posthog-js 1.371.2 → 1.371.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,2 +1,2 @@
1
- !function(){"use strict";function e(e,t,r,i,n,s,o){try{var a=e[s](o),l=a.value}catch(e){return void r(e)}a.done?t(l):Promise.resolve(l).then(i,n)}function t(t){return function(){var r=this,i=arguments;return new Promise((function(n,s){var o=t.apply(r,i);function a(t){e(o,n,s,a,l,"next",t)}function l(t){e(o,n,s,a,l,"throw",t)}a(void 0)}))}}function r(){return r=Object.assign?Object.assign.bind():function(e){for(var t=1;arguments.length>t;t++){var r=arguments[t];for(var i in r)({}).hasOwnProperty.call(r,i)&&(e[i]=r[i])}return e},r.apply(null,arguments)}function i(e,t){if(null==e)return{};var r={};for(var i in e)if({}.hasOwnProperty.call(e,i)){if(-1!==t.indexOf(i))continue;r[i]=e[i]}return r}var n,s=["type"],o=Object.defineProperty,a=(e,t,r)=>((e,t,r)=>t in e?o(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r)(e,"symbol"!=typeof t?t+"":t,r),l=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"]},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:e=>_("Node",e,"childNodes"),parentNode:e=>_("Node",e,"parentNode"),parentElement:e=>_("Node",e,"parentElement"),textContent:e=>_("Node",e,"textContent"),contains:(e,t)=>m("Node",e,"contains")(t),getRootNode:e=>m("Node",e,"getRootNode")(),host:e=>e&&"host"in e?_("ShadowRoot",e,"host"):null,styleSheets:e=>e.styleSheets,shadowRoot:e=>e&&"shadowRoot"in e?_("Element",e,"shadowRoot"):null,querySelector:(e,t)=>_("Element",e,"querySelector")(t),querySelectorAll:(e,t)=>_("Element",e,"querySelectorAll")(t),mutationObserver:()=>v("MutationObserver").constructor};function b(e){return e.nodeType===e.ELEMENT_NODE}function w(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 S(e){return"[object ShadowRoot]"==={}.toString.call(e)}function C(e){try{var t=e.rules||e.cssRules;return t?((r=Array.from(t,(t=>I(t,e.href))).join("")).includes(" background-clip: text;")&&!r.includes(" -webkit-background-clip: text;")&&(r=r.replace(/\sbackground-clip:\s*text;/g," -webkit-background-clip: text; background-clip: text;")),r):null}catch(e){return null}var r}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(3>t.split('"').length)return t;var r=["@import","url("+JSON.stringify(e.href)+")"];return""===e.layerName?r.push("layer"):e.layerName&&r.push("layer("+e.layerName+")"),e.supportsText&&r.push("supports("+e.supportsText+")"),e.media.length&&r.push(e.media.mediaText),r.join(" ")+";"}(e)}catch(t){r=e.cssText}return e.styleSheet.href?O(r,e.styleSheet.href):r}var i=e.cssText;return function(e){return"selectorText"in e}(e)&&e.selectorText.includes(":")&&(i=i.replace(/(\[(?:[\w-]+)[^\\])(:(?:[\w-]+)\])/gm,"$1\\$2")),t?O(i,t):i}function x(e,t){return Array.from(e.styleSheets).find((e=>e.href===t))}let k=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){this.idNodeMap.set(t.id,e),this.nodeMetaMap.set(e,t)}replace(e,t){var r=this.getNode(e);if(r){var i=this.nodeMetaMap.get(r);i&&this.nodeMetaMap.set(t,i)}this.idNodeMap.set(e,t)}reset(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap}};function E(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 R="__rrweb_original__";function M(e){var t=e.type;return e.hasAttribute("data-rr-is-password")?"password":t?T(t):null}function L(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 P=/url\((?:(')([^']*)'|(")(.*?)"|([^)]*))\)/gm,A=/^(?:[a-z+]+:)?\/\//i,F=/^www\..*/i,N=/^(data:)([^,]*),(.*)/i;function O(e,t){return(e||"").replace(P,((e,r,i,n,s,o)=>{var a,l=i||s||o,u=r||n||"";if(!l)return e;if(A.test(l)||F.test(l))return"url("+u+l+u+")";if(N.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,B,H=1,q=new RegExp("[^a-z0-9-_:]"),V=-2;function U(){return H++}var j=/^[^ \t\n\r\u000c]+/,z=/^[, \t\n\r\u000c]+/,W=new WeakMap;function Z(e,t){return t&&""!==t.trim()?G(e,t):t}function G(e,t){var r=W.get(e);if(r||(r=e.createElement("a"),W.set(e,r)),t){if(t.startsWith("blob:")||t.startsWith("data:"))return t}else t="";return r.setAttribute("href",t),r.href}function Y(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?(r+=(i=n[0]).length,i):""}for(var n=[];i(z),t.length>r;){var s=i(j);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,G(e)):"object"===t&&"data"===r?Z(e,i):i:Z(e,i):i}function X(e,t,r){return("video"===e||"audio"===e)&&"autoplay"===t}function K(e,t,r){if(!e)return!1;if(e.nodeType!==e.ELEMENT_NODE)return!!r&&K(y.parentNode(e),t,r);for(var i=e.classList.length;i--;)if(t.test(e.classList[i]))return!0;return!!r&&K(y.parentNode(e),t,r)}function J(e,t,r,i){var n;if(b(e)){if(!y.childNodes(n=e).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(K(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 Q(e){return null==e?"":e.toLowerCase()}function ee(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:I,iframeLoadTimeout:k=5e3,onStylesheetLoad:P,stylesheetLoadTimeout:A=5e3,keepIframeSrcFn:F=(()=>!1),newlyAddedElement:N=!1}=t,{needsMask:H}=t,{preserveWhiteSpace:j=!0}=t;H||(H=J(e,o,a,void 0===H));var z,W=function(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)){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--;)if(t.test(e.classList[i]))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 q.test(t)?"div":t}(e),m={},b=e.attributes.length,w=0;b>w;w++){var S=e.attributes[w];X(f,S.name)||(m[S.name]=Y(i,f,T(S.name),S.value))}if("link"===f&&o){var I=function(e){return null==e?void 0:e.href}(e);if(I){var k=x(i,I);!k&&I.includes(".css")&&(k=x(i,window.location.origin+"/"+I.replace(window.location.href,"")));var L=null;k&&(L=C(k)),L&&(delete m.rel,delete m.href,m._cssText=L)}}if("style"===f&&e.sheet&&!(e.innerText||y.textContent(e)||"").trim().length){var P=C(e.sheet);P&&(m._cssText=P)}if("input"===f||"textarea"===f||"select"===f){var A=e.value,F=e.checked;"radio"!==m.type&&"checkbox"!==m.type&&"submit"!==m.type&&"button"!==m.type&&A?m.value=E({element:e,type:M(e),tagName:f,value:A,maskInputOptions:a,maskInputFn:l}):F&&(m.checked=F)}if("option"===f&&(e.selected&&!a.select?m.selected=!0:delete m.selected),"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;e.width>r;r+=50)for(var i=0;e.height>i;i+=50){var n=t.getImageData;if(new Uint32Array((R in n?n[R]:n).call(t,r,i,Math.min(50,e.width-r),Math.min(50,e.height-i)).data.buffer).some((e=>0!==e)))return!1}return!0})(e)||(m.rr_dataURL=e.toDataURL(u.type,u.quality));else if(!("__context"in e)){var N=e.toDataURL(u.type,u.quality),O=i.createElement("canvas");O.width=e.width,O.height=e.height,N!==O.toDataURL(u.type,u.quality)&&(m.rr_dataURL=N)}if("img"===f&&d){D||(D=i.createElement("canvas"),B=D.getContext("2d"));var H=e,V=H.currentSrc||H.getAttribute("src")||"<unknown-src>",U=H.crossOrigin,j=()=>{H.removeEventListener("load",j);try{D.width=H.naturalWidth,D.height=H.naturalHeight,B.drawImage(H,0,0),m.rr_dataURL=D.toDataURL(u.type,u.quality)}catch(e){if("anonymous"!==H.crossOrigin)return H.crossOrigin="anonymous",void(H.complete&&0!==H.naturalWidth?j():H.addEventListener("load",j));console.warn("Cannot inline img src="+V+"! Error: "+e)}"anonymous"===H.crossOrigin&&(U?m.crossOrigin=U:H.removeAttribute("crossorigin"))};H.complete&&0!==H.naturalWidth?j():H.addEventListener("load",j)}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}if(v||(e.scrollLeft&&(m.rr_scrollLeft=e.scrollLeft),e.scrollTop&&(m.rr_scrollTop=e.scrollTop)),_){var{width:W,height:Z}=e.getBoundingClientRect();m={class:m.class,rr_width:W+"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,Boolean("svg"===G.tagName||G.ownerSVGElement)||void 0),needBlock:_,rootId:g,isCustom:r};var G}(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,G(t.doc))}return d&&(l="SCRIPT_PLACEHOLDER"),!u&&!d&&l&&i&&(l=n?n(l,y.parentElement(e)):l.replace(/[\S]/g,"*")),{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}}(e,{doc:r,mirror:i,blockClass:n,blockSelector:s,needsMask:H,inlineStylesheet:u,maskInputOptions:d,maskTextFn:h,maskInputFn:p,dataURLOptions:g,inlineImages:_,recordCanvas:f,keepIframeSrcFn:F,newlyAddedElement:N});if(!W)return console.warn(e,"not serialized"),null;z=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"===L(e.attributes.href)))return!0;if(t.headFavicon&&("link"===e.tagName&&"shortcut icon"===e.attributes.rel||"meta"===e.tagName&&(Q(e.attributes.name).match(/^msapplication-tile(image|color)$/)||"application-name"===Q(e.attributes.name)||"icon"===Q(e.attributes.rel)||"apple-touch-icon"===Q(e.attributes.rel)||"shortcut icon"===Q(e.attributes.rel))))return!0;if("meta"===e.tagName){if(t.headMetaDescKeywords&&Q(e.attributes.name).match(/^description|keywords$/))return!0;if(t.headMetaSocial&&(Q(e.attributes.property).match(/^(og|twitter|fb):/)||Q(e.attributes.name).match(/^(og|twitter):/)||"pinterest"===Q(e.attributes.name)))return!0;if(t.headMetaRobots&&("robots"===Q(e.attributes.name)||"googlebot"===Q(e.attributes.name)||"bingbot"===Q(e.attributes.name)))return!0;if(t.headMetaHttpEquiv&&void 0!==e.attributes["http-equiv"])return!0;if(t.headMetaAuthorship&&("author"===Q(e.attributes.name)||"generator"===Q(e.attributes.name)||"framework"===Q(e.attributes.name)||"publisher"===Q(e.attributes.name)||"progid"===Q(e.attributes.name)||Q(e.attributes.property).match(/^article:/)||Q(e.attributes.property).match(/^product:/)))return!0;if(t.headMetaVerification&&("google-site-verification"===Q(e.attributes.name)||"yandex-verification"===Q(e.attributes.name)||"csrf-token"===Q(e.attributes.name)||"p:domain_verify"===Q(e.attributes.name)||"verify-v1"===Q(e.attributes.name)||"verification"===Q(e.attributes.name)||"shopify-checkout-api-token"===Q(e.attributes.name)))return!0}}return!1}(W,v)&&(j||W.type!==c.Text||W.isStyle||W.textContent.replace(/^\s+|\s+$/gm,"").length)?U():V;var Z=Object.assign(W,{id:z});if(i.add(e,Z),z===V)return null;m&&m(e);var K=!l;if(Z.type===c.Element){K=K&&!Z.needBlock,delete Z.needBlock;var te=y.shadowRoot(e);te&&S(te)&&(Z.isShadowHost=!0)}if((Z.type===c.Document||Z.type===c.Element)&&K){v.headWhitespace&&Z.type===c.Element&&"head"===Z.tagName&&(j=!1);var re={doc:r,mirror:i,blockClass:n,blockSelector:s,needsMask:H,maskTextClass:o,maskTextSelector:a,skipChild:l,inlineStylesheet:u,maskInputOptions:d,maskTextFn:h,maskInputFn:p,slimDOMOptions:v,dataURLOptions:g,inlineImages:_,recordCanvas:f,preserveWhiteSpace:j,onSerialize:m,onIframeLoad:I,iframeLoadTimeout:k,onStylesheetLoad:P,stylesheetLoadTimeout:A,keepIframeSrcFn:F};if(Z.type===c.Element&&"textarea"===Z.tagName&&void 0!==Z.attributes.value);else for(var ie of Array.from(y.childNodes(e))){var ne=ee(ie,re);ne&&Z.childNodes.push(ne)}var se=null;if(b(e)&&(se=y.shadowRoot(e)))for(var oe of Array.from(y.childNodes(se))){var ae=ee(oe,re);ae&&(S(se)&&(ae.isShadow=!0),Z.childNodes.push(ae))}}var le=y.parentNode(e);return le&&w(le)&&S(le)&&(Z.isShadow=!0),Z.type===c.Element&&"iframe"===Z.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&&I){var r=ee(t,{doc:t,mirror:i,blockClass:n,blockSelector:s,needsMask:H,maskTextClass:o,maskTextSelector:a,skipChild:!1,inlineStylesheet:u,maskInputOptions:d,maskTextFn:h,maskInputFn:p,slimDOMOptions:v,dataURLOptions:g,inlineImages:_,recordCanvas:f,preserveWhiteSpace:j,onSerialize:m,onIframeLoad:I,iframeLoadTimeout:k,onStylesheetLoad:P,stylesheetLoadTimeout:A,keepIframeSrcFn:F});r&&I(e,r)}}),k),Z.type===c.Element&&"link"===Z.tagName&&"string"==typeof Z.attributes.rel&&("stylesheet"===Z.attributes.rel||"preload"===Z.attributes.rel&&"string"==typeof Z.attributes.href&&"css"===L(Z.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(P){var t=ee(e,{doc:r,mirror:i,blockClass:n,blockSelector:s,needsMask:H,maskTextClass:o,maskTextSelector:a,skipChild:!1,inlineStylesheet:u,maskInputOptions:d,maskTextFn:h,maskInputFn:p,slimDOMOptions:v,dataURLOptions:g,inlineImages:_,recordCanvas:f,preserveWhiteSpace:j,onSerialize:m,onIframeLoad:I,iframeLoadTimeout:k,onStylesheetLoad:P,stylesheetLoadTimeout:A,keepIframeSrcFn:F});t&&P(e,t)}}),A),Z}let te=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 re={Node:["childNodes","parentNode","parentElement","textContent"],ShadowRoot:["host","styleSheets"],Element:["shadowRoot","querySelector","querySelectorAll"],MutationObserver:[]},ie={Node:["contains","getRootNode"],ShadowRoot:["getSelection"],Element:[],MutationObserver:["constructor"]},ne={};function se(e){if(ne[e])return ne[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 re?re[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 ie?ie[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 ne[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?ne[e]=u:r}catch(e){return r}}var oe={};function ae(e,t,r){var i,n=e+"."+String(r);if(oe[n])return oe[n].call(t);var s=se(e),o=null==(i=Object.getOwnPropertyDescriptor(s,r))?void 0:i.get;return o?(oe[n]=o,o.call(t)):t[r]}var le={};function ue(e,t,r){var i=e+"."+String(r);if(le[i])return le[i].bind(t);var n=se(e)[r];return"function"!=typeof n?t[r]:(le[i]=n,n.bind(t))}function ce(){return se("MutationObserver").constructor}var de={childNodes:e=>ae("Node",e,"childNodes"),parentNode:e=>ae("Node",e,"parentNode"),parentElement:e=>ae("Node",e,"parentElement"),textContent:e=>ae("Node",e,"textContent"),contains:(e,t)=>ue("Node",e,"contains")(t),getRootNode:e=>ue("Node",e,"getRootNode")(),host:e=>e&&"host"in e?ae("ShadowRoot",e,"host"):null,styleSheets:e=>e.styleSheets,shadowRoot:e=>e&&"shadowRoot"in e?ae("Element",e,"shadowRoot"):null,querySelector:(e,t)=>ae("Element",e,"querySelector")(t),querySelectorAll:(e,t)=>ae("Element",e,"querySelectorAll")(t),mutationObserver:ce};function he(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 pe="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.",ve={map:{},getId(){return console.error(pe),-1},getNode(){return console.error(pe),null},removeNodeFromMap(){console.error(pe)},has(){return console.error(pe),!1},reset(){console.error(pe)}};function ge(e,t,r){void 0===r&&(r={});var i=null,n=0;return function(){for(var s=arguments.length,o=new Array(s),a=0;s>a;a++)o[a]=arguments[a];var l=Date.now();n||!1!==r.leading||(n=l);var u=t-(l-n),c=this;0>=u||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 _e(e,t,r,i,n){void 0===n&&(n=window);var s=n.Object.getOwnPropertyDescriptor(e,t);return n.Object.defineProperty(e,t,i?r:{set(e){setTimeout((()=>{r.set.call(this,e)}),0),s&&s.set&&s.set.call(this,e)}}),()=>_e(e,t,s||{},!0)}function fe(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&&(ve=new Proxy(ve,{get(e,t,r){return"map"===t&&console.error(pe),Reflect.get(e,t,r)}}));var me=Date.now;function ye(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=de.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=de.parentElement(s.body))?void 0:i.scrollTop)||(null==(n=null==s?void 0:s.body)?void 0:n.scrollTop)||0}}function be(){return window.innerHeight||document.documentElement&&document.documentElement.clientHeight||document.body&&document.body.clientHeight}function we(){return window.innerWidth||document.documentElement&&document.documentElement.clientWidth||document.body&&document.body.clientWidth}function Se(e){return e?e.nodeType===e.ELEMENT_NODE?e:de.parentElement(e):null}function Ce(e,t,r,i){if(!e)return!1;var n=Se(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(K(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 Ie(e,t,r){return!("TITLE"!==e.tagName||!r.headTitleMutations)||t.getId(e)===V}function xe(e,t){if(w(e))return!1;var r=t.getId(e);if(!t.has(r))return!0;var i=de.parentNode(e);return(!i||i.nodeType!==e.DOCUMENT_NODE)&&(!i||xe(i,t))}function ke(e){return Boolean(e.changedTouches)}function Ee(e,t){return Boolean("IFRAME"===e.nodeName&&t.getMeta(e))}function Te(e,t){return Boolean("LINK"===e.nodeName&&e.nodeType===e.ELEMENT_NODE&&e.getAttribute&&"stylesheet"===e.getAttribute("rel")&&t.getMeta(e))}function Re(e){return!!e&&(e instanceof te&&"shadowRoot"in e?Boolean(e.shadowRoot):Boolean(de.shadowRoot(e)))}/[1-9][0-9]{12}/.test(Date.now().toString())||(me=()=>(new Date).getTime());let Me=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 Le(e){var t,r=null;return"getRootNode"in e&&(null==(t=de.getRootNode(e))?void 0:t.nodeType)===Node.DOCUMENT_FRAGMENT_NODE&&de.host(de.getRootNode(e))&&(r=de.host(de.getRootNode(e))),r}function Pe(e){var t=e.ownerDocument;return!!t&&(de.contains(t,e)||function(e){var t=e.ownerDocument;if(!t)return!1;var r=function(e){for(var t,r=e;t=Le(r);)r=t;return r}(e);return de.contains(t,r)}(e))}var Ae=(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))(Ae||{}),Fe=(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))(Fe||{}),Ne=(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))(Ne||{}),Oe=(e=>(e[e.Mouse=0]="Mouse",e[e.Pen=1]="Pen",e[e.Touch=2]="Touch",e))(Oe||{}),De=(e=>(e[e["2D"]=0]="2D",e[e.WebGL=1]="WebGL",e[e.WebGL2=2]="WebGL2",e))(De||{}),Be=(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))(Be||{});function He(e){return"__ln"in e}class qe{constructor(){a(this,"length",0),a(this,"head",null),a(this,"tail",null)}get(e){if(e>=this.length)throw new Error("Position outside of list range");for(var t=this.head,r=0;e>r;r++)t=(null==t?void 0:t.next)||null;return t}addNode(e){var t={value:e,previous:null,next:null};if(e.__ln=t,e.previousSibling&&He(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&&He(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 Ve,Ue=(e,t)=>e+"@"+t;class $e{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 qe,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=de.parentNode(n);if(s&&Pe(n)&&"TEXTAREA"!==s.tagName){var o=w(s)?this.mirror.getId(Le(n)):this.mirror.getId(s),a=i(n);if(-1===o||-1===a)return r.addNode(n);var l=ee(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=>{Ee(e,this.mirror)&&this.iframeManager.addIframe(e),Te(e,this.mirror)&&this.stylesheetManager.trackLinkElement(e),Re(n)&&this.shadowDomManager.addShadowRoot(de.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)ze(this.removes,s,this.mirror)&&!this.movedSet.has(de.parentNode(s))||n(s);for(var o of this.addedSet)We(this.droppedSet,o)||ze(this.removes,o,this.mirror)?We(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(de.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(de.parentNode(h.value));if(-1===i(h.value))continue;if(-1!==p){l=h;break}var v=de.parentNode(h.value);if(v&&v.nodeType===Node.DOCUMENT_FRAGMENT_NODE){var g=de.host(v);if(-1!==this.mirror.getId(g)){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 _={texts:this.texts.map((e=>{var t=e.node,r=de.parentNode(t);return r&&"TEXTAREA"===r.tagName&&this.genTextAreaValueMutation(r),{id:this.mirror.getId(t),value:e.value}})).filter((e=>!t.has(e.id))).filter((e=>this.mirror.has(e.id))),attributes:this.attributes.map((e=>{var{attributes:t}=e;if("string"==typeof t.style){var r=JSON.stringify(e.styleDiff),i=JSON.stringify(e._unchangedStyles);t.style.length>r.length&&(r+i).split("var(").length===t.style.split("var(").length&&(t.style=e.styleDiff)}return{id:this.mirror.getId(e.node),attributes:t}})).filter((e=>!t.has(e.id))).filter((e=>this.mirror.has(e.id))),removes:this.removes,adds:e};(_.texts.length||_.attributes.length||_.removes.length||_.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(_))}})),a(this,"genTextAreaValueMutation",(e=>{var t=this.attributeMap.get(e);t||(this.attributes.push(t={node:e,attributes:{},styleDiff:{},_unchangedStyles:{}}),this.attributeMap.set(e,t)),t.attributes.value=Array.from(de.childNodes(e),(e=>de.textContent(e)||"")).join("")})),a(this,"processMutation",(e=>{if(!Ie(e.target,this.mirror,this.slimDOMOptions))switch(e.type){case"characterData":var t=de.textContent(e.target);Ce(e.target,this.blockClass,this.blockSelector,!1)||t===e.oldValue||this.texts.push({value:J(e.target,this.maskTextClass,this.maskTextSelector,!0)&&t?this.maskTextFn?this.maskTextFn(t,Se(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=M(r);n=E({element:r,maskInputOptions:this.maskInputOptions,tagName:r.tagName,type:s,value:n,maskInputFn:this.maskInputFn})}if(Ce(e.target,this.blockClass,this.blockSelector,!1)||n===e.oldValue)return;var o=this.attributeMap.get(e.target);if("IFRAME"===r.tagName&&"src"===i&&!this.keepIframeSrcFn(n)){if(r.contentDocument)return;i="rr_src"}if(o||(this.attributes.push(o={node:e.target,attributes:{},styleDiff:{},_unchangedStyles:{}}),this.attributeMap.set(e.target,o)),"type"===i&&"INPUT"===r.tagName&&"password"===(e.oldValue||"").toLowerCase()&&r.setAttribute("data-rr-is-password","true"),!X(r.tagName,i))if(o.attributes[i]=Y(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&&(o.attributes.rr_open_mode=r.matches("dialog:modal")?"modal":"non-modal");break;case"childList":if(Ce(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=w(e.target)?this.mirror.getId(de.host(e.target)):this.mirror.getId(e.target);Ce(e.target,this.blockClass,this.blockSelector,!1)||Ie(t,this.mirror,this.slimDOMOptions)||!function(e,t){return-1!==t.getId(e)}(t,this.mirror)||(this.addedSet.has(t)?(je(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[Ue(r,i)]?je(this.movedSet,t):this.removes.push({parentId:i,id:r,isShadow:!(!w(e.target)||!S(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(Ie(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[Ue(this.mirror.getId(e),r)]=!0)}else this.addedSet.add(e),this.droppedSet.delete(e);Ce(e,this.blockClass,this.blockSelector,!1)||(de.childNodes(e).forEach((e=>this.genAdds(e))),Re(e)&&de.childNodes(de.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 je(e,t){e.delete(t),de.childNodes(t).forEach((t=>je(e,t)))}function ze(e,t,r){return 0!==e.length&&function(e,t,r){for(var i,n=de.parentNode(t),s=function(){var t=r.getId(n);if(e.some((e=>e.id===t)))return{v:!0};n=de.parentNode(n)};n;)if(i=s())return i.v;return!1}(e,t,r)}function We(e,t){return 0!==e.size&&Ze(e,t)}function Ze(e,t){var r=de.parentNode(t);return!!r&&(!!e.has(r)||Ze(e,r))}var Ge=e=>Ve?function(){try{return e(...arguments)}catch(e){if(Ve&&!0===Ve(e))return;throw e}}:e,Ye=[];function Xe(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 Ke(e,t){var r=new $e;Ye.push(r),r.init(e);var i=new(ce())(Ge(r.processMutations.bind(r)));return i.observe(t,{attributes:!0,attributeOldValue:!0,characterData:!0,characterDataOldValue:!0,childList:!0,subtree:!0}),i}function Je(e){var{scrollCb:t,doc:r,mirror:i,blockClass:n,blockSelector:s,sampling:o}=e;return he("scroll",Ge(ge(Ge((e=>{var o=Xe(e);if(o&&!Ce(o,n,s,!0)){var a=i.getId(o);if(o===r&&r.defaultView){var l=ye(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 Qe=["INPUT","TEXTAREA","SELECT"],et=new WeakMap;function tt(e){return function(e,t){if(st("CSSGroupingRule")&&e.parentRule instanceof CSSGroupingRule||st("CSSMediaRule")&&e.parentRule instanceof CSSMediaRule||st("CSSSupportsRule")&&e.parentRule instanceof CSSSupportsRule||st("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 rt(e,t,r){var i,n;return e?(e.ownerNode?i=t.getId(e.ownerNode):n=r.getId(e),{styleId:n,id:i}):{}}function it(e,t){var r,i,n,s,{mirror:o,stylesheetManager:a}=e;s=o.getId("#document"===t.nodeName?t:de.host(t));var l="#document"===t.nodeName?null==(r=t.defaultView)?void 0:r.Document:null==(n=null==(i=t.ownerDocument)?void 0:i.defaultView)?void 0:n.ShadowRoot,u=(null==l?void 0:l.prototype)?Object.getOwnPropertyDescriptor(null==l?void 0:l.prototype,"adoptedStyleSheets"):void 0;return null!==s&&-1!==s&&l&&u?(Object.defineProperty(t,"adoptedStyleSheets",{configurable:u.configurable,enumerable:u.enumerable,get(){var e;return null==(e=u.get)?void 0:e.call(this)},set(e){var t,r=null==(t=u.set)?void 0:t.call(this,e);if(null!==s&&-1!==s)try{a.adoptStyleSheets(e,s)}catch(e){}return r}}),Ge((()=>{Object.defineProperty(t,"adoptedStyleSheets",{configurable:u.configurable,enumerable:u.enumerable,get:u.get,set:u.set})}))):()=>{}}function nt(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=Ke(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=ge(Ge((e=>{var r=Date.now()-s;t(l.map((e=>(e.timeOffset-=r,e))),e),l=[],s=null})),a),c=Ge(ge(Ge((e=>{var t=Xe(e),{clientX:r,clientY:i}=ke(e)?e.changedTouches[0]:e;s||(s=me()),l.push({x:r,y:i,id:n.getId(t),timeOffset:me()-s}),u("undefined"!=typeof DragEvent&&e instanceof DragEvent?Fe.Drag:e instanceof MouseEvent?Fe.MouseMove:Fe.TouchMove)})),o,{trailing:!1})),d=[he("mousemove",c,i),he("touchmove",c,i),he("drag",c,i)];return Ge((()=>{d.forEach((e=>e()))}))}(e),o=function(e){var{mouseInteractionCb:t,doc:i,mirror:n,blockClass:s,blockSelector:o,sampling:a}=e;if(!1===a.mouseInteraction)return()=>{};var l=!0===a.mouseInteraction||void 0===a.mouseInteraction?{}:a.mouseInteraction,u=[],c=null;return Object.keys(Ne).filter((e=>Number.isNaN(Number(e))&&!e.endsWith("_Departed")&&!1!==l[e])).forEach((e=>{var a=T(e),l=(e=>i=>{var a=Xe(i);if(!Ce(a,s,o,!0)){var l=null,u=e;if("pointerType"in i){switch(i.pointerType){case"mouse":l=Oe.Mouse;break;case"touch":l=Oe.Touch;break;case"pen":l=Oe.Pen}l===Oe.Touch&&(Ne[e]===Ne.MouseDown?u="TouchStart":Ne[e]===Ne.MouseUp&&(u="TouchEnd"))}else ke(i)&&(l=Oe.Touch);null!==l?(c=l,(u.startsWith("Touch")&&l===Oe.Touch||u.startsWith("Mouse")&&l===Oe.Mouse)&&(l=null)):Ne[e]===Ne.Click&&(l=c,c=null);var d=ke(i)?i.changedTouches[0]:i;if(d){var h=n.getId(a),{clientX:p,clientY:v}=d;Ge(t)(r({type:Ne[u],id:h,x:p,y:v},null!==l&&{pointerType:l}))}}})(e);if(window.PointerEvent)switch(Ne[e]){case Ne.MouseDown:case Ne.MouseUp:a=a.replace("mouse","pointer");break;case Ne.TouchStart:case Ne.TouchEnd:return}u.push(he(a,l,i))})),Ge((()=>{u.forEach((e=>e()))}))}(e),a=Je(e),l=function(e,t){var{viewportResizeCb:r}=e,{win:i}=t,n=-1,s=-1;return he("resize",Ge(ge(Ge((()=>{var e=be(),t=we();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=Xe(e),r=e.isTrusted,n=t&&t.tagName;if(t&&"OPTION"===n&&(t=de.parentElement(t)),t&&n&&Qe.indexOf(n)>=0&&!Ce(t,s,o,!0)&&!(t.classList.contains(a)||l&&t.matches(l))){var d=t.value,p=!1,g=M(t)||"";"radio"===g||"checkbox"===g?p=t.checked:(u[n.toLowerCase()]||u[g])&&(d=E({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=et.get(e);if(!s||s.text!==i.text||s.isChecked!==i.isChecked){et.set(e,i);var o=n.getId(e);Ge(t)(r({},i,{id:o}))}}var g=("last"===d.input?["change"]:["input","change"]).map((e=>he(e,Ge(p),i))),_=i.defaultView;if(!_)return()=>{g.forEach((e=>e()))};var f=_.Object.getOwnPropertyDescriptor(_.HTMLInputElement.prototype,"value");return f&&f.set&&g.push(...[[_.HTMLInputElement.prototype,"value"],[_.HTMLInputElement.prototype,"checked"],[_.HTMLSelectElement.prototype,"value"],[_.HTMLTextAreaElement.prototype,"value"],[_.HTMLSelectElement.prototype,"selectedIndex"],[_.HTMLOptionElement.prototype,"selected"]].map((e=>_e(e[0],e[1],{set(){Ge(p)({target:this,isTrusted:!1})}},!1,_)))),Ge((()=>{g.forEach((e=>e()))}))}(e),c=function(e){var{mediaInteractionCb:t,blockClass:r,blockSelector:i,mirror:n,sampling:s,doc:o}=e,a=Ge((e=>ge(Ge((s=>{var o=Xe(s);if(o&&!Ce(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=[he("play",a(Be.Play),o),he("pause",a(Be.Pause),o),he("seeked",a(Be.Seeked),o),he("volumechange",a(Be.VolumeChange),o),he("ratechange",a(Be.RateChange),o)];return Ge((()=>{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:Ge(((e,t,s)=>{var[o,a]=s,{id:l,styleId:u}=rt(t,i,n.styleMirror);return(l&&-1!==l||u&&-1!==u)&&r({id:l,styleId:u,adds:[{rule:o,index:a}]}),e.apply(t,s)}))}),s.CSSStyleSheet.prototype.addRule=function(e,t,r){return void 0===r&&(r=this.cssRules.length),s.CSSStyleSheet.prototype.insertRule.apply(this,[e+" { "+t+" }",r])};var a,l,u=s.CSSStyleSheet.prototype.deleteRule;s.CSSStyleSheet.prototype.deleteRule=new Proxy(u,{apply:Ge(((e,t,s)=>{var[o]=s,{id:a,styleId:l}=rt(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:Ge(((e,t,s)=>{var[o]=s,{id:a,styleId:l}=rt(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:Ge(((e,t,s)=>{var[o]=s,{id:a,styleId:l}=rt(t,i,n.styleMirror);return(a&&-1!==a||l&&-1!==l)&&r({id:a,styleId:l,replaceSync:o}),e.apply(t,s)}))}));var c={};ot("CSSGroupingRule")?c.CSSGroupingRule=s.CSSGroupingRule:(ot("CSSMediaRule")&&(c.CSSMediaRule=s.CSSMediaRule),ot("CSSConditionRule")&&(c.CSSConditionRule=s.CSSConditionRule),ot("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:Ge(((e,t,s)=>{var[o,a]=s,{id:l,styleId:u}=rt(t.parentStyleSheet,i,n.styleMirror);return(l&&-1!==l||u&&-1!==u)&&r({id:l,styleId:u,adds:[{rule:o,index:[...tt(t),a||0]}]}),e.apply(t,s)}))}),s.prototype.deleteRule=new Proxy(d[t].deleteRule,{apply:Ge(((e,t,s)=>{var[o]=s,{id:a,styleId:l}=rt(t.parentStyleSheet,i,n.styleMirror);return(a&&-1!==a||l&&-1!==l)&&r({id:a,styleId:l,removes:[{index:[...tt(t),o]}]}),e.apply(t,s)}))})})),Ge((()=>{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=it(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:Ge(((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}=rt(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:tt(t.parentRule)}),e.apply(t,o)}))});var l=o.CSSStyleDeclaration.prototype.removeProperty;return o.CSSStyleDeclaration.prototype.removeProperty=new Proxy(l,{apply:Ge(((e,t,o)=>{var a,[u]=o;if(n.has(u))return l.apply(t,[u]);var{id:c,styleId:d}=rt(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:tt(t.parentRule)}),e.apply(t,o)}))}),Ge((()=>{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=fe(r.fonts,"add",(function(e){return function(r){return setTimeout(Ge((()=>{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),Ge((()=>{n.forEach((e=>e()))}))}(e)));var g=function(e){var{doc:t,mirror:r,blockClass:i,blockSelector:n,selectionCb:s}=e,o=!0,a=Ge((()=>{var e=t.getSelection();if(!(!e||o&&(null==e?void 0:e.isCollapsed))){o=e.isCollapsed||!1;for(var a=[],l=e.rangeCount||0,u=0;l>u;u++){var c=e.getRangeAt(u),{startContainer:d,startOffset:h,endContainer:p,endOffset:v}=c;Ce(d,i,n,!0)||Ce(p,i,n,!0)||a.push({start:r.getId(d),startOffset:h,end:r.getId(p),endOffset:v})}s({ranges:a})}}));return a(),he("selectionchange",a)}(e),_=function(e){var{doc:t,customElementCb:r}=e,i=t.defaultView;return i&&i.customElements?fe(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 Ge((()=>{Ye.forEach((e=>e.reset())),null==i||i.disconnect(),s(),o(),a(),l(),u(),c(),d(),h(),p(),v(),g(),_(),f.forEach((e=>e()))}))}function st(e){return void 0!==window[e]}function ot(e){return Boolean(void 0!==window[e]&&window[e].prototype&&"insertRule"in window[e].prototype&&"deleteRule"in window[e].prototype)}class at{constructor(e){a(this,"iframeIdToRemoteIdMap",new WeakMap),a(this,"iframeRemoteIdToIdMap",new WeakMap),this.generateIdFn=e}getId(e,t,r,i){var n=r||this.getIdToRemoteIdMap(e),s=i||this.getRemoteIdToIdMap(e),o=n.get(t);return o||(o=this.generateIdFn(),n.set(t,o),s.set(o,t)),o}getIds(e,t){var r=this.getIdToRemoteIdMap(e),i=this.getRemoteIdToIdMap(e);return t.map((t=>this.getId(e,t,r,i)))}getRemoteId(e,t,r){var i=r||this.getRemoteIdToIdMap(e);return"number"!=typeof t?t:i.get(t)||-1}getRemoteIds(e,t){var r=this.getRemoteIdToIdMap(e);return t.map((t=>this.getRemoteId(e,t,r)))}reset(e){if(!e)return this.iframeIdToRemoteIdMap=new WeakMap,void(this.iframeRemoteIdToIdMap=new WeakMap);this.iframeIdToRemoteIdMap.delete(e),this.iframeRemoteIdToIdMap.delete(e)}getIdToRemoteIdMap(e){var t=this.iframeIdToRemoteIdMap.get(e);return t||this.iframeIdToRemoteIdMap.set(e,t=new Map),t}getRemoteIdToIdMap(e){var t=this.iframeRemoteIdToIdMap.get(e);return t||this.iframeRemoteIdToIdMap.set(e,t=new Map),t}}class lt{constructor(e){a(this,"iframes",new WeakMap),a(this,"crossOriginIframeMap",new WeakMap),a(this,"crossOriginIframeMirror",new at(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 at(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 Ae.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:Ae.IncrementalSnapshot,data:{source:Fe.Mutation,adds:[{parentId:this.mirror.getId(e),nextId:null,node:t.data.node}],removes:[],texts:[],attributes:[],isAttachIframe:!0}};case Ae.Meta:case Ae.Load:case Ae.DomContentLoaded:return!1;case Ae.Plugin:return t;case Ae.Custom:return this.replaceIds(t.data.payload,e,["id","parentId","previousId","nextId"]),t;case Ae.IncrementalSnapshot:switch(t.data.source){case Fe.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 Fe.Drag:case Fe.TouchMove:case Fe.MouseMove:return t.data.positions.forEach((t=>{this.replaceIds(t,e,["id"])})),t;case Fe.ViewportResize:return!1;case Fe.MediaInteraction:case Fe.MouseInteraction:case Fe.Scroll:case Fe.CanvasMutation:case Fe.Input:return this.replaceIds(t.data,e,["id"]),t;case Fe.StyleSheetRule:case Fe.StyleDeclaration:return this.replaceIds(t.data,e,["id"]),this.replaceStyleIds(t.data,e,["styleId"]),t;case Fe.Font:return t;case Fe.Selection:return t.data.ranges.forEach((t=>{this.replaceIds(t,e,["start","end"])})),t;case Fe.AdoptedStyleSheet:return this.replaceIds(t.data,e,["id"]),this.replaceStyleIds(t.data,e,["styleIds"]),null==(r=t.data.styles)||r.forEach((t=>{this.replaceStyleIds(t,e,["styleId"])})),t}}return!1}replace(e,t,r,i){for(var n of i)(Array.isArray(t[n])||"number"==typeof t[n])&&(t[n]=Array.isArray(t[n])?e.getIds(r,t[n]):e.getId(r,t[n]));return t}replaceIds(e,t,r){return this.replace(this.crossOriginIframeMirror,e,t,r)}replaceStyleIds(e,t,r){return this.replace(this.crossOriginIframeStyleMirror,e,t,r)}replaceIdOnNode(e,t){this.replaceIds(e,t,["id","rootId"]),"childNodes"in e&&e.childNodes.forEach((e=>{this.replaceIdOnNode(e,t)}))}patchRootIdOnNode(e,t){e.type===c.Document||e.rootId||(e.rootId=t),"childNodes"in e&&e.childNodes.forEach((e=>{this.patchRootIdOnNode(e,t)}))}}class ut{constructor(e){a(this,"shadowDoms",new WeakSet),a(this,"mutationCb"),a(this,"scrollCb"),a(this,"bypassOptions"),a(this,"mirror"),a(this,"restoreHandlers",[]),this.mutationCb=e.mutationCb,this.scrollCb=e.scrollCb,this.bypassOptions=e.bypassOptions,this.mirror=e.mirror,this.init()}init(){this.reset(),this.patchAttachShadow(Element,document)}addShadowRoot(e,t){if(S(e)&&!this.shadowDoms.has(e)){this.shadowDoms.add(e);var i=Ke(r({},this.bypassOptions,{doc:t,mutationCb:this.mutationCb,mirror:this.mirror,shadowDomManager:this}),e);this.restoreHandlers.push((()=>i.disconnect())),this.restoreHandlers.push(Je(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(de.host(e))),this.restoreHandlers.push(it({mirror:this.mirror,stylesheetManager:this.bypassOptions.stylesheetManager},e))}),0)}}observeAttachShadow(e){e.contentWindow&&e.contentDocument&&this.patchAttachShadow(e.contentWindow.Element,e.contentDocument)}patchAttachShadow(e,t){var r=this;this.restoreHandlers.push(fe(e.prototype,"attachShadow",(function(e){return function(i){var n=e.call(this,i),s=de.shadowRoot(this);return s&&Pe(this)&&r.addShadowRoot(s,t),n}})))}reset(){this.restoreHandlers.forEach((e=>{try{e()}catch(e){}})),this.restoreHandlers=[],this.shadowDoms=new WeakSet}}for(var ct="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",dt="undefined"==typeof Uint8Array?[]:new Uint8Array(256),ht=0;64>ht;ht++)dt[ct.charCodeAt(ht)]=ht;var pt=new Map,vt=(e,t,r)=>{if(e&&(ft(e,t)||"object"==typeof e)){var i=function(e,t){var r=pt.get(e);return r||pt.set(e,r=new Map),r.has(t)||r.set(t,[]),r.get(t)}(r,e.constructor.name),n=i.indexOf(e);return-1===n&&(n=i.length,i.push(e)),n}};function gt(e,t,r){if(e instanceof Array)return e.map((e=>gt(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;i>t;t+=3)n+=ct[r[t]>>2],n+=ct[(3&r[t])<<4|r[t+1]>>4],n+=ct[(15&r[t+1])<<2|r[t+2]>>6],n+=ct[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:[gt(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}}return e instanceof HTMLCanvasElement?{rr_type:"HTMLImageElement",src:e.toDataURL()}:e instanceof ImageData?{rr_type:e.constructor.name,args:[gt(e.data,t,r),e.width,e.height]}:ft(e,t)||"object"==typeof e?{rr_type:e.constructor.name,index:vt(e,t,r)}:e}var _t=(e,t,r)=>e.map((e=>gt(e,t,r))),ft=(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 mt(e,t,r,i){var n=[];try{var s=fe(e.HTMLCanvasElement.prototype,"getContext",(function(e){return function(n){for(var s=arguments.length,o=new Array(s>1?s-1:0),a=1;s>a;a++)o[a-1]=arguments[a];if(!Ce(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 yt(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=fe(e,a,(function(e){return function(){for(var o=arguments.length,l=new Array(o),u=0;o>u;u++)l[u]=arguments[u];var c=e.apply(this,l);if(vt(c,s,this),"tagName"in this.canvas&&!Ce(this.canvas,i,n,!0)){var d=_t(l,s,this);r(this.canvas,{type:t,property:a,args:d})}return c}}));o.push(l)}catch(i){var u=_e(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 bt,wt,St,Ct,It="KGZ1bmN0aW9uKCkgewogICJ1c2Ugc3RyaWN0IjsKICB2YXIgY2hhcnMgPSAiQUJDREVGR0hJSktMTU5PUFFSU1RVVldYWVphYmNkZWZnaGlqa2xtbm9wcXJzdHV2d3h5ejAxMjM0NTY3ODkrLyI7CiAgdmFyIGxvb2t1cCA9IHR5cGVvZiBVaW50OEFycmF5ID09PSAidW5kZWZpbmVkIiA/IFtdIDogbmV3IFVpbnQ4QXJyYXkoMjU2KTsKICBmb3IgKHZhciBpID0gMDsgaSA8IGNoYXJzLmxlbmd0aDsgaSsrKSB7CiAgICBsb29rdXBbY2hhcnMuY2hhckNvZGVBdChpKV0gPSBpOwogIH0KICB2YXIgZW5jb2RlID0gZnVuY3Rpb24oYXJyYXlidWZmZXIpIHsKICAgIHZhciBieXRlcyA9IG5ldyBVaW50OEFycmF5KGFycmF5YnVmZmVyKSwgaTIsIGxlbiA9IGJ5dGVzLmxlbmd0aCwgYmFzZTY0ID0gIiI7CiAgICBmb3IgKGkyID0gMDsgaTIgPCBsZW47IGkyICs9IDMpIHsKICAgICAgYmFzZTY0ICs9IGNoYXJzW2J5dGVzW2kyXSA+PiAyXTsKICAgICAgYmFzZTY0ICs9IGNoYXJzWyhieXRlc1tpMl0gJiAzKSA8PCA0IHwgYnl0ZXNbaTIgKyAxXSA+PiA0XTsKICAgICAgYmFzZTY0ICs9IGNoYXJzWyhieXRlc1tpMiArIDFdICYgMTUpIDw8IDIgfCBieXRlc1tpMiArIDJdID4+IDZdOwogICAgICBiYXNlNjQgKz0gY2hhcnNbYnl0ZXNbaTIgKyAyXSAmIDYzXTsKICAgIH0KICAgIGlmIChsZW4gJSAzID09PSAyKSB7CiAgICAgIGJhc2U2NCA9IGJhc2U2NC5zdWJzdHJpbmcoMCwgYmFzZTY0Lmxlbmd0aCAtIDEpICsgIj0iOwogICAgfSBlbHNlIGlmIChsZW4gJSAzID09PSAxKSB7CiAgICAgIGJhc2U2NCA9IGJhc2U2NC5zdWJzdHJpbmcoMCwgYmFzZTY0Lmxlbmd0aCAtIDIpICsgIj09IjsKICAgIH0KICAgIHJldHVybiBiYXNlNjQ7CiAgfTsKICBjb25zdCBsYXN0QmxvYk1hcCA9IC8qIEBfX1BVUkVfXyAqLyBuZXcgTWFwKCk7CiAgY29uc3QgdHJhbnNwYXJlbnRCbG9iTWFwID0gLyogQF9fUFVSRV9fICovIG5ldyBNYXAoKTsKICBhc3luYyBmdW5jdGlvbiBnZXRUcmFuc3BhcmVudEJsb2JGb3Iod2lkdGgsIGhlaWdodCwgZGF0YVVSTE9wdGlvbnMpIHsKICAgIGNvbnN0IGlkID0gYCR7d2lkdGh9LSR7aGVpZ2h0fWA7CiAgICBpZiAoIk9mZnNjcmVlbkNhbnZhcyIgaW4gZ2xvYmFsVGhpcykgewogICAgICBpZiAodHJhbnNwYXJlbnRCbG9iTWFwLmhhcyhpZCkpIHJldHVybiB0cmFuc3BhcmVudEJsb2JNYXAuZ2V0KGlkKTsKICAgICAgY29uc3Qgb2Zmc2NyZWVuID0gbmV3IE9mZnNjcmVlbkNhbnZhcyh3aWR0aCwgaGVpZ2h0KTsKICAgICAgb2Zmc2NyZWVuLmdldENvbnRleHQoIjJkIik7CiAgICAgIGNvbnN0IGJsb2IgPSBhd2FpdCBvZmZzY3JlZW4uY29udmVydFRvQmxvYihkYXRhVVJMT3B0aW9ucyk7CiAgICAgIGNvbnN0IGFycmF5QnVmZmVyID0gYXdhaXQgYmxvYi5hcnJheUJ1ZmZlcigpOwogICAgICBjb25zdCBiYXNlNjQgPSBlbmNvZGUoYXJyYXlCdWZmZXIpOwogICAgICB0cmFuc3BhcmVudEJsb2JNYXAuc2V0KGlkLCBiYXNlNjQpOwogICAgICByZXR1cm4gYmFzZTY0OwogICAgfSBlbHNlIHsKICAgICAgcmV0dXJuICIiOwogICAgfQogIH0KICBjb25zdCB3b3JrZXIgPSBzZWxmOwogIHdvcmtlci5vbm1lc3NhZ2UgPSBhc3luYyBmdW5jdGlvbihlKSB7CiAgICBpZiAoIk9mZnNjcmVlbkNhbnZhcyIgaW4gZ2xvYmFsVGhpcykgewogICAgICBjb25zdCB7IGlkLCBiaXRtYXAsIHdpZHRoLCBoZWlnaHQsIGRhdGFVUkxPcHRpb25zIH0gPSBlLmRhdGE7CiAgICAgIGNvbnN0IHRyYW5zcGFyZW50QmFzZTY0ID0gZ2V0VHJhbnNwYXJlbnRCbG9iRm9yKAogICAgICAgIHdpZHRoLAogICAgICAgIGhlaWdodCwKICAgICAgICBkYXRhVVJMT3B0aW9ucwogICAgICApOwogICAgICBjb25zdCBvZmZzY3JlZW4gPSBuZXcgT2Zmc2NyZWVuQ2FudmFzKHdpZHRoLCBoZWlnaHQpOwogICAgICBjb25zdCBjdHggPSBvZmZzY3JlZW4uZ2V0Q29udGV4dCgiMmQiKTsKICAgICAgY3R4LmRyYXdJbWFnZShiaXRtYXAsIDAsIDApOwogICAgICBiaXRtYXAuY2xvc2UoKTsKICAgICAgY29uc3QgYmxvYiA9IGF3YWl0IG9mZnNjcmVlbi5jb252ZXJ0VG9CbG9iKGRhdGFVUkxPcHRpb25zKTsKICAgICAgY29uc3QgdHlwZSA9IGJsb2IudHlwZTsKICAgICAgY29uc3QgYXJyYXlCdWZmZXIgPSBhd2FpdCBibG9iLmFycmF5QnVmZmVyKCk7CiAgICAgIGNvbnN0IGJhc2U2NCA9IGVuY29kZShhcnJheUJ1ZmZlcik7CiAgICAgIGlmICghbGFzdEJsb2JNYXAuaGFzKGlkKSAmJiBhd2FpdCB0cmFuc3BhcmVudEJhc2U2NCA9PT0gYmFzZTY0KSB7CiAgICAgICAgbGFzdEJsb2JNYXAuc2V0KGlkLCBiYXNlNjQpOwogICAgICAgIHJldHVybiB3b3JrZXIucG9zdE1lc3NhZ2UoeyBpZCB9KTsKICAgICAgfQogICAgICBpZiAobGFzdEJsb2JNYXAuZ2V0KGlkKSA9PT0gYmFzZTY0KSByZXR1cm4gd29ya2VyLnBvc3RNZXNzYWdlKHsgaWQgfSk7CiAgICAgIHdvcmtlci5wb3N0TWVzc2FnZSh7CiAgICAgICAgaWQsCiAgICAgICAgdHlwZSwKICAgICAgICBiYXNlNjQsCiAgICAgICAgd2lkdGgsCiAgICAgICAgaGVpZ2h0CiAgICAgIH0pOwogICAgICBsYXN0QmxvYk1hcC5zZXQoaWQsIGJhc2U2NCk7CiAgICB9IGVsc2UgewogICAgICByZXR1cm4gd29ya2VyLnBvc3RNZXNzYWdlKHsgaWQ6IGUuZGF0YS5pZCB9KTsKICAgIH0KICB9Owp9KSgpOwovLyMgc291cmNlTWFwcGluZ1VSTD1pbWFnZS1iaXRtYXAtZGF0YS11cmwtd29ya2VyLUlKcEM3Z19iLmpzLm1hcAo=",xt="undefined"!=typeof window&&window.Blob&&new Blob([(bt=It,Uint8Array.from(atob(bt),(e=>e.charCodeAt(0))))],{type:"text/javascript;charset=utf-8"});function kt(e){var t;try{if(!(t=xt&&(window.URL||window.webkitURL).createObjectURL(xt)))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,"+It,{name:null==e?void 0:e.name})}finally{t&&(window.URL||window.webkitURL).revokeObjectURL(t)}}class Et{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=mt(r,i,n,!0),l=new Map,u=new kt;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:De["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&&d>e-h||(h=e,(a=[],v=e=>{e.querySelectorAll("canvas").forEach((e=>{Ce(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=mt(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=fe(t.CanvasRenderingContext2D.prototype,s,(function(n){return function(){for(var o=arguments.length,a=new Array(o),l=0;o>l;l++)a[l]=arguments[l];return Ce(this.canvas,r,i,!0)||setTimeout((()=>{var r=_t(a,t,this);e(this.canvas,{type:De["2D"],property:s,args:r})}),0),n.apply(this,a)}}));n.push(o)}catch(r){var a=_e(t.CanvasRenderingContext2D.prototype,s,{set(t){e(this.canvas,{type:De["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(...yt(t.WebGLRenderingContext.prototype,De.WebGL,e,r,i,t)),void 0!==t.WebGL2RenderingContext&&n.push(...yt(t.WebGL2RenderingContext.prototype,De.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 Tt{constructor(e){a(this,"trackedLinkElements",new WeakSet),a(this,"mutationCb"),a(this,"adoptedStyleSheetCb"),a(this,"styleMirror",new Me),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 Rt{constructor(){a(this,"nodeMap",new WeakMap),a(this,"active",!1)}inOtherBuffer(e,t){var r=this.nodeMap.get(e);return r&&Array.from(r).some((e=>e!==t))}add(e,t){this.active||(this.active=!0,requestAnimationFrame((()=>{this.nodeMap=new WeakMap,this.active=!1}))),this.nodeMap.set(e,(this.nodeMap.get(e)||new Set).add(t))}destroy(){}}var Mt=!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 Pt,At,Ft=new k;function Nt(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:w,recordDOM:S=!0,recordCanvas:C=!1,recordCrossOriginIframes:I=!1,recordAfter:x=("DOMContentLoaded"===e.recordAfter?e.recordAfter:"load"),userTriggeredOnInput:E=!1,collectFonts:T=!1,inlineImages:R=!1,plugins:M,keepIframeSrcFn:L=(()=>!1),ignoreCSSAttributes:P=new Set([]),errorHandler:A}=e;Ve=A;var F=!I||window.parent===window,N=!1;if(!F)try{window.parent.document&&(N=!1)}catch(e){N=!0}if(F&&!t)throw new Error("emit function is required");if(!F&&!N)return()=>{};void 0!==w&&void 0===y.mousemove&&(y.mousemove=w),Ft.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},B=!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=[].forEach),"DOMTokenList"in e&&!e.DOMTokenList.prototype.forEach&&(e.DOMTokenList.prototype.forEach=[].forEach)}();var H=0,q=e=>{for(var t of M||[])t.eventProcessor&&(e=t.eventProcessor(e));return m&&!N&&(e=m(e)),e};wt=(e,r)=>{var s,o=e;if(o.timestamp=me(),!(null==(s=Ye[0])?void 0:s.isFrozen())||o.type===Ae.FullSnapshot||o.type===Ae.IncrementalSnapshot&&o.data.source===Fe.Mutation||Ye.forEach((e=>e.unfreeze())),F)null==t||t(q(o),r);else if(N){var a={type:"rrweb",event:q(o),origin:window.location.origin,isCheckout:r};window.parent.postMessage(a,"*")}if(o.type===Ae.FullSnapshot)O=o,H=0;else if(o.type===Ae.IncrementalSnapshot){if(o.data.source===Fe.Mutation&&o.data.isAttachIframe)return;H++,(n&&H>=n||i&&o.timestamp-O.timestamp>i)&&St(!0)}};var V=e=>{wt({type:Ae.IncrementalSnapshot,data:r({source:Fe.Mutation},e)})},U=e=>wt({type:Ae.IncrementalSnapshot,data:r({source:Fe.Scroll},e)}),j=e=>wt({type:Ae.IncrementalSnapshot,data:r({source:Fe.CanvasMutation},e)}),z=new Tt({mutationCb:V,adoptedStyleSheetCb:e=>wt({type:Ae.IncrementalSnapshot,data:r({source:Fe.AdoptedStyleSheet},e)})}),W=new lt({mirror:Ft,mutationCb:V,stylesheetManager:z,recordCrossOriginIframes:I,wrappedEmit:wt});for(var Z of M||[])Z.getMirror&&Z.getMirror({nodeMirror:Ft,crossOriginIframeMirror:W.crossOriginIframeMirror,crossOriginIframeStyleMirror:W.crossOriginIframeStyleMirror});var G=new Rt;Ct=new Et({recordCanvas:C,mutationCb:j,win:window,blockClass:s,blockSelector:o,mirror:Ft,sampling:y.canvas,dataURLOptions:b});var Y=new ut({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:R,sampling:y,slimDOMOptions:B,iframeManager:W,stylesheetManager:z,canvasManager:Ct,keepIframeSrcFn:L,processedNodeManager:G},mirror:Ft});St=function(e){if(void 0===e&&(e=!1),S){wt({type:Ae.Meta,data:{href:window.location.href,width:we(),height:be()}},e),z.reset(),Y.init(),Ye.forEach((e=>e.lock()));var t=function(e,t){var{mirror:r=new k,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:w=(()=>!1)}=t||{};return ee(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:w,newlyAddedElement:!1})}(document,{mirror:Ft,blockClass:s,blockSelector:o,maskTextClass:u,maskTextSelector:c,inlineStylesheet:d,maskAllInputs:D,maskTextFn:_,maskInputFn:g,slimDOM:B,dataURLOptions:b,recordCanvas:C,inlineImages:R,onSerialize(e){Ee(e,Ft)&&W.addIframe(e),Te(e,Ft)&&z.trackLinkElement(e),Re(e)&&Y.addShadowRoot(de.shadowRoot(e),document)},onIframeLoad(e,t){W.attachIframe(e,t),Y.observeAttachShadow(e)},onStylesheetLoad(e,t){z.attachLinkElement(e,t)},keepIframeSrcFn:L});if(!t)return console.warn("Failed to snapshot the document");wt({type:Ae.FullSnapshot,data:{node:t,initialOffset:ye(window)}},e),Ye.forEach((e=>e.unlock())),document.adoptedStyleSheets&&document.adoptedStyleSheets.length>0&&z.adoptStyleSheets(document.adoptedStyleSheets,Ft.getId(document))}};try{var X=[],K=e=>{var t;return Ge(nt)({mutationCb:V,mousemoveCb:(e,t)=>wt({type:Ae.IncrementalSnapshot,data:{source:t,positions:e}}),mouseInteractionCb:e=>wt({type:Ae.IncrementalSnapshot,data:r({source:Fe.MouseInteraction},e)}),scrollCb:U,viewportResizeCb:e=>wt({type:Ae.IncrementalSnapshot,data:r({source:Fe.ViewportResize},e)}),inputCb:e=>wt({type:Ae.IncrementalSnapshot,data:r({source:Fe.Input},e)}),mediaInteractionCb:e=>wt({type:Ae.IncrementalSnapshot,data:r({source:Fe.MediaInteraction},e)}),styleSheetRuleCb:e=>wt({type:Ae.IncrementalSnapshot,data:r({source:Fe.StyleSheetRule},e)}),styleDeclarationCb:e=>wt({type:Ae.IncrementalSnapshot,data:r({source:Fe.StyleDeclaration},e)}),canvasMutationCb:j,fontCb:e=>wt({type:Ae.IncrementalSnapshot,data:r({source:Fe.Font},e)}),selectionCb(e){wt({type:Ae.IncrementalSnapshot,data:r({source:Fe.Selection},e)})},customElementCb(e){wt({type:Ae.IncrementalSnapshot,data:r({source:Fe.CustomElement},e)})},blockClass:s,ignoreClass:a,ignoreSelector:l,maskTextClass:u,maskTextSelector:c,maskInputOptions:D,inlineStylesheet:d,sampling:y,recordDOM:S,recordCanvas:C,inlineImages:R,userTriggeredOnInput:E,collectFonts:T,doc:e,maskInputFn:g,maskTextFn:_,keepIframeSrcFn:L,blockSelector:o,slimDOMOptions:B,dataURLOptions:b,mirror:Ft,iframeManager:W,stylesheetManager:z,shadowDomManager:Y,processedNodeManager:G,canvasManager:Ct,ignoreCSSAttributes:P,plugins:(null==(t=null==M?void 0:M.filter((e=>e.observer)))?void 0:t.map((e=>({observer:e.observer,options:e.options,callback:t=>wt({type:Ae.Plugin,data:{plugin:e.name,payload:t}})}))))||[]},f)};W.addLoadListener((e=>{try{X.push(K(e.contentDocument))}catch(e){console.warn(e)}}));var J=()=>{St(),X.push(K(document)),Mt=!0};return"interactive"===document.readyState||"complete"===document.readyState?J():(X.push(he("DOMContentLoaded",(()=>{wt({type:Ae.DomContentLoaded,data:{}}),"DOMContentLoaded"===x&&J()}))),X.push(he("load",(()=>{wt({type:Ae.Load,data:{}}),"load"===x&&J()}),window))),()=>{X.forEach((e=>e())),G.destroy(),Mt=!1,Ve=void 0}}catch(e){console.warn(e)}}Nt.addCustomEvent=(e,t)=>{if(!Mt)throw new Error("please add custom event after start recording");wt({type:Ae.Custom,data:{tag:e,payload:t}})},Nt.freezePage=()=>{Ye.forEach((e=>e.freeze()))},Nt.takeFullSnapshot=e=>{if(!Mt)throw new Error("please take full snapshot after start recording");St(e)},Nt.mirror=Ft,(At=Pt||(Pt={}))[At.NotStarted=0]="NotStarted",At[At.Running=1]="Running",At[At.Stopped=2]="Stopped";var Ot,Dt=Object.defineProperty,Bt=(e,t,r)=>((e,t,r)=>t in e?Dt(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r)(e,"symbol"!=typeof t?t+"":t,r),Ht=Object.defineProperty,qt=(e,t,r)=>((e,t,r)=>t in e?Ht(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r)(e,"symbol"!=typeof t?t+"":t,r),Vt=Object.defineProperty,Ut=(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),$t={Node:["childNodes","parentNode","parentElement","textContent"],ShadowRoot:["host","styleSheets"],Element:["shadowRoot","querySelector","querySelectorAll"],MutationObserver:[]},jt={Node:["contains","getRootNode"],ShadowRoot:["getSelection"],Element:[],MutationObserver:["constructor"]},zt={};function Wt(e){if(zt[e])return zt[e];var t=globalThis[e],r=t.prototype,i=e in $t?$t[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 jt?jt[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 zt[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?zt[e]=u:r}catch(e){return r}}var Zt={};function Gt(e,t,r){var i,n=e+"."+String(r);if(Zt[n])return Zt[n].call(t);var s=Wt(e),o=null==(i=Object.getOwnPropertyDescriptor(s,r))?void 0:i.get;return o?(Zt[n]=o,o.call(t)):t[r]}var Yt={};function Xt(e,t,r){var i=e+"."+String(r);if(Yt[i])return Yt[i].bind(t);var n=Wt(e)[r];return"function"!=typeof n?t[r]:(Yt[i]=n,n.bind(t))}var Kt={childNodes:e=>Gt("Node",e,"childNodes"),parentNode:e=>Gt("Node",e,"parentNode"),parentElement:e=>Gt("Node",e,"parentElement"),textContent:e=>Gt("Node",e,"textContent"),contains:(e,t)=>Xt("Node",e,"contains")(t),getRootNode:e=>Xt("Node",e,"getRootNode")(),host:e=>e&&"host"in e?Gt("ShadowRoot",e,"host"):null,styleSheets:e=>e.styleSheets,shadowRoot:e=>e&&"shadowRoot"in e?Gt("Element",e,"shadowRoot"):null,querySelector:(e,t)=>Gt("Element",e,"querySelector")(t),querySelectorAll:(e,t)=>Gt("Element",e,"querySelectorAll")(t),mutationObserver:()=>Wt("MutationObserver").constructor};function Jt(e,t,r){if(!e)return!1;if(e.nodeType!==e.ELEMENT_NODE)return!!r&&Jt(Kt.parentNode(e),t,r);for(var i=e.classList.length;i--;)if(t.test(e.classList[i]))return!0;return!!r&&Jt(Kt.parentNode(e),t,r)}class Qt{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 Qt))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 er={Node:["childNodes","parentNode","parentElement","textContent"],ShadowRoot:["host","styleSheets"],Element:["shadowRoot","querySelector","querySelectorAll"],MutationObserver:[]},tr={Node:["contains","getRootNode"],ShadowRoot:["getSelection"],Element:[],MutationObserver:["constructor"]},rr={};function ir(e){if(rr[e])return rr[e];var t=globalThis[e],r=t.prototype,i=e in er?er[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 tr?tr[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 rr[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?rr[e]=u:r}catch(e){return r}}var nr={};function sr(e,t,r){var i,n=e+"."+String(r);if(nr[n])return nr[n].call(t);var s=ir(e),o=null==(i=Object.getOwnPropertyDescriptor(s,r))?void 0:i.get;return o?(nr[n]=o,o.call(t)):t[r]}var or={};function ar(e,t,r){var i=e+"."+String(r);if(or[i])return or[i].bind(t);var n=ir(e)[r];return"function"!=typeof n?t[r]:(or[i]=n,n.bind(t))}var lr={childNodes:e=>sr("Node",e,"childNodes"),parentNode:e=>sr("Node",e,"parentNode"),parentElement:e=>sr("Node",e,"parentElement"),textContent:e=>sr("Node",e,"textContent"),contains:(e,t)=>ar("Node",e,"contains")(t),getRootNode:e=>ar("Node",e,"getRootNode")(),host:e=>e&&"host"in e?sr("ShadowRoot",e,"host"):null,styleSheets:e=>e.styleSheets,shadowRoot:e=>e&&"shadowRoot"in e?sr("Element",e,"shadowRoot"):null,querySelector:(e,t)=>sr("Element",e,"querySelector")(t),querySelectorAll:(e,t)=>sr("Element",e,"querySelectorAll")(t),mutationObserver:()=>ir("MutationObserver").constructor},ur="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.",cr={map:{},getId(){return console.error(ur),-1},getNode(){return console.error(ur),null},removeNodeFromMap(){console.error(ur)},has(){return console.error(ur),!1},reset(){console.error(ur)}};"undefined"!=typeof window&&window.Proxy&&window.Reflect&&(cr=new Proxy(cr,{get(e,t,r){return"map"===t&&console.error(ur),Reflect.get(e,t,r)}}));var dr,hr=Date.now;function pr(e){return e?e.nodeType===e.ELEMENT_NODE?e:lr.parentElement(e):null}function vr(e){var t,r=null;return"getRootNode"in e&&(null==(t=lr.getRootNode(e))?void 0:t.nodeType)===Node.DOCUMENT_FRAGMENT_NODE&&lr.host(lr.getRootNode(e))&&(r=lr.host(lr.getRootNode(e))),r}function gr(e){for(var t,r=e;t=vr(r);)r=t;return r}function _r(e){var t=e.ownerDocument;if(!t)return!1;var r=gr(e);return lr.contains(t,r)}/[1-9][0-9]{12}/.test(Date.now().toString())||(hr=()=>(new Date).getTime());for(var fr=(Object.freeze(Object.defineProperty({__proto__:null,StyleSheetMirror:class{constructor(){qt(this,"id",1),qt(this,"styleIDMap",new WeakMap),qt(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 cr},closestElementOfNode:pr,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(e){var t=[...e],r=t.pop();return{positions:t,index:r}},getRootShadowHost:gr,getShadowHost:vr,getWindowHeight:()=>window.innerHeight||document.documentElement&&document.documentElement.clientHeight||document.body&&document.body.clientHeight,getWindowScroll(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=lr.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=lr.parentElement(s.body))?void 0:i.scrollTop)||(null==(n=null==s?void 0:s.body)?void 0:n.scrollTop)||0}},getWindowWidth:()=>window.innerWidth||document.documentElement&&document.documentElement.clientWidth||document.body&&document.body.clientWidth,hasShadowRoot:e=>!!e&&(e instanceof Qt&&"shadowRoot"in e?Boolean(e.shadowRoot):Boolean(lr.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(e){var t=e.ownerDocument;return!!t&&(lr.contains(t,e)||_r(e))},isAncestorRemoved:function e(t,r){if(n=(i=t)&&"host"in i&&"mode"in i&&Kt.host(i)||null,Boolean(n&&"shadowRoot"in n&&Kt.shadowRoot(n)===i))return!1;var i,n,s=r.getId(t);if(!r.has(s))return!0;var o=lr.parentNode(t);return(!o||o.nodeType!==t.DOCUMENT_NODE)&&(!o||e(o,r))},isBlocked(e,t,r,i){if(!e)return!1;var n=pr(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(Jt(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:(e,t,r)=>!("TITLE"!==e.tagName||!r.headTitleMutations)||-2===t.getId(e),isSerialized:(e,t)=>-1!==t.getId(e),isSerializedIframe:(e,t)=>Boolean("IFRAME"===e.nodeName&&t.getMeta(e)),isSerializedStylesheet:(e,t)=>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:e=>Boolean(e.changedTouches),get nowTimestamp(){return hr},on(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(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(e){void 0===e&&(e=window),"NodeList"in e&&!e.NodeList.prototype.forEach&&(e.NodeList.prototype.forEach=[].forEach),"DOMTokenList"in e&&!e.DOMTokenList.prototype.forEach&&(e.DOMTokenList.prototype.forEach=[].forEach)},queueToResolveTrees(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:_r,throttle(e,t,r){void 0===r&&(r={});var i=null,n=0;return function(){for(var s=arguments.length,o=new Array(s),a=0;s>a;a++)o[a]=arguments[a];var l=Date.now();n||!1!==r.leading||(n=l);var u=t-(l-n),c=this;0>=u||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(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"}))),mr="undefined"==typeof Uint8Array?[]:new Uint8Array(256),yr=0;64>yr;yr++)mr["ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charCodeAt(yr)]=yr;"undefined"!=typeof window&&window.Blob&&new Blob([Uint8Array.from(atob("KGZ1bmN0aW9uKCkgewogICJ1c2Ugc3RyaWN0IjsKICB2YXIgY2hhcnMgPSAiQUJDREVGR0hJSktMTU5PUFFSU1RVVldYWVphYmNkZWZnaGlqa2xtbm9wcXJzdHV2d3h5ejAxMjM0NTY3ODkrLyI7CiAgdmFyIGxvb2t1cCA9IHR5cGVvZiBVaW50OEFycmF5ID09PSAidW5kZWZpbmVkIiA/IFtdIDogbmV3IFVpbnQ4QXJyYXkoMjU2KTsKICBmb3IgKHZhciBpID0gMDsgaSA8IGNoYXJzLmxlbmd0aDsgaSsrKSB7CiAgICBsb29rdXBbY2hhcnMuY2hhckNvZGVBdChpKV0gPSBpOwogIH0KICB2YXIgZW5jb2RlID0gZnVuY3Rpb24oYXJyYXlidWZmZXIpIHsKICAgIHZhciBieXRlcyA9IG5ldyBVaW50OEFycmF5KGFycmF5YnVmZmVyKSwgaTIsIGxlbiA9IGJ5dGVzLmxlbmd0aCwgYmFzZTY0ID0gIiI7CiAgICBmb3IgKGkyID0gMDsgaTIgPCBsZW47IGkyICs9IDMpIHsKICAgICAgYmFzZTY0ICs9IGNoYXJzW2J5dGVzW2kyXSA+PiAyXTsKICAgICAgYmFzZTY0ICs9IGNoYXJzWyhieXRlc1tpMl0gJiAzKSA8PCA0IHwgYnl0ZXNbaTIgKyAxXSA+PiA0XTsKICAgICAgYmFzZTY0ICs9IGNoYXJzWyhieXRlc1tpMiArIDFdICYgMTUpIDw8IDIgfCBieXRlc1tpMiArIDJdID4+IDZdOwogICAgICBiYXNlNjQgKz0gY2hhcnNbYnl0ZXNbaTIgKyAyXSAmIDYzXTsKICAgIH0KICAgIGlmIChsZW4gJSAzID09PSAyKSB7CiAgICAgIGJhc2U2NCA9IGJhc2U2NC5zdWJzdHJpbmcoMCwgYmFzZTY0Lmxlbmd0aCAtIDEpICsgIj0iOwogICAgfSBlbHNlIGlmIChsZW4gJSAzID09PSAxKSB7CiAgICAgIGJhc2U2NCA9IGJhc2U2NC5zdWJzdHJpbmcoMCwgYmFzZTY0Lmxlbmd0aCAtIDIpICsgIj09IjsKICAgIH0KICAgIHJldHVybiBiYXNlNjQ7CiAgfTsKICBjb25zdCBsYXN0QmxvYk1hcCA9IC8qIEBfX1BVUkVfXyAqLyBuZXcgTWFwKCk7CiAgY29uc3QgdHJhbnNwYXJlbnRCbG9iTWFwID0gLyogQF9fUFVSRV9fICovIG5ldyBNYXAoKTsKICBhc3luYyBmdW5jdGlvbiBnZXRUcmFuc3BhcmVudEJsb2JGb3Iod2lkdGgsIGhlaWdodCwgZGF0YVVSTE9wdGlvbnMpIHsKICAgIGNvbnN0IGlkID0gYCR7d2lkdGh9LSR7aGVpZ2h0fWA7CiAgICBpZiAoIk9mZnNjcmVlbkNhbnZhcyIgaW4gZ2xvYmFsVGhpcykgewogICAgICBpZiAodHJhbnNwYXJlbnRCbG9iTWFwLmhhcyhpZCkpIHJldHVybiB0cmFuc3BhcmVudEJsb2JNYXAuZ2V0KGlkKTsKICAgICAgY29uc3Qgb2Zmc2NyZWVuID0gbmV3IE9mZnNjcmVlbkNhbnZhcyh3aWR0aCwgaGVpZ2h0KTsKICAgICAgb2Zmc2NyZWVuLmdldENvbnRleHQoIjJkIik7CiAgICAgIGNvbnN0IGJsb2IgPSBhd2FpdCBvZmZzY3JlZW4uY29udmVydFRvQmxvYihkYXRhVVJMT3B0aW9ucyk7CiAgICAgIGNvbnN0IGFycmF5QnVmZmVyID0gYXdhaXQgYmxvYi5hcnJheUJ1ZmZlcigpOwogICAgICBjb25zdCBiYXNlNjQgPSBlbmNvZGUoYXJyYXlCdWZmZXIpOwogICAgICB0cmFuc3BhcmVudEJsb2JNYXAuc2V0KGlkLCBiYXNlNjQpOwogICAgICByZXR1cm4gYmFzZTY0OwogICAgfSBlbHNlIHsKICAgICAgcmV0dXJuICIiOwogICAgfQogIH0KICBjb25zdCB3b3JrZXIgPSBzZWxmOwogIHdvcmtlci5vbm1lc3NhZ2UgPSBhc3luYyBmdW5jdGlvbihlKSB7CiAgICBpZiAoIk9mZnNjcmVlbkNhbnZhcyIgaW4gZ2xvYmFsVGhpcykgewogICAgICBjb25zdCB7IGlkLCBiaXRtYXAsIHdpZHRoLCBoZWlnaHQsIGRhdGFVUkxPcHRpb25zIH0gPSBlLmRhdGE7CiAgICAgIGNvbnN0IHRyYW5zcGFyZW50QmFzZTY0ID0gZ2V0VHJhbnNwYXJlbnRCbG9iRm9yKAogICAgICAgIHdpZHRoLAogICAgICAgIGhlaWdodCwKICAgICAgICBkYXRhVVJMT3B0aW9ucwogICAgICApOwogICAgICBjb25zdCBvZmZzY3JlZW4gPSBuZXcgT2Zmc2NyZWVuQ2FudmFzKHdpZHRoLCBoZWlnaHQpOwogICAgICBjb25zdCBjdHggPSBvZmZzY3JlZW4uZ2V0Q29udGV4dCgiMmQiKTsKICAgICAgY3R4LmRyYXdJbWFnZShiaXRtYXAsIDAsIDApOwogICAgICBiaXRtYXAuY2xvc2UoKTsKICAgICAgY29uc3QgYmxvYiA9IGF3YWl0IG9mZnNjcmVlbi5jb252ZXJ0VG9CbG9iKGRhdGFVUkxPcHRpb25zKTsKICAgICAgY29uc3QgdHlwZSA9IGJsb2IudHlwZTsKICAgICAgY29uc3QgYXJyYXlCdWZmZXIgPSBhd2FpdCBibG9iLmFycmF5QnVmZmVyKCk7CiAgICAgIGNvbnN0IGJhc2U2NCA9IGVuY29kZShhcnJheUJ1ZmZlcik7CiAgICAgIGlmICghbGFzdEJsb2JNYXAuaGFzKGlkKSAmJiBhd2FpdCB0cmFuc3BhcmVudEJhc2U2NCA9PT0gYmFzZTY0KSB7CiAgICAgICAgbGFzdEJsb2JNYXAuc2V0KGlkLCBiYXNlNjQpOwogICAgICAgIHJldHVybiB3b3JrZXIucG9zdE1lc3NhZ2UoeyBpZCB9KTsKICAgICAgfQogICAgICBpZiAobGFzdEJsb2JNYXAuZ2V0KGlkKSA9PT0gYmFzZTY0KSByZXR1cm4gd29ya2VyLnBvc3RNZXNzYWdlKHsgaWQgfSk7CiAgICAgIHdvcmtlci5wb3N0TWVzc2FnZSh7CiAgICAgICAgaWQsCiAgICAgICAgdHlwZSwKICAgICAgICBiYXNlNjQsCiAgICAgICAgd2lkdGgsCiAgICAgICAgaGVpZ2h0CiAgICAgIH0pOwogICAgICBsYXN0QmxvYk1hcC5zZXQoaWQsIGJhc2U2NCk7CiAgICB9IGVsc2UgewogICAgICByZXR1cm4gd29ya2VyLnBvc3RNZXNzYWdlKHsgaWQ6IGUuZGF0YS5pZCB9KTsKICAgIH0KICB9Owp9KSgpOwovLyMgc291cmNlTWFwcGluZ1VSTD1pbWFnZS1iaXRtYXAtZGF0YS11cmwtd29ya2VyLUlKcEM3Z19iLmpzLm1hcAo="),(e=>e.charCodeAt(0)))],{type:"text/javascript;charset=utf-8"});try{if(2!==Array.from([1],(e=>2*e))[0]){var br=document.createElement("iframe");document.body.appendChild(br),Array.from=(null==(Ot=br.contentWindow)?void 0:Ot.Array.from)||Array.from,document.body.removeChild(br)}}catch(e){console.debug("Unable to override Array.from",e)}new class{constructor(){Ut(this,"idNodeMap",new Map),Ut(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){this.idNodeMap.set(t.id,e),this.nodeMetaMap.set(e,t)}replace(e,t){var r=this.getNode(e);if(r){var i=this.nodeMetaMap.get(r);i&&this.nodeMetaMap.set(t,i)}this.idNodeMap.set(e,t)}reset(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap}},function(e){e[e.NotStarted=0]="NotStarted",e[e.Running=1]="Running",e[e.Stopped=2]="Stopped"}(dr||(dr={}));class wr{constructor(e){Bt(this,"fileName"),Bt(this,"functionName"),Bt(this,"lineNumber"),Bt(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 Sr=/(^|@)\S+:\d+/,Cr=/^\s*at .*(\S+:\d+|\(native\))/m,Ir=/^(eval@)?(\[native code])?$/,xr={parse(e){return e?void 0!==e.stacktrace||void 0!==e["opera#sourceloc"]?this.parseOpera(e):e.stack&&e.stack.match(Cr)?this.parseV8OrIE(e):e.stack?this.parseFFOrSafari(e):(console.warn("[console-record-plugin]: Failed to parse error object:",e),[]):[]},extractLocation(e){if(-1===e.indexOf(":"))return[e];var t=/(.+?)(?::(\d+))?(?::(\d+))?$/.exec(e.replace(/[()]/g,""));if(!t)throw new Error("Cannot parse given url: "+e);return[t[1],t[2]||void 0,t[3]||void 0]},parseV8OrIE(e){return e.stack.split("\n").filter((function(e){return!!e.match(Cr)}),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 wr({functionName:s,fileName:o,lineNumber:n[1],columnNumber:n[2]})}),this)},parseFFOrSafari(e){return e.stack.split("\n").filter((function(e){return!e.match(Ir)}),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 wr({functionName:e});var t=/((.*".+"[^@]*)?[^@]*)(?:@)/,r=e.match(t),i=r&&r[1]?r[1]:void 0,n=this.extractLocation(e.replace(t,""));return new wr({functionName:i,fileName:n[0],lineNumber:n[1],columnNumber:n[2]})}),this)},parseOpera(e){return!e.stacktrace||e.message.indexOf("\n")>-1&&e.message.split("\n").length>e.stacktrace.split("\n").length?this.parseOpera9(e):e.stack?this.parseOpera11(e):this.parseOpera10(e)},parseOpera9(e){for(var t=/Line (\d+).*script (?:in )?(\S+)/i,r=e.message.split("\n"),i=[],n=2,s=r.length;s>n;n+=2){var o=t.exec(r[n]);o&&i.push(new wr({fileName:o[2],lineNumber:parseFloat(o[1])}))}return i},parseOpera10(e){for(var t=/Line (\d+).*script (?:in )?(\S+)(?:: In function (\S+))?$/i,r=e.stacktrace.split("\n"),i=[],n=0,s=r.length;s>n;n+=2){var o=t.exec(r[n]);o&&i.push(new wr({functionName:o[3]||void 0,fileName:o[2],lineNumber:parseFloat(o[1])}))}return i},parseOpera11(e){return e.stack.split("\n").filter((function(e){return!!e.match(Sr)&&!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 wr({functionName:i,fileName:r[0],lineNumber:r[1],columnNumber:r[2]})}),this)}};function kr(e){if(!e||!e.outerHTML)return"";for(var t="";e.parentElement;){var r=e.localName;if(!r)break;r=r.toLowerCase();var i=e.parentElement,n=[];if(i.children&&i.children.length>0)for(var s=0;i.children.length>s;s++){var o=i.children[s];o.localName&&o.localName.toLowerCase&&o.localName.toLowerCase()===r&&n.push(o)}n.length>1&&(r+=":eq("+n.indexOf(e)+")"),t=r+(t?">"+t:""),e=i}return t}function Er(e){return"[object Object]"==={}.toString.call(e)}function Tr(e,t){if(0===t)return!0;var r=Object.keys(e);for(var i of r)if(Er(e[i])&&Tr(e[i],t-1))return!0;return!1}function Rr(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(Er(o=t)&&Object.keys(o).length>r.numOfKeysLimit||"function"==typeof o||Er(o)&&Tr(o,r.depthOfLimit))return function(e){var t=e.toString();return r.stringLengthLimit&&t.length>r.stringLengthLimit&&(t=t.slice(0,r.stringLengthLimit)+"..."),t}(t);var o;if("bigint"==typeof t)return t.toString()+"n";if(t instanceof Event){var a={};for(var l in t){var u=t[l];a[l]=Array.isArray(u)?kr(u.length?u[0]:null):u}return a}return t instanceof Node?t instanceof HTMLElement?t?t.outerHTML:"":t.nodeName:t instanceof Error?t.stack?t.stack+"\nEnd of stack for Error object":t.name+": "+t.message:t}))}var Mr={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 Lr(e,t,r){var i,n=r?Object.assign({},Mr,r):Mr,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=xr.parse(t.error).map((e=>e.toString())),s=[Rr(r,n.stringifyOptions)];e({level:"error",trace:i,payload:s})};t.addEventListener("error",u),l.push((()=>{t.removeEventListener("error",u)}));var c=t=>{var r,i;t.reason instanceof Error?i=[Rr("Uncaught (in promise) "+(r=t.reason).name+": "+r.message,n.stringifyOptions)]:(r=new Error,i=[Rr("Uncaught (in promise)",n.stringifyOptions),Rr(t.reason,n.stringifyOptions)]);var s=xr.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]?fr.patch(t,r,(t=>function(){for(var s=arguments.length,l=new Array(s),u=0;s>u;u++)l[u]=arguments[u];if(t.apply(i,l),!("assert"===r&&l[0]||a)){a=!0;try{var c=xr.parse(new Error).map((e=>e.toString())).splice(1),d=("assert"===r?l.slice(1):l).map((e=>Rr(e,n.stringifyOptions)));o++,n.lengthThreshold>o?e({level:r,trace:c,payload:d}):o===n.lengthThreshold&&e({level:"warn",trace:[],payload:[Rr("The number of log records reached the threshold.")]})}catch(e){t("rrweb logger error:",e,...l)}finally{a=!1}}})):()=>{}}}var Pr=e=>({name:"rrweb/console@1",observer:Lr,options:e});function Ar(){return(Ar=t((function*(e,t,r){void 0===t&&(t=!0);try{var i=new Blob([e],{type:"text/plain"}).stream().pipeThrough(new CompressionStream("gzip"));return yield new Response(i).blob()}catch(e){if(null!=r&&r.rethrow)throw e;return t&&console.error("Failed to gzip compress data",e),null}}))).apply(this,arguments)}var Fr=["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"],Nr=function(e,t){if(void 0===t&&(t=[]),!e)return!1;var r=e.toLowerCase();return Fr.concat(t).some((e=>{var t=e.toLowerCase();return-1!==r.indexOf(t)}))},Or=function(e){return e.MinLength="min_length",e.MaxLength="max_length",e}({}),Dr=["$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 Br(e,t){return-1!==e.indexOf(t)}var Hr=function(e){return e.trim()},qr=function(e){return e.replace(/^\$/,"")},Vr=Object.prototype,Ur=Vr.hasOwnProperty,$r=Vr.toString,jr=Array.isArray||function(e){return"[object Array]"===$r.call(e)},zr=e=>"function"==typeof e,Wr=e=>e===Object(e)&&!jr(e),Zr=e=>{if(Wr(e)){for(var t in e)if(Ur.call(e,t))return!1;return!0}return!1},Gr=e=>void 0===e,Yr=e=>"[object String]"==$r.call(e),Xr=e=>Yr(e)&&0===e.trim().length,Kr=e=>null===e,Jr=e=>Gr(e)||Kr(e),Qr=e=>"[object Number]"==$r.call(e)&&e==e,ei=e=>Qr(e)&&e>0,ti=e=>"[object Boolean]"===$r.call(e),ri=e=>e instanceof FormData;function ii(e){return null===e||"object"!=typeof e}function ni(e,t){return{}.toString.call(e)==="[object "+t+"]"}function si(e){return"undefined"!=typeof Event&&function(e,t){try{return e instanceof t}catch(e){return!1}}(e,Event)}var oi=[!0,"true",1,"1","yes"],ai=e=>Br(oi,e),li=[!1,"false",0,"0","no"];function ui(e,t,r,i,n){return t>r&&(i.warn("min cannot be greater than max."),t=r),Qr(e)?e>r?(i.warn(" cannot be greater than max: "+r+". Using max value instead."),r):t>e?(i.warn(" cannot be less than min: "+t+". Using min value instead."),t):e:(i.warn(" must be a number. using max or fallback. max: "+r+", fallback: "+n),ui(n||r,t,r,i))}class ci{constructor(e){this._buckets={},this._onBucketRateLimited=e._onBucketRateLimited,this._bucketSize=ui(e.bucketSize,0,100,e._logger),this._refillRate=ui(e.refillRate,0,this._bucketSize,e._logger),this._refillInterval=ui(e.refillInterval,0,864e5,e._logger)}_applyRefill(e,t){var r=Math.floor((t-e.lastAccess)/this._refillInterval);r>0&&(e.tokens=Math.min(e.tokens+r*this._refillRate,this._bucketSize),e.lastAccess=e.lastAccess+r*this._refillInterval)}consumeRateLimit(e){var t,r=Date.now(),i=String(e),n=this._buckets[i];return n?this._applyRefill(n,r):this._buckets[i]=n={tokens:this._bucketSize,lastAccess:r},0===n.tokens||(n.tokens--,0===n.tokens&&(null==(t=this._onBucketRateLimited)||t.call(this,e)),0===n.tokens)}stop(){this._buckets={}}}var di,hi,pi,vi="Mobile",gi="iOS",_i="Android",fi="Tablet",mi=_i+" "+fi,yi="iPad",bi="Apple",wi=bi+" Watch",Si="Safari",Ci="BlackBerry",Ii="Samsung",xi=Ii+"Browser",ki=Ii+" Internet",Ei="Chrome",Ti=Ei+" OS",Ri=Ei+" "+gi,Mi="Internet Explorer",Li=Mi+" "+vi,Pi="Opera",Ai=Pi+" Mini",Fi="Edge",Ni="Microsoft "+Fi,Oi="Firefox",Di=Oi+" "+gi,Bi="Nintendo",Hi="PlayStation",qi="Xbox",Vi=_i+" "+vi,Ui=vi+" "+Si,$i="Windows",ji=$i+" Phone",zi="Nokia",Wi="Ouya",Zi="Generic",Gi=Zi+" "+vi.toLowerCase(),Yi=Zi+" "+fi.toLowerCase(),Xi="Konqueror",Ki="(\\d+(\\.\\d+)?)",Ji=new RegExp("Version/"+Ki),Qi=new RegExp(qi,"i"),en=new RegExp(Hi+" \\w+","i"),tn=new RegExp(Bi+" \\w+","i"),rn=new RegExp(Ci+"|PlayBook|BB10","i"),nn={"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"},sn=function(e,t){return t=t||"",Br(e," OPR/")&&Br(e,"Mini")?Ai:Br(e," OPR/")?Pi:rn.test(e)?Ci:Br(e,"IE"+vi)||Br(e,"WPDesktop")?Li:Br(e,xi)?ki:Br(e,Fi)||Br(e,"Edg/")?Ni:Br(e,"FBIOS")?"Facebook "+vi:Br(e,"UCWEB")||Br(e,"UCBrowser")?"UC Browser":Br(e,"CriOS")?Ri:Br(e,"CrMo")||Br(e,Ei)?Ei:Br(e,_i)&&Br(e,Si)?Vi:Br(e,"FxiOS")?Di:Br(e.toLowerCase(),Xi.toLowerCase())?Xi:((e,t)=>t&&Br(t,bi)||function(e){return Br(e,Si)&&!Br(e,Ei)&&!Br(e,_i)}(e))(e,t)?Br(e,vi)?Ui:Si:Br(e,Oi)?Oi:Br(e,"MSIE")||Br(e,"Trident/")?Mi:Br(e,"Gecko")?Oi:""},on={[Li]:[new RegExp("rv:"+Ki)],[Ni]:[new RegExp(Fi+"?\\/"+Ki)],[Ei]:[new RegExp("("+Ei+"|CrMo)\\/"+Ki)],[Ri]:[new RegExp("CriOS\\/"+Ki)],"UC Browser":[new RegExp("(UCBrowser|UCWEB)\\/"+Ki)],[Si]:[Ji],[Ui]:[Ji],[Pi]:[new RegExp("(Opera|OPR)\\/"+Ki)],[Oi]:[new RegExp(Oi+"\\/"+Ki)],[Di]:[new RegExp("FxiOS\\/"+Ki)],[Xi]:[new RegExp("Konqueror[:/]?"+Ki,"i")],[Ci]:[new RegExp(Ci+" "+Ki),Ji],[Vi]:[new RegExp("android\\s"+Ki,"i")],[ki]:[new RegExp(xi+"\\/"+Ki)],[Mi]:[new RegExp("(rv:|MSIE )"+Ki)],Mozilla:[new RegExp("rv:"+Ki)]},an=function(e,t){var r=sn(e,t),i=on[r];if(Gr(i))return null;for(var n=0;i.length>n;n++){var s=e.match(i[n]);if(s)return parseFloat(s[s.length-2])}return null},ln=[[new RegExp(qi+"; "+qi+" (.*?)[);]","i"),e=>[qi,e&&e[1]||""]],[new RegExp(Bi,"i"),[Bi,""]],[new RegExp(Hi,"i"),[Hi,""]],[rn,[Ci,""]],[new RegExp($i,"i"),(e,t)=>{if(/Phone/.test(t)||/WPDesktop/.test(t))return[ji,""];if(new RegExp(vi).test(t)&&!/IEMobile\b/.test(t))return[$i+" "+vi,""];var r=/Windows NT ([0-9.]+)/i.exec(t);if(r&&r[1]){var i=nn[r[1]]||"";return/arm/i.test(t)&&(i="RT"),[$i,i]}return[$i,""]}],[/((iPhone|iPad|iPod).*?OS (\d+)_(\d+)_?(\d+)?|iPhone)/,e=>e&&e[3]?[gi,[e[3],e[4],e[5]||"0"].join(".")]:[gi,""]],[/(watch.*\/(\d+\.\d+\.\d+)|watch os,(\d+\.\d+),)/i,e=>{var t="";return e&&e.length>=3&&(t=Gr(e[2])?e[3]:e[2]),["watchOS",t]}],[new RegExp("("+_i+" (\\d+)\\.(\\d+)\\.?(\\d+)?|"+_i+")","i"),e=>e&&e[2]?[_i,[e[2],e[3],e[4]||"0"].join(".")]:[_i,""]],[/Mac OS X (\d+)[_.](\d+)[_.]?(\d+)?/i,e=>{var t=["Mac OS X",""];return e&&e[1]&&(t[1]=[e[1],e[2],e[3]||"0"].join(".")),t}],[/Mac/i,["Mac OS X",""]],[/CrOS/,[Ti,""]],[/Linux|debian/i,["Linux",""]]],un=function(e){return tn.test(e)?Bi:en.test(e)?Hi:Qi.test(e)?qi:new RegExp(Wi,"i").test(e)?Wi:new RegExp("("+ji+"|WPDesktop)","i").test(e)?ji:/iPad/.test(e)?yi:/iPod/.test(e)?"iPod Touch":/iPhone/.test(e)?"iPhone":/(watch)(?: ?os[,/]|\d,\d\/)[\d.]+/i.test(e)?wi:rn.test(e)?Ci:/(kobo)\s(ereader|touch)/i.test(e)?"Kobo":new RegExp(zi,"i").test(e)?zi:/(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(vi).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)?_i:mi:new RegExp("(pda|"+vi+")","i").test(e)?Gi:new RegExp(fi,"i").test(e)&&!new RegExp(fi+" pc","i").test(e)?Yi:""},cn=function(e,t){var r,i,n,s,o=un(e);return o===yi||o===mi||"Kobo"===o||"Kindle Fire"===o||o===Yi?fi:o===Bi||o===qi||o===Hi||o===Wi?"Console":o===wi?"Wearable":o?vi:"Android"===(null==t?void 0:t.userAgentDataPlatform)&&(null!==(r=null==t?void 0:t.maxTouchPoints)&&void 0!==r?r:0)>0?600>Math.min(null!==(i=null==t?void 0:t.screenWidth)&&void 0!==i?i:0,null!==(n=null==t?void 0:t.screenHeight)&&void 0!==n?n:0)/(null!==(s=null==t?void 0:t.devicePixelRatio)&&void 0!==s?s:1)?vi:fi:"Desktop"},dn={trace:{text:"TRACE",number:1},debug:{text:"DEBUG",number:5},info:{text:"INFO",number:9},warn:{text:"WARN",number:13},error:{text:"ERROR",number:17},fatal:{text:"FATAL",number:21}},hn=dn.info;function pn(e){if(ti(e))return{boolValue:e};if("number"==typeof e)return Number.isFinite(e)?Number.isInteger(e)?{intValue:e}:{doubleValue:e}:{stringValue:String(e)};if("string"==typeof e)return{stringValue:e};if(jr(e))return{arrayValue:{values:e.map((e=>pn(e)))}};try{return{stringValue:JSON.stringify(e)}}catch(t){return{stringValue:String(e)}}}function vn(e){var t=[];for(var r in e){var i=e[r];Kr(i)||Gr(i)||t.push({key:r,value:pn(i)})}return t}function gn(e,t){if(e){var r=e.find((e=>e.type===t));return null==r?void 0:r.value}}function _n(e){var t=globalThis._posthogChunkIds;if(t){var r=Object.keys(t);return pi&&r.length===hi||(hi=r.length,pi=r.reduce(((r,i)=>{di||(di={});var n=di[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,di[i]=[l,u];break}}return r}),{})),pi}}class fn{constructor(e,t,r){void 0===r&&(r=[]),this.coercers=e,this.stackParser=t,this.modifiers=r}buildFromUnknown(e,t){void 0===t&&(t={});var r=t&&t.mechanism||{handled:!0,type:"generic"},i=this.buildCoercingContext(r,t,0).apply(e),n=this.buildParsingContext(t),s=this.parseStacktrace(i,n);return{$exception_list:this.convertToExceptionList(s,r),$exception_level:"error"}}modifyFrames(e){var r=this;return t((function*(){for(var t of e)t.stacktrace&&t.stacktrace.frames&&jr(t.stacktrace.frames)&&(t.stacktrace.frames=yield r.applyModifiers(t.stacktrace.frames));return e}))()}coerceFallback(e){var t;return{type:"Error",value:"Unknown error",stack:null==(t=e.syntheticException)?void 0:t.stack,synthetic:!0}}parseStacktrace(e,t){var i,n;return null!=e.cause&&(i=this.parseStacktrace(e.cause,t)),""!=e.stack&&null!=e.stack&&(n=this.applyChunkIds(this.stackParser(e.stack,e.synthetic?t.skipFirstLines:0),t.chunkIdMap)),r({},e,{cause:i,stack:n})}applyChunkIds(e,t){return e.map((e=>(e.filename&&t&&(e.chunk_id=t[e.filename]),e)))}applyCoercers(e,t){for(var r of this.coercers)if(r.match(e))return r.coerce(e,t);return this.coerceFallback(t)}applyModifiers(e){var r=this;return t((function*(){var t=e;for(var i of r.modifiers)t=yield i(t);return t}))()}convertToExceptionList(e,t){var i,n,s,o={type:e.type,value:e.value,mechanism:{type:null!==(i=t.type)&&void 0!==i?i:"generic",handled:null===(n=t.handled)||void 0===n||n,synthetic:null!==(s=e.synthetic)&&void 0!==s&&s}};e.stack&&(o.stacktrace={type:"raw",frames:e.stack});var a=[o];return null!=e.cause&&a.push(...this.convertToExceptionList(e.cause,r({},t,{handled:!0}))),a}buildParsingContext(e){var t;return{chunkIdMap:_n(this.stackParser),skipFirstLines:null!==(t=e.skipFirstLines)&&void 0!==t?t:1}}buildCoercingContext(e,t,i){void 0===i&&(i=0);var n=(r,i)=>{if(4>=i){var n=this.buildCoercingContext(e,t,i);return this.applyCoercers(r,n)}};return r({},t,{syntheticException:0==i?t.syntheticException:void 0,mechanism:e,apply:e=>n(e,i),next:e=>n(e,i+1)})}}var mn="?";function yn(e,t,r,i,n){var s={platform:e,filename:t,function:"<anonymous>"===r?mn:r,in_app:!0};return Gr(i)||(s.lineno=i),Gr(n)||(s.colno=n),s}var bn=(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]:mn,r?"safari-extension:"+t:"safari-web-extension:"+t]:[e,t]},wn=/^\s*at (\S+?)(?::(\d+))(?::(\d+))\s*$/i,Sn=/^\s*at (?:(.+?\)(?: \[.+\])?|.*?) ?\((?:address at )?)?(?:async )?((?:<anonymous>|[-a-z]+:|.*bundle|\/)?.*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i,Cn=/\((\S*)(?::(\d+))(?::(\d+))\)/,In=(e,t)=>{var r=wn.exec(e);if(r){var[,i,n,s]=r;return yn(t,i,mn,+n,+s)}var o=Sn.exec(e);if(o){if(o[2]&&0===o[2].indexOf("eval")){var a=Cn.exec(o[2]);a&&(o[2]=a[1],o[3]=a[2],o[4]=a[3])}var[l,u]=bn(o[1]||mn,o[2]);return yn(t,u,l,o[3]?+o[3]:void 0,o[4]?+o[4]:void 0)}},xn=/^\s*(.*?)(?:\((.*?)\))?(?:^|@)?((?:[-a-z]+)?:\/.*?|\[native code\]|[^@]*(?:bundle|\d+\.js)|\/[\w\-. /=]+)(?::(\d+))?(?::(\d+))?\s*$/i,kn=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i,En=(e,t)=>{var r=xn.exec(e);if(r){if(r[3]&&r[3].indexOf(" > eval")>-1){var i=kn.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]||mn;return[s,n]=bn(s,n),yn(t,n,s,r[4]?+r[4]:void 0,r[5]?+r[5]:void 0)}},Tn=/\(error: (.*)\)/,Rn=50;class Mn{match(e){return this.isDOMException(e)||this.isDOMError(e)}coerce(e,t){var r=Yr(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 ni(e,"DOMException")}isDOMError(e){return ni(e,"DOMError")}}class Ln{match(e){return e instanceof Error}coerce(e,t){return{type:this.getType(e),value:this.getMessage(e,t),stack:this.getStack(e),cause:e.cause?t.next(e.cause):void 0,synthetic:!1}}getType(e){return e.name||e.constructor.name}getMessage(e,t){var r=e.message;return String(r.error&&"string"==typeof r.error.message?r.error.message:r)}getStack(e){return e.stacktrace||e.stack||void 0}}class Pn{constructor(){}match(e){return ni(e,"ErrorEvent")&&null!=e.error}coerce(e,t){var r;return t.apply(e.error)||{type:"ErrorEvent",value:e.message,stack:null==(r=t.syntheticException)?void 0:r.stack,synthetic:!0}}}var An=/^(?:[Uu]ncaught (?:exception: )?)?(?:((?:Eval|Internal|Range|Reference|Syntax|Type|URI|)Error): )?(.*)$/i;class Fn{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(An);return i&&(t=i[1],r=i[2]),[t,r]}}var Nn=["fatal","error","warning","log","info","debug"];function On(e,t){void 0===t&&(t=40);var r=Object.keys(e);if(r.sort(),!r.length)return"[object has no keys]";for(var i=r.length;i>0;i--){var n=r.slice(0,i).join(", ");if(t>=n.length)return i===r.length?n:n.length>t?n.slice(0,t)+"...":n}return""}class Dn{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 si(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: "+On(e)}isSeverityLevel(e){return Yr(e)&&!Xr(e)&&Nn.indexOf(e)>=0}getErrorPropertyFromObject(e){for(var t in e)if({}.hasOwnProperty.call(e,t)){var r=e[t];if(r instanceof Error)return r}}getObjectClassName(e){try{var t=Object.getPrototypeOf(e);return t?t.constructor.name:void 0}catch(e){return}}}class Bn{match(e){return si(e)}coerce(e,t){var r,i=e.constructor.name;return{type:i,value:i+" captured as exception with keys: "+On(e),stack:null==(r=t.syntheticException)?void 0:r.stack,synthetic:!0}}}class Hn{match(e){return ii(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 qn{match(e){return ni(e,"PromiseRejectionEvent")||this.isCustomEventWrappingRejection(e)}isCustomEventWrappingRejection(e){if(!si(e))return!1;try{var t=e.detail;return null!=t&&"object"==typeof t&&"reason"in t}catch(e){return!1}}coerce(e,t){var r,i=this.getUnhandledRejectionReason(e);return ii(i)?{type:"UnhandledRejection",value:"Non-Error promise rejection captured with value: "+String(i),stack:null==(r=t.syntheticException)?void 0:r.stack,synthetic:!0}:t.apply(i)}getUnhandledRejectionReason(e){try{if("reason"in e)return e.reason;if("detail"in e&&null!=e.detail&&"object"==typeof e.detail&&"reason"in e.detail)return e.detail.reason}catch(e){}return e}}var Vn="$message",Un="$timestamp",$n=new Set([Vn,Un]),jn={enabled:!0,max_bytes:32768};function zn(e){var t;return e?{enabled:null!==(t=e.enabled)&&void 0!==t?t:jn.enabled,max_bytes:Zn(e.max_bytes,jn.max_bytes)}:r({},jn)}class Wn{constructor(e){this._entries=[],this._totalBytes=0,this._config=zn(e)}setConfig(e){this._config=zn(e),this._trimToMaxBytes()}add(e){var t=function(e){var t=function(e){var t=new WeakSet;try{return JSON.stringify(e,((e,r)=>{if("bigint"==typeof r)return r.toString();if("function"!=typeof r&&"symbol"!=typeof r){if(r instanceof Date)return r.toISOString();if(r instanceof Error)return{name:r.name,message:r.message,stack:r.stack};if(r&&"object"==typeof r){if(t.has(r))return"[Circular]";t.add(r)}return r}}))}catch(e){return}}(e);if(t)try{var r=JSON.parse(t);if(!Wr(r))return;var i=r,n=i[Vn],s=i[Un];if(!Yr(n)||0===n.trim().length)return;if(!Yr(s)&&!Qr(s))return;return{step:i,json:t}}catch(e){return}}(e);if(t){var r=function(e){if("undefined"!=typeof TextEncoder)return(new TextEncoder).encode(e).length;for(var t=encodeURIComponent(e),r=0,i=0;t.length>i;i++)"%"===t[i]?(r+=1,i+=2):r+=1;return r}(t.json);r>this._config.max_bytes||(this._entries.push({step:t.step,bytes:r}),this._totalBytes+=r,this._trimToMaxBytes())}}getAttachable(){return this._entries.map((e=>e.step))}clear(){this._entries=[],this._totalBytes=0}size(){return this._entries.length}_trimToMaxBytes(){for(;this._totalBytes>this._config.max_bytes&&this._entries.length>0;){var e=this._entries.shift();e&&(this._totalBytes-=e.bytes)}}}function Zn(e,t){if(!Qr(e)||e===1/0||e===-1/0)return t;var r=Math.floor(e);return 0>r?t:r}var Gn="undefined"!=typeof window?window:void 0,Yn="undefined"!=typeof globalThis?globalThis:Gn;"undefined"==typeof self&&(Yn.self=Yn),"undefined"==typeof File&&(Yn.File=function(){});var Xn=null==Yn?void 0:Yn.navigator,Kn=null==Yn?void 0:Yn.document,Jn=null==Yn?void 0:Yn.location,Qn=null==Yn?void 0:Yn.fetch,es=null!=Yn&&Yn.XMLHttpRequest&&"withCredentials"in new Yn.XMLHttpRequest?Yn.XMLHttpRequest:void 0,ts=null==Yn?void 0:Yn.AbortController,rs=null==Yn?void 0:Yn.CompressionStream,is=null==Xn?void 0:Xn.userAgent,ns=null!=Gn?Gn:{},ss=e=>e instanceof Document,os="1.371.2",as={DEBUG:!1,LIB_VERSION:os,LIB_NAME:"web",JS_SDK_VERSION:os},ls=function(e,t){var{debugEnabled:r}=void 0===t?{}:t,i={_log(t){if(Gn&&(as.DEBUG||ns.POSTHOG_DEBUG||r)&&!Gr(Gn.console)&&Gn.console){for(var i=("__rrweb_original__"in Gn.console[t]?Gn.console[t].__rrweb_original__:Gn.console[t]),n=arguments.length,s=new Array(n>1?n-1:0),o=1;n>o;o++)s[o-1]=arguments[o];i(e,...s)}},info(){for(var e=arguments.length,t=new Array(e),r=0;e>r;r++)t[r]=arguments[r];i._log("log",...t)},warn(){for(var e=arguments.length,t=new Array(e),r=0;e>r;r++)t[r]=arguments[r];i._log("warn",...t)},error(){for(var e=arguments.length,t=new Array(e),r=0;e>r;r++)t[r]=arguments[r];i._log("error",...t)},critical(){for(var t=arguments.length,r=new Array(t),i=0;t>i;i++)r[i]=arguments[i];console.error(e,...r)},uninitializedWarning(e){i.error("You must initialize PostHog before calling "+e)},createLogger:(t,r)=>ls(e+" "+t,r)};return i},us=ls("[PostHog.js]"),cs=us.createLogger;function ds(e,t){jr(e)&&e.forEach(t)}function hs(e,t){if(!Jr(e))if(jr(e))e.forEach(t);else if(ri(e))e.forEach(((e,r)=>t(e,r)));else for(var r in e)Ur.call(e,r)&&t(e[r],r)}var ps=function(e){for(var t=arguments.length,r=new Array(t>1?t-1:0),i=1;t>i;i++)r[i-1]=arguments[i];for(var n of r)for(var s in n)void 0!==n[s]&&(e[s]=n[s]);return e};function vs(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 gs=function(e){try{return e()}catch(e){return}},_s=function(e){return function(){try{for(var t=arguments.length,r=new Array(t),i=0;t>i;i++)r[i]=arguments[i];return e.apply(this,r)}catch(e){us.critical("Implementation error. Please turn on debug mode and open a ticket on https://app.posthog.com/home#panel=support%3Asupport%3A."),us.critical(e)}}},fs=function(e){var t={};return hs(e,(function(e,r){(Yr(e)&&e.length>0||Qr(e))&&(t[r]=e)})),t};var ms=["herokuapp.com","vercel.app","netlify.app"];function ys(e){var t=null==e?void 0:e.hostname;if(!Yr(t))return!1;var r=t.split(".").slice(-2).join(".");for(var i of ms)if(r===i)return!1;return!0}function bs(e,t,r,i){var{capture:n=!1,passive:s=!0}=null!=i?i:{};null==e||e.addEventListener(t,r,{capture:n,passive:s})}function ws(e){return"ph_toolbar_internal"===e.name}var Ss=e=>{var t=null==Kn?void 0:Kn.createElement("a");return Gr(t)?null:(t.href=e,t)},Cs=function(e,t){var r,i;void 0===t&&(t="&");var n=[];return hs(e,(function(e,t){Gr(e)||Gr(t)||"undefined"===t||(r=encodeURIComponent(e instanceof File?e.name:e.toString()),i=encodeURIComponent(t),n[n.length]=i+"="+r)})),n.join(t)},Is=function(e,t){for(var r,i=((e.split("#")[0]||"").split(/\?(.*)/)[1]||"").replace(/^\?+/g,"").split("&"),n=0;i.length>n;n++){var s=i[n].split("=");if(s[0]===t){r=s;break}}if(!jr(r)||2>r.length)return"";var o=r[1];try{o=decodeURIComponent(o)}catch(e){us.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[1],s=(i[0]||"").split("?"),o=s[1],a=s[0],l=(o||"").split("&"),u=[],c=0;l.length>c;c++){var d=l[c].split("=");jr(d)&&(t.includes(d[0])?u.push(d[0]+"="+r):u.push(l[c]))}var h=a;return null!=o&&(h+="?"+u.join("&")),null!=n&&(h+="#"+n),h},ks=function(e,t){var r=e.match(new RegExp(t+"=([^&]*)"));return r?r[1]:null};function Es(e,t,r){try{if(!(t in e))return()=>{};var i=e[t],n=r(i);return zr(n)&&(n.prototype=n.prototype||{},Object.defineProperties(n,{__posthog_wrapped__:{enumerable:!1,value:!0}})),e[t]=n,()=>{e[t]=i}}catch(e){return()=>{}}}function Ts(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 Rs="$people_distinct_id",Ms="$device_id",Ls="__alias",Ps="__timers",As="$autocapture_disabled_server_side",Fs="$heatmaps_enabled_server_side",Ns="$exception_capture_enabled_server_side",Os="$error_tracking_suppression_rules",Ds="$error_tracking_capture_extension_exceptions",Bs="$web_vitals_enabled_server_side",Hs="$dead_clicks_enabled_server_side",qs="$product_tours_enabled_server_side",Vs="$web_vitals_allowed_metrics",Us="$session_recording_remote_config",$s="$replay_override_sampling",js="$replay_override_linked_flag",zs="$replay_override_url_trigger",Ws="$replay_override_event_trigger",Zs="$sesid",Gs="$session_is_sampled",Ys="$enabled_feature_flags",Xs="$active_feature_flags",Ks="$early_access_features",Js="$feature_flag_details",Qs="$feature_flag_payloads",eo="$feature_flag_request_id",to="$override_feature_flags",ro="$override_feature_flag_payloads",io="$stored_person_properties",no="$stored_group_properties",so="$surveys",oo="$surveys_activated",ao="ph_product_tours",lo="$flag_call_reported",uo="$flag_call_reported_session_id",co="$feature_flag_errors",ho="$feature_flag_evaluated_at",po="$user_state",vo="$client_session_props",go="$capture_rate_limit",_o="$initial_campaign_params",fo="$initial_referrer_info",mo="$initial_person_info",yo="$epp",bo="__POSTHOG_TOOLBAR__",wo="$posthog_cookieless",So="$sdk_debug_extensions_init_method",Co="$sdk_debug_extensions_init_time_ms",Io="$sdk_debug_recording_script_not_loaded",xo="PostHog loadExternalDependency extension not found.",ko="on_reject",Eo="always",To="anonymous",Ro="identified",Mo="identified_only",Lo="visibilitychange",Po="beforeunload",Ao="$pageview",Fo="$pageleave",No="$identify",Oo="$groupidentify";function Do(e){return e instanceof Element&&(e.id===bo||!(null==e.closest||!e.closest(".toolbar-global-fade-container")))}function Bo(e){return!!e&&1===e.nodeType}function Ho(e,t){return!!e&&!!e.tagName&&e.tagName.toLowerCase()===t.toLowerCase()}function qo(e){return!!e&&3===e.nodeType}function Vo(e){return!!e&&11===e.nodeType}function Uo(e){return e?Hr(e).split(/\s+/):[]}function $o(e){var t=null==Gn?void 0:Gn.location.href;return!!(t&&e&&e.some((e=>t.match(e))))}function jo(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 Uo(t)}function zo(e){return Jr(e)?null:Hr(e).split(/(\s+)/).filter((e=>ua(e))).join("").replace(/[\r\n]/g," ").replace(/[ ]+/g," ").substring(0,255)}function Wo(e){var t="";return ta(e)&&!ra(e)&&e.childNodes&&e.childNodes.length&&hs(e.childNodes,(function(e){var r;qo(e)&&e.textContent&&(t+=null!==(r=zo(e.textContent))&&void 0!==r?r:"")})),Hr(t)}function Zo(e){return Gr(e.target)?e.srcElement||null:null!=(t=e.target)&&t.shadowRoot?e.composedPath()[0]||null:e.target||null;var t}var Go=["a","button","form","input","select","textarea","label"];function Yo(e,t){if(Gr(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 Xo(e){var t=e.parentNode;return!(!t||!Bo(t))&&t}var Ko=["next","previous","prev",">","<"],Jo=[".ph-no-rageclick",".ph-no-capture"];var Qo=e=>!e||Ho(e,"html")||!Bo(e),ea=(e,t)=>{if(!Gn||Qo(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=Xo(n);if(!s)break;if(t||Go.indexOf(s.tagName.toLowerCase())>-1)r=!0;else{var o=Gn.getComputedStyle(s);o&&"pointer"===o.getPropertyValue("cursor")&&(r=!0)}i.push(s),n=s}return{parentIsUsefulElement:r,targetElementList:i}};function ta(e){for(var t=e;t.parentNode&&!Ho(t,"body");t=t.parentNode){var r=jo(t);if(Br(r,"ph-sensitive")||Br(r,"ph-no-capture"))return!1}if(Br(jo(e),"ph-include"))return!0;var i=e.type||"";if(Yr(i))switch(i.toLowerCase()){case"hidden":case"password":return!1}var n=e.name||e.id||"";return!Yr(n)||!/^cc|cardnum|ccnum|creditcard|csc|cvc|cvv|exp|pass|pwd|routing|seccode|securitycode|securitynum|socialsec|socsec|ssn/i.test(n.replace(/[^a-zA-Z0-9]/g,""))}function ra(e){return!!(Ho(e,"input")&&!["button","checkbox","submit","reset"].includes(e.type)||Ho(e,"select")||Ho(e,"textarea")||"true"===e.getAttribute("contenteditable"))}var ia="(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})",na=new RegExp("^(?:"+ia+")$"),sa=new RegExp(ia),oa="\\d{3}-?\\d{2}-?\\d{4}",aa=new RegExp("^("+oa+")$"),la=new RegExp("("+oa+")");function ua(e,t){if(void 0===t&&(t=!0),Jr(e))return!1;if(Yr(e)){if(e=Hr(e),(t?na:sa).test((e||"").replace(/[- ]/g,"")))return!1;if((t?aa:la).test(e))return!1}return!0}function ca(e){var t=Wo(e);return ua(t=(t+" "+da(e)).trim())?t:""}function da(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=Wo(e);t=(t+" "+i).trim(),e.childNodes&&e.childNodes.length&&(t=(t+" "+da(e)).trim())}catch(e){us.error("[AutoCapture]",e)}})),t}function ha(e){return e.replace(/"|\\"/g,'\\"')}function pa(e){var t=e.attr__class;return t?jr(t)?t:Uo(t):void 0}var va={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"]},ga=cs("[Recorder]"),_a=e=>"navigation"===e.entryType,fa=e=>"resource"===e.entryType;function ma(e,t){return!!t&&(ti(t)||t[e])}function ya(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(ti(r))return!0;if(jr(r))return s(r);var o=r[t];return ti(o)?o:s(o)}function ba(e,t,r,i,n,s){return wa.apply(this,arguments)}function wa(){return wa=t((function*(e,t,r,i,n,s){if(void 0===s&&(s=0),s>10)return ga.warn("Failed to get performance entry for request",{url:r,initiatorType:t}),null;var o=function(e,r){for(var s=e.length-1;s>=0;s-=1)if(fa(o=e[s])&&o.initiatorType===t&&(Gr(i)||o.startTime>=i)&&(Gr(n)||n>=o.startTime))return e[s];var o}(e.performance.getEntriesByName(r));return o||(yield new Promise((e=>setTimeout(e,50*s))),ba(e,t,r,i,n,s+1))})),wa.apply(this,arguments)}function Sa(e){var{body:t,options:r,url:i}=e;if(Jr(t))return null;var{hostname:n,isHostDenied:s}=Ts(i,r);if(s)return n+" is in deny list";if(Yr(t))return t;if(ss(t))return t.textContent;if(ri(t))return Cs(t);if(Wr(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 Ca=e=>!Kr(e)&&("navigation"===e.entryType||"resource"===e.entryType);function Ia(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:Gr(a)?void 0:Math.round(a),endTime:Gr(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(Ca(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 xa=["video/","audio/"];function ka(e){return new Promise((t=>{var r=setTimeout((()=>t("[SessionReplay] Timeout while trying to read body")),500);try{e.clone().text().then((e=>t(e)),(e=>t("[SessionReplay] Failed to read body: "+e))).finally((()=>clearTimeout(r)))}catch(e){clearTimeout(r),t("[SessionReplay] Failed to read body")}}))}function Ea(){return Ea=t((function*(e){var{r:t,options:r,url:i}=e,{hostname:n,isHostDenied:s}=Ts(i,r);return s?Promise.resolve(n+" is in deny list"):ka(t)})),Ea.apply(this,arguments)}function Ta(){return Ta=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=xa.some((e=>null==s?void 0:s.startsWith(e)));if(s&&o)return"Content-Type "+s+" is not supported";var{hostname:a,isHostDenied:l}=Ts(n,i);return l?a+" is in deny list":null}({r:t,options:r,url:i});return Kr(n)?ka(t):Promise.resolve(n)})),Ta.apply(this,arguments)}var Ra=null;function Ma(e,i,n){if(!("performance"in i))return()=>{};if(Ra)return ga.warn("Network observer already initialised, doing nothing"),()=>{};var s=n?Object.assign({},va,n):va,o=t=>{var i=[];t.requests.forEach((e=>{var t=s.maskRequestFn(e);t&&i.push(t)})),i.length>0&&e(r({},t,{requests:i}))},a=function(e,t,r){if(r.recordInitialRequests){var i=t.performance.getEntries().filter((e=>_a(e)||fa(e)&&r.initiatorTypes.includes(e.initiatorType)));e({requests:i.flatMap((e=>Ia({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=>_a(e)||fa(e)&&r.initiatorTypes.includes(e.initiatorType)&&(e=>!r.recordBody&&!r.recordHeaders||"xmlhttprequest"!==e.initiatorType&&"fetch"!==e.initiatorType)(e)));e({requests:i.flatMap((e=>Ia({entry:e,method:void 0,status:void 0,networkRequest:{}})))})})),s=PerformanceObserver.supportedEntryTypes.filter((e=>r.performanceEntryTypeToObserve.includes(e)));return n.observe({entryTypes:s}),()=>{n.disconnect()}}(o,i,s),l=()=>{},u=()=>{};return(s.recordHeaders||s.recordBody)&&(l=function(e,t,r){if(!r.initiatorTypes.includes("xmlhttprequest"))return()=>{};var i=ma("request",r.recordHeaders),n=ma("response",r.recordHeaders),s=Es(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=>(ya({type:"request",headers:_,url:a,recordBody:r.recordBody})&&(g.requestBody=Sa({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),ya({type:"response",headers:i,url:a,recordBody:r.recordBody})&&(g.responseBody=Sa({body:p.response,options:r,url:a})),ba(t,"xmlhttprequest",v.url,d,h).then((t=>{var r=Ia({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()}}(o,i,s),u=function(e,r,i){if(!i.initiatorTypes.includes("fetch"))return()=>{};var n=ma("request",i.recordHeaders),s=ma("response",i.recordHeaders),o=Es(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),ya({type:"request",headers:p,url:t,recordBody:i.recordBody})&&(h.requestBody=yield function(e){return Ea.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),ya({type:"response",headers:v,url:t,recordBody:i.recordBody})&&(h.responseBody=yield function(e){return Ta.apply(this,arguments)}({r:l,options:i,url:t})),l}finally{ba(r,"fetch",d.url,u,c).then((t=>{var r,i=Ia({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()}}(o,i,s)),Ra=()=>{a(),l(),u(),Ra=null}}var La=e=>({name:"rrweb/network@1",observer:Ma,options:e});ns.__PosthogExtensions__=ns.__PosthogExtensions__||{},ns.__PosthogExtensions__.rrwebPlugins={getRecordConsolePlugin:Pr,getRecordNetworkPlugin:La},ns.__PosthogExtensions__.rrweb={record:Nt,version:"v2"},ns.rrweb={record:Nt,version:"v2"},ns.rrwebConsoleRecord={getRecordConsolePlugin:Pr},ns.getRecordNetworkPlugin=La;var Pa,Aa,Fa,Na,Oa,Da,Ba,Ha,qa,Va,Ua,$a,ja={},za=[],Wa=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,Za=Array.isArray;function Ga(e,t){for(var r in t)e[r]=t[r];return e}function Ya(e){e&&e.parentNode&&e.parentNode.removeChild(e)}function Xa(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?Pa.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 Ka(e,o,i,n,null)}function Ka(e,t,r,i,n){var s={type:e,props:t,key:r,ref:i,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:null==n?++Fa:n,__i:-1,__u:0};return null==n&&null!=Aa.vnode&&Aa.vnode(s),s}function Ja(e){return e.children}function Qa(e,t){this.props=e,this.context=t}function el(e,t){if(null==t)return e.__?el(e.__,e.__i+1):null;for(var r;e.__k.length>t;t++)if(null!=(r=e.__k[t])&&null!=r.__e)return r.__e;return"function"==typeof e.type?el(e):null}function tl(e){var t,r;if(null!=(e=e.__)&&null!=e.__c){for(e.__e=e.__c.base=null,t=0;e.__k.length>t;t++)if(null!=(r=e.__k[t])&&null!=r.__e){e.__e=e.__c.base=r.__e;break}return tl(e)}}function rl(e){(!e.__d&&(e.__d=!0)&&Na.push(e)&&!$.__r++||Oa!=Aa.debounceRendering)&&((Oa=Aa.debounceRendering)||Da)($)}function $(){for(var e,t,r,i,n,s,o,a=1;Na.length;)Na.length>a&&Na.sort(Ba),e=Na.shift(),a=Na.length,e.__d&&(r=void 0,i=void 0,n=(i=(t=e).__v).__e,s=[],o=[],t.__P&&((r=Ga({},i)).__v=i.__v+1,Aa.vnode&&Aa.vnode(r),ul(t.__P,r,i,t.__n,t.__P.namespaceURI,32&i.__u?[n]:null,s,null==n?el(i):n,!!(32&i.__u),o),r.__v=i.__v,r.__.__k[r.__i]=r,dl(s,r,o),i.__e=i.__=null,r.__e!=n&&tl(r)));$.__r=0}function il(e,t,r,i,n,s,o,a,l,u,c){var d,h,p,v,g,_,f,m=i&&i.__k||za,y=t.length;for(l=function(e,t,r,i,n){var s,o,a,l,u,c=r.length,d=c,h=0;for(e.__k=new Array(n),s=0;n>s;s++)null!=(o=t[s])&&"boolean"!=typeof o&&"function"!=typeof o?("string"==typeof o||"number"==typeof o||"bigint"==typeof o||o.constructor==String?o=e.__k[s]=Ka(null,o,null,null,null):Za(o)?o=e.__k[s]=Ka(Ja,{children:o},null,null,null):void 0===o.constructor&&o.__b>0?o=e.__k[s]=Ka(o.type,o.props,o.key,o.ref?o.ref:null,o.__v):e.__k[s]=o,l=s+h,o.__=e,o.__b=e.__b+1,a=null,-1!=(u=o.__i=sl(o,r,l,d))&&(d--,(a=r[u])&&(a.__u|=2)),null==a||null==a.__v?(-1==u&&(n>c?h--:c>n&&h++),"function"!=typeof o.type&&(o.__u|=4)):u!=l&&(u==l-1?h--:u==l+1?h++:(u>l?h--:h++,o.__u|=4))):e.__k[s]=null;if(d)for(s=0;c>s;s++)null!=(a=r[s])&&0==(2&a.__u)&&(a.__e==i&&(i=el(a)),vl(a,a));return i}(r,t,m,l,y),d=0;y>d;d++)null!=(p=r.__k[d])&&(h=-1==p.__i?ja:m[p.__i]||ja,p.__i=d,_=ul(e,p,h,n,s,o,a,l,u,c),v=p.__e,p.ref&&h.ref!=p.ref&&(h.ref&&pl(h.ref,null,p),c.push(p.ref,p.__c||v,p)),null==g&&null!=v&&(g=v),(f=!!(4&p.__u))||h.__k===p.__k?l=nl(p,l,e,f):"function"==typeof p.type&&void 0!==_?l=_:v&&(l=v.nextSibling),p.__u&=-7);return r.__e=g,l}function nl(e,t,r,i){var n,s;if("function"==typeof e.type){for(n=e.__k,s=0;n&&n.length>s;s++)n[s]&&(n[s].__=e,t=nl(n[s],t,r,i));return t}e.__e!=t&&(i&&(t&&e.type&&!t.parentNode&&(t=el(e)),r.insertBefore(e.__e,t||null)),t=e.__e);do{t=t&&t.nextSibling}while(null!=t&&8==t.nodeType);return t}function sl(e,t,r,i){var n,s,o,a=e.key,l=e.type,u=t[r],c=null!=u&&0==(2&u.__u);if(null===u&&null==a||c&&a==u.key&&l==u.type)return r;if(i>(c?1:0))for(n=r-1,s=r+1;n>=0||t.length>s;)if(null!=(u=t[o=0>n?s++:n--])&&0==(2&u.__u)&&a==u.key&&l==u.type)return o;return-1}function ol(e,t,r){"-"==t[0]?e.setProperty(t,null==r?"":r):e[t]=null==r?"":"number"!=typeof r||Wa.test(t)?r:r+"px"}function al(e,t,r,i,n){var s,o;e:if("style"==t)if("string"==typeof r)e.style.cssText=r;else{if("string"==typeof i&&(e.style.cssText=i=""),i)for(t in i)r&&t in r||ol(e.style,t,"");if(r)for(t in r)i&&r[t]==i[t]||ol(e.style,t,r[t])}else if("o"==t[0]&&"n"==t[1])s=t!=(t=t.replace(Ha,"$1")),o=t.toLowerCase(),t=o in e||"onFocusOut"==t||"onFocusIn"==t?o.slice(2):t.slice(2),e.l||(e.l={}),e.l[t+s]=r,r?i?r.u=i.u:(r.u=qa,e.addEventListener(t,s?Ua:Va,s)):e.removeEventListener(t,s?Ua:Va,s);else{if("http://www.w3.org/2000/svg"==n)t=t.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if("width"!=t&&"height"!=t&&"href"!=t&&"list"!=t&&"form"!=t&&"tabIndex"!=t&&"download"!=t&&"rowSpan"!=t&&"colSpan"!=t&&"role"!=t&&"popover"!=t&&t in e)try{e[t]=null==r?"":r;break e}catch(e){}"function"==typeof r||(null==r||!1===r&&"-"!=t[4]?e.removeAttribute(t):e.setAttribute(t,"popover"==t&&1==r?"":r))}}function ll(e){return function(t){if(this.l){var r=this.l[t.type+e];if(null==t.t)t.t=qa++;else if(r.u>t.t)return;return r(Aa.event?Aa.event(t):t)}}}function ul(e,t,r,i,n,s,o,a,l,u){var c,d,h,p,v,g,_,f,m,y,b,$,w,S,C,I,x,k=t.type;if(void 0!==t.constructor)return null;128&r.__u&&(l=!!(32&r.__u),s=[a=t.__e=r.__e]),(c=Aa.__b)&&c(t);e:if("function"==typeof k)try{if(f=t.props,m="prototype"in k&&k.prototype.render,y=(c=k.contextType)&&i[c.__c],b=c?y?y.props.value:c.__:i,r.__c?_=(d=t.__c=r.__c).__=d.__E:(m?t.__c=d=new k(f,b):(t.__c=d=new Qa(f,b),d.constructor=k,d.render=gl),y&&y.sub(d),d.state||(d.state={}),d.__n=i,h=d.__d=!0,d.__h=[],d._sb=[]),m&&null==d.__s&&(d.__s=d.state),m&&null!=k.getDerivedStateFromProps&&(d.__s==d.state&&(d.__s=Ga({},d.__s)),Ga(d.__s,k.getDerivedStateFromProps(f,d.__s))),p=d.props,v=d.state,d.__v=t,h)m&&null==k.getDerivedStateFromProps&&null!=d.componentWillMount&&d.componentWillMount(),m&&null!=d.componentDidMount&&d.__h.push(d.componentDidMount);else{if(m&&null==k.getDerivedStateFromProps&&f!==p&&null!=d.componentWillReceiveProps&&d.componentWillReceiveProps(f,b),t.__v==r.__v||!d.__e&&null!=d.shouldComponentUpdate&&!1===d.shouldComponentUpdate(f,d.__s,b)){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.some((function(e){e&&(e.__=t)})),$=0;d._sb.length>$;$++)d.__h.push(d._sb[$]);d._sb=[],d.__h.length&&o.push(d);break e}null!=d.componentWillUpdate&&d.componentWillUpdate(f,d.__s,b),m&&null!=d.componentDidUpdate&&d.__h.push((function(){d.componentDidUpdate(p,v,g)}))}if(d.context=b,d.props=f,d.__P=e,d.__e=!1,w=Aa.__r,S=0,m){for(d.state=d.__s,d.__d=!1,w&&w(t),c=d.render(d.props,d.state,d.context),C=0;d._sb.length>C;C++)d.__h.push(d._sb[C]);d._sb=[]}else do{d.__d=!1,w&&w(t),c=d.render(d.props,d.state,d.context),d.state=d.__s}while(d.__d&&25>++S);d.state=d.__s,null!=d.getChildContext&&(i=Ga(Ga({},i),d.getChildContext())),m&&!h&&null!=d.getSnapshotBeforeUpdate&&(g=d.getSnapshotBeforeUpdate(p,v)),I=c,null!=c&&c.type===Ja&&null==c.key&&(I=hl(c.props.children)),a=il(e,Za(I)?I:[I],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){if(t.__v=null,l||null!=s)if(e.then){for(t.__u|=l?160:128;a&&8==a.nodeType&&a.nextSibling;)a=a.nextSibling;s[s.indexOf(a)]=null,t.__e=a}else{for(x=s.length;x--;)Ya(s[x]);cl(t)}else t.__e=r.__e,t.__k=r.__k,e.then||cl(t);Aa.__e(e,t,r)}else null==s&&t.__v==r.__v?(t.__k=r.__k,t.__e=r.__e):a=t.__e=function(e,t,r,i,n,s,o,a,l){var u,c,d,h,p,v,g,_=r.props||ja,f=t.props,m=t.type;if("svg"==m?n="http://www.w3.org/2000/svg":"math"==m?n="http://www.w3.org/1998/Math/MathML":n||(n="http://www.w3.org/1999/xhtml"),null!=s)for(u=0;s.length>u;u++)if((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=document.createElementNS(n,m,f.is&&f),a&&(Aa.__m&&Aa.__m(t,s),a=!1),s=null}if(null==m)_===f||a&&e.data==f||(e.data=f);else{if(s=s&&Pa.call(e.childNodes),!a&&null!=s)for(_={},u=0;e.attributes.length>u;u++)_[(p=e.attributes[u]).name]=p.value;for(u in _)if(p=_[u],"children"==u);else if("dangerouslySetInnerHTML"==u)d=p;else if(!(u in f)){if("value"==u&&"defaultValue"in f||"checked"==u&&"defaultChecked"in f)continue;al(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:a&&"function"!=typeof p||_[u]===p||al(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=""),il("template"==t.type?e.content:e,Za(h)?h:[h],t,r,i,"foreignObject"==m?"http://www.w3.org/1999/xhtml":n,s,o,s?s[0]:r.__k&&el(r,0),a,l),null!=s)for(u=s.length;u--;)Ya(s[u]);a||(u="value","progress"==m&&null==v?e.removeAttribute("value"):null!=v&&(v!==e[u]||"progress"==m&&!v||"option"==m&&v!=_[u])&&al(e,u,v,_[u],n),u="checked",null!=g&&g!=e[u]&&al(e,u,g,_[u],n))}return e}(r.__e,t,r,i,n,s,o,l,u);return(c=Aa.diffed)&&c(t),128&t.__u?void 0:a}function cl(e){e&&e.__c&&(e.__c.__e=!0),e&&e.__k&&e.__k.forEach(cl)}function dl(e,t,r){for(var i=0;r.length>i;i++)pl(r[i],r[++i],r[++i]);Aa.__c&&Aa.__c(t,e),e.some((function(t){try{e=t.__h,t.__h=[],e.some((function(e){e.call(t)}))}catch(e){Aa.__e(e,t.__v)}}))}function hl(e){return"object"!=typeof e||null==e||e.__b&&e.__b>0?e:Za(e)?e.map(hl):Ga({},e)}function pl(e,t,r){try{if("function"==typeof e){var i="function"==typeof e.__u;i&&e.__u(),i&&null==t||(e.__u=e(t))}else e.current=t}catch(e){Aa.__e(e,r)}}function vl(e,t,r){var i,n;if(Aa.unmount&&Aa.unmount(e),(i=e.ref)&&(i.current&&i.current!=e.__e||pl(i,null,t)),null!=(i=e.__c)){if(i.componentWillUnmount)try{i.componentWillUnmount()}catch(e){Aa.__e(e,t)}i.base=i.__P=null}if(i=e.__k)for(n=0;i.length>n;n++)i[n]&&vl(i[n],t,r||"function"!=typeof e.type);r||Ya(e.__e),e.__c=e.__=e.__e=void 0}function gl(e,t,r){return this.constructor(e,r)}function _l(e,t,r){var i,n,s;t==document&&(t=document.documentElement),Aa.__&&Aa.__(e,t),i=t.__k,n=[],s=[],ul(t,e=t.__k=Xa(Ja,null,[e]),i||ja,ja,t.namespaceURI,i?null:t.firstChild?Pa.call(t.childNodes):null,n,i?i.__e:t.firstChild,!1,s),dl(n,e,s)}Pa=za.slice,Aa={__e(e,t,r,i){for(var n,s,o;t=t.__;)if((n=t.__c)&&!n.__)try{if((s=n.constructor)&&null!=s.getDerivedStateFromError&&(n.setState(s.getDerivedStateFromError(e)),o=n.__d),null!=n.componentDidCatch&&(n.componentDidCatch(e,i||{}),o=n.__d),o)return n.__E=n}catch(t){e=t}throw e}},Fa=0,Qa.prototype.setState=function(e,t){var r;r=null!=this.__s&&this.__s!=this.state?this.__s:this.__s=Ga({},this.state),"function"==typeof e&&(e=e(Ga({},r),this.props)),e&&Ga(r,e),null!=e&&this.__v&&(t&&this._sb.push(t),rl(this))},Qa.prototype.forceUpdate=function(e){this.__v&&(this.__e=!0,e&&this.__h.push(e),rl(this))},Qa.prototype.render=Ja,Na=[],Da="function"==typeof Promise?Promise.prototype.then.bind(Promise.resolve()):setTimeout,Ba=function(e,t){return e.__v.__b-t.__v.__b},$.__r=0,Ha=/(PointerCapture)$|Capture$/i,qa=0,Va=ll(!1),Ua=ll(!0),$a=0;var fl,ml,yl,bl,wl=0,Sl=[],Cl=Aa,Il=Cl.__b,xl=Cl.__r,kl=Cl.diffed,El=Cl.__c,Tl=Cl.unmount,Rl=Cl.__;function Ml(e,t){Cl.__h&&Cl.__h(ml,e,wl||t),wl=0;var r=ml.__H||(ml.__H={__:[],__h:[]});return e>=r.__.length&&r.__.push({}),r.__[e]}function Ll(e){return wl=1,function(e,t,r){var i=Ml(fl++,2);if(i.t=e,!i.__c&&(i.__=[Ul(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=ml,!ml.__f)){var n=function(e,t,r){if(!i.__c.__H)return!0;var n=i.__c.__H.__.filter((function(e){return!!e.__c}));if(n.every((function(e){return!e.__N})))return!s||s.call(this,e,t,r);var o=i.__c.props!==e;return n.forEach((function(e){if(e.__N){var t=e.__[0];e.__=e.__N,e.__N=void 0,t!==e.__[0]&&(o=!0)}})),s&&s.call(this,e,t,r)||o};ml.__f=!0;var s=ml.shouldComponentUpdate,o=ml.componentWillUpdate;ml.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)},ml.shouldComponentUpdate=n}return i.__N||i.__}(Ul,e)}function Pl(e,t){var r=Ml(fl++,3);!Cl.__s&&Vl(r.__H,t)&&(r.__=e,r.u=t,ml.__H.__h.push(r))}function Al(e){return wl=5,Fl((function(){return{current:e}}),[])}function Fl(e,t){var r=Ml(fl++,7);return Vl(r.__H,t)&&(r.__=e(),r.__H=t,r.__h=e),r.__}function Nl(e){var t=ml.context[e.__c],r=Ml(fl++,9);return r.c=e,t?(null==r.__&&(r.__=!0,t.sub(ml)),t.props.value):e.__}function Ol(){for(var e;e=Sl.shift();)if(e.__P&&e.__H)try{e.__H.__h.forEach(Hl),e.__H.__h.forEach(ql),e.__H.__h=[]}catch(t){e.__H.__h=[],Cl.__e(t,e.__v)}}Cl.__b=function(e){ml=null,Il&&Il(e)},Cl.__=function(e,t){e&&t.__k&&t.__k.__m&&(e.__m=t.__k.__m),Rl&&Rl(e,t)},Cl.__r=function(e){xl&&xl(e),fl=0;var t=(ml=e.__c).__H;t&&(yl===ml?(t.__h=[],ml.__h=[],t.__.forEach((function(e){e.__N&&(e.__=e.__N),e.u=e.__N=void 0}))):(t.__h.forEach(Hl),t.__h.forEach(ql),t.__h=[],fl=0)),yl=ml},Cl.diffed=function(e){kl&&kl(e);var t=e.__c;t&&t.__H&&(t.__H.__h.length&&(1!==Sl.push(t)&&bl===Cl.requestAnimationFrame||((bl=Cl.requestAnimationFrame)||Bl)(Ol)),t.__H.__.forEach((function(e){e.u&&(e.__H=e.u),e.u=void 0}))),yl=ml=null},Cl.__c=function(e,t){t.some((function(e){try{e.__h.forEach(Hl),e.__h=e.__h.filter((function(e){return!e.__||ql(e)}))}catch(r){t.some((function(e){e.__h&&(e.__h=[])})),t=[],Cl.__e(r,e.__v)}})),El&&El(e,t)},Cl.unmount=function(e){Tl&&Tl(e);var t,r=e.__c;r&&r.__H&&(r.__H.__.forEach((function(e){try{Hl(e)}catch(e){t=e}})),r.__H=void 0,t&&Cl.__e(t,r.__v))};var Dl="function"==typeof requestAnimationFrame;function Bl(e){var t,r=function(){clearTimeout(i),Dl&&cancelAnimationFrame(t),setTimeout(e)},i=setTimeout(r,35);Dl&&(t=requestAnimationFrame(r))}function Hl(e){var t=ml,r=e.__c;"function"==typeof r&&(e.__c=void 0,r()),ml=t}function ql(e){var t=ml;e.__c=e.__(),ml=t}function Vl(e,t){return!e||e.length!==t.length||t.some((function(t,r){return t!==e[r]}))}function Ul(e,t){return"function"==typeof t?t(e):t}var $l="events",jl="cancelEvents",zl={Tab:"tab",Selector:"selector"},Wl={TopLeft:"top_left",TopRight:"top_right",TopCenter:"top_center",MiddleLeft:"middle_left",MiddleRight:"middle_right",MiddleCenter:"middle_center",Left:"left",Center:"center",Right:"right",NextToTrigger:"next_to_trigger"},Zl={Top:"top",Left:"left",Right:"right",Bottom:"bottom"},Gl={Popover:"popover",API:"api",Widget:"widget",ExternalSurvey:"external_survey"},Yl={Open:"open",MultipleChoice:"multiple_choice",SingleChoice:"single_choice",Rating:"rating",Link:"link"},Xl={End:"end",ResponseBased:"response_based",SpecificQuestion:"specific_question"},Kl="always",Jl={SHOWN:"survey shown",DISMISSED:"survey dismissed",SENT:"survey sent",ABANDONED:"survey abandoned"},Ql={SURVEY_ID:"$survey_id",SURVEY_NAME:"$survey_name",SURVEY_ITERATION:"$survey_iteration",SURVEY_ITERATION_START_DATE:"$survey_iteration_start_date",SURVEY_PARTIALLY_COMPLETED:"$survey_partially_completed",SURVEY_SUBMISSION_ID:"$survey_submission_id",SURVEY_QUESTIONS:"$survey_questions",SURVEY_COMPLETED:"$survey_completed",SURVEY_LAST_SEEN_DATE:"$survey_last_seen_date"},eu="popover",tu=cs("[Surveys]");function ru(e){return!(!e.start_date||e.end_date)}function iu(e){var t;return!(null==(t=e.conditions)||null==(t=t.events)||null==(t=t.values)||!t.length)}function nu(e){var t;return!(null==(t=e.conditions)||null==(t=t.actions)||null==(t=t.values)||!t.length)}var su="seenSurvey_",ou="inProgressSurvey_",au=(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},lu=(e,t)=>{var r=""+e+t.id;return t.current_iteration&&t.current_iteration>0&&(r=""+e+t.id+"_"+t.current_iteration),r},uu=e=>lu(su,e),cu=e=>{try{var t=uu(e);if(localStorage.getItem(t))return;localStorage.setItem(t,"true")}catch(e){tu.error("Failed to persist survey seen state",e)}},du=[Gl.Popover,Gl.Widget,Gl.API],hu={ignoreConditions:!1,ignoreDelay:!1,displayType:eu};Math.trunc||(Math.trunc=function(e){return 0>e?Math.ceil(e):Math.floor(e)}),Number.isInteger||(Number.isInteger=function(e){return Qr(e)&&isFinite(e)&&Math.floor(e)===e});class pu{constructor(e){if(this.bytes=e,16!==e.length)throw new TypeError("not 128-bit length")}static fromFieldsV7(e,t,r,i){if(!Number.isInteger(e)||!Number.isInteger(t)||!Number.isInteger(r)||!Number.isInteger(i)||0>e||0>t||0>r||0>i||e>0xffffffffffff||t>4095||r>1073741823||i>4294967295)throw new RangeError("invalid field value");var n=new Uint8Array(16);return n[0]=e/Math.pow(2,40),n[1]=e/Math.pow(2,32),n[2]=e/Math.pow(2,24),n[3]=e/Math.pow(2,16),n[4]=e/Math.pow(2,8),n[5]=e,n[6]=112|t>>>8,n[7]=t,n[8]=128|r>>>24,n[9]=r>>>16,n[10]=r>>>8,n[11]=r,n[12]=i>>>24,n[13]=i>>>16,n[14]=i>>>8,n[15]=i,new pu(n)}toString(){for(var e="",t=0;this.bytes.length>t;t++)e=e+(this.bytes[t]>>>4).toString(16)+(15&this.bytes[t]).toString(16),3!==t&&5!==t&&7!==t&&9!==t||(e+="-");if(36!==e.length)throw new Error("Invalid UUIDv7 was generated");return e}clone(){return new pu(this.bytes.slice(0))}equals(e){return 0===this.compareTo(e)}compareTo(e){for(var t=0;16>t;t++){var r=this.bytes[t]-e.bytes[t];if(0!==r)return Math.sign(r)}return 0}}class vu{constructor(){this._timestamp=0,this._counter=0,this._random=new fu}generate(){var e=this.generateOrAbort();if(Gr(e)){this._timestamp=0;var t=this.generateOrAbort();if(Gr(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(this._timestamp>=e+1e4)return;this._counter++,this._counter>4398046511103&&(this._timestamp++,this._resetCounter())}return pu.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 gu,_u=e=>{if("undefined"!=typeof UUIDV7_DENY_WEAK_RNG&&UUIDV7_DENY_WEAK_RNG)throw new Error("no cryptographically strong RNG available");for(var t=0;e.length>t;t++)e[t]=65536*Math.trunc(65536*Math.random())+Math.trunc(65536*Math.random());return e};Gn&&!Gr(Gn.crypto)&&crypto.getRandomValues&&(_u=e=>crypto.getRandomValues(e));class fu{constructor(){this._buffer=new Uint32Array(8),this._cursor=1/0}nextUint32(){return this._buffer.length>this._cursor||(_u(this._buffer),this._cursor=0),this._buffer[this._cursor++]}}var mu=()=>yu().toString(),yu=()=>(gu||(gu=new vu)).generate(),bu="gzip-js",wu="base64",Su=Uint8Array,Cu=Uint16Array,Iu=Uint32Array,xu=new Su([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]),ku=new Su([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]),Eu=new Su([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),Tu=function(e,t){for(var r=new Cu(31),i=0;31>i;++i)r[i]=t+=1<<e[i-1];var n=new Iu(r[30]);for(i=1;30>i;++i)for(var s=r[i];r[i+1]>s;++s)n[s]=s-r[i]<<5|i;return[r,n]},Ru=Tu(xu,2),Mu=Ru[1];Ru[0][28]=258,Mu[258]=28;for(var Lu=Tu(ku,0)[1],Pu=new Cu(32768),Au=0;32768>Au;++Au){var Fu=(43690&Au)>>>1|(21845&Au)<<1;Pu[Au]=((65280&(Fu=(61680&(Fu=(52428&Fu)>>>2|(13107&Fu)<<2))>>>4|(3855&Fu)<<4))>>>8|(255&Fu)<<8)>>>1}var Nu=function(e,t,r){for(var i=e.length,n=0,s=new Cu(t);i>n;++n)++s[e[n]-1];var o,a=new Cu(t);for(n=0;t>n;++n)a[n]=a[n-1]+s[n-1]<<1;if(r){o=new Cu(1<<t);var l=15-t;for(n=0;i>n;++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;h>=d;++d)o[Pu[d]>>>l]=u}else for(o=new Cu(i),n=0;i>n;++n)o[n]=Pu[a[e[n]-1]++]>>>15-e[n];return o},Ou=new Su(288);for(Au=0;144>Au;++Au)Ou[Au]=8;for(Au=144;256>Au;++Au)Ou[Au]=9;for(Au=256;280>Au;++Au)Ou[Au]=7;for(Au=280;288>Au;++Au)Ou[Au]=8;var Du=new Su(32);for(Au=0;32>Au;++Au)Du[Au]=5;var Bu=Nu(Ou,9,0),Hu=Nu(Du,5,0),qu=function(e){return(e/8>>0)+(7&e&&1)},Vu=function(e,t,r){(null==r||r>e.length)&&(r=e.length);var i=new(e instanceof Cu?Cu:e instanceof Iu?Iu:Su)(r-t);return i.set(e.subarray(t,r)),i},Uu=function(e,t,r){var i=t/8>>0;e[i]|=r<<=7&t,e[i+1]|=r>>>8},$u=function(e,t,r){var i=t/8>>0;e[i]|=r<<=7&t,e[i+1]|=r>>>8,e[i+2]|=r>>>16},ju=function(e,t){for(var r=[],i=0;e.length>i;++i)e[i]&&r.push({s:i,f:e[i]});var n=r.length,s=r.slice();if(!n)return[new Su(0),0];if(1==n){var o=new Su(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[d].f>r[u].f?u++:d++],l=r[u!=c&&r[d].f>r[u].f?u++:d++],r[c++]={s:-1,f:a.f+l.f,l:a,r:l};var h=s[0].s;for(i=1;n>i;++i)s[i].s>h&&(h=s[i].s);var p=new Cu(h+1),v=zu(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}));n>i;++i){var m=s[i].s;if(t>=p[m])break;g+=f-(1<<v-p[m]),p[m]=t}for(g>>>=_;g>0;){var y=s[i].s;t>p[y]?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 Su(p),v]},zu=function(e,t,r){return-1==e.s?Math.max(zu(e.l,t,r+1),zu(e.r,t,r+1)):t[e.s]=r},Wu=function(e){for(var t=e.length;t&&!e[--t];);for(var r=new Cu(++t),i=0,n=e[0],s=1,o=function(e){r[i++]=e},a=1;t>=a;++a)if(e[a]==n&&a!=t)++s;else{if(!n&&s>2){for(;s>138;s-=138)o(32754);s>2&&(o(s>10?s-11<<5|28690:s-3<<5|12305),s=0)}else if(s>3){for(o(n),--s;s>6;s-=6)o(8304);s>2&&(o(s-3<<5|8208),s=0)}for(;s--;)o(n);s=1,n=e[a]}return[r.subarray(0,i),t]},Zu=function(e,t){for(var r=0,i=0;t.length>i;++i)r+=e[i]*t[i];return r},Gu=function(e,t,r){var i=r.length,n=qu(t+2);e[n]=255&i,e[n+1]=i>>>8,e[n+2]=255^e[n],e[n+3]=255^e[n+1];for(var s=0;i>s;++s)e[n+s+4]=r[s];return 8*(n+4+i)},Yu=function(e,t,r,i,n,s,o,a,l,u,c){Uu(t,c++,r),++n[256];for(var d=ju(n,15),h=d[0],p=d[1],v=ju(s,15),g=v[0],_=v[1],f=Wu(h),m=f[0],y=f[1],b=Wu(g),w=b[0],S=b[1],C=new Cu(19),I=0;m.length>I;++I)C[31&m[I]]++;for(I=0;w.length>I;++I)C[31&w[I]]++;for(var x=ju(C,7),k=x[0],E=x[1],T=19;T>4&&!k[Eu[T-1]];--T);var R,M,L,P,A=u+5<<3,F=Zu(n,Ou)+Zu(s,Du)+o,N=Zu(n,h)+Zu(s,g)+o+14+3*T+Zu(C,k)+(2*C[16]+3*C[17]+7*C[18]);if(F>=A&&N>=A)return Gu(t,c,e.subarray(l,l+u));if(Uu(t,c,1+(F>N)),c+=2,F>N){R=Nu(h,p,0),M=h,L=Nu(g,_,0),P=g;var O=Nu(k,E,0);for(Uu(t,c,y-257),Uu(t,c+5,S-1),Uu(t,c+10,T-4),c+=14,I=0;T>I;++I)Uu(t,c+3*I,k[Eu[I]]);c+=3*T;for(var D=[m,w],B=0;2>B;++B){var H=D[B];for(I=0;H.length>I;++I)Uu(t,c,O[q=31&H[I]]),c+=k[q],q>15&&(Uu(t,c,H[I]>>>5&127),c+=H[I]>>>12)}}else R=Bu,M=Ou,L=Hu,P=Du;for(I=0;a>I;++I)if(i[I]>255){var q;$u(t,c,R[257+(q=i[I]>>>18&31)]),c+=M[q+257],q>7&&(Uu(t,c,i[I]>>>23&31),c+=xu[q]);var V=31&i[I];$u(t,c,L[V]),c+=P[V],V>3&&($u(t,c,i[I]>>>5&8191),c+=ku[V])}else $u(t,c,R[i[I]]),c+=M[i[I]];return $u(t,c,R[256]),c+M[256]},Xu=new Iu([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),Ku=function(){for(var e=new Iu(256),t=0;256>t;++t){for(var r=t,i=9;--i;)r=(1&r&&3988292384)^r>>>1;e[t]=r}return e}(),Ju=function(e,t,r){for(;r;++t)e[t]=r,r>>>=8};function Qu(e,t){void 0===t&&(t={});var r=function(){var e=4294967295;return{p(t){for(var r=e,i=0;t.length>i;++i)r=Ku[255&r^t[i]]^r>>>8;e=r},d(){return 4294967295^e}}}(),i=e.length;r.p(e);var n,s,o,a,l=(n=e,s=t,o=function(e){return 10+(e.filename&&e.filename.length+1||0)}(t),a=8,function(e,t,r,i,n,s){var o=e.length,a=new Su(i+o+5*(1+Math.floor(o/7e3))+n),l=a.subarray(i,a.length-n),u=0;if(!t||8>o)for(var c=0;o>=c;c+=65535){var d=c+65535;o>d?u=Gu(l,u,e.subarray(c,d)):(l[c]=!0,u=Gu(l,u,e.subarray(c,o)))}else{for(var h=Xu[t-1],p=h>>>13,v=8191&h,g=(1<<r)-1,_=new Cu(32768),f=new Cu(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},w=new Iu(25e3),S=new Cu(288),C=new Cu(32),I=0,x=0,k=(c=0,0),E=0,T=0;o>c;++c){var R=b(c),M=32767&c,L=f[R];if(_[M]=L,f[R]=M,c>=E){var P=o-c;if((I>7e3||k>24576)&&P>423){u=Yu(e,l,0,w,S,C,x,k,T,c-T,u),k=I=x=0,T=c;for(var A=0;286>A;++A)S[A]=0;for(A=0;30>A;++A)C[A]=0}var F=2,N=0,O=v,D=M-L&32767;if(P>2&&R==b(c-D))for(var B=Math.min(p,P)-1,H=Math.min(32767,c),q=Math.min(258,P);H>=D&&--O&&M!=L;){if(e[c+F]==e[c+F-D]){for(var V=0;q>V&&e[c+V]==e[c+V-D];++V);if(V>F){if(F=V,N=D,V>B)break;var U=Math.min(D,V-2),j=0;for(A=0;U>A;++A){var z=c-D+A+32768&32767,W=z-_[z]+32768&32767;W>j&&(j=W,L=z)}}}D+=(M=L)-(L=_[M])+32768&32767}if(N){w[k++]=268435456|Mu[F]<<18|Lu[N];var Z=31&Mu[F],G=31&Lu[N];x+=xu[Z]+ku[G],++S[257+Z],++C[G],E=c+F,++I}else w[k++]=e[c],++S[e[c]]}}u=Yu(e,l,!0,w,S,C,x,k,T,c-T,u)}return Vu(a,0,i+qu(u)+n)}(n,null==s.level?6:s.level,null==s.mem?Math.ceil(1.5*Math.max(8,Math.min(13,Math.log(n.length)))):12+s.mem,o,a)),u=l.length;return function(e,t){var r=t.filename;if(e[0]=31,e[1]=139,e[2]=8,e[8]=2>t.level?4:9==t.level?2:0,e[9]=3,0!=t.mtime&&Ju(e,4,Math.floor(new Date(t.mtime||Date.now())/1e3)),r){e[3]=8;for(var i=0;r.length>=i;++i)e[i+10]=r.charCodeAt(i)}}(l,t),Ju(l,u-8,r.d()),Ju(l,u-4,i),l}var ec=!!es||!!Qn,tc="text/plain",rc=!1,ic=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=Cs(a);return u&&l.push(u),s+"?"+l.join("&")},nc=(e,t)=>JSON.stringify(e,((e,t)=>"bigint"==typeof t?t.toString():t),t),sc=e=>{if(e._encodedBody)return e._encodedBody;var{data:t,compression:r}=e;if(t){if(r===bu){var i=Qu(function(e,t){var r=e.length;if("undefined"!=typeof TextEncoder)return(new TextEncoder).encode(e);for(var i=new Su(e.length+(e.length>>>1)),n=0,s=function(e){i[n++]=e},o=0;r>o;++o){if(n+5>i.length){var a=new Su(n+8+(r-o<<1));a.set(i),i=a}var l=e.charCodeAt(o);128>l?s(l):2048>l?(s(192|l>>>6),s(128|63&l)):l>55295&&57344>l?(s(240|(l=65536+(1047552&l)|1023&e.charCodeAt(++o))>>>18),s(128|l>>>12&63),s(128|l>>>6&63),s(128|63&l)):(s(224|l>>>12),s(128|l>>>6&63),s(128|63&l))}return Vu(i,0,n)}(nc(t)),{mtime:0});return{contentType:tc,body:i.buffer.slice(i.byteOffset,i.byteOffset+i.byteLength),estimatedSize:i.byteLength}}if(r===wu){var n=function(e){return e?btoa(encodeURIComponent(e).replace(/%([0-9A-F]{2})/g,((e,t)=>String.fromCharCode(parseInt(t,16))))):e}(nc(t)),s=(e=>"data="+encodeURIComponent("string"==typeof e?e:nc(e)))(n);return{contentType:"application/x-www-form-urlencoded",body:s,estimatedSize:new Blob([s]).size}}var o=nc(t);return{contentType:"application/json",body:o,estimatedSize:new Blob([o]).size}}},oc=function(){var e=t((function*(e){var t=nc(e.data),i=yield function(e,t,r){return Ar.apply(this,arguments)}(t,as.DEBUG,{rethrow:!0});if(!i)return e;var n=yield i.arrayBuffer();return r({},e,{_encodedBody:{contentType:tc,body:n,estimatedSize:n.byteLength}})}));return function(t){return e.apply(this,arguments)}}(),ac=(e,t)=>ic(e,{_:(new Date).getTime().toString(),ver:as.JS_SDK_VERSION,compression:t}),lc=[];Qn&&lc.push({transport:"fetch",method(e){var t,i,{contentType:n,body:s,estimatedSize:o}=null!==(t=sc(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&&52428.8>(o||0),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){us.error(e)}null==e.callback||e.callback(i)})))).catch((t=>{us.error(t),null==e.callback||e.callback({statusCode:0,error:t})})).finally((()=>u?clearTimeout(u.timeout):null))}}),es&&lc.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=sc(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&&lc.push({transport:"sendBeacon",method(e){var t=ic(e.url,{beacon:"1"});try{var r,{contentType:i,body:n}=null!==(r=sc(e))&&void 0!==r?r:{};if(!n)return;var s=n instanceof Blob?n:new Blob([n],{type:i});Xn.sendBeacon(t,s)}catch(e){}}});var uc=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 cc(e,t,r){return nc({distinct_id:e,userPropertiesToSet:t,userPropertiesToSetOnce:r})}var dc={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=>uc(t,e))))),not_regex:(e,t)=>t.every((t=>e.every((e=>!uc(t,e))))),icontains:(e,t)=>t.map(hc).some((t=>e.map(hc).some((e=>t.includes(e))))),not_icontains:(e,t)=>t.map(hc).every((t=>e.map(hc).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)))}))},hc=e=>e.toLowerCase();function pc(e,t){return!e||Object.entries(e).every((e=>{var[r,i]=e,n=null==t?void 0:t[r];if(Gr(n)||Kr(n))return!1;var s=[String(n)],o=dc[i.operator];return!!o&&o(i.values,s)}))}var vc="",gc=/[a-z0-9][a-z0-9-]+\.[a-z]{2,}$/i;var _c={_is_supported:()=>!!Kn,_error(e){us.error("cookieStore error: "+e)},_get(e){if(Kn){try{for(var t=e+"=",r=Kn.cookie.split(";").filter((e=>e.length)),i=0;r.length>i;i++){for(var n=r[i];" "==n.charAt(0);)n=n.substring(1,n.length);if(0===n.indexOf(t))return decodeURIComponent(n.substring(t.length,n.length))}}catch(e){}return null}},_parse(e){var t;try{t=JSON.parse(_c._get(e))||{}}catch(e){}return t},_set(e,t,r,i,n){if(Kn)try{var s="",o="",a=function(e,t){if(t){var r=function(e,t){if(void 0===t&&(t=Kn),vc)return vc;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_"+mu();!vc&&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",vc=s)}return vc}(e);if(!r){var i=(e=>{var t=e.match(gc);return t?t[0]:""})(e);i!==r&&us.info("Warning: cookie subdomain discovery mismatch",i,r),r=i}return r?"; domain=."+r:""}return""}(Kn.location.hostname,i);if(r){var l=new Date;l.setTime(l.getTime()+864e5*r),s="; expires="+l.toUTCString()}n&&(o="; secure");var u=e+"="+encodeURIComponent(JSON.stringify(t))+s+"; SameSite=Lax; path=/"+a+o;return u.length>3686.4&&us.warn("cookieStore warning: large cookie, len="+u.length),Kn.cookie=u,u}catch(e){return}},_remove(e,t){if(null!=Kn&&Kn.cookie)try{_c._set(e,"",-1,t)}catch(e){return}}},fc=null,mc={_is_supported(){if(!Kr(fc))return fc;var e=!0;if(Gr(Gn))e=!1;else try{var t="__mplssupport__";mc._set(t,"xyz"),'"xyz"'!==mc._get(t)&&(e=!1),mc._remove(t)}catch(t){e=!1}return e||us.error("localStorage unsupported; falling back to cookie store"),fc=e,e},_error(e){us.error("localStorage error: "+e)},_get(e){try{return null==Gn?void 0:Gn.localStorage.getItem(e)}catch(e){mc._error(e)}return null},_parse(e){try{return JSON.parse(mc._get(e))||{}}catch(e){}return null},_set(e,t){try{null==Gn||Gn.localStorage.setItem(e,JSON.stringify(t))}catch(e){mc._error(e)}},_remove(e){try{null==Gn||Gn.localStorage.removeItem(e)}catch(e){mc._error(e)}}},yc=[Ms,"distinct_id",Zs,Gs,yo,mo,po],bc={},wc={_is_supported:()=>!0,_error(e){us.error("memoryStorage error: "+e)},_get:e=>bc[e]||null,_parse:e=>bc[e]||null,_set(e,t){bc[e]=t},_remove(e){delete bc[e]}},Sc=null,Cc={_is_supported(){if(!Kr(Sc))return Sc;if(Sc=!0,Gr(Gn))Sc=!1;else try{var e="__support__";Cc._set(e,"xyz"),'"xyz"'!==Cc._get(e)&&(Sc=!1),Cc._remove(e)}catch(e){Sc=!1}return Sc},_error(e){us.error("sessionStorage error: ",e)},_get(e){try{return null==Gn?void 0:Gn.sessionStorage.getItem(e)}catch(e){Cc._error(e)}return null},_parse(e){try{return JSON.parse(Cc._get(e))||null}catch(e){}return null},_set(e,t){try{null==Gn||Gn.sessionStorage.setItem(e,JSON.stringify(t))}catch(e){Cc._error(e)}},_remove(e){try{null==Gn||Gn.sessionStorage.removeItem(e)}catch(e){Cc._error(e)}}},Ic=cs("[Stylesheet Loader]"),xc=Gn,kc=Kn;function Ec(e){return"$survey_response_"+e}var Tc="#020617",Rc={fontFamily:"inherit",backgroundColor:"#eeeded",submitButtonColor:"black",submitButtonTextColor:"white",ratingButtonColor:"white",ratingButtonActiveColor:"black",borderColor:"#c9c6c6",placeholder:"Start typing...",whiteLabel:!1,displayThankYouMessage:!0,thankYouMessageHeader:"Thank you for your feedback!",position:Wl.Right,widgetType:zl.Tab,widgetLabel:"Feedback",widgetColor:"black",zIndex:String(2147483645),disabledButtonOpacity:"0.6",maxWidth:"300px",textSubtleColor:"#939393",boxPadding:"20px 24px",boxShadow:"0 4px 12px rgba(0, 0, 0, 0.15)",borderRadius:"10px",shuffleQuestions:!1,surveyPopupDelaySeconds:void 0,outlineColor:"rgba(59, 130, 246, 0.8)",inputBackground:"white",inputTextColor:Tc,scrollbarThumbColor:"var(--ph-survey-border-color)",scrollbarTrackColor:"var(--ph-survey-background-color)"},Mc=[Wl.Center,Wl.Left,Wl.Right];function Lc(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 Pc(e){var t;void 0===e&&(e=Rc.backgroundColor),"#"===e[0]&&(t=Lc(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=Lc(r)),!t)return Tc;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?Tc:"white"}return Tc}var Ac=(e,t,i)=>{var n=Qc(e),s=kc.querySelector("."+n);if(s&&s.shadowRoot)return{shadow:s.shadowRoot,isNewlyCreated:!1};var o=kc.createElement("div");((e,t,i)=>{var n=r({},Rc,i),s=e.style,o=!Mc.includes(n.position)||t===Gl.Widget&&(null==i?void 0:i.widgetType)===zl.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)||Pc(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",Pc(n.ratingButtonActiveColor)),s.setProperty("--ph-survey-text-primary-color",(null==i?void 0:i.textColor)||Pc(n.backgroundColor)),s.setProperty("--ph-survey-text-subtle-color",n.textSubtleColor),s.setProperty("--ph-widget-color",n.widgetColor),s.setProperty("--ph-widget-text-color",Pc(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)||Pc(l);s.setProperty("--ph-survey-input-text-color",u),s.setProperty("--ph-survey-rating-text-color",u),s.setProperty("--ph-survey-scrollbar-thumb-color",n.scrollbarThumbColor),s.setProperty("--ph-survey-scrollbar-track-color",n.scrollbarTrackColor),s.setProperty("--ph-survey-outline-color",n.outlineColor)})(o,e.type,e.appearance),o.className=n;var a=o.attachShadow({mode:"open"}),l=function(e){var t=((e,t,r)=>{var i,n=e.createElement("style");return n.innerText=':host{--ph-survey-font-family:-apple-system,BlinkMacSystemFont,"Inter","Segoe UI","Roboto",Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol";--ph-survey-box-padding:20px 24px;--ph-survey-max-width:300px;--ph-survey-z-index:2147483645;--ph-survey-border-color:#dcdcdc;--ph-survey-border-bottom:1.5px solid var(--ph-survey-border-color);--ph-survey-border-radius:10px;--ph-survey-background-color:#eeeded;--ph-survey-box-shadow:0 4px 12px rgba(0,0,0,.15);--ph-survey-submit-button-color:#000;--ph-survey-submit-button-text-color:#fff;--ph-survey-rating-bg-color:#fff;--ph-survey-rating-text-color:#020617;--ph-survey-rating-active-bg-color:#000;--ph-survey-rating-active-text-color:#fff;--ph-survey-text-primary-color:#020617;--ph-survey-text-subtle-color:#939393;--ph-widget-color:#e0a045;--ph-widget-text-color:#fff;--ph-survey-scrollbar-thumb-color:var(--ph-survey-border-color);--ph-survey-scrollbar-track-color:var(--ph-survey-background-color);--ph-survey-outline-color:rgba(59,130,246,.8);--ph-survey-input-background:#fff;--ph-survey-input-text-color:#020617;--ph-survey-disabled-button-opacity:0.6}.ph-survey{bottom:0;height:fit-content;margin:0;max-width:85%;min-width:300px;position:fixed;width:var(--ph-survey-max-width);z-index:var(--ph-survey-z-index)}.ph-survey h3,.ph-survey p{margin:0}.ph-survey *{box-sizing:border-box;color:var(--ph-survey-text-primary-color);font-family:var(--ph-survey-font-family)}.ph-survey .multiple-choice-options label,.ph-survey input[type=text],.ph-survey textarea{background:var(--ph-survey-input-background);border:1.5px solid var(--ph-survey-border-color);border-radius:4px;color:var(--ph-survey-input-text-color);padding:10px;transition:border-color .2s ease-out,box-shadow .2s ease-out,transform .15s ease-out}.ph-survey input[type=text],.ph-survey textarea{transition:border-color .2s ease-out,box-shadow .2s ease-out,transform .15s ease-out}.ph-survey input{margin:0}.ph-survey .form-submit:focus,.ph-survey .form-submit:focus-visible,.ph-survey input[type=checkbox]:focus,.ph-survey input[type=checkbox]:focus-visible,.ph-survey input[type=radio]:focus,.ph-survey input[type=radio]:focus-visible,.ph-survey input[type=text]:focus,.ph-survey input[type=text]:focus-visible,.ph-survey textarea:focus,.ph-survey textarea:focus-visible{border-color:var(--ph-survey-rating-active-bg-color);outline:1.5px solid var(--ph-survey-outline-color);outline-offset:2px}.ph-survey button:focus:not(:focus-visible),.ph-survey input[type=checkbox]:focus:not(:focus-visible),.ph-survey input[type=radio]:focus:not(:focus-visible),.ph-survey input[type=text]:focus:not(:focus-visible),.ph-survey textarea:focus:not(:focus-visible){outline:none}.ph-survey input[type=text]:hover:not(:focus),.ph-survey textarea:hover:not(:focus){border-color:var(--ph-survey-rating-active-bg-color)}@media (max-width:768px){.ph-survey input[type=text],.ph-survey textarea{font-size:1rem}}.ph-survey .form-cancel,.ph-survey .multiple-choice-options label,.ph-survey .rating-options-number,.ph-survey input[type=checkbox],.ph-survey input[type=radio]{border:1.5px solid var(--ph-survey-border-color)}.ph-survey .footer-branding,.ph-survey .form-cancel,.ph-survey .form-submit,.ph-survey .ratings-emoji,.ph-survey .ratings-number,.ph-survey input[type=checkbox],.ph-survey input[type=radio],.ph-survey label{transition:all .2s ease-out}@media (prefers-reduced-motion:no-preference){.ph-survey button:active,.ph-survey input[type=checkbox]:active,.ph-survey input[type=radio]:active,.ph-survey label:active{transition-duration:.1s}}.ph-survey-widget-tab{background:var(--ph-widget-color);border:none;border-radius:3px 3px 0 0;color:var(--ph-widget-text-color);cursor:pointer;padding:10px 12px;position:fixed;text-align:center;transition:padding .2s ease-out;z-index:var(--ph-survey-z-index)}.ph-survey-widget-tab:hover:not(.widget-tab-top){padding-bottom:16px}.ph-survey-widget-tab.widget-tab-top{border-radius:0 0 3px 3px}.ph-survey-widget-tab.widget-tab-top:hover{padding-top:16px}@keyframes ph-survey-fade-in{0%{opacity:0}to{opacity:1}}.survey-box{gap:16px}.bottom-section,.survey-box{display:flex;flex-direction:column}.bottom-section{gap:8px}.thank-you-message-header~.bottom-section{padding-top:16px}.question-container,.thank-you-message{display:flex;flex-direction:column;gap:8px}.survey-question{font-size:14px;font-weight:500}.survey-question-description{font-size:13px;opacity:.8;padding-top:4px}.survey-question-description,.thank-you-message-body{word-wrap:break-word;overflow-wrap:break-word}:is(.survey-question-description,.thank-you-message-body) embed,:is(.survey-question-description,.thank-you-message-body) iframe,:is(.survey-question-description,.thank-you-message-body) img,:is(.survey-question-description,.thank-you-message-body) object,:is(.survey-question-description,.thank-you-message-body) video{height:auto;max-width:100%}:is(.survey-question-description,.thank-you-message-body) svg{height:auto;max-width:100%}.question-textarea-wrapper{display:flex;flex-direction:column}.survey-form{animation:ph-survey-fade-in .3s ease-out forwards}.survey-form,.thank-you-message{background:var(--ph-survey-background-color);border:1.5px solid var(--ph-survey-border-color);border-bottom:var(--ph-survey-border-bottom);border-radius:var(--ph-survey-border-radius);box-shadow:var(--ph-survey-box-shadow);margin:0;padding:var(--ph-survey-box-padding);position:relative;text-align:left;width:100%;z-index:var(--ph-survey-z-index)}.survey-form input[type=text],.survey-form textarea{min-width:100%}:is(.survey-form textarea):focus,:is(.survey-form textarea):focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.08)}:is(.survey-form textarea):focus:not(:focus-visible){box-shadow:none}.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}.rating-options-emoji-2{justify-content:space-around}.ratings-emoji{background-color:transparent;border:none;font-size:16px;opacity:.5;padding:0}.ratings-emoji:hover{cursor:pointer;opacity:1;transform:scale(1.15)}.ratings-emoji.rating-active{opacity:1}.ratings-emoji svg{fill:var(--ph-survey-text-primary-color);transition:fill .2s ease-out}.rating-options-number{border-radius:6px;display:grid;grid-auto-columns:1fr;grid-auto-flow:column;overflow:hidden}.rating-options-number .ratings-number{border:none;border-right:1px solid var(--ph-survey-border-color);color:var(--ph-survey-rating-text-color);cursor:pointer;font-weight:700;text-align:center}:is(.rating-options-number .ratings-number):last-of-type{border-right:0}.rating-active:is(.rating-options-number .ratings-number){background:var(--ph-survey-rating-active-bg-color);color:var(--ph-survey-rating-active-text-color)}.ratings-number{background-color:var(--ph-survey-rating-bg-color);border:none;padding:8px 0}.ratings-number .rating-active{background-color:var(--ph-survey-rating-active-bg-color)}.ratings-number{cursor:pointer}@media (hover:hover) and (pointer:fine){.ratings-number:hover:not(.rating-active){background-color:color-mix(in srgb,var(--ph-survey-rating-active-bg-color) 14%,var(--ph-survey-rating-bg-color))}}.rating-text{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)}.validation-hint{font-size:12px;margin-top:4px;opacity:.7}.form-cancel{background:#fff;border-radius:100%;cursor:pointer;line-height:0;padding:12px;position:absolute;right:0;top:0;transform:translate(50%,-50%)}.form-cancel:hover{opacity:.7;transform:translate(50%,-50%) scale(1.1)}.footer-branding{align-items:center;display:flex;font-size:11px;font-weight:500;gap:4px;justify-content:center;opacity:.6;text-decoration:none}.footer-branding:hover{opacity:1}.footer-branding a{text-decoration:none}.thank-you-message{text-align:center}.thank-you-message-header{margin:10px 0 0}.thank-you-message-body{font-size:14px;opacity:.8}.limit-height{max-height:256px;overflow-x:hidden;overflow-y:auto;scrollbar-color:var(--ph-survey-scrollbar-thumb-color) var(--ph-survey-scrollbar-track-color);scrollbar-width:thin}.limit-height::-webkit-scrollbar{width:8px}.limit-height::-webkit-scrollbar-track{background:var(--ph-survey-scrollbar-track-color);border-radius:4px}.limit-height::-webkit-scrollbar-thumb{background-color:var(--ph-survey-scrollbar-thumb-color);border:2px solid var(--ph-survey-scrollbar-track-color);border-radius:4px}:is(.limit-height::-webkit-scrollbar-thumb):hover{background-color:var(--ph-survey-text-subtle-color)}.sr-only{clip:rect(0,0,0,0);border:0;height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;white-space:nowrap;width:1px}@media (prefers-reduced-motion:reduce){.ph-survey *{animation-duration:.01ms!important;animation-iteration-count:1!important;scroll-behavior:auto!important;transition-duration:.01ms!important}}@keyframes ph-survey-checkmark-reveal{0%{opacity:0;transform:rotate(45deg) scale(0)}50%{opacity:1;transform:rotate(45deg) scale(1.2)}to{opacity:1;transform:rotate(45deg) scale(1)}}@keyframes ph-survey-radio-reveal{0%{opacity:0;transform:scale(0)}50%{opacity:1;transform:scale(1.3)}to{opacity:1;transform:scale(1)}}',null!=r&&null!=(i=r.config)&&i.prepare_external_dependency_stylesheet&&(n=r.config.prepare_external_dependency_stylesheet(n)),n||(Ic.error("prepare_external_dependency_stylesheet returned null"),null)})(kc,0,e);return null==t||t.setAttribute("data-ph-survey-style","true"),t}(t);if(l){var u=a.querySelector("style");u&&a.removeChild(u),a.appendChild(l)}return kc.body.appendChild(o),{shadow:a,isNewlyCreated:!0}},Fc=(e,t)=>{if(!t)return null;var r=e[Ec(t)];return jr(r)?[...r]:r},Nc=e=>{var{responses:t,survey:i,surveySubmissionId:n,posthog:s,isSurveyCompleted:o,properties:a}=e;s?(cu(i),s.capture(Jl.SENT,r({[Ql.SURVEY_NAME]:i.name,[Ql.SURVEY_ID]:i.id,[Ql.SURVEY_ITERATION]:i.current_iteration,[Ql.SURVEY_ITERATION_START_DATE]:i.current_iteration_start_date,[Ql.SURVEY_QUESTIONS]:i.questions.map((e=>({id:e.id,question:e.question,response:Fc(t,e.id)}))),[Ql.SURVEY_SUBMISSION_ID]:n,[Ql.SURVEY_COMPLETED]:o,sessionRecordingUrl:null==s.get_session_replay_url?void 0:s.get_session_replay_url()},t,a,{$set:{[au(i,"responded")]:!0}})),o&&(xc.dispatchEvent(new CustomEvent("PHSurveySent",{detail:{surveyId:i.id}})),Jc(i))):tu.error("[survey sent] event not captured, PostHog instance not found.")},Oc=e=>Object.values((null==e?void 0:e.responses)||{}).filter((e=>!Jr(e))).length>0,Dc=(e,t,i)=>r({[Ql.SURVEY_NAME]:e.name,[Ql.SURVEY_ID]:e.id,[Ql.SURVEY_ITERATION]:e.current_iteration,[Ql.SURVEY_ITERATION_START_DATE]:e.current_iteration_start_date,[Ql.SURVEY_PARTIALLY_COMPLETED]:Oc(t),sessionRecordingUrl:null==i.get_session_replay_url?void 0:i.get_session_replay_url()},null==t?void 0:t.responses,{[Ql.SURVEY_SUBMISSION_ID]:null==t?void 0:t.surveySubmissionId,[Ql.SURVEY_QUESTIONS]:e.questions.map((e=>({id:e.id,question:e.question,response:Fc((null==t?void 0:t.responses)||{},e.id)})))}),Bc=(e,t,i)=>{if(t){if(!i){var n=Xc(e);t.capture(Jl.DISMISSED,r({},Dc(e,n,t),{$set:{[au(e,"dismissed")]:!0}})),Jc(e),cu(e),xc.dispatchEvent(new CustomEvent("PHSurveyClosed",{detail:{surveyId:e.id}}))}}else tu.error("[survey dismissed] event not captured, PostHog instance not found.")},Hc=(e,t)=>{if(t){var r=(e=>lu("abandonedSurvey_",e))(e);try{if("true"===localStorage.getItem(r))return}catch(e){return}var i=Xc(e);if(i){try{localStorage.setItem(r,"true")}catch(e){}t.capture(Jl.ABANDONED,Dc(e,i,t),{transport:"sendBeacon"})}}else tu.error("[survey abandoned] event not captured, PostHog instance not found.")},qc=e=>e.map((e=>({sort:Math.floor(10*Math.random()),value:e}))).sort(((e,t)=>e.sort-t.sort)).map((e=>e.value)),Vc=(e,t)=>e.length===t.length&&e.every(((e,r)=>e===t[r]))?t.reverse():t,Uc=e=>e.appearance&&e.appearance.shuffleQuestions&&!e.enable_partial_responses?Vc(e.questions,qc(e.questions)):e.questions,$c=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||Kc(e)},jc=function(e){function t(e){var r,i;return this.getChildContext||(r=new Set,(i={})[t.__c]=this,this.getChildContext=function(){return i},this.componentWillUnmount=function(){r=null},this.shouldComponentUpdate=function(e){this.props.value!=e.value&&r.forEach((function(e){e.__e=!0,rl(e)}))},this.sub=function(e){r.add(e);var t=e.componentWillUnmount;e.componentWillUnmount=function(){r&&r.delete(e),t&&t.call(e)}}),e.children}return t.__c="__cC"+$a++,t.__=e,t.Provider=t.__l=(t.Consumer=function(e,t){return e.children(t)}).contextType=t,t}({isPreviewMode:!1,previewPageIndex:0,onPopupSurveyDismissed(){},isPopup:!0,onPreviewSubmit(){},surveySubmissionId:"",properties:void 0}),zc=()=>Nl(jc),Wc=e=>{var{component:t,children:r,renderAsHtml:i,style:n}=e;return function(e,t,r){var i,n,s,o,a=Ga({},e.props);for(s in e.type&&e.type.defaultProps&&(o=e.type.defaultProps),t)"key"==s?i=t[s]:"ref"==s?n=t[s]:a[s]=void 0===t[s]&&null!=o?o[s]:t[s];return arguments.length>2&&(a.children=arguments.length>3?Pa.call(arguments,2):r),Ka(e.type,a,i||e.key,n||e.ref,null)}(t,i?{dangerouslySetInnerHTML:{__html:r},style:n}:{children:r,style:n})};function Zc(e){var t,r,i;if(null==(t=e.conditions)||!t.url)return!0;var n=null==xc||null==(r=xc.location)?void 0:r.href;if(!n)return!1;var s=[e.conditions.url],o=function(e){return null!=e?e:"icontains"}(null==(i=e.conditions)?void 0:i.urlMatchType);return dc[o](s,[n])}var Gc=e=>{var t=""+ou+e.id;return e.current_iteration&&e.current_iteration>0&&(t=""+ou+e.id+"_"+e.current_iteration),t},Yc=(e,t)=>{try{localStorage.setItem(Gc(e),JSON.stringify(t))}catch(e){tu.error("Error setting in-progress survey state in localStorage",e)}},Xc=e=>{try{var t=localStorage.getItem(Gc(e));if(t)return JSON.parse(t)}catch(e){tu.error("Error getting in-progress survey state from localStorage",e)}return null},Kc=e=>{var t=Xc(e);return!Jr(null==t?void 0:t.surveySubmissionId)},Jc=e=>{try{localStorage.removeItem(Gc(e))}catch(e){tu.error("Error clearing in-progress survey state from localStorage",e)}};function Qc(e,t){void 0===t&&(t=!1);var r="PostHogSurvey-"+e.id;return t?"."+r:r}function ed(e,t,r){if(void 0===t&&(t=Wl.Right),e===Gl.ExternalSurvey)return{};switch(t){case Wl.TopLeft:return{top:"0",left:"0",transform:"translate(30px, 30px)"};case Wl.TopRight:return{top:"0",right:"0",transform:"translate(-30px, 30px)"};case Wl.TopCenter:return{top:"0",left:"50%",transform:"translate(-50%, 30px)"};case Wl.MiddleLeft:return{top:"50%",left:"0",transform:"translate(30px, -50%)"};case Wl.MiddleRight:return{top:"50%",right:"0",transform:"translate(-30px, -50%)"};case Wl.MiddleCenter:return{top:"50%",left:"50%",transform:"translate(-50%, -50%)"};case Wl.Left:return{left:"30px"};case Wl.Center:return{left:"50%",transform:"translateX(-50%)"};default:return{right:e===Gl.Widget&&r===zl.Tab?"60px":"30px"}}}var td=0;function rd(e,t,r,i,n,s){t||(t={});var o,a,l=t;if("ref"in l)for(a in l={},t)"ref"==a?o=t[a]:l[a]=t[a];var u={type:e,props:l,key:r,ref:o,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:--td,__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 Aa.vnode&&Aa.vnode(u),u}var id=rd("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 -960 960 960",width:"48",children:rd("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"})}),nd=rd("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 -960 960 960",width:"48",children:rd("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"})}),sd=rd("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 -960 960 960",width:"48",children:rd("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"})}),od=rd("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 -960 960 960",width:"48",children:rd("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"})}),ad=rd("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 -960 960 960",width:"48",children:rd("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"})}),ld=rd("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 0 24 24",width:"48",children:rd("path",{d:"M2 20h2c.55 0 1-.45 1-1v-9c0-.55-.45-1-1-1H2v11zm19.83-7.12c.11-.25.17-.52.17-.8V11c0-1.1-.9-2-2-2h-5.5l.92-4.65c.05-.22.02-.46-.08-.66-.23-.45-.52-.86-.88-1.22L14 2 7.59 8.41C7.21 8.79 7 9.3 7 9.83v7.84C7 18.95 8.05 20 9.34 20h8.11c.7 0 1.36-.37 1.72-.97l2.66-6.15z"})}),ud=rd("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 0 24 24",width:"48",children:rd("path",{d:"M22 4h-2c-.55 0-1 .45-1 1v9c0 .55.45 1 1 1h2V4zM2.17 11.12c-.11.25-.17.52-.17.8V13c0 1.1.9 2 2 2h5.5l-.92 4.65c-.05.22-.02.46.08.66.23.45.52.86.88 1.22L10 22l6.41-6.41c.38-.38.59-.89.59-1.42V6.34C17 5.05 15.95 4 14.66 4H6.55c-.7 0-1.36.37-1.72.97l-2.66 6.15z"})}),cd=function(e){var{fill:t="currentColor"}=void 0===e?{}:e;return rd("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:t,xmlns:"http://www.w3.org/2000/svg","aria-labelledby":"close-survey-title-adam",children:[rd("title",{id:"close-survey-title",className:"adam-testing",children:"Close survey"}),rd("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M0.164752 0.164752C0.384422 -0.0549175 0.740578 -0.0549175 0.960248 0.164752L6 5.20451L11.0398 0.164752C11.2594 -0.0549175 11.6156 -0.0549175 11.8352 0.164752C12.0549 0.384422 12.0549 0.740578 11.8352 0.960248L6.79549 6L11.8352 11.0398C12.0549 11.2594 12.0549 11.6156 11.8352 11.8352C11.6156 12.0549 11.2594 12.0549 11.0398 11.8352L6 6.79549L0.960248 11.8352C0.740578 12.0549 0.384422 12.0549 0.164752 11.8352C-0.0549175 11.6156 -0.0549175 11.2594 0.164752 11.0398L5.20451 6L0.164752 0.960248C-0.0549175 0.740578 -0.0549175 0.384422 0.164752 0.164752Z",fill:t})]})},dd=rd("svg",{width:"77",height:"14",viewBox:"0 0 77 14",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[rd("g",{"clip-path":"url(#clip0_2415_6911)",children:[rd("mask",{id:"mask0_2415_6911",style:{maskType:"luminance"},maskUnits:"userSpaceOnUse",x:"0",y:"0",width:"77",height:"14",children:rd("path",{d:"M0.5 0H76.5V14H0.5V0Z",fill:"white"})}),rd("g",{mask:"url(#mask0_2415_6911)",children:[rd("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"}),rd("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"}),rd("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"}),rd("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"}),rd("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"}),rd("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"})]})]}),rd("defs",{children:rd("clipPath",{id:"clip0_2415_6911",children:rd("rect",{width:"76",height:"14",fill:"white",transform:"translate(0.5)"})})})]});function hd(e){var{urlParams:t}=e,r=t?Object.entries(t).map((e=>{var[t,r]=e;return encodeURIComponent(t)+"="+encodeURIComponent(r)})).join("&"):"";return rd("a",{href:"https://posthog.com/surveys"+(r?"?"+r:""),target:"_blank",rel:"noopener",className:"footer-branding",children:["Survey by ",dd]})}function pd(e){var{text:t,submitDisabled:r,appearance:i,onSubmit:n,link:s,onPreviewSubmit:o,skipSubmitButton:a}=e,{isPreviewMode:l}=Nl(jc);return rd("div",{className:"bottom-section",children:[!a&&rd("button",{className:"form-submit",disabled:r,"aria-label":"Submit survey",type:"button",onClick(){s&&(null==Gn||Gn.open(s)),l?null==o||o():n()},children:t}),!i.whiteLabel&&rd(hd,{urlParams:{utm_source:"survey-footer"}})]})}function vd(e){var{question:t,forceDisableHtml:r,htmlFor:i}=e;return rd("div",{class:"question-header",children:[rd(t.type===Yl.Open?"label":"h3",{className:"survey-question",htmlFor:i,children:t.question}),t.description&&Wc({component:Xa("p",{className:"survey-question-description"}),children:t.description,renderAsHtml:!r&&"text"!==t.descriptionContentType})]})}function gd(e){var{onClick:t}=e,{isPreviewMode:r}=Nl(jc);return rd("button",{className:"form-cancel",onClick:t,disabled:r,"aria-label":"Close survey",type:"button",children:cd({fill:"black"})})}rd("svg",{width:"16",height:"12",viewBox:"0 0 16 12",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:rd("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 _d=Gn;function fd(e){var{header:t,description:r,contentType:i,forceDisableHtml:n,appearance:s,onClose:o}=e,{isPopup:a}=Nl(jc);return Pl((()=>{var e=e=>{"Enter"!==e.key&&"Escape"!==e.key||(e.preventDefault(),o())};return bs(_d,"keydown",e),()=>{_d.removeEventListener("keydown",e)}}),[o]),rd("div",{className:"thank-you-message",role:"status",tabIndex:0,"aria-atomic":"true",children:[a&&!0!==s.hideCancelButton&&rd(gd,{onClick:()=>o()}),rd("h3",{className:"thank-you-message-header",children:t}),r&&Wc({component:Xa("p",{className:"thank-you-message-body"}),children:r,renderAsHtml:!n&&"text"!==i}),a&&rd(pd,{text:s.thankYouMessageCloseButtonText||"Close",submitDisabled:!1,appearance:s,onSubmit:()=>o()})]})}var md=e=>jr(e)&&e.every((e=>Yr(e)));function yd(e){var{question:t,forceDisableHtml:r,appearance:i,onSubmit:n,onPreviewSubmit:s,displayQuestionIndex:o,initialValue:a}=e,{isPreviewMode:l}=zc(),u=Al(null),[c,d]=Ll((()=>Yr(a)?a:""));Pl((()=>{setTimeout((()=>{var e;l||null==(e=u.current)||e.focus()}),100)}),[l]);var h="surveyQuestion"+o,p=Fl((()=>function(e,t,r){var i,n,s=e.trim();if(!r&&""===s)return"This field is required";if(""===s)return!1;if(t&&t.length>0)for(var o of t)switch(o.type){case Or.MinLength:if(void 0!==o.value&&o.value>s.length)return null!==(i=o.errorMessage)&&void 0!==i?i:"Please enter at least "+o.value+" characters";break;case Or.MaxLength:if(void 0!==o.value&&s.length>o.value)return null!==(n=o.errorMessage)&&void 0!==n?n:"Please enter no more than "+o.value+" characters"}return!1}(c,t.validation,t.optional)),[c,t.validation,t.optional]),v=gn(t.validation,Or.MinLength),g=gn(t.validation,Or.MaxLength),_=Fl((()=>function(e,t){var r=1===e?void 0:e;return r&&t?"Enter "+r+"-"+t+" characters":r?"Enter at least "+r+" "+(1===r?"character":"characters"):t?"Maximum "+t+" "+(1===t?"character":"characters"):void 0}(v,g)),[v,g]);return rd(Ja,{children:[rd("div",{className:"question-container",children:[rd(vd,{question:t,forceDisableHtml:r,htmlFor:h}),rd("textarea",{ref:u,id:h,rows:4,placeholder:null==i?void 0:i.placeholder,minLength:v,maxLength:g,onInput(e){d(e.currentTarget.value),e.stopPropagation()},onKeyDown(e){e.stopPropagation()},value:c}),_&&rd("div",{className:"validation-hint",children:_})]}),rd(pd,{text:t.buttonText||"Submit",submitDisabled:!!p,appearance:i,onSubmit(){p||n(c.trim())},onPreviewSubmit(){p||s(c.trim())}})]})}function bd(e){var{question:t,forceDisableHtml:r,appearance:i,onSubmit:n,onPreviewSubmit:s}=e;return rd(Ja,{children:[rd("div",{className:"question-container",children:rd(vd,{question:t,forceDisableHtml:r})}),rd(pd,{text:t.buttonText||"Submit",submitDisabled:!1,link:t.link,appearance:i,onSubmit:()=>n("link clicked"),onPreviewSubmit:()=>s("link clicked")})]})}function wd(e){var t,{question:r,forceDisableHtml:i,displayQuestionIndex:n,appearance:s,onSubmit:o,onPreviewSubmit:a,initialValue:l}=e,u=r.scale,c=10===r.scale?0:1,[d,h]=Ll((()=>Qr(l)?l:jr(l)&&l.length>0&&Qr(parseInt(l[0]))?parseInt(l[0]):Yr(l)&&Qr(parseInt(l))?parseInt(l):null)),p="emoji"===r.display&&2===r.scale,{isPreviewMode:v}=zc(),g=e=>v?a(e):o(e);return rd(Ja,{children:[rd("div",{className:"question-container",children:[rd(vd,{question:r,forceDisableHtml:i}),rd("div",{className:"rating-section",children:[rd("div",{className:"rating-options",children:["emoji"===r.display&&rd("div",{className:"rating-options-emoji"+(p?" rating-options-emoji-2":""),children:null==(t=Ed[r.scale])?void 0:t.map(((e,t)=>rd("button",{"aria-label":"Rate "+(t+1),className:"ratings-emoji question-"+n+"-rating-"+t+" "+(t+1===d?"rating-active":""),value:t+1,type:"button",onClick(){var e=t+1;h(e),r.skipSubmitButton&&g(e)},children:e},t)))}),"number"===r.display&&rd("div",{className:"rating-options-number",style:{gridTemplateColumns:"repeat("+(u-c+1)+", minmax(0, 1fr))"},children:Td(r.scale).map(((e,t)=>rd(Sd,{displayQuestionIndex:n,active:d===e,appearance:s,num:e,setActiveNumber(e){h(e),r.skipSubmitButton&&g(e)}},t)))})]}),!p&&rd("div",{className:"rating-text",children:[rd("div",{children:r.lowerBoundLabel}),rd("div",{children:r.upperBoundLabel})]})]})]}),rd(pd,{text:r.buttonText||(null==s?void 0:s.submitButtonText)||"Submit",submitDisabled:Kr(d)&&!r.optional,appearance:s,onSubmit:()=>o(d),onPreviewSubmit:()=>a(d),skipSubmitButton:r.skipSubmitButton})]})}function Sd(e){var{num:t,active:r,displayQuestionIndex:i,setActiveNumber:n}=e;return rd("button",{"aria-label":"Rate "+t,className:"ratings-number question-"+i+"-rating-"+t+" "+(r?"rating-active":""),type:"button",onClick(){n(t)},children:t})}function Cd(e){var{question:t,forceDisableHtml:i,displayQuestionIndex:n,appearance:s,onSubmit:o,onPreviewSubmit:a,initialValue:l}=e,u=Al(null),c=Fl((()=>(e=>{if(!e.shuffleOptions)return e.choices;var t=e.choices,r="";e.hasOpenChoice&&(r=t.pop());var i=Vc(t,qc(t));return e.hasOpenChoice&&(e.choices.push(r),i.push(r)),i})(t)),[t]),[d,h]=Ll((()=>((e,t)=>Yr(e)||md(e)?e:t===Yl.SingleChoice?null:[])(l,t.type))),[p,v]=Ll((()=>((e,t)=>{if(Yr(e)&&!t.includes(e))return{isSelected:!0,inputValue:e};if(md(e)){var r=e.find((e=>!t.includes(e)));if(r)return{isSelected:!0,inputValue:r}}return{isSelected:!1,inputValue:""}})(l,c))),{isPreviewMode:g}=zc(),_=t.type===Yl.SingleChoice,f=t.type===Yl.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&&jr(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)},w=e=>{e.stopPropagation(),"Enter"!==e.key||S()||(e.preventDefault(),C()),"Escape"===e.key&&(e.preventDefault(),v((e=>r({},e,{isSelected:!1,inputValue:""}))),_&&h(null))},S=()=>!(t.optional||!Kr(d)&&(!jr(d)||p.isSelected||0!==d.length)&&(!p.isSelected||""!==p.inputValue.trim())),C=()=>{p.isSelected&&f?jr(d)&&(g?a([...d,p.inputValue]):o([...d,p.inputValue])):g?a(d):o(d)};return rd(Ja,{children:[rd("div",{className:"question-container",children:[rd(vd,{question:t,forceDisableHtml:i}),rd("fieldset",{className:"multiple-choice-options limit-height",children:[rd("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:jr(d)&&d.includes(e);return rd("label",{className:i?"choice-option-open":"",children:[rd("div",{className:"response-choice",children:[rd("input",{type:_?"radio":"checkbox",name:s,checked:a,onChange:()=>y(e,i),id:s,"aria-controls":o}),rd("span",{children:i?e+":":e})]}),i&&rd("input",{type:"text",ref:u,id:o,name:"question"+n+"Open",value:p.inputValue,onKeyDown:w,onInput:b,onClick(t){p.isSelected||y(e,!0),t.stopPropagation()},"aria-label":e+" - please specify"})]},r)}))]})]}),rd(pd,{text:t.buttonText||"Submit",submitDisabled:S(),appearance:s,onSubmit:C,onPreviewSubmit:C,skipSubmitButton:m})]})}var Id=[1,2,3,4,5],xd=[1,2,3,4,5,6,7],kd=[0,1,2,3,4,5,6,7,8,9,10],Ed={2:[ld,ud],3:[sd,nd,id],5:[od,sd,nd,id,ad]};function Td(e){switch(e){case 5:default:return Id;case 7:return xd;case 10:return kd}}var Rd=cs("[Surveys]");function Md(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?Xl.End:s;if(n.branching.type===Xl.End)return Xl.End;if(n.branching.type===Xl.SpecificQuestion){if(Number.isInteger(n.branching.index))return n.branching.index}else if(n.branching.type===Xl.ResponseBased){if(n.type===Yl.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===Xl.End?Xl.End:s}}else if(n.type===Yl.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(2===t){if(1>e||e>2)throw new Error("The response must be in range 1-2");return 1===e?"positive":"negative"}if(3===t){if(1>e||e>3)throw new Error("The response must be in range 1-3");return 1===e?"negative":2===e?"neutral":"positive"}if(5===t){if(1>e||e>5)throw new Error("The response must be in range 1-5");return e>2?3===e?"neutral":"positive":"negative"}if(7===t){if(1>e||e>7)throw new Error("The response must be in range 1-7");return e>3?4===e?"neutral":"positive":"negative"}if(10===t){if(0>e||e>10)throw new Error("The response must be in range 0-10");return e>6?e>8?"promoters":"passives":"detractors"}throw new Error("The scale must be one of: 2, 3, 5, 7, 10")}(r,n.scale);if(null!=(u=n.branching)&&null!=(u=u.responseValues)&&u.hasOwnProperty(c)){var d=n.branching.responseValues[c];return Number.isInteger(d)?d:d===Xl.End?Xl.End:s}}return s}return Rd.warn("Falling back to next question index due to unexpected branching type"),s}var Ld=Gn,Pd=Kn,Ad="ph:show_survey_widget",Fd="PHWidgetSurveyClickListener";function Nd(e,t){try{var r=e.getBoundingClientRect(),i=Ld.innerHeight,n=Ld.innerWidth,s=r.left+r.width/2-t/2;s+t>n-20&&(s=n-t-20),20>s&&(s=20);var o=i-r.bottom,a=250>o&&r.top>o;return{position:"fixed",top:a?"auto":r.bottom+12+"px",left:s+"px",right:"auto",bottom:a?i-r.top+12+"px":"auto",zIndex:Rc.zIndex}}catch(e){return tu.warn("Failed to calculate trigger position:",e),null}}class Od{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(so);if(e)for(var t of e)Kc(t)&&Hc(t,this._posthog)},this.handlePopoverSurvey=(e,t)=>{var i,n,s,o,a=null!=t&&t.position||null!=t&&t.selector?r({},e,{appearance:r({},e.appearance,t.position&&{position:t.position},t.selector&&{widgetSelector:t.selector})}):e;this._clearSurveyTimeout(a.id);var{properties:l,initialResponses:u}=null!=t?t:{},c=!(!u||0>=Object.keys(u).length)&&this._handleInitialResponses(a,u,l);if(!c||null!=(i=a.appearance)&&i.displayThankYouMessage){this._addSurveyToFocus(a);var d={};if((null==(n=a.appearance)?void 0:n.position)===Wl.NextToTrigger&&null!=(s=a.appearance)&&s.widgetSelector){var h,p=Pd.querySelector(a.appearance.widgetSelector);p&&(d=Nd(p,parseInt((null==(h=a.appearance)?void 0:h.maxWidth)||Rc.maxWidth))||{})}var v=(null==(o=a.appearance)?void 0:o.surveyPopupDelaySeconds)||0,{shadow:g}=Ac(a,this._posthog),_={posthog:this._posthog,survey:a,removeSurveyFromFocus:this._removeSurveyFromFocus,properties:l,style:d,isSurveyCompleted:c,skipShownEvent:null==t?void 0:t.skipShownEvent};if(0>=v)return _l(rd(qd,r({},_)),g);var f=setTimeout((()=>{if(this._surveyTimeouts.delete(a.id),!Zc(a))return this._removeSurveyFromFocus(a);_l(rd(qd,r({},_,{survey:r({},a,{appearance:r({},a.appearance,{surveyPopupDelaySeconds:0})})})),g)}),1e3*v);this._surveyTimeouts.set(a.id,f)}},this._handleWidget=e=>{var{shadow:t,isNewlyCreated:r}=Ac(e,this._posthog);r&&_l(rd(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(Fd),this._widgetSelectorListeners.delete(e.id),tu.info("Removed click listener for survey "+e.id))},this._manageWidgetSelectorListener=(e,t)=>{var r=Pd.querySelector(t),i=this._widgetSelectorListeners.get(e.id);if(r){if(this._handleWidget(e),i){if(r===i.element)return;tu.info("Selector element changed for survey "+e.id+". Re-attaching listener."),this._removeWidgetSelectorListener(e)}if(!r.hasAttribute(Fd)){var n=t=>{var r,i;t.stopPropagation();var n=(null==(r=e.appearance)?void 0:r.position)===Wl.NextToTrigger?Nd(t.currentTarget,parseInt((null==(i=e.appearance)?void 0:i.maxWidth)||Rc.maxWidth)):{};Ld.dispatchEvent(new CustomEvent(Ad,{detail:{surveyId:e.id,position:n}}))};bs(r,"click",n),r.setAttribute(Fd,"true"),this._widgetSelectorListeners.set(e.id,{element:r,listener:n,survey:e}),tu.info("Attached click listener for feedback button survey "+e.id)}}else i&&this._removeWidgetSelectorListener(e)},this.renderPopover=e=>{var{shadow:t}=Ac(e,this._posthog);_l(rd(qd,{posthog:this._posthog,survey:e,removeSurveyFromFocus:this._removeSurveyFromFocus}),t)},this.renderSurvey=(e,t,r)=>{var i,n=!1;null!=(i=this._posthog.config)&&null!=(i=i.surveys)&&i.prefillFromUrl&&(n=this._handleUrlPrefill(e)),_l(rd(qd,{posthog:this._posthog,survey:e,removeSurveyFromFocus:this._removeSurveyFromFocus,isPopup:!1,properties:r,isSurveyCompleted:n}),t)},this.getActiveMatchingSurveys=function(e,r){var i;void 0===r&&(r=!1),null==(i=t._posthog)||null==(i=i.surveys)||i.getSurveys((r=>{var i=r.filter((e=>t.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===Gl.Popover||e.type===Gl.Widget)),i=t._sortSurveysByAppearanceDelay(r),n=new Set;i.forEach((e=>{if(e.type===Gl.Widget){var r,i,s,o;if((null==(r=e.appearance)?void 0:r.widgetType)===zl.Tab)return void t._handleWidget(e);(null==(i=e.appearance)?void 0:i.widgetType)===zl.Selector&&null!=(s=e.appearance)&&s.widgetSelector&&(n.add(e.id),t._manageWidgetSelectorListener(e,null==(o=e.appearance)?void 0:o.widgetSelector))}Kr(t._surveyInFocus)&&e.type===Gl.Popover&&t.handlePopoverSurvey(e)})),t._widgetSelectorListeners.forEach((e=>{var{survey:r}=e;n.has(r.id)||t._removeWidgetSelectorListener(r)}))}),e)},this._addSurveyToFocus=e=>{Kr(this._surveyInFocus)||tu.error("Survey "+this._surveyInFocus+" already in focus. Cannot add survey "+e.id+"."),this._surveyInFocus=e.id},this._removeSurveyFromFocus=e=>{this._surveyInFocus!==e.id&&tu.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)&&(tu.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=Kc(e),s=Kc(t);if(n&&!s)return-1;if(!n&&s)return 1;var o=e.schedule===Kl,a=t.schedule===Kl;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))return!1;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&&!Gr(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}}(Ld.location.search);if(0===Object.keys(t).length)return!1;tu.info("[Survey Prefill] Detected URL prefill parameters");var r=this._processPrefillData(e,t);if(!r)return!1;var{responses:i,submissionId:n,isSurveyCompleted:s,skippedResponses:o}=r;return(Object.keys(o).length>0&&e.enable_partial_responses||s)&&Nc({responses:s?i:o,survey:e,surveySubmissionId:n,posthog:this._posthog,isSurveyCompleted:s}),this._prefillHandledSurveys.add(e.id),s}_handleInitialResponses(e,t,r){var i={};for(var[n,s]of Object.entries(t))i[parseInt(n)]=jr(s)?s.map(String):[String(s)];tu.info("[Survey] Processing initial responses");var o=this._processPrefillData(e,i);if(!o)return!1;var{responses:a,submissionId:l,isSurveyCompleted:u}=o;return Nc({responses:a,survey:e,surveySubmissionId:l,posthog:this._posthog,isSurveyCompleted:u,properties:r}),u}_processPrefillData(e,t){try{var r=function(e,t){var r={};return e.questions.forEach(((e,i)=>{if(t[i]&&e.id){var n=t[i],s=Ec(e.id);try{switch(e.type){case Yl.SingleChoice:if(!e.choices||0===e.choices.length)return void us.warn("[Survey Prefill] Question "+i+" has no choices");var o=parseInt(n[0],10);if(isNaN(o)||0>o||o>=e.choices.length)return void us.warn("[Survey Prefill] Invalid choice index for q"+i+": "+n[0]);r[s]=e.choices[o];break;case Yl.MultipleChoice:if(!e.choices||0===e.choices.length)return void us.warn("[Survey Prefill] Question "+i+" has no choices");var a=n.map((e=>parseInt(e,10))).filter((t=>!isNaN(t)&&t>=0&&e.choices.length>t));if(0===a.length)return void us.warn("[Survey Prefill] No valid choices for q"+i);var l=[...new Set(a.map((t=>e.choices[t])))];a.length>l.length&&us.warn("[Survey Prefill] Removed duplicate choices for q"+i),r[s]=l;break;case Yl.Rating:var u=parseInt(n[0],10),c=e.scale||10;if(isNaN(u)||0>u||u>c)return void us.warn("[Survey Prefill] Invalid rating for q"+i+": "+n[0]+" (scale: 0-"+c+")");r[s]=u;break;default:us.info("[Survey Prefill] Question type "+e.type+" does not support prefill")}}catch(e){us.error("[Survey Prefill] Error converting q"+i+":",e)}}})),r}(e,t);if(0===Object.keys(r).length)return tu.warn("[Survey Prefill] No valid responses after conversion"),null;var i=mu(),n=Object.keys(t).map((e=>parseInt(e,10))),{startQuestionIndex:s,skippedResponses:o}=function(e,t,r){for(var i=0,n={},s=e.questions.length+1;e.questions.length>i&&s>0&&t.includes(i);){var o=e.questions[i];if(!o||!("skipSubmitButton"in o)||!o.skipSubmitButton)break;if(o.id){var a=Ec(o.id);Gr(r[a])||(n[a]=r[a])}var l=Md(e,i,o.id?r[Ec(o.id)]:null);if(l===Xl.End)return{startQuestionIndex:e.questions.length,skippedResponses:n};i=l}return{startQuestionIndex:i,skippedResponses:n}}(e,n,r),a=s>=e.questions.length;return Yc(e,{surveySubmissionId:i,responses:r,lastQuestionIndex:s}),tu.info("[Survey Prefill] Stored prefilled responses in localStorage"),{responses:r,submissionId:i,startQuestionIndex:s,isSurveyCompleted:a,skippedResponses:o}}catch(e){return tu.error("[Survey Prefill] Error handling prefill:",e),null}}_isSurveyFeatureFlagEnabled(e,t){var r;if(void 0===t&&(t=void 0),!e)return!0;var i,n=!(null==(r=this._posthog.featureFlags)||!r.isFeatureEnabled(e,{send_event:!e.startsWith("survey-targeting-")})),s=!0;return t&&(s=(null==(i=this._posthog.featureFlags)?void 0:i.getFeatureFlag(e,{send_event:!1}))===t||"any"===t),n&&s}_isSurveyConditionMatched(e){return!e.conditions||Zc(e)&&function(e){var t,r;return function(e,t){var r,i,n;if(!e||0===e.length)return!0;if(!is)return!1;var s=cn(is,{userAgentDataPlatform:null==Xn||null==(r=Xn.userAgentData)?void 0:r.platform,maxTouchPoints:null==Xn?void 0:Xn.maxTouchPoints,screenWidth:null==Gn||null==(i=Gn.screen)?void 0:i.width,screenHeight:null==Gn||null==(n=Gn.screen)?void 0:n.height,devicePixelRatio:null==Gn?void 0:Gn.devicePixelRatio});return dc[null!=t?t:"icontains"](e,[s])}(null==(t=e.conditions)?void 0:t.deviceTypes,null==(r=e.conditions)?void 0:r.deviceTypesMatchType)}(e)&&function(e){var t;return null==(t=e.conditions)||!t.selector||!(null==kc||!kc.querySelector(e.conditions.selector))}(e)}_internalFlagCheckSatisfied(e){return $c(e)||this._isSurveyFeatureFlagEnabled(e.internal_targeting_flag_key)||Kc(e)}checkSurveyEligibility(e){var t,r,i={eligible:!0,reason:void 0};if(!ru(e))return i.eligible=!1,i.reason="Survey is not running. It was completed on "+e.end_date,i;if(!du.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)?function(e,t){if(!e||!t)return!0;var r="string"==typeof t?new Date(t):t,i=new Date,n=Math.abs(i.getTime()-r.getTime());return Math.ceil(n/864e5)>e}(null==(r=e.conditions)?void 0:r.seenSurveyWaitPeriodInDays,mc._get("lastSeenSurveyDate"))?(e=>!!mc._get(uu(e))&&!$c(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(!iu(e)&&!nu(e))return!0;var r=null==(t=this._posthog.surveys)||null==(t=t._surveyEventReceiver)?void 0:t.getSurveys();return!(null==r||!r.includes(e.id))}_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=Pd.querySelector(Qc(e,!0));null!=t&&t.shadowRoot&&_l(null,t.shadowRoot),null==t||t.remove()}catch(t){tu.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 Dd(e,t){if(Pd&&Ld){var r,i=new Od(e);if(e.config.disable_surveys_automatic_display)return tu.info("Surveys automatic display is disabled. Skipping call surveys and evaluate display logic."),i;if(!1===t)return tu.info("There are no surveys to load or Surveys is disabled in the project settings."),i;i.callSurveysAndEvaluateDisplayLogic(!0);var n=()=>{Gr(r)&&(r=setInterval((()=>{i.callSurveysAndEvaluateDisplayLogic(!1)}),1e3))};return n(),bs(Pd,"visibilitychange",(()=>{Pd.hidden?Gr(r)||(clearInterval(r),r=void 0):(i.callSurveysAndEvaluateDisplayLogic(!1),n())})),i}}function Bd(e){var{survey:t,removeSurveyFromFocus:r=(()=>{}),setSurveyVisible:i,isPreviewMode:n=!1}=e;Pl((()=>{var e;if(!n&&null!=(e=t.conditions)&&e.url){var s=()=>{var e,n=t.type===Gl.Widget,s=Zc(t),o=(null==(e=t.appearance)?void 0:e.widgetType)===zl.Tab&&n;if(!s)return tu.info("Hiding survey "+t.id+" because URL does not match"),i(!1),r(t);o&&(tu.info("Showing survey "+t.id+" because it is a feedback button tab and URL matches"),i(!0))};bs(Ld,"popstate",s),bs(Ld,"hashchange",s);var o=Ld.history.pushState,a=Ld.history.replaceState;return Ld.history.pushState=function(){for(var e=arguments.length,t=new Array(e),r=0;e>r;r++)t[r]=arguments[r];o.apply(this,t),s()},Ld.history.replaceState=function(){for(var e=arguments.length,t=new Array(e),r=0;e>r;r++)t[r]=arguments[r];a.apply(this,t),s()},()=>{Ld.removeEventListener("popstate",s),Ld.removeEventListener("hashchange",s),Ld.history.pushState=o,Ld.history.replaceState=a}}}),[n,t,r,i])}function Hd(e){switch(void 0===e&&(e=Zl.Right),e){case Zl.Top:return{top:"0",left:"50%",transform:"translateX(-50%)"};case Zl.Left:return{top:"50%",left:"0",transform:"rotate(90deg) translateY(-100%)",transformOrigin:"left top"};case Zl.Bottom:return{bottom:"0",left:"50%",transform:"translateX(-50%)"};default:return{top:"50%",right:"0",transform:"rotate(-90deg) translateY(-100%)",transformOrigin:"right top"}}}function qd(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=(()=>{}),properties:m,isSurveyCompleted:y,skipShownEvent:b}=e,w=Al(null),S=Number.isInteger(h),C=null!=(t=l.appearance)&&t.surveyPopupDelaySeconds?1e3*l.appearance.surveyPopupDelaySeconds:0,{isPopupVisible:I,isSurveySent:x,hidePopupWithViewTransition:k}=function(e,t,r,i,n,s,o,a){var[l,u]=Ll(i||0===r||e.type===Gl.ExternalSurvey),[c,d]=Ll(!1),h=()=>{var t=()=>{s&&n(e),u(!1)};Pd.startViewTransition?Pd.startViewTransition((()=>{var e;null==o||null==(e=o.current)||e.remove()})).finished.then((()=>{setTimeout((()=>{t()}),100)})):t()},p=t=>{t.detail.surveyId===e.id&&h()};return Pl((()=>{if(t){if(!i){var n=t=>{var r,i;if(t.detail.surveyId===e.id){if(null==(r=e.appearance)||!r.displayThankYouMessage)return h();d(!0),null!=(i=e.appearance)&&i.autoDisappear&&setTimeout((()=>{h()}),5e3)}},s=()=>{Zc(e)&&(u(!0),Ld.dispatchEvent(new Event("PHSurveyShown")),a||t.capture(Jl.SHOWN,{[Ql.SURVEY_NAME]:e.name,[Ql.SURVEY_ID]:e.id,[Ql.SURVEY_ITERATION]:e.current_iteration,[Ql.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(bs(Ld,"PHSurveyClosed",p),bs(Ld,"PHSurveySent",n),r>0){var o=setTimeout(s,r);return()=>{clearTimeout(o),Ld.removeEventListener("PHSurveyClosed",p),Ld.removeEventListener("PHSurveySent",n)}}return s(),()=>{Ld.removeEventListener("PHSurveyClosed",p),Ld.removeEventListener("PHSurveySent",n)}}}else tu.error("usePopupVisibility hook called without a PostHog instance.")}),[]),Bd({survey:e,removeSurveyFromFocus:n,setSurveyVisible:u,isPreviewMode:i}),{isPopupVisible:l,isSurveySent:c,setIsPopupVisible:u,hidePopupWithViewTransition:h}}(l,c,C,S,p,v,w,b),E=x||h===l.questions.length||!0===y,T=Fl((()=>{var e=Xc(l);return{isPreviewMode:S,previewPageIndex:h,onPopupSurveyDismissed(){Bc(l,c,S),_()},isPopup:v||!1,surveySubmissionId:(null==e?void 0:e.surveySubmissionId)||mu(),onPreviewSubmit:g,posthog:c,properties:m}}),[S,h,v,c,l,_,g,m]);return I?rd(jc.Provider,{value:T,children:rd("div",{className:"ph-survey",style:r({},ed(l.type,null==(i=l.appearance)?void 0:i.position,null==(n=l.appearance)?void 0:n.widgetType),d),ref:w,children:E?rd(fd,{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||Rc,onClose(){k(),f()}}):rd(Vd,{survey:l,forceDisableHtml:!!u,posthog:c})})}):null}function Vd(e){var t,{survey:i,forceDisableHtml:n,posthog:s}=e,[o,a]=Ll((()=>{var e=Xc(i);return null!=e&&e.responses&&tu.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,properties:v}=Nl(jc),[g,_]=Ll((()=>{var e=Xc(i);return l||(null==e?void 0:e.lastQuestionIndex)||0})),f=Fl((()=>Uc(i)),[i]);Pl((()=>{p&&!Gr(l)&&_(l)}),[l,p]);var m=f.at(g);return m?rd("form",{className:"survey-form",name:"surveyForm",children:[c&&!0!==(null==(t=i.appearance)?void 0:t.hideCancelButton)&&rd(gd,{onClick(){u()}}),rd("div",{className:"survey-box","data-question-index":g,children:$d({question:m,forceDisableHtml:n,displayQuestionIndex:g,appearance:i.appearance||Rc,onSubmit:e=>(e=>{var{res:t,displayQuestionIndex:n,questionId:l}=e;if(s)if(l){var u=Ec(l),c=r({},o,{[u]:t});a(c);var d=Md(i,n,t),p=d===Xl.End;p||(_(d),Yc(i,{surveySubmissionId:h,responses:c,lastQuestionIndex:d})),(i.enable_partial_responses||p)&&Nc({responses:c,survey:i,surveySubmissionId:h,isSurveyCompleted:p,posthog:s,properties:v})}else tu.error("onNextButtonClick called without a questionId.");else tu.error("onNextButtonClick called without a PostHog instance.")})({res:e,displayQuestionIndex:g,questionId:m.id}),onPreviewSubmit:d,initialValue:m.id?o[Ec(m.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]=Ll(!0),[v,g]=Ll(!1),[_,f]=Ll({}),m=()=>{g(!v)};if(Pl((()=>{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&&(tu.info("Received show event for feedback button survey "+l.id),f(r.detail.position||{}),m())};return bs(Ld,Ad,t),()=>{Ld.removeEventListener(Ad,t)}}}else tu.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]),Bd({survey:l,setSurveyVisible:p}),!h)return null;var y=()=>{l.schedule!==Kl&&p(!1),setTimeout((()=>{g(!1)}),200)};return rd(Ja,{children:["tab"===(null==(n=l.appearance)?void 0:n.widgetType)&&rd("button",{className:"ph-survey-widget-tab "+((null==(s=l.appearance)?void 0:s.tabPosition)===Zl.Top?"widget-tab-top":""),onClick:m,disabled:d,style:Hd(null==(o=l.appearance)?void 0:o.tabPosition),children:(null==(a=l.appearance)?void 0:a.widgetLabel)||""}),v&&rd(qd,{posthog:c,survey:l,forceDisableHtml:u,style:_,onPopupSurveyDismissed:y,onCloseConfirmationMessage:y})]})}var $d=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 Yl.Open:return Xa(yd,r({},u,{question:t,key:t.id}));case Yl.Link:return Xa(bd,r({},u,{question:t,key:t.id}));case Yl.Rating:return Xa(wd,r({},u,{question:t,key:t.id}));case Yl.SingleChoice:case Yl.MultipleChoice:return Xa(Cd,r({},u,{question:t,key:t.id}));default:return tu.error("Unsupported question type: "+t.type),null}};ns.__PosthogExtensions__=ns.__PosthogExtensions__||{},ns.__PosthogExtensions__.generateSurveys=Dd,ns.extendPostHogWithSurveys=Dd;class jd{emit(e){}}var zd=new jd,Wd=new class{getLogger(e,t,r){return new jd}};class Zd{constructor(e,t,r,i){this._provider=e,this.name=t,this.version=r,this.options=i}emit(e){this._getLogger().emit(e)}_getLogger(){if(this._delegate)return this._delegate;var e=this._provider._getDelegateLogger(this.name,this.version,this.options);return e?(this._delegate=e,this._delegate):zd}}class Gd{getLogger(e,t,r){var i;return null!==(i=this._getDelegateLogger(e,t,r))&&void 0!==i?i:new Zd(this,e,t,r)}_getDelegate(){var e;return null!==(e=this._delegate)&&void 0!==e?e:Wd}_setDelegate(e){this._delegate=e}_getDelegateLogger(e,t,r){var i;return null===(i=this._delegate)||void 0===i?void 0:i.getLogger(e,t,r)}}var Yd="object"==typeof globalThis?globalThis:"object"==typeof self?self:"object"==typeof window?window:"object"==typeof global?global:{},Xd=Symbol.for("io.opentelemetry.js.api.logs"),Kd=Yd;class Jd{constructor(){this._proxyLoggerProvider=new Gd}static getInstance(){return this._instance||(this._instance=new Jd),this._instance}setGlobalLoggerProvider(e){return Kd[Xd]?this.getLoggerProvider():(Kd[Xd]=(1,t=e,r=Wd,e=>1===e?t:r),this._proxyLoggerProvider._setDelegate(e),e);var t,r}getLoggerProvider(){var e,t;return null!==(t=null===(e=Kd[Xd])||void 0===e?void 0:e.call(Kd,1))&&void 0!==t?t:this._proxyLoggerProvider}getLogger(e,t,r){return this.getLoggerProvider().getLogger(e,t,r)}disable(){delete Kd[Xd],this._proxyLoggerProvider=new Gd}}var Qd=Jd.getInstance();class eh{constructor(e){this._delegate=void 0,this._delegate=e}export(e,t){this._delegate.export(e,t)}forceFlush(){return this._delegate.forceFlush()}shutdown(){return this._delegate.shutdown()}}class th extends Error{constructor(e,t,r){super(e),this.code=void 0,this.name="OTLPExporterError",this.data=void 0,this.data=r,this.code=t}}function rh(e){if(Number.isFinite(e)&&e>0)return e;throw new Error("Configuration: timeoutMillis is invalid, expected number greater than 0 (actual: '"+e+"')")}class ih{constructor(e){this._concurrencyLimit=void 0,this._sendingPromises=[],this._concurrencyLimit=e}pushPromise(e){if(this.hasReachedLimit())throw new Error("Concurrency Limit reached");this._sendingPromises.push(e);var t=()=>{var t=this._sendingPromises.indexOf(e);this._sendingPromises.splice(t,1)};e.then(t,t)}hasReachedLimit(){return this._sendingPromises.length>=this._concurrencyLimit}awaitAll(){var e=this;return t((function*(){yield Promise.all(e._sendingPromises)}))()}}function nh(e){return new ih(e.concurrencyLimit)}var sh="object"==typeof globalThis?globalThis:"object"==typeof self?self:"object"==typeof window?window:"object"==typeof global?global:{},oh="1.9.0",ah=/^(\d+)\.(\d+)\.(\d+)(-(.+))?$/,lh=function(e){var t=new Set([e]),r=new Set,i=e.match(ah);if(!i)return function(){return!1};var n=+i[1],s=+i[2],o=+i[3];if(null!=i[4])return function(t){return t===e};function a(e){return r.add(e),!1}function l(e){return t.add(e),!0}return function(e){if(t.has(e))return!0;if(r.has(e))return!1;var i=e.match(ah);if(!i)return a(e);var u=+i[2],c=+i[3];return null!=i[4]||n!==+i[1]?a(e):0===n?s!==u||o>c?a(e):l(e):s>u?a(e):l(e)}}(oh),uh=oh.split(".")[0],ch=Symbol.for("opentelemetry.js.api."+uh),dh=sh;function hh(e,t,r,i){var n;void 0===i&&(i=!1);var s=dh[ch]=null!==(n=dh[ch])&&void 0!==n?n:{version:oh};if(!i&&s[e]){var o=new Error("@opentelemetry/api: Attempted duplicate registration of API: "+e);return r.error(o.stack||o.message),!1}return s.version!==oh?(o=new Error("@opentelemetry/api: Registration of version v"+s.version+" for "+e+" does not match previously registered API v"+oh),r.error(o.stack||o.message),!1):(s[e]=t,r.debug("@opentelemetry/api: Registered a global for "+e+" v"+oh+"."),!0)}function ph(e){var t,r,i=null===(t=dh[ch])||void 0===t?void 0:t.version;if(i&&lh(i))return null===(r=dh[ch])||void 0===r?void 0:r[e]}function vh(e,t){t.debug("@opentelemetry/api: Unregistering a global for "+e+" v"+oh+".");var r=dh[ch];r&&delete r[e]}var gh,_h=function(){function e(e){this._namespace=e.namespace||"DiagComponentLogger"}return e.prototype.debug=function(){for(var e=[],t=0;arguments.length>t;t++)e[t]=arguments[t];return fh("debug",this._namespace,e)},e.prototype.error=function(){for(var e=[],t=0;arguments.length>t;t++)e[t]=arguments[t];return fh("error",this._namespace,e)},e.prototype.info=function(){for(var e=[],t=0;arguments.length>t;t++)e[t]=arguments[t];return fh("info",this._namespace,e)},e.prototype.warn=function(){for(var e=[],t=0;arguments.length>t;t++)e[t]=arguments[t];return fh("warn",this._namespace,e)},e.prototype.verbose=function(){for(var e=[],t=0;arguments.length>t;t++)e[t]=arguments[t];return fh("verbose",this._namespace,e)},e}();function fh(e,t,r){var i=ph("diag");if(i)return r.unshift(t),i[e].apply(i,function(e,t,r){if(r||2===arguments.length)for(var i,n=0,s=t.length;s>n;n++)!i&&n in t||(i||(i=[].slice.call(t,0,n)),i[n]=t[n]);return e.concat(i||[].slice.call(t))}([],function(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var i,n,s=r.call(e),o=[];try{for(;(void 0===t||t-- >0)&&!(i=s.next()).done;)o.push(i.value)}catch(e){n={error:e}}finally{try{i&&!i.done&&(r=s.return)&&r.call(s)}finally{if(n)throw n.error}}return o}(r),!1))}!function(e){e[e.NONE=0]="NONE",e[e.ERROR=30]="ERROR",e[e.WARN=50]="WARN",e[e.INFO=60]="INFO",e[e.DEBUG=70]="DEBUG",e[e.VERBOSE=80]="VERBOSE",e[e.ALL=9999]="ALL"}(gh||(gh={}));var mh=function(){function e(){function e(e){return function(){for(var t=[],r=0;arguments.length>r;r++)t[r]=arguments[r];var i=ph("diag");if(i)return i[e].apply(i,function(e,t,r){if(r||2===arguments.length)for(var i,n=0,s=t.length;s>n;n++)!i&&n in t||(i||(i=[].slice.call(t,0,n)),i[n]=t[n]);return e.concat(i||[].slice.call(t))}([],function(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var i,n,s=r.call(e),o=[];try{for(;(void 0===t||t-- >0)&&!(i=s.next()).done;)o.push(i.value)}catch(e){n={error:e}}finally{try{i&&!i.done&&(r=s.return)&&r.call(s)}finally{if(n)throw n.error}}return o}(t),!1))}}var t=this;t.setLogger=function(e,r){var i,n,s;if(void 0===r&&(r={logLevel:gh.INFO}),e===t){var o=new Error("Cannot use diag as the logger for itself. Please use a DiagLogger implementation like ConsoleDiagLogger or a custom implementation");return t.error(null!==(i=o.stack)&&void 0!==i?i:o.message),!1}"number"==typeof r&&(r={logLevel:r});var a=ph("diag"),l=function(e,t){function r(r,i){var n=t[r];return"function"!=typeof n||i>e?function(){}:n.bind(t)}return gh.NONE>e?e=gh.NONE:e>gh.ALL&&(e=gh.ALL),t=t||{},{error:r("error",gh.ERROR),warn:r("warn",gh.WARN),info:r("info",gh.INFO),debug:r("debug",gh.DEBUG),verbose:r("verbose",gh.VERBOSE)}}(null!==(n=r.logLevel)&&void 0!==n?n:gh.INFO,e);if(a&&!r.suppressOverrideMessage){var u=null!==(s=(new Error).stack)&&void 0!==s?s:"<failed to generate stacktrace>";a.warn("Current logger will be overwritten from "+u),l.warn("Current logger will overwrite one already registered from "+u)}return hh("diag",l,t,!0)},t.disable=function(){vh("diag",t)},t.createComponentLogger=function(e){return new _h(e)},t.verbose=e("verbose"),t.debug=e("debug"),t.info=e("info"),t.warn=e("warn"),t.error=e("error")}return e.instance=function(){return this._instance||(this._instance=new e),this._instance},e}();function yh(e){return Symbol.for(e)}var bh,wh=new function e(t){var r=this;r._currentContext=t?new Map(t):new Map,r.getValue=function(e){return r._currentContext.get(e)},r.setValue=function(t,i){var n=new e(r._currentContext);return n._currentContext.set(t,i),n},r.deleteValue=function(t){var i=new e(r._currentContext);return i._currentContext.delete(t),i}},Sh=function(){function e(){}return e.prototype.active=function(){return wh},e.prototype.with=function(e,t,r){for(var i=[],n=3;arguments.length>n;n++)i[n-3]=arguments[n];return t.call.apply(t,function(e,t,r){if(r||2===arguments.length)for(var i,n=0,s=t.length;s>n;n++)!i&&n in t||(i||(i=[].slice.call(t,0,n)),i[n]=t[n]);return e.concat(i||[].slice.call(t))}([r],function(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var i,n,s=r.call(e),o=[];try{for(;(void 0===t||t-- >0)&&!(i=s.next()).done;)o.push(i.value)}catch(e){n={error:e}}finally{try{i&&!i.done&&(r=s.return)&&r.call(s)}finally{if(n)throw n.error}}return o}(i),!1))},e.prototype.bind=function(e,t){return t},e.prototype.enable=function(){return this},e.prototype.disable=function(){return this},e}(),Ch="context",Ih=new Sh,xh=function(){function e(){}return e.getInstance=function(){return this._instance||(this._instance=new e),this._instance},e.prototype.setGlobalContextManager=function(e){return hh(Ch,e,mh.instance())},e.prototype.active=function(){return this._getContextManager().active()},e.prototype.with=function(e,t,r){for(var i,n=[],s=3;arguments.length>s;s++)n[s-3]=arguments[s];return(i=this._getContextManager()).with.apply(i,function(e,t,r){if(r||2===arguments.length)for(var i,n=0,s=t.length;s>n;n++)!i&&n in t||(i||(i=[].slice.call(t,0,n)),i[n]=t[n]);return e.concat(i||[].slice.call(t))}([e,t,r],function(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var i,n,s=r.call(e),o=[];try{for(;(void 0===t||t-- >0)&&!(i=s.next()).done;)o.push(i.value)}catch(e){n={error:e}}finally{try{i&&!i.done&&(r=s.return)&&r.call(s)}finally{if(n)throw n.error}}return o}(n),!1))},e.prototype.bind=function(e,t){return this._getContextManager().bind(e,t)},e.prototype._getContextManager=function(){return ph(Ch)||Ih},e.prototype.disable=function(){this._getContextManager().disable(),vh(Ch,mh.instance())},e}();!function(e){e[e.NONE=0]="NONE",e[e.SAMPLED=1]="SAMPLED"}(bh||(bh={}));var kh="0000000000000000",Eh="00000000000000000000000000000000",Th={traceId:Eh,spanId:kh,traceFlags:bh.NONE},Rh=function(){function e(e){void 0===e&&(e=Th),this._spanContext=e}return e.prototype.spanContext=function(){return this._spanContext},e.prototype.setAttribute=function(e,t){return this},e.prototype.setAttributes=function(e){return this},e.prototype.addEvent=function(e,t){return this},e.prototype.addLink=function(e){return this},e.prototype.addLinks=function(e){return this},e.prototype.setStatus=function(e){return this},e.prototype.updateName=function(e){return this},e.prototype.end=function(e){},e.prototype.isRecording=function(){return!1},e.prototype.recordException=function(e,t){},e}(),Mh=yh("OpenTelemetry Context Key SPAN");function Lh(e){return e.getValue(Mh)||void 0}function Ph(){return Lh(xh.getInstance().active())}function Ah(e,t){return e.setValue(Mh,t)}function Fh(e){return e.deleteValue(Mh)}function Nh(e,t){return Ah(e,new Rh(t))}function Oh(e){var t;return null===(t=Lh(e))||void 0===t?void 0:t.spanContext()}var Dh=/^([0-9a-f]{32})$/i,Bh=/^[0-9a-f]{16}$/i;function Hh(e){return Dh.test(r=e.traceId)&&r!==Eh&&Bh.test(t=e.spanId)&&t!==kh;var t,r}function qh(e){return new Rh(e)}var Vh=xh.getInstance(),Uh=function(){function e(){}return e.prototype.startSpan=function(e,t,r){if(void 0===r&&(r=Vh.active()),Boolean(null==t?void 0:t.root))return new Rh;var i,n=r&&Oh(r);return"object"==typeof(i=n)&&"string"==typeof i.spanId&&"string"==typeof i.traceId&&"number"==typeof i.traceFlags&&Hh(n)?new Rh(n):new Rh},e.prototype.startActiveSpan=function(e,t,r,i){var n,s,o;if(arguments.length>=2){2===arguments.length?o=t:3===arguments.length?(n=t,o=r):(n=t,s=r,o=i);var a=null!=s?s:Vh.active(),l=this.startSpan(e,n,a),u=Ah(a,l);return Vh.with(u,o,void 0,l)}},e}(),$h=new Uh,jh=function(){function e(e,t,r,i){this._provider=e,this.name=t,this.version=r,this.options=i}return e.prototype.startSpan=function(e,t,r){return this._getTracer().startSpan(e,t,r)},e.prototype.startActiveSpan=function(e,t,r,i){var n=this._getTracer();return Reflect.apply(n.startActiveSpan,n,arguments)},e.prototype._getTracer=function(){if(this._delegate)return this._delegate;var e=this._provider.getDelegateTracer(this.name,this.version,this.options);return e?(this._delegate=e,this._delegate):$h},e}(),zh=new(function(){function e(){}return e.prototype.getTracer=function(e,t,r){return new Uh},e}()),Wh=function(){function e(){}return e.prototype.getTracer=function(e,t,r){var i;return null!==(i=this.getDelegateTracer(e,t,r))&&void 0!==i?i:new jh(this,e,t,r)},e.prototype.getDelegate=function(){var e;return null!==(e=this._delegate)&&void 0!==e?e:zh},e.prototype.setDelegate=function(e){this._delegate=e},e.prototype.getDelegateTracer=function(e,t,r){var i;return null===(i=this._delegate)||void 0===i?void 0:i.getTracer(e,t,r)},e}(),Zh=xh.getInstance(),Gh=mh.instance(),Yh="trace",Xh=function(){function e(){this._proxyTracerProvider=new Wh,this.wrapSpanContext=qh,this.isSpanContextValid=Hh,this.deleteSpan=Fh,this.getSpan=Lh,this.getActiveSpan=Ph,this.getSpanContext=Oh,this.setSpan=Ah,this.setSpanContext=Nh}return e.getInstance=function(){return this._instance||(this._instance=new e),this._instance},e.prototype.setGlobalTracerProvider=function(e){var t=hh(Yh,this._proxyTracerProvider,mh.instance());return t&&this._proxyTracerProvider.setDelegate(e),t},e.prototype.getTracerProvider=function(){return ph(Yh)||this._proxyTracerProvider},e.prototype.getTracer=function(e,t){return this.getTracerProvider().getTracer(e,t)},e.prototype.disable=function(){vh(Yh,mh.instance()),this._proxyTracerProvider=new Wh},e}().getInstance(),Kh=yh("OpenTelemetry SDK Context Key SUPPRESS_TRACING");function Jh(e){return null==e||(Array.isArray(e)?function(e){var t;for(var r of e)if(null!=r){var i=typeof r;if(i!==t){if(!t){if(Qh(i)){t=i;continue}return!1}return!1}}return!0}(e):Qh(typeof e))}function Qh(e){switch(e){case"number":case"boolean":case"string":return!0}return!1}function ep(e){try{(e=>{Gh.error(function(e){return"string"==typeof e?e:JSON.stringify(function(e){for(var t={},r=e;null!==r;)Object.getOwnPropertyNames(r).forEach((e=>{if(!t[e]){var i=r[e];i&&(t[e]=String(i))}})),r=Object.getPrototypeOf(r);return t}(e))}(e))})(e)}catch(e){}}var tp,rp=performance,ip="telemetry.sdk.language",np="telemetry.sdk.name",sp="telemetry.sdk.version",op={[np]:"opentelemetry","process.runtime.name":"browser",[ip]:"webjs",[sp]:"2.2.0"},ap=Math.pow(10,6),lp=Math.pow(10,9);function up(e){return[Math.trunc(e/1e3),Math.round(e%1e3*ap)]}function cp(){var e=rp.timeOrigin;return"number"!=typeof e&&(e=rp.timing&&rp.timing.fetchStart),e}function dp(e){if(s=e,Array.isArray(s)&&2===s.length&&"number"==typeof s[0]&&"number"==typeof s[1])return e;if("number"==typeof e)return e<cp()?(t=e,r=up(cp()),i=up("number"==typeof t?t:rp.now()),lp>(n=[r[0]+i[0],r[1]+i[1]])[1]||(n[1]-=lp,n[0]+=1),n):up(e);var t,r,i,n,s;if(e instanceof Date)return up(e.getTime());throw TypeError("Invalid input type")}!function(e){e[e.SUCCESS=0]="SUCCESS",e[e.FAILED=1]="FAILED"}(tp||(tp={}));var hp="[object Object]",pp="[object Null]",vp="[object Undefined]",gp=function(){}.toString,_p=gp.call(Object),fp=Object.getPrototypeOf,mp=Object.prototype,yp=mp.hasOwnProperty,bp=Symbol?Symbol.toStringTag:void 0,wp=mp.toString;function Sp(e){if(!function(e){return null!=e&&"object"==typeof e}(e)||function(e){return null==e?void 0===e?vp:pp:bp&&bp in Object(e)?function(e){var t=yp.call(e,bp),r=e[bp],i=!1;try{e[bp]=void 0,i=!0}catch(e){}var n=wp.call(e);return i&&(t?e[bp]=r:delete e[bp]),n}(e):function(e){return wp.call(e)}(e)}(e)!==hp)return!1;var t=fp(e);if(null===t)return!0;var r=yp.call(t,"constructor")&&t.constructor;return"function"==typeof r&&r instanceof r&&gp.call(r)===_p}function Cp(e){return kp(e)?e.slice():e}function Ip(e,t,r,i){var n;if(void 0===r&&(r=0),20>=r){if(r++,Rp(e)||Rp(t)||Ep(t))n=Cp(t);else if(kp(e)){if(n=e.slice(),kp(t))for(var s=0,o=t.length;o>s;s++)n.push(Cp(t[s]));else if(Tp(t))for(var a=Object.keys(t),l=0,u=a.length;u>l;l++){var c=a[l];n[c]=Cp(t[c])}}else if(Tp(e))if(Tp(t)){if(!function(e,t){return!(!Sp(e)||!Sp(t))}(e,t))return t;n=Object.assign({},e);for(var d=Object.keys(t),h=0,p=d.length;p>h;h++){var v=d[h],g=t[v];if(Rp(g))void 0===g?delete n[v]:n[v]=g;else{var _=n[v],f=g;if(xp(e,v,i)||xp(t,v,i))delete n[v];else{if(Tp(_)&&Tp(f)){var m=i.get(_)||[],y=i.get(f)||[];m.push({obj:e,key:v}),y.push({obj:t,key:v}),i.set(_,m),i.set(f,y)}n[v]=Ip(n[v],g,r,i)}}}}else n=t;return n}}function xp(e,t,r){for(var i=r.get(e[t])||[],n=0,s=i.length;s>n;n++){var o=i[n];if(o.key===t&&o.obj===e)return!0}return!1}function kp(e){return Array.isArray(e)}function Ep(e){return"function"==typeof e}function Tp(e){return!Rp(e)&&!kp(e)&&!Ep(e)&&"object"==typeof e}function Rp(e){return"string"==typeof e||"number"==typeof e||"boolean"==typeof e||void 0===e||e instanceof Date||e instanceof RegExp||null===e}class Mp extends Error{constructor(e){super(e),Object.setPrototypeOf(this,Mp.prototype)}}function Lp(e,t){var r,i=new Promise((function(e,i){r=setTimeout((function(){i(new Mp("Operation timed out."))}),t)}));return Promise.race([e,i]).then((e=>(clearTimeout(r),e)),(e=>{throw clearTimeout(r),e}))}class Pp{constructor(){this._promise=void 0,this._resolve=void 0,this._reject=void 0,this._promise=new Promise(((e,t)=>{this._resolve=e,this._reject=t}))}get promise(){return this._promise}resolve(e){this._resolve(e)}reject(e){this._reject(e)}}class Ap{constructor(e,t){this._callback=void 0,this._that=void 0,this._isCalled=!1,this._deferred=new Pp,this._callback=e,this._that=t}get isCalled(){return this._isCalled}get promise(){return this._deferred.promise}call(){if(!this._isCalled){this._isCalled=!0;try{for(var e=arguments.length,t=new Array(e),r=0;e>r;r++)t[r]=arguments[r];Promise.resolve(this._callback.call(this._that,...t)).then((e=>this._deferred.resolve(e)),(e=>this._deferred.reject(e)))}catch(e){this._deferred.reject(e)}}return this._deferred.promise}}var Fp={_export:(e,t)=>new Promise((r=>{Zh.with(function(e){return e.setValue(Kh,!0)}(Zh.active()),(()=>{e.export(t,(e=>{r(e)}))}))}))};class Np{constructor(e,t,r,i,n){this._transport=void 0,this._serializer=void 0,this._responseHandler=void 0,this._promiseQueue=void 0,this._timeout=void 0,this._diagLogger=void 0,this._transport=e,this._serializer=t,this._responseHandler=r,this._promiseQueue=i,this._timeout=n,this._diagLogger=Gh.createComponentLogger({namespace:"OTLPExportDelegate"})}export(e,t){if(this._diagLogger.debug("items to be sent",e),this._promiseQueue.hasReachedLimit())t({code:tp.FAILED,error:new Error("Concurrent export limit reached")});else{var r=this._serializer.serializeRequest(e);null!=r?this._promiseQueue.pushPromise(this._transport.send(r,this._timeout).then((e=>{if("success"!==e.status)t("failure"===e.status&&e.error?{code:tp.FAILED,error:e.error}:"retryable"===e.status?{code:tp.FAILED,error:new th("Export failed with retryable status")}:{code:tp.FAILED,error:new th("Export failed with unknown error")});else{if(null!=e.data)try{this._responseHandler.handleResponse(this._serializer.deserializeResponse(e.data))}catch(t){this._diagLogger.warn("Export succeeded but could not deserialize response - is the response specification compliant?",t,e.data)}t({code:tp.SUCCESS})}}),(e=>t({code:tp.FAILED,error:e})))):t({code:tp.FAILED,error:new Error("Nothing to send")})}}forceFlush(){return this._promiseQueue.awaitAll()}shutdown(){var e=this;return t((function*(){e._diagLogger.debug("shutdown started"),yield e.forceFlush(),e._transport.shutdown()}))()}}function Op(e,t,r){return i={transport:r,serializer:t,promiseHandler:nh(e)},new Np(i.transport,i.serializer,{handleResponse(e){null!=e&&function(e){return{}.hasOwnProperty.call(e,"partialSuccess")}(e)&&null!=e.partialSuccess&&0!==Object.keys(e.partialSuccess).length&&Gh.warn("Received Partial Success response:",JSON.stringify(e.partialSuccess))}},i.promiseHandler,{timeout:e.timeoutMillis}.timeout);var i}function Dp(e){return 48>e||e>57?97>e||e>102?e-55:e-87:e-48}function Bp(e){for(var t=new Uint8Array(e.length/2),r=0,i=0;e.length>i;i+=2){var n=Dp(e.charCodeAt(i)),s=Dp(e.charCodeAt(i+1));t[r++]=n<<4|s}return t}function Hp(e){var t=BigInt(1e9);return BigInt(Math.trunc(e[0]))*t+BigInt(Math.trunc(e[1]))}function qp(e){var t;return t=Hp(e),{low:Number(BigInt.asUintN(32,t)),high:Number(BigInt.asUintN(32,t>>BigInt(32)))}}var Vp="undefined"!=typeof BigInt?function(e){return Hp(e).toString()}:function(e){return e[0]*lp+e[1]};function Up(e){return e}function $p(e){if(void 0!==e)return Bp(e)}var jp={encodeHrTime:qp,encodeSpanContext:Bp,encodeOptionalSpanContext:$p};function zp(e,t){return{key:e,value:Wp(t)}}function Wp(e){var t=typeof e;return"string"===t?{stringValue:e}:"number"===t?Number.isInteger(e)?{intValue:e}:{doubleValue:e}:"boolean"===t?{boolValue:e}:e instanceof Uint8Array?{bytesValue:e}:Array.isArray(e)?{arrayValue:{values:e.map(Wp)}}:"object"===t&&null!=e?{kvlistValue:{values:Object.entries(e).map((e=>{var[t,r]=e;return zp(t,r)}))}}:{}}function Zp(e,t){var r=function(e){var t=new Map;for(var r of e){var{resource:i,instrumentationScope:{name:n,version:s="",schemaUrl:o=""}}=r,a=t.get(i);a||(a=new Map,t.set(i,a));var l=n+"@"+s+":"+o,u=a.get(l);u||a.set(l,u=[]),u.push(r)}return t}(e);return Array.from(r,(e=>{var[r,i]=e,n=function(e){var t,r={attributes:(t=e.attributes,Object.keys(t).map((e=>zp(e,t[e])))),droppedAttributesCount:0},i=e.schemaUrl;return i&&""!==i&&(r.schemaUrl=i),r}(r);return{resource:n,scopeLogs:Array.from(i,(e=>{var r,[,i]=e;return{scope:(r=i[0].instrumentationScope,{name:r.name,version:r.version}),logRecords:i.map((e=>function(e,t){var r,i,n,s;return{timeUnixNano:t.encodeHrTime(e.hrTime),observedTimeUnixNano:t.encodeHrTime(e.hrTimeObserved),severityNumber:e.severityNumber,severityText:e.severityText,body:Wp(e.body),eventName:e.eventName,attributes:(s=e.attributes,Object.keys(s).map((e=>zp(e,s[e])))),droppedAttributesCount:e.droppedAttributesCount,flags:null==(r=e.spanContext)?void 0:r.traceFlags,traceId:t.encodeOptionalSpanContext(null==(i=e.spanContext)?void 0:i.traceId),spanId:t.encodeOptionalSpanContext(null==(n=e.spanContext)?void 0:n.spanId)}}(e,t))),schemaUrl:i[0].instrumentationScope.schemaUrl}})),schemaUrl:n.schemaUrl}}))}var Gp=e=>null!==e&&"object"==typeof e&&"function"==typeof e.then;class Yp{static FromAttributeList(e,t){var r=new Yp({},t);return r._rawAttributes=Kp(e),r._asyncAttributesPending=e.filter((e=>{var[t,r]=e;return Gp(r)})).length>0,r}constructor(e,t){var r;this._rawAttributes=void 0,this._asyncAttributesPending=!1,this._schemaUrl=void 0,this._memoizedAttributes=void 0;var i=null!==(r=e.attributes)&&void 0!==r?r:{};this._rawAttributes=Object.entries(i).map((e=>{var[t,r]=e;return Gp(r)&&(this._asyncAttributesPending=!0),[t,r]})),this._rawAttributes=Kp(this._rawAttributes),this._schemaUrl=function(e){if("string"==typeof e||void 0===e)return e;Gh.warn("Schema URL must be string or undefined, got %s. Schema URL will be ignored.",e)}(null==t?void 0:t.schemaUrl)}get asyncAttributesPending(){return this._asyncAttributesPending}waitForAsyncAttributes(){var e=this;return t((function*(){if(e.asyncAttributesPending){for(var t=0;e._rawAttributes.length>t;t++){var[r,i]=e._rawAttributes[t];e._rawAttributes[t]=[r,Gp(i)?yield i:i]}e._asyncAttributesPending=!1}}))()}get attributes(){if(this.asyncAttributesPending&&Gh.error("Accessing resource attributes before async attributes settled"),this._memoizedAttributes)return this._memoizedAttributes;var e={};for(var[t,r]of this._rawAttributes){var i;Gp(r)?Gh.debug("Unsettled resource attribute "+t+" skipped"):null!=r&&(null!==(i=e[t])&&void 0!==i||(e[t]=r))}return this._asyncAttributesPending||(this._memoizedAttributes=e),e}getRawAttributes(){return this._rawAttributes}get schemaUrl(){return this._schemaUrl}merge(e){if(null==e)return this;var t,r,i,n,s=(n=null==(r=e)?void 0:r.schemaUrl,void 0===(i=null==(t=this)?void 0:t.schemaUrl)||""===i?n:void 0===n||""===n||i===n?i:void Gh.warn('Schema URL merge conflict: old resource has "%s", updating resource has "%s". Resulting resource will have undefined Schema URL.',i,n)),o=s?{schemaUrl:s}:void 0;return Yp.FromAttributeList([...e.getRawAttributes(),...this.getRawAttributes()],o)}}function Xp(e,t){return Yp.FromAttributeList(Object.entries(e),t)}function Kp(e){return e.map((e=>{var[t,r]=e;return Gp(r)?[t,r.catch((e=>{Gh.debug("promise rejection for resource attribute: %s - %s",t,e)}))]:[t,r]}))}var Jp={serializeRequest(e){var t,r,i=(t=e,r=function(e){var t,r;if(void 0===e)return jp;var i=null===(t=e.useLongBits)||void 0===t||t,n=null!==(r=e.useHex)&&void 0!==r&&r;return{encodeHrTime:i?qp:Vp,encodeSpanContext:n?Up:Bp,encodeOptionalSpanContext:n?Up:$p}}({useHex:!0,useLongBits:!1}),{resourceLogs:Zp(t,r)});return(new TextEncoder).encode(JSON.stringify(i))},deserializeResponse(e){if(0===e.length)return{};var t=new TextDecoder;return JSON.parse(t.decode(e))}};class Qp{constructor(e){this._transport=void 0,this._transport=e}retry(e,t,r){return new Promise(((i,n)=>{setTimeout((()=>{this._transport.send(e,t).then(i,n)}),r)}))}send(e,r){var i=this;return t((function*(){for(var t=Date.now()+r,n=yield i._transport.send(e,r),s=5,o=1e3;"retryable"===n.status&&s>0;){var a;s--;var l=Math.max(Math.min(o,5e3)+(.4*Math.random()-.2),0);o*=1.5;var u=null!==(a=n.retryInMillis)&&void 0!==a?a:l,c=t-Date.now();if(u>c)return n;n=yield i.retry(e,c,u)}return n}))()}shutdown(){return this._transport.shutdown()}}function ev(e){return new Qp(e.transport)}function tv(e){return[429,502,503,504].includes(e)}function rv(e){if(null!=e){var t=Number.parseInt(e,10);if(Number.isInteger(t))return t>0?1e3*t:-1;var r=new Date(e).getTime()-Date.now();return 0>r?0:r}}class iv{constructor(e){this._parameters=void 0,this._parameters=e}send(e,r){var i=this;return t((function*(){var t=yield i._parameters.headers(),n=yield new Promise((n=>{var s=new XMLHttpRequest;s.timeout=r,s.open("POST",i._parameters.url),Object.entries(t).forEach((e=>{var[t,r]=e;s.setRequestHeader(t,r)})),s.ontimeout=e=>{n({status:"failure",error:new Error("XHR request timed out")})},s.onreadystatechange=()=>{200>s.status||s.status>299?s.status&&tv(s.status)?n({status:"retryable",retryInMillis:rv(s.getResponseHeader("Retry-After"))}):0!==s.status&&n({status:"failure",error:new Error("XHR request failed with non-retryable status")}):(Gh.debug("XHR success"),n({status:"success"}))},s.onabort=()=>{n({status:"failure",error:new Error("XHR request aborted")})},s.onerror=()=>{n({status:"failure",error:new Error("XHR request errored")})},s.send(e)}));return n}))()}shutdown(){}}class nv{constructor(e){this._params=void 0,this._params=e}send(e){var r=this;return t((function*(){var t=(yield r._params.headers())["Content-Type"];return new Promise((i=>{navigator.sendBeacon(r._params.url,new Blob([e],{type:t}))?(Gh.debug("SendBeacon success"),i({status:"success"})):i({status:"failure",error:new Error("SendBeacon failed")})}))}))()}shutdown(){}}class sv{constructor(e){this._parameters=void 0,this._parameters=e}send(e,r){var i=this;return t((function*(){var t=new AbortController,n=setTimeout((()=>t.abort()),r);try{var s,o=!!globalThis.location,a=new URL(i._parameters.url),l=yield fetch(a.href,{method:"POST",headers:yield i._parameters.headers(),body:e,signal:t.signal,keepalive:o,mode:o?(null==(s=globalThis.location)?void 0:s.origin)===a.origin?"same-origin":"cors":"no-cors"});return 200>l.status||l.status>299?tv(l.status)?{status:"retryable",retryInMillis:rv(l.headers.get("Retry-After"))}:{status:"failure",error:new Error("Fetch request failed with non-retryable status")}:(Gh.debug("response success"),{status:"success"})}catch(e){return"AbortError"===(null==e?void 0:e.name)?{status:"failure",error:new Error("Fetch request timed out",{cause:e})}:{status:"failure",error:new Error("Fetch request errored",{cause:e})}}finally{clearTimeout(n)}}))()}shutdown(){}}function ov(e,t){return Op(e,t,ev({transport:(r=e,new iv(r))}));var r}function av(e,t){return Op(e,t,ev({transport:(r=e,new sv(r))}));var r}function lv(e,t){return Op(e,t,ev({transport:(r={url:e.url,headers:e.headers},new nv(r))}));var r}function uv(e){if(null!=e)try{var t,r=null==(t=globalThis.location)?void 0:t.href;return new URL(e,r).href}catch(t){throw new Error("Configuration: Could not parse user-provided export URL: '"+e+"'")}}function cv(e){return"function"==typeof e.headers?e.headers:function(e){if(null!=e)return t((function*(){return e}))}(e.headers)}function dv(e,i,n){return s={url:e.url,timeoutMillis:e.timeoutMillis,headers:cv(e),concurrencyLimit:e.concurrencyLimit},o={},a=function(e,i){return r({},{timeoutMillis:1e4,concurrencyLimit:30,compression:"none"},{headers:(n=t((function*(){return e})),function(){return n.apply(this,arguments)}),url:"http://localhost:4318/"+i});var n}(n,i),r({},function(e,t,r){var i,n,s,o,a,l;return{timeoutMillis:rh(null!==(i=null!==(n=e.timeoutMillis)&&void 0!==n?n:t.timeoutMillis)&&void 0!==i?i:r.timeoutMillis),concurrencyLimit:null!==(s=null!==(o=e.concurrencyLimit)&&void 0!==o?o:t.concurrencyLimit)&&void 0!==s?s:r.concurrencyLimit,compression:null!==(a=null!==(l=e.compression)&&void 0!==l?l:t.compression)&&void 0!==a?a:r.compression}}(s,o,a),{headers:(c=s.headers,d=o.headers,h=a.headers,t((function*(){var e=r({},yield h()),t={};return null!=d&&Object.assign(t,yield d()),null!=c&&Object.assign(t,function(e){var t={};return Object.entries(null!=e?e:{}).forEach((e=>{var[r,i]=e;void 0!==i?t[r]=String(i):Gh.warn('Header "'+r+'" has invalid value ('+i+") and will be ignored")})),t}(yield c())),Object.assign(t,e)}))),url:null!==(l=null!==(u=uv(s.url))&&void 0!==u?u:o.url)&&void 0!==l?l:a.url});var s,o,a,l,u,c,d,h}function hv(e,t,r,i){return(e.headers||"function"!=typeof navigator.sendBeacon?void 0!==globalThis.fetch?av:ov:lv)(dv(e,r,i),t)}class pv extends eh{constructor(e){void 0===e&&(e={}),super(hv(e,Jp,"v1/logs",{"Content-Type":"application/json"}))}}class vv{set severityText(e){this._isLogRecordReadonly()||(this._severityText=e)}get severityText(){return this._severityText}set severityNumber(e){this._isLogRecordReadonly()||(this._severityNumber=e)}get severityNumber(){return this._severityNumber}set body(e){this._isLogRecordReadonly()||(this._body=e)}get body(){return this._body}get eventName(){return this._eventName}set eventName(e){this._isLogRecordReadonly()||(this._eventName=e)}get droppedAttributesCount(){return this.totalAttributesCount-Object.keys(this.attributes).length}constructor(e,t,r){this.hrTime=void 0,this.hrTimeObserved=void 0,this.spanContext=void 0,this.resource=void 0,this.instrumentationScope=void 0,this.attributes={},this._severityText=void 0,this._severityNumber=void 0,this._body=void 0,this._eventName=void 0,this.totalAttributesCount=0,this._isReadonly=!1,this._logRecordLimits=void 0;var{timestamp:i,observedTimestamp:n,eventName:s,severityNumber:o,severityText:a,body:l,attributes:u={},context:c}=r,d=Date.now();if(this.hrTime=dp(null!=i?i:d),this.hrTimeObserved=dp(null!=n?n:d),c){var h=Xh.getSpanContext(c);h&&Hh(h)&&(this.spanContext=h)}this.severityNumber=o,this.severityText=a,this.body=l,this.resource=e.resource,this.instrumentationScope=t,this._logRecordLimits=e.logRecordLimits,this._eventName=s,this.setAttributes(u)}setAttribute(e,t){return this._isLogRecordReadonly()||null===t?this:0===e.length?(Gh.warn("Invalid attribute key: "+e),this):Jh(t)||"object"==typeof t&&!Array.isArray(t)&&Object.keys(t).length>0?(this.totalAttributesCount+=1,Object.keys(this.attributes).length<this._logRecordLimits.attributeCountLimit||{}.hasOwnProperty.call(this.attributes,e)?(this.attributes[e]=Jh(t)?this._truncateToSize(t):t,this):(1===this.droppedAttributesCount&&Gh.warn("Dropping extra attributes."),this)):(Gh.warn("Invalid attribute value set for key: "+e),this)}setAttributes(e){for(var[t,r]of Object.entries(e))this.setAttribute(t,r);return this}setBody(e){return this.body=e,this}setEventName(e){return this.eventName=e,this}setSeverityNumber(e){return this.severityNumber=e,this}setSeverityText(e){return this.severityText=e,this}_makeReadonly(){this._isReadonly=!0}_truncateToSize(e){var t=this._logRecordLimits.attributeValueLengthLimit;return t>0?"string"==typeof e?this._truncateToLimitUtil(e,t):Array.isArray(e)?e.map((e=>"string"==typeof e?this._truncateToLimitUtil(e,t):e)):e:(Gh.warn("Attribute value limit must be positive, got "+t),e)}_truncateToLimitUtil(e,t){return e.length>t?e.substring(0,t):e}_isLogRecordReadonly(){return this._isReadonly&&Gh.warn("Can not execute the operation on emitted log record"),this._isReadonly}}class gv{constructor(e,t){this.instrumentationScope=void 0,this._sharedState=void 0,this.instrumentationScope=e,this._sharedState=t}emit(e){var t=e.context||Zh.active(),i=new vv(this._sharedState,this.instrumentationScope,r({context:t},e));this._sharedState.activeProcessor.onEmit(i,t),i._makeReadonly()}}class _v{forceFlush(){return Promise.resolve()}onEmit(e,t){}shutdown(){return Promise.resolve()}}class fv{constructor(e,t){this.processors=void 0,this.forceFlushTimeoutMillis=void 0,this.processors=e,this.forceFlushTimeoutMillis=t}forceFlush(){var e=this;return t((function*(){var t=e.forceFlushTimeoutMillis;yield Promise.all(e.processors.map((e=>Lp(e.forceFlush(),t))))}))()}onEmit(e,t){this.processors.forEach((r=>r.onEmit(e,t)))}shutdown(){var e=this;return t((function*(){yield Promise.all(e.processors.map((e=>e.shutdown())))}))()}}class mv{constructor(e,t,r,i){this.resource=void 0,this.forceFlushTimeoutMillis=void 0,this.logRecordLimits=void 0,this.processors=void 0,this.loggers=new Map,this.activeProcessor=void 0,this.registeredLogRecordProcessors=[],this.resource=e,this.forceFlushTimeoutMillis=t,this.logRecordLimits=r,this.processors=i,i.length>0?(this.registeredLogRecordProcessors=i,this.activeProcessor=new fv(this.registeredLogRecordProcessors,this.forceFlushTimeoutMillis)):this.activeProcessor=new _v}}class yv{constructor(e){var t,r,i;void 0===e&&(e={}),this._shutdownOnce=void 0,this._sharedState=void 0;var n,s,o,a,l,u,c,d=function(){for(var e=arguments.length,t=new Array(e),r=0;e>r;r++)t[r]=arguments[r];for(var i=t.shift(),n=new WeakMap;t.length>0;)i=Ip(i,t.shift(),0,n);return i}({},{forceFlushTimeoutMillis:3e4,logRecordLimits:{attributeValueLengthLimit:1/0,attributeCountLimit:128},includeTraceContext:!0},e),h=null!==(t=e.resource)&&void 0!==t?t:Xp({"service.name":"unknown_service",[ip]:op[ip],[np]:op[np],[sp]:op[sp]});this._sharedState=new mv(h,d.forceFlushTimeoutMillis,{attributeCountLimit:null!==(s=null!==(o=null!==(a=(n=d.logRecordLimits).attributeCountLimit)&&void 0!==a?a:void 0)&&void 0!==o?o:void 0)&&void 0!==s?s:128,attributeValueLengthLimit:null!==(l=null!==(u=null!==(c=n.attributeValueLengthLimit)&&void 0!==c?c:void 0)&&void 0!==u?u:void 0)&&void 0!==l?l:1/0},null!==(r=null==(i=e)?void 0:i.processors)&&void 0!==r?r:[]),this._shutdownOnce=new Ap(this._shutdown,this)}getLogger(e,t,r){if(this._shutdownOnce.isCalled)return Gh.warn("A shutdown LoggerProvider cannot provide a Logger"),zd;e||Gh.warn("Logger requested without instrumentation scope name.");var i=e||"unknown",n=i+"@"+(t||"")+":"+((null==r?void 0:r.schemaUrl)||"");return this._sharedState.loggers.has(n)||this._sharedState.loggers.set(n,new gv({name:i,version:t,schemaUrl:null==r?void 0:r.schemaUrl},this._sharedState)),this._sharedState.loggers.get(n)}forceFlush(){return this._shutdownOnce.isCalled?(Gh.warn("invalid attempt to force flush after LoggerProvider shutdown"),this._shutdownOnce.promise):this._sharedState.activeProcessor.forceFlush()}shutdown(){return this._shutdownOnce.isCalled?(Gh.warn("shutdown may only be called once per LoggerProvider"),this._shutdownOnce.promise):this._shutdownOnce.call()}_shutdown(){return this._sharedState.activeProcessor.shutdown()}}class bv{constructor(e,t){var r,i,n,s,o,a,l,u;this._exporter=void 0,this._maxExportBatchSize=void 0,this._maxQueueSize=void 0,this._scheduledDelayMillis=void 0,this._exportTimeoutMillis=void 0,this._isExporting=!1,this._finishedLogRecords=[],this._timer=void 0,this._shutdownOnce=void 0,this._exporter=e,this._maxExportBatchSize=null!==(r=null!==(i=null==t?void 0:t.maxExportBatchSize)&&void 0!==i?i:void 0)&&void 0!==r?r:512,this._maxQueueSize=null!==(n=null!==(s=null==t?void 0:t.maxQueueSize)&&void 0!==s?s:void 0)&&void 0!==n?n:2048,this._scheduledDelayMillis=null!==(o=null!==(a=null==t?void 0:t.scheduledDelayMillis)&&void 0!==a?a:void 0)&&void 0!==o?o:5e3,this._exportTimeoutMillis=null!==(l=null!==(u=null==t?void 0:t.exportTimeoutMillis)&&void 0!==u?u:void 0)&&void 0!==l?l:3e4,this._shutdownOnce=new Ap(this._shutdown,this),this._maxExportBatchSize>this._maxQueueSize&&(Gh.warn("BatchLogRecordProcessor: maxExportBatchSize must be smaller or equal to maxQueueSize, setting maxExportBatchSize to match maxQueueSize"),this._maxExportBatchSize=this._maxQueueSize)}onEmit(e){this._shutdownOnce.isCalled||this._addToBuffer(e)}forceFlush(){return this._shutdownOnce.isCalled?this._shutdownOnce.promise:this._flushAll()}shutdown(){return this._shutdownOnce.call()}_shutdown(){var e=this;return t((function*(){e.onShutdown(),yield e._flushAll(),yield e._exporter.shutdown()}))()}_addToBuffer(e){this._maxQueueSize>this._finishedLogRecords.length&&(this._finishedLogRecords.push(e),this._maybeStartTimer())}_flushAll(){return new Promise(((e,t)=>{for(var r=[],i=Math.ceil(this._finishedLogRecords.length/this._maxExportBatchSize),n=0;i>n;n++)r.push(this._flushOneBatch());Promise.all(r).then((()=>{e()})).catch(t)}))}_flushOneBatch(){return this._clearTimer(),0===this._finishedLogRecords.length?Promise.resolve():new Promise(((e,t)=>{Lp(this._export(this._finishedLogRecords.splice(0,this._maxExportBatchSize)),this._exportTimeoutMillis).then((()=>e())).catch(t)}))}_maybeStartTimer(){if(!this._isExporting){var e=()=>{this._isExporting=!0,this._flushOneBatch().then((()=>{this._isExporting=!1,this._finishedLogRecords.length>0&&(this._clearTimer(),this._maybeStartTimer())})).catch((e=>{this._isExporting=!1,ep(e)}))};if(this._finishedLogRecords.length>=this._maxExportBatchSize)return e();void 0===this._timer&&(this._timer=setTimeout((()=>e()),this._scheduledDelayMillis),"number"!=typeof this._timer&&this._timer.unref())}}_clearTimer(){void 0!==this._timer&&(clearTimeout(this._timer),this._timer=void 0)}_export(e){var t=()=>Fp._export(this._exporter,e).then((e=>{var t;e.code!==tp.SUCCESS&&ep(null!==(t=e.error)&&void 0!==t?t:new Error("BatchLogRecordProcessor: log record export failed (status "+e+")"))})).catch(ep),r=e.map((e=>e.resource)).filter((e=>e.asyncAttributesPending));return 0===r.length?t():Promise.all(r.map((e=>null==e.waitForAsyncAttributes?void 0:e.waitForAsyncAttributes()))).then(t,ep)}}class wv extends bv{constructor(e,t){super(e,t),this._visibilityChangeListener=void 0,this._pageHideListener=void 0,this._onInit(t)}onShutdown(){"undefined"!=typeof document&&(this._visibilityChangeListener&&document.removeEventListener("visibilitychange",this._visibilityChangeListener),this._pageHideListener&&document.removeEventListener("pagehide",this._pageHideListener))}_onInit(e){!0!==(null==e?void 0:e.disableAutoFlushOnDocumentHide)&&"undefined"!=typeof document&&(this._visibilityChangeListener=()=>{"hidden"===document.visibilityState&&this.forceFlush()},this._pageHideListener=()=>{this.forceFlush()},document.addEventListener("visibilitychange",this._visibilityChangeListener),document.addEventListener("pagehide",this._pageHideListener))}}var Sv=1e4,Cv=function(e,t,r,i,n,s){if(void 0===t&&(t=""),void 0===r&&(r={}),void 0===i&&(i=50),void 0===n&&(n=Sv),void 0===s&&(s=new WeakSet),s.has(e))return r[t||"circular"]="[Circular]",r;for(var o in s.add(e),e)if({}.hasOwnProperty.call(e,o)){var a=e[o],l=t?t+"."+o:o;if(Wr(a))Cv(a,l,r,i,n,s);else{if(i-=1,n-=String(a).length,n-=l.length,0>=i||0>=n)return void(r.attributes_truncated=!0);r[l]=a}}return r},Iv={log:"INFO",warn:"WARNING",error:"ERROR",debug:"DEBUG",info:"INFO"};ns.__PosthogExtensions__=ns.__PosthogExtensions__||{},ns.__PosthogExtensions__.logs={initializeLogs(e){(e=>{var t,i={"service.name":(null==(t=e.config.logs)?void 0:t.serviceName)||"posthog-browser-logs",host:ns.location.host};if(e.sessionManager){var{sessionId:n,windowId:s}=e.sessionManager.checkAndGetSessionAndWindowId(!0);i=r({},i,{"session.id":n,"window.id":s})}Qd.setGlobalLoggerProvider(new yv({resource:Xp(i),processors:[new wv(new pv({url:e.config.api_host+"/i/v1/logs?token="+e.config.token,headers:{"Content-Type":"text/plain"}}))]}))})(e);var t=Qd.getLogger("console"),i={};if(e.sessionManager){var{sessionStartTimestamp:n,lastActivityTimestamp:s}=e.sessionManager.checkAndGetSessionAndWindowId(!0);i={sessionStartTimestamp:n.toString(),lastActivityTimestamp:s.toString()}}var o=function(n){var s;ns.console[n]=(s=ns.console[n],function(){for(var o=arguments.length,a=new Array(o),l=0;o>l;l++)a[l]=arguments[l];if(a.length>0){var u=a.map((e=>{return JSON.stringify(e,(t=new WeakSet,(e,i)=>{if(i instanceof Error)return r({},i,{name:i.name,message:i.message,stack:i.stack});if("object"==typeof i&&!Kr(i)){if(t.has(i))return"[Circular]";t.add(i)}return i}));var t})).join(" ");u.length>Sv&&(u=u.slice(0,Sv)+"...",i.body_truncated="true"),t.emit({severityText:Iv[n],body:u,attributes:r({"log.source":"console."+n,distinct_id:e.get_distinct_id(),"location.href":ns.location.href},i,Wr(a[0])?Cv(a[0]):{})}),s.apply(ns.console,a)}})};for(var a of["debug","log","warn","error","info"])o(a)}};var xv=cs("[Error tracking]");function kv(){return new fn([new Mn,new qn,new Pn,new Ln,new Bn,new Dn,new Fn,new Hn],function(e){for(var t=arguments.length,i=new Array(t>1?t-1:0),n=1;t>n;n++)i[n-1]=arguments[n];return function(t,n){void 0===n&&(n=0);for(var s=[],o=t.split("\n"),a=n;o.length>a;a++){var l=o[a];if(1024>=l.length){var u=Tn.test(l)?l.replace(Tn,"$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>=Rn)break}}}return function(e){if(!e.length)return[];var t=Array.from(e);return t.reverse(),t.slice(0,Rn).map((e=>{return r({},e,{filename:e.filename||(i=t,i[i.length-1]||{}).filename,function:e.function||mn});var i}))}(s)}}("web:javascript",In,En))}var Ev=cs("[ExceptionAutocapture]"),Tv=kv(),Rv={wrapOnError(e){var t=Gn;t||Ev.info("window not available, cannot wrap onerror");var r=t.onerror;return t.onerror=function(){for(var t,i=arguments.length,n=new Array(i),s=0;i>s;s++)n[s]=arguments[s];var o=Tv.buildFromUnknown(n[4]||n[0],{mechanism:{handled:!1}});return e(o),null!==(t=null==r?void 0:r(...n))&&void 0!==t&&t},t.onerror.__POSTHOG_INSTRUMENTED__=!0,()=>{var e;null==(e=t.onerror)||delete e.__POSTHOG_INSTRUMENTED__,t.onerror=r}},wrapUnhandledRejection(e){var t=Gn;t||Ev.info("window not available, cannot wrap onUnhandledRejection");var r=t.onunhandledrejection;return t.onunhandledrejection=function(i){var n,s=Tv.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||Ev.info("console not available, cannot wrap console.error");var r=t.error;return t.error=function(){for(var t,i=arguments.length,n=new Array(i),s=0;i>s;s++)n[s]=arguments[s];t=1==n.length?n[0]:n.join(" ");var o=n.find((e=>e instanceof Error)),a=Tv.buildFromUnknown(o||t,{mechanism:{handled:!1},syntheticException:new Error("PostHog syntheticException"),skipFirstLines:2});return e(a),null==r?void 0:r(...n)},t.error.__POSTHOG_INSTRUMENTED__=!0,()=>{var e;null==(e=t.error)||delete e.__POSTHOG_INSTRUMENTED__,t.error=r}}};ns.__PosthogExtensions__=ns.__PosthogExtensions__||{},ns.__PosthogExtensions__.errorWrappingFunctions=Rv,ns.posthogErrorWrappingFunctions=Rv;var Mv=(e,t,r,i)=>{var n;try{n=new URL(i.url).hostname}catch(e){return}if(!jr(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!==wo&&i.headers.set("X-POSTHOG-DISTINCT-ID",t)}};ns.__PosthogExtensions__=ns.__PosthogExtensions__||{};var Lv={_patchFetch:(e,r,i)=>Es(Gn,"fetch",(n=>function(){var s=t((function*(t,s){var o=new Request(t,s);return Mv(e,r,i,o),n(o)}));return function(e,t){return s.apply(this,arguments)}}())),_patchXHR:(e,t,r)=>Es(Gn.XMLHttpRequest.prototype,"open",(i=>function(n,s,o,a,l){void 0===o&&(o=!0);var u=new Request(s);return Mv(e,t,r,u),i.call(this,n,u.url,o,a,l)}))};ns.__PosthogExtensions__.tracingHeadersPatchFns=Lv,ns.postHogTracingHeadersPatchFns=Lv;var Pv=-1,Av=e=>{addEventListener("pageshow",(t=>{t.persisted&&(Pv=t.timeStamp,e(t))}),!0)},Fv=(e,t,r,i)=>{var n,s;return o=>{t.value>=0&&(o||i)&&((s=t.value-(null!=n?n:0))||void 0===n)&&(n=t.value,t.delta=s,t.rating=((e,t)=>e>t[1]?"poor":e>t[0]?"needs-improvement":"good")(t.value,r),e(t))}},Nv=e=>{requestAnimationFrame((()=>requestAnimationFrame((()=>e()))))},Ov=()=>{var e=performance.getEntriesByType("navigation")[0];if(e&&e.responseStart>0&&e.responseStart<performance.now())return e},Dv=()=>{var e,t=Ov();return null!==(e=null==t?void 0:t.activationStart)&&void 0!==e?e:0},Bv=function(e,t){void 0===t&&(t=-1);var r=Ov(),i="navigate";return 0>Pv?r&&(document.prerendering||Dv()>0?i="prerender":document.wasDiscarded?i="restore":r.type&&(i=r.type.replace(/_/g,"-"))):i="back-forward-cache",{name:e,value:t,rating:"good",delta:0,entries:[],id:"v5-"+Date.now()+"-"+(Math.floor(8999999999999*Math.random())+1e12),navigationType:i}},Hv=new WeakMap;function qv(e,t){return Hv.get(e)||Hv.set(e,new t),Hv.get(e)}class Vv{constructor(){this.t=void 0,this.i=0,this.o=[]}h(e){var t;if(!e.hadRecentInput){var r=this.o[0],i=this.o.at(-1);this.i&&r&&i&&1e3>e.startTime-i.startTime&&5e3>e.startTime-r.startTime?(this.i+=e.value,this.o.push(e)):(this.i=e.value,this.o=[e]),null==(t=this.t)||t.call(this,e)}}}var Uv,$v=function(e,t,i){void 0===i&&(i={});try{if(PerformanceObserver.supportedEntryTypes.includes(e)){var n=new PerformanceObserver((e=>{Promise.resolve().then((()=>{t(e.getEntries())}))}));return n.observe(r({type:e,buffered:!0},i)),n}}catch(e){}},jv=e=>{var t=!1;return()=>{t||(e(),t=!0)}},zv=-1,Wv=new Set,Zv=()=>"hidden"!==document.visibilityState||document.prerendering?1/0:0,Gv=e=>{if("hidden"===document.visibilityState){if("visibilitychange"===e.type)for(var t of Wv)t();isFinite(zv)||(zv="visibilitychange"===e.type?e.timeStamp:0,removeEventListener("prerenderingchange",Gv,!0))}},Yv=()=>{if(0>zv){var e,t=Dv(),r=document.prerendering||null==(e=globalThis.performance.getEntriesByType("visibility-state").filter((e=>"hidden"===e.name&&e.startTime>t))[0])?void 0:e.startTime;zv=null!=r?r:Zv(),addEventListener("visibilitychange",Gv,!0),addEventListener("prerenderingchange",Gv,!0),Av((()=>{setTimeout((()=>{zv=Zv()}))}))}return{get firstHiddenTime(){return zv},onHidden(e){Wv.add(e)}}},Xv=e=>{document.prerendering?addEventListener("prerenderingchange",(()=>e()),!0):e()},Kv=[1800,3e3],Jv=function(e,t){void 0===t&&(t={}),Xv((()=>{var r,i=Yv(),n=Bv("FCP"),s=$v("paint",(e=>{for(var t of e)"first-contentful-paint"===t.name&&(s.disconnect(),i.firstHiddenTime>t.startTime&&(n.value=Math.max(t.startTime-Dv(),0),n.entries.push(t),r(!0)))}));s&&(r=Fv(e,n,Kv,t.reportAllChanges),Av((i=>{n=Bv("FCP"),r=Fv(e,n,Kv,t.reportAllChanges),Nv((()=>{n.value=performance.now()-i.timeStamp,r(!0)}))})))}))},Qv=[.1,.25],eg=0,tg=1/0,rg=0,ig=e=>{for(var t of e)t.interactionId&&(tg=Math.min(tg,t.interactionId),rg=Math.max(rg,t.interactionId),eg=rg?(rg-tg)/7+1:0)},ng=()=>{var e;return Uv?eg:null!==(e=performance.interactionCount)&&void 0!==e?e:0},sg=0;class og{constructor(){this.u=[],this.l=new Map,this.m=void 0,this.p=void 0}v(){sg=ng(),this.u.length=0,this.l.clear()}L(){var e=Math.min(this.u.length-1,Math.floor((ng()-sg)/50));return this.u[e]}h(e){var t;if(null!=(t=this.m)&&t.call(this,e),e.interactionId||"first-input"===e.entryType){var r=this.u.at(-1),i=this.l.get(e.interactionId);if(i||10>this.u.length||e.duration>r.P){var n;if(i?e.duration>i.P?(i.entries=[e],i.P=e.duration):e.duration===i.P&&e.startTime===i.entries[0].startTime&&i.entries.push(e):(this.l.set((i={id:e.interactionId,entries:[e],P:e.duration}).id,i),this.u.push(i)),this.u.sort(((e,t)=>t.P-e.P)),this.u.length>10){var s=this.u.splice(10);for(var o of s)this.l.delete(o.id)}null==(n=this.p)||n.call(this,i)}}}}var ag=e=>{var t=globalThis.requestIdleCallback||setTimeout;"hidden"===document.visibilityState?e():(e=jv(e),addEventListener("visibilitychange",e,{once:!0,capture:!0}),t((()=>{e(),removeEventListener("visibilitychange",e,{capture:!0})})))},lg=[200,500];class ug{constructor(){this.m=void 0}h(e){var t;null==(t=this.m)||t.call(this,e)}}var cg=[2500,4e3],dg={onLCP(e,t){void 0===t&&(t={}),Xv((()=>{var r,i=Yv(),n=Bv("LCP"),s=qv(t,ug),o=e=>{for(var o of(t.reportAllChanges||(e=e.slice(-1)),e))s.h(o),i.firstHiddenTime>o.startTime&&(n.value=Math.max(o.startTime-Dv(),0),n.entries=[o],r())},a=$v("largest-contentful-paint",o);if(a){r=Fv(e,n,cg,t.reportAllChanges);var l=jv((()=>{o(a.takeRecords()),a.disconnect(),r(!0)})),u=e=>{e.isTrusted&&(ag(l),removeEventListener(e.type,u,{capture:!0}))};for(var c of["keydown","click","visibilitychange"])addEventListener(c,u,{capture:!0});Av((i=>{n=Bv("LCP"),r=Fv(e,n,cg,t.reportAllChanges),Nv((()=>{n.value=performance.now()-i.timeStamp,r(!0)}))}))}}))},onCLS(e,t){void 0===t&&(t={});var r=Yv();Jv(jv((()=>{var i,n=Bv("CLS",0),s=qv(t,Vv),o=e=>{for(var t of e)s.h(t);s.i>n.value&&(n.value=s.i,n.entries=s.o,i())},a=$v("layout-shift",o);a&&(i=Fv(e,n,Qv,t.reportAllChanges),r.onHidden((()=>{o(a.takeRecords()),i(!0)})),Av((()=>{s.i=0,n=Bv("CLS",0),i=Fv(e,n,Qv,t.reportAllChanges),Nv((()=>i()))})),setTimeout(i))})))},onFCP:Jv,onINP(e,t){if(void 0===t&&(t={}),globalThis.PerformanceEventTiming&&"interactionId"in PerformanceEventTiming.prototype){var r=Yv();Xv((()=>{var i;"interactionCount"in performance||Uv||(Uv=$v("event",ig,{type:"event",buffered:!0,durationThreshold:0}));var n,s=Bv("INP"),o=qv(t,og),a=e=>{ag((()=>{for(var t of e)o.h(t);var r=o.L();r&&r.P!==s.value&&(s.value=r.P,s.entries=r.entries,n())}))},l=$v("event",a,{durationThreshold:null!==(i=t.durationThreshold)&&void 0!==i?i:40});n=Fv(e,s,lg,t.reportAllChanges),l&&(l.observe({type:"first-input",buffered:!0}),r.onHidden((()=>{a(l.takeRecords()),n(!0)})),Av((()=>{o.v(),s=Bv("INP"),n=Fv(e,s,lg,t.reportAllChanges)})))}))}}};ns.__PosthogExtensions__=ns.__PosthogExtensions__||{},ns.__PosthogExtensions__.postHogWebVitalsCallbacks=dg,ns.postHogWebVitalsCallbacks=dg,ns.__PosthogExtensions__.loadWebVitalsCallbacks=()=>dg;class hg{constructor(e){this.disabled=!1===e;var t=Wr(e)?e:{};this.thresholdPx=t.threshold_px||30,this.timeoutMs=t.timeout_ms||1e3,this.clickCount=t.click_count||3,this.clicks=[]}isRageClick(e,t,r){if(this.disabled)return!1;var i=this.clicks[this.clicks.length-1];if(i&&Math.abs(e-i.x)+Math.abs(t-i.y)<this.thresholdPx&&this.timeoutMs>r-i.timestamp){if(this.clicks.push({x:e,y:t,timestamp:r}),this.clicks.length===this.clickCount)return!0}else this.clicks=[{x:e,y:t,timestamp:r}];return!1}}var pg="$copy_autocapture",vg=cs("[AutoCapture]");function gg(e,t){return t.length>e?t.slice(0,e)+"...":t}function _g(e){if(e.previousElementSibling)return e.previousElementSibling;var t=e;do{t=t.previousSibling}while(t&&!Bo(t));return t}function fg(e,t){for(var i,n,{e:s,maskAllElementAttributes:o,maskAllText:a,elementAttributeIgnoreList:l,elementsChainAsString:u}=t,c=[e],d=e;d.parentNode&&!Ho(d,"body");)Vo(d.parentNode)?(c.push(d.parentNode.host),d=d.parentNode.host):(c.push(d.parentNode),d=d.parentNode);var h,p,v=[],g={},_=!1,f=!1;if(hs(c,(e=>{var t=ta(e);"a"===e.tagName.toLowerCase()&&(_=e.getAttribute("href"),_=t&&_&&ua(_)&&_),Br(jo(e),"ph-no-capture")&&(f=!0),v.push(function(e,t,r,i){var n=e.tagName.toLowerCase(),s={tag_name:n};Go.indexOf(n)>-1&&!r&&(s.$el_text="a"===n.toLowerCase()||"button"===n.toLowerCase()?gg(1024,ca(e)):gg(1024,Wo(e)));var o=jo(e);o.length>0&&(s.classes=o.filter((function(e){return""!==e}))),hs(e.attributes,(function(r){var n;if((!ra(e)||-1!==["name","id","class","aria-label"].indexOf(r.name))&&(null==i||!i.includes(r.name))&&!t&&ua(r.value)&&(!Yr(n=r.name)||"_ngcontent"!==n.substring(0,10)&&"_nghost"!==n.substring(0,7))){var o=r.value;"class"===r.name&&(o=Uo(o).join(" ")),s["attr__"+r.name]=gg(1024,o)}}));for(var a=1,l=1,u=e;u=_g(u);)a++,u.tagName===e.tagName&&l++;return s.nth_child=a,s.nth_of_type=l,s}(e,o,a,l));var r=function(e){if(!ta(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&&ua(i)&&(t[r]=i)}})),t}(e);ps(g,r)})),f)return{props:{},explicitNoCapture:f};if(a||(v[0].$el_text="a"===e.tagName.toLowerCase()||"button"===e.tagName.toLowerCase()?ca(e):Wo(e)),_){var m,y;v[0].attr__href=_;var b=null==(m=Ss(_))?void 0:m.host,w=null==Gn||null==(y=Gn.location)?void 0:y.host;b&&w&&b!==w&&(h=_)}return{props:ps({$event_type:s.type,$ce_version:1},u?{}:{$elements:v},{$elements_chain:(p=v,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 vs(o).sort(((e,t)=>{var[r]=e,[i]=t;return r.localeCompare(i)})).forEach((e=>{var[t,r]=e;return a[ha(t.toString())]=ha(r.toString())})),(n+=":")+vs(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:pa(e),attr_id:e.attr__id,nth_child:e.nth_child,nth_of_type:e.nth_of_type,attributes:{}};return vs(e).filter((e=>{var[t]=e;return 0===t.indexOf("attr__")})).forEach((e=>{var[t,r]=e;return i.attributes[t]=r})),i}))}(p)))},null!=(i=v[0])&&i.$el_text?{$el_text:null==(n=v[0])?void 0:n.$el_text}:{},h&&"click"===s.type?{$external_click_url:h}:{},g)}}var mg={};function yg(e){return function(e,t){var r=mg[e];if(r)return r;var i,n=t[e];if(zr(i=n)&&-1!==i.toString().indexOf("[native code]")&&!Gn.Zone)return mg[e]=n.bind(t);var s=t.document;if(s&&zr(s.createElement))try{var o=s.createElement("iframe");o.hidden=!0,s.head.appendChild(o);var a=o.contentWindow;a&&a[e]&&(n=a[e]),s.head.removeChild(o)}catch(t){us.warn("Could not create sandbox iframe for "+e+" check, bailing to assignableWindow."+e+": ",t)}return n&&zr(n)?mg[e]=n.bind(t):n}("MutationObserver",e)}function bg(e,t){return Qr(e)&&e>=t}class wg{_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=Zo(e);return t?{node:t,originalEvent:e,timestamp:Date.now()}:null}(e);Kr(t)||this._ignoreClick(t)||this._clicks.push(t),this._clicks.length&&Gr(this._checkClickTimer)&&(this._checkClickTimer=ns.setTimeout((()=>{this._checkClicks()}),1e3))},this._onScroll=()=>{var e=Date.now();e%50==0&&this._clicks.forEach((t=>{Gr(t.scrollDelayMs)&&(t.scrollDelayMs=e-t.timestamp)}))},this._onSelectionChange=()=>{this._lastSelectionChanged=Date.now()},this._onVisibilityChange=()=>{"visible"===(null==Kn?void 0:Kn.visibilityState)&&(this._lastVisibilityChange=Date.now())},this.instance=e,this._config=this._asRequiredConfig(t),this._onCapture=this._config.__onCapture}start(e){this._startClickObserver(),this._startScrollObserver(),this._startSelectionChangedObserver(),this._startVisibilityChangeObserver(),this._startMutationObserver(e)}_startMutationObserver(e){if(!this._mutationObserver){var t=yg(ns);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,ns.removeEventListener("click",this._onClick),ns.removeEventListener("scroll",this._onScroll,{capture:!0}),ns.removeEventListener("selectionchange",this._onSelectionChange),null==Kn||Kn.removeEventListener("visibilitychange",this._onVisibilityChange)}_onMutation(e){this._lastMutation=Date.now()}_startClickObserver(){bs(ns,"click",this._onClick)}_startScrollObserver(){bs(ns,"scroll",this._onScroll,{capture:!0})}_startSelectionChangedObserver(){bs(ns,"selectionchange",this._onSelectionChange)}_startVisibilityChangeObserver(){bs(Kn,"visibilitychange",this._onVisibilityChange)}_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(Do(e.node))return!0;var r=this._clicks.some((t=>t.node===e.node&&1e3>Math.abs(t.timestamp-e.timestamp)));return!!r||!(!Ho(e.node,"html")&&Bo(e.node)&&!Go.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&&this._lastMutation>=t.timestamp?this._lastMutation-t.timestamp:void 0,t.absoluteDelayMs=Date.now()-t.timestamp,t.selectionChangedDelayMs=this._lastSelectionChanged&&this._lastSelectionChanged>=t.timestamp?this._lastSelectionChanged-t.timestamp:void 0,t.visibilityChangedDelayMs=this._lastVisibilityChange?Math.abs(t.timestamp-this._lastVisibilityChange):void 0;var i=bg(t.scrollDelayMs,this._config.scroll_threshold_ms),n=bg(t.selectionChangedDelayMs,this._config.selection_change_threshold_ms),s=bg(t.mutationDelayMs,this._config.mutation_threshold_ms),o=bg(t.absoluteDelayMs,1.1*this._config.mutation_threshold_ms),a=Qr(t.scrollDelayMs)&&this._config.scroll_threshold_ms>t.scrollDelayMs,l=Qr(t.mutationDelayMs)&&this._config.mutation_threshold_ms>t.mutationDelayMs,u=Qr(t.selectionChangedDelayMs)&&this._config.selection_change_threshold_ms>t.selectionChangedDelayMs,c=Qr(t.visibilityChangedDelayMs)&&this._config.selection_change_threshold_ms>t.visibilityChangedDelayMs;if(!(a||l||u||c)){var d=bg(t.visibilityChangedDelayMs,this._config.selection_change_threshold_ms);i||s||o||n||d?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,$dead_click_visibility_changed_timeout:d}):this._config.mutation_threshold_ms>t.absoluteDelayMs&&this._clicks.push(t)}}this._clicks.length&&Gr(this._checkClickTimer)&&(this._checkClickTimer=ns.setTimeout((()=>{this._checkClicks()}),1e3))}}_captureDeadClick(e,t){this.instance.capture("$dead_click",r({},t,fg(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,$dead_click_visibility_changed_delay_ms:e.visibilityChangedDelayMs}),{timestamp:new Date(e.timestamp)})}}ns.__PosthogExtensions__=ns.__PosthogExtensions__||{},ns.__PosthogExtensions__.initDeadClicksAutocapture=(e,t)=>new wg(e,t);class Sg{constructor(e){this._instance=e}get _config(){return this._instance.config}get consent(){return this._getDnt()?0:this._storedConsent}isOptedOut(){return this._config.cookieless_mode===Eo||this.isRejected()||-1===this.consent&&this._config.cookieless_mode===ko}isOptedIn(){return!this.isOptedOut()}isExplicitlyOptedOut(){return 0===this.consent}isRejected(){return 0===this.consent||-1===this.consent&&this._config.opt_out_capturing_by_default}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 ai(e)?1:Br(li,e)?0:-1}get _storage(){var e=this._config.opt_out_capturing_persistence_type,t="localStorage"===e?mc:_c;if(!this._persistentStore||this._persistentStore!==t){this._persistentStore=t;var r="localStorage"===e?_c:mc;r._get(this._storageKey)&&(this._persistentStore._get(this._storageKey)||this.optInOut(ai(r._get(this._storageKey))),r._remove(this._storageKey,this._config.cross_subdomain_cookie))}return this._persistentStore}_getDnt(){return!!this._config.respect_dnt&&[null==Xn?void 0:Xn.doNotTrack,null==Xn?void 0:Xn.msDoNotTrack,ns.doNotTrack].some((e=>ai(e)))}}var Cg=cs("[Dead Clicks]"),Ig=()=>!0,xg=e=>{var t,r=!(null==(t=e.instance.persistence)||!t.get_property(Hs)),i=e.instance.config.capture_dead_clicks;return ti(i)?i:!!Wr(i)||r};class kg{get lazyLoadedDeadClicksAutocapture(){return this._lazyLoadedDeadClicksAutocapture}constructor(e,t,r){this.instance=e,this.isEnabled=t,this.onCapture=r,this.startIfEnabledOrStop()}onRemoteConfig(e){"captureDeadClicks"in e&&(this.instance.persistence&&this.instance.persistence.register({[Hs]:e.captureDeadClicks}),this.startIfEnabledOrStop())}startIfEnabledOrStop(){this.isEnabled(this)?this._loadScript((()=>{this._start()})):this.stop()}_loadScript(e){var t,r;null!=(t=ns.__PosthogExtensions__)&&t.initDeadClicksAutocapture&&e(),null==(r=ns.__PosthogExtensions__)||null==r.loadExternalDependency||r.loadExternalDependency(this.instance,"dead-clicks-autocapture",(t=>{t?Cg.error("failed to load script",t):e()}))}_start(){var e;if(Kn){if(!this._lazyLoadedDeadClicksAutocapture&&null!=(e=ns.__PosthogExtensions__)&&e.initDeadClicksAutocapture){var t=Wr(this.instance.config.capture_dead_clicks)?this.instance.config.capture_dead_clicks:{};t.__onCapture=this.onCapture,this._lazyLoadedDeadClicksAutocapture=ns.__PosthogExtensions__.initDeadClicksAutocapture(this.instance,t),this._lazyLoadedDeadClicksAutocapture.start(Kn),Cg.info("starting...")}}else Cg.error("`document` not found. Cannot start.")}stop(){this._lazyLoadedDeadClicksAutocapture&&(this._lazyLoadedDeadClicksAutocapture.stop(),this._lazyLoadedDeadClicksAutocapture=void 0,Cg.info("stopping..."))}}var Eg=cs("[SegmentIntegration]");var Tg="posthog-js";function Rg(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,g=(null==(l=t.exception)?void 0:l.values)||[],_=g.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}))),f={$exception_message:(null==(u=g[0])?void 0:u.value)||t.message,$exception_type:null==(c=g[0])?void 0:c.type,$exception_level:t.level,$exception_list:_,$sentry_event_id:t.event_id,$sentry_exception:t.exception,$sentry_exception_message:(null==(d=g[0])?void 0:d.value)||t.message,$sentry_exception_type:null==(h=g[0])?void 0:h.type,$sentry_tags:t.tags};return i&&n&&(f.$sentry_url=(s||"https://sentry.io/organizations/")+i+"/issues/?project="+n+"&query="+t.event_id),a&&(null==(v=e.exceptions)||v.sendExceptionEvent(f)),t}}class Mg{constructor(e,t,r,i,n,s){this.name=Tg,this.setupOnce=function(o){o(Rg(e,{organization:t,projectId:r,prefix:i,severityAllowList:n,sendExceptionsToPostHog:null==s||s}))}}}class Lg{constructor(e){this._onSessionIdChange=(e,t,r)=>{r&&(r.noSessionId||r.activityTimeout||r.sessionPastMaximumLength)&&(us.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==Gn?void 0:Gn.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(!(Gr(s)||Gr(o)||Gr(a)||Gr(l)||Gr(u)||Gr(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?ui(o/s,0,1,us):1,h=s>1?ui(a/s,0,1,us):1,p=l>1?ui(u/l,0,1,us):1,v=l>1?ui(c/l,0,1,us):1;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 Pg={[Rs]:{exposure:"hidden"},[Ls]:{exposure:"hidden"},__cmpns:{exposure:"hidden"},[Ps]:{exposure:"hidden"},[As]:{exposure:"event"},[Fs]:{exposure:"hidden"},[Ns]:{exposure:"event"},[Os]:{exposure:"hidden"},[Ds]:{exposure:"event"},[Bs]:{exposure:"event"},[Hs]:{exposure:"event"},[qs]:{exposure:"hidden"},[Vs]:{exposure:"event"},[Us]:{exposure:"hidden"},$session_recording_enabled_server_side:{exposure:"hidden"},[Zs]:{exposure:"hidden"},[Gs]:{exposure:"event"},$session_past_minimum_duration:{exposure:"event"},$session_recording_url_trigger_activated_session:{exposure:"event"},$session_recording_event_trigger_activated_session:{exposure:"event"},$debug_first_full_snapshot_timestamp:{exposure:"event"},[Ys]:{exposure:"derived",shouldSkipFromEventProperties:(e,t)=>t(),transformToEventProperties(e){if(!Wr(e))return{};for(var t={},r=Object.keys(e),i=0;r.length>i;i++)t["$feature/"+r[i]]=e[r[i]];return t}},[Xs]:{exposure:"event"},[Ks]:{exposure:"hidden"},[Js]:{exposure:"hidden"},[Qs]:{exposure:"event"},[eo]:{exposure:"event"},[to]:{exposure:"event"},[ro]:{exposure:"hidden"},[io]:{exposure:"hidden"},[no]:{exposure:"hidden"},[so]:{exposure:"hidden"},[oo]:{exposure:"event"},[ao]:{exposure:"hidden"},$product_tours_activated:{exposure:"hidden"},$conversations_widget_session_id:{exposure:"event"},$conversations_ticket_id:{exposure:"event"},$conversations_widget_state:{exposure:"event"},$conversations_user_traits:{exposure:"event"},[lo]:{exposure:"hidden"},[uo]:{exposure:"hidden"},[co]:{exposure:"hidden"},[ho]:{exposure:"hidden"},[po]:{exposure:"hidden"},[vo]:{exposure:"hidden"},[go]:{exposure:"hidden"},[_o]:{exposure:"hidden"},[fo]:{exposure:"hidden"},[mo]:{exposure:"hidden"},[yo]:{exposure:"hidden"},[$s]:{exposure:"event"},[js]:{exposure:"event"},[zs]:{exposure:"event"},[Ws]:{exposure:"event"},[So]:{exposure:"event"},[Co]:{exposure:"event"},[Io]:{exposure:"event"},$sdk_debug_replay_event_trigger_status:{exposure:"event"},$sdk_debug_replay_linked_flag_trigger_status:{exposure:"event"},$sdk_debug_replay_matched_recording_trigger_groups:{exposure:"event"},$sdk_debug_replay_remote_trigger_matching_config:{exposure:"event"},$sdk_debug_replay_trigger_groups_count:{exposure:"event"},$sdk_debug_replay_url_trigger_status:{exposure:"event"},$session_recording_start_reason:{exposure:"event"}},Ag=[["$posthog_sr_group_event_trigger_",{exposure:"hidden"}],["$posthog_sr_group_url_trigger_",{exposure:"hidden"}],["$posthog_sr_group_sampling_",{exposure:"hidden"}]],Fg="https?://(.*)",Ng=["gclid","gclsrc","dclid","gbraid","wbraid","fbclid","msclkid","twclid","li_fat_id","igshid","ttclid","rdt_cid","epik","qclid","sccid","irclid","_kx"],Og=["utm_source","utm_medium","utm_campaign","utm_content","utm_term","gad_source","mc_cid",...Ng],Dg="<masked>",Bg=["li_fat_id"];function Hg(e,t,r){if(!Kn)return{};var i,n=t?[...Ng,...r||[]]:[],s=qg(xs(Kn.URL,n,Dg),e),o=(i={},hs(Bg,(function(e){var t=_c._get(e);i[e]=t||null})),i);return ps(o,s)}function qg(e,t){var r=Og.concat(t||[]),i={};return hs(r,(function(t){var r=Is(e,t);i[t]=r||null})),i}function Vg(e){var t=function(e){return e?0===e.search(Fg+"google.([^/?]*)")?"google":0===e.search(Fg+"bing.com")?"bing":0===e.search(Fg+"yahoo.com")?"yahoo":0===e.search(Fg+"duckduckgo.com")?"duckduckgo":null:null}(e),r="yahoo"!=t?"q":"p",i={};if(!Kr(t)){i.$search_engine=t;var n=Kn?Is(Kn.referrer,r):"";n.length&&(i.ph_keyword=n)}return i}function Ug(){return navigator.language||navigator.userLanguage}var $g="$direct";function jg(){return(null==Kn?void 0:Kn.referrer)||$g}function zg(e,t){var r=e?[...Ng,...t||[]]:[],i=null==Jn?void 0:Jn.href.substring(0,1e3);return{r:jg().substring(0,1e3),u:i?xs(i,r,Dg):void 0}}function Wg(e){var t,{r:r,u:i}=e,n={$referrer:r,$referring_domain:null==r?void 0:r==$g?$g:null==(t=Ss(r))?void 0:t.host};if(i){n.$current_url=i;var s=Ss(i);n.$host=null==s?void 0:s.host,n.$pathname=null==s?void 0:s.pathname;var o=qg(i);ps(n,o)}if(r){var a=Vg(r);ps(n,a)}return n}function Zg(){try{return Intl.DateTimeFormat().resolvedOptions().timeZone}catch(e){return}}function Gg(){try{return(new Date).getTimezoneOffset()}catch(e){return}}var Yg=["cookie","localstorage","localstorage+cookie","sessionstorage","memory"];class Xg{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&&us.info("Persistence loaded",e.persistence,r({},this.props)),this.update_config(e,e,t),this.save()}isDisabled(){return!!this._disabled}_buildStorage(e){-1===Yg.indexOf(e.persistence.toLowerCase())&&(us.critical("Unknown persistence type "+e.persistence+"; falling back to localStorage+cookie"),e.persistence="localStorage+cookie");var t=function(e){void 0===e&&(e=[]);var t=[...yc,...e];return r({},mc,{_parse(e){try{var t={};try{t=_c._parse(e)||{}}catch(e){}var r=ps(t,JSON.parse(mc._get(e)||"{}"));return mc._set(e,r),r}catch(e){}return null},_set(e,r,i,n,s,o){try{mc._set(e,r,void 0,void 0,o);var a={};t.forEach((e=>{r[e]&&(a[e]=r[e])})),Object.keys(a).length&&_c._set(e,a,i,n,s,o)}catch(e){mc._error(e)}},_remove(e,t){try{null==Gn||Gn.localStorage.removeItem(e),_c._remove(e,t)}catch(e){mc._error(e)}}})}(e.cookie_persisted_properties||[]),i=e.persistence.toLowerCase();return"localstorage"===i&&mc._is_supported()?mc:"localstorage+cookie"===i&&t._is_supported()?t:"sessionstorage"===i&&Cc._is_supported()?Cc:"memory"===i?wc:"cookie"===i?_c:t._is_supported()?t:_c}_isFeatureFlagCacheStale(e){var t=null!=e?e:this._config.feature_flag_cache_ttl_ms;if(!t||0>=t)return!1;var r=this.props[ho];return!r||"number"!=typeof r||Date.now()-r>t}properties(){var e={};return hs(this.props,((t,r)=>{var i=(e=>{var t=Pg[e];if(t)return t;for(var[r,i]of Ag)if(0===e.indexOf(r))return i})(r);if("derived"===(null==i?void 0:i.exposure)){if(null!=i.shouldSkipFromEventProperties&&i.shouldSkipFromEventProperties(t,r===Ys?()=>this._isFeatureFlagCacheStale():()=>!1))return;i.transformToEventProperties&&ps(e,i.transformToEventProperties(t))}else i&&"event"!==i.exposure||(e[r]=t)})),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(Wr(e)){Gr(t)&&(t="None"),this._expire_days=Gr(r)?this._default_expiry:r;var i=!1;if(hs(e,((e,r)=>{this.props.hasOwnProperty(r)&&this.props[r]!==t||(this._setProp(r,e),i=!0)})),i)return this.save(),!0}return!1}register(e,t){if(Wr(e)){this._expire_days=Gr(t)?this._default_expiry:t;var r=!1;if(hs(e,((t,i)=>{e.hasOwnProperty(i)&&this.props[i]!==t&&(this._setProp(i,t),r=!0)})),r)return this.save(),!0}return!1}unregister(e){e in this.props&&(this._deleteProp(e),this.save())}update_campaign_params(){if(!this._campaign_params_saved){var e=Hg(this._config.custom_campaign_params,this._config.mask_personal_data_properties,this._config.custom_personal_data_properties);Zr(fs(e))||this.register(e),this._campaign_params_saved=!0}}update_search_keyword(){var e;this.register((e=null==Kn?void 0:Kn.referrer)?Vg(e):{})}update_referrer_info(){var e;this.register_once({$referrer:jg(),$referring_domain:null!=Kn&&Kn.referrer&&(null==(e=Ss(Kn.referrer))?void 0:e.host)||$g},void 0)}set_initial_person_info(){this.props[_o]||this.props[fo]||this.register_once({[mo]:zg(this._config.mask_personal_data_properties,this._config.custom_personal_data_properties)},void 0)}get_initial_props(){var e={};hs([fo,_o],(t=>{var r=this.props[t];r&&hs(r,(function(t,r){e["$initial_"+qr(r)]=t}))}));var t,r,i=this.props[mo];if(i){var n=(t=Wg(i),r={},hs(t,(function(e,t){r["$initial_"+qr(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||!((e,t)=>{if(e.length!==t.length)return!1;var r=[...e].sort(),i=[...t].sort();return r.every(((e,t)=>e===i[t]))})(e.cookie_persisted_properties||[],t.cookie_persisted_properties||[])){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[Ps]||{};r[e]=t,this._setProp(Ps,r),this.save()}remove_event_timer(e){var t=this.props[Ps]||{},r=t[e];return Gr(r)||(delete t[e],this._setProp(Ps,t),this.save()),r}get_property(e){return this.props[e]}set_property(e,t){this._setProp(e,t),this.save()}_setProp(e,t){this.props[e]=t}_deleteProp(e){delete this.props[e]}}var Kg=cs("[RateLimiter]");class Jg{constructor(e){this.serverLimits={},this.lastEventRateLimited=!1,this.checkForLimiting=e=>{var t=e.text;if(t&&t.length)try{(JSON.parse(t).quota_limited||[]).forEach((e=>{Kg.info((e||"events")+" is quota limited."),this.serverLimits[e]=(new Date).getTime()+6e4}))}catch(e){return void Kg.warn('could not rate limit - continuing. Error: "'+(null==e?void 0:e.message)+'"',{text:t})}},this.instance=e,this.lastEventRateLimited=this.clientRateLimitContext(!0).isRateLimited}get captureEventsPerSecond(){var e;return(null==(e=this.instance.config.rate_limiting)?void 0:e.events_per_second)||10}get captureEventsBurstLimit(){var e;return Math.max((null==(e=this.instance.config.rate_limiting)?void 0:e.events_burst_limit)||10*this.captureEventsPerSecond,this.captureEventsPerSecond)}clientRateLimitContext(e){var t,r,i;void 0===e&&(e=!1);var{captureEventsBurstLimit:n,captureEventsPerSecond:s}=this,o=(new Date).getTime(),a=null!==(t=null==(r=this.instance.persistence)?void 0:r.get_property(go))&&void 0!==t?t:{tokens:n,last:o};a.tokens+=(o-a.last)/1e3*s,a.last=o,a.tokens>n&&(a.tokens=n);var l=1>a.tokens;return l||e||(a.tokens=Math.max(0,a.tokens-1)),!l||this.lastEventRateLimited||e||this.instance.capture("$$client_ingestion_warning",{$$client_ingestion_warning_message:"posthog-js client rate limited. Config is set to "+s+" events per second and "+n+" events burst limit."},{skip_client_rate_limiting:!0}),this.lastEventRateLimited=l,null==(i=this.instance.persistence)||i.set_property(go,a),{isRateLimited:l,remainingTokens:a.tokens}}isServerRateLimited(e){var t=this.serverLimits[e||"events"]||!1;return!1!==t&&(new Date).getTime()<t}}var Qg=cs("[RemoteConfig]");class e_{constructor(e){this._instance=e}get remoteConfig(){var e;return null==(e=ns._POSTHOG_REMOTE_CONFIG)||null==(e=e[this._instance.config.token])?void 0:e.config}_loadRemoteConfigJs(e){var t,r;null!=(t=ns.__PosthogExtensions__)&&t.loadExternalDependency?null==(r=ns.__PosthogExtensions__)||null==r.loadExternalDependency||r.loadExternalDependency(this._instance,"remote-config",(()=>e(this.remoteConfig))):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 Qg.info("Using preloaded remote config",this.remoteConfig),this._onRemoteConfig(this.remoteConfig),void this._startRefreshInterval();if(this._instance._shouldDisableFlags())return void Qg.warn("Remote config is disabled. Falling back to local config.");this._loadRemoteConfigJs((e=>{if(!e)return Qg.info("No config found after loading remote JS config. Falling back to JSON."),void this._loadRemoteConfigJSON((e=>{this._onRemoteConfig(e),this._startRefreshInterval()}));this._onRemoteConfig(e),this._startRefreshInterval()}))}catch(e){Qg.error("Error loading remote config",e)}}stop(){this._refreshInterval&&(clearInterval(this._refreshInterval),this._refreshInterval=void 0)}refresh(){this._instance._shouldDisableFlags()||"hidden"===(null==Kn?void 0:Kn.visibilityState)||this._instance.reloadFeatureFlags()}_startRefreshInterval(){var e;if(!this._refreshInterval){var t=null!==(e=this._instance.config.remote_config_refresh_interval_ms)&&void 0!==e?e:3e5;0!==t&&(this._refreshInterval=setInterval((()=>{this.refresh()}),t))}}_onRemoteConfig(e){var t;e||Qg.error("Failed to fetch remote config from PostHog."),this._instance._onRemoteConfig(null!=e?e:{}),!1!==(null==e?void 0:e.hasFeatureFlags)&&(this._instance.config.advanced_disable_feature_flags_on_first_load||null==(t=this._instance.featureFlags)||t.ensureFlagsLoaded())}}var t_=3e3;class r_{constructor(e,t){this._isPaused=!0,this._queue=[],this._flushTimeoutMs=ui((null==t?void 0:t.flush_interval_ms)||t_,250,5e3,us.createLogger("flush interval"),t_),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&&jr(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;Gr(e[s])&&(e[s]=r({},n,{data:[]})),null==(i=e[s].data)||i.push(n.data)})),this._queue=[],e}}var i_=["retriesPerformedSoFar"];class n_{constructor(e){this._isPolling=!1,this._pollIntervalMs=3e3,this._queue=[],this._instance=e,this._queue=[],this._areWeOnline=!0,!Gr(Gn)&&"onLine"in Gn.navigator&&(this._areWeOnline=Gn.navigator.onLine,this._onlineListener=()=>{this._areWeOnline=!0,this._flush()},this._offlineListener=()=>{this._areWeOnline=!1},bs(Gn,"online",this._onlineListener),bs(Gn,"offline",this._offlineListener))}get length(){return this._queue.length}retriableRequest(e){var{retriesPerformedSoFar:t}=e,n=i(e,i_);ei(t)&&(n.url=ic(n.url,{retry_count:t})),this._instance._send_request(r({},n,{callback:e=>{200===e.statusCode||e.statusCode>=400&&500>e.statusCode||(null!=t?t:0)>=10?null==n.callback||n.callback(e):this._enqueue(r({retriesPerformedSoFar:t},n))}}))}_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;return Math.ceil(i+n*(i-r))}(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)"),us.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=>e>r.retryAt||(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,Gr(Gn)||(this._onlineListener&&(Gn.removeEventListener("online",this._onlineListener),this._onlineListener=void 0),this._offlineListener&&(Gn.removeEventListener("offline",this._offlineListener),this._offlineListener=void 0)),this._queue))try{this._instance._send_request(r({},e,{transport:"sendBeacon"}))}catch(e){us.error(e)}this._queue=[]}}class s_{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}get _scrollRoot(){return this._instance.config.scroll_root_selector}getContext(){return this._context}resetContext(){var e=this._context;return setTimeout(this._updateScrollData,0),e}startMeasuringScrollPosition(){bs(Gn,"scroll",this._updateScrollData,{capture:!0}),bs(Gn,"scrollend",this._updateScrollData,{capture:!0}),bs(Gn,"resize",this._updateScrollData)}scrollElement(){if(!this._scrollRoot)return null==Gn?void 0:Gn.document.documentElement;var e=jr(this._scrollRoot)?this._scrollRoot:[this._scrollRoot];for(var t of e){var r=null==Gn?void 0:Gn.document.querySelector(t);if(r)return r}}scrollY(){if(this._scrollRoot){var e=this.scrollElement();return e&&e.scrollTop||0}return Gn&&(Gn.scrollY||Gn.pageYOffset||Gn.document.documentElement.scrollTop)||0}scrollX(){if(this._scrollRoot){var e=this.scrollElement();return e&&e.scrollLeft||0}return Gn&&(Gn.scrollX||Gn.pageXOffset||Gn.document.documentElement.scrollLeft)||0}}var o_=e=>zg(null==e?void 0:e.config.mask_personal_data_properties,null==e?void 0:e.config.custom_personal_data_properties);class a_{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({[vo]:r})}},this._instance=e,this._sessionIdManager=t,this._persistence=r,this._sessionSourceParamGenerator=i||o_,this._sessionIdManager.onSessionId(this._onSessionIdCallback)}_getStored(){return this._persistence.props[vo]}getSetOnceProps(){var e,t=null==(e=this._getStored())?void 0:e.props;return t?"r"in t?Wg(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(fs(this.getSetOnceProps()),((t,r)=>{"$current_url"===r&&(r="url"),e["$session_entry_"+qr(r)]=t})),e}}class l_{constructor(){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)}}var u_=cs("[SessionId]");class c_{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 l_,this._sessionHasBeenIdleTooLong=(e,t)=>!(!ei(e)||!ei(t))&&Math.abs(e-t)>this.sessionTimeoutMs,!e.persistence)throw new Error("SessionIdManager requires a PostHogPersistence instance");if(e.config.cookieless_mode===Eo)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||mu,this._windowIdGenerator=r||mu;var n=this._config.persistence_name||this._config.token;if(this._sessionTimeoutMs=1e3*ui(this._config.session_idle_timeout_seconds||1800,60,36e3,u_.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 s=Cc._parse(this._window_id_storage_key),o=Cc._parse(this._primary_window_exists_storage_key);s&&!o?this._windowId=s:Cc._remove(this._window_id_storage_key),Cc._set(this._primary_window_exists_storage_key,!0)}if(null!=(i=this._config.bootstrap)&&i.sessionID)try{var a=(e=>{var t=this._config.bootstrap.sessionID.replace(/-/g,"");if(32!==t.length)throw new Error("Not a valid UUID");if("7"!==t[12])throw new Error("Not a UUIDv7");return parseInt(t.substring(0,12),16)})();this._setSessionId(this._config.bootstrap.sessionID,(new Date).getTime(),a)}catch(e){u_.error("Invalid sessionID in bootstrap",e)}this._listenToReloadWindow()}get sessionTimeoutMs(){return this._sessionTimeoutMs}onSessionId(e){return Gr(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&&Cc._is_supported()}_setWindowId(e){e!==this._windowId&&(this._windowId=e,this._canUseSessionStorage()&&Cc._set(this._window_id_storage_key,e))}_getWindowId(){return this._windowId?this._windowId:this._canUseSessionStorage()?Cc._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({[Zs]:[t,e,r]}))}_getSessionId(){var e=this._persistence.props[Zs];return jr(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&&Gn&&(Gn.removeEventListener(Po,this._beforeUnloadListener,{capture:!1}),this._beforeUnloadListener=void 0),this._sessionIdChangedHandlers=[]}_listenToReloadWindow(){this._beforeUnloadListener=()=>{this._canUseSessionStorage()&&Cc._remove(this._primary_window_exists_storage_key)},bs(Gn,Po,this._beforeUnloadListener,{capture:!1})}checkAndGetSessionAndWindowId(e,t){if(void 0===e&&(e=!1),void 0===t&&(t=null),this._config.cookieless_mode===Eo)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=ei(s)&&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(),u_.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=ei(i)&&e&&!a?i:r,h=ei(s)?s:(new Date).getTime();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 d_=function(e,t){if(!e)return!1;var r=e.userAgent;if(r&&Nr(r,t))return!0;try{var i=null==e?void 0:e.userAgentData;if(null!=i&&i.brands&&i.brands.some((e=>Nr(null==e?void 0:e.brand,t))))return!0}catch(e){}return!!e.webdriver},h_="custom",p_="i.posthog.com",v_=/^\/static\//;class g_{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("."+p_,".posthog.com")),"https://app.posthog.com"===t?"https://us.posthog.com":t}get region(){return this._regionCache[this.apiHost]||(this._regionCache[this.apiHost]=/https:\/\/(app|us|us-assets)(\.i)?\.posthog\.com/i.test(this.apiHost)?"us":/https:\/\/(eu|eu-assets)(\.i)?\.posthog\.com/i.test(this.apiHost)?"eu":h_),this._regionCache[this.apiHost]}_staticAssetHostOverride(e){var t=this.instance.config.__preview_external_dependency_versioned_paths;if("string"==typeof t&&v_.test(e))return t.trim().replace(/\/$/,"")||void 0}endpointFor(e,t){if(void 0===t&&(t=""),t&&(t="/"===t[0]?t:"/"+t),"ui"===e)return this.uiHost+t;if("flags"===e)return this.flagsApiHost+t;if("assets"===e){var r=this._staticAssetHostOverride(t);if(r)return""+r+t}if(this.region===h_)return this.apiHost+t;var i=p_+t;switch(e){case"assets":return"https://"+this.region+"-assets."+i;case"api":return"https://"+this.region+"."+i}}}var __=cs("[PostHog ExternalIntegrations]"),f_={intercom:"intercom-integration",crispChat:"crisp-chat-integration"};class m_{constructor(e){this._instance=e}_loadScript(e,t){var r;null==(r=ns.__PosthogExtensions__)||null==r.loadExternalDependency||r.loadExternalDependency(this._instance,e,(e=>{if(e)return __.error("failed to load script",e);t()}))}startIfEnabledOrStop(){var e=this,t=function(t){var r,n,s;!i||null!=(r=ns.__PosthogExtensions__)&&null!=(r=r.integrations)&&r[t]||e._loadScript(f_[t],(()=>{var r;null==(r=ns.__PosthogExtensions__)||null==(r=r.integrations)||null==(r=r[t])||r.start(e._instance)})),!i&&null!=(n=ns.__PosthogExtensions__)&&null!=(n=n.integrations)&&n[t]&&(null==(s=ns.__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 y_,b_={},w_=0,S_=()=>{},C_='Consent opt in/out is not valid with cookieless_mode="always" and will be ignored',I_="Surveys module not available",x_="sanitize_properties is deprecated. Use before_send instead",k_="Invalid value for property_denylist config: ",E_="posthog",T_=!ec&&-1===(null==is?void 0:is.indexOf("MSIE"))&&-1===(null==is?void 0:is.indexOf("Mozilla")),R_=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:ys(null==Kn?void 0:Kn.location),persistence:"localStorage+cookie",persistence_name:"",cookie_persisted_properties:[],loaded:S_,save_campaign_params:!0,custom_campaign_params:[],custom_blocked_useragents:[],save_referrer:!0,capture_pageleave:"if_capture_pageview",defaults:null!=e?e:"unset",__preview_deferred_init_extensions:!1,__preview_external_dependency_versioned_paths:!1,debug:Jn&&Yr(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:!1,disable_external_dependency_loading:!1,enable_recording_console_log:void 0,secure_cookie:"https:"===(null==Gn||null==(t=Gn.location)?void 0:t.protocol),ip:!1,opt_out_capturing_by_default:!1,opt_out_persistence_by_default:!1,opt_out_useragent_filter:!1,opt_out_capturing_persistence_type:"localStorage",consent_persistence_name:null,opt_out_capturing_cookie_prefix:null,opt_in_site_apps:!1,property_denylist:[],respect_dnt:!1,sanitize_properties:null,request_headers:{},request_batching:!0,properties_string_max_length:65535,mask_all_element_attributes:!1,mask_all_text:!1,mask_personal_data_properties:!1,custom_personal_data_properties:[],advanced_disable_flags:!1,advanced_disable_decide:!1,advanced_disable_feature_flags:!1,advanced_disable_feature_flags_on_first_load:!1,advanced_only_evaluate_survey_feature_flags:!1,advanced_feature_flags_dedup_per_session:!1,advanced_enable_surveys:!1,advanced_disable_toolbar_metrics:!1,feature_flag_request_timeout_ms:3e3,surveys_request_timeout_ms:1e4,on_request_error(e){us.error("Bad HTTP status: "+e.statusCode+" "+e.text)},get_device_id:e=>e,capture_performance:void 0,name:"posthog",bootstrap:{},disable_compression:!1,session_idle_timeout_seconds:1800,person_profiles:Mo,before_send:void 0,request_queue_config:{flush_interval_ms:t_},error_tracking:{},_onCapture:S_,__preview_eager_load_replay:!1},(e=>({rageclick:!e||"2025-11-30">e||{content_ignorelist:!0},capture_pageview:!e||"2025-05-24">e||"history_change",session_recording:e&&e>="2025-11-30"?{strictMinimumDuration:!0}:{},external_scripts_inject_target:e&&e>="2026-01-30"?"head":"body",internal_or_test_user_hostname:e&&e>="2026-01-30"?/^(localhost|127\.0\.0\.1)$/:void 0}))(e))},M_=[["process_person","person_profiles"],["xhr_headers","request_headers"],["cookie_name","persistence_name"],["disable_cookie","disable_persistence"],["store_google","save_campaign_params"],["verbose","debug"]],L_=e=>{var t={};for(var[r,i]of M_)Gr(e[r])||(t[i]=e[r]);var n=ps({},t,e);return jr(e.property_blacklist)&&(Gr(e.property_denylist)?n.property_denylist=e.property_blacklist:jr(e.property_denylist)?n.property_denylist=[...e.property_blacklist,...e.property_denylist]:us.error(k_+e.property_denylist)),n};class P_{constructor(){this.__forceAllowLocalhost=!1}get _forceAllowLocalhost(){return this.__forceAllowLocalhost}set _forceAllowLocalhost(e){us.error("WebPerformanceObserver is deprecated and has no impact on network capture. Use `_forceAllowLocalhostNetworkCapture` on `posthog.sessionRecording`"),this.__forceAllowLocalhost=e}}class A_{_replaceExtension(e,t){if(e){var r=this._extensions.indexOf(e);-1!==r&&this._extensions.splice(r,1)}return this._extensions.push(t),null==t.initialize||t.initialize(),t}_inCookielessMode(){return this.config.cookieless_mode===Eo||this.config.cookieless_mode===ko&&this.consent.isRejected()}get decideEndpointWasHit(){var e,t;return null!==(e=null==(t=this.featureFlags)?void 0:t.hasLoadedFlags)&&void 0!==e&&e}get flagsEndpointWasHit(){var e,t;return null!==(e=null==(t=this.featureFlags)?void 0:t.hasLoadedFlags)&&void 0!==e&&e}constructor(){var e;this.webPerformance=new P_,this._personProcessingSetOncePropertiesSent=!1,this.version=as.LIB_VERSION,this._internalEventEmitter=new l_,this._extensions=[],this._calculate_event_properties=this.calculateEventProperties.bind(this),this.config=R_(),this.SentryIntegration=Mg,this.sentryIntegration=e=>function(e,t){var r=Rg(e,t);return{name:Tg,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.scrollManager=new s_(this),this.pageViewManager=new Lg(this),this.rateLimiter=new Jg(this),this.requestRouter=new g_(this),this.consent=new Sg(this),this.externalIntegrations=new m_(this);var t=null!==(e=A_.__defaultExtensionClasses)&&void 0!==e?e:{};this.featureFlags=t.featureFlags&&new t.featureFlags(this),this.toolbar=t.toolbar&&new t.toolbar(this),this.surveys=t.surveys&&new t.surveys(this),this.conversations=t.conversations&&new t.conversations(this),this.logs=t.logs&&new t.logs(this),this.experiments=t.experiments&&new t.experiments(this),this.exceptions=t.exceptions&&new t.exceptions(this),this.people={set:(e,t,r)=>{var i=Yr(e)?{[e]:t}:e;this.setPersonProperties(i),null==r||r({})},set_once:(e,t,r)=>{var i=Yr(e)?{[e]:t}:e;this.setPersonProperties(void 0,i),null==r||r({})}},this.on("eventCaptured",(e=>us.info('send "'+(null==e?void 0:e.event)+'"',e)))}init(e,t,r){if(r&&r!==E_){var i,n=null!==(i=b_[r])&&void 0!==i?i:new A_;return n._init(e,t,r),b_[r]=n,b_[E_][r]=n,n}return this._init(e,t,r)}_init(e,t,i){var n,s;if(void 0===t&&(t={}),Gr(e)||Xr(e))return us.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:t.process_person&&(this._initialPersonProfilesConfig=t.process_person),this.set_config(ps({},R_(t.defaults),L_(t),{name:i,token:e})),this.config.on_xhr_error&&us.error("on_xhr_error is deprecated. Use on_request_error instead"),this.compression=t.disable_compression?void 0:bu;var o=this._is_persistence_disabled();this.persistence=new Xg(this.config,o),this.sessionPersistence="sessionStorage"===this.config.persistence||"memory"===this.config.persistence?this.persistence:new Xg(r({},this.config,{persistence:"sessionStorage"}),o);var a=r({},this.persistence.props),l=r({},this.sessionPersistence.props);this.register({$initialization_time:(new Date).toISOString()}),this._requestQueue=new r_((e=>this._send_retriable_request(e)),this.config.request_queue_config),this._retryQueue=new n_(this),this.__request_queue=[];var u=this._inCookielessMode();if(u||(this.sessionManager=new c_(this),this.sessionPropsManager=new a_(this,this.sessionManager,this.persistence)),this.config.__preview_deferred_init_extensions?(us.info("Deferring extension initialization to improve startup performance"),setTimeout((()=>{this._initExtensions(u)}),0)):(us.info("Initializing extensions synchronously"),this._initExtensions(u)),as.DEBUG=as.DEBUG||this.config.debug,as.DEBUG&&us.info("Starting in debug mode",{this:this,config:t,thisC:r({},this.config),p:a,s:l}),!this.config.identity_distinct_id||null!=(n=t.bootstrap)&&n.distinctID||(t.bootstrap=r({},t.bootstrap,{distinctID:this.config.identity_distinct_id,isIdentifiedID:!0})),void 0!==(null==(s=t.bootstrap)?void 0:s.distinctID)){var c=t.bootstrap.distinctID,d=this.get_distinct_id(),h=this.persistence.get_property(po);if(t.bootstrap.isIdentifiedID&&null!=d&&d!==c&&h===To)this.identify(c);else if(t.bootstrap.isIdentifiedID&&null!=d&&d!==c&&h===Ro)us.warn("Bootstrap distinctID differs from an already-identified user. The existing identity is preserved. Call reset() before reinitializing if you intend to switch users.");else{var p=this.config.get_device_id(mu()),v=t.bootstrap.isIdentifiedID?p:c;this.persistence.set_property(po,t.bootstrap.isIdentifiedID?Ro:To),this.register({distinct_id:c,$device_id:v})}}if(u)this.register_once({distinct_id:wo,$device_id:null},"");else if(!this.get_distinct_id()){var g=this.config.get_device_id(mu());this.register_once({distinct_id:g,$device_id:g},""),this.persistence.set_property(po,To)}return bs(Gn,"onpagehide"in self?"pagehide":"unload",this._handle_unload.bind(this),{passive:!1}),t.segment?function(e,t){var r=e.config.segment;if(!r)return t();!function(e,t){var r=e.config.segment;if(!r)return t();var i=r=>{var i=()=>r.anonymousId()||mu();e.config.get_device_id=i,r.id()&&(e.register({distinct_id:r.id(),$device_id:i()}),e.persistence.set_property(po,Ro)),t()},n=r.user();"then"in n&&zr(n.then)?n.then(i):i(n)}(e,(()=>{r.register((e=>{Promise&&Promise.resolve||Eg.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()||(Eg.info("No userId set, resetting PostHog"),e.reset()),t.event.userId&&t.event.userId!==e.get_distinct_id()&&(Eg.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,Ao),identify:e=>t(e,No),screen:e=>t(e,"$screen")}})(e)).then((()=>{t()}))}))}(this,(()=>this._loaded())):this._loaded(),zr(this.config._onCapture)&&this.config._onCapture!==S_&&(us.warn("onCapture is deprecated. Please use `before_send` instead"),this.on("eventCaptured",(e=>this.config._onCapture(e.event,e)))),this.config.ip&&us.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,i,n,s,o,a,l,u=performance.now(),c=r({},A_.__defaultExtensionClasses,this.config.__extensionClasses),d=[];c.featureFlags&&this._extensions.push(this.featureFlags=null!==(t=this.featureFlags)&&void 0!==t?t:new c.featureFlags(this)),c.exceptions&&this._extensions.push(this.exceptions=null!==(i=this.exceptions)&&void 0!==i?i:new c.exceptions(this)),c.historyAutocapture&&this._extensions.push(this.historyAutocapture=new c.historyAutocapture(this)),c.tracingHeaders&&this._extensions.push(new c.tracingHeaders(this)),c.siteApps&&this._extensions.push(this.siteApps=new c.siteApps(this)),c.sessionRecording&&!e&&this._extensions.push(this.sessionRecording=new c.sessionRecording(this)),this.config.disable_scroll_properties||d.push((()=>{this.scrollManager.startMeasuringScrollPosition()})),c.autocapture&&this._extensions.push(this.autocapture=new c.autocapture(this)),c.surveys&&this._extensions.push(this.surveys=null!==(n=this.surveys)&&void 0!==n?n:new c.surveys(this)),c.logs&&this._extensions.push(this.logs=null!==(s=this.logs)&&void 0!==s?s:new c.logs(this)),c.conversations&&this._extensions.push(this.conversations=null!==(o=this.conversations)&&void 0!==o?o:new c.conversations(this)),c.productTours&&this._extensions.push(this.productTours=new c.productTours(this)),c.heatmaps&&this._extensions.push(this.heatmaps=new c.heatmaps(this)),c.webVitalsAutocapture&&this._extensions.push(this.webVitalsAutocapture=new c.webVitalsAutocapture(this)),c.exceptionObserver&&this._extensions.push(this.exceptionObserver=new c.exceptionObserver(this)),c.deadClicksAutocapture&&this._extensions.push(this.deadClicksAutocapture=new c.deadClicksAutocapture(this,xg)),c.toolbar&&this._extensions.push(this.toolbar=null!==(a=this.toolbar)&&void 0!==a?a:new c.toolbar(this)),c.experiments&&this._extensions.push(this.experiments=null!==(l=this.experiments)&&void 0!==l?l:new c.experiments(this)),this._extensions.forEach((e=>{e.initialize&&d.push((()=>{null==e.initialize||e.initialize()}))})),d.push((()=>{if(this._pendingRemoteConfig){var e=this._pendingRemoteConfig;this._pendingRemoteConfig=void 0,this._onRemoteConfig(e)}})),this._processInitTaskQueue(d,u)}_processInitTaskQueue(e,t){for(;e.length>0;){if(this.config.__preview_deferred_init_extensions&&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){us.error("Error initializing extension:",e)}}var i=Math.round(performance.now()-t);this.register_for_session({[So]:this.config.__preview_deferred_init_extensions?"deferred":"synchronous",[Co]:i}),this.config.__preview_deferred_init_extensions&&us.info("PostHog extensions initialized ("+i+"ms)")}_onRemoteConfig(e){var t;if(!Kn||!Kn.body)return us.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._lastRemoteConfig=e,this.compression=void 0,e.supportedCompression&&!this.config.disable_compression&&(this.compression=Br(e.supportedCompression,bu)?bu:Br(e.supportedCompression,wu)?wu:void 0),null!=(t=e.analytics)&&t.endpoint&&(this.analyticsDefaultEndpoint=e.analytics.endpoint),this.set_config({person_profiles:this._initialPersonProfilesConfig?this._initialPersonProfilesConfig:Mo}),this._extensions.forEach((t=>null==t.onRemoteConfig?void 0:t.onRemoteConfig(e)))}_loaded(){try{this.config.loaded(this)}catch(e){us.critical("`loaded` function failed",e)}if(this._start_queue_if_opted_in(),this.config.internal_or_test_user_hostname&&null!=Jn&&Jn.hostname){var e=Jn.hostname,t=this.config.internal_or_test_user_hostname;("string"==typeof t?e===t:t.test(e))&&this.setInternalOrTestUser()}this.config.capture_pageview&&setTimeout((()=>{(this.consent.isOptedIn()||this._inCookielessMode())&&this._captureInitialPageview()}),1),this._remoteConfigLoader=new e_(this),this._remoteConfigLoader.load()}_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,r,i;null==(e=this.surveys)||e.handlePageUnload(),this.config.request_batching?(this._shouldCapturePageleave()&&this.capture(Fo),null==(t=this.logs)||t.flushLogs("sendBeacon"),null==(r=this._requestQueue)||r.unload(),null==(i=this._retryQueue)||i.unload()):this._shouldCapturePageleave()&&this.capture(Fo,null,{transport:"sendBeacon"})}_send_request(e){this.__loaded&&(T_?this.__request_queue.push(e):this.rateLimiter.isServerRateLimited(e.batchKey)||(e.transport=e.transport||this.config.api_transport,e.url=ic(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=ac(s.url,s.compression);var o=null!==(t=s.transport)&&void 0!==t?t:"fetch",a=lc.filter((e=>!s.disableTransport||!e.transport||!s.disableTransport.includes(e.transport))),l=null!==(i=null==(n=function(e,t){for(var r=0;e.length>r;r++)if(t(e[r]))return e[r]}(a,(e=>e.transport===o)))?void 0:n.method)&&void 0!==i?i:a[0].method;if(!l)throw new Error("No available transport method");"sendBeacon"!==o&&s.data&&s.compression===bu&&rs&&!rc?oc(s).then((e=>{l(e)})).catch((t=>{if((e=>!(!e||"object"!=typeof e)&&"NotReadableError"===("name"in e?String(e.name):""))(t))return rc=!0,void l(r({},s,{compression:void 0,url:ac(e.url,void 0)}));l(s)})):l(s)})(r({},e,{callback:t=>{var r,i;this.rateLimiter.checkForLimiting(t),400>t.statusCode||null==(r=(i=this.config).on_request_error)||r.call(i,t),null==e.callback||e.callback(t)}}))))}_send_retriable_request(e){this._retryQueue?this._retryQueue.retriableRequest(e):this._send_request(e)}_execute_array(e){w_++;try{var t,r=[],i=[],n=[];ds(e,(e=>{e&&(jr(t=e[0])?n.push(e):zr(e)?e.call(this):jr(e)&&"alias"===t?r.push(e):jr(e)&&-1!==t.indexOf("capture")&&zr(this[t])?n.push(e):i.push(e))}));var s=function(e,t){ds(e,(function(e){if(jr(e[0])){var r=t;hs(e,(function(e){r=r[e[0]].apply(r,e.slice(1))}))}else t[e[0]].apply(t,e.slice(1))}))};s(r,this),s(i,this),s(n,this)}finally{w_--}}push(e){if(w_>0&&jr(e)&&Yr(e[0])){var t=A_.prototype[e[0]];zr(t)&&t.apply(this,e.slice(1))}else this._execute_array([e])}capture(e,t,i){var n,s,o,a,l;if(this.__loaded&&this.persistence&&this.sessionPersistence&&this._requestQueue){if(this.is_capturing())if(!Gr(e)&&Yr(e)){var u=!this.config.opt_out_useragent_filter&&this._is_bot();if(!u||this.config.__preview_capture_bot_pageviews){var c=null!=i&&i.skip_client_rate_limiting?void 0:this.rateLimiter.clientRateLimitContext();if(null==c||!c.isRateLimited){null!=t&&t.$current_url&&!Yr(null==t?void 0:t.$current_url)&&(us.error("Invalid `$current_url` property provided to `posthog.capture`. Input must be a string. Ignoring provided value."),null==t||delete t.$current_url),"$exception"!==e||null!=i&&i._originatedFromCaptureException||us.warn("Using `posthog.capture('$exception')` is unreliable because it does not attach required metadata. Use `posthog.captureException(error)` instead, which attaches required metadata automatically."),this.sessionPersistence.update_search_keyword(),this.config.save_campaign_params&&this.sessionPersistence.update_campaign_params(),this.config.save_referrer&&this.sessionPersistence.update_referrer_info(),(this.config.save_campaign_params||this.config.save_referrer)&&this.persistence.set_initial_person_info();var d=new Date,h=(null==i?void 0:i.timestamp)||d,p=mu(),v={uuid:p,event:e,properties:this.calculateEventProperties(e,t||{},h,p)};e===Ao&&this.config.__preview_capture_bot_pageviews&&u&&(v.event="$bot_pageview",v.properties.$browser_type="bot"),c&&(v.properties.$lib_rate_limit_remaining_tokens=c.remainingTokens),(null==i?void 0:i.$set)&&(v.$set=null==i?void 0:i.$set);var g=this._calculate_set_once_properties(null==i?void 0:i.$set_once,e!==Oo,e===No);if(g&&(v.$set_once=g),null!=i&&i._noTruncate||(s=this.config.properties_string_max_length,o=v,a=e=>Yr(e)?e.slice(0,s):e,l=new Set,v=function e(t,r){return t!==Object(t)?a?a(t):t:l.has(t)?void 0:(l.add(t),jr(t)?(i=[],ds(t,(t=>{i.push(e(t))}))):(i={},hs(t,((t,r)=>{l.has(t)||(i[r]=e(t,r))}))),i);var i}(o)),v.timestamp=h,Gr(null==i?void 0:i.timestamp)||(v.properties.$event_time_override_provided=!0,v.properties.$event_time_override_system_time=d),e===Jl.DISMISSED||e===Jl.SENT){var _=null==t?void 0:t[Ql.SURVEY_ID],f=null==t?void 0:t[Ql.SURVEY_ITERATION];cu({id:_,current_iteration:f}),v.$set=r({},v.$set,{[au({id:_,current_iteration:f},e===Jl.SENT?"responded":"dismissed")]:!0})}else e===Jl.SHOWN&&(v.$set=r({},v.$set,{[Ql.SURVEY_LAST_SEEN_DATE]:(new Date).toISOString()}));if("product tour shown"===e){var m=null==t?void 0:t.$product_tour_type;m&&(v.$set=r({},v.$set,{["$product_tour_last_seen_date/"+m]:(new Date).toISOString()}))}var y=r({},v.properties.$set,v.$set);if(Zr(y)||this.setPersonPropertiesForFlags(y),!Jr(this.config.before_send)){var b=this._runBeforeSend(v);if(!b)return;v=b}this._internalEventEmitter.emit("eventCaptured",v);var w={method:"POST",url:null!==(n=null==i?void 0:i._url)&&void 0!==n?n:this.requestRouter.endpointFor("api",this.analyticsDefaultEndpoint),data:v,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(w):this._requestQueue.enqueue(w),v}us.critical("This capture call is ignored due to client rate limiting.")}}else us.error("No event name provided to posthog.capture")}else us.uninitializedWarning("posthog.capture")}_addCaptureHook(e){return this.on("eventCaptured",(t=>e(t.event,t)))}calculateEventProperties(e,t,i,n,s){if(i=i||new Date,!this.persistence||!this.sessionPersistence)return t;var o=s?void 0:this.persistence.remove_event_timer(e),a=r({},t);if(a.token=this.config.token,a.$config_defaults=this.config.defaults,this._inCookielessMode()&&(a.$cookieless_mode=!0),"$snapshot"===e){var l=r({},this.persistence.properties(),this.sessionPersistence.properties());return a.distinct_id=l.distinct_id,(!Yr(a.distinct_id)&&!Qr(a.distinct_id)||Xr(a.distinct_id))&&us.error("Invalid distinct_id for replay event. This indicates a bug in your implementation"),a}var u,c=function(e,t){var r,i,n,s;if(!is)return{};var o,a=e?[...Ng,...t||[]]:[],[l,u]=function(e){for(var t=0;ln.length>t;t++){var[r,i]=ln[t],n=r.exec(e),s=n&&(zr(i)?i(n,e):i);if(s)return s}return["",""]}(is);return ps(fs({$os:l,$os_version:u,$browser:sn(is,navigator.vendor),$device:un(is),$device_type:cn(is,{userAgentDataPlatform:null==(r=navigator)||null==(r=r.userAgentData)?void 0:r.platform,maxTouchPoints:null==(i=navigator)?void 0:i.maxTouchPoints,screenWidth:null==Gn||null==(n=Gn.screen)?void 0:n.width,screenHeight:null==Gn||null==(s=Gn.screen)?void 0:s.height,devicePixelRatio:null==Gn?void 0:Gn.devicePixelRatio}),$timezone:Zg(),$timezone_offset:Gg()}),{$current_url:xs(null==Jn?void 0:Jn.href,a,Dg),$host:null==Jn?void 0:Jn.host,$pathname:null==Jn?void 0:Jn.pathname,$raw_user_agent:is.length>1e3?is.substring(0,997)+"...":is,$browser_version:an(is,navigator.vendor),$browser_language:Ug(),$browser_language_prefix:(o=Ug(),"string"==typeof o?o.split("-")[0]:void 0),$screen_height:null==Gn?void 0:Gn.screen.height,$screen_width:null==Gn?void 0:Gn.screen.width,$viewport_height:null==Gn?void 0:Gn.innerHeight,$viewport_width:null==Gn?void 0:Gn.innerWidth,$lib:as.LIB_NAME,$lib_version:as.LIB_VERSION,$insert_id:Math.random().toString(36).substring(2,10)+Math.random().toString(36).substring(2,10),$time:Date.now()/1e3})}(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===h_&&(a.$lib_custom_api_host=this.config.api_host),u=e!==Ao||s?e!==Fo||s?this.pageViewManager.doEvent():this.pageViewManager.doPageLeave(i):this.pageViewManager.doPageView(i,n),a=ps(a,u),e===Ao&&Kn&&(a.title=Kn.title),!Gr(o)){var v=i.getTime()-o;a.$duration=parseFloat((v/1e3).toFixed(3))}is&&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(),jr(this.config.property_denylist)?hs(this.config.property_denylist,(function(e){delete a[e]})):us.error(k_+this.config.property_denylist+" or property_blacklist config: "+this.config.property_blacklist);var g=this.config.sanitize_properties;g&&(us.error(x_),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,r){var i;if(void 0===t&&(t=!0),void 0===r&&(r=!1),!this.persistence||!this._hasPersonProcessing())return e;if(this._personProcessingSetOncePropertiesSent&&!r)return e;var n=this.persistence.get_initial_props(),s=null==(i=this.sessionPropsManager)?void 0:i.getSetOnceProps(),o=ps({},n,s||{},e||{}),a=this.config.sanitize_properties;return a&&(us.error(x_),o=a(o,"$set_once")),t&&(this._personProcessingSetOncePropertiesSent=!0),Zr(o)?void 0:o}register(e,t){var r;null==(r=this.persistence)||r.register(e,t)}register_once(e,t,r){var i;null==(i=this.persistence)||i.register_once(e,t,r)}register_for_session(e){var t;null==(t=this.sessionPersistence)||t.register(e)}unregister(e){var t;null==(t=this.persistence)||t.unregister(e)}unregister_for_session(e){var t;null==(t=this.sessionPersistence)||t.unregister(e)}_register_single(e,t){this.register({[e]:t})}getFeatureFlag(e,t){var r;return null==(r=this.featureFlags)?void 0:r.getFeatureFlag(e,t)}getFeatureFlagPayload(e){var t;return null==(t=this.featureFlags)?void 0:t.getFeatureFlagPayload(e)}getFeatureFlagResult(e,t){var r;return null==(r=this.featureFlags)?void 0:r.getFeatureFlagResult(e,t)}isFeatureEnabled(e,t){var r;return null==(r=this.featureFlags)?void 0:r.isFeatureEnabled(e,t)}reloadFeatureFlags(){var e;null==(e=this.featureFlags)||e.reloadFeatureFlags()}updateFlags(e,t,r){var i;null==(i=this.featureFlags)||i.updateFlags(e,t,r)}updateEarlyAccessFeatureEnrollment(e,t,r){var i;null==(i=this.featureFlags)||i.updateEarlyAccessFeatureEnrollment(e,t,r)}getEarlyAccessFeatures(e,t,r){var i;return void 0===t&&(t=!1),null==(i=this.featureFlags)?void 0:i.getEarlyAccessFeatures(e,t,r)}on(e,t){return this._internalEventEmitter.on(e,t)}onFeatureFlags(e){return this.featureFlags?this.featureFlags.onFeatureFlags(e):(e([],{},{errorsLoading:!0}),()=>{})}onSurveysLoaded(e){return this.surveys?this.surveys.onSurveysLoaded(e):(e([],{isLoaded:!1,error:I_}),()=>{})}onSessionId(e){var t,r;return null!==(t=null==(r=this.sessionManager)?void 0:r.onSessionId(e))&&void 0!==t?t:()=>{}}getSurveys(e,t){void 0===t&&(t=!1),this.surveys?this.surveys.getSurveys(e,t):e([],{isLoaded:!1,error:I_})}getActiveMatchingSurveys(e,t){void 0===t&&(t=!1),this.surveys?this.surveys.getActiveMatchingSurveys(e,t):e([],{isLoaded:!1,error:I_})}renderSurvey(e,t){var r;null==(r=this.surveys)||r.renderSurvey(e,t)}displaySurvey(e,t){var r;void 0===t&&(t=hu),null==(r=this.surveys)||r.displaySurvey(e,t)}cancelPendingSurvey(e){var t;null==(t=this.surveys)||t.cancelPendingSurvey(e)}canRenderSurvey(e){var t,r;return null!==(t=null==(r=this.surveys)?void 0:r.canRenderSurvey(e))&&void 0!==t?t:{visible:!1,disabledReason:I_}}canRenderSurveyAsync(e,t){var r,i;return void 0===t&&(t=!1),null!==(r=null==(i=this.surveys)?void 0:i.canRenderSurveyAsync(e,t))&&void 0!==r?r:Promise.resolve({visible:!1,disabledReason:I_})}_validateIdentifyId(e){return!e||Xr(e)?(us.critical("Unique user id has not been set in posthog.identify"),!1):e===wo?(us.critical('The string "'+e+'" was set in posthog.identify which indicates an error. This ID is only used as a sentinel value.'),!1):!["distinct_id","distinctid"].includes(e.toLowerCase())&&!["undefined","null"].includes(e.toLowerCase())||(us.critical('The string "'+e+'" was set in posthog.identify which indicates an error. This ID should be unique to the user and not a hardcoded string.'),!1)}identify(e,t,r){if(!this.__loaded||!this.persistence)return us.uninitializedWarning("posthog.identify");if(Qr(e)&&(e=e.toString(),us.warn("The first argument to posthog.identify was a number, but it should be a string. It has been converted to a string.")),this._validateIdentifyId(e)&&this._requirePersonProcessing("posthog.identify")){var i=this.get_distinct_id();this.register({$user_id:e}),this.get_property(Ms)||this.register_once({$had_persisted_distinct_id:!0,$device_id:i},""),e!==i&&e!==this.get_property(Ls)&&(this.unregister(Ls),this.register({distinct_id:e}));var n,s=(this.persistence.get_property(po)||To)===To;e!==i&&s?(this.persistence.set_property(po,Ro),this.setPersonPropertiesForFlags({$set:t||{},$set_once:r||{}},!1),this.capture(No,{distinct_id:e,$anon_distinct_id:i},{$set:t||{},$set_once:r||{}}),this._cachedPersonProperties=cc(e,t,r),null==(n=this.featureFlags)||n.setAnonymousDistinctId(i)):(t||r)&&this.setPersonProperties(t,r),e!==i&&(this.reloadFeatureFlags(),this.unregister(lo))}}setPersonProperties(e,t){if((e||t)&&this._requirePersonProcessing("posthog.setPersonProperties")){var r=cc(this.get_distinct_id(),e,t);this._cachedPersonProperties!==r?(this.setPersonPropertiesForFlags({$set:e||{},$set_once:t||{}},!0),this.capture("$set",{$set:e||{},$set_once:t||{}}),this._cachedPersonProperties=r):us.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(),s=n[e]!==t;if(s&&this.resetGroupPropertiesForFlags(e),this.register({$groups:r({},n,{[e]:t})}),s||i){var o={$group_type:e,$group_key:t};i&&(o.$group_set=i),this.capture(Oo,o)}i&&this.setGroupPropertiesForFlags({[e]:i}),s&&!i&&this.reloadFeatureFlags()}else us.error("posthog.group requires a group type and group key")}resetGroups(){this.register({$groups:{}}),this.resetGroupPropertiesForFlags(),this.reloadFeatureFlags()}setPersonPropertiesForFlags(e,t){var r;void 0===t&&(t=!0),null==(r=this.featureFlags)||r.setPersonPropertiesForFlags(e,t)}resetPersonPropertiesForFlags(){var e;null==(e=this.featureFlags)||e.resetPersonPropertiesForFlags()}setGroupPropertiesForFlags(e,t){var r;void 0===t&&(t=!0),this._requirePersonProcessing("posthog.setGroupPropertiesForFlags")&&(null==(r=this.featureFlags)||r.setGroupPropertiesForFlags(e,t))}resetGroupPropertiesForFlags(e){var t;null==(t=this.featureFlags)||t.resetGroupPropertiesForFlags(e)}reset(e){var t,r,i,n,s,o,a,l;if(us.info("reset"),!this.__loaded)return us.uninitializedWarning("posthog.reset");var u=this.get_property(Ms);if(this.consent.reset(),null==(t=this.persistence)||t.clear(),null==(r=this.sessionPersistence)||r.clear(),null==(i=this.surveys)||i.reset(),null==(n=this._remoteConfigLoader)||n.stop(),null==(s=this.featureFlags)||s.reset(),null==(o=this.conversations)||o.reset(),null==(a=this.persistence)||a.set_property(po,To),null==(l=this.sessionManager)||l.resetSessionId(),this._cachedPersonProperties=null,this.config.cookieless_mode===Eo)this.register_once({distinct_id:wo,$device_id:null},"");else{var c=this.config.get_device_id(mu());this.register_once({distinct_id:c,$device_id:e?c:u},"")}this.register({$last_posthog_reset:(new Date).toISOString()},1),delete this.config.identity_distinct_id,delete this.config.identity_hash,this.reloadFeatureFlags()}setIdentity(e,t){var r;this.config.identity_distinct_id=e,this.config.identity_hash=t,this.alias(e),null==(r=this.conversations)||r._onIdentityChanged()}clearIdentity(){var e;delete this.config.identity_distinct_id,delete this.config.identity_hash,null==(e=this.conversations)||e._onIdentityCleared()}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(Rs)?(us.critical("Attempting to create alias for existing People user - aborting."),-2):this._requirePersonProcessing("posthog.alias")?(Gr(t)&&(t=this.get_distinct_id()),e!==t?(this._register_single(Ls,e),this.capture("$create_alias",{alias:e,distinct_id:t})):(us.warn("alias matches current distinct_id - skipping api call."),this.identify(e),-1)):void 0}set_config(e){var t=r({},this.config);if(Wr(e)){var i,n,s,o,a,l,u,c,d,h;ps(this.config,L_(e));var p=this._is_persistence_disabled();null==(i=this.persistence)||i.update_config(this.config,t,p),this.sessionPersistence="sessionStorage"===this.config.persistence||"memory"===this.config.persistence?this.persistence:new Xg(r({},this.config,{persistence:"sessionStorage"}),p);var v=this._checkLocalStorageForDebug(this.config.debug);ti(v)&&(this.config.debug=v),ti(this.config.debug)&&(this.config.debug?(as.DEBUG=!0,mc._is_supported()&&mc._set("ph_debug",!0),us.info("set_config",{config:e,oldConfig:t,newConfig:r({},this.config)})):(as.DEBUG=!1,mc._is_supported()&&mc._remove("ph_debug"))),null==(n=this.exceptionObserver)||n.onConfigChange(),null==(s=this.exceptions)||s.onConfigChange(),null==(o=this.sessionRecording)||o.startIfEnabledOrStop(),null==(a=this.autocapture)||a.startIfEnabled(),null==(l=this.heatmaps)||l.startIfEnabled(),null==(u=this.exceptionObserver)||u.startIfEnabledOrStop(),null==(c=this.deadClicksAutocapture)||c.startIfEnabledOrStop(),null==(d=this.surveys)||d.loadIfEnabled(),this._sync_opt_out_with_persistence(),null==(h=this.externalIntegrations)||h.startIfEnabledOrStop()}}_overrideSDKInfo(e,t){as.LIB_NAME=e,as.LIB_VERSION=t}startSessionRecording(e){var t,r,i,n,s,o=!0===e,a={sampling:o||!(null==e||!e.sampling),linked_flag:o||!(null==e||!e.linked_flag),url_trigger:o||!(null==e||!e.url_trigger),event_trigger:o||!(null==e||!e.event_trigger)};Object.values(a).some(Boolean)&&(null==(t=this.sessionManager)||t.checkAndGetSessionAndWindowId(),a.sampling&&(null==(r=this.sessionRecording)||r.overrideSampling()),a.linked_flag&&(null==(i=this.sessionRecording)||i.overrideLinkedFlag()),a.url_trigger&&(null==(n=this.sessionRecording)||n.overrideTrigger("url")),a.event_trigger&&(null==(s=this.sessionRecording)||s.overrideTrigger("event")));this.set_config({disable_session_recording:!1})}stopSessionRecording(){this.set_config({disable_session_recording:!0})}sessionRecordingStarted(){var e;return!(null==(e=this.sessionRecording)||!e.started)}captureException(e,t){if(this.exceptions){var i=new Error("PostHog syntheticException"),n=this.exceptions.buildProperties(e,{handled:!0,syntheticException:i});return this.exceptions.sendExceptionEvent(r({},n,t))}}addExceptionStep(e,t){var r;null==(r=this.exceptions)||r.addExceptionStep(e,t)}captureLog(e){var t;null==(t=this.logs)||t.captureLog(e)}get logger(){var e,t;return null!==(e=null==(t=this.logs)?void 0:t.logger)&&void 0!==e?e:A_._noopLogger}startExceptionAutocapture(e){this.set_config({capture_exceptions:null==e||e})}stopExceptionAutocapture(){this.set_config({capture_exceptions:!1})}loadToolbar(e){var t,r;return null!==(t=null==(r=this.toolbar)?void 0:r.loadToolbar(e))&&void 0!==t&&t}get_property(e){var t;return null==(t=this.persistence)?void 0:t.props[e]}getSessionProperty(e){var t;return null==(t=this.sessionPersistence)?void 0:t.props[e]}toString(){var e,t=null!==(e=this.config.name)&&void 0!==e?e:E_;return t!==E_&&(t=E_+"."+t),t}_isIdentified(){var e,t;return(null==(e=this.persistence)?void 0:e.get_property(po))===Ro||(null==(t=this.sessionPersistence)?void 0:t.get_property(po))===Ro}_hasPersonProcessing(){var e,t;return!("never"===this.config.person_profiles||this.config.person_profiles===Mo&&!this._isIdentified()&&Zr(this.getGroups())&&(null==(e=this.persistence)||null==(e=e.props)||!e[Ls])&&(null==(t=this.persistence)||null==(t=t.props)||!t[yo]))}_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({},{})}setInternalOrTestUser(){this._requirePersonProcessing("posthog.setInternalOrTestUser")&&this.setPersonProperties({$internal_or_test_user:!0})}_requirePersonProcessing(e){return"never"===this.config.person_profiles?(us.error(e+' was called, but process_person is set to "never". This call will be ignored.'),!1):(this._register_single(yo,!0),!0)}_is_persistence_disabled(){if("always"===this.config.cookieless_mode)return!0;var e=this.consent.isOptedOut();return this.config.disable_persistence||e&&!(!this.config.opt_out_persistence_by_default&&this.config.cookieless_mode!==ko)}_sync_opt_out_with_persistence(){var e,t,r,i,n=this._is_persistence_disabled();return(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)),n}opt_in_capturing(e){var t;if(this.config.cookieless_mode!==Eo){if(this._inCookielessMode()){var r,i,n,s,o;this.reset(!0),null==(r=this.sessionManager)||r.destroy(),null==(i=this.pageViewManager)||i.destroy(),this.sessionManager=new c_(this),this.pageViewManager=new Lg(this),this.persistence&&(this.sessionPropsManager=new a_(this,this.sessionManager,this.persistence));var a,l=null!==(n=null==(s=this.config.__extensionClasses)?void 0:s.sessionRecording)&&void 0!==n?n:null==(o=A_.__defaultExtensionClasses)?void 0:o.sessionRecording;l&&(this.sessionRecording=this._replaceExtension(this.sessionRecording,new l(this)),this._lastRemoteConfig&&(null==(a=this.sessionRecording)||null==a.onRemoteConfig||a.onRemoteConfig(this._lastRemoteConfig)))}var u,c;this.consent.optInOut(!0),this._sync_opt_out_with_persistence(),this._start_queue_if_opted_in(),null==(t=this.sessionRecording)||t.startIfEnabledOrStop(),this.config.cookieless_mode==ko&&(null==(u=this.surveys)||u.loadIfEnabled()),(Gr(null==e?void 0:e.captureEventName)||null!=e&&e.captureEventName)&&this.capture(null!==(c=null==e?void 0:e.captureEventName)&&void 0!==c?c:"$opt_in",null==e?void 0:e.captureProperties,{send_instantly:!0}),this.config.capture_pageview&&this._captureInitialPageview()}else us.warn(C_)}opt_out_capturing(){var e,t,r;this.config.cookieless_mode!==Eo?(this.config.cookieless_mode===ko&&this.consent.isOptedIn()&&this.reset(!0),this.consent.optInOut(!1),this._sync_opt_out_with_persistence(),this.config.cookieless_mode===ko&&(this.register({distinct_id:wo,$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())):us.warn(C_)}has_opted_in_capturing(){return this.consent.isOptedIn()}has_opted_out_capturing(){return this.consent.isOptedOut()}get_explicit_consent_status(){var e=this.consent.consent;return 1===e?"granted":0===e?"denied":"pending"}is_capturing(){return this.config.cookieless_mode===Eo||(this.config.cookieless_mode===ko?this.consent.isRejected()||this.consent.isOptedIn():!this.has_opted_out_capturing())}clear_opt_in_out_capturing(){this.consent.reset(),this._sync_opt_out_with_persistence()}_is_bot(){return Xn?d_(Xn,this.config.custom_blocked_useragents):void 0}_captureInitialPageview(){Kn&&("visible"===Kn.visibilityState?this._initialPageviewCaptured||(this._initialPageviewCaptured=!0,this.capture(Ao,{title:Kn.title},{send_instantly:!0}),this._visibilityStateListener&&(Kn.removeEventListener(Lo,this._visibilityStateListener),this._visibilityStateListener=null)):this._visibilityStateListener||(this._visibilityStateListener=this._captureInitialPageview.bind(this),bs(Kn,Lo,this._visibilityStateListener)))}debug(e){!1===e?(null==Gn||Gn.console.log("You've disabled debug mode."),this.set_config({debug:!1})):(null==Gn||Gn.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=this._originalUserConfig||{};return"advanced_disable_flags"in o?!!o.advanced_disable_flags:!1!==this.config.advanced_disable_flags?!!this.config.advanced_disable_flags:!0===this.config.advanced_disable_decide?(us.warn("Config field 'advanced_disable_decide' is deprecated. Please use 'advanced_disable_flags' instead. The old field will be removed in a future major version."),!0):(r="advanced_disable_decide",!1,i=us,n=(t="advanced_disable_flags")in(e=o)&&!Jr(e[t]),s=r in e&&!Jr(e[r]),n?e[t]:!!s&&(i&&i.warn("Config field '"+r+"' is deprecated. Please use '"+t+"' instead. The old field will be removed in a future major version."),e[r]))}_runBeforeSend(e){if(Jr(this.config.before_send))return e;var t=jr(this.config.before_send)?this.config.before_send:[this.config.before_send],r=e;for(var i of t){if(r=i(r),Jr(r)){var n="Event '"+e.event+"' was rejected in beforeSend function";return Br(Dr,e.event)?us.warn(n+". This can cause unexpected behavior."):us.info(n),null}r.properties&&!Zr(r.properties)||us.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=ti(e)&&!e,r=mc._is_supported()&&"true"===mc._get("ph_debug");return!t&&(!!r||e)}}A_.__defaultExtensionClasses={},A_._noopLogger={trace:y_=()=>{},debug:y_,info:y_,warn:y_,error:y_,fatal:y_},function(e,t){for(var r=0;t.length>r;r++)e.prototype[t[r]]=_s(e.prototype[t[r]])}(A_,["identify"]);var F_=cs("[ExceptionAutocapture]"),N_=cs("[TracingHeaders]"),O_=cs("[Web Vitals]"),D_=9e5,B_="disabled",H_="lazy_loading",q_="awaiting_config",V_="missing_config";cs("[SessionRecording]"),cs("[SessionRecording]");var U_="[SessionRecording]",$_=cs(U_),j_=cs("[Heatmaps]");function z_(e){return Wr(e)&&"clientX"in e&&"clientY"in e&&Qr(e.clientX)&&Qr(e.clientY)}var W_=cs("[Product Tours]"),Z_=["$set_once","$set"],G_=cs("[SiteApps]"),Y_="Error while initializing PostHog app with config id ";function X_(e,t,r){if(Jr(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 K_{constructor(e){this._debugEventEmitter=new l_,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,t;Gr(null==(e=this._instance)?void 0:e._addCaptureHook)||(null==(t=this._instance)||t._addCaptureHook(((e,t)=>{this.on(e,t)})))}register(e){var t,r;if(!Gr(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(!X_(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=>X_(e.href,t.href,t.href_matching||"exact")));var n,s=(null==e||null==(r=e.properties)?void 0:r.$elements_chain)||"";return!!s&&X_((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=>X_(e.text,t.text,t.text_matching||"exact")||X_(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;!Jr(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=>X_(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||pc(t.properties.reduce(((e,t)=>{var r=jr(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 J_{constructor(e){this._instance=e,this._eventToItems=new Map,this._cancelEventToItems=new Map,this._actionToItems=new Map}_doesEventMatchFilter(e,t){return!!e&&pc(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===$l?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;Gr(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}));0!==t.length&&(null==this._actionMatcher&&(this._actionMatcher=new K_(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}));0===r.length&&0===i.length||(null==(t=this._instance)||t._addCaptureHook(((e,t)=>{this.onEvent(e,t)})),this._eventToItems=this._buildEventToItemMap(e,$l),this._cancelEventToItems=this._buildEventToItemMap(e,jl))}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);0>c||(o.splice(c,1),this._updateActivatedItems(o))}}else{if(this._cancelEventToItems.has(e)){var d=this._getMatchingItems(e,t,jl);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);0>t||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,$l);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=this._getLogger(),r=[...new Set(e)].filter((e=>!this._isItemPermanentlyIneligible(e)));t.info("updating activated items",{activatedItems:r}),this._setActivatedItems(r)}getActivatedIds(){var e,t=this._getActivatedKey();return(null==(e=this._instance)||null==(e=e.persistence)?void 0:e.props[t])||[]}getEventToItemsMap(){return this._eventToItems}_getActionMatcher(){return this._actionMatcher}}class Q_ extends J_{constructor(e){super(e)}_getActivatedKey(){return oo}_getShownEventName(){return Jl.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 tu}_setActivatedItems(e){var t;null==(t=this._instance)||null==(t=t.persistence)||t.register({[oo]:e})}_isItemPermanentlyIneligible(){return!1}getSurveys(){return this.getActivatedIds()}getEventToSurveys(){return this.getEventToItemsMap()}}var ef="SDK is not enabled or survey functionality is not yet loaded",tf="Disabled. Not loading surveys.",rf=null!=Gn&&Gn.location?ks(Gn.location.hash,"__posthog")||ks(location.hash,"state"):null,nf="_postHogToolbarParams",sf=cs("[Toolbar]"),of=cs("[FeatureFlags]"),af=cs("[FeatureFlags]",{debugEnabled:!0}),lf="\" failed. Feature flags didn't load in time.",uf=e=>{for(var t={},r=0;e.length>r;r++)t[e[r]]=!0;return t},cf=e=>{var t={};for(var[r,i]of vs(e||{}))i&&(t[r]=i);return t},df="Refusing to render web experiment since the viewer is a likely bot",hf={icontains:(e,t)=>!!Gn&&t.href.toLowerCase().indexOf(e.toLowerCase())>-1,not_icontains:(e,t)=>!!Gn&&-1===t.href.toLowerCase().indexOf(e.toLowerCase()),regex:(e,t)=>!!Gn&&uc(t.href,e),not_regex:(e,t)=>!!Gn&&!uc(t.href,e),exact:(e,t)=>t.href===e,is_not:(e,t)=>t.href!==e};class pf{get _config(){return this._instance.config}constructor(e){var t=this;this.getWebExperimentsAndEvaluateDisplayLogic=function(e){void 0===e&&(e=!1),t.getWebExperiments((e=>{pf._logInfo("retrieved web experiments from the server"),t._flagToExperiments=new Map,e.forEach((e=>{if(e.feature_flag_key){var r;t._flagToExperiments&&(pf._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);Yr(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];pf._matchesTestVariant(s)&&t._applyTransforms(e.name,n,s.transforms)}}))}),e)},this._instance=e,this._instance.onFeatureFlags((e=>{this.onFeatureFlags(e)}))}initialize(){}onFeatureFlags(e){if(this._is_bot())pf._logInfo(df);else if(!this._config.disable_web_experiments){if(Jr(this._flagToExperiments))return this._flagToExperiments=new Map,this.loadIfEnabled(),void this.previewWebExperiment();pf._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=pf.getWindowLocation();if(null!=e&&e.search){var t=Is(null==e?void 0:e.search,"__experiment_id"),r=Is(null==e?void 0:e.search,"__experiment_variant");t&&r&&(pf._logInfo("previewing web experiments "+t+" && "+r),this.getWebExperiments((e=>{this._showPreviewWebExperiment(parseInt(t),r,e)}),!1,!0))}}loadIfEnabled(){this._config.disable_web_experiments||this.getWebExperimentsAndEvaluateDisplayLogic()}getWebExperiments(e,t,r){if(this._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._config.token),method:"GET",callback:t=>e(200===t.statusCode&&t.json&&t.json.experiments||[])})}_showPreviewWebExperiment(e,t,r){var i=r.filter((t=>t.id===e));i&&i.length>0&&(pf._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!Jr(e.conditions)&&pf._matchUrlConditions(e)&&pf._matchUTMConditions(e)}static _matchUrlConditions(e){var t;if(Jr(e.conditions)||Jr(null==(t=e.conditions)?void 0:t.url))return!0;var r,i,n,s=pf.getWindowLocation();return!!s&&(null==(r=e.conditions)||!r.url||hf[null!==(i=null==(n=e.conditions)?void 0:n.urlMatchType)&&void 0!==i?i:"icontains"](e.conditions.url,s))}static getWindowLocation(){return null==Gn?void 0:Gn.location}static _matchUTMConditions(e){var t;if(Jr(e.conditions)||Jr(null==(t=e.conditions)?void 0:t.utm))return!0;var r=Hg();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;t>i;i++)r[i-1]=arguments[i];us.info("[WebExperiments] "+e,r)}_applyTransforms(e,t,r){this._is_bot()?pf._logInfo(df):"control"!==t?r.forEach((r=>{if(r.selector){var i;pf._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)}))}})):pf._logInfo("Control variants leave the page unmodified.")}_is_bot(){return Xn&&this._instance?d_(Xn,this._config.custom_blocked_useragents):void 0}}var vf,gf,_f=cs("[Conversations]"),ff="Conversations not available yet.",mf={featureFlags:class{constructor(e){this._override_warning=!1,this._hasLoadedFlags=!1,this._requestInFlight=!1,this._reloadingDisabled=!1,this._additionalReloadRequested=!1,this._flagsLoadedFromRemote=!1,this._hasLoggedDeprecationWarning=!1,this._staleCacheRefreshTriggered=!1,this._instance=e,this.featureFlagEventHandlers=[]}get _config(){return this._instance.config}get _persistence(){return this._instance.persistence}_prop(e){return this._instance.get_property(e)}_isCacheStale(){var e,t;return null!==(e=null==(t=this._persistence)?void 0:t._isFeatureFlagCacheStale(this._config.feature_flag_cache_ttl_ms))&&void 0!==e&&e}_checkAndTriggerStaleRefresh(){return!!this._isCacheStale()&&(this._staleCacheRefreshTriggered||this._requestInFlight||(this._staleCacheRefreshTriggered=!0,of.warn("Feature flag cache is stale, triggering refresh..."),this.reloadFeatureFlags()),!0)}_getValidEvaluationEnvironments(){var e,t=null!==(e=this._config.evaluation_contexts)&&void 0!==e?e:this._config.evaluation_environments;return!this._config.evaluation_environments||this._config.evaluation_contexts||this._hasLoggedDeprecationWarning||(of.warn("evaluation_environments is deprecated. Use evaluation_contexts instead. evaluation_environments will be removed in a future version."),this._hasLoggedDeprecationWarning=!0),null!=t&&t.length?t.filter((e=>{var t=e&&"string"==typeof e&&e.trim().length>0;return t||of.error("Invalid evaluation context found:",e,"Expected non-empty string"),t})):[]}_shouldIncludeEvaluationEnvironments(){return this._getValidEvaluationEnvironments().length>0}initialize(){var e,t,{config:r}=this._instance,i=null!==(e=null==(t=r.bootstrap)?void 0:t.featureFlags)&&void 0!==e?e:{};if(Object.keys(i).length){var n,s,o=null!==(n=null==(s=r.bootstrap)?void 0:s.featureFlagPayloads)&&void 0!==n?n:{},a=Object.keys(i).filter((e=>!!i[e])).reduce(((e,t)=>(e[t]=i[t]||!1,e)),{}),l=Object.keys(o).filter((e=>a[e])).reduce(((e,t)=>(o[t]&&(e[t]=o[t]),e)),{});this.receivedFeatureFlags({featureFlags:a,featureFlagPayloads:l})}}updateFlags(e,t,i){var n=null!=i&&i.merge?this.getFlagVariants():{},s=null!=i&&i.merge?this.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:Gr(null==a?void 0:a[u])?void 0:{id:0,version:void 0,description:void 0,payload:a[u]}}}this.receivedFeatureFlags({flags:l})}get hasLoadedFlags(){return this._hasLoadedFlags}getFlags(){return Object.keys(this.getFlagVariants())}getFlagsWithDetails(){var e=this._prop(Js),t=this._prop(to),i=this._prop(ro);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=Gr(c)?null!==(a=null==u?void 0:u.enabled)&&void 0!==a&&a:!!c,h=Gr(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});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||(of.warn(" Overriding feature flag details!",{flagDetails:e,overriddenPayloads:i,finalDetails:n}),this._override_warning=!0),n}getFlagVariants(){var e=this._prop(Ys),t=this._prop(to);if(!t)return e||{};for(var r=ps({},e),i=Object.keys(t),n=0;i.length>n;n++)r[i[n]]=t[i[n]];return this._override_warning||(of.warn(" Overriding feature flags!",{enabledFlags:e,overriddenFlags:t,finalFlags:r}),this._override_warning=!0),r}getFlagPayloads(){var e=this._prop(Qs),t=this._prop(ro);if(!t)return e||{};for(var r=ps({},e||{}),i=Object.keys(t),n=0;i.length>n;n++)r[i[n]]=t[i[n]];return this._override_warning||(of.warn(" Overriding feature flag payloads!",{flagPayloads:e,overriddenPayloads:t,finalPayloads:r}),this._override_warning=!0),r}reloadFeatureFlags(){this._reloadingDisabled||this._config.advanced_disable_feature_flags||this._reloadDebouncer||(this._instance._internalEventEmitter.emit("featureFlagsReloading",!0),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._config.token,n=this._prop(Ms),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._persistence)?void 0:t.get_initial_props())||{},this._prop(io)||{}),group_properties:this._prop(no),timezone:Zg()};Kr(n)||Gr(n)||(s.$device_id=n),(null!=e&&e.disableFlags||this._config.advanced_disable_feature_flags)&&(s.disable_flags=!0),this._shouldIncludeEvaluationEnvironments()&&(s.evaluation_contexts=this._getValidEvaluationEnvironments());var o=this._instance.requestRouter.endpointFor("flags","/flags/?v=2"+(this._config.advanced_only_evaluate_survey_feature_flags?"&only_evaluate_survey_feature_flags=true":""));this._requestInFlight=!0,this._instance._send_request({method:"POST",url:o,data:s,compression:this._config.disable_compression?void 0:wu,timeout:this._config.feature_flag_request_timeout_ms,callback:e=>{var t,r,i,n=!0;if(200===e.statusCode&&(this._additionalReloadRequested||(this.$anon_distinct_id=void 0),n=!1),this._requestInFlight=!1,!s.disable_flags||this._additionalReloadRequested){this._flagsLoadedFromRemote=!n;var o=[];e.error?e.error instanceof Error?o.push("AbortError"===e.error.name?"timeout":"connection_error"):o.push("unknown_error"):200!==e.statusCode&&o.push("api_error_"+e.statusCode),null!=(t=e.json)&&t.errorsWhileComputingFlags&&o.push("errors_while_computing_flags");var a,l=!(null==(r=e.json)||null==(r=r.quotaLimited)||!r.includes("feature_flags"));if(l&&o.push("quota_limited"),null==(i=this._persistence)||i.register({[co]:o}),l)of.warn("You have hit your feature flags quota limit, and will not be able to load feature flags until the quota is reset. Please visit https://posthog.com/docs/billing/limits-alerts to learn more.");else s.disable_flags||this.receivedFeatureFlags(null!==(a=e.json)&&void 0!==a?a:{},n,{partialResponse:!!this._config.advanced_only_evaluate_survey_feature_flags}),this._additionalReloadRequested&&(this._additionalReloadRequested=!1,this._callFlagsEndpoint())}}})}}getFeatureFlag(e,t){var r;if(void 0===t&&(t={}),!t.fresh||this._flagsLoadedFromRemote)if(this._hasLoadedFlags||this.getFlags()&&this.getFlags().length>0){if(!this._checkAndTriggerStaleRefresh()){var i=this.getFeatureFlagResult(e,t);return null!==(r=null==i?void 0:i.variant)&&void 0!==r?r:null==i?void 0:i.enabled}}else of.warn('getFeatureFlag for key "'+e+lf)}getFeatureFlagDetails(e){return this.getFlagsWithDetails()[e]}getFeatureFlagPayload(e){var t=this.getFeatureFlagResult(e,{send_event:!1});return null==t?void 0:t.payload}getFeatureFlagResult(e,t){if(void 0===t&&(t={}),!t.fresh||this._flagsLoadedFromRemote)if(this._hasLoadedFlags||this.getFlags()&&this.getFlags().length>0){if(!this._checkAndTriggerStaleRefresh()){var r=this.getFlagVariants(),i=e in r,n=r[e],s=this.getFlagPayloads()[e],o=String(n),a=this._prop(eo)||void 0,l=this._prop(ho)||void 0,u=this._prop(lo)||{};if(this._config.advanced_feature_flags_dedup_per_session){var c,d=this._instance.get_session_id(),h=this._prop(uo);d&&d!==h&&(u={},null==(c=this._persistence)||c.register({[lo]:u,[uo]:d}))}if((t.send_event||!("send_event"in t))&&(!(e in u)||!u[e].includes(o))){var p,v,g,_,f,m,y,b,w,S;jr(u[e])?u[e].push(o):u[e]=[o],null==(p=this._persistence)||p.register({[lo]:u});var C=this.getFeatureFlagDetails(e),I=[...null!==(v=this._prop(co))&&void 0!==v?v:[]];Gr(n)&&I.push("flag_missing");var x={$feature_flag:e,$feature_flag_response:n,$feature_flag_payload:s||null,$feature_flag_request_id:a,$feature_flag_evaluated_at:l,$feature_flag_bootstrapped_response:(null==(g=this._config.bootstrap)||null==(g=g.featureFlags)?void 0:g[e])||null,$feature_flag_bootstrapped_payload:(null==(_=this._config.bootstrap)||null==(_=_.featureFlagPayloads)?void 0:_[e])||null,$used_bootstrap_value:!this._flagsLoadedFromRemote};Gr(null==C||null==(f=C.metadata)?void 0:f.version)||(x.$feature_flag_version=C.metadata.version);var k,E=null!==(m=null==C||null==(y=C.reason)?void 0:y.description)&&void 0!==m?m:null==C||null==(b=C.reason)?void 0:b.code;E&&(x.$feature_flag_reason=E),null!=C&&null!=(w=C.metadata)&&w.id&&(x.$feature_flag_id=C.metadata.id),Gr(null==C?void 0:C.original_variant)&&Gr(null==C?void 0:C.original_enabled)||(x.$feature_flag_original_response=Gr(C.original_variant)?C.original_enabled:C.original_variant),null!=C&&null!=(S=C.metadata)&&S.original_payload&&(x.$feature_flag_original_payload=null==C||null==(k=C.metadata)?void 0:k.original_payload),I.length&&(x.$feature_flag_error=I.join(",")),this._instance.capture("$feature_flag_called",x)}if(i){var T=s;if(!Gr(s))try{T=JSON.parse(s)}catch(e){}return{key:e,enabled:!!n,variant:"string"==typeof n?n:void 0,payload:T}}}}else of.warn('getFeatureFlagResult for key "'+e+lf)}getRemoteConfigPayload(e,t){var r=this._config.token,i={distinct_id:this._instance.get_distinct_id(),token:r};this._shouldIncludeEvaluationEnvironments()&&(i.evaluation_contexts=this._getValidEvaluationEnvironments()),this._instance._send_request({method:"POST",url:this._instance.requestRouter.endpointFor("flags","/flags/?v=2"),data:i,compression:this._config.disable_compression?void 0:wu,timeout:this._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={}),!t.fresh||this._flagsLoadedFromRemote){if(this._hasLoadedFlags||this.getFlags()&&this.getFlags().length>0){var r=this.getFeatureFlag(e,t);return Gr(r)?void 0:!!r}of.warn('isFeatureEnabled for key "'+e+lf)}}addFeatureFlagsHandler(e){this.featureFlagEventHandlers.push(e)}removeFeatureFlagsHandler(e){this.featureFlagEventHandlers=this.featureFlagEventHandlers.filter((t=>t!==e))}receivedFeatureFlags(e,t,i){if(this._persistence){this._hasLoadedFlags=!0;var n=this.getFlagVariants(),s=this.getFlagPayloads(),o=this.getFlagsWithDetails();!function(e,t,i,n,s,o){void 0===i&&(i={}),void 0===n&&(n={}),void 0===s&&(s={});var a=(e=>{var t=e.flags;return t?(e.featureFlags=Object.fromEntries(Object.keys(t).map((e=>{var r;return[e,null!==(r=t[e].variant)&&void 0!==r?r:t[e].enabled]}))),e.featureFlagPayloads=Object.fromEntries(Object.keys(t).filter((e=>t[e].enabled)).filter((e=>{var r;return null==(r=t[e].metadata)?void 0:r.payload})).map((e=>{var r;return[e,null==(r=t[e].metadata)?void 0:r.payload]})))):of.warn("Using an older version of the feature flags endpoint. Please upgrade your PostHog server to the latest version"),e})(e),l=a.flags,u=a.featureFlags,c=a.featureFlagPayloads;if(u){var d=e.requestId,h=e.evaluatedAt;if(jr(u)){of.warn("v1 of the feature flags endpoint is deprecated. Please use the latest version.");var p={};if(u)for(var v=0;u.length>v;v++)p[u[v]]=!0;t&&t.register({[Xs]:u,[Ys]:p})}else{var g=u,_=c,f=l;if(null!=o&&o.partialResponse)g=r({},i,g),_=r({},n,_),f=r({},s,f);else if(e.errorsWhileComputingFlags)if(l){var m=new Set(Object.keys(l).filter((e=>{var t;return!(null!=(t=l[e])&&t.failed)})));g=r({},i,Object.fromEntries(Object.entries(g).filter((e=>{var[t]=e;return m.has(t)})))),_=r({},n,Object.fromEntries(Object.entries(_||{}).filter((e=>{var[t]=e;return m.has(t)})))),f=r({},s,Object.fromEntries(Object.entries(f||{}).filter((e=>{var[t]=e;return m.has(t)}))))}else g=r({},i,g),_=r({},n,_),f=r({},s,f);t&&t.register(r({[Xs]:Object.keys(cf(g)),[Ys]:g||{},[Qs]:_||{},[Js]:f||{}},d?{[eo]:d}:{},h?{[ho]:h}:{}))}}}(e,this._persistence,n,s,o,i),t||(this._staleCacheRefreshTriggered=!1),this._fireFeatureFlagsCallbacks(t)}}override(e,t){void 0===t&&(t=!1),of.warn("override is deprecated. Please use overrideFeatureFlags instead."),this.overrideFeatureFlags({flags:e,suppressWarning:t})}overrideFeatureFlags(e){if(!this._instance.__loaded||!this._persistence)return of.uninitializedWarning("posthog.featureFlags.overrideFeatureFlags");if(!1===e)return this._persistence.unregister(to),this._persistence.unregister(ro),this._fireFeatureFlagsCallbacks(),af.info("All overrides cleared");if(jr(e)){var t=uf(e);return this._persistence.register({[to]:t}),this._fireFeatureFlagsCallbacks(),af.info("Flag overrides set",{flags:e})}if(e&&"object"==typeof e&&("flags"in e||"payloads"in e)){var r,i=e;if(this._override_warning=Boolean(null!==(r=i.suppressWarning)&&void 0!==r&&r),"flags"in i)if(!1===i.flags)this._persistence.unregister(to),af.info("Flag overrides cleared");else if(i.flags){if(jr(i.flags)){var n=uf(i.flags);this._persistence.register({[to]:n})}else this._persistence.register({[to]:i.flags});af.info("Flag overrides set",{flags:i.flags})}return"payloads"in i&&(!1===i.payloads?(this._persistence.unregister(ro),af.info("Payload overrides cleared")):i.payloads&&(this._persistence.register({[ro]:i.payloads}),af.info("Payload overrides set",{payloads:i.payloads}))),void this._fireFeatureFlagsCallbacks()}if(e&&"object"==typeof e)return this._persistence.register({[to]:e}),this._fireFeatureFlagsCallbacks(),af.info("Flag overrides set",{flags:e});of.warn("Invalid overrideOptions provided to overrideFeatureFlags",{overrideOptions:e})}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._prop(Ks)||[]).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._persistence)||n.register({[Xs]:Object.keys(cf(l)),[Ys]:l}),this._fireFeatureFlagsCallbacks()}getEarlyAccessFeatures(e,t,r){void 0===t&&(t=!1);var i=this._prop(Ks),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._config.token+n),method:"GET",callback:t=>{var r,i;if(t.json){var n=t.json.earlyAccessFeatures;return null==(r=this._persistence)||r.unregister(Ks),null==(i=this._persistence)||i.register({[Ks]: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._prop(io)||{},n=(null==e?void 0:e.$set)||(null!=e&&e.$set_once?{}:e),s=null==e?void 0:e.$set_once,o={};if(s)for(var a in s)({}).hasOwnProperty.call(s,a)&&(a in i||(o[a]=s[a]));this._instance.register({[io]:r({},i,o,n)}),t&&this._instance.reloadFeatureFlags()}resetPersonPropertiesForFlags(){this._instance.unregister(io)}setGroupPropertiesForFlags(e,t){void 0===t&&(t=!0);var i=this._prop(no)||{};0!==Object.keys(i).length&&Object.keys(i).forEach((t=>{i[t]=r({},i[t],e[t]),delete e[t]})),this._instance.register({[no]:r({},i,e)}),t&&this._instance.reloadFeatureFlags()}resetGroupPropertiesForFlags(e){if(e){var t=this._prop(no)||{};this._instance.register({[no]:r({},t,{[e]:{}})})}else this._instance.unregister(no)}reset(){this._hasLoadedFlags=!1,this._requestInFlight=!1,this._reloadingDisabled=!1,this._additionalReloadRequested=!1,this._flagsLoadedFromRemote=!1,this.$anon_distinct_id=void 0,this._clearDebouncer(),this._override_warning=!1}}},yf={sessionRecording:class{get _config(){return this._instance.config}get _persistence(){return this._instance.persistence}get started(){var e;return!(null==(e=this._lazyLoadedSessionRecording)||!e.isStarted)}get status(){var e,t;return this._recordingStatus===q_||this._recordingStatus===V_?this._recordingStatus:null!==(e=null==(t=this._lazyLoadedSessionRecording)?void 0:t.status)&&void 0!==e?e:this._recordingStatus}constructor(e){if(this._forceAllowLocalhostNetworkCapture=!1,this._recordingStatus=B_,this._persistFlagsOnSessionListener=void 0,this._instance=e,!this._instance.sessionManager)throw $_.error("started without valid sessionManager"),new Error(U_+" started without valid sessionManager. This is a bug.");if(this._config.cookieless_mode===Eo)throw new Error(U_+' cannot be used with cookieless_mode="always"')}initialize(){this.startIfEnabledOrStop()}get _isRecordingEnabled(){var e,t=!(null==(e=this._instance.get_property(Us))||!e.enabled),r=!this._config.disable_session_recording,i=this._config.disable_session_recording||this._instance.consent.isOptedOut();return Gn&&t&&r&&!i}startIfEnabledOrStop(e){var t;if(!this._isRecordingEnabled||null==(t=this._lazyLoadedSessionRecording)||!t.isStarted){var r=!Gr(Object.assign)&&!Gr(Array.from);this._isRecordingEnabled&&r?(this._lazyLoadAndStart(e),$_.info("starting")):(this._recordingStatus=B_,this.stopRecording())}}_lazyLoadAndStart(e){var t,r,i;this._isRecordingEnabled&&(this._recordingStatus!==q_&&this._recordingStatus!==V_&&(this._recordingStatus=H_),null!=ns&&null!=(t=ns.__PosthogExtensions__)&&null!=(t=t.rrweb)&&t.record&&null!=(r=ns.__PosthogExtensions__)&&r.initSessionRecording?this._onScriptLoaded(e):null==(i=ns.__PosthogExtensions__)||null==i.loadExternalDependency||i.loadExternalDependency(this._instance,this._scriptName,(t=>{if(t)return $_.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()}_discardRecording(){var e,t;null==(e=this._persistFlagsOnSessionListener)||e.call(this),this._persistFlagsOnSessionListener=void 0,null==(t=this._lazyLoadedSessionRecording)||t.discard()}_resetSampling(){var e;null==(e=this._persistence)||e.unregister(Gs)}_validateSampleRate(e,t){if(Jr(e))return null;var r,i=Qr(e)?e:parseFloat(e);return"number"!=typeof(r=i)||!Number.isFinite(r)||0>r||r>1?($_.warn(t+" must be between 0 and 1. Ignoring invalid value:",e),null):i}_persistRemoteConfig(e){if(this._persistence){var t,i,n=this._persistence,s=()=>{var t,i=!1===e.sessionRecording?void 0:e.sessionRecording,s=this._validateSampleRate(null==(t=this._config.session_recording)?void 0:t.sampleRate,"session_recording.sampleRate"),o=this._validateSampleRate(null==i?void 0:i.sampleRate,"remote config sampleRate"),a=null!=s?s:o;Jr(a)&&this._resetSampling();var l=null==i?void 0:i.minimumDurationMilliseconds;n.register({[Us]:r({cache_timestamp:Date.now(),enabled:!!i},i,{networkPayloadCapture:r({capturePerformance:e.capturePerformance},null==i?void 0:i.networkPayloadCapture),canvasRecording:{enabled:null==i?void 0:i.recordCanvas,fps:null==i?void 0:i.canvasFps,quality:null==i?void 0:i.canvasQuality},sampleRate:a,minimumDurationMilliseconds:Gr(l)?null:l,endpoint:null==i?void 0:i.endpoint,triggerMatchType:null==i?void 0:i.triggerMatchType,masking:null==i?void 0:i.masking,urlTriggers:null==i?void 0:i.urlTriggers,version:null==i?void 0:i.version,triggerGroups:null==i?void 0:i.triggerGroups})})};s(),null==(t=this._persistFlagsOnSessionListener)||t.call(this),this._persistFlagsOnSessionListener=null==(i=this._instance.sessionManager)?void 0:i.onSessionId(s)}}onRemoteConfig(e){return"sessionRecording"in e?!1===e.sessionRecording?(this._persistRemoteConfig(e),void this._discardRecording()):(this._persistRemoteConfig(e),void this.startIfEnabledOrStop()):(this._recordingStatus===q_&&(this._recordingStatus=V_,$_.warn("config refresh failed, recording will not start until page reload")),void this.startIfEnabledOrStop())}log(e,t){var r;void 0===t&&(t="log"),null!=(r=this._lazyLoadedSessionRecording)&&r.log?this._lazyLoadedSessionRecording.log(e,t):$_.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"}_isRemoteConfigFresh(){var e,t=this._instance.get_property(Us);if(!t)return!1;var r=null!==(e=("object"==typeof t?t:JSON.parse(t)).cache_timestamp)&&void 0!==e?e:Date.now();return 36e5>=Date.now()-r}_onScriptLoaded(e){var t,r;if(null==(t=ns.__PosthogExtensions__)||!t.initSessionRecording)return $_.warn("Called on script loaded before session recording is available. This can be caused by adblockers."),void this._instance.register_for_session({[Io]:!0});if(this._lazyLoadedSessionRecording||(this._lazyLoadedSessionRecording=null==(r=ns.__PosthogExtensions__)?void 0:r.initSessionRecording(this._instance),this._lazyLoadedSessionRecording._forceAllowLocalhostNetworkCapture=this._forceAllowLocalhostNetworkCapture),!this._isRemoteConfigFresh()){if(this._recordingStatus===V_||this._recordingStatus===q_)return;return this._recordingStatus=q_,$_.info("persisted remote config is stale, requesting fresh config before starting"),void new e_(this._instance).load()}this._recordingStatus=H_,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._persistence)||t.register({[js]:!0}),null==(e=this._lazyLoadedSessionRecording)||e.overrideLinkedFlag()}overrideSampling(){var e,t;this._lazyLoadedSessionRecording||null==(t=this._persistence)||t.register({[$s]:!0}),null==(e=this._lazyLoadedSessionRecording)||e.overrideSampling()}overrideTrigger(e){var t,r;this._lazyLoadedSessionRecording||null==(r=this._persistence)||r.register({["url"===e?zs:Ws]:!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))}}},bf={autocapture:class{constructor(e){this._initialized=!1,this._isDisabledServerSide=null,this._elementsChainAsString=!1,this.instance=e,this.rageclicks=new hg(e.config.rageclick),this._elementSelectors=null}initialize(){this.startIfEnabled()}get _config(){var e,t,r=Wr(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(Gn&&Kn){var e=e=>{e=e||(null==Gn?void 0:Gn.event);try{this._captureEvent(e)}catch(e){vg.error("Failed to capture event",e)}};if(bs(Kn,"submit",e,{capture:!0}),bs(Kn,"change",e,{capture:!0}),bs(Kn,"click",e,{capture:!0}),this._config.capture_copied_text){var t=e=>{this._captureEvent(e=e||(null==Gn?void 0:Gn.event),pg)};bs(Kn,"copy",t,{capture:!0}),bs(Kn,"cut",t,{capture:!0})}}}else vg.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({[As]:!!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[As];if(Kr(this._isDisabledServerSide)&&!ti(r)&&!this.instance._shouldDisableFlags())return!1;var i=null!==(t=this._isDisabledServerSide)&&void 0!==t?t:!!r;return!!this.instance.config.autocapture&&!i}_captureEvent(e,t){if(void 0===t&&(t="$autocapture"),this.isEnabled){var r,i=Zo(e);qo(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())&&function(e,t){if(!Gn||Qo(e))return!1;var r,i,n;if(ti(t)?(r=!!t&&Jo,i=void 0):(r=null!==(n=null==t?void 0:t.css_selector_ignorelist)&&void 0!==n?n:Jo,i=null==t?void 0:t.content_ignorelist),!1===r)return!1;var{targetElementList:s}=ea(e,!1);return!function(e,t){if(!1===e||Gr(e))return!1;var r;if(!0===e)r=Ko;else{if(!jr(e))return!1;if(e.length>10)return us.error("[PostHog] content_ignorelist array cannot exceed 10 items. Use css_selector_ignorelist for more complex matching."),!1;r=e.map((e=>e.toLowerCase()))}return t.some((e=>{var{safeText:t,ariaLabel:i}=e;return r.some((e=>t.includes(e)||i.includes(e)))}))}(i,s.map((e=>{var t;return{safeText:Wo(e).toLowerCase(),ariaLabel:(null==(t=e.getAttribute("aria-label"))?void 0:t.toLowerCase().trim())||""}})))&&!Yo(s,r)}(i,this.instance.config.rageclick)&&this._captureEvent(e,"$rageclick");var n=t===pg;if(i&&function(e,t,r,i,n){var s,o,a,l;if(void 0===r&&(r=void 0),!Gn||Qo(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}=ea(e,i);if(!function(e,t){var r=null==t?void 0:t.element_allowlist;if(Gr(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(!Yo(d,null==(l=r)?void 0:l.css_selector_allowlist))return!1;var h=Gn.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&&(Go.indexOf(p)>-1||"true"===e.getAttribute("contenteditable"))}}(i,e,this._config,n,n?["copy","cut"]:void 0)){var{props:s,explicitNoCapture:o}=fg(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===pg){var l,u=zo(null==Gn||null==(l=Gn.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 zr(null==Kn?void 0:Kn.querySelectorAll)}},historyAutocapture:class{constructor(e){var t;this._instance=e,this._lastPathname=(null==Gn||null==(t=Gn.location)?void 0:t.pathname)||""}initialize(){this.startIfEnabled()}get isEnabled(){return"history_change"===this._instance.config.capture_pageview}startIfEnabled(){this.isEnabled&&(us.info("History API monitoring enabled, starting..."),this.monitorHistoryChanges())}stop(){this._popstateListener&&this._popstateListener(),this._popstateListener=void 0,us.info("History API monitoring stopped")}monitorHistoryChanges(){var e,t;if(Gn&&Gn.history){var r=this;null!=(e=Gn.history.pushState)&&e.__posthog_wrapped__||Es(Gn.history,"pushState",(e=>function(t,i,n){e.call(this,t,i,n),r._capturePageview("pushState")})),null!=(t=Gn.history.replaceState)&&t.__posthog_wrapped__||Es(Gn.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==Gn||null==(t=Gn.location)?void 0:t.pathname;if(!r)return;r!==this._lastPathname&&this.isEnabled&&this._instance.capture(Ao,{navigation_type:e}),this._lastPathname=r}catch(t){us.error("Error capturing "+e+" pageview",t)}}_setupPopstateListener(){if(!this._popstateListener){var e=()=>{this._capturePageview("popstate")};bs(Gn,"popstate",e),this._popstateListener=()=>{Gn&&Gn.removeEventListener("popstate",e)}}}},heatmaps:class{get _config(){return this.instance.config}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[Fs]),this.rageclicks=new hg(e.config.rageclick)}initialize(){this.startIfEnabled()}get flushIntervalMilliseconds(){var e=5e3;return Wr(this._config.capture_heatmaps)&&this._config.capture_heatmaps.flush_interval_milliseconds&&(e=this._config.capture_heatmaps.flush_interval_milliseconds),e}get isEnabled(){return Jr(this._config.capture_heatmaps)?Jr(this._config.enable_heatmaps)?this._enabledServerSide:this._config.enable_heatmaps:!1!==this._config.capture_heatmaps}startIfEnabled(){if(this.isEnabled){if(this._initialized)return;j_.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){if("heatmaps"in e){var t=!!e.heatmaps;this.instance.persistence&&this.instance.persistence.register({[Fs]: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(){Gn&&Kn&&(this._flushHandler=this._flush.bind(this),bs(Gn,Po,this._flushHandler),this._onClickHandler=e=>this._onClick(e||(null==Gn?void 0:Gn.event)),bs(Kn,"click",this._onClickHandler,{capture:!0}),this._onMouseMoveHandler=e=>this._onMouseMove(e||(null==Gn?void 0:Gn.event)),bs(Kn,"mousemove",this._onMouseMoveHandler,{capture:!0}),this._deadClicksCapture=new kg(this.instance,Ig,this._onDeadClick.bind(this)),this._deadClicksCapture.startIfEnabledOrStop(),this._onVisibilityChange_handler=this._onVisibilityChange.bind(this),bs(Kn,Lo,this._onVisibilityChange_handler),this._initialized=!0)}_removeListeners(){var e;Gn&&Kn&&(this._flushHandler&&Gn.removeEventListener(Po,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(Lo,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&&Bo(i)&&!Ho(i,"body");){if(i===r)return!1;if(Br(t,null==Gn?void 0:Gn.getComputedStyle(i).position))return!0;i=Xo(i)}return!1}(Zo(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"),!Do(e.target)&&z_(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){!Do(e.target)&&z_(e)&&(clearTimeout(this._mouseMoveTimeout),this._mouseMoveTimeout=setTimeout((()=>{this._capture(this._getProperties(e,"mousemove"))}),500))}_capture(e){if(Gn){var t=Gn.location.href,r=this._config.custom_personal_data_properties,i=this._config.mask_personal_data_properties?[...Ng,...r||[]]:[],n=xs(t,i,Dg);this._buffer=this._buffer||{},this._buffer[n]||(this._buffer[n]=[]),this._buffer[n].push(e)}}_flush(){this._buffer&&!Zr(this._buffer)&&this.instance.capture("$$heatmap",{$heatmap_data:this.getAndClearBuffer()})}},deadClicksAutocapture:kg,webVitalsAutocapture:class{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(Gr(i))O_.error("Could not read session ID. Dropping metrics!");else{this._buffer=this._buffer||{url:void 0,metrics:[],firstMetricTimestamp:void 0};var n=this._currentURL();Gr(n)||(Jr(null==e?void 0:e.name)||Jr(null==e?void 0:e.value)?O_.error("Invalid metric received",e):!this._maxAllowedValue||this._maxAllowedValue>e.value?(this._buffer.url!==n&&(this._flushToCapture(),this._delayedFlushTimer=setTimeout(this._flushToCapture,this.flushToCaptureTimeoutMs)),Gr(this._buffer.url)&&(this._buffer.url=n),this._buffer.firstMetricTimestamp=Gr(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()):O_.error("Ignoring metric with value >= "+this._maxAllowedValue,e))}},this._startCapturing=()=>{if(!this._initialized){var e,t,r,i,n=ns.__PosthogExtensions__;Gr(n)||Gr(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):O_.error("web vitals callbacks not loaded - not starting")}},this._instance=e,this._enabledServerSide=!(null==(t=this._instance.persistence)||!t.props[Bs]),this.startIfEnabled()}get _perfConfig(){return this._instance.config.capture_performance}get allowedMetrics(){var e,t,r=Wr(this._perfConfig)?null==(e=this._perfConfig)?void 0:e.web_vitals_allowed_metrics:void 0;return Jr(r)?(null==(t=this._instance.persistence)?void 0:t.props[Vs])||["CLS","FCP","INP","LCP"]:r}get flushToCaptureTimeoutMs(){return(Wr(this._perfConfig)?this._perfConfig.web_vitals_delayed_flush_ms:void 0)||5e3}get useAttribution(){var e=Wr(this._perfConfig)?this._perfConfig.web_vitals_attribution:void 0;return null!=e&&e}get _maxAllowedValue(){var e=Wr(this._perfConfig)&&Qr(this._perfConfig.__web_vitals_max_value)?this._perfConfig.__web_vitals_max_value:D_;return e>0&&6e4>=e?D_:e}get isEnabled(){var e=null==Jn?void 0:Jn.protocol;if("http:"!==e&&"https:"!==e)return O_.info("Web Vitals are disabled on non-http/https protocols"),!1;var t=Wr(this._perfConfig)?this._perfConfig.web_vitals:ti(this._perfConfig)?this._perfConfig:void 0;return ti(t)?t:this._enabledServerSide}startIfEnabled(){this.isEnabled&&!this._initialized&&(O_.info("enabled, starting..."),this._loadScript(this._startCapturing))}onRemoteConfig(e){if("capturePerformance"in e){var t=Wr(e.capturePerformance)&&!!e.capturePerformance.web_vitals,r=Wr(e.capturePerformance)?e.capturePerformance.web_vitals_allowed_metrics:void 0;this._instance.persistence&&(this._instance.persistence.register({[Bs]:t}),this._instance.persistence.register({[Vs]:r})),this._enabledServerSide=t,this.startIfEnabled()}}_loadScript(e){var t,r;null!=(t=ns.__PosthogExtensions__)&&t.postHogWebVitalsCallbacks?e():null==(r=ns.__PosthogExtensions__)||null==r.loadExternalDependency||r.loadExternalDependency(this._instance,this.useAttribution?"web-vitals-with-attribution":"web-vitals",(t=>{t?O_.error("failed to load script",t):e()}))}_currentURL(){var e=Gn?Gn.location.href:void 0;if(e){var t=this._instance.config.custom_personal_data_properties,r=this._instance.config.mask_personal_data_properties?[...Ng,...t||[]]:[];return xs(e,r,Dg)}O_.error("Could not determine current URL")}}},wf={exceptionObserver:class{constructor(e){var t,r,i;this._startCapturing=()=>{var e;if(Gn&&this.isEnabled&&null!=(e=ns.__PosthogExtensions__)&&e.errorWrappingFunctions){var t=ns.__PosthogExtensions__.errorWrappingFunctions.wrapOnError,r=ns.__PosthogExtensions__.errorWrappingFunctions.wrapUnhandledRejection,i=ns.__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){F_.error("failed to start",e),this._stopCapturing()}}},this._instance=e,this._remoteEnabled=!(null==(t=this._instance.persistence)||!t.props[Ns]),this._rateLimiter=new ci({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:F_}),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 Wr(e)?t=r({},t,e):(Gr(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?(F_.info("enabled"),this._stopCapturing(),this._loadScript(this._startCapturing)):this._stopCapturing()}_loadScript(e){var t,r;null!=(t=ns.__PosthogExtensions__)&&t.errorWrappingFunctions&&e(),null==(r=ns.__PosthogExtensions__)||null==r.loadExternalDependency||r.loadExternalDependency(this._instance,"exception-autocapture",(t=>{if(t)return F_.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){"autocaptureExceptions"in e&&(this._remoteEnabled=!!e.autocaptureExceptions||!1,this._instance.persistence&&this._instance.persistence.register({[Ns]:this._remoteEnabled}),this._config=this._requiredConfig(),this.startIfEnabledOrStop())}onConfigChange(){this._config=this._requiredConfig()}captureException(e){var t,r,i,n=null!==(t=null==e||null==(r=e.$exception_list)||null==(r=r[0])?void 0:r.type)&&void 0!==t?t:"Exception";this._rateLimiter.consumeRateLimit(n)?F_.info("Skipping exception capture because of client rate limiting.",{exception:n}):null==(i=this._instance.exceptions)||i.sendExceptionEvent(e)}},exceptions:class{constructor(e){var t,r;this._suppressionRules=[],this._errorPropertiesBuilder=kv(),this._instance=e,this._suppressionRules=null!==(t=null==(r=this._instance.persistence)?void 0:r.get_property(Os))&&void 0!==t?t:[],this._exceptionStepsConfig=zn(this._getExceptionStepsConfig()),this._exceptionStepsBuffer=new Wn(this._exceptionStepsConfig)}onConfigChange(){this._exceptionStepsConfig=zn(this._getExceptionStepsConfig()),this._exceptionStepsBuffer.setConfig(this._exceptionStepsConfig)}onRemoteConfig(e){var t,r,i;if("errorTracking"in e){var n=null!==(t=null==(r=e.errorTracking)?void 0:r.suppressionRules)&&void 0!==t?t:[],s=null==(i=e.errorTracking)?void 0:i.captureExtensionExceptions;this._suppressionRules=n,this._instance.persistence&&this._instance.persistence.register({[Os]:this._suppressionRules,[Ds]:s})}}get _captureExtensionExceptions(){var e,t=!!this._instance.get_property(Ds),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}})}addExceptionStep(e,t){if(this._exceptionStepsConfig.enabled)try{if(!Yr(e)||0===e.trim().length)return void xv.warn("Ignoring exception step because message must be a non-empty string");var i=this._coerceExceptionStepProperties(t),{sanitizedProperties:n,droppedKeys:s}=function(e){if(!e)return{sanitizedProperties:{},droppedKeys:[]};var t=[];return{sanitizedProperties:Object.keys(e).reduce(((r,i)=>$n.has(i)?(t.push(i),r):(r[i]=e[i],r)),{}),droppedKeys:t}}(i);s.length>0&&xv.warn("Ignoring reserved exception step fields",{droppedKeys:s}),this._exceptionStepsBuffer.add(r({[Vn]:e,[Un]:(new Date).toISOString()},n))}catch(e){xv.error("Failed to add exception step. Ignoring breadcrumb.",e)}}sendExceptionEvent(e){try{var t=e.$exception_list;if(this._isExceptionList(t)){if(this._matchesSuppressionRule(t))return this._addDroppedExceptionStep("Exception dropped: matched a suppression rule"),void xv.info("Skipping exception capture because a suppression rule matched");if(!this._captureExtensionExceptions&&this._isExtensionException(t))return this._addDroppedExceptionStep("Exception dropped: thrown by a browser extension"),void xv.info("Skipping exception capture because it was thrown by an extension");if(!this._instance.config.error_tracking.__capturePostHogExceptions&&this._isPostHogException(t))return this._addDroppedExceptionStep("Exception dropped: thrown by the PostHog SDK"),void xv.info("Skipping exception capture because it was thrown by the PostHog SDK")}var r=this._exceptionStepsConfig.enabled&&Jr(e.$exception_steps)?this._addBufferedExceptionSteps(e):e;try{var i=this._instance.capture("$exception",r,{_noTruncate:!0,_batchKey:"exceptionEvent",_originatedFromCaptureException:!0});return i&&this._exceptionStepsBuffer.clear(),i}catch(e){return xv.error("Failed to capture exception event. Dropping this exception.",e),void this._exceptionStepsBuffer.clear()}}catch(e){return void xv.error("Failed to process exception event. Ignoring this exception.",e)}}_addBufferedExceptionSteps(e){try{var t=this._exceptionStepsBuffer.getAttachable();return 0===t.length?e:r({},e,{$exception_steps:t})}catch(t){return xv.error("Failed to read buffered exception steps. Capturing exception without steps.",t),e}}_addDroppedExceptionStep(e){this._exceptionStepsConfig.enabled&&this._exceptionStepsBuffer.add({[Vn]:e,[Un]:(new Date).toISOString()})}_coerceExceptionStepProperties(e){return Wr(e)?r({},e):{}}_getExceptionStepsConfig(){var e,t;return null!==(e=null==(t=this._instance.config.error_tracking)?void 0:t.exception_steps)&&void 0!==e?e:{}}_matchesSuppressionRule(e){if(0===e.length)return!1;var t=e.reduce(((e,t)=>{var{type:r,value:i}=t;return Yr(r)&&r.length>0&&e.$exception_types.push(r),Yr(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=dc[e.operator],n=jr(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!Jr(e)&&jr(e)}}},Sf=r({productTours:class{get _persistence(){return this._instance.persistence}constructor(e){this._productTourManager=null,this._cachedTours=null,this._instance=e}initialize(){this.loadIfEnabled()}onRemoteConfig(e){"productTours"in e&&(this._persistence&&this._persistence.register({[qs]:!!e.productTours}),this.loadIfEnabled())}loadIfEnabled(){var e,t;this._productTourManager||(e=this._instance).config.disable_product_tours||null==(t=e.persistence)||!t.get_property(qs)||this._loadScript((()=>this._startProductTours()))}_loadScript(e){var t,r;null!=(t=ns.__PosthogExtensions__)&&t.generateProductTours?e():null==(r=ns.__PosthogExtensions__)||null==r.loadExternalDependency||r.loadExternalDependency(this._instance,"product-tours",(t=>{t?W_.error("Could not load product tours script",t):e()}))}_startProductTours(){var e;!this._productTourManager&&null!=(e=ns.__PosthogExtensions__)&&e.generateProductTours&&(this._productTourManager=ns.__PosthogExtensions__.generateProductTours(this._instance,!0))}getProductTours(e,t){if(void 0===t&&(t=!1),!jr(this._cachedTours)||t){var r=this._persistence;if(r){var i=r.props[ao];if(jr(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 W_.error(n),void e([],{isLoaded:!1,error:n})}var s=jr(t.json.product_tours)?t.json.product_tours:[];this._cachedTours=s,r&&r.register({[ao]:s}),e(s,{isLoaded:!0})}})}else e(this._cachedTours,{isLoaded:!0})}getActiveProductTours(e){Jr(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._persistence)||e.unregister(ao)}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)}}},mf),Cf={siteApps:class{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=ns._POSTHOG_REMOTE_CONFIG)||null==(e=e[this._instance.config.token])?void 0:e.siteApps}initialize(){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,Z_),{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&&(G_.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,G_.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){G_.error(Y_+e.id,t),n(!1)}if(i&&t.loaded)try{r()}catch(r){G_.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){G_.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 G_.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;ns["__$$ph_site_app_"+e]=n._instance,null==(t=ns.__PosthogExtensions__)||null==t.loadSiteApp||t.loadSiteApp(n._instance,a,(t=>{if(t)return G_.error(Y_+e,t)}))};for(var{id:o,url:a}of e.siteApps)s(o)}else G_.error('PostHog site apps are disabled. Enable the "opt_in_site_apps" config to proceed.')}}},If={tracingHeaders:class{constructor(e){this._restoreXHRPatch=void 0,this._restoreFetchPatch=void 0,this._startCapturing=()=>{var e,t,r=this._getConfiguredHostnames()||[];Gr(this._restoreXHRPatch)&&(null==(e=ns.__PosthogExtensions__)||null==(e=e.tracingHeadersPatchFns)||e._patchXHR(r,this._instance.get_distinct_id(),this._instance.sessionManager)),Gr(this._restoreFetchPatch)&&(null==(t=ns.__PosthogExtensions__)||null==(t=t.tracingHeadersPatchFns)||t._patchFetch(r,this._instance.get_distinct_id(),this._instance.sessionManager))},this._instance=e}initialize(){this.startIfEnabledOrStop()}_loadScript(e){var t,r;null!=(t=ns.__PosthogExtensions__)&&t.tracingHeadersPatchFns&&e(),null==(r=ns.__PosthogExtensions__)||null==r.loadExternalDependency||r.loadExternalDependency(this._instance,"tracing-headers",(t=>{if(t)return N_.error("failed to load script",t);e()}))}_getConfiguredHostnames(){var e;return null!==(e=this._instance.config.addTracingHeaders)&&void 0!==e?e:this._instance.config.__add_tracing_headers}startIfEnabledOrStop(){var e,t;this._getConfiguredHostnames()?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)}}},xf=r({surveys:class{get _config(){return this._instance.config}constructor(e){this._isSurveysEnabled=void 0,this._surveyManager=null,this._isInitializingSurveys=!1,this._surveyCallbacks=[],this._getSurveysInFlightPromise=null,this._instance=e,this._surveyEventReceiver=null}initialize(){this.loadIfEnabled()}onRemoteConfig(e){if(!this._config.disable_surveys){var t=e.surveys;if(Jr(t))return tu.warn("Flags not loaded yet. Not loading surveys.");var r=jr(t);this._isSurveysEnabled=r?t.length>0:t,tu.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(su)||null!=r&&r.startsWith(ou))&&e.push(r)}e.forEach((e=>localStorage.removeItem(e)))}loadIfEnabled(){if(!this._surveyManager)if(this._isInitializingSurveys)tu.info("Already initializing surveys, skipping...");else if(this._config.disable_surveys)tu.info(tf);else if(this._config.cookieless_mode&&this._instance.consent.isOptedOut())tu.info("Not loading surveys in cookieless mode without consent.");else{var e=null==ns?void 0:ns.__PosthogExtensions__;if(e){if(!Gr(this._isSurveysEnabled)||this._config.advanced_enable_surveys){var t=this._isSurveysEnabled||this._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(xo);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 tu.error("PostHog Extensions not found.")}}_completeSurveyInitialization(e,t){this._surveyManager=e(this._instance,t),this._surveyEventReceiver=new Q_(this._instance),tu.info("Surveys loaded successfully"),this._notifySurveyCallbacks({isLoaded:!0})}_handleSurveyLoadError(e,t){tu.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._config.disable_surveys)return tu.info(tf),e([]);var r,i=this._instance.get_property(so);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._config.token),method:"GET",timeout:this._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;tu.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=>ru(e)&&(iu(e)||nu(e))));u.length>0&&(null==(a=this._surveyEventReceiver)||a.register(u)),null==(i=this._instance.persistence)||i.register({[so]: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){tu.error("Error in survey callback",e)}}getActiveMatchingSurveys(e,t){if(void 0===t&&(t=!1),!Jr(this._surveyManager))return this._surveyManager.getActiveMatchingSurveys(e,t);tu.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(Jr(this._surveyManager))return{eligible:!1,reason:ef};var t="string"==typeof e?this._getSurveyById(e):e;return t?this._surveyManager.checkSurveyEligibility(t):{eligible:!1,reason:"Survey not found"}}canRenderSurvey(e){if(Jr(this._surveyManager))return tu.warn("init was not called"),{visible:!1,disabledReason:ef};var t=this._checkSurveyEligibility(e);return{visible:t.eligible,disabledReason:t.reason}}canRenderSurveyAsync(e,t){return Jr(this._surveyManager)?(tu.warn("init was not called"),Promise.resolve({visible:!1,disabledReason:ef})):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,r){var i;if(Jr(this._surveyManager))tu.warn("init was not called");else{var n="string"==typeof e?this._getSurveyById(e):e;if(null!=n&&n.id)if(du.includes(n.type)){var s=null==Kn?void 0:Kn.querySelector(t);if(s)return null!=(i=n.appearance)&&i.surveyPopupDelaySeconds?(tu.info("Rendering survey "+n.id+" with delay of "+n.appearance.surveyPopupDelaySeconds+" seconds"),void setTimeout((()=>{var e,t;tu.info("Rendering survey "+n.id+" with delay of "+(null==(e=n.appearance)?void 0:e.surveyPopupDelaySeconds)+" seconds"),null==(t=this._surveyManager)||t.renderSurvey(n,s,r),tu.info("Survey "+n.id+" rendered")}),1e3*n.appearance.surveyPopupDelaySeconds)):void this._surveyManager.renderSurvey(n,s,r);tu.warn("Survey element not found")}else tu.warn("Surveys of type "+n.type+" cannot be rendered in the app");else tu.warn("Survey not found")}}displaySurvey(e,t){var i;if(Jr(this._surveyManager))tu.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})})),t.displayType!==eu&&t.initialResponses&&tu.warn("initialResponses is only supported for popover surveys. prefill will not be applied."),!1===t.ignoreConditions){var o=this.canRenderSurvey(n);if(!o.visible)return void tu.warn("Survey is not eligible to be displayed: ",o.disabledReason)}"inline"!==t.displayType?this._surveyManager.handlePopoverSurvey(s,t):this.renderSurvey(s,t.selector,t.properties)}else tu.warn("Survey not found")}}cancelPendingSurvey(e){Jr(this._surveyManager)?tu.warn("init was not called"):this._surveyManager.cancelSurvey(e)}handlePageUnload(){var e;null==(e=this._surveyManager)||e.handlePageUnload()}}},mf),kf={toolbar:class{constructor(e){this.instance=e}_setToolbarState(e){ns.ph_toolbar_state=e}_getToolbarState(){var e;return null!==(e=ns.ph_toolbar_state)&&void 0!==e?e:0}initialize(){return this.maybeLoadToolbar()}maybeLoadToolbar(e,t,r){if(void 0===e&&(e=void 0),void 0===t&&(t=void 0),void 0===r&&(r=void 0),ws(this.instance.config))return!1;if(!Gn||!Kn)return!1;e=null!=e?e:Gn.location,r=null!=r?r:Gn.history;try{if(!t){try{Gn.localStorage.setItem("test","test"),Gn.localStorage.removeItem("test")}catch(e){return!1}t=null==Gn?void 0:Gn.localStorage}var i,n=rf||ks(e.hash,"__posthog")||ks(e.hash,"state"),s=n?gs((()=>JSON.parse(atob(decodeURIComponent(n)))))||gs((()=>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(nf)||"{}")).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=ns.ph_load_toolbar||ns.ph_load_editor;!Jr(t)&&zr(t)?t(e,this.instance):sf.warn("No toolbar load function found")}loadToolbar(e){var t=!(null==Kn||!Kn.getElementById(bo));if(!Gn||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(Gn.localStorage.setItem(nf,JSON.stringify(r({},n,{source:void 0}))),2===this._getToolbarState())this._callLoadToolbar(n);else if(0===this._getToolbarState()){var s;this._setToolbarState(1),null==(s=ns.__PosthogExtensions__)||null==s.loadExternalDependency||s.loadExternalDependency(this.instance,"toolbar",(e=>{if(e)return sf.error("[Toolbar] Failed to load",e),void this._setToolbarState(0);this._setToolbarState(2),this._callLoadToolbar(n)})),bs(Gn,"turbolinks:load",(()=>{this._setToolbarState(0),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)}}},Ef=r({experiments:pf},mf),Tf={conversations:class{constructor(e){this._isConversationsEnabled=void 0,this._conversationsManager=null,this._isInitializing=!1,this._remoteConfig=null,this._instance=e}initialize(){this.loadIfEnabled()}onRemoteConfig(e){if(!this._instance.config.disable_conversations){var t=e.conversations;Jr(t)||(ti(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||ws(this._instance.config)||this._instance.config.cookieless_mode&&this._instance.consent.isOptedOut())){var e=null==ns?void 0:ns.__PosthogExtensions__;if(e&&!Gr(this._isConversationsEnabled)&&this._isConversationsEnabled)if(this._remoteConfig&&this._remoteConfig.token){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(xo);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 _f.error("Conversations enabled but missing token in remote config.")}}_completeInitialization(e){if(this._remoteConfig)try{this._conversationsManager=e(this._remoteConfig,this._instance),_f.info("Conversations loaded successfully")}catch(e){this._handleLoadError("Error completing conversations initialization",e)}else _f.error("Cannot complete initialization: remote config is null")}_handleLoadError(e,t){_f.error(e,t),this._conversationsManager=null,this._isInitializing=!1}show(){this._conversationsManager?this._conversationsManager.show():_f.warn("Conversations not loaded yet.")}hide(){this._conversationsManager&&this._conversationsManager.hide()}isAvailable(){return!0===this._isConversationsEnabled&&!Kr(this._conversationsManager)}isVisible(){var e,t;return null!==(e=null==(t=this._conversationsManager)?void 0:t.isVisible())&&void 0!==e&&e}sendMessage(e,r,i){var n=this;return t((function*(){return n._conversationsManager?n._conversationsManager.sendMessage(e,r,i):(_f.warn(ff),null)}))()}getMessages(e,r){var i=this;return t((function*(){return i._conversationsManager?i._conversationsManager.getMessages(e,r):(_f.warn(ff),null)}))()}markAsRead(e){var r=this;return t((function*(){return r._conversationsManager?r._conversationsManager.markAsRead(e):(_f.warn(ff),null)}))()}getTickets(e){var r=this;return t((function*(){return r._conversationsManager?r._conversationsManager.getTickets(e):(_f.warn(ff),null)}))()}requestRestoreLink(e){var r=this;return t((function*(){return r._conversationsManager?r._conversationsManager.requestRestoreLink(e):(_f.warn(ff),null)}))()}restoreFromToken(e){var r=this;return t((function*(){return r._conversationsManager?r._conversationsManager.restoreFromToken(e):(_f.warn(ff),null)}))()}restoreFromUrlToken(){var e=this;return t((function*(){return e._conversationsManager?e._conversationsManager.restoreFromUrlToken():(_f.warn(ff),null)}))()}getCurrentTicketId(){var e,t;return null!==(e=null==(t=this._conversationsManager)?void 0:t.getCurrentTicketId())&&void 0!==e?e:null}getWidgetSessionId(){var e,t;return null!==(e=null==(t=this._conversationsManager)?void 0:t.getWidgetSessionId())&&void 0!==e?e:null}_onIdentityChanged(){var e;null==(e=this._conversationsManager)||e.setIdentity()}_onIdentityCleared(){var e;null==(e=this._conversationsManager)||e.clearIdentity()}}},Rf={logs:class{constructor(e){var t;this._isLogsEnabled=!1,this._isLoaded=!1,this._logger=cs("[logs]"),this._logBuffer=[],this._intervalLogCount=0,this._intervalWindowStart=0,this._droppedWarned=!1,this._instance=e,this._instance&&null!=(t=this._instance.config.logs)&&t.captureConsoleLogs&&(this._isLogsEnabled=!0)}initialize(){this.loadIfEnabled()}onRemoteConfig(e){var t,r=null==(t=e.logs)?void 0:t.captureConsoleLogs;!Jr(r)&&r&&(this._isLogsEnabled=!0,this.loadIfEnabled())}reset(){this._logBuffer=[],this._flushTimeout&&(clearTimeout(this._flushTimeout),this._flushTimeout=void 0),this._intervalLogCount=0,this._intervalWindowStart=0,this._droppedWarned=!1}loadIfEnabled(){if(this._isLogsEnabled&&!this._isLoaded){var e=null==ns?void 0:ns.__PosthogExtensions__;if(e){var t=e.loadExternalDependency;t?t(this._instance,"logs",(t=>{var r;t||null==(r=e.logs)||!r.initializeLogs?this._logger.error("Could not load logs script",t):(e.logs.initializeLogs(this._instance),this._isLoaded=!0)})):this._logger.error(xo)}else this._logger.error("PostHog Extensions not found.")}}captureLog(e){var t,i,n,s,o,a;if(this._instance.is_capturing())if(e&&e.body){var l=null!==(t=null==(i=this._instance.config.logs)?void 0:i.flushIntervalMs)&&void 0!==t?t:3e3,u=null!==(n=null==(s=this._instance.config.logs)?void 0:s.maxLogsPerInterval)&&void 0!==n?n:1e3,c=Date.now();if(l>c-this._intervalWindowStart||(this._intervalWindowStart=c,this._intervalLogCount=0,this._droppedWarned=!1),u>this._intervalLogCount){this._intervalLogCount++;var d=function(e,t){var i=e.level||"info",{text:n,number:s}=dn[i]||hn,o=String(Date.now())+"000000",a={};t.distinctId&&(a.posthogDistinctId=t.distinctId),t.sessionId&&(a.sessionId=t.sessionId),t.currentUrl&&(a["url.full"]=t.currentUrl),t.screenName&&(a["screen.name"]=t.screenName),t.appState&&(a["app.state"]=t.appState),t.activeFeatureFlags&&t.activeFeatureFlags.length>0&&(a.feature_flags=t.activeFeatureFlags);var l=r({},a,e.attributes||{}),u={timeUnixNano:o,observedTimeUnixNano:o,severityNumber:s,severityText:n,body:{stringValue:e.body},attributes:vn(l)};return e.trace_id&&(u.traceId=e.trace_id),e.span_id&&(u.spanId=e.span_id),Gr(e.trace_flags)||(u.flags=e.trace_flags),u}(e,this._getSdkContext());this._logBuffer.push({record:d}),(null!==(o=null==(a=this._instance.config.logs)?void 0:a.maxBufferSize)&&void 0!==o?o:100)>this._logBuffer.length?this._scheduleFlush():this.flushLogs()}else this._droppedWarned||(this._logger.warn("captureLog dropping logs: exceeded "+u+" logs per "+l+"ms"),this._droppedWarned=!0)}else this._logger.warn("captureLog requires a body")}get logger(){return this._logger_instance||(this._logger_instance={trace:(e,t)=>this.captureLog({body:e,level:"trace",attributes:t}),debug:(e,t)=>this.captureLog({body:e,level:"debug",attributes:t}),info:(e,t)=>this.captureLog({body:e,level:"info",attributes:t}),warn:(e,t)=>this.captureLog({body:e,level:"warn",attributes:t}),error:(e,t)=>this.captureLog({body:e,level:"error",attributes:t}),fatal:(e,t)=>this.captureLog({body:e,level:"fatal",attributes:t})}),this._logger_instance}flushLogs(e){if(this._flushTimeout&&(clearTimeout(this._flushTimeout),this._flushTimeout=void 0),0!==this._logBuffer.length){var t=this._logBuffer;this._logBuffer=[];var i=this._instance.config.logs,n=r({"service.name":(null==i?void 0:i.serviceName)||"unknown_service"},(null==i?void 0:i.environment)&&{"deployment.environment":i.environment},(null==i?void 0:i.serviceVersion)&&{"service.version":i.serviceVersion},null==i?void 0:i.resourceAttributes),s=function(e,t,r,i){return{resourceLogs:[{resource:{attributes:vn(t)},scopeLogs:[{scope:{name:r,version:i},logRecords:e}]}]}}(t.map((e=>e.record)),n,as.LIB_NAME,as.LIB_VERSION),o=this._instance.requestRouter.endpointFor("api","/i/v1/logs")+"?token="+encodeURIComponent(this._instance.config.token);this._instance._send_retriable_request({method:"POST",url:o,data:s,compression:"best-available",batchKey:"logs",transport:e})}}_scheduleFlush(){var e,t;this._flushTimeout||(this._flushTimeout=setTimeout((()=>{this._flushTimeout=void 0,this.flushLogs()}),null!==(e=null==(t=this._instance.config.logs)?void 0:t.flushIntervalMs)&&void 0!==e?e:3e3))}_getSdkContext(){var e,t={};if(t.distinctId=this._instance.get_distinct_id(),this._instance.sessionManager){var{sessionId:r}=this._instance.sessionManager.checkAndGetSessionAndWindowId(!0);t.sessionId=r}if(null!=ns&&null!=(e=ns.location)&&e.href&&(t.currentUrl=ns.location.href),this._instance.featureFlags){var i=this._instance.featureFlags.getFlags();i&&i.length>0&&(t.activeFeatureFlags=i)}return t}}},Mf=r({},mf,yf,bf,wf,Sf,Cf,xf,If,kf,Ef,Tf,Rf);A_.__defaultExtensionClasses=r({},Mf),vf=b_[E_]=new A_,(gf=ns.posthog)&&hs(gf._i,(function(e){if(e&&jr(e)){var t=vf.init(e[0],e[1],e[2]),r=gf[e[2]]||gf;t&&(t._execute_array.call(t.people,r.people),t._execute_array(r))}})),ns.posthog=vf,function(){function e(){e.done||(e.done=!0,T_=!1,hs(b_,(function(e){e._dom_loaded()})))}null!=Kn&&Kn.addEventListener?"complete"===Kn.readyState?e():bs(Kn,"DOMContentLoaded",e,{capture:!1}):Gn&&us.error("Browser doesn't support `document.addEventListener` so PostHog couldn't be initialized")}()}();
1
+ !function(){"use strict";function e(e,t,r,i,n,s,o){try{var a=e[s](o),l=a.value}catch(e){return void r(e)}a.done?t(l):Promise.resolve(l).then(i,n)}function t(t){return function(){var r=this,i=arguments;return new Promise((function(n,s){var o=t.apply(r,i);function a(t){e(o,n,s,a,l,"next",t)}function l(t){e(o,n,s,a,l,"throw",t)}a(void 0)}))}}function r(){return r=Object.assign?Object.assign.bind():function(e){for(var t=1;arguments.length>t;t++){var r=arguments[t];for(var i in r)({}).hasOwnProperty.call(r,i)&&(e[i]=r[i])}return e},r.apply(null,arguments)}function i(e,t){if(null==e)return{};var r={};for(var i in e)if({}.hasOwnProperty.call(e,i)){if(-1!==t.indexOf(i))continue;r[i]=e[i]}return r}var n,s=["type"],o=Object.defineProperty,a=(e,t,r)=>((e,t,r)=>t in e?o(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r)(e,"symbol"!=typeof t?t+"":t,r),l=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"]},p={};function g(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 _={};function v(e,t,r){var i,n=e+"."+String(r);if(_[n])return _[n].call(t);var s=g(e),o=null==(i=Object.getOwnPropertyDescriptor(s,r))?void 0:i.get;return o?(_[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=g(e)[r];return"function"!=typeof n?t[r]:(f[i]=n,n.bind(t))}var y={childNodes:e=>v("Node",e,"childNodes"),parentNode:e=>v("Node",e,"parentNode"),parentElement:e=>v("Node",e,"parentElement"),textContent:e=>v("Node",e,"textContent"),contains:(e,t)=>m("Node",e,"contains")(t),getRootNode:e=>m("Node",e,"getRootNode")(),host:e=>e&&"host"in e?v("ShadowRoot",e,"host"):null,styleSheets:e=>e.styleSheets,shadowRoot:e=>e&&"shadowRoot"in e?v("Element",e,"shadowRoot"):null,querySelector:(e,t)=>v("Element",e,"querySelector")(t),querySelectorAll:(e,t)=>v("Element",e,"querySelectorAll")(t),mutationObserver:()=>g("MutationObserver").constructor};function b(e){return e.nodeType===e.ELEMENT_NODE}function w(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 S(e){return"[object ShadowRoot]"==={}.toString.call(e)}function C(e){try{var t=e.rules||e.cssRules;return t?((r=Array.from(t,(t=>I(t,e.href))).join("")).includes(" background-clip: text;")&&!r.includes(" -webkit-background-clip: text;")&&(r=r.replace(/\sbackground-clip:\s*text;/g," -webkit-background-clip: text; background-clip: text;")),r):null}catch(e){return null}var r}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(3>t.split('"').length)return t;var r=["@import","url("+JSON.stringify(e.href)+")"];return""===e.layerName?r.push("layer"):e.layerName&&r.push("layer("+e.layerName+")"),e.supportsText&&r.push("supports("+e.supportsText+")"),e.media.length&&r.push(e.media.mediaText),r.join(" ")+";"}(e)}catch(t){r=e.cssText}return e.styleSheet.href?O(r,e.styleSheet.href):r}var i=e.cssText;return function(e){return"selectorText"in e}(e)&&e.selectorText.includes(":")&&(i=i.replace(/(\[(?:[\w-]+)[^\\])(:(?:[\w-]+)\])/gm,"$1\\$2")),t?O(i,t):i}function k(e,t){return Array.from(e.styleSheets).find((e=>e.href===t))}let x=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){this.idNodeMap.set(t.id,e),this.nodeMetaMap.set(e,t)}replace(e,t){var r=this.getNode(e);if(r){var i=this.nodeMetaMap.get(r);i&&this.nodeMetaMap.set(t,i)}this.idNodeMap.set(e,t)}reset(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap}};function E(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 R="__rrweb_original__";function M(e){var t=e.type;return e.hasAttribute("data-rr-is-password")?"password":t?T(t):null}function L(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 P=/url\((?:(')([^']*)'|(")(.*?)"|([^)]*))\)/gm,A=/^(?:[a-z+]+:)?\/\//i,F=/^www\..*/i,N=/^(data:)([^,]*),(.*)/i;function O(e,t){return(e||"").replace(P,((e,r,i,n,s,o)=>{var a,l=i||s||o,u=r||n||"";if(!l)return e;if(A.test(l)||F.test(l))return"url("+u+l+u+")";if(N.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,B,H=1,q=new RegExp("[^a-z0-9-_:]"),z=-2;function V(){return H++}var U=/^[^ \t\n\r\u000c]+/,W=/^[, \t\n\r\u000c]+/,j=new WeakMap;function G(e,t){return t&&""!==t.trim()?Z(e,t):t}function Z(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 Y(e,t,r,i){return i?"src"===r||"href"===r&&("use"!==t||"#"!==i[0])||"xlink:href"===r&&"#"!==i[0]?G(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?(r+=(i=n[0]).length,i):""}for(var n=[];i(W),t.length>r;){var s=i(U);if(","===s.slice(-1))s=G(e,s.substring(0,s.length-1)),n.push(s);else{var o="";s=G(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,Z(e)):"object"===t&&"data"===r?G(e,i):i:G(e,i):i}function X(e,t,r){return("video"===e||"audio"===e)&&"autoplay"===t}function K(e,t,r){if(!e)return!1;if(e.nodeType!==e.ELEMENT_NODE)return!!r&&K(y.parentNode(e),t,r);for(var i=e.classList.length;i--;)if(t.test(e.classList[i]))return!0;return!!r&&K(y.parentNode(e),t,r)}function J(e,t,r,i){var n;if(b(e)){if(!y.childNodes(n=e).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(K(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 Q(e){return null==e?"":e.toLowerCase()}function ee(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:g,dataURLOptions:_={},inlineImages:v=!1,recordCanvas:f=!1,onSerialize:m,onIframeLoad:I,iframeLoadTimeout:x=5e3,onStylesheetLoad:P,stylesheetLoadTimeout:A=5e3,keepIframeSrcFn:F=(()=>!1),newlyAddedElement:N=!1}=t,{needsMask:H}=t,{preserveWhiteSpace:U=!0}=t;H||(H=J(e,o,a,void 0===H));var W,j=function(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:g,keepIframeSrcFn:_,newlyAddedElement:v=!1}=t,f=function(e,t){if(t.hasNode(e)){var r=t.getId(e);return 1===r?void 0:r}}(r,i);switch(e.nodeType){case e.DOCUMENT_NODE:return"CSS1Compat"!==e.compatMode?{type: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:g=!1,rootId:_}=t,v=function(e,t,r){try{if("string"==typeof t){if(e.classList.contains(t))return!0}else for(var i=e.classList.length;i--;)if(t.test(e.classList[i]))return!0;if(r)return e.matches(r)}catch(e){}return!1}(e,n,s),f=function(e){if(e instanceof HTMLFormElement)return"form";var t=T(e.tagName);return q.test(t)?"div":t}(e),m={},b=e.attributes.length,w=0;b>w;w++){var S=e.attributes[w];X(f,S.name)||(m[S.name]=Y(i,f,T(S.name),S.value))}if("link"===f&&o){var I=function(e){return null==e?void 0:e.href}(e);if(I){var x=k(i,I);!x&&I.includes(".css")&&(x=k(i,window.location.origin+"/"+I.replace(window.location.href,"")));var L=null;x&&(L=C(x)),L&&(delete m.rel,delete m.href,m._cssText=L)}}if("style"===f&&e.sheet&&!(e.innerText||y.textContent(e)||"").trim().length){var P=C(e.sheet);P&&(m._cssText=P)}if("input"===f||"textarea"===f||"select"===f){var A=e.value,F=e.checked;"radio"!==m.type&&"checkbox"!==m.type&&"submit"!==m.type&&"button"!==m.type&&A?m.value=E({element:e,type:M(e),tagName:f,value:A,maskInputOptions:a,maskInputFn:l}):F&&(m.checked=F)}if("option"===f&&(e.selected&&!a.select?m.selected=!0:delete m.selected),"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;e.width>r;r+=50)for(var i=0;e.height>i;i+=50){var n=t.getImageData;if(new Uint32Array((R in n?n[R]:n).call(t,r,i,Math.min(50,e.width-r),Math.min(50,e.height-i)).data.buffer).some((e=>0!==e)))return!1}return!0})(e)||(m.rr_dataURL=e.toDataURL(u.type,u.quality));else if(!("__context"in e)){var N=e.toDataURL(u.type,u.quality),O=i.createElement("canvas");O.width=e.width,O.height=e.height,N!==O.toDataURL(u.type,u.quality)&&(m.rr_dataURL=N)}if("img"===f&&d){D||(D=i.createElement("canvas"),B=D.getContext("2d"));var H=e,z=H.currentSrc||H.getAttribute("src")||"<unknown-src>",V=H.crossOrigin,U=()=>{H.removeEventListener("load",U);try{D.width=H.naturalWidth,D.height=H.naturalHeight,B.drawImage(H,0,0),m.rr_dataURL=D.toDataURL(u.type,u.quality)}catch(e){if("anonymous"!==H.crossOrigin)return H.crossOrigin="anonymous",void(H.complete&&0!==H.naturalWidth?U():H.addEventListener("load",U));console.warn("Cannot inline img src="+z+"! Error: "+e)}"anonymous"===H.crossOrigin&&(V?m.crossOrigin=V:H.removeAttribute("crossorigin"))};H.complete&&0!==H.naturalWidth?U():H.addEventListener("load",U)}if("audio"===f||"video"===f){var W=m;W.rr_mediaState=e.paused?"paused":"played",W.rr_mediaCurrentTime=e.currentTime,W.rr_mediaPlaybackRate=e.playbackRate,W.rr_mediaMuted=e.muted,W.rr_mediaLoop=e.loop,W.rr_mediaVolume=e.volume}if(g||(e.scrollLeft&&(m.rr_scrollLeft=e.scrollLeft),e.scrollTop&&(m.rr_scrollTop=e.scrollTop)),v){var{width:j,height:G}=e.getBoundingClientRect();m={class:m.class,rr_width:j+"px",rr_height:G+"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:(Z=e,Boolean("svg"===Z.tagName||Z.ownerSVGElement)||void 0),needBlock:v,rootId:_,isCustom:r};var Z}(e,{doc:r,blockClass:n,blockSelector:s,inlineStylesheet:a,maskInputOptions:l,maskInputFn:d,dataURLOptions:h,inlineImages:p,recordCanvas:g,keepIframeSrcFn:_,newlyAddedElement:v,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,Z(t.doc))}return d&&(l="SCRIPT_PLACEHOLDER"),!u&&!d&&l&&i&&(l=n?n(l,y.parentElement(e)):l.replace(/[\S]/g,"*")),{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}}(e,{doc:r,mirror:i,blockClass:n,blockSelector:s,needsMask:H,inlineStylesheet:u,maskInputOptions:d,maskTextFn:h,maskInputFn:p,dataURLOptions:_,inlineImages:v,recordCanvas:f,keepIframeSrcFn:F,newlyAddedElement:N});if(!j)return console.warn(e,"not serialized"),null;W=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"===L(e.attributes.href)))return!0;if(t.headFavicon&&("link"===e.tagName&&"shortcut icon"===e.attributes.rel||"meta"===e.tagName&&(Q(e.attributes.name).match(/^msapplication-tile(image|color)$/)||"application-name"===Q(e.attributes.name)||"icon"===Q(e.attributes.rel)||"apple-touch-icon"===Q(e.attributes.rel)||"shortcut icon"===Q(e.attributes.rel))))return!0;if("meta"===e.tagName){if(t.headMetaDescKeywords&&Q(e.attributes.name).match(/^description|keywords$/))return!0;if(t.headMetaSocial&&(Q(e.attributes.property).match(/^(og|twitter|fb):/)||Q(e.attributes.name).match(/^(og|twitter):/)||"pinterest"===Q(e.attributes.name)))return!0;if(t.headMetaRobots&&("robots"===Q(e.attributes.name)||"googlebot"===Q(e.attributes.name)||"bingbot"===Q(e.attributes.name)))return!0;if(t.headMetaHttpEquiv&&void 0!==e.attributes["http-equiv"])return!0;if(t.headMetaAuthorship&&("author"===Q(e.attributes.name)||"generator"===Q(e.attributes.name)||"framework"===Q(e.attributes.name)||"publisher"===Q(e.attributes.name)||"progid"===Q(e.attributes.name)||Q(e.attributes.property).match(/^article:/)||Q(e.attributes.property).match(/^product:/)))return!0;if(t.headMetaVerification&&("google-site-verification"===Q(e.attributes.name)||"yandex-verification"===Q(e.attributes.name)||"csrf-token"===Q(e.attributes.name)||"p:domain_verify"===Q(e.attributes.name)||"verify-v1"===Q(e.attributes.name)||"verification"===Q(e.attributes.name)||"shopify-checkout-api-token"===Q(e.attributes.name)))return!0}}return!1}(j,g)&&(U||j.type!==c.Text||j.isStyle||j.textContent.replace(/^\s+|\s+$/gm,"").length)?V():z;var G=Object.assign(j,{id:W});if(i.add(e,G),W===z)return null;m&&m(e);var K=!l;if(G.type===c.Element){K=K&&!G.needBlock,delete G.needBlock;var te=y.shadowRoot(e);te&&S(te)&&(G.isShadowHost=!0)}if((G.type===c.Document||G.type===c.Element)&&K){g.headWhitespace&&G.type===c.Element&&"head"===G.tagName&&(U=!1);var re={doc:r,mirror:i,blockClass:n,blockSelector:s,needsMask:H,maskTextClass:o,maskTextSelector:a,skipChild:l,inlineStylesheet:u,maskInputOptions:d,maskTextFn:h,maskInputFn:p,slimDOMOptions:g,dataURLOptions:_,inlineImages:v,recordCanvas:f,preserveWhiteSpace:U,onSerialize:m,onIframeLoad:I,iframeLoadTimeout:x,onStylesheetLoad:P,stylesheetLoadTimeout:A,keepIframeSrcFn:F};if(G.type===c.Element&&"textarea"===G.tagName&&void 0!==G.attributes.value);else for(var ie of Array.from(y.childNodes(e))){var ne=ee(ie,re);ne&&G.childNodes.push(ne)}var se=null;if(b(e)&&(se=y.shadowRoot(e)))for(var oe of Array.from(y.childNodes(se))){var ae=ee(oe,re);ae&&(S(se)&&(ae.isShadow=!0),G.childNodes.push(ae))}}var le=y.parentNode(e);return le&&w(le)&&S(le)&&(G.isShadow=!0),G.type===c.Element&&"iframe"===G.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&&I){var r=ee(t,{doc:t,mirror:i,blockClass:n,blockSelector:s,needsMask:H,maskTextClass:o,maskTextSelector:a,skipChild:!1,inlineStylesheet:u,maskInputOptions:d,maskTextFn:h,maskInputFn:p,slimDOMOptions:g,dataURLOptions:_,inlineImages:v,recordCanvas:f,preserveWhiteSpace:U,onSerialize:m,onIframeLoad:I,iframeLoadTimeout:x,onStylesheetLoad:P,stylesheetLoadTimeout:A,keepIframeSrcFn:F});r&&I(e,r)}}),x),G.type===c.Element&&"link"===G.tagName&&"string"==typeof G.attributes.rel&&("stylesheet"===G.attributes.rel||"preload"===G.attributes.rel&&"string"==typeof G.attributes.href&&"css"===L(G.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(P){var t=ee(e,{doc:r,mirror:i,blockClass:n,blockSelector:s,needsMask:H,maskTextClass:o,maskTextSelector:a,skipChild:!1,inlineStylesheet:u,maskInputOptions:d,maskTextFn:h,maskInputFn:p,slimDOMOptions:g,dataURLOptions:_,inlineImages:v,recordCanvas:f,preserveWhiteSpace:U,onSerialize:m,onIframeLoad:I,iframeLoadTimeout:x,onStylesheetLoad:P,stylesheetLoadTimeout:A,keepIframeSrcFn:F});t&&P(e,t)}}),A),G}let te=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 re={Node:["childNodes","parentNode","parentElement","textContent"],ShadowRoot:["host","styleSheets"],Element:["shadowRoot","querySelector","querySelectorAll"],MutationObserver:[]},ie={Node:["contains","getRootNode"],ShadowRoot:["getSelection"],Element:[],MutationObserver:["constructor"]},ne={};function se(e){if(ne[e])return ne[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 re?re[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 ie?ie[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 ne[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?ne[e]=u:r}catch(e){return r}}var oe={};function ae(e,t,r){var i,n=e+"."+String(r);if(oe[n])return oe[n].call(t);var s=se(e),o=null==(i=Object.getOwnPropertyDescriptor(s,r))?void 0:i.get;return o?(oe[n]=o,o.call(t)):t[r]}var le={};function ue(e,t,r){var i=e+"."+String(r);if(le[i])return le[i].bind(t);var n=se(e)[r];return"function"!=typeof n?t[r]:(le[i]=n,n.bind(t))}function ce(){return se("MutationObserver").constructor}var de={childNodes:e=>ae("Node",e,"childNodes"),parentNode:e=>ae("Node",e,"parentNode"),parentElement:e=>ae("Node",e,"parentElement"),textContent:e=>ae("Node",e,"textContent"),contains:(e,t)=>ue("Node",e,"contains")(t),getRootNode:e=>ue("Node",e,"getRootNode")(),host:e=>e&&"host"in e?ae("ShadowRoot",e,"host"):null,styleSheets:e=>e.styleSheets,shadowRoot:e=>e&&"shadowRoot"in e?ae("Element",e,"shadowRoot"):null,querySelector:(e,t)=>ae("Element",e,"querySelector")(t),querySelectorAll:(e,t)=>ae("Element",e,"querySelectorAll")(t),mutationObserver:ce};function he(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 pe="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.",ge={map:{},getId(){return console.error(pe),-1},getNode(){return console.error(pe),null},removeNodeFromMap(){console.error(pe)},has(){return console.error(pe),!1},reset(){console.error(pe)}};function _e(e,t,r){void 0===r&&(r={});var i=null,n=0;return function(){for(var s=arguments.length,o=new Array(s),a=0;s>a;a++)o[a]=arguments[a];var l=Date.now();n||!1!==r.leading||(n=l);var u=t-(l-n),c=this;0>=u||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 ve(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)}}),()=>ve(e,t,s||{},!0)}function fe(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&&(ge=new Proxy(ge,{get(e,t,r){return"map"===t&&console.error(pe),Reflect.get(e,t,r)}}));var me=Date.now;function ye(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=de.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=de.parentElement(s.body))?void 0:i.scrollTop)||(null==(n=null==s?void 0:s.body)?void 0:n.scrollTop)||0}}function be(){return window.innerHeight||document.documentElement&&document.documentElement.clientHeight||document.body&&document.body.clientHeight}function we(){return window.innerWidth||document.documentElement&&document.documentElement.clientWidth||document.body&&document.body.clientWidth}function Se(e){return e?e.nodeType===e.ELEMENT_NODE?e:de.parentElement(e):null}function Ce(e,t,r,i){if(!e)return!1;var n=Se(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(K(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 Ie(e,t,r){return!("TITLE"!==e.tagName||!r.headTitleMutations)||t.getId(e)===z}function ke(e,t){if(w(e))return!1;var r=t.getId(e);if(!t.has(r))return!0;var i=de.parentNode(e);return(!i||i.nodeType!==e.DOCUMENT_NODE)&&(!i||ke(i,t))}function xe(e){return Boolean(e.changedTouches)}function Ee(e,t){return Boolean("IFRAME"===e.nodeName&&t.getMeta(e))}function Te(e,t){return Boolean("LINK"===e.nodeName&&e.nodeType===e.ELEMENT_NODE&&e.getAttribute&&"stylesheet"===e.getAttribute("rel")&&t.getMeta(e))}function Re(e){return!!e&&(e instanceof te&&"shadowRoot"in e?Boolean(e.shadowRoot):Boolean(de.shadowRoot(e)))}/[1-9][0-9]{12}/.test(Date.now().toString())||(me=()=>(new Date).getTime());let Me=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 Le(e){var t,r=null;return"getRootNode"in e&&(null==(t=de.getRootNode(e))?void 0:t.nodeType)===Node.DOCUMENT_FRAGMENT_NODE&&de.host(de.getRootNode(e))&&(r=de.host(de.getRootNode(e))),r}function Pe(e){var t=e.ownerDocument;return!!t&&(de.contains(t,e)||function(e){var t=e.ownerDocument;if(!t)return!1;var r=function(e){for(var t,r=e;t=Le(r);)r=t;return r}(e);return de.contains(t,r)}(e))}var Ae=(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))(Ae||{}),Fe=(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))(Fe||{}),Ne=(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))(Ne||{}),Oe=(e=>(e[e.Mouse=0]="Mouse",e[e.Pen=1]="Pen",e[e.Touch=2]="Touch",e))(Oe||{}),De=(e=>(e[e["2D"]=0]="2D",e[e.WebGL=1]="WebGL",e[e.WebGL2=2]="WebGL2",e))(De||{}),Be=(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))(Be||{});function He(e){return"__ln"in e}class qe{constructor(){a(this,"length",0),a(this,"head",null),a(this,"tail",null)}get(e){if(e>=this.length)throw new Error("Position outside of list range");for(var t=this.head,r=0;e>r;r++)t=(null==t?void 0:t.next)||null;return t}addNode(e){var t={value:e,previous:null,next:null};if(e.__ln=t,e.previousSibling&&He(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&&He(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 ze,Ve=(e,t)=>e+"@"+t;class $e{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 qe,i=e=>{for(var t=e,r=z;r===z;)r=(t=t&&t.nextSibling)&&this.mirror.getId(t);return r},n=n=>{var s=de.parentNode(n);if(s&&Pe(n)&&"TEXTAREA"!==s.tagName){var o=w(s)?this.mirror.getId(Le(n)):this.mirror.getId(s),a=i(n);if(-1===o||-1===a)return r.addNode(n);var l=ee(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=>{Ee(e,this.mirror)&&this.iframeManager.addIframe(e),Te(e,this.mirror)&&this.stylesheetManager.trackLinkElement(e),Re(n)&&this.shadowDomManager.addShadowRoot(de.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)We(this.removes,s,this.mirror)&&!this.movedSet.has(de.parentNode(s))||n(s);for(var o of this.addedSet)je(this.droppedSet,o)||We(this.removes,o,this.mirror)?je(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(de.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(de.parentNode(h.value));if(-1===i(h.value))continue;if(-1!==p){l=h;break}var g=de.parentNode(h.value);if(g&&g.nodeType===Node.DOCUMENT_FRAGMENT_NODE){var _=de.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 v={texts:this.texts.map((e=>{var t=e.node,r=de.parentNode(t);return r&&"TEXTAREA"===r.tagName&&this.genTextAreaValueMutation(r),{id:this.mirror.getId(t),value:e.value}})).filter((e=>!t.has(e.id))).filter((e=>this.mirror.has(e.id))),attributes:this.attributes.map((e=>{var{attributes:t}=e;if("string"==typeof t.style){var r=JSON.stringify(e.styleDiff),i=JSON.stringify(e._unchangedStyles);t.style.length>r.length&&(r+i).split("var(").length===t.style.split("var(").length&&(t.style=e.styleDiff)}return{id:this.mirror.getId(e.node),attributes:t}})).filter((e=>!t.has(e.id))).filter((e=>this.mirror.has(e.id))),removes:this.removes,adds:e};(v.texts.length||v.attributes.length||v.removes.length||v.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(v))}})),a(this,"genTextAreaValueMutation",(e=>{var t=this.attributeMap.get(e);t||(this.attributes.push(t={node:e,attributes:{},styleDiff:{},_unchangedStyles:{}}),this.attributeMap.set(e,t)),t.attributes.value=Array.from(de.childNodes(e),(e=>de.textContent(e)||"")).join("")})),a(this,"processMutation",(e=>{if(!Ie(e.target,this.mirror,this.slimDOMOptions))switch(e.type){case"characterData":var t=de.textContent(e.target);Ce(e.target,this.blockClass,this.blockSelector,!1)||t===e.oldValue||this.texts.push({value:J(e.target,this.maskTextClass,this.maskTextSelector,!0)&&t?this.maskTextFn?this.maskTextFn(t,Se(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=M(r);n=E({element:r,maskInputOptions:this.maskInputOptions,tagName:r.tagName,type:s,value:n,maskInputFn:this.maskInputFn})}if(Ce(e.target,this.blockClass,this.blockSelector,!1)||n===e.oldValue)return;var o=this.attributeMap.get(e.target);if("IFRAME"===r.tagName&&"src"===i&&!this.keepIframeSrcFn(n)){if(r.contentDocument)return;i="rr_src"}if(o||(this.attributes.push(o={node:e.target,attributes:{},styleDiff:{},_unchangedStyles:{}}),this.attributeMap.set(e.target,o)),"type"===i&&"INPUT"===r.tagName&&"password"===(e.oldValue||"").toLowerCase()&&r.setAttribute("data-rr-is-password","true"),!X(r.tagName,i))if(o.attributes[i]=Y(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&&(o.attributes.rr_open_mode=r.matches("dialog:modal")?"modal":"non-modal");break;case"childList":if(Ce(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=w(e.target)?this.mirror.getId(de.host(e.target)):this.mirror.getId(e.target);Ce(e.target,this.blockClass,this.blockSelector,!1)||Ie(t,this.mirror,this.slimDOMOptions)||!function(e,t){return-1!==t.getId(e)}(t,this.mirror)||(this.addedSet.has(t)?(Ue(this.addedSet,t),this.droppedSet.add(t)):this.addedSet.has(e.target)&&-1===r||ke(e.target,this.mirror)||(this.movedSet.has(t)&&this.movedMap[Ve(r,i)]?Ue(this.movedSet,t):this.removes.push({parentId:i,id:r,isShadow:!(!w(e.target)||!S(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(Ie(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[Ve(this.mirror.getId(e),r)]=!0)}else this.addedSet.add(e),this.droppedSet.delete(e);Ce(e,this.blockClass,this.blockSelector,!1)||(de.childNodes(e).forEach((e=>this.genAdds(e))),Re(e)&&de.childNodes(de.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 Ue(e,t){e.delete(t),de.childNodes(t).forEach((t=>Ue(e,t)))}function We(e,t,r){return 0!==e.length&&function(e,t,r){for(var i,n=de.parentNode(t),s=function(){var t=r.getId(n);if(e.some((e=>e.id===t)))return{v:!0};n=de.parentNode(n)};n;)if(i=s())return i.v;return!1}(e,t,r)}function je(e,t){return 0!==e.size&&Ge(e,t)}function Ge(e,t){var r=de.parentNode(t);return!!r&&(!!e.has(r)||Ge(e,r))}var Ze=e=>ze?function(){try{return e(...arguments)}catch(e){if(ze&&!0===ze(e))return;throw e}}:e,Ye=[];function Xe(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 Ke(e,t){var r=new $e;Ye.push(r),r.init(e);var i=new(ce())(Ze(r.processMutations.bind(r)));return i.observe(t,{attributes:!0,attributeOldValue:!0,characterData:!0,characterDataOldValue:!0,childList:!0,subtree:!0}),i}function Je(e){var{scrollCb:t,doc:r,mirror:i,blockClass:n,blockSelector:s,sampling:o}=e;return he("scroll",Ze(_e(Ze((e=>{var o=Xe(e);if(o&&!Ce(o,n,s,!0)){var a=i.getId(o);if(o===r&&r.defaultView){var l=ye(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 Qe=["INPUT","TEXTAREA","SELECT"],et=new WeakMap;function tt(e){return function(e,t){if(st("CSSGroupingRule")&&e.parentRule instanceof CSSGroupingRule||st("CSSMediaRule")&&e.parentRule instanceof CSSMediaRule||st("CSSSupportsRule")&&e.parentRule instanceof CSSSupportsRule||st("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 rt(e,t,r){var i,n;return e?(e.ownerNode?i=t.getId(e.ownerNode):n=r.getId(e),{styleId:n,id:i}):{}}function it(e,t){var r,i,n,s,{mirror:o,stylesheetManager:a}=e;s=o.getId("#document"===t.nodeName?t:de.host(t));var l="#document"===t.nodeName?null==(r=t.defaultView)?void 0:r.Document:null==(n=null==(i=t.ownerDocument)?void 0:i.defaultView)?void 0:n.ShadowRoot,u=(null==l?void 0:l.prototype)?Object.getOwnPropertyDescriptor(null==l?void 0:l.prototype,"adoptedStyleSheets"):void 0;return null!==s&&-1!==s&&l&&u?(Object.defineProperty(t,"adoptedStyleSheets",{configurable:u.configurable,enumerable:u.enumerable,get(){var e;return null==(e=u.get)?void 0:e.call(this)},set(e){var t,r=null==(t=u.set)?void 0:t.call(this,e);if(null!==s&&-1!==s)try{a.adoptStyleSheets(e,s)}catch(e){}return r}}),Ze((()=>{Object.defineProperty(t,"adoptedStyleSheets",{configurable:u.configurable,enumerable:u.enumerable,get:u.get,set:u.set})}))):()=>{}}function nt(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:g}=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),g(...arguments)}}(e,t),e.recordDOM&&(i=Ke(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=_e(Ze((e=>{var r=Date.now()-s;t(l.map((e=>(e.timeOffset-=r,e))),e),l=[],s=null})),a),c=Ze(_e(Ze((e=>{var t=Xe(e),{clientX:r,clientY:i}=xe(e)?e.changedTouches[0]:e;s||(s=me()),l.push({x:r,y:i,id:n.getId(t),timeOffset:me()-s}),u("undefined"!=typeof DragEvent&&e instanceof DragEvent?Fe.Drag:e instanceof MouseEvent?Fe.MouseMove:Fe.TouchMove)})),o,{trailing:!1})),d=[he("mousemove",c,i),he("touchmove",c,i),he("drag",c,i)];return Ze((()=>{d.forEach((e=>e()))}))}(e),o=function(e){var{mouseInteractionCb:t,doc:i,mirror:n,blockClass:s,blockSelector:o,sampling:a}=e;if(!1===a.mouseInteraction)return()=>{};var l=!0===a.mouseInteraction||void 0===a.mouseInteraction?{}:a.mouseInteraction,u=[],c=null;return Object.keys(Ne).filter((e=>Number.isNaN(Number(e))&&!e.endsWith("_Departed")&&!1!==l[e])).forEach((e=>{var a=T(e),l=(e=>i=>{var a=Xe(i);if(!Ce(a,s,o,!0)){var l=null,u=e;if("pointerType"in i){switch(i.pointerType){case"mouse":l=Oe.Mouse;break;case"touch":l=Oe.Touch;break;case"pen":l=Oe.Pen}l===Oe.Touch&&(Ne[e]===Ne.MouseDown?u="TouchStart":Ne[e]===Ne.MouseUp&&(u="TouchEnd"))}else xe(i)&&(l=Oe.Touch);null!==l?(c=l,(u.startsWith("Touch")&&l===Oe.Touch||u.startsWith("Mouse")&&l===Oe.Mouse)&&(l=null)):Ne[e]===Ne.Click&&(l=c,c=null);var d=xe(i)?i.changedTouches[0]:i;if(d){var h=n.getId(a),{clientX:p,clientY:g}=d;Ze(t)(r({type:Ne[u],id:h,x:p,y:g},null!==l&&{pointerType:l}))}}})(e);if(window.PointerEvent)switch(Ne[e]){case Ne.MouseDown:case Ne.MouseUp:a=a.replace("mouse","pointer");break;case Ne.TouchStart:case Ne.TouchEnd:return}u.push(he(a,l,i))})),Ze((()=>{u.forEach((e=>e()))}))}(e),a=Je(e),l=function(e,t){var{viewportResizeCb:r}=e,{win:i}=t,n=-1,s=-1;return he("resize",Ze(_e(Ze((()=>{var e=be(),t=we();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=Xe(e),r=e.isTrusted,n=t&&t.tagName;if(t&&"OPTION"===n&&(t=de.parentElement(t)),t&&n&&Qe.indexOf(n)>=0&&!Ce(t,s,o,!0)&&!(t.classList.contains(a)||l&&t.matches(l))){var d=t.value,p=!1,_=M(t)||"";"radio"===_||"checkbox"===_?p=t.checked:(u[n.toLowerCase()]||u[_])&&(d=E({element:t,maskInputOptions:u,tagName:n,type:_,value:d,maskInputFn:c})),g(t,h?{text:d,isChecked:p,userTriggered:r}:{text:d,isChecked:p});var v=t.name;"radio"===_&&v&&p&&i.querySelectorAll('input[type="radio"][name="'+v+'"]').forEach((e=>{if(e!==t){var r=e.value;g(e,h?{text:r,isChecked:!p,userTriggered:!1}:{text:r,isChecked:!p})}}))}}function g(e,i){var s=et.get(e);if(!s||s.text!==i.text||s.isChecked!==i.isChecked){et.set(e,i);var o=n.getId(e);Ze(t)(r({},i,{id:o}))}}var _=("last"===d.input?["change"]:["input","change"]).map((e=>he(e,Ze(p),i))),v=i.defaultView;if(!v)return()=>{_.forEach((e=>e()))};var f=v.Object.getOwnPropertyDescriptor(v.HTMLInputElement.prototype,"value");return f&&f.set&&_.push(...[[v.HTMLInputElement.prototype,"value"],[v.HTMLInputElement.prototype,"checked"],[v.HTMLSelectElement.prototype,"value"],[v.HTMLTextAreaElement.prototype,"value"],[v.HTMLSelectElement.prototype,"selectedIndex"],[v.HTMLOptionElement.prototype,"selected"]].map((e=>ve(e[0],e[1],{set(){Ze(p)({target:this,isTrusted:!1})}},!1,v)))),Ze((()=>{_.forEach((e=>e()))}))}(e),c=function(e){var{mediaInteractionCb:t,blockClass:r,blockSelector:i,mirror:n,sampling:s,doc:o}=e,a=Ze((e=>_e(Ze((s=>{var o=Xe(s);if(o&&!Ce(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=[he("play",a(Be.Play),o),he("pause",a(Be.Pause),o),he("seeked",a(Be.Seeked),o),he("volumechange",a(Be.VolumeChange),o),he("ratechange",a(Be.RateChange),o)];return Ze((()=>{l.forEach((e=>e()))}))}(e),d=()=>{},h=()=>{},p=()=>{},g=()=>{};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:Ze(((e,t,s)=>{var[o,a]=s,{id:l,styleId:u}=rt(t,i,n.styleMirror);return(l&&-1!==l||u&&-1!==u)&&r({id:l,styleId:u,adds:[{rule:o,index:a}]}),e.apply(t,s)}))}),s.CSSStyleSheet.prototype.addRule=function(e,t,r){return void 0===r&&(r=this.cssRules.length),s.CSSStyleSheet.prototype.insertRule.apply(this,[e+" { "+t+" }",r])};var a,l,u=s.CSSStyleSheet.prototype.deleteRule;s.CSSStyleSheet.prototype.deleteRule=new Proxy(u,{apply:Ze(((e,t,s)=>{var[o]=s,{id:a,styleId:l}=rt(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:Ze(((e,t,s)=>{var[o]=s,{id:a,styleId:l}=rt(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:Ze(((e,t,s)=>{var[o]=s,{id:a,styleId:l}=rt(t,i,n.styleMirror);return(a&&-1!==a||l&&-1!==l)&&r({id:a,styleId:l,replaceSync:o}),e.apply(t,s)}))}));var c={};ot("CSSGroupingRule")?c.CSSGroupingRule=s.CSSGroupingRule:(ot("CSSMediaRule")&&(c.CSSMediaRule=s.CSSMediaRule),ot("CSSConditionRule")&&(c.CSSConditionRule=s.CSSConditionRule),ot("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:Ze(((e,t,s)=>{var[o,a]=s,{id:l,styleId:u}=rt(t.parentStyleSheet,i,n.styleMirror);return(l&&-1!==l||u&&-1!==u)&&r({id:l,styleId:u,adds:[{rule:o,index:[...tt(t),a||0]}]}),e.apply(t,s)}))}),s.prototype.deleteRule=new Proxy(d[t].deleteRule,{apply:Ze(((e,t,s)=>{var[o]=s,{id:a,styleId:l}=rt(t.parentStyleSheet,i,n.styleMirror);return(a&&-1!==a||l&&-1!==l)&&r({id:a,styleId:l,removes:[{index:[...tt(t),o]}]}),e.apply(t,s)}))})})),Ze((()=>{s.CSSStyleSheet.prototype.insertRule=o,s.CSSStyleSheet.prototype.deleteRule=u,a&&(s.CSSStyleSheet.prototype.replace=a),l&&(s.CSSStyleSheet.prototype.replaceSync=l),Object.entries(c).forEach((e=>{var[t,r]=e;r.prototype.insertRule=d[t].insertRule,r.prototype.deleteRule=d[t].deleteRule}))}))}(e,{win:n}),h=it(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:Ze(((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}=rt(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:tt(t.parentRule)}),e.apply(t,o)}))});var l=o.CSSStyleDeclaration.prototype.removeProperty;return o.CSSStyleDeclaration.prototype.removeProperty=new Proxy(l,{apply:Ze(((e,t,o)=>{var a,[u]=o;if(n.has(u))return l.apply(t,[u]);var{id:c,styleId:d}=rt(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:tt(t.parentRule)}),e.apply(t,o)}))}),Ze((()=>{o.CSSStyleDeclaration.prototype.setProperty=a,o.CSSStyleDeclaration.prototype.removeProperty=l}))}(e,{win:n}),e.collectFonts&&(g=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=fe(r.fonts,"add",(function(e){return function(r){return setTimeout(Ze((()=>{var e=s.get(r);e&&(t(e),s.delete(r))})),0),e.apply(this,[r])}}));return n.push((()=>{i.FontFace=o})),n.push(a),Ze((()=>{n.forEach((e=>e()))}))}(e)));var _=function(e){var{doc:t,mirror:r,blockClass:i,blockSelector:n,selectionCb:s}=e,o=!0,a=Ze((()=>{var e=t.getSelection();if(!(!e||o&&(null==e?void 0:e.isCollapsed))){o=e.isCollapsed||!1;for(var a=[],l=e.rangeCount||0,u=0;l>u;u++){var c=e.getRangeAt(u),{startContainer:d,startOffset:h,endContainer:p,endOffset:g}=c;Ce(d,i,n,!0)||Ce(p,i,n,!0)||a.push({start:r.getId(d),startOffset:h,end:r.getId(p),endOffset:g})}s({ranges:a})}}));return a(),he("selectionchange",a)}(e),v=function(e){var{doc:t,customElementCb:r}=e,i=t.defaultView;return i&&i.customElements?fe(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 Ze((()=>{Ye.forEach((e=>e.reset())),null==i||i.disconnect(),s(),o(),a(),l(),u(),c(),d(),h(),p(),g(),_(),v(),f.forEach((e=>e()))}))}function st(e){return void 0!==window[e]}function ot(e){return Boolean(void 0!==window[e]&&window[e].prototype&&"insertRule"in window[e].prototype&&"deleteRule"in window[e].prototype)}class at{constructor(e){a(this,"iframeIdToRemoteIdMap",new WeakMap),a(this,"iframeRemoteIdToIdMap",new WeakMap),this.generateIdFn=e}getId(e,t,r,i){var n=r||this.getIdToRemoteIdMap(e),s=i||this.getRemoteIdToIdMap(e),o=n.get(t);return o||(o=this.generateIdFn(),n.set(t,o),s.set(o,t)),o}getIds(e,t){var r=this.getIdToRemoteIdMap(e),i=this.getRemoteIdToIdMap(e);return t.map((t=>this.getId(e,t,r,i)))}getRemoteId(e,t,r){var i=r||this.getRemoteIdToIdMap(e);return"number"!=typeof t?t:i.get(t)||-1}getRemoteIds(e,t){var r=this.getRemoteIdToIdMap(e);return t.map((t=>this.getRemoteId(e,t,r)))}reset(e){if(!e)return this.iframeIdToRemoteIdMap=new WeakMap,void(this.iframeRemoteIdToIdMap=new WeakMap);this.iframeIdToRemoteIdMap.delete(e),this.iframeRemoteIdToIdMap.delete(e)}getIdToRemoteIdMap(e){var t=this.iframeIdToRemoteIdMap.get(e);return t||this.iframeIdToRemoteIdMap.set(e,t=new Map),t}getRemoteIdToIdMap(e){var t=this.iframeRemoteIdToIdMap.get(e);return t||this.iframeRemoteIdToIdMap.set(e,t=new Map),t}}class lt{constructor(e){a(this,"iframes",new WeakMap),a(this,"crossOriginIframeMap",new WeakMap),a(this,"crossOriginIframeMirror",new at(V)),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 at(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 Ae.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:Ae.IncrementalSnapshot,data:{source:Fe.Mutation,adds:[{parentId:this.mirror.getId(e),nextId:null,node:t.data.node}],removes:[],texts:[],attributes:[],isAttachIframe:!0}};case Ae.Meta:case Ae.Load:case Ae.DomContentLoaded:return!1;case Ae.Plugin:return t;case Ae.Custom:return this.replaceIds(t.data.payload,e,["id","parentId","previousId","nextId"]),t;case Ae.IncrementalSnapshot:switch(t.data.source){case Fe.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 Fe.Drag:case Fe.TouchMove:case Fe.MouseMove:return t.data.positions.forEach((t=>{this.replaceIds(t,e,["id"])})),t;case Fe.ViewportResize:return!1;case Fe.MediaInteraction:case Fe.MouseInteraction:case Fe.Scroll:case Fe.CanvasMutation:case Fe.Input:return this.replaceIds(t.data,e,["id"]),t;case Fe.StyleSheetRule:case Fe.StyleDeclaration:return this.replaceIds(t.data,e,["id"]),this.replaceStyleIds(t.data,e,["styleId"]),t;case Fe.Font:return t;case Fe.Selection:return t.data.ranges.forEach((t=>{this.replaceIds(t,e,["start","end"])})),t;case Fe.AdoptedStyleSheet:return this.replaceIds(t.data,e,["id"]),this.replaceStyleIds(t.data,e,["styleIds"]),null==(r=t.data.styles)||r.forEach((t=>{this.replaceStyleIds(t,e,["styleId"])})),t}}return!1}replace(e,t,r,i){for(var n of i)(Array.isArray(t[n])||"number"==typeof t[n])&&(t[n]=Array.isArray(t[n])?e.getIds(r,t[n]):e.getId(r,t[n]));return t}replaceIds(e,t,r){return this.replace(this.crossOriginIframeMirror,e,t,r)}replaceStyleIds(e,t,r){return this.replace(this.crossOriginIframeStyleMirror,e,t,r)}replaceIdOnNode(e,t){this.replaceIds(e,t,["id","rootId"]),"childNodes"in e&&e.childNodes.forEach((e=>{this.replaceIdOnNode(e,t)}))}patchRootIdOnNode(e,t){e.type===c.Document||e.rootId||(e.rootId=t),"childNodes"in e&&e.childNodes.forEach((e=>{this.patchRootIdOnNode(e,t)}))}}class ut{constructor(e){a(this,"shadowDoms",new WeakSet),a(this,"mutationCb"),a(this,"scrollCb"),a(this,"bypassOptions"),a(this,"mirror"),a(this,"restoreHandlers",[]),this.mutationCb=e.mutationCb,this.scrollCb=e.scrollCb,this.bypassOptions=e.bypassOptions,this.mirror=e.mirror,this.init()}init(){this.reset(),this.patchAttachShadow(Element,document)}addShadowRoot(e,t){if(S(e)&&!this.shadowDoms.has(e)){this.shadowDoms.add(e);var i=Ke(r({},this.bypassOptions,{doc:t,mutationCb:this.mutationCb,mirror:this.mirror,shadowDomManager:this}),e);this.restoreHandlers.push((()=>i.disconnect())),this.restoreHandlers.push(Je(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(de.host(e))),this.restoreHandlers.push(it({mirror:this.mirror,stylesheetManager:this.bypassOptions.stylesheetManager},e))}),0)}}observeAttachShadow(e){e.contentWindow&&e.contentDocument&&this.patchAttachShadow(e.contentWindow.Element,e.contentDocument)}patchAttachShadow(e,t){var r=this;this.restoreHandlers.push(fe(e.prototype,"attachShadow",(function(e){return function(i){var n=e.call(this,i),s=de.shadowRoot(this);return s&&Pe(this)&&r.addShadowRoot(s,t),n}})))}reset(){this.restoreHandlers.forEach((e=>{try{e()}catch(e){}})),this.restoreHandlers=[],this.shadowDoms=new WeakSet}}for(var ct="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",dt="undefined"==typeof Uint8Array?[]:new Uint8Array(256),ht=0;64>ht;ht++)dt[ct.charCodeAt(ht)]=ht;var pt=new Map,gt=(e,t,r)=>{if(e&&(ft(e,t)||"object"==typeof e)){var i=function(e,t){var r=pt.get(e);return r||pt.set(e,r=new Map),r.has(t)||r.set(t,[]),r.get(t)}(r,e.constructor.name),n=i.indexOf(e);return-1===n&&(n=i.length,i.push(e)),n}};function _t(e,t,r){if(e instanceof Array)return e.map((e=>_t(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;i>t;t+=3)n+=ct[r[t]>>2],n+=ct[(3&r[t])<<4|r[t+1]>>4],n+=ct[(15&r[t+1])<<2|r[t+2]>>6],n+=ct[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:[_t(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}}return e instanceof HTMLCanvasElement?{rr_type:"HTMLImageElement",src:e.toDataURL()}:e instanceof ImageData?{rr_type:e.constructor.name,args:[_t(e.data,t,r),e.width,e.height]}:ft(e,t)||"object"==typeof e?{rr_type:e.constructor.name,index:gt(e,t,r)}:e}var vt=(e,t,r)=>e.map((e=>_t(e,t,r))),ft=(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 mt(e,t,r,i){var n=[];try{var s=fe(e.HTMLCanvasElement.prototype,"getContext",(function(e){return function(n){for(var s=arguments.length,o=new Array(s>1?s-1:0),a=1;s>a;a++)o[a-1]=arguments[a];if(!Ce(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 yt(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=fe(e,a,(function(e){return function(){for(var o=arguments.length,l=new Array(o),u=0;o>u;u++)l[u]=arguments[u];var c=e.apply(this,l);if(gt(c,s,this),"tagName"in this.canvas&&!Ce(this.canvas,i,n,!0)){var d=vt(l,s,this);r(this.canvas,{type:t,property:a,args:d})}return c}}));o.push(l)}catch(i){var u=ve(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 bt,wt,St,Ct,It="KGZ1bmN0aW9uKCkgewogICJ1c2Ugc3RyaWN0IjsKICB2YXIgY2hhcnMgPSAiQUJDREVGR0hJSktMTU5PUFFSU1RVVldYWVphYmNkZWZnaGlqa2xtbm9wcXJzdHV2d3h5ejAxMjM0NTY3ODkrLyI7CiAgdmFyIGxvb2t1cCA9IHR5cGVvZiBVaW50OEFycmF5ID09PSAidW5kZWZpbmVkIiA/IFtdIDogbmV3IFVpbnQ4QXJyYXkoMjU2KTsKICBmb3IgKHZhciBpID0gMDsgaSA8IGNoYXJzLmxlbmd0aDsgaSsrKSB7CiAgICBsb29rdXBbY2hhcnMuY2hhckNvZGVBdChpKV0gPSBpOwogIH0KICB2YXIgZW5jb2RlID0gZnVuY3Rpb24oYXJyYXlidWZmZXIpIHsKICAgIHZhciBieXRlcyA9IG5ldyBVaW50OEFycmF5KGFycmF5YnVmZmVyKSwgaTIsIGxlbiA9IGJ5dGVzLmxlbmd0aCwgYmFzZTY0ID0gIiI7CiAgICBmb3IgKGkyID0gMDsgaTIgPCBsZW47IGkyICs9IDMpIHsKICAgICAgYmFzZTY0ICs9IGNoYXJzW2J5dGVzW2kyXSA+PiAyXTsKICAgICAgYmFzZTY0ICs9IGNoYXJzWyhieXRlc1tpMl0gJiAzKSA8PCA0IHwgYnl0ZXNbaTIgKyAxXSA+PiA0XTsKICAgICAgYmFzZTY0ICs9IGNoYXJzWyhieXRlc1tpMiArIDFdICYgMTUpIDw8IDIgfCBieXRlc1tpMiArIDJdID4+IDZdOwogICAgICBiYXNlNjQgKz0gY2hhcnNbYnl0ZXNbaTIgKyAyXSAmIDYzXTsKICAgIH0KICAgIGlmIChsZW4gJSAzID09PSAyKSB7CiAgICAgIGJhc2U2NCA9IGJhc2U2NC5zdWJzdHJpbmcoMCwgYmFzZTY0Lmxlbmd0aCAtIDEpICsgIj0iOwogICAgfSBlbHNlIGlmIChsZW4gJSAzID09PSAxKSB7CiAgICAgIGJhc2U2NCA9IGJhc2U2NC5zdWJzdHJpbmcoMCwgYmFzZTY0Lmxlbmd0aCAtIDIpICsgIj09IjsKICAgIH0KICAgIHJldHVybiBiYXNlNjQ7CiAgfTsKICBjb25zdCBsYXN0QmxvYk1hcCA9IC8qIEBfX1BVUkVfXyAqLyBuZXcgTWFwKCk7CiAgY29uc3QgdHJhbnNwYXJlbnRCbG9iTWFwID0gLyogQF9fUFVSRV9fICovIG5ldyBNYXAoKTsKICBhc3luYyBmdW5jdGlvbiBnZXRUcmFuc3BhcmVudEJsb2JGb3Iod2lkdGgsIGhlaWdodCwgZGF0YVVSTE9wdGlvbnMpIHsKICAgIGNvbnN0IGlkID0gYCR7d2lkdGh9LSR7aGVpZ2h0fWA7CiAgICBpZiAoIk9mZnNjcmVlbkNhbnZhcyIgaW4gZ2xvYmFsVGhpcykgewogICAgICBpZiAodHJhbnNwYXJlbnRCbG9iTWFwLmhhcyhpZCkpIHJldHVybiB0cmFuc3BhcmVudEJsb2JNYXAuZ2V0KGlkKTsKICAgICAgY29uc3Qgb2Zmc2NyZWVuID0gbmV3IE9mZnNjcmVlbkNhbnZhcyh3aWR0aCwgaGVpZ2h0KTsKICAgICAgb2Zmc2NyZWVuLmdldENvbnRleHQoIjJkIik7CiAgICAgIGNvbnN0IGJsb2IgPSBhd2FpdCBvZmZzY3JlZW4uY29udmVydFRvQmxvYihkYXRhVVJMT3B0aW9ucyk7CiAgICAgIGNvbnN0IGFycmF5QnVmZmVyID0gYXdhaXQgYmxvYi5hcnJheUJ1ZmZlcigpOwogICAgICBjb25zdCBiYXNlNjQgPSBlbmNvZGUoYXJyYXlCdWZmZXIpOwogICAgICB0cmFuc3BhcmVudEJsb2JNYXAuc2V0KGlkLCBiYXNlNjQpOwogICAgICByZXR1cm4gYmFzZTY0OwogICAgfSBlbHNlIHsKICAgICAgcmV0dXJuICIiOwogICAgfQogIH0KICBjb25zdCB3b3JrZXIgPSBzZWxmOwogIHdvcmtlci5vbm1lc3NhZ2UgPSBhc3luYyBmdW5jdGlvbihlKSB7CiAgICBpZiAoIk9mZnNjcmVlbkNhbnZhcyIgaW4gZ2xvYmFsVGhpcykgewogICAgICBjb25zdCB7IGlkLCBiaXRtYXAsIHdpZHRoLCBoZWlnaHQsIGRhdGFVUkxPcHRpb25zIH0gPSBlLmRhdGE7CiAgICAgIGNvbnN0IHRyYW5zcGFyZW50QmFzZTY0ID0gZ2V0VHJhbnNwYXJlbnRCbG9iRm9yKAogICAgICAgIHdpZHRoLAogICAgICAgIGhlaWdodCwKICAgICAgICBkYXRhVVJMT3B0aW9ucwogICAgICApOwogICAgICBjb25zdCBvZmZzY3JlZW4gPSBuZXcgT2Zmc2NyZWVuQ2FudmFzKHdpZHRoLCBoZWlnaHQpOwogICAgICBjb25zdCBjdHggPSBvZmZzY3JlZW4uZ2V0Q29udGV4dCgiMmQiKTsKICAgICAgY3R4LmRyYXdJbWFnZShiaXRtYXAsIDAsIDApOwogICAgICBiaXRtYXAuY2xvc2UoKTsKICAgICAgY29uc3QgYmxvYiA9IGF3YWl0IG9mZnNjcmVlbi5jb252ZXJ0VG9CbG9iKGRhdGFVUkxPcHRpb25zKTsKICAgICAgY29uc3QgdHlwZSA9IGJsb2IudHlwZTsKICAgICAgY29uc3QgYXJyYXlCdWZmZXIgPSBhd2FpdCBibG9iLmFycmF5QnVmZmVyKCk7CiAgICAgIGNvbnN0IGJhc2U2NCA9IGVuY29kZShhcnJheUJ1ZmZlcik7CiAgICAgIGlmICghbGFzdEJsb2JNYXAuaGFzKGlkKSAmJiBhd2FpdCB0cmFuc3BhcmVudEJhc2U2NCA9PT0gYmFzZTY0KSB7CiAgICAgICAgbGFzdEJsb2JNYXAuc2V0KGlkLCBiYXNlNjQpOwogICAgICAgIHJldHVybiB3b3JrZXIucG9zdE1lc3NhZ2UoeyBpZCB9KTsKICAgICAgfQogICAgICBpZiAobGFzdEJsb2JNYXAuZ2V0KGlkKSA9PT0gYmFzZTY0KSByZXR1cm4gd29ya2VyLnBvc3RNZXNzYWdlKHsgaWQgfSk7CiAgICAgIHdvcmtlci5wb3N0TWVzc2FnZSh7CiAgICAgICAgaWQsCiAgICAgICAgdHlwZSwKICAgICAgICBiYXNlNjQsCiAgICAgICAgd2lkdGgsCiAgICAgICAgaGVpZ2h0CiAgICAgIH0pOwogICAgICBsYXN0QmxvYk1hcC5zZXQoaWQsIGJhc2U2NCk7CiAgICB9IGVsc2UgewogICAgICByZXR1cm4gd29ya2VyLnBvc3RNZXNzYWdlKHsgaWQ6IGUuZGF0YS5pZCB9KTsKICAgIH0KICB9Owp9KSgpOwovLyMgc291cmNlTWFwcGluZ1VSTD1pbWFnZS1iaXRtYXAtZGF0YS11cmwtd29ya2VyLUlKcEM3Z19iLmpzLm1hcAo=",kt="undefined"!=typeof window&&window.Blob&&new Blob([(bt=It,Uint8Array.from(atob(bt),(e=>e.charCodeAt(0))))],{type:"text/javascript;charset=utf-8"});function xt(e){var t;try{if(!(t=kt&&(window.URL||window.webkitURL).createObjectURL(kt)))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,"+It,{name:null==e?void 0:e.name})}finally{t&&(window.URL||window.webkitURL).revokeObjectURL(t)}}class Et{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=mt(r,i,n,!0),l=new Map,u=new xt;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:De["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,g;h&&d>e-h||(h=e,(a=[],g=e=>{e.querySelectorAll("canvas").forEach((e=>{Ce(e,i,n,!0)||a.push(e)})),e.querySelectorAll("*").forEach((e=>{e.shadowRoot&&g(e.shadowRoot)}))},g(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=mt(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=fe(t.CanvasRenderingContext2D.prototype,s,(function(n){return function(){for(var o=arguments.length,a=new Array(o),l=0;o>l;l++)a[l]=arguments[l];return Ce(this.canvas,r,i,!0)||setTimeout((()=>{var r=vt(a,t,this);e(this.canvas,{type:De["2D"],property:s,args:r})}),0),n.apply(this,a)}}));n.push(o)}catch(r){var a=ve(t.CanvasRenderingContext2D.prototype,s,{set(t){e(this.canvas,{type:De["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(...yt(t.WebGLRenderingContext.prototype,De.WebGL,e,r,i,t)),void 0!==t.WebGL2RenderingContext&&n.push(...yt(t.WebGL2RenderingContext.prototype,De.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 Tt{constructor(e){a(this,"trackedLinkElements",new WeakSet),a(this,"mutationCb"),a(this,"adoptedStyleSheetCb"),a(this,"styleMirror",new Me),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 Rt{constructor(){a(this,"nodeMap",new WeakMap),a(this,"active",!1)}inOtherBuffer(e,t){var r=this.nodeMap.get(e);return r&&Array.from(r).some((e=>e!==t))}add(e,t){this.active||(this.active=!0,requestAnimationFrame((()=>{this.nodeMap=new WeakMap,this.active=!1}))),this.nodeMap.set(e,(this.nodeMap.get(e)||new Set).add(t))}destroy(){}}var Mt=!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 Pt,At,Ft=new x;function Nt(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:g,maskInputFn:_,maskTextFn:v,hooks:f,packFn:m,sampling:y={},dataURLOptions:b={},mousemoveWait:w,recordDOM:S=!0,recordCanvas:C=!1,recordCrossOriginIframes:I=!1,recordAfter:k=("DOMContentLoaded"===e.recordAfter?e.recordAfter:"load"),userTriggeredOnInput:E=!1,collectFonts:T=!1,inlineImages:R=!1,plugins:M,keepIframeSrcFn:L=(()=>!1),ignoreCSSAttributes:P=new Set([]),errorHandler:A}=e;ze=A;var F=!I||window.parent===window,N=!1;if(!F)try{window.parent.document&&(N=!1)}catch(e){N=!0}if(F&&!t)throw new Error("emit function is required");if(!F&&!N)return()=>{};void 0!==w&&void 0===y.mousemove&&(y.mousemove=w),Ft.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},B=!0===g||"all"===g?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaVerification:!0,headMetaAuthorship:"all"===g,headMetaDescKeywords:"all"===g,headTitleMutations:"all"===g}:g||{};!function(e){void 0===e&&(e=window),"NodeList"in e&&!e.NodeList.prototype.forEach&&(e.NodeList.prototype.forEach=[].forEach),"DOMTokenList"in e&&!e.DOMTokenList.prototype.forEach&&(e.DOMTokenList.prototype.forEach=[].forEach)}();var H=0,q=e=>{for(var t of M||[])t.eventProcessor&&(e=t.eventProcessor(e));return m&&!N&&(e=m(e)),e};wt=(e,r)=>{var s,o=e;if(o.timestamp=me(),!(null==(s=Ye[0])?void 0:s.isFrozen())||o.type===Ae.FullSnapshot||o.type===Ae.IncrementalSnapshot&&o.data.source===Fe.Mutation||Ye.forEach((e=>e.unfreeze())),F)null==t||t(q(o),r);else if(N){var a={type:"rrweb",event:q(o),origin:window.location.origin,isCheckout:r};window.parent.postMessage(a,"*")}if(o.type===Ae.FullSnapshot)O=o,H=0;else if(o.type===Ae.IncrementalSnapshot){if(o.data.source===Fe.Mutation&&o.data.isAttachIframe)return;H++,(n&&H>=n||i&&o.timestamp-O.timestamp>i)&&St(!0)}};var z=e=>{wt({type:Ae.IncrementalSnapshot,data:r({source:Fe.Mutation},e)})},V=e=>wt({type:Ae.IncrementalSnapshot,data:r({source:Fe.Scroll},e)}),U=e=>wt({type:Ae.IncrementalSnapshot,data:r({source:Fe.CanvasMutation},e)}),W=new Tt({mutationCb:z,adoptedStyleSheetCb:e=>wt({type:Ae.IncrementalSnapshot,data:r({source:Fe.AdoptedStyleSheet},e)})}),j=new lt({mirror:Ft,mutationCb:z,stylesheetManager:W,recordCrossOriginIframes:I,wrappedEmit:wt});for(var G of M||[])G.getMirror&&G.getMirror({nodeMirror:Ft,crossOriginIframeMirror:j.crossOriginIframeMirror,crossOriginIframeStyleMirror:j.crossOriginIframeStyleMirror});var Z=new Rt;Ct=new Et({recordCanvas:C,mutationCb:U,win:window,blockClass:s,blockSelector:o,mirror:Ft,sampling:y.canvas,dataURLOptions:b});var Y=new ut({mutationCb:z,scrollCb:V,bypassOptions:{blockClass:s,blockSelector:o,maskTextClass:u,maskTextSelector:c,inlineStylesheet:d,maskInputOptions:D,dataURLOptions:b,maskTextFn:v,maskInputFn:_,recordCanvas:C,inlineImages:R,sampling:y,slimDOMOptions:B,iframeManager:j,stylesheetManager:W,canvasManager:Ct,keepIframeSrcFn:L,processedNodeManager:Z},mirror:Ft});St=function(e){if(void 0===e&&(e=!1),S){wt({type:Ae.Meta,data:{href:window.location.href,width:we(),height:be()}},e),W.reset(),Y.init(),Ye.forEach((e=>e.lock()));var t=function(e,t){var{mirror:r=new x,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:g,preserveWhiteSpace:_,onSerialize:v,onIframeLoad:f,iframeLoadTimeout:m,onStylesheetLoad:y,stylesheetLoadTimeout:b,keepIframeSrcFn:w=(()=>!1)}=t||{};return ee(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:g,inlineImages:l,recordCanvas:u,preserveWhiteSpace:_,onSerialize:v,onIframeLoad:f,iframeLoadTimeout:m,onStylesheetLoad:y,stylesheetLoadTimeout:b,keepIframeSrcFn:w,newlyAddedElement:!1})}(document,{mirror:Ft,blockClass:s,blockSelector:o,maskTextClass:u,maskTextSelector:c,inlineStylesheet:d,maskAllInputs:D,maskTextFn:v,maskInputFn:_,slimDOM:B,dataURLOptions:b,recordCanvas:C,inlineImages:R,onSerialize(e){Ee(e,Ft)&&j.addIframe(e),Te(e,Ft)&&W.trackLinkElement(e),Re(e)&&Y.addShadowRoot(de.shadowRoot(e),document)},onIframeLoad(e,t){j.attachIframe(e,t),Y.observeAttachShadow(e)},onStylesheetLoad(e,t){W.attachLinkElement(e,t)},keepIframeSrcFn:L});if(!t)return console.warn("Failed to snapshot the document");wt({type:Ae.FullSnapshot,data:{node:t,initialOffset:ye(window)}},e),Ye.forEach((e=>e.unlock())),document.adoptedStyleSheets&&document.adoptedStyleSheets.length>0&&W.adoptStyleSheets(document.adoptedStyleSheets,Ft.getId(document))}};try{var X=[],K=e=>{var t;return Ze(nt)({mutationCb:z,mousemoveCb:(e,t)=>wt({type:Ae.IncrementalSnapshot,data:{source:t,positions:e}}),mouseInteractionCb:e=>wt({type:Ae.IncrementalSnapshot,data:r({source:Fe.MouseInteraction},e)}),scrollCb:V,viewportResizeCb:e=>wt({type:Ae.IncrementalSnapshot,data:r({source:Fe.ViewportResize},e)}),inputCb:e=>wt({type:Ae.IncrementalSnapshot,data:r({source:Fe.Input},e)}),mediaInteractionCb:e=>wt({type:Ae.IncrementalSnapshot,data:r({source:Fe.MediaInteraction},e)}),styleSheetRuleCb:e=>wt({type:Ae.IncrementalSnapshot,data:r({source:Fe.StyleSheetRule},e)}),styleDeclarationCb:e=>wt({type:Ae.IncrementalSnapshot,data:r({source:Fe.StyleDeclaration},e)}),canvasMutationCb:U,fontCb:e=>wt({type:Ae.IncrementalSnapshot,data:r({source:Fe.Font},e)}),selectionCb(e){wt({type:Ae.IncrementalSnapshot,data:r({source:Fe.Selection},e)})},customElementCb(e){wt({type:Ae.IncrementalSnapshot,data:r({source:Fe.CustomElement},e)})},blockClass:s,ignoreClass:a,ignoreSelector:l,maskTextClass:u,maskTextSelector:c,maskInputOptions:D,inlineStylesheet:d,sampling:y,recordDOM:S,recordCanvas:C,inlineImages:R,userTriggeredOnInput:E,collectFonts:T,doc:e,maskInputFn:_,maskTextFn:v,keepIframeSrcFn:L,blockSelector:o,slimDOMOptions:B,dataURLOptions:b,mirror:Ft,iframeManager:j,stylesheetManager:W,shadowDomManager:Y,processedNodeManager:Z,canvasManager:Ct,ignoreCSSAttributes:P,plugins:(null==(t=null==M?void 0:M.filter((e=>e.observer)))?void 0:t.map((e=>({observer:e.observer,options:e.options,callback:t=>wt({type:Ae.Plugin,data:{plugin:e.name,payload:t}})}))))||[]},f)};j.addLoadListener((e=>{try{X.push(K(e.contentDocument))}catch(e){console.warn(e)}}));var J=()=>{St(),X.push(K(document)),Mt=!0};return"interactive"===document.readyState||"complete"===document.readyState?J():(X.push(he("DOMContentLoaded",(()=>{wt({type:Ae.DomContentLoaded,data:{}}),"DOMContentLoaded"===k&&J()}))),X.push(he("load",(()=>{wt({type:Ae.Load,data:{}}),"load"===k&&J()}),window))),()=>{X.forEach((e=>e())),Z.destroy(),Mt=!1,ze=void 0}}catch(e){console.warn(e)}}Nt.addCustomEvent=(e,t)=>{if(!Mt)throw new Error("please add custom event after start recording");wt({type:Ae.Custom,data:{tag:e,payload:t}})},Nt.freezePage=()=>{Ye.forEach((e=>e.freeze()))},Nt.takeFullSnapshot=e=>{if(!Mt)throw new Error("please take full snapshot after start recording");St(e)},Nt.mirror=Ft,(At=Pt||(Pt={}))[At.NotStarted=0]="NotStarted",At[At.Running=1]="Running",At[At.Stopped=2]="Stopped";var Ot,Dt=Object.defineProperty,Bt=(e,t,r)=>((e,t,r)=>t in e?Dt(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r)(e,"symbol"!=typeof t?t+"":t,r),Ht=Object.defineProperty,qt=(e,t,r)=>((e,t,r)=>t in e?Ht(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r)(e,"symbol"!=typeof t?t+"":t,r),zt=Object.defineProperty,Vt=(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),$t={Node:["childNodes","parentNode","parentElement","textContent"],ShadowRoot:["host","styleSheets"],Element:["shadowRoot","querySelector","querySelectorAll"],MutationObserver:[]},Ut={Node:["contains","getRootNode"],ShadowRoot:["getSelection"],Element:[],MutationObserver:["constructor"]},Wt={};function jt(e){if(Wt[e])return Wt[e];var t=globalThis[e],r=t.prototype,i=e in $t?$t[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 Ut?Ut[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 Wt[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?Wt[e]=u:r}catch(e){return r}}var Gt={};function Zt(e,t,r){var i,n=e+"."+String(r);if(Gt[n])return Gt[n].call(t);var s=jt(e),o=null==(i=Object.getOwnPropertyDescriptor(s,r))?void 0:i.get;return o?(Gt[n]=o,o.call(t)):t[r]}var Yt={};function Xt(e,t,r){var i=e+"."+String(r);if(Yt[i])return Yt[i].bind(t);var n=jt(e)[r];return"function"!=typeof n?t[r]:(Yt[i]=n,n.bind(t))}var Kt={childNodes:e=>Zt("Node",e,"childNodes"),parentNode:e=>Zt("Node",e,"parentNode"),parentElement:e=>Zt("Node",e,"parentElement"),textContent:e=>Zt("Node",e,"textContent"),contains:(e,t)=>Xt("Node",e,"contains")(t),getRootNode:e=>Xt("Node",e,"getRootNode")(),host:e=>e&&"host"in e?Zt("ShadowRoot",e,"host"):null,styleSheets:e=>e.styleSheets,shadowRoot:e=>e&&"shadowRoot"in e?Zt("Element",e,"shadowRoot"):null,querySelector:(e,t)=>Zt("Element",e,"querySelector")(t),querySelectorAll:(e,t)=>Zt("Element",e,"querySelectorAll")(t),mutationObserver:()=>jt("MutationObserver").constructor};function Jt(e,t,r){if(!e)return!1;if(e.nodeType!==e.ELEMENT_NODE)return!!r&&Jt(Kt.parentNode(e),t,r);for(var i=e.classList.length;i--;)if(t.test(e.classList[i]))return!0;return!!r&&Jt(Kt.parentNode(e),t,r)}class Qt{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 Qt))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 er={Node:["childNodes","parentNode","parentElement","textContent"],ShadowRoot:["host","styleSheets"],Element:["shadowRoot","querySelector","querySelectorAll"],MutationObserver:[]},tr={Node:["contains","getRootNode"],ShadowRoot:["getSelection"],Element:[],MutationObserver:["constructor"]},rr={};function ir(e){if(rr[e])return rr[e];var t=globalThis[e],r=t.prototype,i=e in er?er[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 tr?tr[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 rr[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?rr[e]=u:r}catch(e){return r}}var nr={};function sr(e,t,r){var i,n=e+"."+String(r);if(nr[n])return nr[n].call(t);var s=ir(e),o=null==(i=Object.getOwnPropertyDescriptor(s,r))?void 0:i.get;return o?(nr[n]=o,o.call(t)):t[r]}var or={};function ar(e,t,r){var i=e+"."+String(r);if(or[i])return or[i].bind(t);var n=ir(e)[r];return"function"!=typeof n?t[r]:(or[i]=n,n.bind(t))}var lr={childNodes:e=>sr("Node",e,"childNodes"),parentNode:e=>sr("Node",e,"parentNode"),parentElement:e=>sr("Node",e,"parentElement"),textContent:e=>sr("Node",e,"textContent"),contains:(e,t)=>ar("Node",e,"contains")(t),getRootNode:e=>ar("Node",e,"getRootNode")(),host:e=>e&&"host"in e?sr("ShadowRoot",e,"host"):null,styleSheets:e=>e.styleSheets,shadowRoot:e=>e&&"shadowRoot"in e?sr("Element",e,"shadowRoot"):null,querySelector:(e,t)=>sr("Element",e,"querySelector")(t),querySelectorAll:(e,t)=>sr("Element",e,"querySelectorAll")(t),mutationObserver:()=>ir("MutationObserver").constructor},ur="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.",cr={map:{},getId(){return console.error(ur),-1},getNode(){return console.error(ur),null},removeNodeFromMap(){console.error(ur)},has(){return console.error(ur),!1},reset(){console.error(ur)}};"undefined"!=typeof window&&window.Proxy&&window.Reflect&&(cr=new Proxy(cr,{get(e,t,r){return"map"===t&&console.error(ur),Reflect.get(e,t,r)}}));var dr,hr=Date.now;function pr(e){return e?e.nodeType===e.ELEMENT_NODE?e:lr.parentElement(e):null}function gr(e){var t,r=null;return"getRootNode"in e&&(null==(t=lr.getRootNode(e))?void 0:t.nodeType)===Node.DOCUMENT_FRAGMENT_NODE&&lr.host(lr.getRootNode(e))&&(r=lr.host(lr.getRootNode(e))),r}function _r(e){for(var t,r=e;t=gr(r);)r=t;return r}function vr(e){var t=e.ownerDocument;if(!t)return!1;var r=_r(e);return lr.contains(t,r)}/[1-9][0-9]{12}/.test(Date.now().toString())||(hr=()=>(new Date).getTime());for(var fr=(Object.freeze(Object.defineProperty({__proto__:null,StyleSheetMirror:class{constructor(){qt(this,"id",1),qt(this,"styleIDMap",new WeakMap),qt(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 cr},closestElementOfNode:pr,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(e){var t=[...e],r=t.pop();return{positions:t,index:r}},getRootShadowHost:_r,getShadowHost:gr,getWindowHeight:()=>window.innerHeight||document.documentElement&&document.documentElement.clientHeight||document.body&&document.body.clientHeight,getWindowScroll(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=lr.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=lr.parentElement(s.body))?void 0:i.scrollTop)||(null==(n=null==s?void 0:s.body)?void 0:n.scrollTop)||0}},getWindowWidth:()=>window.innerWidth||document.documentElement&&document.documentElement.clientWidth||document.body&&document.body.clientWidth,hasShadowRoot:e=>!!e&&(e instanceof Qt&&"shadowRoot"in e?Boolean(e.shadowRoot):Boolean(lr.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(e){var t=e.ownerDocument;return!!t&&(lr.contains(t,e)||vr(e))},isAncestorRemoved:function e(t,r){if(n=(i=t)&&"host"in i&&"mode"in i&&Kt.host(i)||null,Boolean(n&&"shadowRoot"in n&&Kt.shadowRoot(n)===i))return!1;var i,n,s=r.getId(t);if(!r.has(s))return!0;var o=lr.parentNode(t);return(!o||o.nodeType!==t.DOCUMENT_NODE)&&(!o||e(o,r))},isBlocked(e,t,r,i){if(!e)return!1;var n=pr(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(Jt(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:(e,t,r)=>!("TITLE"!==e.tagName||!r.headTitleMutations)||-2===t.getId(e),isSerialized:(e,t)=>-1!==t.getId(e),isSerializedIframe:(e,t)=>Boolean("IFRAME"===e.nodeName&&t.getMeta(e)),isSerializedStylesheet:(e,t)=>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:e=>Boolean(e.changedTouches),get nowTimestamp(){return hr},on(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(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(e){void 0===e&&(e=window),"NodeList"in e&&!e.NodeList.prototype.forEach&&(e.NodeList.prototype.forEach=[].forEach),"DOMTokenList"in e&&!e.DOMTokenList.prototype.forEach&&(e.DOMTokenList.prototype.forEach=[].forEach)},queueToResolveTrees(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:vr,throttle(e,t,r){void 0===r&&(r={});var i=null,n=0;return function(){for(var s=arguments.length,o=new Array(s),a=0;s>a;a++)o[a]=arguments[a];var l=Date.now();n||!1!==r.leading||(n=l);var u=t-(l-n),c=this;0>=u||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(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"}))),mr="undefined"==typeof Uint8Array?[]:new Uint8Array(256),yr=0;64>yr;yr++)mr["ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charCodeAt(yr)]=yr;"undefined"!=typeof window&&window.Blob&&new Blob([Uint8Array.from(atob("KGZ1bmN0aW9uKCkgewogICJ1c2Ugc3RyaWN0IjsKICB2YXIgY2hhcnMgPSAiQUJDREVGR0hJSktMTU5PUFFSU1RVVldYWVphYmNkZWZnaGlqa2xtbm9wcXJzdHV2d3h5ejAxMjM0NTY3ODkrLyI7CiAgdmFyIGxvb2t1cCA9IHR5cGVvZiBVaW50OEFycmF5ID09PSAidW5kZWZpbmVkIiA/IFtdIDogbmV3IFVpbnQ4QXJyYXkoMjU2KTsKICBmb3IgKHZhciBpID0gMDsgaSA8IGNoYXJzLmxlbmd0aDsgaSsrKSB7CiAgICBsb29rdXBbY2hhcnMuY2hhckNvZGVBdChpKV0gPSBpOwogIH0KICB2YXIgZW5jb2RlID0gZnVuY3Rpb24oYXJyYXlidWZmZXIpIHsKICAgIHZhciBieXRlcyA9IG5ldyBVaW50OEFycmF5KGFycmF5YnVmZmVyKSwgaTIsIGxlbiA9IGJ5dGVzLmxlbmd0aCwgYmFzZTY0ID0gIiI7CiAgICBmb3IgKGkyID0gMDsgaTIgPCBsZW47IGkyICs9IDMpIHsKICAgICAgYmFzZTY0ICs9IGNoYXJzW2J5dGVzW2kyXSA+PiAyXTsKICAgICAgYmFzZTY0ICs9IGNoYXJzWyhieXRlc1tpMl0gJiAzKSA8PCA0IHwgYnl0ZXNbaTIgKyAxXSA+PiA0XTsKICAgICAgYmFzZTY0ICs9IGNoYXJzWyhieXRlc1tpMiArIDFdICYgMTUpIDw8IDIgfCBieXRlc1tpMiArIDJdID4+IDZdOwogICAgICBiYXNlNjQgKz0gY2hhcnNbYnl0ZXNbaTIgKyAyXSAmIDYzXTsKICAgIH0KICAgIGlmIChsZW4gJSAzID09PSAyKSB7CiAgICAgIGJhc2U2NCA9IGJhc2U2NC5zdWJzdHJpbmcoMCwgYmFzZTY0Lmxlbmd0aCAtIDEpICsgIj0iOwogICAgfSBlbHNlIGlmIChsZW4gJSAzID09PSAxKSB7CiAgICAgIGJhc2U2NCA9IGJhc2U2NC5zdWJzdHJpbmcoMCwgYmFzZTY0Lmxlbmd0aCAtIDIpICsgIj09IjsKICAgIH0KICAgIHJldHVybiBiYXNlNjQ7CiAgfTsKICBjb25zdCBsYXN0QmxvYk1hcCA9IC8qIEBfX1BVUkVfXyAqLyBuZXcgTWFwKCk7CiAgY29uc3QgdHJhbnNwYXJlbnRCbG9iTWFwID0gLyogQF9fUFVSRV9fICovIG5ldyBNYXAoKTsKICBhc3luYyBmdW5jdGlvbiBnZXRUcmFuc3BhcmVudEJsb2JGb3Iod2lkdGgsIGhlaWdodCwgZGF0YVVSTE9wdGlvbnMpIHsKICAgIGNvbnN0IGlkID0gYCR7d2lkdGh9LSR7aGVpZ2h0fWA7CiAgICBpZiAoIk9mZnNjcmVlbkNhbnZhcyIgaW4gZ2xvYmFsVGhpcykgewogICAgICBpZiAodHJhbnNwYXJlbnRCbG9iTWFwLmhhcyhpZCkpIHJldHVybiB0cmFuc3BhcmVudEJsb2JNYXAuZ2V0KGlkKTsKICAgICAgY29uc3Qgb2Zmc2NyZWVuID0gbmV3IE9mZnNjcmVlbkNhbnZhcyh3aWR0aCwgaGVpZ2h0KTsKICAgICAgb2Zmc2NyZWVuLmdldENvbnRleHQoIjJkIik7CiAgICAgIGNvbnN0IGJsb2IgPSBhd2FpdCBvZmZzY3JlZW4uY29udmVydFRvQmxvYihkYXRhVVJMT3B0aW9ucyk7CiAgICAgIGNvbnN0IGFycmF5QnVmZmVyID0gYXdhaXQgYmxvYi5hcnJheUJ1ZmZlcigpOwogICAgICBjb25zdCBiYXNlNjQgPSBlbmNvZGUoYXJyYXlCdWZmZXIpOwogICAgICB0cmFuc3BhcmVudEJsb2JNYXAuc2V0KGlkLCBiYXNlNjQpOwogICAgICByZXR1cm4gYmFzZTY0OwogICAgfSBlbHNlIHsKICAgICAgcmV0dXJuICIiOwogICAgfQogIH0KICBjb25zdCB3b3JrZXIgPSBzZWxmOwogIHdvcmtlci5vbm1lc3NhZ2UgPSBhc3luYyBmdW5jdGlvbihlKSB7CiAgICBpZiAoIk9mZnNjcmVlbkNhbnZhcyIgaW4gZ2xvYmFsVGhpcykgewogICAgICBjb25zdCB7IGlkLCBiaXRtYXAsIHdpZHRoLCBoZWlnaHQsIGRhdGFVUkxPcHRpb25zIH0gPSBlLmRhdGE7CiAgICAgIGNvbnN0IHRyYW5zcGFyZW50QmFzZTY0ID0gZ2V0VHJhbnNwYXJlbnRCbG9iRm9yKAogICAgICAgIHdpZHRoLAogICAgICAgIGhlaWdodCwKICAgICAgICBkYXRhVVJMT3B0aW9ucwogICAgICApOwogICAgICBjb25zdCBvZmZzY3JlZW4gPSBuZXcgT2Zmc2NyZWVuQ2FudmFzKHdpZHRoLCBoZWlnaHQpOwogICAgICBjb25zdCBjdHggPSBvZmZzY3JlZW4uZ2V0Q29udGV4dCgiMmQiKTsKICAgICAgY3R4LmRyYXdJbWFnZShiaXRtYXAsIDAsIDApOwogICAgICBiaXRtYXAuY2xvc2UoKTsKICAgICAgY29uc3QgYmxvYiA9IGF3YWl0IG9mZnNjcmVlbi5jb252ZXJ0VG9CbG9iKGRhdGFVUkxPcHRpb25zKTsKICAgICAgY29uc3QgdHlwZSA9IGJsb2IudHlwZTsKICAgICAgY29uc3QgYXJyYXlCdWZmZXIgPSBhd2FpdCBibG9iLmFycmF5QnVmZmVyKCk7CiAgICAgIGNvbnN0IGJhc2U2NCA9IGVuY29kZShhcnJheUJ1ZmZlcik7CiAgICAgIGlmICghbGFzdEJsb2JNYXAuaGFzKGlkKSAmJiBhd2FpdCB0cmFuc3BhcmVudEJhc2U2NCA9PT0gYmFzZTY0KSB7CiAgICAgICAgbGFzdEJsb2JNYXAuc2V0KGlkLCBiYXNlNjQpOwogICAgICAgIHJldHVybiB3b3JrZXIucG9zdE1lc3NhZ2UoeyBpZCB9KTsKICAgICAgfQogICAgICBpZiAobGFzdEJsb2JNYXAuZ2V0KGlkKSA9PT0gYmFzZTY0KSByZXR1cm4gd29ya2VyLnBvc3RNZXNzYWdlKHsgaWQgfSk7CiAgICAgIHdvcmtlci5wb3N0TWVzc2FnZSh7CiAgICAgICAgaWQsCiAgICAgICAgdHlwZSwKICAgICAgICBiYXNlNjQsCiAgICAgICAgd2lkdGgsCiAgICAgICAgaGVpZ2h0CiAgICAgIH0pOwogICAgICBsYXN0QmxvYk1hcC5zZXQoaWQsIGJhc2U2NCk7CiAgICB9IGVsc2UgewogICAgICByZXR1cm4gd29ya2VyLnBvc3RNZXNzYWdlKHsgaWQ6IGUuZGF0YS5pZCB9KTsKICAgIH0KICB9Owp9KSgpOwovLyMgc291cmNlTWFwcGluZ1VSTD1pbWFnZS1iaXRtYXAtZGF0YS11cmwtd29ya2VyLUlKcEM3Z19iLmpzLm1hcAo="),(e=>e.charCodeAt(0)))],{type:"text/javascript;charset=utf-8"});try{if(2!==Array.from([1],(e=>2*e))[0]){var br=document.createElement("iframe");document.body.appendChild(br),Array.from=(null==(Ot=br.contentWindow)?void 0:Ot.Array.from)||Array.from,document.body.removeChild(br)}}catch(e){console.debug("Unable to override Array.from",e)}new class{constructor(){Vt(this,"idNodeMap",new Map),Vt(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){this.idNodeMap.set(t.id,e),this.nodeMetaMap.set(e,t)}replace(e,t){var r=this.getNode(e);if(r){var i=this.nodeMetaMap.get(r);i&&this.nodeMetaMap.set(t,i)}this.idNodeMap.set(e,t)}reset(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap}},function(e){e[e.NotStarted=0]="NotStarted",e[e.Running=1]="Running",e[e.Stopped=2]="Stopped"}(dr||(dr={}));class wr{constructor(e){Bt(this,"fileName"),Bt(this,"functionName"),Bt(this,"lineNumber"),Bt(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 Sr=/(^|@)\S+:\d+/,Cr=/^\s*at .*(\S+:\d+|\(native\))/m,Ir=/^(eval@)?(\[native code])?$/,kr={parse(e){return e?void 0!==e.stacktrace||void 0!==e["opera#sourceloc"]?this.parseOpera(e):e.stack&&e.stack.match(Cr)?this.parseV8OrIE(e):e.stack?this.parseFFOrSafari(e):(console.warn("[console-record-plugin]: Failed to parse error object:",e),[]):[]},extractLocation(e){if(-1===e.indexOf(":"))return[e];var t=/(.+?)(?::(\d+))?(?::(\d+))?$/.exec(e.replace(/[()]/g,""));if(!t)throw new Error("Cannot parse given url: "+e);return[t[1],t[2]||void 0,t[3]||void 0]},parseV8OrIE(e){return e.stack.split("\n").filter((function(e){return!!e.match(Cr)}),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 wr({functionName:s,fileName:o,lineNumber:n[1],columnNumber:n[2]})}),this)},parseFFOrSafari(e){return e.stack.split("\n").filter((function(e){return!e.match(Ir)}),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 wr({functionName:e});var t=/((.*".+"[^@]*)?[^@]*)(?:@)/,r=e.match(t),i=r&&r[1]?r[1]:void 0,n=this.extractLocation(e.replace(t,""));return new wr({functionName:i,fileName:n[0],lineNumber:n[1],columnNumber:n[2]})}),this)},parseOpera(e){return!e.stacktrace||e.message.indexOf("\n")>-1&&e.message.split("\n").length>e.stacktrace.split("\n").length?this.parseOpera9(e):e.stack?this.parseOpera11(e):this.parseOpera10(e)},parseOpera9(e){for(var t=/Line (\d+).*script (?:in )?(\S+)/i,r=e.message.split("\n"),i=[],n=2,s=r.length;s>n;n+=2){var o=t.exec(r[n]);o&&i.push(new wr({fileName:o[2],lineNumber:parseFloat(o[1])}))}return i},parseOpera10(e){for(var t=/Line (\d+).*script (?:in )?(\S+)(?:: In function (\S+))?$/i,r=e.stacktrace.split("\n"),i=[],n=0,s=r.length;s>n;n+=2){var o=t.exec(r[n]);o&&i.push(new wr({functionName:o[3]||void 0,fileName:o[2],lineNumber:parseFloat(o[1])}))}return i},parseOpera11(e){return e.stack.split("\n").filter((function(e){return!!e.match(Sr)&&!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 wr({functionName:i,fileName:r[0],lineNumber:r[1],columnNumber:r[2]})}),this)}};function xr(e){if(!e||!e.outerHTML)return"";for(var t="";e.parentElement;){var r=e.localName;if(!r)break;r=r.toLowerCase();var i=e.parentElement,n=[];if(i.children&&i.children.length>0)for(var s=0;i.children.length>s;s++){var o=i.children[s];o.localName&&o.localName.toLowerCase&&o.localName.toLowerCase()===r&&n.push(o)}n.length>1&&(r+=":eq("+n.indexOf(e)+")"),t=r+(t?">"+t:""),e=i}return t}function Er(e){return"[object Object]"==={}.toString.call(e)}function Tr(e,t){if(0===t)return!0;var r=Object.keys(e);for(var i of r)if(Er(e[i])&&Tr(e[i],t-1))return!0;return!1}function Rr(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(Er(o=t)&&Object.keys(o).length>r.numOfKeysLimit||"function"==typeof o||Er(o)&&Tr(o,r.depthOfLimit))return function(e){var t=e.toString();return r.stringLengthLimit&&t.length>r.stringLengthLimit&&(t=t.slice(0,r.stringLengthLimit)+"..."),t}(t);var o;if("bigint"==typeof t)return t.toString()+"n";if(t instanceof Event){var a={};for(var l in t){var u=t[l];a[l]=Array.isArray(u)?xr(u.length?u[0]:null):u}return a}return t instanceof Node?t instanceof HTMLElement?t?t.outerHTML:"":t.nodeName:t instanceof Error?t.stack?t.stack+"\nEnd of stack for Error object":t.name+": "+t.message:t}))}var Mr={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 Lr(e,t,r){var i,n=r?Object.assign({},Mr,r):Mr,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=kr.parse(t.error).map((e=>e.toString())),s=[Rr(r,n.stringifyOptions)];e({level:"error",trace:i,payload:s})};t.addEventListener("error",u),l.push((()=>{t.removeEventListener("error",u)}));var c=t=>{var r,i;t.reason instanceof Error?i=[Rr("Uncaught (in promise) "+(r=t.reason).name+": "+r.message,n.stringifyOptions)]:(r=new Error,i=[Rr("Uncaught (in promise)",n.stringifyOptions),Rr(t.reason,n.stringifyOptions)]);var s=kr.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]?fr.patch(t,r,(t=>function(){for(var s=arguments.length,l=new Array(s),u=0;s>u;u++)l[u]=arguments[u];if(t.apply(i,l),!("assert"===r&&l[0]||a)){a=!0;try{var c=kr.parse(new Error).map((e=>e.toString())).splice(1),d=("assert"===r?l.slice(1):l).map((e=>Rr(e,n.stringifyOptions)));o++,n.lengthThreshold>o?e({level:r,trace:c,payload:d}):o===n.lengthThreshold&&e({level:"warn",trace:[],payload:[Rr("The number of log records reached the threshold.")]})}catch(e){t("rrweb logger error:",e,...l)}finally{a=!1}}})):()=>{}}}var Pr=e=>({name:"rrweb/console@1",observer:Lr,options:e});function Ar(){return(Ar=t((function*(e,t,r){void 0===t&&(t=!0);try{var i=new Blob([e],{type:"text/plain"}).stream().pipeThrough(new CompressionStream("gzip"));return yield new Response(i).blob()}catch(e){if(null!=r&&r.rethrow)throw e;return t&&console.error("Failed to gzip compress data",e),null}}))).apply(this,arguments)}var Fr=["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"],Nr=function(e,t){if(void 0===t&&(t=[]),!e)return!1;var r=e.toLowerCase();return Fr.concat(t).some((e=>{var t=e.toLowerCase();return-1!==r.indexOf(t)}))},Or=function(e){return e.MinLength="min_length",e.MaxLength="max_length",e}({}),Dr=["$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 Br(e,t){return-1!==e.indexOf(t)}var Hr=function(e){return e.trim()},qr=function(e){return e.replace(/^\$/,"")},zr=Object.prototype,Vr=zr.hasOwnProperty,$r=zr.toString,Ur=Array.isArray||function(e){return"[object Array]"===$r.call(e)},Wr=e=>"function"==typeof e,jr=e=>e===Object(e)&&!Ur(e),Gr=e=>{if(jr(e)){for(var t in e)if(Vr.call(e,t))return!1;return!0}return!1},Zr=e=>void 0===e,Yr=e=>"[object String]"==$r.call(e),Xr=e=>Yr(e)&&0===e.trim().length,Kr=e=>null===e,Jr=e=>Zr(e)||Kr(e),Qr=e=>"[object Number]"==$r.call(e)&&e==e,ei=e=>Qr(e)&&e>0,ti=e=>"[object Boolean]"===$r.call(e),ri=e=>e instanceof FormData;function ii(e){return null===e||"object"!=typeof e}function ni(e,t){return{}.toString.call(e)==="[object "+t+"]"}function si(e){return"undefined"!=typeof Event&&function(e,t){try{return e instanceof t}catch(e){return!1}}(e,Event)}var oi=[!0,"true",1,"1","yes"],ai=e=>Br(oi,e),li=[!1,"false",0,"0","no"];function ui(e,t,r,i,n){return t>r&&(i.warn("min cannot be greater than max."),t=r),Qr(e)?e>r?(i.warn(" cannot be greater than max: "+r+". Using max value instead."),r):t>e?(i.warn(" cannot be less than min: "+t+". Using min value instead."),t):e:(i.warn(" must be a number. using max or fallback. max: "+r+", fallback: "+n),ui(n||r,t,r,i))}class ci{constructor(e){this._buckets={},this._onBucketRateLimited=e._onBucketRateLimited,this._bucketSize=ui(e.bucketSize,0,100,e._logger),this._refillRate=ui(e.refillRate,0,this._bucketSize,e._logger),this._refillInterval=ui(e.refillInterval,0,864e5,e._logger)}_applyRefill(e,t){var r=Math.floor((t-e.lastAccess)/this._refillInterval);r>0&&(e.tokens=Math.min(e.tokens+r*this._refillRate,this._bucketSize),e.lastAccess=e.lastAccess+r*this._refillInterval)}consumeRateLimit(e){var t,r=Date.now(),i=String(e),n=this._buckets[i];return n?this._applyRefill(n,r):this._buckets[i]=n={tokens:this._bucketSize,lastAccess:r},0===n.tokens||(n.tokens--,0===n.tokens&&(null==(t=this._onBucketRateLimited)||t.call(this,e)),0===n.tokens)}stop(){this._buckets={}}}var di,hi,pi,gi="Mobile",_i="iOS",vi="Android",fi="Tablet",mi=vi+" "+fi,yi="iPad",bi="Apple",wi=bi+" Watch",Si="Safari",Ci="BlackBerry",Ii="Samsung",ki=Ii+"Browser",xi=Ii+" Internet",Ei="Chrome",Ti=Ei+" OS",Ri=Ei+" "+_i,Mi="Internet Explorer",Li=Mi+" "+gi,Pi="Opera",Ai=Pi+" Mini",Fi="Edge",Ni="Microsoft "+Fi,Oi="Firefox",Di=Oi+" "+_i,Bi="Nintendo",Hi="PlayStation",qi="Xbox",zi=vi+" "+gi,Vi=gi+" "+Si,$i="Windows",Ui=$i+" Phone",Wi="Nokia",ji="Ouya",Gi="Generic",Zi=Gi+" "+gi.toLowerCase(),Yi=Gi+" "+fi.toLowerCase(),Xi="Konqueror",Ki="(\\d+(\\.\\d+)?)",Ji=new RegExp("Version/"+Ki),Qi=new RegExp(qi,"i"),en=new RegExp(Hi+" \\w+","i"),tn=new RegExp(Bi+" \\w+","i"),rn=new RegExp(Ci+"|PlayBook|BB10","i"),nn={"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"},sn=function(e,t){return t=t||"",Br(e," OPR/")&&Br(e,"Mini")?Ai:Br(e," OPR/")?Pi:rn.test(e)?Ci:Br(e,"IE"+gi)||Br(e,"WPDesktop")?Li:Br(e,ki)?xi:Br(e,Fi)||Br(e,"Edg/")?Ni:Br(e,"FBIOS")?"Facebook "+gi:Br(e,"UCWEB")||Br(e,"UCBrowser")?"UC Browser":Br(e,"CriOS")?Ri:Br(e,"CrMo")||Br(e,Ei)?Ei:Br(e,vi)&&Br(e,Si)?zi:Br(e,"FxiOS")?Di:Br(e.toLowerCase(),Xi.toLowerCase())?Xi:((e,t)=>t&&Br(t,bi)||function(e){return Br(e,Si)&&!Br(e,Ei)&&!Br(e,vi)}(e))(e,t)?Br(e,gi)?Vi:Si:Br(e,Oi)?Oi:Br(e,"MSIE")||Br(e,"Trident/")?Mi:Br(e,"Gecko")?Oi:""},on={[Li]:[new RegExp("rv:"+Ki)],[Ni]:[new RegExp(Fi+"?\\/"+Ki)],[Ei]:[new RegExp("("+Ei+"|CrMo)\\/"+Ki)],[Ri]:[new RegExp("CriOS\\/"+Ki)],"UC Browser":[new RegExp("(UCBrowser|UCWEB)\\/"+Ki)],[Si]:[Ji],[Vi]:[Ji],[Pi]:[new RegExp("(Opera|OPR)\\/"+Ki)],[Oi]:[new RegExp(Oi+"\\/"+Ki)],[Di]:[new RegExp("FxiOS\\/"+Ki)],[Xi]:[new RegExp("Konqueror[:/]?"+Ki,"i")],[Ci]:[new RegExp(Ci+" "+Ki),Ji],[zi]:[new RegExp("android\\s"+Ki,"i")],[xi]:[new RegExp(ki+"\\/"+Ki)],[Mi]:[new RegExp("(rv:|MSIE )"+Ki)],Mozilla:[new RegExp("rv:"+Ki)]},an=function(e,t){var r=sn(e,t),i=on[r];if(Zr(i))return null;for(var n=0;i.length>n;n++){var s=e.match(i[n]);if(s)return parseFloat(s[s.length-2])}return null},ln=[[new RegExp(qi+"; "+qi+" (.*?)[);]","i"),e=>[qi,e&&e[1]||""]],[new RegExp(Bi,"i"),[Bi,""]],[new RegExp(Hi,"i"),[Hi,""]],[rn,[Ci,""]],[new RegExp($i,"i"),(e,t)=>{if(/Phone/.test(t)||/WPDesktop/.test(t))return[Ui,""];if(new RegExp(gi).test(t)&&!/IEMobile\b/.test(t))return[$i+" "+gi,""];var r=/Windows NT ([0-9.]+)/i.exec(t);if(r&&r[1]){var i=nn[r[1]]||"";return/arm/i.test(t)&&(i="RT"),[$i,i]}return[$i,""]}],[/((iPhone|iPad|iPod).*?OS (\d+)_(\d+)_?(\d+)?|iPhone)/,e=>e&&e[3]?[_i,[e[3],e[4],e[5]||"0"].join(".")]:[_i,""]],[/(watch.*\/(\d+\.\d+\.\d+)|watch os,(\d+\.\d+),)/i,e=>{var t="";return e&&e.length>=3&&(t=Zr(e[2])?e[3]:e[2]),["watchOS",t]}],[new RegExp("("+vi+" (\\d+)\\.(\\d+)\\.?(\\d+)?|"+vi+")","i"),e=>e&&e[2]?[vi,[e[2],e[3],e[4]||"0"].join(".")]:[vi,""]],[/Mac OS X (\d+)[_.](\d+)[_.]?(\d+)?/i,e=>{var t=["Mac OS X",""];return e&&e[1]&&(t[1]=[e[1],e[2],e[3]||"0"].join(".")),t}],[/Mac/i,["Mac OS X",""]],[/CrOS/,[Ti,""]],[/Linux|debian/i,["Linux",""]]],un=function(e){return tn.test(e)?Bi:en.test(e)?Hi:Qi.test(e)?qi:new RegExp(ji,"i").test(e)?ji:new RegExp("("+Ui+"|WPDesktop)","i").test(e)?Ui:/iPad/.test(e)?yi:/iPod/.test(e)?"iPod Touch":/iPhone/.test(e)?"iPhone":/(watch)(?: ?os[,/]|\d,\d\/)[\d.]+/i.test(e)?wi:rn.test(e)?Ci:/(kobo)\s(ereader|touch)/i.test(e)?"Kobo":new RegExp(Wi,"i").test(e)?Wi:/(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(gi).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)?vi:mi:new RegExp("(pda|"+gi+")","i").test(e)?Zi:new RegExp(fi,"i").test(e)&&!new RegExp(fi+" pc","i").test(e)?Yi:""},cn=function(e,t){var r,i,n,s,o=un(e);return o===yi||o===mi||"Kobo"===o||"Kindle Fire"===o||o===Yi?fi:o===Bi||o===qi||o===Hi||o===ji?"Console":o===wi?"Wearable":o?gi:"Android"===(null==t?void 0:t.userAgentDataPlatform)&&(null!==(r=null==t?void 0:t.maxTouchPoints)&&void 0!==r?r:0)>0?600>Math.min(null!==(i=null==t?void 0:t.screenWidth)&&void 0!==i?i:0,null!==(n=null==t?void 0:t.screenHeight)&&void 0!==n?n:0)/(null!==(s=null==t?void 0:t.devicePixelRatio)&&void 0!==s?s:1)?gi:fi:"Desktop"},dn={trace:{text:"TRACE",number:1},debug:{text:"DEBUG",number:5},info:{text:"INFO",number:9},warn:{text:"WARN",number:13},error:{text:"ERROR",number:17},fatal:{text:"FATAL",number:21}},hn=dn.info;function pn(e){if(ti(e))return{boolValue:e};if("number"==typeof e)return Number.isFinite(e)?Number.isInteger(e)?{intValue:e}:{doubleValue:e}:{stringValue:String(e)};if("string"==typeof e)return{stringValue:e};if(Ur(e))return{arrayValue:{values:e.map((e=>pn(e)))}};try{return{stringValue:JSON.stringify(e)}}catch(t){return{stringValue:String(e)}}}function gn(e){var t=[];for(var r in e){var i=e[r];Kr(i)||Zr(i)||t.push({key:r,value:pn(i)})}return t}function _n(e,t){if(e){var r=e.find((e=>e.type===t));return null==r?void 0:r.value}}function vn(e){var t=globalThis._posthogChunkIds;if(t){var r=Object.keys(t);return pi&&r.length===hi||(hi=r.length,pi=r.reduce(((r,i)=>{di||(di={});var n=di[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,di[i]=[l,u];break}}return r}),{})),pi}}class fn{constructor(e,t,r){void 0===r&&(r=[]),this.coercers=e,this.stackParser=t,this.modifiers=r}buildFromUnknown(e,t){void 0===t&&(t={});var r=t&&t.mechanism||{handled:!0,type:"generic"},i=this.buildCoercingContext(r,t,0).apply(e),n=this.buildParsingContext(t),s=this.parseStacktrace(i,n);return{$exception_list:this.convertToExceptionList(s,r),$exception_level:"error"}}modifyFrames(e){var r=this;return t((function*(){for(var t of e)t.stacktrace&&t.stacktrace.frames&&Ur(t.stacktrace.frames)&&(t.stacktrace.frames=yield r.applyModifiers(t.stacktrace.frames));return e}))()}coerceFallback(e){var t;return{type:"Error",value:"Unknown error",stack:null==(t=e.syntheticException)?void 0:t.stack,synthetic:!0}}parseStacktrace(e,t){var i,n;return null!=e.cause&&(i=this.parseStacktrace(e.cause,t)),""!=e.stack&&null!=e.stack&&(n=this.applyChunkIds(this.stackParser(e.stack,e.synthetic?t.skipFirstLines:0),t.chunkIdMap)),r({},e,{cause:i,stack:n})}applyChunkIds(e,t){return e.map((e=>(e.filename&&t&&(e.chunk_id=t[e.filename]),e)))}applyCoercers(e,t){for(var r of this.coercers)if(r.match(e))return r.coerce(e,t);return this.coerceFallback(t)}applyModifiers(e){var r=this;return t((function*(){var t=e;for(var i of r.modifiers)t=yield i(t);return t}))()}convertToExceptionList(e,t){var i,n,s,o={type:e.type,value:e.value,mechanism:{type:null!==(i=t.type)&&void 0!==i?i:"generic",handled:null===(n=t.handled)||void 0===n||n,synthetic:null!==(s=e.synthetic)&&void 0!==s&&s}};e.stack&&(o.stacktrace={type:"raw",frames:e.stack});var a=[o];return null!=e.cause&&a.push(...this.convertToExceptionList(e.cause,r({},t,{handled:!0}))),a}buildParsingContext(e){var t;return{chunkIdMap:vn(this.stackParser),skipFirstLines:null!==(t=e.skipFirstLines)&&void 0!==t?t:1}}buildCoercingContext(e,t,i){void 0===i&&(i=0);var n=(r,i)=>{if(4>=i){var n=this.buildCoercingContext(e,t,i);return this.applyCoercers(r,n)}};return r({},t,{syntheticException:0==i?t.syntheticException:void 0,mechanism:e,apply:e=>n(e,i),next:e=>n(e,i+1)})}}var mn="?";function yn(e,t,r,i,n){var s={platform:e,filename:t,function:"<anonymous>"===r?mn:r,in_app:!0};return Zr(i)||(s.lineno=i),Zr(n)||(s.colno=n),s}var bn=(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]:mn,r?"safari-extension:"+t:"safari-web-extension:"+t]:[e,t]},wn=/^\s*at (\S+?)(?::(\d+))(?::(\d+))\s*$/i,Sn=/^\s*at (?:(.+?\)(?: \[.+\])?|.*?) ?\((?:address at )?)?(?:async )?((?:<anonymous>|[-a-z]+:|.*bundle|\/)?.*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i,Cn=/\((\S*)(?::(\d+))(?::(\d+))\)/,In=(e,t)=>{var r=wn.exec(e);if(r){var[,i,n,s]=r;return yn(t,i,mn,+n,+s)}var o=Sn.exec(e);if(o){if(o[2]&&0===o[2].indexOf("eval")){var a=Cn.exec(o[2]);a&&(o[2]=a[1],o[3]=a[2],o[4]=a[3])}var[l,u]=bn(o[1]||mn,o[2]);return yn(t,u,l,o[3]?+o[3]:void 0,o[4]?+o[4]:void 0)}},kn=/^\s*(.*?)(?:\((.*?)\))?(?:^|@)?((?:[-a-z]+)?:\/.*?|\[native code\]|[^@]*(?:bundle|\d+\.js)|\/[\w\-. /=]+)(?::(\d+))?(?::(\d+))?\s*$/i,xn=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i,En=(e,t)=>{var r=kn.exec(e);if(r){if(r[3]&&r[3].indexOf(" > eval")>-1){var i=xn.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]||mn;return[s,n]=bn(s,n),yn(t,n,s,r[4]?+r[4]:void 0,r[5]?+r[5]:void 0)}},Tn=/\(error: (.*)\)/,Rn=50;class Mn{match(e){return this.isDOMException(e)||this.isDOMError(e)}coerce(e,t){var r=Yr(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 ni(e,"DOMException")}isDOMError(e){return ni(e,"DOMError")}}class Ln{match(e){return e instanceof Error}coerce(e,t){return{type:this.getType(e),value:this.getMessage(e,t),stack:this.getStack(e),cause:e.cause?t.next(e.cause):void 0,synthetic:!1}}getType(e){return e.name||e.constructor.name}getMessage(e,t){var r=e.message;return String(r.error&&"string"==typeof r.error.message?r.error.message:r)}getStack(e){return e.stacktrace||e.stack||void 0}}class Pn{constructor(){}match(e){return ni(e,"ErrorEvent")&&null!=e.error}coerce(e,t){var r;return t.apply(e.error)||{type:"ErrorEvent",value:e.message,stack:null==(r=t.syntheticException)?void 0:r.stack,synthetic:!0}}}var An=/^(?:[Uu]ncaught (?:exception: )?)?(?:((?:Eval|Internal|Range|Reference|Syntax|Type|URI|)Error): )?(.*)$/i;class Fn{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(An);return i&&(t=i[1],r=i[2]),[t,r]}}var Nn=["fatal","error","warning","log","info","debug"];function On(e,t){void 0===t&&(t=40);var r=Object.keys(e);if(r.sort(),!r.length)return"[object has no keys]";for(var i=r.length;i>0;i--){var n=r.slice(0,i).join(", ");if(t>=n.length)return i===r.length?n:n.length>t?n.slice(0,t)+"...":n}return""}class Dn{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 si(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: "+On(e)}isSeverityLevel(e){return Yr(e)&&!Xr(e)&&Nn.indexOf(e)>=0}getErrorPropertyFromObject(e){for(var t in e)if({}.hasOwnProperty.call(e,t)){var r=e[t];if(r instanceof Error)return r}}getObjectClassName(e){try{var t=Object.getPrototypeOf(e);return t?t.constructor.name:void 0}catch(e){return}}}class Bn{match(e){return si(e)}coerce(e,t){var r,i=e.constructor.name;return{type:i,value:i+" captured as exception with keys: "+On(e),stack:null==(r=t.syntheticException)?void 0:r.stack,synthetic:!0}}}class Hn{match(e){return ii(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 qn{match(e){return ni(e,"PromiseRejectionEvent")||this.isCustomEventWrappingRejection(e)}isCustomEventWrappingRejection(e){if(!si(e))return!1;try{var t=e.detail;return null!=t&&"object"==typeof t&&"reason"in t}catch(e){return!1}}coerce(e,t){var r,i=this.getUnhandledRejectionReason(e);return ii(i)?{type:"UnhandledRejection",value:"Non-Error promise rejection captured with value: "+String(i),stack:null==(r=t.syntheticException)?void 0:r.stack,synthetic:!0}:t.apply(i)}getUnhandledRejectionReason(e){try{if("reason"in e)return e.reason;if("detail"in e&&null!=e.detail&&"object"==typeof e.detail&&"reason"in e.detail)return e.detail.reason}catch(e){}return e}}var zn="$message",Vn="$timestamp",$n=new Set([zn,Vn]),Un={enabled:!0,max_bytes:32768};function Wn(e){var t;return e?{enabled:null!==(t=e.enabled)&&void 0!==t?t:Un.enabled,max_bytes:Gn(e.max_bytes,Un.max_bytes)}:r({},Un)}class jn{constructor(e){this._entries=[],this._totalBytes=0,this._config=Wn(e)}setConfig(e){this._config=Wn(e),this._trimToMaxBytes()}add(e){var t=function(e){var t=function(e){var t=new WeakSet;try{return JSON.stringify(e,((e,r)=>{if("bigint"==typeof r)return r.toString();if("function"!=typeof r&&"symbol"!=typeof r){if(r instanceof Date)return r.toISOString();if(r instanceof Error)return{name:r.name,message:r.message,stack:r.stack};if(r&&"object"==typeof r){if(t.has(r))return"[Circular]";t.add(r)}return r}}))}catch(e){return}}(e);if(t)try{var r=JSON.parse(t);if(!jr(r))return;var i=r,n=i[zn],s=i[Vn];if(!Yr(n)||0===n.trim().length)return;if(!Yr(s)&&!Qr(s))return;return{step:i,json:t}}catch(e){return}}(e);if(t){var r=function(e){if("undefined"!=typeof TextEncoder)return(new TextEncoder).encode(e).length;for(var t=encodeURIComponent(e),r=0,i=0;t.length>i;i++)"%"===t[i]?(r+=1,i+=2):r+=1;return r}(t.json);r>this._config.max_bytes||(this._entries.push({step:t.step,bytes:r}),this._totalBytes+=r,this._trimToMaxBytes())}}getAttachable(){return this._entries.map((e=>e.step))}clear(){this._entries=[],this._totalBytes=0}size(){return this._entries.length}_trimToMaxBytes(){for(;this._totalBytes>this._config.max_bytes&&this._entries.length>0;){var e=this._entries.shift();e&&(this._totalBytes-=e.bytes)}}}function Gn(e,t){if(!Qr(e)||e===1/0||e===-1/0)return t;var r=Math.floor(e);return 0>r?t:r}var Zn="undefined"!=typeof window?window:void 0,Yn="undefined"!=typeof globalThis?globalThis:Zn;"undefined"==typeof self&&(Yn.self=Yn),"undefined"==typeof File&&(Yn.File=function(){});var Xn=null==Yn?void 0:Yn.navigator,Kn=null==Yn?void 0:Yn.document,Jn=null==Yn?void 0:Yn.location,Qn=null==Yn?void 0:Yn.fetch,es=null!=Yn&&Yn.XMLHttpRequest&&"withCredentials"in new Yn.XMLHttpRequest?Yn.XMLHttpRequest:void 0,ts=null==Yn?void 0:Yn.AbortController,rs=null==Yn?void 0:Yn.CompressionStream,is=null==Xn?void 0:Xn.userAgent,ns=null!=Zn?Zn:{},ss=e=>e instanceof Document,os="1.371.3",as={DEBUG:!1,LIB_VERSION:os,LIB_NAME:"web",JS_SDK_VERSION:os},ls=function(e,t){var{debugEnabled:r}=void 0===t?{}:t,i={_log(t){if(Zn&&(as.DEBUG||ns.POSTHOG_DEBUG||r)&&!Zr(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;n>o;o++)s[o-1]=arguments[o];i(e,...s)}},info(){for(var e=arguments.length,t=new Array(e),r=0;e>r;r++)t[r]=arguments[r];i._log("log",...t)},warn(){for(var e=arguments.length,t=new Array(e),r=0;e>r;r++)t[r]=arguments[r];i._log("warn",...t)},error(){for(var e=arguments.length,t=new Array(e),r=0;e>r;r++)t[r]=arguments[r];i._log("error",...t)},critical(){for(var t=arguments.length,r=new Array(t),i=0;t>i;i++)r[i]=arguments[i];console.error(e,...r)},uninitializedWarning(e){i.error("You must initialize PostHog before calling "+e)},createLogger:(t,r)=>ls(e+" "+t,r)};return i},us=ls("[PostHog.js]"),cs=us.createLogger;function ds(e,t){Ur(e)&&e.forEach(t)}function hs(e,t){if(!Jr(e))if(Ur(e))e.forEach(t);else if(ri(e))e.forEach(((e,r)=>t(e,r)));else for(var r in e)Vr.call(e,r)&&t(e[r],r)}var ps=function(e){for(var t=arguments.length,r=new Array(t>1?t-1:0),i=1;t>i;i++)r[i-1]=arguments[i];for(var n of r)for(var s in n)void 0!==n[s]&&(e[s]=n[s]);return e};function 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}},vs=function(e){return function(){try{for(var t=arguments.length,r=new Array(t),i=0;t>i;i++)r[i]=arguments[i];return e.apply(this,r)}catch(e){us.critical("Implementation error. Please turn on debug mode and open a ticket on https://app.posthog.com/home#panel=support%3Asupport%3A."),us.critical(e)}}},fs=function(e){var t={};return hs(e,(function(e,r){(Yr(e)&&e.length>0||Qr(e))&&(t[r]=e)})),t};var ms=["herokuapp.com","vercel.app","netlify.app"];function ys(e){var t=null==e?void 0:e.hostname;if(!Yr(t))return!1;var r=t.split(".").slice(-2).join(".");for(var i of ms)if(r===i)return!1;return!0}function bs(e,t,r,i){var{capture:n=!1,passive:s=!0}=null!=i?i:{};null==e||e.addEventListener(t,r,{capture:n,passive:s})}function ws(e){return"ph_toolbar_internal"===e.name}var Ss=["localhost","127.0.0.1"],Cs=e=>{var t=null==Kn?void 0:Kn.createElement("a");return Zr(t)?null:(t.href=e,t)},Is=function(e,t){var r,i;void 0===t&&(t="&");var n=[];return hs(e,(function(e,t){Zr(e)||Zr(t)||"undefined"===t||(r=encodeURIComponent(e instanceof File?e.name:e.toString()),i=encodeURIComponent(t),n[n.length]=i+"="+r)})),n.join(t)},ks=function(e,t){for(var r,i=((e.split("#")[0]||"").split(/\?(.*)/)[1]||"").replace(/^\?+/g,"").split("&"),n=0;i.length>n;n++){var s=i[n].split("=");if(s[0]===t){r=s;break}}if(!Ur(r)||2>r.length)return"";var o=r[1];try{o=decodeURIComponent(o)}catch(e){us.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[1],s=(i[0]||"").split("?"),o=s[1],a=s[0],l=(o||"").split("&"),u=[],c=0;l.length>c;c++){var d=l[c].split("=");Ur(d)&&(t.includes(d[0])?u.push(d[0]+"="+r):u.push(l[c]))}var h=a;return null!=o&&(h+="?"+u.join("&")),null!=n&&(h+="#"+n),h},Es=function(e,t){var r=e.match(new RegExp(t+"=([^&]*)"));return r?r[1]:null};function Ts(e,t,r){try{if(!(t in e))return()=>{};var i=e[t],n=r(i);return Wr(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 Ms="$people_distinct_id",Ls="$device_id",Ps="__alias",As="__timers",Fs="$autocapture_disabled_server_side",Ns="$heatmaps_enabled_server_side",Os="$exception_capture_enabled_server_side",Ds="$error_tracking_suppression_rules",Bs="$error_tracking_capture_extension_exceptions",Hs="$web_vitals_enabled_server_side",qs="$dead_clicks_enabled_server_side",zs="$product_tours_enabled_server_side",Vs="$web_vitals_allowed_metrics",$s="$session_recording_remote_config",Us="$replay_override_sampling",Ws="$replay_override_linked_flag",js="$replay_override_url_trigger",Gs="$replay_override_event_trigger",Zs="$sesid",Ys="$session_is_sampled",Xs="$session_past_minimum_duration",Ks="$session_recording_url_trigger_activated_session",Js="$session_recording_event_trigger_activated_session",Qs="$posthog_sr_group_event_trigger_",eo="$posthog_sr_group_url_trigger_",to="$posthog_sr_group_sampling_",ro="$debug_first_full_snapshot_timestamp",io="$enabled_feature_flags",no="$active_feature_flags",so="$early_access_features",oo="$feature_flag_details",ao="$feature_flag_payloads",lo="$feature_flag_request_id",uo="$override_feature_flags",co="$override_feature_flag_payloads",ho="$stored_person_properties",po="$stored_group_properties",go="$surveys",_o="$surveys_activated",vo="ph_product_tours",fo="$flag_call_reported",mo="$flag_call_reported_session_id",yo="$feature_flag_errors",bo="$feature_flag_evaluated_at",wo="$user_state",So="$client_session_props",Co="$capture_rate_limit",Io="$initial_campaign_params",ko="$initial_referrer_info",xo="$initial_person_info",Eo="$epp",To="__POSTHOG_TOOLBAR__",Ro="$posthog_cookieless",Mo="$sdk_debug_extensions_init_method",Lo="$sdk_debug_extensions_init_time_ms",Po="$sdk_debug_recording_script_not_loaded",Ao="$sdk_debug_replay_event_trigger_status",Fo="$sdk_debug_replay_linked_flag_trigger_status",No="$sdk_debug_replay_matched_recording_trigger_groups",Oo="$sdk_debug_replay_remote_trigger_matching_config",Do="$sdk_debug_replay_trigger_groups_count",Bo="$sdk_debug_replay_url_trigger_status",Ho="$session_recording_start_reason",qo="PostHog loadExternalDependency extension not found.",zo="on_reject",Vo="always",$o="anonymous",Uo="identified",Wo="identified_only",jo="visibilitychange",Go="beforeunload",Zo="$pageview",Yo="$pageleave",Xo="$identify",Ko="$groupidentify";function Jo(e){return e instanceof Element&&(e.id===To||!(null==e.closest||!e.closest(".toolbar-global-fade-container")))}function Qo(e){return!!e&&1===e.nodeType}function ea(e,t){return!!e&&!!e.tagName&&e.tagName.toLowerCase()===t.toLowerCase()}function ta(e){return!!e&&3===e.nodeType}function ra(e){return!!e&&11===e.nodeType}function ia(e){return e?Hr(e).split(/\s+/):[]}function na(e){var t=null==Zn?void 0:Zn.location.href;return!!(t&&e&&e.some((e=>t.match(e))))}function sa(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 ia(t)}function oa(e){return Jr(e)?null:Hr(e).split(/(\s+)/).filter((e=>Ia(e))).join("").replace(/[\r\n]/g," ").replace(/[ ]+/g," ").substring(0,255)}function aa(e){var t="";return va(e)&&!fa(e)&&e.childNodes&&e.childNodes.length&&hs(e.childNodes,(function(e){var r;ta(e)&&e.textContent&&(t+=null!==(r=oa(e.textContent))&&void 0!==r?r:"")})),Hr(t)}function la(e){return Zr(e.target)?e.srcElement||null:null!=(t=e.target)&&t.shadowRoot?e.composedPath()[0]||null:e.target||null;var t}var ua=["a","button","form","input","select","textarea","label"];function ca(e,t){if(Zr(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 da(e){var t=e.parentNode;return!(!t||!Qo(t))&&t}var ha=["next","previous","prev",">","<"],pa=[".ph-no-rageclick",".ph-no-capture"];var ga=e=>!e||ea(e,"html")||!Qo(e),_a=(e,t)=>{if(!Zn||ga(e))return{parentIsUsefulElement:!1,targetElementList:[]};for(var r=!1,i=[e],n=e;n.parentNode&&!ea(n,"body");)if(ra(n.parentNode))i.push(n.parentNode.host),n=n.parentNode.host;else{var s=da(n);if(!s)break;if(t||ua.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 va(e){for(var t=e;t.parentNode&&!ea(t,"body");t=t.parentNode){var r=sa(t);if(Br(r,"ph-sensitive")||Br(r,"ph-no-capture"))return!1}if(Br(sa(e),"ph-include"))return!0;var i=e.type||"";if(Yr(i))switch(i.toLowerCase()){case"hidden":case"password":return!1}var n=e.name||e.id||"";return!Yr(n)||!/^cc|cardnum|ccnum|creditcard|csc|cvc|cvv|exp|pass|pwd|routing|seccode|securitycode|securitynum|socialsec|socsec|ssn/i.test(n.replace(/[^a-zA-Z0-9]/g,""))}function fa(e){return!!(ea(e,"input")&&!["button","checkbox","submit","reset"].includes(e.type)||ea(e,"select")||ea(e,"textarea")||"true"===e.getAttribute("contenteditable"))}var ma="(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})",ya=new RegExp("^(?:"+ma+")$"),ba=new RegExp(ma),wa="\\d{3}-?\\d{2}-?\\d{4}",Sa=new RegExp("^("+wa+")$"),Ca=new RegExp("("+wa+")");function Ia(e,t){if(void 0===t&&(t=!0),Jr(e))return!1;if(Yr(e)){if(e=Hr(e),(t?ya:ba).test((e||"").replace(/[- ]/g,"")))return!1;if((t?Sa:Ca).test(e))return!1}return!0}function ka(e){var t=aa(e);return Ia(t=(t+" "+xa(e)).trim())?t:""}function xa(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=aa(e);t=(t+" "+i).trim(),e.childNodes&&e.childNodes.length&&(t=(t+" "+xa(e)).trim())}catch(e){us.error("[AutoCapture]",e)}})),t}function Ea(e){return e.replace(/"|\\"/g,'\\"')}function Ta(e){var t=e.attr__class;return t?Ur(t)?t:ia(t):void 0}var Ra="[SessionRecording]",Ma="redacted",La={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"]},Pa=["authorization","x-forwarded-for","authorization","cookie","set-cookie","x-api-key","x-real-ip","remote-addr","forwarded","proxy-authorization","x-csrf-token","x-csrftoken","x-xsrf-token"],Aa=["password","secret","passwd","api_key","apikey","auth","credentials","mysql_pwd","privatekey","private_key","token"],Fa=["/s/","/e/","/i/"];function Na(e,t,r,i){if(Jr(e))return e;var n=(null==t?void 0:t["content-length"])||function(e){return new Blob([e]).size}(e);return Yr(n)&&(n=parseInt(n)),n>r?Ra+" "+i+" body too large to record ("+n+" bytes)":e}function Oa(e,t){if(Jr(e))return e;var r=e;return Ia(r,!1)||(r=Ra+" "+t+" body "+Ma),hs(Aa,(e=>{var i,n;null!=(i=r)&&i.length&&-1!==(null==(n=r)?void 0:n.indexOf(e))&&(r=Ra+" "+t+" body "+Ma+" as might contain: "+e)})),r}var Da=cs("[Recorder]"),Ba=e=>"navigation"===e.entryType,Ha=e=>"resource"===e.entryType;function qa(e,t){return!!t&&(ti(t)||t[e])}function za(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(ti(r))return!0;if(Ur(r))return s(r);var o=r[t];return ti(o)?o:s(o)}function Va(e,t,r,i,n,s){return $a.apply(this,arguments)}function $a(){return $a=t((function*(e,t,r,i,n,s){if(void 0===s&&(s=0),s>10)return Da.warn("Failed to get performance entry for request",{url:r,initiatorType:t}),null;var o=function(e,r){for(var s=e.length-1;s>=0;s-=1)if(Ha(o=e[s])&&o.initiatorType===t&&(Zr(i)||o.startTime>=i)&&(Zr(n)||n>=o.startTime))return e[s];var o}(e.performance.getEntriesByName(r));return o||(yield new Promise((e=>setTimeout(e,50*s))),Va(e,t,r,i,n,s+1))})),$a.apply(this,arguments)}function Ua(e){var{body:t,options:r,url:i}=e;if(Jr(t))return null;var{hostname:n,isHostDenied:s}=Rs(i,r);if(s)return n+" is in deny list";if(Yr(t))return t;if(ss(t))return t.textContent;if(ri(t))return Is(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 Wa=e=>!Kr(e)&&("navigation"===e.entryType||"resource"===e.entryType);function ja(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:Zr(a)?void 0:Math.round(a),endTime:Zr(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(Wa(t))for(var g of t.serverTiming||[])p.push({timeOrigin:d,timestamp:h,startTime:Math.round(t.startTime),name:g.name,duration:g.duration,entryType:"serverTiming"});return p}var Ga=["video/","audio/"];function Za(e){return new Promise((t=>{var r=setTimeout((()=>t("[SessionReplay] Timeout while trying to read body")),500);try{e.clone().text().then((e=>t(e)),(e=>t("[SessionReplay] Failed to read body: "+e))).finally((()=>clearTimeout(r)))}catch(e){clearTimeout(r),t("[SessionReplay] Failed to read body")}}))}function Ya(){return Ya=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"):Za(t)})),Ya.apply(this,arguments)}function Xa(){return Xa=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=Ga.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 Kr(n)?Za(t):Promise.resolve(n)})),Xa.apply(this,arguments)}var Ka=null;function Ja(e,i,n){if(!("performance"in i))return()=>{};if(Ka)return Da.warn("Network observer already initialised, doing nothing"),()=>{};var s=n?Object.assign({},La,n):La,o=t=>{var i=[];t.requests.forEach((e=>{var t=s.maskRequestFn(e);t&&i.push(t)})),i.length>0&&e(r({},t,{requests:i}))},a=function(e,t,r){if(r.recordInitialRequests){var i=t.performance.getEntries().filter((e=>Ba(e)||Ha(e)&&r.initiatorTypes.includes(e.initiatorType)));e({requests:i.flatMap((e=>ja({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=>Ba(e)||Ha(e)&&r.initiatorTypes.includes(e.initiatorType)&&(e=>!r.recordBody&&!r.recordHeaders||"xmlhttprequest"!==e.initiatorType&&"fetch"!==e.initiatorType)(e)));e({requests:i.flatMap((e=>ja({entry:e,method:void 0,status:void 0,networkRequest:{}})))})})),s=PerformanceObserver.supportedEntryTypes.filter((e=>r.performanceEntryTypeToObserve.includes(e)));return n.observe({entryTypes:s}),()=>{n.disconnect()}}(o,i,s),l=()=>{},u=()=>{};return(s.recordHeaders||s.recordBody)&&(l=function(e,t,r){if(!r.initiatorTypes.includes("xmlhttprequest"))return()=>{};var i=qa("request",r.recordHeaders),n=qa("response",r.recordHeaders),s=Ts(t.XMLHttpRequest.prototype,"open",(s=>function(o,a,l,u,c){void 0===l&&(l=!0);var d,h,p=this,g=new Request(a),_={},v={},f=p.setRequestHeader.bind(p);p.setRequestHeader=(e,t)=>(v[e]=t,f(e,t)),i&&(_.requestHeaders=v);var m=p.send.bind(p);p.send=e=>(za({type:"request",headers:v,url:a,recordBody:r.recordBody})&&(_.requestBody=Ua({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&&(_.responseHeaders=i),za({type:"response",headers:i,url:a,recordBody:r.recordBody})&&(_.responseBody=Ua({body:p.response,options:r,url:a})),Va(t,"xmlhttprequest",g.url,d,h).then((t=>{var r=ja({entry:t,method:o,status:null==p?void 0:p.status,networkRequest:_,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()}}(o,i,s),u=function(e,r,i){if(!i.initiatorTypes.includes("fetch"))return()=>{};var n=qa("request",i.recordHeaders),s=qa("response",i.recordHeaders),o=Ts(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),za({type:"request",headers:p,url:t,recordBody:i.recordBody})&&(h.requestBody=yield function(e){return Ya.apply(this,arguments)}({r:d,options:i,url:t})),u=r.performance.now(),l=yield o(d),c=r.performance.now();var g={};return l.headers.forEach(((e,t)=>{g[t]=e})),s&&(h.responseHeaders=g),za({type:"response",headers:g,url:t,recordBody:i.recordBody})&&(h.responseBody=yield function(e){return Xa.apply(this,arguments)}({r:l,options:i,url:t})),l}finally{Va(r,"fetch",d.url,u,c).then((t=>{var r,i=ja({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()}}(o,i,s)),Ka=()=>{a(),l(),u(),Ka=null}}var Qa=e=>({name:"rrweb/network@1",observer:Ja,options:e});ns.__PosthogExtensions__=ns.__PosthogExtensions__||{},ns.__PosthogExtensions__.rrwebPlugins={getRecordConsolePlugin:Pr,getRecordNetworkPlugin:Qa},ns.__PosthogExtensions__.rrweb={record:Nt,version:"v2"},ns.rrweb={record:Nt,version:"v2"},ns.rrwebConsoleRecord={getRecordConsolePlugin:Pr},ns.getRecordNetworkPlugin=Qa;var el,tl,rl,il,nl,sl,ol,al,ll,ul,cl,dl,hl={},pl=[],gl=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,_l=Array.isArray;function vl(e,t){for(var r in t)e[r]=t[r];return e}function fl(e){e&&e.parentNode&&e.parentNode.removeChild(e)}function ml(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?el.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 yl(e,o,i,n,null)}function yl(e,t,r,i,n){var s={type:e,props:t,key:r,ref:i,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:null==n?++rl:n,__i:-1,__u:0};return null==n&&null!=tl.vnode&&tl.vnode(s),s}function bl(e){return e.children}function wl(e,t){this.props=e,this.context=t}function Sl(e,t){if(null==t)return e.__?Sl(e.__,e.__i+1):null;for(var r;e.__k.length>t;t++)if(null!=(r=e.__k[t])&&null!=r.__e)return r.__e;return"function"==typeof e.type?Sl(e):null}function Cl(e){var t,r;if(null!=(e=e.__)&&null!=e.__c){for(e.__e=e.__c.base=null,t=0;e.__k.length>t;t++)if(null!=(r=e.__k[t])&&null!=r.__e){e.__e=e.__c.base=r.__e;break}return Cl(e)}}function Il(e){(!e.__d&&(e.__d=!0)&&il.push(e)&&!$.__r++||nl!=tl.debounceRendering)&&((nl=tl.debounceRendering)||sl)($)}function $(){for(var e,t,r,i,n,s,o,a=1;il.length;)il.length>a&&il.sort(ol),e=il.shift(),a=il.length,e.__d&&(r=void 0,i=void 0,n=(i=(t=e).__v).__e,s=[],o=[],t.__P&&((r=vl({},i)).__v=i.__v+1,tl.vnode&&tl.vnode(r),Ll(t.__P,r,i,t.__n,t.__P.namespaceURI,32&i.__u?[n]:null,s,null==n?Sl(i):n,!!(32&i.__u),o),r.__v=i.__v,r.__.__k[r.__i]=r,Al(s,r,o),i.__e=i.__=null,r.__e!=n&&Cl(r)));$.__r=0}function kl(e,t,r,i,n,s,o,a,l,u,c){var d,h,p,g,_,v,f,m=i&&i.__k||pl,y=t.length;for(l=function(e,t,r,i,n){var s,o,a,l,u,c=r.length,d=c,h=0;for(e.__k=new Array(n),s=0;n>s;s++)null!=(o=t[s])&&"boolean"!=typeof o&&"function"!=typeof o?("string"==typeof o||"number"==typeof o||"bigint"==typeof o||o.constructor==String?o=e.__k[s]=yl(null,o,null,null,null):_l(o)?o=e.__k[s]=yl(bl,{children:o},null,null,null):void 0===o.constructor&&o.__b>0?o=e.__k[s]=yl(o.type,o.props,o.key,o.ref?o.ref:null,o.__v):e.__k[s]=o,l=s+h,o.__=e,o.__b=e.__b+1,a=null,-1!=(u=o.__i=El(o,r,l,d))&&(d--,(a=r[u])&&(a.__u|=2)),null==a||null==a.__v?(-1==u&&(n>c?h--:c>n&&h++),"function"!=typeof o.type&&(o.__u|=4)):u!=l&&(u==l-1?h--:u==l+1?h++:(u>l?h--:h++,o.__u|=4))):e.__k[s]=null;if(d)for(s=0;c>s;s++)null!=(a=r[s])&&0==(2&a.__u)&&(a.__e==i&&(i=Sl(a)),Ol(a,a));return i}(r,t,m,l,y),d=0;y>d;d++)null!=(p=r.__k[d])&&(h=-1==p.__i?hl:m[p.__i]||hl,p.__i=d,v=Ll(e,p,h,n,s,o,a,l,u,c),g=p.__e,p.ref&&h.ref!=p.ref&&(h.ref&&Nl(h.ref,null,p),c.push(p.ref,p.__c||g,p)),null==_&&null!=g&&(_=g),(f=!!(4&p.__u))||h.__k===p.__k?l=xl(p,l,e,f):"function"==typeof p.type&&void 0!==v?l=v:g&&(l=g.nextSibling),p.__u&=-7);return r.__e=_,l}function xl(e,t,r,i){var n,s;if("function"==typeof e.type){for(n=e.__k,s=0;n&&n.length>s;s++)n[s]&&(n[s].__=e,t=xl(n[s],t,r,i));return t}e.__e!=t&&(i&&(t&&e.type&&!t.parentNode&&(t=Sl(e)),r.insertBefore(e.__e,t||null)),t=e.__e);do{t=t&&t.nextSibling}while(null!=t&&8==t.nodeType);return t}function El(e,t,r,i){var n,s,o,a=e.key,l=e.type,u=t[r],c=null!=u&&0==(2&u.__u);if(null===u&&null==a||c&&a==u.key&&l==u.type)return r;if(i>(c?1:0))for(n=r-1,s=r+1;n>=0||t.length>s;)if(null!=(u=t[o=0>n?s++:n--])&&0==(2&u.__u)&&a==u.key&&l==u.type)return o;return-1}function Tl(e,t,r){"-"==t[0]?e.setProperty(t,null==r?"":r):e[t]=null==r?"":"number"!=typeof r||gl.test(t)?r:r+"px"}function Rl(e,t,r,i,n){var s,o;e:if("style"==t)if("string"==typeof r)e.style.cssText=r;else{if("string"==typeof i&&(e.style.cssText=i=""),i)for(t in i)r&&t in r||Tl(e.style,t,"");if(r)for(t in r)i&&r[t]==i[t]||Tl(e.style,t,r[t])}else if("o"==t[0]&&"n"==t[1])s=t!=(t=t.replace(al,"$1")),o=t.toLowerCase(),t=o in e||"onFocusOut"==t||"onFocusIn"==t?o.slice(2):t.slice(2),e.l||(e.l={}),e.l[t+s]=r,r?i?r.u=i.u:(r.u=ll,e.addEventListener(t,s?cl:ul,s)):e.removeEventListener(t,s?cl:ul,s);else{if("http://www.w3.org/2000/svg"==n)t=t.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if("width"!=t&&"height"!=t&&"href"!=t&&"list"!=t&&"form"!=t&&"tabIndex"!=t&&"download"!=t&&"rowSpan"!=t&&"colSpan"!=t&&"role"!=t&&"popover"!=t&&t in e)try{e[t]=null==r?"":r;break e}catch(e){}"function"==typeof r||(null==r||!1===r&&"-"!=t[4]?e.removeAttribute(t):e.setAttribute(t,"popover"==t&&1==r?"":r))}}function Ml(e){return function(t){if(this.l){var r=this.l[t.type+e];if(null==t.t)t.t=ll++;else if(r.u>t.t)return;return r(tl.event?tl.event(t):t)}}}function Ll(e,t,r,i,n,s,o,a,l,u){var c,d,h,p,g,_,v,f,m,y,b,$,w,S,C,I,k,x=t.type;if(void 0!==t.constructor)return null;128&r.__u&&(l=!!(32&r.__u),s=[a=t.__e=r.__e]),(c=tl.__b)&&c(t);e:if("function"==typeof x)try{if(f=t.props,m="prototype"in x&&x.prototype.render,y=(c=x.contextType)&&i[c.__c],b=c?y?y.props.value:c.__:i,r.__c?v=(d=t.__c=r.__c).__=d.__E:(m?t.__c=d=new x(f,b):(t.__c=d=new wl(f,b),d.constructor=x,d.render=Dl),y&&y.sub(d),d.state||(d.state={}),d.__n=i,h=d.__d=!0,d.__h=[],d._sb=[]),m&&null==d.__s&&(d.__s=d.state),m&&null!=x.getDerivedStateFromProps&&(d.__s==d.state&&(d.__s=vl({},d.__s)),vl(d.__s,x.getDerivedStateFromProps(f,d.__s))),p=d.props,g=d.state,d.__v=t,h)m&&null==x.getDerivedStateFromProps&&null!=d.componentWillMount&&d.componentWillMount(),m&&null!=d.componentDidMount&&d.__h.push(d.componentDidMount);else{if(m&&null==x.getDerivedStateFromProps&&f!==p&&null!=d.componentWillReceiveProps&&d.componentWillReceiveProps(f,b),t.__v==r.__v||!d.__e&&null!=d.shouldComponentUpdate&&!1===d.shouldComponentUpdate(f,d.__s,b)){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.some((function(e){e&&(e.__=t)})),$=0;d._sb.length>$;$++)d.__h.push(d._sb[$]);d._sb=[],d.__h.length&&o.push(d);break e}null!=d.componentWillUpdate&&d.componentWillUpdate(f,d.__s,b),m&&null!=d.componentDidUpdate&&d.__h.push((function(){d.componentDidUpdate(p,g,_)}))}if(d.context=b,d.props=f,d.__P=e,d.__e=!1,w=tl.__r,S=0,m){for(d.state=d.__s,d.__d=!1,w&&w(t),c=d.render(d.props,d.state,d.context),C=0;d._sb.length>C;C++)d.__h.push(d._sb[C]);d._sb=[]}else do{d.__d=!1,w&&w(t),c=d.render(d.props,d.state,d.context),d.state=d.__s}while(d.__d&&25>++S);d.state=d.__s,null!=d.getChildContext&&(i=vl(vl({},i),d.getChildContext())),m&&!h&&null!=d.getSnapshotBeforeUpdate&&(_=d.getSnapshotBeforeUpdate(p,g)),I=c,null!=c&&c.type===bl&&null==c.key&&(I=Fl(c.props.children)),a=kl(e,_l(I)?I:[I],t,r,i,n,s,o,a,l,u),d.base=t.__e,t.__u&=-161,d.__h.length&&o.push(d),v&&(d.__E=d.__=null)}catch(e){if(t.__v=null,l||null!=s)if(e.then){for(t.__u|=l?160:128;a&&8==a.nodeType&&a.nextSibling;)a=a.nextSibling;s[s.indexOf(a)]=null,t.__e=a}else{for(k=s.length;k--;)fl(s[k]);Pl(t)}else t.__e=r.__e,t.__k=r.__k,e.then||Pl(t);tl.__e(e,t,r)}else null==s&&t.__v==r.__v?(t.__k=r.__k,t.__e=r.__e):a=t.__e=function(e,t,r,i,n,s,o,a,l){var u,c,d,h,p,g,_,v=r.props||hl,f=t.props,m=t.type;if("svg"==m?n="http://www.w3.org/2000/svg":"math"==m?n="http://www.w3.org/1998/Math/MathML":n||(n="http://www.w3.org/1999/xhtml"),null!=s)for(u=0;s.length>u;u++)if((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=document.createElementNS(n,m,f.is&&f),a&&(tl.__m&&tl.__m(t,s),a=!1),s=null}if(null==m)v===f||a&&e.data==f||(e.data=f);else{if(s=s&&el.call(e.childNodes),!a&&null!=s)for(v={},u=0;e.attributes.length>u;u++)v[(p=e.attributes[u]).name]=p.value;for(u in v)if(p=v[u],"children"==u);else if("dangerouslySetInnerHTML"==u)d=p;else if(!(u in f)){if("value"==u&&"defaultValue"in f||"checked"==u&&"defaultChecked"in f)continue;Rl(e,u,null,p,n)}for(u in f)p=f[u],"children"==u?h=p:"dangerouslySetInnerHTML"==u?c=p:"value"==u?g=p:"checked"==u?_=p:a&&"function"!=typeof p||v[u]===p||Rl(e,u,p,v[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=""),kl("template"==t.type?e.content:e,_l(h)?h:[h],t,r,i,"foreignObject"==m?"http://www.w3.org/1999/xhtml":n,s,o,s?s[0]:r.__k&&Sl(r,0),a,l),null!=s)for(u=s.length;u--;)fl(s[u]);a||(u="value","progress"==m&&null==g?e.removeAttribute("value"):null!=g&&(g!==e[u]||"progress"==m&&!g||"option"==m&&g!=v[u])&&Rl(e,u,g,v[u],n),u="checked",null!=_&&_!=e[u]&&Rl(e,u,_,v[u],n))}return e}(r.__e,t,r,i,n,s,o,l,u);return(c=tl.diffed)&&c(t),128&t.__u?void 0:a}function Pl(e){e&&e.__c&&(e.__c.__e=!0),e&&e.__k&&e.__k.forEach(Pl)}function Al(e,t,r){for(var i=0;r.length>i;i++)Nl(r[i],r[++i],r[++i]);tl.__c&&tl.__c(t,e),e.some((function(t){try{e=t.__h,t.__h=[],e.some((function(e){e.call(t)}))}catch(e){tl.__e(e,t.__v)}}))}function Fl(e){return"object"!=typeof e||null==e||e.__b&&e.__b>0?e:_l(e)?e.map(Fl):vl({},e)}function Nl(e,t,r){try{if("function"==typeof e){var i="function"==typeof e.__u;i&&e.__u(),i&&null==t||(e.__u=e(t))}else e.current=t}catch(e){tl.__e(e,r)}}function Ol(e,t,r){var i,n;if(tl.unmount&&tl.unmount(e),(i=e.ref)&&(i.current&&i.current!=e.__e||Nl(i,null,t)),null!=(i=e.__c)){if(i.componentWillUnmount)try{i.componentWillUnmount()}catch(e){tl.__e(e,t)}i.base=i.__P=null}if(i=e.__k)for(n=0;i.length>n;n++)i[n]&&Ol(i[n],t,r||"function"!=typeof e.type);r||fl(e.__e),e.__c=e.__=e.__e=void 0}function Dl(e,t,r){return this.constructor(e,r)}function Bl(e,t,r){var i,n,s;t==document&&(t=document.documentElement),tl.__&&tl.__(e,t),i=t.__k,n=[],s=[],Ll(t,e=t.__k=ml(bl,null,[e]),i||hl,hl,t.namespaceURI,i?null:t.firstChild?el.call(t.childNodes):null,n,i?i.__e:t.firstChild,!1,s),Al(n,e,s)}el=pl.slice,tl={__e(e,t,r,i){for(var n,s,o;t=t.__;)if((n=t.__c)&&!n.__)try{if((s=n.constructor)&&null!=s.getDerivedStateFromError&&(n.setState(s.getDerivedStateFromError(e)),o=n.__d),null!=n.componentDidCatch&&(n.componentDidCatch(e,i||{}),o=n.__d),o)return n.__E=n}catch(t){e=t}throw e}},rl=0,wl.prototype.setState=function(e,t){var r;r=null!=this.__s&&this.__s!=this.state?this.__s:this.__s=vl({},this.state),"function"==typeof e&&(e=e(vl({},r),this.props)),e&&vl(r,e),null!=e&&this.__v&&(t&&this._sb.push(t),Il(this))},wl.prototype.forceUpdate=function(e){this.__v&&(this.__e=!0,e&&this.__h.push(e),Il(this))},wl.prototype.render=bl,il=[],sl="function"==typeof Promise?Promise.prototype.then.bind(Promise.resolve()):setTimeout,ol=function(e,t){return e.__v.__b-t.__v.__b},$.__r=0,al=/(PointerCapture)$|Capture$/i,ll=0,ul=Ml(!1),cl=Ml(!0),dl=0;var Hl,ql,zl,Vl,$l=0,Ul=[],Wl=tl,jl=Wl.__b,Gl=Wl.__r,Zl=Wl.diffed,Yl=Wl.__c,Xl=Wl.unmount,Kl=Wl.__;function Jl(e,t){Wl.__h&&Wl.__h(ql,e,$l||t),$l=0;var r=ql.__H||(ql.__H={__:[],__h:[]});return e>=r.__.length&&r.__.push({}),r.__[e]}function Ql(e){return $l=1,function(e,t,r){var i=Jl(Hl++,2);if(i.t=e,!i.__c&&(i.__=[cu(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=ql,!ql.__f)){var n=function(e,t,r){if(!i.__c.__H)return!0;var n=i.__c.__H.__.filter((function(e){return!!e.__c}));if(n.every((function(e){return!e.__N})))return!s||s.call(this,e,t,r);var o=i.__c.props!==e;return n.forEach((function(e){if(e.__N){var t=e.__[0];e.__=e.__N,e.__N=void 0,t!==e.__[0]&&(o=!0)}})),s&&s.call(this,e,t,r)||o};ql.__f=!0;var s=ql.shouldComponentUpdate,o=ql.componentWillUpdate;ql.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)},ql.shouldComponentUpdate=n}return i.__N||i.__}(cu,e)}function eu(e,t){var r=Jl(Hl++,3);!Wl.__s&&uu(r.__H,t)&&(r.__=e,r.u=t,ql.__H.__h.push(r))}function tu(e){return $l=5,ru((function(){return{current:e}}),[])}function ru(e,t){var r=Jl(Hl++,7);return uu(r.__H,t)&&(r.__=e(),r.__H=t,r.__h=e),r.__}function iu(e){var t=ql.context[e.__c],r=Jl(Hl++,9);return r.c=e,t?(null==r.__&&(r.__=!0,t.sub(ql)),t.props.value):e.__}function nu(){for(var e;e=Ul.shift();)if(e.__P&&e.__H)try{e.__H.__h.forEach(au),e.__H.__h.forEach(lu),e.__H.__h=[]}catch(t){e.__H.__h=[],Wl.__e(t,e.__v)}}Wl.__b=function(e){ql=null,jl&&jl(e)},Wl.__=function(e,t){e&&t.__k&&t.__k.__m&&(e.__m=t.__k.__m),Kl&&Kl(e,t)},Wl.__r=function(e){Gl&&Gl(e),Hl=0;var t=(ql=e.__c).__H;t&&(zl===ql?(t.__h=[],ql.__h=[],t.__.forEach((function(e){e.__N&&(e.__=e.__N),e.u=e.__N=void 0}))):(t.__h.forEach(au),t.__h.forEach(lu),t.__h=[],Hl=0)),zl=ql},Wl.diffed=function(e){Zl&&Zl(e);var t=e.__c;t&&t.__H&&(t.__H.__h.length&&(1!==Ul.push(t)&&Vl===Wl.requestAnimationFrame||((Vl=Wl.requestAnimationFrame)||ou)(nu)),t.__H.__.forEach((function(e){e.u&&(e.__H=e.u),e.u=void 0}))),zl=ql=null},Wl.__c=function(e,t){t.some((function(e){try{e.__h.forEach(au),e.__h=e.__h.filter((function(e){return!e.__||lu(e)}))}catch(r){t.some((function(e){e.__h&&(e.__h=[])})),t=[],Wl.__e(r,e.__v)}})),Yl&&Yl(e,t)},Wl.unmount=function(e){Xl&&Xl(e);var t,r=e.__c;r&&r.__H&&(r.__H.__.forEach((function(e){try{au(e)}catch(e){t=e}})),r.__H=void 0,t&&Wl.__e(t,r.__v))};var su="function"==typeof requestAnimationFrame;function ou(e){var t,r=function(){clearTimeout(i),su&&cancelAnimationFrame(t),setTimeout(e)},i=setTimeout(r,35);su&&(t=requestAnimationFrame(r))}function au(e){var t=ql,r=e.__c;"function"==typeof r&&(e.__c=void 0,r()),ql=t}function lu(e){var t=ql;e.__c=e.__(),ql=t}function uu(e,t){return!e||e.length!==t.length||t.some((function(t,r){return t!==e[r]}))}function cu(e,t){return"function"==typeof t?t(e):t}var du="events",hu="cancelEvents",pu={Tab:"tab",Selector:"selector"},gu={TopLeft:"top_left",TopRight:"top_right",TopCenter:"top_center",MiddleLeft:"middle_left",MiddleRight:"middle_right",MiddleCenter:"middle_center",Left:"left",Center:"center",Right:"right",NextToTrigger:"next_to_trigger"},_u={Top:"top",Left:"left",Right:"right",Bottom:"bottom"},vu={Popover:"popover",API:"api",Widget:"widget",ExternalSurvey:"external_survey"},fu={Open:"open",MultipleChoice:"multiple_choice",SingleChoice:"single_choice",Rating:"rating",Link:"link"},mu={End:"end",ResponseBased:"response_based",SpecificQuestion:"specific_question"},yu="always",bu={SHOWN:"survey shown",DISMISSED:"survey dismissed",SENT:"survey sent",ABANDONED:"survey abandoned"},wu={SURVEY_ID:"$survey_id",SURVEY_NAME:"$survey_name",SURVEY_ITERATION:"$survey_iteration",SURVEY_ITERATION_START_DATE:"$survey_iteration_start_date",SURVEY_PARTIALLY_COMPLETED:"$survey_partially_completed",SURVEY_SUBMISSION_ID:"$survey_submission_id",SURVEY_QUESTIONS:"$survey_questions",SURVEY_COMPLETED:"$survey_completed",SURVEY_LAST_SEEN_DATE:"$survey_last_seen_date"},Su="popover",Cu=cs("[Surveys]");function Iu(e){return!(!e.start_date||e.end_date)}function ku(e){var t;return!(null==(t=e.conditions)||null==(t=t.events)||null==(t=t.values)||!t.length)}function xu(e){var t;return!(null==(t=e.conditions)||null==(t=t.actions)||null==(t=t.values)||!t.length)}var Eu="seenSurvey_",Tu="inProgressSurvey_",Ru=(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},Mu=(e,t)=>{var r=""+e+t.id;return t.current_iteration&&t.current_iteration>0&&(r=""+e+t.id+"_"+t.current_iteration),r},Lu=e=>Mu(Eu,e),Pu=e=>{try{var t=Lu(e);if(localStorage.getItem(t))return;localStorage.setItem(t,"true")}catch(e){Cu.error("Failed to persist survey seen state",e)}},Au=[vu.Popover,vu.Widget,vu.API],Fu={ignoreConditions:!1,ignoreDelay:!1,displayType:Su};Math.trunc||(Math.trunc=function(e){return 0>e?Math.ceil(e):Math.floor(e)}),Number.isInteger||(Number.isInteger=function(e){return Qr(e)&&isFinite(e)&&Math.floor(e)===e});class Nu{constructor(e){if(this.bytes=e,16!==e.length)throw new TypeError("not 128-bit length")}static fromFieldsV7(e,t,r,i){if(!Number.isInteger(e)||!Number.isInteger(t)||!Number.isInteger(r)||!Number.isInteger(i)||0>e||0>t||0>r||0>i||e>0xffffffffffff||t>4095||r>1073741823||i>4294967295)throw new RangeError("invalid field value");var n=new Uint8Array(16);return n[0]=e/Math.pow(2,40),n[1]=e/Math.pow(2,32),n[2]=e/Math.pow(2,24),n[3]=e/Math.pow(2,16),n[4]=e/Math.pow(2,8),n[5]=e,n[6]=112|t>>>8,n[7]=t,n[8]=128|r>>>24,n[9]=r>>>16,n[10]=r>>>8,n[11]=r,n[12]=i>>>24,n[13]=i>>>16,n[14]=i>>>8,n[15]=i,new Nu(n)}toString(){for(var e="",t=0;this.bytes.length>t;t++)e=e+(this.bytes[t]>>>4).toString(16)+(15&this.bytes[t]).toString(16),3!==t&&5!==t&&7!==t&&9!==t||(e+="-");if(36!==e.length)throw new Error("Invalid UUIDv7 was generated");return e}clone(){return new Nu(this.bytes.slice(0))}equals(e){return 0===this.compareTo(e)}compareTo(e){for(var t=0;16>t;t++){var r=this.bytes[t]-e.bytes[t];if(0!==r)return Math.sign(r)}return 0}}class Ou{constructor(){this._timestamp=0,this._counter=0,this._random=new Hu}generate(){var e=this.generateOrAbort();if(Zr(e)){this._timestamp=0;var t=this.generateOrAbort();if(Zr(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(this._timestamp>=e+1e4)return;this._counter++,this._counter>4398046511103&&(this._timestamp++,this._resetCounter())}return Nu.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 Du,Bu=e=>{if("undefined"!=typeof UUIDV7_DENY_WEAK_RNG&&UUIDV7_DENY_WEAK_RNG)throw new Error("no cryptographically strong RNG available");for(var t=0;e.length>t;t++)e[t]=65536*Math.trunc(65536*Math.random())+Math.trunc(65536*Math.random());return e};Zn&&!Zr(Zn.crypto)&&crypto.getRandomValues&&(Bu=e=>crypto.getRandomValues(e));class Hu{constructor(){this._buffer=new Uint32Array(8),this._cursor=1/0}nextUint32(){return this._buffer.length>this._cursor||(Bu(this._buffer),this._cursor=0),this._buffer[this._cursor++]}}var qu=()=>zu().toString(),zu=()=>(Du||(Du=new Ou)).generate(),Vu="gzip-js",$u="base64",Uu=Uint8Array,Wu=Uint16Array,ju=Uint32Array,Gu=new Uu([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]),Zu=new Uu([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]),Yu=new Uu([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),Xu=function(e,t){for(var r=new Wu(31),i=0;31>i;++i)r[i]=t+=1<<e[i-1];var n=new ju(r[30]);for(i=1;30>i;++i)for(var s=r[i];r[i+1]>s;++s)n[s]=s-r[i]<<5|i;return[r,n]},Ku=Xu(Gu,2),Ju=Ku[1];Ku[0][28]=258,Ju[258]=28;for(var Qu=Xu(Zu,0)[1],ec=new Wu(32768),tc=0;32768>tc;++tc){var rc=(43690&tc)>>>1|(21845&tc)<<1;ec[tc]=((65280&(rc=(61680&(rc=(52428&rc)>>>2|(13107&rc)<<2))>>>4|(3855&rc)<<4))>>>8|(255&rc)<<8)>>>1}var ic=function(e,t,r){for(var i=e.length,n=0,s=new Wu(t);i>n;++n)++s[e[n]-1];var o,a=new Wu(t);for(n=0;t>n;++n)a[n]=a[n-1]+s[n-1]<<1;if(r){o=new Wu(1<<t);var l=15-t;for(n=0;i>n;++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;h>=d;++d)o[ec[d]>>>l]=u}else for(o=new Wu(i),n=0;i>n;++n)o[n]=ec[a[e[n]-1]++]>>>15-e[n];return o},nc=new Uu(288);for(tc=0;144>tc;++tc)nc[tc]=8;for(tc=144;256>tc;++tc)nc[tc]=9;for(tc=256;280>tc;++tc)nc[tc]=7;for(tc=280;288>tc;++tc)nc[tc]=8;var sc=new Uu(32);for(tc=0;32>tc;++tc)sc[tc]=5;var oc=ic(nc,9,0),ac=ic(sc,5,0),lc=function(e){return(e/8>>0)+(7&e&&1)},uc=function(e,t,r){(null==r||r>e.length)&&(r=e.length);var i=new(e instanceof Wu?Wu:e instanceof ju?ju:Uu)(r-t);return i.set(e.subarray(t,r)),i},cc=function(e,t,r){var i=t/8>>0;e[i]|=r<<=7&t,e[i+1]|=r>>>8},dc=function(e,t,r){var i=t/8>>0;e[i]|=r<<=7&t,e[i+1]|=r>>>8,e[i+2]|=r>>>16},hc=function(e,t){for(var r=[],i=0;e.length>i;++i)e[i]&&r.push({s:i,f:e[i]});var n=r.length,s=r.slice();if(!n)return[new Uu(0),0];if(1==n){var o=new Uu(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[d].f>r[u].f?u++:d++],l=r[u!=c&&r[d].f>r[u].f?u++:d++],r[c++]={s:-1,f:a.f+l.f,l:a,r:l};var h=s[0].s;for(i=1;n>i;++i)s[i].s>h&&(h=s[i].s);var p=new Wu(h+1),g=pc(r[c-1],p,0);if(g>t){i=0;var _=0,v=g-t,f=1<<v;for(s.sort((function(e,t){return p[t.s]-p[e.s]||e.f-t.f}));n>i;++i){var m=s[i].s;if(t>=p[m])break;_+=f-(1<<g-p[m]),p[m]=t}for(_>>>=v;_>0;){var y=s[i].s;t>p[y]?_-=1<<t-p[y]++-1:++i}for(;i>=0&&_;--i){var b=s[i].s;p[b]==t&&(--p[b],++_)}g=t}return[new Uu(p),g]},pc=function(e,t,r){return-1==e.s?Math.max(pc(e.l,t,r+1),pc(e.r,t,r+1)):t[e.s]=r},gc=function(e){for(var t=e.length;t&&!e[--t];);for(var r=new Wu(++t),i=0,n=e[0],s=1,o=function(e){r[i++]=e},a=1;t>=a;++a)if(e[a]==n&&a!=t)++s;else{if(!n&&s>2){for(;s>138;s-=138)o(32754);s>2&&(o(s>10?s-11<<5|28690:s-3<<5|12305),s=0)}else if(s>3){for(o(n),--s;s>6;s-=6)o(8304);s>2&&(o(s-3<<5|8208),s=0)}for(;s--;)o(n);s=1,n=e[a]}return[r.subarray(0,i),t]},_c=function(e,t){for(var r=0,i=0;t.length>i;++i)r+=e[i]*t[i];return r},vc=function(e,t,r){var i=r.length,n=lc(t+2);e[n]=255&i,e[n+1]=i>>>8,e[n+2]=255^e[n],e[n+3]=255^e[n+1];for(var s=0;i>s;++s)e[n+s+4]=r[s];return 8*(n+4+i)},fc=function(e,t,r,i,n,s,o,a,l,u,c){cc(t,c++,r),++n[256];for(var d=hc(n,15),h=d[0],p=d[1],g=hc(s,15),_=g[0],v=g[1],f=gc(h),m=f[0],y=f[1],b=gc(_),w=b[0],S=b[1],C=new Wu(19),I=0;m.length>I;++I)C[31&m[I]]++;for(I=0;w.length>I;++I)C[31&w[I]]++;for(var k=hc(C,7),x=k[0],E=k[1],T=19;T>4&&!x[Yu[T-1]];--T);var R,M,L,P,A=u+5<<3,F=_c(n,nc)+_c(s,sc)+o,N=_c(n,h)+_c(s,_)+o+14+3*T+_c(C,x)+(2*C[16]+3*C[17]+7*C[18]);if(F>=A&&N>=A)return vc(t,c,e.subarray(l,l+u));if(cc(t,c,1+(F>N)),c+=2,F>N){R=ic(h,p,0),M=h,L=ic(_,v,0),P=_;var O=ic(x,E,0);for(cc(t,c,y-257),cc(t,c+5,S-1),cc(t,c+10,T-4),c+=14,I=0;T>I;++I)cc(t,c+3*I,x[Yu[I]]);c+=3*T;for(var D=[m,w],B=0;2>B;++B){var H=D[B];for(I=0;H.length>I;++I)cc(t,c,O[q=31&H[I]]),c+=x[q],q>15&&(cc(t,c,H[I]>>>5&127),c+=H[I]>>>12)}}else R=oc,M=nc,L=ac,P=sc;for(I=0;a>I;++I)if(i[I]>255){var q;dc(t,c,R[257+(q=i[I]>>>18&31)]),c+=M[q+257],q>7&&(cc(t,c,i[I]>>>23&31),c+=Gu[q]);var z=31&i[I];dc(t,c,L[z]),c+=P[z],z>3&&(dc(t,c,i[I]>>>5&8191),c+=Zu[z])}else dc(t,c,R[i[I]]),c+=M[i[I]];return dc(t,c,R[256]),c+M[256]},mc=new ju([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),yc=function(){for(var e=new ju(256),t=0;256>t;++t){for(var r=t,i=9;--i;)r=(1&r&&3988292384)^r>>>1;e[t]=r}return e}(),bc=function(){var e=4294967295;return{p(t){for(var r=e,i=0;t.length>i;++i)r=yc[255&r^t[i]]^r>>>8;e=r},d:()=>4294967295^e}},wc=function(e,t,r,i,n){return function(e,t,r,i,n,s){var o=e.length,a=new Uu(i+o+5*(1+Math.floor(o/7e3))+n),l=a.subarray(i,a.length-n),u=0;if(!t||8>o)for(var c=0;o>=c;c+=65535){var d=c+65535;o>d?u=vc(l,u,e.subarray(c,d)):(l[c]=true,u=vc(l,u,e.subarray(c,o)))}else{for(var h=mc[t-1],p=h>>>13,g=8191&h,_=(1<<r)-1,v=new Wu(32768),f=new Wu(_+1),m=Math.ceil(r/3),y=2*m,b=function(t){return(e[t]^e[t+1]<<m^e[t+2]<<y)&_},w=new ju(25e3),S=new Wu(288),C=new Wu(32),I=0,k=0,x=(c=0,0),E=0,T=0;o>c;++c){var R=b(c),M=32767&c,L=f[R];if(v[M]=L,f[R]=M,c>=E){var P=o-c;if((I>7e3||x>24576)&&P>423){u=fc(e,l,0,w,S,C,k,x,T,c-T,u),x=I=k=0,T=c;for(var A=0;286>A;++A)S[A]=0;for(A=0;30>A;++A)C[A]=0}var F=2,N=0,O=g,D=M-L&32767;if(P>2&&R==b(c-D))for(var B=Math.min(p,P)-1,H=Math.min(32767,c),q=Math.min(258,P);H>=D&&--O&&M!=L;){if(e[c+F]==e[c+F-D]){for(var z=0;q>z&&e[c+z]==e[c+z-D];++z);if(z>F){if(F=z,N=D,z>B)break;var V=Math.min(D,z-2),U=0;for(A=0;V>A;++A){var W=c-D+A+32768&32767,j=W-v[W]+32768&32767;j>U&&(U=j,L=W)}}}D+=(M=L)-(L=v[M])+32768&32767}if(N){w[x++]=268435456|Ju[F]<<18|Qu[N];var G=31&Ju[F],Z=31&Qu[N];k+=Gu[G]+Zu[Z],++S[257+G],++C[Z],E=c+F,++I}else w[x++]=e[c],++S[e[c]]}}u=fc(e,l,true,w,S,C,k,x,T,c-T,u)}return uc(a,0,i+lc(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)},Sc=function(e,t,r){for(;r;++t)e[t]=r,r>>>=8},Cc=function(e,t){var r=t.filename;if(e[0]=31,e[1]=139,e[2]=8,e[8]=2>t.level?4:9==t.level?2:0,e[9]=3,0!=t.mtime&&Sc(e,4,Math.floor(new Date(t.mtime||Date.now())/1e3)),r){e[3]=8;for(var i=0;r.length>=i;++i)e[i+10]=r.charCodeAt(i)}},Ic=function(e){return 10+(e.filename&&e.filename.length+1||0)};function kc(e,t){void 0===t&&(t={});var r=bc(),i=e.length;r.p(e);var n=wc(e,t,Ic(t),8),s=n.length;return Cc(n,t),Sc(n,s-8,r.d()),Sc(n,s-4,i),n}function xc(e,t){var r=e.length;if("undefined"!=typeof TextEncoder)return(new TextEncoder).encode(e);for(var i=new Uu(e.length+(e.length>>>1)),n=0,s=function(e){i[n++]=e},o=0;r>o;++o){if(n+5>i.length){var a=new Uu(n+8+(r-o<<1));a.set(i),i=a}var l=e.charCodeAt(o);128>l||t?s(l):2048>l?(s(192|l>>>6),s(128|63&l)):l>55295&&57344>l?(s(240|(l=65536+(1047552&l)|1023&e.charCodeAt(++o))>>>18),s(128|l>>>12&63),s(128|l>>>6&63),s(128|63&l)):(s(224|l>>>12),s(128|l>>>6&63),s(128|63&l))}return uc(i,0,n)}var Ec=!!es||!!Qn,Tc="text/plain",Rc=!1,Mc=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=Is(a);return u&&l.push(u),s+"?"+l.join("&")},Lc=(e,t)=>JSON.stringify(e,((e,t)=>"bigint"==typeof t?t.toString():t),t),Pc=e=>{if(e._encodedBody)return e._encodedBody;var{data:t,compression:r}=e;if(t){if(r===Vu){var i=kc(xc(Lc(t)),{mtime:0});return{contentType:Tc,body:i.buffer.slice(i.byteOffset,i.byteOffset+i.byteLength),estimatedSize:i.byteLength}}if(r===$u){var n=function(e){return e?btoa(encodeURIComponent(e).replace(/%([0-9A-F]{2})/g,((e,t)=>String.fromCharCode(parseInt(t,16))))):e}(Lc(t)),s=(e=>"data="+encodeURIComponent("string"==typeof e?e:Lc(e)))(n);return{contentType:"application/x-www-form-urlencoded",body:s,estimatedSize:new Blob([s]).size}}var o=Lc(t);return{contentType:"application/json",body:o,estimatedSize:new Blob([o]).size}}},Ac=function(){var e=t((function*(e){var t=Lc(e.data),i=yield function(e,t,r){return Ar.apply(this,arguments)}(t,as.DEBUG,{rethrow:!0});if(!i)return e;var n=yield i.arrayBuffer();return r({},e,{_encodedBody:{contentType:Tc,body:n,estimatedSize:n.byteLength}})}));return function(t){return e.apply(this,arguments)}}(),Fc=(e,t)=>Mc(e,{_:(new Date).getTime().toString(),ver:as.JS_SDK_VERSION,compression:t}),Nc=[];Qn&&Nc.push({transport:"fetch",method(e){var t,i,{contentType:n,body:s,estimatedSize:o}=null!==(t=Pc(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&&52428.8>(o||0),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){us.error(e)}null==e.callback||e.callback(i)})))).catch((t=>{us.error(t),null==e.callback||e.callback({statusCode:0,error:t})})).finally((()=>u?clearTimeout(u.timeout):null))}}),es&&Nc.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=Pc(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&&Nc.push({transport:"sendBeacon",method(e){var t=Mc(e.url,{beacon:"1"});try{var r,{contentType:i,body:n}=null!==(r=Pc(e))&&void 0!==r?r:{};if(!n)return;var s=n instanceof Blob?n:new Blob([n],{type:i});Xn.sendBeacon(t,s)}catch(e){}}});var Oc=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 Dc(e,t,r){return Lc({distinct_id:e,userPropertiesToSet:t,userPropertiesToSetOnce:r})}var Bc={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=>Oc(t,e))))),not_regex:(e,t)=>t.every((t=>e.every((e=>!Oc(t,e))))),icontains:(e,t)=>t.map(Hc).some((t=>e.map(Hc).some((e=>t.includes(e))))),not_icontains:(e,t)=>t.map(Hc).every((t=>e.map(Hc).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)))}))},Hc=e=>e.toLowerCase(),qc=new Set(["is_not","not_icontains","not_regex"]);function zc(e,t,r){return!e||0===e.length||e.every((e=>{var i="person"===e.type?r:t,n=null==i?void 0:i[e.key],s=e.operator||"exact";if(Zr(n)||Kr(n))return qc.has(s);var o=Bc[s];return!!o&&!Zr(e.value)&&!Kr(e.value)&&o(Ur(e.value)?e.value.map(String):[String(e.value)],Ur(n)?n.map(String):[String(n)])}))}function Vc(e,t){return!e||Object.entries(e).every((e=>{var[r,i]=e,n=null==t?void 0:t[r];if(Zr(n)||Kr(n))return!1;var s=[String(n)],o=Bc[i.operator];return!!o&&o(i.values,s)}))}var $c="",Uc=/[a-z0-9][a-z0-9-]+\.[a-z]{2,}$/i;var Wc={_is_supported:()=>!!Kn,_error(e){us.error("cookieStore error: "+e)},_get(e){if(Kn){try{for(var t=e+"=",r=Kn.cookie.split(";").filter((e=>e.length)),i=0;r.length>i;i++){for(var n=r[i];" "==n.charAt(0);)n=n.substring(1,n.length);if(0===n.indexOf(t))return decodeURIComponent(n.substring(t.length,n.length))}}catch(e){}return null}},_parse(e){var t;try{t=JSON.parse(Wc._get(e))||{}}catch(e){}return t},_set(e,t,r,i,n){if(Kn)try{var s="",o="",a=function(e,t){if(t){var r=function(e,t){if(void 0===t&&(t=Kn),$c)return $c;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_"+qu();!$c&&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",$c=s)}return $c}(e);if(!r){var i=(e=>{var t=e.match(Uc);return t?t[0]:""})(e);i!==r&&us.info("Warning: cookie subdomain discovery mismatch",i,r),r=i}return r?"; domain=."+r:""}return""}(Kn.location.hostname,i);if(r){var l=new Date;l.setTime(l.getTime()+864e5*r),s="; expires="+l.toUTCString()}n&&(o="; secure");var u=e+"="+encodeURIComponent(JSON.stringify(t))+s+"; SameSite=Lax; path=/"+a+o;return u.length>3686.4&&us.warn("cookieStore warning: large cookie, len="+u.length),Kn.cookie=u,u}catch(e){return}},_remove(e,t){if(null!=Kn&&Kn.cookie)try{Wc._set(e,"",-1,t)}catch(e){return}}},jc=null,Gc={_is_supported(){if(!Kr(jc))return jc;var e=!0;if(Zr(Zn))e=!1;else try{var t="__mplssupport__";Gc._set(t,"xyz"),'"xyz"'!==Gc._get(t)&&(e=!1),Gc._remove(t)}catch(t){e=!1}return e||us.error("localStorage unsupported; falling back to cookie store"),jc=e,e},_error(e){us.error("localStorage error: "+e)},_get(e){try{return null==Zn?void 0:Zn.localStorage.getItem(e)}catch(e){Gc._error(e)}return null},_parse(e){try{return JSON.parse(Gc._get(e))||{}}catch(e){}return null},_set(e,t){try{null==Zn||Zn.localStorage.setItem(e,JSON.stringify(t))}catch(e){Gc._error(e)}},_remove(e){try{null==Zn||Zn.localStorage.removeItem(e)}catch(e){Gc._error(e)}}},Zc=[Ls,"distinct_id",Zs,Ys,Eo,xo,wo],Yc={},Xc={_is_supported:()=>!0,_error(e){us.error("memoryStorage error: "+e)},_get:e=>Yc[e]||null,_parse:e=>Yc[e]||null,_set(e,t){Yc[e]=t},_remove(e){delete Yc[e]}},Kc=null,Jc={_is_supported(){if(!Kr(Kc))return Kc;if(Kc=!0,Zr(Zn))Kc=!1;else try{var e="__support__";Jc._set(e,"xyz"),'"xyz"'!==Jc._get(e)&&(Kc=!1),Jc._remove(e)}catch(e){Kc=!1}return Kc},_error(e){us.error("sessionStorage error: ",e)},_get(e){try{return null==Zn?void 0:Zn.sessionStorage.getItem(e)}catch(e){Jc._error(e)}return null},_parse(e){try{return JSON.parse(Jc._get(e))||null}catch(e){}return null},_set(e,t){try{null==Zn||Zn.sessionStorage.setItem(e,JSON.stringify(t))}catch(e){Jc._error(e)}},_remove(e){try{null==Zn||Zn.sessionStorage.removeItem(e)}catch(e){Jc._error(e)}}},Qc=cs("[Stylesheet Loader]"),ed=Zn,td=Kn;function rd(e){return"$survey_response_"+e}var id="#020617",nd={fontFamily:"inherit",backgroundColor:"#eeeded",submitButtonColor:"black",submitButtonTextColor:"white",ratingButtonColor:"white",ratingButtonActiveColor:"black",borderColor:"#c9c6c6",placeholder:"Start typing...",whiteLabel:!1,displayThankYouMessage:!0,thankYouMessageHeader:"Thank you for your feedback!",position:gu.Right,widgetType:pu.Tab,widgetLabel:"Feedback",widgetColor:"black",zIndex:String(2147483645),disabledButtonOpacity:"0.6",maxWidth:"300px",textSubtleColor:"#939393",boxPadding:"20px 24px",boxShadow:"0 4px 12px rgba(0, 0, 0, 0.15)",borderRadius:"10px",shuffleQuestions:!1,surveyPopupDelaySeconds:void 0,outlineColor:"rgba(59, 130, 246, 0.8)",inputBackground:"white",inputTextColor:id,scrollbarThumbColor:"var(--ph-survey-border-color)",scrollbarTrackColor:"var(--ph-survey-background-color)"},sd=[gu.Center,gu.Left,gu.Right];function od(e){if(e.startsWith("#")){var t=e.replace(/^#/,"");return/^[0-9A-Fa-f]{3}$/.test(t)&&(t=t[0]+t[0]+t[1]+t[1]+t[2]+t[2]),/^[0-9A-Fa-f]{6}$/.test(t)?"rgb("+parseInt(t.slice(0,2),16)+","+parseInt(t.slice(2,4),16)+","+parseInt(t.slice(4,6),16)+")":"rgb(255, 255, 255)"}return"rgb(255, 255, 255)"}function ad(e){var t;void 0===e&&(e=nd.backgroundColor),"#"===e[0]&&(t=od(e)),e.startsWith("rgb")&&(t=e);var r={aliceblue:"#f0f8ff",antiquewhite:"#faebd7",aqua:"#00ffff",aquamarine:"#7fffd4",azure:"#f0ffff",beige:"#f5f5dc",bisque:"#ffe4c4",black:"#000000",blanchedalmond:"#ffebcd",blue:"#0000ff",blueviolet:"#8a2be2",brown:"#a52a2a",burlywood:"#deb887",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",cornflowerblue:"#6495ed",cornsilk:"#fff8dc",crimson:"#dc143c",cyan:"#00ffff",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkgray:"#a9a9a9",darkgreen:"#006400",darkkhaki:"#bdb76b",darkmagenta:"#8b008b",darkolivegreen:"#556b2f",darkorange:"#ff8c00",darkorchid:"#9932cc",darkred:"#8b0000",darksalmon:"#e9967a",darkseagreen:"#8fbc8f",darkslateblue:"#483d8b",darkslategray:"#2f4f4f",darkturquoise:"#00ced1",darkviolet:"#9400d3",deeppink:"#ff1493",deepskyblue:"#00bfff",dimgray:"#696969",dodgerblue:"#1e90ff",firebrick:"#b22222",floralwhite:"#fffaf0",forestgreen:"#228b22",fuchsia:"#ff00ff",gainsboro:"#dcdcdc",ghostwhite:"#f8f8ff",gold:"#ffd700",goldenrod:"#daa520",gray:"#808080",green:"#008000",greenyellow:"#adff2f",honeydew:"#f0fff0",hotpink:"#ff69b4","indianred ":"#cd5c5c",indigo:"#4b0082",ivory:"#fffff0",khaki:"#f0e68c",lavender:"#e6e6fa",lavenderblush:"#fff0f5",lawngreen:"#7cfc00",lemonchiffon:"#fffacd",lightblue:"#add8e6",lightcoral:"#f08080",lightcyan:"#e0ffff",lightgoldenrodyellow:"#fafad2",lightgrey:"#d3d3d3",lightgreen:"#90ee90",lightpink:"#ffb6c1",lightsalmon:"#ffa07a",lightseagreen:"#20b2aa",lightskyblue:"#87cefa",lightslategray:"#778899",lightsteelblue:"#b0c4de",lightyellow:"#ffffe0",lime:"#00ff00",limegreen:"#32cd32",linen:"#faf0e6",magenta:"#ff00ff",maroon:"#800000",mediumaquamarine:"#66cdaa",mediumblue:"#0000cd",mediumorchid:"#ba55d3",mediumpurple:"#9370d8",mediumseagreen:"#3cb371",mediumslateblue:"#7b68ee",mediumspringgreen:"#00fa9a",mediumturquoise:"#48d1cc",mediumvioletred:"#c71585",midnightblue:"#191970",mintcream:"#f5fffa",mistyrose:"#ffe4e1",moccasin:"#ffe4b5",navajowhite:"#ffdead",navy:"#000080",oldlace:"#fdf5e6",olive:"#808000",olivedrab:"#6b8e23",orange:"#ffa500",orangered:"#ff4500",orchid:"#da70d6",palegoldenrod:"#eee8aa",palegreen:"#98fb98",paleturquoise:"#afeeee",palevioletred:"#d87093",papayawhip:"#ffefd5",peachpuff:"#ffdab9",peru:"#cd853f",pink:"#ffc0cb",plum:"#dda0dd",powderblue:"#b0e0e6",purple:"#800080",red:"#ff0000",rosybrown:"#bc8f8f",royalblue:"#4169e1",saddlebrown:"#8b4513",salmon:"#fa8072",sandybrown:"#f4a460",seagreen:"#2e8b57",seashell:"#fff5ee",sienna:"#a0522d",silver:"#c0c0c0",skyblue:"#87ceeb",slateblue:"#6a5acd",slategray:"#708090",snow:"#fffafa",springgreen:"#00ff7f",steelblue:"#4682b4",tan:"#d2b48c",teal:"#008080",thistle:"#d8bfd8",tomato:"#ff6347",turquoise:"#40e0d0",violet:"#ee82ee",wheat:"#f5deb3",white:"#ffffff",whitesmoke:"#f5f5f5",yellow:"#ffff00",yellowgreen:"#9acd32"}[e.toLowerCase()];if(r&&(t=od(r)),!t)return id;var i=t.match(/^rgba?\((\d+),\s*(\d+),\s*(\d+)(?:,\s*(\d+(?:\.\d+)?))?\)$/);if(i){var n=parseInt(i[1]),s=parseInt(i[2]),o=parseInt(i[3]);return Math.sqrt(n*n*.299+s*s*.587+o*o*.114)>127.5?id:"white"}return id}var ld=(e,t,i)=>{var n=Td(e),s=td.querySelector("."+n);if(s&&s.shadowRoot)return{shadow:s.shadowRoot,isNewlyCreated:!1};var o=td.createElement("div");((e,t,i)=>{var n=r({},nd,i),s=e.style,o=!sd.includes(n.position)||t===vu.Widget&&(null==i?void 0:i.widgetType)===pu.Tab;s.setProperty("--ph-survey-font-family",function(e){if("inherit"===e)return"inherit";var t='BlinkMacSystemFont, "Inter", "Segoe UI", "Roboto", Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol"';return e?e+", "+t:"-apple-system, "+t}(n.fontFamily)),s.setProperty("--ph-survey-box-padding",n.boxPadding),s.setProperty("--ph-survey-max-width",n.maxWidth),s.setProperty("--ph-survey-z-index",n.zIndex),s.setProperty("--ph-survey-border-color",n.borderColor),o?(s.setProperty("--ph-survey-border-radius",n.borderRadius),s.setProperty("--ph-survey-border-bottom","1.5px solid var(--ph-survey-border-color)")):(s.setProperty("--ph-survey-border-bottom","none"),s.setProperty("--ph-survey-border-radius",n.borderRadius+" "+n.borderRadius+" 0 0")),s.setProperty("--ph-survey-background-color",n.backgroundColor),s.setProperty("--ph-survey-box-shadow",n.boxShadow),s.setProperty("--ph-survey-disabled-button-opacity",n.disabledButtonOpacity),s.setProperty("--ph-survey-submit-button-color",n.submitButtonColor),s.setProperty("--ph-survey-submit-button-text-color",(null==i?void 0:i.submitButtonTextColor)||ad(n.submitButtonColor)),s.setProperty("--ph-survey-rating-bg-color",n.ratingButtonColor),s.setProperty("--ph-survey-rating-active-bg-color",n.ratingButtonActiveColor),s.setProperty("--ph-survey-rating-active-text-color",ad(n.ratingButtonActiveColor)),s.setProperty("--ph-survey-text-primary-color",(null==i?void 0:i.textColor)||ad(n.backgroundColor)),s.setProperty("--ph-survey-text-subtle-color",n.textSubtleColor),s.setProperty("--ph-widget-color",n.widgetColor),s.setProperty("--ph-widget-text-color",ad(n.widgetColor)),s.setProperty("--ph-widget-z-index",n.zIndex);var a=(null==i?void 0:i.inputBackground)||(null==i?void 0:i.inputBackgroundColor),l=a||n.inputBackground;a||"white"!==n.backgroundColor||(l="#f8f8f8"),s.setProperty("--ph-survey-input-background",l);var u=(null==i?void 0:i.inputTextColor)||ad(l);s.setProperty("--ph-survey-input-text-color",u),s.setProperty("--ph-survey-rating-text-color",u),s.setProperty("--ph-survey-scrollbar-thumb-color",n.scrollbarThumbColor),s.setProperty("--ph-survey-scrollbar-track-color",n.scrollbarTrackColor),s.setProperty("--ph-survey-outline-color",n.outlineColor)})(o,e.type,e.appearance),o.className=n;var a=o.attachShadow({mode:"open"}),l=function(e){var t=((e,t,r)=>{var i,n=e.createElement("style");return n.innerText=':host{--ph-survey-font-family:-apple-system,BlinkMacSystemFont,"Inter","Segoe UI","Roboto",Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol";--ph-survey-box-padding:20px 24px;--ph-survey-max-width:300px;--ph-survey-z-index:2147483645;--ph-survey-border-color:#dcdcdc;--ph-survey-border-bottom:1.5px solid var(--ph-survey-border-color);--ph-survey-border-radius:10px;--ph-survey-background-color:#eeeded;--ph-survey-box-shadow:0 4px 12px rgba(0,0,0,.15);--ph-survey-submit-button-color:#000;--ph-survey-submit-button-text-color:#fff;--ph-survey-rating-bg-color:#fff;--ph-survey-rating-text-color:#020617;--ph-survey-rating-active-bg-color:#000;--ph-survey-rating-active-text-color:#fff;--ph-survey-text-primary-color:#020617;--ph-survey-text-subtle-color:#939393;--ph-widget-color:#e0a045;--ph-widget-text-color:#fff;--ph-survey-scrollbar-thumb-color:var(--ph-survey-border-color);--ph-survey-scrollbar-track-color:var(--ph-survey-background-color);--ph-survey-outline-color:rgba(59,130,246,.8);--ph-survey-input-background:#fff;--ph-survey-input-text-color:#020617;--ph-survey-disabled-button-opacity:0.6}.ph-survey{bottom:0;height:fit-content;margin:0;max-width:85%;min-width:300px;position:fixed;width:var(--ph-survey-max-width);z-index:var(--ph-survey-z-index)}.ph-survey h3,.ph-survey p{margin:0}.ph-survey *{box-sizing:border-box;color:var(--ph-survey-text-primary-color);font-family:var(--ph-survey-font-family)}.ph-survey .multiple-choice-options label,.ph-survey input[type=text],.ph-survey textarea{background:var(--ph-survey-input-background);border:1.5px solid var(--ph-survey-border-color);border-radius:4px;color:var(--ph-survey-input-text-color);padding:10px;transition:border-color .2s ease-out,box-shadow .2s ease-out,transform .15s ease-out}.ph-survey input[type=text],.ph-survey textarea{transition:border-color .2s ease-out,box-shadow .2s ease-out,transform .15s ease-out}.ph-survey input{margin:0}.ph-survey .form-submit:focus,.ph-survey .form-submit:focus-visible,.ph-survey input[type=checkbox]:focus,.ph-survey input[type=checkbox]:focus-visible,.ph-survey input[type=radio]:focus,.ph-survey input[type=radio]:focus-visible,.ph-survey input[type=text]:focus,.ph-survey input[type=text]:focus-visible,.ph-survey textarea:focus,.ph-survey textarea:focus-visible{border-color:var(--ph-survey-rating-active-bg-color);outline:1.5px solid var(--ph-survey-outline-color);outline-offset:2px}.ph-survey button:focus:not(:focus-visible),.ph-survey input[type=checkbox]:focus:not(:focus-visible),.ph-survey input[type=radio]:focus:not(:focus-visible),.ph-survey input[type=text]:focus:not(:focus-visible),.ph-survey textarea:focus:not(:focus-visible){outline:none}.ph-survey input[type=text]:hover:not(:focus),.ph-survey textarea:hover:not(:focus){border-color:var(--ph-survey-rating-active-bg-color)}@media (max-width:768px){.ph-survey input[type=text],.ph-survey textarea{font-size:1rem}}.ph-survey .form-cancel,.ph-survey .multiple-choice-options label,.ph-survey .rating-options-number,.ph-survey input[type=checkbox],.ph-survey input[type=radio]{border:1.5px solid var(--ph-survey-border-color)}.ph-survey .footer-branding,.ph-survey .form-cancel,.ph-survey .form-submit,.ph-survey .ratings-emoji,.ph-survey .ratings-number,.ph-survey input[type=checkbox],.ph-survey input[type=radio],.ph-survey label{transition:all .2s ease-out}@media (prefers-reduced-motion:no-preference){.ph-survey button:active,.ph-survey input[type=checkbox]:active,.ph-survey input[type=radio]:active,.ph-survey label:active{transition-duration:.1s}}.ph-survey-widget-tab{background:var(--ph-widget-color);border:none;border-radius:3px 3px 0 0;color:var(--ph-widget-text-color);cursor:pointer;padding:10px 12px;position:fixed;text-align:center;transition:padding .2s ease-out;z-index:var(--ph-survey-z-index)}.ph-survey-widget-tab:hover:not(.widget-tab-top){padding-bottom:16px}.ph-survey-widget-tab.widget-tab-top{border-radius:0 0 3px 3px}.ph-survey-widget-tab.widget-tab-top:hover{padding-top:16px}@keyframes ph-survey-fade-in{0%{opacity:0}to{opacity:1}}.survey-box{gap:16px}.bottom-section,.survey-box{display:flex;flex-direction:column}.bottom-section{gap:8px}.thank-you-message-header~.bottom-section{padding-top:16px}.question-container,.thank-you-message{display:flex;flex-direction:column;gap:8px}.survey-question{font-size:14px;font-weight:500}.survey-question-description{font-size:13px;opacity:.8;padding-top:4px}.survey-question-description,.thank-you-message-body{word-wrap:break-word;overflow-wrap:break-word}:is(.survey-question-description,.thank-you-message-body) embed,:is(.survey-question-description,.thank-you-message-body) iframe,:is(.survey-question-description,.thank-you-message-body) img,:is(.survey-question-description,.thank-you-message-body) object,:is(.survey-question-description,.thank-you-message-body) video{height:auto;max-width:100%}:is(.survey-question-description,.thank-you-message-body) svg{height:auto;max-width:100%}.question-textarea-wrapper{display:flex;flex-direction:column}.survey-form{animation:ph-survey-fade-in .3s ease-out forwards}.survey-form,.thank-you-message{background:var(--ph-survey-background-color);border:1.5px solid var(--ph-survey-border-color);border-bottom:var(--ph-survey-border-bottom);border-radius:var(--ph-survey-border-radius);box-shadow:var(--ph-survey-box-shadow);margin:0;padding:var(--ph-survey-box-padding);position:relative;text-align:left;width:100%;z-index:var(--ph-survey-z-index)}.survey-form input[type=text],.survey-form textarea{min-width:100%}:is(.survey-form textarea):focus,:is(.survey-form textarea):focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.08)}:is(.survey-form textarea):focus:not(:focus-visible){box-shadow:none}.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}.rating-options-emoji-2{justify-content:space-around}.ratings-emoji{background-color:transparent;border:none;font-size:16px;opacity:.5;padding:0}.ratings-emoji:hover{cursor:pointer;opacity:1;transform:scale(1.15)}.ratings-emoji.rating-active{opacity:1}.ratings-emoji svg{fill:var(--ph-survey-text-primary-color);transition:fill .2s ease-out}.rating-options-number{border-radius:6px;display:grid;grid-auto-columns:1fr;grid-auto-flow:column;overflow:hidden}.rating-options-number .ratings-number{border:none;border-right:1px solid var(--ph-survey-border-color);color:var(--ph-survey-rating-text-color);cursor:pointer;font-weight:700;text-align:center}:is(.rating-options-number .ratings-number):last-of-type{border-right:0}.rating-active:is(.rating-options-number .ratings-number){background:var(--ph-survey-rating-active-bg-color);color:var(--ph-survey-rating-active-text-color)}.ratings-number{background-color:var(--ph-survey-rating-bg-color);border:none;padding:8px 0}.ratings-number .rating-active{background-color:var(--ph-survey-rating-active-bg-color)}.ratings-number{cursor:pointer}@media (hover:hover) and (pointer:fine){.ratings-number:hover:not(.rating-active){background-color:color-mix(in srgb,var(--ph-survey-rating-active-bg-color) 14%,var(--ph-survey-rating-bg-color))}}.rating-text{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)}.validation-hint{font-size:12px;margin-top:4px;opacity:.7}.form-cancel{background:#fff;border-radius:100%;cursor:pointer;line-height:0;padding:12px;position:absolute;right:0;top:0;transform:translate(50%,-50%)}.form-cancel:hover{opacity:.7;transform:translate(50%,-50%) scale(1.1)}.footer-branding{align-items:center;display:flex;font-size:11px;font-weight:500;gap:4px;justify-content:center;opacity:.6;text-decoration:none}.footer-branding:hover{opacity:1}.footer-branding a{text-decoration:none}.thank-you-message{text-align:center}.thank-you-message-header{margin:10px 0 0}.thank-you-message-body{font-size:14px;opacity:.8}.limit-height{max-height:256px;overflow-x:hidden;overflow-y:auto;scrollbar-color:var(--ph-survey-scrollbar-thumb-color) var(--ph-survey-scrollbar-track-color);scrollbar-width:thin}.limit-height::-webkit-scrollbar{width:8px}.limit-height::-webkit-scrollbar-track{background:var(--ph-survey-scrollbar-track-color);border-radius:4px}.limit-height::-webkit-scrollbar-thumb{background-color:var(--ph-survey-scrollbar-thumb-color);border:2px solid var(--ph-survey-scrollbar-track-color);border-radius:4px}:is(.limit-height::-webkit-scrollbar-thumb):hover{background-color:var(--ph-survey-text-subtle-color)}.sr-only{clip:rect(0,0,0,0);border:0;height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;white-space:nowrap;width:1px}@media (prefers-reduced-motion:reduce){.ph-survey *{animation-duration:.01ms!important;animation-iteration-count:1!important;scroll-behavior:auto!important;transition-duration:.01ms!important}}@keyframes ph-survey-checkmark-reveal{0%{opacity:0;transform:rotate(45deg) scale(0)}50%{opacity:1;transform:rotate(45deg) scale(1.2)}to{opacity:1;transform:rotate(45deg) scale(1)}}@keyframes ph-survey-radio-reveal{0%{opacity:0;transform:scale(0)}50%{opacity:1;transform:scale(1.3)}to{opacity:1;transform:scale(1)}}',null!=r&&null!=(i=r.config)&&i.prepare_external_dependency_stylesheet&&(n=r.config.prepare_external_dependency_stylesheet(n)),n||(Qc.error("prepare_external_dependency_stylesheet returned null"),null)})(td,0,e);return null==t||t.setAttribute("data-ph-survey-style","true"),t}(t);if(l){var u=a.querySelector("style");u&&a.removeChild(u),a.appendChild(l)}return td.body.appendChild(o),{shadow:a,isNewlyCreated:!0}},ud=(e,t)=>{if(!t)return null;var r=e[rd(t)];return Ur(r)?[...r]:r},cd=e=>{var{responses:t,survey:i,surveySubmissionId:n,posthog:s,isSurveyCompleted:o,properties:a}=e;s?(Pu(i),s.capture(bu.SENT,r({[wu.SURVEY_NAME]:i.name,[wu.SURVEY_ID]:i.id,[wu.SURVEY_ITERATION]:i.current_iteration,[wu.SURVEY_ITERATION_START_DATE]:i.current_iteration_start_date,[wu.SURVEY_QUESTIONS]:i.questions.map((e=>({id:e.id,question:e.question,response:ud(t,e.id)}))),[wu.SURVEY_SUBMISSION_ID]:n,[wu.SURVEY_COMPLETED]:o,sessionRecordingUrl:null==s.get_session_replay_url?void 0:s.get_session_replay_url()},t,a,{$set:{[Ru(i,"responded")]:!0}})),o&&(ed.dispatchEvent(new CustomEvent("PHSurveySent",{detail:{surveyId:i.id}})),Ed(i))):Cu.error("[survey sent] event not captured, PostHog instance not found.")},dd=e=>Object.values((null==e?void 0:e.responses)||{}).filter((e=>!Jr(e))).length>0,hd=(e,t,i)=>r({[wu.SURVEY_NAME]:e.name,[wu.SURVEY_ID]:e.id,[wu.SURVEY_ITERATION]:e.current_iteration,[wu.SURVEY_ITERATION_START_DATE]:e.current_iteration_start_date,[wu.SURVEY_PARTIALLY_COMPLETED]:dd(t),sessionRecordingUrl:null==i.get_session_replay_url?void 0:i.get_session_replay_url()},null==t?void 0:t.responses,{[wu.SURVEY_SUBMISSION_ID]:null==t?void 0:t.surveySubmissionId,[wu.SURVEY_QUESTIONS]:e.questions.map((e=>({id:e.id,question:e.question,response:ud((null==t?void 0:t.responses)||{},e.id)})))}),pd=(e,t,i)=>{if(t){if(!i){var n=kd(e);t.capture(bu.DISMISSED,r({},hd(e,n,t),{$set:{[Ru(e,"dismissed")]:!0}})),Ed(e),Pu(e),ed.dispatchEvent(new CustomEvent("PHSurveyClosed",{detail:{surveyId:e.id}}))}}else Cu.error("[survey dismissed] event not captured, PostHog instance not found.")},gd=(e,t)=>{if(t){var r=(e=>Mu("abandonedSurvey_",e))(e);try{if("true"===localStorage.getItem(r))return}catch(e){return}var i=kd(e);if(i){try{localStorage.setItem(r,"true")}catch(e){}t.capture(bu.ABANDONED,hd(e,i,t),{transport:"sendBeacon"})}}else Cu.error("[survey abandoned] event not captured, PostHog instance not found.")},_d=e=>e.map((e=>({sort:Math.floor(10*Math.random()),value:e}))).sort(((e,t)=>e.sort-t.sort)).map((e=>e.value)),vd=(e,t)=>e.length===t.length&&e.every(((e,r)=>e===t[r]))?t.reverse():t,fd=e=>e.appearance&&e.appearance.shuffleQuestions&&!e.enable_partial_responses?vd(e.questions,_d(e.questions)):e.questions,md=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===yu||xd(e)},yd=function(e){function t(e){var r,i;return this.getChildContext||(r=new Set,(i={})[t.__c]=this,this.getChildContext=function(){return i},this.componentWillUnmount=function(){r=null},this.shouldComponentUpdate=function(e){this.props.value!=e.value&&r.forEach((function(e){e.__e=!0,Il(e)}))},this.sub=function(e){r.add(e);var t=e.componentWillUnmount;e.componentWillUnmount=function(){r&&r.delete(e),t&&t.call(e)}}),e.children}return t.__c="__cC"+dl++,t.__=e,t.Provider=t.__l=(t.Consumer=function(e,t){return e.children(t)}).contextType=t,t}({isPreviewMode:!1,previewPageIndex:0,onPopupSurveyDismissed(){},isPopup:!0,onPreviewSubmit(){},surveySubmissionId:"",properties:void 0}),bd=()=>iu(yd),wd=e=>{var{component:t,children:r,renderAsHtml:i,style:n}=e;return function(e,t,r){var i,n,s,o,a=vl({},e.props);for(s in e.type&&e.type.defaultProps&&(o=e.type.defaultProps),t)"key"==s?i=t[s]:"ref"==s?n=t[s]:a[s]=void 0===t[s]&&null!=o?o[s]:t[s];return arguments.length>2&&(a.children=arguments.length>3?el.call(arguments,2):r),yl(e.type,a,i||e.key,n||e.ref,null)}(t,i?{dangerouslySetInnerHTML:{__html:r},style:n}:{children:r,style:n})};function Sd(e){var t,r,i;if(null==(t=e.conditions)||!t.url)return!0;var n=null==ed||null==(r=ed.location)?void 0:r.href;if(!n)return!1;var s=[e.conditions.url],o=function(e){return null!=e?e:"icontains"}(null==(i=e.conditions)?void 0:i.urlMatchType);return Bc[o](s,[n])}var Cd=e=>{var t=""+Tu+e.id;return e.current_iteration&&e.current_iteration>0&&(t=""+Tu+e.id+"_"+e.current_iteration),t},Id=(e,t)=>{try{localStorage.setItem(Cd(e),JSON.stringify(t))}catch(e){Cu.error("Error setting in-progress survey state in localStorage",e)}},kd=e=>{try{var t=localStorage.getItem(Cd(e));if(t)return JSON.parse(t)}catch(e){Cu.error("Error getting in-progress survey state from localStorage",e)}return null},xd=e=>{var t=kd(e);return!Jr(null==t?void 0:t.surveySubmissionId)},Ed=e=>{try{localStorage.removeItem(Cd(e))}catch(e){Cu.error("Error clearing in-progress survey state from localStorage",e)}};function Td(e,t){void 0===t&&(t=!1);var r="PostHogSurvey-"+e.id;return t?"."+r:r}function Rd(e,t,r){if(void 0===t&&(t=gu.Right),e===vu.ExternalSurvey)return{};switch(t){case gu.TopLeft:return{top:"0",left:"0",transform:"translate(30px, 30px)"};case gu.TopRight:return{top:"0",right:"0",transform:"translate(-30px, 30px)"};case gu.TopCenter:return{top:"0",left:"50%",transform:"translate(-50%, 30px)"};case gu.MiddleLeft:return{top:"50%",left:"0",transform:"translate(30px, -50%)"};case gu.MiddleRight:return{top:"50%",right:"0",transform:"translate(-30px, -50%)"};case gu.MiddleCenter:return{top:"50%",left:"50%",transform:"translate(-50%, -50%)"};case gu.Left:return{left:"30px"};case gu.Center:return{left:"50%",transform:"translateX(-50%)"};default:return{right:e===vu.Widget&&r===pu.Tab?"60px":"30px"}}}var Md=0;function Ld(e,t,r,i,n,s){t||(t={});var o,a,l=t;if("ref"in l)for(a in l={},t)"ref"==a?o=t[a]:l[a]=t[a];var u={type:e,props:l,key:r,ref:o,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:--Md,__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 tl.vnode&&tl.vnode(u),u}var Pd=Ld("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 -960 960 960",width:"48",children:Ld("path",{d:"M626-533q22.5 0 38.25-15.75T680-587q0-22.5-15.75-38.25T626-641q-22.5 0-38.25 15.75T572-587q0 22.5 15.75 38.25T626-533Zm-292 0q22.5 0 38.25-15.75T388-587q0-22.5-15.75-38.25T334-641q-22.5 0-38.25 15.75T280-587q0 22.5 15.75 38.25T334-533Zm146 272q66 0 121.5-35.5T682-393h-52q-23 40-63 61.5T480.5-310q-46.5 0-87-21T331-393h-53q26 61 81 96.5T480-261Zm0 181q-83 0-156-31.5T197-197q-54-54-85.5-127T80-480q0-83 31.5-156T197-763q54-54 127-85.5T480-880q83 0 156 31.5T763-763q54 54 85.5 127T880-480q0 83-31.5 156T763-197q-54 54-127 85.5T480-80Zm0-400Zm0 340q142.375 0 241.188-98.812Q820-337.625 820-480t-98.812-241.188Q622.375-820 480-820t-241.188 98.812Q140-622.375 140-480t98.812 241.188Q337.625-140 480-140Z"})}),Ad=Ld("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 -960 960 960",width:"48",children:Ld("path",{d:"M626-533q22.5 0 38.25-15.75T680-587q0-22.5-15.75-38.25T626-641q-22.5 0-38.25 15.75T572-587q0 22.5 15.75 38.25T626-533Zm-292 0q22.5 0 38.25-15.75T388-587q0-22.5-15.75-38.25T334-641q-22.5 0-38.25 15.75T280-587q0 22.5 15.75 38.25T334-533Zm20 194h253v-49H354v49ZM480-80q-83 0-156-31.5T197-197q-54-54-85.5-127T80-480q0-83 31.5-156T197-763q54-54 127-85.5T480-880q83 0 156 31.5T763-763q54 54 85.5 127T880-480q0 83-31.5 156T763-197q-54 54-127 85.5T480-80Zm0-400Zm0 340q142.375 0 241.188-98.812Q820-337.625 820-480t-98.812-241.188Q622.375-820 480-820t-241.188 98.812Q140-622.375 140-480t98.812 241.188Q337.625-140 480-140Z"})}),Fd=Ld("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 -960 960 960",width:"48",children:Ld("path",{d:"M626-533q22.5 0 38.25-15.75T680-587q0-22.5-15.75-38.25T626-641q-22.5 0-38.25 15.75T572-587q0 22.5 15.75 38.25T626-533Zm-292 0q22.5 0 38.25-15.75T388-587q0-22.5-15.75-38.25T334-641q-22.5 0-38.25 15.75T280-587q0 22.5 15.75 38.25T334-533Zm146.174 116Q413-417 358.5-379.5T278-280h53q22-42 62.173-65t87.5-23Q528-368 567.5-344.5T630-280h52q-25-63-79.826-100-54.826-37-122-37ZM480-80q-83 0-156-31.5T197-197q-54-54-85.5-127T80-480q0-83 31.5-156T197-763q54-54 127-85.5T480-880q83 0 156 31.5T763-763q54 54 85.5 127T880-480q0 83-31.5 156T763-197q-54 54-127 85.5T480-80Zm0-400Zm0 340q142.375 0 241.188-98.812Q820-337.625 820-480t-98.812-241.188Q622.375-820 480-820t-241.188 98.812Q140-622.375 140-480t98.812 241.188Q337.625-140 480-140Z"})}),Nd=Ld("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 -960 960 960",width:"48",children:Ld("path",{d:"M480-417q-67 0-121.5 37.5T278-280h404q-25-63-80-100t-122-37Zm-183-72 50-45 45 45 31-36-45-45 45-45-31-36-45 45-50-45-31 36 45 45-45 45 31 36Zm272 0 44-45 51 45 31-36-45-45 45-45-31-36-51 45-44-45-31 36 44 45-44 45 31 36ZM480-80q-83 0-156-31.5T197-197q-54-54-85.5-127T80-480q0-83 31.5-156T197-763q54-54 127-85.5T480-880q83 0 156 31.5T763-763q54 54 85.5 127T880-480q0 83-31.5 156T763-197q-54 54-127 85.5T480-80Zm0-400Zm0 340q142 0 241-99t99-241q0-142-99-241t-241-99q-142 0-241 99t-99 241q0 142 99 241t241 99Z"})}),Od=Ld("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 -960 960 960",width:"48",children:Ld("path",{d:"M479.504-261Q537-261 585.5-287q48.5-26 78.5-72.4 6-11.6-.75-22.6-6.75-11-20.25-11H316.918Q303-393 296.5-382t-.5 22.6q30 46.4 78.5 72.4 48.5 26 105.004 26ZM347-578l27 27q7.636 8 17.818 8Q402-543 410-551q8-8 8-18t-8-18l-42-42q-8.8-9-20.9-9-12.1 0-21.1 9l-42 42q-8 7.636-8 17.818Q276-559 284-551q8 8 18 8t18-8l27-27Zm267 0 27 27q7.714 8 18 8t18-8q8-7.636 8-17.818Q685-579 677-587l-42-42q-8.8-9-20.9-9-12.1 0-21.1 9l-42 42q-8 7.714-8 18t8 18q7.636 8 17.818 8Q579-543 587-551l27-27ZM480-80q-83 0-156-31.5T197-197q-54-54-85.5-127T80-480q0-83 31.5-156T197-763q54-54 127-85.5T480-880q83 0 156 31.5T763-763q54 54 85.5 127T880-480q0 83-31.5 156T763-197q-54 54-127 85.5T480-80Zm0-400Zm0 340q142.375 0 241.188-98.812Q820-337.625 820-480t-98.812-241.188Q622.375-820 480-820t-241.188 98.812Q140-622.375 140-480t98.812 241.188Q337.625-140 480-140Z"})}),Dd=Ld("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 0 24 24",width:"48",children:Ld("path",{d:"M2 20h2c.55 0 1-.45 1-1v-9c0-.55-.45-1-1-1H2v11zm19.83-7.12c.11-.25.17-.52.17-.8V11c0-1.1-.9-2-2-2h-5.5l.92-4.65c.05-.22.02-.46-.08-.66-.23-.45-.52-.86-.88-1.22L14 2 7.59 8.41C7.21 8.79 7 9.3 7 9.83v7.84C7 18.95 8.05 20 9.34 20h8.11c.7 0 1.36-.37 1.72-.97l2.66-6.15z"})}),Bd=Ld("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 0 24 24",width:"48",children:Ld("path",{d:"M22 4h-2c-.55 0-1 .45-1 1v9c0 .55.45 1 1 1h2V4zM2.17 11.12c-.11.25-.17.52-.17.8V13c0 1.1.9 2 2 2h5.5l-.92 4.65c-.05.22-.02.46.08.66.23.45.52.86.88 1.22L10 22l6.41-6.41c.38-.38.59-.89.59-1.42V6.34C17 5.05 15.95 4 14.66 4H6.55c-.7 0-1.36.37-1.72.97l-2.66 6.15z"})}),Hd=function(e){var{fill:t="currentColor"}=void 0===e?{}:e;return Ld("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:t,xmlns:"http://www.w3.org/2000/svg","aria-labelledby":"close-survey-title-adam",children:[Ld("title",{id:"close-survey-title",className:"adam-testing",children:"Close survey"}),Ld("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M0.164752 0.164752C0.384422 -0.0549175 0.740578 -0.0549175 0.960248 0.164752L6 5.20451L11.0398 0.164752C11.2594 -0.0549175 11.6156 -0.0549175 11.8352 0.164752C12.0549 0.384422 12.0549 0.740578 11.8352 0.960248L6.79549 6L11.8352 11.0398C12.0549 11.2594 12.0549 11.6156 11.8352 11.8352C11.6156 12.0549 11.2594 12.0549 11.0398 11.8352L6 6.79549L0.960248 11.8352C0.740578 12.0549 0.384422 12.0549 0.164752 11.8352C-0.0549175 11.6156 -0.0549175 11.2594 0.164752 11.0398L5.20451 6L0.164752 0.960248C-0.0549175 0.740578 -0.0549175 0.384422 0.164752 0.164752Z",fill:t})]})},qd=Ld("svg",{width:"77",height:"14",viewBox:"0 0 77 14",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[Ld("g",{"clip-path":"url(#clip0_2415_6911)",children:[Ld("mask",{id:"mask0_2415_6911",style:{maskType:"luminance"},maskUnits:"userSpaceOnUse",x:"0",y:"0",width:"77",height:"14",children:Ld("path",{d:"M0.5 0H76.5V14H0.5V0Z",fill:"white"})}),Ld("g",{mask:"url(#mask0_2415_6911)",children:[Ld("path",{d:"M5.77226 8.02931C5.59388 8.37329 5.08474 8.37329 4.90634 8.02931L4.4797 7.20672C4.41155 7.07535 4.41155 6.9207 4.4797 6.78933L4.90634 5.96669C5.08474 5.62276 5.59388 5.62276 5.77226 5.96669L6.19893 6.78933C6.26709 6.9207 6.26709 7.07535 6.19893 7.20672L5.77226 8.02931ZM5.77226 12.6946C5.59388 13.0386 5.08474 13.0386 4.90634 12.6946L4.4797 11.872C4.41155 11.7406 4.41155 11.586 4.4797 11.4546L4.90634 10.632C5.08474 10.288 5.59388 10.288 5.77226 10.632L6.19893 11.4546C6.26709 11.586 6.26709 11.7406 6.19893 11.872L5.77226 12.6946Z",fill:"#1D4AFF"}),Ld("path",{d:"M0.5 10.9238C0.5 10.508 1.02142 10.2998 1.32637 10.5938L3.54508 12.7327C3.85003 13.0267 3.63405 13.5294 3.20279 13.5294H0.984076C0.716728 13.5294 0.5 13.3205 0.5 13.0627V10.9238ZM0.5 8.67083C0.5 8.79459 0.551001 8.91331 0.641783 9.00081L5.19753 13.3927C5.28831 13.4802 5.41144 13.5294 5.53982 13.5294H8.0421C8.47337 13.5294 8.68936 13.0267 8.3844 12.7327L1.32637 5.92856C1.02142 5.63456 0.5 5.84278 0.5 6.25854V8.67083ZM0.5 4.00556C0.5 4.12932 0.551001 4.24802 0.641783 4.33554L10.0368 13.3927C10.1276 13.4802 10.2508 13.5294 10.3791 13.5294H12.8814C13.3127 13.5294 13.5287 13.0267 13.2237 12.7327L1.32637 1.26329C1.02142 0.969312 0.5 1.17752 0.5 1.59327V4.00556ZM5.33931 4.00556C5.33931 4.12932 5.39033 4.24802 5.4811 4.33554L14.1916 12.7327C14.4965 13.0267 15.0179 12.8185 15.0179 12.4028V9.99047C15.0179 9.86671 14.9669 9.74799 14.8762 9.66049L6.16568 1.26329C5.86071 0.969307 5.33931 1.17752 5.33931 1.59327V4.00556ZM11.005 1.26329C10.7 0.969307 10.1786 1.17752 10.1786 1.59327V4.00556C10.1786 4.12932 10.2296 4.24802 10.3204 4.33554L14.1916 8.06748C14.4965 8.36148 15.0179 8.15325 15.0179 7.7375V5.3252C15.0179 5.20144 14.9669 5.08272 14.8762 4.99522L11.005 1.26329Z",fill:"#F9BD2B"}),Ld("path",{d:"M21.0852 10.981L16.5288 6.58843C16.2238 6.29443 15.7024 6.50266 15.7024 6.91841V13.0627C15.7024 13.3205 15.9191 13.5294 16.1865 13.5294H23.2446C23.5119 13.5294 23.7287 13.3205 23.7287 13.0627V12.5032C23.7287 12.2455 23.511 12.0396 23.2459 12.0063C22.4323 11.9042 21.6713 11.546 21.0852 10.981ZM18.0252 12.0365C17.5978 12.0365 17.251 11.7021 17.251 11.2901C17.251 10.878 17.5978 10.5436 18.0252 10.5436C18.4527 10.5436 18.7996 10.878 18.7996 11.2901C18.7996 11.7021 18.4527 12.0365 18.0252 12.0365Z",fill:"currentColor"}),Ld("path",{d:"M0.5 13.0627C0.5 13.3205 0.716728 13.5294 0.984076 13.5294H3.20279C3.63405 13.5294 3.85003 13.0267 3.54508 12.7327L1.32637 10.5938C1.02142 10.2998 0.5 10.508 0.5 10.9238V13.0627ZM5.33931 5.13191L1.32637 1.26329C1.02142 0.969306 0.5 1.17752 0.5 1.59327V4.00556C0.5 4.12932 0.551001 4.24802 0.641783 4.33554L5.33931 8.86412V5.13191ZM1.32637 5.92855C1.02142 5.63455 0.5 5.84278 0.5 6.25853V8.67083C0.5 8.79459 0.551001 8.91331 0.641783 9.00081L5.33931 13.5294V9.79717L1.32637 5.92855Z",fill:"#1D4AFF"}),Ld("path",{d:"M10.1787 5.3252C10.1787 5.20144 10.1277 5.08272 10.0369 4.99522L6.16572 1.26329C5.8608 0.969306 5.33936 1.17752 5.33936 1.59327V4.00556C5.33936 4.12932 5.39037 4.24802 5.48114 4.33554L10.1787 8.86412V5.3252ZM5.33936 13.5294H8.04214C8.47341 13.5294 8.6894 13.0267 8.38443 12.7327L5.33936 9.79717V13.5294ZM5.33936 5.13191V8.67083C5.33936 8.79459 5.39037 8.91331 5.48114 9.00081L10.1787 13.5294V9.99047C10.1787 9.86671 10.1277 9.74803 10.0369 9.66049L5.33936 5.13191Z",fill:"#F54E00"}),Ld("path",{d:"M29.375 11.6667H31.3636V8.48772H33.0249C34.8499 8.48772 36.0204 7.4443 36.0204 5.83052C36.0204 4.21681 34.8499 3.17334 33.0249 3.17334H29.375V11.6667ZM31.3636 6.84972V4.81136H32.8236C33.5787 4.81136 34.0318 5.19958 34.0318 5.83052C34.0318 6.4615 33.5787 6.84972 32.8236 6.84972H31.3636ZM39.618 11.7637C41.5563 11.7637 42.9659 10.429 42.9659 8.60905C42.9659 6.78905 41.5563 5.45438 39.618 5.45438C37.6546 5.45438 36.2701 6.78905 36.2701 8.60905C36.2701 10.429 37.6546 11.7637 39.618 11.7637ZM38.1077 8.60905C38.1077 7.63838 38.7118 6.97105 39.618 6.97105C40.5116 6.97105 41.1157 7.63838 41.1157 8.60905C41.1157 9.57972 40.5116 10.2471 39.618 10.2471C38.7118 10.2471 38.1077 9.57972 38.1077 8.60905ZM46.1482 11.7637C47.6333 11.7637 48.6402 10.8658 48.6402 9.81025C48.6402 7.33505 45.2294 8.13585 45.2294 7.16518C45.2294 6.8983 45.5189 6.72843 45.9342 6.72843C46.3622 6.72843 46.8782 6.98318 47.0418 7.54132L48.527 6.94678C48.2375 6.06105 47.1677 5.45438 45.8713 5.45438C44.4743 5.45438 43.6058 6.25518 43.6058 7.21372C43.6058 9.53118 46.9663 8.88812 46.9663 9.84665C46.9663 10.1864 46.6391 10.417 46.1482 10.417C45.4434 10.417 44.9525 9.94376 44.8015 9.3735L43.3164 9.93158C43.6436 10.8537 44.6001 11.7637 46.1482 11.7637ZM53.4241 11.606L53.2982 10.0651C53.0843 10.1743 52.8074 10.2106 52.5808 10.2106C52.1278 10.2106 51.8257 9.89523 51.8257 9.34918V7.03172H53.3612V5.55145H51.8257V3.78001H49.9755V5.55145H48.9687V7.03172H49.9755V9.57972C49.9755 11.06 51.0202 11.7637 52.3921 11.7637C52.7696 11.7637 53.122 11.7031 53.4241 11.606ZM59.8749 3.17334V6.47358H56.376V3.17334H54.3874V11.6667H56.376V8.11158H59.8749V11.6667H61.8761V3.17334H59.8749ZM66.2899 11.7637C68.2281 11.7637 69.6378 10.429 69.6378 8.60905C69.6378 6.78905 68.2281 5.45438 66.2899 5.45438C64.3265 5.45438 62.942 6.78905 62.942 8.60905C62.942 10.429 64.3265 11.7637 66.2899 11.7637ZM64.7796 8.60905C64.7796 7.63838 65.3837 6.97105 66.2899 6.97105C67.1835 6.97105 67.7876 7.63838 67.7876 8.60905C67.7876 9.57972 67.1835 10.2471 66.2899 10.2471C65.3837 10.2471 64.7796 9.57972 64.7796 8.60905ZM73.2088 11.4725C73.901 11.4725 74.5177 11.242 74.845 10.8416V11.424C74.845 12.1034 74.2786 12.5767 73.4102 12.5767C72.7935 12.5767 72.2523 12.2854 72.1642 11.788L70.4776 12.0428C70.7042 13.1955 71.925 13.972 73.4102 13.972C75.361 13.972 76.6574 12.8679 76.6574 11.2298V5.55145H74.8324V6.07318C74.4926 5.69705 73.9136 5.45438 73.171 5.45438C71.409 5.45438 70.3014 6.61918 70.3014 8.46345C70.3014 10.3077 71.409 11.4725 73.2088 11.4725ZM72.1012 8.46345C72.1012 7.55345 72.655 6.97105 73.5109 6.97105C74.3793 6.97105 74.9331 7.55345 74.9331 8.46345C74.9331 9.37345 74.3793 9.95585 73.5109 9.95585C72.655 9.95585 72.1012 9.37345 72.1012 8.46345Z",fill:"currentColor"})]})]}),Ld("defs",{children:Ld("clipPath",{id:"clip0_2415_6911",children:Ld("rect",{width:"76",height:"14",fill:"white",transform:"translate(0.5)"})})})]});function zd(e){var{urlParams:t}=e,r=t?Object.entries(t).map((e=>{var[t,r]=e;return encodeURIComponent(t)+"="+encodeURIComponent(r)})).join("&"):"";return Ld("a",{href:"https://posthog.com/surveys"+(r?"?"+r:""),target:"_blank",rel:"noopener",className:"footer-branding",children:["Survey by ",qd]})}function Vd(e){var{text:t,submitDisabled:r,appearance:i,onSubmit:n,link:s,onPreviewSubmit:o,skipSubmitButton:a}=e,{isPreviewMode:l}=iu(yd);return Ld("div",{className:"bottom-section",children:[!a&&Ld("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&&Ld(zd,{urlParams:{utm_source:"survey-footer"}})]})}function $d(e){var{question:t,forceDisableHtml:r,htmlFor:i}=e;return Ld("div",{class:"question-header",children:[Ld(t.type===fu.Open?"label":"h3",{className:"survey-question",htmlFor:i,children:t.question}),t.description&&wd({component:ml("p",{className:"survey-question-description"}),children:t.description,renderAsHtml:!r&&"text"!==t.descriptionContentType})]})}function Ud(e){var{onClick:t}=e,{isPreviewMode:r}=iu(yd);return Ld("button",{className:"form-cancel",onClick:t,disabled:r,"aria-label":"Close survey",type:"button",children:Hd({fill:"black"})})}Ld("svg",{width:"16",height:"12",viewBox:"0 0 16 12",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:Ld("path",{d:"M5.30769 10.6923L4.77736 11.2226C4.91801 11.3633 5.10878 11.4423 5.30769 11.4423C5.5066 11.4423 5.69737 11.3633 5.83802 11.2226L5.30769 10.6923ZM15.5303 1.53033C15.8232 1.23744 15.8232 0.762563 15.5303 0.46967C15.2374 0.176777 14.7626 0.176777 14.4697 0.46967L15.5303 1.53033ZM1.53033 5.85429C1.23744 5.56139 0.762563 5.56139 0.46967 5.85429C0.176777 6.14718 0.176777 6.62205 0.46967 6.91495L1.53033 5.85429ZM5.83802 11.2226L15.5303 1.53033L14.4697 0.46967L4.77736 10.162L5.83802 11.2226ZM0.46967 6.91495L4.77736 11.2226L5.83802 10.162L1.53033 5.85429L0.46967 6.91495Z",fill:"currentColor"})});var Wd=Zn;function jd(e){var{header:t,description:r,contentType:i,forceDisableHtml:n,appearance:s,onClose:o}=e,{isPopup:a}=iu(yd);return eu((()=>{var e=e=>{"Enter"!==e.key&&"Escape"!==e.key||(e.preventDefault(),o())};return bs(Wd,"keydown",e),()=>{Wd.removeEventListener("keydown",e)}}),[o]),Ld("div",{className:"thank-you-message",role:"status",tabIndex:0,"aria-atomic":"true",children:[a&&!0!==s.hideCancelButton&&Ld(Ud,{onClick:()=>o()}),Ld("h3",{className:"thank-you-message-header",children:t}),r&&wd({component:ml("p",{className:"thank-you-message-body"}),children:r,renderAsHtml:!n&&"text"!==i}),a&&Ld(Vd,{text:s.thankYouMessageCloseButtonText||"Close",submitDisabled:!1,appearance:s,onSubmit:()=>o()})]})}var Gd=e=>Ur(e)&&e.every((e=>Yr(e)));function Zd(e){var{question:t,forceDisableHtml:r,appearance:i,onSubmit:n,onPreviewSubmit:s,displayQuestionIndex:o,initialValue:a}=e,{isPreviewMode:l}=bd(),u=tu(null),[c,d]=Ql((()=>Yr(a)?a:""));eu((()=>{setTimeout((()=>{var e;l||null==(e=u.current)||e.focus()}),100)}),[l]);var h="surveyQuestion"+o,p=ru((()=>function(e,t,r){var i,n,s=e.trim();if(!r&&""===s)return"This field is required";if(""===s)return!1;if(t&&t.length>0)for(var o of t)switch(o.type){case Or.MinLength:if(void 0!==o.value&&o.value>s.length)return null!==(i=o.errorMessage)&&void 0!==i?i:"Please enter at least "+o.value+" characters";break;case Or.MaxLength:if(void 0!==o.value&&s.length>o.value)return null!==(n=o.errorMessage)&&void 0!==n?n:"Please enter no more than "+o.value+" characters"}return!1}(c,t.validation,t.optional)),[c,t.validation,t.optional]),g=_n(t.validation,Or.MinLength),_=_n(t.validation,Or.MaxLength),v=ru((()=>function(e,t){var r=1===e?void 0:e;return r&&t?"Enter "+r+"-"+t+" characters":r?"Enter at least "+r+" "+(1===r?"character":"characters"):t?"Maximum "+t+" "+(1===t?"character":"characters"):void 0}(g,_)),[g,_]);return Ld(bl,{children:[Ld("div",{className:"question-container",children:[Ld($d,{question:t,forceDisableHtml:r,htmlFor:h}),Ld("textarea",{ref:u,id:h,rows:4,placeholder:null==i?void 0:i.placeholder,minLength:g,maxLength:_,onInput(e){d(e.currentTarget.value),e.stopPropagation()},onKeyDown(e){e.stopPropagation()},value:c}),v&&Ld("div",{className:"validation-hint",children:v})]}),Ld(Vd,{text:t.buttonText||"Submit",submitDisabled:!!p,appearance:i,onSubmit(){p||n(c.trim())},onPreviewSubmit(){p||s(c.trim())}})]})}function Yd(e){var{question:t,forceDisableHtml:r,appearance:i,onSubmit:n,onPreviewSubmit:s}=e;return Ld(bl,{children:[Ld("div",{className:"question-container",children:Ld($d,{question:t,forceDisableHtml:r})}),Ld(Vd,{text:t.buttonText||"Submit",submitDisabled:!1,link:t.link,appearance:i,onSubmit:()=>n("link clicked"),onPreviewSubmit:()=>s("link clicked")})]})}function Xd(e){var t,{question:r,forceDisableHtml:i,displayQuestionIndex:n,appearance:s,onSubmit:o,onPreviewSubmit:a,initialValue:l}=e,u=r.scale,c=10===r.scale?0:1,[d,h]=Ql((()=>Qr(l)?l:Ur(l)&&l.length>0&&Qr(parseInt(l[0]))?parseInt(l[0]):Yr(l)&&Qr(parseInt(l))?parseInt(l):null)),p="emoji"===r.display&&2===r.scale,{isPreviewMode:g}=bd(),_=e=>g?a(e):o(e);return Ld(bl,{children:[Ld("div",{className:"question-container",children:[Ld($d,{question:r,forceDisableHtml:i}),Ld("div",{className:"rating-section",children:[Ld("div",{className:"rating-options",children:["emoji"===r.display&&Ld("div",{className:"rating-options-emoji"+(p?" rating-options-emoji-2":""),children:null==(t=rh[r.scale])?void 0:t.map(((e,t)=>Ld("button",{"aria-label":"Rate "+(t+1),className:"ratings-emoji question-"+n+"-rating-"+t+" "+(t+1===d?"rating-active":""),value:t+1,type:"button",onClick(){var e=t+1;h(e),r.skipSubmitButton&&_(e)},children:e},t)))}),"number"===r.display&&Ld("div",{className:"rating-options-number",style:{gridTemplateColumns:"repeat("+(u-c+1)+", minmax(0, 1fr))"},children:ih(r.scale).map(((e,t)=>Ld(Kd,{displayQuestionIndex:n,active:d===e,appearance:s,num:e,setActiveNumber(e){h(e),r.skipSubmitButton&&_(e)}},t)))})]}),!p&&Ld("div",{className:"rating-text",children:[Ld("div",{children:r.lowerBoundLabel}),Ld("div",{children:r.upperBoundLabel})]})]})]}),Ld(Vd,{text:r.buttonText||(null==s?void 0:s.submitButtonText)||"Submit",submitDisabled:Kr(d)&&!r.optional,appearance:s,onSubmit:()=>o(d),onPreviewSubmit:()=>a(d),skipSubmitButton:r.skipSubmitButton})]})}function Kd(e){var{num:t,active:r,displayQuestionIndex:i,setActiveNumber:n}=e;return Ld("button",{"aria-label":"Rate "+t,className:"ratings-number question-"+i+"-rating-"+t+" "+(r?"rating-active":""),type:"button",onClick(){n(t)},children:t})}function Jd(e){var{question:t,forceDisableHtml:i,displayQuestionIndex:n,appearance:s,onSubmit:o,onPreviewSubmit:a,initialValue:l}=e,u=tu(null),c=ru((()=>(e=>{if(!e.shuffleOptions)return e.choices;var t=e.choices,r="";e.hasOpenChoice&&(r=t.pop());var i=vd(t,_d(t));return e.hasOpenChoice&&(e.choices.push(r),i.push(r)),i})(t)),[t]),[d,h]=Ql((()=>((e,t)=>Yr(e)||Gd(e)?e:t===fu.SingleChoice?null:[])(l,t.type))),[p,g]=Ql((()=>((e,t)=>{if(Yr(e)&&!t.includes(e))return{isSelected:!0,inputValue:e};if(Gd(e)){var r=e.find((e=>!t.includes(e)));if(r)return{isSelected:!0,inputValue:r}}return{isSelected:!1,inputValue:""}})(l,c))),{isPreviewMode:_}=bd(),v=t.type===fu.SingleChoice,f=t.type===fu.MultipleChoice,m=t.skipSubmitButton&&v&&!t.hasOpenChoice,y=(e,t)=>{if(t){var i=!p.isSelected;return g((e=>r({},e,{isSelected:i,inputValue:i?e.inputValue:""}))),v&&h(""),void(i&&setTimeout((()=>{var e;return null==(e=u.current)?void 0:e.focus()}),75))}if(v)return h(e),g((e=>r({},e,{isSelected:!1,inputValue:""}))),void(m&&(o(e),_&&a(e)));f&&Ur(d)&&(d.includes(e)?h(d.filter((t=>t!==e))):h([...d,e]))},b=e=>{e.stopPropagation();var t=e.currentTarget.value;g((e=>r({},e,{inputValue:t}))),v&&h(t)},w=e=>{e.stopPropagation(),"Enter"!==e.key||S()||(e.preventDefault(),C()),"Escape"===e.key&&(e.preventDefault(),g((e=>r({},e,{isSelected:!1,inputValue:""}))),v&&h(null))},S=()=>!(t.optional||!Kr(d)&&(!Ur(d)||p.isSelected||0!==d.length)&&(!p.isSelected||""!==p.inputValue.trim())),C=()=>{p.isSelected&&f?Ur(d)&&(_?a([...d,p.inputValue]):o([...d,p.inputValue])):_?a(d):o(d)};return Ld(bl,{children:[Ld("div",{className:"question-container",children:[Ld($d,{question:t,forceDisableHtml:i}),Ld("fieldset",{className:"multiple-choice-options limit-height",children:[Ld("legend",{className:"sr-only",children: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:v?d===e:Ur(d)&&d.includes(e);return Ld("label",{className:i?"choice-option-open":"",children:[Ld("div",{className:"response-choice",children:[Ld("input",{type:v?"radio":"checkbox",name:s,checked:a,onChange:()=>y(e,i),id:s,"aria-controls":o}),Ld("span",{children:i?e+":":e})]}),i&&Ld("input",{type:"text",ref:u,id:o,name:"question"+n+"Open",value:p.inputValue,onKeyDown:w,onInput:b,onClick(t){p.isSelected||y(e,!0),t.stopPropagation()},"aria-label":e+" - please specify"})]},r)}))]})]}),Ld(Vd,{text:t.buttonText||"Submit",submitDisabled:S(),appearance:s,onSubmit:C,onPreviewSubmit:C,skipSubmitButton:m})]})}var Qd=[1,2,3,4,5],eh=[1,2,3,4,5,6,7],th=[0,1,2,3,4,5,6,7,8,9,10],rh={2:[Dd,Bd],3:[Fd,Ad,Pd],5:[Nd,Fd,Ad,Pd,Od]};function ih(e){switch(e){case 5:default:return Qd;case 7:return eh;case 10:return th}}var nh=cs("[Surveys]");function sh(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?mu.End:s;if(n.branching.type===mu.End)return mu.End;if(n.branching.type===mu.SpecificQuestion){if(Number.isInteger(n.branching.index))return n.branching.index}else if(n.branching.type===mu.ResponseBased){if(n.type===fu.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===mu.End?mu.End:s}}else if(n.type===fu.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(2===t){if(1>e||e>2)throw new Error("The response must be in range 1-2");return 1===e?"positive":"negative"}if(3===t){if(1>e||e>3)throw new Error("The response must be in range 1-3");return 1===e?"negative":2===e?"neutral":"positive"}if(5===t){if(1>e||e>5)throw new Error("The response must be in range 1-5");return e>2?3===e?"neutral":"positive":"negative"}if(7===t){if(1>e||e>7)throw new Error("The response must be in range 1-7");return e>3?4===e?"neutral":"positive":"negative"}if(10===t){if(0>e||e>10)throw new Error("The response must be in range 0-10");return e>6?e>8?"promoters":"passives":"detractors"}throw new Error("The scale must be one of: 2, 3, 5, 7, 10")}(r,n.scale);if(null!=(u=n.branching)&&null!=(u=u.responseValues)&&u.hasOwnProperty(c)){var d=n.branching.responseValues[c];return Number.isInteger(d)?d:d===mu.End?mu.End:s}}return s}return nh.warn("Falling back to next question index due to unexpected branching type"),s}var oh=Zn,ah=Kn,lh="ph:show_survey_widget",uh="PHWidgetSurveyClickListener";function ch(e,t){try{var r=e.getBoundingClientRect(),i=oh.innerHeight,n=oh.innerWidth,s=r.left+r.width/2-t/2;s+t>n-20&&(s=n-t-20),20>s&&(s=20);var o=i-r.bottom,a=250>o&&r.top>o;return{position:"fixed",top:a?"auto":r.bottom+12+"px",left:s+"px",right:"auto",bottom:a?i-r.top+12+"px":"auto",zIndex:nd.zIndex}}catch(e){return Cu.warn("Failed to calculate trigger position:",e),null}}class dh{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(go);if(e)for(var t of e)xd(t)&&gd(t,this._posthog)},this.handlePopoverSurvey=(e,t)=>{var i,n,s,o,a=null!=t&&t.position||null!=t&&t.selector?r({},e,{appearance:r({},e.appearance,t.position&&{position:t.position},t.selector&&{widgetSelector:t.selector})}):e;this._clearSurveyTimeout(a.id);var{properties:l,initialResponses:u}=null!=t?t:{},c=!(!u||0>=Object.keys(u).length)&&this._handleInitialResponses(a,u,l);if(!c||null!=(i=a.appearance)&&i.displayThankYouMessage){this._addSurveyToFocus(a);var d={};if((null==(n=a.appearance)?void 0:n.position)===gu.NextToTrigger&&null!=(s=a.appearance)&&s.widgetSelector){var h,p=ah.querySelector(a.appearance.widgetSelector);p&&(d=ch(p,parseInt((null==(h=a.appearance)?void 0:h.maxWidth)||nd.maxWidth))||{})}var g=(null==(o=a.appearance)?void 0:o.surveyPopupDelaySeconds)||0,{shadow:_}=ld(a,this._posthog),v={posthog:this._posthog,survey:a,removeSurveyFromFocus:this._removeSurveyFromFocus,properties:l,style:d,isSurveyCompleted:c,skipShownEvent:null==t?void 0:t.skipShownEvent};if(0>=g)return Bl(Ld(_h,r({},v)),_);var f=setTimeout((()=>{if(this._surveyTimeouts.delete(a.id),!Sd(a))return this._removeSurveyFromFocus(a);Bl(Ld(_h,r({},v,{survey:r({},a,{appearance:r({},a.appearance,{surveyPopupDelaySeconds:0})})})),_)}),1e3*g);this._surveyTimeouts.set(a.id,f)}},this._handleWidget=e=>{var{shadow:t,isNewlyCreated:r}=ld(e,this._posthog);r&&Bl(Ld(fh,{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(uh),this._widgetSelectorListeners.delete(e.id),Cu.info("Removed click listener for survey "+e.id))},this._manageWidgetSelectorListener=(e,t)=>{var r=ah.querySelector(t),i=this._widgetSelectorListeners.get(e.id);if(r){if(this._handleWidget(e),i){if(r===i.element)return;Cu.info("Selector element changed for survey "+e.id+". Re-attaching listener."),this._removeWidgetSelectorListener(e)}if(!r.hasAttribute(uh)){var n=t=>{var r,i;t.stopPropagation();var n=(null==(r=e.appearance)?void 0:r.position)===gu.NextToTrigger?ch(t.currentTarget,parseInt((null==(i=e.appearance)?void 0:i.maxWidth)||nd.maxWidth)):{};oh.dispatchEvent(new CustomEvent(lh,{detail:{surveyId:e.id,position:n}}))};bs(r,"click",n),r.setAttribute(uh,"true"),this._widgetSelectorListeners.set(e.id,{element:r,listener:n,survey:e}),Cu.info("Attached click listener for feedback button survey "+e.id)}}else i&&this._removeWidgetSelectorListener(e)},this.renderPopover=e=>{var{shadow:t}=ld(e,this._posthog);Bl(Ld(_h,{posthog:this._posthog,survey:e,removeSurveyFromFocus:this._removeSurveyFromFocus}),t)},this.renderSurvey=(e,t,r)=>{var i,n=!1;null!=(i=this._posthog.config)&&null!=(i=i.surveys)&&i.prefillFromUrl&&(n=this._handleUrlPrefill(e)),Bl(Ld(_h,{posthog:this._posthog,survey:e,removeSurveyFromFocus:this._removeSurveyFromFocus,isPopup:!1,properties:r,isSurveyCompleted:n}),t)},this.getActiveMatchingSurveys=function(e,r){var i;void 0===r&&(r=!1),null==(i=t._posthog)||null==(i=i.surveys)||i.getSurveys((r=>{var i=r.filter((e=>t.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===vu.Popover||e.type===vu.Widget)),i=t._sortSurveysByAppearanceDelay(r),n=new Set;i.forEach((e=>{if(e.type===vu.Widget){var r,i,s,o;if((null==(r=e.appearance)?void 0:r.widgetType)===pu.Tab)return void t._handleWidget(e);(null==(i=e.appearance)?void 0:i.widgetType)===pu.Selector&&null!=(s=e.appearance)&&s.widgetSelector&&(n.add(e.id),t._manageWidgetSelectorListener(e,null==(o=e.appearance)?void 0:o.widgetSelector))}Kr(t._surveyInFocus)&&e.type===vu.Popover&&t.handlePopoverSurvey(e)})),t._widgetSelectorListeners.forEach((e=>{var{survey:r}=e;n.has(r.id)||t._removeWidgetSelectorListener(r)}))}),e)},this._addSurveyToFocus=e=>{Kr(this._surveyInFocus)||Cu.error("Survey "+this._surveyInFocus+" already in focus. Cannot add survey "+e.id+"."),this._surveyInFocus=e.id},this._removeSurveyFromFocus=e=>{this._surveyInFocus!==e.id&&Cu.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)&&(Cu.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=xd(e),s=xd(t);if(n&&!s)return-1;if(!n&&s)return 1;var o=e.schedule===yu,a=t.schedule===yu;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))return!1;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&&!Zr(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}}(oh.location.search);if(0===Object.keys(t).length)return!1;Cu.info("[Survey Prefill] Detected URL prefill parameters");var r=this._processPrefillData(e,t);if(!r)return!1;var{responses:i,submissionId:n,isSurveyCompleted:s,skippedResponses:o}=r;return(Object.keys(o).length>0&&e.enable_partial_responses||s)&&cd({responses:s?i:o,survey:e,surveySubmissionId:n,posthog:this._posthog,isSurveyCompleted:s}),this._prefillHandledSurveys.add(e.id),s}_handleInitialResponses(e,t,r){var i={};for(var[n,s]of Object.entries(t))i[parseInt(n)]=Ur(s)?s.map(String):[String(s)];Cu.info("[Survey] Processing initial responses");var o=this._processPrefillData(e,i);if(!o)return!1;var{responses:a,submissionId:l,isSurveyCompleted:u}=o;return cd({responses:a,survey:e,surveySubmissionId:l,posthog:this._posthog,isSurveyCompleted:u,properties:r}),u}_processPrefillData(e,t){try{var r=function(e,t){var r={};return e.questions.forEach(((e,i)=>{if(t[i]&&e.id){var n=t[i],s=rd(e.id);try{switch(e.type){case fu.SingleChoice:if(!e.choices||0===e.choices.length)return void us.warn("[Survey Prefill] Question "+i+" has no choices");var o=parseInt(n[0],10);if(isNaN(o)||0>o||o>=e.choices.length)return void us.warn("[Survey Prefill] Invalid choice index for q"+i+": "+n[0]);r[s]=e.choices[o];break;case fu.MultipleChoice:if(!e.choices||0===e.choices.length)return void us.warn("[Survey Prefill] Question "+i+" has no choices");var a=n.map((e=>parseInt(e,10))).filter((t=>!isNaN(t)&&t>=0&&e.choices.length>t));if(0===a.length)return void us.warn("[Survey Prefill] No valid choices for q"+i);var l=[...new Set(a.map((t=>e.choices[t])))];a.length>l.length&&us.warn("[Survey Prefill] Removed duplicate choices for q"+i),r[s]=l;break;case fu.Rating:var u=parseInt(n[0],10),c=e.scale||10;if(isNaN(u)||0>u||u>c)return void us.warn("[Survey Prefill] Invalid rating for q"+i+": "+n[0]+" (scale: 0-"+c+")");r[s]=u;break;default:us.info("[Survey Prefill] Question type "+e.type+" does not support prefill")}}catch(e){us.error("[Survey Prefill] Error converting q"+i+":",e)}}})),r}(e,t);if(0===Object.keys(r).length)return Cu.warn("[Survey Prefill] No valid responses after conversion"),null;var i=qu(),n=Object.keys(t).map((e=>parseInt(e,10))),{startQuestionIndex:s,skippedResponses:o}=function(e,t,r){for(var i=0,n={},s=e.questions.length+1;e.questions.length>i&&s>0&&t.includes(i);){var o=e.questions[i];if(!o||!("skipSubmitButton"in o)||!o.skipSubmitButton)break;if(o.id){var a=rd(o.id);Zr(r[a])||(n[a]=r[a])}var l=sh(e,i,o.id?r[rd(o.id)]:null);if(l===mu.End)return{startQuestionIndex:e.questions.length,skippedResponses:n};i=l}return{startQuestionIndex:i,skippedResponses:n}}(e,n,r),a=s>=e.questions.length;return Id(e,{surveySubmissionId:i,responses:r,lastQuestionIndex:s}),Cu.info("[Survey Prefill] Stored prefilled responses in localStorage"),{responses:r,submissionId:i,startQuestionIndex:s,isSurveyCompleted:a,skippedResponses:o}}catch(e){return Cu.error("[Survey Prefill] Error handling prefill:",e),null}}_isSurveyFeatureFlagEnabled(e,t){var r;if(void 0===t&&(t=void 0),!e)return!0;var i,n=!(null==(r=this._posthog.featureFlags)||!r.isFeatureEnabled(e,{send_event:!e.startsWith("survey-targeting-")})),s=!0;return t&&(s=(null==(i=this._posthog.featureFlags)?void 0:i.getFeatureFlag(e,{send_event:!1}))===t||"any"===t),n&&s}_isSurveyConditionMatched(e){return!e.conditions||Sd(e)&&function(e){var t,r;return function(e,t){var r,i,n;if(!e||0===e.length)return!0;if(!is)return!1;var s=cn(is,{userAgentDataPlatform:null==Xn||null==(r=Xn.userAgentData)?void 0:r.platform,maxTouchPoints:null==Xn?void 0:Xn.maxTouchPoints,screenWidth:null==Zn||null==(i=Zn.screen)?void 0:i.width,screenHeight:null==Zn||null==(n=Zn.screen)?void 0:n.height,devicePixelRatio:null==Zn?void 0:Zn.devicePixelRatio});return Bc[null!=t?t:"icontains"](e,[s])}(null==(t=e.conditions)?void 0:t.deviceTypes,null==(r=e.conditions)?void 0:r.deviceTypesMatchType)}(e)&&function(e){var t;return null==(t=e.conditions)||!t.selector||!(null==td||!td.querySelector(e.conditions.selector))}(e)}_internalFlagCheckSatisfied(e){return md(e)||this._isSurveyFeatureFlagEnabled(e.internal_targeting_flag_key)||xd(e)}checkSurveyEligibility(e){var t,r,i={eligible:!0,reason:void 0};if(!Iu(e))return i.eligible=!1,i.reason="Survey is not running. It was completed on "+e.end_date,i;if(!Au.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)?function(e,t){if(!e||!t)return!0;var r="string"==typeof t?new Date(t):t,i=new Date,n=Math.abs(i.getTime()-r.getTime());return Math.ceil(n/864e5)>e}(null==(r=e.conditions)?void 0:r.seenSurveyWaitPeriodInDays,Gc._get("lastSeenSurveyDate"))?(e=>!!Gc._get(Lu(e))&&!md(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(!ku(e)&&!xu(e))return!0;var r=null==(t=this._posthog.surveys)||null==(t=t._surveyEventReceiver)?void 0:t.getSurveys();return!(null==r||!r.includes(e.id))}_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=ah.querySelector(Td(e,!0));null!=t&&t.shadowRoot&&Bl(null,t.shadowRoot),null==t||t.remove()}catch(t){Cu.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 hh(e,t){if(ah&&oh){var r,i=new dh(e);if(e.config.disable_surveys_automatic_display)return Cu.info("Surveys automatic display is disabled. Skipping call surveys and evaluate display logic."),i;if(!1===t)return Cu.info("There are no surveys to load or Surveys is disabled in the project settings."),i;i.callSurveysAndEvaluateDisplayLogic(!0);var n=()=>{Zr(r)&&(r=setInterval((()=>{i.callSurveysAndEvaluateDisplayLogic(!1)}),1e3))};return n(),bs(ah,"visibilitychange",(()=>{ah.hidden?Zr(r)||(clearInterval(r),r=void 0):(i.callSurveysAndEvaluateDisplayLogic(!1),n())})),i}}function ph(e){var{survey:t,removeSurveyFromFocus:r=(()=>{}),setSurveyVisible:i,isPreviewMode:n=!1}=e;eu((()=>{var e;if(!n&&null!=(e=t.conditions)&&e.url){var s=()=>{var e,n=t.type===vu.Widget,s=Sd(t),o=(null==(e=t.appearance)?void 0:e.widgetType)===pu.Tab&&n;if(!s)return Cu.info("Hiding survey "+t.id+" because URL does not match"),i(!1),r(t);o&&(Cu.info("Showing survey "+t.id+" because it is a feedback button tab and URL matches"),i(!0))};bs(oh,"popstate",s),bs(oh,"hashchange",s);var o=oh.history.pushState,a=oh.history.replaceState;return oh.history.pushState=function(){for(var e=arguments.length,t=new Array(e),r=0;e>r;r++)t[r]=arguments[r];o.apply(this,t),s()},oh.history.replaceState=function(){for(var e=arguments.length,t=new Array(e),r=0;e>r;r++)t[r]=arguments[r];a.apply(this,t),s()},()=>{oh.removeEventListener("popstate",s),oh.removeEventListener("hashchange",s),oh.history.pushState=o,oh.history.replaceState=a}}}),[n,t,r,i])}function gh(e){switch(void 0===e&&(e=_u.Right),e){case _u.Top:return{top:"0",left:"50%",transform:"translateX(-50%)"};case _u.Left:return{top:"50%",left:"0",transform:"rotate(90deg) translateY(-100%)",transformOrigin:"left top"};case _u.Bottom:return{bottom:"0",left:"50%",transform:"translateX(-50%)"};default:return{top:"50%",right:"0",transform:"rotate(-90deg) translateY(-100%)",transformOrigin:"right top"}}}function _h(e){var t,i,n,s,o,a,{survey:l,forceDisableHtml:u,posthog:c,style:d={},previewPageIndex:h,removeSurveyFromFocus:p=(()=>{}),isPopup:g=!0,onPreviewSubmit:_=(()=>{}),onPopupSurveyDismissed:v=(()=>{}),onCloseConfirmationMessage:f=(()=>{}),properties:m,isSurveyCompleted:y,skipShownEvent:b}=e,w=tu(null),S=Number.isInteger(h),C=null!=(t=l.appearance)&&t.surveyPopupDelaySeconds?1e3*l.appearance.surveyPopupDelaySeconds:0,{isPopupVisible:I,isSurveySent:k,hidePopupWithViewTransition:x}=function(e,t,r,i,n,s,o,a){var[l,u]=Ql(i||0===r||e.type===vu.ExternalSurvey),[c,d]=Ql(!1),h=()=>{var t=()=>{s&&n(e),u(!1)};ah.startViewTransition?ah.startViewTransition((()=>{var e;null==o||null==(e=o.current)||e.remove()})).finished.then((()=>{setTimeout((()=>{t()}),100)})):t()},p=t=>{t.detail.surveyId===e.id&&h()};return eu((()=>{if(t){if(!i){var n=t=>{var r,i;if(t.detail.surveyId===e.id){if(null==(r=e.appearance)||!r.displayThankYouMessage)return h();d(!0),null!=(i=e.appearance)&&i.autoDisappear&&setTimeout((()=>{h()}),5e3)}},s=()=>{Sd(e)&&(u(!0),oh.dispatchEvent(new Event("PHSurveyShown")),a||t.capture(bu.SHOWN,{[wu.SURVEY_NAME]:e.name,[wu.SURVEY_ID]:e.id,[wu.SURVEY_ITERATION]:e.current_iteration,[wu.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(bs(oh,"PHSurveyClosed",p),bs(oh,"PHSurveySent",n),r>0){var o=setTimeout(s,r);return()=>{clearTimeout(o),oh.removeEventListener("PHSurveyClosed",p),oh.removeEventListener("PHSurveySent",n)}}return s(),()=>{oh.removeEventListener("PHSurveyClosed",p),oh.removeEventListener("PHSurveySent",n)}}}else Cu.error("usePopupVisibility hook called without a PostHog instance.")}),[]),ph({survey:e,removeSurveyFromFocus:n,setSurveyVisible:u,isPreviewMode:i}),{isPopupVisible:l,isSurveySent:c,setIsPopupVisible:u,hidePopupWithViewTransition:h}}(l,c,C,S,p,g,w,b),E=k||h===l.questions.length||!0===y,T=ru((()=>{var e=kd(l);return{isPreviewMode:S,previewPageIndex:h,onPopupSurveyDismissed(){pd(l,c,S),v()},isPopup:g||!1,surveySubmissionId:(null==e?void 0:e.surveySubmissionId)||qu(),onPreviewSubmit:_,posthog:c,properties:m}}),[S,h,g,c,l,v,_,m]);return I?Ld(yd.Provider,{value:T,children:Ld("div",{className:"ph-survey",style:r({},Rd(l.type,null==(i=l.appearance)?void 0:i.position,null==(n=l.appearance)?void 0:n.widgetType),d),ref:w,children:E?Ld(jd,{header:(null==(s=l.appearance)?void 0:s.thankYouMessageHeader)||"Thank you!",description:(null==(o=l.appearance)?void 0:o.thankYouMessageDescription)||"",forceDisableHtml:!!u,contentType:null==(a=l.appearance)?void 0:a.thankYouMessageDescriptionContentType,appearance:l.appearance||nd,onClose(){x(),f()}}):Ld(vh,{survey:l,forceDisableHtml:!!u,posthog:c})})}):null}function vh(e){var t,{survey:i,forceDisableHtml:n,posthog:s}=e,[o,a]=Ql((()=>{var e=kd(i);return null!=e&&e.responses&&Cu.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,properties:g}=iu(yd),[_,v]=Ql((()=>{var e=kd(i);return l||(null==e?void 0:e.lastQuestionIndex)||0})),f=ru((()=>fd(i)),[i]);eu((()=>{p&&!Zr(l)&&v(l)}),[l,p]);var m=f.at(_);return m?Ld("form",{className:"survey-form",name:"surveyForm",children:[c&&!0!==(null==(t=i.appearance)?void 0:t.hideCancelButton)&&Ld(Ud,{onClick(){u()}}),Ld("div",{className:"survey-box","data-question-index":_,children:mh({question:m,forceDisableHtml:n,displayQuestionIndex:_,appearance:i.appearance||nd,onSubmit:e=>(e=>{var{res:t,displayQuestionIndex:n,questionId:l}=e;if(s)if(l){var u=rd(l),c=r({},o,{[u]:t});a(c);var d=sh(i,n,t),p=d===mu.End;p||(v(d),Id(i,{surveySubmissionId:h,responses:c,lastQuestionIndex:d})),(i.enable_partial_responses||p)&&cd({responses:c,survey:i,surveySubmissionId:h,isSurveyCompleted:p,posthog:s,properties:g})}else Cu.error("onNextButtonClick called without a questionId.");else Cu.error("onNextButtonClick called without a PostHog instance.")})({res:e,displayQuestionIndex:_,questionId:m.id}),onPreviewSubmit:d,initialValue:m.id?o[rd(m.id)]:void 0})})]}):null}function fh(e){var t,r,i,n,s,o,a,{survey:l,forceDisableHtml:u,posthog:c,readOnly:d}=e,[h,p]=Ql(!0),[g,_]=Ql(!1),[v,f]=Ql({}),m=()=>{_(!g)};if(eu((()=>{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&&(Cu.info("Received show event for feedback button survey "+l.id),f(r.detail.position||{}),m())};return bs(oh,lh,t),()=>{oh.removeEventListener(lh,t)}}}else Cu.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]),ph({survey:l,setSurveyVisible:p}),!h)return null;var y=()=>{l.schedule!==yu&&p(!1),setTimeout((()=>{_(!1)}),200)};return Ld(bl,{children:["tab"===(null==(n=l.appearance)?void 0:n.widgetType)&&Ld("button",{className:"ph-survey-widget-tab "+((null==(s=l.appearance)?void 0:s.tabPosition)===_u.Top?"widget-tab-top":""),onClick:m,disabled:d,style:gh(null==(o=l.appearance)?void 0:o.tabPosition),children:(null==(a=l.appearance)?void 0:a.widgetLabel)||""}),g&&Ld(_h,{posthog:c,survey:l,forceDisableHtml:u,style:v,onPopupSurveyDismissed:y,onCloseConfirmationMessage:y})]})}var mh=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 fu.Open:return ml(Zd,r({},u,{question:t,key:t.id}));case fu.Link:return ml(Yd,r({},u,{question:t,key:t.id}));case fu.Rating:return ml(Xd,r({},u,{question:t,key:t.id}));case fu.SingleChoice:case fu.MultipleChoice:return ml(Jd,r({},u,{question:t,key:t.id}));default:return Cu.error("Unsupported question type: "+t.type),null}};ns.__PosthogExtensions__=ns.__PosthogExtensions__||{},ns.__PosthogExtensions__.generateSurveys=hh,ns.extendPostHogWithSurveys=hh;class yh{emit(e){}}var bh=new yh,wh=new class{getLogger(e,t,r){return new yh}};class Sh{constructor(e,t,r,i){this._provider=e,this.name=t,this.version=r,this.options=i}emit(e){this._getLogger().emit(e)}_getLogger(){if(this._delegate)return this._delegate;var e=this._provider._getDelegateLogger(this.name,this.version,this.options);return e?(this._delegate=e,this._delegate):bh}}class Ch{getLogger(e,t,r){var i;return null!==(i=this._getDelegateLogger(e,t,r))&&void 0!==i?i:new Sh(this,e,t,r)}_getDelegate(){var e;return null!==(e=this._delegate)&&void 0!==e?e:wh}_setDelegate(e){this._delegate=e}_getDelegateLogger(e,t,r){var i;return null===(i=this._delegate)||void 0===i?void 0:i.getLogger(e,t,r)}}var Ih="object"==typeof globalThis?globalThis:"object"==typeof self?self:"object"==typeof window?window:"object"==typeof global?global:{},kh=Symbol.for("io.opentelemetry.js.api.logs"),xh=Ih;class Eh{constructor(){this._proxyLoggerProvider=new Ch}static getInstance(){return this._instance||(this._instance=new Eh),this._instance}setGlobalLoggerProvider(e){return xh[kh]?this.getLoggerProvider():(xh[kh]=(1,t=e,r=wh,e=>1===e?t:r),this._proxyLoggerProvider._setDelegate(e),e);var t,r}getLoggerProvider(){var e,t;return null!==(t=null===(e=xh[kh])||void 0===e?void 0:e.call(xh,1))&&void 0!==t?t:this._proxyLoggerProvider}getLogger(e,t,r){return this.getLoggerProvider().getLogger(e,t,r)}disable(){delete xh[kh],this._proxyLoggerProvider=new Ch}}var Th=Eh.getInstance();class Rh{constructor(e){this._delegate=void 0,this._delegate=e}export(e,t){this._delegate.export(e,t)}forceFlush(){return this._delegate.forceFlush()}shutdown(){return this._delegate.shutdown()}}class Mh extends Error{constructor(e,t,r){super(e),this.code=void 0,this.name="OTLPExporterError",this.data=void 0,this.data=r,this.code=t}}function Lh(e){if(Number.isFinite(e)&&e>0)return e;throw new Error("Configuration: timeoutMillis is invalid, expected number greater than 0 (actual: '"+e+"')")}class Ph{constructor(e){this._concurrencyLimit=void 0,this._sendingPromises=[],this._concurrencyLimit=e}pushPromise(e){if(this.hasReachedLimit())throw new Error("Concurrency Limit reached");this._sendingPromises.push(e);var t=()=>{var t=this._sendingPromises.indexOf(e);this._sendingPromises.splice(t,1)};e.then(t,t)}hasReachedLimit(){return this._sendingPromises.length>=this._concurrencyLimit}awaitAll(){var e=this;return t((function*(){yield Promise.all(e._sendingPromises)}))()}}function Ah(e){return new Ph(e.concurrencyLimit)}var Fh="object"==typeof globalThis?globalThis:"object"==typeof self?self:"object"==typeof window?window:"object"==typeof global?global:{},Nh="1.9.0",Oh=/^(\d+)\.(\d+)\.(\d+)(-(.+))?$/,Dh=function(e){var t=new Set([e]),r=new Set,i=e.match(Oh);if(!i)return function(){return!1};var n=+i[1],s=+i[2],o=+i[3];if(null!=i[4])return function(t){return t===e};function a(e){return r.add(e),!1}function l(e){return t.add(e),!0}return function(e){if(t.has(e))return!0;if(r.has(e))return!1;var i=e.match(Oh);if(!i)return a(e);var u=+i[2],c=+i[3];return null!=i[4]||n!==+i[1]?a(e):0===n?s!==u||o>c?a(e):l(e):s>u?a(e):l(e)}}(Nh),Bh=Nh.split(".")[0],Hh=Symbol.for("opentelemetry.js.api."+Bh),qh=Fh;function zh(e,t,r,i){var n;void 0===i&&(i=!1);var s=qh[Hh]=null!==(n=qh[Hh])&&void 0!==n?n:{version:Nh};if(!i&&s[e]){var o=new Error("@opentelemetry/api: Attempted duplicate registration of API: "+e);return r.error(o.stack||o.message),!1}return s.version!==Nh?(o=new Error("@opentelemetry/api: Registration of version v"+s.version+" for "+e+" does not match previously registered API v"+Nh),r.error(o.stack||o.message),!1):(s[e]=t,r.debug("@opentelemetry/api: Registered a global for "+e+" v"+Nh+"."),!0)}function Vh(e){var t,r,i=null===(t=qh[Hh])||void 0===t?void 0:t.version;if(i&&Dh(i))return null===(r=qh[Hh])||void 0===r?void 0:r[e]}function $h(e,t){t.debug("@opentelemetry/api: Unregistering a global for "+e+" v"+Nh+".");var r=qh[Hh];r&&delete r[e]}var Uh,Wh=function(){function e(e){this._namespace=e.namespace||"DiagComponentLogger"}return e.prototype.debug=function(){for(var e=[],t=0;arguments.length>t;t++)e[t]=arguments[t];return jh("debug",this._namespace,e)},e.prototype.error=function(){for(var e=[],t=0;arguments.length>t;t++)e[t]=arguments[t];return jh("error",this._namespace,e)},e.prototype.info=function(){for(var e=[],t=0;arguments.length>t;t++)e[t]=arguments[t];return jh("info",this._namespace,e)},e.prototype.warn=function(){for(var e=[],t=0;arguments.length>t;t++)e[t]=arguments[t];return jh("warn",this._namespace,e)},e.prototype.verbose=function(){for(var e=[],t=0;arguments.length>t;t++)e[t]=arguments[t];return jh("verbose",this._namespace,e)},e}();function jh(e,t,r){var i=Vh("diag");if(i)return r.unshift(t),i[e].apply(i,function(e,t,r){if(r||2===arguments.length)for(var i,n=0,s=t.length;s>n;n++)!i&&n in t||(i||(i=[].slice.call(t,0,n)),i[n]=t[n]);return e.concat(i||[].slice.call(t))}([],function(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var i,n,s=r.call(e),o=[];try{for(;(void 0===t||t-- >0)&&!(i=s.next()).done;)o.push(i.value)}catch(e){n={error:e}}finally{try{i&&!i.done&&(r=s.return)&&r.call(s)}finally{if(n)throw n.error}}return o}(r),!1))}!function(e){e[e.NONE=0]="NONE",e[e.ERROR=30]="ERROR",e[e.WARN=50]="WARN",e[e.INFO=60]="INFO",e[e.DEBUG=70]="DEBUG",e[e.VERBOSE=80]="VERBOSE",e[e.ALL=9999]="ALL"}(Uh||(Uh={}));var Gh=function(){function e(){function e(e){return function(){for(var t=[],r=0;arguments.length>r;r++)t[r]=arguments[r];var i=Vh("diag");if(i)return i[e].apply(i,function(e,t,r){if(r||2===arguments.length)for(var i,n=0,s=t.length;s>n;n++)!i&&n in t||(i||(i=[].slice.call(t,0,n)),i[n]=t[n]);return e.concat(i||[].slice.call(t))}([],function(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var i,n,s=r.call(e),o=[];try{for(;(void 0===t||t-- >0)&&!(i=s.next()).done;)o.push(i.value)}catch(e){n={error:e}}finally{try{i&&!i.done&&(r=s.return)&&r.call(s)}finally{if(n)throw n.error}}return o}(t),!1))}}var t=this;t.setLogger=function(e,r){var i,n,s;if(void 0===r&&(r={logLevel:Uh.INFO}),e===t){var o=new Error("Cannot use diag as the logger for itself. Please use a DiagLogger implementation like ConsoleDiagLogger or a custom implementation");return t.error(null!==(i=o.stack)&&void 0!==i?i:o.message),!1}"number"==typeof r&&(r={logLevel:r});var a=Vh("diag"),l=function(e,t){function r(r,i){var n=t[r];return"function"!=typeof n||i>e?function(){}:n.bind(t)}return Uh.NONE>e?e=Uh.NONE:e>Uh.ALL&&(e=Uh.ALL),t=t||{},{error:r("error",Uh.ERROR),warn:r("warn",Uh.WARN),info:r("info",Uh.INFO),debug:r("debug",Uh.DEBUG),verbose:r("verbose",Uh.VERBOSE)}}(null!==(n=r.logLevel)&&void 0!==n?n:Uh.INFO,e);if(a&&!r.suppressOverrideMessage){var u=null!==(s=(new Error).stack)&&void 0!==s?s:"<failed to generate stacktrace>";a.warn("Current logger will be overwritten from "+u),l.warn("Current logger will overwrite one already registered from "+u)}return zh("diag",l,t,!0)},t.disable=function(){$h("diag",t)},t.createComponentLogger=function(e){return new Wh(e)},t.verbose=e("verbose"),t.debug=e("debug"),t.info=e("info"),t.warn=e("warn"),t.error=e("error")}return e.instance=function(){return this._instance||(this._instance=new e),this._instance},e}();function Zh(e){return Symbol.for(e)}var Yh,Xh=new function e(t){var r=this;r._currentContext=t?new Map(t):new Map,r.getValue=function(e){return r._currentContext.get(e)},r.setValue=function(t,i){var n=new e(r._currentContext);return n._currentContext.set(t,i),n},r.deleteValue=function(t){var i=new e(r._currentContext);return i._currentContext.delete(t),i}},Kh=function(){function e(){}return e.prototype.active=function(){return Xh},e.prototype.with=function(e,t,r){for(var i=[],n=3;arguments.length>n;n++)i[n-3]=arguments[n];return t.call.apply(t,function(e,t,r){if(r||2===arguments.length)for(var i,n=0,s=t.length;s>n;n++)!i&&n in t||(i||(i=[].slice.call(t,0,n)),i[n]=t[n]);return e.concat(i||[].slice.call(t))}([r],function(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var i,n,s=r.call(e),o=[];try{for(;(void 0===t||t-- >0)&&!(i=s.next()).done;)o.push(i.value)}catch(e){n={error:e}}finally{try{i&&!i.done&&(r=s.return)&&r.call(s)}finally{if(n)throw n.error}}return o}(i),!1))},e.prototype.bind=function(e,t){return t},e.prototype.enable=function(){return this},e.prototype.disable=function(){return this},e}(),Jh="context",Qh=new Kh,ep=function(){function e(){}return e.getInstance=function(){return this._instance||(this._instance=new e),this._instance},e.prototype.setGlobalContextManager=function(e){return zh(Jh,e,Gh.instance())},e.prototype.active=function(){return this._getContextManager().active()},e.prototype.with=function(e,t,r){for(var i,n=[],s=3;arguments.length>s;s++)n[s-3]=arguments[s];return(i=this._getContextManager()).with.apply(i,function(e,t,r){if(r||2===arguments.length)for(var i,n=0,s=t.length;s>n;n++)!i&&n in t||(i||(i=[].slice.call(t,0,n)),i[n]=t[n]);return e.concat(i||[].slice.call(t))}([e,t,r],function(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var i,n,s=r.call(e),o=[];try{for(;(void 0===t||t-- >0)&&!(i=s.next()).done;)o.push(i.value)}catch(e){n={error:e}}finally{try{i&&!i.done&&(r=s.return)&&r.call(s)}finally{if(n)throw n.error}}return o}(n),!1))},e.prototype.bind=function(e,t){return this._getContextManager().bind(e,t)},e.prototype._getContextManager=function(){return Vh(Jh)||Qh},e.prototype.disable=function(){this._getContextManager().disable(),$h(Jh,Gh.instance())},e}();!function(e){e[e.NONE=0]="NONE",e[e.SAMPLED=1]="SAMPLED"}(Yh||(Yh={}));var tp="0000000000000000",rp="00000000000000000000000000000000",ip={traceId:rp,spanId:tp,traceFlags:Yh.NONE},np=function(){function e(e){void 0===e&&(e=ip),this._spanContext=e}return e.prototype.spanContext=function(){return this._spanContext},e.prototype.setAttribute=function(e,t){return this},e.prototype.setAttributes=function(e){return this},e.prototype.addEvent=function(e,t){return this},e.prototype.addLink=function(e){return this},e.prototype.addLinks=function(e){return this},e.prototype.setStatus=function(e){return this},e.prototype.updateName=function(e){return this},e.prototype.end=function(e){},e.prototype.isRecording=function(){return!1},e.prototype.recordException=function(e,t){},e}(),sp=Zh("OpenTelemetry Context Key SPAN");function op(e){return e.getValue(sp)||void 0}function ap(){return op(ep.getInstance().active())}function lp(e,t){return e.setValue(sp,t)}function up(e){return e.deleteValue(sp)}function cp(e,t){return lp(e,new np(t))}function dp(e){var t;return null===(t=op(e))||void 0===t?void 0:t.spanContext()}var hp=/^([0-9a-f]{32})$/i,pp=/^[0-9a-f]{16}$/i;function gp(e){return hp.test(r=e.traceId)&&r!==rp&&pp.test(t=e.spanId)&&t!==tp;var t,r}function _p(e){return new np(e)}var vp=ep.getInstance(),fp=function(){function e(){}return e.prototype.startSpan=function(e,t,r){if(void 0===r&&(r=vp.active()),Boolean(null==t?void 0:t.root))return new np;var i,n=r&&dp(r);return"object"==typeof(i=n)&&"string"==typeof i.spanId&&"string"==typeof i.traceId&&"number"==typeof i.traceFlags&&gp(n)?new np(n):new np},e.prototype.startActiveSpan=function(e,t,r,i){var n,s,o;if(arguments.length>=2){2===arguments.length?o=t:3===arguments.length?(n=t,o=r):(n=t,s=r,o=i);var a=null!=s?s:vp.active(),l=this.startSpan(e,n,a),u=lp(a,l);return vp.with(u,o,void 0,l)}},e}(),mp=new fp,yp=function(){function e(e,t,r,i){this._provider=e,this.name=t,this.version=r,this.options=i}return e.prototype.startSpan=function(e,t,r){return this._getTracer().startSpan(e,t,r)},e.prototype.startActiveSpan=function(e,t,r,i){var n=this._getTracer();return Reflect.apply(n.startActiveSpan,n,arguments)},e.prototype._getTracer=function(){if(this._delegate)return this._delegate;var e=this._provider.getDelegateTracer(this.name,this.version,this.options);return e?(this._delegate=e,this._delegate):mp},e}(),bp=new(function(){function e(){}return e.prototype.getTracer=function(e,t,r){return new fp},e}()),wp=function(){function e(){}return e.prototype.getTracer=function(e,t,r){var i;return null!==(i=this.getDelegateTracer(e,t,r))&&void 0!==i?i:new yp(this,e,t,r)},e.prototype.getDelegate=function(){var e;return null!==(e=this._delegate)&&void 0!==e?e:bp},e.prototype.setDelegate=function(e){this._delegate=e},e.prototype.getDelegateTracer=function(e,t,r){var i;return null===(i=this._delegate)||void 0===i?void 0:i.getTracer(e,t,r)},e}(),Sp=ep.getInstance(),Cp=Gh.instance(),Ip="trace",kp=function(){function e(){this._proxyTracerProvider=new wp,this.wrapSpanContext=_p,this.isSpanContextValid=gp,this.deleteSpan=up,this.getSpan=op,this.getActiveSpan=ap,this.getSpanContext=dp,this.setSpan=lp,this.setSpanContext=cp}return e.getInstance=function(){return this._instance||(this._instance=new e),this._instance},e.prototype.setGlobalTracerProvider=function(e){var t=zh(Ip,this._proxyTracerProvider,Gh.instance());return t&&this._proxyTracerProvider.setDelegate(e),t},e.prototype.getTracerProvider=function(){return Vh(Ip)||this._proxyTracerProvider},e.prototype.getTracer=function(e,t){return this.getTracerProvider().getTracer(e,t)},e.prototype.disable=function(){$h(Ip,Gh.instance()),this._proxyTracerProvider=new wp},e}().getInstance(),xp=Zh("OpenTelemetry SDK Context Key SUPPRESS_TRACING");function Ep(e){return null==e||(Array.isArray(e)?function(e){var t;for(var r of e)if(null!=r){var i=typeof r;if(i!==t){if(!t){if(Tp(i)){t=i;continue}return!1}return!1}}return!0}(e):Tp(typeof e))}function Tp(e){switch(e){case"number":case"boolean":case"string":return!0}return!1}function Rp(e){try{(e=>{Cp.error(function(e){return"string"==typeof e?e:JSON.stringify(function(e){for(var t={},r=e;null!==r;)Object.getOwnPropertyNames(r).forEach((e=>{if(!t[e]){var i=r[e];i&&(t[e]=String(i))}})),r=Object.getPrototypeOf(r);return t}(e))}(e))})(e)}catch(e){}}var Mp,Lp=performance,Pp="telemetry.sdk.language",Ap="telemetry.sdk.name",Fp="telemetry.sdk.version",Np={[Ap]:"opentelemetry","process.runtime.name":"browser",[Pp]:"webjs",[Fp]:"2.2.0"},Op=Math.pow(10,6),Dp=Math.pow(10,9);function Bp(e){return[Math.trunc(e/1e3),Math.round(e%1e3*Op)]}function Hp(){var e=Lp.timeOrigin;return"number"!=typeof e&&(e=Lp.timing&&Lp.timing.fetchStart),e}function qp(e){if(s=e,Array.isArray(s)&&2===s.length&&"number"==typeof s[0]&&"number"==typeof s[1])return e;if("number"==typeof e)return e<Hp()?(t=e,r=Bp(Hp()),i=Bp("number"==typeof t?t:Lp.now()),Dp>(n=[r[0]+i[0],r[1]+i[1]])[1]||(n[1]-=Dp,n[0]+=1),n):Bp(e);var t,r,i,n,s;if(e instanceof Date)return Bp(e.getTime());throw TypeError("Invalid input type")}!function(e){e[e.SUCCESS=0]="SUCCESS",e[e.FAILED=1]="FAILED"}(Mp||(Mp={}));var zp="[object Object]",Vp="[object Null]",$p="[object Undefined]",Up=function(){}.toString,Wp=Up.call(Object),jp=Object.getPrototypeOf,Gp=Object.prototype,Zp=Gp.hasOwnProperty,Yp=Symbol?Symbol.toStringTag:void 0,Xp=Gp.toString;function Kp(e){if(!function(e){return null!=e&&"object"==typeof e}(e)||function(e){return null==e?void 0===e?$p:Vp:Yp&&Yp in Object(e)?function(e){var t=Zp.call(e,Yp),r=e[Yp],i=!1;try{e[Yp]=void 0,i=!0}catch(e){}var n=Xp.call(e);return i&&(t?e[Yp]=r:delete e[Yp]),n}(e):function(e){return Xp.call(e)}(e)}(e)!==zp)return!1;var t=jp(e);if(null===t)return!0;var r=Zp.call(t,"constructor")&&t.constructor;return"function"==typeof r&&r instanceof r&&Up.call(r)===Wp}function Jp(e){return tg(e)?e.slice():e}function Qp(e,t,r,i){var n;if(void 0===r&&(r=0),20>=r){if(r++,ng(e)||ng(t)||rg(t))n=Jp(t);else if(tg(e)){if(n=e.slice(),tg(t))for(var s=0,o=t.length;o>s;s++)n.push(Jp(t[s]));else if(ig(t))for(var a=Object.keys(t),l=0,u=a.length;u>l;l++){var c=a[l];n[c]=Jp(t[c])}}else if(ig(e))if(ig(t)){if(!function(e,t){return!(!Kp(e)||!Kp(t))}(e,t))return t;n=Object.assign({},e);for(var d=Object.keys(t),h=0,p=d.length;p>h;h++){var g=d[h],_=t[g];if(ng(_))void 0===_?delete n[g]:n[g]=_;else{var v=n[g],f=_;if(eg(e,g,i)||eg(t,g,i))delete n[g];else{if(ig(v)&&ig(f)){var m=i.get(v)||[],y=i.get(f)||[];m.push({obj:e,key:g}),y.push({obj:t,key:g}),i.set(v,m),i.set(f,y)}n[g]=Qp(n[g],_,r,i)}}}}else n=t;return n}}function eg(e,t,r){for(var i=r.get(e[t])||[],n=0,s=i.length;s>n;n++){var o=i[n];if(o.key===t&&o.obj===e)return!0}return!1}function tg(e){return Array.isArray(e)}function rg(e){return"function"==typeof e}function ig(e){return!ng(e)&&!tg(e)&&!rg(e)&&"object"==typeof e}function ng(e){return"string"==typeof e||"number"==typeof e||"boolean"==typeof e||void 0===e||e instanceof Date||e instanceof RegExp||null===e}class sg extends Error{constructor(e){super(e),Object.setPrototypeOf(this,sg.prototype)}}function og(e,t){var r,i=new Promise((function(e,i){r=setTimeout((function(){i(new sg("Operation timed out."))}),t)}));return Promise.race([e,i]).then((e=>(clearTimeout(r),e)),(e=>{throw clearTimeout(r),e}))}class ag{constructor(){this._promise=void 0,this._resolve=void 0,this._reject=void 0,this._promise=new Promise(((e,t)=>{this._resolve=e,this._reject=t}))}get promise(){return this._promise}resolve(e){this._resolve(e)}reject(e){this._reject(e)}}class lg{constructor(e,t){this._callback=void 0,this._that=void 0,this._isCalled=!1,this._deferred=new ag,this._callback=e,this._that=t}get isCalled(){return this._isCalled}get promise(){return this._deferred.promise}call(){if(!this._isCalled){this._isCalled=!0;try{for(var e=arguments.length,t=new Array(e),r=0;e>r;r++)t[r]=arguments[r];Promise.resolve(this._callback.call(this._that,...t)).then((e=>this._deferred.resolve(e)),(e=>this._deferred.reject(e)))}catch(e){this._deferred.reject(e)}}return this._deferred.promise}}var ug={_export:(e,t)=>new Promise((r=>{Sp.with(function(e){return e.setValue(xp,!0)}(Sp.active()),(()=>{e.export(t,(e=>{r(e)}))}))}))};class cg{constructor(e,t,r,i,n){this._transport=void 0,this._serializer=void 0,this._responseHandler=void 0,this._promiseQueue=void 0,this._timeout=void 0,this._diagLogger=void 0,this._transport=e,this._serializer=t,this._responseHandler=r,this._promiseQueue=i,this._timeout=n,this._diagLogger=Cp.createComponentLogger({namespace:"OTLPExportDelegate"})}export(e,t){if(this._diagLogger.debug("items to be sent",e),this._promiseQueue.hasReachedLimit())t({code:Mp.FAILED,error:new Error("Concurrent export limit reached")});else{var r=this._serializer.serializeRequest(e);null!=r?this._promiseQueue.pushPromise(this._transport.send(r,this._timeout).then((e=>{if("success"!==e.status)t("failure"===e.status&&e.error?{code:Mp.FAILED,error:e.error}:"retryable"===e.status?{code:Mp.FAILED,error:new Mh("Export failed with retryable status")}:{code:Mp.FAILED,error:new Mh("Export failed with unknown error")});else{if(null!=e.data)try{this._responseHandler.handleResponse(this._serializer.deserializeResponse(e.data))}catch(t){this._diagLogger.warn("Export succeeded but could not deserialize response - is the response specification compliant?",t,e.data)}t({code:Mp.SUCCESS})}}),(e=>t({code:Mp.FAILED,error:e})))):t({code:Mp.FAILED,error:new Error("Nothing to send")})}}forceFlush(){return this._promiseQueue.awaitAll()}shutdown(){var e=this;return t((function*(){e._diagLogger.debug("shutdown started"),yield e.forceFlush(),e._transport.shutdown()}))()}}function dg(e,t,r){return i={transport:r,serializer:t,promiseHandler:Ah(e)},new cg(i.transport,i.serializer,{handleResponse(e){null!=e&&function(e){return{}.hasOwnProperty.call(e,"partialSuccess")}(e)&&null!=e.partialSuccess&&0!==Object.keys(e.partialSuccess).length&&Cp.warn("Received Partial Success response:",JSON.stringify(e.partialSuccess))}},i.promiseHandler,{timeout:e.timeoutMillis}.timeout);var i}function hg(e){return 48>e||e>57?97>e||e>102?e-55:e-87:e-48}function pg(e){for(var t=new Uint8Array(e.length/2),r=0,i=0;e.length>i;i+=2){var n=hg(e.charCodeAt(i)),s=hg(e.charCodeAt(i+1));t[r++]=n<<4|s}return t}function gg(e){var t=BigInt(1e9);return BigInt(Math.trunc(e[0]))*t+BigInt(Math.trunc(e[1]))}function _g(e){var t;return t=gg(e),{low:Number(BigInt.asUintN(32,t)),high:Number(BigInt.asUintN(32,t>>BigInt(32)))}}var vg="undefined"!=typeof BigInt?function(e){return gg(e).toString()}:function(e){return e[0]*Dp+e[1]};function fg(e){return e}function mg(e){if(void 0!==e)return pg(e)}var yg={encodeHrTime:_g,encodeSpanContext:pg,encodeOptionalSpanContext:mg};function bg(e,t){return{key:e,value:wg(t)}}function wg(e){var t=typeof e;return"string"===t?{stringValue:e}:"number"===t?Number.isInteger(e)?{intValue:e}:{doubleValue:e}:"boolean"===t?{boolValue:e}:e instanceof Uint8Array?{bytesValue:e}:Array.isArray(e)?{arrayValue:{values:e.map(wg)}}:"object"===t&&null!=e?{kvlistValue:{values:Object.entries(e).map((e=>{var[t,r]=e;return bg(t,r)}))}}:{}}function Sg(e,t){var r=function(e){var t=new Map;for(var r of e){var{resource:i,instrumentationScope:{name:n,version:s="",schemaUrl:o=""}}=r,a=t.get(i);a||(a=new Map,t.set(i,a));var l=n+"@"+s+":"+o,u=a.get(l);u||a.set(l,u=[]),u.push(r)}return t}(e);return Array.from(r,(e=>{var[r,i]=e,n=function(e){var t,r={attributes:(t=e.attributes,Object.keys(t).map((e=>bg(e,t[e])))),droppedAttributesCount:0},i=e.schemaUrl;return i&&""!==i&&(r.schemaUrl=i),r}(r);return{resource:n,scopeLogs:Array.from(i,(e=>{var r,[,i]=e;return{scope:(r=i[0].instrumentationScope,{name:r.name,version:r.version}),logRecords:i.map((e=>function(e,t){var r,i,n,s;return{timeUnixNano:t.encodeHrTime(e.hrTime),observedTimeUnixNano:t.encodeHrTime(e.hrTimeObserved),severityNumber:e.severityNumber,severityText:e.severityText,body:wg(e.body),eventName:e.eventName,attributes:(s=e.attributes,Object.keys(s).map((e=>bg(e,s[e])))),droppedAttributesCount:e.droppedAttributesCount,flags:null==(r=e.spanContext)?void 0:r.traceFlags,traceId:t.encodeOptionalSpanContext(null==(i=e.spanContext)?void 0:i.traceId),spanId:t.encodeOptionalSpanContext(null==(n=e.spanContext)?void 0:n.spanId)}}(e,t))),schemaUrl:i[0].instrumentationScope.schemaUrl}})),schemaUrl:n.schemaUrl}}))}var Cg=e=>null!==e&&"object"==typeof e&&"function"==typeof e.then;class Ig{static FromAttributeList(e,t){var r=new Ig({},t);return r._rawAttributes=xg(e),r._asyncAttributesPending=e.filter((e=>{var[t,r]=e;return Cg(r)})).length>0,r}constructor(e,t){var r;this._rawAttributes=void 0,this._asyncAttributesPending=!1,this._schemaUrl=void 0,this._memoizedAttributes=void 0;var i=null!==(r=e.attributes)&&void 0!==r?r:{};this._rawAttributes=Object.entries(i).map((e=>{var[t,r]=e;return Cg(r)&&(this._asyncAttributesPending=!0),[t,r]})),this._rawAttributes=xg(this._rawAttributes),this._schemaUrl=function(e){if("string"==typeof e||void 0===e)return e;Cp.warn("Schema URL must be string or undefined, got %s. Schema URL will be ignored.",e)}(null==t?void 0:t.schemaUrl)}get asyncAttributesPending(){return this._asyncAttributesPending}waitForAsyncAttributes(){var e=this;return t((function*(){if(e.asyncAttributesPending){for(var t=0;e._rawAttributes.length>t;t++){var[r,i]=e._rawAttributes[t];e._rawAttributes[t]=[r,Cg(i)?yield i:i]}e._asyncAttributesPending=!1}}))()}get attributes(){if(this.asyncAttributesPending&&Cp.error("Accessing resource attributes before async attributes settled"),this._memoizedAttributes)return this._memoizedAttributes;var e={};for(var[t,r]of this._rawAttributes){var i;Cg(r)?Cp.debug("Unsettled resource attribute "+t+" skipped"):null!=r&&(null!==(i=e[t])&&void 0!==i||(e[t]=r))}return this._asyncAttributesPending||(this._memoizedAttributes=e),e}getRawAttributes(){return this._rawAttributes}get schemaUrl(){return this._schemaUrl}merge(e){if(null==e)return this;var t,r,i,n,s=(n=null==(r=e)?void 0:r.schemaUrl,void 0===(i=null==(t=this)?void 0:t.schemaUrl)||""===i?n:void 0===n||""===n||i===n?i:void Cp.warn('Schema URL merge conflict: old resource has "%s", updating resource has "%s". Resulting resource will have undefined Schema URL.',i,n)),o=s?{schemaUrl:s}:void 0;return Ig.FromAttributeList([...e.getRawAttributes(),...this.getRawAttributes()],o)}}function kg(e,t){return Ig.FromAttributeList(Object.entries(e),t)}function xg(e){return e.map((e=>{var[t,r]=e;return Cg(r)?[t,r.catch((e=>{Cp.debug("promise rejection for resource attribute: %s - %s",t,e)}))]:[t,r]}))}var Eg={serializeRequest(e){var t,r,i=(t=e,r=function(e){var t,r;if(void 0===e)return yg;var i=null===(t=e.useLongBits)||void 0===t||t,n=null!==(r=e.useHex)&&void 0!==r&&r;return{encodeHrTime:i?_g:vg,encodeSpanContext:n?fg:pg,encodeOptionalSpanContext:n?fg:mg}}({useHex:!0,useLongBits:!1}),{resourceLogs:Sg(t,r)});return(new TextEncoder).encode(JSON.stringify(i))},deserializeResponse(e){if(0===e.length)return{};var t=new TextDecoder;return JSON.parse(t.decode(e))}};class Tg{constructor(e){this._transport=void 0,this._transport=e}retry(e,t,r){return new Promise(((i,n)=>{setTimeout((()=>{this._transport.send(e,t).then(i,n)}),r)}))}send(e,r){var i=this;return t((function*(){for(var t=Date.now()+r,n=yield i._transport.send(e,r),s=5,o=1e3;"retryable"===n.status&&s>0;){var a;s--;var l=Math.max(Math.min(o,5e3)+(.4*Math.random()-.2),0);o*=1.5;var u=null!==(a=n.retryInMillis)&&void 0!==a?a:l,c=t-Date.now();if(u>c)return n;n=yield i.retry(e,c,u)}return n}))()}shutdown(){return this._transport.shutdown()}}function Rg(e){return new Tg(e.transport)}function Mg(e){return[429,502,503,504].includes(e)}function Lg(e){if(null!=e){var t=Number.parseInt(e,10);if(Number.isInteger(t))return t>0?1e3*t:-1;var r=new Date(e).getTime()-Date.now();return 0>r?0:r}}class Pg{constructor(e){this._parameters=void 0,this._parameters=e}send(e,r){var i=this;return t((function*(){var t=yield i._parameters.headers(),n=yield new Promise((n=>{var s=new XMLHttpRequest;s.timeout=r,s.open("POST",i._parameters.url),Object.entries(t).forEach((e=>{var[t,r]=e;s.setRequestHeader(t,r)})),s.ontimeout=e=>{n({status:"failure",error:new Error("XHR request timed out")})},s.onreadystatechange=()=>{200>s.status||s.status>299?s.status&&Mg(s.status)?n({status:"retryable",retryInMillis:Lg(s.getResponseHeader("Retry-After"))}):0!==s.status&&n({status:"failure",error:new Error("XHR request failed with non-retryable status")}):(Cp.debug("XHR success"),n({status:"success"}))},s.onabort=()=>{n({status:"failure",error:new Error("XHR request aborted")})},s.onerror=()=>{n({status:"failure",error:new Error("XHR request errored")})},s.send(e)}));return n}))()}shutdown(){}}class Ag{constructor(e){this._params=void 0,this._params=e}send(e){var r=this;return t((function*(){var t=(yield r._params.headers())["Content-Type"];return new Promise((i=>{navigator.sendBeacon(r._params.url,new Blob([e],{type:t}))?(Cp.debug("SendBeacon success"),i({status:"success"})):i({status:"failure",error:new Error("SendBeacon failed")})}))}))()}shutdown(){}}class Fg{constructor(e){this._parameters=void 0,this._parameters=e}send(e,r){var i=this;return t((function*(){var t=new AbortController,n=setTimeout((()=>t.abort()),r);try{var s,o=!!globalThis.location,a=new URL(i._parameters.url),l=yield fetch(a.href,{method:"POST",headers:yield i._parameters.headers(),body:e,signal:t.signal,keepalive:o,mode:o?(null==(s=globalThis.location)?void 0:s.origin)===a.origin?"same-origin":"cors":"no-cors"});return 200>l.status||l.status>299?Mg(l.status)?{status:"retryable",retryInMillis:Lg(l.headers.get("Retry-After"))}:{status:"failure",error:new Error("Fetch request failed with non-retryable status")}:(Cp.debug("response success"),{status:"success"})}catch(e){return"AbortError"===(null==e?void 0:e.name)?{status:"failure",error:new Error("Fetch request timed out",{cause:e})}:{status:"failure",error:new Error("Fetch request errored",{cause:e})}}finally{clearTimeout(n)}}))()}shutdown(){}}function Ng(e,t){return dg(e,t,Rg({transport:(r=e,new Pg(r))}));var r}function Og(e,t){return dg(e,t,Rg({transport:(r=e,new Fg(r))}));var r}function Dg(e,t){return dg(e,t,Rg({transport:(r={url:e.url,headers:e.headers},new Ag(r))}));var r}function Bg(e){if(null!=e)try{var t,r=null==(t=globalThis.location)?void 0:t.href;return new URL(e,r).href}catch(t){throw new Error("Configuration: Could not parse user-provided export URL: '"+e+"'")}}function Hg(e){return"function"==typeof e.headers?e.headers:function(e){if(null!=e)return t((function*(){return e}))}(e.headers)}function qg(e,i,n){return s={url:e.url,timeoutMillis:e.timeoutMillis,headers:Hg(e),concurrencyLimit:e.concurrencyLimit},o={},a=function(e,i){return r({},{timeoutMillis:1e4,concurrencyLimit:30,compression:"none"},{headers:(n=t((function*(){return e})),function(){return n.apply(this,arguments)}),url:"http://localhost:4318/"+i});var n}(n,i),r({},function(e,t,r){var i,n,s,o,a,l;return{timeoutMillis:Lh(null!==(i=null!==(n=e.timeoutMillis)&&void 0!==n?n:t.timeoutMillis)&&void 0!==i?i:r.timeoutMillis),concurrencyLimit:null!==(s=null!==(o=e.concurrencyLimit)&&void 0!==o?o:t.concurrencyLimit)&&void 0!==s?s:r.concurrencyLimit,compression:null!==(a=null!==(l=e.compression)&&void 0!==l?l:t.compression)&&void 0!==a?a:r.compression}}(s,o,a),{headers:(c=s.headers,d=o.headers,h=a.headers,t((function*(){var e=r({},yield h()),t={};return null!=d&&Object.assign(t,yield d()),null!=c&&Object.assign(t,function(e){var t={};return Object.entries(null!=e?e:{}).forEach((e=>{var[r,i]=e;void 0!==i?t[r]=String(i):Cp.warn('Header "'+r+'" has invalid value ('+i+") and will be ignored")})),t}(yield c())),Object.assign(t,e)}))),url:null!==(l=null!==(u=Bg(s.url))&&void 0!==u?u:o.url)&&void 0!==l?l:a.url});var s,o,a,l,u,c,d,h}function zg(e,t,r,i){return(e.headers||"function"!=typeof navigator.sendBeacon?void 0!==globalThis.fetch?Og:Ng:Dg)(qg(e,r,i),t)}class Vg extends Rh{constructor(e){void 0===e&&(e={}),super(zg(e,Eg,"v1/logs",{"Content-Type":"application/json"}))}}class $g{set severityText(e){this._isLogRecordReadonly()||(this._severityText=e)}get severityText(){return this._severityText}set severityNumber(e){this._isLogRecordReadonly()||(this._severityNumber=e)}get severityNumber(){return this._severityNumber}set body(e){this._isLogRecordReadonly()||(this._body=e)}get body(){return this._body}get eventName(){return this._eventName}set eventName(e){this._isLogRecordReadonly()||(this._eventName=e)}get droppedAttributesCount(){return this.totalAttributesCount-Object.keys(this.attributes).length}constructor(e,t,r){this.hrTime=void 0,this.hrTimeObserved=void 0,this.spanContext=void 0,this.resource=void 0,this.instrumentationScope=void 0,this.attributes={},this._severityText=void 0,this._severityNumber=void 0,this._body=void 0,this._eventName=void 0,this.totalAttributesCount=0,this._isReadonly=!1,this._logRecordLimits=void 0;var{timestamp:i,observedTimestamp:n,eventName:s,severityNumber:o,severityText:a,body:l,attributes:u={},context:c}=r,d=Date.now();if(this.hrTime=qp(null!=i?i:d),this.hrTimeObserved=qp(null!=n?n:d),c){var h=kp.getSpanContext(c);h&&gp(h)&&(this.spanContext=h)}this.severityNumber=o,this.severityText=a,this.body=l,this.resource=e.resource,this.instrumentationScope=t,this._logRecordLimits=e.logRecordLimits,this._eventName=s,this.setAttributes(u)}setAttribute(e,t){return this._isLogRecordReadonly()||null===t?this:0===e.length?(Cp.warn("Invalid attribute key: "+e),this):Ep(t)||"object"==typeof t&&!Array.isArray(t)&&Object.keys(t).length>0?(this.totalAttributesCount+=1,Object.keys(this.attributes).length<this._logRecordLimits.attributeCountLimit||{}.hasOwnProperty.call(this.attributes,e)?(this.attributes[e]=Ep(t)?this._truncateToSize(t):t,this):(1===this.droppedAttributesCount&&Cp.warn("Dropping extra attributes."),this)):(Cp.warn("Invalid attribute value set for key: "+e),this)}setAttributes(e){for(var[t,r]of Object.entries(e))this.setAttribute(t,r);return this}setBody(e){return this.body=e,this}setEventName(e){return this.eventName=e,this}setSeverityNumber(e){return this.severityNumber=e,this}setSeverityText(e){return this.severityText=e,this}_makeReadonly(){this._isReadonly=!0}_truncateToSize(e){var t=this._logRecordLimits.attributeValueLengthLimit;return t>0?"string"==typeof e?this._truncateToLimitUtil(e,t):Array.isArray(e)?e.map((e=>"string"==typeof e?this._truncateToLimitUtil(e,t):e)):e:(Cp.warn("Attribute value limit must be positive, got "+t),e)}_truncateToLimitUtil(e,t){return e.length>t?e.substring(0,t):e}_isLogRecordReadonly(){return this._isReadonly&&Cp.warn("Can not execute the operation on emitted log record"),this._isReadonly}}class Ug{constructor(e,t){this.instrumentationScope=void 0,this._sharedState=void 0,this.instrumentationScope=e,this._sharedState=t}emit(e){var t=e.context||Sp.active(),i=new $g(this._sharedState,this.instrumentationScope,r({context:t},e));this._sharedState.activeProcessor.onEmit(i,t),i._makeReadonly()}}class Wg{forceFlush(){return Promise.resolve()}onEmit(e,t){}shutdown(){return Promise.resolve()}}class jg{constructor(e,t){this.processors=void 0,this.forceFlushTimeoutMillis=void 0,this.processors=e,this.forceFlushTimeoutMillis=t}forceFlush(){var e=this;return t((function*(){var t=e.forceFlushTimeoutMillis;yield Promise.all(e.processors.map((e=>og(e.forceFlush(),t))))}))()}onEmit(e,t){this.processors.forEach((r=>r.onEmit(e,t)))}shutdown(){var e=this;return t((function*(){yield Promise.all(e.processors.map((e=>e.shutdown())))}))()}}class Gg{constructor(e,t,r,i){this.resource=void 0,this.forceFlushTimeoutMillis=void 0,this.logRecordLimits=void 0,this.processors=void 0,this.loggers=new Map,this.activeProcessor=void 0,this.registeredLogRecordProcessors=[],this.resource=e,this.forceFlushTimeoutMillis=t,this.logRecordLimits=r,this.processors=i,i.length>0?(this.registeredLogRecordProcessors=i,this.activeProcessor=new jg(this.registeredLogRecordProcessors,this.forceFlushTimeoutMillis)):this.activeProcessor=new Wg}}class Zg{constructor(e){var t,r,i;void 0===e&&(e={}),this._shutdownOnce=void 0,this._sharedState=void 0;var n,s,o,a,l,u,c,d=function(){for(var e=arguments.length,t=new Array(e),r=0;e>r;r++)t[r]=arguments[r];for(var i=t.shift(),n=new WeakMap;t.length>0;)i=Qp(i,t.shift(),0,n);return i}({},{forceFlushTimeoutMillis:3e4,logRecordLimits:{attributeValueLengthLimit:1/0,attributeCountLimit:128},includeTraceContext:!0},e),h=null!==(t=e.resource)&&void 0!==t?t:kg({"service.name":"unknown_service",[Pp]:Np[Pp],[Ap]:Np[Ap],[Fp]:Np[Fp]});this._sharedState=new Gg(h,d.forceFlushTimeoutMillis,{attributeCountLimit:null!==(s=null!==(o=null!==(a=(n=d.logRecordLimits).attributeCountLimit)&&void 0!==a?a:void 0)&&void 0!==o?o:void 0)&&void 0!==s?s:128,attributeValueLengthLimit:null!==(l=null!==(u=null!==(c=n.attributeValueLengthLimit)&&void 0!==c?c:void 0)&&void 0!==u?u:void 0)&&void 0!==l?l:1/0},null!==(r=null==(i=e)?void 0:i.processors)&&void 0!==r?r:[]),this._shutdownOnce=new lg(this._shutdown,this)}getLogger(e,t,r){if(this._shutdownOnce.isCalled)return Cp.warn("A shutdown LoggerProvider cannot provide a Logger"),bh;e||Cp.warn("Logger requested without instrumentation scope name.");var i=e||"unknown",n=i+"@"+(t||"")+":"+((null==r?void 0:r.schemaUrl)||"");return this._sharedState.loggers.has(n)||this._sharedState.loggers.set(n,new Ug({name:i,version:t,schemaUrl:null==r?void 0:r.schemaUrl},this._sharedState)),this._sharedState.loggers.get(n)}forceFlush(){return this._shutdownOnce.isCalled?(Cp.warn("invalid attempt to force flush after LoggerProvider shutdown"),this._shutdownOnce.promise):this._sharedState.activeProcessor.forceFlush()}shutdown(){return this._shutdownOnce.isCalled?(Cp.warn("shutdown may only be called once per LoggerProvider"),this._shutdownOnce.promise):this._shutdownOnce.call()}_shutdown(){return this._sharedState.activeProcessor.shutdown()}}class Yg{constructor(e,t){var r,i,n,s,o,a,l,u;this._exporter=void 0,this._maxExportBatchSize=void 0,this._maxQueueSize=void 0,this._scheduledDelayMillis=void 0,this._exportTimeoutMillis=void 0,this._isExporting=!1,this._finishedLogRecords=[],this._timer=void 0,this._shutdownOnce=void 0,this._exporter=e,this._maxExportBatchSize=null!==(r=null!==(i=null==t?void 0:t.maxExportBatchSize)&&void 0!==i?i:void 0)&&void 0!==r?r:512,this._maxQueueSize=null!==(n=null!==(s=null==t?void 0:t.maxQueueSize)&&void 0!==s?s:void 0)&&void 0!==n?n:2048,this._scheduledDelayMillis=null!==(o=null!==(a=null==t?void 0:t.scheduledDelayMillis)&&void 0!==a?a:void 0)&&void 0!==o?o:5e3,this._exportTimeoutMillis=null!==(l=null!==(u=null==t?void 0:t.exportTimeoutMillis)&&void 0!==u?u:void 0)&&void 0!==l?l:3e4,this._shutdownOnce=new lg(this._shutdown,this),this._maxExportBatchSize>this._maxQueueSize&&(Cp.warn("BatchLogRecordProcessor: maxExportBatchSize must be smaller or equal to maxQueueSize, setting maxExportBatchSize to match maxQueueSize"),this._maxExportBatchSize=this._maxQueueSize)}onEmit(e){this._shutdownOnce.isCalled||this._addToBuffer(e)}forceFlush(){return this._shutdownOnce.isCalled?this._shutdownOnce.promise:this._flushAll()}shutdown(){return this._shutdownOnce.call()}_shutdown(){var e=this;return t((function*(){e.onShutdown(),yield e._flushAll(),yield e._exporter.shutdown()}))()}_addToBuffer(e){this._maxQueueSize>this._finishedLogRecords.length&&(this._finishedLogRecords.push(e),this._maybeStartTimer())}_flushAll(){return new Promise(((e,t)=>{for(var r=[],i=Math.ceil(this._finishedLogRecords.length/this._maxExportBatchSize),n=0;i>n;n++)r.push(this._flushOneBatch());Promise.all(r).then((()=>{e()})).catch(t)}))}_flushOneBatch(){return this._clearTimer(),0===this._finishedLogRecords.length?Promise.resolve():new Promise(((e,t)=>{og(this._export(this._finishedLogRecords.splice(0,this._maxExportBatchSize)),this._exportTimeoutMillis).then((()=>e())).catch(t)}))}_maybeStartTimer(){if(!this._isExporting){var e=()=>{this._isExporting=!0,this._flushOneBatch().then((()=>{this._isExporting=!1,this._finishedLogRecords.length>0&&(this._clearTimer(),this._maybeStartTimer())})).catch((e=>{this._isExporting=!1,Rp(e)}))};if(this._finishedLogRecords.length>=this._maxExportBatchSize)return e();void 0===this._timer&&(this._timer=setTimeout((()=>e()),this._scheduledDelayMillis),"number"!=typeof this._timer&&this._timer.unref())}}_clearTimer(){void 0!==this._timer&&(clearTimeout(this._timer),this._timer=void 0)}_export(e){var t=()=>ug._export(this._exporter,e).then((e=>{var t;e.code!==Mp.SUCCESS&&Rp(null!==(t=e.error)&&void 0!==t?t:new Error("BatchLogRecordProcessor: log record export failed (status "+e+")"))})).catch(Rp),r=e.map((e=>e.resource)).filter((e=>e.asyncAttributesPending));return 0===r.length?t():Promise.all(r.map((e=>null==e.waitForAsyncAttributes?void 0:e.waitForAsyncAttributes()))).then(t,Rp)}}class Xg extends Yg{constructor(e,t){super(e,t),this._visibilityChangeListener=void 0,this._pageHideListener=void 0,this._onInit(t)}onShutdown(){"undefined"!=typeof document&&(this._visibilityChangeListener&&document.removeEventListener("visibilitychange",this._visibilityChangeListener),this._pageHideListener&&document.removeEventListener("pagehide",this._pageHideListener))}_onInit(e){!0!==(null==e?void 0:e.disableAutoFlushOnDocumentHide)&&"undefined"!=typeof document&&(this._visibilityChangeListener=()=>{"hidden"===document.visibilityState&&this.forceFlush()},this._pageHideListener=()=>{this.forceFlush()},document.addEventListener("visibilitychange",this._visibilityChangeListener),document.addEventListener("pagehide",this._pageHideListener))}}var Kg=1e4,Jg=function(e,t,r,i,n,s){if(void 0===t&&(t=""),void 0===r&&(r={}),void 0===i&&(i=50),void 0===n&&(n=Kg),void 0===s&&(s=new WeakSet),s.has(e))return r[t||"circular"]="[Circular]",r;for(var o in s.add(e),e)if({}.hasOwnProperty.call(e,o)){var a=e[o],l=t?t+"."+o:o;if(jr(a))Jg(a,l,r,i,n,s);else{if(i-=1,n-=String(a).length,n-=l.length,0>=i||0>=n)return void(r.attributes_truncated=!0);r[l]=a}}return r},Qg={log:"INFO",warn:"WARNING",error:"ERROR",debug:"DEBUG",info:"INFO"};ns.__PosthogExtensions__=ns.__PosthogExtensions__||{},ns.__PosthogExtensions__.logs={initializeLogs(e){(e=>{var t,i={"service.name":(null==(t=e.config.logs)?void 0:t.serviceName)||"posthog-browser-logs",host:ns.location.host};if(e.sessionManager){var{sessionId:n,windowId:s}=e.sessionManager.checkAndGetSessionAndWindowId(!0);i=r({},i,{"session.id":n,"window.id":s})}Th.setGlobalLoggerProvider(new Zg({resource:kg(i),processors:[new Xg(new Vg({url:e.config.api_host+"/i/v1/logs?token="+e.config.token,headers:{"Content-Type":"text/plain"}}))]}))})(e);var t=Th.getLogger("console"),i={};if(e.sessionManager){var{sessionStartTimestamp:n,lastActivityTimestamp:s}=e.sessionManager.checkAndGetSessionAndWindowId(!0);i={sessionStartTimestamp:n.toString(),lastActivityTimestamp:s.toString()}}var o=function(n){var s;ns.console[n]=(s=ns.console[n],function(){for(var o=arguments.length,a=new Array(o),l=0;o>l;l++)a[l]=arguments[l];if(a.length>0){var u=a.map((e=>{return JSON.stringify(e,(t=new WeakSet,(e,i)=>{if(i instanceof Error)return r({},i,{name:i.name,message:i.message,stack:i.stack});if("object"==typeof i&&!Kr(i)){if(t.has(i))return"[Circular]";t.add(i)}return i}));var t})).join(" ");u.length>Kg&&(u=u.slice(0,Kg)+"...",i.body_truncated="true"),t.emit({severityText:Qg[n],body:u,attributes:r({"log.source":"console."+n,distinct_id:e.get_distinct_id(),"location.href":ns.location.href},i,jr(a[0])?Jg(a[0]):{})}),s.apply(ns.console,a)}})};for(var a of["debug","log","warn","error","info"])o(a)}};var e_=cs("[Error tracking]");function t_(){return new fn([new Mn,new qn,new Pn,new Ln,new Bn,new Dn,new Fn,new Hn],function(e){for(var t=arguments.length,i=new Array(t>1?t-1:0),n=1;t>n;n++)i[n-1]=arguments[n];return function(t,n){void 0===n&&(n=0);for(var s=[],o=t.split("\n"),a=n;o.length>a;a++){var l=o[a];if(1024>=l.length){var u=Tn.test(l)?l.replace(Tn,"$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>=Rn)break}}}return function(e){if(!e.length)return[];var t=Array.from(e);return t.reverse(),t.slice(0,Rn).map((e=>{return r({},e,{filename:e.filename||(i=t,i[i.length-1]||{}).filename,function:e.function||mn});var i}))}(s)}}("web:javascript",In,En))}var r_=cs("[ExceptionAutocapture]"),i_=t_(),n_={wrapOnError(e){var t=Zn;t||r_.info("window not available, cannot wrap onerror");var r=t.onerror;return t.onerror=function(){for(var t,i=arguments.length,n=new Array(i),s=0;i>s;s++)n[s]=arguments[s];var o=i_.buildFromUnknown(n[4]||n[0],{mechanism:{handled:!1}});return e(o),null!==(t=null==r?void 0:r(...n))&&void 0!==t&&t},t.onerror.__POSTHOG_INSTRUMENTED__=!0,()=>{var e;null==(e=t.onerror)||delete e.__POSTHOG_INSTRUMENTED__,t.onerror=r}},wrapUnhandledRejection(e){var t=Zn;t||r_.info("window not available, cannot wrap onUnhandledRejection");var r=t.onunhandledrejection;return t.onunhandledrejection=function(i){var n,s=i_.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||r_.info("console not available, cannot wrap console.error");var r=t.error;return t.error=function(){for(var t,i=arguments.length,n=new Array(i),s=0;i>s;s++)n[s]=arguments[s];t=1==n.length?n[0]:n.join(" ");var o=n.find((e=>e instanceof Error)),a=i_.buildFromUnknown(o||t,{mechanism:{handled:!1},syntheticException:new Error("PostHog syntheticException"),skipFirstLines:2});return e(a),null==r?void 0:r(...n)},t.error.__POSTHOG_INSTRUMENTED__=!0,()=>{var e;null==(e=t.error)||delete e.__POSTHOG_INSTRUMENTED__,t.error=r}}};ns.__PosthogExtensions__=ns.__PosthogExtensions__||{},ns.__PosthogExtensions__.errorWrappingFunctions=n_,ns.posthogErrorWrappingFunctions=n_;var s_=(e,t,r,i)=>{var n;try{n=new URL(i.url).hostname}catch(e){return}if(!Ur(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!==Ro&&i.headers.set("X-POSTHOG-DISTINCT-ID",t)}};ns.__PosthogExtensions__=ns.__PosthogExtensions__||{};var o_={_patchFetch:(e,r,i)=>Ts(Zn,"fetch",(n=>function(){var s=t((function*(t,s){var o=new Request(t,s);return s_(e,r,i,o),n(o)}));return function(e,t){return s.apply(this,arguments)}}())),_patchXHR:(e,t,r)=>Ts(Zn.XMLHttpRequest.prototype,"open",(i=>function(n,s,o,a,l){void 0===o&&(o=!0);var u=new Request(s);return s_(e,t,r,u),i.call(this,n,u.url,o,a,l)}))};ns.__PosthogExtensions__.tracingHeadersPatchFns=o_,ns.postHogTracingHeadersPatchFns=o_;var a_=-1,l_=e=>{addEventListener("pageshow",(t=>{t.persisted&&(a_=t.timeStamp,e(t))}),!0)},u_=(e,t,r,i)=>{var n,s;return o=>{t.value>=0&&(o||i)&&((s=t.value-(null!=n?n:0))||void 0===n)&&(n=t.value,t.delta=s,t.rating=((e,t)=>e>t[1]?"poor":e>t[0]?"needs-improvement":"good")(t.value,r),e(t))}},c_=e=>{requestAnimationFrame((()=>requestAnimationFrame((()=>e()))))},d_=()=>{var e=performance.getEntriesByType("navigation")[0];if(e&&e.responseStart>0&&e.responseStart<performance.now())return e},h_=()=>{var e,t=d_();return null!==(e=null==t?void 0:t.activationStart)&&void 0!==e?e:0},p_=function(e,t){void 0===t&&(t=-1);var r=d_(),i="navigate";return 0>a_?r&&(document.prerendering||h_()>0?i="prerender":document.wasDiscarded?i="restore":r.type&&(i=r.type.replace(/_/g,"-"))):i="back-forward-cache",{name:e,value:t,rating:"good",delta:0,entries:[],id:"v5-"+Date.now()+"-"+(Math.floor(8999999999999*Math.random())+1e12),navigationType:i}},g_=new WeakMap;function __(e,t){return g_.get(e)||g_.set(e,new t),g_.get(e)}class v_{constructor(){this.t=void 0,this.i=0,this.o=[]}h(e){var t;if(!e.hadRecentInput){var r=this.o[0],i=this.o.at(-1);this.i&&r&&i&&1e3>e.startTime-i.startTime&&5e3>e.startTime-r.startTime?(this.i+=e.value,this.o.push(e)):(this.i=e.value,this.o=[e]),null==(t=this.t)||t.call(this,e)}}}var f_,m_=function(e,t,i){void 0===i&&(i={});try{if(PerformanceObserver.supportedEntryTypes.includes(e)){var n=new PerformanceObserver((e=>{Promise.resolve().then((()=>{t(e.getEntries())}))}));return n.observe(r({type:e,buffered:!0},i)),n}}catch(e){}},y_=e=>{var t=!1;return()=>{t||(e(),t=!0)}},b_=-1,w_=new Set,S_=()=>"hidden"!==document.visibilityState||document.prerendering?1/0:0,C_=e=>{if("hidden"===document.visibilityState){if("visibilitychange"===e.type)for(var t of w_)t();isFinite(b_)||(b_="visibilitychange"===e.type?e.timeStamp:0,removeEventListener("prerenderingchange",C_,!0))}},I_=()=>{if(0>b_){var e,t=h_(),r=document.prerendering||null==(e=globalThis.performance.getEntriesByType("visibility-state").filter((e=>"hidden"===e.name&&e.startTime>t))[0])?void 0:e.startTime;b_=null!=r?r:S_(),addEventListener("visibilitychange",C_,!0),addEventListener("prerenderingchange",C_,!0),l_((()=>{setTimeout((()=>{b_=S_()}))}))}return{get firstHiddenTime(){return b_},onHidden(e){w_.add(e)}}},k_=e=>{document.prerendering?addEventListener("prerenderingchange",(()=>e()),!0):e()},x_=[1800,3e3],E_=function(e,t){void 0===t&&(t={}),k_((()=>{var r,i=I_(),n=p_("FCP"),s=m_("paint",(e=>{for(var t of e)"first-contentful-paint"===t.name&&(s.disconnect(),i.firstHiddenTime>t.startTime&&(n.value=Math.max(t.startTime-h_(),0),n.entries.push(t),r(!0)))}));s&&(r=u_(e,n,x_,t.reportAllChanges),l_((i=>{n=p_("FCP"),r=u_(e,n,x_,t.reportAllChanges),c_((()=>{n.value=performance.now()-i.timeStamp,r(!0)}))})))}))},T_=[.1,.25],R_=0,M_=1/0,L_=0,P_=e=>{for(var t of e)t.interactionId&&(M_=Math.min(M_,t.interactionId),L_=Math.max(L_,t.interactionId),R_=L_?(L_-M_)/7+1:0)},A_=()=>{var e;return f_?R_:null!==(e=performance.interactionCount)&&void 0!==e?e:0},F_=0;class N_{constructor(){this.u=[],this.l=new Map,this.m=void 0,this.p=void 0}v(){F_=A_(),this.u.length=0,this.l.clear()}L(){var e=Math.min(this.u.length-1,Math.floor((A_()-F_)/50));return this.u[e]}h(e){var t;if(null!=(t=this.m)&&t.call(this,e),e.interactionId||"first-input"===e.entryType){var r=this.u.at(-1),i=this.l.get(e.interactionId);if(i||10>this.u.length||e.duration>r.P){var n;if(i?e.duration>i.P?(i.entries=[e],i.P=e.duration):e.duration===i.P&&e.startTime===i.entries[0].startTime&&i.entries.push(e):(this.l.set((i={id:e.interactionId,entries:[e],P:e.duration}).id,i),this.u.push(i)),this.u.sort(((e,t)=>t.P-e.P)),this.u.length>10){var s=this.u.splice(10);for(var o of s)this.l.delete(o.id)}null==(n=this.p)||n.call(this,i)}}}}var O_=e=>{var t=globalThis.requestIdleCallback||setTimeout;"hidden"===document.visibilityState?e():(e=y_(e),addEventListener("visibilitychange",e,{once:!0,capture:!0}),t((()=>{e(),removeEventListener("visibilitychange",e,{capture:!0})})))},D_=[200,500];class B_{constructor(){this.m=void 0}h(e){var t;null==(t=this.m)||t.call(this,e)}}var H_=[2500,4e3],q_={onLCP(e,t){void 0===t&&(t={}),k_((()=>{var r,i=I_(),n=p_("LCP"),s=__(t,B_),o=e=>{for(var o of(t.reportAllChanges||(e=e.slice(-1)),e))s.h(o),i.firstHiddenTime>o.startTime&&(n.value=Math.max(o.startTime-h_(),0),n.entries=[o],r())},a=m_("largest-contentful-paint",o);if(a){r=u_(e,n,H_,t.reportAllChanges);var l=y_((()=>{o(a.takeRecords()),a.disconnect(),r(!0)})),u=e=>{e.isTrusted&&(O_(l),removeEventListener(e.type,u,{capture:!0}))};for(var c of["keydown","click","visibilitychange"])addEventListener(c,u,{capture:!0});l_((i=>{n=p_("LCP"),r=u_(e,n,H_,t.reportAllChanges),c_((()=>{n.value=performance.now()-i.timeStamp,r(!0)}))}))}}))},onCLS(e,t){void 0===t&&(t={});var r=I_();E_(y_((()=>{var i,n=p_("CLS",0),s=__(t,v_),o=e=>{for(var t of e)s.h(t);s.i>n.value&&(n.value=s.i,n.entries=s.o,i())},a=m_("layout-shift",o);a&&(i=u_(e,n,T_,t.reportAllChanges),r.onHidden((()=>{o(a.takeRecords()),i(!0)})),l_((()=>{s.i=0,n=p_("CLS",0),i=u_(e,n,T_,t.reportAllChanges),c_((()=>i()))})),setTimeout(i))})))},onFCP:E_,onINP(e,t){if(void 0===t&&(t={}),globalThis.PerformanceEventTiming&&"interactionId"in PerformanceEventTiming.prototype){var r=I_();k_((()=>{var i;"interactionCount"in performance||f_||(f_=m_("event",P_,{type:"event",buffered:!0,durationThreshold:0}));var n,s=p_("INP"),o=__(t,N_),a=e=>{O_((()=>{for(var t of e)o.h(t);var r=o.L();r&&r.P!==s.value&&(s.value=r.P,s.entries=r.entries,n())}))},l=m_("event",a,{durationThreshold:null!==(i=t.durationThreshold)&&void 0!==i?i:40});n=u_(e,s,D_,t.reportAllChanges),l&&(l.observe({type:"first-input",buffered:!0}),r.onHidden((()=>{a(l.takeRecords()),n(!0)})),l_((()=>{o.v(),s=p_("INP"),n=u_(e,s,D_,t.reportAllChanges)})))}))}}};ns.__PosthogExtensions__=ns.__PosthogExtensions__||{},ns.__PosthogExtensions__.postHogWebVitalsCallbacks=q_,ns.postHogWebVitalsCallbacks=q_,ns.__PosthogExtensions__.loadWebVitalsCallbacks=()=>q_;class z_{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&&this.timeoutMs>r-i.timestamp){if(this.clicks.push({x:e,y:t,timestamp:r}),this.clicks.length===this.clickCount)return!0}else this.clicks=[{x:e,y:t,timestamp:r}];return!1}}var V_="$copy_autocapture",$_=cs("[AutoCapture]");function U_(e,t){return t.length>e?t.slice(0,e)+"...":t}function W_(e){if(e.previousElementSibling)return e.previousElementSibling;var t=e;do{t=t.previousSibling}while(t&&!Qo(t));return t}function j_(e,t){for(var i,n,{e:s,maskAllElementAttributes:o,maskAllText:a,elementAttributeIgnoreList:l,elementsChainAsString:u}=t,c=[e],d=e;d.parentNode&&!ea(d,"body");)ra(d.parentNode)?(c.push(d.parentNode.host),d=d.parentNode.host):(c.push(d.parentNode),d=d.parentNode);var h,p,g=[],_={},v=!1,f=!1;if(hs(c,(e=>{var t=va(e);"a"===e.tagName.toLowerCase()&&(v=e.getAttribute("href"),v=t&&v&&Ia(v)&&v),Br(sa(e),"ph-no-capture")&&(f=!0),g.push(function(e,t,r,i){var n=e.tagName.toLowerCase(),s={tag_name:n};ua.indexOf(n)>-1&&!r&&(s.$el_text="a"===n.toLowerCase()||"button"===n.toLowerCase()?U_(1024,ka(e)):U_(1024,aa(e)));var o=sa(e);o.length>0&&(s.classes=o.filter((function(e){return""!==e}))),hs(e.attributes,(function(r){var n;if((!fa(e)||-1!==["name","id","class","aria-label"].indexOf(r.name))&&(null==i||!i.includes(r.name))&&!t&&Ia(r.value)&&(!Yr(n=r.name)||"_ngcontent"!==n.substring(0,10)&&"_nghost"!==n.substring(0,7))){var o=r.value;"class"===r.name&&(o=ia(o).join(" ")),s["attr__"+r.name]=U_(1024,o)}}));for(var a=1,l=1,u=e;u=W_(u);)a++,u.tagName===e.tagName&&l++;return s.nth_child=a,s.nth_of_type=l,s}(e,o,a,l));var r=function(e){if(!va(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&&Ia(i)&&(t[r]=i)}})),t}(e);ps(_,r)})),f)return{props:{},explicitNoCapture:f};if(a||(g[0].$el_text="a"===e.tagName.toLowerCase()||"button"===e.tagName.toLowerCase()?ka(e):aa(e)),v){var m,y;g[0].attr__href=v;var b=null==(m=Cs(v))?void 0:m.host,w=null==Zn||null==(y=Zn.location)?void 0:y.host;b&&w&&b!==w&&(h=v)}return{props:ps({$event_type:s.type,$ce_version:1},u?{}:{$elements:g},{$elements_chain:(p=g,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[Ea(t.toString())]=Ea(r.toString())})),(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:Ta(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}))}(p)))},null!=(i=g[0])&&i.$el_text?{$el_text:null==(n=g[0])?void 0:n.$el_text}:{},h&&"click"===s.type?{$external_click_url:h}:{},_)}}var G_={};function Z_(e){return function(e,t){var r=G_[e];if(r)return r;var i,n=t[e];if(Wr(i=n)&&-1!==i.toString().indexOf("[native code]")&&!Zn.Zone)return G_[e]=n.bind(t);var s=t.document;if(s&&Wr(s.createElement))try{var o=s.createElement("iframe");o.hidden=!0,s.head.appendChild(o);var a=o.contentWindow;a&&a[e]&&(n=a[e]),s.head.removeChild(o)}catch(t){us.warn("Could not create sandbox iframe for "+e+" check, bailing to assignableWindow."+e+": ",t)}return n&&Wr(n)?G_[e]=n.bind(t):n}("MutationObserver",e)}function Y_(e,t){return Qr(e)&&e>=t}class X_{_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=la(e);return t?{node:t,originalEvent:e,timestamp:Date.now()}:null}(e);Kr(t)||this._ignoreClick(t)||this._clicks.push(t),this._clicks.length&&Zr(this._checkClickTimer)&&(this._checkClickTimer=ns.setTimeout((()=>{this._checkClicks()}),1e3))},this._onScroll=()=>{var e=Date.now();e%50==0&&this._clicks.forEach((t=>{Zr(t.scrollDelayMs)&&(t.scrollDelayMs=e-t.timestamp)}))},this._onSelectionChange=()=>{this._lastSelectionChanged=Date.now()},this._onVisibilityChange=()=>{"visible"===(null==Kn?void 0:Kn.visibilityState)&&(this._lastVisibilityChange=Date.now())},this.instance=e,this._config=this._asRequiredConfig(t),this._onCapture=this._config.__onCapture}start(e){this._startClickObserver(),this._startScrollObserver(),this._startSelectionChangedObserver(),this._startVisibilityChangeObserver(),this._startMutationObserver(e)}_startMutationObserver(e){if(!this._mutationObserver){var t=Z_(ns);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,ns.removeEventListener("click",this._onClick),ns.removeEventListener("scroll",this._onScroll,{capture:!0}),ns.removeEventListener("selectionchange",this._onSelectionChange),null==Kn||Kn.removeEventListener("visibilitychange",this._onVisibilityChange)}_onMutation(e){this._lastMutation=Date.now()}_startClickObserver(){bs(ns,"click",this._onClick)}_startScrollObserver(){bs(ns,"scroll",this._onScroll,{capture:!0})}_startSelectionChangedObserver(){bs(ns,"selectionchange",this._onSelectionChange)}_startVisibilityChangeObserver(){bs(Kn,"visibilitychange",this._onVisibilityChange)}_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(Jo(e.node))return!0;var r=this._clicks.some((t=>t.node===e.node&&1e3>Math.abs(t.timestamp-e.timestamp)));return!!r||!(!ea(e.node,"html")&&Qo(e.node)&&!ua.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&&this._lastMutation>=t.timestamp?this._lastMutation-t.timestamp:void 0,t.absoluteDelayMs=Date.now()-t.timestamp,t.selectionChangedDelayMs=this._lastSelectionChanged&&this._lastSelectionChanged>=t.timestamp?this._lastSelectionChanged-t.timestamp:void 0,t.visibilityChangedDelayMs=this._lastVisibilityChange?Math.abs(t.timestamp-this._lastVisibilityChange):void 0;var i=Y_(t.scrollDelayMs,this._config.scroll_threshold_ms),n=Y_(t.selectionChangedDelayMs,this._config.selection_change_threshold_ms),s=Y_(t.mutationDelayMs,this._config.mutation_threshold_ms),o=Y_(t.absoluteDelayMs,1.1*this._config.mutation_threshold_ms),a=Qr(t.scrollDelayMs)&&this._config.scroll_threshold_ms>t.scrollDelayMs,l=Qr(t.mutationDelayMs)&&this._config.mutation_threshold_ms>t.mutationDelayMs,u=Qr(t.selectionChangedDelayMs)&&this._config.selection_change_threshold_ms>t.selectionChangedDelayMs,c=Qr(t.visibilityChangedDelayMs)&&this._config.selection_change_threshold_ms>t.visibilityChangedDelayMs;if(!(a||l||u||c)){var d=Y_(t.visibilityChangedDelayMs,this._config.selection_change_threshold_ms);i||s||o||n||d?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,$dead_click_visibility_changed_timeout:d}):this._config.mutation_threshold_ms>t.absoluteDelayMs&&this._clicks.push(t)}}this._clicks.length&&Zr(this._checkClickTimer)&&(this._checkClickTimer=ns.setTimeout((()=>{this._checkClicks()}),1e3))}}_captureDeadClick(e,t){this.instance.capture("$dead_click",r({},t,j_(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,$dead_click_visibility_changed_delay_ms:e.visibilityChangedDelayMs}),{timestamp:new Date(e.timestamp)})}}ns.__PosthogExtensions__=ns.__PosthogExtensions__||{},ns.__PosthogExtensions__.initDeadClicksAutocapture=(e,t)=>new X_(e,t);var K_={DomContentLoaded:0,Load:1,FullSnapshot:2,IncrementalSnapshot:3,Meta:4,Custom:5,Plugin:6},J_="disabled",Q_="sampled",ev="active",tv="buffering",rv="paused",iv="lazy_loading",nv="awaiting_config",sv="missing_config",ov="rrweb_error",av="trigger",lv=av+"_activated",uv=av+"_pending",cv=av+"_"+J_;function dv(e,t,r){return t.some((t=>{var i;return"regex"===t.matching&&(null!==(i=null==r?void 0:r.get(t.url))&&void 0!==i?i:new RegExp(t.url)).test(e)}))}class hv{constructor(e){this._matchers=e}triggerStatus(e){var t=this._matchers.map((t=>t.triggerStatus(e)));return t.includes(lv)?lv:t.includes(uv)?uv:cv}stop(){this._matchers.forEach((e=>e.stop()))}}class pv{constructor(e){this._matchers=e}triggerStatus(e){var t=new Set;for(var r of this._matchers)t.add(r.triggerStatus(e));switch(t.delete(cv),t.size){case 0:return cv;case 1:return Array.from(t)[0];default:return uv}}stop(){this._matchers.forEach((e=>e.stop()))}}class gv{triggerStatus(){return lv}stop(){}}var _v=e=>"sessionRecording"in e;class vv{constructor(e,t){this._urlTriggers=[],this._urlBlocklist=[],this._compiledTriggerRegexes=new Map,this._compiledBlocklistRegexes=new Map,this._lastCheckedUrl="",this.urlBlocked=!1,this._instance=e,this._groupId=t}onConfig(e){var t,r;this._urlTriggers=(_v(e)?jr(e.sessionRecording)?null==(t=e.sessionRecording)?void 0:t.urlTriggers:[]:null==e?void 0:e.urlTriggers)||[],this._urlBlocklist=(_v(e)?jr(e.sessionRecording)?null==(r=e.sessionRecording)?void 0:r.urlBlocklist:[]:null==e?void 0:e.urlBlocklist)||[],this._compileRegexCache()}_compileRegexCache(){for(var e of(this._compiledTriggerRegexes.clear(),this._compiledBlocklistRegexes.clear(),this._urlTriggers))if("regex"===e.matching&&!this._compiledTriggerRegexes.has(e.url))try{this._compiledTriggerRegexes.set(e.url,new RegExp(e.url))}catch(t){us.error("Invalid URL trigger regex pattern:",e.url,t)}for(var t of this._urlBlocklist)if("regex"===t.matching&&!this._compiledBlocklistRegexes.has(t.url))try{this._compiledBlocklistRegexes.set(t.url,new RegExp(t.url))}catch(e){us.error("Invalid URL blocklist regex pattern:",t.url,e)}}onRemoteConfig(e){this.onConfig(e)}_urlTriggerStatus(e){var t;return 0===this._urlTriggers.length?cv:(null==(t=this._instance)?void 0:t.get_property(this._groupId?eo+this._groupId:Ks))===e?lv:uv}triggerStatus(e){var t=this._urlTriggerStatus(e),r=t===lv?lv:t===uv?uv:cv;return this._instance.register_for_session({[Bo]:r}),r}checkUrlBlocklist(e,t){if(void 0!==Zn&&Zn.location.href){var r=Zn.location.href;if(r!==this._lastCheckedUrl){this._lastCheckedUrl=r;var i=this.urlBlocked,n=dv(r,this._urlBlocklist,this._compiledBlocklistRegexes);i&&n||(n&&!i?e():!n&&i&&t())}}}checkUrlTriggerConditions(e,t,r,i){if(void 0!==Zn&&Zn.location.href){var n=Zn.location.href;if(n!==this._lastCheckedUrl){this._lastCheckedUrl=n;var s=this.urlBlocked,o=dv(n,this._urlBlocklist,this._compiledBlocklistRegexes);o&&!s?e():!o&&s&&t();var a=this._urlTriggerStatus(i)===lv,l=dv(n,this._urlTriggers,this._compiledTriggerRegexes);!a&&l&&r("url",n)}}}stop(){this._lastCheckedUrl=""}}class fv{constructor(e){this.linkedFlag=null,this.linkedFlagSeen=!1,this._flagListenerCleanup=()=>{},this._instance=e}triggerStatus(){var e=uv;return Jr(this.linkedFlag)&&(e=cv),this.linkedFlagSeen&&(e=lv),this._instance.register_for_session({[Fo]:e}),e}onConfig(e,t){var r;if(this.linkedFlag=(_v(e)?jr(e.sessionRecording)?null==(r=e.sessionRecording)?void 0:r.linkedFlag:null:null==e?void 0:e.linkedFlag)||null,!Jr(this.linkedFlag)&&!this.linkedFlagSeen){var i=Yr(this.linkedFlag)?this.linkedFlag:this.linkedFlag.flag,n=Yr(this.linkedFlag)?null:this.linkedFlag.variant;this._flagListenerCleanup=this._instance.onFeatureFlags(((e,r)=>{var s=!1;if(jr(r)&&i in r){var o=r[i];s=ti(o)?!0===o:n?o===n:!!o}this.linkedFlagSeen=s,s&&t(i,n)}))}}onRemoteConfig(e,t){this.onConfig(e,t)}stop(){this._flagListenerCleanup()}}class mv{constructor(e,t){this._eventTriggers=[],this._instance=e,this._groupId=t}onConfig(e){var t;this._eventTriggers=(_v(e)?jr(e.sessionRecording)?null==(t=e.sessionRecording)?void 0:t.eventTriggers:[]:null==e?void 0:e.eventTriggers)||[]}onRemoteConfig(e){this.onConfig(e)}_eventTriggerStatus(e){var t;return 0===this._eventTriggers.length?cv:(null==(t=this._instance)?void 0:t.get_property(this._groupId?Qs+this._groupId:Js))===e?lv:uv}triggerStatus(e){var t=this._eventTriggerStatus(e),r=t===lv?lv:t===uv?uv:cv;return this._instance.register_for_session({[Ao]:r}),r}checkEventTriggerConditions(e,t,r){if(0!==this._eventTriggers.length){var i=this._eventTriggerStatus(r)===lv,n=this._eventTriggers.includes(e);!i&&n&&t("event",e)}}stop(){}}class yv{constructor(e,t,r){if(this._instance=e,this.group=t,this._urlTriggerMatching=new vv(e,t.id),this._eventTriggerMatching=new mv(e,t.id),this._linkedFlagMatching=new fv(e),t.conditions.events&&t.conditions.events.length>0||t.conditions.urls&&t.conditions.urls.length>0||t.conditions.flag){var i=(t.conditions.events||[]).map((e=>e.name)),n={urlTriggers:t.conditions.urls||[],eventTriggers:i,linkedFlag:t.conditions.flag||null,urlBlocklist:[]};this._urlTriggerMatching.onConfig(n),this._eventTriggerMatching.onConfig(n),this._linkedFlagMatching.onConfig(n,r);var s=[this._eventTriggerMatching,this._urlTriggerMatching,this._linkedFlagMatching];this._combinedMatching="any"===t.conditions.matchType?new hv(s):new pv(s)}else this._combinedMatching=new gv}triggerStatus(e){return this._combinedMatching.triggerStatus(e)}checkEventTriggerConditions(e,t,r){this._eventTriggerMatching.checkEventTriggerConditions(e,t,r)}checkUrlTriggerConditions(e,t,r,i){this._urlTriggerMatching.checkUrlTriggerConditions(e,t,r,i)}activateTrigger(e,t){var r;null==(r=this._instance.persistence)||r.register({["url"===e?eo+this.group.id:Qs+this.group.id]:t})}stop(){this._urlTriggerMatching.stop(),this._eventTriggerMatching.stop(),this._linkedFlagMatching.stop()}}function bv(e){if(e.rrwebError)return ov;if(!e.receivedFlags)return tv;if(!e.isRecordingEnabled)return J_;if(e.urlTriggerMatching.urlBlocked)return rv;var t=!0===e.isSampled,r=new hv([e.eventTriggerMatching,e.urlTriggerMatching,e.linkedFlagMatching]).triggerStatus(e.sessionId);return t?Q_:r===lv?ev:r===uv?tv:!1===e.isSampled?J_:ev}function wv(e){if(e.rrwebError)return ov;if(!e.receivedFlags)return tv;if(!e.isRecordingEnabled)return J_;if(e.urlTriggerMatching.urlBlocked)return rv;var t=new pv([e.eventTriggerMatching,e.urlTriggerMatching,e.linkedFlagMatching]).triggerStatus(e.sessionId),r=t!==cv,i=ti(e.isSampled);return r&&t===uv?tv:r&&t===cv||i&&!e.isSampled?J_:!0===e.isSampled?Q_:ev}function Sv(e){var t,r;return(null==(t=JSON.stringify(e,(r=[],function(e,t){if(jr(t)){for(;r.length>0&&r[r.length-1]!==this;)r.pop();return r.includes(t)?"[Circular]":(r.push(t),t)}return t})))?void 0:t.length)||0}function Cv(e){if(Kr(e))return 4;if(Zr(e))return 0;switch(typeof e){case"string":return e.length+2;case"number":return String(e).length;case"boolean":return e?4:5;case"object":if(Ur(e)){for(var t=2,r=0;e.length>r;r++){r>0&&(t+=1);var i=e[r];t+=Zr(i)||Kr(i)?4:Cv(i)}return t}var n=e,s=2,o=!0;for(var a in n)if({}.hasOwnProperty.call(n,a)){var l=n[a];Zr(l)||(o||(s+=1),o=!1,s+=a.length+3+Cv(l))}return s;default:return 0}}class Iv{constructor(e,t){var r,i;void 0===t&&(t={}),this._loggedTracker={},this._onNodeRateLimited=e=>{if(!this._loggedTracker[e]){var t,r;this._loggedTracker[e]=!0;var i=this._getNode(e);null==(t=(r=this._options).onBlockedNode)||t.call(r,e,i)}},this._getNodeOrRelevantParent=e=>{var t=this._getNode(e);if("svg"!==(null==t?void 0:t.nodeName)&&t instanceof Element){var r=t.closest("svg");if(r)return[this._rrweb.mirror.getId(r),r]}return[e,t]},this._getNode=e=>this._rrweb.mirror.getNode(e),this._numberOfChanges=e=>{var t,r,i,n,s,o,a,l;return(null!==(t=null==(r=e.removes)?void 0:r.length)&&void 0!==t?t:0)+(null!==(i=null==(n=e.attributes)?void 0:n.length)&&void 0!==i?i:0)+(null!==(s=null==(o=e.texts)?void 0:o.length)&&void 0!==s?s:0)+(null!==(a=null==(l=e.adds)?void 0:l.length)&&void 0!==a?a:0)},this.throttleMutations=e=>{if(3!==e.type||0!==e.data.source)return e;var t=e.data,r=this._numberOfChanges(t);t.attributes&&(t.attributes=t.attributes.filter((e=>{var[t]=this._getNodeOrRelevantParent(e.id);return!this._rateLimiter.consumeRateLimit(t)&&e})));var i=this._numberOfChanges(t);return 0!==i||r===i?e:void 0},this._rrweb=e,this._options=t,this._rateLimiter=new ci({bucketSize:null!==(r=this._options.bucketSize)&&void 0!==r?r:100,refillRate:null!==(i=this._options.refillRate)&&void 0!==i?i:10,refillInterval:1e3,_onBucketRateLimited:this._onNodeRateLimited,_logger:us})}reset(){this._loggedTracker={}}stop(){this._rateLimiter.stop(),this.reset()}}var kv="$sess_rec_flush_size";class xv{constructor(e){if(!e.persistence)throw new Error("it is not valid to not have persistence and be this far into setting up the application");this._getProperty=e.get_property.bind(e),this._setProperty=e.persistence.set_property.bind(e.persistence)}trackSize(e){var t=Number(this._getProperty(kv))||0;this._setProperty(kv,t+e)}reset(){return this._setProperty(kv,0)}get currentTrackedSize(){return Number(this._getProperty(kv))||0}}function Ev(e,t){return function(e){for(var t=0,r=0;e.length>r;r++)t=(t<<5)-t+e.charCodeAt(r),t|=0;return Math.abs(t)}(e)%100<ui(100*t,0,100,us)}var Tv=cs("[SessionRecording]");class Rv{constructor(e,t,r,i,n,s){this._sampleRate=null,this._recordingStatusFunction=wv,this._instance=e,this._urlTriggerMatching=t,this._eventTriggerMatching=r,this._linkedFlagMatching=i,this._reportStarted=n,this._tryTakeFullSnapshot=s}onRemoteConfig(e){this._sampleRate=Qr(e.sampleRate)?e.sampleRate:null,"any"===e.triggerMatchType?(this._triggerStatusMatcher=new hv([this._eventTriggerMatching,this._urlTriggerMatching]),this._recordingStatusFunction=bv):(this._triggerStatusMatcher=new pv([this._eventTriggerMatching,this._urlTriggerMatching]),this._recordingStatusFunction=wv),this._instance.register_for_session({[Oo]:e.triggerMatchType}),this._urlTriggerMatching.onConfig(e),this._eventTriggerMatching.onConfig(e),this._linkedFlagMatching.onConfig(e,((e,t)=>{this._reportStarted("linked_flag_matched",{flag:e,variant:t})}))}getStatus(e){return this._recordingStatusFunction({receivedFlags:!0,isRecordingEnabled:!0,isSampled:e.isSampled,rrwebError:e.rrwebError,urlTriggerMatching:e.urlTriggerMatching,eventTriggerMatching:e.eventTriggerMatching,linkedFlagMatching:e.linkedFlagMatching,sessionId:e.sessionId})}getMinimumDuration(e){var t=this._instance.get_property("$session_recording_remote_config"),r=null==t?void 0:t.minimumDurationMilliseconds;return Qr(r)?r:null}checkUrlTriggers(e,t,r,i){this._urlTriggerMatching.checkUrlTriggerConditions(t,r,i,e)}setupEventTriggerListeners(e,t,r){if(0!==this._eventTriggerMatching._eventTriggers.length&&Jr(this._removeEventTriggerCaptureHook))return this._removeEventTriggerCaptureHook=e((e=>{try{this._eventTriggerMatching.checkEventTriggerConditions(e.event,r,t)}catch(e){Tv.error("Could not activate event trigger",e)}})),this._removeEventTriggerCaptureHook}makeSamplingDecisions(e){var t,r=this._sampleRate;if(Qr(r)){var i=this._instance.get_property(Ys),n=i===e||!1!==i&&null,s="string"==typeof i&&i!==e||!ti(n),o=s?Ev(e,r):n;s&&(o?this._reportStarted("sampled"):Tv.warn("Sample rate ("+r+") has determined that this sessionId ("+e+") will not be sent to the server.")),null==(t=this._instance.persistence)||t.register({[Ys]:!!o&&e})}else{var a;null==(a=this._instance.persistence)||a.unregister(Ys)}}onFlushComplete(){}clearConditionalRecordingPersistence(){var e,t,r,i;null==(e=this._instance.persistence)||e.unregister(Js),null==(t=this._instance.persistence)||t.unregister(Ks),null==(r=this._instance.persistence)||r.unregister(Ys),null==(i=this._instance.persistence)||i.unregister(Xs)}updateActiveTriggers(e){}hasPendingTriggers(e){var t;return(null==(t=this._triggerStatusMatcher)?void 0:t.triggerStatus(e))===uv}stop(){var e;null==(e=this._removeEventTriggerCaptureHook)||e.call(this),this._removeEventTriggerCaptureHook=void 0,this._eventTriggerMatching.stop(),this._urlTriggerMatching.stop(),this._linkedFlagMatching.stop()}}class Mv{constructor(e,t,r,i){this._triggerGroupMatchers=[],this._triggerGroupSamplingResults=new Map,this._hasCompletedInitialFlush=!1,this._instance=e,this._urlTriggerMatching=t,this._reportStarted=r,this._tryAddCustomEvent=i}onRemoteConfig(e){e.triggerGroups&&0!==e.triggerGroups.length?(this._setupTriggerGroups(e.triggerGroups),this._instance.register_for_session({[Oo]:"v2_trigger_groups",[Do]:e.triggerGroups.length}),this._urlTriggerMatching.onConfig(e)):Tv.warn("[V2Strategy] No trigger groups configured")}getStatus(e){return function(e){if(e.rrwebError)return ov;if(e.urlTriggerMatching.urlBlocked)return rv;var t=e.triggerGroupMatchers,r=e.triggerGroupSamplingResults;if(0===t.length)return J_;var i=!1,n=!1;for(var s of t){var o=s.triggerStatus(e.sessionId);if(o===lv){var a=s.group.id,l=r.get(a);Zr(l)?us.warn("[V2 Triggers] Group activated but no sampling decision found",{groupId:a}):!0===l&&(n=!0)}else o===uv&&(i=!0)}return n?Q_:i?tv:J_}({isSampled:e.isSampled,rrwebError:e.rrwebError,urlTriggerMatching:e.urlTriggerMatching,eventTriggerMatching:e.eventTriggerMatching,linkedFlagMatching:e.linkedFlagMatching,sessionId:e.sessionId,triggerGroupMatchers:this._triggerGroupMatchers,triggerGroupSamplingResults:this._triggerGroupSamplingResults,minimumDuration:this.getMinimumDuration(e.sessionId)})}getMinimumDuration(e){var t=null;for(var r of this._triggerGroupMatchers)if("trigger_activated"===r.triggerStatus(e)){var i=r.group.minDurationMs;Qr(i)&&(Kr(t)||t>i)&&(t=i)}return t}checkUrlTriggers(e,t,r,i){var n=this;this._urlTriggerMatching.checkUrlBlocklist(t,r);var s=function(i){i.checkUrlTriggerConditions(t,r,(t=>{n._checkGroupLevelProperties(i,void 0)&&(i.activateTrigger(t,e),n.updateActiveTriggers(e))}),e)};for(var o of this._triggerGroupMatchers)s(o)}setupEventTriggerListeners(e,t,r){var i=this;return this._removeEventTriggerCaptureHook=e((e=>{var r;if(this._hasCompletedInitialFlush)return Tv.info("[SessionRecorder] Stopping trigger checks - initial buffer flushed"),null==(r=this._removeEventTriggerCaptureHook)||r.call(this),void(this._removeEventTriggerCaptureHook=void 0);try{var n=function(r){r.checkEventTriggerConditions(e.event,(n=>{if(i._checkGroupLevelProperties(r,e.properties)){var s=(r.group.conditions.events||[]).filter((t=>t.name===e.event)),o=i._instance.get_property(ho),a=s.some((t=>!t.properties||0===t.properties.length||zc(t.properties,e.properties,o)));a&&(r.activateTrigger(n,t),i.updateActiveTriggers(t))}}),t)};for(var s of this._triggerGroupMatchers)n(s)}catch(e){Tv.error("Could not activate event trigger for trigger groups",e)}})),this._removeEventTriggerCaptureHook}makeSamplingDecisions(e){for(var t of this._triggerGroupMatchers){var r,i=t.group,n=i.id,s=i.sampleRate,o=to+n,a=this._instance.get_property(o),l=a===e||!1!==a&&null,u="string"==typeof a&&a!==e||!ti(l),c=u?Ev(e+n,s):l;u&&this._tryAddCustomEvent("triggerGroupSamplingDecisionMade",{group_id:n,group_name:i.name,sampleRate:s,isSampled:c}),this._triggerGroupSamplingResults.set(n,c),null==(r=this._instance.persistence)||r.register({[o]:!!c&&e})}this.updateActiveTriggers(e)}onFlushComplete(){this._hasCompletedInitialFlush=!0}clearConditionalRecordingPersistence(){var e,t;for(var r of(null==(e=this._instance.persistence)||e.unregister(Ys),null==(t=this._instance.persistence)||t.unregister(Xs),this._triggerGroupMatchers)){var i,n,s,o=r.group.id;null==(i=this._instance.persistence)||i.unregister(Qs+o),null==(n=this._instance.persistence)||n.unregister(eo+o),null==(s=this._instance.persistence)||s.unregister(to+o)}}updateActiveTriggers(e){var t=[];for(var r of this._triggerGroupMatchers){var i=r.group,n=i.id,s="trigger_activated"===r.triggerStatus(e),o=!0===this._triggerGroupSamplingResults.get(n);s&&t.push({id:n,name:i.name,matched:!0,sampled:o})}this._instance.register_for_session({[No]:t})}hasPendingTriggers(e){for(var t of this._triggerGroupMatchers)if(t.triggerStatus(e)===uv)return!0;return!1}stop(){var e;null==(e=this._removeEventTriggerCaptureHook)||e.call(this),this._removeEventTriggerCaptureHook=void 0,this._triggerGroupMatchers.forEach((e=>e.stop())),this._triggerGroupMatchers=[],this._triggerGroupSamplingResults.clear(),this._urlTriggerMatching.stop()}_checkGroupLevelProperties(e,t){var r=e.group.conditions.properties;return!r||0===r.length||zc(r,t,this._instance.get_property(ho))}_setupTriggerGroups(e){var t=this;this._triggerGroupMatchers.forEach((e=>e.stop())),this._triggerGroupMatchers=[],this._triggerGroupSamplingResults.clear();var r=function(e){var r=new yv(t._instance,e,((r,i)=>{t._reportStarted("linked_flag_matched",{flag:r,variant:i,group_id:e.id,group_name:e.name})}));t._triggerGroupMatchers.push(r)};for(var i of e)r(i)}}function Lv(e){return jr(e)?e.network_timing:e}var Pv,Av=36e5,Fv="[SessionRecording]",Nv=cs(Fv),Ov=[1,2,3,4,5,6,7,12],Dv=e=>({rrwebMethod:e,enqueuedAt:Date.now(),attempt:1});function Bv(){var e;return null==ns||null==(e=ns.__PosthogExtensions__)?void 0:e.rrweb}function Hv(){var e;return null==(e=Bv())?void 0:e.record}function qv(e){return function(e,t){for(var r="",i=0;e.length>i;){var n=e[i++];r+=String.fromCharCode(n)}return r}(kc(xc(JSON.stringify(e))))}function zv(e){return Ur(e)&&0===e.length?Pv=null!=Pv?Pv:qv([]):qv(e)}function Vv(e,t){return e.type===K_.Custom&&e.data.tag===t}function $v(e){return Vv(e,"sessionIdle")}function Uv(e){return Vv(e,"$session_ending")}function Wv(e){return Vv(e,"$session_starting")}function jv(e,t){if(void 0===t&&(t=6606028.8),e.size>=t&&e.data.length>1){var r=Math.floor(e.data.length/2),i=e.sizes.slice(0,r),n=e.sizes.slice(r);return[jv({size:i.reduce(((e,t)=>e+t),0),data:e.data.slice(0,r),sizes:i,sessionId:e.sessionId,windowId:e.windowId}),jv({size:n.reduce(((e,t)=>e+t),0),data:e.data.slice(r),sizes:n,sessionId:e.sessionId,windowId:e.windowId})].flatMap((e=>e))}return[e]}class Gv{get sessionId(){return this._sessionId}get _sessionManager(){if(!this._instance.sessionManager)throw new Error(Fv+" must be started with a valid sessionManager.");return this._instance.sessionManager}get _sessionIdleThresholdMilliseconds(){return this._instance.config.session_recording.session_idle_threshold_ms||3e5}get _isSampled(){var e=this._instance.get_property(Ys);return!0===e?null:!1!==e&&(Yr(e)?e===this.sessionId:null)}get _sampleRate(){var e,t=null==(e=this._remoteConfig)?void 0:e.sampleRate;return Qr(t)?t:null}get _minimumDuration(){var e,t;return null!==(e=null==(t=this._strategy)?void 0:t.getMinimumDuration(this.sessionId))&&void 0!==e?e:null}constructor(e){this._endpoint="/s/",this._forceAllowLocalhostNetworkCapture=!1,this._stopRrweb=void 0,this._lastActivityTimestamp=Date.now(),this._isActivatingTrigger=!1,this._queuedRRWebEvents=[],this._isIdle="unknown",this._rrwebError=!1,this._maxDepthExceeded=!1,this._fullSnapshotTimestamps=[],this._removePageViewCaptureHook=void 0,this._removeEventTriggerCaptureHook=void 0,this._onSessionIdListener=void 0,this._onSessionIdleResetForcedListener=void 0,this._samplingSessionListener=void 0,this._forceIdleSessionIdListener=void 0,this._onSessionIdCallback=(e,t,r)=>{var i,n;if(r&&(e!==this._sessionId||t!==this._windowId)){var s,o,a=!r.noSessionId&&(r.activityTimeout||r.sessionPastMaximumLength),l=this._sessionId,u=this._windowId;a&&this._tryAddCustomEvent("$session_ending",{currentSessionId:l,currentWindowId:u,nextSessionId:e,nextWindowId:t,changeReason:r,lastActivityTimestamp:this._lastActivityTimestamp,flushed_size:null==(s=this._flushedSizeTracker)?void 0:s.currentTrackedSize}),this._flushedSizeTracker&&this._flushedSizeTracker.reset(),null==(i=this._instance.persistence)||i.unregister(ro),this._maxDepthExceeded=!1,null==(n=Bv())||null==n.resetMaxDepthState||n.resetMaxDepthState(),this._tryAddCustomEvent("$session_id_change",{sessionId:e,windowId:t,changeReason:r}),this._clearConditionalRecordingPersistence(),!0===this._isIdle&&(this._isIdle="unknown",this.stop(),this.start("session_id_changed")),a&&this._tryAddCustomEvent("$session_starting",{previousSessionId:l,previousWindowId:u,nextSessionId:e,nextWindowId:t,changeReason:r,lastActivityTimestamp:this._lastActivityTimestamp}),Qr(this._sampleRate)&&Jr(this._samplingSessionListener)&&(null==(o=this._strategy)||o.makeSamplingDecisions(e))}},this._hasPassedMinimumDuration=()=>{var e;return(null==(e=this._instance.persistence)?void 0:e.props[Xs])===this._sessionId},this._getBufferDuration=()=>{var e,t;if(0===this._buffer.data.length)return null;var r=null==(e=this._buffer.data[0])?void 0:e.timestamp,i=null==(t=this._buffer.data[this._buffer.data.length-1])?void 0:t.timestamp;return Qr(r)&&Qr(i)?i-r:null},this._isBelowMinimumDuration=()=>{var e,t,r=this._minimumDuration;if(!Qr(r))return!1;if(null===(e=null==(t=this._instance.config.session_recording)?void 0:t.strictMinimumDuration)||void 0===e||!e){var i=this._sessionDuration;return Qr(i)&&i>=0&&r>i}if(this._hasPassedMinimumDuration())return!1;var n,s=this._getBufferDuration();return!!Kr(s)||r>s||(null==(n=this._instance.persistence)||n.register({[Xs]:this._sessionId}),!1)},this._onBeforeUnload=()=>{this.status!==tv?this._flushBuffer():this._clearBuffer()},this._onOffline=()=>{this._tryAddCustomEvent("browser offline",{})},this._onOnline=()=>{this._tryAddCustomEvent("browser online",{})},this._onVisibilityChange=()=>{null!=Kn&&Kn.visibilityState&&this._tryAddCustomEvent("window "+Kn.visibilityState,{})},this._instance=e;var{sessionId:t,windowId:r}=this._sessionManager.checkAndGetSessionAndWindowId();this._sessionId=t,this._windowId=r,this._linkedFlagMatching=new fv(this._instance),this._urlTriggerMatching=new vv(this._instance),this._eventTriggerMatching=new mv(this._instance),this._buffer=this._clearBuffer(),this._sessionManager.sessionTimeoutMs>this._sessionIdleThresholdMilliseconds||Nv.warn("session_idle_threshold_ms ("+this._sessionIdleThresholdMilliseconds+") is greater than the session timeout ("+this._sessionManager.sessionTimeoutMs+"). Session will never be detected as idle"),this._flushedSizeTracker=new xv(this._instance)}get _masking(){var e,t,r,i,n,s,o,a=null==(e=this._remoteConfig)?void 0:e.masking,l={maskAllInputs:null==(t=this._instance.config.session_recording)?void 0:t.maskAllInputs,maskTextSelector:null==(r=this._instance.config.session_recording)?void 0:r.maskTextSelector,blockSelector:null==(i=this._instance.config.session_recording)?void 0:i.blockSelector},u=null!==(n=null==l?void 0:l.maskAllInputs)&&void 0!==n?n:null==a?void 0:a.maskAllInputs,c=null!==(s=null==l?void 0:l.maskTextSelector)&&void 0!==s?s:null==a?void 0:a.maskTextSelector,d=null!==(o=null==l?void 0:l.blockSelector)&&void 0!==o?o:null==a?void 0:a.blockSelector;return Zr(u)&&Zr(c)&&Zr(d)?void 0:{maskAllInputs:null==u||u,maskTextSelector:c,blockSelector:d}}get _canvasRecording(){var e,t,r,i,n,s,o,a=this._instance.config.session_recording.captureCanvas,l=null==(e=this._remoteConfig)?void 0:e.canvasRecording,u=null!==(t=null!==(r=null==a?void 0:a.recordCanvas)&&void 0!==r?r:null==l?void 0:l.enabled)&&void 0!==t&&t,c=null!==(i=null!==(n=null==a?void 0:a.canvasFps)&&void 0!==n?n:null==l?void 0:l.fps)&&void 0!==i?i:4,d=null!==(s=null!==(o=null==a?void 0:a.canvasQuality)&&void 0!==o?o:null==l?void 0:l.quality)&&void 0!==s?s:.4;if("string"==typeof d){var h=parseFloat(d);d=isNaN(h)?.4:h}return{enabled:u,fps:ui(c,0,12,cs("canvas recording fps"),4),quality:ui(d,0,1,cs("canvas recording quality"),.4)}}get _isConsoleLogCaptureEnabled(){var e,t=!(null==(e=this._remoteConfig)||!e.consoleLogRecordingEnabled),r=this._instance.config.enable_recording_console_log;return null!=r?r:t}get _networkPayloadCapture(){var e,t,r,i=null==(e=this._remoteConfig)?void 0:e.networkPayloadCapture,n={recordHeaders:null==(t=this._instance.config.session_recording)?void 0:t.recordHeaders,recordBody:null==(r=this._instance.config.session_recording)?void 0:r.recordBody},s=(null==n?void 0:n.recordHeaders)||(null==i?void 0:i.recordHeaders),o=(null==n?void 0:n.recordBody)||(null==i?void 0:i.recordBody),a=Lv(this._instance.config.capture_performance),l=Lv(null==i?void 0:i.capturePerformance),u=!!(ti(a)?a:l);return s||o||u?{recordHeaders:s,recordBody:o,recordPerformance:u}:void 0}_gatherRRWebPlugins(){var e,t,i=[],n=null==(e=ns.__PosthogExtensions__)||null==(e=e.rrwebPlugins)?void 0:e.getRecordConsolePlugin;n&&this._isConsoleLogCaptureEnabled&&i.push(n());var s,o,a,l,u,c,d,h,p,g,_,v=null==(t=ns.__PosthogExtensions__)||null==(t=t.rrwebPlugins)?void 0:t.getRecordNetworkPlugin;return this._networkPayloadCapture&&Wr(v)&&(!Ss.includes(location.hostname)||this._forceAllowLocalhostNetworkCapture?i.push(v((u={payloadSizeLimitBytes:La.payloadSizeLimitBytes,performanceEntryTypeToObserve:[...La.performanceEntryTypeToObserve],payloadHostDenyList:[...(o=this._networkPayloadCapture).payloadHostDenyList||[],...La.payloadHostDenyList]},c=!1!==(s=this._instance.config).session_recording.recordHeaders&&o.recordHeaders,d=!1!==s.session_recording.recordBody&&o.recordBody,h=!1!==s.capture_performance&&o.recordPerformance,l=Math.min(1e6,null!==(a=u.payloadSizeLimitBytes)&&void 0!==a?a:1e6),p=e=>(null!=e&&e.requestBody&&(e.requestBody=Na(e.requestBody,e.requestHeaders,l,"Request")),null!=e&&e.responseBody&&(e.responseBody=Na(e.responseBody,e.responseHeaders,l,"Response")),e),g=e=>{return p(((e,t)=>{var r,i=Cs(e.name),n=0===t.indexOf("http")?null==(r=Cs(t))?void 0:r.pathname:t;"/"===n&&(n="");var s=null==i?void 0:i.pathname.replace(n||"","");if(!(i&&s&&Fa.some((e=>0===s.indexOf(e)))))return e})((Jr(r=(t=e).requestHeaders)||hs(Object.keys(null!=r?r:{}),(e=>{Pa.includes(e.toLowerCase())&&(r[e]=Ma)})),t),s.api_host));var t,r},(_=Wr(s.session_recording.maskNetworkRequestFn))&&Wr(s.session_recording.maskCapturedNetworkRequestFn)&&us.warn("Both `maskNetworkRequestFn` and `maskCapturedNetworkRequestFn` are defined. `maskNetworkRequestFn` will be ignored."),_&&(s.session_recording.maskCapturedNetworkRequestFn=e=>{var t=s.session_recording.maskNetworkRequestFn({url:e.name});return r({},e,{name:null==t?void 0:t.url})}),u.maskRequestFn=Wr(s.session_recording.maskCapturedNetworkRequestFn)?e=>{var t,r=g(e);return r&&null!==(t=null==s.session_recording.maskCapturedNetworkRequestFn?void 0:s.session_recording.maskCapturedNetworkRequestFn(r))&&void 0!==t?t:void 0}:e=>function(e){if(!Zr(e))return e.requestBody=Oa(e.requestBody,"Request"),e.responseBody=Oa(e.responseBody,"Response"),e}(g(e)),r({},La,u,{recordHeaders:c,recordBody:d,recordPerformance:h,recordInitialRequests:h})))):Nv.info("NetworkCapture not started because we are on localhost.")),i}_maskUrl(e){var t=this._instance.config.session_recording;if(t.maskCapturedNetworkRequestFn){var r,i=t.maskCapturedNetworkRequestFn({name:e});return null!==(r=null==i?void 0:i.name)&&void 0!==r?r:null==i?void 0:i.url}if(t.maskNetworkRequestFn){var n=t.maskNetworkRequestFn({url:e});return null==n?void 0:n.url}return e}_tryRRWebMethod(e){try{return e.rrwebMethod(),!0}catch(t){return 10>this._queuedRRWebEvents.length?this._queuedRRWebEvents.push({enqueuedAt:e.enqueuedAt||Date.now(),attempt:e.attempt+1,rrwebMethod:e.rrwebMethod}):Nv.warn("could not emit queued rrweb event.",t,e),!1}}_tryAddCustomEvent(e,t){return this._tryRRWebMethod(Dv((()=>Hv().addCustomEvent(e,t))))}_pageViewFallBack(){try{if(this._instance.config.capture_pageview||!Zn)return;var e=new URL(Zn.location.href),t=this._maskUrl(e.origin+e.pathname+e.search);this._lastHref!==t&&(this._lastHref=t,this._tryAddCustomEvent("$url_changed",{href:t}))}catch(e){}}_processQueuedEvents(){if(this._queuedRRWebEvents.length){var e=[...this._queuedRRWebEvents];this._queuedRRWebEvents=[],e.forEach((e=>{Date.now()-e.enqueuedAt>2e3||this._tryRRWebMethod(e)}))}}_tryTakeFullSnapshot(){return this._tryRRWebMethod(Dv((()=>Hv().takeFullSnapshot())))}get _fullSnapshotIntervalMillis(){var e,t,r;return null!=(e=this._strategy)&&e.hasPendingTriggers(this.sessionId)&&!["sampled","active"].includes(this.status)?6e4:null!==(t=null==(r=this._instance.config.session_recording)?void 0:r.full_snapshot_interval_millis)&&void 0!==t?t:3e5}_scheduleFullSnapshot(){if(this._fullSnapshotTimer&&clearInterval(this._fullSnapshotTimer),!0!==this._isIdle){var e=this._fullSnapshotIntervalMillis;e&&(this._fullSnapshotTimer=setInterval((()=>{this._tryTakeFullSnapshot()}),e))}}_pauseRecording(){this._urlTriggerMatching.urlBlocked||(this._urlTriggerMatching.urlBlocked=!0,clearInterval(this._fullSnapshotTimer),Nv.info("recording paused due to URL blocker"),this._tryAddCustomEvent("recording paused",{reason:"url blocker"}))}_resumeRecording(){this._urlTriggerMatching.urlBlocked&&(this._urlTriggerMatching.urlBlocked=!1,this._tryTakeFullSnapshot(),this._scheduleFullSnapshot(),this._tryAddCustomEvent("recording resumed",{reason:"left blocked url"}),Nv.info("recording resumed"))}_activateTrigger(e,t){var r;if(!this._isActivatingTrigger&&null!=(r=this._strategy)&&r.hasPendingTriggers(this.sessionId)){this._isActivatingTrigger=!0;try{var i,n;null==(i=this._instance.persistence)||i.register({["url"===e?Ks:Js]:this.sessionId}),null==(n=this._strategy)||n.updateActiveTriggers(this.sessionId),this._flushBuffer(),this._reportStarted(e+"_trigger_matched",{["url"===e?"matchedUrl":"matchedEvent"]:t})}finally{this._isActivatingTrigger=!1}}}get isStarted(){return!!this._stopRrweb}get _remoteConfig(){var e=this._instance.get_property($s);if(e){var t=jr(e)?e:JSON.parse(e);if(!this.isStarted){var r,i,n=null!==(r=t.cache_timestamp)&&void 0!==r?r:Date.now();if(Date.now()-n>Av)return Nv.info("persisted remote config for session recording is stale and will be ignored",{cacheTimestamp:n,persistedConfig:e}),void(null==(i=this._instance.persistence)||i.unregister($s))}return t}}_checkOverride(e,t,r){this._instance.get_property(e)&&(t(),r())}start(e){var t,r,i=this._remoteConfig;if(i){var{sessionId:n,windowId:s}=this._sessionManager.checkAndGetSessionAndWindowId();this._sessionId=n,this._windowId=s,null==(t=this._instance.persistence)||t.unregister(ro),null!=i&&i.endpoint&&(this._endpoint=null==i?void 0:i.endpoint),this._strategy=2===(null==i?void 0:i.version)&&(null==i?void 0:i.triggerGroups)&&i.triggerGroups.length>0?new Mv(this._instance,this._urlTriggerMatching,this._reportStarted.bind(this),this._tryAddCustomEvent.bind(this)):new Rv(this._instance,this._urlTriggerMatching,this._eventTriggerMatching,this._linkedFlagMatching,this._reportStarted.bind(this),this._tryTakeFullSnapshot.bind(this)),this._strategy.onRemoteConfig(i),null==(r=this._removeEventTriggerCaptureHook)||r.call(this),this._removeEventTriggerCaptureHook=this._strategy.setupEventTriggerListeners(this._instance.on.bind(this._instance,"eventCaptured"),this.sessionId,((e,t)=>this._activateTrigger(e,t))),this._checkOverride(Us,(()=>{this.overrideSampling()}),(()=>{var e;return null==(e=this._instance.persistence)?void 0:e.unregister(Us)})),this._checkOverride(Ws,(()=>{this.overrideLinkedFlag()}),(()=>{var e;return null==(e=this._instance.persistence)?void 0:e.unregister(Ws)})),this._checkOverride(Gs,(()=>{this.overrideTrigger("event")}),(()=>{var e;return null==(e=this._instance.persistence)?void 0:e.unregister(Gs)})),this._checkOverride(js,(()=>{this.overrideTrigger("url")}),(()=>{var e;return null==(e=this._instance.persistence)?void 0:e.unregister(js)})),this._strategy.makeSamplingDecisions(this.sessionId),this._startRecorder(),this._rrwebError||(bs(Zn,"beforeunload",this._onBeforeUnload),bs(Zn,"offline",this._onOffline),bs(Zn,"online",this._onOnline),bs(Zn,"visibilitychange",this._onVisibilityChange),this._onSessionIdListener||(this._onSessionIdListener=this._sessionManager.onSessionId(this._onSessionIdCallback)),this._onSessionIdleResetForcedListener||(this._onSessionIdleResetForcedListener=this._sessionManager.on("forcedIdleReset",(()=>{this._clearConditionalRecordingPersistence(),this._isIdle="unknown",this.stop(),this._forceIdleSessionIdListener=this._sessionManager.onSessionId(((e,t,r)=>{var i;null==(i=this._forceIdleSessionIdListener)||i.call(this),this._forceIdleSessionIdListener=void 0,this._onSessionIdCallback(e,t,r)}))}))),Jr(this._removePageViewCaptureHook)&&(this._removePageViewCaptureHook=this._instance.on("eventCaptured",(e=>{try{if("$pageview"===e.event){var t=null!=e&&e.properties.$current_url?this._maskUrl(null==e?void 0:e.properties.$current_url):"";if(!t)return;this._tryAddCustomEvent("$pageview",{href:t})}}catch(e){Nv.error("Could not add $pageview to rrweb session",e)}}))),this.status===ev&&this._reportStarted(e||"recording_initialized"))}else Nv.info("remote config must be stored in persistence before recording can start")}_teardown(){var e,t,r,i,n,s,o,a,l;null==Zn||Zn.removeEventListener("beforeunload",this._onBeforeUnload),null==Zn||Zn.removeEventListener("offline",this._onOffline),null==Zn||Zn.removeEventListener("online",this._onOnline),null==Zn||Zn.removeEventListener("visibilitychange",this._onVisibilityChange),clearInterval(this._fullSnapshotTimer),this._clearFlushBufferTimer(),null==(e=this._removePageViewCaptureHook)||e.call(this),this._removePageViewCaptureHook=void 0,null==(t=this._removeEventTriggerCaptureHook)||t.call(this),this._removeEventTriggerCaptureHook=void 0,null==(r=this._onSessionIdListener)||r.call(this),this._onSessionIdListener=void 0,null==(i=this._onSessionIdleResetForcedListener)||i.call(this),this._onSessionIdleResetForcedListener=void 0,null==(n=this._samplingSessionListener)||n.call(this),this._samplingSessionListener=void 0,null==(s=this._forceIdleSessionIdListener)||s.call(this),this._forceIdleSessionIdListener=void 0,null==(o=this._strategy)||o.stop(),null==(a=this._mutationThrottler)||a.stop(),this._queuedRRWebEvents=[],null==(l=this._stopRrweb)||l.call(this),this._stopRrweb=void 0}stop(){this._flushBuffer(),this._clearBuffer(),this._teardown(),Nv.info("stopped")}discard(){this._clearBuffer(),this._teardown(),Nv.info("discarded")}onRRwebEmit(e){var t,i,n,s,o,a,l,u;if(this._processQueuedEvents(),e&&jr(e)){if(e.type===K_.Meta){var c=this._maskUrl(e.data.href);if(this._lastHref=c,!c)return;e.data.href=c}else this._pageViewFallBack();if(null==(t=this._strategy)||t.checkUrlTriggers(this.sessionId,(()=>this._pauseRecording()),(()=>this._resumeRecording()),((e,t)=>this._activateTrigger(e,t))),!this._urlTriggerMatching.urlBlocked||function(e){return e.type===K_.Custom&&"recording paused"===e.data.tag}(e)){var d,h;e.type===K_.FullSnapshot&&(this._scheduleFullSnapshot(),null==(d=this._mutationThrottler)||d.reset(),null==(h=this._instance.persistence)||h.register_once({[ro]:e.timestamp},void 0)),e.type===K_.FullSnapshot&&null!=(i=this._strategy)&&i.hasPendingTriggers(this.sessionId)&&this._clearBufferBeforeMostRecentMeta();var p=this._mutationThrottler?this._mutationThrottler.throttleMutations(e):e;if(p){var g=function(e){var t=e;if(t&&jr(t)&&6===t.type&&jr(t.data)&&"rrweb/console@1"===t.data.plugin){t.data.payload.payload.length>10&&(t.data.payload.payload=t.data.payload.payload.slice(0,10),t.data.payload.payload.push("...[truncated]"));for(var r=[],i=0;t.data.payload.payload.length>i;i++)r.push(t.data.payload.payload[i]&&t.data.payload.payload[i].length>2e3?t.data.payload.payload[i].slice(0,2e3)+"...[truncated]":t.data.payload.payload[i]);return t.data.payload.payload=r,e}return e}(p),_=function(e){return Uv(e)?e.data.payload:null}(g),v=function(e){return Wv(e)?e.data.payload:null}(g);if(_||v){var f=null!=_?_:v;null!=f&&f.lastActivityTimestamp&&(g.timestamp=f.lastActivityTimestamp)}else this._updateWindowAndSessionIds(g);e.type===K_.FullSnapshot&&(this._fullSnapshotTimestamps.push([this._sessionId,e.timestamp]),this._fullSnapshotTimestamps.length>6&&(this._fullSnapshotTimestamps=this._fullSnapshotTimestamps.slice(-6)));var m=null!==(n=null!==(s=null==_?void 0:_.currentSessionId)&&void 0!==s?s:null==v?void 0:v.nextSessionId)&&void 0!==n?n:this._sessionId,y=null!==(o=null!==(a=null==_?void 0:_.currentWindowId)&&void 0!==a?a:null==v?void 0:v.nextWindowId)&&void 0!==o?o:this._windowId;if(!0!==this._isIdle||function(e){return $v(e)||Uv(e)||Wv(e)}(g)){if($v(g)){var b=g.data.payload;b&&(g.timestamp=b.lastActivityTimestamp+b.threshold)}var{event:w,size:S}=null===(l=this._instance.config.session_recording.compress_events)||void 0===l||l?function(e){try{if(e.type===K_.FullSnapshot){var t=r({},e,{data:qv(e.data),cv:"2024-10"});return{event:t,size:Cv(t)}}if(e.type===K_.IncrementalSnapshot&&0===e.data.source){var i=r({},e,{cv:"2024-10",data:r({},e.data,{texts:zv(e.data.texts),attributes:zv(e.data.attributes),removes:zv(e.data.removes),adds:zv(e.data.adds)})});return{event:i,size:Cv(i)}}if(e.type===K_.IncrementalSnapshot&&8===e.data.source){var n=r({},e,{cv:"2024-10",data:r({},e.data,{adds:e.data.adds?qv(e.data.adds):void 0,removes:e.data.removes?qv(e.data.removes):void 0})});return{event:n,size:Cv(n)}}}catch(e){Nv.error("could not compress event - will use uncompressed event",e)}return{event:e,size:Sv(e)}}(g):{event:g,size:Sv(g)},C={$snapshot_bytes:S,$snapshot_data:w,$session_id:m,$window_id:y};g.type===K_.FullSnapshot&&null!=(u=Bv())&&null!=u.wasMaxDepthReached&&u.wasMaxDepthReached()&&(this._maxDepthExceeded=!0),this.status!==J_?this._captureSnapshotBuffered(C):this._clearBuffer()}}}}}get status(){return this._strategy?this._strategy.getStatus({instance:this._instance,sessionId:this.sessionId,isSampled:this._isSampled,rrwebError:this._rrwebError,urlTriggerMatching:this._urlTriggerMatching,eventTriggerMatching:this._eventTriggerMatching,linkedFlagMatching:this._linkedFlagMatching,remoteConfig:this._remoteConfig}):J_}log(e,t){var r;void 0===t&&(t="log"),null==(r=this._instance.sessionRecording)||r.onRRwebEmit({type:6,data:{plugin:"rrweb/console@1",payload:{level:t,trace:[],payload:[JSON.stringify(e)]}},timestamp:Date.now()})}overrideLinkedFlag(){this._linkedFlagMatching.linkedFlagSeen=!0,this._tryTakeFullSnapshot(),this._reportStarted("linked_flag_overridden")}overrideSampling(){var e;null==(e=this._instance.persistence)||e.register({[Ys]:this.sessionId}),this._tryTakeFullSnapshot(),this._reportStarted("sampling_overridden")}overrideTrigger(e){this._activateTrigger(e)}_clearFlushBufferTimer(){this._flushBufferTimer&&(clearTimeout(this._flushBufferTimer),this._flushBufferTimer=void 0)}_flushBuffer(){this._clearFlushBufferTimer();var e,t=this._isBelowMinimumDuration();return this.status===tv||this.status===rv||this.status===J_||t?(this._flushBufferTimer=setTimeout((()=>{this._flushBuffer()}),2e3),this._buffer):(this._buffer.data.length>0&&(jv(this._buffer).forEach((e=>{var t;null==(t=this._flushedSizeTracker)||t.trackSize(e.size),this._captureSnapshot({$snapshot_bytes:e.size,$snapshot_data:e.data,$session_id:e.sessionId,$window_id:e.windowId,$lib:as.LIB_NAME,$lib_version:as.LIB_VERSION})})),null==(e=this._strategy)||e.onFlushComplete()),this._clearBuffer())}_captureSnapshotBuffered(e){var t,r=2+((null==(t=this._buffer)?void 0:t.data.length)||0),i=e.$session_id;this._isIdle||943718.4>=this._buffer.size+e.$snapshot_bytes+r&&this._buffer.sessionId===i||(this._buffer=this._flushBuffer(),this._buffer.sessionId=i,this._buffer.windowId=e.$window_id),this._buffer.size+=e.$snapshot_bytes,this._buffer.data.push(e.$snapshot_data),this._buffer.sizes.push(e.$snapshot_bytes),this._flushBufferTimer||this._isIdle||(this._flushBufferTimer=setTimeout((()=>{this._flushBuffer()}),2e3))}_captureSnapshot(e){this._instance.capture("$snapshot",e,{_url:this._instance.requestRouter.endpointFor("api",this._endpoint),_noTruncate:!0,_batchKey:"recordings",skip_client_rate_limiting:!0})}get _sessionDuration(){var e,t,r=null==(e=this._buffer)?void 0:e.data[(null==(t=this._buffer)?void 0:t.data.length)-1],{sessionStartTimestamp:i}=this._sessionManager.checkAndGetSessionAndWindowId(!0);return r?r.timestamp-i:null}_clearBufferBeforeMostRecentMeta(){if(!this._buffer||0===this._buffer.data.length)return this._clearBuffer();for(var e=-1,t=this._buffer.data.length-1;t>=0;t--)if(this._buffer.data[t].type===K_.Meta){e=t;break}return 0>e?this._clearBuffer():(this._buffer.data=this._buffer.data.slice(e),this._buffer.sizes=this._buffer.sizes.slice(e),this._buffer.size=this._buffer.sizes.reduce(((e,t)=>e+t),0),this._buffer)}_clearBuffer(){return this._buffer={size:0,data:[],sizes:[],sessionId:this._sessionId,windowId:this._windowId},this._buffer}_reportStarted(e,t){this._instance.register_for_session({[Ho]:e}),Nv.info(e.replace("_"," "),t),"session_id_changed"!==e&&this._tryAddCustomEvent("$recording_started",r({reason:e},t))}_isInteractiveEvent(e){var t;return 3===e.type&&-1!==Ov.indexOf(null==(t=e.data)?void 0:t.source)}_updateWindowAndSessionIds(e){var t=this._isInteractiveEvent(e);t||this._isIdle||e.timestamp-this._lastActivityTimestamp>this._sessionIdleThresholdMilliseconds&&(this._isIdle=!0,clearInterval(this._fullSnapshotTimer),this._tryAddCustomEvent("sessionIdle",{eventTimestamp:e.timestamp,lastActivityTimestamp:this._lastActivityTimestamp,threshold:this._sessionIdleThresholdMilliseconds,bufferLength:this._buffer.data.length,bufferSize:this._buffer.size}),this._flushBuffer());var r=!1;if(t&&(this._lastActivityTimestamp=e.timestamp,this._isIdle)){var i="unknown"===this._isIdle;this._isIdle=!1,i||(this._tryAddCustomEvent("sessionNoLongerIdle",{reason:"user activity",type:e.type}),r=!0)}if(!this._isIdle){var{windowId:n,sessionId:s}=this._sessionManager.checkAndGetSessionAndWindowId(!t,e.timestamp),o=this._sessionId!==s,a=this._windowId!==n;this._windowId=n,this._sessionId=s,o||a?(this.stop(),this.start("session_id_changed")):r&&this._scheduleFullSnapshot()}}_clearConditionalRecordingPersistence(){var e;null==(e=this._strategy)||e.clearConditionalRecordingPersistence()}get sdkDebugProperties(){var e,{sessionStartTimestamp:t}=this._sessionManager.checkAndGetSessionAndWindowId(!0);return{$recording_status:this.status,$sdk_debug_replay_internal_buffer_length:this._buffer.data.length,$sdk_debug_replay_internal_buffer_size:this._buffer.size,$sdk_debug_current_session_duration:this._sessionDuration,$sdk_debug_session_start:t,$sdk_debug_replay_flushed_size:null==(e=this._flushedSizeTracker)?void 0:e.currentTrackedSize,$sdk_debug_replay_full_snapshots:this._fullSnapshotTimestamps,$snapshot_max_depth_exceeded:this._maxDepthExceeded,$sdk_debug_replay_rrweb_error:this._rrwebError}}_startRecorder(){var e;if(!this._stopRrweb){var t,i,n,s={blockClass:"ph-no-capture",blockSelector:void 0,ignoreClass:"ph-ignore-input",maskTextClass:"ph-mask",maskTextSelector:void 0,maskTextFn:void 0,maskAllInputs:!0,maskInputOptions:{password:!0},maskInputFn:void 0,slimDOMOptions:{},collectFonts:!1,inlineStylesheet:!0,recordCrossOriginIframes:!1},o=this._instance.config.session_recording;for(var[a,l]of Object.entries(o||{}))a in s&&("maskInputOptions"===a?s.maskInputOptions=r({password:!0},l):s[a]=l);this._canvasRecording&&this._canvasRecording.enabled&&(s.recordCanvas=!0,s.sampling={canvas:this._canvasRecording.fps},s.dataURLOptions={type:"image/webp",quality:this._canvasRecording.quality}),this._masking&&(s.maskAllInputs=null===(t=this._masking.maskAllInputs)||void 0===t||t,s.maskTextSelector=null!==(i=this._masking.maskTextSelector)&&void 0!==i?i:void 0,s.blockSelector=null!==(n=this._masking.blockSelector)&&void 0!==n?n:void 0);var u=Hv();if(u){this._mutationThrottler=null!==(e=this._mutationThrottler)&&void 0!==e?e:new Iv(u,{refillRate:this._instance.config.session_recording.__mutationThrottlerRefillRate,bucketSize:this._instance.config.session_recording.__mutationThrottlerBucketSize,onBlockedNode:(e,t)=>{var r="Too many mutations on node '"+e+"'. Rate limiting. This could be due to SVG animations or something similar";Nv.info(r,{node:t}),this.log(Fv+" "+r,"warn")}});var c=this._gatherRRWebPlugins();if(this._stopRrweb=u(r({emit:e=>{this.onRRwebEmit(e)},plugins:c},s)),!this._stopRrweb)return this._rrwebError=!0,void Nv.error("rrweb failed to start - Loss of recording data is possible. Check the browser console for rrweb errors.");this._rrwebError=!1,this._lastActivityTimestamp=Date.now(),this._isIdle=ti(this._isIdle)?this._isIdle:"unknown",this.tryAddCustomEvent("$remote_config_received",this._remoteConfig),this._tryAddCustomEvent("$session_options",{sessionRecordingOptions:s,activePlugins:c.map((e=>null==e?void 0:e.name))}),this._tryAddCustomEvent("$posthog_config",{config:this._instance.config})}else Nv.error("_startRecorder was called but rrwebRecord is not available. This indicates something has gone wrong.")}}tryAddCustomEvent(e,t){return this._tryAddCustomEvent(e,t)}}ns.__PosthogExtensions__=ns.__PosthogExtensions__||{},ns.__PosthogExtensions__.initSessionRecording=e=>new Gv(e);class Zv{constructor(e){this._instance=e}get _config(){return this._instance.config}get consent(){return this._getDnt()?0:this._storedConsent}isOptedOut(){return this._config.cookieless_mode===Vo||this.isRejected()||-1===this.consent&&this._config.cookieless_mode===zo}isOptedIn(){return!this.isOptedOut()}isExplicitlyOptedOut(){return 0===this.consent}isRejected(){return 0===this.consent||-1===this.consent&&this._config.opt_out_capturing_by_default}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 ai(e)?1:Br(li,e)?0:-1}get _storage(){var e=this._config.opt_out_capturing_persistence_type,t="localStorage"===e?Gc:Wc;if(!this._persistentStore||this._persistentStore!==t){this._persistentStore=t;var r="localStorage"===e?Wc:Gc;r._get(this._storageKey)&&(this._persistentStore._get(this._storageKey)||this.optInOut(ai(r._get(this._storageKey))),r._remove(this._storageKey,this._config.cross_subdomain_cookie))}return this._persistentStore}_getDnt(){return!!this._config.respect_dnt&&[null==Xn?void 0:Xn.doNotTrack,null==Xn?void 0:Xn.msDoNotTrack,ns.doNotTrack].some((e=>ai(e)))}}var Yv=cs("[Dead Clicks]"),Xv=()=>!0,Kv=e=>{var t,r=!(null==(t=e.instance.persistence)||!t.get_property(qs)),i=e.instance.config.capture_dead_clicks;return ti(i)?i:!!jr(i)||r};class Jv{get lazyLoadedDeadClicksAutocapture(){return this._lazyLoadedDeadClicksAutocapture}constructor(e,t,r){this.instance=e,this.isEnabled=t,this.onCapture=r,this.startIfEnabledOrStop()}onRemoteConfig(e){"captureDeadClicks"in e&&(this.instance.persistence&&this.instance.persistence.register({[qs]:e.captureDeadClicks}),this.startIfEnabledOrStop())}startIfEnabledOrStop(){this.isEnabled(this)?this._loadScript((()=>{this._start()})):this.stop()}_loadScript(e){var t,r;null!=(t=ns.__PosthogExtensions__)&&t.initDeadClicksAutocapture&&e(),null==(r=ns.__PosthogExtensions__)||null==r.loadExternalDependency||r.loadExternalDependency(this.instance,"dead-clicks-autocapture",(t=>{t?Yv.error("failed to load script",t):e()}))}_start(){var e;if(Kn){if(!this._lazyLoadedDeadClicksAutocapture&&null!=(e=ns.__PosthogExtensions__)&&e.initDeadClicksAutocapture){var t=jr(this.instance.config.capture_dead_clicks)?this.instance.config.capture_dead_clicks:{};t.__onCapture=this.onCapture,this._lazyLoadedDeadClicksAutocapture=ns.__PosthogExtensions__.initDeadClicksAutocapture(this.instance,t),this._lazyLoadedDeadClicksAutocapture.start(Kn),Yv.info("starting...")}}else Yv.error("`document` not found. Cannot start.")}stop(){this._lazyLoadedDeadClicksAutocapture&&(this._lazyLoadedDeadClicksAutocapture.stop(),this._lazyLoadedDeadClicksAutocapture=void 0,Yv.info("stopping..."))}}var Qv=cs("[SegmentIntegration]");var ef="posthog-js";function tf(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 g,_=(null==(l=t.exception)?void 0:l.values)||[],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}))),f={$exception_message:(null==(u=_[0])?void 0:u.value)||t.message,$exception_type:null==(c=_[0])?void 0:c.type,$exception_level:t.level,$exception_list:v,$sentry_event_id:t.event_id,$sentry_exception:t.exception,$sentry_exception_message:(null==(d=_[0])?void 0:d.value)||t.message,$sentry_exception_type:null==(h=_[0])?void 0:h.type,$sentry_tags:t.tags};return i&&n&&(f.$sentry_url=(s||"https://sentry.io/organizations/")+i+"/issues/?project="+n+"&query="+t.event_id),a&&(null==(g=e.exceptions)||g.sendExceptionEvent(f)),t}}class rf{constructor(e,t,r,i,n,s){this.name=ef,this.setupOnce=function(o){o(tf(e,{organization:t,projectId:r,prefix:i,severityAllowList:n,sendExceptionsToPostHog:null==s||s}))}}}class nf{constructor(e){this._onSessionIdChange=(e,t,r)=>{r&&(r.noSessionId||r.activityTimeout||r.sessionPastMaximumLength)&&(us.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(!(Zr(s)||Zr(o)||Zr(a)||Zr(l)||Zr(u)||Zr(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?ui(o/s,0,1,us):1,h=s>1?ui(a/s,0,1,us):1,p=l>1?ui(u/l,0,1,us):1,g=l>1?ui(c/l,0,1,us):1;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:g})}}return r.pathname&&(i.$prev_pageview_pathname=r.pathname),r.timestamp&&(i.$prev_pageview_duration=(e.getTime()-r.timestamp.getTime())/1e3),i}}var sf={[Ms]:{exposure:"hidden"},[Ps]:{exposure:"hidden"},__cmpns:{exposure:"hidden"},[As]:{exposure:"hidden"},[Fs]:{exposure:"event"},[Ns]:{exposure:"hidden"},[Os]:{exposure:"event"},[Ds]:{exposure:"hidden"},[Bs]:{exposure:"event"},[Hs]:{exposure:"event"},[qs]:{exposure:"event"},[zs]:{exposure:"hidden"},[Vs]:{exposure:"event"},[$s]:{exposure:"hidden"},$session_recording_enabled_server_side:{exposure:"hidden"},[Zs]:{exposure:"hidden"},[Ys]:{exposure:"event"},[Xs]:{exposure:"event"},[Ks]:{exposure:"event"},[Js]:{exposure:"event"},[ro]:{exposure:"event"},[io]:{exposure:"derived",shouldSkipFromEventProperties:(e,t)=>t(),transformToEventProperties(e){if(!jr(e))return{};for(var t={},r=Object.keys(e),i=0;r.length>i;i++)t["$feature/"+r[i]]=e[r[i]];return t}},[no]:{exposure:"event"},[so]:{exposure:"hidden"},[oo]:{exposure:"hidden"},[ao]:{exposure:"event"},[lo]:{exposure:"event"},[uo]:{exposure:"event"},[co]:{exposure:"hidden"},[ho]:{exposure:"hidden"},[po]:{exposure:"hidden"},[go]:{exposure:"hidden"},[_o]:{exposure:"event"},[vo]:{exposure:"hidden"},$product_tours_activated:{exposure:"hidden"},$conversations_widget_session_id:{exposure:"event"},$conversations_ticket_id:{exposure:"event"},$conversations_widget_state:{exposure:"event"},$conversations_user_traits:{exposure:"event"},[fo]:{exposure:"hidden"},[mo]:{exposure:"hidden"},[yo]:{exposure:"hidden"},[bo]:{exposure:"hidden"},[wo]:{exposure:"hidden"},[So]:{exposure:"hidden"},[Co]:{exposure:"hidden"},[Io]:{exposure:"hidden"},[ko]:{exposure:"hidden"},[xo]:{exposure:"hidden"},[Eo]:{exposure:"hidden"},[Us]:{exposure:"event"},[Ws]:{exposure:"event"},[js]:{exposure:"event"},[Gs]:{exposure:"event"},[Mo]:{exposure:"event"},[Lo]:{exposure:"event"},[Po]:{exposure:"event"},[Ao]:{exposure:"event"},[Fo]:{exposure:"event"},[No]:{exposure:"event"},[Oo]:{exposure:"event"},[Do]:{exposure:"event"},[Bo]:{exposure:"event"},[Ho]:{exposure:"event"}},of=[[Qs,{exposure:"hidden"}],[eo,{exposure:"hidden"}],[to,{exposure:"hidden"}]],af="https?://(.*)",lf=["gclid","gclsrc","dclid","gbraid","wbraid","fbclid","msclkid","twclid","li_fat_id","igshid","ttclid","rdt_cid","epik","qclid","sccid","irclid","_kx"],uf=["utm_source","utm_medium","utm_campaign","utm_content","utm_term","gad_source","mc_cid",...lf],cf="<masked>",df=["li_fat_id"];function hf(e,t,r){if(!Kn)return{};var i,n=t?[...lf,...r||[]]:[],s=pf(xs(Kn.URL,n,cf),e),o=(i={},hs(df,(function(e){var t=Wc._get(e);i[e]=t||null})),i);return ps(o,s)}function pf(e,t){var r=uf.concat(t||[]),i={};return hs(r,(function(t){var r=ks(e,t);i[t]=r||null})),i}function gf(e){var t=function(e){return e?0===e.search(af+"google.([^/?]*)")?"google":0===e.search(af+"bing.com")?"bing":0===e.search(af+"yahoo.com")?"yahoo":0===e.search(af+"duckduckgo.com")?"duckduckgo":null:null}(e),r="yahoo"!=t?"q":"p",i={};if(!Kr(t)){i.$search_engine=t;var n=Kn?ks(Kn.referrer,r):"";n.length&&(i.ph_keyword=n)}return i}function _f(){return navigator.language||navigator.userLanguage}var vf="$direct";function ff(){return(null==Kn?void 0:Kn.referrer)||vf}function mf(e,t){var r=e?[...lf,...t||[]]:[],i=null==Jn?void 0:Jn.href.substring(0,1e3);return{r:ff().substring(0,1e3),u:i?xs(i,r,cf):void 0}}function yf(e){var t,{r:r,u:i}=e,n={$referrer:r,$referring_domain:null==r?void 0:r==vf?vf:null==(t=Cs(r))?void 0:t.host};if(i){n.$current_url=i;var s=Cs(i);n.$host=null==s?void 0:s.host,n.$pathname=null==s?void 0:s.pathname;var o=pf(i);ps(n,o)}if(r){var a=gf(r);ps(n,a)}return n}function bf(){try{return Intl.DateTimeFormat().resolvedOptions().timeZone}catch(e){return}}function wf(){try{return(new Date).getTimezoneOffset()}catch(e){return}}var Sf=["cookie","localstorage","localstorage+cookie","sessionstorage","memory"];class Cf{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&&us.info("Persistence loaded",e.persistence,r({},this.props)),this.update_config(e,e,t),this.save()}isDisabled(){return!!this._disabled}_buildStorage(e){-1===Sf.indexOf(e.persistence.toLowerCase())&&(us.critical("Unknown persistence type "+e.persistence+"; falling back to localStorage+cookie"),e.persistence="localStorage+cookie");var t=function(e){void 0===e&&(e=[]);var t=[...Zc,...e];return r({},Gc,{_parse(e){try{var t={};try{t=Wc._parse(e)||{}}catch(e){}var r=ps(t,JSON.parse(Gc._get(e)||"{}"));return Gc._set(e,r),r}catch(e){}return null},_set(e,r,i,n,s,o){try{Gc._set(e,r,void 0,void 0,o);var a={};t.forEach((e=>{r[e]&&(a[e]=r[e])})),Object.keys(a).length&&Wc._set(e,a,i,n,s,o)}catch(e){Gc._error(e)}},_remove(e,t){try{null==Zn||Zn.localStorage.removeItem(e),Wc._remove(e,t)}catch(e){Gc._error(e)}}})}(e.cookie_persisted_properties||[]),i=e.persistence.toLowerCase();return"localstorage"===i&&Gc._is_supported()?Gc:"localstorage+cookie"===i&&t._is_supported()?t:"sessionstorage"===i&&Jc._is_supported()?Jc:"memory"===i?Xc:"cookie"===i?Wc:t._is_supported()?t:Wc}_isFeatureFlagCacheStale(e){var t=null!=e?e:this._config.feature_flag_cache_ttl_ms;if(!t||0>=t)return!1;var r=this.props[bo];return!r||"number"!=typeof r||Date.now()-r>t}properties(){var e={};return hs(this.props,((t,r)=>{var i=(e=>{var t=sf[e];if(t)return t;for(var[r,i]of of)if(0===e.indexOf(r))return i})(r);if("derived"===(null==i?void 0:i.exposure)){if(null!=i.shouldSkipFromEventProperties&&i.shouldSkipFromEventProperties(t,r===io?()=>this._isFeatureFlagCacheStale():()=>!1))return;i.transformToEventProperties&&ps(e,i.transformToEventProperties(t))}else i&&"event"!==i.exposure||(e[r]=t)})),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)){Zr(t)&&(t="None"),this._expire_days=Zr(r)?this._default_expiry:r;var i=!1;if(hs(e,((e,r)=>{this.props.hasOwnProperty(r)&&this.props[r]!==t||(this._setProp(r,e),i=!0)})),i)return this.save(),!0}return!1}register(e,t){if(jr(e)){this._expire_days=Zr(t)?this._default_expiry:t;var r=!1;if(hs(e,((t,i)=>{e.hasOwnProperty(i)&&this.props[i]!==t&&(this._setProp(i,t),r=!0)})),r)return this.save(),!0}return!1}unregister(e){e in this.props&&(this._deleteProp(e),this.save())}update_campaign_params(){if(!this._campaign_params_saved){var e=hf(this._config.custom_campaign_params,this._config.mask_personal_data_properties,this._config.custom_personal_data_properties);Gr(fs(e))||this.register(e),this._campaign_params_saved=!0}}update_search_keyword(){var e;this.register((e=null==Kn?void 0:Kn.referrer)?gf(e):{})}update_referrer_info(){var e;this.register_once({$referrer:ff(),$referring_domain:null!=Kn&&Kn.referrer&&(null==(e=Cs(Kn.referrer))?void 0:e.host)||vf},void 0)}set_initial_person_info(){this.props[Io]||this.props[ko]||this.register_once({[xo]:mf(this._config.mask_personal_data_properties,this._config.custom_personal_data_properties)},void 0)}get_initial_props(){var e={};hs([ko,Io],(t=>{var r=this.props[t];r&&hs(r,(function(t,r){e["$initial_"+qr(r)]=t}))}));var t,r,i=this.props[xo];if(i){var n=(t=yf(i),r={},hs(t,(function(e,t){r["$initial_"+qr(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||!((e,t)=>{if(e.length!==t.length)return!1;var r=[...e].sort(),i=[...t].sort();return r.every(((e,t)=>e===i[t]))})(e.cookie_persisted_properties||[],t.cookie_persisted_properties||[])){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[As]||{};r[e]=t,this._setProp(As,r),this.save()}remove_event_timer(e){var t=this.props[As]||{},r=t[e];return Zr(r)||(delete t[e],this._setProp(As,t),this.save()),r}get_property(e){return this.props[e]}set_property(e,t){this._setProp(e,t),this.save()}_setProp(e,t){this.props[e]=t}_deleteProp(e){delete this.props[e]}}var If=cs("[RateLimiter]");class kf{constructor(e){this.serverLimits={},this.lastEventRateLimited=!1,this.checkForLimiting=e=>{var t=e.text;if(t&&t.length)try{(JSON.parse(t).quota_limited||[]).forEach((e=>{If.info((e||"events")+" is quota limited."),this.serverLimits[e]=(new Date).getTime()+6e4}))}catch(e){return void If.warn('could not rate limit - continuing. Error: "'+(null==e?void 0:e.message)+'"',{text:t})}},this.instance=e,this.lastEventRateLimited=this.clientRateLimitContext(!0).isRateLimited}get captureEventsPerSecond(){var e;return(null==(e=this.instance.config.rate_limiting)?void 0:e.events_per_second)||10}get captureEventsBurstLimit(){var e;return Math.max((null==(e=this.instance.config.rate_limiting)?void 0:e.events_burst_limit)||10*this.captureEventsPerSecond,this.captureEventsPerSecond)}clientRateLimitContext(e){var t,r,i;void 0===e&&(e=!1);var{captureEventsBurstLimit:n,captureEventsPerSecond:s}=this,o=(new Date).getTime(),a=null!==(t=null==(r=this.instance.persistence)?void 0:r.get_property(Co))&&void 0!==t?t:{tokens:n,last:o};a.tokens+=(o-a.last)/1e3*s,a.last=o,a.tokens>n&&(a.tokens=n);var l=1>a.tokens;return l||e||(a.tokens=Math.max(0,a.tokens-1)),!l||this.lastEventRateLimited||e||this.instance.capture("$$client_ingestion_warning",{$$client_ingestion_warning_message:"posthog-js client rate limited. Config is set to "+s+" events per second and "+n+" events burst limit."},{skip_client_rate_limiting:!0}),this.lastEventRateLimited=l,null==(i=this.instance.persistence)||i.set_property(Co,a),{isRateLimited:l,remainingTokens:a.tokens}}isServerRateLimited(e){var t=this.serverLimits[e||"events"]||!1;return!1!==t&&(new Date).getTime()<t}}var xf=cs("[RemoteConfig]");class Ef{constructor(e){this._instance=e}get remoteConfig(){var e;return null==(e=ns._POSTHOG_REMOTE_CONFIG)||null==(e=e[this._instance.config.token])?void 0:e.config}_loadRemoteConfigJs(e){var t,r;null!=(t=ns.__PosthogExtensions__)&&t.loadExternalDependency?null==(r=ns.__PosthogExtensions__)||null==r.loadExternalDependency||r.loadExternalDependency(this._instance,"remote-config",(()=>e(this.remoteConfig))):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 xf.info("Using preloaded remote config",this.remoteConfig),this._onRemoteConfig(this.remoteConfig),void this._startRefreshInterval();if(this._instance._shouldDisableFlags())return void xf.warn("Remote config is disabled. Falling back to local config.");this._loadRemoteConfigJs((e=>{if(!e)return xf.info("No config found after loading remote JS config. Falling back to JSON."),void this._loadRemoteConfigJSON((e=>{this._onRemoteConfig(e),this._startRefreshInterval()}));this._onRemoteConfig(e),this._startRefreshInterval()}))}catch(e){xf.error("Error loading remote config",e)}}stop(){this._refreshInterval&&(clearInterval(this._refreshInterval),this._refreshInterval=void 0)}refresh(){this._instance._shouldDisableFlags()||"hidden"===(null==Kn?void 0:Kn.visibilityState)||this._instance.reloadFeatureFlags()}_startRefreshInterval(){var e;if(!this._refreshInterval){var t=null!==(e=this._instance.config.remote_config_refresh_interval_ms)&&void 0!==e?e:3e5;0!==t&&(this._refreshInterval=setInterval((()=>{this.refresh()}),t))}}_onRemoteConfig(e){var t;e||xf.error("Failed to fetch remote config from PostHog."),this._instance._onRemoteConfig(null!=e?e:{}),!1!==(null==e?void 0:e.hasFeatureFlags)&&(this._instance.config.advanced_disable_feature_flags_on_first_load||null==(t=this._instance.featureFlags)||t.ensureFlagsLoaded())}}var Tf=3e3;class Rf{constructor(e,t){this._isPaused=!0,this._queue=[],this._flushTimeoutMs=ui((null==t?void 0:t.flush_interval_ms)||Tf,250,5e3,us.createLogger("flush interval"),Tf),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&&Ur(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;Zr(e[s])&&(e[s]=r({},n,{data:[]})),null==(i=e[s].data)||i.push(n.data)})),this._queue=[],e}}var Mf=["retriesPerformedSoFar"];class Lf{constructor(e){this._isPolling=!1,this._pollIntervalMs=3e3,this._queue=[],this._instance=e,this._queue=[],this._areWeOnline=!0,!Zr(Zn)&&"onLine"in Zn.navigator&&(this._areWeOnline=Zn.navigator.onLine,this._onlineListener=()=>{this._areWeOnline=!0,this._flush()},this._offlineListener=()=>{this._areWeOnline=!1},bs(Zn,"online",this._onlineListener),bs(Zn,"offline",this._offlineListener))}get length(){return this._queue.length}retriableRequest(e){var{retriesPerformedSoFar:t}=e,n=i(e,Mf);ei(t)&&(n.url=Mc(n.url,{retry_count:t})),this._instance._send_request(r({},n,{callback:e=>{200===e.statusCode||e.statusCode>=400&&500>e.statusCode||(null!=t?t:0)>=10?null==n.callback||n.callback(e):this._enqueue(r({retriesPerformedSoFar:t},n))}}))}_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;return Math.ceil(i+n*(i-r))}(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)"),us.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=>e>r.retryAt||(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,Zr(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){us.error(e)}this._queue=[]}}class Pf{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}get _scrollRoot(){return this._instance.config.scroll_root_selector}getContext(){return this._context}resetContext(){var e=this._context;return setTimeout(this._updateScrollData,0),e}startMeasuringScrollPosition(){bs(Zn,"scroll",this._updateScrollData,{capture:!0}),bs(Zn,"scrollend",this._updateScrollData,{capture:!0}),bs(Zn,"resize",this._updateScrollData)}scrollElement(){if(!this._scrollRoot)return null==Zn?void 0:Zn.document.documentElement;var e=Ur(this._scrollRoot)?this._scrollRoot:[this._scrollRoot];for(var t of e){var r=null==Zn?void 0:Zn.document.querySelector(t);if(r)return r}}scrollY(){if(this._scrollRoot){var e=this.scrollElement();return e&&e.scrollTop||0}return Zn&&(Zn.scrollY||Zn.pageYOffset||Zn.document.documentElement.scrollTop)||0}scrollX(){if(this._scrollRoot){var e=this.scrollElement();return e&&e.scrollLeft||0}return Zn&&(Zn.scrollX||Zn.pageXOffset||Zn.document.documentElement.scrollLeft)||0}}var Af=e=>mf(null==e?void 0:e.config.mask_personal_data_properties,null==e?void 0:e.config.custom_personal_data_properties);class Ff{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({[So]:r})}},this._instance=e,this._sessionIdManager=t,this._persistence=r,this._sessionSourceParamGenerator=i||Af,this._sessionIdManager.onSessionId(this._onSessionIdCallback)}_getStored(){return this._persistence.props[So]}getSetOnceProps(){var e,t=null==(e=this._getStored())?void 0:e.props;return t?"r"in t?yf(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(fs(this.getSetOnceProps()),((t,r)=>{"$current_url"===r&&(r="url"),e["$session_entry_"+qr(r)]=t})),e}}class Nf{constructor(){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)}}var Of=cs("[SessionId]");class Df{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 Nf,this._sessionHasBeenIdleTooLong=(e,t)=>!(!ei(e)||!ei(t))&&Math.abs(e-t)>this.sessionTimeoutMs,!e.persistence)throw new Error("SessionIdManager requires a PostHogPersistence instance");if(e.config.cookieless_mode===Vo)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||qu,this._windowIdGenerator=r||qu;var n=this._config.persistence_name||this._config.token;if(this._sessionTimeoutMs=1e3*ui(this._config.session_idle_timeout_seconds||1800,60,36e3,Of.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 s=Jc._parse(this._window_id_storage_key),o=Jc._parse(this._primary_window_exists_storage_key);s&&!o?this._windowId=s:Jc._remove(this._window_id_storage_key),Jc._set(this._primary_window_exists_storage_key,!0)}if(null!=(i=this._config.bootstrap)&&i.sessionID)try{var a=(e=>{var t=this._config.bootstrap.sessionID.replace(/-/g,"");if(32!==t.length)throw new Error("Not a valid UUID");if("7"!==t[12])throw new Error("Not a UUIDv7");return parseInt(t.substring(0,12),16)})();this._setSessionId(this._config.bootstrap.sessionID,(new Date).getTime(),a)}catch(e){Of.error("Invalid sessionID in bootstrap",e)}this._listenToReloadWindow()}get sessionTimeoutMs(){return this._sessionTimeoutMs}onSessionId(e){return Zr(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&&Jc._is_supported()}_setWindowId(e){e!==this._windowId&&(this._windowId=e,this._canUseSessionStorage()&&Jc._set(this._window_id_storage_key,e))}_getWindowId(){return this._windowId?this._windowId:this._canUseSessionStorage()?Jc._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({[Zs]:[t,e,r]}))}_getSessionId(){var e=this._persistence.props[Zs];return Ur(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(Go,this._beforeUnloadListener,{capture:!1}),this._beforeUnloadListener=void 0),this._sessionIdChangedHandlers=[]}_listenToReloadWindow(){this._beforeUnloadListener=()=>{this._canUseSessionStorage()&&Jc._remove(this._primary_window_exists_storage_key)},bs(Zn,Go,this._beforeUnloadListener,{capture:!1})}checkAndGetSessionAndWindowId(e,t){if(void 0===e&&(e=!1),void 0===t&&(t=null),this._config.cookieless_mode===Vo)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=ei(s)&&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(),Of.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=ei(i)&&e&&!a?i:r,h=ei(s)?s:(new Date).getTime();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 Bf=function(e,t){if(!e)return!1;var r=e.userAgent;if(r&&Nr(r,t))return!0;try{var i=null==e?void 0:e.userAgentData;if(null!=i&&i.brands&&i.brands.some((e=>Nr(null==e?void 0:e.brand,t))))return!0}catch(e){}return!!e.webdriver},Hf="custom",qf="i.posthog.com",zf=/^\/static\//;class Vf{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("."+qf,".posthog.com")),"https://app.posthog.com"===t?"https://us.posthog.com":t}get region(){return this._regionCache[this.apiHost]||(this._regionCache[this.apiHost]=/https:\/\/(app|us|us-assets)(\.i)?\.posthog\.com/i.test(this.apiHost)?"us":/https:\/\/(eu|eu-assets)(\.i)?\.posthog\.com/i.test(this.apiHost)?"eu":Hf),this._regionCache[this.apiHost]}_staticAssetHostOverride(e){var t=this.instance.config.__preview_external_dependency_versioned_paths;if("string"==typeof t&&zf.test(e))return t.trim().replace(/\/$/,"")||void 0}endpointFor(e,t){if(void 0===t&&(t=""),t&&(t="/"===t[0]?t:"/"+t),"ui"===e)return this.uiHost+t;if("flags"===e)return this.flagsApiHost+t;if("assets"===e){var r=this._staticAssetHostOverride(t);if(r)return""+r+t}if(this.region===Hf)return this.apiHost+t;var i=qf+t;switch(e){case"assets":return"https://"+this.region+"-assets."+i;case"api":return"https://"+this.region+"."+i}}}var $f=cs("[PostHog ExternalIntegrations]"),Uf={intercom:"intercom-integration",crispChat:"crisp-chat-integration"};class Wf{constructor(e){this._instance=e}_loadScript(e,t){var r;null==(r=ns.__PosthogExtensions__)||null==r.loadExternalDependency||r.loadExternalDependency(this._instance,e,(e=>{if(e)return $f.error("failed to load script",e);t()}))}startIfEnabledOrStop(){var e=this,t=function(t){var r,n,s;!i||null!=(r=ns.__PosthogExtensions__)&&null!=(r=r.integrations)&&r[t]||e._loadScript(Uf[t],(()=>{var r;null==(r=ns.__PosthogExtensions__)||null==(r=r.integrations)||null==(r=r[t])||r.start(e._instance)})),!i&&null!=(n=ns.__PosthogExtensions__)&&null!=(n=n.integrations)&&n[t]&&(null==(s=ns.__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 jf,Gf={},Zf=0,Yf=()=>{},Xf='Consent opt in/out is not valid with cookieless_mode="always" and will be ignored',Kf="Surveys module not available",Jf="sanitize_properties is deprecated. Use before_send instead",Qf="Invalid value for property_denylist config: ",em="posthog",tm=!Ec&&-1===(null==is?void 0:is.indexOf("MSIE"))&&-1===(null==is?void 0:is.indexOf("Mozilla")),rm=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:ys(null==Kn?void 0:Kn.location),persistence:"localStorage+cookie",persistence_name:"",cookie_persisted_properties:[],loaded:Yf,save_campaign_params:!0,custom_campaign_params:[],custom_blocked_useragents:[],save_referrer:!0,capture_pageleave:"if_capture_pageview",defaults:null!=e?e:"unset",__preview_deferred_init_extensions:!1,__preview_external_dependency_versioned_paths:!1,debug:Jn&&Yr(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:!1,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_feature_flags_dedup_per_session:!1,advanced_enable_surveys:!1,advanced_disable_toolbar_metrics:!1,feature_flag_request_timeout_ms:3e3,surveys_request_timeout_ms:1e4,on_request_error(e){us.error("Bad HTTP status: "+e.statusCode+" "+e.text)},get_device_id:e=>e,capture_performance:void 0,name:"posthog",bootstrap:{},disable_compression:!1,session_idle_timeout_seconds:1800,person_profiles:Wo,before_send:void 0,request_queue_config:{flush_interval_ms:Tf},error_tracking:{},_onCapture:Yf,__preview_eager_load_replay:!1},(e=>({rageclick:!e||"2025-11-30">e||{content_ignorelist:!0},capture_pageview:!e||"2025-05-24">e||"history_change",session_recording:e&&e>="2025-11-30"?{strictMinimumDuration:!0}:{},external_scripts_inject_target:e&&e>="2026-01-30"?"head":"body",internal_or_test_user_hostname:e&&e>="2026-01-30"?/^(localhost|127\.0\.0\.1)$/:void 0}))(e))},im=[["process_person","person_profiles"],["xhr_headers","request_headers"],["cookie_name","persistence_name"],["disable_cookie","disable_persistence"],["store_google","save_campaign_params"],["verbose","debug"]],nm=e=>{var t={};for(var[r,i]of im)Zr(e[r])||(t[i]=e[r]);var n=ps({},t,e);return Ur(e.property_blacklist)&&(Zr(e.property_denylist)?n.property_denylist=e.property_blacklist:Ur(e.property_denylist)?n.property_denylist=[...e.property_blacklist,...e.property_denylist]:us.error(Qf+e.property_denylist)),n};class sm{constructor(){this.__forceAllowLocalhost=!1}get _forceAllowLocalhost(){return this.__forceAllowLocalhost}set _forceAllowLocalhost(e){us.error("WebPerformanceObserver is deprecated and has no impact on network capture. Use `_forceAllowLocalhostNetworkCapture` on `posthog.sessionRecording`"),this.__forceAllowLocalhost=e}}class om{_replaceExtension(e,t){if(e){var r=this._extensions.indexOf(e);-1!==r&&this._extensions.splice(r,1)}return this._extensions.push(t),null==t.initialize||t.initialize(),t}_inCookielessMode(){return this.config.cookieless_mode===Vo||this.config.cookieless_mode===zo&&this.consent.isRejected()}get decideEndpointWasHit(){var e,t;return null!==(e=null==(t=this.featureFlags)?void 0:t.hasLoadedFlags)&&void 0!==e&&e}get flagsEndpointWasHit(){var e,t;return null!==(e=null==(t=this.featureFlags)?void 0:t.hasLoadedFlags)&&void 0!==e&&e}constructor(){var e;this.webPerformance=new sm,this._personProcessingSetOncePropertiesSent=!1,this.version=as.LIB_VERSION,this._internalEventEmitter=new Nf,this._extensions=[],this._calculate_event_properties=this.calculateEventProperties.bind(this),this.config=rm(),this.SentryIntegration=rf,this.sentryIntegration=e=>function(e,t){var r=tf(e,t);return{name:ef,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.scrollManager=new Pf(this),this.pageViewManager=new nf(this),this.rateLimiter=new kf(this),this.requestRouter=new Vf(this),this.consent=new Zv(this),this.externalIntegrations=new Wf(this);var t=null!==(e=om.__defaultExtensionClasses)&&void 0!==e?e:{};this.featureFlags=t.featureFlags&&new t.featureFlags(this),this.toolbar=t.toolbar&&new t.toolbar(this),this.surveys=t.surveys&&new t.surveys(this),this.conversations=t.conversations&&new t.conversations(this),this.logs=t.logs&&new t.logs(this),this.experiments=t.experiments&&new t.experiments(this),this.exceptions=t.exceptions&&new t.exceptions(this),this.people={set:(e,t,r)=>{var i=Yr(e)?{[e]:t}:e;this.setPersonProperties(i),null==r||r({})},set_once:(e,t,r)=>{var i=Yr(e)?{[e]:t}:e;this.setPersonProperties(void 0,i),null==r||r({})}},this.on("eventCaptured",(e=>us.info('send "'+(null==e?void 0:e.event)+'"',e)))}init(e,t,r){if(r&&r!==em){var i,n=null!==(i=Gf[r])&&void 0!==i?i:new om;return n._init(e,t,r),Gf[r]=n,Gf[em][r]=n,n}return this._init(e,t,r)}_init(e,t,i){var n,s;if(void 0===t&&(t={}),Zr(e)||Xr(e))return us.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:t.process_person&&(this._initialPersonProfilesConfig=t.process_person),this.set_config(ps({},rm(t.defaults),nm(t),{name:i,token:e})),this.config.on_xhr_error&&us.error("on_xhr_error is deprecated. Use on_request_error instead"),this.compression=t.disable_compression?void 0:Vu;var o=this._is_persistence_disabled();this.persistence=new Cf(this.config,o),this.sessionPersistence="sessionStorage"===this.config.persistence||"memory"===this.config.persistence?this.persistence:new Cf(r({},this.config,{persistence:"sessionStorage"}),o);var a=r({},this.persistence.props),l=r({},this.sessionPersistence.props);this.register({$initialization_time:(new Date).toISOString()}),this._requestQueue=new Rf((e=>this._send_retriable_request(e)),this.config.request_queue_config),this._retryQueue=new Lf(this),this.__request_queue=[];var u=this._inCookielessMode();if(u||(this.sessionManager=new Df(this),this.sessionPropsManager=new Ff(this,this.sessionManager,this.persistence)),this.config.__preview_deferred_init_extensions?(us.info("Deferring extension initialization to improve startup performance"),setTimeout((()=>{this._initExtensions(u)}),0)):(us.info("Initializing extensions synchronously"),this._initExtensions(u)),as.DEBUG=as.DEBUG||this.config.debug,as.DEBUG&&us.info("Starting in debug mode",{this:this,config:t,thisC:r({},this.config),p:a,s:l}),!this.config.identity_distinct_id||null!=(n=t.bootstrap)&&n.distinctID||(t.bootstrap=r({},t.bootstrap,{distinctID:this.config.identity_distinct_id,isIdentifiedID:!0})),void 0!==(null==(s=t.bootstrap)?void 0:s.distinctID)){var c=t.bootstrap.distinctID,d=this.get_distinct_id(),h=this.persistence.get_property(wo);if(t.bootstrap.isIdentifiedID&&null!=d&&d!==c&&h===$o)this.identify(c);else if(t.bootstrap.isIdentifiedID&&null!=d&&d!==c&&h===Uo)us.warn("Bootstrap distinctID differs from an already-identified user. The existing identity is preserved. Call reset() before reinitializing if you intend to switch users.");else{var p=this.config.get_device_id(qu()),g=t.bootstrap.isIdentifiedID?p:c;this.persistence.set_property(wo,t.bootstrap.isIdentifiedID?Uo:$o),this.register({distinct_id:c,$device_id:g})}}if(u)this.register_once({distinct_id:Ro,$device_id:null},"");else if(!this.get_distinct_id()){var _=this.config.get_device_id(qu());this.register_once({distinct_id:_,$device_id:_},""),this.persistence.set_property(wo,$o)}return bs(Zn,"onpagehide"in self?"pagehide":"unload",this._handle_unload.bind(this),{passive:!1}),t.segment?function(e,t){var r=e.config.segment;if(!r)return t();!function(e,t){var r=e.config.segment;if(!r)return t();var i=r=>{var i=()=>r.anonymousId()||qu();e.config.get_device_id=i,r.id()&&(e.register({distinct_id:r.id(),$device_id:i()}),e.persistence.set_property(wo,Uo)),t()},n=r.user();"then"in n&&Wr(n.then)?n.then(i):i(n)}(e,(()=>{r.register((e=>{Promise&&Promise.resolve||Qv.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()||(Qv.info("No userId set, resetting PostHog"),e.reset()),t.event.userId&&t.event.userId!==e.get_distinct_id()&&(Qv.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,Zo),identify:e=>t(e,Xo),screen:e=>t(e,"$screen")}})(e)).then((()=>{t()}))}))}(this,(()=>this._loaded())):this._loaded(),Wr(this.config._onCapture)&&this.config._onCapture!==Yf&&(us.warn("onCapture is deprecated. Please use `before_send` instead"),this.on("eventCaptured",(e=>this.config._onCapture(e.event,e)))),this.config.ip&&us.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,i,n,s,o,a,l,u=performance.now(),c=r({},om.__defaultExtensionClasses,this.config.__extensionClasses),d=[];c.featureFlags&&this._extensions.push(this.featureFlags=null!==(t=this.featureFlags)&&void 0!==t?t:new c.featureFlags(this)),c.exceptions&&this._extensions.push(this.exceptions=null!==(i=this.exceptions)&&void 0!==i?i:new c.exceptions(this)),c.historyAutocapture&&this._extensions.push(this.historyAutocapture=new c.historyAutocapture(this)),c.tracingHeaders&&this._extensions.push(new c.tracingHeaders(this)),c.siteApps&&this._extensions.push(this.siteApps=new c.siteApps(this)),c.sessionRecording&&!e&&this._extensions.push(this.sessionRecording=new c.sessionRecording(this)),this.config.disable_scroll_properties||d.push((()=>{this.scrollManager.startMeasuringScrollPosition()})),c.autocapture&&this._extensions.push(this.autocapture=new c.autocapture(this)),c.surveys&&this._extensions.push(this.surveys=null!==(n=this.surveys)&&void 0!==n?n:new c.surveys(this)),c.logs&&this._extensions.push(this.logs=null!==(s=this.logs)&&void 0!==s?s:new c.logs(this)),c.conversations&&this._extensions.push(this.conversations=null!==(o=this.conversations)&&void 0!==o?o:new c.conversations(this)),c.productTours&&this._extensions.push(this.productTours=new c.productTours(this)),c.heatmaps&&this._extensions.push(this.heatmaps=new c.heatmaps(this)),c.webVitalsAutocapture&&this._extensions.push(this.webVitalsAutocapture=new c.webVitalsAutocapture(this)),c.exceptionObserver&&this._extensions.push(this.exceptionObserver=new c.exceptionObserver(this)),c.deadClicksAutocapture&&this._extensions.push(this.deadClicksAutocapture=new c.deadClicksAutocapture(this,Kv)),c.toolbar&&this._extensions.push(this.toolbar=null!==(a=this.toolbar)&&void 0!==a?a:new c.toolbar(this)),c.experiments&&this._extensions.push(this.experiments=null!==(l=this.experiments)&&void 0!==l?l:new c.experiments(this)),this._extensions.forEach((e=>{e.initialize&&d.push((()=>{null==e.initialize||e.initialize()}))})),d.push((()=>{if(this._pendingRemoteConfig){var e=this._pendingRemoteConfig;this._pendingRemoteConfig=void 0,this._onRemoteConfig(e)}})),this._processInitTaskQueue(d,u)}_processInitTaskQueue(e,t){for(;e.length>0;){if(this.config.__preview_deferred_init_extensions&&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){us.error("Error initializing extension:",e)}}var i=Math.round(performance.now()-t);this.register_for_session({[Mo]:this.config.__preview_deferred_init_extensions?"deferred":"synchronous",[Lo]:i}),this.config.__preview_deferred_init_extensions&&us.info("PostHog extensions initialized ("+i+"ms)")}_onRemoteConfig(e){var t;if(!Kn||!Kn.body)return us.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._lastRemoteConfig=e,this.compression=void 0,e.supportedCompression&&!this.config.disable_compression&&(this.compression=Br(e.supportedCompression,Vu)?Vu:Br(e.supportedCompression,$u)?$u:void 0),null!=(t=e.analytics)&&t.endpoint&&(this.analyticsDefaultEndpoint=e.analytics.endpoint),this.set_config({person_profiles:this._initialPersonProfilesConfig?this._initialPersonProfilesConfig:Wo}),this._extensions.forEach((t=>null==t.onRemoteConfig?void 0:t.onRemoteConfig(e)))}_loaded(){try{this.config.loaded(this)}catch(e){us.critical("`loaded` function failed",e)}if(this._start_queue_if_opted_in(),this.config.internal_or_test_user_hostname&&null!=Jn&&Jn.hostname){var e=Jn.hostname,t=this.config.internal_or_test_user_hostname;("string"==typeof t?e===t:t.test(e))&&this.setInternalOrTestUser()}this.config.capture_pageview&&setTimeout((()=>{(this.consent.isOptedIn()||this._inCookielessMode())&&this._captureInitialPageview()}),1),this._remoteConfigLoader=new Ef(this),this._remoteConfigLoader.load()}_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,r,i;null==(e=this.surveys)||e.handlePageUnload(),this.config.request_batching?(this._shouldCapturePageleave()&&this.capture(Yo),null==(t=this.logs)||t.flushLogs("sendBeacon"),null==(r=this._requestQueue)||r.unload(),null==(i=this._retryQueue)||i.unload()):this._shouldCapturePageleave()&&this.capture(Yo,null,{transport:"sendBeacon"})}_send_request(e){this.__loaded&&(tm?this.__request_queue.push(e):this.rateLimiter.isServerRateLimited(e.batchKey)||(e.transport=e.transport||this.config.api_transport,e.url=Mc(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=Fc(s.url,s.compression);var o=null!==(t=s.transport)&&void 0!==t?t:"fetch",a=Nc.filter((e=>!s.disableTransport||!e.transport||!s.disableTransport.includes(e.transport))),l=null!==(i=null==(n=function(e,t){for(var r=0;e.length>r;r++)if(t(e[r]))return e[r]}(a,(e=>e.transport===o)))?void 0:n.method)&&void 0!==i?i:a[0].method;if(!l)throw new Error("No available transport method");"sendBeacon"!==o&&s.data&&s.compression===Vu&&rs&&!Rc?Ac(s).then((e=>{l(e)})).catch((t=>{if((e=>!(!e||"object"!=typeof e)&&"NotReadableError"===("name"in e?String(e.name):""))(t))return Rc=!0,void l(r({},s,{compression:void 0,url:Fc(e.url,void 0)}));l(s)})):l(s)})(r({},e,{callback:t=>{var r,i;this.rateLimiter.checkForLimiting(t),400>t.statusCode||null==(r=(i=this.config).on_request_error)||r.call(i,t),null==e.callback||e.callback(t)}}))))}_send_retriable_request(e){this._retryQueue?this._retryQueue.retriableRequest(e):this._send_request(e)}_execute_array(e){Zf++;try{var t,r=[],i=[],n=[];ds(e,(e=>{e&&(Ur(t=e[0])?n.push(e):Wr(e)?e.call(this):Ur(e)&&"alias"===t?r.push(e):Ur(e)&&-1!==t.indexOf("capture")&&Wr(this[t])?n.push(e):i.push(e))}));var s=function(e,t){ds(e,(function(e){if(Ur(e[0])){var r=t;hs(e,(function(e){r=r[e[0]].apply(r,e.slice(1))}))}else t[e[0]].apply(t,e.slice(1))}))};s(r,this),s(i,this),s(n,this)}finally{Zf--}}push(e){if(Zf>0&&Ur(e)&&Yr(e[0])){var t=om.prototype[e[0]];Wr(t)&&t.apply(this,e.slice(1))}else this._execute_array([e])}capture(e,t,i){var n,s,o,a,l;if(this.__loaded&&this.persistence&&this.sessionPersistence&&this._requestQueue){if(this.is_capturing())if(!Zr(e)&&Yr(e)){var u=!this.config.opt_out_useragent_filter&&this._is_bot();if(!u||this.config.__preview_capture_bot_pageviews){var c=null!=i&&i.skip_client_rate_limiting?void 0:this.rateLimiter.clientRateLimitContext();if(null==c||!c.isRateLimited){null!=t&&t.$current_url&&!Yr(null==t?void 0:t.$current_url)&&(us.error("Invalid `$current_url` property provided to `posthog.capture`. Input must be a string. Ignoring provided value."),null==t||delete t.$current_url),"$exception"!==e||null!=i&&i._originatedFromCaptureException||us.warn("Using `posthog.capture('$exception')` is unreliable because it does not attach required metadata. Use `posthog.captureException(error)` instead, which attaches required metadata automatically."),this.sessionPersistence.update_search_keyword(),this.config.save_campaign_params&&this.sessionPersistence.update_campaign_params(),this.config.save_referrer&&this.sessionPersistence.update_referrer_info(),(this.config.save_campaign_params||this.config.save_referrer)&&this.persistence.set_initial_person_info();var d=new Date,h=(null==i?void 0:i.timestamp)||d,p=qu(),g={uuid:p,event:e,properties:this.calculateEventProperties(e,t||{},h,p)};e===Zo&&this.config.__preview_capture_bot_pageviews&&u&&(g.event="$bot_pageview",g.properties.$browser_type="bot"),c&&(g.properties.$lib_rate_limit_remaining_tokens=c.remainingTokens),(null==i?void 0:i.$set)&&(g.$set=null==i?void 0:i.$set);var _=this._calculate_set_once_properties(null==i?void 0:i.$set_once,e!==Ko,e===Xo);if(_&&(g.$set_once=_),null!=i&&i._noTruncate||(s=this.config.properties_string_max_length,o=g,a=e=>Yr(e)?e.slice(0,s):e,l=new Set,g=function e(t,r){return t!==Object(t)?a?a(t):t:l.has(t)?void 0:(l.add(t),Ur(t)?(i=[],ds(t,(t=>{i.push(e(t))}))):(i={},hs(t,((t,r)=>{l.has(t)||(i[r]=e(t,r))}))),i);var i}(o)),g.timestamp=h,Zr(null==i?void 0:i.timestamp)||(g.properties.$event_time_override_provided=!0,g.properties.$event_time_override_system_time=d),e===bu.DISMISSED||e===bu.SENT){var v=null==t?void 0:t[wu.SURVEY_ID],f=null==t?void 0:t[wu.SURVEY_ITERATION];Pu({id:v,current_iteration:f}),g.$set=r({},g.$set,{[Ru({id:v,current_iteration:f},e===bu.SENT?"responded":"dismissed")]:!0})}else e===bu.SHOWN&&(g.$set=r({},g.$set,{[wu.SURVEY_LAST_SEEN_DATE]:(new Date).toISOString()}));if("product tour shown"===e){var m=null==t?void 0:t.$product_tour_type;m&&(g.$set=r({},g.$set,{["$product_tour_last_seen_date/"+m]:(new Date).toISOString()}))}var y=r({},g.properties.$set,g.$set);if(Gr(y)||this.setPersonPropertiesForFlags(y),!Jr(this.config.before_send)){var b=this._runBeforeSend(g);if(!b)return;g=b}this._internalEventEmitter.emit("eventCaptured",g);var w={method:"POST",url:null!==(n=null==i?void 0:i._url)&&void 0!==n?n:this.requestRouter.endpointFor("api",this.analyticsDefaultEndpoint),data:g,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(w):this._requestQueue.enqueue(w),g}us.critical("This capture call is ignored due to client rate limiting.")}}else us.error("No event name provided to posthog.capture")}else us.uninitializedWarning("posthog.capture")}_addCaptureHook(e){return this.on("eventCaptured",(t=>e(t.event,t)))}calculateEventProperties(e,t,i,n,s){if(i=i||new Date,!this.persistence||!this.sessionPersistence)return t;var o=s?void 0:this.persistence.remove_event_timer(e),a=r({},t);if(a.token=this.config.token,a.$config_defaults=this.config.defaults,this._inCookielessMode()&&(a.$cookieless_mode=!0),"$snapshot"===e){var l=r({},this.persistence.properties(),this.sessionPersistence.properties());return a.distinct_id=l.distinct_id,(!Yr(a.distinct_id)&&!Qr(a.distinct_id)||Xr(a.distinct_id))&&us.error("Invalid distinct_id for replay event. This indicates a bug in your implementation"),a}var u,c=function(e,t){var r,i,n,s;if(!is)return{};var o,a=e?[...lf,...t||[]]:[],[l,u]=function(e){for(var t=0;ln.length>t;t++){var[r,i]=ln[t],n=r.exec(e),s=n&&(Wr(i)?i(n,e):i);if(s)return s}return["",""]}(is);return ps(fs({$os:l,$os_version:u,$browser:sn(is,navigator.vendor),$device:un(is),$device_type:cn(is,{userAgentDataPlatform:null==(r=navigator)||null==(r=r.userAgentData)?void 0:r.platform,maxTouchPoints:null==(i=navigator)?void 0:i.maxTouchPoints,screenWidth:null==Zn||null==(n=Zn.screen)?void 0:n.width,screenHeight:null==Zn||null==(s=Zn.screen)?void 0:s.height,devicePixelRatio:null==Zn?void 0:Zn.devicePixelRatio}),$timezone:bf(),$timezone_offset:wf()}),{$current_url:xs(null==Jn?void 0:Jn.href,a,cf),$host:null==Jn?void 0:Jn.host,$pathname:null==Jn?void 0:Jn.pathname,$raw_user_agent:is.length>1e3?is.substring(0,997)+"...":is,$browser_version:an(is,navigator.vendor),$browser_language:_f(),$browser_language_prefix:(o=_f(),"string"==typeof o?o.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:as.LIB_NAME,$lib_version:as.LIB_VERSION,$insert_id:Math.random().toString(36).substring(2,10)+Math.random().toString(36).substring(2,10),$time:Date.now()/1e3})}(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===Hf&&(a.$lib_custom_api_host=this.config.api_host),u=e!==Zo||s?e!==Yo||s?this.pageViewManager.doEvent():this.pageViewManager.doPageLeave(i):this.pageViewManager.doPageView(i,n),a=ps(a,u),e===Zo&&Kn&&(a.title=Kn.title),!Zr(o)){var g=i.getTime()-o;a.$duration=parseFloat((g/1e3).toFixed(3))}is&&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(),Ur(this.config.property_denylist)?hs(this.config.property_denylist,(function(e){delete a[e]})):us.error(Qf+this.config.property_denylist+" or property_blacklist config: "+this.config.property_blacklist);var _=this.config.sanitize_properties;_&&(us.error(Jf),a=_(a,e));var v=this._hasPersonProcessing();return a.$process_person_profile=v,v&&!s&&this._requirePersonProcessing("_calculate_event_properties"),a}_calculate_set_once_properties(e,t,r){var i;if(void 0===t&&(t=!0),void 0===r&&(r=!1),!this.persistence||!this._hasPersonProcessing())return e;if(this._personProcessingSetOncePropertiesSent&&!r)return e;var n=this.persistence.get_initial_props(),s=null==(i=this.sessionPropsManager)?void 0:i.getSetOnceProps(),o=ps({},n,s||{},e||{}),a=this.config.sanitize_properties;return a&&(us.error(Jf),o=a(o,"$set_once")),t&&(this._personProcessingSetOncePropertiesSent=!0),Gr(o)?void 0:o}register(e,t){var r;null==(r=this.persistence)||r.register(e,t)}register_once(e,t,r){var i;null==(i=this.persistence)||i.register_once(e,t,r)}register_for_session(e){var t;null==(t=this.sessionPersistence)||t.register(e)}unregister(e){var t;null==(t=this.persistence)||t.unregister(e)}unregister_for_session(e){var t;null==(t=this.sessionPersistence)||t.unregister(e)}_register_single(e,t){this.register({[e]:t})}getFeatureFlag(e,t){var r;return null==(r=this.featureFlags)?void 0:r.getFeatureFlag(e,t)}getFeatureFlagPayload(e){var t;return null==(t=this.featureFlags)?void 0:t.getFeatureFlagPayload(e)}getFeatureFlagResult(e,t){var r;return null==(r=this.featureFlags)?void 0:r.getFeatureFlagResult(e,t)}isFeatureEnabled(e,t){var r;return null==(r=this.featureFlags)?void 0:r.isFeatureEnabled(e,t)}reloadFeatureFlags(){var e;null==(e=this.featureFlags)||e.reloadFeatureFlags()}updateFlags(e,t,r){var i;null==(i=this.featureFlags)||i.updateFlags(e,t,r)}updateEarlyAccessFeatureEnrollment(e,t,r){var i;null==(i=this.featureFlags)||i.updateEarlyAccessFeatureEnrollment(e,t,r)}getEarlyAccessFeatures(e,t,r){var i;return void 0===t&&(t=!1),null==(i=this.featureFlags)?void 0:i.getEarlyAccessFeatures(e,t,r)}on(e,t){return this._internalEventEmitter.on(e,t)}onFeatureFlags(e){return this.featureFlags?this.featureFlags.onFeatureFlags(e):(e([],{},{errorsLoading:!0}),()=>{})}onSurveysLoaded(e){return this.surveys?this.surveys.onSurveysLoaded(e):(e([],{isLoaded:!1,error:Kf}),()=>{})}onSessionId(e){var t,r;return null!==(t=null==(r=this.sessionManager)?void 0:r.onSessionId(e))&&void 0!==t?t:()=>{}}getSurveys(e,t){void 0===t&&(t=!1),this.surveys?this.surveys.getSurveys(e,t):e([],{isLoaded:!1,error:Kf})}getActiveMatchingSurveys(e,t){void 0===t&&(t=!1),this.surveys?this.surveys.getActiveMatchingSurveys(e,t):e([],{isLoaded:!1,error:Kf})}renderSurvey(e,t){var r;null==(r=this.surveys)||r.renderSurvey(e,t)}displaySurvey(e,t){var r;void 0===t&&(t=Fu),null==(r=this.surveys)||r.displaySurvey(e,t)}cancelPendingSurvey(e){var t;null==(t=this.surveys)||t.cancelPendingSurvey(e)}canRenderSurvey(e){var t,r;return null!==(t=null==(r=this.surveys)?void 0:r.canRenderSurvey(e))&&void 0!==t?t:{visible:!1,disabledReason:Kf}}canRenderSurveyAsync(e,t){var r,i;return void 0===t&&(t=!1),null!==(r=null==(i=this.surveys)?void 0:i.canRenderSurveyAsync(e,t))&&void 0!==r?r:Promise.resolve({visible:!1,disabledReason:Kf})}_validateIdentifyId(e){return!e||Xr(e)?(us.critical("Unique user id has not been set in posthog.identify"),!1):e===Ro?(us.critical('The string "'+e+'" was set in posthog.identify which indicates an error. This ID is only used as a sentinel value.'),!1):!["distinct_id","distinctid"].includes(e.toLowerCase())&&!["undefined","null"].includes(e.toLowerCase())||(us.critical('The string "'+e+'" was set in posthog.identify which indicates an error. This ID should be unique to the user and not a hardcoded string.'),!1)}identify(e,t,r){if(!this.__loaded||!this.persistence)return us.uninitializedWarning("posthog.identify");if(Qr(e)&&(e=e.toString(),us.warn("The first argument to posthog.identify was a number, but it should be a string. It has been converted to a string.")),this._validateIdentifyId(e)&&this._requirePersonProcessing("posthog.identify")){var i=this.get_distinct_id();this.register({$user_id:e}),this.get_property(Ls)||this.register_once({$had_persisted_distinct_id:!0,$device_id:i},""),e!==i&&e!==this.get_property(Ps)&&(this.unregister(Ps),this.register({distinct_id:e}));var n,s=(this.persistence.get_property(wo)||$o)===$o;e!==i&&s?(this.persistence.set_property(wo,Uo),this.setPersonPropertiesForFlags({$set:t||{},$set_once:r||{}},!1),this.capture(Xo,{distinct_id:e,$anon_distinct_id:i},{$set:t||{},$set_once:r||{}}),this._cachedPersonProperties=Dc(e,t,r),null==(n=this.featureFlags)||n.setAnonymousDistinctId(i)):(t||r)&&this.setPersonProperties(t,r),e!==i&&(this.reloadFeatureFlags(),this.unregister(fo))}}setPersonProperties(e,t){if((e||t)&&this._requirePersonProcessing("posthog.setPersonProperties")){var r=Dc(this.get_distinct_id(),e,t);this._cachedPersonProperties!==r?(this.setPersonPropertiesForFlags({$set:e||{},$set_once:t||{}},!0),this.capture("$set",{$set:e||{},$set_once:t||{}}),this._cachedPersonProperties=r):us.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(),s=n[e]!==t;if(s&&this.resetGroupPropertiesForFlags(e),this.register({$groups:r({},n,{[e]:t})}),s||i){var o={$group_type:e,$group_key:t};i&&(o.$group_set=i),this.capture(Ko,o)}i&&this.setGroupPropertiesForFlags({[e]:i}),s&&!i&&this.reloadFeatureFlags()}else us.error("posthog.group requires a group type and group key")}resetGroups(){this.register({$groups:{}}),this.resetGroupPropertiesForFlags(),this.reloadFeatureFlags()}setPersonPropertiesForFlags(e,t){var r;void 0===t&&(t=!0),null==(r=this.featureFlags)||r.setPersonPropertiesForFlags(e,t)}resetPersonPropertiesForFlags(){var e;null==(e=this.featureFlags)||e.resetPersonPropertiesForFlags()}setGroupPropertiesForFlags(e,t){var r;void 0===t&&(t=!0),this._requirePersonProcessing("posthog.setGroupPropertiesForFlags")&&(null==(r=this.featureFlags)||r.setGroupPropertiesForFlags(e,t))}resetGroupPropertiesForFlags(e){var t;null==(t=this.featureFlags)||t.resetGroupPropertiesForFlags(e)}reset(e){var t,r,i,n,s,o,a,l;if(us.info("reset"),!this.__loaded)return us.uninitializedWarning("posthog.reset");var u=this.get_property(Ls);if(this.consent.reset(),null==(t=this.persistence)||t.clear(),null==(r=this.sessionPersistence)||r.clear(),null==(i=this.surveys)||i.reset(),null==(n=this._remoteConfigLoader)||n.stop(),null==(s=this.featureFlags)||s.reset(),null==(o=this.conversations)||o.reset(),null==(a=this.persistence)||a.set_property(wo,$o),null==(l=this.sessionManager)||l.resetSessionId(),this._cachedPersonProperties=null,this.config.cookieless_mode===Vo)this.register_once({distinct_id:Ro,$device_id:null},"");else{var c=this.config.get_device_id(qu());this.register_once({distinct_id:c,$device_id:e?c:u},"")}this.register({$last_posthog_reset:(new Date).toISOString()},1),delete this.config.identity_distinct_id,delete this.config.identity_hash,this.reloadFeatureFlags()}setIdentity(e,t){var r;this.config.identity_distinct_id=e,this.config.identity_hash=t,this.alias(e),null==(r=this.conversations)||r._onIdentityChanged()}clearIdentity(){var e;delete this.config.identity_distinct_id,delete this.config.identity_hash,null==(e=this.conversations)||e._onIdentityCleared()}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(Ms)?(us.critical("Attempting to create alias for existing People user - aborting."),-2):this._requirePersonProcessing("posthog.alias")?(Zr(t)&&(t=this.get_distinct_id()),e!==t?(this._register_single(Ps,e),this.capture("$create_alias",{alias:e,distinct_id:t})):(us.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,c,d,h;ps(this.config,nm(e));var p=this._is_persistence_disabled();null==(i=this.persistence)||i.update_config(this.config,t,p),this.sessionPersistence="sessionStorage"===this.config.persistence||"memory"===this.config.persistence?this.persistence:new Cf(r({},this.config,{persistence:"sessionStorage"}),p);var g=this._checkLocalStorageForDebug(this.config.debug);ti(g)&&(this.config.debug=g),ti(this.config.debug)&&(this.config.debug?(as.DEBUG=!0,Gc._is_supported()&&Gc._set("ph_debug",!0),us.info("set_config",{config:e,oldConfig:t,newConfig:r({},this.config)})):(as.DEBUG=!1,Gc._is_supported()&&Gc._remove("ph_debug"))),null==(n=this.exceptionObserver)||n.onConfigChange(),null==(s=this.exceptions)||s.onConfigChange(),null==(o=this.sessionRecording)||o.startIfEnabledOrStop(),null==(a=this.autocapture)||a.startIfEnabled(),null==(l=this.heatmaps)||l.startIfEnabled(),null==(u=this.exceptionObserver)||u.startIfEnabledOrStop(),null==(c=this.deadClicksAutocapture)||c.startIfEnabledOrStop(),null==(d=this.surveys)||d.loadIfEnabled(),this._sync_opt_out_with_persistence(),null==(h=this.externalIntegrations)||h.startIfEnabledOrStop()}}_overrideSDKInfo(e,t){as.LIB_NAME=e,as.LIB_VERSION=t}startSessionRecording(e){var t,r,i,n,s,o=!0===e,a={sampling:o||!(null==e||!e.sampling),linked_flag:o||!(null==e||!e.linked_flag),url_trigger:o||!(null==e||!e.url_trigger),event_trigger:o||!(null==e||!e.event_trigger)};Object.values(a).some(Boolean)&&(null==(t=this.sessionManager)||t.checkAndGetSessionAndWindowId(),a.sampling&&(null==(r=this.sessionRecording)||r.overrideSampling()),a.linked_flag&&(null==(i=this.sessionRecording)||i.overrideLinkedFlag()),a.url_trigger&&(null==(n=this.sessionRecording)||n.overrideTrigger("url")),a.event_trigger&&(null==(s=this.sessionRecording)||s.overrideTrigger("event")));this.set_config({disable_session_recording:!1})}stopSessionRecording(){this.set_config({disable_session_recording:!0})}sessionRecordingStarted(){var e;return!(null==(e=this.sessionRecording)||!e.started)}captureException(e,t){if(this.exceptions){var i=new Error("PostHog syntheticException"),n=this.exceptions.buildProperties(e,{handled:!0,syntheticException:i});return this.exceptions.sendExceptionEvent(r({},n,t))}}addExceptionStep(e,t){var r;null==(r=this.exceptions)||r.addExceptionStep(e,t)}captureLog(e){var t;null==(t=this.logs)||t.captureLog(e)}get logger(){var e,t;return null!==(e=null==(t=this.logs)?void 0:t.logger)&&void 0!==e?e:om._noopLogger}startExceptionAutocapture(e){this.set_config({capture_exceptions:null==e||e})}stopExceptionAutocapture(){this.set_config({capture_exceptions:!1})}loadToolbar(e){var t,r;return null!==(t=null==(r=this.toolbar)?void 0:r.loadToolbar(e))&&void 0!==t&&t}get_property(e){var t;return null==(t=this.persistence)?void 0:t.props[e]}getSessionProperty(e){var t;return null==(t=this.sessionPersistence)?void 0:t.props[e]}toString(){var e,t=null!==(e=this.config.name)&&void 0!==e?e:em;return t!==em&&(t=em+"."+t),t}_isIdentified(){var e,t;return(null==(e=this.persistence)?void 0:e.get_property(wo))===Uo||(null==(t=this.sessionPersistence)?void 0:t.get_property(wo))===Uo}_hasPersonProcessing(){var e,t;return!("never"===this.config.person_profiles||this.config.person_profiles===Wo&&!this._isIdentified()&&Gr(this.getGroups())&&(null==(e=this.persistence)||null==(e=e.props)||!e[Ps])&&(null==(t=this.persistence)||null==(t=t.props)||!t[Eo]))}_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({},{})}setInternalOrTestUser(){this._requirePersonProcessing("posthog.setInternalOrTestUser")&&this.setPersonProperties({$internal_or_test_user:!0})}_requirePersonProcessing(e){return"never"===this.config.person_profiles?(us.error(e+' was called, but process_person is set to "never". This call will be ignored.'),!1):(this._register_single(Eo,!0),!0)}_is_persistence_disabled(){if("always"===this.config.cookieless_mode)return!0;var e=this.consent.isOptedOut();return this.config.disable_persistence||e&&!(!this.config.opt_out_persistence_by_default&&this.config.cookieless_mode!==zo)}_sync_opt_out_with_persistence(){var e,t,r,i,n=this._is_persistence_disabled();return(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)),n}opt_in_capturing(e){var t;if(this.config.cookieless_mode!==Vo){if(this._inCookielessMode()){var r,i,n,s,o;this.reset(!0),null==(r=this.sessionManager)||r.destroy(),null==(i=this.pageViewManager)||i.destroy(),this.sessionManager=new Df(this),this.pageViewManager=new nf(this),this.persistence&&(this.sessionPropsManager=new Ff(this,this.sessionManager,this.persistence));var a,l=null!==(n=null==(s=this.config.__extensionClasses)?void 0:s.sessionRecording)&&void 0!==n?n:null==(o=om.__defaultExtensionClasses)?void 0:o.sessionRecording;l&&(this.sessionRecording=this._replaceExtension(this.sessionRecording,new l(this)),this._lastRemoteConfig&&(null==(a=this.sessionRecording)||null==a.onRemoteConfig||a.onRemoteConfig(this._lastRemoteConfig)))}var u,c;this.consent.optInOut(!0),this._sync_opt_out_with_persistence(),this._start_queue_if_opted_in(),null==(t=this.sessionRecording)||t.startIfEnabledOrStop(),this.config.cookieless_mode==zo&&(null==(u=this.surveys)||u.loadIfEnabled()),(Zr(null==e?void 0:e.captureEventName)||null!=e&&e.captureEventName)&&this.capture(null!==(c=null==e?void 0:e.captureEventName)&&void 0!==c?c:"$opt_in",null==e?void 0:e.captureProperties,{send_instantly:!0}),this.config.capture_pageview&&this._captureInitialPageview()}else us.warn(Xf)}opt_out_capturing(){var e,t,r;this.config.cookieless_mode!==Vo?(this.config.cookieless_mode===zo&&this.consent.isOptedIn()&&this.reset(!0),this.consent.optInOut(!1),this._sync_opt_out_with_persistence(),this.config.cookieless_mode===zo&&(this.register({distinct_id:Ro,$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())):us.warn(Xf)}has_opted_in_capturing(){return this.consent.isOptedIn()}has_opted_out_capturing(){return this.consent.isOptedOut()}get_explicit_consent_status(){var e=this.consent.consent;return 1===e?"granted":0===e?"denied":"pending"}is_capturing(){return this.config.cookieless_mode===Vo||(this.config.cookieless_mode===zo?this.consent.isRejected()||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?Bf(Xn,this.config.custom_blocked_useragents):void 0}_captureInitialPageview(){Kn&&("visible"===Kn.visibilityState?this._initialPageviewCaptured||(this._initialPageviewCaptured=!0,this.capture(Zo,{title:Kn.title},{send_instantly:!0}),this._visibilityStateListener&&(Kn.removeEventListener(jo,this._visibilityStateListener),this._visibilityStateListener=null)):this._visibilityStateListener||(this._visibilityStateListener=this._captureInitialPageview.bind(this),bs(Kn,jo,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=this._originalUserConfig||{};return"advanced_disable_flags"in o?!!o.advanced_disable_flags:!1!==this.config.advanced_disable_flags?!!this.config.advanced_disable_flags:!0===this.config.advanced_disable_decide?(us.warn("Config field 'advanced_disable_decide' is deprecated. Please use 'advanced_disable_flags' instead. The old field will be removed in a future major version."),!0):(r="advanced_disable_decide",!1,i=us,n=(t="advanced_disable_flags")in(e=o)&&!Jr(e[t]),s=r in e&&!Jr(e[r]),n?e[t]:!!s&&(i&&i.warn("Config field '"+r+"' is deprecated. Please use '"+t+"' instead. The old field will be removed in a future major version."),e[r]))}_runBeforeSend(e){if(Jr(this.config.before_send))return e;var t=Ur(this.config.before_send)?this.config.before_send:[this.config.before_send],r=e;for(var i of t){if(r=i(r),Jr(r)){var n="Event '"+e.event+"' was rejected in beforeSend function";return Br(Dr,e.event)?us.warn(n+". This can cause unexpected behavior."):us.info(n),null}r.properties&&!Gr(r.properties)||us.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=ti(e)&&!e,r=Gc._is_supported()&&"true"===Gc._get("ph_debug");return!t&&(!!r||e)}}om.__defaultExtensionClasses={},om._noopLogger={trace:jf=()=>{},debug:jf,info:jf,warn:jf,error:jf,fatal:jf},function(e,t){for(var r=0;t.length>r;r++)e.prototype[t[r]]=vs(e.prototype[t[r]])}(om,["identify"]);var am=cs("[ExceptionAutocapture]"),lm=cs("[TracingHeaders]"),um=cs("[Web Vitals]"),cm=9e5,dm="[SessionRecording]",hm=cs(dm),pm=cs("[Heatmaps]");function gm(e){return jr(e)&&"clientX"in e&&"clientY"in e&&Qr(e.clientX)&&Qr(e.clientY)}var _m=cs("[Product Tours]"),vm=["$set_once","$set"],fm=cs("[SiteApps]"),mm="Error while initializing PostHog app with config id ";function ym(e,t,r){if(Jr(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 bm{constructor(e){this._debugEventEmitter=new Nf,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,t;Zr(null==(e=this._instance)?void 0:e._addCaptureHook)||(null==(t=this._instance)||t._addCaptureHook(((e,t)=>{this.on(e,t)})))}register(e){var t,r;if(!Zr(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(!ym(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=>ym(e.href,t.href,t.href_matching||"exact")));var n,s=(null==e||null==(r=e.properties)?void 0:r.$elements_chain)||"";return!!s&&ym((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=>ym(e.text,t.text,t.text_matching||"exact")||ym(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;!Jr(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=>ym(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||Vc(t.properties.reduce(((e,t)=>{var r=Ur(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 wm{constructor(e){this._instance=e,this._eventToItems=new Map,this._cancelEventToItems=new Map,this._actionToItems=new Map}_doesEventMatchFilter(e,t){return!!e&&Vc(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===du?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;Zr(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}));0!==t.length&&(null==this._actionMatcher&&(this._actionMatcher=new bm(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}));0===r.length&&0===i.length||(null==(t=this._instance)||t._addCaptureHook(((e,t)=>{this.onEvent(e,t)})),this._eventToItems=this._buildEventToItemMap(e,du),this._cancelEventToItems=this._buildEventToItemMap(e,hu))}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);0>c||(o.splice(c,1),this._updateActivatedItems(o))}}else{if(this._cancelEventToItems.has(e)){var d=this._getMatchingItems(e,t,hu);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);0>t||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,du);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=this._getLogger(),r=[...new Set(e)].filter((e=>!this._isItemPermanentlyIneligible(e)));t.info("updating activated items",{activatedItems:r}),this._setActivatedItems(r)}getActivatedIds(){var e,t=this._getActivatedKey();return(null==(e=this._instance)||null==(e=e.persistence)?void 0:e.props[t])||[]}getEventToItemsMap(){return this._eventToItems}_getActionMatcher(){return this._actionMatcher}}class Sm extends wm{constructor(e){super(e)}_getActivatedKey(){return _o}_getShownEventName(){return bu.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 Cu}_setActivatedItems(e){var t;null==(t=this._instance)||null==(t=t.persistence)||t.register({[_o]:e})}_isItemPermanentlyIneligible(){return!1}getSurveys(){return this.getActivatedIds()}getEventToSurveys(){return this.getEventToItemsMap()}}var Cm="SDK is not enabled or survey functionality is not yet loaded",Im="Disabled. Not loading surveys.",km=null!=Zn&&Zn.location?Es(Zn.location.hash,"__posthog")||Es(location.hash,"state"):null,xm="_postHogToolbarParams",Em=cs("[Toolbar]"),Tm=cs("[FeatureFlags]"),Rm=cs("[FeatureFlags]",{debugEnabled:!0}),Mm="\" failed. Feature flags didn't load in time.",Lm=e=>{for(var t={},r=0;e.length>r;r++)t[e[r]]=!0;return t},Pm=e=>{var t={};for(var[r,i]of gs(e||{}))i&&(t[r]=i);return t},Am="Refusing to render web experiment since the viewer is a likely bot",Fm={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&&Oc(t.href,e),not_regex:(e,t)=>!!Zn&&!Oc(t.href,e),exact:(e,t)=>t.href===e,is_not:(e,t)=>t.href!==e};class Nm{get _config(){return this._instance.config}constructor(e){var t=this;this.getWebExperimentsAndEvaluateDisplayLogic=function(e){void 0===e&&(e=!1),t.getWebExperiments((e=>{Nm._logInfo("retrieved web experiments from the server"),t._flagToExperiments=new Map,e.forEach((e=>{if(e.feature_flag_key){var r;t._flagToExperiments&&(Nm._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);Yr(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];Nm._matchesTestVariant(s)&&t._applyTransforms(e.name,n,s.transforms)}}))}),e)},this._instance=e,this._instance.onFeatureFlags((e=>{this.onFeatureFlags(e)}))}initialize(){}onFeatureFlags(e){if(this._is_bot())Nm._logInfo(Am);else if(!this._config.disable_web_experiments){if(Jr(this._flagToExperiments))return this._flagToExperiments=new Map,this.loadIfEnabled(),void this.previewWebExperiment();Nm._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=Nm.getWindowLocation();if(null!=e&&e.search){var t=ks(null==e?void 0:e.search,"__experiment_id"),r=ks(null==e?void 0:e.search,"__experiment_variant");t&&r&&(Nm._logInfo("previewing web experiments "+t+" && "+r),this.getWebExperiments((e=>{this._showPreviewWebExperiment(parseInt(t),r,e)}),!1,!0))}}loadIfEnabled(){this._config.disable_web_experiments||this.getWebExperimentsAndEvaluateDisplayLogic()}getWebExperiments(e,t,r){if(this._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._config.token),method:"GET",callback:t=>e(200===t.statusCode&&t.json&&t.json.experiments||[])})}_showPreviewWebExperiment(e,t,r){var i=r.filter((t=>t.id===e));i&&i.length>0&&(Nm._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!Jr(e.conditions)&&Nm._matchUrlConditions(e)&&Nm._matchUTMConditions(e)}static _matchUrlConditions(e){var t;if(Jr(e.conditions)||Jr(null==(t=e.conditions)?void 0:t.url))return!0;var r,i,n,s=Nm.getWindowLocation();return!!s&&(null==(r=e.conditions)||!r.url||Fm[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(Jr(e.conditions)||Jr(null==(t=e.conditions)?void 0:t.utm))return!0;var r=hf();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,g=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&&g&&h}return!1}static _logInfo(e){for(var t=arguments.length,r=new Array(t>1?t-1:0),i=1;t>i;i++)r[i-1]=arguments[i];us.info("[WebExperiments] "+e,r)}_applyTransforms(e,t,r){this._is_bot()?Nm._logInfo(Am):"control"!==t?r.forEach((r=>{if(r.selector){var i;Nm._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)}))}})):Nm._logInfo("Control variants leave the page unmodified.")}_is_bot(){return Xn&&this._instance?Bf(Xn,this._config.custom_blocked_useragents):void 0}}var Om,Dm,Bm=cs("[Conversations]"),Hm="Conversations not available yet.",qm={featureFlags:class{constructor(e){this._override_warning=!1,this._hasLoadedFlags=!1,this._requestInFlight=!1,this._reloadingDisabled=!1,this._additionalReloadRequested=!1,this._flagsLoadedFromRemote=!1,this._hasLoggedDeprecationWarning=!1,this._staleCacheRefreshTriggered=!1,this._instance=e,this.featureFlagEventHandlers=[]}get _config(){return this._instance.config}get _persistence(){return this._instance.persistence}_prop(e){return this._instance.get_property(e)}_isCacheStale(){var e,t;return null!==(e=null==(t=this._persistence)?void 0:t._isFeatureFlagCacheStale(this._config.feature_flag_cache_ttl_ms))&&void 0!==e&&e}_checkAndTriggerStaleRefresh(){return!!this._isCacheStale()&&(this._staleCacheRefreshTriggered||this._requestInFlight||(this._staleCacheRefreshTriggered=!0,Tm.warn("Feature flag cache is stale, triggering refresh..."),this.reloadFeatureFlags()),!0)}_getValidEvaluationEnvironments(){var e,t=null!==(e=this._config.evaluation_contexts)&&void 0!==e?e:this._config.evaluation_environments;return!this._config.evaluation_environments||this._config.evaluation_contexts||this._hasLoggedDeprecationWarning||(Tm.warn("evaluation_environments is deprecated. Use evaluation_contexts instead. evaluation_environments will be removed in a future version."),this._hasLoggedDeprecationWarning=!0),null!=t&&t.length?t.filter((e=>{var t=e&&"string"==typeof e&&e.trim().length>0;return t||Tm.error("Invalid evaluation context found:",e,"Expected non-empty string"),t})):[]}_shouldIncludeEvaluationEnvironments(){return this._getValidEvaluationEnvironments().length>0}initialize(){var e,t,{config:r}=this._instance,i=null!==(e=null==(t=r.bootstrap)?void 0:t.featureFlags)&&void 0!==e?e:{};if(Object.keys(i).length){var n,s,o=null!==(n=null==(s=r.bootstrap)?void 0:s.featureFlagPayloads)&&void 0!==n?n:{},a=Object.keys(i).filter((e=>!!i[e])).reduce(((e,t)=>(e[t]=i[t]||!1,e)),{}),l=Object.keys(o).filter((e=>a[e])).reduce(((e,t)=>(o[t]&&(e[t]=o[t]),e)),{});this.receivedFeatureFlags({featureFlags:a,featureFlagPayloads:l})}}updateFlags(e,t,i){var n=null!=i&&i.merge?this.getFlagVariants():{},s=null!=i&&i.merge?this.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:Zr(null==a?void 0:a[u])?void 0:{id:0,version:void 0,description:void 0,payload:a[u]}}}this.receivedFeatureFlags({flags:l})}get hasLoadedFlags(){return this._hasLoadedFlags}getFlags(){return Object.keys(this.getFlagVariants())}getFlagsWithDetails(){var e=this._prop(oo),t=this._prop(uo),i=this._prop(co);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=Zr(c)?null!==(a=null==u?void 0:u.enabled)&&void 0!==a&&a:!!c,h=Zr(c)?u.variant:"string"==typeof c?c:void 0,p=null==i?void 0:i[o],g=r({},u,{enabled:d,variant:d?null!=h?h:null==u?void 0:u.variant:void 0});d!==(null==u?void 0:u.enabled)&&(g.original_enabled=null==u?void 0:u.enabled),h!==(null==u?void 0:u.variant)&&(g.original_variant=null==u?void 0:u.variant),p&&(g.metadata=r({},null==u?void 0:u.metadata,{payload:p,original_payload:null==u||null==(l=u.metadata)?void 0:l.payload})),n[o]=g}return this._override_warning||(Tm.warn(" Overriding feature flag details!",{flagDetails:e,overriddenPayloads:i,finalDetails:n}),this._override_warning=!0),n}getFlagVariants(){var e=this._prop(io),t=this._prop(uo);if(!t)return e||{};for(var r=ps({},e),i=Object.keys(t),n=0;i.length>n;n++)r[i[n]]=t[i[n]];return this._override_warning||(Tm.warn(" Overriding feature flags!",{enabledFlags:e,overriddenFlags:t,finalFlags:r}),this._override_warning=!0),r}getFlagPayloads(){var e=this._prop(ao),t=this._prop(co);if(!t)return e||{};for(var r=ps({},e||{}),i=Object.keys(t),n=0;i.length>n;n++)r[i[n]]=t[i[n]];return this._override_warning||(Tm.warn(" Overriding feature flag payloads!",{flagPayloads:e,overriddenPayloads:t,finalPayloads:r}),this._override_warning=!0),r}reloadFeatureFlags(){this._reloadingDisabled||this._config.advanced_disable_feature_flags||this._reloadDebouncer||(this._instance._internalEventEmitter.emit("featureFlagsReloading",!0),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._config.token,n=this._prop(Ls),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._persistence)?void 0:t.get_initial_props())||{},this._prop(ho)||{}),group_properties:this._prop(po),timezone:bf()};Kr(n)||Zr(n)||(s.$device_id=n),(null!=e&&e.disableFlags||this._config.advanced_disable_feature_flags)&&(s.disable_flags=!0),this._shouldIncludeEvaluationEnvironments()&&(s.evaluation_contexts=this._getValidEvaluationEnvironments());var o=this._instance.requestRouter.endpointFor("flags","/flags/?v=2"+(this._config.advanced_only_evaluate_survey_feature_flags?"&only_evaluate_survey_feature_flags=true":""));this._requestInFlight=!0,this._instance._send_request({method:"POST",url:o,data:s,compression:this._config.disable_compression?void 0:$u,timeout:this._config.feature_flag_request_timeout_ms,callback:e=>{var t,r,i,n=!0;if(200===e.statusCode&&(this._additionalReloadRequested||(this.$anon_distinct_id=void 0),n=!1),this._requestInFlight=!1,!s.disable_flags||this._additionalReloadRequested){this._flagsLoadedFromRemote=!n;var o=[];e.error?e.error instanceof Error?o.push("AbortError"===e.error.name?"timeout":"connection_error"):o.push("unknown_error"):200!==e.statusCode&&o.push("api_error_"+e.statusCode),null!=(t=e.json)&&t.errorsWhileComputingFlags&&o.push("errors_while_computing_flags");var a,l=!(null==(r=e.json)||null==(r=r.quotaLimited)||!r.includes("feature_flags"));if(l&&o.push("quota_limited"),null==(i=this._persistence)||i.register({[yo]:o}),l)Tm.warn("You have hit your feature flags quota limit, and will not be able to load feature flags until the quota is reset. Please visit https://posthog.com/docs/billing/limits-alerts to learn more.");else s.disable_flags||this.receivedFeatureFlags(null!==(a=e.json)&&void 0!==a?a:{},n,{partialResponse:!!this._config.advanced_only_evaluate_survey_feature_flags}),this._additionalReloadRequested&&(this._additionalReloadRequested=!1,this._callFlagsEndpoint())}}})}}getFeatureFlag(e,t){var r;if(void 0===t&&(t={}),!t.fresh||this._flagsLoadedFromRemote)if(this._hasLoadedFlags||this.getFlags()&&this.getFlags().length>0){if(!this._checkAndTriggerStaleRefresh()){var i=this.getFeatureFlagResult(e,t);return null!==(r=null==i?void 0:i.variant)&&void 0!==r?r:null==i?void 0:i.enabled}}else Tm.warn('getFeatureFlag for key "'+e+Mm)}getFeatureFlagDetails(e){return this.getFlagsWithDetails()[e]}getFeatureFlagPayload(e){var t=this.getFeatureFlagResult(e,{send_event:!1});return null==t?void 0:t.payload}getFeatureFlagResult(e,t){if(void 0===t&&(t={}),!t.fresh||this._flagsLoadedFromRemote)if(this._hasLoadedFlags||this.getFlags()&&this.getFlags().length>0){if(!this._checkAndTriggerStaleRefresh()){var r=this.getFlagVariants(),i=e in r,n=r[e],s=this.getFlagPayloads()[e],o=String(n),a=this._prop(lo)||void 0,l=this._prop(bo)||void 0,u=this._prop(fo)||{};if(this._config.advanced_feature_flags_dedup_per_session){var c,d=this._instance.get_session_id(),h=this._prop(mo);d&&d!==h&&(u={},null==(c=this._persistence)||c.register({[fo]:u,[mo]:d}))}if((t.send_event||!("send_event"in t))&&(!(e in u)||!u[e].includes(o))){var p,g,_,v,f,m,y,b,w,S;Ur(u[e])?u[e].push(o):u[e]=[o],null==(p=this._persistence)||p.register({[fo]:u});var C=this.getFeatureFlagDetails(e),I=[...null!==(g=this._prop(yo))&&void 0!==g?g:[]];Zr(n)&&I.push("flag_missing");var k={$feature_flag:e,$feature_flag_response:n,$feature_flag_payload:s||null,$feature_flag_request_id:a,$feature_flag_evaluated_at:l,$feature_flag_bootstrapped_response:(null==(_=this._config.bootstrap)||null==(_=_.featureFlags)?void 0:_[e])||null,$feature_flag_bootstrapped_payload:(null==(v=this._config.bootstrap)||null==(v=v.featureFlagPayloads)?void 0:v[e])||null,$used_bootstrap_value:!this._flagsLoadedFromRemote};Zr(null==C||null==(f=C.metadata)?void 0:f.version)||(k.$feature_flag_version=C.metadata.version);var x,E=null!==(m=null==C||null==(y=C.reason)?void 0:y.description)&&void 0!==m?m:null==C||null==(b=C.reason)?void 0:b.code;E&&(k.$feature_flag_reason=E),null!=C&&null!=(w=C.metadata)&&w.id&&(k.$feature_flag_id=C.metadata.id),Zr(null==C?void 0:C.original_variant)&&Zr(null==C?void 0:C.original_enabled)||(k.$feature_flag_original_response=Zr(C.original_variant)?C.original_enabled:C.original_variant),null!=C&&null!=(S=C.metadata)&&S.original_payload&&(k.$feature_flag_original_payload=null==C||null==(x=C.metadata)?void 0:x.original_payload),I.length&&(k.$feature_flag_error=I.join(",")),this._instance.capture("$feature_flag_called",k)}if(i){var T=s;if(!Zr(s))try{T=JSON.parse(s)}catch(e){}return{key:e,enabled:!!n,variant:"string"==typeof n?n:void 0,payload:T}}}}else Tm.warn('getFeatureFlagResult for key "'+e+Mm)}getRemoteConfigPayload(e,t){var r=this._config.token,i={distinct_id:this._instance.get_distinct_id(),token:r};this._shouldIncludeEvaluationEnvironments()&&(i.evaluation_contexts=this._getValidEvaluationEnvironments()),this._instance._send_request({method:"POST",url:this._instance.requestRouter.endpointFor("flags","/flags/?v=2"),data:i,compression:this._config.disable_compression?void 0:$u,timeout:this._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={}),!t.fresh||this._flagsLoadedFromRemote){if(this._hasLoadedFlags||this.getFlags()&&this.getFlags().length>0){var r=this.getFeatureFlag(e,t);return Zr(r)?void 0:!!r}Tm.warn('isFeatureEnabled for key "'+e+Mm)}}addFeatureFlagsHandler(e){this.featureFlagEventHandlers.push(e)}removeFeatureFlagsHandler(e){this.featureFlagEventHandlers=this.featureFlagEventHandlers.filter((t=>t!==e))}receivedFeatureFlags(e,t,i){if(this._persistence){this._hasLoadedFlags=!0;var n=this.getFlagVariants(),s=this.getFlagPayloads(),o=this.getFlagsWithDetails();!function(e,t,i,n,s,o){void 0===i&&(i={}),void 0===n&&(n={}),void 0===s&&(s={});var a=(e=>{var t=e.flags;return t?(e.featureFlags=Object.fromEntries(Object.keys(t).map((e=>{var r;return[e,null!==(r=t[e].variant)&&void 0!==r?r:t[e].enabled]}))),e.featureFlagPayloads=Object.fromEntries(Object.keys(t).filter((e=>t[e].enabled)).filter((e=>{var r;return null==(r=t[e].metadata)?void 0:r.payload})).map((e=>{var r;return[e,null==(r=t[e].metadata)?void 0:r.payload]})))):Tm.warn("Using an older version of the feature flags endpoint. Please upgrade your PostHog server to the latest version"),e})(e),l=a.flags,u=a.featureFlags,c=a.featureFlagPayloads;if(u){var d=e.requestId,h=e.evaluatedAt;if(Ur(u)){Tm.warn("v1 of the feature flags endpoint is deprecated. Please use the latest version.");var p={};if(u)for(var g=0;u.length>g;g++)p[u[g]]=!0;t&&t.register({[no]:u,[io]:p})}else{var _=u,v=c,f=l;if(null!=o&&o.partialResponse)_=r({},i,_),v=r({},n,v),f=r({},s,f);else if(e.errorsWhileComputingFlags)if(l){var m=new Set(Object.keys(l).filter((e=>{var t;return!(null!=(t=l[e])&&t.failed)})));_=r({},i,Object.fromEntries(Object.entries(_).filter((e=>{var[t]=e;return m.has(t)})))),v=r({},n,Object.fromEntries(Object.entries(v||{}).filter((e=>{var[t]=e;return m.has(t)})))),f=r({},s,Object.fromEntries(Object.entries(f||{}).filter((e=>{var[t]=e;return m.has(t)}))))}else _=r({},i,_),v=r({},n,v),f=r({},s,f);t&&t.register(r({[no]:Object.keys(Pm(_)),[io]:_||{},[ao]:v||{},[oo]:f||{}},d?{[lo]:d}:{},h?{[bo]:h}:{}))}}}(e,this._persistence,n,s,o,i),t||(this._staleCacheRefreshTriggered=!1),this._fireFeatureFlagsCallbacks(t)}}override(e,t){void 0===t&&(t=!1),Tm.warn("override is deprecated. Please use overrideFeatureFlags instead."),this.overrideFeatureFlags({flags:e,suppressWarning:t})}overrideFeatureFlags(e){if(!this._instance.__loaded||!this._persistence)return Tm.uninitializedWarning("posthog.featureFlags.overrideFeatureFlags");if(!1===e)return this._persistence.unregister(uo),this._persistence.unregister(co),this._fireFeatureFlagsCallbacks(),Rm.info("All overrides cleared");if(Ur(e)){var t=Lm(e);return this._persistence.register({[uo]:t}),this._fireFeatureFlagsCallbacks(),Rm.info("Flag overrides set",{flags:e})}if(e&&"object"==typeof e&&("flags"in e||"payloads"in e)){var r,i=e;if(this._override_warning=Boolean(null!==(r=i.suppressWarning)&&void 0!==r&&r),"flags"in i)if(!1===i.flags)this._persistence.unregister(uo),Rm.info("Flag overrides cleared");else if(i.flags){if(Ur(i.flags)){var n=Lm(i.flags);this._persistence.register({[uo]:n})}else this._persistence.register({[uo]:i.flags});Rm.info("Flag overrides set",{flags:i.flags})}return"payloads"in i&&(!1===i.payloads?(this._persistence.unregister(co),Rm.info("Payload overrides cleared")):i.payloads&&(this._persistence.register({[co]:i.payloads}),Rm.info("Payload overrides set",{payloads:i.payloads}))),void this._fireFeatureFlagsCallbacks()}if(e&&"object"==typeof e)return this._persistence.register({[uo]:e}),this._fireFeatureFlagsCallbacks(),Rm.info("Flag overrides set",{flags:e});Tm.warn("Invalid overrideOptions provided to overrideFeatureFlags",{overrideOptions:e})}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._prop(so)||[]).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._persistence)||n.register({[no]:Object.keys(Pm(l)),[io]:l}),this._fireFeatureFlagsCallbacks()}getEarlyAccessFeatures(e,t,r){void 0===t&&(t=!1);var i=this._prop(so),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._config.token+n),method:"GET",callback:t=>{var r,i;if(t.json){var n=t.json.earlyAccessFeatures;return null==(r=this._persistence)||r.unregister(so),null==(i=this._persistence)||i.register({[so]: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._prop(ho)||{},n=(null==e?void 0:e.$set)||(null!=e&&e.$set_once?{}:e),s=null==e?void 0:e.$set_once,o={};if(s)for(var a in s)({}).hasOwnProperty.call(s,a)&&(a in i||(o[a]=s[a]));this._instance.register({[ho]:r({},i,o,n)}),t&&this._instance.reloadFeatureFlags()}resetPersonPropertiesForFlags(){this._instance.unregister(ho)}setGroupPropertiesForFlags(e,t){void 0===t&&(t=!0);var i=this._prop(po)||{};0!==Object.keys(i).length&&Object.keys(i).forEach((t=>{i[t]=r({},i[t],e[t]),delete e[t]})),this._instance.register({[po]:r({},i,e)}),t&&this._instance.reloadFeatureFlags()}resetGroupPropertiesForFlags(e){if(e){var t=this._prop(po)||{};this._instance.register({[po]:r({},t,{[e]:{}})})}else this._instance.unregister(po)}reset(){this._hasLoadedFlags=!1,this._requestInFlight=!1,this._reloadingDisabled=!1,this._additionalReloadRequested=!1,this._flagsLoadedFromRemote=!1,this.$anon_distinct_id=void 0,this._clearDebouncer(),this._override_warning=!1}}},zm={sessionRecording:class{get _config(){return this._instance.config}get _persistence(){return this._instance.persistence}get started(){var e;return!(null==(e=this._lazyLoadedSessionRecording)||!e.isStarted)}get status(){var e,t;return this._recordingStatus===nv||this._recordingStatus===sv?this._recordingStatus:null!==(e=null==(t=this._lazyLoadedSessionRecording)?void 0:t.status)&&void 0!==e?e:this._recordingStatus}constructor(e){if(this._forceAllowLocalhostNetworkCapture=!1,this._recordingStatus=J_,this._persistFlagsOnSessionListener=void 0,this._instance=e,!this._instance.sessionManager)throw hm.error("started without valid sessionManager"),new Error(dm+" started without valid sessionManager. This is a bug.");if(this._config.cookieless_mode===Vo)throw new Error(dm+' cannot be used with cookieless_mode="always"')}initialize(){this.startIfEnabledOrStop()}get _isRecordingEnabled(){var e,t=!(null==(e=this._instance.get_property($s))||!e.enabled),r=!this._config.disable_session_recording,i=this._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=!Zr(Object.assign)&&!Zr(Array.from);this._isRecordingEnabled&&r?(this._lazyLoadAndStart(e),hm.info("starting")):(this._recordingStatus=J_,this.stopRecording())}}_lazyLoadAndStart(e){var t,r,i;this._isRecordingEnabled&&(this._recordingStatus!==nv&&this._recordingStatus!==sv&&(this._recordingStatus=iv),null!=ns&&null!=(t=ns.__PosthogExtensions__)&&null!=(t=t.rrweb)&&t.record&&null!=(r=ns.__PosthogExtensions__)&&r.initSessionRecording?this._onScriptLoaded(e):null==(i=ns.__PosthogExtensions__)||null==i.loadExternalDependency||i.loadExternalDependency(this._instance,this._scriptName,(t=>{if(t)return hm.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()}_discardRecording(){var e,t;null==(e=this._persistFlagsOnSessionListener)||e.call(this),this._persistFlagsOnSessionListener=void 0,null==(t=this._lazyLoadedSessionRecording)||t.discard()}_resetSampling(){var e;null==(e=this._persistence)||e.unregister(Ys)}_validateSampleRate(e,t){if(Jr(e))return null;var r,i=Qr(e)?e:parseFloat(e);return"number"!=typeof(r=i)||!Number.isFinite(r)||0>r||r>1?(hm.warn(t+" must be between 0 and 1. Ignoring invalid value:",e),null):i}_persistRemoteConfig(e){if(this._persistence){var t,i,n=this._persistence,s=()=>{var t,i=!1===e.sessionRecording?void 0:e.sessionRecording,s=this._validateSampleRate(null==(t=this._config.session_recording)?void 0:t.sampleRate,"session_recording.sampleRate"),o=this._validateSampleRate(null==i?void 0:i.sampleRate,"remote config sampleRate"),a=null!=s?s:o;Jr(a)&&this._resetSampling();var l=null==i?void 0:i.minimumDurationMilliseconds;n.register({[$s]:r({cache_timestamp:Date.now(),enabled:!!i},i,{networkPayloadCapture:r({capturePerformance:e.capturePerformance},null==i?void 0:i.networkPayloadCapture),canvasRecording:{enabled:null==i?void 0:i.recordCanvas,fps:null==i?void 0:i.canvasFps,quality:null==i?void 0:i.canvasQuality},sampleRate:a,minimumDurationMilliseconds:Zr(l)?null:l,endpoint:null==i?void 0:i.endpoint,triggerMatchType:null==i?void 0:i.triggerMatchType,masking:null==i?void 0:i.masking,urlTriggers:null==i?void 0:i.urlTriggers,version:null==i?void 0:i.version,triggerGroups:null==i?void 0:i.triggerGroups})})};s(),null==(t=this._persistFlagsOnSessionListener)||t.call(this),this._persistFlagsOnSessionListener=null==(i=this._instance.sessionManager)?void 0:i.onSessionId(s)}}onRemoteConfig(e){return"sessionRecording"in e?!1===e.sessionRecording?(this._persistRemoteConfig(e),void this._discardRecording()):(this._persistRemoteConfig(e),void this.startIfEnabledOrStop()):(this._recordingStatus===nv&&(this._recordingStatus=sv,hm.warn("config refresh failed, recording will not start until page reload")),void this.startIfEnabledOrStop())}log(e,t){var r;void 0===t&&(t="log"),null!=(r=this._lazyLoadedSessionRecording)&&r.log?this._lazyLoadedSessionRecording.log(e,t):hm.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($s);return(null==r||null==(t=r.scriptConfig)?void 0:t.script)||"lazy-recorder"}_isRemoteConfigFresh(){var e,t=this._instance.get_property($s);if(!t)return!1;var r=null!==(e=("object"==typeof t?t:JSON.parse(t)).cache_timestamp)&&void 0!==e?e:Date.now();return Date.now()-r<=Av}_onScriptLoaded(e){var t,r;if(null==(t=ns.__PosthogExtensions__)||!t.initSessionRecording)return hm.warn("Called on script loaded before session recording is available. This can be caused by adblockers."),void this._instance.register_for_session({[Po]:!0});if(this._lazyLoadedSessionRecording||(this._lazyLoadedSessionRecording=null==(r=ns.__PosthogExtensions__)?void 0:r.initSessionRecording(this._instance),this._lazyLoadedSessionRecording._forceAllowLocalhostNetworkCapture=this._forceAllowLocalhostNetworkCapture),!this._isRemoteConfigFresh()){if(this._recordingStatus===sv||this._recordingStatus===nv)return;return this._recordingStatus=nv,hm.info("persisted remote config is stale, requesting fresh config before starting"),void new Ef(this._instance).load()}this._recordingStatus=iv,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._persistence)||t.register({[Ws]:!0}),null==(e=this._lazyLoadedSessionRecording)||e.overrideLinkedFlag()}overrideSampling(){var e,t;this._lazyLoadedSessionRecording||null==(t=this._persistence)||t.register({[Us]:!0}),null==(e=this._lazyLoadedSessionRecording)||e.overrideSampling()}overrideTrigger(e){var t,r;this._lazyLoadedSessionRecording||null==(r=this._persistence)||r.register({["url"===e?js:Gs]:!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))}}},Vm={autocapture:class{constructor(e){this._initialized=!1,this._isDisabledServerSide=null,this._elementsChainAsString=!1,this.instance=e,this.rageclicks=new z_(e.config.rageclick),this._elementSelectors=null}initialize(){this.startIfEnabled()}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){$_.error("Failed to capture event",e)}};if(bs(Kn,"submit",e,{capture:!0}),bs(Kn,"change",e,{capture:!0}),bs(Kn,"click",e,{capture:!0}),this._config.capture_copied_text){var t=e=>{this._captureEvent(e=e||(null==Zn?void 0:Zn.event),V_)};bs(Kn,"copy",t,{capture:!0}),bs(Kn,"cut",t,{capture:!0})}}}else $_.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];if(Kr(this._isDisabledServerSide)&&!ti(r)&&!this.instance._shouldDisableFlags())return!1;var i=null!==(t=this._isDisabledServerSide)&&void 0!==t?t:!!r;return!!this.instance.config.autocapture&&!i}_captureEvent(e,t){if(void 0===t&&(t="$autocapture"),this.isEnabled){var r,i=la(e);ta(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())&&function(e,t){if(!Zn||ga(e))return!1;var r,i,n;if(ti(t)?(r=!!t&&pa,i=void 0):(r=null!==(n=null==t?void 0:t.css_selector_ignorelist)&&void 0!==n?n:pa,i=null==t?void 0:t.content_ignorelist),!1===r)return!1;var{targetElementList:s}=_a(e,!1);return!function(e,t){if(!1===e||Zr(e))return!1;var r;if(!0===e)r=ha;else{if(!Ur(e))return!1;if(e.length>10)return us.error("[PostHog] content_ignorelist array cannot exceed 10 items. Use css_selector_ignorelist for more complex matching."),!1;r=e.map((e=>e.toLowerCase()))}return t.some((e=>{var{safeText:t,ariaLabel:i}=e;return r.some((e=>t.includes(e)||i.includes(e)))}))}(i,s.map((e=>{var t;return{safeText:aa(e).toLowerCase(),ariaLabel:(null==(t=e.getAttribute("aria-label"))?void 0:t.toLowerCase().trim())||""}})))&&!ca(s,r)}(i,this.instance.config.rageclick)&&this._captureEvent(e,"$rageclick");var n=t===V_;if(i&&function(e,t,r,i,n){var s,o,a,l;if(void 0===r&&(r=void 0),!Zn||ga(e))return!1;if(null!=(s=r)&&s.url_allowlist&&!na(r.url_allowlist))return!1;if(null!=(o=r)&&o.url_ignorelist&&na(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}=_a(e,i);if(!function(e,t){var r=null==t?void 0:t.element_allowlist;if(Zr(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(!ca(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&&(ua.indexOf(p)>-1||"true"===e.getAttribute("contenteditable"))}}(i,e,this._config,n,n?["copy","cut"]:void 0)){var{props:s,explicitNoCapture:o}=j_(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===V_){var l,u=oa(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 Wr(null==Kn?void 0:Kn.querySelectorAll)}},historyAutocapture:class{constructor(e){var t;this._instance=e,this._lastPathname=(null==Zn||null==(t=Zn.location)?void 0:t.pathname)||""}initialize(){this.startIfEnabled()}get isEnabled(){return"history_change"===this._instance.config.capture_pageview}startIfEnabled(){this.isEnabled&&(us.info("History API monitoring enabled, starting..."),this.monitorHistoryChanges())}stop(){this._popstateListener&&this._popstateListener(),this._popstateListener=void 0,us.info("History API monitoring stopped")}monitorHistoryChanges(){var e,t;if(Zn&&Zn.history){var r=this;null!=(e=Zn.history.pushState)&&e.__posthog_wrapped__||Ts(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__||Ts(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(Zo,{navigation_type:e}),this._lastPathname=r}catch(t){us.error("Error capturing "+e+" pageview",t)}}_setupPopstateListener(){if(!this._popstateListener){var e=()=>{this._capturePageview("popstate")};bs(Zn,"popstate",e),this._popstateListener=()=>{Zn&&Zn.removeEventListener("popstate",e)}}}},heatmaps:class{get _config(){return this.instance.config}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[Ns]),this.rageclicks=new z_(e.config.rageclick)}initialize(){this.startIfEnabled()}get flushIntervalMilliseconds(){var e=5e3;return jr(this._config.capture_heatmaps)&&this._config.capture_heatmaps.flush_interval_milliseconds&&(e=this._config.capture_heatmaps.flush_interval_milliseconds),e}get isEnabled(){return Jr(this._config.capture_heatmaps)?Jr(this._config.enable_heatmaps)?this._enabledServerSide:this._config.enable_heatmaps:!1!==this._config.capture_heatmaps}startIfEnabled(){if(this.isEnabled){if(this._initialized)return;pm.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){if("heatmaps"in e){var t=!!e.heatmaps;this.instance.persistence&&this.instance.persistence.register({[Ns]: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),bs(Zn,Go,this._flushHandler),this._onClickHandler=e=>this._onClick(e||(null==Zn?void 0:Zn.event)),bs(Kn,"click",this._onClickHandler,{capture:!0}),this._onMouseMoveHandler=e=>this._onMouseMove(e||(null==Zn?void 0:Zn.event)),bs(Kn,"mousemove",this._onMouseMoveHandler,{capture:!0}),this._deadClicksCapture=new Jv(this.instance,Xv,this._onDeadClick.bind(this)),this._deadClicksCapture.startIfEnabledOrStop(),this._onVisibilityChange_handler=this._onVisibilityChange.bind(this),bs(Kn,jo,this._onVisibilityChange_handler),this._initialized=!0)}_removeListeners(){var e;Zn&&Kn&&(this._flushHandler&&Zn.removeEventListener(Go,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(jo,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&&Qo(i)&&!ea(i,"body");){if(i===r)return!1;if(Br(t,null==Zn?void 0:Zn.getComputedStyle(i).position))return!0;i=da(i)}return!1}(la(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"),!Jo(e.target)&&gm(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){!Jo(e.target)&&gm(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._config.custom_personal_data_properties,i=this._config.mask_personal_data_properties?[...lf,...r||[]]:[],n=xs(t,i,cf);this._buffer=this._buffer||{},this._buffer[n]||(this._buffer[n]=[]),this._buffer[n].push(e)}}_flush(){this._buffer&&!Gr(this._buffer)&&this.instance.capture("$$heatmap",{$heatmap_data:this.getAndClearBuffer()})}},deadClicksAutocapture:Jv,webVitalsAutocapture:class{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(Zr(i))um.error("Could not read session ID. Dropping metrics!");else{this._buffer=this._buffer||{url:void 0,metrics:[],firstMetricTimestamp:void 0};var n=this._currentURL();Zr(n)||(Jr(null==e?void 0:e.name)||Jr(null==e?void 0:e.value)?um.error("Invalid metric received",e):!this._maxAllowedValue||this._maxAllowedValue>e.value?(this._buffer.url!==n&&(this._flushToCapture(),this._delayedFlushTimer=setTimeout(this._flushToCapture,this.flushToCaptureTimeoutMs)),Zr(this._buffer.url)&&(this._buffer.url=n),this._buffer.firstMetricTimestamp=Zr(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()):um.error("Ignoring metric with value >= "+this._maxAllowedValue,e))}},this._startCapturing=()=>{if(!this._initialized){var e,t,r,i,n=ns.__PosthogExtensions__;Zr(n)||Zr(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):um.error("web vitals callbacks not loaded - not starting")}},this._instance=e,this._enabledServerSide=!(null==(t=this._instance.persistence)||!t.props[Hs]),this.startIfEnabled()}get _perfConfig(){return this._instance.config.capture_performance}get allowedMetrics(){var e,t,r=jr(this._perfConfig)?null==(e=this._perfConfig)?void 0:e.web_vitals_allowed_metrics:void 0;return Jr(r)?(null==(t=this._instance.persistence)?void 0:t.props[Vs])||["CLS","FCP","INP","LCP"]:r}get flushToCaptureTimeoutMs(){return(jr(this._perfConfig)?this._perfConfig.web_vitals_delayed_flush_ms:void 0)||5e3}get useAttribution(){var e=jr(this._perfConfig)?this._perfConfig.web_vitals_attribution:void 0;return null!=e&&e}get _maxAllowedValue(){var e=jr(this._perfConfig)&&Qr(this._perfConfig.__web_vitals_max_value)?this._perfConfig.__web_vitals_max_value:cm;return e>0&&6e4>=e?cm:e}get isEnabled(){var e=null==Jn?void 0:Jn.protocol;if("http:"!==e&&"https:"!==e)return um.info("Web Vitals are disabled on non-http/https protocols"),!1;var t=jr(this._perfConfig)?this._perfConfig.web_vitals:ti(this._perfConfig)?this._perfConfig:void 0;return ti(t)?t:this._enabledServerSide}startIfEnabled(){this.isEnabled&&!this._initialized&&(um.info("enabled, starting..."),this._loadScript(this._startCapturing))}onRemoteConfig(e){if("capturePerformance"in 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({[Hs]:t}),this._instance.persistence.register({[Vs]:r})),this._enabledServerSide=t,this.startIfEnabled()}}_loadScript(e){var t,r;null!=(t=ns.__PosthogExtensions__)&&t.postHogWebVitalsCallbacks?e():null==(r=ns.__PosthogExtensions__)||null==r.loadExternalDependency||r.loadExternalDependency(this._instance,this.useAttribution?"web-vitals-with-attribution":"web-vitals",(t=>{t?um.error("failed to load script",t):e()}))}_currentURL(){var e=Zn?Zn.location.href:void 0;if(e){var t=this._instance.config.custom_personal_data_properties,r=this._instance.config.mask_personal_data_properties?[...lf,...t||[]]:[];return xs(e,r,cf)}um.error("Could not determine current URL")}}},$m={exceptionObserver:class{constructor(e){var t,r,i;this._startCapturing=()=>{var e;if(Zn&&this.isEnabled&&null!=(e=ns.__PosthogExtensions__)&&e.errorWrappingFunctions){var t=ns.__PosthogExtensions__.errorWrappingFunctions.wrapOnError,r=ns.__PosthogExtensions__.errorWrappingFunctions.wrapUnhandledRejection,i=ns.__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){am.error("failed to start",e),this._stopCapturing()}}},this._instance=e,this._remoteEnabled=!(null==(t=this._instance.persistence)||!t.props[Os]),this._rateLimiter=new ci({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:am}),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):(Zr(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?(am.info("enabled"),this._stopCapturing(),this._loadScript(this._startCapturing)):this._stopCapturing()}_loadScript(e){var t,r;null!=(t=ns.__PosthogExtensions__)&&t.errorWrappingFunctions&&e(),null==(r=ns.__PosthogExtensions__)||null==r.loadExternalDependency||r.loadExternalDependency(this._instance,"exception-autocapture",(t=>{if(t)return am.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){"autocaptureExceptions"in e&&(this._remoteEnabled=!!e.autocaptureExceptions||!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,n=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(n)?am.info("Skipping exception capture because of client rate limiting.",{exception:n}):null==(i=this._instance.exceptions)||i.sendExceptionEvent(e)}},exceptions:class{constructor(e){var t,r;this._suppressionRules=[],this._errorPropertiesBuilder=t_(),this._instance=e,this._suppressionRules=null!==(t=null==(r=this._instance.persistence)?void 0:r.get_property(Ds))&&void 0!==t?t:[],this._exceptionStepsConfig=Wn(this._getExceptionStepsConfig()),this._exceptionStepsBuffer=new jn(this._exceptionStepsConfig)}onConfigChange(){this._exceptionStepsConfig=Wn(this._getExceptionStepsConfig()),this._exceptionStepsBuffer.setConfig(this._exceptionStepsConfig)}onRemoteConfig(e){var t,r,i;if("errorTracking"in e){var n=null!==(t=null==(r=e.errorTracking)?void 0:r.suppressionRules)&&void 0!==t?t:[],s=null==(i=e.errorTracking)?void 0:i.captureExtensionExceptions;this._suppressionRules=n,this._instance.persistence&&this._instance.persistence.register({[Ds]:this._suppressionRules,[Bs]:s})}}get _captureExtensionExceptions(){var e,t=!!this._instance.get_property(Bs),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}})}addExceptionStep(e,t){if(this._exceptionStepsConfig.enabled)try{if(!Yr(e)||0===e.trim().length)return void e_.warn("Ignoring exception step because message must be a non-empty string");var i=this._coerceExceptionStepProperties(t),{sanitizedProperties:n,droppedKeys:s}=function(e){if(!e)return{sanitizedProperties:{},droppedKeys:[]};var t=[];return{sanitizedProperties:Object.keys(e).reduce(((r,i)=>$n.has(i)?(t.push(i),r):(r[i]=e[i],r)),{}),droppedKeys:t}}(i);s.length>0&&e_.warn("Ignoring reserved exception step fields",{droppedKeys:s}),this._exceptionStepsBuffer.add(r({[zn]:e,[Vn]:(new Date).toISOString()},n))}catch(e){e_.error("Failed to add exception step. Ignoring breadcrumb.",e)}}sendExceptionEvent(e){try{var t=e.$exception_list;if(this._isExceptionList(t)){if(this._matchesSuppressionRule(t))return this._addDroppedExceptionStep("Exception dropped: matched a suppression rule"),void e_.info("Skipping exception capture because a suppression rule matched");if(!this._captureExtensionExceptions&&this._isExtensionException(t))return this._addDroppedExceptionStep("Exception dropped: thrown by a browser extension"),void e_.info("Skipping exception capture because it was thrown by an extension");if(!this._instance.config.error_tracking.__capturePostHogExceptions&&this._isPostHogException(t))return this._addDroppedExceptionStep("Exception dropped: thrown by the PostHog SDK"),void e_.info("Skipping exception capture because it was thrown by the PostHog SDK")}var r=this._exceptionStepsConfig.enabled&&Jr(e.$exception_steps)?this._addBufferedExceptionSteps(e):e;try{var i=this._instance.capture("$exception",r,{_noTruncate:!0,_batchKey:"exceptionEvent",_originatedFromCaptureException:!0});return i&&this._exceptionStepsBuffer.clear(),i}catch(e){return e_.error("Failed to capture exception event. Dropping this exception.",e),void this._exceptionStepsBuffer.clear()}}catch(e){return void e_.error("Failed to process exception event. Ignoring this exception.",e)}}_addBufferedExceptionSteps(e){try{var t=this._exceptionStepsBuffer.getAttachable();return 0===t.length?e:r({},e,{$exception_steps:t})}catch(t){return e_.error("Failed to read buffered exception steps. Capturing exception without steps.",t),e}}_addDroppedExceptionStep(e){this._exceptionStepsConfig.enabled&&this._exceptionStepsBuffer.add({[zn]:e,[Vn]:(new Date).toISOString()})}_coerceExceptionStepProperties(e){return jr(e)?r({},e):{}}_getExceptionStepsConfig(){var e,t;return null!==(e=null==(t=this._instance.config.error_tracking)?void 0:t.exception_steps)&&void 0!==e?e:{}}_matchesSuppressionRule(e){if(0===e.length)return!1;var t=e.reduce(((e,t)=>{var{type:r,value:i}=t;return Yr(r)&&r.length>0&&e.$exception_types.push(r),Yr(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=Bc[e.operator],n=Ur(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!Jr(e)&&Ur(e)}}},Um=r({productTours:class{get _persistence(){return this._instance.persistence}constructor(e){this._productTourManager=null,this._cachedTours=null,this._instance=e}initialize(){this.loadIfEnabled()}onRemoteConfig(e){"productTours"in e&&(this._persistence&&this._persistence.register({[zs]:!!e.productTours}),this.loadIfEnabled())}loadIfEnabled(){var e,t;this._productTourManager||(e=this._instance).config.disable_product_tours||null==(t=e.persistence)||!t.get_property(zs)||this._loadScript((()=>this._startProductTours()))}_loadScript(e){var t,r;null!=(t=ns.__PosthogExtensions__)&&t.generateProductTours?e():null==(r=ns.__PosthogExtensions__)||null==r.loadExternalDependency||r.loadExternalDependency(this._instance,"product-tours",(t=>{t?_m.error("Could not load product tours script",t):e()}))}_startProductTours(){var e;!this._productTourManager&&null!=(e=ns.__PosthogExtensions__)&&e.generateProductTours&&(this._productTourManager=ns.__PosthogExtensions__.generateProductTours(this._instance,!0))}getProductTours(e,t){if(void 0===t&&(t=!1),!Ur(this._cachedTours)||t){var r=this._persistence;if(r){var i=r.props[vo];if(Ur(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 _m.error(n),void e([],{isLoaded:!1,error:n})}var s=Ur(t.json.product_tours)?t.json.product_tours:[];this._cachedTours=s,r&&r.register({[vo]:s}),e(s,{isLoaded:!0})}})}else e(this._cachedTours,{isLoaded:!0})}getActiveProductTours(e){Jr(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._persistence)||e.unregister(vo)}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)}}},qm),Wm={siteApps:class{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=ns._POSTHOG_REMOTE_CONFIG)||null==(e=e[this._instance.config.token])?void 0:e.siteApps}initialize(){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,g]of Object.entries(h))c[p]={id:d[p],type:p,properties:g};var{$set_once:_,$set:v}=e;return{event:r({},i(e,vm),{properties:r({},e.properties,v?{$set:r({},null!==(t=null==(n=e.properties)?void 0:n.$set)&&void 0!==t?t:{},v)}:{},_?{$set_once:r({},null!==(s=null==(o=e.properties)?void 0:o.$set_once)&&void 0!==s?s:{},_)}:{}),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&&(fm.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,fm.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){fm.error(mm+e.id,t),n(!1)}if(i&&t.loaded)try{r()}catch(r){fm.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){fm.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 fm.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;ns["__$$ph_site_app_"+e]=n._instance,null==(t=ns.__PosthogExtensions__)||null==t.loadSiteApp||t.loadSiteApp(n._instance,a,(t=>{if(t)return fm.error(mm+e,t)}))};for(var{id:o,url:a}of e.siteApps)s(o)}else fm.error('PostHog site apps are disabled. Enable the "opt_in_site_apps" config to proceed.')}}},jm={tracingHeaders:class{constructor(e){this._restoreXHRPatch=void 0,this._restoreFetchPatch=void 0,this._startCapturing=()=>{var e,t,r=this._getConfiguredHostnames()||[];Zr(this._restoreXHRPatch)&&(null==(e=ns.__PosthogExtensions__)||null==(e=e.tracingHeadersPatchFns)||e._patchXHR(r,this._instance.get_distinct_id(),this._instance.sessionManager)),Zr(this._restoreFetchPatch)&&(null==(t=ns.__PosthogExtensions__)||null==(t=t.tracingHeadersPatchFns)||t._patchFetch(r,this._instance.get_distinct_id(),this._instance.sessionManager))},this._instance=e}initialize(){this.startIfEnabledOrStop()}_loadScript(e){var t,r;null!=(t=ns.__PosthogExtensions__)&&t.tracingHeadersPatchFns&&e(),null==(r=ns.__PosthogExtensions__)||null==r.loadExternalDependency||r.loadExternalDependency(this._instance,"tracing-headers",(t=>{if(t)return lm.error("failed to load script",t);e()}))}_getConfiguredHostnames(){var e;return null!==(e=this._instance.config.addTracingHeaders)&&void 0!==e?e:this._instance.config.__add_tracing_headers}startIfEnabledOrStop(){var e,t;this._getConfiguredHostnames()?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)}}},Gm=r({surveys:class{get _config(){return this._instance.config}constructor(e){this._isSurveysEnabled=void 0,this._surveyManager=null,this._isInitializingSurveys=!1,this._surveyCallbacks=[],this._getSurveysInFlightPromise=null,this._instance=e,this._surveyEventReceiver=null}initialize(){this.loadIfEnabled()}onRemoteConfig(e){if(!this._config.disable_surveys){var t=e.surveys;if(Jr(t))return Cu.warn("Flags not loaded yet. Not loading surveys.");var r=Ur(t);this._isSurveysEnabled=r?t.length>0:t,Cu.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(Eu)||null!=r&&r.startsWith(Tu))&&e.push(r)}e.forEach((e=>localStorage.removeItem(e)))}loadIfEnabled(){if(!this._surveyManager)if(this._isInitializingSurveys)Cu.info("Already initializing surveys, skipping...");else if(this._config.disable_surveys)Cu.info(Im);else if(this._config.cookieless_mode&&this._instance.consent.isOptedOut())Cu.info("Not loading surveys in cookieless mode without consent.");else{var e=null==ns?void 0:ns.__PosthogExtensions__;if(e){if(!Zr(this._isSurveysEnabled)||this._config.advanced_enable_surveys){var t=this._isSurveysEnabled||this._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(qo);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 Cu.error("PostHog Extensions not found.")}}_completeSurveyInitialization(e,t){this._surveyManager=e(this._instance,t),this._surveyEventReceiver=new Sm(this._instance),Cu.info("Surveys loaded successfully"),this._notifySurveyCallbacks({isLoaded:!0})}_handleSurveyLoadError(e,t){Cu.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._config.disable_surveys)return Cu.info(Im),e([]);var r,i=this._instance.get_property(go);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._config.token),method:"GET",timeout:this._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;Cu.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=>Iu(e)&&(ku(e)||xu(e))));u.length>0&&(null==(a=this._surveyEventReceiver)||a.register(u)),null==(i=this._instance.persistence)||i.register({[go]: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){Cu.error("Error in survey callback",e)}}getActiveMatchingSurveys(e,t){if(void 0===t&&(t=!1),!Jr(this._surveyManager))return this._surveyManager.getActiveMatchingSurveys(e,t);Cu.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(Jr(this._surveyManager))return{eligible:!1,reason:Cm};var t="string"==typeof e?this._getSurveyById(e):e;return t?this._surveyManager.checkSurveyEligibility(t):{eligible:!1,reason:"Survey not found"}}canRenderSurvey(e){if(Jr(this._surveyManager))return Cu.warn("init was not called"),{visible:!1,disabledReason:Cm};var t=this._checkSurveyEligibility(e);return{visible:t.eligible,disabledReason:t.reason}}canRenderSurveyAsync(e,t){return Jr(this._surveyManager)?(Cu.warn("init was not called"),Promise.resolve({visible:!1,disabledReason:Cm})):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,r){var i;if(Jr(this._surveyManager))Cu.warn("init was not called");else{var n="string"==typeof e?this._getSurveyById(e):e;if(null!=n&&n.id)if(Au.includes(n.type)){var s=null==Kn?void 0:Kn.querySelector(t);if(s)return null!=(i=n.appearance)&&i.surveyPopupDelaySeconds?(Cu.info("Rendering survey "+n.id+" with delay of "+n.appearance.surveyPopupDelaySeconds+" seconds"),void setTimeout((()=>{var e,t;Cu.info("Rendering survey "+n.id+" with delay of "+(null==(e=n.appearance)?void 0:e.surveyPopupDelaySeconds)+" seconds"),null==(t=this._surveyManager)||t.renderSurvey(n,s,r),Cu.info("Survey "+n.id+" rendered")}),1e3*n.appearance.surveyPopupDelaySeconds)):void this._surveyManager.renderSurvey(n,s,r);Cu.warn("Survey element not found")}else Cu.warn("Surveys of type "+n.type+" cannot be rendered in the app");else Cu.warn("Survey not found")}}displaySurvey(e,t){var i;if(Jr(this._surveyManager))Cu.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})})),t.displayType!==Su&&t.initialResponses&&Cu.warn("initialResponses is only supported for popover surveys. prefill will not be applied."),!1===t.ignoreConditions){var o=this.canRenderSurvey(n);if(!o.visible)return void Cu.warn("Survey is not eligible to be displayed: ",o.disabledReason)}"inline"!==t.displayType?this._surveyManager.handlePopoverSurvey(s,t):this.renderSurvey(s,t.selector,t.properties)}else Cu.warn("Survey not found")}}cancelPendingSurvey(e){Jr(this._surveyManager)?Cu.warn("init was not called"):this._surveyManager.cancelSurvey(e)}handlePageUnload(){var e;null==(e=this._surveyManager)||e.handlePageUnload()}}},qm),Zm={toolbar:class{constructor(e){this.instance=e}_setToolbarState(e){ns.ph_toolbar_state=e}_getToolbarState(){var e;return null!==(e=ns.ph_toolbar_state)&&void 0!==e?e:0}initialize(){return this.maybeLoadToolbar()}maybeLoadToolbar(e,t,r){if(void 0===e&&(e=void 0),void 0===t&&(t=void 0),void 0===r&&(r=void 0),ws(this.instance.config))return!1;if(!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=km||Es(e.hash,"__posthog")||Es(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(xm)||"{}")).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=ns.ph_load_toolbar||ns.ph_load_editor;!Jr(t)&&Wr(t)?t(e,this.instance):Em.warn("No toolbar load function found")}loadToolbar(e){var t=!(null==Kn||!Kn.getElementById(To));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(xm,JSON.stringify(r({},n,{source:void 0}))),2===this._getToolbarState())this._callLoadToolbar(n);else if(0===this._getToolbarState()){var s;this._setToolbarState(1),null==(s=ns.__PosthogExtensions__)||null==s.loadExternalDependency||s.loadExternalDependency(this.instance,"toolbar",(e=>{if(e)return Em.error("[Toolbar] Failed to load",e),void this._setToolbarState(0);this._setToolbarState(2),this._callLoadToolbar(n)})),bs(Zn,"turbolinks:load",(()=>{this._setToolbarState(0),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)}}},Ym=r({experiments:Nm},qm),Xm={conversations:class{constructor(e){this._isConversationsEnabled=void 0,this._conversationsManager=null,this._isInitializing=!1,this._remoteConfig=null,this._instance=e}initialize(){this.loadIfEnabled()}onRemoteConfig(e){if(!this._instance.config.disable_conversations){var t=e.conversations;Jr(t)||(ti(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||ws(this._instance.config)||this._instance.config.cookieless_mode&&this._instance.consent.isOptedOut())){var e=null==ns?void 0:ns.__PosthogExtensions__;if(e&&!Zr(this._isConversationsEnabled)&&this._isConversationsEnabled)if(this._remoteConfig&&this._remoteConfig.token){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(qo);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 Bm.error("Conversations enabled but missing token in remote config.")}}_completeInitialization(e){if(this._remoteConfig)try{this._conversationsManager=e(this._remoteConfig,this._instance),Bm.info("Conversations loaded successfully")}catch(e){this._handleLoadError("Error completing conversations initialization",e)}else Bm.error("Cannot complete initialization: remote config is null")}_handleLoadError(e,t){Bm.error(e,t),this._conversationsManager=null,this._isInitializing=!1}show(){this._conversationsManager?this._conversationsManager.show():Bm.warn("Conversations not loaded yet.")}hide(){this._conversationsManager&&this._conversationsManager.hide()}isAvailable(){return!0===this._isConversationsEnabled&&!Kr(this._conversationsManager)}isVisible(){var e,t;return null!==(e=null==(t=this._conversationsManager)?void 0:t.isVisible())&&void 0!==e&&e}sendMessage(e,r,i){var n=this;return t((function*(){return n._conversationsManager?n._conversationsManager.sendMessage(e,r,i):(Bm.warn(Hm),null)}))()}getMessages(e,r){var i=this;return t((function*(){return i._conversationsManager?i._conversationsManager.getMessages(e,r):(Bm.warn(Hm),null)}))()}markAsRead(e){var r=this;return t((function*(){return r._conversationsManager?r._conversationsManager.markAsRead(e):(Bm.warn(Hm),null)}))()}getTickets(e){var r=this;return t((function*(){return r._conversationsManager?r._conversationsManager.getTickets(e):(Bm.warn(Hm),null)}))()}requestRestoreLink(e){var r=this;return t((function*(){return r._conversationsManager?r._conversationsManager.requestRestoreLink(e):(Bm.warn(Hm),null)}))()}restoreFromToken(e){var r=this;return t((function*(){return r._conversationsManager?r._conversationsManager.restoreFromToken(e):(Bm.warn(Hm),null)}))()}restoreFromUrlToken(){var e=this;return t((function*(){return e._conversationsManager?e._conversationsManager.restoreFromUrlToken():(Bm.warn(Hm),null)}))()}getCurrentTicketId(){var e,t;return null!==(e=null==(t=this._conversationsManager)?void 0:t.getCurrentTicketId())&&void 0!==e?e:null}getWidgetSessionId(){var e,t;return null!==(e=null==(t=this._conversationsManager)?void 0:t.getWidgetSessionId())&&void 0!==e?e:null}_onIdentityChanged(){var e;null==(e=this._conversationsManager)||e.setIdentity()}_onIdentityCleared(){var e;null==(e=this._conversationsManager)||e.clearIdentity()}}},Km={logs:class{constructor(e){var t;this._isLogsEnabled=!1,this._isLoaded=!1,this._logger=cs("[logs]"),this._logBuffer=[],this._intervalLogCount=0,this._intervalWindowStart=0,this._droppedWarned=!1,this._instance=e,this._instance&&null!=(t=this._instance.config.logs)&&t.captureConsoleLogs&&(this._isLogsEnabled=!0)}initialize(){this.loadIfEnabled()}onRemoteConfig(e){var t,r=null==(t=e.logs)?void 0:t.captureConsoleLogs;!Jr(r)&&r&&(this._isLogsEnabled=!0,this.loadIfEnabled())}reset(){this._logBuffer=[],this._flushTimeout&&(clearTimeout(this._flushTimeout),this._flushTimeout=void 0),this._intervalLogCount=0,this._intervalWindowStart=0,this._droppedWarned=!1}loadIfEnabled(){if(this._isLogsEnabled&&!this._isLoaded){var e=null==ns?void 0:ns.__PosthogExtensions__;if(e){var t=e.loadExternalDependency;t?t(this._instance,"logs",(t=>{var r;t||null==(r=e.logs)||!r.initializeLogs?this._logger.error("Could not load logs script",t):(e.logs.initializeLogs(this._instance),this._isLoaded=!0)})):this._logger.error(qo)}else this._logger.error("PostHog Extensions not found.")}}captureLog(e){var t,i,n,s,o,a;if(this._instance.is_capturing())if(e&&e.body){var l=null!==(t=null==(i=this._instance.config.logs)?void 0:i.flushIntervalMs)&&void 0!==t?t:3e3,u=null!==(n=null==(s=this._instance.config.logs)?void 0:s.maxLogsPerInterval)&&void 0!==n?n:1e3,c=Date.now();if(l>c-this._intervalWindowStart||(this._intervalWindowStart=c,this._intervalLogCount=0,this._droppedWarned=!1),u>this._intervalLogCount){this._intervalLogCount++;var d=function(e,t){var i=e.level||"info",{text:n,number:s}=dn[i]||hn,o=String(Date.now())+"000000",a={};t.distinctId&&(a.posthogDistinctId=t.distinctId),t.sessionId&&(a.sessionId=t.sessionId),t.currentUrl&&(a["url.full"]=t.currentUrl),t.screenName&&(a["screen.name"]=t.screenName),t.appState&&(a["app.state"]=t.appState),t.activeFeatureFlags&&t.activeFeatureFlags.length>0&&(a.feature_flags=t.activeFeatureFlags);var l=r({},a,e.attributes||{}),u={timeUnixNano:o,observedTimeUnixNano:o,severityNumber:s,severityText:n,body:{stringValue:e.body},attributes:gn(l)};return e.trace_id&&(u.traceId=e.trace_id),e.span_id&&(u.spanId=e.span_id),Zr(e.trace_flags)||(u.flags=e.trace_flags),u}(e,this._getSdkContext());this._logBuffer.push({record:d}),(null!==(o=null==(a=this._instance.config.logs)?void 0:a.maxBufferSize)&&void 0!==o?o:100)>this._logBuffer.length?this._scheduleFlush():this.flushLogs()}else this._droppedWarned||(this._logger.warn("captureLog dropping logs: exceeded "+u+" logs per "+l+"ms"),this._droppedWarned=!0)}else this._logger.warn("captureLog requires a body")}get logger(){return this._logger_instance||(this._logger_instance={trace:(e,t)=>this.captureLog({body:e,level:"trace",attributes:t}),debug:(e,t)=>this.captureLog({body:e,level:"debug",attributes:t}),info:(e,t)=>this.captureLog({body:e,level:"info",attributes:t}),warn:(e,t)=>this.captureLog({body:e,level:"warn",attributes:t}),error:(e,t)=>this.captureLog({body:e,level:"error",attributes:t}),fatal:(e,t)=>this.captureLog({body:e,level:"fatal",attributes:t})}),this._logger_instance}flushLogs(e){if(this._flushTimeout&&(clearTimeout(this._flushTimeout),this._flushTimeout=void 0),0!==this._logBuffer.length){var t=this._logBuffer;this._logBuffer=[];var i=this._instance.config.logs,n=r({"service.name":(null==i?void 0:i.serviceName)||"unknown_service"},(null==i?void 0:i.environment)&&{"deployment.environment":i.environment},(null==i?void 0:i.serviceVersion)&&{"service.version":i.serviceVersion},null==i?void 0:i.resourceAttributes),s=function(e,t,r,i){return{resourceLogs:[{resource:{attributes:gn(t)},scopeLogs:[{scope:{name:r,version:i},logRecords:e}]}]}}(t.map((e=>e.record)),n,as.LIB_NAME,as.LIB_VERSION),o=this._instance.requestRouter.endpointFor("api","/i/v1/logs")+"?token="+encodeURIComponent(this._instance.config.token);this._instance._send_retriable_request({method:"POST",url:o,data:s,compression:"best-available",batchKey:"logs",transport:e})}}_scheduleFlush(){var e,t;this._flushTimeout||(this._flushTimeout=setTimeout((()=>{this._flushTimeout=void 0,this.flushLogs()}),null!==(e=null==(t=this._instance.config.logs)?void 0:t.flushIntervalMs)&&void 0!==e?e:3e3))}_getSdkContext(){var e,t={};if(t.distinctId=this._instance.get_distinct_id(),this._instance.sessionManager){var{sessionId:r}=this._instance.sessionManager.checkAndGetSessionAndWindowId(!0);t.sessionId=r}if(null!=ns&&null!=(e=ns.location)&&e.href&&(t.currentUrl=ns.location.href),this._instance.featureFlags){var i=this._instance.featureFlags.getFlags();i&&i.length>0&&(t.activeFeatureFlags=i)}return t}}},Jm=r({},qm,zm,Vm,$m,Um,Wm,Gm,jm,Zm,Ym,Xm,Km);om.__defaultExtensionClasses=r({},Jm),Om=Gf[em]=new om,(Dm=ns.posthog)&&hs(Dm._i,(function(e){if(e&&Ur(e)){var t=Om.init(e[0],e[1],e[2]),r=Dm[e[2]]||Dm;t&&(t._execute_array.call(t.people,r.people),t._execute_array(r))}})),ns.posthog=Om,function(){function e(){e.done||(e.done=!0,tm=!1,hs(Gf,(function(e){e._dom_loaded()})))}null!=Kn&&Kn.addEventListener?"complete"===Kn.readyState?e():bs(Kn,"DOMContentLoaded",e,{capture:!1}):Zn&&us.error("Browser doesn't support `document.addEventListener` so PostHog couldn't be initialized")}()}();
2
2
  //# sourceMappingURL=array.full.no-external.js.map