posthog-js 1.311.0 → 1.312.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,2 +1,2 @@
1
- function 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;t<arguments.length;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=Object.defineProperty,u=(e,t,r)=>((e,t,r)=>t in e?l(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r)(e,"symbol"!=typeof t?t+"":t,r),c=(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))(c||{}),d={Node:["childNodes","parentNode","parentElement","textContent"],ShadowRoot:["host","styleSheets"],Element:["shadowRoot","querySelector","querySelectorAll"],MutationObserver:[]},h={Node:["contains","getRootNode"],ShadowRoot:["getSelection"],Element:[],MutationObserver:["constructor"]};var p={};function v(e){if(p[e])return p[e];var t=function(e){var t,r=null==globalThis||null==(t=globalThis.Zone)||null==t.__symbol__?void 0:t.__symbol__(e);return r&&globalThis[r]?globalThis[r]:void 0}(e)||globalThis[e],r=t.prototype,i=e in d?d[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 h?h[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 p[e]=t.prototype,t.prototype;try{var a=document.createElement("iframe");document.body.appendChild(a);var l=a.contentWindow;if(!l)return t.prototype;var u=l[e].prototype;return document.body.removeChild(a),u?p[e]=u:t.prototype}catch(e){return t.prototype}}var g={};function _(e,t,r){var i,n=e+"."+String(r);if(g[n])return g[n].call(t);var s=v(e),o=null==(i=Object.getOwnPropertyDescriptor(s,r))?void 0:i.get;return o?(g[n]=o,o.call(t)):t[r]}var f={};function m(e,t,r){var i=e+"."+String(r);if(f[i])return f[i].bind(t);var n=v(e)[r];return"function"!=typeof n?t[r]:(f[i]=n,n.bind(t))}var y={childNodes:function(e){return _("Node",e,"childNodes")},parentNode:function(e){return _("Node",e,"parentNode")},parentElement:function(e){return _("Node",e,"parentElement")},textContent:function(e){return _("Node",e,"textContent")},contains:function(e,t){return m("Node",e,"contains")(t)},getRootNode:function(e){return m("Node",e,"getRootNode")()},host:function(e){return e&&"host"in e?_("ShadowRoot",e,"host"):null},styleSheets:function(e){return e.styleSheets},shadowRoot:function(e){return e&&"shadowRoot"in e?_("Element",e,"shadowRoot"):null},querySelector:function(e,t){return _("Element",e,"querySelector")(t)},querySelectorAll:function(e,t){return _("Element",e,"querySelectorAll")(t)},mutationObserver:function(){return v("MutationObserver").constructor}};function b(e){return e.nodeType===e.ELEMENT_NODE}function S(e){var t=e&&"host"in e&&"mode"in e&&y.host(e)||null;return Boolean(t&&"shadowRoot"in t&&y.shadowRoot(t)===e)}function w(e){return"[object ShadowRoot]"===Object.prototype.toString.call(e)}function C(e){try{var t=e.rules||e.cssRules;if(!t)return null;var r=Array.from(t,(t=>I(t,e.href))).join("");return(i=r).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 I(e,t){if(function(e){return"styleSheet"in e}(e)){var r;try{r=C(e.styleSheet)||function(e){var{cssText:t}=e;if(t.split('"').length<3)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){r=e.cssText}return e.styleSheet.href?O(r,e.styleSheet.href):r}var i,n=e.cssText;return function(e){return"selectorText"in e}(e)&&e.selectorText.includes(":")&&(i=/(\[(?:[\w-]+)[^\\])(:(?:[\w-]+)\])/gm,n=n.replace(i,"$1\\$2")),t?O(n,t):n}function k(e,t){return Array.from(e.styleSheets).find((e=>e.href===t))}let E=class{constructor(){u(this,"idNodeMap",new Map),u(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);this.idNodeMap.delete(t),e.childNodes&&e.childNodes.forEach((e=>this.removeNodeFromMap(e)))}has(e){return this.idNodeMap.has(e)}hasNode(e){return this.nodeMetaMap.has(e)}add(e,t){var r=t.id;this.idNodeMap.set(r,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 x(e){var{element:t,maskInputOptions:r,tagName:i,type:n,value:s,maskInputFn:o}=e,a=s||"",l=n&&T(n);return(r[i.toLowerCase()]||l&&r[l])&&(a=o?o(a,t):"*".repeat(a.length)),a}function T(e){return e.toLowerCase()}var M="__rrweb_original__";function R(e){var t=e.type;return e.hasAttribute("data-rr-is-password")?"password":t?T(t):null}function P(e,t){var r,i;try{i=new URL(e,null!=t?t: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}var A=/url\((?:(')([^']*)'|(")(.*?)"|([^)]*))\)/gm,N=/^(?:[a-z+]+:)?\/\//i,F=/^www\..*/i,L=/^(data:)([^,]*),(.*)/i;function O(e,t){return(e||"").replace(A,((e,r,i,n,s,o)=>{var a,l=i||s||o,u=r||n||"";if(!l)return e;if(N.test(l)||F.test(l))return"url("+u+l+u+")";if(L.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 c=t.split("/"),d=l.split("/");for(var h of(c.pop(),d))"."!==h&&(".."===h?c.pop():c.push(h));return"url("+u+c.join("/")+u+")"}))}var D,H,q=1,B=new RegExp("[^a-z0-9-_:]"),V=-2;function U(){return q++}var W=/^[^ \t\n\r\u000c]+/,z=/^[, \t\n\r\u000c]+/;var j=new WeakMap;function Z(e,t){return t&&""!==t.trim()?Y(e,t):t}function G(e){return Boolean("svg"===e.tagName||e.ownerSVGElement)}function Y(e,t){var r=j.get(e);if(r||(r=e.createElement("a"),j.set(e,r)),t){if(t.startsWith("blob:")||t.startsWith("data:"))return t}else t="";return r.setAttribute("href",t),r.href}function X(e,t,r,i){return i?"src"===r||"href"===r&&("use"!==t||"#"!==i[0])||"xlink:href"===r&&"#"!==i[0]?Z(e,i):"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?(i=n[0],r+=i.length,i):""}for(var n=[];i(z),!(r>=t.length);){var s=i(W);if(","===s.slice(-1))s=Z(e,s.substring(0,s.length-1)),n.push(s);else{var o="";s=Z(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?O(i,Y(e)):"object"===t&&"data"===r?Z(e,i):i:Z(e,i):i}function K(e,t,r){return("video"===e||"audio"===e)&&"autoplay"===t}function J(e,t,r){if(!e)return!1;if(e.nodeType!==e.ELEMENT_NODE)return!!r&&J(y.parentNode(e),t,r);for(var i=e.classList.length;i--;){var n=e.classList[i];if(t.test(n))return!0}return!!r&&J(y.parentNode(e),t,r)}function Q(e,t,r,i){var n;if(b(e)){if(n=e,!y.childNodes(n).length)return!1}else{if(null===y.parentElement(e))return!1;n=y.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(J(n,t,i))return!0;if(r)if(i){if(n.closest(r))return!0}else if(n.matches(r))return!0}catch(e){}return!1}function ee(e,t){var{doc:r,mirror:i,blockClass:n,blockSelector:s,needsMask:o,inlineStylesheet:a,maskInputOptions:l={},maskTextFn:u,maskInputFn:d,dataURLOptions:h={},inlineImages:p,recordCanvas:v,keepIframeSrcFn:g,newlyAddedElement:_=!1}=t,f=function(e,t){if(!t.hasNode(e))return;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:c.Document,childNodes:[],compatMode:e.compatMode}:{type:c.Document,childNodes:[]};case e.DOCUMENT_TYPE_NODE:return{type:c.DocumentType,name:e.name,publicId:e.publicId,systemId:e.systemId,rootId:f};case e.ELEMENT_NODE:return function(e,t){for(var r,{doc:i,blockClass:n,blockSelector:s,inlineStylesheet:o,maskInputOptions:a={},maskInputFn:l,dataURLOptions:u={},inlineImages:d,recordCanvas:h,keepIframeSrcFn:p,newlyAddedElement:v=!1,rootId:g}=t,_=function(e,t,r){try{if("string"==typeof t){if(e.classList.contains(t))return!0}else for(var i=e.classList.length;i--;){var n=e.classList[i];if(t.test(n))return!0}if(r)return e.matches(r)}catch(e){}return!1}(e,n,s),f=function(e){if(e instanceof HTMLFormElement)return"form";var t=T(e.tagName);return B.test(t)?"div":t}(e),m={},b=e.attributes.length,S=0;S<b;S++){var w=e.attributes[S];K(f,w.name,w.value)||(m[w.name]=X(i,f,T(w.name),w.value))}if("link"===f&&o){var I=function(e){return null==e?void 0:e.href}(e);if(I){var E=k(i,I);if(!E&&I.includes(".css"))E=k(i,window.location.origin+"/"+I.replace(window.location.href,""));var P=null;E&&(P=C(E)),P&&(delete m.rel,delete m.href,m._cssText=P)}}if("style"===f&&e.sheet&&!(e.innerText||y.textContent(e)||"").trim().length){var A=C(e.sheet);A&&(m._cssText=A)}if("input"===f||"textarea"===f||"select"===f){var N=e.value,F=e.checked;"radio"!==m.type&&"checkbox"!==m.type&&"submit"!==m.type&&"button"!==m.type&&N?m.value=x({element:e,type:R(e),tagName:f,value:N,maskInputOptions:a,maskInputFn:l}):F&&(m.checked=F)}"option"===f&&(e.selected&&!a.select?m.selected=!0:delete m.selected);if("dialog"===f&&e.open)try{m.rr_open_mode=e.matches("dialog:modal")?"modal":"non-modal"}catch(e){m.rr_open_mode="modal",m.ph_rr_could_not_detect_modal=!0}if("canvas"===f&&h)if("2d"===e.__context)(function(e){var t=e.getContext("2d");if(!t)return!0;for(var r=0;r<e.width;r+=50)for(var i=0;i<e.height;i+=50){var n=t.getImageData,s=M in n?n[M]:n;if(new Uint32Array(s.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)||(m.rr_dataURL=e.toDataURL(u.type,u.quality));else if(!("__context"in e)){var L=e.toDataURL(u.type,u.quality),O=i.createElement("canvas");O.width=e.width,O.height=e.height,L!==O.toDataURL(u.type,u.quality)&&(m.rr_dataURL=L)}if("img"===f&&d){D||(D=i.createElement("canvas"),H=D.getContext("2d"));var q=e,V=q.currentSrc||q.getAttribute("src")||"<unknown-src>",U=q.crossOrigin,W=()=>{q.removeEventListener("load",W);try{D.width=q.naturalWidth,D.height=q.naturalHeight,H.drawImage(q,0,0),m.rr_dataURL=D.toDataURL(u.type,u.quality)}catch(e){if("anonymous"!==q.crossOrigin)return q.crossOrigin="anonymous",void(q.complete&&0!==q.naturalWidth?W():q.addEventListener("load",W));console.warn("Cannot inline img src="+V+"! Error: "+e)}"anonymous"===q.crossOrigin&&(U?m.crossOrigin=U:q.removeAttribute("crossorigin"))};q.complete&&0!==q.naturalWidth?W():q.addEventListener("load",W)}if("audio"===f||"video"===f){var z=m;z.rr_mediaState=e.paused?"paused":"played",z.rr_mediaCurrentTime=e.currentTime,z.rr_mediaPlaybackRate=e.playbackRate,z.rr_mediaMuted=e.muted,z.rr_mediaLoop=e.loop,z.rr_mediaVolume=e.volume}v||(e.scrollLeft&&(m.rr_scrollLeft=e.scrollLeft),e.scrollTop&&(m.rr_scrollTop=e.scrollTop));if(_){var{width:j,height:Z}=e.getBoundingClientRect();m={class:m.class,rr_width:j+"px",rr_height:Z+"px"}}"iframe"!==f||p(m.src)||(e.contentDocument||(m.rr_src=m.src),delete m.src);try{customElements.get(f)&&(r=!0)}catch(e){}return{type:c.Element,tagName:f,attributes:m,childNodes:[],isSVG:G(e)||void 0,needBlock:_,rootId:g,isCustom:r}}(e,{doc:r,blockClass:n,blockSelector:s,inlineStylesheet:a,maskInputOptions:l,maskInputFn:d,dataURLOptions:h,inlineImages:p,recordCanvas:v,keepIframeSrcFn:g,newlyAddedElement:_,rootId:f});case e.TEXT_NODE:return function(e,t){var r,{needsMask:i,maskTextFn:n,rootId:s}=t,o=y.parentNode(e),a=o&&o.tagName,l=y.textContent(e),u="STYLE"===a||void 0,d="SCRIPT"===a||void 0;if(u&&l){try{e.nextSibling||e.previousSibling||(null==(r=o.sheet)?void 0:r.cssRules)&&(l=C(o.sheet))}catch(t){console.warn("Cannot get CSS styles from text's parentNode. Error: "+t,e)}l=O(l,Y(t.doc))}d&&(l="SCRIPT_PLACEHOLDER");!u&&!d&&l&&i&&(l=n?n(l,y.parentElement(e)):l.replace(/[\S]/g,"*"));return{type:c.Text,textContent:l||"",isStyle:u,rootId:s}}(e,{doc:r,needsMask:o,maskTextFn:u,rootId:f});case e.CDATA_SECTION_NODE:return{type:c.CDATA,textContent:"",rootId:f};case e.COMMENT_NODE:return{type:c.Comment,textContent:y.textContent(e)||"",rootId:f};default:return!1}}function te(e){return null==e?"":e.toLowerCase()}function re(e,t){var{doc:r,mirror:i,blockClass:n,blockSelector:s,maskTextClass:o,maskTextSelector:a,skipChild:l=!1,inlineStylesheet:u=!0,maskInputOptions:d={},maskTextFn:h,maskInputFn:p,slimDOMOptions:v,dataURLOptions:g={},inlineImages:_=!1,recordCanvas:f=!1,onSerialize:m,onIframeLoad:C,iframeLoadTimeout:I=5e3,onStylesheetLoad:k,stylesheetLoadTimeout:E=5e3,keepIframeSrcFn:x=(()=>!1),newlyAddedElement:T=!1}=t,{needsMask:M}=t,{preserveWhiteSpace:R=!0}=t;M||(M=Q(e,o,a,void 0===M));var A,N=ee(e,{doc:r,mirror:i,blockClass:n,blockSelector:s,needsMask:M,inlineStylesheet:u,maskInputOptions:d,maskTextFn:h,maskInputFn:p,dataURLOptions:g,inlineImages:_,recordCanvas:f,keepIframeSrcFn:x,newlyAddedElement:T});if(!N)return console.warn(e,"not serialized"),null;A=i.hasNode(e)?i.getId(e):!function(e,t){if(t.comment&&e.type===c.Comment)return!0;if(e.type===c.Element){if(t.script&&("script"===e.tagName||"link"===e.tagName&&("preload"===e.attributes.rel||"modulepreload"===e.attributes.rel)&&"script"===e.attributes.as||"link"===e.tagName&&"prefetch"===e.attributes.rel&&"string"==typeof e.attributes.href&&"js"===P(e.attributes.href)))return!0;if(t.headFavicon&&("link"===e.tagName&&"shortcut icon"===e.attributes.rel||"meta"===e.tagName&&(te(e.attributes.name).match(/^msapplication-tile(image|color)$/)||"application-name"===te(e.attributes.name)||"icon"===te(e.attributes.rel)||"apple-touch-icon"===te(e.attributes.rel)||"shortcut icon"===te(e.attributes.rel))))return!0;if("meta"===e.tagName){if(t.headMetaDescKeywords&&te(e.attributes.name).match(/^description|keywords$/))return!0;if(t.headMetaSocial&&(te(e.attributes.property).match(/^(og|twitter|fb):/)||te(e.attributes.name).match(/^(og|twitter):/)||"pinterest"===te(e.attributes.name)))return!0;if(t.headMetaRobots&&("robots"===te(e.attributes.name)||"googlebot"===te(e.attributes.name)||"bingbot"===te(e.attributes.name)))return!0;if(t.headMetaHttpEquiv&&void 0!==e.attributes["http-equiv"])return!0;if(t.headMetaAuthorship&&("author"===te(e.attributes.name)||"generator"===te(e.attributes.name)||"framework"===te(e.attributes.name)||"publisher"===te(e.attributes.name)||"progid"===te(e.attributes.name)||te(e.attributes.property).match(/^article:/)||te(e.attributes.property).match(/^product:/)))return!0;if(t.headMetaVerification&&("google-site-verification"===te(e.attributes.name)||"yandex-verification"===te(e.attributes.name)||"csrf-token"===te(e.attributes.name)||"p:domain_verify"===te(e.attributes.name)||"verify-v1"===te(e.attributes.name)||"verification"===te(e.attributes.name)||"shopify-checkout-api-token"===te(e.attributes.name)))return!0}}return!1}(N,v)&&(R||N.type!==c.Text||N.isStyle||N.textContent.replace(/^\s+|\s+$/gm,"").length)?U():V;var F=Object.assign(N,{id:A});if(i.add(e,F),A===V)return null;m&&m(e);var L=!l;if(F.type===c.Element){L=L&&!F.needBlock,delete F.needBlock;var O=y.shadowRoot(e);O&&w(O)&&(F.isShadowHost=!0)}if((F.type===c.Document||F.type===c.Element)&&L){v.headWhitespace&&F.type===c.Element&&"head"===F.tagName&&(R=!1);var D={doc:r,mirror:i,blockClass:n,blockSelector:s,needsMask:M,maskTextClass:o,maskTextSelector:a,skipChild:l,inlineStylesheet:u,maskInputOptions:d,maskTextFn:h,maskInputFn:p,slimDOMOptions:v,dataURLOptions:g,inlineImages:_,recordCanvas:f,preserveWhiteSpace:R,onSerialize:m,onIframeLoad:C,iframeLoadTimeout:I,onStylesheetLoad:k,stylesheetLoadTimeout:E,keepIframeSrcFn:x};if(F.type===c.Element&&"textarea"===F.tagName&&void 0!==F.attributes.value);else for(var H of Array.from(y.childNodes(e))){var q=re(H,D);q&&F.childNodes.push(q)}var B=null;if(b(e)&&(B=y.shadowRoot(e)))for(var W of Array.from(y.childNodes(B))){var z=re(W,D);z&&(w(B)&&(z.isShadow=!0),F.childNodes.push(z))}}var j=y.parentNode(e);return j&&S(j)&&w(j)&&(F.isShadow=!0),F.type===c.Element&&"iframe"===F.tagName&&function(e,t,r){var i=e.contentWindow;if(i){var n,s=!1;try{n=i.document.readyState}catch(e){return}if("complete"===n){var o="about:blank";if(i.location.href!==o||e.src===o||""===e.src)return setTimeout(t,0),e.addEventListener("load",t);e.addEventListener("load",t)}else{var a=setTimeout((()=>{s||(t(),s=!0)}),r);e.addEventListener("load",(()=>{clearTimeout(a),s=!0,t()}))}}}(e,(()=>{var t=e.contentDocument;if(t&&C){var r=re(t,{doc:t,mirror:i,blockClass:n,blockSelector:s,needsMask:M,maskTextClass:o,maskTextSelector:a,skipChild:!1,inlineStylesheet:u,maskInputOptions:d,maskTextFn:h,maskInputFn:p,slimDOMOptions:v,dataURLOptions:g,inlineImages:_,recordCanvas:f,preserveWhiteSpace:R,onSerialize:m,onIframeLoad:C,iframeLoadTimeout:I,onStylesheetLoad:k,stylesheetLoadTimeout:E,keepIframeSrcFn:x});r&&C(e,r)}}),I),F.type===c.Element&&"link"===F.tagName&&"string"==typeof F.attributes.rel&&("stylesheet"===F.attributes.rel||"preload"===F.attributes.rel&&"string"==typeof F.attributes.href&&"css"===P(F.attributes.href))&&function(e,t,r){var i,n=!1;try{i=e.sheet}catch(e){return}if(!i){var s=setTimeout((()=>{n||(t(),n=!0)}),r);e.addEventListener("load",(()=>{clearTimeout(s),n=!0,t()}))}}(e,(()=>{if(k){var t=re(e,{doc:r,mirror:i,blockClass:n,blockSelector:s,needsMask:M,maskTextClass:o,maskTextSelector:a,skipChild:!1,inlineStylesheet:u,maskInputOptions:d,maskTextFn:h,maskInputFn:p,slimDOMOptions:v,dataURLOptions:g,inlineImages:_,recordCanvas:f,preserveWhiteSpace:R,onSerialize:m,onIframeLoad:C,iframeLoadTimeout:I,onStylesheetLoad:k,stylesheetLoadTimeout:E,keepIframeSrcFn:x});t&&k(e,t)}}),E),F}let ie=class e{constructor(){__publicField2(this,"parentElement",null),__publicField2(this,"parentNode",null),__publicField2(this,"ownerDocument"),__publicField2(this,"firstChild",null),__publicField2(this,"lastChild",null),__publicField2(this,"previousSibling",null),__publicField2(this,"nextSibling",null),__publicField2(this,"ELEMENT_NODE",1),__publicField2(this,"TEXT_NODE",3),__publicField2(this,"nodeType"),__publicField2(this,"nodeName"),__publicField2(this,"RRNodeType")}get childNodes(){for(var e=[],t=this.firstChild;t;)e.push(t),t=t.nextSibling;return e}contains(t){if(!(t instanceof e))return!1;if(t.ownerDocument!==this.ownerDocument)return!1;if(t===this)return!0;for(;t.parentNode;){if(t.parentNode===this)return!0;t=t.parentNode}return!1}appendChild(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"}};var ne={Node:["childNodes","parentNode","parentElement","textContent"],ShadowRoot:["host","styleSheets"],Element:["shadowRoot","querySelector","querySelectorAll"],MutationObserver:[]},se={Node:["contains","getRootNode"],ShadowRoot:["getSelection"],Element:[],MutationObserver:["constructor"]};var oe={};function ae(e){if(oe[e])return oe[e];var t=function(e){var t,r=null==globalThis||null==(t=globalThis.Zone)||null==t.__symbol__?void 0:t.__symbol__(e);return r&&globalThis[r]?globalThis[r]:void 0}(e)||globalThis[e],r=t.prototype,i=e in ne?ne[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 se?se[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 oe[e]=t.prototype,t.prototype;try{var a=document.createElement("iframe");document.body.appendChild(a);var l=a.contentWindow;if(!l)return t.prototype;var u=l[e].prototype;return document.body.removeChild(a),u?oe[e]=u:r}catch(e){return r}}var le={};function ue(e,t,r){var i,n=e+"."+String(r);if(le[n])return le[n].call(t);var s=ae(e),o=null==(i=Object.getOwnPropertyDescriptor(s,r))?void 0:i.get;return o?(le[n]=o,o.call(t)):t[r]}var ce={};function de(e,t,r){var i=e+"."+String(r);if(ce[i])return ce[i].bind(t);var n=ae(e)[r];return"function"!=typeof n?t[r]:(ce[i]=n,n.bind(t))}function he(){return ae("MutationObserver").constructor}var pe={childNodes:function(e){return ue("Node",e,"childNodes")},parentNode:function(e){return ue("Node",e,"parentNode")},parentElement:function(e){return ue("Node",e,"parentElement")},textContent:function(e){return ue("Node",e,"textContent")},contains:function(e,t){return de("Node",e,"contains")(t)},getRootNode:function(e){return de("Node",e,"getRootNode")()},host:function(e){return e&&"host"in e?ue("ShadowRoot",e,"host"):null},styleSheets:function(e){return e.styleSheets},shadowRoot:function(e){return e&&"shadowRoot"in e?ue("Element",e,"shadowRoot"):null},querySelector:function(e,t){return ue("Element",e,"querySelector")(t)},querySelectorAll:function(e,t){return ue("Element",e,"querySelectorAll")(t)},mutationObserver:he};function ve(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)}var ge="Please stop import mirror directly. Instead of that,\r\nnow you can use replayer.getMirror() to access the mirror instance of a replayer,\r\nor you can use record.mirror to access the mirror instance during recording.",_e={map:{},getId:()=>(console.error(ge),-1),getNode:()=>(console.error(ge),null),removeNodeFromMap(){console.error(ge)},has:()=>(console.error(ge),!1),reset(){console.error(ge)}};function fe(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;a<s;a++)o[a]=arguments[a];var l=Date.now();n||!1!==r.leading||(n=l);var u=t-(l-n),c=this;u<=0||u>t?(i&&(clearTimeout(i),i=null),n=l,e.apply(c,o)):i||!1===r.trailing||(i=setTimeout((()=>{n=!1===r.leading?0:Date.now(),i=null,e.apply(c,o)}),u))}}function me(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)}}),()=>me(e,t,s||{},!0)}function ye(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()=>{}}}"undefined"!=typeof window&&window.Proxy&&window.Reflect&&(_e=new Proxy(_e,{get:(e,t,r)=>("map"===t&&console.error(ge),Reflect.get(e,t,r))}));var be=Date.now;function Se(e){var t,r,i,n,s=e.document;return{left:s.scrollingElement?s.scrollingElement.scrollLeft:void 0!==e.pageXOffset?e.pageXOffset:s.documentElement.scrollLeft||(null==s?void 0:s.body)&&(null==(t=pe.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=pe.parentElement(s.body))?void 0:i.scrollTop)||(null==(n=null==s?void 0:s.body)?void 0:n.scrollTop)||0}}function we(){return window.innerHeight||document.documentElement&&document.documentElement.clientHeight||document.body&&document.body.clientHeight}function Ce(){return window.innerWidth||document.documentElement&&document.documentElement.clientWidth||document.body&&document.body.clientWidth}function Ie(e){return e?e.nodeType===e.ELEMENT_NODE?e:pe.parentElement(e):null}function ke(e,t,r,i){if(!e)return!1;var n=Ie(e);if(!n)return!1;try{if("string"==typeof t){if(n.classList.contains(t))return!0;if(i&&null!==n.closest("."+t))return!0}else if(J(n,t,i))return!0}catch(e){}if(r){if(n.matches(r))return!0;if(i&&null!==n.closest(r))return!0}return!1}function Ee(e,t,r){return!("TITLE"!==e.tagName||!r.headTitleMutations)||t.getId(e)===V}function xe(e,t){if(S(e))return!1;var r=t.getId(e);if(!t.has(r))return!0;var i=pe.parentNode(e);return(!i||i.nodeType!==e.DOCUMENT_NODE)&&(!i||xe(i,t))}function Te(e){return Boolean(e.changedTouches)}function Me(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 Pe(e){return!!e&&(e instanceof ie&&"shadowRoot"in e?Boolean(e.shadowRoot):Boolean(pe.shadowRoot(e)))}/[1-9][0-9]{12}/.test(Date.now().toString())||(be=()=>(new Date).getTime());let Ae=class{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 Ne(e){var t,r=null;return"getRootNode"in e&&(null==(t=pe.getRootNode(e))?void 0:t.nodeType)===Node.DOCUMENT_FRAGMENT_NODE&&pe.host(pe.getRootNode(e))&&(r=pe.host(pe.getRootNode(e))),r}function Fe(e){var t=e.ownerDocument;if(!t)return!1;var r=function(e){for(var t,r=e;t=Ne(r);)r=t;return r}(e);return pe.contains(t,r)}function Le(e){var t=e.ownerDocument;return!!t&&(pe.contains(t,e)||Fe(e))}var Oe=(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))(Oe||{}),De=(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))(De||{}),He=(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))(He||{}),qe=(e=>(e[e.Mouse=0]="Mouse",e[e.Pen=1]="Pen",e[e.Touch=2]="Touch",e))(qe||{}),Be=(e=>(e[e["2D"]=0]="2D",e[e.WebGL=1]="WebGL",e[e.WebGL2=2]="WebGL2",e))(Be||{}),Ve=(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))(Ve||{});function $e(e){return"__ln"in e}class Ue{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;r<e;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 We,ze=(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,"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,"processMutations",(e=>{e.forEach(this.processMutation),this.emit()})),a(this,"emit",(()=>{if(!this.frozen&&!this.locked){for(var e=[],t=new Set,r=new Ue,i=e=>{for(var t=e,r=V;r===V;)r=(t=t&&t.nextSibling)&&this.mirror.getId(t);return r},n=n=>{var s=pe.parentNode(n);if(s&&Le(n)&&"TEXTAREA"!==s.tagName){var o=S(s)?this.mirror.getId(Ne(n)):this.mirror.getId(s),a=i(n);if(-1===o||-1===a)return r.addNode(n);var l=re(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=>{Me(e,this.mirror)&&this.iframeManager.addIframe(e),Re(e,this.mirror)&&this.stylesheetManager.trackLinkElement(e),Pe(n)&&this.shadowDomManager.addShadowRoot(pe.shadowRoot(n),this.doc)},onIframeLoad:(e,t)=>{this.iframeManager.attachIframe(e,t),this.shadowDomManager.observeAttachShadow(e)},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)Ge(this.removes,s,this.mirror)&&!this.movedSet.has(pe.parentNode(s))||n(s);for(var o of this.addedSet)Ye(this.droppedSet,o)||Ge(this.removes,o,this.mirror)?Ye(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(pe.parentNode(a.value)),c=i(a.value);-1!==u&&-1!==c&&(l=a)}if(!l)for(var d=r.tail;d;){var h=d;if(d=d.previous,h){var p=this.mirror.getId(pe.parentNode(h.value));if(-1===i(h.value))continue;if(-1!==p){l=h;break}var v=h.value,g=pe.parentNode(v);if(g&&g.nodeType===Node.DOCUMENT_FRAGMENT_NODE){var _=pe.host(g);if(-1!==this.mirror.getId(_)){l=h;break}}}}if(!l){for(;r.head;)r.removeNode(r.head.value);break}a=l.previous,r.removeNode(l.value),n(l.value)}var f={texts:this.texts.map((e=>{var t=e.node,r=pe.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);r.length<t.style.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};(f.texts.length||f.attributes.length||f.removes.length||f.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.movedMap={},this.mutationCb(f))}})),a(this,"genTextAreaValueMutation",(e=>{var t=this.attributeMap.get(e);t||(t={node:e,attributes:{},styleDiff:{},_unchangedStyles:{}},this.attributes.push(t),this.attributeMap.set(e,t)),t.attributes.value=Array.from(pe.childNodes(e),(e=>pe.textContent(e)||"")).join("")})),a(this,"processMutation",(e=>{if(!Ee(e.target,this.mirror,this.slimDOMOptions))switch(e.type){case"characterData":var t=pe.textContent(e.target);ke(e.target,this.blockClass,this.blockSelector,!1)||t===e.oldValue||this.texts.push({value:Q(e.target,this.maskTextClass,this.maskTextSelector,!0)&&t?this.maskTextFn?this.maskTextFn(t,Ie(e.target)):t.replace(/[\S]/g,"*"):t,node:e.target});break;case"attributes":var r=e.target,i=e.attributeName,n=e.target.getAttribute(i);if("value"===i){var s=R(r);n=x({element:r,maskInputOptions:this.maskInputOptions,tagName:r.tagName,type:s,value:n,maskInputFn:this.maskInputFn})}if(ke(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||(o={node:e.target,attributes:{},styleDiff:{},_unchangedStyles:{}},this.attributes.push(o),this.attributeMap.set(e.target,o)),"type"===i&&"INPUT"===r.tagName&&"password"===(e.oldValue||"").toLowerCase()&&r.setAttribute("data-rr-is-password","true"),!K(r.tagName,i))if(o.attributes[i]=X(this.doc,T(r.tagName),T(i),n),"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.setAttribute("style",e.oldValue),Array.from(r.style))){var u=r.style.getPropertyValue(l),c=r.style.getPropertyPriority(l);u!==a.style.getPropertyValue(l)||c!==a.style.getPropertyPriority(l)?o.styleDiff[l]=""===c?u:[u,c]:o._unchangedStyles[l]=[u,c]}for(var d of Array.from(a.style))""===r.style.getPropertyValue(d)&&(o.styleDiff[d]=!1)}else"open"===i&&"DIALOG"===r.tagName&&(r.matches("dialog:modal")?o.attributes.rr_open_mode="modal":o.attributes.rr_open_mode="non-modal");break;case"childList":if(ke(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=S(e.target)?this.mirror.getId(pe.host(e.target)):this.mirror.getId(e.target);ke(e.target,this.blockClass,this.blockSelector,!1)||Ee(t,this.mirror,this.slimDOMOptions)||!function(e,t){return-1!==t.getId(e)}(t,this.mirror)||(this.addedSet.has(t)?(Ze(this.addedSet,t),this.droppedSet.add(t)):this.addedSet.has(e.target)&&-1===r||xe(e.target,this.mirror)||(this.movedSet.has(t)&&this.movedMap[ze(r,i)]?Ze(this.movedSet,t):this.removes.push({parentId:i,id:r,isShadow:!(!S(e.target)||!w(e.target))||void 0})),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(Ee(e,this.mirror,this.slimDOMOptions))return;this.movedSet.add(e);var r=null;t&&this.mirror.hasNode(t)&&(r=this.mirror.getId(t)),r&&-1!==r&&(this.movedMap[ze(this.mirror.getId(e),r)]=!0)}else this.addedSet.add(e),this.droppedSet.delete(e);ke(e,this.blockClass,this.blockSelector,!1)||(pe.childNodes(e).forEach((e=>this.genAdds(e))),Pe(e)&&pe.childNodes(pe.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]}))}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.canvasManager.reset()}}function Ze(e,t){e.delete(t),pe.childNodes(t).forEach((t=>Ze(e,t)))}function Ge(e,t,r){return 0!==e.length&&function(e,t,r){var i,n=pe.parentNode(t),s=function(){var t=r.getId(n);if(e.some((e=>e.id===t)))return{v:!0};n=pe.parentNode(n)};for(;n;)if(i=s())return i.v;return!1}(e,t,r)}function Ye(e,t){return 0!==e.size&&Xe(e,t)}function Xe(e,t){var r=pe.parentNode(t);return!!r&&(!!e.has(r)||Xe(e,r))}var Ke=e=>{if(!We)return e;return function(){try{return e(...arguments)}catch(e){if(We&&!0===We(e))return;throw e}}},Je=[];function Qe(e){try{if("composedPath"in e){var t=e.composedPath();if(t.length)return t[0]}else if("path"in e&&e.path.length)return e.path[0]}catch(e){}return e&&e.target}function et(e,t){var r=new je;Je.push(r),r.init(e);var i=new(he())(Ke(r.processMutations.bind(r)));return i.observe(t,{attributes:!0,attributeOldValue:!0,characterData:!0,characterDataOldValue:!0,childList:!0,subtree:!0}),i}function tt(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(He).filter((e=>Number.isNaN(Number(e))&&!e.endsWith("_Departed")&&!1!==l[e])).forEach((e=>{var a=T(e),l=(e=>i=>{var a=Qe(i);if(!ke(a,s,o,!0)){var l=null,u=e;if("pointerType"in i){switch(i.pointerType){case"mouse":l=qe.Mouse;break;case"touch":l=qe.Touch;break;case"pen":l=qe.Pen}l===qe.Touch?He[e]===He.MouseDown?u="TouchStart":He[e]===He.MouseUp&&(u="TouchEnd"):qe.Pen}else Te(i)&&(l=qe.Touch);null!==l?(c=l,(u.startsWith("Touch")&&l===qe.Touch||u.startsWith("Mouse")&&l===qe.Mouse)&&(l=null)):He[e]===He.Click&&(l=c,c=null);var d=Te(i)?i.changedTouches[0]:i;if(d){var h=n.getId(a),{clientX:p,clientY:v}=d;Ke(t)(r({type:He[u],id:h,x:p,y:v},null!==l&&{pointerType:l}))}}})(e);if(window.PointerEvent)switch(He[e]){case He.MouseDown:case He.MouseUp:a=a.replace("mouse","pointer");break;case He.TouchStart:case He.TouchEnd:return}u.push(ve(a,l,i))})),Ke((()=>{u.forEach((e=>e()))}))}function rt(e){var{scrollCb:t,doc:r,mirror:i,blockClass:n,blockSelector:s,sampling:o}=e;return ve("scroll",Ke(fe(Ke((e=>{var o=Qe(e);if(o&&!ke(o,n,s,!0)){var a=i.getId(o);if(o===r&&r.defaultView){var l=Se(r.defaultView);t({id:a,x:l.left,y:l.top})}else t({id:a,x:o.scrollLeft,y:o.scrollTop})}})),o.scroll||100)),r)}var it=["INPUT","TEXTAREA","SELECT"],nt=new WeakMap;function st(e){return function(e,t){if(ut("CSSGroupingRule")&&e.parentRule instanceof CSSGroupingRule||ut("CSSMediaRule")&&e.parentRule instanceof CSSMediaRule||ut("CSSSupportsRule")&&e.parentRule instanceof CSSSupportsRule||ut("CSSConditionRule")&&e.parentRule instanceof CSSConditionRule){var r=Array.from(e.parentRule.cssRules).indexOf(e);t.unshift(r)}else if(e.parentStyleSheet){var i=Array.from(e.parentStyleSheet.cssRules).indexOf(e);t.unshift(i)}return t}(e,[])}function ot(e,t,r){var i,n;return e?(e.ownerNode?i=t.getId(e.ownerNode):n=r.getId(e),{styleId:n,id:i}):{}}function at(e,t){var r,i,n,{mirror:s,stylesheetManager:o}=e,a=null;a="#document"===t.nodeName?s.getId(t):s.getId(pe.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!==a&&-1!==a&&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!==a&&-1!==a)try{o.adoptStyleSheets(e,a)}catch(e){}return r}}),Ke((()=>{Object.defineProperty(t,"adoptedStyleSheets",{configurable:u.configurable,enumerable:u.enumerable,get:u.get,set:u.set})}))):()=>{}}function lt(e,t){void 0===t&&(t={});var i,n=e.doc.defaultView;if(!n)return()=>{};!function(e,t){var{mutationCb:r,mousemoveCb:i,mouseInteractionCb:n,scrollCb:s,viewportResizeCb:o,inputCb:a,mediaInteractionCb:l,styleSheetRuleCb:u,styleDeclarationCb:c,canvasMutationCb:d,fontCb:h,selectionCb:p,customElementCb:v}=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),c(...arguments)},e.canvasMutationCb=function(){t.canvasMutation&&t.canvasMutation(...arguments),d(...arguments)},e.fontCb=function(){t.font&&t.font(...arguments),h(...arguments)},e.selectionCb=function(){t.selection&&t.selection(...arguments),p(...arguments)},e.customElementCb=function(){t.customElement&&t.customElement(...arguments),v(...arguments)}}(e,t),e.recordDOM&&(i=et(e,e.doc));var s=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=[],u=fe(Ke((e=>{var r=Date.now()-s;t(l.map((e=>(e.timeOffset-=r,e))),e),l=[],s=null})),a),c=Ke(fe(Ke((e=>{var t=Qe(e),{clientX:r,clientY:i}=Te(e)?e.changedTouches[0]:e;s||(s=be()),l.push({x:r,y:i,id:n.getId(t),timeOffset:be()-s}),u("undefined"!=typeof DragEvent&&e instanceof DragEvent?De.Drag:e instanceof MouseEvent?De.MouseMove:De.TouchMove)})),o,{trailing:!1})),d=[ve("mousemove",c,i),ve("touchmove",c,i),ve("drag",c,i)];return Ke((()=>{d.forEach((e=>e()))}))}(e),o=tt(e),a=rt(e),l=function(e,t){var{viewportResizeCb:r}=e,{win:i}=t,n=-1,s=-1;return ve("resize",Ke(fe(Ke((()=>{var e=we(),t=Ce();n===e&&s===t||(r({width:Number(t),height:Number(e)}),n=e,s=t)})),200)),i)}(e,{win:n}),u=function(e){var{inputCb:t,doc:i,mirror:n,blockClass:s,blockSelector:o,ignoreClass:a,ignoreSelector:l,maskInputOptions:u,maskInputFn:c,sampling:d,userTriggeredOnInput:h}=e;function p(e){var t=Qe(e),r=e.isTrusted,n=t&&t.tagName;if(t&&"OPTION"===n&&(t=pe.parentElement(t)),t&&n&&!(it.indexOf(n)<0)&&!ke(t,s,o,!0)&&!(t.classList.contains(a)||l&&t.matches(l))){var d=t.value,p=!1,g=R(t)||"";"radio"===g||"checkbox"===g?p=t.checked:(u[n.toLowerCase()]||u[g])&&(d=x({element:t,maskInputOptions:u,tagName:n,type:g,value:d,maskInputFn:c})),v(t,h?{text:d,isChecked:p,userTriggered:r}:{text:d,isChecked:p});var _=t.name;"radio"===g&&_&&p&&i.querySelectorAll('input[type="radio"][name="'+_+'"]').forEach((e=>{if(e!==t){var r=e.value;v(e,h?{text:r,isChecked:!p,userTriggered:!1}:{text:r,isChecked:!p})}}))}}function v(e,i){var s=nt.get(e);if(!s||s.text!==i.text||s.isChecked!==i.isChecked){nt.set(e,i);var o=n.getId(e);Ke(t)(r({},i,{id:o}))}}var g=("last"===d.input?["change"]:["input","change"]).map((e=>ve(e,Ke(p),i))),_=i.defaultView;if(!_)return()=>{g.forEach((e=>e()))};var f=_.Object.getOwnPropertyDescriptor(_.HTMLInputElement.prototype,"value"),m=[[_.HTMLInputElement.prototype,"value"],[_.HTMLInputElement.prototype,"checked"],[_.HTMLSelectElement.prototype,"value"],[_.HTMLTextAreaElement.prototype,"value"],[_.HTMLSelectElement.prototype,"selectedIndex"],[_.HTMLOptionElement.prototype,"selected"]];return f&&f.set&&g.push(...m.map((e=>me(e[0],e[1],{set(){Ke(p)({target:this,isTrusted:!1})}},!1,_)))),Ke((()=>{g.forEach((e=>e()))}))}(e),c=function(e){var{mediaInteractionCb:t,blockClass:r,blockSelector:i,mirror:n,sampling:s,doc:o}=e,a=Ke((e=>fe(Ke((s=>{var o=Qe(s);if(o&&!ke(o,r,i,!0)){var{currentTime:a,volume:l,muted:u,playbackRate:c,loop:d}=o;t({type:e,id:n.getId(o),currentTime:a,volume:l,muted:u,playbackRate:c,loop:d})}})),s.media||500))),l=[ve("play",a(Ve.Play),o),ve("pause",a(Ve.Pause),o),ve("seeked",a(Ve.Seeked),o),ve("volumechange",a(Ve.VolumeChange),o),ve("ratechange",a(Ve.RateChange),o)];return Ke((()=>{l.forEach((e=>e()))}))}(e),d=()=>{},h=()=>{},p=()=>{},v=()=>{};e.recordDOM&&(d=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:Ke(((e,t,s)=>{var[o,a]=s,{id:l,styleId:u}=ot(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){void 0===r&&(r=this.cssRules.length);var i=e+" { "+t+" }";return s.CSSStyleSheet.prototype.insertRule.apply(this,[i,r])};var a,l,u=s.CSSStyleSheet.prototype.deleteRule;s.CSSStyleSheet.prototype.deleteRule=new Proxy(u,{apply:Ke(((e,t,s)=>{var[o]=s,{id:a,styleId:l}=ot(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:Ke(((e,t,s)=>{var[o]=s,{id:a,styleId:l}=ot(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:Ke(((e,t,s)=>{var[o]=s,{id:a,styleId:l}=ot(t,i,n.styleMirror);return(a&&-1!==a||l&&-1!==l)&&r({id:a,styleId:l,replaceSync:o}),e.apply(t,s)}))}));var c={};ct("CSSGroupingRule")?c.CSSGroupingRule=s.CSSGroupingRule:(ct("CSSMediaRule")&&(c.CSSMediaRule=s.CSSMediaRule),ct("CSSConditionRule")&&(c.CSSConditionRule=s.CSSConditionRule),ct("CSSSupportsRule")&&(c.CSSSupportsRule=s.CSSSupportsRule));var d={};return Object.entries(c).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:Ke(((e,t,s)=>{var[o,a]=s,{id:l,styleId:u}=ot(t.parentStyleSheet,i,n.styleMirror);return(l&&-1!==l||u&&-1!==u)&&r({id:l,styleId:u,adds:[{rule:o,index:[...st(t),a||0]}]}),e.apply(t,s)}))}),s.prototype.deleteRule=new Proxy(d[t].deleteRule,{apply:Ke(((e,t,s)=>{var[o]=s,{id:a,styleId:l}=ot(t.parentStyleSheet,i,n.styleMirror);return(a&&-1!==a||l&&-1!==l)&&r({id:a,styleId:l,removes:[{index:[...st(t),o]}]}),e.apply(t,s)}))})})),Ke((()=>{s.CSSStyleSheet.prototype.insertRule=o,s.CSSStyleSheet.prototype.deleteRule=u,a&&(s.CSSStyleSheet.prototype.replace=a),l&&(s.CSSStyleSheet.prototype.replaceSync=l),Object.entries(c).forEach((e=>{var[t,r]=e;r.prototype.insertRule=d[t].insertRule,r.prototype.deleteRule=d[t].deleteRule}))}))}(e,{win:n}),h=at(e,e.doc),p=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:Ke(((e,t,o)=>{var l,[u,c,d]=o;if(n.has(u))return a.apply(t,[u,c,d]);var{id:h,styleId:p}=ot(null==(l=t.parentRule)?void 0:l.parentStyleSheet,i,s.styleMirror);return(h&&-1!==h||p&&-1!==p)&&r({id:h,styleId:p,set:{property:u,value:c,priority:d},index:st(t.parentRule)}),e.apply(t,o)}))});var l=o.CSSStyleDeclaration.prototype.removeProperty;return o.CSSStyleDeclaration.prototype.removeProperty=new Proxy(l,{apply:Ke(((e,t,o)=>{var a,[u]=o;if(n.has(u))return l.apply(t,[u]);var{id:c,styleId:d}=ot(null==(a=t.parentRule)?void 0:a.parentStyleSheet,i,s.styleMirror);return(c&&-1!==c||d&&-1!==d)&&r({id:c,styleId:d,remove:{property:u},index:st(t.parentRule)}),e.apply(t,o)}))}),Ke((()=>{o.CSSStyleDeclaration.prototype.setProperty=a,o.CSSStyleDeclaration.prototype.removeProperty=l}))}(e,{win:n}),e.collectFonts&&(v=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=ye(r.fonts,"add",(function(e){return function(r){return setTimeout(Ke((()=>{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),Ke((()=>{n.forEach((e=>e()))}))}(e)));var g=function(e){var{doc:t,mirror:r,blockClass:i,blockSelector:n,selectionCb:s}=e,o=!0,a=Ke((()=>{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;u<l;u++){var c=e.getRangeAt(u),{startContainer:d,startOffset:h,endContainer:p,endOffset:v}=c;ke(d,i,n,!0)||ke(p,i,n,!0)||a.push({start:r.getId(d),startOffset:h,end:r.getId(p),endOffset:v})}s({ranges:a})}}));return a(),ve("selectionchange",a)}(e),_=function(e){var{doc:t,customElementCb:r}=e,i=t.defaultView;return i&&i.customElements?ye(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),f=[];for(var m of e.plugins)f.push(m.observer(m.callback,n,m.options));return Ke((()=>{Je.forEach((e=>e.reset())),null==i||i.disconnect(),s(),o(),a(),l(),u(),c(),d(),h(),p(),v(),g(),_(),f.forEach((e=>e()))}))}function ut(e){return void 0!==window[e]}function ct(e){return Boolean(void 0!==window[e]&&window[e].prototype&&"insertRule"in window[e].prototype&&"deleteRule"in window[e].prototype)}class dt{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);if("number"!=typeof t)return t;var n=i.get(t);return n||-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||(t=new Map,this.iframeIdToRemoteIdMap.set(e,t)),t}getRemoteIdToIdMap(e){var t=this.iframeRemoteIdToIdMap.get(e);return t||(t=new Map,this.iframeRemoteIdToIdMap.set(e,t)),t}}class ht{constructor(e){a(this,"iframes",new WeakMap),a(this,"crossOriginIframeMap",new WeakMap),a(this,"crossOriginIframeMirror",new dt(U)),a(this,"crossOriginIframeStyleMirror"),a(this,"crossOriginIframeRootIdMap",new WeakMap),a(this,"mirror"),a(this,"mutationCb"),a(this,"wrappedEmit"),a(this,"loadListener"),a(this,"stylesheetManager"),a(this,"recordCrossOriginIframes"),this.mutationCb=e.mutationCb,this.wrappedEmit=e.wrappedEmit,this.stylesheetManager=e.stylesheetManager,this.recordCrossOriginIframes=e.recordCrossOriginIframes,this.crossOriginIframeStyleMirror=new dt(this.stylesheetManager.styleMirror.generateId.bind(this.stylesheetManager.styleMirror)),this.mirror=e.mirror,this.recordCrossOriginIframes&&window.addEventListener("message",this.handleMessage.bind(this))}addIframe(e){this.iframes.set(e,!0),e.contentWindow&&this.crossOriginIframeMap.set(e.contentWindow,e)}addLoadListener(e){this.loadListener=e}attachIframe(e,t){var r,i;this.mutationCb({adds:[{parentId:this.mirror.getId(e),nextId:null,node:t}],removes:[],texts:[],attributes:[],isAttachIframe:!0}),this.recordCrossOriginIframes&&(null==(r=e.contentWindow)||r.addEventListener("message",this.handleMessage.bind(this))),null==(i=this.loadListener)||i.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 Oe.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),{timestamp:t.timestamp,type:Oe.IncrementalSnapshot,data:{source:De.Mutation,adds:[{parentId:this.mirror.getId(e),nextId:null,node:t.data.node}],removes:[],texts:[],attributes:[],isAttachIframe:!0}};case Oe.Meta:case Oe.Load:case Oe.DomContentLoaded:return!1;case Oe.Plugin:return t;case Oe.Custom:return this.replaceIds(t.data.payload,e,["id","parentId","previousId","nextId"]),t;case Oe.IncrementalSnapshot:switch(t.data.source){case De.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 De.Drag:case De.TouchMove:case De.MouseMove:return t.data.positions.forEach((t=>{this.replaceIds(t,e,["id"])})),t;case De.ViewportResize:return!1;case De.MediaInteraction:case De.MouseInteraction:case De.Scroll:case De.CanvasMutation:case De.Input:return this.replaceIds(t.data,e,["id"]),t;case De.StyleSheetRule:case De.StyleDeclaration:return this.replaceIds(t.data,e,["id"]),this.replaceStyleIds(t.data,e,["styleId"]),t;case De.Font:return t;case De.Selection:return t.data.ranges.forEach((t=>{this.replaceIds(t,e,["start","end"])})),t;case De.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])&&(Array.isArray(t[n])?t[n]=e.getIds(r,t[n]):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===c.Document||e.rootId||(e.rootId=t),"childNodes"in e&&e.childNodes.forEach((e=>{this.patchRootIdOnNode(e,t)}))}}class pt{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(w(e)&&!this.shadowDoms.has(e)){this.shadowDoms.add(e);var i=et(r({},this.bypassOptions,{doc:t,mutationCb:this.mutationCb,mirror:this.mirror,shadowDomManager:this}),e);this.restoreHandlers.push((()=>i.disconnect())),this.restoreHandlers.push(rt(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(pe.host(e))),this.restoreHandlers.push(at({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(ye(e.prototype,"attachShadow",(function(e){return function(i){var n=e.call(this,i),s=pe.shadowRoot(this);return s&&Le(this)&&r.addShadowRoot(s,t),n}})))}reset(){this.restoreHandlers.forEach((e=>{try{e()}catch(e){}})),this.restoreHandlers=[],this.shadowDoms=new WeakSet}}for(var vt="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",gt="undefined"==typeof Uint8Array?[]:new Uint8Array(256),_t=0;_t<64;_t++)gt[vt.charCodeAt(_t)]=_t;var ft=new Map;var mt=(e,t,r)=>{if(e&&(St(e,t)||"object"==typeof e)){var i=function(e,t){var r=ft.get(e);return r||(r=new Map,ft.set(e,r)),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 yt(e,t,r){if(e instanceof Array)return e.map((e=>yt(e,t,r)));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)return{rr_type:e.constructor.name,base64:function(e){var t,r=new Uint8Array(e),i=r.length,n="";for(t=0;t<i;t+=3)n+=vt[r[t]>>2],n+=vt[(3&r[t])<<4|r[t+1]>>4],n+=vt[(15&r[t+1])<<2|r[t+2]>>6],n+=vt[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)};if(e instanceof DataView)return{rr_type:e.constructor.name,args:[yt(e.buffer,t,r),e.byteOffset,e.byteLength]};if(e instanceof HTMLImageElement){var i=e.constructor.name,{src:n}=e;return{rr_type:i,src:n}}if(e instanceof HTMLCanvasElement){return{rr_type:"HTMLImageElement",src:e.toDataURL()}}return e instanceof ImageData?{rr_type:e.constructor.name,args:[yt(e.data,t,r),e.width,e.height]}:St(e,t)||"object"==typeof e?{rr_type:e.constructor.name,index:mt(e,t,r)}:e}var bt=(e,t,r)=>e.map((e=>yt(e,t,r))),St=(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])))};function wt(e,t,r,i){var n=[];try{var s=ye(e.HTMLCanvasElement.prototype,"getContext",(function(e){return function(n){for(var s=arguments.length,o=new Array(s>1?s-1:0),a=1;a<s;a++)o[a-1]=arguments[a];if(!ke(this,t,r,!0)){var l=function(e){return"experimental-webgl"===e?"webgl":e}(n);if("__context"in this||(this.__context=l),i&&["webgl","webgl2"].includes(l))if(o[0]&&"object"==typeof o[0]){var u=o[0];u.preserveDrawingBuffer||(u.preserveDrawingBuffer=!0)}else o.splice(0,1,{preserveDrawingBuffer:!0})}return e.apply(this,[n,...o])}}));n.push(s)}catch(e){console.error("failed to patch HTMLCanvasElement.prototype.getContext")}return()=>{n.forEach((e=>e()))}}function Ct(e,t,r,i,n,s){var o=[],a=Object.getOwnPropertyNames(e),l=function(a){if(["isContextLost","canvas","drawingBufferWidth","drawingBufferHeight"].includes(a))return 0;try{if("function"!=typeof e[a])return 0;var l=ye(e,a,(function(e){return function(){for(var o=arguments.length,l=new Array(o),u=0;u<o;u++)l[u]=arguments[u];var c=e.apply(this,l);if(mt(c,s,this),"tagName"in this.canvas&&!ke(this.canvas,i,n,!0)){var d=bt(l,s,this),h={type:t,property:a,args:d};r(this.canvas,h)}return c}}));o.push(l)}catch(i){var u=me(e,a,{set(e){r(this.canvas,{type:t,property:a,args:[e],setter:!0})}});o.push(u)}};for(var u of a)l(u);return o}var It,kt,Et,xt,Tt="KGZ1bmN0aW9uKCkgewogICJ1c2Ugc3RyaWN0IjsKICB2YXIgY2hhcnMgPSAiQUJDREVGR0hJSktMTU5PUFFSU1RVVldYWVphYmNkZWZnaGlqa2xtbm9wcXJzdHV2d3h5ejAxMjM0NTY3ODkrLyI7CiAgdmFyIGxvb2t1cCA9IHR5cGVvZiBVaW50OEFycmF5ID09PSAidW5kZWZpbmVkIiA/IFtdIDogbmV3IFVpbnQ4QXJyYXkoMjU2KTsKICBmb3IgKHZhciBpID0gMDsgaSA8IGNoYXJzLmxlbmd0aDsgaSsrKSB7CiAgICBsb29rdXBbY2hhcnMuY2hhckNvZGVBdChpKV0gPSBpOwogIH0KICB2YXIgZW5jb2RlID0gZnVuY3Rpb24oYXJyYXlidWZmZXIpIHsKICAgIHZhciBieXRlcyA9IG5ldyBVaW50OEFycmF5KGFycmF5YnVmZmVyKSwgaTIsIGxlbiA9IGJ5dGVzLmxlbmd0aCwgYmFzZTY0ID0gIiI7CiAgICBmb3IgKGkyID0gMDsgaTIgPCBsZW47IGkyICs9IDMpIHsKICAgICAgYmFzZTY0ICs9IGNoYXJzW2J5dGVzW2kyXSA+PiAyXTsKICAgICAgYmFzZTY0ICs9IGNoYXJzWyhieXRlc1tpMl0gJiAzKSA8PCA0IHwgYnl0ZXNbaTIgKyAxXSA+PiA0XTsKICAgICAgYmFzZTY0ICs9IGNoYXJzWyhieXRlc1tpMiArIDFdICYgMTUpIDw8IDIgfCBieXRlc1tpMiArIDJdID4+IDZdOwogICAgICBiYXNlNjQgKz0gY2hhcnNbYnl0ZXNbaTIgKyAyXSAmIDYzXTsKICAgIH0KICAgIGlmIChsZW4gJSAzID09PSAyKSB7CiAgICAgIGJhc2U2NCA9IGJhc2U2NC5zdWJzdHJpbmcoMCwgYmFzZTY0Lmxlbmd0aCAtIDEpICsgIj0iOwogICAgfSBlbHNlIGlmIChsZW4gJSAzID09PSAxKSB7CiAgICAgIGJhc2U2NCA9IGJhc2U2NC5zdWJzdHJpbmcoMCwgYmFzZTY0Lmxlbmd0aCAtIDIpICsgIj09IjsKICAgIH0KICAgIHJldHVybiBiYXNlNjQ7CiAgfTsKICBjb25zdCBsYXN0QmxvYk1hcCA9IC8qIEBfX1BVUkVfXyAqLyBuZXcgTWFwKCk7CiAgY29uc3QgdHJhbnNwYXJlbnRCbG9iTWFwID0gLyogQF9fUFVSRV9fICovIG5ldyBNYXAoKTsKICBhc3luYyBmdW5jdGlvbiBnZXRUcmFuc3BhcmVudEJsb2JGb3Iod2lkdGgsIGhlaWdodCwgZGF0YVVSTE9wdGlvbnMpIHsKICAgIGNvbnN0IGlkID0gYCR7d2lkdGh9LSR7aGVpZ2h0fWA7CiAgICBpZiAoIk9mZnNjcmVlbkNhbnZhcyIgaW4gZ2xvYmFsVGhpcykgewogICAgICBpZiAodHJhbnNwYXJlbnRCbG9iTWFwLmhhcyhpZCkpIHJldHVybiB0cmFuc3BhcmVudEJsb2JNYXAuZ2V0KGlkKTsKICAgICAgY29uc3Qgb2Zmc2NyZWVuID0gbmV3IE9mZnNjcmVlbkNhbnZhcyh3aWR0aCwgaGVpZ2h0KTsKICAgICAgb2Zmc2NyZWVuLmdldENvbnRleHQoIjJkIik7CiAgICAgIGNvbnN0IGJsb2IgPSBhd2FpdCBvZmZzY3JlZW4uY29udmVydFRvQmxvYihkYXRhVVJMT3B0aW9ucyk7CiAgICAgIGNvbnN0IGFycmF5QnVmZmVyID0gYXdhaXQgYmxvYi5hcnJheUJ1ZmZlcigpOwogICAgICBjb25zdCBiYXNlNjQgPSBlbmNvZGUoYXJyYXlCdWZmZXIpOwogICAgICB0cmFuc3BhcmVudEJsb2JNYXAuc2V0KGlkLCBiYXNlNjQpOwogICAgICByZXR1cm4gYmFzZTY0OwogICAgfSBlbHNlIHsKICAgICAgcmV0dXJuICIiOwogICAgfQogIH0KICBjb25zdCB3b3JrZXIgPSBzZWxmOwogIHdvcmtlci5vbm1lc3NhZ2UgPSBhc3luYyBmdW5jdGlvbihlKSB7CiAgICBpZiAoIk9mZnNjcmVlbkNhbnZhcyIgaW4gZ2xvYmFsVGhpcykgewogICAgICBjb25zdCB7IGlkLCBiaXRtYXAsIHdpZHRoLCBoZWlnaHQsIGRhdGFVUkxPcHRpb25zIH0gPSBlLmRhdGE7CiAgICAgIGNvbnN0IHRyYW5zcGFyZW50QmFzZTY0ID0gZ2V0VHJhbnNwYXJlbnRCbG9iRm9yKAogICAgICAgIHdpZHRoLAogICAgICAgIGhlaWdodCwKICAgICAgICBkYXRhVVJMT3B0aW9ucwogICAgICApOwogICAgICBjb25zdCBvZmZzY3JlZW4gPSBuZXcgT2Zmc2NyZWVuQ2FudmFzKHdpZHRoLCBoZWlnaHQpOwogICAgICBjb25zdCBjdHggPSBvZmZzY3JlZW4uZ2V0Q29udGV4dCgiMmQiKTsKICAgICAgY3R4LmRyYXdJbWFnZShiaXRtYXAsIDAsIDApOwogICAgICBiaXRtYXAuY2xvc2UoKTsKICAgICAgY29uc3QgYmxvYiA9IGF3YWl0IG9mZnNjcmVlbi5jb252ZXJ0VG9CbG9iKGRhdGFVUkxPcHRpb25zKTsKICAgICAgY29uc3QgdHlwZSA9IGJsb2IudHlwZTsKICAgICAgY29uc3QgYXJyYXlCdWZmZXIgPSBhd2FpdCBibG9iLmFycmF5QnVmZmVyKCk7CiAgICAgIGNvbnN0IGJhc2U2NCA9IGVuY29kZShhcnJheUJ1ZmZlcik7CiAgICAgIGlmICghbGFzdEJsb2JNYXAuaGFzKGlkKSAmJiBhd2FpdCB0cmFuc3BhcmVudEJhc2U2NCA9PT0gYmFzZTY0KSB7CiAgICAgICAgbGFzdEJsb2JNYXAuc2V0KGlkLCBiYXNlNjQpOwogICAgICAgIHJldHVybiB3b3JrZXIucG9zdE1lc3NhZ2UoeyBpZCB9KTsKICAgICAgfQogICAgICBpZiAobGFzdEJsb2JNYXAuZ2V0KGlkKSA9PT0gYmFzZTY0KSByZXR1cm4gd29ya2VyLnBvc3RNZXNzYWdlKHsgaWQgfSk7CiAgICAgIHdvcmtlci5wb3N0TWVzc2FnZSh7CiAgICAgICAgaWQsCiAgICAgICAgdHlwZSwKICAgICAgICBiYXNlNjQsCiAgICAgICAgd2lkdGgsCiAgICAgICAgaGVpZ2h0CiAgICAgIH0pOwogICAgICBsYXN0QmxvYk1hcC5zZXQoaWQsIGJhc2U2NCk7CiAgICB9IGVsc2UgewogICAgICByZXR1cm4gd29ya2VyLnBvc3RNZXNzYWdlKHsgaWQ6IGUuZGF0YS5pZCB9KTsKICAgIH0KICB9Owp9KSgpOwovLyMgc291cmNlTWFwcGluZ1VSTD1pbWFnZS1iaXRtYXAtZGF0YS11cmwtd29ya2VyLUlKcEM3Z19iLmpzLm1hcAo=",Mt="undefined"!=typeof window&&window.Blob&&new Blob([(It=Tt,Uint8Array.from(atob(It),(e=>e.charCodeAt(0))))],{type:"text/javascript;charset=utf-8"});function Rt(e){var t;try{if(!(t=Mt&&(window.URL||window.webkitURL).createObjectURL(Mt)))throw"";var r=new Worker(t,{name:null==e?void 0:e.name});return r.addEventListener("error",(()=>{(window.URL||window.webkitURL).revokeObjectURL(t)})),r}catch(t){return new Worker("data:text/javascript;base64,"+Tt,{name:null==e?void 0:e.name})}finally{t&&(window.URL||window.webkitURL).revokeObjectURL(t)}}class Pt{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,"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}=e;this.mutationCb=e.mutationCb,this.mirror=e.mirror,s&&"all"===t&&this.initCanvasMutationObserver(r,i,n),s&&"number"==typeof t&&this.initCanvasFPSObserver(t,r,i,n,{dataURLOptions:o})}reset(){this.pendingCanvasMutations.clear(),this.resetObservers&&this.resetObservers()}freeze(){this.frozen=!0}unfreeze(){this.frozen=!1}lock(){this.locked=!0}unlock(){this.locked=!1}initCanvasFPSObserver(e,r,i,n,s){var o=this,a=wt(r,i,n,!0),l=new Map,u=new Rt;u.onmessage=e=>{var{id:t}=e.data;if(l.set(t,!1),"base64"in e.data){var{base64:r,type:i,width:n,height:s}=e.data;this.mutationCb({id:t,type:Be["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]}]})}};var c,d=1e3/e,h=0,p=e=>{var a,v;h&&e-h<d?c=requestAnimationFrame(p):(h=e,(a=[],v=e=>{e.querySelectorAll("canvas").forEach((e=>{ke(e,i,n,!0)||a.push(e)})),e.querySelectorAll("*").forEach((e=>{e.shadowRoot&&v(e.shadowRoot)}))},v(r.document),a).forEach(function(){var e=t((function*(e){var t,r=o.mirror.getId(e);if(!l.get(r)&&0!==e.width&&0!==e.height){if(l.set(r,!0),["webgl","webgl2"].includes(e.__context)){var i=e.getContext(e.__context);!1===(null==(t=null==i?void 0:i.getContextAttributes())?void 0:t.preserveDrawingBuffer)&&i.clear(i.COLOR_BUFFER_BIT)}var n=e.clientWidth||e.width,a=e.clientHeight||e.height,c=yield createImageBitmap(e,{resizeWidth:n,resizeHeight:a});u.postMessage({id:r,bitmap:c,width:n,height:a,dataURLOptions:s.dataURLOptions},[c])}}));return function(t){return e.apply(this,arguments)}}()),c=requestAnimationFrame(p))};c=requestAnimationFrame(p),this.resetObservers=()=>{a(),cancelAnimationFrame(c)}}initCanvasMutationObserver(e,t,r){this.startRAFTimestamping(),this.startPendingCanvasMutationFlusher();var i=wt(e,t,r,!1),n=function(e,t,r,i){var n=[],s=Object.getOwnPropertyNames(t.CanvasRenderingContext2D.prototype),o=function(s){try{if("function"!=typeof t.CanvasRenderingContext2D.prototype[s])return 1;var o=ye(t.CanvasRenderingContext2D.prototype,s,(function(n){return function(){for(var o=arguments.length,a=new Array(o),l=0;l<o;l++)a[l]=arguments[l];return ke(this.canvas,r,i,!0)||setTimeout((()=>{var r=bt(a,t,this);e(this.canvas,{type:Be["2D"],property:s,args:r})}),0),n.apply(this,a)}}));n.push(o)}catch(r){var a=me(t.CanvasRenderingContext2D.prototype,s,{set(t){e(this.canvas,{type:Be["2D"],property:s,args:[t],setter:!0})}});n.push(a)}};for(var a of s)o(a);return()=>{n.forEach((e=>e()))}}(this.processMutation.bind(this),e,t,r),s=function(e,t,r,i){var n=[];return n.push(...Ct(t.WebGLRenderingContext.prototype,Be.WebGL,e,r,i,t)),void 0!==t.WebGL2RenderingContext&&n.push(...Ct(t.WebGL2RenderingContext.prototype,Be.WebGL2,e,r,i,t)),()=>{n.forEach((e=>e()))}}(this.processMutation.bind(this),e,t,r);this.resetObservers=()=>{i(),n(),s()}}startPendingCanvasMutationFlusher(){requestAnimationFrame((()=>this.flushPendingCanvasMutations()))}startRAFTimestamping(){var e=t=>{this.rafStamps.latestId=t,requestAnimationFrame(e)};requestAnimationFrame(e)}flushPendingCanvasMutations(){this.pendingCanvasMutations.forEach(((e,t)=>{var r=this.mirror.getId(t);this.flushPendingCanvasMutationFor(t,r)})),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 At{constructor(e){a(this,"trackedLinkElements",new WeakSet),a(this,"mutationCb"),a(this,"adoptedStyleSheetCb"),a(this,"styleMirror",new Ae),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:I(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}trackStylesheetInLinkElement(e){}}class Nt{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 Ft=!1;try{if(2!==Array.from([1],(e=>2*e))[0]){var Lt=document.createElement("iframe");document.body.appendChild(Lt),Array.from=(null==(n=Lt.contentWindow)?void 0:n.Array.from)||Array.from,document.body.removeChild(Lt)}}catch(e){console.debug("Unable to override Array.from",e)}var Ot,Dt,Ht=new E;function qt(e){void 0===e&&(e={});var{emit:t,checkoutEveryNms:i,checkoutEveryNth:n,blockClass:s="rr-block",blockSelector:o=null,ignoreClass:a="rr-ignore",ignoreSelector:l=null,maskTextClass:u="rr-mask",maskTextSelector:c=null,inlineStylesheet:d=!0,maskAllInputs:h,maskInputOptions:p,slimDOMOptions:v,maskInputFn:g,maskTextFn:_,hooks:f,packFn:m,sampling:y={},dataURLOptions:b={},mousemoveWait:S,recordDOM:w=!0,recordCanvas:C=!1,recordCrossOriginIframes:I=!1,recordAfter:k=("DOMContentLoaded"===e.recordAfter?e.recordAfter:"load"),userTriggeredOnInput:x=!1,collectFonts:T=!1,inlineImages:M=!1,plugins:R,keepIframeSrcFn:P=(()=>!1),ignoreCSSAttributes:A=new Set([]),errorHandler:N}=e;We=N;var F=!I||window.parent===window,L=!1;if(!F)try{window.parent.document&&(L=!1)}catch(e){L=!0}if(F&&!t)throw new Error("emit function is required");if(!F&&!L)return()=>{};void 0!==S&&void 0===y.mousemove&&(y.mousemove=S),Ht.reset();var O,D=!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}:void 0!==p?p:{password:!0},H=!0===v||"all"===v?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaVerification:!0,headMetaAuthorship:"all"===v,headMetaDescKeywords:"all"===v,headTitleMutations:"all"===v}:v||{};!function(e){void 0===e&&(e=window),"NodeList"in e&&!e.NodeList.prototype.forEach&&(e.NodeList.prototype.forEach=Array.prototype.forEach),"DOMTokenList"in e&&!e.DOMTokenList.prototype.forEach&&(e.DOMTokenList.prototype.forEach=Array.prototype.forEach)}();var q=0,B=e=>{for(var t of R||[])t.eventProcessor&&(e=t.eventProcessor(e));return m&&!L&&(e=m(e)),e};kt=(e,r)=>{var s,o=e;if(o.timestamp=be(),!(null==(s=Je[0])?void 0:s.isFrozen())||o.type===Oe.FullSnapshot||o.type===Oe.IncrementalSnapshot&&o.data.source===De.Mutation||Je.forEach((e=>e.unfreeze())),F)null==t||t(B(o),r);else if(L){var a={type:"rrweb",event:B(o),origin:window.location.origin,isCheckout:r};window.parent.postMessage(a,"*")}if(o.type===Oe.FullSnapshot)O=o,q=0;else if(o.type===Oe.IncrementalSnapshot){if(o.data.source===De.Mutation&&o.data.isAttachIframe)return;q++;var l=n&&q>=n,u=i&&o.timestamp-O.timestamp>i;(l||u)&&Et(!0)}};var V=e=>{kt({type:Oe.IncrementalSnapshot,data:r({source:De.Mutation},e)})},U=e=>kt({type:Oe.IncrementalSnapshot,data:r({source:De.Scroll},e)}),W=e=>kt({type:Oe.IncrementalSnapshot,data:r({source:De.CanvasMutation},e)}),z=new At({mutationCb:V,adoptedStyleSheetCb:e=>kt({type:Oe.IncrementalSnapshot,data:r({source:De.AdoptedStyleSheet},e)})}),j=new ht({mirror:Ht,mutationCb:V,stylesheetManager:z,recordCrossOriginIframes:I,wrappedEmit:kt});for(var Z of R||[])Z.getMirror&&Z.getMirror({nodeMirror:Ht,crossOriginIframeMirror:j.crossOriginIframeMirror,crossOriginIframeStyleMirror:j.crossOriginIframeStyleMirror});var G=new Nt;xt=new Pt({recordCanvas:C,mutationCb:W,win:window,blockClass:s,blockSelector:o,mirror:Ht,sampling:y.canvas,dataURLOptions:b});var Y=new pt({mutationCb:V,scrollCb:U,bypassOptions:{blockClass:s,blockSelector:o,maskTextClass:u,maskTextSelector:c,inlineStylesheet:d,maskInputOptions:D,dataURLOptions:b,maskTextFn:_,maskInputFn:g,recordCanvas:C,inlineImages:M,sampling:y,slimDOMOptions:H,iframeManager:j,stylesheetManager:z,canvasManager:xt,keepIframeSrcFn:P,processedNodeManager:G},mirror:Ht});Et=function(e){if(void 0===e&&(e=!1),w){kt({type:Oe.Meta,data:{href:window.location.href,width:Ce(),height:we()}},e),z.reset(),Y.init(),Je.forEach((e=>e.lock()));var t=function(e,t){var{mirror:r=new E,blockClass:i="rr-block",blockSelector:n=null,maskTextClass:s="rr-mask",maskTextSelector:o=null,inlineStylesheet:a=!0,inlineImages:l=!1,recordCanvas:u=!1,maskAllInputs:c=!1,maskTextFn:d,maskInputFn:h,slimDOM:p=!1,dataURLOptions:v,preserveWhiteSpace:g,onSerialize:_,onIframeLoad:f,iframeLoadTimeout:m,onStylesheetLoad:y,stylesheetLoadTimeout:b,keepIframeSrcFn:S=(()=>!1)}=t||{};return re(e,{doc:e,mirror:r,blockClass:i,blockSelector:n,maskTextClass:s,maskTextSelector:o,skipChild:!1,inlineStylesheet:a,maskInputOptions:!0===c?{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===c?{password:!0}:c,maskTextFn:d,maskInputFn:h,slimDOMOptions:!0===p||"all"===p?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaDescKeywords:"all"===p,headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaAuthorship:!0,headMetaVerification:!0}:!1===p?{}:p,dataURLOptions:v,inlineImages:l,recordCanvas:u,preserveWhiteSpace:g,onSerialize:_,onIframeLoad:f,iframeLoadTimeout:m,onStylesheetLoad:y,stylesheetLoadTimeout:b,keepIframeSrcFn:S,newlyAddedElement:!1})}(document,{mirror:Ht,blockClass:s,blockSelector:o,maskTextClass:u,maskTextSelector:c,inlineStylesheet:d,maskAllInputs:D,maskTextFn:_,maskInputFn:g,slimDOM:H,dataURLOptions:b,recordCanvas:C,inlineImages:M,onSerialize:e=>{Me(e,Ht)&&j.addIframe(e),Re(e,Ht)&&z.trackLinkElement(e),Pe(e)&&Y.addShadowRoot(pe.shadowRoot(e),document)},onIframeLoad:(e,t)=>{j.attachIframe(e,t),Y.observeAttachShadow(e)},onStylesheetLoad:(e,t)=>{z.attachLinkElement(e,t)},keepIframeSrcFn:P});if(!t)return console.warn("Failed to snapshot the document");kt({type:Oe.FullSnapshot,data:{node:t,initialOffset:Se(window)}},e),Je.forEach((e=>e.unlock())),document.adoptedStyleSheets&&document.adoptedStyleSheets.length>0&&z.adoptStyleSheets(document.adoptedStyleSheets,Ht.getId(document))}};try{var X=[],K=e=>{var t;return Ke(lt)({mutationCb:V,mousemoveCb:(e,t)=>kt({type:Oe.IncrementalSnapshot,data:{source:t,positions:e}}),mouseInteractionCb:e=>kt({type:Oe.IncrementalSnapshot,data:r({source:De.MouseInteraction},e)}),scrollCb:U,viewportResizeCb:e=>kt({type:Oe.IncrementalSnapshot,data:r({source:De.ViewportResize},e)}),inputCb:e=>kt({type:Oe.IncrementalSnapshot,data:r({source:De.Input},e)}),mediaInteractionCb:e=>kt({type:Oe.IncrementalSnapshot,data:r({source:De.MediaInteraction},e)}),styleSheetRuleCb:e=>kt({type:Oe.IncrementalSnapshot,data:r({source:De.StyleSheetRule},e)}),styleDeclarationCb:e=>kt({type:Oe.IncrementalSnapshot,data:r({source:De.StyleDeclaration},e)}),canvasMutationCb:W,fontCb:e=>kt({type:Oe.IncrementalSnapshot,data:r({source:De.Font},e)}),selectionCb:e=>{kt({type:Oe.IncrementalSnapshot,data:r({source:De.Selection},e)})},customElementCb:e=>{kt({type:Oe.IncrementalSnapshot,data:r({source:De.CustomElement},e)})},blockClass:s,ignoreClass:a,ignoreSelector:l,maskTextClass:u,maskTextSelector:c,maskInputOptions:D,inlineStylesheet:d,sampling:y,recordDOM:w,recordCanvas:C,inlineImages:M,userTriggeredOnInput:x,collectFonts:T,doc:e,maskInputFn:g,maskTextFn:_,keepIframeSrcFn:P,blockSelector:o,slimDOMOptions:H,dataURLOptions:b,mirror:Ht,iframeManager:j,stylesheetManager:z,shadowDomManager:Y,processedNodeManager:G,canvasManager:xt,ignoreCSSAttributes:A,plugins:(null==(t=null==R?void 0:R.filter((e=>e.observer)))?void 0:t.map((e=>({observer:e.observer,options:e.options,callback:t=>kt({type:Oe.Plugin,data:{plugin:e.name,payload:t}})}))))||[]},f)};j.addLoadListener((e=>{try{X.push(K(e.contentDocument))}catch(e){console.warn(e)}}));var J=()=>{Et(),X.push(K(document)),Ft=!0};return"interactive"===document.readyState||"complete"===document.readyState?J():(X.push(ve("DOMContentLoaded",(()=>{kt({type:Oe.DomContentLoaded,data:{}}),"DOMContentLoaded"===k&&J()}))),X.push(ve("load",(()=>{kt({type:Oe.Load,data:{}}),"load"===k&&J()}),window))),()=>{X.forEach((e=>e())),G.destroy(),Ft=!1,We=void 0}}catch(e){console.warn(e)}}qt.addCustomEvent=(e,t)=>{if(!Ft)throw new Error("please add custom event after start recording");kt({type:Oe.Custom,data:{tag:e,payload:t}})},qt.freezePage=()=>{Je.forEach((e=>e.freeze()))},qt.takeFullSnapshot=e=>{if(!Ft)throw new Error("please take full snapshot after start recording");Et(e)},qt.mirror=Ht,(Dt=Ot||(Ot={}))[Dt.NotStarted=0]="NotStarted",Dt[Dt.Running=1]="Running",Dt[Dt.Stopped=2]="Stopped";var Bt,Vt=Object.defineProperty,$t=(e,t,r)=>((e,t,r)=>t in e?Vt(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r)(e,"symbol"!=typeof t?t+"":t,r),Ut=Object.defineProperty,Wt=(e,t,r)=>((e,t,r)=>t in e?Ut(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r)(e,"symbol"!=typeof t?t+"":t,r),zt=Object.defineProperty,jt=(e,t,r)=>((e,t,r)=>t in e?zt(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r)(e,"symbol"!=typeof t?t+"":t,r),Zt={Node:["childNodes","parentNode","parentElement","textContent"],ShadowRoot:["host","styleSheets"],Element:["shadowRoot","querySelector","querySelectorAll"],MutationObserver:[]},Gt={Node:["contains","getRootNode"],ShadowRoot:["getSelection"],Element:[],MutationObserver:["constructor"]},Yt={};function Xt(e){if(Yt[e])return Yt[e];var t=globalThis[e],r=t.prototype,i=e in Zt?Zt[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 Gt?Gt[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 Yt[e]=t.prototype,t.prototype;try{var a=document.createElement("iframe");document.body.appendChild(a);var l=a.contentWindow;if(!l)return t.prototype;var u=l[e].prototype;return document.body.removeChild(a),u?Yt[e]=u:r}catch(e){return r}}var Kt={};function Jt(e,t,r){var i,n=e+"."+String(r);if(Kt[n])return Kt[n].call(t);var s=Xt(e),o=null==(i=Object.getOwnPropertyDescriptor(s,r))?void 0:i.get;return o?(Kt[n]=o,o.call(t)):t[r]}var Qt={};function er(e,t,r){var i=e+"."+String(r);if(Qt[i])return Qt[i].bind(t);var n=Xt(e)[r];return"function"!=typeof n?t[r]:(Qt[i]=n,n.bind(t))}var tr={childNodes:function(e){return Jt("Node",e,"childNodes")},parentNode:function(e){return Jt("Node",e,"parentNode")},parentElement:function(e){return Jt("Node",e,"parentElement")},textContent:function(e){return Jt("Node",e,"textContent")},contains:function(e,t){return er("Node",e,"contains")(t)},getRootNode:function(e){return er("Node",e,"getRootNode")()},host:function(e){return e&&"host"in e?Jt("ShadowRoot",e,"host"):null},styleSheets:function(e){return e.styleSheets},shadowRoot:function(e){return e&&"shadowRoot"in e?Jt("Element",e,"shadowRoot"):null},querySelector:function(e,t){return Jt("Element",e,"querySelector")(t)},querySelectorAll:function(e,t){return Jt("Element",e,"querySelectorAll")(t)},mutationObserver:function(){return Xt("MutationObserver").constructor}};class rr{constructor(){jt(this,"idNodeMap",new Map),jt(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);this.idNodeMap.delete(t),e.childNodes&&e.childNodes.forEach((e=>this.removeNodeFromMap(e)))}has(e){return this.idNodeMap.has(e)}hasNode(e){return this.nodeMetaMap.has(e)}add(e,t){var r=t.id;this.idNodeMap.set(r,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 ir(e,t,r){if(!e)return!1;if(e.nodeType!==e.ELEMENT_NODE)return!!r&&ir(tr.parentNode(e),t,r);for(var i=e.classList.length;i--;){var n=e.classList[i];if(t.test(n))return!0}return!!r&&ir(tr.parentNode(e),t,r)}class nr{constructor(){__publicField22(this,"parentElement",null),__publicField22(this,"parentNode",null),__publicField22(this,"ownerDocument"),__publicField22(this,"firstChild",null),__publicField22(this,"lastChild",null),__publicField22(this,"previousSibling",null),__publicField22(this,"nextSibling",null),__publicField22(this,"ELEMENT_NODE",1),__publicField22(this,"TEXT_NODE",3),__publicField22(this,"nodeType"),__publicField22(this,"nodeName"),__publicField22(this,"RRNodeType")}get childNodes(){for(var e=[],t=this.firstChild;t;)e.push(t),t=t.nextSibling;return e}contains(e){if(!(e instanceof nr))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"}}var sr={Node:["childNodes","parentNode","parentElement","textContent"],ShadowRoot:["host","styleSheets"],Element:["shadowRoot","querySelector","querySelectorAll"],MutationObserver:[]},or={Node:["contains","getRootNode"],ShadowRoot:["getSelection"],Element:[],MutationObserver:["constructor"]},ar={};function lr(e){if(ar[e])return ar[e];var t=globalThis[e],r=t.prototype,i=e in sr?sr[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 or?or[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 ar[e]=t.prototype,t.prototype;try{var a=document.createElement("iframe");document.body.appendChild(a);var l=a.contentWindow;if(!l)return t.prototype;var u=l[e].prototype;return document.body.removeChild(a),u?ar[e]=u:r}catch(e){return r}}var ur={};function cr(e,t,r){var i,n=e+"."+String(r);if(ur[n])return ur[n].call(t);var s=lr(e),o=null==(i=Object.getOwnPropertyDescriptor(s,r))?void 0:i.get;return o?(ur[n]=o,o.call(t)):t[r]}var dr={};function hr(e,t,r){var i=e+"."+String(r);if(dr[i])return dr[i].bind(t);var n=lr(e)[r];return"function"!=typeof n?t[r]:(dr[i]=n,n.bind(t))}var pr={childNodes:function(e){return cr("Node",e,"childNodes")},parentNode:function(e){return cr("Node",e,"parentNode")},parentElement:function(e){return cr("Node",e,"parentElement")},textContent:function(e){return cr("Node",e,"textContent")},contains:function(e,t){return hr("Node",e,"contains")(t)},getRootNode:function(e){return hr("Node",e,"getRootNode")()},host:function(e){return e&&"host"in e?cr("ShadowRoot",e,"host"):null},styleSheets:function(e){return e.styleSheets},shadowRoot:function(e){return e&&"shadowRoot"in e?cr("Element",e,"shadowRoot"):null},querySelector:function(e,t){return cr("Element",e,"querySelector")(t)},querySelectorAll:function(e,t){return cr("Element",e,"querySelectorAll")(t)},mutationObserver:function(){return lr("MutationObserver").constructor}};var vr="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.",gr={map:{},getId:()=>(console.error(vr),-1),getNode:()=>(console.error(vr),null),removeNodeFromMap(){console.error(vr)},has:()=>(console.error(vr),!1),reset(){console.error(vr)}};"undefined"!=typeof window&&window.Proxy&&window.Reflect&&(gr=new Proxy(gr,{get:(e,t,r)=>("map"===t&&console.error(vr),Reflect.get(e,t,r))}));var _r=Date.now;function fr(e){return e?e.nodeType===e.ELEMENT_NODE?e:pr.parentElement(e):null}/[1-9][0-9]{12}/.test(Date.now().toString())||(_r=()=>(new Date).getTime());function mr(e){var t,r=null;return"getRootNode"in e&&(null==(t=pr.getRootNode(e))?void 0:t.nodeType)===Node.DOCUMENT_FRAGMENT_NODE&&pr.host(pr.getRootNode(e))&&(r=pr.host(pr.getRootNode(e))),r}function yr(e){for(var t,r=e;t=mr(r);)r=t;return r}function br(e){var t=e.ownerDocument;if(!t)return!1;var r=yr(e);return pr.contains(t,r)}for(var Sr=Object.freeze(Object.defineProperty({__proto__:null,StyleSheetMirror:class{constructor(){Wt(this,"id",1),Wt(this,"styleIDMap",new WeakMap),Wt(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++}},get _mirror(){return gr},closestElementOfNode:fr,getBaseDimension:function e(t,r){var i,n,s=null==(n=null==(i=t.ownerDocument)?void 0:i.defaultView)?void 0:n.frameElement;if(!s||s===r)return{x:0,y:0,relativeScale:1,absoluteScale:1};var o=s.getBoundingClientRect(),a=e(s,r),l=o.height/s.clientHeight;return{x:o.x*a.relativeScale+a.x,y:o.y*a.relativeScale+a.y,relativeScale:l,absoluteScale:a.absoluteScale*l}},getNestedRule:function e(t,r){var i=t[r[0]];return 1===r.length?i:e(i.cssRules[r[1]].cssRules,r.slice(2))},getPositionsAndIndex:function(e){var t=[...e],r=t.pop();return{positions:t,index:r}},getRootShadowHost:yr,getShadowHost:mr,getWindowHeight:function(){return window.innerHeight||document.documentElement&&document.documentElement.clientHeight||document.body&&document.body.clientHeight},getWindowScroll:function(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=pr.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=pr.parentElement(s.body))?void 0:i.scrollTop)||(null==(n=null==s?void 0:s.body)?void 0:n.scrollTop)||0}},getWindowWidth:function(){return window.innerWidth||document.documentElement&&document.documentElement.clientWidth||document.body&&document.body.clientWidth},hasShadowRoot:function(e){return!!e&&(e instanceof nr&&"shadowRoot"in e?Boolean(e.shadowRoot):Boolean(pr.shadowRoot(e)))},hookSetter:function e(t,r,i,n,s){void 0===s&&(s=window);var o=s.Object.getOwnPropertyDescriptor(t,r);return s.Object.defineProperty(t,r,n?i:{set(e){setTimeout((()=>{i.set.call(this,e)}),0),o&&o.set&&o.set.call(this,e)}}),()=>e(t,r,o||{},!0)},inDom:function(e){var t=e.ownerDocument;return!!t&&(pr.contains(t,e)||br(e))},isAncestorRemoved:function e(t,r){if(n=(i=t)&&"host"in i&&"mode"in i&&tr.host(i)||null,Boolean(n&&"shadowRoot"in n&&tr.shadowRoot(n)===i))return!1;var i,n,s=r.getId(t);if(!r.has(s))return!0;var o=pr.parentNode(t);return(!o||o.nodeType!==t.DOCUMENT_NODE)&&(!o||e(o,r))},isBlocked:function(e,t,r,i){if(!e)return!1;var n=fr(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(ir(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},isIgnored:function(e,t,r){return!("TITLE"!==e.tagName||!r.headTitleMutations)||-2===t.getId(e)},isSerialized:function(e,t){return-1!==t.getId(e)},isSerializedIframe:function(e,t){return Boolean("IFRAME"===e.nodeName&&t.getMeta(e))},isSerializedStylesheet:function(e,t){return Boolean("LINK"===e.nodeName&&e.nodeType===e.ELEMENT_NODE&&e.getAttribute&&"stylesheet"===e.getAttribute("rel")&&t.getMeta(e))},iterateResolveTree:function e(t,r){r(t.value);for(var i=t.children.length-1;i>=0;i--)e(t.children[i],r)},legacy_isTouchEvent:function(e){return Boolean(e.changedTouches)},get nowTimestamp(){return _r},on:function(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)},patch:function(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()=>{}}},polyfill:function(e){void 0===e&&(e=window),"NodeList"in e&&!e.NodeList.prototype.forEach&&(e.NodeList.prototype.forEach=Array.prototype.forEach),"DOMTokenList"in e&&!e.DOMTokenList.prototype.forEach&&(e.DOMTokenList.prototype.forEach=Array.prototype.forEach)},queueToResolveTrees:function(e){var t={},r=(e,r)=>{var i={value:e,parent:r,children:[]};return t[e.node.id]=i,i},i=[];for(var n of e){var{nextId:s,parentId:o}=n;if(s&&s in t){var a=t[s];if(a.parent){var l=a.parent.children.indexOf(a);a.parent.children.splice(l,0,r(n,a.parent))}else{var u=i.indexOf(a);i.splice(u,0,r(n,null))}}else if(o in t){var c=t[o];c.children.push(r(n,c))}else i.push(r(n,null))}return i},shadowHostInDom:br,throttle:function(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;a<s;a++)o[a]=arguments[a];var l=Date.now();n||!1!==r.leading||(n=l);var u=t-(l-n),c=this;u<=0||u>t?(i&&(clearTimeout(i),i=null),n=l,e.apply(c,o)):i||!1===r.trailing||(i=setTimeout((()=>{n=!1===r.leading?0:Date.now(),i=null,e.apply(c,o)}),u))}},uniqueTextMutations:function(e){for(var t=new Set,r=[],i=e.length;i--;){var n=e[i];t.has(n.id)||(r.push(n),t.add(n.id))}return r}},Symbol.toStringTag,{value:"Module"})),wr="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",Cr="undefined"==typeof Uint8Array?[]:new Uint8Array(256),Ir=0;Ir<64;Ir++)Cr[wr.charCodeAt(Ir)]=Ir;var kr;"undefined"!=typeof window&&window.Blob&&new Blob([(e=>Uint8Array.from(atob(e),(e=>e.charCodeAt(0))))("KGZ1bmN0aW9uKCkgewogICJ1c2Ugc3RyaWN0IjsKICB2YXIgY2hhcnMgPSAiQUJDREVGR0hJSktMTU5PUFFSU1RVVldYWVphYmNkZWZnaGlqa2xtbm9wcXJzdHV2d3h5ejAxMjM0NTY3ODkrLyI7CiAgdmFyIGxvb2t1cCA9IHR5cGVvZiBVaW50OEFycmF5ID09PSAidW5kZWZpbmVkIiA/IFtdIDogbmV3IFVpbnQ4QXJyYXkoMjU2KTsKICBmb3IgKHZhciBpID0gMDsgaSA8IGNoYXJzLmxlbmd0aDsgaSsrKSB7CiAgICBsb29rdXBbY2hhcnMuY2hhckNvZGVBdChpKV0gPSBpOwogIH0KICB2YXIgZW5jb2RlID0gZnVuY3Rpb24oYXJyYXlidWZmZXIpIHsKICAgIHZhciBieXRlcyA9IG5ldyBVaW50OEFycmF5KGFycmF5YnVmZmVyKSwgaTIsIGxlbiA9IGJ5dGVzLmxlbmd0aCwgYmFzZTY0ID0gIiI7CiAgICBmb3IgKGkyID0gMDsgaTIgPCBsZW47IGkyICs9IDMpIHsKICAgICAgYmFzZTY0ICs9IGNoYXJzW2J5dGVzW2kyXSA+PiAyXTsKICAgICAgYmFzZTY0ICs9IGNoYXJzWyhieXRlc1tpMl0gJiAzKSA8PCA0IHwgYnl0ZXNbaTIgKyAxXSA+PiA0XTsKICAgICAgYmFzZTY0ICs9IGNoYXJzWyhieXRlc1tpMiArIDFdICYgMTUpIDw8IDIgfCBieXRlc1tpMiArIDJdID4+IDZdOwogICAgICBiYXNlNjQgKz0gY2hhcnNbYnl0ZXNbaTIgKyAyXSAmIDYzXTsKICAgIH0KICAgIGlmIChsZW4gJSAzID09PSAyKSB7CiAgICAgIGJhc2U2NCA9IGJhc2U2NC5zdWJzdHJpbmcoMCwgYmFzZTY0Lmxlbmd0aCAtIDEpICsgIj0iOwogICAgfSBlbHNlIGlmIChsZW4gJSAzID09PSAxKSB7CiAgICAgIGJhc2U2NCA9IGJhc2U2NC5zdWJzdHJpbmcoMCwgYmFzZTY0Lmxlbmd0aCAtIDIpICsgIj09IjsKICAgIH0KICAgIHJldHVybiBiYXNlNjQ7CiAgfTsKICBjb25zdCBsYXN0QmxvYk1hcCA9IC8qIEBfX1BVUkVfXyAqLyBuZXcgTWFwKCk7CiAgY29uc3QgdHJhbnNwYXJlbnRCbG9iTWFwID0gLyogQF9fUFVSRV9fICovIG5ldyBNYXAoKTsKICBhc3luYyBmdW5jdGlvbiBnZXRUcmFuc3BhcmVudEJsb2JGb3Iod2lkdGgsIGhlaWdodCwgZGF0YVVSTE9wdGlvbnMpIHsKICAgIGNvbnN0IGlkID0gYCR7d2lkdGh9LSR7aGVpZ2h0fWA7CiAgICBpZiAoIk9mZnNjcmVlbkNhbnZhcyIgaW4gZ2xvYmFsVGhpcykgewogICAgICBpZiAodHJhbnNwYXJlbnRCbG9iTWFwLmhhcyhpZCkpIHJldHVybiB0cmFuc3BhcmVudEJsb2JNYXAuZ2V0KGlkKTsKICAgICAgY29uc3Qgb2Zmc2NyZWVuID0gbmV3IE9mZnNjcmVlbkNhbnZhcyh3aWR0aCwgaGVpZ2h0KTsKICAgICAgb2Zmc2NyZWVuLmdldENvbnRleHQoIjJkIik7CiAgICAgIGNvbnN0IGJsb2IgPSBhd2FpdCBvZmZzY3JlZW4uY29udmVydFRvQmxvYihkYXRhVVJMT3B0aW9ucyk7CiAgICAgIGNvbnN0IGFycmF5QnVmZmVyID0gYXdhaXQgYmxvYi5hcnJheUJ1ZmZlcigpOwogICAgICBjb25zdCBiYXNlNjQgPSBlbmNvZGUoYXJyYXlCdWZmZXIpOwogICAgICB0cmFuc3BhcmVudEJsb2JNYXAuc2V0KGlkLCBiYXNlNjQpOwogICAgICByZXR1cm4gYmFzZTY0OwogICAgfSBlbHNlIHsKICAgICAgcmV0dXJuICIiOwogICAgfQogIH0KICBjb25zdCB3b3JrZXIgPSBzZWxmOwogIHdvcmtlci5vbm1lc3NhZ2UgPSBhc3luYyBmdW5jdGlvbihlKSB7CiAgICBpZiAoIk9mZnNjcmVlbkNhbnZhcyIgaW4gZ2xvYmFsVGhpcykgewogICAgICBjb25zdCB7IGlkLCBiaXRtYXAsIHdpZHRoLCBoZWlnaHQsIGRhdGFVUkxPcHRpb25zIH0gPSBlLmRhdGE7CiAgICAgIGNvbnN0IHRyYW5zcGFyZW50QmFzZTY0ID0gZ2V0VHJhbnNwYXJlbnRCbG9iRm9yKAogICAgICAgIHdpZHRoLAogICAgICAgIGhlaWdodCwKICAgICAgICBkYXRhVVJMT3B0aW9ucwogICAgICApOwogICAgICBjb25zdCBvZmZzY3JlZW4gPSBuZXcgT2Zmc2NyZWVuQ2FudmFzKHdpZHRoLCBoZWlnaHQpOwogICAgICBjb25zdCBjdHggPSBvZmZzY3JlZW4uZ2V0Q29udGV4dCgiMmQiKTsKICAgICAgY3R4LmRyYXdJbWFnZShiaXRtYXAsIDAsIDApOwogICAgICBiaXRtYXAuY2xvc2UoKTsKICAgICAgY29uc3QgYmxvYiA9IGF3YWl0IG9mZnNjcmVlbi5jb252ZXJ0VG9CbG9iKGRhdGFVUkxPcHRpb25zKTsKICAgICAgY29uc3QgdHlwZSA9IGJsb2IudHlwZTsKICAgICAgY29uc3QgYXJyYXlCdWZmZXIgPSBhd2FpdCBibG9iLmFycmF5QnVmZmVyKCk7CiAgICAgIGNvbnN0IGJhc2U2NCA9IGVuY29kZShhcnJheUJ1ZmZlcik7CiAgICAgIGlmICghbGFzdEJsb2JNYXAuaGFzKGlkKSAmJiBhd2FpdCB0cmFuc3BhcmVudEJhc2U2NCA9PT0gYmFzZTY0KSB7CiAgICAgICAgbGFzdEJsb2JNYXAuc2V0KGlkLCBiYXNlNjQpOwogICAgICAgIHJldHVybiB3b3JrZXIucG9zdE1lc3NhZ2UoeyBpZCB9KTsKICAgICAgfQogICAgICBpZiAobGFzdEJsb2JNYXAuZ2V0KGlkKSA9PT0gYmFzZTY0KSByZXR1cm4gd29ya2VyLnBvc3RNZXNzYWdlKHsgaWQgfSk7CiAgICAgIHdvcmtlci5wb3N0TWVzc2FnZSh7CiAgICAgICAgaWQsCiAgICAgICAgdHlwZSwKICAgICAgICBiYXNlNjQsCiAgICAgICAgd2lkdGgsCiAgICAgICAgaGVpZ2h0CiAgICAgIH0pOwogICAgICBsYXN0QmxvYk1hcC5zZXQoaWQsIGJhc2U2NCk7CiAgICB9IGVsc2UgewogICAgICByZXR1cm4gd29ya2VyLnBvc3RNZXNzYWdlKHsgaWQ6IGUuZGF0YS5pZCB9KTsKICAgIH0KICB9Owp9KSgpOwovLyMgc291cmNlTWFwcGluZ1VSTD1pbWFnZS1iaXRtYXAtZGF0YS11cmwtd29ya2VyLUlKcEM3Z19iLmpzLm1hcAo=")],{type:"text/javascript;charset=utf-8"});try{if(2!==Array.from([1],(e=>2*e))[0]){var Er=document.createElement("iframe");document.body.appendChild(Er),Array.from=(null==(Bt=Er.contentWindow)?void 0:Bt.Array.from)||Array.from,document.body.removeChild(Er)}}catch(e){console.debug("Unable to override Array.from",e)}new rr,function(e){e[e.NotStarted=0]="NotStarted",e[e.Running=1]="Running",e[e.Stopped=2]="Stopped"}(kr||(kr={}));class xr{constructor(e){$t(this,"fileName"),$t(this,"functionName"),$t(this,"lineNumber"),$t(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 Tr=/(^|@)\S+:\d+/,Mr=/^\s*at .*(\S+:\d+|\(native\))/m,Rr=/^(eval@)?(\[native code])?$/,Pr={parse:function(e){return e?void 0!==e.stacktrace||void 0!==e["opera#sourceloc"]?this.parseOpera(e):e.stack&&e.stack.match(Mr)?this.parseV8OrIE(e):e.stack?this.parseFFOrSafari(e):(console.warn("[console-record-plugin]: Failed to parse error object:",e),[]):[]},extractLocation:function(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:function(e){return e.stack.split("\n").filter((function(e){return!!e.match(Mr)}),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 xr({functionName:s,fileName:o,lineNumber:n[1],columnNumber:n[2]})}),this)},parseFFOrSafari:function(e){return e.stack.split("\n").filter((function(e){return!e.match(Rr)}),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 xr({functionName:e});var t=/((.*".+"[^@]*)?[^@]*)(?:@)/,r=e.match(t),i=r&&r[1]?r[1]:void 0,n=this.extractLocation(e.replace(t,""));return new xr({functionName:i,fileName:n[0],lineNumber:n[1],columnNumber:n[2]})}),this)},parseOpera:function(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:function(e){for(var t=/Line (\d+).*script (?:in )?(\S+)/i,r=e.message.split("\n"),i=[],n=2,s=r.length;n<s;n+=2){var o=t.exec(r[n]);o&&i.push(new xr({fileName:o[2],lineNumber:parseFloat(o[1])}))}return i},parseOpera10:function(e){for(var t=/Line (\d+).*script (?:in )?(\S+)(?:: In function (\S+))?$/i,r=e.stacktrace.split("\n"),i=[],n=0,s=r.length;n<s;n+=2){var o=t.exec(r[n]);o&&i.push(new xr({functionName:o[3]||void 0,fileName:o[2],lineNumber:parseFloat(o[1])}))}return i},parseOpera11:function(e){return e.stack.split("\n").filter((function(e){return!!e.match(Tr)&&!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 xr({functionName:i,fileName:r[0],lineNumber:r[1],columnNumber:r[2]})}),this)}};function Ar(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;s<i.children.length;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 Nr(e){return"[object Object]"===Object.prototype.toString.call(e)}function Fr(e,t){if(0===t)return!0;var r=Object.keys(e);for(var i of r)if(Nr(e[i])&&Fr(e[i],t-1))return!0;return!1}function Lr(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(function(e){if(Nr(e)&&Object.keys(e).length>r.numOfKeysLimit)return!0;if("function"==typeof e)return!0;if(Nr(e)&&Fr(e,r.depthOfLimit))return!0;return!1}(t))return function(e){var t=e.toString();r.stringLengthLimit&&t.length>r.stringLengthLimit&&(t=t.slice(0,r.stringLengthLimit)+"...");return t}(t);if("bigint"==typeof t)return t.toString()+"n";if(t instanceof Event){var o={};for(var a in t){var l=t[a];Array.isArray(l)?o[a]=Ar(l.length?l[0]:null):o[a]=l}return o}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 Or={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 Dr(e,t,r){var i,n=r?Object.assign({},Or,r):Or,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=t.error,s=Pr.parse(i).map((e=>e.toString())),o=[Lr(r,n.stringifyOptions)];e({level:"error",trace:s,payload:o})};t.addEventListener("error",u),l.push((()=>{t.removeEventListener("error",u)}));var c=t=>{var r,i;t.reason instanceof Error?i=[Lr("Uncaught (in promise) "+(r=t.reason).name+": "+r.message,n.stringifyOptions)]:(r=new Error,i=[Lr("Uncaught (in promise)",n.stringifyOptions),Lr(t.reason,n.stringifyOptions)]);var s=Pr.parse(r).map((e=>e.toString()));e({level:"error",trace:s,payload:i})};t.addEventListener("unhandledrejection",c),l.push((()=>{t.removeEventListener("unhandledrejection",c)}))}for(var d of n.level)l.push(h(i,d));return()=>{l.forEach((e=>e()))};function h(t,r){var i=this;return t[r]?Sr.patch(t,r,(t=>function(){for(var s=arguments.length,l=new Array(s),u=0;u<s;u++)l[u]=arguments[u];if(t.apply(i,l),!("assert"===r&&l[0]||a)){a=!0;try{var c=Pr.parse(new Error).map((e=>e.toString())).splice(1),d=("assert"===r?l.slice(1):l).map((e=>Lr(e,n.stringifyOptions)));++o<n.lengthThreshold?e({level:r,trace:c,payload:d}):o===n.lengthThreshold&&e({level:"warn",trace:[],payload:[Lr("The number of log records reached the threshold.")]})}catch(e){t("rrweb logger error:",e,...l)}finally{a=!1}}})):()=>{}}}var Hr=e=>({name:"rrweb/console@1",observer:Dr,options:e}),qr=["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"],Br=function(e,t){if(void 0===t&&(t=[]),!e)return!1;var r=e.toLowerCase();return qr.concat(t).some((e=>{var t=e.toLowerCase();return-1!==r.indexOf(t)}))},Vr=["$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"];function $r(e,t){return-1!==e.indexOf(t)}var Ur=function(e){return e.trim()},Wr=function(e){return e.replace(/^\$/,"")};var zr=Array.isArray,jr=Object.prototype,Zr=jr.hasOwnProperty,Gr=jr.toString,Yr=zr||function(e){return"[object Array]"===Gr.call(e)},Xr=e=>"function"==typeof e,Kr=e=>Xr(e)&&-1!==e.toString().indexOf("[native code]"),Jr=e=>e===Object(e)&&!Yr(e),Qr=e=>{if(Jr(e)){for(var t in e)if(Zr.call(e,t))return!1;return!0}return!1},ei=e=>void 0===e,ti=e=>"[object String]"==Gr.call(e),ri=e=>ti(e)&&0===e.trim().length,ii=e=>null===e,ni=e=>ei(e)||ii(e),si=e=>"[object Number]"==Gr.call(e),oi=e=>"[object Boolean]"===Gr.call(e),ai=e=>e instanceof FormData,li=e=>$r(Vr,e);function ui(e){return null===e||"object"!=typeof e}function ci(e,t){return Object.prototype.toString.call(e)==="[object "+t+"]"}function di(e){return!ei(Event)&&function(e,t){try{return e instanceof t}catch(e){return!1}}(e,Event)}var hi=[!0,"true",1,"1","yes"],pi=e=>$r(hi,e),vi=[!1,"false",0,"0","no"];function gi(e,t,r,i,n){return t>r&&(i.warn("min cannot be greater than max."),t=r),si(e)?e>r?(i.warn(" cannot be greater than max: "+r+". Using max value instead."),r):e<t?(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),gi(n||r,t,r,i))}class _i{constructor(e){this._buckets={},this._onBucketRateLimited=e._onBucketRateLimited,this._bucketSize=gi(e.bucketSize,0,100,e._logger),this._refillRate=gi(e.refillRate,0,this._bucketSize,e._logger),this._refillInterval=gi(e.refillInterval,0,864e5,e._logger)}_applyRefill(e,t){var r=t-e.lastAccess,i=Math.floor(r/this._refillInterval);if(i>0){var n=i*this._refillRate;e.tokens=Math.min(e.tokens+n,this._bucketSize),e.lastAccess=e.lastAccess+i*this._refillInterval}}consumeRateLimit(e){var t,r=Date.now(),i=String(e),n=this._buckets[i];return n?this._applyRefill(n,r):(n={tokens:this._bucketSize,lastAccess:r},this._buckets[i]=n),0===n.tokens||(n.tokens--,0===n.tokens&&(null==(t=this._onBucketRateLimited)||t.call(this,e)),0===n.tokens)}stop(){this._buckets={}}}var fi="Mobile",mi="iOS",yi="Android",bi="Tablet",Si=yi+" "+bi,wi="iPad",Ci="Apple",Ii=Ci+" Watch",ki="Safari",Ei="BlackBerry",xi="Samsung",Ti=xi+"Browser",Mi=xi+" Internet",Ri="Chrome",Pi=Ri+" OS",Ai=Ri+" "+mi,Ni="Internet Explorer",Fi=Ni+" "+fi,Li="Opera",Oi=Li+" Mini",Di="Edge",Hi="Microsoft "+Di,qi="Firefox",Bi=qi+" "+mi,Vi="Nintendo",$i="PlayStation",Ui="Xbox",Wi=yi+" "+fi,zi=fi+" "+ki,ji="Windows",Zi=ji+" Phone",Gi="Nokia",Yi="Ouya",Xi="Generic",Ki=Xi+" "+fi.toLowerCase(),Ji=Xi+" "+bi.toLowerCase(),Qi="Konqueror",en="(\\d+(\\.\\d+)?)",tn=new RegExp("Version/"+en),rn=new RegExp(Ui,"i"),nn=new RegExp($i+" \\w+","i"),sn=new RegExp(Vi+" \\w+","i"),on=new RegExp(Ei+"|PlayBook|BB10","i"),an={"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"};var ln,un,cn,dn=(e,t)=>t&&$r(t,Ci)||function(e){return $r(e,ki)&&!$r(e,Ri)&&!$r(e,yi)}(e),hn=function(e,t){return t=t||"",$r(e," OPR/")&&$r(e,"Mini")?Oi:$r(e," OPR/")?Li:on.test(e)?Ei:$r(e,"IE"+fi)||$r(e,"WPDesktop")?Fi:$r(e,Ti)?Mi:$r(e,Di)||$r(e,"Edg/")?Hi:$r(e,"FBIOS")?"Facebook "+fi:$r(e,"UCWEB")||$r(e,"UCBrowser")?"UC Browser":$r(e,"CriOS")?Ai:$r(e,"CrMo")||$r(e,Ri)?Ri:$r(e,yi)&&$r(e,ki)?Wi:$r(e,"FxiOS")?Bi:$r(e.toLowerCase(),Qi.toLowerCase())?Qi:dn(e,t)?$r(e,fi)?zi:ki:$r(e,qi)?qi:$r(e,"MSIE")||$r(e,"Trident/")?Ni:$r(e,"Gecko")?qi:""},pn={[Fi]:[new RegExp("rv:"+en)],[Hi]:[new RegExp(Di+"?\\/"+en)],[Ri]:[new RegExp("("+Ri+"|CrMo)\\/"+en)],[Ai]:[new RegExp("CriOS\\/"+en)],"UC Browser":[new RegExp("(UCBrowser|UCWEB)\\/"+en)],[ki]:[tn],[zi]:[tn],[Li]:[new RegExp("(Opera|OPR)\\/"+en)],[qi]:[new RegExp(qi+"\\/"+en)],[Bi]:[new RegExp("FxiOS\\/"+en)],[Qi]:[new RegExp("Konqueror[:/]?"+en,"i")],[Ei]:[new RegExp(Ei+" "+en),tn],[Wi]:[new RegExp("android\\s"+en,"i")],[Mi]:[new RegExp(Ti+"\\/"+en)],[Ni]:[new RegExp("(rv:|MSIE )"+en)],Mozilla:[new RegExp("rv:"+en)]},vn=function(e,t){var r=hn(e,t),i=pn[r];if(ei(i))return null;for(var n=0;n<i.length;n++){var s=i[n],o=e.match(s);if(o)return parseFloat(o[o.length-2])}return null},gn=[[new RegExp(Ui+"; "+Ui+" (.*?)[);]","i"),e=>[Ui,e&&e[1]||""]],[new RegExp(Vi,"i"),[Vi,""]],[new RegExp($i,"i"),[$i,""]],[on,[Ei,""]],[new RegExp(ji,"i"),(e,t)=>{if(/Phone/.test(t)||/WPDesktop/.test(t))return[Zi,""];if(new RegExp(fi).test(t)&&!/IEMobile\b/.test(t))return[ji+" "+fi,""];var r=/Windows NT ([0-9.]+)/i.exec(t);if(r&&r[1]){var i=r[1],n=an[i]||"";return/arm/i.test(t)&&(n="RT"),[ji,n]}return[ji,""]}],[/((iPhone|iPad|iPod).*?OS (\d+)_(\d+)_?(\d+)?|iPhone)/,e=>{if(e&&e[3]){var t=[e[3],e[4],e[5]||"0"];return[mi,t.join(".")]}return[mi,""]}],[/(watch.*\/(\d+\.\d+\.\d+)|watch os,(\d+\.\d+),)/i,e=>{var t="";return e&&e.length>=3&&(t=ei(e[2])?e[3]:e[2]),["watchOS",t]}],[new RegExp("("+yi+" (\\d+)\\.(\\d+)\\.?(\\d+)?|"+yi+")","i"),e=>{if(e&&e[2]){var t=[e[2],e[3],e[4]||"0"];return[yi,t.join(".")]}return[yi,""]}],[/Mac OS X (\d+)[_.](\d+)[_.]?(\d+)?/i,e=>{var t=["Mac OS X",""];if(e&&e[1]){var r=[e[1],e[2],e[3]||"0"];t[1]=r.join(".")}return t}],[/Mac/i,["Mac OS X",""]],[/CrOS/,[Pi,""]],[/Linux|debian/i,["Linux",""]]],_n=function(e){return sn.test(e)?Vi:nn.test(e)?$i:rn.test(e)?Ui:new RegExp(Yi,"i").test(e)?Yi:new RegExp("("+Zi+"|WPDesktop)","i").test(e)?Zi:/iPad/.test(e)?wi:/iPod/.test(e)?"iPod Touch":/iPhone/.test(e)?"iPhone":/(watch)(?: ?os[,/]|\d,\d\/)[\d.]+/i.test(e)?Ii:on.test(e)?Ei:/(kobo)\s(ereader|touch)/i.test(e)?"Kobo":new RegExp(Gi,"i").test(e)?Gi:/(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(fi).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)?yi:Si:new RegExp("(pda|"+fi+")","i").test(e)?Ki:new RegExp(bi,"i").test(e)&&!new RegExp(bi+" pc","i").test(e)?Ji:""},fn=function(e){var t=_n(e);return t===wi||t===Si||"Kobo"===t||"Kindle Fire"===t||t===Ji?bi:t===Vi||t===Ui||t===$i||t===Yi?"Console":t===Ii?"Wearable":t?fi:"Desktop"},mn=e=>e instanceof Error;function yn(e){var t=globalThis._posthogChunkIds;if(t){var r=Object.keys(t);return cn&&r.length===un||(un=r.length,cn=r.reduce(((r,i)=>{ln||(ln={});var n=ln[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,ln[i]=[l,u];break}}return r}),{})),cn}}class bn{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(),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?1: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(){return{chunkIdMap:yn(this.stackParser)}}buildCoercingContext(e,t,i){void 0===i&&(i=0);var n=(r,i)=>{if(i<=4){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 Sn="?";function wn(e,t,r,i,n){var s={platform:e,filename:t,function:"<anonymous>"===r?Sn:r,in_app:!0};return ei(i)||(s.lineno=i),ei(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]:Sn,r?"safari-extension:"+t:"safari-web-extension:"+t]:[e,t]},In=/^\s*at (\S+?)(?::(\d+))(?::(\d+))\s*$/i,kn=/^\s*at (?:(.+?\)(?: \[.+\])?|.*?) ?\((?:address at )?)?(?:async )?((?:<anonymous>|[-a-z]+:|.*bundle|\/)?.*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i,En=/\((\S*)(?::(\d+))(?::(\d+))\)/,xn=(e,t)=>{var r=In.exec(e);if(r){var[,i,n,s]=r;return wn(t,i,Sn,+n,+s)}var o=kn.exec(e);if(o){if(o[2]&&0===o[2].indexOf("eval")){var a=En.exec(o[2]);a&&(o[2]=a[1],o[3]=a[2],o[4]=a[3])}var[l,u]=Cn(o[1]||Sn,o[2]);return wn(t,u,l,o[3]?+o[3]:void 0,o[4]?+o[4]:void 0)}},Tn=/^\s*(.*?)(?:\((.*?)\))?(?:^|@)?((?:[-a-z]+)?:\/.*?|\[native code\]|[^@]*(?:bundle|\d+\.js)|\/[\w\-. /=]+)(?::(\d+))?(?::(\d+))?\s*$/i,Mn=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i,Rn=(e,t)=>{var r=Tn.exec(e);if(r){if(r[3]&&r[3].indexOf(" > eval")>-1){var i=Mn.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]||Sn;return[s,n]=Cn(s,n),wn(t,n,s,r[4]?+r[4]:void 0,r[5]?+r[5]:void 0)}},Pn=/\(error: (.*)\)/,An=50;function Nn(e){for(var t=arguments.length,i=new Array(t>1?t-1:0),n=1;n<t;n++)i[n-1]=arguments[n];return function(t,n){void 0===n&&(n=0);for(var s=[],o=t.split("\n"),a=n;a<o.length;a++){var l=o[a];if(!(l.length>1024)){var u=Pn.test(l)?l.replace(Pn,"$1"):l;if(!u.match(/\S*Error: /)){for(var c of i){var d=c(u,e);if(d){s.push(d);break}}if(s.length>=An)break}}}return function(e){if(!e.length)return[];var t=Array.from(e);return t.reverse(),t.slice(0,An).map((e=>{return r({},e,{filename:e.filename||(i=t,i[i.length-1]||{}).filename,function:e.function||Sn});var i}))}(s)}}class Fn{match(e){return this.isDOMException(e)||this.isDOMError(e)}coerce(e,t){var r=ti(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 ci(e,"DOMException")}isDOMError(e){return ci(e,"DOMError")}}class Ln{match(e){return(e=>e instanceof Error)(e)}coerce(e,t){return{type:this.getType(e),value:this.getMessage(e,t),stack:this.getStack(e),cause:e.cause?t.next(e.cause):void 0,synthetic:!1}}getType(e){return e.name||e.constructor.name}getMessage(e,t){var r=e.message;return r.error&&"string"==typeof r.error.message?String(r.error.message):String(r)}getStack(e){return e.stacktrace||e.stack||void 0}}class On{constructor(){}match(e){return ci(e,"ErrorEvent")&&null!=e.error}coerce(e,t){var r,i=t.apply(e.error);return i||{type:"ErrorEvent",value:e.message,stack:null==(r=t.syntheticException)?void 0:r.stack,synthetic:!0}}}var Dn=/^(?:[Uu]ncaught (?:exception: )?)?(?:((?:Eval|Internal|Range|Reference|Syntax|Type|URI|)Error): )?(.*)$/i;class Hn{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(Dn);return i&&(t=i[1],r=i[2]),[t,r]}}var qn=["fatal","error","warning","log","info","debug"];function Bn(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(!(n.length>t))return i===r.length||n.length<=t?n:n.slice(0,t)+"..."}return""}class Vn{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 di(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: "+Bn(e)}isSeverityLevel(e){return ti(e)&&!ri(e)&&qn.indexOf(e)>=0}getErrorPropertyFromObject(e){for(var t in e)if(Object.prototype.hasOwnProperty.call(e,t)){var r=e[t];if(mn(r))return r}}getObjectClassName(e){try{var t=Object.getPrototypeOf(e);return t?t.constructor.name:void 0}catch(e){return}}}class $n{match(e){return di(e)}coerce(e,t){var r,i=e.constructor.name;return{type:i,value:i+" captured as exception with keys: "+Bn(e),stack:null==(r=t.syntheticException)?void 0:r.stack,synthetic:!0}}}class Un{match(e){return ui(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 Wn{match(e){return ci(e,"PromiseRejectionEvent")}coerce(e,t){var r,i=this.getUnhandledRejectionReason(e);return ui(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){if(ui(e))return e;try{if("reason"in e)return e.reason;if("detail"in e&&"reason"in e.detail)return e.detail.reason}catch(e){}return e}}var zn="undefined"!=typeof window?window:void 0,jn="undefined"!=typeof globalThis?globalThis:zn;"undefined"==typeof self&&(jn.self=jn),"undefined"==typeof File&&(jn.File=function(){});var Zn=Array.prototype,Gn=Zn.forEach,Yn=Zn.indexOf,Xn=null==jn?void 0:jn.navigator,Kn=null==jn?void 0:jn.document,Jn=null==jn?void 0:jn.location,Qn=null==jn?void 0:jn.fetch,es=null!=jn&&jn.XMLHttpRequest&&"withCredentials"in new jn.XMLHttpRequest?jn.XMLHttpRequest:void 0,ts=null==jn?void 0:jn.AbortController,rs=null==Xn?void 0:Xn.userAgent,is=null!=zn?zn:{},ns=()=>!!zn.Zone,ss=e=>e instanceof Document,os={DEBUG:!1,LIB_VERSION:"1.311.0"},as=function(e,t){var{debugEnabled:r}=void 0===t?{}:t,i={_log:function(t){if(zn&&(os.DEBUG||is.POSTHOG_DEBUG||r)&&!ei(zn.console)&&zn.console){for(var i=("__rrweb_original__"in zn.console[t]?zn.console[t].__rrweb_original__:zn.console[t]),n=arguments.length,s=new Array(n>1?n-1:0),o=1;o<n;o++)s[o-1]=arguments[o];i(e,...s)}},info:function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];i._log("log",...t)},warn:function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];i._log("warn",...t)},error:function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];i._log("error",...t)},critical:function(){for(var t=arguments.length,r=new Array(t),i=0;i<t;i++)r[i]=arguments[i];console.error(e,...r)},uninitializedWarning:e=>{i.error("You must initialize PostHog before calling "+e)},createLogger:(t,r)=>as(e+" "+t,r)};return i},ls=as("[PostHog.js]"),us=ls.createLogger,cs={};function ds(e,t,r){if(Yr(e))if(Gn&&e.forEach===Gn)e.forEach(t,r);else if("length"in e&&e.length===+e.length)for(var i=0,n=e.length;i<n;i++)if(i in e&&t.call(r,e[i],i)===cs)return}function hs(e,t,r){if(!ni(e)){if(Yr(e))return ds(e,t,r);if(ai(e)){for(var i of e.entries())if(t.call(r,i[1],i[0])===cs)return}else for(var n in e)if(Zr.call(e,n)&&t.call(r,e[n],n)===cs)return}}var ps=function(e){for(var t=arguments.length,r=new Array(t>1?t-1:0),i=1;i<t;i++)r[i-1]=arguments[i];return ds(r,(function(t){for(var r in t)void 0!==t[r]&&(e[r]=t[r])})),e},vs=function(e){for(var t=arguments.length,r=new Array(t>1?t-1:0),i=1;i<t;i++)r[i-1]=arguments[i];return ds(r,(function(t){ds(t,(function(t){e.push(t)}))})),e};function gs(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 _s=function(e){try{return e()}catch(e){return}},fs=function(e){return function(){try{for(var t=arguments.length,r=new Array(t),i=0;i<t;i++)r[i]=arguments[i];return e.apply(this,r)}catch(e){ls.critical("Implementation error. Please turn on debug mode and open a ticket on https://app.posthog.com/home#panel=support%3Asupport%3A."),ls.critical(e)}}},ms=function(e){var t={};return hs(e,(function(e,r){(ti(e)&&e.length>0||si(e))&&(t[r]=e)})),t};function ys(e,t){return r=e,i=e=>ti(e)&&!ii(t)?e.slice(0,t):e,n=new Set,function e(t,r){return t!==Object(t)?i?i(t,r):t:n.has(t)?void 0:(n.add(t),Yr(t)?(s=[],ds(t,(t=>{s.push(e(t))}))):(s={},hs(t,((t,r)=>{n.has(t)||(s[r]=e(t,r))}))),s);var s}(r);var r,i,n}var bs=["herokuapp.com","vercel.app","netlify.app"];function Ss(e){var t=null==e?void 0:e.hostname;if(!ti(t))return!1;var r=t.split(".").slice(-2).join(".");for(var i of bs)if(r===i)return!1;return!0}function ws(e,t){for(var r=0;r<e.length;r++)if(t(e[r]))return e[r]}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})}var Is=e=>{var t=null==Kn?void 0:Kn.createElement("a");return ei(t)?null:(t.href=e,t)},ks=function(e,t){var r,i;void 0===t&&(t="&");var n=[];return hs(e,(function(e,t){ei(e)||ei(t)||"undefined"===t||(r=encodeURIComponent((e=>e instanceof File)(e)?e.name:e.toString()),i=encodeURIComponent(t),n[n.length]=i+"="+r)})),n.join(t)},Es=function(e,t){for(var r,i=((e.split("#")[0]||"").split(/\?(.*)/)[1]||"").replace(/^\?+/g,"").split("&"),n=0;n<i.length;n++){var s=i[n].split("=");if(s[0]===t){r=s;break}}if(!Yr(r)||r.length<2)return"";var o=r[1];try{o=decodeURIComponent(o)}catch(e){ls.error("Skipping decoding for malformed query param: "+o)}return o.replace(/\+/g," ")},xs=function(e,t,r){if(!e||!t||!t.length)return e;for(var i=e.split("#"),n=i[0]||"",s=i[1],o=n.split("?"),a=o[1],l=o[0],u=(a||"").split("&"),c=[],d=0;d<u.length;d++){var h=u[d].split("=");Yr(h)&&(t.includes(h[0])?c.push(h[0]+"="+r):c.push(u[d]))}var p=l;return null!=a&&(p+="?"+c.join("&")),null!=s&&(p+="#"+s),p},Ts=function(e,t){var r=e.match(new RegExp(t+"=([^&]*)"));return r?r[1]:null};function Ms(e,t,r){try{if(!(t in e))return()=>{};var i=e[t],n=r(i);return Xr(n)&&(n.prototype=n.prototype||{},Object.defineProperties(n,{__posthog_wrapped__:{enumerable:!1,value:!0}})),e[t]=n,()=>{e[t]=i}}catch(e){return()=>{}}}function Rs(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}var Ps="$people_distinct_id",As="__alias",Ns="__timers",Fs="$autocapture_disabled_server_side",Ls="$heatmaps_enabled_server_side",Os="$exception_capture_enabled_server_side",Ds="$error_tracking_suppression_rules",Hs="$error_tracking_capture_extension_exceptions",qs="$web_vitals_enabled_server_side",Bs="$dead_clicks_enabled_server_side",Vs="$product_tours_enabled_server_side",$s="$web_vitals_allowed_metrics",Us="$session_recording_remote_config",Ws="$sesid",zs="$session_is_sampled",js="$enabled_feature_flags",Zs="$early_access_features",Gs="$feature_flag_details",Ys="$stored_person_properties",Xs="$stored_group_properties",Ks="$surveys",Js="$flag_call_reported",Qs="$user_state",eo="$client_session_props",to="$capture_rate_limit",ro="$initial_campaign_params",io="$initial_referrer_info",no="$initial_person_info",so="$epp",oo="__POSTHOG_TOOLBAR__",ao="$posthog_cookieless",lo=[Ps,As,"__cmpns",Ns,"$session_recording_enabled_server_side",Ls,Ws,js,Ds,Qs,Zs,Gs,Xs,Ys,Ks,Js,eo,to,ro,io,so,no,"$conversations_widget_session_id","$conversations_ticket_id","$conversations_widget_state","$conversations_user_traits"];function uo(e){return e instanceof Element&&(e.id===oo||!(null==e.closest||!e.closest(".toolbar-global-fade-container")))}function co(e){return!!e&&1===e.nodeType}function ho(e,t){return!!e&&!!e.tagName&&e.tagName.toLowerCase()===t.toLowerCase()}function po(e){return!!e&&3===e.nodeType}function vo(e){return!!e&&11===e.nodeType}function go(e){return e?Ur(e).split(/\s+/):[]}function _o(e){var t=null==zn?void 0:zn.location.href;return!!(t&&e&&e.some((e=>t.match(e))))}function fo(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 go(t)}function mo(e){return ni(e)?null:Ur(e).split(/(\s+)/).filter((e=>qo(e))).join("").replace(/[\r\n]/g," ").replace(/[ ]+/g," ").substring(0,255)}function yo(e){var t="";return Po(e)&&!Ao(e)&&e.childNodes&&e.childNodes.length&&hs(e.childNodes,(function(e){var r;po(e)&&e.textContent&&(t+=null!==(r=mo(e.textContent))&&void 0!==r?r:"")})),Ur(t)}function bo(e){return ei(e.target)?e.srcElement||null:null!=(t=e.target)&&t.shadowRoot?e.composedPath()[0]||null:e.target||null;var t}var So=["a","button","form","input","select","textarea","label"];function wo(e,t){if(ei(t))return!0;var r,i=function(e){if(t.some((t=>e.matches(t))))return{v:!0}};for(var n of e)if(r=i(n))return r.v;return!1}function Co(e){var t=e.parentNode;return!(!t||!co(t))&&t}var Io=["next","previous","prev",">","<"],ko=10;var Eo=[".ph-no-rageclick",".ph-no-capture"];function xo(e,t){if(!zn||To(e))return!1;var r,i,n;oi(t)?(r=!!t&&Eo,i=void 0):(r=null!==(n=null==t?void 0:t.css_selector_ignorelist)&&void 0!==n?n:Eo,i=null==t?void 0:t.content_ignorelist);if(!1===r)return!1;var{targetElementList:s}=Mo(e,!1);return!function(e,t){if(!1===e||ei(e))return!1;var r;if(!0===e)r=Io;else{if(!Yr(e))return!1;if(e.length>ko)return ls.error("[PostHog] content_ignorelist array cannot exceed "+ko+" 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=>t.includes(e)||i.includes(e)))}))}(i,s.map((e=>{var t;return{safeText:yo(e).toLowerCase(),ariaLabel:(null==(t=e.getAttribute("aria-label"))?void 0:t.toLowerCase().trim())||""}})))&&!wo(s,r)}var To=e=>!e||ho(e,"html")||!co(e),Mo=(e,t)=>{if(!zn||To(e))return{parentIsUsefulElement:!1,targetElementList:[]};for(var r=!1,i=[e],n=e;n.parentNode&&!ho(n,"body");)if(vo(n.parentNode))i.push(n.parentNode.host),n=n.parentNode.host;else{var s=Co(n);if(!s)break;if(t||So.indexOf(s.tagName.toLowerCase())>-1)r=!0;else{var o=zn.getComputedStyle(s);o&&"pointer"===o.getPropertyValue("cursor")&&(r=!0)}i.push(s),n=s}return{parentIsUsefulElement:r,targetElementList:i}};function Ro(e,t,r,i,n){var s,o,a,l;if(void 0===r&&(r=void 0),!zn||To(e))return!1;if(null!=(s=r)&&s.url_allowlist&&!_o(r.url_allowlist))return!1;if(null!=(o=r)&&o.url_ignorelist&&_o(r.url_ignorelist))return!1;if(null!=(a=r)&&a.dom_event_allowlist){var u=r.dom_event_allowlist;if(u&&!u.some((e=>t.type===e)))return!1}var{parentIsUsefulElement:c,targetElementList:d}=Mo(e,i);if(!function(e,t){var r=null==t?void 0:t.element_allowlist;if(ei(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}(d,r))return!1;if(!wo(d,null==(l=r)?void 0:l.css_selector_allowlist))return!1;var h=zn.getComputedStyle(e);if(h&&"pointer"===h.getPropertyValue("cursor")&&"click"===t.type)return!0;var p=e.tagName.toLowerCase();switch(p){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 c?(n||["click"]).indexOf(t.type)>=0:(n||["click"]).indexOf(t.type)>=0&&(So.indexOf(p)>-1||"true"===e.getAttribute("contenteditable"))}}function Po(e){for(var t=e;t.parentNode&&!ho(t,"body");t=t.parentNode){var r=fo(t);if($r(r,"ph-sensitive")||$r(r,"ph-no-capture"))return!1}if($r(fo(e),"ph-include"))return!0;var i=e.type||"";if(ti(i))switch(i.toLowerCase()){case"hidden":case"password":return!1}var n=e.name||e.id||"";if(ti(n)){if(/^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,"")))return!1}return!0}function Ao(e){return!!(ho(e,"input")&&!["button","checkbox","submit","reset"].includes(e.type)||ho(e,"select")||ho(e,"textarea")||"true"===e.getAttribute("contenteditable"))}var No="(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})",Fo=new RegExp("^(?:"+No+")$"),Lo=new RegExp(No),Oo="\\d{3}-?\\d{2}-?\\d{4}",Do=new RegExp("^("+Oo+")$"),Ho=new RegExp("("+Oo+")");function qo(e,t){if(void 0===t&&(t=!0),ni(e))return!1;if(ti(e)){if(e=Ur(e),(t?Fo:Lo).test((e||"").replace(/[- ]/g,"")))return!1;if((t?Do:Ho).test(e))return!1}return!0}function Bo(e){var t=yo(e);return qo(t=(t+" "+Vo(e)).trim())?t:""}function Vo(e){var t="";return e&&e.childNodes&&e.childNodes.length&&hs(e.childNodes,(function(e){var r;if(e&&"span"===(null==(r=e.tagName)?void 0:r.toLowerCase()))try{var i=yo(e);t=(t+" "+i).trim(),e.childNodes&&e.childNodes.length&&(t=(t+" "+Vo(e)).trim())}catch(e){ls.error("[AutoCapture]",e)}})),t}function $o(e){return 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 gs(o).sort(((e,t)=>{var[r]=e,[i]=t;return r.localeCompare(i)})).forEach((e=>{var[t,r]=e;return a[Uo(t.toString())]=Uo(r.toString())})),n+=":",n+=gs(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:Wo(e),attr_id:e.attr__id,nth_child:e.nth_child,nth_of_type:e.nth_of_type,attributes:{}};return gs(e).filter((e=>{var[t]=e;return 0===t.indexOf("attr__")})).forEach((e=>{var[t,r]=e;return i.attributes[t]=r})),i}))}(e))}function Uo(e){return e.replace(/"|\\"/g,'\\"')}function Wo(e){var t=e.attr__class;return t?Yr(t)?t:go(t):void 0}var zo={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:1e6,payloadHostDenyList:[".lr-ingest.io",".ingest.sentry.io",".clarity.ms","analytics.google.com","bam.nr-data.net"]},jo=us("[Recorder]"),Zo=e=>"navigation"===e.entryType,Go=e=>"resource"===e.entryType;function Yo(e,t,r){if(r.recordInitialRequests){var i=t.performance.getEntries().filter((e=>Zo(e)||Go(e)&&r.initiatorTypes.includes(e.initiatorType)));e({requests:i.flatMap((e=>ra({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=>Zo(e)||Go(e)&&r.initiatorTypes.includes(e.initiatorType)&&(e=>!r.recordBody&&!r.recordHeaders||"xmlhttprequest"!==e.initiatorType&&"fetch"!==e.initiatorType)(e)));e({requests:i.flatMap((e=>ra({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()}}function Xo(e,t){return!!t&&(oi(t)||t[e])}function Ko(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.includes(e)))}if(!r)return!1;if(function e(t){try{return"string"==typeof t?t.startsWith("blob:"):t instanceof URL?"blob:"===t.protocol:t instanceof Request&&e(t.url)}catch(e){return!1}}(n))return!1;if(oi(r))return!0;if(Yr(r))return s(r);var o=r[t];return oi(o)?o:s(o)}function Jo(e,t,r,i,n,s){return Qo.apply(this,arguments)}function Qo(){return Qo=t((function*(e,t,r,i,n,s){if(void 0===s&&(s=0),s>10)return jo.warn("Failed to get performance entry for request",{url:r,initiatorType:t}),null;var o=function(e,t){for(var r=e.length-1;r>=0;r-=1)if(t(e[r]))return e[r]}(e.performance.getEntriesByName(r),(e=>Go(e)&&e.initiatorType===t&&(ei(i)||e.startTime>=i)&&(ei(n)||e.startTime<=n)));return o||(yield new Promise((e=>setTimeout(e,50*s))),Jo(e,t,r,i,n,s+1))})),Qo.apply(this,arguments)}function ea(e){var{body:t,options:r,url:i}=e;if(ni(t))return null;var{hostname:n,isHostDenied:s}=Rs(i,r);if(s)return n+" is in deny list";if(ti(t))return t;if(ss(t))return t.textContent;if(ai(t))return ks(t);if(Jr(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 ta=e=>!ii(e)&&("navigation"===e.entryType||"resource"===e.entryType);function ra(e){var{entry:t,method:i,status:n,networkRequest:s,isInitial:o,start:a,end:l,url:u,initiatorType:c}=e;a=t?t.startTime:a,l=t?t.responseEnd:l;var d=Math.floor(Date.now()-performance.now()),h=Math.floor(d+(a||0)),p=[r({},t?t.toJSON():{name:u},{startTime:ei(a)?void 0:Math.round(a),endTime:ei(l)?void 0:Math.round(l),timeOrigin:d,timestamp:h,method:i,initiatorType:c||(t?t.initiatorType:void 0),status:n,requestHeaders:s.requestHeaders,requestBody:s.requestBody,responseHeaders:s.responseHeaders,responseBody:s.responseBody,isInitial:o})];if(ta(t))for(var v of t.serverTiming||[])p.push({timeOrigin:d,timestamp:h,startTime:Math.round(t.startTime),name:v.name,duration:v.duration,entryType:"serverTiming"});return p}var ia=["video/","audio/"];function na(e){return new Promise(((t,r)=>{var i=setTimeout((()=>t("[SessionReplay] Timeout while trying to read body")),500);try{e.clone().text().then((e=>t(e)),(e=>r(e))).finally((()=>clearTimeout(i)))}catch(e){clearTimeout(i),t("[SessionReplay] Failed to read body")}}))}function sa(){return sa=t((function*(e){var{r:t,options:r,url:i}=e,{hostname:n,isHostDenied:s}=Rs(i,r);return s?Promise.resolve(n+" is in deny list"):na(t)})),sa.apply(this,arguments)}function oa(){return oa=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=ia.some((e=>null==s?void 0:s.startsWith(e)));if(s&&o)return"Content-Type "+s+" is not supported";var{hostname:a,isHostDenied:l}=Rs(n,i);return l?a+" is in deny list":null}({r:t,options:r,url:i});return ii(n)?na(t):Promise.resolve(n)})),oa.apply(this,arguments)}function aa(e,r,i){if(!i.initiatorTypes.includes("fetch"))return()=>{};var n=Xo("request",i.recordHeaders),s=Xo("response",i.recordHeaders),o=Ms(r,"fetch",(o=>function(){var a=t((function*(t,a){var l,u,c,d=new Request(t,a),h={};try{var p={};d.headers.forEach(((e,t)=>{p[t]=e})),n&&(h.requestHeaders=p),Ko({type:"request",headers:p,url:t,recordBody:i.recordBody})&&(h.requestBody=yield function(e){return sa.apply(this,arguments)}({r:d,options:i,url:t})),u=r.performance.now(),l=yield o(d),c=r.performance.now();var v={};return l.headers.forEach(((e,t)=>{v[t]=e})),s&&(h.responseHeaders=v),Ko({type:"response",headers:v,url:t,recordBody:i.recordBody})&&(h.responseBody=yield function(e){return oa.apply(this,arguments)}({r:l,options:i,url:t})),l}finally{Jo(r,"fetch",d.url,u,c).then((t=>{var r,i=ra({entry:t,method:d.method,status:null==(r=l)?void 0:r.status,networkRequest:h,start:u,end:c,url:d.url,initiatorType:"fetch"});e({requests:i})})).catch((()=>{}))}}));return function(e,t){return a.apply(this,arguments)}}()));return()=>{o()}}var la=null;function ua(e,t,i){if(!("performance"in t))return()=>{};if(la)return jo.warn("Network observer already initialised, doing nothing"),()=>{};var n=i?Object.assign({},zo,i):zo,s=t=>{var i=[];t.requests.forEach((e=>{var t=n.maskRequestFn(e);t&&i.push(t)})),i.length>0&&e(r({},t,{requests:i}))},o=Yo(s,t,n),a=()=>{},l=()=>{};return(n.recordHeaders||n.recordBody)&&(a=function(e,t,r){if(!r.initiatorTypes.includes("xmlhttprequest"))return()=>{};var i=Xo("request",r.recordHeaders),n=Xo("response",r.recordHeaders),s=Ms(t.XMLHttpRequest.prototype,"open",(s=>function(o,a,l,u,c){void 0===l&&(l=!0);var d,h,p=this,v=new Request(a),g={},_={},f=p.setRequestHeader.bind(p);p.setRequestHeader=(e,t)=>(_[e]=t,f(e,t)),i&&(g.requestHeaders=_);var m=p.send.bind(p);p.send=e=>(Ko({type:"request",headers:_,url:a,recordBody:r.recordBody})&&(g.requestBody=ea({body:e,options:r,url:a})),d=t.performance.now(),m(e));var y=()=>{p.removeEventListener("readystatechange",b),p.removeEventListener("error",y),p.removeEventListener("abort",y),p.removeEventListener("timeout",y)},b=()=>{if(p.readyState===p.DONE){y(),h=t.performance.now();var i={};p.getAllResponseHeaders().trim().split(/[\r\n]+/).forEach((e=>{var t=e.split(": "),r=t.shift(),n=t.join(": ");r&&(i[r]=n)})),n&&(g.responseHeaders=i),Ko({type:"response",headers:i,url:a,recordBody:r.recordBody})&&(g.responseBody=ea({body:p.response,options:r,url:a})),Jo(t,"xmlhttprequest",v.url,d,h).then((t=>{var r=ra({entry:t,method:o,status:null==p?void 0:p.status,networkRequest:g,start:d,end:h,url:a.toString(),initiatorType:"xmlhttprequest"});e({requests:r})})).catch((()=>{}))}};p.addEventListener("readystatechange",b),p.addEventListener("error",y),p.addEventListener("abort",y),p.addEventListener("timeout",y),s.call(p,o,a.toString(),l,u,c)}));return()=>{s()}}(s,t,n),l=aa(s,t,n)),la=()=>{o(),a(),l(),la=null}}var ca=e=>({name:"rrweb/network@1",observer:ua,options:e});is.__PosthogExtensions__=is.__PosthogExtensions__||{},is.__PosthogExtensions__.rrwebPlugins={getRecordConsolePlugin:Hr,getRecordNetworkPlugin:ca},is.__PosthogExtensions__.rrweb={record:qt,version:"v2"},is.rrweb={record:qt,version:"v2"},is.rrwebConsoleRecord={getRecordConsolePlugin:Hr},is.getRecordNetworkPlugin=ca;var da,ha,pa,va,ga,_a,fa,ma,ya={},ba=[],Sa=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,wa=Array.isArray;function Ca(e,t){for(var r in t)e[r]=t[r];return e}function Ia(e){var t=e.parentNode;t&&t.removeChild(e)}function ka(e,t,r){var i,n,s,o={};for(s in t)"key"==s?i=t[s]:"ref"==s?n=t[s]:o[s]=t[s];if(arguments.length>2&&(o.children=arguments.length>3?da.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 Ea(e,o,i,n,null)}function Ea(e,t,r,i,n){var s={type:e,props:t,key:r,ref:i,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,constructor:void 0,__v:null==n?++pa:n,__i:-1,__u:0};return null==n&&null!=ha.vnode&&ha.vnode(s),s}function xa(e){return e.children}function Ta(e,t){this.props=e,this.context=t}function Ma(e,t){if(null==t)return e.__?Ma(e.__,e.__i+1):null;for(var r;t<e.__k.length;t++)if(null!=(r=e.__k[t])&&null!=r.__e)return r.__e;return"function"==typeof e.type?Ma(e):null}function Ra(e){var t,r;if(null!=(e=e.__)&&null!=e.__c){for(e.__e=e.__c.base=null,t=0;t<e.__k.length;t++)if(null!=(r=e.__k[t])&&null!=r.__e){e.__e=e.__c.base=r.__e;break}return Ra(e)}}function Pa(e){(!e.__d&&(e.__d=!0)&&va.push(e)&&!Aa.__r++||ga!==ha.debounceRendering)&&((ga=ha.debounceRendering)||_a)(Aa)}function Aa(){var e,t,r,i,n,s,o,a,l;for(va.sort(fa);e=va.shift();)e.__d&&(t=va.length,i=void 0,s=(n=(r=e).__v).__e,a=[],l=[],(o=r.__P)&&((i=Ca({},n)).__v=n.__v+1,ha.vnode&&ha.vnode(i),Ba(o,i,n,r.__n,void 0!==o.ownerSVGElement,32&n.__u?[s]:null,a,null==s?Ma(n):s,!!(32&n.__u),l),i.__.__k[i.__i]=i,Va(a,i,l),i.__e!=s&&Ra(i)),va.length>t&&va.sort(fa));Aa.__r=0}function Na(e,t,r,i,n,s,o,a,l,u,c){var d,h,p,v,g,_=i&&i.__k||ba,f=t.length;for(r.__d=l,function(e,t,r){var i,n,s,o,a,l=t.length,u=r.length,c=u,d=0;for(e.__k=[],i=0;i<l;i++)null!=(n=e.__k[i]=null==(n=t[i])||"boolean"==typeof n||"function"==typeof n?null:"string"==typeof n||"number"==typeof n||"bigint"==typeof n||n.constructor==String?Ea(null,n,null,null,n):wa(n)?Ea(xa,{children:n},null,null,null):void 0===n.constructor&&n.__b>0?Ea(n.type,n.props,n.key,n.ref?n.ref:null,n.__v):n)?(n.__=e,n.__b=e.__b+1,a=La(n,r,o=i+d,c),n.__i=a,s=null,-1!==a&&(c--,(s=r[a])&&(s.__u|=131072)),null==s||null===s.__v?(-1==a&&d--,"function"!=typeof n.type&&(n.__u|=65536)):a!==o&&(a===o+1?d++:a>o?c>l-o?d+=a-o:d--:d=a<o&&a==o-1?a-o:0,a!==i+d&&(n.__u|=65536))):(s=r[i])&&null==s.key&&s.__e&&(s.__e==e.__d&&(e.__d=Ma(s)),Ua(s,s,!1),r[i]=null,c--);if(c)for(i=0;i<u;i++)null!=(s=r[i])&&0==(131072&s.__u)&&(s.__e==e.__d&&(e.__d=Ma(s)),Ua(s,s))}(r,t,_),l=r.__d,d=0;d<f;d++)null!=(p=r.__k[d])&&"boolean"!=typeof p&&"function"!=typeof p&&(h=-1===p.__i?ya:_[p.__i]||ya,p.__i=d,Ba(e,p,h,n,s,o,a,l,u,c),v=p.__e,p.ref&&h.ref!=p.ref&&(h.ref&&$a(h.ref,null,p),c.push(p.ref,p.__c||v,p)),null==g&&null!=v&&(g=v),65536&p.__u||h.__k===p.__k?l=Fa(p,l,e):"function"==typeof p.type&&void 0!==p.__d?l=p.__d:v&&(l=v.nextSibling),p.__d=void 0,p.__u&=-196609);r.__d=l,r.__e=g}function Fa(e,t,r){var i,n;if("function"==typeof e.type){for(i=e.__k,n=0;i&&n<i.length;n++)i[n]&&(i[n].__=e,t=Fa(i[n],t,r));return t}return e.__e!=t&&(r.insertBefore(e.__e,t||null),t=e.__e),t&&t.nextSibling}function La(e,t,r,i){var n=e.key,s=e.type,o=r-1,a=r+1,l=t[r];if(null===l||l&&n==l.key&&s===l.type)return r;if(i>(null!=l&&0==(131072&l.__u)?1:0))for(;o>=0||a<t.length;){if(o>=0){if((l=t[o])&&0==(131072&l.__u)&&n==l.key&&s===l.type)return o;o--}if(a<t.length){if((l=t[a])&&0==(131072&l.__u)&&n==l.key&&s===l.type)return a;a++}}return-1}function Oa(e,t,r){"-"===t[0]?e.setProperty(t,null==r?"":r):e[t]=null==r?"":"number"!=typeof r||Sa.test(t)?r:r+"px"}function Da(e,t,r,i,n){var s;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||Oa(e.style,t,"");if(r)for(t in r)i&&r[t]===i[t]||Oa(e.style,t,r[t])}else if("o"===t[0]&&"n"===t[1])s=t!==(t=t.replace(/(PointerCapture)$|Capture$/,"$1")),t=t.toLowerCase()in e?t.toLowerCase().slice(2):t.slice(2),e.l||(e.l={}),e.l[t+s]=r,r?i?r.u=i.u:(r.u=Date.now(),e.addEventListener(t,s?qa:Ha,s)):e.removeEventListener(t,s?qa:Ha,s);else{if(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&&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,r))}}function Ha(e){var t=this.l[e.type+!1];if(e.t){if(e.t<=t.u)return}else e.t=Date.now();return t(ha.event?ha.event(e):e)}function qa(e){return this.l[e.type+!0](ha.event?ha.event(e):e)}function Ba(e,t,r,i,n,s,o,a,l,u){var c,d,h,p,v,g,_,f,m,y,b,$,S,w,C,I=t.type;if(void 0!==t.constructor)return null;128&r.__u&&(l=!!(32&r.__u),s=[a=t.__e=r.__e]),(c=ha.__b)&&c(t);e:if("function"==typeof I)try{if(f=t.props,m=(c=I.contextType)&&i[c.__c],y=c?m?m.props.value:c.__:i,r.__c?_=(d=t.__c=r.__c).__=d.__E:("prototype"in I&&I.prototype.render?t.__c=d=new I(f,y):(t.__c=d=new Ta(f,y),d.constructor=I,d.render=Wa),m&&m.sub(d),d.props=f,d.state||(d.state={}),d.context=y,d.__n=i,h=d.__d=!0,d.__h=[],d._sb=[]),null==d.__s&&(d.__s=d.state),null!=I.getDerivedStateFromProps&&(d.__s==d.state&&(d.__s=Ca({},d.__s)),Ca(d.__s,I.getDerivedStateFromProps(f,d.__s))),p=d.props,v=d.state,d.__v=t,h)null==I.getDerivedStateFromProps&&null!=d.componentWillMount&&d.componentWillMount(),null!=d.componentDidMount&&d.__h.push(d.componentDidMount);else{if(null==I.getDerivedStateFromProps&&f!==p&&null!=d.componentWillReceiveProps&&d.componentWillReceiveProps(f,y),!d.__e&&(null!=d.shouldComponentUpdate&&!1===d.shouldComponentUpdate(f,d.__s,y)||t.__v===r.__v)){for(t.__v!==r.__v&&(d.props=f,d.state=d.__s,d.__d=!1),t.__e=r.__e,t.__k=r.__k,t.__k.forEach((function(e){e&&(e.__=t)})),b=0;b<d._sb.length;b++)d.__h.push(d._sb[b]);d._sb=[],d.__h.length&&o.push(d);break e}null!=d.componentWillUpdate&&d.componentWillUpdate(f,d.__s,y),null!=d.componentDidUpdate&&d.__h.push((function(){d.componentDidUpdate(p,v,g)}))}if(d.context=y,d.props=f,d.__P=e,d.__e=!1,$=ha.__r,S=0,"prototype"in I&&I.prototype.render){for(d.state=d.__s,d.__d=!1,$&&$(t),c=d.render(d.props,d.state,d.context),w=0;w<d._sb.length;w++)d.__h.push(d._sb[w]);d._sb=[]}else do{d.__d=!1,$&&$(t),c=d.render(d.props,d.state,d.context),d.state=d.__s}while(d.__d&&++S<25);d.state=d.__s,null!=d.getChildContext&&(i=Ca(Ca({},i),d.getChildContext())),h||null==d.getSnapshotBeforeUpdate||(g=d.getSnapshotBeforeUpdate(p,v)),Na(e,wa(C=null!=c&&c.type===xa&&null==c.key?c.props.children:c)?C:[C],t,r,i,n,s,o,a,l,u),d.base=t.__e,t.__u&=-161,d.__h.length&&o.push(d),_&&(d.__E=d.__=null)}catch(e){t.__v=null,l||null!=s?(t.__e=a,t.__u|=l?160:32,s[s.indexOf(a)]=null):(t.__e=r.__e,t.__k=r.__k),ha.__e(e,t,r)}else null==s&&t.__v===r.__v?(t.__k=r.__k,t.__e=r.__e):t.__e=function(e,t,r,i,n,s,o,a,l){var u,c,d,h,p,v,g,_=r.props,f=t.props,m=t.type;if("svg"===m&&(n=!0),null!=s)for(u=0;u<s.length;u++)if((p=s[u])&&"setAttribute"in p==!!m&&(m?p.localName===m:3===p.nodeType)){e=p,s[u]=null;break}if(null==e){if(null===m)return document.createTextNode(f);e=n?document.createElementNS("http://www.w3.org/2000/svg",m):document.createElement(m,f.is&&f),s=null,a=!1}if(null===m)_===f||a&&e.data===f||(e.data=f);else{if(s=s&&da.call(e.childNodes),_=r.props||ya,!a&&null!=s)for(_={},u=0;u<e.attributes.length;u++)_[(p=e.attributes[u]).name]=p.value;for(u in _)p=_[u],"children"==u||("dangerouslySetInnerHTML"==u?d=p:"key"===u||u in f||Da(e,u,null,p,n));for(u in f)p=f[u],"children"==u?h=p:"dangerouslySetInnerHTML"==u?c=p:"value"==u?v=p:"checked"==u?g=p:"key"===u||a&&"function"!=typeof p||_[u]===p||Da(e,u,p,_[u],n);if(c)a||d&&(c.__html===d.__html||c.__html===e.innerHTML)||(e.innerHTML=c.__html),t.__k=[];else if(d&&(e.innerHTML=""),Na(e,wa(h)?h:[h],t,r,i,n&&"foreignObject"!==m,s,o,s?s[0]:r.__k&&Ma(r,0),a,l),null!=s)for(u=s.length;u--;)null!=s[u]&&Ia(s[u]);a||(u="value",void 0!==v&&(v!==e[u]||"progress"===m&&!v||"option"===m&&v!==_[u])&&Da(e,u,v,_[u],!1),u="checked",void 0!==g&&g!==e[u]&&Da(e,u,g,_[u],!1))}return e}(r.__e,t,r,i,n,s,o,l,u);(c=ha.diffed)&&c(t)}function Va(e,t,r){t.__d=void 0;for(var i=0;i<r.length;i++)$a(r[i],r[++i],r[++i]);ha.__c&&ha.__c(t,e),e.some((function(t){try{e=t.__h,t.__h=[],e.some((function(e){e.call(t)}))}catch(e){ha.__e(e,t.__v)}}))}function $a(e,t,r){try{"function"==typeof e?e(t):e.current=t}catch(e){ha.__e(e,r)}}function Ua(e,t,r){var i,n;if(ha.unmount&&ha.unmount(e),(i=e.ref)&&(i.current&&i.current!==e.__e||$a(i,null,t)),null!=(i=e.__c)){if(i.componentWillUnmount)try{i.componentWillUnmount()}catch(e){ha.__e(e,t)}i.base=i.__P=null,e.__c=void 0}if(i=e.__k)for(n=0;n<i.length;n++)i[n]&&Ua(i[n],t,r||"function"!=typeof e.type);r||null==e.__e||Ia(e.__e),e.__=e.__e=e.__d=void 0}function Wa(e,t,r){return this.constructor(e,r)}function za(e,t,r){var i,n,s;ha.__&&ha.__(e,t),i=!1?null:t.__k,n=[],s=[],Ba(t,e=t.__k=ka(xa,null,[e]),i||ya,ya,void 0!==t.ownerSVGElement,i?null:t.firstChild?da.call(t.childNodes):null,n,i?i.__e:t.firstChild,false,s),Va(n,e,s)}function ja(e,t,r){var i,n,s,o,a=Ca({},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]&&void 0!==o?o[s]:t[s];return arguments.length>2&&(a.children=arguments.length>3?da.call(arguments,2):r),Ea(e.type,a,i||e.key,n||e.ref,null)}da=ba.slice,ha={__e:function(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}},pa=0,Ta.prototype.setState=function(e,t){var r;r=null!=this.__s&&this.__s!==this.state?this.__s:this.__s=Ca({},this.state),"function"==typeof e&&(e=e(Ca({},r),this.props)),e&&Ca(r,e),null!=e&&this.__v&&(t&&this._sb.push(t),Pa(this))},Ta.prototype.forceUpdate=function(e){this.__v&&(this.__e=!0,e&&this.__h.push(e),Pa(this))},Ta.prototype.render=xa,va=[],_a="function"==typeof Promise?Promise.prototype.then.bind(Promise.resolve()):setTimeout,fa=function(e,t){return e.__v.__b-t.__v.__b},Aa.__r=0,ma=0;var Za,Ga,Ya,Xa,Ka=0,Ja=[],Qa=[],el=ha.__b,tl=ha.__r,rl=ha.diffed,il=ha.__c,nl=ha.unmount;function sl(e,t){ha.__h&&ha.__h(Ga,e,Ka||t),Ka=0;var r=Ga.__H||(Ga.__H={__:[],__h:[]});return e>=r.__.length&&r.__.push({__V:Qa}),r.__[e]}function ol(e){return Ka=1,function(e,t,r){var i=sl(Za++,2);if(i.t=e,!i.__c&&(i.__=[fl(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=Ga,!Ga.u)){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=!1;return n.forEach((function(e){if(e.__N){var t=e.__[0];e.__=e.__N,e.__N=void 0,t!==e.__[0]&&(o=!0)}})),!(!o&&i.__c.props===e)&&(!s||s.call(this,e,t,r))};Ga.u=!0;var s=Ga.shouldComponentUpdate,o=Ga.componentWillUpdate;Ga.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)},Ga.shouldComponentUpdate=n}return i.__N||i.__}(fl,e)}function al(e,t){var r=sl(Za++,3);!ha.__s&&_l(r.__H,t)&&(r.__=e,r.i=t,Ga.__H.__h.push(r))}function ll(e){return Ka=5,ul((function(){return{current:e}}),[])}function ul(e,t){var r=sl(Za++,7);return _l(r.__H,t)?(r.__V=e(),r.i=t,r.__h=e,r.__V):r.__}function cl(e){var t=Ga.context[e.__c],r=sl(Za++,9);return r.c=e,t?(null==r.__&&(r.__=!0,t.sub(Ga)),t.props.value):e.__}function dl(){for(var e;e=Ja.shift();)if(e.__P&&e.__H)try{e.__H.__h.forEach(vl),e.__H.__h.forEach(gl),e.__H.__h=[]}catch(t){e.__H.__h=[],ha.__e(t,e.__v)}}ha.__b=function(e){Ga=null,el&&el(e)},ha.__r=function(e){tl&&tl(e),Za=0;var t=(Ga=e.__c).__H;t&&(Ya===Ga?(t.__h=[],Ga.__h=[],t.__.forEach((function(e){e.__N&&(e.__=e.__N),e.__V=Qa,e.__N=e.i=void 0}))):(t.__h.forEach(vl),t.__h.forEach(gl),t.__h=[],Za=0)),Ya=Ga},ha.diffed=function(e){rl&&rl(e);var t=e.__c;t&&t.__H&&(t.__H.__h.length&&(1!==Ja.push(t)&&Xa===ha.requestAnimationFrame||((Xa=ha.requestAnimationFrame)||pl)(dl)),t.__H.__.forEach((function(e){e.i&&(e.__H=e.i),e.__V!==Qa&&(e.__=e.__V),e.i=void 0,e.__V=Qa}))),Ya=Ga=null},ha.__c=function(e,t){t.some((function(e){try{e.__h.forEach(vl),e.__h=e.__h.filter((function(e){return!e.__||gl(e)}))}catch(r){t.some((function(e){e.__h&&(e.__h=[])})),t=[],ha.__e(r,e.__v)}})),il&&il(e,t)},ha.unmount=function(e){nl&&nl(e);var t,r=e.__c;r&&r.__H&&(r.__H.__.forEach((function(e){try{vl(e)}catch(e){t=e}})),r.__H=void 0,t&&ha.__e(t,r.__v))};var hl="function"==typeof requestAnimationFrame;function pl(e){var t,r=function(){clearTimeout(i),hl&&cancelAnimationFrame(t),setTimeout(e)},i=setTimeout(r,100);hl&&(t=requestAnimationFrame(r))}function vl(e){var t=Ga,r=e.__c;"function"==typeof r&&(e.__c=void 0,r()),Ga=t}function gl(e){var t=Ga;e.__c=e.__(),Ga=t}function _l(e,t){return!e||e.length!==t.length||t.some((function(t,r){return t!==e[r]}))}function fl(e,t){return"function"==typeof t?t(e):t}var ml=function(e){return e.Activation="events",e.Cancellation="cancelEvents",e}({}),yl=function(e){return e.Button="button",e.Tab="tab",e.Selector="selector",e}({}),bl=function(e){return e.TopLeft="top_left",e.TopRight="top_right",e.TopCenter="top_center",e.MiddleLeft="middle_left",e.MiddleRight="middle_right",e.MiddleCenter="middle_center",e.Left="left",e.Center="center",e.Right="right",e.NextToTrigger="next_to_trigger",e}({}),Sl=function(e){return e.Top="top",e.Left="left",e.Right="right",e.Bottom="bottom",e}({}),wl=function(e){return e.Popover="popover",e.API="api",e.Widget="widget",e.ExternalSurvey="external_survey",e}({}),Cl=function(e){return e.Open="open",e.MultipleChoice="multiple_choice",e.SingleChoice="single_choice",e.Rating="rating",e.Link="link",e}({}),Il=function(e){return e.NextQuestion="next_question",e.End="end",e.ResponseBased="response_based",e.SpecificQuestion="specific_question",e}({}),kl=function(e){return e.Once="once",e.Recurring="recurring",e.Always="always",e}({}),El=function(e){return e.SHOWN="survey shown",e.DISMISSED="survey dismissed",e.SENT="survey sent",e.ABANDONED="survey abandoned",e}({}),xl=function(e){return e.SURVEY_ID="$survey_id",e.SURVEY_NAME="$survey_name",e.SURVEY_RESPONSE="$survey_response",e.SURVEY_ITERATION="$survey_iteration",e.SURVEY_ITERATION_START_DATE="$survey_iteration_start_date",e.SURVEY_PARTIALLY_COMPLETED="$survey_partially_completed",e.SURVEY_SUBMISSION_ID="$survey_submission_id",e.SURVEY_QUESTIONS="$survey_questions",e.SURVEY_COMPLETED="$survey_completed",e.PRODUCT_TOUR_ID="$product_tour_id",e}({}),Tl=function(e){return e.Popover="popover",e.Inline="inline",e}({}),Ml=us("[Surveys]");function Rl(e){return!(!e.start_date||e.end_date)}function Pl(e){var t;return!(null==(t=e.conditions)||null==(t=t.events)||null==(t=t.values)||!t.length)}function Al(e){var t;return!(null==(t=e.conditions)||null==(t=t.actions)||null==(t=t.values)||!t.length)}var Nl="seenSurvey_",Fl="inProgressSurvey_",Ll=(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},Ol=(e,t)=>{var r=""+e+t.id;return t.current_iteration&&t.current_iteration>0&&(r=""+e+t.id+"_"+t.current_iteration),r},Dl=e=>Ol(Nl,e),Hl=e=>{localStorage.getItem(Dl(e))||localStorage.setItem(Dl(e),"true")},ql=[wl.Popover,wl.Widget,wl.API],Bl={ignoreConditions:!1,ignoreDelay:!1,displayType:Tl.Popover};Math.trunc||(Math.trunc=function(e){return e<0?Math.ceil(e):Math.floor(e)}),Number.isInteger||(Number.isInteger=function(e){return si(e)&&isFinite(e)&&Math.floor(e)===e});var Vl="0123456789abcdef";class $l{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)||e<0||t<0||r<0||i<0||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 $l(n)}toString(){for(var e="",t=0;t<this.bytes.length;t++)e=e+Vl.charAt(this.bytes[t]>>>4)+Vl.charAt(15&this.bytes[t]),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 $l(this.bytes.slice(0))}equals(e){return 0===this.compareTo(e)}compareTo(e){for(var t=0;t<16;t++){var r=this.bytes[t]-e.bytes[t];if(0!==r)return Math.sign(r)}return 0}}class Ul{constructor(){this._timestamp=0,this._counter=0,this._random=new jl}generate(){var e=this.generateOrAbort();if(ei(e)){this._timestamp=0;var t=this.generateOrAbort();if(ei(t))throw new Error("Could not generate UUID after timestamp reset");return t}return e}generateOrAbort(){var e=Date.now();if(e>this._timestamp)this._timestamp=e,this._resetCounter();else{if(!(e+1e4>this._timestamp))return;this._counter++,this._counter>4398046511103&&(this._timestamp++,this._resetCounter())}return $l.fromFieldsV7(this._timestamp,Math.trunc(this._counter/Math.pow(2,30)),this._counter&Math.pow(2,30)-1,this._random.nextUint32())}_resetCounter(){this._counter=1024*this._random.nextUint32()+(1023&this._random.nextUint32())}}var Wl,zl=e=>{if("undefined"!=typeof UUIDV7_DENY_WEAK_RNG&&UUIDV7_DENY_WEAK_RNG)throw new Error("no cryptographically strong RNG available");for(var t=0;t<e.length;t++)e[t]=65536*Math.trunc(65536*Math.random())+Math.trunc(65536*Math.random());return e};zn&&!ei(zn.crypto)&&crypto.getRandomValues&&(zl=e=>crypto.getRandomValues(e));class jl{constructor(){this._buffer=new Uint32Array(8),this._cursor=1/0}nextUint32(){return this._cursor>=this._buffer.length&&(zl(this._buffer),this._cursor=0),this._buffer[this._cursor++]}}var Zl=()=>Gl().toString(),Gl=()=>(Wl||(Wl=new Ul)).generate(),Yl="$copy_autocapture",Xl=function(e){return e.GZipJS="gzip-js",e.Base64="base64",e}({}),Kl=["fatal","error","warning","log","info","debug"],Jl=Uint8Array,Ql=Uint16Array,eu=Uint32Array,tu=new Jl([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]),ru=new Jl([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]),iu=new Jl([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),nu=function(e,t){for(var r=new Ql(31),i=0;i<31;++i)r[i]=t+=1<<e[i-1];var n=new eu(r[30]);for(i=1;i<30;++i)for(var s=r[i];s<r[i+1];++s)n[s]=s-r[i]<<5|i;return[r,n]},su=nu(tu,2),ou=su[0],au=su[1];ou[28]=258,au[258]=28;for(var lu=nu(ru,0)[1],uu=new Ql(32768),cu=0;cu<32768;++cu){var du=(43690&cu)>>>1|(21845&cu)<<1;du=(61680&(du=(52428&du)>>>2|(13107&du)<<2))>>>4|(3855&du)<<4,uu[cu]=((65280&du)>>>8|(255&du)<<8)>>>1}var hu=function(e,t,r){for(var i=e.length,n=0,s=new Ql(t);n<i;++n)++s[e[n]-1];var o,a=new Ql(t);for(n=0;n<t;++n)a[n]=a[n-1]+s[n-1]<<1;if(r){o=new Ql(1<<t);var l=15-t;for(n=0;n<i;++n)if(e[n])for(var u=n<<4|e[n],c=t-e[n],d=a[e[n]-1]++<<c,h=d|(1<<c)-1;d<=h;++d)o[uu[d]>>>l]=u}else for(o=new Ql(i),n=0;n<i;++n)o[n]=uu[a[e[n]-1]++]>>>15-e[n];return o},pu=new Jl(288);for(cu=0;cu<144;++cu)pu[cu]=8;for(cu=144;cu<256;++cu)pu[cu]=9;for(cu=256;cu<280;++cu)pu[cu]=7;for(cu=280;cu<288;++cu)pu[cu]=8;var vu=new Jl(32);for(cu=0;cu<32;++cu)vu[cu]=5;var gu=hu(pu,9,0),_u=hu(vu,5,0),fu=function(e){return(e/8>>0)+(7&e&&1)},mu=function(e,t,r){(null==r||r>e.length)&&(r=e.length);var i=new(e instanceof Ql?Ql:e instanceof eu?eu:Jl)(r-t);return i.set(e.subarray(t,r)),i},yu=function(e,t,r){r<<=7&t;var i=t/8>>0;e[i]|=r,e[i+1]|=r>>>8},bu=function(e,t,r){r<<=7&t;var i=t/8>>0;e[i]|=r,e[i+1]|=r>>>8,e[i+2]|=r>>>16},Su=function(e,t){for(var r=[],i=0;i<e.length;++i)e[i]&&r.push({s:i,f:e[i]});var n=r.length,s=r.slice();if(!n)return[new Jl(0),0];if(1==n){var o=new Jl(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,c=1,d=2;for(r[0]={s:-1,f:a.f+l.f,l:a,r:l};c!=n-1;)a=r[r[u].f<r[d].f?u++:d++],l=r[u!=c&&r[u].f<r[d].f?u++:d++],r[c++]={s:-1,f:a.f+l.f,l:a,r:l};var h=s[0].s;for(i=1;i<n;++i)s[i].s>h&&(h=s[i].s);var p=new Ql(h+1),v=wu(r[c-1],p,0);if(v>t){i=0;var g=0,_=v-t,f=1<<_;for(s.sort((function(e,t){return p[t.s]-p[e.s]||e.f-t.f}));i<n;++i){var m=s[i].s;if(!(p[m]>t))break;g+=f-(1<<v-p[m]),p[m]=t}for(g>>>=_;g>0;){var y=s[i].s;p[y]<t?g-=1<<t-p[y]++-1:++i}for(;i>=0&&g;--i){var b=s[i].s;p[b]==t&&(--p[b],++g)}v=t}return[new Jl(p),v]},wu=function(e,t,r){return-1==e.s?Math.max(wu(e.l,t,r+1),wu(e.r,t,r+1)):t[e.s]=r},Cu=function(e){for(var t=e.length;t&&!e[--t];);for(var r=new Ql(++t),i=0,n=e[0],s=1,o=function(e){r[i++]=e},a=1;a<=t;++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]},Iu=function(e,t){for(var r=0,i=0;i<t.length;++i)r+=e[i]*t[i];return r},ku=function(e,t,r){var i=r.length,n=fu(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;s<i;++s)e[n+s+4]=r[s];return 8*(n+4+i)},Eu=function(e,t,r,i,n,s,o,a,l,u,c){yu(t,c++,r),++n[256];for(var d=Su(n,15),h=d[0],p=d[1],v=Su(s,15),g=v[0],_=v[1],f=Cu(h),m=f[0],y=f[1],b=Cu(g),S=b[0],w=b[1],C=new Ql(19),I=0;I<m.length;++I)C[31&m[I]]++;for(I=0;I<S.length;++I)C[31&S[I]]++;for(var k=Su(C,7),E=k[0],x=k[1],T=19;T>4&&!E[iu[T-1]];--T);var M,R,P,A,N=u+5<<3,F=Iu(n,pu)+Iu(s,vu)+o,L=Iu(n,h)+Iu(s,g)+o+14+3*T+Iu(C,E)+(2*C[16]+3*C[17]+7*C[18]);if(N<=F&&N<=L)return ku(t,c,e.subarray(l,l+u));if(yu(t,c,1+(L<F)),c+=2,L<F){M=hu(h,p,0),R=h,P=hu(g,_,0),A=g;var O=hu(E,x,0);yu(t,c,y-257),yu(t,c+5,w-1),yu(t,c+10,T-4),c+=14;for(I=0;I<T;++I)yu(t,c+3*I,E[iu[I]]);c+=3*T;for(var D=[m,S],H=0;H<2;++H){var q=D[H];for(I=0;I<q.length;++I){var B=31&q[I];yu(t,c,O[B]),c+=E[B],B>15&&(yu(t,c,q[I]>>>5&127),c+=q[I]>>>12)}}}else M=gu,R=pu,P=_u,A=vu;for(I=0;I<a;++I)if(i[I]>255){B=i[I]>>>18&31;bu(t,c,M[B+257]),c+=R[B+257],B>7&&(yu(t,c,i[I]>>>23&31),c+=tu[B]);var V=31&i[I];bu(t,c,P[V]),c+=A[V],V>3&&(bu(t,c,i[I]>>>5&8191),c+=ru[V])}else bu(t,c,M[i[I]]),c+=R[i[I]];return bu(t,c,M[256]),c+R[256]},xu=new eu([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),Tu=function(){for(var e=new eu(256),t=0;t<256;++t){for(var r=t,i=9;--i;)r=(1&r&&3988292384)^r>>>1;e[t]=r}return e}(),Mu=function(e,t,r,i,n){return function(e,t,r,i,n,s){var o=e.length,a=new Jl(i+o+5*(1+Math.floor(o/7e3))+n),l=a.subarray(i,a.length-n),u=0;if(!t||o<8)for(var c=0;c<=o;c+=65535){var d=c+65535;d<o?u=ku(l,u,e.subarray(c,d)):(l[c]=s,u=ku(l,u,e.subarray(c,o)))}else{for(var h=xu[t-1],p=h>>>13,v=8191&h,g=(1<<r)-1,_=new Ql(32768),f=new Ql(g+1),m=Math.ceil(r/3),y=2*m,b=function(t){return(e[t]^e[t+1]<<m^e[t+2]<<y)&g},S=new eu(25e3),w=new Ql(288),C=new Ql(32),I=0,k=0,E=(c=0,0),x=0,T=0;c<o;++c){var M=b(c),R=32767&c,P=f[M];if(_[R]=P,f[M]=R,x<=c){var A=o-c;if((I>7e3||E>24576)&&A>423){u=Eu(e,l,0,S,w,C,k,E,T,c-T,u),E=I=k=0,T=c;for(var N=0;N<286;++N)w[N]=0;for(N=0;N<30;++N)C[N]=0}var F=2,L=0,O=v,D=R-P&32767;if(A>2&&M==b(c-D))for(var H=Math.min(p,A)-1,q=Math.min(32767,c),B=Math.min(258,A);D<=q&&--O&&R!=P;){if(e[c+F]==e[c+F-D]){for(var V=0;V<B&&e[c+V]==e[c+V-D];++V);if(V>F){if(F=V,L=D,V>H)break;var U=Math.min(D,V-2),W=0;for(N=0;N<U;++N){var z=c-D+N+32768&32767,j=z-_[z]+32768&32767;j>W&&(W=j,P=z)}}}D+=(R=P)-(P=_[R])+32768&32767}if(L){S[E++]=268435456|au[F]<<18|lu[L];var Z=31&au[F],G=31&lu[L];k+=tu[Z]+ru[G],++w[257+Z],++C[G],x=c+F,++I}else S[E++]=e[c],++w[e[c]]}}u=Eu(e,l,s,S,w,C,k,E,T,c-T,u)}return mu(a,0,i+fu(u)+n)}(e,null==t.level?6:t.level,null==t.mem?Math.ceil(1.5*Math.max(8,Math.min(13,Math.log(e.length)))):12+t.mem,r,i,!0)},Ru=function(e,t,r){for(;r;++t)e[t]=r,r>>>=8};function Pu(e,t){void 0===t&&(t={});var r=function(){var e=4294967295;return{p:function(t){for(var r=e,i=0;i<t.length;++i)r=Tu[255&r^t[i]]^r>>>8;e=r},d:function(){return 4294967295^e}}}(),i=e.length;r.p(e);var n=Mu(e,t,function(e){return 10+(e.filename&&e.filename.length+1||0)}(t),8),s=n.length;return function(e,t){var r=t.filename;if(e[0]=31,e[1]=139,e[2]=8,e[8]=t.level<2?4:9==t.level?2:0,e[9]=3,0!=t.mtime&&Ru(e,4,Math.floor(new Date(t.mtime||Date.now())/1e3)),r){e[3]=8;for(var i=0;i<=r.length;++i)e[i+10]=r.charCodeAt(i)}}(n,t),Ru(n,s-8,r.d()),Ru(n,s-4,i),n}var Au=function(e){var t,r,i,n,s="";for(t=r=0,i=(e=(e+"").replace(/\r\n/g,"\n").replace(/\r/g,"\n")).length,n=0;n<i;n++){var o=e.charCodeAt(n),a=null;o<128?r++:a=o>127&&o<2048?String.fromCharCode(o>>6|192,63&o|128):String.fromCharCode(o>>12|224,o>>6&63|128,63&o|128),ii(a)||(r>t&&(s+=e.substring(t,r)),s+=a,t=r=n+1)}return r>t&&(s+=e.substring(t,e.length)),s},Nu=!!es||!!Qn,Fu="text/plain",Lu=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=ks(a);return u&&l.push(u),s+"?"+l.join("&")},Ou=(e,t)=>JSON.stringify(e,((e,t)=>"bigint"==typeof t?t.toString():t),t),Du=e=>{var{data:t,compression:r}=e;if(t){if(r===Xl.GZipJS){var i=Pu(function(e,t){var r=e.length;if("undefined"!=typeof TextEncoder)return(new TextEncoder).encode(e);for(var i=new Jl(e.length+(e.length>>>1)),n=0,s=function(e){i[n++]=e},o=0;o<r;++o){if(n+5>i.length){var a=new Jl(n+8+(r-o<<1));a.set(i),i=a}var l=e.charCodeAt(o);l<128||t?s(l):l<2048?(s(192|l>>>6),s(128|63&l)):l>55295&&l<57344?(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 mu(i,0,n)}(Ou(t)),{mtime:0}),n=new Blob([i],{type:Fu});return{contentType:Fu,body:n,estimatedSize:n.size}}if(r===Xl.Base64){var s=function(e){var t,r,i,n,s,o="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",a=0,l=0,u="",c=[];if(!e)return e;e=Au(e);do{t=(s=e.charCodeAt(a++)<<16|e.charCodeAt(a++)<<8|e.charCodeAt(a++))>>18&63,r=s>>12&63,i=s>>6&63,n=63&s,c[l++]=o.charAt(t)+o.charAt(r)+o.charAt(i)+o.charAt(n)}while(a<e.length);switch(u=c.join(""),e.length%3){case 1:u=u.slice(0,-2)+"==";break;case 2:u=u.slice(0,-1)+"="}return u}(Ou(t)),o=(e=>"data="+encodeURIComponent("string"==typeof e?e:Ou(e)))(s);return{contentType:"application/x-www-form-urlencoded",body:o,estimatedSize:new Blob([o]).size}}var a=Ou(t);return{contentType:"application/json",body:a,estimatedSize:new Blob([a]).size}}},Hu=[];Qn&&Hu.push({transport:"fetch",method:e=>{var t,i,{contentType:n,body:s,estimatedSize:o}=null!==(t=Du(e))&&void 0!==t?t:{},a=new Headers;hs(e.headers,(function(e,t){a.append(t,e)})),n&&a.append("Content-Type",n);var l=e.url,u=null;if(ts){var c=new ts;u={signal:c.signal,timeout:setTimeout((()=>c.abort()),e.timeout)}}Qn(l,r({method:(null==e?void 0:e.method)||"GET",headers:a,keepalive:"POST"===e.method&&(o||0)<52428.8,body:s,signal:null==(i=u)?void 0:i.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){ls.error(e)}null==e.callback||e.callback(i)})))).catch((t=>{ls.error(t),null==e.callback||e.callback({statusCode:0,text:t})})).finally((()=>u?clearTimeout(u.timeout):null))}}),es&&Hu.push({transport:"XHR",method:e=>{var t,r=new es;r.open(e.method||"GET",e.url,!0);var{contentType:i,body:n}=null!==(t=Du(e))&&void 0!==t?t:{};hs(e.headers,(function(e,t){r.setRequestHeader(t,e)})),i&&r.setRequestHeader("Content-Type",i),e.timeout&&(r.timeout=e.timeout),e.disableXHRCredentials||(r.withCredentials=!0),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(n)}}),null!=Xn&&Xn.sendBeacon&&Hu.push({transport:"sendBeacon",method:e=>{var t=Lu(e.url,{beacon:"1"});try{var r,{contentType:i,body:n}=null!==(r=Du(e))&&void 0!==r?r:{},s="string"==typeof n?new Blob([n],{type:i}):n;Xn.sendBeacon(t,s)}catch(e){}}});var qu=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 Bu(e,t,r){return Ou({distinct_id:e,userPropertiesToSet:t,userPropertiesToSetOnce:r})}var Vu={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=>qu(t,e))))),not_regex:(e,t)=>t.every((t=>e.every((e=>!qu(t,e))))),icontains:(e,t)=>t.map($u).some((t=>e.map($u).some((e=>t.includes(e))))),not_icontains:(e,t)=>t.map($u).every((t=>e.map($u).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)))}))},$u=e=>e.toLowerCase();function Uu(e,t){return!e||Object.entries(e).every((e=>{var[r,i]=e,n=null==t?void 0:t[r];if(ei(n)||ii(n))return!1;var s=[String(n)],o=Vu[i.operator];return!!o&&o(i.values,s)}))}var Wu=us("[Stylesheet Loader]"),zu=zn,ju=Kn;function Zu(e){return"$survey_response_"+e}var Gu="#020617",Yu={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:bl.Right,widgetType:yl.Tab,widgetLabel:"Feedback",widgetColor:"black",zIndex:"2147483647",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:Gu,scrollbarThumbColor:"var(--ph-survey-border-color)",scrollbarTrackColor:"var(--ph-survey-background-color)"};function Xu(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 Ku(e){var t;void 0===e&&(e=Yu.backgroundColor),"#"===e[0]&&(t=Xu(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=Xu(r)),!t)return Gu;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?Gu:"white"}return Gu}function Ju(e){var t=((e,t,r)=>{var i,n=e.createElement("style");return n.innerText=t,null!=r&&null!=(i=r.config)&&i.prepare_external_dependency_stylesheet&&(n=r.config.prepare_external_dependency_stylesheet(n)),n||(Wu.error("prepare_external_dependency_stylesheet returned null"),null)})(ju,':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:2147483647;--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}.survey-box:has(.survey-question:empty):not(:has(.survey-question-description)) .multiple-choice-options,.survey-box:has(.survey-question:empty):not(:has(.survey-question-description)) 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}.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:hover{cursor:pointer}.rating-text{display:flex;flex-direction:row;font-size:11px;justify-content:space-between;opacity:.7}.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-cancel{background:#fff;border-radius:100%;cursor:pointer;line-height:0;padding:12px;position:absolute;right:0;top:0;transform:translate(50%,-50%)}.form-cancel:hover{opacity:.7;transform:translate(50%,-50%) scale(1.1)}.footer-branding{align-items:center;display:flex;font-size:11px;font-weight:500;gap:4px;justify-content:center;opacity:.6;text-decoration:none}.footer-branding:hover{opacity:1}.footer-branding a{text-decoration:none}.thank-you-message{text-align:center}.thank-you-message-header{margin:10px 0 0}.thank-you-message-body{font-size:14px;opacity:.8}.limit-height{max-height:256px;overflow-x:hidden;overflow-y:auto;scrollbar-color:var(--ph-survey-scrollbar-thumb-color) var(--ph-survey-scrollbar-track-color);scrollbar-width:thin}.limit-height::-webkit-scrollbar{width:8px}.limit-height::-webkit-scrollbar-track{background:var(--ph-survey-scrollbar-track-color);border-radius:4px}.limit-height::-webkit-scrollbar-thumb{background-color:var(--ph-survey-scrollbar-thumb-color);border:2px solid var(--ph-survey-scrollbar-track-color);border-radius:4px}:is(.limit-height::-webkit-scrollbar-thumb):hover{background-color:var(--ph-survey-text-subtle-color)}.sr-only{clip:rect(0,0,0,0);border:0;height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;white-space:nowrap;width:1px}@media (prefers-reduced-motion:reduce){.ph-survey *{animation-duration:.01ms!important;animation-iteration-count:1!important;scroll-behavior:auto!important;transition-duration:.01ms!important}}@keyframes ph-survey-checkmark-reveal{0%{opacity:0;transform:rotate(45deg) scale(0)}50%{opacity:1;transform:rotate(45deg) scale(1.2)}to{opacity:1;transform:rotate(45deg) scale(1)}}@keyframes ph-survey-radio-reveal{0%{opacity:0;transform:scale(0)}50%{opacity:1;transform:scale(1.3)}to{opacity:1;transform:scale(1)}}',e);return null==t||t.setAttribute("data-ph-survey-style","true"),t}var Qu=(e,t,i)=>{var n=bc(e),s=ju.querySelector("."+n);if(s&&s.shadowRoot)return{shadow:s.shadowRoot,isNewlyCreated:!1};var o=ju.createElement("div");((e,t,i)=>{var n=r({},Yu,i),s=e.style,o=![bl.Center,bl.Left,bl.Right].includes(n.position)||t===wl.Widget&&(null==i?void 0:i.widgetType)===yl.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)||Ku(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",Ku(n.ratingButtonActiveColor)),s.setProperty("--ph-survey-text-primary-color",(null==i?void 0:i.textColor)||Ku(n.backgroundColor)),s.setProperty("--ph-survey-text-subtle-color",n.textSubtleColor),s.setProperty("--ph-widget-color",n.widgetColor),s.setProperty("--ph-widget-text-color",Ku(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)||Ku(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=Ju(t);if(l){var u=a.querySelector("style");u&&a.removeChild(u),a.appendChild(l)}return ju.body.appendChild(o),{shadow:a,isNewlyCreated:!0}},ec=(e,t)=>{if(!t)return null;var r=e[Zu(t)];return Yr(r)?[...r]:r},tc=e=>{var{responses:t,survey:i,surveySubmissionId:n,posthog:s,isSurveyCompleted:o}=e;s?(Hl(i),s.capture(El.SENT,r({[xl.SURVEY_NAME]:i.name,[xl.SURVEY_ID]:i.id,[xl.SURVEY_ITERATION]:i.current_iteration,[xl.SURVEY_ITERATION_START_DATE]:i.current_iteration_start_date,[xl.SURVEY_QUESTIONS]:i.questions.map((e=>({id:e.id,question:e.question,response:ec(t,e.id)}))),[xl.SURVEY_SUBMISSION_ID]:n,[xl.SURVEY_COMPLETED]:o,sessionRecordingUrl:null==s.get_session_replay_url?void 0:s.get_session_replay_url()},t,{$set:{[Ll(i,"responded")]:!0}})),o&&(zu.dispatchEvent(new CustomEvent("PHSurveySent",{detail:{surveyId:i.id}})),yc(i))):Ml.error("[survey sent] event not captured, PostHog instance not found.")},rc=e=>Object.values((null==e?void 0:e.responses)||{}).filter((e=>!ni(e))).length>0,ic=(e,t,i)=>r({[xl.SURVEY_NAME]:e.name,[xl.SURVEY_ID]:e.id,[xl.SURVEY_ITERATION]:e.current_iteration,[xl.SURVEY_ITERATION_START_DATE]:e.current_iteration_start_date,[xl.SURVEY_PARTIALLY_COMPLETED]:rc(t),sessionRecordingUrl:null==i.get_session_replay_url?void 0:i.get_session_replay_url()},null==t?void 0:t.responses,{[xl.SURVEY_SUBMISSION_ID]:null==t?void 0:t.surveySubmissionId,[xl.SURVEY_QUESTIONS]:e.questions.map((e=>({id:e.id,question:e.question,response:ec((null==t?void 0:t.responses)||{},e.id)})))}),nc=(e,t,i)=>{if(t){if(!i){var n=fc(e);t.capture(El.DISMISSED,r({},ic(e,n,t),{$set:{[Ll(e,"dismissed")]:!0}})),yc(e),Hl(e),zu.dispatchEvent(new CustomEvent("PHSurveyClosed",{detail:{surveyId:e.id}}))}}else Ml.error("[survey dismissed] event not captured, PostHog instance not found.")},sc=(e,t)=>{if(t){var r=(e=>Ol("abandonedSurvey_",e))(e);try{if("true"===localStorage.getItem(r))return}catch(e){return}var i=fc(e);if(i){try{localStorage.setItem(r,"true")}catch(e){}t.capture(El.ABANDONED,ic(e,i,t),{transport:"sendBeacon"})}}else Ml.error("[survey abandoned] event not captured, PostHog instance not found.")},oc=e=>e.map((e=>({sort:Math.floor(10*Math.random()),value:e}))).sort(((e,t)=>e.sort-t.sort)).map((e=>e.value)),ac=(e,t)=>e.length===t.length&&e.every(((e,r)=>e===t[r]))?t.reverse():t,lc=e=>e.appearance&&e.appearance.shuffleQuestions&&!e.enable_partial_responses?ac(e.questions,oc(e.questions)):e.questions,uc=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===kl.Always||mc(e)},cc=function(e,t){var r={__c:t="__cC"+ma++,__:e,Consumer:function(e,t){return e.children(t)},Provider:function(e){var r,i;return this.getChildContext||(r=[],(i={})[t]=this,this.getChildContext=function(){return i},this.shouldComponentUpdate=function(e){this.props.value!==e.value&&r.some((function(e){e.__e=!0,Pa(e)}))},this.sub=function(e){r.push(e);var t=e.componentWillUnmount;e.componentWillUnmount=function(){r.splice(r.indexOf(e),1),t&&t.call(e)}}),e.children}};return r.Provider.__=r.Consumer.contextType=r}({isPreviewMode:!1,previewPageIndex:0,onPopupSurveyDismissed:()=>{},isPopup:!0,onPreviewSubmit:()=>{},surveySubmissionId:""}),dc=()=>cl(cc),hc=e=>{var{component:t,children:r,renderAsHtml:i,style:n}=e;return ja(t,i?{dangerouslySetInnerHTML:{__html:r},style:n}:{children:r,style:n})};function pc(e){return null!=e?e:"icontains"}function vc(e){var t,r,i;if(null==(t=e.conditions)||!t.url)return!0;var n=null==zu||null==(r=zu.location)?void 0:r.href;if(!n)return!1;var s=[e.conditions.url],o=pc(null==(i=e.conditions)?void 0:i.urlMatchType);return Vu[o](s,[n])}var gc=e=>{var t=""+Fl+e.id;return e.current_iteration&&e.current_iteration>0&&(t=""+Fl+e.id+"_"+e.current_iteration),t},_c=(e,t)=>{try{localStorage.setItem(gc(e),JSON.stringify(t))}catch(e){Ml.error("Error setting in-progress survey state in localStorage",e)}},fc=e=>{try{var t=localStorage.getItem(gc(e));if(t)return JSON.parse(t)}catch(e){Ml.error("Error getting in-progress survey state from localStorage",e)}return null},mc=e=>{var t=fc(e);return!ni(null==t?void 0:t.surveySubmissionId)},yc=e=>{try{localStorage.removeItem(gc(e))}catch(e){Ml.error("Error clearing in-progress survey state from localStorage",e)}};function bc(e,t){void 0===t&&(t=!1);var r="PostHogSurvey-"+e.id;return t?"."+r:r}var Sc=0;function wc(e,t,r,i,n,s){var o,a,l={};for(a in 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,__d:void 0,__c:null,constructor:void 0,__v:--Sc,__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 ha.vnode&&ha.vnode(u),u}var Cc=wc("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 -960 960 960",width:"48",children:wc("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"})}),Ic=wc("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 -960 960 960",width:"48",children:wc("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"})}),kc=wc("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 -960 960 960",width:"48",children:wc("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"})}),Ec=wc("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 -960 960 960",width:"48",children:wc("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"})}),xc=wc("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 -960 960 960",width:"48",children:wc("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"})}),Tc=wc("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-labelledby":"close-survey-title",children:[wc("title",{id:"close-survey-title",children:"Close survey"}),wc("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:"black"})]}),Mc=wc("svg",{width:"77",height:"14",viewBox:"0 0 77 14",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[wc("g",{"clip-path":"url(#clip0_2415_6911)",children:[wc("mask",{id:"mask0_2415_6911",style:{maskType:"luminance"},maskUnits:"userSpaceOnUse",x:"0",y:"0",width:"77",height:"14",children:wc("path",{d:"M0.5 0H76.5V14H0.5V0Z",fill:"white"})}),wc("g",{mask:"url(#mask0_2415_6911)",children:[wc("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"}),wc("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"}),wc("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"}),wc("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"}),wc("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"}),wc("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"})]})]}),wc("defs",{children:wc("clipPath",{id:"clip0_2415_6911",children:wc("rect",{width:"76",height:"14",fill:"white",transform:"translate(0.5)"})})})]});function Rc(){return wc("a",{href:"https://posthog.com/surveys",target:"_blank",rel:"noopener",className:"footer-branding",children:["Survey by ",Mc]})}function Pc(e){var{text:t,submitDisabled:r,appearance:i,onSubmit:n,link:s,onPreviewSubmit:o,skipSubmitButton:a}=e,{isPreviewMode:l}=cl(cc);return wc("div",{className:"bottom-section",children:[!a&&wc("button",{className:"form-submit",disabled:r,"aria-label":"Submit survey",type:"button",onClick:()=>{s&&(null==zn||zn.open(s)),l?null==o||o():n()},children:t}),!i.whiteLabel&&wc(Rc,{})]})}function Ac(e){var{question:t,forceDisableHtml:r,htmlFor:i}=e;return wc("div",{class:"question-header",children:[wc(t.type===Cl.Open?"label":"h3",{className:"survey-question",htmlFor:i,children:t.question}),t.description&&hc({component:ka("p",{className:"survey-question-description"}),children:t.description,renderAsHtml:!r&&"text"!==t.descriptionContentType})]})}function Nc(e){var{onClick:t}=e,{isPreviewMode:r}=cl(cc);return wc("button",{className:"form-cancel",onClick:t,disabled:r,"aria-label":"Close survey",type:"button",children:Tc})}wc("svg",{width:"16",height:"12",viewBox:"0 0 16 12",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:wc("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 Fc=zn;function Lc(e){var{header:t,description:r,contentType:i,forceDisableHtml:n,appearance:s,onClose:o}=e,{isPopup:a}=cl(cc);return al((()=>{var e=e=>{"Enter"!==e.key&&"Escape"!==e.key||(e.preventDefault(),o())};return Cs(Fc,"keydown",e),()=>{Fc.removeEventListener("keydown",e)}}),[o]),wc("div",{className:"thank-you-message",role:"status",tabIndex:0,"aria-atomic":"true",children:[a&&!0!==s.hideCancelButton&&wc(Nc,{onClick:()=>o()}),wc("h3",{className:"thank-you-message-header",children:t}),r&&hc({component:ka("p",{className:"thank-you-message-body"}),children:r,renderAsHtml:!n&&"text"!==i}),a&&wc(Pc,{text:s.thankYouMessageCloseButtonText||"Close",submitDisabled:!1,appearance:s,onSubmit:()=>o()})]})}var Oc=e=>Yr(e)&&e.every((e=>ti(e)));function Dc(e){var{question:t,forceDisableHtml:r,appearance:i,onSubmit:n,onPreviewSubmit:s,displayQuestionIndex:o,initialValue:a}=e,{isPreviewMode:l}=dc(),u=ll(null),[c,d]=ol((()=>ti(a)?a:""));al((()=>{setTimeout((()=>{var e;l||(null==(e=u.current)||e.focus())}),100)}),[l]);var h="surveyQuestion"+o;return wc(xa,{children:[wc("div",{className:"question-container",children:[wc(Ac,{question:t,forceDisableHtml:r,htmlFor:h}),wc("textarea",{ref:u,id:h,rows:4,placeholder:null==i?void 0:i.placeholder,onInput:e=>{d(e.currentTarget.value),e.stopPropagation()},onKeyDown:e=>{e.stopPropagation()},value:c})]}),wc(Pc,{text:t.buttonText||"Submit",submitDisabled:!c&&!t.optional,appearance:i,onSubmit:()=>n(c),onPreviewSubmit:()=>s(c)})]})}function Hc(e){var{question:t,forceDisableHtml:r,appearance:i,onSubmit:n,onPreviewSubmit:s}=e;return wc(xa,{children:[wc("div",{className:"question-container",children:wc(Ac,{question:t,forceDisableHtml:r})}),wc(Pc,{text:t.buttonText||"Submit",submitDisabled:!1,link:t.link,appearance:i,onSubmit:()=>n("link clicked"),onPreviewSubmit:()=>s("link clicked")})]})}function qc(e){var{question:t,forceDisableHtml:r,displayQuestionIndex:i,appearance:n,onSubmit:s,onPreviewSubmit:o,initialValue:a}=e,l=t.scale,u=10===t.scale?0:1,[c,d]=ol((()=>si(a)?a:Yr(a)&&a.length>0&&si(parseInt(a[0]))?parseInt(a[0]):ti(a)&&si(parseInt(a))?parseInt(a):null)),{isPreviewMode:h}=dc(),p=e=>h?o(e):s(e);return wc(xa,{children:[wc("div",{className:"question-container",children:[wc(Ac,{question:t,forceDisableHtml:r}),wc("div",{className:"rating-section",children:[wc("div",{className:"rating-options",children:["emoji"===t.display&&wc("div",{className:"rating-options-emoji",children:(3===t.scale?$c:Uc).map(((e,r)=>wc("button",{"aria-label":"Rate "+(r+1),className:"ratings-emoji question-"+i+"-rating-"+r+" "+(r+1===c?"rating-active":""),value:r+1,type:"button",onClick:()=>{var e=r+1;d(e),t.skipSubmitButton&&p(e)},children:e},r)))}),"number"===t.display&&wc("div",{className:"rating-options-number",style:{gridTemplateColumns:"repeat("+(l-u+1)+", minmax(0, 1fr))"},children:Zc(t.scale).map(((e,r)=>wc(Bc,{displayQuestionIndex:i,active:c===e,appearance:n,num:e,setActiveNumber:e=>{d(e),t.skipSubmitButton&&p(e)}},r)))})]}),wc("div",{className:"rating-text",children:[wc("div",{children:t.lowerBoundLabel}),wc("div",{children:t.upperBoundLabel})]})]})]}),wc(Pc,{text:t.buttonText||(null==n?void 0:n.submitButtonText)||"Submit",submitDisabled:ii(c)&&!t.optional,appearance:n,onSubmit:()=>s(c),onPreviewSubmit:()=>o(c),skipSubmitButton:t.skipSubmitButton})]})}function Bc(e){var{num:t,active:r,displayQuestionIndex:i,setActiveNumber:n}=e;return wc("button",{"aria-label":"Rate "+t,className:"ratings-number question-"+i+"-rating-"+t+" "+(r?"rating-active":""),type:"button",onClick:()=>{n(t)},children:t})}function Vc(e){var{question:t,forceDisableHtml:i,displayQuestionIndex:n,appearance:s,onSubmit:o,onPreviewSubmit:a,initialValue:l}=e,u=ll(null),c=ul((()=>(e=>{if(!e.shuffleOptions)return e.choices;var t=e.choices,r="";e.hasOpenChoice&&(r=t.pop());var i=ac(t,oc(t));return e.hasOpenChoice&&(e.choices.push(r),i.push(r)),i})(t)),[t]),[d,h]=ol((()=>((e,t)=>ti(e)||Oc(e)?e:t===Cl.SingleChoice?null:[])(l,t.type))),[p,v]=ol((()=>((e,t)=>{if(ti(e)&&!t.includes(e))return{isSelected:!0,inputValue:e};if(Oc(e)){var r=e.find((e=>!t.includes(e)));if(r)return{isSelected:!0,inputValue:r}}return{isSelected:!1,inputValue:""}})(l,c))),{isPreviewMode:g}=dc(),_=t.type===Cl.SingleChoice,f=t.type===Cl.MultipleChoice,m=t.skipSubmitButton&&_&&!t.hasOpenChoice,y=(e,t)=>{if(t){var i=!p.isSelected;return v((e=>r({},e,{isSelected:i,inputValue:i?e.inputValue:""}))),_&&h(""),void(i&&setTimeout((()=>{var e;return null==(e=u.current)?void 0:e.focus()}),75))}if(_)return h(e),v((e=>r({},e,{isSelected:!1,inputValue:""}))),void(m&&(o(e),g&&a(e)));f&&Yr(d)&&(d.includes(e)?h(d.filter((t=>t!==e))):h([...d,e]))},b=e=>{e.stopPropagation();var t=e.currentTarget.value;v((e=>r({},e,{inputValue:t}))),_&&h(t)},S=e=>{e.stopPropagation(),"Enter"!==e.key||w()||(e.preventDefault(),C()),"Escape"===e.key&&(e.preventDefault(),v((e=>r({},e,{isSelected:!1,inputValue:""}))),_&&h(null))},w=()=>!t.optional&&(!!ii(d)||(!(!Yr(d)||p.isSelected||0!==d.length)||!(!p.isSelected||""!==p.inputValue.trim()))),C=()=>{p.isSelected&&f?Yr(d)&&(g?a([...d,p.inputValue]):o([...d,p.inputValue])):g?a(d):o(d)};return wc(xa,{children:[wc("div",{className:"question-container",children:[wc(Ac,{question:t,forceDisableHtml:i}),wc("fieldset",{className:"multiple-choice-options limit-height",children:[wc("legend",{className:"sr-only",children:f?" 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:_?d===e:Yr(d)&&d.includes(e);return wc("label",{className:i?"choice-option-open":"",children:[wc("div",{className:"response-choice",children:[wc("input",{type:_?"radio":"checkbox",name:s,checked:a,onChange:()=>y(e,i),id:s,"aria-controls":o}),wc("span",{children:i?e+":":e})]}),i&&wc("input",{type:"text",ref:u,id:o,name:"question"+n+"Open",value:p.inputValue,onKeyDown:S,onInput:b,onClick:t=>{p.isSelected||y(e,!0),t.stopPropagation()},"aria-label":e+" - please specify"})]},r)}))]})]}),wc(Pc,{text:t.buttonText||"Submit",submitDisabled:w(),appearance:s,onSubmit:C,onPreviewSubmit:C,skipSubmitButton:m})]})}var $c=[kc,Ic,Cc],Uc=[Ec,kc,Ic,Cc,xc],Wc=[1,2,3,4,5],zc=[1,2,3,4,5,6,7],jc=[0,1,2,3,4,5,6,7,8,9,10];function Zc(e){switch(e){case 5:default:return Wc;case 7:return zc;case 10:return jc}}var Gc=zn,Yc=Kn,Xc="ph:show_survey_widget",Kc="PHWidgetSurveyClickListener";function Jc(e,t,r){var i,n=e.questions[t],s=t+1;if(null==(i=n.branching)||!i.type)return t===e.questions.length-1?Il.End:s;if(n.branching.type===Il.End)return Il.End;if(n.branching.type===Il.SpecificQuestion){if(Number.isInteger(n.branching.index))return n.branching.index}else if(n.branching.type===Il.ResponseBased){if(n.type===Cl.SingleChoice){var o,a=n.choices.indexOf(""+r);if(-1===a&&n.hasOpenChoice&&(a=n.choices.length-1),null!=(o=n.branching)&&null!=(o=o.responseValues)&&o.hasOwnProperty(a)){var l=n.branching.responseValues[a];return Number.isInteger(l)?l:l===Il.End?Il.End:s}}else if(n.type===Cl.Rating){var u;if("number"!=typeof r||!Number.isInteger(r))throw new Error("The response type must be an integer");var c=function(e,t){if(3===t){if(e<1||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(e<1||e>5)throw new Error("The response must be in range 1-5");return e<=2?"negative":3===e?"neutral":"positive"}if(7===t){if(e<1||e>7)throw new Error("The response must be in range 1-7");return e<=3?"negative":4===e?"neutral":"positive"}if(10===t){if(e<0||e>10)throw new Error("The response must be in range 0-10");return e<=6?"detractors":e<=8?"passives":"promoters"}throw new Error("The scale must be one of: 3, 5, 7, 10")}(r,n.scale);if(null!=(u=n.branching)&&null!=(u=u.responseValues)&&u.hasOwnProperty(c)){var d=n.branching.responseValues[c];return Number.isInteger(d)?d:d===Il.End?Il.End:s}}return s}return Ml.warn("Falling back to next question index due to unexpected branching type"),s}var Qc=250,ed=20,td=12;class rd{constructor(e){var t=this;this._surveyTimeouts=new Map,this._widgetSelectorListeners=new Map,this._prefillHandledSurveys=new Set,this.handlePageUnload=()=>{var e=this._posthog.get_property(Ks);if(e)for(var t of e)mc(t)&&sc(t,this._posthog)},this.handlePopoverSurvey=e=>{var t;this._clearSurveyTimeout(e.id),this._addSurveyToFocus(e);var i=(null==(t=e.appearance)?void 0:t.surveyPopupDelaySeconds)||0,{shadow:n}=Qu(e,this._posthog);if(i<=0)return za(wc(ad,{posthog:this._posthog,survey:e,removeSurveyFromFocus:this._removeSurveyFromFocus}),n);var s=setTimeout((()=>{if(this._surveyTimeouts.delete(e.id),!vc(e))return this._removeSurveyFromFocus(e);za(wc(ad,{posthog:this._posthog,survey:r({},e,{appearance:r({},e.appearance,{surveyPopupDelaySeconds:0})}),removeSurveyFromFocus:this._removeSurveyFromFocus}),n)}),1e3*i);this._surveyTimeouts.set(e.id,s)},this._handleWidget=e=>{var{shadow:t,isNewlyCreated:r}=Qu(e,this._posthog);r&&za(wc(ud,{posthog:this._posthog,survey:e},e.id),t)},this._removeWidgetSelectorListener=e=>{this._removeSurveyFromDom(e);var t=this._widgetSelectorListeners.get(e.id);t&&(t.element.removeEventListener("click",t.listener),t.element.removeAttribute(Kc),this._widgetSelectorListeners.delete(e.id),Ml.info("Removed click listener for survey "+e.id))},this._manageWidgetSelectorListener=(e,t)=>{var r=Yc.querySelector(t),i=this._widgetSelectorListeners.get(e.id);if(r){if(this._handleWidget(e),i){if(r===i.element)return;Ml.info("Selector element changed for survey "+e.id+". Re-attaching listener."),this._removeWidgetSelectorListener(e)}if(!r.hasAttribute(Kc)){var n=t=>{var r,i;t.stopPropagation();var n=(null==(r=e.appearance)?void 0:r.position)===bl.NextToTrigger?function(e,t){try{var r=e.getBoundingClientRect(),i=Gc.innerHeight,n=Gc.innerWidth,s=Qc,o=r.left+r.width/2-t/2;o+t>n-ed&&(o=n-t-ed),o<ed&&(o=ed);var a=td,l=i-r.bottom,u=r.top,c=l<s&&u>l;return{position:"fixed",top:c?"auto":r.bottom+a+"px",left:o+"px",right:"auto",bottom:c?i-r.top+a+"px":"auto",zIndex:Yu.zIndex}}catch(e){return Ml.warn("Failed to calculate trigger position:",e),null}}(t.currentTarget,parseInt((null==(i=e.appearance)?void 0:i.maxWidth)||Yu.maxWidth)):{};Gc.dispatchEvent(new CustomEvent(Xc,{detail:{surveyId:e.id,position:n}}))};Cs(r,"click",n),r.setAttribute(Kc,"true"),this._widgetSelectorListeners.set(e.id,{element:r,listener:n,survey:e}),Ml.info("Attached click listener for feedback button survey "+e.id)}}else i&&this._removeWidgetSelectorListener(e)},this.renderPopover=e=>{var{shadow:t}=Qu(e,this._posthog);za(wc(ad,{posthog:this._posthog,survey:e,removeSurveyFromFocus:this._removeSurveyFromFocus}),t)},this.renderSurvey=(e,t)=>{var r;null!=(r=this._posthog.config)&&null!=(r=r.surveys)&&r.prefillFromUrl&&this._handleUrlPrefill(e),za(wc(ad,{posthog:this._posthog,survey:e,removeSurveyFromFocus:this._removeSurveyFromFocus,isPopup:!1}),t)},this.getActiveMatchingSurveys=function(e,r){var i;void 0===r&&(r=!1),null==(i=t._posthog)||i.surveys.getSurveys((r=>{var i=r.filter((e=>t.checkSurveyEligibility(e).eligible&&t._isSurveyConditionMatched(e)&&t._hasActionOrEventTriggeredSurvey(e)&&t._checkFlags(e)));e(i)}),r)},this.callSurveysAndEvaluateDisplayLogic=function(e){void 0===e&&(e=!1),t.getActiveMatchingSurveys((e=>{var r=e.filter((e=>e.type===wl.Popover||e.type===wl.Widget)),i=t._sortSurveysByAppearanceDelay(r),n=new Set;i.forEach((e=>{if(e.type===wl.Widget){var r,i,s,o;if((null==(r=e.appearance)?void 0:r.widgetType)===yl.Tab)return void t._handleWidget(e);if((null==(i=e.appearance)?void 0:i.widgetType)===yl.Selector&&null!=(s=e.appearance)&&s.widgetSelector)n.add(e.id),t._manageWidgetSelectorListener(e,null==(o=e.appearance)?void 0:o.widgetSelector)}ii(t._surveyInFocus)&&e.type===wl.Popover&&t.handlePopoverSurvey(e)})),t._widgetSelectorListeners.forEach((e=>{var{survey:r}=e;n.has(r.id)||t._removeWidgetSelectorListener(r)}))}),e)},this._addSurveyToFocus=e=>{ii(this._surveyInFocus)||Ml.error("Survey "+this._surveyInFocus+" already in focus. Cannot add survey "+e.id+"."),this._surveyInFocus=e.id},this._removeSurveyFromFocus=e=>{this._surveyInFocus!==e.id&&Ml.error("Survey "+e.id+" is not in focus. Cannot remove survey "+e.id+"."),this._clearSurveyTimeout(e.id),this._surveyInFocus=null,this._removeSurveyFromDom(e)},this._posthog=e,this._surveyInFocus=null}_clearSurveyTimeout(e){var t=this._surveyTimeouts.get(e);t&&(clearTimeout(t),this._surveyTimeouts.delete(e))}cancelSurvey(e){this._surveyTimeouts.has(e)&&(Ml.info("Cancelled pending survey "+e),this._clearSurveyTimeout(e),this._surveyInFocus===e&&(this._surveyInFocus=null))}_sortSurveysByAppearanceDelay(e){return e.sort(((e,t)=>{var r,i,n=mc(e),s=mc(t);if(n&&!s)return-1;if(!n&&s)return 1;var o=e.schedule===kl.Always,a=t.schedule===kl.Always;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)}))}_handleUrlPrefill(e){if(!this._prefillHandledSurveys.has(e.id))try{var{params:t}=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&&!ei(a)){var l=decodeURIComponent(o),u=decodeURIComponent(a);if("auto_submit"!==l||"true"!==u){var c=l.match(/^q(\d+)$/);if(c){var d=parseInt(c[1],10);t[d]||(t[d]=[]),t[d].push(u)}}else r=!0}}return{params:t,autoSubmit:r}}(Gc.location.search);if(0===Object.keys(t).length)return;Ml.info("[Survey Prefill] Detected URL prefill parameters");var r=function(e,t){var r={};return e.questions.forEach(((e,i)=>{if(t[i]&&e.id){var n=t[i],s=Zu(e.id);try{switch(e.type){case Cl.SingleChoice:if(!e.choices||0===e.choices.length)return void ls.warn("[Survey Prefill] Question "+i+" has no choices");var o=parseInt(n[0],10);if(isNaN(o)||o<0||o>=e.choices.length)return void ls.warn("[Survey Prefill] Invalid choice index for q"+i+": "+n[0]);r[s]=e.choices[o];break;case Cl.MultipleChoice:if(!e.choices||0===e.choices.length)return void ls.warn("[Survey Prefill] Question "+i+" has no choices");var a=n.map((e=>parseInt(e,10))).filter((t=>!isNaN(t)&&t>=0&&t<e.choices.length));if(0===a.length)return void ls.warn("[Survey Prefill] No valid choices for q"+i);var l=[...new Set(a.map((t=>e.choices[t])))];l.length<a.length&&ls.warn("[Survey Prefill] Removed duplicate choices for q"+i),r[s]=l;break;case Cl.Rating:var u=parseInt(n[0],10),c=e.scale||10;if(isNaN(u)||u<0||u>c)return void ls.warn("[Survey Prefill] Invalid rating for q"+i+": "+n[0]+" (scale: 0-"+c+")");r[s]=u;break;default:ls.info("[Survey Prefill] Question type "+e.type+" does not support prefill")}}catch(e){ls.error("[Survey Prefill] Error converting q"+i+":",e)}}})),r}(e,t);if(0===Object.keys(r).length)return void Ml.warn("[Survey Prefill] No valid responses after conversion");var i=Zl(),n=Object.keys(t).map((e=>parseInt(e,10))),{startQuestionIndex:s,skippedResponses:o}=function(e,t,r){for(var i=0,n={},s=0;s<e.length&&t.includes(s);s++){var o=e[s];if(!(o&&"skipSubmitButton"in o&&o.skipSubmitButton))break;if(i=s+1,o.id){var a=Zu(o.id);ei(r[a])||(n[a]=r[a])}}return{startQuestionIndex:i,skippedResponses:n}}(e.questions,n,r),a=s>=e.questions.length;_c(e,{surveySubmissionId:i,responses:r,lastQuestionIndex:a?e.questions.length-1:s}),Ml.info("[Survey Prefill] Stored prefilled responses in localStorage"),(Object.keys(o).length>0&&e.enable_partial_responses||a)&&tc({responses:a?r:o,survey:e,surveySubmissionId:i,posthog:this._posthog,isSurveyCompleted:a}),this._prefillHandledSurveys.add(e.id)}catch(e){Ml.error("[Survey Prefill] Error handling URL prefill:",e)}}_isSurveyFeatureFlagEnabled(e,t){if(void 0===t&&(t=void 0),!e)return!0;var r=!!this._posthog.featureFlags.isFeatureEnabled(e,{send_event:!e.startsWith("survey-targeting-")}),i=!0;t&&(i=this._posthog.featureFlags.getFeatureFlag(e,{send_event:!1})===t||"any"===t);return r&&i}_isSurveyConditionMatched(e){return!e.conditions||vc(e)&&function(e){var t,r,i;if(null==(t=e.conditions)||!t.deviceTypes||0===(null==(r=e.conditions)?void 0:r.deviceTypes.length))return!0;if(!rs)return!1;var n=fn(rs);return Vu[pc(null==(i=e.conditions)?void 0:i.deviceTypesMatchType)](e.conditions.deviceTypes,[n])}(e)&&function(e){var t;return null==(t=e.conditions)||!t.selector||!(null==ju||!ju.querySelector(e.conditions.selector))}(e)}_internalFlagCheckSatisfied(e){return uc(e)||this._isSurveyFeatureFlagEnabled(e.internal_targeting_flag_key)||mc(e)}checkSurveyEligibility(e){var t,r,i={eligible:!0,reason:void 0};if(!Rl(e))return i.eligible=!1,i.reason="Survey is not running. It was completed on "+e.end_date,i;if(!ql.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._isSurveyFeatureFlagEnabled(e.linked_flag_key,n)?this._isSurveyFeatureFlagEnabled(e.targeting_flag_key)?this._internalFlagCheckSatisfied(e)?(e=>{var t=localStorage.getItem("lastSeenSurveyDate");if(!e||!t)return!0;var r=new Date,i=Math.abs(r.getTime()-new Date(t).getTime());return Math.ceil(i/864e5)>e})(null==(r=e.conditions)?void 0:r.seenSurveyWaitPeriodInDays)?(e=>!!localStorage.getItem(Dl(e))&&!uc(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)}_hasActionOrEventTriggeredSurvey(e){var t;if(!Pl(e)&&!Al(e))return!0;var r=null==(t=this._posthog.surveys._surveyEventReceiver)?void 0:t.getSurveys();return!(null==r||!r.includes(e.id))}_checkFlags(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._isSurveyFeatureFlagEnabled(r)}))}_removeSurveyFromDom(e){try{var t=Yc.querySelector(bc(e,!0));null!=t&&t.shadowRoot&&za(null,t.shadowRoot),null==t||t.remove()}catch(t){Ml.warn("Failed to remove survey "+e.id+" from DOM:",t)}}getTestAPI(){return{addSurveyToFocus:this._addSurveyToFocus,removeSurveyFromFocus:this._removeSurveyFromFocus,surveyInFocus:this._surveyInFocus,surveyTimeouts:this._surveyTimeouts,handleWidget:this._handleWidget,handlePopoverSurvey:this.handlePopoverSurvey,manageWidgetSelectorListener:this._manageWidgetSelectorListener,sortSurveysByAppearanceDelay:this._sortSurveysByAppearanceDelay,checkFlags:this._checkFlags.bind(this),isSurveyFeatureFlagEnabled:this._isSurveyFeatureFlagEnabled.bind(this)}}}function id(e,t){if(Yc&&Gc){var r,i=new rd(e);if(e.config.disable_surveys_automatic_display)return Ml.info("Surveys automatic display is disabled. Skipping call surveys and evaluate display logic."),i;if(!1===t)return Ml.info("There are no surveys to load or Surveys is disabled in the project settings."),i;i.callSurveysAndEvaluateDisplayLogic(!0);var n=()=>{ei(r)&&(r=setInterval((()=>{i.callSurveysAndEvaluateDisplayLogic(!1)}),1e3))};return n(),Cs(Yc,"visibilitychange",(()=>{Yc.hidden?ei(r)||(clearInterval(r),r=void 0):(i.callSurveysAndEvaluateDisplayLogic(!1),n())})),i}}function nd(e){var{survey:t,removeSurveyFromFocus:r=(()=>{}),setSurveyVisible:i,isPreviewMode:n=!1}=e;al((()=>{var e;if(!n&&null!=(e=t.conditions)&&e.url){var s=()=>{var e,n=t.type===wl.Widget,s=vc(t),o=(null==(e=t.appearance)?void 0:e.widgetType)===yl.Tab&&n;if(!s)return Ml.info("Hiding survey "+t.id+" because URL does not match"),i(!1),r(t);o&&(Ml.info("Showing survey "+t.id+" because it is a feedback button tab and URL matches"),i(!0))};Cs(Gc,"popstate",s),Cs(Gc,"hashchange",s);var o=Gc.history.pushState,a=Gc.history.replaceState;return Gc.history.pushState=function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];o.apply(this,t),s()},Gc.history.replaceState=function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];a.apply(this,t),s()},()=>{Gc.removeEventListener("popstate",s),Gc.removeEventListener("hashchange",s),Gc.history.pushState=o,Gc.history.replaceState=a}}}),[n,t,r,i])}function sd(e,t,r){if(void 0===t&&(t=bl.Right),e===wl.ExternalSurvey)return{};switch(t){case bl.TopLeft:return{top:"0",left:"0",transform:"translate(30px, 30px)"};case bl.TopRight:return{top:"0",right:"0",transform:"translate(-30px, 30px)"};case bl.TopCenter:return{top:"0",left:"50%",transform:"translate(-50%, 30px)"};case bl.MiddleLeft:return{top:"50%",left:"0",transform:"translate(30px, -50%)"};case bl.MiddleRight:return{top:"50%",right:"0",transform:"translate(-30px, -50%)"};case bl.MiddleCenter:return{top:"50%",left:"50%",transform:"translate(-50%, -50%)"};case bl.Left:return{left:"30px"};case bl.Center:return{left:"50%",transform:"translateX(-50%)"};default:case bl.Right:return{right:e===wl.Widget&&r===yl.Tab?"60px":"30px"}}}function od(e){switch(void 0===e&&(e=Sl.Right),e){case Sl.Top:return{top:"0",left:"50%",transform:"translateX(-50%)"};case Sl.Left:return{top:"50%",left:"0",transform:"rotate(90deg) translateY(-100%)",transformOrigin:"left top"};case Sl.Bottom:return{bottom:"0",left:"50%",transform:"translateX(-50%)"};default:case Sl.Right:return{top:"50%",right:"0",transform:"rotate(-90deg) translateY(-100%)",transformOrigin:"right top"}}}function ad(e){var t,i,n,s,o,a,{survey:l,forceDisableHtml:u,posthog:c,style:d={},previewPageIndex:h,removeSurveyFromFocus:p=(()=>{}),isPopup:v=!0,onPreviewSubmit:g=(()=>{}),onPopupSurveyDismissed:_=(()=>{}),onCloseConfirmationMessage:f=(()=>{})}=e,m=ll(null),y=Number.isInteger(h),b=null!=(t=l.appearance)&&t.surveyPopupDelaySeconds?1e3*l.appearance.surveyPopupDelaySeconds:0,{isPopupVisible:S,isSurveySent:w,hidePopupWithViewTransition:C}=function(e,t,r,i,n,s,o){var[a,l]=ol(i||0===r||e.type===wl.ExternalSurvey),[u,c]=ol(!1),d=()=>{var t=()=>{s&&n(e),l(!1)};Yc.startViewTransition?Yc.startViewTransition((()=>{var e;null==o||null==(e=o.current)||e.remove()})).finished.then((()=>{setTimeout((()=>{t()}),100)})):t()},h=t=>{t.detail.surveyId===e.id&&d()};return al((()=>{if(t){if(!i){var n=t=>{var r,i;if(t.detail.surveyId===e.id){if(null==(r=e.appearance)||!r.displayThankYouMessage)return d();c(!0),null!=(i=e.appearance)&&i.autoDisappear&&setTimeout((()=>{d()}),5e3)}},s=()=>{vc(e)&&(l(!0),Gc.dispatchEvent(new Event("PHSurveyShown")),t.capture(El.SHOWN,{[xl.SURVEY_NAME]:e.name,[xl.SURVEY_ID]:e.id,[xl.SURVEY_ITERATION]:e.current_iteration,[xl.SURVEY_ITERATION_START_DATE]:e.current_iteration_start_date,sessionRecordingUrl:null==t.get_session_replay_url?void 0:t.get_session_replay_url()}),localStorage.setItem("lastSeenSurveyDate",(new Date).toISOString()))};if(Cs(Gc,"PHSurveyClosed",h),Cs(Gc,"PHSurveySent",n),r>0){var o=setTimeout(s,r);return()=>{clearTimeout(o),Gc.removeEventListener("PHSurveyClosed",h),Gc.removeEventListener("PHSurveySent",n)}}return s(),()=>{Gc.removeEventListener("PHSurveyClosed",h),Gc.removeEventListener("PHSurveySent",n)}}}else Ml.error("usePopupVisibility hook called without a PostHog instance.")}),[]),nd({survey:e,removeSurveyFromFocus:n,setSurveyVisible:l,isPreviewMode:i}),{isPopupVisible:a,isSurveySent:u,setIsPopupVisible:l,hidePopupWithViewTransition:d}}(l,c,b,y,p,v,m),I=w||h===l.questions.length,k=ul((()=>{var e=fc(l);return{isPreviewMode:y,previewPageIndex:h,onPopupSurveyDismissed:()=>{nc(l,c,y),_()},isPopup:v||!1,surveySubmissionId:(null==e?void 0:e.surveySubmissionId)||Zl(),onPreviewSubmit:g,posthog:c}}),[y,h,v,c,l,_,g]);return S?wc(cc.Provider,{value:k,children:wc("div",{className:"ph-survey",style:r({},sd(l.type,null==(i=l.appearance)?void 0:i.position,null==(n=l.appearance)?void 0:n.widgetType),d),ref:m,children:I?wc(Lc,{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||Yu,onClose:()=>{C(),f()}}):wc(ld,{survey:l,forceDisableHtml:!!u,posthog:c})})}):null}function ld(e){var t,{survey:i,forceDisableHtml:n,posthog:s}=e,[o,a]=ol((()=>{var e=fc(i);return null!=e&&e.responses&&Ml.info("Survey is already in progress, filling in initial responses"),(null==e?void 0:e.responses)||{}})),{previewPageIndex:l,onPopupSurveyDismissed:u,isPopup:c,onPreviewSubmit:d,surveySubmissionId:h,isPreviewMode:p}=cl(cc),[v,g]=ol((()=>{var e=fc(i);return l||(null==e?void 0:e.lastQuestionIndex)||0})),_=ul((()=>lc(i)),[i]);al((()=>{p&&!ei(l)&&g(l)}),[l,p]);var f=_.at(v);return f?wc("form",{className:"survey-form",name:"surveyForm",children:[c&&!0!==(null==(t=i.appearance)?void 0:t.hideCancelButton)&&wc(Nc,{onClick:()=>{u()}}),wc("div",{className:"survey-box",children:cd({question:f,forceDisableHtml:n,displayQuestionIndex:v,appearance:i.appearance||Yu,onSubmit:e=>(e=>{var{res:t,displayQuestionIndex:n,questionId:l}=e;if(s)if(l){var u=Zu(l),c=r({},o,{[u]:t});a(c);var d=Jc(i,n,t),p=d===Il.End;p||(g(d),_c(i,{surveySubmissionId:h,responses:c,lastQuestionIndex:d})),(i.enable_partial_responses||p)&&tc({responses:c,survey:i,surveySubmissionId:h,isSurveyCompleted:p,posthog:s})}else Ml.error("onNextButtonClick called without a questionId.");else Ml.error("onNextButtonClick called without a PostHog instance.")})({res:e,displayQuestionIndex:v,questionId:f.id}),onPreviewSubmit:d,initialValue:f.id?o[Zu(f.id)]:void 0})})]}):null}function ud(e){var t,r,i,n,s,o,a,{survey:l,forceDisableHtml:u,posthog:c,readOnly:d}=e,[h,p]=ol(!0),[v,g]=ol(!1),[_,f]=ol({}),m=()=>{g(!v)};if(al((()=>{var e;if(c){if(!d){"tab"===(null==(e=l.appearance)?void 0:e.widgetType)&&f({top:"50%",bottom:"auto"});var t=e=>{var t,r=e;(null==(t=r.detail)?void 0:t.surveyId)===l.id&&(Ml.info("Received show event for feedback button survey "+l.id),f(r.detail.position||{}),m())};return Cs(Gc,Xc,t),()=>{Gc.removeEventListener(Xc,t)}}}else Ml.error("FeedbackWidget called without a PostHog instance.")}),[c,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]),nd({survey:l,setSurveyVisible:p}),!h)return null;var y=()=>{l.schedule!==kl.Always&&p(!1),setTimeout((()=>{g(!1)}),200)};return wc(xa,{children:["tab"===(null==(n=l.appearance)?void 0:n.widgetType)&&wc("button",{className:"ph-survey-widget-tab "+((null==(s=l.appearance)?void 0:s.tabPosition)===Sl.Top?"widget-tab-top":""),onClick:m,disabled:d,style:od(null==(o=l.appearance)?void 0:o.tabPosition),children:(null==(a=l.appearance)?void 0:a.widgetLabel)||""}),v&&wc(ad,{posthog:c,survey:l,forceDisableHtml:u,style:_,onPopupSurveyDismissed:y,onCloseConfirmationMessage:y})]})}var cd=e=>{var{question:t,forceDisableHtml:i,displayQuestionIndex:n,appearance:s,onSubmit:o,onPreviewSubmit:a,initialValue:l}=e,u={forceDisableHtml:i,appearance:s,onPreviewSubmit:e=>{a(e)},onSubmit:e=>{o(e)},initialValue:l,displayQuestionIndex:n};switch(t.type){case Cl.Open:return ka(Dc,r({},u,{question:t,key:t.id}));case Cl.Link:return ka(Hc,r({},u,{question:t,key:t.id}));case Cl.Rating:return ka(qc,r({},u,{question:t,key:t.id}));case Cl.SingleChoice:case Cl.MultipleChoice:return ka(Vc,r({},u,{question:t,key:t.id}));default:return Ml.error("Unsupported question type: "+t.type),null}};is.__PosthogExtensions__=is.__PosthogExtensions__||{},is.__PosthogExtensions__.generateSurveys=id,is.extendPostHogWithSurveys=id;var dd=us("[Error tracking]");function hd(){return new bn([new Fn,new Wn,new On,new Ln,new $n,new Vn,new Hn,new Un],Nn("web:javascript",xn,Rn))}class pd{constructor(e){var t,r;this._suppressionRules=[],this._errorPropertiesBuilder=hd(),this._instance=e,this._suppressionRules=null!==(t=null==(r=this._instance.persistence)?void 0:r.get_property(Ds))&&void 0!==t?t:[]}onRemoteConfig(e){var t,r,i,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._suppressionRules=n,this._instance.persistence&&this._instance.persistence.register({[Ds]:this._suppressionRules,[Hs]:s})}get _captureExtensionExceptions(){var e,t=!!this._instance.get_property(Hs),r=this._instance.config.error_tracking.captureExtensionExceptions;return null!==(e=null!=r?r:t)&&void 0!==e&&e}buildProperties(e,t){return this._errorPropertiesBuilder.buildFromUnknown(e,{syntheticException:null==t?void 0:t.syntheticException,mechanism:{handled:null==t?void 0:t.handled}})}sendExceptionEvent(e){var t=e.$exception_list;if(this._isExceptionList(t)){if(this._matchesSuppressionRule(t))return void dd.info("Skipping exception capture because a suppression rule matched");if(!this._captureExtensionExceptions&&this._isExtensionException(t))return void dd.info("Skipping exception capture because it was thrown by an extension");if(!this._instance.config.error_tracking.__capturePostHogExceptions&&this._isPostHogException(t))return void dd.info("Skipping exception capture because it was thrown by the PostHog SDK")}return this._instance.capture("$exception",e,{_noTruncate:!0,_batchKey:"exceptionEvent"})}_matchesSuppressionRule(e){if(0===e.length)return!1;var t=e.reduce(((e,t)=>{var{type:r,value:i}=t;return ti(r)&&r.length>0&&e.$exception_types.push(r),ti(i)&&i.length>0&&e.$exception_values.push(i),e}),{$exception_types:[],$exception_values:[]});return this._suppressionRules.some((e=>{var r=e.values.map((e=>{var r,i=Vu[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)}))}_isExtensionException(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://")))}_isPostHogException(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}_isExceptionList(e){return!ni(e)&&Yr(e)}}var vd=us("[ExceptionAutocapture]"),gd=hd(),_d={wrapOnError:e=>{var t=zn;t||vd.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;s<i;s++)n[s]=arguments[s];var o=n[4],a=n[0],l=gd.buildFromUnknown(o||a,{mechanism:{handled:!1}});return e(l),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=zn;t||vd.info("window not available, cannot wrap onUnhandledRejection");var r=t.onunhandledrejection;return t.onunhandledrejection=function(i){var n,s=gd.buildFromUnknown(i,{mechanism:{handled:!1}});return e(s),null!==(n=null==r?void 0:r.apply(t,[i]))&&void 0!==n&&n},t.onunhandledrejection.__POSTHOG_INSTRUMENTED__=!0,()=>{var e;null==(e=t.onunhandledrejection)||delete e.__POSTHOG_INSTRUMENTED__,t.onunhandledrejection=r}},wrapConsoleError:e=>{var t=console;t||vd.info("console not available, cannot wrap console.error");var r=t.error;return t.error=function(){for(var t=arguments.length,i=new Array(t),n=0;n<t;n++)i[n]=arguments[n];var s=i.join(" "),o=i.find((e=>e instanceof Error)),a=gd.buildFromUnknown(o||s,{mechanism:{handled:!1},syntheticException:new Error("PostHog syntheticException")});return e(a),null==r?void 0:r(...i)},t.error.__POSTHOG_INSTRUMENTED__=!0,()=>{var e;null==(e=t.error)||delete e.__POSTHOG_INSTRUMENTED__,t.error=r}}};is.__PosthogExtensions__=is.__PosthogExtensions__||{},is.__PosthogExtensions__.errorWrappingFunctions=_d,is.posthogErrorWrappingFunctions=_d;var fd=(e,t,r,i)=>{var n;try{n=new URL(i.url).hostname}catch(e){return}if(!Yr(e)||e.includes(n)){if(r){var{sessionId:s,windowId:o}=r.checkAndGetSessionAndWindowId(!0);i.headers.set("X-POSTHOG-SESSION-ID",s),i.headers.set("X-POSTHOG-WINDOW-ID",o)}t!==ao&&i.headers.set("X-POSTHOG-DISTINCT-ID",t)}};is.__PosthogExtensions__=is.__PosthogExtensions__||{};var md={_patchFetch:(e,r,i)=>Ms(zn,"fetch",(n=>function(){var s=t((function*(t,s){var o=new Request(t,s);return fd(e,r,i,o),n(o)}));return function(e,t){return s.apply(this,arguments)}}())),_patchXHR:(e,t,r)=>Ms(zn.XMLHttpRequest.prototype,"open",(i=>function(n,s,o,a,l){void 0===o&&(o=!0);var u=new Request(s);return fd(e,t,r,u),i.call(this,n,u.url,o,a,l)}))};is.__PosthogExtensions__.tracingHeadersPatchFns=md,is.postHogTracingHeadersPatchFns=md;var yd,bd,Sd=function(){var e=self.performance&&performance.getEntriesByType&&performance.getEntriesByType("navigation")[0];if(e&&e.responseStart>0&&e.responseStart<performance.now())return e},wd=function(e){if("loading"===document.readyState)return"loading";var t=Sd();if(t){if(e<t.domInteractive)return"loading";if(0===t.domContentLoadedEventStart||e<t.domContentLoadedEventStart)return"dom-interactive";if(0===t.domComplete||e<t.domComplete)return"dom-content-loaded"}return"complete"},Cd=function(e){var t=e.nodeName;return 1===e.nodeType?t.toLowerCase():t.toUpperCase().replace(/^#/,"")},Id=function(e,t){var r="";try{for(;e&&9!==e.nodeType;){var i=e,n=i.id?"#"+i.id:Cd(i)+(i.classList&&i.classList.value&&i.classList.value.trim()&&i.classList.value.trim().length?"."+i.classList.value.trim().replace(/\s+/g,"."):"");if(r.length+n.length>(t||100)-1)return r||n;if(r=r?n+">"+r:n,i.id)break;e=i.parentNode}}catch(e){}return r},kd=-1,Ed=function(){return kd},xd=function(e){addEventListener("pageshow",(function(t){t.persisted&&(kd=t.timeStamp,e(t))}),!0)},Td=function(){var e=Sd();return e&&e.activationStart||0},Md=function(e,t){var r=Sd(),i="navigate";return Ed()>=0?i="back-forward-cache":r&&(document.prerendering||Td()>0?i="prerender":document.wasDiscarded?i="restore":r.type&&(i=r.type.replace(/_/g,"-"))),{name:e,value:void 0===t?-1:t,rating:"good",delta:0,entries:[],id:"v4-".concat(Date.now(),"-").concat(Math.floor(8999999999999*Math.random())+1e12),navigationType:i}},Rd=function(e,t,r){try{if(PerformanceObserver.supportedEntryTypes.includes(e)){var i=new PerformanceObserver((function(e){Promise.resolve().then((function(){t(e.getEntries())}))}));return i.observe(Object.assign({type:e,buffered:!0},r||{})),i}}catch(e){}},Pd=function(e,t,r,i){var n,s;return function(o){t.value>=0&&(o||i)&&((s=t.value-(n||0))||void 0===n)&&(n=t.value,t.delta=s,t.rating=function(e,t){return e>t[1]?"poor":e>t[0]?"needs-improvement":"good"}(t.value,r),e(t))}},Ad=function(e){requestAnimationFrame((function(){return requestAnimationFrame((function(){return e()}))}))},Nd=function(e){document.addEventListener("visibilitychange",(function(){"hidden"===document.visibilityState&&e()}))},Fd=function(e){var t=!1;return function(){t||(e(),t=!0)}},Ld=-1,Od=function(){return"hidden"!==document.visibilityState||document.prerendering?1/0:0},Dd=function(e){"hidden"===document.visibilityState&&Ld>-1&&(Ld="visibilitychange"===e.type?e.timeStamp:0,qd())},Hd=function(){addEventListener("visibilitychange",Dd,!0),addEventListener("prerenderingchange",Dd,!0)},qd=function(){removeEventListener("visibilitychange",Dd,!0),removeEventListener("prerenderingchange",Dd,!0)},Bd=function(){return Ld<0&&(Ld=Od(),Hd(),xd((function(){setTimeout((function(){Ld=Od(),Hd()}),0)}))),{get firstHiddenTime(){return Ld}}},Vd=function(e){document.prerendering?addEventListener("prerenderingchange",(function(){return e()}),!0):e()},$d=[1800,3e3],Ud=function(e,t){t=t||{},Vd((function(){var r,i=Bd(),n=Md("FCP"),s=Rd("paint",(function(e){e.forEach((function(e){"first-contentful-paint"===e.name&&(s.disconnect(),e.startTime<i.firstHiddenTime&&(n.value=Math.max(e.startTime-Td(),0),n.entries.push(e),r(!0)))}))}));s&&(r=Pd(e,n,$d,t.reportAllChanges),xd((function(i){n=Md("FCP"),r=Pd(e,n,$d,t.reportAllChanges),Ad((function(){n.value=performance.now()-i.timeStamp,r(!0)}))})))}))},Wd=[.1,.25],zd=0,jd=1/0,Zd=0,Gd=function(e){e.forEach((function(e){e.interactionId&&(jd=Math.min(jd,e.interactionId),Zd=Math.max(Zd,e.interactionId),zd=Zd?(Zd-jd)/7+1:0)}))},Yd=function(){return yd?zd:performance.interactionCount||0},Xd=function(){"interactionCount"in performance||yd||(yd=Rd("event",Gd,{type:"event",buffered:!0,durationThreshold:0}))},Kd=[],Jd=new Map,Qd=0,eh=[],th=function(e){if(eh.forEach((function(t){return t(e)})),e.interactionId||"first-input"===e.entryType){var t=Kd[Kd.length-1],r=Jd.get(e.interactionId);if(r||Kd.length<10||e.duration>t.latency){if(r)e.duration>r.latency?(r.entries=[e],r.latency=e.duration):e.duration===r.latency&&e.startTime===r.entries[0].startTime&&r.entries.push(e);else{var i={id:e.interactionId,latency:e.duration,entries:[e]};Jd.set(i.id,i),Kd.push(i)}Kd.sort((function(e,t){return t.latency-e.latency})),Kd.length>10&&Kd.splice(10).forEach((function(e){return Jd.delete(e.id)}))}}},rh=function(e){var t=self.requestIdleCallback||self.setTimeout,r=-1;return e=Fd(e),"hidden"===document.visibilityState?e():(r=t(e),Nd(e)),r},ih=[200,500],nh=function(e,t){"PerformanceEventTiming"in self&&"interactionId"in PerformanceEventTiming.prototype&&(t=t||{},Vd((function(){var r;Xd();var i,n=Md("INP"),s=function(e){rh((function(){e.forEach(th);var t=function(){var e=Math.min(Kd.length-1,Math.floor((Yd()-Qd)/50));return Kd[e]}();t&&t.latency!==n.value&&(n.value=t.latency,n.entries=t.entries,i())}))},o=Rd("event",s,{durationThreshold:null!==(r=t.durationThreshold)&&void 0!==r?r:40});i=Pd(e,n,ih,t.reportAllChanges),o&&(o.observe({type:"first-input",buffered:!0}),Nd((function(){s(o.takeRecords()),i(!0)})),xd((function(){Qd=Yd(),Kd.length=0,Jd.clear(),n=Md("INP"),i=Pd(e,n,ih,t.reportAllChanges)})))})))},sh=[],oh=[],ah=0,lh=new WeakMap,uh=new Map,ch=-1,dh=function(e){sh=sh.concat(e),hh()},hh=function(){ch<0&&(ch=rh(ph))},ph=function(){uh.size>10&&uh.forEach((function(e,t){Jd.has(t)||uh.delete(t)}));var e=Kd.map((function(e){return lh.get(e.entries[0])})),t=oh.length-50;oh=oh.filter((function(r,i){return i>=t||e.includes(r)}));for(var r=new Set,i=0;i<oh.length;i++){var n=oh[i];vh(n.startTime,n.processingEnd).forEach((function(e){r.add(e)}))}var s=sh.length-1-50;sh=sh.filter((function(e,t){return e.startTime>ah&&t>s||r.has(e)})),ch=-1};eh.push((function(e){e.interactionId&&e.target&&!uh.has(e.interactionId)&&uh.set(e.interactionId,e.target)}),(function(e){var t,r=e.startTime+e.duration;ah=Math.max(ah,e.processingEnd);for(var i=oh.length-1;i>=0;i--){var n=oh[i];if(Math.abs(r-n.renderTime)<=8){(t=n).startTime=Math.min(e.startTime,t.startTime),t.processingStart=Math.min(e.processingStart,t.processingStart),t.processingEnd=Math.max(e.processingEnd,t.processingEnd),t.entries.push(e);break}}t||(t={startTime:e.startTime,processingStart:e.processingStart,processingEnd:e.processingEnd,renderTime:r,entries:[e]},oh.push(t)),(e.interactionId||"first-input"===e.entryType)&&lh.set(e,t),hh()}));var vh=function(e,t){for(var r,i=[],n=0;r=sh[n];n++)if(!(r.startTime+r.duration<e)){if(r.startTime>t)break;i.push(r)}return i},gh=[2500,4e3],_h={},fh={onLCP:function(e,t){!function(e,t){t=t||{},Vd((function(){var r,i=Bd(),n=Md("LCP"),s=function(e){t.reportAllChanges||(e=e.slice(-1)),e.forEach((function(e){e.startTime<i.firstHiddenTime&&(n.value=Math.max(e.startTime-Td(),0),n.entries=[e],r())}))},o=Rd("largest-contentful-paint",s);if(o){r=Pd(e,n,gh,t.reportAllChanges);var a=Fd((function(){_h[n.id]||(s(o.takeRecords()),o.disconnect(),_h[n.id]=!0,r(!0))}));["keydown","click"].forEach((function(e){addEventListener(e,(function(){return rh(a)}),{once:!0,capture:!0})})),Nd(a),xd((function(i){n=Md("LCP"),r=Pd(e,n,gh,t.reportAllChanges),Ad((function(){n.value=performance.now()-i.timeStamp,_h[n.id]=!0,r(!0)}))}))}}))}((function(t){var r=function(e){var t={timeToFirstByte:0,resourceLoadDelay:0,resourceLoadDuration:0,elementRenderDelay:e.value};if(e.entries.length){var r=Sd();if(r){var i=r.activationStart||0,n=e.entries[e.entries.length-1],s=n.url&&performance.getEntriesByType("resource").filter((function(e){return e.name===n.url}))[0],o=Math.max(0,r.responseStart-i),a=Math.max(o,s?(s.requestStart||s.startTime)-i:0),l=Math.max(a,s?s.responseEnd-i:0),u=Math.max(l,n.startTime-i);t={element:Id(n.element),timeToFirstByte:o,resourceLoadDelay:a-o,resourceLoadDuration:l-a,elementRenderDelay:u-l,navigationEntry:r,lcpEntry:n},n.url&&(t.url=n.url),s&&(t.lcpResourceEntry=s)}}return Object.assign(e,{attribution:t})}(t);e(r)}),t)},onCLS:function(e,t){!function(e,t){t=t||{},Ud(Fd((function(){var r,i=Md("CLS",0),n=0,s=[],o=function(e){e.forEach((function(e){if(!e.hadRecentInput){var t=s[0],r=s[s.length-1];n&&e.startTime-r.startTime<1e3&&e.startTime-t.startTime<5e3?(n+=e.value,s.push(e)):(n=e.value,s=[e])}})),n>i.value&&(i.value=n,i.entries=s,r())},a=Rd("layout-shift",o);a&&(r=Pd(e,i,Wd,t.reportAllChanges),Nd((function(){o(a.takeRecords()),r(!0)})),xd((function(){n=0,i=Md("CLS",0),r=Pd(e,i,Wd,t.reportAllChanges),Ad((function(){return r()}))})),setTimeout(r,0))})))}((function(t){var r=function(e){var t,r={};if(e.entries.length){var i=e.entries.reduce((function(e,t){return e&&e.value>t.value?e:t}));if(i&&i.sources&&i.sources.length){var n=(t=i.sources).find((function(e){return e.node&&1===e.node.nodeType}))||t[0];n&&(r={largestShiftTarget:Id(n.node),largestShiftTime:i.startTime,largestShiftValue:i.value,largestShiftSource:n,largestShiftEntry:i,loadState:wd(i.startTime)})}}return Object.assign(e,{attribution:r})}(t);e(r)}),t)},onFCP:function(e,t){Ud((function(t){var r=function(e){var t={timeToFirstByte:0,firstByteToFCP:e.value,loadState:wd(Ed())};if(e.entries.length){var r=Sd(),i=e.entries[e.entries.length-1];if(r){var n=r.activationStart||0,s=Math.max(0,r.responseStart-n);t={timeToFirstByte:s,firstByteToFCP:e.value-s,loadState:wd(e.entries[0].startTime),navigationEntry:r,fcpEntry:i}}}return Object.assign(e,{attribution:t})}(t);e(r)}),t)},onINP:function(e,t){bd||(bd=Rd("long-animation-frame",dh)),nh((function(t){var r=function(e){var t=e.entries[0],r=lh.get(t),i=t.processingStart,n=r.processingEnd,s=r.entries.sort((function(e,t){return e.processingStart-t.processingStart})),o=vh(t.startTime,n),a=e.entries.find((function(e){return e.target})),l=a&&a.target||uh.get(t.interactionId),u=[t.startTime+t.duration,n].concat(o.map((function(e){return e.startTime+e.duration}))),c=Math.max.apply(Math,u),d={interactionTarget:Id(l),interactionTargetElement:l,interactionType:t.name.startsWith("key")?"keyboard":"pointer",interactionTime:t.startTime,nextPaintTime:c,processedEventEntries:s,longAnimationFrameEntries:o,inputDelay:i-t.startTime,processingDuration:n-i,presentationDelay:Math.max(c-n,0),loadState:wd(t.startTime)};return Object.assign(e,{attribution:d})}(t);e(r)}),t)}};is.__PosthogExtensions__=is.__PosthogExtensions__||{},is.__PosthogExtensions__.postHogWebVitalsCallbacks=fh,is.postHogWebVitalsCallbacks=fh;class mh{constructor(e){this.disabled=!1===e;var t=Jr(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&&r-i.timestamp<this.timeoutMs){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 yh=us("[AutoCapture]");function bh(e,t){return t.length>e?t.slice(0,e)+"...":t}function Sh(e){if(e.previousElementSibling)return e.previousElementSibling;var t=e;do{t=t.previousSibling}while(t&&!co(t));return t}function wh(e,t,r,i){var n=e.tagName.toLowerCase(),s={tag_name:n};So.indexOf(n)>-1&&!r&&("a"===n.toLowerCase()||"button"===n.toLowerCase()?s.$el_text=bh(1024,Bo(e)):s.$el_text=bh(1024,yo(e)));var o=fo(e);o.length>0&&(s.classes=o.filter((function(e){return""!==e}))),hs(e.attributes,(function(r){var n;if((!Ao(e)||-1!==["name","id","class","aria-label"].indexOf(r.name))&&((null==i||!i.includes(r.name))&&!t&&qo(r.value)&&(n=r.name,!ti(n)||"_ngcontent"!==n.substring(0,10)&&"_nghost"!==n.substring(0,7)))){var o=r.value;"class"===r.name&&(o=go(o).join(" ")),s["attr__"+r.name]=bh(1024,o)}}));for(var a=1,l=1,u=e;u=Sh(u);)a++,u.tagName===e.tagName&&l++;return s.nth_child=a,s.nth_of_type=l,s}function Ch(e,t){for(var r,i,{e:n,maskAllElementAttributes:s,maskAllText:o,elementAttributeIgnoreList:a,elementsChainAsString:l}=t,u=[e],c=e;c.parentNode&&!ho(c,"body");)vo(c.parentNode)?(u.push(c.parentNode.host),c=c.parentNode.host):(u.push(c.parentNode),c=c.parentNode);var d,h=[],p={},v=!1,g=!1;if(hs(u,(e=>{var t=Po(e);"a"===e.tagName.toLowerCase()&&(v=e.getAttribute("href"),v=t&&v&&qo(v)&&v),$r(fo(e),"ph-no-capture")&&(g=!0),h.push(wh(e,s,o,a));var r=function(e){if(!Po(e))return{};var t={};return hs(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&&qo(i)&&(t[r]=i)}})),t}(e);ps(p,r)})),g)return{props:{},explicitNoCapture:g};if(o||("a"===e.tagName.toLowerCase()||"button"===e.tagName.toLowerCase()?h[0].$el_text=Bo(e):h[0].$el_text=yo(e)),v){var _,f;h[0].attr__href=v;var m=null==(_=Is(v))?void 0:_.host,y=null==zn||null==(f=zn.location)?void 0:f.host;m&&y&&m!==y&&(d=v)}return{props:ps({$event_type:n.type,$ce_version:1},l?{}:{$elements:h},{$elements_chain:$o(h)},null!=(r=h[0])&&r.$el_text?{$el_text:null==(i=h[0])?void 0:i.$el_text}:{},d&&"click"===n.type?{$external_click_url:d}:{},p)}}class Ih{constructor(e){this._initialized=!1,this._isDisabledServerSide=null,this._elementsChainAsString=!1,this.instance=e,this.rageclicks=new mh(e.config.rageclick),this._elementSelectors=null}get _config(){var e,t,r=Jr(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}_addDomEventHandlers(){if(this.isBrowserSupported()){if(zn&&Kn){var e=e=>{e=e||(null==zn?void 0:zn.event);try{this._captureEvent(e)}catch(e){yh.error("Failed to capture event",e)}};if(Cs(Kn,"submit",e,{capture:!0}),Cs(Kn,"change",e,{capture:!0}),Cs(Kn,"click",e,{capture:!0}),this._config.capture_copied_text){var t=e=>{e=e||(null==zn?void 0:zn.event),this._captureEvent(e,Yl)};Cs(Kn,"copy",t,{capture:!0}),Cs(Kn,"cut",t,{capture:!0})}}}else yh.info("Disabling Automatic Event Collection because this browser is not supported")}startIfEnabled(){this.isEnabled&&!this._initialized&&(this._addDomEventHandlers(),this._initialized=!0)}onRemoteConfig(e){e.elementsChainAsString&&(this._elementsChainAsString=e.elementsChainAsString),this.instance.persistence&&this.instance.persistence.register({[Fs]:!!e.autocapture_opt_out}),this._isDisabledServerSide=!!e.autocapture_opt_out,this.startIfEnabled()}setElementSelectors(e){this._elementSelectors=e}getElementSelectors(e){var t,r=[];return null==(t=this._elementSelectors)||t.forEach((t=>{var i=null==Kn?void 0:Kn.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[Fs],i=this._isDisabledServerSide;if(ii(i)&&!oi(r)&&!this.instance._shouldDisableFlags())return!1;var n=null!==(t=this._isDisabledServerSide)&&void 0!==t?t:!!r;return!!this.instance.config.autocapture&&!n}_captureEvent(e,t){if(void 0===t&&(t="$autocapture"),this.isEnabled){var r,i=bo(e);if(po(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())&&xo(i,this.instance.config.rageclick)&&this._captureEvent(e,"$rageclick");var n=t===Yl;if(i&&Ro(i,e,this._config,n,n?["copy","cut"]:void 0)){var{props:s,explicitNoCapture:o}=Ch(i,{e:e,maskAllElementAttributes:this.instance.config.mask_all_element_attributes,maskAllText:this.instance.config.mask_all_text,elementAttributeIgnoreList:this._config.element_attribute_ignorelist,elementsChainAsString:this._elementsChainAsString});if(o)return!1;var a=this.getElementSelectors(i);if(a&&a.length>0&&(s.$element_selectors=a),t===Yl){var l,u=mo(null==zn||null==(l=zn.getSelection())?void 0:l.toString()),c=e.type||"clipboard";if(!u)return!1;s.$selected_content=u,s.$copy_type=c}return this.instance.capture(t,s),!0}}}isBrowserSupported(){return Xr(null==Kn?void 0:Kn.querySelectorAll)}}var kh={};function Eh(e){return function(e,t){var r=kh[e];if(r)return r;var i=t[e];if(Kr(i)&&!ns())return kh[e]=i.bind(t);var n=t.document;if(n&&Xr(n.createElement))try{var s=n.createElement("iframe");s.hidden=!0,n.head.appendChild(s);var o=s.contentWindow;o&&o[e]&&(i=o[e]),n.head.removeChild(s)}catch(t){ls.warn("Could not create sandbox iframe for "+e+" check, bailing to assignableWindow."+e+": ",t)}return i&&Xr(i)?kh[e]=i.bind(t):i}("MutationObserver",e)}function xh(e,t){return si(e)&&e>=t}class Th{_asRequiredConfig(e){var t,r,i,n,s,o=this._defaultConfig((null==e?void 0:e.__onCapture)||this._captureDeadClick.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,__onCapture:o.__onCapture}}constructor(e,t){this._clicks=[],this._defaultConfig=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._onClick=e=>{var t=function(e){var t=bo(e);return t?{node:t,originalEvent:e,timestamp:Date.now()}:null}(e);ii(t)||this._ignoreClick(t)||this._clicks.push(t),this._clicks.length&&ei(this._checkClickTimer)&&(this._checkClickTimer=is.setTimeout((()=>{this._checkClicks()}),1e3))},this._onScroll=()=>{var e=Date.now();e%50==0&&this._clicks.forEach((t=>{ei(t.scrollDelayMs)&&(t.scrollDelayMs=e-t.timestamp)}))},this._onSelectionChange=()=>{this._lastSelectionChanged=Date.now()},this.instance=e,this._config=this._asRequiredConfig(t),this._onCapture=this._config.__onCapture}start(e){this._startClickObserver(),this._startScrollObserver(),this._startSelectionChangedObserver(),this._startMutationObserver(e)}_startMutationObserver(e){if(!this._mutationObserver){var t=Eh(is);this._mutationObserver=new t((e=>{this._onMutation(e)})),this._mutationObserver.observe(e,{attributes:!0,characterData:!0,childList:!0,subtree:!0})}}stop(){var e;null==(e=this._mutationObserver)||e.disconnect(),this._mutationObserver=void 0,is.removeEventListener("click",this._onClick),is.removeEventListener("scroll",this._onScroll,{capture:!0}),is.removeEventListener("selectionchange",this._onSelectionChange)}_onMutation(e){this._lastMutation=Date.now()}_startClickObserver(){Cs(is,"click",this._onClick)}_startScrollObserver(){Cs(is,"scroll",this._onScroll,{capture:!0})}_startSelectionChangedObserver(){Cs(is,"selectionchange",this._onSelectionChange)}_ignoreClick(e){if(!e)return!0;if(!this._config.capture_clicks_with_modifier_keys&&((t=e.originalEvent).ctrlKey||t.metaKey||t.altKey||t.shiftKey))return!0;var t;if(uo(e.node))return!0;var r=this._clicks.some((t=>t.node===e.node&&Math.abs(t.timestamp-e.timestamp)<1e3));return!!r||!(!ho(e.node,"html")&&co(e.node)&&!So.includes(e.node.tagName.toLowerCase()))}_checkClicks(){if(this._clicks.length){clearTimeout(this._checkClickTimer),this._checkClickTimer=void 0;var e=this._clicks;for(var t of(this._clicks=[],e)){var r;t.mutationDelayMs=null!==(r=t.mutationDelayMs)&&void 0!==r?r:this._lastMutation&&t.timestamp<=this._lastMutation?this._lastMutation-t.timestamp:void 0,t.absoluteDelayMs=Date.now()-t.timestamp,t.selectionChangedDelayMs=this._lastSelectionChanged&&t.timestamp<=this._lastSelectionChanged?this._lastSelectionChanged-t.timestamp:void 0;var i=xh(t.scrollDelayMs,this._config.scroll_threshold_ms),n=xh(t.selectionChangedDelayMs,this._config.selection_change_threshold_ms),s=xh(t.mutationDelayMs,this._config.mutation_threshold_ms),o=xh(t.absoluteDelayMs,1.1*this._config.mutation_threshold_ms),a=si(t.scrollDelayMs)&&t.scrollDelayMs<this._config.scroll_threshold_ms,l=si(t.mutationDelayMs)&&t.mutationDelayMs<this._config.mutation_threshold_ms,u=si(t.selectionChangedDelayMs)&&t.selectionChangedDelayMs<this._config.selection_change_threshold_ms;a||l||u||(i||s||o||n?this._onCapture(t,{$dead_click_last_mutation_timestamp:this._lastMutation,$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}):t.absoluteDelayMs<this._config.mutation_threshold_ms&&this._clicks.push(t))}this._clicks.length&&ei(this._checkClickTimer)&&(this._checkClickTimer=is.setTimeout((()=>{this._checkClicks()}),1e3))}}_captureDeadClick(e,t){this.instance.capture("$dead_click",r({},t,Ch(e.node,{e:e.originalEvent,maskAllElementAttributes:this.instance.config.mask_all_element_attributes,maskAllText:this.instance.config.mask_all_text,elementAttributeIgnoreList:this._config.element_attribute_ignorelist,elementsChainAsString:!1}).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}),{timestamp:new Date(e.timestamp)})}}is.__PosthogExtensions__=is.__PosthogExtensions__||{},is.__PosthogExtensions__.initDeadClicksAutocapture=(e,t)=>new Th(e,t);var Mh="";var Rh=/[a-z0-9][a-z0-9-]+\.[a-z]{2,}$/i;function Ph(e,t){if(t){var r=function(e,t){if(void 0===t&&(t=Kn),Mh)return Mh;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_"+Zl();!Mh&&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",Mh=s)}return Mh}(e);if(!r){var i=(e=>{var t=e.match(Rh);return t?t[0]:""})(e);i!==r&&ls.info("Warning: cookie subdomain discovery mismatch",i,r),r=i}return r?"; domain=."+r:""}return""}var Ah={_is_supported:()=>!!Kn,_error:function(e){ls.error("cookieStore error: "+e)},_get:function(e){if(Kn){try{for(var t=e+"=",r=Kn.cookie.split(";").filter((e=>e.length)),i=0;i<r.length;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}},_parse:function(e){var t;try{t=JSON.parse(Ah._get(e))||{}}catch(e){}return t},_set:function(e,t,r,i,n){if(Kn)try{var s="",o="",a=Ph(Kn.location.hostname,i);if(r){var l=new Date;l.setTime(l.getTime()+24*r*60*60*1e3),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&&ls.warn("cookieStore warning: large cookie, len="+u.length),Kn.cookie=u,u}catch(e){return}},_remove:function(e,t){if(null!=Kn&&Kn.cookie)try{Ah._set(e,"",-1,t)}catch(e){return}}},Nh=null,Fh={_is_supported:function(){if(!ii(Nh))return Nh;var e=!0;if(ei(zn))e=!1;else try{var t="__mplssupport__";Fh._set(t,"xyz"),'"xyz"'!==Fh._get(t)&&(e=!1),Fh._remove(t)}catch(t){e=!1}return e||ls.error("localStorage unsupported; falling back to cookie store"),Nh=e,e},_error:function(e){ls.error("localStorage error: "+e)},_get:function(e){try{return null==zn?void 0:zn.localStorage.getItem(e)}catch(e){Fh._error(e)}return null},_parse:function(e){try{return JSON.parse(Fh._get(e))||{}}catch(e){}return null},_set:function(e,t){try{null==zn||zn.localStorage.setItem(e,JSON.stringify(t))}catch(e){Fh._error(e)}},_remove:function(e){try{null==zn||zn.localStorage.removeItem(e)}catch(e){Fh._error(e)}}},Lh=["$device_id","distinct_id",Ws,zs,so,no],Oh=r({},Fh,{_parse:function(e){try{var t={};try{t=Ah._parse(e)||{}}catch(e){}var r=ps(t,JSON.parse(Fh._get(e)||"{}"));return Fh._set(e,r),r}catch(e){}return null},_set:function(e,t,r,i,n,s){try{Fh._set(e,t,void 0,void 0,s);var o={};Lh.forEach((e=>{t[e]&&(o[e]=t[e])})),Object.keys(o).length&&Ah._set(e,o,r,i,n,s)}catch(e){Fh._error(e)}},_remove:function(e,t){try{null==zn||zn.localStorage.removeItem(e),Ah._remove(e,t)}catch(e){Fh._error(e)}}}),Dh={},Hh={_is_supported:function(){return!0},_error:function(e){ls.error("memoryStorage error: "+e)},_get:function(e){return Dh[e]||null},_parse:function(e){return Dh[e]||null},_set:function(e,t){Dh[e]=t},_remove:function(e){delete Dh[e]}},qh=null,Bh={_is_supported:function(){if(!ii(qh))return qh;if(qh=!0,ei(zn))qh=!1;else try{var e="__support__";Bh._set(e,"xyz"),'"xyz"'!==Bh._get(e)&&(qh=!1),Bh._remove(e)}catch(e){qh=!1}return qh},_error:function(e){ls.error("sessionStorage error: ",e)},_get:function(e){try{return null==zn?void 0:zn.sessionStorage.getItem(e)}catch(e){Bh._error(e)}return null},_parse:function(e){try{return JSON.parse(Bh._get(e))||null}catch(e){}return null},_set:function(e,t){try{null==zn||zn.sessionStorage.setItem(e,JSON.stringify(t))}catch(e){Bh._error(e)}},_remove:function(e){try{null==zn||zn.sessionStorage.removeItem(e)}catch(e){Bh._error(e)}}},Vh=function(e){return e[e.PENDING=-1]="PENDING",e[e.DENIED=0]="DENIED",e[e.GRANTED=1]="GRANTED",e}({});class $h{constructor(e){this._instance=e}get _config(){return this._instance.config}get consent(){return this._getDnt()?Vh.DENIED:this._storedConsent}isOptedOut(){return"always"===this._config.cookieless_mode||(this.consent===Vh.DENIED||this.consent===Vh.PENDING&&(this._config.opt_out_capturing_by_default||"on_reject"===this._config.cookieless_mode))}isOptedIn(){return!this.isOptedOut()}isExplicitlyOptedOut(){return this.consent===Vh.DENIED}optInOut(e){this._storage._set(this._storageKey,e?1:0,this._config.cookie_expiration,this._config.cross_subdomain_cookie,this._config.secure_cookie)}reset(){this._storage._remove(this._storageKey,this._config.cross_subdomain_cookie)}get _storageKey(){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 _storedConsent(){var e=this._storage._get(this._storageKey);return pi(e)?Vh.GRANTED:$r(vi,e)?Vh.DENIED:Vh.PENDING}get _storage(){if(!this._persistentStore){var e=this._config.opt_out_capturing_persistence_type;this._persistentStore="localStorage"===e?Fh:Ah;var t="localStorage"===e?Ah:Fh;t._get(this._storageKey)&&(this._persistentStore._get(this._storageKey)||this.optInOut(pi(t._get(this._storageKey))),t._remove(this._storageKey,this._config.cross_subdomain_cookie))}return this._persistentStore}_getDnt(){return!!this._config.respect_dnt&&!!ws([null==Xn?void 0:Xn.doNotTrack,null==Xn?void 0:Xn.msDoNotTrack,is.doNotTrack],(e=>pi(e)))}}var Uh=us("[Dead Clicks]"),Wh=()=>!0,zh=e=>{var t,r=!(null==(t=e.instance.persistence)||!t.get_property(Bs)),i=e.instance.config.capture_dead_clicks;return oi(i)?i:!!Jr(i)||r};class jh{get lazyLoadedDeadClicksAutocapture(){return this._lazyLoadedDeadClicksAutocapture}constructor(e,t,r){this.instance=e,this.isEnabled=t,this.onCapture=r,this.startIfEnabled()}onRemoteConfig(e){this.instance.persistence&&this.instance.persistence.register({[Bs]:null==e?void 0:e.captureDeadClicks}),this.startIfEnabled()}startIfEnabled(){this.isEnabled(this)&&this._loadScript((()=>{this._start()}))}_loadScript(e){var t,r;null!=(t=is.__PosthogExtensions__)&&t.initDeadClicksAutocapture&&e(),null==(r=is.__PosthogExtensions__)||null==r.loadExternalDependency||r.loadExternalDependency(this.instance,"dead-clicks-autocapture",(t=>{t?Uh.error("failed to load script",t):e()}))}_start(){var e;if(Kn){if(!this._lazyLoadedDeadClicksAutocapture&&null!=(e=is.__PosthogExtensions__)&&e.initDeadClicksAutocapture){var t=Jr(this.instance.config.capture_dead_clicks)?this.instance.config.capture_dead_clicks:{};t.__onCapture=this.onCapture,this._lazyLoadedDeadClicksAutocapture=is.__PosthogExtensions__.initDeadClicksAutocapture(this.instance,t),this._lazyLoadedDeadClicksAutocapture.start(Kn),Uh.info("starting...")}}else Uh.error("`document` not found. Cannot start.")}stop(){this._lazyLoadedDeadClicksAutocapture&&(this._lazyLoadedDeadClicksAutocapture.stop(),this._lazyLoadedDeadClicksAutocapture=void 0,Uh.info("stopping..."))}}var Zh=us("[ExceptionAutocapture]");class Gh{constructor(e){var t,r,i;this._startCapturing=()=>{var e;if(zn&&this.isEnabled&&null!=(e=is.__PosthogExtensions__)&&e.errorWrappingFunctions){var t=is.__PosthogExtensions__.errorWrappingFunctions.wrapOnError,r=is.__PosthogExtensions__.errorWrappingFunctions.wrapUnhandledRejection,i=is.__PosthogExtensions__.errorWrappingFunctions.wrapConsoleError;try{!this._unwrapOnError&&this._config.capture_unhandled_errors&&(this._unwrapOnError=t(this.captureException.bind(this))),!this._unwrapUnhandledRejection&&this._config.capture_unhandled_rejections&&(this._unwrapUnhandledRejection=r(this.captureException.bind(this))),!this._unwrapConsoleError&&this._config.capture_console_errors&&(this._unwrapConsoleError=i(this.captureException.bind(this)))}catch(e){Zh.error("failed to start",e),this._stopCapturing()}}},this._instance=e,this._remoteEnabled=!(null==(t=this._instance.persistence)||!t.props[Os]),this._rateLimiter=new _i({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,_logger:Zh}),this._config=this._requiredConfig(),this.startIfEnabledOrStop()}_requiredConfig(){var e=this._instance.config.capture_exceptions,t={capture_unhandled_errors:!1,capture_unhandled_rejections:!1,capture_console_errors:!1};return Jr(e)?t=r({},t,e):(ei(e)?this._remoteEnabled:e)&&(t=r({},t,{capture_unhandled_errors:!0,capture_unhandled_rejections:!0})),t}get isEnabled(){return this._config.capture_console_errors||this._config.capture_unhandled_errors||this._config.capture_unhandled_rejections}startIfEnabledOrStop(){this.isEnabled?(Zh.info("enabled"),this._stopCapturing(),this._loadScript(this._startCapturing)):this._stopCapturing()}_loadScript(e){var t,r;null!=(t=is.__PosthogExtensions__)&&t.errorWrappingFunctions&&e(),null==(r=is.__PosthogExtensions__)||null==r.loadExternalDependency||r.loadExternalDependency(this._instance,"exception-autocapture",(t=>{if(t)return Zh.error("failed to load script",t);e()}))}_stopCapturing(){var e,t,r;null==(e=this._unwrapOnError)||e.call(this),this._unwrapOnError=void 0,null==(t=this._unwrapUnhandledRejection)||t.call(this),this._unwrapUnhandledRejection=void 0,null==(r=this._unwrapConsoleError)||r.call(this),this._unwrapConsoleError=void 0}onRemoteConfig(e){var t=e.autocaptureExceptions;this._remoteEnabled=!!t||!1,this._instance.persistence&&this._instance.persistence.register({[Os]:this._remoteEnabled}),this._config=this._requiredConfig(),this.startIfEnabledOrStop()}onConfigChange(){this._config=this._requiredConfig()}captureException(e){var t,r,i=null!==(t=null==e||null==(r=e.$exception_list)||null==(r=r[0])?void 0:r.type)&&void 0!==t?t:"Exception";this._rateLimiter.consumeRateLimit(i)?Zh.info("Skipping exception capture because of client rate limiting.",{exception:i}):this._instance.exceptions.sendExceptionEvent(e)}}class Yh{constructor(e){var t;this._instance=e,this._lastPathname=(null==zn||null==(t=zn.location)?void 0:t.pathname)||""}get isEnabled(){return"history_change"===this._instance.config.capture_pageview}startIfEnabled(){this.isEnabled&&(ls.info("History API monitoring enabled, starting..."),this.monitorHistoryChanges())}stop(){this._popstateListener&&this._popstateListener(),this._popstateListener=void 0,ls.info("History API monitoring stopped")}monitorHistoryChanges(){var e,t;if(zn&&zn.history){var r=this;null!=(e=zn.history.pushState)&&e.__posthog_wrapped__||Ms(zn.history,"pushState",(e=>function(t,i,n){e.call(this,t,i,n),r._capturePageview("pushState")})),null!=(t=zn.history.replaceState)&&t.__posthog_wrapped__||Ms(zn.history,"replaceState",(e=>function(t,i,n){e.call(this,t,i,n),r._capturePageview("replaceState")})),this._setupPopstateListener()}}_capturePageview(e){try{var t,r=null==zn||null==(t=zn.location)?void 0:t.pathname;if(!r)return;r!==this._lastPathname&&this.isEnabled&&this._instance.capture("$pageview",{navigation_type:e}),this._lastPathname=r}catch(t){ls.error("Error capturing "+e+" pageview",t)}}_setupPopstateListener(){if(!this._popstateListener){var e=()=>{this._capturePageview("popstate")};Cs(zn,"popstate",e),this._popstateListener=()=>{zn&&zn.removeEventListener("popstate",e)}}}}var Xh=us("[SegmentIntegration]");function Kh(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()||Zl();e.config.get_device_id=i,r.id()&&(e.register({distinct_id:r.id(),$device_id:i()}),e.persistence.set_property(Qs,"identified")),t()},n=r.user();"then"in n&&Xr(n.then)?n.then((e=>i(e))):i(n)}(e,(()=>{r.register((e=>{Promise&&Promise.resolve||Xh.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()||(Xh.info("No userId set, resetting PostHog"),e.reset()),t.event.userId&&t.event.userId!==e.get_distinct_id()&&(Xh.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,"$pageview"),identify:e=>t(e,"$identify"),screen:e=>t(e,"$screen")}})(e)).then((()=>{t()}))}))}var Jh="posthog-js";function Qh(e,t){var{organization:i,projectId:n,prefix:s,severityAllowList:o=["error"],sendExceptionsToPostHog:a=!0}=void 0===t?{}:t;return t=>{var l,u,c,d,h;if(!("*"===o||o.includes(t.level))||!e.__loaded)return t;t.tags||(t.tags={});var p=e.requestRouter.endpointFor("ui","/project/"+e.config.token+"/person/"+e.get_distinct_id());t.tags["PostHog Person URL"]=p,e.sessionRecordingStarted()&&(t.tags["PostHog Recording URL"]=e.get_session_replay_url({withTimestamp:!0}));var v=(null==(l=t.exception)?void 0:l.values)||[],g=v.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}))),_={$exception_message:(null==(u=v[0])?void 0:u.value)||t.message,$exception_type:null==(c=v[0])?void 0:c.type,$exception_level:t.level,$exception_list:g,$sentry_event_id:t.event_id,$sentry_exception:t.exception,$sentry_exception_message:(null==(d=v[0])?void 0:d.value)||t.message,$sentry_exception_type:null==(h=v[0])?void 0:h.type,$sentry_tags:t.tags};return i&&n&&(_.$sentry_url=(s||"https://sentry.io/organizations/")+i+"/issues/?project="+n+"&query="+t.event_id),a&&e.exceptions.sendExceptionEvent(_),t}}class ep{constructor(e,t,r,i,n,s){this.name=Jh,this.setupOnce=function(o){o(Qh(e,{organization:t,projectId:r,prefix:i,severityAllowList:n,sendExceptionsToPostHog:null==s||s}))}}}var tp=null!=zn&&zn.location?Ts(zn.location.hash,"__posthog")||Ts(location.hash,"state"):null,rp="_postHogToolbarParams",ip=us("[Toolbar]"),np=function(e){return e[e.UNINITIALIZED=0]="UNINITIALIZED",e[e.LOADING=1]="LOADING",e[e.LOADED=2]="LOADED",e}(np||{});class sp{constructor(e){this.instance=e}_setToolbarState(e){is.ph_toolbar_state=e}_getToolbarState(){var e;return null!==(e=is.ph_toolbar_state)&&void 0!==e?e:np.UNINITIALIZED}maybeLoadToolbar(e,t,r){if(void 0===e&&(e=void 0),void 0===t&&(t=void 0),void 0===r&&(r=void 0),!zn||!Kn)return!1;e=null!=e?e:zn.location,r=null!=r?r:zn.history;try{if(!t){try{zn.localStorage.setItem("test","test"),zn.localStorage.removeItem("test")}catch(e){return!1}t=null==zn?void 0:zn.localStorage}var i,n=tp||Ts(e.hash,"__posthog")||Ts(e.hash,"state"),s=n?_s((()=>JSON.parse(atob(decodeURIComponent(n)))))||_s((()=>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(rp)||"{}")).source="localstorage",delete i.userIntent),!(!i.token||this.instance.config.token!==i.token)&&(this.loadToolbar(i),!0)}catch(e){return!1}}_callLoadToolbar(e){var t=is.ph_load_toolbar||is.ph_load_editor;!ni(t)&&Xr(t)?t(e,this.instance):ip.warn("No toolbar load function found")}loadToolbar(e){var t=!(null==Kn||!Kn.getElementById(oo));if(!zn||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(zn.localStorage.setItem(rp,JSON.stringify(r({},n,{source:void 0}))),this._getToolbarState()===np.LOADED)this._callLoadToolbar(n);else if(this._getToolbarState()===np.UNINITIALIZED){var s;this._setToolbarState(np.LOADING),null==(s=is.__PosthogExtensions__)||null==s.loadExternalDependency||s.loadExternalDependency(this.instance,"toolbar",(e=>{if(e)return ip.error("[Toolbar] Failed to load",e),void this._setToolbarState(np.UNINITIALIZED);this._setToolbarState(np.LOADED),this._callLoadToolbar(n)})),Cs(zn,"turbolinks:load",(()=>{this._setToolbarState(np.UNINITIALIZED),this.loadToolbar(n)}))}return!0}_loadEditor(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)}}var op=us("[TracingHeaders]");class ap{constructor(e){this._restoreXHRPatch=void 0,this._restoreFetchPatch=void 0,this._startCapturing=()=>{var e,t;ei(this._restoreXHRPatch)&&(null==(e=is.__PosthogExtensions__)||null==(e=e.tracingHeadersPatchFns)||e._patchXHR(this._instance.config.__add_tracing_headers||[],this._instance.get_distinct_id(),this._instance.sessionManager));ei(this._restoreFetchPatch)&&(null==(t=is.__PosthogExtensions__)||null==(t=t.tracingHeadersPatchFns)||t._patchFetch(this._instance.config.__add_tracing_headers||[],this._instance.get_distinct_id(),this._instance.sessionManager))},this._instance=e}_loadScript(e){var t,r;null!=(t=is.__PosthogExtensions__)&&t.tracingHeadersPatchFns&&e(),null==(r=is.__PosthogExtensions__)||null==r.loadExternalDependency||r.loadExternalDependency(this._instance,"tracing-headers",(t=>{if(t)return op.error("failed to load script",t);e()}))}startIfEnabledOrStop(){var e,t;this._instance.config.__add_tracing_headers?this._loadScript(this._startCapturing):(null==(e=this._restoreXHRPatch)||e.call(this),null==(t=this._restoreFetchPatch)||t.call(this),this._restoreXHRPatch=void 0,this._restoreFetchPatch=void 0)}}var lp="https?://(.*)",up=["gclid","gclsrc","dclid","gbraid","wbraid","fbclid","msclkid","twclid","li_fat_id","igshid","ttclid","rdt_cid","epik","qclid","sccid","irclid","_kx"],cp=vs(["utm_source","utm_medium","utm_campaign","utm_content","utm_term","gad_source","mc_cid"],up),dp="<masked>",hp=["li_fat_id"];function pp(e,t,r){if(!Kn)return{};var i,n=t?vs([],up,r||[]):[],s=vp(xs(Kn.URL,n,dp),e),o=(i={},hs(hp,(function(e){var t=Ah._get(e);i[e]=t||null})),i);return ps(o,s)}function vp(e,t){var r=cp.concat(t||[]),i={};return hs(r,(function(t){var r=Es(e,t);i[t]=r||null})),i}function gp(e){var t=function(e){return e?0===e.search(lp+"google.([^/?]*)")?"google":0===e.search(lp+"bing.com")?"bing":0===e.search(lp+"yahoo.com")?"yahoo":0===e.search(lp+"duckduckgo.com")?"duckduckgo":null:null}(e),r="yahoo"!=t?"q":"p",i={};if(!ii(t)){i.$search_engine=t;var n=Kn?Es(Kn.referrer,r):"";n.length&&(i.ph_keyword=n)}return i}function _p(){return navigator.language||navigator.userLanguage}function fp(){return(null==Kn?void 0:Kn.referrer)||"$direct"}function mp(e,t){var r=e?vs([],up,t||[]):[],i=null==Jn?void 0:Jn.href.substring(0,1e3);return{r:fp().substring(0,1e3),u:i?xs(i,r,dp):void 0}}function yp(e){var t,{r:r,u:i}=e,n={$referrer:r,$referring_domain:null==r?void 0:"$direct"==r?"$direct":null==(t=Is(r))?void 0:t.host};if(i){n.$current_url=i;var s=Is(i);n.$host=null==s?void 0:s.host,n.$pathname=null==s?void 0:s.pathname;var o=vp(i);ps(n,o)}if(r){var a=gp(r);ps(n,a)}return n}function bp(){try{return Intl.DateTimeFormat().resolvedOptions().timeZone}catch(e){return}}function Sp(){try{return(new Date).getTimezoneOffset()}catch(e){return}}function wp(e,t){if(!rs)return{};var r,i=e?vs([],up,t||[]):[],[n,s]=function(e){for(var t=0;t<gn.length;t++){var[r,i]=gn[t],n=r.exec(e),s=n&&(Xr(i)?i(n,e):i);if(s)return s}return["",""]}(rs);return ps(ms({$os:n,$os_version:s,$browser:hn(rs,navigator.vendor),$device:_n(rs),$device_type:fn(rs),$timezone:bp(),$timezone_offset:Sp()}),{$current_url:xs(null==Jn?void 0:Jn.href,i,dp),$host:null==Jn?void 0:Jn.host,$pathname:null==Jn?void 0:Jn.pathname,$raw_user_agent:rs.length>1e3?rs.substring(0,997)+"...":rs,$browser_version:vn(rs,navigator.vendor),$browser_language:_p(),$browser_language_prefix:(r=_p(),"string"==typeof r?r.split("-")[0]:void 0),$screen_height:null==zn?void 0:zn.screen.height,$screen_width:null==zn?void 0:zn.screen.width,$viewport_height:null==zn?void 0:zn.innerHeight,$viewport_width:null==zn?void 0:zn.innerWidth,$lib:"web",$lib_version:os.LIB_VERSION,$insert_id:Math.random().toString(36).substring(2,10)+Math.random().toString(36).substring(2,10),$time:Date.now()/1e3})}var Cp=us("[Web Vitals]"),Ip=9e5;class kp{constructor(e){var t;this._enabledServerSide=!1,this._initialized=!1,this._buffer={url:void 0,metrics:[],firstMetricTimestamp:void 0},this._flushToCapture=()=>{clearTimeout(this._delayedFlushTimer),0!==this._buffer.metrics.length&&(this._instance.capture("$web_vitals",this._buffer.metrics.reduce(((e,t)=>r({},e,{["$web_vitals_"+t.name+"_event"]:r({},t),["$web_vitals_"+t.name+"_value"]:t.value})),{})),this._buffer={url:void 0,metrics:[],firstMetricTimestamp:void 0})},this._addToBuffer=e=>{var t,i=null==(t=this._instance.sessionManager)?void 0:t.checkAndGetSessionAndWindowId(!0);if(ei(i))Cp.error("Could not read session ID. Dropping metrics!");else{this._buffer=this._buffer||{url:void 0,metrics:[],firstMetricTimestamp:void 0};var n=this._currentURL();if(!ei(n))if(ni(null==e?void 0:e.name)||ni(null==e?void 0:e.value))Cp.error("Invalid metric received",e);else if(this._maxAllowedValue&&e.value>=this._maxAllowedValue)Cp.error("Ignoring metric with value >= "+this._maxAllowedValue,e);else this._buffer.url!==n&&(this._flushToCapture(),this._delayedFlushTimer=setTimeout(this._flushToCapture,this.flushToCaptureTimeoutMs)),ei(this._buffer.url)&&(this._buffer.url=n),this._buffer.firstMetricTimestamp=ei(this._buffer.firstMetricTimestamp)?Date.now():this._buffer.firstMetricTimestamp,e.attribution&&e.attribution.interactionTargetElement&&(e.attribution.interactionTargetElement=void 0),this._buffer.metrics.push(r({},e,{$current_url:n,$session_id:i.sessionId,$window_id:i.windowId,timestamp:Date.now()})),this._buffer.metrics.length===this.allowedMetrics.length&&this._flushToCapture()}},this._startCapturing=()=>{var e,t,r,i,n=is.__PosthogExtensions__;ei(n)||ei(n.postHogWebVitalsCallbacks)||({onLCP:e,onCLS:t,onFCP:r,onINP:i}=n.postHogWebVitalsCallbacks),e&&t&&r&&i?(this.allowedMetrics.indexOf("LCP")>-1&&e(this._addToBuffer.bind(this)),this.allowedMetrics.indexOf("CLS")>-1&&t(this._addToBuffer.bind(this)),this.allowedMetrics.indexOf("FCP")>-1&&r(this._addToBuffer.bind(this)),this.allowedMetrics.indexOf("INP")>-1&&i(this._addToBuffer.bind(this)),this._initialized=!0):Cp.error("web vitals callbacks not loaded - not starting")},this._instance=e,this._enabledServerSide=!(null==(t=this._instance.persistence)||!t.props[qs]),this.startIfEnabled()}get allowedMetrics(){var e,t,r=Jr(this._instance.config.capture_performance)?null==(e=this._instance.config.capture_performance)?void 0:e.web_vitals_allowed_metrics:void 0;return ei(r)?(null==(t=this._instance.persistence)?void 0:t.props[$s])||["CLS","FCP","INP","LCP"]:r}get flushToCaptureTimeoutMs(){return(Jr(this._instance.config.capture_performance)?this._instance.config.capture_performance.web_vitals_delayed_flush_ms:void 0)||5e3}get _maxAllowedValue(){var e=Jr(this._instance.config.capture_performance)&&si(this._instance.config.capture_performance.__web_vitals_max_value)?this._instance.config.capture_performance.__web_vitals_max_value:Ip;return 0<e&&e<=6e4?Ip:e}get isEnabled(){var e=null==Jn?void 0:Jn.protocol;if("http:"!==e&&"https:"!==e)return Cp.info("Web Vitals are disabled on non-http/https protocols"),!1;var t=Jr(this._instance.config.capture_performance)?this._instance.config.capture_performance.web_vitals:oi(this._instance.config.capture_performance)?this._instance.config.capture_performance:void 0;return oi(t)?t:this._enabledServerSide}startIfEnabled(){this.isEnabled&&!this._initialized&&(Cp.info("enabled, starting..."),this._loadScript(this._startCapturing))}onRemoteConfig(e){var t=Jr(e.capturePerformance)&&!!e.capturePerformance.web_vitals,r=Jr(e.capturePerformance)?e.capturePerformance.web_vitals_allowed_metrics:void 0;this._instance.persistence&&(this._instance.persistence.register({[qs]:t}),this._instance.persistence.register({[$s]:r})),this._enabledServerSide=t,this.startIfEnabled()}_loadScript(e){var t,r;null!=(t=is.__PosthogExtensions__)&&t.postHogWebVitalsCallbacks&&e(),null==(r=is.__PosthogExtensions__)||null==r.loadExternalDependency||r.loadExternalDependency(this._instance,"web-vitals",(t=>{t?Cp.error("failed to load script",t):e()}))}_currentURL(){var e=zn?zn.location.href:void 0;if(e){var t=this._instance.config.mask_personal_data_properties,r=this._instance.config.custom_personal_data_properties,i=t?vs([],up,r||[]):[];return xs(e,i,dp)}Cp.error("Could not determine current URL")}}var Ep=us("[Heatmaps]");function xp(e){return Jr(e)&&"clientX"in e&&"clientY"in e&&si(e.clientX)&&si(e.clientY)}class Tp{constructor(e){var t;this._enabledServerSide=!1,this._initialized=!1,this._flushInterval=null,this.instance=e,this._enabledServerSide=!(null==(t=this.instance.persistence)||!t.props[Ls]),this.rageclicks=new mh(e.config.rageclick)}get flushIntervalMilliseconds(){var e=5e3;return Jr(this.instance.config.capture_heatmaps)&&this.instance.config.capture_heatmaps.flush_interval_milliseconds&&(e=this.instance.config.capture_heatmaps.flush_interval_milliseconds),e}get isEnabled(){return ei(this.instance.config.capture_heatmaps)?ei(this.instance.config.enable_heatmaps)?this._enabledServerSide:this.instance.config.enable_heatmaps:!1!==this.instance.config.capture_heatmaps}startIfEnabled(){if(this.isEnabled){if(this._initialized)return;Ep.info("starting..."),this._setupListeners(),this._onVisibilityChange()}else{var e;clearInterval(null!==(e=this._flushInterval)&&void 0!==e?e:void 0),this._removeListeners(),this.getAndClearBuffer()}}onRemoteConfig(e){var t=!!e.heatmaps;this.instance.persistence&&this.instance.persistence.register({[Ls]:t}),this._enabledServerSide=t,this.startIfEnabled()}getAndClearBuffer(){var e=this._buffer;return this._buffer=void 0,e}_onDeadClick(e){this._onClick(e.originalEvent,"deadclick")}_onVisibilityChange(){this._flushInterval&&clearInterval(this._flushInterval),this._flushInterval=function(e){return"visible"===(null==e?void 0:e.visibilityState)}(Kn)?setInterval(this._flush.bind(this),this.flushIntervalMilliseconds):null}_setupListeners(){zn&&Kn&&(this._flushHandler=this._flush.bind(this),Cs(zn,"beforeunload",this._flushHandler),this._onClickHandler=e=>this._onClick(e||(null==zn?void 0:zn.event)),Cs(Kn,"click",this._onClickHandler,{capture:!0}),this._onMouseMoveHandler=e=>this._onMouseMove(e||(null==zn?void 0:zn.event)),Cs(Kn,"mousemove",this._onMouseMoveHandler,{capture:!0}),this._deadClicksCapture=new jh(this.instance,Wh,this._onDeadClick.bind(this)),this._deadClicksCapture.startIfEnabled(),this._onVisibilityChange_handler=this._onVisibilityChange.bind(this),Cs(Kn,"visibilitychange",this._onVisibilityChange_handler),this._initialized=!0)}_removeListeners(){var e;zn&&Kn&&(this._flushHandler&&zn.removeEventListener("beforeunload",this._flushHandler),this._onClickHandler&&Kn.removeEventListener("click",this._onClickHandler,{capture:!0}),this._onMouseMoveHandler&&Kn.removeEventListener("mousemove",this._onMouseMoveHandler,{capture:!0}),this._onVisibilityChange_handler&&Kn.removeEventListener("visibilitychange",this._onVisibilityChange_handler),clearTimeout(this._mouseMoveTimeout),null==(e=this._deadClicksCapture)||e.stop(),this._initialized=!1)}_getProperties(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&&co(i)&&!ho(i,"body");){if(i===r)return!1;if($r(t,null==zn?void 0:zn.getComputedStyle(i).position))return!0;i=Co(i)}return!1}(bo(e),["fixed","sticky"],n);return{x:e.clientX+(s?0:i),y:e.clientY+(s?0:r),target_fixed:s,type:t}}_onClick(e,t){var i;if(void 0===t&&(t="click"),!uo(e.target)&&xp(e)){var n=this._getProperties(e,t);null!=(i=this.rageclicks)&&i.isRageClick(e.clientX,e.clientY,(new Date).getTime())&&this._capture(r({},n,{type:"rageclick"})),this._capture(n)}}_onMouseMove(e){!uo(e.target)&&xp(e)&&(clearTimeout(this._mouseMoveTimeout),this._mouseMoveTimeout=setTimeout((()=>{this._capture(this._getProperties(e,"mousemove"))}),500))}_capture(e){if(zn){var t=zn.location.href,r=this.instance.config.mask_personal_data_properties,i=this.instance.config.custom_personal_data_properties,n=r?vs([],up,i||[]):[],s=xs(t,n,dp);this._buffer=this._buffer||{},this._buffer[s]||(this._buffer[s]=[]),this._buffer[s].push(e)}}_flush(){this._buffer&&!Qr(this._buffer)&&this.instance.capture("$$heatmap",{$heatmap_data:this.getAndClearBuffer()})}}class Mp{constructor(e){this._instance=e}doPageView(e,t){var r,i=this._previousPageViewProperties(e,t);return this._currentPageview={pathname:null!==(r=null==zn?void 0:zn.location.pathname)&&void 0!==r?r:"",pageViewId:t,timestamp:e},this._instance.scrollManager.resetContext(),i}doPageLeave(e){var t;return this._previousPageViewProperties(e,null==(t=this._currentPageview)?void 0:t.pageViewId)}doEvent(){var e;return{$pageview_id:null==(e=this._currentPageview)?void 0:e.pageViewId}}_previousPageViewProperties(e,t){var r=this._currentPageview;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:c}=n;if(!(ei(s)||ei(o)||ei(a)||ei(l)||ei(u)||ei(c))){s=Math.ceil(s),o=Math.ceil(o),a=Math.ceil(a),l=Math.ceil(l),u=Math.ceil(u),c=Math.ceil(c);var d=s<=1?1:gi(o/s,0,1,ls),h=s<=1?1:gi(a/s,0,1,ls),p=l<=1?1:gi(u/l,0,1,ls),v=l<=1?1:gi(c/l,0,1,ls);i=ps(i,{$prev_pageview_last_scroll:o,$prev_pageview_last_scroll_percentage:d,$prev_pageview_max_scroll:a,$prev_pageview_max_scroll_percentage:h,$prev_pageview_last_content:u,$prev_pageview_last_content_percentage:p,$prev_pageview_max_content:c,$prev_pageview_max_content_percentage:v})}}return r.pathname&&(i.$prev_pageview_pathname=r.pathname),r.timestamp&&(i.$prev_pageview_duration=(e.getTime()-r.timestamp.getTime())/1e3),i}}var Rp=us("[FeatureFlags]"),Pp=us("[FeatureFlags]",{debugEnabled:!0}),Ap="$active_feature_flags",Np="$override_feature_flags",Fp="$feature_flag_payloads",Lp="$override_feature_flag_payloads",Op="$feature_flag_request_id",Dp="$feature_flag_evaluated_at",Hp=e=>{var t={};for(var[r,i]of gs(e||{}))i&&(t[r]=i);return t},qp=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]})))):Rp.warn("Using an older version of the feature flags endpoint. Please upgrade your PostHog server to the latest version"),e},Bp=function(e){return e.FeatureFlags="feature_flags",e.Recordings="recordings",e}({});class Vp{constructor(e){this._override_warning=!1,this._hasLoadedFlags=!1,this._requestInFlight=!1,this._reloadingDisabled=!1,this._additionalReloadRequested=!1,this._flagsCalled=!1,this._flagsLoadedFromRemote=!1,this._instance=e,this.featureFlagEventHandlers=[]}_getValidEvaluationEnvironments(){var e=this._instance.config.evaluation_environments;return null!=e&&e.length?e.filter((e=>{var t=e&&"string"==typeof e&&e.trim().length>0;return t||Rp.error("Invalid evaluation environment found:",e,"Expected non-empty string"),t})):[]}_shouldIncludeEvaluationEnvironments(){return this._getValidEvaluationEnvironments().length>0}flags(){if(this._instance.config.__preview_remote_config)this._flagsCalled=!0;else{var e=!this._reloadDebouncer&&(this._instance.config.advanced_disable_feature_flags||this._instance.config.advanced_disable_feature_flags_on_first_load);this._callFlagsEndpoint({disableFlags:e})}}get hasLoadedFlags(){return this._hasLoadedFlags}getFlags(){return Object.keys(this.getFlagVariants())}getFlagsWithDetails(){var e=this._instance.get_property(Gs),t=this._instance.get_property(Np),i=this._instance.get_property(Lp);if(!i&&!t)return e||{};var n=ps({},e||{}),s=[...new Set([...Object.keys(i||{}),...Object.keys(t||{})])];for(var o of s){var a,l,u=n[o],c=null==t?void 0:t[o],d=ei(c)?null!==(a=null==u?void 0:u.enabled)&&void 0!==a&&a:!!c,h=ei(c)?u.variant:"string"==typeof c?c:void 0,p=null==i?void 0:i[o],v=r({},u,{enabled:d,variant:d?null!=h?h:null==u?void 0:u.variant:void 0});if(d!==(null==u?void 0:u.enabled)&&(v.original_enabled=null==u?void 0:u.enabled),h!==(null==u?void 0:u.variant)&&(v.original_variant=null==u?void 0:u.variant),p)v.metadata=r({},null==u?void 0:u.metadata,{payload:p,original_payload:null==u||null==(l=u.metadata)?void 0:l.payload});n[o]=v}return this._override_warning||(Rp.warn(" Overriding feature flag details!",{flagDetails:e,overriddenPayloads:i,finalDetails:n}),this._override_warning=!0),n}getFlagVariants(){var e=this._instance.get_property(js),t=this._instance.get_property(Np);if(!t)return e||{};for(var r=ps({},e),i=Object.keys(t),n=0;n<i.length;n++)r[i[n]]=t[i[n]];return this._override_warning||(Rp.warn(" Overriding feature flags!",{enabledFlags:e,overriddenFlags:t,finalFlags:r}),this._override_warning=!0),r}getFlagPayloads(){var e=this._instance.get_property(Fp),t=this._instance.get_property(Lp);if(!t)return e||{};for(var r=ps({},e||{}),i=Object.keys(t),n=0;n<i.length;n++)r[i[n]]=t[i[n]];return this._override_warning||(Rp.warn(" Overriding feature flag payloads!",{flagPayloads:e,overriddenPayloads:t,finalPayloads:r}),this._override_warning=!0),r}reloadFeatureFlags(){this._reloadingDisabled||this._instance.config.advanced_disable_feature_flags||this._reloadDebouncer||(this._reloadDebouncer=setTimeout((()=>{this._callFlagsEndpoint()}),5))}_clearDebouncer(){clearTimeout(this._reloadDebouncer),this._reloadDebouncer=void 0}ensureFlagsLoaded(){this._hasLoadedFlags||this._requestInFlight||this._reloadDebouncer||this.reloadFeatureFlags()}setAnonymousDistinctId(e){this.$anon_distinct_id=e}setReloadingPaused(e){this._reloadingDisabled=e}_callFlagsEndpoint(e){var t;if(this._clearDebouncer(),!this._instance._shouldDisableFlags())if(this._requestInFlight)this._additionalReloadRequested=!0;else{var i=this._instance.config.token,n=this._instance.get_property("$device_id"),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._instance.persistence)?void 0:t.get_initial_props())||{},this._instance.get_property(Ys)||{}),group_properties:this._instance.get_property(Xs)};ii(n)||ei(n)||(s.$device_id=n),(null!=e&&e.disableFlags||this._instance.config.advanced_disable_feature_flags)&&(s.disable_flags=!0),this._shouldIncludeEvaluationEnvironments()&&(s.evaluation_environments=this._getValidEvaluationEnvironments());var o=this._instance.config.__preview_remote_config,a=o?"/flags/?v=2":"/flags/?v=2&config=true",l=this._instance.config.advanced_only_evaluate_survey_feature_flags?"&only_evaluate_survey_feature_flags=true":"",u=this._instance.requestRouter.endpointFor("flags",a+l);o&&(s.timezone=bp()),this._requestInFlight=!0,this._instance._send_request({method:"POST",url:u,data:s,compression:this._instance.config.disable_compression?void 0:Xl.Base64,timeout:this._instance.config.feature_flag_request_timeout_ms,callback:e=>{var t,r,i=!0;(200===e.statusCode&&(this._additionalReloadRequested||(this.$anon_distinct_id=void 0),i=!1),this._requestInFlight=!1,this._flagsCalled)||(this._flagsCalled=!0,this._instance._onRemoteConfig(null!==(r=e.json)&&void 0!==r?r:{}));if(!s.disable_flags||this._additionalReloadRequested)if(this._flagsLoadedFromRemote=!i,e.json&&null!=(t=e.json.quotaLimited)&&t.includes(Bp.FeatureFlags))Rp.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{var n;if(!s.disable_flags)this.receivedFeatureFlags(null!==(n=e.json)&&void 0!==n?n:{},i);this._additionalReloadRequested&&(this._additionalReloadRequested=!1,this._callFlagsEndpoint())}}})}}getFeatureFlag(e,t){if(void 0===t&&(t={}),this._hasLoadedFlags||this.getFlags()&&this.getFlags().length>0){var r=this.getFlagVariants()[e],i=""+r,n=this._instance.get_property(Op)||void 0,s=this._instance.get_property(Dp)||void 0,o=this._instance.get_property(Js)||{};if((t.send_event||!("send_event"in t))&&(!(e in o)||!o[e].includes(i))){var a,l,u,c,d,h,p,v,g;Yr(o[e])?o[e].push(i):o[e]=[i],null==(a=this._instance.persistence)||a.register({[Js]:o});var _=this.getFeatureFlagDetails(e),f={$feature_flag:e,$feature_flag_response:r,$feature_flag_payload:this.getFeatureFlagPayload(e)||null,$feature_flag_request_id:n,$feature_flag_evaluated_at:s,$feature_flag_bootstrapped_response:(null==(l=this._instance.config.bootstrap)||null==(l=l.featureFlags)?void 0:l[e])||null,$feature_flag_bootstrapped_payload:(null==(u=this._instance.config.bootstrap)||null==(u=u.featureFlagPayloads)?void 0:u[e])||null,$used_bootstrap_value:!this._flagsLoadedFromRemote};ei(null==_||null==(c=_.metadata)?void 0:c.version)||(f.$feature_flag_version=_.metadata.version);var m,y=null!==(d=null==_||null==(h=_.reason)?void 0:h.description)&&void 0!==d?d:null==_||null==(p=_.reason)?void 0:p.code;if(y&&(f.$feature_flag_reason=y),null!=_&&null!=(v=_.metadata)&&v.id&&(f.$feature_flag_id=_.metadata.id),ei(null==_?void 0:_.original_variant)&&ei(null==_?void 0:_.original_enabled)||(f.$feature_flag_original_response=ei(_.original_variant)?_.original_enabled:_.original_variant),null!=_&&null!=(g=_.metadata)&&g.original_payload)f.$feature_flag_original_payload=null==_||null==(m=_.metadata)?void 0:m.original_payload;this._instance.capture("$feature_flag_called",f)}return r}Rp.warn('getFeatureFlag for key "'+e+"\" failed. Feature flags didn't load in time.")}getFeatureFlagDetails(e){return this.getFlagsWithDetails()[e]}getFeatureFlagPayload(e){return this.getFlagPayloads()[e]}getRemoteConfigPayload(e,t){var r=this._instance.config.token,i={distinct_id:this._instance.get_distinct_id(),token:r};this._shouldIncludeEvaluationEnvironments()&&(i.evaluation_environments=this._getValidEvaluationEnvironments()),this._instance._send_request({method:"POST",url:this._instance.requestRouter.endpointFor("flags","/flags/?v=2&config=true"),data:i,compression:this._instance.config.disable_compression?void 0:Xl.Base64,timeout:this._instance.config.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={}),this._hasLoadedFlags||this.getFlags()&&this.getFlags().length>0){var r=this.getFeatureFlag(e,t);return ei(r)?void 0:!!r}Rp.warn('isFeatureEnabled for key "'+e+"\" failed. Feature flags didn't load in time.")}addFeatureFlagsHandler(e){this.featureFlagEventHandlers.push(e)}removeFeatureFlagsHandler(e){this.featureFlagEventHandlers=this.featureFlagEventHandlers.filter((t=>t!==e))}receivedFeatureFlags(e,t){if(this._instance.persistence){this._hasLoadedFlags=!0;var i=this.getFlagVariants(),n=this.getFlagPayloads(),s=this.getFlagsWithDetails();!function(e,t,i,n,s){void 0===i&&(i={}),void 0===n&&(n={}),void 0===s&&(s={});var o=qp(e),a=o.flags,l=o.featureFlags,u=o.featureFlagPayloads;if(l){var c=e.requestId,d=e.evaluatedAt;if(Yr(l)){Rp.warn("v1 of the feature flags endpoint is deprecated. Please use the latest version.");var h={};if(l)for(var p=0;p<l.length;p++)h[l[p]]=!0;t&&t.register({[Ap]:l,[js]:h})}else{var v=l,g=u,_=a;e.errorsWhileComputingFlags&&(v=r({},i,v),g=r({},n,g),_=r({},s,_)),t&&t.register(r({[Ap]:Object.keys(Hp(v)),[js]:v||{},[Fp]:g||{},[Gs]:_||{}},c?{[Op]:c}:{},d?{[Dp]:d}:{}))}}}(e,this._instance.persistence,i,n,s),this._fireFeatureFlagsCallbacks(t)}}override(e,t){void 0===t&&(t=!1),Rp.warn("override is deprecated. Please use overrideFeatureFlags instead."),this.overrideFeatureFlags({flags:e,suppressWarning:t})}overrideFeatureFlags(e){if(!this._instance.__loaded||!this._instance.persistence)return Rp.uninitializedWarning("posthog.featureFlags.overrideFeatureFlags");if(!1===e)return this._instance.persistence.unregister(Np),this._instance.persistence.unregister(Lp),this._fireFeatureFlagsCallbacks(),Pp.info("All overrides cleared");if(e&&"object"==typeof e&&("flags"in e||"payloads"in e)){var t,r=e;if(this._override_warning=Boolean(null!==(t=r.suppressWarning)&&void 0!==t&&t),"flags"in r)if(!1===r.flags)this._instance.persistence.unregister(Np),Pp.info("Flag overrides cleared");else if(r.flags){if(Yr(r.flags)){for(var i={},n=0;n<r.flags.length;n++)i[r.flags[n]]=!0;this._instance.persistence.register({[Np]:i})}else this._instance.persistence.register({[Np]:r.flags});Pp.info("Flag overrides set",{flags:r.flags})}return"payloads"in r&&(!1===r.payloads?(this._instance.persistence.unregister(Lp),Pp.info("Payload overrides cleared")):r.payloads&&(this._instance.persistence.register({[Lp]:r.payloads}),Pp.info("Payload overrides set",{payloads:r.payloads}))),void this._fireFeatureFlagsCallbacks()}this._fireFeatureFlagsCallbacks()}onFeatureFlags(e){if(this.addFeatureFlagsHandler(e),this._hasLoadedFlags){var{flags:t,flagVariants:r}=this._prepareFeatureFlagsForCallbacks();e(t,r)}return()=>this.removeFeatureFlagsHandler(e)}updateEarlyAccessFeatureEnrollment(e,t,i){var n,s=(this._instance.get_property(Zs)||[]).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._instance.persistence)||n.register({[Ap]:Object.keys(Hp(l)),[js]:l}),this._fireFeatureFlagsCallbacks()}getEarlyAccessFeatures(e,t,r){void 0===t&&(t=!1);var i=this._instance.get_property(Zs),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._instance.config.token+n),method:"GET",callback:t=>{var r,i;if(t.json){var n=t.json.earlyAccessFeatures;return null==(r=this._instance.persistence)||r.unregister(Zs),null==(i=this._instance.persistence)||i.register({[Zs]:n}),e(n)}}})}_prepareFeatureFlagsForCallbacks(){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)),{})}}_fireFeatureFlagsCallbacks(e){var{flags:t,flagVariants:r}=this._prepareFeatureFlagsForCallbacks();this.featureFlagEventHandlers.forEach((i=>i(t,r,{errorsLoading:e})))}setPersonPropertiesForFlags(e,t){void 0===t&&(t=!0);var i=this._instance.get_property(Ys)||{};this._instance.register({[Ys]:r({},i,e)}),t&&this._instance.reloadFeatureFlags()}resetPersonPropertiesForFlags(){this._instance.unregister(Ys)}setGroupPropertiesForFlags(e,t){void 0===t&&(t=!0);var i=this._instance.get_property(Xs)||{};0!==Object.keys(i).length&&Object.keys(i).forEach((t=>{i[t]=r({},i[t],e[t]),delete e[t]})),this._instance.register({[Xs]:r({},i,e)}),t&&this._instance.reloadFeatureFlags()}resetGroupPropertiesForFlags(e){if(e){var t=this._instance.get_property(Xs)||{};this._instance.register({[Xs]:r({},t,{[e]:{}})})}else this._instance.unregister(Xs)}reset(){this._hasLoadedFlags=!1,this._requestInFlight=!1,this._reloadingDisabled=!1,this._additionalReloadRequested=!1,this._flagsCalled=!1,this._flagsLoadedFromRemote=!1,this.$anon_distinct_id=void 0,this._clearDebouncer(),this._override_warning=!1}}var $p=["cookie","localstorage","localstorage+cookie","sessionstorage","memory"];class Up{constructor(e,t){this._config=e,this.props={},this._campaign_params_saved=!1,this._name=(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._storage=this._buildStorage(e),this.load(),e.debug&&ls.info("Persistence loaded",e.persistence,r({},this.props)),this.update_config(e,e,t),this.save()}isDisabled(){return!!this._disabled}_buildStorage(e){-1===$p.indexOf(e.persistence.toLowerCase())&&(ls.critical("Unknown persistence type "+e.persistence+"; falling back to localStorage+cookie"),e.persistence="localStorage+cookie");var t=e.persistence.toLowerCase();return"localstorage"===t&&Fh._is_supported()?Fh:"localstorage+cookie"===t&&Oh._is_supported()?Oh:"sessionstorage"===t&&Bh._is_supported()?Bh:"memory"===t?Hh:"cookie"===t?Ah:Oh._is_supported()?Oh:Ah}properties(){var e={};return hs(this.props,(function(t,r){if(r===js&&Jr(t))for(var i=Object.keys(t),n=0;n<i.length;n++)e["$feature/"+i[n]]=t[i[n]];else o=r,a=!1,(ii(s=lo)?a:Yn&&s.indexOf===Yn?-1!=s.indexOf(o):(hs(s,(function(e){if(a||(a=e===o))return cs})),a))||(e[r]=t);var s,o,a})),e}load(){if(!this._disabled){var e=this._storage._parse(this._name);e&&(this.props=ps({},e))}}save(){this._disabled||this._storage._set(this._name,this.props,this._expire_days,this._cross_subdomain,this._secure,this._config.debug)}remove(){this._storage._remove(this._name,!1),this._storage._remove(this._name,!0)}clear(){this.remove(),this.props={}}register_once(e,t,r){if(Jr(e)){ei(t)&&(t="None"),this._expire_days=ei(r)?this._default_expiry:r;var i=!1;if(hs(e,((e,r)=>{this.props.hasOwnProperty(r)&&this.props[r]!==t||(this.props[r]=e,i=!0)})),i)return this.save(),!0}return!1}register(e,t){if(Jr(e)){this._expire_days=ei(t)?this._default_expiry:t;var r=!1;if(hs(e,((t,i)=>{e.hasOwnProperty(i)&&this.props[i]!==t&&(this.props[i]=t,r=!0)})),r)return this.save(),!0}return!1}unregister(e){e in this.props&&(delete this.props[e],this.save())}update_campaign_params(){if(!this._campaign_params_saved){var e=pp(this._config.custom_campaign_params,this._config.mask_personal_data_properties,this._config.custom_personal_data_properties);Qr(ms(e))||this.register(e),this._campaign_params_saved=!0}}update_search_keyword(){var e;this.register((e=null==Kn?void 0:Kn.referrer)?gp(e):{})}update_referrer_info(){var e;this.register_once({$referrer:fp(),$referring_domain:null!=Kn&&Kn.referrer&&(null==(e=Is(Kn.referrer))?void 0:e.host)||"$direct"},void 0)}set_initial_person_info(){this.props[ro]||this.props[io]||this.register_once({[no]:mp(this._config.mask_personal_data_properties,this._config.custom_personal_data_properties)},void 0)}get_initial_props(){var e={};hs([io,ro],(t=>{var r=this.props[t];r&&hs(r,(function(t,r){e["$initial_"+Wr(r)]=t}))}));var t,r,i=this.props[no];if(i){var n=(t=yp(i),r={},hs(t,(function(e,t){r["$initial_"+Wr(t)]=e})),r);ps(e,n)}return e}safe_merge(e){return hs(this.props,(function(t,r){r in e||(e[r]=t)})),e}update_config(e,t,r){if(this._default_expiry=this._expire_days=e.cookie_expiration,this.set_disabled(e.disable_persistence||!!r),this.set_cross_subdomain(e.cross_subdomain_cookie),this.set_secure(e.secure_cookie),e.persistence!==t.persistence){var i=this._buildStorage(e),n=this.props;this.clear(),this._storage=i,this.props=n,this.save()}}set_disabled(e){this._disabled=e,this._disabled?this.remove():this.save()}set_cross_subdomain(e){e!==this._cross_subdomain&&(this._cross_subdomain=e,this.remove(),this.save())}set_secure(e){e!==this._secure&&(this._secure=e,this.remove(),this.save())}set_event_timer(e,t){var r=this.props[Ns]||{};r[e]=t,this.props[Ns]=r,this.save()}remove_event_timer(e){var t=(this.props[Ns]||{})[e];return ei(t)||(delete this.props[Ns][e],this.save()),t}get_property(e){return this.props[e]}set_property(e,t){this.props[e]=t,this.save()}}var Wp=us("[Product Tours]"),zp="ph_product_tours";class jp{constructor(e){this._productTourManager=null,this._cachedTours=null,this._instance=e}onRemoteConfig(e){this._instance.persistence&&this._instance.persistence.register({[Vs]:!(null==e||!e.productTours)}),this.loadIfEnabled()}loadIfEnabled(){var e,t;this._productTourManager||((e=this._instance).config.disable_product_tours||null==(t=e.persistence)||!t.get_property(Vs))||this._loadScript((()=>this._startProductTours()))}_loadScript(e){var t,r;null!=(t=is.__PosthogExtensions__)&&t.generateProductTours?e():null==(r=is.__PosthogExtensions__)||null==r.loadExternalDependency||r.loadExternalDependency(this._instance,"product-tours",(t=>{t?Wp.error("Could not load product tours script",t):e()}))}_startProductTours(){var e;!this._productTourManager&&null!=(e=is.__PosthogExtensions__)&&e.generateProductTours&&(this._productTourManager=is.__PosthogExtensions__.generateProductTours(this._instance,!0))}getProductTours(e,t){if(void 0===t&&(t=!1),!Yr(this._cachedTours)||t){var r=this._instance.persistence;if(r){var i=r.props[zp];if(Yr(i)&&!t)return this._cachedTours=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=>{var i=t.statusCode;if(200!==i||!t.json){var n="Product Tours API could not be loaded, status: "+i;return Wp.error(n),void e([],{isLoaded:!1,error:n})}var s=Yr(t.json.product_tours)?t.json.product_tours:[];this._cachedTours=s,r&&r.register({[zp]:s}),e(s,{isLoaded:!0})}})}else e(this._cachedTours,{isLoaded:!0})}getActiveProductTours(e){ni(this._productTourManager)?e([],{isLoaded:!1,error:"Product tours not loaded"}):this._productTourManager.getActiveProductTours(e)}showProductTour(e){var t;null==(t=this._productTourManager)||t.showTourById(e)}previewTour(e){this._productTourManager?this._productTourManager.previewTour(e):this._loadScript((()=>{var t;this._startProductTours(),null==(t=this._productTourManager)||t.previewTour(e)}))}dismissProductTour(){var e;null==(e=this._productTourManager)||e.dismissTour("user_clicked_skip")}nextStep(){var e;null==(e=this._productTourManager)||e.nextStep()}previousStep(){var e;null==(e=this._productTourManager)||e.previousStep()}clearCache(){var e;this._cachedTours=null,null==(e=this._instance.persistence)||e.unregister(zp)}resetTour(e){var t;null==(t=this._productTourManager)||t.resetTour(e)}resetAllTours(){var e;null==(e=this._productTourManager)||e.resetAllTours()}cancelPendingTour(e){var t;null==(t=this._productTourManager)||t.cancelPendingTour(e)}}class Zp{constructor(){this._events={},this._events={}}on(e,t){return this._events[e]||(this._events[e]=[]),this._events[e].push(t),()=>{this._events[e]=this._events[e].filter((e=>e!==t))}}emit(e,t){for(var r of this._events[e]||[])r(t);for(var i of this._events["*"]||[])i(e,t)}}function Gp(e,t,r){if(ni(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 Yp{constructor(e){this._debugEventEmitter=new Zp,this._checkStep=(e,t)=>this._checkStepEvent(e,t)&&this._checkStepUrl(e,t)&&this._checkStepElement(e,t)&&this._checkStepProperties(e,t),this._checkStepEvent=(e,t)=>null==t||!t.event||(null==e?void 0:e.event)===(null==t?void 0:t.event),this._instance=e,this._actionEvents=new Set,this._actionRegistry=new Set}init(){var e;if(!ei(null==(e=this._instance)?void 0:e._addCaptureHook)){var t;null==(t=this._instance)||t._addCaptureHook(((e,t)=>{this.on(e,t)}))}}register(e){var t,r;if(!ei(null==(t=this._instance)?void 0:t._addCaptureHook)&&(e.forEach((e=>{var t,r;null==(t=this._actionRegistry)||t.add(e),null==(r=e.steps)||r.forEach((e=>{var t;null==(t=this._actionEvents)||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._actionEvents.has(e)||this._actionEvents.has(null==t?void 0:t.event))&&this._actionRegistry&&(null==(r=this._actionRegistry)?void 0:r.size)>0&&this._actionRegistry.forEach((e=>{this._checkAction(t,e)&&this._debugEventEmitter.emit("actionCaptured",e.name)}))}_addActionHook(e){this.onAction("actionCaptured",(t=>e(t)))}_checkAction(e,t){if(null==(null==t?void 0:t.steps))return!1;for(var r of t.steps)if(this._checkStep(e,r))return!0;return!1}onAction(e,t){return this._debugEventEmitter.on(e,t)}_checkStepUrl(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(!Gp(i,t.url,t.url_matching||"contains"))return!1}return!0}_checkStepElement(e,t){return!!this._checkStepHref(e,t)&&(!!this._checkStepText(e,t)&&!!this._checkStepSelector(e,t))}_checkStepHref(e,t){var r;if(null==t||!t.href)return!0;var i=this._getElementsList(e);if(i.length>0)return i.some((e=>Gp(e.href,t.href,t.href_matching||"exact")));var n,s=(null==e||null==(r=e.properties)?void 0:r.$elements_chain)||"";return!!s&&Gp((n=s.match(/(?::|")href="(.*?)"/))?n[1]:"",t.href,t.href_matching||"exact")}_checkStepText(e,t){var r;if(null==t||!t.text)return!0;var i=this._getElementsList(e);if(i.length>0)return i.some((e=>Gp(e.text,t.text,t.text_matching||"exact")||Gp(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;!ni(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=>Gp(e,s,o))))}_checkStepSelector(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}_getElementsList(e){var t;return null==(null==e||null==(t=e.properties)?void 0:t.$elements)?[]:null==e?void 0:e.properties.$elements}_checkStepProperties(e,t){return null==t||!t.properties||0===t.properties.length||Uu(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 Xp{constructor(e){this._instance=e,this._eventToItems=new Map,this._cancelEventToItems=new Map,this._actionToItems=new Map}_doesEventMatchFilter(e,t){return!!e&&Uu(e.propertyFilters,null==t?void 0:t.properties)}_buildEventToItemMap(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}_getMatchingItems(e,t,r){var i=(r===ml.Activation?this._eventToItems:this._cancelEventToItems).get(e),n=[];return this._getItems((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._doesEventMatchFilter(s,t)}))}register(e){var t;ei(null==(t=this._instance)?void 0:t._addCaptureHook)||(this._setupEventBasedItems(e),this._setupActionBasedItems(e))}_setupActionBasedItems(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}));if(0!==t.length){if(null==this._actionMatcher){this._actionMatcher=new Yp(this._instance),this._actionMatcher.init();this._actionMatcher._addActionHook((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._actionMatcher)||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._actionToItems.get(t.name);r&&r.push(e.id),this._actionToItems.set(t.name,r||[e.id])}})))}))}}_setupEventBasedItems(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}));if(0!==r.length||0!==i.length){null==(t=this._instance)||t._addCaptureHook(((e,t)=>{this.onEvent(e,t)})),this._eventToItems=this._buildEventToItemMap(e,ml.Activation),this._cancelEventToItems=this._buildEventToItemMap(e,ml.Cancellation)}}onEvent(e,t){var r,i=this._getLogger(),n=this._getActivatedKey(),s=this._getShownEventName(),o=(null==(r=this._instance)||null==(r=r.persistence)?void 0:r.props[n])||[];if(s===e&&t&&o.length>0){var a,l;i.info("event matched, removing item from activated items",{event:e,eventPayload:t,existingActivatedItems:o});var u=(null==t||null==(a=t.properties)?void 0:a.$survey_id)||(null==t||null==(l=t.properties)?void 0:l.$product_tour_id);if(u){var c=o.indexOf(u);c>=0&&(o.splice(c,1),this._updateActivatedItems(o))}}else{if(this._cancelEventToItems.has(e)){var d=this._getMatchingItems(e,t,ml.Cancellation);d.length>0&&(i.info("cancel event matched, cancelling items",{event:e,itemsToCancel:d.map((e=>e.id))}),d.forEach((e=>{var t=o.indexOf(e.id);t>=0&&o.splice(t,1),this._cancelPendingItem(e.id)})),this._updateActivatedItems(o))}if(this._eventToItems.has(e)){i.info("event name matched",{event:e,eventPayload:t,items:this._eventToItems.get(e)});var h=this._getMatchingItems(e,t,ml.Activation);this._updateActivatedItems(o.concat(h.map((e=>e.id))||[]))}}}onAction(e){var t,r=this._getActivatedKey(),i=(null==(t=this._instance)||null==(t=t.persistence)?void 0:t.props[r])||[];this._actionToItems.has(e)&&this._updateActivatedItems(i.concat(this._actionToItems.get(e)||[]))}_updateActivatedItems(e){var t,r=this._getLogger(),i=this._getActivatedKey(),n=[...new Set(e)].filter((e=>!this._isItemPermanentlyIneligible(e)));r.info("updating activated items",{activatedItems:n}),null==(t=this._instance)||null==(t=t.persistence)||t.register({[i]:n})}getActivatedIds(){var e,t=this._getActivatedKey(),r=null==(e=this._instance)||null==(e=e.persistence)?void 0:e.props[t];return r||[]}getEventToItemsMap(){return this._eventToItems}_getActionMatcher(){return this._actionMatcher}}class Kp extends Xp{constructor(e){super(e)}_getActivatedKey(){return"$surveys_activated"}_getShownEventName(){return El.SHOWN}_getItems(e){var t;null==(t=this._instance)||t.getSurveys(e)}_cancelPendingItem(e){var t;null==(t=this._instance)||t.cancelPendingSurvey(e)}_getLogger(){return Ml}_isItemPermanentlyIneligible(){return!1}getSurveys(){return this.getActivatedIds()}getEventToSurveys(){return this.getEventToItemsMap()}}class Jp{constructor(e){this._isSurveysEnabled=void 0,this._surveyManager=null,this._isInitializingSurveys=!1,this._surveyCallbacks=[],this._getSurveysInFlightPromise=null,this._instance=e,this._surveyEventReceiver=null}onRemoteConfig(e){if(!this._instance.config.disable_surveys){var t=e.surveys;if(ni(t))return Ml.warn("Flags not loaded yet. Not loading surveys.");var r=Yr(t);this._isSurveysEnabled=r?t.length>0:t,Ml.info("flags response received, isSurveysEnabled: "+this._isSurveysEnabled),this.loadIfEnabled()}}reset(){localStorage.removeItem("lastSeenSurveyDate");for(var e=[],t=0;t<localStorage.length;t++){var r=localStorage.key(t);(null!=r&&r.startsWith(Nl)||null!=r&&r.startsWith(Fl))&&e.push(r)}e.forEach((e=>localStorage.removeItem(e)))}loadIfEnabled(){if(!this._surveyManager)if(this._isInitializingSurveys)Ml.info("Already initializing surveys, skipping...");else if(this._instance.config.disable_surveys)Ml.info("Disabled. Not loading surveys.");else if(this._instance.config.cookieless_mode&&this._instance.consent.isOptedOut())Ml.info("Not loading surveys in cookieless mode without consent.");else{var e=null==is?void 0:is.__PosthogExtensions__;if(e){if(!ei(this._isSurveysEnabled)||this._instance.config.advanced_enable_surveys){var t=this._isSurveysEnabled||this._instance.config.advanced_enable_surveys;this._isInitializingSurveys=!0;try{var r=e.generateSurveys;if(r)return void this._completeSurveyInitialization(r,t);var i=e.loadExternalDependency;if(!i)return void this._handleSurveyLoadError("PostHog loadExternalDependency extension not found.");i(this._instance,"surveys",(r=>{r||!e.generateSurveys?this._handleSurveyLoadError("Could not load surveys script",r):this._completeSurveyInitialization(e.generateSurveys,t)}))}catch(e){throw this._handleSurveyLoadError("Error initializing surveys",e),e}finally{this._isInitializingSurveys=!1}}}else Ml.error("PostHog Extensions not found.")}}_completeSurveyInitialization(e,t){this._surveyManager=e(this._instance,t),this._surveyEventReceiver=new Kp(this._instance),Ml.info("Surveys loaded successfully"),this._notifySurveyCallbacks({isLoaded:!0})}_handleSurveyLoadError(e,t){Ml.error(e,t),this._notifySurveyCallbacks({isLoaded:!1,error:e})}onSurveysLoaded(e){return this._surveyCallbacks.push(e),this._surveyManager&&this._notifySurveyCallbacks({isLoaded:!0}),()=>{this._surveyCallbacks=this._surveyCallbacks.filter((t=>t!==e))}}getSurveys(e,t){if(void 0===t&&(t=!1),this._instance.config.disable_surveys)return Ml.info("Disabled. Not loading surveys."),e([]);var r,i=this._instance.get_property(Ks);if(i&&!t)return e(i,{isLoaded:!0});"undefined"!=typeof Promise&&this._getSurveysInFlightPromise?this._getSurveysInFlightPromise.then((t=>{var{surveys:r,context:i}=t;return e(r,i)})):("undefined"!=typeof Promise&&(this._getSurveysInFlightPromise=new Promise((e=>{r=e}))),this._instance._send_request({url:this._instance.requestRouter.endpointFor("api","/api/surveys/?token="+this._instance.config.token),method:"GET",timeout:this._instance.config.surveys_request_timeout_ms,callback:t=>{var i;this._getSurveysInFlightPromise=null;var n=t.statusCode;if(200!==n||!t.json){var s="Surveys API could not be loaded, status: "+n;Ml.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=>Rl(e)&&(Pl(e)||Al(e))));u.length>0&&(null==(a=this._surveyEventReceiver)||a.register(u));null==(i=this._instance.persistence)||i.register({[Ks]:l});var c={isLoaded:!0};e(l,c),null==r||r({surveys:l,context:c})}}))}_notifySurveyCallbacks(e){for(var t of this._surveyCallbacks)try{if(!e.isLoaded)return t([],e);this.getSurveys(t)}catch(e){Ml.error("Error in survey callback",e)}}getActiveMatchingSurveys(e,t){if(void 0===t&&(t=!1),!ni(this._surveyManager))return this._surveyManager.getActiveMatchingSurveys(e,t);Ml.warn("init was not called")}_getSurveyById(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}_checkSurveyEligibility(e){if(ni(this._surveyManager))return{eligible:!1,reason:"SDK is not enabled or survey functionality is not yet loaded"};var t="string"==typeof e?this._getSurveyById(e):e;return t?this._surveyManager.checkSurveyEligibility(t):{eligible:!1,reason:"Survey not found"}}canRenderSurvey(e){if(ni(this._surveyManager))return Ml.warn("init was not called"),{visible:!1,disabledReason:"SDK is not enabled or survey functionality is not yet loaded"};var t=this._checkSurveyEligibility(e);return{visible:t.eligible,disabledReason:t.reason}}canRenderSurveyAsync(e,t){return ni(this._surveyManager)?(Ml.warn("init was not called"),Promise.resolve({visible:!1,disabledReason:"SDK is not enabled or survey functionality is not yet loaded"})):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._checkSurveyEligibility(n);r({visible:s.eligible,disabledReason:s.reason})}else r({visible:!1,disabledReason:"Survey not found"})}),t)}))}renderSurvey(e,t){var r;if(ni(this._surveyManager))Ml.warn("init was not called");else{var i="string"==typeof e?this._getSurveyById(e):e;if(null!=i&&i.id)if(ql.includes(i.type)){var n=null==Kn?void 0:Kn.querySelector(t);if(n)return null!=(r=i.appearance)&&r.surveyPopupDelaySeconds?(Ml.info("Rendering survey "+i.id+" with delay of "+i.appearance.surveyPopupDelaySeconds+" seconds"),void setTimeout((()=>{var e,t;Ml.info("Rendering survey "+i.id+" with delay of "+(null==(e=i.appearance)?void 0:e.surveyPopupDelaySeconds)+" seconds"),null==(t=this._surveyManager)||t.renderSurvey(i,n),Ml.info("Survey "+i.id+" rendered")}),1e3*i.appearance.surveyPopupDelaySeconds)):void this._surveyManager.renderSurvey(i,n);Ml.warn("Survey element not found")}else Ml.warn("Surveys of type "+i.type+" cannot be rendered in the app");else Ml.warn("Survey not found")}}displaySurvey(e,t){var i;if(ni(this._surveyManager))Ml.warn("init was not called");else{var n=this._getSurveyById(e);if(n){var s=n;if(null!=(i=n.appearance)&&i.surveyPopupDelaySeconds&&t.ignoreDelay&&(s=r({},n,{appearance:r({},n.appearance,{surveyPopupDelaySeconds:0})})),!1===t.ignoreConditions){var o=this.canRenderSurvey(n);if(!o.visible)return void Ml.warn("Survey is not eligible to be displayed: ",o.disabledReason)}t.displayType!==Tl.Inline?this._surveyManager.handlePopoverSurvey(s):this.renderSurvey(s,t.selector)}else Ml.warn("Survey not found")}}cancelPendingSurvey(e){ni(this._surveyManager)?Ml.warn("init was not called"):this._surveyManager.cancelSurvey(e)}handlePageUnload(){var e;null==(e=this._surveyManager)||e.handlePageUnload()}}var Qp=us("[Conversations]");class ev{constructor(e){this._isConversationsEnabled=void 0,this._conversationsManager=null,this._isInitializing=!1,this._remoteConfig=null,this._instance=e}onRemoteConfig(e){if(!this._instance.config.disable_conversations){var t=e.conversations;ni(t)||(oi(t)?this._isConversationsEnabled=t:(this._isConversationsEnabled=t.enabled,this._remoteConfig=t),this.loadIfEnabled())}}reset(){var e;null==(e=this._conversationsManager)||e.reset(),this._conversationsManager=null,this._isConversationsEnabled=void 0,this._remoteConfig=null}loadIfEnabled(){if(!this._conversationsManager&&!this._isInitializing&&!(this._instance.config.disable_conversations||this._instance.config.cookieless_mode&&this._instance.consent.isOptedOut())){var e=null==is?void 0:is.__PosthogExtensions__;if(e&&!ei(this._isConversationsEnabled)&&this._isConversationsEnabled)if(this._remoteConfig&&this._remoteConfig.token){if(function(e){var t;if(!e||0===e.length)return!0;var r=null==zn||null==(t=zn.location)?void 0:t.hostname;return!r||e.some((e=>{var t=function(e){var t=e.replace(/^https?:\/\//,"");return(t=t.split("/")[0].split("?")[0].split(":")[0])||null}(e);if(!t)return!1;if(t.startsWith("*.")){var i=t.slice(2);return r.endsWith("."+i)||r===i}return r===t}))}(this._remoteConfig.domains)){this._isInitializing=!0;try{var t=e.initConversations;if(t)return this._completeInitialization(t),void(this._isInitializing=!1);var r=e.loadExternalDependency;if(!r)return void this._handleLoadError("PostHog loadExternalDependency extension not found.");r(this._instance,"conversations",(t=>{t||!e.initConversations?this._handleLoadError("Could not load conversations script",t):this._completeInitialization(e.initConversations),this._isInitializing=!1}))}catch(e){this._handleLoadError("Error initializing conversations",e),this._isInitializing=!1}}}else Qp.error("Conversations enabled but missing token in remote config.")}}_completeInitialization(e){if(this._remoteConfig)try{this._conversationsManager=e(this._remoteConfig,this._instance),Qp.info("Conversations loaded successfully")}catch(e){this._handleLoadError("Error completing conversations initialization",e)}else Qp.error("Cannot complete initialization: remote config is null")}_handleLoadError(e,t){Qp.error(e,t),this._conversationsManager=null,this._isInitializing=!1}enable(){this._conversationsManager?this._conversationsManager.enable():Qp.warn("Conversations not loaded yet.")}disable(){this._conversationsManager&&this._conversationsManager.disable()}isLoaded(){return!ii(this._conversationsManager)}isEnabled(){return!0===this._isConversationsEnabled}}var tv=us("[RateLimiter]");class rv{constructor(e){var t,r;this.serverLimits={},this.lastEventRateLimited=!1,this.checkForLimiting=e=>{var t=e.text;if(t&&t.length)try{(JSON.parse(t).quota_limited||[]).forEach((e=>{tv.info((e||"events")+" is quota limited."),this.serverLimits[e]=(new Date).getTime()+6e4}))}catch(e){return void tv.warn('could not rate limit - continuing. Error: "'+(null==e?void 0:e.message)+'"',{text:t})}},this.instance=e,this.captureEventsPerSecond=(null==(t=e.config.rate_limiting)?void 0:t.events_per_second)||10,this.captureEventsBurstLimit=Math.max((null==(r=e.config.rate_limiting)?void 0:r.events_burst_limit)||10*this.captureEventsPerSecond,this.captureEventsPerSecond),this.lastEventRateLimited=this.clientRateLimitContext(!0).isRateLimited}clientRateLimitContext(e){var t,r,i;void 0===e&&(e=!1);var n=(new Date).getTime(),s=null!==(t=null==(r=this.instance.persistence)?void 0:r.get_property(to))&&void 0!==t?t:{tokens:this.captureEventsBurstLimit,last:n};s.tokens+=(n-s.last)/1e3*this.captureEventsPerSecond,s.last=n,s.tokens>this.captureEventsBurstLimit&&(s.tokens=this.captureEventsBurstLimit);var o=s.tokens<1;return o||e||(s.tokens=Math.max(0,s.tokens-1)),!o||this.lastEventRateLimited||e||this.instance.capture("$$client_ingestion_warning",{$$client_ingestion_warning_message:"posthog-js client rate limited. Config is set to "+this.captureEventsPerSecond+" events per second and "+this.captureEventsBurstLimit+" events burst limit."},{skip_client_rate_limiting:!0}),this.lastEventRateLimited=o,null==(i=this.instance.persistence)||i.set_property(to,s),{isRateLimited:o,remainingTokens:s.tokens}}isServerRateLimited(e){var t=this.serverLimits[e||"events"]||!1;return!1!==t&&(new Date).getTime()<t}}var iv=us("[RemoteConfig]");class nv{constructor(e){this._instance=e}get remoteConfig(){var e;return null==(e=is._POSTHOG_REMOTE_CONFIG)||null==(e=e[this._instance.config.token])?void 0:e.config}_loadRemoteConfigJs(e){var t,r;null!=(t=is.__PosthogExtensions__)&&t.loadExternalDependency?null==(r=is.__PosthogExtensions__)||null==r.loadExternalDependency||r.loadExternalDependency(this._instance,"remote-config",(()=>e(this.remoteConfig))):(iv.error("PostHog Extensions not found. Cannot load remote config."),e())}_loadRemoteConfigJSON(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 iv.info("Using preloaded remote config",this.remoteConfig),void this._onRemoteConfig(this.remoteConfig);if(this._instance._shouldDisableFlags())return void iv.warn("Remote config is disabled. Falling back to local config.");this._loadRemoteConfigJs((e=>{if(!e)return iv.info("No config found after loading remote JS config. Falling back to JSON."),void this._loadRemoteConfigJSON((e=>{this._onRemoteConfig(e)}));this._onRemoteConfig(e)}))}catch(e){iv.error("Error loading remote config",e)}}_onRemoteConfig(e){e?this._instance.config.__preview_remote_config?(this._instance._onRemoteConfig(e),!1!==e.hasFeatureFlags&&this._instance.featureFlags.ensureFlagsLoaded()):iv.info("__preview_remote_config is disabled. Logging config instead",e):iv.error("Failed to fetch remote config from PostHog.")}}var sv=3e3;class ov{constructor(e,t){this._isPaused=!0,this._queue=[],this._flushTimeoutMs=gi((null==t?void 0:t.flush_interval_ms)||sv,250,5e3,ls.createLogger("flush interval"),sv),this._sendRequest=e}enqueue(e){this._queue.push(e),this._flushTimeout||this._setFlushTimeout()}unload(){this._clearFlushTimeout();var e=this._queue.length>0?this._formatQueue():{},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._sendRequest(r({},e,{transport:"sendBeacon"}))}))}enable(){this._isPaused=!1,this._setFlushTimeout()}_setFlushTimeout(){var e=this;this._isPaused||(this._flushTimeout=setTimeout((()=>{if(this._clearFlushTimeout(),this._queue.length>0){var t=this._formatQueue(),r=function(){var r=t[i],n=(new Date).getTime();r.data&&Yr(r.data)&&hs(r.data,(e=>{e.offset=Math.abs(e.timestamp-n),delete e.timestamp})),e._sendRequest(r)};for(var i in t)r()}}),this._flushTimeoutMs))}_clearFlushTimeout(){clearTimeout(this._flushTimeout),this._flushTimeout=void 0}_formatQueue(){var e={};return hs(this._queue,(t=>{var i,n=t,s=(n?n.batchKey:null)||n.url;ei(e[s])&&(e[s]=r({},n,{data:[]})),null==(i=e[s].data)||i.push(n.data)})),this._queue=[],e}}var av=["retriesPerformedSoFar"];class lv{constructor(e){this._isPolling=!1,this._pollIntervalMs=3e3,this._queue=[],this._instance=e,this._queue=[],this._areWeOnline=!0,!ei(zn)&&"onLine"in zn.navigator&&(this._areWeOnline=zn.navigator.onLine,this._onlineListener=()=>{this._areWeOnline=!0,this._flush()},this._offlineListener=()=>{this._areWeOnline=!1},Cs(zn,"online",this._onlineListener),Cs(zn,"offline",this._offlineListener))}get length(){return this._queue.length}retriableRequest(e){var{retriesPerformedSoFar:t}=e,n=i(e,av);si(t)&&t>0&&(n.url=Lu(n.url,{retry_count:t})),this._instance._send_request(r({},n,{callback:e=>{200!==e.statusCode&&(e.statusCode<400||e.statusCode>=500)&&(null!=t?t:0)<10?this._enqueue(r({retriesPerformedSoFar:t},n)):null==n.callback||n.callback(e)}}))}_enqueue(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)*(i-r);return Math.ceil(i+n)}(t),i=Date.now()+r;this._queue.push({retryAt:i,requestOptions:e});var n="Enqueued failed request for retry in "+r;navigator.onLine||(n+=" (Browser is offline)"),ls.warn(n),this._isPolling||(this._isPolling=!0,this._poll())}_poll(){if(this._poller&&clearTimeout(this._poller),0===this._queue.length)return this._isPolling=!1,void(this._poller=void 0);this._poller=setTimeout((()=>{this._areWeOnline&&this._queue.length>0&&this._flush(),this._poll()}),this._pollIntervalMs)}_flush(){var e=Date.now(),t=[],r=this._queue.filter((r=>r.retryAt<e||(t.push(r),!1)));if(this._queue=t,r.length>0)for(var{requestOptions:i}of r)this.retriableRequest(i)}unload(){for(var{requestOptions:e}of(this._poller&&(clearTimeout(this._poller),this._poller=void 0),this._isPolling=!1,ei(zn)||(this._onlineListener&&(zn.removeEventListener("online",this._onlineListener),this._onlineListener=void 0),this._offlineListener&&(zn.removeEventListener("offline",this._offlineListener),this._offlineListener=void 0)),this._queue))try{this._instance._send_request(r({},e,{transport:"sendBeacon"}))}catch(e){ls.error(e)}this._queue=[]}}class uv{constructor(e){this._updateScrollData=()=>{var e,t,r,i;this._context||(this._context={});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._context.lastScrollY=Math.ceil(s),this._context.maxScrollY=Math.max(s,null!==(e=this._context.maxScrollY)&&void 0!==e?e:0),this._context.maxScrollHeight=Math.max(o,null!==(t=this._context.maxScrollHeight)&&void 0!==t?t:0),this._context.lastContentY=a,this._context.maxContentY=Math.max(a,null!==(r=this._context.maxContentY)&&void 0!==r?r:0),this._context.maxContentHeight=Math.max(l,null!==(i=this._context.maxContentHeight)&&void 0!==i?i:0)},this._instance=e}getContext(){return this._context}resetContext(){var e=this._context;return setTimeout(this._updateScrollData,0),e}startMeasuringScrollPosition(){Cs(zn,"scroll",this._updateScrollData,{capture:!0}),Cs(zn,"scrollend",this._updateScrollData,{capture:!0}),Cs(zn,"resize",this._updateScrollData)}scrollElement(){if(!this._instance.config.scroll_root_selector)return null==zn?void 0:zn.document.documentElement;var e=Yr(this._instance.config.scroll_root_selector)?this._instance.config.scroll_root_selector:[this._instance.config.scroll_root_selector];for(var t of e){var r=null==zn?void 0:zn.document.querySelector(t);if(r)return r}}scrollY(){if(this._instance.config.scroll_root_selector){var e=this.scrollElement();return e&&e.scrollTop||0}return zn&&(zn.scrollY||zn.pageYOffset||zn.document.documentElement.scrollTop)||0}scrollX(){if(this._instance.config.scroll_root_selector){var e=this.scrollElement();return e&&e.scrollLeft||0}return zn&&(zn.scrollX||zn.pageXOffset||zn.document.documentElement.scrollLeft)||0}}var cv=e=>mp(null==e?void 0:e.config.mask_personal_data_properties,null==e?void 0:e.config.custom_personal_data_properties);class dv{constructor(e,t,r,i){this._onSessionIdCallback=e=>{var t=this._getStored();if(!t||t.sessionId!==e){var r={sessionId:e,props:this._sessionSourceParamGenerator(this._instance)};this._persistence.register({[eo]:r})}},this._instance=e,this._sessionIdManager=t,this._persistence=r,this._sessionSourceParamGenerator=i||cv,this._sessionIdManager.onSessionId(this._onSessionIdCallback)}_getStored(){return this._persistence.props[eo]}getSetOnceProps(){var e,t=null==(e=this._getStored())?void 0:e.props;return t?"r"in t?yp(t):{$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 hs(ms(this.getSetOnceProps()),((t,r)=>{"$current_url"===r&&(r="url"),e["$session_entry_"+Wr(r)]=t})),e}}var hv=us("[SessionId]");class pv{on(e,t){return this._eventEmitter.on(e,t)}constructor(e,t,r){var i;if(this._sessionIdChangedHandlers=[],this._beforeUnloadListener=void 0,this._eventEmitter=new Zp,this._sessionHasBeenIdleTooLong=(e,t)=>Math.abs(e-t)>this.sessionTimeoutMs,!e.persistence)throw new Error("SessionIdManager requires a PostHogPersistence instance");if("always"===e.config.cookieless_mode)throw new Error('SessionIdManager cannot be used with cookieless_mode="always"');this._config=e.config,this._persistence=e.persistence,this._windowId=void 0,this._sessionId=void 0,this._sessionStartTimestamp=null,this._sessionActivityTimestamp=null,this._sessionIdGenerator=t||Zl,this._windowIdGenerator=r||Zl;var n=this._config.persistence_name||this._config.token,s=this._config.session_idle_timeout_seconds||1800;if(this._sessionTimeoutMs=1e3*gi(s,60,36e3,hv.createLogger("session_idle_timeout_seconds"),1800),e.register({$configured_session_timeout_ms:this._sessionTimeoutMs}),this._resetIdleTimer(),this._window_id_storage_key="ph_"+n+"_window_id",this._primary_window_exists_storage_key="ph_"+n+"_primary_window_exists",this._canUseSessionStorage()){var o=Bh._parse(this._window_id_storage_key),a=Bh._parse(this._primary_window_exists_storage_key);o&&!a?this._windowId=o:Bh._remove(this._window_id_storage_key),Bh._set(this._primary_window_exists_storage_key,!0)}if(null!=(i=this._config.bootstrap)&&i.sessionID)try{var l=(e=>{var t=e.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._config.bootstrap.sessionID);this._setSessionId(this._config.bootstrap.sessionID,(new Date).getTime(),l)}catch(e){hv.error("Invalid sessionID in bootstrap",e)}this._listenToReloadWindow()}get sessionTimeoutMs(){return this._sessionTimeoutMs}onSessionId(e){return ei(this._sessionIdChangedHandlers)&&(this._sessionIdChangedHandlers=[]),this._sessionIdChangedHandlers.push(e),this._sessionId&&e(this._sessionId,this._windowId),()=>{this._sessionIdChangedHandlers=this._sessionIdChangedHandlers.filter((t=>t!==e))}}_canUseSessionStorage(){return"memory"!==this._config.persistence&&!this._persistence._disabled&&Bh._is_supported()}_setWindowId(e){e!==this._windowId&&(this._windowId=e,this._canUseSessionStorage()&&Bh._set(this._window_id_storage_key,e))}_getWindowId(){return this._windowId?this._windowId:this._canUseSessionStorage()?Bh._parse(this._window_id_storage_key):null}_setSessionId(e,t,r){e===this._sessionId&&t===this._sessionActivityTimestamp&&r===this._sessionStartTimestamp||(this._sessionStartTimestamp=r,this._sessionActivityTimestamp=t,this._sessionId=e,this._persistence.register({[Ws]:[t,e,r]}))}_getSessionId(){var e=this._persistence.props[Ws];return Yr(e)&&2===e.length&&e.push(e[0]),e||[0,null,0]}resetSessionId(){this._setSessionId(null,null,null)}destroy(){clearTimeout(this._enforceIdleTimeout),this._enforceIdleTimeout=void 0,this._beforeUnloadListener&&zn&&(zn.removeEventListener("beforeunload",this._beforeUnloadListener,{capture:!1}),this._beforeUnloadListener=void 0),this._sessionIdChangedHandlers=[]}_listenToReloadWindow(){this._beforeUnloadListener=()=>{this._canUseSessionStorage()&&Bh._remove(this._primary_window_exists_storage_key)},Cs(zn,"beforeunload",this._beforeUnloadListener,{capture:!1})}checkAndGetSessionAndWindowId(e,t){if(void 0===e&&(e=!1),void 0===t&&(t=null),"always"===this._config.cookieless_mode)throw new Error('checkAndGetSessionAndWindowId should not be called with cookieless_mode="always"');var r=t||(new Date).getTime(),[i,n,s]=this._getSessionId(),o=this._getWindowId(),a=si(s)&&s>0&&Math.abs(r-s)>864e5,l=!1,u=!n,c=!u&&!e&&this._sessionHasBeenIdleTooLong(r,i);u||c||a?(n=this._sessionIdGenerator(),o=this._windowIdGenerator(),hv.info("new session ID generated",{sessionId:n,windowId:o,changeReason:{noSessionId:u,activityTimeout:c,sessionPastMaximumLength:a}}),s=r,l=!0):o||(o=this._windowIdGenerator(),l=!0);var d=0===i||!e||a?r:i,h=0===s?(new Date).getTime():s;return this._setWindowId(o),this._setSessionId(n,d,h),e||this._resetIdleTimer(),l&&this._sessionIdChangedHandlers.forEach((e=>e(n,o,l?{noSessionId:u,activityTimeout:c,sessionPastMaximumLength:a}:void 0))),{sessionId:n,windowId:o,sessionStartTimestamp:h,changeReason:l?{noSessionId:u,activityTimeout:c,sessionPastMaximumLength:a}:void 0,lastActivityTimestamp:i}}_resetIdleTimer(){clearTimeout(this._enforceIdleTimeout),this._enforceIdleTimeout=setTimeout((()=>{var[e]=this._getSessionId();if(this._sessionHasBeenIdleTooLong((new Date).getTime(),e)){var t=this._sessionId;this.resetSessionId(),this._eventEmitter.emit("forcedIdleReset",{idleSessionId:t})}}),1.1*this.sessionTimeoutMs)}}var vv=["$set_once","$set"],gv=us("[SiteApps]");class _v{constructor(e){this._instance=e,this._bufferedInvocations=[],this.apps={}}get isEnabled(){return!!this._instance.config.opt_in_site_apps}_eventCollector(e,t){if(t){var r=this.globalsForEvent(t);this._bufferedInvocations.push(r),this._bufferedInvocations.length>1e3&&(this._bufferedInvocations=this._bufferedInvocations.slice(10))}}get siteAppLoaders(){var e;return null==(e=is._POSTHOG_REMOTE_CONFIG)||null==(e=e[this._instance.config.token])?void 0:e.siteApps}init(){if(this.isEnabled){var e=this._instance._addCaptureHook(this._eventCollector.bind(this));this._stopBuffering=()=>{e(),this._bufferedInvocations=[],this._stopBuffering=void 0}}}globalsForEvent(e){var t,n,s,o,a,l,u;if(!e)throw new Error("Event payload is required");var c={},d=this._instance.get_property("$groups")||[],h=this._instance.get_property("$stored_group_properties")||{};for(var[p,v]of Object.entries(h))c[p]={id:d[p],type:p,properties:v};var{$set_once:g,$set:_}=e;return{event:r({},i(e,vv),{properties:r({},e.properties,_?{$set:r({},null!==(t=null==(n=e.properties)?void 0:n.$set)&&void 0!==t?t:{},_)}:{},g?{$set_once:r({},null!==(s=null==(o=e.properties)?void 0:o.$set_once)&&void 0!==s?s:{},g)}:{}),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:c}}setupSiteApp(e){var t=this.apps[e.id],r=()=>{var r;(!t.errored&&this._bufferedInvocations.length&&(gv.info("Processing "+this._bufferedInvocations.length+" events for site app with id "+e.id),this._bufferedInvocations.forEach((e=>null==t.processEvent?void 0:t.processEvent(e))),t.processedBuffer=!0),Object.values(this.apps).every((e=>e.processedBuffer||e.errored)))&&(null==(r=this._stopBuffering)||r.call(this))},i=!1,n=n=>{t.errored=!n,t.loaded=!0,gv.info("Site app with id "+e.id+" "+(n?"loaded":"errored")),i&&r()};try{var{processEvent:s}=e.init({posthog:this._instance,callback:e=>{n(e)}});s&&(t.processEvent=s),i=!0}catch(t){gv.error("Error while initializing PostHog app with config id "+e.id,t),n(!1)}if(i&&t.loaded)try{r()}catch(r){gv.error("Error while processing buffered events PostHog app with config id "+e.id,r),t.errored=!0}}_setupSiteApps(){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)}_onCapturedEvent(e){if(0!==Object.keys(this.apps).length){var t=this.globalsForEvent(e);for(var r of Object.values(this.apps))try{null==r.processEvent||r.processEvent(t)}catch(t){gv.error("Error while processing event "+e.event+" for site app "+r.id,t)}}}onRemoteConfig(e){var t,r,i,n=this;if(null!=(t=this.siteAppLoaders)&&t.length)return this.isEnabled?(this._setupSiteApps(),void this._instance.on("eventCaptured",(e=>this._onCapturedEvent(e)))):void gv.error('PostHog site apps are disabled. Enable the "opt_in_site_apps" config to proceed.');if(null==(r=this._stopBuffering)||r.call(this),null!=(i=e.siteApps)&&i.length)if(this.isEnabled){var s=function(e){var t;is["__$$ph_site_app_"+e]=n._instance,null==(t=is.__PosthogExtensions__)||null==t.loadSiteApp||t.loadSiteApp(n._instance,a,(t=>{if(t)return gv.error("Error while initializing PostHog app with config id "+e,t)}))};for(var{id:o,url:a}of e.siteApps)s(o)}else gv.error('PostHog site apps are disabled. Enable the "opt_in_site_apps" config to proceed.')}}var fv=function(e,t){if(!e)return!1;var r=e.userAgent;if(r&&Br(r,t))return!0;try{var i=null==e?void 0:e.userAgentData;if(null!=i&&i.brands&&i.brands.some((e=>Br(null==e?void 0:e.brand,t))))return!0}catch(e){}return!!e.webdriver},mv=function(e){return e.US="us",e.EU="eu",e.CUSTOM="custom",e}({}),yv="i.posthog.com";class bv{constructor(e){this._regionCache={},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("."+yv,".posthog.com")),"https://app.posthog.com"===t?"https://us.posthog.com":t}get region(){return this._regionCache[this.apiHost]||(/https:\/\/(app|us|us-assets)(\.i)?\.posthog\.com/i.test(this.apiHost)?this._regionCache[this.apiHost]=mv.US:/https:\/\/(eu|eu-assets)(\.i)?\.posthog\.com/i.test(this.apiHost)?this._regionCache[this.apiHost]=mv.EU:this._regionCache[this.apiHost]=mv.CUSTOM),this._regionCache[this.apiHost]}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(this.region===mv.CUSTOM)return this.apiHost+t;var r=yv+t;switch(e){case"assets":return"https://"+this.region+"-assets."+r;case"api":return"https://"+this.region+"."+r}}}var Sv={icontains:(e,t)=>!!zn&&t.href.toLowerCase().indexOf(e.toLowerCase())>-1,not_icontains:(e,t)=>!!zn&&-1===t.href.toLowerCase().indexOf(e.toLowerCase()),regex:(e,t)=>!!zn&&qu(t.href,e),not_regex:(e,t)=>!!zn&&!qu(t.href,e),exact:(e,t)=>t.href===e,is_not:(e,t)=>t.href!==e};class wv{constructor(e){var t=this;this.getWebExperimentsAndEvaluateDisplayLogic=function(e){void 0===e&&(e=!1),t.getWebExperiments((e=>{wv._logInfo("retrieved web experiments from the server"),t._flagToExperiments=new Map,e.forEach((e=>{if(e.feature_flag_key){var r;if(t._flagToExperiments)wv._logInfo("setting flag key ",e.feature_flag_key," to web experiment ",e),null==(r=t._flagToExperiments)||r.set(e.feature_flag_key,e);var i=t._instance.getFeatureFlag(e.feature_flag_key);ti(i)&&e.variants[i]&&t._applyTransforms(e.name,i,e.variants[i].transforms)}else if(e.variants)for(var n in e.variants){var s=e.variants[n];wv._matchesTestVariant(s)&&t._applyTransforms(e.name,n,s.transforms)}}))}),e)},this._instance=e,this._instance.onFeatureFlags((e=>{this.onFeatureFlags(e)}))}onFeatureFlags(e){if(this._is_bot())wv._logInfo("Refusing to render web experiment since the viewer is a likely bot");else if(!this._instance.config.disable_web_experiments){if(ni(this._flagToExperiments))return this._flagToExperiments=new Map,this.loadIfEnabled(),void this.previewWebExperiment();wv._logInfo("applying feature flags",e),e.forEach((e=>{var t;if(this._flagToExperiments&&null!=(t=this._flagToExperiments)&&t.has(e)){var r,i=this._instance.getFeatureFlag(e),n=null==(r=this._flagToExperiments)?void 0:r.get(e);i&&null!=n&&n.variants[i]&&this._applyTransforms(n.name,i,n.variants[i].transforms)}}))}}previewWebExperiment(){var e=wv.getWindowLocation();if(null!=e&&e.search){var t=Es(null==e?void 0:e.search,"__experiment_id"),r=Es(null==e?void 0:e.search,"__experiment_variant");t&&r&&(wv._logInfo("previewing web experiments "+t+" && "+r),this.getWebExperiments((e=>{this._showPreviewWebExperiment(parseInt(t),r,e)}),!1,!0))}}loadIfEnabled(){this._instance.config.disable_web_experiments||this.getWebExperimentsAndEvaluateDisplayLogic()}getWebExperiments(e,t,r){if(this._instance.config.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._instance.config.token),method:"GET",callback:t=>{if(200!==t.statusCode||!t.json)return e([]);var r=t.json.experiments||[];return e(r)}})}_showPreviewWebExperiment(e,t,r){var i=r.filter((t=>t.id===e));i&&i.length>0&&(wv._logInfo("Previewing web experiment ["+i[0].name+"] with variant ["+t+"]"),this._applyTransforms(i[0].name,t,i[0].variants[t].transforms))}static _matchesTestVariant(e){return!ni(e.conditions)&&(wv._matchUrlConditions(e)&&wv._matchUTMConditions(e))}static _matchUrlConditions(e){var t;if(ni(e.conditions)||ni(null==(t=e.conditions)?void 0:t.url))return!0;var r,i,n,s=wv.getWindowLocation();return!!s&&(null==(r=e.conditions)||!r.url||Sv[null!==(i=null==(n=e.conditions)?void 0:n.urlMatchType)&&void 0!==i?i:"icontains"](e.conditions.url,s))}static getWindowLocation(){return null==zn?void 0:zn.location}static _matchUTMConditions(e){var t;if(ni(e.conditions)||ni(null==(t=e.conditions)?void 0:t.utm))return!0;var r=pp();if(r.utm_source){var i,n,s,o,a,l,u,c,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,h=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,p=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,v=null==(u=e.conditions)||null==(u=u.utm)||!u.utm_term||(null==(c=e.conditions)||null==(c=c.utm)?void 0:c.utm_term)==r.utm_term;return d&&p&&v&&h}return!1}static _logInfo(e){for(var t=arguments.length,r=new Array(t>1?t-1:0),i=1;i<t;i++)r[i-1]=arguments[i];ls.info("[WebExperiments] "+e,r)}_applyTransforms(e,t,r){this._is_bot()?wv._logInfo("Refusing to render web experiment since the viewer is a likely bot"):"control"!==t?r.forEach((r=>{if(r.selector){var i;wv._logInfo("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)}))}})):wv._logInfo("Control variants leave the page unmodified.")}_is_bot(){return Xn&&this._instance?fv(Xn,this._instance.config.custom_blocked_useragents):void 0}}var Cv=us("[PostHog ExternalIntegrations]"),Iv={intercom:"intercom-integration",crispChat:"crisp-chat-integration"};class kv{constructor(e){this._instance=e}_loadScript(e,t){var r;null==(r=is.__PosthogExtensions__)||null==r.loadExternalDependency||r.loadExternalDependency(this._instance,e,(e=>{if(e)return Cv.error("failed to load script",e);t()}))}startIfEnabledOrStop(){var e=this,t=function(t){var r,n,s;(!i||null!=(r=is.__PosthogExtensions__)&&null!=(r=r.integrations)&&r[t]||e._loadScript(Iv[t],(()=>{var r;null==(r=is.__PosthogExtensions__)||null==(r=r.integrations)||null==(r=r[t])||r.start(e._instance)})),!i&&null!=(n=is.__PosthogExtensions__)&&null!=(n=n.integrations)&&n[t])&&(null==(s=is.__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 Ev="[SessionRecording]",xv=us(Ev);class Tv{get started(){var e;return!(null==(e=this._lazyLoadedSessionRecording)||!e.isStarted)}get status(){return this._lazyLoadedSessionRecording?this._lazyLoadedSessionRecording.status:this._receivedFlags&&!this._isRecordingEnabled?"disabled":"lazy_loading"}constructor(e){if(this._forceAllowLocalhostNetworkCapture=!1,this._receivedFlags=!1,this._persistFlagsOnSessionListener=void 0,this._instance=e,!this._instance.sessionManager)throw xv.error("started without valid sessionManager"),new Error(Ev+" started without valid sessionManager. This is a bug.");if("always"===this._instance.config.cookieless_mode)throw new Error(Ev+' cannot be used with cookieless_mode="always"')}get _isRecordingEnabled(){var e,t=!(null==(e=this._instance.get_property(Us))||!e.enabled),r=!this._instance.config.disable_session_recording,i=this._instance.config.disable_session_recording||this._instance.consent.isOptedOut();return zn&&t&&r&&!i}startIfEnabledOrStop(e){var t;if(!this._isRecordingEnabled||null==(t=this._lazyLoadedSessionRecording)||!t.isStarted){var r=!ei(Object.assign)&&!ei(Array.from);this._isRecordingEnabled&&r?(this._lazyLoadAndStart(e),xv.info("starting")):this.stopRecording()}}_lazyLoadAndStart(e){var t,r,i;this._isRecordingEnabled&&(null!=is&&null!=(t=is.__PosthogExtensions__)&&null!=(t=t.rrweb)&&t.record&&null!=(r=is.__PosthogExtensions__)&&r.initSessionRecording?this._onScriptLoaded(e):null==(i=is.__PosthogExtensions__)||null==i.loadExternalDependency||i.loadExternalDependency(this._instance,this._scriptName,(t=>{if(t)return xv.error("could not load recorder",t);this._onScriptLoaded(e)})))}stopRecording(){var e,t;null==(e=this._persistFlagsOnSessionListener)||e.call(this),this._persistFlagsOnSessionListener=void 0,null==(t=this._lazyLoadedSessionRecording)||t.stop()}_resetSampling(){var e;null==(e=this._instance.persistence)||e.unregister(zs)}_persistRemoteConfig(e){if(this._instance.persistence){var t,i,n=this._instance.persistence,s=()=>{var t=!1===e.sessionRecording?void 0:e.sessionRecording,i=null==t?void 0:t.sampleRate,s=ni(i)?null:parseFloat(i);ni(s)&&this._resetSampling();var o=null==t?void 0:t.minimumDurationMilliseconds;n.register({[Us]:r({enabled:!!t},t,{networkPayloadCapture:r({capturePerformance:e.capturePerformance},null==t?void 0:t.networkPayloadCapture),canvasRecording:{enabled:null==t?void 0:t.recordCanvas,fps:null==t?void 0:t.canvasFps,quality:null==t?void 0:t.canvasQuality},sampleRate:s,minimumDurationMilliseconds:ei(o)?null:o,endpoint:null==t?void 0:t.endpoint,triggerMatchType:null==t?void 0:t.triggerMatchType,masking:null==t?void 0:t.masking,urlTriggers:null==t?void 0:t.urlTriggers})})};s(),null==(t=this._persistFlagsOnSessionListener)||t.call(this),this._persistFlagsOnSessionListener=null==(i=this._instance.sessionManager)?void 0:i.onSessionId(s)}}onRemoteConfig(e){"sessionRecording"in e?!1!==e.sessionRecording?(this._persistRemoteConfig(e),this._receivedFlags=!0,this.startIfEnabledOrStop()):this._receivedFlags=!0:xv.info("skipping remote config with no sessionRecording",e)}log(e,t){var r;void 0===t&&(t="log"),null!=(r=this._lazyLoadedSessionRecording)&&r.log?this._lazyLoadedSessionRecording.log(e,t):xv.warn("log called before recorder was ready")}get _scriptName(){var e,t,r=null==(e=this._instance)||null==(e=e.persistence)?void 0:e.get_property(Us);return(null==r||null==(t=r.scriptConfig)?void 0:t.script)||"lazy-recorder"}_onScriptLoaded(e){var t,r;if(null==(t=is.__PosthogExtensions__)||!t.initSessionRecording)throw Error("Called on script loaded before session recording is available");this._lazyLoadedSessionRecording||(this._lazyLoadedSessionRecording=null==(r=is.__PosthogExtensions__)?void 0:r.initSessionRecording(this._instance),this._lazyLoadedSessionRecording._forceAllowLocalhostNetworkCapture=this._forceAllowLocalhostNetworkCapture);this._lazyLoadedSessionRecording.start(e)}onRRwebEmit(e){var t;null==(t=this._lazyLoadedSessionRecording)||null==t.onRRwebEmit||t.onRRwebEmit(e)}overrideLinkedFlag(){var e,t;this._lazyLoadedSessionRecording||(null==(t=this._instance.persistence)||t.register({$replay_override_linked_flag:!0}));null==(e=this._lazyLoadedSessionRecording)||e.overrideLinkedFlag()}overrideSampling(){var e,t;this._lazyLoadedSessionRecording||(null==(t=this._instance.persistence)||t.register({$replay_override_sampling:!0}));null==(e=this._lazyLoadedSessionRecording)||e.overrideSampling()}overrideTrigger(e){var t,r;this._lazyLoadedSessionRecording||(null==(r=this._instance.persistence)||r.register({["url"===e?"$replay_override_url_trigger":"$replay_override_event_trigger"]:!0}));null==(t=this._lazyLoadedSessionRecording)||t.overrideTrigger(e)}get sdkDebugProperties(){var e;return(null==(e=this._lazyLoadedSessionRecording)?void 0:e.sdkDebugProperties)||{$recording_status:this.status}}tryAddCustomEvent(e,t){var r;return!(null==(r=this._lazyLoadedSessionRecording)||!r.tryAddCustomEvent(e,t))}}var Mv={},Rv=()=>{},Pv="posthog",Av=!Nu&&-1===(null==rs?void 0:rs.indexOf("MSIE"))&&-1===(null==rs?void 0:rs.indexOf("Mozilla")),Nv=e=>{var t;return r({api_host:"https://us.i.posthog.com",flags_api_host:null,ui_host:null,token:"",autocapture:!0,cross_subdomain_cookie:Ss(null==Kn?void 0:Kn.location),persistence:"localStorage+cookie",persistence_name:"",loaded:Rv,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,debug:Jn&&ti(null==Jn?void 0:Jn.search)&&-1!==Jn.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:!0,disable_external_dependency_loading:!1,enable_recording_console_log:void 0,secure_cookie:"https:"===(null==zn||null==(t=zn.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_enable_surveys:!1,advanced_disable_toolbar_metrics:!1,feature_flag_request_timeout_ms:3e3,surveys_request_timeout_ms:1e4,on_request_error:e=>{var t="Bad HTTP status: "+e.statusCode+" "+e.text;ls.error(t)},get_device_id:e=>e,capture_performance:void 0,name:"posthog",bootstrap:{},disable_compression:!1,session_idle_timeout_seconds:1800,person_profiles:"identified_only",before_send:void 0,request_queue_config:{flush_interval_ms:sv},error_tracking:{},_onCapture:Rv,__preview_eager_load_replay:!1},(e=>({rageclick:!(e&&e>="2025-11-30")||{content_ignorelist:!0},capture_pageview:!(e&&e>="2025-05-24")||"history_change",session_recording:e&&e>="2025-11-30"?{strictMinimumDuration:!0}:{}}))(e))},Fv=e=>{var t={};ei(e.process_person)||(t.person_profiles=e.process_person),ei(e.xhr_headers)||(t.request_headers=e.xhr_headers),ei(e.cookie_name)||(t.persistence_name=e.cookie_name),ei(e.disable_cookie)||(t.disable_persistence=e.disable_cookie),ei(e.store_google)||(t.save_campaign_params=e.store_google),ei(e.verbose)||(t.debug=e.verbose);var r=ps({},t,e);return Yr(e.property_blacklist)&&(ei(e.property_denylist)?r.property_denylist=e.property_blacklist:Yr(e.property_denylist)?r.property_denylist=[...e.property_blacklist,...e.property_denylist]:ls.error("Invalid value for property_denylist config: "+e.property_denylist)),r};class Lv{constructor(){this.__forceAllowLocalhost=!1}get _forceAllowLocalhost(){return this.__forceAllowLocalhost}set _forceAllowLocalhost(e){ls.error("WebPerformanceObserver is deprecated and has no impact on network capture. Use `_forceAllowLocalhostNetworkCapture` on `posthog.sessionRecording`"),this.__forceAllowLocalhost=e}}class Ov{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(){this.webPerformance=new Lv,this._personProcessingSetOncePropertiesSent=!1,this.version=os.LIB_VERSION,this._internalEventEmitter=new Zp,this._calculate_event_properties=this.calculateEventProperties.bind(this),this.config=Nv(),this.SentryIntegration=ep,this.sentryIntegration=e=>function(e,t){var r=Qh(e,t);return{name:Jh,processEvent:e=>r(e)}}(this,e),this.__request_queue=[],this.__loaded=!1,this.analyticsDefaultEndpoint="/e/",this._initialPageviewCaptured=!1,this._visibilityStateListener=null,this._initialPersonProfilesConfig=null,this._cachedPersonProperties=null,this.featureFlags=new Vp(this),this.toolbar=new sp(this),this.scrollManager=new uv(this),this.pageViewManager=new Mp(this),this.surveys=new Jp(this),this.conversations=new ev(this),this.experiments=new wv(this),this.exceptions=new pd(this),this.rateLimiter=new rv(this),this.requestRouter=new bv(this),this.consent=new $h(this),this.externalIntegrations=new kv(this),this.people={set:(e,t,r)=>{var i=ti(e)?{[e]:t}:e;this.setPersonProperties(i),null==r||r({})},set_once:(e,t,r)=>{var i=ti(e)?{[e]:t}:e;this.setPersonProperties(void 0,i),null==r||r({})}},this.on("eventCaptured",(e=>ls.info('send "'+(null==e?void 0:e.event)+'"',e)))}init(e,t,r){if(r&&r!==Pv){var i,n=null!==(i=Mv[r])&&void 0!==i?i:new Ov;return n._init(e,t,r),Mv[r]=n,Mv[Pv][r]=n,n}return this._init(e,t,r)}_init(e,t,i){var n;if(void 0===t&&(t={}),ei(e)||ri(e))return ls.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._checkLocalStorageForDebug(t.debug),this._originalUserConfig=t,this._triggered_notifs=[],t.person_profiles&&(this._initialPersonProfilesConfig=t.person_profiles),this.set_config(ps({},Nv(t.defaults),Fv(t),{name:i,token:e})),this.config.on_xhr_error&&ls.error("on_xhr_error is deprecated. Use on_request_error instead"),this.compression=t.disable_compression?void 0:Xl.GZipJS;var s=this._is_persistence_disabled();this.persistence=new Up(this.config,s),this.sessionPersistence="sessionStorage"===this.config.persistence||"memory"===this.config.persistence?this.persistence:new Up(r({},this.config,{persistence:"sessionStorage"}),s);var o=r({},this.persistence.props),a=r({},this.sessionPersistence.props);this.register({$initialization_time:(new Date).toISOString()}),this._requestQueue=new ov((e=>this._send_retriable_request(e)),this.config.request_queue_config),this._retryQueue=new lv(this),this.__request_queue=[];var l="always"===this.config.cookieless_mode||"on_reject"===this.config.cookieless_mode&&this.consent.isExplicitlyOptedOut();if(l||(this.sessionManager=new pv(this),this.sessionPropsManager=new dv(this,this.sessionManager,this.persistence)),this.config.__preview_deferred_init_extensions?(ls.info("Deferring extension initialization to improve startup performance"),setTimeout((()=>{this._initExtensions(l)}),0)):(ls.info("Initializing extensions synchronously"),this._initExtensions(l)),os.DEBUG=os.DEBUG||this.config.debug,os.DEBUG&&ls.info("Starting in debug mode",{this:this,config:t,thisC:r({},this.config),p:o,s:a}),void 0!==(null==(n=t.bootstrap)?void 0:n.distinctID)){var u,c,d=this.config.get_device_id(Zl()),h=null!=(u=t.bootstrap)&&u.isIdentifiedID?d:t.bootstrap.distinctID;this.persistence.set_property(Qs,null!=(c=t.bootstrap)&&c.isIdentifiedID?"identified":"anonymous"),this.register({distinct_id:t.bootstrap.distinctID,$device_id:h})}if(this._hasBootstrappedFeatureFlags()){var p,v,g=Object.keys((null==(p=t.bootstrap)?void 0:p.featureFlags)||{}).filter((e=>{var r;return!(null==(r=t.bootstrap)||null==(r=r.featureFlags)||!r[e])})).reduce(((e,r)=>{var i;return e[r]=(null==(i=t.bootstrap)||null==(i=i.featureFlags)?void 0:i[r])||!1,e}),{}),_=Object.keys((null==(v=t.bootstrap)?void 0:v.featureFlagPayloads)||{}).filter((e=>g[e])).reduce(((e,r)=>{var i,n;null!=(i=t.bootstrap)&&null!=(i=i.featureFlagPayloads)&&i[r]&&(e[r]=null==(n=t.bootstrap)||null==(n=n.featureFlagPayloads)?void 0:n[r]);return e}),{});this.featureFlags.receivedFeatureFlags({featureFlags:g,featureFlagPayloads:_})}if(l)this.register_once({distinct_id:ao,$device_id:null},"");else if(!this.get_distinct_id()){var f=this.config.get_device_id(Zl());this.register_once({distinct_id:f,$device_id:f},""),this.persistence.set_property(Qs,"anonymous")}return Cs(zn,"onpagehide"in self?"pagehide":"unload",this._handle_unload.bind(this),{passive:!1}),this.toolbar.maybeLoadToolbar(),t.segment?Kh(this,(()=>this._loaded())):this._loaded(),Xr(this.config._onCapture)&&this.config._onCapture!==Rv&&(ls.warn("onCapture is deprecated. Please use `before_send` instead"),this.on("eventCaptured",(e=>this.config._onCapture(e.event,e)))),this.config.ip&&ls.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}_initExtensions(e){var t=performance.now();this.historyAutocapture=new Yh(this),this.historyAutocapture.startIfEnabled();var r=[];r.push((()=>{new ap(this).startIfEnabledOrStop()})),r.push((()=>{var e;this.siteApps=new _v(this),null==(e=this.siteApps)||e.init()})),e||r.push((()=>{this.sessionRecording=new Tv(this),this.sessionRecording.startIfEnabledOrStop()})),this.config.disable_scroll_properties||r.push((()=>{this.scrollManager.startMeasuringScrollPosition()})),r.push((()=>{this.autocapture=new Ih(this),this.autocapture.startIfEnabled()})),r.push((()=>{this.surveys.loadIfEnabled()})),r.push((()=>{this.conversations.loadIfEnabled()})),r.push((()=>{this.productTours=new jp(this),this.productTours.loadIfEnabled()})),r.push((()=>{this.heatmaps=new Tp(this),this.heatmaps.startIfEnabled()})),r.push((()=>{this.webVitalsAutocapture=new kp(this)})),r.push((()=>{this.exceptionObserver=new Gh(this),this.exceptionObserver.startIfEnabledOrStop()})),r.push((()=>{this.deadClicksAutocapture=new jh(this,zh),this.deadClicksAutocapture.startIfEnabled()})),r.push((()=>{if(this._pendingRemoteConfig){var e=this._pendingRemoteConfig;this._pendingRemoteConfig=void 0,this._onRemoteConfig(e)}})),this._processInitTaskQueue(r,t)}_processInitTaskQueue(e,t){for(;e.length>0;){if(this.config.__preview_deferred_init_extensions)if(performance.now()-t>=30&&e.length>0)return void setTimeout((()=>{this._processInitTaskQueue(e,t)}),0);var r=e.shift();if(r)try{r()}catch(e){ls.error("Error initializing extension:",e)}}var i=Math.round(performance.now()-t);this.register_for_session({$sdk_debug_extensions_init_method:this.config.__preview_deferred_init_extensions?"deferred":"synchronous",$sdk_debug_extensions_init_time_ms:i}),this.config.__preview_deferred_init_extensions&&ls.info("PostHog extensions initialized ("+i+"ms)")}_onRemoteConfig(e){var t,r,i,n,s,o,a,l,u;if(!Kn||!Kn.body)return ls.info("document not ready yet, trying again in 500 milliseconds..."),void setTimeout((()=>{this._onRemoteConfig(e)}),500);this.config.__preview_deferred_init_extensions&&(this._pendingRemoteConfig=e),this.compression=void 0,e.supportedCompression&&!this.config.disable_compression&&(this.compression=$r(e.supportedCompression,Xl.GZipJS)?Xl.GZipJS:$r(e.supportedCompression,Xl.Base64)?Xl.Base64:void 0),null!=(t=e.analytics)&&t.endpoint&&(this.analyticsDefaultEndpoint=e.analytics.endpoint),this.set_config({person_profiles:this._initialPersonProfilesConfig?this._initialPersonProfilesConfig:"identified_only"}),null==(r=this.siteApps)||r.onRemoteConfig(e),null==(i=this.sessionRecording)||i.onRemoteConfig(e),null==(n=this.autocapture)||n.onRemoteConfig(e),null==(s=this.heatmaps)||s.onRemoteConfig(e),this.surveys.onRemoteConfig(e),this.conversations.onRemoteConfig(e),null==(o=this.productTours)||o.onRemoteConfig(e),null==(a=this.webVitalsAutocapture)||a.onRemoteConfig(e),null==(l=this.exceptionObserver)||l.onRemoteConfig(e),this.exceptions.onRemoteConfig(e),null==(u=this.deadClicksAutocapture)||u.onRemoteConfig(e)}_loaded(){try{this.config.loaded(this)}catch(e){ls.critical("`loaded` function failed",e)}this._start_queue_if_opted_in(),this.config.capture_pageview&&setTimeout((()=>{(this.consent.isOptedIn()||"always"===this.config.cookieless_mode)&&this._captureInitialPageview()}),1),new nv(this).load(),this.featureFlags.flags()}_start_queue_if_opted_in(){var e;this.is_capturing()&&(this.config.request_batching&&(null==(e=this._requestQueue)||e.enable()))}_dom_loaded(){this.is_capturing()&&ds(this.__request_queue,(e=>this._send_retriable_request(e))),this.__request_queue=[],this._start_queue_if_opted_in()}_handle_unload(){var e,t;this.surveys.handlePageUnload(),this.config.request_batching?(this._shouldCapturePageleave()&&this.capture("$pageleave"),null==(e=this._requestQueue)||e.unload(),null==(t=this._retryQueue)||t.unload()):this._shouldCapturePageleave()&&this.capture("$pageleave",null,{transport:"sendBeacon"})}_send_request(e){this.__loaded&&(Av?this.__request_queue.push(e):this.rateLimiter.isServerRateLimited(e.batchKey)||(e.transport=e.transport||this.config.api_transport,e.url=Lu(e.url,{ip:this.config.ip?1:0}),e.headers=r({},this.config.request_headers,e.headers),e.compression="best-available"===e.compression?this.compression:e.compression,e.disableXHRCredentials=this.config.__preview_disable_xhr_credentials,this.config.__preview_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=Lu(s.url,{_:(new Date).getTime().toString(),ver:os.LIB_VERSION,compression:s.compression});var o=null!==(t=s.transport)&&void 0!==t?t:"fetch",a=Hu.filter((e=>!s.disableTransport||!e.transport||!s.disableTransport.includes(e.transport))),l=null!==(i=null==(n=ws(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");l(s)})(r({},e,{callback:t=>{var r,i;(this.rateLimiter.checkForLimiting(t),t.statusCode>=400)&&(null==(r=(i=this.config).on_request_error)||r.call(i,t));null==e.callback||e.callback(t)}}))))}_send_retriable_request(e){this._retryQueue?this._retryQueue.retriableRequest(e):this._send_request(e)}_execute_array(e){var t,r=[],i=[],n=[];ds(e,(e=>{e&&(t=e[0],Yr(t)?n.push(e):Xr(e)?e.call(this):Yr(e)&&"alias"===t?r.push(e):Yr(e)&&-1!==t.indexOf("capture")&&Xr(this[t])?n.push(e):i.push(e))}));var s=function(e,t){ds(e,(function(e){if(Yr(e[0])){var r=t;hs(e,(function(e){r=r[e[0]].apply(r,e.slice(1))}))}else this[e[0]].apply(this,e.slice(1))}),t)};s(r,this),s(i,this),s(n,this)}_hasBootstrappedFeatureFlags(){var e,t;return(null==(e=this.config.bootstrap)?void 0:e.featureFlags)&&Object.keys(null==(t=this.config.bootstrap)?void 0:t.featureFlags).length>0||!1}push(e){this._execute_array([e])}capture(e,t,i){var n;if(this.__loaded&&this.persistence&&this.sessionPersistence&&this._requestQueue){if(this.is_capturing())if(!ei(e)&&ti(e)){var s=!this.config.opt_out_useragent_filter&&this._is_bot();if(!(s&&!this.config.__preview_capture_bot_pageviews)){var o=null!=i&&i.skip_client_rate_limiting?void 0:this.rateLimiter.clientRateLimitContext();if(null==o||!o.isRateLimited){null!=t&&t.$current_url&&!ti(null==t?void 0:t.$current_url)&&(ls.error("Invalid `$current_url` property provided to `posthog.capture`. Input must be a string. Ignoring provided value."),null==t||delete t.$current_url),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 a=new Date,l=(null==i?void 0:i.timestamp)||a,u=Zl(),c={uuid:u,event:e,properties:this.calculateEventProperties(e,t||{},l,u)};"$pageview"===e&&this.config.__preview_capture_bot_pageviews&&s&&(c.event="$bot_pageview",c.properties.$browser_type="bot"),o&&(c.properties.$lib_rate_limit_remaining_tokens=o.remainingTokens),(null==i?void 0:i.$set)&&(c.$set=null==i?void 0:i.$set);var d="$groupidentify"!==e,h=this._calculate_set_once_properties(null==i?void 0:i.$set_once,d);if(h&&(c.$set_once=h),(c=ys(c,null!=i&&i._noTruncate?null:this.config.properties_string_max_length)).timestamp=l,ei(null==i?void 0:i.timestamp)||(c.properties.$event_time_override_provided=!0,c.properties.$event_time_override_system_time=a),e===El.DISMISSED||e===El.SENT){var p=null==t?void 0:t[xl.SURVEY_ID],v=null==t?void 0:t[xl.SURVEY_ITERATION];Hl({id:p,current_iteration:v}),c.$set=r({},c.$set,{[Ll({id:p,current_iteration:v},e===El.SENT?"responded":"dismissed")]:!0})}var g=r({},c.properties.$set,c.$set);if(Qr(g)||this.setPersonPropertiesForFlags(g),!ni(this.config.before_send)){var _=this._runBeforeSend(c);if(!_)return;c=_}this._internalEventEmitter.emit("eventCaptured",c);var f={method:"POST",url:null!==(n=null==i?void 0:i._url)&&void 0!==n?n:this.requestRouter.endpointFor("api",this.analyticsDefaultEndpoint),data:c,compression:"best-available",batchKey:null==i?void 0:i._batchKey};return!this.config.request_batching||i&&(null==i||!i._batchKey)||null!=i&&i.send_instantly?this._send_retriable_request(f):this._requestQueue.enqueue(f),c}ls.critical("This capture call is ignored due to client rate limiting.")}}else ls.error("No event name provided to posthog.capture")}else ls.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,("always"==this.config.cookieless_mode||"on_reject"==this.config.cookieless_mode&&this.consent.isExplicitlyOptedOut())&&(a.$cookieless_mode=!0),"$snapshot"===e){var l=r({},this.persistence.properties(),this.sessionPersistence.properties());return a.distinct_id=l.distinct_id,(!ti(a.distinct_id)&&!si(a.distinct_id)||ri(a.distinct_id))&&ls.error("Invalid distinct_id for replay event. This indicates a bug in your implementation"),a}var u,c=wp(this.config.mask_personal_data_properties,this.config.custom_personal_data_properties);if(this.sessionManager){var{sessionId:d,windowId:h}=this.sessionManager.checkAndGetSessionAndWindowId(s,i.getTime());a.$session_id=d,a.$window_id=h}this.sessionPropsManager&&ps(a,this.sessionPropsManager.getSessionProps());try{var p;this.sessionRecording&&ps(a,this.sessionRecording.sdkDebugProperties),a.$sdk_debug_retry_queue_size=null==(p=this._retryQueue)?void 0:p.length}catch(e){a.$sdk_debug_error_capturing_properties=String(e)}if(this.requestRouter.region===mv.CUSTOM&&(a.$lib_custom_api_host=this.config.api_host),u="$pageview"!==e||s?"$pageleave"!==e||s?this.pageViewManager.doEvent():this.pageViewManager.doPageLeave(i):this.pageViewManager.doPageView(i,n),a=ps(a,u),"$pageview"===e&&Kn&&(a.title=Kn.title),!ei(o)){var v=i.getTime()-o;a.$duration=parseFloat((v/1e3).toFixed(3))}rs&&this.config.opt_out_useragent_filter&&(a.$browser_type=this._is_bot()?"bot":"browser"),(a=ps({},c,this.persistence.properties(),this.sessionPersistence.properties(),a)).$is_identified=this._isIdentified(),Yr(this.config.property_denylist)?hs(this.config.property_denylist,(function(e){delete a[e]})):ls.error("Invalid value for property_denylist config: "+this.config.property_denylist+" or property_blacklist config: "+this.config.property_blacklist);var g=this.config.sanitize_properties;g&&(ls.error("sanitize_properties is deprecated. Use before_send instead"),a=g(a,e));var _=this._hasPersonProcessing();return a.$process_person_profile=_,_&&!s&&this._requirePersonProcessing("_calculate_event_properties"),a}_calculate_set_once_properties(e,t){var r;if(void 0===t&&(t=!0),!this.persistence||!this._hasPersonProcessing())return e;if(this._personProcessingSetOncePropertiesSent)return e;var i=this.persistence.get_initial_props(),n=null==(r=this.sessionPropsManager)?void 0:r.getSetOnceProps(),s=ps({},i,n||{},e||{}),o=this.config.sanitize_properties;return o&&(ls.error("sanitize_properties is deprecated. Use before_send instead"),s=o(s,"$set_once")),t&&(this._personProcessingSetOncePropertiesSent=!0),Qr(s)?void 0:s}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)}_register_single(e,t){this.register({[e]:t})}getFeatureFlag(e,t){return this.featureFlags.getFeatureFlag(e,t)}getFeatureFlagPayload(e){var t=this.featureFlags.getFeatureFlagPayload(e);try{return JSON.parse(t)}catch(e){return t}}isFeatureEnabled(e,t){return this.featureFlags.isFeatureEnabled(e,t)}reloadFeatureFlags(){this.featureFlags.reloadFeatureFlags()}updateFlags(e,t,i){var n=null!=i&&i.merge?this.featureFlags.getFlagVariants():{},s=null!=i&&i.merge?this.featureFlags.getFlagPayloads():{},o=r({},n,e),a=r({},s,t),l={};for(var[u,c]of Object.entries(o)){var d="string"==typeof c;l[u]={key:u,enabled:!!d||Boolean(c),variant:d?c:void 0,reason:void 0,metadata:ei(null==a?void 0:a[u])?void 0:{id:0,version:void 0,description:void 0,payload:a[u]}}}this.featureFlags.receivedFeatureFlags({flags:l})}updateEarlyAccessFeatureEnrollment(e,t,r){this.featureFlags.updateEarlyAccessFeatureEnrollment(e,t,r)}getEarlyAccessFeatures(e,t,r){return void 0===t&&(t=!1),this.featureFlags.getEarlyAccessFeatures(e,t,r)}on(e,t){return this._internalEventEmitter.on(e,t)}onFeatureFlags(e){return this.featureFlags.onFeatureFlags(e)}onSurveysLoaded(e){return this.surveys.onSurveysLoaded(e)}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.getSurveys(e,t)}getActiveMatchingSurveys(e,t){void 0===t&&(t=!1),this.surveys.getActiveMatchingSurveys(e,t)}renderSurvey(e,t){this.surveys.renderSurvey(e,t)}displaySurvey(e,t){void 0===t&&(t=Bl),this.surveys.displaySurvey(e,t)}cancelPendingSurvey(e){this.surveys.cancelPendingSurvey(e)}canRenderSurvey(e){return this.surveys.canRenderSurvey(e)}canRenderSurveyAsync(e,t){return void 0===t&&(t=!1),this.surveys.canRenderSurveyAsync(e,t)}identify(e,t,i){if(!this.__loaded||!this.persistence)return ls.uninitializedWarning("posthog.identify");if(si(e)&&(e=e.toString(),ls.warn("The first argument to posthog.identify was a number, but it should be a string. It has been converted to a string.")),e)if(["distinct_id","distinctid"].includes(e.toLowerCase()))ls.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.');else if(e!==ao){if(this._requirePersonProcessing("posthog.identify")){var n=this.get_distinct_id();if(this.register({$user_id:e}),!this.get_property("$device_id")){var s=n;this.register_once({$had_persisted_distinct_id:!0,$device_id:s},"")}e!==n&&e!==this.get_property(As)&&(this.unregister(As),this.register({distinct_id:e}));var o="anonymous"===(this.persistence.get_property(Qs)||"anonymous");e!==n&&o?(this.persistence.set_property(Qs,"identified"),this.setPersonPropertiesForFlags(r({},i||{},t||{}),!1),this.capture("$identify",{distinct_id:e,$anon_distinct_id:n},{$set:t||{},$set_once:i||{}}),this._cachedPersonProperties=Bu(e,t,i),this.featureFlags.setAnonymousDistinctId(n)):(t||i)&&this.setPersonProperties(t,i),e!==n&&(this.reloadFeatureFlags(),this.unregister(Js))}}else ls.critical('The string "'+ao+'" was set in posthog.identify which indicates an error. This ID is only used as a sentinel value.');else ls.error("Unique user id has not been set in posthog.identify")}setPersonProperties(e,t){if((e||t)&&this._requirePersonProcessing("posthog.setPersonProperties")){var i=Bu(this.get_distinct_id(),e,t);this._cachedPersonProperties!==i?(this.setPersonPropertiesForFlags(r({},t||{},e||{})),this.capture("$set",{$set:e||{},$set_once:t||{}}),this._cachedPersonProperties=i):ls.info("A duplicate setPersonProperties call was made with the same properties. It has been ignored.")}}group(e,t,i){if(e&&t){var n=this.getGroups();n[e]!==t&&this.resetGroupPropertiesForFlags(e),this.register({$groups:r({},n,{[e]:t})}),i&&(this.capture("$groupidentify",{$group_type:e,$group_key:t,$group_set:i}),this.setGroupPropertiesForFlags({[e]:i})),n[e]===t||i||this.reloadFeatureFlags()}else ls.error("posthog.group requires a group type and group key")}resetGroups(){this.register({$groups:{}}),this.resetGroupPropertiesForFlags(),this.reloadFeatureFlags()}setPersonPropertiesForFlags(e,t){void 0===t&&(t=!0),this.featureFlags.setPersonPropertiesForFlags(e,t)}resetPersonPropertiesForFlags(){this.featureFlags.resetPersonPropertiesForFlags()}setGroupPropertiesForFlags(e,t){void 0===t&&(t=!0),this._requirePersonProcessing("posthog.setGroupPropertiesForFlags")&&this.featureFlags.setGroupPropertiesForFlags(e,t)}resetGroupPropertiesForFlags(e){this.featureFlags.resetGroupPropertiesForFlags(e)}reset(e){var t,r,i,n;if(ls.info("reset"),!this.__loaded)return ls.uninitializedWarning("posthog.reset");var s=this.get_property("$device_id");if(this.consent.reset(),null==(t=this.persistence)||t.clear(),null==(r=this.sessionPersistence)||r.clear(),this.surveys.reset(),this.featureFlags.reset(),null==(i=this.persistence)||i.set_property(Qs,"anonymous"),null==(n=this.sessionManager)||n.resetSessionId(),this._cachedPersonProperties=null,"always"===this.config.cookieless_mode)this.register_once({distinct_id:ao,$device_id:null},"");else{var o=this.config.get_device_id(Zl());this.register_once({distinct_id:o,$device_id:e?o:s},"")}this.register({$last_posthog_reset:(new Date).toISOString()},1)}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(Ps)?(ls.critical("Attempting to create alias for existing People user - aborting."),-2):this._requirePersonProcessing("posthog.alias")?(ei(t)&&(t=this.get_distinct_id()),e!==t?(this._register_single(As,e),this.capture("$create_alias",{alias:e,distinct_id:t})):(ls.warn("alias matches current distinct_id - skipping api call."),this.identify(e),-1)):void 0}set_config(e){var t=r({},this.config);if(Jr(e)){var i,n,s,o,a,l,u;ps(this.config,Fv(e));var c=this._is_persistence_disabled();null==(i=this.persistence)||i.update_config(this.config,t,c),this.sessionPersistence="sessionStorage"===this.config.persistence||"memory"===this.config.persistence?this.persistence:new Up(r({},this.config,{persistence:"sessionStorage"}),c);var d=this._checkLocalStorageForDebug(this.config.debug);oi(d)&&(this.config.debug=d),oi(this.config.debug)&&(this.config.debug?(os.DEBUG=!0,Fh._is_supported()&&Fh._set("ph_debug","true"),ls.info("set_config",{config:e,oldConfig:t,newConfig:r({},this.config)})):(os.DEBUG=!1,Fh._is_supported()&&Fh._remove("ph_debug"))),null==(n=this.exceptionObserver)||n.onConfigChange(),null==(s=this.sessionRecording)||s.startIfEnabledOrStop(),null==(o=this.autocapture)||o.startIfEnabled(),null==(a=this.heatmaps)||a.startIfEnabled(),null==(l=this.exceptionObserver)||l.startIfEnabledOrStop(),this.surveys.loadIfEnabled(),this._sync_opt_out_with_persistence(),null==(u=this.externalIntegrations)||u.startIfEnabledOrStop()}}startSessionRecording(e){var t=!0===e,r={sampling:t||!(null==e||!e.sampling),linked_flag:t||!(null==e||!e.linked_flag),url_trigger:t||!(null==e||!e.url_trigger),event_trigger:t||!(null==e||!e.event_trigger)};if(Object.values(r).some(Boolean)){var i,n,s,o,a;if(null==(i=this.sessionManager)||i.checkAndGetSessionAndWindowId(),r.sampling)null==(n=this.sessionRecording)||n.overrideSampling();if(r.linked_flag)null==(s=this.sessionRecording)||s.overrideLinkedFlag();if(r.url_trigger)null==(o=this.sessionRecording)||o.overrideTrigger("url");if(r.event_trigger)null==(a=this.sessionRecording)||a.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){var i=new Error("PostHog syntheticException"),n=this.exceptions.buildProperties(e,{handled:!0,syntheticException:i});return this.exceptions.sendExceptionEvent(r({},n,t))}startExceptionAutocapture(e){this.set_config({capture_exceptions:null==e||e})}stopExceptionAutocapture(){this.set_config({capture_exceptions:!1})}loadToolbar(e){return this.toolbar.loadToolbar(e)}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:Pv;return t!==Pv&&(t=Pv+"."+t),t}_isIdentified(){var e,t;return"identified"===(null==(e=this.persistence)?void 0:e.get_property(Qs))||"identified"===(null==(t=this.sessionPersistence)?void 0:t.get_property(Qs))}_hasPersonProcessing(){var e,t;return!("never"===this.config.person_profiles||"identified_only"===this.config.person_profiles&&!this._isIdentified()&&Qr(this.getGroups())&&(null==(e=this.persistence)||null==(e=e.props)||!e[As])&&(null==(t=this.persistence)||null==(t=t.props)||!t[so]))}_shouldCapturePageleave(){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._hasPersonProcessing()||this._requirePersonProcessing("posthog.createPersonProfile")&&this.setPersonProperties({},{})}_requirePersonProcessing(e){return"never"===this.config.person_profiles?(ls.error(e+' was called, but process_person is set to "never". This call will be ignored.'),!1):(this._register_single(so,!0),!0)}_is_persistence_disabled(){if("always"===this.config.cookieless_mode)return!0;var e=this.consent.isOptedOut(),t=this.config.opt_out_persistence_by_default||"on_reject"===this.config.cookieless_mode;return this.config.disable_persistence||e&&!!t}_sync_opt_out_with_persistence(){var e,t,r,i,n=this._is_persistence_disabled();(null==(e=this.persistence)?void 0:e._disabled)!==n&&(null==(r=this.persistence)||r.set_disabled(n));(null==(t=this.sessionPersistence)?void 0:t._disabled)!==n&&(null==(i=this.sessionPersistence)||i.set_disabled(n));return n}opt_in_capturing(e){var t;if("always"!==this.config.cookieless_mode){var r,i;if("on_reject"===this.config.cookieless_mode&&this.consent.isExplicitlyOptedOut())this.reset(!0),null==(r=this.sessionManager)||r.destroy(),this.sessionManager=new pv(this),this.persistence&&(this.sessionPropsManager=new dv(this,this.sessionManager,this.persistence)),this.sessionRecording=new Tv(this),this.sessionRecording.startIfEnabledOrStop();if(this.consent.optInOut(!0),this._sync_opt_out_with_persistence(),this._start_queue_if_opted_in(),null==(t=this.sessionRecording)||t.startIfEnabledOrStop(),"on_reject"==this.config.cookieless_mode&&this.surveys.loadIfEnabled(),ei(null==e?void 0:e.captureEventName)||null!=e&&e.captureEventName)this.capture(null!==(i=null==e?void 0:e.captureEventName)&&void 0!==i?i:"$opt_in",null==e?void 0:e.captureProperties,{send_instantly:!0});this.config.capture_pageview&&this._captureInitialPageview()}else ls.warn('Consent opt in/out is not valid with cookieless_mode="always" and will be ignored')}opt_out_capturing(){var e,t;"always"!==this.config.cookieless_mode?("on_reject"===this.config.cookieless_mode&&this.consent.isOptedIn()&&this.reset(!0),this.consent.optInOut(!1),this._sync_opt_out_with_persistence(),"on_reject"===this.config.cookieless_mode&&(this.register({distinct_id:ao,$device_id:null}),null==(e=this.sessionManager)||e.destroy(),this.sessionManager=void 0,this.sessionPropsManager=void 0,null==(t=this.sessionRecording)||t.stopRecording(),this.sessionRecording=void 0,this._captureInitialPageview())):ls.warn('Consent opt in/out is not valid with cookieless_mode="always" and will be ignored')}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 e===Vh.GRANTED?"granted":e===Vh.DENIED?"denied":"pending"}is_capturing(){return"always"===this.config.cookieless_mode||("on_reject"===this.config.cookieless_mode?this.consent.isExplicitlyOptedOut()||this.consent.isOptedIn():!this.has_opted_out_capturing())}clear_opt_in_out_capturing(){this.consent.reset(),this._sync_opt_out_with_persistence()}_is_bot(){return Xn?fv(Xn,this.config.custom_blocked_useragents):void 0}_captureInitialPageview(){Kn&&("visible"===Kn.visibilityState?this._initialPageviewCaptured||(this._initialPageviewCaptured=!0,this.capture("$pageview",{title:Kn.title},{send_instantly:!0}),this._visibilityStateListener&&(Kn.removeEventListener("visibilitychange",this._visibilityStateListener),this._visibilityStateListener=null)):this._visibilityStateListener||(this._visibilityStateListener=this._captureInitialPageview.bind(this),Cs(Kn,"visibilitychange",this._visibilityStateListener)))}debug(e){!1===e?(null==zn||zn.console.log("You've disabled debug mode."),this.set_config({debug:!1})):(null==zn||zn.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}))}_shouldDisableFlags(){var e,t,r,i,n,s,o,a=this._originalUserConfig||{};return"advanced_disable_flags"in a?!!a.advanced_disable_flags:!1!==this.config.advanced_disable_flags?!!this.config.advanced_disable_flags:!0===this.config.advanced_disable_decide?(ls.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",i=!1,n=ls,s=(t="advanced_disable_flags")in(e=a)&&!ei(e[t]),o=r in e&&!ei(e[r]),s?e[t]:o?(n&&n.warn("Config field '"+r+"' is deprecated. Please use '"+t+"' instead. The old field will be removed in a future major version."),e[r]):i)}_runBeforeSend(e){if(ni(this.config.before_send))return e;var t=Yr(this.config.before_send)?this.config.before_send:[this.config.before_send],r=e;for(var i of t){if(r=i(r),ni(r)){var n="Event '"+e.event+"' was rejected in beforeSend function";return li(e.event)?ls.warn(n+". This can cause unexpected behavior."):ls.info(n),null}r.properties&&!Qr(r.properties)||ls.warn("Event '"+e.event+"' has no properties after beforeSend function, this is likely an error.")}return r}getPageViewId(){var e;return null==(e=this.pageViewManager._currentPageview)?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)})}_checkLocalStorageForDebug(e){var t=oi(e)&&!e,r=Fh._is_supported()&&"true"===Fh._get("ph_debug");return!t&&(!!r||e)}}!function(e,t){for(var r=0;r<t.length;r++)e.prototype[t[r]]=fs(e.prototype[t[r]])}(Ov,["identify"]);var Dv,Hv={backgroundColor:"#ffffff",textColor:"#1d1f27",buttonColor:"#1d1f27",borderRadius:8,buttonBorderRadius:6,borderColor:"#e5e7eb",fontFamily:"system-ui",boxShadow:"0 4px 12px rgba(0, 0, 0, 0.15)",showOverlay:!0,whiteLabel:!1},qv=(Dv=Mv[Pv]=new Ov,function(){function e(){e.done||(e.done=!0,Av=!1,hs(Mv,(function(e){e._dom_loaded()})))}null!=Kn&&Kn.addEventListener?"complete"===Kn.readyState?e():Cs(Kn,"DOMContentLoaded",e,{capture:!1}):zn&&ls.error("Browser doesn't support `document.addEventListener` so PostHog couldn't be initialized")}(),Dv);export{Yl as COPY_AUTOCAPTURE_EVENT,Xl as Compression,Hv as DEFAULT_PRODUCT_TOUR_APPEARANCE,Tl as DisplaySurveyType,Ov as PostHog,El as SurveyEventName,xl as SurveyEventProperties,ml as SurveyEventType,bl as SurveyPosition,Il as SurveyQuestionBranchingType,Cl as SurveyQuestionType,kl as SurveySchedule,Sl as SurveyTabPosition,wl as SurveyType,yl as SurveyWidgetType,qv as default,qv as posthog,Kl as severityLevels};
1
+ 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;t<arguments.length;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=Object.defineProperty,u=(e,t,r)=>((e,t,r)=>t in e?l(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r)(e,"symbol"!=typeof t?t+"":t,r),c=(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))(c||{}),d={Node:["childNodes","parentNode","parentElement","textContent"],ShadowRoot:["host","styleSheets"],Element:["shadowRoot","querySelector","querySelectorAll"],MutationObserver:[]},h={Node:["contains","getRootNode"],ShadowRoot:["getSelection"],Element:[],MutationObserver:["constructor"]};var p={};function v(e){if(p[e])return p[e];var t=function(e){var t,r=null==globalThis||null==(t=globalThis.Zone)||null==t.__symbol__?void 0:t.__symbol__(e);return r&&globalThis[r]?globalThis[r]:void 0}(e)||globalThis[e],r=t.prototype,i=e in d?d[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 h?h[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 p[e]=t.prototype,t.prototype;try{var a=document.createElement("iframe");document.body.appendChild(a);var l=a.contentWindow;if(!l)return t.prototype;var u=l[e].prototype;return document.body.removeChild(a),u?p[e]=u:t.prototype}catch(e){return t.prototype}}var g={};function _(e,t,r){var i,n=e+"."+String(r);if(g[n])return g[n].call(t);var s=v(e),o=null==(i=Object.getOwnPropertyDescriptor(s,r))?void 0:i.get;return o?(g[n]=o,o.call(t)):t[r]}var f={};function m(e,t,r){var i=e+"."+String(r);if(f[i])return f[i].bind(t);var n=v(e)[r];return"function"!=typeof n?t[r]:(f[i]=n,n.bind(t))}var y={childNodes:function(e){return _("Node",e,"childNodes")},parentNode:function(e){return _("Node",e,"parentNode")},parentElement:function(e){return _("Node",e,"parentElement")},textContent:function(e){return _("Node",e,"textContent")},contains:function(e,t){return m("Node",e,"contains")(t)},getRootNode:function(e){return m("Node",e,"getRootNode")()},host:function(e){return e&&"host"in e?_("ShadowRoot",e,"host"):null},styleSheets:function(e){return e.styleSheets},shadowRoot:function(e){return e&&"shadowRoot"in e?_("Element",e,"shadowRoot"):null},querySelector:function(e,t){return _("Element",e,"querySelector")(t)},querySelectorAll:function(e,t){return _("Element",e,"querySelectorAll")(t)},mutationObserver:function(){return v("MutationObserver").constructor}};function b(e){return e.nodeType===e.ELEMENT_NODE}function S(e){var t=e&&"host"in e&&"mode"in e&&y.host(e)||null;return Boolean(t&&"shadowRoot"in t&&y.shadowRoot(t)===e)}function w(e){return"[object ShadowRoot]"===Object.prototype.toString.call(e)}function C(e){try{var t=e.rules||e.cssRules;if(!t)return null;var r=Array.from(t,(t=>I(t,e.href))).join("");return(i=r).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 I(e,t){if(function(e){return"styleSheet"in e}(e)){var r;try{r=C(e.styleSheet)||function(e){var{cssText:t}=e;if(t.split('"').length<3)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){r=e.cssText}return e.styleSheet.href?O(r,e.styleSheet.href):r}var i,n=e.cssText;return function(e){return"selectorText"in e}(e)&&e.selectorText.includes(":")&&(i=/(\[(?:[\w-]+)[^\\])(:(?:[\w-]+)\])/gm,n=n.replace(i,"$1\\$2")),t?O(n,t):n}function k(e,t){return Array.from(e.styleSheets).find((e=>e.href===t))}let E=class{constructor(){u(this,"idNodeMap",new Map),u(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);this.idNodeMap.delete(t),e.childNodes&&e.childNodes.forEach((e=>this.removeNodeFromMap(e)))}has(e){return this.idNodeMap.has(e)}hasNode(e){return this.nodeMetaMap.has(e)}add(e,t){var r=t.id;this.idNodeMap.set(r,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 x(e){var{element:t,maskInputOptions:r,tagName:i,type:n,value:s,maskInputFn:o}=e,a=s||"",l=n&&T(n);return(r[i.toLowerCase()]||l&&r[l])&&(a=o?o(a,t):"*".repeat(a.length)),a}function T(e){return e.toLowerCase()}var M="__rrweb_original__";function R(e){var t=e.type;return e.hasAttribute("data-rr-is-password")?"password":t?T(t):null}function P(e,t){var r,i;try{i=new URL(e,null!=t?t: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}var A=/url\((?:(')([^']*)'|(")(.*?)"|([^)]*))\)/gm,N=/^(?:[a-z+]+:)?\/\//i,F=/^www\..*/i,L=/^(data:)([^,]*),(.*)/i;function O(e,t){return(e||"").replace(A,((e,r,i,n,s,o)=>{var a,l=i||s||o,u=r||n||"";if(!l)return e;if(N.test(l)||F.test(l))return"url("+u+l+u+")";if(L.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 c=t.split("/"),d=l.split("/");for(var h of(c.pop(),d))"."!==h&&(".."===h?c.pop():c.push(h));return"url("+u+c.join("/")+u+")"}))}var D,H,q=1,B=new RegExp("[^a-z0-9-_:]"),V=-2;function U(){return q++}var W=/^[^ \t\n\r\u000c]+/,z=/^[, \t\n\r\u000c]+/;var j=new WeakMap;function Z(e,t){return t&&""!==t.trim()?Y(e,t):t}function G(e){return Boolean("svg"===e.tagName||e.ownerSVGElement)}function Y(e,t){var r=j.get(e);if(r||(r=e.createElement("a"),j.set(e,r)),t){if(t.startsWith("blob:")||t.startsWith("data:"))return t}else t="";return r.setAttribute("href",t),r.href}function X(e,t,r,i){return i?"src"===r||"href"===r&&("use"!==t||"#"!==i[0])||"xlink:href"===r&&"#"!==i[0]?Z(e,i):"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?(i=n[0],r+=i.length,i):""}for(var n=[];i(z),!(r>=t.length);){var s=i(W);if(","===s.slice(-1))s=Z(e,s.substring(0,s.length-1)),n.push(s);else{var o="";s=Z(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?O(i,Y(e)):"object"===t&&"data"===r?Z(e,i):i:Z(e,i):i}function K(e,t,r){return("video"===e||"audio"===e)&&"autoplay"===t}function J(e,t,r){if(!e)return!1;if(e.nodeType!==e.ELEMENT_NODE)return!!r&&J(y.parentNode(e),t,r);for(var i=e.classList.length;i--;){var n=e.classList[i];if(t.test(n))return!0}return!!r&&J(y.parentNode(e),t,r)}function Q(e,t,r,i){var n;if(b(e)){if(n=e,!y.childNodes(n).length)return!1}else{if(null===y.parentElement(e))return!1;n=y.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(J(n,t,i))return!0;if(r)if(i){if(n.closest(r))return!0}else if(n.matches(r))return!0}catch(e){}return!1}function ee(e,t){var{doc:r,mirror:i,blockClass:n,blockSelector:s,needsMask:o,inlineStylesheet:a,maskInputOptions:l={},maskTextFn:u,maskInputFn:d,dataURLOptions:h={},inlineImages:p,recordCanvas:v,keepIframeSrcFn:g,newlyAddedElement:_=!1}=t,f=function(e,t){if(!t.hasNode(e))return;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:c.Document,childNodes:[],compatMode:e.compatMode}:{type:c.Document,childNodes:[]};case e.DOCUMENT_TYPE_NODE:return{type:c.DocumentType,name:e.name,publicId:e.publicId,systemId:e.systemId,rootId:f};case e.ELEMENT_NODE:return function(e,t){for(var r,{doc:i,blockClass:n,blockSelector:s,inlineStylesheet:o,maskInputOptions:a={},maskInputFn:l,dataURLOptions:u={},inlineImages:d,recordCanvas:h,keepIframeSrcFn:p,newlyAddedElement:v=!1,rootId:g}=t,_=function(e,t,r){try{if("string"==typeof t){if(e.classList.contains(t))return!0}else for(var i=e.classList.length;i--;){var n=e.classList[i];if(t.test(n))return!0}if(r)return e.matches(r)}catch(e){}return!1}(e,n,s),f=function(e){if(e instanceof HTMLFormElement)return"form";var t=T(e.tagName);return B.test(t)?"div":t}(e),m={},b=e.attributes.length,S=0;S<b;S++){var w=e.attributes[S];K(f,w.name,w.value)||(m[w.name]=X(i,f,T(w.name),w.value))}if("link"===f&&o){var I=function(e){return null==e?void 0:e.href}(e);if(I){var E=k(i,I);if(!E&&I.includes(".css"))E=k(i,window.location.origin+"/"+I.replace(window.location.href,""));var P=null;E&&(P=C(E)),P&&(delete m.rel,delete m.href,m._cssText=P)}}if("style"===f&&e.sheet&&!(e.innerText||y.textContent(e)||"").trim().length){var A=C(e.sheet);A&&(m._cssText=A)}if("input"===f||"textarea"===f||"select"===f){var N=e.value,F=e.checked;"radio"!==m.type&&"checkbox"!==m.type&&"submit"!==m.type&&"button"!==m.type&&N?m.value=x({element:e,type:R(e),tagName:f,value:N,maskInputOptions:a,maskInputFn:l}):F&&(m.checked=F)}"option"===f&&(e.selected&&!a.select?m.selected=!0:delete m.selected);if("dialog"===f&&e.open)try{m.rr_open_mode=e.matches("dialog:modal")?"modal":"non-modal"}catch(e){m.rr_open_mode="modal",m.ph_rr_could_not_detect_modal=!0}if("canvas"===f&&h)if("2d"===e.__context)(function(e){var t=e.getContext("2d");if(!t)return!0;for(var r=0;r<e.width;r+=50)for(var i=0;i<e.height;i+=50){var n=t.getImageData,s=M in n?n[M]:n;if(new Uint32Array(s.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)||(m.rr_dataURL=e.toDataURL(u.type,u.quality));else if(!("__context"in e)){var L=e.toDataURL(u.type,u.quality),O=i.createElement("canvas");O.width=e.width,O.height=e.height,L!==O.toDataURL(u.type,u.quality)&&(m.rr_dataURL=L)}if("img"===f&&d){D||(D=i.createElement("canvas"),H=D.getContext("2d"));var q=e,V=q.currentSrc||q.getAttribute("src")||"<unknown-src>",U=q.crossOrigin,W=()=>{q.removeEventListener("load",W);try{D.width=q.naturalWidth,D.height=q.naturalHeight,H.drawImage(q,0,0),m.rr_dataURL=D.toDataURL(u.type,u.quality)}catch(e){if("anonymous"!==q.crossOrigin)return q.crossOrigin="anonymous",void(q.complete&&0!==q.naturalWidth?W():q.addEventListener("load",W));console.warn("Cannot inline img src="+V+"! Error: "+e)}"anonymous"===q.crossOrigin&&(U?m.crossOrigin=U:q.removeAttribute("crossorigin"))};q.complete&&0!==q.naturalWidth?W():q.addEventListener("load",W)}if("audio"===f||"video"===f){var z=m;z.rr_mediaState=e.paused?"paused":"played",z.rr_mediaCurrentTime=e.currentTime,z.rr_mediaPlaybackRate=e.playbackRate,z.rr_mediaMuted=e.muted,z.rr_mediaLoop=e.loop,z.rr_mediaVolume=e.volume}v||(e.scrollLeft&&(m.rr_scrollLeft=e.scrollLeft),e.scrollTop&&(m.rr_scrollTop=e.scrollTop));if(_){var{width:j,height:Z}=e.getBoundingClientRect();m={class:m.class,rr_width:j+"px",rr_height:Z+"px"}}"iframe"!==f||p(m.src)||(e.contentDocument||(m.rr_src=m.src),delete m.src);try{customElements.get(f)&&(r=!0)}catch(e){}return{type:c.Element,tagName:f,attributes:m,childNodes:[],isSVG:G(e)||void 0,needBlock:_,rootId:g,isCustom:r}}(e,{doc:r,blockClass:n,blockSelector:s,inlineStylesheet:a,maskInputOptions:l,maskInputFn:d,dataURLOptions:h,inlineImages:p,recordCanvas:v,keepIframeSrcFn:g,newlyAddedElement:_,rootId:f});case e.TEXT_NODE:return function(e,t){var r,{needsMask:i,maskTextFn:n,rootId:s}=t,o=y.parentNode(e),a=o&&o.tagName,l=y.textContent(e),u="STYLE"===a||void 0,d="SCRIPT"===a||void 0;if(u&&l){try{e.nextSibling||e.previousSibling||(null==(r=o.sheet)?void 0:r.cssRules)&&(l=C(o.sheet))}catch(t){console.warn("Cannot get CSS styles from text's parentNode. Error: "+t,e)}l=O(l,Y(t.doc))}d&&(l="SCRIPT_PLACEHOLDER");!u&&!d&&l&&i&&(l=n?n(l,y.parentElement(e)):l.replace(/[\S]/g,"*"));return{type:c.Text,textContent:l||"",isStyle:u,rootId:s}}(e,{doc:r,needsMask:o,maskTextFn:u,rootId:f});case e.CDATA_SECTION_NODE:return{type:c.CDATA,textContent:"",rootId:f};case e.COMMENT_NODE:return{type:c.Comment,textContent:y.textContent(e)||"",rootId:f};default:return!1}}function te(e){return null==e?"":e.toLowerCase()}function re(e,t){var{doc:r,mirror:i,blockClass:n,blockSelector:s,maskTextClass:o,maskTextSelector:a,skipChild:l=!1,inlineStylesheet:u=!0,maskInputOptions:d={},maskTextFn:h,maskInputFn:p,slimDOMOptions:v,dataURLOptions:g={},inlineImages:_=!1,recordCanvas:f=!1,onSerialize:m,onIframeLoad:C,iframeLoadTimeout:I=5e3,onStylesheetLoad:k,stylesheetLoadTimeout:E=5e3,keepIframeSrcFn:x=(()=>!1),newlyAddedElement:T=!1}=t,{needsMask:M}=t,{preserveWhiteSpace:R=!0}=t;M||(M=Q(e,o,a,void 0===M));var A,N=ee(e,{doc:r,mirror:i,blockClass:n,blockSelector:s,needsMask:M,inlineStylesheet:u,maskInputOptions:d,maskTextFn:h,maskInputFn:p,dataURLOptions:g,inlineImages:_,recordCanvas:f,keepIframeSrcFn:x,newlyAddedElement:T});if(!N)return console.warn(e,"not serialized"),null;A=i.hasNode(e)?i.getId(e):!function(e,t){if(t.comment&&e.type===c.Comment)return!0;if(e.type===c.Element){if(t.script&&("script"===e.tagName||"link"===e.tagName&&("preload"===e.attributes.rel||"modulepreload"===e.attributes.rel)&&"script"===e.attributes.as||"link"===e.tagName&&"prefetch"===e.attributes.rel&&"string"==typeof e.attributes.href&&"js"===P(e.attributes.href)))return!0;if(t.headFavicon&&("link"===e.tagName&&"shortcut icon"===e.attributes.rel||"meta"===e.tagName&&(te(e.attributes.name).match(/^msapplication-tile(image|color)$/)||"application-name"===te(e.attributes.name)||"icon"===te(e.attributes.rel)||"apple-touch-icon"===te(e.attributes.rel)||"shortcut icon"===te(e.attributes.rel))))return!0;if("meta"===e.tagName){if(t.headMetaDescKeywords&&te(e.attributes.name).match(/^description|keywords$/))return!0;if(t.headMetaSocial&&(te(e.attributes.property).match(/^(og|twitter|fb):/)||te(e.attributes.name).match(/^(og|twitter):/)||"pinterest"===te(e.attributes.name)))return!0;if(t.headMetaRobots&&("robots"===te(e.attributes.name)||"googlebot"===te(e.attributes.name)||"bingbot"===te(e.attributes.name)))return!0;if(t.headMetaHttpEquiv&&void 0!==e.attributes["http-equiv"])return!0;if(t.headMetaAuthorship&&("author"===te(e.attributes.name)||"generator"===te(e.attributes.name)||"framework"===te(e.attributes.name)||"publisher"===te(e.attributes.name)||"progid"===te(e.attributes.name)||te(e.attributes.property).match(/^article:/)||te(e.attributes.property).match(/^product:/)))return!0;if(t.headMetaVerification&&("google-site-verification"===te(e.attributes.name)||"yandex-verification"===te(e.attributes.name)||"csrf-token"===te(e.attributes.name)||"p:domain_verify"===te(e.attributes.name)||"verify-v1"===te(e.attributes.name)||"verification"===te(e.attributes.name)||"shopify-checkout-api-token"===te(e.attributes.name)))return!0}}return!1}(N,v)&&(R||N.type!==c.Text||N.isStyle||N.textContent.replace(/^\s+|\s+$/gm,"").length)?U():V;var F=Object.assign(N,{id:A});if(i.add(e,F),A===V)return null;m&&m(e);var L=!l;if(F.type===c.Element){L=L&&!F.needBlock,delete F.needBlock;var O=y.shadowRoot(e);O&&w(O)&&(F.isShadowHost=!0)}if((F.type===c.Document||F.type===c.Element)&&L){v.headWhitespace&&F.type===c.Element&&"head"===F.tagName&&(R=!1);var D={doc:r,mirror:i,blockClass:n,blockSelector:s,needsMask:M,maskTextClass:o,maskTextSelector:a,skipChild:l,inlineStylesheet:u,maskInputOptions:d,maskTextFn:h,maskInputFn:p,slimDOMOptions:v,dataURLOptions:g,inlineImages:_,recordCanvas:f,preserveWhiteSpace:R,onSerialize:m,onIframeLoad:C,iframeLoadTimeout:I,onStylesheetLoad:k,stylesheetLoadTimeout:E,keepIframeSrcFn:x};if(F.type===c.Element&&"textarea"===F.tagName&&void 0!==F.attributes.value);else for(var H of Array.from(y.childNodes(e))){var q=re(H,D);q&&F.childNodes.push(q)}var B=null;if(b(e)&&(B=y.shadowRoot(e)))for(var W of Array.from(y.childNodes(B))){var z=re(W,D);z&&(w(B)&&(z.isShadow=!0),F.childNodes.push(z))}}var j=y.parentNode(e);return j&&S(j)&&w(j)&&(F.isShadow=!0),F.type===c.Element&&"iframe"===F.tagName&&function(e,t,r){var i=e.contentWindow;if(i){var n,s=!1;try{n=i.document.readyState}catch(e){return}if("complete"===n){var o="about:blank";if(i.location.href!==o||e.src===o||""===e.src)return setTimeout(t,0),e.addEventListener("load",t);e.addEventListener("load",t)}else{var a=setTimeout((()=>{s||(t(),s=!0)}),r);e.addEventListener("load",(()=>{clearTimeout(a),s=!0,t()}))}}}(e,(()=>{var t=e.contentDocument;if(t&&C){var r=re(t,{doc:t,mirror:i,blockClass:n,blockSelector:s,needsMask:M,maskTextClass:o,maskTextSelector:a,skipChild:!1,inlineStylesheet:u,maskInputOptions:d,maskTextFn:h,maskInputFn:p,slimDOMOptions:v,dataURLOptions:g,inlineImages:_,recordCanvas:f,preserveWhiteSpace:R,onSerialize:m,onIframeLoad:C,iframeLoadTimeout:I,onStylesheetLoad:k,stylesheetLoadTimeout:E,keepIframeSrcFn:x});r&&C(e,r)}}),I),F.type===c.Element&&"link"===F.tagName&&"string"==typeof F.attributes.rel&&("stylesheet"===F.attributes.rel||"preload"===F.attributes.rel&&"string"==typeof F.attributes.href&&"css"===P(F.attributes.href))&&function(e,t,r){var i,n=!1;try{i=e.sheet}catch(e){return}if(!i){var s=setTimeout((()=>{n||(t(),n=!0)}),r);e.addEventListener("load",(()=>{clearTimeout(s),n=!0,t()}))}}(e,(()=>{if(k){var t=re(e,{doc:r,mirror:i,blockClass:n,blockSelector:s,needsMask:M,maskTextClass:o,maskTextSelector:a,skipChild:!1,inlineStylesheet:u,maskInputOptions:d,maskTextFn:h,maskInputFn:p,slimDOMOptions:v,dataURLOptions:g,inlineImages:_,recordCanvas:f,preserveWhiteSpace:R,onSerialize:m,onIframeLoad:C,iframeLoadTimeout:I,onStylesheetLoad:k,stylesheetLoadTimeout:E,keepIframeSrcFn:x});t&&k(e,t)}}),E),F}let ie=class e{constructor(){__publicField2(this,"parentElement",null),__publicField2(this,"parentNode",null),__publicField2(this,"ownerDocument"),__publicField2(this,"firstChild",null),__publicField2(this,"lastChild",null),__publicField2(this,"previousSibling",null),__publicField2(this,"nextSibling",null),__publicField2(this,"ELEMENT_NODE",1),__publicField2(this,"TEXT_NODE",3),__publicField2(this,"nodeType"),__publicField2(this,"nodeName"),__publicField2(this,"RRNodeType")}get childNodes(){for(var e=[],t=this.firstChild;t;)e.push(t),t=t.nextSibling;return e}contains(t){if(!(t instanceof e))return!1;if(t.ownerDocument!==this.ownerDocument)return!1;if(t===this)return!0;for(;t.parentNode;){if(t.parentNode===this)return!0;t=t.parentNode}return!1}appendChild(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"}};var ne={Node:["childNodes","parentNode","parentElement","textContent"],ShadowRoot:["host","styleSheets"],Element:["shadowRoot","querySelector","querySelectorAll"],MutationObserver:[]},se={Node:["contains","getRootNode"],ShadowRoot:["getSelection"],Element:[],MutationObserver:["constructor"]};var oe={};function ae(e){if(oe[e])return oe[e];var t=function(e){var t,r=null==globalThis||null==(t=globalThis.Zone)||null==t.__symbol__?void 0:t.__symbol__(e);return r&&globalThis[r]?globalThis[r]:void 0}(e)||globalThis[e],r=t.prototype,i=e in ne?ne[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 se?se[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 oe[e]=t.prototype,t.prototype;try{var a=document.createElement("iframe");document.body.appendChild(a);var l=a.contentWindow;if(!l)return t.prototype;var u=l[e].prototype;return document.body.removeChild(a),u?oe[e]=u:r}catch(e){return r}}var le={};function ue(e,t,r){var i,n=e+"."+String(r);if(le[n])return le[n].call(t);var s=ae(e),o=null==(i=Object.getOwnPropertyDescriptor(s,r))?void 0:i.get;return o?(le[n]=o,o.call(t)):t[r]}var ce={};function de(e,t,r){var i=e+"."+String(r);if(ce[i])return ce[i].bind(t);var n=ae(e)[r];return"function"!=typeof n?t[r]:(ce[i]=n,n.bind(t))}function he(){return ae("MutationObserver").constructor}var pe={childNodes:function(e){return ue("Node",e,"childNodes")},parentNode:function(e){return ue("Node",e,"parentNode")},parentElement:function(e){return ue("Node",e,"parentElement")},textContent:function(e){return ue("Node",e,"textContent")},contains:function(e,t){return de("Node",e,"contains")(t)},getRootNode:function(e){return de("Node",e,"getRootNode")()},host:function(e){return e&&"host"in e?ue("ShadowRoot",e,"host"):null},styleSheets:function(e){return e.styleSheets},shadowRoot:function(e){return e&&"shadowRoot"in e?ue("Element",e,"shadowRoot"):null},querySelector:function(e,t){return ue("Element",e,"querySelector")(t)},querySelectorAll:function(e,t){return ue("Element",e,"querySelectorAll")(t)},mutationObserver:he};function ve(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)}var ge="Please stop import mirror directly. Instead of that,\r\nnow you can use replayer.getMirror() to access the mirror instance of a replayer,\r\nor you can use record.mirror to access the mirror instance during recording.",_e={map:{},getId:()=>(console.error(ge),-1),getNode:()=>(console.error(ge),null),removeNodeFromMap(){console.error(ge)},has:()=>(console.error(ge),!1),reset(){console.error(ge)}};function fe(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;a<s;a++)o[a]=arguments[a];var l=Date.now();n||!1!==r.leading||(n=l);var u=t-(l-n),c=this;u<=0||u>t?(i&&(clearTimeout(i),i=null),n=l,e.apply(c,o)):i||!1===r.trailing||(i=setTimeout((()=>{n=!1===r.leading?0:Date.now(),i=null,e.apply(c,o)}),u))}}function me(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)}}),()=>me(e,t,s||{},!0)}function ye(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()=>{}}}"undefined"!=typeof window&&window.Proxy&&window.Reflect&&(_e=new Proxy(_e,{get:(e,t,r)=>("map"===t&&console.error(ge),Reflect.get(e,t,r))}));var be=Date.now;function Se(e){var t,r,i,n,s=e.document;return{left:s.scrollingElement?s.scrollingElement.scrollLeft:void 0!==e.pageXOffset?e.pageXOffset:s.documentElement.scrollLeft||(null==s?void 0:s.body)&&(null==(t=pe.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=pe.parentElement(s.body))?void 0:i.scrollTop)||(null==(n=null==s?void 0:s.body)?void 0:n.scrollTop)||0}}function we(){return window.innerHeight||document.documentElement&&document.documentElement.clientHeight||document.body&&document.body.clientHeight}function Ce(){return window.innerWidth||document.documentElement&&document.documentElement.clientWidth||document.body&&document.body.clientWidth}function Ie(e){return e?e.nodeType===e.ELEMENT_NODE?e:pe.parentElement(e):null}function ke(e,t,r,i){if(!e)return!1;var n=Ie(e);if(!n)return!1;try{if("string"==typeof t){if(n.classList.contains(t))return!0;if(i&&null!==n.closest("."+t))return!0}else if(J(n,t,i))return!0}catch(e){}if(r){if(n.matches(r))return!0;if(i&&null!==n.closest(r))return!0}return!1}function Ee(e,t,r){return!("TITLE"!==e.tagName||!r.headTitleMutations)||t.getId(e)===V}function xe(e,t){if(S(e))return!1;var r=t.getId(e);if(!t.has(r))return!0;var i=pe.parentNode(e);return(!i||i.nodeType!==e.DOCUMENT_NODE)&&(!i||xe(i,t))}function Te(e){return Boolean(e.changedTouches)}function Me(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 Pe(e){return!!e&&(e instanceof ie&&"shadowRoot"in e?Boolean(e.shadowRoot):Boolean(pe.shadowRoot(e)))}/[1-9][0-9]{12}/.test(Date.now().toString())||(be=()=>(new Date).getTime());let Ae=class{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 Ne(e){var t,r=null;return"getRootNode"in e&&(null==(t=pe.getRootNode(e))?void 0:t.nodeType)===Node.DOCUMENT_FRAGMENT_NODE&&pe.host(pe.getRootNode(e))&&(r=pe.host(pe.getRootNode(e))),r}function Fe(e){var t=e.ownerDocument;if(!t)return!1;var r=function(e){for(var t,r=e;t=Ne(r);)r=t;return r}(e);return pe.contains(t,r)}function Le(e){var t=e.ownerDocument;return!!t&&(pe.contains(t,e)||Fe(e))}var Oe=(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))(Oe||{}),De=(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))(De||{}),He=(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))(He||{}),qe=(e=>(e[e.Mouse=0]="Mouse",e[e.Pen=1]="Pen",e[e.Touch=2]="Touch",e))(qe||{}),Be=(e=>(e[e["2D"]=0]="2D",e[e.WebGL=1]="WebGL",e[e.WebGL2=2]="WebGL2",e))(Be||{}),Ve=(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))(Ve||{});function $e(e){return"__ln"in e}class Ue{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;r<e;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 We,ze=(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,"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,"processMutations",(e=>{e.forEach(this.processMutation),this.emit()})),a(this,"emit",(()=>{if(!this.frozen&&!this.locked){for(var e=[],t=new Set,r=new Ue,i=e=>{for(var t=e,r=V;r===V;)r=(t=t&&t.nextSibling)&&this.mirror.getId(t);return r},n=n=>{var s=pe.parentNode(n);if(s&&Le(n)&&"TEXTAREA"!==s.tagName){var o=S(s)?this.mirror.getId(Ne(n)):this.mirror.getId(s),a=i(n);if(-1===o||-1===a)return r.addNode(n);var l=re(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=>{Me(e,this.mirror)&&this.iframeManager.addIframe(e),Re(e,this.mirror)&&this.stylesheetManager.trackLinkElement(e),Pe(n)&&this.shadowDomManager.addShadowRoot(pe.shadowRoot(n),this.doc)},onIframeLoad:(e,t)=>{this.iframeManager.attachIframe(e,t),this.shadowDomManager.observeAttachShadow(e)},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)Ge(this.removes,s,this.mirror)&&!this.movedSet.has(pe.parentNode(s))||n(s);for(var o of this.addedSet)Ye(this.droppedSet,o)||Ge(this.removes,o,this.mirror)?Ye(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(pe.parentNode(a.value)),c=i(a.value);-1!==u&&-1!==c&&(l=a)}if(!l)for(var d=r.tail;d;){var h=d;if(d=d.previous,h){var p=this.mirror.getId(pe.parentNode(h.value));if(-1===i(h.value))continue;if(-1!==p){l=h;break}var v=h.value,g=pe.parentNode(v);if(g&&g.nodeType===Node.DOCUMENT_FRAGMENT_NODE){var _=pe.host(g);if(-1!==this.mirror.getId(_)){l=h;break}}}}if(!l){for(;r.head;)r.removeNode(r.head.value);break}a=l.previous,r.removeNode(l.value),n(l.value)}var f={texts:this.texts.map((e=>{var t=e.node,r=pe.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);r.length<t.style.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};(f.texts.length||f.attributes.length||f.removes.length||f.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.movedMap={},this.mutationCb(f))}})),a(this,"genTextAreaValueMutation",(e=>{var t=this.attributeMap.get(e);t||(t={node:e,attributes:{},styleDiff:{},_unchangedStyles:{}},this.attributes.push(t),this.attributeMap.set(e,t)),t.attributes.value=Array.from(pe.childNodes(e),(e=>pe.textContent(e)||"")).join("")})),a(this,"processMutation",(e=>{if(!Ee(e.target,this.mirror,this.slimDOMOptions))switch(e.type){case"characterData":var t=pe.textContent(e.target);ke(e.target,this.blockClass,this.blockSelector,!1)||t===e.oldValue||this.texts.push({value:Q(e.target,this.maskTextClass,this.maskTextSelector,!0)&&t?this.maskTextFn?this.maskTextFn(t,Ie(e.target)):t.replace(/[\S]/g,"*"):t,node:e.target});break;case"attributes":var r=e.target,i=e.attributeName,n=e.target.getAttribute(i);if("value"===i){var s=R(r);n=x({element:r,maskInputOptions:this.maskInputOptions,tagName:r.tagName,type:s,value:n,maskInputFn:this.maskInputFn})}if(ke(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||(o={node:e.target,attributes:{},styleDiff:{},_unchangedStyles:{}},this.attributes.push(o),this.attributeMap.set(e.target,o)),"type"===i&&"INPUT"===r.tagName&&"password"===(e.oldValue||"").toLowerCase()&&r.setAttribute("data-rr-is-password","true"),!K(r.tagName,i))if(o.attributes[i]=X(this.doc,T(r.tagName),T(i),n),"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.setAttribute("style",e.oldValue),Array.from(r.style))){var u=r.style.getPropertyValue(l),c=r.style.getPropertyPriority(l);u!==a.style.getPropertyValue(l)||c!==a.style.getPropertyPriority(l)?o.styleDiff[l]=""===c?u:[u,c]:o._unchangedStyles[l]=[u,c]}for(var d of Array.from(a.style))""===r.style.getPropertyValue(d)&&(o.styleDiff[d]=!1)}else"open"===i&&"DIALOG"===r.tagName&&(r.matches("dialog:modal")?o.attributes.rr_open_mode="modal":o.attributes.rr_open_mode="non-modal");break;case"childList":if(ke(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=S(e.target)?this.mirror.getId(pe.host(e.target)):this.mirror.getId(e.target);ke(e.target,this.blockClass,this.blockSelector,!1)||Ee(t,this.mirror,this.slimDOMOptions)||!function(e,t){return-1!==t.getId(e)}(t,this.mirror)||(this.addedSet.has(t)?(Ze(this.addedSet,t),this.droppedSet.add(t)):this.addedSet.has(e.target)&&-1===r||xe(e.target,this.mirror)||(this.movedSet.has(t)&&this.movedMap[ze(r,i)]?Ze(this.movedSet,t):this.removes.push({parentId:i,id:r,isShadow:!(!S(e.target)||!w(e.target))||void 0})),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(Ee(e,this.mirror,this.slimDOMOptions))return;this.movedSet.add(e);var r=null;t&&this.mirror.hasNode(t)&&(r=this.mirror.getId(t)),r&&-1!==r&&(this.movedMap[ze(this.mirror.getId(e),r)]=!0)}else this.addedSet.add(e),this.droppedSet.delete(e);ke(e,this.blockClass,this.blockSelector,!1)||(pe.childNodes(e).forEach((e=>this.genAdds(e))),Pe(e)&&pe.childNodes(pe.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]}))}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.canvasManager.reset()}}function Ze(e,t){e.delete(t),pe.childNodes(t).forEach((t=>Ze(e,t)))}function Ge(e,t,r){return 0!==e.length&&function(e,t,r){var i,n=pe.parentNode(t),s=function(){var t=r.getId(n);if(e.some((e=>e.id===t)))return{v:!0};n=pe.parentNode(n)};for(;n;)if(i=s())return i.v;return!1}(e,t,r)}function Ye(e,t){return 0!==e.size&&Xe(e,t)}function Xe(e,t){var r=pe.parentNode(t);return!!r&&(!!e.has(r)||Xe(e,r))}var Ke=e=>{if(!We)return e;return function(){try{return e(...arguments)}catch(e){if(We&&!0===We(e))return;throw e}}},Je=[];function Qe(e){try{if("composedPath"in e){var t=e.composedPath();if(t.length)return t[0]}else if("path"in e&&e.path.length)return e.path[0]}catch(e){}return e&&e.target}function et(e,t){var r=new je;Je.push(r),r.init(e);var i=new(he())(Ke(r.processMutations.bind(r)));return i.observe(t,{attributes:!0,attributeOldValue:!0,characterData:!0,characterDataOldValue:!0,childList:!0,subtree:!0}),i}function tt(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(He).filter((e=>Number.isNaN(Number(e))&&!e.endsWith("_Departed")&&!1!==l[e])).forEach((e=>{var a=T(e),l=(e=>i=>{var a=Qe(i);if(!ke(a,s,o,!0)){var l=null,u=e;if("pointerType"in i){switch(i.pointerType){case"mouse":l=qe.Mouse;break;case"touch":l=qe.Touch;break;case"pen":l=qe.Pen}l===qe.Touch?He[e]===He.MouseDown?u="TouchStart":He[e]===He.MouseUp&&(u="TouchEnd"):qe.Pen}else Te(i)&&(l=qe.Touch);null!==l?(c=l,(u.startsWith("Touch")&&l===qe.Touch||u.startsWith("Mouse")&&l===qe.Mouse)&&(l=null)):He[e]===He.Click&&(l=c,c=null);var d=Te(i)?i.changedTouches[0]:i;if(d){var h=n.getId(a),{clientX:p,clientY:v}=d;Ke(t)(r({type:He[u],id:h,x:p,y:v},null!==l&&{pointerType:l}))}}})(e);if(window.PointerEvent)switch(He[e]){case He.MouseDown:case He.MouseUp:a=a.replace("mouse","pointer");break;case He.TouchStart:case He.TouchEnd:return}u.push(ve(a,l,i))})),Ke((()=>{u.forEach((e=>e()))}))}function rt(e){var{scrollCb:t,doc:r,mirror:i,blockClass:n,blockSelector:s,sampling:o}=e;return ve("scroll",Ke(fe(Ke((e=>{var o=Qe(e);if(o&&!ke(o,n,s,!0)){var a=i.getId(o);if(o===r&&r.defaultView){var l=Se(r.defaultView);t({id:a,x:l.left,y:l.top})}else t({id:a,x:o.scrollLeft,y:o.scrollTop})}})),o.scroll||100)),r)}var it=["INPUT","TEXTAREA","SELECT"],nt=new WeakMap;function st(e){return function(e,t){if(ut("CSSGroupingRule")&&e.parentRule instanceof CSSGroupingRule||ut("CSSMediaRule")&&e.parentRule instanceof CSSMediaRule||ut("CSSSupportsRule")&&e.parentRule instanceof CSSSupportsRule||ut("CSSConditionRule")&&e.parentRule instanceof CSSConditionRule){var r=Array.from(e.parentRule.cssRules).indexOf(e);t.unshift(r)}else if(e.parentStyleSheet){var i=Array.from(e.parentStyleSheet.cssRules).indexOf(e);t.unshift(i)}return t}(e,[])}function ot(e,t,r){var i,n;return e?(e.ownerNode?i=t.getId(e.ownerNode):n=r.getId(e),{styleId:n,id:i}):{}}function at(e,t){var r,i,n,{mirror:s,stylesheetManager:o}=e,a=null;a="#document"===t.nodeName?s.getId(t):s.getId(pe.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!==a&&-1!==a&&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!==a&&-1!==a)try{o.adoptStyleSheets(e,a)}catch(e){}return r}}),Ke((()=>{Object.defineProperty(t,"adoptedStyleSheets",{configurable:u.configurable,enumerable:u.enumerable,get:u.get,set:u.set})}))):()=>{}}function lt(e,t){void 0===t&&(t={});var i,n=e.doc.defaultView;if(!n)return()=>{};!function(e,t){var{mutationCb:r,mousemoveCb:i,mouseInteractionCb:n,scrollCb:s,viewportResizeCb:o,inputCb:a,mediaInteractionCb:l,styleSheetRuleCb:u,styleDeclarationCb:c,canvasMutationCb:d,fontCb:h,selectionCb:p,customElementCb:v}=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),c(...arguments)},e.canvasMutationCb=function(){t.canvasMutation&&t.canvasMutation(...arguments),d(...arguments)},e.fontCb=function(){t.font&&t.font(...arguments),h(...arguments)},e.selectionCb=function(){t.selection&&t.selection(...arguments),p(...arguments)},e.customElementCb=function(){t.customElement&&t.customElement(...arguments),v(...arguments)}}(e,t),e.recordDOM&&(i=et(e,e.doc));var s=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=[],u=fe(Ke((e=>{var r=Date.now()-s;t(l.map((e=>(e.timeOffset-=r,e))),e),l=[],s=null})),a),c=Ke(fe(Ke((e=>{var t=Qe(e),{clientX:r,clientY:i}=Te(e)?e.changedTouches[0]:e;s||(s=be()),l.push({x:r,y:i,id:n.getId(t),timeOffset:be()-s}),u("undefined"!=typeof DragEvent&&e instanceof DragEvent?De.Drag:e instanceof MouseEvent?De.MouseMove:De.TouchMove)})),o,{trailing:!1})),d=[ve("mousemove",c,i),ve("touchmove",c,i),ve("drag",c,i)];return Ke((()=>{d.forEach((e=>e()))}))}(e),o=tt(e),a=rt(e),l=function(e,t){var{viewportResizeCb:r}=e,{win:i}=t,n=-1,s=-1;return ve("resize",Ke(fe(Ke((()=>{var e=we(),t=Ce();n===e&&s===t||(r({width:Number(t),height:Number(e)}),n=e,s=t)})),200)),i)}(e,{win:n}),u=function(e){var{inputCb:t,doc:i,mirror:n,blockClass:s,blockSelector:o,ignoreClass:a,ignoreSelector:l,maskInputOptions:u,maskInputFn:c,sampling:d,userTriggeredOnInput:h}=e;function p(e){var t=Qe(e),r=e.isTrusted,n=t&&t.tagName;if(t&&"OPTION"===n&&(t=pe.parentElement(t)),t&&n&&!(it.indexOf(n)<0)&&!ke(t,s,o,!0)&&!(t.classList.contains(a)||l&&t.matches(l))){var d=t.value,p=!1,g=R(t)||"";"radio"===g||"checkbox"===g?p=t.checked:(u[n.toLowerCase()]||u[g])&&(d=x({element:t,maskInputOptions:u,tagName:n,type:g,value:d,maskInputFn:c})),v(t,h?{text:d,isChecked:p,userTriggered:r}:{text:d,isChecked:p});var _=t.name;"radio"===g&&_&&p&&i.querySelectorAll('input[type="radio"][name="'+_+'"]').forEach((e=>{if(e!==t){var r=e.value;v(e,h?{text:r,isChecked:!p,userTriggered:!1}:{text:r,isChecked:!p})}}))}}function v(e,i){var s=nt.get(e);if(!s||s.text!==i.text||s.isChecked!==i.isChecked){nt.set(e,i);var o=n.getId(e);Ke(t)(r({},i,{id:o}))}}var g=("last"===d.input?["change"]:["input","change"]).map((e=>ve(e,Ke(p),i))),_=i.defaultView;if(!_)return()=>{g.forEach((e=>e()))};var f=_.Object.getOwnPropertyDescriptor(_.HTMLInputElement.prototype,"value"),m=[[_.HTMLInputElement.prototype,"value"],[_.HTMLInputElement.prototype,"checked"],[_.HTMLSelectElement.prototype,"value"],[_.HTMLTextAreaElement.prototype,"value"],[_.HTMLSelectElement.prototype,"selectedIndex"],[_.HTMLOptionElement.prototype,"selected"]];return f&&f.set&&g.push(...m.map((e=>me(e[0],e[1],{set(){Ke(p)({target:this,isTrusted:!1})}},!1,_)))),Ke((()=>{g.forEach((e=>e()))}))}(e),c=function(e){var{mediaInteractionCb:t,blockClass:r,blockSelector:i,mirror:n,sampling:s,doc:o}=e,a=Ke((e=>fe(Ke((s=>{var o=Qe(s);if(o&&!ke(o,r,i,!0)){var{currentTime:a,volume:l,muted:u,playbackRate:c,loop:d}=o;t({type:e,id:n.getId(o),currentTime:a,volume:l,muted:u,playbackRate:c,loop:d})}})),s.media||500))),l=[ve("play",a(Ve.Play),o),ve("pause",a(Ve.Pause),o),ve("seeked",a(Ve.Seeked),o),ve("volumechange",a(Ve.VolumeChange),o),ve("ratechange",a(Ve.RateChange),o)];return Ke((()=>{l.forEach((e=>e()))}))}(e),d=()=>{},h=()=>{},p=()=>{},v=()=>{};e.recordDOM&&(d=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:Ke(((e,t,s)=>{var[o,a]=s,{id:l,styleId:u}=ot(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){void 0===r&&(r=this.cssRules.length);var i=e+" { "+t+" }";return s.CSSStyleSheet.prototype.insertRule.apply(this,[i,r])};var a,l,u=s.CSSStyleSheet.prototype.deleteRule;s.CSSStyleSheet.prototype.deleteRule=new Proxy(u,{apply:Ke(((e,t,s)=>{var[o]=s,{id:a,styleId:l}=ot(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:Ke(((e,t,s)=>{var[o]=s,{id:a,styleId:l}=ot(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:Ke(((e,t,s)=>{var[o]=s,{id:a,styleId:l}=ot(t,i,n.styleMirror);return(a&&-1!==a||l&&-1!==l)&&r({id:a,styleId:l,replaceSync:o}),e.apply(t,s)}))}));var c={};ct("CSSGroupingRule")?c.CSSGroupingRule=s.CSSGroupingRule:(ct("CSSMediaRule")&&(c.CSSMediaRule=s.CSSMediaRule),ct("CSSConditionRule")&&(c.CSSConditionRule=s.CSSConditionRule),ct("CSSSupportsRule")&&(c.CSSSupportsRule=s.CSSSupportsRule));var d={};return Object.entries(c).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:Ke(((e,t,s)=>{var[o,a]=s,{id:l,styleId:u}=ot(t.parentStyleSheet,i,n.styleMirror);return(l&&-1!==l||u&&-1!==u)&&r({id:l,styleId:u,adds:[{rule:o,index:[...st(t),a||0]}]}),e.apply(t,s)}))}),s.prototype.deleteRule=new Proxy(d[t].deleteRule,{apply:Ke(((e,t,s)=>{var[o]=s,{id:a,styleId:l}=ot(t.parentStyleSheet,i,n.styleMirror);return(a&&-1!==a||l&&-1!==l)&&r({id:a,styleId:l,removes:[{index:[...st(t),o]}]}),e.apply(t,s)}))})})),Ke((()=>{s.CSSStyleSheet.prototype.insertRule=o,s.CSSStyleSheet.prototype.deleteRule=u,a&&(s.CSSStyleSheet.prototype.replace=a),l&&(s.CSSStyleSheet.prototype.replaceSync=l),Object.entries(c).forEach((e=>{var[t,r]=e;r.prototype.insertRule=d[t].insertRule,r.prototype.deleteRule=d[t].deleteRule}))}))}(e,{win:n}),h=at(e,e.doc),p=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:Ke(((e,t,o)=>{var l,[u,c,d]=o;if(n.has(u))return a.apply(t,[u,c,d]);var{id:h,styleId:p}=ot(null==(l=t.parentRule)?void 0:l.parentStyleSheet,i,s.styleMirror);return(h&&-1!==h||p&&-1!==p)&&r({id:h,styleId:p,set:{property:u,value:c,priority:d},index:st(t.parentRule)}),e.apply(t,o)}))});var l=o.CSSStyleDeclaration.prototype.removeProperty;return o.CSSStyleDeclaration.prototype.removeProperty=new Proxy(l,{apply:Ke(((e,t,o)=>{var a,[u]=o;if(n.has(u))return l.apply(t,[u]);var{id:c,styleId:d}=ot(null==(a=t.parentRule)?void 0:a.parentStyleSheet,i,s.styleMirror);return(c&&-1!==c||d&&-1!==d)&&r({id:c,styleId:d,remove:{property:u},index:st(t.parentRule)}),e.apply(t,o)}))}),Ke((()=>{o.CSSStyleDeclaration.prototype.setProperty=a,o.CSSStyleDeclaration.prototype.removeProperty=l}))}(e,{win:n}),e.collectFonts&&(v=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=ye(r.fonts,"add",(function(e){return function(r){return setTimeout(Ke((()=>{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),Ke((()=>{n.forEach((e=>e()))}))}(e)));var g=function(e){var{doc:t,mirror:r,blockClass:i,blockSelector:n,selectionCb:s}=e,o=!0,a=Ke((()=>{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;u<l;u++){var c=e.getRangeAt(u),{startContainer:d,startOffset:h,endContainer:p,endOffset:v}=c;ke(d,i,n,!0)||ke(p,i,n,!0)||a.push({start:r.getId(d),startOffset:h,end:r.getId(p),endOffset:v})}s({ranges:a})}}));return a(),ve("selectionchange",a)}(e),_=function(e){var{doc:t,customElementCb:r}=e,i=t.defaultView;return i&&i.customElements?ye(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),f=[];for(var m of e.plugins)f.push(m.observer(m.callback,n,m.options));return Ke((()=>{Je.forEach((e=>e.reset())),null==i||i.disconnect(),s(),o(),a(),l(),u(),c(),d(),h(),p(),v(),g(),_(),f.forEach((e=>e()))}))}function ut(e){return void 0!==window[e]}function ct(e){return Boolean(void 0!==window[e]&&window[e].prototype&&"insertRule"in window[e].prototype&&"deleteRule"in window[e].prototype)}class dt{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);if("number"!=typeof t)return t;var n=i.get(t);return n||-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||(t=new Map,this.iframeIdToRemoteIdMap.set(e,t)),t}getRemoteIdToIdMap(e){var t=this.iframeRemoteIdToIdMap.get(e);return t||(t=new Map,this.iframeRemoteIdToIdMap.set(e,t)),t}}class ht{constructor(e){a(this,"iframes",new WeakMap),a(this,"crossOriginIframeMap",new WeakMap),a(this,"crossOriginIframeMirror",new dt(U)),a(this,"crossOriginIframeStyleMirror"),a(this,"crossOriginIframeRootIdMap",new WeakMap),a(this,"mirror"),a(this,"mutationCb"),a(this,"wrappedEmit"),a(this,"loadListener"),a(this,"stylesheetManager"),a(this,"recordCrossOriginIframes"),this.mutationCb=e.mutationCb,this.wrappedEmit=e.wrappedEmit,this.stylesheetManager=e.stylesheetManager,this.recordCrossOriginIframes=e.recordCrossOriginIframes,this.crossOriginIframeStyleMirror=new dt(this.stylesheetManager.styleMirror.generateId.bind(this.stylesheetManager.styleMirror)),this.mirror=e.mirror,this.recordCrossOriginIframes&&window.addEventListener("message",this.handleMessage.bind(this))}addIframe(e){this.iframes.set(e,!0),e.contentWindow&&this.crossOriginIframeMap.set(e.contentWindow,e)}addLoadListener(e){this.loadListener=e}attachIframe(e,t){var r,i;this.mutationCb({adds:[{parentId:this.mirror.getId(e),nextId:null,node:t}],removes:[],texts:[],attributes:[],isAttachIframe:!0}),this.recordCrossOriginIframes&&(null==(r=e.contentWindow)||r.addEventListener("message",this.handleMessage.bind(this))),null==(i=this.loadListener)||i.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 Oe.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),{timestamp:t.timestamp,type:Oe.IncrementalSnapshot,data:{source:De.Mutation,adds:[{parentId:this.mirror.getId(e),nextId:null,node:t.data.node}],removes:[],texts:[],attributes:[],isAttachIframe:!0}};case Oe.Meta:case Oe.Load:case Oe.DomContentLoaded:return!1;case Oe.Plugin:return t;case Oe.Custom:return this.replaceIds(t.data.payload,e,["id","parentId","previousId","nextId"]),t;case Oe.IncrementalSnapshot:switch(t.data.source){case De.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 De.Drag:case De.TouchMove:case De.MouseMove:return t.data.positions.forEach((t=>{this.replaceIds(t,e,["id"])})),t;case De.ViewportResize:return!1;case De.MediaInteraction:case De.MouseInteraction:case De.Scroll:case De.CanvasMutation:case De.Input:return this.replaceIds(t.data,e,["id"]),t;case De.StyleSheetRule:case De.StyleDeclaration:return this.replaceIds(t.data,e,["id"]),this.replaceStyleIds(t.data,e,["styleId"]),t;case De.Font:return t;case De.Selection:return t.data.ranges.forEach((t=>{this.replaceIds(t,e,["start","end"])})),t;case De.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])&&(Array.isArray(t[n])?t[n]=e.getIds(r,t[n]):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===c.Document||e.rootId||(e.rootId=t),"childNodes"in e&&e.childNodes.forEach((e=>{this.patchRootIdOnNode(e,t)}))}}class pt{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(w(e)&&!this.shadowDoms.has(e)){this.shadowDoms.add(e);var i=et(r({},this.bypassOptions,{doc:t,mutationCb:this.mutationCb,mirror:this.mirror,shadowDomManager:this}),e);this.restoreHandlers.push((()=>i.disconnect())),this.restoreHandlers.push(rt(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(pe.host(e))),this.restoreHandlers.push(at({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(ye(e.prototype,"attachShadow",(function(e){return function(i){var n=e.call(this,i),s=pe.shadowRoot(this);return s&&Le(this)&&r.addShadowRoot(s,t),n}})))}reset(){this.restoreHandlers.forEach((e=>{try{e()}catch(e){}})),this.restoreHandlers=[],this.shadowDoms=new WeakSet}}for(var vt="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",gt="undefined"==typeof Uint8Array?[]:new Uint8Array(256),_t=0;_t<64;_t++)gt[vt.charCodeAt(_t)]=_t;var ft=new Map;var mt=(e,t,r)=>{if(e&&(St(e,t)||"object"==typeof e)){var i=function(e,t){var r=ft.get(e);return r||(r=new Map,ft.set(e,r)),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 yt(e,t,r){if(e instanceof Array)return e.map((e=>yt(e,t,r)));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)return{rr_type:e.constructor.name,base64:function(e){var t,r=new Uint8Array(e),i=r.length,n="";for(t=0;t<i;t+=3)n+=vt[r[t]>>2],n+=vt[(3&r[t])<<4|r[t+1]>>4],n+=vt[(15&r[t+1])<<2|r[t+2]>>6],n+=vt[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)};if(e instanceof DataView)return{rr_type:e.constructor.name,args:[yt(e.buffer,t,r),e.byteOffset,e.byteLength]};if(e instanceof HTMLImageElement){var i=e.constructor.name,{src:n}=e;return{rr_type:i,src:n}}if(e instanceof HTMLCanvasElement){return{rr_type:"HTMLImageElement",src:e.toDataURL()}}return e instanceof ImageData?{rr_type:e.constructor.name,args:[yt(e.data,t,r),e.width,e.height]}:St(e,t)||"object"==typeof e?{rr_type:e.constructor.name,index:mt(e,t,r)}:e}var bt=(e,t,r)=>e.map((e=>yt(e,t,r))),St=(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])))};function wt(e,t,r,i){var n=[];try{var s=ye(e.HTMLCanvasElement.prototype,"getContext",(function(e){return function(n){for(var s=arguments.length,o=new Array(s>1?s-1:0),a=1;a<s;a++)o[a-1]=arguments[a];if(!ke(this,t,r,!0)){var l=function(e){return"experimental-webgl"===e?"webgl":e}(n);if("__context"in this||(this.__context=l),i&&["webgl","webgl2"].includes(l))if(o[0]&&"object"==typeof o[0]){var u=o[0];u.preserveDrawingBuffer||(u.preserveDrawingBuffer=!0)}else o.splice(0,1,{preserveDrawingBuffer:!0})}return e.apply(this,[n,...o])}}));n.push(s)}catch(e){console.error("failed to patch HTMLCanvasElement.prototype.getContext")}return()=>{n.forEach((e=>e()))}}function Ct(e,t,r,i,n,s){var o=[],a=Object.getOwnPropertyNames(e),l=function(a){if(["isContextLost","canvas","drawingBufferWidth","drawingBufferHeight"].includes(a))return 0;try{if("function"!=typeof e[a])return 0;var l=ye(e,a,(function(e){return function(){for(var o=arguments.length,l=new Array(o),u=0;u<o;u++)l[u]=arguments[u];var c=e.apply(this,l);if(mt(c,s,this),"tagName"in this.canvas&&!ke(this.canvas,i,n,!0)){var d=bt(l,s,this),h={type:t,property:a,args:d};r(this.canvas,h)}return c}}));o.push(l)}catch(i){var u=me(e,a,{set(e){r(this.canvas,{type:t,property:a,args:[e],setter:!0})}});o.push(u)}};for(var u of a)l(u);return o}var It,kt,Et,xt,Tt="KGZ1bmN0aW9uKCkgewogICJ1c2Ugc3RyaWN0IjsKICB2YXIgY2hhcnMgPSAiQUJDREVGR0hJSktMTU5PUFFSU1RVVldYWVphYmNkZWZnaGlqa2xtbm9wcXJzdHV2d3h5ejAxMjM0NTY3ODkrLyI7CiAgdmFyIGxvb2t1cCA9IHR5cGVvZiBVaW50OEFycmF5ID09PSAidW5kZWZpbmVkIiA/IFtdIDogbmV3IFVpbnQ4QXJyYXkoMjU2KTsKICBmb3IgKHZhciBpID0gMDsgaSA8IGNoYXJzLmxlbmd0aDsgaSsrKSB7CiAgICBsb29rdXBbY2hhcnMuY2hhckNvZGVBdChpKV0gPSBpOwogIH0KICB2YXIgZW5jb2RlID0gZnVuY3Rpb24oYXJyYXlidWZmZXIpIHsKICAgIHZhciBieXRlcyA9IG5ldyBVaW50OEFycmF5KGFycmF5YnVmZmVyKSwgaTIsIGxlbiA9IGJ5dGVzLmxlbmd0aCwgYmFzZTY0ID0gIiI7CiAgICBmb3IgKGkyID0gMDsgaTIgPCBsZW47IGkyICs9IDMpIHsKICAgICAgYmFzZTY0ICs9IGNoYXJzW2J5dGVzW2kyXSA+PiAyXTsKICAgICAgYmFzZTY0ICs9IGNoYXJzWyhieXRlc1tpMl0gJiAzKSA8PCA0IHwgYnl0ZXNbaTIgKyAxXSA+PiA0XTsKICAgICAgYmFzZTY0ICs9IGNoYXJzWyhieXRlc1tpMiArIDFdICYgMTUpIDw8IDIgfCBieXRlc1tpMiArIDJdID4+IDZdOwogICAgICBiYXNlNjQgKz0gY2hhcnNbYnl0ZXNbaTIgKyAyXSAmIDYzXTsKICAgIH0KICAgIGlmIChsZW4gJSAzID09PSAyKSB7CiAgICAgIGJhc2U2NCA9IGJhc2U2NC5zdWJzdHJpbmcoMCwgYmFzZTY0Lmxlbmd0aCAtIDEpICsgIj0iOwogICAgfSBlbHNlIGlmIChsZW4gJSAzID09PSAxKSB7CiAgICAgIGJhc2U2NCA9IGJhc2U2NC5zdWJzdHJpbmcoMCwgYmFzZTY0Lmxlbmd0aCAtIDIpICsgIj09IjsKICAgIH0KICAgIHJldHVybiBiYXNlNjQ7CiAgfTsKICBjb25zdCBsYXN0QmxvYk1hcCA9IC8qIEBfX1BVUkVfXyAqLyBuZXcgTWFwKCk7CiAgY29uc3QgdHJhbnNwYXJlbnRCbG9iTWFwID0gLyogQF9fUFVSRV9fICovIG5ldyBNYXAoKTsKICBhc3luYyBmdW5jdGlvbiBnZXRUcmFuc3BhcmVudEJsb2JGb3Iod2lkdGgsIGhlaWdodCwgZGF0YVVSTE9wdGlvbnMpIHsKICAgIGNvbnN0IGlkID0gYCR7d2lkdGh9LSR7aGVpZ2h0fWA7CiAgICBpZiAoIk9mZnNjcmVlbkNhbnZhcyIgaW4gZ2xvYmFsVGhpcykgewogICAgICBpZiAodHJhbnNwYXJlbnRCbG9iTWFwLmhhcyhpZCkpIHJldHVybiB0cmFuc3BhcmVudEJsb2JNYXAuZ2V0KGlkKTsKICAgICAgY29uc3Qgb2Zmc2NyZWVuID0gbmV3IE9mZnNjcmVlbkNhbnZhcyh3aWR0aCwgaGVpZ2h0KTsKICAgICAgb2Zmc2NyZWVuLmdldENvbnRleHQoIjJkIik7CiAgICAgIGNvbnN0IGJsb2IgPSBhd2FpdCBvZmZzY3JlZW4uY29udmVydFRvQmxvYihkYXRhVVJMT3B0aW9ucyk7CiAgICAgIGNvbnN0IGFycmF5QnVmZmVyID0gYXdhaXQgYmxvYi5hcnJheUJ1ZmZlcigpOwogICAgICBjb25zdCBiYXNlNjQgPSBlbmNvZGUoYXJyYXlCdWZmZXIpOwogICAgICB0cmFuc3BhcmVudEJsb2JNYXAuc2V0KGlkLCBiYXNlNjQpOwogICAgICByZXR1cm4gYmFzZTY0OwogICAgfSBlbHNlIHsKICAgICAgcmV0dXJuICIiOwogICAgfQogIH0KICBjb25zdCB3b3JrZXIgPSBzZWxmOwogIHdvcmtlci5vbm1lc3NhZ2UgPSBhc3luYyBmdW5jdGlvbihlKSB7CiAgICBpZiAoIk9mZnNjcmVlbkNhbnZhcyIgaW4gZ2xvYmFsVGhpcykgewogICAgICBjb25zdCB7IGlkLCBiaXRtYXAsIHdpZHRoLCBoZWlnaHQsIGRhdGFVUkxPcHRpb25zIH0gPSBlLmRhdGE7CiAgICAgIGNvbnN0IHRyYW5zcGFyZW50QmFzZTY0ID0gZ2V0VHJhbnNwYXJlbnRCbG9iRm9yKAogICAgICAgIHdpZHRoLAogICAgICAgIGhlaWdodCwKICAgICAgICBkYXRhVVJMT3B0aW9ucwogICAgICApOwogICAgICBjb25zdCBvZmZzY3JlZW4gPSBuZXcgT2Zmc2NyZWVuQ2FudmFzKHdpZHRoLCBoZWlnaHQpOwogICAgICBjb25zdCBjdHggPSBvZmZzY3JlZW4uZ2V0Q29udGV4dCgiMmQiKTsKICAgICAgY3R4LmRyYXdJbWFnZShiaXRtYXAsIDAsIDApOwogICAgICBiaXRtYXAuY2xvc2UoKTsKICAgICAgY29uc3QgYmxvYiA9IGF3YWl0IG9mZnNjcmVlbi5jb252ZXJ0VG9CbG9iKGRhdGFVUkxPcHRpb25zKTsKICAgICAgY29uc3QgdHlwZSA9IGJsb2IudHlwZTsKICAgICAgY29uc3QgYXJyYXlCdWZmZXIgPSBhd2FpdCBibG9iLmFycmF5QnVmZmVyKCk7CiAgICAgIGNvbnN0IGJhc2U2NCA9IGVuY29kZShhcnJheUJ1ZmZlcik7CiAgICAgIGlmICghbGFzdEJsb2JNYXAuaGFzKGlkKSAmJiBhd2FpdCB0cmFuc3BhcmVudEJhc2U2NCA9PT0gYmFzZTY0KSB7CiAgICAgICAgbGFzdEJsb2JNYXAuc2V0KGlkLCBiYXNlNjQpOwogICAgICAgIHJldHVybiB3b3JrZXIucG9zdE1lc3NhZ2UoeyBpZCB9KTsKICAgICAgfQogICAgICBpZiAobGFzdEJsb2JNYXAuZ2V0KGlkKSA9PT0gYmFzZTY0KSByZXR1cm4gd29ya2VyLnBvc3RNZXNzYWdlKHsgaWQgfSk7CiAgICAgIHdvcmtlci5wb3N0TWVzc2FnZSh7CiAgICAgICAgaWQsCiAgICAgICAgdHlwZSwKICAgICAgICBiYXNlNjQsCiAgICAgICAgd2lkdGgsCiAgICAgICAgaGVpZ2h0CiAgICAgIH0pOwogICAgICBsYXN0QmxvYk1hcC5zZXQoaWQsIGJhc2U2NCk7CiAgICB9IGVsc2UgewogICAgICByZXR1cm4gd29ya2VyLnBvc3RNZXNzYWdlKHsgaWQ6IGUuZGF0YS5pZCB9KTsKICAgIH0KICB9Owp9KSgpOwovLyMgc291cmNlTWFwcGluZ1VSTD1pbWFnZS1iaXRtYXAtZGF0YS11cmwtd29ya2VyLUlKcEM3Z19iLmpzLm1hcAo=",Mt="undefined"!=typeof window&&window.Blob&&new Blob([(It=Tt,Uint8Array.from(atob(It),(e=>e.charCodeAt(0))))],{type:"text/javascript;charset=utf-8"});function Rt(e){var t;try{if(!(t=Mt&&(window.URL||window.webkitURL).createObjectURL(Mt)))throw"";var r=new Worker(t,{name:null==e?void 0:e.name});return r.addEventListener("error",(()=>{(window.URL||window.webkitURL).revokeObjectURL(t)})),r}catch(t){return new Worker("data:text/javascript;base64,"+Tt,{name:null==e?void 0:e.name})}finally{t&&(window.URL||window.webkitURL).revokeObjectURL(t)}}class Pt{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,"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}=e;this.mutationCb=e.mutationCb,this.mirror=e.mirror,s&&"all"===t&&this.initCanvasMutationObserver(r,i,n),s&&"number"==typeof t&&this.initCanvasFPSObserver(t,r,i,n,{dataURLOptions:o})}reset(){this.pendingCanvasMutations.clear(),this.resetObservers&&this.resetObservers()}freeze(){this.frozen=!0}unfreeze(){this.frozen=!1}lock(){this.locked=!0}unlock(){this.locked=!1}initCanvasFPSObserver(e,r,i,n,s){var o=this,a=wt(r,i,n,!0),l=new Map,u=new Rt;u.onmessage=e=>{var{id:t}=e.data;if(l.set(t,!1),"base64"in e.data){var{base64:r,type:i,width:n,height:s}=e.data;this.mutationCb({id:t,type:Be["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]}]})}};var c,d=1e3/e,h=0,p=e=>{var a,v;h&&e-h<d?c=requestAnimationFrame(p):(h=e,(a=[],v=e=>{e.querySelectorAll("canvas").forEach((e=>{ke(e,i,n,!0)||a.push(e)})),e.querySelectorAll("*").forEach((e=>{e.shadowRoot&&v(e.shadowRoot)}))},v(r.document),a).forEach(function(){var e=t((function*(e){var t,r=o.mirror.getId(e);if(!l.get(r)&&0!==e.width&&0!==e.height){if(l.set(r,!0),["webgl","webgl2"].includes(e.__context)){var i=e.getContext(e.__context);!1===(null==(t=null==i?void 0:i.getContextAttributes())?void 0:t.preserveDrawingBuffer)&&i.clear(i.COLOR_BUFFER_BIT)}var n=e.clientWidth||e.width,a=e.clientHeight||e.height,c=yield createImageBitmap(e,{resizeWidth:n,resizeHeight:a});u.postMessage({id:r,bitmap:c,width:n,height:a,dataURLOptions:s.dataURLOptions},[c])}}));return function(t){return e.apply(this,arguments)}}()),c=requestAnimationFrame(p))};c=requestAnimationFrame(p),this.resetObservers=()=>{a(),cancelAnimationFrame(c)}}initCanvasMutationObserver(e,t,r){this.startRAFTimestamping(),this.startPendingCanvasMutationFlusher();var i=wt(e,t,r,!1),n=function(e,t,r,i){var n=[],s=Object.getOwnPropertyNames(t.CanvasRenderingContext2D.prototype),o=function(s){try{if("function"!=typeof t.CanvasRenderingContext2D.prototype[s])return 1;var o=ye(t.CanvasRenderingContext2D.prototype,s,(function(n){return function(){for(var o=arguments.length,a=new Array(o),l=0;l<o;l++)a[l]=arguments[l];return ke(this.canvas,r,i,!0)||setTimeout((()=>{var r=bt(a,t,this);e(this.canvas,{type:Be["2D"],property:s,args:r})}),0),n.apply(this,a)}}));n.push(o)}catch(r){var a=me(t.CanvasRenderingContext2D.prototype,s,{set(t){e(this.canvas,{type:Be["2D"],property:s,args:[t],setter:!0})}});n.push(a)}};for(var a of s)o(a);return()=>{n.forEach((e=>e()))}}(this.processMutation.bind(this),e,t,r),s=function(e,t,r,i){var n=[];return n.push(...Ct(t.WebGLRenderingContext.prototype,Be.WebGL,e,r,i,t)),void 0!==t.WebGL2RenderingContext&&n.push(...Ct(t.WebGL2RenderingContext.prototype,Be.WebGL2,e,r,i,t)),()=>{n.forEach((e=>e()))}}(this.processMutation.bind(this),e,t,r);this.resetObservers=()=>{i(),n(),s()}}startPendingCanvasMutationFlusher(){requestAnimationFrame((()=>this.flushPendingCanvasMutations()))}startRAFTimestamping(){var e=t=>{this.rafStamps.latestId=t,requestAnimationFrame(e)};requestAnimationFrame(e)}flushPendingCanvasMutations(){this.pendingCanvasMutations.forEach(((e,t)=>{var r=this.mirror.getId(t);this.flushPendingCanvasMutationFor(t,r)})),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 At{constructor(e){a(this,"trackedLinkElements",new WeakSet),a(this,"mutationCb"),a(this,"adoptedStyleSheetCb"),a(this,"styleMirror",new Ae),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:I(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}trackStylesheetInLinkElement(e){}}class Nt{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 Ft=!1;try{if(2!==Array.from([1],(e=>2*e))[0]){var Lt=document.createElement("iframe");document.body.appendChild(Lt),Array.from=(null==(n=Lt.contentWindow)?void 0:n.Array.from)||Array.from,document.body.removeChild(Lt)}}catch(e){console.debug("Unable to override Array.from",e)}var Ot,Dt,Ht=new E;function qt(e){void 0===e&&(e={});var{emit:t,checkoutEveryNms:i,checkoutEveryNth:n,blockClass:s="rr-block",blockSelector:o=null,ignoreClass:a="rr-ignore",ignoreSelector:l=null,maskTextClass:u="rr-mask",maskTextSelector:c=null,inlineStylesheet:d=!0,maskAllInputs:h,maskInputOptions:p,slimDOMOptions:v,maskInputFn:g,maskTextFn:_,hooks:f,packFn:m,sampling:y={},dataURLOptions:b={},mousemoveWait:S,recordDOM:w=!0,recordCanvas:C=!1,recordCrossOriginIframes:I=!1,recordAfter:k=("DOMContentLoaded"===e.recordAfter?e.recordAfter:"load"),userTriggeredOnInput:x=!1,collectFonts:T=!1,inlineImages:M=!1,plugins:R,keepIframeSrcFn:P=(()=>!1),ignoreCSSAttributes:A=new Set([]),errorHandler:N}=e;We=N;var F=!I||window.parent===window,L=!1;if(!F)try{window.parent.document&&(L=!1)}catch(e){L=!0}if(F&&!t)throw new Error("emit function is required");if(!F&&!L)return()=>{};void 0!==S&&void 0===y.mousemove&&(y.mousemove=S),Ht.reset();var O,D=!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}:void 0!==p?p:{password:!0},H=!0===v||"all"===v?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaVerification:!0,headMetaAuthorship:"all"===v,headMetaDescKeywords:"all"===v,headTitleMutations:"all"===v}:v||{};!function(e){void 0===e&&(e=window),"NodeList"in e&&!e.NodeList.prototype.forEach&&(e.NodeList.prototype.forEach=Array.prototype.forEach),"DOMTokenList"in e&&!e.DOMTokenList.prototype.forEach&&(e.DOMTokenList.prototype.forEach=Array.prototype.forEach)}();var q=0,B=e=>{for(var t of R||[])t.eventProcessor&&(e=t.eventProcessor(e));return m&&!L&&(e=m(e)),e};kt=(e,r)=>{var s,o=e;if(o.timestamp=be(),!(null==(s=Je[0])?void 0:s.isFrozen())||o.type===Oe.FullSnapshot||o.type===Oe.IncrementalSnapshot&&o.data.source===De.Mutation||Je.forEach((e=>e.unfreeze())),F)null==t||t(B(o),r);else if(L){var a={type:"rrweb",event:B(o),origin:window.location.origin,isCheckout:r};window.parent.postMessage(a,"*")}if(o.type===Oe.FullSnapshot)O=o,q=0;else if(o.type===Oe.IncrementalSnapshot){if(o.data.source===De.Mutation&&o.data.isAttachIframe)return;q++;var l=n&&q>=n,u=i&&o.timestamp-O.timestamp>i;(l||u)&&Et(!0)}};var V=e=>{kt({type:Oe.IncrementalSnapshot,data:r({source:De.Mutation},e)})},U=e=>kt({type:Oe.IncrementalSnapshot,data:r({source:De.Scroll},e)}),W=e=>kt({type:Oe.IncrementalSnapshot,data:r({source:De.CanvasMutation},e)}),z=new At({mutationCb:V,adoptedStyleSheetCb:e=>kt({type:Oe.IncrementalSnapshot,data:r({source:De.AdoptedStyleSheet},e)})}),j=new ht({mirror:Ht,mutationCb:V,stylesheetManager:z,recordCrossOriginIframes:I,wrappedEmit:kt});for(var Z of R||[])Z.getMirror&&Z.getMirror({nodeMirror:Ht,crossOriginIframeMirror:j.crossOriginIframeMirror,crossOriginIframeStyleMirror:j.crossOriginIframeStyleMirror});var G=new Nt;xt=new Pt({recordCanvas:C,mutationCb:W,win:window,blockClass:s,blockSelector:o,mirror:Ht,sampling:y.canvas,dataURLOptions:b});var Y=new pt({mutationCb:V,scrollCb:U,bypassOptions:{blockClass:s,blockSelector:o,maskTextClass:u,maskTextSelector:c,inlineStylesheet:d,maskInputOptions:D,dataURLOptions:b,maskTextFn:_,maskInputFn:g,recordCanvas:C,inlineImages:M,sampling:y,slimDOMOptions:H,iframeManager:j,stylesheetManager:z,canvasManager:xt,keepIframeSrcFn:P,processedNodeManager:G},mirror:Ht});Et=function(e){if(void 0===e&&(e=!1),w){kt({type:Oe.Meta,data:{href:window.location.href,width:Ce(),height:we()}},e),z.reset(),Y.init(),Je.forEach((e=>e.lock()));var t=function(e,t){var{mirror:r=new E,blockClass:i="rr-block",blockSelector:n=null,maskTextClass:s="rr-mask",maskTextSelector:o=null,inlineStylesheet:a=!0,inlineImages:l=!1,recordCanvas:u=!1,maskAllInputs:c=!1,maskTextFn:d,maskInputFn:h,slimDOM:p=!1,dataURLOptions:v,preserveWhiteSpace:g,onSerialize:_,onIframeLoad:f,iframeLoadTimeout:m,onStylesheetLoad:y,stylesheetLoadTimeout:b,keepIframeSrcFn:S=(()=>!1)}=t||{};return re(e,{doc:e,mirror:r,blockClass:i,blockSelector:n,maskTextClass:s,maskTextSelector:o,skipChild:!1,inlineStylesheet:a,maskInputOptions:!0===c?{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===c?{password:!0}:c,maskTextFn:d,maskInputFn:h,slimDOMOptions:!0===p||"all"===p?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaDescKeywords:"all"===p,headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaAuthorship:!0,headMetaVerification:!0}:!1===p?{}:p,dataURLOptions:v,inlineImages:l,recordCanvas:u,preserveWhiteSpace:g,onSerialize:_,onIframeLoad:f,iframeLoadTimeout:m,onStylesheetLoad:y,stylesheetLoadTimeout:b,keepIframeSrcFn:S,newlyAddedElement:!1})}(document,{mirror:Ht,blockClass:s,blockSelector:o,maskTextClass:u,maskTextSelector:c,inlineStylesheet:d,maskAllInputs:D,maskTextFn:_,maskInputFn:g,slimDOM:H,dataURLOptions:b,recordCanvas:C,inlineImages:M,onSerialize:e=>{Me(e,Ht)&&j.addIframe(e),Re(e,Ht)&&z.trackLinkElement(e),Pe(e)&&Y.addShadowRoot(pe.shadowRoot(e),document)},onIframeLoad:(e,t)=>{j.attachIframe(e,t),Y.observeAttachShadow(e)},onStylesheetLoad:(e,t)=>{z.attachLinkElement(e,t)},keepIframeSrcFn:P});if(!t)return console.warn("Failed to snapshot the document");kt({type:Oe.FullSnapshot,data:{node:t,initialOffset:Se(window)}},e),Je.forEach((e=>e.unlock())),document.adoptedStyleSheets&&document.adoptedStyleSheets.length>0&&z.adoptStyleSheets(document.adoptedStyleSheets,Ht.getId(document))}};try{var X=[],K=e=>{var t;return Ke(lt)({mutationCb:V,mousemoveCb:(e,t)=>kt({type:Oe.IncrementalSnapshot,data:{source:t,positions:e}}),mouseInteractionCb:e=>kt({type:Oe.IncrementalSnapshot,data:r({source:De.MouseInteraction},e)}),scrollCb:U,viewportResizeCb:e=>kt({type:Oe.IncrementalSnapshot,data:r({source:De.ViewportResize},e)}),inputCb:e=>kt({type:Oe.IncrementalSnapshot,data:r({source:De.Input},e)}),mediaInteractionCb:e=>kt({type:Oe.IncrementalSnapshot,data:r({source:De.MediaInteraction},e)}),styleSheetRuleCb:e=>kt({type:Oe.IncrementalSnapshot,data:r({source:De.StyleSheetRule},e)}),styleDeclarationCb:e=>kt({type:Oe.IncrementalSnapshot,data:r({source:De.StyleDeclaration},e)}),canvasMutationCb:W,fontCb:e=>kt({type:Oe.IncrementalSnapshot,data:r({source:De.Font},e)}),selectionCb:e=>{kt({type:Oe.IncrementalSnapshot,data:r({source:De.Selection},e)})},customElementCb:e=>{kt({type:Oe.IncrementalSnapshot,data:r({source:De.CustomElement},e)})},blockClass:s,ignoreClass:a,ignoreSelector:l,maskTextClass:u,maskTextSelector:c,maskInputOptions:D,inlineStylesheet:d,sampling:y,recordDOM:w,recordCanvas:C,inlineImages:M,userTriggeredOnInput:x,collectFonts:T,doc:e,maskInputFn:g,maskTextFn:_,keepIframeSrcFn:P,blockSelector:o,slimDOMOptions:H,dataURLOptions:b,mirror:Ht,iframeManager:j,stylesheetManager:z,shadowDomManager:Y,processedNodeManager:G,canvasManager:xt,ignoreCSSAttributes:A,plugins:(null==(t=null==R?void 0:R.filter((e=>e.observer)))?void 0:t.map((e=>({observer:e.observer,options:e.options,callback:t=>kt({type:Oe.Plugin,data:{plugin:e.name,payload:t}})}))))||[]},f)};j.addLoadListener((e=>{try{X.push(K(e.contentDocument))}catch(e){console.warn(e)}}));var J=()=>{Et(),X.push(K(document)),Ft=!0};return"interactive"===document.readyState||"complete"===document.readyState?J():(X.push(ve("DOMContentLoaded",(()=>{kt({type:Oe.DomContentLoaded,data:{}}),"DOMContentLoaded"===k&&J()}))),X.push(ve("load",(()=>{kt({type:Oe.Load,data:{}}),"load"===k&&J()}),window))),()=>{X.forEach((e=>e())),G.destroy(),Ft=!1,We=void 0}}catch(e){console.warn(e)}}qt.addCustomEvent=(e,t)=>{if(!Ft)throw new Error("please add custom event after start recording");kt({type:Oe.Custom,data:{tag:e,payload:t}})},qt.freezePage=()=>{Je.forEach((e=>e.freeze()))},qt.takeFullSnapshot=e=>{if(!Ft)throw new Error("please take full snapshot after start recording");Et(e)},qt.mirror=Ht,(Dt=Ot||(Ot={}))[Dt.NotStarted=0]="NotStarted",Dt[Dt.Running=1]="Running",Dt[Dt.Stopped=2]="Stopped";var Bt,Vt=Object.defineProperty,$t=(e,t,r)=>((e,t,r)=>t in e?Vt(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r)(e,"symbol"!=typeof t?t+"":t,r),Ut=Object.defineProperty,Wt=(e,t,r)=>((e,t,r)=>t in e?Ut(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r)(e,"symbol"!=typeof t?t+"":t,r),zt=Object.defineProperty,jt=(e,t,r)=>((e,t,r)=>t in e?zt(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r)(e,"symbol"!=typeof t?t+"":t,r),Zt={Node:["childNodes","parentNode","parentElement","textContent"],ShadowRoot:["host","styleSheets"],Element:["shadowRoot","querySelector","querySelectorAll"],MutationObserver:[]},Gt={Node:["contains","getRootNode"],ShadowRoot:["getSelection"],Element:[],MutationObserver:["constructor"]},Yt={};function Xt(e){if(Yt[e])return Yt[e];var t=globalThis[e],r=t.prototype,i=e in Zt?Zt[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 Gt?Gt[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 Yt[e]=t.prototype,t.prototype;try{var a=document.createElement("iframe");document.body.appendChild(a);var l=a.contentWindow;if(!l)return t.prototype;var u=l[e].prototype;return document.body.removeChild(a),u?Yt[e]=u:r}catch(e){return r}}var Kt={};function Jt(e,t,r){var i,n=e+"."+String(r);if(Kt[n])return Kt[n].call(t);var s=Xt(e),o=null==(i=Object.getOwnPropertyDescriptor(s,r))?void 0:i.get;return o?(Kt[n]=o,o.call(t)):t[r]}var Qt={};function er(e,t,r){var i=e+"."+String(r);if(Qt[i])return Qt[i].bind(t);var n=Xt(e)[r];return"function"!=typeof n?t[r]:(Qt[i]=n,n.bind(t))}var tr={childNodes:function(e){return Jt("Node",e,"childNodes")},parentNode:function(e){return Jt("Node",e,"parentNode")},parentElement:function(e){return Jt("Node",e,"parentElement")},textContent:function(e){return Jt("Node",e,"textContent")},contains:function(e,t){return er("Node",e,"contains")(t)},getRootNode:function(e){return er("Node",e,"getRootNode")()},host:function(e){return e&&"host"in e?Jt("ShadowRoot",e,"host"):null},styleSheets:function(e){return e.styleSheets},shadowRoot:function(e){return e&&"shadowRoot"in e?Jt("Element",e,"shadowRoot"):null},querySelector:function(e,t){return Jt("Element",e,"querySelector")(t)},querySelectorAll:function(e,t){return Jt("Element",e,"querySelectorAll")(t)},mutationObserver:function(){return Xt("MutationObserver").constructor}};class rr{constructor(){jt(this,"idNodeMap",new Map),jt(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);this.idNodeMap.delete(t),e.childNodes&&e.childNodes.forEach((e=>this.removeNodeFromMap(e)))}has(e){return this.idNodeMap.has(e)}hasNode(e){return this.nodeMetaMap.has(e)}add(e,t){var r=t.id;this.idNodeMap.set(r,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 ir(e,t,r){if(!e)return!1;if(e.nodeType!==e.ELEMENT_NODE)return!!r&&ir(tr.parentNode(e),t,r);for(var i=e.classList.length;i--;){var n=e.classList[i];if(t.test(n))return!0}return!!r&&ir(tr.parentNode(e),t,r)}class nr{constructor(){__publicField22(this,"parentElement",null),__publicField22(this,"parentNode",null),__publicField22(this,"ownerDocument"),__publicField22(this,"firstChild",null),__publicField22(this,"lastChild",null),__publicField22(this,"previousSibling",null),__publicField22(this,"nextSibling",null),__publicField22(this,"ELEMENT_NODE",1),__publicField22(this,"TEXT_NODE",3),__publicField22(this,"nodeType"),__publicField22(this,"nodeName"),__publicField22(this,"RRNodeType")}get childNodes(){for(var e=[],t=this.firstChild;t;)e.push(t),t=t.nextSibling;return e}contains(e){if(!(e instanceof nr))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"}}var sr={Node:["childNodes","parentNode","parentElement","textContent"],ShadowRoot:["host","styleSheets"],Element:["shadowRoot","querySelector","querySelectorAll"],MutationObserver:[]},or={Node:["contains","getRootNode"],ShadowRoot:["getSelection"],Element:[],MutationObserver:["constructor"]},ar={};function lr(e){if(ar[e])return ar[e];var t=globalThis[e],r=t.prototype,i=e in sr?sr[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 or?or[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 ar[e]=t.prototype,t.prototype;try{var a=document.createElement("iframe");document.body.appendChild(a);var l=a.contentWindow;if(!l)return t.prototype;var u=l[e].prototype;return document.body.removeChild(a),u?ar[e]=u:r}catch(e){return r}}var ur={};function cr(e,t,r){var i,n=e+"."+String(r);if(ur[n])return ur[n].call(t);var s=lr(e),o=null==(i=Object.getOwnPropertyDescriptor(s,r))?void 0:i.get;return o?(ur[n]=o,o.call(t)):t[r]}var dr={};function hr(e,t,r){var i=e+"."+String(r);if(dr[i])return dr[i].bind(t);var n=lr(e)[r];return"function"!=typeof n?t[r]:(dr[i]=n,n.bind(t))}var pr={childNodes:function(e){return cr("Node",e,"childNodes")},parentNode:function(e){return cr("Node",e,"parentNode")},parentElement:function(e){return cr("Node",e,"parentElement")},textContent:function(e){return cr("Node",e,"textContent")},contains:function(e,t){return hr("Node",e,"contains")(t)},getRootNode:function(e){return hr("Node",e,"getRootNode")()},host:function(e){return e&&"host"in e?cr("ShadowRoot",e,"host"):null},styleSheets:function(e){return e.styleSheets},shadowRoot:function(e){return e&&"shadowRoot"in e?cr("Element",e,"shadowRoot"):null},querySelector:function(e,t){return cr("Element",e,"querySelector")(t)},querySelectorAll:function(e,t){return cr("Element",e,"querySelectorAll")(t)},mutationObserver:function(){return lr("MutationObserver").constructor}};var vr="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.",gr={map:{},getId:()=>(console.error(vr),-1),getNode:()=>(console.error(vr),null),removeNodeFromMap(){console.error(vr)},has:()=>(console.error(vr),!1),reset(){console.error(vr)}};"undefined"!=typeof window&&window.Proxy&&window.Reflect&&(gr=new Proxy(gr,{get:(e,t,r)=>("map"===t&&console.error(vr),Reflect.get(e,t,r))}));var _r=Date.now;function fr(e){return e?e.nodeType===e.ELEMENT_NODE?e:pr.parentElement(e):null}/[1-9][0-9]{12}/.test(Date.now().toString())||(_r=()=>(new Date).getTime());function mr(e){var t,r=null;return"getRootNode"in e&&(null==(t=pr.getRootNode(e))?void 0:t.nodeType)===Node.DOCUMENT_FRAGMENT_NODE&&pr.host(pr.getRootNode(e))&&(r=pr.host(pr.getRootNode(e))),r}function yr(e){for(var t,r=e;t=mr(r);)r=t;return r}function br(e){var t=e.ownerDocument;if(!t)return!1;var r=yr(e);return pr.contains(t,r)}for(var Sr=Object.freeze(Object.defineProperty({__proto__:null,StyleSheetMirror:class{constructor(){Wt(this,"id",1),Wt(this,"styleIDMap",new WeakMap),Wt(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++}},get _mirror(){return gr},closestElementOfNode:fr,getBaseDimension:function e(t,r){var i,n,s=null==(n=null==(i=t.ownerDocument)?void 0:i.defaultView)?void 0:n.frameElement;if(!s||s===r)return{x:0,y:0,relativeScale:1,absoluteScale:1};var o=s.getBoundingClientRect(),a=e(s,r),l=o.height/s.clientHeight;return{x:o.x*a.relativeScale+a.x,y:o.y*a.relativeScale+a.y,relativeScale:l,absoluteScale:a.absoluteScale*l}},getNestedRule:function e(t,r){var i=t[r[0]];return 1===r.length?i:e(i.cssRules[r[1]].cssRules,r.slice(2))},getPositionsAndIndex:function(e){var t=[...e],r=t.pop();return{positions:t,index:r}},getRootShadowHost:yr,getShadowHost:mr,getWindowHeight:function(){return window.innerHeight||document.documentElement&&document.documentElement.clientHeight||document.body&&document.body.clientHeight},getWindowScroll:function(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=pr.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=pr.parentElement(s.body))?void 0:i.scrollTop)||(null==(n=null==s?void 0:s.body)?void 0:n.scrollTop)||0}},getWindowWidth:function(){return window.innerWidth||document.documentElement&&document.documentElement.clientWidth||document.body&&document.body.clientWidth},hasShadowRoot:function(e){return!!e&&(e instanceof nr&&"shadowRoot"in e?Boolean(e.shadowRoot):Boolean(pr.shadowRoot(e)))},hookSetter:function e(t,r,i,n,s){void 0===s&&(s=window);var o=s.Object.getOwnPropertyDescriptor(t,r);return s.Object.defineProperty(t,r,n?i:{set(e){setTimeout((()=>{i.set.call(this,e)}),0),o&&o.set&&o.set.call(this,e)}}),()=>e(t,r,o||{},!0)},inDom:function(e){var t=e.ownerDocument;return!!t&&(pr.contains(t,e)||br(e))},isAncestorRemoved:function e(t,r){if(n=(i=t)&&"host"in i&&"mode"in i&&tr.host(i)||null,Boolean(n&&"shadowRoot"in n&&tr.shadowRoot(n)===i))return!1;var i,n,s=r.getId(t);if(!r.has(s))return!0;var o=pr.parentNode(t);return(!o||o.nodeType!==t.DOCUMENT_NODE)&&(!o||e(o,r))},isBlocked:function(e,t,r,i){if(!e)return!1;var n=fr(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(ir(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},isIgnored:function(e,t,r){return!("TITLE"!==e.tagName||!r.headTitleMutations)||-2===t.getId(e)},isSerialized:function(e,t){return-1!==t.getId(e)},isSerializedIframe:function(e,t){return Boolean("IFRAME"===e.nodeName&&t.getMeta(e))},isSerializedStylesheet:function(e,t){return Boolean("LINK"===e.nodeName&&e.nodeType===e.ELEMENT_NODE&&e.getAttribute&&"stylesheet"===e.getAttribute("rel")&&t.getMeta(e))},iterateResolveTree:function e(t,r){r(t.value);for(var i=t.children.length-1;i>=0;i--)e(t.children[i],r)},legacy_isTouchEvent:function(e){return Boolean(e.changedTouches)},get nowTimestamp(){return _r},on:function(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)},patch:function(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()=>{}}},polyfill:function(e){void 0===e&&(e=window),"NodeList"in e&&!e.NodeList.prototype.forEach&&(e.NodeList.prototype.forEach=Array.prototype.forEach),"DOMTokenList"in e&&!e.DOMTokenList.prototype.forEach&&(e.DOMTokenList.prototype.forEach=Array.prototype.forEach)},queueToResolveTrees:function(e){var t={},r=(e,r)=>{var i={value:e,parent:r,children:[]};return t[e.node.id]=i,i},i=[];for(var n of e){var{nextId:s,parentId:o}=n;if(s&&s in t){var a=t[s];if(a.parent){var l=a.parent.children.indexOf(a);a.parent.children.splice(l,0,r(n,a.parent))}else{var u=i.indexOf(a);i.splice(u,0,r(n,null))}}else if(o in t){var c=t[o];c.children.push(r(n,c))}else i.push(r(n,null))}return i},shadowHostInDom:br,throttle:function(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;a<s;a++)o[a]=arguments[a];var l=Date.now();n||!1!==r.leading||(n=l);var u=t-(l-n),c=this;u<=0||u>t?(i&&(clearTimeout(i),i=null),n=l,e.apply(c,o)):i||!1===r.trailing||(i=setTimeout((()=>{n=!1===r.leading?0:Date.now(),i=null,e.apply(c,o)}),u))}},uniqueTextMutations:function(e){for(var t=new Set,r=[],i=e.length;i--;){var n=e[i];t.has(n.id)||(r.push(n),t.add(n.id))}return r}},Symbol.toStringTag,{value:"Module"})),wr="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",Cr="undefined"==typeof Uint8Array?[]:new Uint8Array(256),Ir=0;Ir<64;Ir++)Cr[wr.charCodeAt(Ir)]=Ir;var kr;"undefined"!=typeof window&&window.Blob&&new Blob([(e=>Uint8Array.from(atob(e),(e=>e.charCodeAt(0))))("KGZ1bmN0aW9uKCkgewogICJ1c2Ugc3RyaWN0IjsKICB2YXIgY2hhcnMgPSAiQUJDREVGR0hJSktMTU5PUFFSU1RVVldYWVphYmNkZWZnaGlqa2xtbm9wcXJzdHV2d3h5ejAxMjM0NTY3ODkrLyI7CiAgdmFyIGxvb2t1cCA9IHR5cGVvZiBVaW50OEFycmF5ID09PSAidW5kZWZpbmVkIiA/IFtdIDogbmV3IFVpbnQ4QXJyYXkoMjU2KTsKICBmb3IgKHZhciBpID0gMDsgaSA8IGNoYXJzLmxlbmd0aDsgaSsrKSB7CiAgICBsb29rdXBbY2hhcnMuY2hhckNvZGVBdChpKV0gPSBpOwogIH0KICB2YXIgZW5jb2RlID0gZnVuY3Rpb24oYXJyYXlidWZmZXIpIHsKICAgIHZhciBieXRlcyA9IG5ldyBVaW50OEFycmF5KGFycmF5YnVmZmVyKSwgaTIsIGxlbiA9IGJ5dGVzLmxlbmd0aCwgYmFzZTY0ID0gIiI7CiAgICBmb3IgKGkyID0gMDsgaTIgPCBsZW47IGkyICs9IDMpIHsKICAgICAgYmFzZTY0ICs9IGNoYXJzW2J5dGVzW2kyXSA+PiAyXTsKICAgICAgYmFzZTY0ICs9IGNoYXJzWyhieXRlc1tpMl0gJiAzKSA8PCA0IHwgYnl0ZXNbaTIgKyAxXSA+PiA0XTsKICAgICAgYmFzZTY0ICs9IGNoYXJzWyhieXRlc1tpMiArIDFdICYgMTUpIDw8IDIgfCBieXRlc1tpMiArIDJdID4+IDZdOwogICAgICBiYXNlNjQgKz0gY2hhcnNbYnl0ZXNbaTIgKyAyXSAmIDYzXTsKICAgIH0KICAgIGlmIChsZW4gJSAzID09PSAyKSB7CiAgICAgIGJhc2U2NCA9IGJhc2U2NC5zdWJzdHJpbmcoMCwgYmFzZTY0Lmxlbmd0aCAtIDEpICsgIj0iOwogICAgfSBlbHNlIGlmIChsZW4gJSAzID09PSAxKSB7CiAgICAgIGJhc2U2NCA9IGJhc2U2NC5zdWJzdHJpbmcoMCwgYmFzZTY0Lmxlbmd0aCAtIDIpICsgIj09IjsKICAgIH0KICAgIHJldHVybiBiYXNlNjQ7CiAgfTsKICBjb25zdCBsYXN0QmxvYk1hcCA9IC8qIEBfX1BVUkVfXyAqLyBuZXcgTWFwKCk7CiAgY29uc3QgdHJhbnNwYXJlbnRCbG9iTWFwID0gLyogQF9fUFVSRV9fICovIG5ldyBNYXAoKTsKICBhc3luYyBmdW5jdGlvbiBnZXRUcmFuc3BhcmVudEJsb2JGb3Iod2lkdGgsIGhlaWdodCwgZGF0YVVSTE9wdGlvbnMpIHsKICAgIGNvbnN0IGlkID0gYCR7d2lkdGh9LSR7aGVpZ2h0fWA7CiAgICBpZiAoIk9mZnNjcmVlbkNhbnZhcyIgaW4gZ2xvYmFsVGhpcykgewogICAgICBpZiAodHJhbnNwYXJlbnRCbG9iTWFwLmhhcyhpZCkpIHJldHVybiB0cmFuc3BhcmVudEJsb2JNYXAuZ2V0KGlkKTsKICAgICAgY29uc3Qgb2Zmc2NyZWVuID0gbmV3IE9mZnNjcmVlbkNhbnZhcyh3aWR0aCwgaGVpZ2h0KTsKICAgICAgb2Zmc2NyZWVuLmdldENvbnRleHQoIjJkIik7CiAgICAgIGNvbnN0IGJsb2IgPSBhd2FpdCBvZmZzY3JlZW4uY29udmVydFRvQmxvYihkYXRhVVJMT3B0aW9ucyk7CiAgICAgIGNvbnN0IGFycmF5QnVmZmVyID0gYXdhaXQgYmxvYi5hcnJheUJ1ZmZlcigpOwogICAgICBjb25zdCBiYXNlNjQgPSBlbmNvZGUoYXJyYXlCdWZmZXIpOwogICAgICB0cmFuc3BhcmVudEJsb2JNYXAuc2V0KGlkLCBiYXNlNjQpOwogICAgICByZXR1cm4gYmFzZTY0OwogICAgfSBlbHNlIHsKICAgICAgcmV0dXJuICIiOwogICAgfQogIH0KICBjb25zdCB3b3JrZXIgPSBzZWxmOwogIHdvcmtlci5vbm1lc3NhZ2UgPSBhc3luYyBmdW5jdGlvbihlKSB7CiAgICBpZiAoIk9mZnNjcmVlbkNhbnZhcyIgaW4gZ2xvYmFsVGhpcykgewogICAgICBjb25zdCB7IGlkLCBiaXRtYXAsIHdpZHRoLCBoZWlnaHQsIGRhdGFVUkxPcHRpb25zIH0gPSBlLmRhdGE7CiAgICAgIGNvbnN0IHRyYW5zcGFyZW50QmFzZTY0ID0gZ2V0VHJhbnNwYXJlbnRCbG9iRm9yKAogICAgICAgIHdpZHRoLAogICAgICAgIGhlaWdodCwKICAgICAgICBkYXRhVVJMT3B0aW9ucwogICAgICApOwogICAgICBjb25zdCBvZmZzY3JlZW4gPSBuZXcgT2Zmc2NyZWVuQ2FudmFzKHdpZHRoLCBoZWlnaHQpOwogICAgICBjb25zdCBjdHggPSBvZmZzY3JlZW4uZ2V0Q29udGV4dCgiMmQiKTsKICAgICAgY3R4LmRyYXdJbWFnZShiaXRtYXAsIDAsIDApOwogICAgICBiaXRtYXAuY2xvc2UoKTsKICAgICAgY29uc3QgYmxvYiA9IGF3YWl0IG9mZnNjcmVlbi5jb252ZXJ0VG9CbG9iKGRhdGFVUkxPcHRpb25zKTsKICAgICAgY29uc3QgdHlwZSA9IGJsb2IudHlwZTsKICAgICAgY29uc3QgYXJyYXlCdWZmZXIgPSBhd2FpdCBibG9iLmFycmF5QnVmZmVyKCk7CiAgICAgIGNvbnN0IGJhc2U2NCA9IGVuY29kZShhcnJheUJ1ZmZlcik7CiAgICAgIGlmICghbGFzdEJsb2JNYXAuaGFzKGlkKSAmJiBhd2FpdCB0cmFuc3BhcmVudEJhc2U2NCA9PT0gYmFzZTY0KSB7CiAgICAgICAgbGFzdEJsb2JNYXAuc2V0KGlkLCBiYXNlNjQpOwogICAgICAgIHJldHVybiB3b3JrZXIucG9zdE1lc3NhZ2UoeyBpZCB9KTsKICAgICAgfQogICAgICBpZiAobGFzdEJsb2JNYXAuZ2V0KGlkKSA9PT0gYmFzZTY0KSByZXR1cm4gd29ya2VyLnBvc3RNZXNzYWdlKHsgaWQgfSk7CiAgICAgIHdvcmtlci5wb3N0TWVzc2FnZSh7CiAgICAgICAgaWQsCiAgICAgICAgdHlwZSwKICAgICAgICBiYXNlNjQsCiAgICAgICAgd2lkdGgsCiAgICAgICAgaGVpZ2h0CiAgICAgIH0pOwogICAgICBsYXN0QmxvYk1hcC5zZXQoaWQsIGJhc2U2NCk7CiAgICB9IGVsc2UgewogICAgICByZXR1cm4gd29ya2VyLnBvc3RNZXNzYWdlKHsgaWQ6IGUuZGF0YS5pZCB9KTsKICAgIH0KICB9Owp9KSgpOwovLyMgc291cmNlTWFwcGluZ1VSTD1pbWFnZS1iaXRtYXAtZGF0YS11cmwtd29ya2VyLUlKcEM3Z19iLmpzLm1hcAo=")],{type:"text/javascript;charset=utf-8"});try{if(2!==Array.from([1],(e=>2*e))[0]){var Er=document.createElement("iframe");document.body.appendChild(Er),Array.from=(null==(Bt=Er.contentWindow)?void 0:Bt.Array.from)||Array.from,document.body.removeChild(Er)}}catch(e){console.debug("Unable to override Array.from",e)}new rr,function(e){e[e.NotStarted=0]="NotStarted",e[e.Running=1]="Running",e[e.Stopped=2]="Stopped"}(kr||(kr={}));class xr{constructor(e){$t(this,"fileName"),$t(this,"functionName"),$t(this,"lineNumber"),$t(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 Tr=/(^|@)\S+:\d+/,Mr=/^\s*at .*(\S+:\d+|\(native\))/m,Rr=/^(eval@)?(\[native code])?$/,Pr={parse:function(e){return e?void 0!==e.stacktrace||void 0!==e["opera#sourceloc"]?this.parseOpera(e):e.stack&&e.stack.match(Mr)?this.parseV8OrIE(e):e.stack?this.parseFFOrSafari(e):(console.warn("[console-record-plugin]: Failed to parse error object:",e),[]):[]},extractLocation:function(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:function(e){return e.stack.split("\n").filter((function(e){return!!e.match(Mr)}),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 xr({functionName:s,fileName:o,lineNumber:n[1],columnNumber:n[2]})}),this)},parseFFOrSafari:function(e){return e.stack.split("\n").filter((function(e){return!e.match(Rr)}),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 xr({functionName:e});var t=/((.*".+"[^@]*)?[^@]*)(?:@)/,r=e.match(t),i=r&&r[1]?r[1]:void 0,n=this.extractLocation(e.replace(t,""));return new xr({functionName:i,fileName:n[0],lineNumber:n[1],columnNumber:n[2]})}),this)},parseOpera:function(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:function(e){for(var t=/Line (\d+).*script (?:in )?(\S+)/i,r=e.message.split("\n"),i=[],n=2,s=r.length;n<s;n+=2){var o=t.exec(r[n]);o&&i.push(new xr({fileName:o[2],lineNumber:parseFloat(o[1])}))}return i},parseOpera10:function(e){for(var t=/Line (\d+).*script (?:in )?(\S+)(?:: In function (\S+))?$/i,r=e.stacktrace.split("\n"),i=[],n=0,s=r.length;n<s;n+=2){var o=t.exec(r[n]);o&&i.push(new xr({functionName:o[3]||void 0,fileName:o[2],lineNumber:parseFloat(o[1])}))}return i},parseOpera11:function(e){return e.stack.split("\n").filter((function(e){return!!e.match(Tr)&&!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 xr({functionName:i,fileName:r[0],lineNumber:r[1],columnNumber:r[2]})}),this)}};function Ar(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;s<i.children.length;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 Nr(e){return"[object Object]"===Object.prototype.toString.call(e)}function Fr(e,t){if(0===t)return!0;var r=Object.keys(e);for(var i of r)if(Nr(e[i])&&Fr(e[i],t-1))return!0;return!1}function Lr(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(function(e){if(Nr(e)&&Object.keys(e).length>r.numOfKeysLimit)return!0;if("function"==typeof e)return!0;if(Nr(e)&&Fr(e,r.depthOfLimit))return!0;return!1}(t))return function(e){var t=e.toString();r.stringLengthLimit&&t.length>r.stringLengthLimit&&(t=t.slice(0,r.stringLengthLimit)+"...");return t}(t);if("bigint"==typeof t)return t.toString()+"n";if(t instanceof Event){var o={};for(var a in t){var l=t[a];Array.isArray(l)?o[a]=Ar(l.length?l[0]:null):o[a]=l}return o}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 Or={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 Dr(e,t,r){var i,n=r?Object.assign({},Or,r):Or,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=t.error,s=Pr.parse(i).map((e=>e.toString())),o=[Lr(r,n.stringifyOptions)];e({level:"error",trace:s,payload:o})};t.addEventListener("error",u),l.push((()=>{t.removeEventListener("error",u)}));var c=t=>{var r,i;t.reason instanceof Error?i=[Lr("Uncaught (in promise) "+(r=t.reason).name+": "+r.message,n.stringifyOptions)]:(r=new Error,i=[Lr("Uncaught (in promise)",n.stringifyOptions),Lr(t.reason,n.stringifyOptions)]);var s=Pr.parse(r).map((e=>e.toString()));e({level:"error",trace:s,payload:i})};t.addEventListener("unhandledrejection",c),l.push((()=>{t.removeEventListener("unhandledrejection",c)}))}for(var d of n.level)l.push(h(i,d));return()=>{l.forEach((e=>e()))};function h(t,r){var i=this;return t[r]?Sr.patch(t,r,(t=>function(){for(var s=arguments.length,l=new Array(s),u=0;u<s;u++)l[u]=arguments[u];if(t.apply(i,l),!("assert"===r&&l[0]||a)){a=!0;try{var c=Pr.parse(new Error).map((e=>e.toString())).splice(1),d=("assert"===r?l.slice(1):l).map((e=>Lr(e,n.stringifyOptions)));++o<n.lengthThreshold?e({level:r,trace:c,payload:d}):o===n.lengthThreshold&&e({level:"warn",trace:[],payload:[Lr("The number of log records reached the threshold.")]})}catch(e){t("rrweb logger error:",e,...l)}finally{a=!1}}})):()=>{}}}var Hr=e=>({name:"rrweb/console@1",observer:Dr,options:e}),qr=["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"],Br=function(e,t){if(void 0===t&&(t=[]),!e)return!1;var r=e.toLowerCase();return qr.concat(t).some((e=>{var t=e.toLowerCase();return-1!==r.indexOf(t)}))},Vr=["$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"];function $r(e,t){return-1!==e.indexOf(t)}var Ur=function(e){return e.trim()},Wr=function(e){return e.replace(/^\$/,"")};var zr=Array.isArray,jr=Object.prototype,Zr=jr.hasOwnProperty,Gr=jr.toString,Yr=zr||function(e){return"[object Array]"===Gr.call(e)},Xr=e=>"function"==typeof e,Kr=e=>Xr(e)&&-1!==e.toString().indexOf("[native code]"),Jr=e=>e===Object(e)&&!Yr(e),Qr=e=>{if(Jr(e)){for(var t in e)if(Zr.call(e,t))return!1;return!0}return!1},ei=e=>void 0===e,ti=e=>"[object String]"==Gr.call(e),ri=e=>ti(e)&&0===e.trim().length,ii=e=>null===e,ni=e=>ei(e)||ii(e),si=e=>"[object Number]"==Gr.call(e),oi=e=>"[object Boolean]"===Gr.call(e),ai=e=>e instanceof FormData,li=e=>$r(Vr,e);function ui(e){return null===e||"object"!=typeof e}function ci(e,t){return Object.prototype.toString.call(e)==="[object "+t+"]"}function di(e){return!ei(Event)&&function(e,t){try{return e instanceof t}catch(e){return!1}}(e,Event)}var hi=[!0,"true",1,"1","yes"],pi=e=>$r(hi,e),vi=[!1,"false",0,"0","no"];function gi(e,t,r,i,n){return t>r&&(i.warn("min cannot be greater than max."),t=r),si(e)?e>r?(i.warn(" cannot be greater than max: "+r+". Using max value instead."),r):e<t?(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),gi(n||r,t,r,i))}class _i{constructor(e){this._buckets={},this._onBucketRateLimited=e._onBucketRateLimited,this._bucketSize=gi(e.bucketSize,0,100,e._logger),this._refillRate=gi(e.refillRate,0,this._bucketSize,e._logger),this._refillInterval=gi(e.refillInterval,0,864e5,e._logger)}_applyRefill(e,t){var r=t-e.lastAccess,i=Math.floor(r/this._refillInterval);if(i>0){var n=i*this._refillRate;e.tokens=Math.min(e.tokens+n,this._bucketSize),e.lastAccess=e.lastAccess+i*this._refillInterval}}consumeRateLimit(e){var t,r=Date.now(),i=String(e),n=this._buckets[i];return n?this._applyRefill(n,r):(n={tokens:this._bucketSize,lastAccess:r},this._buckets[i]=n),0===n.tokens||(n.tokens--,0===n.tokens&&(null==(t=this._onBucketRateLimited)||t.call(this,e)),0===n.tokens)}stop(){this._buckets={}}}var fi="Mobile",mi="iOS",yi="Android",bi="Tablet",Si=yi+" "+bi,wi="iPad",Ci="Apple",Ii=Ci+" Watch",ki="Safari",Ei="BlackBerry",xi="Samsung",Ti=xi+"Browser",Mi=xi+" Internet",Ri="Chrome",Pi=Ri+" OS",Ai=Ri+" "+mi,Ni="Internet Explorer",Fi=Ni+" "+fi,Li="Opera",Oi=Li+" Mini",Di="Edge",Hi="Microsoft "+Di,qi="Firefox",Bi=qi+" "+mi,Vi="Nintendo",$i="PlayStation",Ui="Xbox",Wi=yi+" "+fi,zi=fi+" "+ki,ji="Windows",Zi=ji+" Phone",Gi="Nokia",Yi="Ouya",Xi="Generic",Ki=Xi+" "+fi.toLowerCase(),Ji=Xi+" "+bi.toLowerCase(),Qi="Konqueror",en="(\\d+(\\.\\d+)?)",tn=new RegExp("Version/"+en),rn=new RegExp(Ui,"i"),nn=new RegExp($i+" \\w+","i"),sn=new RegExp(Vi+" \\w+","i"),on=new RegExp(Ei+"|PlayBook|BB10","i"),an={"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"};var ln,un,cn,dn=(e,t)=>t&&$r(t,Ci)||function(e){return $r(e,ki)&&!$r(e,Ri)&&!$r(e,yi)}(e),hn=function(e,t){return t=t||"",$r(e," OPR/")&&$r(e,"Mini")?Oi:$r(e," OPR/")?Li:on.test(e)?Ei:$r(e,"IE"+fi)||$r(e,"WPDesktop")?Fi:$r(e,Ti)?Mi:$r(e,Di)||$r(e,"Edg/")?Hi:$r(e,"FBIOS")?"Facebook "+fi:$r(e,"UCWEB")||$r(e,"UCBrowser")?"UC Browser":$r(e,"CriOS")?Ai:$r(e,"CrMo")||$r(e,Ri)?Ri:$r(e,yi)&&$r(e,ki)?Wi:$r(e,"FxiOS")?Bi:$r(e.toLowerCase(),Qi.toLowerCase())?Qi:dn(e,t)?$r(e,fi)?zi:ki:$r(e,qi)?qi:$r(e,"MSIE")||$r(e,"Trident/")?Ni:$r(e,"Gecko")?qi:""},pn={[Fi]:[new RegExp("rv:"+en)],[Hi]:[new RegExp(Di+"?\\/"+en)],[Ri]:[new RegExp("("+Ri+"|CrMo)\\/"+en)],[Ai]:[new RegExp("CriOS\\/"+en)],"UC Browser":[new RegExp("(UCBrowser|UCWEB)\\/"+en)],[ki]:[tn],[zi]:[tn],[Li]:[new RegExp("(Opera|OPR)\\/"+en)],[qi]:[new RegExp(qi+"\\/"+en)],[Bi]:[new RegExp("FxiOS\\/"+en)],[Qi]:[new RegExp("Konqueror[:/]?"+en,"i")],[Ei]:[new RegExp(Ei+" "+en),tn],[Wi]:[new RegExp("android\\s"+en,"i")],[Mi]:[new RegExp(Ti+"\\/"+en)],[Ni]:[new RegExp("(rv:|MSIE )"+en)],Mozilla:[new RegExp("rv:"+en)]},vn=function(e,t){var r=hn(e,t),i=pn[r];if(ei(i))return null;for(var n=0;n<i.length;n++){var s=i[n],o=e.match(s);if(o)return parseFloat(o[o.length-2])}return null},gn=[[new RegExp(Ui+"; "+Ui+" (.*?)[);]","i"),e=>[Ui,e&&e[1]||""]],[new RegExp(Vi,"i"),[Vi,""]],[new RegExp($i,"i"),[$i,""]],[on,[Ei,""]],[new RegExp(ji,"i"),(e,t)=>{if(/Phone/.test(t)||/WPDesktop/.test(t))return[Zi,""];if(new RegExp(fi).test(t)&&!/IEMobile\b/.test(t))return[ji+" "+fi,""];var r=/Windows NT ([0-9.]+)/i.exec(t);if(r&&r[1]){var i=r[1],n=an[i]||"";return/arm/i.test(t)&&(n="RT"),[ji,n]}return[ji,""]}],[/((iPhone|iPad|iPod).*?OS (\d+)_(\d+)_?(\d+)?|iPhone)/,e=>{if(e&&e[3]){var t=[e[3],e[4],e[5]||"0"];return[mi,t.join(".")]}return[mi,""]}],[/(watch.*\/(\d+\.\d+\.\d+)|watch os,(\d+\.\d+),)/i,e=>{var t="";return e&&e.length>=3&&(t=ei(e[2])?e[3]:e[2]),["watchOS",t]}],[new RegExp("("+yi+" (\\d+)\\.(\\d+)\\.?(\\d+)?|"+yi+")","i"),e=>{if(e&&e[2]){var t=[e[2],e[3],e[4]||"0"];return[yi,t.join(".")]}return[yi,""]}],[/Mac OS X (\d+)[_.](\d+)[_.]?(\d+)?/i,e=>{var t=["Mac OS X",""];if(e&&e[1]){var r=[e[1],e[2],e[3]||"0"];t[1]=r.join(".")}return t}],[/Mac/i,["Mac OS X",""]],[/CrOS/,[Pi,""]],[/Linux|debian/i,["Linux",""]]],_n=function(e){return sn.test(e)?Vi:nn.test(e)?$i:rn.test(e)?Ui:new RegExp(Yi,"i").test(e)?Yi:new RegExp("("+Zi+"|WPDesktop)","i").test(e)?Zi:/iPad/.test(e)?wi:/iPod/.test(e)?"iPod Touch":/iPhone/.test(e)?"iPhone":/(watch)(?: ?os[,/]|\d,\d\/)[\d.]+/i.test(e)?Ii:on.test(e)?Ei:/(kobo)\s(ereader|touch)/i.test(e)?"Kobo":new RegExp(Gi,"i").test(e)?Gi:/(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(fi).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)?yi:Si:new RegExp("(pda|"+fi+")","i").test(e)?Ki:new RegExp(bi,"i").test(e)&&!new RegExp(bi+" pc","i").test(e)?Ji:""},fn=function(e){var t=_n(e);return t===wi||t===Si||"Kobo"===t||"Kindle Fire"===t||t===Ji?bi:t===Vi||t===Ui||t===$i||t===Yi?"Console":t===Ii?"Wearable":t?fi:"Desktop"},mn=e=>e instanceof Error;function yn(e){var t=globalThis._posthogChunkIds;if(t){var r=Object.keys(t);return cn&&r.length===un||(un=r.length,cn=r.reduce(((r,i)=>{ln||(ln={});var n=ln[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,ln[i]=[l,u];break}}return r}),{})),cn}}class bn{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(),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?1: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(){return{chunkIdMap:yn(this.stackParser)}}buildCoercingContext(e,t,i){void 0===i&&(i=0);var n=(r,i)=>{if(i<=4){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 Sn="?";function wn(e,t,r,i,n){var s={platform:e,filename:t,function:"<anonymous>"===r?Sn:r,in_app:!0};return ei(i)||(s.lineno=i),ei(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]:Sn,r?"safari-extension:"+t:"safari-web-extension:"+t]:[e,t]},In=/^\s*at (\S+?)(?::(\d+))(?::(\d+))\s*$/i,kn=/^\s*at (?:(.+?\)(?: \[.+\])?|.*?) ?\((?:address at )?)?(?:async )?((?:<anonymous>|[-a-z]+:|.*bundle|\/)?.*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i,En=/\((\S*)(?::(\d+))(?::(\d+))\)/,xn=(e,t)=>{var r=In.exec(e);if(r){var[,i,n,s]=r;return wn(t,i,Sn,+n,+s)}var o=kn.exec(e);if(o){if(o[2]&&0===o[2].indexOf("eval")){var a=En.exec(o[2]);a&&(o[2]=a[1],o[3]=a[2],o[4]=a[3])}var[l,u]=Cn(o[1]||Sn,o[2]);return wn(t,u,l,o[3]?+o[3]:void 0,o[4]?+o[4]:void 0)}},Tn=/^\s*(.*?)(?:\((.*?)\))?(?:^|@)?((?:[-a-z]+)?:\/.*?|\[native code\]|[^@]*(?:bundle|\d+\.js)|\/[\w\-. /=]+)(?::(\d+))?(?::(\d+))?\s*$/i,Mn=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i,Rn=(e,t)=>{var r=Tn.exec(e);if(r){if(r[3]&&r[3].indexOf(" > eval")>-1){var i=Mn.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]||Sn;return[s,n]=Cn(s,n),wn(t,n,s,r[4]?+r[4]:void 0,r[5]?+r[5]:void 0)}},Pn=/\(error: (.*)\)/,An=50;function Nn(e){for(var t=arguments.length,i=new Array(t>1?t-1:0),n=1;n<t;n++)i[n-1]=arguments[n];return function(t,n){void 0===n&&(n=0);for(var s=[],o=t.split("\n"),a=n;a<o.length;a++){var l=o[a];if(!(l.length>1024)){var u=Pn.test(l)?l.replace(Pn,"$1"):l;if(!u.match(/\S*Error: /)){for(var c of i){var d=c(u,e);if(d){s.push(d);break}}if(s.length>=An)break}}}return function(e){if(!e.length)return[];var t=Array.from(e);return t.reverse(),t.slice(0,An).map((e=>{return r({},e,{filename:e.filename||(i=t,i[i.length-1]||{}).filename,function:e.function||Sn});var i}))}(s)}}class Fn{match(e){return this.isDOMException(e)||this.isDOMError(e)}coerce(e,t){var r=ti(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 ci(e,"DOMException")}isDOMError(e){return ci(e,"DOMError")}}class Ln{match(e){return(e=>e instanceof Error)(e)}coerce(e,t){return{type:this.getType(e),value:this.getMessage(e,t),stack:this.getStack(e),cause:e.cause?t.next(e.cause):void 0,synthetic:!1}}getType(e){return e.name||e.constructor.name}getMessage(e,t){var r=e.message;return r.error&&"string"==typeof r.error.message?String(r.error.message):String(r)}getStack(e){return e.stacktrace||e.stack||void 0}}class On{constructor(){}match(e){return ci(e,"ErrorEvent")&&null!=e.error}coerce(e,t){var r,i=t.apply(e.error);return i||{type:"ErrorEvent",value:e.message,stack:null==(r=t.syntheticException)?void 0:r.stack,synthetic:!0}}}var Dn=/^(?:[Uu]ncaught (?:exception: )?)?(?:((?:Eval|Internal|Range|Reference|Syntax|Type|URI|)Error): )?(.*)$/i;class Hn{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(Dn);return i&&(t=i[1],r=i[2]),[t,r]}}var qn=["fatal","error","warning","log","info","debug"];function Bn(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(!(n.length>t))return i===r.length||n.length<=t?n:n.slice(0,t)+"..."}return""}class Vn{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 di(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: "+Bn(e)}isSeverityLevel(e){return ti(e)&&!ri(e)&&qn.indexOf(e)>=0}getErrorPropertyFromObject(e){for(var t in e)if(Object.prototype.hasOwnProperty.call(e,t)){var r=e[t];if(mn(r))return r}}getObjectClassName(e){try{var t=Object.getPrototypeOf(e);return t?t.constructor.name:void 0}catch(e){return}}}class $n{match(e){return di(e)}coerce(e,t){var r,i=e.constructor.name;return{type:i,value:i+" captured as exception with keys: "+Bn(e),stack:null==(r=t.syntheticException)?void 0:r.stack,synthetic:!0}}}class Un{match(e){return ui(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 Wn{match(e){return ci(e,"PromiseRejectionEvent")}coerce(e,t){var r,i=this.getUnhandledRejectionReason(e);return ui(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){if(ui(e))return e;try{if("reason"in e)return e.reason;if("detail"in e&&"reason"in e.detail)return e.detail.reason}catch(e){}return e}}var zn="undefined"!=typeof window?window:void 0,jn="undefined"!=typeof globalThis?globalThis:zn;"undefined"==typeof self&&(jn.self=jn),"undefined"==typeof File&&(jn.File=function(){});var Zn=Array.prototype,Gn=Zn.forEach,Yn=Zn.indexOf,Xn=null==jn?void 0:jn.navigator,Kn=null==jn?void 0:jn.document,Jn=null==jn?void 0:jn.location,Qn=null==jn?void 0:jn.fetch,es=null!=jn&&jn.XMLHttpRequest&&"withCredentials"in new jn.XMLHttpRequest?jn.XMLHttpRequest:void 0,ts=null==jn?void 0:jn.AbortController,rs=null==Xn?void 0:Xn.userAgent,is=null!=zn?zn:{},ns=()=>!!zn.Zone,ss=e=>e instanceof Document,os={DEBUG:!1,LIB_VERSION:"1.312.0"},as=function(e,t){var{debugEnabled:r}=void 0===t?{}:t,i={_log:function(t){if(zn&&(os.DEBUG||is.POSTHOG_DEBUG||r)&&!ei(zn.console)&&zn.console){for(var i=("__rrweb_original__"in zn.console[t]?zn.console[t].__rrweb_original__:zn.console[t]),n=arguments.length,s=new Array(n>1?n-1:0),o=1;o<n;o++)s[o-1]=arguments[o];i(e,...s)}},info:function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];i._log("log",...t)},warn:function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];i._log("warn",...t)},error:function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];i._log("error",...t)},critical:function(){for(var t=arguments.length,r=new Array(t),i=0;i<t;i++)r[i]=arguments[i];console.error(e,...r)},uninitializedWarning:e=>{i.error("You must initialize PostHog before calling "+e)},createLogger:(t,r)=>as(e+" "+t,r)};return i},ls=as("[PostHog.js]"),us=ls.createLogger,cs={};function ds(e,t,r){if(Yr(e))if(Gn&&e.forEach===Gn)e.forEach(t,r);else if("length"in e&&e.length===+e.length)for(var i=0,n=e.length;i<n;i++)if(i in e&&t.call(r,e[i],i)===cs)return}function hs(e,t,r){if(!ni(e)){if(Yr(e))return ds(e,t,r);if(ai(e)){for(var i of e.entries())if(t.call(r,i[1],i[0])===cs)return}else for(var n in e)if(Zr.call(e,n)&&t.call(r,e[n],n)===cs)return}}var ps=function(e){for(var t=arguments.length,r=new Array(t>1?t-1:0),i=1;i<t;i++)r[i-1]=arguments[i];return ds(r,(function(t){for(var r in t)void 0!==t[r]&&(e[r]=t[r])})),e},vs=function(e){for(var t=arguments.length,r=new Array(t>1?t-1:0),i=1;i<t;i++)r[i-1]=arguments[i];return ds(r,(function(t){ds(t,(function(t){e.push(t)}))})),e};function gs(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 _s=function(e){try{return e()}catch(e){return}},fs=function(e){return function(){try{for(var t=arguments.length,r=new Array(t),i=0;i<t;i++)r[i]=arguments[i];return e.apply(this,r)}catch(e){ls.critical("Implementation error. Please turn on debug mode and open a ticket on https://app.posthog.com/home#panel=support%3Asupport%3A."),ls.critical(e)}}},ms=function(e){var t={};return hs(e,(function(e,r){(ti(e)&&e.length>0||si(e))&&(t[r]=e)})),t};function ys(e,t){return r=e,i=e=>ti(e)&&!ii(t)?e.slice(0,t):e,n=new Set,function e(t,r){return t!==Object(t)?i?i(t,r):t:n.has(t)?void 0:(n.add(t),Yr(t)?(s=[],ds(t,(t=>{s.push(e(t))}))):(s={},hs(t,((t,r)=>{n.has(t)||(s[r]=e(t,r))}))),s);var s}(r);var r,i,n}var bs=["herokuapp.com","vercel.app","netlify.app"];function Ss(e){var t=null==e?void 0:e.hostname;if(!ti(t))return!1;var r=t.split(".").slice(-2).join(".");for(var i of bs)if(r===i)return!1;return!0}function ws(e,t){for(var r=0;r<e.length;r++)if(t(e[r]))return e[r]}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})}var Is=e=>{var t=null==Kn?void 0:Kn.createElement("a");return ei(t)?null:(t.href=e,t)},ks=function(e,t){var r,i;void 0===t&&(t="&");var n=[];return hs(e,(function(e,t){ei(e)||ei(t)||"undefined"===t||(r=encodeURIComponent((e=>e instanceof File)(e)?e.name:e.toString()),i=encodeURIComponent(t),n[n.length]=i+"="+r)})),n.join(t)},Es=function(e,t){for(var r,i=((e.split("#")[0]||"").split(/\?(.*)/)[1]||"").replace(/^\?+/g,"").split("&"),n=0;n<i.length;n++){var s=i[n].split("=");if(s[0]===t){r=s;break}}if(!Yr(r)||r.length<2)return"";var o=r[1];try{o=decodeURIComponent(o)}catch(e){ls.error("Skipping decoding for malformed query param: "+o)}return o.replace(/\+/g," ")},xs=function(e,t,r){if(!e||!t||!t.length)return e;for(var i=e.split("#"),n=i[0]||"",s=i[1],o=n.split("?"),a=o[1],l=o[0],u=(a||"").split("&"),c=[],d=0;d<u.length;d++){var h=u[d].split("=");Yr(h)&&(t.includes(h[0])?c.push(h[0]+"="+r):c.push(u[d]))}var p=l;return null!=a&&(p+="?"+c.join("&")),null!=s&&(p+="#"+s),p},Ts=function(e,t){var r=e.match(new RegExp(t+"=([^&]*)"));return r?r[1]:null};function Ms(e,t,r){try{if(!(t in e))return()=>{};var i=e[t],n=r(i);return Xr(n)&&(n.prototype=n.prototype||{},Object.defineProperties(n,{__posthog_wrapped__:{enumerable:!1,value:!0}})),e[t]=n,()=>{e[t]=i}}catch(e){return()=>{}}}function Rs(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}var Ps="$people_distinct_id",As="__alias",Ns="__timers",Fs="$autocapture_disabled_server_side",Ls="$heatmaps_enabled_server_side",Os="$exception_capture_enabled_server_side",Ds="$error_tracking_suppression_rules",Hs="$error_tracking_capture_extension_exceptions",qs="$web_vitals_enabled_server_side",Bs="$dead_clicks_enabled_server_side",Vs="$product_tours_enabled_server_side",$s="$web_vitals_allowed_metrics",Us="$session_recording_remote_config",Ws="$sesid",zs="$session_is_sampled",js="$enabled_feature_flags",Zs="$early_access_features",Gs="$feature_flag_details",Ys="$stored_person_properties",Xs="$stored_group_properties",Ks="$surveys",Js="$flag_call_reported",Qs="$user_state",eo="$client_session_props",to="$capture_rate_limit",ro="$initial_campaign_params",io="$initial_referrer_info",no="$initial_person_info",so="$epp",oo="__POSTHOG_TOOLBAR__",ao="$posthog_cookieless",lo=[Ps,As,"__cmpns",Ns,"$session_recording_enabled_server_side",Ls,Ws,js,Ds,Qs,Zs,Gs,Xs,Ys,Ks,Js,eo,to,ro,io,so,no,"$conversations_widget_session_id","$conversations_ticket_id","$conversations_widget_state","$conversations_user_traits"];function uo(e){return e instanceof Element&&(e.id===oo||!(null==e.closest||!e.closest(".toolbar-global-fade-container")))}function co(e){return!!e&&1===e.nodeType}function ho(e,t){return!!e&&!!e.tagName&&e.tagName.toLowerCase()===t.toLowerCase()}function po(e){return!!e&&3===e.nodeType}function vo(e){return!!e&&11===e.nodeType}function go(e){return e?Ur(e).split(/\s+/):[]}function _o(e){var t=null==zn?void 0:zn.location.href;return!!(t&&e&&e.some((e=>t.match(e))))}function fo(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 go(t)}function mo(e){return ni(e)?null:Ur(e).split(/(\s+)/).filter((e=>qo(e))).join("").replace(/[\r\n]/g," ").replace(/[ ]+/g," ").substring(0,255)}function yo(e){var t="";return Po(e)&&!Ao(e)&&e.childNodes&&e.childNodes.length&&hs(e.childNodes,(function(e){var r;po(e)&&e.textContent&&(t+=null!==(r=mo(e.textContent))&&void 0!==r?r:"")})),Ur(t)}function bo(e){return ei(e.target)?e.srcElement||null:null!=(t=e.target)&&t.shadowRoot?e.composedPath()[0]||null:e.target||null;var t}var So=["a","button","form","input","select","textarea","label"];function wo(e,t){if(ei(t))return!0;var r,i=function(e){if(t.some((t=>e.matches(t))))return{v:!0}};for(var n of e)if(r=i(n))return r.v;return!1}function Co(e){var t=e.parentNode;return!(!t||!co(t))&&t}var Io=["next","previous","prev",">","<"],ko=10;var Eo=[".ph-no-rageclick",".ph-no-capture"];function xo(e,t){if(!zn||To(e))return!1;var r,i,n;oi(t)?(r=!!t&&Eo,i=void 0):(r=null!==(n=null==t?void 0:t.css_selector_ignorelist)&&void 0!==n?n:Eo,i=null==t?void 0:t.content_ignorelist);if(!1===r)return!1;var{targetElementList:s}=Mo(e,!1);return!function(e,t){if(!1===e||ei(e))return!1;var r;if(!0===e)r=Io;else{if(!Yr(e))return!1;if(e.length>ko)return ls.error("[PostHog] content_ignorelist array cannot exceed "+ko+" 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=>t.includes(e)||i.includes(e)))}))}(i,s.map((e=>{var t;return{safeText:yo(e).toLowerCase(),ariaLabel:(null==(t=e.getAttribute("aria-label"))?void 0:t.toLowerCase().trim())||""}})))&&!wo(s,r)}var To=e=>!e||ho(e,"html")||!co(e),Mo=(e,t)=>{if(!zn||To(e))return{parentIsUsefulElement:!1,targetElementList:[]};for(var r=!1,i=[e],n=e;n.parentNode&&!ho(n,"body");)if(vo(n.parentNode))i.push(n.parentNode.host),n=n.parentNode.host;else{var s=Co(n);if(!s)break;if(t||So.indexOf(s.tagName.toLowerCase())>-1)r=!0;else{var o=zn.getComputedStyle(s);o&&"pointer"===o.getPropertyValue("cursor")&&(r=!0)}i.push(s),n=s}return{parentIsUsefulElement:r,targetElementList:i}};function Ro(e,t,r,i,n){var s,o,a,l;if(void 0===r&&(r=void 0),!zn||To(e))return!1;if(null!=(s=r)&&s.url_allowlist&&!_o(r.url_allowlist))return!1;if(null!=(o=r)&&o.url_ignorelist&&_o(r.url_ignorelist))return!1;if(null!=(a=r)&&a.dom_event_allowlist){var u=r.dom_event_allowlist;if(u&&!u.some((e=>t.type===e)))return!1}var{parentIsUsefulElement:c,targetElementList:d}=Mo(e,i);if(!function(e,t){var r=null==t?void 0:t.element_allowlist;if(ei(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}(d,r))return!1;if(!wo(d,null==(l=r)?void 0:l.css_selector_allowlist))return!1;var h=zn.getComputedStyle(e);if(h&&"pointer"===h.getPropertyValue("cursor")&&"click"===t.type)return!0;var p=e.tagName.toLowerCase();switch(p){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 c?(n||["click"]).indexOf(t.type)>=0:(n||["click"]).indexOf(t.type)>=0&&(So.indexOf(p)>-1||"true"===e.getAttribute("contenteditable"))}}function Po(e){for(var t=e;t.parentNode&&!ho(t,"body");t=t.parentNode){var r=fo(t);if($r(r,"ph-sensitive")||$r(r,"ph-no-capture"))return!1}if($r(fo(e),"ph-include"))return!0;var i=e.type||"";if(ti(i))switch(i.toLowerCase()){case"hidden":case"password":return!1}var n=e.name||e.id||"";if(ti(n)){if(/^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,"")))return!1}return!0}function Ao(e){return!!(ho(e,"input")&&!["button","checkbox","submit","reset"].includes(e.type)||ho(e,"select")||ho(e,"textarea")||"true"===e.getAttribute("contenteditable"))}var No="(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})",Fo=new RegExp("^(?:"+No+")$"),Lo=new RegExp(No),Oo="\\d{3}-?\\d{2}-?\\d{4}",Do=new RegExp("^("+Oo+")$"),Ho=new RegExp("("+Oo+")");function qo(e,t){if(void 0===t&&(t=!0),ni(e))return!1;if(ti(e)){if(e=Ur(e),(t?Fo:Lo).test((e||"").replace(/[- ]/g,"")))return!1;if((t?Do:Ho).test(e))return!1}return!0}function Bo(e){var t=yo(e);return qo(t=(t+" "+Vo(e)).trim())?t:""}function Vo(e){var t="";return e&&e.childNodes&&e.childNodes.length&&hs(e.childNodes,(function(e){var r;if(e&&"span"===(null==(r=e.tagName)?void 0:r.toLowerCase()))try{var i=yo(e);t=(t+" "+i).trim(),e.childNodes&&e.childNodes.length&&(t=(t+" "+Vo(e)).trim())}catch(e){ls.error("[AutoCapture]",e)}})),t}function $o(e){return 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 gs(o).sort(((e,t)=>{var[r]=e,[i]=t;return r.localeCompare(i)})).forEach((e=>{var[t,r]=e;return a[Uo(t.toString())]=Uo(r.toString())})),n+=":",n+=gs(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:Wo(e),attr_id:e.attr__id,nth_child:e.nth_child,nth_of_type:e.nth_of_type,attributes:{}};return gs(e).filter((e=>{var[t]=e;return 0===t.indexOf("attr__")})).forEach((e=>{var[t,r]=e;return i.attributes[t]=r})),i}))}(e))}function Uo(e){return e.replace(/"|\\"/g,'\\"')}function Wo(e){var t=e.attr__class;return t?Yr(t)?t:go(t):void 0}var zo={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:1e6,payloadHostDenyList:[".lr-ingest.io",".ingest.sentry.io",".clarity.ms","analytics.google.com","bam.nr-data.net"]},jo=us("[Recorder]"),Zo=e=>"navigation"===e.entryType,Go=e=>"resource"===e.entryType;function Yo(e,t,r){if(r.recordInitialRequests){var i=t.performance.getEntries().filter((e=>Zo(e)||Go(e)&&r.initiatorTypes.includes(e.initiatorType)));e({requests:i.flatMap((e=>ra({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=>Zo(e)||Go(e)&&r.initiatorTypes.includes(e.initiatorType)&&(e=>!r.recordBody&&!r.recordHeaders||"xmlhttprequest"!==e.initiatorType&&"fetch"!==e.initiatorType)(e)));e({requests:i.flatMap((e=>ra({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()}}function Xo(e,t){return!!t&&(oi(t)||t[e])}function Ko(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.includes(e)))}if(!r)return!1;if(function e(t){try{return"string"==typeof t?t.startsWith("blob:"):t instanceof URL?"blob:"===t.protocol:t instanceof Request&&e(t.url)}catch(e){return!1}}(n))return!1;if(oi(r))return!0;if(Yr(r))return s(r);var o=r[t];return oi(o)?o:s(o)}function Jo(e,t,r,i,n,s){return Qo.apply(this,arguments)}function Qo(){return Qo=t((function*(e,t,r,i,n,s){if(void 0===s&&(s=0),s>10)return jo.warn("Failed to get performance entry for request",{url:r,initiatorType:t}),null;var o=function(e,t){for(var r=e.length-1;r>=0;r-=1)if(t(e[r]))return e[r]}(e.performance.getEntriesByName(r),(e=>Go(e)&&e.initiatorType===t&&(ei(i)||e.startTime>=i)&&(ei(n)||e.startTime<=n)));return o||(yield new Promise((e=>setTimeout(e,50*s))),Jo(e,t,r,i,n,s+1))})),Qo.apply(this,arguments)}function ea(e){var{body:t,options:r,url:i}=e;if(ni(t))return null;var{hostname:n,isHostDenied:s}=Rs(i,r);if(s)return n+" is in deny list";if(ti(t))return t;if(ss(t))return t.textContent;if(ai(t))return ks(t);if(Jr(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 ta=e=>!ii(e)&&("navigation"===e.entryType||"resource"===e.entryType);function ra(e){var{entry:t,method:i,status:n,networkRequest:s,isInitial:o,start:a,end:l,url:u,initiatorType:c}=e;a=t?t.startTime:a,l=t?t.responseEnd:l;var d=Math.floor(Date.now()-performance.now()),h=Math.floor(d+(a||0)),p=[r({},t?t.toJSON():{name:u},{startTime:ei(a)?void 0:Math.round(a),endTime:ei(l)?void 0:Math.round(l),timeOrigin:d,timestamp:h,method:i,initiatorType:c||(t?t.initiatorType:void 0),status:n,requestHeaders:s.requestHeaders,requestBody:s.requestBody,responseHeaders:s.responseHeaders,responseBody:s.responseBody,isInitial:o})];if(ta(t))for(var v of t.serverTiming||[])p.push({timeOrigin:d,timestamp:h,startTime:Math.round(t.startTime),name:v.name,duration:v.duration,entryType:"serverTiming"});return p}var ia=["video/","audio/"];function na(e){return new Promise(((t,r)=>{var i=setTimeout((()=>t("[SessionReplay] Timeout while trying to read body")),500);try{e.clone().text().then((e=>t(e)),(e=>r(e))).finally((()=>clearTimeout(i)))}catch(e){clearTimeout(i),t("[SessionReplay] Failed to read body")}}))}function sa(){return sa=t((function*(e){var{r:t,options:r,url:i}=e,{hostname:n,isHostDenied:s}=Rs(i,r);return s?Promise.resolve(n+" is in deny list"):na(t)})),sa.apply(this,arguments)}function oa(){return oa=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=ia.some((e=>null==s?void 0:s.startsWith(e)));if(s&&o)return"Content-Type "+s+" is not supported";var{hostname:a,isHostDenied:l}=Rs(n,i);return l?a+" is in deny list":null}({r:t,options:r,url:i});return ii(n)?na(t):Promise.resolve(n)})),oa.apply(this,arguments)}function aa(e,r,i){if(!i.initiatorTypes.includes("fetch"))return()=>{};var n=Xo("request",i.recordHeaders),s=Xo("response",i.recordHeaders),o=Ms(r,"fetch",(o=>function(){var a=t((function*(t,a){var l,u,c,d=new Request(t,a),h={};try{var p={};d.headers.forEach(((e,t)=>{p[t]=e})),n&&(h.requestHeaders=p),Ko({type:"request",headers:p,url:t,recordBody:i.recordBody})&&(h.requestBody=yield function(e){return sa.apply(this,arguments)}({r:d,options:i,url:t})),u=r.performance.now(),l=yield o(d),c=r.performance.now();var v={};return l.headers.forEach(((e,t)=>{v[t]=e})),s&&(h.responseHeaders=v),Ko({type:"response",headers:v,url:t,recordBody:i.recordBody})&&(h.responseBody=yield function(e){return oa.apply(this,arguments)}({r:l,options:i,url:t})),l}finally{Jo(r,"fetch",d.url,u,c).then((t=>{var r,i=ra({entry:t,method:d.method,status:null==(r=l)?void 0:r.status,networkRequest:h,start:u,end:c,url:d.url,initiatorType:"fetch"});e({requests:i})})).catch((()=>{}))}}));return function(e,t){return a.apply(this,arguments)}}()));return()=>{o()}}var la=null;function ua(e,t,i){if(!("performance"in t))return()=>{};if(la)return jo.warn("Network observer already initialised, doing nothing"),()=>{};var n=i?Object.assign({},zo,i):zo,s=t=>{var i=[];t.requests.forEach((e=>{var t=n.maskRequestFn(e);t&&i.push(t)})),i.length>0&&e(r({},t,{requests:i}))},o=Yo(s,t,n),a=()=>{},l=()=>{};return(n.recordHeaders||n.recordBody)&&(a=function(e,t,r){if(!r.initiatorTypes.includes("xmlhttprequest"))return()=>{};var i=Xo("request",r.recordHeaders),n=Xo("response",r.recordHeaders),s=Ms(t.XMLHttpRequest.prototype,"open",(s=>function(o,a,l,u,c){void 0===l&&(l=!0);var d,h,p=this,v=new Request(a),g={},_={},f=p.setRequestHeader.bind(p);p.setRequestHeader=(e,t)=>(_[e]=t,f(e,t)),i&&(g.requestHeaders=_);var m=p.send.bind(p);p.send=e=>(Ko({type:"request",headers:_,url:a,recordBody:r.recordBody})&&(g.requestBody=ea({body:e,options:r,url:a})),d=t.performance.now(),m(e));var y=()=>{p.removeEventListener("readystatechange",b),p.removeEventListener("error",y),p.removeEventListener("abort",y),p.removeEventListener("timeout",y)},b=()=>{if(p.readyState===p.DONE){y(),h=t.performance.now();var i={};p.getAllResponseHeaders().trim().split(/[\r\n]+/).forEach((e=>{var t=e.split(": "),r=t.shift(),n=t.join(": ");r&&(i[r]=n)})),n&&(g.responseHeaders=i),Ko({type:"response",headers:i,url:a,recordBody:r.recordBody})&&(g.responseBody=ea({body:p.response,options:r,url:a})),Jo(t,"xmlhttprequest",v.url,d,h).then((t=>{var r=ra({entry:t,method:o,status:null==p?void 0:p.status,networkRequest:g,start:d,end:h,url:a.toString(),initiatorType:"xmlhttprequest"});e({requests:r})})).catch((()=>{}))}};p.addEventListener("readystatechange",b),p.addEventListener("error",y),p.addEventListener("abort",y),p.addEventListener("timeout",y),s.call(p,o,a.toString(),l,u,c)}));return()=>{s()}}(s,t,n),l=aa(s,t,n)),la=()=>{o(),a(),l(),la=null}}var ca=e=>({name:"rrweb/network@1",observer:ua,options:e});is.__PosthogExtensions__=is.__PosthogExtensions__||{},is.__PosthogExtensions__.rrwebPlugins={getRecordConsolePlugin:Hr,getRecordNetworkPlugin:ca},is.__PosthogExtensions__.rrweb={record:qt,version:"v2"},is.rrweb={record:qt,version:"v2"},is.rrwebConsoleRecord={getRecordConsolePlugin:Hr},is.getRecordNetworkPlugin=ca;var da,ha,pa,va,ga,_a,fa,ma,ya={},ba=[],Sa=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,wa=Array.isArray;function Ca(e,t){for(var r in t)e[r]=t[r];return e}function Ia(e){var t=e.parentNode;t&&t.removeChild(e)}function ka(e,t,r){var i,n,s,o={};for(s in t)"key"==s?i=t[s]:"ref"==s?n=t[s]:o[s]=t[s];if(arguments.length>2&&(o.children=arguments.length>3?da.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 Ea(e,o,i,n,null)}function Ea(e,t,r,i,n){var s={type:e,props:t,key:r,ref:i,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,constructor:void 0,__v:null==n?++pa:n,__i:-1,__u:0};return null==n&&null!=ha.vnode&&ha.vnode(s),s}function xa(e){return e.children}function Ta(e,t){this.props=e,this.context=t}function Ma(e,t){if(null==t)return e.__?Ma(e.__,e.__i+1):null;for(var r;t<e.__k.length;t++)if(null!=(r=e.__k[t])&&null!=r.__e)return r.__e;return"function"==typeof e.type?Ma(e):null}function Ra(e){var t,r;if(null!=(e=e.__)&&null!=e.__c){for(e.__e=e.__c.base=null,t=0;t<e.__k.length;t++)if(null!=(r=e.__k[t])&&null!=r.__e){e.__e=e.__c.base=r.__e;break}return Ra(e)}}function Pa(e){(!e.__d&&(e.__d=!0)&&va.push(e)&&!Aa.__r++||ga!==ha.debounceRendering)&&((ga=ha.debounceRendering)||_a)(Aa)}function Aa(){var e,t,r,i,n,s,o,a,l;for(va.sort(fa);e=va.shift();)e.__d&&(t=va.length,i=void 0,s=(n=(r=e).__v).__e,a=[],l=[],(o=r.__P)&&((i=Ca({},n)).__v=n.__v+1,ha.vnode&&ha.vnode(i),Ba(o,i,n,r.__n,void 0!==o.ownerSVGElement,32&n.__u?[s]:null,a,null==s?Ma(n):s,!!(32&n.__u),l),i.__.__k[i.__i]=i,Va(a,i,l),i.__e!=s&&Ra(i)),va.length>t&&va.sort(fa));Aa.__r=0}function Na(e,t,r,i,n,s,o,a,l,u,c){var d,h,p,v,g,_=i&&i.__k||ba,f=t.length;for(r.__d=l,function(e,t,r){var i,n,s,o,a,l=t.length,u=r.length,c=u,d=0;for(e.__k=[],i=0;i<l;i++)null!=(n=e.__k[i]=null==(n=t[i])||"boolean"==typeof n||"function"==typeof n?null:"string"==typeof n||"number"==typeof n||"bigint"==typeof n||n.constructor==String?Ea(null,n,null,null,n):wa(n)?Ea(xa,{children:n},null,null,null):void 0===n.constructor&&n.__b>0?Ea(n.type,n.props,n.key,n.ref?n.ref:null,n.__v):n)?(n.__=e,n.__b=e.__b+1,a=La(n,r,o=i+d,c),n.__i=a,s=null,-1!==a&&(c--,(s=r[a])&&(s.__u|=131072)),null==s||null===s.__v?(-1==a&&d--,"function"!=typeof n.type&&(n.__u|=65536)):a!==o&&(a===o+1?d++:a>o?c>l-o?d+=a-o:d--:d=a<o&&a==o-1?a-o:0,a!==i+d&&(n.__u|=65536))):(s=r[i])&&null==s.key&&s.__e&&(s.__e==e.__d&&(e.__d=Ma(s)),Ua(s,s,!1),r[i]=null,c--);if(c)for(i=0;i<u;i++)null!=(s=r[i])&&0==(131072&s.__u)&&(s.__e==e.__d&&(e.__d=Ma(s)),Ua(s,s))}(r,t,_),l=r.__d,d=0;d<f;d++)null!=(p=r.__k[d])&&"boolean"!=typeof p&&"function"!=typeof p&&(h=-1===p.__i?ya:_[p.__i]||ya,p.__i=d,Ba(e,p,h,n,s,o,a,l,u,c),v=p.__e,p.ref&&h.ref!=p.ref&&(h.ref&&$a(h.ref,null,p),c.push(p.ref,p.__c||v,p)),null==g&&null!=v&&(g=v),65536&p.__u||h.__k===p.__k?l=Fa(p,l,e):"function"==typeof p.type&&void 0!==p.__d?l=p.__d:v&&(l=v.nextSibling),p.__d=void 0,p.__u&=-196609);r.__d=l,r.__e=g}function Fa(e,t,r){var i,n;if("function"==typeof e.type){for(i=e.__k,n=0;i&&n<i.length;n++)i[n]&&(i[n].__=e,t=Fa(i[n],t,r));return t}return e.__e!=t&&(r.insertBefore(e.__e,t||null),t=e.__e),t&&t.nextSibling}function La(e,t,r,i){var n=e.key,s=e.type,o=r-1,a=r+1,l=t[r];if(null===l||l&&n==l.key&&s===l.type)return r;if(i>(null!=l&&0==(131072&l.__u)?1:0))for(;o>=0||a<t.length;){if(o>=0){if((l=t[o])&&0==(131072&l.__u)&&n==l.key&&s===l.type)return o;o--}if(a<t.length){if((l=t[a])&&0==(131072&l.__u)&&n==l.key&&s===l.type)return a;a++}}return-1}function Oa(e,t,r){"-"===t[0]?e.setProperty(t,null==r?"":r):e[t]=null==r?"":"number"!=typeof r||Sa.test(t)?r:r+"px"}function Da(e,t,r,i,n){var s;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||Oa(e.style,t,"");if(r)for(t in r)i&&r[t]===i[t]||Oa(e.style,t,r[t])}else if("o"===t[0]&&"n"===t[1])s=t!==(t=t.replace(/(PointerCapture)$|Capture$/,"$1")),t=t.toLowerCase()in e?t.toLowerCase().slice(2):t.slice(2),e.l||(e.l={}),e.l[t+s]=r,r?i?r.u=i.u:(r.u=Date.now(),e.addEventListener(t,s?qa:Ha,s)):e.removeEventListener(t,s?qa:Ha,s);else{if(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&&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,r))}}function Ha(e){var t=this.l[e.type+!1];if(e.t){if(e.t<=t.u)return}else e.t=Date.now();return t(ha.event?ha.event(e):e)}function qa(e){return this.l[e.type+!0](ha.event?ha.event(e):e)}function Ba(e,t,r,i,n,s,o,a,l,u){var c,d,h,p,v,g,_,f,m,y,b,$,S,w,C,I=t.type;if(void 0!==t.constructor)return null;128&r.__u&&(l=!!(32&r.__u),s=[a=t.__e=r.__e]),(c=ha.__b)&&c(t);e:if("function"==typeof I)try{if(f=t.props,m=(c=I.contextType)&&i[c.__c],y=c?m?m.props.value:c.__:i,r.__c?_=(d=t.__c=r.__c).__=d.__E:("prototype"in I&&I.prototype.render?t.__c=d=new I(f,y):(t.__c=d=new Ta(f,y),d.constructor=I,d.render=Wa),m&&m.sub(d),d.props=f,d.state||(d.state={}),d.context=y,d.__n=i,h=d.__d=!0,d.__h=[],d._sb=[]),null==d.__s&&(d.__s=d.state),null!=I.getDerivedStateFromProps&&(d.__s==d.state&&(d.__s=Ca({},d.__s)),Ca(d.__s,I.getDerivedStateFromProps(f,d.__s))),p=d.props,v=d.state,d.__v=t,h)null==I.getDerivedStateFromProps&&null!=d.componentWillMount&&d.componentWillMount(),null!=d.componentDidMount&&d.__h.push(d.componentDidMount);else{if(null==I.getDerivedStateFromProps&&f!==p&&null!=d.componentWillReceiveProps&&d.componentWillReceiveProps(f,y),!d.__e&&(null!=d.shouldComponentUpdate&&!1===d.shouldComponentUpdate(f,d.__s,y)||t.__v===r.__v)){for(t.__v!==r.__v&&(d.props=f,d.state=d.__s,d.__d=!1),t.__e=r.__e,t.__k=r.__k,t.__k.forEach((function(e){e&&(e.__=t)})),b=0;b<d._sb.length;b++)d.__h.push(d._sb[b]);d._sb=[],d.__h.length&&o.push(d);break e}null!=d.componentWillUpdate&&d.componentWillUpdate(f,d.__s,y),null!=d.componentDidUpdate&&d.__h.push((function(){d.componentDidUpdate(p,v,g)}))}if(d.context=y,d.props=f,d.__P=e,d.__e=!1,$=ha.__r,S=0,"prototype"in I&&I.prototype.render){for(d.state=d.__s,d.__d=!1,$&&$(t),c=d.render(d.props,d.state,d.context),w=0;w<d._sb.length;w++)d.__h.push(d._sb[w]);d._sb=[]}else do{d.__d=!1,$&&$(t),c=d.render(d.props,d.state,d.context),d.state=d.__s}while(d.__d&&++S<25);d.state=d.__s,null!=d.getChildContext&&(i=Ca(Ca({},i),d.getChildContext())),h||null==d.getSnapshotBeforeUpdate||(g=d.getSnapshotBeforeUpdate(p,v)),Na(e,wa(C=null!=c&&c.type===xa&&null==c.key?c.props.children:c)?C:[C],t,r,i,n,s,o,a,l,u),d.base=t.__e,t.__u&=-161,d.__h.length&&o.push(d),_&&(d.__E=d.__=null)}catch(e){t.__v=null,l||null!=s?(t.__e=a,t.__u|=l?160:32,s[s.indexOf(a)]=null):(t.__e=r.__e,t.__k=r.__k),ha.__e(e,t,r)}else null==s&&t.__v===r.__v?(t.__k=r.__k,t.__e=r.__e):t.__e=function(e,t,r,i,n,s,o,a,l){var u,c,d,h,p,v,g,_=r.props,f=t.props,m=t.type;if("svg"===m&&(n=!0),null!=s)for(u=0;u<s.length;u++)if((p=s[u])&&"setAttribute"in p==!!m&&(m?p.localName===m:3===p.nodeType)){e=p,s[u]=null;break}if(null==e){if(null===m)return document.createTextNode(f);e=n?document.createElementNS("http://www.w3.org/2000/svg",m):document.createElement(m,f.is&&f),s=null,a=!1}if(null===m)_===f||a&&e.data===f||(e.data=f);else{if(s=s&&da.call(e.childNodes),_=r.props||ya,!a&&null!=s)for(_={},u=0;u<e.attributes.length;u++)_[(p=e.attributes[u]).name]=p.value;for(u in _)p=_[u],"children"==u||("dangerouslySetInnerHTML"==u?d=p:"key"===u||u in f||Da(e,u,null,p,n));for(u in f)p=f[u],"children"==u?h=p:"dangerouslySetInnerHTML"==u?c=p:"value"==u?v=p:"checked"==u?g=p:"key"===u||a&&"function"!=typeof p||_[u]===p||Da(e,u,p,_[u],n);if(c)a||d&&(c.__html===d.__html||c.__html===e.innerHTML)||(e.innerHTML=c.__html),t.__k=[];else if(d&&(e.innerHTML=""),Na(e,wa(h)?h:[h],t,r,i,n&&"foreignObject"!==m,s,o,s?s[0]:r.__k&&Ma(r,0),a,l),null!=s)for(u=s.length;u--;)null!=s[u]&&Ia(s[u]);a||(u="value",void 0!==v&&(v!==e[u]||"progress"===m&&!v||"option"===m&&v!==_[u])&&Da(e,u,v,_[u],!1),u="checked",void 0!==g&&g!==e[u]&&Da(e,u,g,_[u],!1))}return e}(r.__e,t,r,i,n,s,o,l,u);(c=ha.diffed)&&c(t)}function Va(e,t,r){t.__d=void 0;for(var i=0;i<r.length;i++)$a(r[i],r[++i],r[++i]);ha.__c&&ha.__c(t,e),e.some((function(t){try{e=t.__h,t.__h=[],e.some((function(e){e.call(t)}))}catch(e){ha.__e(e,t.__v)}}))}function $a(e,t,r){try{"function"==typeof e?e(t):e.current=t}catch(e){ha.__e(e,r)}}function Ua(e,t,r){var i,n;if(ha.unmount&&ha.unmount(e),(i=e.ref)&&(i.current&&i.current!==e.__e||$a(i,null,t)),null!=(i=e.__c)){if(i.componentWillUnmount)try{i.componentWillUnmount()}catch(e){ha.__e(e,t)}i.base=i.__P=null,e.__c=void 0}if(i=e.__k)for(n=0;n<i.length;n++)i[n]&&Ua(i[n],t,r||"function"!=typeof e.type);r||null==e.__e||Ia(e.__e),e.__=e.__e=e.__d=void 0}function Wa(e,t,r){return this.constructor(e,r)}function za(e,t,r){var i,n,s;ha.__&&ha.__(e,t),i=!1?null:t.__k,n=[],s=[],Ba(t,e=t.__k=ka(xa,null,[e]),i||ya,ya,void 0!==t.ownerSVGElement,i?null:t.firstChild?da.call(t.childNodes):null,n,i?i.__e:t.firstChild,false,s),Va(n,e,s)}function ja(e,t,r){var i,n,s,o,a=Ca({},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]&&void 0!==o?o[s]:t[s];return arguments.length>2&&(a.children=arguments.length>3?da.call(arguments,2):r),Ea(e.type,a,i||e.key,n||e.ref,null)}da=ba.slice,ha={__e:function(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}},pa=0,Ta.prototype.setState=function(e,t){var r;r=null!=this.__s&&this.__s!==this.state?this.__s:this.__s=Ca({},this.state),"function"==typeof e&&(e=e(Ca({},r),this.props)),e&&Ca(r,e),null!=e&&this.__v&&(t&&this._sb.push(t),Pa(this))},Ta.prototype.forceUpdate=function(e){this.__v&&(this.__e=!0,e&&this.__h.push(e),Pa(this))},Ta.prototype.render=xa,va=[],_a="function"==typeof Promise?Promise.prototype.then.bind(Promise.resolve()):setTimeout,fa=function(e,t){return e.__v.__b-t.__v.__b},Aa.__r=0,ma=0;var Za,Ga,Ya,Xa,Ka=0,Ja=[],Qa=[],el=ha.__b,tl=ha.__r,rl=ha.diffed,il=ha.__c,nl=ha.unmount;function sl(e,t){ha.__h&&ha.__h(Ga,e,Ka||t),Ka=0;var r=Ga.__H||(Ga.__H={__:[],__h:[]});return e>=r.__.length&&r.__.push({__V:Qa}),r.__[e]}function ol(e){return Ka=1,function(e,t,r){var i=sl(Za++,2);if(i.t=e,!i.__c&&(i.__=[fl(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=Ga,!Ga.u)){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=!1;return n.forEach((function(e){if(e.__N){var t=e.__[0];e.__=e.__N,e.__N=void 0,t!==e.__[0]&&(o=!0)}})),!(!o&&i.__c.props===e)&&(!s||s.call(this,e,t,r))};Ga.u=!0;var s=Ga.shouldComponentUpdate,o=Ga.componentWillUpdate;Ga.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)},Ga.shouldComponentUpdate=n}return i.__N||i.__}(fl,e)}function al(e,t){var r=sl(Za++,3);!ha.__s&&_l(r.__H,t)&&(r.__=e,r.i=t,Ga.__H.__h.push(r))}function ll(e){return Ka=5,ul((function(){return{current:e}}),[])}function ul(e,t){var r=sl(Za++,7);return _l(r.__H,t)?(r.__V=e(),r.i=t,r.__h=e,r.__V):r.__}function cl(e){var t=Ga.context[e.__c],r=sl(Za++,9);return r.c=e,t?(null==r.__&&(r.__=!0,t.sub(Ga)),t.props.value):e.__}function dl(){for(var e;e=Ja.shift();)if(e.__P&&e.__H)try{e.__H.__h.forEach(vl),e.__H.__h.forEach(gl),e.__H.__h=[]}catch(t){e.__H.__h=[],ha.__e(t,e.__v)}}ha.__b=function(e){Ga=null,el&&el(e)},ha.__r=function(e){tl&&tl(e),Za=0;var t=(Ga=e.__c).__H;t&&(Ya===Ga?(t.__h=[],Ga.__h=[],t.__.forEach((function(e){e.__N&&(e.__=e.__N),e.__V=Qa,e.__N=e.i=void 0}))):(t.__h.forEach(vl),t.__h.forEach(gl),t.__h=[],Za=0)),Ya=Ga},ha.diffed=function(e){rl&&rl(e);var t=e.__c;t&&t.__H&&(t.__H.__h.length&&(1!==Ja.push(t)&&Xa===ha.requestAnimationFrame||((Xa=ha.requestAnimationFrame)||pl)(dl)),t.__H.__.forEach((function(e){e.i&&(e.__H=e.i),e.__V!==Qa&&(e.__=e.__V),e.i=void 0,e.__V=Qa}))),Ya=Ga=null},ha.__c=function(e,t){t.some((function(e){try{e.__h.forEach(vl),e.__h=e.__h.filter((function(e){return!e.__||gl(e)}))}catch(r){t.some((function(e){e.__h&&(e.__h=[])})),t=[],ha.__e(r,e.__v)}})),il&&il(e,t)},ha.unmount=function(e){nl&&nl(e);var t,r=e.__c;r&&r.__H&&(r.__H.__.forEach((function(e){try{vl(e)}catch(e){t=e}})),r.__H=void 0,t&&ha.__e(t,r.__v))};var hl="function"==typeof requestAnimationFrame;function pl(e){var t,r=function(){clearTimeout(i),hl&&cancelAnimationFrame(t),setTimeout(e)},i=setTimeout(r,100);hl&&(t=requestAnimationFrame(r))}function vl(e){var t=Ga,r=e.__c;"function"==typeof r&&(e.__c=void 0,r()),Ga=t}function gl(e){var t=Ga;e.__c=e.__(),Ga=t}function _l(e,t){return!e||e.length!==t.length||t.some((function(t,r){return t!==e[r]}))}function fl(e,t){return"function"==typeof t?t(e):t}var ml=function(e){return e.Activation="events",e.Cancellation="cancelEvents",e}({}),yl=function(e){return e.Button="button",e.Tab="tab",e.Selector="selector",e}({}),bl=function(e){return e.TopLeft="top_left",e.TopRight="top_right",e.TopCenter="top_center",e.MiddleLeft="middle_left",e.MiddleRight="middle_right",e.MiddleCenter="middle_center",e.Left="left",e.Center="center",e.Right="right",e.NextToTrigger="next_to_trigger",e}({}),Sl=function(e){return e.Top="top",e.Left="left",e.Right="right",e.Bottom="bottom",e}({}),wl=function(e){return e.Popover="popover",e.API="api",e.Widget="widget",e.ExternalSurvey="external_survey",e}({}),Cl=function(e){return e.Open="open",e.MultipleChoice="multiple_choice",e.SingleChoice="single_choice",e.Rating="rating",e.Link="link",e}({}),Il=function(e){return e.NextQuestion="next_question",e.End="end",e.ResponseBased="response_based",e.SpecificQuestion="specific_question",e}({}),kl=function(e){return e.Once="once",e.Recurring="recurring",e.Always="always",e}({}),El=function(e){return e.SHOWN="survey shown",e.DISMISSED="survey dismissed",e.SENT="survey sent",e.ABANDONED="survey abandoned",e}({}),xl=function(e){return e.SURVEY_ID="$survey_id",e.SURVEY_NAME="$survey_name",e.SURVEY_RESPONSE="$survey_response",e.SURVEY_ITERATION="$survey_iteration",e.SURVEY_ITERATION_START_DATE="$survey_iteration_start_date",e.SURVEY_PARTIALLY_COMPLETED="$survey_partially_completed",e.SURVEY_SUBMISSION_ID="$survey_submission_id",e.SURVEY_QUESTIONS="$survey_questions",e.SURVEY_COMPLETED="$survey_completed",e.PRODUCT_TOUR_ID="$product_tour_id",e}({}),Tl=function(e){return e.Popover="popover",e.Inline="inline",e}({}),Ml=us("[Surveys]");function Rl(e){return!(!e.start_date||e.end_date)}function Pl(e){var t;return!(null==(t=e.conditions)||null==(t=t.events)||null==(t=t.values)||!t.length)}function Al(e){var t;return!(null==(t=e.conditions)||null==(t=t.actions)||null==(t=t.values)||!t.length)}var Nl="seenSurvey_",Fl="inProgressSurvey_",Ll=(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},Ol=(e,t)=>{var r=""+e+t.id;return t.current_iteration&&t.current_iteration>0&&(r=""+e+t.id+"_"+t.current_iteration),r},Dl=e=>Ol(Nl,e),Hl=e=>{localStorage.getItem(Dl(e))||localStorage.setItem(Dl(e),"true")},ql=[wl.Popover,wl.Widget,wl.API],Bl={ignoreConditions:!1,ignoreDelay:!1,displayType:Tl.Popover};Math.trunc||(Math.trunc=function(e){return e<0?Math.ceil(e):Math.floor(e)}),Number.isInteger||(Number.isInteger=function(e){return si(e)&&isFinite(e)&&Math.floor(e)===e});var Vl="0123456789abcdef";class $l{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)||e<0||t<0||r<0||i<0||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 $l(n)}toString(){for(var e="",t=0;t<this.bytes.length;t++)e=e+Vl.charAt(this.bytes[t]>>>4)+Vl.charAt(15&this.bytes[t]),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 $l(this.bytes.slice(0))}equals(e){return 0===this.compareTo(e)}compareTo(e){for(var t=0;t<16;t++){var r=this.bytes[t]-e.bytes[t];if(0!==r)return Math.sign(r)}return 0}}class Ul{constructor(){this._timestamp=0,this._counter=0,this._random=new jl}generate(){var e=this.generateOrAbort();if(ei(e)){this._timestamp=0;var t=this.generateOrAbort();if(ei(t))throw new Error("Could not generate UUID after timestamp reset");return t}return e}generateOrAbort(){var e=Date.now();if(e>this._timestamp)this._timestamp=e,this._resetCounter();else{if(!(e+1e4>this._timestamp))return;this._counter++,this._counter>4398046511103&&(this._timestamp++,this._resetCounter())}return $l.fromFieldsV7(this._timestamp,Math.trunc(this._counter/Math.pow(2,30)),this._counter&Math.pow(2,30)-1,this._random.nextUint32())}_resetCounter(){this._counter=1024*this._random.nextUint32()+(1023&this._random.nextUint32())}}var Wl,zl=e=>{if("undefined"!=typeof UUIDV7_DENY_WEAK_RNG&&UUIDV7_DENY_WEAK_RNG)throw new Error("no cryptographically strong RNG available");for(var t=0;t<e.length;t++)e[t]=65536*Math.trunc(65536*Math.random())+Math.trunc(65536*Math.random());return e};zn&&!ei(zn.crypto)&&crypto.getRandomValues&&(zl=e=>crypto.getRandomValues(e));class jl{constructor(){this._buffer=new Uint32Array(8),this._cursor=1/0}nextUint32(){return this._cursor>=this._buffer.length&&(zl(this._buffer),this._cursor=0),this._buffer[this._cursor++]}}var Zl=()=>Gl().toString(),Gl=()=>(Wl||(Wl=new Ul)).generate(),Yl="$copy_autocapture",Xl=function(e){return e.GZipJS="gzip-js",e.Base64="base64",e}({}),Kl=["fatal","error","warning","log","info","debug"],Jl=Uint8Array,Ql=Uint16Array,eu=Uint32Array,tu=new Jl([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]),ru=new Jl([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]),iu=new Jl([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),nu=function(e,t){for(var r=new Ql(31),i=0;i<31;++i)r[i]=t+=1<<e[i-1];var n=new eu(r[30]);for(i=1;i<30;++i)for(var s=r[i];s<r[i+1];++s)n[s]=s-r[i]<<5|i;return[r,n]},su=nu(tu,2),ou=su[0],au=su[1];ou[28]=258,au[258]=28;for(var lu=nu(ru,0)[1],uu=new Ql(32768),cu=0;cu<32768;++cu){var du=(43690&cu)>>>1|(21845&cu)<<1;du=(61680&(du=(52428&du)>>>2|(13107&du)<<2))>>>4|(3855&du)<<4,uu[cu]=((65280&du)>>>8|(255&du)<<8)>>>1}var hu=function(e,t,r){for(var i=e.length,n=0,s=new Ql(t);n<i;++n)++s[e[n]-1];var o,a=new Ql(t);for(n=0;n<t;++n)a[n]=a[n-1]+s[n-1]<<1;if(r){o=new Ql(1<<t);var l=15-t;for(n=0;n<i;++n)if(e[n])for(var u=n<<4|e[n],c=t-e[n],d=a[e[n]-1]++<<c,h=d|(1<<c)-1;d<=h;++d)o[uu[d]>>>l]=u}else for(o=new Ql(i),n=0;n<i;++n)o[n]=uu[a[e[n]-1]++]>>>15-e[n];return o},pu=new Jl(288);for(cu=0;cu<144;++cu)pu[cu]=8;for(cu=144;cu<256;++cu)pu[cu]=9;for(cu=256;cu<280;++cu)pu[cu]=7;for(cu=280;cu<288;++cu)pu[cu]=8;var vu=new Jl(32);for(cu=0;cu<32;++cu)vu[cu]=5;var gu=hu(pu,9,0),_u=hu(vu,5,0),fu=function(e){return(e/8>>0)+(7&e&&1)},mu=function(e,t,r){(null==r||r>e.length)&&(r=e.length);var i=new(e instanceof Ql?Ql:e instanceof eu?eu:Jl)(r-t);return i.set(e.subarray(t,r)),i},yu=function(e,t,r){r<<=7&t;var i=t/8>>0;e[i]|=r,e[i+1]|=r>>>8},bu=function(e,t,r){r<<=7&t;var i=t/8>>0;e[i]|=r,e[i+1]|=r>>>8,e[i+2]|=r>>>16},Su=function(e,t){for(var r=[],i=0;i<e.length;++i)e[i]&&r.push({s:i,f:e[i]});var n=r.length,s=r.slice();if(!n)return[new Jl(0),0];if(1==n){var o=new Jl(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,c=1,d=2;for(r[0]={s:-1,f:a.f+l.f,l:a,r:l};c!=n-1;)a=r[r[u].f<r[d].f?u++:d++],l=r[u!=c&&r[u].f<r[d].f?u++:d++],r[c++]={s:-1,f:a.f+l.f,l:a,r:l};var h=s[0].s;for(i=1;i<n;++i)s[i].s>h&&(h=s[i].s);var p=new Ql(h+1),v=wu(r[c-1],p,0);if(v>t){i=0;var g=0,_=v-t,f=1<<_;for(s.sort((function(e,t){return p[t.s]-p[e.s]||e.f-t.f}));i<n;++i){var m=s[i].s;if(!(p[m]>t))break;g+=f-(1<<v-p[m]),p[m]=t}for(g>>>=_;g>0;){var y=s[i].s;p[y]<t?g-=1<<t-p[y]++-1:++i}for(;i>=0&&g;--i){var b=s[i].s;p[b]==t&&(--p[b],++g)}v=t}return[new Jl(p),v]},wu=function(e,t,r){return-1==e.s?Math.max(wu(e.l,t,r+1),wu(e.r,t,r+1)):t[e.s]=r},Cu=function(e){for(var t=e.length;t&&!e[--t];);for(var r=new Ql(++t),i=0,n=e[0],s=1,o=function(e){r[i++]=e},a=1;a<=t;++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]},Iu=function(e,t){for(var r=0,i=0;i<t.length;++i)r+=e[i]*t[i];return r},ku=function(e,t,r){var i=r.length,n=fu(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;s<i;++s)e[n+s+4]=r[s];return 8*(n+4+i)},Eu=function(e,t,r,i,n,s,o,a,l,u,c){yu(t,c++,r),++n[256];for(var d=Su(n,15),h=d[0],p=d[1],v=Su(s,15),g=v[0],_=v[1],f=Cu(h),m=f[0],y=f[1],b=Cu(g),S=b[0],w=b[1],C=new Ql(19),I=0;I<m.length;++I)C[31&m[I]]++;for(I=0;I<S.length;++I)C[31&S[I]]++;for(var k=Su(C,7),E=k[0],x=k[1],T=19;T>4&&!E[iu[T-1]];--T);var M,R,P,A,N=u+5<<3,F=Iu(n,pu)+Iu(s,vu)+o,L=Iu(n,h)+Iu(s,g)+o+14+3*T+Iu(C,E)+(2*C[16]+3*C[17]+7*C[18]);if(N<=F&&N<=L)return ku(t,c,e.subarray(l,l+u));if(yu(t,c,1+(L<F)),c+=2,L<F){M=hu(h,p,0),R=h,P=hu(g,_,0),A=g;var O=hu(E,x,0);yu(t,c,y-257),yu(t,c+5,w-1),yu(t,c+10,T-4),c+=14;for(I=0;I<T;++I)yu(t,c+3*I,E[iu[I]]);c+=3*T;for(var D=[m,S],H=0;H<2;++H){var q=D[H];for(I=0;I<q.length;++I){var B=31&q[I];yu(t,c,O[B]),c+=E[B],B>15&&(yu(t,c,q[I]>>>5&127),c+=q[I]>>>12)}}}else M=gu,R=pu,P=_u,A=vu;for(I=0;I<a;++I)if(i[I]>255){B=i[I]>>>18&31;bu(t,c,M[B+257]),c+=R[B+257],B>7&&(yu(t,c,i[I]>>>23&31),c+=tu[B]);var V=31&i[I];bu(t,c,P[V]),c+=A[V],V>3&&(bu(t,c,i[I]>>>5&8191),c+=ru[V])}else bu(t,c,M[i[I]]),c+=R[i[I]];return bu(t,c,M[256]),c+R[256]},xu=new eu([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),Tu=function(){for(var e=new eu(256),t=0;t<256;++t){for(var r=t,i=9;--i;)r=(1&r&&3988292384)^r>>>1;e[t]=r}return e}(),Mu=function(e,t,r,i,n){return function(e,t,r,i,n,s){var o=e.length,a=new Jl(i+o+5*(1+Math.floor(o/7e3))+n),l=a.subarray(i,a.length-n),u=0;if(!t||o<8)for(var c=0;c<=o;c+=65535){var d=c+65535;d<o?u=ku(l,u,e.subarray(c,d)):(l[c]=s,u=ku(l,u,e.subarray(c,o)))}else{for(var h=xu[t-1],p=h>>>13,v=8191&h,g=(1<<r)-1,_=new Ql(32768),f=new Ql(g+1),m=Math.ceil(r/3),y=2*m,b=function(t){return(e[t]^e[t+1]<<m^e[t+2]<<y)&g},S=new eu(25e3),w=new Ql(288),C=new Ql(32),I=0,k=0,E=(c=0,0),x=0,T=0;c<o;++c){var M=b(c),R=32767&c,P=f[M];if(_[R]=P,f[M]=R,x<=c){var A=o-c;if((I>7e3||E>24576)&&A>423){u=Eu(e,l,0,S,w,C,k,E,T,c-T,u),E=I=k=0,T=c;for(var N=0;N<286;++N)w[N]=0;for(N=0;N<30;++N)C[N]=0}var F=2,L=0,O=v,D=R-P&32767;if(A>2&&M==b(c-D))for(var H=Math.min(p,A)-1,q=Math.min(32767,c),B=Math.min(258,A);D<=q&&--O&&R!=P;){if(e[c+F]==e[c+F-D]){for(var V=0;V<B&&e[c+V]==e[c+V-D];++V);if(V>F){if(F=V,L=D,V>H)break;var U=Math.min(D,V-2),W=0;for(N=0;N<U;++N){var z=c-D+N+32768&32767,j=z-_[z]+32768&32767;j>W&&(W=j,P=z)}}}D+=(R=P)-(P=_[R])+32768&32767}if(L){S[E++]=268435456|au[F]<<18|lu[L];var Z=31&au[F],G=31&lu[L];k+=tu[Z]+ru[G],++w[257+Z],++C[G],x=c+F,++I}else S[E++]=e[c],++w[e[c]]}}u=Eu(e,l,s,S,w,C,k,E,T,c-T,u)}return mu(a,0,i+fu(u)+n)}(e,null==t.level?6:t.level,null==t.mem?Math.ceil(1.5*Math.max(8,Math.min(13,Math.log(e.length)))):12+t.mem,r,i,!0)},Ru=function(e,t,r){for(;r;++t)e[t]=r,r>>>=8};function Pu(e,t){void 0===t&&(t={});var r=function(){var e=4294967295;return{p:function(t){for(var r=e,i=0;i<t.length;++i)r=Tu[255&r^t[i]]^r>>>8;e=r},d:function(){return 4294967295^e}}}(),i=e.length;r.p(e);var n=Mu(e,t,function(e){return 10+(e.filename&&e.filename.length+1||0)}(t),8),s=n.length;return function(e,t){var r=t.filename;if(e[0]=31,e[1]=139,e[2]=8,e[8]=t.level<2?4:9==t.level?2:0,e[9]=3,0!=t.mtime&&Ru(e,4,Math.floor(new Date(t.mtime||Date.now())/1e3)),r){e[3]=8;for(var i=0;i<=r.length;++i)e[i+10]=r.charCodeAt(i)}}(n,t),Ru(n,s-8,r.d()),Ru(n,s-4,i),n}var Au=function(e){var t,r,i,n,s="";for(t=r=0,i=(e=(e+"").replace(/\r\n/g,"\n").replace(/\r/g,"\n")).length,n=0;n<i;n++){var o=e.charCodeAt(n),a=null;o<128?r++:a=o>127&&o<2048?String.fromCharCode(o>>6|192,63&o|128):String.fromCharCode(o>>12|224,o>>6&63|128,63&o|128),ii(a)||(r>t&&(s+=e.substring(t,r)),s+=a,t=r=n+1)}return r>t&&(s+=e.substring(t,e.length)),s},Nu=!!es||!!Qn,Fu="text/plain",Lu=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=ks(a);return u&&l.push(u),s+"?"+l.join("&")},Ou=(e,t)=>JSON.stringify(e,((e,t)=>"bigint"==typeof t?t.toString():t),t),Du=e=>{var{data:t,compression:r}=e;if(t){if(r===Xl.GZipJS){var i=Pu(function(e,t){var r=e.length;if("undefined"!=typeof TextEncoder)return(new TextEncoder).encode(e);for(var i=new Jl(e.length+(e.length>>>1)),n=0,s=function(e){i[n++]=e},o=0;o<r;++o){if(n+5>i.length){var a=new Jl(n+8+(r-o<<1));a.set(i),i=a}var l=e.charCodeAt(o);l<128||t?s(l):l<2048?(s(192|l>>>6),s(128|63&l)):l>55295&&l<57344?(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 mu(i,0,n)}(Ou(t)),{mtime:0}),n=new Blob([i],{type:Fu});return{contentType:Fu,body:n,estimatedSize:n.size}}if(r===Xl.Base64){var s=function(e){var t,r,i,n,s,o="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",a=0,l=0,u="",c=[];if(!e)return e;e=Au(e);do{t=(s=e.charCodeAt(a++)<<16|e.charCodeAt(a++)<<8|e.charCodeAt(a++))>>18&63,r=s>>12&63,i=s>>6&63,n=63&s,c[l++]=o.charAt(t)+o.charAt(r)+o.charAt(i)+o.charAt(n)}while(a<e.length);switch(u=c.join(""),e.length%3){case 1:u=u.slice(0,-2)+"==";break;case 2:u=u.slice(0,-1)+"="}return u}(Ou(t)),o=(e=>"data="+encodeURIComponent("string"==typeof e?e:Ou(e)))(s);return{contentType:"application/x-www-form-urlencoded",body:o,estimatedSize:new Blob([o]).size}}var a=Ou(t);return{contentType:"application/json",body:a,estimatedSize:new Blob([a]).size}}},Hu=[];Qn&&Hu.push({transport:"fetch",method:e=>{var t,i,{contentType:n,body:s,estimatedSize:o}=null!==(t=Du(e))&&void 0!==t?t:{},a=new Headers;hs(e.headers,(function(e,t){a.append(t,e)})),n&&a.append("Content-Type",n);var l=e.url,u=null;if(ts){var c=new ts;u={signal:c.signal,timeout:setTimeout((()=>c.abort()),e.timeout)}}Qn(l,r({method:(null==e?void 0:e.method)||"GET",headers:a,keepalive:"POST"===e.method&&(o||0)<52428.8,body:s,signal:null==(i=u)?void 0:i.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){ls.error(e)}null==e.callback||e.callback(i)})))).catch((t=>{ls.error(t),null==e.callback||e.callback({statusCode:0,text:t})})).finally((()=>u?clearTimeout(u.timeout):null))}}),es&&Hu.push({transport:"XHR",method:e=>{var t,r=new es;r.open(e.method||"GET",e.url,!0);var{contentType:i,body:n}=null!==(t=Du(e))&&void 0!==t?t:{};hs(e.headers,(function(e,t){r.setRequestHeader(t,e)})),i&&r.setRequestHeader("Content-Type",i),e.timeout&&(r.timeout=e.timeout),e.disableXHRCredentials||(r.withCredentials=!0),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(n)}}),null!=Xn&&Xn.sendBeacon&&Hu.push({transport:"sendBeacon",method:e=>{var t=Lu(e.url,{beacon:"1"});try{var r,{contentType:i,body:n}=null!==(r=Du(e))&&void 0!==r?r:{},s="string"==typeof n?new Blob([n],{type:i}):n;Xn.sendBeacon(t,s)}catch(e){}}});var qu=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 Bu(e,t,r){return Ou({distinct_id:e,userPropertiesToSet:t,userPropertiesToSetOnce:r})}var Vu={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=>qu(t,e))))),not_regex:(e,t)=>t.every((t=>e.every((e=>!qu(t,e))))),icontains:(e,t)=>t.map($u).some((t=>e.map($u).some((e=>t.includes(e))))),not_icontains:(e,t)=>t.map($u).every((t=>e.map($u).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)))}))},$u=e=>e.toLowerCase();function Uu(e,t){return!e||Object.entries(e).every((e=>{var[r,i]=e,n=null==t?void 0:t[r];if(ei(n)||ii(n))return!1;var s=[String(n)],o=Vu[i.operator];return!!o&&o(i.values,s)}))}var Wu=us("[Stylesheet Loader]"),zu=zn,ju=Kn;function Zu(e){return"$survey_response_"+e}var Gu="#020617",Yu={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:bl.Right,widgetType:yl.Tab,widgetLabel:"Feedback",widgetColor:"black",zIndex:"2147483647",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:Gu,scrollbarThumbColor:"var(--ph-survey-border-color)",scrollbarTrackColor:"var(--ph-survey-background-color)"};function Xu(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 Ku(e){var t;void 0===e&&(e=Yu.backgroundColor),"#"===e[0]&&(t=Xu(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=Xu(r)),!t)return Gu;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?Gu:"white"}return Gu}function Ju(e){var t=((e,t,r)=>{var i,n=e.createElement("style");return n.innerText=t,null!=r&&null!=(i=r.config)&&i.prepare_external_dependency_stylesheet&&(n=r.config.prepare_external_dependency_stylesheet(n)),n||(Wu.error("prepare_external_dependency_stylesheet returned null"),null)})(ju,':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:2147483647;--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}.survey-box:has(.survey-question:empty):not(:has(.survey-question-description)) .multiple-choice-options,.survey-box:has(.survey-question:empty):not(:has(.survey-question-description)) 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}.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:hover{cursor:pointer}.rating-text{display:flex;flex-direction:row;font-size:11px;justify-content:space-between;opacity:.7}.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-cancel{background:#fff;border-radius:100%;cursor:pointer;line-height:0;padding:12px;position:absolute;right:0;top:0;transform:translate(50%,-50%)}.form-cancel:hover{opacity:.7;transform:translate(50%,-50%) scale(1.1)}.footer-branding{align-items:center;display:flex;font-size:11px;font-weight:500;gap:4px;justify-content:center;opacity:.6;text-decoration:none}.footer-branding:hover{opacity:1}.footer-branding a{text-decoration:none}.thank-you-message{text-align:center}.thank-you-message-header{margin:10px 0 0}.thank-you-message-body{font-size:14px;opacity:.8}.limit-height{max-height:256px;overflow-x:hidden;overflow-y:auto;scrollbar-color:var(--ph-survey-scrollbar-thumb-color) var(--ph-survey-scrollbar-track-color);scrollbar-width:thin}.limit-height::-webkit-scrollbar{width:8px}.limit-height::-webkit-scrollbar-track{background:var(--ph-survey-scrollbar-track-color);border-radius:4px}.limit-height::-webkit-scrollbar-thumb{background-color:var(--ph-survey-scrollbar-thumb-color);border:2px solid var(--ph-survey-scrollbar-track-color);border-radius:4px}:is(.limit-height::-webkit-scrollbar-thumb):hover{background-color:var(--ph-survey-text-subtle-color)}.sr-only{clip:rect(0,0,0,0);border:0;height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;white-space:nowrap;width:1px}@media (prefers-reduced-motion:reduce){.ph-survey *{animation-duration:.01ms!important;animation-iteration-count:1!important;scroll-behavior:auto!important;transition-duration:.01ms!important}}@keyframes ph-survey-checkmark-reveal{0%{opacity:0;transform:rotate(45deg) scale(0)}50%{opacity:1;transform:rotate(45deg) scale(1.2)}to{opacity:1;transform:rotate(45deg) scale(1)}}@keyframes ph-survey-radio-reveal{0%{opacity:0;transform:scale(0)}50%{opacity:1;transform:scale(1.3)}to{opacity:1;transform:scale(1)}}',e);return null==t||t.setAttribute("data-ph-survey-style","true"),t}var Qu=(e,t,i)=>{var n=bc(e),s=ju.querySelector("."+n);if(s&&s.shadowRoot)return{shadow:s.shadowRoot,isNewlyCreated:!1};var o=ju.createElement("div");((e,t,i)=>{var n=r({},Yu,i),s=e.style,o=![bl.Center,bl.Left,bl.Right].includes(n.position)||t===wl.Widget&&(null==i?void 0:i.widgetType)===yl.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)||Ku(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",Ku(n.ratingButtonActiveColor)),s.setProperty("--ph-survey-text-primary-color",(null==i?void 0:i.textColor)||Ku(n.backgroundColor)),s.setProperty("--ph-survey-text-subtle-color",n.textSubtleColor),s.setProperty("--ph-widget-color",n.widgetColor),s.setProperty("--ph-widget-text-color",Ku(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)||Ku(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=Ju(t);if(l){var u=a.querySelector("style");u&&a.removeChild(u),a.appendChild(l)}return ju.body.appendChild(o),{shadow:a,isNewlyCreated:!0}},ec=(e,t)=>{if(!t)return null;var r=e[Zu(t)];return Yr(r)?[...r]:r},tc=e=>{var{responses:t,survey:i,surveySubmissionId:n,posthog:s,isSurveyCompleted:o}=e;s?(Hl(i),s.capture(El.SENT,r({[xl.SURVEY_NAME]:i.name,[xl.SURVEY_ID]:i.id,[xl.SURVEY_ITERATION]:i.current_iteration,[xl.SURVEY_ITERATION_START_DATE]:i.current_iteration_start_date,[xl.SURVEY_QUESTIONS]:i.questions.map((e=>({id:e.id,question:e.question,response:ec(t,e.id)}))),[xl.SURVEY_SUBMISSION_ID]:n,[xl.SURVEY_COMPLETED]:o,sessionRecordingUrl:null==s.get_session_replay_url?void 0:s.get_session_replay_url()},t,{$set:{[Ll(i,"responded")]:!0}})),o&&(zu.dispatchEvent(new CustomEvent("PHSurveySent",{detail:{surveyId:i.id}})),yc(i))):Ml.error("[survey sent] event not captured, PostHog instance not found.")},rc=e=>Object.values((null==e?void 0:e.responses)||{}).filter((e=>!ni(e))).length>0,ic=(e,t,i)=>r({[xl.SURVEY_NAME]:e.name,[xl.SURVEY_ID]:e.id,[xl.SURVEY_ITERATION]:e.current_iteration,[xl.SURVEY_ITERATION_START_DATE]:e.current_iteration_start_date,[xl.SURVEY_PARTIALLY_COMPLETED]:rc(t),sessionRecordingUrl:null==i.get_session_replay_url?void 0:i.get_session_replay_url()},null==t?void 0:t.responses,{[xl.SURVEY_SUBMISSION_ID]:null==t?void 0:t.surveySubmissionId,[xl.SURVEY_QUESTIONS]:e.questions.map((e=>({id:e.id,question:e.question,response:ec((null==t?void 0:t.responses)||{},e.id)})))}),nc=(e,t,i)=>{if(t){if(!i){var n=fc(e);t.capture(El.DISMISSED,r({},ic(e,n,t),{$set:{[Ll(e,"dismissed")]:!0}})),yc(e),Hl(e),zu.dispatchEvent(new CustomEvent("PHSurveyClosed",{detail:{surveyId:e.id}}))}}else Ml.error("[survey dismissed] event not captured, PostHog instance not found.")},sc=(e,t)=>{if(t){var r=(e=>Ol("abandonedSurvey_",e))(e);try{if("true"===localStorage.getItem(r))return}catch(e){return}var i=fc(e);if(i){try{localStorage.setItem(r,"true")}catch(e){}t.capture(El.ABANDONED,ic(e,i,t),{transport:"sendBeacon"})}}else Ml.error("[survey abandoned] event not captured, PostHog instance not found.")},oc=e=>e.map((e=>({sort:Math.floor(10*Math.random()),value:e}))).sort(((e,t)=>e.sort-t.sort)).map((e=>e.value)),ac=(e,t)=>e.length===t.length&&e.every(((e,r)=>e===t[r]))?t.reverse():t,lc=e=>e.appearance&&e.appearance.shuffleQuestions&&!e.enable_partial_responses?ac(e.questions,oc(e.questions)):e.questions,uc=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===kl.Always||mc(e)},cc=function(e,t){var r={__c:t="__cC"+ma++,__:e,Consumer:function(e,t){return e.children(t)},Provider:function(e){var r,i;return this.getChildContext||(r=[],(i={})[t]=this,this.getChildContext=function(){return i},this.shouldComponentUpdate=function(e){this.props.value!==e.value&&r.some((function(e){e.__e=!0,Pa(e)}))},this.sub=function(e){r.push(e);var t=e.componentWillUnmount;e.componentWillUnmount=function(){r.splice(r.indexOf(e),1),t&&t.call(e)}}),e.children}};return r.Provider.__=r.Consumer.contextType=r}({isPreviewMode:!1,previewPageIndex:0,onPopupSurveyDismissed:()=>{},isPopup:!0,onPreviewSubmit:()=>{},surveySubmissionId:""}),dc=()=>cl(cc),hc=e=>{var{component:t,children:r,renderAsHtml:i,style:n}=e;return ja(t,i?{dangerouslySetInnerHTML:{__html:r},style:n}:{children:r,style:n})};function pc(e){return null!=e?e:"icontains"}function vc(e){var t,r,i;if(null==(t=e.conditions)||!t.url)return!0;var n=null==zu||null==(r=zu.location)?void 0:r.href;if(!n)return!1;var s=[e.conditions.url],o=pc(null==(i=e.conditions)?void 0:i.urlMatchType);return Vu[o](s,[n])}var gc=e=>{var t=""+Fl+e.id;return e.current_iteration&&e.current_iteration>0&&(t=""+Fl+e.id+"_"+e.current_iteration),t},_c=(e,t)=>{try{localStorage.setItem(gc(e),JSON.stringify(t))}catch(e){Ml.error("Error setting in-progress survey state in localStorage",e)}},fc=e=>{try{var t=localStorage.getItem(gc(e));if(t)return JSON.parse(t)}catch(e){Ml.error("Error getting in-progress survey state from localStorage",e)}return null},mc=e=>{var t=fc(e);return!ni(null==t?void 0:t.surveySubmissionId)},yc=e=>{try{localStorage.removeItem(gc(e))}catch(e){Ml.error("Error clearing in-progress survey state from localStorage",e)}};function bc(e,t){void 0===t&&(t=!1);var r="PostHogSurvey-"+e.id;return t?"."+r:r}var Sc=0;function wc(e,t,r,i,n,s){var o,a,l={};for(a in 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,__d:void 0,__c:null,constructor:void 0,__v:--Sc,__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 ha.vnode&&ha.vnode(u),u}var Cc=wc("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 -960 960 960",width:"48",children:wc("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"})}),Ic=wc("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 -960 960 960",width:"48",children:wc("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"})}),kc=wc("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 -960 960 960",width:"48",children:wc("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"})}),Ec=wc("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 -960 960 960",width:"48",children:wc("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"})}),xc=wc("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 -960 960 960",width:"48",children:wc("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"})}),Tc=wc("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-labelledby":"close-survey-title",children:[wc("title",{id:"close-survey-title",children:"Close survey"}),wc("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:"black"})]}),Mc=wc("svg",{width:"77",height:"14",viewBox:"0 0 77 14",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[wc("g",{"clip-path":"url(#clip0_2415_6911)",children:[wc("mask",{id:"mask0_2415_6911",style:{maskType:"luminance"},maskUnits:"userSpaceOnUse",x:"0",y:"0",width:"77",height:"14",children:wc("path",{d:"M0.5 0H76.5V14H0.5V0Z",fill:"white"})}),wc("g",{mask:"url(#mask0_2415_6911)",children:[wc("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"}),wc("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"}),wc("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"}),wc("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"}),wc("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"}),wc("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"})]})]}),wc("defs",{children:wc("clipPath",{id:"clip0_2415_6911",children:wc("rect",{width:"76",height:"14",fill:"white",transform:"translate(0.5)"})})})]});function Rc(){return wc("a",{href:"https://posthog.com/surveys",target:"_blank",rel:"noopener",className:"footer-branding",children:["Survey by ",Mc]})}function Pc(e){var{text:t,submitDisabled:r,appearance:i,onSubmit:n,link:s,onPreviewSubmit:o,skipSubmitButton:a}=e,{isPreviewMode:l}=cl(cc);return wc("div",{className:"bottom-section",children:[!a&&wc("button",{className:"form-submit",disabled:r,"aria-label":"Submit survey",type:"button",onClick:()=>{s&&(null==zn||zn.open(s)),l?null==o||o():n()},children:t}),!i.whiteLabel&&wc(Rc,{})]})}function Ac(e){var{question:t,forceDisableHtml:r,htmlFor:i}=e;return wc("div",{class:"question-header",children:[wc(t.type===Cl.Open?"label":"h3",{className:"survey-question",htmlFor:i,children:t.question}),t.description&&hc({component:ka("p",{className:"survey-question-description"}),children:t.description,renderAsHtml:!r&&"text"!==t.descriptionContentType})]})}function Nc(e){var{onClick:t}=e,{isPreviewMode:r}=cl(cc);return wc("button",{className:"form-cancel",onClick:t,disabled:r,"aria-label":"Close survey",type:"button",children:Tc})}wc("svg",{width:"16",height:"12",viewBox:"0 0 16 12",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:wc("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 Fc=zn;function Lc(e){var{header:t,description:r,contentType:i,forceDisableHtml:n,appearance:s,onClose:o}=e,{isPopup:a}=cl(cc);return al((()=>{var e=e=>{"Enter"!==e.key&&"Escape"!==e.key||(e.preventDefault(),o())};return Cs(Fc,"keydown",e),()=>{Fc.removeEventListener("keydown",e)}}),[o]),wc("div",{className:"thank-you-message",role:"status",tabIndex:0,"aria-atomic":"true",children:[a&&!0!==s.hideCancelButton&&wc(Nc,{onClick:()=>o()}),wc("h3",{className:"thank-you-message-header",children:t}),r&&hc({component:ka("p",{className:"thank-you-message-body"}),children:r,renderAsHtml:!n&&"text"!==i}),a&&wc(Pc,{text:s.thankYouMessageCloseButtonText||"Close",submitDisabled:!1,appearance:s,onSubmit:()=>o()})]})}var Oc=e=>Yr(e)&&e.every((e=>ti(e)));function Dc(e){var{question:t,forceDisableHtml:r,appearance:i,onSubmit:n,onPreviewSubmit:s,displayQuestionIndex:o,initialValue:a}=e,{isPreviewMode:l}=dc(),u=ll(null),[c,d]=ol((()=>ti(a)?a:""));al((()=>{setTimeout((()=>{var e;l||(null==(e=u.current)||e.focus())}),100)}),[l]);var h="surveyQuestion"+o;return wc(xa,{children:[wc("div",{className:"question-container",children:[wc(Ac,{question:t,forceDisableHtml:r,htmlFor:h}),wc("textarea",{ref:u,id:h,rows:4,placeholder:null==i?void 0:i.placeholder,onInput:e=>{d(e.currentTarget.value),e.stopPropagation()},onKeyDown:e=>{e.stopPropagation()},value:c})]}),wc(Pc,{text:t.buttonText||"Submit",submitDisabled:!c&&!t.optional,appearance:i,onSubmit:()=>n(c),onPreviewSubmit:()=>s(c)})]})}function Hc(e){var{question:t,forceDisableHtml:r,appearance:i,onSubmit:n,onPreviewSubmit:s}=e;return wc(xa,{children:[wc("div",{className:"question-container",children:wc(Ac,{question:t,forceDisableHtml:r})}),wc(Pc,{text:t.buttonText||"Submit",submitDisabled:!1,link:t.link,appearance:i,onSubmit:()=>n("link clicked"),onPreviewSubmit:()=>s("link clicked")})]})}function qc(e){var{question:t,forceDisableHtml:r,displayQuestionIndex:i,appearance:n,onSubmit:s,onPreviewSubmit:o,initialValue:a}=e,l=t.scale,u=10===t.scale?0:1,[c,d]=ol((()=>si(a)?a:Yr(a)&&a.length>0&&si(parseInt(a[0]))?parseInt(a[0]):ti(a)&&si(parseInt(a))?parseInt(a):null)),{isPreviewMode:h}=dc(),p=e=>h?o(e):s(e);return wc(xa,{children:[wc("div",{className:"question-container",children:[wc(Ac,{question:t,forceDisableHtml:r}),wc("div",{className:"rating-section",children:[wc("div",{className:"rating-options",children:["emoji"===t.display&&wc("div",{className:"rating-options-emoji",children:(3===t.scale?$c:Uc).map(((e,r)=>wc("button",{"aria-label":"Rate "+(r+1),className:"ratings-emoji question-"+i+"-rating-"+r+" "+(r+1===c?"rating-active":""),value:r+1,type:"button",onClick:()=>{var e=r+1;d(e),t.skipSubmitButton&&p(e)},children:e},r)))}),"number"===t.display&&wc("div",{className:"rating-options-number",style:{gridTemplateColumns:"repeat("+(l-u+1)+", minmax(0, 1fr))"},children:Zc(t.scale).map(((e,r)=>wc(Bc,{displayQuestionIndex:i,active:c===e,appearance:n,num:e,setActiveNumber:e=>{d(e),t.skipSubmitButton&&p(e)}},r)))})]}),wc("div",{className:"rating-text",children:[wc("div",{children:t.lowerBoundLabel}),wc("div",{children:t.upperBoundLabel})]})]})]}),wc(Pc,{text:t.buttonText||(null==n?void 0:n.submitButtonText)||"Submit",submitDisabled:ii(c)&&!t.optional,appearance:n,onSubmit:()=>s(c),onPreviewSubmit:()=>o(c),skipSubmitButton:t.skipSubmitButton})]})}function Bc(e){var{num:t,active:r,displayQuestionIndex:i,setActiveNumber:n}=e;return wc("button",{"aria-label":"Rate "+t,className:"ratings-number question-"+i+"-rating-"+t+" "+(r?"rating-active":""),type:"button",onClick:()=>{n(t)},children:t})}function Vc(e){var{question:t,forceDisableHtml:i,displayQuestionIndex:n,appearance:s,onSubmit:o,onPreviewSubmit:a,initialValue:l}=e,u=ll(null),c=ul((()=>(e=>{if(!e.shuffleOptions)return e.choices;var t=e.choices,r="";e.hasOpenChoice&&(r=t.pop());var i=ac(t,oc(t));return e.hasOpenChoice&&(e.choices.push(r),i.push(r)),i})(t)),[t]),[d,h]=ol((()=>((e,t)=>ti(e)||Oc(e)?e:t===Cl.SingleChoice?null:[])(l,t.type))),[p,v]=ol((()=>((e,t)=>{if(ti(e)&&!t.includes(e))return{isSelected:!0,inputValue:e};if(Oc(e)){var r=e.find((e=>!t.includes(e)));if(r)return{isSelected:!0,inputValue:r}}return{isSelected:!1,inputValue:""}})(l,c))),{isPreviewMode:g}=dc(),_=t.type===Cl.SingleChoice,f=t.type===Cl.MultipleChoice,m=t.skipSubmitButton&&_&&!t.hasOpenChoice,y=(e,t)=>{if(t){var i=!p.isSelected;return v((e=>r({},e,{isSelected:i,inputValue:i?e.inputValue:""}))),_&&h(""),void(i&&setTimeout((()=>{var e;return null==(e=u.current)?void 0:e.focus()}),75))}if(_)return h(e),v((e=>r({},e,{isSelected:!1,inputValue:""}))),void(m&&(o(e),g&&a(e)));f&&Yr(d)&&(d.includes(e)?h(d.filter((t=>t!==e))):h([...d,e]))},b=e=>{e.stopPropagation();var t=e.currentTarget.value;v((e=>r({},e,{inputValue:t}))),_&&h(t)},S=e=>{e.stopPropagation(),"Enter"!==e.key||w()||(e.preventDefault(),C()),"Escape"===e.key&&(e.preventDefault(),v((e=>r({},e,{isSelected:!1,inputValue:""}))),_&&h(null))},w=()=>!t.optional&&(!!ii(d)||(!(!Yr(d)||p.isSelected||0!==d.length)||!(!p.isSelected||""!==p.inputValue.trim()))),C=()=>{p.isSelected&&f?Yr(d)&&(g?a([...d,p.inputValue]):o([...d,p.inputValue])):g?a(d):o(d)};return wc(xa,{children:[wc("div",{className:"question-container",children:[wc(Ac,{question:t,forceDisableHtml:i}),wc("fieldset",{className:"multiple-choice-options limit-height",children:[wc("legend",{className:"sr-only",children:f?" 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:_?d===e:Yr(d)&&d.includes(e);return wc("label",{className:i?"choice-option-open":"",children:[wc("div",{className:"response-choice",children:[wc("input",{type:_?"radio":"checkbox",name:s,checked:a,onChange:()=>y(e,i),id:s,"aria-controls":o}),wc("span",{children:i?e+":":e})]}),i&&wc("input",{type:"text",ref:u,id:o,name:"question"+n+"Open",value:p.inputValue,onKeyDown:S,onInput:b,onClick:t=>{p.isSelected||y(e,!0),t.stopPropagation()},"aria-label":e+" - please specify"})]},r)}))]})]}),wc(Pc,{text:t.buttonText||"Submit",submitDisabled:w(),appearance:s,onSubmit:C,onPreviewSubmit:C,skipSubmitButton:m})]})}var $c=[kc,Ic,Cc],Uc=[Ec,kc,Ic,Cc,xc],Wc=[1,2,3,4,5],zc=[1,2,3,4,5,6,7],jc=[0,1,2,3,4,5,6,7,8,9,10];function Zc(e){switch(e){case 5:default:return Wc;case 7:return zc;case 10:return jc}}var Gc=zn,Yc=Kn,Xc="ph:show_survey_widget",Kc="PHWidgetSurveyClickListener";function Jc(e,t,r){var i,n=e.questions[t],s=t+1;if(null==(i=n.branching)||!i.type)return t===e.questions.length-1?Il.End:s;if(n.branching.type===Il.End)return Il.End;if(n.branching.type===Il.SpecificQuestion){if(Number.isInteger(n.branching.index))return n.branching.index}else if(n.branching.type===Il.ResponseBased){if(n.type===Cl.SingleChoice){var o,a=n.choices.indexOf(""+r);if(-1===a&&n.hasOpenChoice&&(a=n.choices.length-1),null!=(o=n.branching)&&null!=(o=o.responseValues)&&o.hasOwnProperty(a)){var l=n.branching.responseValues[a];return Number.isInteger(l)?l:l===Il.End?Il.End:s}}else if(n.type===Cl.Rating){var u;if("number"!=typeof r||!Number.isInteger(r))throw new Error("The response type must be an integer");var c=function(e,t){if(3===t){if(e<1||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(e<1||e>5)throw new Error("The response must be in range 1-5");return e<=2?"negative":3===e?"neutral":"positive"}if(7===t){if(e<1||e>7)throw new Error("The response must be in range 1-7");return e<=3?"negative":4===e?"neutral":"positive"}if(10===t){if(e<0||e>10)throw new Error("The response must be in range 0-10");return e<=6?"detractors":e<=8?"passives":"promoters"}throw new Error("The scale must be one of: 3, 5, 7, 10")}(r,n.scale);if(null!=(u=n.branching)&&null!=(u=u.responseValues)&&u.hasOwnProperty(c)){var d=n.branching.responseValues[c];return Number.isInteger(d)?d:d===Il.End?Il.End:s}}return s}return Ml.warn("Falling back to next question index due to unexpected branching type"),s}var Qc=250,ed=20,td=12;class rd{constructor(e){var t=this;this._surveyTimeouts=new Map,this._widgetSelectorListeners=new Map,this._prefillHandledSurveys=new Set,this.handlePageUnload=()=>{var e=this._posthog.get_property(Ks);if(e)for(var t of e)mc(t)&&sc(t,this._posthog)},this.handlePopoverSurvey=e=>{var t;this._clearSurveyTimeout(e.id),this._addSurveyToFocus(e);var i=(null==(t=e.appearance)?void 0:t.surveyPopupDelaySeconds)||0,{shadow:n}=Qu(e,this._posthog);if(i<=0)return za(wc(ad,{posthog:this._posthog,survey:e,removeSurveyFromFocus:this._removeSurveyFromFocus}),n);var s=setTimeout((()=>{if(this._surveyTimeouts.delete(e.id),!vc(e))return this._removeSurveyFromFocus(e);za(wc(ad,{posthog:this._posthog,survey:r({},e,{appearance:r({},e.appearance,{surveyPopupDelaySeconds:0})}),removeSurveyFromFocus:this._removeSurveyFromFocus}),n)}),1e3*i);this._surveyTimeouts.set(e.id,s)},this._handleWidget=e=>{var{shadow:t,isNewlyCreated:r}=Qu(e,this._posthog);r&&za(wc(ud,{posthog:this._posthog,survey:e},e.id),t)},this._removeWidgetSelectorListener=e=>{this._removeSurveyFromDom(e);var t=this._widgetSelectorListeners.get(e.id);t&&(t.element.removeEventListener("click",t.listener),t.element.removeAttribute(Kc),this._widgetSelectorListeners.delete(e.id),Ml.info("Removed click listener for survey "+e.id))},this._manageWidgetSelectorListener=(e,t)=>{var r=Yc.querySelector(t),i=this._widgetSelectorListeners.get(e.id);if(r){if(this._handleWidget(e),i){if(r===i.element)return;Ml.info("Selector element changed for survey "+e.id+". Re-attaching listener."),this._removeWidgetSelectorListener(e)}if(!r.hasAttribute(Kc)){var n=t=>{var r,i;t.stopPropagation();var n=(null==(r=e.appearance)?void 0:r.position)===bl.NextToTrigger?function(e,t){try{var r=e.getBoundingClientRect(),i=Gc.innerHeight,n=Gc.innerWidth,s=Qc,o=r.left+r.width/2-t/2;o+t>n-ed&&(o=n-t-ed),o<ed&&(o=ed);var a=td,l=i-r.bottom,u=r.top,c=l<s&&u>l;return{position:"fixed",top:c?"auto":r.bottom+a+"px",left:o+"px",right:"auto",bottom:c?i-r.top+a+"px":"auto",zIndex:Yu.zIndex}}catch(e){return Ml.warn("Failed to calculate trigger position:",e),null}}(t.currentTarget,parseInt((null==(i=e.appearance)?void 0:i.maxWidth)||Yu.maxWidth)):{};Gc.dispatchEvent(new CustomEvent(Xc,{detail:{surveyId:e.id,position:n}}))};Cs(r,"click",n),r.setAttribute(Kc,"true"),this._widgetSelectorListeners.set(e.id,{element:r,listener:n,survey:e}),Ml.info("Attached click listener for feedback button survey "+e.id)}}else i&&this._removeWidgetSelectorListener(e)},this.renderPopover=e=>{var{shadow:t}=Qu(e,this._posthog);za(wc(ad,{posthog:this._posthog,survey:e,removeSurveyFromFocus:this._removeSurveyFromFocus}),t)},this.renderSurvey=(e,t)=>{var r;null!=(r=this._posthog.config)&&null!=(r=r.surveys)&&r.prefillFromUrl&&this._handleUrlPrefill(e),za(wc(ad,{posthog:this._posthog,survey:e,removeSurveyFromFocus:this._removeSurveyFromFocus,isPopup:!1}),t)},this.getActiveMatchingSurveys=function(e,r){var i;void 0===r&&(r=!1),null==(i=t._posthog)||i.surveys.getSurveys((r=>{var i=r.filter((e=>t.checkSurveyEligibility(e).eligible&&t._isSurveyConditionMatched(e)&&t._hasActionOrEventTriggeredSurvey(e)&&t._checkFlags(e)));e(i)}),r)},this.callSurveysAndEvaluateDisplayLogic=function(e){void 0===e&&(e=!1),t.getActiveMatchingSurveys((e=>{var r=e.filter((e=>e.type===wl.Popover||e.type===wl.Widget)),i=t._sortSurveysByAppearanceDelay(r),n=new Set;i.forEach((e=>{if(e.type===wl.Widget){var r,i,s,o;if((null==(r=e.appearance)?void 0:r.widgetType)===yl.Tab)return void t._handleWidget(e);if((null==(i=e.appearance)?void 0:i.widgetType)===yl.Selector&&null!=(s=e.appearance)&&s.widgetSelector)n.add(e.id),t._manageWidgetSelectorListener(e,null==(o=e.appearance)?void 0:o.widgetSelector)}ii(t._surveyInFocus)&&e.type===wl.Popover&&t.handlePopoverSurvey(e)})),t._widgetSelectorListeners.forEach((e=>{var{survey:r}=e;n.has(r.id)||t._removeWidgetSelectorListener(r)}))}),e)},this._addSurveyToFocus=e=>{ii(this._surveyInFocus)||Ml.error("Survey "+this._surveyInFocus+" already in focus. Cannot add survey "+e.id+"."),this._surveyInFocus=e.id},this._removeSurveyFromFocus=e=>{this._surveyInFocus!==e.id&&Ml.error("Survey "+e.id+" is not in focus. Cannot remove survey "+e.id+"."),this._clearSurveyTimeout(e.id),this._surveyInFocus=null,this._removeSurveyFromDom(e)},this._posthog=e,this._surveyInFocus=null}_clearSurveyTimeout(e){var t=this._surveyTimeouts.get(e);t&&(clearTimeout(t),this._surveyTimeouts.delete(e))}cancelSurvey(e){this._surveyTimeouts.has(e)&&(Ml.info("Cancelled pending survey "+e),this._clearSurveyTimeout(e),this._surveyInFocus===e&&(this._surveyInFocus=null))}_sortSurveysByAppearanceDelay(e){return e.sort(((e,t)=>{var r,i,n=mc(e),s=mc(t);if(n&&!s)return-1;if(!n&&s)return 1;var o=e.schedule===kl.Always,a=t.schedule===kl.Always;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)}))}_handleUrlPrefill(e){if(!this._prefillHandledSurveys.has(e.id))try{var{params:t}=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&&!ei(a)){var l=decodeURIComponent(o),u=decodeURIComponent(a);if("auto_submit"!==l||"true"!==u){var c=l.match(/^q(\d+)$/);if(c){var d=parseInt(c[1],10);t[d]||(t[d]=[]),t[d].push(u)}}else r=!0}}return{params:t,autoSubmit:r}}(Gc.location.search);if(0===Object.keys(t).length)return;Ml.info("[Survey Prefill] Detected URL prefill parameters");var r=function(e,t){var r={};return e.questions.forEach(((e,i)=>{if(t[i]&&e.id){var n=t[i],s=Zu(e.id);try{switch(e.type){case Cl.SingleChoice:if(!e.choices||0===e.choices.length)return void ls.warn("[Survey Prefill] Question "+i+" has no choices");var o=parseInt(n[0],10);if(isNaN(o)||o<0||o>=e.choices.length)return void ls.warn("[Survey Prefill] Invalid choice index for q"+i+": "+n[0]);r[s]=e.choices[o];break;case Cl.MultipleChoice:if(!e.choices||0===e.choices.length)return void ls.warn("[Survey Prefill] Question "+i+" has no choices");var a=n.map((e=>parseInt(e,10))).filter((t=>!isNaN(t)&&t>=0&&t<e.choices.length));if(0===a.length)return void ls.warn("[Survey Prefill] No valid choices for q"+i);var l=[...new Set(a.map((t=>e.choices[t])))];l.length<a.length&&ls.warn("[Survey Prefill] Removed duplicate choices for q"+i),r[s]=l;break;case Cl.Rating:var u=parseInt(n[0],10),c=e.scale||10;if(isNaN(u)||u<0||u>c)return void ls.warn("[Survey Prefill] Invalid rating for q"+i+": "+n[0]+" (scale: 0-"+c+")");r[s]=u;break;default:ls.info("[Survey Prefill] Question type "+e.type+" does not support prefill")}}catch(e){ls.error("[Survey Prefill] Error converting q"+i+":",e)}}})),r}(e,t);if(0===Object.keys(r).length)return void Ml.warn("[Survey Prefill] No valid responses after conversion");var i=Zl(),n=Object.keys(t).map((e=>parseInt(e,10))),{startQuestionIndex:s,skippedResponses:o}=function(e,t,r){for(var i=0,n={},s=0;s<e.length&&t.includes(s);s++){var o=e[s];if(!(o&&"skipSubmitButton"in o&&o.skipSubmitButton))break;if(i=s+1,o.id){var a=Zu(o.id);ei(r[a])||(n[a]=r[a])}}return{startQuestionIndex:i,skippedResponses:n}}(e.questions,n,r),a=s>=e.questions.length;_c(e,{surveySubmissionId:i,responses:r,lastQuestionIndex:a?e.questions.length-1:s}),Ml.info("[Survey Prefill] Stored prefilled responses in localStorage"),(Object.keys(o).length>0&&e.enable_partial_responses||a)&&tc({responses:a?r:o,survey:e,surveySubmissionId:i,posthog:this._posthog,isSurveyCompleted:a}),this._prefillHandledSurveys.add(e.id)}catch(e){Ml.error("[Survey Prefill] Error handling URL prefill:",e)}}_isSurveyFeatureFlagEnabled(e,t){if(void 0===t&&(t=void 0),!e)return!0;var r=!!this._posthog.featureFlags.isFeatureEnabled(e,{send_event:!e.startsWith("survey-targeting-")}),i=!0;t&&(i=this._posthog.featureFlags.getFeatureFlag(e,{send_event:!1})===t||"any"===t);return r&&i}_isSurveyConditionMatched(e){return!e.conditions||vc(e)&&function(e){var t,r,i;if(null==(t=e.conditions)||!t.deviceTypes||0===(null==(r=e.conditions)?void 0:r.deviceTypes.length))return!0;if(!rs)return!1;var n=fn(rs);return Vu[pc(null==(i=e.conditions)?void 0:i.deviceTypesMatchType)](e.conditions.deviceTypes,[n])}(e)&&function(e){var t;return null==(t=e.conditions)||!t.selector||!(null==ju||!ju.querySelector(e.conditions.selector))}(e)}_internalFlagCheckSatisfied(e){return uc(e)||this._isSurveyFeatureFlagEnabled(e.internal_targeting_flag_key)||mc(e)}checkSurveyEligibility(e){var t,r,i={eligible:!0,reason:void 0};if(!Rl(e))return i.eligible=!1,i.reason="Survey is not running. It was completed on "+e.end_date,i;if(!ql.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._isSurveyFeatureFlagEnabled(e.linked_flag_key,n)?this._isSurveyFeatureFlagEnabled(e.targeting_flag_key)?this._internalFlagCheckSatisfied(e)?(e=>{var t=localStorage.getItem("lastSeenSurveyDate");if(!e||!t)return!0;var r=new Date,i=Math.abs(r.getTime()-new Date(t).getTime());return Math.ceil(i/864e5)>e})(null==(r=e.conditions)?void 0:r.seenSurveyWaitPeriodInDays)?(e=>!!localStorage.getItem(Dl(e))&&!uc(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)}_hasActionOrEventTriggeredSurvey(e){var t;if(!Pl(e)&&!Al(e))return!0;var r=null==(t=this._posthog.surveys._surveyEventReceiver)?void 0:t.getSurveys();return!(null==r||!r.includes(e.id))}_checkFlags(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._isSurveyFeatureFlagEnabled(r)}))}_removeSurveyFromDom(e){try{var t=Yc.querySelector(bc(e,!0));null!=t&&t.shadowRoot&&za(null,t.shadowRoot),null==t||t.remove()}catch(t){Ml.warn("Failed to remove survey "+e.id+" from DOM:",t)}}getTestAPI(){return{addSurveyToFocus:this._addSurveyToFocus,removeSurveyFromFocus:this._removeSurveyFromFocus,surveyInFocus:this._surveyInFocus,surveyTimeouts:this._surveyTimeouts,handleWidget:this._handleWidget,handlePopoverSurvey:this.handlePopoverSurvey,manageWidgetSelectorListener:this._manageWidgetSelectorListener,sortSurveysByAppearanceDelay:this._sortSurveysByAppearanceDelay,checkFlags:this._checkFlags.bind(this),isSurveyFeatureFlagEnabled:this._isSurveyFeatureFlagEnabled.bind(this)}}}function id(e,t){if(Yc&&Gc){var r,i=new rd(e);if(e.config.disable_surveys_automatic_display)return Ml.info("Surveys automatic display is disabled. Skipping call surveys and evaluate display logic."),i;if(!1===t)return Ml.info("There are no surveys to load or Surveys is disabled in the project settings."),i;i.callSurveysAndEvaluateDisplayLogic(!0);var n=()=>{ei(r)&&(r=setInterval((()=>{i.callSurveysAndEvaluateDisplayLogic(!1)}),1e3))};return n(),Cs(Yc,"visibilitychange",(()=>{Yc.hidden?ei(r)||(clearInterval(r),r=void 0):(i.callSurveysAndEvaluateDisplayLogic(!1),n())})),i}}function nd(e){var{survey:t,removeSurveyFromFocus:r=(()=>{}),setSurveyVisible:i,isPreviewMode:n=!1}=e;al((()=>{var e;if(!n&&null!=(e=t.conditions)&&e.url){var s=()=>{var e,n=t.type===wl.Widget,s=vc(t),o=(null==(e=t.appearance)?void 0:e.widgetType)===yl.Tab&&n;if(!s)return Ml.info("Hiding survey "+t.id+" because URL does not match"),i(!1),r(t);o&&(Ml.info("Showing survey "+t.id+" because it is a feedback button tab and URL matches"),i(!0))};Cs(Gc,"popstate",s),Cs(Gc,"hashchange",s);var o=Gc.history.pushState,a=Gc.history.replaceState;return Gc.history.pushState=function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];o.apply(this,t),s()},Gc.history.replaceState=function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];a.apply(this,t),s()},()=>{Gc.removeEventListener("popstate",s),Gc.removeEventListener("hashchange",s),Gc.history.pushState=o,Gc.history.replaceState=a}}}),[n,t,r,i])}function sd(e,t,r){if(void 0===t&&(t=bl.Right),e===wl.ExternalSurvey)return{};switch(t){case bl.TopLeft:return{top:"0",left:"0",transform:"translate(30px, 30px)"};case bl.TopRight:return{top:"0",right:"0",transform:"translate(-30px, 30px)"};case bl.TopCenter:return{top:"0",left:"50%",transform:"translate(-50%, 30px)"};case bl.MiddleLeft:return{top:"50%",left:"0",transform:"translate(30px, -50%)"};case bl.MiddleRight:return{top:"50%",right:"0",transform:"translate(-30px, -50%)"};case bl.MiddleCenter:return{top:"50%",left:"50%",transform:"translate(-50%, -50%)"};case bl.Left:return{left:"30px"};case bl.Center:return{left:"50%",transform:"translateX(-50%)"};default:case bl.Right:return{right:e===wl.Widget&&r===yl.Tab?"60px":"30px"}}}function od(e){switch(void 0===e&&(e=Sl.Right),e){case Sl.Top:return{top:"0",left:"50%",transform:"translateX(-50%)"};case Sl.Left:return{top:"50%",left:"0",transform:"rotate(90deg) translateY(-100%)",transformOrigin:"left top"};case Sl.Bottom:return{bottom:"0",left:"50%",transform:"translateX(-50%)"};default:case Sl.Right:return{top:"50%",right:"0",transform:"rotate(-90deg) translateY(-100%)",transformOrigin:"right top"}}}function ad(e){var t,i,n,s,o,a,{survey:l,forceDisableHtml:u,posthog:c,style:d={},previewPageIndex:h,removeSurveyFromFocus:p=(()=>{}),isPopup:v=!0,onPreviewSubmit:g=(()=>{}),onPopupSurveyDismissed:_=(()=>{}),onCloseConfirmationMessage:f=(()=>{})}=e,m=ll(null),y=Number.isInteger(h),b=null!=(t=l.appearance)&&t.surveyPopupDelaySeconds?1e3*l.appearance.surveyPopupDelaySeconds:0,{isPopupVisible:S,isSurveySent:w,hidePopupWithViewTransition:C}=function(e,t,r,i,n,s,o){var[a,l]=ol(i||0===r||e.type===wl.ExternalSurvey),[u,c]=ol(!1),d=()=>{var t=()=>{s&&n(e),l(!1)};Yc.startViewTransition?Yc.startViewTransition((()=>{var e;null==o||null==(e=o.current)||e.remove()})).finished.then((()=>{setTimeout((()=>{t()}),100)})):t()},h=t=>{t.detail.surveyId===e.id&&d()};return al((()=>{if(t){if(!i){var n=t=>{var r,i;if(t.detail.surveyId===e.id){if(null==(r=e.appearance)||!r.displayThankYouMessage)return d();c(!0),null!=(i=e.appearance)&&i.autoDisappear&&setTimeout((()=>{d()}),5e3)}},s=()=>{vc(e)&&(l(!0),Gc.dispatchEvent(new Event("PHSurveyShown")),t.capture(El.SHOWN,{[xl.SURVEY_NAME]:e.name,[xl.SURVEY_ID]:e.id,[xl.SURVEY_ITERATION]:e.current_iteration,[xl.SURVEY_ITERATION_START_DATE]:e.current_iteration_start_date,sessionRecordingUrl:null==t.get_session_replay_url?void 0:t.get_session_replay_url()}),localStorage.setItem("lastSeenSurveyDate",(new Date).toISOString()))};if(Cs(Gc,"PHSurveyClosed",h),Cs(Gc,"PHSurveySent",n),r>0){var o=setTimeout(s,r);return()=>{clearTimeout(o),Gc.removeEventListener("PHSurveyClosed",h),Gc.removeEventListener("PHSurveySent",n)}}return s(),()=>{Gc.removeEventListener("PHSurveyClosed",h),Gc.removeEventListener("PHSurveySent",n)}}}else Ml.error("usePopupVisibility hook called without a PostHog instance.")}),[]),nd({survey:e,removeSurveyFromFocus:n,setSurveyVisible:l,isPreviewMode:i}),{isPopupVisible:a,isSurveySent:u,setIsPopupVisible:l,hidePopupWithViewTransition:d}}(l,c,b,y,p,v,m),I=w||h===l.questions.length,k=ul((()=>{var e=fc(l);return{isPreviewMode:y,previewPageIndex:h,onPopupSurveyDismissed:()=>{nc(l,c,y),_()},isPopup:v||!1,surveySubmissionId:(null==e?void 0:e.surveySubmissionId)||Zl(),onPreviewSubmit:g,posthog:c}}),[y,h,v,c,l,_,g]);return S?wc(cc.Provider,{value:k,children:wc("div",{className:"ph-survey",style:r({},sd(l.type,null==(i=l.appearance)?void 0:i.position,null==(n=l.appearance)?void 0:n.widgetType),d),ref:m,children:I?wc(Lc,{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||Yu,onClose:()=>{C(),f()}}):wc(ld,{survey:l,forceDisableHtml:!!u,posthog:c})})}):null}function ld(e){var t,{survey:i,forceDisableHtml:n,posthog:s}=e,[o,a]=ol((()=>{var e=fc(i);return null!=e&&e.responses&&Ml.info("Survey is already in progress, filling in initial responses"),(null==e?void 0:e.responses)||{}})),{previewPageIndex:l,onPopupSurveyDismissed:u,isPopup:c,onPreviewSubmit:d,surveySubmissionId:h,isPreviewMode:p}=cl(cc),[v,g]=ol((()=>{var e=fc(i);return l||(null==e?void 0:e.lastQuestionIndex)||0})),_=ul((()=>lc(i)),[i]);al((()=>{p&&!ei(l)&&g(l)}),[l,p]);var f=_.at(v);return f?wc("form",{className:"survey-form",name:"surveyForm",children:[c&&!0!==(null==(t=i.appearance)?void 0:t.hideCancelButton)&&wc(Nc,{onClick:()=>{u()}}),wc("div",{className:"survey-box",children:cd({question:f,forceDisableHtml:n,displayQuestionIndex:v,appearance:i.appearance||Yu,onSubmit:e=>(e=>{var{res:t,displayQuestionIndex:n,questionId:l}=e;if(s)if(l){var u=Zu(l),c=r({},o,{[u]:t});a(c);var d=Jc(i,n,t),p=d===Il.End;p||(g(d),_c(i,{surveySubmissionId:h,responses:c,lastQuestionIndex:d})),(i.enable_partial_responses||p)&&tc({responses:c,survey:i,surveySubmissionId:h,isSurveyCompleted:p,posthog:s})}else Ml.error("onNextButtonClick called without a questionId.");else Ml.error("onNextButtonClick called without a PostHog instance.")})({res:e,displayQuestionIndex:v,questionId:f.id}),onPreviewSubmit:d,initialValue:f.id?o[Zu(f.id)]:void 0})})]}):null}function ud(e){var t,r,i,n,s,o,a,{survey:l,forceDisableHtml:u,posthog:c,readOnly:d}=e,[h,p]=ol(!0),[v,g]=ol(!1),[_,f]=ol({}),m=()=>{g(!v)};if(al((()=>{var e;if(c){if(!d){"tab"===(null==(e=l.appearance)?void 0:e.widgetType)&&f({top:"50%",bottom:"auto"});var t=e=>{var t,r=e;(null==(t=r.detail)?void 0:t.surveyId)===l.id&&(Ml.info("Received show event for feedback button survey "+l.id),f(r.detail.position||{}),m())};return Cs(Gc,Xc,t),()=>{Gc.removeEventListener(Xc,t)}}}else Ml.error("FeedbackWidget called without a PostHog instance.")}),[c,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]),nd({survey:l,setSurveyVisible:p}),!h)return null;var y=()=>{l.schedule!==kl.Always&&p(!1),setTimeout((()=>{g(!1)}),200)};return wc(xa,{children:["tab"===(null==(n=l.appearance)?void 0:n.widgetType)&&wc("button",{className:"ph-survey-widget-tab "+((null==(s=l.appearance)?void 0:s.tabPosition)===Sl.Top?"widget-tab-top":""),onClick:m,disabled:d,style:od(null==(o=l.appearance)?void 0:o.tabPosition),children:(null==(a=l.appearance)?void 0:a.widgetLabel)||""}),v&&wc(ad,{posthog:c,survey:l,forceDisableHtml:u,style:_,onPopupSurveyDismissed:y,onCloseConfirmationMessage:y})]})}var cd=e=>{var{question:t,forceDisableHtml:i,displayQuestionIndex:n,appearance:s,onSubmit:o,onPreviewSubmit:a,initialValue:l}=e,u={forceDisableHtml:i,appearance:s,onPreviewSubmit:e=>{a(e)},onSubmit:e=>{o(e)},initialValue:l,displayQuestionIndex:n};switch(t.type){case Cl.Open:return ka(Dc,r({},u,{question:t,key:t.id}));case Cl.Link:return ka(Hc,r({},u,{question:t,key:t.id}));case Cl.Rating:return ka(qc,r({},u,{question:t,key:t.id}));case Cl.SingleChoice:case Cl.MultipleChoice:return ka(Vc,r({},u,{question:t,key:t.id}));default:return Ml.error("Unsupported question type: "+t.type),null}};is.__PosthogExtensions__=is.__PosthogExtensions__||{},is.__PosthogExtensions__.generateSurveys=id,is.extendPostHogWithSurveys=id;var dd=us("[Error tracking]");function hd(){return new bn([new Fn,new Wn,new On,new Ln,new $n,new Vn,new Hn,new Un],Nn("web:javascript",xn,Rn))}class pd{constructor(e){var t,r;this._suppressionRules=[],this._errorPropertiesBuilder=hd(),this._instance=e,this._suppressionRules=null!==(t=null==(r=this._instance.persistence)?void 0:r.get_property(Ds))&&void 0!==t?t:[]}onRemoteConfig(e){var t,r,i,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._suppressionRules=n,this._instance.persistence&&this._instance.persistence.register({[Ds]:this._suppressionRules,[Hs]:s})}get _captureExtensionExceptions(){var e,t=!!this._instance.get_property(Hs),r=this._instance.config.error_tracking.captureExtensionExceptions;return null!==(e=null!=r?r:t)&&void 0!==e&&e}buildProperties(e,t){return this._errorPropertiesBuilder.buildFromUnknown(e,{syntheticException:null==t?void 0:t.syntheticException,mechanism:{handled:null==t?void 0:t.handled}})}sendExceptionEvent(e){var t=e.$exception_list;if(this._isExceptionList(t)){if(this._matchesSuppressionRule(t))return void dd.info("Skipping exception capture because a suppression rule matched");if(!this._captureExtensionExceptions&&this._isExtensionException(t))return void dd.info("Skipping exception capture because it was thrown by an extension");if(!this._instance.config.error_tracking.__capturePostHogExceptions&&this._isPostHogException(t))return void dd.info("Skipping exception capture because it was thrown by the PostHog SDK")}return this._instance.capture("$exception",e,{_noTruncate:!0,_batchKey:"exceptionEvent"})}_matchesSuppressionRule(e){if(0===e.length)return!1;var t=e.reduce(((e,t)=>{var{type:r,value:i}=t;return ti(r)&&r.length>0&&e.$exception_types.push(r),ti(i)&&i.length>0&&e.$exception_values.push(i),e}),{$exception_types:[],$exception_values:[]});return this._suppressionRules.some((e=>{var r=e.values.map((e=>{var r,i=Vu[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)}))}_isExtensionException(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://")))}_isPostHogException(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}_isExceptionList(e){return!ni(e)&&Yr(e)}}var vd=us("[ExceptionAutocapture]"),gd=hd(),_d={wrapOnError:e=>{var t=zn;t||vd.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;s<i;s++)n[s]=arguments[s];var o=n[4],a=n[0],l=gd.buildFromUnknown(o||a,{mechanism:{handled:!1}});return e(l),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=zn;t||vd.info("window not available, cannot wrap onUnhandledRejection");var r=t.onunhandledrejection;return t.onunhandledrejection=function(i){var n,s=gd.buildFromUnknown(i,{mechanism:{handled:!1}});return e(s),null!==(n=null==r?void 0:r.apply(t,[i]))&&void 0!==n&&n},t.onunhandledrejection.__POSTHOG_INSTRUMENTED__=!0,()=>{var e;null==(e=t.onunhandledrejection)||delete e.__POSTHOG_INSTRUMENTED__,t.onunhandledrejection=r}},wrapConsoleError:e=>{var t=console;t||vd.info("console not available, cannot wrap console.error");var r=t.error;return t.error=function(){for(var t=arguments.length,i=new Array(t),n=0;n<t;n++)i[n]=arguments[n];var s=i.join(" "),o=i.find((e=>e instanceof Error)),a=gd.buildFromUnknown(o||s,{mechanism:{handled:!1},syntheticException:new Error("PostHog syntheticException")});return e(a),null==r?void 0:r(...i)},t.error.__POSTHOG_INSTRUMENTED__=!0,()=>{var e;null==(e=t.error)||delete e.__POSTHOG_INSTRUMENTED__,t.error=r}}};is.__PosthogExtensions__=is.__PosthogExtensions__||{},is.__PosthogExtensions__.errorWrappingFunctions=_d,is.posthogErrorWrappingFunctions=_d;var fd=(e,t,r,i)=>{var n;try{n=new URL(i.url).hostname}catch(e){return}if(!Yr(e)||e.includes(n)){if(r){var{sessionId:s,windowId:o}=r.checkAndGetSessionAndWindowId(!0);i.headers.set("X-POSTHOG-SESSION-ID",s),i.headers.set("X-POSTHOG-WINDOW-ID",o)}t!==ao&&i.headers.set("X-POSTHOG-DISTINCT-ID",t)}};is.__PosthogExtensions__=is.__PosthogExtensions__||{};var md={_patchFetch:(e,r,i)=>Ms(zn,"fetch",(n=>function(){var s=t((function*(t,s){var o=new Request(t,s);return fd(e,r,i,o),n(o)}));return function(e,t){return s.apply(this,arguments)}}())),_patchXHR:(e,t,r)=>Ms(zn.XMLHttpRequest.prototype,"open",(i=>function(n,s,o,a,l){void 0===o&&(o=!0);var u=new Request(s);return fd(e,t,r,u),i.call(this,n,u.url,o,a,l)}))};is.__PosthogExtensions__.tracingHeadersPatchFns=md,is.postHogTracingHeadersPatchFns=md;var yd,bd,Sd=function(){var e=self.performance&&performance.getEntriesByType&&performance.getEntriesByType("navigation")[0];if(e&&e.responseStart>0&&e.responseStart<performance.now())return e},wd=function(e){if("loading"===document.readyState)return"loading";var t=Sd();if(t){if(e<t.domInteractive)return"loading";if(0===t.domContentLoadedEventStart||e<t.domContentLoadedEventStart)return"dom-interactive";if(0===t.domComplete||e<t.domComplete)return"dom-content-loaded"}return"complete"},Cd=function(e){var t=e.nodeName;return 1===e.nodeType?t.toLowerCase():t.toUpperCase().replace(/^#/,"")},Id=function(e,t){var r="";try{for(;e&&9!==e.nodeType;){var i=e,n=i.id?"#"+i.id:Cd(i)+(i.classList&&i.classList.value&&i.classList.value.trim()&&i.classList.value.trim().length?"."+i.classList.value.trim().replace(/\s+/g,"."):"");if(r.length+n.length>(t||100)-1)return r||n;if(r=r?n+">"+r:n,i.id)break;e=i.parentNode}}catch(e){}return r},kd=-1,Ed=function(){return kd},xd=function(e){addEventListener("pageshow",(function(t){t.persisted&&(kd=t.timeStamp,e(t))}),!0)},Td=function(){var e=Sd();return e&&e.activationStart||0},Md=function(e,t){var r=Sd(),i="navigate";return Ed()>=0?i="back-forward-cache":r&&(document.prerendering||Td()>0?i="prerender":document.wasDiscarded?i="restore":r.type&&(i=r.type.replace(/_/g,"-"))),{name:e,value:void 0===t?-1:t,rating:"good",delta:0,entries:[],id:"v4-".concat(Date.now(),"-").concat(Math.floor(8999999999999*Math.random())+1e12),navigationType:i}},Rd=function(e,t,r){try{if(PerformanceObserver.supportedEntryTypes.includes(e)){var i=new PerformanceObserver((function(e){Promise.resolve().then((function(){t(e.getEntries())}))}));return i.observe(Object.assign({type:e,buffered:!0},r||{})),i}}catch(e){}},Pd=function(e,t,r,i){var n,s;return function(o){t.value>=0&&(o||i)&&((s=t.value-(n||0))||void 0===n)&&(n=t.value,t.delta=s,t.rating=function(e,t){return e>t[1]?"poor":e>t[0]?"needs-improvement":"good"}(t.value,r),e(t))}},Ad=function(e){requestAnimationFrame((function(){return requestAnimationFrame((function(){return e()}))}))},Nd=function(e){document.addEventListener("visibilitychange",(function(){"hidden"===document.visibilityState&&e()}))},Fd=function(e){var t=!1;return function(){t||(e(),t=!0)}},Ld=-1,Od=function(){return"hidden"!==document.visibilityState||document.prerendering?1/0:0},Dd=function(e){"hidden"===document.visibilityState&&Ld>-1&&(Ld="visibilitychange"===e.type?e.timeStamp:0,qd())},Hd=function(){addEventListener("visibilitychange",Dd,!0),addEventListener("prerenderingchange",Dd,!0)},qd=function(){removeEventListener("visibilitychange",Dd,!0),removeEventListener("prerenderingchange",Dd,!0)},Bd=function(){return Ld<0&&(Ld=Od(),Hd(),xd((function(){setTimeout((function(){Ld=Od(),Hd()}),0)}))),{get firstHiddenTime(){return Ld}}},Vd=function(e){document.prerendering?addEventListener("prerenderingchange",(function(){return e()}),!0):e()},$d=[1800,3e3],Ud=function(e,t){t=t||{},Vd((function(){var r,i=Bd(),n=Md("FCP"),s=Rd("paint",(function(e){e.forEach((function(e){"first-contentful-paint"===e.name&&(s.disconnect(),e.startTime<i.firstHiddenTime&&(n.value=Math.max(e.startTime-Td(),0),n.entries.push(e),r(!0)))}))}));s&&(r=Pd(e,n,$d,t.reportAllChanges),xd((function(i){n=Md("FCP"),r=Pd(e,n,$d,t.reportAllChanges),Ad((function(){n.value=performance.now()-i.timeStamp,r(!0)}))})))}))},Wd=[.1,.25],zd=0,jd=1/0,Zd=0,Gd=function(e){e.forEach((function(e){e.interactionId&&(jd=Math.min(jd,e.interactionId),Zd=Math.max(Zd,e.interactionId),zd=Zd?(Zd-jd)/7+1:0)}))},Yd=function(){return yd?zd:performance.interactionCount||0},Xd=function(){"interactionCount"in performance||yd||(yd=Rd("event",Gd,{type:"event",buffered:!0,durationThreshold:0}))},Kd=[],Jd=new Map,Qd=0,eh=[],th=function(e){if(eh.forEach((function(t){return t(e)})),e.interactionId||"first-input"===e.entryType){var t=Kd[Kd.length-1],r=Jd.get(e.interactionId);if(r||Kd.length<10||e.duration>t.latency){if(r)e.duration>r.latency?(r.entries=[e],r.latency=e.duration):e.duration===r.latency&&e.startTime===r.entries[0].startTime&&r.entries.push(e);else{var i={id:e.interactionId,latency:e.duration,entries:[e]};Jd.set(i.id,i),Kd.push(i)}Kd.sort((function(e,t){return t.latency-e.latency})),Kd.length>10&&Kd.splice(10).forEach((function(e){return Jd.delete(e.id)}))}}},rh=function(e){var t=self.requestIdleCallback||self.setTimeout,r=-1;return e=Fd(e),"hidden"===document.visibilityState?e():(r=t(e),Nd(e)),r},ih=[200,500],nh=function(e,t){"PerformanceEventTiming"in self&&"interactionId"in PerformanceEventTiming.prototype&&(t=t||{},Vd((function(){var r;Xd();var i,n=Md("INP"),s=function(e){rh((function(){e.forEach(th);var t=function(){var e=Math.min(Kd.length-1,Math.floor((Yd()-Qd)/50));return Kd[e]}();t&&t.latency!==n.value&&(n.value=t.latency,n.entries=t.entries,i())}))},o=Rd("event",s,{durationThreshold:null!==(r=t.durationThreshold)&&void 0!==r?r:40});i=Pd(e,n,ih,t.reportAllChanges),o&&(o.observe({type:"first-input",buffered:!0}),Nd((function(){s(o.takeRecords()),i(!0)})),xd((function(){Qd=Yd(),Kd.length=0,Jd.clear(),n=Md("INP"),i=Pd(e,n,ih,t.reportAllChanges)})))})))},sh=[],oh=[],ah=0,lh=new WeakMap,uh=new Map,ch=-1,dh=function(e){sh=sh.concat(e),hh()},hh=function(){ch<0&&(ch=rh(ph))},ph=function(){uh.size>10&&uh.forEach((function(e,t){Jd.has(t)||uh.delete(t)}));var e=Kd.map((function(e){return lh.get(e.entries[0])})),t=oh.length-50;oh=oh.filter((function(r,i){return i>=t||e.includes(r)}));for(var r=new Set,i=0;i<oh.length;i++){var n=oh[i];vh(n.startTime,n.processingEnd).forEach((function(e){r.add(e)}))}var s=sh.length-1-50;sh=sh.filter((function(e,t){return e.startTime>ah&&t>s||r.has(e)})),ch=-1};eh.push((function(e){e.interactionId&&e.target&&!uh.has(e.interactionId)&&uh.set(e.interactionId,e.target)}),(function(e){var t,r=e.startTime+e.duration;ah=Math.max(ah,e.processingEnd);for(var i=oh.length-1;i>=0;i--){var n=oh[i];if(Math.abs(r-n.renderTime)<=8){(t=n).startTime=Math.min(e.startTime,t.startTime),t.processingStart=Math.min(e.processingStart,t.processingStart),t.processingEnd=Math.max(e.processingEnd,t.processingEnd),t.entries.push(e);break}}t||(t={startTime:e.startTime,processingStart:e.processingStart,processingEnd:e.processingEnd,renderTime:r,entries:[e]},oh.push(t)),(e.interactionId||"first-input"===e.entryType)&&lh.set(e,t),hh()}));var vh=function(e,t){for(var r,i=[],n=0;r=sh[n];n++)if(!(r.startTime+r.duration<e)){if(r.startTime>t)break;i.push(r)}return i},gh=[2500,4e3],_h={},fh={onLCP:function(e,t){!function(e,t){t=t||{},Vd((function(){var r,i=Bd(),n=Md("LCP"),s=function(e){t.reportAllChanges||(e=e.slice(-1)),e.forEach((function(e){e.startTime<i.firstHiddenTime&&(n.value=Math.max(e.startTime-Td(),0),n.entries=[e],r())}))},o=Rd("largest-contentful-paint",s);if(o){r=Pd(e,n,gh,t.reportAllChanges);var a=Fd((function(){_h[n.id]||(s(o.takeRecords()),o.disconnect(),_h[n.id]=!0,r(!0))}));["keydown","click"].forEach((function(e){addEventListener(e,(function(){return rh(a)}),{once:!0,capture:!0})})),Nd(a),xd((function(i){n=Md("LCP"),r=Pd(e,n,gh,t.reportAllChanges),Ad((function(){n.value=performance.now()-i.timeStamp,_h[n.id]=!0,r(!0)}))}))}}))}((function(t){var r=function(e){var t={timeToFirstByte:0,resourceLoadDelay:0,resourceLoadDuration:0,elementRenderDelay:e.value};if(e.entries.length){var r=Sd();if(r){var i=r.activationStart||0,n=e.entries[e.entries.length-1],s=n.url&&performance.getEntriesByType("resource").filter((function(e){return e.name===n.url}))[0],o=Math.max(0,r.responseStart-i),a=Math.max(o,s?(s.requestStart||s.startTime)-i:0),l=Math.max(a,s?s.responseEnd-i:0),u=Math.max(l,n.startTime-i);t={element:Id(n.element),timeToFirstByte:o,resourceLoadDelay:a-o,resourceLoadDuration:l-a,elementRenderDelay:u-l,navigationEntry:r,lcpEntry:n},n.url&&(t.url=n.url),s&&(t.lcpResourceEntry=s)}}return Object.assign(e,{attribution:t})}(t);e(r)}),t)},onCLS:function(e,t){!function(e,t){t=t||{},Ud(Fd((function(){var r,i=Md("CLS",0),n=0,s=[],o=function(e){e.forEach((function(e){if(!e.hadRecentInput){var t=s[0],r=s[s.length-1];n&&e.startTime-r.startTime<1e3&&e.startTime-t.startTime<5e3?(n+=e.value,s.push(e)):(n=e.value,s=[e])}})),n>i.value&&(i.value=n,i.entries=s,r())},a=Rd("layout-shift",o);a&&(r=Pd(e,i,Wd,t.reportAllChanges),Nd((function(){o(a.takeRecords()),r(!0)})),xd((function(){n=0,i=Md("CLS",0),r=Pd(e,i,Wd,t.reportAllChanges),Ad((function(){return r()}))})),setTimeout(r,0))})))}((function(t){var r=function(e){var t,r={};if(e.entries.length){var i=e.entries.reduce((function(e,t){return e&&e.value>t.value?e:t}));if(i&&i.sources&&i.sources.length){var n=(t=i.sources).find((function(e){return e.node&&1===e.node.nodeType}))||t[0];n&&(r={largestShiftTarget:Id(n.node),largestShiftTime:i.startTime,largestShiftValue:i.value,largestShiftSource:n,largestShiftEntry:i,loadState:wd(i.startTime)})}}return Object.assign(e,{attribution:r})}(t);e(r)}),t)},onFCP:function(e,t){Ud((function(t){var r=function(e){var t={timeToFirstByte:0,firstByteToFCP:e.value,loadState:wd(Ed())};if(e.entries.length){var r=Sd(),i=e.entries[e.entries.length-1];if(r){var n=r.activationStart||0,s=Math.max(0,r.responseStart-n);t={timeToFirstByte:s,firstByteToFCP:e.value-s,loadState:wd(e.entries[0].startTime),navigationEntry:r,fcpEntry:i}}}return Object.assign(e,{attribution:t})}(t);e(r)}),t)},onINP:function(e,t){bd||(bd=Rd("long-animation-frame",dh)),nh((function(t){var r=function(e){var t=e.entries[0],r=lh.get(t),i=t.processingStart,n=r.processingEnd,s=r.entries.sort((function(e,t){return e.processingStart-t.processingStart})),o=vh(t.startTime,n),a=e.entries.find((function(e){return e.target})),l=a&&a.target||uh.get(t.interactionId),u=[t.startTime+t.duration,n].concat(o.map((function(e){return e.startTime+e.duration}))),c=Math.max.apply(Math,u),d={interactionTarget:Id(l),interactionTargetElement:l,interactionType:t.name.startsWith("key")?"keyboard":"pointer",interactionTime:t.startTime,nextPaintTime:c,processedEventEntries:s,longAnimationFrameEntries:o,inputDelay:i-t.startTime,processingDuration:n-i,presentationDelay:Math.max(c-n,0),loadState:wd(t.startTime)};return Object.assign(e,{attribution:d})}(t);e(r)}),t)}};is.__PosthogExtensions__=is.__PosthogExtensions__||{},is.__PosthogExtensions__.postHogWebVitalsCallbacks=fh,is.postHogWebVitalsCallbacks=fh;class mh{constructor(e){this.disabled=!1===e;var t=Jr(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&&r-i.timestamp<this.timeoutMs){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 yh=us("[AutoCapture]");function bh(e,t){return t.length>e?t.slice(0,e)+"...":t}function Sh(e){if(e.previousElementSibling)return e.previousElementSibling;var t=e;do{t=t.previousSibling}while(t&&!co(t));return t}function wh(e,t,r,i){var n=e.tagName.toLowerCase(),s={tag_name:n};So.indexOf(n)>-1&&!r&&("a"===n.toLowerCase()||"button"===n.toLowerCase()?s.$el_text=bh(1024,Bo(e)):s.$el_text=bh(1024,yo(e)));var o=fo(e);o.length>0&&(s.classes=o.filter((function(e){return""!==e}))),hs(e.attributes,(function(r){var n;if((!Ao(e)||-1!==["name","id","class","aria-label"].indexOf(r.name))&&((null==i||!i.includes(r.name))&&!t&&qo(r.value)&&(n=r.name,!ti(n)||"_ngcontent"!==n.substring(0,10)&&"_nghost"!==n.substring(0,7)))){var o=r.value;"class"===r.name&&(o=go(o).join(" ")),s["attr__"+r.name]=bh(1024,o)}}));for(var a=1,l=1,u=e;u=Sh(u);)a++,u.tagName===e.tagName&&l++;return s.nth_child=a,s.nth_of_type=l,s}function Ch(e,t){for(var r,i,{e:n,maskAllElementAttributes:s,maskAllText:o,elementAttributeIgnoreList:a,elementsChainAsString:l}=t,u=[e],c=e;c.parentNode&&!ho(c,"body");)vo(c.parentNode)?(u.push(c.parentNode.host),c=c.parentNode.host):(u.push(c.parentNode),c=c.parentNode);var d,h=[],p={},v=!1,g=!1;if(hs(u,(e=>{var t=Po(e);"a"===e.tagName.toLowerCase()&&(v=e.getAttribute("href"),v=t&&v&&qo(v)&&v),$r(fo(e),"ph-no-capture")&&(g=!0),h.push(wh(e,s,o,a));var r=function(e){if(!Po(e))return{};var t={};return hs(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&&qo(i)&&(t[r]=i)}})),t}(e);ps(p,r)})),g)return{props:{},explicitNoCapture:g};if(o||("a"===e.tagName.toLowerCase()||"button"===e.tagName.toLowerCase()?h[0].$el_text=Bo(e):h[0].$el_text=yo(e)),v){var _,f;h[0].attr__href=v;var m=null==(_=Is(v))?void 0:_.host,y=null==zn||null==(f=zn.location)?void 0:f.host;m&&y&&m!==y&&(d=v)}return{props:ps({$event_type:n.type,$ce_version:1},l?{}:{$elements:h},{$elements_chain:$o(h)},null!=(r=h[0])&&r.$el_text?{$el_text:null==(i=h[0])?void 0:i.$el_text}:{},d&&"click"===n.type?{$external_click_url:d}:{},p)}}class Ih{constructor(e){this._initialized=!1,this._isDisabledServerSide=null,this._elementsChainAsString=!1,this.instance=e,this.rageclicks=new mh(e.config.rageclick),this._elementSelectors=null}get _config(){var e,t,r=Jr(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}_addDomEventHandlers(){if(this.isBrowserSupported()){if(zn&&Kn){var e=e=>{e=e||(null==zn?void 0:zn.event);try{this._captureEvent(e)}catch(e){yh.error("Failed to capture event",e)}};if(Cs(Kn,"submit",e,{capture:!0}),Cs(Kn,"change",e,{capture:!0}),Cs(Kn,"click",e,{capture:!0}),this._config.capture_copied_text){var t=e=>{e=e||(null==zn?void 0:zn.event),this._captureEvent(e,Yl)};Cs(Kn,"copy",t,{capture:!0}),Cs(Kn,"cut",t,{capture:!0})}}}else yh.info("Disabling Automatic Event Collection because this browser is not supported")}startIfEnabled(){this.isEnabled&&!this._initialized&&(this._addDomEventHandlers(),this._initialized=!0)}onRemoteConfig(e){e.elementsChainAsString&&(this._elementsChainAsString=e.elementsChainAsString),this.instance.persistence&&this.instance.persistence.register({[Fs]:!!e.autocapture_opt_out}),this._isDisabledServerSide=!!e.autocapture_opt_out,this.startIfEnabled()}setElementSelectors(e){this._elementSelectors=e}getElementSelectors(e){var t,r=[];return null==(t=this._elementSelectors)||t.forEach((t=>{var i=null==Kn?void 0:Kn.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[Fs],i=this._isDisabledServerSide;if(ii(i)&&!oi(r)&&!this.instance._shouldDisableFlags())return!1;var n=null!==(t=this._isDisabledServerSide)&&void 0!==t?t:!!r;return!!this.instance.config.autocapture&&!n}_captureEvent(e,t){if(void 0===t&&(t="$autocapture"),this.isEnabled){var r,i=bo(e);if(po(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())&&xo(i,this.instance.config.rageclick)&&this._captureEvent(e,"$rageclick");var n=t===Yl;if(i&&Ro(i,e,this._config,n,n?["copy","cut"]:void 0)){var{props:s,explicitNoCapture:o}=Ch(i,{e:e,maskAllElementAttributes:this.instance.config.mask_all_element_attributes,maskAllText:this.instance.config.mask_all_text,elementAttributeIgnoreList:this._config.element_attribute_ignorelist,elementsChainAsString:this._elementsChainAsString});if(o)return!1;var a=this.getElementSelectors(i);if(a&&a.length>0&&(s.$element_selectors=a),t===Yl){var l,u=mo(null==zn||null==(l=zn.getSelection())?void 0:l.toString()),c=e.type||"clipboard";if(!u)return!1;s.$selected_content=u,s.$copy_type=c}return this.instance.capture(t,s),!0}}}isBrowserSupported(){return Xr(null==Kn?void 0:Kn.querySelectorAll)}}var kh={};function Eh(e){return function(e,t){var r=kh[e];if(r)return r;var i=t[e];if(Kr(i)&&!ns())return kh[e]=i.bind(t);var n=t.document;if(n&&Xr(n.createElement))try{var s=n.createElement("iframe");s.hidden=!0,n.head.appendChild(s);var o=s.contentWindow;o&&o[e]&&(i=o[e]),n.head.removeChild(s)}catch(t){ls.warn("Could not create sandbox iframe for "+e+" check, bailing to assignableWindow."+e+": ",t)}return i&&Xr(i)?kh[e]=i.bind(t):i}("MutationObserver",e)}function xh(e,t){return si(e)&&e>=t}class Th{_asRequiredConfig(e){var t,r,i,n,s,o=this._defaultConfig((null==e?void 0:e.__onCapture)||this._captureDeadClick.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,__onCapture:o.__onCapture}}constructor(e,t){this._clicks=[],this._defaultConfig=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._onClick=e=>{var t=function(e){var t=bo(e);return t?{node:t,originalEvent:e,timestamp:Date.now()}:null}(e);ii(t)||this._ignoreClick(t)||this._clicks.push(t),this._clicks.length&&ei(this._checkClickTimer)&&(this._checkClickTimer=is.setTimeout((()=>{this._checkClicks()}),1e3))},this._onScroll=()=>{var e=Date.now();e%50==0&&this._clicks.forEach((t=>{ei(t.scrollDelayMs)&&(t.scrollDelayMs=e-t.timestamp)}))},this._onSelectionChange=()=>{this._lastSelectionChanged=Date.now()},this.instance=e,this._config=this._asRequiredConfig(t),this._onCapture=this._config.__onCapture}start(e){this._startClickObserver(),this._startScrollObserver(),this._startSelectionChangedObserver(),this._startMutationObserver(e)}_startMutationObserver(e){if(!this._mutationObserver){var t=Eh(is);this._mutationObserver=new t((e=>{this._onMutation(e)})),this._mutationObserver.observe(e,{attributes:!0,characterData:!0,childList:!0,subtree:!0})}}stop(){var e;null==(e=this._mutationObserver)||e.disconnect(),this._mutationObserver=void 0,is.removeEventListener("click",this._onClick),is.removeEventListener("scroll",this._onScroll,{capture:!0}),is.removeEventListener("selectionchange",this._onSelectionChange)}_onMutation(e){this._lastMutation=Date.now()}_startClickObserver(){Cs(is,"click",this._onClick)}_startScrollObserver(){Cs(is,"scroll",this._onScroll,{capture:!0})}_startSelectionChangedObserver(){Cs(is,"selectionchange",this._onSelectionChange)}_ignoreClick(e){if(!e)return!0;if(!this._config.capture_clicks_with_modifier_keys&&((t=e.originalEvent).ctrlKey||t.metaKey||t.altKey||t.shiftKey))return!0;var t;if(uo(e.node))return!0;var r=this._clicks.some((t=>t.node===e.node&&Math.abs(t.timestamp-e.timestamp)<1e3));return!!r||!(!ho(e.node,"html")&&co(e.node)&&!So.includes(e.node.tagName.toLowerCase()))}_checkClicks(){if(this._clicks.length){clearTimeout(this._checkClickTimer),this._checkClickTimer=void 0;var e=this._clicks;for(var t of(this._clicks=[],e)){var r;t.mutationDelayMs=null!==(r=t.mutationDelayMs)&&void 0!==r?r:this._lastMutation&&t.timestamp<=this._lastMutation?this._lastMutation-t.timestamp:void 0,t.absoluteDelayMs=Date.now()-t.timestamp,t.selectionChangedDelayMs=this._lastSelectionChanged&&t.timestamp<=this._lastSelectionChanged?this._lastSelectionChanged-t.timestamp:void 0;var i=xh(t.scrollDelayMs,this._config.scroll_threshold_ms),n=xh(t.selectionChangedDelayMs,this._config.selection_change_threshold_ms),s=xh(t.mutationDelayMs,this._config.mutation_threshold_ms),o=xh(t.absoluteDelayMs,1.1*this._config.mutation_threshold_ms),a=si(t.scrollDelayMs)&&t.scrollDelayMs<this._config.scroll_threshold_ms,l=si(t.mutationDelayMs)&&t.mutationDelayMs<this._config.mutation_threshold_ms,u=si(t.selectionChangedDelayMs)&&t.selectionChangedDelayMs<this._config.selection_change_threshold_ms;a||l||u||(i||s||o||n?this._onCapture(t,{$dead_click_last_mutation_timestamp:this._lastMutation,$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}):t.absoluteDelayMs<this._config.mutation_threshold_ms&&this._clicks.push(t))}this._clicks.length&&ei(this._checkClickTimer)&&(this._checkClickTimer=is.setTimeout((()=>{this._checkClicks()}),1e3))}}_captureDeadClick(e,t){this.instance.capture("$dead_click",r({},t,Ch(e.node,{e:e.originalEvent,maskAllElementAttributes:this.instance.config.mask_all_element_attributes,maskAllText:this.instance.config.mask_all_text,elementAttributeIgnoreList:this._config.element_attribute_ignorelist,elementsChainAsString:!1}).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}),{timestamp:new Date(e.timestamp)})}}is.__PosthogExtensions__=is.__PosthogExtensions__||{},is.__PosthogExtensions__.initDeadClicksAutocapture=(e,t)=>new Th(e,t);var Mh="";var Rh=/[a-z0-9][a-z0-9-]+\.[a-z]{2,}$/i;function Ph(e,t){if(t){var r=function(e,t){if(void 0===t&&(t=Kn),Mh)return Mh;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_"+Zl();!Mh&&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",Mh=s)}return Mh}(e);if(!r){var i=(e=>{var t=e.match(Rh);return t?t[0]:""})(e);i!==r&&ls.info("Warning: cookie subdomain discovery mismatch",i,r),r=i}return r?"; domain=."+r:""}return""}var Ah={_is_supported:()=>!!Kn,_error:function(e){ls.error("cookieStore error: "+e)},_get:function(e){if(Kn){try{for(var t=e+"=",r=Kn.cookie.split(";").filter((e=>e.length)),i=0;i<r.length;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}},_parse:function(e){var t;try{t=JSON.parse(Ah._get(e))||{}}catch(e){}return t},_set:function(e,t,r,i,n){if(Kn)try{var s="",o="",a=Ph(Kn.location.hostname,i);if(r){var l=new Date;l.setTime(l.getTime()+24*r*60*60*1e3),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&&ls.warn("cookieStore warning: large cookie, len="+u.length),Kn.cookie=u,u}catch(e){return}},_remove:function(e,t){if(null!=Kn&&Kn.cookie)try{Ah._set(e,"",-1,t)}catch(e){return}}},Nh=null,Fh={_is_supported:function(){if(!ii(Nh))return Nh;var e=!0;if(ei(zn))e=!1;else try{var t="__mplssupport__";Fh._set(t,"xyz"),'"xyz"'!==Fh._get(t)&&(e=!1),Fh._remove(t)}catch(t){e=!1}return e||ls.error("localStorage unsupported; falling back to cookie store"),Nh=e,e},_error:function(e){ls.error("localStorage error: "+e)},_get:function(e){try{return null==zn?void 0:zn.localStorage.getItem(e)}catch(e){Fh._error(e)}return null},_parse:function(e){try{return JSON.parse(Fh._get(e))||{}}catch(e){}return null},_set:function(e,t){try{null==zn||zn.localStorage.setItem(e,JSON.stringify(t))}catch(e){Fh._error(e)}},_remove:function(e){try{null==zn||zn.localStorage.removeItem(e)}catch(e){Fh._error(e)}}},Lh=["$device_id","distinct_id",Ws,zs,so,no],Oh=r({},Fh,{_parse:function(e){try{var t={};try{t=Ah._parse(e)||{}}catch(e){}var r=ps(t,JSON.parse(Fh._get(e)||"{}"));return Fh._set(e,r),r}catch(e){}return null},_set:function(e,t,r,i,n,s){try{Fh._set(e,t,void 0,void 0,s);var o={};Lh.forEach((e=>{t[e]&&(o[e]=t[e])})),Object.keys(o).length&&Ah._set(e,o,r,i,n,s)}catch(e){Fh._error(e)}},_remove:function(e,t){try{null==zn||zn.localStorage.removeItem(e),Ah._remove(e,t)}catch(e){Fh._error(e)}}}),Dh={},Hh={_is_supported:function(){return!0},_error:function(e){ls.error("memoryStorage error: "+e)},_get:function(e){return Dh[e]||null},_parse:function(e){return Dh[e]||null},_set:function(e,t){Dh[e]=t},_remove:function(e){delete Dh[e]}},qh=null,Bh={_is_supported:function(){if(!ii(qh))return qh;if(qh=!0,ei(zn))qh=!1;else try{var e="__support__";Bh._set(e,"xyz"),'"xyz"'!==Bh._get(e)&&(qh=!1),Bh._remove(e)}catch(e){qh=!1}return qh},_error:function(e){ls.error("sessionStorage error: ",e)},_get:function(e){try{return null==zn?void 0:zn.sessionStorage.getItem(e)}catch(e){Bh._error(e)}return null},_parse:function(e){try{return JSON.parse(Bh._get(e))||null}catch(e){}return null},_set:function(e,t){try{null==zn||zn.sessionStorage.setItem(e,JSON.stringify(t))}catch(e){Bh._error(e)}},_remove:function(e){try{null==zn||zn.sessionStorage.removeItem(e)}catch(e){Bh._error(e)}}},Vh=function(e){return e[e.PENDING=-1]="PENDING",e[e.DENIED=0]="DENIED",e[e.GRANTED=1]="GRANTED",e}({});class $h{constructor(e){this._instance=e}get _config(){return this._instance.config}get consent(){return this._getDnt()?Vh.DENIED:this._storedConsent}isOptedOut(){return"always"===this._config.cookieless_mode||(this.consent===Vh.DENIED||this.consent===Vh.PENDING&&(this._config.opt_out_capturing_by_default||"on_reject"===this._config.cookieless_mode))}isOptedIn(){return!this.isOptedOut()}isExplicitlyOptedOut(){return this.consent===Vh.DENIED}optInOut(e){this._storage._set(this._storageKey,e?1:0,this._config.cookie_expiration,this._config.cross_subdomain_cookie,this._config.secure_cookie)}reset(){this._storage._remove(this._storageKey,this._config.cross_subdomain_cookie)}get _storageKey(){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 _storedConsent(){var e=this._storage._get(this._storageKey);return pi(e)?Vh.GRANTED:$r(vi,e)?Vh.DENIED:Vh.PENDING}get _storage(){if(!this._persistentStore){var e=this._config.opt_out_capturing_persistence_type;this._persistentStore="localStorage"===e?Fh:Ah;var t="localStorage"===e?Ah:Fh;t._get(this._storageKey)&&(this._persistentStore._get(this._storageKey)||this.optInOut(pi(t._get(this._storageKey))),t._remove(this._storageKey,this._config.cross_subdomain_cookie))}return this._persistentStore}_getDnt(){return!!this._config.respect_dnt&&!!ws([null==Xn?void 0:Xn.doNotTrack,null==Xn?void 0:Xn.msDoNotTrack,is.doNotTrack],(e=>pi(e)))}}var Uh=us("[Dead Clicks]"),Wh=()=>!0,zh=e=>{var t,r=!(null==(t=e.instance.persistence)||!t.get_property(Bs)),i=e.instance.config.capture_dead_clicks;return oi(i)?i:!!Jr(i)||r};class jh{get lazyLoadedDeadClicksAutocapture(){return this._lazyLoadedDeadClicksAutocapture}constructor(e,t,r){this.instance=e,this.isEnabled=t,this.onCapture=r,this.startIfEnabled()}onRemoteConfig(e){this.instance.persistence&&this.instance.persistence.register({[Bs]:null==e?void 0:e.captureDeadClicks}),this.startIfEnabled()}startIfEnabled(){this.isEnabled(this)&&this._loadScript((()=>{this._start()}))}_loadScript(e){var t,r;null!=(t=is.__PosthogExtensions__)&&t.initDeadClicksAutocapture&&e(),null==(r=is.__PosthogExtensions__)||null==r.loadExternalDependency||r.loadExternalDependency(this.instance,"dead-clicks-autocapture",(t=>{t?Uh.error("failed to load script",t):e()}))}_start(){var e;if(Kn){if(!this._lazyLoadedDeadClicksAutocapture&&null!=(e=is.__PosthogExtensions__)&&e.initDeadClicksAutocapture){var t=Jr(this.instance.config.capture_dead_clicks)?this.instance.config.capture_dead_clicks:{};t.__onCapture=this.onCapture,this._lazyLoadedDeadClicksAutocapture=is.__PosthogExtensions__.initDeadClicksAutocapture(this.instance,t),this._lazyLoadedDeadClicksAutocapture.start(Kn),Uh.info("starting...")}}else Uh.error("`document` not found. Cannot start.")}stop(){this._lazyLoadedDeadClicksAutocapture&&(this._lazyLoadedDeadClicksAutocapture.stop(),this._lazyLoadedDeadClicksAutocapture=void 0,Uh.info("stopping..."))}}var Zh=us("[ExceptionAutocapture]");class Gh{constructor(e){var t,r,i;this._startCapturing=()=>{var e;if(zn&&this.isEnabled&&null!=(e=is.__PosthogExtensions__)&&e.errorWrappingFunctions){var t=is.__PosthogExtensions__.errorWrappingFunctions.wrapOnError,r=is.__PosthogExtensions__.errorWrappingFunctions.wrapUnhandledRejection,i=is.__PosthogExtensions__.errorWrappingFunctions.wrapConsoleError;try{!this._unwrapOnError&&this._config.capture_unhandled_errors&&(this._unwrapOnError=t(this.captureException.bind(this))),!this._unwrapUnhandledRejection&&this._config.capture_unhandled_rejections&&(this._unwrapUnhandledRejection=r(this.captureException.bind(this))),!this._unwrapConsoleError&&this._config.capture_console_errors&&(this._unwrapConsoleError=i(this.captureException.bind(this)))}catch(e){Zh.error("failed to start",e),this._stopCapturing()}}},this._instance=e,this._remoteEnabled=!(null==(t=this._instance.persistence)||!t.props[Os]),this._rateLimiter=new _i({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,_logger:Zh}),this._config=this._requiredConfig(),this.startIfEnabledOrStop()}_requiredConfig(){var e=this._instance.config.capture_exceptions,t={capture_unhandled_errors:!1,capture_unhandled_rejections:!1,capture_console_errors:!1};return Jr(e)?t=r({},t,e):(ei(e)?this._remoteEnabled:e)&&(t=r({},t,{capture_unhandled_errors:!0,capture_unhandled_rejections:!0})),t}get isEnabled(){return this._config.capture_console_errors||this._config.capture_unhandled_errors||this._config.capture_unhandled_rejections}startIfEnabledOrStop(){this.isEnabled?(Zh.info("enabled"),this._stopCapturing(),this._loadScript(this._startCapturing)):this._stopCapturing()}_loadScript(e){var t,r;null!=(t=is.__PosthogExtensions__)&&t.errorWrappingFunctions&&e(),null==(r=is.__PosthogExtensions__)||null==r.loadExternalDependency||r.loadExternalDependency(this._instance,"exception-autocapture",(t=>{if(t)return Zh.error("failed to load script",t);e()}))}_stopCapturing(){var e,t,r;null==(e=this._unwrapOnError)||e.call(this),this._unwrapOnError=void 0,null==(t=this._unwrapUnhandledRejection)||t.call(this),this._unwrapUnhandledRejection=void 0,null==(r=this._unwrapConsoleError)||r.call(this),this._unwrapConsoleError=void 0}onRemoteConfig(e){var t=e.autocaptureExceptions;this._remoteEnabled=!!t||!1,this._instance.persistence&&this._instance.persistence.register({[Os]:this._remoteEnabled}),this._config=this._requiredConfig(),this.startIfEnabledOrStop()}onConfigChange(){this._config=this._requiredConfig()}captureException(e){var t,r,i=null!==(t=null==e||null==(r=e.$exception_list)||null==(r=r[0])?void 0:r.type)&&void 0!==t?t:"Exception";this._rateLimiter.consumeRateLimit(i)?Zh.info("Skipping exception capture because of client rate limiting.",{exception:i}):this._instance.exceptions.sendExceptionEvent(e)}}class Yh{constructor(e){var t;this._instance=e,this._lastPathname=(null==zn||null==(t=zn.location)?void 0:t.pathname)||""}get isEnabled(){return"history_change"===this._instance.config.capture_pageview}startIfEnabled(){this.isEnabled&&(ls.info("History API monitoring enabled, starting..."),this.monitorHistoryChanges())}stop(){this._popstateListener&&this._popstateListener(),this._popstateListener=void 0,ls.info("History API monitoring stopped")}monitorHistoryChanges(){var e,t;if(zn&&zn.history){var r=this;null!=(e=zn.history.pushState)&&e.__posthog_wrapped__||Ms(zn.history,"pushState",(e=>function(t,i,n){e.call(this,t,i,n),r._capturePageview("pushState")})),null!=(t=zn.history.replaceState)&&t.__posthog_wrapped__||Ms(zn.history,"replaceState",(e=>function(t,i,n){e.call(this,t,i,n),r._capturePageview("replaceState")})),this._setupPopstateListener()}}_capturePageview(e){try{var t,r=null==zn||null==(t=zn.location)?void 0:t.pathname;if(!r)return;r!==this._lastPathname&&this.isEnabled&&this._instance.capture("$pageview",{navigation_type:e}),this._lastPathname=r}catch(t){ls.error("Error capturing "+e+" pageview",t)}}_setupPopstateListener(){if(!this._popstateListener){var e=()=>{this._capturePageview("popstate")};Cs(zn,"popstate",e),this._popstateListener=()=>{zn&&zn.removeEventListener("popstate",e)}}}}var Xh=us("[SegmentIntegration]");function Kh(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()||Zl();e.config.get_device_id=i,r.id()&&(e.register({distinct_id:r.id(),$device_id:i()}),e.persistence.set_property(Qs,"identified")),t()},n=r.user();"then"in n&&Xr(n.then)?n.then((e=>i(e))):i(n)}(e,(()=>{r.register((e=>{Promise&&Promise.resolve||Xh.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()||(Xh.info("No userId set, resetting PostHog"),e.reset()),t.event.userId&&t.event.userId!==e.get_distinct_id()&&(Xh.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,"$pageview"),identify:e=>t(e,"$identify"),screen:e=>t(e,"$screen")}})(e)).then((()=>{t()}))}))}var Jh="posthog-js";function Qh(e,t){var{organization:i,projectId:n,prefix:s,severityAllowList:o=["error"],sendExceptionsToPostHog:a=!0}=void 0===t?{}:t;return t=>{var l,u,c,d,h;if(!("*"===o||o.includes(t.level))||!e.__loaded)return t;t.tags||(t.tags={});var p=e.requestRouter.endpointFor("ui","/project/"+e.config.token+"/person/"+e.get_distinct_id());t.tags["PostHog Person URL"]=p,e.sessionRecordingStarted()&&(t.tags["PostHog Recording URL"]=e.get_session_replay_url({withTimestamp:!0}));var v=(null==(l=t.exception)?void 0:l.values)||[],g=v.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}))),_={$exception_message:(null==(u=v[0])?void 0:u.value)||t.message,$exception_type:null==(c=v[0])?void 0:c.type,$exception_level:t.level,$exception_list:g,$sentry_event_id:t.event_id,$sentry_exception:t.exception,$sentry_exception_message:(null==(d=v[0])?void 0:d.value)||t.message,$sentry_exception_type:null==(h=v[0])?void 0:h.type,$sentry_tags:t.tags};return i&&n&&(_.$sentry_url=(s||"https://sentry.io/organizations/")+i+"/issues/?project="+n+"&query="+t.event_id),a&&e.exceptions.sendExceptionEvent(_),t}}class ep{constructor(e,t,r,i,n,s){this.name=Jh,this.setupOnce=function(o){o(Qh(e,{organization:t,projectId:r,prefix:i,severityAllowList:n,sendExceptionsToPostHog:null==s||s}))}}}var tp=null!=zn&&zn.location?Ts(zn.location.hash,"__posthog")||Ts(location.hash,"state"):null,rp="_postHogToolbarParams",ip=us("[Toolbar]"),np=function(e){return e[e.UNINITIALIZED=0]="UNINITIALIZED",e[e.LOADING=1]="LOADING",e[e.LOADED=2]="LOADED",e}(np||{});class sp{constructor(e){this.instance=e}_setToolbarState(e){is.ph_toolbar_state=e}_getToolbarState(){var e;return null!==(e=is.ph_toolbar_state)&&void 0!==e?e:np.UNINITIALIZED}maybeLoadToolbar(e,t,r){if(void 0===e&&(e=void 0),void 0===t&&(t=void 0),void 0===r&&(r=void 0),!zn||!Kn)return!1;e=null!=e?e:zn.location,r=null!=r?r:zn.history;try{if(!t){try{zn.localStorage.setItem("test","test"),zn.localStorage.removeItem("test")}catch(e){return!1}t=null==zn?void 0:zn.localStorage}var i,n=tp||Ts(e.hash,"__posthog")||Ts(e.hash,"state"),s=n?_s((()=>JSON.parse(atob(decodeURIComponent(n)))))||_s((()=>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(rp)||"{}")).source="localstorage",delete i.userIntent),!(!i.token||this.instance.config.token!==i.token)&&(this.loadToolbar(i),!0)}catch(e){return!1}}_callLoadToolbar(e){var t=is.ph_load_toolbar||is.ph_load_editor;!ni(t)&&Xr(t)?t(e,this.instance):ip.warn("No toolbar load function found")}loadToolbar(e){var t=!(null==Kn||!Kn.getElementById(oo));if(!zn||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(zn.localStorage.setItem(rp,JSON.stringify(r({},n,{source:void 0}))),this._getToolbarState()===np.LOADED)this._callLoadToolbar(n);else if(this._getToolbarState()===np.UNINITIALIZED){var s;this._setToolbarState(np.LOADING),null==(s=is.__PosthogExtensions__)||null==s.loadExternalDependency||s.loadExternalDependency(this.instance,"toolbar",(e=>{if(e)return ip.error("[Toolbar] Failed to load",e),void this._setToolbarState(np.UNINITIALIZED);this._setToolbarState(np.LOADED),this._callLoadToolbar(n)})),Cs(zn,"turbolinks:load",(()=>{this._setToolbarState(np.UNINITIALIZED),this.loadToolbar(n)}))}return!0}_loadEditor(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)}}var op=us("[TracingHeaders]");class ap{constructor(e){this._restoreXHRPatch=void 0,this._restoreFetchPatch=void 0,this._startCapturing=()=>{var e,t;ei(this._restoreXHRPatch)&&(null==(e=is.__PosthogExtensions__)||null==(e=e.tracingHeadersPatchFns)||e._patchXHR(this._instance.config.__add_tracing_headers||[],this._instance.get_distinct_id(),this._instance.sessionManager));ei(this._restoreFetchPatch)&&(null==(t=is.__PosthogExtensions__)||null==(t=t.tracingHeadersPatchFns)||t._patchFetch(this._instance.config.__add_tracing_headers||[],this._instance.get_distinct_id(),this._instance.sessionManager))},this._instance=e}_loadScript(e){var t,r;null!=(t=is.__PosthogExtensions__)&&t.tracingHeadersPatchFns&&e(),null==(r=is.__PosthogExtensions__)||null==r.loadExternalDependency||r.loadExternalDependency(this._instance,"tracing-headers",(t=>{if(t)return op.error("failed to load script",t);e()}))}startIfEnabledOrStop(){var e,t;this._instance.config.__add_tracing_headers?this._loadScript(this._startCapturing):(null==(e=this._restoreXHRPatch)||e.call(this),null==(t=this._restoreFetchPatch)||t.call(this),this._restoreXHRPatch=void 0,this._restoreFetchPatch=void 0)}}var lp="https?://(.*)",up=["gclid","gclsrc","dclid","gbraid","wbraid","fbclid","msclkid","twclid","li_fat_id","igshid","ttclid","rdt_cid","epik","qclid","sccid","irclid","_kx"],cp=vs(["utm_source","utm_medium","utm_campaign","utm_content","utm_term","gad_source","mc_cid"],up),dp="<masked>",hp=["li_fat_id"];function pp(e,t,r){if(!Kn)return{};var i,n=t?vs([],up,r||[]):[],s=vp(xs(Kn.URL,n,dp),e),o=(i={},hs(hp,(function(e){var t=Ah._get(e);i[e]=t||null})),i);return ps(o,s)}function vp(e,t){var r=cp.concat(t||[]),i={};return hs(r,(function(t){var r=Es(e,t);i[t]=r||null})),i}function gp(e){var t=function(e){return e?0===e.search(lp+"google.([^/?]*)")?"google":0===e.search(lp+"bing.com")?"bing":0===e.search(lp+"yahoo.com")?"yahoo":0===e.search(lp+"duckduckgo.com")?"duckduckgo":null:null}(e),r="yahoo"!=t?"q":"p",i={};if(!ii(t)){i.$search_engine=t;var n=Kn?Es(Kn.referrer,r):"";n.length&&(i.ph_keyword=n)}return i}function _p(){return navigator.language||navigator.userLanguage}function fp(){return(null==Kn?void 0:Kn.referrer)||"$direct"}function mp(e,t){var r=e?vs([],up,t||[]):[],i=null==Jn?void 0:Jn.href.substring(0,1e3);return{r:fp().substring(0,1e3),u:i?xs(i,r,dp):void 0}}function yp(e){var t,{r:r,u:i}=e,n={$referrer:r,$referring_domain:null==r?void 0:"$direct"==r?"$direct":null==(t=Is(r))?void 0:t.host};if(i){n.$current_url=i;var s=Is(i);n.$host=null==s?void 0:s.host,n.$pathname=null==s?void 0:s.pathname;var o=vp(i);ps(n,o)}if(r){var a=gp(r);ps(n,a)}return n}function bp(){try{return Intl.DateTimeFormat().resolvedOptions().timeZone}catch(e){return}}function Sp(){try{return(new Date).getTimezoneOffset()}catch(e){return}}function wp(e,t){if(!rs)return{};var r,i=e?vs([],up,t||[]):[],[n,s]=function(e){for(var t=0;t<gn.length;t++){var[r,i]=gn[t],n=r.exec(e),s=n&&(Xr(i)?i(n,e):i);if(s)return s}return["",""]}(rs);return ps(ms({$os:n,$os_version:s,$browser:hn(rs,navigator.vendor),$device:_n(rs),$device_type:fn(rs),$timezone:bp(),$timezone_offset:Sp()}),{$current_url:xs(null==Jn?void 0:Jn.href,i,dp),$host:null==Jn?void 0:Jn.host,$pathname:null==Jn?void 0:Jn.pathname,$raw_user_agent:rs.length>1e3?rs.substring(0,997)+"...":rs,$browser_version:vn(rs,navigator.vendor),$browser_language:_p(),$browser_language_prefix:(r=_p(),"string"==typeof r?r.split("-")[0]:void 0),$screen_height:null==zn?void 0:zn.screen.height,$screen_width:null==zn?void 0:zn.screen.width,$viewport_height:null==zn?void 0:zn.innerHeight,$viewport_width:null==zn?void 0:zn.innerWidth,$lib:"web",$lib_version:os.LIB_VERSION,$insert_id:Math.random().toString(36).substring(2,10)+Math.random().toString(36).substring(2,10),$time:Date.now()/1e3})}var Cp=us("[Web Vitals]"),Ip=9e5;class kp{constructor(e){var t;this._enabledServerSide=!1,this._initialized=!1,this._buffer={url:void 0,metrics:[],firstMetricTimestamp:void 0},this._flushToCapture=()=>{clearTimeout(this._delayedFlushTimer),0!==this._buffer.metrics.length&&(this._instance.capture("$web_vitals",this._buffer.metrics.reduce(((e,t)=>r({},e,{["$web_vitals_"+t.name+"_event"]:r({},t),["$web_vitals_"+t.name+"_value"]:t.value})),{})),this._buffer={url:void 0,metrics:[],firstMetricTimestamp:void 0})},this._addToBuffer=e=>{var t,i=null==(t=this._instance.sessionManager)?void 0:t.checkAndGetSessionAndWindowId(!0);if(ei(i))Cp.error("Could not read session ID. Dropping metrics!");else{this._buffer=this._buffer||{url:void 0,metrics:[],firstMetricTimestamp:void 0};var n=this._currentURL();if(!ei(n))if(ni(null==e?void 0:e.name)||ni(null==e?void 0:e.value))Cp.error("Invalid metric received",e);else if(this._maxAllowedValue&&e.value>=this._maxAllowedValue)Cp.error("Ignoring metric with value >= "+this._maxAllowedValue,e);else this._buffer.url!==n&&(this._flushToCapture(),this._delayedFlushTimer=setTimeout(this._flushToCapture,this.flushToCaptureTimeoutMs)),ei(this._buffer.url)&&(this._buffer.url=n),this._buffer.firstMetricTimestamp=ei(this._buffer.firstMetricTimestamp)?Date.now():this._buffer.firstMetricTimestamp,e.attribution&&e.attribution.interactionTargetElement&&(e.attribution.interactionTargetElement=void 0),this._buffer.metrics.push(r({},e,{$current_url:n,$session_id:i.sessionId,$window_id:i.windowId,timestamp:Date.now()})),this._buffer.metrics.length===this.allowedMetrics.length&&this._flushToCapture()}},this._startCapturing=()=>{var e,t,r,i,n=is.__PosthogExtensions__;ei(n)||ei(n.postHogWebVitalsCallbacks)||({onLCP:e,onCLS:t,onFCP:r,onINP:i}=n.postHogWebVitalsCallbacks),e&&t&&r&&i?(this.allowedMetrics.indexOf("LCP")>-1&&e(this._addToBuffer.bind(this)),this.allowedMetrics.indexOf("CLS")>-1&&t(this._addToBuffer.bind(this)),this.allowedMetrics.indexOf("FCP")>-1&&r(this._addToBuffer.bind(this)),this.allowedMetrics.indexOf("INP")>-1&&i(this._addToBuffer.bind(this)),this._initialized=!0):Cp.error("web vitals callbacks not loaded - not starting")},this._instance=e,this._enabledServerSide=!(null==(t=this._instance.persistence)||!t.props[qs]),this.startIfEnabled()}get allowedMetrics(){var e,t,r=Jr(this._instance.config.capture_performance)?null==(e=this._instance.config.capture_performance)?void 0:e.web_vitals_allowed_metrics:void 0;return ei(r)?(null==(t=this._instance.persistence)?void 0:t.props[$s])||["CLS","FCP","INP","LCP"]:r}get flushToCaptureTimeoutMs(){return(Jr(this._instance.config.capture_performance)?this._instance.config.capture_performance.web_vitals_delayed_flush_ms:void 0)||5e3}get _maxAllowedValue(){var e=Jr(this._instance.config.capture_performance)&&si(this._instance.config.capture_performance.__web_vitals_max_value)?this._instance.config.capture_performance.__web_vitals_max_value:Ip;return 0<e&&e<=6e4?Ip:e}get isEnabled(){var e=null==Jn?void 0:Jn.protocol;if("http:"!==e&&"https:"!==e)return Cp.info("Web Vitals are disabled on non-http/https protocols"),!1;var t=Jr(this._instance.config.capture_performance)?this._instance.config.capture_performance.web_vitals:oi(this._instance.config.capture_performance)?this._instance.config.capture_performance:void 0;return oi(t)?t:this._enabledServerSide}startIfEnabled(){this.isEnabled&&!this._initialized&&(Cp.info("enabled, starting..."),this._loadScript(this._startCapturing))}onRemoteConfig(e){var t=Jr(e.capturePerformance)&&!!e.capturePerformance.web_vitals,r=Jr(e.capturePerformance)?e.capturePerformance.web_vitals_allowed_metrics:void 0;this._instance.persistence&&(this._instance.persistence.register({[qs]:t}),this._instance.persistence.register({[$s]:r})),this._enabledServerSide=t,this.startIfEnabled()}_loadScript(e){var t,r;null!=(t=is.__PosthogExtensions__)&&t.postHogWebVitalsCallbacks&&e(),null==(r=is.__PosthogExtensions__)||null==r.loadExternalDependency||r.loadExternalDependency(this._instance,"web-vitals",(t=>{t?Cp.error("failed to load script",t):e()}))}_currentURL(){var e=zn?zn.location.href:void 0;if(e){var t=this._instance.config.mask_personal_data_properties,r=this._instance.config.custom_personal_data_properties,i=t?vs([],up,r||[]):[];return xs(e,i,dp)}Cp.error("Could not determine current URL")}}var Ep=us("[Heatmaps]");function xp(e){return Jr(e)&&"clientX"in e&&"clientY"in e&&si(e.clientX)&&si(e.clientY)}class Tp{constructor(e){var t;this._enabledServerSide=!1,this._initialized=!1,this._flushInterval=null,this.instance=e,this._enabledServerSide=!(null==(t=this.instance.persistence)||!t.props[Ls]),this.rageclicks=new mh(e.config.rageclick)}get flushIntervalMilliseconds(){var e=5e3;return Jr(this.instance.config.capture_heatmaps)&&this.instance.config.capture_heatmaps.flush_interval_milliseconds&&(e=this.instance.config.capture_heatmaps.flush_interval_milliseconds),e}get isEnabled(){return ei(this.instance.config.capture_heatmaps)?ei(this.instance.config.enable_heatmaps)?this._enabledServerSide:this.instance.config.enable_heatmaps:!1!==this.instance.config.capture_heatmaps}startIfEnabled(){if(this.isEnabled){if(this._initialized)return;Ep.info("starting..."),this._setupListeners(),this._onVisibilityChange()}else{var e;clearInterval(null!==(e=this._flushInterval)&&void 0!==e?e:void 0),this._removeListeners(),this.getAndClearBuffer()}}onRemoteConfig(e){var t=!!e.heatmaps;this.instance.persistence&&this.instance.persistence.register({[Ls]:t}),this._enabledServerSide=t,this.startIfEnabled()}getAndClearBuffer(){var e=this._buffer;return this._buffer=void 0,e}_onDeadClick(e){this._onClick(e.originalEvent,"deadclick")}_onVisibilityChange(){this._flushInterval&&clearInterval(this._flushInterval),this._flushInterval=function(e){return"visible"===(null==e?void 0:e.visibilityState)}(Kn)?setInterval(this._flush.bind(this),this.flushIntervalMilliseconds):null}_setupListeners(){zn&&Kn&&(this._flushHandler=this._flush.bind(this),Cs(zn,"beforeunload",this._flushHandler),this._onClickHandler=e=>this._onClick(e||(null==zn?void 0:zn.event)),Cs(Kn,"click",this._onClickHandler,{capture:!0}),this._onMouseMoveHandler=e=>this._onMouseMove(e||(null==zn?void 0:zn.event)),Cs(Kn,"mousemove",this._onMouseMoveHandler,{capture:!0}),this._deadClicksCapture=new jh(this.instance,Wh,this._onDeadClick.bind(this)),this._deadClicksCapture.startIfEnabled(),this._onVisibilityChange_handler=this._onVisibilityChange.bind(this),Cs(Kn,"visibilitychange",this._onVisibilityChange_handler),this._initialized=!0)}_removeListeners(){var e;zn&&Kn&&(this._flushHandler&&zn.removeEventListener("beforeunload",this._flushHandler),this._onClickHandler&&Kn.removeEventListener("click",this._onClickHandler,{capture:!0}),this._onMouseMoveHandler&&Kn.removeEventListener("mousemove",this._onMouseMoveHandler,{capture:!0}),this._onVisibilityChange_handler&&Kn.removeEventListener("visibilitychange",this._onVisibilityChange_handler),clearTimeout(this._mouseMoveTimeout),null==(e=this._deadClicksCapture)||e.stop(),this._initialized=!1)}_getProperties(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&&co(i)&&!ho(i,"body");){if(i===r)return!1;if($r(t,null==zn?void 0:zn.getComputedStyle(i).position))return!0;i=Co(i)}return!1}(bo(e),["fixed","sticky"],n);return{x:e.clientX+(s?0:i),y:e.clientY+(s?0:r),target_fixed:s,type:t}}_onClick(e,t){var i;if(void 0===t&&(t="click"),!uo(e.target)&&xp(e)){var n=this._getProperties(e,t);null!=(i=this.rageclicks)&&i.isRageClick(e.clientX,e.clientY,(new Date).getTime())&&this._capture(r({},n,{type:"rageclick"})),this._capture(n)}}_onMouseMove(e){!uo(e.target)&&xp(e)&&(clearTimeout(this._mouseMoveTimeout),this._mouseMoveTimeout=setTimeout((()=>{this._capture(this._getProperties(e,"mousemove"))}),500))}_capture(e){if(zn){var t=zn.location.href,r=this.instance.config.mask_personal_data_properties,i=this.instance.config.custom_personal_data_properties,n=r?vs([],up,i||[]):[],s=xs(t,n,dp);this._buffer=this._buffer||{},this._buffer[s]||(this._buffer[s]=[]),this._buffer[s].push(e)}}_flush(){this._buffer&&!Qr(this._buffer)&&this.instance.capture("$$heatmap",{$heatmap_data:this.getAndClearBuffer()})}}class Mp{constructor(e){this._onSessionIdChange=(e,t,r)=>{r&&(r.noSessionId||r.activityTimeout||r.sessionPastMaximumLength)&&(ls.info("[PageViewManager] Session rotated, clearing pageview state",{sessionId:e,changeReason:r}),this._currentPageview=void 0,this._instance.scrollManager.resetContext())},this._instance=e,this._setupSessionRotationHandler()}_setupSessionRotationHandler(){var e;this._unsubscribeSessionId=null==(e=this._instance.sessionManager)?void 0:e.onSessionId(this._onSessionIdChange)}destroy(){var e;null==(e=this._unsubscribeSessionId)||e.call(this),this._unsubscribeSessionId=void 0}doPageView(e,t){var r,i=this._previousPageViewProperties(e,t);return this._currentPageview={pathname:null!==(r=null==zn?void 0:zn.location.pathname)&&void 0!==r?r:"",pageViewId:t,timestamp:e},this._instance.scrollManager.resetContext(),i}doPageLeave(e){var t;return this._previousPageViewProperties(e,null==(t=this._currentPageview)?void 0:t.pageViewId)}doEvent(){var e;return{$pageview_id:null==(e=this._currentPageview)?void 0:e.pageViewId}}_previousPageViewProperties(e,t){var r=this._currentPageview;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:c}=n;if(!(ei(s)||ei(o)||ei(a)||ei(l)||ei(u)||ei(c))){s=Math.ceil(s),o=Math.ceil(o),a=Math.ceil(a),l=Math.ceil(l),u=Math.ceil(u),c=Math.ceil(c);var d=s<=1?1:gi(o/s,0,1,ls),h=s<=1?1:gi(a/s,0,1,ls),p=l<=1?1:gi(u/l,0,1,ls),v=l<=1?1:gi(c/l,0,1,ls);i=ps(i,{$prev_pageview_last_scroll:o,$prev_pageview_last_scroll_percentage:d,$prev_pageview_max_scroll:a,$prev_pageview_max_scroll_percentage:h,$prev_pageview_last_content:u,$prev_pageview_last_content_percentage:p,$prev_pageview_max_content:c,$prev_pageview_max_content_percentage:v})}}return r.pathname&&(i.$prev_pageview_pathname=r.pathname),r.timestamp&&(i.$prev_pageview_duration=(e.getTime()-r.timestamp.getTime())/1e3),i}}var Rp=us("[FeatureFlags]"),Pp=us("[FeatureFlags]",{debugEnabled:!0}),Ap="$active_feature_flags",Np="$override_feature_flags",Fp="$feature_flag_payloads",Lp="$override_feature_flag_payloads",Op="$feature_flag_request_id",Dp="$feature_flag_evaluated_at",Hp=e=>{var t={};for(var[r,i]of gs(e||{}))i&&(t[r]=i);return t},qp=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]})))):Rp.warn("Using an older version of the feature flags endpoint. Please upgrade your PostHog server to the latest version"),e},Bp=function(e){return e.FeatureFlags="feature_flags",e.Recordings="recordings",e}({});class Vp{constructor(e){this._override_warning=!1,this._hasLoadedFlags=!1,this._requestInFlight=!1,this._reloadingDisabled=!1,this._additionalReloadRequested=!1,this._flagsCalled=!1,this._flagsLoadedFromRemote=!1,this._instance=e,this.featureFlagEventHandlers=[]}_getValidEvaluationEnvironments(){var e=this._instance.config.evaluation_environments;return null!=e&&e.length?e.filter((e=>{var t=e&&"string"==typeof e&&e.trim().length>0;return t||Rp.error("Invalid evaluation environment found:",e,"Expected non-empty string"),t})):[]}_shouldIncludeEvaluationEnvironments(){return this._getValidEvaluationEnvironments().length>0}flags(){if(this._instance.config.__preview_remote_config)this._flagsCalled=!0;else{var e=!this._reloadDebouncer&&(this._instance.config.advanced_disable_feature_flags||this._instance.config.advanced_disable_feature_flags_on_first_load);this._callFlagsEndpoint({disableFlags:e})}}get hasLoadedFlags(){return this._hasLoadedFlags}getFlags(){return Object.keys(this.getFlagVariants())}getFlagsWithDetails(){var e=this._instance.get_property(Gs),t=this._instance.get_property(Np),i=this._instance.get_property(Lp);if(!i&&!t)return e||{};var n=ps({},e||{}),s=[...new Set([...Object.keys(i||{}),...Object.keys(t||{})])];for(var o of s){var a,l,u=n[o],c=null==t?void 0:t[o],d=ei(c)?null!==(a=null==u?void 0:u.enabled)&&void 0!==a&&a:!!c,h=ei(c)?u.variant:"string"==typeof c?c:void 0,p=null==i?void 0:i[o],v=r({},u,{enabled:d,variant:d?null!=h?h:null==u?void 0:u.variant:void 0});if(d!==(null==u?void 0:u.enabled)&&(v.original_enabled=null==u?void 0:u.enabled),h!==(null==u?void 0:u.variant)&&(v.original_variant=null==u?void 0:u.variant),p)v.metadata=r({},null==u?void 0:u.metadata,{payload:p,original_payload:null==u||null==(l=u.metadata)?void 0:l.payload});n[o]=v}return this._override_warning||(Rp.warn(" Overriding feature flag details!",{flagDetails:e,overriddenPayloads:i,finalDetails:n}),this._override_warning=!0),n}getFlagVariants(){var e=this._instance.get_property(js),t=this._instance.get_property(Np);if(!t)return e||{};for(var r=ps({},e),i=Object.keys(t),n=0;n<i.length;n++)r[i[n]]=t[i[n]];return this._override_warning||(Rp.warn(" Overriding feature flags!",{enabledFlags:e,overriddenFlags:t,finalFlags:r}),this._override_warning=!0),r}getFlagPayloads(){var e=this._instance.get_property(Fp),t=this._instance.get_property(Lp);if(!t)return e||{};for(var r=ps({},e||{}),i=Object.keys(t),n=0;n<i.length;n++)r[i[n]]=t[i[n]];return this._override_warning||(Rp.warn(" Overriding feature flag payloads!",{flagPayloads:e,overriddenPayloads:t,finalPayloads:r}),this._override_warning=!0),r}reloadFeatureFlags(){this._reloadingDisabled||this._instance.config.advanced_disable_feature_flags||this._reloadDebouncer||(this._reloadDebouncer=setTimeout((()=>{this._callFlagsEndpoint()}),5))}_clearDebouncer(){clearTimeout(this._reloadDebouncer),this._reloadDebouncer=void 0}ensureFlagsLoaded(){this._hasLoadedFlags||this._requestInFlight||this._reloadDebouncer||this.reloadFeatureFlags()}setAnonymousDistinctId(e){this.$anon_distinct_id=e}setReloadingPaused(e){this._reloadingDisabled=e}_callFlagsEndpoint(e){var t;if(this._clearDebouncer(),!this._instance._shouldDisableFlags())if(this._requestInFlight)this._additionalReloadRequested=!0;else{var i=this._instance.config.token,n=this._instance.get_property("$device_id"),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._instance.persistence)?void 0:t.get_initial_props())||{},this._instance.get_property(Ys)||{}),group_properties:this._instance.get_property(Xs)};ii(n)||ei(n)||(s.$device_id=n),(null!=e&&e.disableFlags||this._instance.config.advanced_disable_feature_flags)&&(s.disable_flags=!0),this._shouldIncludeEvaluationEnvironments()&&(s.evaluation_environments=this._getValidEvaluationEnvironments());var o=this._instance.config.__preview_remote_config,a=o?"/flags/?v=2":"/flags/?v=2&config=true",l=this._instance.config.advanced_only_evaluate_survey_feature_flags?"&only_evaluate_survey_feature_flags=true":"",u=this._instance.requestRouter.endpointFor("flags",a+l);o&&(s.timezone=bp()),this._requestInFlight=!0,this._instance._send_request({method:"POST",url:u,data:s,compression:this._instance.config.disable_compression?void 0:Xl.Base64,timeout:this._instance.config.feature_flag_request_timeout_ms,callback:e=>{var t,r,i=!0;(200===e.statusCode&&(this._additionalReloadRequested||(this.$anon_distinct_id=void 0),i=!1),this._requestInFlight=!1,this._flagsCalled)||(this._flagsCalled=!0,this._instance._onRemoteConfig(null!==(r=e.json)&&void 0!==r?r:{}));if(!s.disable_flags||this._additionalReloadRequested)if(this._flagsLoadedFromRemote=!i,e.json&&null!=(t=e.json.quotaLimited)&&t.includes(Bp.FeatureFlags))Rp.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{var n;if(!s.disable_flags)this.receivedFeatureFlags(null!==(n=e.json)&&void 0!==n?n:{},i);this._additionalReloadRequested&&(this._additionalReloadRequested=!1,this._callFlagsEndpoint())}}})}}getFeatureFlag(e,t){if(void 0===t&&(t={}),this._hasLoadedFlags||this.getFlags()&&this.getFlags().length>0){var r=this.getFlagVariants()[e],i=""+r,n=this._instance.get_property(Op)||void 0,s=this._instance.get_property(Dp)||void 0,o=this._instance.get_property(Js)||{};if((t.send_event||!("send_event"in t))&&(!(e in o)||!o[e].includes(i))){var a,l,u,c,d,h,p,v,g;Yr(o[e])?o[e].push(i):o[e]=[i],null==(a=this._instance.persistence)||a.register({[Js]:o});var _=this.getFeatureFlagDetails(e),f={$feature_flag:e,$feature_flag_response:r,$feature_flag_payload:this.getFeatureFlagPayload(e)||null,$feature_flag_request_id:n,$feature_flag_evaluated_at:s,$feature_flag_bootstrapped_response:(null==(l=this._instance.config.bootstrap)||null==(l=l.featureFlags)?void 0:l[e])||null,$feature_flag_bootstrapped_payload:(null==(u=this._instance.config.bootstrap)||null==(u=u.featureFlagPayloads)?void 0:u[e])||null,$used_bootstrap_value:!this._flagsLoadedFromRemote};ei(null==_||null==(c=_.metadata)?void 0:c.version)||(f.$feature_flag_version=_.metadata.version);var m,y=null!==(d=null==_||null==(h=_.reason)?void 0:h.description)&&void 0!==d?d:null==_||null==(p=_.reason)?void 0:p.code;if(y&&(f.$feature_flag_reason=y),null!=_&&null!=(v=_.metadata)&&v.id&&(f.$feature_flag_id=_.metadata.id),ei(null==_?void 0:_.original_variant)&&ei(null==_?void 0:_.original_enabled)||(f.$feature_flag_original_response=ei(_.original_variant)?_.original_enabled:_.original_variant),null!=_&&null!=(g=_.metadata)&&g.original_payload)f.$feature_flag_original_payload=null==_||null==(m=_.metadata)?void 0:m.original_payload;this._instance.capture("$feature_flag_called",f)}return r}Rp.warn('getFeatureFlag for key "'+e+"\" failed. Feature flags didn't load in time.")}getFeatureFlagDetails(e){return this.getFlagsWithDetails()[e]}getFeatureFlagPayload(e){return this.getFlagPayloads()[e]}getRemoteConfigPayload(e,t){var r=this._instance.config.token,i={distinct_id:this._instance.get_distinct_id(),token:r};this._shouldIncludeEvaluationEnvironments()&&(i.evaluation_environments=this._getValidEvaluationEnvironments()),this._instance._send_request({method:"POST",url:this._instance.requestRouter.endpointFor("flags","/flags/?v=2&config=true"),data:i,compression:this._instance.config.disable_compression?void 0:Xl.Base64,timeout:this._instance.config.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={}),this._hasLoadedFlags||this.getFlags()&&this.getFlags().length>0){var r=this.getFeatureFlag(e,t);return ei(r)?void 0:!!r}Rp.warn('isFeatureEnabled for key "'+e+"\" failed. Feature flags didn't load in time.")}addFeatureFlagsHandler(e){this.featureFlagEventHandlers.push(e)}removeFeatureFlagsHandler(e){this.featureFlagEventHandlers=this.featureFlagEventHandlers.filter((t=>t!==e))}receivedFeatureFlags(e,t){if(this._instance.persistence){this._hasLoadedFlags=!0;var i=this.getFlagVariants(),n=this.getFlagPayloads(),s=this.getFlagsWithDetails();!function(e,t,i,n,s){void 0===i&&(i={}),void 0===n&&(n={}),void 0===s&&(s={});var o=qp(e),a=o.flags,l=o.featureFlags,u=o.featureFlagPayloads;if(l){var c=e.requestId,d=e.evaluatedAt;if(Yr(l)){Rp.warn("v1 of the feature flags endpoint is deprecated. Please use the latest version.");var h={};if(l)for(var p=0;p<l.length;p++)h[l[p]]=!0;t&&t.register({[Ap]:l,[js]:h})}else{var v=l,g=u,_=a;e.errorsWhileComputingFlags&&(v=r({},i,v),g=r({},n,g),_=r({},s,_)),t&&t.register(r({[Ap]:Object.keys(Hp(v)),[js]:v||{},[Fp]:g||{},[Gs]:_||{}},c?{[Op]:c}:{},d?{[Dp]:d}:{}))}}}(e,this._instance.persistence,i,n,s),this._fireFeatureFlagsCallbacks(t)}}override(e,t){void 0===t&&(t=!1),Rp.warn("override is deprecated. Please use overrideFeatureFlags instead."),this.overrideFeatureFlags({flags:e,suppressWarning:t})}overrideFeatureFlags(e){if(!this._instance.__loaded||!this._instance.persistence)return Rp.uninitializedWarning("posthog.featureFlags.overrideFeatureFlags");if(!1===e)return this._instance.persistence.unregister(Np),this._instance.persistence.unregister(Lp),this._fireFeatureFlagsCallbacks(),Pp.info("All overrides cleared");if(e&&"object"==typeof e&&("flags"in e||"payloads"in e)){var t,r=e;if(this._override_warning=Boolean(null!==(t=r.suppressWarning)&&void 0!==t&&t),"flags"in r)if(!1===r.flags)this._instance.persistence.unregister(Np),Pp.info("Flag overrides cleared");else if(r.flags){if(Yr(r.flags)){for(var i={},n=0;n<r.flags.length;n++)i[r.flags[n]]=!0;this._instance.persistence.register({[Np]:i})}else this._instance.persistence.register({[Np]:r.flags});Pp.info("Flag overrides set",{flags:r.flags})}return"payloads"in r&&(!1===r.payloads?(this._instance.persistence.unregister(Lp),Pp.info("Payload overrides cleared")):r.payloads&&(this._instance.persistence.register({[Lp]:r.payloads}),Pp.info("Payload overrides set",{payloads:r.payloads}))),void this._fireFeatureFlagsCallbacks()}this._fireFeatureFlagsCallbacks()}onFeatureFlags(e){if(this.addFeatureFlagsHandler(e),this._hasLoadedFlags){var{flags:t,flagVariants:r}=this._prepareFeatureFlagsForCallbacks();e(t,r)}return()=>this.removeFeatureFlagsHandler(e)}updateEarlyAccessFeatureEnrollment(e,t,i){var n,s=(this._instance.get_property(Zs)||[]).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._instance.persistence)||n.register({[Ap]:Object.keys(Hp(l)),[js]:l}),this._fireFeatureFlagsCallbacks()}getEarlyAccessFeatures(e,t,r){void 0===t&&(t=!1);var i=this._instance.get_property(Zs),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._instance.config.token+n),method:"GET",callback:t=>{var r,i;if(t.json){var n=t.json.earlyAccessFeatures;return null==(r=this._instance.persistence)||r.unregister(Zs),null==(i=this._instance.persistence)||i.register({[Zs]:n}),e(n)}}})}_prepareFeatureFlagsForCallbacks(){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)),{})}}_fireFeatureFlagsCallbacks(e){var{flags:t,flagVariants:r}=this._prepareFeatureFlagsForCallbacks();this.featureFlagEventHandlers.forEach((i=>i(t,r,{errorsLoading:e})))}setPersonPropertiesForFlags(e,t){void 0===t&&(t=!0);var i=this._instance.get_property(Ys)||{};this._instance.register({[Ys]:r({},i,e)}),t&&this._instance.reloadFeatureFlags()}resetPersonPropertiesForFlags(){this._instance.unregister(Ys)}setGroupPropertiesForFlags(e,t){void 0===t&&(t=!0);var i=this._instance.get_property(Xs)||{};0!==Object.keys(i).length&&Object.keys(i).forEach((t=>{i[t]=r({},i[t],e[t]),delete e[t]})),this._instance.register({[Xs]:r({},i,e)}),t&&this._instance.reloadFeatureFlags()}resetGroupPropertiesForFlags(e){if(e){var t=this._instance.get_property(Xs)||{};this._instance.register({[Xs]:r({},t,{[e]:{}})})}else this._instance.unregister(Xs)}reset(){this._hasLoadedFlags=!1,this._requestInFlight=!1,this._reloadingDisabled=!1,this._additionalReloadRequested=!1,this._flagsCalled=!1,this._flagsLoadedFromRemote=!1,this.$anon_distinct_id=void 0,this._clearDebouncer(),this._override_warning=!1}}var $p=["cookie","localstorage","localstorage+cookie","sessionstorage","memory"];class Up{constructor(e,t){this._config=e,this.props={},this._campaign_params_saved=!1,this._name=(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._storage=this._buildStorage(e),this.load(),e.debug&&ls.info("Persistence loaded",e.persistence,r({},this.props)),this.update_config(e,e,t),this.save()}isDisabled(){return!!this._disabled}_buildStorage(e){-1===$p.indexOf(e.persistence.toLowerCase())&&(ls.critical("Unknown persistence type "+e.persistence+"; falling back to localStorage+cookie"),e.persistence="localStorage+cookie");var t=e.persistence.toLowerCase();return"localstorage"===t&&Fh._is_supported()?Fh:"localstorage+cookie"===t&&Oh._is_supported()?Oh:"sessionstorage"===t&&Bh._is_supported()?Bh:"memory"===t?Hh:"cookie"===t?Ah:Oh._is_supported()?Oh:Ah}properties(){var e={};return hs(this.props,(function(t,r){if(r===js&&Jr(t))for(var i=Object.keys(t),n=0;n<i.length;n++)e["$feature/"+i[n]]=t[i[n]];else o=r,a=!1,(ii(s=lo)?a:Yn&&s.indexOf===Yn?-1!=s.indexOf(o):(hs(s,(function(e){if(a||(a=e===o))return cs})),a))||(e[r]=t);var s,o,a})),e}load(){if(!this._disabled){var e=this._storage._parse(this._name);e&&(this.props=ps({},e))}}save(){this._disabled||this._storage._set(this._name,this.props,this._expire_days,this._cross_subdomain,this._secure,this._config.debug)}remove(){this._storage._remove(this._name,!1),this._storage._remove(this._name,!0)}clear(){this.remove(),this.props={}}register_once(e,t,r){if(Jr(e)){ei(t)&&(t="None"),this._expire_days=ei(r)?this._default_expiry:r;var i=!1;if(hs(e,((e,r)=>{this.props.hasOwnProperty(r)&&this.props[r]!==t||(this.props[r]=e,i=!0)})),i)return this.save(),!0}return!1}register(e,t){if(Jr(e)){this._expire_days=ei(t)?this._default_expiry:t;var r=!1;if(hs(e,((t,i)=>{e.hasOwnProperty(i)&&this.props[i]!==t&&(this.props[i]=t,r=!0)})),r)return this.save(),!0}return!1}unregister(e){e in this.props&&(delete this.props[e],this.save())}update_campaign_params(){if(!this._campaign_params_saved){var e=pp(this._config.custom_campaign_params,this._config.mask_personal_data_properties,this._config.custom_personal_data_properties);Qr(ms(e))||this.register(e),this._campaign_params_saved=!0}}update_search_keyword(){var e;this.register((e=null==Kn?void 0:Kn.referrer)?gp(e):{})}update_referrer_info(){var e;this.register_once({$referrer:fp(),$referring_domain:null!=Kn&&Kn.referrer&&(null==(e=Is(Kn.referrer))?void 0:e.host)||"$direct"},void 0)}set_initial_person_info(){this.props[ro]||this.props[io]||this.register_once({[no]:mp(this._config.mask_personal_data_properties,this._config.custom_personal_data_properties)},void 0)}get_initial_props(){var e={};hs([io,ro],(t=>{var r=this.props[t];r&&hs(r,(function(t,r){e["$initial_"+Wr(r)]=t}))}));var t,r,i=this.props[no];if(i){var n=(t=yp(i),r={},hs(t,(function(e,t){r["$initial_"+Wr(t)]=e})),r);ps(e,n)}return e}safe_merge(e){return hs(this.props,(function(t,r){r in e||(e[r]=t)})),e}update_config(e,t,r){if(this._default_expiry=this._expire_days=e.cookie_expiration,this.set_disabled(e.disable_persistence||!!r),this.set_cross_subdomain(e.cross_subdomain_cookie),this.set_secure(e.secure_cookie),e.persistence!==t.persistence){var i=this._buildStorage(e),n=this.props;this.clear(),this._storage=i,this.props=n,this.save()}}set_disabled(e){this._disabled=e,this._disabled?this.remove():this.save()}set_cross_subdomain(e){e!==this._cross_subdomain&&(this._cross_subdomain=e,this.remove(),this.save())}set_secure(e){e!==this._secure&&(this._secure=e,this.remove(),this.save())}set_event_timer(e,t){var r=this.props[Ns]||{};r[e]=t,this.props[Ns]=r,this.save()}remove_event_timer(e){var t=(this.props[Ns]||{})[e];return ei(t)||(delete this.props[Ns][e],this.save()),t}get_property(e){return this.props[e]}set_property(e,t){this.props[e]=t,this.save()}}var Wp=us("[Product Tours]"),zp="ph_product_tours";class jp{constructor(e){this._productTourManager=null,this._cachedTours=null,this._instance=e}onRemoteConfig(e){this._instance.persistence&&this._instance.persistence.register({[Vs]:!(null==e||!e.productTours)}),this.loadIfEnabled()}loadIfEnabled(){var e,t;this._productTourManager||((e=this._instance).config.disable_product_tours||null==(t=e.persistence)||!t.get_property(Vs))||this._loadScript((()=>this._startProductTours()))}_loadScript(e){var t,r;null!=(t=is.__PosthogExtensions__)&&t.generateProductTours?e():null==(r=is.__PosthogExtensions__)||null==r.loadExternalDependency||r.loadExternalDependency(this._instance,"product-tours",(t=>{t?Wp.error("Could not load product tours script",t):e()}))}_startProductTours(){var e;!this._productTourManager&&null!=(e=is.__PosthogExtensions__)&&e.generateProductTours&&(this._productTourManager=is.__PosthogExtensions__.generateProductTours(this._instance,!0))}getProductTours(e,t){if(void 0===t&&(t=!1),!Yr(this._cachedTours)||t){var r=this._instance.persistence;if(r){var i=r.props[zp];if(Yr(i)&&!t)return this._cachedTours=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=>{var i=t.statusCode;if(200!==i||!t.json){var n="Product Tours API could not be loaded, status: "+i;return Wp.error(n),void e([],{isLoaded:!1,error:n})}var s=Yr(t.json.product_tours)?t.json.product_tours:[];this._cachedTours=s,r&&r.register({[zp]:s}),e(s,{isLoaded:!0})}})}else e(this._cachedTours,{isLoaded:!0})}getActiveProductTours(e){ni(this._productTourManager)?e([],{isLoaded:!1,error:"Product tours not loaded"}):this._productTourManager.getActiveProductTours(e)}showProductTour(e){var t;null==(t=this._productTourManager)||t.showTourById(e)}previewTour(e){this._productTourManager?this._productTourManager.previewTour(e):this._loadScript((()=>{var t;this._startProductTours(),null==(t=this._productTourManager)||t.previewTour(e)}))}dismissProductTour(){var e;null==(e=this._productTourManager)||e.dismissTour("user_clicked_skip")}nextStep(){var e;null==(e=this._productTourManager)||e.nextStep()}previousStep(){var e;null==(e=this._productTourManager)||e.previousStep()}clearCache(){var e;this._cachedTours=null,null==(e=this._instance.persistence)||e.unregister(zp)}resetTour(e){var t;null==(t=this._productTourManager)||t.resetTour(e)}resetAllTours(){var e;null==(e=this._productTourManager)||e.resetAllTours()}cancelPendingTour(e){var t;null==(t=this._productTourManager)||t.cancelPendingTour(e)}}class Zp{constructor(){this._events={},this._events={}}on(e,t){return this._events[e]||(this._events[e]=[]),this._events[e].push(t),()=>{this._events[e]=this._events[e].filter((e=>e!==t))}}emit(e,t){for(var r of this._events[e]||[])r(t);for(var i of this._events["*"]||[])i(e,t)}}function Gp(e,t,r){if(ni(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 Yp{constructor(e){this._debugEventEmitter=new Zp,this._checkStep=(e,t)=>this._checkStepEvent(e,t)&&this._checkStepUrl(e,t)&&this._checkStepElement(e,t)&&this._checkStepProperties(e,t),this._checkStepEvent=(e,t)=>null==t||!t.event||(null==e?void 0:e.event)===(null==t?void 0:t.event),this._instance=e,this._actionEvents=new Set,this._actionRegistry=new Set}init(){var e;if(!ei(null==(e=this._instance)?void 0:e._addCaptureHook)){var t;null==(t=this._instance)||t._addCaptureHook(((e,t)=>{this.on(e,t)}))}}register(e){var t,r;if(!ei(null==(t=this._instance)?void 0:t._addCaptureHook)&&(e.forEach((e=>{var t,r;null==(t=this._actionRegistry)||t.add(e),null==(r=e.steps)||r.forEach((e=>{var t;null==(t=this._actionEvents)||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._actionEvents.has(e)||this._actionEvents.has(null==t?void 0:t.event))&&this._actionRegistry&&(null==(r=this._actionRegistry)?void 0:r.size)>0&&this._actionRegistry.forEach((e=>{this._checkAction(t,e)&&this._debugEventEmitter.emit("actionCaptured",e.name)}))}_addActionHook(e){this.onAction("actionCaptured",(t=>e(t)))}_checkAction(e,t){if(null==(null==t?void 0:t.steps))return!1;for(var r of t.steps)if(this._checkStep(e,r))return!0;return!1}onAction(e,t){return this._debugEventEmitter.on(e,t)}_checkStepUrl(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(!Gp(i,t.url,t.url_matching||"contains"))return!1}return!0}_checkStepElement(e,t){return!!this._checkStepHref(e,t)&&(!!this._checkStepText(e,t)&&!!this._checkStepSelector(e,t))}_checkStepHref(e,t){var r;if(null==t||!t.href)return!0;var i=this._getElementsList(e);if(i.length>0)return i.some((e=>Gp(e.href,t.href,t.href_matching||"exact")));var n,s=(null==e||null==(r=e.properties)?void 0:r.$elements_chain)||"";return!!s&&Gp((n=s.match(/(?::|")href="(.*?)"/))?n[1]:"",t.href,t.href_matching||"exact")}_checkStepText(e,t){var r;if(null==t||!t.text)return!0;var i=this._getElementsList(e);if(i.length>0)return i.some((e=>Gp(e.text,t.text,t.text_matching||"exact")||Gp(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;!ni(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=>Gp(e,s,o))))}_checkStepSelector(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}_getElementsList(e){var t;return null==(null==e||null==(t=e.properties)?void 0:t.$elements)?[]:null==e?void 0:e.properties.$elements}_checkStepProperties(e,t){return null==t||!t.properties||0===t.properties.length||Uu(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 Xp{constructor(e){this._instance=e,this._eventToItems=new Map,this._cancelEventToItems=new Map,this._actionToItems=new Map}_doesEventMatchFilter(e,t){return!!e&&Uu(e.propertyFilters,null==t?void 0:t.properties)}_buildEventToItemMap(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}_getMatchingItems(e,t,r){var i=(r===ml.Activation?this._eventToItems:this._cancelEventToItems).get(e),n=[];return this._getItems((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._doesEventMatchFilter(s,t)}))}register(e){var t;ei(null==(t=this._instance)?void 0:t._addCaptureHook)||(this._setupEventBasedItems(e),this._setupActionBasedItems(e))}_setupActionBasedItems(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}));if(0!==t.length){if(null==this._actionMatcher){this._actionMatcher=new Yp(this._instance),this._actionMatcher.init();this._actionMatcher._addActionHook((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._actionMatcher)||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._actionToItems.get(t.name);r&&r.push(e.id),this._actionToItems.set(t.name,r||[e.id])}})))}))}}_setupEventBasedItems(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}));if(0!==r.length||0!==i.length){null==(t=this._instance)||t._addCaptureHook(((e,t)=>{this.onEvent(e,t)})),this._eventToItems=this._buildEventToItemMap(e,ml.Activation),this._cancelEventToItems=this._buildEventToItemMap(e,ml.Cancellation)}}onEvent(e,t){var r,i=this._getLogger(),n=this._getActivatedKey(),s=this._getShownEventName(),o=(null==(r=this._instance)||null==(r=r.persistence)?void 0:r.props[n])||[];if(s===e&&t&&o.length>0){var a,l;i.info("event matched, removing item from activated items",{event:e,eventPayload:t,existingActivatedItems:o});var u=(null==t||null==(a=t.properties)?void 0:a.$survey_id)||(null==t||null==(l=t.properties)?void 0:l.$product_tour_id);if(u){var c=o.indexOf(u);c>=0&&(o.splice(c,1),this._updateActivatedItems(o))}}else{if(this._cancelEventToItems.has(e)){var d=this._getMatchingItems(e,t,ml.Cancellation);d.length>0&&(i.info("cancel event matched, cancelling items",{event:e,itemsToCancel:d.map((e=>e.id))}),d.forEach((e=>{var t=o.indexOf(e.id);t>=0&&o.splice(t,1),this._cancelPendingItem(e.id)})),this._updateActivatedItems(o))}if(this._eventToItems.has(e)){i.info("event name matched",{event:e,eventPayload:t,items:this._eventToItems.get(e)});var h=this._getMatchingItems(e,t,ml.Activation);this._updateActivatedItems(o.concat(h.map((e=>e.id))||[]))}}}onAction(e){var t,r=this._getActivatedKey(),i=(null==(t=this._instance)||null==(t=t.persistence)?void 0:t.props[r])||[];this._actionToItems.has(e)&&this._updateActivatedItems(i.concat(this._actionToItems.get(e)||[]))}_updateActivatedItems(e){var t,r=this._getLogger(),i=this._getActivatedKey(),n=[...new Set(e)].filter((e=>!this._isItemPermanentlyIneligible(e)));r.info("updating activated items",{activatedItems:n}),null==(t=this._instance)||null==(t=t.persistence)||t.register({[i]:n})}getActivatedIds(){var e,t=this._getActivatedKey(),r=null==(e=this._instance)||null==(e=e.persistence)?void 0:e.props[t];return r||[]}getEventToItemsMap(){return this._eventToItems}_getActionMatcher(){return this._actionMatcher}}class Kp extends Xp{constructor(e){super(e)}_getActivatedKey(){return"$surveys_activated"}_getShownEventName(){return El.SHOWN}_getItems(e){var t;null==(t=this._instance)||t.getSurveys(e)}_cancelPendingItem(e){var t;null==(t=this._instance)||t.cancelPendingSurvey(e)}_getLogger(){return Ml}_isItemPermanentlyIneligible(){return!1}getSurveys(){return this.getActivatedIds()}getEventToSurveys(){return this.getEventToItemsMap()}}class Jp{constructor(e){this._isSurveysEnabled=void 0,this._surveyManager=null,this._isInitializingSurveys=!1,this._surveyCallbacks=[],this._getSurveysInFlightPromise=null,this._instance=e,this._surveyEventReceiver=null}onRemoteConfig(e){if(!this._instance.config.disable_surveys){var t=e.surveys;if(ni(t))return Ml.warn("Flags not loaded yet. Not loading surveys.");var r=Yr(t);this._isSurveysEnabled=r?t.length>0:t,Ml.info("flags response received, isSurveysEnabled: "+this._isSurveysEnabled),this.loadIfEnabled()}}reset(){localStorage.removeItem("lastSeenSurveyDate");for(var e=[],t=0;t<localStorage.length;t++){var r=localStorage.key(t);(null!=r&&r.startsWith(Nl)||null!=r&&r.startsWith(Fl))&&e.push(r)}e.forEach((e=>localStorage.removeItem(e)))}loadIfEnabled(){if(!this._surveyManager)if(this._isInitializingSurveys)Ml.info("Already initializing surveys, skipping...");else if(this._instance.config.disable_surveys)Ml.info("Disabled. Not loading surveys.");else if(this._instance.config.cookieless_mode&&this._instance.consent.isOptedOut())Ml.info("Not loading surveys in cookieless mode without consent.");else{var e=null==is?void 0:is.__PosthogExtensions__;if(e){if(!ei(this._isSurveysEnabled)||this._instance.config.advanced_enable_surveys){var t=this._isSurveysEnabled||this._instance.config.advanced_enable_surveys;this._isInitializingSurveys=!0;try{var r=e.generateSurveys;if(r)return void this._completeSurveyInitialization(r,t);var i=e.loadExternalDependency;if(!i)return void this._handleSurveyLoadError("PostHog loadExternalDependency extension not found.");i(this._instance,"surveys",(r=>{r||!e.generateSurveys?this._handleSurveyLoadError("Could not load surveys script",r):this._completeSurveyInitialization(e.generateSurveys,t)}))}catch(e){throw this._handleSurveyLoadError("Error initializing surveys",e),e}finally{this._isInitializingSurveys=!1}}}else Ml.error("PostHog Extensions not found.")}}_completeSurveyInitialization(e,t){this._surveyManager=e(this._instance,t),this._surveyEventReceiver=new Kp(this._instance),Ml.info("Surveys loaded successfully"),this._notifySurveyCallbacks({isLoaded:!0})}_handleSurveyLoadError(e,t){Ml.error(e,t),this._notifySurveyCallbacks({isLoaded:!1,error:e})}onSurveysLoaded(e){return this._surveyCallbacks.push(e),this._surveyManager&&this._notifySurveyCallbacks({isLoaded:!0}),()=>{this._surveyCallbacks=this._surveyCallbacks.filter((t=>t!==e))}}getSurveys(e,t){if(void 0===t&&(t=!1),this._instance.config.disable_surveys)return Ml.info("Disabled. Not loading surveys."),e([]);var r,i=this._instance.get_property(Ks);if(i&&!t)return e(i,{isLoaded:!0});"undefined"!=typeof Promise&&this._getSurveysInFlightPromise?this._getSurveysInFlightPromise.then((t=>{var{surveys:r,context:i}=t;return e(r,i)})):("undefined"!=typeof Promise&&(this._getSurveysInFlightPromise=new Promise((e=>{r=e}))),this._instance._send_request({url:this._instance.requestRouter.endpointFor("api","/api/surveys/?token="+this._instance.config.token),method:"GET",timeout:this._instance.config.surveys_request_timeout_ms,callback:t=>{var i;this._getSurveysInFlightPromise=null;var n=t.statusCode;if(200!==n||!t.json){var s="Surveys API could not be loaded, status: "+n;Ml.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=>Rl(e)&&(Pl(e)||Al(e))));u.length>0&&(null==(a=this._surveyEventReceiver)||a.register(u));null==(i=this._instance.persistence)||i.register({[Ks]:l});var c={isLoaded:!0};e(l,c),null==r||r({surveys:l,context:c})}}))}_notifySurveyCallbacks(e){for(var t of this._surveyCallbacks)try{if(!e.isLoaded)return t([],e);this.getSurveys(t)}catch(e){Ml.error("Error in survey callback",e)}}getActiveMatchingSurveys(e,t){if(void 0===t&&(t=!1),!ni(this._surveyManager))return this._surveyManager.getActiveMatchingSurveys(e,t);Ml.warn("init was not called")}_getSurveyById(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}_checkSurveyEligibility(e){if(ni(this._surveyManager))return{eligible:!1,reason:"SDK is not enabled or survey functionality is not yet loaded"};var t="string"==typeof e?this._getSurveyById(e):e;return t?this._surveyManager.checkSurveyEligibility(t):{eligible:!1,reason:"Survey not found"}}canRenderSurvey(e){if(ni(this._surveyManager))return Ml.warn("init was not called"),{visible:!1,disabledReason:"SDK is not enabled or survey functionality is not yet loaded"};var t=this._checkSurveyEligibility(e);return{visible:t.eligible,disabledReason:t.reason}}canRenderSurveyAsync(e,t){return ni(this._surveyManager)?(Ml.warn("init was not called"),Promise.resolve({visible:!1,disabledReason:"SDK is not enabled or survey functionality is not yet loaded"})):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._checkSurveyEligibility(n);r({visible:s.eligible,disabledReason:s.reason})}else r({visible:!1,disabledReason:"Survey not found"})}),t)}))}renderSurvey(e,t){var r;if(ni(this._surveyManager))Ml.warn("init was not called");else{var i="string"==typeof e?this._getSurveyById(e):e;if(null!=i&&i.id)if(ql.includes(i.type)){var n=null==Kn?void 0:Kn.querySelector(t);if(n)return null!=(r=i.appearance)&&r.surveyPopupDelaySeconds?(Ml.info("Rendering survey "+i.id+" with delay of "+i.appearance.surveyPopupDelaySeconds+" seconds"),void setTimeout((()=>{var e,t;Ml.info("Rendering survey "+i.id+" with delay of "+(null==(e=i.appearance)?void 0:e.surveyPopupDelaySeconds)+" seconds"),null==(t=this._surveyManager)||t.renderSurvey(i,n),Ml.info("Survey "+i.id+" rendered")}),1e3*i.appearance.surveyPopupDelaySeconds)):void this._surveyManager.renderSurvey(i,n);Ml.warn("Survey element not found")}else Ml.warn("Surveys of type "+i.type+" cannot be rendered in the app");else Ml.warn("Survey not found")}}displaySurvey(e,t){var i;if(ni(this._surveyManager))Ml.warn("init was not called");else{var n=this._getSurveyById(e);if(n){var s=n;if(null!=(i=n.appearance)&&i.surveyPopupDelaySeconds&&t.ignoreDelay&&(s=r({},n,{appearance:r({},n.appearance,{surveyPopupDelaySeconds:0})})),!1===t.ignoreConditions){var o=this.canRenderSurvey(n);if(!o.visible)return void Ml.warn("Survey is not eligible to be displayed: ",o.disabledReason)}t.displayType!==Tl.Inline?this._surveyManager.handlePopoverSurvey(s):this.renderSurvey(s,t.selector)}else Ml.warn("Survey not found")}}cancelPendingSurvey(e){ni(this._surveyManager)?Ml.warn("init was not called"):this._surveyManager.cancelSurvey(e)}handlePageUnload(){var e;null==(e=this._surveyManager)||e.handlePageUnload()}}var Qp=us("[Conversations]");class ev{constructor(e){this._isConversationsEnabled=void 0,this._conversationsManager=null,this._isInitializing=!1,this._remoteConfig=null,this._instance=e}onRemoteConfig(e){if(!this._instance.config.disable_conversations){var t=e.conversations;ni(t)||(oi(t)?this._isConversationsEnabled=t:(this._isConversationsEnabled=t.enabled,this._remoteConfig=t),this.loadIfEnabled())}}reset(){var e;null==(e=this._conversationsManager)||e.reset(),this._conversationsManager=null,this._isConversationsEnabled=void 0,this._remoteConfig=null}loadIfEnabled(){if(!this._conversationsManager&&!this._isInitializing&&!(this._instance.config.disable_conversations||this._instance.config.cookieless_mode&&this._instance.consent.isOptedOut())){var e=null==is?void 0:is.__PosthogExtensions__;if(e&&!ei(this._isConversationsEnabled)&&this._isConversationsEnabled)if(this._remoteConfig&&this._remoteConfig.token){if(function(e){var t;if(!e||0===e.length)return!0;var r=null==zn||null==(t=zn.location)?void 0:t.hostname;return!r||e.some((e=>{var t=function(e){var t=e.replace(/^https?:\/\//,"");return(t=t.split("/")[0].split("?")[0].split(":")[0])||null}(e);if(!t)return!1;if(t.startsWith("*.")){var i=t.slice(2);return r.endsWith("."+i)||r===i}return r===t}))}(this._remoteConfig.domains)){this._isInitializing=!0;try{var t=e.initConversations;if(t)return this._completeInitialization(t),void(this._isInitializing=!1);var r=e.loadExternalDependency;if(!r)return void this._handleLoadError("PostHog loadExternalDependency extension not found.");r(this._instance,"conversations",(t=>{t||!e.initConversations?this._handleLoadError("Could not load conversations script",t):this._completeInitialization(e.initConversations),this._isInitializing=!1}))}catch(e){this._handleLoadError("Error initializing conversations",e),this._isInitializing=!1}}}else Qp.error("Conversations enabled but missing token in remote config.")}}_completeInitialization(e){if(this._remoteConfig)try{this._conversationsManager=e(this._remoteConfig,this._instance),Qp.info("Conversations loaded successfully")}catch(e){this._handleLoadError("Error completing conversations initialization",e)}else Qp.error("Cannot complete initialization: remote config is null")}_handleLoadError(e,t){Qp.error(e,t),this._conversationsManager=null,this._isInitializing=!1}enable(){this._conversationsManager?this._conversationsManager.enable():Qp.warn("Conversations not loaded yet.")}disable(){this._conversationsManager&&this._conversationsManager.disable()}isLoaded(){return!ii(this._conversationsManager)}isEnabled(){return!0===this._isConversationsEnabled}}var tv=us("[RateLimiter]");class rv{constructor(e){var t,r;this.serverLimits={},this.lastEventRateLimited=!1,this.checkForLimiting=e=>{var t=e.text;if(t&&t.length)try{(JSON.parse(t).quota_limited||[]).forEach((e=>{tv.info((e||"events")+" is quota limited."),this.serverLimits[e]=(new Date).getTime()+6e4}))}catch(e){return void tv.warn('could not rate limit - continuing. Error: "'+(null==e?void 0:e.message)+'"',{text:t})}},this.instance=e,this.captureEventsPerSecond=(null==(t=e.config.rate_limiting)?void 0:t.events_per_second)||10,this.captureEventsBurstLimit=Math.max((null==(r=e.config.rate_limiting)?void 0:r.events_burst_limit)||10*this.captureEventsPerSecond,this.captureEventsPerSecond),this.lastEventRateLimited=this.clientRateLimitContext(!0).isRateLimited}clientRateLimitContext(e){var t,r,i;void 0===e&&(e=!1);var n=(new Date).getTime(),s=null!==(t=null==(r=this.instance.persistence)?void 0:r.get_property(to))&&void 0!==t?t:{tokens:this.captureEventsBurstLimit,last:n};s.tokens+=(n-s.last)/1e3*this.captureEventsPerSecond,s.last=n,s.tokens>this.captureEventsBurstLimit&&(s.tokens=this.captureEventsBurstLimit);var o=s.tokens<1;return o||e||(s.tokens=Math.max(0,s.tokens-1)),!o||this.lastEventRateLimited||e||this.instance.capture("$$client_ingestion_warning",{$$client_ingestion_warning_message:"posthog-js client rate limited. Config is set to "+this.captureEventsPerSecond+" events per second and "+this.captureEventsBurstLimit+" events burst limit."},{skip_client_rate_limiting:!0}),this.lastEventRateLimited=o,null==(i=this.instance.persistence)||i.set_property(to,s),{isRateLimited:o,remainingTokens:s.tokens}}isServerRateLimited(e){var t=this.serverLimits[e||"events"]||!1;return!1!==t&&(new Date).getTime()<t}}var iv=us("[RemoteConfig]");class nv{constructor(e){this._instance=e}get remoteConfig(){var e;return null==(e=is._POSTHOG_REMOTE_CONFIG)||null==(e=e[this._instance.config.token])?void 0:e.config}_loadRemoteConfigJs(e){var t,r;null!=(t=is.__PosthogExtensions__)&&t.loadExternalDependency?null==(r=is.__PosthogExtensions__)||null==r.loadExternalDependency||r.loadExternalDependency(this._instance,"remote-config",(()=>e(this.remoteConfig))):(iv.error("PostHog Extensions not found. Cannot load remote config."),e())}_loadRemoteConfigJSON(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 iv.info("Using preloaded remote config",this.remoteConfig),void this._onRemoteConfig(this.remoteConfig);if(this._instance._shouldDisableFlags())return void iv.warn("Remote config is disabled. Falling back to local config.");this._loadRemoteConfigJs((e=>{if(!e)return iv.info("No config found after loading remote JS config. Falling back to JSON."),void this._loadRemoteConfigJSON((e=>{this._onRemoteConfig(e)}));this._onRemoteConfig(e)}))}catch(e){iv.error("Error loading remote config",e)}}_onRemoteConfig(e){e?this._instance.config.__preview_remote_config?(this._instance._onRemoteConfig(e),!1!==e.hasFeatureFlags&&this._instance.featureFlags.ensureFlagsLoaded()):iv.info("__preview_remote_config is disabled. Logging config instead",e):iv.error("Failed to fetch remote config from PostHog.")}}var sv=3e3;class ov{constructor(e,t){this._isPaused=!0,this._queue=[],this._flushTimeoutMs=gi((null==t?void 0:t.flush_interval_ms)||sv,250,5e3,ls.createLogger("flush interval"),sv),this._sendRequest=e}enqueue(e){this._queue.push(e),this._flushTimeout||this._setFlushTimeout()}unload(){this._clearFlushTimeout();var e=this._queue.length>0?this._formatQueue():{},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._sendRequest(r({},e,{transport:"sendBeacon"}))}))}enable(){this._isPaused=!1,this._setFlushTimeout()}_setFlushTimeout(){var e=this;this._isPaused||(this._flushTimeout=setTimeout((()=>{if(this._clearFlushTimeout(),this._queue.length>0){var t=this._formatQueue(),r=function(){var r=t[i],n=(new Date).getTime();r.data&&Yr(r.data)&&hs(r.data,(e=>{e.offset=Math.abs(e.timestamp-n),delete e.timestamp})),e._sendRequest(r)};for(var i in t)r()}}),this._flushTimeoutMs))}_clearFlushTimeout(){clearTimeout(this._flushTimeout),this._flushTimeout=void 0}_formatQueue(){var e={};return hs(this._queue,(t=>{var i,n=t,s=(n?n.batchKey:null)||n.url;ei(e[s])&&(e[s]=r({},n,{data:[]})),null==(i=e[s].data)||i.push(n.data)})),this._queue=[],e}}var av=["retriesPerformedSoFar"];class lv{constructor(e){this._isPolling=!1,this._pollIntervalMs=3e3,this._queue=[],this._instance=e,this._queue=[],this._areWeOnline=!0,!ei(zn)&&"onLine"in zn.navigator&&(this._areWeOnline=zn.navigator.onLine,this._onlineListener=()=>{this._areWeOnline=!0,this._flush()},this._offlineListener=()=>{this._areWeOnline=!1},Cs(zn,"online",this._onlineListener),Cs(zn,"offline",this._offlineListener))}get length(){return this._queue.length}retriableRequest(e){var{retriesPerformedSoFar:t}=e,n=i(e,av);si(t)&&t>0&&(n.url=Lu(n.url,{retry_count:t})),this._instance._send_request(r({},n,{callback:e=>{200!==e.statusCode&&(e.statusCode<400||e.statusCode>=500)&&(null!=t?t:0)<10?this._enqueue(r({retriesPerformedSoFar:t},n)):null==n.callback||n.callback(e)}}))}_enqueue(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)*(i-r);return Math.ceil(i+n)}(t),i=Date.now()+r;this._queue.push({retryAt:i,requestOptions:e});var n="Enqueued failed request for retry in "+r;navigator.onLine||(n+=" (Browser is offline)"),ls.warn(n),this._isPolling||(this._isPolling=!0,this._poll())}_poll(){if(this._poller&&clearTimeout(this._poller),0===this._queue.length)return this._isPolling=!1,void(this._poller=void 0);this._poller=setTimeout((()=>{this._areWeOnline&&this._queue.length>0&&this._flush(),this._poll()}),this._pollIntervalMs)}_flush(){var e=Date.now(),t=[],r=this._queue.filter((r=>r.retryAt<e||(t.push(r),!1)));if(this._queue=t,r.length>0)for(var{requestOptions:i}of r)this.retriableRequest(i)}unload(){for(var{requestOptions:e}of(this._poller&&(clearTimeout(this._poller),this._poller=void 0),this._isPolling=!1,ei(zn)||(this._onlineListener&&(zn.removeEventListener("online",this._onlineListener),this._onlineListener=void 0),this._offlineListener&&(zn.removeEventListener("offline",this._offlineListener),this._offlineListener=void 0)),this._queue))try{this._instance._send_request(r({},e,{transport:"sendBeacon"}))}catch(e){ls.error(e)}this._queue=[]}}class uv{constructor(e){this._updateScrollData=()=>{var e,t,r,i;this._context||(this._context={});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._context.lastScrollY=Math.ceil(s),this._context.maxScrollY=Math.max(s,null!==(e=this._context.maxScrollY)&&void 0!==e?e:0),this._context.maxScrollHeight=Math.max(o,null!==(t=this._context.maxScrollHeight)&&void 0!==t?t:0),this._context.lastContentY=a,this._context.maxContentY=Math.max(a,null!==(r=this._context.maxContentY)&&void 0!==r?r:0),this._context.maxContentHeight=Math.max(l,null!==(i=this._context.maxContentHeight)&&void 0!==i?i:0)},this._instance=e}getContext(){return this._context}resetContext(){var e=this._context;return setTimeout(this._updateScrollData,0),e}startMeasuringScrollPosition(){Cs(zn,"scroll",this._updateScrollData,{capture:!0}),Cs(zn,"scrollend",this._updateScrollData,{capture:!0}),Cs(zn,"resize",this._updateScrollData)}scrollElement(){if(!this._instance.config.scroll_root_selector)return null==zn?void 0:zn.document.documentElement;var e=Yr(this._instance.config.scroll_root_selector)?this._instance.config.scroll_root_selector:[this._instance.config.scroll_root_selector];for(var t of e){var r=null==zn?void 0:zn.document.querySelector(t);if(r)return r}}scrollY(){if(this._instance.config.scroll_root_selector){var e=this.scrollElement();return e&&e.scrollTop||0}return zn&&(zn.scrollY||zn.pageYOffset||zn.document.documentElement.scrollTop)||0}scrollX(){if(this._instance.config.scroll_root_selector){var e=this.scrollElement();return e&&e.scrollLeft||0}return zn&&(zn.scrollX||zn.pageXOffset||zn.document.documentElement.scrollLeft)||0}}var cv=e=>mp(null==e?void 0:e.config.mask_personal_data_properties,null==e?void 0:e.config.custom_personal_data_properties);class dv{constructor(e,t,r,i){this._onSessionIdCallback=e=>{var t=this._getStored();if(!t||t.sessionId!==e){var r={sessionId:e,props:this._sessionSourceParamGenerator(this._instance)};this._persistence.register({[eo]:r})}},this._instance=e,this._sessionIdManager=t,this._persistence=r,this._sessionSourceParamGenerator=i||cv,this._sessionIdManager.onSessionId(this._onSessionIdCallback)}_getStored(){return this._persistence.props[eo]}getSetOnceProps(){var e,t=null==(e=this._getStored())?void 0:e.props;return t?"r"in t?yp(t):{$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 hs(ms(this.getSetOnceProps()),((t,r)=>{"$current_url"===r&&(r="url"),e["$session_entry_"+Wr(r)]=t})),e}}var hv=us("[SessionId]");class pv{on(e,t){return this._eventEmitter.on(e,t)}constructor(e,t,r){var i;if(this._sessionIdChangedHandlers=[],this._beforeUnloadListener=void 0,this._eventEmitter=new Zp,this._sessionHasBeenIdleTooLong=(e,t)=>Math.abs(e-t)>this.sessionTimeoutMs,!e.persistence)throw new Error("SessionIdManager requires a PostHogPersistence instance");if("always"===e.config.cookieless_mode)throw new Error('SessionIdManager cannot be used with cookieless_mode="always"');this._config=e.config,this._persistence=e.persistence,this._windowId=void 0,this._sessionId=void 0,this._sessionStartTimestamp=null,this._sessionActivityTimestamp=null,this._sessionIdGenerator=t||Zl,this._windowIdGenerator=r||Zl;var n=this._config.persistence_name||this._config.token,s=this._config.session_idle_timeout_seconds||1800;if(this._sessionTimeoutMs=1e3*gi(s,60,36e3,hv.createLogger("session_idle_timeout_seconds"),1800),e.register({$configured_session_timeout_ms:this._sessionTimeoutMs}),this._resetIdleTimer(),this._window_id_storage_key="ph_"+n+"_window_id",this._primary_window_exists_storage_key="ph_"+n+"_primary_window_exists",this._canUseSessionStorage()){var o=Bh._parse(this._window_id_storage_key),a=Bh._parse(this._primary_window_exists_storage_key);o&&!a?this._windowId=o:Bh._remove(this._window_id_storage_key),Bh._set(this._primary_window_exists_storage_key,!0)}if(null!=(i=this._config.bootstrap)&&i.sessionID)try{var l=(e=>{var t=e.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._config.bootstrap.sessionID);this._setSessionId(this._config.bootstrap.sessionID,(new Date).getTime(),l)}catch(e){hv.error("Invalid sessionID in bootstrap",e)}this._listenToReloadWindow()}get sessionTimeoutMs(){return this._sessionTimeoutMs}onSessionId(e){return ei(this._sessionIdChangedHandlers)&&(this._sessionIdChangedHandlers=[]),this._sessionIdChangedHandlers.push(e),this._sessionId&&e(this._sessionId,this._windowId),()=>{this._sessionIdChangedHandlers=this._sessionIdChangedHandlers.filter((t=>t!==e))}}_canUseSessionStorage(){return"memory"!==this._config.persistence&&!this._persistence._disabled&&Bh._is_supported()}_setWindowId(e){e!==this._windowId&&(this._windowId=e,this._canUseSessionStorage()&&Bh._set(this._window_id_storage_key,e))}_getWindowId(){return this._windowId?this._windowId:this._canUseSessionStorage()?Bh._parse(this._window_id_storage_key):null}_setSessionId(e,t,r){e===this._sessionId&&t===this._sessionActivityTimestamp&&r===this._sessionStartTimestamp||(this._sessionStartTimestamp=r,this._sessionActivityTimestamp=t,this._sessionId=e,this._persistence.register({[Ws]:[t,e,r]}))}_getSessionId(){var e=this._persistence.props[Ws];return Yr(e)&&2===e.length&&e.push(e[0]),e||[0,null,0]}resetSessionId(){this._setSessionId(null,null,null)}destroy(){clearTimeout(this._enforceIdleTimeout),this._enforceIdleTimeout=void 0,this._beforeUnloadListener&&zn&&(zn.removeEventListener("beforeunload",this._beforeUnloadListener,{capture:!1}),this._beforeUnloadListener=void 0),this._sessionIdChangedHandlers=[]}_listenToReloadWindow(){this._beforeUnloadListener=()=>{this._canUseSessionStorage()&&Bh._remove(this._primary_window_exists_storage_key)},Cs(zn,"beforeunload",this._beforeUnloadListener,{capture:!1})}checkAndGetSessionAndWindowId(e,t){if(void 0===e&&(e=!1),void 0===t&&(t=null),"always"===this._config.cookieless_mode)throw new Error('checkAndGetSessionAndWindowId should not be called with cookieless_mode="always"');var r=t||(new Date).getTime(),[i,n,s]=this._getSessionId(),o=this._getWindowId(),a=si(s)&&s>0&&Math.abs(r-s)>864e5,l=!1,u=!n,c=!u&&!e&&this._sessionHasBeenIdleTooLong(r,i);u||c||a?(n=this._sessionIdGenerator(),o=this._windowIdGenerator(),hv.info("new session ID generated",{sessionId:n,windowId:o,changeReason:{noSessionId:u,activityTimeout:c,sessionPastMaximumLength:a}}),s=r,l=!0):o||(o=this._windowIdGenerator(),l=!0);var d=0===i||!e||a?r:i,h=0===s?(new Date).getTime():s;return this._setWindowId(o),this._setSessionId(n,d,h),e||this._resetIdleTimer(),l&&this._sessionIdChangedHandlers.forEach((e=>e(n,o,l?{noSessionId:u,activityTimeout:c,sessionPastMaximumLength:a}:void 0))),{sessionId:n,windowId:o,sessionStartTimestamp:h,changeReason:l?{noSessionId:u,activityTimeout:c,sessionPastMaximumLength:a}:void 0,lastActivityTimestamp:i}}_resetIdleTimer(){clearTimeout(this._enforceIdleTimeout),this._enforceIdleTimeout=setTimeout((()=>{var[e]=this._getSessionId();if(this._sessionHasBeenIdleTooLong((new Date).getTime(),e)){var t=this._sessionId;this.resetSessionId(),this._eventEmitter.emit("forcedIdleReset",{idleSessionId:t})}}),1.1*this.sessionTimeoutMs)}}var vv=["$set_once","$set"],gv=us("[SiteApps]");class _v{constructor(e){this._instance=e,this._bufferedInvocations=[],this.apps={}}get isEnabled(){return!!this._instance.config.opt_in_site_apps}_eventCollector(e,t){if(t){var r=this.globalsForEvent(t);this._bufferedInvocations.push(r),this._bufferedInvocations.length>1e3&&(this._bufferedInvocations=this._bufferedInvocations.slice(10))}}get siteAppLoaders(){var e;return null==(e=is._POSTHOG_REMOTE_CONFIG)||null==(e=e[this._instance.config.token])?void 0:e.siteApps}init(){if(this.isEnabled){var e=this._instance._addCaptureHook(this._eventCollector.bind(this));this._stopBuffering=()=>{e(),this._bufferedInvocations=[],this._stopBuffering=void 0}}}globalsForEvent(e){var t,n,s,o,a,l,u;if(!e)throw new Error("Event payload is required");var c={},d=this._instance.get_property("$groups")||[],h=this._instance.get_property("$stored_group_properties")||{};for(var[p,v]of Object.entries(h))c[p]={id:d[p],type:p,properties:v};var{$set_once:g,$set:_}=e;return{event:r({},i(e,vv),{properties:r({},e.properties,_?{$set:r({},null!==(t=null==(n=e.properties)?void 0:n.$set)&&void 0!==t?t:{},_)}:{},g?{$set_once:r({},null!==(s=null==(o=e.properties)?void 0:o.$set_once)&&void 0!==s?s:{},g)}:{}),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:c}}setupSiteApp(e){var t=this.apps[e.id],r=()=>{var r;(!t.errored&&this._bufferedInvocations.length&&(gv.info("Processing "+this._bufferedInvocations.length+" events for site app with id "+e.id),this._bufferedInvocations.forEach((e=>null==t.processEvent?void 0:t.processEvent(e))),t.processedBuffer=!0),Object.values(this.apps).every((e=>e.processedBuffer||e.errored)))&&(null==(r=this._stopBuffering)||r.call(this))},i=!1,n=n=>{t.errored=!n,t.loaded=!0,gv.info("Site app with id "+e.id+" "+(n?"loaded":"errored")),i&&r()};try{var{processEvent:s}=e.init({posthog:this._instance,callback:e=>{n(e)}});s&&(t.processEvent=s),i=!0}catch(t){gv.error("Error while initializing PostHog app with config id "+e.id,t),n(!1)}if(i&&t.loaded)try{r()}catch(r){gv.error("Error while processing buffered events PostHog app with config id "+e.id,r),t.errored=!0}}_setupSiteApps(){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)}_onCapturedEvent(e){if(0!==Object.keys(this.apps).length){var t=this.globalsForEvent(e);for(var r of Object.values(this.apps))try{null==r.processEvent||r.processEvent(t)}catch(t){gv.error("Error while processing event "+e.event+" for site app "+r.id,t)}}}onRemoteConfig(e){var t,r,i,n=this;if(null!=(t=this.siteAppLoaders)&&t.length)return this.isEnabled?(this._setupSiteApps(),void this._instance.on("eventCaptured",(e=>this._onCapturedEvent(e)))):void gv.error('PostHog site apps are disabled. Enable the "opt_in_site_apps" config to proceed.');if(null==(r=this._stopBuffering)||r.call(this),null!=(i=e.siteApps)&&i.length)if(this.isEnabled){var s=function(e){var t;is["__$$ph_site_app_"+e]=n._instance,null==(t=is.__PosthogExtensions__)||null==t.loadSiteApp||t.loadSiteApp(n._instance,a,(t=>{if(t)return gv.error("Error while initializing PostHog app with config id "+e,t)}))};for(var{id:o,url:a}of e.siteApps)s(o)}else gv.error('PostHog site apps are disabled. Enable the "opt_in_site_apps" config to proceed.')}}var fv=function(e,t){if(!e)return!1;var r=e.userAgent;if(r&&Br(r,t))return!0;try{var i=null==e?void 0:e.userAgentData;if(null!=i&&i.brands&&i.brands.some((e=>Br(null==e?void 0:e.brand,t))))return!0}catch(e){}return!!e.webdriver},mv=function(e){return e.US="us",e.EU="eu",e.CUSTOM="custom",e}({}),yv="i.posthog.com";class bv{constructor(e){this._regionCache={},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("."+yv,".posthog.com")),"https://app.posthog.com"===t?"https://us.posthog.com":t}get region(){return this._regionCache[this.apiHost]||(/https:\/\/(app|us|us-assets)(\.i)?\.posthog\.com/i.test(this.apiHost)?this._regionCache[this.apiHost]=mv.US:/https:\/\/(eu|eu-assets)(\.i)?\.posthog\.com/i.test(this.apiHost)?this._regionCache[this.apiHost]=mv.EU:this._regionCache[this.apiHost]=mv.CUSTOM),this._regionCache[this.apiHost]}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(this.region===mv.CUSTOM)return this.apiHost+t;var r=yv+t;switch(e){case"assets":return"https://"+this.region+"-assets."+r;case"api":return"https://"+this.region+"."+r}}}var Sv={icontains:(e,t)=>!!zn&&t.href.toLowerCase().indexOf(e.toLowerCase())>-1,not_icontains:(e,t)=>!!zn&&-1===t.href.toLowerCase().indexOf(e.toLowerCase()),regex:(e,t)=>!!zn&&qu(t.href,e),not_regex:(e,t)=>!!zn&&!qu(t.href,e),exact:(e,t)=>t.href===e,is_not:(e,t)=>t.href!==e};class wv{constructor(e){var t=this;this.getWebExperimentsAndEvaluateDisplayLogic=function(e){void 0===e&&(e=!1),t.getWebExperiments((e=>{wv._logInfo("retrieved web experiments from the server"),t._flagToExperiments=new Map,e.forEach((e=>{if(e.feature_flag_key){var r;if(t._flagToExperiments)wv._logInfo("setting flag key ",e.feature_flag_key," to web experiment ",e),null==(r=t._flagToExperiments)||r.set(e.feature_flag_key,e);var i=t._instance.getFeatureFlag(e.feature_flag_key);ti(i)&&e.variants[i]&&t._applyTransforms(e.name,i,e.variants[i].transforms)}else if(e.variants)for(var n in e.variants){var s=e.variants[n];wv._matchesTestVariant(s)&&t._applyTransforms(e.name,n,s.transforms)}}))}),e)},this._instance=e,this._instance.onFeatureFlags((e=>{this.onFeatureFlags(e)}))}onFeatureFlags(e){if(this._is_bot())wv._logInfo("Refusing to render web experiment since the viewer is a likely bot");else if(!this._instance.config.disable_web_experiments){if(ni(this._flagToExperiments))return this._flagToExperiments=new Map,this.loadIfEnabled(),void this.previewWebExperiment();wv._logInfo("applying feature flags",e),e.forEach((e=>{var t;if(this._flagToExperiments&&null!=(t=this._flagToExperiments)&&t.has(e)){var r,i=this._instance.getFeatureFlag(e),n=null==(r=this._flagToExperiments)?void 0:r.get(e);i&&null!=n&&n.variants[i]&&this._applyTransforms(n.name,i,n.variants[i].transforms)}}))}}previewWebExperiment(){var e=wv.getWindowLocation();if(null!=e&&e.search){var t=Es(null==e?void 0:e.search,"__experiment_id"),r=Es(null==e?void 0:e.search,"__experiment_variant");t&&r&&(wv._logInfo("previewing web experiments "+t+" && "+r),this.getWebExperiments((e=>{this._showPreviewWebExperiment(parseInt(t),r,e)}),!1,!0))}}loadIfEnabled(){this._instance.config.disable_web_experiments||this.getWebExperimentsAndEvaluateDisplayLogic()}getWebExperiments(e,t,r){if(this._instance.config.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._instance.config.token),method:"GET",callback:t=>{if(200!==t.statusCode||!t.json)return e([]);var r=t.json.experiments||[];return e(r)}})}_showPreviewWebExperiment(e,t,r){var i=r.filter((t=>t.id===e));i&&i.length>0&&(wv._logInfo("Previewing web experiment ["+i[0].name+"] with variant ["+t+"]"),this._applyTransforms(i[0].name,t,i[0].variants[t].transforms))}static _matchesTestVariant(e){return!ni(e.conditions)&&(wv._matchUrlConditions(e)&&wv._matchUTMConditions(e))}static _matchUrlConditions(e){var t;if(ni(e.conditions)||ni(null==(t=e.conditions)?void 0:t.url))return!0;var r,i,n,s=wv.getWindowLocation();return!!s&&(null==(r=e.conditions)||!r.url||Sv[null!==(i=null==(n=e.conditions)?void 0:n.urlMatchType)&&void 0!==i?i:"icontains"](e.conditions.url,s))}static getWindowLocation(){return null==zn?void 0:zn.location}static _matchUTMConditions(e){var t;if(ni(e.conditions)||ni(null==(t=e.conditions)?void 0:t.utm))return!0;var r=pp();if(r.utm_source){var i,n,s,o,a,l,u,c,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,h=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,p=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,v=null==(u=e.conditions)||null==(u=u.utm)||!u.utm_term||(null==(c=e.conditions)||null==(c=c.utm)?void 0:c.utm_term)==r.utm_term;return d&&p&&v&&h}return!1}static _logInfo(e){for(var t=arguments.length,r=new Array(t>1?t-1:0),i=1;i<t;i++)r[i-1]=arguments[i];ls.info("[WebExperiments] "+e,r)}_applyTransforms(e,t,r){this._is_bot()?wv._logInfo("Refusing to render web experiment since the viewer is a likely bot"):"control"!==t?r.forEach((r=>{if(r.selector){var i;wv._logInfo("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)}))}})):wv._logInfo("Control variants leave the page unmodified.")}_is_bot(){return Xn&&this._instance?fv(Xn,this._instance.config.custom_blocked_useragents):void 0}}var Cv=us("[PostHog ExternalIntegrations]"),Iv={intercom:"intercom-integration",crispChat:"crisp-chat-integration"};class kv{constructor(e){this._instance=e}_loadScript(e,t){var r;null==(r=is.__PosthogExtensions__)||null==r.loadExternalDependency||r.loadExternalDependency(this._instance,e,(e=>{if(e)return Cv.error("failed to load script",e);t()}))}startIfEnabledOrStop(){var e=this,t=function(t){var r,n,s;(!i||null!=(r=is.__PosthogExtensions__)&&null!=(r=r.integrations)&&r[t]||e._loadScript(Iv[t],(()=>{var r;null==(r=is.__PosthogExtensions__)||null==(r=r.integrations)||null==(r=r[t])||r.start(e._instance)})),!i&&null!=(n=is.__PosthogExtensions__)&&null!=(n=n.integrations)&&n[t])&&(null==(s=is.__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 Ev="[SessionRecording]",xv=us(Ev);class Tv{get started(){var e;return!(null==(e=this._lazyLoadedSessionRecording)||!e.isStarted)}get status(){return this._lazyLoadedSessionRecording?this._lazyLoadedSessionRecording.status:this._receivedFlags&&!this._isRecordingEnabled?"disabled":"lazy_loading"}constructor(e){if(this._forceAllowLocalhostNetworkCapture=!1,this._receivedFlags=!1,this._persistFlagsOnSessionListener=void 0,this._instance=e,!this._instance.sessionManager)throw xv.error("started without valid sessionManager"),new Error(Ev+" started without valid sessionManager. This is a bug.");if("always"===this._instance.config.cookieless_mode)throw new Error(Ev+' cannot be used with cookieless_mode="always"')}get _isRecordingEnabled(){var e,t=!(null==(e=this._instance.get_property(Us))||!e.enabled),r=!this._instance.config.disable_session_recording,i=this._instance.config.disable_session_recording||this._instance.consent.isOptedOut();return zn&&t&&r&&!i}startIfEnabledOrStop(e){var t;if(!this._isRecordingEnabled||null==(t=this._lazyLoadedSessionRecording)||!t.isStarted){var r=!ei(Object.assign)&&!ei(Array.from);this._isRecordingEnabled&&r?(this._lazyLoadAndStart(e),xv.info("starting")):this.stopRecording()}}_lazyLoadAndStart(e){var t,r,i;this._isRecordingEnabled&&(null!=is&&null!=(t=is.__PosthogExtensions__)&&null!=(t=t.rrweb)&&t.record&&null!=(r=is.__PosthogExtensions__)&&r.initSessionRecording?this._onScriptLoaded(e):null==(i=is.__PosthogExtensions__)||null==i.loadExternalDependency||i.loadExternalDependency(this._instance,this._scriptName,(t=>{if(t)return xv.error("could not load recorder",t);this._onScriptLoaded(e)})))}stopRecording(){var e,t;null==(e=this._persistFlagsOnSessionListener)||e.call(this),this._persistFlagsOnSessionListener=void 0,null==(t=this._lazyLoadedSessionRecording)||t.stop()}_resetSampling(){var e;null==(e=this._instance.persistence)||e.unregister(zs)}_persistRemoteConfig(e){if(this._instance.persistence){var t,i,n=this._instance.persistence,s=()=>{var t=!1===e.sessionRecording?void 0:e.sessionRecording,i=null==t?void 0:t.sampleRate,s=ni(i)?null:parseFloat(i);ni(s)&&this._resetSampling();var o=null==t?void 0:t.minimumDurationMilliseconds;n.register({[Us]:r({enabled:!!t},t,{networkPayloadCapture:r({capturePerformance:e.capturePerformance},null==t?void 0:t.networkPayloadCapture),canvasRecording:{enabled:null==t?void 0:t.recordCanvas,fps:null==t?void 0:t.canvasFps,quality:null==t?void 0:t.canvasQuality},sampleRate:s,minimumDurationMilliseconds:ei(o)?null:o,endpoint:null==t?void 0:t.endpoint,triggerMatchType:null==t?void 0:t.triggerMatchType,masking:null==t?void 0:t.masking,urlTriggers:null==t?void 0:t.urlTriggers})})};s(),null==(t=this._persistFlagsOnSessionListener)||t.call(this),this._persistFlagsOnSessionListener=null==(i=this._instance.sessionManager)?void 0:i.onSessionId(s)}}onRemoteConfig(e){"sessionRecording"in e?!1!==e.sessionRecording?(this._persistRemoteConfig(e),this._receivedFlags=!0,this.startIfEnabledOrStop()):this._receivedFlags=!0:xv.info("skipping remote config with no sessionRecording",e)}log(e,t){var r;void 0===t&&(t="log"),null!=(r=this._lazyLoadedSessionRecording)&&r.log?this._lazyLoadedSessionRecording.log(e,t):xv.warn("log called before recorder was ready")}get _scriptName(){var e,t,r=null==(e=this._instance)||null==(e=e.persistence)?void 0:e.get_property(Us);return(null==r||null==(t=r.scriptConfig)?void 0:t.script)||"lazy-recorder"}_onScriptLoaded(e){var t,r;if(null==(t=is.__PosthogExtensions__)||!t.initSessionRecording)throw Error("Called on script loaded before session recording is available");this._lazyLoadedSessionRecording||(this._lazyLoadedSessionRecording=null==(r=is.__PosthogExtensions__)?void 0:r.initSessionRecording(this._instance),this._lazyLoadedSessionRecording._forceAllowLocalhostNetworkCapture=this._forceAllowLocalhostNetworkCapture);this._lazyLoadedSessionRecording.start(e)}onRRwebEmit(e){var t;null==(t=this._lazyLoadedSessionRecording)||null==t.onRRwebEmit||t.onRRwebEmit(e)}overrideLinkedFlag(){var e,t;this._lazyLoadedSessionRecording||(null==(t=this._instance.persistence)||t.register({$replay_override_linked_flag:!0}));null==(e=this._lazyLoadedSessionRecording)||e.overrideLinkedFlag()}overrideSampling(){var e,t;this._lazyLoadedSessionRecording||(null==(t=this._instance.persistence)||t.register({$replay_override_sampling:!0}));null==(e=this._lazyLoadedSessionRecording)||e.overrideSampling()}overrideTrigger(e){var t,r;this._lazyLoadedSessionRecording||(null==(r=this._instance.persistence)||r.register({["url"===e?"$replay_override_url_trigger":"$replay_override_event_trigger"]:!0}));null==(t=this._lazyLoadedSessionRecording)||t.overrideTrigger(e)}get sdkDebugProperties(){var e;return(null==(e=this._lazyLoadedSessionRecording)?void 0:e.sdkDebugProperties)||{$recording_status:this.status}}tryAddCustomEvent(e,t){var r;return!(null==(r=this._lazyLoadedSessionRecording)||!r.tryAddCustomEvent(e,t))}}var Mv={},Rv=()=>{},Pv="posthog",Av=!Nu&&-1===(null==rs?void 0:rs.indexOf("MSIE"))&&-1===(null==rs?void 0:rs.indexOf("Mozilla")),Nv=e=>{var t;return r({api_host:"https://us.i.posthog.com",flags_api_host:null,ui_host:null,token:"",autocapture:!0,cross_subdomain_cookie:Ss(null==Kn?void 0:Kn.location),persistence:"localStorage+cookie",persistence_name:"",loaded:Rv,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,debug:Jn&&ti(null==Jn?void 0:Jn.search)&&-1!==Jn.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:!0,disable_external_dependency_loading:!1,enable_recording_console_log:void 0,secure_cookie:"https:"===(null==zn||null==(t=zn.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_enable_surveys:!1,advanced_disable_toolbar_metrics:!1,feature_flag_request_timeout_ms:3e3,surveys_request_timeout_ms:1e4,on_request_error:e=>{var t="Bad HTTP status: "+e.statusCode+" "+e.text;ls.error(t)},get_device_id:e=>e,capture_performance:void 0,name:"posthog",bootstrap:{},disable_compression:!1,session_idle_timeout_seconds:1800,person_profiles:"identified_only",before_send:void 0,request_queue_config:{flush_interval_ms:sv},error_tracking:{},_onCapture:Rv,__preview_eager_load_replay:!1},(e=>({rageclick:!(e&&e>="2025-11-30")||{content_ignorelist:!0},capture_pageview:!(e&&e>="2025-05-24")||"history_change",session_recording:e&&e>="2025-11-30"?{strictMinimumDuration:!0}:{}}))(e))},Fv=e=>{var t={};ei(e.process_person)||(t.person_profiles=e.process_person),ei(e.xhr_headers)||(t.request_headers=e.xhr_headers),ei(e.cookie_name)||(t.persistence_name=e.cookie_name),ei(e.disable_cookie)||(t.disable_persistence=e.disable_cookie),ei(e.store_google)||(t.save_campaign_params=e.store_google),ei(e.verbose)||(t.debug=e.verbose);var r=ps({},t,e);return Yr(e.property_blacklist)&&(ei(e.property_denylist)?r.property_denylist=e.property_blacklist:Yr(e.property_denylist)?r.property_denylist=[...e.property_blacklist,...e.property_denylist]:ls.error("Invalid value for property_denylist config: "+e.property_denylist)),r};class Lv{constructor(){this.__forceAllowLocalhost=!1}get _forceAllowLocalhost(){return this.__forceAllowLocalhost}set _forceAllowLocalhost(e){ls.error("WebPerformanceObserver is deprecated and has no impact on network capture. Use `_forceAllowLocalhostNetworkCapture` on `posthog.sessionRecording`"),this.__forceAllowLocalhost=e}}class Ov{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(){this.webPerformance=new Lv,this._personProcessingSetOncePropertiesSent=!1,this.version=os.LIB_VERSION,this._internalEventEmitter=new Zp,this._calculate_event_properties=this.calculateEventProperties.bind(this),this.config=Nv(),this.SentryIntegration=ep,this.sentryIntegration=e=>function(e,t){var r=Qh(e,t);return{name:Jh,processEvent:e=>r(e)}}(this,e),this.__request_queue=[],this.__loaded=!1,this.analyticsDefaultEndpoint="/e/",this._initialPageviewCaptured=!1,this._visibilityStateListener=null,this._initialPersonProfilesConfig=null,this._cachedPersonProperties=null,this.featureFlags=new Vp(this),this.toolbar=new sp(this),this.scrollManager=new uv(this),this.pageViewManager=new Mp(this),this.surveys=new Jp(this),this.conversations=new ev(this),this.experiments=new wv(this),this.exceptions=new pd(this),this.rateLimiter=new rv(this),this.requestRouter=new bv(this),this.consent=new $h(this),this.externalIntegrations=new kv(this),this.people={set:(e,t,r)=>{var i=ti(e)?{[e]:t}:e;this.setPersonProperties(i),null==r||r({})},set_once:(e,t,r)=>{var i=ti(e)?{[e]:t}:e;this.setPersonProperties(void 0,i),null==r||r({})}},this.on("eventCaptured",(e=>ls.info('send "'+(null==e?void 0:e.event)+'"',e)))}init(e,t,r){if(r&&r!==Pv){var i,n=null!==(i=Mv[r])&&void 0!==i?i:new Ov;return n._init(e,t,r),Mv[r]=n,Mv[Pv][r]=n,n}return this._init(e,t,r)}_init(e,t,i){var n;if(void 0===t&&(t={}),ei(e)||ri(e))return ls.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._checkLocalStorageForDebug(t.debug),this._originalUserConfig=t,this._triggered_notifs=[],t.person_profiles&&(this._initialPersonProfilesConfig=t.person_profiles),this.set_config(ps({},Nv(t.defaults),Fv(t),{name:i,token:e})),this.config.on_xhr_error&&ls.error("on_xhr_error is deprecated. Use on_request_error instead"),this.compression=t.disable_compression?void 0:Xl.GZipJS;var s=this._is_persistence_disabled();this.persistence=new Up(this.config,s),this.sessionPersistence="sessionStorage"===this.config.persistence||"memory"===this.config.persistence?this.persistence:new Up(r({},this.config,{persistence:"sessionStorage"}),s);var o=r({},this.persistence.props),a=r({},this.sessionPersistence.props);this.register({$initialization_time:(new Date).toISOString()}),this._requestQueue=new ov((e=>this._send_retriable_request(e)),this.config.request_queue_config),this._retryQueue=new lv(this),this.__request_queue=[];var l="always"===this.config.cookieless_mode||"on_reject"===this.config.cookieless_mode&&this.consent.isExplicitlyOptedOut();if(l||(this.sessionManager=new pv(this),this.sessionPropsManager=new dv(this,this.sessionManager,this.persistence)),this.config.__preview_deferred_init_extensions?(ls.info("Deferring extension initialization to improve startup performance"),setTimeout((()=>{this._initExtensions(l)}),0)):(ls.info("Initializing extensions synchronously"),this._initExtensions(l)),os.DEBUG=os.DEBUG||this.config.debug,os.DEBUG&&ls.info("Starting in debug mode",{this:this,config:t,thisC:r({},this.config),p:o,s:a}),void 0!==(null==(n=t.bootstrap)?void 0:n.distinctID)){var u,c,d=this.config.get_device_id(Zl()),h=null!=(u=t.bootstrap)&&u.isIdentifiedID?d:t.bootstrap.distinctID;this.persistence.set_property(Qs,null!=(c=t.bootstrap)&&c.isIdentifiedID?"identified":"anonymous"),this.register({distinct_id:t.bootstrap.distinctID,$device_id:h})}if(this._hasBootstrappedFeatureFlags()){var p,v,g=Object.keys((null==(p=t.bootstrap)?void 0:p.featureFlags)||{}).filter((e=>{var r;return!(null==(r=t.bootstrap)||null==(r=r.featureFlags)||!r[e])})).reduce(((e,r)=>{var i;return e[r]=(null==(i=t.bootstrap)||null==(i=i.featureFlags)?void 0:i[r])||!1,e}),{}),_=Object.keys((null==(v=t.bootstrap)?void 0:v.featureFlagPayloads)||{}).filter((e=>g[e])).reduce(((e,r)=>{var i,n;null!=(i=t.bootstrap)&&null!=(i=i.featureFlagPayloads)&&i[r]&&(e[r]=null==(n=t.bootstrap)||null==(n=n.featureFlagPayloads)?void 0:n[r]);return e}),{});this.featureFlags.receivedFeatureFlags({featureFlags:g,featureFlagPayloads:_})}if(l)this.register_once({distinct_id:ao,$device_id:null},"");else if(!this.get_distinct_id()){var f=this.config.get_device_id(Zl());this.register_once({distinct_id:f,$device_id:f},""),this.persistence.set_property(Qs,"anonymous")}return Cs(zn,"onpagehide"in self?"pagehide":"unload",this._handle_unload.bind(this),{passive:!1}),this.toolbar.maybeLoadToolbar(),t.segment?Kh(this,(()=>this._loaded())):this._loaded(),Xr(this.config._onCapture)&&this.config._onCapture!==Rv&&(ls.warn("onCapture is deprecated. Please use `before_send` instead"),this.on("eventCaptured",(e=>this.config._onCapture(e.event,e)))),this.config.ip&&ls.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}_initExtensions(e){var t=performance.now();this.historyAutocapture=new Yh(this),this.historyAutocapture.startIfEnabled();var r=[];r.push((()=>{new ap(this).startIfEnabledOrStop()})),r.push((()=>{var e;this.siteApps=new _v(this),null==(e=this.siteApps)||e.init()})),e||r.push((()=>{this.sessionRecording=new Tv(this),this.sessionRecording.startIfEnabledOrStop()})),this.config.disable_scroll_properties||r.push((()=>{this.scrollManager.startMeasuringScrollPosition()})),r.push((()=>{this.autocapture=new Ih(this),this.autocapture.startIfEnabled()})),r.push((()=>{this.surveys.loadIfEnabled()})),r.push((()=>{this.conversations.loadIfEnabled()})),r.push((()=>{this.productTours=new jp(this),this.productTours.loadIfEnabled()})),r.push((()=>{this.heatmaps=new Tp(this),this.heatmaps.startIfEnabled()})),r.push((()=>{this.webVitalsAutocapture=new kp(this)})),r.push((()=>{this.exceptionObserver=new Gh(this),this.exceptionObserver.startIfEnabledOrStop()})),r.push((()=>{this.deadClicksAutocapture=new jh(this,zh),this.deadClicksAutocapture.startIfEnabled()})),r.push((()=>{if(this._pendingRemoteConfig){var e=this._pendingRemoteConfig;this._pendingRemoteConfig=void 0,this._onRemoteConfig(e)}})),this._processInitTaskQueue(r,t)}_processInitTaskQueue(e,t){for(;e.length>0;){if(this.config.__preview_deferred_init_extensions)if(performance.now()-t>=30&&e.length>0)return void setTimeout((()=>{this._processInitTaskQueue(e,t)}),0);var r=e.shift();if(r)try{r()}catch(e){ls.error("Error initializing extension:",e)}}var i=Math.round(performance.now()-t);this.register_for_session({$sdk_debug_extensions_init_method:this.config.__preview_deferred_init_extensions?"deferred":"synchronous",$sdk_debug_extensions_init_time_ms:i}),this.config.__preview_deferred_init_extensions&&ls.info("PostHog extensions initialized ("+i+"ms)")}_onRemoteConfig(e){var t,r,i,n,s,o,a,l,u;if(!Kn||!Kn.body)return ls.info("document not ready yet, trying again in 500 milliseconds..."),void setTimeout((()=>{this._onRemoteConfig(e)}),500);this.config.__preview_deferred_init_extensions&&(this._pendingRemoteConfig=e),this.compression=void 0,e.supportedCompression&&!this.config.disable_compression&&(this.compression=$r(e.supportedCompression,Xl.GZipJS)?Xl.GZipJS:$r(e.supportedCompression,Xl.Base64)?Xl.Base64:void 0),null!=(t=e.analytics)&&t.endpoint&&(this.analyticsDefaultEndpoint=e.analytics.endpoint),this.set_config({person_profiles:this._initialPersonProfilesConfig?this._initialPersonProfilesConfig:"identified_only"}),null==(r=this.siteApps)||r.onRemoteConfig(e),null==(i=this.sessionRecording)||i.onRemoteConfig(e),null==(n=this.autocapture)||n.onRemoteConfig(e),null==(s=this.heatmaps)||s.onRemoteConfig(e),this.surveys.onRemoteConfig(e),this.conversations.onRemoteConfig(e),null==(o=this.productTours)||o.onRemoteConfig(e),null==(a=this.webVitalsAutocapture)||a.onRemoteConfig(e),null==(l=this.exceptionObserver)||l.onRemoteConfig(e),this.exceptions.onRemoteConfig(e),null==(u=this.deadClicksAutocapture)||u.onRemoteConfig(e)}_loaded(){try{this.config.loaded(this)}catch(e){ls.critical("`loaded` function failed",e)}this._start_queue_if_opted_in(),this.config.capture_pageview&&setTimeout((()=>{(this.consent.isOptedIn()||"always"===this.config.cookieless_mode)&&this._captureInitialPageview()}),1),new nv(this).load(),this.featureFlags.flags()}_start_queue_if_opted_in(){var e;this.is_capturing()&&(this.config.request_batching&&(null==(e=this._requestQueue)||e.enable()))}_dom_loaded(){this.is_capturing()&&ds(this.__request_queue,(e=>this._send_retriable_request(e))),this.__request_queue=[],this._start_queue_if_opted_in()}_handle_unload(){var e,t;this.surveys.handlePageUnload(),this.config.request_batching?(this._shouldCapturePageleave()&&this.capture("$pageleave"),null==(e=this._requestQueue)||e.unload(),null==(t=this._retryQueue)||t.unload()):this._shouldCapturePageleave()&&this.capture("$pageleave",null,{transport:"sendBeacon"})}_send_request(e){this.__loaded&&(Av?this.__request_queue.push(e):this.rateLimiter.isServerRateLimited(e.batchKey)||(e.transport=e.transport||this.config.api_transport,e.url=Lu(e.url,{ip:this.config.ip?1:0}),e.headers=r({},this.config.request_headers,e.headers),e.compression="best-available"===e.compression?this.compression:e.compression,e.disableXHRCredentials=this.config.__preview_disable_xhr_credentials,this.config.__preview_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=Lu(s.url,{_:(new Date).getTime().toString(),ver:os.LIB_VERSION,compression:s.compression});var o=null!==(t=s.transport)&&void 0!==t?t:"fetch",a=Hu.filter((e=>!s.disableTransport||!e.transport||!s.disableTransport.includes(e.transport))),l=null!==(i=null==(n=ws(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");l(s)})(r({},e,{callback:t=>{var r,i;(this.rateLimiter.checkForLimiting(t),t.statusCode>=400)&&(null==(r=(i=this.config).on_request_error)||r.call(i,t));null==e.callback||e.callback(t)}}))))}_send_retriable_request(e){this._retryQueue?this._retryQueue.retriableRequest(e):this._send_request(e)}_execute_array(e){var t,r=[],i=[],n=[];ds(e,(e=>{e&&(t=e[0],Yr(t)?n.push(e):Xr(e)?e.call(this):Yr(e)&&"alias"===t?r.push(e):Yr(e)&&-1!==t.indexOf("capture")&&Xr(this[t])?n.push(e):i.push(e))}));var s=function(e,t){ds(e,(function(e){if(Yr(e[0])){var r=t;hs(e,(function(e){r=r[e[0]].apply(r,e.slice(1))}))}else this[e[0]].apply(this,e.slice(1))}),t)};s(r,this),s(i,this),s(n,this)}_hasBootstrappedFeatureFlags(){var e,t;return(null==(e=this.config.bootstrap)?void 0:e.featureFlags)&&Object.keys(null==(t=this.config.bootstrap)?void 0:t.featureFlags).length>0||!1}push(e){this._execute_array([e])}capture(e,t,i){var n;if(this.__loaded&&this.persistence&&this.sessionPersistence&&this._requestQueue){if(this.is_capturing())if(!ei(e)&&ti(e)){var s=!this.config.opt_out_useragent_filter&&this._is_bot();if(!(s&&!this.config.__preview_capture_bot_pageviews)){var o=null!=i&&i.skip_client_rate_limiting?void 0:this.rateLimiter.clientRateLimitContext();if(null==o||!o.isRateLimited){null!=t&&t.$current_url&&!ti(null==t?void 0:t.$current_url)&&(ls.error("Invalid `$current_url` property provided to `posthog.capture`. Input must be a string. Ignoring provided value."),null==t||delete t.$current_url),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 a=new Date,l=(null==i?void 0:i.timestamp)||a,u=Zl(),c={uuid:u,event:e,properties:this.calculateEventProperties(e,t||{},l,u)};"$pageview"===e&&this.config.__preview_capture_bot_pageviews&&s&&(c.event="$bot_pageview",c.properties.$browser_type="bot"),o&&(c.properties.$lib_rate_limit_remaining_tokens=o.remainingTokens),(null==i?void 0:i.$set)&&(c.$set=null==i?void 0:i.$set);var d="$groupidentify"!==e,h=this._calculate_set_once_properties(null==i?void 0:i.$set_once,d);if(h&&(c.$set_once=h),(c=ys(c,null!=i&&i._noTruncate?null:this.config.properties_string_max_length)).timestamp=l,ei(null==i?void 0:i.timestamp)||(c.properties.$event_time_override_provided=!0,c.properties.$event_time_override_system_time=a),e===El.DISMISSED||e===El.SENT){var p=null==t?void 0:t[xl.SURVEY_ID],v=null==t?void 0:t[xl.SURVEY_ITERATION];Hl({id:p,current_iteration:v}),c.$set=r({},c.$set,{[Ll({id:p,current_iteration:v},e===El.SENT?"responded":"dismissed")]:!0})}var g=r({},c.properties.$set,c.$set);if(Qr(g)||this.setPersonPropertiesForFlags(g),!ni(this.config.before_send)){var _=this._runBeforeSend(c);if(!_)return;c=_}this._internalEventEmitter.emit("eventCaptured",c);var f={method:"POST",url:null!==(n=null==i?void 0:i._url)&&void 0!==n?n:this.requestRouter.endpointFor("api",this.analyticsDefaultEndpoint),data:c,compression:"best-available",batchKey:null==i?void 0:i._batchKey};return!this.config.request_batching||i&&(null==i||!i._batchKey)||null!=i&&i.send_instantly?this._send_retriable_request(f):this._requestQueue.enqueue(f),c}ls.critical("This capture call is ignored due to client rate limiting.")}}else ls.error("No event name provided to posthog.capture")}else ls.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,("always"==this.config.cookieless_mode||"on_reject"==this.config.cookieless_mode&&this.consent.isExplicitlyOptedOut())&&(a.$cookieless_mode=!0),"$snapshot"===e){var l=r({},this.persistence.properties(),this.sessionPersistence.properties());return a.distinct_id=l.distinct_id,(!ti(a.distinct_id)&&!si(a.distinct_id)||ri(a.distinct_id))&&ls.error("Invalid distinct_id for replay event. This indicates a bug in your implementation"),a}var u,c=wp(this.config.mask_personal_data_properties,this.config.custom_personal_data_properties);if(this.sessionManager){var{sessionId:d,windowId:h}=this.sessionManager.checkAndGetSessionAndWindowId(s,i.getTime());a.$session_id=d,a.$window_id=h}this.sessionPropsManager&&ps(a,this.sessionPropsManager.getSessionProps());try{var p;this.sessionRecording&&ps(a,this.sessionRecording.sdkDebugProperties),a.$sdk_debug_retry_queue_size=null==(p=this._retryQueue)?void 0:p.length}catch(e){a.$sdk_debug_error_capturing_properties=String(e)}if(this.requestRouter.region===mv.CUSTOM&&(a.$lib_custom_api_host=this.config.api_host),u="$pageview"!==e||s?"$pageleave"!==e||s?this.pageViewManager.doEvent():this.pageViewManager.doPageLeave(i):this.pageViewManager.doPageView(i,n),a=ps(a,u),"$pageview"===e&&Kn&&(a.title=Kn.title),!ei(o)){var v=i.getTime()-o;a.$duration=parseFloat((v/1e3).toFixed(3))}rs&&this.config.opt_out_useragent_filter&&(a.$browser_type=this._is_bot()?"bot":"browser"),(a=ps({},c,this.persistence.properties(),this.sessionPersistence.properties(),a)).$is_identified=this._isIdentified(),Yr(this.config.property_denylist)?hs(this.config.property_denylist,(function(e){delete a[e]})):ls.error("Invalid value for property_denylist config: "+this.config.property_denylist+" or property_blacklist config: "+this.config.property_blacklist);var g=this.config.sanitize_properties;g&&(ls.error("sanitize_properties is deprecated. Use before_send instead"),a=g(a,e));var _=this._hasPersonProcessing();return a.$process_person_profile=_,_&&!s&&this._requirePersonProcessing("_calculate_event_properties"),a}_calculate_set_once_properties(e,t){var r;if(void 0===t&&(t=!0),!this.persistence||!this._hasPersonProcessing())return e;if(this._personProcessingSetOncePropertiesSent)return e;var i=this.persistence.get_initial_props(),n=null==(r=this.sessionPropsManager)?void 0:r.getSetOnceProps(),s=ps({},i,n||{},e||{}),o=this.config.sanitize_properties;return o&&(ls.error("sanitize_properties is deprecated. Use before_send instead"),s=o(s,"$set_once")),t&&(this._personProcessingSetOncePropertiesSent=!0),Qr(s)?void 0:s}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)}_register_single(e,t){this.register({[e]:t})}getFeatureFlag(e,t){return this.featureFlags.getFeatureFlag(e,t)}getFeatureFlagPayload(e){var t=this.featureFlags.getFeatureFlagPayload(e);try{return JSON.parse(t)}catch(e){return t}}isFeatureEnabled(e,t){return this.featureFlags.isFeatureEnabled(e,t)}reloadFeatureFlags(){this.featureFlags.reloadFeatureFlags()}updateFlags(e,t,i){var n=null!=i&&i.merge?this.featureFlags.getFlagVariants():{},s=null!=i&&i.merge?this.featureFlags.getFlagPayloads():{},o=r({},n,e),a=r({},s,t),l={};for(var[u,c]of Object.entries(o)){var d="string"==typeof c;l[u]={key:u,enabled:!!d||Boolean(c),variant:d?c:void 0,reason:void 0,metadata:ei(null==a?void 0:a[u])?void 0:{id:0,version:void 0,description:void 0,payload:a[u]}}}this.featureFlags.receivedFeatureFlags({flags:l})}updateEarlyAccessFeatureEnrollment(e,t,r){this.featureFlags.updateEarlyAccessFeatureEnrollment(e,t,r)}getEarlyAccessFeatures(e,t,r){return void 0===t&&(t=!1),this.featureFlags.getEarlyAccessFeatures(e,t,r)}on(e,t){return this._internalEventEmitter.on(e,t)}onFeatureFlags(e){return this.featureFlags.onFeatureFlags(e)}onSurveysLoaded(e){return this.surveys.onSurveysLoaded(e)}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.getSurveys(e,t)}getActiveMatchingSurveys(e,t){void 0===t&&(t=!1),this.surveys.getActiveMatchingSurveys(e,t)}renderSurvey(e,t){this.surveys.renderSurvey(e,t)}displaySurvey(e,t){void 0===t&&(t=Bl),this.surveys.displaySurvey(e,t)}cancelPendingSurvey(e){this.surveys.cancelPendingSurvey(e)}canRenderSurvey(e){return this.surveys.canRenderSurvey(e)}canRenderSurveyAsync(e,t){return void 0===t&&(t=!1),this.surveys.canRenderSurveyAsync(e,t)}identify(e,t,i){if(!this.__loaded||!this.persistence)return ls.uninitializedWarning("posthog.identify");if(si(e)&&(e=e.toString(),ls.warn("The first argument to posthog.identify was a number, but it should be a string. It has been converted to a string.")),e)if(["distinct_id","distinctid"].includes(e.toLowerCase()))ls.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.');else if(e!==ao){if(this._requirePersonProcessing("posthog.identify")){var n=this.get_distinct_id();if(this.register({$user_id:e}),!this.get_property("$device_id")){var s=n;this.register_once({$had_persisted_distinct_id:!0,$device_id:s},"")}e!==n&&e!==this.get_property(As)&&(this.unregister(As),this.register({distinct_id:e}));var o="anonymous"===(this.persistence.get_property(Qs)||"anonymous");e!==n&&o?(this.persistence.set_property(Qs,"identified"),this.setPersonPropertiesForFlags(r({},i||{},t||{}),!1),this.capture("$identify",{distinct_id:e,$anon_distinct_id:n},{$set:t||{},$set_once:i||{}}),this._cachedPersonProperties=Bu(e,t,i),this.featureFlags.setAnonymousDistinctId(n)):(t||i)&&this.setPersonProperties(t,i),e!==n&&(this.reloadFeatureFlags(),this.unregister(Js))}}else ls.critical('The string "'+ao+'" was set in posthog.identify which indicates an error. This ID is only used as a sentinel value.');else ls.error("Unique user id has not been set in posthog.identify")}setPersonProperties(e,t){if((e||t)&&this._requirePersonProcessing("posthog.setPersonProperties")){var i=Bu(this.get_distinct_id(),e,t);this._cachedPersonProperties!==i?(this.setPersonPropertiesForFlags(r({},t||{},e||{})),this.capture("$set",{$set:e||{},$set_once:t||{}}),this._cachedPersonProperties=i):ls.info("A duplicate setPersonProperties call was made with the same properties. It has been ignored.")}}group(e,t,i){if(e&&t){var n=this.getGroups();n[e]!==t&&this.resetGroupPropertiesForFlags(e),this.register({$groups:r({},n,{[e]:t})}),i&&(this.capture("$groupidentify",{$group_type:e,$group_key:t,$group_set:i}),this.setGroupPropertiesForFlags({[e]:i})),n[e]===t||i||this.reloadFeatureFlags()}else ls.error("posthog.group requires a group type and group key")}resetGroups(){this.register({$groups:{}}),this.resetGroupPropertiesForFlags(),this.reloadFeatureFlags()}setPersonPropertiesForFlags(e,t){void 0===t&&(t=!0),this.featureFlags.setPersonPropertiesForFlags(e,t)}resetPersonPropertiesForFlags(){this.featureFlags.resetPersonPropertiesForFlags()}setGroupPropertiesForFlags(e,t){void 0===t&&(t=!0),this._requirePersonProcessing("posthog.setGroupPropertiesForFlags")&&this.featureFlags.setGroupPropertiesForFlags(e,t)}resetGroupPropertiesForFlags(e){this.featureFlags.resetGroupPropertiesForFlags(e)}reset(e){var t,r,i,n;if(ls.info("reset"),!this.__loaded)return ls.uninitializedWarning("posthog.reset");var s=this.get_property("$device_id");if(this.consent.reset(),null==(t=this.persistence)||t.clear(),null==(r=this.sessionPersistence)||r.clear(),this.surveys.reset(),this.featureFlags.reset(),null==(i=this.persistence)||i.set_property(Qs,"anonymous"),null==(n=this.sessionManager)||n.resetSessionId(),this._cachedPersonProperties=null,"always"===this.config.cookieless_mode)this.register_once({distinct_id:ao,$device_id:null},"");else{var o=this.config.get_device_id(Zl());this.register_once({distinct_id:o,$device_id:e?o:s},"")}this.register({$last_posthog_reset:(new Date).toISOString()},1)}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(Ps)?(ls.critical("Attempting to create alias for existing People user - aborting."),-2):this._requirePersonProcessing("posthog.alias")?(ei(t)&&(t=this.get_distinct_id()),e!==t?(this._register_single(As,e),this.capture("$create_alias",{alias:e,distinct_id:t})):(ls.warn("alias matches current distinct_id - skipping api call."),this.identify(e),-1)):void 0}set_config(e){var t=r({},this.config);if(Jr(e)){var i,n,s,o,a,l,u;ps(this.config,Fv(e));var c=this._is_persistence_disabled();null==(i=this.persistence)||i.update_config(this.config,t,c),this.sessionPersistence="sessionStorage"===this.config.persistence||"memory"===this.config.persistence?this.persistence:new Up(r({},this.config,{persistence:"sessionStorage"}),c);var d=this._checkLocalStorageForDebug(this.config.debug);oi(d)&&(this.config.debug=d),oi(this.config.debug)&&(this.config.debug?(os.DEBUG=!0,Fh._is_supported()&&Fh._set("ph_debug","true"),ls.info("set_config",{config:e,oldConfig:t,newConfig:r({},this.config)})):(os.DEBUG=!1,Fh._is_supported()&&Fh._remove("ph_debug"))),null==(n=this.exceptionObserver)||n.onConfigChange(),null==(s=this.sessionRecording)||s.startIfEnabledOrStop(),null==(o=this.autocapture)||o.startIfEnabled(),null==(a=this.heatmaps)||a.startIfEnabled(),null==(l=this.exceptionObserver)||l.startIfEnabledOrStop(),this.surveys.loadIfEnabled(),this._sync_opt_out_with_persistence(),null==(u=this.externalIntegrations)||u.startIfEnabledOrStop()}}startSessionRecording(e){var t=!0===e,r={sampling:t||!(null==e||!e.sampling),linked_flag:t||!(null==e||!e.linked_flag),url_trigger:t||!(null==e||!e.url_trigger),event_trigger:t||!(null==e||!e.event_trigger)};if(Object.values(r).some(Boolean)){var i,n,s,o,a;if(null==(i=this.sessionManager)||i.checkAndGetSessionAndWindowId(),r.sampling)null==(n=this.sessionRecording)||n.overrideSampling();if(r.linked_flag)null==(s=this.sessionRecording)||s.overrideLinkedFlag();if(r.url_trigger)null==(o=this.sessionRecording)||o.overrideTrigger("url");if(r.event_trigger)null==(a=this.sessionRecording)||a.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){var i=new Error("PostHog syntheticException"),n=this.exceptions.buildProperties(e,{handled:!0,syntheticException:i});return this.exceptions.sendExceptionEvent(r({},n,t))}startExceptionAutocapture(e){this.set_config({capture_exceptions:null==e||e})}stopExceptionAutocapture(){this.set_config({capture_exceptions:!1})}loadToolbar(e){return this.toolbar.loadToolbar(e)}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:Pv;return t!==Pv&&(t=Pv+"."+t),t}_isIdentified(){var e,t;return"identified"===(null==(e=this.persistence)?void 0:e.get_property(Qs))||"identified"===(null==(t=this.sessionPersistence)?void 0:t.get_property(Qs))}_hasPersonProcessing(){var e,t;return!("never"===this.config.person_profiles||"identified_only"===this.config.person_profiles&&!this._isIdentified()&&Qr(this.getGroups())&&(null==(e=this.persistence)||null==(e=e.props)||!e[As])&&(null==(t=this.persistence)||null==(t=t.props)||!t[so]))}_shouldCapturePageleave(){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._hasPersonProcessing()||this._requirePersonProcessing("posthog.createPersonProfile")&&this.setPersonProperties({},{})}_requirePersonProcessing(e){return"never"===this.config.person_profiles?(ls.error(e+' was called, but process_person is set to "never". This call will be ignored.'),!1):(this._register_single(so,!0),!0)}_is_persistence_disabled(){if("always"===this.config.cookieless_mode)return!0;var e=this.consent.isOptedOut(),t=this.config.opt_out_persistence_by_default||"on_reject"===this.config.cookieless_mode;return this.config.disable_persistence||e&&!!t}_sync_opt_out_with_persistence(){var e,t,r,i,n=this._is_persistence_disabled();(null==(e=this.persistence)?void 0:e._disabled)!==n&&(null==(r=this.persistence)||r.set_disabled(n));(null==(t=this.sessionPersistence)?void 0:t._disabled)!==n&&(null==(i=this.sessionPersistence)||i.set_disabled(n));return n}opt_in_capturing(e){var t;if("always"!==this.config.cookieless_mode){var r,i,n;if("on_reject"===this.config.cookieless_mode&&this.consent.isExplicitlyOptedOut())this.reset(!0),null==(r=this.sessionManager)||r.destroy(),null==(i=this.pageViewManager)||i.destroy(),this.sessionManager=new pv(this),this.pageViewManager=new Mp(this),this.persistence&&(this.sessionPropsManager=new dv(this,this.sessionManager,this.persistence)),this.sessionRecording=new Tv(this),this.sessionRecording.startIfEnabledOrStop();if(this.consent.optInOut(!0),this._sync_opt_out_with_persistence(),this._start_queue_if_opted_in(),null==(t=this.sessionRecording)||t.startIfEnabledOrStop(),"on_reject"==this.config.cookieless_mode&&this.surveys.loadIfEnabled(),ei(null==e?void 0:e.captureEventName)||null!=e&&e.captureEventName)this.capture(null!==(n=null==e?void 0:e.captureEventName)&&void 0!==n?n:"$opt_in",null==e?void 0:e.captureProperties,{send_instantly:!0});this.config.capture_pageview&&this._captureInitialPageview()}else ls.warn('Consent opt in/out is not valid with cookieless_mode="always" and will be ignored')}opt_out_capturing(){var e,t,r;"always"!==this.config.cookieless_mode?("on_reject"===this.config.cookieless_mode&&this.consent.isOptedIn()&&this.reset(!0),this.consent.optInOut(!1),this._sync_opt_out_with_persistence(),"on_reject"===this.config.cookieless_mode&&(this.register({distinct_id:ao,$device_id:null}),null==(e=this.sessionManager)||e.destroy(),null==(t=this.pageViewManager)||t.destroy(),this.sessionManager=void 0,this.sessionPropsManager=void 0,null==(r=this.sessionRecording)||r.stopRecording(),this.sessionRecording=void 0,this._captureInitialPageview())):ls.warn('Consent opt in/out is not valid with cookieless_mode="always" and will be ignored')}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 e===Vh.GRANTED?"granted":e===Vh.DENIED?"denied":"pending"}is_capturing(){return"always"===this.config.cookieless_mode||("on_reject"===this.config.cookieless_mode?this.consent.isExplicitlyOptedOut()||this.consent.isOptedIn():!this.has_opted_out_capturing())}clear_opt_in_out_capturing(){this.consent.reset(),this._sync_opt_out_with_persistence()}_is_bot(){return Xn?fv(Xn,this.config.custom_blocked_useragents):void 0}_captureInitialPageview(){Kn&&("visible"===Kn.visibilityState?this._initialPageviewCaptured||(this._initialPageviewCaptured=!0,this.capture("$pageview",{title:Kn.title},{send_instantly:!0}),this._visibilityStateListener&&(Kn.removeEventListener("visibilitychange",this._visibilityStateListener),this._visibilityStateListener=null)):this._visibilityStateListener||(this._visibilityStateListener=this._captureInitialPageview.bind(this),Cs(Kn,"visibilitychange",this._visibilityStateListener)))}debug(e){!1===e?(null==zn||zn.console.log("You've disabled debug mode."),this.set_config({debug:!1})):(null==zn||zn.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}))}_shouldDisableFlags(){var e,t,r,i,n,s,o,a=this._originalUserConfig||{};return"advanced_disable_flags"in a?!!a.advanced_disable_flags:!1!==this.config.advanced_disable_flags?!!this.config.advanced_disable_flags:!0===this.config.advanced_disable_decide?(ls.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",i=!1,n=ls,s=(t="advanced_disable_flags")in(e=a)&&!ei(e[t]),o=r in e&&!ei(e[r]),s?e[t]:o?(n&&n.warn("Config field '"+r+"' is deprecated. Please use '"+t+"' instead. The old field will be removed in a future major version."),e[r]):i)}_runBeforeSend(e){if(ni(this.config.before_send))return e;var t=Yr(this.config.before_send)?this.config.before_send:[this.config.before_send],r=e;for(var i of t){if(r=i(r),ni(r)){var n="Event '"+e.event+"' was rejected in beforeSend function";return li(e.event)?ls.warn(n+". This can cause unexpected behavior."):ls.info(n),null}r.properties&&!Qr(r.properties)||ls.warn("Event '"+e.event+"' has no properties after beforeSend function, this is likely an error.")}return r}getPageViewId(){var e;return null==(e=this.pageViewManager._currentPageview)?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)})}_checkLocalStorageForDebug(e){var t=oi(e)&&!e,r=Fh._is_supported()&&"true"===Fh._get("ph_debug");return!t&&(!!r||e)}}!function(e,t){for(var r=0;r<t.length;r++)e.prototype[t[r]]=fs(e.prototype[t[r]])}(Ov,["identify"]);var Dv,Hv={backgroundColor:"#ffffff",textColor:"#1d1f27",buttonColor:"#1d1f27",borderRadius:8,buttonBorderRadius:6,borderColor:"#e5e7eb",fontFamily:"system-ui",boxShadow:"0 4px 12px rgba(0, 0, 0, 0.15)",showOverlay:!0,whiteLabel:!1},qv=(Dv=Mv[Pv]=new Ov,function(){function e(){e.done||(e.done=!0,Av=!1,hs(Mv,(function(e){e._dom_loaded()})))}null!=Kn&&Kn.addEventListener?"complete"===Kn.readyState?e():Cs(Kn,"DOMContentLoaded",e,{capture:!1}):zn&&ls.error("Browser doesn't support `document.addEventListener` so PostHog couldn't be initialized")}(),Dv);export{Yl as COPY_AUTOCAPTURE_EVENT,Xl as Compression,Hv as DEFAULT_PRODUCT_TOUR_APPEARANCE,Tl as DisplaySurveyType,Ov as PostHog,El as SurveyEventName,xl as SurveyEventProperties,ml as SurveyEventType,bl as SurveyPosition,Il as SurveyQuestionBranchingType,Cl as SurveyQuestionType,kl as SurveySchedule,Sl as SurveyTabPosition,wl as SurveyType,yl as SurveyWidgetType,qv as default,qv as posthog,Kl as severityLevels};
2
2
  //# sourceMappingURL=module.full.no-external.js.map