posthog-js 1.274.1 → 1.274.2

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 t(t,e,r,i,n,o,s){try{var a=t[o](s),l=a.value}catch(t){return void r(t)}a.done?e(l):Promise.resolve(l).then(i,n)}function e(e){return function(){var r=this,i=arguments;return new Promise((function(n,o){var s=e.apply(r,i);function a(e){t(s,n,o,a,l,"next",e)}function l(e){t(s,n,o,a,l,"throw",e)}a(void 0)}))}}function r(){return r=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var i in r)({}).hasOwnProperty.call(r,i)&&(t[i]=r[i])}return t},r.apply(null,arguments)}function i(t,e){if(null==t)return{};var r={};for(var i in t)if({}.hasOwnProperty.call(t,i)){if(-1!==e.indexOf(i))continue;r[i]=t[i]}return r}var n,o=["type"],s=Object.defineProperty,a=(t,e,r)=>((t,e,r)=>e in t?s(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r)(t,"symbol"!=typeof e?e+"":e,r),l=Object.defineProperty,u=(t,e,r)=>((t,e,r)=>e in t?l(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r)(t,"symbol"!=typeof e?e+"":e,r),c=(t=>(t[t.Document=0]="Document",t[t.DocumentType=1]="DocumentType",t[t.Element=2]="Element",t[t.Text=3]="Text",t[t.CDATA=4]="CDATA",t[t.Comment=5]="Comment",t))(c||{}),h={Node:["childNodes","parentNode","parentElement","textContent"],ShadowRoot:["host","styleSheets"],Element:["shadowRoot","querySelector","querySelectorAll"],MutationObserver:[]},d={Node:["contains","getRootNode"],ShadowRoot:["getSelection"],Element:[],MutationObserver:["constructor"]};var v={};function f(t){if(v[t])return v[t];var e=function(t){var e,r=null==globalThis||null==(e=globalThis.Zone)||null==e.__symbol__?void 0:e.__symbol__(t);return r&&globalThis[r]?globalThis[r]:void 0}(t)||globalThis[t],r=e.prototype,i=t in h?h[t]:void 0,n=Boolean(i&&i.every((t=>{var e,i;return Boolean(null==(i=null==(e=Object.getOwnPropertyDescriptor(r,t))?void 0:e.get)?void 0:i.toString().includes("[native code]"))}))),o=t in d?d[t]:void 0,s=Boolean(o&&o.every((t=>{var e;return"function"==typeof r[t]&&(null==(e=r[t])?void 0:e.toString().includes("[native code]"))})));if(n&&s)return v[t]=e.prototype,e.prototype;try{var a=document.createElement("iframe");document.body.appendChild(a);var l=a.contentWindow;if(!l)return e.prototype;var u=l[t].prototype;return document.body.removeChild(a),u?v[t]=u:e.prototype}catch(t){return e.prototype}}var p={};function g(t,e,r){var i,n=t+"."+String(r);if(p[n])return p[n].call(e);var o=f(t),s=null==(i=Object.getOwnPropertyDescriptor(o,r))?void 0:i.get;return s?(p[n]=s,s.call(e)):e[r]}var m={};function y(t,e,r){var i=t+"."+String(r);if(m[i])return m[i].bind(e);var n=f(t)[r];return"function"!=typeof n?e[r]:(m[i]=n,n.bind(e))}var b={childNodes:function(t){return g("Node",t,"childNodes")},parentNode:function(t){return g("Node",t,"parentNode")},parentElement:function(t){return g("Node",t,"parentElement")},textContent:function(t){return g("Node",t,"textContent")},contains:function(t,e){return y("Node",t,"contains")(e)},getRootNode:function(t){return y("Node",t,"getRootNode")()},host:function(t){return t&&"host"in t?g("ShadowRoot",t,"host"):null},styleSheets:function(t){return t.styleSheets},shadowRoot:function(t){return t&&"shadowRoot"in t?g("Element",t,"shadowRoot"):null},querySelector:function(t,e){return g("Element",t,"querySelector")(e)},querySelectorAll:function(t,e){return g("Element",t,"querySelectorAll")(e)},mutationObserver:function(){return f("MutationObserver").constructor}};function w(t){return t.nodeType===t.ELEMENT_NODE}function _(t){var e=t&&"host"in t&&"mode"in t&&b.host(t)||null;return Boolean(e&&"shadowRoot"in e&&b.shadowRoot(e)===t)}function C(t){return"[object ShadowRoot]"===Object.prototype.toString.call(t)}function I(t){try{var e=t.rules||t.cssRules;if(!e)return null;var r=Array.from(e,(e=>S(e,t.href))).join("");return(i=r).includes(" background-clip: text;")&&!i.includes(" -webkit-background-clip: text;")&&(i=i.replace(/\sbackground-clip:\s*text;/g," -webkit-background-clip: text; background-clip: text;")),i}catch(t){return null}var i}function S(t,e){if(function(t){return"styleSheet"in t}(t)){var r;try{r=I(t.styleSheet)||function(t){var{cssText:e}=t;if(e.split('"').length<3)return e;var r=["@import","url("+JSON.stringify(t.href)+")"];return""===t.layerName?r.push("layer"):t.layerName&&r.push("layer("+t.layerName+")"),t.supportsText&&r.push("supports("+t.supportsText+")"),t.media.length&&r.push(t.media.mediaText),r.join(" ")+";"}(t)}catch(e){r=t.cssText}return t.styleSheet.href?L(r,t.styleSheet.href):r}var i,n=t.cssText;return function(t){return"selectorText"in t}(t)&&t.selectorText.includes(":")&&(i=/(\[(?:[\w-]+)[^\\])(:(?:[\w-]+)\])/gm,n=n.replace(i,"$1\\$2")),e?L(n,e):n}function k(t,e){return Array.from(t.styleSheets).find((t=>t.href===e))}let x=class{constructor(){u(this,"idNodeMap",new Map),u(this,"nodeMetaMap",new WeakMap)}getId(t){var e;if(!t)return-1;var r=null==(e=this.getMeta(t))?void 0:e.id;return null!=r?r:-1}getNode(t){return this.idNodeMap.get(t)||null}getIds(){return Array.from(this.idNodeMap.keys())}getMeta(t){return this.nodeMetaMap.get(t)||null}removeNodeFromMap(t){var e=this.getId(t);this.idNodeMap.delete(e),t.childNodes&&t.childNodes.forEach((t=>this.removeNodeFromMap(t)))}has(t){return this.idNodeMap.has(t)}hasNode(t){return this.nodeMetaMap.has(t)}add(t,e){var r=e.id;this.idNodeMap.set(r,t),this.nodeMetaMap.set(t,e)}replace(t,e){var r=this.getNode(t);if(r){var i=this.nodeMetaMap.get(r);i&&this.nodeMetaMap.set(e,i)}this.idNodeMap.set(t,e)}reset(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap}};function A(t){var{element:e,maskInputOptions:r,tagName:i,type:n,value:o,maskInputFn:s}=t,a=o||"",l=n&&T(n);return(r[i.toLowerCase()]||l&&r[l])&&(a=s?s(a,e):"*".repeat(a.length)),a}function T(t){return t.toLowerCase()}var M="__rrweb_original__";function E(t){var e=t.type;return t.hasAttribute("data-rr-is-password")?"password":e?T(e):null}function N(t,e){var r,i;try{i=new URL(t,null!=e?e:window.location.href)}catch(t){return null}var n=i.pathname.match(/\.([0-9a-z]+)(?:$)/i);return null!==(r=null==n?void 0:n[1])&&void 0!==r?r:null}var R=/url\((?:(')([^']*)'|(")(.*?)"|([^)]*))\)/gm,F=/^(?:[a-z+]+:)?\/\//i,O=/^www\..*/i,P=/^(data:)([^,]*),(.*)/i;function L(t,e){return(t||"").replace(R,((t,r,i,n,o,s)=>{var a,l=i||o||s,u=r||n||"";if(!l)return t;if(F.test(l)||O.test(l))return"url("+u+l+u+")";if(P.test(l))return"url("+u+l+u+")";if("/"===l[0])return"url("+u+(((a=e).indexOf("//")>-1?a.split("/").slice(0,3).join("/"):a.split("/")[0]).split("?")[0]+l)+u+")";var c=e.split("/"),h=l.split("/");for(var d of(c.pop(),h))"."!==d&&(".."===d?c.pop():c.push(d));return"url("+u+c.join("/")+u+")"}))}var D,B,Z=1,q=new RegExp("[^a-z0-9-_:]"),H=-2;function V(){return Z++}var j=/^[^ \t\n\r\u000c]+/,Y=/^[, \t\n\r\u000c]+/;var G=new WeakMap;function W(t,e){return e&&""!==e.trim()?U(t,e):e}function z(t){return Boolean("svg"===t.tagName||t.ownerSVGElement)}function U(t,e){var r=G.get(t);if(r||(r=t.createElement("a"),G.set(t,r)),e){if(e.startsWith("blob:")||e.startsWith("data:"))return e}else e="";return r.setAttribute("href",e),r.href}function X(t,e,r,i){return i?"src"===r||"href"===r&&("use"!==e||"#"!==i[0])||"xlink:href"===r&&"#"!==i[0]?W(t,i):"background"!==r||"table"!==e&&"td"!==e&&"th"!==e?"srcset"===r?function(t,e){if(""===e.trim())return e;var r=0;function i(t){var i,n=t.exec(e.substring(r));return n?(i=n[0],r+=i.length,i):""}for(var n=[];i(Y),!(r>=e.length);){var o=i(j);if(","===o.slice(-1))o=W(t,o.substring(0,o.length-1)),n.push(o);else{var s="";o=W(t,o);for(var a=!1;;){var l=e.charAt(r);if(""===l){n.push((o+s).trim());break}if(a)")"===l&&(a=!1);else{if(","===l){r+=1,n.push((o+s).trim());break}"("===l&&(a=!0)}s+=l,r+=1}}}return n.join(", ")}(t,i):"style"===r?L(i,U(t)):"object"===e&&"data"===r?W(t,i):i:W(t,i):i}function J(t,e,r){return("video"===t||"audio"===t)&&"autoplay"===e}function K(t,e,r){if(!t)return!1;if(t.nodeType!==t.ELEMENT_NODE)return!!r&&K(b.parentNode(t),e,r);for(var i=t.classList.length;i--;){var n=t.classList[i];if(e.test(n))return!0}return!!r&&K(b.parentNode(t),e,r)}function Q(t,e,r,i){var n;if(w(t)){if(n=t,!b.childNodes(n).length)return!1}else{if(null===b.parentElement(t))return!1;n=b.parentElement(t)}try{if("string"==typeof e){if(i){if(n.closest("."+e))return!0}else if(n.classList.contains(e))return!0}else if(K(n,e,i))return!0;if(r)if(i){if(n.closest(r))return!0}else if(n.matches(r))return!0}catch(t){}return!1}function tt(t,e){var{doc:r,mirror:i,blockClass:n,blockSelector:o,needsMask:s,inlineStylesheet:a,maskInputOptions:l={},maskTextFn:u,maskInputFn:h,dataURLOptions:d={},inlineImages:v,recordCanvas:f,keepIframeSrcFn:p,newlyAddedElement:g=!1}=e,m=function(t,e){if(!e.hasNode(t))return;var r=e.getId(t);return 1===r?void 0:r}(r,i);switch(t.nodeType){case t.DOCUMENT_NODE:return"CSS1Compat"!==t.compatMode?{type:c.Document,childNodes:[],compatMode:t.compatMode}:{type:c.Document,childNodes:[]};case t.DOCUMENT_TYPE_NODE:return{type:c.DocumentType,name:t.name,publicId:t.publicId,systemId:t.systemId,rootId:m};case t.ELEMENT_NODE:return function(t,e){for(var r,{doc:i,blockClass:n,blockSelector:o,inlineStylesheet:s,maskInputOptions:a={},maskInputFn:l,dataURLOptions:u={},inlineImages:h,recordCanvas:d,keepIframeSrcFn:v,newlyAddedElement:f=!1,rootId:p}=e,g=function(t,e,r){try{if("string"==typeof e){if(t.classList.contains(e))return!0}else for(var i=t.classList.length;i--;){var n=t.classList[i];if(e.test(n))return!0}if(r)return t.matches(r)}catch(t){}return!1}(t,n,o),m=function(t){if(t instanceof HTMLFormElement)return"form";var e=T(t.tagName);return q.test(e)?"div":e}(t),y={},w=t.attributes.length,_=0;_<w;_++){var C=t.attributes[_];J(m,C.name,C.value)||(y[C.name]=X(i,m,T(C.name),C.value))}if("link"===m&&s){var S=function(t){return null==t?void 0:t.href}(t);if(S){var x=k(i,S);if(!x&&S.includes(".css"))x=k(i,window.location.origin+"/"+S.replace(window.location.href,""));var N=null;x&&(N=I(x)),N&&(delete y.rel,delete y.href,y._cssText=N)}}if("style"===m&&t.sheet&&!(t.innerText||b.textContent(t)||"").trim().length){var R=I(t.sheet);R&&(y._cssText=R)}if("input"===m||"textarea"===m||"select"===m){var F=t.value,O=t.checked;"radio"!==y.type&&"checkbox"!==y.type&&"submit"!==y.type&&"button"!==y.type&&F?y.value=A({element:t,type:E(t),tagName:m,value:F,maskInputOptions:a,maskInputFn:l}):O&&(y.checked=O)}"option"===m&&(t.selected&&!a.select?y.selected=!0:delete y.selected);if("dialog"===m&&t.open)try{y.rr_open_mode=t.matches("dialog:modal")?"modal":"non-modal"}catch(t){y.rr_open_mode="modal",y.ph_rr_could_not_detect_modal=!0}if("canvas"===m&&d)if("2d"===t.__context)(function(t){var e=t.getContext("2d");if(!e)return!0;for(var r=0;r<t.width;r+=50)for(var i=0;i<t.height;i+=50){var n=e.getImageData,o=M in n?n[M]:n;if(new Uint32Array(o.call(e,r,i,Math.min(50,t.width-r),Math.min(50,t.height-i)).data.buffer).some((t=>0!==t)))return!1}return!0})(t)||(y.rr_dataURL=t.toDataURL(u.type,u.quality));else if(!("__context"in t)){var P=t.toDataURL(u.type,u.quality),L=i.createElement("canvas");L.width=t.width,L.height=t.height,P!==L.toDataURL(u.type,u.quality)&&(y.rr_dataURL=P)}if("img"===m&&h){D||(D=i.createElement("canvas"),B=D.getContext("2d"));var Z=t,H=Z.currentSrc||Z.getAttribute("src")||"<unknown-src>",V=Z.crossOrigin,j=()=>{Z.removeEventListener("load",j);try{D.width=Z.naturalWidth,D.height=Z.naturalHeight,B.drawImage(Z,0,0),y.rr_dataURL=D.toDataURL(u.type,u.quality)}catch(t){if("anonymous"!==Z.crossOrigin)return Z.crossOrigin="anonymous",void(Z.complete&&0!==Z.naturalWidth?j():Z.addEventListener("load",j));console.warn("Cannot inline img src="+H+"! Error: "+t)}"anonymous"===Z.crossOrigin&&(V?y.crossOrigin=V:Z.removeAttribute("crossorigin"))};Z.complete&&0!==Z.naturalWidth?j():Z.addEventListener("load",j)}if("audio"===m||"video"===m){var Y=y;Y.rr_mediaState=t.paused?"paused":"played",Y.rr_mediaCurrentTime=t.currentTime,Y.rr_mediaPlaybackRate=t.playbackRate,Y.rr_mediaMuted=t.muted,Y.rr_mediaLoop=t.loop,Y.rr_mediaVolume=t.volume}f||(t.scrollLeft&&(y.rr_scrollLeft=t.scrollLeft),t.scrollTop&&(y.rr_scrollTop=t.scrollTop));if(g){var{width:G,height:W}=t.getBoundingClientRect();y={class:y.class,rr_width:G+"px",rr_height:W+"px"}}"iframe"!==m||v(y.src)||(t.contentDocument||(y.rr_src=y.src),delete y.src);try{customElements.get(m)&&(r=!0)}catch(t){}return{type:c.Element,tagName:m,attributes:y,childNodes:[],isSVG:z(t)||void 0,needBlock:g,rootId:p,isCustom:r}}(t,{doc:r,blockClass:n,blockSelector:o,inlineStylesheet:a,maskInputOptions:l,maskInputFn:h,dataURLOptions:d,inlineImages:v,recordCanvas:f,keepIframeSrcFn:p,newlyAddedElement:g,rootId:m});case t.TEXT_NODE:return function(t,e){var r,{needsMask:i,maskTextFn:n,rootId:o}=e,s=b.parentNode(t),a=s&&s.tagName,l=b.textContent(t),u="STYLE"===a||void 0,h="SCRIPT"===a||void 0;if(u&&l){try{t.nextSibling||t.previousSibling||(null==(r=s.sheet)?void 0:r.cssRules)&&(l=I(s.sheet))}catch(e){console.warn("Cannot get CSS styles from text's parentNode. Error: "+e,t)}l=L(l,U(e.doc))}h&&(l="SCRIPT_PLACEHOLDER");!u&&!h&&l&&i&&(l=n?n(l,b.parentElement(t)):l.replace(/[\S]/g,"*"));return{type:c.Text,textContent:l||"",isStyle:u,rootId:o}}(t,{doc:r,needsMask:s,maskTextFn:u,rootId:m});case t.CDATA_SECTION_NODE:return{type:c.CDATA,textContent:"",rootId:m};case t.COMMENT_NODE:return{type:c.Comment,textContent:b.textContent(t)||"",rootId:m};default:return!1}}function et(t){return null==t?"":t.toLowerCase()}function rt(t,e){var{doc:r,mirror:i,blockClass:n,blockSelector:o,maskTextClass:s,maskTextSelector:a,skipChild:l=!1,inlineStylesheet:u=!0,maskInputOptions:h={},maskTextFn:d,maskInputFn:v,slimDOMOptions:f,dataURLOptions:p={},inlineImages:g=!1,recordCanvas:m=!1,onSerialize:y,onIframeLoad:I,iframeLoadTimeout:S=5e3,onStylesheetLoad:k,stylesheetLoadTimeout:x=5e3,keepIframeSrcFn:A=(()=>!1),newlyAddedElement:T=!1}=e,{needsMask:M}=e,{preserveWhiteSpace:E=!0}=e;M||(M=Q(t,s,a,void 0===M));var R,F=tt(t,{doc:r,mirror:i,blockClass:n,blockSelector:o,needsMask:M,inlineStylesheet:u,maskInputOptions:h,maskTextFn:d,maskInputFn:v,dataURLOptions:p,inlineImages:g,recordCanvas:m,keepIframeSrcFn:A,newlyAddedElement:T});if(!F)return console.warn(t,"not serialized"),null;R=i.hasNode(t)?i.getId(t):!function(t,e){if(e.comment&&t.type===c.Comment)return!0;if(t.type===c.Element){if(e.script&&("script"===t.tagName||"link"===t.tagName&&("preload"===t.attributes.rel||"modulepreload"===t.attributes.rel)&&"script"===t.attributes.as||"link"===t.tagName&&"prefetch"===t.attributes.rel&&"string"==typeof t.attributes.href&&"js"===N(t.attributes.href)))return!0;if(e.headFavicon&&("link"===t.tagName&&"shortcut icon"===t.attributes.rel||"meta"===t.tagName&&(et(t.attributes.name).match(/^msapplication-tile(image|color)$/)||"application-name"===et(t.attributes.name)||"icon"===et(t.attributes.rel)||"apple-touch-icon"===et(t.attributes.rel)||"shortcut icon"===et(t.attributes.rel))))return!0;if("meta"===t.tagName){if(e.headMetaDescKeywords&&et(t.attributes.name).match(/^description|keywords$/))return!0;if(e.headMetaSocial&&(et(t.attributes.property).match(/^(og|twitter|fb):/)||et(t.attributes.name).match(/^(og|twitter):/)||"pinterest"===et(t.attributes.name)))return!0;if(e.headMetaRobots&&("robots"===et(t.attributes.name)||"googlebot"===et(t.attributes.name)||"bingbot"===et(t.attributes.name)))return!0;if(e.headMetaHttpEquiv&&void 0!==t.attributes["http-equiv"])return!0;if(e.headMetaAuthorship&&("author"===et(t.attributes.name)||"generator"===et(t.attributes.name)||"framework"===et(t.attributes.name)||"publisher"===et(t.attributes.name)||"progid"===et(t.attributes.name)||et(t.attributes.property).match(/^article:/)||et(t.attributes.property).match(/^product:/)))return!0;if(e.headMetaVerification&&("google-site-verification"===et(t.attributes.name)||"yandex-verification"===et(t.attributes.name)||"csrf-token"===et(t.attributes.name)||"p:domain_verify"===et(t.attributes.name)||"verify-v1"===et(t.attributes.name)||"verification"===et(t.attributes.name)||"shopify-checkout-api-token"===et(t.attributes.name)))return!0}}return!1}(F,f)&&(E||F.type!==c.Text||F.isStyle||F.textContent.replace(/^\s+|\s+$/gm,"").length)?V():H;var O=Object.assign(F,{id:R});if(i.add(t,O),R===H)return null;y&&y(t);var P=!l;if(O.type===c.Element){P=P&&!O.needBlock,delete O.needBlock;var L=b.shadowRoot(t);L&&C(L)&&(O.isShadowHost=!0)}if((O.type===c.Document||O.type===c.Element)&&P){f.headWhitespace&&O.type===c.Element&&"head"===O.tagName&&(E=!1);var D={doc:r,mirror:i,blockClass:n,blockSelector:o,needsMask:M,maskTextClass:s,maskTextSelector:a,skipChild:l,inlineStylesheet:u,maskInputOptions:h,maskTextFn:d,maskInputFn:v,slimDOMOptions:f,dataURLOptions:p,inlineImages:g,recordCanvas:m,preserveWhiteSpace:E,onSerialize:y,onIframeLoad:I,iframeLoadTimeout:S,onStylesheetLoad:k,stylesheetLoadTimeout:x,keepIframeSrcFn:A};if(O.type===c.Element&&"textarea"===O.tagName&&void 0!==O.attributes.value);else for(var B of Array.from(b.childNodes(t))){var Z=rt(B,D);Z&&O.childNodes.push(Z)}var q=null;if(w(t)&&(q=b.shadowRoot(t)))for(var j of Array.from(b.childNodes(q))){var Y=rt(j,D);Y&&(C(q)&&(Y.isShadow=!0),O.childNodes.push(Y))}}var G=b.parentNode(t);return G&&_(G)&&C(G)&&(O.isShadow=!0),O.type===c.Element&&"iframe"===O.tagName&&function(t,e,r){var i=t.contentWindow;if(i){var n,o=!1;try{n=i.document.readyState}catch(t){return}if("complete"===n){var s="about:blank";if(i.location.href!==s||t.src===s||""===t.src)return setTimeout(e,0),t.addEventListener("load",e);t.addEventListener("load",e)}else{var a=setTimeout((()=>{o||(e(),o=!0)}),r);t.addEventListener("load",(()=>{clearTimeout(a),o=!0,e()}))}}}(t,(()=>{var e=t.contentDocument;if(e&&I){var r=rt(e,{doc:e,mirror:i,blockClass:n,blockSelector:o,needsMask:M,maskTextClass:s,maskTextSelector:a,skipChild:!1,inlineStylesheet:u,maskInputOptions:h,maskTextFn:d,maskInputFn:v,slimDOMOptions:f,dataURLOptions:p,inlineImages:g,recordCanvas:m,preserveWhiteSpace:E,onSerialize:y,onIframeLoad:I,iframeLoadTimeout:S,onStylesheetLoad:k,stylesheetLoadTimeout:x,keepIframeSrcFn:A});r&&I(t,r)}}),S),O.type===c.Element&&"link"===O.tagName&&"string"==typeof O.attributes.rel&&("stylesheet"===O.attributes.rel||"preload"===O.attributes.rel&&"string"==typeof O.attributes.href&&"css"===N(O.attributes.href))&&function(t,e,r){var i,n=!1;try{i=t.sheet}catch(t){return}if(!i){var o=setTimeout((()=>{n||(e(),n=!0)}),r);t.addEventListener("load",(()=>{clearTimeout(o),n=!0,e()}))}}(t,(()=>{if(k){var e=rt(t,{doc:r,mirror:i,blockClass:n,blockSelector:o,needsMask:M,maskTextClass:s,maskTextSelector:a,skipChild:!1,inlineStylesheet:u,maskInputOptions:h,maskTextFn:d,maskInputFn:v,slimDOMOptions:f,dataURLOptions:p,inlineImages:g,recordCanvas:m,preserveWhiteSpace:E,onSerialize:y,onIframeLoad:I,iframeLoadTimeout:S,onStylesheetLoad:k,stylesheetLoadTimeout:x,keepIframeSrcFn:A});e&&k(t,e)}}),x),O}let it=class t{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 t=[],e=this.firstChild;e;)t.push(e),e=e.nextSibling;return t}contains(e){if(!(e instanceof t))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(t){throw new Error("RRDomException: Failed to execute 'appendChild' on 'RRNode': This RRNode type does not support this method.")}insertBefore(t,e){throw new Error("RRDomException: Failed to execute 'insertBefore' on 'RRNode': This RRNode type does not support this method.")}removeChild(t){throw new Error("RRDomException: Failed to execute 'removeChild' on 'RRNode': This RRNode type does not support this method.")}toString(){return"RRNode"}};var nt={Node:["childNodes","parentNode","parentElement","textContent"],ShadowRoot:["host","styleSheets"],Element:["shadowRoot","querySelector","querySelectorAll"],MutationObserver:[]},ot={Node:["contains","getRootNode"],ShadowRoot:["getSelection"],Element:[],MutationObserver:["constructor"]};var st={};function at(t){if(st[t])return st[t];var e=function(t){var e,r=null==globalThis||null==(e=globalThis.Zone)||null==e.__symbol__?void 0:e.__symbol__(t);return r&&globalThis[r]?globalThis[r]:void 0}(t)||globalThis[t],r=e.prototype,i=t in nt?nt[t]:void 0,n=Boolean(i&&i.every((t=>{var e,i;return Boolean(null==(i=null==(e=Object.getOwnPropertyDescriptor(r,t))?void 0:e.get)?void 0:i.toString().includes("[native code]"))}))),o=t in ot?ot[t]:void 0,s=Boolean(o&&o.every((t=>{var e;return"function"==typeof r[t]&&(null==(e=r[t])?void 0:e.toString().includes("[native code]"))})));if(n&&s)return st[t]=e.prototype,e.prototype;try{var a=document.createElement("iframe");document.body.appendChild(a);var l=a.contentWindow;if(!l)return e.prototype;var u=l[t].prototype;return document.body.removeChild(a),u?st[t]=u:r}catch(t){return r}}var lt={};function ut(t,e,r){var i,n=t+"."+String(r);if(lt[n])return lt[n].call(e);var o=at(t),s=null==(i=Object.getOwnPropertyDescriptor(o,r))?void 0:i.get;return s?(lt[n]=s,s.call(e)):e[r]}var ct={};function ht(t,e,r){var i=t+"."+String(r);if(ct[i])return ct[i].bind(e);var n=at(t)[r];return"function"!=typeof n?e[r]:(ct[i]=n,n.bind(e))}function dt(){return at("MutationObserver").constructor}var vt={childNodes:function(t){return ut("Node",t,"childNodes")},parentNode:function(t){return ut("Node",t,"parentNode")},parentElement:function(t){return ut("Node",t,"parentElement")},textContent:function(t){return ut("Node",t,"textContent")},contains:function(t,e){return ht("Node",t,"contains")(e)},getRootNode:function(t){return ht("Node",t,"getRootNode")()},host:function(t){return t&&"host"in t?ut("ShadowRoot",t,"host"):null},styleSheets:function(t){return t.styleSheets},shadowRoot:function(t){return t&&"shadowRoot"in t?ut("Element",t,"shadowRoot"):null},querySelector:function(t,e){return ut("Element",t,"querySelector")(e)},querySelectorAll:function(t,e){return ut("Element",t,"querySelectorAll")(e)},mutationObserver:dt};function ft(t,e,r){void 0===r&&(r=document);var i={capture:!0,passive:!0};return r.addEventListener(t,e,i),()=>r.removeEventListener(t,e,i)}var pt="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.",gt={map:{},getId:()=>(console.error(pt),-1),getNode:()=>(console.error(pt),null),removeNodeFromMap(){console.error(pt)},has:()=>(console.error(pt),!1),reset(){console.error(pt)}};function mt(t,e,r){void 0===r&&(r={});var i=null,n=0;return function(){for(var o=arguments.length,s=new Array(o),a=0;a<o;a++)s[a]=arguments[a];var l=Date.now();n||!1!==r.leading||(n=l);var u=e-(l-n),c=this;u<=0||u>e?(i&&(clearTimeout(i),i=null),n=l,t.apply(c,s)):i||!1===r.trailing||(i=setTimeout((()=>{n=!1===r.leading?0:Date.now(),i=null,t.apply(c,s)}),u))}}function yt(t,e,r,i,n){void 0===n&&(n=window);var o=n.Object.getOwnPropertyDescriptor(t,e);return n.Object.defineProperty(t,e,i?r:{set(t){setTimeout((()=>{r.set.call(this,t)}),0),o&&o.set&&o.set.call(this,t)}}),()=>yt(t,e,o||{},!0)}function bt(t,e,r){try{if(!(e in t))return()=>{};var i=t[e],n=r(i);return"function"==typeof n&&(n.prototype=n.prototype||{},Object.defineProperties(n,{__rrweb_original__:{enumerable:!1,value:i}})),t[e]=n,()=>{t[e]=i}}catch(t){return()=>{}}}"undefined"!=typeof window&&window.Proxy&&window.Reflect&&(gt=new Proxy(gt,{get:(t,e,r)=>("map"===e&&console.error(pt),Reflect.get(t,e,r))}));var wt=Date.now;function _t(t){var e,r,i,n,o=t.document;return{left:o.scrollingElement?o.scrollingElement.scrollLeft:void 0!==t.pageXOffset?t.pageXOffset:o.documentElement.scrollLeft||(null==o?void 0:o.body)&&(null==(e=vt.parentElement(o.body))?void 0:e.scrollLeft)||(null==(r=null==o?void 0:o.body)?void 0:r.scrollLeft)||0,top:o.scrollingElement?o.scrollingElement.scrollTop:void 0!==t.pageYOffset?t.pageYOffset:(null==o?void 0:o.documentElement.scrollTop)||(null==o?void 0:o.body)&&(null==(i=vt.parentElement(o.body))?void 0:i.scrollTop)||(null==(n=null==o?void 0:o.body)?void 0:n.scrollTop)||0}}function Ct(){return window.innerHeight||document.documentElement&&document.documentElement.clientHeight||document.body&&document.body.clientHeight}function It(){return window.innerWidth||document.documentElement&&document.documentElement.clientWidth||document.body&&document.body.clientWidth}function St(t){return t?t.nodeType===t.ELEMENT_NODE?t:vt.parentElement(t):null}function kt(t,e,r,i){if(!t)return!1;var n=St(t);if(!n)return!1;try{if("string"==typeof e){if(n.classList.contains(e))return!0;if(i&&null!==n.closest("."+e))return!0}else if(K(n,e,i))return!0}catch(t){}if(r){if(n.matches(r))return!0;if(i&&null!==n.closest(r))return!0}return!1}function xt(t,e,r){return!("TITLE"!==t.tagName||!r.headTitleMutations)||e.getId(t)===H}function At(t,e){if(_(t))return!1;var r=e.getId(t);if(!e.has(r))return!0;var i=vt.parentNode(t);return(!i||i.nodeType!==t.DOCUMENT_NODE)&&(!i||At(i,e))}function Tt(t){return Boolean(t.changedTouches)}function Mt(t,e){return Boolean("IFRAME"===t.nodeName&&e.getMeta(t))}function Et(t,e){return Boolean("LINK"===t.nodeName&&t.nodeType===t.ELEMENT_NODE&&t.getAttribute&&"stylesheet"===t.getAttribute("rel")&&e.getMeta(t))}function Nt(t){return!!t&&(t instanceof it&&"shadowRoot"in t?Boolean(t.shadowRoot):Boolean(vt.shadowRoot(t)))}/[1-9][0-9]{12}/.test(Date.now().toString())||(wt=()=>(new Date).getTime());let Rt=class{constructor(){a(this,"id",1),a(this,"styleIDMap",new WeakMap),a(this,"idStyleMap",new Map)}getId(t){var e;return null!==(e=this.styleIDMap.get(t))&&void 0!==e?e:-1}has(t){return this.styleIDMap.has(t)}add(t,e){return this.has(t)?this.getId(t):(r=void 0===e?this.id++:e,this.styleIDMap.set(t,r),this.idStyleMap.set(r,t),r);var r}getStyle(t){return this.idStyleMap.get(t)||null}reset(){this.styleIDMap=new WeakMap,this.idStyleMap=new Map,this.id=1}generateId(){return this.id++}};function Ft(t){var e,r=null;return"getRootNode"in t&&(null==(e=vt.getRootNode(t))?void 0:e.nodeType)===Node.DOCUMENT_FRAGMENT_NODE&&vt.host(vt.getRootNode(t))&&(r=vt.host(vt.getRootNode(t))),r}function Ot(t){var e=t.ownerDocument;if(!e)return!1;var r=function(t){for(var e,r=t;e=Ft(r);)r=e;return r}(t);return vt.contains(e,r)}function Pt(t){var e=t.ownerDocument;return!!e&&(vt.contains(e,t)||Ot(t))}var Lt=(t=>(t[t.DomContentLoaded=0]="DomContentLoaded",t[t.Load=1]="Load",t[t.FullSnapshot=2]="FullSnapshot",t[t.IncrementalSnapshot=3]="IncrementalSnapshot",t[t.Meta=4]="Meta",t[t.Custom=5]="Custom",t[t.Plugin=6]="Plugin",t))(Lt||{}),Dt=(t=>(t[t.Mutation=0]="Mutation",t[t.MouseMove=1]="MouseMove",t[t.MouseInteraction=2]="MouseInteraction",t[t.Scroll=3]="Scroll",t[t.ViewportResize=4]="ViewportResize",t[t.Input=5]="Input",t[t.TouchMove=6]="TouchMove",t[t.MediaInteraction=7]="MediaInteraction",t[t.StyleSheetRule=8]="StyleSheetRule",t[t.CanvasMutation=9]="CanvasMutation",t[t.Font=10]="Font",t[t.Log=11]="Log",t[t.Drag=12]="Drag",t[t.StyleDeclaration=13]="StyleDeclaration",t[t.Selection=14]="Selection",t[t.AdoptedStyleSheet=15]="AdoptedStyleSheet",t[t.CustomElement=16]="CustomElement",t))(Dt||{}),Bt=(t=>(t[t.MouseUp=0]="MouseUp",t[t.MouseDown=1]="MouseDown",t[t.Click=2]="Click",t[t.ContextMenu=3]="ContextMenu",t[t.DblClick=4]="DblClick",t[t.Focus=5]="Focus",t[t.Blur=6]="Blur",t[t.TouchStart=7]="TouchStart",t[t.TouchMove_Departed=8]="TouchMove_Departed",t[t.TouchEnd=9]="TouchEnd",t[t.TouchCancel=10]="TouchCancel",t))(Bt||{}),Zt=(t=>(t[t.Mouse=0]="Mouse",t[t.Pen=1]="Pen",t[t.Touch=2]="Touch",t))(Zt||{}),$t=(t=>(t[t["2D"]=0]="2D",t[t.WebGL=1]="WebGL",t[t.WebGL2=2]="WebGL2",t))($t||{}),qt=(t=>(t[t.Play=0]="Play",t[t.Pause=1]="Pause",t[t.Seeked=2]="Seeked",t[t.VolumeChange=3]="VolumeChange",t[t.RateChange=4]="RateChange",t))(qt||{});function Ht(t){return"__ln"in t}class Vt{constructor(){a(this,"length",0),a(this,"head",null),a(this,"tail",null)}get(t){if(t>=this.length)throw new Error("Position outside of list range");for(var e=this.head,r=0;r<t;r++)e=(null==e?void 0:e.next)||null;return e}addNode(t){var e={value:t,previous:null,next:null};if(t.__ln=e,t.previousSibling&&Ht(t.previousSibling)){var r=t.previousSibling.__ln.next;e.next=r,e.previous=t.previousSibling.__ln,t.previousSibling.__ln.next=e,r&&(r.previous=e)}else if(t.nextSibling&&Ht(t.nextSibling)&&t.nextSibling.__ln.previous){var i=t.nextSibling.__ln.previous;e.previous=i,e.next=t.nextSibling.__ln,t.nextSibling.__ln.previous=e,i&&(i.next=e)}else this.head&&(this.head.previous=e),e.next=this.head,this.head=e;null===e.next&&(this.tail=e),this.length++}removeNode(t){var e=t.__ln;this.head&&(e.previous?(e.previous.next=e.next,e.next?e.next.previous=e.previous:this.tail=e.previous):(this.head=e.next,this.head?this.head.previous=null:this.tail=null),t.__ln&&delete t.__ln,this.length--)}}var jt,Yt=(t,e)=>t+"@"+e;class Gt{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",(t=>{t.forEach(this.processMutation),this.emit()})),a(this,"emit",(()=>{if(!this.frozen&&!this.locked){for(var t=[],e=new Set,r=new Vt,i=t=>{for(var e=t,r=H;r===H;)r=(e=e&&e.nextSibling)&&this.mirror.getId(e);return r},n=n=>{var o=vt.parentNode(n);if(o&&Pt(n)&&"TEXTAREA"!==o.tagName){var s=_(o)?this.mirror.getId(Ft(n)):this.mirror.getId(o),a=i(n);if(-1===s||-1===a)return r.addNode(n);var l=rt(n,{doc:this.doc,mirror:this.mirror,blockClass:this.blockClass,blockSelector:this.blockSelector,maskTextClass:this.maskTextClass,maskTextSelector:this.maskTextSelector,skipChild:!0,newlyAddedElement:!0,inlineStylesheet:this.inlineStylesheet,maskInputOptions:this.maskInputOptions,maskTextFn:this.maskTextFn,maskInputFn:this.maskInputFn,slimDOMOptions:this.slimDOMOptions,dataURLOptions:this.dataURLOptions,recordCanvas:this.recordCanvas,inlineImages:this.inlineImages,onSerialize:t=>{Mt(t,this.mirror)&&this.iframeManager.addIframe(t),Et(t,this.mirror)&&this.stylesheetManager.trackLinkElement(t),Nt(n)&&this.shadowDomManager.addShadowRoot(vt.shadowRoot(n),this.doc)},onIframeLoad:(t,e)=>{this.iframeManager.attachIframe(t,e),this.shadowDomManager.observeAttachShadow(t)},onStylesheetLoad:(t,e)=>{this.stylesheetManager.attachLinkElement(t,e)}});l&&(t.push({parentId:s,nextId:a,node:l}),e.add(l.id))}};this.mapRemoves.length;)this.mirror.removeNodeFromMap(this.mapRemoves.shift());for(var o of this.movedSet)zt(this.removes,o,this.mirror)&&!this.movedSet.has(vt.parentNode(o))||n(o);for(var s of this.addedSet)Ut(this.droppedSet,s)||zt(this.removes,s,this.mirror)?Ut(this.movedSet,s)?n(s):this.droppedSet.add(s):n(s);for(var a=null;r.length;){var l=null;if(a){var u=this.mirror.getId(vt.parentNode(a.value)),c=i(a.value);-1!==u&&-1!==c&&(l=a)}if(!l)for(var h=r.tail;h;){var d=h;if(h=h.previous,d){var v=this.mirror.getId(vt.parentNode(d.value));if(-1===i(d.value))continue;if(-1!==v){l=d;break}var f=d.value,p=vt.parentNode(f);if(p&&p.nodeType===Node.DOCUMENT_FRAGMENT_NODE){var g=vt.host(p);if(-1!==this.mirror.getId(g)){l=d;break}}}}if(!l){for(;r.head;)r.removeNode(r.head.value);break}a=l.previous,r.removeNode(l.value),n(l.value)}var m={texts:this.texts.map((t=>{var e=t.node,r=vt.parentNode(e);return r&&"TEXTAREA"===r.tagName&&this.genTextAreaValueMutation(r),{id:this.mirror.getId(e),value:t.value}})).filter((t=>!e.has(t.id))).filter((t=>this.mirror.has(t.id))),attributes:this.attributes.map((t=>{var{attributes:e}=t;if("string"==typeof e.style){var r=JSON.stringify(t.styleDiff),i=JSON.stringify(t._unchangedStyles);r.length<e.style.length&&(r+i).split("var(").length===e.style.split("var(").length&&(e.style=t.styleDiff)}return{id:this.mirror.getId(t.node),attributes:e}})).filter((t=>!e.has(t.id))).filter((t=>this.mirror.has(t.id))),removes:this.removes,adds:t};(m.texts.length||m.attributes.length||m.removes.length||m.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(m))}})),a(this,"genTextAreaValueMutation",(t=>{var e=this.attributeMap.get(t);e||(e={node:t,attributes:{},styleDiff:{},_unchangedStyles:{}},this.attributes.push(e),this.attributeMap.set(t,e)),e.attributes.value=Array.from(vt.childNodes(t),(t=>vt.textContent(t)||"")).join("")})),a(this,"processMutation",(t=>{if(!xt(t.target,this.mirror,this.slimDOMOptions))switch(t.type){case"characterData":var e=vt.textContent(t.target);kt(t.target,this.blockClass,this.blockSelector,!1)||e===t.oldValue||this.texts.push({value:Q(t.target,this.maskTextClass,this.maskTextSelector,!0)&&e?this.maskTextFn?this.maskTextFn(e,St(t.target)):e.replace(/[\S]/g,"*"):e,node:t.target});break;case"attributes":var r=t.target,i=t.attributeName,n=t.target.getAttribute(i);if("value"===i){var o=E(r);n=A({element:r,maskInputOptions:this.maskInputOptions,tagName:r.tagName,type:o,value:n,maskInputFn:this.maskInputFn})}if(kt(t.target,this.blockClass,this.blockSelector,!1)||n===t.oldValue)return;var s=this.attributeMap.get(t.target);if("IFRAME"===r.tagName&&"src"===i&&!this.keepIframeSrcFn(n)){if(r.contentDocument)return;i="rr_src"}if(s||(s={node:t.target,attributes:{},styleDiff:{},_unchangedStyles:{}},this.attributes.push(s),this.attributeMap.set(t.target,s)),"type"===i&&"INPUT"===r.tagName&&"password"===(t.oldValue||"").toLowerCase()&&r.setAttribute("data-rr-is-password","true"),!J(r.tagName,i))if(s.attributes[i]=X(this.doc,T(r.tagName),T(i),n),"style"===i){if(!this.unattachedDoc)try{this.unattachedDoc=document.implementation.createHTMLDocument()}catch(t){this.unattachedDoc=this.doc}var a=this.unattachedDoc.createElement("span");for(var l of(t.oldValue&&a.setAttribute("style",t.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)?s.styleDiff[l]=""===c?u:[u,c]:s._unchangedStyles[l]=[u,c]}for(var h of Array.from(a.style))""===r.style.getPropertyValue(h)&&(s.styleDiff[h]=!1)}else"open"===i&&"DIALOG"===r.tagName&&(r.matches("dialog:modal")?s.attributes.rr_open_mode="modal":s.attributes.rr_open_mode="non-modal");break;case"childList":if(kt(t.target,this.blockClass,this.blockSelector,!0))return;if("TEXTAREA"===t.target.tagName)return void this.genTextAreaValueMutation(t.target);t.addedNodes.forEach((e=>this.genAdds(e,t.target))),t.removedNodes.forEach((e=>{var r=this.mirror.getId(e),i=_(t.target)?this.mirror.getId(vt.host(t.target)):this.mirror.getId(t.target);kt(t.target,this.blockClass,this.blockSelector,!1)||xt(e,this.mirror,this.slimDOMOptions)||!function(t,e){return-1!==e.getId(t)}(e,this.mirror)||(this.addedSet.has(e)?(Wt(this.addedSet,e),this.droppedSet.add(e)):this.addedSet.has(t.target)&&-1===r||At(t.target,this.mirror)||(this.movedSet.has(e)&&this.movedMap[Yt(r,i)]?Wt(this.movedSet,e):this.removes.push({parentId:i,id:r,isShadow:!(!_(t.target)||!C(t.target))||void 0})),this.mapRemoves.push(e))}))}})),a(this,"genAdds",((t,e)=>{if(!this.processedNodeManager.inOtherBuffer(t,this)&&!this.addedSet.has(t)&&!this.movedSet.has(t)){if(this.mirror.hasNode(t)){if(xt(t,this.mirror,this.slimDOMOptions))return;this.movedSet.add(t);var r=null;e&&this.mirror.hasNode(e)&&(r=this.mirror.getId(e)),r&&-1!==r&&(this.movedMap[Yt(this.mirror.getId(t),r)]=!0)}else this.addedSet.add(t),this.droppedSet.delete(t);kt(t,this.blockClass,this.blockSelector,!1)||(vt.childNodes(t).forEach((t=>this.genAdds(t))),Nt(t)&&vt.childNodes(vt.shadowRoot(t)).forEach((e=>{this.processedNodeManager.add(e,this),this.genAdds(e,t)})))}}))}init(t){["mutationCb","blockClass","blockSelector","maskTextClass","maskTextSelector","inlineStylesheet","maskInputOptions","maskTextFn","maskInputFn","keepIframeSrcFn","recordCanvas","inlineImages","slimDOMOptions","dataURLOptions","doc","mirror","iframeManager","stylesheetManager","shadowDomManager","canvasManager","processedNodeManager"].forEach((e=>{this[e]=t[e]}))}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 Wt(t,e){t.delete(e),vt.childNodes(e).forEach((e=>Wt(t,e)))}function zt(t,e,r){return 0!==t.length&&function(t,e,r){var i,n=vt.parentNode(e),o=function(){var e=r.getId(n);if(t.some((t=>t.id===e)))return{v:!0};n=vt.parentNode(n)};for(;n;)if(i=o())return i.v;return!1}(t,e,r)}function Ut(t,e){return 0!==t.size&&Xt(t,e)}function Xt(t,e){var r=vt.parentNode(e);return!!r&&(!!t.has(r)||Xt(t,r))}var Jt=t=>{if(!jt)return t;return function(){try{return t(...arguments)}catch(t){if(jt&&!0===jt(t))return;throw t}}},Kt=[];function Qt(t){try{if("composedPath"in t){var e=t.composedPath();if(e.length)return e[0]}else if("path"in t&&t.path.length)return t.path[0]}catch(t){}return t&&t.target}function te(t,e){var r=new Gt;Kt.push(r),r.init(t);var i=new(dt())(Jt(r.processMutations.bind(r)));return i.observe(e,{attributes:!0,attributeOldValue:!0,characterData:!0,characterDataOldValue:!0,childList:!0,subtree:!0}),i}function ee(t){var{mouseInteractionCb:e,doc:i,mirror:n,blockClass:o,blockSelector:s,sampling:a}=t;if(!1===a.mouseInteraction)return()=>{};var l=!0===a.mouseInteraction||void 0===a.mouseInteraction?{}:a.mouseInteraction,u=[],c=null;return Object.keys(Bt).filter((t=>Number.isNaN(Number(t))&&!t.endsWith("_Departed")&&!1!==l[t])).forEach((t=>{var a=T(t),l=(t=>i=>{var a=Qt(i);if(!kt(a,o,s,!0)){var l=null,u=t;if("pointerType"in i){switch(i.pointerType){case"mouse":l=Zt.Mouse;break;case"touch":l=Zt.Touch;break;case"pen":l=Zt.Pen}l===Zt.Touch?Bt[t]===Bt.MouseDown?u="TouchStart":Bt[t]===Bt.MouseUp&&(u="TouchEnd"):Zt.Pen}else Tt(i)&&(l=Zt.Touch);null!==l?(c=l,(u.startsWith("Touch")&&l===Zt.Touch||u.startsWith("Mouse")&&l===Zt.Mouse)&&(l=null)):Bt[t]===Bt.Click&&(l=c,c=null);var h=Tt(i)?i.changedTouches[0]:i;if(h){var d=n.getId(a),{clientX:v,clientY:f}=h;Jt(e)(r({type:Bt[u],id:d,x:v,y:f},null!==l&&{pointerType:l}))}}})(t);if(window.PointerEvent)switch(Bt[t]){case Bt.MouseDown:case Bt.MouseUp:a=a.replace("mouse","pointer");break;case Bt.TouchStart:case Bt.TouchEnd:return}u.push(ft(a,l,i))})),Jt((()=>{u.forEach((t=>t()))}))}function re(t){var{scrollCb:e,doc:r,mirror:i,blockClass:n,blockSelector:o,sampling:s}=t;return ft("scroll",Jt(mt(Jt((t=>{var s=Qt(t);if(s&&!kt(s,n,o,!0)){var a=i.getId(s);if(s===r&&r.defaultView){var l=_t(r.defaultView);e({id:a,x:l.left,y:l.top})}else e({id:a,x:s.scrollLeft,y:s.scrollTop})}})),s.scroll||100)),r)}var ie=["INPUT","TEXTAREA","SELECT"],ne=new WeakMap;function oe(t){return function(t,e){if(ue("CSSGroupingRule")&&t.parentRule instanceof CSSGroupingRule||ue("CSSMediaRule")&&t.parentRule instanceof CSSMediaRule||ue("CSSSupportsRule")&&t.parentRule instanceof CSSSupportsRule||ue("CSSConditionRule")&&t.parentRule instanceof CSSConditionRule){var r=Array.from(t.parentRule.cssRules).indexOf(t);e.unshift(r)}else if(t.parentStyleSheet){var i=Array.from(t.parentStyleSheet.cssRules).indexOf(t);e.unshift(i)}return e}(t,[])}function se(t,e,r){var i,n;return t?(t.ownerNode?i=e.getId(t.ownerNode):n=r.getId(t),{styleId:n,id:i}):{}}function ae(t,e){var r,i,n,{mirror:o,stylesheetManager:s}=t,a=null;a="#document"===e.nodeName?o.getId(e):o.getId(vt.host(e));var l="#document"===e.nodeName?null==(r=e.defaultView)?void 0:r.Document:null==(n=null==(i=e.ownerDocument)?void 0:i.defaultView)?void 0:n.ShadowRoot,u=(null==l?void 0:l.prototype)?Object.getOwnPropertyDescriptor(null==l?void 0:l.prototype,"adoptedStyleSheets"):void 0;return null!==a&&-1!==a&&l&&u?(Object.defineProperty(e,"adoptedStyleSheets",{configurable:u.configurable,enumerable:u.enumerable,get(){var t;return null==(t=u.get)?void 0:t.call(this)},set(t){var e,r=null==(e=u.set)?void 0:e.call(this,t);if(null!==a&&-1!==a)try{s.adoptStyleSheets(t,a)}catch(t){}return r}}),Jt((()=>{Object.defineProperty(e,"adoptedStyleSheets",{configurable:u.configurable,enumerable:u.enumerable,get:u.get,set:u.set})}))):()=>{}}function le(t,e){void 0===e&&(e={});var i,n=t.doc.defaultView;if(!n)return()=>{};!function(t,e){var{mutationCb:r,mousemoveCb:i,mouseInteractionCb:n,scrollCb:o,viewportResizeCb:s,inputCb:a,mediaInteractionCb:l,styleSheetRuleCb:u,styleDeclarationCb:c,canvasMutationCb:h,fontCb:d,selectionCb:v,customElementCb:f}=t;t.mutationCb=function(){e.mutation&&e.mutation(...arguments),r(...arguments)},t.mousemoveCb=function(){e.mousemove&&e.mousemove(...arguments),i(...arguments)},t.mouseInteractionCb=function(){e.mouseInteraction&&e.mouseInteraction(...arguments),n(...arguments)},t.scrollCb=function(){e.scroll&&e.scroll(...arguments),o(...arguments)},t.viewportResizeCb=function(){e.viewportResize&&e.viewportResize(...arguments),s(...arguments)},t.inputCb=function(){e.input&&e.input(...arguments),a(...arguments)},t.mediaInteractionCb=function(){e.mediaInteaction&&e.mediaInteaction(...arguments),l(...arguments)},t.styleSheetRuleCb=function(){e.styleSheetRule&&e.styleSheetRule(...arguments),u(...arguments)},t.styleDeclarationCb=function(){e.styleDeclaration&&e.styleDeclaration(...arguments),c(...arguments)},t.canvasMutationCb=function(){e.canvasMutation&&e.canvasMutation(...arguments),h(...arguments)},t.fontCb=function(){e.font&&e.font(...arguments),d(...arguments)},t.selectionCb=function(){e.selection&&e.selection(...arguments),v(...arguments)},t.customElementCb=function(){e.customElement&&e.customElement(...arguments),f(...arguments)}}(t,e),t.recordDOM&&(i=te(t,t.doc));var o=function(t){var{mousemoveCb:e,sampling:r,doc:i,mirror:n}=t;if(!1===r.mousemove)return()=>{};var o,s="number"==typeof r.mousemove?r.mousemove:50,a="number"==typeof r.mousemoveCallback?r.mousemoveCallback:500,l=[],u=mt(Jt((t=>{var r=Date.now()-o;e(l.map((t=>(t.timeOffset-=r,t))),t),l=[],o=null})),a),c=Jt(mt(Jt((t=>{var e=Qt(t),{clientX:r,clientY:i}=Tt(t)?t.changedTouches[0]:t;o||(o=wt()),l.push({x:r,y:i,id:n.getId(e),timeOffset:wt()-o}),u("undefined"!=typeof DragEvent&&t instanceof DragEvent?Dt.Drag:t instanceof MouseEvent?Dt.MouseMove:Dt.TouchMove)})),s,{trailing:!1})),h=[ft("mousemove",c,i),ft("touchmove",c,i),ft("drag",c,i)];return Jt((()=>{h.forEach((t=>t()))}))}(t),s=ee(t),a=re(t),l=function(t,e){var{viewportResizeCb:r}=t,{win:i}=e,n=-1,o=-1;return ft("resize",Jt(mt(Jt((()=>{var t=Ct(),e=It();n===t&&o===e||(r({width:Number(e),height:Number(t)}),n=t,o=e)})),200)),i)}(t,{win:n}),u=function(t){var{inputCb:e,doc:i,mirror:n,blockClass:o,blockSelector:s,ignoreClass:a,ignoreSelector:l,maskInputOptions:u,maskInputFn:c,sampling:h,userTriggeredOnInput:d}=t;function v(t){var e=Qt(t),r=t.isTrusted,n=e&&e.tagName;if(e&&"OPTION"===n&&(e=vt.parentElement(e)),e&&n&&!(ie.indexOf(n)<0)&&!kt(e,o,s,!0)&&!(e.classList.contains(a)||l&&e.matches(l))){var h=e.value,v=!1,p=E(e)||"";"radio"===p||"checkbox"===p?v=e.checked:(u[n.toLowerCase()]||u[p])&&(h=A({element:e,maskInputOptions:u,tagName:n,type:p,value:h,maskInputFn:c})),f(e,d?{text:h,isChecked:v,userTriggered:r}:{text:h,isChecked:v});var g=e.name;"radio"===p&&g&&v&&i.querySelectorAll('input[type="radio"][name="'+g+'"]').forEach((t=>{if(t!==e){var r=t.value;f(t,d?{text:r,isChecked:!v,userTriggered:!1}:{text:r,isChecked:!v})}}))}}function f(t,i){var o=ne.get(t);if(!o||o.text!==i.text||o.isChecked!==i.isChecked){ne.set(t,i);var s=n.getId(t);Jt(e)(r({},i,{id:s}))}}var p=("last"===h.input?["change"]:["input","change"]).map((t=>ft(t,Jt(v),i))),g=i.defaultView;if(!g)return()=>{p.forEach((t=>t()))};var m=g.Object.getOwnPropertyDescriptor(g.HTMLInputElement.prototype,"value"),y=[[g.HTMLInputElement.prototype,"value"],[g.HTMLInputElement.prototype,"checked"],[g.HTMLSelectElement.prototype,"value"],[g.HTMLTextAreaElement.prototype,"value"],[g.HTMLSelectElement.prototype,"selectedIndex"],[g.HTMLOptionElement.prototype,"selected"]];return m&&m.set&&p.push(...y.map((t=>yt(t[0],t[1],{set(){Jt(v)({target:this,isTrusted:!1})}},!1,g)))),Jt((()=>{p.forEach((t=>t()))}))}(t),c=function(t){var{mediaInteractionCb:e,blockClass:r,blockSelector:i,mirror:n,sampling:o,doc:s}=t,a=Jt((t=>mt(Jt((o=>{var s=Qt(o);if(s&&!kt(s,r,i,!0)){var{currentTime:a,volume:l,muted:u,playbackRate:c,loop:h}=s;e({type:t,id:n.getId(s),currentTime:a,volume:l,muted:u,playbackRate:c,loop:h})}})),o.media||500))),l=[ft("play",a(qt.Play),s),ft("pause",a(qt.Pause),s),ft("seeked",a(qt.Seeked),s),ft("volumechange",a(qt.VolumeChange),s),ft("ratechange",a(qt.RateChange),s)];return Jt((()=>{l.forEach((t=>t()))}))}(t),h=()=>{},d=()=>{},v=()=>{},f=()=>{};t.recordDOM&&(h=function(t,e){var{styleSheetRuleCb:r,mirror:i,stylesheetManager:n}=t,{win:o}=e;if(!o.CSSStyleSheet||!o.CSSStyleSheet.prototype)return()=>{};var s=o.CSSStyleSheet.prototype.insertRule;o.CSSStyleSheet.prototype.insertRule=new Proxy(s,{apply:Jt(((t,e,o)=>{var[s,a]=o,{id:l,styleId:u}=se(e,i,n.styleMirror);return(l&&-1!==l||u&&-1!==u)&&r({id:l,styleId:u,adds:[{rule:s,index:a}]}),t.apply(e,o)}))}),o.CSSStyleSheet.prototype.addRule=function(t,e,r){void 0===r&&(r=this.cssRules.length);var i=t+" { "+e+" }";return o.CSSStyleSheet.prototype.insertRule.apply(this,[i,r])};var a,l,u=o.CSSStyleSheet.prototype.deleteRule;o.CSSStyleSheet.prototype.deleteRule=new Proxy(u,{apply:Jt(((t,e,o)=>{var[s]=o,{id:a,styleId:l}=se(e,i,n.styleMirror);return(a&&-1!==a||l&&-1!==l)&&r({id:a,styleId:l,removes:[{index:s}]}),t.apply(e,o)}))}),o.CSSStyleSheet.prototype.removeRule=function(t){return o.CSSStyleSheet.prototype.deleteRule.apply(this,[t])},o.CSSStyleSheet.prototype.replace&&(a=o.CSSStyleSheet.prototype.replace,o.CSSStyleSheet.prototype.replace=new Proxy(a,{apply:Jt(((t,e,o)=>{var[s]=o,{id:a,styleId:l}=se(e,i,n.styleMirror);return(a&&-1!==a||l&&-1!==l)&&r({id:a,styleId:l,replace:s}),t.apply(e,o)}))})),o.CSSStyleSheet.prototype.replaceSync&&(l=o.CSSStyleSheet.prototype.replaceSync,o.CSSStyleSheet.prototype.replaceSync=new Proxy(l,{apply:Jt(((t,e,o)=>{var[s]=o,{id:a,styleId:l}=se(e,i,n.styleMirror);return(a&&-1!==a||l&&-1!==l)&&r({id:a,styleId:l,replaceSync:s}),t.apply(e,o)}))}));var c={};ce("CSSGroupingRule")?c.CSSGroupingRule=o.CSSGroupingRule:(ce("CSSMediaRule")&&(c.CSSMediaRule=o.CSSMediaRule),ce("CSSConditionRule")&&(c.CSSConditionRule=o.CSSConditionRule),ce("CSSSupportsRule")&&(c.CSSSupportsRule=o.CSSSupportsRule));var h={};return Object.entries(c).forEach((t=>{var[e,o]=t;h[e]={insertRule:o.prototype.insertRule,deleteRule:o.prototype.deleteRule},o.prototype.insertRule=new Proxy(h[e].insertRule,{apply:Jt(((t,e,o)=>{var[s,a]=o,{id:l,styleId:u}=se(e.parentStyleSheet,i,n.styleMirror);return(l&&-1!==l||u&&-1!==u)&&r({id:l,styleId:u,adds:[{rule:s,index:[...oe(e),a||0]}]}),t.apply(e,o)}))}),o.prototype.deleteRule=new Proxy(h[e].deleteRule,{apply:Jt(((t,e,o)=>{var[s]=o,{id:a,styleId:l}=se(e.parentStyleSheet,i,n.styleMirror);return(a&&-1!==a||l&&-1!==l)&&r({id:a,styleId:l,removes:[{index:[...oe(e),s]}]}),t.apply(e,o)}))})})),Jt((()=>{o.CSSStyleSheet.prototype.insertRule=s,o.CSSStyleSheet.prototype.deleteRule=u,a&&(o.CSSStyleSheet.prototype.replace=a),l&&(o.CSSStyleSheet.prototype.replaceSync=l),Object.entries(c).forEach((t=>{var[e,r]=t;r.prototype.insertRule=h[e].insertRule,r.prototype.deleteRule=h[e].deleteRule}))}))}(t,{win:n}),d=ae(t,t.doc),v=function(t,e){var{styleDeclarationCb:r,mirror:i,ignoreCSSAttributes:n,stylesheetManager:o}=t,{win:s}=e,a=s.CSSStyleDeclaration.prototype.setProperty;s.CSSStyleDeclaration.prototype.setProperty=new Proxy(a,{apply:Jt(((t,e,s)=>{var l,[u,c,h]=s;if(n.has(u))return a.apply(e,[u,c,h]);var{id:d,styleId:v}=se(null==(l=e.parentRule)?void 0:l.parentStyleSheet,i,o.styleMirror);return(d&&-1!==d||v&&-1!==v)&&r({id:d,styleId:v,set:{property:u,value:c,priority:h},index:oe(e.parentRule)}),t.apply(e,s)}))});var l=s.CSSStyleDeclaration.prototype.removeProperty;return s.CSSStyleDeclaration.prototype.removeProperty=new Proxy(l,{apply:Jt(((t,e,s)=>{var a,[u]=s;if(n.has(u))return l.apply(e,[u]);var{id:c,styleId:h}=se(null==(a=e.parentRule)?void 0:a.parentStyleSheet,i,o.styleMirror);return(c&&-1!==c||h&&-1!==h)&&r({id:c,styleId:h,remove:{property:u},index:oe(e.parentRule)}),t.apply(e,s)}))}),Jt((()=>{s.CSSStyleDeclaration.prototype.setProperty=a,s.CSSStyleDeclaration.prototype.removeProperty=l}))}(t,{win:n}),t.collectFonts&&(f=function(t){var{fontCb:e,doc:r}=t,i=r.defaultView;if(!i)return()=>{};var n=[],o=new WeakMap,s=i.FontFace;i.FontFace=function(t,e,r){var i=new s(t,e,r);return o.set(i,{family:t,buffer:"string"!=typeof e,descriptors:r,fontSource:"string"==typeof e?e:JSON.stringify(Array.from(new Uint8Array(e)))}),i};var a=bt(r.fonts,"add",(function(t){return function(r){return setTimeout(Jt((()=>{var t=o.get(r);t&&(e(t),o.delete(r))})),0),t.apply(this,[r])}}));return n.push((()=>{i.FontFace=s})),n.push(a),Jt((()=>{n.forEach((t=>t()))}))}(t)));var p=function(t){var{doc:e,mirror:r,blockClass:i,blockSelector:n,selectionCb:o}=t,s=!0,a=Jt((()=>{var t=e.getSelection();if(!(!t||s&&(null==t?void 0:t.isCollapsed))){s=t.isCollapsed||!1;for(var a=[],l=t.rangeCount||0,u=0;u<l;u++){var c=t.getRangeAt(u),{startContainer:h,startOffset:d,endContainer:v,endOffset:f}=c;kt(h,i,n,!0)||kt(v,i,n,!0)||a.push({start:r.getId(h),startOffset:d,end:r.getId(v),endOffset:f})}o({ranges:a})}}));return a(),ft("selectionchange",a)}(t),g=function(t){var{doc:e,customElementCb:r}=t,i=e.defaultView;return i&&i.customElements?bt(i.customElements,"define",(function(t){return function(e,i,n){try{r({define:{name:e}})}catch(t){console.warn("Custom element callback failed for "+e)}return t.apply(this,[e,i,n])}})):()=>{}}(t),m=[];for(var y of t.plugins)m.push(y.observer(y.callback,n,y.options));return Jt((()=>{Kt.forEach((t=>t.reset())),null==i||i.disconnect(),o(),s(),a(),l(),u(),c(),h(),d(),v(),f(),p(),g(),m.forEach((t=>t()))}))}function ue(t){return void 0!==window[t]}function ce(t){return Boolean(void 0!==window[t]&&window[t].prototype&&"insertRule"in window[t].prototype&&"deleteRule"in window[t].prototype)}class he{constructor(t){a(this,"iframeIdToRemoteIdMap",new WeakMap),a(this,"iframeRemoteIdToIdMap",new WeakMap),this.generateIdFn=t}getId(t,e,r,i){var n=r||this.getIdToRemoteIdMap(t),o=i||this.getRemoteIdToIdMap(t),s=n.get(e);return s||(s=this.generateIdFn(),n.set(e,s),o.set(s,e)),s}getIds(t,e){var r=this.getIdToRemoteIdMap(t),i=this.getRemoteIdToIdMap(t);return e.map((e=>this.getId(t,e,r,i)))}getRemoteId(t,e,r){var i=r||this.getRemoteIdToIdMap(t);if("number"!=typeof e)return e;var n=i.get(e);return n||-1}getRemoteIds(t,e){var r=this.getRemoteIdToIdMap(t);return e.map((e=>this.getRemoteId(t,e,r)))}reset(t){if(!t)return this.iframeIdToRemoteIdMap=new WeakMap,void(this.iframeRemoteIdToIdMap=new WeakMap);this.iframeIdToRemoteIdMap.delete(t),this.iframeRemoteIdToIdMap.delete(t)}getIdToRemoteIdMap(t){var e=this.iframeIdToRemoteIdMap.get(t);return e||(e=new Map,this.iframeIdToRemoteIdMap.set(t,e)),e}getRemoteIdToIdMap(t){var e=this.iframeRemoteIdToIdMap.get(t);return e||(e=new Map,this.iframeRemoteIdToIdMap.set(t,e)),e}}class de{constructor(t){a(this,"iframes",new WeakMap),a(this,"crossOriginIframeMap",new WeakMap),a(this,"crossOriginIframeMirror",new he(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=t.mutationCb,this.wrappedEmit=t.wrappedEmit,this.stylesheetManager=t.stylesheetManager,this.recordCrossOriginIframes=t.recordCrossOriginIframes,this.crossOriginIframeStyleMirror=new he(this.stylesheetManager.styleMirror.generateId.bind(this.stylesheetManager.styleMirror)),this.mirror=t.mirror,this.recordCrossOriginIframes&&window.addEventListener("message",this.handleMessage.bind(this))}addIframe(t){this.iframes.set(t,!0),t.contentWindow&&this.crossOriginIframeMap.set(t.contentWindow,t)}addLoadListener(t){this.loadListener=t}attachIframe(t,e){var r,i;this.mutationCb({adds:[{parentId:this.mirror.getId(t),nextId:null,node:e}],removes:[],texts:[],attributes:[],isAttachIframe:!0}),this.recordCrossOriginIframes&&(null==(r=t.contentWindow)||r.addEventListener("message",this.handleMessage.bind(this))),null==(i=this.loadListener)||i.call(this,t),t.contentDocument&&t.contentDocument.adoptedStyleSheets&&t.contentDocument.adoptedStyleSheets.length>0&&this.stylesheetManager.adoptStyleSheets(t.contentDocument.adoptedStyleSheets,this.mirror.getId(t.contentDocument))}handleMessage(t){var e=t;if("rrweb"===e.data.type&&e.origin===e.data.origin&&t.source){var r=this.crossOriginIframeMap.get(t.source);if(r){var i=this.transformCrossOriginEvent(r,e.data.event);i&&this.wrappedEmit(i,e.data.isCheckout)}}}transformCrossOriginEvent(t,e){var r;switch(e.type){case Lt.FullSnapshot:this.crossOriginIframeMirror.reset(t),this.crossOriginIframeStyleMirror.reset(t),this.replaceIdOnNode(e.data.node,t);var i=e.data.node.id;return this.crossOriginIframeRootIdMap.set(t,i),this.patchRootIdOnNode(e.data.node,i),{timestamp:e.timestamp,type:Lt.IncrementalSnapshot,data:{source:Dt.Mutation,adds:[{parentId:this.mirror.getId(t),nextId:null,node:e.data.node}],removes:[],texts:[],attributes:[],isAttachIframe:!0}};case Lt.Meta:case Lt.Load:case Lt.DomContentLoaded:return!1;case Lt.Plugin:return e;case Lt.Custom:return this.replaceIds(e.data.payload,t,["id","parentId","previousId","nextId"]),e;case Lt.IncrementalSnapshot:switch(e.data.source){case Dt.Mutation:return e.data.adds.forEach((e=>{this.replaceIds(e,t,["parentId","nextId","previousId"]),this.replaceIdOnNode(e.node,t);var r=this.crossOriginIframeRootIdMap.get(t);r&&this.patchRootIdOnNode(e.node,r)})),e.data.removes.forEach((e=>{this.replaceIds(e,t,["parentId","id"])})),e.data.attributes.forEach((e=>{this.replaceIds(e,t,["id"])})),e.data.texts.forEach((e=>{this.replaceIds(e,t,["id"])})),e;case Dt.Drag:case Dt.TouchMove:case Dt.MouseMove:return e.data.positions.forEach((e=>{this.replaceIds(e,t,["id"])})),e;case Dt.ViewportResize:return!1;case Dt.MediaInteraction:case Dt.MouseInteraction:case Dt.Scroll:case Dt.CanvasMutation:case Dt.Input:return this.replaceIds(e.data,t,["id"]),e;case Dt.StyleSheetRule:case Dt.StyleDeclaration:return this.replaceIds(e.data,t,["id"]),this.replaceStyleIds(e.data,t,["styleId"]),e;case Dt.Font:return e;case Dt.Selection:return e.data.ranges.forEach((e=>{this.replaceIds(e,t,["start","end"])})),e;case Dt.AdoptedStyleSheet:return this.replaceIds(e.data,t,["id"]),this.replaceStyleIds(e.data,t,["styleIds"]),null==(r=e.data.styles)||r.forEach((e=>{this.replaceStyleIds(e,t,["styleId"])})),e}}return!1}replace(t,e,r,i){for(var n of i)(Array.isArray(e[n])||"number"==typeof e[n])&&(Array.isArray(e[n])?e[n]=t.getIds(r,e[n]):e[n]=t.getId(r,e[n]));return e}replaceIds(t,e,r){return this.replace(this.crossOriginIframeMirror,t,e,r)}replaceStyleIds(t,e,r){return this.replace(this.crossOriginIframeStyleMirror,t,e,r)}replaceIdOnNode(t,e){this.replaceIds(t,e,["id","rootId"]),"childNodes"in t&&t.childNodes.forEach((t=>{this.replaceIdOnNode(t,e)}))}patchRootIdOnNode(t,e){t.type===c.Document||t.rootId||(t.rootId=e),"childNodes"in t&&t.childNodes.forEach((t=>{this.patchRootIdOnNode(t,e)}))}}class ve{constructor(t){a(this,"shadowDoms",new WeakSet),a(this,"mutationCb"),a(this,"scrollCb"),a(this,"bypassOptions"),a(this,"mirror"),a(this,"restoreHandlers",[]),this.mutationCb=t.mutationCb,this.scrollCb=t.scrollCb,this.bypassOptions=t.bypassOptions,this.mirror=t.mirror,this.init()}init(){this.reset(),this.patchAttachShadow(Element,document)}addShadowRoot(t,e){if(C(t)&&!this.shadowDoms.has(t)){this.shadowDoms.add(t);var i=te(r({},this.bypassOptions,{doc:e,mutationCb:this.mutationCb,mirror:this.mirror,shadowDomManager:this}),t);this.restoreHandlers.push((()=>i.disconnect())),this.restoreHandlers.push(re(r({},this.bypassOptions,{scrollCb:this.scrollCb,doc:t,mirror:this.mirror}))),setTimeout((()=>{t.adoptedStyleSheets&&t.adoptedStyleSheets.length>0&&this.bypassOptions.stylesheetManager.adoptStyleSheets(t.adoptedStyleSheets,this.mirror.getId(vt.host(t))),this.restoreHandlers.push(ae({mirror:this.mirror,stylesheetManager:this.bypassOptions.stylesheetManager},t))}),0)}}observeAttachShadow(t){t.contentWindow&&t.contentDocument&&this.patchAttachShadow(t.contentWindow.Element,t.contentDocument)}patchAttachShadow(t,e){var r=this;this.restoreHandlers.push(bt(t.prototype,"attachShadow",(function(t){return function(i){var n=t.call(this,i),o=vt.shadowRoot(this);return o&&Pt(this)&&r.addShadowRoot(o,e),n}})))}reset(){this.restoreHandlers.forEach((t=>{try{t()}catch(t){}})),this.restoreHandlers=[],this.shadowDoms=new WeakSet}}for(var fe="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",pe="undefined"==typeof Uint8Array?[]:new Uint8Array(256),ge=0;ge<64;ge++)pe[fe.charCodeAt(ge)]=ge;var me=new Map;var ye=(t,e,r)=>{if(t&&(_e(t,e)||"object"==typeof t)){var i=function(t,e){var r=me.get(t);return r||(r=new Map,me.set(t,r)),r.has(e)||r.set(e,[]),r.get(e)}(r,t.constructor.name),n=i.indexOf(t);return-1===n&&(n=i.length,i.push(t)),n}};function be(t,e,r){if(t instanceof Array)return t.map((t=>be(t,e,r)));if(null===t)return t;if(t instanceof Float32Array||t instanceof Float64Array||t instanceof Int32Array||t instanceof Uint32Array||t instanceof Uint8Array||t instanceof Uint16Array||t instanceof Int16Array||t instanceof Int8Array||t instanceof Uint8ClampedArray)return{rr_type:t.constructor.name,args:[Object.values(t)]};if(t instanceof ArrayBuffer)return{rr_type:t.constructor.name,base64:function(t){var e,r=new Uint8Array(t),i=r.length,n="";for(e=0;e<i;e+=3)n+=fe[r[e]>>2],n+=fe[(3&r[e])<<4|r[e+1]>>4],n+=fe[(15&r[e+1])<<2|r[e+2]>>6],n+=fe[63&r[e+2]];return i%3==2?n=n.substring(0,n.length-1)+"=":i%3==1&&(n=n.substring(0,n.length-2)+"=="),n}(t)};if(t instanceof DataView)return{rr_type:t.constructor.name,args:[be(t.buffer,e,r),t.byteOffset,t.byteLength]};if(t instanceof HTMLImageElement){var i=t.constructor.name,{src:n}=t;return{rr_type:i,src:n}}if(t instanceof HTMLCanvasElement){return{rr_type:"HTMLImageElement",src:t.toDataURL()}}return t instanceof ImageData?{rr_type:t.constructor.name,args:[be(t.data,e,r),t.width,t.height]}:_e(t,e)||"object"==typeof t?{rr_type:t.constructor.name,index:ye(t,e,r)}:t}var we=(t,e,r)=>t.map((t=>be(t,e,r))),_e=(t,e)=>{var r=["WebGLActiveInfo","WebGLBuffer","WebGLFramebuffer","WebGLProgram","WebGLRenderbuffer","WebGLShader","WebGLShaderPrecisionFormat","WebGLTexture","WebGLUniformLocation","WebGLVertexArrayObject","WebGLVertexArrayObjectOES"].filter((t=>"function"==typeof e[t]));return Boolean(r.find((r=>t instanceof e[r])))};function Ce(t,e,r,i){var n=[];try{var o=bt(t.HTMLCanvasElement.prototype,"getContext",(function(t){return function(n){for(var o=arguments.length,s=new Array(o>1?o-1:0),a=1;a<o;a++)s[a-1]=arguments[a];if(!kt(this,e,r,!0)){var l=function(t){return"experimental-webgl"===t?"webgl":t}(n);if("__context"in this||(this.__context=l),i&&["webgl","webgl2"].includes(l))if(s[0]&&"object"==typeof s[0]){var u=s[0];u.preserveDrawingBuffer||(u.preserveDrawingBuffer=!0)}else s.splice(0,1,{preserveDrawingBuffer:!0})}return t.apply(this,[n,...s])}}));n.push(o)}catch(t){console.error("failed to patch HTMLCanvasElement.prototype.getContext")}return()=>{n.forEach((t=>t()))}}function Ie(t,e,r,i,n,o){var s=[],a=Object.getOwnPropertyNames(t),l=function(a){if(["isContextLost","canvas","drawingBufferWidth","drawingBufferHeight"].includes(a))return 0;try{if("function"!=typeof t[a])return 0;var l=bt(t,a,(function(t){return function(){for(var s=arguments.length,l=new Array(s),u=0;u<s;u++)l[u]=arguments[u];var c=t.apply(this,l);if(ye(c,o,this),"tagName"in this.canvas&&!kt(this.canvas,i,n,!0)){var h=we(l,o,this),d={type:e,property:a,args:h};r(this.canvas,d)}return c}}));s.push(l)}catch(i){var u=yt(t,a,{set(t){r(this.canvas,{type:e,property:a,args:[t],setter:!0})}});s.push(u)}};for(var u of a)l(u);return s}var Se,ke,xe,Ae,Te="KGZ1bmN0aW9uKCkgewogICJ1c2Ugc3RyaWN0IjsKICB2YXIgY2hhcnMgPSAiQUJDREVGR0hJSktMTU5PUFFSU1RVVldYWVphYmNkZWZnaGlqa2xtbm9wcXJzdHV2d3h5ejAxMjM0NTY3ODkrLyI7CiAgdmFyIGxvb2t1cCA9IHR5cGVvZiBVaW50OEFycmF5ID09PSAidW5kZWZpbmVkIiA/IFtdIDogbmV3IFVpbnQ4QXJyYXkoMjU2KTsKICBmb3IgKHZhciBpID0gMDsgaSA8IGNoYXJzLmxlbmd0aDsgaSsrKSB7CiAgICBsb29rdXBbY2hhcnMuY2hhckNvZGVBdChpKV0gPSBpOwogIH0KICB2YXIgZW5jb2RlID0gZnVuY3Rpb24oYXJyYXlidWZmZXIpIHsKICAgIHZhciBieXRlcyA9IG5ldyBVaW50OEFycmF5KGFycmF5YnVmZmVyKSwgaTIsIGxlbiA9IGJ5dGVzLmxlbmd0aCwgYmFzZTY0ID0gIiI7CiAgICBmb3IgKGkyID0gMDsgaTIgPCBsZW47IGkyICs9IDMpIHsKICAgICAgYmFzZTY0ICs9IGNoYXJzW2J5dGVzW2kyXSA+PiAyXTsKICAgICAgYmFzZTY0ICs9IGNoYXJzWyhieXRlc1tpMl0gJiAzKSA8PCA0IHwgYnl0ZXNbaTIgKyAxXSA+PiA0XTsKICAgICAgYmFzZTY0ICs9IGNoYXJzWyhieXRlc1tpMiArIDFdICYgMTUpIDw8IDIgfCBieXRlc1tpMiArIDJdID4+IDZdOwogICAgICBiYXNlNjQgKz0gY2hhcnNbYnl0ZXNbaTIgKyAyXSAmIDYzXTsKICAgIH0KICAgIGlmIChsZW4gJSAzID09PSAyKSB7CiAgICAgIGJhc2U2NCA9IGJhc2U2NC5zdWJzdHJpbmcoMCwgYmFzZTY0Lmxlbmd0aCAtIDEpICsgIj0iOwogICAgfSBlbHNlIGlmIChsZW4gJSAzID09PSAxKSB7CiAgICAgIGJhc2U2NCA9IGJhc2U2NC5zdWJzdHJpbmcoMCwgYmFzZTY0Lmxlbmd0aCAtIDIpICsgIj09IjsKICAgIH0KICAgIHJldHVybiBiYXNlNjQ7CiAgfTsKICBjb25zdCBsYXN0QmxvYk1hcCA9IC8qIEBfX1BVUkVfXyAqLyBuZXcgTWFwKCk7CiAgY29uc3QgdHJhbnNwYXJlbnRCbG9iTWFwID0gLyogQF9fUFVSRV9fICovIG5ldyBNYXAoKTsKICBhc3luYyBmdW5jdGlvbiBnZXRUcmFuc3BhcmVudEJsb2JGb3Iod2lkdGgsIGhlaWdodCwgZGF0YVVSTE9wdGlvbnMpIHsKICAgIGNvbnN0IGlkID0gYCR7d2lkdGh9LSR7aGVpZ2h0fWA7CiAgICBpZiAoIk9mZnNjcmVlbkNhbnZhcyIgaW4gZ2xvYmFsVGhpcykgewogICAgICBpZiAodHJhbnNwYXJlbnRCbG9iTWFwLmhhcyhpZCkpIHJldHVybiB0cmFuc3BhcmVudEJsb2JNYXAuZ2V0KGlkKTsKICAgICAgY29uc3Qgb2Zmc2NyZWVuID0gbmV3IE9mZnNjcmVlbkNhbnZhcyh3aWR0aCwgaGVpZ2h0KTsKICAgICAgb2Zmc2NyZWVuLmdldENvbnRleHQoIjJkIik7CiAgICAgIGNvbnN0IGJsb2IgPSBhd2FpdCBvZmZzY3JlZW4uY29udmVydFRvQmxvYihkYXRhVVJMT3B0aW9ucyk7CiAgICAgIGNvbnN0IGFycmF5QnVmZmVyID0gYXdhaXQgYmxvYi5hcnJheUJ1ZmZlcigpOwogICAgICBjb25zdCBiYXNlNjQgPSBlbmNvZGUoYXJyYXlCdWZmZXIpOwogICAgICB0cmFuc3BhcmVudEJsb2JNYXAuc2V0KGlkLCBiYXNlNjQpOwogICAgICByZXR1cm4gYmFzZTY0OwogICAgfSBlbHNlIHsKICAgICAgcmV0dXJuICIiOwogICAgfQogIH0KICBjb25zdCB3b3JrZXIgPSBzZWxmOwogIHdvcmtlci5vbm1lc3NhZ2UgPSBhc3luYyBmdW5jdGlvbihlKSB7CiAgICBpZiAoIk9mZnNjcmVlbkNhbnZhcyIgaW4gZ2xvYmFsVGhpcykgewogICAgICBjb25zdCB7IGlkLCBiaXRtYXAsIHdpZHRoLCBoZWlnaHQsIGRhdGFVUkxPcHRpb25zIH0gPSBlLmRhdGE7CiAgICAgIGNvbnN0IHRyYW5zcGFyZW50QmFzZTY0ID0gZ2V0VHJhbnNwYXJlbnRCbG9iRm9yKAogICAgICAgIHdpZHRoLAogICAgICAgIGhlaWdodCwKICAgICAgICBkYXRhVVJMT3B0aW9ucwogICAgICApOwogICAgICBjb25zdCBvZmZzY3JlZW4gPSBuZXcgT2Zmc2NyZWVuQ2FudmFzKHdpZHRoLCBoZWlnaHQpOwogICAgICBjb25zdCBjdHggPSBvZmZzY3JlZW4uZ2V0Q29udGV4dCgiMmQiKTsKICAgICAgY3R4LmRyYXdJbWFnZShiaXRtYXAsIDAsIDApOwogICAgICBiaXRtYXAuY2xvc2UoKTsKICAgICAgY29uc3QgYmxvYiA9IGF3YWl0IG9mZnNjcmVlbi5jb252ZXJ0VG9CbG9iKGRhdGFVUkxPcHRpb25zKTsKICAgICAgY29uc3QgdHlwZSA9IGJsb2IudHlwZTsKICAgICAgY29uc3QgYXJyYXlCdWZmZXIgPSBhd2FpdCBibG9iLmFycmF5QnVmZmVyKCk7CiAgICAgIGNvbnN0IGJhc2U2NCA9IGVuY29kZShhcnJheUJ1ZmZlcik7CiAgICAgIGlmICghbGFzdEJsb2JNYXAuaGFzKGlkKSAmJiBhd2FpdCB0cmFuc3BhcmVudEJhc2U2NCA9PT0gYmFzZTY0KSB7CiAgICAgICAgbGFzdEJsb2JNYXAuc2V0KGlkLCBiYXNlNjQpOwogICAgICAgIHJldHVybiB3b3JrZXIucG9zdE1lc3NhZ2UoeyBpZCB9KTsKICAgICAgfQogICAgICBpZiAobGFzdEJsb2JNYXAuZ2V0KGlkKSA9PT0gYmFzZTY0KSByZXR1cm4gd29ya2VyLnBvc3RNZXNzYWdlKHsgaWQgfSk7CiAgICAgIHdvcmtlci5wb3N0TWVzc2FnZSh7CiAgICAgICAgaWQsCiAgICAgICAgdHlwZSwKICAgICAgICBiYXNlNjQsCiAgICAgICAgd2lkdGgsCiAgICAgICAgaGVpZ2h0CiAgICAgIH0pOwogICAgICBsYXN0QmxvYk1hcC5zZXQoaWQsIGJhc2U2NCk7CiAgICB9IGVsc2UgewogICAgICByZXR1cm4gd29ya2VyLnBvc3RNZXNzYWdlKHsgaWQ6IGUuZGF0YS5pZCB9KTsKICAgIH0KICB9Owp9KSgpOwovLyMgc291cmNlTWFwcGluZ1VSTD1pbWFnZS1iaXRtYXAtZGF0YS11cmwtd29ya2VyLUlKcEM3Z19iLmpzLm1hcAo=",Me="undefined"!=typeof window&&window.Blob&&new Blob([(Se=Te,Uint8Array.from(atob(Se),(t=>t.charCodeAt(0))))],{type:"text/javascript;charset=utf-8"});function Ee(t){var e;try{if(!(e=Me&&(window.URL||window.webkitURL).createObjectURL(Me)))throw"";var r=new Worker(e,{name:null==t?void 0:t.name});return r.addEventListener("error",(()=>{(window.URL||window.webkitURL).revokeObjectURL(e)})),r}catch(e){return new Worker("data:text/javascript;base64,"+Te,{name:null==t?void 0:t.name})}finally{e&&(window.URL||window.webkitURL).revokeObjectURL(e)}}class Ne{constructor(t){a(this,"pendingCanvasMutations",new Map),a(this,"rafStamps",{latestId:0,invokeId:null}),a(this,"mirror"),a(this,"mutationCb"),a(this,"resetObservers"),a(this,"frozen",!1),a(this,"locked",!1),a(this,"processMutation",((t,e)=>{!(this.rafStamps.invokeId&&this.rafStamps.latestId!==this.rafStamps.invokeId)&&this.rafStamps.invokeId||(this.rafStamps.invokeId=this.rafStamps.latestId),this.pendingCanvasMutations.has(t)||this.pendingCanvasMutations.set(t,[]),this.pendingCanvasMutations.get(t).push(e)}));var{sampling:e="all",win:r,blockClass:i,blockSelector:n,recordCanvas:o,dataURLOptions:s}=t;this.mutationCb=t.mutationCb,this.mirror=t.mirror,o&&"all"===e&&this.initCanvasMutationObserver(r,i,n),o&&"number"==typeof e&&this.initCanvasFPSObserver(e,r,i,n,{dataURLOptions:s})}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(t,r,i,n,o){var s=this,a=Ce(r,i,n,!0),l=new Map,u=new Ee;u.onmessage=t=>{var{id:e}=t.data;if(l.set(e,!1),"base64"in t.data){var{base64:r,type:i,width:n,height:o}=t.data;this.mutationCb({id:e,type:$t["2D"],commands:[{property:"clearRect",args:[0,0,n,o]},{property:"drawImage",args:[{rr_type:"ImageBitmap",args:[{rr_type:"Blob",data:[{rr_type:"ArrayBuffer",base64:r}],type:i}]},0,0]}]})}};var c,h=1e3/t,d=0,v=t=>{var a,f;d&&t-d<h?c=requestAnimationFrame(v):(d=t,(a=[],f=t=>{t.querySelectorAll("canvas").forEach((t=>{kt(t,i,n,!0)||a.push(t)})),t.querySelectorAll("*").forEach((t=>{t.shadowRoot&&f(t.shadowRoot)}))},f(r.document),a).forEach(function(){var t=e((function*(t){var e,r=s.mirror.getId(t);if(!l.get(r)&&0!==t.width&&0!==t.height){if(l.set(r,!0),["webgl","webgl2"].includes(t.__context)){var i=t.getContext(t.__context);!1===(null==(e=null==i?void 0:i.getContextAttributes())?void 0:e.preserveDrawingBuffer)&&i.clear(i.COLOR_BUFFER_BIT)}var n=t.clientWidth||t.width,a=t.clientHeight||t.height,c=yield createImageBitmap(t,{resizeWidth:n,resizeHeight:a});u.postMessage({id:r,bitmap:c,width:n,height:a,dataURLOptions:o.dataURLOptions},[c])}}));return function(e){return t.apply(this,arguments)}}()),c=requestAnimationFrame(v))};c=requestAnimationFrame(v),this.resetObservers=()=>{a(),cancelAnimationFrame(c)}}initCanvasMutationObserver(t,e,r){this.startRAFTimestamping(),this.startPendingCanvasMutationFlusher();var i=Ce(t,e,r,!1),n=function(t,e,r,i){var n=[],o=Object.getOwnPropertyNames(e.CanvasRenderingContext2D.prototype),s=function(o){try{if("function"!=typeof e.CanvasRenderingContext2D.prototype[o])return 1;var s=bt(e.CanvasRenderingContext2D.prototype,o,(function(n){return function(){for(var s=arguments.length,a=new Array(s),l=0;l<s;l++)a[l]=arguments[l];return kt(this.canvas,r,i,!0)||setTimeout((()=>{var r=we(a,e,this);t(this.canvas,{type:$t["2D"],property:o,args:r})}),0),n.apply(this,a)}}));n.push(s)}catch(r){var a=yt(e.CanvasRenderingContext2D.prototype,o,{set(e){t(this.canvas,{type:$t["2D"],property:o,args:[e],setter:!0})}});n.push(a)}};for(var a of o)s(a);return()=>{n.forEach((t=>t()))}}(this.processMutation.bind(this),t,e,r),o=function(t,e,r,i){var n=[];return n.push(...Ie(e.WebGLRenderingContext.prototype,$t.WebGL,t,r,i,e)),void 0!==e.WebGL2RenderingContext&&n.push(...Ie(e.WebGL2RenderingContext.prototype,$t.WebGL2,t,r,i,e)),()=>{n.forEach((t=>t()))}}(this.processMutation.bind(this),t,e,r);this.resetObservers=()=>{i(),n(),o()}}startPendingCanvasMutationFlusher(){requestAnimationFrame((()=>this.flushPendingCanvasMutations()))}startRAFTimestamping(){var t=e=>{this.rafStamps.latestId=e,requestAnimationFrame(t)};requestAnimationFrame(t)}flushPendingCanvasMutations(){this.pendingCanvasMutations.forEach(((t,e)=>{var r=this.mirror.getId(e);this.flushPendingCanvasMutationFor(e,r)})),requestAnimationFrame((()=>this.flushPendingCanvasMutations()))}flushPendingCanvasMutationFor(t,e){if(!this.frozen&&!this.locked){var r=this.pendingCanvasMutations.get(t);if(r&&-1!==e){var n=r.map((t=>i(t,o))),{type:s}=r[0];this.mutationCb({id:e,type:s,commands:n}),this.pendingCanvasMutations.delete(t)}}}}class Re{constructor(t){a(this,"trackedLinkElements",new WeakSet),a(this,"mutationCb"),a(this,"adoptedStyleSheetCb"),a(this,"styleMirror",new Rt),this.mutationCb=t.mutationCb,this.adoptedStyleSheetCb=t.adoptedStyleSheetCb}attachLinkElement(t,e){"_cssText"in e.attributes&&this.mutationCb({adds:[],removes:[],texts:[],attributes:[{id:e.id,attributes:e.attributes}]}),this.trackLinkElement(t)}trackLinkElement(t){this.trackedLinkElements.has(t)||(this.trackedLinkElements.add(t),this.trackStylesheetInLinkElement(t))}adoptStyleSheets(t,e){var r=this;if(0!==t.length){var i={id:e,styleIds:[]},n=[],o=function(t){var e;r.styleMirror.has(t)?e=r.styleMirror.getId(t):(e=r.styleMirror.add(t),n.push({styleId:e,rules:Array.from(t.rules||CSSRule,((e,r)=>({rule:S(e,t.href),index:r})))})),i.styleIds.push(e)};for(var s of t)o(s);n.length>0&&(i.styles=n),this.adoptedStyleSheetCb(i)}}reset(){this.styleMirror.reset(),this.trackedLinkElements=new WeakSet}trackStylesheetInLinkElement(t){}}class Fe{constructor(){a(this,"nodeMap",new WeakMap),a(this,"active",!1)}inOtherBuffer(t,e){var r=this.nodeMap.get(t);return r&&Array.from(r).some((t=>t!==e))}add(t,e){this.active||(this.active=!0,requestAnimationFrame((()=>{this.nodeMap=new WeakMap,this.active=!1}))),this.nodeMap.set(t,(this.nodeMap.get(t)||new Set).add(e))}destroy(){}}var Oe=!1;try{if(2!==Array.from([1],(t=>2*t))[0]){var Pe=document.createElement("iframe");document.body.appendChild(Pe),Array.from=(null==(n=Pe.contentWindow)?void 0:n.Array.from)||Array.from,document.body.removeChild(Pe)}}catch(t){console.debug("Unable to override Array.from",t)}var Le,De,Be=new x;function Ze(t){void 0===t&&(t={});var{emit:e,checkoutEveryNms:i,checkoutEveryNth:n,blockClass:o="rr-block",blockSelector:s=null,ignoreClass:a="rr-ignore",ignoreSelector:l=null,maskTextClass:u="rr-mask",maskTextSelector:c=null,inlineStylesheet:h=!0,maskAllInputs:d,maskInputOptions:v,slimDOMOptions:f,maskInputFn:p,maskTextFn:g,hooks:m,packFn:y,sampling:b={},dataURLOptions:w={},mousemoveWait:_,recordDOM:C=!0,recordCanvas:I=!1,recordCrossOriginIframes:S=!1,recordAfter:k=("DOMContentLoaded"===t.recordAfter?t.recordAfter:"load"),userTriggeredOnInput:A=!1,collectFonts:T=!1,inlineImages:M=!1,plugins:E,keepIframeSrcFn:N=(()=>!1),ignoreCSSAttributes:R=new Set([]),errorHandler:F}=t;jt=F;var O=!S||window.parent===window,P=!1;if(!O)try{window.parent.document&&(P=!1)}catch(t){P=!0}if(O&&!e)throw new Error("emit function is required");if(!O&&!P)return()=>{};void 0!==_&&void 0===b.mousemove&&(b.mousemove=_),Be.reset();var L,D=!0===d?{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!==v?v:{password:!0},B=!0===f||"all"===f?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaVerification:!0,headMetaAuthorship:"all"===f,headMetaDescKeywords:"all"===f,headTitleMutations:"all"===f}:f||{};!function(t){void 0===t&&(t=window),"NodeList"in t&&!t.NodeList.prototype.forEach&&(t.NodeList.prototype.forEach=Array.prototype.forEach),"DOMTokenList"in t&&!t.DOMTokenList.prototype.forEach&&(t.DOMTokenList.prototype.forEach=Array.prototype.forEach)}();var Z=0,q=t=>{for(var e of E||[])e.eventProcessor&&(t=e.eventProcessor(t));return y&&!P&&(t=y(t)),t};ke=(t,r)=>{var o,s=t;if(s.timestamp=wt(),!(null==(o=Kt[0])?void 0:o.isFrozen())||s.type===Lt.FullSnapshot||s.type===Lt.IncrementalSnapshot&&s.data.source===Dt.Mutation||Kt.forEach((t=>t.unfreeze())),O)null==e||e(q(s),r);else if(P){var a={type:"rrweb",event:q(s),origin:window.location.origin,isCheckout:r};window.parent.postMessage(a,"*")}if(s.type===Lt.FullSnapshot)L=s,Z=0;else if(s.type===Lt.IncrementalSnapshot){if(s.data.source===Dt.Mutation&&s.data.isAttachIframe)return;Z++;var l=n&&Z>=n,u=i&&s.timestamp-L.timestamp>i;(l||u)&&xe(!0)}};var H=t=>{ke({type:Lt.IncrementalSnapshot,data:r({source:Dt.Mutation},t)})},V=t=>ke({type:Lt.IncrementalSnapshot,data:r({source:Dt.Scroll},t)}),j=t=>ke({type:Lt.IncrementalSnapshot,data:r({source:Dt.CanvasMutation},t)}),Y=new Re({mutationCb:H,adoptedStyleSheetCb:t=>ke({type:Lt.IncrementalSnapshot,data:r({source:Dt.AdoptedStyleSheet},t)})}),G=new de({mirror:Be,mutationCb:H,stylesheetManager:Y,recordCrossOriginIframes:S,wrappedEmit:ke});for(var W of E||[])W.getMirror&&W.getMirror({nodeMirror:Be,crossOriginIframeMirror:G.crossOriginIframeMirror,crossOriginIframeStyleMirror:G.crossOriginIframeStyleMirror});var z=new Fe;Ae=new Ne({recordCanvas:I,mutationCb:j,win:window,blockClass:o,blockSelector:s,mirror:Be,sampling:b.canvas,dataURLOptions:w});var U=new ve({mutationCb:H,scrollCb:V,bypassOptions:{blockClass:o,blockSelector:s,maskTextClass:u,maskTextSelector:c,inlineStylesheet:h,maskInputOptions:D,dataURLOptions:w,maskTextFn:g,maskInputFn:p,recordCanvas:I,inlineImages:M,sampling:b,slimDOMOptions:B,iframeManager:G,stylesheetManager:Y,canvasManager:Ae,keepIframeSrcFn:N,processedNodeManager:z},mirror:Be});xe=function(t){if(void 0===t&&(t=!1),C){ke({type:Lt.Meta,data:{href:window.location.href,width:It(),height:Ct()}},t),Y.reset(),U.init(),Kt.forEach((t=>t.lock()));var e=function(t,e){var{mirror:r=new x,blockClass:i="rr-block",blockSelector:n=null,maskTextClass:o="rr-mask",maskTextSelector:s=null,inlineStylesheet:a=!0,inlineImages:l=!1,recordCanvas:u=!1,maskAllInputs:c=!1,maskTextFn:h,maskInputFn:d,slimDOM:v=!1,dataURLOptions:f,preserveWhiteSpace:p,onSerialize:g,onIframeLoad:m,iframeLoadTimeout:y,onStylesheetLoad:b,stylesheetLoadTimeout:w,keepIframeSrcFn:_=(()=>!1)}=e||{};return rt(t,{doc:t,mirror:r,blockClass:i,blockSelector:n,maskTextClass:o,maskTextSelector:s,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:h,maskInputFn:d,slimDOMOptions:!0===v||"all"===v?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaDescKeywords:"all"===v,headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaAuthorship:!0,headMetaVerification:!0}:!1===v?{}:v,dataURLOptions:f,inlineImages:l,recordCanvas:u,preserveWhiteSpace:p,onSerialize:g,onIframeLoad:m,iframeLoadTimeout:y,onStylesheetLoad:b,stylesheetLoadTimeout:w,keepIframeSrcFn:_,newlyAddedElement:!1})}(document,{mirror:Be,blockClass:o,blockSelector:s,maskTextClass:u,maskTextSelector:c,inlineStylesheet:h,maskAllInputs:D,maskTextFn:g,maskInputFn:p,slimDOM:B,dataURLOptions:w,recordCanvas:I,inlineImages:M,onSerialize:t=>{Mt(t,Be)&&G.addIframe(t),Et(t,Be)&&Y.trackLinkElement(t),Nt(t)&&U.addShadowRoot(vt.shadowRoot(t),document)},onIframeLoad:(t,e)=>{G.attachIframe(t,e),U.observeAttachShadow(t)},onStylesheetLoad:(t,e)=>{Y.attachLinkElement(t,e)},keepIframeSrcFn:N});if(!e)return console.warn("Failed to snapshot the document");ke({type:Lt.FullSnapshot,data:{node:e,initialOffset:_t(window)}},t),Kt.forEach((t=>t.unlock())),document.adoptedStyleSheets&&document.adoptedStyleSheets.length>0&&Y.adoptStyleSheets(document.adoptedStyleSheets,Be.getId(document))}};try{var X=[],J=t=>{var e;return Jt(le)({mutationCb:H,mousemoveCb:(t,e)=>ke({type:Lt.IncrementalSnapshot,data:{source:e,positions:t}}),mouseInteractionCb:t=>ke({type:Lt.IncrementalSnapshot,data:r({source:Dt.MouseInteraction},t)}),scrollCb:V,viewportResizeCb:t=>ke({type:Lt.IncrementalSnapshot,data:r({source:Dt.ViewportResize},t)}),inputCb:t=>ke({type:Lt.IncrementalSnapshot,data:r({source:Dt.Input},t)}),mediaInteractionCb:t=>ke({type:Lt.IncrementalSnapshot,data:r({source:Dt.MediaInteraction},t)}),styleSheetRuleCb:t=>ke({type:Lt.IncrementalSnapshot,data:r({source:Dt.StyleSheetRule},t)}),styleDeclarationCb:t=>ke({type:Lt.IncrementalSnapshot,data:r({source:Dt.StyleDeclaration},t)}),canvasMutationCb:j,fontCb:t=>ke({type:Lt.IncrementalSnapshot,data:r({source:Dt.Font},t)}),selectionCb:t=>{ke({type:Lt.IncrementalSnapshot,data:r({source:Dt.Selection},t)})},customElementCb:t=>{ke({type:Lt.IncrementalSnapshot,data:r({source:Dt.CustomElement},t)})},blockClass:o,ignoreClass:a,ignoreSelector:l,maskTextClass:u,maskTextSelector:c,maskInputOptions:D,inlineStylesheet:h,sampling:b,recordDOM:C,recordCanvas:I,inlineImages:M,userTriggeredOnInput:A,collectFonts:T,doc:t,maskInputFn:p,maskTextFn:g,keepIframeSrcFn:N,blockSelector:s,slimDOMOptions:B,dataURLOptions:w,mirror:Be,iframeManager:G,stylesheetManager:Y,shadowDomManager:U,processedNodeManager:z,canvasManager:Ae,ignoreCSSAttributes:R,plugins:(null==(e=null==E?void 0:E.filter((t=>t.observer)))?void 0:e.map((t=>({observer:t.observer,options:t.options,callback:e=>ke({type:Lt.Plugin,data:{plugin:t.name,payload:e}})}))))||[]},m)};G.addLoadListener((t=>{try{X.push(J(t.contentDocument))}catch(t){console.warn(t)}}));var K=()=>{xe(),X.push(J(document)),Oe=!0};return"interactive"===document.readyState||"complete"===document.readyState?K():(X.push(ft("DOMContentLoaded",(()=>{ke({type:Lt.DomContentLoaded,data:{}}),"DOMContentLoaded"===k&&K()}))),X.push(ft("load",(()=>{ke({type:Lt.Load,data:{}}),"load"===k&&K()}),window))),()=>{X.forEach((t=>t())),z.destroy(),Oe=!1,jt=void 0}}catch(t){console.warn(t)}}Ze.addCustomEvent=(t,e)=>{if(!Oe)throw new Error("please add custom event after start recording");ke({type:Lt.Custom,data:{tag:t,payload:e}})},Ze.freezePage=()=>{Kt.forEach((t=>t.freeze()))},Ze.takeFullSnapshot=t=>{if(!Oe)throw new Error("please take full snapshot after start recording");xe(t)},Ze.mirror=Be,(De=Le||(Le={}))[De.NotStarted=0]="NotStarted",De[De.Running=1]="Running",De[De.Stopped=2]="Stopped";var $e,qe=Object.defineProperty,He=(t,e,r)=>((t,e,r)=>e in t?qe(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r)(t,"symbol"!=typeof e?e+"":e,r),Ve=Object.defineProperty,je=(t,e,r)=>((t,e,r)=>e in t?Ve(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r)(t,"symbol"!=typeof e?e+"":e,r),Ye=Object.defineProperty,Ge=(t,e,r)=>((t,e,r)=>e in t?Ye(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r)(t,"symbol"!=typeof e?e+"":e,r),We={Node:["childNodes","parentNode","parentElement","textContent"],ShadowRoot:["host","styleSheets"],Element:["shadowRoot","querySelector","querySelectorAll"],MutationObserver:[]},ze={Node:["contains","getRootNode"],ShadowRoot:["getSelection"],Element:[],MutationObserver:["constructor"]},Ue={};function Xe(t){if(Ue[t])return Ue[t];var e=globalThis[t],r=e.prototype,i=t in We?We[t]:void 0,n=Boolean(i&&i.every((t=>{var e,i;return Boolean(null==(i=null==(e=Object.getOwnPropertyDescriptor(r,t))?void 0:e.get)?void 0:i.toString().includes("[native code]"))}))),o=t in ze?ze[t]:void 0,s=Boolean(o&&o.every((t=>{var e;return"function"==typeof r[t]&&(null==(e=r[t])?void 0:e.toString().includes("[native code]"))})));if(n&&s)return Ue[t]=e.prototype,e.prototype;try{var a=document.createElement("iframe");document.body.appendChild(a);var l=a.contentWindow;if(!l)return e.prototype;var u=l[t].prototype;return document.body.removeChild(a),u?Ue[t]=u:r}catch(t){return r}}var Je={};function Ke(t,e,r){var i,n=t+"."+String(r);if(Je[n])return Je[n].call(e);var o=Xe(t),s=null==(i=Object.getOwnPropertyDescriptor(o,r))?void 0:i.get;return s?(Je[n]=s,s.call(e)):e[r]}var Qe={};function tr(t,e,r){var i=t+"."+String(r);if(Qe[i])return Qe[i].bind(e);var n=Xe(t)[r];return"function"!=typeof n?e[r]:(Qe[i]=n,n.bind(e))}var er={childNodes:function(t){return Ke("Node",t,"childNodes")},parentNode:function(t){return Ke("Node",t,"parentNode")},parentElement:function(t){return Ke("Node",t,"parentElement")},textContent:function(t){return Ke("Node",t,"textContent")},contains:function(t,e){return tr("Node",t,"contains")(e)},getRootNode:function(t){return tr("Node",t,"getRootNode")()},host:function(t){return t&&"host"in t?Ke("ShadowRoot",t,"host"):null},styleSheets:function(t){return t.styleSheets},shadowRoot:function(t){return t&&"shadowRoot"in t?Ke("Element",t,"shadowRoot"):null},querySelector:function(t,e){return Ke("Element",t,"querySelector")(e)},querySelectorAll:function(t,e){return Ke("Element",t,"querySelectorAll")(e)},mutationObserver:function(){return Xe("MutationObserver").constructor}};class rr{constructor(){Ge(this,"idNodeMap",new Map),Ge(this,"nodeMetaMap",new WeakMap)}getId(t){var e;if(!t)return-1;var r=null==(e=this.getMeta(t))?void 0:e.id;return null!=r?r:-1}getNode(t){return this.idNodeMap.get(t)||null}getIds(){return Array.from(this.idNodeMap.keys())}getMeta(t){return this.nodeMetaMap.get(t)||null}removeNodeFromMap(t){var e=this.getId(t);this.idNodeMap.delete(e),t.childNodes&&t.childNodes.forEach((t=>this.removeNodeFromMap(t)))}has(t){return this.idNodeMap.has(t)}hasNode(t){return this.nodeMetaMap.has(t)}add(t,e){var r=e.id;this.idNodeMap.set(r,t),this.nodeMetaMap.set(t,e)}replace(t,e){var r=this.getNode(t);if(r){var i=this.nodeMetaMap.get(r);i&&this.nodeMetaMap.set(e,i)}this.idNodeMap.set(t,e)}reset(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap}}function ir(t,e,r){if(!t)return!1;if(t.nodeType!==t.ELEMENT_NODE)return!!r&&ir(er.parentNode(t),e,r);for(var i=t.classList.length;i--;){var n=t.classList[i];if(e.test(n))return!0}return!!r&&ir(er.parentNode(t),e,r)}class nr{constructor(){__publicField22(this,"parentElement",null),__publicField22(this,"parentNode",null),__publicField22(this,"ownerDocument"),__publicField22(this,"firstChild",null),__publicField22(this,"lastChild",null),__publicField22(this,"previousSibling",null),__publicField22(this,"nextSibling",null),__publicField22(this,"ELEMENT_NODE",1),__publicField22(this,"TEXT_NODE",3),__publicField22(this,"nodeType"),__publicField22(this,"nodeName"),__publicField22(this,"RRNodeType")}get childNodes(){for(var t=[],e=this.firstChild;e;)t.push(e),e=e.nextSibling;return t}contains(t){if(!(t instanceof nr))return!1;if(t.ownerDocument!==this.ownerDocument)return!1;if(t===this)return!0;for(;t.parentNode;){if(t.parentNode===this)return!0;t=t.parentNode}return!1}appendChild(t){throw new Error("RRDomException: Failed to execute 'appendChild' on 'RRNode': This RRNode type does not support this method.")}insertBefore(t,e){throw new Error("RRDomException: Failed to execute 'insertBefore' on 'RRNode': This RRNode type does not support this method.")}removeChild(t){throw new Error("RRDomException: Failed to execute 'removeChild' on 'RRNode': This RRNode type does not support this method.")}toString(){return"RRNode"}}var or={Node:["childNodes","parentNode","parentElement","textContent"],ShadowRoot:["host","styleSheets"],Element:["shadowRoot","querySelector","querySelectorAll"],MutationObserver:[]},sr={Node:["contains","getRootNode"],ShadowRoot:["getSelection"],Element:[],MutationObserver:["constructor"]},ar={};function lr(t){if(ar[t])return ar[t];var e=globalThis[t],r=e.prototype,i=t in or?or[t]:void 0,n=Boolean(i&&i.every((t=>{var e,i;return Boolean(null==(i=null==(e=Object.getOwnPropertyDescriptor(r,t))?void 0:e.get)?void 0:i.toString().includes("[native code]"))}))),o=t in sr?sr[t]:void 0,s=Boolean(o&&o.every((t=>{var e;return"function"==typeof r[t]&&(null==(e=r[t])?void 0:e.toString().includes("[native code]"))})));if(n&&s)return ar[t]=e.prototype,e.prototype;try{var a=document.createElement("iframe");document.body.appendChild(a);var l=a.contentWindow;if(!l)return e.prototype;var u=l[t].prototype;return document.body.removeChild(a),u?ar[t]=u:r}catch(t){return r}}var ur={};function cr(t,e,r){var i,n=t+"."+String(r);if(ur[n])return ur[n].call(e);var o=lr(t),s=null==(i=Object.getOwnPropertyDescriptor(o,r))?void 0:i.get;return s?(ur[n]=s,s.call(e)):e[r]}var hr={};function dr(t,e,r){var i=t+"."+String(r);if(hr[i])return hr[i].bind(e);var n=lr(t)[r];return"function"!=typeof n?e[r]:(hr[i]=n,n.bind(e))}var vr={childNodes:function(t){return cr("Node",t,"childNodes")},parentNode:function(t){return cr("Node",t,"parentNode")},parentElement:function(t){return cr("Node",t,"parentElement")},textContent:function(t){return cr("Node",t,"textContent")},contains:function(t,e){return dr("Node",t,"contains")(e)},getRootNode:function(t){return dr("Node",t,"getRootNode")()},host:function(t){return t&&"host"in t?cr("ShadowRoot",t,"host"):null},styleSheets:function(t){return t.styleSheets},shadowRoot:function(t){return t&&"shadowRoot"in t?cr("Element",t,"shadowRoot"):null},querySelector:function(t,e){return cr("Element",t,"querySelector")(e)},querySelectorAll:function(t,e){return cr("Element",t,"querySelectorAll")(e)},mutationObserver:function(){return lr("MutationObserver").constructor}};var fr="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.",pr={map:{},getId:()=>(console.error(fr),-1),getNode:()=>(console.error(fr),null),removeNodeFromMap(){console.error(fr)},has:()=>(console.error(fr),!1),reset(){console.error(fr)}};"undefined"!=typeof window&&window.Proxy&&window.Reflect&&(pr=new Proxy(pr,{get:(t,e,r)=>("map"===e&&console.error(fr),Reflect.get(t,e,r))}));var gr=Date.now;function mr(t){return t?t.nodeType===t.ELEMENT_NODE?t:vr.parentElement(t):null}/[1-9][0-9]{12}/.test(Date.now().toString())||(gr=()=>(new Date).getTime());function yr(t){var e,r=null;return"getRootNode"in t&&(null==(e=vr.getRootNode(t))?void 0:e.nodeType)===Node.DOCUMENT_FRAGMENT_NODE&&vr.host(vr.getRootNode(t))&&(r=vr.host(vr.getRootNode(t))),r}function br(t){for(var e,r=t;e=yr(r);)r=e;return r}function wr(t){var e=t.ownerDocument;if(!e)return!1;var r=br(t);return vr.contains(e,r)}for(var _r=Object.freeze(Object.defineProperty({__proto__:null,StyleSheetMirror:class{constructor(){je(this,"id",1),je(this,"styleIDMap",new WeakMap),je(this,"idStyleMap",new Map)}getId(t){var e;return null!==(e=this.styleIDMap.get(t))&&void 0!==e?e:-1}has(t){return this.styleIDMap.has(t)}add(t,e){return this.has(t)?this.getId(t):(r=void 0===e?this.id++:e,this.styleIDMap.set(t,r),this.idStyleMap.set(r,t),r);var r}getStyle(t){return this.idStyleMap.get(t)||null}reset(){this.styleIDMap=new WeakMap,this.idStyleMap=new Map,this.id=1}generateId(){return this.id++}},get _mirror(){return pr},closestElementOfNode:mr,getBaseDimension:function t(e,r){var i,n,o=null==(n=null==(i=e.ownerDocument)?void 0:i.defaultView)?void 0:n.frameElement;if(!o||o===r)return{x:0,y:0,relativeScale:1,absoluteScale:1};var s=o.getBoundingClientRect(),a=t(o,r),l=s.height/o.clientHeight;return{x:s.x*a.relativeScale+a.x,y:s.y*a.relativeScale+a.y,relativeScale:l,absoluteScale:a.absoluteScale*l}},getNestedRule:function t(e,r){var i=e[r[0]];return 1===r.length?i:t(i.cssRules[r[1]].cssRules,r.slice(2))},getPositionsAndIndex:function(t){var e=[...t],r=e.pop();return{positions:e,index:r}},getRootShadowHost:br,getShadowHost:yr,getWindowHeight:function(){return window.innerHeight||document.documentElement&&document.documentElement.clientHeight||document.body&&document.body.clientHeight},getWindowScroll:function(t){var e,r,i,n,o=t.document;return{left:o.scrollingElement?o.scrollingElement.scrollLeft:void 0!==t.pageXOffset?t.pageXOffset:o.documentElement.scrollLeft||(null==o?void 0:o.body)&&(null==(e=vr.parentElement(o.body))?void 0:e.scrollLeft)||(null==(r=null==o?void 0:o.body)?void 0:r.scrollLeft)||0,top:o.scrollingElement?o.scrollingElement.scrollTop:void 0!==t.pageYOffset?t.pageYOffset:(null==o?void 0:o.documentElement.scrollTop)||(null==o?void 0:o.body)&&(null==(i=vr.parentElement(o.body))?void 0:i.scrollTop)||(null==(n=null==o?void 0:o.body)?void 0:n.scrollTop)||0}},getWindowWidth:function(){return window.innerWidth||document.documentElement&&document.documentElement.clientWidth||document.body&&document.body.clientWidth},hasShadowRoot:function(t){return!!t&&(t instanceof nr&&"shadowRoot"in t?Boolean(t.shadowRoot):Boolean(vr.shadowRoot(t)))},hookSetter:function t(e,r,i,n,o){void 0===o&&(o=window);var s=o.Object.getOwnPropertyDescriptor(e,r);return o.Object.defineProperty(e,r,n?i:{set(t){setTimeout((()=>{i.set.call(this,t)}),0),s&&s.set&&s.set.call(this,t)}}),()=>t(e,r,s||{},!0)},inDom:function(t){var e=t.ownerDocument;return!!e&&(vr.contains(e,t)||wr(t))},isAncestorRemoved:function t(e,r){if(n=(i=e)&&"host"in i&&"mode"in i&&er.host(i)||null,Boolean(n&&"shadowRoot"in n&&er.shadowRoot(n)===i))return!1;var i,n,o=r.getId(e);if(!r.has(o))return!0;var s=vr.parentNode(e);return(!s||s.nodeType!==e.DOCUMENT_NODE)&&(!s||t(s,r))},isBlocked:function(t,e,r,i){if(!t)return!1;var n=mr(t);if(!n)return!1;try{if("string"==typeof e){if(n.classList.contains(e))return!0;if(i&&null!==n.closest("."+e))return!0}else if(ir(n,e,i))return!0}catch(t){}if(r){if(n.matches(r))return!0;if(i&&null!==n.closest(r))return!0}return!1},isIgnored:function(t,e,r){return!("TITLE"!==t.tagName||!r.headTitleMutations)||-2===e.getId(t)},isSerialized:function(t,e){return-1!==e.getId(t)},isSerializedIframe:function(t,e){return Boolean("IFRAME"===t.nodeName&&e.getMeta(t))},isSerializedStylesheet:function(t,e){return Boolean("LINK"===t.nodeName&&t.nodeType===t.ELEMENT_NODE&&t.getAttribute&&"stylesheet"===t.getAttribute("rel")&&e.getMeta(t))},iterateResolveTree:function t(e,r){r(e.value);for(var i=e.children.length-1;i>=0;i--)t(e.children[i],r)},legacy_isTouchEvent:function(t){return Boolean(t.changedTouches)},get nowTimestamp(){return gr},on:function(t,e,r){void 0===r&&(r=document);var i={capture:!0,passive:!0};return r.addEventListener(t,e,i),()=>r.removeEventListener(t,e,i)},patch:function(t,e,r){try{if(!(e in t))return()=>{};var i=t[e],n=r(i);return"function"==typeof n&&(n.prototype=n.prototype||{},Object.defineProperties(n,{__rrweb_original__:{enumerable:!1,value:i}})),t[e]=n,()=>{t[e]=i}}catch(t){return()=>{}}},polyfill:function(t){void 0===t&&(t=window),"NodeList"in t&&!t.NodeList.prototype.forEach&&(t.NodeList.prototype.forEach=Array.prototype.forEach),"DOMTokenList"in t&&!t.DOMTokenList.prototype.forEach&&(t.DOMTokenList.prototype.forEach=Array.prototype.forEach)},queueToResolveTrees:function(t){var e={},r=(t,r)=>{var i={value:t,parent:r,children:[]};return e[t.node.id]=i,i},i=[];for(var n of t){var{nextId:o,parentId:s}=n;if(o&&o in e){var a=e[o];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(s in e){var c=e[s];c.children.push(r(n,c))}else i.push(r(n,null))}return i},shadowHostInDom:wr,throttle:function(t,e,r){void 0===r&&(r={});var i=null,n=0;return function(){for(var o=arguments.length,s=new Array(o),a=0;a<o;a++)s[a]=arguments[a];var l=Date.now();n||!1!==r.leading||(n=l);var u=e-(l-n),c=this;u<=0||u>e?(i&&(clearTimeout(i),i=null),n=l,t.apply(c,s)):i||!1===r.trailing||(i=setTimeout((()=>{n=!1===r.leading?0:Date.now(),i=null,t.apply(c,s)}),u))}},uniqueTextMutations:function(t){for(var e=new Set,r=[],i=t.length;i--;){var n=t[i];e.has(n.id)||(r.push(n),e.add(n.id))}return r}},Symbol.toStringTag,{value:"Module"})),Cr="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",Ir="undefined"==typeof Uint8Array?[]:new Uint8Array(256),Sr=0;Sr<64;Sr++)Ir[Cr.charCodeAt(Sr)]=Sr;var kr;"undefined"!=typeof window&&window.Blob&&new Blob([(t=>Uint8Array.from(atob(t),(t=>t.charCodeAt(0))))("KGZ1bmN0aW9uKCkgewogICJ1c2Ugc3RyaWN0IjsKICB2YXIgY2hhcnMgPSAiQUJDREVGR0hJSktMTU5PUFFSU1RVVldYWVphYmNkZWZnaGlqa2xtbm9wcXJzdHV2d3h5ejAxMjM0NTY3ODkrLyI7CiAgdmFyIGxvb2t1cCA9IHR5cGVvZiBVaW50OEFycmF5ID09PSAidW5kZWZpbmVkIiA/IFtdIDogbmV3IFVpbnQ4QXJyYXkoMjU2KTsKICBmb3IgKHZhciBpID0gMDsgaSA8IGNoYXJzLmxlbmd0aDsgaSsrKSB7CiAgICBsb29rdXBbY2hhcnMuY2hhckNvZGVBdChpKV0gPSBpOwogIH0KICB2YXIgZW5jb2RlID0gZnVuY3Rpb24oYXJyYXlidWZmZXIpIHsKICAgIHZhciBieXRlcyA9IG5ldyBVaW50OEFycmF5KGFycmF5YnVmZmVyKSwgaTIsIGxlbiA9IGJ5dGVzLmxlbmd0aCwgYmFzZTY0ID0gIiI7CiAgICBmb3IgKGkyID0gMDsgaTIgPCBsZW47IGkyICs9IDMpIHsKICAgICAgYmFzZTY0ICs9IGNoYXJzW2J5dGVzW2kyXSA+PiAyXTsKICAgICAgYmFzZTY0ICs9IGNoYXJzWyhieXRlc1tpMl0gJiAzKSA8PCA0IHwgYnl0ZXNbaTIgKyAxXSA+PiA0XTsKICAgICAgYmFzZTY0ICs9IGNoYXJzWyhieXRlc1tpMiArIDFdICYgMTUpIDw8IDIgfCBieXRlc1tpMiArIDJdID4+IDZdOwogICAgICBiYXNlNjQgKz0gY2hhcnNbYnl0ZXNbaTIgKyAyXSAmIDYzXTsKICAgIH0KICAgIGlmIChsZW4gJSAzID09PSAyKSB7CiAgICAgIGJhc2U2NCA9IGJhc2U2NC5zdWJzdHJpbmcoMCwgYmFzZTY0Lmxlbmd0aCAtIDEpICsgIj0iOwogICAgfSBlbHNlIGlmIChsZW4gJSAzID09PSAxKSB7CiAgICAgIGJhc2U2NCA9IGJhc2U2NC5zdWJzdHJpbmcoMCwgYmFzZTY0Lmxlbmd0aCAtIDIpICsgIj09IjsKICAgIH0KICAgIHJldHVybiBiYXNlNjQ7CiAgfTsKICBjb25zdCBsYXN0QmxvYk1hcCA9IC8qIEBfX1BVUkVfXyAqLyBuZXcgTWFwKCk7CiAgY29uc3QgdHJhbnNwYXJlbnRCbG9iTWFwID0gLyogQF9fUFVSRV9fICovIG5ldyBNYXAoKTsKICBhc3luYyBmdW5jdGlvbiBnZXRUcmFuc3BhcmVudEJsb2JGb3Iod2lkdGgsIGhlaWdodCwgZGF0YVVSTE9wdGlvbnMpIHsKICAgIGNvbnN0IGlkID0gYCR7d2lkdGh9LSR7aGVpZ2h0fWA7CiAgICBpZiAoIk9mZnNjcmVlbkNhbnZhcyIgaW4gZ2xvYmFsVGhpcykgewogICAgICBpZiAodHJhbnNwYXJlbnRCbG9iTWFwLmhhcyhpZCkpIHJldHVybiB0cmFuc3BhcmVudEJsb2JNYXAuZ2V0KGlkKTsKICAgICAgY29uc3Qgb2Zmc2NyZWVuID0gbmV3IE9mZnNjcmVlbkNhbnZhcyh3aWR0aCwgaGVpZ2h0KTsKICAgICAgb2Zmc2NyZWVuLmdldENvbnRleHQoIjJkIik7CiAgICAgIGNvbnN0IGJsb2IgPSBhd2FpdCBvZmZzY3JlZW4uY29udmVydFRvQmxvYihkYXRhVVJMT3B0aW9ucyk7CiAgICAgIGNvbnN0IGFycmF5QnVmZmVyID0gYXdhaXQgYmxvYi5hcnJheUJ1ZmZlcigpOwogICAgICBjb25zdCBiYXNlNjQgPSBlbmNvZGUoYXJyYXlCdWZmZXIpOwogICAgICB0cmFuc3BhcmVudEJsb2JNYXAuc2V0KGlkLCBiYXNlNjQpOwogICAgICByZXR1cm4gYmFzZTY0OwogICAgfSBlbHNlIHsKICAgICAgcmV0dXJuICIiOwogICAgfQogIH0KICBjb25zdCB3b3JrZXIgPSBzZWxmOwogIHdvcmtlci5vbm1lc3NhZ2UgPSBhc3luYyBmdW5jdGlvbihlKSB7CiAgICBpZiAoIk9mZnNjcmVlbkNhbnZhcyIgaW4gZ2xvYmFsVGhpcykgewogICAgICBjb25zdCB7IGlkLCBiaXRtYXAsIHdpZHRoLCBoZWlnaHQsIGRhdGFVUkxPcHRpb25zIH0gPSBlLmRhdGE7CiAgICAgIGNvbnN0IHRyYW5zcGFyZW50QmFzZTY0ID0gZ2V0VHJhbnNwYXJlbnRCbG9iRm9yKAogICAgICAgIHdpZHRoLAogICAgICAgIGhlaWdodCwKICAgICAgICBkYXRhVVJMT3B0aW9ucwogICAgICApOwogICAgICBjb25zdCBvZmZzY3JlZW4gPSBuZXcgT2Zmc2NyZWVuQ2FudmFzKHdpZHRoLCBoZWlnaHQpOwogICAgICBjb25zdCBjdHggPSBvZmZzY3JlZW4uZ2V0Q29udGV4dCgiMmQiKTsKICAgICAgY3R4LmRyYXdJbWFnZShiaXRtYXAsIDAsIDApOwogICAgICBiaXRtYXAuY2xvc2UoKTsKICAgICAgY29uc3QgYmxvYiA9IGF3YWl0IG9mZnNjcmVlbi5jb252ZXJ0VG9CbG9iKGRhdGFVUkxPcHRpb25zKTsKICAgICAgY29uc3QgdHlwZSA9IGJsb2IudHlwZTsKICAgICAgY29uc3QgYXJyYXlCdWZmZXIgPSBhd2FpdCBibG9iLmFycmF5QnVmZmVyKCk7CiAgICAgIGNvbnN0IGJhc2U2NCA9IGVuY29kZShhcnJheUJ1ZmZlcik7CiAgICAgIGlmICghbGFzdEJsb2JNYXAuaGFzKGlkKSAmJiBhd2FpdCB0cmFuc3BhcmVudEJhc2U2NCA9PT0gYmFzZTY0KSB7CiAgICAgICAgbGFzdEJsb2JNYXAuc2V0KGlkLCBiYXNlNjQpOwogICAgICAgIHJldHVybiB3b3JrZXIucG9zdE1lc3NhZ2UoeyBpZCB9KTsKICAgICAgfQogICAgICBpZiAobGFzdEJsb2JNYXAuZ2V0KGlkKSA9PT0gYmFzZTY0KSByZXR1cm4gd29ya2VyLnBvc3RNZXNzYWdlKHsgaWQgfSk7CiAgICAgIHdvcmtlci5wb3N0TWVzc2FnZSh7CiAgICAgICAgaWQsCiAgICAgICAgdHlwZSwKICAgICAgICBiYXNlNjQsCiAgICAgICAgd2lkdGgsCiAgICAgICAgaGVpZ2h0CiAgICAgIH0pOwogICAgICBsYXN0QmxvYk1hcC5zZXQoaWQsIGJhc2U2NCk7CiAgICB9IGVsc2UgewogICAgICByZXR1cm4gd29ya2VyLnBvc3RNZXNzYWdlKHsgaWQ6IGUuZGF0YS5pZCB9KTsKICAgIH0KICB9Owp9KSgpOwovLyMgc291cmNlTWFwcGluZ1VSTD1pbWFnZS1iaXRtYXAtZGF0YS11cmwtd29ya2VyLUlKcEM3Z19iLmpzLm1hcAo=")],{type:"text/javascript;charset=utf-8"});try{if(2!==Array.from([1],(t=>2*t))[0]){var xr=document.createElement("iframe");document.body.appendChild(xr),Array.from=(null==($e=xr.contentWindow)?void 0:$e.Array.from)||Array.from,document.body.removeChild(xr)}}catch(t){console.debug("Unable to override Array.from",t)}new rr,function(t){t[t.NotStarted=0]="NotStarted",t[t.Running=1]="Running",t[t.Stopped=2]="Stopped"}(kr||(kr={}));class Ar{constructor(t){He(this,"fileName"),He(this,"functionName"),He(this,"lineNumber"),He(this,"columnNumber"),this.fileName=t.fileName||"",this.functionName=t.functionName||"",this.lineNumber=t.lineNumber,this.columnNumber=t.columnNumber}toString(){var t=this.lineNumber||"",e=this.columnNumber||"";return this.functionName?this.functionName+" ("+this.fileName+":"+t+":"+e+")":this.fileName+":"+t+":"+e}}var Tr=/(^|@)\S+:\d+/,Mr=/^\s*at .*(\S+:\d+|\(native\))/m,Er=/^(eval@)?(\[native code])?$/,Nr={parse:function(t){return t?void 0!==t.stacktrace||void 0!==t["opera#sourceloc"]?this.parseOpera(t):t.stack&&t.stack.match(Mr)?this.parseV8OrIE(t):t.stack?this.parseFFOrSafari(t):(console.warn("[console-record-plugin]: Failed to parse error object:",t),[]):[]},extractLocation:function(t){if(-1===t.indexOf(":"))return[t];var e=/(.+?)(?::(\d+))?(?::(\d+))?$/.exec(t.replace(/[()]/g,""));if(!e)throw new Error("Cannot parse given url: "+t);return[e[1],e[2]||void 0,e[3]||void 0]},parseV8OrIE:function(t){return t.stack.split("\n").filter((function(t){return!!t.match(Mr)}),this).map((function(t){t.indexOf("(eval ")>-1&&(t=t.replace(/eval code/g,"eval").replace(/(\(eval at [^()]*)|(\),.*$)/g,""));var e=t.replace(/^\s+/,"").replace(/\(eval code/g,"("),r=e.match(/ (\((.+):(\d+):(\d+)\)$)/),i=(e=r?e.replace(r[0],""):e).split(/\s+/).slice(1),n=this.extractLocation(r?r[1]:i.pop()),o=i.join(" ")||void 0,s=["eval","<anonymous>"].indexOf(n[0])>-1?void 0:n[0];return new Ar({functionName:o,fileName:s,lineNumber:n[1],columnNumber:n[2]})}),this)},parseFFOrSafari:function(t){return t.stack.split("\n").filter((function(t){return!t.match(Er)}),this).map((function(t){if(t.indexOf(" > eval")>-1&&(t=t.replace(/ line (\d+)(?: > eval line \d+)* > eval:\d+:\d+/g,":$1")),-1===t.indexOf("@")&&-1===t.indexOf(":"))return new Ar({functionName:t});var e=/((.*".+"[^@]*)?[^@]*)(?:@)/,r=t.match(e),i=r&&r[1]?r[1]:void 0,n=this.extractLocation(t.replace(e,""));return new Ar({functionName:i,fileName:n[0],lineNumber:n[1],columnNumber:n[2]})}),this)},parseOpera:function(t){return!t.stacktrace||t.message.indexOf("\n")>-1&&t.message.split("\n").length>t.stacktrace.split("\n").length?this.parseOpera9(t):t.stack?this.parseOpera11(t):this.parseOpera10(t)},parseOpera9:function(t){for(var e=/Line (\d+).*script (?:in )?(\S+)/i,r=t.message.split("\n"),i=[],n=2,o=r.length;n<o;n+=2){var s=e.exec(r[n]);s&&i.push(new Ar({fileName:s[2],lineNumber:parseFloat(s[1])}))}return i},parseOpera10:function(t){for(var e=/Line (\d+).*script (?:in )?(\S+)(?:: In function (\S+))?$/i,r=t.stacktrace.split("\n"),i=[],n=0,o=r.length;n<o;n+=2){var s=e.exec(r[n]);s&&i.push(new Ar({functionName:s[3]||void 0,fileName:s[2],lineNumber:parseFloat(s[1])}))}return i},parseOpera11:function(t){return t.stack.split("\n").filter((function(t){return!!t.match(Tr)&&!t.match(/^Error created at/)}),this).map((function(t){var e=t.split("@"),r=this.extractLocation(e.pop()),i=(e.shift()||"").replace(/<anonymous function(: (\w+))?>/,"$2").replace(/\([^)]*\)/g,"")||void 0;return new Ar({functionName:i,fileName:r[0],lineNumber:r[1],columnNumber:r[2]})}),this)}};function Rr(t){if(!t||!t.outerHTML)return"";for(var e="";t.parentElement;){var r=t.localName;if(!r)break;r=r.toLowerCase();var i=t.parentElement,n=[];if(i.children&&i.children.length>0)for(var o=0;o<i.children.length;o++){var s=i.children[o];s.localName&&s.localName.toLowerCase&&s.localName.toLowerCase()===r&&n.push(s)}n.length>1&&(r+=":eq("+n.indexOf(t)+")"),e=r+(e?">"+e:""),t=i}return e}function Fr(t){return"[object Object]"===Object.prototype.toString.call(t)}function Or(t,e){if(0===e)return!0;var r=Object.keys(t);for(var i of r)if(Fr(t[i])&&Or(t[i],e-1))return!0;return!1}function Pr(t,e){var r={numOfKeysLimit:50,depthOfLimit:4};Object.assign(r,e);var i=[],n=[];return JSON.stringify(t,(function(t,e){if(i.length>0){var o=i.indexOf(this);~o?i.splice(o+1):i.push(this),~o?n.splice(o,1/0,t):n.push(t),~i.indexOf(e)&&(e=i[0]===e?"[Circular ~]":"[Circular ~."+n.slice(0,i.indexOf(e)).join(".")+"]")}else i.push(e);if(null===e)return e;if(void 0===e)return"undefined";if(function(t){if(Fr(t)&&Object.keys(t).length>r.numOfKeysLimit)return!0;if("function"==typeof t)return!0;if(Fr(t)&&Or(t,r.depthOfLimit))return!0;return!1}(e))return function(t){var e=t.toString();r.stringLengthLimit&&e.length>r.stringLengthLimit&&(e=e.slice(0,r.stringLengthLimit)+"...");return e}(e);if("bigint"==typeof e)return e.toString()+"n";if(e instanceof Event){var s={};for(var a in e){var l=e[a];Array.isArray(l)?s[a]=Rr(l.length?l[0]:null):s[a]=l}return s}return e instanceof Node?e instanceof HTMLElement?e?e.outerHTML:"":e.nodeName:e instanceof Error?e.stack?e.stack+"\nEnd of stack for Error object":e.name+": "+e.message:e}))}var Lr={level:["assert","clear","count","countReset","debug","dir","dirxml","error","group","groupCollapsed","groupEnd","info","log","table","time","timeEnd","timeLog","trace","warn"],lengthThreshold:1e3,logger:"console"};function Dr(t,e,r){var i,n=r?Object.assign({},Lr,r):Lr,o=n.logger;if(!o)return()=>{};i="string"==typeof o?e[o]:o;var s=0,a=!1,l=[];if(n.level.includes("error")){var u=e=>{var r=e.message,i=e.error,o=Nr.parse(i).map((t=>t.toString())),s=[Pr(r,n.stringifyOptions)];t({level:"error",trace:o,payload:s})};e.addEventListener("error",u),l.push((()=>{e.removeEventListener("error",u)}));var c=e=>{var r,i;e.reason instanceof Error?i=[Pr("Uncaught (in promise) "+(r=e.reason).name+": "+r.message,n.stringifyOptions)]:(r=new Error,i=[Pr("Uncaught (in promise)",n.stringifyOptions),Pr(e.reason,n.stringifyOptions)]);var o=Nr.parse(r).map((t=>t.toString()));t({level:"error",trace:o,payload:i})};e.addEventListener("unhandledrejection",c),l.push((()=>{e.removeEventListener("unhandledrejection",c)}))}for(var h of n.level)l.push(d(i,h));return()=>{l.forEach((t=>t()))};function d(e,r){var i=this;return e[r]?_r.patch(e,r,(e=>function(){for(var o=arguments.length,l=new Array(o),u=0;u<o;u++)l[u]=arguments[u];if(e.apply(i,l),!("assert"===r&&l[0]||a)){a=!0;try{var c=Nr.parse(new Error).map((t=>t.toString())).splice(1),h=("assert"===r?l.slice(1):l).map((t=>Pr(t,n.stringifyOptions)));++s<n.lengthThreshold?t({level:r,trace:c,payload:h}):s===n.lengthThreshold&&t({level:"warn",trace:[],payload:[Pr("The number of log records reached the threshold.")]})}catch(t){e("rrweb logger error:",t,...l)}finally{a=!1}}})):()=>{}}}var Br=t=>({name:"rrweb/console@1",observer:Dr,options:t}),Zr=["$snapshot","$pageview","$pageleave","$set","survey dismissed","survey sent","survey shown","$identify","$groupidentify","$create_alias","$$client_ingestion_warning","$web_experiment_applied","$feature_enrollment_update","$feature_flag_called"];function $r(t,e){return-1!==t.indexOf(e)}var qr=function(t){return t.trim()},Hr=function(t){return t.replace(/^\$/,"")};var Vr=Array.isArray,jr=Object.prototype,Yr=jr.hasOwnProperty,Gr=jr.toString,Wr=Vr||function(t){return"[object Array]"===Gr.call(t)},zr=t=>"function"==typeof t,Ur=t=>zr(t)&&-1!==t.toString().indexOf("[native code]"),Xr=t=>t===Object(t)&&!Wr(t),Jr=t=>{if(Xr(t)){for(var e in t)if(Yr.call(t,e))return!1;return!0}return!1},Kr=t=>void 0===t,Qr=t=>"[object String]"==Gr.call(t),ti=t=>Qr(t)&&0===t.trim().length,ei=t=>null===t,ri=t=>Kr(t)||ei(t),ii=t=>"[object Number]"==Gr.call(t),ni=t=>"[object Boolean]"===Gr.call(t),oi=t=>t instanceof FormData,si=t=>$r(Zr,t);function ai(t){return null===t||"object"!=typeof t}function li(t,e){return Object.prototype.toString.call(t)==="[object "+e+"]"}function ui(t){return!Kr(Event)&&function(t,e){try{return t instanceof e}catch(t){return!1}}(t,Event)}var ci=[!0,"true",1,"1","yes"],hi=t=>$r(ci,t),di=[!1,"false",0,"0","no"];function vi(t,e,r,i,n){return e>r&&(i.warn("min cannot be greater than max."),e=r),ii(t)?t>r?(i.warn(" cannot be greater than max: "+r+". Using max value instead."),r):t<e?(i.warn(" cannot be less than min: "+e+". Using min value instead."),e):t:(i.warn(" must be a number. using max or fallback. max: "+r+", fallback: "+n),vi(n||r,e,r,i))}class fi{constructor(t){this.o=t,this.h={},this.m=()=>{Object.keys(this.h).forEach((t=>{var e=this.C(t)+this.I;e>=this.S?delete this.h[t]:this.k(t,e)}))},this.C=t=>this.h[String(t)],this.k=(t,e)=>{this.h[String(t)]=e},this.consumeRateLimit=t=>{var e,r,i=null!==(e=this.C(t))&&void 0!==e?e:this.S;if(0===(i=Math.max(i-1,0)))return!0;this.k(t,i);var n=0===i;return n&&(null==(r=this.A)||r.call(this,t)),n},this.A=this.o.A,this.S=vi(this.o.bucketSize,0,100,this.o.T),this.I=vi(this.o.refillRate,0,this.S,this.o.T),this.M=vi(this.o.refillInterval,0,864e5,this.o.T),this.N=setInterval((()=>{this.m()}),this.M)}stop(){this.N&&(clearInterval(this.N),this.N=void 0)}}var pi,gi,mi,yi=t=>t instanceof Error;function bi(t){var e=globalThis._posthogChunkIds;if(e){var r=Object.keys(e);return mi&&r.length===gi||(gi=r.length,mi=r.reduce(((r,i)=>{pi||(pi={});var n=pi[i];if(n)r[n[0]]=n[1];else for(var o=t(i),s=o.length-1;s>=0;s--){var a=o[s],l=null==a?void 0:a.filename,u=e[i];if(l&&u){r[l]=u,pi[i]=[l,u];break}}return r}),{})),mi}}var wi="?";function _i(t,e,r,i){var n={platform:"web:javascript",filename:t,function:"<anonymous>"===e?wi:e,in_app:!0};return Kr(r)||(n.lineno=r),Kr(i)||(n.colno=i),n}var Ci=(t,e)=>{var r=-1!==t.indexOf("safari-extension"),i=-1!==t.indexOf("safari-web-extension");return r||i?[-1!==t.indexOf("@")?t.split("@")[0]:wi,r?"safari-extension:"+e:"safari-web-extension:"+e]:[t,e]},Ii=/^\s*at (\S+?)(?::(\d+))(?::(\d+))\s*$/i,Si=/^\s*at (?:(.+?\)(?: \[.+\])?|.*?) ?\((?:address at )?)?(?:async )?((?:<anonymous>|[-a-z]+:|.*bundle|\/)?.*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i,ki=/\((\S*)(?::(\d+))(?::(\d+))\)/,xi=t=>{var e=Ii.exec(t);if(e){var[,r,i,n]=e;return _i(r,wi,+i,+n)}var o=Si.exec(t);if(o){if(o[2]&&0===o[2].indexOf("eval")){var s=ki.exec(o[2]);s&&(o[2]=s[1],o[3]=s[2],o[4]=s[3])}var[a,l]=Ci(o[1]||wi,o[2]);return _i(l,a,o[3]?+o[3]:void 0,o[4]?+o[4]:void 0)}},Ai=/^\s*(.*?)(?:\((.*?)\))?(?:^|@)?((?:[-a-z]+)?:\/.*?|\[native code\]|[^@]*(?:bundle|\d+\.js)|\/[\w\-. /=]+)(?::(\d+))?(?::(\d+))?\s*$/i,Ti=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i,Mi=t=>{var e=Ai.exec(t);if(e){if(e[3]&&e[3].indexOf(" > eval")>-1){var r=Ti.exec(e[3]);r&&(e[1]=e[1]||"eval",e[3]=r[1],e[4]=r[2],e[5]="")}var i=e[3],n=e[1]||wi;return[n,i]=Ci(n,i),_i(i,n,e[4]?+e[4]:void 0,e[5]?+e[5]:void 0)}},Ei=/\(error: (.*)\)/,Ni=50;function Ri(){for(var t=arguments.length,e=new Array(t),i=0;i<t;i++)e[i]=arguments[i];return function(t,i){void 0===i&&(i=0);for(var n=[],o=t.split("\n"),s=i;s<o.length;s++){var a=o[s];if(!(a.length>1024)){var l=Ei.test(a)?a.replace(Ei,"$1"):a;if(!l.match(/\S*Error: /)){for(var u of e){var c=u(l);if(c){n.push(c);break}}if(n.length>=Ni)break}}}return function(t){if(!t.length)return[];var e=Array.from(t);return e.reverse(),e.slice(0,Ni).map((t=>{return r({},t,{filename:t.filename||(i=e,i[i.length-1]||{}).filename,function:t.function||wi});var i}))}(n)}}class Fi{constructor(t,e,r){void 0===t&&(t=[]),void 0===e&&(e=[]),void 0===r&&(r=[]),this.coercers=t,this.modifiers=r,this.stackParser=Ri(...e)}buildFromUnknown(t,e){void 0===e&&(e={});var r=e&&e.mechanism||{handled:!0,type:"generic"},i=this.buildCoercingContext(r,e,0).apply(t),n=this.buildParsingContext(),o=this.parseStacktrace(i,n);return{$exception_list:this.convertToExceptionList(o,r),$exception_level:"error"}}modifyFrames(t){var r=this;return e((function*(){for(var e of t)e.stacktrace&&e.stacktrace.frames&&Wr(e.stacktrace.frames)&&(e.stacktrace.frames=yield r.applyModifiers(e.stacktrace.frames));return t}))()}coerceFallback(t){var e;return{type:"Error",value:"Unknown error",stack:null==(e=t.syntheticException)?void 0:e.stack,synthetic:!0}}parseStacktrace(t,e){var i,n;return null!=t.cause&&(i=this.parseStacktrace(t.cause,e)),""!=t.stack&&null!=t.stack&&(n=this.applyChunkIds(this.stackParser(t.stack,t.synthetic?1:0),e.chunkIdMap)),r({},t,{cause:i,stack:n})}applyChunkIds(t,e){return t.map((t=>(t.filename&&e&&(t.chunk_id=e[t.filename]),t)))}applyCoercers(t,e){for(var r of this.coercers)if(r.match(t))return r.coerce(t,e);return this.coerceFallback(e)}applyModifiers(t){var r=this;return e((function*(){var e=t;for(var i of r.modifiers)e=yield i(e);return e}))()}convertToExceptionList(t,e){var i,n,o,s={type:t.type,value:t.value,mechanism:{type:null!==(i=e.type)&&void 0!==i?i:"generic",handled:null===(n=e.handled)||void 0===n||n,synthetic:null!==(o=t.synthetic)&&void 0!==o&&o}};t.stack&&(s.stacktrace={type:"raw",frames:t.stack});var a=[s];return null!=t.cause&&a.push(...this.convertToExceptionList(t.cause,r({},e,{handled:!0}))),a}buildParsingContext(){return{chunkIdMap:bi(this.stackParser)}}buildCoercingContext(t,e,i){void 0===i&&(i=0);var n=(r,i)=>{if(i<=4){var n=this.buildCoercingContext(t,e,i);return this.applyCoercers(r,n)}};return r({},e,{syntheticException:0==i?e.syntheticException:void 0,mechanism:t,apply:t=>n(t,i),next:t=>n(t,i+1)})}}class Oi{match(t){return this.isDOMException(t)||this.isDOMError(t)}coerce(t,e){var r=Qr(t.stack);return{type:this.getType(t),value:this.getValue(t),stack:r?t.stack:void 0,cause:t.cause?e.next(t.cause):void 0,synthetic:!1}}getType(t){return this.isDOMError(t)?"DOMError":"DOMException"}getValue(t){var e=t.name||(this.isDOMError(t)?"DOMError":"DOMException");return t.message?e+": "+t.message:e}isDOMException(t){return li(t,"DOMException")}isDOMError(t){return li(t,"DOMError")}}class Pi{match(t){return(t=>t instanceof Error)(t)}coerce(t,e){return{type:this.getType(t),value:this.getMessage(t,e),stack:this.getStack(t),cause:t.cause?e.next(t.cause):void 0,synthetic:!1}}getType(t){return t.name||t.constructor.name}getMessage(t,e){var r=t.message;return r.error&&"string"==typeof r.error.message?String(r.error.message):String(r)}getStack(t){return t.stacktrace||t.stack||void 0}}class Li{constructor(){}match(t){return li(t,"ErrorEvent")&&null!=t.error}coerce(t,e){var r,i=e.apply(t.error);return i||{type:"ErrorEvent",value:t.message,stack:null==(r=e.syntheticException)?void 0:r.stack,synthetic:!0}}}var Di=/^(?:[Uu]ncaught (?:exception: )?)?(?:((?:Eval|Internal|Range|Reference|Syntax|Type|URI|)Error): )?(.*)$/i;class Bi{match(t){return"string"==typeof t}coerce(t,e){var r,[i,n]=this.getInfos(t);return{type:null!=i?i:"Error",value:null!=n?n:t,stack:null==(r=e.syntheticException)?void 0:r.stack,synthetic:!0}}getInfos(t){var e="Error",r=t,i=t.match(Di);return i&&(e=i[1],r=i[2]),[e,r]}}var Zi=["fatal","error","warning","log","info","debug"];function $i(t,e){void 0===e&&(e=40);var r=Object.keys(t);if(r.sort(),!r.length)return"[object has no keys]";for(var i=r.length;i>0;i--){var n=r.slice(0,i).join(", ");if(!(n.length>e))return i===r.length||n.length<=e?n:n.slice(0,e)+"..."}return""}class qi{match(t){return"object"==typeof t&&null!==t}coerce(t,e){var r,i=this.getErrorPropertyFromObject(t);return i?e.apply(i):{type:this.getType(t),value:this.getValue(t),stack:null==(r=e.syntheticException)?void 0:r.stack,level:this.isSeverityLevel(t.level)?t.level:"error",synthetic:!0}}getType(t){return ui(t)?t.constructor.name:"Error"}getValue(t){if("name"in t&&"string"==typeof t.name){var e="'"+t.name+"' captured as exception";return"message"in t&&"string"==typeof t.message&&(e+=" with message: '"+t.message+"'"),e}if("message"in t&&"string"==typeof t.message)return t.message;var r=this.getObjectClassName(t);return(r&&"Object"!==r?"'"+r+"'":"Object")+" captured as exception with keys: "+$i(t)}isSeverityLevel(t){return Qr(t)&&!ti(t)&&Zi.indexOf(t)>=0}getErrorPropertyFromObject(t){for(var e in t)if(Object.prototype.hasOwnProperty.call(t,e)){var r=t[e];if(yi(r))return r}}getObjectClassName(t){try{var e=Object.getPrototypeOf(t);return e?e.constructor.name:void 0}catch(t){return}}}class Hi{match(t){return ui(t)}coerce(t,e){var r,i=t.constructor.name;return{type:i,value:i+" captured as exception with keys: "+$i(t),stack:null==(r=e.syntheticException)?void 0:r.stack,synthetic:!0}}}class Vi{match(t){return ai(t)}coerce(t,e){var r;return{type:"Error",value:"Primitive value captured as exception: "+String(t),stack:null==(r=e.syntheticException)?void 0:r.stack,synthetic:!0}}}class ji{match(t){return li(t,"PromiseRejectionEvent")}coerce(t,e){var r,i=this.getUnhandledRejectionReason(t);return ai(i)?{type:"UnhandledRejection",value:"Non-Error promise rejection captured with value: "+String(i),stack:null==(r=e.syntheticException)?void 0:r.stack,synthetic:!0}:e.apply(i)}getUnhandledRejectionReason(t){if(ai(t))return t;try{if("reason"in t)return t.reason;if("detail"in t&&"reason"in t.detail)return t.detail.reason}catch(t){}return t}}var Yi="undefined"!=typeof window?window:void 0,Gi="undefined"!=typeof globalThis?globalThis:Yi,Wi=Array.prototype,zi=Wi.forEach,Ui=Wi.indexOf,Xi=null==Gi?void 0:Gi.navigator,Ji=null==Gi?void 0:Gi.document,Ki=null==Gi?void 0:Gi.location,Qi=null==Gi?void 0:Gi.fetch,tn=null!=Gi&&Gi.XMLHttpRequest&&"withCredentials"in new Gi.XMLHttpRequest?Gi.XMLHttpRequest:void 0,en=null==Gi?void 0:Gi.AbortController,rn=null==Xi?void 0:Xi.userAgent,nn=null!=Yi?Yi:{},on=()=>!!Yi.Zone,sn=t=>t instanceof Document,an={DEBUG:!1,LIB_VERSION:"1.274.1"},ln=t=>{var e={R:function(e){if(Yi&&(an.DEBUG||nn.POSTHOG_DEBUG)&&!Kr(Yi.console)&&Yi.console){for(var r=("__rrweb_original__"in Yi.console[e]?Yi.console[e].__rrweb_original__:Yi.console[e]),i=arguments.length,n=new Array(i>1?i-1:0),o=1;o<i;o++)n[o-1]=arguments[o];r(t,...n)}},info:function(){for(var t=arguments.length,r=new Array(t),i=0;i<t;i++)r[i]=arguments[i];e.R("log",...r)},warn:function(){for(var t=arguments.length,r=new Array(t),i=0;i<t;i++)r[i]=arguments[i];e.R("warn",...r)},error:function(){for(var t=arguments.length,r=new Array(t),i=0;i<t;i++)r[i]=arguments[i];e.R("error",...r)},critical:function(){for(var e=arguments.length,r=new Array(e),i=0;i<e;i++)r[i]=arguments[i];console.error(t,...r)},uninitializedWarning:t=>{e.error("You must initialize PostHog before calling "+t)},createLogger:e=>ln(t+" "+e)};return e},un=ln("[PostHog.js]"),cn=un.createLogger,hn={};function dn(t,e,r){if(Wr(t))if(zi&&t.forEach===zi)t.forEach(e,r);else if("length"in t&&t.length===+t.length)for(var i=0,n=t.length;i<n;i++)if(i in t&&e.call(r,t[i],i)===hn)return}function vn(t,e,r){if(!ri(t)){if(Wr(t))return dn(t,e,r);if(oi(t)){for(var i of t.entries())if(e.call(r,i[1],i[0])===hn)return}else for(var n in t)if(Yr.call(t,n)&&e.call(r,t[n],n)===hn)return}}var fn=function(t){for(var e=arguments.length,r=new Array(e>1?e-1:0),i=1;i<e;i++)r[i-1]=arguments[i];return dn(r,(function(e){for(var r in e)void 0!==e[r]&&(t[r]=e[r])})),t},pn=function(t){for(var e=arguments.length,r=new Array(e>1?e-1:0),i=1;i<e;i++)r[i-1]=arguments[i];return dn(r,(function(e){dn(e,(function(e){t.push(e)}))})),t};function gn(t){for(var e=Object.keys(t),r=e.length,i=new Array(r);r--;)i[r]=[e[r],t[e[r]]];return i}var mn=function(t){try{return t()}catch(t){return}},yn=function(t){return function(){try{for(var e=arguments.length,r=new Array(e),i=0;i<e;i++)r[i]=arguments[i];return t.apply(this,r)}catch(t){un.critical("Implementation error. Please turn on debug mode and open a ticket on https://app.posthog.com/home#panel=support%3Asupport%3A."),un.critical(t)}}},bn=function(t){var e={};return vn(t,(function(t,r){(Qr(t)&&t.length>0||ii(t))&&(e[r]=t)})),e};function wn(t,e){return r=t,i=t=>Qr(t)&&!ei(e)?t.slice(0,e):t,n=new Set,function t(e,r){return e!==Object(e)?i?i(e,r):e:n.has(e)?void 0:(n.add(e),Wr(e)?(o=[],dn(e,(e=>{o.push(t(e))}))):(o={},vn(e,((e,r)=>{n.has(e)||(o[r]=t(e,r))}))),o);var o}(r);var r,i,n}var _n=["herokuapp.com","vercel.app","netlify.app"];function Cn(t){var e=null==t?void 0:t.hostname;if(!Qr(e))return!1;var r=e.split(".").slice(-2).join(".");for(var i of _n)if(r===i)return!1;return!0}function In(t,e){for(var r=0;r<t.length;r++)if(e(t[r]))return t[r]}function Sn(t,e,r,i){var{capture:n=!1,passive:o=!0}=null!=i?i:{};null==t||t.addEventListener(e,r,{capture:n,passive:o})}var kn=t=>{var e=null==Ji?void 0:Ji.createElement("a");return Kr(e)?null:(e.href=t,e)},xn=function(t,e){var r,i;void 0===e&&(e="&");var n=[];return vn(t,(function(t,e){Kr(t)||Kr(e)||"undefined"===e||(r=encodeURIComponent((t=>t instanceof File)(t)?t.name:t.toString()),i=encodeURIComponent(e),n[n.length]=i+"="+r)})),n.join(e)},An=function(t,e){for(var r,i=((t.split("#")[0]||"").split(/\?(.*)/)[1]||"").replace(/^\?+/g,"").split("&"),n=0;n<i.length;n++){var o=i[n].split("=");if(o[0]===e){r=o;break}}if(!Wr(r)||r.length<2)return"";var s=r[1];try{s=decodeURIComponent(s)}catch(t){un.error("Skipping decoding for malformed query param: "+s)}return s.replace(/\+/g," ")},Tn=function(t,e,r){if(!t||!e||!e.length)return t;for(var i=t.split("#"),n=i[0]||"",o=i[1],s=n.split("?"),a=s[1],l=s[0],u=(a||"").split("&"),c=[],h=0;h<u.length;h++){var d=u[h].split("=");Wr(d)&&(e.includes(d[0])?c.push(d[0]+"="+r):c.push(u[h]))}var v=l;return null!=a&&(v+="?"+c.join("&")),null!=o&&(v+="#"+o),v},Mn=function(t,e){var r=t.match(new RegExp(e+"=([^&]*)"));return r?r[1]:null};function En(t,e,r){try{if(!(e in t))return()=>{};var i=t[e],n=r(i);return zr(n)&&(n.prototype=n.prototype||{},Object.defineProperties(n,{__posthog_wrapped__:{enumerable:!1,value:!0}})),t[e]=n,()=>{t[e]=i}}catch(t){return()=>{}}}function Nn(t,e){var r,i=function(t){try{return"string"==typeof t?new URL(t).hostname:"url"in t?new URL(t.url).hostname:t.hostname}catch(t){return null}}(t),n={hostname:i,isHostDenied:!1};if(null==(r=e.payloadHostDenyList)||!r.length||null==i||!i.trim().length)return n;for(var o of e.payloadHostDenyList)if(i.endsWith(o))return{hostname:i,isHostDenied:!0};return n}var Rn="$people_distinct_id",Fn="__alias",On="__timers",Pn="$autocapture_disabled_server_side",Ln="$heatmaps_enabled_server_side",Dn="$exception_capture_enabled_server_side",Bn="$error_tracking_suppression_rules",Zn="$error_tracking_capture_extension_exceptions",$n="$web_vitals_enabled_server_side",qn="$dead_clicks_enabled_server_side",Hn="$web_vitals_allowed_metrics",Vn="$session_recording_remote_config",jn="$sesid",Yn="$session_is_sampled",Gn="$enabled_feature_flags",Wn="$early_access_features",zn="$feature_flag_details",Un="$stored_person_properties",Xn="$stored_group_properties",Jn="$surveys",Kn="$surveys_activated",Qn="$flag_call_reported",to="$user_state",eo="$client_session_props",ro="$capture_rate_limit",io="$initial_campaign_params",no="$initial_referrer_info",oo="$initial_person_info",so="$epp",ao="__POSTHOG_TOOLBAR__",lo="$posthog_cookieless",uo=[Rn,Fn,"__cmpns",On,"$session_recording_enabled_server_side",Ln,jn,Gn,Bn,to,Wn,zn,Xn,Un,Jn,Qn,eo,ro,io,no,so,oo];function co(t){return t instanceof Element&&(t.id===ao||!(null==t.closest||!t.closest(".toolbar-global-fade-container")))}function ho(t){return!!t&&1===t.nodeType}function vo(t,e){return!!t&&!!t.tagName&&t.tagName.toLowerCase()===e.toLowerCase()}function fo(t){return!!t&&3===t.nodeType}function po(t){return!!t&&11===t.nodeType}function go(t){return t?qr(t).split(/\s+/):[]}function mo(t){var e=null==Yi?void 0:Yi.location.href;return!!(e&&t&&t.some((t=>e.match(t))))}function yo(t){var e="";switch(typeof t.className){case"string":e=t.className;break;case"object":e=(t.className&&"baseVal"in t.className?t.className.baseVal:null)||t.getAttribute("class")||"";break;default:e=""}return go(e)}function bo(t){return ri(t)?null:qr(t).split(/(\s+)/).filter((t=>Do(t))).join("").replace(/[\r\n]/g," ").replace(/[ ]+/g," ").substring(0,255)}function wo(t){var e="";return Mo(t)&&!Eo(t)&&t.childNodes&&t.childNodes.length&&vn(t.childNodes,(function(t){var r;fo(t)&&t.textContent&&(e+=null!==(r=bo(t.textContent))&&void 0!==r?r:"")})),qr(e)}function _o(t){return Kr(t.target)?t.srcElement||null:null!=(e=t.target)&&e.shadowRoot?t.composedPath()[0]||null:t.target||null;var e}var Co=["a","button","form","input","select","textarea","label"];function Io(t,e){if(Kr(e))return!0;var r,i=function(t){if(e.some((e=>t.matches(e))))return{v:!0}};for(var n of t)if(r=i(n))return r.v;return!1}function So(t){var e=t.parentNode;return!(!e||!ho(e))&&e}var ko=[".ph-no-rageclick",".ph-no-capture"];var xo=t=>!t||vo(t,"html")||!ho(t),Ao=(t,e)=>{if(!Yi||xo(t))return{parentIsUsefulElement:!1,targetElementList:[]};for(var r=!1,i=[t],n=t;n.parentNode&&!vo(n,"body");)if(po(n.parentNode))i.push(n.parentNode.host),n=n.parentNode.host;else{var o=So(n);if(!o)break;if(e||Co.indexOf(o.tagName.toLowerCase())>-1)r=!0;else{var s=Yi.getComputedStyle(o);s&&"pointer"===s.getPropertyValue("cursor")&&(r=!0)}i.push(o),n=o}return{parentIsUsefulElement:r,targetElementList:i}};function To(t,e,r,i,n){var o,s,a,l;if(void 0===r&&(r=void 0),!Yi||xo(t))return!1;if(null!=(o=r)&&o.url_allowlist&&!mo(r.url_allowlist))return!1;if(null!=(s=r)&&s.url_ignorelist&&mo(r.url_ignorelist))return!1;if(null!=(a=r)&&a.dom_event_allowlist){var u=r.dom_event_allowlist;if(u&&!u.some((t=>e.type===t)))return!1}var{parentIsUsefulElement:c,targetElementList:h}=Ao(t,i);if(!function(t,e){var r=null==e?void 0:e.element_allowlist;if(Kr(r))return!0;var i,n=function(t){if(r.some((e=>t.tagName.toLowerCase()===e)))return{v:!0}};for(var o of t)if(i=n(o))return i.v;return!1}(h,r))return!1;if(!Io(h,null==(l=r)?void 0:l.css_selector_allowlist))return!1;var d=Yi.getComputedStyle(t);if(d&&"pointer"===d.getPropertyValue("cursor")&&"click"===e.type)return!0;var v=t.tagName.toLowerCase();switch(v){case"html":return!1;case"form":return(n||["submit"]).indexOf(e.type)>=0;case"input":case"select":case"textarea":return(n||["change","click"]).indexOf(e.type)>=0;default:return c?(n||["click"]).indexOf(e.type)>=0:(n||["click"]).indexOf(e.type)>=0&&(Co.indexOf(v)>-1||"true"===t.getAttribute("contenteditable"))}}function Mo(t){for(var e=t;e.parentNode&&!vo(e,"body");e=e.parentNode){var r=yo(e);if($r(r,"ph-sensitive")||$r(r,"ph-no-capture"))return!1}if($r(yo(t),"ph-include"))return!0;var i=t.type||"";if(Qr(i))switch(i.toLowerCase()){case"hidden":case"password":return!1}var n=t.name||t.id||"";if(Qr(n)){if(/^cc|cardnum|ccnum|creditcard|csc|cvc|cvv|exp|pass|pwd|routing|seccode|securitycode|securitynum|socialsec|socsec|ssn/i.test(n.replace(/[^a-zA-Z0-9]/g,"")))return!1}return!0}function Eo(t){return!!(vo(t,"input")&&!["button","checkbox","submit","reset"].includes(t.type)||vo(t,"select")||vo(t,"textarea")||"true"===t.getAttribute("contenteditable"))}var No="(4[0-9]{12}(?:[0-9]{3})?)|(5[1-5][0-9]{14})|(6(?:011|5[0-9]{2})[0-9]{12})|(3[47][0-9]{13})|(3(?:0[0-5]|[68][0-9])[0-9]{11})|((?:2131|1800|35[0-9]{3})[0-9]{11})",Ro=new RegExp("^(?:"+No+")$"),Fo=new RegExp(No),Oo="\\d{3}-?\\d{2}-?\\d{4}",Po=new RegExp("^("+Oo+")$"),Lo=new RegExp("("+Oo+")");function Do(t,e){if(void 0===e&&(e=!0),ri(t))return!1;if(Qr(t)){if(t=qr(t),(e?Ro:Fo).test((t||"").replace(/[- ]/g,"")))return!1;if((e?Po:Lo).test(t))return!1}return!0}function Bo(t){var e=wo(t);return Do(e=(e+" "+Zo(t)).trim())?e:""}function Zo(t){var e="";return t&&t.childNodes&&t.childNodes.length&&vn(t.childNodes,(function(t){var r;if(t&&"span"===(null==(r=t.tagName)?void 0:r.toLowerCase()))try{var i=wo(t);e=(e+" "+i).trim(),t.childNodes&&t.childNodes.length&&(e=(e+" "+Zo(t)).trim())}catch(t){un.error("[AutoCapture]",t)}})),e}function $o(t){return function(t){var e=t.map((t=>{var e,i,n="";if(t.tag_name&&(n+=t.tag_name),t.attr_class)for(var o of(t.attr_class.sort(),t.attr_class))n+="."+o.replace(/"/g,"");var s=r({},t.text?{text:t.text}:{},{"nth-child":null!==(e=t.nth_child)&&void 0!==e?e:0,"nth-of-type":null!==(i=t.nth_of_type)&&void 0!==i?i:0},t.href?{href:t.href}:{},t.attr_id?{attr_id:t.attr_id}:{},t.attributes),a={};return gn(s).sort(((t,e)=>{var[r]=t,[i]=e;return r.localeCompare(i)})).forEach((t=>{var[e,r]=t;return a[qo(e.toString())]=qo(r.toString())})),n+=":",n+=gn(a).map((t=>{var[e,r]=t;return e+'="'+r+'"'})).join("")}));return e.join(";")}(function(t){return t.map((t=>{var e,r,i={text:null==(e=t.$el_text)?void 0:e.slice(0,400),tag_name:t.tag_name,href:null==(r=t.attr__href)?void 0:r.slice(0,2048),attr_class:Ho(t),attr_id:t.attr__id,nth_child:t.nth_child,nth_of_type:t.nth_of_type,attributes:{}};return gn(t).filter((t=>{var[e]=t;return 0===e.indexOf("attr__")})).forEach((t=>{var[e,r]=t;return i.attributes[e]=r})),i}))}(t))}function qo(t){return t.replace(/"|\\"/g,'\\"')}function Ho(t){var e=t.attr__class;return e?Wr(e)?e:go(e):void 0}var Vo={initiatorTypes:["audio","beacon","body","css","early-hint","embed","fetch","frame","iframe","icon","image","img","input","link","navigation","object","ping","script","track","video","xmlhttprequest"],maskRequestFn:t=>t,recordHeaders:!1,recordBody:!1,recordInitialRequests:!1,recordPerformance:!1,performanceEntryTypeToObserve:["first-input","navigation","paint","resource"],payloadSizeLimitBytes:1e6,payloadHostDenyList:[".lr-ingest.io",".ingest.sentry.io",".clarity.ms","analytics.google.com","bam.nr-data.net"]},jo=cn("[Recorder]"),Yo=t=>"navigation"===t.entryType,Go=t=>"resource"===t.entryType;function Wo(t,e,r){if(r.recordInitialRequests){var i=e.performance.getEntries().filter((t=>Yo(t)||Go(t)&&r.initiatorTypes.includes(t.initiatorType)));t({requests:i.flatMap((t=>ts({entry:t,method:void 0,status:void 0,networkRequest:{},isInitial:!0}))),isInitial:!0})}var n=new e.PerformanceObserver((e=>{var i=e.getEntries().filter((t=>Yo(t)||Go(t)&&r.initiatorTypes.includes(t.initiatorType)&&(t=>!r.recordBody&&!r.recordHeaders||"xmlhttprequest"!==t.initiatorType&&"fetch"!==t.initiatorType)(t)));t({requests:i.flatMap((t=>ts({entry:t,method:void 0,status:void 0,networkRequest:{}})))})})),o=PerformanceObserver.supportedEntryTypes.filter((t=>r.performanceEntryTypeToObserve.includes(t)));return n.observe({entryTypes:o}),()=>{n.disconnect()}}function zo(t,e){return!!e&&(ni(e)||e[t])}function Uo(t){var{type:e,recordBody:r,headers:i,url:n}=t;function o(t){var e=Object.keys(i).find((t=>"content-type"===t.toLowerCase())),r=e&&i[e];return t.some((t=>null==r?void 0:r.includes(t)))}if(!r)return!1;if(function t(e){try{return"string"==typeof e?e.startsWith("blob:"):e instanceof URL?"blob:"===e.protocol:e instanceof Request&&t(e.url)}catch(t){return!1}}(n))return!1;if(ni(r))return!0;if(Wr(r))return o(r);var s=r[e];return ni(s)?s:o(s)}function Xo(t,e,r,i,n,o){return Jo.apply(this,arguments)}function Jo(){return Jo=e((function*(t,e,r,i,n,o){if(void 0===o&&(o=0),o>10)return jo.warn("Failed to get performance entry for request",{url:r,initiatorType:e}),null;var s=function(t,e){for(var r=t.length-1;r>=0;r-=1)if(e(t[r]))return t[r]}(t.performance.getEntriesByName(r),(t=>Go(t)&&t.initiatorType===e&&(Kr(i)||t.startTime>=i)&&(Kr(n)||t.startTime<=n)));return s||(yield new Promise((t=>setTimeout(t,50*o))),Xo(t,e,r,i,n,o+1))})),Jo.apply(this,arguments)}function Ko(t){var{body:e,options:r,url:i}=t;if(ri(e))return null;var{hostname:n,isHostDenied:o}=Nn(i,r);if(o)return n+" is in deny list";if(Qr(e))return e;if(sn(e))return e.textContent;if(oi(e))return xn(e);if(Xr(e))try{return JSON.stringify(e)}catch(t){return"[SessionReplay] Failed to stringify response object"}return"[SessionReplay] Cannot read body of type "+toString.call(e)}var Qo=t=>!ei(t)&&("navigation"===t.entryType||"resource"===t.entryType);function ts(t){var{entry:e,method:i,status:n,networkRequest:o,isInitial:s,start:a,end:l,url:u,initiatorType:c}=t;a=e?e.startTime:a,l=e?e.responseEnd:l;var h=Math.floor(Date.now()-performance.now()),d=Math.floor(h+(a||0)),v=[r({},e?e.toJSON():{name:u},{startTime:Kr(a)?void 0:Math.round(a),endTime:Kr(l)?void 0:Math.round(l),timeOrigin:h,timestamp:d,method:i,initiatorType:c||(e?e.initiatorType:void 0),status:n,requestHeaders:o.requestHeaders,requestBody:o.requestBody,responseHeaders:o.responseHeaders,responseBody:o.responseBody,isInitial:s})];if(Qo(e))for(var f of e.serverTiming||[])v.push({timeOrigin:h,timestamp:d,startTime:Math.round(e.startTime),name:f.name,duration:f.duration,entryType:"serverTiming"});return v}var es=["video/","audio/"];function rs(t){return new Promise(((e,r)=>{var i=setTimeout((()=>e("[SessionReplay] Timeout while trying to read body")),500);try{t.clone().text().then((t=>e(t)),(t=>r(t))).finally((()=>clearTimeout(i)))}catch(t){clearTimeout(i),e("[SessionReplay] Failed to read body")}}))}function is(){return is=e((function*(t){var{r:e,options:r,url:i}=t,{hostname:n,isHostDenied:o}=Nn(i,r);return o?Promise.resolve(n+" is in deny list"):rs(e)})),is.apply(this,arguments)}function ns(){return ns=e((function*(t){var{r:e,options:r,url:i}=t,n=function(t){var e,{r:r,options:i,url:n}=t;if("chunked"===r.headers.get("Transfer-Encoding"))return"Chunked Transfer-Encoding is not supported";var o=null==(e=r.headers.get("Content-Type"))?void 0:e.toLowerCase(),s=es.some((t=>null==o?void 0:o.startsWith(t)));if(o&&s)return"Content-Type "+o+" is not supported";var{hostname:a,isHostDenied:l}=Nn(n,i);return l?a+" is in deny list":null}({r:e,options:r,url:i});return ei(n)?rs(e):Promise.resolve(n)})),ns.apply(this,arguments)}function os(t,r,i){if(!i.initiatorTypes.includes("fetch"))return()=>{};var n=zo("request",i.recordHeaders),o=zo("response",i.recordHeaders),s=En(r,"fetch",(s=>function(){var a=e((function*(e,a){var l,u,c,h=new Request(e,a),d={};try{var v={};h.headers.forEach(((t,e)=>{v[e]=t})),n&&(d.requestHeaders=v),Uo({type:"request",headers:v,url:e,recordBody:i.recordBody})&&(d.requestBody=yield function(t){return is.apply(this,arguments)}({r:h,options:i,url:e})),u=r.performance.now(),l=yield s(h),c=r.performance.now();var f={};return l.headers.forEach(((t,e)=>{f[e]=t})),o&&(d.responseHeaders=f),Uo({type:"response",headers:f,url:e,recordBody:i.recordBody})&&(d.responseBody=yield function(t){return ns.apply(this,arguments)}({r:l,options:i,url:e})),l}finally{Xo(r,"fetch",h.url,u,c).then((e=>{var r,i=ts({entry:e,method:h.method,status:null==(r=l)?void 0:r.status,networkRequest:d,start:u,end:c,url:h.url,initiatorType:"fetch"});t({requests:i})})).catch((()=>{}))}}));return function(t,e){return a.apply(this,arguments)}}()));return()=>{s()}}var ss=null;function as(t,e,i){if(!("performance"in e))return()=>{};if(ss)return jo.warn("Network observer already initialised, doing nothing"),()=>{};var n=i?Object.assign({},Vo,i):Vo,o=e=>{var i=[];e.requests.forEach((t=>{var e=n.maskRequestFn(t);e&&i.push(e)})),i.length>0&&t(r({},e,{requests:i}))},s=Wo(o,e,n),a=()=>{},l=()=>{};return(n.recordHeaders||n.recordBody)&&(a=function(t,e,r){if(!r.initiatorTypes.includes("xmlhttprequest"))return()=>{};var i=zo("request",r.recordHeaders),n=zo("response",r.recordHeaders),o=En(e.XMLHttpRequest.prototype,"open",(o=>function(s,a,l,u,c){void 0===l&&(l=!0);var h,d,v=this,f=new Request(a),p={},g={},m=v.setRequestHeader.bind(v);v.setRequestHeader=(t,e)=>(g[t]=e,m(t,e)),i&&(p.requestHeaders=g);var y=v.send.bind(v);v.send=t=>(Uo({type:"request",headers:g,url:a,recordBody:r.recordBody})&&(p.requestBody=Ko({body:t,options:r,url:a})),h=e.performance.now(),y(t));var b=()=>{if(v.readyState===v.DONE){v.removeEventListener("readystatechange",b),d=e.performance.now();var i={};v.getAllResponseHeaders().trim().split(/[\r\n]+/).forEach((t=>{var e=t.split(": "),r=e.shift(),n=e.join(": ");r&&(i[r]=n)})),n&&(p.responseHeaders=i),Uo({type:"response",headers:i,url:a,recordBody:r.recordBody})&&(p.responseBody=Ko({body:v.response,options:r,url:a})),Xo(e,"xmlhttprequest",f.url,h,d).then((e=>{var r=ts({entry:e,method:s,status:null==v?void 0:v.status,networkRequest:p,start:h,end:d,url:a.toString(),initiatorType:"xmlhttprequest"});t({requests:r})})).catch((()=>{}))}};v.addEventListener("readystatechange",b),o.call(v,s,a,l,u,c)}));return()=>{o()}}(o,e,n),l=os(o,e,n)),ss=()=>{s(),a(),l()}}var ls=t=>({name:"rrweb/network@1",observer:as,options:t});nn.__PosthogExtensions__=nn.__PosthogExtensions__||{},nn.__PosthogExtensions__.rrwebPlugins={getRecordConsolePlugin:Br,getRecordNetworkPlugin:ls},nn.__PosthogExtensions__.rrweb={record:Ze,version:"v2"},nn.rrweb={record:Ze,version:"v2"},nn.rrwebConsoleRecord={getRecordConsolePlugin:Br},nn.getRecordNetworkPlugin=ls;var us,cs,hs,ds,vs,fs,ps,gs,ms={},ys=[],bs=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,ws=Array.isArray;function _s(t,e){for(var r in e)t[r]=e[r];return t}function Cs(t){var e=t.parentNode;e&&e.removeChild(t)}function Is(t,e,r){var i,n,o,s={};for(o in e)"key"==o?i=e[o]:"ref"==o?n=e[o]:s[o]=e[o];if(arguments.length>2&&(s.children=arguments.length>3?us.call(arguments,2):r),"function"==typeof t&&null!=t.defaultProps)for(o in t.defaultProps)void 0===s[o]&&(s[o]=t.defaultProps[o]);return Ss(t,s,i,n,null)}function Ss(t,e,r,i,n){var o={type:t,props:e,key:r,ref:i,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,constructor:void 0,__v:null==n?++hs:n,__i:-1,__u:0};return null==n&&null!=cs.vnode&&cs.vnode(o),o}function ks(t){return t.children}function xs(t,e){this.props=t,this.context=e}function As(t,e){if(null==e)return t.__?As(t.__,t.__i+1):null;for(var r;e<t.__k.length;e++)if(null!=(r=t.__k[e])&&null!=r.__e)return r.__e;return"function"==typeof t.type?As(t):null}function Ts(t){var e,r;if(null!=(t=t.__)&&null!=t.__c){for(t.__e=t.__c.base=null,e=0;e<t.__k.length;e++)if(null!=(r=t.__k[e])&&null!=r.__e){t.__e=t.__c.base=r.__e;break}return Ts(t)}}function Ms(t){(!t.__d&&(t.__d=!0)&&ds.push(t)&&!Es.__r++||vs!==cs.debounceRendering)&&((vs=cs.debounceRendering)||fs)(Es)}function Es(){var t,e,r,i,n,o,s,a,l;for(ds.sort(ps);t=ds.shift();)t.__d&&(e=ds.length,i=void 0,o=(n=(r=t).__v).__e,a=[],l=[],(s=r.__P)&&((i=_s({},n)).__v=n.__v+1,cs.vnode&&cs.vnode(i),Bs(s,i,n,r.__n,void 0!==s.ownerSVGElement,32&n.__u?[o]:null,a,null==o?As(n):o,!!(32&n.__u),l),i.__.__k[i.__i]=i,Zs(a,i,l),i.__e!=o&&Ts(i)),ds.length>e&&ds.sort(ps));Es.__r=0}function Ns(t,e,r,i,n,o,s,a,l,u,c){var h,d,v,f,p,g=i&&i.__k||ys,m=e.length;for(r.__d=l,function(t,e,r){var i,n,o,s,a,l=e.length,u=r.length,c=u,h=0;for(t.__k=[],i=0;i<l;i++)null!=(n=t.__k[i]=null==(n=e[i])||"boolean"==typeof n||"function"==typeof n?null:"string"==typeof n||"number"==typeof n||"bigint"==typeof n||n.constructor==String?Ss(null,n,null,null,n):ws(n)?Ss(ks,{children:n},null,null,null):void 0===n.constructor&&n.__b>0?Ss(n.type,n.props,n.key,n.ref?n.ref:null,n.__v):n)?(n.__=t,n.__b=t.__b+1,a=Fs(n,r,s=i+h,c),n.__i=a,o=null,-1!==a&&(c--,(o=r[a])&&(o.__u|=131072)),null==o||null===o.__v?(-1==a&&h--,"function"!=typeof n.type&&(n.__u|=65536)):a!==s&&(a===s+1?h++:a>s?c>l-s?h+=a-s:h--:h=a<s&&a==s-1?a-s:0,a!==i+h&&(n.__u|=65536))):(o=r[i])&&null==o.key&&o.__e&&(o.__e==t.__d&&(t.__d=As(o)),qs(o,o,!1),r[i]=null,c--);if(c)for(i=0;i<u;i++)null!=(o=r[i])&&0==(131072&o.__u)&&(o.__e==t.__d&&(t.__d=As(o)),qs(o,o))}(r,e,g),l=r.__d,h=0;h<m;h++)null!=(v=r.__k[h])&&"boolean"!=typeof v&&"function"!=typeof v&&(d=-1===v.__i?ms:g[v.__i]||ms,v.__i=h,Bs(t,v,d,n,o,s,a,l,u,c),f=v.__e,v.ref&&d.ref!=v.ref&&(d.ref&&$s(d.ref,null,v),c.push(v.ref,v.__c||f,v)),null==p&&null!=f&&(p=f),65536&v.__u||d.__k===v.__k?l=Rs(v,l,t):"function"==typeof v.type&&void 0!==v.__d?l=v.__d:f&&(l=f.nextSibling),v.__d=void 0,v.__u&=-196609);r.__d=l,r.__e=p}function Rs(t,e,r){var i,n;if("function"==typeof t.type){for(i=t.__k,n=0;i&&n<i.length;n++)i[n]&&(i[n].__=t,e=Rs(i[n],e,r));return e}return t.__e!=e&&(r.insertBefore(t.__e,e||null),e=t.__e),e&&e.nextSibling}function Fs(t,e,r,i){var n=t.key,o=t.type,s=r-1,a=r+1,l=e[r];if(null===l||l&&n==l.key&&o===l.type)return r;if(i>(null!=l&&0==(131072&l.__u)?1:0))for(;s>=0||a<e.length;){if(s>=0){if((l=e[s])&&0==(131072&l.__u)&&n==l.key&&o===l.type)return s;s--}if(a<e.length){if((l=e[a])&&0==(131072&l.__u)&&n==l.key&&o===l.type)return a;a++}}return-1}function Os(t,e,r){"-"===e[0]?t.setProperty(e,null==r?"":r):t[e]=null==r?"":"number"!=typeof r||bs.test(e)?r:r+"px"}function Ps(t,e,r,i,n){var o;t:if("style"===e)if("string"==typeof r)t.style.cssText=r;else{if("string"==typeof i&&(t.style.cssText=i=""),i)for(e in i)r&&e in r||Os(t.style,e,"");if(r)for(e in r)i&&r[e]===i[e]||Os(t.style,e,r[e])}else if("o"===e[0]&&"n"===e[1])o=e!==(e=e.replace(/(PointerCapture)$|Capture$/,"$1")),e=e.toLowerCase()in t?e.toLowerCase().slice(2):e.slice(2),t.l||(t.l={}),t.l[e+o]=r,r?i?r.u=i.u:(r.u=Date.now(),t.addEventListener(e,o?Ds:Ls,o)):t.removeEventListener(e,o?Ds:Ls,o);else{if(n)e=e.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if("width"!==e&&"height"!==e&&"href"!==e&&"list"!==e&&"form"!==e&&"tabIndex"!==e&&"download"!==e&&"rowSpan"!==e&&"colSpan"!==e&&"role"!==e&&e in t)try{t[e]=null==r?"":r;break t}catch(t){}"function"==typeof r||(null==r||!1===r&&"-"!==e[4]?t.removeAttribute(e):t.setAttribute(e,r))}}function Ls(t){var e=this.l[t.type+!1];if(t.t){if(t.t<=e.u)return}else t.t=Date.now();return e(cs.event?cs.event(t):t)}function Ds(t){return this.l[t.type+!0](cs.event?cs.event(t):t)}function Bs(t,e,r,i,n,o,s,a,l,u){var c,h,d,v,f,p,g,m,y,b,w,$,_,C,I,S=e.type;if(void 0!==e.constructor)return null;128&r.__u&&(l=!!(32&r.__u),o=[a=e.__e=r.__e]),(c=cs.__b)&&c(e);t:if("function"==typeof S)try{if(m=e.props,y=(c=S.contextType)&&i[c.__c],b=c?y?y.props.value:c.__:i,r.__c?g=(h=e.__c=r.__c).__=h.__E:("prototype"in S&&S.prototype.render?e.__c=h=new S(m,b):(e.__c=h=new xs(m,b),h.constructor=S,h.render=Hs),y&&y.sub(h),h.props=m,h.state||(h.state={}),h.context=b,h.__n=i,d=h.__d=!0,h.__h=[],h._sb=[]),null==h.__s&&(h.__s=h.state),null!=S.getDerivedStateFromProps&&(h.__s==h.state&&(h.__s=_s({},h.__s)),_s(h.__s,S.getDerivedStateFromProps(m,h.__s))),v=h.props,f=h.state,h.__v=e,d)null==S.getDerivedStateFromProps&&null!=h.componentWillMount&&h.componentWillMount(),null!=h.componentDidMount&&h.__h.push(h.componentDidMount);else{if(null==S.getDerivedStateFromProps&&m!==v&&null!=h.componentWillReceiveProps&&h.componentWillReceiveProps(m,b),!h.__e&&(null!=h.shouldComponentUpdate&&!1===h.shouldComponentUpdate(m,h.__s,b)||e.__v===r.__v)){for(e.__v!==r.__v&&(h.props=m,h.state=h.__s,h.__d=!1),e.__e=r.__e,e.__k=r.__k,e.__k.forEach((function(t){t&&(t.__=e)})),w=0;w<h._sb.length;w++)h.__h.push(h._sb[w]);h._sb=[],h.__h.length&&s.push(h);break t}null!=h.componentWillUpdate&&h.componentWillUpdate(m,h.__s,b),null!=h.componentDidUpdate&&h.__h.push((function(){h.componentDidUpdate(v,f,p)}))}if(h.context=b,h.props=m,h.__P=t,h.__e=!1,$=cs.__r,_=0,"prototype"in S&&S.prototype.render){for(h.state=h.__s,h.__d=!1,$&&$(e),c=h.render(h.props,h.state,h.context),C=0;C<h._sb.length;C++)h.__h.push(h._sb[C]);h._sb=[]}else do{h.__d=!1,$&&$(e),c=h.render(h.props,h.state,h.context),h.state=h.__s}while(h.__d&&++_<25);h.state=h.__s,null!=h.getChildContext&&(i=_s(_s({},i),h.getChildContext())),d||null==h.getSnapshotBeforeUpdate||(p=h.getSnapshotBeforeUpdate(v,f)),Ns(t,ws(I=null!=c&&c.type===ks&&null==c.key?c.props.children:c)?I:[I],e,r,i,n,o,s,a,l,u),h.base=e.__e,e.__u&=-161,h.__h.length&&s.push(h),g&&(h.__E=h.__=null)}catch(t){e.__v=null,l||null!=o?(e.__e=a,e.__u|=l?160:32,o[o.indexOf(a)]=null):(e.__e=r.__e,e.__k=r.__k),cs.__e(t,e,r)}else null==o&&e.__v===r.__v?(e.__k=r.__k,e.__e=r.__e):e.__e=function(t,e,r,i,n,o,s,a,l){var u,c,h,d,v,f,p,g=r.props,m=e.props,y=e.type;if("svg"===y&&(n=!0),null!=o)for(u=0;u<o.length;u++)if((v=o[u])&&"setAttribute"in v==!!y&&(y?v.localName===y:3===v.nodeType)){t=v,o[u]=null;break}if(null==t){if(null===y)return document.createTextNode(m);t=n?document.createElementNS("http://www.w3.org/2000/svg",y):document.createElement(y,m.is&&m),o=null,a=!1}if(null===y)g===m||a&&t.data===m||(t.data=m);else{if(o=o&&us.call(t.childNodes),g=r.props||ms,!a&&null!=o)for(g={},u=0;u<t.attributes.length;u++)g[(v=t.attributes[u]).name]=v.value;for(u in g)v=g[u],"children"==u||("dangerouslySetInnerHTML"==u?h=v:"key"===u||u in m||Ps(t,u,null,v,n));for(u in m)v=m[u],"children"==u?d=v:"dangerouslySetInnerHTML"==u?c=v:"value"==u?f=v:"checked"==u?p=v:"key"===u||a&&"function"!=typeof v||g[u]===v||Ps(t,u,v,g[u],n);if(c)a||h&&(c.__html===h.__html||c.__html===t.innerHTML)||(t.innerHTML=c.__html),e.__k=[];else if(h&&(t.innerHTML=""),Ns(t,ws(d)?d:[d],e,r,i,n&&"foreignObject"!==y,o,s,o?o[0]:r.__k&&As(r,0),a,l),null!=o)for(u=o.length;u--;)null!=o[u]&&Cs(o[u]);a||(u="value",void 0!==f&&(f!==t[u]||"progress"===y&&!f||"option"===y&&f!==g[u])&&Ps(t,u,f,g[u],!1),u="checked",void 0!==p&&p!==t[u]&&Ps(t,u,p,g[u],!1))}return t}(r.__e,e,r,i,n,o,s,l,u);(c=cs.diffed)&&c(e)}function Zs(t,e,r){e.__d=void 0;for(var i=0;i<r.length;i++)$s(r[i],r[++i],r[++i]);cs.__c&&cs.__c(e,t),t.some((function(e){try{t=e.__h,e.__h=[],t.some((function(t){t.call(e)}))}catch(t){cs.__e(t,e.__v)}}))}function $s(t,e,r){try{"function"==typeof t?t(e):t.current=e}catch(t){cs.__e(t,r)}}function qs(t,e,r){var i,n;if(cs.unmount&&cs.unmount(t),(i=t.ref)&&(i.current&&i.current!==t.__e||$s(i,null,e)),null!=(i=t.__c)){if(i.componentWillUnmount)try{i.componentWillUnmount()}catch(t){cs.__e(t,e)}i.base=i.__P=null,t.__c=void 0}if(i=t.__k)for(n=0;n<i.length;n++)i[n]&&qs(i[n],e,r||"function"!=typeof t.type);r||null==t.__e||Cs(t.__e),t.__=t.__e=t.__d=void 0}function Hs(t,e,r){return this.constructor(t,r)}function Vs(t,e,r){var i,n,o;cs.__&&cs.__(t,e),i=!1?null:e.__k,n=[],o=[],Bs(e,t=e.__k=Is(ks,null,[t]),i||ms,ms,void 0!==e.ownerSVGElement,i?null:e.firstChild?us.call(e.childNodes):null,n,i?i.__e:e.firstChild,false,o),Zs(n,t,o)}function js(t,e,r){var i,n,o,s,a=_s({},t.props);for(o in t.type&&t.type.defaultProps&&(s=t.type.defaultProps),e)"key"==o?i=e[o]:"ref"==o?n=e[o]:a[o]=void 0===e[o]&&void 0!==s?s[o]:e[o];return arguments.length>2&&(a.children=arguments.length>3?us.call(arguments,2):r),Ss(t.type,a,i||t.key,n||t.ref,null)}us=ys.slice,cs={__e:function(t,e,r,i){for(var n,o,s;e=e.__;)if((n=e.__c)&&!n.__)try{if((o=n.constructor)&&null!=o.getDerivedStateFromError&&(n.setState(o.getDerivedStateFromError(t)),s=n.__d),null!=n.componentDidCatch&&(n.componentDidCatch(t,i||{}),s=n.__d),s)return n.__E=n}catch(e){t=e}throw t}},hs=0,xs.prototype.setState=function(t,e){var r;r=null!=this.__s&&this.__s!==this.state?this.__s:this.__s=_s({},this.state),"function"==typeof t&&(t=t(_s({},r),this.props)),t&&_s(r,t),null!=t&&this.__v&&(e&&this._sb.push(e),Ms(this))},xs.prototype.forceUpdate=function(t){this.__v&&(this.__e=!0,t&&this.__h.push(t),Ms(this))},xs.prototype.render=ks,ds=[],fs="function"==typeof Promise?Promise.prototype.then.bind(Promise.resolve()):setTimeout,ps=function(t,e){return t.__v.__b-e.__v.__b},Es.__r=0,gs=0;var Ys,Gs,Ws,zs,Us=0,Xs=[],Js=[],Ks=cs.__b,Qs=cs.__r,ta=cs.diffed,ea=cs.__c,ra=cs.unmount;function ia(t,e){cs.__h&&cs.__h(Gs,t,Us||e),Us=0;var r=Gs.__H||(Gs.__H={__:[],__h:[]});return t>=r.__.length&&r.__.push({__V:Js}),r.__[t]}function na(t){return Us=1,function(t,e,r){var i=ia(Ys++,2);if(i.t=t,!i.__c&&(i.__=[pa(void 0,e),function(t){var e=i.__N?i.__N[0]:i.__[0],r=i.t(e,t);e!==r&&(i.__N=[r,i.__[1]],i.__c.setState({}))}],i.__c=Gs,!Gs.u)){var n=function(t,e,r){if(!i.__c.__H)return!0;var n=i.__c.__H.__.filter((function(t){return t.__c}));if(n.every((function(t){return!t.__N})))return!o||o.call(this,t,e,r);var s=!1;return n.forEach((function(t){if(t.__N){var e=t.__[0];t.__=t.__N,t.__N=void 0,e!==t.__[0]&&(s=!0)}})),!(!s&&i.__c.props===t)&&(!o||o.call(this,t,e,r))};Gs.u=!0;var o=Gs.shouldComponentUpdate,s=Gs.componentWillUpdate;Gs.componentWillUpdate=function(t,e,r){if(this.__e){var i=o;o=void 0,n(t,e,r),o=i}s&&s.call(this,t,e,r)},Gs.shouldComponentUpdate=n}return i.__N||i.__}(pa,t)}function oa(t,e){var r=ia(Ys++,3);!cs.__s&&fa(r.__H,e)&&(r.__=t,r.i=e,Gs.__H.__h.push(r))}function sa(t){return Us=5,aa((function(){return{current:t}}),[])}function aa(t,e){var r=ia(Ys++,7);return fa(r.__H,e)?(r.__V=t(),r.i=e,r.__h=t,r.__V):r.__}function la(t){var e=Gs.context[t.__c],r=ia(Ys++,9);return r.c=t,e?(null==r.__&&(r.__=!0,e.sub(Gs)),e.props.value):t.__}function ua(){for(var t;t=Xs.shift();)if(t.__P&&t.__H)try{t.__H.__h.forEach(da),t.__H.__h.forEach(va),t.__H.__h=[]}catch(e){t.__H.__h=[],cs.__e(e,t.__v)}}cs.__b=function(t){Gs=null,Ks&&Ks(t)},cs.__r=function(t){Qs&&Qs(t),Ys=0;var e=(Gs=t.__c).__H;e&&(Ws===Gs?(e.__h=[],Gs.__h=[],e.__.forEach((function(t){t.__N&&(t.__=t.__N),t.__V=Js,t.__N=t.i=void 0}))):(e.__h.forEach(da),e.__h.forEach(va),e.__h=[],Ys=0)),Ws=Gs},cs.diffed=function(t){ta&&ta(t);var e=t.__c;e&&e.__H&&(e.__H.__h.length&&(1!==Xs.push(e)&&zs===cs.requestAnimationFrame||((zs=cs.requestAnimationFrame)||ha)(ua)),e.__H.__.forEach((function(t){t.i&&(t.__H=t.i),t.__V!==Js&&(t.__=t.__V),t.i=void 0,t.__V=Js}))),Ws=Gs=null},cs.__c=function(t,e){e.some((function(t){try{t.__h.forEach(da),t.__h=t.__h.filter((function(t){return!t.__||va(t)}))}catch(r){e.some((function(t){t.__h&&(t.__h=[])})),e=[],cs.__e(r,t.__v)}})),ea&&ea(t,e)},cs.unmount=function(t){ra&&ra(t);var e,r=t.__c;r&&r.__H&&(r.__H.__.forEach((function(t){try{da(t)}catch(t){e=t}})),r.__H=void 0,e&&cs.__e(e,r.__v))};var ca="function"==typeof requestAnimationFrame;function ha(t){var e,r=function(){clearTimeout(i),ca&&cancelAnimationFrame(e),setTimeout(t)},i=setTimeout(r,100);ca&&(e=requestAnimationFrame(r))}function da(t){var e=Gs,r=t.__c;"function"==typeof r&&(t.__c=void 0,r()),Gs=e}function va(t){var e=Gs;t.__c=t.__(),Gs=e}function fa(t,e){return!t||t.length!==e.length||e.some((function(e,r){return e!==t[r]}))}function pa(t,e){return"function"==typeof e?e(t):e}var ga=function(t){return t.Button="button",t.Tab="tab",t.Selector="selector",t}({}),ma=function(t){return t.TopLeft="top_left",t.TopRight="top_right",t.TopCenter="top_center",t.MiddleLeft="middle_left",t.MiddleRight="middle_right",t.MiddleCenter="middle_center",t.Left="left",t.Center="center",t.Right="right",t.NextToTrigger="next_to_trigger",t}({}),ya=function(t){return t.Popover="popover",t.API="api",t.Widget="widget",t.ExternalSurvey="external_survey",t}({}),ba=function(t){return t.Open="open",t.MultipleChoice="multiple_choice",t.SingleChoice="single_choice",t.Rating="rating",t.Link="link",t}({}),wa=function(t){return t.NextQuestion="next_question",t.End="end",t.ResponseBased="response_based",t.SpecificQuestion="specific_question",t}({}),_a=function(t){return t.Once="once",t.Recurring="recurring",t.Always="always",t}({}),Ca=function(t){return t.SHOWN="survey shown",t.DISMISSED="survey dismissed",t.SENT="survey sent",t}({}),Ia=function(t){return t.SURVEY_ID="$survey_id",t.SURVEY_NAME="$survey_name",t.SURVEY_RESPONSE="$survey_response",t.SURVEY_ITERATION="$survey_iteration",t.SURVEY_ITERATION_START_DATE="$survey_iteration_start_date",t.SURVEY_PARTIALLY_COMPLETED="$survey_partially_completed",t.SURVEY_SUBMISSION_ID="$survey_submission_id",t.SURVEY_QUESTIONS="$survey_questions",t.SURVEY_COMPLETED="$survey_completed",t}({}),Sa=function(t){return t.Popover="popover",t.Inline="inline",t}({}),ka=cn("[Surveys]");function xa(t){return!(!t.start_date||t.end_date)}function Aa(t){var e;return!(null==(e=t.conditions)||null==(e=e.events)||null==(e=e.values)||!e.length)}function Ta(t){var e;return!(null==(e=t.conditions)||null==(e=e.actions)||null==(e=e.values)||!e.length)}var Ma="seenSurvey_",Ea="inProgressSurvey_",Na=(t,e)=>{var r="$survey_"+e+"/"+t.id;return t.current_iteration&&t.current_iteration>0&&(r="$survey_"+e+"/"+t.id+"/"+t.current_iteration),r},Ra=t=>{var e=""+Ma+t.id;return t.current_iteration&&t.current_iteration>0&&(e=""+Ma+t.id+"_"+t.current_iteration),e},Fa=t=>{localStorage.getItem(Ra(t))||localStorage.setItem(Ra(t),"true")},Oa=[ya.Popover,ya.Widget,ya.API],Pa={ignoreConditions:!1,ignoreDelay:!1,displayType:Sa.Popover};Math.trunc||(Math.trunc=function(t){return t<0?Math.ceil(t):Math.floor(t)}),Number.isInteger||(Number.isInteger=function(t){return ii(t)&&isFinite(t)&&Math.floor(t)===t});var La="0123456789abcdef";class Da{constructor(t){if(this.bytes=t,16!==t.length)throw new TypeError("not 128-bit length")}static fromFieldsV7(t,e,r,i){if(!Number.isInteger(t)||!Number.isInteger(e)||!Number.isInteger(r)||!Number.isInteger(i)||t<0||e<0||r<0||i<0||t>0xffffffffffff||e>4095||r>1073741823||i>4294967295)throw new RangeError("invalid field value");var n=new Uint8Array(16);return n[0]=t/Math.pow(2,40),n[1]=t/Math.pow(2,32),n[2]=t/Math.pow(2,24),n[3]=t/Math.pow(2,16),n[4]=t/Math.pow(2,8),n[5]=t,n[6]=112|e>>>8,n[7]=e,n[8]=128|r>>>24,n[9]=r>>>16,n[10]=r>>>8,n[11]=r,n[12]=i>>>24,n[13]=i>>>16,n[14]=i>>>8,n[15]=i,new Da(n)}toString(){for(var t="",e=0;e<this.bytes.length;e++)t=t+La.charAt(this.bytes[e]>>>4)+La.charAt(15&this.bytes[e]),3!==e&&5!==e&&7!==e&&9!==e||(t+="-");if(36!==t.length)throw new Error("Invalid UUIDv7 was generated");return t}clone(){return new Da(this.bytes.slice(0))}equals(t){return 0===this.compareTo(t)}compareTo(t){for(var e=0;e<16;e++){var r=this.bytes[e]-t.bytes[e];if(0!==r)return Math.sign(r)}return 0}}class Ba{constructor(){this.F=0,this.O=0,this.P=new qa}generate(){var t=this.generateOrAbort();if(Kr(t)){this.F=0;var e=this.generateOrAbort();if(Kr(e))throw new Error("Could not generate UUID after timestamp reset");return e}return t}generateOrAbort(){var t=Date.now();if(t>this.F)this.F=t,this.L();else{if(!(t+1e4>this.F))return;this.O++,this.O>4398046511103&&(this.F++,this.L())}return Da.fromFieldsV7(this.F,Math.trunc(this.O/Math.pow(2,30)),this.O&Math.pow(2,30)-1,this.P.nextUint32())}L(){this.O=1024*this.P.nextUint32()+(1023&this.P.nextUint32())}}var Za,$a=t=>{if("undefined"!=typeof UUIDV7_DENY_WEAK_RNG&&UUIDV7_DENY_WEAK_RNG)throw new Error("no cryptographically strong RNG available");for(var e=0;e<t.length;e++)t[e]=65536*Math.trunc(65536*Math.random())+Math.trunc(65536*Math.random());return t};Yi&&!Kr(Yi.crypto)&&crypto.getRandomValues&&($a=t=>crypto.getRandomValues(t));class qa{constructor(){this.D=new Uint32Array(8),this.B=1/0}nextUint32(){return this.B>=this.D.length&&($a(this.D),this.B=0),this.D[this.B++]}}var Ha=()=>Va().toString(),Va=()=>(Za||(Za=new Ba)).generate(),ja="Mobile",Ya="iOS",Ga="Android",Wa="Tablet",za=Ga+" "+Wa,Ua="iPad",Xa="Apple",Ja=Xa+" Watch",Ka="Safari",Qa="BlackBerry",tl="Samsung",el=tl+"Browser",rl=tl+" Internet",il="Chrome",nl=il+" OS",ol=il+" "+Ya,sl="Internet Explorer",al=sl+" "+ja,ll="Opera",ul=ll+" Mini",cl="Edge",hl="Microsoft "+cl,dl="Firefox",vl=dl+" "+Ya,fl="Nintendo",pl="PlayStation",gl="Xbox",ml=Ga+" "+ja,yl=ja+" "+Ka,bl="Windows",wl=bl+" Phone",_l="Nokia",Cl="Ouya",Il="Generic",Sl=Il+" "+ja.toLowerCase(),kl=Il+" "+Wa.toLowerCase(),xl="Konqueror",Al="(\\d+(\\.\\d+)?)",Tl=new RegExp("Version/"+Al),Ml=new RegExp(gl,"i"),El=new RegExp(pl+" \\w+","i"),Nl=new RegExp(fl+" \\w+","i"),Rl=new RegExp(Qa+"|PlayBook|BB10","i"),Fl={"NT3.51":"NT 3.11","NT4.0":"NT 4.0","5.0":"2000",5.1:"XP",5.2:"XP","6.0":"Vista",6.1:"7",6.2:"8",6.3:"8.1",6.4:"10","10.0":"10"};var Ol=(t,e)=>e&&$r(e,Xa)||function(t){return $r(t,Ka)&&!$r(t,il)&&!$r(t,Ga)}(t),Pl=function(t,e){return e=e||"",$r(t," OPR/")&&$r(t,"Mini")?ul:$r(t," OPR/")?ll:Rl.test(t)?Qa:$r(t,"IE"+ja)||$r(t,"WPDesktop")?al:$r(t,el)?rl:$r(t,cl)||$r(t,"Edg/")?hl:$r(t,"FBIOS")?"Facebook "+ja:$r(t,"UCWEB")||$r(t,"UCBrowser")?"UC Browser":$r(t,"CriOS")?ol:$r(t,"CrMo")||$r(t,il)?il:$r(t,Ga)&&$r(t,Ka)?ml:$r(t,"FxiOS")?vl:$r(t.toLowerCase(),xl.toLowerCase())?xl:Ol(t,e)?$r(t,ja)?yl:Ka:$r(t,dl)?dl:$r(t,"MSIE")||$r(t,"Trident/")?sl:$r(t,"Gecko")?dl:""},Ll={[al]:[new RegExp("rv:"+Al)],[hl]:[new RegExp(cl+"?\\/"+Al)],[il]:[new RegExp("("+il+"|CrMo)\\/"+Al)],[ol]:[new RegExp("CriOS\\/"+Al)],"UC Browser":[new RegExp("(UCBrowser|UCWEB)\\/"+Al)],[Ka]:[Tl],[yl]:[Tl],[ll]:[new RegExp("(Opera|OPR)\\/"+Al)],[dl]:[new RegExp(dl+"\\/"+Al)],[vl]:[new RegExp("FxiOS\\/"+Al)],[xl]:[new RegExp("Konqueror[:/]?"+Al,"i")],[Qa]:[new RegExp(Qa+" "+Al),Tl],[ml]:[new RegExp("android\\s"+Al,"i")],[rl]:[new RegExp(el+"\\/"+Al)],[sl]:[new RegExp("(rv:|MSIE )"+Al)],Mozilla:[new RegExp("rv:"+Al)]},Dl=function(t,e){var r=Pl(t,e),i=Ll[r];if(Kr(i))return null;for(var n=0;n<i.length;n++){var o=i[n],s=t.match(o);if(s)return parseFloat(s[s.length-2])}return null},Bl=[[new RegExp(gl+"; "+gl+" (.*?)[);]","i"),t=>[gl,t&&t[1]||""]],[new RegExp(fl,"i"),[fl,""]],[new RegExp(pl,"i"),[pl,""]],[Rl,[Qa,""]],[new RegExp(bl,"i"),(t,e)=>{if(/Phone/.test(e)||/WPDesktop/.test(e))return[wl,""];if(new RegExp(ja).test(e)&&!/IEMobile\b/.test(e))return[bl+" "+ja,""];var r=/Windows NT ([0-9.]+)/i.exec(e);if(r&&r[1]){var i=r[1],n=Fl[i]||"";return/arm/i.test(e)&&(n="RT"),[bl,n]}return[bl,""]}],[/((iPhone|iPad|iPod).*?OS (\d+)_(\d+)_?(\d+)?|iPhone)/,t=>{if(t&&t[3]){var e=[t[3],t[4],t[5]||"0"];return[Ya,e.join(".")]}return[Ya,""]}],[/(watch.*\/(\d+\.\d+\.\d+)|watch os,(\d+\.\d+),)/i,t=>{var e="";return t&&t.length>=3&&(e=Kr(t[2])?t[3]:t[2]),["watchOS",e]}],[new RegExp("("+Ga+" (\\d+)\\.(\\d+)\\.?(\\d+)?|"+Ga+")","i"),t=>{if(t&&t[2]){var e=[t[2],t[3],t[4]||"0"];return[Ga,e.join(".")]}return[Ga,""]}],[/Mac OS X (\d+)[_.](\d+)[_.]?(\d+)?/i,t=>{var e=["Mac OS X",""];if(t&&t[1]){var r=[t[1],t[2],t[3]||"0"];e[1]=r.join(".")}return e}],[/Mac/i,["Mac OS X",""]],[/CrOS/,[nl,""]],[/Linux|debian/i,["Linux",""]]],Zl=function(t){return Nl.test(t)?fl:El.test(t)?pl:Ml.test(t)?gl:new RegExp(Cl,"i").test(t)?Cl:new RegExp("("+wl+"|WPDesktop)","i").test(t)?wl:/iPad/.test(t)?Ua:/iPod/.test(t)?"iPod Touch":/iPhone/.test(t)?"iPhone":/(watch)(?: ?os[,/]|\d,\d\/)[\d.]+/i.test(t)?Ja:Rl.test(t)?Qa:/(kobo)\s(ereader|touch)/i.test(t)?"Kobo":new RegExp(_l,"i").test(t)?_l:/(kf[a-z]{2}wi|aeo[c-r]{2})( bui|\))/i.test(t)||/(kf[a-z]+)( bui|\)).+silk\//i.test(t)?"Kindle Fire":/(Android|ZTE)/i.test(t)?!new RegExp(ja).test(t)||/(9138B|TB782B|Nexus [97]|pixel c|HUAWEISHT|BTV|noble nook|smart ultra 6)/i.test(t)?/pixel[\daxl ]{1,6}/i.test(t)&&!/pixel c/i.test(t)||/(huaweimed-al00|tah-|APA|SM-G92|i980|zte|U304AA)/i.test(t)||/lmy47v/i.test(t)&&!/QTAQZ3/i.test(t)?Ga:za:Ga:new RegExp("(pda|"+ja+")","i").test(t)?Sl:new RegExp(Wa,"i").test(t)&&!new RegExp(Wa+" pc","i").test(t)?kl:""},$l=function(t){var e=Zl(t);return e===Ua||e===za||"Kobo"===e||"Kindle Fire"===e||e===kl?Wa:e===fl||e===gl||e===pl||e===Cl?"Console":e===Ja?"Wearable":e?ja:"Desktop"},ql="$copy_autocapture",Hl=function(t){return t.GZipJS="gzip-js",t.Base64="base64",t}({}),Vl=Uint8Array,jl=Uint16Array,Yl=Uint32Array,Gl=new Vl([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]),Wl=new Vl([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]),zl=new Vl([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),Ul=function(t,e){for(var r=new jl(31),i=0;i<31;++i)r[i]=e+=1<<t[i-1];var n=new Yl(r[30]);for(i=1;i<30;++i)for(var o=r[i];o<r[i+1];++o)n[o]=o-r[i]<<5|i;return[r,n]},Xl=Ul(Gl,2),Jl=Xl[0],Kl=Xl[1];Jl[28]=258,Kl[258]=28;for(var Ql=Ul(Wl,0)[1],tu=new jl(32768),eu=0;eu<32768;++eu){var ru=(43690&eu)>>>1|(21845&eu)<<1;ru=(61680&(ru=(52428&ru)>>>2|(13107&ru)<<2))>>>4|(3855&ru)<<4,tu[eu]=((65280&ru)>>>8|(255&ru)<<8)>>>1}var iu=function(t,e,r){for(var i=t.length,n=0,o=new jl(e);n<i;++n)++o[t[n]-1];var s,a=new jl(e);for(n=0;n<e;++n)a[n]=a[n-1]+o[n-1]<<1;if(r){s=new jl(1<<e);var l=15-e;for(n=0;n<i;++n)if(t[n])for(var u=n<<4|t[n],c=e-t[n],h=a[t[n]-1]++<<c,d=h|(1<<c)-1;h<=d;++h)s[tu[h]>>>l]=u}else for(s=new jl(i),n=0;n<i;++n)s[n]=tu[a[t[n]-1]++]>>>15-t[n];return s},nu=new Vl(288);for(eu=0;eu<144;++eu)nu[eu]=8;for(eu=144;eu<256;++eu)nu[eu]=9;for(eu=256;eu<280;++eu)nu[eu]=7;for(eu=280;eu<288;++eu)nu[eu]=8;var ou=new Vl(32);for(eu=0;eu<32;++eu)ou[eu]=5;var su=iu(nu,9,0),au=iu(ou,5,0),lu=function(t){return(t/8>>0)+(7&t&&1)},uu=function(t,e,r){(null==r||r>t.length)&&(r=t.length);var i=new(t instanceof jl?jl:t instanceof Yl?Yl:Vl)(r-e);return i.set(t.subarray(e,r)),i},cu=function(t,e,r){r<<=7&e;var i=e/8>>0;t[i]|=r,t[i+1]|=r>>>8},hu=function(t,e,r){r<<=7&e;var i=e/8>>0;t[i]|=r,t[i+1]|=r>>>8,t[i+2]|=r>>>16},du=function(t,e){for(var r=[],i=0;i<t.length;++i)t[i]&&r.push({s:i,f:t[i]});var n=r.length,o=r.slice();if(!n)return[new Vl(0),0];if(1==n){var s=new Vl(r[0].s+1);return s[r[0].s]=1,[s,1]}r.sort((function(t,e){return t.f-e.f})),r.push({s:-1,f:25001});var a=r[0],l=r[1],u=0,c=1,h=2;for(r[0]={s:-1,f:a.f+l.f,l:a,r:l};c!=n-1;)a=r[r[u].f<r[h].f?u++:h++],l=r[u!=c&&r[u].f<r[h].f?u++:h++],r[c++]={s:-1,f:a.f+l.f,l:a,r:l};var d=o[0].s;for(i=1;i<n;++i)o[i].s>d&&(d=o[i].s);var v=new jl(d+1),f=vu(r[c-1],v,0);if(f>e){i=0;var p=0,g=f-e,m=1<<g;for(o.sort((function(t,e){return v[e.s]-v[t.s]||t.f-e.f}));i<n;++i){var y=o[i].s;if(!(v[y]>e))break;p+=m-(1<<f-v[y]),v[y]=e}for(p>>>=g;p>0;){var b=o[i].s;v[b]<e?p-=1<<e-v[b]++-1:++i}for(;i>=0&&p;--i){var w=o[i].s;v[w]==e&&(--v[w],++p)}f=e}return[new Vl(v),f]},vu=function(t,e,r){return-1==t.s?Math.max(vu(t.l,e,r+1),vu(t.r,e,r+1)):e[t.s]=r},fu=function(t){for(var e=t.length;e&&!t[--e];);for(var r=new jl(++e),i=0,n=t[0],o=1,s=function(t){r[i++]=t},a=1;a<=e;++a)if(t[a]==n&&a!=e)++o;else{if(!n&&o>2){for(;o>138;o-=138)s(32754);o>2&&(s(o>10?o-11<<5|28690:o-3<<5|12305),o=0)}else if(o>3){for(s(n),--o;o>6;o-=6)s(8304);o>2&&(s(o-3<<5|8208),o=0)}for(;o--;)s(n);o=1,n=t[a]}return[r.subarray(0,i),e]},pu=function(t,e){for(var r=0,i=0;i<e.length;++i)r+=t[i]*e[i];return r},gu=function(t,e,r){var i=r.length,n=lu(e+2);t[n]=255&i,t[n+1]=i>>>8,t[n+2]=255^t[n],t[n+3]=255^t[n+1];for(var o=0;o<i;++o)t[n+o+4]=r[o];return 8*(n+4+i)},mu=function(t,e,r,i,n,o,s,a,l,u,c){cu(e,c++,r),++n[256];for(var h=du(n,15),d=h[0],v=h[1],f=du(o,15),p=f[0],g=f[1],m=fu(d),y=m[0],b=m[1],w=fu(p),_=w[0],C=w[1],I=new jl(19),S=0;S<y.length;++S)I[31&y[S]]++;for(S=0;S<_.length;++S)I[31&_[S]]++;for(var k=du(I,7),x=k[0],A=k[1],T=19;T>4&&!x[zl[T-1]];--T);var M,E,N,R,F=u+5<<3,O=pu(n,nu)+pu(o,ou)+s,P=pu(n,d)+pu(o,p)+s+14+3*T+pu(I,x)+(2*I[16]+3*I[17]+7*I[18]);if(F<=O&&F<=P)return gu(e,c,t.subarray(l,l+u));if(cu(e,c,1+(P<O)),c+=2,P<O){M=iu(d,v,0),E=d,N=iu(p,g,0),R=p;var L=iu(x,A,0);cu(e,c,b-257),cu(e,c+5,C-1),cu(e,c+10,T-4),c+=14;for(S=0;S<T;++S)cu(e,c+3*S,x[zl[S]]);c+=3*T;for(var D=[y,_],B=0;B<2;++B){var Z=D[B];for(S=0;S<Z.length;++S){var q=31&Z[S];cu(e,c,L[q]),c+=x[q],q>15&&(cu(e,c,Z[S]>>>5&127),c+=Z[S]>>>12)}}}else M=su,E=nu,N=au,R=ou;for(S=0;S<a;++S)if(i[S]>255){q=i[S]>>>18&31;hu(e,c,M[q+257]),c+=E[q+257],q>7&&(cu(e,c,i[S]>>>23&31),c+=Gl[q]);var H=31&i[S];hu(e,c,N[H]),c+=R[H],H>3&&(hu(e,c,i[S]>>>5&8191),c+=Wl[H])}else hu(e,c,M[i[S]]),c+=E[i[S]];return hu(e,c,M[256]),c+E[256]},yu=new Yl([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),bu=function(){for(var t=new Yl(256),e=0;e<256;++e){for(var r=e,i=9;--i;)r=(1&r&&3988292384)^r>>>1;t[e]=r}return t}(),wu=function(t,e,r,i,n){return function(t,e,r,i,n,o){var s=t.length,a=new Vl(i+s+5*(1+Math.floor(s/7e3))+n),l=a.subarray(i,a.length-n),u=0;if(!e||s<8)for(var c=0;c<=s;c+=65535){var h=c+65535;h<s?u=gu(l,u,t.subarray(c,h)):(l[c]=o,u=gu(l,u,t.subarray(c,s)))}else{for(var d=yu[e-1],v=d>>>13,f=8191&d,p=(1<<r)-1,g=new jl(32768),m=new jl(p+1),y=Math.ceil(r/3),b=2*y,w=function(e){return(t[e]^t[e+1]<<y^t[e+2]<<b)&p},_=new Yl(25e3),C=new jl(288),I=new jl(32),S=0,k=0,x=(c=0,0),A=0,T=0;c<s;++c){var M=w(c),E=32767&c,N=m[M];if(g[E]=N,m[M]=E,A<=c){var R=s-c;if((S>7e3||x>24576)&&R>423){u=mu(t,l,0,_,C,I,k,x,T,c-T,u),x=S=k=0,T=c;for(var F=0;F<286;++F)C[F]=0;for(F=0;F<30;++F)I[F]=0}var O=2,P=0,L=f,D=E-N&32767;if(R>2&&M==w(c-D))for(var B=Math.min(v,R)-1,Z=Math.min(32767,c),q=Math.min(258,R);D<=Z&&--L&&E!=N;){if(t[c+O]==t[c+O-D]){for(var H=0;H<q&&t[c+H]==t[c+H-D];++H);if(H>O){if(O=H,P=D,H>B)break;var V=Math.min(D,H-2),j=0;for(F=0;F<V;++F){var Y=c-D+F+32768&32767,G=Y-g[Y]+32768&32767;G>j&&(j=G,N=Y)}}}D+=(E=N)-(N=g[E])+32768&32767}if(P){_[x++]=268435456|Kl[O]<<18|Ql[P];var W=31&Kl[O],z=31&Ql[P];k+=Gl[W]+Wl[z],++C[257+W],++I[z],A=c+O,++S}else _[x++]=t[c],++C[t[c]]}}u=mu(t,l,o,_,C,I,k,x,T,c-T,u)}return uu(a,0,i+lu(u)+n)}(t,null==e.level?6:e.level,null==e.mem?Math.ceil(1.5*Math.max(8,Math.min(13,Math.log(t.length)))):12+e.mem,r,i,!0)},_u=function(t,e,r){for(;r;++e)t[e]=r,r>>>=8};function Cu(t,e){void 0===e&&(e={});var r=function(){var t=4294967295;return{p:function(e){for(var r=t,i=0;i<e.length;++i)r=bu[255&r^e[i]]^r>>>8;t=r},d:function(){return 4294967295^t}}}(),i=t.length;r.p(t);var n=wu(t,e,function(t){return 10+(t.filename&&t.filename.length+1||0)}(e),8),o=n.length;return function(t,e){var r=e.filename;if(t[0]=31,t[1]=139,t[2]=8,t[8]=e.level<2?4:9==e.level?2:0,t[9]=3,0!=e.mtime&&_u(t,4,Math.floor(new Date(e.mtime||Date.now())/1e3)),r){t[3]=8;for(var i=0;i<=r.length;++i)t[i+10]=r.charCodeAt(i)}}(n,e),_u(n,o-8,r.d()),_u(n,o-4,i),n}var Iu=function(t){var e,r,i,n,o="";for(e=r=0,i=(t=(t+"").replace(/\r\n/g,"\n").replace(/\r/g,"\n")).length,n=0;n<i;n++){var s=t.charCodeAt(n),a=null;s<128?r++:a=s>127&&s<2048?String.fromCharCode(s>>6|192,63&s|128):String.fromCharCode(s>>12|224,s>>6&63|128,63&s|128),ei(a)||(r>e&&(o+=t.substring(e,r)),o+=a,e=r=n+1)}return r>e&&(o+=t.substring(e,t.length)),o},Su=!!tn||!!Qi,ku="text/plain",xu=(t,e)=>{var[i,n]=t.split("?"),o=r({},e);null==n||n.split("&").forEach((t=>{var[e]=t.split("=");delete o[e]}));var s=xn(o);return i+"?"+(s=s?(n?n+"&":"")+s:n)},Au=(t,e)=>JSON.stringify(t,((t,e)=>"bigint"==typeof e?e.toString():e),e),Tu=t=>{var{data:e,compression:r}=t;if(e){if(r===Hl.GZipJS){var i=Cu(function(t,e){var r=t.length;if("undefined"!=typeof TextEncoder)return(new TextEncoder).encode(t);for(var i=new Vl(t.length+(t.length>>>1)),n=0,o=function(t){i[n++]=t},s=0;s<r;++s){if(n+5>i.length){var a=new Vl(n+8+(r-s<<1));a.set(i),i=a}var l=t.charCodeAt(s);l<128||e?o(l):l<2048?(o(192|l>>>6),o(128|63&l)):l>55295&&l<57344?(o(240|(l=65536+(1047552&l)|1023&t.charCodeAt(++s))>>>18),o(128|l>>>12&63),o(128|l>>>6&63),o(128|63&l)):(o(224|l>>>12),o(128|l>>>6&63),o(128|63&l))}return uu(i,0,n)}(Au(e)),{mtime:0}),n=new Blob([i],{type:ku});return{contentType:ku,body:n,estimatedSize:n.size}}if(r===Hl.Base64){var o=function(t){var e,r,i,n,o,s="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",a=0,l=0,u="",c=[];if(!t)return t;t=Iu(t);do{e=(o=t.charCodeAt(a++)<<16|t.charCodeAt(a++)<<8|t.charCodeAt(a++))>>18&63,r=o>>12&63,i=o>>6&63,n=63&o,c[l++]=s.charAt(e)+s.charAt(r)+s.charAt(i)+s.charAt(n)}while(a<t.length);switch(u=c.join(""),t.length%3){case 1:u=u.slice(0,-2)+"==";break;case 2:u=u.slice(0,-1)+"="}return u}(Au(e)),s=(t=>"data="+encodeURIComponent("string"==typeof t?t:Au(t)))(o);return{contentType:"application/x-www-form-urlencoded",body:s,estimatedSize:new Blob([s]).size}}var a=Au(e);return{contentType:"application/json",body:a,estimatedSize:new Blob([a]).size}}},Mu=[];Qi&&Mu.push({transport:"fetch",method:t=>{var e,i,{contentType:n,body:o,estimatedSize:s}=null!==(e=Tu(t))&&void 0!==e?e:{},a=new Headers;vn(t.headers,(function(t,e){a.append(e,t)})),n&&a.append("Content-Type",n);var l=t.url,u=null;if(en){var c=new en;u={signal:c.signal,timeout:setTimeout((()=>c.abort()),t.timeout)}}Qi(l,r({method:(null==t?void 0:t.method)||"GET",headers:a,keepalive:"POST"===t.method&&(s||0)<52428.8,body:o,signal:null==(i=u)?void 0:i.signal},t.fetchOptions)).then((e=>e.text().then((r=>{var i={statusCode:e.status,text:r};if(200===e.status)try{i.json=JSON.parse(r)}catch(t){un.error(t)}null==t.callback||t.callback(i)})))).catch((e=>{un.error(e),null==t.callback||t.callback({statusCode:0,text:e})})).finally((()=>u?clearTimeout(u.timeout):null))}}),tn&&Mu.push({transport:"XHR",method:t=>{var e,r=new tn;r.open(t.method||"GET",t.url,!0);var{contentType:i,body:n}=null!==(e=Tu(t))&&void 0!==e?e:{};vn(t.headers,(function(t,e){r.setRequestHeader(e,t)})),i&&r.setRequestHeader("Content-Type",i),t.timeout&&(r.timeout=t.timeout),t.disableXHRCredentials||(r.withCredentials=!0),r.onreadystatechange=()=>{if(4===r.readyState){var e={statusCode:r.status,text:r.responseText};if(200===r.status)try{e.json=JSON.parse(r.responseText)}catch(t){}null==t.callback||t.callback(e)}},r.send(n)}}),null!=Xi&&Xi.sendBeacon&&Mu.push({transport:"sendBeacon",method:t=>{var e=xu(t.url,{beacon:"1"});try{var r,{contentType:i,body:n}=null!==(r=Tu(t))&&void 0!==r?r:{},o="string"==typeof n?new Blob([n],{type:i}):n;Xi.sendBeacon(e,o)}catch(t){}}});var Eu=function(t,e){if(!function(t){try{new RegExp(t)}catch(t){return!1}return!0}(e))return!1;try{return new RegExp(e).test(t)}catch(t){return!1}};function Nu(t,e,r){return Au({distinct_id:t,userPropertiesToSet:e,userPropertiesToSetOnce:r})}var Ru={exact:(t,e)=>e.some((e=>t.some((t=>e===t)))),is_not:(t,e)=>e.every((e=>t.every((t=>e!==t)))),regex:(t,e)=>e.some((e=>t.some((t=>Eu(e,t))))),not_regex:(t,e)=>e.every((e=>t.every((t=>!Eu(e,t))))),icontains:(t,e)=>e.map(Fu).some((e=>t.map(Fu).some((t=>e.includes(t))))),not_icontains:(t,e)=>e.map(Fu).every((e=>t.map(Fu).every((t=>!e.includes(t)))))},Fu=t=>t.toLowerCase(),Ou=cn("[Stylesheet Loader]"),Pu=Yi,Lu=Ji;function Du(t){return"$survey_response_"+t}var Bu="#020617",Zu={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:ma.Right,widgetType:ga.Tab,widgetLabel:"Feedback",widgetColor:"black",zIndex:"2147483647",disabledButtonOpacity:"0.6",maxWidth:"300px",textSubtleColor:"#939393",boxPadding:"20px 24px",boxShadow:"0 4px 12px rgba(0, 0, 0, 0.15)",borderRadius:"10px",shuffleQuestions:!1,surveyPopupDelaySeconds:void 0,outlineColor:"rgba(59, 130, 246, 0.8)",inputBackground:"white",inputTextColor:Bu,scrollbarThumbColor:"var(--ph-survey-border-color)",scrollbarTrackColor:"var(--ph-survey-background-color)"};function $u(t){if("#"===t[0]){var e=t.replace(/^#/,"");return"rgb("+parseInt(e.slice(0,2),16)+","+parseInt(e.slice(2,4),16)+","+parseInt(e.slice(4,6),16)+")"}return"rgb(255, 255, 255)"}function qu(t){var e;void 0===t&&(t=Zu.backgroundColor),"#"===t[0]&&(e=$u(t)),t.startsWith("rgb")&&(e=t);var r={aliceblue:"#f0f8ff",antiquewhite:"#faebd7",aqua:"#00ffff",aquamarine:"#7fffd4",azure:"#f0ffff",beige:"#f5f5dc",bisque:"#ffe4c4",black:"#000000",blanchedalmond:"#ffebcd",blue:"#0000ff",blueviolet:"#8a2be2",brown:"#a52a2a",burlywood:"#deb887",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",cornflowerblue:"#6495ed",cornsilk:"#fff8dc",crimson:"#dc143c",cyan:"#00ffff",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkgray:"#a9a9a9",darkgreen:"#006400",darkkhaki:"#bdb76b",darkmagenta:"#8b008b",darkolivegreen:"#556b2f",darkorange:"#ff8c00",darkorchid:"#9932cc",darkred:"#8b0000",darksalmon:"#e9967a",darkseagreen:"#8fbc8f",darkslateblue:"#483d8b",darkslategray:"#2f4f4f",darkturquoise:"#00ced1",darkviolet:"#9400d3",deeppink:"#ff1493",deepskyblue:"#00bfff",dimgray:"#696969",dodgerblue:"#1e90ff",firebrick:"#b22222",floralwhite:"#fffaf0",forestgreen:"#228b22",fuchsia:"#ff00ff",gainsboro:"#dcdcdc",ghostwhite:"#f8f8ff",gold:"#ffd700",goldenrod:"#daa520",gray:"#808080",green:"#008000",greenyellow:"#adff2f",honeydew:"#f0fff0",hotpink:"#ff69b4","indianred ":"#cd5c5c",indigo:"#4b0082",ivory:"#fffff0",khaki:"#f0e68c",lavender:"#e6e6fa",lavenderblush:"#fff0f5",lawngreen:"#7cfc00",lemonchiffon:"#fffacd",lightblue:"#add8e6",lightcoral:"#f08080",lightcyan:"#e0ffff",lightgoldenrodyellow:"#fafad2",lightgrey:"#d3d3d3",lightgreen:"#90ee90",lightpink:"#ffb6c1",lightsalmon:"#ffa07a",lightseagreen:"#20b2aa",lightskyblue:"#87cefa",lightslategray:"#778899",lightsteelblue:"#b0c4de",lightyellow:"#ffffe0",lime:"#00ff00",limegreen:"#32cd32",linen:"#faf0e6",magenta:"#ff00ff",maroon:"#800000",mediumaquamarine:"#66cdaa",mediumblue:"#0000cd",mediumorchid:"#ba55d3",mediumpurple:"#9370d8",mediumseagreen:"#3cb371",mediumslateblue:"#7b68ee",mediumspringgreen:"#00fa9a",mediumturquoise:"#48d1cc",mediumvioletred:"#c71585",midnightblue:"#191970",mintcream:"#f5fffa",mistyrose:"#ffe4e1",moccasin:"#ffe4b5",navajowhite:"#ffdead",navy:"#000080",oldlace:"#fdf5e6",olive:"#808000",olivedrab:"#6b8e23",orange:"#ffa500",orangered:"#ff4500",orchid:"#da70d6",palegoldenrod:"#eee8aa",palegreen:"#98fb98",paleturquoise:"#afeeee",palevioletred:"#d87093",papayawhip:"#ffefd5",peachpuff:"#ffdab9",peru:"#cd853f",pink:"#ffc0cb",plum:"#dda0dd",powderblue:"#b0e0e6",purple:"#800080",red:"#ff0000",rosybrown:"#bc8f8f",royalblue:"#4169e1",saddlebrown:"#8b4513",salmon:"#fa8072",sandybrown:"#f4a460",seagreen:"#2e8b57",seashell:"#fff5ee",sienna:"#a0522d",silver:"#c0c0c0",skyblue:"#87ceeb",slateblue:"#6a5acd",slategray:"#708090",snow:"#fffafa",springgreen:"#00ff7f",steelblue:"#4682b4",tan:"#d2b48c",teal:"#008080",thistle:"#d8bfd8",tomato:"#ff6347",turquoise:"#40e0d0",violet:"#ee82ee",wheat:"#f5deb3",white:"#ffffff",whitesmoke:"#f5f5f5",yellow:"#ffff00",yellowgreen:"#9acd32"}[t.toLowerCase()];if(r&&(e=$u(r)),!e)return Bu;var i=e.match(/^rgba?\((\d+),\s*(\d+),\s*(\d+)(?:,\s*(\d+(?:\.\d+)?))?\)$/);if(i){var n=parseInt(i[1]),o=parseInt(i[2]),s=parseInt(i[3]);return Math.sqrt(n*n*.299+o*o*.587+s*s*.114)>127.5?Bu:"white"}return Bu}function Hu(t){var e=((t,e,r)=>{var i,n=t.createElement("style");return n.innerText=e,null!=r&&null!=(i=r.config)&&i.prepare_external_dependency_stylesheet&&(n=r.config.prepare_external_dependency_stylesheet(n)),n||(Ou.error("prepare_external_dependency_stylesheet returned null"),null)})(Lu,':host{--ph-survey-font-family:-apple-system,BlinkMacSystemFont,"Inter","Segoe UI","Roboto",Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol";--ph-survey-box-padding:20px 24px;--ph-survey-max-width:300px;--ph-survey-z-index:2147483647;--ph-survey-border-color:#dcdcdc;--ph-survey-border-bottom:1.5px solid var(--ph-survey-border-color);--ph-survey-border-radius:10px;--ph-survey-background-color:#eeeded;--ph-survey-box-shadow:0 4px 12px rgba(0,0,0,.15);--ph-survey-submit-button-color:#000;--ph-survey-submit-button-text-color:#fff;--ph-survey-rating-bg-color:#fff;--ph-survey-rating-text-color:#020617;--ph-survey-rating-active-bg-color:#000;--ph-survey-rating-active-text-color:#fff;--ph-survey-text-primary-color:#020617;--ph-survey-text-subtle-color:#939393;--ph-widget-color:#e0a045;--ph-widget-text-color:#fff;--ph-survey-scrollbar-thumb-color:var(--ph-survey-border-color);--ph-survey-scrollbar-track-color:var(--ph-survey-background-color);--ph-survey-outline-color:rgba(59,130,246,.8);--ph-survey-input-background:#fff;--ph-survey-input-text-color:#020617;--ph-survey-disabled-button-opacity:0.6}.ph-survey{bottom:0;height:fit-content;margin:0;max-width:85%;min-width:300px;position:fixed;width:var(--ph-survey-max-width);z-index:var(--ph-survey-z-index)}.ph-survey h3,.ph-survey p{margin:0}.ph-survey *{box-sizing:border-box;color:var(--ph-survey-text-primary-color);font-family:var(--ph-survey-font-family)}.ph-survey .multiple-choice-options label,.ph-survey input[type=text],.ph-survey textarea{background:var(--ph-survey-input-background);border:1.5px solid var(--ph-survey-border-color);border-radius:4px;color:var(--ph-survey-input-text-color);padding:10px;transition:border-color .2s ease-out,box-shadow .2s ease-out,transform .15s ease-out}.ph-survey input[type=text],.ph-survey textarea{transition:border-color .2s ease-out,box-shadow .2s ease-out,transform .15s ease-out}.ph-survey input{margin:0}.ph-survey .form-submit:focus,.ph-survey .form-submit:focus-visible,.ph-survey input[type=checkbox]:focus,.ph-survey input[type=checkbox]:focus-visible,.ph-survey input[type=radio]:focus,.ph-survey input[type=radio]:focus-visible,.ph-survey input[type=text]:focus,.ph-survey input[type=text]:focus-visible,.ph-survey textarea:focus,.ph-survey textarea:focus-visible{border-color:var(--ph-survey-rating-active-bg-color);outline:1.5px solid var(--ph-survey-outline-color);outline-offset:2px}.ph-survey button:focus:not(:focus-visible),.ph-survey input[type=checkbox]:focus:not(:focus-visible),.ph-survey input[type=radio]:focus:not(:focus-visible),.ph-survey input[type=text]:focus:not(:focus-visible),.ph-survey textarea:focus:not(:focus-visible){outline:none}.ph-survey input[type=text]:hover:not(:focus),.ph-survey textarea:hover:not(:focus){border-color:var(--ph-survey-rating-active-bg-color)}@media (max-width:768px){.ph-survey input[type=text],.ph-survey textarea{font-size:1rem}}.ph-survey .form-cancel,.ph-survey .multiple-choice-options label,.ph-survey .rating-options-number,.ph-survey input[type=checkbox],.ph-survey input[type=radio]{border:1.5px solid var(--ph-survey-border-color)}.ph-survey .footer-branding,.ph-survey .form-cancel,.ph-survey .form-submit,.ph-survey .ratings-emoji,.ph-survey .ratings-number,.ph-survey input[type=checkbox],.ph-survey input[type=radio],.ph-survey label{transition:all .2s ease-out}@media (prefers-reduced-motion:no-preference){.ph-survey button:active,.ph-survey input[type=checkbox]:active,.ph-survey input[type=radio]:active,.ph-survey label:active{transition-duration:.1s}}.ph-survey-widget-tab{background:var(--ph-widget-color);border:none;border-radius:3px 3px 0 0;color:var(--ph-widget-text-color);cursor:pointer;padding:10px 12px;position:fixed;right:0;text-align:center;top:50%;transform:rotate(-90deg) translateY(-100%);transform-origin:right top;transition:padding-bottom .2s ease-out;z-index:var(--ph-survey-z-index)}.ph-survey-widget-tab:hover{padding-bottom: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}.question-textarea-wrapper{display:flex;flex-direction:column}.survey-form{animation:ph-survey-fade-in .3s ease-out forwards}.survey-form,.thank-you-message{background:var(--ph-survey-background-color);border:1.5px solid var(--ph-survey-border-color);border-bottom:var(--ph-survey-border-bottom);border-radius:var(--ph-survey-border-radius);box-shadow:var(--ph-survey-box-shadow);margin:0;padding:var(--ph-survey-box-padding);position:relative;text-align:left;width:100%;z-index:var(--ph-survey-z-index)}.survey-form input[type=text],.survey-form textarea{min-width:100%}:is(.survey-form textarea):focus,:is(.survey-form textarea):focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.08)}:is(.survey-form textarea):focus:not(:focus-visible){box-shadow:none}.survey-box:has(.survey-question:empty):not(:has(.survey-question-description)) .multiple-choice-options,.survey-box:has(.survey-question:empty):not(:has(.survey-question-description)) textarea{margin-top:0}.multiple-choice-options{border:none;display:flex;flex-direction:column;font-size:14px;gap:8px;margin:0;padding:1px 0}.multiple-choice-options .response-choice,.multiple-choice-options label{align-items:center;color:inherit;display:flex;gap:8px}.multiple-choice-options label{cursor:pointer;font-size:13px}:is(.multiple-choice-options label):hover:not(:has(input:checked)){border-color:var(--ph-survey-text-subtle-color);box-shadow:0 2px 8px rgba(0,0,0,.08)}:is(.multiple-choice-options label):has(input:checked){border-color:var(--ph-survey-rating-active-bg-color);box-shadow:0 1px 4px rgba(0,0,0,.05)}.choice-option-open:is(.multiple-choice-options label){flex-wrap:wrap}:is(.multiple-choice-options label) span{color:inherit}.multiple-choice-options input[type=checkbox],.multiple-choice-options input[type=radio]{appearance:none;-webkit-appearance:none;-moz-appearance:none;background:var(--ph-survey-input-background);border-radius:3px;cursor:pointer;flex-shrink:0;height:1rem;position:relative;transition:all .2s cubic-bezier(.4,0,.2,1),transform .15s ease-out;width:1rem;z-index:1}:is(.multiple-choice-options input[type=checkbox],.multiple-choice-options input[type=radio]):focus{transform:scale(1.05)}:is(.multiple-choice-options input[type=checkbox],.multiple-choice-options input[type=radio]):hover{border-color:var(--ph-survey-rating-active-bg-color);transform:scale(1.05)}:is(.multiple-choice-options input[type=checkbox],.multiple-choice-options input[type=radio]):active{transform:scale(.95)}:is(.multiple-choice-options input[type=checkbox],.multiple-choice-options input[type=radio]):checked{background:var(--ph-survey-rating-active-bg-color);border-color:var(--ph-survey-rating-active-bg-color);transform:scale(1)}:is(.multiple-choice-options input[type=checkbox],.multiple-choice-options input[type=radio]):checked:hover{transform:scale(1.05)}.multiple-choice-options input[type=checkbox]:checked:after{animation:ph-survey-checkmark-reveal .2s ease-out .1s forwards;border:solid var(--ph-survey-rating-active-text-color);border-width:0 2px 2px 0;height:8px;left:4px;transform:rotate(45deg) scale(0);width:4px}.multiple-choice-options input[type=radio]:checked:after{animation:ph-survey-radio-reveal .15s ease-out .05s forwards;background:var(--ph-survey-rating-active-text-color);border-radius:50%;height:6px;left:5px;top:5px;transform:scale(0);width:6px}.multiple-choice-options input[type=checkbox]:checked:after,.multiple-choice-options input[type=radio]:checked:after{box-sizing:content-box;content:"";position:absolute}.multiple-choice-options input[type=radio]{border-radius:50%}.multiple-choice-options input[type=radio]:checked{border:none}:is(.multiple-choice-options input[type=checkbox]:checked,.multiple-choice-options input[type=radio]:checked)~*{font-weight:700}:is(:is(.multiple-choice-options .choice-option-open) input[type=text])::placeholder{color:var(--ph-survey-text-subtle-color);font-weight:400}.rating-options-emoji{display:flex;justify-content:space-between}.ratings-emoji{background-color:transparent;border:none;font-size:16px;opacity:.5;padding:0}.ratings-emoji:hover{cursor:pointer;opacity:1;transform:scale(1.15)}.ratings-emoji.rating-active{opacity:1}.ratings-emoji svg{fill:var(--ph-survey-text-primary-color);transition:fill .2s ease-out}.rating-options-number{border-radius:6px;display:grid;grid-auto-columns:1fr;grid-auto-flow:column;overflow:hidden}.rating-options-number .ratings-number{border:none;border-right:1px solid var(--ph-survey-border-color);color:var(--ph-survey-rating-text-color);cursor:pointer;font-weight:700;text-align:center}:is(.rating-options-number .ratings-number):last-of-type{border-right:0}.rating-active:is(.rating-options-number .ratings-number){background:var(--ph-survey-rating-active-bg-color);color:var(--ph-survey-rating-active-text-color)}.ratings-number{background-color:var(--ph-survey-rating-bg-color);border:none;padding:8px 0}.ratings-number .rating-active{background-color:var(--ph-survey-rating-active-bg-color)}.ratings-number:hover{cursor:pointer}.rating-text{display:flex;flex-direction:row;font-size:11px;justify-content:space-between;opacity:.7}.form-submit{background:var(--ph-survey-submit-button-color);border:none;border-radius:6px;box-shadow:0 2px 0 rgba(0,0,0,.045);color:var(--ph-survey-submit-button-text-color);cursor:pointer;font-weight:700;min-width:100%;padding:12px;text-align:center;user-select:none}.form-submit:not([disabled]):hover{box-shadow:0 4px 8px rgba(0,0,0,.1);transform:scale(1.02)}.form-submit:not([disabled]):active{box-shadow:0 1px 2px rgba(0,0,0,.05);transform:scale(.98)}.form-submit[disabled]{cursor:not-allowed;opacity:var(--ph-survey-disabled-button-opacity)}.form-cancel{background:#fff;border-radius:100%;cursor:pointer;line-height:0;padding:12px;position:absolute;right:0;top:0;transform:translate(50%,-50%)}.form-cancel:hover{opacity:.7;transform:translate(50%,-50%) scale(1.1)}.footer-branding{align-items:center;display:flex;font-size:11px;font-weight:500;gap:4px;justify-content:center;opacity:.6;text-decoration:none}.footer-branding:hover{opacity:1}.footer-branding a{text-decoration:none}.thank-you-message{text-align:center}.thank-you-message-header{margin:10px 0 0}.thank-you-message-body{font-size:14px;opacity:.8}.limit-height{max-height:256px;overflow-x:hidden;overflow-y:auto;scrollbar-color:var(--ph-survey-scrollbar-thumb-color) var(--ph-survey-scrollbar-track-color);scrollbar-width:thin}.limit-height::-webkit-scrollbar{width:8px}.limit-height::-webkit-scrollbar-track{background:var(--ph-survey-scrollbar-track-color);border-radius:4px}.limit-height::-webkit-scrollbar-thumb{background-color:var(--ph-survey-scrollbar-thumb-color);border:2px solid var(--ph-survey-scrollbar-track-color);border-radius:4px}:is(.limit-height::-webkit-scrollbar-thumb):hover{background-color:var(--ph-survey-text-subtle-color)}.sr-only{clip:rect(0,0,0,0);border:0;height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;white-space:nowrap;width:1px}@media (prefers-reduced-motion:reduce){.ph-survey *{animation-duration:.01ms!important;animation-iteration-count:1!important;scroll-behavior:auto!important;transition-duration:.01ms!important}}@keyframes ph-survey-checkmark-reveal{0%{opacity:0;transform:rotate(45deg) scale(0)}50%{opacity:1;transform:rotate(45deg) scale(1.2)}to{opacity:1;transform:rotate(45deg) scale(1)}}@keyframes ph-survey-radio-reveal{0%{opacity:0;transform:scale(0)}50%{opacity:1;transform:scale(1.3)}to{opacity:1;transform:scale(1)}}',t);return null==e||e.setAttribute("data-ph-survey-style","true"),e}var Vu=(t,e,i)=>{var n=ac(t),o=Lu.querySelector("."+n);if(o&&o.shadowRoot)return{shadow:o.shadowRoot,isNewlyCreated:!1};var s=Lu.createElement("div");((t,e,i)=>{var n=r({},Zu,i),o=t.style,s=![ma.Center,ma.Left,ma.Right].includes(n.position)||e===ya.Widget&&(null==i?void 0:i.widgetType)===ga.Tab;o.setProperty("--ph-survey-font-family",function(t){if("inherit"===t)return"inherit";var e='BlinkMacSystemFont, "Inter", "Segoe UI", "Roboto", Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol"';return t?t+", "+e:"-apple-system, "+e}(n.fontFamily)),o.setProperty("--ph-survey-box-padding",n.boxPadding),o.setProperty("--ph-survey-max-width",n.maxWidth),o.setProperty("--ph-survey-z-index",n.zIndex),o.setProperty("--ph-survey-border-color",n.borderColor),s?(o.setProperty("--ph-survey-border-radius",n.borderRadius),o.setProperty("--ph-survey-border-bottom","1.5px solid var(--ph-survey-border-color)")):(o.setProperty("--ph-survey-border-bottom","none"),o.setProperty("--ph-survey-border-radius",n.borderRadius+" "+n.borderRadius+" 0 0")),o.setProperty("--ph-survey-background-color",n.backgroundColor),o.setProperty("--ph-survey-box-shadow",n.boxShadow),o.setProperty("--ph-survey-disabled-button-opacity",n.disabledButtonOpacity),o.setProperty("--ph-survey-submit-button-color",n.submitButtonColor),o.setProperty("--ph-survey-submit-button-text-color",(null==i?void 0:i.submitButtonTextColor)||qu(n.submitButtonColor)),o.setProperty("--ph-survey-rating-bg-color",n.ratingButtonColor),o.setProperty("--ph-survey-rating-text-color",qu(n.ratingButtonColor)),o.setProperty("--ph-survey-rating-active-bg-color",n.ratingButtonActiveColor),o.setProperty("--ph-survey-rating-active-text-color",qu(n.ratingButtonActiveColor)),o.setProperty("--ph-survey-text-primary-color",qu(n.backgroundColor)),o.setProperty("--ph-survey-text-subtle-color",n.textSubtleColor),o.setProperty("--ph-widget-color",n.widgetColor),o.setProperty("--ph-widget-text-color",qu(n.widgetColor)),o.setProperty("--ph-widget-z-index",n.zIndex),"white"===n.backgroundColor&&o.setProperty("--ph-survey-input-background","#f8f8f8"),o.setProperty("--ph-survey-input-background",n.inputBackground),o.setProperty("--ph-survey-input-text-color",qu(n.inputBackground)),o.setProperty("--ph-survey-scrollbar-thumb-color",n.scrollbarThumbColor),o.setProperty("--ph-survey-scrollbar-track-color",n.scrollbarTrackColor),o.setProperty("--ph-survey-outline-color",n.outlineColor)})(s,t.type,t.appearance),s.className=n;var a=s.attachShadow({mode:"open"}),l=Hu(e);if(l){var u=a.querySelector("style");u&&a.removeChild(u),a.appendChild(l)}return Lu.body.appendChild(s),{shadow:a,isNewlyCreated:!0}},ju=(t,e)=>{if(!e)return null;var r=t[Du(e)];return Wr(r)?[...r]:r},Yu=t=>{var{responses:e,survey:i,surveySubmissionId:n,posthog:o,isSurveyCompleted:s}=t;o?(Fa(i),o.capture(Ca.SENT,r({[Ia.SURVEY_NAME]:i.name,[Ia.SURVEY_ID]:i.id,[Ia.SURVEY_ITERATION]:i.current_iteration,[Ia.SURVEY_ITERATION_START_DATE]:i.current_iteration_start_date,[Ia.SURVEY_QUESTIONS]:i.questions.map((t=>({id:t.id,question:t.question,response:ju(e,t.id)}))),[Ia.SURVEY_SUBMISSION_ID]:n,[Ia.SURVEY_COMPLETED]:s,sessionRecordingUrl:null==o.get_session_replay_url?void 0:o.get_session_replay_url()},e,{$set:{[Na(i,"responded")]:!0}})),s&&(Pu.dispatchEvent(new CustomEvent("PHSurveySent",{detail:{surveyId:i.id}})),sc(i))):ka.error("[survey sent] event not captured, PostHog instance not found.")},Gu=(t,e,i)=>{if(e){if(!i){var n=nc(t);e.capture(Ca.DISMISSED,r({[Ia.SURVEY_NAME]:t.name,[Ia.SURVEY_ID]:t.id,[Ia.SURVEY_ITERATION]:t.current_iteration,[Ia.SURVEY_ITERATION_START_DATE]:t.current_iteration_start_date,[Ia.SURVEY_PARTIALLY_COMPLETED]:Object.values((null==n?void 0:n.responses)||{}).filter((t=>!ri(t))).length>0,sessionRecordingUrl:null==e.get_session_replay_url?void 0:e.get_session_replay_url()},null==n?void 0:n.responses,{[Ia.SURVEY_SUBMISSION_ID]:null==n?void 0:n.surveySubmissionId,[Ia.SURVEY_QUESTIONS]:t.questions.map((t=>({id:t.id,question:t.question,response:ju((null==n?void 0:n.responses)||{},t.id)}))),$set:{[Na(t,"dismissed")]:!0}})),sc(t),Fa(t),Pu.dispatchEvent(new CustomEvent("PHSurveyClosed",{detail:{surveyId:t.id}}))}}else ka.error("[survey dismissed] event not captured, PostHog instance not found.")},Wu=t=>t.map((t=>({sort:Math.floor(10*Math.random()),value:t}))).sort(((t,e)=>t.sort-e.sort)).map((t=>t.value)),zu=(t,e)=>t.length===e.length&&t.every(((t,r)=>t===e[r]))?e.reverse():e,Uu=t=>t.appearance&&t.appearance.shuffleQuestions&&!t.enable_partial_responses?zu(t.questions,Wu(t.questions)):t.questions,Xu=t=>{var e;return!(null==(e=t.conditions)||null==(e=e.events)||!e.repeatedActivation||!(t=>{var e,r;return null!=(null==(e=t.conditions)||null==(e=e.events)||null==(e=e.values)?void 0:e.length)&&(null==(r=t.conditions)||null==(r=r.events)||null==(r=r.values)?void 0:r.length)>0})(t))||t.schedule===_a.Always||oc(t)},Ju=function(t,e){var r={__c:e="__cC"+gs++,__:t,Consumer:function(t,e){return t.children(e)},Provider:function(t){var r,i;return this.getChildContext||(r=[],(i={})[e]=this,this.getChildContext=function(){return i},this.shouldComponentUpdate=function(t){this.props.value!==t.value&&r.some((function(t){t.__e=!0,Ms(t)}))},this.sub=function(t){r.push(t);var e=t.componentWillUnmount;t.componentWillUnmount=function(){r.splice(r.indexOf(t),1),e&&e.call(t)}}),t.children}};return r.Provider.__=r.Consumer.contextType=r}({isPreviewMode:!1,previewPageIndex:0,onPopupSurveyDismissed:()=>{},isPopup:!0,onPreviewSubmit:()=>{},surveySubmissionId:""}),Ku=()=>la(Ju),Qu=t=>{var{component:e,children:r,renderAsHtml:i,style:n}=t;return js(e,i?{dangerouslySetInnerHTML:{__html:r},style:n}:{children:r,style:n})};function tc(t){return null!=t?t:"icontains"}function ec(t){var e,r,i;if(null==(e=t.conditions)||!e.url)return!0;var n=null==Pu||null==(r=Pu.location)?void 0:r.href;if(!n)return!1;var o=[t.conditions.url],s=tc(null==(i=t.conditions)?void 0:i.urlMatchType);return Ru[s](o,[n])}var rc=t=>{var e=""+Ea+t.id;return t.current_iteration&&t.current_iteration>0&&(e=""+Ea+t.id+"_"+t.current_iteration),e},ic=(t,e)=>{try{localStorage.setItem(rc(t),JSON.stringify(e))}catch(t){ka.error("Error setting in-progress survey state in localStorage",t)}},nc=t=>{try{var e=localStorage.getItem(rc(t));if(e)return JSON.parse(e)}catch(t){ka.error("Error getting in-progress survey state from localStorage",t)}return null},oc=t=>{var e=nc(t);return!ri(null==e?void 0:e.surveySubmissionId)},sc=t=>{try{localStorage.removeItem(rc(t))}catch(t){ka.error("Error clearing in-progress survey state from localStorage",t)}};function ac(t,e){void 0===e&&(e=!1);var r="PostHogSurvey-"+t.id;return e?"."+r:r}var lc=0;function uc(t,e,r,i,n,o){var s,a,l={};for(a in e)"ref"==a?s=e[a]:l[a]=e[a];var u={type:t,props:l,key:r,ref:s,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,constructor:void 0,__v:--lc,__i:-1,__u:0,__source:n,__self:o};if("function"==typeof t&&(s=t.defaultProps))for(a in s)void 0===l[a]&&(l[a]=s[a]);return cs.vnode&&cs.vnode(u),u}var cc=uc("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 -960 960 960",width:"48",children:uc("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"})}),hc=uc("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 -960 960 960",width:"48",children:uc("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"})}),dc=uc("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 -960 960 960",width:"48",children:uc("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"})}),vc=uc("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 -960 960 960",width:"48",children:uc("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"})}),fc=uc("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 -960 960 960",width:"48",children:uc("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"})}),pc=uc("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-labelledby":"close-survey-title",children:[uc("title",{id:"close-survey-title",children:"Close survey"}),uc("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M0.164752 0.164752C0.384422 -0.0549175 0.740578 -0.0549175 0.960248 0.164752L6 5.20451L11.0398 0.164752C11.2594 -0.0549175 11.6156 -0.0549175 11.8352 0.164752C12.0549 0.384422 12.0549 0.740578 11.8352 0.960248L6.79549 6L11.8352 11.0398C12.0549 11.2594 12.0549 11.6156 11.8352 11.8352C11.6156 12.0549 11.2594 12.0549 11.0398 11.8352L6 6.79549L0.960248 11.8352C0.740578 12.0549 0.384422 12.0549 0.164752 11.8352C-0.0549175 11.6156 -0.0549175 11.2594 0.164752 11.0398L5.20451 6L0.164752 0.960248C-0.0549175 0.740578 -0.0549175 0.384422 0.164752 0.164752Z",fill:"black"})]}),gc=uc("svg",{width:"77",height:"14",viewBox:"0 0 77 14",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[uc("g",{"clip-path":"url(#clip0_2415_6911)",children:[uc("mask",{id:"mask0_2415_6911",style:{maskType:"luminance"},maskUnits:"userSpaceOnUse",x:"0",y:"0",width:"77",height:"14",children:uc("path",{d:"M0.5 0H76.5V14H0.5V0Z",fill:"white"})}),uc("g",{mask:"url(#mask0_2415_6911)",children:[uc("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"}),uc("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"}),uc("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"}),uc("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"}),uc("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"}),uc("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"})]})]}),uc("defs",{children:uc("clipPath",{id:"clip0_2415_6911",children:uc("rect",{width:"76",height:"14",fill:"white",transform:"translate(0.5)"})})})]});function mc(){return uc("a",{href:"https://posthog.com/surveys",target:"_blank",rel:"noopener",className:"footer-branding",children:["Survey by ",gc]})}function yc(t){var{text:e,submitDisabled:r,appearance:i,onSubmit:n,link:o,onPreviewSubmit:s,skipSubmitButton:a}=t,{isPreviewMode:l}=la(Ju);return uc("div",{className:"bottom-section",children:[!a&&uc("button",{className:"form-submit",disabled:r,"aria-label":"Submit survey",type:"button",onClick:()=>{o&&(null==Yi||Yi.open(o)),l?null==s||s():n()},children:e}),!i.whiteLabel&&uc(mc,{})]})}function bc(t){var{question:e,forceDisableHtml:r,htmlFor:i}=t;return uc("div",{class:"question-header",children:[uc(e.type===ba.Open?"label":"h3",{className:"survey-question",htmlFor:i,children:e.question}),e.description&&Qu({component:Is("p",{className:"survey-question-description"}),children:e.description,renderAsHtml:!r&&"text"!==e.descriptionContentType})]})}function wc(t){var{onClick:e}=t,{isPreviewMode:r}=la(Ju);return uc("button",{className:"form-cancel",onClick:e,disabled:r,"aria-label":"Close survey",type:"button",children:pc})}uc("svg",{width:"16",height:"12",viewBox:"0 0 16 12",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:uc("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 _c=Yi;function Cc(t){var{header:e,description:r,contentType:i,forceDisableHtml:n,appearance:o,onClose:s}=t,{isPopup:a}=la(Ju);return oa((()=>{var t=t=>{"Enter"!==t.key&&"Escape"!==t.key||(t.preventDefault(),s())};return Sn(_c,"keydown",t),()=>{_c.removeEventListener("keydown",t)}}),[s]),uc("div",{className:"thank-you-message",role:"status",tabIndex:0,"aria-atomic":"true",children:[a&&uc(wc,{onClick:()=>s()}),uc("h3",{className:"thank-you-message-header",children:e}),r&&Qu({component:Is("p",{className:"thank-you-message-body"}),children:r,renderAsHtml:!n&&"text"!==i}),a&&uc(yc,{text:o.thankYouMessageCloseButtonText||"Close",submitDisabled:!1,appearance:o,onSubmit:()=>s()})]})}var Ic=t=>Wr(t)&&t.every((t=>Qr(t)));function Sc(t){var{question:e,forceDisableHtml:r,appearance:i,onSubmit:n,onPreviewSubmit:o,displayQuestionIndex:s,initialValue:a}=t,{isPreviewMode:l}=Ku(),u=sa(null),[c,h]=na((()=>Qr(a)?a:""));oa((()=>{setTimeout((()=>{var t;l||(null==(t=u.current)||t.focus())}),100)}),[l]);var d="surveyQuestion"+s;return uc(ks,{children:[uc("div",{className:"question-container",children:[uc(bc,{question:e,forceDisableHtml:r,htmlFor:d}),uc("textarea",{ref:u,id:d,rows:4,placeholder:null==i?void 0:i.placeholder,onInput:t=>{h(t.currentTarget.value),t.stopPropagation()},onKeyDown:t=>{t.stopPropagation()},value:c})]}),uc(yc,{text:e.buttonText||"Submit",submitDisabled:!c&&!e.optional,appearance:i,onSubmit:()=>n(c),onPreviewSubmit:()=>o(c)})]})}function kc(t){var{question:e,forceDisableHtml:r,appearance:i,onSubmit:n,onPreviewSubmit:o}=t;return uc(ks,{children:[uc("div",{className:"question-container",children:uc(bc,{question:e,forceDisableHtml:r})}),uc(yc,{text:e.buttonText||"Submit",submitDisabled:!1,link:e.link,appearance:i,onSubmit:()=>n("link clicked"),onPreviewSubmit:()=>o("link clicked")})]})}function xc(t){var{question:e,forceDisableHtml:r,displayQuestionIndex:i,appearance:n,onSubmit:o,onPreviewSubmit:s,initialValue:a}=t,l=e.scale,u=10===e.scale?0:1,[c,h]=na((()=>ii(a)?a:Wr(a)&&a.length>0&&ii(parseInt(a[0]))?parseInt(a[0]):Qr(a)&&ii(parseInt(a))?parseInt(a):null)),{isPreviewMode:d}=Ku(),v=t=>d?s(t):o(t);return uc(ks,{children:[uc("div",{className:"question-container",children:[uc(bc,{question:e,forceDisableHtml:r}),uc("div",{className:"rating-section",children:[uc("div",{className:"rating-options",children:["emoji"===e.display&&uc("div",{className:"rating-options-emoji",children:(3===e.scale?Mc:Ec).map(((t,r)=>uc("button",{"aria-label":"Rate "+(r+1),className:"ratings-emoji question-"+i+"-rating-"+r+" "+(r+1===c?"rating-active":""),value:r+1,type:"button",onClick:()=>{var t=r+1;h(t),e.skipSubmitButton&&v(t)},children:t},r)))}),"number"===e.display&&uc("div",{className:"rating-options-number",style:{gridTemplateColumns:"repeat("+(l-u+1)+", minmax(0, 1fr))"},children:Oc(e.scale).map(((t,r)=>uc(Ac,{displayQuestionIndex:i,active:c===t,appearance:n,num:t,setActiveNumber:t=>{h(t),e.skipSubmitButton&&v(t)}},r)))})]}),uc("div",{className:"rating-text",children:[uc("div",{children:e.lowerBoundLabel}),uc("div",{children:e.upperBoundLabel})]})]})]}),uc(yc,{text:e.buttonText||(null==n?void 0:n.submitButtonText)||"Submit",submitDisabled:ei(c)&&!e.optional,appearance:n,onSubmit:()=>o(c),onPreviewSubmit:()=>s(c),skipSubmitButton:e.skipSubmitButton})]})}function Ac(t){var{num:e,active:r,displayQuestionIndex:i,setActiveNumber:n}=t;return uc("button",{"aria-label":"Rate "+e,className:"ratings-number question-"+i+"-rating-"+e+" "+(r?"rating-active":""),type:"button",onClick:()=>{n(e)},children:e})}function Tc(t){var{question:e,forceDisableHtml:i,displayQuestionIndex:n,appearance:o,onSubmit:s,onPreviewSubmit:a,initialValue:l}=t,u=sa(null),c=aa((()=>(t=>{if(!t.shuffleOptions)return t.choices;var e=t.choices,r="";t.hasOpenChoice&&(r=e.pop());var i=zu(e,Wu(e));return t.hasOpenChoice&&(t.choices.push(r),i.push(r)),i})(e)),[e]),[h,d]=na((()=>((t,e)=>Qr(t)||Ic(t)?t:e===ba.SingleChoice?null:[])(l,e.type))),[v,f]=na((()=>((t,e)=>{if(Qr(t)&&!e.includes(t))return{isSelected:!0,inputValue:t};if(Ic(t)){var r=t.find((t=>!e.includes(t)));if(r)return{isSelected:!0,inputValue:r}}return{isSelected:!1,inputValue:""}})(l,c))),{isPreviewMode:p}=Ku(),g=e.type===ba.SingleChoice,m=e.type===ba.MultipleChoice,y=e.skipSubmitButton&&g&&!e.hasOpenChoice,b=(t,e)=>{if(e){var i=!v.isSelected;return f((t=>r({},t,{isSelected:i,inputValue:i?t.inputValue:""}))),g&&d(""),void(i&&setTimeout((()=>{var t;return null==(t=u.current)?void 0:t.focus()}),75))}if(g)return d(t),f((t=>r({},t,{isSelected:!1,inputValue:""}))),void(y&&(s(t),p&&a(t)));m&&Wr(h)&&(h.includes(t)?d(h.filter((e=>e!==t))):d([...h,t]))},w=t=>{t.stopPropagation();var e=t.currentTarget.value;f((t=>r({},t,{inputValue:e}))),g&&d(e)},_=t=>{t.stopPropagation(),"Enter"!==t.key||C()||(t.preventDefault(),I()),"Escape"===t.key&&(t.preventDefault(),f((t=>r({},t,{isSelected:!1,inputValue:""}))),g&&d(null))},C=()=>!e.optional&&(!!ei(h)||(!(!Wr(h)||v.isSelected||0!==h.length)||!(!v.isSelected||""!==v.inputValue.trim()))),I=()=>{v.isSelected&&m?Wr(h)&&(p?a([...h,v.inputValue]):s([...h,v.inputValue])):p?a(h):s(h)};return uc(ks,{children:[uc("div",{className:"question-container",children:[uc(bc,{question:e,forceDisableHtml:i}),uc("fieldset",{className:"multiple-choice-options limit-height",children:[uc("legend",{className:"sr-only",children:m?" Select all that apply":" Select one"}),c.map(((t,r)=>{var i=!!e.hasOpenChoice&&r===e.choices.length-1,o="surveyQuestion"+n+"Choice"+r,s=o+"Open",a=i?v.isSelected:g?h===t:Wr(h)&&h.includes(t);return uc("label",{className:i?"choice-option-open":"",children:[uc("div",{className:"response-choice",children:[uc("input",{type:g?"radio":"checkbox",name:o,checked:a,onChange:()=>b(t,i),id:o,"aria-controls":s}),uc("span",{children:i?t+":":t})]}),i&&uc("input",{type:"text",ref:u,id:s,name:"question"+n+"Open",value:v.inputValue,onKeyDown:_,onInput:w,onClick:e=>{v.isSelected||b(t,!0),e.stopPropagation()},"aria-label":t+" - please specify"})]},r)}))]})]}),uc(yc,{text:e.buttonText||"Submit",submitDisabled:C(),appearance:o,onSubmit:I,onPreviewSubmit:I,skipSubmitButton:y})]})}var Mc=[dc,hc,cc],Ec=[vc,dc,hc,cc,fc],Nc=[1,2,3,4,5],Rc=[1,2,3,4,5,6,7],Fc=[0,1,2,3,4,5,6,7,8,9,10];function Oc(t){switch(t){case 5:default:return Nc;case 7:return Rc;case 10:return Fc}}var Pc=Yi,Lc=Ji,Dc="ph:show_survey_widget",Bc="PHWidgetSurveyClickListener";function Zc(t,e,r){var i,n=t.questions[e],o=e+1;if(null==(i=n.branching)||!i.type)return e===t.questions.length-1?wa.End:o;if(n.branching.type===wa.End)return wa.End;if(n.branching.type===wa.SpecificQuestion){if(Number.isInteger(n.branching.index))return n.branching.index}else if(n.branching.type===wa.ResponseBased){if(n.type===ba.SingleChoice){var s,a=n.choices.indexOf(""+r);if(-1===a&&n.hasOpenChoice&&(a=n.choices.length-1),null!=(s=n.branching)&&null!=(s=s.responseValues)&&s.hasOwnProperty(a)){var l=n.branching.responseValues[a];return Number.isInteger(l)?l:l===wa.End?wa.End:o}}else if(n.type===ba.Rating){var u;if("number"!=typeof r||!Number.isInteger(r))throw new Error("The response type must be an integer");var c=function(t,e){if(3===e){if(t<1||t>3)throw new Error("The response must be in range 1-3");return 1===t?"negative":2===t?"neutral":"positive"}if(5===e){if(t<1||t>5)throw new Error("The response must be in range 1-5");return t<=2?"negative":3===t?"neutral":"positive"}if(7===e){if(t<1||t>7)throw new Error("The response must be in range 1-7");return t<=3?"negative":4===t?"neutral":"positive"}if(10===e){if(t<0||t>10)throw new Error("The response must be in range 0-10");return t<=6?"detractors":t<=8?"passives":"promoters"}throw new Error("The scale must be one of: 3, 5, 7, 10")}(r,n.scale);if(null!=(u=n.branching)&&null!=(u=u.responseValues)&&u.hasOwnProperty(c)){var h=n.branching.responseValues[c];return Number.isInteger(h)?h:h===wa.End?wa.End:o}}return o}return ka.warn("Falling back to next question index due to unexpected branching type"),o}var $c=250,qc=20,Hc=12;class Vc{constructor(t){var e=this;this.Z=new Map,this.$=new Map,this.handlePopoverSurvey=t=>{var e;this.q(t.id),this.H(t);var i=(null==(e=t.appearance)?void 0:e.surveyPopupDelaySeconds)||0,{shadow:n}=Vu(t,this._posthog);if(i<=0)return Vs(uc(Wc,{posthog:this._posthog,survey:t,removeSurveyFromFocus:this.V}),n);var o=setTimeout((()=>{if(!ec(t))return this.V(t);Vs(uc(Wc,{posthog:this._posthog,survey:r({},t,{appearance:r({},t.appearance,{surveyPopupDelaySeconds:0})}),removeSurveyFromFocus:this.V}),n)}),1e3*i);this.Z.set(t.id,o)},this.j=t=>{var{shadow:e,isNewlyCreated:r}=Vu(t,this._posthog);r&&Vs(uc(Uc,{posthog:this._posthog,survey:t},t.id),e)},this.Y=t=>{this.G(t);var e=this.$.get(t.id);e&&(e.element.removeEventListener("click",e.listener),e.element.removeAttribute(Bc),this.$.delete(t.id),ka.info("Removed click listener for survey "+t.id))},this.W=(t,e)=>{var r=Lc.querySelector(e),i=this.$.get(t.id);if(r){if(this.j(t),i){if(r===i.element)return;ka.info("Selector element changed for survey "+t.id+". Re-attaching listener."),this.Y(t)}if(!r.hasAttribute(Bc)){var n=e=>{var r,i;e.stopPropagation();var n=(null==(r=t.appearance)?void 0:r.position)===ma.NextToTrigger?function(t,e){try{var r=t.getBoundingClientRect(),i=Pc.innerHeight,n=Pc.innerWidth,o=$c,s=r.left+r.width/2-e/2;s+e>n-qc&&(s=n-e-qc),s<qc&&(s=qc);var a=Hc,l=i-r.bottom,u=r.top,c=l<o&&u>l;return{position:"fixed",top:c?"auto":r.bottom+a+"px",left:s+"px",right:"auto",bottom:c?i-r.top+a+"px":"auto",zIndex:Zu.zIndex}}catch(t){return ka.warn("Failed to calculate trigger position:",t),null}}(e.currentTarget,parseInt((null==(i=t.appearance)?void 0:i.maxWidth)||Zu.maxWidth)):{};Pc.dispatchEvent(new CustomEvent(Dc,{detail:{surveyId:t.id,position:n}}))};Sn(r,"click",n),r.setAttribute(Bc,"true"),this.$.set(t.id,{element:r,listener:n,survey:t}),ka.info("Attached click listener for feedback button survey "+t.id)}}else i&&this.Y(t)},this.renderPopover=t=>{var{shadow:e}=Vu(t,this._posthog);Vs(uc(Wc,{posthog:this._posthog,survey:t,removeSurveyFromFocus:this.V}),e)},this.renderSurvey=(t,e)=>{Vs(uc(Wc,{posthog:this._posthog,survey:t,removeSurveyFromFocus:this.V,isPopup:!1}),e)},this.getActiveMatchingSurveys=function(t,r){var i;void 0===r&&(r=!1),null==(i=e._posthog)||i.surveys.getSurveys((r=>{var i=r.filter((t=>e.checkSurveyEligibility(t).eligible&&e.U(t)&&e.X(t)&&e.J(t)));t(i)}),r)},this.callSurveysAndEvaluateDisplayLogic=function(t){void 0===t&&(t=!1),e.getActiveMatchingSurveys((t=>{var r=t.filter((t=>t.type===ya.Popover||t.type===ya.Widget)),i=e.K(r),n=new Set;i.forEach((t=>{if(t.type===ya.Widget){var r,i,o,s;if((null==(r=t.appearance)?void 0:r.widgetType)===ga.Tab)return void e.j(t);if((null==(i=t.appearance)?void 0:i.widgetType)===ga.Selector&&null!=(o=t.appearance)&&o.widgetSelector)n.add(t.id),e.W(t,null==(s=t.appearance)?void 0:s.widgetSelector)}ei(e.tt)&&t.type===ya.Popover&&e.handlePopoverSurvey(t)})),e.$.forEach((t=>{var{survey:r}=t;n.has(r.id)||e.Y(r)}))}),t)},this.H=t=>{ei(this.tt)||ka.error("Survey "+this.tt+" already in focus. Cannot add survey "+t.id+"."),this.tt=t.id},this.V=t=>{this.tt!==t.id&&ka.error("Survey "+t.id+" is not in focus. Cannot remove survey "+t.id+"."),this.q(t.id),this.tt=null,this.G(t)},this._posthog=t,this.tt=null}q(t){var e=this.Z.get(t);e&&(clearTimeout(e),this.Z.delete(t))}K(t){return t.sort(((t,e)=>{var r,i,n=oc(t),o=oc(e);if(n&&!o)return-1;if(!n&&o)return 1;var s=t.schedule===_a.Always,a=e.schedule===_a.Always;return s&&!a?1:!s&&a?-1:((null==(r=t.appearance)?void 0:r.surveyPopupDelaySeconds)||0)-((null==(i=e.appearance)?void 0:i.surveyPopupDelaySeconds)||0)}))}et(t,e){if(void 0===e&&(e=void 0),!t)return!0;var r=!!this._posthog.featureFlags.isFeatureEnabled(t,{send_event:!t.startsWith("survey-targeting-")}),i=!0;e&&(i=this._posthog.featureFlags.getFeatureFlag(t,{send_event:!1})===e||"any"===e);return r&&i}U(t){return!t.conditions||ec(t)&&function(t){var e,r,i;if(null==(e=t.conditions)||!e.deviceTypes||0===(null==(r=t.conditions)?void 0:r.deviceTypes.length))return!0;if(!rn)return!1;var n=$l(rn);return Ru[tc(null==(i=t.conditions)?void 0:i.deviceTypesMatchType)](t.conditions.deviceTypes,[n])}(t)&&function(t){var e;return null==(e=t.conditions)||!e.selector||!(null==Lu||!Lu.querySelector(t.conditions.selector))}(t)}rt(t){return Xu(t)||this.et(t.internal_targeting_flag_key)||oc(t)}checkSurveyEligibility(t){var e,r,i={eligible:!0,reason:void 0};if(!xa(t))return i.eligible=!1,i.reason="Survey is not running. It was completed on "+t.end_date,i;if(!Oa.includes(t.type))return i.eligible=!1,i.reason="Surveys of type "+t.type+" are never eligible to be shown in the app",i;var n=null==(e=t.conditions)?void 0:e.linkedFlagVariant;return this.et(t.linked_flag_key,n)?this.et(t.targeting_flag_key)?this.rt(t)?(t=>{var e=localStorage.getItem("lastSeenSurveyDate");if(!t||!e)return!0;var r=new Date,i=Math.abs(r.getTime()-new Date(e).getTime());return Math.ceil(i/864e5)>t})(null==(r=t.conditions)?void 0:r.seenSurveyWaitPeriodInDays)?(t=>!!localStorage.getItem(Ra(t))&&!Xu(t))(t)?(i.eligible=!1,i.reason="Survey has already been seen and it can't be activated again",i):i:(i.eligible=!1,i.reason="Survey wait period has not passed",i):(i.eligible=!1,i.reason="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)}X(t){var e;if(!Aa(t)&&!Ta(t))return!0;var r=null==(e=this._posthog.surveys._surveyEventReceiver)?void 0:e.getSurveys();return!(null==r||!r.includes(t.id))}J(t){var e;return null==(e=t.feature_flag_keys)||!e.length||t.feature_flag_keys.every((t=>{var{key:e,value:r}=t;return!e||!r||this.et(r)}))}G(t){try{var e=Lc.querySelector(ac(t,!0));null!=e&&e.shadowRoot&&Vs(null,e.shadowRoot),null==e||e.remove()}catch(e){ka.warn("Failed to remove survey "+t.id+" from DOM:",e)}}getTestAPI(){return{addSurveyToFocus:this.H,removeSurveyFromFocus:this.V,surveyInFocus:this.tt,surveyTimeouts:this.Z,handleWidget:this.j,handlePopoverSurvey:this.handlePopoverSurvey,manageWidgetSelectorListener:this.W,sortSurveysByAppearanceDelay:this.K,checkFlags:this.J.bind(this),isSurveyFeatureFlagEnabled:this.et.bind(this)}}}function jc(t,e){if(Lc&&Pc){var r=new Vc(t);return t.config.disable_surveys_automatic_display?(ka.info("Surveys automatic display is disabled. Skipping call surveys and evaluate display logic."),r):!1===e?(ka.info("There are no surveys to load or Surveys is disabled in the project settings."),r):(r.callSurveysAndEvaluateDisplayLogic(!0),setInterval((()=>{r.callSurveysAndEvaluateDisplayLogic(!1)}),1e3),r)}}function Yc(t){var{survey:e,removeSurveyFromFocus:r=(()=>{}),setSurveyVisible:i,isPreviewMode:n=!1}=t;oa((()=>{var t;if(!n&&null!=(t=e.conditions)&&t.url){var o=()=>{var t,n=e.type===ya.Widget,o=ec(e),s=(null==(t=e.appearance)?void 0:t.widgetType)===ga.Tab&&n;if(!o)return ka.info("Hiding survey "+e.id+" because URL does not match"),i(!1),r(e);s&&(ka.info("Showing survey "+e.id+" because it is a feedback button tab and URL matches"),i(!0))};Sn(Pc,"popstate",o),Sn(Pc,"hashchange",o);var s=Pc.history.pushState,a=Pc.history.replaceState;return Pc.history.pushState=function(){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];s.apply(this,e),o()},Pc.history.replaceState=function(){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];a.apply(this,e),o()},()=>{Pc.removeEventListener("popstate",o),Pc.removeEventListener("hashchange",o),Pc.history.pushState=s,Pc.history.replaceState=a}}}),[n,e,r,i])}function Gc(t,e,r){if(void 0===e&&(e=ma.Right),t===ya.ExternalSurvey)return{};switch(e){case ma.TopLeft:return{top:"0",left:"0",transform:"translate(30px, 30px)"};case ma.TopRight:return{top:"0",right:"0",transform:"translate(-30px, 30px)"};case ma.TopCenter:return{top:"0",left:"50%",transform:"translate(-50%, 30px)"};case ma.MiddleLeft:return{top:"50%",left:"0",transform:"translate(30px, -50%)"};case ma.MiddleRight:return{top:"50%",right:"0",transform:"translate(-30px, -50%)"};case ma.MiddleCenter:return{top:"50%",left:"50%",transform:"translate(-50%, -50%)"};case ma.Left:return{left:"30px"};case ma.Center:return{left:"50%",transform:"translateX(-50%)"};default:case ma.Right:return{right:t===ya.Widget&&r===ga.Tab?"60px":"30px"}}}function Wc(t){var e,i,n,o,s,a,{survey:l,forceDisableHtml:u,posthog:c,style:h={},previewPageIndex:d,removeSurveyFromFocus:v=(()=>{}),isPopup:f=!0,onPreviewSubmit:p=(()=>{}),onPopupSurveyDismissed:g=(()=>{}),onCloseConfirmationMessage:m=(()=>{})}=t,y=sa(null),b=Number.isInteger(d),w=null!=(e=l.appearance)&&e.surveyPopupDelaySeconds?1e3*l.appearance.surveyPopupDelaySeconds:0,{isPopupVisible:_,isSurveySent:C,hidePopupWithViewTransition:I}=function(t,e,r,i,n,o){var[s,a]=na(i||0===r||t.type===ya.ExternalSurvey),[l,u]=na(!1),c=()=>{var e=()=>{t.type===ya.Popover&&n(t),a(!1)};Lc.startViewTransition?Lc.startViewTransition((()=>{var t;null==o||null==(t=o.current)||t.remove()})).finished.then((()=>{setTimeout((()=>{e()}),100)})):e()},h=e=>{e.detail.surveyId===t.id&&c()};return oa((()=>{if(e){if(!i){var n=e=>{var r,i;if(e.detail.surveyId===t.id){if(null==(r=t.appearance)||!r.displayThankYouMessage)return c();u(!0),null!=(i=t.appearance)&&i.autoDisappear&&setTimeout((()=>{c()}),5e3)}},o=()=>{ec(t)&&(a(!0),Pc.dispatchEvent(new Event("PHSurveyShown")),e.capture(Ca.SHOWN,{[Ia.SURVEY_NAME]:t.name,[Ia.SURVEY_ID]:t.id,[Ia.SURVEY_ITERATION]:t.current_iteration,[Ia.SURVEY_ITERATION_START_DATE]:t.current_iteration_start_date,sessionRecordingUrl:null==e.get_session_replay_url?void 0:e.get_session_replay_url()}),localStorage.setItem("lastSeenSurveyDate",(new Date).toISOString()))};if(Sn(Pc,"PHSurveyClosed",h),Sn(Pc,"PHSurveySent",n),r>0){var s=setTimeout(o,r);return()=>{clearTimeout(s),Pc.removeEventListener("PHSurveyClosed",h),Pc.removeEventListener("PHSurveySent",n)}}return o(),()=>{Pc.removeEventListener("PHSurveyClosed",h),Pc.removeEventListener("PHSurveySent",n)}}}else ka.error("usePopupVisibility hook called without a PostHog instance.")}),[]),Yc({survey:t,removeSurveyFromFocus:n,setSurveyVisible:a,isPreviewMode:i}),{isPopupVisible:s,isSurveySent:l,setIsPopupVisible:a,hidePopupWithViewTransition:c}}(l,c,w,b,v,y),S=C||d===l.questions.length,k=aa((()=>{var t=nc(l);return{isPreviewMode:b,previewPageIndex:d,onPopupSurveyDismissed:()=>{Gu(l,c,b),g()},isPopup:f||!1,surveySubmissionId:(null==t?void 0:t.surveySubmissionId)||Ha(),onPreviewSubmit:p,posthog:c}}),[b,d,f,c,l,g,p]);return _?uc(Ju.Provider,{value:k,children:uc("div",{className:"ph-survey",style:r({},Gc(l.type,null==(i=l.appearance)?void 0:i.position,null==(n=l.appearance)?void 0:n.widgetType),h),ref:y,children:S?uc(Cc,{header:(null==(o=l.appearance)?void 0:o.thankYouMessageHeader)||"Thank you!",description:(null==(s=l.appearance)?void 0:s.thankYouMessageDescription)||"",forceDisableHtml:!!u,contentType:null==(a=l.appearance)?void 0:a.thankYouMessageDescriptionContentType,appearance:l.appearance||Zu,onClose:()=>{I(),m()}}):uc(zc,{survey:l,forceDisableHtml:!!u,posthog:c})})}):null}function zc(t){var{survey:e,forceDisableHtml:i,posthog:n}=t,[o,s]=na((()=>{var t=nc(e);return null!=t&&t.responses&&ka.info("Survey is already in progress, filling in initial responses"),(null==t?void 0:t.responses)||{}})),{previewPageIndex:a,onPopupSurveyDismissed:l,isPopup:u,onPreviewSubmit:c,surveySubmissionId:h,isPreviewMode:d}=la(Ju),[v,f]=na((()=>{var t=nc(e);return a||(null==t?void 0:t.lastQuestionIndex)||0})),p=aa((()=>Uu(e)),[e]);oa((()=>{d&&!Kr(a)&&f(a)}),[a,d]);var g=p.at(v);return g?uc("form",{className:"survey-form",name:"surveyForm",children:[u&&uc(wc,{onClick:()=>{l()}}),uc("div",{className:"survey-box",children:Xc({question:g,forceDisableHtml:i,displayQuestionIndex:v,appearance:e.appearance||Zu,onSubmit:t=>(t=>{var{res:i,displayQuestionIndex:a,questionId:l}=t;if(n)if(l){var u=Du(l),c=r({},o,{[u]:i});s(c);var d=Zc(e,a,i),v=d===wa.End;v||(f(d),ic(e,{surveySubmissionId:h,responses:c,lastQuestionIndex:d})),(e.enable_partial_responses||v)&&Yu({responses:c,survey:e,surveySubmissionId:h,isSurveyCompleted:v,posthog:n})}else ka.error("onNextButtonClick called without a questionId.");else ka.error("onNextButtonClick called without a PostHog instance.")})({res:t,displayQuestionIndex:v,questionId:g.id}),onPreviewSubmit:c,initialValue:g.id?o[Du(g.id)]:void 0})})]}):null}function Uc(t){var e,r,i,n,o,{survey:s,forceDisableHtml:a,posthog:l,readOnly:u}=t,[c,h]=na(!0),[d,v]=na(!1),[f,p]=na({}),g=()=>{v(!d)};if(oa((()=>{var t;if(l){if(!u){"tab"===(null==(t=s.appearance)?void 0:t.widgetType)&&p({top:"50%",bottom:"auto"});var e=t=>{var e,r=t;(null==(e=r.detail)?void 0:e.surveyId)===s.id&&(ka.info("Received show event for feedback button survey "+s.id),p(r.detail.position||{}),g())};return Sn(Pc,Dc,e),()=>{Pc.removeEventListener(Dc,e)}}}else ka.error("FeedbackWidget called without a PostHog instance.")}),[l,u,s.id,null==(e=s.appearance)?void 0:e.widgetType,null==(r=s.appearance)?void 0:r.widgetSelector,null==(i=s.appearance)?void 0:i.borderColor]),Yc({survey:s,setSurveyVisible:h}),!c)return null;var m=()=>{s.schedule!==_a.Always&&h(!1),setTimeout((()=>{v(!1)}),200)};return uc(ks,{children:["tab"===(null==(n=s.appearance)?void 0:n.widgetType)&&uc("button",{className:"ph-survey-widget-tab",onClick:g,disabled:u,children:(null==(o=s.appearance)?void 0:o.widgetLabel)||""}),d&&uc(Wc,{posthog:l,survey:s,forceDisableHtml:a,style:f,onPopupSurveyDismissed:m,onCloseConfirmationMessage:m})]})}var Xc=t=>{var{question:e,forceDisableHtml:i,displayQuestionIndex:n,appearance:o,onSubmit:s,onPreviewSubmit:a,initialValue:l}=t,u={forceDisableHtml:i,appearance:o,onPreviewSubmit:t=>{a(t)},onSubmit:t=>{s(t)},initialValue:l,displayQuestionIndex:n};switch(e.type){case ba.Open:return Is(Sc,r({},u,{question:e,key:e.id}));case ba.Link:return Is(kc,r({},u,{question:e,key:e.id}));case ba.Rating:return Is(xc,r({},u,{question:e,key:e.id}));case ba.SingleChoice:case ba.MultipleChoice:return Is(Tc,r({},u,{question:e,key:e.id}));default:return ka.error("Unsupported question type: "+e.type),null}};nn.__PosthogExtensions__=nn.__PosthogExtensions__||{},nn.__PosthogExtensions__.generateSurveys=jc,nn.extendPostHogWithSurveys=jc;var Jc=cn("[Error tracking]");function Kc(){return new Fi([new Oi,new ji,new Li,new Pi,new Hi,new qi,new Bi,new Vi],[xi,Mi])}class Qc{constructor(t){var e,r;this.it=[],this.nt=Kc(),this._instance=t,this.it=null!==(e=null==(r=this._instance.persistence)?void 0:r.get_property(Bn))&&void 0!==e?e:[]}onRemoteConfig(t){var e,r,i,n=null!==(e=null==(r=t.errorTracking)?void 0:r.suppressionRules)&&void 0!==e?e:[],o=null==(i=t.errorTracking)?void 0:i.captureExtensionExceptions;this.it=n,this._instance.persistence&&this._instance.persistence.register({[Bn]:this.it,[Zn]:o})}get ot(){var t,e=!!this._instance.get_property(Zn),r=this._instance.config.error_tracking.captureExtensionExceptions;return null!==(t=null!=r?r:e)&&void 0!==t&&t}buildProperties(t,e){return this.nt.buildFromUnknown(t,{syntheticException:null==e?void 0:e.syntheticException,mechanism:{handled:null==e?void 0:e.handled}})}sendExceptionEvent(t){if(this.st(t))Jc.info("Skipping exception capture because a suppression rule matched");else{if(this.ot||!this.lt(t))return this._instance.capture("$exception",t,{_noTruncate:!0,_batchKey:"exceptionEvent"});Jc.info("Skipping exception capture because it was thrown by an extension")}}st(t){var e=t.$exception_list;if(!e||!Wr(e)||0===e.length)return!1;var r=e.reduce(((t,e)=>{var{type:r,value:i}=e;return Qr(r)&&r.length>0&&t.$exception_types.push(r),Qr(i)&&i.length>0&&t.$exception_values.push(i),t}),{$exception_types:[],$exception_values:[]});return this.it.some((t=>{var e=t.values.map((t=>{var e,i=Ru[t.operator],n=Wr(t.value)?t.value:[t.value],o=null!==(e=r[t.key])&&void 0!==e?e:[];return n.length>0&&i(n,o)}));return"OR"===t.type?e.some(Boolean):e.every(Boolean)}))}lt(t){var e=t.$exception_list;if(!e||!Wr(e))return!1;var r=e.flatMap((t=>{var e,r;return null!==(e=null==(r=t.stacktrace)?void 0:r.frames)&&void 0!==e?e:[]}));return r.some((t=>t.filename&&t.filename.startsWith("chrome-extension://")))}}var th=cn("[ExceptionAutocapture]"),eh=Kc();function rh(t){var{event:e,error:r}=t;return eh.buildFromUnknown(r||e,{mechanism:{handled:!1}})}var ih={wrapOnError:t=>{var e=Yi;e||th.info("window not available, cannot wrap onerror");var r=e.onerror;return e.onerror=function(){for(var e,i=arguments.length,n=new Array(i),o=0;o<i;o++)n[o]=arguments[o];var s=rh({event:n[0],error:n[4]});return t(s),null!==(e=null==r?void 0:r(...n))&&void 0!==e&&e},e.onerror.__POSTHOG_INSTRUMENTED__=!0,()=>{var t;null==(t=e.onerror)||delete t.__POSTHOG_INSTRUMENTED__,e.onerror=r}},wrapUnhandledRejection:t=>{var e=Yi;e||th.info("window not available, cannot wrap onUnhandledRejection");var r=e.onunhandledrejection;return e.onunhandledrejection=function(i){var n,o=rh({event:i});return t(o),null!==(n=null==r?void 0:r.apply(e,[i]))&&void 0!==n&&n},e.onunhandledrejection.__POSTHOG_INSTRUMENTED__=!0,()=>{var t;null==(t=e.onunhandledrejection)||delete t.__POSTHOG_INSTRUMENTED__,e.onunhandledrejection=r}},wrapConsoleError:t=>{var e=console;e||th.info("console not available, cannot wrap console.error");var r=e.error;return e.error=function(){for(var e=arguments.length,i=new Array(e),n=0;n<e;n++)i[n]=arguments[n];var o=i.join(" "),s=rh({error:i.find((t=>t instanceof Error)),event:o});return t(s),null==r?void 0:r(...i)},e.error.__POSTHOG_INSTRUMENTED__=!0,()=>{var t;null==(t=e.error)||delete t.__POSTHOG_INSTRUMENTED__,e.error=r}}};nn.__PosthogExtensions__=nn.__PosthogExtensions__||{},nn.__PosthogExtensions__.errorWrappingFunctions=ih,nn.posthogErrorWrappingFunctions=ih;var nh=(t,e,r,i)=>{var n;try{n=new URL(i.url).hostname}catch(t){return}if(!Wr(t)||t.includes(n)){if(r){var{sessionId:o,windowId:s}=r.checkAndGetSessionAndWindowId(!0);i.headers.set("X-POSTHOG-SESSION-ID",o),i.headers.set("X-POSTHOG-WINDOW-ID",s)}e!==lo&&i.headers.set("X-POSTHOG-DISTINCT-ID",e)}};nn.__PosthogExtensions__=nn.__PosthogExtensions__||{};var oh={_patchFetch:(t,r,i)=>En(Yi,"fetch",(n=>function(){var o=e((function*(e,o){var s=new Request(e,o);return nh(t,r,i,s),n(s)}));return function(t,e){return o.apply(this,arguments)}}())),_patchXHR:(t,e,r)=>En(Yi.XMLHttpRequest.prototype,"open",(i=>function(n,o,s,a,l){void 0===s&&(s=!0);var u=new Request(o);return nh(t,e,r,u),i.call(this,n,u.url,s,a,l)}))};nn.__PosthogExtensions__.tracingHeadersPatchFns=oh,nn.postHogTracingHeadersPatchFns=oh;var sh,ah,lh=function(){var t=self.performance&&performance.getEntriesByType&&performance.getEntriesByType("navigation")[0];if(t&&t.responseStart>0&&t.responseStart<performance.now())return t},uh=function(t){if("loading"===document.readyState)return"loading";var e=lh();if(e){if(t<e.domInteractive)return"loading";if(0===e.domContentLoadedEventStart||t<e.domContentLoadedEventStart)return"dom-interactive";if(0===e.domComplete||t<e.domComplete)return"dom-content-loaded"}return"complete"},ch=function(t){var e=t.nodeName;return 1===t.nodeType?e.toLowerCase():e.toUpperCase().replace(/^#/,"")},hh=function(t,e){var r="";try{for(;t&&9!==t.nodeType;){var i=t,n=i.id?"#"+i.id:ch(i)+(i.classList&&i.classList.value&&i.classList.value.trim()&&i.classList.value.trim().length?"."+i.classList.value.trim().replace(/\s+/g,"."):"");if(r.length+n.length>(e||100)-1)return r||n;if(r=r?n+">"+r:n,i.id)break;t=i.parentNode}}catch(t){}return r},dh=-1,vh=function(){return dh},fh=function(t){addEventListener("pageshow",(function(e){e.persisted&&(dh=e.timeStamp,t(e))}),!0)},ph=function(){var t=lh();return t&&t.activationStart||0},gh=function(t,e){var r=lh(),i="navigate";return vh()>=0?i="back-forward-cache":r&&(document.prerendering||ph()>0?i="prerender":document.wasDiscarded?i="restore":r.type&&(i=r.type.replace(/_/g,"-"))),{name:t,value:void 0===e?-1:e,rating:"good",delta:0,entries:[],id:"v4-".concat(Date.now(),"-").concat(Math.floor(8999999999999*Math.random())+1e12),navigationType:i}},mh=function(t,e,r){try{if(PerformanceObserver.supportedEntryTypes.includes(t)){var i=new PerformanceObserver((function(t){Promise.resolve().then((function(){e(t.getEntries())}))}));return i.observe(Object.assign({type:t,buffered:!0},r||{})),i}}catch(t){}},yh=function(t,e,r,i){var n,o;return function(s){e.value>=0&&(s||i)&&((o=e.value-(n||0))||void 0===n)&&(n=e.value,e.delta=o,e.rating=function(t,e){return t>e[1]?"poor":t>e[0]?"needs-improvement":"good"}(e.value,r),t(e))}},bh=function(t){requestAnimationFrame((function(){return requestAnimationFrame((function(){return t()}))}))},wh=function(t){document.addEventListener("visibilitychange",(function(){"hidden"===document.visibilityState&&t()}))},_h=function(t){var e=!1;return function(){e||(t(),e=!0)}},Ch=-1,Ih=function(){return"hidden"!==document.visibilityState||document.prerendering?1/0:0},Sh=function(t){"hidden"===document.visibilityState&&Ch>-1&&(Ch="visibilitychange"===t.type?t.timeStamp:0,xh())},kh=function(){addEventListener("visibilitychange",Sh,!0),addEventListener("prerenderingchange",Sh,!0)},xh=function(){removeEventListener("visibilitychange",Sh,!0),removeEventListener("prerenderingchange",Sh,!0)},Ah=function(){return Ch<0&&(Ch=Ih(),kh(),fh((function(){setTimeout((function(){Ch=Ih(),kh()}),0)}))),{get firstHiddenTime(){return Ch}}},Th=function(t){document.prerendering?addEventListener("prerenderingchange",(function(){return t()}),!0):t()},Mh=[1800,3e3],Eh=function(t,e){e=e||{},Th((function(){var r,i=Ah(),n=gh("FCP"),o=mh("paint",(function(t){t.forEach((function(t){"first-contentful-paint"===t.name&&(o.disconnect(),t.startTime<i.firstHiddenTime&&(n.value=Math.max(t.startTime-ph(),0),n.entries.push(t),r(!0)))}))}));o&&(r=yh(t,n,Mh,e.reportAllChanges),fh((function(i){n=gh("FCP"),r=yh(t,n,Mh,e.reportAllChanges),bh((function(){n.value=performance.now()-i.timeStamp,r(!0)}))})))}))},Nh=[.1,.25],Rh=0,Fh=1/0,Oh=0,Ph=function(t){t.forEach((function(t){t.interactionId&&(Fh=Math.min(Fh,t.interactionId),Oh=Math.max(Oh,t.interactionId),Rh=Oh?(Oh-Fh)/7+1:0)}))},Lh=function(){return sh?Rh:performance.interactionCount||0},Dh=function(){"interactionCount"in performance||sh||(sh=mh("event",Ph,{type:"event",buffered:!0,durationThreshold:0}))},Bh=[],Zh=new Map,$h=0,qh=[],Hh=function(t){if(qh.forEach((function(e){return e(t)})),t.interactionId||"first-input"===t.entryType){var e=Bh[Bh.length-1],r=Zh.get(t.interactionId);if(r||Bh.length<10||t.duration>e.latency){if(r)t.duration>r.latency?(r.entries=[t],r.latency=t.duration):t.duration===r.latency&&t.startTime===r.entries[0].startTime&&r.entries.push(t);else{var i={id:t.interactionId,latency:t.duration,entries:[t]};Zh.set(i.id,i),Bh.push(i)}Bh.sort((function(t,e){return e.latency-t.latency})),Bh.length>10&&Bh.splice(10).forEach((function(t){return Zh.delete(t.id)}))}}},Vh=function(t){var e=self.requestIdleCallback||self.setTimeout,r=-1;return t=_h(t),"hidden"===document.visibilityState?t():(r=e(t),wh(t)),r},jh=[200,500],Yh=function(t,e){"PerformanceEventTiming"in self&&"interactionId"in PerformanceEventTiming.prototype&&(e=e||{},Th((function(){var r;Dh();var i,n=gh("INP"),o=function(t){Vh((function(){t.forEach(Hh);var e=function(){var t=Math.min(Bh.length-1,Math.floor((Lh()-$h)/50));return Bh[t]}();e&&e.latency!==n.value&&(n.value=e.latency,n.entries=e.entries,i())}))},s=mh("event",o,{durationThreshold:null!==(r=e.durationThreshold)&&void 0!==r?r:40});i=yh(t,n,jh,e.reportAllChanges),s&&(s.observe({type:"first-input",buffered:!0}),wh((function(){o(s.takeRecords()),i(!0)})),fh((function(){$h=Lh(),Bh.length=0,Zh.clear(),n=gh("INP"),i=yh(t,n,jh,e.reportAllChanges)})))})))},Gh=[],Wh=[],zh=0,Uh=new WeakMap,Xh=new Map,Jh=-1,Kh=function(t){Gh=Gh.concat(t),Qh()},Qh=function(){Jh<0&&(Jh=Vh(td))},td=function(){Xh.size>10&&Xh.forEach((function(t,e){Zh.has(e)||Xh.delete(e)}));var t=Bh.map((function(t){return Uh.get(t.entries[0])})),e=Wh.length-50;Wh=Wh.filter((function(r,i){return i>=e||t.includes(r)}));for(var r=new Set,i=0;i<Wh.length;i++){var n=Wh[i];ed(n.startTime,n.processingEnd).forEach((function(t){r.add(t)}))}var o=Gh.length-1-50;Gh=Gh.filter((function(t,e){return t.startTime>zh&&e>o||r.has(t)})),Jh=-1};qh.push((function(t){t.interactionId&&t.target&&!Xh.has(t.interactionId)&&Xh.set(t.interactionId,t.target)}),(function(t){var e,r=t.startTime+t.duration;zh=Math.max(zh,t.processingEnd);for(var i=Wh.length-1;i>=0;i--){var n=Wh[i];if(Math.abs(r-n.renderTime)<=8){(e=n).startTime=Math.min(t.startTime,e.startTime),e.processingStart=Math.min(t.processingStart,e.processingStart),e.processingEnd=Math.max(t.processingEnd,e.processingEnd),e.entries.push(t);break}}e||(e={startTime:t.startTime,processingStart:t.processingStart,processingEnd:t.processingEnd,renderTime:r,entries:[t]},Wh.push(e)),(t.interactionId||"first-input"===t.entryType)&&Uh.set(t,e),Qh()}));var ed=function(t,e){for(var r,i=[],n=0;r=Gh[n];n++)if(!(r.startTime+r.duration<t)){if(r.startTime>e)break;i.push(r)}return i},rd=[2500,4e3],id={},nd={onLCP:function(t,e){!function(t,e){e=e||{},Th((function(){var r,i=Ah(),n=gh("LCP"),o=function(t){e.reportAllChanges||(t=t.slice(-1)),t.forEach((function(t){t.startTime<i.firstHiddenTime&&(n.value=Math.max(t.startTime-ph(),0),n.entries=[t],r())}))},s=mh("largest-contentful-paint",o);if(s){r=yh(t,n,rd,e.reportAllChanges);var a=_h((function(){id[n.id]||(o(s.takeRecords()),s.disconnect(),id[n.id]=!0,r(!0))}));["keydown","click"].forEach((function(t){addEventListener(t,(function(){return Vh(a)}),{once:!0,capture:!0})})),wh(a),fh((function(i){n=gh("LCP"),r=yh(t,n,rd,e.reportAllChanges),bh((function(){n.value=performance.now()-i.timeStamp,id[n.id]=!0,r(!0)}))}))}}))}((function(e){var r=function(t){var e={timeToFirstByte:0,resourceLoadDelay:0,resourceLoadDuration:0,elementRenderDelay:t.value};if(t.entries.length){var r=lh();if(r){var i=r.activationStart||0,n=t.entries[t.entries.length-1],o=n.url&&performance.getEntriesByType("resource").filter((function(t){return t.name===n.url}))[0],s=Math.max(0,r.responseStart-i),a=Math.max(s,o?(o.requestStart||o.startTime)-i:0),l=Math.max(a,o?o.responseEnd-i:0),u=Math.max(l,n.startTime-i);e={element:hh(n.element),timeToFirstByte:s,resourceLoadDelay:a-s,resourceLoadDuration:l-a,elementRenderDelay:u-l,navigationEntry:r,lcpEntry:n},n.url&&(e.url=n.url),o&&(e.lcpResourceEntry=o)}}return Object.assign(t,{attribution:e})}(e);t(r)}),e)},onCLS:function(t,e){!function(t,e){e=e||{},Eh(_h((function(){var r,i=gh("CLS",0),n=0,o=[],s=function(t){t.forEach((function(t){if(!t.hadRecentInput){var e=o[0],r=o[o.length-1];n&&t.startTime-r.startTime<1e3&&t.startTime-e.startTime<5e3?(n+=t.value,o.push(t)):(n=t.value,o=[t])}})),n>i.value&&(i.value=n,i.entries=o,r())},a=mh("layout-shift",s);a&&(r=yh(t,i,Nh,e.reportAllChanges),wh((function(){s(a.takeRecords()),r(!0)})),fh((function(){n=0,i=gh("CLS",0),r=yh(t,i,Nh,e.reportAllChanges),bh((function(){return r()}))})),setTimeout(r,0))})))}((function(e){var r=function(t){var e,r={};if(t.entries.length){var i=t.entries.reduce((function(t,e){return t&&t.value>e.value?t:e}));if(i&&i.sources&&i.sources.length){var n=(e=i.sources).find((function(t){return t.node&&1===t.node.nodeType}))||e[0];n&&(r={largestShiftTarget:hh(n.node),largestShiftTime:i.startTime,largestShiftValue:i.value,largestShiftSource:n,largestShiftEntry:i,loadState:uh(i.startTime)})}}return Object.assign(t,{attribution:r})}(e);t(r)}),e)},onFCP:function(t,e){Eh((function(e){var r=function(t){var e={timeToFirstByte:0,firstByteToFCP:t.value,loadState:uh(vh())};if(t.entries.length){var r=lh(),i=t.entries[t.entries.length-1];if(r){var n=r.activationStart||0,o=Math.max(0,r.responseStart-n);e={timeToFirstByte:o,firstByteToFCP:t.value-o,loadState:uh(t.entries[0].startTime),navigationEntry:r,fcpEntry:i}}}return Object.assign(t,{attribution:e})}(e);t(r)}),e)},onINP:function(t,e){ah||(ah=mh("long-animation-frame",Kh)),Yh((function(e){var r=function(t){var e=t.entries[0],r=Uh.get(e),i=e.processingStart,n=r.processingEnd,o=r.entries.sort((function(t,e){return t.processingStart-e.processingStart})),s=ed(e.startTime,n),a=t.entries.find((function(t){return t.target})),l=a&&a.target||Xh.get(e.interactionId),u=[e.startTime+e.duration,n].concat(s.map((function(t){return t.startTime+t.duration}))),c=Math.max.apply(Math,u),h={interactionTarget:hh(l),interactionTargetElement:l,interactionType:e.name.startsWith("key")?"keyboard":"pointer",interactionTime:e.startTime,nextPaintTime:c,processedEventEntries:o,longAnimationFrameEntries:s,inputDelay:i-e.startTime,processingDuration:n-i,presentationDelay:Math.max(c-n,0),loadState:uh(e.startTime)};return Object.assign(t,{attribution:h})}(e);t(r)}),e)}};nn.__PosthogExtensions__=nn.__PosthogExtensions__||{},nn.__PosthogExtensions__.postHogWebVitalsCallbacks=nd,nn.postHogWebVitalsCallbacks=nd;class od{constructor(){this.clicks=[]}isRageClick(t,e,r){var i=this.clicks[this.clicks.length-1];if(i&&Math.abs(t-i.x)+Math.abs(e-i.y)<30&&r-i.timestamp<1e3){if(this.clicks.push({x:t,y:e,timestamp:r}),3===this.clicks.length)return!0}else this.clicks=[{x:t,y:e,timestamp:r}];return!1}}var sd=cn("[AutoCapture]");function ad(t,e){return e.length>t?e.slice(0,t)+"...":e}function ld(t){if(t.previousElementSibling)return t.previousElementSibling;var e=t;do{e=e.previousSibling}while(e&&!ho(e));return e}function ud(t,e,r,i){var n=t.tagName.toLowerCase(),o={tag_name:n};Co.indexOf(n)>-1&&!r&&("a"===n.toLowerCase()||"button"===n.toLowerCase()?o.$el_text=ad(1024,Bo(t)):o.$el_text=ad(1024,wo(t)));var s=yo(t);s.length>0&&(o.classes=s.filter((function(t){return""!==t}))),vn(t.attributes,(function(r){var n;if((!Eo(t)||-1!==["name","id","class","aria-label"].indexOf(r.name))&&((null==i||!i.includes(r.name))&&!e&&Do(r.value)&&(n=r.name,!Qr(n)||"_ngcontent"!==n.substring(0,10)&&"_nghost"!==n.substring(0,7)))){var s=r.value;"class"===r.name&&(s=go(s).join(" ")),o["attr__"+r.name]=ad(1024,s)}}));for(var a=1,l=1,u=t;u=ld(u);)a++,u.tagName===t.tagName&&l++;return o.nth_child=a,o.nth_of_type=l,o}function cd(t,e){for(var r,i,{e:n,maskAllElementAttributes:o,maskAllText:s,elementAttributeIgnoreList:a,elementsChainAsString:l}=e,u=[t],c=t;c.parentNode&&!vo(c,"body");)po(c.parentNode)?(u.push(c.parentNode.host),c=c.parentNode.host):(u.push(c.parentNode),c=c.parentNode);var h,d=[],v={},f=!1,p=!1;if(vn(u,(t=>{var e=Mo(t);"a"===t.tagName.toLowerCase()&&(f=t.getAttribute("href"),f=e&&f&&Do(f)&&f),$r(yo(t),"ph-no-capture")&&(p=!0),d.push(ud(t,o,s,a));var r=function(t){if(!Mo(t))return{};var e={};return vn(t.attributes,(function(t){if(t.name&&0===t.name.indexOf("data-ph-capture-attribute")){var r=t.name.replace("data-ph-capture-attribute-",""),i=t.value;r&&i&&Do(i)&&(e[r]=i)}})),e}(t);fn(v,r)})),p)return{props:{},explicitNoCapture:p};if(s||("a"===t.tagName.toLowerCase()||"button"===t.tagName.toLowerCase()?d[0].$el_text=Bo(t):d[0].$el_text=wo(t)),f){var g,m;d[0].attr__href=f;var y=null==(g=kn(f))?void 0:g.host,b=null==Yi||null==(m=Yi.location)?void 0:m.host;y&&b&&y!==b&&(h=f)}return{props:fn({$event_type:n.type,$ce_version:1},l?{}:{$elements:d},{$elements_chain:$o(d)},null!=(r=d[0])&&r.$el_text?{$el_text:null==(i=d[0])?void 0:i.$el_text}:{},h&&"click"===n.type?{$external_click_url:h}:{},v)}}class hd{constructor(t){this.ut=!1,this.ct=null,this.rageclicks=new od,this.ht=!1,this.instance=t,this.dt=null}get vt(){var t,e,r=Xr(this.instance.config.autocapture)?this.instance.config.autocapture:{};return r.url_allowlist=null==(t=r.url_allowlist)?void 0:t.map((t=>new RegExp(t))),r.url_ignorelist=null==(e=r.url_ignorelist)?void 0:e.map((t=>new RegExp(t))),r}ft(){if(this.isBrowserSupported()){if(Yi&&Ji){var t=t=>{t=t||(null==Yi?void 0:Yi.event);try{this.gt(t)}catch(t){sd.error("Failed to capture event",t)}};if(Sn(Ji,"submit",t,{capture:!0}),Sn(Ji,"change",t,{capture:!0}),Sn(Ji,"click",t,{capture:!0}),this.vt.capture_copied_text){var e=t=>{t=t||(null==Yi?void 0:Yi.event),this.gt(t,ql)};Sn(Ji,"copy",e,{capture:!0}),Sn(Ji,"cut",e,{capture:!0})}}}else sd.info("Disabling Automatic Event Collection because this browser is not supported")}startIfEnabled(){this.isEnabled&&!this.ut&&(this.ft(),this.ut=!0)}onRemoteConfig(t){t.elementsChainAsString&&(this.ht=t.elementsChainAsString),this.instance.persistence&&this.instance.persistence.register({[Pn]:!!t.autocapture_opt_out}),this.ct=!!t.autocapture_opt_out,this.startIfEnabled()}setElementSelectors(t){this.dt=t}getElementSelectors(t){var e,r=[];return null==(e=this.dt)||e.forEach((e=>{var i=null==Ji?void 0:Ji.querySelectorAll(e);null==i||i.forEach((i=>{t===i&&r.push(e)}))})),r}get isEnabled(){var t,e,r=null==(t=this.instance.persistence)?void 0:t.props[Pn],i=this.ct;if(ei(i)&&!ni(r)&&!this.instance.yt())return!1;var n=null!==(e=this.ct)&&void 0!==e?e:!!r;return!!this.instance.config.autocapture&&!n}gt(t,e){if(void 0===e&&(e="$autocapture"),this.isEnabled){var r,i=_o(t);if(fo(i)&&(i=i.parentNode||null),"$autocapture"===e&&"click"===t.type&&t instanceof MouseEvent)this.instance.config.rageclick&&null!=(r=this.rageclicks)&&r.isRageClick(t.clientX,t.clientY,(new Date).getTime())&&function(t,e){if(!Yi||xo(t))return!1;var r,i;if(!1===(r=ni(e)?!!e&&ko:null!==(i=null==e?void 0:e.css_selector_ignorelist)&&void 0!==i?i:ko))return!1;var{targetElementList:n}=Ao(t,!1);return!Io(n,r)}(i,this.instance.config.rageclick)&&this.gt(t,"$rageclick");var n=e===ql;if(i&&To(i,t,this.vt,n,n?["copy","cut"]:void 0)){var{props:o,explicitNoCapture:s}=cd(i,{e:t,maskAllElementAttributes:this.instance.config.mask_all_element_attributes,maskAllText:this.instance.config.mask_all_text,elementAttributeIgnoreList:this.vt.element_attribute_ignorelist,elementsChainAsString:this.ht});if(s)return!1;var a=this.getElementSelectors(i);if(a&&a.length>0&&(o.$element_selectors=a),e===ql){var l,u=bo(null==Yi||null==(l=Yi.getSelection())?void 0:l.toString()),c=t.type||"clipboard";if(!u)return!1;o.$selected_content=u,o.$copy_type=c}return this.instance.capture(e,o),!0}}}isBrowserSupported(){return zr(null==Ji?void 0:Ji.querySelectorAll)}}var dd={};function vd(t){return function(t,e){var r=dd[t];if(r)return r;var i=e[t];if(Ur(i)&&!on())return dd[t]=i.bind(e);var n=e.document;if(n&&zr(n.createElement))try{var o=n.createElement("iframe");o.hidden=!0,n.head.appendChild(o);var s=o.contentWindow;s&&s[t]&&(i=s[t]),n.head.removeChild(o)}catch(e){un.warn("Could not create sandbox iframe for "+t+" check, bailing to assignableWindow."+t+": ",e)}return i&&zr(i)?dd[t]=i.bind(e):i}("MutationObserver",t)}function fd(t,e){return ii(t)&&t>=e}class pd{bt(t){var e,r,i,n,o=this.wt((null==t?void 0:t.__onCapture)||this._t.bind(this));return{element_attribute_ignorelist:null!==(e=null==t?void 0:t.element_attribute_ignorelist)&&void 0!==e?e:o.element_attribute_ignorelist,scroll_threshold_ms:null!==(r=null==t?void 0:t.scroll_threshold_ms)&&void 0!==r?r:o.scroll_threshold_ms,selection_change_threshold_ms:null!==(i=null==t?void 0:t.selection_change_threshold_ms)&&void 0!==i?i:o.selection_change_threshold_ms,mutation_threshold_ms:null!==(n=null==t?void 0:t.mutation_threshold_ms)&&void 0!==n?n:o.mutation_threshold_ms,__onCapture:o.__onCapture}}constructor(t,e){this.Ct=[],this.wt=t=>({element_attribute_ignorelist:[],scroll_threshold_ms:100,selection_change_threshold_ms:100,mutation_threshold_ms:2500,__onCapture:t}),this.It=t=>{var e=function(t){var e=_o(t);return e?{node:e,originalEvent:t,timestamp:Date.now()}:null}(t);ei(e)||this.St(e)||this.Ct.push(e),this.Ct.length&&Kr(this.kt)&&(this.kt=nn.setTimeout((()=>{this.xt()}),1e3))},this.At=()=>{var t=Date.now();t%50==0&&this.Ct.forEach((e=>{Kr(e.scrollDelayMs)&&(e.scrollDelayMs=t-e.timestamp)}))},this.Tt=()=>{this.Mt=Date.now()},this.instance=t,this.vt=this.bt(e),this._onCapture=this.vt.__onCapture}start(t){this.Et(),this.Nt(),this.Rt(),this.Ft(t)}Ft(t){if(!this.Ot){var e=vd(nn);this.Ot=new e((t=>{this.Pt(t)})),this.Ot.observe(t,{attributes:!0,characterData:!0,childList:!0,subtree:!0})}}stop(){var t;null==(t=this.Ot)||t.disconnect(),this.Ot=void 0,nn.removeEventListener("click",this.It),nn.removeEventListener("scroll",this.At,{capture:!0}),nn.removeEventListener("selectionchange",this.Tt)}Pt(t){this.Lt=Date.now()}Et(){Sn(nn,"click",this.It)}Nt(){Sn(nn,"scroll",this.At,{capture:!0})}Rt(){Sn(nn,"selectionchange",this.Tt)}St(t){if(!t)return!0;if(co(t.node))return!0;var e=this.Ct.some((e=>e.node===t.node&&Math.abs(e.timestamp-t.timestamp)<1e3));return!!e||!(!vo(t.node,"html")&&ho(t.node)&&!Co.includes(t.node.tagName.toLowerCase()))}xt(){if(this.Ct.length){clearTimeout(this.kt),this.kt=void 0;var t=this.Ct;for(var e of(this.Ct=[],t)){var r;e.mutationDelayMs=null!==(r=e.mutationDelayMs)&&void 0!==r?r:this.Lt&&e.timestamp<=this.Lt?this.Lt-e.timestamp:void 0,e.absoluteDelayMs=Date.now()-e.timestamp,e.selectionChangedDelayMs=this.Mt&&e.timestamp<=this.Mt?this.Mt-e.timestamp:void 0;var i=fd(e.scrollDelayMs,this.vt.scroll_threshold_ms),n=fd(e.selectionChangedDelayMs,this.vt.selection_change_threshold_ms),o=fd(e.mutationDelayMs,this.vt.mutation_threshold_ms),s=fd(e.absoluteDelayMs,1.1*this.vt.mutation_threshold_ms),a=ii(e.scrollDelayMs)&&e.scrollDelayMs<this.vt.scroll_threshold_ms,l=ii(e.mutationDelayMs)&&e.mutationDelayMs<this.vt.mutation_threshold_ms,u=ii(e.selectionChangedDelayMs)&&e.selectionChangedDelayMs<this.vt.selection_change_threshold_ms;a||l||u||(i||o||s||n?this._onCapture(e,{$dead_click_last_mutation_timestamp:this.Lt,$dead_click_event_timestamp:e.timestamp,$dead_click_scroll_timeout:i,$dead_click_mutation_timeout:o,$dead_click_absolute_timeout:s,$dead_click_selection_changed_timeout:n}):e.absoluteDelayMs<this.vt.mutation_threshold_ms&&this.Ct.push(e))}this.Ct.length&&Kr(this.kt)&&(this.kt=nn.setTimeout((()=>{this.xt()}),1e3))}}_t(t,e){this.instance.capture("$dead_click",r({},e,cd(t.node,{e:t.originalEvent,maskAllElementAttributes:this.instance.config.mask_all_element_attributes,maskAllText:this.instance.config.mask_all_text,elementAttributeIgnoreList:this.vt.element_attribute_ignorelist,elementsChainAsString:!1}).props,{$dead_click_scroll_delay_ms:t.scrollDelayMs,$dead_click_mutation_delay_ms:t.mutationDelayMs,$dead_click_absolute_delay_ms:t.absoluteDelayMs,$dead_click_selection_changed_delay_ms:t.selectionChangedDelayMs}),{timestamp:new Date(t.timestamp)})}}nn.__PosthogExtensions__=nn.__PosthogExtensions__||{},nn.__PosthogExtensions__.initDeadClicksAutocapture=(t,e)=>new pd(t,e);var gd=cn("[ExternalScriptsLoader]"),md=(t,e,r)=>{if(t.config.disable_external_dependency_loading)return gd.warn(e+" was requested but loading of external scripts is disabled."),r("Loading of external scripts is disabled");var i=null==Ji?void 0:Ji.querySelectorAll("script");if(i)for(var n,o=function(){if(i[s].src===e){var t=i[s];return t.__posthog_loading_callback_fired?{v:r()}:(t.addEventListener("load",(e=>{t.__posthog_loading_callback_fired=!0,r(void 0,e)})),t.onerror=t=>r(t),{v:void 0})}},s=0;s<i.length;s++)if(n=o())return n.v;var a=()=>{if(!Ji)return r("document not found");var i=Ji.createElement("script");if(i.type="text/javascript",i.crossOrigin="anonymous",i.src=e,i.onload=t=>{i.__posthog_loading_callback_fired=!0,r(void 0,t)},i.onerror=t=>r(t),t.config.prepare_external_dependency_script&&(i=t.config.prepare_external_dependency_script(i)),!i)return r("prepare_external_dependency_script returned null");var n,o=Ji.querySelectorAll("body > script");o.length>0?null==(n=o[0].parentNode)||n.insertBefore(i,o[0]):Ji.body.appendChild(i)};null!=Ji&&Ji.body?a():null==Ji||Ji.addEventListener("DOMContentLoaded",a)};nn.__PosthogExtensions__=nn.__PosthogExtensions__||{},nn.__PosthogExtensions__.loadExternalDependency=(t,e,r)=>{var i="/static/"+e+".js?v="+t.version;if("remote-config"===e&&(i="/array/"+t.config.token+"/config.js"),"toolbar"===e){var n=3e5;i=i+"&t="+Math.floor(Date.now()/n)*n}var o=t.requestRouter.endpointFor("assets",i);md(t,o,r)},nn.__PosthogExtensions__.loadSiteApp=(t,e,r)=>{var i=t.requestRouter.endpointFor("api",e);md(t,i,r)};var yd="";var bd=/[a-z0-9][a-z0-9-]+\.[a-z]{2,}$/i;function wd(t,e){if(e){var r=function(t,e){if(void 0===e&&(e=Ji),yd)return yd;if(!e)return"";if(["localhost","127.0.0.1"].includes(t))return"";for(var r=t.split("."),i=Math.min(r.length,8),n="dmn_chk_"+Ha();!yd&&i--;){var o=r.slice(i).join("."),s=n+"=1;domain=."+o+";path=/";e.cookie=s+";max-age=3",e.cookie.includes(n)&&(e.cookie=s+";max-age=0",yd=o)}return yd}(t);if(!r){var i=(t=>{var e=t.match(bd);return e?e[0]:""})(t);i!==r&&un.info("Warning: cookie subdomain discovery mismatch",i,r),r=i}return r?"; domain=."+r:""}return""}var _d={Dt:()=>!!Ji,Bt:function(t){un.error("cookieStore error: "+t)},Zt:function(t){if(Ji){try{for(var e=t+"=",r=Ji.cookie.split(";").filter((t=>t.length)),i=0;i<r.length;i++){for(var n=r[i];" "==n.charAt(0);)n=n.substring(1,n.length);if(0===n.indexOf(e))return decodeURIComponent(n.substring(e.length,n.length))}}catch(t){}return null}},$t:function(t){var e;try{e=JSON.parse(_d.Zt(t))||{}}catch(t){}return e},qt:function(t,e,r,i,n){if(Ji)try{var o="",s="",a=wd(Ji.location.hostname,i);if(r){var l=new Date;l.setTime(l.getTime()+24*r*60*60*1e3),o="; expires="+l.toUTCString()}n&&(s="; secure");var u=t+"="+encodeURIComponent(JSON.stringify(e))+o+"; SameSite=Lax; path=/"+a+s;return u.length>3686.4&&un.warn("cookieStore warning: large cookie, len="+u.length),Ji.cookie=u,u}catch(t){return}},Ht:function(t,e){if(null!=Ji&&Ji.cookie)try{_d.qt(t,"",-1,e)}catch(t){return}}},Cd=null,Id={Dt:function(){if(!ei(Cd))return Cd;var t=!0;if(Kr(Yi))t=!1;else try{var e="__mplssupport__";Id.qt(e,"xyz"),'"xyz"'!==Id.Zt(e)&&(t=!1),Id.Ht(e)}catch(e){t=!1}return t||un.error("localStorage unsupported; falling back to cookie store"),Cd=t,t},Bt:function(t){un.error("localStorage error: "+t)},Zt:function(t){try{return null==Yi?void 0:Yi.localStorage.getItem(t)}catch(t){Id.Bt(t)}return null},$t:function(t){try{return JSON.parse(Id.Zt(t))||{}}catch(t){}return null},qt:function(t,e){try{null==Yi||Yi.localStorage.setItem(t,JSON.stringify(e))}catch(t){Id.Bt(t)}},Ht:function(t){try{null==Yi||Yi.localStorage.removeItem(t)}catch(t){Id.Bt(t)}}},Sd=["distinct_id",jn,Yn,so,oo],kd=r({},Id,{$t:function(t){try{var e={};try{e=_d.$t(t)||{}}catch(t){}var r=fn(e,JSON.parse(Id.Zt(t)||"{}"));return Id.qt(t,r),r}catch(t){}return null},qt:function(t,e,r,i,n,o){try{Id.qt(t,e,void 0,void 0,o);var s={};Sd.forEach((t=>{e[t]&&(s[t]=e[t])})),Object.keys(s).length&&_d.qt(t,s,r,i,n,o)}catch(t){Id.Bt(t)}},Ht:function(t,e){try{null==Yi||Yi.localStorage.removeItem(t),_d.Ht(t,e)}catch(t){Id.Bt(t)}}}),xd={},Ad={Dt:function(){return!0},Bt:function(t){un.error("memoryStorage error: "+t)},Zt:function(t){return xd[t]||null},$t:function(t){return xd[t]||null},qt:function(t,e){xd[t]=e},Ht:function(t){delete xd[t]}},Td=null,Md={Dt:function(){if(!ei(Td))return Td;if(Td=!0,Kr(Yi))Td=!1;else try{var t="__support__";Md.qt(t,"xyz"),'"xyz"'!==Md.Zt(t)&&(Td=!1),Md.Ht(t)}catch(t){Td=!1}return Td},Bt:function(t){un.error("sessionStorage error: ",t)},Zt:function(t){try{return null==Yi?void 0:Yi.sessionStorage.getItem(t)}catch(t){Md.Bt(t)}return null},$t:function(t){try{return JSON.parse(Md.Zt(t))||null}catch(t){}return null},qt:function(t,e){try{null==Yi||Yi.sessionStorage.setItem(t,JSON.stringify(e))}catch(t){Md.Bt(t)}},Ht:function(t){try{null==Yi||Yi.sessionStorage.removeItem(t)}catch(t){Md.Bt(t)}}},Ed=function(t){return t[t.PENDING=-1]="PENDING",t[t.DENIED=0]="DENIED",t[t.GRANTED=1]="GRANTED",t}({});class Nd{constructor(t){this._instance=t}get vt(){return this._instance.config}get consent(){return this.Vt()?Ed.DENIED:this.jt}isOptedOut(){return"always"===this.vt.cookieless_mode||(this.consent===Ed.DENIED||this.consent===Ed.PENDING&&(this.vt.opt_out_capturing_by_default||"on_reject"===this.vt.cookieless_mode))}isOptedIn(){return!this.isOptedOut()}isExplicitlyOptedOut(){return this.consent===Ed.DENIED}optInOut(t){this.Yt.qt(this.Gt,t?1:0,this.vt.cookie_expiration,this.vt.cross_subdomain_cookie,this.vt.secure_cookie)}reset(){this.Yt.Ht(this.Gt,this.vt.cross_subdomain_cookie)}get Gt(){var{token:t,opt_out_capturing_cookie_prefix:e,consent_persistence_name:r}=this._instance.config;return r||(e?e+t:"__ph_opt_in_out_"+t)}get jt(){var t=this.Yt.Zt(this.Gt);return hi(t)?Ed.GRANTED:$r(di,t)?Ed.DENIED:Ed.PENDING}get Yt(){if(!this.Wt){var t=this.vt.opt_out_capturing_persistence_type;this.Wt="localStorage"===t?Id:_d;var e="localStorage"===t?_d:Id;e.Zt(this.Gt)&&(this.Wt.Zt(this.Gt)||this.optInOut(hi(e.Zt(this.Gt))),e.Ht(this.Gt,this.vt.cross_subdomain_cookie))}return this.Wt}Vt(){return!!this.vt.respect_dnt&&!!In([null==Xi?void 0:Xi.doNotTrack,null==Xi?void 0:Xi.msDoNotTrack,nn.doNotTrack],(t=>hi(t)))}}var Rd=cn("[Dead Clicks]"),Fd=()=>!0,Od=t=>{var e,r=!(null==(e=t.instance.persistence)||!e.get_property(qn)),i=t.instance.config.capture_dead_clicks;return ni(i)?i:r};class Pd{get lazyLoadedDeadClicksAutocapture(){return this.zt}constructor(t,e,r){this.instance=t,this.isEnabled=e,this.onCapture=r,this.startIfEnabled()}onRemoteConfig(t){this.instance.persistence&&this.instance.persistence.register({[qn]:null==t?void 0:t.captureDeadClicks}),this.startIfEnabled()}startIfEnabled(){this.isEnabled(this)&&this.Ut((()=>{this.Xt()}))}Ut(t){var e,r;null!=(e=nn.__PosthogExtensions__)&&e.initDeadClicksAutocapture&&t(),null==(r=nn.__PosthogExtensions__)||null==r.loadExternalDependency||r.loadExternalDependency(this.instance,"dead-clicks-autocapture",(e=>{e?Rd.error("failed to load script",e):t()}))}Xt(){var t;if(Ji){if(!this.zt&&null!=(t=nn.__PosthogExtensions__)&&t.initDeadClicksAutocapture){var e=Xr(this.instance.config.capture_dead_clicks)?this.instance.config.capture_dead_clicks:{};e.__onCapture=this.onCapture,this.zt=nn.__PosthogExtensions__.initDeadClicksAutocapture(this.instance,e),this.zt.start(Ji),Rd.info("starting...")}}else Rd.error("`document` not found. Cannot start.")}stop(){this.zt&&(this.zt.stop(),this.zt=void 0,Rd.info("stopping..."))}}var Ld=cn("[ExceptionAutocapture]");class Dd{constructor(t){var e,r,i;this.Jt=()=>{var t;if(Yi&&this.isEnabled&&null!=(t=nn.__PosthogExtensions__)&&t.errorWrappingFunctions){var e=nn.__PosthogExtensions__.errorWrappingFunctions.wrapOnError,r=nn.__PosthogExtensions__.errorWrappingFunctions.wrapUnhandledRejection,i=nn.__PosthogExtensions__.errorWrappingFunctions.wrapConsoleError;try{!this.Kt&&this.vt.capture_unhandled_errors&&(this.Kt=e(this.captureException.bind(this))),!this.Qt&&this.vt.capture_unhandled_rejections&&(this.Qt=r(this.captureException.bind(this))),!this.te&&this.vt.capture_console_errors&&(this.te=i(this.captureException.bind(this)))}catch(t){Ld.error("failed to start",t),this.ee()}}},this._instance=t,this.re=!(null==(e=this._instance.persistence)||!e.props[Dn]),this.vt=this.ie(),this.ne=new fi({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,T:Ld}),this.startIfEnabled()}ie(){var t=this._instance.config.capture_exceptions,e={capture_unhandled_errors:!1,capture_unhandled_rejections:!1,capture_console_errors:!1};return Xr(t)?e=r({},e,t):(Kr(t)?this.re:t)&&(e=r({},e,{capture_unhandled_errors:!0,capture_unhandled_rejections:!0})),e}get isEnabled(){return this.vt.capture_console_errors||this.vt.capture_unhandled_errors||this.vt.capture_unhandled_rejections}startIfEnabled(){this.isEnabled&&(Ld.info("enabled"),this.Ut(this.Jt))}Ut(t){var e,r;null!=(e=nn.__PosthogExtensions__)&&e.errorWrappingFunctions&&t(),null==(r=nn.__PosthogExtensions__)||null==r.loadExternalDependency||r.loadExternalDependency(this._instance,"exception-autocapture",(e=>{if(e)return Ld.error("failed to load script",e);t()}))}ee(){var t,e,r;null==(t=this.Kt)||t.call(this),this.Kt=void 0,null==(e=this.Qt)||e.call(this),this.Qt=void 0,null==(r=this.te)||r.call(this),this.te=void 0}onRemoteConfig(t){var e=t.autocaptureExceptions;this.re=!!e||!1,this.vt=this.ie(),this._instance.persistence&&this._instance.persistence.register({[Dn]:this.re}),this.startIfEnabled()}captureException(t){var e,r,i=null!==(e=null==t||null==(r=t.$exception_list)||null==(r=r[0])?void 0:r.type)&&void 0!==e?e:"Exception";this.ne.consumeRateLimit(i)?Ld.info("Skipping exception capture because of client rate limiting.",{exception:i}):this._instance.exceptions.sendExceptionEvent(t)}}class Bd{constructor(t){var e;this._instance=t,this.oe=(null==Yi||null==(e=Yi.location)?void 0:e.pathname)||""}get isEnabled(){return"history_change"===this._instance.config.capture_pageview}startIfEnabled(){this.isEnabled&&(un.info("History API monitoring enabled, starting..."),this.monitorHistoryChanges())}stop(){this.se&&this.se(),this.se=void 0,un.info("History API monitoring stopped")}monitorHistoryChanges(){var t,e;if(Yi&&Yi.history){var r=this;null!=(t=Yi.history.pushState)&&t.__posthog_wrapped__||En(Yi.history,"pushState",(t=>function(e,i,n){t.call(this,e,i,n),r.ae("pushState")})),null!=(e=Yi.history.replaceState)&&e.__posthog_wrapped__||En(Yi.history,"replaceState",(t=>function(e,i,n){t.call(this,e,i,n),r.ae("replaceState")})),this.le()}}ae(t){try{var e,r=null==Yi||null==(e=Yi.location)?void 0:e.pathname;if(!r)return;r!==this.oe&&this.isEnabled&&this._instance.capture("$pageview",{navigation_type:t}),this.oe=r}catch(e){un.error("Error capturing "+t+" pageview",e)}}le(){if(!this.se){var t=()=>{this.ae("popstate")};Sn(Yi,"popstate",t),this.se=()=>{Yi&&Yi.removeEventListener("popstate",t)}}}}var Zd=cn("[SegmentIntegration]");function $d(t,e){var r=t.config.segment;if(!r)return e();!function(t,e){var r=t.config.segment;if(!r)return e();var i=r=>{var i=()=>r.anonymousId()||Ha();t.config.get_device_id=i,r.id()&&(t.register({distinct_id:r.id(),$device_id:i()}),t.persistence.set_property(to,"identified")),e()},n=r.user();"then"in n&&zr(n.then)?n.then((t=>i(t))):i(n)}(t,(()=>{r.register((t=>{Promise&&Promise.resolve||Zd.warn("This browser does not have Promise support, and can not use the segment integration");var e=(e,r)=>{if(!r)return e;e.event.userId||e.event.anonymousId===t.get_distinct_id()||(Zd.info("No userId set, resetting PostHog"),t.reset()),e.event.userId&&e.event.userId!==t.get_distinct_id()&&(Zd.info("UserId set, identifying with PostHog"),t.identify(e.event.userId));var i=t.calculateEventProperties(r,e.event.properties);return e.event.properties=Object.assign({},i,e.event.properties),e};return{name:"PostHog JS",type:"enrichment",version:"1.0.0",isLoaded:()=>!0,load:()=>Promise.resolve(),track:t=>e(t,t.event.event),page:t=>e(t,"$pageview"),identify:t=>e(t,"$identify"),screen:t=>e(t,"$screen")}})(t)).then((()=>{e()}))}))}var qd="posthog-js";function Hd(t,e){var{organization:i,projectId:n,prefix:o,severityAllowList:s=["error"],sendExceptionsToPostHog:a=!0}=void 0===e?{}:e;return e=>{var l,u,c,h,d;if(!("*"===s||s.includes(e.level))||!t.__loaded)return e;e.tags||(e.tags={});var v=t.requestRouter.endpointFor("ui","/project/"+t.config.token+"/person/"+t.get_distinct_id());e.tags["PostHog Person URL"]=v,t.sessionRecordingStarted()&&(e.tags["PostHog Recording URL"]=t.get_session_replay_url({withTimestamp:!0}));var f=(null==(l=e.exception)?void 0:l.values)||[],p=f.map((t=>r({},t,{stacktrace:t.stacktrace?r({},t.stacktrace,{type:"raw",frames:(t.stacktrace.frames||[]).map((t=>r({},t,{platform:"web:javascript"})))}):void 0}))),g={$exception_message:(null==(u=f[0])?void 0:u.value)||e.message,$exception_type:null==(c=f[0])?void 0:c.type,$exception_personURL:v,$exception_level:e.level,$exception_list:p,$sentry_event_id:e.event_id,$sentry_exception:e.exception,$sentry_exception_message:(null==(h=f[0])?void 0:h.value)||e.message,$sentry_exception_type:null==(d=f[0])?void 0:d.type,$sentry_tags:e.tags};return i&&n&&(g.$sentry_url=(o||"https://sentry.io/organizations/")+i+"/issues/?project="+n+"&query="+e.event_id),a&&t.exceptions.sendExceptionEvent(g),e}}class Vd{constructor(t,e,r,i,n,o){this.name=qd,this.setupOnce=function(s){s(Hd(t,{organization:e,projectId:r,prefix:i,severityAllowList:n,sendExceptionsToPostHog:null==o||o}))}}}var jd=null!=Yi&&Yi.location?Mn(Yi.location.hash,"__posthog")||Mn(location.hash,"state"):null,Yd="_postHogToolbarParams",Gd=cn("[Toolbar]"),Wd=function(t){return t[t.UNINITIALIZED=0]="UNINITIALIZED",t[t.LOADING=1]="LOADING",t[t.LOADED=2]="LOADED",t}(Wd||{});class zd{constructor(t){this.instance=t}ue(t){nn.ph_toolbar_state=t}ce(){var t;return null!==(t=nn.ph_toolbar_state)&&void 0!==t?t:Wd.UNINITIALIZED}maybeLoadToolbar(t,e,r){if(void 0===t&&(t=void 0),void 0===e&&(e=void 0),void 0===r&&(r=void 0),!Yi||!Ji)return!1;t=null!=t?t:Yi.location,r=null!=r?r:Yi.history;try{if(!e){try{Yi.localStorage.setItem("test","test"),Yi.localStorage.removeItem("test")}catch(t){return!1}e=null==Yi?void 0:Yi.localStorage}var i,n=jd||Mn(t.hash,"__posthog")||Mn(t.hash,"state"),o=n?mn((()=>JSON.parse(atob(decodeURIComponent(n)))))||mn((()=>JSON.parse(decodeURIComponent(n)))):null;return o&&"ph_authorize"===o.action?((i=o).source="url",i&&Object.keys(i).length>0&&(o.desiredHash?t.hash=o.desiredHash:r?r.replaceState(r.state,"",t.pathname+t.search):t.hash="")):((i=JSON.parse(e.getItem(Yd)||"{}")).source="localstorage",delete i.userIntent),!(!i.token||this.instance.config.token!==i.token)&&(this.loadToolbar(i),!0)}catch(t){return!1}}he(t){var e=nn.ph_load_toolbar||nn.ph_load_editor;!ri(e)&&zr(e)?e(t,this.instance):Gd.warn("No toolbar load function found")}loadToolbar(t){var e=!(null==Ji||!Ji.getElementById(ao));if(!Yi||e)return!1;var i="custom"===this.instance.requestRouter.region&&this.instance.config.advanced_disable_toolbar_metrics,n=r({token:this.instance.config.token},t,{apiURL:this.instance.requestRouter.endpointFor("ui")},i?{instrument:!1}:{});if(Yi.localStorage.setItem(Yd,JSON.stringify(r({},n,{source:void 0}))),this.ce()===Wd.LOADED)this.he(n);else if(this.ce()===Wd.UNINITIALIZED){var o;this.ue(Wd.LOADING),null==(o=nn.__PosthogExtensions__)||null==o.loadExternalDependency||o.loadExternalDependency(this.instance,"toolbar",(t=>{if(t)return Gd.error("[Toolbar] Failed to load",t),void this.ue(Wd.UNINITIALIZED);this.ue(Wd.LOADED),this.he(n)})),Sn(Yi,"turbolinks:load",(()=>{this.ue(Wd.UNINITIALIZED),this.loadToolbar(n)}))}return!0}de(t){return this.loadToolbar(t)}maybeLoadEditor(t,e,r){return void 0===t&&(t=void 0),void 0===e&&(e=void 0),void 0===r&&(r=void 0),this.maybeLoadToolbar(t,e,r)}}var Ud=cn("[TracingHeaders]");class Xd{constructor(t){this.ve=void 0,this.fe=void 0,this.Jt=()=>{var t,e;Kr(this.ve)&&(null==(t=nn.__PosthogExtensions__)||null==(t=t.tracingHeadersPatchFns)||t._patchXHR(this._instance.config.__add_tracing_headers||[],this._instance.get_distinct_id(),this._instance.sessionManager));Kr(this.fe)&&(null==(e=nn.__PosthogExtensions__)||null==(e=e.tracingHeadersPatchFns)||e._patchFetch(this._instance.config.__add_tracing_headers||[],this._instance.get_distinct_id(),this._instance.sessionManager))},this._instance=t}Ut(t){var e,r;null!=(e=nn.__PosthogExtensions__)&&e.tracingHeadersPatchFns&&t(),null==(r=nn.__PosthogExtensions__)||null==r.loadExternalDependency||r.loadExternalDependency(this._instance,"tracing-headers",(e=>{if(e)return Ud.error("failed to load script",e);t()}))}startIfEnabledOrStop(){var t,e;this._instance.config.__add_tracing_headers?this.Ut(this.Jt):(null==(t=this.ve)||t.call(this),null==(e=this.fe)||e.call(this),this.ve=void 0,this.fe=void 0)}}var Jd=cn("[Web Vitals]"),Kd=9e5;class Qd{constructor(t){var e;this.pe=!1,this.ut=!1,this.D={url:void 0,metrics:[],firstMetricTimestamp:void 0},this.ge=()=>{clearTimeout(this.me),0!==this.D.metrics.length&&(this._instance.capture("$web_vitals",this.D.metrics.reduce(((t,e)=>r({},t,{["$web_vitals_"+e.name+"_event"]:r({},e),["$web_vitals_"+e.name+"_value"]:e.value})),{})),this.D={url:void 0,metrics:[],firstMetricTimestamp:void 0})},this.ye=t=>{var e,i=null==(e=this._instance.sessionManager)?void 0:e.checkAndGetSessionAndWindowId(!0);if(Kr(i))Jd.error("Could not read session ID. Dropping metrics!");else{this.D=this.D||{url:void 0,metrics:[],firstMetricTimestamp:void 0};var n=this.be();if(!Kr(n))if(ri(null==t?void 0:t.name)||ri(null==t?void 0:t.value))Jd.error("Invalid metric received",t);else if(this.we&&t.value>=this.we)Jd.error("Ignoring metric with value >= "+this.we,t);else this.D.url!==n&&(this.ge(),this.me=setTimeout(this.ge,this.flushToCaptureTimeoutMs)),Kr(this.D.url)&&(this.D.url=n),this.D.firstMetricTimestamp=Kr(this.D.firstMetricTimestamp)?Date.now():this.D.firstMetricTimestamp,t.attribution&&t.attribution.interactionTargetElement&&(t.attribution.interactionTargetElement=void 0),this.D.metrics.push(r({},t,{$current_url:n,$session_id:i.sessionId,$window_id:i.windowId,timestamp:Date.now()})),this.D.metrics.length===this.allowedMetrics.length&&this.ge()}},this.Jt=()=>{var t,e,r,i,n=nn.__PosthogExtensions__;Kr(n)||Kr(n.postHogWebVitalsCallbacks)||({onLCP:t,onCLS:e,onFCP:r,onINP:i}=n.postHogWebVitalsCallbacks),t&&e&&r&&i?(this.allowedMetrics.indexOf("LCP")>-1&&t(this.ye.bind(this)),this.allowedMetrics.indexOf("CLS")>-1&&e(this.ye.bind(this)),this.allowedMetrics.indexOf("FCP")>-1&&r(this.ye.bind(this)),this.allowedMetrics.indexOf("INP")>-1&&i(this.ye.bind(this)),this.ut=!0):Jd.error("web vitals callbacks not loaded - not starting")},this._instance=t,this.pe=!(null==(e=this._instance.persistence)||!e.props[$n]),this.startIfEnabled()}get allowedMetrics(){var t,e,r=Xr(this._instance.config.capture_performance)?null==(t=this._instance.config.capture_performance)?void 0:t.web_vitals_allowed_metrics:void 0;return Kr(r)?(null==(e=this._instance.persistence)?void 0:e.props[Hn])||["CLS","FCP","INP","LCP"]:r}get flushToCaptureTimeoutMs(){return(Xr(this._instance.config.capture_performance)?this._instance.config.capture_performance.web_vitals_delayed_flush_ms:void 0)||5e3}get we(){var t=Xr(this._instance.config.capture_performance)&&ii(this._instance.config.capture_performance.__web_vitals_max_value)?this._instance.config.capture_performance.__web_vitals_max_value:Kd;return 0<t&&t<=6e4?Kd:t}get isEnabled(){var t=null==Ki?void 0:Ki.protocol;if("http:"!==t&&"https:"!==t)return Jd.info("Web Vitals are disabled on non-http/https protocols"),!1;var e=Xr(this._instance.config.capture_performance)?this._instance.config.capture_performance.web_vitals:ni(this._instance.config.capture_performance)?this._instance.config.capture_performance:void 0;return ni(e)?e:this.pe}startIfEnabled(){this.isEnabled&&!this.ut&&(Jd.info("enabled, starting..."),this.Ut(this.Jt))}onRemoteConfig(t){var e=Xr(t.capturePerformance)&&!!t.capturePerformance.web_vitals,r=Xr(t.capturePerformance)?t.capturePerformance.web_vitals_allowed_metrics:void 0;this._instance.persistence&&(this._instance.persistence.register({[$n]:e}),this._instance.persistence.register({[Hn]:r})),this.pe=e,this.startIfEnabled()}Ut(t){var e,r;null!=(e=nn.__PosthogExtensions__)&&e.postHogWebVitalsCallbacks&&t(),null==(r=nn.__PosthogExtensions__)||null==r.loadExternalDependency||r.loadExternalDependency(this._instance,"web-vitals",(e=>{e?Jd.error("failed to load script",e):t()}))}be(){var t=Yi?Yi.location.href:void 0;return t||Jd.error("Could not determine current URL"),t}}var tv=cn("[Heatmaps]");function ev(t){return Xr(t)&&"clientX"in t&&"clientY"in t&&ii(t.clientX)&&ii(t.clientY)}class rv{constructor(t){var e;this.rageclicks=new od,this.pe=!1,this.ut=!1,this._e=null,this.instance=t,this.pe=!(null==(e=this.instance.persistence)||!e.props[Ln])}get flushIntervalMilliseconds(){var t=5e3;return Xr(this.instance.config.capture_heatmaps)&&this.instance.config.capture_heatmaps.flush_interval_milliseconds&&(t=this.instance.config.capture_heatmaps.flush_interval_milliseconds),t}get isEnabled(){return Kr(this.instance.config.capture_heatmaps)?Kr(this.instance.config.enable_heatmaps)?this.pe:this.instance.config.enable_heatmaps:!1!==this.instance.config.capture_heatmaps}startIfEnabled(){if(this.isEnabled){if(this.ut)return;tv.info("starting..."),this.Ce(),this._e=setInterval(this.Ie.bind(this),this.flushIntervalMilliseconds)}else{var t,e;clearInterval(null!==(t=this._e)&&void 0!==t?t:void 0),null==(e=this.Se)||e.stop(),this.getAndClearBuffer()}}onRemoteConfig(t){var e=!!t.heatmaps;this.instance.persistence&&this.instance.persistence.register({[Ln]:e}),this.pe=e,this.startIfEnabled()}getAndClearBuffer(){var t=this.D;return this.D=void 0,t}ke(t){this.It(t.originalEvent,"deadclick")}Ce(){Yi&&Ji&&(Sn(Yi,"beforeunload",this.Ie.bind(this)),Sn(Ji,"click",(t=>this.It(t||(null==Yi?void 0:Yi.event))),{capture:!0}),Sn(Ji,"mousemove",(t=>this.xe(t||(null==Yi?void 0:Yi.event))),{capture:!0}),this.Se=new Pd(this.instance,Fd,this.ke.bind(this)),this.Se.startIfEnabled(),this.ut=!0)}Ae(t,e){var r=this.instance.scrollManager.scrollY(),i=this.instance.scrollManager.scrollX(),n=this.instance.scrollManager.scrollElement(),o=function(t,e,r){for(var i=t;i&&ho(i)&&!vo(i,"body");){if(i===r)return!1;if($r(e,null==Yi?void 0:Yi.getComputedStyle(i).position))return!0;i=So(i)}return!1}(_o(t),["fixed","sticky"],n);return{x:t.clientX+(o?0:i),y:t.clientY+(o?0:r),target_fixed:o,type:e}}It(t,e){var i;if(void 0===e&&(e="click"),!co(t.target)&&ev(t)){var n=this.Ae(t,e);null!=(i=this.rageclicks)&&i.isRageClick(t.clientX,t.clientY,(new Date).getTime())&&this.Te(r({},n,{type:"rageclick"})),this.Te(n)}}xe(t){!co(t.target)&&ev(t)&&(clearTimeout(this.Me),this.Me=setTimeout((()=>{this.Te(this.Ae(t,"mousemove"))}),500))}Te(t){if(Yi){var e=Yi.location.href;this.D=this.D||{},this.D[e]||(this.D[e]=[]),this.D[e].push(t)}}Ie(){this.D&&!Jr(this.D)&&this.instance.capture("$$heatmap",{$heatmap_data:this.getAndClearBuffer()})}}class iv{constructor(t){this._instance=t}doPageView(t,e){var r,i=this.Ee(t,e);return this.Ne={pathname:null!==(r=null==Yi?void 0:Yi.location.pathname)&&void 0!==r?r:"",pageViewId:e,timestamp:t},this._instance.scrollManager.resetContext(),i}doPageLeave(t){var e;return this.Ee(t,null==(e=this.Ne)?void 0:e.pageViewId)}doEvent(){var t;return{$pageview_id:null==(t=this.Ne)?void 0:t.pageViewId}}Ee(t,e){var r=this.Ne;if(!r)return{$pageview_id:e};var i={$pageview_id:e,$prev_pageview_id:r.pageViewId},n=this._instance.scrollManager.getContext();if(n&&!this._instance.config.disable_scroll_properties){var{maxScrollHeight:o,lastScrollY:s,maxScrollY:a,maxContentHeight:l,lastContentY:u,maxContentY:c}=n;if(!(Kr(o)||Kr(s)||Kr(a)||Kr(l)||Kr(u)||Kr(c))){o=Math.ceil(o),s=Math.ceil(s),a=Math.ceil(a),l=Math.ceil(l),u=Math.ceil(u),c=Math.ceil(c);var h=o<=1?1:vi(s/o,0,1,un),d=o<=1?1:vi(a/o,0,1,un),v=l<=1?1:vi(u/l,0,1,un),f=l<=1?1:vi(c/l,0,1,un);i=fn(i,{$prev_pageview_last_scroll:s,$prev_pageview_last_scroll_percentage:h,$prev_pageview_max_scroll:a,$prev_pageview_max_scroll_percentage:d,$prev_pageview_last_content:u,$prev_pageview_last_content_percentage:v,$prev_pageview_max_content:c,$prev_pageview_max_content_percentage:f})}}return r.pathname&&(i.$prev_pageview_pathname=r.pathname),r.timestamp&&(i.$prev_pageview_duration=(t.getTime()-r.timestamp.getTime())/1e3),i}}var nv="https?://(.*)",ov=["gclid","gclsrc","dclid","gbraid","wbraid","fbclid","msclkid","twclid","li_fat_id","igshid","ttclid","rdt_cid","epik","qclid","sccid","irclid","_kx"],sv=pn(["utm_source","utm_medium","utm_campaign","utm_content","utm_term","gad_source","mc_cid"],ov),av="<masked>",lv=["li_fat_id"];function uv(t,e,r){if(!Ji)return{};var i,n=e?pn([],ov,r||[]):[],o=cv(Tn(Ji.URL,n,av),t),s=(i={},vn(lv,(function(t){var e=_d.Zt(t);i[t]=e||null})),i);return fn(s,o)}function cv(t,e){var r=sv.concat(e||[]),i={};return vn(r,(function(e){var r=An(t,e);i[e]=r||null})),i}function hv(t){var e=function(t){return t?0===t.search(nv+"google.([^/?]*)")?"google":0===t.search(nv+"bing.com")?"bing":0===t.search(nv+"yahoo.com")?"yahoo":0===t.search(nv+"duckduckgo.com")?"duckduckgo":null:null}(t),r="yahoo"!=e?"q":"p",i={};if(!ei(e)){i.$search_engine=e;var n=Ji?An(Ji.referrer,r):"";n.length&&(i.ph_keyword=n)}return i}function dv(){return navigator.language||navigator.userLanguage}function vv(){return(null==Ji?void 0:Ji.referrer)||"$direct"}function fv(t,e){var r=t?pn([],ov,e||[]):[],i=null==Ki?void 0:Ki.href.substring(0,1e3);return{r:vv().substring(0,1e3),u:i?Tn(i,r,av):void 0}}function pv(t){var e,{r:r,u:i}=t,n={$referrer:r,$referring_domain:null==r?void 0:"$direct"==r?"$direct":null==(e=kn(r))?void 0:e.host};if(i){n.$current_url=i;var o=kn(i);n.$host=null==o?void 0:o.host,n.$pathname=null==o?void 0:o.pathname;var s=cv(i);fn(n,s)}if(r){var a=hv(r);fn(n,a)}return n}function gv(){try{return Intl.DateTimeFormat().resolvedOptions().timeZone}catch(t){return}}function mv(){try{return(new Date).getTimezoneOffset()}catch(t){return}}function yv(t,e){if(!rn)return{};var r,i=t?pn([],ov,e||[]):[],[n,o]=function(t){for(var e=0;e<Bl.length;e++){var[r,i]=Bl[e],n=r.exec(t),o=n&&(zr(i)?i(n,t):i);if(o)return o}return["",""]}(rn);return fn(bn({$os:n,$os_version:o,$browser:Pl(rn,navigator.vendor),$device:Zl(rn),$device_type:$l(rn),$timezone:gv(),$timezone_offset:mv()}),{$current_url:Tn(null==Ki?void 0:Ki.href,i,av),$host:null==Ki?void 0:Ki.host,$pathname:null==Ki?void 0:Ki.pathname,$raw_user_agent:rn.length>1e3?rn.substring(0,997)+"...":rn,$browser_version:Dl(rn,navigator.vendor),$browser_language:dv(),$browser_language_prefix:(r=dv(),"string"==typeof r?r.split("-")[0]:void 0),$screen_height:null==Yi?void 0:Yi.screen.height,$screen_width:null==Yi?void 0:Yi.screen.width,$viewport_height:null==Yi?void 0:Yi.innerHeight,$viewport_width:null==Yi?void 0:Yi.innerWidth,$lib:"web",$lib_version:an.LIB_VERSION,$insert_id:Math.random().toString(36).substring(2,10)+Math.random().toString(36).substring(2,10),$time:Date.now()/1e3})}var bv=cn("[FeatureFlags]"),wv="$active_feature_flags",_v="$override_feature_flags",Cv="$feature_flag_payloads",Iv="$override_feature_flag_payloads",Sv="$feature_flag_request_id",kv=t=>{var e={};for(var[r,i]of gn(t||{}))i&&(e[r]=i);return e},xv=t=>{var e=t.flags;return e?(t.featureFlags=Object.fromEntries(Object.keys(e).map((t=>{var r;return[t,null!==(r=e[t].variant)&&void 0!==r?r:e[t].enabled]}))),t.featureFlagPayloads=Object.fromEntries(Object.keys(e).filter((t=>e[t].enabled)).filter((t=>{var r;return null==(r=e[t].metadata)?void 0:r.payload})).map((t=>{var r;return[t,null==(r=e[t].metadata)?void 0:r.payload]})))):bv.warn("Using an older version of the feature flags endpoint. Please upgrade your PostHog server to the latest version"),t},Av=function(t){return t.FeatureFlags="feature_flags",t.Recordings="recordings",t}({});class Tv{constructor(t){this.Re=!1,this.Fe=!1,this.Oe=!1,this.Pe=!1,this.Le=!1,this.De=!1,this.Be=!1,this._instance=t,this.featureFlagEventHandlers=[]}Ze(){var t=this._instance.config.evaluation_environments;return null!=t&&t.length?t.filter((t=>{var e=t&&"string"==typeof t&&t.trim().length>0;return e||bv.error("Invalid evaluation environment found:",t,"Expected non-empty string"),e})):[]}$e(){return this.Ze().length>0}flags(){if(this._instance.config.__preview_remote_config)this.De=!0;else{var t=!this.qe&&(this._instance.config.advanced_disable_feature_flags||this._instance.config.advanced_disable_feature_flags_on_first_load);this.He({disableFlags:t})}}get hasLoadedFlags(){return this.Fe}getFlags(){return Object.keys(this.getFlagVariants())}getFlagsWithDetails(){var t=this._instance.get_property(zn),e=this._instance.get_property(_v),i=this._instance.get_property(Iv);if(!i&&!e)return t||{};var n=fn({},t||{}),o=[...new Set([...Object.keys(i||{}),...Object.keys(e||{})])];for(var s of o){var a,l,u=n[s],c=null==e?void 0:e[s],h=Kr(c)?null!==(a=null==u?void 0:u.enabled)&&void 0!==a&&a:!!c,d=Kr(c)?u.variant:"string"==typeof c?c:void 0,v=null==i?void 0:i[s],f=r({},u,{enabled:h,variant:h?null!=d?d:null==u?void 0:u.variant:void 0});if(h!==(null==u?void 0:u.enabled)&&(f.original_enabled=null==u?void 0:u.enabled),d!==(null==u?void 0:u.variant)&&(f.original_variant=null==u?void 0:u.variant),v)f.metadata=r({},null==u?void 0:u.metadata,{payload:v,original_payload:null==u||null==(l=u.metadata)?void 0:l.payload});n[s]=f}return this.Re||(bv.warn(" Overriding feature flag details!",{flagDetails:t,overriddenPayloads:i,finalDetails:n}),this.Re=!0),n}getFlagVariants(){var t=this._instance.get_property(Gn),e=this._instance.get_property(_v);if(!e)return t||{};for(var r=fn({},t),i=Object.keys(e),n=0;n<i.length;n++)r[i[n]]=e[i[n]];return this.Re||(bv.warn(" Overriding feature flags!",{enabledFlags:t,overriddenFlags:e,finalFlags:r}),this.Re=!0),r}getFlagPayloads(){var t=this._instance.get_property(Cv),e=this._instance.get_property(Iv);if(!e)return t||{};for(var r=fn({},t||{}),i=Object.keys(e),n=0;n<i.length;n++)r[i[n]]=e[i[n]];return this.Re||(bv.warn(" Overriding feature flag payloads!",{flagPayloads:t,overriddenPayloads:e,finalPayloads:r}),this.Re=!0),r}reloadFeatureFlags(){this.Pe||this._instance.config.advanced_disable_feature_flags||this.qe||(this.qe=setTimeout((()=>{this.He()}),5))}Ve(){clearTimeout(this.qe),this.qe=void 0}ensureFlagsLoaded(){this.Fe||this.Oe||this.qe||this.reloadFeatureFlags()}setAnonymousDistinctId(t){this.$anon_distinct_id=t}setReloadingPaused(t){this.Pe=t}He(t){var e;if(this.Ve(),!this._instance.yt())if(this.Oe)this.Le=!0;else{var i={token:this._instance.config.token,distinct_id:this._instance.get_distinct_id(),groups:this._instance.getGroups(),$anon_distinct_id:this.$anon_distinct_id,person_properties:r({},(null==(e=this._instance.persistence)?void 0:e.get_initial_props())||{},this._instance.get_property(Un)||{}),group_properties:this._instance.get_property(Xn)};(null!=t&&t.disableFlags||this._instance.config.advanced_disable_feature_flags)&&(i.disable_flags=!0),this.$e()&&(i.evaluation_environments=this.Ze());var n=this._instance.config.__preview_remote_config,o=n?"/flags/?v=2":"/flags/?v=2&config=true",s=this._instance.config.advanced_only_evaluate_survey_feature_flags?"&only_evaluate_survey_feature_flags=true":"",a=this._instance.requestRouter.endpointFor("api",o+s);n&&(i.timezone=gv()),this.Oe=!0,this._instance.je({method:"POST",url:a,data:i,compression:this._instance.config.disable_compression?void 0:Hl.Base64,timeout:this._instance.config.feature_flag_request_timeout_ms,callback:t=>{var e,r,n=!0;(200===t.statusCode&&(this.Le||(this.$anon_distinct_id=void 0),n=!1),this.Oe=!1,this.De)||(this.De=!0,this._instance.Ye(null!==(r=t.json)&&void 0!==r?r:{}));if(!i.disable_flags||this.Le)if(this.Be=!n,t.json&&null!=(e=t.json.quotaLimited)&&e.includes(Av.FeatureFlags))bv.warn("You have hit your feature flags quota limit, and will not be able to load feature flags until the quota is reset. Please visit https://posthog.com/docs/billing/limits-alerts to learn more.");else{var o;if(!i.disable_flags)this.receivedFeatureFlags(null!==(o=t.json)&&void 0!==o?o:{},n);this.Le&&(this.Le=!1,this.He())}}})}}getFeatureFlag(t,e){if(void 0===e&&(e={}),this.Fe||this.getFlags()&&this.getFlags().length>0){var r=this.getFlagVariants()[t],i=""+r,n=this._instance.get_property(Sv)||void 0,o=this._instance.get_property(Qn)||{};if((e.send_event||!("send_event"in e))&&(!(t in o)||!o[t].includes(i))){var s,a,l,u,c,h,d,v,f;Wr(o[t])?o[t].push(i):o[t]=[i],null==(s=this._instance.persistence)||s.register({[Qn]:o});var p=this.getFeatureFlagDetails(t),g={$feature_flag:t,$feature_flag_response:r,$feature_flag_payload:this.getFeatureFlagPayload(t)||null,$feature_flag_request_id:n,$feature_flag_bootstrapped_response:(null==(a=this._instance.config.bootstrap)||null==(a=a.featureFlags)?void 0:a[t])||null,$feature_flag_bootstrapped_payload:(null==(l=this._instance.config.bootstrap)||null==(l=l.featureFlagPayloads)?void 0:l[t])||null,$used_bootstrap_value:!this.Be};Kr(null==p||null==(u=p.metadata)?void 0:u.version)||(g.$feature_flag_version=p.metadata.version);var m,y=null!==(c=null==p||null==(h=p.reason)?void 0:h.description)&&void 0!==c?c:null==p||null==(d=p.reason)?void 0:d.code;if(y&&(g.$feature_flag_reason=y),null!=p&&null!=(v=p.metadata)&&v.id&&(g.$feature_flag_id=p.metadata.id),Kr(null==p?void 0:p.original_variant)&&Kr(null==p?void 0:p.original_enabled)||(g.$feature_flag_original_response=Kr(p.original_variant)?p.original_enabled:p.original_variant),null!=p&&null!=(f=p.metadata)&&f.original_payload)g.$feature_flag_original_payload=null==p||null==(m=p.metadata)?void 0:m.original_payload;this._instance.capture("$feature_flag_called",g)}return r}bv.warn('getFeatureFlag for key "'+t+"\" failed. Feature flags didn't load in time.")}getFeatureFlagDetails(t){return this.getFlagsWithDetails()[t]}getFeatureFlagPayload(t){return this.getFlagPayloads()[t]}getRemoteConfigPayload(t,e){var r=this._instance.config.token,i={distinct_id:this._instance.get_distinct_id(),token:r};this.$e()&&(i.evaluation_environments=this.Ze()),this._instance.je({method:"POST",url:this._instance.requestRouter.endpointFor("api","/flags/?v=2&config=true"),data:i,compression:this._instance.config.disable_compression?void 0:Hl.Base64,timeout:this._instance.config.feature_flag_request_timeout_ms,callback:r=>{var i,n=null==(i=r.json)?void 0:i.featureFlagPayloads;e((null==n?void 0:n[t])||void 0)}})}isFeatureEnabled(t,e){if(void 0===e&&(e={}),this.Fe||this.getFlags()&&this.getFlags().length>0){var r=this.getFeatureFlag(t,e);return Kr(r)?void 0:!!r}bv.warn('isFeatureEnabled for key "'+t+"\" failed. Feature flags didn't load in time.")}addFeatureFlagsHandler(t){this.featureFlagEventHandlers.push(t)}removeFeatureFlagsHandler(t){this.featureFlagEventHandlers=this.featureFlagEventHandlers.filter((e=>e!==t))}receivedFeatureFlags(t,e){if(this._instance.persistence){this.Fe=!0;var i=this.getFlagVariants(),n=this.getFlagPayloads(),o=this.getFlagsWithDetails();!function(t,e,i,n,o){void 0===i&&(i={}),void 0===n&&(n={}),void 0===o&&(o={});var s=xv(t),a=s.flags,l=s.featureFlags,u=s.featureFlagPayloads;if(l){var c=t.requestId;if(Wr(l)){bv.warn("v1 of the feature flags endpoint is deprecated. Please use the latest version.");var h={};if(l)for(var d=0;d<l.length;d++)h[l[d]]=!0;e&&e.register({[wv]:l,[Gn]:h})}else{var v=l,f=u,p=a;t.errorsWhileComputingFlags&&(v=r({},i,v),f=r({},n,f),p=r({},o,p)),e&&e.register(r({[wv]:Object.keys(kv(v)),[Gn]:v||{},[Cv]:f||{},[zn]:p||{}},c?{[Sv]:c}:{}))}}}(t,this._instance.persistence,i,n,o),this.Ge(e)}}override(t,e){void 0===e&&(e=!1),bv.warn("override is deprecated. Please use overrideFeatureFlags instead."),this.overrideFeatureFlags({flags:t,suppressWarning:e})}overrideFeatureFlags(t){if(!this._instance.__loaded||!this._instance.persistence)return bv.uninitializedWarning("posthog.featureFlags.overrideFeatureFlags");if(!1===t)return this._instance.persistence.unregister(_v),this._instance.persistence.unregister(Iv),void this.Ge();if(t&&"object"==typeof t&&("flags"in t||"payloads"in t)){var e,r=t;if(this.Re=Boolean(null!==(e=r.suppressWarning)&&void 0!==e&&e),"flags"in r)if(!1===r.flags)this._instance.persistence.unregister(_v);else if(r.flags)if(Wr(r.flags)){for(var i={},n=0;n<r.flags.length;n++)i[r.flags[n]]=!0;this._instance.persistence.register({[_v]:i})}else this._instance.persistence.register({[_v]:r.flags});return"payloads"in r&&(!1===r.payloads?this._instance.persistence.unregister(Iv):r.payloads&&this._instance.persistence.register({[Iv]:r.payloads})),void this.Ge()}this.Ge()}onFeatureFlags(t){if(this.addFeatureFlagsHandler(t),this.Fe){var{flags:e,flagVariants:r}=this.We();t(e,r)}return()=>this.removeFeatureFlagsHandler(t)}updateEarlyAccessFeatureEnrollment(t,e,i){var n,o=(this._instance.get_property(Wn)||[]).find((e=>e.flagKey===t)),s={["$feature_enrollment/"+t]:e},a={$feature_flag:t,$feature_enrollment:e,$set:s};o&&(a.$early_access_feature_name=o.name),i&&(a.$feature_enrollment_stage=i),this._instance.capture("$feature_enrollment_update",a),this.setPersonPropertiesForFlags(s,!1);var l=r({},this.getFlagVariants(),{[t]:e});null==(n=this._instance.persistence)||n.register({[wv]:Object.keys(kv(l)),[Gn]:l}),this.Ge()}getEarlyAccessFeatures(t,e,r){void 0===e&&(e=!1);var i=this._instance.get_property(Wn),n=r?"&"+r.map((t=>"stage="+t)).join("&"):"";if(i&&!e)return t(i);this._instance.je({url:this._instance.requestRouter.endpointFor("api","/api/early_access_features/?token="+this._instance.config.token+n),method:"GET",callback:e=>{var r,i;if(e.json){var n=e.json.earlyAccessFeatures;return null==(r=this._instance.persistence)||r.unregister(Wn),null==(i=this._instance.persistence)||i.register({[Wn]:n}),t(n)}}})}We(){var t=this.getFlags(),e=this.getFlagVariants();return{flags:t.filter((t=>e[t])),flagVariants:Object.keys(e).filter((t=>e[t])).reduce(((t,r)=>(t[r]=e[r],t)),{})}}Ge(t){var{flags:e,flagVariants:r}=this.We();this.featureFlagEventHandlers.forEach((i=>i(e,r,{errorsLoading:t})))}setPersonPropertiesForFlags(t,e){void 0===e&&(e=!0);var i=this._instance.get_property(Un)||{};this._instance.register({[Un]:r({},i,t)}),e&&this._instance.reloadFeatureFlags()}resetPersonPropertiesForFlags(){this._instance.unregister(Un)}setGroupPropertiesForFlags(t,e){void 0===e&&(e=!0);var i=this._instance.get_property(Xn)||{};0!==Object.keys(i).length&&Object.keys(i).forEach((e=>{i[e]=r({},i[e],t[e]),delete t[e]})),this._instance.register({[Xn]:r({},i,t)}),e&&this._instance.reloadFeatureFlags()}resetGroupPropertiesForFlags(t){if(t){var e=this._instance.get_property(Xn)||{};this._instance.register({[Xn]:r({},e,{[t]:{}})})}else this._instance.unregister(Xn)}reset(){this.Fe=!1,this.Oe=!1,this.Pe=!1,this.Le=!1,this.De=!1,this.Be=!1,this.$anon_distinct_id=void 0,this.Ve(),this.Re=!1}}var Mv=["cookie","localstorage","localstorage+cookie","sessionstorage","memory"];class Ev{constructor(t,e){this.vt=t,this.props={},this.ze=!1,this.Ue=(t=>{var e="";return t.token&&(e=t.token.replace(/\+/g,"PL").replace(/\//g,"SL").replace(/=/g,"EQ")),t.persistence_name?"ph_"+t.persistence_name:"ph_"+e+"_posthog"})(t),this.Yt=this.Xe(t),this.load(),t.debug&&un.info("Persistence loaded",t.persistence,r({},this.props)),this.update_config(t,t,e),this.save()}isDisabled(){return!!this.Je}Xe(t){-1===Mv.indexOf(t.persistence.toLowerCase())&&(un.critical("Unknown persistence type "+t.persistence+"; falling back to localStorage+cookie"),t.persistence="localStorage+cookie");var e=t.persistence.toLowerCase();return"localstorage"===e&&Id.Dt()?Id:"localstorage+cookie"===e&&kd.Dt()?kd:"sessionstorage"===e&&Md.Dt()?Md:"memory"===e?Ad:"cookie"===e?_d:kd.Dt()?kd:_d}properties(){var t={};return vn(this.props,(function(e,r){if(r===Gn&&Xr(e))for(var i=Object.keys(e),n=0;n<i.length;n++)t["$feature/"+i[n]]=e[i[n]];else s=r,a=!1,(ei(o=uo)?a:Ui&&o.indexOf===Ui?-1!=o.indexOf(s):(vn(o,(function(t){if(a||(a=t===s))return hn})),a))||(t[r]=e);var o,s,a})),t}load(){if(!this.Je){var t=this.Yt.$t(this.Ue);t&&(this.props=fn({},t))}}save(){this.Je||this.Yt.qt(this.Ue,this.props,this.Ke,this.Qe,this.tr,this.vt.debug)}remove(){this.Yt.Ht(this.Ue,!1),this.Yt.Ht(this.Ue,!0)}clear(){this.remove(),this.props={}}register_once(t,e,r){if(Xr(t)){Kr(e)&&(e="None"),this.Ke=Kr(r)?this.er:r;var i=!1;if(vn(t,((t,r)=>{this.props.hasOwnProperty(r)&&this.props[r]!==e||(this.props[r]=t,i=!0)})),i)return this.save(),!0}return!1}register(t,e){if(Xr(t)){this.Ke=Kr(e)?this.er:e;var r=!1;if(vn(t,((e,i)=>{t.hasOwnProperty(i)&&this.props[i]!==e&&(this.props[i]=e,r=!0)})),r)return this.save(),!0}return!1}unregister(t){t in this.props&&(delete this.props[t],this.save())}update_campaign_params(){if(!this.ze){var t=uv(this.vt.custom_campaign_params,this.vt.mask_personal_data_properties,this.vt.custom_personal_data_properties);Jr(bn(t))||this.register(t),this.ze=!0}}update_search_keyword(){var t;this.register((t=null==Ji?void 0:Ji.referrer)?hv(t):{})}update_referrer_info(){var t;this.register_once({$referrer:vv(),$referring_domain:null!=Ji&&Ji.referrer&&(null==(t=kn(Ji.referrer))?void 0:t.host)||"$direct"},void 0)}set_initial_person_info(){this.props[io]||this.props[no]||this.register_once({[oo]:fv(this.vt.mask_personal_data_properties,this.vt.custom_personal_data_properties)},void 0)}get_initial_props(){var t={};vn([no,io],(e=>{var r=this.props[e];r&&vn(r,(function(e,r){t["$initial_"+Hr(r)]=e}))}));var e,r,i=this.props[oo];if(i){var n=(e=pv(i),r={},vn(e,(function(t,e){r["$initial_"+Hr(e)]=t})),r);fn(t,n)}return t}safe_merge(t){return vn(this.props,(function(e,r){r in t||(t[r]=e)})),t}update_config(t,e,r){if(this.er=this.Ke=t.cookie_expiration,this.set_disabled(t.disable_persistence||!!r),this.set_cross_subdomain(t.cross_subdomain_cookie),this.set_secure(t.secure_cookie),t.persistence!==e.persistence){var i=this.Xe(t),n=this.props;this.clear(),this.Yt=i,this.props=n,this.save()}}set_disabled(t){this.Je=t,this.Je?this.remove():this.save()}set_cross_subdomain(t){t!==this.Qe&&(this.Qe=t,this.remove(),this.save())}set_secure(t){t!==this.tr&&(this.tr=t,this.remove(),this.save())}set_event_timer(t,e){var r=this.props[On]||{};r[t]=e,this.props[On]=r,this.save()}remove_event_timer(t){var e=(this.props[On]||{})[t];return Kr(e)||(delete this.props[On][t],this.save()),e}get_property(t){return this.props[t]}set_property(t,e){this.props[t]=e,this.save()}}class Nv{constructor(){this.rr={},this.rr={}}on(t,e){return this.rr[t]||(this.rr[t]=[]),this.rr[t].push(e),()=>{this.rr[t]=this.rr[t].filter((t=>t!==e))}}emit(t,e){for(var r of this.rr[t]||[])r(e);for(var i of this.rr["*"]||[])i(t,e)}}class Rv{constructor(t){this.ir=new Nv,this.nr=(t,e)=>this.sr(t,e)&&this.ar(t,e)&&this.lr(t,e),this.sr=(t,e)=>null==e||!e.event||(null==t?void 0:t.event)===(null==e?void 0:e.event),this._instance=t,this.ur=new Set,this.cr=new Set}init(){var t;if(!Kr(null==(t=this._instance)?void 0:t.hr)){var e;null==(e=this._instance)||e.hr(((t,e)=>{this.on(t,e)}))}}register(t){var e,r;if(!Kr(null==(e=this._instance)?void 0:e.hr)&&(t.forEach((t=>{var e,r;null==(e=this.cr)||e.add(t),null==(r=t.steps)||r.forEach((t=>{var e;null==(e=this.ur)||e.add((null==t?void 0:t.event)||"")}))})),null!=(r=this._instance)&&r.autocapture)){var i,n=new Set;t.forEach((t=>{var e;null==(e=t.steps)||e.forEach((t=>{null!=t&&t.selector&&n.add(null==t?void 0:t.selector)}))})),null==(i=this._instance)||i.autocapture.setElementSelectors(n)}}on(t,e){var r;null!=e&&0!=t.length&&(this.ur.has(t)||this.ur.has(null==e?void 0:e.event))&&this.cr&&(null==(r=this.cr)?void 0:r.size)>0&&this.cr.forEach((t=>{this.dr(e,t)&&this.ir.emit("actionCaptured",t.name)}))}vr(t){this.onAction("actionCaptured",(e=>t(e)))}dr(t,e){if(null==(null==e?void 0:e.steps))return!1;for(var r of e.steps)if(this.nr(t,r))return!0;return!1}onAction(t,e){return this.ir.on(t,e)}ar(t,e){if(null!=e&&e.url){var r,i=null==t||null==(r=t.properties)?void 0:r.$current_url;if(!i||"string"!=typeof i)return!1;if(!Rv.pr(i,null==e?void 0:e.url,(null==e?void 0:e.url_matching)||"contains"))return!1}return!0}static pr(t,e,r){switch(r){case"regex":return!!Yi&&Eu(t,e);case"exact":return e===t;case"contains":var i=Rv.gr(e).replace(/_/g,".").replace(/%/g,".*");return Eu(t,i);default:return!1}}static gr(t){return t.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}lr(t,e){if((null!=e&&e.href||null!=e&&e.tag_name||null!=e&&e.text)&&!this.mr(t).some((t=>!(null!=e&&e.href&&!Rv.pr(t.href||"",null==e?void 0:e.href,(null==e?void 0:e.href_matching)||"exact"))&&((null==e||!e.tag_name||t.tag_name===(null==e?void 0:e.tag_name))&&!(null!=e&&e.text&&!Rv.pr(t.text||"",null==e?void 0:e.text,(null==e?void 0:e.text_matching)||"exact")&&!Rv.pr(t.$el_text||"",null==e?void 0:e.text,(null==e?void 0:e.text_matching)||"exact"))))))return!1;if(null!=e&&e.selector){var r,i=null==t||null==(r=t.properties)?void 0:r.$element_selectors;if(!i)return!1;if(!i.includes(null==e?void 0:e.selector))return!1}return!0}mr(t){return null==(null==t?void 0:t.properties.$elements)?[]:null==t?void 0:t.properties.$elements}}class Fv{constructor(t){this._instance=t,this.yr=new Map,this.br=new Map}register(t){var e;Kr(null==(e=this._instance)?void 0:e.hr)||(this.wr(t),this._r(t))}_r(t){var e=t.filter((t=>{var e,r;return(null==(e=t.conditions)?void 0:e.actions)&&(null==(r=t.conditions)||null==(r=r.actions)||null==(r=r.values)?void 0:r.length)>0}));if(0!==e.length){if(null==this.Cr){this.Cr=new Rv(this._instance),this.Cr.init();this.Cr.vr((t=>{this.onAction(t)}))}e.forEach((t=>{var e,r,i,n,o;t.conditions&&null!=(e=t.conditions)&&e.actions&&null!=(r=t.conditions)&&null!=(r=r.actions)&&r.values&&(null==(i=t.conditions)||null==(i=i.actions)||null==(i=i.values)?void 0:i.length)>0&&(null==(n=this.Cr)||n.register(t.conditions.actions.values),null==(o=t.conditions)||null==(o=o.actions)||null==(o=o.values)||o.forEach((e=>{if(e&&e.name){var r=this.br.get(e.name);r&&r.push(t.id),this.br.set(e.name,r||[t.id])}})))}))}}wr(t){var e;if(0!==t.filter((t=>{var e,r;return(null==(e=t.conditions)?void 0:e.events)&&(null==(r=t.conditions)||null==(r=r.events)||null==(r=r.values)?void 0:r.length)>0})).length){null==(e=this._instance)||e.hr(((t,e)=>{this.onEvent(t,e)})),t.forEach((t=>{var e;null==(e=t.conditions)||null==(e=e.events)||null==(e=e.values)||e.forEach((e=>{if(e&&e.name){var r=this.yr.get(e.name);r&&r.push(t.id),this.yr.set(e.name,r||[t.id])}}))}))}}onEvent(t,e){var r,i,n=(null==(r=this._instance)||null==(r=r.persistence)?void 0:r.props[Kn])||[];if(Ca.SHOWN===t&&e&&n.length>0){var o;ka.info("survey event matched, removing survey from activated surveys",{event:t,eventPayload:e,existingActivatedSurveys:n});var s=null==e||null==(o=e.properties)?void 0:o.$survey_id;if(s){var a=n.indexOf(s);a>=0&&(n.splice(a,1),this.Ir(n))}}else if(this.yr.has(t)){ka.info("survey event name matched",{event:t,eventPayload:e,surveys:this.yr.get(t)});var l=[];null==(i=this._instance)||i.getSurveys((e=>{l=e.filter((e=>{var r;return null==(r=this.yr.get(t))?void 0:r.includes(e.id)}))}));var u=l.filter((r=>{var i,n=null==(i=r.conditions)||null==(i=i.events)||null==(i=i.values)?void 0:i.find((e=>e.name===t));return!!n&&(!n.propertyFilters||Object.entries(n.propertyFilters).every((t=>{var r,[i,n]=t,o=null==e||null==(r=e.properties)?void 0:r[i];if(Kr(o)||ei(o))return!1;var s=[String(o)],a=Ru[n.operator];return a?a(n.values,s):(ka.warn("Unknown property comparison operator: "+n.operator),!1)})))}));this.Ir(n.concat(u.map((t=>t.id))||[]))}}onAction(t){var e,r=(null==(e=this._instance)||null==(e=e.persistence)?void 0:e.props[Kn])||[];this.br.has(t)&&this.Ir(r.concat(this.br.get(t)||[]))}Ir(t){var e;ka.info("updating activated surveys",{activatedSurveys:t}),null==(e=this._instance)||null==(e=e.persistence)||e.register({[Kn]:[...new Set(t)]})}getSurveys(){var t,e=null==(t=this._instance)||null==(t=t.persistence)?void 0:t.props[Kn];return e||[]}getEventToSurveys(){return this.yr}Sr(){return this.Cr}}class Ov{constructor(t){this.kr=void 0,this._surveyManager=null,this.Ar=!1,this.Tr=!1,this.Mr=[],this._instance=t,this._surveyEventReceiver=null}onRemoteConfig(t){if(!this._instance.config.disable_surveys){var e=t.surveys;if(ri(e))return ka.warn("Flags not loaded yet. Not loading surveys.");var r=Wr(e);this.kr=r?e.length>0:e,ka.info("flags response received, isSurveysEnabled: "+this.kr),this.loadIfEnabled()}}reset(){localStorage.removeItem("lastSeenSurveyDate");for(var t=[],e=0;e<localStorage.length;e++){var r=localStorage.key(e);(null!=r&&r.startsWith(Ma)||null!=r&&r.startsWith(Ea))&&t.push(r)}t.forEach((t=>localStorage.removeItem(t)))}loadIfEnabled(){if(!this._surveyManager)if(this.Tr)ka.info("Already initializing surveys, skipping...");else if(this._instance.config.disable_surveys)ka.info("Disabled. Not loading surveys.");else if(this._instance.config.cookieless_mode&&this._instance.consent.isOptedOut())ka.info("Not loading surveys in cookieless mode without consent.");else{var t=null==nn?void 0:nn.__PosthogExtensions__;if(t){if(!Kr(this.kr)||this._instance.config.advanced_enable_surveys){var e=this.kr||this._instance.config.advanced_enable_surveys;this.Tr=!0;try{var r=t.generateSurveys;if(r)return void this.Er(r,e);var i=t.loadExternalDependency;if(!i)return void this.Nr("PostHog loadExternalDependency extension not found.");i(this._instance,"surveys",(r=>{r||!t.generateSurveys?this.Nr("Could not load surveys script",r):this.Er(t.generateSurveys,e)}))}catch(t){throw this.Nr("Error initializing surveys",t),t}finally{this.Tr=!1}}}else ka.error("PostHog Extensions not found.")}}Er(t,e){this._surveyManager=t(this._instance,e),this._surveyEventReceiver=new Fv(this._instance),ka.info("Surveys loaded successfully"),this.Rr({isLoaded:!0})}Nr(t,e){ka.error(t,e),this.Rr({isLoaded:!1,error:t})}onSurveysLoaded(t){return this.Mr.push(t),this._surveyManager&&this.Rr({isLoaded:!0}),()=>{this.Mr=this.Mr.filter((e=>e!==t))}}getSurveys(t,e){if(void 0===e&&(e=!1),this._instance.config.disable_surveys)return ka.info("Disabled. Not loading surveys."),t([]);var r=this._instance.get_property(Jn);if(r&&!e)return t(r,{isLoaded:!0});if(this.Ar)return t([],{isLoaded:!1,error:"Surveys are already being loaded"});try{this.Ar=!0,this._instance.je({url:this._instance.requestRouter.endpointFor("api","/api/surveys/?token="+this._instance.config.token),method:"GET",timeout:this._instance.config.surveys_request_timeout_ms,callback:e=>{var r;this.Ar=!1;var i=e.statusCode;if(200!==i||!e.json){var n="Surveys API could not be loaded, status: "+i;return ka.error(n),t([],{isLoaded:!1,error:n})}var o,s=e.json.surveys||[],a=s.filter((t=>xa(t)&&(Aa(t)||Ta(t))));a.length>0&&(null==(o=this._surveyEventReceiver)||o.register(a));return null==(r=this._instance.persistence)||r.register({[Jn]:s}),t(s,{isLoaded:!0})}})}catch(t){throw this.Ar=!1,t}}Rr(t){for(var e of this.Mr)try{if(!t.isLoaded)return e([],t);this.getSurveys(e)}catch(t){ka.error("Error in survey callback",t)}}getActiveMatchingSurveys(t,e){if(void 0===e&&(e=!1),!ri(this._surveyManager))return this._surveyManager.getActiveMatchingSurveys(t,e);ka.warn("init was not called")}Fr(t){var e=null;return this.getSurveys((r=>{var i;e=null!==(i=r.find((e=>e.id===t)))&&void 0!==i?i:null})),e}Or(t){if(ri(this._surveyManager))return{eligible:!1,reason:"SDK is not enabled or survey functionality is not yet loaded"};var e="string"==typeof t?this.Fr(t):t;return e?this._surveyManager.checkSurveyEligibility(e):{eligible:!1,reason:"Survey not found"}}canRenderSurvey(t){if(ri(this._surveyManager))return ka.warn("init was not called"),{visible:!1,disabledReason:"SDK is not enabled or survey functionality is not yet loaded"};var e=this.Or(t);return{visible:e.eligible,disabledReason:e.reason}}canRenderSurveyAsync(t,e){return ri(this._surveyManager)?(ka.warn("init was not called"),Promise.resolve({visible:!1,disabledReason:"SDK is not enabled or survey functionality is not yet loaded"})):new Promise((r=>{this.getSurveys((e=>{var i,n=null!==(i=e.find((e=>e.id===t)))&&void 0!==i?i:null;if(n){var o=this.Or(n);r({visible:o.eligible,disabledReason:o.reason})}else r({visible:!1,disabledReason:"Survey not found"})}),e)}))}renderSurvey(t,e){var r;if(ri(this._surveyManager))ka.warn("init was not called");else{var i="string"==typeof t?this.Fr(t):t;if(null!=i&&i.id)if(Oa.includes(i.type)){var n=null==Ji?void 0:Ji.querySelector(e);if(n)return null!=(r=i.appearance)&&r.surveyPopupDelaySeconds?(ka.info("Rendering survey "+i.id+" with delay of "+i.appearance.surveyPopupDelaySeconds+" seconds"),void setTimeout((()=>{var t,e;ka.info("Rendering survey "+i.id+" with delay of "+(null==(t=i.appearance)?void 0:t.surveyPopupDelaySeconds)+" seconds"),null==(e=this._surveyManager)||e.renderSurvey(i,n),ka.info("Survey "+i.id+" rendered")}),1e3*i.appearance.surveyPopupDelaySeconds)):void this._surveyManager.renderSurvey(i,n);ka.warn("Survey element not found")}else ka.warn("Surveys of type "+i.type+" cannot be rendered in the app");else ka.warn("Survey not found")}}displaySurvey(t,e){var i;if(ri(this._surveyManager))ka.warn("init was not called");else{var n=this.Fr(t);if(n){var o=n;if(null!=(i=n.appearance)&&i.surveyPopupDelaySeconds&&e.ignoreDelay&&(o=r({},n,{appearance:r({},n.appearance,{surveyPopupDelaySeconds:0})})),!1===e.ignoreConditions){var s=this.canRenderSurvey(n);if(!s.visible)return void ka.warn("Survey is not eligible to be displayed: ",s.disabledReason)}e.displayType!==Sa.Inline?this._surveyManager.handlePopoverSurvey(o):this.renderSurvey(o,e.selector)}else ka.warn("Survey not found")}}}var Pv=cn("[RateLimiter]");class Lv{constructor(t){var e,r;this.serverLimits={},this.lastEventRateLimited=!1,this.checkForLimiting=t=>{var e=t.text;if(e&&e.length)try{(JSON.parse(e).quota_limited||[]).forEach((t=>{Pv.info((t||"events")+" is quota limited."),this.serverLimits[t]=(new Date).getTime()+6e4}))}catch(t){return void Pv.warn('could not rate limit - continuing. Error: "'+(null==t?void 0:t.message)+'"',{text:e})}},this.instance=t,this.captureEventsPerSecond=(null==(e=t.config.rate_limiting)?void 0:e.events_per_second)||10,this.captureEventsBurstLimit=Math.max((null==(r=t.config.rate_limiting)?void 0:r.events_burst_limit)||10*this.captureEventsPerSecond,this.captureEventsPerSecond),this.lastEventRateLimited=this.clientRateLimitContext(!0).isRateLimited}clientRateLimitContext(t){var e,r,i;void 0===t&&(t=!1);var n=(new Date).getTime(),o=null!==(e=null==(r=this.instance.persistence)?void 0:r.get_property(ro))&&void 0!==e?e:{tokens:this.captureEventsBurstLimit,last:n};o.tokens+=(n-o.last)/1e3*this.captureEventsPerSecond,o.last=n,o.tokens>this.captureEventsBurstLimit&&(o.tokens=this.captureEventsBurstLimit);var s=o.tokens<1;return s||t||(o.tokens=Math.max(0,o.tokens-1)),!s||this.lastEventRateLimited||t||this.instance.capture("$$client_ingestion_warning",{$$client_ingestion_warning_message:"posthog-js client rate limited. Config is set to "+this.captureEventsPerSecond+" events per second and "+this.captureEventsBurstLimit+" events burst limit."},{skip_client_rate_limiting:!0}),this.lastEventRateLimited=s,null==(i=this.instance.persistence)||i.set_property(ro,o),{isRateLimited:s,remainingTokens:o.tokens}}isServerRateLimited(t){var e=this.serverLimits[t||"events"]||!1;return!1!==e&&(new Date).getTime()<e}}var Dv=cn("[RemoteConfig]");class Bv{constructor(t){this._instance=t}get remoteConfig(){var t;return null==(t=nn._POSTHOG_REMOTE_CONFIG)||null==(t=t[this._instance.config.token])?void 0:t.config}Pr(t){var e,r;null!=(e=nn.__PosthogExtensions__)&&e.loadExternalDependency?null==(r=nn.__PosthogExtensions__)||null==r.loadExternalDependency||r.loadExternalDependency(this._instance,"remote-config",(()=>t(this.remoteConfig))):(Dv.error("PostHog Extensions not found. Cannot load remote config."),t())}Lr(t){this._instance.je({method:"GET",url:this._instance.requestRouter.endpointFor("assets","/array/"+this._instance.config.token+"/config"),callback:e=>{t(e.json)}})}load(){try{if(this.remoteConfig)return Dv.info("Using preloaded remote config",this.remoteConfig),void this.Ye(this.remoteConfig);if(this._instance.yt())return void Dv.warn("Remote config is disabled. Falling back to local config.");this.Pr((t=>{if(!t)return Dv.info("No config found after loading remote JS config. Falling back to JSON."),void this.Lr((t=>{this.Ye(t)}));this.Ye(t)}))}catch(t){Dv.error("Error loading remote config",t)}}Ye(t){t?this._instance.config.__preview_remote_config?(this._instance.Ye(t),!1!==t.hasFeatureFlags&&this._instance.featureFlags.ensureFlagsLoaded()):Dv.info("__preview_remote_config is disabled. Logging config instead",t):Dv.error("Failed to fetch remote config from PostHog.")}}var Zv=3e3;class $v{constructor(t,e){this.Dr=!0,this.Br=[],this.Zr=vi((null==e?void 0:e.flush_interval_ms)||Zv,250,5e3,un.createLogger("flush interval"),Zv),this.$r=t}enqueue(t){this.Br.push(t),this.qr||this.Hr()}unload(){this.Vr();var t=this.Br.length>0?this.jr():{},e=Object.values(t),i=[...e.filter((t=>0===t.url.indexOf("/e"))),...e.filter((t=>0!==t.url.indexOf("/e")))];i.map((t=>{this.$r(r({},t,{transport:"sendBeacon"}))}))}enable(){this.Dr=!1,this.Hr()}Hr(){var t=this;this.Dr||(this.qr=setTimeout((()=>{if(this.Vr(),this.Br.length>0){var e=this.jr(),r=function(){var r=e[i],n=(new Date).getTime();r.data&&Wr(r.data)&&vn(r.data,(t=>{t.offset=Math.abs(t.timestamp-n),delete t.timestamp})),t.$r(r)};for(var i in e)r()}}),this.Zr))}Vr(){clearTimeout(this.qr),this.qr=void 0}jr(){var t={};return vn(this.Br,(e=>{var i,n=e,o=(n?n.batchKey:null)||n.url;Kr(t[o])&&(t[o]=r({},n,{data:[]})),null==(i=t[o].data)||i.push(n.data)})),this.Br=[],t}}var qv=["retriesPerformedSoFar"];class Hv{constructor(t){this.Yr=!1,this.Gr=3e3,this.Br=[],this._instance=t,this.Br=[],this.Wr=!0,!Kr(Yi)&&"onLine"in Yi.navigator&&(this.Wr=Yi.navigator.onLine,Sn(Yi,"online",(()=>{this.Wr=!0,this.Ie()})),Sn(Yi,"offline",(()=>{this.Wr=!1})))}get length(){return this.Br.length}retriableRequest(t){var{retriesPerformedSoFar:e}=t,n=i(t,qv);ii(e)&&e>0&&(n.url=xu(n.url,{retry_count:e})),this._instance.je(r({},n,{callback:t=>{200!==t.statusCode&&(t.statusCode<400||t.statusCode>=500)&&(null!=e?e:0)<10?this.zr(r({retriesPerformedSoFar:e},n)):null==n.callback||n.callback(t)}}))}zr(t){var e=t.retriesPerformedSoFar||0;t.retriesPerformedSoFar=e+1;var r=function(t){var e=3e3*Math.pow(2,t),r=e/2,i=Math.min(18e5,e),n=(Math.random()-.5)*(i-r);return Math.ceil(i+n)}(e),i=Date.now()+r;this.Br.push({retryAt:i,requestOptions:t});var n="Enqueued failed request for retry in "+r;navigator.onLine||(n+=" (Browser is offline)"),un.warn(n),this.Yr||(this.Yr=!0,this.Ur())}Ur(){this.Xr&&clearTimeout(this.Xr),this.Xr=setTimeout((()=>{this.Wr&&this.Br.length>0&&this.Ie(),this.Ur()}),this.Gr)}Ie(){var t=Date.now(),e=[],r=this.Br.filter((r=>r.retryAt<t||(e.push(r),!1)));if(this.Br=e,r.length>0)for(var{requestOptions:i}of r)this.retriableRequest(i)}unload(){for(var{requestOptions:t}of(this.Xr&&(clearTimeout(this.Xr),this.Xr=void 0),this.Br))try{this._instance.je(r({},t,{transport:"sendBeacon"}))}catch(t){un.error(t)}this.Br=[]}}class Vv{constructor(t){this.Jr=()=>{var t,e,r,i;this.Kr||(this.Kr={});var n=this.scrollElement(),o=this.scrollY(),s=n?Math.max(0,n.scrollHeight-n.clientHeight):0,a=o+((null==n?void 0:n.clientHeight)||0),l=(null==n?void 0:n.scrollHeight)||0;this.Kr.lastScrollY=Math.ceil(o),this.Kr.maxScrollY=Math.max(o,null!==(t=this.Kr.maxScrollY)&&void 0!==t?t:0),this.Kr.maxScrollHeight=Math.max(s,null!==(e=this.Kr.maxScrollHeight)&&void 0!==e?e:0),this.Kr.lastContentY=a,this.Kr.maxContentY=Math.max(a,null!==(r=this.Kr.maxContentY)&&void 0!==r?r:0),this.Kr.maxContentHeight=Math.max(l,null!==(i=this.Kr.maxContentHeight)&&void 0!==i?i:0)},this._instance=t}getContext(){return this.Kr}resetContext(){var t=this.Kr;return setTimeout(this.Jr,0),t}startMeasuringScrollPosition(){Sn(Yi,"scroll",this.Jr,{capture:!0}),Sn(Yi,"scrollend",this.Jr,{capture:!0}),Sn(Yi,"resize",this.Jr)}scrollElement(){if(!this._instance.config.scroll_root_selector)return null==Yi?void 0:Yi.document.documentElement;var t=Wr(this._instance.config.scroll_root_selector)?this._instance.config.scroll_root_selector:[this._instance.config.scroll_root_selector];for(var e of t){var r=null==Yi?void 0:Yi.document.querySelector(e);if(r)return r}}scrollY(){if(this._instance.config.scroll_root_selector){var t=this.scrollElement();return t&&t.scrollTop||0}return Yi&&(Yi.scrollY||Yi.pageYOffset||Yi.document.documentElement.scrollTop)||0}scrollX(){if(this._instance.config.scroll_root_selector){var t=this.scrollElement();return t&&t.scrollLeft||0}return Yi&&(Yi.scrollX||Yi.pageXOffset||Yi.document.documentElement.scrollLeft)||0}}var jv=t=>fv(null==t?void 0:t.config.mask_personal_data_properties,null==t?void 0:t.config.custom_personal_data_properties);class Yv{constructor(t,e,r,i){this.Qr=t=>{var e=this.ti();if(!e||e.sessionId!==t){var r={sessionId:t,props:this.ei(this._instance)};this.ri.register({[eo]:r})}},this._instance=t,this.ii=e,this.ri=r,this.ei=i||jv,this.ii.onSessionId(this.Qr)}ti(){return this.ri.props[eo]}getSetOnceProps(){var t,e=null==(t=this.ti())?void 0:t.props;return e?"r"in e?pv(e):{$referring_domain:e.referringDomain,$pathname:e.initialPathName,utm_source:e.utm_source,utm_campaign:e.utm_campaign,utm_medium:e.utm_medium,utm_content:e.utm_content,utm_term:e.utm_term}:{}}getSessionProps(){var t={};return vn(bn(this.getSetOnceProps()),((e,r)=>{"$current_url"===r&&(r="url"),t["$session_entry_"+Hr(r)]=e})),t}}var Gv=cn("[SessionId]");class Wv{on(t,e){return this.ni.on(t,e)}constructor(t,e,r){var i;if(this.oi=[],this.ni=new Nv,this.si=(t,e)=>Math.abs(t-e)>this.sessionTimeoutMs,!t.persistence)throw new Error("SessionIdManager requires a PostHogPersistence instance");if("always"===t.config.cookieless_mode)throw new Error('SessionIdManager cannot be used with cookieless_mode="always"');this.vt=t.config,this.ri=t.persistence,this.ai=void 0,this.li=void 0,this._sessionStartTimestamp=null,this._sessionActivityTimestamp=null,this.ui=e||Ha,this.ci=r||Ha;var n=this.vt.persistence_name||this.vt.token,o=this.vt.session_idle_timeout_seconds||1800;if(this._sessionTimeoutMs=1e3*vi(o,60,36e3,Gv.createLogger("session_idle_timeout_seconds"),1800),t.register({$configured_session_timeout_ms:this._sessionTimeoutMs}),this.hi(),this.di="ph_"+n+"_window_id",this.vi="ph_"+n+"_primary_window_exists",this.fi()){var s=Md.$t(this.di),a=Md.$t(this.vi);s&&!a?this.ai=s:Md.Ht(this.di),Md.qt(this.vi,!0)}if(null!=(i=this.vt.bootstrap)&&i.sessionID)try{var l=(t=>{var e=t.replace(/-/g,"");if(32!==e.length)throw new Error("Not a valid UUID");if("7"!==e[12])throw new Error("Not a UUIDv7");return parseInt(e.substring(0,12),16)})(this.vt.bootstrap.sessionID);this.pi(this.vt.bootstrap.sessionID,(new Date).getTime(),l)}catch(t){Gv.error("Invalid sessionID in bootstrap",t)}this.gi()}get sessionTimeoutMs(){return this._sessionTimeoutMs}onSessionId(t){return Kr(this.oi)&&(this.oi=[]),this.oi.push(t),this.li&&t(this.li,this.ai),()=>{this.oi=this.oi.filter((e=>e!==t))}}fi(){return"memory"!==this.vt.persistence&&!this.ri.Je&&Md.Dt()}mi(t){t!==this.ai&&(this.ai=t,this.fi()&&Md.qt(this.di,t))}yi(){return this.ai?this.ai:this.fi()?Md.$t(this.di):null}pi(t,e,r){t===this.li&&e===this._sessionActivityTimestamp&&r===this._sessionStartTimestamp||(this._sessionStartTimestamp=r,this._sessionActivityTimestamp=e,this.li=t,this.ri.register({[jn]:[e,t,r]}))}bi(){if(this.li&&this._sessionActivityTimestamp&&this._sessionStartTimestamp)return[this._sessionActivityTimestamp,this.li,this._sessionStartTimestamp];var t=this.ri.props[jn];return Wr(t)&&2===t.length&&t.push(t[0]),t||[0,null,0]}resetSessionId(){this.pi(null,null,null)}gi(){Sn(Yi,"beforeunload",(()=>{this.fi()&&Md.Ht(this.vi)}),{capture:!1})}checkAndGetSessionAndWindowId(t,e){if(void 0===t&&(t=!1),void 0===e&&(e=null),"always"===this.vt.cookieless_mode)throw new Error('checkAndGetSessionAndWindowId should not be called with cookieless_mode="always"');var r=e||(new Date).getTime(),[i,n,o]=this.bi(),s=this.yi(),a=ii(o)&&o>0&&Math.abs(r-o)>864e5,l=!1,u=!n,c=!t&&this.si(r,i);u||c||a?(n=this.ui(),s=this.ci(),Gv.info("new session ID generated",{sessionId:n,windowId:s,changeReason:{noSessionId:u,activityTimeout:c,sessionPastMaximumLength:a}}),o=r,l=!0):s||(s=this.ci(),l=!0);var h=0===i||!t||a?r:i,d=0===o?(new Date).getTime():o;return this.mi(s),this.pi(n,h,d),t||this.hi(),l&&this.oi.forEach((t=>t(n,s,l?{noSessionId:u,activityTimeout:c,sessionPastMaximumLength:a}:void 0))),{sessionId:n,windowId:s,sessionStartTimestamp:d,changeReason:l?{noSessionId:u,activityTimeout:c,sessionPastMaximumLength:a}:void 0,lastActivityTimestamp:i}}hi(){clearTimeout(this.wi),this.wi=setTimeout((()=>{var[t]=this.bi();if(this.si((new Date).getTime(),t)){var e=this.li;this.resetSessionId(),this.ni.emit("forcedIdleReset",{idleSessionId:e})}}),1.1*this.sessionTimeoutMs)}}var zv=["$set_once","$set"],Uv=cn("[SiteApps]");class Xv{constructor(t){this._instance=t,this.Ci=[],this.apps={}}get isEnabled(){return!!this._instance.config.opt_in_site_apps}Ii(t,e){if(e){var r=this.globalsForEvent(e);this.Ci.push(r),this.Ci.length>1e3&&(this.Ci=this.Ci.slice(10))}}get siteAppLoaders(){var t;return null==(t=nn._POSTHOG_REMOTE_CONFIG)||null==(t=t[this._instance.config.token])?void 0:t.siteApps}init(){if(this.isEnabled){var t=this._instance.hr(this.Ii.bind(this));this.Si=()=>{t(),this.Ci=[],this.Si=void 0}}}globalsForEvent(t){var e,n,o,s,a,l,u;if(!t)throw new Error("Event payload is required");var c={},h=this._instance.get_property("$groups")||[],d=this._instance.get_property("$stored_group_properties")||{};for(var[v,f]of Object.entries(d))c[v]={id:h[v],type:v,properties:f};var{$set_once:p,$set:g}=t;return{event:r({},i(t,zv),{properties:r({},t.properties,g?{$set:r({},null!==(e=null==(n=t.properties)?void 0:n.$set)&&void 0!==e?e:{},g)}:{},p?{$set_once:r({},null!==(o=null==(s=t.properties)?void 0:s.$set_once)&&void 0!==o?o:{},p)}:{}),elements_chain:null!==(a=null==(l=t.properties)?void 0:l.$elements_chain)&&void 0!==a?a:"",distinct_id:null==(u=t.properties)?void 0:u.distinct_id}),person:{properties:this._instance.get_property("$stored_person_properties")},groups:c}}setupSiteApp(t){var e=this.apps[t.id],r=()=>{var r;(!e.errored&&this.Ci.length&&(Uv.info("Processing "+this.Ci.length+" events for site app with id "+t.id),this.Ci.forEach((t=>null==e.processEvent?void 0:e.processEvent(t))),e.processedBuffer=!0),Object.values(this.apps).every((t=>t.processedBuffer||t.errored)))&&(null==(r=this.Si)||r.call(this))},i=!1,n=n=>{e.errored=!n,e.loaded=!0,Uv.info("Site app with id "+t.id+" "+(n?"loaded":"errored")),i&&r()};try{var{processEvent:o}=t.init({posthog:this._instance,callback:t=>{n(t)}});o&&(e.processEvent=o),i=!0}catch(e){Uv.error("Error while initializing PostHog app with config id "+t.id,e),n(!1)}if(i&&e.loaded)try{r()}catch(r){Uv.error("Error while processing buffered events PostHog app with config id "+t.id,r),e.errored=!0}}ki(){var t=this.siteAppLoaders||[];for(var e of t)this.apps[e.id]={id:e.id,loaded:!1,errored:!1,processedBuffer:!1};for(var r of t)this.setupSiteApp(r)}xi(t){if(0!==Object.keys(this.apps).length){var e=this.globalsForEvent(t);for(var r of Object.values(this.apps))try{null==r.processEvent||r.processEvent(e)}catch(e){Uv.error("Error while processing event "+t.event+" for site app "+r.id,e)}}}onRemoteConfig(t){var e,r,i,n=this;if(null!=(e=this.siteAppLoaders)&&e.length)return this.isEnabled?(this.ki(),void this._instance.on("eventCaptured",(t=>this.xi(t)))):void Uv.error('PostHog site apps are disabled. Enable the "opt_in_site_apps" config to proceed.');if(null==(r=this.Si)||r.call(this),null!=(i=t.siteApps)&&i.length)if(this.isEnabled){var o=function(t){var e;nn["__$$ph_site_app_"+t]=n._instance,null==(e=nn.__PosthogExtensions__)||null==e.loadSiteApp||e.loadSiteApp(n._instance,a,(e=>{if(e)return Uv.error("Error while initializing PostHog app with config id "+t,e)}))};for(var{id:s,url:a}of t.siteApps)o(s)}else Uv.error('PostHog site apps are disabled. Enable the "opt_in_site_apps" config to proceed.')}}var Jv=["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"],Kv=function(t,e){if(!t)return!1;var r=t.toLowerCase();return Jv.concat(e||[]).some((t=>{var e=t.toLowerCase();return-1!==r.indexOf(e)}))},Qv=function(t,e){if(!t)return!1;var r=t.userAgent;if(r&&Kv(r,e))return!0;try{var i=null==t?void 0:t.userAgentData;if(null!=i&&i.brands&&i.brands.some((t=>Kv(null==t?void 0:t.brand,e))))return!0}catch(t){}return!!t.webdriver},tf=function(t){return t.US="us",t.EU="eu",t.CUSTOM="custom",t}({}),ef="i.posthog.com";class rf{constructor(t){this.Ai={},this.instance=t}get apiHost(){var t=this.instance.config.api_host.trim().replace(/\/$/,"");return"https://app.posthog.com"===t?"https://us.i.posthog.com":t}get uiHost(){var t,e=null==(t=this.instance.config.ui_host)?void 0:t.replace(/\/$/,"");return e||(e=this.apiHost.replace("."+ef,".posthog.com")),"https://app.posthog.com"===e?"https://us.posthog.com":e}get region(){return this.Ai[this.apiHost]||(/https:\/\/(app|us|us-assets)(\.i)?\.posthog\.com/i.test(this.apiHost)?this.Ai[this.apiHost]=tf.US:/https:\/\/(eu|eu-assets)(\.i)?\.posthog\.com/i.test(this.apiHost)?this.Ai[this.apiHost]=tf.EU:this.Ai[this.apiHost]=tf.CUSTOM),this.Ai[this.apiHost]}endpointFor(t,e){if(void 0===e&&(e=""),e&&(e="/"===e[0]?e:"/"+e),"ui"===t)return this.uiHost+e;if(this.region===tf.CUSTOM)return this.apiHost+e;var r=ef+e;switch(t){case"assets":return"https://"+this.region+"-assets."+r;case"api":return"https://"+this.region+"."+r}}}var nf={icontains:(t,e)=>!!Yi&&e.href.toLowerCase().indexOf(t.toLowerCase())>-1,not_icontains:(t,e)=>!!Yi&&-1===e.href.toLowerCase().indexOf(t.toLowerCase()),regex:(t,e)=>!!Yi&&Eu(e.href,t),not_regex:(t,e)=>!!Yi&&!Eu(e.href,t),exact:(t,e)=>e.href===t,is_not:(t,e)=>e.href!==t};class of{constructor(t){var e=this;this.getWebExperimentsAndEvaluateDisplayLogic=function(t){void 0===t&&(t=!1),e.getWebExperiments((t=>{of.Ti("retrieved web experiments from the server"),e.Mi=new Map,t.forEach((t=>{if(t.feature_flag_key){var r;if(e.Mi)of.Ti("setting flag key ",t.feature_flag_key," to web experiment ",t),null==(r=e.Mi)||r.set(t.feature_flag_key,t);var i=e._instance.getFeatureFlag(t.feature_flag_key);Qr(i)&&t.variants[i]&&e.Ei(t.name,i,t.variants[i].transforms)}else if(t.variants)for(var n in t.variants){var o=t.variants[n];of.Ni(o)&&e.Ei(t.name,n,o.transforms)}}))}),t)},this._instance=t,this._instance.onFeatureFlags((t=>{this.onFeatureFlags(t)}))}onFeatureFlags(t){if(this._is_bot())of.Ti("Refusing to render web experiment since the viewer is a likely bot");else if(!this._instance.config.disable_web_experiments){if(ri(this.Mi))return this.Mi=new Map,this.loadIfEnabled(),void this.previewWebExperiment();of.Ti("applying feature flags",t),t.forEach((t=>{var e;if(this.Mi&&null!=(e=this.Mi)&&e.has(t)){var r,i=this._instance.getFeatureFlag(t),n=null==(r=this.Mi)?void 0:r.get(t);i&&null!=n&&n.variants[i]&&this.Ei(n.name,i,n.variants[i].transforms)}}))}}previewWebExperiment(){var t=of.getWindowLocation();if(null!=t&&t.search){var e=An(null==t?void 0:t.search,"__experiment_id"),r=An(null==t?void 0:t.search,"__experiment_variant");e&&r&&(of.Ti("previewing web experiments "+e+" && "+r),this.getWebExperiments((t=>{this.Ri(parseInt(e),r,t)}),!1,!0))}}loadIfEnabled(){this._instance.config.disable_web_experiments||this.getWebExperimentsAndEvaluateDisplayLogic()}getWebExperiments(t,e,r){if(this._instance.config.disable_web_experiments&&!r)return t([]);var i=this._instance.get_property("$web_experiments");if(i&&!e)return t(i);this._instance.je({url:this._instance.requestRouter.endpointFor("api","/api/web_experiments/?token="+this._instance.config.token),method:"GET",callback:e=>{if(200!==e.statusCode||!e.json)return t([]);var r=e.json.experiments||[];return t(r)}})}Ri(t,e,r){var i=r.filter((e=>e.id===t));i&&i.length>0&&(of.Ti("Previewing web experiment ["+i[0].name+"] with variant ["+e+"]"),this.Ei(i[0].name,e,i[0].variants[e].transforms))}static Ni(t){return!ri(t.conditions)&&(of.Fi(t)&&of.Oi(t))}static Fi(t){var e;if(ri(t.conditions)||ri(null==(e=t.conditions)?void 0:e.url))return!0;var r,i,n,o=of.getWindowLocation();return!!o&&(null==(r=t.conditions)||!r.url||nf[null!==(i=null==(n=t.conditions)?void 0:n.urlMatchType)&&void 0!==i?i:"icontains"](t.conditions.url,o))}static getWindowLocation(){return null==Yi?void 0:Yi.location}static Oi(t){var e;if(ri(t.conditions)||ri(null==(e=t.conditions)?void 0:e.utm))return!0;var r=uv();if(r.utm_source){var i,n,o,s,a,l,u,c,h=null==(i=t.conditions)||null==(i=i.utm)||!i.utm_campaign||(null==(n=t.conditions)||null==(n=n.utm)?void 0:n.utm_campaign)==r.utm_campaign,d=null==(o=t.conditions)||null==(o=o.utm)||!o.utm_source||(null==(s=t.conditions)||null==(s=s.utm)?void 0:s.utm_source)==r.utm_source,v=null==(a=t.conditions)||null==(a=a.utm)||!a.utm_medium||(null==(l=t.conditions)||null==(l=l.utm)?void 0:l.utm_medium)==r.utm_medium,f=null==(u=t.conditions)||null==(u=u.utm)||!u.utm_term||(null==(c=t.conditions)||null==(c=c.utm)?void 0:c.utm_term)==r.utm_term;return h&&v&&f&&d}return!1}static Ti(t){for(var e=arguments.length,r=new Array(e>1?e-1:0),i=1;i<e;i++)r[i-1]=arguments[i];un.info("[WebExperiments] "+t,r)}Ei(t,e,r){this._is_bot()?of.Ti("Refusing to render web experiment since the viewer is a likely bot"):"control"!==e?r.forEach((r=>{if(r.selector){var i;of.Ti("applying transform of variant "+e+" for experiment "+t+" ",r);var n=null==(i=document)?void 0:i.querySelectorAll(r.selector);null==n||n.forEach((t=>{var e=t;r.html&&(e.innerHTML=r.html),r.css&&e.setAttribute("style",r.css)}))}})):of.Ti("Control variants leave the page unmodified.")}_is_bot(){return Xi&&this._instance?Qv(Xi,this._instance.config.custom_blocked_useragents):void 0}}var sf=cn("[PostHog ExternalIntegrations]"),af={intercom:"intercom-integration",crispChat:"crisp-chat-integration"};class lf{constructor(t){this._instance=t}Ut(t,e){var r;null==(r=nn.__PosthogExtensions__)||null==r.loadExternalDependency||r.loadExternalDependency(this._instance,t,(t=>{if(t)return sf.error("failed to load script",t);e()}))}startIfEnabledOrStop(){var t=this,e=function(e){var r,n,o;(!i||null!=(r=nn.__PosthogExtensions__)&&null!=(r=r.integrations)&&r[e]||t.Ut(af[e],(()=>{var r;null==(r=nn.__PosthogExtensions__)||null==(r=r.integrations)||null==(r=r[e])||r.start(t._instance)})),!i&&null!=(n=nn.__PosthogExtensions__)&&null!=(n=n.integrations)&&n[e])&&(null==(o=nn.__PosthogExtensions__)||null==(o=o.integrations)||null==(o=o[e])||o.stop())};for(var[r,i]of Object.entries(null!==(n=this._instance.config.integrations)&&void 0!==n?n:{})){var n;e(r)}}}var uf="[SessionRecording]",cf=cn(uf);class hf{get started(){var t;return!(null==(t=this.Pi)||!t.isStarted)}get status(){return this.Pi?this.Pi.status:this.Li&&!this.Di?"disabled":"lazy_loading"}constructor(t){if(this._forceAllowLocalhostNetworkCapture=!1,this.Li=!1,this.Bi=void 0,this._instance=t,!this._instance.sessionManager)throw cf.error("started without valid sessionManager"),new Error(uf+" started without valid sessionManager. This is a bug.");if("always"===this._instance.config.cookieless_mode)throw new Error(uf+' cannot be used with cookieless_mode="always"')}get Di(){var t,e=!(null==(t=this._instance.get_property(Vn))||!t.enabled),r=!this._instance.config.disable_session_recording,i=this._instance.config.disable_session_recording||this._instance.consent.isOptedOut();return Yi&&e&&r&&!i}startIfEnabledOrStop(t){var e;if(!this.Di||null==(e=this.Pi)||!e.isStarted){var r=!Kr(Object.assign)&&!Kr(Array.from);this.Di&&r?(this.Zi(t),cf.info("starting")):this.stopRecording()}}Zi(t){var e,r,i;this.Di&&(null!=nn&&null!=(e=nn.__PosthogExtensions__)&&null!=(e=e.rrweb)&&e.record&&null!=(r=nn.__PosthogExtensions__)&&r.initSessionRecording?this.$i(t):null==(i=nn.__PosthogExtensions__)||null==i.loadExternalDependency||i.loadExternalDependency(this._instance,this.qi,(e=>{if(e)return cf.error("could not load recorder",e);this.$i(t)})))}stopRecording(){var t;null==(t=this.Pi)||t.stop()}Hi(){var t;null==(t=this._instance.persistence)||t.unregister(Yn)}Vi(t){if(this._instance.persistence){var e,i,n=this._instance.persistence,o=()=>{var e=!1===t.sessionRecording?void 0:t.sessionRecording,i=null==e?void 0:e.sampleRate,o=ri(i)?null:parseFloat(i);ri(o)&&this.Hi();var s=null==e?void 0:e.minimumDurationMilliseconds;n.register({[Vn]:r({enabled:!!e},e,{networkPayloadCapture:r({capturePerformance:t.capturePerformance},null==e?void 0:e.networkPayloadCapture),canvasRecording:{enabled:null==e?void 0:e.recordCanvas,fps:null==e?void 0:e.canvasFps,quality:null==e?void 0:e.canvasQuality},sampleRate:o,minimumDurationMilliseconds:Kr(s)?null:s,endpoint:null==e?void 0:e.endpoint,triggerMatchType:null==e?void 0:e.triggerMatchType,masking:null==e?void 0:e.masking,urlTriggers:null==e?void 0:e.urlTriggers})})};o(),null==(e=this.Bi)||e.call(this),this.Bi=null==(i=this._instance.sessionManager)?void 0:i.onSessionId(o)}}onRemoteConfig(t){"sessionRecording"in t?!1!==t.sessionRecording?(this.Vi(t),this.Li=!0,this.startIfEnabledOrStop()):this.Li=!0:cf.info("skipping remote config with no sessionRecording",t)}log(t,e){var r;void 0===e&&(e="log"),null!=(r=this.Pi)&&r.log?this.Pi.log(t,e):cf.warn("log called before recorder was ready")}get qi(){var t,e,r=null==(t=this._instance)||null==(t=t.persistence)?void 0:t.get_property(Vn);return(null==r||null==(e=r.scriptConfig)?void 0:e.script)||"lazy-recorder"}$i(t){var e,r;if(null==(e=nn.__PosthogExtensions__)||!e.initSessionRecording)throw Error("Called on script loaded before session recording is available");this.Pi||(this.Pi=null==(r=nn.__PosthogExtensions__)?void 0:r.initSessionRecording(this._instance),this.Pi._forceAllowLocalhostNetworkCapture=this._forceAllowLocalhostNetworkCapture);this.Pi.start(t)}onRRwebEmit(t){var e;null==(e=this.Pi)||null==e.onRRwebEmit||e.onRRwebEmit(t)}overrideLinkedFlag(){var t;null==(t=this.Pi)||t.overrideLinkedFlag()}overrideSampling(){var t;null==(t=this.Pi)||t.overrideSampling()}overrideTrigger(t){var e;null==(e=this.Pi)||e.overrideTrigger(t)}get sdkDebugProperties(){var t;return(null==(t=this.Pi)?void 0:t.sdkDebugProperties)||{$recording_status:this.status}}tryAddCustomEvent(t,e){var r;return!(null==(r=this.Pi)||!r.tryAddCustomEvent(t,e))}}var df={},vf=()=>{},ff="posthog",pf=!Su&&-1===(null==rn?void 0:rn.indexOf("MSIE"))&&-1===(null==rn?void 0:rn.indexOf("Mozilla")),gf=t=>{var e;return{api_host:"https://us.i.posthog.com",ui_host:null,token:"",autocapture:!0,rageclick:!0,cross_subdomain_cookie:Cn(null==Ji?void 0:Ji.location),persistence:"localStorage+cookie",persistence_name:"",loaded:vf,save_campaign_params:!0,custom_campaign_params:[],custom_blocked_useragents:[],save_referrer:!0,capture_pageview:"2025-05-24"!==t||"history_change",capture_pageleave:"if_capture_pageview",defaults:null!=t?t:"unset",debug:Ki&&Qr(null==Ki?void 0:Ki.search)&&-1!==Ki.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_external_dependency_loading:!1,enable_recording_console_log:void 0,secure_cookie:"https:"===(null==Yi||null==(e=Yi.location)?void 0:e.protocol),ip:!1,opt_out_capturing_by_default:!1,opt_out_persistence_by_default:!1,opt_out_useragent_filter:!1,opt_out_capturing_persistence_type:"localStorage",consent_persistence_name:null,opt_out_capturing_cookie_prefix:null,opt_in_site_apps:!1,property_denylist:[],respect_dnt:!1,sanitize_properties:null,request_headers:{},request_batching:!0,properties_string_max_length:65535,session_recording:{},mask_all_element_attributes:!1,mask_all_text:!1,mask_personal_data_properties:!1,custom_personal_data_properties:[],advanced_disable_flags:!1,advanced_disable_decide:!1,advanced_disable_feature_flags:!1,advanced_disable_feature_flags_on_first_load:!1,advanced_only_evaluate_survey_feature_flags:!1,advanced_enable_surveys:!1,advanced_disable_toolbar_metrics:!1,feature_flag_request_timeout_ms:3e3,surveys_request_timeout_ms:1e4,on_request_error:t=>{var e="Bad HTTP status: "+t.statusCode+" "+t.text;un.error(e)},get_device_id:t=>t,capture_performance:void 0,name:"posthog",bootstrap:{},disable_compression:!1,session_idle_timeout_seconds:1800,person_profiles:"identified_only",before_send:void 0,request_queue_config:{flush_interval_ms:Zv},error_tracking:{},_onCapture:vf,__preview_eager_load_replay:!1}},mf=t=>{var e={};Kr(t.process_person)||(e.person_profiles=t.process_person),Kr(t.xhr_headers)||(e.request_headers=t.xhr_headers),Kr(t.cookie_name)||(e.persistence_name=t.cookie_name),Kr(t.disable_cookie)||(e.disable_persistence=t.disable_cookie),Kr(t.store_google)||(e.save_campaign_params=t.store_google),Kr(t.verbose)||(e.debug=t.verbose);var r=fn({},e,t);return Wr(t.property_blacklist)&&(Kr(t.property_denylist)?r.property_denylist=t.property_blacklist:Wr(t.property_denylist)?r.property_denylist=[...t.property_blacklist,...t.property_denylist]:un.error("Invalid value for property_denylist config: "+t.property_denylist)),r};class yf{constructor(){this.__forceAllowLocalhost=!1}get ji(){return this.__forceAllowLocalhost}set ji(t){un.error("WebPerformanceObserver is deprecated and has no impact on network capture. Use `_forceAllowLocalhostNetworkCapture` on `posthog.sessionRecording`"),this.__forceAllowLocalhost=t}}class bf{get decideEndpointWasHit(){var t,e;return null!==(t=null==(e=this.featureFlags)?void 0:e.hasLoadedFlags)&&void 0!==t&&t}get flagsEndpointWasHit(){var t,e;return null!==(t=null==(e=this.featureFlags)?void 0:e.hasLoadedFlags)&&void 0!==t&&t}constructor(){this.webPerformance=new yf,this.Yi=!1,this.version=an.LIB_VERSION,this.Gi=new Nv,this._calculate_event_properties=this.calculateEventProperties.bind(this),this.config=gf(),this.SentryIntegration=Vd,this.sentryIntegration=t=>function(t,e){var r=Hd(t,e);return{name:qd,processEvent:t=>r(t)}}(this,t),this.__request_queue=[],this.__loaded=!1,this.analyticsDefaultEndpoint="/e/",this.Wi=!1,this.zi=null,this.Ui=null,this.Xi=null,this.featureFlags=new Tv(this),this.toolbar=new zd(this),this.scrollManager=new Vv(this),this.pageViewManager=new iv(this),this.surveys=new Ov(this),this.experiments=new of(this),this.exceptions=new Qc(this),this.rateLimiter=new Lv(this),this.requestRouter=new rf(this),this.consent=new Nd(this),this.externalIntegrations=new lf(this),this.people={set:(t,e,r)=>{var i=Qr(t)?{[t]:e}:t;this.setPersonProperties(i),null==r||r({})},set_once:(t,e,r)=>{var i=Qr(t)?{[t]:e}:t;this.setPersonProperties(void 0,i),null==r||r({})}},this.on("eventCaptured",(t=>un.info('send "'+(null==t?void 0:t.event)+'"',t)))}init(t,e,r){if(r&&r!==ff){var i,n=null!==(i=df[r])&&void 0!==i?i:new bf;return n._init(t,e,r),df[r]=n,df[ff][r]=n,n}return this._init(t,e,r)}_init(t,e,i){var n,o;if(void 0===e&&(e={}),Kr(t)||ti(t))return un.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 un.warn("You have already initialized PostHog! Re-initializing is a no-op"),this;this.__loaded=!0,this.config={},this.Ji=e,this.Ki=[],e.person_profiles&&(this.Ui=e.person_profiles),this.set_config(fn({},gf(e.defaults),mf(e),{name:i,token:t})),this.config.on_xhr_error&&un.error("on_xhr_error is deprecated. Use on_request_error instead"),this.compression=e.disable_compression?void 0:Hl.GZipJS;var s=this.Qi();this.persistence=new Ev(this.config,s),this.sessionPersistence="sessionStorage"===this.config.persistence||"memory"===this.config.persistence?this.persistence:new Ev(r({},this.config,{persistence:"sessionStorage"}),s);var a=r({},this.persistence.props),l=r({},this.sessionPersistence.props);this.register({$initialization_time:(new Date).toISOString()}),this.tn=new $v((t=>this.en(t)),this.config.request_queue_config),this.rn=new Hv(this),this.__request_queue=[];var u="always"===this.config.cookieless_mode||"on_reject"===this.config.cookieless_mode&&this.consent.isExplicitlyOptedOut();if(u||(this.sessionManager=new Wv(this),this.sessionPropsManager=new Yv(this,this.sessionManager,this.persistence)),new Xd(this).startIfEnabledOrStop(),this.siteApps=new Xv(this),null==(n=this.siteApps)||n.init(),u||(this.sessionRecording=new hf(this),this.sessionRecording.startIfEnabledOrStop()),this.config.disable_scroll_properties||this.scrollManager.startMeasuringScrollPosition(),this.autocapture=new hd(this),this.autocapture.startIfEnabled(),this.surveys.loadIfEnabled(),this.heatmaps=new rv(this),this.heatmaps.startIfEnabled(),this.webVitalsAutocapture=new Qd(this),this.exceptionObserver=new Dd(this),this.exceptionObserver.startIfEnabled(),this.deadClicksAutocapture=new Pd(this,Od),this.deadClicksAutocapture.startIfEnabled(),this.historyAutocapture=new Bd(this),this.historyAutocapture.startIfEnabled(),an.DEBUG=an.DEBUG||this.config.debug,an.DEBUG&&un.info("Starting in debug mode",{this:this,config:e,thisC:r({},this.config),p:a,s:l}),void 0!==(null==(o=e.bootstrap)?void 0:o.distinctID)){var c,h,d=this.config.get_device_id(Ha()),v=null!=(c=e.bootstrap)&&c.isIdentifiedID?d:e.bootstrap.distinctID;this.persistence.set_property(to,null!=(h=e.bootstrap)&&h.isIdentifiedID?"identified":"anonymous"),this.register({distinct_id:e.bootstrap.distinctID,$device_id:v})}if(this.nn()){var f,p,g=Object.keys((null==(f=e.bootstrap)?void 0:f.featureFlags)||{}).filter((t=>{var r;return!(null==(r=e.bootstrap)||null==(r=r.featureFlags)||!r[t])})).reduce(((t,r)=>{var i;return t[r]=(null==(i=e.bootstrap)||null==(i=i.featureFlags)?void 0:i[r])||!1,t}),{}),m=Object.keys((null==(p=e.bootstrap)?void 0:p.featureFlagPayloads)||{}).filter((t=>g[t])).reduce(((t,r)=>{var i,n;null!=(i=e.bootstrap)&&null!=(i=i.featureFlagPayloads)&&i[r]&&(t[r]=null==(n=e.bootstrap)||null==(n=n.featureFlagPayloads)?void 0:n[r]);return t}),{});this.featureFlags.receivedFeatureFlags({featureFlags:g,featureFlagPayloads:m})}if(u)this.register_once({distinct_id:lo,$device_id:null},"");else if(!this.get_distinct_id()){var y=this.config.get_device_id(Ha());this.register_once({distinct_id:y,$device_id:y},""),this.persistence.set_property(to,"anonymous")}return Sn(Yi,"onpagehide"in self?"pagehide":"unload",this._handle_unload.bind(this),{passive:!1}),this.toolbar.maybeLoadToolbar(),e.segment?$d(this,(()=>this.sn())):this.sn(),zr(this.config._onCapture)&&this.config._onCapture!==vf&&(un.warn("onCapture is deprecated. Please use `before_send` instead"),this.on("eventCaptured",(t=>this.config._onCapture(t.event,t)))),this.config.ip&&un.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}Ye(t){var e,r,i,n,o,s,a,l;if(!Ji||!Ji.body)return un.info("document not ready yet, trying again in 500 milliseconds..."),void setTimeout((()=>{this.Ye(t)}),500);this.compression=void 0,t.supportedCompression&&!this.config.disable_compression&&(this.compression=$r(t.supportedCompression,Hl.GZipJS)?Hl.GZipJS:$r(t.supportedCompression,Hl.Base64)?Hl.Base64:void 0),null!=(e=t.analytics)&&e.endpoint&&(this.analyticsDefaultEndpoint=t.analytics.endpoint),this.set_config({person_profiles:this.Ui?this.Ui:"identified_only"}),null==(r=this.siteApps)||r.onRemoteConfig(t),null==(i=this.sessionRecording)||i.onRemoteConfig(t),null==(n=this.autocapture)||n.onRemoteConfig(t),null==(o=this.heatmaps)||o.onRemoteConfig(t),this.surveys.onRemoteConfig(t),null==(s=this.webVitalsAutocapture)||s.onRemoteConfig(t),null==(a=this.exceptionObserver)||a.onRemoteConfig(t),this.exceptions.onRemoteConfig(t),null==(l=this.deadClicksAutocapture)||l.onRemoteConfig(t)}sn(){try{this.config.loaded(this)}catch(t){un.critical("`loaded` function failed",t)}this.an(),this.config.capture_pageview&&setTimeout((()=>{(this.consent.isOptedIn()||"always"===this.config.cookieless_mode)&&this.ln()}),1),new Bv(this).load(),this.featureFlags.flags()}an(){var t;this.is_capturing()&&(this.config.request_batching&&(null==(t=this.tn)||t.enable()))}_dom_loaded(){this.is_capturing()&&dn(this.__request_queue,(t=>this.en(t))),this.__request_queue=[],this.an()}_handle_unload(){var t,e;this.config.request_batching?(this.un()&&this.capture("$pageleave"),null==(t=this.tn)||t.unload(),null==(e=this.rn)||e.unload()):this.un()&&this.capture("$pageleave",null,{transport:"sendBeacon"})}je(t){this.__loaded&&(pf?this.__request_queue.push(t):this.rateLimiter.isServerRateLimited(t.batchKey)||(t.transport=t.transport||this.config.api_transport,t.url=xu(t.url,{ip:this.config.ip?1:0}),t.headers=r({},this.config.request_headers),t.compression="best-available"===t.compression?this.compression:t.compression,t.disableXHRCredentials=this.config.__preview_disable_xhr_credentials,this.config.__preview_disable_beacon&&(t.disableTransport=["sendBeacon"]),t.fetchOptions=t.fetchOptions||this.config.fetch_options,(t=>{var e,i,n,o=r({},t);o.timeout=o.timeout||6e4,o.url=xu(o.url,{_:(new Date).getTime().toString(),ver:an.LIB_VERSION,compression:o.compression});var s=null!==(e=o.transport)&&void 0!==e?e:"fetch",a=Mu.filter((t=>!o.disableTransport||!t.transport||!o.disableTransport.includes(t.transport))),l=null!==(i=null==(n=In(a,(t=>t.transport===s)))?void 0:n.method)&&void 0!==i?i:a[0].method;if(!l)throw new Error("No available transport method");l(o)})(r({},t,{callback:e=>{var r,i;(this.rateLimiter.checkForLimiting(e),e.statusCode>=400)&&(null==(r=(i=this.config).on_request_error)||r.call(i,e));null==t.callback||t.callback(e)}}))))}en(t){this.rn?this.rn.retriableRequest(t):this.je(t)}_execute_array(t){var e,r=[],i=[],n=[];dn(t,(t=>{t&&(e=t[0],Wr(e)?n.push(t):zr(t)?t.call(this):Wr(t)&&"alias"===e?r.push(t):Wr(t)&&-1!==e.indexOf("capture")&&zr(this[e])?n.push(t):i.push(t))}));var o=function(t,e){dn(t,(function(t){if(Wr(t[0])){var r=e;vn(t,(function(t){r=r[t[0]].apply(r,t.slice(1))}))}else this[t[0]].apply(this,t.slice(1))}),e)};o(r,this),o(i,this),o(n,this)}nn(){var t,e;return(null==(t=this.config.bootstrap)?void 0:t.featureFlags)&&Object.keys(null==(e=this.config.bootstrap)?void 0:e.featureFlags).length>0||!1}push(t){this._execute_array([t])}capture(t,e,i){var n;if(this.__loaded&&this.persistence&&this.sessionPersistence&&this.tn){if(this.is_capturing())if(!Kr(t)&&Qr(t)){if(this.config.opt_out_useragent_filter||!this._is_bot()){var o=null!=i&&i.skip_client_rate_limiting?void 0:this.rateLimiter.clientRateLimitContext();if(null==o||!o.isRateLimited){null!=e&&e.$current_url&&!Qr(null==e?void 0:e.$current_url)&&(un.error("Invalid `$current_url` property provided to `posthog.capture`. Input must be a string. Ignoring provided value."),null==e||delete e.$current_url),this.sessionPersistence.update_search_keyword(),this.config.save_campaign_params&&this.sessionPersistence.update_campaign_params(),this.config.save_referrer&&this.sessionPersistence.update_referrer_info(),(this.config.save_campaign_params||this.config.save_referrer)&&this.persistence.set_initial_person_info();var s=new Date,a=(null==i?void 0:i.timestamp)||s,l=Ha(),u={uuid:l,event:t,properties:this.calculateEventProperties(t,e||{},a,l)};o&&(u.properties.$lib_rate_limit_remaining_tokens=o.remainingTokens),(null==i?void 0:i.$set)&&(u.$set=null==i?void 0:i.$set);var c=this.cn(null==i?void 0:i.$set_once);if(c&&(u.$set_once=c),(u=wn(u,null!=i&&i._noTruncate?null:this.config.properties_string_max_length)).timestamp=a,Kr(null==i?void 0:i.timestamp)||(u.properties.$event_time_override_provided=!0,u.properties.$event_time_override_system_time=s),t===Ca.DISMISSED||t===Ca.SENT){var h=null==e?void 0:e[Ia.SURVEY_ID],d=null==e?void 0:e[Ia.SURVEY_ITERATION];Fa({id:h,current_iteration:d}),u.$set=r({},u.$set,{[Na({id:h,current_iteration:d},t===Ca.SENT?"responded":"dismissed")]:!0})}var v=r({},u.properties.$set,u.$set);if(Jr(v)||this.setPersonPropertiesForFlags(v),!ri(this.config.before_send)){var f=this.hn(u);if(!f)return;u=f}this.Gi.emit("eventCaptured",u);var p={method:"POST",url:null!==(n=null==i?void 0:i._url)&&void 0!==n?n:this.requestRouter.endpointFor("api",this.analyticsDefaultEndpoint),data:u,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.en(p):this.tn.enqueue(p),u}un.critical("This capture call is ignored due to client rate limiting.")}}else un.error("No event name provided to posthog.capture")}else un.uninitializedWarning("posthog.capture")}hr(t){return this.on("eventCaptured",(e=>t(e.event,e)))}calculateEventProperties(t,e,i,n,o){if(i=i||new Date,!this.persistence||!this.sessionPersistence)return e;var s=o?void 0:this.persistence.remove_event_timer(t),a=r({},e);if(a.token=this.config.token,a.$config_defaults=this.config.defaults,("always"==this.config.cookieless_mode||"on_reject"==this.config.cookieless_mode&&this.consent.isExplicitlyOptedOut())&&(a.$cookieless_mode=!0),"$snapshot"===t){var l=r({},this.persistence.properties(),this.sessionPersistence.properties());return a.distinct_id=l.distinct_id,(!Qr(a.distinct_id)&&!ii(a.distinct_id)||ti(a.distinct_id))&&un.error("Invalid distinct_id for replay event. This indicates a bug in your implementation"),a}var u,c=yv(this.config.mask_personal_data_properties,this.config.custom_personal_data_properties);if(this.sessionManager){var{sessionId:h,windowId:d}=this.sessionManager.checkAndGetSessionAndWindowId(o,i.getTime());a.$session_id=h,a.$window_id=d}this.sessionPropsManager&&fn(a,this.sessionPropsManager.getSessionProps());try{var v;this.sessionRecording&&fn(a,this.sessionRecording.sdkDebugProperties),a.$sdk_debug_retry_queue_size=null==(v=this.rn)?void 0:v.length}catch(t){a.$sdk_debug_error_capturing_properties=String(t)}if(this.requestRouter.region===tf.CUSTOM&&(a.$lib_custom_api_host=this.config.api_host),u="$pageview"!==t||o?"$pageleave"!==t||o?this.pageViewManager.doEvent():this.pageViewManager.doPageLeave(i):this.pageViewManager.doPageView(i,n),a=fn(a,u),"$pageview"===t&&Ji&&(a.title=Ji.title),!Kr(s)){var f=i.getTime()-s;a.$duration=parseFloat((f/1e3).toFixed(3))}rn&&this.config.opt_out_useragent_filter&&(a.$browser_type=this._is_bot()?"bot":"browser"),(a=fn({},c,this.persistence.properties(),this.sessionPersistence.properties(),a)).$is_identified=this._isIdentified(),Wr(this.config.property_denylist)?vn(this.config.property_denylist,(function(t){delete a[t]})):un.error("Invalid value for property_denylist config: "+this.config.property_denylist+" or property_blacklist config: "+this.config.property_blacklist);var p=this.config.sanitize_properties;p&&(un.error("sanitize_properties is deprecated. Use before_send instead"),a=p(a,t));var g=this.dn();return a.$process_person_profile=g,g&&!o&&this.vn("_calculate_event_properties"),a}cn(t){var e;if(!this.persistence||!this.dn())return t;if(this.Yi)return t;var r=this.persistence.get_initial_props(),i=null==(e=this.sessionPropsManager)?void 0:e.getSetOnceProps(),n=fn({},r,i||{},t||{}),o=this.config.sanitize_properties;return o&&(un.error("sanitize_properties is deprecated. Use before_send instead"),n=o(n,"$set_once")),this.Yi=!0,Jr(n)?void 0:n}register(t,e){var r;null==(r=this.persistence)||r.register(t,e)}register_once(t,e,r){var i;null==(i=this.persistence)||i.register_once(t,e,r)}register_for_session(t){var e;null==(e=this.sessionPersistence)||e.register(t)}unregister(t){var e;null==(e=this.persistence)||e.unregister(t)}unregister_for_session(t){var e;null==(e=this.sessionPersistence)||e.unregister(t)}fn(t,e){this.register({[t]:e})}getFeatureFlag(t,e){return this.featureFlags.getFeatureFlag(t,e)}getFeatureFlagPayload(t){var e=this.featureFlags.getFeatureFlagPayload(t);try{return JSON.parse(e)}catch(t){return e}}isFeatureEnabled(t,e){return this.featureFlags.isFeatureEnabled(t,e)}reloadFeatureFlags(){this.featureFlags.reloadFeatureFlags()}updateEarlyAccessFeatureEnrollment(t,e,r){this.featureFlags.updateEarlyAccessFeatureEnrollment(t,e,r)}getEarlyAccessFeatures(t,e,r){return void 0===e&&(e=!1),this.featureFlags.getEarlyAccessFeatures(t,e,r)}on(t,e){return this.Gi.on(t,e)}onFeatureFlags(t){return this.featureFlags.onFeatureFlags(t)}onSurveysLoaded(t){return this.surveys.onSurveysLoaded(t)}onSessionId(t){var e,r;return null!==(e=null==(r=this.sessionManager)?void 0:r.onSessionId(t))&&void 0!==e?e:()=>{}}getSurveys(t,e){void 0===e&&(e=!1),this.surveys.getSurveys(t,e)}getActiveMatchingSurveys(t,e){void 0===e&&(e=!1),this.surveys.getActiveMatchingSurveys(t,e)}renderSurvey(t,e){this.surveys.renderSurvey(t,e)}displaySurvey(t,e){void 0===e&&(e=Pa),this.surveys.displaySurvey(t,e)}canRenderSurvey(t){return this.surveys.canRenderSurvey(t)}canRenderSurveyAsync(t,e){return void 0===e&&(e=!1),this.surveys.canRenderSurveyAsync(t,e)}identify(t,e,i){if(!this.__loaded||!this.persistence)return un.uninitializedWarning("posthog.identify");if(ii(t)&&(t=t.toString(),un.warn("The first argument to posthog.identify was a number, but it should be a string. It has been converted to a string.")),t)if(["distinct_id","distinctid"].includes(t.toLowerCase()))un.critical('The string "'+t+'" was set in posthog.identify which indicates an error. This ID should be unique to the user and not a hardcoded string.');else if(t!==lo){if(this.vn("posthog.identify")){var n=this.get_distinct_id();if(this.register({$user_id:t}),!this.get_property("$device_id")){var o=n;this.register_once({$had_persisted_distinct_id:!0,$device_id:o},"")}t!==n&&t!==this.get_property(Fn)&&(this.unregister(Fn),this.register({distinct_id:t}));var s="anonymous"===(this.persistence.get_property(to)||"anonymous");t!==n&&s?(this.persistence.set_property(to,"identified"),this.setPersonPropertiesForFlags(r({},i||{},e||{}),!1),this.capture("$identify",{distinct_id:t,$anon_distinct_id:n},{$set:e||{},$set_once:i||{}}),this.Xi=Nu(t,e,i),this.featureFlags.setAnonymousDistinctId(n)):(e||i)&&this.setPersonProperties(e,i),t!==n&&(this.reloadFeatureFlags(),this.unregister(Qn))}}else un.critical('The string "'+lo+'" was set in posthog.identify which indicates an error. This ID is only used as a sentinel value.');else un.error("Unique user id has not been set in posthog.identify")}setPersonProperties(t,e){if((t||e)&&this.vn("posthog.setPersonProperties")){var i=Nu(this.get_distinct_id(),t,e);this.Xi!==i?(this.setPersonPropertiesForFlags(r({},e||{},t||{})),this.capture("$set",{$set:t||{},$set_once:e||{}}),this.Xi=i):un.info("A duplicate setPersonProperties call was made with the same properties. It has been ignored.")}}group(t,e,i){if(t&&e){if(this.vn("posthog.group")){var n=this.getGroups();n[t]!==e&&this.resetGroupPropertiesForFlags(t),this.register({$groups:r({},n,{[t]:e})}),i&&(this.capture("$groupidentify",{$group_type:t,$group_key:e,$group_set:i}),this.setGroupPropertiesForFlags({[t]:i})),n[t]===e||i||this.reloadFeatureFlags()}}else un.error("posthog.group requires a group type and group key")}resetGroups(){this.register({$groups:{}}),this.resetGroupPropertiesForFlags(),this.reloadFeatureFlags()}setPersonPropertiesForFlags(t,e){void 0===e&&(e=!0),this.featureFlags.setPersonPropertiesForFlags(t,e)}resetPersonPropertiesForFlags(){this.featureFlags.resetPersonPropertiesForFlags()}setGroupPropertiesForFlags(t,e){void 0===e&&(e=!0),this.vn("posthog.setGroupPropertiesForFlags")&&this.featureFlags.setGroupPropertiesForFlags(t,e)}resetGroupPropertiesForFlags(t){this.featureFlags.resetGroupPropertiesForFlags(t)}reset(t){var e,r,i,n;if(un.info("reset"),!this.__loaded)return un.uninitializedWarning("posthog.reset");var o=this.get_property("$device_id");if(this.consent.reset(),null==(e=this.persistence)||e.clear(),null==(r=this.sessionPersistence)||r.clear(),this.surveys.reset(),this.featureFlags.reset(),null==(i=this.persistence)||i.set_property(to,"anonymous"),null==(n=this.sessionManager)||n.resetSessionId(),this.Xi=null,"always"===this.config.cookieless_mode)this.register_once({distinct_id:lo,$device_id:null},"");else{var s=this.config.get_device_id(Ha());this.register_once({distinct_id:s,$device_id:t?s:o},"")}this.register({$last_posthog_reset:(new Date).toISOString()},1)}get_distinct_id(){return this.get_property("distinct_id")}getGroups(){return this.get_property("$groups")||{}}get_session_id(){var t,e;return null!==(t=null==(e=this.sessionManager)?void 0:e.checkAndGetSessionAndWindowId(!0).sessionId)&&void 0!==t?t:""}get_session_replay_url(t){if(!this.sessionManager)return"";var{sessionId:e,sessionStartTimestamp:r}=this.sessionManager.checkAndGetSessionAndWindowId(!0),i=this.requestRouter.endpointFor("ui","/project/"+this.config.token+"/replay/"+e);if(null!=t&&t.withTimestamp&&r){var n,o=null!==(n=t.timestampLookBack)&&void 0!==n?n:10;if(!r)return i;i+="?t="+Math.max(Math.floor(((new Date).getTime()-r)/1e3)-o,0)}return i}alias(t,e){return t===this.get_property(Rn)?(un.critical("Attempting to create alias for existing People user - aborting."),-2):this.vn("posthog.alias")?(Kr(e)&&(e=this.get_distinct_id()),t!==e?(this.fn(Fn,t),this.capture("$create_alias",{alias:t,distinct_id:e})):(un.warn("alias matches current distinct_id - skipping api call."),this.identify(t),-1)):void 0}set_config(t){var e=r({},this.config);if(Xr(t)){var i,n,o,s,a;fn(this.config,mf(t));var l=this.Qi();null==(i=this.persistence)||i.update_config(this.config,e,l),this.sessionPersistence="sessionStorage"===this.config.persistence||"memory"===this.config.persistence?this.persistence:new Ev(r({},this.config,{persistence:"sessionStorage"}),l),Id.Dt()&&"true"===Id.Zt("ph_debug")&&(this.config.debug=!0),this.config.debug&&(an.DEBUG=!0,un.info("set_config",{config:t,oldConfig:e,newConfig:r({},this.config)})),null==(n=this.sessionRecording)||n.startIfEnabledOrStop(),null==(o=this.autocapture)||o.startIfEnabled(),null==(s=this.heatmaps)||s.startIfEnabled(),this.surveys.loadIfEnabled(),this.pn(),null==(a=this.externalIntegrations)||a.startIfEnabledOrStop()}}startSessionRecording(t){var e=!0===t,r={sampling:e||!(null==t||!t.sampling),linked_flag:e||!(null==t||!t.linked_flag),url_trigger:e||!(null==t||!t.url_trigger),event_trigger:e||!(null==t||!t.event_trigger)};if(Object.values(r).some(Boolean)){var i,n,o,s,a;if(null==(i=this.sessionManager)||i.checkAndGetSessionAndWindowId(),r.sampling)null==(n=this.sessionRecording)||n.overrideSampling();if(r.linked_flag)null==(o=this.sessionRecording)||o.overrideLinkedFlag();if(r.url_trigger)null==(s=this.sessionRecording)||s.overrideTrigger("url");if(r.event_trigger)null==(a=this.sessionRecording)||a.overrideTrigger("event")}this.set_config({disable_session_recording:!1})}stopSessionRecording(){this.set_config({disable_session_recording:!0})}sessionRecordingStarted(){var t;return!(null==(t=this.sessionRecording)||!t.started)}captureException(t,e){var i=new Error("PostHog syntheticException"),n=this.exceptions.buildProperties(t,{handled:!0,syntheticException:i});return this.exceptions.sendExceptionEvent(r({},n,e))}loadToolbar(t){return this.toolbar.loadToolbar(t)}get_property(t){var e;return null==(e=this.persistence)?void 0:e.props[t]}getSessionProperty(t){var e;return null==(e=this.sessionPersistence)?void 0:e.props[t]}toString(){var t,e=null!==(t=this.config.name)&&void 0!==t?t:ff;return e!==ff&&(e=ff+"."+e),e}_isIdentified(){var t,e;return"identified"===(null==(t=this.persistence)?void 0:t.get_property(to))||"identified"===(null==(e=this.sessionPersistence)?void 0:e.get_property(to))}dn(){var t,e;return!("never"===this.config.person_profiles||"identified_only"===this.config.person_profiles&&!this._isIdentified()&&Jr(this.getGroups())&&(null==(t=this.persistence)||null==(t=t.props)||!t[Fn])&&(null==(e=this.persistence)||null==(e=e.props)||!e[so]))}un(){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.dn()||this.vn("posthog.createPersonProfile")&&this.setPersonProperties({},{})}vn(t){return"never"===this.config.person_profiles?(un.error(t+' was called, but process_person is set to "never". This call will be ignored.'),!1):(this.fn(so,!0),!0)}Qi(){if("always"===this.config.cookieless_mode)return!0;var t=this.consent.isOptedOut(),e=this.config.opt_out_persistence_by_default||"on_reject"===this.config.cookieless_mode;return this.config.disable_persistence||t&&!!e}pn(){var t,e,r,i,n=this.Qi();(null==(t=this.persistence)?void 0:t.Je)!==n&&(null==(r=this.persistence)||r.set_disabled(n));(null==(e=this.sessionPersistence)?void 0:e.Je)!==n&&(null==(i=this.sessionPersistence)||i.set_disabled(n));return n}opt_in_capturing(t){if("always"!==this.config.cookieless_mode){var e;if("on_reject"===this.config.cookieless_mode&&this.consent.isExplicitlyOptedOut()&&(this.reset(!0),this.sessionManager=new Wv(this),this.persistence&&(this.sessionPropsManager=new Yv(this,this.sessionManager,this.persistence)),this.sessionRecording=new hf(this),this.sessionRecording.startIfEnabledOrStop()),this.consent.optInOut(!0),this.pn(),this.an(),"on_reject"==this.config.cookieless_mode&&this.surveys.loadIfEnabled(),Kr(null==t?void 0:t.captureEventName)||null!=t&&t.captureEventName)this.capture(null!==(e=null==t?void 0:t.captureEventName)&&void 0!==e?e:"$opt_in",null==t?void 0:t.captureProperties,{send_instantly:!0});this.config.capture_pageview&&this.ln()}else un.warn('Consent opt in/out is not valid with cookieless_mode="always" and will be ignored')}opt_out_capturing(){var t;"always"!==this.config.cookieless_mode?("on_reject"===this.config.cookieless_mode&&this.consent.isOptedIn()&&this.reset(!0),this.consent.optInOut(!1),this.pn(),"on_reject"===this.config.cookieless_mode&&(this.register({distinct_id:lo,$device_id:null}),this.sessionManager=void 0,this.sessionPropsManager=void 0,null==(t=this.sessionRecording)||t.stopRecording(),this.sessionRecording=void 0,this.ln())):un.warn('Consent opt in/out is not valid with cookieless_mode="always" and will be ignored')}has_opted_in_capturing(){return this.consent.isOptedIn()}has_opted_out_capturing(){return this.consent.isOptedOut()}get_explicit_consent_status(){var t=this.consent.consent;return t===Ed.GRANTED?"granted":t===Ed.DENIED?"denied":"pending"}is_capturing(){return"always"===this.config.cookieless_mode||("on_reject"===this.config.cookieless_mode?this.consent.isExplicitlyOptedOut()||this.consent.isOptedIn():!this.has_opted_out_capturing())}clear_opt_in_out_capturing(){this.consent.reset(),this.pn()}_is_bot(){return Xi?Qv(Xi,this.config.custom_blocked_useragents):void 0}ln(){Ji&&("visible"===Ji.visibilityState?this.Wi||(this.Wi=!0,this.capture("$pageview",{title:Ji.title},{send_instantly:!0}),this.zi&&(Ji.removeEventListener("visibilitychange",this.zi),this.zi=null)):this.zi||(this.zi=this.ln.bind(this),Sn(Ji,"visibilitychange",this.zi)))}debug(t){!1===t?(null==Yi||Yi.console.log("You've disabled debug mode."),localStorage&&localStorage.removeItem("ph_debug"),this.set_config({debug:!1})):(null==Yi||Yi.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)`."),localStorage&&localStorage.setItem("ph_debug","true"),this.set_config({debug:!0}))}yt(){var t,e,r,i,n,o,s,a=this.Ji||{};return"advanced_disable_flags"in a?!!a.advanced_disable_flags:!1!==this.config.advanced_disable_flags?!!this.config.advanced_disable_flags:!0===this.config.advanced_disable_decide?(un.warn("Config field 'advanced_disable_decide' is deprecated. Please use 'advanced_disable_flags' instead. The old field will be removed in a future major version."),!0):(r="advanced_disable_decide",i=!1,n=un,o=(e="advanced_disable_flags")in(t=a)&&!Kr(t[e]),s=r in t&&!Kr(t[r]),o?t[e]:s?(n&&n.warn("Config field '"+r+"' is deprecated. Please use '"+e+"' instead. The old field will be removed in a future major version."),t[r]):i)}hn(t){if(ri(this.config.before_send))return t;var e=Wr(this.config.before_send)?this.config.before_send:[this.config.before_send],r=t;for(var i of e){if(r=i(r),ri(r)){var n="Event '"+t.event+"' was rejected in beforeSend function";return si(t.event)?un.warn(n+". This can cause unexpected behavior."):un.info(n),null}r.properties&&!Jr(r.properties)||un.warn("Event '"+t.event+"' has no properties after beforeSend function, this is likely an error.")}return r}getPageViewId(){var t;return null==(t=this.pageViewManager.Ne)?void 0:t.pageViewId}captureTraceFeedback(t,e){this.capture("$ai_feedback",{$ai_trace_id:String(t),$ai_feedback_text:e})}captureTraceMetric(t,e,r){this.capture("$ai_metric",{$ai_trace_id:String(t),$ai_metric_name:e,$ai_metric_value:String(r)})}}!function(t,e){for(var r=0;r<e.length;r++)t.prototype[e[r]]=yn(t.prototype[e[r]])}(bf,["identify"]);var wf,_f;wf=df[ff]=new bf,(_f=nn.posthog)&&vn(_f._i,(function(t){if(t&&Wr(t)){var e=wf.init(t[0],t[1],t[2]),r=_f[t[2]]||_f;e&&(e._execute_array.call(e.people,r.people),e._execute_array(r))}})),nn.posthog=wf,function(){function t(){t.done||(t.done=!0,pf=!1,vn(df,(function(t){t._dom_loaded()})))}null!=Ji&&Ji.addEventListener?"complete"===Ji.readyState?t():Sn(Ji,"DOMContentLoaded",t,{capture:!1}):Yi&&un.error("Browser doesn't support `document.addEventListener` so PostHog couldn't be initialized")}()}();
1
+ !function(){"use strict";function t(t,e,r,i,n,o,s){try{var a=t[o](s),l=a.value}catch(t){return void r(t)}a.done?e(l):Promise.resolve(l).then(i,n)}function e(e){return function(){var r=this,i=arguments;return new Promise((function(n,o){var s=e.apply(r,i);function a(e){t(s,n,o,a,l,"next",e)}function l(e){t(s,n,o,a,l,"throw",e)}a(void 0)}))}}function r(){return r=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var i in r)({}).hasOwnProperty.call(r,i)&&(t[i]=r[i])}return t},r.apply(null,arguments)}function i(t,e){if(null==t)return{};var r={};for(var i in t)if({}.hasOwnProperty.call(t,i)){if(-1!==e.indexOf(i))continue;r[i]=t[i]}return r}var n,o=["type"],s=Object.defineProperty,a=(t,e,r)=>((t,e,r)=>e in t?s(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r)(t,"symbol"!=typeof e?e+"":e,r),l=Object.defineProperty,u=(t,e,r)=>((t,e,r)=>e in t?l(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r)(t,"symbol"!=typeof e?e+"":e,r),c=(t=>(t[t.Document=0]="Document",t[t.DocumentType=1]="DocumentType",t[t.Element=2]="Element",t[t.Text=3]="Text",t[t.CDATA=4]="CDATA",t[t.Comment=5]="Comment",t))(c||{}),h={Node:["childNodes","parentNode","parentElement","textContent"],ShadowRoot:["host","styleSheets"],Element:["shadowRoot","querySelector","querySelectorAll"],MutationObserver:[]},d={Node:["contains","getRootNode"],ShadowRoot:["getSelection"],Element:[],MutationObserver:["constructor"]};var v={};function f(t){if(v[t])return v[t];var e=function(t){var e,r=null==globalThis||null==(e=globalThis.Zone)||null==e.__symbol__?void 0:e.__symbol__(t);return r&&globalThis[r]?globalThis[r]:void 0}(t)||globalThis[t],r=e.prototype,i=t in h?h[t]:void 0,n=Boolean(i&&i.every((t=>{var e,i;return Boolean(null==(i=null==(e=Object.getOwnPropertyDescriptor(r,t))?void 0:e.get)?void 0:i.toString().includes("[native code]"))}))),o=t in d?d[t]:void 0,s=Boolean(o&&o.every((t=>{var e;return"function"==typeof r[t]&&(null==(e=r[t])?void 0:e.toString().includes("[native code]"))})));if(n&&s)return v[t]=e.prototype,e.prototype;try{var a=document.createElement("iframe");document.body.appendChild(a);var l=a.contentWindow;if(!l)return e.prototype;var u=l[t].prototype;return document.body.removeChild(a),u?v[t]=u:e.prototype}catch(t){return e.prototype}}var p={};function g(t,e,r){var i,n=t+"."+String(r);if(p[n])return p[n].call(e);var o=f(t),s=null==(i=Object.getOwnPropertyDescriptor(o,r))?void 0:i.get;return s?(p[n]=s,s.call(e)):e[r]}var m={};function y(t,e,r){var i=t+"."+String(r);if(m[i])return m[i].bind(e);var n=f(t)[r];return"function"!=typeof n?e[r]:(m[i]=n,n.bind(e))}var b={childNodes:function(t){return g("Node",t,"childNodes")},parentNode:function(t){return g("Node",t,"parentNode")},parentElement:function(t){return g("Node",t,"parentElement")},textContent:function(t){return g("Node",t,"textContent")},contains:function(t,e){return y("Node",t,"contains")(e)},getRootNode:function(t){return y("Node",t,"getRootNode")()},host:function(t){return t&&"host"in t?g("ShadowRoot",t,"host"):null},styleSheets:function(t){return t.styleSheets},shadowRoot:function(t){return t&&"shadowRoot"in t?g("Element",t,"shadowRoot"):null},querySelector:function(t,e){return g("Element",t,"querySelector")(e)},querySelectorAll:function(t,e){return g("Element",t,"querySelectorAll")(e)},mutationObserver:function(){return f("MutationObserver").constructor}};function w(t){return t.nodeType===t.ELEMENT_NODE}function _(t){var e=t&&"host"in t&&"mode"in t&&b.host(t)||null;return Boolean(e&&"shadowRoot"in e&&b.shadowRoot(e)===t)}function C(t){return"[object ShadowRoot]"===Object.prototype.toString.call(t)}function I(t){try{var e=t.rules||t.cssRules;if(!e)return null;var r=Array.from(e,(e=>S(e,t.href))).join("");return(i=r).includes(" background-clip: text;")&&!i.includes(" -webkit-background-clip: text;")&&(i=i.replace(/\sbackground-clip:\s*text;/g," -webkit-background-clip: text; background-clip: text;")),i}catch(t){return null}var i}function S(t,e){if(function(t){return"styleSheet"in t}(t)){var r;try{r=I(t.styleSheet)||function(t){var{cssText:e}=t;if(e.split('"').length<3)return e;var r=["@import","url("+JSON.stringify(t.href)+")"];return""===t.layerName?r.push("layer"):t.layerName&&r.push("layer("+t.layerName+")"),t.supportsText&&r.push("supports("+t.supportsText+")"),t.media.length&&r.push(t.media.mediaText),r.join(" ")+";"}(t)}catch(e){r=t.cssText}return t.styleSheet.href?L(r,t.styleSheet.href):r}var i,n=t.cssText;return function(t){return"selectorText"in t}(t)&&t.selectorText.includes(":")&&(i=/(\[(?:[\w-]+)[^\\])(:(?:[\w-]+)\])/gm,n=n.replace(i,"$1\\$2")),e?L(n,e):n}function k(t,e){return Array.from(t.styleSheets).find((t=>t.href===e))}let x=class{constructor(){u(this,"idNodeMap",new Map),u(this,"nodeMetaMap",new WeakMap)}getId(t){var e;if(!t)return-1;var r=null==(e=this.getMeta(t))?void 0:e.id;return null!=r?r:-1}getNode(t){return this.idNodeMap.get(t)||null}getIds(){return Array.from(this.idNodeMap.keys())}getMeta(t){return this.nodeMetaMap.get(t)||null}removeNodeFromMap(t){var e=this.getId(t);this.idNodeMap.delete(e),t.childNodes&&t.childNodes.forEach((t=>this.removeNodeFromMap(t)))}has(t){return this.idNodeMap.has(t)}hasNode(t){return this.nodeMetaMap.has(t)}add(t,e){var r=e.id;this.idNodeMap.set(r,t),this.nodeMetaMap.set(t,e)}replace(t,e){var r=this.getNode(t);if(r){var i=this.nodeMetaMap.get(r);i&&this.nodeMetaMap.set(e,i)}this.idNodeMap.set(t,e)}reset(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap}};function A(t){var{element:e,maskInputOptions:r,tagName:i,type:n,value:o,maskInputFn:s}=t,a=o||"",l=n&&T(n);return(r[i.toLowerCase()]||l&&r[l])&&(a=s?s(a,e):"*".repeat(a.length)),a}function T(t){return t.toLowerCase()}var M="__rrweb_original__";function E(t){var e=t.type;return t.hasAttribute("data-rr-is-password")?"password":e?T(e):null}function N(t,e){var r,i;try{i=new URL(t,null!=e?e:window.location.href)}catch(t){return null}var n=i.pathname.match(/\.([0-9a-z]+)(?:$)/i);return null!==(r=null==n?void 0:n[1])&&void 0!==r?r:null}var R=/url\((?:(')([^']*)'|(")(.*?)"|([^)]*))\)/gm,F=/^(?:[a-z+]+:)?\/\//i,O=/^www\..*/i,P=/^(data:)([^,]*),(.*)/i;function L(t,e){return(t||"").replace(R,((t,r,i,n,o,s)=>{var a,l=i||o||s,u=r||n||"";if(!l)return t;if(F.test(l)||O.test(l))return"url("+u+l+u+")";if(P.test(l))return"url("+u+l+u+")";if("/"===l[0])return"url("+u+(((a=e).indexOf("//")>-1?a.split("/").slice(0,3).join("/"):a.split("/")[0]).split("?")[0]+l)+u+")";var c=e.split("/"),h=l.split("/");for(var d of(c.pop(),h))"."!==d&&(".."===d?c.pop():c.push(d));return"url("+u+c.join("/")+u+")"}))}var D,B,Z=1,q=new RegExp("[^a-z0-9-_:]"),H=-2;function V(){return Z++}var j=/^[^ \t\n\r\u000c]+/,Y=/^[, \t\n\r\u000c]+/;var G=new WeakMap;function W(t,e){return e&&""!==e.trim()?U(t,e):e}function z(t){return Boolean("svg"===t.tagName||t.ownerSVGElement)}function U(t,e){var r=G.get(t);if(r||(r=t.createElement("a"),G.set(t,r)),e){if(e.startsWith("blob:")||e.startsWith("data:"))return e}else e="";return r.setAttribute("href",e),r.href}function X(t,e,r,i){return i?"src"===r||"href"===r&&("use"!==e||"#"!==i[0])||"xlink:href"===r&&"#"!==i[0]?W(t,i):"background"!==r||"table"!==e&&"td"!==e&&"th"!==e?"srcset"===r?function(t,e){if(""===e.trim())return e;var r=0;function i(t){var i,n=t.exec(e.substring(r));return n?(i=n[0],r+=i.length,i):""}for(var n=[];i(Y),!(r>=e.length);){var o=i(j);if(","===o.slice(-1))o=W(t,o.substring(0,o.length-1)),n.push(o);else{var s="";o=W(t,o);for(var a=!1;;){var l=e.charAt(r);if(""===l){n.push((o+s).trim());break}if(a)")"===l&&(a=!1);else{if(","===l){r+=1,n.push((o+s).trim());break}"("===l&&(a=!0)}s+=l,r+=1}}}return n.join(", ")}(t,i):"style"===r?L(i,U(t)):"object"===e&&"data"===r?W(t,i):i:W(t,i):i}function J(t,e,r){return("video"===t||"audio"===t)&&"autoplay"===e}function K(t,e,r){if(!t)return!1;if(t.nodeType!==t.ELEMENT_NODE)return!!r&&K(b.parentNode(t),e,r);for(var i=t.classList.length;i--;){var n=t.classList[i];if(e.test(n))return!0}return!!r&&K(b.parentNode(t),e,r)}function Q(t,e,r,i){var n;if(w(t)){if(n=t,!b.childNodes(n).length)return!1}else{if(null===b.parentElement(t))return!1;n=b.parentElement(t)}try{if("string"==typeof e){if(i){if(n.closest("."+e))return!0}else if(n.classList.contains(e))return!0}else if(K(n,e,i))return!0;if(r)if(i){if(n.closest(r))return!0}else if(n.matches(r))return!0}catch(t){}return!1}function tt(t,e){var{doc:r,mirror:i,blockClass:n,blockSelector:o,needsMask:s,inlineStylesheet:a,maskInputOptions:l={},maskTextFn:u,maskInputFn:h,dataURLOptions:d={},inlineImages:v,recordCanvas:f,keepIframeSrcFn:p,newlyAddedElement:g=!1}=e,m=function(t,e){if(!e.hasNode(t))return;var r=e.getId(t);return 1===r?void 0:r}(r,i);switch(t.nodeType){case t.DOCUMENT_NODE:return"CSS1Compat"!==t.compatMode?{type:c.Document,childNodes:[],compatMode:t.compatMode}:{type:c.Document,childNodes:[]};case t.DOCUMENT_TYPE_NODE:return{type:c.DocumentType,name:t.name,publicId:t.publicId,systemId:t.systemId,rootId:m};case t.ELEMENT_NODE:return function(t,e){for(var r,{doc:i,blockClass:n,blockSelector:o,inlineStylesheet:s,maskInputOptions:a={},maskInputFn:l,dataURLOptions:u={},inlineImages:h,recordCanvas:d,keepIframeSrcFn:v,newlyAddedElement:f=!1,rootId:p}=e,g=function(t,e,r){try{if("string"==typeof e){if(t.classList.contains(e))return!0}else for(var i=t.classList.length;i--;){var n=t.classList[i];if(e.test(n))return!0}if(r)return t.matches(r)}catch(t){}return!1}(t,n,o),m=function(t){if(t instanceof HTMLFormElement)return"form";var e=T(t.tagName);return q.test(e)?"div":e}(t),y={},w=t.attributes.length,_=0;_<w;_++){var C=t.attributes[_];J(m,C.name,C.value)||(y[C.name]=X(i,m,T(C.name),C.value))}if("link"===m&&s){var S=function(t){return null==t?void 0:t.href}(t);if(S){var x=k(i,S);if(!x&&S.includes(".css"))x=k(i,window.location.origin+"/"+S.replace(window.location.href,""));var N=null;x&&(N=I(x)),N&&(delete y.rel,delete y.href,y._cssText=N)}}if("style"===m&&t.sheet&&!(t.innerText||b.textContent(t)||"").trim().length){var R=I(t.sheet);R&&(y._cssText=R)}if("input"===m||"textarea"===m||"select"===m){var F=t.value,O=t.checked;"radio"!==y.type&&"checkbox"!==y.type&&"submit"!==y.type&&"button"!==y.type&&F?y.value=A({element:t,type:E(t),tagName:m,value:F,maskInputOptions:a,maskInputFn:l}):O&&(y.checked=O)}"option"===m&&(t.selected&&!a.select?y.selected=!0:delete y.selected);if("dialog"===m&&t.open)try{y.rr_open_mode=t.matches("dialog:modal")?"modal":"non-modal"}catch(t){y.rr_open_mode="modal",y.ph_rr_could_not_detect_modal=!0}if("canvas"===m&&d)if("2d"===t.__context)(function(t){var e=t.getContext("2d");if(!e)return!0;for(var r=0;r<t.width;r+=50)for(var i=0;i<t.height;i+=50){var n=e.getImageData,o=M in n?n[M]:n;if(new Uint32Array(o.call(e,r,i,Math.min(50,t.width-r),Math.min(50,t.height-i)).data.buffer).some((t=>0!==t)))return!1}return!0})(t)||(y.rr_dataURL=t.toDataURL(u.type,u.quality));else if(!("__context"in t)){var P=t.toDataURL(u.type,u.quality),L=i.createElement("canvas");L.width=t.width,L.height=t.height,P!==L.toDataURL(u.type,u.quality)&&(y.rr_dataURL=P)}if("img"===m&&h){D||(D=i.createElement("canvas"),B=D.getContext("2d"));var Z=t,H=Z.currentSrc||Z.getAttribute("src")||"<unknown-src>",V=Z.crossOrigin,j=()=>{Z.removeEventListener("load",j);try{D.width=Z.naturalWidth,D.height=Z.naturalHeight,B.drawImage(Z,0,0),y.rr_dataURL=D.toDataURL(u.type,u.quality)}catch(t){if("anonymous"!==Z.crossOrigin)return Z.crossOrigin="anonymous",void(Z.complete&&0!==Z.naturalWidth?j():Z.addEventListener("load",j));console.warn("Cannot inline img src="+H+"! Error: "+t)}"anonymous"===Z.crossOrigin&&(V?y.crossOrigin=V:Z.removeAttribute("crossorigin"))};Z.complete&&0!==Z.naturalWidth?j():Z.addEventListener("load",j)}if("audio"===m||"video"===m){var Y=y;Y.rr_mediaState=t.paused?"paused":"played",Y.rr_mediaCurrentTime=t.currentTime,Y.rr_mediaPlaybackRate=t.playbackRate,Y.rr_mediaMuted=t.muted,Y.rr_mediaLoop=t.loop,Y.rr_mediaVolume=t.volume}f||(t.scrollLeft&&(y.rr_scrollLeft=t.scrollLeft),t.scrollTop&&(y.rr_scrollTop=t.scrollTop));if(g){var{width:G,height:W}=t.getBoundingClientRect();y={class:y.class,rr_width:G+"px",rr_height:W+"px"}}"iframe"!==m||v(y.src)||(t.contentDocument||(y.rr_src=y.src),delete y.src);try{customElements.get(m)&&(r=!0)}catch(t){}return{type:c.Element,tagName:m,attributes:y,childNodes:[],isSVG:z(t)||void 0,needBlock:g,rootId:p,isCustom:r}}(t,{doc:r,blockClass:n,blockSelector:o,inlineStylesheet:a,maskInputOptions:l,maskInputFn:h,dataURLOptions:d,inlineImages:v,recordCanvas:f,keepIframeSrcFn:p,newlyAddedElement:g,rootId:m});case t.TEXT_NODE:return function(t,e){var r,{needsMask:i,maskTextFn:n,rootId:o}=e,s=b.parentNode(t),a=s&&s.tagName,l=b.textContent(t),u="STYLE"===a||void 0,h="SCRIPT"===a||void 0;if(u&&l){try{t.nextSibling||t.previousSibling||(null==(r=s.sheet)?void 0:r.cssRules)&&(l=I(s.sheet))}catch(e){console.warn("Cannot get CSS styles from text's parentNode. Error: "+e,t)}l=L(l,U(e.doc))}h&&(l="SCRIPT_PLACEHOLDER");!u&&!h&&l&&i&&(l=n?n(l,b.parentElement(t)):l.replace(/[\S]/g,"*"));return{type:c.Text,textContent:l||"",isStyle:u,rootId:o}}(t,{doc:r,needsMask:s,maskTextFn:u,rootId:m});case t.CDATA_SECTION_NODE:return{type:c.CDATA,textContent:"",rootId:m};case t.COMMENT_NODE:return{type:c.Comment,textContent:b.textContent(t)||"",rootId:m};default:return!1}}function et(t){return null==t?"":t.toLowerCase()}function rt(t,e){var{doc:r,mirror:i,blockClass:n,blockSelector:o,maskTextClass:s,maskTextSelector:a,skipChild:l=!1,inlineStylesheet:u=!0,maskInputOptions:h={},maskTextFn:d,maskInputFn:v,slimDOMOptions:f,dataURLOptions:p={},inlineImages:g=!1,recordCanvas:m=!1,onSerialize:y,onIframeLoad:I,iframeLoadTimeout:S=5e3,onStylesheetLoad:k,stylesheetLoadTimeout:x=5e3,keepIframeSrcFn:A=(()=>!1),newlyAddedElement:T=!1}=e,{needsMask:M}=e,{preserveWhiteSpace:E=!0}=e;M||(M=Q(t,s,a,void 0===M));var R,F=tt(t,{doc:r,mirror:i,blockClass:n,blockSelector:o,needsMask:M,inlineStylesheet:u,maskInputOptions:h,maskTextFn:d,maskInputFn:v,dataURLOptions:p,inlineImages:g,recordCanvas:m,keepIframeSrcFn:A,newlyAddedElement:T});if(!F)return console.warn(t,"not serialized"),null;R=i.hasNode(t)?i.getId(t):!function(t,e){if(e.comment&&t.type===c.Comment)return!0;if(t.type===c.Element){if(e.script&&("script"===t.tagName||"link"===t.tagName&&("preload"===t.attributes.rel||"modulepreload"===t.attributes.rel)&&"script"===t.attributes.as||"link"===t.tagName&&"prefetch"===t.attributes.rel&&"string"==typeof t.attributes.href&&"js"===N(t.attributes.href)))return!0;if(e.headFavicon&&("link"===t.tagName&&"shortcut icon"===t.attributes.rel||"meta"===t.tagName&&(et(t.attributes.name).match(/^msapplication-tile(image|color)$/)||"application-name"===et(t.attributes.name)||"icon"===et(t.attributes.rel)||"apple-touch-icon"===et(t.attributes.rel)||"shortcut icon"===et(t.attributes.rel))))return!0;if("meta"===t.tagName){if(e.headMetaDescKeywords&&et(t.attributes.name).match(/^description|keywords$/))return!0;if(e.headMetaSocial&&(et(t.attributes.property).match(/^(og|twitter|fb):/)||et(t.attributes.name).match(/^(og|twitter):/)||"pinterest"===et(t.attributes.name)))return!0;if(e.headMetaRobots&&("robots"===et(t.attributes.name)||"googlebot"===et(t.attributes.name)||"bingbot"===et(t.attributes.name)))return!0;if(e.headMetaHttpEquiv&&void 0!==t.attributes["http-equiv"])return!0;if(e.headMetaAuthorship&&("author"===et(t.attributes.name)||"generator"===et(t.attributes.name)||"framework"===et(t.attributes.name)||"publisher"===et(t.attributes.name)||"progid"===et(t.attributes.name)||et(t.attributes.property).match(/^article:/)||et(t.attributes.property).match(/^product:/)))return!0;if(e.headMetaVerification&&("google-site-verification"===et(t.attributes.name)||"yandex-verification"===et(t.attributes.name)||"csrf-token"===et(t.attributes.name)||"p:domain_verify"===et(t.attributes.name)||"verify-v1"===et(t.attributes.name)||"verification"===et(t.attributes.name)||"shopify-checkout-api-token"===et(t.attributes.name)))return!0}}return!1}(F,f)&&(E||F.type!==c.Text||F.isStyle||F.textContent.replace(/^\s+|\s+$/gm,"").length)?V():H;var O=Object.assign(F,{id:R});if(i.add(t,O),R===H)return null;y&&y(t);var P=!l;if(O.type===c.Element){P=P&&!O.needBlock,delete O.needBlock;var L=b.shadowRoot(t);L&&C(L)&&(O.isShadowHost=!0)}if((O.type===c.Document||O.type===c.Element)&&P){f.headWhitespace&&O.type===c.Element&&"head"===O.tagName&&(E=!1);var D={doc:r,mirror:i,blockClass:n,blockSelector:o,needsMask:M,maskTextClass:s,maskTextSelector:a,skipChild:l,inlineStylesheet:u,maskInputOptions:h,maskTextFn:d,maskInputFn:v,slimDOMOptions:f,dataURLOptions:p,inlineImages:g,recordCanvas:m,preserveWhiteSpace:E,onSerialize:y,onIframeLoad:I,iframeLoadTimeout:S,onStylesheetLoad:k,stylesheetLoadTimeout:x,keepIframeSrcFn:A};if(O.type===c.Element&&"textarea"===O.tagName&&void 0!==O.attributes.value);else for(var B of Array.from(b.childNodes(t))){var Z=rt(B,D);Z&&O.childNodes.push(Z)}var q=null;if(w(t)&&(q=b.shadowRoot(t)))for(var j of Array.from(b.childNodes(q))){var Y=rt(j,D);Y&&(C(q)&&(Y.isShadow=!0),O.childNodes.push(Y))}}var G=b.parentNode(t);return G&&_(G)&&C(G)&&(O.isShadow=!0),O.type===c.Element&&"iframe"===O.tagName&&function(t,e,r){var i=t.contentWindow;if(i){var n,o=!1;try{n=i.document.readyState}catch(t){return}if("complete"===n){var s="about:blank";if(i.location.href!==s||t.src===s||""===t.src)return setTimeout(e,0),t.addEventListener("load",e);t.addEventListener("load",e)}else{var a=setTimeout((()=>{o||(e(),o=!0)}),r);t.addEventListener("load",(()=>{clearTimeout(a),o=!0,e()}))}}}(t,(()=>{var e=t.contentDocument;if(e&&I){var r=rt(e,{doc:e,mirror:i,blockClass:n,blockSelector:o,needsMask:M,maskTextClass:s,maskTextSelector:a,skipChild:!1,inlineStylesheet:u,maskInputOptions:h,maskTextFn:d,maskInputFn:v,slimDOMOptions:f,dataURLOptions:p,inlineImages:g,recordCanvas:m,preserveWhiteSpace:E,onSerialize:y,onIframeLoad:I,iframeLoadTimeout:S,onStylesheetLoad:k,stylesheetLoadTimeout:x,keepIframeSrcFn:A});r&&I(t,r)}}),S),O.type===c.Element&&"link"===O.tagName&&"string"==typeof O.attributes.rel&&("stylesheet"===O.attributes.rel||"preload"===O.attributes.rel&&"string"==typeof O.attributes.href&&"css"===N(O.attributes.href))&&function(t,e,r){var i,n=!1;try{i=t.sheet}catch(t){return}if(!i){var o=setTimeout((()=>{n||(e(),n=!0)}),r);t.addEventListener("load",(()=>{clearTimeout(o),n=!0,e()}))}}(t,(()=>{if(k){var e=rt(t,{doc:r,mirror:i,blockClass:n,blockSelector:o,needsMask:M,maskTextClass:s,maskTextSelector:a,skipChild:!1,inlineStylesheet:u,maskInputOptions:h,maskTextFn:d,maskInputFn:v,slimDOMOptions:f,dataURLOptions:p,inlineImages:g,recordCanvas:m,preserveWhiteSpace:E,onSerialize:y,onIframeLoad:I,iframeLoadTimeout:S,onStylesheetLoad:k,stylesheetLoadTimeout:x,keepIframeSrcFn:A});e&&k(t,e)}}),x),O}let it=class t{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 t=[],e=this.firstChild;e;)t.push(e),e=e.nextSibling;return t}contains(e){if(!(e instanceof t))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(t){throw new Error("RRDomException: Failed to execute 'appendChild' on 'RRNode': This RRNode type does not support this method.")}insertBefore(t,e){throw new Error("RRDomException: Failed to execute 'insertBefore' on 'RRNode': This RRNode type does not support this method.")}removeChild(t){throw new Error("RRDomException: Failed to execute 'removeChild' on 'RRNode': This RRNode type does not support this method.")}toString(){return"RRNode"}};var nt={Node:["childNodes","parentNode","parentElement","textContent"],ShadowRoot:["host","styleSheets"],Element:["shadowRoot","querySelector","querySelectorAll"],MutationObserver:[]},ot={Node:["contains","getRootNode"],ShadowRoot:["getSelection"],Element:[],MutationObserver:["constructor"]};var st={};function at(t){if(st[t])return st[t];var e=function(t){var e,r=null==globalThis||null==(e=globalThis.Zone)||null==e.__symbol__?void 0:e.__symbol__(t);return r&&globalThis[r]?globalThis[r]:void 0}(t)||globalThis[t],r=e.prototype,i=t in nt?nt[t]:void 0,n=Boolean(i&&i.every((t=>{var e,i;return Boolean(null==(i=null==(e=Object.getOwnPropertyDescriptor(r,t))?void 0:e.get)?void 0:i.toString().includes("[native code]"))}))),o=t in ot?ot[t]:void 0,s=Boolean(o&&o.every((t=>{var e;return"function"==typeof r[t]&&(null==(e=r[t])?void 0:e.toString().includes("[native code]"))})));if(n&&s)return st[t]=e.prototype,e.prototype;try{var a=document.createElement("iframe");document.body.appendChild(a);var l=a.contentWindow;if(!l)return e.prototype;var u=l[t].prototype;return document.body.removeChild(a),u?st[t]=u:r}catch(t){return r}}var lt={};function ut(t,e,r){var i,n=t+"."+String(r);if(lt[n])return lt[n].call(e);var o=at(t),s=null==(i=Object.getOwnPropertyDescriptor(o,r))?void 0:i.get;return s?(lt[n]=s,s.call(e)):e[r]}var ct={};function ht(t,e,r){var i=t+"."+String(r);if(ct[i])return ct[i].bind(e);var n=at(t)[r];return"function"!=typeof n?e[r]:(ct[i]=n,n.bind(e))}function dt(){return at("MutationObserver").constructor}var vt={childNodes:function(t){return ut("Node",t,"childNodes")},parentNode:function(t){return ut("Node",t,"parentNode")},parentElement:function(t){return ut("Node",t,"parentElement")},textContent:function(t){return ut("Node",t,"textContent")},contains:function(t,e){return ht("Node",t,"contains")(e)},getRootNode:function(t){return ht("Node",t,"getRootNode")()},host:function(t){return t&&"host"in t?ut("ShadowRoot",t,"host"):null},styleSheets:function(t){return t.styleSheets},shadowRoot:function(t){return t&&"shadowRoot"in t?ut("Element",t,"shadowRoot"):null},querySelector:function(t,e){return ut("Element",t,"querySelector")(e)},querySelectorAll:function(t,e){return ut("Element",t,"querySelectorAll")(e)},mutationObserver:dt};function ft(t,e,r){void 0===r&&(r=document);var i={capture:!0,passive:!0};return r.addEventListener(t,e,i),()=>r.removeEventListener(t,e,i)}var pt="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.",gt={map:{},getId:()=>(console.error(pt),-1),getNode:()=>(console.error(pt),null),removeNodeFromMap(){console.error(pt)},has:()=>(console.error(pt),!1),reset(){console.error(pt)}};function mt(t,e,r){void 0===r&&(r={});var i=null,n=0;return function(){for(var o=arguments.length,s=new Array(o),a=0;a<o;a++)s[a]=arguments[a];var l=Date.now();n||!1!==r.leading||(n=l);var u=e-(l-n),c=this;u<=0||u>e?(i&&(clearTimeout(i),i=null),n=l,t.apply(c,s)):i||!1===r.trailing||(i=setTimeout((()=>{n=!1===r.leading?0:Date.now(),i=null,t.apply(c,s)}),u))}}function yt(t,e,r,i,n){void 0===n&&(n=window);var o=n.Object.getOwnPropertyDescriptor(t,e);return n.Object.defineProperty(t,e,i?r:{set(t){setTimeout((()=>{r.set.call(this,t)}),0),o&&o.set&&o.set.call(this,t)}}),()=>yt(t,e,o||{},!0)}function bt(t,e,r){try{if(!(e in t))return()=>{};var i=t[e],n=r(i);return"function"==typeof n&&(n.prototype=n.prototype||{},Object.defineProperties(n,{__rrweb_original__:{enumerable:!1,value:i}})),t[e]=n,()=>{t[e]=i}}catch(t){return()=>{}}}"undefined"!=typeof window&&window.Proxy&&window.Reflect&&(gt=new Proxy(gt,{get:(t,e,r)=>("map"===e&&console.error(pt),Reflect.get(t,e,r))}));var wt=Date.now;function _t(t){var e,r,i,n,o=t.document;return{left:o.scrollingElement?o.scrollingElement.scrollLeft:void 0!==t.pageXOffset?t.pageXOffset:o.documentElement.scrollLeft||(null==o?void 0:o.body)&&(null==(e=vt.parentElement(o.body))?void 0:e.scrollLeft)||(null==(r=null==o?void 0:o.body)?void 0:r.scrollLeft)||0,top:o.scrollingElement?o.scrollingElement.scrollTop:void 0!==t.pageYOffset?t.pageYOffset:(null==o?void 0:o.documentElement.scrollTop)||(null==o?void 0:o.body)&&(null==(i=vt.parentElement(o.body))?void 0:i.scrollTop)||(null==(n=null==o?void 0:o.body)?void 0:n.scrollTop)||0}}function Ct(){return window.innerHeight||document.documentElement&&document.documentElement.clientHeight||document.body&&document.body.clientHeight}function It(){return window.innerWidth||document.documentElement&&document.documentElement.clientWidth||document.body&&document.body.clientWidth}function St(t){return t?t.nodeType===t.ELEMENT_NODE?t:vt.parentElement(t):null}function kt(t,e,r,i){if(!t)return!1;var n=St(t);if(!n)return!1;try{if("string"==typeof e){if(n.classList.contains(e))return!0;if(i&&null!==n.closest("."+e))return!0}else if(K(n,e,i))return!0}catch(t){}if(r){if(n.matches(r))return!0;if(i&&null!==n.closest(r))return!0}return!1}function xt(t,e,r){return!("TITLE"!==t.tagName||!r.headTitleMutations)||e.getId(t)===H}function At(t,e){if(_(t))return!1;var r=e.getId(t);if(!e.has(r))return!0;var i=vt.parentNode(t);return(!i||i.nodeType!==t.DOCUMENT_NODE)&&(!i||At(i,e))}function Tt(t){return Boolean(t.changedTouches)}function Mt(t,e){return Boolean("IFRAME"===t.nodeName&&e.getMeta(t))}function Et(t,e){return Boolean("LINK"===t.nodeName&&t.nodeType===t.ELEMENT_NODE&&t.getAttribute&&"stylesheet"===t.getAttribute("rel")&&e.getMeta(t))}function Nt(t){return!!t&&(t instanceof it&&"shadowRoot"in t?Boolean(t.shadowRoot):Boolean(vt.shadowRoot(t)))}/[1-9][0-9]{12}/.test(Date.now().toString())||(wt=()=>(new Date).getTime());let Rt=class{constructor(){a(this,"id",1),a(this,"styleIDMap",new WeakMap),a(this,"idStyleMap",new Map)}getId(t){var e;return null!==(e=this.styleIDMap.get(t))&&void 0!==e?e:-1}has(t){return this.styleIDMap.has(t)}add(t,e){return this.has(t)?this.getId(t):(r=void 0===e?this.id++:e,this.styleIDMap.set(t,r),this.idStyleMap.set(r,t),r);var r}getStyle(t){return this.idStyleMap.get(t)||null}reset(){this.styleIDMap=new WeakMap,this.idStyleMap=new Map,this.id=1}generateId(){return this.id++}};function Ft(t){var e,r=null;return"getRootNode"in t&&(null==(e=vt.getRootNode(t))?void 0:e.nodeType)===Node.DOCUMENT_FRAGMENT_NODE&&vt.host(vt.getRootNode(t))&&(r=vt.host(vt.getRootNode(t))),r}function Ot(t){var e=t.ownerDocument;if(!e)return!1;var r=function(t){for(var e,r=t;e=Ft(r);)r=e;return r}(t);return vt.contains(e,r)}function Pt(t){var e=t.ownerDocument;return!!e&&(vt.contains(e,t)||Ot(t))}var Lt=(t=>(t[t.DomContentLoaded=0]="DomContentLoaded",t[t.Load=1]="Load",t[t.FullSnapshot=2]="FullSnapshot",t[t.IncrementalSnapshot=3]="IncrementalSnapshot",t[t.Meta=4]="Meta",t[t.Custom=5]="Custom",t[t.Plugin=6]="Plugin",t))(Lt||{}),Dt=(t=>(t[t.Mutation=0]="Mutation",t[t.MouseMove=1]="MouseMove",t[t.MouseInteraction=2]="MouseInteraction",t[t.Scroll=3]="Scroll",t[t.ViewportResize=4]="ViewportResize",t[t.Input=5]="Input",t[t.TouchMove=6]="TouchMove",t[t.MediaInteraction=7]="MediaInteraction",t[t.StyleSheetRule=8]="StyleSheetRule",t[t.CanvasMutation=9]="CanvasMutation",t[t.Font=10]="Font",t[t.Log=11]="Log",t[t.Drag=12]="Drag",t[t.StyleDeclaration=13]="StyleDeclaration",t[t.Selection=14]="Selection",t[t.AdoptedStyleSheet=15]="AdoptedStyleSheet",t[t.CustomElement=16]="CustomElement",t))(Dt||{}),Bt=(t=>(t[t.MouseUp=0]="MouseUp",t[t.MouseDown=1]="MouseDown",t[t.Click=2]="Click",t[t.ContextMenu=3]="ContextMenu",t[t.DblClick=4]="DblClick",t[t.Focus=5]="Focus",t[t.Blur=6]="Blur",t[t.TouchStart=7]="TouchStart",t[t.TouchMove_Departed=8]="TouchMove_Departed",t[t.TouchEnd=9]="TouchEnd",t[t.TouchCancel=10]="TouchCancel",t))(Bt||{}),Zt=(t=>(t[t.Mouse=0]="Mouse",t[t.Pen=1]="Pen",t[t.Touch=2]="Touch",t))(Zt||{}),$t=(t=>(t[t["2D"]=0]="2D",t[t.WebGL=1]="WebGL",t[t.WebGL2=2]="WebGL2",t))($t||{}),qt=(t=>(t[t.Play=0]="Play",t[t.Pause=1]="Pause",t[t.Seeked=2]="Seeked",t[t.VolumeChange=3]="VolumeChange",t[t.RateChange=4]="RateChange",t))(qt||{});function Ht(t){return"__ln"in t}class Vt{constructor(){a(this,"length",0),a(this,"head",null),a(this,"tail",null)}get(t){if(t>=this.length)throw new Error("Position outside of list range");for(var e=this.head,r=0;r<t;r++)e=(null==e?void 0:e.next)||null;return e}addNode(t){var e={value:t,previous:null,next:null};if(t.__ln=e,t.previousSibling&&Ht(t.previousSibling)){var r=t.previousSibling.__ln.next;e.next=r,e.previous=t.previousSibling.__ln,t.previousSibling.__ln.next=e,r&&(r.previous=e)}else if(t.nextSibling&&Ht(t.nextSibling)&&t.nextSibling.__ln.previous){var i=t.nextSibling.__ln.previous;e.previous=i,e.next=t.nextSibling.__ln,t.nextSibling.__ln.previous=e,i&&(i.next=e)}else this.head&&(this.head.previous=e),e.next=this.head,this.head=e;null===e.next&&(this.tail=e),this.length++}removeNode(t){var e=t.__ln;this.head&&(e.previous?(e.previous.next=e.next,e.next?e.next.previous=e.previous:this.tail=e.previous):(this.head=e.next,this.head?this.head.previous=null:this.tail=null),t.__ln&&delete t.__ln,this.length--)}}var jt,Yt=(t,e)=>t+"@"+e;class Gt{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",(t=>{t.forEach(this.processMutation),this.emit()})),a(this,"emit",(()=>{if(!this.frozen&&!this.locked){for(var t=[],e=new Set,r=new Vt,i=t=>{for(var e=t,r=H;r===H;)r=(e=e&&e.nextSibling)&&this.mirror.getId(e);return r},n=n=>{var o=vt.parentNode(n);if(o&&Pt(n)&&"TEXTAREA"!==o.tagName){var s=_(o)?this.mirror.getId(Ft(n)):this.mirror.getId(o),a=i(n);if(-1===s||-1===a)return r.addNode(n);var l=rt(n,{doc:this.doc,mirror:this.mirror,blockClass:this.blockClass,blockSelector:this.blockSelector,maskTextClass:this.maskTextClass,maskTextSelector:this.maskTextSelector,skipChild:!0,newlyAddedElement:!0,inlineStylesheet:this.inlineStylesheet,maskInputOptions:this.maskInputOptions,maskTextFn:this.maskTextFn,maskInputFn:this.maskInputFn,slimDOMOptions:this.slimDOMOptions,dataURLOptions:this.dataURLOptions,recordCanvas:this.recordCanvas,inlineImages:this.inlineImages,onSerialize:t=>{Mt(t,this.mirror)&&this.iframeManager.addIframe(t),Et(t,this.mirror)&&this.stylesheetManager.trackLinkElement(t),Nt(n)&&this.shadowDomManager.addShadowRoot(vt.shadowRoot(n),this.doc)},onIframeLoad:(t,e)=>{this.iframeManager.attachIframe(t,e),this.shadowDomManager.observeAttachShadow(t)},onStylesheetLoad:(t,e)=>{this.stylesheetManager.attachLinkElement(t,e)}});l&&(t.push({parentId:s,nextId:a,node:l}),e.add(l.id))}};this.mapRemoves.length;)this.mirror.removeNodeFromMap(this.mapRemoves.shift());for(var o of this.movedSet)zt(this.removes,o,this.mirror)&&!this.movedSet.has(vt.parentNode(o))||n(o);for(var s of this.addedSet)Ut(this.droppedSet,s)||zt(this.removes,s,this.mirror)?Ut(this.movedSet,s)?n(s):this.droppedSet.add(s):n(s);for(var a=null;r.length;){var l=null;if(a){var u=this.mirror.getId(vt.parentNode(a.value)),c=i(a.value);-1!==u&&-1!==c&&(l=a)}if(!l)for(var h=r.tail;h;){var d=h;if(h=h.previous,d){var v=this.mirror.getId(vt.parentNode(d.value));if(-1===i(d.value))continue;if(-1!==v){l=d;break}var f=d.value,p=vt.parentNode(f);if(p&&p.nodeType===Node.DOCUMENT_FRAGMENT_NODE){var g=vt.host(p);if(-1!==this.mirror.getId(g)){l=d;break}}}}if(!l){for(;r.head;)r.removeNode(r.head.value);break}a=l.previous,r.removeNode(l.value),n(l.value)}var m={texts:this.texts.map((t=>{var e=t.node,r=vt.parentNode(e);return r&&"TEXTAREA"===r.tagName&&this.genTextAreaValueMutation(r),{id:this.mirror.getId(e),value:t.value}})).filter((t=>!e.has(t.id))).filter((t=>this.mirror.has(t.id))),attributes:this.attributes.map((t=>{var{attributes:e}=t;if("string"==typeof e.style){var r=JSON.stringify(t.styleDiff),i=JSON.stringify(t._unchangedStyles);r.length<e.style.length&&(r+i).split("var(").length===e.style.split("var(").length&&(e.style=t.styleDiff)}return{id:this.mirror.getId(t.node),attributes:e}})).filter((t=>!e.has(t.id))).filter((t=>this.mirror.has(t.id))),removes:this.removes,adds:t};(m.texts.length||m.attributes.length||m.removes.length||m.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(m))}})),a(this,"genTextAreaValueMutation",(t=>{var e=this.attributeMap.get(t);e||(e={node:t,attributes:{},styleDiff:{},_unchangedStyles:{}},this.attributes.push(e),this.attributeMap.set(t,e)),e.attributes.value=Array.from(vt.childNodes(t),(t=>vt.textContent(t)||"")).join("")})),a(this,"processMutation",(t=>{if(!xt(t.target,this.mirror,this.slimDOMOptions))switch(t.type){case"characterData":var e=vt.textContent(t.target);kt(t.target,this.blockClass,this.blockSelector,!1)||e===t.oldValue||this.texts.push({value:Q(t.target,this.maskTextClass,this.maskTextSelector,!0)&&e?this.maskTextFn?this.maskTextFn(e,St(t.target)):e.replace(/[\S]/g,"*"):e,node:t.target});break;case"attributes":var r=t.target,i=t.attributeName,n=t.target.getAttribute(i);if("value"===i){var o=E(r);n=A({element:r,maskInputOptions:this.maskInputOptions,tagName:r.tagName,type:o,value:n,maskInputFn:this.maskInputFn})}if(kt(t.target,this.blockClass,this.blockSelector,!1)||n===t.oldValue)return;var s=this.attributeMap.get(t.target);if("IFRAME"===r.tagName&&"src"===i&&!this.keepIframeSrcFn(n)){if(r.contentDocument)return;i="rr_src"}if(s||(s={node:t.target,attributes:{},styleDiff:{},_unchangedStyles:{}},this.attributes.push(s),this.attributeMap.set(t.target,s)),"type"===i&&"INPUT"===r.tagName&&"password"===(t.oldValue||"").toLowerCase()&&r.setAttribute("data-rr-is-password","true"),!J(r.tagName,i))if(s.attributes[i]=X(this.doc,T(r.tagName),T(i),n),"style"===i){if(!this.unattachedDoc)try{this.unattachedDoc=document.implementation.createHTMLDocument()}catch(t){this.unattachedDoc=this.doc}var a=this.unattachedDoc.createElement("span");for(var l of(t.oldValue&&a.setAttribute("style",t.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)?s.styleDiff[l]=""===c?u:[u,c]:s._unchangedStyles[l]=[u,c]}for(var h of Array.from(a.style))""===r.style.getPropertyValue(h)&&(s.styleDiff[h]=!1)}else"open"===i&&"DIALOG"===r.tagName&&(r.matches("dialog:modal")?s.attributes.rr_open_mode="modal":s.attributes.rr_open_mode="non-modal");break;case"childList":if(kt(t.target,this.blockClass,this.blockSelector,!0))return;if("TEXTAREA"===t.target.tagName)return void this.genTextAreaValueMutation(t.target);t.addedNodes.forEach((e=>this.genAdds(e,t.target))),t.removedNodes.forEach((e=>{var r=this.mirror.getId(e),i=_(t.target)?this.mirror.getId(vt.host(t.target)):this.mirror.getId(t.target);kt(t.target,this.blockClass,this.blockSelector,!1)||xt(e,this.mirror,this.slimDOMOptions)||!function(t,e){return-1!==e.getId(t)}(e,this.mirror)||(this.addedSet.has(e)?(Wt(this.addedSet,e),this.droppedSet.add(e)):this.addedSet.has(t.target)&&-1===r||At(t.target,this.mirror)||(this.movedSet.has(e)&&this.movedMap[Yt(r,i)]?Wt(this.movedSet,e):this.removes.push({parentId:i,id:r,isShadow:!(!_(t.target)||!C(t.target))||void 0})),this.mapRemoves.push(e))}))}})),a(this,"genAdds",((t,e)=>{if(!this.processedNodeManager.inOtherBuffer(t,this)&&!this.addedSet.has(t)&&!this.movedSet.has(t)){if(this.mirror.hasNode(t)){if(xt(t,this.mirror,this.slimDOMOptions))return;this.movedSet.add(t);var r=null;e&&this.mirror.hasNode(e)&&(r=this.mirror.getId(e)),r&&-1!==r&&(this.movedMap[Yt(this.mirror.getId(t),r)]=!0)}else this.addedSet.add(t),this.droppedSet.delete(t);kt(t,this.blockClass,this.blockSelector,!1)||(vt.childNodes(t).forEach((t=>this.genAdds(t))),Nt(t)&&vt.childNodes(vt.shadowRoot(t)).forEach((e=>{this.processedNodeManager.add(e,this),this.genAdds(e,t)})))}}))}init(t){["mutationCb","blockClass","blockSelector","maskTextClass","maskTextSelector","inlineStylesheet","maskInputOptions","maskTextFn","maskInputFn","keepIframeSrcFn","recordCanvas","inlineImages","slimDOMOptions","dataURLOptions","doc","mirror","iframeManager","stylesheetManager","shadowDomManager","canvasManager","processedNodeManager"].forEach((e=>{this[e]=t[e]}))}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 Wt(t,e){t.delete(e),vt.childNodes(e).forEach((e=>Wt(t,e)))}function zt(t,e,r){return 0!==t.length&&function(t,e,r){var i,n=vt.parentNode(e),o=function(){var e=r.getId(n);if(t.some((t=>t.id===e)))return{v:!0};n=vt.parentNode(n)};for(;n;)if(i=o())return i.v;return!1}(t,e,r)}function Ut(t,e){return 0!==t.size&&Xt(t,e)}function Xt(t,e){var r=vt.parentNode(e);return!!r&&(!!t.has(r)||Xt(t,r))}var Jt=t=>{if(!jt)return t;return function(){try{return t(...arguments)}catch(t){if(jt&&!0===jt(t))return;throw t}}},Kt=[];function Qt(t){try{if("composedPath"in t){var e=t.composedPath();if(e.length)return e[0]}else if("path"in t&&t.path.length)return t.path[0]}catch(t){}return t&&t.target}function te(t,e){var r=new Gt;Kt.push(r),r.init(t);var i=new(dt())(Jt(r.processMutations.bind(r)));return i.observe(e,{attributes:!0,attributeOldValue:!0,characterData:!0,characterDataOldValue:!0,childList:!0,subtree:!0}),i}function ee(t){var{mouseInteractionCb:e,doc:i,mirror:n,blockClass:o,blockSelector:s,sampling:a}=t;if(!1===a.mouseInteraction)return()=>{};var l=!0===a.mouseInteraction||void 0===a.mouseInteraction?{}:a.mouseInteraction,u=[],c=null;return Object.keys(Bt).filter((t=>Number.isNaN(Number(t))&&!t.endsWith("_Departed")&&!1!==l[t])).forEach((t=>{var a=T(t),l=(t=>i=>{var a=Qt(i);if(!kt(a,o,s,!0)){var l=null,u=t;if("pointerType"in i){switch(i.pointerType){case"mouse":l=Zt.Mouse;break;case"touch":l=Zt.Touch;break;case"pen":l=Zt.Pen}l===Zt.Touch?Bt[t]===Bt.MouseDown?u="TouchStart":Bt[t]===Bt.MouseUp&&(u="TouchEnd"):Zt.Pen}else Tt(i)&&(l=Zt.Touch);null!==l?(c=l,(u.startsWith("Touch")&&l===Zt.Touch||u.startsWith("Mouse")&&l===Zt.Mouse)&&(l=null)):Bt[t]===Bt.Click&&(l=c,c=null);var h=Tt(i)?i.changedTouches[0]:i;if(h){var d=n.getId(a),{clientX:v,clientY:f}=h;Jt(e)(r({type:Bt[u],id:d,x:v,y:f},null!==l&&{pointerType:l}))}}})(t);if(window.PointerEvent)switch(Bt[t]){case Bt.MouseDown:case Bt.MouseUp:a=a.replace("mouse","pointer");break;case Bt.TouchStart:case Bt.TouchEnd:return}u.push(ft(a,l,i))})),Jt((()=>{u.forEach((t=>t()))}))}function re(t){var{scrollCb:e,doc:r,mirror:i,blockClass:n,blockSelector:o,sampling:s}=t;return ft("scroll",Jt(mt(Jt((t=>{var s=Qt(t);if(s&&!kt(s,n,o,!0)){var a=i.getId(s);if(s===r&&r.defaultView){var l=_t(r.defaultView);e({id:a,x:l.left,y:l.top})}else e({id:a,x:s.scrollLeft,y:s.scrollTop})}})),s.scroll||100)),r)}var ie=["INPUT","TEXTAREA","SELECT"],ne=new WeakMap;function oe(t){return function(t,e){if(ue("CSSGroupingRule")&&t.parentRule instanceof CSSGroupingRule||ue("CSSMediaRule")&&t.parentRule instanceof CSSMediaRule||ue("CSSSupportsRule")&&t.parentRule instanceof CSSSupportsRule||ue("CSSConditionRule")&&t.parentRule instanceof CSSConditionRule){var r=Array.from(t.parentRule.cssRules).indexOf(t);e.unshift(r)}else if(t.parentStyleSheet){var i=Array.from(t.parentStyleSheet.cssRules).indexOf(t);e.unshift(i)}return e}(t,[])}function se(t,e,r){var i,n;return t?(t.ownerNode?i=e.getId(t.ownerNode):n=r.getId(t),{styleId:n,id:i}):{}}function ae(t,e){var r,i,n,{mirror:o,stylesheetManager:s}=t,a=null;a="#document"===e.nodeName?o.getId(e):o.getId(vt.host(e));var l="#document"===e.nodeName?null==(r=e.defaultView)?void 0:r.Document:null==(n=null==(i=e.ownerDocument)?void 0:i.defaultView)?void 0:n.ShadowRoot,u=(null==l?void 0:l.prototype)?Object.getOwnPropertyDescriptor(null==l?void 0:l.prototype,"adoptedStyleSheets"):void 0;return null!==a&&-1!==a&&l&&u?(Object.defineProperty(e,"adoptedStyleSheets",{configurable:u.configurable,enumerable:u.enumerable,get(){var t;return null==(t=u.get)?void 0:t.call(this)},set(t){var e,r=null==(e=u.set)?void 0:e.call(this,t);if(null!==a&&-1!==a)try{s.adoptStyleSheets(t,a)}catch(t){}return r}}),Jt((()=>{Object.defineProperty(e,"adoptedStyleSheets",{configurable:u.configurable,enumerable:u.enumerable,get:u.get,set:u.set})}))):()=>{}}function le(t,e){void 0===e&&(e={});var i,n=t.doc.defaultView;if(!n)return()=>{};!function(t,e){var{mutationCb:r,mousemoveCb:i,mouseInteractionCb:n,scrollCb:o,viewportResizeCb:s,inputCb:a,mediaInteractionCb:l,styleSheetRuleCb:u,styleDeclarationCb:c,canvasMutationCb:h,fontCb:d,selectionCb:v,customElementCb:f}=t;t.mutationCb=function(){e.mutation&&e.mutation(...arguments),r(...arguments)},t.mousemoveCb=function(){e.mousemove&&e.mousemove(...arguments),i(...arguments)},t.mouseInteractionCb=function(){e.mouseInteraction&&e.mouseInteraction(...arguments),n(...arguments)},t.scrollCb=function(){e.scroll&&e.scroll(...arguments),o(...arguments)},t.viewportResizeCb=function(){e.viewportResize&&e.viewportResize(...arguments),s(...arguments)},t.inputCb=function(){e.input&&e.input(...arguments),a(...arguments)},t.mediaInteractionCb=function(){e.mediaInteaction&&e.mediaInteaction(...arguments),l(...arguments)},t.styleSheetRuleCb=function(){e.styleSheetRule&&e.styleSheetRule(...arguments),u(...arguments)},t.styleDeclarationCb=function(){e.styleDeclaration&&e.styleDeclaration(...arguments),c(...arguments)},t.canvasMutationCb=function(){e.canvasMutation&&e.canvasMutation(...arguments),h(...arguments)},t.fontCb=function(){e.font&&e.font(...arguments),d(...arguments)},t.selectionCb=function(){e.selection&&e.selection(...arguments),v(...arguments)},t.customElementCb=function(){e.customElement&&e.customElement(...arguments),f(...arguments)}}(t,e),t.recordDOM&&(i=te(t,t.doc));var o=function(t){var{mousemoveCb:e,sampling:r,doc:i,mirror:n}=t;if(!1===r.mousemove)return()=>{};var o,s="number"==typeof r.mousemove?r.mousemove:50,a="number"==typeof r.mousemoveCallback?r.mousemoveCallback:500,l=[],u=mt(Jt((t=>{var r=Date.now()-o;e(l.map((t=>(t.timeOffset-=r,t))),t),l=[],o=null})),a),c=Jt(mt(Jt((t=>{var e=Qt(t),{clientX:r,clientY:i}=Tt(t)?t.changedTouches[0]:t;o||(o=wt()),l.push({x:r,y:i,id:n.getId(e),timeOffset:wt()-o}),u("undefined"!=typeof DragEvent&&t instanceof DragEvent?Dt.Drag:t instanceof MouseEvent?Dt.MouseMove:Dt.TouchMove)})),s,{trailing:!1})),h=[ft("mousemove",c,i),ft("touchmove",c,i),ft("drag",c,i)];return Jt((()=>{h.forEach((t=>t()))}))}(t),s=ee(t),a=re(t),l=function(t,e){var{viewportResizeCb:r}=t,{win:i}=e,n=-1,o=-1;return ft("resize",Jt(mt(Jt((()=>{var t=Ct(),e=It();n===t&&o===e||(r({width:Number(e),height:Number(t)}),n=t,o=e)})),200)),i)}(t,{win:n}),u=function(t){var{inputCb:e,doc:i,mirror:n,blockClass:o,blockSelector:s,ignoreClass:a,ignoreSelector:l,maskInputOptions:u,maskInputFn:c,sampling:h,userTriggeredOnInput:d}=t;function v(t){var e=Qt(t),r=t.isTrusted,n=e&&e.tagName;if(e&&"OPTION"===n&&(e=vt.parentElement(e)),e&&n&&!(ie.indexOf(n)<0)&&!kt(e,o,s,!0)&&!(e.classList.contains(a)||l&&e.matches(l))){var h=e.value,v=!1,p=E(e)||"";"radio"===p||"checkbox"===p?v=e.checked:(u[n.toLowerCase()]||u[p])&&(h=A({element:e,maskInputOptions:u,tagName:n,type:p,value:h,maskInputFn:c})),f(e,d?{text:h,isChecked:v,userTriggered:r}:{text:h,isChecked:v});var g=e.name;"radio"===p&&g&&v&&i.querySelectorAll('input[type="radio"][name="'+g+'"]').forEach((t=>{if(t!==e){var r=t.value;f(t,d?{text:r,isChecked:!v,userTriggered:!1}:{text:r,isChecked:!v})}}))}}function f(t,i){var o=ne.get(t);if(!o||o.text!==i.text||o.isChecked!==i.isChecked){ne.set(t,i);var s=n.getId(t);Jt(e)(r({},i,{id:s}))}}var p=("last"===h.input?["change"]:["input","change"]).map((t=>ft(t,Jt(v),i))),g=i.defaultView;if(!g)return()=>{p.forEach((t=>t()))};var m=g.Object.getOwnPropertyDescriptor(g.HTMLInputElement.prototype,"value"),y=[[g.HTMLInputElement.prototype,"value"],[g.HTMLInputElement.prototype,"checked"],[g.HTMLSelectElement.prototype,"value"],[g.HTMLTextAreaElement.prototype,"value"],[g.HTMLSelectElement.prototype,"selectedIndex"],[g.HTMLOptionElement.prototype,"selected"]];return m&&m.set&&p.push(...y.map((t=>yt(t[0],t[1],{set(){Jt(v)({target:this,isTrusted:!1})}},!1,g)))),Jt((()=>{p.forEach((t=>t()))}))}(t),c=function(t){var{mediaInteractionCb:e,blockClass:r,blockSelector:i,mirror:n,sampling:o,doc:s}=t,a=Jt((t=>mt(Jt((o=>{var s=Qt(o);if(s&&!kt(s,r,i,!0)){var{currentTime:a,volume:l,muted:u,playbackRate:c,loop:h}=s;e({type:t,id:n.getId(s),currentTime:a,volume:l,muted:u,playbackRate:c,loop:h})}})),o.media||500))),l=[ft("play",a(qt.Play),s),ft("pause",a(qt.Pause),s),ft("seeked",a(qt.Seeked),s),ft("volumechange",a(qt.VolumeChange),s),ft("ratechange",a(qt.RateChange),s)];return Jt((()=>{l.forEach((t=>t()))}))}(t),h=()=>{},d=()=>{},v=()=>{},f=()=>{};t.recordDOM&&(h=function(t,e){var{styleSheetRuleCb:r,mirror:i,stylesheetManager:n}=t,{win:o}=e;if(!o.CSSStyleSheet||!o.CSSStyleSheet.prototype)return()=>{};var s=o.CSSStyleSheet.prototype.insertRule;o.CSSStyleSheet.prototype.insertRule=new Proxy(s,{apply:Jt(((t,e,o)=>{var[s,a]=o,{id:l,styleId:u}=se(e,i,n.styleMirror);return(l&&-1!==l||u&&-1!==u)&&r({id:l,styleId:u,adds:[{rule:s,index:a}]}),t.apply(e,o)}))}),o.CSSStyleSheet.prototype.addRule=function(t,e,r){void 0===r&&(r=this.cssRules.length);var i=t+" { "+e+" }";return o.CSSStyleSheet.prototype.insertRule.apply(this,[i,r])};var a,l,u=o.CSSStyleSheet.prototype.deleteRule;o.CSSStyleSheet.prototype.deleteRule=new Proxy(u,{apply:Jt(((t,e,o)=>{var[s]=o,{id:a,styleId:l}=se(e,i,n.styleMirror);return(a&&-1!==a||l&&-1!==l)&&r({id:a,styleId:l,removes:[{index:s}]}),t.apply(e,o)}))}),o.CSSStyleSheet.prototype.removeRule=function(t){return o.CSSStyleSheet.prototype.deleteRule.apply(this,[t])},o.CSSStyleSheet.prototype.replace&&(a=o.CSSStyleSheet.prototype.replace,o.CSSStyleSheet.prototype.replace=new Proxy(a,{apply:Jt(((t,e,o)=>{var[s]=o,{id:a,styleId:l}=se(e,i,n.styleMirror);return(a&&-1!==a||l&&-1!==l)&&r({id:a,styleId:l,replace:s}),t.apply(e,o)}))})),o.CSSStyleSheet.prototype.replaceSync&&(l=o.CSSStyleSheet.prototype.replaceSync,o.CSSStyleSheet.prototype.replaceSync=new Proxy(l,{apply:Jt(((t,e,o)=>{var[s]=o,{id:a,styleId:l}=se(e,i,n.styleMirror);return(a&&-1!==a||l&&-1!==l)&&r({id:a,styleId:l,replaceSync:s}),t.apply(e,o)}))}));var c={};ce("CSSGroupingRule")?c.CSSGroupingRule=o.CSSGroupingRule:(ce("CSSMediaRule")&&(c.CSSMediaRule=o.CSSMediaRule),ce("CSSConditionRule")&&(c.CSSConditionRule=o.CSSConditionRule),ce("CSSSupportsRule")&&(c.CSSSupportsRule=o.CSSSupportsRule));var h={};return Object.entries(c).forEach((t=>{var[e,o]=t;h[e]={insertRule:o.prototype.insertRule,deleteRule:o.prototype.deleteRule},o.prototype.insertRule=new Proxy(h[e].insertRule,{apply:Jt(((t,e,o)=>{var[s,a]=o,{id:l,styleId:u}=se(e.parentStyleSheet,i,n.styleMirror);return(l&&-1!==l||u&&-1!==u)&&r({id:l,styleId:u,adds:[{rule:s,index:[...oe(e),a||0]}]}),t.apply(e,o)}))}),o.prototype.deleteRule=new Proxy(h[e].deleteRule,{apply:Jt(((t,e,o)=>{var[s]=o,{id:a,styleId:l}=se(e.parentStyleSheet,i,n.styleMirror);return(a&&-1!==a||l&&-1!==l)&&r({id:a,styleId:l,removes:[{index:[...oe(e),s]}]}),t.apply(e,o)}))})})),Jt((()=>{o.CSSStyleSheet.prototype.insertRule=s,o.CSSStyleSheet.prototype.deleteRule=u,a&&(o.CSSStyleSheet.prototype.replace=a),l&&(o.CSSStyleSheet.prototype.replaceSync=l),Object.entries(c).forEach((t=>{var[e,r]=t;r.prototype.insertRule=h[e].insertRule,r.prototype.deleteRule=h[e].deleteRule}))}))}(t,{win:n}),d=ae(t,t.doc),v=function(t,e){var{styleDeclarationCb:r,mirror:i,ignoreCSSAttributes:n,stylesheetManager:o}=t,{win:s}=e,a=s.CSSStyleDeclaration.prototype.setProperty;s.CSSStyleDeclaration.prototype.setProperty=new Proxy(a,{apply:Jt(((t,e,s)=>{var l,[u,c,h]=s;if(n.has(u))return a.apply(e,[u,c,h]);var{id:d,styleId:v}=se(null==(l=e.parentRule)?void 0:l.parentStyleSheet,i,o.styleMirror);return(d&&-1!==d||v&&-1!==v)&&r({id:d,styleId:v,set:{property:u,value:c,priority:h},index:oe(e.parentRule)}),t.apply(e,s)}))});var l=s.CSSStyleDeclaration.prototype.removeProperty;return s.CSSStyleDeclaration.prototype.removeProperty=new Proxy(l,{apply:Jt(((t,e,s)=>{var a,[u]=s;if(n.has(u))return l.apply(e,[u]);var{id:c,styleId:h}=se(null==(a=e.parentRule)?void 0:a.parentStyleSheet,i,o.styleMirror);return(c&&-1!==c||h&&-1!==h)&&r({id:c,styleId:h,remove:{property:u},index:oe(e.parentRule)}),t.apply(e,s)}))}),Jt((()=>{s.CSSStyleDeclaration.prototype.setProperty=a,s.CSSStyleDeclaration.prototype.removeProperty=l}))}(t,{win:n}),t.collectFonts&&(f=function(t){var{fontCb:e,doc:r}=t,i=r.defaultView;if(!i)return()=>{};var n=[],o=new WeakMap,s=i.FontFace;i.FontFace=function(t,e,r){var i=new s(t,e,r);return o.set(i,{family:t,buffer:"string"!=typeof e,descriptors:r,fontSource:"string"==typeof e?e:JSON.stringify(Array.from(new Uint8Array(e)))}),i};var a=bt(r.fonts,"add",(function(t){return function(r){return setTimeout(Jt((()=>{var t=o.get(r);t&&(e(t),o.delete(r))})),0),t.apply(this,[r])}}));return n.push((()=>{i.FontFace=s})),n.push(a),Jt((()=>{n.forEach((t=>t()))}))}(t)));var p=function(t){var{doc:e,mirror:r,blockClass:i,blockSelector:n,selectionCb:o}=t,s=!0,a=Jt((()=>{var t=e.getSelection();if(!(!t||s&&(null==t?void 0:t.isCollapsed))){s=t.isCollapsed||!1;for(var a=[],l=t.rangeCount||0,u=0;u<l;u++){var c=t.getRangeAt(u),{startContainer:h,startOffset:d,endContainer:v,endOffset:f}=c;kt(h,i,n,!0)||kt(v,i,n,!0)||a.push({start:r.getId(h),startOffset:d,end:r.getId(v),endOffset:f})}o({ranges:a})}}));return a(),ft("selectionchange",a)}(t),g=function(t){var{doc:e,customElementCb:r}=t,i=e.defaultView;return i&&i.customElements?bt(i.customElements,"define",(function(t){return function(e,i,n){try{r({define:{name:e}})}catch(t){console.warn("Custom element callback failed for "+e)}return t.apply(this,[e,i,n])}})):()=>{}}(t),m=[];for(var y of t.plugins)m.push(y.observer(y.callback,n,y.options));return Jt((()=>{Kt.forEach((t=>t.reset())),null==i||i.disconnect(),o(),s(),a(),l(),u(),c(),h(),d(),v(),f(),p(),g(),m.forEach((t=>t()))}))}function ue(t){return void 0!==window[t]}function ce(t){return Boolean(void 0!==window[t]&&window[t].prototype&&"insertRule"in window[t].prototype&&"deleteRule"in window[t].prototype)}class he{constructor(t){a(this,"iframeIdToRemoteIdMap",new WeakMap),a(this,"iframeRemoteIdToIdMap",new WeakMap),this.generateIdFn=t}getId(t,e,r,i){var n=r||this.getIdToRemoteIdMap(t),o=i||this.getRemoteIdToIdMap(t),s=n.get(e);return s||(s=this.generateIdFn(),n.set(e,s),o.set(s,e)),s}getIds(t,e){var r=this.getIdToRemoteIdMap(t),i=this.getRemoteIdToIdMap(t);return e.map((e=>this.getId(t,e,r,i)))}getRemoteId(t,e,r){var i=r||this.getRemoteIdToIdMap(t);if("number"!=typeof e)return e;var n=i.get(e);return n||-1}getRemoteIds(t,e){var r=this.getRemoteIdToIdMap(t);return e.map((e=>this.getRemoteId(t,e,r)))}reset(t){if(!t)return this.iframeIdToRemoteIdMap=new WeakMap,void(this.iframeRemoteIdToIdMap=new WeakMap);this.iframeIdToRemoteIdMap.delete(t),this.iframeRemoteIdToIdMap.delete(t)}getIdToRemoteIdMap(t){var e=this.iframeIdToRemoteIdMap.get(t);return e||(e=new Map,this.iframeIdToRemoteIdMap.set(t,e)),e}getRemoteIdToIdMap(t){var e=this.iframeRemoteIdToIdMap.get(t);return e||(e=new Map,this.iframeRemoteIdToIdMap.set(t,e)),e}}class de{constructor(t){a(this,"iframes",new WeakMap),a(this,"crossOriginIframeMap",new WeakMap),a(this,"crossOriginIframeMirror",new he(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=t.mutationCb,this.wrappedEmit=t.wrappedEmit,this.stylesheetManager=t.stylesheetManager,this.recordCrossOriginIframes=t.recordCrossOriginIframes,this.crossOriginIframeStyleMirror=new he(this.stylesheetManager.styleMirror.generateId.bind(this.stylesheetManager.styleMirror)),this.mirror=t.mirror,this.recordCrossOriginIframes&&window.addEventListener("message",this.handleMessage.bind(this))}addIframe(t){this.iframes.set(t,!0),t.contentWindow&&this.crossOriginIframeMap.set(t.contentWindow,t)}addLoadListener(t){this.loadListener=t}attachIframe(t,e){var r,i;this.mutationCb({adds:[{parentId:this.mirror.getId(t),nextId:null,node:e}],removes:[],texts:[],attributes:[],isAttachIframe:!0}),this.recordCrossOriginIframes&&(null==(r=t.contentWindow)||r.addEventListener("message",this.handleMessage.bind(this))),null==(i=this.loadListener)||i.call(this,t),t.contentDocument&&t.contentDocument.adoptedStyleSheets&&t.contentDocument.adoptedStyleSheets.length>0&&this.stylesheetManager.adoptStyleSheets(t.contentDocument.adoptedStyleSheets,this.mirror.getId(t.contentDocument))}handleMessage(t){var e=t;if("rrweb"===e.data.type&&e.origin===e.data.origin&&t.source){var r=this.crossOriginIframeMap.get(t.source);if(r){var i=this.transformCrossOriginEvent(r,e.data.event);i&&this.wrappedEmit(i,e.data.isCheckout)}}}transformCrossOriginEvent(t,e){var r;switch(e.type){case Lt.FullSnapshot:this.crossOriginIframeMirror.reset(t),this.crossOriginIframeStyleMirror.reset(t),this.replaceIdOnNode(e.data.node,t);var i=e.data.node.id;return this.crossOriginIframeRootIdMap.set(t,i),this.patchRootIdOnNode(e.data.node,i),{timestamp:e.timestamp,type:Lt.IncrementalSnapshot,data:{source:Dt.Mutation,adds:[{parentId:this.mirror.getId(t),nextId:null,node:e.data.node}],removes:[],texts:[],attributes:[],isAttachIframe:!0}};case Lt.Meta:case Lt.Load:case Lt.DomContentLoaded:return!1;case Lt.Plugin:return e;case Lt.Custom:return this.replaceIds(e.data.payload,t,["id","parentId","previousId","nextId"]),e;case Lt.IncrementalSnapshot:switch(e.data.source){case Dt.Mutation:return e.data.adds.forEach((e=>{this.replaceIds(e,t,["parentId","nextId","previousId"]),this.replaceIdOnNode(e.node,t);var r=this.crossOriginIframeRootIdMap.get(t);r&&this.patchRootIdOnNode(e.node,r)})),e.data.removes.forEach((e=>{this.replaceIds(e,t,["parentId","id"])})),e.data.attributes.forEach((e=>{this.replaceIds(e,t,["id"])})),e.data.texts.forEach((e=>{this.replaceIds(e,t,["id"])})),e;case Dt.Drag:case Dt.TouchMove:case Dt.MouseMove:return e.data.positions.forEach((e=>{this.replaceIds(e,t,["id"])})),e;case Dt.ViewportResize:return!1;case Dt.MediaInteraction:case Dt.MouseInteraction:case Dt.Scroll:case Dt.CanvasMutation:case Dt.Input:return this.replaceIds(e.data,t,["id"]),e;case Dt.StyleSheetRule:case Dt.StyleDeclaration:return this.replaceIds(e.data,t,["id"]),this.replaceStyleIds(e.data,t,["styleId"]),e;case Dt.Font:return e;case Dt.Selection:return e.data.ranges.forEach((e=>{this.replaceIds(e,t,["start","end"])})),e;case Dt.AdoptedStyleSheet:return this.replaceIds(e.data,t,["id"]),this.replaceStyleIds(e.data,t,["styleIds"]),null==(r=e.data.styles)||r.forEach((e=>{this.replaceStyleIds(e,t,["styleId"])})),e}}return!1}replace(t,e,r,i){for(var n of i)(Array.isArray(e[n])||"number"==typeof e[n])&&(Array.isArray(e[n])?e[n]=t.getIds(r,e[n]):e[n]=t.getId(r,e[n]));return e}replaceIds(t,e,r){return this.replace(this.crossOriginIframeMirror,t,e,r)}replaceStyleIds(t,e,r){return this.replace(this.crossOriginIframeStyleMirror,t,e,r)}replaceIdOnNode(t,e){this.replaceIds(t,e,["id","rootId"]),"childNodes"in t&&t.childNodes.forEach((t=>{this.replaceIdOnNode(t,e)}))}patchRootIdOnNode(t,e){t.type===c.Document||t.rootId||(t.rootId=e),"childNodes"in t&&t.childNodes.forEach((t=>{this.patchRootIdOnNode(t,e)}))}}class ve{constructor(t){a(this,"shadowDoms",new WeakSet),a(this,"mutationCb"),a(this,"scrollCb"),a(this,"bypassOptions"),a(this,"mirror"),a(this,"restoreHandlers",[]),this.mutationCb=t.mutationCb,this.scrollCb=t.scrollCb,this.bypassOptions=t.bypassOptions,this.mirror=t.mirror,this.init()}init(){this.reset(),this.patchAttachShadow(Element,document)}addShadowRoot(t,e){if(C(t)&&!this.shadowDoms.has(t)){this.shadowDoms.add(t);var i=te(r({},this.bypassOptions,{doc:e,mutationCb:this.mutationCb,mirror:this.mirror,shadowDomManager:this}),t);this.restoreHandlers.push((()=>i.disconnect())),this.restoreHandlers.push(re(r({},this.bypassOptions,{scrollCb:this.scrollCb,doc:t,mirror:this.mirror}))),setTimeout((()=>{t.adoptedStyleSheets&&t.adoptedStyleSheets.length>0&&this.bypassOptions.stylesheetManager.adoptStyleSheets(t.adoptedStyleSheets,this.mirror.getId(vt.host(t))),this.restoreHandlers.push(ae({mirror:this.mirror,stylesheetManager:this.bypassOptions.stylesheetManager},t))}),0)}}observeAttachShadow(t){t.contentWindow&&t.contentDocument&&this.patchAttachShadow(t.contentWindow.Element,t.contentDocument)}patchAttachShadow(t,e){var r=this;this.restoreHandlers.push(bt(t.prototype,"attachShadow",(function(t){return function(i){var n=t.call(this,i),o=vt.shadowRoot(this);return o&&Pt(this)&&r.addShadowRoot(o,e),n}})))}reset(){this.restoreHandlers.forEach((t=>{try{t()}catch(t){}})),this.restoreHandlers=[],this.shadowDoms=new WeakSet}}for(var fe="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",pe="undefined"==typeof Uint8Array?[]:new Uint8Array(256),ge=0;ge<64;ge++)pe[fe.charCodeAt(ge)]=ge;var me=new Map;var ye=(t,e,r)=>{if(t&&(_e(t,e)||"object"==typeof t)){var i=function(t,e){var r=me.get(t);return r||(r=new Map,me.set(t,r)),r.has(e)||r.set(e,[]),r.get(e)}(r,t.constructor.name),n=i.indexOf(t);return-1===n&&(n=i.length,i.push(t)),n}};function be(t,e,r){if(t instanceof Array)return t.map((t=>be(t,e,r)));if(null===t)return t;if(t instanceof Float32Array||t instanceof Float64Array||t instanceof Int32Array||t instanceof Uint32Array||t instanceof Uint8Array||t instanceof Uint16Array||t instanceof Int16Array||t instanceof Int8Array||t instanceof Uint8ClampedArray)return{rr_type:t.constructor.name,args:[Object.values(t)]};if(t instanceof ArrayBuffer)return{rr_type:t.constructor.name,base64:function(t){var e,r=new Uint8Array(t),i=r.length,n="";for(e=0;e<i;e+=3)n+=fe[r[e]>>2],n+=fe[(3&r[e])<<4|r[e+1]>>4],n+=fe[(15&r[e+1])<<2|r[e+2]>>6],n+=fe[63&r[e+2]];return i%3==2?n=n.substring(0,n.length-1)+"=":i%3==1&&(n=n.substring(0,n.length-2)+"=="),n}(t)};if(t instanceof DataView)return{rr_type:t.constructor.name,args:[be(t.buffer,e,r),t.byteOffset,t.byteLength]};if(t instanceof HTMLImageElement){var i=t.constructor.name,{src:n}=t;return{rr_type:i,src:n}}if(t instanceof HTMLCanvasElement){return{rr_type:"HTMLImageElement",src:t.toDataURL()}}return t instanceof ImageData?{rr_type:t.constructor.name,args:[be(t.data,e,r),t.width,t.height]}:_e(t,e)||"object"==typeof t?{rr_type:t.constructor.name,index:ye(t,e,r)}:t}var we=(t,e,r)=>t.map((t=>be(t,e,r))),_e=(t,e)=>{var r=["WebGLActiveInfo","WebGLBuffer","WebGLFramebuffer","WebGLProgram","WebGLRenderbuffer","WebGLShader","WebGLShaderPrecisionFormat","WebGLTexture","WebGLUniformLocation","WebGLVertexArrayObject","WebGLVertexArrayObjectOES"].filter((t=>"function"==typeof e[t]));return Boolean(r.find((r=>t instanceof e[r])))};function Ce(t,e,r,i){var n=[];try{var o=bt(t.HTMLCanvasElement.prototype,"getContext",(function(t){return function(n){for(var o=arguments.length,s=new Array(o>1?o-1:0),a=1;a<o;a++)s[a-1]=arguments[a];if(!kt(this,e,r,!0)){var l=function(t){return"experimental-webgl"===t?"webgl":t}(n);if("__context"in this||(this.__context=l),i&&["webgl","webgl2"].includes(l))if(s[0]&&"object"==typeof s[0]){var u=s[0];u.preserveDrawingBuffer||(u.preserveDrawingBuffer=!0)}else s.splice(0,1,{preserveDrawingBuffer:!0})}return t.apply(this,[n,...s])}}));n.push(o)}catch(t){console.error("failed to patch HTMLCanvasElement.prototype.getContext")}return()=>{n.forEach((t=>t()))}}function Ie(t,e,r,i,n,o){var s=[],a=Object.getOwnPropertyNames(t),l=function(a){if(["isContextLost","canvas","drawingBufferWidth","drawingBufferHeight"].includes(a))return 0;try{if("function"!=typeof t[a])return 0;var l=bt(t,a,(function(t){return function(){for(var s=arguments.length,l=new Array(s),u=0;u<s;u++)l[u]=arguments[u];var c=t.apply(this,l);if(ye(c,o,this),"tagName"in this.canvas&&!kt(this.canvas,i,n,!0)){var h=we(l,o,this),d={type:e,property:a,args:h};r(this.canvas,d)}return c}}));s.push(l)}catch(i){var u=yt(t,a,{set(t){r(this.canvas,{type:e,property:a,args:[t],setter:!0})}});s.push(u)}};for(var u of a)l(u);return s}var Se,ke,xe,Ae,Te="KGZ1bmN0aW9uKCkgewogICJ1c2Ugc3RyaWN0IjsKICB2YXIgY2hhcnMgPSAiQUJDREVGR0hJSktMTU5PUFFSU1RVVldYWVphYmNkZWZnaGlqa2xtbm9wcXJzdHV2d3h5ejAxMjM0NTY3ODkrLyI7CiAgdmFyIGxvb2t1cCA9IHR5cGVvZiBVaW50OEFycmF5ID09PSAidW5kZWZpbmVkIiA/IFtdIDogbmV3IFVpbnQ4QXJyYXkoMjU2KTsKICBmb3IgKHZhciBpID0gMDsgaSA8IGNoYXJzLmxlbmd0aDsgaSsrKSB7CiAgICBsb29rdXBbY2hhcnMuY2hhckNvZGVBdChpKV0gPSBpOwogIH0KICB2YXIgZW5jb2RlID0gZnVuY3Rpb24oYXJyYXlidWZmZXIpIHsKICAgIHZhciBieXRlcyA9IG5ldyBVaW50OEFycmF5KGFycmF5YnVmZmVyKSwgaTIsIGxlbiA9IGJ5dGVzLmxlbmd0aCwgYmFzZTY0ID0gIiI7CiAgICBmb3IgKGkyID0gMDsgaTIgPCBsZW47IGkyICs9IDMpIHsKICAgICAgYmFzZTY0ICs9IGNoYXJzW2J5dGVzW2kyXSA+PiAyXTsKICAgICAgYmFzZTY0ICs9IGNoYXJzWyhieXRlc1tpMl0gJiAzKSA8PCA0IHwgYnl0ZXNbaTIgKyAxXSA+PiA0XTsKICAgICAgYmFzZTY0ICs9IGNoYXJzWyhieXRlc1tpMiArIDFdICYgMTUpIDw8IDIgfCBieXRlc1tpMiArIDJdID4+IDZdOwogICAgICBiYXNlNjQgKz0gY2hhcnNbYnl0ZXNbaTIgKyAyXSAmIDYzXTsKICAgIH0KICAgIGlmIChsZW4gJSAzID09PSAyKSB7CiAgICAgIGJhc2U2NCA9IGJhc2U2NC5zdWJzdHJpbmcoMCwgYmFzZTY0Lmxlbmd0aCAtIDEpICsgIj0iOwogICAgfSBlbHNlIGlmIChsZW4gJSAzID09PSAxKSB7CiAgICAgIGJhc2U2NCA9IGJhc2U2NC5zdWJzdHJpbmcoMCwgYmFzZTY0Lmxlbmd0aCAtIDIpICsgIj09IjsKICAgIH0KICAgIHJldHVybiBiYXNlNjQ7CiAgfTsKICBjb25zdCBsYXN0QmxvYk1hcCA9IC8qIEBfX1BVUkVfXyAqLyBuZXcgTWFwKCk7CiAgY29uc3QgdHJhbnNwYXJlbnRCbG9iTWFwID0gLyogQF9fUFVSRV9fICovIG5ldyBNYXAoKTsKICBhc3luYyBmdW5jdGlvbiBnZXRUcmFuc3BhcmVudEJsb2JGb3Iod2lkdGgsIGhlaWdodCwgZGF0YVVSTE9wdGlvbnMpIHsKICAgIGNvbnN0IGlkID0gYCR7d2lkdGh9LSR7aGVpZ2h0fWA7CiAgICBpZiAoIk9mZnNjcmVlbkNhbnZhcyIgaW4gZ2xvYmFsVGhpcykgewogICAgICBpZiAodHJhbnNwYXJlbnRCbG9iTWFwLmhhcyhpZCkpIHJldHVybiB0cmFuc3BhcmVudEJsb2JNYXAuZ2V0KGlkKTsKICAgICAgY29uc3Qgb2Zmc2NyZWVuID0gbmV3IE9mZnNjcmVlbkNhbnZhcyh3aWR0aCwgaGVpZ2h0KTsKICAgICAgb2Zmc2NyZWVuLmdldENvbnRleHQoIjJkIik7CiAgICAgIGNvbnN0IGJsb2IgPSBhd2FpdCBvZmZzY3JlZW4uY29udmVydFRvQmxvYihkYXRhVVJMT3B0aW9ucyk7CiAgICAgIGNvbnN0IGFycmF5QnVmZmVyID0gYXdhaXQgYmxvYi5hcnJheUJ1ZmZlcigpOwogICAgICBjb25zdCBiYXNlNjQgPSBlbmNvZGUoYXJyYXlCdWZmZXIpOwogICAgICB0cmFuc3BhcmVudEJsb2JNYXAuc2V0KGlkLCBiYXNlNjQpOwogICAgICByZXR1cm4gYmFzZTY0OwogICAgfSBlbHNlIHsKICAgICAgcmV0dXJuICIiOwogICAgfQogIH0KICBjb25zdCB3b3JrZXIgPSBzZWxmOwogIHdvcmtlci5vbm1lc3NhZ2UgPSBhc3luYyBmdW5jdGlvbihlKSB7CiAgICBpZiAoIk9mZnNjcmVlbkNhbnZhcyIgaW4gZ2xvYmFsVGhpcykgewogICAgICBjb25zdCB7IGlkLCBiaXRtYXAsIHdpZHRoLCBoZWlnaHQsIGRhdGFVUkxPcHRpb25zIH0gPSBlLmRhdGE7CiAgICAgIGNvbnN0IHRyYW5zcGFyZW50QmFzZTY0ID0gZ2V0VHJhbnNwYXJlbnRCbG9iRm9yKAogICAgICAgIHdpZHRoLAogICAgICAgIGhlaWdodCwKICAgICAgICBkYXRhVVJMT3B0aW9ucwogICAgICApOwogICAgICBjb25zdCBvZmZzY3JlZW4gPSBuZXcgT2Zmc2NyZWVuQ2FudmFzKHdpZHRoLCBoZWlnaHQpOwogICAgICBjb25zdCBjdHggPSBvZmZzY3JlZW4uZ2V0Q29udGV4dCgiMmQiKTsKICAgICAgY3R4LmRyYXdJbWFnZShiaXRtYXAsIDAsIDApOwogICAgICBiaXRtYXAuY2xvc2UoKTsKICAgICAgY29uc3QgYmxvYiA9IGF3YWl0IG9mZnNjcmVlbi5jb252ZXJ0VG9CbG9iKGRhdGFVUkxPcHRpb25zKTsKICAgICAgY29uc3QgdHlwZSA9IGJsb2IudHlwZTsKICAgICAgY29uc3QgYXJyYXlCdWZmZXIgPSBhd2FpdCBibG9iLmFycmF5QnVmZmVyKCk7CiAgICAgIGNvbnN0IGJhc2U2NCA9IGVuY29kZShhcnJheUJ1ZmZlcik7CiAgICAgIGlmICghbGFzdEJsb2JNYXAuaGFzKGlkKSAmJiBhd2FpdCB0cmFuc3BhcmVudEJhc2U2NCA9PT0gYmFzZTY0KSB7CiAgICAgICAgbGFzdEJsb2JNYXAuc2V0KGlkLCBiYXNlNjQpOwogICAgICAgIHJldHVybiB3b3JrZXIucG9zdE1lc3NhZ2UoeyBpZCB9KTsKICAgICAgfQogICAgICBpZiAobGFzdEJsb2JNYXAuZ2V0KGlkKSA9PT0gYmFzZTY0KSByZXR1cm4gd29ya2VyLnBvc3RNZXNzYWdlKHsgaWQgfSk7CiAgICAgIHdvcmtlci5wb3N0TWVzc2FnZSh7CiAgICAgICAgaWQsCiAgICAgICAgdHlwZSwKICAgICAgICBiYXNlNjQsCiAgICAgICAgd2lkdGgsCiAgICAgICAgaGVpZ2h0CiAgICAgIH0pOwogICAgICBsYXN0QmxvYk1hcC5zZXQoaWQsIGJhc2U2NCk7CiAgICB9IGVsc2UgewogICAgICByZXR1cm4gd29ya2VyLnBvc3RNZXNzYWdlKHsgaWQ6IGUuZGF0YS5pZCB9KTsKICAgIH0KICB9Owp9KSgpOwovLyMgc291cmNlTWFwcGluZ1VSTD1pbWFnZS1iaXRtYXAtZGF0YS11cmwtd29ya2VyLUlKcEM3Z19iLmpzLm1hcAo=",Me="undefined"!=typeof window&&window.Blob&&new Blob([(Se=Te,Uint8Array.from(atob(Se),(t=>t.charCodeAt(0))))],{type:"text/javascript;charset=utf-8"});function Ee(t){var e;try{if(!(e=Me&&(window.URL||window.webkitURL).createObjectURL(Me)))throw"";var r=new Worker(e,{name:null==t?void 0:t.name});return r.addEventListener("error",(()=>{(window.URL||window.webkitURL).revokeObjectURL(e)})),r}catch(e){return new Worker("data:text/javascript;base64,"+Te,{name:null==t?void 0:t.name})}finally{e&&(window.URL||window.webkitURL).revokeObjectURL(e)}}class Ne{constructor(t){a(this,"pendingCanvasMutations",new Map),a(this,"rafStamps",{latestId:0,invokeId:null}),a(this,"mirror"),a(this,"mutationCb"),a(this,"resetObservers"),a(this,"frozen",!1),a(this,"locked",!1),a(this,"processMutation",((t,e)=>{!(this.rafStamps.invokeId&&this.rafStamps.latestId!==this.rafStamps.invokeId)&&this.rafStamps.invokeId||(this.rafStamps.invokeId=this.rafStamps.latestId),this.pendingCanvasMutations.has(t)||this.pendingCanvasMutations.set(t,[]),this.pendingCanvasMutations.get(t).push(e)}));var{sampling:e="all",win:r,blockClass:i,blockSelector:n,recordCanvas:o,dataURLOptions:s}=t;this.mutationCb=t.mutationCb,this.mirror=t.mirror,o&&"all"===e&&this.initCanvasMutationObserver(r,i,n),o&&"number"==typeof e&&this.initCanvasFPSObserver(e,r,i,n,{dataURLOptions:s})}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(t,r,i,n,o){var s=this,a=Ce(r,i,n,!0),l=new Map,u=new Ee;u.onmessage=t=>{var{id:e}=t.data;if(l.set(e,!1),"base64"in t.data){var{base64:r,type:i,width:n,height:o}=t.data;this.mutationCb({id:e,type:$t["2D"],commands:[{property:"clearRect",args:[0,0,n,o]},{property:"drawImage",args:[{rr_type:"ImageBitmap",args:[{rr_type:"Blob",data:[{rr_type:"ArrayBuffer",base64:r}],type:i}]},0,0]}]})}};var c,h=1e3/t,d=0,v=t=>{var a,f;d&&t-d<h?c=requestAnimationFrame(v):(d=t,(a=[],f=t=>{t.querySelectorAll("canvas").forEach((t=>{kt(t,i,n,!0)||a.push(t)})),t.querySelectorAll("*").forEach((t=>{t.shadowRoot&&f(t.shadowRoot)}))},f(r.document),a).forEach(function(){var t=e((function*(t){var e,r=s.mirror.getId(t);if(!l.get(r)&&0!==t.width&&0!==t.height){if(l.set(r,!0),["webgl","webgl2"].includes(t.__context)){var i=t.getContext(t.__context);!1===(null==(e=null==i?void 0:i.getContextAttributes())?void 0:e.preserveDrawingBuffer)&&i.clear(i.COLOR_BUFFER_BIT)}var n=t.clientWidth||t.width,a=t.clientHeight||t.height,c=yield createImageBitmap(t,{resizeWidth:n,resizeHeight:a});u.postMessage({id:r,bitmap:c,width:n,height:a,dataURLOptions:o.dataURLOptions},[c])}}));return function(e){return t.apply(this,arguments)}}()),c=requestAnimationFrame(v))};c=requestAnimationFrame(v),this.resetObservers=()=>{a(),cancelAnimationFrame(c)}}initCanvasMutationObserver(t,e,r){this.startRAFTimestamping(),this.startPendingCanvasMutationFlusher();var i=Ce(t,e,r,!1),n=function(t,e,r,i){var n=[],o=Object.getOwnPropertyNames(e.CanvasRenderingContext2D.prototype),s=function(o){try{if("function"!=typeof e.CanvasRenderingContext2D.prototype[o])return 1;var s=bt(e.CanvasRenderingContext2D.prototype,o,(function(n){return function(){for(var s=arguments.length,a=new Array(s),l=0;l<s;l++)a[l]=arguments[l];return kt(this.canvas,r,i,!0)||setTimeout((()=>{var r=we(a,e,this);t(this.canvas,{type:$t["2D"],property:o,args:r})}),0),n.apply(this,a)}}));n.push(s)}catch(r){var a=yt(e.CanvasRenderingContext2D.prototype,o,{set(e){t(this.canvas,{type:$t["2D"],property:o,args:[e],setter:!0})}});n.push(a)}};for(var a of o)s(a);return()=>{n.forEach((t=>t()))}}(this.processMutation.bind(this),t,e,r),o=function(t,e,r,i){var n=[];return n.push(...Ie(e.WebGLRenderingContext.prototype,$t.WebGL,t,r,i,e)),void 0!==e.WebGL2RenderingContext&&n.push(...Ie(e.WebGL2RenderingContext.prototype,$t.WebGL2,t,r,i,e)),()=>{n.forEach((t=>t()))}}(this.processMutation.bind(this),t,e,r);this.resetObservers=()=>{i(),n(),o()}}startPendingCanvasMutationFlusher(){requestAnimationFrame((()=>this.flushPendingCanvasMutations()))}startRAFTimestamping(){var t=e=>{this.rafStamps.latestId=e,requestAnimationFrame(t)};requestAnimationFrame(t)}flushPendingCanvasMutations(){this.pendingCanvasMutations.forEach(((t,e)=>{var r=this.mirror.getId(e);this.flushPendingCanvasMutationFor(e,r)})),requestAnimationFrame((()=>this.flushPendingCanvasMutations()))}flushPendingCanvasMutationFor(t,e){if(!this.frozen&&!this.locked){var r=this.pendingCanvasMutations.get(t);if(r&&-1!==e){var n=r.map((t=>i(t,o))),{type:s}=r[0];this.mutationCb({id:e,type:s,commands:n}),this.pendingCanvasMutations.delete(t)}}}}class Re{constructor(t){a(this,"trackedLinkElements",new WeakSet),a(this,"mutationCb"),a(this,"adoptedStyleSheetCb"),a(this,"styleMirror",new Rt),this.mutationCb=t.mutationCb,this.adoptedStyleSheetCb=t.adoptedStyleSheetCb}attachLinkElement(t,e){"_cssText"in e.attributes&&this.mutationCb({adds:[],removes:[],texts:[],attributes:[{id:e.id,attributes:e.attributes}]}),this.trackLinkElement(t)}trackLinkElement(t){this.trackedLinkElements.has(t)||(this.trackedLinkElements.add(t),this.trackStylesheetInLinkElement(t))}adoptStyleSheets(t,e){var r=this;if(0!==t.length){var i={id:e,styleIds:[]},n=[],o=function(t){var e;r.styleMirror.has(t)?e=r.styleMirror.getId(t):(e=r.styleMirror.add(t),n.push({styleId:e,rules:Array.from(t.rules||CSSRule,((e,r)=>({rule:S(e,t.href),index:r})))})),i.styleIds.push(e)};for(var s of t)o(s);n.length>0&&(i.styles=n),this.adoptedStyleSheetCb(i)}}reset(){this.styleMirror.reset(),this.trackedLinkElements=new WeakSet}trackStylesheetInLinkElement(t){}}class Fe{constructor(){a(this,"nodeMap",new WeakMap),a(this,"active",!1)}inOtherBuffer(t,e){var r=this.nodeMap.get(t);return r&&Array.from(r).some((t=>t!==e))}add(t,e){this.active||(this.active=!0,requestAnimationFrame((()=>{this.nodeMap=new WeakMap,this.active=!1}))),this.nodeMap.set(t,(this.nodeMap.get(t)||new Set).add(e))}destroy(){}}var Oe=!1;try{if(2!==Array.from([1],(t=>2*t))[0]){var Pe=document.createElement("iframe");document.body.appendChild(Pe),Array.from=(null==(n=Pe.contentWindow)?void 0:n.Array.from)||Array.from,document.body.removeChild(Pe)}}catch(t){console.debug("Unable to override Array.from",t)}var Le,De,Be=new x;function Ze(t){void 0===t&&(t={});var{emit:e,checkoutEveryNms:i,checkoutEveryNth:n,blockClass:o="rr-block",blockSelector:s=null,ignoreClass:a="rr-ignore",ignoreSelector:l=null,maskTextClass:u="rr-mask",maskTextSelector:c=null,inlineStylesheet:h=!0,maskAllInputs:d,maskInputOptions:v,slimDOMOptions:f,maskInputFn:p,maskTextFn:g,hooks:m,packFn:y,sampling:b={},dataURLOptions:w={},mousemoveWait:_,recordDOM:C=!0,recordCanvas:I=!1,recordCrossOriginIframes:S=!1,recordAfter:k=("DOMContentLoaded"===t.recordAfter?t.recordAfter:"load"),userTriggeredOnInput:A=!1,collectFonts:T=!1,inlineImages:M=!1,plugins:E,keepIframeSrcFn:N=(()=>!1),ignoreCSSAttributes:R=new Set([]),errorHandler:F}=t;jt=F;var O=!S||window.parent===window,P=!1;if(!O)try{window.parent.document&&(P=!1)}catch(t){P=!0}if(O&&!e)throw new Error("emit function is required");if(!O&&!P)return()=>{};void 0!==_&&void 0===b.mousemove&&(b.mousemove=_),Be.reset();var L,D=!0===d?{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!==v?v:{password:!0},B=!0===f||"all"===f?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaVerification:!0,headMetaAuthorship:"all"===f,headMetaDescKeywords:"all"===f,headTitleMutations:"all"===f}:f||{};!function(t){void 0===t&&(t=window),"NodeList"in t&&!t.NodeList.prototype.forEach&&(t.NodeList.prototype.forEach=Array.prototype.forEach),"DOMTokenList"in t&&!t.DOMTokenList.prototype.forEach&&(t.DOMTokenList.prototype.forEach=Array.prototype.forEach)}();var Z=0,q=t=>{for(var e of E||[])e.eventProcessor&&(t=e.eventProcessor(t));return y&&!P&&(t=y(t)),t};ke=(t,r)=>{var o,s=t;if(s.timestamp=wt(),!(null==(o=Kt[0])?void 0:o.isFrozen())||s.type===Lt.FullSnapshot||s.type===Lt.IncrementalSnapshot&&s.data.source===Dt.Mutation||Kt.forEach((t=>t.unfreeze())),O)null==e||e(q(s),r);else if(P){var a={type:"rrweb",event:q(s),origin:window.location.origin,isCheckout:r};window.parent.postMessage(a,"*")}if(s.type===Lt.FullSnapshot)L=s,Z=0;else if(s.type===Lt.IncrementalSnapshot){if(s.data.source===Dt.Mutation&&s.data.isAttachIframe)return;Z++;var l=n&&Z>=n,u=i&&s.timestamp-L.timestamp>i;(l||u)&&xe(!0)}};var H=t=>{ke({type:Lt.IncrementalSnapshot,data:r({source:Dt.Mutation},t)})},V=t=>ke({type:Lt.IncrementalSnapshot,data:r({source:Dt.Scroll},t)}),j=t=>ke({type:Lt.IncrementalSnapshot,data:r({source:Dt.CanvasMutation},t)}),Y=new Re({mutationCb:H,adoptedStyleSheetCb:t=>ke({type:Lt.IncrementalSnapshot,data:r({source:Dt.AdoptedStyleSheet},t)})}),G=new de({mirror:Be,mutationCb:H,stylesheetManager:Y,recordCrossOriginIframes:S,wrappedEmit:ke});for(var W of E||[])W.getMirror&&W.getMirror({nodeMirror:Be,crossOriginIframeMirror:G.crossOriginIframeMirror,crossOriginIframeStyleMirror:G.crossOriginIframeStyleMirror});var z=new Fe;Ae=new Ne({recordCanvas:I,mutationCb:j,win:window,blockClass:o,blockSelector:s,mirror:Be,sampling:b.canvas,dataURLOptions:w});var U=new ve({mutationCb:H,scrollCb:V,bypassOptions:{blockClass:o,blockSelector:s,maskTextClass:u,maskTextSelector:c,inlineStylesheet:h,maskInputOptions:D,dataURLOptions:w,maskTextFn:g,maskInputFn:p,recordCanvas:I,inlineImages:M,sampling:b,slimDOMOptions:B,iframeManager:G,stylesheetManager:Y,canvasManager:Ae,keepIframeSrcFn:N,processedNodeManager:z},mirror:Be});xe=function(t){if(void 0===t&&(t=!1),C){ke({type:Lt.Meta,data:{href:window.location.href,width:It(),height:Ct()}},t),Y.reset(),U.init(),Kt.forEach((t=>t.lock()));var e=function(t,e){var{mirror:r=new x,blockClass:i="rr-block",blockSelector:n=null,maskTextClass:o="rr-mask",maskTextSelector:s=null,inlineStylesheet:a=!0,inlineImages:l=!1,recordCanvas:u=!1,maskAllInputs:c=!1,maskTextFn:h,maskInputFn:d,slimDOM:v=!1,dataURLOptions:f,preserveWhiteSpace:p,onSerialize:g,onIframeLoad:m,iframeLoadTimeout:y,onStylesheetLoad:b,stylesheetLoadTimeout:w,keepIframeSrcFn:_=(()=>!1)}=e||{};return rt(t,{doc:t,mirror:r,blockClass:i,blockSelector:n,maskTextClass:o,maskTextSelector:s,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:h,maskInputFn:d,slimDOMOptions:!0===v||"all"===v?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaDescKeywords:"all"===v,headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaAuthorship:!0,headMetaVerification:!0}:!1===v?{}:v,dataURLOptions:f,inlineImages:l,recordCanvas:u,preserveWhiteSpace:p,onSerialize:g,onIframeLoad:m,iframeLoadTimeout:y,onStylesheetLoad:b,stylesheetLoadTimeout:w,keepIframeSrcFn:_,newlyAddedElement:!1})}(document,{mirror:Be,blockClass:o,blockSelector:s,maskTextClass:u,maskTextSelector:c,inlineStylesheet:h,maskAllInputs:D,maskTextFn:g,maskInputFn:p,slimDOM:B,dataURLOptions:w,recordCanvas:I,inlineImages:M,onSerialize:t=>{Mt(t,Be)&&G.addIframe(t),Et(t,Be)&&Y.trackLinkElement(t),Nt(t)&&U.addShadowRoot(vt.shadowRoot(t),document)},onIframeLoad:(t,e)=>{G.attachIframe(t,e),U.observeAttachShadow(t)},onStylesheetLoad:(t,e)=>{Y.attachLinkElement(t,e)},keepIframeSrcFn:N});if(!e)return console.warn("Failed to snapshot the document");ke({type:Lt.FullSnapshot,data:{node:e,initialOffset:_t(window)}},t),Kt.forEach((t=>t.unlock())),document.adoptedStyleSheets&&document.adoptedStyleSheets.length>0&&Y.adoptStyleSheets(document.adoptedStyleSheets,Be.getId(document))}};try{var X=[],J=t=>{var e;return Jt(le)({mutationCb:H,mousemoveCb:(t,e)=>ke({type:Lt.IncrementalSnapshot,data:{source:e,positions:t}}),mouseInteractionCb:t=>ke({type:Lt.IncrementalSnapshot,data:r({source:Dt.MouseInteraction},t)}),scrollCb:V,viewportResizeCb:t=>ke({type:Lt.IncrementalSnapshot,data:r({source:Dt.ViewportResize},t)}),inputCb:t=>ke({type:Lt.IncrementalSnapshot,data:r({source:Dt.Input},t)}),mediaInteractionCb:t=>ke({type:Lt.IncrementalSnapshot,data:r({source:Dt.MediaInteraction},t)}),styleSheetRuleCb:t=>ke({type:Lt.IncrementalSnapshot,data:r({source:Dt.StyleSheetRule},t)}),styleDeclarationCb:t=>ke({type:Lt.IncrementalSnapshot,data:r({source:Dt.StyleDeclaration},t)}),canvasMutationCb:j,fontCb:t=>ke({type:Lt.IncrementalSnapshot,data:r({source:Dt.Font},t)}),selectionCb:t=>{ke({type:Lt.IncrementalSnapshot,data:r({source:Dt.Selection},t)})},customElementCb:t=>{ke({type:Lt.IncrementalSnapshot,data:r({source:Dt.CustomElement},t)})},blockClass:o,ignoreClass:a,ignoreSelector:l,maskTextClass:u,maskTextSelector:c,maskInputOptions:D,inlineStylesheet:h,sampling:b,recordDOM:C,recordCanvas:I,inlineImages:M,userTriggeredOnInput:A,collectFonts:T,doc:t,maskInputFn:p,maskTextFn:g,keepIframeSrcFn:N,blockSelector:s,slimDOMOptions:B,dataURLOptions:w,mirror:Be,iframeManager:G,stylesheetManager:Y,shadowDomManager:U,processedNodeManager:z,canvasManager:Ae,ignoreCSSAttributes:R,plugins:(null==(e=null==E?void 0:E.filter((t=>t.observer)))?void 0:e.map((t=>({observer:t.observer,options:t.options,callback:e=>ke({type:Lt.Plugin,data:{plugin:t.name,payload:e}})}))))||[]},m)};G.addLoadListener((t=>{try{X.push(J(t.contentDocument))}catch(t){console.warn(t)}}));var K=()=>{xe(),X.push(J(document)),Oe=!0};return"interactive"===document.readyState||"complete"===document.readyState?K():(X.push(ft("DOMContentLoaded",(()=>{ke({type:Lt.DomContentLoaded,data:{}}),"DOMContentLoaded"===k&&K()}))),X.push(ft("load",(()=>{ke({type:Lt.Load,data:{}}),"load"===k&&K()}),window))),()=>{X.forEach((t=>t())),z.destroy(),Oe=!1,jt=void 0}}catch(t){console.warn(t)}}Ze.addCustomEvent=(t,e)=>{if(!Oe)throw new Error("please add custom event after start recording");ke({type:Lt.Custom,data:{tag:t,payload:e}})},Ze.freezePage=()=>{Kt.forEach((t=>t.freeze()))},Ze.takeFullSnapshot=t=>{if(!Oe)throw new Error("please take full snapshot after start recording");xe(t)},Ze.mirror=Be,(De=Le||(Le={}))[De.NotStarted=0]="NotStarted",De[De.Running=1]="Running",De[De.Stopped=2]="Stopped";var $e,qe=Object.defineProperty,He=(t,e,r)=>((t,e,r)=>e in t?qe(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r)(t,"symbol"!=typeof e?e+"":e,r),Ve=Object.defineProperty,je=(t,e,r)=>((t,e,r)=>e in t?Ve(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r)(t,"symbol"!=typeof e?e+"":e,r),Ye=Object.defineProperty,Ge=(t,e,r)=>((t,e,r)=>e in t?Ye(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r)(t,"symbol"!=typeof e?e+"":e,r),We={Node:["childNodes","parentNode","parentElement","textContent"],ShadowRoot:["host","styleSheets"],Element:["shadowRoot","querySelector","querySelectorAll"],MutationObserver:[]},ze={Node:["contains","getRootNode"],ShadowRoot:["getSelection"],Element:[],MutationObserver:["constructor"]},Ue={};function Xe(t){if(Ue[t])return Ue[t];var e=globalThis[t],r=e.prototype,i=t in We?We[t]:void 0,n=Boolean(i&&i.every((t=>{var e,i;return Boolean(null==(i=null==(e=Object.getOwnPropertyDescriptor(r,t))?void 0:e.get)?void 0:i.toString().includes("[native code]"))}))),o=t in ze?ze[t]:void 0,s=Boolean(o&&o.every((t=>{var e;return"function"==typeof r[t]&&(null==(e=r[t])?void 0:e.toString().includes("[native code]"))})));if(n&&s)return Ue[t]=e.prototype,e.prototype;try{var a=document.createElement("iframe");document.body.appendChild(a);var l=a.contentWindow;if(!l)return e.prototype;var u=l[t].prototype;return document.body.removeChild(a),u?Ue[t]=u:r}catch(t){return r}}var Je={};function Ke(t,e,r){var i,n=t+"."+String(r);if(Je[n])return Je[n].call(e);var o=Xe(t),s=null==(i=Object.getOwnPropertyDescriptor(o,r))?void 0:i.get;return s?(Je[n]=s,s.call(e)):e[r]}var Qe={};function tr(t,e,r){var i=t+"."+String(r);if(Qe[i])return Qe[i].bind(e);var n=Xe(t)[r];return"function"!=typeof n?e[r]:(Qe[i]=n,n.bind(e))}var er={childNodes:function(t){return Ke("Node",t,"childNodes")},parentNode:function(t){return Ke("Node",t,"parentNode")},parentElement:function(t){return Ke("Node",t,"parentElement")},textContent:function(t){return Ke("Node",t,"textContent")},contains:function(t,e){return tr("Node",t,"contains")(e)},getRootNode:function(t){return tr("Node",t,"getRootNode")()},host:function(t){return t&&"host"in t?Ke("ShadowRoot",t,"host"):null},styleSheets:function(t){return t.styleSheets},shadowRoot:function(t){return t&&"shadowRoot"in t?Ke("Element",t,"shadowRoot"):null},querySelector:function(t,e){return Ke("Element",t,"querySelector")(e)},querySelectorAll:function(t,e){return Ke("Element",t,"querySelectorAll")(e)},mutationObserver:function(){return Xe("MutationObserver").constructor}};class rr{constructor(){Ge(this,"idNodeMap",new Map),Ge(this,"nodeMetaMap",new WeakMap)}getId(t){var e;if(!t)return-1;var r=null==(e=this.getMeta(t))?void 0:e.id;return null!=r?r:-1}getNode(t){return this.idNodeMap.get(t)||null}getIds(){return Array.from(this.idNodeMap.keys())}getMeta(t){return this.nodeMetaMap.get(t)||null}removeNodeFromMap(t){var e=this.getId(t);this.idNodeMap.delete(e),t.childNodes&&t.childNodes.forEach((t=>this.removeNodeFromMap(t)))}has(t){return this.idNodeMap.has(t)}hasNode(t){return this.nodeMetaMap.has(t)}add(t,e){var r=e.id;this.idNodeMap.set(r,t),this.nodeMetaMap.set(t,e)}replace(t,e){var r=this.getNode(t);if(r){var i=this.nodeMetaMap.get(r);i&&this.nodeMetaMap.set(e,i)}this.idNodeMap.set(t,e)}reset(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap}}function ir(t,e,r){if(!t)return!1;if(t.nodeType!==t.ELEMENT_NODE)return!!r&&ir(er.parentNode(t),e,r);for(var i=t.classList.length;i--;){var n=t.classList[i];if(e.test(n))return!0}return!!r&&ir(er.parentNode(t),e,r)}class nr{constructor(){__publicField22(this,"parentElement",null),__publicField22(this,"parentNode",null),__publicField22(this,"ownerDocument"),__publicField22(this,"firstChild",null),__publicField22(this,"lastChild",null),__publicField22(this,"previousSibling",null),__publicField22(this,"nextSibling",null),__publicField22(this,"ELEMENT_NODE",1),__publicField22(this,"TEXT_NODE",3),__publicField22(this,"nodeType"),__publicField22(this,"nodeName"),__publicField22(this,"RRNodeType")}get childNodes(){for(var t=[],e=this.firstChild;e;)t.push(e),e=e.nextSibling;return t}contains(t){if(!(t instanceof nr))return!1;if(t.ownerDocument!==this.ownerDocument)return!1;if(t===this)return!0;for(;t.parentNode;){if(t.parentNode===this)return!0;t=t.parentNode}return!1}appendChild(t){throw new Error("RRDomException: Failed to execute 'appendChild' on 'RRNode': This RRNode type does not support this method.")}insertBefore(t,e){throw new Error("RRDomException: Failed to execute 'insertBefore' on 'RRNode': This RRNode type does not support this method.")}removeChild(t){throw new Error("RRDomException: Failed to execute 'removeChild' on 'RRNode': This RRNode type does not support this method.")}toString(){return"RRNode"}}var or={Node:["childNodes","parentNode","parentElement","textContent"],ShadowRoot:["host","styleSheets"],Element:["shadowRoot","querySelector","querySelectorAll"],MutationObserver:[]},sr={Node:["contains","getRootNode"],ShadowRoot:["getSelection"],Element:[],MutationObserver:["constructor"]},ar={};function lr(t){if(ar[t])return ar[t];var e=globalThis[t],r=e.prototype,i=t in or?or[t]:void 0,n=Boolean(i&&i.every((t=>{var e,i;return Boolean(null==(i=null==(e=Object.getOwnPropertyDescriptor(r,t))?void 0:e.get)?void 0:i.toString().includes("[native code]"))}))),o=t in sr?sr[t]:void 0,s=Boolean(o&&o.every((t=>{var e;return"function"==typeof r[t]&&(null==(e=r[t])?void 0:e.toString().includes("[native code]"))})));if(n&&s)return ar[t]=e.prototype,e.prototype;try{var a=document.createElement("iframe");document.body.appendChild(a);var l=a.contentWindow;if(!l)return e.prototype;var u=l[t].prototype;return document.body.removeChild(a),u?ar[t]=u:r}catch(t){return r}}var ur={};function cr(t,e,r){var i,n=t+"."+String(r);if(ur[n])return ur[n].call(e);var o=lr(t),s=null==(i=Object.getOwnPropertyDescriptor(o,r))?void 0:i.get;return s?(ur[n]=s,s.call(e)):e[r]}var hr={};function dr(t,e,r){var i=t+"."+String(r);if(hr[i])return hr[i].bind(e);var n=lr(t)[r];return"function"!=typeof n?e[r]:(hr[i]=n,n.bind(e))}var vr={childNodes:function(t){return cr("Node",t,"childNodes")},parentNode:function(t){return cr("Node",t,"parentNode")},parentElement:function(t){return cr("Node",t,"parentElement")},textContent:function(t){return cr("Node",t,"textContent")},contains:function(t,e){return dr("Node",t,"contains")(e)},getRootNode:function(t){return dr("Node",t,"getRootNode")()},host:function(t){return t&&"host"in t?cr("ShadowRoot",t,"host"):null},styleSheets:function(t){return t.styleSheets},shadowRoot:function(t){return t&&"shadowRoot"in t?cr("Element",t,"shadowRoot"):null},querySelector:function(t,e){return cr("Element",t,"querySelector")(e)},querySelectorAll:function(t,e){return cr("Element",t,"querySelectorAll")(e)},mutationObserver:function(){return lr("MutationObserver").constructor}};var fr="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.",pr={map:{},getId:()=>(console.error(fr),-1),getNode:()=>(console.error(fr),null),removeNodeFromMap(){console.error(fr)},has:()=>(console.error(fr),!1),reset(){console.error(fr)}};"undefined"!=typeof window&&window.Proxy&&window.Reflect&&(pr=new Proxy(pr,{get:(t,e,r)=>("map"===e&&console.error(fr),Reflect.get(t,e,r))}));var gr=Date.now;function mr(t){return t?t.nodeType===t.ELEMENT_NODE?t:vr.parentElement(t):null}/[1-9][0-9]{12}/.test(Date.now().toString())||(gr=()=>(new Date).getTime());function yr(t){var e,r=null;return"getRootNode"in t&&(null==(e=vr.getRootNode(t))?void 0:e.nodeType)===Node.DOCUMENT_FRAGMENT_NODE&&vr.host(vr.getRootNode(t))&&(r=vr.host(vr.getRootNode(t))),r}function br(t){for(var e,r=t;e=yr(r);)r=e;return r}function wr(t){var e=t.ownerDocument;if(!e)return!1;var r=br(t);return vr.contains(e,r)}for(var _r=Object.freeze(Object.defineProperty({__proto__:null,StyleSheetMirror:class{constructor(){je(this,"id",1),je(this,"styleIDMap",new WeakMap),je(this,"idStyleMap",new Map)}getId(t){var e;return null!==(e=this.styleIDMap.get(t))&&void 0!==e?e:-1}has(t){return this.styleIDMap.has(t)}add(t,e){return this.has(t)?this.getId(t):(r=void 0===e?this.id++:e,this.styleIDMap.set(t,r),this.idStyleMap.set(r,t),r);var r}getStyle(t){return this.idStyleMap.get(t)||null}reset(){this.styleIDMap=new WeakMap,this.idStyleMap=new Map,this.id=1}generateId(){return this.id++}},get _mirror(){return pr},closestElementOfNode:mr,getBaseDimension:function t(e,r){var i,n,o=null==(n=null==(i=e.ownerDocument)?void 0:i.defaultView)?void 0:n.frameElement;if(!o||o===r)return{x:0,y:0,relativeScale:1,absoluteScale:1};var s=o.getBoundingClientRect(),a=t(o,r),l=s.height/o.clientHeight;return{x:s.x*a.relativeScale+a.x,y:s.y*a.relativeScale+a.y,relativeScale:l,absoluteScale:a.absoluteScale*l}},getNestedRule:function t(e,r){var i=e[r[0]];return 1===r.length?i:t(i.cssRules[r[1]].cssRules,r.slice(2))},getPositionsAndIndex:function(t){var e=[...t],r=e.pop();return{positions:e,index:r}},getRootShadowHost:br,getShadowHost:yr,getWindowHeight:function(){return window.innerHeight||document.documentElement&&document.documentElement.clientHeight||document.body&&document.body.clientHeight},getWindowScroll:function(t){var e,r,i,n,o=t.document;return{left:o.scrollingElement?o.scrollingElement.scrollLeft:void 0!==t.pageXOffset?t.pageXOffset:o.documentElement.scrollLeft||(null==o?void 0:o.body)&&(null==(e=vr.parentElement(o.body))?void 0:e.scrollLeft)||(null==(r=null==o?void 0:o.body)?void 0:r.scrollLeft)||0,top:o.scrollingElement?o.scrollingElement.scrollTop:void 0!==t.pageYOffset?t.pageYOffset:(null==o?void 0:o.documentElement.scrollTop)||(null==o?void 0:o.body)&&(null==(i=vr.parentElement(o.body))?void 0:i.scrollTop)||(null==(n=null==o?void 0:o.body)?void 0:n.scrollTop)||0}},getWindowWidth:function(){return window.innerWidth||document.documentElement&&document.documentElement.clientWidth||document.body&&document.body.clientWidth},hasShadowRoot:function(t){return!!t&&(t instanceof nr&&"shadowRoot"in t?Boolean(t.shadowRoot):Boolean(vr.shadowRoot(t)))},hookSetter:function t(e,r,i,n,o){void 0===o&&(o=window);var s=o.Object.getOwnPropertyDescriptor(e,r);return o.Object.defineProperty(e,r,n?i:{set(t){setTimeout((()=>{i.set.call(this,t)}),0),s&&s.set&&s.set.call(this,t)}}),()=>t(e,r,s||{},!0)},inDom:function(t){var e=t.ownerDocument;return!!e&&(vr.contains(e,t)||wr(t))},isAncestorRemoved:function t(e,r){if(n=(i=e)&&"host"in i&&"mode"in i&&er.host(i)||null,Boolean(n&&"shadowRoot"in n&&er.shadowRoot(n)===i))return!1;var i,n,o=r.getId(e);if(!r.has(o))return!0;var s=vr.parentNode(e);return(!s||s.nodeType!==e.DOCUMENT_NODE)&&(!s||t(s,r))},isBlocked:function(t,e,r,i){if(!t)return!1;var n=mr(t);if(!n)return!1;try{if("string"==typeof e){if(n.classList.contains(e))return!0;if(i&&null!==n.closest("."+e))return!0}else if(ir(n,e,i))return!0}catch(t){}if(r){if(n.matches(r))return!0;if(i&&null!==n.closest(r))return!0}return!1},isIgnored:function(t,e,r){return!("TITLE"!==t.tagName||!r.headTitleMutations)||-2===e.getId(t)},isSerialized:function(t,e){return-1!==e.getId(t)},isSerializedIframe:function(t,e){return Boolean("IFRAME"===t.nodeName&&e.getMeta(t))},isSerializedStylesheet:function(t,e){return Boolean("LINK"===t.nodeName&&t.nodeType===t.ELEMENT_NODE&&t.getAttribute&&"stylesheet"===t.getAttribute("rel")&&e.getMeta(t))},iterateResolveTree:function t(e,r){r(e.value);for(var i=e.children.length-1;i>=0;i--)t(e.children[i],r)},legacy_isTouchEvent:function(t){return Boolean(t.changedTouches)},get nowTimestamp(){return gr},on:function(t,e,r){void 0===r&&(r=document);var i={capture:!0,passive:!0};return r.addEventListener(t,e,i),()=>r.removeEventListener(t,e,i)},patch:function(t,e,r){try{if(!(e in t))return()=>{};var i=t[e],n=r(i);return"function"==typeof n&&(n.prototype=n.prototype||{},Object.defineProperties(n,{__rrweb_original__:{enumerable:!1,value:i}})),t[e]=n,()=>{t[e]=i}}catch(t){return()=>{}}},polyfill:function(t){void 0===t&&(t=window),"NodeList"in t&&!t.NodeList.prototype.forEach&&(t.NodeList.prototype.forEach=Array.prototype.forEach),"DOMTokenList"in t&&!t.DOMTokenList.prototype.forEach&&(t.DOMTokenList.prototype.forEach=Array.prototype.forEach)},queueToResolveTrees:function(t){var e={},r=(t,r)=>{var i={value:t,parent:r,children:[]};return e[t.node.id]=i,i},i=[];for(var n of t){var{nextId:o,parentId:s}=n;if(o&&o in e){var a=e[o];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(s in e){var c=e[s];c.children.push(r(n,c))}else i.push(r(n,null))}return i},shadowHostInDom:wr,throttle:function(t,e,r){void 0===r&&(r={});var i=null,n=0;return function(){for(var o=arguments.length,s=new Array(o),a=0;a<o;a++)s[a]=arguments[a];var l=Date.now();n||!1!==r.leading||(n=l);var u=e-(l-n),c=this;u<=0||u>e?(i&&(clearTimeout(i),i=null),n=l,t.apply(c,s)):i||!1===r.trailing||(i=setTimeout((()=>{n=!1===r.leading?0:Date.now(),i=null,t.apply(c,s)}),u))}},uniqueTextMutations:function(t){for(var e=new Set,r=[],i=t.length;i--;){var n=t[i];e.has(n.id)||(r.push(n),e.add(n.id))}return r}},Symbol.toStringTag,{value:"Module"})),Cr="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",Ir="undefined"==typeof Uint8Array?[]:new Uint8Array(256),Sr=0;Sr<64;Sr++)Ir[Cr.charCodeAt(Sr)]=Sr;var kr;"undefined"!=typeof window&&window.Blob&&new Blob([(t=>Uint8Array.from(atob(t),(t=>t.charCodeAt(0))))("KGZ1bmN0aW9uKCkgewogICJ1c2Ugc3RyaWN0IjsKICB2YXIgY2hhcnMgPSAiQUJDREVGR0hJSktMTU5PUFFSU1RVVldYWVphYmNkZWZnaGlqa2xtbm9wcXJzdHV2d3h5ejAxMjM0NTY3ODkrLyI7CiAgdmFyIGxvb2t1cCA9IHR5cGVvZiBVaW50OEFycmF5ID09PSAidW5kZWZpbmVkIiA/IFtdIDogbmV3IFVpbnQ4QXJyYXkoMjU2KTsKICBmb3IgKHZhciBpID0gMDsgaSA8IGNoYXJzLmxlbmd0aDsgaSsrKSB7CiAgICBsb29rdXBbY2hhcnMuY2hhckNvZGVBdChpKV0gPSBpOwogIH0KICB2YXIgZW5jb2RlID0gZnVuY3Rpb24oYXJyYXlidWZmZXIpIHsKICAgIHZhciBieXRlcyA9IG5ldyBVaW50OEFycmF5KGFycmF5YnVmZmVyKSwgaTIsIGxlbiA9IGJ5dGVzLmxlbmd0aCwgYmFzZTY0ID0gIiI7CiAgICBmb3IgKGkyID0gMDsgaTIgPCBsZW47IGkyICs9IDMpIHsKICAgICAgYmFzZTY0ICs9IGNoYXJzW2J5dGVzW2kyXSA+PiAyXTsKICAgICAgYmFzZTY0ICs9IGNoYXJzWyhieXRlc1tpMl0gJiAzKSA8PCA0IHwgYnl0ZXNbaTIgKyAxXSA+PiA0XTsKICAgICAgYmFzZTY0ICs9IGNoYXJzWyhieXRlc1tpMiArIDFdICYgMTUpIDw8IDIgfCBieXRlc1tpMiArIDJdID4+IDZdOwogICAgICBiYXNlNjQgKz0gY2hhcnNbYnl0ZXNbaTIgKyAyXSAmIDYzXTsKICAgIH0KICAgIGlmIChsZW4gJSAzID09PSAyKSB7CiAgICAgIGJhc2U2NCA9IGJhc2U2NC5zdWJzdHJpbmcoMCwgYmFzZTY0Lmxlbmd0aCAtIDEpICsgIj0iOwogICAgfSBlbHNlIGlmIChsZW4gJSAzID09PSAxKSB7CiAgICAgIGJhc2U2NCA9IGJhc2U2NC5zdWJzdHJpbmcoMCwgYmFzZTY0Lmxlbmd0aCAtIDIpICsgIj09IjsKICAgIH0KICAgIHJldHVybiBiYXNlNjQ7CiAgfTsKICBjb25zdCBsYXN0QmxvYk1hcCA9IC8qIEBfX1BVUkVfXyAqLyBuZXcgTWFwKCk7CiAgY29uc3QgdHJhbnNwYXJlbnRCbG9iTWFwID0gLyogQF9fUFVSRV9fICovIG5ldyBNYXAoKTsKICBhc3luYyBmdW5jdGlvbiBnZXRUcmFuc3BhcmVudEJsb2JGb3Iod2lkdGgsIGhlaWdodCwgZGF0YVVSTE9wdGlvbnMpIHsKICAgIGNvbnN0IGlkID0gYCR7d2lkdGh9LSR7aGVpZ2h0fWA7CiAgICBpZiAoIk9mZnNjcmVlbkNhbnZhcyIgaW4gZ2xvYmFsVGhpcykgewogICAgICBpZiAodHJhbnNwYXJlbnRCbG9iTWFwLmhhcyhpZCkpIHJldHVybiB0cmFuc3BhcmVudEJsb2JNYXAuZ2V0KGlkKTsKICAgICAgY29uc3Qgb2Zmc2NyZWVuID0gbmV3IE9mZnNjcmVlbkNhbnZhcyh3aWR0aCwgaGVpZ2h0KTsKICAgICAgb2Zmc2NyZWVuLmdldENvbnRleHQoIjJkIik7CiAgICAgIGNvbnN0IGJsb2IgPSBhd2FpdCBvZmZzY3JlZW4uY29udmVydFRvQmxvYihkYXRhVVJMT3B0aW9ucyk7CiAgICAgIGNvbnN0IGFycmF5QnVmZmVyID0gYXdhaXQgYmxvYi5hcnJheUJ1ZmZlcigpOwogICAgICBjb25zdCBiYXNlNjQgPSBlbmNvZGUoYXJyYXlCdWZmZXIpOwogICAgICB0cmFuc3BhcmVudEJsb2JNYXAuc2V0KGlkLCBiYXNlNjQpOwogICAgICByZXR1cm4gYmFzZTY0OwogICAgfSBlbHNlIHsKICAgICAgcmV0dXJuICIiOwogICAgfQogIH0KICBjb25zdCB3b3JrZXIgPSBzZWxmOwogIHdvcmtlci5vbm1lc3NhZ2UgPSBhc3luYyBmdW5jdGlvbihlKSB7CiAgICBpZiAoIk9mZnNjcmVlbkNhbnZhcyIgaW4gZ2xvYmFsVGhpcykgewogICAgICBjb25zdCB7IGlkLCBiaXRtYXAsIHdpZHRoLCBoZWlnaHQsIGRhdGFVUkxPcHRpb25zIH0gPSBlLmRhdGE7CiAgICAgIGNvbnN0IHRyYW5zcGFyZW50QmFzZTY0ID0gZ2V0VHJhbnNwYXJlbnRCbG9iRm9yKAogICAgICAgIHdpZHRoLAogICAgICAgIGhlaWdodCwKICAgICAgICBkYXRhVVJMT3B0aW9ucwogICAgICApOwogICAgICBjb25zdCBvZmZzY3JlZW4gPSBuZXcgT2Zmc2NyZWVuQ2FudmFzKHdpZHRoLCBoZWlnaHQpOwogICAgICBjb25zdCBjdHggPSBvZmZzY3JlZW4uZ2V0Q29udGV4dCgiMmQiKTsKICAgICAgY3R4LmRyYXdJbWFnZShiaXRtYXAsIDAsIDApOwogICAgICBiaXRtYXAuY2xvc2UoKTsKICAgICAgY29uc3QgYmxvYiA9IGF3YWl0IG9mZnNjcmVlbi5jb252ZXJ0VG9CbG9iKGRhdGFVUkxPcHRpb25zKTsKICAgICAgY29uc3QgdHlwZSA9IGJsb2IudHlwZTsKICAgICAgY29uc3QgYXJyYXlCdWZmZXIgPSBhd2FpdCBibG9iLmFycmF5QnVmZmVyKCk7CiAgICAgIGNvbnN0IGJhc2U2NCA9IGVuY29kZShhcnJheUJ1ZmZlcik7CiAgICAgIGlmICghbGFzdEJsb2JNYXAuaGFzKGlkKSAmJiBhd2FpdCB0cmFuc3BhcmVudEJhc2U2NCA9PT0gYmFzZTY0KSB7CiAgICAgICAgbGFzdEJsb2JNYXAuc2V0KGlkLCBiYXNlNjQpOwogICAgICAgIHJldHVybiB3b3JrZXIucG9zdE1lc3NhZ2UoeyBpZCB9KTsKICAgICAgfQogICAgICBpZiAobGFzdEJsb2JNYXAuZ2V0KGlkKSA9PT0gYmFzZTY0KSByZXR1cm4gd29ya2VyLnBvc3RNZXNzYWdlKHsgaWQgfSk7CiAgICAgIHdvcmtlci5wb3N0TWVzc2FnZSh7CiAgICAgICAgaWQsCiAgICAgICAgdHlwZSwKICAgICAgICBiYXNlNjQsCiAgICAgICAgd2lkdGgsCiAgICAgICAgaGVpZ2h0CiAgICAgIH0pOwogICAgICBsYXN0QmxvYk1hcC5zZXQoaWQsIGJhc2U2NCk7CiAgICB9IGVsc2UgewogICAgICByZXR1cm4gd29ya2VyLnBvc3RNZXNzYWdlKHsgaWQ6IGUuZGF0YS5pZCB9KTsKICAgIH0KICB9Owp9KSgpOwovLyMgc291cmNlTWFwcGluZ1VSTD1pbWFnZS1iaXRtYXAtZGF0YS11cmwtd29ya2VyLUlKcEM3Z19iLmpzLm1hcAo=")],{type:"text/javascript;charset=utf-8"});try{if(2!==Array.from([1],(t=>2*t))[0]){var xr=document.createElement("iframe");document.body.appendChild(xr),Array.from=(null==($e=xr.contentWindow)?void 0:$e.Array.from)||Array.from,document.body.removeChild(xr)}}catch(t){console.debug("Unable to override Array.from",t)}new rr,function(t){t[t.NotStarted=0]="NotStarted",t[t.Running=1]="Running",t[t.Stopped=2]="Stopped"}(kr||(kr={}));class Ar{constructor(t){He(this,"fileName"),He(this,"functionName"),He(this,"lineNumber"),He(this,"columnNumber"),this.fileName=t.fileName||"",this.functionName=t.functionName||"",this.lineNumber=t.lineNumber,this.columnNumber=t.columnNumber}toString(){var t=this.lineNumber||"",e=this.columnNumber||"";return this.functionName?this.functionName+" ("+this.fileName+":"+t+":"+e+")":this.fileName+":"+t+":"+e}}var Tr=/(^|@)\S+:\d+/,Mr=/^\s*at .*(\S+:\d+|\(native\))/m,Er=/^(eval@)?(\[native code])?$/,Nr={parse:function(t){return t?void 0!==t.stacktrace||void 0!==t["opera#sourceloc"]?this.parseOpera(t):t.stack&&t.stack.match(Mr)?this.parseV8OrIE(t):t.stack?this.parseFFOrSafari(t):(console.warn("[console-record-plugin]: Failed to parse error object:",t),[]):[]},extractLocation:function(t){if(-1===t.indexOf(":"))return[t];var e=/(.+?)(?::(\d+))?(?::(\d+))?$/.exec(t.replace(/[()]/g,""));if(!e)throw new Error("Cannot parse given url: "+t);return[e[1],e[2]||void 0,e[3]||void 0]},parseV8OrIE:function(t){return t.stack.split("\n").filter((function(t){return!!t.match(Mr)}),this).map((function(t){t.indexOf("(eval ")>-1&&(t=t.replace(/eval code/g,"eval").replace(/(\(eval at [^()]*)|(\),.*$)/g,""));var e=t.replace(/^\s+/,"").replace(/\(eval code/g,"("),r=e.match(/ (\((.+):(\d+):(\d+)\)$)/),i=(e=r?e.replace(r[0],""):e).split(/\s+/).slice(1),n=this.extractLocation(r?r[1]:i.pop()),o=i.join(" ")||void 0,s=["eval","<anonymous>"].indexOf(n[0])>-1?void 0:n[0];return new Ar({functionName:o,fileName:s,lineNumber:n[1],columnNumber:n[2]})}),this)},parseFFOrSafari:function(t){return t.stack.split("\n").filter((function(t){return!t.match(Er)}),this).map((function(t){if(t.indexOf(" > eval")>-1&&(t=t.replace(/ line (\d+)(?: > eval line \d+)* > eval:\d+:\d+/g,":$1")),-1===t.indexOf("@")&&-1===t.indexOf(":"))return new Ar({functionName:t});var e=/((.*".+"[^@]*)?[^@]*)(?:@)/,r=t.match(e),i=r&&r[1]?r[1]:void 0,n=this.extractLocation(t.replace(e,""));return new Ar({functionName:i,fileName:n[0],lineNumber:n[1],columnNumber:n[2]})}),this)},parseOpera:function(t){return!t.stacktrace||t.message.indexOf("\n")>-1&&t.message.split("\n").length>t.stacktrace.split("\n").length?this.parseOpera9(t):t.stack?this.parseOpera11(t):this.parseOpera10(t)},parseOpera9:function(t){for(var e=/Line (\d+).*script (?:in )?(\S+)/i,r=t.message.split("\n"),i=[],n=2,o=r.length;n<o;n+=2){var s=e.exec(r[n]);s&&i.push(new Ar({fileName:s[2],lineNumber:parseFloat(s[1])}))}return i},parseOpera10:function(t){for(var e=/Line (\d+).*script (?:in )?(\S+)(?:: In function (\S+))?$/i,r=t.stacktrace.split("\n"),i=[],n=0,o=r.length;n<o;n+=2){var s=e.exec(r[n]);s&&i.push(new Ar({functionName:s[3]||void 0,fileName:s[2],lineNumber:parseFloat(s[1])}))}return i},parseOpera11:function(t){return t.stack.split("\n").filter((function(t){return!!t.match(Tr)&&!t.match(/^Error created at/)}),this).map((function(t){var e=t.split("@"),r=this.extractLocation(e.pop()),i=(e.shift()||"").replace(/<anonymous function(: (\w+))?>/,"$2").replace(/\([^)]*\)/g,"")||void 0;return new Ar({functionName:i,fileName:r[0],lineNumber:r[1],columnNumber:r[2]})}),this)}};function Rr(t){if(!t||!t.outerHTML)return"";for(var e="";t.parentElement;){var r=t.localName;if(!r)break;r=r.toLowerCase();var i=t.parentElement,n=[];if(i.children&&i.children.length>0)for(var o=0;o<i.children.length;o++){var s=i.children[o];s.localName&&s.localName.toLowerCase&&s.localName.toLowerCase()===r&&n.push(s)}n.length>1&&(r+=":eq("+n.indexOf(t)+")"),e=r+(e?">"+e:""),t=i}return e}function Fr(t){return"[object Object]"===Object.prototype.toString.call(t)}function Or(t,e){if(0===e)return!0;var r=Object.keys(t);for(var i of r)if(Fr(t[i])&&Or(t[i],e-1))return!0;return!1}function Pr(t,e){var r={numOfKeysLimit:50,depthOfLimit:4};Object.assign(r,e);var i=[],n=[];return JSON.stringify(t,(function(t,e){if(i.length>0){var o=i.indexOf(this);~o?i.splice(o+1):i.push(this),~o?n.splice(o,1/0,t):n.push(t),~i.indexOf(e)&&(e=i[0]===e?"[Circular ~]":"[Circular ~."+n.slice(0,i.indexOf(e)).join(".")+"]")}else i.push(e);if(null===e)return e;if(void 0===e)return"undefined";if(function(t){if(Fr(t)&&Object.keys(t).length>r.numOfKeysLimit)return!0;if("function"==typeof t)return!0;if(Fr(t)&&Or(t,r.depthOfLimit))return!0;return!1}(e))return function(t){var e=t.toString();r.stringLengthLimit&&e.length>r.stringLengthLimit&&(e=e.slice(0,r.stringLengthLimit)+"...");return e}(e);if("bigint"==typeof e)return e.toString()+"n";if(e instanceof Event){var s={};for(var a in e){var l=e[a];Array.isArray(l)?s[a]=Rr(l.length?l[0]:null):s[a]=l}return s}return e instanceof Node?e instanceof HTMLElement?e?e.outerHTML:"":e.nodeName:e instanceof Error?e.stack?e.stack+"\nEnd of stack for Error object":e.name+": "+e.message:e}))}var Lr={level:["assert","clear","count","countReset","debug","dir","dirxml","error","group","groupCollapsed","groupEnd","info","log","table","time","timeEnd","timeLog","trace","warn"],lengthThreshold:1e3,logger:"console"};function Dr(t,e,r){var i,n=r?Object.assign({},Lr,r):Lr,o=n.logger;if(!o)return()=>{};i="string"==typeof o?e[o]:o;var s=0,a=!1,l=[];if(n.level.includes("error")){var u=e=>{var r=e.message,i=e.error,o=Nr.parse(i).map((t=>t.toString())),s=[Pr(r,n.stringifyOptions)];t({level:"error",trace:o,payload:s})};e.addEventListener("error",u),l.push((()=>{e.removeEventListener("error",u)}));var c=e=>{var r,i;e.reason instanceof Error?i=[Pr("Uncaught (in promise) "+(r=e.reason).name+": "+r.message,n.stringifyOptions)]:(r=new Error,i=[Pr("Uncaught (in promise)",n.stringifyOptions),Pr(e.reason,n.stringifyOptions)]);var o=Nr.parse(r).map((t=>t.toString()));t({level:"error",trace:o,payload:i})};e.addEventListener("unhandledrejection",c),l.push((()=>{e.removeEventListener("unhandledrejection",c)}))}for(var h of n.level)l.push(d(i,h));return()=>{l.forEach((t=>t()))};function d(e,r){var i=this;return e[r]?_r.patch(e,r,(e=>function(){for(var o=arguments.length,l=new Array(o),u=0;u<o;u++)l[u]=arguments[u];if(e.apply(i,l),!("assert"===r&&l[0]||a)){a=!0;try{var c=Nr.parse(new Error).map((t=>t.toString())).splice(1),h=("assert"===r?l.slice(1):l).map((t=>Pr(t,n.stringifyOptions)));++s<n.lengthThreshold?t({level:r,trace:c,payload:h}):s===n.lengthThreshold&&t({level:"warn",trace:[],payload:[Pr("The number of log records reached the threshold.")]})}catch(t){e("rrweb logger error:",t,...l)}finally{a=!1}}})):()=>{}}}var Br=t=>({name:"rrweb/console@1",observer:Dr,options:t}),Zr=["$snapshot","$pageview","$pageleave","$set","survey dismissed","survey sent","survey shown","$identify","$groupidentify","$create_alias","$$client_ingestion_warning","$web_experiment_applied","$feature_enrollment_update","$feature_flag_called"];function $r(t,e){return-1!==t.indexOf(e)}var qr=function(t){return t.trim()},Hr=function(t){return t.replace(/^\$/,"")};var Vr=Array.isArray,jr=Object.prototype,Yr=jr.hasOwnProperty,Gr=jr.toString,Wr=Vr||function(t){return"[object Array]"===Gr.call(t)},zr=t=>"function"==typeof t,Ur=t=>zr(t)&&-1!==t.toString().indexOf("[native code]"),Xr=t=>t===Object(t)&&!Wr(t),Jr=t=>{if(Xr(t)){for(var e in t)if(Yr.call(t,e))return!1;return!0}return!1},Kr=t=>void 0===t,Qr=t=>"[object String]"==Gr.call(t),ti=t=>Qr(t)&&0===t.trim().length,ei=t=>null===t,ri=t=>Kr(t)||ei(t),ii=t=>"[object Number]"==Gr.call(t),ni=t=>"[object Boolean]"===Gr.call(t),oi=t=>t instanceof FormData,si=t=>$r(Zr,t);function ai(t){return null===t||"object"!=typeof t}function li(t,e){return Object.prototype.toString.call(t)==="[object "+e+"]"}function ui(t){return!Kr(Event)&&function(t,e){try{return t instanceof e}catch(t){return!1}}(t,Event)}var ci=[!0,"true",1,"1","yes"],hi=t=>$r(ci,t),di=[!1,"false",0,"0","no"];function vi(t,e,r,i,n){return e>r&&(i.warn("min cannot be greater than max."),e=r),ii(t)?t>r?(i.warn(" cannot be greater than max: "+r+". Using max value instead."),r):t<e?(i.warn(" cannot be less than min: "+e+". Using min value instead."),e):t:(i.warn(" must be a number. using max or fallback. max: "+r+", fallback: "+n),vi(n||r,e,r,i))}class fi{constructor(t){this.o=t,this.h={},this.m=()=>{Object.keys(this.h).forEach((t=>{var e=this.C(t)+this.I;e>=this.S?delete this.h[t]:this.k(t,e)}))},this.C=t=>this.h[String(t)],this.k=(t,e)=>{this.h[String(t)]=e},this.consumeRateLimit=t=>{var e,r,i=null!==(e=this.C(t))&&void 0!==e?e:this.S;if(0===(i=Math.max(i-1,0)))return!0;this.k(t,i);var n=0===i;return n&&(null==(r=this.A)||r.call(this,t)),n},this.A=this.o.A,this.S=vi(this.o.bucketSize,0,100,this.o.T),this.I=vi(this.o.refillRate,0,this.S,this.o.T),this.M=vi(this.o.refillInterval,0,864e5,this.o.T),this.N=setInterval((()=>{this.m()}),this.M)}stop(){this.N&&(clearInterval(this.N),this.N=void 0)}}var pi,gi,mi,yi=t=>t instanceof Error;function bi(t){var e=globalThis._posthogChunkIds;if(e){var r=Object.keys(e);return mi&&r.length===gi||(gi=r.length,mi=r.reduce(((r,i)=>{pi||(pi={});var n=pi[i];if(n)r[n[0]]=n[1];else for(var o=t(i),s=o.length-1;s>=0;s--){var a=o[s],l=null==a?void 0:a.filename,u=e[i];if(l&&u){r[l]=u,pi[i]=[l,u];break}}return r}),{})),mi}}var wi="?";function _i(t,e,r,i){var n={platform:"web:javascript",filename:t,function:"<anonymous>"===e?wi:e,in_app:!0};return Kr(r)||(n.lineno=r),Kr(i)||(n.colno=i),n}var Ci=(t,e)=>{var r=-1!==t.indexOf("safari-extension"),i=-1!==t.indexOf("safari-web-extension");return r||i?[-1!==t.indexOf("@")?t.split("@")[0]:wi,r?"safari-extension:"+e:"safari-web-extension:"+e]:[t,e]},Ii=/^\s*at (\S+?)(?::(\d+))(?::(\d+))\s*$/i,Si=/^\s*at (?:(.+?\)(?: \[.+\])?|.*?) ?\((?:address at )?)?(?:async )?((?:<anonymous>|[-a-z]+:|.*bundle|\/)?.*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i,ki=/\((\S*)(?::(\d+))(?::(\d+))\)/,xi=t=>{var e=Ii.exec(t);if(e){var[,r,i,n]=e;return _i(r,wi,+i,+n)}var o=Si.exec(t);if(o){if(o[2]&&0===o[2].indexOf("eval")){var s=ki.exec(o[2]);s&&(o[2]=s[1],o[3]=s[2],o[4]=s[3])}var[a,l]=Ci(o[1]||wi,o[2]);return _i(l,a,o[3]?+o[3]:void 0,o[4]?+o[4]:void 0)}},Ai=/^\s*(.*?)(?:\((.*?)\))?(?:^|@)?((?:[-a-z]+)?:\/.*?|\[native code\]|[^@]*(?:bundle|\d+\.js)|\/[\w\-. /=]+)(?::(\d+))?(?::(\d+))?\s*$/i,Ti=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i,Mi=t=>{var e=Ai.exec(t);if(e){if(e[3]&&e[3].indexOf(" > eval")>-1){var r=Ti.exec(e[3]);r&&(e[1]=e[1]||"eval",e[3]=r[1],e[4]=r[2],e[5]="")}var i=e[3],n=e[1]||wi;return[n,i]=Ci(n,i),_i(i,n,e[4]?+e[4]:void 0,e[5]?+e[5]:void 0)}},Ei=/\(error: (.*)\)/,Ni=50;function Ri(){for(var t=arguments.length,e=new Array(t),i=0;i<t;i++)e[i]=arguments[i];return function(t,i){void 0===i&&(i=0);for(var n=[],o=t.split("\n"),s=i;s<o.length;s++){var a=o[s];if(!(a.length>1024)){var l=Ei.test(a)?a.replace(Ei,"$1"):a;if(!l.match(/\S*Error: /)){for(var u of e){var c=u(l);if(c){n.push(c);break}}if(n.length>=Ni)break}}}return function(t){if(!t.length)return[];var e=Array.from(t);return e.reverse(),e.slice(0,Ni).map((t=>{return r({},t,{filename:t.filename||(i=e,i[i.length-1]||{}).filename,function:t.function||wi});var i}))}(n)}}class Fi{constructor(t,e,r){void 0===t&&(t=[]),void 0===e&&(e=[]),void 0===r&&(r=[]),this.coercers=t,this.modifiers=r,this.stackParser=Ri(...e)}buildFromUnknown(t,e){void 0===e&&(e={});var r=e&&e.mechanism||{handled:!0,type:"generic"},i=this.buildCoercingContext(r,e,0).apply(t),n=this.buildParsingContext(),o=this.parseStacktrace(i,n);return{$exception_list:this.convertToExceptionList(o,r),$exception_level:"error"}}modifyFrames(t){var r=this;return e((function*(){for(var e of t)e.stacktrace&&e.stacktrace.frames&&Wr(e.stacktrace.frames)&&(e.stacktrace.frames=yield r.applyModifiers(e.stacktrace.frames));return t}))()}coerceFallback(t){var e;return{type:"Error",value:"Unknown error",stack:null==(e=t.syntheticException)?void 0:e.stack,synthetic:!0}}parseStacktrace(t,e){var i,n;return null!=t.cause&&(i=this.parseStacktrace(t.cause,e)),""!=t.stack&&null!=t.stack&&(n=this.applyChunkIds(this.stackParser(t.stack,t.synthetic?1:0),e.chunkIdMap)),r({},t,{cause:i,stack:n})}applyChunkIds(t,e){return t.map((t=>(t.filename&&e&&(t.chunk_id=e[t.filename]),t)))}applyCoercers(t,e){for(var r of this.coercers)if(r.match(t))return r.coerce(t,e);return this.coerceFallback(e)}applyModifiers(t){var r=this;return e((function*(){var e=t;for(var i of r.modifiers)e=yield i(e);return e}))()}convertToExceptionList(t,e){var i,n,o,s={type:t.type,value:t.value,mechanism:{type:null!==(i=e.type)&&void 0!==i?i:"generic",handled:null===(n=e.handled)||void 0===n||n,synthetic:null!==(o=t.synthetic)&&void 0!==o&&o}};t.stack&&(s.stacktrace={type:"raw",frames:t.stack});var a=[s];return null!=t.cause&&a.push(...this.convertToExceptionList(t.cause,r({},e,{handled:!0}))),a}buildParsingContext(){return{chunkIdMap:bi(this.stackParser)}}buildCoercingContext(t,e,i){void 0===i&&(i=0);var n=(r,i)=>{if(i<=4){var n=this.buildCoercingContext(t,e,i);return this.applyCoercers(r,n)}};return r({},e,{syntheticException:0==i?e.syntheticException:void 0,mechanism:t,apply:t=>n(t,i),next:t=>n(t,i+1)})}}class Oi{match(t){return this.isDOMException(t)||this.isDOMError(t)}coerce(t,e){var r=Qr(t.stack);return{type:this.getType(t),value:this.getValue(t),stack:r?t.stack:void 0,cause:t.cause?e.next(t.cause):void 0,synthetic:!1}}getType(t){return this.isDOMError(t)?"DOMError":"DOMException"}getValue(t){var e=t.name||(this.isDOMError(t)?"DOMError":"DOMException");return t.message?e+": "+t.message:e}isDOMException(t){return li(t,"DOMException")}isDOMError(t){return li(t,"DOMError")}}class Pi{match(t){return(t=>t instanceof Error)(t)}coerce(t,e){return{type:this.getType(t),value:this.getMessage(t,e),stack:this.getStack(t),cause:t.cause?e.next(t.cause):void 0,synthetic:!1}}getType(t){return t.name||t.constructor.name}getMessage(t,e){var r=t.message;return r.error&&"string"==typeof r.error.message?String(r.error.message):String(r)}getStack(t){return t.stacktrace||t.stack||void 0}}class Li{constructor(){}match(t){return li(t,"ErrorEvent")&&null!=t.error}coerce(t,e){var r,i=e.apply(t.error);return i||{type:"ErrorEvent",value:t.message,stack:null==(r=e.syntheticException)?void 0:r.stack,synthetic:!0}}}var Di=/^(?:[Uu]ncaught (?:exception: )?)?(?:((?:Eval|Internal|Range|Reference|Syntax|Type|URI|)Error): )?(.*)$/i;class Bi{match(t){return"string"==typeof t}coerce(t,e){var r,[i,n]=this.getInfos(t);return{type:null!=i?i:"Error",value:null!=n?n:t,stack:null==(r=e.syntheticException)?void 0:r.stack,synthetic:!0}}getInfos(t){var e="Error",r=t,i=t.match(Di);return i&&(e=i[1],r=i[2]),[e,r]}}var Zi=["fatal","error","warning","log","info","debug"];function $i(t,e){void 0===e&&(e=40);var r=Object.keys(t);if(r.sort(),!r.length)return"[object has no keys]";for(var i=r.length;i>0;i--){var n=r.slice(0,i).join(", ");if(!(n.length>e))return i===r.length||n.length<=e?n:n.slice(0,e)+"..."}return""}class qi{match(t){return"object"==typeof t&&null!==t}coerce(t,e){var r,i=this.getErrorPropertyFromObject(t);return i?e.apply(i):{type:this.getType(t),value:this.getValue(t),stack:null==(r=e.syntheticException)?void 0:r.stack,level:this.isSeverityLevel(t.level)?t.level:"error",synthetic:!0}}getType(t){return ui(t)?t.constructor.name:"Error"}getValue(t){if("name"in t&&"string"==typeof t.name){var e="'"+t.name+"' captured as exception";return"message"in t&&"string"==typeof t.message&&(e+=" with message: '"+t.message+"'"),e}if("message"in t&&"string"==typeof t.message)return t.message;var r=this.getObjectClassName(t);return(r&&"Object"!==r?"'"+r+"'":"Object")+" captured as exception with keys: "+$i(t)}isSeverityLevel(t){return Qr(t)&&!ti(t)&&Zi.indexOf(t)>=0}getErrorPropertyFromObject(t){for(var e in t)if(Object.prototype.hasOwnProperty.call(t,e)){var r=t[e];if(yi(r))return r}}getObjectClassName(t){try{var e=Object.getPrototypeOf(t);return e?e.constructor.name:void 0}catch(t){return}}}class Hi{match(t){return ui(t)}coerce(t,e){var r,i=t.constructor.name;return{type:i,value:i+" captured as exception with keys: "+$i(t),stack:null==(r=e.syntheticException)?void 0:r.stack,synthetic:!0}}}class Vi{match(t){return ai(t)}coerce(t,e){var r;return{type:"Error",value:"Primitive value captured as exception: "+String(t),stack:null==(r=e.syntheticException)?void 0:r.stack,synthetic:!0}}}class ji{match(t){return li(t,"PromiseRejectionEvent")}coerce(t,e){var r,i=this.getUnhandledRejectionReason(t);return ai(i)?{type:"UnhandledRejection",value:"Non-Error promise rejection captured with value: "+String(i),stack:null==(r=e.syntheticException)?void 0:r.stack,synthetic:!0}:e.apply(i)}getUnhandledRejectionReason(t){if(ai(t))return t;try{if("reason"in t)return t.reason;if("detail"in t&&"reason"in t.detail)return t.detail.reason}catch(t){}return t}}var Yi="undefined"!=typeof window?window:void 0,Gi="undefined"!=typeof globalThis?globalThis:Yi,Wi=Array.prototype,zi=Wi.forEach,Ui=Wi.indexOf,Xi=null==Gi?void 0:Gi.navigator,Ji=null==Gi?void 0:Gi.document,Ki=null==Gi?void 0:Gi.location,Qi=null==Gi?void 0:Gi.fetch,tn=null!=Gi&&Gi.XMLHttpRequest&&"withCredentials"in new Gi.XMLHttpRequest?Gi.XMLHttpRequest:void 0,en=null==Gi?void 0:Gi.AbortController,rn=null==Xi?void 0:Xi.userAgent,nn=null!=Yi?Yi:{},on=()=>!!Yi.Zone,sn=t=>t instanceof Document,an={DEBUG:!1,LIB_VERSION:"1.274.2"},ln=t=>{var e={R:function(e){if(Yi&&(an.DEBUG||nn.POSTHOG_DEBUG)&&!Kr(Yi.console)&&Yi.console){for(var r=("__rrweb_original__"in Yi.console[e]?Yi.console[e].__rrweb_original__:Yi.console[e]),i=arguments.length,n=new Array(i>1?i-1:0),o=1;o<i;o++)n[o-1]=arguments[o];r(t,...n)}},info:function(){for(var t=arguments.length,r=new Array(t),i=0;i<t;i++)r[i]=arguments[i];e.R("log",...r)},warn:function(){for(var t=arguments.length,r=new Array(t),i=0;i<t;i++)r[i]=arguments[i];e.R("warn",...r)},error:function(){for(var t=arguments.length,r=new Array(t),i=0;i<t;i++)r[i]=arguments[i];e.R("error",...r)},critical:function(){for(var e=arguments.length,r=new Array(e),i=0;i<e;i++)r[i]=arguments[i];console.error(t,...r)},uninitializedWarning:t=>{e.error("You must initialize PostHog before calling "+t)},createLogger:e=>ln(t+" "+e)};return e},un=ln("[PostHog.js]"),cn=un.createLogger,hn={};function dn(t,e,r){if(Wr(t))if(zi&&t.forEach===zi)t.forEach(e,r);else if("length"in t&&t.length===+t.length)for(var i=0,n=t.length;i<n;i++)if(i in t&&e.call(r,t[i],i)===hn)return}function vn(t,e,r){if(!ri(t)){if(Wr(t))return dn(t,e,r);if(oi(t)){for(var i of t.entries())if(e.call(r,i[1],i[0])===hn)return}else for(var n in t)if(Yr.call(t,n)&&e.call(r,t[n],n)===hn)return}}var fn=function(t){for(var e=arguments.length,r=new Array(e>1?e-1:0),i=1;i<e;i++)r[i-1]=arguments[i];return dn(r,(function(e){for(var r in e)void 0!==e[r]&&(t[r]=e[r])})),t},pn=function(t){for(var e=arguments.length,r=new Array(e>1?e-1:0),i=1;i<e;i++)r[i-1]=arguments[i];return dn(r,(function(e){dn(e,(function(e){t.push(e)}))})),t};function gn(t){for(var e=Object.keys(t),r=e.length,i=new Array(r);r--;)i[r]=[e[r],t[e[r]]];return i}var mn=function(t){try{return t()}catch(t){return}},yn=function(t){return function(){try{for(var e=arguments.length,r=new Array(e),i=0;i<e;i++)r[i]=arguments[i];return t.apply(this,r)}catch(t){un.critical("Implementation error. Please turn on debug mode and open a ticket on https://app.posthog.com/home#panel=support%3Asupport%3A."),un.critical(t)}}},bn=function(t){var e={};return vn(t,(function(t,r){(Qr(t)&&t.length>0||ii(t))&&(e[r]=t)})),e};function wn(t,e){return r=t,i=t=>Qr(t)&&!ei(e)?t.slice(0,e):t,n=new Set,function t(e,r){return e!==Object(e)?i?i(e,r):e:n.has(e)?void 0:(n.add(e),Wr(e)?(o=[],dn(e,(e=>{o.push(t(e))}))):(o={},vn(e,((e,r)=>{n.has(e)||(o[r]=t(e,r))}))),o);var o}(r);var r,i,n}var _n=["herokuapp.com","vercel.app","netlify.app"];function Cn(t){var e=null==t?void 0:t.hostname;if(!Qr(e))return!1;var r=e.split(".").slice(-2).join(".");for(var i of _n)if(r===i)return!1;return!0}function In(t,e){for(var r=0;r<t.length;r++)if(e(t[r]))return t[r]}function Sn(t,e,r,i){var{capture:n=!1,passive:o=!0}=null!=i?i:{};null==t||t.addEventListener(e,r,{capture:n,passive:o})}var kn=t=>{var e=null==Ji?void 0:Ji.createElement("a");return Kr(e)?null:(e.href=t,e)},xn=function(t,e){var r,i;void 0===e&&(e="&");var n=[];return vn(t,(function(t,e){Kr(t)||Kr(e)||"undefined"===e||(r=encodeURIComponent((t=>t instanceof File)(t)?t.name:t.toString()),i=encodeURIComponent(e),n[n.length]=i+"="+r)})),n.join(e)},An=function(t,e){for(var r,i=((t.split("#")[0]||"").split(/\?(.*)/)[1]||"").replace(/^\?+/g,"").split("&"),n=0;n<i.length;n++){var o=i[n].split("=");if(o[0]===e){r=o;break}}if(!Wr(r)||r.length<2)return"";var s=r[1];try{s=decodeURIComponent(s)}catch(t){un.error("Skipping decoding for malformed query param: "+s)}return s.replace(/\+/g," ")},Tn=function(t,e,r){if(!t||!e||!e.length)return t;for(var i=t.split("#"),n=i[0]||"",o=i[1],s=n.split("?"),a=s[1],l=s[0],u=(a||"").split("&"),c=[],h=0;h<u.length;h++){var d=u[h].split("=");Wr(d)&&(e.includes(d[0])?c.push(d[0]+"="+r):c.push(u[h]))}var v=l;return null!=a&&(v+="?"+c.join("&")),null!=o&&(v+="#"+o),v},Mn=function(t,e){var r=t.match(new RegExp(e+"=([^&]*)"));return r?r[1]:null};function En(t,e,r){try{if(!(e in t))return()=>{};var i=t[e],n=r(i);return zr(n)&&(n.prototype=n.prototype||{},Object.defineProperties(n,{__posthog_wrapped__:{enumerable:!1,value:!0}})),t[e]=n,()=>{t[e]=i}}catch(t){return()=>{}}}function Nn(t,e){var r,i=function(t){try{return"string"==typeof t?new URL(t).hostname:"url"in t?new URL(t.url).hostname:t.hostname}catch(t){return null}}(t),n={hostname:i,isHostDenied:!1};if(null==(r=e.payloadHostDenyList)||!r.length||null==i||!i.trim().length)return n;for(var o of e.payloadHostDenyList)if(i.endsWith(o))return{hostname:i,isHostDenied:!0};return n}var Rn="$people_distinct_id",Fn="__alias",On="__timers",Pn="$autocapture_disabled_server_side",Ln="$heatmaps_enabled_server_side",Dn="$exception_capture_enabled_server_side",Bn="$error_tracking_suppression_rules",Zn="$error_tracking_capture_extension_exceptions",$n="$web_vitals_enabled_server_side",qn="$dead_clicks_enabled_server_side",Hn="$web_vitals_allowed_metrics",Vn="$session_recording_remote_config",jn="$sesid",Yn="$session_is_sampled",Gn="$enabled_feature_flags",Wn="$early_access_features",zn="$feature_flag_details",Un="$stored_person_properties",Xn="$stored_group_properties",Jn="$surveys",Kn="$surveys_activated",Qn="$flag_call_reported",to="$user_state",eo="$client_session_props",ro="$capture_rate_limit",io="$initial_campaign_params",no="$initial_referrer_info",oo="$initial_person_info",so="$epp",ao="__POSTHOG_TOOLBAR__",lo="$posthog_cookieless",uo=[Rn,Fn,"__cmpns",On,"$session_recording_enabled_server_side",Ln,jn,Gn,Bn,to,Wn,zn,Xn,Un,Jn,Qn,eo,ro,io,no,so,oo];function co(t){return t instanceof Element&&(t.id===ao||!(null==t.closest||!t.closest(".toolbar-global-fade-container")))}function ho(t){return!!t&&1===t.nodeType}function vo(t,e){return!!t&&!!t.tagName&&t.tagName.toLowerCase()===e.toLowerCase()}function fo(t){return!!t&&3===t.nodeType}function po(t){return!!t&&11===t.nodeType}function go(t){return t?qr(t).split(/\s+/):[]}function mo(t){var e=null==Yi?void 0:Yi.location.href;return!!(e&&t&&t.some((t=>e.match(t))))}function yo(t){var e="";switch(typeof t.className){case"string":e=t.className;break;case"object":e=(t.className&&"baseVal"in t.className?t.className.baseVal:null)||t.getAttribute("class")||"";break;default:e=""}return go(e)}function bo(t){return ri(t)?null:qr(t).split(/(\s+)/).filter((t=>Do(t))).join("").replace(/[\r\n]/g," ").replace(/[ ]+/g," ").substring(0,255)}function wo(t){var e="";return Mo(t)&&!Eo(t)&&t.childNodes&&t.childNodes.length&&vn(t.childNodes,(function(t){var r;fo(t)&&t.textContent&&(e+=null!==(r=bo(t.textContent))&&void 0!==r?r:"")})),qr(e)}function _o(t){return Kr(t.target)?t.srcElement||null:null!=(e=t.target)&&e.shadowRoot?t.composedPath()[0]||null:t.target||null;var e}var Co=["a","button","form","input","select","textarea","label"];function Io(t,e){if(Kr(e))return!0;var r,i=function(t){if(e.some((e=>t.matches(e))))return{v:!0}};for(var n of t)if(r=i(n))return r.v;return!1}function So(t){var e=t.parentNode;return!(!e||!ho(e))&&e}var ko=[".ph-no-rageclick",".ph-no-capture"];var xo=t=>!t||vo(t,"html")||!ho(t),Ao=(t,e)=>{if(!Yi||xo(t))return{parentIsUsefulElement:!1,targetElementList:[]};for(var r=!1,i=[t],n=t;n.parentNode&&!vo(n,"body");)if(po(n.parentNode))i.push(n.parentNode.host),n=n.parentNode.host;else{var o=So(n);if(!o)break;if(e||Co.indexOf(o.tagName.toLowerCase())>-1)r=!0;else{var s=Yi.getComputedStyle(o);s&&"pointer"===s.getPropertyValue("cursor")&&(r=!0)}i.push(o),n=o}return{parentIsUsefulElement:r,targetElementList:i}};function To(t,e,r,i,n){var o,s,a,l;if(void 0===r&&(r=void 0),!Yi||xo(t))return!1;if(null!=(o=r)&&o.url_allowlist&&!mo(r.url_allowlist))return!1;if(null!=(s=r)&&s.url_ignorelist&&mo(r.url_ignorelist))return!1;if(null!=(a=r)&&a.dom_event_allowlist){var u=r.dom_event_allowlist;if(u&&!u.some((t=>e.type===t)))return!1}var{parentIsUsefulElement:c,targetElementList:h}=Ao(t,i);if(!function(t,e){var r=null==e?void 0:e.element_allowlist;if(Kr(r))return!0;var i,n=function(t){if(r.some((e=>t.tagName.toLowerCase()===e)))return{v:!0}};for(var o of t)if(i=n(o))return i.v;return!1}(h,r))return!1;if(!Io(h,null==(l=r)?void 0:l.css_selector_allowlist))return!1;var d=Yi.getComputedStyle(t);if(d&&"pointer"===d.getPropertyValue("cursor")&&"click"===e.type)return!0;var v=t.tagName.toLowerCase();switch(v){case"html":return!1;case"form":return(n||["submit"]).indexOf(e.type)>=0;case"input":case"select":case"textarea":return(n||["change","click"]).indexOf(e.type)>=0;default:return c?(n||["click"]).indexOf(e.type)>=0:(n||["click"]).indexOf(e.type)>=0&&(Co.indexOf(v)>-1||"true"===t.getAttribute("contenteditable"))}}function Mo(t){for(var e=t;e.parentNode&&!vo(e,"body");e=e.parentNode){var r=yo(e);if($r(r,"ph-sensitive")||$r(r,"ph-no-capture"))return!1}if($r(yo(t),"ph-include"))return!0;var i=t.type||"";if(Qr(i))switch(i.toLowerCase()){case"hidden":case"password":return!1}var n=t.name||t.id||"";if(Qr(n)){if(/^cc|cardnum|ccnum|creditcard|csc|cvc|cvv|exp|pass|pwd|routing|seccode|securitycode|securitynum|socialsec|socsec|ssn/i.test(n.replace(/[^a-zA-Z0-9]/g,"")))return!1}return!0}function Eo(t){return!!(vo(t,"input")&&!["button","checkbox","submit","reset"].includes(t.type)||vo(t,"select")||vo(t,"textarea")||"true"===t.getAttribute("contenteditable"))}var No="(4[0-9]{12}(?:[0-9]{3})?)|(5[1-5][0-9]{14})|(6(?:011|5[0-9]{2})[0-9]{12})|(3[47][0-9]{13})|(3(?:0[0-5]|[68][0-9])[0-9]{11})|((?:2131|1800|35[0-9]{3})[0-9]{11})",Ro=new RegExp("^(?:"+No+")$"),Fo=new RegExp(No),Oo="\\d{3}-?\\d{2}-?\\d{4}",Po=new RegExp("^("+Oo+")$"),Lo=new RegExp("("+Oo+")");function Do(t,e){if(void 0===e&&(e=!0),ri(t))return!1;if(Qr(t)){if(t=qr(t),(e?Ro:Fo).test((t||"").replace(/[- ]/g,"")))return!1;if((e?Po:Lo).test(t))return!1}return!0}function Bo(t){var e=wo(t);return Do(e=(e+" "+Zo(t)).trim())?e:""}function Zo(t){var e="";return t&&t.childNodes&&t.childNodes.length&&vn(t.childNodes,(function(t){var r;if(t&&"span"===(null==(r=t.tagName)?void 0:r.toLowerCase()))try{var i=wo(t);e=(e+" "+i).trim(),t.childNodes&&t.childNodes.length&&(e=(e+" "+Zo(t)).trim())}catch(t){un.error("[AutoCapture]",t)}})),e}function $o(t){return function(t){var e=t.map((t=>{var e,i,n="";if(t.tag_name&&(n+=t.tag_name),t.attr_class)for(var o of(t.attr_class.sort(),t.attr_class))n+="."+o.replace(/"/g,"");var s=r({},t.text?{text:t.text}:{},{"nth-child":null!==(e=t.nth_child)&&void 0!==e?e:0,"nth-of-type":null!==(i=t.nth_of_type)&&void 0!==i?i:0},t.href?{href:t.href}:{},t.attr_id?{attr_id:t.attr_id}:{},t.attributes),a={};return gn(s).sort(((t,e)=>{var[r]=t,[i]=e;return r.localeCompare(i)})).forEach((t=>{var[e,r]=t;return a[qo(e.toString())]=qo(r.toString())})),n+=":",n+=gn(a).map((t=>{var[e,r]=t;return e+'="'+r+'"'})).join("")}));return e.join(";")}(function(t){return t.map((t=>{var e,r,i={text:null==(e=t.$el_text)?void 0:e.slice(0,400),tag_name:t.tag_name,href:null==(r=t.attr__href)?void 0:r.slice(0,2048),attr_class:Ho(t),attr_id:t.attr__id,nth_child:t.nth_child,nth_of_type:t.nth_of_type,attributes:{}};return gn(t).filter((t=>{var[e]=t;return 0===e.indexOf("attr__")})).forEach((t=>{var[e,r]=t;return i.attributes[e]=r})),i}))}(t))}function qo(t){return t.replace(/"|\\"/g,'\\"')}function Ho(t){var e=t.attr__class;return e?Wr(e)?e:go(e):void 0}var Vo={initiatorTypes:["audio","beacon","body","css","early-hint","embed","fetch","frame","iframe","icon","image","img","input","link","navigation","object","ping","script","track","video","xmlhttprequest"],maskRequestFn:t=>t,recordHeaders:!1,recordBody:!1,recordInitialRequests:!1,recordPerformance:!1,performanceEntryTypeToObserve:["first-input","navigation","paint","resource"],payloadSizeLimitBytes:1e6,payloadHostDenyList:[".lr-ingest.io",".ingest.sentry.io",".clarity.ms","analytics.google.com","bam.nr-data.net"]},jo=cn("[Recorder]"),Yo=t=>"navigation"===t.entryType,Go=t=>"resource"===t.entryType;function Wo(t,e,r){if(r.recordInitialRequests){var i=e.performance.getEntries().filter((t=>Yo(t)||Go(t)&&r.initiatorTypes.includes(t.initiatorType)));t({requests:i.flatMap((t=>ts({entry:t,method:void 0,status:void 0,networkRequest:{},isInitial:!0}))),isInitial:!0})}var n=new e.PerformanceObserver((e=>{var i=e.getEntries().filter((t=>Yo(t)||Go(t)&&r.initiatorTypes.includes(t.initiatorType)&&(t=>!r.recordBody&&!r.recordHeaders||"xmlhttprequest"!==t.initiatorType&&"fetch"!==t.initiatorType)(t)));t({requests:i.flatMap((t=>ts({entry:t,method:void 0,status:void 0,networkRequest:{}})))})})),o=PerformanceObserver.supportedEntryTypes.filter((t=>r.performanceEntryTypeToObserve.includes(t)));return n.observe({entryTypes:o}),()=>{n.disconnect()}}function zo(t,e){return!!e&&(ni(e)||e[t])}function Uo(t){var{type:e,recordBody:r,headers:i,url:n}=t;function o(t){var e=Object.keys(i).find((t=>"content-type"===t.toLowerCase())),r=e&&i[e];return t.some((t=>null==r?void 0:r.includes(t)))}if(!r)return!1;if(function t(e){try{return"string"==typeof e?e.startsWith("blob:"):e instanceof URL?"blob:"===e.protocol:e instanceof Request&&t(e.url)}catch(t){return!1}}(n))return!1;if(ni(r))return!0;if(Wr(r))return o(r);var s=r[e];return ni(s)?s:o(s)}function Xo(t,e,r,i,n,o){return Jo.apply(this,arguments)}function Jo(){return Jo=e((function*(t,e,r,i,n,o){if(void 0===o&&(o=0),o>10)return jo.warn("Failed to get performance entry for request",{url:r,initiatorType:e}),null;var s=function(t,e){for(var r=t.length-1;r>=0;r-=1)if(e(t[r]))return t[r]}(t.performance.getEntriesByName(r),(t=>Go(t)&&t.initiatorType===e&&(Kr(i)||t.startTime>=i)&&(Kr(n)||t.startTime<=n)));return s||(yield new Promise((t=>setTimeout(t,50*o))),Xo(t,e,r,i,n,o+1))})),Jo.apply(this,arguments)}function Ko(t){var{body:e,options:r,url:i}=t;if(ri(e))return null;var{hostname:n,isHostDenied:o}=Nn(i,r);if(o)return n+" is in deny list";if(Qr(e))return e;if(sn(e))return e.textContent;if(oi(e))return xn(e);if(Xr(e))try{return JSON.stringify(e)}catch(t){return"[SessionReplay] Failed to stringify response object"}return"[SessionReplay] Cannot read body of type "+toString.call(e)}var Qo=t=>!ei(t)&&("navigation"===t.entryType||"resource"===t.entryType);function ts(t){var{entry:e,method:i,status:n,networkRequest:o,isInitial:s,start:a,end:l,url:u,initiatorType:c}=t;a=e?e.startTime:a,l=e?e.responseEnd:l;var h=Math.floor(Date.now()-performance.now()),d=Math.floor(h+(a||0)),v=[r({},e?e.toJSON():{name:u},{startTime:Kr(a)?void 0:Math.round(a),endTime:Kr(l)?void 0:Math.round(l),timeOrigin:h,timestamp:d,method:i,initiatorType:c||(e?e.initiatorType:void 0),status:n,requestHeaders:o.requestHeaders,requestBody:o.requestBody,responseHeaders:o.responseHeaders,responseBody:o.responseBody,isInitial:s})];if(Qo(e))for(var f of e.serverTiming||[])v.push({timeOrigin:h,timestamp:d,startTime:Math.round(e.startTime),name:f.name,duration:f.duration,entryType:"serverTiming"});return v}var es=["video/","audio/"];function rs(t){return new Promise(((e,r)=>{var i=setTimeout((()=>e("[SessionReplay] Timeout while trying to read body")),500);try{t.clone().text().then((t=>e(t)),(t=>r(t))).finally((()=>clearTimeout(i)))}catch(t){clearTimeout(i),e("[SessionReplay] Failed to read body")}}))}function is(){return is=e((function*(t){var{r:e,options:r,url:i}=t,{hostname:n,isHostDenied:o}=Nn(i,r);return o?Promise.resolve(n+" is in deny list"):rs(e)})),is.apply(this,arguments)}function ns(){return ns=e((function*(t){var{r:e,options:r,url:i}=t,n=function(t){var e,{r:r,options:i,url:n}=t;if("chunked"===r.headers.get("Transfer-Encoding"))return"Chunked Transfer-Encoding is not supported";var o=null==(e=r.headers.get("Content-Type"))?void 0:e.toLowerCase(),s=es.some((t=>null==o?void 0:o.startsWith(t)));if(o&&s)return"Content-Type "+o+" is not supported";var{hostname:a,isHostDenied:l}=Nn(n,i);return l?a+" is in deny list":null}({r:e,options:r,url:i});return ei(n)?rs(e):Promise.resolve(n)})),ns.apply(this,arguments)}function os(t,r,i){if(!i.initiatorTypes.includes("fetch"))return()=>{};var n=zo("request",i.recordHeaders),o=zo("response",i.recordHeaders),s=En(r,"fetch",(s=>function(){var a=e((function*(e,a){var l,u,c,h=new Request(e,a),d={};try{var v={};h.headers.forEach(((t,e)=>{v[e]=t})),n&&(d.requestHeaders=v),Uo({type:"request",headers:v,url:e,recordBody:i.recordBody})&&(d.requestBody=yield function(t){return is.apply(this,arguments)}({r:h,options:i,url:e})),u=r.performance.now(),l=yield s(h),c=r.performance.now();var f={};return l.headers.forEach(((t,e)=>{f[e]=t})),o&&(d.responseHeaders=f),Uo({type:"response",headers:f,url:e,recordBody:i.recordBody})&&(d.responseBody=yield function(t){return ns.apply(this,arguments)}({r:l,options:i,url:e})),l}finally{Xo(r,"fetch",h.url,u,c).then((e=>{var r,i=ts({entry:e,method:h.method,status:null==(r=l)?void 0:r.status,networkRequest:d,start:u,end:c,url:h.url,initiatorType:"fetch"});t({requests:i})})).catch((()=>{}))}}));return function(t,e){return a.apply(this,arguments)}}()));return()=>{s()}}var ss=null;function as(t,e,i){if(!("performance"in e))return()=>{};if(ss)return jo.warn("Network observer already initialised, doing nothing"),()=>{};var n=i?Object.assign({},Vo,i):Vo,o=e=>{var i=[];e.requests.forEach((t=>{var e=n.maskRequestFn(t);e&&i.push(e)})),i.length>0&&t(r({},e,{requests:i}))},s=Wo(o,e,n),a=()=>{},l=()=>{};return(n.recordHeaders||n.recordBody)&&(a=function(t,e,r){if(!r.initiatorTypes.includes("xmlhttprequest"))return()=>{};var i=zo("request",r.recordHeaders),n=zo("response",r.recordHeaders),o=En(e.XMLHttpRequest.prototype,"open",(o=>function(s,a,l,u,c){void 0===l&&(l=!0);var h,d,v=this,f=new Request(a),p={},g={},m=v.setRequestHeader.bind(v);v.setRequestHeader=(t,e)=>(g[t]=e,m(t,e)),i&&(p.requestHeaders=g);var y=v.send.bind(v);v.send=t=>(Uo({type:"request",headers:g,url:a,recordBody:r.recordBody})&&(p.requestBody=Ko({body:t,options:r,url:a})),h=e.performance.now(),y(t));var b=()=>{if(v.readyState===v.DONE){v.removeEventListener("readystatechange",b),d=e.performance.now();var i={};v.getAllResponseHeaders().trim().split(/[\r\n]+/).forEach((t=>{var e=t.split(": "),r=e.shift(),n=e.join(": ");r&&(i[r]=n)})),n&&(p.responseHeaders=i),Uo({type:"response",headers:i,url:a,recordBody:r.recordBody})&&(p.responseBody=Ko({body:v.response,options:r,url:a})),Xo(e,"xmlhttprequest",f.url,h,d).then((e=>{var r=ts({entry:e,method:s,status:null==v?void 0:v.status,networkRequest:p,start:h,end:d,url:a.toString(),initiatorType:"xmlhttprequest"});t({requests:r})})).catch((()=>{}))}};v.addEventListener("readystatechange",b),o.call(v,s,a,l,u,c)}));return()=>{o()}}(o,e,n),l=os(o,e,n)),ss=()=>{s(),a(),l()}}var ls=t=>({name:"rrweb/network@1",observer:as,options:t});nn.__PosthogExtensions__=nn.__PosthogExtensions__||{},nn.__PosthogExtensions__.rrwebPlugins={getRecordConsolePlugin:Br,getRecordNetworkPlugin:ls},nn.__PosthogExtensions__.rrweb={record:Ze,version:"v2"},nn.rrweb={record:Ze,version:"v2"},nn.rrwebConsoleRecord={getRecordConsolePlugin:Br},nn.getRecordNetworkPlugin=ls;var us,cs,hs,ds,vs,fs,ps,gs,ms={},ys=[],bs=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,ws=Array.isArray;function _s(t,e){for(var r in e)t[r]=e[r];return t}function Cs(t){var e=t.parentNode;e&&e.removeChild(t)}function Is(t,e,r){var i,n,o,s={};for(o in e)"key"==o?i=e[o]:"ref"==o?n=e[o]:s[o]=e[o];if(arguments.length>2&&(s.children=arguments.length>3?us.call(arguments,2):r),"function"==typeof t&&null!=t.defaultProps)for(o in t.defaultProps)void 0===s[o]&&(s[o]=t.defaultProps[o]);return Ss(t,s,i,n,null)}function Ss(t,e,r,i,n){var o={type:t,props:e,key:r,ref:i,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,constructor:void 0,__v:null==n?++hs:n,__i:-1,__u:0};return null==n&&null!=cs.vnode&&cs.vnode(o),o}function ks(t){return t.children}function xs(t,e){this.props=t,this.context=e}function As(t,e){if(null==e)return t.__?As(t.__,t.__i+1):null;for(var r;e<t.__k.length;e++)if(null!=(r=t.__k[e])&&null!=r.__e)return r.__e;return"function"==typeof t.type?As(t):null}function Ts(t){var e,r;if(null!=(t=t.__)&&null!=t.__c){for(t.__e=t.__c.base=null,e=0;e<t.__k.length;e++)if(null!=(r=t.__k[e])&&null!=r.__e){t.__e=t.__c.base=r.__e;break}return Ts(t)}}function Ms(t){(!t.__d&&(t.__d=!0)&&ds.push(t)&&!Es.__r++||vs!==cs.debounceRendering)&&((vs=cs.debounceRendering)||fs)(Es)}function Es(){var t,e,r,i,n,o,s,a,l;for(ds.sort(ps);t=ds.shift();)t.__d&&(e=ds.length,i=void 0,o=(n=(r=t).__v).__e,a=[],l=[],(s=r.__P)&&((i=_s({},n)).__v=n.__v+1,cs.vnode&&cs.vnode(i),Bs(s,i,n,r.__n,void 0!==s.ownerSVGElement,32&n.__u?[o]:null,a,null==o?As(n):o,!!(32&n.__u),l),i.__.__k[i.__i]=i,Zs(a,i,l),i.__e!=o&&Ts(i)),ds.length>e&&ds.sort(ps));Es.__r=0}function Ns(t,e,r,i,n,o,s,a,l,u,c){var h,d,v,f,p,g=i&&i.__k||ys,m=e.length;for(r.__d=l,function(t,e,r){var i,n,o,s,a,l=e.length,u=r.length,c=u,h=0;for(t.__k=[],i=0;i<l;i++)null!=(n=t.__k[i]=null==(n=e[i])||"boolean"==typeof n||"function"==typeof n?null:"string"==typeof n||"number"==typeof n||"bigint"==typeof n||n.constructor==String?Ss(null,n,null,null,n):ws(n)?Ss(ks,{children:n},null,null,null):void 0===n.constructor&&n.__b>0?Ss(n.type,n.props,n.key,n.ref?n.ref:null,n.__v):n)?(n.__=t,n.__b=t.__b+1,a=Fs(n,r,s=i+h,c),n.__i=a,o=null,-1!==a&&(c--,(o=r[a])&&(o.__u|=131072)),null==o||null===o.__v?(-1==a&&h--,"function"!=typeof n.type&&(n.__u|=65536)):a!==s&&(a===s+1?h++:a>s?c>l-s?h+=a-s:h--:h=a<s&&a==s-1?a-s:0,a!==i+h&&(n.__u|=65536))):(o=r[i])&&null==o.key&&o.__e&&(o.__e==t.__d&&(t.__d=As(o)),qs(o,o,!1),r[i]=null,c--);if(c)for(i=0;i<u;i++)null!=(o=r[i])&&0==(131072&o.__u)&&(o.__e==t.__d&&(t.__d=As(o)),qs(o,o))}(r,e,g),l=r.__d,h=0;h<m;h++)null!=(v=r.__k[h])&&"boolean"!=typeof v&&"function"!=typeof v&&(d=-1===v.__i?ms:g[v.__i]||ms,v.__i=h,Bs(t,v,d,n,o,s,a,l,u,c),f=v.__e,v.ref&&d.ref!=v.ref&&(d.ref&&$s(d.ref,null,v),c.push(v.ref,v.__c||f,v)),null==p&&null!=f&&(p=f),65536&v.__u||d.__k===v.__k?l=Rs(v,l,t):"function"==typeof v.type&&void 0!==v.__d?l=v.__d:f&&(l=f.nextSibling),v.__d=void 0,v.__u&=-196609);r.__d=l,r.__e=p}function Rs(t,e,r){var i,n;if("function"==typeof t.type){for(i=t.__k,n=0;i&&n<i.length;n++)i[n]&&(i[n].__=t,e=Rs(i[n],e,r));return e}return t.__e!=e&&(r.insertBefore(t.__e,e||null),e=t.__e),e&&e.nextSibling}function Fs(t,e,r,i){var n=t.key,o=t.type,s=r-1,a=r+1,l=e[r];if(null===l||l&&n==l.key&&o===l.type)return r;if(i>(null!=l&&0==(131072&l.__u)?1:0))for(;s>=0||a<e.length;){if(s>=0){if((l=e[s])&&0==(131072&l.__u)&&n==l.key&&o===l.type)return s;s--}if(a<e.length){if((l=e[a])&&0==(131072&l.__u)&&n==l.key&&o===l.type)return a;a++}}return-1}function Os(t,e,r){"-"===e[0]?t.setProperty(e,null==r?"":r):t[e]=null==r?"":"number"!=typeof r||bs.test(e)?r:r+"px"}function Ps(t,e,r,i,n){var o;t:if("style"===e)if("string"==typeof r)t.style.cssText=r;else{if("string"==typeof i&&(t.style.cssText=i=""),i)for(e in i)r&&e in r||Os(t.style,e,"");if(r)for(e in r)i&&r[e]===i[e]||Os(t.style,e,r[e])}else if("o"===e[0]&&"n"===e[1])o=e!==(e=e.replace(/(PointerCapture)$|Capture$/,"$1")),e=e.toLowerCase()in t?e.toLowerCase().slice(2):e.slice(2),t.l||(t.l={}),t.l[e+o]=r,r?i?r.u=i.u:(r.u=Date.now(),t.addEventListener(e,o?Ds:Ls,o)):t.removeEventListener(e,o?Ds:Ls,o);else{if(n)e=e.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if("width"!==e&&"height"!==e&&"href"!==e&&"list"!==e&&"form"!==e&&"tabIndex"!==e&&"download"!==e&&"rowSpan"!==e&&"colSpan"!==e&&"role"!==e&&e in t)try{t[e]=null==r?"":r;break t}catch(t){}"function"==typeof r||(null==r||!1===r&&"-"!==e[4]?t.removeAttribute(e):t.setAttribute(e,r))}}function Ls(t){var e=this.l[t.type+!1];if(t.t){if(t.t<=e.u)return}else t.t=Date.now();return e(cs.event?cs.event(t):t)}function Ds(t){return this.l[t.type+!0](cs.event?cs.event(t):t)}function Bs(t,e,r,i,n,o,s,a,l,u){var c,h,d,v,f,p,g,m,y,b,w,$,_,C,I,S=e.type;if(void 0!==e.constructor)return null;128&r.__u&&(l=!!(32&r.__u),o=[a=e.__e=r.__e]),(c=cs.__b)&&c(e);t:if("function"==typeof S)try{if(m=e.props,y=(c=S.contextType)&&i[c.__c],b=c?y?y.props.value:c.__:i,r.__c?g=(h=e.__c=r.__c).__=h.__E:("prototype"in S&&S.prototype.render?e.__c=h=new S(m,b):(e.__c=h=new xs(m,b),h.constructor=S,h.render=Hs),y&&y.sub(h),h.props=m,h.state||(h.state={}),h.context=b,h.__n=i,d=h.__d=!0,h.__h=[],h._sb=[]),null==h.__s&&(h.__s=h.state),null!=S.getDerivedStateFromProps&&(h.__s==h.state&&(h.__s=_s({},h.__s)),_s(h.__s,S.getDerivedStateFromProps(m,h.__s))),v=h.props,f=h.state,h.__v=e,d)null==S.getDerivedStateFromProps&&null!=h.componentWillMount&&h.componentWillMount(),null!=h.componentDidMount&&h.__h.push(h.componentDidMount);else{if(null==S.getDerivedStateFromProps&&m!==v&&null!=h.componentWillReceiveProps&&h.componentWillReceiveProps(m,b),!h.__e&&(null!=h.shouldComponentUpdate&&!1===h.shouldComponentUpdate(m,h.__s,b)||e.__v===r.__v)){for(e.__v!==r.__v&&(h.props=m,h.state=h.__s,h.__d=!1),e.__e=r.__e,e.__k=r.__k,e.__k.forEach((function(t){t&&(t.__=e)})),w=0;w<h._sb.length;w++)h.__h.push(h._sb[w]);h._sb=[],h.__h.length&&s.push(h);break t}null!=h.componentWillUpdate&&h.componentWillUpdate(m,h.__s,b),null!=h.componentDidUpdate&&h.__h.push((function(){h.componentDidUpdate(v,f,p)}))}if(h.context=b,h.props=m,h.__P=t,h.__e=!1,$=cs.__r,_=0,"prototype"in S&&S.prototype.render){for(h.state=h.__s,h.__d=!1,$&&$(e),c=h.render(h.props,h.state,h.context),C=0;C<h._sb.length;C++)h.__h.push(h._sb[C]);h._sb=[]}else do{h.__d=!1,$&&$(e),c=h.render(h.props,h.state,h.context),h.state=h.__s}while(h.__d&&++_<25);h.state=h.__s,null!=h.getChildContext&&(i=_s(_s({},i),h.getChildContext())),d||null==h.getSnapshotBeforeUpdate||(p=h.getSnapshotBeforeUpdate(v,f)),Ns(t,ws(I=null!=c&&c.type===ks&&null==c.key?c.props.children:c)?I:[I],e,r,i,n,o,s,a,l,u),h.base=e.__e,e.__u&=-161,h.__h.length&&s.push(h),g&&(h.__E=h.__=null)}catch(t){e.__v=null,l||null!=o?(e.__e=a,e.__u|=l?160:32,o[o.indexOf(a)]=null):(e.__e=r.__e,e.__k=r.__k),cs.__e(t,e,r)}else null==o&&e.__v===r.__v?(e.__k=r.__k,e.__e=r.__e):e.__e=function(t,e,r,i,n,o,s,a,l){var u,c,h,d,v,f,p,g=r.props,m=e.props,y=e.type;if("svg"===y&&(n=!0),null!=o)for(u=0;u<o.length;u++)if((v=o[u])&&"setAttribute"in v==!!y&&(y?v.localName===y:3===v.nodeType)){t=v,o[u]=null;break}if(null==t){if(null===y)return document.createTextNode(m);t=n?document.createElementNS("http://www.w3.org/2000/svg",y):document.createElement(y,m.is&&m),o=null,a=!1}if(null===y)g===m||a&&t.data===m||(t.data=m);else{if(o=o&&us.call(t.childNodes),g=r.props||ms,!a&&null!=o)for(g={},u=0;u<t.attributes.length;u++)g[(v=t.attributes[u]).name]=v.value;for(u in g)v=g[u],"children"==u||("dangerouslySetInnerHTML"==u?h=v:"key"===u||u in m||Ps(t,u,null,v,n));for(u in m)v=m[u],"children"==u?d=v:"dangerouslySetInnerHTML"==u?c=v:"value"==u?f=v:"checked"==u?p=v:"key"===u||a&&"function"!=typeof v||g[u]===v||Ps(t,u,v,g[u],n);if(c)a||h&&(c.__html===h.__html||c.__html===t.innerHTML)||(t.innerHTML=c.__html),e.__k=[];else if(h&&(t.innerHTML=""),Ns(t,ws(d)?d:[d],e,r,i,n&&"foreignObject"!==y,o,s,o?o[0]:r.__k&&As(r,0),a,l),null!=o)for(u=o.length;u--;)null!=o[u]&&Cs(o[u]);a||(u="value",void 0!==f&&(f!==t[u]||"progress"===y&&!f||"option"===y&&f!==g[u])&&Ps(t,u,f,g[u],!1),u="checked",void 0!==p&&p!==t[u]&&Ps(t,u,p,g[u],!1))}return t}(r.__e,e,r,i,n,o,s,l,u);(c=cs.diffed)&&c(e)}function Zs(t,e,r){e.__d=void 0;for(var i=0;i<r.length;i++)$s(r[i],r[++i],r[++i]);cs.__c&&cs.__c(e,t),t.some((function(e){try{t=e.__h,e.__h=[],t.some((function(t){t.call(e)}))}catch(t){cs.__e(t,e.__v)}}))}function $s(t,e,r){try{"function"==typeof t?t(e):t.current=e}catch(t){cs.__e(t,r)}}function qs(t,e,r){var i,n;if(cs.unmount&&cs.unmount(t),(i=t.ref)&&(i.current&&i.current!==t.__e||$s(i,null,e)),null!=(i=t.__c)){if(i.componentWillUnmount)try{i.componentWillUnmount()}catch(t){cs.__e(t,e)}i.base=i.__P=null,t.__c=void 0}if(i=t.__k)for(n=0;n<i.length;n++)i[n]&&qs(i[n],e,r||"function"!=typeof t.type);r||null==t.__e||Cs(t.__e),t.__=t.__e=t.__d=void 0}function Hs(t,e,r){return this.constructor(t,r)}function Vs(t,e,r){var i,n,o;cs.__&&cs.__(t,e),i=!1?null:e.__k,n=[],o=[],Bs(e,t=e.__k=Is(ks,null,[t]),i||ms,ms,void 0!==e.ownerSVGElement,i?null:e.firstChild?us.call(e.childNodes):null,n,i?i.__e:e.firstChild,false,o),Zs(n,t,o)}function js(t,e,r){var i,n,o,s,a=_s({},t.props);for(o in t.type&&t.type.defaultProps&&(s=t.type.defaultProps),e)"key"==o?i=e[o]:"ref"==o?n=e[o]:a[o]=void 0===e[o]&&void 0!==s?s[o]:e[o];return arguments.length>2&&(a.children=arguments.length>3?us.call(arguments,2):r),Ss(t.type,a,i||t.key,n||t.ref,null)}us=ys.slice,cs={__e:function(t,e,r,i){for(var n,o,s;e=e.__;)if((n=e.__c)&&!n.__)try{if((o=n.constructor)&&null!=o.getDerivedStateFromError&&(n.setState(o.getDerivedStateFromError(t)),s=n.__d),null!=n.componentDidCatch&&(n.componentDidCatch(t,i||{}),s=n.__d),s)return n.__E=n}catch(e){t=e}throw t}},hs=0,xs.prototype.setState=function(t,e){var r;r=null!=this.__s&&this.__s!==this.state?this.__s:this.__s=_s({},this.state),"function"==typeof t&&(t=t(_s({},r),this.props)),t&&_s(r,t),null!=t&&this.__v&&(e&&this._sb.push(e),Ms(this))},xs.prototype.forceUpdate=function(t){this.__v&&(this.__e=!0,t&&this.__h.push(t),Ms(this))},xs.prototype.render=ks,ds=[],fs="function"==typeof Promise?Promise.prototype.then.bind(Promise.resolve()):setTimeout,ps=function(t,e){return t.__v.__b-e.__v.__b},Es.__r=0,gs=0;var Ys,Gs,Ws,zs,Us=0,Xs=[],Js=[],Ks=cs.__b,Qs=cs.__r,ta=cs.diffed,ea=cs.__c,ra=cs.unmount;function ia(t,e){cs.__h&&cs.__h(Gs,t,Us||e),Us=0;var r=Gs.__H||(Gs.__H={__:[],__h:[]});return t>=r.__.length&&r.__.push({__V:Js}),r.__[t]}function na(t){return Us=1,function(t,e,r){var i=ia(Ys++,2);if(i.t=t,!i.__c&&(i.__=[pa(void 0,e),function(t){var e=i.__N?i.__N[0]:i.__[0],r=i.t(e,t);e!==r&&(i.__N=[r,i.__[1]],i.__c.setState({}))}],i.__c=Gs,!Gs.u)){var n=function(t,e,r){if(!i.__c.__H)return!0;var n=i.__c.__H.__.filter((function(t){return t.__c}));if(n.every((function(t){return!t.__N})))return!o||o.call(this,t,e,r);var s=!1;return n.forEach((function(t){if(t.__N){var e=t.__[0];t.__=t.__N,t.__N=void 0,e!==t.__[0]&&(s=!0)}})),!(!s&&i.__c.props===t)&&(!o||o.call(this,t,e,r))};Gs.u=!0;var o=Gs.shouldComponentUpdate,s=Gs.componentWillUpdate;Gs.componentWillUpdate=function(t,e,r){if(this.__e){var i=o;o=void 0,n(t,e,r),o=i}s&&s.call(this,t,e,r)},Gs.shouldComponentUpdate=n}return i.__N||i.__}(pa,t)}function oa(t,e){var r=ia(Ys++,3);!cs.__s&&fa(r.__H,e)&&(r.__=t,r.i=e,Gs.__H.__h.push(r))}function sa(t){return Us=5,aa((function(){return{current:t}}),[])}function aa(t,e){var r=ia(Ys++,7);return fa(r.__H,e)?(r.__V=t(),r.i=e,r.__h=t,r.__V):r.__}function la(t){var e=Gs.context[t.__c],r=ia(Ys++,9);return r.c=t,e?(null==r.__&&(r.__=!0,e.sub(Gs)),e.props.value):t.__}function ua(){for(var t;t=Xs.shift();)if(t.__P&&t.__H)try{t.__H.__h.forEach(da),t.__H.__h.forEach(va),t.__H.__h=[]}catch(e){t.__H.__h=[],cs.__e(e,t.__v)}}cs.__b=function(t){Gs=null,Ks&&Ks(t)},cs.__r=function(t){Qs&&Qs(t),Ys=0;var e=(Gs=t.__c).__H;e&&(Ws===Gs?(e.__h=[],Gs.__h=[],e.__.forEach((function(t){t.__N&&(t.__=t.__N),t.__V=Js,t.__N=t.i=void 0}))):(e.__h.forEach(da),e.__h.forEach(va),e.__h=[],Ys=0)),Ws=Gs},cs.diffed=function(t){ta&&ta(t);var e=t.__c;e&&e.__H&&(e.__H.__h.length&&(1!==Xs.push(e)&&zs===cs.requestAnimationFrame||((zs=cs.requestAnimationFrame)||ha)(ua)),e.__H.__.forEach((function(t){t.i&&(t.__H=t.i),t.__V!==Js&&(t.__=t.__V),t.i=void 0,t.__V=Js}))),Ws=Gs=null},cs.__c=function(t,e){e.some((function(t){try{t.__h.forEach(da),t.__h=t.__h.filter((function(t){return!t.__||va(t)}))}catch(r){e.some((function(t){t.__h&&(t.__h=[])})),e=[],cs.__e(r,t.__v)}})),ea&&ea(t,e)},cs.unmount=function(t){ra&&ra(t);var e,r=t.__c;r&&r.__H&&(r.__H.__.forEach((function(t){try{da(t)}catch(t){e=t}})),r.__H=void 0,e&&cs.__e(e,r.__v))};var ca="function"==typeof requestAnimationFrame;function ha(t){var e,r=function(){clearTimeout(i),ca&&cancelAnimationFrame(e),setTimeout(t)},i=setTimeout(r,100);ca&&(e=requestAnimationFrame(r))}function da(t){var e=Gs,r=t.__c;"function"==typeof r&&(t.__c=void 0,r()),Gs=e}function va(t){var e=Gs;t.__c=t.__(),Gs=e}function fa(t,e){return!t||t.length!==e.length||e.some((function(e,r){return e!==t[r]}))}function pa(t,e){return"function"==typeof e?e(t):e}var ga=function(t){return t.Button="button",t.Tab="tab",t.Selector="selector",t}({}),ma=function(t){return t.TopLeft="top_left",t.TopRight="top_right",t.TopCenter="top_center",t.MiddleLeft="middle_left",t.MiddleRight="middle_right",t.MiddleCenter="middle_center",t.Left="left",t.Center="center",t.Right="right",t.NextToTrigger="next_to_trigger",t}({}),ya=function(t){return t.Popover="popover",t.API="api",t.Widget="widget",t.ExternalSurvey="external_survey",t}({}),ba=function(t){return t.Open="open",t.MultipleChoice="multiple_choice",t.SingleChoice="single_choice",t.Rating="rating",t.Link="link",t}({}),wa=function(t){return t.NextQuestion="next_question",t.End="end",t.ResponseBased="response_based",t.SpecificQuestion="specific_question",t}({}),_a=function(t){return t.Once="once",t.Recurring="recurring",t.Always="always",t}({}),Ca=function(t){return t.SHOWN="survey shown",t.DISMISSED="survey dismissed",t.SENT="survey sent",t}({}),Ia=function(t){return t.SURVEY_ID="$survey_id",t.SURVEY_NAME="$survey_name",t.SURVEY_RESPONSE="$survey_response",t.SURVEY_ITERATION="$survey_iteration",t.SURVEY_ITERATION_START_DATE="$survey_iteration_start_date",t.SURVEY_PARTIALLY_COMPLETED="$survey_partially_completed",t.SURVEY_SUBMISSION_ID="$survey_submission_id",t.SURVEY_QUESTIONS="$survey_questions",t.SURVEY_COMPLETED="$survey_completed",t}({}),Sa=function(t){return t.Popover="popover",t.Inline="inline",t}({}),ka=cn("[Surveys]");function xa(t){return!(!t.start_date||t.end_date)}function Aa(t){var e;return!(null==(e=t.conditions)||null==(e=e.events)||null==(e=e.values)||!e.length)}function Ta(t){var e;return!(null==(e=t.conditions)||null==(e=e.actions)||null==(e=e.values)||!e.length)}var Ma="seenSurvey_",Ea="inProgressSurvey_",Na=(t,e)=>{var r="$survey_"+e+"/"+t.id;return t.current_iteration&&t.current_iteration>0&&(r="$survey_"+e+"/"+t.id+"/"+t.current_iteration),r},Ra=t=>{var e=""+Ma+t.id;return t.current_iteration&&t.current_iteration>0&&(e=""+Ma+t.id+"_"+t.current_iteration),e},Fa=t=>{localStorage.getItem(Ra(t))||localStorage.setItem(Ra(t),"true")},Oa=[ya.Popover,ya.Widget,ya.API],Pa={ignoreConditions:!1,ignoreDelay:!1,displayType:Sa.Popover};Math.trunc||(Math.trunc=function(t){return t<0?Math.ceil(t):Math.floor(t)}),Number.isInteger||(Number.isInteger=function(t){return ii(t)&&isFinite(t)&&Math.floor(t)===t});var La="0123456789abcdef";class Da{constructor(t){if(this.bytes=t,16!==t.length)throw new TypeError("not 128-bit length")}static fromFieldsV7(t,e,r,i){if(!Number.isInteger(t)||!Number.isInteger(e)||!Number.isInteger(r)||!Number.isInteger(i)||t<0||e<0||r<0||i<0||t>0xffffffffffff||e>4095||r>1073741823||i>4294967295)throw new RangeError("invalid field value");var n=new Uint8Array(16);return n[0]=t/Math.pow(2,40),n[1]=t/Math.pow(2,32),n[2]=t/Math.pow(2,24),n[3]=t/Math.pow(2,16),n[4]=t/Math.pow(2,8),n[5]=t,n[6]=112|e>>>8,n[7]=e,n[8]=128|r>>>24,n[9]=r>>>16,n[10]=r>>>8,n[11]=r,n[12]=i>>>24,n[13]=i>>>16,n[14]=i>>>8,n[15]=i,new Da(n)}toString(){for(var t="",e=0;e<this.bytes.length;e++)t=t+La.charAt(this.bytes[e]>>>4)+La.charAt(15&this.bytes[e]),3!==e&&5!==e&&7!==e&&9!==e||(t+="-");if(36!==t.length)throw new Error("Invalid UUIDv7 was generated");return t}clone(){return new Da(this.bytes.slice(0))}equals(t){return 0===this.compareTo(t)}compareTo(t){for(var e=0;e<16;e++){var r=this.bytes[e]-t.bytes[e];if(0!==r)return Math.sign(r)}return 0}}class Ba{constructor(){this.F=0,this.O=0,this.P=new qa}generate(){var t=this.generateOrAbort();if(Kr(t)){this.F=0;var e=this.generateOrAbort();if(Kr(e))throw new Error("Could not generate UUID after timestamp reset");return e}return t}generateOrAbort(){var t=Date.now();if(t>this.F)this.F=t,this.L();else{if(!(t+1e4>this.F))return;this.O++,this.O>4398046511103&&(this.F++,this.L())}return Da.fromFieldsV7(this.F,Math.trunc(this.O/Math.pow(2,30)),this.O&Math.pow(2,30)-1,this.P.nextUint32())}L(){this.O=1024*this.P.nextUint32()+(1023&this.P.nextUint32())}}var Za,$a=t=>{if("undefined"!=typeof UUIDV7_DENY_WEAK_RNG&&UUIDV7_DENY_WEAK_RNG)throw new Error("no cryptographically strong RNG available");for(var e=0;e<t.length;e++)t[e]=65536*Math.trunc(65536*Math.random())+Math.trunc(65536*Math.random());return t};Yi&&!Kr(Yi.crypto)&&crypto.getRandomValues&&($a=t=>crypto.getRandomValues(t));class qa{constructor(){this.D=new Uint32Array(8),this.B=1/0}nextUint32(){return this.B>=this.D.length&&($a(this.D),this.B=0),this.D[this.B++]}}var Ha=()=>Va().toString(),Va=()=>(Za||(Za=new Ba)).generate(),ja="Mobile",Ya="iOS",Ga="Android",Wa="Tablet",za=Ga+" "+Wa,Ua="iPad",Xa="Apple",Ja=Xa+" Watch",Ka="Safari",Qa="BlackBerry",tl="Samsung",el=tl+"Browser",rl=tl+" Internet",il="Chrome",nl=il+" OS",ol=il+" "+Ya,sl="Internet Explorer",al=sl+" "+ja,ll="Opera",ul=ll+" Mini",cl="Edge",hl="Microsoft "+cl,dl="Firefox",vl=dl+" "+Ya,fl="Nintendo",pl="PlayStation",gl="Xbox",ml=Ga+" "+ja,yl=ja+" "+Ka,bl="Windows",wl=bl+" Phone",_l="Nokia",Cl="Ouya",Il="Generic",Sl=Il+" "+ja.toLowerCase(),kl=Il+" "+Wa.toLowerCase(),xl="Konqueror",Al="(\\d+(\\.\\d+)?)",Tl=new RegExp("Version/"+Al),Ml=new RegExp(gl,"i"),El=new RegExp(pl+" \\w+","i"),Nl=new RegExp(fl+" \\w+","i"),Rl=new RegExp(Qa+"|PlayBook|BB10","i"),Fl={"NT3.51":"NT 3.11","NT4.0":"NT 4.0","5.0":"2000",5.1:"XP",5.2:"XP","6.0":"Vista",6.1:"7",6.2:"8",6.3:"8.1",6.4:"10","10.0":"10"};var Ol=(t,e)=>e&&$r(e,Xa)||function(t){return $r(t,Ka)&&!$r(t,il)&&!$r(t,Ga)}(t),Pl=function(t,e){return e=e||"",$r(t," OPR/")&&$r(t,"Mini")?ul:$r(t," OPR/")?ll:Rl.test(t)?Qa:$r(t,"IE"+ja)||$r(t,"WPDesktop")?al:$r(t,el)?rl:$r(t,cl)||$r(t,"Edg/")?hl:$r(t,"FBIOS")?"Facebook "+ja:$r(t,"UCWEB")||$r(t,"UCBrowser")?"UC Browser":$r(t,"CriOS")?ol:$r(t,"CrMo")||$r(t,il)?il:$r(t,Ga)&&$r(t,Ka)?ml:$r(t,"FxiOS")?vl:$r(t.toLowerCase(),xl.toLowerCase())?xl:Ol(t,e)?$r(t,ja)?yl:Ka:$r(t,dl)?dl:$r(t,"MSIE")||$r(t,"Trident/")?sl:$r(t,"Gecko")?dl:""},Ll={[al]:[new RegExp("rv:"+Al)],[hl]:[new RegExp(cl+"?\\/"+Al)],[il]:[new RegExp("("+il+"|CrMo)\\/"+Al)],[ol]:[new RegExp("CriOS\\/"+Al)],"UC Browser":[new RegExp("(UCBrowser|UCWEB)\\/"+Al)],[Ka]:[Tl],[yl]:[Tl],[ll]:[new RegExp("(Opera|OPR)\\/"+Al)],[dl]:[new RegExp(dl+"\\/"+Al)],[vl]:[new RegExp("FxiOS\\/"+Al)],[xl]:[new RegExp("Konqueror[:/]?"+Al,"i")],[Qa]:[new RegExp(Qa+" "+Al),Tl],[ml]:[new RegExp("android\\s"+Al,"i")],[rl]:[new RegExp(el+"\\/"+Al)],[sl]:[new RegExp("(rv:|MSIE )"+Al)],Mozilla:[new RegExp("rv:"+Al)]},Dl=function(t,e){var r=Pl(t,e),i=Ll[r];if(Kr(i))return null;for(var n=0;n<i.length;n++){var o=i[n],s=t.match(o);if(s)return parseFloat(s[s.length-2])}return null},Bl=[[new RegExp(gl+"; "+gl+" (.*?)[);]","i"),t=>[gl,t&&t[1]||""]],[new RegExp(fl,"i"),[fl,""]],[new RegExp(pl,"i"),[pl,""]],[Rl,[Qa,""]],[new RegExp(bl,"i"),(t,e)=>{if(/Phone/.test(e)||/WPDesktop/.test(e))return[wl,""];if(new RegExp(ja).test(e)&&!/IEMobile\b/.test(e))return[bl+" "+ja,""];var r=/Windows NT ([0-9.]+)/i.exec(e);if(r&&r[1]){var i=r[1],n=Fl[i]||"";return/arm/i.test(e)&&(n="RT"),[bl,n]}return[bl,""]}],[/((iPhone|iPad|iPod).*?OS (\d+)_(\d+)_?(\d+)?|iPhone)/,t=>{if(t&&t[3]){var e=[t[3],t[4],t[5]||"0"];return[Ya,e.join(".")]}return[Ya,""]}],[/(watch.*\/(\d+\.\d+\.\d+)|watch os,(\d+\.\d+),)/i,t=>{var e="";return t&&t.length>=3&&(e=Kr(t[2])?t[3]:t[2]),["watchOS",e]}],[new RegExp("("+Ga+" (\\d+)\\.(\\d+)\\.?(\\d+)?|"+Ga+")","i"),t=>{if(t&&t[2]){var e=[t[2],t[3],t[4]||"0"];return[Ga,e.join(".")]}return[Ga,""]}],[/Mac OS X (\d+)[_.](\d+)[_.]?(\d+)?/i,t=>{var e=["Mac OS X",""];if(t&&t[1]){var r=[t[1],t[2],t[3]||"0"];e[1]=r.join(".")}return e}],[/Mac/i,["Mac OS X",""]],[/CrOS/,[nl,""]],[/Linux|debian/i,["Linux",""]]],Zl=function(t){return Nl.test(t)?fl:El.test(t)?pl:Ml.test(t)?gl:new RegExp(Cl,"i").test(t)?Cl:new RegExp("("+wl+"|WPDesktop)","i").test(t)?wl:/iPad/.test(t)?Ua:/iPod/.test(t)?"iPod Touch":/iPhone/.test(t)?"iPhone":/(watch)(?: ?os[,/]|\d,\d\/)[\d.]+/i.test(t)?Ja:Rl.test(t)?Qa:/(kobo)\s(ereader|touch)/i.test(t)?"Kobo":new RegExp(_l,"i").test(t)?_l:/(kf[a-z]{2}wi|aeo[c-r]{2})( bui|\))/i.test(t)||/(kf[a-z]+)( bui|\)).+silk\//i.test(t)?"Kindle Fire":/(Android|ZTE)/i.test(t)?!new RegExp(ja).test(t)||/(9138B|TB782B|Nexus [97]|pixel c|HUAWEISHT|BTV|noble nook|smart ultra 6)/i.test(t)?/pixel[\daxl ]{1,6}/i.test(t)&&!/pixel c/i.test(t)||/(huaweimed-al00|tah-|APA|SM-G92|i980|zte|U304AA)/i.test(t)||/lmy47v/i.test(t)&&!/QTAQZ3/i.test(t)?Ga:za:Ga:new RegExp("(pda|"+ja+")","i").test(t)?Sl:new RegExp(Wa,"i").test(t)&&!new RegExp(Wa+" pc","i").test(t)?kl:""},$l=function(t){var e=Zl(t);return e===Ua||e===za||"Kobo"===e||"Kindle Fire"===e||e===kl?Wa:e===fl||e===gl||e===pl||e===Cl?"Console":e===Ja?"Wearable":e?ja:"Desktop"},ql="$copy_autocapture",Hl=function(t){return t.GZipJS="gzip-js",t.Base64="base64",t}({}),Vl=Uint8Array,jl=Uint16Array,Yl=Uint32Array,Gl=new Vl([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]),Wl=new Vl([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]),zl=new Vl([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),Ul=function(t,e){for(var r=new jl(31),i=0;i<31;++i)r[i]=e+=1<<t[i-1];var n=new Yl(r[30]);for(i=1;i<30;++i)for(var o=r[i];o<r[i+1];++o)n[o]=o-r[i]<<5|i;return[r,n]},Xl=Ul(Gl,2),Jl=Xl[0],Kl=Xl[1];Jl[28]=258,Kl[258]=28;for(var Ql=Ul(Wl,0)[1],tu=new jl(32768),eu=0;eu<32768;++eu){var ru=(43690&eu)>>>1|(21845&eu)<<1;ru=(61680&(ru=(52428&ru)>>>2|(13107&ru)<<2))>>>4|(3855&ru)<<4,tu[eu]=((65280&ru)>>>8|(255&ru)<<8)>>>1}var iu=function(t,e,r){for(var i=t.length,n=0,o=new jl(e);n<i;++n)++o[t[n]-1];var s,a=new jl(e);for(n=0;n<e;++n)a[n]=a[n-1]+o[n-1]<<1;if(r){s=new jl(1<<e);var l=15-e;for(n=0;n<i;++n)if(t[n])for(var u=n<<4|t[n],c=e-t[n],h=a[t[n]-1]++<<c,d=h|(1<<c)-1;h<=d;++h)s[tu[h]>>>l]=u}else for(s=new jl(i),n=0;n<i;++n)s[n]=tu[a[t[n]-1]++]>>>15-t[n];return s},nu=new Vl(288);for(eu=0;eu<144;++eu)nu[eu]=8;for(eu=144;eu<256;++eu)nu[eu]=9;for(eu=256;eu<280;++eu)nu[eu]=7;for(eu=280;eu<288;++eu)nu[eu]=8;var ou=new Vl(32);for(eu=0;eu<32;++eu)ou[eu]=5;var su=iu(nu,9,0),au=iu(ou,5,0),lu=function(t){return(t/8>>0)+(7&t&&1)},uu=function(t,e,r){(null==r||r>t.length)&&(r=t.length);var i=new(t instanceof jl?jl:t instanceof Yl?Yl:Vl)(r-e);return i.set(t.subarray(e,r)),i},cu=function(t,e,r){r<<=7&e;var i=e/8>>0;t[i]|=r,t[i+1]|=r>>>8},hu=function(t,e,r){r<<=7&e;var i=e/8>>0;t[i]|=r,t[i+1]|=r>>>8,t[i+2]|=r>>>16},du=function(t,e){for(var r=[],i=0;i<t.length;++i)t[i]&&r.push({s:i,f:t[i]});var n=r.length,o=r.slice();if(!n)return[new Vl(0),0];if(1==n){var s=new Vl(r[0].s+1);return s[r[0].s]=1,[s,1]}r.sort((function(t,e){return t.f-e.f})),r.push({s:-1,f:25001});var a=r[0],l=r[1],u=0,c=1,h=2;for(r[0]={s:-1,f:a.f+l.f,l:a,r:l};c!=n-1;)a=r[r[u].f<r[h].f?u++:h++],l=r[u!=c&&r[u].f<r[h].f?u++:h++],r[c++]={s:-1,f:a.f+l.f,l:a,r:l};var d=o[0].s;for(i=1;i<n;++i)o[i].s>d&&(d=o[i].s);var v=new jl(d+1),f=vu(r[c-1],v,0);if(f>e){i=0;var p=0,g=f-e,m=1<<g;for(o.sort((function(t,e){return v[e.s]-v[t.s]||t.f-e.f}));i<n;++i){var y=o[i].s;if(!(v[y]>e))break;p+=m-(1<<f-v[y]),v[y]=e}for(p>>>=g;p>0;){var b=o[i].s;v[b]<e?p-=1<<e-v[b]++-1:++i}for(;i>=0&&p;--i){var w=o[i].s;v[w]==e&&(--v[w],++p)}f=e}return[new Vl(v),f]},vu=function(t,e,r){return-1==t.s?Math.max(vu(t.l,e,r+1),vu(t.r,e,r+1)):e[t.s]=r},fu=function(t){for(var e=t.length;e&&!t[--e];);for(var r=new jl(++e),i=0,n=t[0],o=1,s=function(t){r[i++]=t},a=1;a<=e;++a)if(t[a]==n&&a!=e)++o;else{if(!n&&o>2){for(;o>138;o-=138)s(32754);o>2&&(s(o>10?o-11<<5|28690:o-3<<5|12305),o=0)}else if(o>3){for(s(n),--o;o>6;o-=6)s(8304);o>2&&(s(o-3<<5|8208),o=0)}for(;o--;)s(n);o=1,n=t[a]}return[r.subarray(0,i),e]},pu=function(t,e){for(var r=0,i=0;i<e.length;++i)r+=t[i]*e[i];return r},gu=function(t,e,r){var i=r.length,n=lu(e+2);t[n]=255&i,t[n+1]=i>>>8,t[n+2]=255^t[n],t[n+3]=255^t[n+1];for(var o=0;o<i;++o)t[n+o+4]=r[o];return 8*(n+4+i)},mu=function(t,e,r,i,n,o,s,a,l,u,c){cu(e,c++,r),++n[256];for(var h=du(n,15),d=h[0],v=h[1],f=du(o,15),p=f[0],g=f[1],m=fu(d),y=m[0],b=m[1],w=fu(p),_=w[0],C=w[1],I=new jl(19),S=0;S<y.length;++S)I[31&y[S]]++;for(S=0;S<_.length;++S)I[31&_[S]]++;for(var k=du(I,7),x=k[0],A=k[1],T=19;T>4&&!x[zl[T-1]];--T);var M,E,N,R,F=u+5<<3,O=pu(n,nu)+pu(o,ou)+s,P=pu(n,d)+pu(o,p)+s+14+3*T+pu(I,x)+(2*I[16]+3*I[17]+7*I[18]);if(F<=O&&F<=P)return gu(e,c,t.subarray(l,l+u));if(cu(e,c,1+(P<O)),c+=2,P<O){M=iu(d,v,0),E=d,N=iu(p,g,0),R=p;var L=iu(x,A,0);cu(e,c,b-257),cu(e,c+5,C-1),cu(e,c+10,T-4),c+=14;for(S=0;S<T;++S)cu(e,c+3*S,x[zl[S]]);c+=3*T;for(var D=[y,_],B=0;B<2;++B){var Z=D[B];for(S=0;S<Z.length;++S){var q=31&Z[S];cu(e,c,L[q]),c+=x[q],q>15&&(cu(e,c,Z[S]>>>5&127),c+=Z[S]>>>12)}}}else M=su,E=nu,N=au,R=ou;for(S=0;S<a;++S)if(i[S]>255){q=i[S]>>>18&31;hu(e,c,M[q+257]),c+=E[q+257],q>7&&(cu(e,c,i[S]>>>23&31),c+=Gl[q]);var H=31&i[S];hu(e,c,N[H]),c+=R[H],H>3&&(hu(e,c,i[S]>>>5&8191),c+=Wl[H])}else hu(e,c,M[i[S]]),c+=E[i[S]];return hu(e,c,M[256]),c+E[256]},yu=new Yl([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),bu=function(){for(var t=new Yl(256),e=0;e<256;++e){for(var r=e,i=9;--i;)r=(1&r&&3988292384)^r>>>1;t[e]=r}return t}(),wu=function(t,e,r,i,n){return function(t,e,r,i,n,o){var s=t.length,a=new Vl(i+s+5*(1+Math.floor(s/7e3))+n),l=a.subarray(i,a.length-n),u=0;if(!e||s<8)for(var c=0;c<=s;c+=65535){var h=c+65535;h<s?u=gu(l,u,t.subarray(c,h)):(l[c]=o,u=gu(l,u,t.subarray(c,s)))}else{for(var d=yu[e-1],v=d>>>13,f=8191&d,p=(1<<r)-1,g=new jl(32768),m=new jl(p+1),y=Math.ceil(r/3),b=2*y,w=function(e){return(t[e]^t[e+1]<<y^t[e+2]<<b)&p},_=new Yl(25e3),C=new jl(288),I=new jl(32),S=0,k=0,x=(c=0,0),A=0,T=0;c<s;++c){var M=w(c),E=32767&c,N=m[M];if(g[E]=N,m[M]=E,A<=c){var R=s-c;if((S>7e3||x>24576)&&R>423){u=mu(t,l,0,_,C,I,k,x,T,c-T,u),x=S=k=0,T=c;for(var F=0;F<286;++F)C[F]=0;for(F=0;F<30;++F)I[F]=0}var O=2,P=0,L=f,D=E-N&32767;if(R>2&&M==w(c-D))for(var B=Math.min(v,R)-1,Z=Math.min(32767,c),q=Math.min(258,R);D<=Z&&--L&&E!=N;){if(t[c+O]==t[c+O-D]){for(var H=0;H<q&&t[c+H]==t[c+H-D];++H);if(H>O){if(O=H,P=D,H>B)break;var V=Math.min(D,H-2),j=0;for(F=0;F<V;++F){var Y=c-D+F+32768&32767,G=Y-g[Y]+32768&32767;G>j&&(j=G,N=Y)}}}D+=(E=N)-(N=g[E])+32768&32767}if(P){_[x++]=268435456|Kl[O]<<18|Ql[P];var W=31&Kl[O],z=31&Ql[P];k+=Gl[W]+Wl[z],++C[257+W],++I[z],A=c+O,++S}else _[x++]=t[c],++C[t[c]]}}u=mu(t,l,o,_,C,I,k,x,T,c-T,u)}return uu(a,0,i+lu(u)+n)}(t,null==e.level?6:e.level,null==e.mem?Math.ceil(1.5*Math.max(8,Math.min(13,Math.log(t.length)))):12+e.mem,r,i,!0)},_u=function(t,e,r){for(;r;++e)t[e]=r,r>>>=8};function Cu(t,e){void 0===e&&(e={});var r=function(){var t=4294967295;return{p:function(e){for(var r=t,i=0;i<e.length;++i)r=bu[255&r^e[i]]^r>>>8;t=r},d:function(){return 4294967295^t}}}(),i=t.length;r.p(t);var n=wu(t,e,function(t){return 10+(t.filename&&t.filename.length+1||0)}(e),8),o=n.length;return function(t,e){var r=e.filename;if(t[0]=31,t[1]=139,t[2]=8,t[8]=e.level<2?4:9==e.level?2:0,t[9]=3,0!=e.mtime&&_u(t,4,Math.floor(new Date(e.mtime||Date.now())/1e3)),r){t[3]=8;for(var i=0;i<=r.length;++i)t[i+10]=r.charCodeAt(i)}}(n,e),_u(n,o-8,r.d()),_u(n,o-4,i),n}var Iu=function(t){var e,r,i,n,o="";for(e=r=0,i=(t=(t+"").replace(/\r\n/g,"\n").replace(/\r/g,"\n")).length,n=0;n<i;n++){var s=t.charCodeAt(n),a=null;s<128?r++:a=s>127&&s<2048?String.fromCharCode(s>>6|192,63&s|128):String.fromCharCode(s>>12|224,s>>6&63|128,63&s|128),ei(a)||(r>e&&(o+=t.substring(e,r)),o+=a,e=r=n+1)}return r>e&&(o+=t.substring(e,t.length)),o},Su=!!tn||!!Qi,ku="text/plain",xu=(t,e)=>{var[i,n]=t.split("?"),o=r({},e);null==n||n.split("&").forEach((t=>{var[e]=t.split("=");delete o[e]}));var s=xn(o);return i+"?"+(s=s?(n?n+"&":"")+s:n)},Au=(t,e)=>JSON.stringify(t,((t,e)=>"bigint"==typeof e?e.toString():e),e),Tu=t=>{var{data:e,compression:r}=t;if(e){if(r===Hl.GZipJS){var i=Cu(function(t,e){var r=t.length;if("undefined"!=typeof TextEncoder)return(new TextEncoder).encode(t);for(var i=new Vl(t.length+(t.length>>>1)),n=0,o=function(t){i[n++]=t},s=0;s<r;++s){if(n+5>i.length){var a=new Vl(n+8+(r-s<<1));a.set(i),i=a}var l=t.charCodeAt(s);l<128||e?o(l):l<2048?(o(192|l>>>6),o(128|63&l)):l>55295&&l<57344?(o(240|(l=65536+(1047552&l)|1023&t.charCodeAt(++s))>>>18),o(128|l>>>12&63),o(128|l>>>6&63),o(128|63&l)):(o(224|l>>>12),o(128|l>>>6&63),o(128|63&l))}return uu(i,0,n)}(Au(e)),{mtime:0}),n=new Blob([i],{type:ku});return{contentType:ku,body:n,estimatedSize:n.size}}if(r===Hl.Base64){var o=function(t){var e,r,i,n,o,s="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",a=0,l=0,u="",c=[];if(!t)return t;t=Iu(t);do{e=(o=t.charCodeAt(a++)<<16|t.charCodeAt(a++)<<8|t.charCodeAt(a++))>>18&63,r=o>>12&63,i=o>>6&63,n=63&o,c[l++]=s.charAt(e)+s.charAt(r)+s.charAt(i)+s.charAt(n)}while(a<t.length);switch(u=c.join(""),t.length%3){case 1:u=u.slice(0,-2)+"==";break;case 2:u=u.slice(0,-1)+"="}return u}(Au(e)),s=(t=>"data="+encodeURIComponent("string"==typeof t?t:Au(t)))(o);return{contentType:"application/x-www-form-urlencoded",body:s,estimatedSize:new Blob([s]).size}}var a=Au(e);return{contentType:"application/json",body:a,estimatedSize:new Blob([a]).size}}},Mu=[];Qi&&Mu.push({transport:"fetch",method:t=>{var e,i,{contentType:n,body:o,estimatedSize:s}=null!==(e=Tu(t))&&void 0!==e?e:{},a=new Headers;vn(t.headers,(function(t,e){a.append(e,t)})),n&&a.append("Content-Type",n);var l=t.url,u=null;if(en){var c=new en;u={signal:c.signal,timeout:setTimeout((()=>c.abort()),t.timeout)}}Qi(l,r({method:(null==t?void 0:t.method)||"GET",headers:a,keepalive:"POST"===t.method&&(s||0)<52428.8,body:o,signal:null==(i=u)?void 0:i.signal},t.fetchOptions)).then((e=>e.text().then((r=>{var i={statusCode:e.status,text:r};if(200===e.status)try{i.json=JSON.parse(r)}catch(t){un.error(t)}null==t.callback||t.callback(i)})))).catch((e=>{un.error(e),null==t.callback||t.callback({statusCode:0,text:e})})).finally((()=>u?clearTimeout(u.timeout):null))}}),tn&&Mu.push({transport:"XHR",method:t=>{var e,r=new tn;r.open(t.method||"GET",t.url,!0);var{contentType:i,body:n}=null!==(e=Tu(t))&&void 0!==e?e:{};vn(t.headers,(function(t,e){r.setRequestHeader(e,t)})),i&&r.setRequestHeader("Content-Type",i),t.timeout&&(r.timeout=t.timeout),t.disableXHRCredentials||(r.withCredentials=!0),r.onreadystatechange=()=>{if(4===r.readyState){var e={statusCode:r.status,text:r.responseText};if(200===r.status)try{e.json=JSON.parse(r.responseText)}catch(t){}null==t.callback||t.callback(e)}},r.send(n)}}),null!=Xi&&Xi.sendBeacon&&Mu.push({transport:"sendBeacon",method:t=>{var e=xu(t.url,{beacon:"1"});try{var r,{contentType:i,body:n}=null!==(r=Tu(t))&&void 0!==r?r:{},o="string"==typeof n?new Blob([n],{type:i}):n;Xi.sendBeacon(e,o)}catch(t){}}});var Eu=function(t,e){if(!function(t){try{new RegExp(t)}catch(t){return!1}return!0}(e))return!1;try{return new RegExp(e).test(t)}catch(t){return!1}};function Nu(t,e,r){return Au({distinct_id:t,userPropertiesToSet:e,userPropertiesToSetOnce:r})}var Ru={exact:(t,e)=>e.some((e=>t.some((t=>e===t)))),is_not:(t,e)=>e.every((e=>t.every((t=>e!==t)))),regex:(t,e)=>e.some((e=>t.some((t=>Eu(e,t))))),not_regex:(t,e)=>e.every((e=>t.every((t=>!Eu(e,t))))),icontains:(t,e)=>e.map(Fu).some((e=>t.map(Fu).some((t=>e.includes(t))))),not_icontains:(t,e)=>e.map(Fu).every((e=>t.map(Fu).every((t=>!e.includes(t)))))},Fu=t=>t.toLowerCase(),Ou=cn("[Stylesheet Loader]"),Pu=Yi,Lu=Ji;function Du(t){return"$survey_response_"+t}var Bu="#020617",Zu={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:ma.Right,widgetType:ga.Tab,widgetLabel:"Feedback",widgetColor:"black",zIndex:"2147483647",disabledButtonOpacity:"0.6",maxWidth:"300px",textSubtleColor:"#939393",boxPadding:"20px 24px",boxShadow:"0 4px 12px rgba(0, 0, 0, 0.15)",borderRadius:"10px",shuffleQuestions:!1,surveyPopupDelaySeconds:void 0,outlineColor:"rgba(59, 130, 246, 0.8)",inputBackground:"white",inputTextColor:Bu,scrollbarThumbColor:"var(--ph-survey-border-color)",scrollbarTrackColor:"var(--ph-survey-background-color)"};function $u(t){if("#"===t[0]){var e=t.replace(/^#/,"");return"rgb("+parseInt(e.slice(0,2),16)+","+parseInt(e.slice(2,4),16)+","+parseInt(e.slice(4,6),16)+")"}return"rgb(255, 255, 255)"}function qu(t){var e;void 0===t&&(t=Zu.backgroundColor),"#"===t[0]&&(e=$u(t)),t.startsWith("rgb")&&(e=t);var r={aliceblue:"#f0f8ff",antiquewhite:"#faebd7",aqua:"#00ffff",aquamarine:"#7fffd4",azure:"#f0ffff",beige:"#f5f5dc",bisque:"#ffe4c4",black:"#000000",blanchedalmond:"#ffebcd",blue:"#0000ff",blueviolet:"#8a2be2",brown:"#a52a2a",burlywood:"#deb887",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",cornflowerblue:"#6495ed",cornsilk:"#fff8dc",crimson:"#dc143c",cyan:"#00ffff",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkgray:"#a9a9a9",darkgreen:"#006400",darkkhaki:"#bdb76b",darkmagenta:"#8b008b",darkolivegreen:"#556b2f",darkorange:"#ff8c00",darkorchid:"#9932cc",darkred:"#8b0000",darksalmon:"#e9967a",darkseagreen:"#8fbc8f",darkslateblue:"#483d8b",darkslategray:"#2f4f4f",darkturquoise:"#00ced1",darkviolet:"#9400d3",deeppink:"#ff1493",deepskyblue:"#00bfff",dimgray:"#696969",dodgerblue:"#1e90ff",firebrick:"#b22222",floralwhite:"#fffaf0",forestgreen:"#228b22",fuchsia:"#ff00ff",gainsboro:"#dcdcdc",ghostwhite:"#f8f8ff",gold:"#ffd700",goldenrod:"#daa520",gray:"#808080",green:"#008000",greenyellow:"#adff2f",honeydew:"#f0fff0",hotpink:"#ff69b4","indianred ":"#cd5c5c",indigo:"#4b0082",ivory:"#fffff0",khaki:"#f0e68c",lavender:"#e6e6fa",lavenderblush:"#fff0f5",lawngreen:"#7cfc00",lemonchiffon:"#fffacd",lightblue:"#add8e6",lightcoral:"#f08080",lightcyan:"#e0ffff",lightgoldenrodyellow:"#fafad2",lightgrey:"#d3d3d3",lightgreen:"#90ee90",lightpink:"#ffb6c1",lightsalmon:"#ffa07a",lightseagreen:"#20b2aa",lightskyblue:"#87cefa",lightslategray:"#778899",lightsteelblue:"#b0c4de",lightyellow:"#ffffe0",lime:"#00ff00",limegreen:"#32cd32",linen:"#faf0e6",magenta:"#ff00ff",maroon:"#800000",mediumaquamarine:"#66cdaa",mediumblue:"#0000cd",mediumorchid:"#ba55d3",mediumpurple:"#9370d8",mediumseagreen:"#3cb371",mediumslateblue:"#7b68ee",mediumspringgreen:"#00fa9a",mediumturquoise:"#48d1cc",mediumvioletred:"#c71585",midnightblue:"#191970",mintcream:"#f5fffa",mistyrose:"#ffe4e1",moccasin:"#ffe4b5",navajowhite:"#ffdead",navy:"#000080",oldlace:"#fdf5e6",olive:"#808000",olivedrab:"#6b8e23",orange:"#ffa500",orangered:"#ff4500",orchid:"#da70d6",palegoldenrod:"#eee8aa",palegreen:"#98fb98",paleturquoise:"#afeeee",palevioletred:"#d87093",papayawhip:"#ffefd5",peachpuff:"#ffdab9",peru:"#cd853f",pink:"#ffc0cb",plum:"#dda0dd",powderblue:"#b0e0e6",purple:"#800080",red:"#ff0000",rosybrown:"#bc8f8f",royalblue:"#4169e1",saddlebrown:"#8b4513",salmon:"#fa8072",sandybrown:"#f4a460",seagreen:"#2e8b57",seashell:"#fff5ee",sienna:"#a0522d",silver:"#c0c0c0",skyblue:"#87ceeb",slateblue:"#6a5acd",slategray:"#708090",snow:"#fffafa",springgreen:"#00ff7f",steelblue:"#4682b4",tan:"#d2b48c",teal:"#008080",thistle:"#d8bfd8",tomato:"#ff6347",turquoise:"#40e0d0",violet:"#ee82ee",wheat:"#f5deb3",white:"#ffffff",whitesmoke:"#f5f5f5",yellow:"#ffff00",yellowgreen:"#9acd32"}[t.toLowerCase()];if(r&&(e=$u(r)),!e)return Bu;var i=e.match(/^rgba?\((\d+),\s*(\d+),\s*(\d+)(?:,\s*(\d+(?:\.\d+)?))?\)$/);if(i){var n=parseInt(i[1]),o=parseInt(i[2]),s=parseInt(i[3]);return Math.sqrt(n*n*.299+o*o*.587+s*s*.114)>127.5?Bu:"white"}return Bu}function Hu(t){var e=((t,e,r)=>{var i,n=t.createElement("style");return n.innerText=e,null!=r&&null!=(i=r.config)&&i.prepare_external_dependency_stylesheet&&(n=r.config.prepare_external_dependency_stylesheet(n)),n||(Ou.error("prepare_external_dependency_stylesheet returned null"),null)})(Lu,':host{--ph-survey-font-family:-apple-system,BlinkMacSystemFont,"Inter","Segoe UI","Roboto",Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol";--ph-survey-box-padding:20px 24px;--ph-survey-max-width:300px;--ph-survey-z-index:2147483647;--ph-survey-border-color:#dcdcdc;--ph-survey-border-bottom:1.5px solid var(--ph-survey-border-color);--ph-survey-border-radius:10px;--ph-survey-background-color:#eeeded;--ph-survey-box-shadow:0 4px 12px rgba(0,0,0,.15);--ph-survey-submit-button-color:#000;--ph-survey-submit-button-text-color:#fff;--ph-survey-rating-bg-color:#fff;--ph-survey-rating-text-color:#020617;--ph-survey-rating-active-bg-color:#000;--ph-survey-rating-active-text-color:#fff;--ph-survey-text-primary-color:#020617;--ph-survey-text-subtle-color:#939393;--ph-widget-color:#e0a045;--ph-widget-text-color:#fff;--ph-survey-scrollbar-thumb-color:var(--ph-survey-border-color);--ph-survey-scrollbar-track-color:var(--ph-survey-background-color);--ph-survey-outline-color:rgba(59,130,246,.8);--ph-survey-input-background:#fff;--ph-survey-input-text-color:#020617;--ph-survey-disabled-button-opacity:0.6}.ph-survey{bottom:0;height:fit-content;margin:0;max-width:85%;min-width:300px;position:fixed;width:var(--ph-survey-max-width);z-index:var(--ph-survey-z-index)}.ph-survey h3,.ph-survey p{margin:0}.ph-survey *{box-sizing:border-box;color:var(--ph-survey-text-primary-color);font-family:var(--ph-survey-font-family)}.ph-survey .multiple-choice-options label,.ph-survey input[type=text],.ph-survey textarea{background:var(--ph-survey-input-background);border:1.5px solid var(--ph-survey-border-color);border-radius:4px;color:var(--ph-survey-input-text-color);padding:10px;transition:border-color .2s ease-out,box-shadow .2s ease-out,transform .15s ease-out}.ph-survey input[type=text],.ph-survey textarea{transition:border-color .2s ease-out,box-shadow .2s ease-out,transform .15s ease-out}.ph-survey input{margin:0}.ph-survey .form-submit:focus,.ph-survey .form-submit:focus-visible,.ph-survey input[type=checkbox]:focus,.ph-survey input[type=checkbox]:focus-visible,.ph-survey input[type=radio]:focus,.ph-survey input[type=radio]:focus-visible,.ph-survey input[type=text]:focus,.ph-survey input[type=text]:focus-visible,.ph-survey textarea:focus,.ph-survey textarea:focus-visible{border-color:var(--ph-survey-rating-active-bg-color);outline:1.5px solid var(--ph-survey-outline-color);outline-offset:2px}.ph-survey button:focus:not(:focus-visible),.ph-survey input[type=checkbox]:focus:not(:focus-visible),.ph-survey input[type=radio]:focus:not(:focus-visible),.ph-survey input[type=text]:focus:not(:focus-visible),.ph-survey textarea:focus:not(:focus-visible){outline:none}.ph-survey input[type=text]:hover:not(:focus),.ph-survey textarea:hover:not(:focus){border-color:var(--ph-survey-rating-active-bg-color)}@media (max-width:768px){.ph-survey input[type=text],.ph-survey textarea{font-size:1rem}}.ph-survey .form-cancel,.ph-survey .multiple-choice-options label,.ph-survey .rating-options-number,.ph-survey input[type=checkbox],.ph-survey input[type=radio]{border:1.5px solid var(--ph-survey-border-color)}.ph-survey .footer-branding,.ph-survey .form-cancel,.ph-survey .form-submit,.ph-survey .ratings-emoji,.ph-survey .ratings-number,.ph-survey input[type=checkbox],.ph-survey input[type=radio],.ph-survey label{transition:all .2s ease-out}@media (prefers-reduced-motion:no-preference){.ph-survey button:active,.ph-survey input[type=checkbox]:active,.ph-survey input[type=radio]:active,.ph-survey label:active{transition-duration:.1s}}.ph-survey-widget-tab{background:var(--ph-widget-color);border:none;border-radius:3px 3px 0 0;color:var(--ph-widget-text-color);cursor:pointer;padding:10px 12px;position:fixed;right:0;text-align:center;top:50%;transform:rotate(-90deg) translateY(-100%);transform-origin:right top;transition:padding-bottom .2s ease-out;z-index:var(--ph-survey-z-index)}.ph-survey-widget-tab:hover{padding-bottom: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}.question-textarea-wrapper{display:flex;flex-direction:column}.survey-form{animation:ph-survey-fade-in .3s ease-out forwards}.survey-form,.thank-you-message{background:var(--ph-survey-background-color);border:1.5px solid var(--ph-survey-border-color);border-bottom:var(--ph-survey-border-bottom);border-radius:var(--ph-survey-border-radius);box-shadow:var(--ph-survey-box-shadow);margin:0;padding:var(--ph-survey-box-padding);position:relative;text-align:left;width:100%;z-index:var(--ph-survey-z-index)}.survey-form input[type=text],.survey-form textarea{min-width:100%}:is(.survey-form textarea):focus,:is(.survey-form textarea):focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.08)}:is(.survey-form textarea):focus:not(:focus-visible){box-shadow:none}.survey-box:has(.survey-question:empty):not(:has(.survey-question-description)) .multiple-choice-options,.survey-box:has(.survey-question:empty):not(:has(.survey-question-description)) textarea{margin-top:0}.multiple-choice-options{border:none;display:flex;flex-direction:column;font-size:14px;gap:8px;margin:0;padding:1px 0}.multiple-choice-options .response-choice,.multiple-choice-options label{align-items:center;color:inherit;display:flex;gap:8px}.multiple-choice-options label{cursor:pointer;font-size:13px}:is(.multiple-choice-options label):hover:not(:has(input:checked)){border-color:var(--ph-survey-text-subtle-color);box-shadow:0 2px 8px rgba(0,0,0,.08)}:is(.multiple-choice-options label):has(input:checked){border-color:var(--ph-survey-rating-active-bg-color);box-shadow:0 1px 4px rgba(0,0,0,.05)}.choice-option-open:is(.multiple-choice-options label){flex-wrap:wrap}:is(.multiple-choice-options label) span{color:inherit}.multiple-choice-options input[type=checkbox],.multiple-choice-options input[type=radio]{appearance:none;-webkit-appearance:none;-moz-appearance:none;background:var(--ph-survey-input-background);border-radius:3px;cursor:pointer;flex-shrink:0;height:1rem;position:relative;transition:all .2s cubic-bezier(.4,0,.2,1),transform .15s ease-out;width:1rem;z-index:1}:is(.multiple-choice-options input[type=checkbox],.multiple-choice-options input[type=radio]):focus{transform:scale(1.05)}:is(.multiple-choice-options input[type=checkbox],.multiple-choice-options input[type=radio]):hover{border-color:var(--ph-survey-rating-active-bg-color);transform:scale(1.05)}:is(.multiple-choice-options input[type=checkbox],.multiple-choice-options input[type=radio]):active{transform:scale(.95)}:is(.multiple-choice-options input[type=checkbox],.multiple-choice-options input[type=radio]):checked{background:var(--ph-survey-rating-active-bg-color);border-color:var(--ph-survey-rating-active-bg-color);transform:scale(1)}:is(.multiple-choice-options input[type=checkbox],.multiple-choice-options input[type=radio]):checked:hover{transform:scale(1.05)}.multiple-choice-options input[type=checkbox]:checked:after{animation:ph-survey-checkmark-reveal .2s ease-out .1s forwards;border:solid var(--ph-survey-rating-active-text-color);border-width:0 2px 2px 0;height:8px;left:4px;transform:rotate(45deg) scale(0);width:4px}.multiple-choice-options input[type=radio]:checked:after{animation:ph-survey-radio-reveal .15s ease-out .05s forwards;background:var(--ph-survey-rating-active-text-color);border-radius:50%;height:6px;left:5px;top:5px;transform:scale(0);width:6px}.multiple-choice-options input[type=checkbox]:checked:after,.multiple-choice-options input[type=radio]:checked:after{box-sizing:content-box;content:"";position:absolute}.multiple-choice-options input[type=radio]{border-radius:50%}.multiple-choice-options input[type=radio]:checked{border:none}:is(.multiple-choice-options input[type=checkbox]:checked,.multiple-choice-options input[type=radio]:checked)~*{font-weight:700}:is(:is(.multiple-choice-options .choice-option-open) input[type=text])::placeholder{color:var(--ph-survey-text-subtle-color);font-weight:400}.rating-options-emoji{display:flex;justify-content:space-between}.ratings-emoji{background-color:transparent;border:none;font-size:16px;opacity:.5;padding:0}.ratings-emoji:hover{cursor:pointer;opacity:1;transform:scale(1.15)}.ratings-emoji.rating-active{opacity:1}.ratings-emoji svg{fill:var(--ph-survey-text-primary-color);transition:fill .2s ease-out}.rating-options-number{border-radius:6px;display:grid;grid-auto-columns:1fr;grid-auto-flow:column;overflow:hidden}.rating-options-number .ratings-number{border:none;border-right:1px solid var(--ph-survey-border-color);color:var(--ph-survey-rating-text-color);cursor:pointer;font-weight:700;text-align:center}:is(.rating-options-number .ratings-number):last-of-type{border-right:0}.rating-active:is(.rating-options-number .ratings-number){background:var(--ph-survey-rating-active-bg-color);color:var(--ph-survey-rating-active-text-color)}.ratings-number{background-color:var(--ph-survey-rating-bg-color);border:none;padding:8px 0}.ratings-number .rating-active{background-color:var(--ph-survey-rating-active-bg-color)}.ratings-number:hover{cursor:pointer}.rating-text{display:flex;flex-direction:row;font-size:11px;justify-content:space-between;opacity:.7}.form-submit{background:var(--ph-survey-submit-button-color);border:none;border-radius:6px;box-shadow:0 2px 0 rgba(0,0,0,.045);color:var(--ph-survey-submit-button-text-color);cursor:pointer;font-weight:700;min-width:100%;padding:12px;text-align:center;user-select:none}.form-submit:not([disabled]):hover{box-shadow:0 4px 8px rgba(0,0,0,.1);transform:scale(1.02)}.form-submit:not([disabled]):active{box-shadow:0 1px 2px rgba(0,0,0,.05);transform:scale(.98)}.form-submit[disabled]{cursor:not-allowed;opacity:var(--ph-survey-disabled-button-opacity)}.form-cancel{background:#fff;border-radius:100%;cursor:pointer;line-height:0;padding:12px;position:absolute;right:0;top:0;transform:translate(50%,-50%)}.form-cancel:hover{opacity:.7;transform:translate(50%,-50%) scale(1.1)}.footer-branding{align-items:center;display:flex;font-size:11px;font-weight:500;gap:4px;justify-content:center;opacity:.6;text-decoration:none}.footer-branding:hover{opacity:1}.footer-branding a{text-decoration:none}.thank-you-message{text-align:center}.thank-you-message-header{margin:10px 0 0}.thank-you-message-body{font-size:14px;opacity:.8}.limit-height{max-height:256px;overflow-x:hidden;overflow-y:auto;scrollbar-color:var(--ph-survey-scrollbar-thumb-color) var(--ph-survey-scrollbar-track-color);scrollbar-width:thin}.limit-height::-webkit-scrollbar{width:8px}.limit-height::-webkit-scrollbar-track{background:var(--ph-survey-scrollbar-track-color);border-radius:4px}.limit-height::-webkit-scrollbar-thumb{background-color:var(--ph-survey-scrollbar-thumb-color);border:2px solid var(--ph-survey-scrollbar-track-color);border-radius:4px}:is(.limit-height::-webkit-scrollbar-thumb):hover{background-color:var(--ph-survey-text-subtle-color)}.sr-only{clip:rect(0,0,0,0);border:0;height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;white-space:nowrap;width:1px}@media (prefers-reduced-motion:reduce){.ph-survey *{animation-duration:.01ms!important;animation-iteration-count:1!important;scroll-behavior:auto!important;transition-duration:.01ms!important}}@keyframes ph-survey-checkmark-reveal{0%{opacity:0;transform:rotate(45deg) scale(0)}50%{opacity:1;transform:rotate(45deg) scale(1.2)}to{opacity:1;transform:rotate(45deg) scale(1)}}@keyframes ph-survey-radio-reveal{0%{opacity:0;transform:scale(0)}50%{opacity:1;transform:scale(1.3)}to{opacity:1;transform:scale(1)}}',t);return null==e||e.setAttribute("data-ph-survey-style","true"),e}var Vu=(t,e,i)=>{var n=ac(t),o=Lu.querySelector("."+n);if(o&&o.shadowRoot)return{shadow:o.shadowRoot,isNewlyCreated:!1};var s=Lu.createElement("div");((t,e,i)=>{var n=r({},Zu,i),o=t.style,s=![ma.Center,ma.Left,ma.Right].includes(n.position)||e===ya.Widget&&(null==i?void 0:i.widgetType)===ga.Tab;o.setProperty("--ph-survey-font-family",function(t){if("inherit"===t)return"inherit";var e='BlinkMacSystemFont, "Inter", "Segoe UI", "Roboto", Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol"';return t?t+", "+e:"-apple-system, "+e}(n.fontFamily)),o.setProperty("--ph-survey-box-padding",n.boxPadding),o.setProperty("--ph-survey-max-width",n.maxWidth),o.setProperty("--ph-survey-z-index",n.zIndex),o.setProperty("--ph-survey-border-color",n.borderColor),s?(o.setProperty("--ph-survey-border-radius",n.borderRadius),o.setProperty("--ph-survey-border-bottom","1.5px solid var(--ph-survey-border-color)")):(o.setProperty("--ph-survey-border-bottom","none"),o.setProperty("--ph-survey-border-radius",n.borderRadius+" "+n.borderRadius+" 0 0")),o.setProperty("--ph-survey-background-color",n.backgroundColor),o.setProperty("--ph-survey-box-shadow",n.boxShadow),o.setProperty("--ph-survey-disabled-button-opacity",n.disabledButtonOpacity),o.setProperty("--ph-survey-submit-button-color",n.submitButtonColor),o.setProperty("--ph-survey-submit-button-text-color",(null==i?void 0:i.submitButtonTextColor)||qu(n.submitButtonColor)),o.setProperty("--ph-survey-rating-bg-color",n.ratingButtonColor),o.setProperty("--ph-survey-rating-text-color",qu(n.ratingButtonColor)),o.setProperty("--ph-survey-rating-active-bg-color",n.ratingButtonActiveColor),o.setProperty("--ph-survey-rating-active-text-color",qu(n.ratingButtonActiveColor)),o.setProperty("--ph-survey-text-primary-color",qu(n.backgroundColor)),o.setProperty("--ph-survey-text-subtle-color",n.textSubtleColor),o.setProperty("--ph-widget-color",n.widgetColor),o.setProperty("--ph-widget-text-color",qu(n.widgetColor)),o.setProperty("--ph-widget-z-index",n.zIndex),"white"===n.backgroundColor&&o.setProperty("--ph-survey-input-background","#f8f8f8"),o.setProperty("--ph-survey-input-background",n.inputBackground),o.setProperty("--ph-survey-input-text-color",qu(n.inputBackground)),o.setProperty("--ph-survey-scrollbar-thumb-color",n.scrollbarThumbColor),o.setProperty("--ph-survey-scrollbar-track-color",n.scrollbarTrackColor),o.setProperty("--ph-survey-outline-color",n.outlineColor)})(s,t.type,t.appearance),s.className=n;var a=s.attachShadow({mode:"open"}),l=Hu(e);if(l){var u=a.querySelector("style");u&&a.removeChild(u),a.appendChild(l)}return Lu.body.appendChild(s),{shadow:a,isNewlyCreated:!0}},ju=(t,e)=>{if(!e)return null;var r=t[Du(e)];return Wr(r)?[...r]:r},Yu=t=>{var{responses:e,survey:i,surveySubmissionId:n,posthog:o,isSurveyCompleted:s}=t;o?(Fa(i),o.capture(Ca.SENT,r({[Ia.SURVEY_NAME]:i.name,[Ia.SURVEY_ID]:i.id,[Ia.SURVEY_ITERATION]:i.current_iteration,[Ia.SURVEY_ITERATION_START_DATE]:i.current_iteration_start_date,[Ia.SURVEY_QUESTIONS]:i.questions.map((t=>({id:t.id,question:t.question,response:ju(e,t.id)}))),[Ia.SURVEY_SUBMISSION_ID]:n,[Ia.SURVEY_COMPLETED]:s,sessionRecordingUrl:null==o.get_session_replay_url?void 0:o.get_session_replay_url()},e,{$set:{[Na(i,"responded")]:!0}})),s&&(Pu.dispatchEvent(new CustomEvent("PHSurveySent",{detail:{surveyId:i.id}})),sc(i))):ka.error("[survey sent] event not captured, PostHog instance not found.")},Gu=(t,e,i)=>{if(e){if(!i){var n=nc(t);e.capture(Ca.DISMISSED,r({[Ia.SURVEY_NAME]:t.name,[Ia.SURVEY_ID]:t.id,[Ia.SURVEY_ITERATION]:t.current_iteration,[Ia.SURVEY_ITERATION_START_DATE]:t.current_iteration_start_date,[Ia.SURVEY_PARTIALLY_COMPLETED]:Object.values((null==n?void 0:n.responses)||{}).filter((t=>!ri(t))).length>0,sessionRecordingUrl:null==e.get_session_replay_url?void 0:e.get_session_replay_url()},null==n?void 0:n.responses,{[Ia.SURVEY_SUBMISSION_ID]:null==n?void 0:n.surveySubmissionId,[Ia.SURVEY_QUESTIONS]:t.questions.map((t=>({id:t.id,question:t.question,response:ju((null==n?void 0:n.responses)||{},t.id)}))),$set:{[Na(t,"dismissed")]:!0}})),sc(t),Fa(t),Pu.dispatchEvent(new CustomEvent("PHSurveyClosed",{detail:{surveyId:t.id}}))}}else ka.error("[survey dismissed] event not captured, PostHog instance not found.")},Wu=t=>t.map((t=>({sort:Math.floor(10*Math.random()),value:t}))).sort(((t,e)=>t.sort-e.sort)).map((t=>t.value)),zu=(t,e)=>t.length===e.length&&t.every(((t,r)=>t===e[r]))?e.reverse():e,Uu=t=>t.appearance&&t.appearance.shuffleQuestions&&!t.enable_partial_responses?zu(t.questions,Wu(t.questions)):t.questions,Xu=t=>{var e;return!(null==(e=t.conditions)||null==(e=e.events)||!e.repeatedActivation||!(t=>{var e,r;return null!=(null==(e=t.conditions)||null==(e=e.events)||null==(e=e.values)?void 0:e.length)&&(null==(r=t.conditions)||null==(r=r.events)||null==(r=r.values)?void 0:r.length)>0})(t))||t.schedule===_a.Always||oc(t)},Ju=function(t,e){var r={__c:e="__cC"+gs++,__:t,Consumer:function(t,e){return t.children(e)},Provider:function(t){var r,i;return this.getChildContext||(r=[],(i={})[e]=this,this.getChildContext=function(){return i},this.shouldComponentUpdate=function(t){this.props.value!==t.value&&r.some((function(t){t.__e=!0,Ms(t)}))},this.sub=function(t){r.push(t);var e=t.componentWillUnmount;t.componentWillUnmount=function(){r.splice(r.indexOf(t),1),e&&e.call(t)}}),t.children}};return r.Provider.__=r.Consumer.contextType=r}({isPreviewMode:!1,previewPageIndex:0,onPopupSurveyDismissed:()=>{},isPopup:!0,onPreviewSubmit:()=>{},surveySubmissionId:""}),Ku=()=>la(Ju),Qu=t=>{var{component:e,children:r,renderAsHtml:i,style:n}=t;return js(e,i?{dangerouslySetInnerHTML:{__html:r},style:n}:{children:r,style:n})};function tc(t){return null!=t?t:"icontains"}function ec(t){var e,r,i;if(null==(e=t.conditions)||!e.url)return!0;var n=null==Pu||null==(r=Pu.location)?void 0:r.href;if(!n)return!1;var o=[t.conditions.url],s=tc(null==(i=t.conditions)?void 0:i.urlMatchType);return Ru[s](o,[n])}var rc=t=>{var e=""+Ea+t.id;return t.current_iteration&&t.current_iteration>0&&(e=""+Ea+t.id+"_"+t.current_iteration),e},ic=(t,e)=>{try{localStorage.setItem(rc(t),JSON.stringify(e))}catch(t){ka.error("Error setting in-progress survey state in localStorage",t)}},nc=t=>{try{var e=localStorage.getItem(rc(t));if(e)return JSON.parse(e)}catch(t){ka.error("Error getting in-progress survey state from localStorage",t)}return null},oc=t=>{var e=nc(t);return!ri(null==e?void 0:e.surveySubmissionId)},sc=t=>{try{localStorage.removeItem(rc(t))}catch(t){ka.error("Error clearing in-progress survey state from localStorage",t)}};function ac(t,e){void 0===e&&(e=!1);var r="PostHogSurvey-"+t.id;return e?"."+r:r}var lc=0;function uc(t,e,r,i,n,o){var s,a,l={};for(a in e)"ref"==a?s=e[a]:l[a]=e[a];var u={type:t,props:l,key:r,ref:s,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,constructor:void 0,__v:--lc,__i:-1,__u:0,__source:n,__self:o};if("function"==typeof t&&(s=t.defaultProps))for(a in s)void 0===l[a]&&(l[a]=s[a]);return cs.vnode&&cs.vnode(u),u}var cc=uc("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 -960 960 960",width:"48",children:uc("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"})}),hc=uc("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 -960 960 960",width:"48",children:uc("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"})}),dc=uc("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 -960 960 960",width:"48",children:uc("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"})}),vc=uc("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 -960 960 960",width:"48",children:uc("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"})}),fc=uc("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 -960 960 960",width:"48",children:uc("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"})}),pc=uc("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-labelledby":"close-survey-title",children:[uc("title",{id:"close-survey-title",children:"Close survey"}),uc("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M0.164752 0.164752C0.384422 -0.0549175 0.740578 -0.0549175 0.960248 0.164752L6 5.20451L11.0398 0.164752C11.2594 -0.0549175 11.6156 -0.0549175 11.8352 0.164752C12.0549 0.384422 12.0549 0.740578 11.8352 0.960248L6.79549 6L11.8352 11.0398C12.0549 11.2594 12.0549 11.6156 11.8352 11.8352C11.6156 12.0549 11.2594 12.0549 11.0398 11.8352L6 6.79549L0.960248 11.8352C0.740578 12.0549 0.384422 12.0549 0.164752 11.8352C-0.0549175 11.6156 -0.0549175 11.2594 0.164752 11.0398L5.20451 6L0.164752 0.960248C-0.0549175 0.740578 -0.0549175 0.384422 0.164752 0.164752Z",fill:"black"})]}),gc=uc("svg",{width:"77",height:"14",viewBox:"0 0 77 14",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[uc("g",{"clip-path":"url(#clip0_2415_6911)",children:[uc("mask",{id:"mask0_2415_6911",style:{maskType:"luminance"},maskUnits:"userSpaceOnUse",x:"0",y:"0",width:"77",height:"14",children:uc("path",{d:"M0.5 0H76.5V14H0.5V0Z",fill:"white"})}),uc("g",{mask:"url(#mask0_2415_6911)",children:[uc("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"}),uc("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"}),uc("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"}),uc("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"}),uc("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"}),uc("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"})]})]}),uc("defs",{children:uc("clipPath",{id:"clip0_2415_6911",children:uc("rect",{width:"76",height:"14",fill:"white",transform:"translate(0.5)"})})})]});function mc(){return uc("a",{href:"https://posthog.com/surveys",target:"_blank",rel:"noopener",className:"footer-branding",children:["Survey by ",gc]})}function yc(t){var{text:e,submitDisabled:r,appearance:i,onSubmit:n,link:o,onPreviewSubmit:s,skipSubmitButton:a}=t,{isPreviewMode:l}=la(Ju);return uc("div",{className:"bottom-section",children:[!a&&uc("button",{className:"form-submit",disabled:r,"aria-label":"Submit survey",type:"button",onClick:()=>{o&&(null==Yi||Yi.open(o)),l?null==s||s():n()},children:e}),!i.whiteLabel&&uc(mc,{})]})}function bc(t){var{question:e,forceDisableHtml:r,htmlFor:i}=t;return uc("div",{class:"question-header",children:[uc(e.type===ba.Open?"label":"h3",{className:"survey-question",htmlFor:i,children:e.question}),e.description&&Qu({component:Is("p",{className:"survey-question-description"}),children:e.description,renderAsHtml:!r&&"text"!==e.descriptionContentType})]})}function wc(t){var{onClick:e}=t,{isPreviewMode:r}=la(Ju);return uc("button",{className:"form-cancel",onClick:e,disabled:r,"aria-label":"Close survey",type:"button",children:pc})}uc("svg",{width:"16",height:"12",viewBox:"0 0 16 12",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:uc("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 _c=Yi;function Cc(t){var{header:e,description:r,contentType:i,forceDisableHtml:n,appearance:o,onClose:s}=t,{isPopup:a}=la(Ju);return oa((()=>{var t=t=>{"Enter"!==t.key&&"Escape"!==t.key||(t.preventDefault(),s())};return Sn(_c,"keydown",t),()=>{_c.removeEventListener("keydown",t)}}),[s]),uc("div",{className:"thank-you-message",role:"status",tabIndex:0,"aria-atomic":"true",children:[a&&uc(wc,{onClick:()=>s()}),uc("h3",{className:"thank-you-message-header",children:e}),r&&Qu({component:Is("p",{className:"thank-you-message-body"}),children:r,renderAsHtml:!n&&"text"!==i}),a&&uc(yc,{text:o.thankYouMessageCloseButtonText||"Close",submitDisabled:!1,appearance:o,onSubmit:()=>s()})]})}var Ic=t=>Wr(t)&&t.every((t=>Qr(t)));function Sc(t){var{question:e,forceDisableHtml:r,appearance:i,onSubmit:n,onPreviewSubmit:o,displayQuestionIndex:s,initialValue:a}=t,{isPreviewMode:l}=Ku(),u=sa(null),[c,h]=na((()=>Qr(a)?a:""));oa((()=>{setTimeout((()=>{var t;l||(null==(t=u.current)||t.focus())}),100)}),[l]);var d="surveyQuestion"+s;return uc(ks,{children:[uc("div",{className:"question-container",children:[uc(bc,{question:e,forceDisableHtml:r,htmlFor:d}),uc("textarea",{ref:u,id:d,rows:4,placeholder:null==i?void 0:i.placeholder,onInput:t=>{h(t.currentTarget.value),t.stopPropagation()},onKeyDown:t=>{t.stopPropagation()},value:c})]}),uc(yc,{text:e.buttonText||"Submit",submitDisabled:!c&&!e.optional,appearance:i,onSubmit:()=>n(c),onPreviewSubmit:()=>o(c)})]})}function kc(t){var{question:e,forceDisableHtml:r,appearance:i,onSubmit:n,onPreviewSubmit:o}=t;return uc(ks,{children:[uc("div",{className:"question-container",children:uc(bc,{question:e,forceDisableHtml:r})}),uc(yc,{text:e.buttonText||"Submit",submitDisabled:!1,link:e.link,appearance:i,onSubmit:()=>n("link clicked"),onPreviewSubmit:()=>o("link clicked")})]})}function xc(t){var{question:e,forceDisableHtml:r,displayQuestionIndex:i,appearance:n,onSubmit:o,onPreviewSubmit:s,initialValue:a}=t,l=e.scale,u=10===e.scale?0:1,[c,h]=na((()=>ii(a)?a:Wr(a)&&a.length>0&&ii(parseInt(a[0]))?parseInt(a[0]):Qr(a)&&ii(parseInt(a))?parseInt(a):null)),{isPreviewMode:d}=Ku(),v=t=>d?s(t):o(t);return uc(ks,{children:[uc("div",{className:"question-container",children:[uc(bc,{question:e,forceDisableHtml:r}),uc("div",{className:"rating-section",children:[uc("div",{className:"rating-options",children:["emoji"===e.display&&uc("div",{className:"rating-options-emoji",children:(3===e.scale?Mc:Ec).map(((t,r)=>uc("button",{"aria-label":"Rate "+(r+1),className:"ratings-emoji question-"+i+"-rating-"+r+" "+(r+1===c?"rating-active":""),value:r+1,type:"button",onClick:()=>{var t=r+1;h(t),e.skipSubmitButton&&v(t)},children:t},r)))}),"number"===e.display&&uc("div",{className:"rating-options-number",style:{gridTemplateColumns:"repeat("+(l-u+1)+", minmax(0, 1fr))"},children:Oc(e.scale).map(((t,r)=>uc(Ac,{displayQuestionIndex:i,active:c===t,appearance:n,num:t,setActiveNumber:t=>{h(t),e.skipSubmitButton&&v(t)}},r)))})]}),uc("div",{className:"rating-text",children:[uc("div",{children:e.lowerBoundLabel}),uc("div",{children:e.upperBoundLabel})]})]})]}),uc(yc,{text:e.buttonText||(null==n?void 0:n.submitButtonText)||"Submit",submitDisabled:ei(c)&&!e.optional,appearance:n,onSubmit:()=>o(c),onPreviewSubmit:()=>s(c),skipSubmitButton:e.skipSubmitButton})]})}function Ac(t){var{num:e,active:r,displayQuestionIndex:i,setActiveNumber:n}=t;return uc("button",{"aria-label":"Rate "+e,className:"ratings-number question-"+i+"-rating-"+e+" "+(r?"rating-active":""),type:"button",onClick:()=>{n(e)},children:e})}function Tc(t){var{question:e,forceDisableHtml:i,displayQuestionIndex:n,appearance:o,onSubmit:s,onPreviewSubmit:a,initialValue:l}=t,u=sa(null),c=aa((()=>(t=>{if(!t.shuffleOptions)return t.choices;var e=t.choices,r="";t.hasOpenChoice&&(r=e.pop());var i=zu(e,Wu(e));return t.hasOpenChoice&&(t.choices.push(r),i.push(r)),i})(e)),[e]),[h,d]=na((()=>((t,e)=>Qr(t)||Ic(t)?t:e===ba.SingleChoice?null:[])(l,e.type))),[v,f]=na((()=>((t,e)=>{if(Qr(t)&&!e.includes(t))return{isSelected:!0,inputValue:t};if(Ic(t)){var r=t.find((t=>!e.includes(t)));if(r)return{isSelected:!0,inputValue:r}}return{isSelected:!1,inputValue:""}})(l,c))),{isPreviewMode:p}=Ku(),g=e.type===ba.SingleChoice,m=e.type===ba.MultipleChoice,y=e.skipSubmitButton&&g&&!e.hasOpenChoice,b=(t,e)=>{if(e){var i=!v.isSelected;return f((t=>r({},t,{isSelected:i,inputValue:i?t.inputValue:""}))),g&&d(""),void(i&&setTimeout((()=>{var t;return null==(t=u.current)?void 0:t.focus()}),75))}if(g)return d(t),f((t=>r({},t,{isSelected:!1,inputValue:""}))),void(y&&(s(t),p&&a(t)));m&&Wr(h)&&(h.includes(t)?d(h.filter((e=>e!==t))):d([...h,t]))},w=t=>{t.stopPropagation();var e=t.currentTarget.value;f((t=>r({},t,{inputValue:e}))),g&&d(e)},_=t=>{t.stopPropagation(),"Enter"!==t.key||C()||(t.preventDefault(),I()),"Escape"===t.key&&(t.preventDefault(),f((t=>r({},t,{isSelected:!1,inputValue:""}))),g&&d(null))},C=()=>!e.optional&&(!!ei(h)||(!(!Wr(h)||v.isSelected||0!==h.length)||!(!v.isSelected||""!==v.inputValue.trim()))),I=()=>{v.isSelected&&m?Wr(h)&&(p?a([...h,v.inputValue]):s([...h,v.inputValue])):p?a(h):s(h)};return uc(ks,{children:[uc("div",{className:"question-container",children:[uc(bc,{question:e,forceDisableHtml:i}),uc("fieldset",{className:"multiple-choice-options limit-height",children:[uc("legend",{className:"sr-only",children:m?" Select all that apply":" Select one"}),c.map(((t,r)=>{var i=!!e.hasOpenChoice&&r===e.choices.length-1,o="surveyQuestion"+n+"Choice"+r,s=o+"Open",a=i?v.isSelected:g?h===t:Wr(h)&&h.includes(t);return uc("label",{className:i?"choice-option-open":"",children:[uc("div",{className:"response-choice",children:[uc("input",{type:g?"radio":"checkbox",name:o,checked:a,onChange:()=>b(t,i),id:o,"aria-controls":s}),uc("span",{children:i?t+":":t})]}),i&&uc("input",{type:"text",ref:u,id:s,name:"question"+n+"Open",value:v.inputValue,onKeyDown:_,onInput:w,onClick:e=>{v.isSelected||b(t,!0),e.stopPropagation()},"aria-label":t+" - please specify"})]},r)}))]})]}),uc(yc,{text:e.buttonText||"Submit",submitDisabled:C(),appearance:o,onSubmit:I,onPreviewSubmit:I,skipSubmitButton:y})]})}var Mc=[dc,hc,cc],Ec=[vc,dc,hc,cc,fc],Nc=[1,2,3,4,5],Rc=[1,2,3,4,5,6,7],Fc=[0,1,2,3,4,5,6,7,8,9,10];function Oc(t){switch(t){case 5:default:return Nc;case 7:return Rc;case 10:return Fc}}var Pc=Yi,Lc=Ji,Dc="ph:show_survey_widget",Bc="PHWidgetSurveyClickListener";function Zc(t,e,r){var i,n=t.questions[e],o=e+1;if(null==(i=n.branching)||!i.type)return e===t.questions.length-1?wa.End:o;if(n.branching.type===wa.End)return wa.End;if(n.branching.type===wa.SpecificQuestion){if(Number.isInteger(n.branching.index))return n.branching.index}else if(n.branching.type===wa.ResponseBased){if(n.type===ba.SingleChoice){var s,a=n.choices.indexOf(""+r);if(-1===a&&n.hasOpenChoice&&(a=n.choices.length-1),null!=(s=n.branching)&&null!=(s=s.responseValues)&&s.hasOwnProperty(a)){var l=n.branching.responseValues[a];return Number.isInteger(l)?l:l===wa.End?wa.End:o}}else if(n.type===ba.Rating){var u;if("number"!=typeof r||!Number.isInteger(r))throw new Error("The response type must be an integer");var c=function(t,e){if(3===e){if(t<1||t>3)throw new Error("The response must be in range 1-3");return 1===t?"negative":2===t?"neutral":"positive"}if(5===e){if(t<1||t>5)throw new Error("The response must be in range 1-5");return t<=2?"negative":3===t?"neutral":"positive"}if(7===e){if(t<1||t>7)throw new Error("The response must be in range 1-7");return t<=3?"negative":4===t?"neutral":"positive"}if(10===e){if(t<0||t>10)throw new Error("The response must be in range 0-10");return t<=6?"detractors":t<=8?"passives":"promoters"}throw new Error("The scale must be one of: 3, 5, 7, 10")}(r,n.scale);if(null!=(u=n.branching)&&null!=(u=u.responseValues)&&u.hasOwnProperty(c)){var h=n.branching.responseValues[c];return Number.isInteger(h)?h:h===wa.End?wa.End:o}}return o}return ka.warn("Falling back to next question index due to unexpected branching type"),o}var $c=250,qc=20,Hc=12;class Vc{constructor(t){var e=this;this.Z=new Map,this.$=new Map,this.handlePopoverSurvey=t=>{var e;this.q(t.id),this.H(t);var i=(null==(e=t.appearance)?void 0:e.surveyPopupDelaySeconds)||0,{shadow:n}=Vu(t,this._posthog);if(i<=0)return Vs(uc(Wc,{posthog:this._posthog,survey:t,removeSurveyFromFocus:this.V}),n);var o=setTimeout((()=>{if(!ec(t))return this.V(t);Vs(uc(Wc,{posthog:this._posthog,survey:r({},t,{appearance:r({},t.appearance,{surveyPopupDelaySeconds:0})}),removeSurveyFromFocus:this.V}),n)}),1e3*i);this.Z.set(t.id,o)},this.j=t=>{var{shadow:e,isNewlyCreated:r}=Vu(t,this._posthog);r&&Vs(uc(Uc,{posthog:this._posthog,survey:t},t.id),e)},this.Y=t=>{this.G(t);var e=this.$.get(t.id);e&&(e.element.removeEventListener("click",e.listener),e.element.removeAttribute(Bc),this.$.delete(t.id),ka.info("Removed click listener for survey "+t.id))},this.W=(t,e)=>{var r=Lc.querySelector(e),i=this.$.get(t.id);if(r){if(this.j(t),i){if(r===i.element)return;ka.info("Selector element changed for survey "+t.id+". Re-attaching listener."),this.Y(t)}if(!r.hasAttribute(Bc)){var n=e=>{var r,i;e.stopPropagation();var n=(null==(r=t.appearance)?void 0:r.position)===ma.NextToTrigger?function(t,e){try{var r=t.getBoundingClientRect(),i=Pc.innerHeight,n=Pc.innerWidth,o=$c,s=r.left+r.width/2-e/2;s+e>n-qc&&(s=n-e-qc),s<qc&&(s=qc);var a=Hc,l=i-r.bottom,u=r.top,c=l<o&&u>l;return{position:"fixed",top:c?"auto":r.bottom+a+"px",left:s+"px",right:"auto",bottom:c?i-r.top+a+"px":"auto",zIndex:Zu.zIndex}}catch(t){return ka.warn("Failed to calculate trigger position:",t),null}}(e.currentTarget,parseInt((null==(i=t.appearance)?void 0:i.maxWidth)||Zu.maxWidth)):{};Pc.dispatchEvent(new CustomEvent(Dc,{detail:{surveyId:t.id,position:n}}))};Sn(r,"click",n),r.setAttribute(Bc,"true"),this.$.set(t.id,{element:r,listener:n,survey:t}),ka.info("Attached click listener for feedback button survey "+t.id)}}else i&&this.Y(t)},this.renderPopover=t=>{var{shadow:e}=Vu(t,this._posthog);Vs(uc(Wc,{posthog:this._posthog,survey:t,removeSurveyFromFocus:this.V}),e)},this.renderSurvey=(t,e)=>{Vs(uc(Wc,{posthog:this._posthog,survey:t,removeSurveyFromFocus:this.V,isPopup:!1}),e)},this.getActiveMatchingSurveys=function(t,r){var i;void 0===r&&(r=!1),null==(i=e._posthog)||i.surveys.getSurveys((r=>{var i=r.filter((t=>e.checkSurveyEligibility(t).eligible&&e.U(t)&&e.X(t)&&e.J(t)));t(i)}),r)},this.callSurveysAndEvaluateDisplayLogic=function(t){void 0===t&&(t=!1),e.getActiveMatchingSurveys((t=>{var r=t.filter((t=>t.type===ya.Popover||t.type===ya.Widget)),i=e.K(r),n=new Set;i.forEach((t=>{if(t.type===ya.Widget){var r,i,o,s;if((null==(r=t.appearance)?void 0:r.widgetType)===ga.Tab)return void e.j(t);if((null==(i=t.appearance)?void 0:i.widgetType)===ga.Selector&&null!=(o=t.appearance)&&o.widgetSelector)n.add(t.id),e.W(t,null==(s=t.appearance)?void 0:s.widgetSelector)}ei(e.tt)&&t.type===ya.Popover&&e.handlePopoverSurvey(t)})),e.$.forEach((t=>{var{survey:r}=t;n.has(r.id)||e.Y(r)}))}),t)},this.H=t=>{ei(this.tt)||ka.error("Survey "+this.tt+" already in focus. Cannot add survey "+t.id+"."),this.tt=t.id},this.V=t=>{this.tt!==t.id&&ka.error("Survey "+t.id+" is not in focus. Cannot remove survey "+t.id+"."),this.q(t.id),this.tt=null,this.G(t)},this._posthog=t,this.tt=null}q(t){var e=this.Z.get(t);e&&(clearTimeout(e),this.Z.delete(t))}K(t){return t.sort(((t,e)=>{var r,i,n=oc(t),o=oc(e);if(n&&!o)return-1;if(!n&&o)return 1;var s=t.schedule===_a.Always,a=e.schedule===_a.Always;return s&&!a?1:!s&&a?-1:((null==(r=t.appearance)?void 0:r.surveyPopupDelaySeconds)||0)-((null==(i=e.appearance)?void 0:i.surveyPopupDelaySeconds)||0)}))}et(t,e){if(void 0===e&&(e=void 0),!t)return!0;var r=!!this._posthog.featureFlags.isFeatureEnabled(t,{send_event:!t.startsWith("survey-targeting-")}),i=!0;e&&(i=this._posthog.featureFlags.getFeatureFlag(t,{send_event:!1})===e||"any"===e);return r&&i}U(t){return!t.conditions||ec(t)&&function(t){var e,r,i;if(null==(e=t.conditions)||!e.deviceTypes||0===(null==(r=t.conditions)?void 0:r.deviceTypes.length))return!0;if(!rn)return!1;var n=$l(rn);return Ru[tc(null==(i=t.conditions)?void 0:i.deviceTypesMatchType)](t.conditions.deviceTypes,[n])}(t)&&function(t){var e;return null==(e=t.conditions)||!e.selector||!(null==Lu||!Lu.querySelector(t.conditions.selector))}(t)}rt(t){return Xu(t)||this.et(t.internal_targeting_flag_key)||oc(t)}checkSurveyEligibility(t){var e,r,i={eligible:!0,reason:void 0};if(!xa(t))return i.eligible=!1,i.reason="Survey is not running. It was completed on "+t.end_date,i;if(!Oa.includes(t.type))return i.eligible=!1,i.reason="Surveys of type "+t.type+" are never eligible to be shown in the app",i;var n=null==(e=t.conditions)?void 0:e.linkedFlagVariant;return this.et(t.linked_flag_key,n)?this.et(t.targeting_flag_key)?this.rt(t)?(t=>{var e=localStorage.getItem("lastSeenSurveyDate");if(!t||!e)return!0;var r=new Date,i=Math.abs(r.getTime()-new Date(e).getTime());return Math.ceil(i/864e5)>t})(null==(r=t.conditions)?void 0:r.seenSurveyWaitPeriodInDays)?(t=>!!localStorage.getItem(Ra(t))&&!Xu(t))(t)?(i.eligible=!1,i.reason="Survey has already been seen and it can't be activated again",i):i:(i.eligible=!1,i.reason="Survey wait period has not passed",i):(i.eligible=!1,i.reason="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)}X(t){var e;if(!Aa(t)&&!Ta(t))return!0;var r=null==(e=this._posthog.surveys._surveyEventReceiver)?void 0:e.getSurveys();return!(null==r||!r.includes(t.id))}J(t){var e;return null==(e=t.feature_flag_keys)||!e.length||t.feature_flag_keys.every((t=>{var{key:e,value:r}=t;return!e||!r||this.et(r)}))}G(t){try{var e=Lc.querySelector(ac(t,!0));null!=e&&e.shadowRoot&&Vs(null,e.shadowRoot),null==e||e.remove()}catch(e){ka.warn("Failed to remove survey "+t.id+" from DOM:",e)}}getTestAPI(){return{addSurveyToFocus:this.H,removeSurveyFromFocus:this.V,surveyInFocus:this.tt,surveyTimeouts:this.Z,handleWidget:this.j,handlePopoverSurvey:this.handlePopoverSurvey,manageWidgetSelectorListener:this.W,sortSurveysByAppearanceDelay:this.K,checkFlags:this.J.bind(this),isSurveyFeatureFlagEnabled:this.et.bind(this)}}}function jc(t,e){if(Lc&&Pc){var r=new Vc(t);return t.config.disable_surveys_automatic_display?(ka.info("Surveys automatic display is disabled. Skipping call surveys and evaluate display logic."),r):!1===e?(ka.info("There are no surveys to load or Surveys is disabled in the project settings."),r):(r.callSurveysAndEvaluateDisplayLogic(!0),setInterval((()=>{r.callSurveysAndEvaluateDisplayLogic(!1)}),1e3),r)}}function Yc(t){var{survey:e,removeSurveyFromFocus:r=(()=>{}),setSurveyVisible:i,isPreviewMode:n=!1}=t;oa((()=>{var t;if(!n&&null!=(t=e.conditions)&&t.url){var o=()=>{var t,n=e.type===ya.Widget,o=ec(e),s=(null==(t=e.appearance)?void 0:t.widgetType)===ga.Tab&&n;if(!o)return ka.info("Hiding survey "+e.id+" because URL does not match"),i(!1),r(e);s&&(ka.info("Showing survey "+e.id+" because it is a feedback button tab and URL matches"),i(!0))};Sn(Pc,"popstate",o),Sn(Pc,"hashchange",o);var s=Pc.history.pushState,a=Pc.history.replaceState;return Pc.history.pushState=function(){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];s.apply(this,e),o()},Pc.history.replaceState=function(){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];a.apply(this,e),o()},()=>{Pc.removeEventListener("popstate",o),Pc.removeEventListener("hashchange",o),Pc.history.pushState=s,Pc.history.replaceState=a}}}),[n,e,r,i])}function Gc(t,e,r){if(void 0===e&&(e=ma.Right),t===ya.ExternalSurvey)return{};switch(e){case ma.TopLeft:return{top:"0",left:"0",transform:"translate(30px, 30px)"};case ma.TopRight:return{top:"0",right:"0",transform:"translate(-30px, 30px)"};case ma.TopCenter:return{top:"0",left:"50%",transform:"translate(-50%, 30px)"};case ma.MiddleLeft:return{top:"50%",left:"0",transform:"translate(30px, -50%)"};case ma.MiddleRight:return{top:"50%",right:"0",transform:"translate(-30px, -50%)"};case ma.MiddleCenter:return{top:"50%",left:"50%",transform:"translate(-50%, -50%)"};case ma.Left:return{left:"30px"};case ma.Center:return{left:"50%",transform:"translateX(-50%)"};default:case ma.Right:return{right:t===ya.Widget&&r===ga.Tab?"60px":"30px"}}}function Wc(t){var e,i,n,o,s,a,{survey:l,forceDisableHtml:u,posthog:c,style:h={},previewPageIndex:d,removeSurveyFromFocus:v=(()=>{}),isPopup:f=!0,onPreviewSubmit:p=(()=>{}),onPopupSurveyDismissed:g=(()=>{}),onCloseConfirmationMessage:m=(()=>{})}=t,y=sa(null),b=Number.isInteger(d),w=null!=(e=l.appearance)&&e.surveyPopupDelaySeconds?1e3*l.appearance.surveyPopupDelaySeconds:0,{isPopupVisible:_,isSurveySent:C,hidePopupWithViewTransition:I}=function(t,e,r,i,n,o){var[s,a]=na(i||0===r||t.type===ya.ExternalSurvey),[l,u]=na(!1),c=()=>{var e=()=>{t.type===ya.Popover&&n(t),a(!1)};Lc.startViewTransition?Lc.startViewTransition((()=>{var t;null==o||null==(t=o.current)||t.remove()})).finished.then((()=>{setTimeout((()=>{e()}),100)})):e()},h=e=>{e.detail.surveyId===t.id&&c()};return oa((()=>{if(e){if(!i){var n=e=>{var r,i;if(e.detail.surveyId===t.id){if(null==(r=t.appearance)||!r.displayThankYouMessage)return c();u(!0),null!=(i=t.appearance)&&i.autoDisappear&&setTimeout((()=>{c()}),5e3)}},o=()=>{ec(t)&&(a(!0),Pc.dispatchEvent(new Event("PHSurveyShown")),e.capture(Ca.SHOWN,{[Ia.SURVEY_NAME]:t.name,[Ia.SURVEY_ID]:t.id,[Ia.SURVEY_ITERATION]:t.current_iteration,[Ia.SURVEY_ITERATION_START_DATE]:t.current_iteration_start_date,sessionRecordingUrl:null==e.get_session_replay_url?void 0:e.get_session_replay_url()}),localStorage.setItem("lastSeenSurveyDate",(new Date).toISOString()))};if(Sn(Pc,"PHSurveyClosed",h),Sn(Pc,"PHSurveySent",n),r>0){var s=setTimeout(o,r);return()=>{clearTimeout(s),Pc.removeEventListener("PHSurveyClosed",h),Pc.removeEventListener("PHSurveySent",n)}}return o(),()=>{Pc.removeEventListener("PHSurveyClosed",h),Pc.removeEventListener("PHSurveySent",n)}}}else ka.error("usePopupVisibility hook called without a PostHog instance.")}),[]),Yc({survey:t,removeSurveyFromFocus:n,setSurveyVisible:a,isPreviewMode:i}),{isPopupVisible:s,isSurveySent:l,setIsPopupVisible:a,hidePopupWithViewTransition:c}}(l,c,w,b,v,y),S=C||d===l.questions.length,k=aa((()=>{var t=nc(l);return{isPreviewMode:b,previewPageIndex:d,onPopupSurveyDismissed:()=>{Gu(l,c,b),g()},isPopup:f||!1,surveySubmissionId:(null==t?void 0:t.surveySubmissionId)||Ha(),onPreviewSubmit:p,posthog:c}}),[b,d,f,c,l,g,p]);return _?uc(Ju.Provider,{value:k,children:uc("div",{className:"ph-survey",style:r({},Gc(l.type,null==(i=l.appearance)?void 0:i.position,null==(n=l.appearance)?void 0:n.widgetType),h),ref:y,children:S?uc(Cc,{header:(null==(o=l.appearance)?void 0:o.thankYouMessageHeader)||"Thank you!",description:(null==(s=l.appearance)?void 0:s.thankYouMessageDescription)||"",forceDisableHtml:!!u,contentType:null==(a=l.appearance)?void 0:a.thankYouMessageDescriptionContentType,appearance:l.appearance||Zu,onClose:()=>{I(),m()}}):uc(zc,{survey:l,forceDisableHtml:!!u,posthog:c})})}):null}function zc(t){var{survey:e,forceDisableHtml:i,posthog:n}=t,[o,s]=na((()=>{var t=nc(e);return null!=t&&t.responses&&ka.info("Survey is already in progress, filling in initial responses"),(null==t?void 0:t.responses)||{}})),{previewPageIndex:a,onPopupSurveyDismissed:l,isPopup:u,onPreviewSubmit:c,surveySubmissionId:h,isPreviewMode:d}=la(Ju),[v,f]=na((()=>{var t=nc(e);return a||(null==t?void 0:t.lastQuestionIndex)||0})),p=aa((()=>Uu(e)),[e]);oa((()=>{d&&!Kr(a)&&f(a)}),[a,d]);var g=p.at(v);return g?uc("form",{className:"survey-form",name:"surveyForm",children:[u&&uc(wc,{onClick:()=>{l()}}),uc("div",{className:"survey-box",children:Xc({question:g,forceDisableHtml:i,displayQuestionIndex:v,appearance:e.appearance||Zu,onSubmit:t=>(t=>{var{res:i,displayQuestionIndex:a,questionId:l}=t;if(n)if(l){var u=Du(l),c=r({},o,{[u]:i});s(c);var d=Zc(e,a,i),v=d===wa.End;v||(f(d),ic(e,{surveySubmissionId:h,responses:c,lastQuestionIndex:d})),(e.enable_partial_responses||v)&&Yu({responses:c,survey:e,surveySubmissionId:h,isSurveyCompleted:v,posthog:n})}else ka.error("onNextButtonClick called without a questionId.");else ka.error("onNextButtonClick called without a PostHog instance.")})({res:t,displayQuestionIndex:v,questionId:g.id}),onPreviewSubmit:c,initialValue:g.id?o[Du(g.id)]:void 0})})]}):null}function Uc(t){var e,r,i,n,o,{survey:s,forceDisableHtml:a,posthog:l,readOnly:u}=t,[c,h]=na(!0),[d,v]=na(!1),[f,p]=na({}),g=()=>{v(!d)};if(oa((()=>{var t;if(l){if(!u){"tab"===(null==(t=s.appearance)?void 0:t.widgetType)&&p({top:"50%",bottom:"auto"});var e=t=>{var e,r=t;(null==(e=r.detail)?void 0:e.surveyId)===s.id&&(ka.info("Received show event for feedback button survey "+s.id),p(r.detail.position||{}),g())};return Sn(Pc,Dc,e),()=>{Pc.removeEventListener(Dc,e)}}}else ka.error("FeedbackWidget called without a PostHog instance.")}),[l,u,s.id,null==(e=s.appearance)?void 0:e.widgetType,null==(r=s.appearance)?void 0:r.widgetSelector,null==(i=s.appearance)?void 0:i.borderColor]),Yc({survey:s,setSurveyVisible:h}),!c)return null;var m=()=>{s.schedule!==_a.Always&&h(!1),setTimeout((()=>{v(!1)}),200)};return uc(ks,{children:["tab"===(null==(n=s.appearance)?void 0:n.widgetType)&&uc("button",{className:"ph-survey-widget-tab",onClick:g,disabled:u,children:(null==(o=s.appearance)?void 0:o.widgetLabel)||""}),d&&uc(Wc,{posthog:l,survey:s,forceDisableHtml:a,style:f,onPopupSurveyDismissed:m,onCloseConfirmationMessage:m})]})}var Xc=t=>{var{question:e,forceDisableHtml:i,displayQuestionIndex:n,appearance:o,onSubmit:s,onPreviewSubmit:a,initialValue:l}=t,u={forceDisableHtml:i,appearance:o,onPreviewSubmit:t=>{a(t)},onSubmit:t=>{s(t)},initialValue:l,displayQuestionIndex:n};switch(e.type){case ba.Open:return Is(Sc,r({},u,{question:e,key:e.id}));case ba.Link:return Is(kc,r({},u,{question:e,key:e.id}));case ba.Rating:return Is(xc,r({},u,{question:e,key:e.id}));case ba.SingleChoice:case ba.MultipleChoice:return Is(Tc,r({},u,{question:e,key:e.id}));default:return ka.error("Unsupported question type: "+e.type),null}};nn.__PosthogExtensions__=nn.__PosthogExtensions__||{},nn.__PosthogExtensions__.generateSurveys=jc,nn.extendPostHogWithSurveys=jc;var Jc=cn("[Error tracking]");function Kc(){return new Fi([new Oi,new ji,new Li,new Pi,new Hi,new qi,new Bi,new Vi],[xi,Mi])}class Qc{constructor(t){var e,r;this.it=[],this.nt=Kc(),this._instance=t,this.it=null!==(e=null==(r=this._instance.persistence)?void 0:r.get_property(Bn))&&void 0!==e?e:[]}onRemoteConfig(t){var e,r,i,n=null!==(e=null==(r=t.errorTracking)?void 0:r.suppressionRules)&&void 0!==e?e:[],o=null==(i=t.errorTracking)?void 0:i.captureExtensionExceptions;this.it=n,this._instance.persistence&&this._instance.persistence.register({[Bn]:this.it,[Zn]:o})}get ot(){var t,e=!!this._instance.get_property(Zn),r=this._instance.config.error_tracking.captureExtensionExceptions;return null!==(t=null!=r?r:e)&&void 0!==t&&t}buildProperties(t,e){return this.nt.buildFromUnknown(t,{syntheticException:null==e?void 0:e.syntheticException,mechanism:{handled:null==e?void 0:e.handled}})}sendExceptionEvent(t){if(this.st(t))Jc.info("Skipping exception capture because a suppression rule matched");else{if(this.ot||!this.lt(t))return this._instance.capture("$exception",t,{_noTruncate:!0,_batchKey:"exceptionEvent"});Jc.info("Skipping exception capture because it was thrown by an extension")}}st(t){var e=t.$exception_list;if(!e||!Wr(e)||0===e.length)return!1;var r=e.reduce(((t,e)=>{var{type:r,value:i}=e;return Qr(r)&&r.length>0&&t.$exception_types.push(r),Qr(i)&&i.length>0&&t.$exception_values.push(i),t}),{$exception_types:[],$exception_values:[]});return this.it.some((t=>{var e=t.values.map((t=>{var e,i=Ru[t.operator],n=Wr(t.value)?t.value:[t.value],o=null!==(e=r[t.key])&&void 0!==e?e:[];return n.length>0&&i(n,o)}));return"OR"===t.type?e.some(Boolean):e.every(Boolean)}))}lt(t){var e=t.$exception_list;if(!e||!Wr(e))return!1;var r=e.flatMap((t=>{var e,r;return null!==(e=null==(r=t.stacktrace)?void 0:r.frames)&&void 0!==e?e:[]}));return r.some((t=>t.filename&&t.filename.startsWith("chrome-extension://")))}}var th=cn("[ExceptionAutocapture]"),eh=Kc();function rh(t){var{event:e,error:r}=t;return eh.buildFromUnknown(r||e,{mechanism:{handled:!1}})}var ih={wrapOnError:t=>{var e=Yi;e||th.info("window not available, cannot wrap onerror");var r=e.onerror;return e.onerror=function(){for(var e,i=arguments.length,n=new Array(i),o=0;o<i;o++)n[o]=arguments[o];var s=rh({event:n[0],error:n[4]});return t(s),null!==(e=null==r?void 0:r(...n))&&void 0!==e&&e},e.onerror.__POSTHOG_INSTRUMENTED__=!0,()=>{var t;null==(t=e.onerror)||delete t.__POSTHOG_INSTRUMENTED__,e.onerror=r}},wrapUnhandledRejection:t=>{var e=Yi;e||th.info("window not available, cannot wrap onUnhandledRejection");var r=e.onunhandledrejection;return e.onunhandledrejection=function(i){var n,o=rh({event:i});return t(o),null!==(n=null==r?void 0:r.apply(e,[i]))&&void 0!==n&&n},e.onunhandledrejection.__POSTHOG_INSTRUMENTED__=!0,()=>{var t;null==(t=e.onunhandledrejection)||delete t.__POSTHOG_INSTRUMENTED__,e.onunhandledrejection=r}},wrapConsoleError:t=>{var e=console;e||th.info("console not available, cannot wrap console.error");var r=e.error;return e.error=function(){for(var e=arguments.length,i=new Array(e),n=0;n<e;n++)i[n]=arguments[n];var o=i.join(" "),s=rh({error:i.find((t=>t instanceof Error)),event:o});return t(s),null==r?void 0:r(...i)},e.error.__POSTHOG_INSTRUMENTED__=!0,()=>{var t;null==(t=e.error)||delete t.__POSTHOG_INSTRUMENTED__,e.error=r}}};nn.__PosthogExtensions__=nn.__PosthogExtensions__||{},nn.__PosthogExtensions__.errorWrappingFunctions=ih,nn.posthogErrorWrappingFunctions=ih;var nh=(t,e,r,i)=>{var n;try{n=new URL(i.url).hostname}catch(t){return}if(!Wr(t)||t.includes(n)){if(r){var{sessionId:o,windowId:s}=r.checkAndGetSessionAndWindowId(!0);i.headers.set("X-POSTHOG-SESSION-ID",o),i.headers.set("X-POSTHOG-WINDOW-ID",s)}e!==lo&&i.headers.set("X-POSTHOG-DISTINCT-ID",e)}};nn.__PosthogExtensions__=nn.__PosthogExtensions__||{};var oh={_patchFetch:(t,r,i)=>En(Yi,"fetch",(n=>function(){var o=e((function*(e,o){var s=new Request(e,o);return nh(t,r,i,s),n(s)}));return function(t,e){return o.apply(this,arguments)}}())),_patchXHR:(t,e,r)=>En(Yi.XMLHttpRequest.prototype,"open",(i=>function(n,o,s,a,l){void 0===s&&(s=!0);var u=new Request(o);return nh(t,e,r,u),i.call(this,n,u.url,s,a,l)}))};nn.__PosthogExtensions__.tracingHeadersPatchFns=oh,nn.postHogTracingHeadersPatchFns=oh;var sh,ah,lh=function(){var t=self.performance&&performance.getEntriesByType&&performance.getEntriesByType("navigation")[0];if(t&&t.responseStart>0&&t.responseStart<performance.now())return t},uh=function(t){if("loading"===document.readyState)return"loading";var e=lh();if(e){if(t<e.domInteractive)return"loading";if(0===e.domContentLoadedEventStart||t<e.domContentLoadedEventStart)return"dom-interactive";if(0===e.domComplete||t<e.domComplete)return"dom-content-loaded"}return"complete"},ch=function(t){var e=t.nodeName;return 1===t.nodeType?e.toLowerCase():e.toUpperCase().replace(/^#/,"")},hh=function(t,e){var r="";try{for(;t&&9!==t.nodeType;){var i=t,n=i.id?"#"+i.id:ch(i)+(i.classList&&i.classList.value&&i.classList.value.trim()&&i.classList.value.trim().length?"."+i.classList.value.trim().replace(/\s+/g,"."):"");if(r.length+n.length>(e||100)-1)return r||n;if(r=r?n+">"+r:n,i.id)break;t=i.parentNode}}catch(t){}return r},dh=-1,vh=function(){return dh},fh=function(t){addEventListener("pageshow",(function(e){e.persisted&&(dh=e.timeStamp,t(e))}),!0)},ph=function(){var t=lh();return t&&t.activationStart||0},gh=function(t,e){var r=lh(),i="navigate";return vh()>=0?i="back-forward-cache":r&&(document.prerendering||ph()>0?i="prerender":document.wasDiscarded?i="restore":r.type&&(i=r.type.replace(/_/g,"-"))),{name:t,value:void 0===e?-1:e,rating:"good",delta:0,entries:[],id:"v4-".concat(Date.now(),"-").concat(Math.floor(8999999999999*Math.random())+1e12),navigationType:i}},mh=function(t,e,r){try{if(PerformanceObserver.supportedEntryTypes.includes(t)){var i=new PerformanceObserver((function(t){Promise.resolve().then((function(){e(t.getEntries())}))}));return i.observe(Object.assign({type:t,buffered:!0},r||{})),i}}catch(t){}},yh=function(t,e,r,i){var n,o;return function(s){e.value>=0&&(s||i)&&((o=e.value-(n||0))||void 0===n)&&(n=e.value,e.delta=o,e.rating=function(t,e){return t>e[1]?"poor":t>e[0]?"needs-improvement":"good"}(e.value,r),t(e))}},bh=function(t){requestAnimationFrame((function(){return requestAnimationFrame((function(){return t()}))}))},wh=function(t){document.addEventListener("visibilitychange",(function(){"hidden"===document.visibilityState&&t()}))},_h=function(t){var e=!1;return function(){e||(t(),e=!0)}},Ch=-1,Ih=function(){return"hidden"!==document.visibilityState||document.prerendering?1/0:0},Sh=function(t){"hidden"===document.visibilityState&&Ch>-1&&(Ch="visibilitychange"===t.type?t.timeStamp:0,xh())},kh=function(){addEventListener("visibilitychange",Sh,!0),addEventListener("prerenderingchange",Sh,!0)},xh=function(){removeEventListener("visibilitychange",Sh,!0),removeEventListener("prerenderingchange",Sh,!0)},Ah=function(){return Ch<0&&(Ch=Ih(),kh(),fh((function(){setTimeout((function(){Ch=Ih(),kh()}),0)}))),{get firstHiddenTime(){return Ch}}},Th=function(t){document.prerendering?addEventListener("prerenderingchange",(function(){return t()}),!0):t()},Mh=[1800,3e3],Eh=function(t,e){e=e||{},Th((function(){var r,i=Ah(),n=gh("FCP"),o=mh("paint",(function(t){t.forEach((function(t){"first-contentful-paint"===t.name&&(o.disconnect(),t.startTime<i.firstHiddenTime&&(n.value=Math.max(t.startTime-ph(),0),n.entries.push(t),r(!0)))}))}));o&&(r=yh(t,n,Mh,e.reportAllChanges),fh((function(i){n=gh("FCP"),r=yh(t,n,Mh,e.reportAllChanges),bh((function(){n.value=performance.now()-i.timeStamp,r(!0)}))})))}))},Nh=[.1,.25],Rh=0,Fh=1/0,Oh=0,Ph=function(t){t.forEach((function(t){t.interactionId&&(Fh=Math.min(Fh,t.interactionId),Oh=Math.max(Oh,t.interactionId),Rh=Oh?(Oh-Fh)/7+1:0)}))},Lh=function(){return sh?Rh:performance.interactionCount||0},Dh=function(){"interactionCount"in performance||sh||(sh=mh("event",Ph,{type:"event",buffered:!0,durationThreshold:0}))},Bh=[],Zh=new Map,$h=0,qh=[],Hh=function(t){if(qh.forEach((function(e){return e(t)})),t.interactionId||"first-input"===t.entryType){var e=Bh[Bh.length-1],r=Zh.get(t.interactionId);if(r||Bh.length<10||t.duration>e.latency){if(r)t.duration>r.latency?(r.entries=[t],r.latency=t.duration):t.duration===r.latency&&t.startTime===r.entries[0].startTime&&r.entries.push(t);else{var i={id:t.interactionId,latency:t.duration,entries:[t]};Zh.set(i.id,i),Bh.push(i)}Bh.sort((function(t,e){return e.latency-t.latency})),Bh.length>10&&Bh.splice(10).forEach((function(t){return Zh.delete(t.id)}))}}},Vh=function(t){var e=self.requestIdleCallback||self.setTimeout,r=-1;return t=_h(t),"hidden"===document.visibilityState?t():(r=e(t),wh(t)),r},jh=[200,500],Yh=function(t,e){"PerformanceEventTiming"in self&&"interactionId"in PerformanceEventTiming.prototype&&(e=e||{},Th((function(){var r;Dh();var i,n=gh("INP"),o=function(t){Vh((function(){t.forEach(Hh);var e=function(){var t=Math.min(Bh.length-1,Math.floor((Lh()-$h)/50));return Bh[t]}();e&&e.latency!==n.value&&(n.value=e.latency,n.entries=e.entries,i())}))},s=mh("event",o,{durationThreshold:null!==(r=e.durationThreshold)&&void 0!==r?r:40});i=yh(t,n,jh,e.reportAllChanges),s&&(s.observe({type:"first-input",buffered:!0}),wh((function(){o(s.takeRecords()),i(!0)})),fh((function(){$h=Lh(),Bh.length=0,Zh.clear(),n=gh("INP"),i=yh(t,n,jh,e.reportAllChanges)})))})))},Gh=[],Wh=[],zh=0,Uh=new WeakMap,Xh=new Map,Jh=-1,Kh=function(t){Gh=Gh.concat(t),Qh()},Qh=function(){Jh<0&&(Jh=Vh(td))},td=function(){Xh.size>10&&Xh.forEach((function(t,e){Zh.has(e)||Xh.delete(e)}));var t=Bh.map((function(t){return Uh.get(t.entries[0])})),e=Wh.length-50;Wh=Wh.filter((function(r,i){return i>=e||t.includes(r)}));for(var r=new Set,i=0;i<Wh.length;i++){var n=Wh[i];ed(n.startTime,n.processingEnd).forEach((function(t){r.add(t)}))}var o=Gh.length-1-50;Gh=Gh.filter((function(t,e){return t.startTime>zh&&e>o||r.has(t)})),Jh=-1};qh.push((function(t){t.interactionId&&t.target&&!Xh.has(t.interactionId)&&Xh.set(t.interactionId,t.target)}),(function(t){var e,r=t.startTime+t.duration;zh=Math.max(zh,t.processingEnd);for(var i=Wh.length-1;i>=0;i--){var n=Wh[i];if(Math.abs(r-n.renderTime)<=8){(e=n).startTime=Math.min(t.startTime,e.startTime),e.processingStart=Math.min(t.processingStart,e.processingStart),e.processingEnd=Math.max(t.processingEnd,e.processingEnd),e.entries.push(t);break}}e||(e={startTime:t.startTime,processingStart:t.processingStart,processingEnd:t.processingEnd,renderTime:r,entries:[t]},Wh.push(e)),(t.interactionId||"first-input"===t.entryType)&&Uh.set(t,e),Qh()}));var ed=function(t,e){for(var r,i=[],n=0;r=Gh[n];n++)if(!(r.startTime+r.duration<t)){if(r.startTime>e)break;i.push(r)}return i},rd=[2500,4e3],id={},nd={onLCP:function(t,e){!function(t,e){e=e||{},Th((function(){var r,i=Ah(),n=gh("LCP"),o=function(t){e.reportAllChanges||(t=t.slice(-1)),t.forEach((function(t){t.startTime<i.firstHiddenTime&&(n.value=Math.max(t.startTime-ph(),0),n.entries=[t],r())}))},s=mh("largest-contentful-paint",o);if(s){r=yh(t,n,rd,e.reportAllChanges);var a=_h((function(){id[n.id]||(o(s.takeRecords()),s.disconnect(),id[n.id]=!0,r(!0))}));["keydown","click"].forEach((function(t){addEventListener(t,(function(){return Vh(a)}),{once:!0,capture:!0})})),wh(a),fh((function(i){n=gh("LCP"),r=yh(t,n,rd,e.reportAllChanges),bh((function(){n.value=performance.now()-i.timeStamp,id[n.id]=!0,r(!0)}))}))}}))}((function(e){var r=function(t){var e={timeToFirstByte:0,resourceLoadDelay:0,resourceLoadDuration:0,elementRenderDelay:t.value};if(t.entries.length){var r=lh();if(r){var i=r.activationStart||0,n=t.entries[t.entries.length-1],o=n.url&&performance.getEntriesByType("resource").filter((function(t){return t.name===n.url}))[0],s=Math.max(0,r.responseStart-i),a=Math.max(s,o?(o.requestStart||o.startTime)-i:0),l=Math.max(a,o?o.responseEnd-i:0),u=Math.max(l,n.startTime-i);e={element:hh(n.element),timeToFirstByte:s,resourceLoadDelay:a-s,resourceLoadDuration:l-a,elementRenderDelay:u-l,navigationEntry:r,lcpEntry:n},n.url&&(e.url=n.url),o&&(e.lcpResourceEntry=o)}}return Object.assign(t,{attribution:e})}(e);t(r)}),e)},onCLS:function(t,e){!function(t,e){e=e||{},Eh(_h((function(){var r,i=gh("CLS",0),n=0,o=[],s=function(t){t.forEach((function(t){if(!t.hadRecentInput){var e=o[0],r=o[o.length-1];n&&t.startTime-r.startTime<1e3&&t.startTime-e.startTime<5e3?(n+=t.value,o.push(t)):(n=t.value,o=[t])}})),n>i.value&&(i.value=n,i.entries=o,r())},a=mh("layout-shift",s);a&&(r=yh(t,i,Nh,e.reportAllChanges),wh((function(){s(a.takeRecords()),r(!0)})),fh((function(){n=0,i=gh("CLS",0),r=yh(t,i,Nh,e.reportAllChanges),bh((function(){return r()}))})),setTimeout(r,0))})))}((function(e){var r=function(t){var e,r={};if(t.entries.length){var i=t.entries.reduce((function(t,e){return t&&t.value>e.value?t:e}));if(i&&i.sources&&i.sources.length){var n=(e=i.sources).find((function(t){return t.node&&1===t.node.nodeType}))||e[0];n&&(r={largestShiftTarget:hh(n.node),largestShiftTime:i.startTime,largestShiftValue:i.value,largestShiftSource:n,largestShiftEntry:i,loadState:uh(i.startTime)})}}return Object.assign(t,{attribution:r})}(e);t(r)}),e)},onFCP:function(t,e){Eh((function(e){var r=function(t){var e={timeToFirstByte:0,firstByteToFCP:t.value,loadState:uh(vh())};if(t.entries.length){var r=lh(),i=t.entries[t.entries.length-1];if(r){var n=r.activationStart||0,o=Math.max(0,r.responseStart-n);e={timeToFirstByte:o,firstByteToFCP:t.value-o,loadState:uh(t.entries[0].startTime),navigationEntry:r,fcpEntry:i}}}return Object.assign(t,{attribution:e})}(e);t(r)}),e)},onINP:function(t,e){ah||(ah=mh("long-animation-frame",Kh)),Yh((function(e){var r=function(t){var e=t.entries[0],r=Uh.get(e),i=e.processingStart,n=r.processingEnd,o=r.entries.sort((function(t,e){return t.processingStart-e.processingStart})),s=ed(e.startTime,n),a=t.entries.find((function(t){return t.target})),l=a&&a.target||Xh.get(e.interactionId),u=[e.startTime+e.duration,n].concat(s.map((function(t){return t.startTime+t.duration}))),c=Math.max.apply(Math,u),h={interactionTarget:hh(l),interactionTargetElement:l,interactionType:e.name.startsWith("key")?"keyboard":"pointer",interactionTime:e.startTime,nextPaintTime:c,processedEventEntries:o,longAnimationFrameEntries:s,inputDelay:i-e.startTime,processingDuration:n-i,presentationDelay:Math.max(c-n,0),loadState:uh(e.startTime)};return Object.assign(t,{attribution:h})}(e);t(r)}),e)}};nn.__PosthogExtensions__=nn.__PosthogExtensions__||{},nn.__PosthogExtensions__.postHogWebVitalsCallbacks=nd,nn.postHogWebVitalsCallbacks=nd;class od{constructor(){this.clicks=[]}isRageClick(t,e,r){var i=this.clicks[this.clicks.length-1];if(i&&Math.abs(t-i.x)+Math.abs(e-i.y)<30&&r-i.timestamp<1e3){if(this.clicks.push({x:t,y:e,timestamp:r}),3===this.clicks.length)return!0}else this.clicks=[{x:t,y:e,timestamp:r}];return!1}}var sd=cn("[AutoCapture]");function ad(t,e){return e.length>t?e.slice(0,t)+"...":e}function ld(t){if(t.previousElementSibling)return t.previousElementSibling;var e=t;do{e=e.previousSibling}while(e&&!ho(e));return e}function ud(t,e,r,i){var n=t.tagName.toLowerCase(),o={tag_name:n};Co.indexOf(n)>-1&&!r&&("a"===n.toLowerCase()||"button"===n.toLowerCase()?o.$el_text=ad(1024,Bo(t)):o.$el_text=ad(1024,wo(t)));var s=yo(t);s.length>0&&(o.classes=s.filter((function(t){return""!==t}))),vn(t.attributes,(function(r){var n;if((!Eo(t)||-1!==["name","id","class","aria-label"].indexOf(r.name))&&((null==i||!i.includes(r.name))&&!e&&Do(r.value)&&(n=r.name,!Qr(n)||"_ngcontent"!==n.substring(0,10)&&"_nghost"!==n.substring(0,7)))){var s=r.value;"class"===r.name&&(s=go(s).join(" ")),o["attr__"+r.name]=ad(1024,s)}}));for(var a=1,l=1,u=t;u=ld(u);)a++,u.tagName===t.tagName&&l++;return o.nth_child=a,o.nth_of_type=l,o}function cd(t,e){for(var r,i,{e:n,maskAllElementAttributes:o,maskAllText:s,elementAttributeIgnoreList:a,elementsChainAsString:l}=e,u=[t],c=t;c.parentNode&&!vo(c,"body");)po(c.parentNode)?(u.push(c.parentNode.host),c=c.parentNode.host):(u.push(c.parentNode),c=c.parentNode);var h,d=[],v={},f=!1,p=!1;if(vn(u,(t=>{var e=Mo(t);"a"===t.tagName.toLowerCase()&&(f=t.getAttribute("href"),f=e&&f&&Do(f)&&f),$r(yo(t),"ph-no-capture")&&(p=!0),d.push(ud(t,o,s,a));var r=function(t){if(!Mo(t))return{};var e={};return vn(t.attributes,(function(t){if(t.name&&0===t.name.indexOf("data-ph-capture-attribute")){var r=t.name.replace("data-ph-capture-attribute-",""),i=t.value;r&&i&&Do(i)&&(e[r]=i)}})),e}(t);fn(v,r)})),p)return{props:{},explicitNoCapture:p};if(s||("a"===t.tagName.toLowerCase()||"button"===t.tagName.toLowerCase()?d[0].$el_text=Bo(t):d[0].$el_text=wo(t)),f){var g,m;d[0].attr__href=f;var y=null==(g=kn(f))?void 0:g.host,b=null==Yi||null==(m=Yi.location)?void 0:m.host;y&&b&&y!==b&&(h=f)}return{props:fn({$event_type:n.type,$ce_version:1},l?{}:{$elements:d},{$elements_chain:$o(d)},null!=(r=d[0])&&r.$el_text?{$el_text:null==(i=d[0])?void 0:i.$el_text}:{},h&&"click"===n.type?{$external_click_url:h}:{},v)}}class hd{constructor(t){this.ut=!1,this.ct=null,this.rageclicks=new od,this.ht=!1,this.instance=t,this.dt=null}get vt(){var t,e,r=Xr(this.instance.config.autocapture)?this.instance.config.autocapture:{};return r.url_allowlist=null==(t=r.url_allowlist)?void 0:t.map((t=>new RegExp(t))),r.url_ignorelist=null==(e=r.url_ignorelist)?void 0:e.map((t=>new RegExp(t))),r}ft(){if(this.isBrowserSupported()){if(Yi&&Ji){var t=t=>{t=t||(null==Yi?void 0:Yi.event);try{this.gt(t)}catch(t){sd.error("Failed to capture event",t)}};if(Sn(Ji,"submit",t,{capture:!0}),Sn(Ji,"change",t,{capture:!0}),Sn(Ji,"click",t,{capture:!0}),this.vt.capture_copied_text){var e=t=>{t=t||(null==Yi?void 0:Yi.event),this.gt(t,ql)};Sn(Ji,"copy",e,{capture:!0}),Sn(Ji,"cut",e,{capture:!0})}}}else sd.info("Disabling Automatic Event Collection because this browser is not supported")}startIfEnabled(){this.isEnabled&&!this.ut&&(this.ft(),this.ut=!0)}onRemoteConfig(t){t.elementsChainAsString&&(this.ht=t.elementsChainAsString),this.instance.persistence&&this.instance.persistence.register({[Pn]:!!t.autocapture_opt_out}),this.ct=!!t.autocapture_opt_out,this.startIfEnabled()}setElementSelectors(t){this.dt=t}getElementSelectors(t){var e,r=[];return null==(e=this.dt)||e.forEach((e=>{var i=null==Ji?void 0:Ji.querySelectorAll(e);null==i||i.forEach((i=>{t===i&&r.push(e)}))})),r}get isEnabled(){var t,e,r=null==(t=this.instance.persistence)?void 0:t.props[Pn],i=this.ct;if(ei(i)&&!ni(r)&&!this.instance.yt())return!1;var n=null!==(e=this.ct)&&void 0!==e?e:!!r;return!!this.instance.config.autocapture&&!n}gt(t,e){if(void 0===e&&(e="$autocapture"),this.isEnabled){var r,i=_o(t);if(fo(i)&&(i=i.parentNode||null),"$autocapture"===e&&"click"===t.type&&t instanceof MouseEvent)this.instance.config.rageclick&&null!=(r=this.rageclicks)&&r.isRageClick(t.clientX,t.clientY,(new Date).getTime())&&function(t,e){if(!Yi||xo(t))return!1;var r,i;if(!1===(r=ni(e)?!!e&&ko:null!==(i=null==e?void 0:e.css_selector_ignorelist)&&void 0!==i?i:ko))return!1;var{targetElementList:n}=Ao(t,!1);return!Io(n,r)}(i,this.instance.config.rageclick)&&this.gt(t,"$rageclick");var n=e===ql;if(i&&To(i,t,this.vt,n,n?["copy","cut"]:void 0)){var{props:o,explicitNoCapture:s}=cd(i,{e:t,maskAllElementAttributes:this.instance.config.mask_all_element_attributes,maskAllText:this.instance.config.mask_all_text,elementAttributeIgnoreList:this.vt.element_attribute_ignorelist,elementsChainAsString:this.ht});if(s)return!1;var a=this.getElementSelectors(i);if(a&&a.length>0&&(o.$element_selectors=a),e===ql){var l,u=bo(null==Yi||null==(l=Yi.getSelection())?void 0:l.toString()),c=t.type||"clipboard";if(!u)return!1;o.$selected_content=u,o.$copy_type=c}return this.instance.capture(e,o),!0}}}isBrowserSupported(){return zr(null==Ji?void 0:Ji.querySelectorAll)}}var dd={};function vd(t){return function(t,e){var r=dd[t];if(r)return r;var i=e[t];if(Ur(i)&&!on())return dd[t]=i.bind(e);var n=e.document;if(n&&zr(n.createElement))try{var o=n.createElement("iframe");o.hidden=!0,n.head.appendChild(o);var s=o.contentWindow;s&&s[t]&&(i=s[t]),n.head.removeChild(o)}catch(e){un.warn("Could not create sandbox iframe for "+t+" check, bailing to assignableWindow."+t+": ",e)}return i&&zr(i)?dd[t]=i.bind(e):i}("MutationObserver",t)}function fd(t,e){return ii(t)&&t>=e}class pd{bt(t){var e,r,i,n,o=this.wt((null==t?void 0:t.__onCapture)||this._t.bind(this));return{element_attribute_ignorelist:null!==(e=null==t?void 0:t.element_attribute_ignorelist)&&void 0!==e?e:o.element_attribute_ignorelist,scroll_threshold_ms:null!==(r=null==t?void 0:t.scroll_threshold_ms)&&void 0!==r?r:o.scroll_threshold_ms,selection_change_threshold_ms:null!==(i=null==t?void 0:t.selection_change_threshold_ms)&&void 0!==i?i:o.selection_change_threshold_ms,mutation_threshold_ms:null!==(n=null==t?void 0:t.mutation_threshold_ms)&&void 0!==n?n:o.mutation_threshold_ms,__onCapture:o.__onCapture}}constructor(t,e){this.Ct=[],this.wt=t=>({element_attribute_ignorelist:[],scroll_threshold_ms:100,selection_change_threshold_ms:100,mutation_threshold_ms:2500,__onCapture:t}),this.It=t=>{var e=function(t){var e=_o(t);return e?{node:e,originalEvent:t,timestamp:Date.now()}:null}(t);ei(e)||this.St(e)||this.Ct.push(e),this.Ct.length&&Kr(this.kt)&&(this.kt=nn.setTimeout((()=>{this.xt()}),1e3))},this.At=()=>{var t=Date.now();t%50==0&&this.Ct.forEach((e=>{Kr(e.scrollDelayMs)&&(e.scrollDelayMs=t-e.timestamp)}))},this.Tt=()=>{this.Mt=Date.now()},this.instance=t,this.vt=this.bt(e),this._onCapture=this.vt.__onCapture}start(t){this.Et(),this.Nt(),this.Rt(),this.Ft(t)}Ft(t){if(!this.Ot){var e=vd(nn);this.Ot=new e((t=>{this.Pt(t)})),this.Ot.observe(t,{attributes:!0,characterData:!0,childList:!0,subtree:!0})}}stop(){var t;null==(t=this.Ot)||t.disconnect(),this.Ot=void 0,nn.removeEventListener("click",this.It),nn.removeEventListener("scroll",this.At,{capture:!0}),nn.removeEventListener("selectionchange",this.Tt)}Pt(t){this.Lt=Date.now()}Et(){Sn(nn,"click",this.It)}Nt(){Sn(nn,"scroll",this.At,{capture:!0})}Rt(){Sn(nn,"selectionchange",this.Tt)}St(t){if(!t)return!0;if(co(t.node))return!0;var e=this.Ct.some((e=>e.node===t.node&&Math.abs(e.timestamp-t.timestamp)<1e3));return!!e||!(!vo(t.node,"html")&&ho(t.node)&&!Co.includes(t.node.tagName.toLowerCase()))}xt(){if(this.Ct.length){clearTimeout(this.kt),this.kt=void 0;var t=this.Ct;for(var e of(this.Ct=[],t)){var r;e.mutationDelayMs=null!==(r=e.mutationDelayMs)&&void 0!==r?r:this.Lt&&e.timestamp<=this.Lt?this.Lt-e.timestamp:void 0,e.absoluteDelayMs=Date.now()-e.timestamp,e.selectionChangedDelayMs=this.Mt&&e.timestamp<=this.Mt?this.Mt-e.timestamp:void 0;var i=fd(e.scrollDelayMs,this.vt.scroll_threshold_ms),n=fd(e.selectionChangedDelayMs,this.vt.selection_change_threshold_ms),o=fd(e.mutationDelayMs,this.vt.mutation_threshold_ms),s=fd(e.absoluteDelayMs,1.1*this.vt.mutation_threshold_ms),a=ii(e.scrollDelayMs)&&e.scrollDelayMs<this.vt.scroll_threshold_ms,l=ii(e.mutationDelayMs)&&e.mutationDelayMs<this.vt.mutation_threshold_ms,u=ii(e.selectionChangedDelayMs)&&e.selectionChangedDelayMs<this.vt.selection_change_threshold_ms;a||l||u||(i||o||s||n?this._onCapture(e,{$dead_click_last_mutation_timestamp:this.Lt,$dead_click_event_timestamp:e.timestamp,$dead_click_scroll_timeout:i,$dead_click_mutation_timeout:o,$dead_click_absolute_timeout:s,$dead_click_selection_changed_timeout:n}):e.absoluteDelayMs<this.vt.mutation_threshold_ms&&this.Ct.push(e))}this.Ct.length&&Kr(this.kt)&&(this.kt=nn.setTimeout((()=>{this.xt()}),1e3))}}_t(t,e){this.instance.capture("$dead_click",r({},e,cd(t.node,{e:t.originalEvent,maskAllElementAttributes:this.instance.config.mask_all_element_attributes,maskAllText:this.instance.config.mask_all_text,elementAttributeIgnoreList:this.vt.element_attribute_ignorelist,elementsChainAsString:!1}).props,{$dead_click_scroll_delay_ms:t.scrollDelayMs,$dead_click_mutation_delay_ms:t.mutationDelayMs,$dead_click_absolute_delay_ms:t.absoluteDelayMs,$dead_click_selection_changed_delay_ms:t.selectionChangedDelayMs}),{timestamp:new Date(t.timestamp)})}}nn.__PosthogExtensions__=nn.__PosthogExtensions__||{},nn.__PosthogExtensions__.initDeadClicksAutocapture=(t,e)=>new pd(t,e);var gd=cn("[ExternalScriptsLoader]"),md=(t,e,r)=>{if(t.config.disable_external_dependency_loading)return gd.warn(e+" was requested but loading of external scripts is disabled."),r("Loading of external scripts is disabled");var i=null==Ji?void 0:Ji.querySelectorAll("script");if(i)for(var n,o=function(){if(i[s].src===e){var t=i[s];return t.__posthog_loading_callback_fired?{v:r()}:(t.addEventListener("load",(e=>{t.__posthog_loading_callback_fired=!0,r(void 0,e)})),t.onerror=t=>r(t),{v:void 0})}},s=0;s<i.length;s++)if(n=o())return n.v;var a=()=>{if(!Ji)return r("document not found");var i=Ji.createElement("script");if(i.type="text/javascript",i.crossOrigin="anonymous",i.src=e,i.onload=t=>{i.__posthog_loading_callback_fired=!0,r(void 0,t)},i.onerror=t=>r(t),t.config.prepare_external_dependency_script&&(i=t.config.prepare_external_dependency_script(i)),!i)return r("prepare_external_dependency_script returned null");var n,o=Ji.querySelectorAll("body > script");o.length>0?null==(n=o[0].parentNode)||n.insertBefore(i,o[0]):Ji.body.appendChild(i)};null!=Ji&&Ji.body?a():null==Ji||Ji.addEventListener("DOMContentLoaded",a)};nn.__PosthogExtensions__=nn.__PosthogExtensions__||{},nn.__PosthogExtensions__.loadExternalDependency=(t,e,r)=>{var i="/static/"+e+".js?v="+t.version;if("remote-config"===e&&(i="/array/"+t.config.token+"/config.js"),"toolbar"===e){var n=3e5;i=i+"&t="+Math.floor(Date.now()/n)*n}var o=t.requestRouter.endpointFor("assets",i);md(t,o,r)},nn.__PosthogExtensions__.loadSiteApp=(t,e,r)=>{var i=t.requestRouter.endpointFor("api",e);md(t,i,r)};var yd="";var bd=/[a-z0-9][a-z0-9-]+\.[a-z]{2,}$/i;function wd(t,e){if(e){var r=function(t,e){if(void 0===e&&(e=Ji),yd)return yd;if(!e)return"";if(["localhost","127.0.0.1"].includes(t))return"";for(var r=t.split("."),i=Math.min(r.length,8),n="dmn_chk_"+Ha();!yd&&i--;){var o=r.slice(i).join("."),s=n+"=1;domain=."+o+";path=/";e.cookie=s+";max-age=3",e.cookie.includes(n)&&(e.cookie=s+";max-age=0",yd=o)}return yd}(t);if(!r){var i=(t=>{var e=t.match(bd);return e?e[0]:""})(t);i!==r&&un.info("Warning: cookie subdomain discovery mismatch",i,r),r=i}return r?"; domain=."+r:""}return""}var _d={Dt:()=>!!Ji,Bt:function(t){un.error("cookieStore error: "+t)},Zt:function(t){if(Ji){try{for(var e=t+"=",r=Ji.cookie.split(";").filter((t=>t.length)),i=0;i<r.length;i++){for(var n=r[i];" "==n.charAt(0);)n=n.substring(1,n.length);if(0===n.indexOf(e))return decodeURIComponent(n.substring(e.length,n.length))}}catch(t){}return null}},$t:function(t){var e;try{e=JSON.parse(_d.Zt(t))||{}}catch(t){}return e},qt:function(t,e,r,i,n){if(Ji)try{var o="",s="",a=wd(Ji.location.hostname,i);if(r){var l=new Date;l.setTime(l.getTime()+24*r*60*60*1e3),o="; expires="+l.toUTCString()}n&&(s="; secure");var u=t+"="+encodeURIComponent(JSON.stringify(e))+o+"; SameSite=Lax; path=/"+a+s;return u.length>3686.4&&un.warn("cookieStore warning: large cookie, len="+u.length),Ji.cookie=u,u}catch(t){return}},Ht:function(t,e){if(null!=Ji&&Ji.cookie)try{_d.qt(t,"",-1,e)}catch(t){return}}},Cd=null,Id={Dt:function(){if(!ei(Cd))return Cd;var t=!0;if(Kr(Yi))t=!1;else try{var e="__mplssupport__";Id.qt(e,"xyz"),'"xyz"'!==Id.Zt(e)&&(t=!1),Id.Ht(e)}catch(e){t=!1}return t||un.error("localStorage unsupported; falling back to cookie store"),Cd=t,t},Bt:function(t){un.error("localStorage error: "+t)},Zt:function(t){try{return null==Yi?void 0:Yi.localStorage.getItem(t)}catch(t){Id.Bt(t)}return null},$t:function(t){try{return JSON.parse(Id.Zt(t))||{}}catch(t){}return null},qt:function(t,e){try{null==Yi||Yi.localStorage.setItem(t,JSON.stringify(e))}catch(t){Id.Bt(t)}},Ht:function(t){try{null==Yi||Yi.localStorage.removeItem(t)}catch(t){Id.Bt(t)}}},Sd=["distinct_id",jn,Yn,so,oo],kd=r({},Id,{$t:function(t){try{var e={};try{e=_d.$t(t)||{}}catch(t){}var r=fn(e,JSON.parse(Id.Zt(t)||"{}"));return Id.qt(t,r),r}catch(t){}return null},qt:function(t,e,r,i,n,o){try{Id.qt(t,e,void 0,void 0,o);var s={};Sd.forEach((t=>{e[t]&&(s[t]=e[t])})),Object.keys(s).length&&_d.qt(t,s,r,i,n,o)}catch(t){Id.Bt(t)}},Ht:function(t,e){try{null==Yi||Yi.localStorage.removeItem(t),_d.Ht(t,e)}catch(t){Id.Bt(t)}}}),xd={},Ad={Dt:function(){return!0},Bt:function(t){un.error("memoryStorage error: "+t)},Zt:function(t){return xd[t]||null},$t:function(t){return xd[t]||null},qt:function(t,e){xd[t]=e},Ht:function(t){delete xd[t]}},Td=null,Md={Dt:function(){if(!ei(Td))return Td;if(Td=!0,Kr(Yi))Td=!1;else try{var t="__support__";Md.qt(t,"xyz"),'"xyz"'!==Md.Zt(t)&&(Td=!1),Md.Ht(t)}catch(t){Td=!1}return Td},Bt:function(t){un.error("sessionStorage error: ",t)},Zt:function(t){try{return null==Yi?void 0:Yi.sessionStorage.getItem(t)}catch(t){Md.Bt(t)}return null},$t:function(t){try{return JSON.parse(Md.Zt(t))||null}catch(t){}return null},qt:function(t,e){try{null==Yi||Yi.sessionStorage.setItem(t,JSON.stringify(e))}catch(t){Md.Bt(t)}},Ht:function(t){try{null==Yi||Yi.sessionStorage.removeItem(t)}catch(t){Md.Bt(t)}}},Ed=function(t){return t[t.PENDING=-1]="PENDING",t[t.DENIED=0]="DENIED",t[t.GRANTED=1]="GRANTED",t}({});class Nd{constructor(t){this._instance=t}get vt(){return this._instance.config}get consent(){return this.Vt()?Ed.DENIED:this.jt}isOptedOut(){return"always"===this.vt.cookieless_mode||(this.consent===Ed.DENIED||this.consent===Ed.PENDING&&(this.vt.opt_out_capturing_by_default||"on_reject"===this.vt.cookieless_mode))}isOptedIn(){return!this.isOptedOut()}isExplicitlyOptedOut(){return this.consent===Ed.DENIED}optInOut(t){this.Yt.qt(this.Gt,t?1:0,this.vt.cookie_expiration,this.vt.cross_subdomain_cookie,this.vt.secure_cookie)}reset(){this.Yt.Ht(this.Gt,this.vt.cross_subdomain_cookie)}get Gt(){var{token:t,opt_out_capturing_cookie_prefix:e,consent_persistence_name:r}=this._instance.config;return r||(e?e+t:"__ph_opt_in_out_"+t)}get jt(){var t=this.Yt.Zt(this.Gt);return hi(t)?Ed.GRANTED:$r(di,t)?Ed.DENIED:Ed.PENDING}get Yt(){if(!this.Wt){var t=this.vt.opt_out_capturing_persistence_type;this.Wt="localStorage"===t?Id:_d;var e="localStorage"===t?_d:Id;e.Zt(this.Gt)&&(this.Wt.Zt(this.Gt)||this.optInOut(hi(e.Zt(this.Gt))),e.Ht(this.Gt,this.vt.cross_subdomain_cookie))}return this.Wt}Vt(){return!!this.vt.respect_dnt&&!!In([null==Xi?void 0:Xi.doNotTrack,null==Xi?void 0:Xi.msDoNotTrack,nn.doNotTrack],(t=>hi(t)))}}var Rd=cn("[Dead Clicks]"),Fd=()=>!0,Od=t=>{var e,r=!(null==(e=t.instance.persistence)||!e.get_property(qn)),i=t.instance.config.capture_dead_clicks;return ni(i)?i:r};class Pd{get lazyLoadedDeadClicksAutocapture(){return this.zt}constructor(t,e,r){this.instance=t,this.isEnabled=e,this.onCapture=r,this.startIfEnabled()}onRemoteConfig(t){this.instance.persistence&&this.instance.persistence.register({[qn]:null==t?void 0:t.captureDeadClicks}),this.startIfEnabled()}startIfEnabled(){this.isEnabled(this)&&this.Ut((()=>{this.Xt()}))}Ut(t){var e,r;null!=(e=nn.__PosthogExtensions__)&&e.initDeadClicksAutocapture&&t(),null==(r=nn.__PosthogExtensions__)||null==r.loadExternalDependency||r.loadExternalDependency(this.instance,"dead-clicks-autocapture",(e=>{e?Rd.error("failed to load script",e):t()}))}Xt(){var t;if(Ji){if(!this.zt&&null!=(t=nn.__PosthogExtensions__)&&t.initDeadClicksAutocapture){var e=Xr(this.instance.config.capture_dead_clicks)?this.instance.config.capture_dead_clicks:{};e.__onCapture=this.onCapture,this.zt=nn.__PosthogExtensions__.initDeadClicksAutocapture(this.instance,e),this.zt.start(Ji),Rd.info("starting...")}}else Rd.error("`document` not found. Cannot start.")}stop(){this.zt&&(this.zt.stop(),this.zt=void 0,Rd.info("stopping..."))}}var Ld=cn("[ExceptionAutocapture]");class Dd{constructor(t){var e,r,i;this.Jt=()=>{var t;if(Yi&&this.isEnabled&&null!=(t=nn.__PosthogExtensions__)&&t.errorWrappingFunctions){var e=nn.__PosthogExtensions__.errorWrappingFunctions.wrapOnError,r=nn.__PosthogExtensions__.errorWrappingFunctions.wrapUnhandledRejection,i=nn.__PosthogExtensions__.errorWrappingFunctions.wrapConsoleError;try{!this.Kt&&this.vt.capture_unhandled_errors&&(this.Kt=e(this.captureException.bind(this))),!this.Qt&&this.vt.capture_unhandled_rejections&&(this.Qt=r(this.captureException.bind(this))),!this.te&&this.vt.capture_console_errors&&(this.te=i(this.captureException.bind(this)))}catch(t){Ld.error("failed to start",t),this.ee()}}},this._instance=t,this.re=!(null==(e=this._instance.persistence)||!e.props[Dn]),this.vt=this.ie(),this.ne=new fi({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,T:Ld}),this.startIfEnabled()}ie(){var t=this._instance.config.capture_exceptions,e={capture_unhandled_errors:!1,capture_unhandled_rejections:!1,capture_console_errors:!1};return Xr(t)?e=r({},e,t):(Kr(t)?this.re:t)&&(e=r({},e,{capture_unhandled_errors:!0,capture_unhandled_rejections:!0})),e}get isEnabled(){return this.vt.capture_console_errors||this.vt.capture_unhandled_errors||this.vt.capture_unhandled_rejections}startIfEnabled(){this.isEnabled&&(Ld.info("enabled"),this.Ut(this.Jt))}Ut(t){var e,r;null!=(e=nn.__PosthogExtensions__)&&e.errorWrappingFunctions&&t(),null==(r=nn.__PosthogExtensions__)||null==r.loadExternalDependency||r.loadExternalDependency(this._instance,"exception-autocapture",(e=>{if(e)return Ld.error("failed to load script",e);t()}))}ee(){var t,e,r;null==(t=this.Kt)||t.call(this),this.Kt=void 0,null==(e=this.Qt)||e.call(this),this.Qt=void 0,null==(r=this.te)||r.call(this),this.te=void 0}onRemoteConfig(t){var e=t.autocaptureExceptions;this.re=!!e||!1,this.vt=this.ie(),this._instance.persistence&&this._instance.persistence.register({[Dn]:this.re}),this.startIfEnabled()}captureException(t){var e,r,i=null!==(e=null==t||null==(r=t.$exception_list)||null==(r=r[0])?void 0:r.type)&&void 0!==e?e:"Exception";this.ne.consumeRateLimit(i)?Ld.info("Skipping exception capture because of client rate limiting.",{exception:i}):this._instance.exceptions.sendExceptionEvent(t)}}class Bd{constructor(t){var e;this._instance=t,this.oe=(null==Yi||null==(e=Yi.location)?void 0:e.pathname)||""}get isEnabled(){return"history_change"===this._instance.config.capture_pageview}startIfEnabled(){this.isEnabled&&(un.info("History API monitoring enabled, starting..."),this.monitorHistoryChanges())}stop(){this.se&&this.se(),this.se=void 0,un.info("History API monitoring stopped")}monitorHistoryChanges(){var t,e;if(Yi&&Yi.history){var r=this;null!=(t=Yi.history.pushState)&&t.__posthog_wrapped__||En(Yi.history,"pushState",(t=>function(e,i,n){t.call(this,e,i,n),r.ae("pushState")})),null!=(e=Yi.history.replaceState)&&e.__posthog_wrapped__||En(Yi.history,"replaceState",(t=>function(e,i,n){t.call(this,e,i,n),r.ae("replaceState")})),this.le()}}ae(t){try{var e,r=null==Yi||null==(e=Yi.location)?void 0:e.pathname;if(!r)return;r!==this.oe&&this.isEnabled&&this._instance.capture("$pageview",{navigation_type:t}),this.oe=r}catch(e){un.error("Error capturing "+t+" pageview",e)}}le(){if(!this.se){var t=()=>{this.ae("popstate")};Sn(Yi,"popstate",t),this.se=()=>{Yi&&Yi.removeEventListener("popstate",t)}}}}var Zd=cn("[SegmentIntegration]");function $d(t,e){var r=t.config.segment;if(!r)return e();!function(t,e){var r=t.config.segment;if(!r)return e();var i=r=>{var i=()=>r.anonymousId()||Ha();t.config.get_device_id=i,r.id()&&(t.register({distinct_id:r.id(),$device_id:i()}),t.persistence.set_property(to,"identified")),e()},n=r.user();"then"in n&&zr(n.then)?n.then((t=>i(t))):i(n)}(t,(()=>{r.register((t=>{Promise&&Promise.resolve||Zd.warn("This browser does not have Promise support, and can not use the segment integration");var e=(e,r)=>{if(!r)return e;e.event.userId||e.event.anonymousId===t.get_distinct_id()||(Zd.info("No userId set, resetting PostHog"),t.reset()),e.event.userId&&e.event.userId!==t.get_distinct_id()&&(Zd.info("UserId set, identifying with PostHog"),t.identify(e.event.userId));var i=t.calculateEventProperties(r,e.event.properties);return e.event.properties=Object.assign({},i,e.event.properties),e};return{name:"PostHog JS",type:"enrichment",version:"1.0.0",isLoaded:()=>!0,load:()=>Promise.resolve(),track:t=>e(t,t.event.event),page:t=>e(t,"$pageview"),identify:t=>e(t,"$identify"),screen:t=>e(t,"$screen")}})(t)).then((()=>{e()}))}))}var qd="posthog-js";function Hd(t,e){var{organization:i,projectId:n,prefix:o,severityAllowList:s=["error"],sendExceptionsToPostHog:a=!0}=void 0===e?{}:e;return e=>{var l,u,c,h,d;if(!("*"===s||s.includes(e.level))||!t.__loaded)return e;e.tags||(e.tags={});var v=t.requestRouter.endpointFor("ui","/project/"+t.config.token+"/person/"+t.get_distinct_id());e.tags["PostHog Person URL"]=v,t.sessionRecordingStarted()&&(e.tags["PostHog Recording URL"]=t.get_session_replay_url({withTimestamp:!0}));var f=(null==(l=e.exception)?void 0:l.values)||[],p=f.map((t=>r({},t,{stacktrace:t.stacktrace?r({},t.stacktrace,{type:"raw",frames:(t.stacktrace.frames||[]).map((t=>r({},t,{platform:"web:javascript"})))}):void 0}))),g={$exception_message:(null==(u=f[0])?void 0:u.value)||e.message,$exception_type:null==(c=f[0])?void 0:c.type,$exception_personURL:v,$exception_level:e.level,$exception_list:p,$sentry_event_id:e.event_id,$sentry_exception:e.exception,$sentry_exception_message:(null==(h=f[0])?void 0:h.value)||e.message,$sentry_exception_type:null==(d=f[0])?void 0:d.type,$sentry_tags:e.tags};return i&&n&&(g.$sentry_url=(o||"https://sentry.io/organizations/")+i+"/issues/?project="+n+"&query="+e.event_id),a&&t.exceptions.sendExceptionEvent(g),e}}class Vd{constructor(t,e,r,i,n,o){this.name=qd,this.setupOnce=function(s){s(Hd(t,{organization:e,projectId:r,prefix:i,severityAllowList:n,sendExceptionsToPostHog:null==o||o}))}}}var jd=null!=Yi&&Yi.location?Mn(Yi.location.hash,"__posthog")||Mn(location.hash,"state"):null,Yd="_postHogToolbarParams",Gd=cn("[Toolbar]"),Wd=function(t){return t[t.UNINITIALIZED=0]="UNINITIALIZED",t[t.LOADING=1]="LOADING",t[t.LOADED=2]="LOADED",t}(Wd||{});class zd{constructor(t){this.instance=t}ue(t){nn.ph_toolbar_state=t}ce(){var t;return null!==(t=nn.ph_toolbar_state)&&void 0!==t?t:Wd.UNINITIALIZED}maybeLoadToolbar(t,e,r){if(void 0===t&&(t=void 0),void 0===e&&(e=void 0),void 0===r&&(r=void 0),!Yi||!Ji)return!1;t=null!=t?t:Yi.location,r=null!=r?r:Yi.history;try{if(!e){try{Yi.localStorage.setItem("test","test"),Yi.localStorage.removeItem("test")}catch(t){return!1}e=null==Yi?void 0:Yi.localStorage}var i,n=jd||Mn(t.hash,"__posthog")||Mn(t.hash,"state"),o=n?mn((()=>JSON.parse(atob(decodeURIComponent(n)))))||mn((()=>JSON.parse(decodeURIComponent(n)))):null;return o&&"ph_authorize"===o.action?((i=o).source="url",i&&Object.keys(i).length>0&&(o.desiredHash?t.hash=o.desiredHash:r?r.replaceState(r.state,"",t.pathname+t.search):t.hash="")):((i=JSON.parse(e.getItem(Yd)||"{}")).source="localstorage",delete i.userIntent),!(!i.token||this.instance.config.token!==i.token)&&(this.loadToolbar(i),!0)}catch(t){return!1}}he(t){var e=nn.ph_load_toolbar||nn.ph_load_editor;!ri(e)&&zr(e)?e(t,this.instance):Gd.warn("No toolbar load function found")}loadToolbar(t){var e=!(null==Ji||!Ji.getElementById(ao));if(!Yi||e)return!1;var i="custom"===this.instance.requestRouter.region&&this.instance.config.advanced_disable_toolbar_metrics,n=r({token:this.instance.config.token},t,{apiURL:this.instance.requestRouter.endpointFor("ui")},i?{instrument:!1}:{});if(Yi.localStorage.setItem(Yd,JSON.stringify(r({},n,{source:void 0}))),this.ce()===Wd.LOADED)this.he(n);else if(this.ce()===Wd.UNINITIALIZED){var o;this.ue(Wd.LOADING),null==(o=nn.__PosthogExtensions__)||null==o.loadExternalDependency||o.loadExternalDependency(this.instance,"toolbar",(t=>{if(t)return Gd.error("[Toolbar] Failed to load",t),void this.ue(Wd.UNINITIALIZED);this.ue(Wd.LOADED),this.he(n)})),Sn(Yi,"turbolinks:load",(()=>{this.ue(Wd.UNINITIALIZED),this.loadToolbar(n)}))}return!0}de(t){return this.loadToolbar(t)}maybeLoadEditor(t,e,r){return void 0===t&&(t=void 0),void 0===e&&(e=void 0),void 0===r&&(r=void 0),this.maybeLoadToolbar(t,e,r)}}var Ud=cn("[TracingHeaders]");class Xd{constructor(t){this.ve=void 0,this.fe=void 0,this.Jt=()=>{var t,e;Kr(this.ve)&&(null==(t=nn.__PosthogExtensions__)||null==(t=t.tracingHeadersPatchFns)||t._patchXHR(this._instance.config.__add_tracing_headers||[],this._instance.get_distinct_id(),this._instance.sessionManager));Kr(this.fe)&&(null==(e=nn.__PosthogExtensions__)||null==(e=e.tracingHeadersPatchFns)||e._patchFetch(this._instance.config.__add_tracing_headers||[],this._instance.get_distinct_id(),this._instance.sessionManager))},this._instance=t}Ut(t){var e,r;null!=(e=nn.__PosthogExtensions__)&&e.tracingHeadersPatchFns&&t(),null==(r=nn.__PosthogExtensions__)||null==r.loadExternalDependency||r.loadExternalDependency(this._instance,"tracing-headers",(e=>{if(e)return Ud.error("failed to load script",e);t()}))}startIfEnabledOrStop(){var t,e;this._instance.config.__add_tracing_headers?this.Ut(this.Jt):(null==(t=this.ve)||t.call(this),null==(e=this.fe)||e.call(this),this.ve=void 0,this.fe=void 0)}}var Jd=cn("[Web Vitals]"),Kd=9e5;class Qd{constructor(t){var e;this.pe=!1,this.ut=!1,this.D={url:void 0,metrics:[],firstMetricTimestamp:void 0},this.ge=()=>{clearTimeout(this.me),0!==this.D.metrics.length&&(this._instance.capture("$web_vitals",this.D.metrics.reduce(((t,e)=>r({},t,{["$web_vitals_"+e.name+"_event"]:r({},e),["$web_vitals_"+e.name+"_value"]:e.value})),{})),this.D={url:void 0,metrics:[],firstMetricTimestamp:void 0})},this.ye=t=>{var e,i=null==(e=this._instance.sessionManager)?void 0:e.checkAndGetSessionAndWindowId(!0);if(Kr(i))Jd.error("Could not read session ID. Dropping metrics!");else{this.D=this.D||{url:void 0,metrics:[],firstMetricTimestamp:void 0};var n=this.be();if(!Kr(n))if(ri(null==t?void 0:t.name)||ri(null==t?void 0:t.value))Jd.error("Invalid metric received",t);else if(this.we&&t.value>=this.we)Jd.error("Ignoring metric with value >= "+this.we,t);else this.D.url!==n&&(this.ge(),this.me=setTimeout(this.ge,this.flushToCaptureTimeoutMs)),Kr(this.D.url)&&(this.D.url=n),this.D.firstMetricTimestamp=Kr(this.D.firstMetricTimestamp)?Date.now():this.D.firstMetricTimestamp,t.attribution&&t.attribution.interactionTargetElement&&(t.attribution.interactionTargetElement=void 0),this.D.metrics.push(r({},t,{$current_url:n,$session_id:i.sessionId,$window_id:i.windowId,timestamp:Date.now()})),this.D.metrics.length===this.allowedMetrics.length&&this.ge()}},this.Jt=()=>{var t,e,r,i,n=nn.__PosthogExtensions__;Kr(n)||Kr(n.postHogWebVitalsCallbacks)||({onLCP:t,onCLS:e,onFCP:r,onINP:i}=n.postHogWebVitalsCallbacks),t&&e&&r&&i?(this.allowedMetrics.indexOf("LCP")>-1&&t(this.ye.bind(this)),this.allowedMetrics.indexOf("CLS")>-1&&e(this.ye.bind(this)),this.allowedMetrics.indexOf("FCP")>-1&&r(this.ye.bind(this)),this.allowedMetrics.indexOf("INP")>-1&&i(this.ye.bind(this)),this.ut=!0):Jd.error("web vitals callbacks not loaded - not starting")},this._instance=t,this.pe=!(null==(e=this._instance.persistence)||!e.props[$n]),this.startIfEnabled()}get allowedMetrics(){var t,e,r=Xr(this._instance.config.capture_performance)?null==(t=this._instance.config.capture_performance)?void 0:t.web_vitals_allowed_metrics:void 0;return Kr(r)?(null==(e=this._instance.persistence)?void 0:e.props[Hn])||["CLS","FCP","INP","LCP"]:r}get flushToCaptureTimeoutMs(){return(Xr(this._instance.config.capture_performance)?this._instance.config.capture_performance.web_vitals_delayed_flush_ms:void 0)||5e3}get we(){var t=Xr(this._instance.config.capture_performance)&&ii(this._instance.config.capture_performance.__web_vitals_max_value)?this._instance.config.capture_performance.__web_vitals_max_value:Kd;return 0<t&&t<=6e4?Kd:t}get isEnabled(){var t=null==Ki?void 0:Ki.protocol;if("http:"!==t&&"https:"!==t)return Jd.info("Web Vitals are disabled on non-http/https protocols"),!1;var e=Xr(this._instance.config.capture_performance)?this._instance.config.capture_performance.web_vitals:ni(this._instance.config.capture_performance)?this._instance.config.capture_performance:void 0;return ni(e)?e:this.pe}startIfEnabled(){this.isEnabled&&!this.ut&&(Jd.info("enabled, starting..."),this.Ut(this.Jt))}onRemoteConfig(t){var e=Xr(t.capturePerformance)&&!!t.capturePerformance.web_vitals,r=Xr(t.capturePerformance)?t.capturePerformance.web_vitals_allowed_metrics:void 0;this._instance.persistence&&(this._instance.persistence.register({[$n]:e}),this._instance.persistence.register({[Hn]:r})),this.pe=e,this.startIfEnabled()}Ut(t){var e,r;null!=(e=nn.__PosthogExtensions__)&&e.postHogWebVitalsCallbacks&&t(),null==(r=nn.__PosthogExtensions__)||null==r.loadExternalDependency||r.loadExternalDependency(this._instance,"web-vitals",(e=>{e?Jd.error("failed to load script",e):t()}))}be(){var t=Yi?Yi.location.href:void 0;return t||Jd.error("Could not determine current URL"),t}}var tv=cn("[Heatmaps]");function ev(t){return Xr(t)&&"clientX"in t&&"clientY"in t&&ii(t.clientX)&&ii(t.clientY)}class rv{constructor(t){var e;this.rageclicks=new od,this.pe=!1,this.ut=!1,this._e=null,this.instance=t,this.pe=!(null==(e=this.instance.persistence)||!e.props[Ln])}get flushIntervalMilliseconds(){var t=5e3;return Xr(this.instance.config.capture_heatmaps)&&this.instance.config.capture_heatmaps.flush_interval_milliseconds&&(t=this.instance.config.capture_heatmaps.flush_interval_milliseconds),t}get isEnabled(){return Kr(this.instance.config.capture_heatmaps)?Kr(this.instance.config.enable_heatmaps)?this.pe:this.instance.config.enable_heatmaps:!1!==this.instance.config.capture_heatmaps}startIfEnabled(){if(this.isEnabled){if(this.ut)return;tv.info("starting..."),this.Ce(),this._e=setInterval(this.Ie.bind(this),this.flushIntervalMilliseconds)}else{var t,e;clearInterval(null!==(t=this._e)&&void 0!==t?t:void 0),null==(e=this.Se)||e.stop(),this.getAndClearBuffer()}}onRemoteConfig(t){var e=!!t.heatmaps;this.instance.persistence&&this.instance.persistence.register({[Ln]:e}),this.pe=e,this.startIfEnabled()}getAndClearBuffer(){var t=this.D;return this.D=void 0,t}ke(t){this.It(t.originalEvent,"deadclick")}Ce(){Yi&&Ji&&(Sn(Yi,"beforeunload",this.Ie.bind(this)),Sn(Ji,"click",(t=>this.It(t||(null==Yi?void 0:Yi.event))),{capture:!0}),Sn(Ji,"mousemove",(t=>this.xe(t||(null==Yi?void 0:Yi.event))),{capture:!0}),this.Se=new Pd(this.instance,Fd,this.ke.bind(this)),this.Se.startIfEnabled(),this.ut=!0)}Ae(t,e){var r=this.instance.scrollManager.scrollY(),i=this.instance.scrollManager.scrollX(),n=this.instance.scrollManager.scrollElement(),o=function(t,e,r){for(var i=t;i&&ho(i)&&!vo(i,"body");){if(i===r)return!1;if($r(e,null==Yi?void 0:Yi.getComputedStyle(i).position))return!0;i=So(i)}return!1}(_o(t),["fixed","sticky"],n);return{x:t.clientX+(o?0:i),y:t.clientY+(o?0:r),target_fixed:o,type:e}}It(t,e){var i;if(void 0===e&&(e="click"),!co(t.target)&&ev(t)){var n=this.Ae(t,e);null!=(i=this.rageclicks)&&i.isRageClick(t.clientX,t.clientY,(new Date).getTime())&&this.Te(r({},n,{type:"rageclick"})),this.Te(n)}}xe(t){!co(t.target)&&ev(t)&&(clearTimeout(this.Me),this.Me=setTimeout((()=>{this.Te(this.Ae(t,"mousemove"))}),500))}Te(t){if(Yi){var e=Yi.location.href;this.D=this.D||{},this.D[e]||(this.D[e]=[]),this.D[e].push(t)}}Ie(){this.D&&!Jr(this.D)&&this.instance.capture("$$heatmap",{$heatmap_data:this.getAndClearBuffer()})}}class iv{constructor(t){this._instance=t}doPageView(t,e){var r,i=this.Ee(t,e);return this.Ne={pathname:null!==(r=null==Yi?void 0:Yi.location.pathname)&&void 0!==r?r:"",pageViewId:e,timestamp:t},this._instance.scrollManager.resetContext(),i}doPageLeave(t){var e;return this.Ee(t,null==(e=this.Ne)?void 0:e.pageViewId)}doEvent(){var t;return{$pageview_id:null==(t=this.Ne)?void 0:t.pageViewId}}Ee(t,e){var r=this.Ne;if(!r)return{$pageview_id:e};var i={$pageview_id:e,$prev_pageview_id:r.pageViewId},n=this._instance.scrollManager.getContext();if(n&&!this._instance.config.disable_scroll_properties){var{maxScrollHeight:o,lastScrollY:s,maxScrollY:a,maxContentHeight:l,lastContentY:u,maxContentY:c}=n;if(!(Kr(o)||Kr(s)||Kr(a)||Kr(l)||Kr(u)||Kr(c))){o=Math.ceil(o),s=Math.ceil(s),a=Math.ceil(a),l=Math.ceil(l),u=Math.ceil(u),c=Math.ceil(c);var h=o<=1?1:vi(s/o,0,1,un),d=o<=1?1:vi(a/o,0,1,un),v=l<=1?1:vi(u/l,0,1,un),f=l<=1?1:vi(c/l,0,1,un);i=fn(i,{$prev_pageview_last_scroll:s,$prev_pageview_last_scroll_percentage:h,$prev_pageview_max_scroll:a,$prev_pageview_max_scroll_percentage:d,$prev_pageview_last_content:u,$prev_pageview_last_content_percentage:v,$prev_pageview_max_content:c,$prev_pageview_max_content_percentage:f})}}return r.pathname&&(i.$prev_pageview_pathname=r.pathname),r.timestamp&&(i.$prev_pageview_duration=(t.getTime()-r.timestamp.getTime())/1e3),i}}var nv="https?://(.*)",ov=["gclid","gclsrc","dclid","gbraid","wbraid","fbclid","msclkid","twclid","li_fat_id","igshid","ttclid","rdt_cid","epik","qclid","sccid","irclid","_kx"],sv=pn(["utm_source","utm_medium","utm_campaign","utm_content","utm_term","gad_source","mc_cid"],ov),av="<masked>",lv=["li_fat_id"];function uv(t,e,r){if(!Ji)return{};var i,n=e?pn([],ov,r||[]):[],o=cv(Tn(Ji.URL,n,av),t),s=(i={},vn(lv,(function(t){var e=_d.Zt(t);i[t]=e||null})),i);return fn(s,o)}function cv(t,e){var r=sv.concat(e||[]),i={};return vn(r,(function(e){var r=An(t,e);i[e]=r||null})),i}function hv(t){var e=function(t){return t?0===t.search(nv+"google.([^/?]*)")?"google":0===t.search(nv+"bing.com")?"bing":0===t.search(nv+"yahoo.com")?"yahoo":0===t.search(nv+"duckduckgo.com")?"duckduckgo":null:null}(t),r="yahoo"!=e?"q":"p",i={};if(!ei(e)){i.$search_engine=e;var n=Ji?An(Ji.referrer,r):"";n.length&&(i.ph_keyword=n)}return i}function dv(){return navigator.language||navigator.userLanguage}function vv(){return(null==Ji?void 0:Ji.referrer)||"$direct"}function fv(t,e){var r=t?pn([],ov,e||[]):[],i=null==Ki?void 0:Ki.href.substring(0,1e3);return{r:vv().substring(0,1e3),u:i?Tn(i,r,av):void 0}}function pv(t){var e,{r:r,u:i}=t,n={$referrer:r,$referring_domain:null==r?void 0:"$direct"==r?"$direct":null==(e=kn(r))?void 0:e.host};if(i){n.$current_url=i;var o=kn(i);n.$host=null==o?void 0:o.host,n.$pathname=null==o?void 0:o.pathname;var s=cv(i);fn(n,s)}if(r){var a=hv(r);fn(n,a)}return n}function gv(){try{return Intl.DateTimeFormat().resolvedOptions().timeZone}catch(t){return}}function mv(){try{return(new Date).getTimezoneOffset()}catch(t){return}}function yv(t,e){if(!rn)return{};var r,i=t?pn([],ov,e||[]):[],[n,o]=function(t){for(var e=0;e<Bl.length;e++){var[r,i]=Bl[e],n=r.exec(t),o=n&&(zr(i)?i(n,t):i);if(o)return o}return["",""]}(rn);return fn(bn({$os:n,$os_version:o,$browser:Pl(rn,navigator.vendor),$device:Zl(rn),$device_type:$l(rn),$timezone:gv(),$timezone_offset:mv()}),{$current_url:Tn(null==Ki?void 0:Ki.href,i,av),$host:null==Ki?void 0:Ki.host,$pathname:null==Ki?void 0:Ki.pathname,$raw_user_agent:rn.length>1e3?rn.substring(0,997)+"...":rn,$browser_version:Dl(rn,navigator.vendor),$browser_language:dv(),$browser_language_prefix:(r=dv(),"string"==typeof r?r.split("-")[0]:void 0),$screen_height:null==Yi?void 0:Yi.screen.height,$screen_width:null==Yi?void 0:Yi.screen.width,$viewport_height:null==Yi?void 0:Yi.innerHeight,$viewport_width:null==Yi?void 0:Yi.innerWidth,$lib:"web",$lib_version:an.LIB_VERSION,$insert_id:Math.random().toString(36).substring(2,10)+Math.random().toString(36).substring(2,10),$time:Date.now()/1e3})}var bv=cn("[FeatureFlags]"),wv="$active_feature_flags",_v="$override_feature_flags",Cv="$feature_flag_payloads",Iv="$override_feature_flag_payloads",Sv="$feature_flag_request_id",kv=t=>{var e={};for(var[r,i]of gn(t||{}))i&&(e[r]=i);return e},xv=t=>{var e=t.flags;return e?(t.featureFlags=Object.fromEntries(Object.keys(e).map((t=>{var r;return[t,null!==(r=e[t].variant)&&void 0!==r?r:e[t].enabled]}))),t.featureFlagPayloads=Object.fromEntries(Object.keys(e).filter((t=>e[t].enabled)).filter((t=>{var r;return null==(r=e[t].metadata)?void 0:r.payload})).map((t=>{var r;return[t,null==(r=e[t].metadata)?void 0:r.payload]})))):bv.warn("Using an older version of the feature flags endpoint. Please upgrade your PostHog server to the latest version"),t},Av=function(t){return t.FeatureFlags="feature_flags",t.Recordings="recordings",t}({});class Tv{constructor(t){this.Re=!1,this.Fe=!1,this.Oe=!1,this.Pe=!1,this.Le=!1,this.De=!1,this.Be=!1,this._instance=t,this.featureFlagEventHandlers=[]}Ze(){var t=this._instance.config.evaluation_environments;return null!=t&&t.length?t.filter((t=>{var e=t&&"string"==typeof t&&t.trim().length>0;return e||bv.error("Invalid evaluation environment found:",t,"Expected non-empty string"),e})):[]}$e(){return this.Ze().length>0}flags(){if(this._instance.config.__preview_remote_config)this.De=!0;else{var t=!this.qe&&(this._instance.config.advanced_disable_feature_flags||this._instance.config.advanced_disable_feature_flags_on_first_load);this.He({disableFlags:t})}}get hasLoadedFlags(){return this.Fe}getFlags(){return Object.keys(this.getFlagVariants())}getFlagsWithDetails(){var t=this._instance.get_property(zn),e=this._instance.get_property(_v),i=this._instance.get_property(Iv);if(!i&&!e)return t||{};var n=fn({},t||{}),o=[...new Set([...Object.keys(i||{}),...Object.keys(e||{})])];for(var s of o){var a,l,u=n[s],c=null==e?void 0:e[s],h=Kr(c)?null!==(a=null==u?void 0:u.enabled)&&void 0!==a&&a:!!c,d=Kr(c)?u.variant:"string"==typeof c?c:void 0,v=null==i?void 0:i[s],f=r({},u,{enabled:h,variant:h?null!=d?d:null==u?void 0:u.variant:void 0});if(h!==(null==u?void 0:u.enabled)&&(f.original_enabled=null==u?void 0:u.enabled),d!==(null==u?void 0:u.variant)&&(f.original_variant=null==u?void 0:u.variant),v)f.metadata=r({},null==u?void 0:u.metadata,{payload:v,original_payload:null==u||null==(l=u.metadata)?void 0:l.payload});n[s]=f}return this.Re||(bv.warn(" Overriding feature flag details!",{flagDetails:t,overriddenPayloads:i,finalDetails:n}),this.Re=!0),n}getFlagVariants(){var t=this._instance.get_property(Gn),e=this._instance.get_property(_v);if(!e)return t||{};for(var r=fn({},t),i=Object.keys(e),n=0;n<i.length;n++)r[i[n]]=e[i[n]];return this.Re||(bv.warn(" Overriding feature flags!",{enabledFlags:t,overriddenFlags:e,finalFlags:r}),this.Re=!0),r}getFlagPayloads(){var t=this._instance.get_property(Cv),e=this._instance.get_property(Iv);if(!e)return t||{};for(var r=fn({},t||{}),i=Object.keys(e),n=0;n<i.length;n++)r[i[n]]=e[i[n]];return this.Re||(bv.warn(" Overriding feature flag payloads!",{flagPayloads:t,overriddenPayloads:e,finalPayloads:r}),this.Re=!0),r}reloadFeatureFlags(){this.Pe||this._instance.config.advanced_disable_feature_flags||this.qe||(this.qe=setTimeout((()=>{this.He()}),5))}Ve(){clearTimeout(this.qe),this.qe=void 0}ensureFlagsLoaded(){this.Fe||this.Oe||this.qe||this.reloadFeatureFlags()}setAnonymousDistinctId(t){this.$anon_distinct_id=t}setReloadingPaused(t){this.Pe=t}He(t){var e;if(this.Ve(),!this._instance.yt())if(this.Oe)this.Le=!0;else{var i={token:this._instance.config.token,distinct_id:this._instance.get_distinct_id(),groups:this._instance.getGroups(),$anon_distinct_id:this.$anon_distinct_id,person_properties:r({},(null==(e=this._instance.persistence)?void 0:e.get_initial_props())||{},this._instance.get_property(Un)||{}),group_properties:this._instance.get_property(Xn)};(null!=t&&t.disableFlags||this._instance.config.advanced_disable_feature_flags)&&(i.disable_flags=!0),this.$e()&&(i.evaluation_environments=this.Ze());var n=this._instance.config.__preview_remote_config,o=n?"/flags/?v=2":"/flags/?v=2&config=true",s=this._instance.config.advanced_only_evaluate_survey_feature_flags?"&only_evaluate_survey_feature_flags=true":"",a=this._instance.requestRouter.endpointFor("api",o+s);n&&(i.timezone=gv()),this.Oe=!0,this._instance.je({method:"POST",url:a,data:i,compression:this._instance.config.disable_compression?void 0:Hl.Base64,timeout:this._instance.config.feature_flag_request_timeout_ms,callback:t=>{var e,r,n=!0;(200===t.statusCode&&(this.Le||(this.$anon_distinct_id=void 0),n=!1),this.Oe=!1,this.De)||(this.De=!0,this._instance.Ye(null!==(r=t.json)&&void 0!==r?r:{}));if(!i.disable_flags||this.Le)if(this.Be=!n,t.json&&null!=(e=t.json.quotaLimited)&&e.includes(Av.FeatureFlags))bv.warn("You have hit your feature flags quota limit, and will not be able to load feature flags until the quota is reset. Please visit https://posthog.com/docs/billing/limits-alerts to learn more.");else{var o;if(!i.disable_flags)this.receivedFeatureFlags(null!==(o=t.json)&&void 0!==o?o:{},n);this.Le&&(this.Le=!1,this.He())}}})}}getFeatureFlag(t,e){if(void 0===e&&(e={}),this.Fe||this.getFlags()&&this.getFlags().length>0){var r=this.getFlagVariants()[t],i=""+r,n=this._instance.get_property(Sv)||void 0,o=this._instance.get_property(Qn)||{};if((e.send_event||!("send_event"in e))&&(!(t in o)||!o[t].includes(i))){var s,a,l,u,c,h,d,v,f;Wr(o[t])?o[t].push(i):o[t]=[i],null==(s=this._instance.persistence)||s.register({[Qn]:o});var p=this.getFeatureFlagDetails(t),g={$feature_flag:t,$feature_flag_response:r,$feature_flag_payload:this.getFeatureFlagPayload(t)||null,$feature_flag_request_id:n,$feature_flag_bootstrapped_response:(null==(a=this._instance.config.bootstrap)||null==(a=a.featureFlags)?void 0:a[t])||null,$feature_flag_bootstrapped_payload:(null==(l=this._instance.config.bootstrap)||null==(l=l.featureFlagPayloads)?void 0:l[t])||null,$used_bootstrap_value:!this.Be};Kr(null==p||null==(u=p.metadata)?void 0:u.version)||(g.$feature_flag_version=p.metadata.version);var m,y=null!==(c=null==p||null==(h=p.reason)?void 0:h.description)&&void 0!==c?c:null==p||null==(d=p.reason)?void 0:d.code;if(y&&(g.$feature_flag_reason=y),null!=p&&null!=(v=p.metadata)&&v.id&&(g.$feature_flag_id=p.metadata.id),Kr(null==p?void 0:p.original_variant)&&Kr(null==p?void 0:p.original_enabled)||(g.$feature_flag_original_response=Kr(p.original_variant)?p.original_enabled:p.original_variant),null!=p&&null!=(f=p.metadata)&&f.original_payload)g.$feature_flag_original_payload=null==p||null==(m=p.metadata)?void 0:m.original_payload;this._instance.capture("$feature_flag_called",g)}return r}bv.warn('getFeatureFlag for key "'+t+"\" failed. Feature flags didn't load in time.")}getFeatureFlagDetails(t){return this.getFlagsWithDetails()[t]}getFeatureFlagPayload(t){return this.getFlagPayloads()[t]}getRemoteConfigPayload(t,e){var r=this._instance.config.token,i={distinct_id:this._instance.get_distinct_id(),token:r};this.$e()&&(i.evaluation_environments=this.Ze()),this._instance.je({method:"POST",url:this._instance.requestRouter.endpointFor("api","/flags/?v=2&config=true"),data:i,compression:this._instance.config.disable_compression?void 0:Hl.Base64,timeout:this._instance.config.feature_flag_request_timeout_ms,callback:r=>{var i,n=null==(i=r.json)?void 0:i.featureFlagPayloads;e((null==n?void 0:n[t])||void 0)}})}isFeatureEnabled(t,e){if(void 0===e&&(e={}),this.Fe||this.getFlags()&&this.getFlags().length>0){var r=this.getFeatureFlag(t,e);return Kr(r)?void 0:!!r}bv.warn('isFeatureEnabled for key "'+t+"\" failed. Feature flags didn't load in time.")}addFeatureFlagsHandler(t){this.featureFlagEventHandlers.push(t)}removeFeatureFlagsHandler(t){this.featureFlagEventHandlers=this.featureFlagEventHandlers.filter((e=>e!==t))}receivedFeatureFlags(t,e){if(this._instance.persistence){this.Fe=!0;var i=this.getFlagVariants(),n=this.getFlagPayloads(),o=this.getFlagsWithDetails();!function(t,e,i,n,o){void 0===i&&(i={}),void 0===n&&(n={}),void 0===o&&(o={});var s=xv(t),a=s.flags,l=s.featureFlags,u=s.featureFlagPayloads;if(l){var c=t.requestId;if(Wr(l)){bv.warn("v1 of the feature flags endpoint is deprecated. Please use the latest version.");var h={};if(l)for(var d=0;d<l.length;d++)h[l[d]]=!0;e&&e.register({[wv]:l,[Gn]:h})}else{var v=l,f=u,p=a;t.errorsWhileComputingFlags&&(v=r({},i,v),f=r({},n,f),p=r({},o,p)),e&&e.register(r({[wv]:Object.keys(kv(v)),[Gn]:v||{},[Cv]:f||{},[zn]:p||{}},c?{[Sv]:c}:{}))}}}(t,this._instance.persistence,i,n,o),this.Ge(e)}}override(t,e){void 0===e&&(e=!1),bv.warn("override is deprecated. Please use overrideFeatureFlags instead."),this.overrideFeatureFlags({flags:t,suppressWarning:e})}overrideFeatureFlags(t){if(!this._instance.__loaded||!this._instance.persistence)return bv.uninitializedWarning("posthog.featureFlags.overrideFeatureFlags");if(!1===t)return this._instance.persistence.unregister(_v),this._instance.persistence.unregister(Iv),void this.Ge();if(t&&"object"==typeof t&&("flags"in t||"payloads"in t)){var e,r=t;if(this.Re=Boolean(null!==(e=r.suppressWarning)&&void 0!==e&&e),"flags"in r)if(!1===r.flags)this._instance.persistence.unregister(_v);else if(r.flags)if(Wr(r.flags)){for(var i={},n=0;n<r.flags.length;n++)i[r.flags[n]]=!0;this._instance.persistence.register({[_v]:i})}else this._instance.persistence.register({[_v]:r.flags});return"payloads"in r&&(!1===r.payloads?this._instance.persistence.unregister(Iv):r.payloads&&this._instance.persistence.register({[Iv]:r.payloads})),void this.Ge()}this.Ge()}onFeatureFlags(t){if(this.addFeatureFlagsHandler(t),this.Fe){var{flags:e,flagVariants:r}=this.We();t(e,r)}return()=>this.removeFeatureFlagsHandler(t)}updateEarlyAccessFeatureEnrollment(t,e,i){var n,o=(this._instance.get_property(Wn)||[]).find((e=>e.flagKey===t)),s={["$feature_enrollment/"+t]:e},a={$feature_flag:t,$feature_enrollment:e,$set:s};o&&(a.$early_access_feature_name=o.name),i&&(a.$feature_enrollment_stage=i),this._instance.capture("$feature_enrollment_update",a),this.setPersonPropertiesForFlags(s,!1);var l=r({},this.getFlagVariants(),{[t]:e});null==(n=this._instance.persistence)||n.register({[wv]:Object.keys(kv(l)),[Gn]:l}),this.Ge()}getEarlyAccessFeatures(t,e,r){void 0===e&&(e=!1);var i=this._instance.get_property(Wn),n=r?"&"+r.map((t=>"stage="+t)).join("&"):"";if(i&&!e)return t(i);this._instance.je({url:this._instance.requestRouter.endpointFor("api","/api/early_access_features/?token="+this._instance.config.token+n),method:"GET",callback:e=>{var r,i;if(e.json){var n=e.json.earlyAccessFeatures;return null==(r=this._instance.persistence)||r.unregister(Wn),null==(i=this._instance.persistence)||i.register({[Wn]:n}),t(n)}}})}We(){var t=this.getFlags(),e=this.getFlagVariants();return{flags:t.filter((t=>e[t])),flagVariants:Object.keys(e).filter((t=>e[t])).reduce(((t,r)=>(t[r]=e[r],t)),{})}}Ge(t){var{flags:e,flagVariants:r}=this.We();this.featureFlagEventHandlers.forEach((i=>i(e,r,{errorsLoading:t})))}setPersonPropertiesForFlags(t,e){void 0===e&&(e=!0);var i=this._instance.get_property(Un)||{};this._instance.register({[Un]:r({},i,t)}),e&&this._instance.reloadFeatureFlags()}resetPersonPropertiesForFlags(){this._instance.unregister(Un)}setGroupPropertiesForFlags(t,e){void 0===e&&(e=!0);var i=this._instance.get_property(Xn)||{};0!==Object.keys(i).length&&Object.keys(i).forEach((e=>{i[e]=r({},i[e],t[e]),delete t[e]})),this._instance.register({[Xn]:r({},i,t)}),e&&this._instance.reloadFeatureFlags()}resetGroupPropertiesForFlags(t){if(t){var e=this._instance.get_property(Xn)||{};this._instance.register({[Xn]:r({},e,{[t]:{}})})}else this._instance.unregister(Xn)}reset(){this.Fe=!1,this.Oe=!1,this.Pe=!1,this.Le=!1,this.De=!1,this.Be=!1,this.$anon_distinct_id=void 0,this.Ve(),this.Re=!1}}var Mv=["cookie","localstorage","localstorage+cookie","sessionstorage","memory"];class Ev{constructor(t,e){this.vt=t,this.props={},this.ze=!1,this.Ue=(t=>{var e="";return t.token&&(e=t.token.replace(/\+/g,"PL").replace(/\//g,"SL").replace(/=/g,"EQ")),t.persistence_name?"ph_"+t.persistence_name:"ph_"+e+"_posthog"})(t),this.Yt=this.Xe(t),this.load(),t.debug&&un.info("Persistence loaded",t.persistence,r({},this.props)),this.update_config(t,t,e),this.save()}isDisabled(){return!!this.Je}Xe(t){-1===Mv.indexOf(t.persistence.toLowerCase())&&(un.critical("Unknown persistence type "+t.persistence+"; falling back to localStorage+cookie"),t.persistence="localStorage+cookie");var e=t.persistence.toLowerCase();return"localstorage"===e&&Id.Dt()?Id:"localstorage+cookie"===e&&kd.Dt()?kd:"sessionstorage"===e&&Md.Dt()?Md:"memory"===e?Ad:"cookie"===e?_d:kd.Dt()?kd:_d}properties(){var t={};return vn(this.props,(function(e,r){if(r===Gn&&Xr(e))for(var i=Object.keys(e),n=0;n<i.length;n++)t["$feature/"+i[n]]=e[i[n]];else s=r,a=!1,(ei(o=uo)?a:Ui&&o.indexOf===Ui?-1!=o.indexOf(s):(vn(o,(function(t){if(a||(a=t===s))return hn})),a))||(t[r]=e);var o,s,a})),t}load(){if(!this.Je){var t=this.Yt.$t(this.Ue);t&&(this.props=fn({},t))}}save(){this.Je||this.Yt.qt(this.Ue,this.props,this.Ke,this.Qe,this.tr,this.vt.debug)}remove(){this.Yt.Ht(this.Ue,!1),this.Yt.Ht(this.Ue,!0)}clear(){this.remove(),this.props={}}register_once(t,e,r){if(Xr(t)){Kr(e)&&(e="None"),this.Ke=Kr(r)?this.er:r;var i=!1;if(vn(t,((t,r)=>{this.props.hasOwnProperty(r)&&this.props[r]!==e||(this.props[r]=t,i=!0)})),i)return this.save(),!0}return!1}register(t,e){if(Xr(t)){this.Ke=Kr(e)?this.er:e;var r=!1;if(vn(t,((e,i)=>{t.hasOwnProperty(i)&&this.props[i]!==e&&(this.props[i]=e,r=!0)})),r)return this.save(),!0}return!1}unregister(t){t in this.props&&(delete this.props[t],this.save())}update_campaign_params(){if(!this.ze){var t=uv(this.vt.custom_campaign_params,this.vt.mask_personal_data_properties,this.vt.custom_personal_data_properties);Jr(bn(t))||this.register(t),this.ze=!0}}update_search_keyword(){var t;this.register((t=null==Ji?void 0:Ji.referrer)?hv(t):{})}update_referrer_info(){var t;this.register_once({$referrer:vv(),$referring_domain:null!=Ji&&Ji.referrer&&(null==(t=kn(Ji.referrer))?void 0:t.host)||"$direct"},void 0)}set_initial_person_info(){this.props[io]||this.props[no]||this.register_once({[oo]:fv(this.vt.mask_personal_data_properties,this.vt.custom_personal_data_properties)},void 0)}get_initial_props(){var t={};vn([no,io],(e=>{var r=this.props[e];r&&vn(r,(function(e,r){t["$initial_"+Hr(r)]=e}))}));var e,r,i=this.props[oo];if(i){var n=(e=pv(i),r={},vn(e,(function(t,e){r["$initial_"+Hr(e)]=t})),r);fn(t,n)}return t}safe_merge(t){return vn(this.props,(function(e,r){r in t||(t[r]=e)})),t}update_config(t,e,r){if(this.er=this.Ke=t.cookie_expiration,this.set_disabled(t.disable_persistence||!!r),this.set_cross_subdomain(t.cross_subdomain_cookie),this.set_secure(t.secure_cookie),t.persistence!==e.persistence){var i=this.Xe(t),n=this.props;this.clear(),this.Yt=i,this.props=n,this.save()}}set_disabled(t){this.Je=t,this.Je?this.remove():this.save()}set_cross_subdomain(t){t!==this.Qe&&(this.Qe=t,this.remove(),this.save())}set_secure(t){t!==this.tr&&(this.tr=t,this.remove(),this.save())}set_event_timer(t,e){var r=this.props[On]||{};r[t]=e,this.props[On]=r,this.save()}remove_event_timer(t){var e=(this.props[On]||{})[t];return Kr(e)||(delete this.props[On][t],this.save()),e}get_property(t){return this.props[t]}set_property(t,e){this.props[t]=e,this.save()}}class Nv{constructor(){this.rr={},this.rr={}}on(t,e){return this.rr[t]||(this.rr[t]=[]),this.rr[t].push(e),()=>{this.rr[t]=this.rr[t].filter((t=>t!==e))}}emit(t,e){for(var r of this.rr[t]||[])r(e);for(var i of this.rr["*"]||[])i(t,e)}}class Rv{constructor(t){this.ir=new Nv,this.nr=(t,e)=>this.sr(t,e)&&this.ar(t,e)&&this.lr(t,e),this.sr=(t,e)=>null==e||!e.event||(null==t?void 0:t.event)===(null==e?void 0:e.event),this._instance=t,this.ur=new Set,this.cr=new Set}init(){var t;if(!Kr(null==(t=this._instance)?void 0:t.hr)){var e;null==(e=this._instance)||e.hr(((t,e)=>{this.on(t,e)}))}}register(t){var e,r;if(!Kr(null==(e=this._instance)?void 0:e.hr)&&(t.forEach((t=>{var e,r;null==(e=this.cr)||e.add(t),null==(r=t.steps)||r.forEach((t=>{var e;null==(e=this.ur)||e.add((null==t?void 0:t.event)||"")}))})),null!=(r=this._instance)&&r.autocapture)){var i,n=new Set;t.forEach((t=>{var e;null==(e=t.steps)||e.forEach((t=>{null!=t&&t.selector&&n.add(null==t?void 0:t.selector)}))})),null==(i=this._instance)||i.autocapture.setElementSelectors(n)}}on(t,e){var r;null!=e&&0!=t.length&&(this.ur.has(t)||this.ur.has(null==e?void 0:e.event))&&this.cr&&(null==(r=this.cr)?void 0:r.size)>0&&this.cr.forEach((t=>{this.dr(e,t)&&this.ir.emit("actionCaptured",t.name)}))}vr(t){this.onAction("actionCaptured",(e=>t(e)))}dr(t,e){if(null==(null==e?void 0:e.steps))return!1;for(var r of e.steps)if(this.nr(t,r))return!0;return!1}onAction(t,e){return this.ir.on(t,e)}ar(t,e){if(null!=e&&e.url){var r,i=null==t||null==(r=t.properties)?void 0:r.$current_url;if(!i||"string"!=typeof i)return!1;if(!Rv.pr(i,null==e?void 0:e.url,(null==e?void 0:e.url_matching)||"contains"))return!1}return!0}static pr(t,e,r){switch(r){case"regex":return!!Yi&&Eu(t,e);case"exact":return e===t;case"contains":var i=Rv.gr(e).replace(/_/g,".").replace(/%/g,".*");return Eu(t,i);default:return!1}}static gr(t){return t.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}lr(t,e){if((null!=e&&e.href||null!=e&&e.tag_name||null!=e&&e.text)&&!this.mr(t).some((t=>!(null!=e&&e.href&&!Rv.pr(t.href||"",null==e?void 0:e.href,(null==e?void 0:e.href_matching)||"exact"))&&((null==e||!e.tag_name||t.tag_name===(null==e?void 0:e.tag_name))&&!(null!=e&&e.text&&!Rv.pr(t.text||"",null==e?void 0:e.text,(null==e?void 0:e.text_matching)||"exact")&&!Rv.pr(t.$el_text||"",null==e?void 0:e.text,(null==e?void 0:e.text_matching)||"exact"))))))return!1;if(null!=e&&e.selector){var r,i=null==t||null==(r=t.properties)?void 0:r.$element_selectors;if(!i)return!1;if(!i.includes(null==e?void 0:e.selector))return!1}return!0}mr(t){return null==(null==t?void 0:t.properties.$elements)?[]:null==t?void 0:t.properties.$elements}}class Fv{constructor(t){this._instance=t,this.yr=new Map,this.br=new Map}register(t){var e;Kr(null==(e=this._instance)?void 0:e.hr)||(this.wr(t),this._r(t))}_r(t){var e=t.filter((t=>{var e,r;return(null==(e=t.conditions)?void 0:e.actions)&&(null==(r=t.conditions)||null==(r=r.actions)||null==(r=r.values)?void 0:r.length)>0}));if(0!==e.length){if(null==this.Cr){this.Cr=new Rv(this._instance),this.Cr.init();this.Cr.vr((t=>{this.onAction(t)}))}e.forEach((t=>{var e,r,i,n,o;t.conditions&&null!=(e=t.conditions)&&e.actions&&null!=(r=t.conditions)&&null!=(r=r.actions)&&r.values&&(null==(i=t.conditions)||null==(i=i.actions)||null==(i=i.values)?void 0:i.length)>0&&(null==(n=this.Cr)||n.register(t.conditions.actions.values),null==(o=t.conditions)||null==(o=o.actions)||null==(o=o.values)||o.forEach((e=>{if(e&&e.name){var r=this.br.get(e.name);r&&r.push(t.id),this.br.set(e.name,r||[t.id])}})))}))}}wr(t){var e;if(0!==t.filter((t=>{var e,r;return(null==(e=t.conditions)?void 0:e.events)&&(null==(r=t.conditions)||null==(r=r.events)||null==(r=r.values)?void 0:r.length)>0})).length){null==(e=this._instance)||e.hr(((t,e)=>{this.onEvent(t,e)})),t.forEach((t=>{var e;null==(e=t.conditions)||null==(e=e.events)||null==(e=e.values)||e.forEach((e=>{if(e&&e.name){var r=this.yr.get(e.name);r&&r.push(t.id),this.yr.set(e.name,r||[t.id])}}))}))}}onEvent(t,e){var r,i,n=(null==(r=this._instance)||null==(r=r.persistence)?void 0:r.props[Kn])||[];if(Ca.SHOWN===t&&e&&n.length>0){var o;ka.info("survey event matched, removing survey from activated surveys",{event:t,eventPayload:e,existingActivatedSurveys:n});var s=null==e||null==(o=e.properties)?void 0:o.$survey_id;if(s){var a=n.indexOf(s);a>=0&&(n.splice(a,1),this.Ir(n))}}else if(this.yr.has(t)){ka.info("survey event name matched",{event:t,eventPayload:e,surveys:this.yr.get(t)});var l=[];null==(i=this._instance)||i.getSurveys((e=>{l=e.filter((e=>{var r;return null==(r=this.yr.get(t))?void 0:r.includes(e.id)}))}));var u=l.filter((r=>{var i,n=null==(i=r.conditions)||null==(i=i.events)||null==(i=i.values)?void 0:i.find((e=>e.name===t));return!!n&&(!n.propertyFilters||Object.entries(n.propertyFilters).every((t=>{var r,[i,n]=t,o=null==e||null==(r=e.properties)?void 0:r[i];if(Kr(o)||ei(o))return!1;var s=[String(o)],a=Ru[n.operator];return a?a(n.values,s):(ka.warn("Unknown property comparison operator: "+n.operator),!1)})))}));this.Ir(n.concat(u.map((t=>t.id))||[]))}}onAction(t){var e,r=(null==(e=this._instance)||null==(e=e.persistence)?void 0:e.props[Kn])||[];this.br.has(t)&&this.Ir(r.concat(this.br.get(t)||[]))}Ir(t){var e;ka.info("updating activated surveys",{activatedSurveys:t}),null==(e=this._instance)||null==(e=e.persistence)||e.register({[Kn]:[...new Set(t)]})}getSurveys(){var t,e=null==(t=this._instance)||null==(t=t.persistence)?void 0:t.props[Kn];return e||[]}getEventToSurveys(){return this.yr}Sr(){return this.Cr}}class Ov{constructor(t){this.kr=void 0,this._surveyManager=null,this.Ar=!1,this.Tr=!1,this.Mr=[],this._instance=t,this._surveyEventReceiver=null}onRemoteConfig(t){if(!this._instance.config.disable_surveys){var e=t.surveys;if(ri(e))return ka.warn("Flags not loaded yet. Not loading surveys.");var r=Wr(e);this.kr=r?e.length>0:e,ka.info("flags response received, isSurveysEnabled: "+this.kr),this.loadIfEnabled()}}reset(){localStorage.removeItem("lastSeenSurveyDate");for(var t=[],e=0;e<localStorage.length;e++){var r=localStorage.key(e);(null!=r&&r.startsWith(Ma)||null!=r&&r.startsWith(Ea))&&t.push(r)}t.forEach((t=>localStorage.removeItem(t)))}loadIfEnabled(){if(!this._surveyManager)if(this.Tr)ka.info("Already initializing surveys, skipping...");else if(this._instance.config.disable_surveys)ka.info("Disabled. Not loading surveys.");else if(this._instance.config.cookieless_mode&&this._instance.consent.isOptedOut())ka.info("Not loading surveys in cookieless mode without consent.");else{var t=null==nn?void 0:nn.__PosthogExtensions__;if(t){if(!Kr(this.kr)||this._instance.config.advanced_enable_surveys){var e=this.kr||this._instance.config.advanced_enable_surveys;this.Tr=!0;try{var r=t.generateSurveys;if(r)return void this.Er(r,e);var i=t.loadExternalDependency;if(!i)return void this.Nr("PostHog loadExternalDependency extension not found.");i(this._instance,"surveys",(r=>{r||!t.generateSurveys?this.Nr("Could not load surveys script",r):this.Er(t.generateSurveys,e)}))}catch(t){throw this.Nr("Error initializing surveys",t),t}finally{this.Tr=!1}}}else ka.error("PostHog Extensions not found.")}}Er(t,e){this._surveyManager=t(this._instance,e),this._surveyEventReceiver=new Fv(this._instance),ka.info("Surveys loaded successfully"),this.Rr({isLoaded:!0})}Nr(t,e){ka.error(t,e),this.Rr({isLoaded:!1,error:t})}onSurveysLoaded(t){return this.Mr.push(t),this._surveyManager&&this.Rr({isLoaded:!0}),()=>{this.Mr=this.Mr.filter((e=>e!==t))}}getSurveys(t,e){if(void 0===e&&(e=!1),this._instance.config.disable_surveys)return ka.info("Disabled. Not loading surveys."),t([]);var r=this._instance.get_property(Jn);if(r&&!e)return t(r,{isLoaded:!0});if(this.Ar)return t([],{isLoaded:!1,error:"Surveys are already being loaded"});try{this.Ar=!0,this._instance.je({url:this._instance.requestRouter.endpointFor("api","/api/surveys/?token="+this._instance.config.token),method:"GET",timeout:this._instance.config.surveys_request_timeout_ms,callback:e=>{var r;this.Ar=!1;var i=e.statusCode;if(200!==i||!e.json){var n="Surveys API could not be loaded, status: "+i;return ka.error(n),t([],{isLoaded:!1,error:n})}var o,s=e.json.surveys||[],a=s.filter((t=>xa(t)&&(Aa(t)||Ta(t))));a.length>0&&(null==(o=this._surveyEventReceiver)||o.register(a));return null==(r=this._instance.persistence)||r.register({[Jn]:s}),t(s,{isLoaded:!0})}})}catch(t){throw this.Ar=!1,t}}Rr(t){for(var e of this.Mr)try{if(!t.isLoaded)return e([],t);this.getSurveys(e)}catch(t){ka.error("Error in survey callback",t)}}getActiveMatchingSurveys(t,e){if(void 0===e&&(e=!1),!ri(this._surveyManager))return this._surveyManager.getActiveMatchingSurveys(t,e);ka.warn("init was not called")}Fr(t){var e=null;return this.getSurveys((r=>{var i;e=null!==(i=r.find((e=>e.id===t)))&&void 0!==i?i:null})),e}Or(t){if(ri(this._surveyManager))return{eligible:!1,reason:"SDK is not enabled or survey functionality is not yet loaded"};var e="string"==typeof t?this.Fr(t):t;return e?this._surveyManager.checkSurveyEligibility(e):{eligible:!1,reason:"Survey not found"}}canRenderSurvey(t){if(ri(this._surveyManager))return ka.warn("init was not called"),{visible:!1,disabledReason:"SDK is not enabled or survey functionality is not yet loaded"};var e=this.Or(t);return{visible:e.eligible,disabledReason:e.reason}}canRenderSurveyAsync(t,e){return ri(this._surveyManager)?(ka.warn("init was not called"),Promise.resolve({visible:!1,disabledReason:"SDK is not enabled or survey functionality is not yet loaded"})):new Promise((r=>{this.getSurveys((e=>{var i,n=null!==(i=e.find((e=>e.id===t)))&&void 0!==i?i:null;if(n){var o=this.Or(n);r({visible:o.eligible,disabledReason:o.reason})}else r({visible:!1,disabledReason:"Survey not found"})}),e)}))}renderSurvey(t,e){var r;if(ri(this._surveyManager))ka.warn("init was not called");else{var i="string"==typeof t?this.Fr(t):t;if(null!=i&&i.id)if(Oa.includes(i.type)){var n=null==Ji?void 0:Ji.querySelector(e);if(n)return null!=(r=i.appearance)&&r.surveyPopupDelaySeconds?(ka.info("Rendering survey "+i.id+" with delay of "+i.appearance.surveyPopupDelaySeconds+" seconds"),void setTimeout((()=>{var t,e;ka.info("Rendering survey "+i.id+" with delay of "+(null==(t=i.appearance)?void 0:t.surveyPopupDelaySeconds)+" seconds"),null==(e=this._surveyManager)||e.renderSurvey(i,n),ka.info("Survey "+i.id+" rendered")}),1e3*i.appearance.surveyPopupDelaySeconds)):void this._surveyManager.renderSurvey(i,n);ka.warn("Survey element not found")}else ka.warn("Surveys of type "+i.type+" cannot be rendered in the app");else ka.warn("Survey not found")}}displaySurvey(t,e){var i;if(ri(this._surveyManager))ka.warn("init was not called");else{var n=this.Fr(t);if(n){var o=n;if(null!=(i=n.appearance)&&i.surveyPopupDelaySeconds&&e.ignoreDelay&&(o=r({},n,{appearance:r({},n.appearance,{surveyPopupDelaySeconds:0})})),!1===e.ignoreConditions){var s=this.canRenderSurvey(n);if(!s.visible)return void ka.warn("Survey is not eligible to be displayed: ",s.disabledReason)}e.displayType!==Sa.Inline?this._surveyManager.handlePopoverSurvey(o):this.renderSurvey(o,e.selector)}else ka.warn("Survey not found")}}}var Pv=cn("[RateLimiter]");class Lv{constructor(t){var e,r;this.serverLimits={},this.lastEventRateLimited=!1,this.checkForLimiting=t=>{var e=t.text;if(e&&e.length)try{(JSON.parse(e).quota_limited||[]).forEach((t=>{Pv.info((t||"events")+" is quota limited."),this.serverLimits[t]=(new Date).getTime()+6e4}))}catch(t){return void Pv.warn('could not rate limit - continuing. Error: "'+(null==t?void 0:t.message)+'"',{text:e})}},this.instance=t,this.captureEventsPerSecond=(null==(e=t.config.rate_limiting)?void 0:e.events_per_second)||10,this.captureEventsBurstLimit=Math.max((null==(r=t.config.rate_limiting)?void 0:r.events_burst_limit)||10*this.captureEventsPerSecond,this.captureEventsPerSecond),this.lastEventRateLimited=this.clientRateLimitContext(!0).isRateLimited}clientRateLimitContext(t){var e,r,i;void 0===t&&(t=!1);var n=(new Date).getTime(),o=null!==(e=null==(r=this.instance.persistence)?void 0:r.get_property(ro))&&void 0!==e?e:{tokens:this.captureEventsBurstLimit,last:n};o.tokens+=(n-o.last)/1e3*this.captureEventsPerSecond,o.last=n,o.tokens>this.captureEventsBurstLimit&&(o.tokens=this.captureEventsBurstLimit);var s=o.tokens<1;return s||t||(o.tokens=Math.max(0,o.tokens-1)),!s||this.lastEventRateLimited||t||this.instance.capture("$$client_ingestion_warning",{$$client_ingestion_warning_message:"posthog-js client rate limited. Config is set to "+this.captureEventsPerSecond+" events per second and "+this.captureEventsBurstLimit+" events burst limit."},{skip_client_rate_limiting:!0}),this.lastEventRateLimited=s,null==(i=this.instance.persistence)||i.set_property(ro,o),{isRateLimited:s,remainingTokens:o.tokens}}isServerRateLimited(t){var e=this.serverLimits[t||"events"]||!1;return!1!==e&&(new Date).getTime()<e}}var Dv=cn("[RemoteConfig]");class Bv{constructor(t){this._instance=t}get remoteConfig(){var t;return null==(t=nn._POSTHOG_REMOTE_CONFIG)||null==(t=t[this._instance.config.token])?void 0:t.config}Pr(t){var e,r;null!=(e=nn.__PosthogExtensions__)&&e.loadExternalDependency?null==(r=nn.__PosthogExtensions__)||null==r.loadExternalDependency||r.loadExternalDependency(this._instance,"remote-config",(()=>t(this.remoteConfig))):(Dv.error("PostHog Extensions not found. Cannot load remote config."),t())}Lr(t){this._instance.je({method:"GET",url:this._instance.requestRouter.endpointFor("assets","/array/"+this._instance.config.token+"/config"),callback:e=>{t(e.json)}})}load(){try{if(this.remoteConfig)return Dv.info("Using preloaded remote config",this.remoteConfig),void this.Ye(this.remoteConfig);if(this._instance.yt())return void Dv.warn("Remote config is disabled. Falling back to local config.");this.Pr((t=>{if(!t)return Dv.info("No config found after loading remote JS config. Falling back to JSON."),void this.Lr((t=>{this.Ye(t)}));this.Ye(t)}))}catch(t){Dv.error("Error loading remote config",t)}}Ye(t){t?this._instance.config.__preview_remote_config?(this._instance.Ye(t),!1!==t.hasFeatureFlags&&this._instance.featureFlags.ensureFlagsLoaded()):Dv.info("__preview_remote_config is disabled. Logging config instead",t):Dv.error("Failed to fetch remote config from PostHog.")}}var Zv=3e3;class $v{constructor(t,e){this.Dr=!0,this.Br=[],this.Zr=vi((null==e?void 0:e.flush_interval_ms)||Zv,250,5e3,un.createLogger("flush interval"),Zv),this.$r=t}enqueue(t){this.Br.push(t),this.qr||this.Hr()}unload(){this.Vr();var t=this.Br.length>0?this.jr():{},e=Object.values(t),i=[...e.filter((t=>0===t.url.indexOf("/e"))),...e.filter((t=>0!==t.url.indexOf("/e")))];i.map((t=>{this.$r(r({},t,{transport:"sendBeacon"}))}))}enable(){this.Dr=!1,this.Hr()}Hr(){var t=this;this.Dr||(this.qr=setTimeout((()=>{if(this.Vr(),this.Br.length>0){var e=this.jr(),r=function(){var r=e[i],n=(new Date).getTime();r.data&&Wr(r.data)&&vn(r.data,(t=>{t.offset=Math.abs(t.timestamp-n),delete t.timestamp})),t.$r(r)};for(var i in e)r()}}),this.Zr))}Vr(){clearTimeout(this.qr),this.qr=void 0}jr(){var t={};return vn(this.Br,(e=>{var i,n=e,o=(n?n.batchKey:null)||n.url;Kr(t[o])&&(t[o]=r({},n,{data:[]})),null==(i=t[o].data)||i.push(n.data)})),this.Br=[],t}}var qv=["retriesPerformedSoFar"];class Hv{constructor(t){this.Yr=!1,this.Gr=3e3,this.Br=[],this._instance=t,this.Br=[],this.Wr=!0,!Kr(Yi)&&"onLine"in Yi.navigator&&(this.Wr=Yi.navigator.onLine,Sn(Yi,"online",(()=>{this.Wr=!0,this.Ie()})),Sn(Yi,"offline",(()=>{this.Wr=!1})))}get length(){return this.Br.length}retriableRequest(t){var{retriesPerformedSoFar:e}=t,n=i(t,qv);ii(e)&&e>0&&(n.url=xu(n.url,{retry_count:e})),this._instance.je(r({},n,{callback:t=>{200!==t.statusCode&&(t.statusCode<400||t.statusCode>=500)&&(null!=e?e:0)<10?this.zr(r({retriesPerformedSoFar:e},n)):null==n.callback||n.callback(t)}}))}zr(t){var e=t.retriesPerformedSoFar||0;t.retriesPerformedSoFar=e+1;var r=function(t){var e=3e3*Math.pow(2,t),r=e/2,i=Math.min(18e5,e),n=(Math.random()-.5)*(i-r);return Math.ceil(i+n)}(e),i=Date.now()+r;this.Br.push({retryAt:i,requestOptions:t});var n="Enqueued failed request for retry in "+r;navigator.onLine||(n+=" (Browser is offline)"),un.warn(n),this.Yr||(this.Yr=!0,this.Ur())}Ur(){this.Xr&&clearTimeout(this.Xr),this.Xr=setTimeout((()=>{this.Wr&&this.Br.length>0&&this.Ie(),this.Ur()}),this.Gr)}Ie(){var t=Date.now(),e=[],r=this.Br.filter((r=>r.retryAt<t||(e.push(r),!1)));if(this.Br=e,r.length>0)for(var{requestOptions:i}of r)this.retriableRequest(i)}unload(){for(var{requestOptions:t}of(this.Xr&&(clearTimeout(this.Xr),this.Xr=void 0),this.Br))try{this._instance.je(r({},t,{transport:"sendBeacon"}))}catch(t){un.error(t)}this.Br=[]}}class Vv{constructor(t){this.Jr=()=>{var t,e,r,i;this.Kr||(this.Kr={});var n=this.scrollElement(),o=this.scrollY(),s=n?Math.max(0,n.scrollHeight-n.clientHeight):0,a=o+((null==n?void 0:n.clientHeight)||0),l=(null==n?void 0:n.scrollHeight)||0;this.Kr.lastScrollY=Math.ceil(o),this.Kr.maxScrollY=Math.max(o,null!==(t=this.Kr.maxScrollY)&&void 0!==t?t:0),this.Kr.maxScrollHeight=Math.max(s,null!==(e=this.Kr.maxScrollHeight)&&void 0!==e?e:0),this.Kr.lastContentY=a,this.Kr.maxContentY=Math.max(a,null!==(r=this.Kr.maxContentY)&&void 0!==r?r:0),this.Kr.maxContentHeight=Math.max(l,null!==(i=this.Kr.maxContentHeight)&&void 0!==i?i:0)},this._instance=t}getContext(){return this.Kr}resetContext(){var t=this.Kr;return setTimeout(this.Jr,0),t}startMeasuringScrollPosition(){Sn(Yi,"scroll",this.Jr,{capture:!0}),Sn(Yi,"scrollend",this.Jr,{capture:!0}),Sn(Yi,"resize",this.Jr)}scrollElement(){if(!this._instance.config.scroll_root_selector)return null==Yi?void 0:Yi.document.documentElement;var t=Wr(this._instance.config.scroll_root_selector)?this._instance.config.scroll_root_selector:[this._instance.config.scroll_root_selector];for(var e of t){var r=null==Yi?void 0:Yi.document.querySelector(e);if(r)return r}}scrollY(){if(this._instance.config.scroll_root_selector){var t=this.scrollElement();return t&&t.scrollTop||0}return Yi&&(Yi.scrollY||Yi.pageYOffset||Yi.document.documentElement.scrollTop)||0}scrollX(){if(this._instance.config.scroll_root_selector){var t=this.scrollElement();return t&&t.scrollLeft||0}return Yi&&(Yi.scrollX||Yi.pageXOffset||Yi.document.documentElement.scrollLeft)||0}}var jv=t=>fv(null==t?void 0:t.config.mask_personal_data_properties,null==t?void 0:t.config.custom_personal_data_properties);class Yv{constructor(t,e,r,i){this.Qr=t=>{var e=this.ti();if(!e||e.sessionId!==t){var r={sessionId:t,props:this.ei(this._instance)};this.ri.register({[eo]:r})}},this._instance=t,this.ii=e,this.ri=r,this.ei=i||jv,this.ii.onSessionId(this.Qr)}ti(){return this.ri.props[eo]}getSetOnceProps(){var t,e=null==(t=this.ti())?void 0:t.props;return e?"r"in e?pv(e):{$referring_domain:e.referringDomain,$pathname:e.initialPathName,utm_source:e.utm_source,utm_campaign:e.utm_campaign,utm_medium:e.utm_medium,utm_content:e.utm_content,utm_term:e.utm_term}:{}}getSessionProps(){var t={};return vn(bn(this.getSetOnceProps()),((e,r)=>{"$current_url"===r&&(r="url"),t["$session_entry_"+Hr(r)]=e})),t}}var Gv=cn("[SessionId]");class Wv{on(t,e){return this.ni.on(t,e)}constructor(t,e,r){var i;if(this.oi=[],this.ni=new Nv,this.si=(t,e)=>Math.abs(t-e)>this.sessionTimeoutMs,!t.persistence)throw new Error("SessionIdManager requires a PostHogPersistence instance");if("always"===t.config.cookieless_mode)throw new Error('SessionIdManager cannot be used with cookieless_mode="always"');this.vt=t.config,this.ri=t.persistence,this.ai=void 0,this.li=void 0,this._sessionStartTimestamp=null,this._sessionActivityTimestamp=null,this.ui=e||Ha,this.ci=r||Ha;var n=this.vt.persistence_name||this.vt.token,o=this.vt.session_idle_timeout_seconds||1800;if(this._sessionTimeoutMs=1e3*vi(o,60,36e3,Gv.createLogger("session_idle_timeout_seconds"),1800),t.register({$configured_session_timeout_ms:this._sessionTimeoutMs}),this.hi(),this.di="ph_"+n+"_window_id",this.vi="ph_"+n+"_primary_window_exists",this.fi()){var s=Md.$t(this.di),a=Md.$t(this.vi);s&&!a?this.ai=s:Md.Ht(this.di),Md.qt(this.vi,!0)}if(null!=(i=this.vt.bootstrap)&&i.sessionID)try{var l=(t=>{var e=t.replace(/-/g,"");if(32!==e.length)throw new Error("Not a valid UUID");if("7"!==e[12])throw new Error("Not a UUIDv7");return parseInt(e.substring(0,12),16)})(this.vt.bootstrap.sessionID);this.pi(this.vt.bootstrap.sessionID,(new Date).getTime(),l)}catch(t){Gv.error("Invalid sessionID in bootstrap",t)}this.gi()}get sessionTimeoutMs(){return this._sessionTimeoutMs}onSessionId(t){return Kr(this.oi)&&(this.oi=[]),this.oi.push(t),this.li&&t(this.li,this.ai),()=>{this.oi=this.oi.filter((e=>e!==t))}}fi(){return"memory"!==this.vt.persistence&&!this.ri.Je&&Md.Dt()}mi(t){t!==this.ai&&(this.ai=t,this.fi()&&Md.qt(this.di,t))}yi(){return this.ai?this.ai:this.fi()?Md.$t(this.di):null}pi(t,e,r){t===this.li&&e===this._sessionActivityTimestamp&&r===this._sessionStartTimestamp||(this._sessionStartTimestamp=r,this._sessionActivityTimestamp=e,this.li=t,this.ri.register({[jn]:[e,t,r]}))}bi(){if(this.li&&this._sessionActivityTimestamp&&this._sessionStartTimestamp)return[this._sessionActivityTimestamp,this.li,this._sessionStartTimestamp];var t=this.ri.props[jn];return Wr(t)&&2===t.length&&t.push(t[0]),t||[0,null,0]}resetSessionId(){this.pi(null,null,null)}gi(){Sn(Yi,"beforeunload",(()=>{this.fi()&&Md.Ht(this.vi)}),{capture:!1})}checkAndGetSessionAndWindowId(t,e){if(void 0===t&&(t=!1),void 0===e&&(e=null),"always"===this.vt.cookieless_mode)throw new Error('checkAndGetSessionAndWindowId should not be called with cookieless_mode="always"');var r=e||(new Date).getTime(),[i,n,o]=this.bi(),s=this.yi(),a=ii(o)&&o>0&&Math.abs(r-o)>864e5,l=!1,u=!n,c=!t&&this.si(r,i);u||c||a?(n=this.ui(),s=this.ci(),Gv.info("new session ID generated",{sessionId:n,windowId:s,changeReason:{noSessionId:u,activityTimeout:c,sessionPastMaximumLength:a}}),o=r,l=!0):s||(s=this.ci(),l=!0);var h=0===i||!t||a?r:i,d=0===o?(new Date).getTime():o;return this.mi(s),this.pi(n,h,d),t||this.hi(),l&&this.oi.forEach((t=>t(n,s,l?{noSessionId:u,activityTimeout:c,sessionPastMaximumLength:a}:void 0))),{sessionId:n,windowId:s,sessionStartTimestamp:d,changeReason:l?{noSessionId:u,activityTimeout:c,sessionPastMaximumLength:a}:void 0,lastActivityTimestamp:i}}hi(){clearTimeout(this.wi),this.wi=setTimeout((()=>{var[t]=this.bi();if(this.si((new Date).getTime(),t)){var e=this.li;this.resetSessionId(),this.ni.emit("forcedIdleReset",{idleSessionId:e})}}),1.1*this.sessionTimeoutMs)}}var zv=["$set_once","$set"],Uv=cn("[SiteApps]");class Xv{constructor(t){this._instance=t,this.Ci=[],this.apps={}}get isEnabled(){return!!this._instance.config.opt_in_site_apps}Ii(t,e){if(e){var r=this.globalsForEvent(e);this.Ci.push(r),this.Ci.length>1e3&&(this.Ci=this.Ci.slice(10))}}get siteAppLoaders(){var t;return null==(t=nn._POSTHOG_REMOTE_CONFIG)||null==(t=t[this._instance.config.token])?void 0:t.siteApps}init(){if(this.isEnabled){var t=this._instance.hr(this.Ii.bind(this));this.Si=()=>{t(),this.Ci=[],this.Si=void 0}}}globalsForEvent(t){var e,n,o,s,a,l,u;if(!t)throw new Error("Event payload is required");var c={},h=this._instance.get_property("$groups")||[],d=this._instance.get_property("$stored_group_properties")||{};for(var[v,f]of Object.entries(d))c[v]={id:h[v],type:v,properties:f};var{$set_once:p,$set:g}=t;return{event:r({},i(t,zv),{properties:r({},t.properties,g?{$set:r({},null!==(e=null==(n=t.properties)?void 0:n.$set)&&void 0!==e?e:{},g)}:{},p?{$set_once:r({},null!==(o=null==(s=t.properties)?void 0:s.$set_once)&&void 0!==o?o:{},p)}:{}),elements_chain:null!==(a=null==(l=t.properties)?void 0:l.$elements_chain)&&void 0!==a?a:"",distinct_id:null==(u=t.properties)?void 0:u.distinct_id}),person:{properties:this._instance.get_property("$stored_person_properties")},groups:c}}setupSiteApp(t){var e=this.apps[t.id],r=()=>{var r;(!e.errored&&this.Ci.length&&(Uv.info("Processing "+this.Ci.length+" events for site app with id "+t.id),this.Ci.forEach((t=>null==e.processEvent?void 0:e.processEvent(t))),e.processedBuffer=!0),Object.values(this.apps).every((t=>t.processedBuffer||t.errored)))&&(null==(r=this.Si)||r.call(this))},i=!1,n=n=>{e.errored=!n,e.loaded=!0,Uv.info("Site app with id "+t.id+" "+(n?"loaded":"errored")),i&&r()};try{var{processEvent:o}=t.init({posthog:this._instance,callback:t=>{n(t)}});o&&(e.processEvent=o),i=!0}catch(e){Uv.error("Error while initializing PostHog app with config id "+t.id,e),n(!1)}if(i&&e.loaded)try{r()}catch(r){Uv.error("Error while processing buffered events PostHog app with config id "+t.id,r),e.errored=!0}}ki(){var t=this.siteAppLoaders||[];for(var e of t)this.apps[e.id]={id:e.id,loaded:!1,errored:!1,processedBuffer:!1};for(var r of t)this.setupSiteApp(r)}xi(t){if(0!==Object.keys(this.apps).length){var e=this.globalsForEvent(t);for(var r of Object.values(this.apps))try{null==r.processEvent||r.processEvent(e)}catch(e){Uv.error("Error while processing event "+t.event+" for site app "+r.id,e)}}}onRemoteConfig(t){var e,r,i,n=this;if(null!=(e=this.siteAppLoaders)&&e.length)return this.isEnabled?(this.ki(),void this._instance.on("eventCaptured",(t=>this.xi(t)))):void Uv.error('PostHog site apps are disabled. Enable the "opt_in_site_apps" config to proceed.');if(null==(r=this.Si)||r.call(this),null!=(i=t.siteApps)&&i.length)if(this.isEnabled){var o=function(t){var e;nn["__$$ph_site_app_"+t]=n._instance,null==(e=nn.__PosthogExtensions__)||null==e.loadSiteApp||e.loadSiteApp(n._instance,a,(e=>{if(e)return Uv.error("Error while initializing PostHog app with config id "+t,e)}))};for(var{id:s,url:a}of t.siteApps)o(s)}else Uv.error('PostHog site apps are disabled. Enable the "opt_in_site_apps" config to proceed.')}}var Jv=["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"],Kv=function(t,e){if(!t)return!1;var r=t.toLowerCase();return Jv.concat(e||[]).some((t=>{var e=t.toLowerCase();return-1!==r.indexOf(e)}))},Qv=function(t,e){if(!t)return!1;var r=t.userAgent;if(r&&Kv(r,e))return!0;try{var i=null==t?void 0:t.userAgentData;if(null!=i&&i.brands&&i.brands.some((t=>Kv(null==t?void 0:t.brand,e))))return!0}catch(t){}return!!t.webdriver},tf=function(t){return t.US="us",t.EU="eu",t.CUSTOM="custom",t}({}),ef="i.posthog.com";class rf{constructor(t){this.Ai={},this.instance=t}get apiHost(){var t=this.instance.config.api_host.trim().replace(/\/$/,"");return"https://app.posthog.com"===t?"https://us.i.posthog.com":t}get uiHost(){var t,e=null==(t=this.instance.config.ui_host)?void 0:t.replace(/\/$/,"");return e||(e=this.apiHost.replace("."+ef,".posthog.com")),"https://app.posthog.com"===e?"https://us.posthog.com":e}get region(){return this.Ai[this.apiHost]||(/https:\/\/(app|us|us-assets)(\.i)?\.posthog\.com/i.test(this.apiHost)?this.Ai[this.apiHost]=tf.US:/https:\/\/(eu|eu-assets)(\.i)?\.posthog\.com/i.test(this.apiHost)?this.Ai[this.apiHost]=tf.EU:this.Ai[this.apiHost]=tf.CUSTOM),this.Ai[this.apiHost]}endpointFor(t,e){if(void 0===e&&(e=""),e&&(e="/"===e[0]?e:"/"+e),"ui"===t)return this.uiHost+e;if(this.region===tf.CUSTOM)return this.apiHost+e;var r=ef+e;switch(t){case"assets":return"https://"+this.region+"-assets."+r;case"api":return"https://"+this.region+"."+r}}}var nf={icontains:(t,e)=>!!Yi&&e.href.toLowerCase().indexOf(t.toLowerCase())>-1,not_icontains:(t,e)=>!!Yi&&-1===e.href.toLowerCase().indexOf(t.toLowerCase()),regex:(t,e)=>!!Yi&&Eu(e.href,t),not_regex:(t,e)=>!!Yi&&!Eu(e.href,t),exact:(t,e)=>e.href===t,is_not:(t,e)=>e.href!==t};class of{constructor(t){var e=this;this.getWebExperimentsAndEvaluateDisplayLogic=function(t){void 0===t&&(t=!1),e.getWebExperiments((t=>{of.Ti("retrieved web experiments from the server"),e.Mi=new Map,t.forEach((t=>{if(t.feature_flag_key){var r;if(e.Mi)of.Ti("setting flag key ",t.feature_flag_key," to web experiment ",t),null==(r=e.Mi)||r.set(t.feature_flag_key,t);var i=e._instance.getFeatureFlag(t.feature_flag_key);Qr(i)&&t.variants[i]&&e.Ei(t.name,i,t.variants[i].transforms)}else if(t.variants)for(var n in t.variants){var o=t.variants[n];of.Ni(o)&&e.Ei(t.name,n,o.transforms)}}))}),t)},this._instance=t,this._instance.onFeatureFlags((t=>{this.onFeatureFlags(t)}))}onFeatureFlags(t){if(this._is_bot())of.Ti("Refusing to render web experiment since the viewer is a likely bot");else if(!this._instance.config.disable_web_experiments){if(ri(this.Mi))return this.Mi=new Map,this.loadIfEnabled(),void this.previewWebExperiment();of.Ti("applying feature flags",t),t.forEach((t=>{var e;if(this.Mi&&null!=(e=this.Mi)&&e.has(t)){var r,i=this._instance.getFeatureFlag(t),n=null==(r=this.Mi)?void 0:r.get(t);i&&null!=n&&n.variants[i]&&this.Ei(n.name,i,n.variants[i].transforms)}}))}}previewWebExperiment(){var t=of.getWindowLocation();if(null!=t&&t.search){var e=An(null==t?void 0:t.search,"__experiment_id"),r=An(null==t?void 0:t.search,"__experiment_variant");e&&r&&(of.Ti("previewing web experiments "+e+" && "+r),this.getWebExperiments((t=>{this.Ri(parseInt(e),r,t)}),!1,!0))}}loadIfEnabled(){this._instance.config.disable_web_experiments||this.getWebExperimentsAndEvaluateDisplayLogic()}getWebExperiments(t,e,r){if(this._instance.config.disable_web_experiments&&!r)return t([]);var i=this._instance.get_property("$web_experiments");if(i&&!e)return t(i);this._instance.je({url:this._instance.requestRouter.endpointFor("api","/api/web_experiments/?token="+this._instance.config.token),method:"GET",callback:e=>{if(200!==e.statusCode||!e.json)return t([]);var r=e.json.experiments||[];return t(r)}})}Ri(t,e,r){var i=r.filter((e=>e.id===t));i&&i.length>0&&(of.Ti("Previewing web experiment ["+i[0].name+"] with variant ["+e+"]"),this.Ei(i[0].name,e,i[0].variants[e].transforms))}static Ni(t){return!ri(t.conditions)&&(of.Fi(t)&&of.Oi(t))}static Fi(t){var e;if(ri(t.conditions)||ri(null==(e=t.conditions)?void 0:e.url))return!0;var r,i,n,o=of.getWindowLocation();return!!o&&(null==(r=t.conditions)||!r.url||nf[null!==(i=null==(n=t.conditions)?void 0:n.urlMatchType)&&void 0!==i?i:"icontains"](t.conditions.url,o))}static getWindowLocation(){return null==Yi?void 0:Yi.location}static Oi(t){var e;if(ri(t.conditions)||ri(null==(e=t.conditions)?void 0:e.utm))return!0;var r=uv();if(r.utm_source){var i,n,o,s,a,l,u,c,h=null==(i=t.conditions)||null==(i=i.utm)||!i.utm_campaign||(null==(n=t.conditions)||null==(n=n.utm)?void 0:n.utm_campaign)==r.utm_campaign,d=null==(o=t.conditions)||null==(o=o.utm)||!o.utm_source||(null==(s=t.conditions)||null==(s=s.utm)?void 0:s.utm_source)==r.utm_source,v=null==(a=t.conditions)||null==(a=a.utm)||!a.utm_medium||(null==(l=t.conditions)||null==(l=l.utm)?void 0:l.utm_medium)==r.utm_medium,f=null==(u=t.conditions)||null==(u=u.utm)||!u.utm_term||(null==(c=t.conditions)||null==(c=c.utm)?void 0:c.utm_term)==r.utm_term;return h&&v&&f&&d}return!1}static Ti(t){for(var e=arguments.length,r=new Array(e>1?e-1:0),i=1;i<e;i++)r[i-1]=arguments[i];un.info("[WebExperiments] "+t,r)}Ei(t,e,r){this._is_bot()?of.Ti("Refusing to render web experiment since the viewer is a likely bot"):"control"!==e?r.forEach((r=>{if(r.selector){var i;of.Ti("applying transform of variant "+e+" for experiment "+t+" ",r);var n=null==(i=document)?void 0:i.querySelectorAll(r.selector);null==n||n.forEach((t=>{var e=t;r.html&&(e.innerHTML=r.html),r.css&&e.setAttribute("style",r.css)}))}})):of.Ti("Control variants leave the page unmodified.")}_is_bot(){return Xi&&this._instance?Qv(Xi,this._instance.config.custom_blocked_useragents):void 0}}var sf=cn("[PostHog ExternalIntegrations]"),af={intercom:"intercom-integration",crispChat:"crisp-chat-integration"};class lf{constructor(t){this._instance=t}Ut(t,e){var r;null==(r=nn.__PosthogExtensions__)||null==r.loadExternalDependency||r.loadExternalDependency(this._instance,t,(t=>{if(t)return sf.error("failed to load script",t);e()}))}startIfEnabledOrStop(){var t=this,e=function(e){var r,n,o;(!i||null!=(r=nn.__PosthogExtensions__)&&null!=(r=r.integrations)&&r[e]||t.Ut(af[e],(()=>{var r;null==(r=nn.__PosthogExtensions__)||null==(r=r.integrations)||null==(r=r[e])||r.start(t._instance)})),!i&&null!=(n=nn.__PosthogExtensions__)&&null!=(n=n.integrations)&&n[e])&&(null==(o=nn.__PosthogExtensions__)||null==(o=o.integrations)||null==(o=o[e])||o.stop())};for(var[r,i]of Object.entries(null!==(n=this._instance.config.integrations)&&void 0!==n?n:{})){var n;e(r)}}}var uf="[SessionRecording]",cf=cn(uf);class hf{get started(){var t;return!(null==(t=this.Pi)||!t.isStarted)}get status(){return this.Pi?this.Pi.status:this.Li&&!this.Di?"disabled":"lazy_loading"}constructor(t){if(this._forceAllowLocalhostNetworkCapture=!1,this.Li=!1,this.Bi=void 0,this._instance=t,!this._instance.sessionManager)throw cf.error("started without valid sessionManager"),new Error(uf+" started without valid sessionManager. This is a bug.");if("always"===this._instance.config.cookieless_mode)throw new Error(uf+' cannot be used with cookieless_mode="always"')}get Di(){var t,e=!(null==(t=this._instance.get_property(Vn))||!t.enabled),r=!this._instance.config.disable_session_recording,i=this._instance.config.disable_session_recording||this._instance.consent.isOptedOut();return Yi&&e&&r&&!i}startIfEnabledOrStop(t){var e;if(!this.Di||null==(e=this.Pi)||!e.isStarted){var r=!Kr(Object.assign)&&!Kr(Array.from);this.Di&&r?(this.Zi(t),cf.info("starting")):this.stopRecording()}}Zi(t){var e,r,i;this.Di&&(null!=nn&&null!=(e=nn.__PosthogExtensions__)&&null!=(e=e.rrweb)&&e.record&&null!=(r=nn.__PosthogExtensions__)&&r.initSessionRecording?this.$i(t):null==(i=nn.__PosthogExtensions__)||null==i.loadExternalDependency||i.loadExternalDependency(this._instance,this.qi,(e=>{if(e)return cf.error("could not load recorder",e);this.$i(t)})))}stopRecording(){var t;null==(t=this.Pi)||t.stop()}Hi(){var t;null==(t=this._instance.persistence)||t.unregister(Yn)}Vi(t){if(this._instance.persistence){var e,i,n=this._instance.persistence,o=()=>{var e=!1===t.sessionRecording?void 0:t.sessionRecording,i=null==e?void 0:e.sampleRate,o=ri(i)?null:parseFloat(i);ri(o)&&this.Hi();var s=null==e?void 0:e.minimumDurationMilliseconds;n.register({[Vn]:r({enabled:!!e},e,{networkPayloadCapture:r({capturePerformance:t.capturePerformance},null==e?void 0:e.networkPayloadCapture),canvasRecording:{enabled:null==e?void 0:e.recordCanvas,fps:null==e?void 0:e.canvasFps,quality:null==e?void 0:e.canvasQuality},sampleRate:o,minimumDurationMilliseconds:Kr(s)?null:s,endpoint:null==e?void 0:e.endpoint,triggerMatchType:null==e?void 0:e.triggerMatchType,masking:null==e?void 0:e.masking,urlTriggers:null==e?void 0:e.urlTriggers})})};o(),null==(e=this.Bi)||e.call(this),this.Bi=null==(i=this._instance.sessionManager)?void 0:i.onSessionId(o)}}onRemoteConfig(t){"sessionRecording"in t?!1!==t.sessionRecording?(this.Vi(t),this.Li=!0,this.startIfEnabledOrStop()):this.Li=!0:cf.info("skipping remote config with no sessionRecording",t)}log(t,e){var r;void 0===e&&(e="log"),null!=(r=this.Pi)&&r.log?this.Pi.log(t,e):cf.warn("log called before recorder was ready")}get qi(){var t,e,r=null==(t=this._instance)||null==(t=t.persistence)?void 0:t.get_property(Vn);return(null==r||null==(e=r.scriptConfig)?void 0:e.script)||"lazy-recorder"}$i(t){var e,r;if(null==(e=nn.__PosthogExtensions__)||!e.initSessionRecording)throw Error("Called on script loaded before session recording is available");this.Pi||(this.Pi=null==(r=nn.__PosthogExtensions__)?void 0:r.initSessionRecording(this._instance),this.Pi._forceAllowLocalhostNetworkCapture=this._forceAllowLocalhostNetworkCapture);this.Pi.start(t)}onRRwebEmit(t){var e;null==(e=this.Pi)||null==e.onRRwebEmit||e.onRRwebEmit(t)}overrideLinkedFlag(){var t;null==(t=this.Pi)||t.overrideLinkedFlag()}overrideSampling(){var t;null==(t=this.Pi)||t.overrideSampling()}overrideTrigger(t){var e;null==(e=this.Pi)||e.overrideTrigger(t)}get sdkDebugProperties(){var t;return(null==(t=this.Pi)?void 0:t.sdkDebugProperties)||{$recording_status:this.status}}tryAddCustomEvent(t,e){var r;return!(null==(r=this.Pi)||!r.tryAddCustomEvent(t,e))}}var df={},vf=()=>{},ff="posthog",pf=!Su&&-1===(null==rn?void 0:rn.indexOf("MSIE"))&&-1===(null==rn?void 0:rn.indexOf("Mozilla")),gf=t=>{var e;return{api_host:"https://us.i.posthog.com",ui_host:null,token:"",autocapture:!0,rageclick:!0,cross_subdomain_cookie:Cn(null==Ji?void 0:Ji.location),persistence:"localStorage+cookie",persistence_name:"",loaded:vf,save_campaign_params:!0,custom_campaign_params:[],custom_blocked_useragents:[],save_referrer:!0,capture_pageview:"2025-05-24"!==t||"history_change",capture_pageleave:"if_capture_pageview",defaults:null!=t?t:"unset",debug:Ki&&Qr(null==Ki?void 0:Ki.search)&&-1!==Ki.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_external_dependency_loading:!1,enable_recording_console_log:void 0,secure_cookie:"https:"===(null==Yi||null==(e=Yi.location)?void 0:e.protocol),ip:!1,opt_out_capturing_by_default:!1,opt_out_persistence_by_default:!1,opt_out_useragent_filter:!1,opt_out_capturing_persistence_type:"localStorage",consent_persistence_name:null,opt_out_capturing_cookie_prefix:null,opt_in_site_apps:!1,property_denylist:[],respect_dnt:!1,sanitize_properties:null,request_headers:{},request_batching:!0,properties_string_max_length:65535,session_recording:{},mask_all_element_attributes:!1,mask_all_text:!1,mask_personal_data_properties:!1,custom_personal_data_properties:[],advanced_disable_flags:!1,advanced_disable_decide:!1,advanced_disable_feature_flags:!1,advanced_disable_feature_flags_on_first_load:!1,advanced_only_evaluate_survey_feature_flags:!1,advanced_enable_surveys:!1,advanced_disable_toolbar_metrics:!1,feature_flag_request_timeout_ms:3e3,surveys_request_timeout_ms:1e4,on_request_error:t=>{var e="Bad HTTP status: "+t.statusCode+" "+t.text;un.error(e)},get_device_id:t=>t,capture_performance:void 0,name:"posthog",bootstrap:{},disable_compression:!1,session_idle_timeout_seconds:1800,person_profiles:"identified_only",before_send:void 0,request_queue_config:{flush_interval_ms:Zv},error_tracking:{},_onCapture:vf,__preview_eager_load_replay:!1}},mf=t=>{var e={};Kr(t.process_person)||(e.person_profiles=t.process_person),Kr(t.xhr_headers)||(e.request_headers=t.xhr_headers),Kr(t.cookie_name)||(e.persistence_name=t.cookie_name),Kr(t.disable_cookie)||(e.disable_persistence=t.disable_cookie),Kr(t.store_google)||(e.save_campaign_params=t.store_google),Kr(t.verbose)||(e.debug=t.verbose);var r=fn({},e,t);return Wr(t.property_blacklist)&&(Kr(t.property_denylist)?r.property_denylist=t.property_blacklist:Wr(t.property_denylist)?r.property_denylist=[...t.property_blacklist,...t.property_denylist]:un.error("Invalid value for property_denylist config: "+t.property_denylist)),r};class yf{constructor(){this.__forceAllowLocalhost=!1}get ji(){return this.__forceAllowLocalhost}set ji(t){un.error("WebPerformanceObserver is deprecated and has no impact on network capture. Use `_forceAllowLocalhostNetworkCapture` on `posthog.sessionRecording`"),this.__forceAllowLocalhost=t}}class bf{get decideEndpointWasHit(){var t,e;return null!==(t=null==(e=this.featureFlags)?void 0:e.hasLoadedFlags)&&void 0!==t&&t}get flagsEndpointWasHit(){var t,e;return null!==(t=null==(e=this.featureFlags)?void 0:e.hasLoadedFlags)&&void 0!==t&&t}constructor(){this.webPerformance=new yf,this.Yi=!1,this.version=an.LIB_VERSION,this.Gi=new Nv,this._calculate_event_properties=this.calculateEventProperties.bind(this),this.config=gf(),this.SentryIntegration=Vd,this.sentryIntegration=t=>function(t,e){var r=Hd(t,e);return{name:qd,processEvent:t=>r(t)}}(this,t),this.__request_queue=[],this.__loaded=!1,this.analyticsDefaultEndpoint="/e/",this.Wi=!1,this.zi=null,this.Ui=null,this.Xi=null,this.featureFlags=new Tv(this),this.toolbar=new zd(this),this.scrollManager=new Vv(this),this.pageViewManager=new iv(this),this.surveys=new Ov(this),this.experiments=new of(this),this.exceptions=new Qc(this),this.rateLimiter=new Lv(this),this.requestRouter=new rf(this),this.consent=new Nd(this),this.externalIntegrations=new lf(this),this.people={set:(t,e,r)=>{var i=Qr(t)?{[t]:e}:t;this.setPersonProperties(i),null==r||r({})},set_once:(t,e,r)=>{var i=Qr(t)?{[t]:e}:t;this.setPersonProperties(void 0,i),null==r||r({})}},this.on("eventCaptured",(t=>un.info('send "'+(null==t?void 0:t.event)+'"',t)))}init(t,e,r){if(r&&r!==ff){var i,n=null!==(i=df[r])&&void 0!==i?i:new bf;return n._init(t,e,r),df[r]=n,df[ff][r]=n,n}return this._init(t,e,r)}_init(t,e,i){var n,o;if(void 0===e&&(e={}),Kr(t)||ti(t))return un.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 un.warn("You have already initialized PostHog! Re-initializing is a no-op"),this;this.__loaded=!0,this.config={},this.Ji=e,this.Ki=[],e.person_profiles&&(this.Ui=e.person_profiles),this.set_config(fn({},gf(e.defaults),mf(e),{name:i,token:t})),this.config.on_xhr_error&&un.error("on_xhr_error is deprecated. Use on_request_error instead"),this.compression=e.disable_compression?void 0:Hl.GZipJS;var s=this.Qi();this.persistence=new Ev(this.config,s),this.sessionPersistence="sessionStorage"===this.config.persistence||"memory"===this.config.persistence?this.persistence:new Ev(r({},this.config,{persistence:"sessionStorage"}),s);var a=r({},this.persistence.props),l=r({},this.sessionPersistence.props);this.register({$initialization_time:(new Date).toISOString()}),this.tn=new $v((t=>this.en(t)),this.config.request_queue_config),this.rn=new Hv(this),this.__request_queue=[];var u="always"===this.config.cookieless_mode||"on_reject"===this.config.cookieless_mode&&this.consent.isExplicitlyOptedOut();if(u||(this.sessionManager=new Wv(this),this.sessionPropsManager=new Yv(this,this.sessionManager,this.persistence)),new Xd(this).startIfEnabledOrStop(),this.siteApps=new Xv(this),null==(n=this.siteApps)||n.init(),u||(this.sessionRecording=new hf(this),this.sessionRecording.startIfEnabledOrStop()),this.config.disable_scroll_properties||this.scrollManager.startMeasuringScrollPosition(),this.autocapture=new hd(this),this.autocapture.startIfEnabled(),this.surveys.loadIfEnabled(),this.heatmaps=new rv(this),this.heatmaps.startIfEnabled(),this.webVitalsAutocapture=new Qd(this),this.exceptionObserver=new Dd(this),this.exceptionObserver.startIfEnabled(),this.deadClicksAutocapture=new Pd(this,Od),this.deadClicksAutocapture.startIfEnabled(),this.historyAutocapture=new Bd(this),this.historyAutocapture.startIfEnabled(),an.DEBUG=an.DEBUG||this.config.debug,an.DEBUG&&un.info("Starting in debug mode",{this:this,config:e,thisC:r({},this.config),p:a,s:l}),void 0!==(null==(o=e.bootstrap)?void 0:o.distinctID)){var c,h,d=this.config.get_device_id(Ha()),v=null!=(c=e.bootstrap)&&c.isIdentifiedID?d:e.bootstrap.distinctID;this.persistence.set_property(to,null!=(h=e.bootstrap)&&h.isIdentifiedID?"identified":"anonymous"),this.register({distinct_id:e.bootstrap.distinctID,$device_id:v})}if(this.nn()){var f,p,g=Object.keys((null==(f=e.bootstrap)?void 0:f.featureFlags)||{}).filter((t=>{var r;return!(null==(r=e.bootstrap)||null==(r=r.featureFlags)||!r[t])})).reduce(((t,r)=>{var i;return t[r]=(null==(i=e.bootstrap)||null==(i=i.featureFlags)?void 0:i[r])||!1,t}),{}),m=Object.keys((null==(p=e.bootstrap)?void 0:p.featureFlagPayloads)||{}).filter((t=>g[t])).reduce(((t,r)=>{var i,n;null!=(i=e.bootstrap)&&null!=(i=i.featureFlagPayloads)&&i[r]&&(t[r]=null==(n=e.bootstrap)||null==(n=n.featureFlagPayloads)?void 0:n[r]);return t}),{});this.featureFlags.receivedFeatureFlags({featureFlags:g,featureFlagPayloads:m})}if(u)this.register_once({distinct_id:lo,$device_id:null},"");else if(!this.get_distinct_id()){var y=this.config.get_device_id(Ha());this.register_once({distinct_id:y,$device_id:y},""),this.persistence.set_property(to,"anonymous")}return Sn(Yi,"onpagehide"in self?"pagehide":"unload",this._handle_unload.bind(this),{passive:!1}),this.toolbar.maybeLoadToolbar(),e.segment?$d(this,(()=>this.sn())):this.sn(),zr(this.config._onCapture)&&this.config._onCapture!==vf&&(un.warn("onCapture is deprecated. Please use `before_send` instead"),this.on("eventCaptured",(t=>this.config._onCapture(t.event,t)))),this.config.ip&&un.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}Ye(t){var e,r,i,n,o,s,a,l;if(!Ji||!Ji.body)return un.info("document not ready yet, trying again in 500 milliseconds..."),void setTimeout((()=>{this.Ye(t)}),500);this.compression=void 0,t.supportedCompression&&!this.config.disable_compression&&(this.compression=$r(t.supportedCompression,Hl.GZipJS)?Hl.GZipJS:$r(t.supportedCompression,Hl.Base64)?Hl.Base64:void 0),null!=(e=t.analytics)&&e.endpoint&&(this.analyticsDefaultEndpoint=t.analytics.endpoint),this.set_config({person_profiles:this.Ui?this.Ui:"identified_only"}),null==(r=this.siteApps)||r.onRemoteConfig(t),null==(i=this.sessionRecording)||i.onRemoteConfig(t),null==(n=this.autocapture)||n.onRemoteConfig(t),null==(o=this.heatmaps)||o.onRemoteConfig(t),this.surveys.onRemoteConfig(t),null==(s=this.webVitalsAutocapture)||s.onRemoteConfig(t),null==(a=this.exceptionObserver)||a.onRemoteConfig(t),this.exceptions.onRemoteConfig(t),null==(l=this.deadClicksAutocapture)||l.onRemoteConfig(t)}sn(){try{this.config.loaded(this)}catch(t){un.critical("`loaded` function failed",t)}this.an(),this.config.capture_pageview&&setTimeout((()=>{(this.consent.isOptedIn()||"always"===this.config.cookieless_mode)&&this.ln()}),1),new Bv(this).load(),this.featureFlags.flags()}an(){var t;this.is_capturing()&&(this.config.request_batching&&(null==(t=this.tn)||t.enable()))}_dom_loaded(){this.is_capturing()&&dn(this.__request_queue,(t=>this.en(t))),this.__request_queue=[],this.an()}_handle_unload(){var t,e;this.config.request_batching?(this.un()&&this.capture("$pageleave"),null==(t=this.tn)||t.unload(),null==(e=this.rn)||e.unload()):this.un()&&this.capture("$pageleave",null,{transport:"sendBeacon"})}je(t){this.__loaded&&(pf?this.__request_queue.push(t):this.rateLimiter.isServerRateLimited(t.batchKey)||(t.transport=t.transport||this.config.api_transport,t.url=xu(t.url,{ip:this.config.ip?1:0}),t.headers=r({},this.config.request_headers),t.compression="best-available"===t.compression?this.compression:t.compression,t.disableXHRCredentials=this.config.__preview_disable_xhr_credentials,this.config.__preview_disable_beacon&&(t.disableTransport=["sendBeacon"]),t.fetchOptions=t.fetchOptions||this.config.fetch_options,(t=>{var e,i,n,o=r({},t);o.timeout=o.timeout||6e4,o.url=xu(o.url,{_:(new Date).getTime().toString(),ver:an.LIB_VERSION,compression:o.compression});var s=null!==(e=o.transport)&&void 0!==e?e:"fetch",a=Mu.filter((t=>!o.disableTransport||!t.transport||!o.disableTransport.includes(t.transport))),l=null!==(i=null==(n=In(a,(t=>t.transport===s)))?void 0:n.method)&&void 0!==i?i:a[0].method;if(!l)throw new Error("No available transport method");l(o)})(r({},t,{callback:e=>{var r,i;(this.rateLimiter.checkForLimiting(e),e.statusCode>=400)&&(null==(r=(i=this.config).on_request_error)||r.call(i,e));null==t.callback||t.callback(e)}}))))}en(t){this.rn?this.rn.retriableRequest(t):this.je(t)}_execute_array(t){var e,r=[],i=[],n=[];dn(t,(t=>{t&&(e=t[0],Wr(e)?n.push(t):zr(t)?t.call(this):Wr(t)&&"alias"===e?r.push(t):Wr(t)&&-1!==e.indexOf("capture")&&zr(this[e])?n.push(t):i.push(t))}));var o=function(t,e){dn(t,(function(t){if(Wr(t[0])){var r=e;vn(t,(function(t){r=r[t[0]].apply(r,t.slice(1))}))}else this[t[0]].apply(this,t.slice(1))}),e)};o(r,this),o(i,this),o(n,this)}nn(){var t,e;return(null==(t=this.config.bootstrap)?void 0:t.featureFlags)&&Object.keys(null==(e=this.config.bootstrap)?void 0:e.featureFlags).length>0||!1}push(t){this._execute_array([t])}capture(t,e,i){var n;if(this.__loaded&&this.persistence&&this.sessionPersistence&&this.tn){if(this.is_capturing())if(!Kr(t)&&Qr(t)){if(this.config.opt_out_useragent_filter||!this._is_bot()){var o=null!=i&&i.skip_client_rate_limiting?void 0:this.rateLimiter.clientRateLimitContext();if(null==o||!o.isRateLimited){null!=e&&e.$current_url&&!Qr(null==e?void 0:e.$current_url)&&(un.error("Invalid `$current_url` property provided to `posthog.capture`. Input must be a string. Ignoring provided value."),null==e||delete e.$current_url),this.sessionPersistence.update_search_keyword(),this.config.save_campaign_params&&this.sessionPersistence.update_campaign_params(),this.config.save_referrer&&this.sessionPersistence.update_referrer_info(),(this.config.save_campaign_params||this.config.save_referrer)&&this.persistence.set_initial_person_info();var s=new Date,a=(null==i?void 0:i.timestamp)||s,l=Ha(),u={uuid:l,event:t,properties:this.calculateEventProperties(t,e||{},a,l)};o&&(u.properties.$lib_rate_limit_remaining_tokens=o.remainingTokens),(null==i?void 0:i.$set)&&(u.$set=null==i?void 0:i.$set);var c=this.cn(null==i?void 0:i.$set_once);if(c&&(u.$set_once=c),(u=wn(u,null!=i&&i._noTruncate?null:this.config.properties_string_max_length)).timestamp=a,Kr(null==i?void 0:i.timestamp)||(u.properties.$event_time_override_provided=!0,u.properties.$event_time_override_system_time=s),t===Ca.DISMISSED||t===Ca.SENT){var h=null==e?void 0:e[Ia.SURVEY_ID],d=null==e?void 0:e[Ia.SURVEY_ITERATION];Fa({id:h,current_iteration:d}),u.$set=r({},u.$set,{[Na({id:h,current_iteration:d},t===Ca.SENT?"responded":"dismissed")]:!0})}var v=r({},u.properties.$set,u.$set);if(Jr(v)||this.setPersonPropertiesForFlags(v),!ri(this.config.before_send)){var f=this.hn(u);if(!f)return;u=f}this.Gi.emit("eventCaptured",u);var p={method:"POST",url:null!==(n=null==i?void 0:i._url)&&void 0!==n?n:this.requestRouter.endpointFor("api",this.analyticsDefaultEndpoint),data:u,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.en(p):this.tn.enqueue(p),u}un.critical("This capture call is ignored due to client rate limiting.")}}else un.error("No event name provided to posthog.capture")}else un.uninitializedWarning("posthog.capture")}hr(t){return this.on("eventCaptured",(e=>t(e.event,e)))}calculateEventProperties(t,e,i,n,o){if(i=i||new Date,!this.persistence||!this.sessionPersistence)return e;var s=o?void 0:this.persistence.remove_event_timer(t),a=r({},e);if(a.token=this.config.token,a.$config_defaults=this.config.defaults,("always"==this.config.cookieless_mode||"on_reject"==this.config.cookieless_mode&&this.consent.isExplicitlyOptedOut())&&(a.$cookieless_mode=!0),"$snapshot"===t){var l=r({},this.persistence.properties(),this.sessionPersistence.properties());return a.distinct_id=l.distinct_id,(!Qr(a.distinct_id)&&!ii(a.distinct_id)||ti(a.distinct_id))&&un.error("Invalid distinct_id for replay event. This indicates a bug in your implementation"),a}var u,c=yv(this.config.mask_personal_data_properties,this.config.custom_personal_data_properties);if(this.sessionManager){var{sessionId:h,windowId:d}=this.sessionManager.checkAndGetSessionAndWindowId(o,i.getTime());a.$session_id=h,a.$window_id=d}this.sessionPropsManager&&fn(a,this.sessionPropsManager.getSessionProps());try{var v;this.sessionRecording&&fn(a,this.sessionRecording.sdkDebugProperties),a.$sdk_debug_retry_queue_size=null==(v=this.rn)?void 0:v.length}catch(t){a.$sdk_debug_error_capturing_properties=String(t)}if(this.requestRouter.region===tf.CUSTOM&&(a.$lib_custom_api_host=this.config.api_host),u="$pageview"!==t||o?"$pageleave"!==t||o?this.pageViewManager.doEvent():this.pageViewManager.doPageLeave(i):this.pageViewManager.doPageView(i,n),a=fn(a,u),"$pageview"===t&&Ji&&(a.title=Ji.title),!Kr(s)){var f=i.getTime()-s;a.$duration=parseFloat((f/1e3).toFixed(3))}rn&&this.config.opt_out_useragent_filter&&(a.$browser_type=this._is_bot()?"bot":"browser"),(a=fn({},c,this.persistence.properties(),this.sessionPersistence.properties(),a)).$is_identified=this._isIdentified(),Wr(this.config.property_denylist)?vn(this.config.property_denylist,(function(t){delete a[t]})):un.error("Invalid value for property_denylist config: "+this.config.property_denylist+" or property_blacklist config: "+this.config.property_blacklist);var p=this.config.sanitize_properties;p&&(un.error("sanitize_properties is deprecated. Use before_send instead"),a=p(a,t));var g=this.dn();return a.$process_person_profile=g,g&&!o&&this.vn("_calculate_event_properties"),a}cn(t){var e;if(!this.persistence||!this.dn())return t;if(this.Yi)return t;var r=this.persistence.get_initial_props(),i=null==(e=this.sessionPropsManager)?void 0:e.getSetOnceProps(),n=fn({},r,i||{},t||{}),o=this.config.sanitize_properties;return o&&(un.error("sanitize_properties is deprecated. Use before_send instead"),n=o(n,"$set_once")),this.Yi=!0,Jr(n)?void 0:n}register(t,e){var r;null==(r=this.persistence)||r.register(t,e)}register_once(t,e,r){var i;null==(i=this.persistence)||i.register_once(t,e,r)}register_for_session(t){var e;null==(e=this.sessionPersistence)||e.register(t)}unregister(t){var e;null==(e=this.persistence)||e.unregister(t)}unregister_for_session(t){var e;null==(e=this.sessionPersistence)||e.unregister(t)}fn(t,e){this.register({[t]:e})}getFeatureFlag(t,e){return this.featureFlags.getFeatureFlag(t,e)}getFeatureFlagPayload(t){var e=this.featureFlags.getFeatureFlagPayload(t);try{return JSON.parse(e)}catch(t){return e}}isFeatureEnabled(t,e){return this.featureFlags.isFeatureEnabled(t,e)}reloadFeatureFlags(){this.featureFlags.reloadFeatureFlags()}updateEarlyAccessFeatureEnrollment(t,e,r){this.featureFlags.updateEarlyAccessFeatureEnrollment(t,e,r)}getEarlyAccessFeatures(t,e,r){return void 0===e&&(e=!1),this.featureFlags.getEarlyAccessFeatures(t,e,r)}on(t,e){return this.Gi.on(t,e)}onFeatureFlags(t){return this.featureFlags.onFeatureFlags(t)}onSurveysLoaded(t){return this.surveys.onSurveysLoaded(t)}onSessionId(t){var e,r;return null!==(e=null==(r=this.sessionManager)?void 0:r.onSessionId(t))&&void 0!==e?e:()=>{}}getSurveys(t,e){void 0===e&&(e=!1),this.surveys.getSurveys(t,e)}getActiveMatchingSurveys(t,e){void 0===e&&(e=!1),this.surveys.getActiveMatchingSurveys(t,e)}renderSurvey(t,e){this.surveys.renderSurvey(t,e)}displaySurvey(t,e){void 0===e&&(e=Pa),this.surveys.displaySurvey(t,e)}canRenderSurvey(t){return this.surveys.canRenderSurvey(t)}canRenderSurveyAsync(t,e){return void 0===e&&(e=!1),this.surveys.canRenderSurveyAsync(t,e)}identify(t,e,i){if(!this.__loaded||!this.persistence)return un.uninitializedWarning("posthog.identify");if(ii(t)&&(t=t.toString(),un.warn("The first argument to posthog.identify was a number, but it should be a string. It has been converted to a string.")),t)if(["distinct_id","distinctid"].includes(t.toLowerCase()))un.critical('The string "'+t+'" was set in posthog.identify which indicates an error. This ID should be unique to the user and not a hardcoded string.');else if(t!==lo){if(this.vn("posthog.identify")){var n=this.get_distinct_id();if(this.register({$user_id:t}),!this.get_property("$device_id")){var o=n;this.register_once({$had_persisted_distinct_id:!0,$device_id:o},"")}t!==n&&t!==this.get_property(Fn)&&(this.unregister(Fn),this.register({distinct_id:t}));var s="anonymous"===(this.persistence.get_property(to)||"anonymous");t!==n&&s?(this.persistence.set_property(to,"identified"),this.setPersonPropertiesForFlags(r({},i||{},e||{}),!1),this.capture("$identify",{distinct_id:t,$anon_distinct_id:n},{$set:e||{},$set_once:i||{}}),this.Xi=Nu(t,e,i),this.featureFlags.setAnonymousDistinctId(n)):(e||i)&&this.setPersonProperties(e,i),t!==n&&(this.reloadFeatureFlags(),this.unregister(Qn))}}else un.critical('The string "'+lo+'" was set in posthog.identify which indicates an error. This ID is only used as a sentinel value.');else un.error("Unique user id has not been set in posthog.identify")}setPersonProperties(t,e){if((t||e)&&this.vn("posthog.setPersonProperties")){var i=Nu(this.get_distinct_id(),t,e);this.Xi!==i?(this.setPersonPropertiesForFlags(r({},e||{},t||{})),this.capture("$set",{$set:t||{},$set_once:e||{}}),this.Xi=i):un.info("A duplicate setPersonProperties call was made with the same properties. It has been ignored.")}}group(t,e,i){if(t&&e){if(this.vn("posthog.group")){var n=this.getGroups();n[t]!==e&&this.resetGroupPropertiesForFlags(t),this.register({$groups:r({},n,{[t]:e})}),i&&(this.capture("$groupidentify",{$group_type:t,$group_key:e,$group_set:i}),this.setGroupPropertiesForFlags({[t]:i})),n[t]===e||i||this.reloadFeatureFlags()}}else un.error("posthog.group requires a group type and group key")}resetGroups(){this.register({$groups:{}}),this.resetGroupPropertiesForFlags(),this.reloadFeatureFlags()}setPersonPropertiesForFlags(t,e){void 0===e&&(e=!0),this.featureFlags.setPersonPropertiesForFlags(t,e)}resetPersonPropertiesForFlags(){this.featureFlags.resetPersonPropertiesForFlags()}setGroupPropertiesForFlags(t,e){void 0===e&&(e=!0),this.vn("posthog.setGroupPropertiesForFlags")&&this.featureFlags.setGroupPropertiesForFlags(t,e)}resetGroupPropertiesForFlags(t){this.featureFlags.resetGroupPropertiesForFlags(t)}reset(t){var e,r,i,n;if(un.info("reset"),!this.__loaded)return un.uninitializedWarning("posthog.reset");var o=this.get_property("$device_id");if(this.consent.reset(),null==(e=this.persistence)||e.clear(),null==(r=this.sessionPersistence)||r.clear(),this.surveys.reset(),this.featureFlags.reset(),null==(i=this.persistence)||i.set_property(to,"anonymous"),null==(n=this.sessionManager)||n.resetSessionId(),this.Xi=null,"always"===this.config.cookieless_mode)this.register_once({distinct_id:lo,$device_id:null},"");else{var s=this.config.get_device_id(Ha());this.register_once({distinct_id:s,$device_id:t?s:o},"")}this.register({$last_posthog_reset:(new Date).toISOString()},1)}get_distinct_id(){return this.get_property("distinct_id")}getGroups(){return this.get_property("$groups")||{}}get_session_id(){var t,e;return null!==(t=null==(e=this.sessionManager)?void 0:e.checkAndGetSessionAndWindowId(!0).sessionId)&&void 0!==t?t:""}get_session_replay_url(t){if(!this.sessionManager)return"";var{sessionId:e,sessionStartTimestamp:r}=this.sessionManager.checkAndGetSessionAndWindowId(!0),i=this.requestRouter.endpointFor("ui","/project/"+this.config.token+"/replay/"+e);if(null!=t&&t.withTimestamp&&r){var n,o=null!==(n=t.timestampLookBack)&&void 0!==n?n:10;if(!r)return i;i+="?t="+Math.max(Math.floor(((new Date).getTime()-r)/1e3)-o,0)}return i}alias(t,e){return t===this.get_property(Rn)?(un.critical("Attempting to create alias for existing People user - aborting."),-2):this.vn("posthog.alias")?(Kr(e)&&(e=this.get_distinct_id()),t!==e?(this.fn(Fn,t),this.capture("$create_alias",{alias:t,distinct_id:e})):(un.warn("alias matches current distinct_id - skipping api call."),this.identify(t),-1)):void 0}set_config(t){var e=r({},this.config);if(Xr(t)){var i,n,o,s,a;fn(this.config,mf(t));var l=this.Qi();null==(i=this.persistence)||i.update_config(this.config,e,l),this.sessionPersistence="sessionStorage"===this.config.persistence||"memory"===this.config.persistence?this.persistence:new Ev(r({},this.config,{persistence:"sessionStorage"}),l),Id.Dt()&&"true"===Id.Zt("ph_debug")&&(this.config.debug=!0),this.config.debug&&(an.DEBUG=!0,un.info("set_config",{config:t,oldConfig:e,newConfig:r({},this.config)})),null==(n=this.sessionRecording)||n.startIfEnabledOrStop(),null==(o=this.autocapture)||o.startIfEnabled(),null==(s=this.heatmaps)||s.startIfEnabled(),this.surveys.loadIfEnabled(),this.pn(),null==(a=this.externalIntegrations)||a.startIfEnabledOrStop()}}startSessionRecording(t){var e=!0===t,r={sampling:e||!(null==t||!t.sampling),linked_flag:e||!(null==t||!t.linked_flag),url_trigger:e||!(null==t||!t.url_trigger),event_trigger:e||!(null==t||!t.event_trigger)};if(Object.values(r).some(Boolean)){var i,n,o,s,a;if(null==(i=this.sessionManager)||i.checkAndGetSessionAndWindowId(),r.sampling)null==(n=this.sessionRecording)||n.overrideSampling();if(r.linked_flag)null==(o=this.sessionRecording)||o.overrideLinkedFlag();if(r.url_trigger)null==(s=this.sessionRecording)||s.overrideTrigger("url");if(r.event_trigger)null==(a=this.sessionRecording)||a.overrideTrigger("event")}this.set_config({disable_session_recording:!1})}stopSessionRecording(){this.set_config({disable_session_recording:!0})}sessionRecordingStarted(){var t;return!(null==(t=this.sessionRecording)||!t.started)}captureException(t,e){var i=new Error("PostHog syntheticException"),n=this.exceptions.buildProperties(t,{handled:!0,syntheticException:i});return this.exceptions.sendExceptionEvent(r({},n,e))}loadToolbar(t){return this.toolbar.loadToolbar(t)}get_property(t){var e;return null==(e=this.persistence)?void 0:e.props[t]}getSessionProperty(t){var e;return null==(e=this.sessionPersistence)?void 0:e.props[t]}toString(){var t,e=null!==(t=this.config.name)&&void 0!==t?t:ff;return e!==ff&&(e=ff+"."+e),e}_isIdentified(){var t,e;return"identified"===(null==(t=this.persistence)?void 0:t.get_property(to))||"identified"===(null==(e=this.sessionPersistence)?void 0:e.get_property(to))}dn(){var t,e;return!("never"===this.config.person_profiles||"identified_only"===this.config.person_profiles&&!this._isIdentified()&&Jr(this.getGroups())&&(null==(t=this.persistence)||null==(t=t.props)||!t[Fn])&&(null==(e=this.persistence)||null==(e=e.props)||!e[so]))}un(){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.dn()||this.vn("posthog.createPersonProfile")&&this.setPersonProperties({},{})}vn(t){return"never"===this.config.person_profiles?(un.error(t+' was called, but process_person is set to "never". This call will be ignored.'),!1):(this.fn(so,!0),!0)}Qi(){if("always"===this.config.cookieless_mode)return!0;var t=this.consent.isOptedOut(),e=this.config.opt_out_persistence_by_default||"on_reject"===this.config.cookieless_mode;return this.config.disable_persistence||t&&!!e}pn(){var t,e,r,i,n=this.Qi();(null==(t=this.persistence)?void 0:t.Je)!==n&&(null==(r=this.persistence)||r.set_disabled(n));(null==(e=this.sessionPersistence)?void 0:e.Je)!==n&&(null==(i=this.sessionPersistence)||i.set_disabled(n));return n}opt_in_capturing(t){if("always"!==this.config.cookieless_mode){var e;if("on_reject"===this.config.cookieless_mode&&this.consent.isExplicitlyOptedOut()&&(this.reset(!0),this.sessionManager=new Wv(this),this.persistence&&(this.sessionPropsManager=new Yv(this,this.sessionManager,this.persistence)),this.sessionRecording=new hf(this),this.sessionRecording.startIfEnabledOrStop()),this.consent.optInOut(!0),this.pn(),this.an(),"on_reject"==this.config.cookieless_mode&&this.surveys.loadIfEnabled(),Kr(null==t?void 0:t.captureEventName)||null!=t&&t.captureEventName)this.capture(null!==(e=null==t?void 0:t.captureEventName)&&void 0!==e?e:"$opt_in",null==t?void 0:t.captureProperties,{send_instantly:!0});this.config.capture_pageview&&this.ln()}else un.warn('Consent opt in/out is not valid with cookieless_mode="always" and will be ignored')}opt_out_capturing(){var t;"always"!==this.config.cookieless_mode?("on_reject"===this.config.cookieless_mode&&this.consent.isOptedIn()&&this.reset(!0),this.consent.optInOut(!1),this.pn(),"on_reject"===this.config.cookieless_mode&&(this.register({distinct_id:lo,$device_id:null}),this.sessionManager=void 0,this.sessionPropsManager=void 0,null==(t=this.sessionRecording)||t.stopRecording(),this.sessionRecording=void 0,this.ln())):un.warn('Consent opt in/out is not valid with cookieless_mode="always" and will be ignored')}has_opted_in_capturing(){return this.consent.isOptedIn()}has_opted_out_capturing(){return this.consent.isOptedOut()}get_explicit_consent_status(){var t=this.consent.consent;return t===Ed.GRANTED?"granted":t===Ed.DENIED?"denied":"pending"}is_capturing(){return"always"===this.config.cookieless_mode||("on_reject"===this.config.cookieless_mode?this.consent.isExplicitlyOptedOut()||this.consent.isOptedIn():!this.has_opted_out_capturing())}clear_opt_in_out_capturing(){this.consent.reset(),this.pn()}_is_bot(){return Xi?Qv(Xi,this.config.custom_blocked_useragents):void 0}ln(){Ji&&("visible"===Ji.visibilityState?this.Wi||(this.Wi=!0,this.capture("$pageview",{title:Ji.title},{send_instantly:!0}),this.zi&&(Ji.removeEventListener("visibilitychange",this.zi),this.zi=null)):this.zi||(this.zi=this.ln.bind(this),Sn(Ji,"visibilitychange",this.zi)))}debug(t){!1===t?(null==Yi||Yi.console.log("You've disabled debug mode."),localStorage&&localStorage.removeItem("ph_debug"),this.set_config({debug:!1})):(null==Yi||Yi.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)`."),localStorage&&localStorage.setItem("ph_debug","true"),this.set_config({debug:!0}))}yt(){var t,e,r,i,n,o,s,a=this.Ji||{};return"advanced_disable_flags"in a?!!a.advanced_disable_flags:!1!==this.config.advanced_disable_flags?!!this.config.advanced_disable_flags:!0===this.config.advanced_disable_decide?(un.warn("Config field 'advanced_disable_decide' is deprecated. Please use 'advanced_disable_flags' instead. The old field will be removed in a future major version."),!0):(r="advanced_disable_decide",i=!1,n=un,o=(e="advanced_disable_flags")in(t=a)&&!Kr(t[e]),s=r in t&&!Kr(t[r]),o?t[e]:s?(n&&n.warn("Config field '"+r+"' is deprecated. Please use '"+e+"' instead. The old field will be removed in a future major version."),t[r]):i)}hn(t){if(ri(this.config.before_send))return t;var e=Wr(this.config.before_send)?this.config.before_send:[this.config.before_send],r=t;for(var i of e){if(r=i(r),ri(r)){var n="Event '"+t.event+"' was rejected in beforeSend function";return si(t.event)?un.warn(n+". This can cause unexpected behavior."):un.info(n),null}r.properties&&!Jr(r.properties)||un.warn("Event '"+t.event+"' has no properties after beforeSend function, this is likely an error.")}return r}getPageViewId(){var t;return null==(t=this.pageViewManager.Ne)?void 0:t.pageViewId}captureTraceFeedback(t,e){this.capture("$ai_feedback",{$ai_trace_id:String(t),$ai_feedback_text:e})}captureTraceMetric(t,e,r){this.capture("$ai_metric",{$ai_trace_id:String(t),$ai_metric_name:e,$ai_metric_value:String(r)})}}!function(t,e){for(var r=0;r<e.length;r++)t.prototype[e[r]]=yn(t.prototype[e[r]])}(bf,["identify"]);var wf,_f;wf=df[ff]=new bf,(_f=nn.posthog)&&vn(_f._i,(function(t){if(t&&Wr(t)){var e=wf.init(t[0],t[1],t[2]),r=_f[t[2]]||_f;e&&(e._execute_array.call(e.people,r.people),e._execute_array(r))}})),nn.posthog=wf,function(){function t(){t.done||(t.done=!0,pf=!1,vn(df,(function(t){t._dom_loaded()})))}null!=Ji&&Ji.addEventListener?"complete"===Ji.readyState?t():Sn(Ji,"DOMContentLoaded",t,{capture:!1}):Yi&&un.error("Browser doesn't support `document.addEventListener` so PostHog couldn't be initialized")}()}();
2
2
  //# sourceMappingURL=array.full.js.map