posthog-js 1.211.1 → 1.211.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.
- package/dist/all-external-dependencies.js +1 -1
- package/dist/all-external-dependencies.js.map +1 -1
- package/dist/array.full.es5.js +1 -1
- package/dist/array.full.es5.js.map +1 -1
- package/dist/array.full.js +1 -1
- package/dist/array.full.js.map +1 -1
- package/dist/array.full.no-external.js +1 -1
- package/dist/array.full.no-external.js.map +1 -1
- package/dist/array.js +1 -1
- package/dist/array.js.map +1 -1
- package/dist/array.no-external.js +1 -1
- package/dist/array.no-external.js.map +1 -1
- package/dist/customizations.full.js +1 -1
- package/dist/main.js +1 -1
- package/dist/main.js.map +1 -1
- package/dist/module.full.js +1 -1
- package/dist/module.full.js.map +1 -1
- package/dist/module.full.no-external.js +1 -1
- package/dist/module.full.no-external.js.map +1 -1
- package/dist/module.js +1 -1
- package/dist/module.js.map +1 -1
- package/dist/module.no-external.js +1 -1
- package/dist/module.no-external.js.map +1 -1
- package/dist/src/posthog-surveys.d.ts +1 -0
- package/dist/surveys-preview.js +1 -1
- package/dist/surveys-preview.js.map +1 -1
- package/dist/surveys.js +1 -1
- package/dist/surveys.js.map +1 -1
- package/lib/package.json +1 -1
- package/lib/src/extensions/surveys.jsx +45 -0
- package/lib/src/extensions/surveys.jsx.map +1 -1
- package/lib/src/posthog-surveys.d.ts +1 -0
- package/lib/src/posthog-surveys.js +11 -6
- package/lib/src/posthog-surveys.js.map +1 -1
- package/package.json +1 -1
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
!function(){"use strict";function e(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function t(t){for(var n=1;n<arguments.length;n++){var r=null!=arguments[n]?arguments[n]:{};n%2?e(Object(r),!0).forEach((function(e){i(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):e(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function n(e,t,n,r,i,o,s){try{var a=e[o](s),l=a.value}catch(e){return void n(e)}a.done?t(l):Promise.resolve(l).then(r,i)}function r(e){return function(){var t=this,r=arguments;return new Promise((function(i,o){var s=e.apply(t,r);function a(e){n(s,i,o,a,l,"next",e)}function l(e){n(s,i,o,a,l,"throw",e)}a(void 0)}))}}function i(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function o(e,t){if(null==e)return{};var n,r,i=function(e,t){if(null==e)return{};var n,r,i={},o=Object.keys(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||(i[n]=e[n]);return i}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}var s,a=["type"],l=Object.defineProperty,c=(e,t,n)=>((e,t,n)=>t in e?l(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n)(e,"symbol"!=typeof t?t+"":t,n),u=Object.defineProperty,d=(e,t,n)=>((e,t,n)=>t in e?u(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n)(e,"symbol"!=typeof t?t+"":t,n),h=(e=>(e[e.Document=0]="Document",e[e.DocumentType=1]="DocumentType",e[e.Element=2]="Element",e[e.Text=3]="Text",e[e.CDATA=4]="CDATA",e[e.Comment=5]="Comment",e))(h||{}),p={Node:["childNodes","parentNode","parentElement","textContent"],ShadowRoot:["host","styleSheets"],Element:["shadowRoot","querySelector","querySelectorAll"],MutationObserver:[]},v={Node:["contains","getRootNode"],ShadowRoot:["getSelection"],Element:[],MutationObserver:["constructor"]};var g={};function f(e){if(g[e])return g[e];var t=function(e){var t,n,r=null===globalThis||void 0===globalThis||null===(t=globalThis.Zone)||void 0===t||null===(n=t.__symbol__)||void 0===n?void 0:n.call(t,e);return r&&globalThis[r]?globalThis[r]:void 0}(e)||globalThis[e],n=t.prototype,r=e in p?p[e]:void 0,i=Boolean(r&&r.every((e=>{var t,r;return Boolean(null==(r=null==(t=Object.getOwnPropertyDescriptor(n,e))?void 0:t.get)?void 0:r.toString().includes("[native code]"))}))),o=e in v?v[e]:void 0,s=Boolean(o&&o.every((e=>{var t;return"function"==typeof n[e]&&(null==(t=n[e])?void 0:t.toString().includes("[native code]"))})));if(i&&s)return g[e]=t.prototype,t.prototype;try{var a=document.createElement("iframe");document.body.appendChild(a);var l=a.contentWindow;if(!l)return t.prototype;var c=l[e].prototype;return document.body.removeChild(a),c?g[e]=c:t.prototype}catch(e){return t.prototype}}var m={};function _(e,t,n){var r,i="".concat(e,".").concat(String(n));if(m[i])return m[i].call(t);var o=f(e),s=null==(r=Object.getOwnPropertyDescriptor(o,n))?void 0:r.get;return s?(m[i]=s,s.call(t)):t[n]}var y={};function b(e,t,n){var r="".concat(e,".").concat(String(n));if(y[r])return y[r].bind(t);var i=f(e)[n];return"function"!=typeof i?t[n]:(y[r]=i,i.bind(t))}var w={childNodes:function(e){return _("Node",e,"childNodes")},parentNode:function(e){return _("Node",e,"parentNode")},parentElement:function(e){return _("Node",e,"parentElement")},textContent:function(e){return _("Node",e,"textContent")},contains:function(e,t){return b("Node",e,"contains")(t)},getRootNode:function(e){return b("Node",e,"getRootNode")()},host:function(e){return e&&"host"in e?_("ShadowRoot",e,"host"):null},styleSheets:function(e){return e.styleSheets},shadowRoot:function(e){return e&&"shadowRoot"in e?_("Element",e,"shadowRoot"):null},querySelector:function(e,t){return _("Element",e,"querySelector")(t)},querySelectorAll:function(e,t){return _("Element",e,"querySelectorAll")(t)},mutationObserver:function(){return f("MutationObserver").constructor}};function S(e){return e.nodeType===e.ELEMENT_NODE}function C(e){var t=e&&"host"in e&&"mode"in e&&w.host(e)||null;return Boolean(t&&"shadowRoot"in t&&w.shadowRoot(t)===e)}function I(e){return"[object ShadowRoot]"===Object.prototype.toString.call(e)}function k(e){try{var t=e.rules||e.cssRules;if(!t)return null;var n=Array.from(t,(t=>E(t,e.href))).join("");return(r=n).includes(" background-clip: text;")&&!r.includes(" -webkit-background-clip: text;")&&(r=r.replace(/\sbackground-clip:\s*text;/g," -webkit-background-clip: text; background-clip: text;")),r}catch(e){return null}var r}function E(e,t){if(function(e){return"styleSheet"in e}(e)){var n;try{n=k(e.styleSheet)||function(e){var{cssText:t}=e;if(t.split('"').length<3)return t;var n=["@import","url(".concat(JSON.stringify(e.href),")")];return""===e.layerName?n.push("layer"):e.layerName&&n.push("layer(".concat(e.layerName,")")),e.supportsText&&n.push("supports(".concat(e.supportsText,")")),e.media.length&&n.push(e.media.mediaText),n.join(" ")+";"}(e)}catch(t){n=e.cssText}return e.styleSheet.href?B(n,e.styleSheet.href):n}var r,i=e.cssText;return function(e){return"selectorText"in e}(e)&&e.selectorText.includes(":")&&(r=/(\[(?:[\w-]+)[^\\])(:(?:[\w-]+)\])/gm,i=i.replace(r,"$1\\$2")),t?B(i,t):i}function x(e,t){return Array.from(e.styleSheets).find((e=>e.href===t))}let T=class{constructor(){d(this,"idNodeMap",new Map),d(this,"nodeMetaMap",new WeakMap)}getId(e){var t;if(!e)return-1;var n=null==(t=this.getMeta(e))?void 0:t.id;return null!=n?n:-1}getNode(e){return this.idNodeMap.get(e)||null}getIds(){return Array.from(this.idNodeMap.keys())}getMeta(e){return this.nodeMetaMap.get(e)||null}removeNodeFromMap(e){var t=this.getId(e);this.idNodeMap.delete(t),e.childNodes&&e.childNodes.forEach((e=>this.removeNodeFromMap(e)))}has(e){return this.idNodeMap.has(e)}hasNode(e){return this.nodeMetaMap.has(e)}add(e,t){var n=t.id;this.idNodeMap.set(n,e),this.nodeMetaMap.set(e,t)}replace(e,t){var n=this.getNode(e);if(n){var r=this.nodeMetaMap.get(n);r&&this.nodeMetaMap.set(t,r)}this.idNodeMap.set(e,t)}reset(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap}};function M(e){var{element:t,maskInputOptions:n,tagName:r,type:i,value:o,maskInputFn:s}=e,a=o||"",l=i&&R(i);return(n[r.toLowerCase()]||l&&n[l])&&(a=s?s(a,t):"*".repeat(a.length)),a}function R(e){return e.toLowerCase()}var A="__rrweb_original__";function N(e){var t=e.type;return e.hasAttribute("data-rr-is-password")?"password":t?R(t):null}function F(e,t){var n,r;try{r=new URL(e,null!=t?t:window.location.href)}catch(e){return null}var i=r.pathname.match(/\.([0-9a-z]+)(?:$)/i);return null!==(n=null==i?void 0:i[1])&&void 0!==n?n:null}var O=/url\((?:(')([^']*)'|(")(.*?)"|([^)]*))\)/gm,P=/^(?:[a-z+]+:)?\/\//i,L=/^www\..*/i,D=/^(data:)([^,]*),(.*)/i;function B(e,t){return(e||"").replace(O,((e,n,r,i,o,s)=>{var a,l=r||o||s,c=n||i||"";if(!l)return e;if(P.test(l)||L.test(l))return"url(".concat(c).concat(l).concat(c,")");if(D.test(l))return"url(".concat(c).concat(l).concat(c,")");if("/"===l[0])return"url(".concat(c).concat((a=t,(a.indexOf("//")>-1?a.split("/").slice(0,3).join("/"):a.split("/")[0]).split("?")[0]+l)).concat(c,")");var u=t.split("/"),d=l.split("/");for(var h of(u.pop(),d))"."!==h&&(".."===h?u.pop():u.push(h));return"url(".concat(c).concat(u.join("/")).concat(c,")")}))}var H,q,$=1,W=new RegExp("[^a-z0-9-_:]"),V=-2;function Z(){return $++}var G=/^[^ \t\n\r\u000c]+/,U=/^[, \t\n\r\u000c]+/;var j=new WeakMap;function z(e,t){return t&&""!==t.trim()?X(e,t):t}function Y(e){return Boolean("svg"===e.tagName||e.ownerSVGElement)}function X(e,t){var n=j.get(e);if(n||(n=e.createElement("a"),j.set(e,n)),t){if(t.startsWith("blob:")||t.startsWith("data:"))return t}else t="";return n.setAttribute("href",t),n.href}function J(e,t,n,r){return r?"src"===n||"href"===n&&("use"!==t||"#"!==r[0])||"xlink:href"===n&&"#"!==r[0]?z(e,r):"background"!==n||"table"!==t&&"td"!==t&&"th"!==t?"srcset"===n?function(e,t){if(""===t.trim())return t;var n=0;function r(e){var r,i=e.exec(t.substring(n));return i?(r=i[0],n+=r.length,r):""}for(var i=[];r(U),!(n>=t.length);){var o=r(G);if(","===o.slice(-1))o=z(e,o.substring(0,o.length-1)),i.push(o);else{var s="";o=z(e,o);for(var a=!1;;){var l=t.charAt(n);if(""===l){i.push((o+s).trim());break}if(a)")"===l&&(a=!1);else{if(","===l){n+=1,i.push((o+s).trim());break}"("===l&&(a=!0)}s+=l,n+=1}}}return i.join(", ")}(e,r):"style"===n?B(r,X(e)):"object"===t&&"data"===n?z(e,r):r:z(e,r):r}function K(e,t,n){return("video"===e||"audio"===e)&&"autoplay"===t}function Q(e,t,n){if(!e)return!1;if(e.nodeType!==e.ELEMENT_NODE)return!!n&&Q(w.parentNode(e),t,n);for(var r=e.classList.length;r--;){var i=e.classList[r];if(t.test(i))return!0}return!!n&&Q(w.parentNode(e),t,n)}function ee(e,t,n,r){var i;if(S(e)){if(i=e,!w.childNodes(i).length)return!1}else{if(null===w.parentElement(e))return!1;i=w.parentElement(e)}try{if("string"==typeof t){if(r){if(i.closest(".".concat(t)))return!0}else if(i.classList.contains(t))return!0}else if(Q(i,t,r))return!0;if(n)if(r){if(i.closest(n))return!0}else if(i.matches(n))return!0}catch(e){}return!1}function te(e,t){var{doc:n,mirror:r,blockClass:i,blockSelector:o,needsMask:s,inlineStylesheet:a,maskInputOptions:l={},maskTextFn:c,maskInputFn:u,dataURLOptions:d={},inlineImages:p,recordCanvas:v,keepIframeSrcFn:g,newlyAddedElement:f=!1}=t,m=function(e,t){if(!t.hasNode(e))return;var n=t.getId(e);return 1===n?void 0:n}(n,r);switch(e.nodeType){case e.DOCUMENT_NODE:return"CSS1Compat"!==e.compatMode?{type:h.Document,childNodes:[],compatMode:e.compatMode}:{type:h.Document,childNodes:[]};case e.DOCUMENT_TYPE_NODE:return{type:h.DocumentType,name:e.name,publicId:e.publicId,systemId:e.systemId,rootId:m};case e.ELEMENT_NODE:return function(e,t){for(var n,{doc:r,blockClass:i,blockSelector:o,inlineStylesheet:s,maskInputOptions:a={},maskInputFn:l,dataURLOptions:c={},inlineImages:u,recordCanvas:d,keepIframeSrcFn:p,newlyAddedElement:v=!1,rootId:g}=t,f=function(e,t,n){try{if("string"==typeof t){if(e.classList.contains(t))return!0}else for(var r=e.classList.length;r--;){var i=e.classList[r];if(t.test(i))return!0}if(n)return e.matches(n)}catch(e){}return!1}(e,i,o),m=function(e){if(e instanceof HTMLFormElement)return"form";var t=R(e.tagName);return W.test(t)?"div":t}(e),_={},y=e.attributes.length,b=0;b<y;b++){var S=e.attributes[b];K(m,S.name,S.value)||(_[S.name]=J(r,m,R(S.name),S.value))}if("link"===m&&s){var C=function(e){return null==e?void 0:e.href}(e);if(C){var I=x(r,C);if(!I&&C.includes(".css"))I=x(r,window.location.origin+"/"+C.replace(window.location.href,""));var E=null;I&&(E=k(I)),E&&(delete _.rel,delete _.href,_._cssText=E)}}if("style"===m&&e.sheet&&!(e.innerText||w.textContent(e)||"").trim().length){var T=k(e.sheet);T&&(_._cssText=T)}if("input"===m||"textarea"===m||"select"===m){var F=e.value,O=e.checked;"radio"!==_.type&&"checkbox"!==_.type&&"submit"!==_.type&&"button"!==_.type&&F?_.value=M({element:e,type:N(e),tagName:m,value:F,maskInputOptions:a,maskInputFn:l}):O&&(_.checked=O)}"option"===m&&(e.selected&&!a.select?_.selected=!0:delete _.selected);if("dialog"===m&&e.open)try{_.rr_open_mode=e.matches("dialog:modal")?"modal":"non-modal"}catch(e){_.rr_open_mode="modal",_.ph_rr_could_not_detect_modal=!0}if("canvas"===m&&d)if("2d"===e.__context)(function(e){var t=e.getContext("2d");if(!t)return!0;for(var n=0;n<e.width;n+=50)for(var r=0;r<e.height;r+=50){var i=t.getImageData,o=A in i?i[A]:i;if(new Uint32Array(o.call(t,n,r,Math.min(50,e.width-n),Math.min(50,e.height-r)).data.buffer).some((e=>0!==e)))return!1}return!0})(e)||(_.rr_dataURL=e.toDataURL(c.type,c.quality));else if(!("__context"in e)){var P=e.toDataURL(c.type,c.quality),L=r.createElement("canvas");L.width=e.width,L.height=e.height,P!==L.toDataURL(c.type,c.quality)&&(_.rr_dataURL=P)}if("img"===m&&u){H||(H=r.createElement("canvas"),q=H.getContext("2d"));var D=e,B=D.currentSrc||D.getAttribute("src")||"<unknown-src>",$=D.crossOrigin,V=()=>{D.removeEventListener("load",V);try{H.width=D.naturalWidth,H.height=D.naturalHeight,q.drawImage(D,0,0),_.rr_dataURL=H.toDataURL(c.type,c.quality)}catch(e){if("anonymous"!==D.crossOrigin)return D.crossOrigin="anonymous",void(D.complete&&0!==D.naturalWidth?V():D.addEventListener("load",V));console.warn("Cannot inline img src=".concat(B,"! Error: ").concat(e))}"anonymous"===D.crossOrigin&&($?_.crossOrigin=$:D.removeAttribute("crossorigin"))};D.complete&&0!==D.naturalWidth?V():D.addEventListener("load",V)}if("audio"===m||"video"===m){var Z=_;Z.rr_mediaState=e.paused?"paused":"played",Z.rr_mediaCurrentTime=e.currentTime,Z.rr_mediaPlaybackRate=e.playbackRate,Z.rr_mediaMuted=e.muted,Z.rr_mediaLoop=e.loop,Z.rr_mediaVolume=e.volume}v||(e.scrollLeft&&(_.rr_scrollLeft=e.scrollLeft),e.scrollTop&&(_.rr_scrollTop=e.scrollTop));if(f){var{width:G,height:U}=e.getBoundingClientRect();_={class:_.class,rr_width:"".concat(G,"px"),rr_height:"".concat(U,"px")}}"iframe"!==m||p(_.src)||(e.contentDocument||(_.rr_src=_.src),delete _.src);try{customElements.get(m)&&(n=!0)}catch(e){}return{type:h.Element,tagName:m,attributes:_,childNodes:[],isSVG:Y(e)||void 0,needBlock:f,rootId:g,isCustom:n}}(e,{doc:n,blockClass:i,blockSelector:o,inlineStylesheet:a,maskInputOptions:l,maskInputFn:u,dataURLOptions:d,inlineImages:p,recordCanvas:v,keepIframeSrcFn:g,newlyAddedElement:f,rootId:m});case e.TEXT_NODE:return function(e,t){var n,{needsMask:r,maskTextFn:i,rootId:o}=t,s=w.parentNode(e),a=s&&s.tagName,l=w.textContent(e),c="STYLE"===a||void 0,u="SCRIPT"===a||void 0;if(c&&l){try{e.nextSibling||e.previousSibling||(null==(n=s.sheet)?void 0:n.cssRules)&&(l=k(s.sheet))}catch(t){console.warn("Cannot get CSS styles from text's parentNode. Error: ".concat(t),e)}l=B(l,X(t.doc))}u&&(l="SCRIPT_PLACEHOLDER");!c&&!u&&l&&r&&(l=i?i(l,w.parentElement(e)):l.replace(/[\S]/g,"*"));return{type:h.Text,textContent:l||"",isStyle:c,rootId:o}}(e,{doc:n,needsMask:s,maskTextFn:c,rootId:m});case e.CDATA_SECTION_NODE:return{type:h.CDATA,textContent:"",rootId:m};case e.COMMENT_NODE:return{type:h.Comment,textContent:w.textContent(e)||"",rootId:m};default:return!1}}function ne(e){return null==e?"":e.toLowerCase()}function re(e,t){var{doc:n,mirror:r,blockClass:i,blockSelector:o,maskTextClass:s,maskTextSelector:a,skipChild:l=!1,inlineStylesheet:c=!0,maskInputOptions:u={},maskTextFn:d,maskInputFn:p,slimDOMOptions:v,dataURLOptions:g={},inlineImages:f=!1,recordCanvas:m=!1,onSerialize:_,onIframeLoad:y,iframeLoadTimeout:b=5e3,onStylesheetLoad:k,stylesheetLoadTimeout:E=5e3,keepIframeSrcFn:x=(()=>!1),newlyAddedElement:T=!1}=t,{needsMask:M}=t,{preserveWhiteSpace:R=!0}=t;M||(M=ee(e,s,a,void 0===M));var A,N=te(e,{doc:n,mirror:r,blockClass:i,blockSelector:o,needsMask:M,inlineStylesheet:c,maskInputOptions:u,maskTextFn:d,maskInputFn:p,dataURLOptions:g,inlineImages:f,recordCanvas:m,keepIframeSrcFn:x,newlyAddedElement:T});if(!N)return console.warn(e,"not serialized"),null;A=r.hasNode(e)?r.getId(e):!function(e,t){if(t.comment&&e.type===h.Comment)return!0;if(e.type===h.Element){if(t.script&&("script"===e.tagName||"link"===e.tagName&&("preload"===e.attributes.rel||"modulepreload"===e.attributes.rel)&&"script"===e.attributes.as||"link"===e.tagName&&"prefetch"===e.attributes.rel&&"string"==typeof e.attributes.href&&"js"===F(e.attributes.href)))return!0;if(t.headFavicon&&("link"===e.tagName&&"shortcut icon"===e.attributes.rel||"meta"===e.tagName&&(ne(e.attributes.name).match(/^msapplication-tile(image|color)$/)||"application-name"===ne(e.attributes.name)||"icon"===ne(e.attributes.rel)||"apple-touch-icon"===ne(e.attributes.rel)||"shortcut icon"===ne(e.attributes.rel))))return!0;if("meta"===e.tagName){if(t.headMetaDescKeywords&&ne(e.attributes.name).match(/^description|keywords$/))return!0;if(t.headMetaSocial&&(ne(e.attributes.property).match(/^(og|twitter|fb):/)||ne(e.attributes.name).match(/^(og|twitter):/)||"pinterest"===ne(e.attributes.name)))return!0;if(t.headMetaRobots&&("robots"===ne(e.attributes.name)||"googlebot"===ne(e.attributes.name)||"bingbot"===ne(e.attributes.name)))return!0;if(t.headMetaHttpEquiv&&void 0!==e.attributes["http-equiv"])return!0;if(t.headMetaAuthorship&&("author"===ne(e.attributes.name)||"generator"===ne(e.attributes.name)||"framework"===ne(e.attributes.name)||"publisher"===ne(e.attributes.name)||"progid"===ne(e.attributes.name)||ne(e.attributes.property).match(/^article:/)||ne(e.attributes.property).match(/^product:/)))return!0;if(t.headMetaVerification&&("google-site-verification"===ne(e.attributes.name)||"yandex-verification"===ne(e.attributes.name)||"csrf-token"===ne(e.attributes.name)||"p:domain_verify"===ne(e.attributes.name)||"verify-v1"===ne(e.attributes.name)||"verification"===ne(e.attributes.name)||"shopify-checkout-api-token"===ne(e.attributes.name)))return!0}}return!1}(N,v)&&(R||N.type!==h.Text||N.isStyle||N.textContent.replace(/^\s+|\s+$/gm,"").length)?Z():V;var O=Object.assign(N,{id:A});if(r.add(e,O),A===V)return null;_&&_(e);var P=!l;if(O.type===h.Element){P=P&&!O.needBlock,delete O.needBlock;var L=w.shadowRoot(e);L&&I(L)&&(O.isShadowHost=!0)}if((O.type===h.Document||O.type===h.Element)&&P){v.headWhitespace&&O.type===h.Element&&"head"===O.tagName&&(R=!1);var D={doc:n,mirror:r,blockClass:i,blockSelector:o,needsMask:M,maskTextClass:s,maskTextSelector:a,skipChild:l,inlineStylesheet:c,maskInputOptions:u,maskTextFn:d,maskInputFn:p,slimDOMOptions:v,dataURLOptions:g,inlineImages:f,recordCanvas:m,preserveWhiteSpace:R,onSerialize:_,onIframeLoad:y,iframeLoadTimeout:b,onStylesheetLoad:k,stylesheetLoadTimeout:E,keepIframeSrcFn:x};if(O.type===h.Element&&"textarea"===O.tagName&&void 0!==O.attributes.value);else for(var B of Array.from(w.childNodes(e))){var H=re(B,D);H&&O.childNodes.push(H)}var q=null;if(S(e)&&(q=w.shadowRoot(e)))for(var $ of Array.from(w.childNodes(q))){var W=re($,D);W&&(I(q)&&(W.isShadow=!0),O.childNodes.push(W))}}var G=w.parentNode(e);return G&&C(G)&&I(G)&&(O.isShadow=!0),O.type===h.Element&&"iframe"===O.tagName&&function(e,t,n){var r=e.contentWindow;if(r){var i,o=!1;try{i=r.document.readyState}catch(e){return}if("complete"===i){var s="about:blank";if(r.location.href!==s||e.src===s||""===e.src)return setTimeout(t,0),e.addEventListener("load",t);e.addEventListener("load",t)}else{var a=setTimeout((()=>{o||(t(),o=!0)}),n);e.addEventListener("load",(()=>{clearTimeout(a),o=!0,t()}))}}}(e,(()=>{var t=e.contentDocument;if(t&&y){var n=re(t,{doc:t,mirror:r,blockClass:i,blockSelector:o,needsMask:M,maskTextClass:s,maskTextSelector:a,skipChild:!1,inlineStylesheet:c,maskInputOptions:u,maskTextFn:d,maskInputFn:p,slimDOMOptions:v,dataURLOptions:g,inlineImages:f,recordCanvas:m,preserveWhiteSpace:R,onSerialize:_,onIframeLoad:y,iframeLoadTimeout:b,onStylesheetLoad:k,stylesheetLoadTimeout:E,keepIframeSrcFn:x});n&&y(e,n)}}),b),O.type===h.Element&&"link"===O.tagName&&"string"==typeof O.attributes.rel&&("stylesheet"===O.attributes.rel||"preload"===O.attributes.rel&&"string"==typeof O.attributes.href&&"css"===F(O.attributes.href))&&function(e,t,n){var r,i=!1;try{r=e.sheet}catch(e){return}if(!r){var o=setTimeout((()=>{i||(t(),i=!0)}),n);e.addEventListener("load",(()=>{clearTimeout(o),i=!0,t()}))}}(e,(()=>{if(k){var t=re(e,{doc:n,mirror:r,blockClass:i,blockSelector:o,needsMask:M,maskTextClass:s,maskTextSelector:a,skipChild:!1,inlineStylesheet:c,maskInputOptions:u,maskTextFn:d,maskInputFn:p,slimDOMOptions:v,dataURLOptions:g,inlineImages:f,recordCanvas:m,preserveWhiteSpace:R,onSerialize:_,onIframeLoad:y,iframeLoadTimeout:b,onStylesheetLoad:k,stylesheetLoadTimeout:E,keepIframeSrcFn:x});t&&k(e,t)}}),E),O}let ie=class e{constructor(){__publicField2(this,"parentElement",null),__publicField2(this,"parentNode",null),__publicField2(this,"ownerDocument"),__publicField2(this,"firstChild",null),__publicField2(this,"lastChild",null),__publicField2(this,"previousSibling",null),__publicField2(this,"nextSibling",null),__publicField2(this,"ELEMENT_NODE",1),__publicField2(this,"TEXT_NODE",3),__publicField2(this,"nodeType"),__publicField2(this,"nodeName"),__publicField2(this,"RRNodeType")}get childNodes(){for(var e=[],t=this.firstChild;t;)e.push(t),t=t.nextSibling;return e}contains(t){if(!(t instanceof e))return!1;if(t.ownerDocument!==this.ownerDocument)return!1;if(t===this)return!0;for(;t.parentNode;){if(t.parentNode===this)return!0;t=t.parentNode}return!1}appendChild(e){throw new Error("RRDomException: Failed to execute 'appendChild' on 'RRNode': This RRNode type does not support this method.")}insertBefore(e,t){throw new Error("RRDomException: Failed to execute 'insertBefore' on 'RRNode': This RRNode type does not support this method.")}removeChild(e){throw new Error("RRDomException: Failed to execute 'removeChild' on 'RRNode': This RRNode type does not support this method.")}toString(){return"RRNode"}};var oe={Node:["childNodes","parentNode","parentElement","textContent"],ShadowRoot:["host","styleSheets"],Element:["shadowRoot","querySelector","querySelectorAll"],MutationObserver:[]},se={Node:["contains","getRootNode"],ShadowRoot:["getSelection"],Element:[],MutationObserver:["constructor"]};var ae={};function le(e){if(ae[e])return ae[e];var t=function(e){var t,n,r=null===globalThis||void 0===globalThis||null===(t=globalThis.Zone)||void 0===t||null===(n=t.__symbol__)||void 0===n?void 0:n.call(t,e);return r&&globalThis[r]?globalThis[r]:void 0}(e)||globalThis[e],n=t.prototype,r=e in oe?oe[e]:void 0,i=Boolean(r&&r.every((e=>{var t,r;return Boolean(null==(r=null==(t=Object.getOwnPropertyDescriptor(n,e))?void 0:t.get)?void 0:r.toString().includes("[native code]"))}))),o=e in se?se[e]:void 0,s=Boolean(o&&o.every((e=>{var t;return"function"==typeof n[e]&&(null==(t=n[e])?void 0:t.toString().includes("[native code]"))})));if(i&&s)return ae[e]=t.prototype,t.prototype;try{var a=document.createElement("iframe");document.body.appendChild(a);var l=a.contentWindow;if(!l)return t.prototype;var c=l[e].prototype;return document.body.removeChild(a),c?ae[e]=c:n}catch(e){return n}}var ce={};function ue(e,t,n){var r,i="".concat(e,".").concat(String(n));if(ce[i])return ce[i].call(t);var o=le(e),s=null==(r=Object.getOwnPropertyDescriptor(o,n))?void 0:r.get;return s?(ce[i]=s,s.call(t)):t[n]}var de={};function he(e,t,n){var r="".concat(e,".").concat(String(n));if(de[r])return de[r].bind(t);var i=le(e)[n];return"function"!=typeof i?t[n]:(de[r]=i,i.bind(t))}function pe(){return le("MutationObserver").constructor}var ve={childNodes:function(e){return ue("Node",e,"childNodes")},parentNode:function(e){return ue("Node",e,"parentNode")},parentElement:function(e){return ue("Node",e,"parentElement")},textContent:function(e){return ue("Node",e,"textContent")},contains:function(e,t){return he("Node",e,"contains")(t)},getRootNode:function(e){return he("Node",e,"getRootNode")()},host:function(e){return e&&"host"in e?ue("ShadowRoot",e,"host"):null},styleSheets:function(e){return e.styleSheets},shadowRoot:function(e){return e&&"shadowRoot"in e?ue("Element",e,"shadowRoot"):null},querySelector:function(e,t){return ue("Element",e,"querySelector")(t)},querySelectorAll:function(e,t){return ue("Element",e,"querySelectorAll")(t)},mutationObserver:pe};function ge(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:document,r={capture:!0,passive:!0};return n.addEventListener(e,t,r),()=>n.removeEventListener(e,t,r)}var fe="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.",me={map:{},getId:()=>(console.error(fe),-1),getNode:()=>(console.error(fe),null),removeNodeFromMap(){console.error(fe)},has:()=>(console.error(fe),!1),reset(){console.error(fe)}};function _e(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=null,i=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();i||!1!==n.leading||(i=l);var c=t-(l-i),u=this;c<=0||c>t?(r&&(clearTimeout(r),r=null),i=l,e.apply(u,s)):r||!1===n.trailing||(r=setTimeout((()=>{i=!1===n.leading?0:Date.now(),r=null,e.apply(u,s)}),c))}}function ye(e,t,n,r){var i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:window,o=i.Object.getOwnPropertyDescriptor(e,t);return i.Object.defineProperty(e,t,r?n:{set(e){setTimeout((()=>{n.set.call(this,e)}),0),o&&o.set&&o.set.call(this,e)}}),()=>ye(e,t,o||{},!0)}function be(e,t,n){try{if(!(t in e))return()=>{};var r=e[t],i=n(r);return"function"==typeof i&&(i.prototype=i.prototype||{},Object.defineProperties(i,{__rrweb_original__:{enumerable:!1,value:r}})),e[t]=i,()=>{e[t]=r}}catch(e){return()=>{}}}"undefined"!=typeof window&&window.Proxy&&window.Reflect&&(me=new Proxy(me,{get:(e,t,n)=>("map"===t&&console.error(fe),Reflect.get(e,t,n))}));var we=Date.now;function Se(e){var t,n,r,i,o=e.document;return{left:o.scrollingElement?o.scrollingElement.scrollLeft:void 0!==e.pageXOffset?e.pageXOffset:o.documentElement.scrollLeft||(null==o?void 0:o.body)&&(null==(t=ve.parentElement(o.body))?void 0:t.scrollLeft)||(null==(n=null==o?void 0:o.body)?void 0:n.scrollLeft)||0,top:o.scrollingElement?o.scrollingElement.scrollTop:void 0!==e.pageYOffset?e.pageYOffset:(null==o?void 0:o.documentElement.scrollTop)||(null==o?void 0:o.body)&&(null==(r=ve.parentElement(o.body))?void 0:r.scrollTop)||(null==(i=null==o?void 0:o.body)?void 0:i.scrollTop)||0}}function Ce(){return window.innerHeight||document.documentElement&&document.documentElement.clientHeight||document.body&&document.body.clientHeight}function Ie(){return window.innerWidth||document.documentElement&&document.documentElement.clientWidth||document.body&&document.body.clientWidth}function ke(e){return e?e.nodeType===e.ELEMENT_NODE?e:ve.parentElement(e):null}function Ee(e,t,n,r){if(!e)return!1;var i=ke(e);if(!i)return!1;try{if("string"==typeof t){if(i.classList.contains(t))return!0;if(r&&null!==i.closest("."+t))return!0}else if(Q(i,t,r))return!0}catch(e){}if(n){if(i.matches(n))return!0;if(r&&null!==i.closest(n))return!0}return!1}function xe(e,t,n){return!("TITLE"!==e.tagName||!n.headTitleMutations)||t.getId(e)===V}function Te(e,t){if(C(e))return!1;var n=t.getId(e);if(!t.has(n))return!0;var r=ve.parentNode(e);return(!r||r.nodeType!==e.DOCUMENT_NODE)&&(!r||Te(r,t))}function Me(e){return Boolean(e.changedTouches)}function Re(e,t){return Boolean("IFRAME"===e.nodeName&&t.getMeta(e))}function Ae(e,t){return Boolean("LINK"===e.nodeName&&e.nodeType===e.ELEMENT_NODE&&e.getAttribute&&"stylesheet"===e.getAttribute("rel")&&t.getMeta(e))}function Ne(e){return!!e&&(e instanceof ie&&"shadowRoot"in e?Boolean(e.shadowRoot):Boolean(ve.shadowRoot(e)))}/[1-9][0-9]{12}/.test(Date.now().toString())||(we=()=>(new Date).getTime());let Fe=class{constructor(){c(this,"id",1),c(this,"styleIDMap",new WeakMap),c(this,"idStyleMap",new Map)}getId(e){var t;return null!==(t=this.styleIDMap.get(e))&&void 0!==t?t:-1}has(e){return this.styleIDMap.has(e)}add(e,t){return this.has(e)?this.getId(e):(n=void 0===t?this.id++:t,this.styleIDMap.set(e,n),this.idStyleMap.set(n,e),n);var n}getStyle(e){return this.idStyleMap.get(e)||null}reset(){this.styleIDMap=new WeakMap,this.idStyleMap=new Map,this.id=1}generateId(){return this.id++}};function Oe(e){var t,n=null;return"getRootNode"in e&&(null==(t=ve.getRootNode(e))?void 0:t.nodeType)===Node.DOCUMENT_FRAGMENT_NODE&&ve.host(ve.getRootNode(e))&&(n=ve.host(ve.getRootNode(e))),n}function Pe(e){var t=e.ownerDocument;if(!t)return!1;var n=function(e){for(var t,n=e;t=Oe(n);)n=t;return n}(e);return ve.contains(t,n)}function Le(e){var t=e.ownerDocument;return!!t&&(ve.contains(t,e)||Pe(e))}var De=(e=>(e[e.DomContentLoaded=0]="DomContentLoaded",e[e.Load=1]="Load",e[e.FullSnapshot=2]="FullSnapshot",e[e.IncrementalSnapshot=3]="IncrementalSnapshot",e[e.Meta=4]="Meta",e[e.Custom=5]="Custom",e[e.Plugin=6]="Plugin",e))(De||{}),Be=(e=>(e[e.Mutation=0]="Mutation",e[e.MouseMove=1]="MouseMove",e[e.MouseInteraction=2]="MouseInteraction",e[e.Scroll=3]="Scroll",e[e.ViewportResize=4]="ViewportResize",e[e.Input=5]="Input",e[e.TouchMove=6]="TouchMove",e[e.MediaInteraction=7]="MediaInteraction",e[e.StyleSheetRule=8]="StyleSheetRule",e[e.CanvasMutation=9]="CanvasMutation",e[e.Font=10]="Font",e[e.Log=11]="Log",e[e.Drag=12]="Drag",e[e.StyleDeclaration=13]="StyleDeclaration",e[e.Selection=14]="Selection",e[e.AdoptedStyleSheet=15]="AdoptedStyleSheet",e[e.CustomElement=16]="CustomElement",e))(Be||{}),He=(e=>(e[e.MouseUp=0]="MouseUp",e[e.MouseDown=1]="MouseDown",e[e.Click=2]="Click",e[e.ContextMenu=3]="ContextMenu",e[e.DblClick=4]="DblClick",e[e.Focus=5]="Focus",e[e.Blur=6]="Blur",e[e.TouchStart=7]="TouchStart",e[e.TouchMove_Departed=8]="TouchMove_Departed",e[e.TouchEnd=9]="TouchEnd",e[e.TouchCancel=10]="TouchCancel",e))(He||{}),qe=(e=>(e[e.Mouse=0]="Mouse",e[e.Pen=1]="Pen",e[e.Touch=2]="Touch",e))(qe||{}),$e=(e=>(e[e["2D"]=0]="2D",e[e.WebGL=1]="WebGL",e[e.WebGL2=2]="WebGL2",e))($e||{}),We=(e=>(e[e.Play=0]="Play",e[e.Pause=1]="Pause",e[e.Seeked=2]="Seeked",e[e.VolumeChange=3]="VolumeChange",e[e.RateChange=4]="RateChange",e))(We||{});function Ve(e){return"__ln"in e}class Ze{constructor(){c(this,"length",0),c(this,"head",null),c(this,"tail",null)}get(e){if(e>=this.length)throw new Error("Position outside of list range");for(var t=this.head,n=0;n<e;n++)t=(null==t?void 0:t.next)||null;return t}addNode(e){var t={value:e,previous:null,next:null};if(e.__ln=t,e.previousSibling&&Ve(e.previousSibling)){var n=e.previousSibling.__ln.next;t.next=n,t.previous=e.previousSibling.__ln,e.previousSibling.__ln.next=t,n&&(n.previous=t)}else if(e.nextSibling&&Ve(e.nextSibling)&&e.nextSibling.__ln.previous){var r=e.nextSibling.__ln.previous;t.previous=r,t.next=e.nextSibling.__ln,e.nextSibling.__ln.previous=t,r&&(r.next=t)}else this.head&&(this.head.previous=t),t.next=this.head,this.head=t;null===t.next&&(this.tail=t),this.length++}removeNode(e){var t=e.__ln;this.head&&(t.previous?(t.previous.next=t.next,t.next?t.next.previous=t.previous:this.tail=t.previous):(this.head=t.next,this.head?this.head.previous=null:this.tail=null),e.__ln&&delete e.__ln,this.length--)}}var Ge,Ue=(e,t)=>"".concat(e,"@").concat(t);class je{constructor(){c(this,"frozen",!1),c(this,"locked",!1),c(this,"texts",[]),c(this,"attributes",[]),c(this,"attributeMap",new WeakMap),c(this,"removes",[]),c(this,"mapRemoves",[]),c(this,"movedMap",{}),c(this,"addedSet",new Set),c(this,"movedSet",new Set),c(this,"droppedSet",new Set),c(this,"mutationCb"),c(this,"blockClass"),c(this,"blockSelector"),c(this,"maskTextClass"),c(this,"maskTextSelector"),c(this,"inlineStylesheet"),c(this,"maskInputOptions"),c(this,"maskTextFn"),c(this,"maskInputFn"),c(this,"keepIframeSrcFn"),c(this,"recordCanvas"),c(this,"inlineImages"),c(this,"slimDOMOptions"),c(this,"dataURLOptions"),c(this,"doc"),c(this,"mirror"),c(this,"iframeManager"),c(this,"stylesheetManager"),c(this,"shadowDomManager"),c(this,"canvasManager"),c(this,"processedNodeManager"),c(this,"unattachedDoc"),c(this,"processMutations",(e=>{e.forEach(this.processMutation),this.emit()})),c(this,"emit",(()=>{if(!this.frozen&&!this.locked){for(var e=[],t=new Set,n=new Ze,r=e=>{for(var t=e,n=V;n===V;)n=(t=t&&t.nextSibling)&&this.mirror.getId(t);return n},i=i=>{var o=ve.parentNode(i);if(o&&Le(i)&&"TEXTAREA"!==o.tagName){var s=C(o)?this.mirror.getId(Oe(i)):this.mirror.getId(o),a=r(i);if(-1===s||-1===a)return n.addNode(i);var l=re(i,{doc:this.doc,mirror:this.mirror,blockClass:this.blockClass,blockSelector:this.blockSelector,maskTextClass:this.maskTextClass,maskTextSelector:this.maskTextSelector,skipChild:!0,newlyAddedElement:!0,inlineStylesheet:this.inlineStylesheet,maskInputOptions:this.maskInputOptions,maskTextFn:this.maskTextFn,maskInputFn:this.maskInputFn,slimDOMOptions:this.slimDOMOptions,dataURLOptions:this.dataURLOptions,recordCanvas:this.recordCanvas,inlineImages:this.inlineImages,onSerialize:e=>{Re(e,this.mirror)&&this.iframeManager.addIframe(e),Ae(e,this.mirror)&&this.stylesheetManager.trackLinkElement(e),Ne(i)&&this.shadowDomManager.addShadowRoot(ve.shadowRoot(i),this.doc)},onIframeLoad:(e,t)=>{this.iframeManager.attachIframe(e,t),this.shadowDomManager.observeAttachShadow(e)},onStylesheetLoad:(e,t)=>{this.stylesheetManager.attachLinkElement(e,t)}});l&&(e.push({parentId:s,nextId:a,node:l}),t.add(l.id))}};this.mapRemoves.length;)this.mirror.removeNodeFromMap(this.mapRemoves.shift());for(var o of this.movedSet)Ye(this.removes,o,this.mirror)&&!this.movedSet.has(ve.parentNode(o))||i(o);for(var s of this.addedSet)Xe(this.droppedSet,s)||Ye(this.removes,s,this.mirror)?Xe(this.movedSet,s)?i(s):this.droppedSet.add(s):i(s);for(var a=null;n.length;){var l=null;if(a){var c=this.mirror.getId(ve.parentNode(a.value)),u=r(a.value);-1!==c&&-1!==u&&(l=a)}if(!l)for(var d=n.tail;d;){var h=d;if(d=d.previous,h){var p=this.mirror.getId(ve.parentNode(h.value));if(-1===r(h.value))continue;if(-1!==p){l=h;break}var v=h.value,g=ve.parentNode(v);if(g&&g.nodeType===Node.DOCUMENT_FRAGMENT_NODE){var f=ve.host(g);if(-1!==this.mirror.getId(f)){l=h;break}}}}if(!l){for(;n.head;)n.removeNode(n.head.value);break}a=l.previous,n.removeNode(l.value),i(l.value)}var m={texts:this.texts.map((e=>{var t=e.node,n=ve.parentNode(t);return n&&"TEXTAREA"===n.tagName&&this.genTextAreaValueMutation(n),{id:this.mirror.getId(t),value:e.value}})).filter((e=>!t.has(e.id))).filter((e=>this.mirror.has(e.id))),attributes:this.attributes.map((e=>{var{attributes:t}=e;if("string"==typeof t.style){var n=JSON.stringify(e.styleDiff),r=JSON.stringify(e._unchangedStyles);n.length<t.style.length&&(n+r).split("var(").length===t.style.split("var(").length&&(t.style=e.styleDiff)}return{id:this.mirror.getId(e.node),attributes:t}})).filter((e=>!t.has(e.id))).filter((e=>this.mirror.has(e.id))),removes:this.removes,adds:e};(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))}})),c(this,"genTextAreaValueMutation",(e=>{var t=this.attributeMap.get(e);t||(t={node:e,attributes:{},styleDiff:{},_unchangedStyles:{}},this.attributes.push(t),this.attributeMap.set(e,t)),t.attributes.value=Array.from(ve.childNodes(e),(e=>ve.textContent(e)||"")).join("")})),c(this,"processMutation",(e=>{if(!xe(e.target,this.mirror,this.slimDOMOptions))switch(e.type){case"characterData":var t=ve.textContent(e.target);Ee(e.target,this.blockClass,this.blockSelector,!1)||t===e.oldValue||this.texts.push({value:ee(e.target,this.maskTextClass,this.maskTextSelector,!0)&&t?this.maskTextFn?this.maskTextFn(t,ke(e.target)):t.replace(/[\S]/g,"*"):t,node:e.target});break;case"attributes":var n=e.target,r=e.attributeName,i=e.target.getAttribute(r);if("value"===r){var o=N(n);i=M({element:n,maskInputOptions:this.maskInputOptions,tagName:n.tagName,type:o,value:i,maskInputFn:this.maskInputFn})}if(Ee(e.target,this.blockClass,this.blockSelector,!1)||i===e.oldValue)return;var s=this.attributeMap.get(e.target);if("IFRAME"===n.tagName&&"src"===r&&!this.keepIframeSrcFn(i)){if(n.contentDocument)return;r="rr_src"}if(s||(s={node:e.target,attributes:{},styleDiff:{},_unchangedStyles:{}},this.attributes.push(s),this.attributeMap.set(e.target,s)),"type"===r&&"INPUT"===n.tagName&&"password"===(e.oldValue||"").toLowerCase()&&n.setAttribute("data-rr-is-password","true"),!K(n.tagName,r))if(s.attributes[r]=J(this.doc,R(n.tagName),R(r),i),"style"===r){if(!this.unattachedDoc)try{this.unattachedDoc=document.implementation.createHTMLDocument()}catch(e){this.unattachedDoc=this.doc}var a=this.unattachedDoc.createElement("span");for(var l of(e.oldValue&&a.setAttribute("style",e.oldValue),Array.from(n.style))){var c=n.style.getPropertyValue(l),u=n.style.getPropertyPriority(l);c!==a.style.getPropertyValue(l)||u!==a.style.getPropertyPriority(l)?s.styleDiff[l]=""===u?c:[c,u]:s._unchangedStyles[l]=[c,u]}for(var d of Array.from(a.style))""===n.style.getPropertyValue(d)&&(s.styleDiff[d]=!1)}else"open"===r&&"DIALOG"===n.tagName&&(n.matches("dialog:modal")?s.attributes.rr_open_mode="modal":s.attributes.rr_open_mode="non-modal");break;case"childList":if(Ee(e.target,this.blockClass,this.blockSelector,!0))return;if("TEXTAREA"===e.target.tagName)return void this.genTextAreaValueMutation(e.target);e.addedNodes.forEach((t=>this.genAdds(t,e.target))),e.removedNodes.forEach((t=>{var n=this.mirror.getId(t),r=C(e.target)?this.mirror.getId(ve.host(e.target)):this.mirror.getId(e.target);Ee(e.target,this.blockClass,this.blockSelector,!1)||xe(t,this.mirror,this.slimDOMOptions)||!function(e,t){return-1!==t.getId(e)}(t,this.mirror)||(this.addedSet.has(t)?(ze(this.addedSet,t),this.droppedSet.add(t)):this.addedSet.has(e.target)&&-1===n||Te(e.target,this.mirror)||(this.movedSet.has(t)&&this.movedMap[Ue(n,r)]?ze(this.movedSet,t):this.removes.push({parentId:r,id:n,isShadow:!(!C(e.target)||!I(e.target))||void 0})),this.mapRemoves.push(t))}))}})),c(this,"genAdds",((e,t)=>{if(!this.processedNodeManager.inOtherBuffer(e,this)&&!this.addedSet.has(e)&&!this.movedSet.has(e)){if(this.mirror.hasNode(e)){if(xe(e,this.mirror,this.slimDOMOptions))return;this.movedSet.add(e);var n=null;t&&this.mirror.hasNode(t)&&(n=this.mirror.getId(t)),n&&-1!==n&&(this.movedMap[Ue(this.mirror.getId(e),n)]=!0)}else this.addedSet.add(e),this.droppedSet.delete(e);Ee(e,this.blockClass,this.blockSelector,!1)||(ve.childNodes(e).forEach((e=>this.genAdds(e))),Ne(e)&&ve.childNodes(ve.shadowRoot(e)).forEach((t=>{this.processedNodeManager.add(t,this),this.genAdds(t,e)})))}}))}init(e){["mutationCb","blockClass","blockSelector","maskTextClass","maskTextSelector","inlineStylesheet","maskInputOptions","maskTextFn","maskInputFn","keepIframeSrcFn","recordCanvas","inlineImages","slimDOMOptions","dataURLOptions","doc","mirror","iframeManager","stylesheetManager","shadowDomManager","canvasManager","processedNodeManager"].forEach((t=>{this[t]=e[t]}))}freeze(){this.frozen=!0,this.canvasManager.freeze()}unfreeze(){this.frozen=!1,this.canvasManager.unfreeze(),this.emit()}isFrozen(){return this.frozen}lock(){this.locked=!0,this.canvasManager.lock()}unlock(){this.locked=!1,this.canvasManager.unlock(),this.emit()}reset(){this.shadowDomManager.reset(),this.canvasManager.reset()}}function ze(e,t){e.delete(t),ve.childNodes(t).forEach((t=>ze(e,t)))}function Ye(e,t,n){return 0!==e.length&&function(e,t,n){var r=ve.parentNode(t),i=function(){var t=n.getId(r);if(e.some((e=>e.id===t)))return{v:!0};r=ve.parentNode(r)};for(;r;){var o=i();if("object"==typeof o)return o.v}return!1}(e,t,n)}function Xe(e,t){return 0!==e.size&&Je(e,t)}function Je(e,t){var n=ve.parentNode(t);return!!n&&(!!e.has(n)||Je(e,n))}var Ke=e=>{if(!Ge)return e;return function(){try{return e(...arguments)}catch(e){if(Ge&&!0===Ge(e))return;throw e}}},Qe=[];function et(e){try{if("composedPath"in e){var t=e.composedPath();if(t.length)return t[0]}else if("path"in e&&e.path.length)return e.path[0]}catch(e){}return e&&e.target}function tt(e,t){var n=new je;Qe.push(n),n.init(e);var r=new(pe())(Ke(n.processMutations.bind(n)));return r.observe(t,{attributes:!0,attributeOldValue:!0,characterData:!0,characterDataOldValue:!0,childList:!0,subtree:!0}),r}function nt(e){var{mouseInteractionCb:n,doc:r,mirror:i,blockClass:o,blockSelector:s,sampling:a}=e;if(!1===a.mouseInteraction)return()=>{};var l=!0===a.mouseInteraction||void 0===a.mouseInteraction?{}:a.mouseInteraction,c=[],u=null;return Object.keys(He).filter((e=>Number.isNaN(Number(e))&&!e.endsWith("_Departed")&&!1!==l[e])).forEach((e=>{var a=R(e),l=(e=>r=>{var a=et(r);if(!Ee(a,o,s,!0)){var l=null,c=e;if("pointerType"in r){switch(r.pointerType){case"mouse":l=qe.Mouse;break;case"touch":l=qe.Touch;break;case"pen":l=qe.Pen}l===qe.Touch?He[e]===He.MouseDown?c="TouchStart":He[e]===He.MouseUp&&(c="TouchEnd"):qe.Pen}else Me(r)&&(l=qe.Touch);null!==l?(u=l,(c.startsWith("Touch")&&l===qe.Touch||c.startsWith("Mouse")&&l===qe.Mouse)&&(l=null)):He[e]===He.Click&&(l=u,u=null);var d=Me(r)?r.changedTouches[0]:r;if(d){var h=i.getId(a),{clientX:p,clientY:v}=d;Ke(n)(t({type:He[c],id:h,x:p,y:v},null!==l&&{pointerType:l}))}}})(e);if(window.PointerEvent)switch(He[e]){case He.MouseDown:case He.MouseUp:a=a.replace("mouse","pointer");break;case He.TouchStart:case He.TouchEnd:return}c.push(ge(a,l,r))})),Ke((()=>{c.forEach((e=>e()))}))}function rt(e){var{scrollCb:t,doc:n,mirror:r,blockClass:i,blockSelector:o,sampling:s}=e;return ge("scroll",Ke(_e(Ke((e=>{var s=et(e);if(s&&!Ee(s,i,o,!0)){var a=r.getId(s);if(s===n&&n.defaultView){var l=Se(n.defaultView);t({id:a,x:l.left,y:l.top})}else t({id:a,x:s.scrollLeft,y:s.scrollTop})}})),s.scroll||100)),n)}var it=["INPUT","TEXTAREA","SELECT"],ot=new WeakMap;function st(e){return function(e,t){if(ut("CSSGroupingRule")&&e.parentRule instanceof CSSGroupingRule||ut("CSSMediaRule")&&e.parentRule instanceof CSSMediaRule||ut("CSSSupportsRule")&&e.parentRule instanceof CSSSupportsRule||ut("CSSConditionRule")&&e.parentRule instanceof CSSConditionRule){var n=Array.from(e.parentRule.cssRules).indexOf(e);t.unshift(n)}else if(e.parentStyleSheet){var r=Array.from(e.parentStyleSheet.cssRules).indexOf(e);t.unshift(r)}return t}(e,[])}function at(e,t,n){var r,i;return e?(e.ownerNode?r=t.getId(e.ownerNode):i=n.getId(e),{styleId:i,id:r}):{}}function lt(e,t){var n,r,i,{mirror:o,stylesheetManager:s}=e,a=null;a="#document"===t.nodeName?o.getId(t):o.getId(ve.host(t));var l="#document"===t.nodeName?null==(n=t.defaultView)?void 0:n.Document:null==(i=null==(r=t.ownerDocument)?void 0:r.defaultView)?void 0:i.ShadowRoot,c=(null==l?void 0:l.prototype)?Object.getOwnPropertyDescriptor(null==l?void 0:l.prototype,"adoptedStyleSheets"):void 0;return null!==a&&-1!==a&&l&&c?(Object.defineProperty(t,"adoptedStyleSheets",{configurable:c.configurable,enumerable:c.enumerable,get(){var e;return null==(e=c.get)?void 0:e.call(this)},set(e){var t,n=null==(t=c.set)?void 0:t.call(this,e);if(null!==a&&-1!==a)try{s.adoptStyleSheets(e,a)}catch(e){}return n}}),Ke((()=>{Object.defineProperty(t,"adoptedStyleSheets",{configurable:c.configurable,enumerable:c.enumerable,get:c.get,set:c.set})}))):()=>{}}function ct(e){var n,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=e.doc.defaultView;if(!i)return()=>{};!function(e,t){var{mutationCb:n,mousemoveCb:r,mouseInteractionCb:i,scrollCb:o,viewportResizeCb:s,inputCb:a,mediaInteractionCb:l,styleSheetRuleCb:c,styleDeclarationCb:u,canvasMutationCb:d,fontCb:h,selectionCb:p,customElementCb:v}=e;e.mutationCb=function(){t.mutation&&t.mutation(...arguments),n(...arguments)},e.mousemoveCb=function(){t.mousemove&&t.mousemove(...arguments),r(...arguments)},e.mouseInteractionCb=function(){t.mouseInteraction&&t.mouseInteraction(...arguments),i(...arguments)},e.scrollCb=function(){t.scroll&&t.scroll(...arguments),o(...arguments)},e.viewportResizeCb=function(){t.viewportResize&&t.viewportResize(...arguments),s(...arguments)},e.inputCb=function(){t.input&&t.input(...arguments),a(...arguments)},e.mediaInteractionCb=function(){t.mediaInteaction&&t.mediaInteaction(...arguments),l(...arguments)},e.styleSheetRuleCb=function(){t.styleSheetRule&&t.styleSheetRule(...arguments),c(...arguments)},e.styleDeclarationCb=function(){t.styleDeclaration&&t.styleDeclaration(...arguments),u(...arguments)},e.canvasMutationCb=function(){t.canvasMutation&&t.canvasMutation(...arguments),d(...arguments)},e.fontCb=function(){t.font&&t.font(...arguments),h(...arguments)},e.selectionCb=function(){t.selection&&t.selection(...arguments),p(...arguments)},e.customElementCb=function(){t.customElement&&t.customElement(...arguments),v(...arguments)}}(e,r),e.recordDOM&&(n=tt(e,e.doc));var o=function(e){var{mousemoveCb:t,sampling:n,doc:r,mirror:i}=e;if(!1===n.mousemove)return()=>{};var o,s="number"==typeof n.mousemove?n.mousemove:50,a="number"==typeof n.mousemoveCallback?n.mousemoveCallback:500,l=[],c=_e(Ke((e=>{var n=Date.now()-o;t(l.map((e=>(e.timeOffset-=n,e))),e),l=[],o=null})),a),u=Ke(_e(Ke((e=>{var t=et(e),{clientX:n,clientY:r}=Me(e)?e.changedTouches[0]:e;o||(o=we()),l.push({x:n,y:r,id:i.getId(t),timeOffset:we()-o}),c("undefined"!=typeof DragEvent&&e instanceof DragEvent?Be.Drag:e instanceof MouseEvent?Be.MouseMove:Be.TouchMove)})),s,{trailing:!1})),d=[ge("mousemove",u,r),ge("touchmove",u,r),ge("drag",u,r)];return Ke((()=>{d.forEach((e=>e()))}))}(e),s=nt(e),a=rt(e),l=function(e,t){var{viewportResizeCb:n}=e,{win:r}=t,i=-1,o=-1;return ge("resize",Ke(_e(Ke((()=>{var e=Ce(),t=Ie();i===e&&o===t||(n({width:Number(t),height:Number(e)}),i=e,o=t)})),200)),r)}(e,{win:i}),c=function(e){var{inputCb:n,doc:r,mirror:i,blockClass:o,blockSelector:s,ignoreClass:a,ignoreSelector:l,maskInputOptions:c,maskInputFn:u,sampling:d,userTriggeredOnInput:h}=e;function p(e){var t=et(e),n=e.isTrusted,i=t&&t.tagName;if(t&&"OPTION"===i&&(t=ve.parentElement(t)),t&&i&&!(it.indexOf(i)<0)&&!Ee(t,o,s,!0)&&!(t.classList.contains(a)||l&&t.matches(l))){var d=t.value,p=!1,g=N(t)||"";"radio"===g||"checkbox"===g?p=t.checked:(c[i.toLowerCase()]||c[g])&&(d=M({element:t,maskInputOptions:c,tagName:i,type:g,value:d,maskInputFn:u})),v(t,h?{text:d,isChecked:p,userTriggered:n}:{text:d,isChecked:p});var f=t.name;"radio"===g&&f&&p&&r.querySelectorAll('input[type="radio"][name="'.concat(f,'"]')).forEach((e=>{if(e!==t){var n=e.value;v(e,h?{text:n,isChecked:!p,userTriggered:!1}:{text:n,isChecked:!p})}}))}}function v(e,r){var o=ot.get(e);if(!o||o.text!==r.text||o.isChecked!==r.isChecked){ot.set(e,r);var s=i.getId(e);Ke(n)(t(t({},r),{},{id:s}))}}var g=("last"===d.input?["change"]:["input","change"]).map((e=>ge(e,Ke(p),r))),f=r.defaultView;if(!f)return()=>{g.forEach((e=>e()))};var m=f.Object.getOwnPropertyDescriptor(f.HTMLInputElement.prototype,"value"),_=[[f.HTMLInputElement.prototype,"value"],[f.HTMLInputElement.prototype,"checked"],[f.HTMLSelectElement.prototype,"value"],[f.HTMLTextAreaElement.prototype,"value"],[f.HTMLSelectElement.prototype,"selectedIndex"],[f.HTMLOptionElement.prototype,"selected"]];return m&&m.set&&g.push(..._.map((e=>ye(e[0],e[1],{set(){Ke(p)({target:this,isTrusted:!1})}},!1,f)))),Ke((()=>{g.forEach((e=>e()))}))}(e),u=function(e){var{mediaInteractionCb:t,blockClass:n,blockSelector:r,mirror:i,sampling:o,doc:s}=e,a=Ke((e=>_e(Ke((o=>{var s=et(o);if(s&&!Ee(s,n,r,!0)){var{currentTime:a,volume:l,muted:c,playbackRate:u,loop:d}=s;t({type:e,id:i.getId(s),currentTime:a,volume:l,muted:c,playbackRate:u,loop:d})}})),o.media||500))),l=[ge("play",a(We.Play),s),ge("pause",a(We.Pause),s),ge("seeked",a(We.Seeked),s),ge("volumechange",a(We.VolumeChange),s),ge("ratechange",a(We.RateChange),s)];return Ke((()=>{l.forEach((e=>e()))}))}(e),d=()=>{},h=()=>{},p=()=>{},v=()=>{};e.recordDOM&&(d=function(e,t){var{styleSheetRuleCb:n,mirror:r,stylesheetManager:i}=e,{win:o}=t;if(!o.CSSStyleSheet||!o.CSSStyleSheet.prototype)return()=>{};var s=o.CSSStyleSheet.prototype.insertRule;o.CSSStyleSheet.prototype.insertRule=new Proxy(s,{apply:Ke(((e,t,o)=>{var[s,a]=o,{id:l,styleId:c}=at(t,r,i.styleMirror);return(l&&-1!==l||c&&-1!==c)&&n({id:l,styleId:c,adds:[{rule:s,index:a}]}),e.apply(t,o)}))}),o.CSSStyleSheet.prototype.addRule=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:this.cssRules.length,r="".concat(e," { ").concat(t," }");return o.CSSStyleSheet.prototype.insertRule.apply(this,[r,n])};var a,l,c=o.CSSStyleSheet.prototype.deleteRule;o.CSSStyleSheet.prototype.deleteRule=new Proxy(c,{apply:Ke(((e,t,o)=>{var[s]=o,{id:a,styleId:l}=at(t,r,i.styleMirror);return(a&&-1!==a||l&&-1!==l)&&n({id:a,styleId:l,removes:[{index:s}]}),e.apply(t,o)}))}),o.CSSStyleSheet.prototype.removeRule=function(e){return o.CSSStyleSheet.prototype.deleteRule.apply(this,[e])},o.CSSStyleSheet.prototype.replace&&(a=o.CSSStyleSheet.prototype.replace,o.CSSStyleSheet.prototype.replace=new Proxy(a,{apply:Ke(((e,t,o)=>{var[s]=o,{id:a,styleId:l}=at(t,r,i.styleMirror);return(a&&-1!==a||l&&-1!==l)&&n({id:a,styleId:l,replace:s}),e.apply(t,o)}))})),o.CSSStyleSheet.prototype.replaceSync&&(l=o.CSSStyleSheet.prototype.replaceSync,o.CSSStyleSheet.prototype.replaceSync=new Proxy(l,{apply:Ke(((e,t,o)=>{var[s]=o,{id:a,styleId:l}=at(t,r,i.styleMirror);return(a&&-1!==a||l&&-1!==l)&&n({id:a,styleId:l,replaceSync:s}),e.apply(t,o)}))}));var u={};dt("CSSGroupingRule")?u.CSSGroupingRule=o.CSSGroupingRule:(dt("CSSMediaRule")&&(u.CSSMediaRule=o.CSSMediaRule),dt("CSSConditionRule")&&(u.CSSConditionRule=o.CSSConditionRule),dt("CSSSupportsRule")&&(u.CSSSupportsRule=o.CSSSupportsRule));var d={};return Object.entries(u).forEach((e=>{var[t,o]=e;d[t]={insertRule:o.prototype.insertRule,deleteRule:o.prototype.deleteRule},o.prototype.insertRule=new Proxy(d[t].insertRule,{apply:Ke(((e,t,o)=>{var[s,a]=o,{id:l,styleId:c}=at(t.parentStyleSheet,r,i.styleMirror);return(l&&-1!==l||c&&-1!==c)&&n({id:l,styleId:c,adds:[{rule:s,index:[...st(t),a||0]}]}),e.apply(t,o)}))}),o.prototype.deleteRule=new Proxy(d[t].deleteRule,{apply:Ke(((e,t,o)=>{var[s]=o,{id:a,styleId:l}=at(t.parentStyleSheet,r,i.styleMirror);return(a&&-1!==a||l&&-1!==l)&&n({id:a,styleId:l,removes:[{index:[...st(t),s]}]}),e.apply(t,o)}))})})),Ke((()=>{o.CSSStyleSheet.prototype.insertRule=s,o.CSSStyleSheet.prototype.deleteRule=c,a&&(o.CSSStyleSheet.prototype.replace=a),l&&(o.CSSStyleSheet.prototype.replaceSync=l),Object.entries(u).forEach((e=>{var[t,n]=e;n.prototype.insertRule=d[t].insertRule,n.prototype.deleteRule=d[t].deleteRule}))}))}(e,{win:i}),h=lt(e,e.doc),p=function(e,t){var{styleDeclarationCb:n,mirror:r,ignoreCSSAttributes:i,stylesheetManager:o}=e,{win:s}=t,a=s.CSSStyleDeclaration.prototype.setProperty;s.CSSStyleDeclaration.prototype.setProperty=new Proxy(a,{apply:Ke(((e,t,s)=>{var l,[c,u,d]=s;if(i.has(c))return a.apply(t,[c,u,d]);var{id:h,styleId:p}=at(null==(l=t.parentRule)?void 0:l.parentStyleSheet,r,o.styleMirror);return(h&&-1!==h||p&&-1!==p)&&n({id:h,styleId:p,set:{property:c,value:u,priority:d},index:st(t.parentRule)}),e.apply(t,s)}))});var l=s.CSSStyleDeclaration.prototype.removeProperty;return s.CSSStyleDeclaration.prototype.removeProperty=new Proxy(l,{apply:Ke(((e,t,s)=>{var a,[c]=s;if(i.has(c))return l.apply(t,[c]);var{id:u,styleId:d}=at(null==(a=t.parentRule)?void 0:a.parentStyleSheet,r,o.styleMirror);return(u&&-1!==u||d&&-1!==d)&&n({id:u,styleId:d,remove:{property:c},index:st(t.parentRule)}),e.apply(t,s)}))}),Ke((()=>{s.CSSStyleDeclaration.prototype.setProperty=a,s.CSSStyleDeclaration.prototype.removeProperty=l}))}(e,{win:i}),e.collectFonts&&(v=function(e){var{fontCb:t,doc:n}=e,r=n.defaultView;if(!r)return()=>{};var i=[],o=new WeakMap,s=r.FontFace;r.FontFace=function(e,t,n){var r=new s(e,t,n);return o.set(r,{family:e,buffer:"string"!=typeof t,descriptors:n,fontSource:"string"==typeof t?t:JSON.stringify(Array.from(new Uint8Array(t)))}),r};var a=be(n.fonts,"add",(function(e){return function(n){return setTimeout(Ke((()=>{var e=o.get(n);e&&(t(e),o.delete(n))})),0),e.apply(this,[n])}}));return i.push((()=>{r.FontFace=s})),i.push(a),Ke((()=>{i.forEach((e=>e()))}))}(e)));var g=function(e){var{doc:t,mirror:n,blockClass:r,blockSelector:i,selectionCb:o}=e,s=!0,a=Ke((()=>{var e=t.getSelection();if(!(!e||s&&(null==e?void 0:e.isCollapsed))){s=e.isCollapsed||!1;for(var a=[],l=e.rangeCount||0,c=0;c<l;c++){var u=e.getRangeAt(c),{startContainer:d,startOffset:h,endContainer:p,endOffset:v}=u;Ee(d,r,i,!0)||Ee(p,r,i,!0)||a.push({start:n.getId(d),startOffset:h,end:n.getId(p),endOffset:v})}o({ranges:a})}}));return a(),ge("selectionchange",a)}(e),f=function(e){var{doc:t,customElementCb:n}=e,r=t.defaultView;if(!r||!r.customElements)return()=>{};var i=be(r.customElements,"define",(function(e){return function(t,r,i){try{n({define:{name:t}})}catch(e){console.warn("Custom element callback failed for ".concat(t))}return e.apply(this,[t,r,i])}}));return i}(e),m=[];for(var _ of e.plugins)m.push(_.observer(_.callback,i,_.options));return Ke((()=>{Qe.forEach((e=>e.reset())),null==n||n.disconnect(),o(),s(),a(),l(),c(),u(),d(),h(),p(),v(),g(),f(),m.forEach((e=>e()))}))}function ut(e){return void 0!==window[e]}function dt(e){return Boolean(void 0!==window[e]&&window[e].prototype&&"insertRule"in window[e].prototype&&"deleteRule"in window[e].prototype)}class ht{constructor(e){c(this,"iframeIdToRemoteIdMap",new WeakMap),c(this,"iframeRemoteIdToIdMap",new WeakMap),this.generateIdFn=e}getId(e,t,n,r){var i=n||this.getIdToRemoteIdMap(e),o=r||this.getRemoteIdToIdMap(e),s=i.get(t);return s||(s=this.generateIdFn(),i.set(t,s),o.set(s,t)),s}getIds(e,t){var n=this.getIdToRemoteIdMap(e),r=this.getRemoteIdToIdMap(e);return t.map((t=>this.getId(e,t,n,r)))}getRemoteId(e,t,n){var r=n||this.getRemoteIdToIdMap(e);if("number"!=typeof t)return t;var i=r.get(t);return i||-1}getRemoteIds(e,t){var n=this.getRemoteIdToIdMap(e);return t.map((t=>this.getRemoteId(e,t,n)))}reset(e){if(!e)return this.iframeIdToRemoteIdMap=new WeakMap,void(this.iframeRemoteIdToIdMap=new WeakMap);this.iframeIdToRemoteIdMap.delete(e),this.iframeRemoteIdToIdMap.delete(e)}getIdToRemoteIdMap(e){var t=this.iframeIdToRemoteIdMap.get(e);return t||(t=new Map,this.iframeIdToRemoteIdMap.set(e,t)),t}getRemoteIdToIdMap(e){var t=this.iframeRemoteIdToIdMap.get(e);return t||(t=new Map,this.iframeRemoteIdToIdMap.set(e,t)),t}}class pt{constructor(e){c(this,"iframes",new WeakMap),c(this,"crossOriginIframeMap",new WeakMap),c(this,"crossOriginIframeMirror",new ht(Z)),c(this,"crossOriginIframeStyleMirror"),c(this,"crossOriginIframeRootIdMap",new WeakMap),c(this,"mirror"),c(this,"mutationCb"),c(this,"wrappedEmit"),c(this,"loadListener"),c(this,"stylesheetManager"),c(this,"recordCrossOriginIframes"),this.mutationCb=e.mutationCb,this.wrappedEmit=e.wrappedEmit,this.stylesheetManager=e.stylesheetManager,this.recordCrossOriginIframes=e.recordCrossOriginIframes,this.crossOriginIframeStyleMirror=new ht(this.stylesheetManager.styleMirror.generateId.bind(this.stylesheetManager.styleMirror)),this.mirror=e.mirror,this.recordCrossOriginIframes&&window.addEventListener("message",this.handleMessage.bind(this))}addIframe(e){this.iframes.set(e,!0),e.contentWindow&&this.crossOriginIframeMap.set(e.contentWindow,e)}addLoadListener(e){this.loadListener=e}attachIframe(e,t){var n,r;this.mutationCb({adds:[{parentId:this.mirror.getId(e),nextId:null,node:t}],removes:[],texts:[],attributes:[],isAttachIframe:!0}),this.recordCrossOriginIframes&&(null==(n=e.contentWindow)||n.addEventListener("message",this.handleMessage.bind(this))),null==(r=this.loadListener)||r.call(this,e),e.contentDocument&&e.contentDocument.adoptedStyleSheets&&e.contentDocument.adoptedStyleSheets.length>0&&this.stylesheetManager.adoptStyleSheets(e.contentDocument.adoptedStyleSheets,this.mirror.getId(e.contentDocument))}handleMessage(e){var t=e;if("rrweb"===t.data.type&&t.origin===t.data.origin&&e.source){var n=this.crossOriginIframeMap.get(e.source);if(n){var r=this.transformCrossOriginEvent(n,t.data.event);r&&this.wrappedEmit(r,t.data.isCheckout)}}}transformCrossOriginEvent(e,t){var n;switch(t.type){case De.FullSnapshot:this.crossOriginIframeMirror.reset(e),this.crossOriginIframeStyleMirror.reset(e),this.replaceIdOnNode(t.data.node,e);var r=t.data.node.id;return this.crossOriginIframeRootIdMap.set(e,r),this.patchRootIdOnNode(t.data.node,r),{timestamp:t.timestamp,type:De.IncrementalSnapshot,data:{source:Be.Mutation,adds:[{parentId:this.mirror.getId(e),nextId:null,node:t.data.node}],removes:[],texts:[],attributes:[],isAttachIframe:!0}};case De.Meta:case De.Load:case De.DomContentLoaded:return!1;case De.Plugin:return t;case De.Custom:return this.replaceIds(t.data.payload,e,["id","parentId","previousId","nextId"]),t;case De.IncrementalSnapshot:switch(t.data.source){case Be.Mutation:return t.data.adds.forEach((t=>{this.replaceIds(t,e,["parentId","nextId","previousId"]),this.replaceIdOnNode(t.node,e);var n=this.crossOriginIframeRootIdMap.get(e);n&&this.patchRootIdOnNode(t.node,n)})),t.data.removes.forEach((t=>{this.replaceIds(t,e,["parentId","id"])})),t.data.attributes.forEach((t=>{this.replaceIds(t,e,["id"])})),t.data.texts.forEach((t=>{this.replaceIds(t,e,["id"])})),t;case Be.Drag:case Be.TouchMove:case Be.MouseMove:return t.data.positions.forEach((t=>{this.replaceIds(t,e,["id"])})),t;case Be.ViewportResize:return!1;case Be.MediaInteraction:case Be.MouseInteraction:case Be.Scroll:case Be.CanvasMutation:case Be.Input:return this.replaceIds(t.data,e,["id"]),t;case Be.StyleSheetRule:case Be.StyleDeclaration:return this.replaceIds(t.data,e,["id"]),this.replaceStyleIds(t.data,e,["styleId"]),t;case Be.Font:return t;case Be.Selection:return t.data.ranges.forEach((t=>{this.replaceIds(t,e,["start","end"])})),t;case Be.AdoptedStyleSheet:return this.replaceIds(t.data,e,["id"]),this.replaceStyleIds(t.data,e,["styleIds"]),null==(n=t.data.styles)||n.forEach((t=>{this.replaceStyleIds(t,e,["styleId"])})),t}}return!1}replace(e,t,n,r){for(var i of r)(Array.isArray(t[i])||"number"==typeof t[i])&&(Array.isArray(t[i])?t[i]=e.getIds(n,t[i]):t[i]=e.getId(n,t[i]));return t}replaceIds(e,t,n){return this.replace(this.crossOriginIframeMirror,e,t,n)}replaceStyleIds(e,t,n){return this.replace(this.crossOriginIframeStyleMirror,e,t,n)}replaceIdOnNode(e,t){this.replaceIds(e,t,["id","rootId"]),"childNodes"in e&&e.childNodes.forEach((e=>{this.replaceIdOnNode(e,t)}))}patchRootIdOnNode(e,t){e.type===h.Document||e.rootId||(e.rootId=t),"childNodes"in e&&e.childNodes.forEach((e=>{this.patchRootIdOnNode(e,t)}))}}class vt{constructor(e){c(this,"shadowDoms",new WeakSet),c(this,"mutationCb"),c(this,"scrollCb"),c(this,"bypassOptions"),c(this,"mirror"),c(this,"restoreHandlers",[]),this.mutationCb=e.mutationCb,this.scrollCb=e.scrollCb,this.bypassOptions=e.bypassOptions,this.mirror=e.mirror,this.init()}init(){this.reset(),this.patchAttachShadow(Element,document)}addShadowRoot(e,n){if(I(e)&&!this.shadowDoms.has(e)){this.shadowDoms.add(e);var r=tt(t(t({},this.bypassOptions),{},{doc:n,mutationCb:this.mutationCb,mirror:this.mirror,shadowDomManager:this}),e);this.restoreHandlers.push((()=>r.disconnect())),this.restoreHandlers.push(rt(t(t({},this.bypassOptions),{},{scrollCb:this.scrollCb,doc:e,mirror:this.mirror}))),setTimeout((()=>{e.adoptedStyleSheets&&e.adoptedStyleSheets.length>0&&this.bypassOptions.stylesheetManager.adoptStyleSheets(e.adoptedStyleSheets,this.mirror.getId(ve.host(e))),this.restoreHandlers.push(lt({mirror:this.mirror,stylesheetManager:this.bypassOptions.stylesheetManager},e))}),0)}}observeAttachShadow(e){e.contentWindow&&e.contentDocument&&this.patchAttachShadow(e.contentWindow.Element,e.contentDocument)}patchAttachShadow(e,t){var n=this;this.restoreHandlers.push(be(e.prototype,"attachShadow",(function(e){return function(r){var i=e.call(this,r),o=ve.shadowRoot(this);return o&&Le(this)&&n.addShadowRoot(o,t),i}})))}reset(){this.restoreHandlers.forEach((e=>{try{e()}catch(e){}})),this.restoreHandlers=[],this.shadowDoms=new WeakSet}}for(var gt="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",ft="undefined"==typeof Uint8Array?[]:new Uint8Array(256),mt=0;mt<64;mt++)ft[gt.charCodeAt(mt)]=mt;var _t=new Map;var yt=(e,t,n)=>{if(e&&(St(e,t)||"object"==typeof e)){var r=function(e,t){var n=_t.get(e);return n||(n=new Map,_t.set(e,n)),n.has(t)||n.set(t,[]),n.get(t)}(n,e.constructor.name),i=r.indexOf(e);return-1===i&&(i=r.length,r.push(e)),i}};function bt(e,t,n){if(e instanceof Array)return e.map((e=>bt(e,t,n)));if(null===e)return e;if(e instanceof Float32Array||e instanceof Float64Array||e instanceof Int32Array||e instanceof Uint32Array||e instanceof Uint8Array||e instanceof Uint16Array||e instanceof Int16Array||e instanceof Int8Array||e instanceof Uint8ClampedArray)return{rr_type:e.constructor.name,args:[Object.values(e)]};if(e instanceof ArrayBuffer)return{rr_type:e.constructor.name,base64:function(e){var t,n=new Uint8Array(e),r=n.length,i="";for(t=0;t<r;t+=3)i+=gt[n[t]>>2],i+=gt[(3&n[t])<<4|n[t+1]>>4],i+=gt[(15&n[t+1])<<2|n[t+2]>>6],i+=gt[63&n[t+2]];return r%3==2?i=i.substring(0,i.length-1)+"=":r%3==1&&(i=i.substring(0,i.length-2)+"=="),i}(e)};if(e instanceof DataView)return{rr_type:e.constructor.name,args:[bt(e.buffer,t,n),e.byteOffset,e.byteLength]};if(e instanceof HTMLImageElement){var r=e.constructor.name,{src:i}=e;return{rr_type:r,src:i}}if(e instanceof HTMLCanvasElement){return{rr_type:"HTMLImageElement",src:e.toDataURL()}}return e instanceof ImageData?{rr_type:e.constructor.name,args:[bt(e.data,t,n),e.width,e.height]}:St(e,t)||"object"==typeof e?{rr_type:e.constructor.name,index:yt(e,t,n)}:e}var wt=(e,t,n)=>e.map((e=>bt(e,t,n))),St=(e,t)=>{var n=["WebGLActiveInfo","WebGLBuffer","WebGLFramebuffer","WebGLProgram","WebGLRenderbuffer","WebGLShader","WebGLShaderPrecisionFormat","WebGLTexture","WebGLUniformLocation","WebGLVertexArrayObject","WebGLVertexArrayObjectOES"].filter((e=>"function"==typeof t[e]));return Boolean(n.find((n=>e instanceof t[n])))};function Ct(e,t,n,r){var i=[];try{var o=be(e.HTMLCanvasElement.prototype,"getContext",(function(e){return function(i){for(var o=arguments.length,s=new Array(o>1?o-1:0),a=1;a<o;a++)s[a-1]=arguments[a];if(!Ee(this,t,n,!0)){var l=function(e){return"experimental-webgl"===e?"webgl":e}(i);if("__context"in this||(this.__context=l),r&&["webgl","webgl2"].includes(l))if(s[0]&&"object"==typeof s[0]){var c=s[0];c.preserveDrawingBuffer||(c.preserveDrawingBuffer=!0)}else s.splice(0,1,{preserveDrawingBuffer:!0})}return e.apply(this,[i,...s])}}));i.push(o)}catch(e){console.error("failed to patch HTMLCanvasElement.prototype.getContext")}return()=>{i.forEach((e=>e()))}}function It(e,t,n,r,i,o){var s=[],a=Object.getOwnPropertyNames(e),l=function(a){if(["isContextLost","canvas","drawingBufferWidth","drawingBufferHeight"].includes(a))return"continue";try{if("function"!=typeof e[a])return"continue";var l=be(e,a,(function(e){return function(){for(var s=arguments.length,l=new Array(s),c=0;c<s;c++)l[c]=arguments[c];var u=e.apply(this,l);if(yt(u,o,this),"tagName"in this.canvas&&!Ee(this.canvas,r,i,!0)){var d=wt(l,o,this),h={type:t,property:a,args:d};n(this.canvas,h)}return u}}));s.push(l)}catch(r){var c=ye(e,a,{set(e){n(this.canvas,{type:t,property:a,args:[e],setter:!0})}});s.push(c)}};for(var c of a)l(c);return s}var kt,Et,xt,Tt,Mt="KGZ1bmN0aW9uKCkgewogICJ1c2Ugc3RyaWN0IjsKICB2YXIgY2hhcnMgPSAiQUJDREVGR0hJSktMTU5PUFFSU1RVVldYWVphYmNkZWZnaGlqa2xtbm9wcXJzdHV2d3h5ejAxMjM0NTY3ODkrLyI7CiAgdmFyIGxvb2t1cCA9IHR5cGVvZiBVaW50OEFycmF5ID09PSAidW5kZWZpbmVkIiA/IFtdIDogbmV3IFVpbnQ4QXJyYXkoMjU2KTsKICBmb3IgKHZhciBpID0gMDsgaSA8IGNoYXJzLmxlbmd0aDsgaSsrKSB7CiAgICBsb29rdXBbY2hhcnMuY2hhckNvZGVBdChpKV0gPSBpOwogIH0KICB2YXIgZW5jb2RlID0gZnVuY3Rpb24oYXJyYXlidWZmZXIpIHsKICAgIHZhciBieXRlcyA9IG5ldyBVaW50OEFycmF5KGFycmF5YnVmZmVyKSwgaTIsIGxlbiA9IGJ5dGVzLmxlbmd0aCwgYmFzZTY0ID0gIiI7CiAgICBmb3IgKGkyID0gMDsgaTIgPCBsZW47IGkyICs9IDMpIHsKICAgICAgYmFzZTY0ICs9IGNoYXJzW2J5dGVzW2kyXSA+PiAyXTsKICAgICAgYmFzZTY0ICs9IGNoYXJzWyhieXRlc1tpMl0gJiAzKSA8PCA0IHwgYnl0ZXNbaTIgKyAxXSA+PiA0XTsKICAgICAgYmFzZTY0ICs9IGNoYXJzWyhieXRlc1tpMiArIDFdICYgMTUpIDw8IDIgfCBieXRlc1tpMiArIDJdID4+IDZdOwogICAgICBiYXNlNjQgKz0gY2hhcnNbYnl0ZXNbaTIgKyAyXSAmIDYzXTsKICAgIH0KICAgIGlmIChsZW4gJSAzID09PSAyKSB7CiAgICAgIGJhc2U2NCA9IGJhc2U2NC5zdWJzdHJpbmcoMCwgYmFzZTY0Lmxlbmd0aCAtIDEpICsgIj0iOwogICAgfSBlbHNlIGlmIChsZW4gJSAzID09PSAxKSB7CiAgICAgIGJhc2U2NCA9IGJhc2U2NC5zdWJzdHJpbmcoMCwgYmFzZTY0Lmxlbmd0aCAtIDIpICsgIj09IjsKICAgIH0KICAgIHJldHVybiBiYXNlNjQ7CiAgfTsKICBjb25zdCBsYXN0QmxvYk1hcCA9IC8qIEBfX1BVUkVfXyAqLyBuZXcgTWFwKCk7CiAgY29uc3QgdHJhbnNwYXJlbnRCbG9iTWFwID0gLyogQF9fUFVSRV9fICovIG5ldyBNYXAoKTsKICBhc3luYyBmdW5jdGlvbiBnZXRUcmFuc3BhcmVudEJsb2JGb3Iod2lkdGgsIGhlaWdodCwgZGF0YVVSTE9wdGlvbnMpIHsKICAgIGNvbnN0IGlkID0gYCR7d2lkdGh9LSR7aGVpZ2h0fWA7CiAgICBpZiAoIk9mZnNjcmVlbkNhbnZhcyIgaW4gZ2xvYmFsVGhpcykgewogICAgICBpZiAodHJhbnNwYXJlbnRCbG9iTWFwLmhhcyhpZCkpIHJldHVybiB0cmFuc3BhcmVudEJsb2JNYXAuZ2V0KGlkKTsKICAgICAgY29uc3Qgb2Zmc2NyZWVuID0gbmV3IE9mZnNjcmVlbkNhbnZhcyh3aWR0aCwgaGVpZ2h0KTsKICAgICAgb2Zmc2NyZWVuLmdldENvbnRleHQoIjJkIik7CiAgICAgIGNvbnN0IGJsb2IgPSBhd2FpdCBvZmZzY3JlZW4uY29udmVydFRvQmxvYihkYXRhVVJMT3B0aW9ucyk7CiAgICAgIGNvbnN0IGFycmF5QnVmZmVyID0gYXdhaXQgYmxvYi5hcnJheUJ1ZmZlcigpOwogICAgICBjb25zdCBiYXNlNjQgPSBlbmNvZGUoYXJyYXlCdWZmZXIpOwogICAgICB0cmFuc3BhcmVudEJsb2JNYXAuc2V0KGlkLCBiYXNlNjQpOwogICAgICByZXR1cm4gYmFzZTY0OwogICAgfSBlbHNlIHsKICAgICAgcmV0dXJuICIiOwogICAgfQogIH0KICBjb25zdCB3b3JrZXIgPSBzZWxmOwogIHdvcmtlci5vbm1lc3NhZ2UgPSBhc3luYyBmdW5jdGlvbihlKSB7CiAgICBpZiAoIk9mZnNjcmVlbkNhbnZhcyIgaW4gZ2xvYmFsVGhpcykgewogICAgICBjb25zdCB7IGlkLCBiaXRtYXAsIHdpZHRoLCBoZWlnaHQsIGRhdGFVUkxPcHRpb25zIH0gPSBlLmRhdGE7CiAgICAgIGNvbnN0IHRyYW5zcGFyZW50QmFzZTY0ID0gZ2V0VHJhbnNwYXJlbnRCbG9iRm9yKAogICAgICAgIHdpZHRoLAogICAgICAgIGhlaWdodCwKICAgICAgICBkYXRhVVJMT3B0aW9ucwogICAgICApOwogICAgICBjb25zdCBvZmZzY3JlZW4gPSBuZXcgT2Zmc2NyZWVuQ2FudmFzKHdpZHRoLCBoZWlnaHQpOwogICAgICBjb25zdCBjdHggPSBvZmZzY3JlZW4uZ2V0Q29udGV4dCgiMmQiKTsKICAgICAgY3R4LmRyYXdJbWFnZShiaXRtYXAsIDAsIDApOwogICAgICBiaXRtYXAuY2xvc2UoKTsKICAgICAgY29uc3QgYmxvYiA9IGF3YWl0IG9mZnNjcmVlbi5jb252ZXJ0VG9CbG9iKGRhdGFVUkxPcHRpb25zKTsKICAgICAgY29uc3QgdHlwZSA9IGJsb2IudHlwZTsKICAgICAgY29uc3QgYXJyYXlCdWZmZXIgPSBhd2FpdCBibG9iLmFycmF5QnVmZmVyKCk7CiAgICAgIGNvbnN0IGJhc2U2NCA9IGVuY29kZShhcnJheUJ1ZmZlcik7CiAgICAgIGlmICghbGFzdEJsb2JNYXAuaGFzKGlkKSAmJiBhd2FpdCB0cmFuc3BhcmVudEJhc2U2NCA9PT0gYmFzZTY0KSB7CiAgICAgICAgbGFzdEJsb2JNYXAuc2V0KGlkLCBiYXNlNjQpOwogICAgICAgIHJldHVybiB3b3JrZXIucG9zdE1lc3NhZ2UoeyBpZCB9KTsKICAgICAgfQogICAgICBpZiAobGFzdEJsb2JNYXAuZ2V0KGlkKSA9PT0gYmFzZTY0KSByZXR1cm4gd29ya2VyLnBvc3RNZXNzYWdlKHsgaWQgfSk7CiAgICAgIHdvcmtlci5wb3N0TWVzc2FnZSh7CiAgICAgICAgaWQsCiAgICAgICAgdHlwZSwKICAgICAgICBiYXNlNjQsCiAgICAgICAgd2lkdGgsCiAgICAgICAgaGVpZ2h0CiAgICAgIH0pOwogICAgICBsYXN0QmxvYk1hcC5zZXQoaWQsIGJhc2U2NCk7CiAgICB9IGVsc2UgewogICAgICByZXR1cm4gd29ya2VyLnBvc3RNZXNzYWdlKHsgaWQ6IGUuZGF0YS5pZCB9KTsKICAgIH0KICB9Owp9KSgpOwovLyMgc291cmNlTWFwcGluZ1VSTD1pbWFnZS1iaXRtYXAtZGF0YS11cmwtd29ya2VyLUlKcEM3Z19iLmpzLm1hcAo=",Rt="undefined"!=typeof window&&window.Blob&&new Blob([(kt=Mt,Uint8Array.from(atob(kt),(e=>e.charCodeAt(0))))],{type:"text/javascript;charset=utf-8"});function At(e){var t;try{if(!(t=Rt&&(window.URL||window.webkitURL).createObjectURL(Rt)))throw"";var n=new Worker(t,{name:null==e?void 0:e.name});return n.addEventListener("error",(()=>{(window.URL||window.webkitURL).revokeObjectURL(t)})),n}catch(t){return new Worker("data:text/javascript;base64,"+Mt,{name:null==e?void 0:e.name})}finally{t&&(window.URL||window.webkitURL).revokeObjectURL(t)}}class Nt{constructor(e){c(this,"pendingCanvasMutations",new Map),c(this,"rafStamps",{latestId:0,invokeId:null}),c(this,"mirror"),c(this,"mutationCb"),c(this,"resetObservers"),c(this,"frozen",!1),c(this,"locked",!1),c(this,"processMutation",((e,t)=>{!(this.rafStamps.invokeId&&this.rafStamps.latestId!==this.rafStamps.invokeId)&&this.rafStamps.invokeId||(this.rafStamps.invokeId=this.rafStamps.latestId),this.pendingCanvasMutations.has(e)||this.pendingCanvasMutations.set(e,[]),this.pendingCanvasMutations.get(e).push(t)}));var{sampling:t="all",win:n,blockClass:r,blockSelector:i,recordCanvas:o,dataURLOptions:s}=e;this.mutationCb=e.mutationCb,this.mirror=e.mirror,o&&"all"===t&&this.initCanvasMutationObserver(n,r,i),o&&"number"==typeof t&&this.initCanvasFPSObserver(t,n,r,i,{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(e,t,n,i,o){var s=this,a=Ct(t,n,i,!0),l=new Map,c=new At;c.onmessage=e=>{var{id:t}=e.data;if(l.set(t,!1),"base64"in e.data){var{base64:n,type:r,width:i,height:o}=e.data;this.mutationCb({id:t,type:$e["2D"],commands:[{property:"clearRect",args:[0,0,i,o]},{property:"drawImage",args:[{rr_type:"ImageBitmap",args:[{rr_type:"Blob",data:[{rr_type:"ArrayBuffer",base64:n}],type:r}]},0,0]}]})}};var u,d=1e3/e,h=0,p=e=>{var a,v;h&&e-h<d?u=requestAnimationFrame(p):(h=e,(a=[],v=e=>{e.querySelectorAll("canvas").forEach((e=>{Ee(e,n,i,!0)||a.push(e)})),e.querySelectorAll("*").forEach((e=>{e.shadowRoot&&v(e.shadowRoot)}))},v(t.document),a).forEach(function(){var e=r((function*(e){var t,n=s.mirror.getId(e);if(!l.get(n)&&0!==e.width&&0!==e.height){if(l.set(n,!0),["webgl","webgl2"].includes(e.__context)){var r=e.getContext(e.__context);!1===(null==(t=null==r?void 0:r.getContextAttributes())?void 0:t.preserveDrawingBuffer)&&r.clear(r.COLOR_BUFFER_BIT)}var i=e.clientWidth||e.width,a=e.clientHeight||e.height,u=yield createImageBitmap(e,{resizeWidth:i,resizeHeight:a});c.postMessage({id:n,bitmap:u,width:i,height:a,dataURLOptions:o.dataURLOptions},[u])}}));return function(t){return e.apply(this,arguments)}}()),u=requestAnimationFrame(p))};u=requestAnimationFrame(p),this.resetObservers=()=>{a(),cancelAnimationFrame(u)}}initCanvasMutationObserver(e,t,n){this.startRAFTimestamping(),this.startPendingCanvasMutationFlusher();var r=Ct(e,t,n,!1),i=function(e,t,n,r){var i=[],o=Object.getOwnPropertyNames(t.CanvasRenderingContext2D.prototype),s=function(o){try{if("function"!=typeof t.CanvasRenderingContext2D.prototype[o])return"continue";var s=be(t.CanvasRenderingContext2D.prototype,o,(function(i){return function(){for(var s=arguments.length,a=new Array(s),l=0;l<s;l++)a[l]=arguments[l];return Ee(this.canvas,n,r,!0)||setTimeout((()=>{var n=wt(a,t,this);e(this.canvas,{type:$e["2D"],property:o,args:n})}),0),i.apply(this,a)}}));i.push(s)}catch(n){var a=ye(t.CanvasRenderingContext2D.prototype,o,{set(t){e(this.canvas,{type:$e["2D"],property:o,args:[t],setter:!0})}});i.push(a)}};for(var a of o)s(a);return()=>{i.forEach((e=>e()))}}(this.processMutation.bind(this),e,t,n),o=function(e,t,n,r){var i=[];return i.push(...It(t.WebGLRenderingContext.prototype,$e.WebGL,e,n,r,t)),void 0!==t.WebGL2RenderingContext&&i.push(...It(t.WebGL2RenderingContext.prototype,$e.WebGL2,e,n,r,t)),()=>{i.forEach((e=>e()))}}(this.processMutation.bind(this),e,t,n);this.resetObservers=()=>{r(),i(),o()}}startPendingCanvasMutationFlusher(){requestAnimationFrame((()=>this.flushPendingCanvasMutations()))}startRAFTimestamping(){var e=t=>{this.rafStamps.latestId=t,requestAnimationFrame(e)};requestAnimationFrame(e)}flushPendingCanvasMutations(){this.pendingCanvasMutations.forEach(((e,t)=>{var n=this.mirror.getId(t);this.flushPendingCanvasMutationFor(t,n)})),requestAnimationFrame((()=>this.flushPendingCanvasMutations()))}flushPendingCanvasMutationFor(e,t){if(!this.frozen&&!this.locked){var n=this.pendingCanvasMutations.get(e);if(n&&-1!==t){var r=n.map((e=>o(e,a))),{type:i}=n[0];this.mutationCb({id:t,type:i,commands:r}),this.pendingCanvasMutations.delete(e)}}}}class Ft{constructor(e){c(this,"trackedLinkElements",new WeakSet),c(this,"mutationCb"),c(this,"adoptedStyleSheetCb"),c(this,"styleMirror",new Fe),this.mutationCb=e.mutationCb,this.adoptedStyleSheetCb=e.adoptedStyleSheetCb}attachLinkElement(e,t){"_cssText"in t.attributes&&this.mutationCb({adds:[],removes:[],texts:[],attributes:[{id:t.id,attributes:t.attributes}]}),this.trackLinkElement(e)}trackLinkElement(e){this.trackedLinkElements.has(e)||(this.trackedLinkElements.add(e),this.trackStylesheetInLinkElement(e))}adoptStyleSheets(e,t){var n=this;if(0!==e.length){var r={id:t,styleIds:[]},i=[],o=function(e){var t=void 0;n.styleMirror.has(e)?t=n.styleMirror.getId(e):(t=n.styleMirror.add(e),i.push({styleId:t,rules:Array.from(e.rules||CSSRule,((t,n)=>({rule:E(t,e.href),index:n})))})),r.styleIds.push(t)};for(var s of e)o(s);i.length>0&&(r.styles=i),this.adoptedStyleSheetCb(r)}}reset(){this.styleMirror.reset(),this.trackedLinkElements=new WeakSet}trackStylesheetInLinkElement(e){}}class Ot{constructor(){c(this,"nodeMap",new WeakMap),c(this,"active",!1)}inOtherBuffer(e,t){var n=this.nodeMap.get(e);return n&&Array.from(n).some((e=>e!==t))}add(e,t){this.active||(this.active=!0,requestAnimationFrame((()=>{this.nodeMap=new WeakMap,this.active=!1}))),this.nodeMap.set(e,(this.nodeMap.get(e)||new Set).add(t))}destroy(){}}var Pt=!1;try{if(2!==Array.from([1],(e=>2*e))[0]){var Lt=document.createElement("iframe");document.body.appendChild(Lt),Array.from=(null==(s=Lt.contentWindow)?void 0:s.Array.from)||Array.from,document.body.removeChild(Lt)}}catch(e){console.debug("Unable to override Array.from",e)}var Dt,Bt,Ht=new T;function qt(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},{emit:n,checkoutEveryNms:r,checkoutEveryNth:i,blockClass:o="rr-block",blockSelector:s=null,ignoreClass:a="rr-ignore",ignoreSelector:l=null,maskTextClass:c="rr-mask",maskTextSelector:u=null,inlineStylesheet:d=!0,maskAllInputs:h,maskInputOptions:p,slimDOMOptions:v,maskInputFn:g,maskTextFn:f,hooks:m,packFn:_,sampling:y={},dataURLOptions:b={},mousemoveWait:w,recordDOM:S=!0,recordCanvas:C=!1,recordCrossOriginIframes:I=!1,recordAfter:k=("DOMContentLoaded"===e.recordAfter?e.recordAfter:"load"),userTriggeredOnInput:E=!1,collectFonts:x=!1,inlineImages:M=!1,plugins:R,keepIframeSrcFn:A=(()=>!1),ignoreCSSAttributes:N=new Set([]),errorHandler:F}=e;Ge=F;var O=!I||window.parent===window,P=!1;if(!O)try{window.parent.document&&(P=!1)}catch(e){P=!0}if(O&&!n)throw new Error("emit function is required");if(!O&&!P)return()=>{};void 0!==w&&void 0===y.mousemove&&(y.mousemove=w),Ht.reset();var L,D=!0===h?{color:!0,date:!0,"datetime-local":!0,email:!0,month:!0,number:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0,textarea:!0,select:!0,password:!0}:void 0!==p?p:{password:!0},B=!0===v||"all"===v?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaVerification:!0,headMetaAuthorship:"all"===v,headMetaDescKeywords:"all"===v,headTitleMutations:"all"===v}:v||{};!function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:window;"NodeList"in e&&!e.NodeList.prototype.forEach&&(e.NodeList.prototype.forEach=Array.prototype.forEach),"DOMTokenList"in e&&!e.DOMTokenList.prototype.forEach&&(e.DOMTokenList.prototype.forEach=Array.prototype.forEach)}();var H=0,q=e=>{for(var t of R||[])t.eventProcessor&&(e=t.eventProcessor(e));return _&&!P&&(e=_(e)),e};Et=(e,t)=>{var o,s=e;if(s.timestamp=we(),!(null==(o=Qe[0])?void 0:o.isFrozen())||s.type===De.FullSnapshot||s.type===De.IncrementalSnapshot&&s.data.source===Be.Mutation||Qe.forEach((e=>e.unfreeze())),O)null==n||n(q(s),t);else if(P){var a={type:"rrweb",event:q(s),origin:window.location.origin,isCheckout:t};window.parent.postMessage(a,"*")}if(s.type===De.FullSnapshot)L=s,H=0;else if(s.type===De.IncrementalSnapshot){if(s.data.source===Be.Mutation&&s.data.isAttachIframe)return;H++;var l=i&&H>=i,c=r&&s.timestamp-L.timestamp>r;(l||c)&&xt(!0)}};var $=e=>{Et({type:De.IncrementalSnapshot,data:t({source:Be.Mutation},e)})},W=e=>Et({type:De.IncrementalSnapshot,data:t({source:Be.Scroll},e)}),V=e=>Et({type:De.IncrementalSnapshot,data:t({source:Be.CanvasMutation},e)}),Z=new Ft({mutationCb:$,adoptedStyleSheetCb:e=>Et({type:De.IncrementalSnapshot,data:t({source:Be.AdoptedStyleSheet},e)})}),G=new pt({mirror:Ht,mutationCb:$,stylesheetManager:Z,recordCrossOriginIframes:I,wrappedEmit:Et});for(var U of R||[])U.getMirror&&U.getMirror({nodeMirror:Ht,crossOriginIframeMirror:G.crossOriginIframeMirror,crossOriginIframeStyleMirror:G.crossOriginIframeStyleMirror});var j=new Ot;Tt=new Nt({recordCanvas:C,mutationCb:V,win:window,blockClass:o,blockSelector:s,mirror:Ht,sampling:y.canvas,dataURLOptions:b});var z=new vt({mutationCb:$,scrollCb:W,bypassOptions:{blockClass:o,blockSelector:s,maskTextClass:c,maskTextSelector:u,inlineStylesheet:d,maskInputOptions:D,dataURLOptions:b,maskTextFn:f,maskInputFn:g,recordCanvas:C,inlineImages:M,sampling:y,slimDOMOptions:B,iframeManager:G,stylesheetManager:Z,canvasManager:Tt,keepIframeSrcFn:A,processedNodeManager:j},mirror:Ht});xt=function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(S){Et({type:De.Meta,data:{href:window.location.href,width:Ie(),height:Ce()}},e),Z.reset(),z.init(),Qe.forEach((e=>e.lock()));var t=function(e,t){var{mirror:n=new T,blockClass:r="rr-block",blockSelector:i=null,maskTextClass:o="rr-mask",maskTextSelector:s=null,inlineStylesheet:a=!0,inlineImages:l=!1,recordCanvas:c=!1,maskAllInputs:u=!1,maskTextFn:d,maskInputFn:h,slimDOM:p=!1,dataURLOptions:v,preserveWhiteSpace:g,onSerialize:f,onIframeLoad:m,iframeLoadTimeout:_,onStylesheetLoad:y,stylesheetLoadTimeout:b,keepIframeSrcFn:w=(()=>!1)}=t||{};return re(e,{doc:e,mirror:n,blockClass:r,blockSelector:i,maskTextClass:o,maskTextSelector:s,skipChild:!1,inlineStylesheet:a,maskInputOptions:!0===u?{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===u?{password:!0}:u,maskTextFn:d,maskInputFn:h,slimDOMOptions:!0===p||"all"===p?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaDescKeywords:"all"===p,headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaAuthorship:!0,headMetaVerification:!0}:!1===p?{}:p,dataURLOptions:v,inlineImages:l,recordCanvas:c,preserveWhiteSpace:g,onSerialize:f,onIframeLoad:m,iframeLoadTimeout:_,onStylesheetLoad:y,stylesheetLoadTimeout:b,keepIframeSrcFn:w,newlyAddedElement:!1})}(document,{mirror:Ht,blockClass:o,blockSelector:s,maskTextClass:c,maskTextSelector:u,inlineStylesheet:d,maskAllInputs:D,maskTextFn:f,maskInputFn:g,slimDOM:B,dataURLOptions:b,recordCanvas:C,inlineImages:M,onSerialize:e=>{Re(e,Ht)&&G.addIframe(e),Ae(e,Ht)&&Z.trackLinkElement(e),Ne(e)&&z.addShadowRoot(ve.shadowRoot(e),document)},onIframeLoad:(e,t)=>{G.attachIframe(e,t),z.observeAttachShadow(e)},onStylesheetLoad:(e,t)=>{Z.attachLinkElement(e,t)},keepIframeSrcFn:A});if(!t)return console.warn("Failed to snapshot the document");Et({type:De.FullSnapshot,data:{node:t,initialOffset:Se(window)}},e),Qe.forEach((e=>e.unlock())),document.adoptedStyleSheets&&document.adoptedStyleSheets.length>0&&Z.adoptStyleSheets(document.adoptedStyleSheets,Ht.getId(document))}};try{var Y=[],X=e=>{var n;return Ke(ct)({mutationCb:$,mousemoveCb:(e,t)=>Et({type:De.IncrementalSnapshot,data:{source:t,positions:e}}),mouseInteractionCb:e=>Et({type:De.IncrementalSnapshot,data:t({source:Be.MouseInteraction},e)}),scrollCb:W,viewportResizeCb:e=>Et({type:De.IncrementalSnapshot,data:t({source:Be.ViewportResize},e)}),inputCb:e=>Et({type:De.IncrementalSnapshot,data:t({source:Be.Input},e)}),mediaInteractionCb:e=>Et({type:De.IncrementalSnapshot,data:t({source:Be.MediaInteraction},e)}),styleSheetRuleCb:e=>Et({type:De.IncrementalSnapshot,data:t({source:Be.StyleSheetRule},e)}),styleDeclarationCb:e=>Et({type:De.IncrementalSnapshot,data:t({source:Be.StyleDeclaration},e)}),canvasMutationCb:V,fontCb:e=>Et({type:De.IncrementalSnapshot,data:t({source:Be.Font},e)}),selectionCb:e=>{Et({type:De.IncrementalSnapshot,data:t({source:Be.Selection},e)})},customElementCb:e=>{Et({type:De.IncrementalSnapshot,data:t({source:Be.CustomElement},e)})},blockClass:o,ignoreClass:a,ignoreSelector:l,maskTextClass:c,maskTextSelector:u,maskInputOptions:D,inlineStylesheet:d,sampling:y,recordDOM:S,recordCanvas:C,inlineImages:M,userTriggeredOnInput:E,collectFonts:x,doc:e,maskInputFn:g,maskTextFn:f,keepIframeSrcFn:A,blockSelector:s,slimDOMOptions:B,dataURLOptions:b,mirror:Ht,iframeManager:G,stylesheetManager:Z,shadowDomManager:z,processedNodeManager:j,canvasManager:Tt,ignoreCSSAttributes:N,plugins:(null==(n=null==R?void 0:R.filter((e=>e.observer)))?void 0:n.map((e=>({observer:e.observer,options:e.options,callback:t=>Et({type:De.Plugin,data:{plugin:e.name,payload:t}})}))))||[]},m)};G.addLoadListener((e=>{try{Y.push(X(e.contentDocument))}catch(e){console.warn(e)}}));var J=()=>{xt(),Y.push(X(document)),Pt=!0};return"interactive"===document.readyState||"complete"===document.readyState?J():(Y.push(ge("DOMContentLoaded",(()=>{Et({type:De.DomContentLoaded,data:{}}),"DOMContentLoaded"===k&&J()}))),Y.push(ge("load",(()=>{Et({type:De.Load,data:{}}),"load"===k&&J()}),window))),()=>{Y.forEach((e=>e())),j.destroy(),Pt=!1,Ge=void 0}}catch(e){console.warn(e)}}qt.addCustomEvent=(e,t)=>{if(!Pt)throw new Error("please add custom event after start recording");Et({type:De.Custom,data:{tag:e,payload:t}})},qt.freezePage=()=>{Qe.forEach((e=>e.freeze()))},qt.takeFullSnapshot=e=>{if(!Pt)throw new Error("please take full snapshot after start recording");xt(e)},qt.mirror=Ht,(Bt=Dt||(Dt={}))[Bt.NotStarted=0]="NotStarted",Bt[Bt.Running=1]="Running",Bt[Bt.Stopped=2]="Stopped";var $t,Wt=Object.defineProperty,Vt=(e,t,n)=>((e,t,n)=>t in e?Wt(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n)(e,"symbol"!=typeof t?t+"":t,n),Zt=Object.defineProperty,Gt=(e,t,n)=>((e,t,n)=>t in e?Zt(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n)(e,"symbol"!=typeof t?t+"":t,n),Ut=Object.defineProperty,jt=(e,t,n)=>((e,t,n)=>t in e?Ut(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n)(e,"symbol"!=typeof t?t+"":t,n),zt={Node:["childNodes","parentNode","parentElement","textContent"],ShadowRoot:["host","styleSheets"],Element:["shadowRoot","querySelector","querySelectorAll"],MutationObserver:[]},Yt={Node:["contains","getRootNode"],ShadowRoot:["getSelection"],Element:[],MutationObserver:["constructor"]},Xt={};function Jt(e){if(Xt[e])return Xt[e];var t=globalThis[e],n=t.prototype,r=e in zt?zt[e]:void 0,i=Boolean(r&&r.every((e=>{var t,r;return Boolean(null==(r=null==(t=Object.getOwnPropertyDescriptor(n,e))?void 0:t.get)?void 0:r.toString().includes("[native code]"))}))),o=e in Yt?Yt[e]:void 0,s=Boolean(o&&o.every((e=>{var t;return"function"==typeof n[e]&&(null==(t=n[e])?void 0:t.toString().includes("[native code]"))})));if(i&&s)return Xt[e]=t.prototype,t.prototype;try{var a=document.createElement("iframe");document.body.appendChild(a);var l=a.contentWindow;if(!l)return t.prototype;var c=l[e].prototype;return document.body.removeChild(a),c?Xt[e]=c:n}catch(e){return n}}var Kt={};function Qt(e,t,n){var r,i="".concat(e,".").concat(String(n));if(Kt[i])return Kt[i].call(t);var o=Jt(e),s=null==(r=Object.getOwnPropertyDescriptor(o,n))?void 0:r.get;return s?(Kt[i]=s,s.call(t)):t[n]}var en={};function tn(e,t,n){var r="".concat(e,".").concat(String(n));if(en[r])return en[r].bind(t);var i=Jt(e)[n];return"function"!=typeof i?t[n]:(en[r]=i,i.bind(t))}var nn={childNodes:function(e){return Qt("Node",e,"childNodes")},parentNode:function(e){return Qt("Node",e,"parentNode")},parentElement:function(e){return Qt("Node",e,"parentElement")},textContent:function(e){return Qt("Node",e,"textContent")},contains:function(e,t){return tn("Node",e,"contains")(t)},getRootNode:function(e){return tn("Node",e,"getRootNode")()},host:function(e){return e&&"host"in e?Qt("ShadowRoot",e,"host"):null},styleSheets:function(e){return e.styleSheets},shadowRoot:function(e){return e&&"shadowRoot"in e?Qt("Element",e,"shadowRoot"):null},querySelector:function(e,t){return Qt("Element",e,"querySelector")(t)},querySelectorAll:function(e,t){return Qt("Element",e,"querySelectorAll")(t)},mutationObserver:function(){return Jt("MutationObserver").constructor}};class rn{constructor(){jt(this,"idNodeMap",new Map),jt(this,"nodeMetaMap",new WeakMap)}getId(e){var t;if(!e)return-1;var n=null==(t=this.getMeta(e))?void 0:t.id;return null!=n?n:-1}getNode(e){return this.idNodeMap.get(e)||null}getIds(){return Array.from(this.idNodeMap.keys())}getMeta(e){return this.nodeMetaMap.get(e)||null}removeNodeFromMap(e){var t=this.getId(e);this.idNodeMap.delete(t),e.childNodes&&e.childNodes.forEach((e=>this.removeNodeFromMap(e)))}has(e){return this.idNodeMap.has(e)}hasNode(e){return this.nodeMetaMap.has(e)}add(e,t){var n=t.id;this.idNodeMap.set(n,e),this.nodeMetaMap.set(e,t)}replace(e,t){var n=this.getNode(e);if(n){var r=this.nodeMetaMap.get(n);r&&this.nodeMetaMap.set(t,r)}this.idNodeMap.set(e,t)}reset(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap}}function on(e,t,n){if(!e)return!1;if(e.nodeType!==e.ELEMENT_NODE)return!!n&&on(nn.parentNode(e),t,n);for(var r=e.classList.length;r--;){var i=e.classList[r];if(t.test(i))return!0}return!!n&&on(nn.parentNode(e),t,n)}class sn{constructor(){__publicField22(this,"parentElement",null),__publicField22(this,"parentNode",null),__publicField22(this,"ownerDocument"),__publicField22(this,"firstChild",null),__publicField22(this,"lastChild",null),__publicField22(this,"previousSibling",null),__publicField22(this,"nextSibling",null),__publicField22(this,"ELEMENT_NODE",1),__publicField22(this,"TEXT_NODE",3),__publicField22(this,"nodeType"),__publicField22(this,"nodeName"),__publicField22(this,"RRNodeType")}get childNodes(){for(var e=[],t=this.firstChild;t;)e.push(t),t=t.nextSibling;return e}contains(e){if(!(e instanceof sn))return!1;if(e.ownerDocument!==this.ownerDocument)return!1;if(e===this)return!0;for(;e.parentNode;){if(e.parentNode===this)return!0;e=e.parentNode}return!1}appendChild(e){throw new Error("RRDomException: Failed to execute 'appendChild' on 'RRNode': This RRNode type does not support this method.")}insertBefore(e,t){throw new Error("RRDomException: Failed to execute 'insertBefore' on 'RRNode': This RRNode type does not support this method.")}removeChild(e){throw new Error("RRDomException: Failed to execute 'removeChild' on 'RRNode': This RRNode type does not support this method.")}toString(){return"RRNode"}}var an={Node:["childNodes","parentNode","parentElement","textContent"],ShadowRoot:["host","styleSheets"],Element:["shadowRoot","querySelector","querySelectorAll"],MutationObserver:[]},ln={Node:["contains","getRootNode"],ShadowRoot:["getSelection"],Element:[],MutationObserver:["constructor"]},cn={};function un(e){if(cn[e])return cn[e];var t=globalThis[e],n=t.prototype,r=e in an?an[e]:void 0,i=Boolean(r&&r.every((e=>{var t,r;return Boolean(null==(r=null==(t=Object.getOwnPropertyDescriptor(n,e))?void 0:t.get)?void 0:r.toString().includes("[native code]"))}))),o=e in ln?ln[e]:void 0,s=Boolean(o&&o.every((e=>{var t;return"function"==typeof n[e]&&(null==(t=n[e])?void 0:t.toString().includes("[native code]"))})));if(i&&s)return cn[e]=t.prototype,t.prototype;try{var a=document.createElement("iframe");document.body.appendChild(a);var l=a.contentWindow;if(!l)return t.prototype;var c=l[e].prototype;return document.body.removeChild(a),c?cn[e]=c:n}catch(e){return n}}var dn={};function hn(e,t,n){var r,i="".concat(e,".").concat(String(n));if(dn[i])return dn[i].call(t);var o=un(e),s=null==(r=Object.getOwnPropertyDescriptor(o,n))?void 0:r.get;return s?(dn[i]=s,s.call(t)):t[n]}var pn={};function vn(e,t,n){var r="".concat(e,".").concat(String(n));if(pn[r])return pn[r].bind(t);var i=un(e)[n];return"function"!=typeof i?t[n]:(pn[r]=i,i.bind(t))}var gn={childNodes:function(e){return hn("Node",e,"childNodes")},parentNode:function(e){return hn("Node",e,"parentNode")},parentElement:function(e){return hn("Node",e,"parentElement")},textContent:function(e){return hn("Node",e,"textContent")},contains:function(e,t){return vn("Node",e,"contains")(t)},getRootNode:function(e){return vn("Node",e,"getRootNode")()},host:function(e){return e&&"host"in e?hn("ShadowRoot",e,"host"):null},styleSheets:function(e){return e.styleSheets},shadowRoot:function(e){return e&&"shadowRoot"in e?hn("Element",e,"shadowRoot"):null},querySelector:function(e,t){return hn("Element",e,"querySelector")(t)},querySelectorAll:function(e,t){return hn("Element",e,"querySelectorAll")(t)},mutationObserver:function(){return un("MutationObserver").constructor}};var fn="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.",mn={map:{},getId:()=>(console.error(fn),-1),getNode:()=>(console.error(fn),null),removeNodeFromMap(){console.error(fn)},has:()=>(console.error(fn),!1),reset(){console.error(fn)}};"undefined"!=typeof window&&window.Proxy&&window.Reflect&&(mn=new Proxy(mn,{get:(e,t,n)=>("map"===t&&console.error(fn),Reflect.get(e,t,n))}));var _n=Date.now;function yn(e){return e?e.nodeType===e.ELEMENT_NODE?e:gn.parentElement(e):null}/[1-9][0-9]{12}/.test(Date.now().toString())||(_n=()=>(new Date).getTime());function bn(e){var t,n=null;return"getRootNode"in e&&(null==(t=gn.getRootNode(e))?void 0:t.nodeType)===Node.DOCUMENT_FRAGMENT_NODE&&gn.host(gn.getRootNode(e))&&(n=gn.host(gn.getRootNode(e))),n}function wn(e){for(var t,n=e;t=bn(n);)n=t;return n}function Sn(e){var t=e.ownerDocument;if(!t)return!1;var n=wn(e);return gn.contains(t,n)}for(var Cn=Object.freeze(Object.defineProperty({__proto__:null,StyleSheetMirror:class{constructor(){Gt(this,"id",1),Gt(this,"styleIDMap",new WeakMap),Gt(this,"idStyleMap",new Map)}getId(e){var t;return null!==(t=this.styleIDMap.get(e))&&void 0!==t?t:-1}has(e){return this.styleIDMap.has(e)}add(e,t){return this.has(e)?this.getId(e):(n=void 0===t?this.id++:t,this.styleIDMap.set(e,n),this.idStyleMap.set(n,e),n);var n}getStyle(e){return this.idStyleMap.get(e)||null}reset(){this.styleIDMap=new WeakMap,this.idStyleMap=new Map,this.id=1}generateId(){return this.id++}},get _mirror(){return mn},closestElementOfNode:yn,getBaseDimension:function e(t,n){var r,i,o=null==(i=null==(r=t.ownerDocument)?void 0:r.defaultView)?void 0:i.frameElement;if(!o||o===n)return{x:0,y:0,relativeScale:1,absoluteScale:1};var s=o.getBoundingClientRect(),a=e(o,n),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 e(t,n){var r=t[n[0]];return 1===n.length?r:e(r.cssRules[n[1]].cssRules,n.slice(2))},getPositionsAndIndex:function(e){var t=[...e],n=t.pop();return{positions:t,index:n}},getRootShadowHost:wn,getShadowHost:bn,getWindowHeight:function(){return window.innerHeight||document.documentElement&&document.documentElement.clientHeight||document.body&&document.body.clientHeight},getWindowScroll:function(e){var t,n,r,i,o=e.document;return{left:o.scrollingElement?o.scrollingElement.scrollLeft:void 0!==e.pageXOffset?e.pageXOffset:o.documentElement.scrollLeft||(null==o?void 0:o.body)&&(null==(t=gn.parentElement(o.body))?void 0:t.scrollLeft)||(null==(n=null==o?void 0:o.body)?void 0:n.scrollLeft)||0,top:o.scrollingElement?o.scrollingElement.scrollTop:void 0!==e.pageYOffset?e.pageYOffset:(null==o?void 0:o.documentElement.scrollTop)||(null==o?void 0:o.body)&&(null==(r=gn.parentElement(o.body))?void 0:r.scrollTop)||(null==(i=null==o?void 0:o.body)?void 0:i.scrollTop)||0}},getWindowWidth:function(){return window.innerWidth||document.documentElement&&document.documentElement.clientWidth||document.body&&document.body.clientWidth},hasShadowRoot:function(e){return!!e&&(e instanceof sn&&"shadowRoot"in e?Boolean(e.shadowRoot):Boolean(gn.shadowRoot(e)))},hookSetter:function e(t,n,r,i){var o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:window,s=o.Object.getOwnPropertyDescriptor(t,n);return o.Object.defineProperty(t,n,i?r:{set(e){setTimeout((()=>{r.set.call(this,e)}),0),s&&s.set&&s.set.call(this,e)}}),()=>e(t,n,s||{},!0)},inDom:function(e){var t=e.ownerDocument;return!!t&&(gn.contains(t,e)||Sn(e))},isAncestorRemoved:function e(t,n){if(i=(r=t)&&"host"in r&&"mode"in r&&nn.host(r)||null,Boolean(i&&"shadowRoot"in i&&nn.shadowRoot(i)===r))return!1;var r,i,o=n.getId(t);if(!n.has(o))return!0;var s=gn.parentNode(t);return(!s||s.nodeType!==t.DOCUMENT_NODE)&&(!s||e(s,n))},isBlocked:function(e,t,n,r){if(!e)return!1;var i=yn(e);if(!i)return!1;try{if("string"==typeof t){if(i.classList.contains(t))return!0;if(r&&null!==i.closest("."+t))return!0}else if(on(i,t,r))return!0}catch(e){}if(n){if(i.matches(n))return!0;if(r&&null!==i.closest(n))return!0}return!1},isIgnored:function(e,t,n){return!("TITLE"!==e.tagName||!n.headTitleMutations)||-2===t.getId(e)},isSerialized:function(e,t){return-1!==t.getId(e)},isSerializedIframe:function(e,t){return Boolean("IFRAME"===e.nodeName&&t.getMeta(e))},isSerializedStylesheet:function(e,t){return Boolean("LINK"===e.nodeName&&e.nodeType===e.ELEMENT_NODE&&e.getAttribute&&"stylesheet"===e.getAttribute("rel")&&t.getMeta(e))},iterateResolveTree:function e(t,n){n(t.value);for(var r=t.children.length-1;r>=0;r--)e(t.children[r],n)},legacy_isTouchEvent:function(e){return Boolean(e.changedTouches)},get nowTimestamp(){return _n},on:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:document,r={capture:!0,passive:!0};return n.addEventListener(e,t,r),()=>n.removeEventListener(e,t,r)},patch:function(e,t,n){try{if(!(t in e))return()=>{};var r=e[t],i=n(r);return"function"==typeof i&&(i.prototype=i.prototype||{},Object.defineProperties(i,{__rrweb_original__:{enumerable:!1,value:r}})),e[t]=i,()=>{e[t]=r}}catch(e){return()=>{}}},polyfill:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:window;"NodeList"in e&&!e.NodeList.prototype.forEach&&(e.NodeList.prototype.forEach=Array.prototype.forEach),"DOMTokenList"in e&&!e.DOMTokenList.prototype.forEach&&(e.DOMTokenList.prototype.forEach=Array.prototype.forEach)},queueToResolveTrees:function(e){var t={},n=(e,n)=>{var r={value:e,parent:n,children:[]};return t[e.node.id]=r,r},r=[];for(var i of e){var{nextId:o,parentId:s}=i;if(o&&o in t){var a=t[o];if(a.parent){var l=a.parent.children.indexOf(a);a.parent.children.splice(l,0,n(i,a.parent))}else{var c=r.indexOf(a);r.splice(c,0,n(i,null))}}else if(s in t){var u=t[s];u.children.push(n(i,u))}else r.push(n(i,null))}return r},shadowHostInDom:Sn,throttle:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=null,i=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();i||!1!==n.leading||(i=l);var c=t-(l-i),u=this;c<=0||c>t?(r&&(clearTimeout(r),r=null),i=l,e.apply(u,s)):r||!1===n.trailing||(r=setTimeout((()=>{i=!1===n.leading?0:Date.now(),r=null,e.apply(u,s)}),c))}},uniqueTextMutations:function(e){for(var t=new Set,n=[],r=e.length;r--;){var i=e[r];t.has(i.id)||(n.push(i),t.add(i.id))}return n}},Symbol.toStringTag,{value:"Module"})),In="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",kn="undefined"==typeof Uint8Array?[]:new Uint8Array(256),En=0;En<64;En++)kn[In.charCodeAt(En)]=En;var xn;"undefined"!=typeof window&&window.Blob&&new Blob([(e=>Uint8Array.from(atob(e),(e=>e.charCodeAt(0))))("KGZ1bmN0aW9uKCkgewogICJ1c2Ugc3RyaWN0IjsKICB2YXIgY2hhcnMgPSAiQUJDREVGR0hJSktMTU5PUFFSU1RVVldYWVphYmNkZWZnaGlqa2xtbm9wcXJzdHV2d3h5ejAxMjM0NTY3ODkrLyI7CiAgdmFyIGxvb2t1cCA9IHR5cGVvZiBVaW50OEFycmF5ID09PSAidW5kZWZpbmVkIiA/IFtdIDogbmV3IFVpbnQ4QXJyYXkoMjU2KTsKICBmb3IgKHZhciBpID0gMDsgaSA8IGNoYXJzLmxlbmd0aDsgaSsrKSB7CiAgICBsb29rdXBbY2hhcnMuY2hhckNvZGVBdChpKV0gPSBpOwogIH0KICB2YXIgZW5jb2RlID0gZnVuY3Rpb24oYXJyYXlidWZmZXIpIHsKICAgIHZhciBieXRlcyA9IG5ldyBVaW50OEFycmF5KGFycmF5YnVmZmVyKSwgaTIsIGxlbiA9IGJ5dGVzLmxlbmd0aCwgYmFzZTY0ID0gIiI7CiAgICBmb3IgKGkyID0gMDsgaTIgPCBsZW47IGkyICs9IDMpIHsKICAgICAgYmFzZTY0ICs9IGNoYXJzW2J5dGVzW2kyXSA+PiAyXTsKICAgICAgYmFzZTY0ICs9IGNoYXJzWyhieXRlc1tpMl0gJiAzKSA8PCA0IHwgYnl0ZXNbaTIgKyAxXSA+PiA0XTsKICAgICAgYmFzZTY0ICs9IGNoYXJzWyhieXRlc1tpMiArIDFdICYgMTUpIDw8IDIgfCBieXRlc1tpMiArIDJdID4+IDZdOwogICAgICBiYXNlNjQgKz0gY2hhcnNbYnl0ZXNbaTIgKyAyXSAmIDYzXTsKICAgIH0KICAgIGlmIChsZW4gJSAzID09PSAyKSB7CiAgICAgIGJhc2U2NCA9IGJhc2U2NC5zdWJzdHJpbmcoMCwgYmFzZTY0Lmxlbmd0aCAtIDEpICsgIj0iOwogICAgfSBlbHNlIGlmIChsZW4gJSAzID09PSAxKSB7CiAgICAgIGJhc2U2NCA9IGJhc2U2NC5zdWJzdHJpbmcoMCwgYmFzZTY0Lmxlbmd0aCAtIDIpICsgIj09IjsKICAgIH0KICAgIHJldHVybiBiYXNlNjQ7CiAgfTsKICBjb25zdCBsYXN0QmxvYk1hcCA9IC8qIEBfX1BVUkVfXyAqLyBuZXcgTWFwKCk7CiAgY29uc3QgdHJhbnNwYXJlbnRCbG9iTWFwID0gLyogQF9fUFVSRV9fICovIG5ldyBNYXAoKTsKICBhc3luYyBmdW5jdGlvbiBnZXRUcmFuc3BhcmVudEJsb2JGb3Iod2lkdGgsIGhlaWdodCwgZGF0YVVSTE9wdGlvbnMpIHsKICAgIGNvbnN0IGlkID0gYCR7d2lkdGh9LSR7aGVpZ2h0fWA7CiAgICBpZiAoIk9mZnNjcmVlbkNhbnZhcyIgaW4gZ2xvYmFsVGhpcykgewogICAgICBpZiAodHJhbnNwYXJlbnRCbG9iTWFwLmhhcyhpZCkpIHJldHVybiB0cmFuc3BhcmVudEJsb2JNYXAuZ2V0KGlkKTsKICAgICAgY29uc3Qgb2Zmc2NyZWVuID0gbmV3IE9mZnNjcmVlbkNhbnZhcyh3aWR0aCwgaGVpZ2h0KTsKICAgICAgb2Zmc2NyZWVuLmdldENvbnRleHQoIjJkIik7CiAgICAgIGNvbnN0IGJsb2IgPSBhd2FpdCBvZmZzY3JlZW4uY29udmVydFRvQmxvYihkYXRhVVJMT3B0aW9ucyk7CiAgICAgIGNvbnN0IGFycmF5QnVmZmVyID0gYXdhaXQgYmxvYi5hcnJheUJ1ZmZlcigpOwogICAgICBjb25zdCBiYXNlNjQgPSBlbmNvZGUoYXJyYXlCdWZmZXIpOwogICAgICB0cmFuc3BhcmVudEJsb2JNYXAuc2V0KGlkLCBiYXNlNjQpOwogICAgICByZXR1cm4gYmFzZTY0OwogICAgfSBlbHNlIHsKICAgICAgcmV0dXJuICIiOwogICAgfQogIH0KICBjb25zdCB3b3JrZXIgPSBzZWxmOwogIHdvcmtlci5vbm1lc3NhZ2UgPSBhc3luYyBmdW5jdGlvbihlKSB7CiAgICBpZiAoIk9mZnNjcmVlbkNhbnZhcyIgaW4gZ2xvYmFsVGhpcykgewogICAgICBjb25zdCB7IGlkLCBiaXRtYXAsIHdpZHRoLCBoZWlnaHQsIGRhdGFVUkxPcHRpb25zIH0gPSBlLmRhdGE7CiAgICAgIGNvbnN0IHRyYW5zcGFyZW50QmFzZTY0ID0gZ2V0VHJhbnNwYXJlbnRCbG9iRm9yKAogICAgICAgIHdpZHRoLAogICAgICAgIGhlaWdodCwKICAgICAgICBkYXRhVVJMT3B0aW9ucwogICAgICApOwogICAgICBjb25zdCBvZmZzY3JlZW4gPSBuZXcgT2Zmc2NyZWVuQ2FudmFzKHdpZHRoLCBoZWlnaHQpOwogICAgICBjb25zdCBjdHggPSBvZmZzY3JlZW4uZ2V0Q29udGV4dCgiMmQiKTsKICAgICAgY3R4LmRyYXdJbWFnZShiaXRtYXAsIDAsIDApOwogICAgICBiaXRtYXAuY2xvc2UoKTsKICAgICAgY29uc3QgYmxvYiA9IGF3YWl0IG9mZnNjcmVlbi5jb252ZXJ0VG9CbG9iKGRhdGFVUkxPcHRpb25zKTsKICAgICAgY29uc3QgdHlwZSA9IGJsb2IudHlwZTsKICAgICAgY29uc3QgYXJyYXlCdWZmZXIgPSBhd2FpdCBibG9iLmFycmF5QnVmZmVyKCk7CiAgICAgIGNvbnN0IGJhc2U2NCA9IGVuY29kZShhcnJheUJ1ZmZlcik7CiAgICAgIGlmICghbGFzdEJsb2JNYXAuaGFzKGlkKSAmJiBhd2FpdCB0cmFuc3BhcmVudEJhc2U2NCA9PT0gYmFzZTY0KSB7CiAgICAgICAgbGFzdEJsb2JNYXAuc2V0KGlkLCBiYXNlNjQpOwogICAgICAgIHJldHVybiB3b3JrZXIucG9zdE1lc3NhZ2UoeyBpZCB9KTsKICAgICAgfQogICAgICBpZiAobGFzdEJsb2JNYXAuZ2V0KGlkKSA9PT0gYmFzZTY0KSByZXR1cm4gd29ya2VyLnBvc3RNZXNzYWdlKHsgaWQgfSk7CiAgICAgIHdvcmtlci5wb3N0TWVzc2FnZSh7CiAgICAgICAgaWQsCiAgICAgICAgdHlwZSwKICAgICAgICBiYXNlNjQsCiAgICAgICAgd2lkdGgsCiAgICAgICAgaGVpZ2h0CiAgICAgIH0pOwogICAgICBsYXN0QmxvYk1hcC5zZXQoaWQsIGJhc2U2NCk7CiAgICB9IGVsc2UgewogICAgICByZXR1cm4gd29ya2VyLnBvc3RNZXNzYWdlKHsgaWQ6IGUuZGF0YS5pZCB9KTsKICAgIH0KICB9Owp9KSgpOwovLyMgc291cmNlTWFwcGluZ1VSTD1pbWFnZS1iaXRtYXAtZGF0YS11cmwtd29ya2VyLUlKcEM3Z19iLmpzLm1hcAo=")],{type:"text/javascript;charset=utf-8"});try{if(2!==Array.from([1],(e=>2*e))[0]){var Tn=document.createElement("iframe");document.body.appendChild(Tn),Array.from=(null==($t=Tn.contentWindow)?void 0:$t.Array.from)||Array.from,document.body.removeChild(Tn)}}catch(e){console.debug("Unable to override Array.from",e)}new rn,function(e){e[e.NotStarted=0]="NotStarted",e[e.Running=1]="Running",e[e.Stopped=2]="Stopped"}(xn||(xn={}));class Mn{constructor(e){Vt(this,"fileName"),Vt(this,"functionName"),Vt(this,"lineNumber"),Vt(this,"columnNumber"),this.fileName=e.fileName||"",this.functionName=e.functionName||"",this.lineNumber=e.lineNumber,this.columnNumber=e.columnNumber}toString(){var e=this.lineNumber||"",t=this.columnNumber||"";return this.functionName?"".concat(this.functionName," (").concat(this.fileName,":").concat(e,":").concat(t,")"):"".concat(this.fileName,":").concat(e,":").concat(t)}}var Rn=/(^|@)\S+:\d+/,An=/^\s*at .*(\S+:\d+|\(native\))/m,Nn=/^(eval@)?(\[native code])?$/,Fn={parse:function(e){return e?void 0!==e.stacktrace||void 0!==e["opera#sourceloc"]?this.parseOpera(e):e.stack&&e.stack.match(An)?this.parseV8OrIE(e):e.stack?this.parseFFOrSafari(e):(console.warn("[console-record-plugin]: Failed to parse error object:",e),[]):[]},extractLocation:function(e){if(-1===e.indexOf(":"))return[e];var t=/(.+?)(?::(\d+))?(?::(\d+))?$/.exec(e.replace(/[()]/g,""));if(!t)throw new Error("Cannot parse given url: ".concat(e));return[t[1],t[2]||void 0,t[3]||void 0]},parseV8OrIE:function(e){return e.stack.split("\n").filter((function(e){return!!e.match(An)}),this).map((function(e){e.indexOf("(eval ")>-1&&(e=e.replace(/eval code/g,"eval").replace(/(\(eval at [^()]*)|(\),.*$)/g,""));var t=e.replace(/^\s+/,"").replace(/\(eval code/g,"("),n=t.match(/ (\((.+):(\d+):(\d+)\)$)/),r=(t=n?t.replace(n[0],""):t).split(/\s+/).slice(1),i=this.extractLocation(n?n[1]:r.pop()),o=r.join(" ")||void 0,s=["eval","<anonymous>"].indexOf(i[0])>-1?void 0:i[0];return new Mn({functionName:o,fileName:s,lineNumber:i[1],columnNumber:i[2]})}),this)},parseFFOrSafari:function(e){return e.stack.split("\n").filter((function(e){return!e.match(Nn)}),this).map((function(e){if(e.indexOf(" > eval")>-1&&(e=e.replace(/ line (\d+)(?: > eval line \d+)* > eval:\d+:\d+/g,":$1")),-1===e.indexOf("@")&&-1===e.indexOf(":"))return new Mn({functionName:e});var t=/((.*".+"[^@]*)?[^@]*)(?:@)/,n=e.match(t),r=n&&n[1]?n[1]:void 0,i=this.extractLocation(e.replace(t,""));return new Mn({functionName:r,fileName:i[0],lineNumber:i[1],columnNumber:i[2]})}),this)},parseOpera:function(e){return!e.stacktrace||e.message.indexOf("\n")>-1&&e.message.split("\n").length>e.stacktrace.split("\n").length?this.parseOpera9(e):e.stack?this.parseOpera11(e):this.parseOpera10(e)},parseOpera9:function(e){for(var t=/Line (\d+).*script (?:in )?(\S+)/i,n=e.message.split("\n"),r=[],i=2,o=n.length;i<o;i+=2){var s=t.exec(n[i]);s&&r.push(new Mn({fileName:s[2],lineNumber:parseFloat(s[1])}))}return r},parseOpera10:function(e){for(var t=/Line (\d+).*script (?:in )?(\S+)(?:: In function (\S+))?$/i,n=e.stacktrace.split("\n"),r=[],i=0,o=n.length;i<o;i+=2){var s=t.exec(n[i]);s&&r.push(new Mn({functionName:s[3]||void 0,fileName:s[2],lineNumber:parseFloat(s[1])}))}return r},parseOpera11:function(e){return e.stack.split("\n").filter((function(e){return!!e.match(Rn)&&!e.match(/^Error created at/)}),this).map((function(e){var t=e.split("@"),n=this.extractLocation(t.pop()),r=(t.shift()||"").replace(/<anonymous function(: (\w+))?>/,"$2").replace(/\([^)]*\)/g,"")||void 0;return new Mn({functionName:r,fileName:n[0],lineNumber:n[1],columnNumber:n[2]})}),this)}};function On(e){if(!e||!e.outerHTML)return"";for(var t="";e.parentElement;){var n=e.localName;if(!n)break;n=n.toLowerCase();var r=e.parentElement,i=[];if(r.children&&r.children.length>0)for(var o=0;o<r.children.length;o++){var s=r.children[o];s.localName&&s.localName.toLowerCase&&s.localName.toLowerCase()===n&&i.push(s)}i.length>1&&(n+=":eq(".concat(i.indexOf(e),")")),t=n+(t?">"+t:""),e=r}return t}function Pn(e){return"[object Object]"===Object.prototype.toString.call(e)}function Ln(e,t){if(0===t)return!0;var n=Object.keys(e);for(var r of n)if(Pn(e[r])&&Ln(e[r],t-1))return!0;return!1}function Dn(e,t){var n={numOfKeysLimit:50,depthOfLimit:4};Object.assign(n,t);var r=[],i=[];return JSON.stringify(e,(function(e,t){if(r.length>0){var o=r.indexOf(this);~o?r.splice(o+1):r.push(this),~o?i.splice(o,1/0,e):i.push(e),~r.indexOf(t)&&(t=r[0]===t?"[Circular ~]":"[Circular ~."+i.slice(0,r.indexOf(t)).join(".")+"]")}else r.push(t);if(null===t)return t;if(void 0===t)return"undefined";if(function(e){if(Pn(e)&&Object.keys(e).length>n.numOfKeysLimit)return!0;if("function"==typeof e)return!0;if(Pn(e)&&Ln(e,n.depthOfLimit))return!0;return!1}(t))return function(e){var t=e.toString();n.stringLengthLimit&&t.length>n.stringLengthLimit&&(t="".concat(t.slice(0,n.stringLengthLimit),"..."));return t}(t);if("bigint"==typeof t)return t.toString()+"n";if(t instanceof Event){var s={};for(var a in t){var l=t[a];Array.isArray(l)?s[a]=On(l.length?l[0]:null):s[a]=l}return s}return t instanceof Node?t instanceof HTMLElement?t?t.outerHTML:"":t.nodeName:t instanceof Error?t.stack?t.stack+"\nEnd of stack for Error object":t.name+": "+t.message:t}))}var Bn={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 Hn(e,t,n){var r,i=n?Object.assign({},Bn,n):Bn,o=i.logger;if(!o)return()=>{};r="string"==typeof o?t[o]:o;var s=0,a=!1,l=[];if(i.level.includes("error")){var c=t=>{var n=t.message,r=t.error,o=Fn.parse(r).map((e=>e.toString())),s=[Dn(n,i.stringifyOptions)];e({level:"error",trace:o,payload:s})};t.addEventListener("error",c),l.push((()=>{t.removeEventListener("error",c)}));var u=t=>{var n,r;t.reason instanceof Error?(n=t.reason,r=[Dn("Uncaught (in promise) ".concat(n.name,": ").concat(n.message),i.stringifyOptions)]):(n=new Error,r=[Dn("Uncaught (in promise)",i.stringifyOptions),Dn(t.reason,i.stringifyOptions)]);var o=Fn.parse(n).map((e=>e.toString()));e({level:"error",trace:o,payload:r})};t.addEventListener("unhandledrejection",u),l.push((()=>{t.removeEventListener("unhandledrejection",u)}))}for(var d of i.level)l.push(h(r,d));return()=>{l.forEach((e=>e()))};function h(t,n){var r=this;return t[n]?Cn.patch(t,n,(t=>function(){for(var o=arguments.length,l=new Array(o),c=0;c<o;c++)l[c]=arguments[c];if(t.apply(r,l),!("assert"===n&&l[0]||a)){a=!0;try{var u=Fn.parse(new Error).map((e=>e.toString())).splice(1),d=("assert"===n?l.slice(1):l).map((e=>Dn(e,i.stringifyOptions)));++s<i.lengthThreshold?e({level:n,trace:u,payload:d}):s===i.lengthThreshold&&e({level:"warn",trace:[],payload:[Dn("The number of log records reached the threshold.")]})}catch(e){t("rrweb logger error:",e,...l)}finally{a=!1}}})):()=>{}}}var qn,$n=e=>({name:"rrweb/console@1",observer:Hn,options:e}),Wn="undefined"!=typeof window?window:void 0,Vn="undefined"!=typeof globalThis?globalThis:Wn,Zn=Array.prototype,Gn=Zn.forEach,Un=Zn.indexOf,jn=null==Vn?void 0:Vn.navigator,zn=null==Vn?void 0:Vn.document,Yn=null==Vn?void 0:Vn.location,Xn=null==Vn?void 0:Vn.fetch,Jn=null!=Vn&&Vn.XMLHttpRequest&&"withCredentials"in new Vn.XMLHttpRequest?Vn.XMLHttpRequest:void 0,Kn=null==Vn?void 0:Vn.AbortController,Qn=null==jn?void 0:jn.userAgent,er=null!=Wn?Wn:{},tr="$copy_autocapture",nr=["$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(e){e.GZipJS="gzip-js",e.Base64="base64"}(qn||(qn={}));var rr=["fatal","error","warning","log","info","debug"];function ir(e,t){return-1!==e.indexOf(t)}var or=function(e){return e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"")},sr=function(e){return e.replace(/^\$/,"")};var ar=Array.isArray,lr=Object.prototype,cr=lr.hasOwnProperty,ur=lr.toString,dr=ar||function(e){return"[object Array]"===ur.call(e)},hr=e=>"function"==typeof e,pr=e=>hr(e)&&-1!==e.toString().indexOf("[native code]"),vr=()=>!!Wn.Zone,gr=e=>e===Object(e)&&!dr(e),fr=e=>{if(gr(e)){for(var t in e)if(cr.call(e,t))return!1;return!0}return!1},mr=e=>void 0===e,_r=e=>"[object String]"==ur.call(e),yr=e=>_r(e)&&0===e.trim().length,br=e=>null===e,wr=e=>mr(e)||br(e),Sr=e=>"[object Number]"==ur.call(e),Cr=e=>"[object Boolean]"===ur.call(e),Ir=e=>e instanceof Document,kr=e=>e instanceof FormData,Er=e=>ir(nr,e),xr={DEBUG:!1,LIB_VERSION:"1.211.1"},Tr=e=>{var t={_log:function(t){if(Wn&&(xr.DEBUG||er.POSTHOG_DEBUG)&&!mr(Wn.console)&&Wn.console){for(var n=("__rrweb_original__"in Wn.console[t]?Wn.console[t].__rrweb_original__:Wn.console[t]),r=arguments.length,i=new Array(r>1?r-1:0),o=1;o<r;o++)i[o-1]=arguments[o];n(e,...i)}},info:function(){for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];t._log("log",...n)},warn:function(){for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];t._log("warn",...n)},error:function(){for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];t._log("error",...n)},critical:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];console.error(e,...n)},uninitializedWarning:e=>{t.error("You must initialize PostHog before calling ".concat(e))},createLogger:t=>Tr("".concat(e," ").concat(t))};return t},Mr=Tr("[PostHog.js]"),Rr=Mr.createLogger,Ar={};function Nr(e,t,n){if(dr(e))if(Gn&&e.forEach===Gn)e.forEach(t,n);else if("length"in e&&e.length===+e.length)for(var r=0,i=e.length;r<i;r++)if(r in e&&t.call(n,e[r],r)===Ar)return}function Fr(e,t,n){if(!wr(e)){if(dr(e))return Nr(e,t,n);if(kr(e)){for(var r of e.entries())if(t.call(n,r[1],r[0])===Ar)return}else for(var i in e)if(cr.call(e,i)&&t.call(n,e[i],i)===Ar)return}}var Or=function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];return Nr(n,(function(t){for(var n in t)void 0!==t[n]&&(e[n]=t[n])})),e},Pr=function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];return Nr(n,(function(t){Nr(t,(function(t){e.push(t)}))})),e};function Lr(e){for(var t=Object.keys(e),n=t.length,r=new Array(n);n--;)r[n]=[t[n],e[t[n]]];return r}var Dr=function(e){try{return e()}catch(e){return}},Br=function(e){return function(){try{for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return e.apply(this,n)}catch(e){Mr.critical("Implementation error. Please turn on debug mode and open a ticket on https://app.posthog.com/home#panel=support%3Asupport%3A."),Mr.critical(e)}}},Hr=function(e){var t={};return Fr(e,(function(e,n){_r(e)&&e.length>0&&(t[n]=e)})),t};function qr(e,t){return n=e,r=e=>_r(e)&&!br(t)?e.slice(0,t):e,i=new Set,function e(t,n){return t!==Object(t)?r?r(t,n):t:i.has(t)?void 0:(i.add(t),dr(t)?(o=[],Nr(t,(t=>{o.push(e(t))}))):(o={},Fr(t,((t,n)=>{i.has(t)||(o[n]=e(t,n))}))),o);var o}(n);var n,r,i}var $r=function(){function e(t){return t&&(t.preventDefault=e.preventDefault,t.stopPropagation=e.stopPropagation),t}return e.preventDefault=function(){this.returnValue=!1},e.stopPropagation=function(){this.cancelBubble=!0},function(t,n,r,i,o){if(t)if(t.addEventListener&&!i)t.addEventListener(n,r,!!o);else{var s="on"+n,a=t[s];t[s]=function(t,n,r){return function(i){if(i=i||e(null==Wn?void 0:Wn.event)){var o,s=!0;hr(r)&&(o=r(i));var a=n.call(t,i);return!1!==o&&!1!==a||(s=!1),s}}}(t,r,a)}else Mr.error("No valid element provided to register_event")}}(),Wr=["herokuapp.com","vercel.app","netlify.app"];function Vr(e){var t=null==e?void 0:e.hostname;if(!_r(t))return!1;var n=t.split(".").slice(-2).join(".");for(var r of Wr)if(n===r)return!1;return!0}function Zr(e,t){for(var n=0;n<e.length;n++)if(t(e[n]))return e[n]}var Gr=["localhost","127.0.0.1"],Ur=e=>{var t=null==zn?void 0:zn.createElement("a");return mr(t)?null:(t.href=e,t)},jr=function(e,t){return!!function(e){try{new RegExp(e)}catch(e){return!1}return!0}(t)&&new RegExp(t).test(e)},zr=function(e){var t,n,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"&",i=[];return Fr(e,(function(e,r){mr(e)||mr(r)||"undefined"===r||(t=encodeURIComponent((e=>e instanceof File)(e)?e.name:e.toString()),n=encodeURIComponent(r),i[i.length]=n+"="+t)})),i.join(r)},Yr=function(e,t){for(var n,r=((e.split("#")[0]||"").split("?")[1]||"").split("&"),i=0;i<r.length;i++){var o=r[i].split("=");if(o[0]===t){n=o;break}}if(!dr(n)||n.length<2)return"";var s=n[1];try{s=decodeURIComponent(s)}catch(e){Mr.error("Skipping decoding for malformed query param: "+s)}return s.replace(/\+/g," ")},Xr=function(e,t,n){if(!e||!t||!t.length)return e;for(var r=e.split("#"),i=r[0]||"",o=r[1],s=i.split("?"),a=s[1],l=s[0],c=(a||"").split("&"),u=[],d=0;d<c.length;d++){var h=c[d].split("=");dr(h)&&(t.includes(h[0])?u.push(h[0]+"="+n):u.push(c[d]))}var p=l;return null!=a&&(p+="?"+u.join("&")),null!=o&&(p+="#"+o),p},Jr=function(e,t){var n=e.match(new RegExp(t+"=([^&]*)"));return n?n[1]:null},Kr="$people_distinct_id",Qr="__alias",ei="__timers",ti="$autocapture_disabled_server_side",ni="$heatmaps_enabled_server_side",ri="$exception_capture_enabled_server_side",ii="$web_vitals_enabled_server_side",oi="$dead_clicks_enabled_server_side",si="$web_vitals_allowed_metrics",ai="$session_recording_enabled_server_side",li="$console_log_recording_enabled_server_side",ci="$session_recording_network_payload_capture",ui="$session_recording_canvas_recording",di="$replay_sample_rate",hi="$replay_minimum_duration",pi="$replay_script_config",vi="$sesid",gi="$session_is_sampled",fi="$session_recording_url_trigger_activated_session",mi="$session_recording_event_trigger_activated_session",_i="$enabled_feature_flags",yi="$early_access_features",bi="$stored_person_properties",wi="$stored_group_properties",Si="$surveys",Ci="$surveys_activated",Ii="$flag_call_reported",ki="$user_state",Ei="$client_session_props",xi="$capture_rate_limit",Ti="$initial_campaign_params",Mi="$initial_referrer_info",Ri="$initial_person_info",Ai="$epp",Ni="__POSTHOG_TOOLBAR__",Fi="$posthog_cookieless",Oi=[Kr,Qr,"__cmpns",ei,ai,ni,vi,_i,ki,yi,wi,bi,Si,Ii,Ei,xi,Ti,Mi,Ai];function Pi(e){var t;return e instanceof Element&&(e.id===Ni||!(null===(t=e.closest)||void 0===t||!t.call(e,".toolbar-global-fade-container")))}function Li(e){return!!e&&1===e.nodeType}function Di(e,t){return!!e&&!!e.tagName&&e.tagName.toLowerCase()===t.toLowerCase()}function Bi(e){return!!e&&3===e.nodeType}function Hi(e){return!!e&&11===e.nodeType}function qi(e){return e?or(e).split(/\s+/):[]}function $i(e){var t=null==Wn?void 0:Wn.location.href;return!!(t&&e&&e.some((e=>t.match(e))))}function Wi(e){var t="";switch(typeof e.className){case"string":t=e.className;break;case"object":t=(e.className&&"baseVal"in e.className?e.className.baseVal:null)||e.getAttribute("class")||"";break;default:t=""}return qi(t)}function Vi(e){return wr(e)?null:or(e).split(/(\s+)/).filter((e=>ro(e))).join("").replace(/[\r\n]/g," ").replace(/[ ]+/g," ").substring(0,255)}function Zi(e){var t="";return Yi(e)&&!Xi(e)&&e.childNodes&&e.childNodes.length&&Fr(e.childNodes,(function(e){var n;Bi(e)&&e.textContent&&(t+=null!==(n=Vi(e.textContent))&&void 0!==n?n:"")})),or(t)}function Gi(e){return mr(e.target)?e.srcElement||null:null!==(t=e.target)&&void 0!==t&&t.shadowRoot?e.composedPath()[0]||null:e.target||null;var t}var Ui=["a","button","form","input","select","textarea","label"];function ji(e){var t=e.parentNode;return!(!t||!Li(t))&&t}function zi(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:void 0,r=arguments.length>3?arguments[3]:void 0,i=arguments.length>4?arguments[4]:void 0;if(!Wn||!e||Di(e,"html")||!Li(e))return!1;if(null!=n&&n.url_allowlist&&!$i(n.url_allowlist))return!1;if(null!=n&&n.url_ignorelist&&$i(n.url_ignorelist))return!1;if(null!=n&&n.dom_event_allowlist){var o=n.dom_event_allowlist;if(o&&!o.some((e=>t.type===e)))return!1}for(var s=!1,a=[e],l=!0,c=e;c.parentNode&&!Di(c,"body");)if(Hi(c.parentNode))a.push(c.parentNode.host),c=c.parentNode.host;else{if(!(l=ji(c)))break;if(r||Ui.indexOf(l.tagName.toLowerCase())>-1)s=!0;else{var u=Wn.getComputedStyle(l);u&&"pointer"===u.getPropertyValue("cursor")&&(s=!0)}a.push(l),c=l}if(!function(e,t){var n=null==t?void 0:t.element_allowlist;if(mr(n))return!0;var r=function(e){if(n.some((t=>e.tagName.toLowerCase()===t)))return{v:!0}};for(var i of e){var o=r(i);if("object"==typeof o)return o.v}return!1}(a,n))return!1;if(!function(e,t){var n=null==t?void 0:t.css_selector_allowlist;if(mr(n))return!0;var r=function(e){if(n.some((t=>e.matches(t))))return{v:!0}};for(var i of e){var o=r(i);if("object"==typeof o)return o.v}return!1}(a,n))return!1;var d=Wn.getComputedStyle(e);if(d&&"pointer"===d.getPropertyValue("cursor")&&"click"===t.type)return!0;var h=e.tagName.toLowerCase();switch(h){case"html":return!1;case"form":return(i||["submit"]).indexOf(t.type)>=0;case"input":case"select":case"textarea":return(i||["change","click"]).indexOf(t.type)>=0;default:return s?(i||["click"]).indexOf(t.type)>=0:(i||["click"]).indexOf(t.type)>=0&&(Ui.indexOf(h)>-1||"true"===e.getAttribute("contenteditable"))}}function Yi(e){for(var t=e;t.parentNode&&!Di(t,"body");t=t.parentNode){var n=Wi(t);if(ir(n,"ph-sensitive")||ir(n,"ph-no-capture"))return!1}if(ir(Wi(e),"ph-include"))return!0;var r=e.type||"";if(_r(r))switch(r.toLowerCase()){case"hidden":case"password":return!1}var i=e.name||e.id||"";if(_r(i)){if(/^cc|cardnum|ccnum|creditcard|csc|cvc|cvv|exp|pass|pwd|routing|seccode|securitycode|securitynum|socialsec|socsec|ssn/i.test(i.replace(/[^a-zA-Z0-9]/g,"")))return!1}return!0}function Xi(e){return!!(Di(e,"input")&&!["button","checkbox","submit","reset"].includes(e.type)||Di(e,"select")||Di(e,"textarea")||"true"===e.getAttribute("contenteditable"))}var Ji="(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})",Ki=new RegExp("^(?:".concat(Ji,")$")),Qi=new RegExp(Ji),eo="\\d{3}-?\\d{2}-?\\d{4}",to=new RegExp("^(".concat(eo,")$")),no=new RegExp("(".concat(eo,")"));function ro(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if(wr(e))return!1;if(_r(e)){if(e=or(e),(t?Ki:Qi).test((e||"").replace(/[- ]/g,"")))return!1;if((t?to:no).test(e))return!1}return!0}function io(e){var t=Zi(e);return ro(t="".concat(t," ").concat(oo(e)).trim())?t:""}function oo(e){var t="";return e&&e.childNodes&&e.childNodes.length&&Fr(e.childNodes,(function(e){var n;if(e&&"span"===(null===(n=e.tagName)||void 0===n?void 0:n.toLowerCase()))try{var r=Zi(e);t="".concat(t," ").concat(r).trim(),e.childNodes&&e.childNodes.length&&(t="".concat(t," ").concat(oo(e)).trim())}catch(e){Mr.error("[AutoCapture]",e)}})),t}function so(e){return function(e){var n=e.map((e=>{var n,r,i="";if(e.tag_name&&(i+=e.tag_name),e.attr_class)for(var o of(e.attr_class.sort(),e.attr_class))i+=".".concat(o.replace(/"/g,""));var s=t(t(t(t({},e.text?{text:e.text}:{}),{},{"nth-child":null!==(n=e.nth_child)&&void 0!==n?n:0,"nth-of-type":null!==(r=e.nth_of_type)&&void 0!==r?r:0},e.href?{href:e.href}:{}),e.attr_id?{attr_id:e.attr_id}:{}),e.attributes),a={};return Lr(s).sort(((e,t)=>{var[n]=e,[r]=t;return n.localeCompare(r)})).forEach((e=>{var[t,n]=e;return a[ao(t.toString())]=ao(n.toString())})),i+=":",i+=Lr(s).map((e=>{var[t,n]=e;return"".concat(t,'="').concat(n,'"')})).join("")}));return n.join(";")}(function(e){return e.map((e=>{var t,n,r={text:null===(t=e.$el_text)||void 0===t?void 0:t.slice(0,400),tag_name:e.tag_name,href:null===(n=e.attr__href)||void 0===n?void 0:n.slice(0,2048),attr_class:lo(e),attr_id:e.attr__id,nth_child:e.nth_child,nth_of_type:e.nth_of_type,attributes:{}};return Lr(e).filter((e=>{var[t]=e;return 0===t.indexOf("attr__")})).forEach((e=>{var[t,n]=e;return r.attributes[t]=n})),r}))}(e))}function ao(e){return e.replace(/"|\\"/g,'\\"')}function lo(e){var t=e.attr__class;return t?dr(t)?t:qi(t):void 0}var co="[SessionRecording]",uo="redacted",ho={initiatorTypes:["audio","beacon","body","css","early-hint","embed","fetch","frame","iframe","icon","image","img","input","link","navigation","object","ping","script","track","video","xmlhttprequest"],maskRequestFn:e=>e,recordHeaders:!1,recordBody:!1,recordInitialRequests:!1,recordPerformance:!1,performanceEntryTypeToObserve:["first-input","navigation","paint","resource"],payloadSizeLimitBytes:1e6,payloadHostDenyList:[".lr-ingest.io",".ingest.sentry.io",".clarity.ms","analytics.google.com"]},po=["authorization","x-forwarded-for","authorization","cookie","set-cookie","x-api-key","x-real-ip","remote-addr","forwarded","proxy-authorization","x-csrf-token","x-csrftoken","x-xsrf-token"],vo=["password","secret","passwd","api_key","apikey","auth","credentials","mysql_pwd","privatekey","private_key","token"],go=["/s/","/e/","/i/"];function fo(e,t,n,r){if(wr(e))return e;var i=(null==t?void 0:t["content-length"])||function(e){return new Blob([e]).size}(e);return _r(i)&&(i=parseInt(i)),i>n?co+" ".concat(r," body too large to record (").concat(i," bytes)"):e}function mo(e,t){if(wr(e))return e;var n=e;return ro(n,!1)||(n=co+" "+t+" body "+uo),Fr(vo,(e=>{var r,i;null!==(r=n)&&void 0!==r&&r.length&&-1!==(null===(i=n)||void 0===i?void 0:i.indexOf(e))&&(n=co+" "+t+" body "+uo+" as might contain: "+e)})),n}var _o=(e,n)=>{var r,i,o,s={payloadSizeLimitBytes:ho.payloadSizeLimitBytes,performanceEntryTypeToObserve:[...ho.performanceEntryTypeToObserve],payloadHostDenyList:[...n.payloadHostDenyList||[],...ho.payloadHostDenyList]},a=!1!==e.session_recording.recordHeaders&&n.recordHeaders,l=!1!==e.session_recording.recordBody&&n.recordBody,c=!1!==e.capture_performance&&n.recordPerformance,u=(r=s,o=Math.min(1e6,null!==(i=r.payloadSizeLimitBytes)&&void 0!==i?i:1e6),e=>(null!=e&&e.requestBody&&(e.requestBody=fo(e.requestBody,e.requestHeaders,o,"Request")),null!=e&&e.responseBody&&(e.responseBody=fo(e.responseBody,e.responseHeaders,o,"Response")),e)),d=t=>{return u(((e,t)=>{var n,r=Ur(e.name),i=0===t.indexOf("http")?null===(n=Ur(t))||void 0===n?void 0:n.pathname:t;"/"===i&&(i="");var o=null==r?void 0:r.pathname.replace(i||"","");if(!(r&&o&&go.some((e=>0===o.indexOf(e)))))return e})((r=(n=t).requestHeaders,wr(r)||Fr(Object.keys(null!=r?r:{}),(e=>{po.includes(e.toLowerCase())&&(r[e]=uo)})),n),e.api_host));var n,r},h=hr(e.session_recording.maskNetworkRequestFn);return h&&hr(e.session_recording.maskCapturedNetworkRequestFn)&&Mr.warn("Both `maskNetworkRequestFn` and `maskCapturedNetworkRequestFn` are defined. `maskNetworkRequestFn` will be ignored."),h&&(e.session_recording.maskCapturedNetworkRequestFn=n=>{var r=e.session_recording.maskNetworkRequestFn({url:n.name});return t(t({},n),{},{name:null==r?void 0:r.url})}),s.maskRequestFn=hr(e.session_recording.maskCapturedNetworkRequestFn)?t=>{var n,r,i,o=d(t);return o&&null!==(n=null===(r=(i=e.session_recording).maskCapturedNetworkRequestFn)||void 0===r?void 0:r.call(i,o))&&void 0!==n?n:void 0}:e=>function(e){if(!mr(e))return e.requestBody=mo(e.requestBody,"Request"),e.responseBody=mo(e.responseBody,"Response"),e}(d(e)),t(t(t({},ho),s),{},{recordHeaders:a,recordBody:l,recordPerformance:c,recordInitialRequests:c})};function yo(e,t,n){try{if(!(t in e))return()=>{};var r=e[t],i=n(r);return hr(i)&&(i.prototype=i.prototype||{},Object.defineProperties(i,{__posthog_wrapped__:{enumerable:!1,value:!0}})),e[t]=i,()=>{e[t]=r}}catch(e){return()=>{}}}function bo(e,t){var n,r=function(e){try{return"string"==typeof e?new URL(e).hostname:"url"in e?new URL(e.url).hostname:e.hostname}catch(e){return null}}(e),i={hostname:r,isHostDenied:!1};if(null===(n=t.payloadHostDenyList)||void 0===n||!n.length||null==r||!r.trim().length)return i;for(var o of t.payloadHostDenyList)if(r.endsWith(o))return{hostname:r,isHostDenied:!0};return i}var wo=Rr("[Recorder]"),So=e=>"navigation"===e.entryType,Co=e=>"resource"===e.entryType;function Io(e,t,n){if(n.recordInitialRequests){var r=t.performance.getEntries().filter((e=>So(e)||Co(e)&&n.initiatorTypes.includes(e.initiatorType)));e({requests:r.flatMap((e=>Ao({entry:e,method:void 0,status:void 0,networkRequest:{},isInitial:!0}))),isInitial:!0})}var i=new t.PerformanceObserver((t=>{var r=t.getEntries().filter((e=>So(e)||Co(e)&&n.initiatorTypes.includes(e.initiatorType)&&(e=>!n.recordBody&&!n.recordHeaders||"xmlhttprequest"!==e.initiatorType&&"fetch"!==e.initiatorType)(e)));e({requests:r.flatMap((e=>Ao({entry:e,method:void 0,status:void 0,networkRequest:{}})))})})),o=PerformanceObserver.supportedEntryTypes.filter((e=>n.performanceEntryTypeToObserve.includes(e)));return i.observe({entryTypes:o}),()=>{i.disconnect()}}function ko(e,t){return!!t&&(Cr(t)||t[e])}function Eo(e){var{type:t,recordBody:n,headers:r}=e;function i(e){var t=Object.keys(r).find((e=>"content-type"===e.toLowerCase())),n=t&&r[t];return e.some((e=>null==n?void 0:n.includes(e)))}if(!n)return!1;if(Cr(n))return!0;if(dr(n))return i(n);var o=n[t];return Cr(o)?o:i(o)}function xo(e,t,n,r,i){return To.apply(this,arguments)}function To(){return To=r((function*(e,t,n,r,i){var o=arguments.length>5&&void 0!==arguments[5]?arguments[5]:0;if(o>10)return wo.warn("Failed to get performance entry for request",{url:n,initiatorType:t}),null;var s=function(e,t){for(var n=e.length-1;n>=0;n-=1)if(t(e[n]))return e[n]}(e.performance.getEntriesByName(n),(e=>Co(e)&&e.initiatorType===t&&(mr(r)||e.startTime>=r)&&(mr(i)||e.startTime<=i)));return s||(yield new Promise((e=>setTimeout(e,50*o))),xo(e,t,n,r,i,o+1))})),To.apply(this,arguments)}function Mo(e){var{body:t,options:n,url:r}=e;if(wr(t))return null;var{hostname:i,isHostDenied:o}=bo(r,n);if(o)return i+" is in deny list";if(_r(t))return t;if(Ir(t))return t.textContent;if(kr(t))return zr(t);if(gr(t))try{return JSON.stringify(t)}catch(e){return"[SessionReplay] Failed to stringify response object"}return"[SessionReplay] Cannot read body of type "+toString.call(t)}var Ro=e=>!br(e)&&("navigation"===e.entryType||"resource"===e.entryType);function Ao(e){var{entry:n,method:r,status:i,networkRequest:o,isInitial:s,start:a,end:l,url:c,initiatorType:u}=e;a=n?n.startTime:a,l=n?n.responseEnd:l;var d=Math.floor(Date.now()-performance.now()),h=Math.floor(d+(a||0)),p=[t(t({},n?n.toJSON():{name:c}),{},{startTime:mr(a)?void 0:Math.round(a),endTime:mr(l)?void 0:Math.round(l),timeOrigin:d,timestamp:h,method:r,initiatorType:u||(n?n.initiatorType:void 0),status:i,requestHeaders:o.requestHeaders,requestBody:o.requestBody,responseHeaders:o.responseHeaders,responseBody:o.responseBody,isInitial:s})];if(Ro(n))for(var v of n.serverTiming||[])p.push({timeOrigin:d,timestamp:h,startTime:Math.round(n.startTime),name:v.name,duration:v.duration,entryType:"serverTiming"});return p}var No=["video/","audio/"];function Fo(e){return new Promise(((t,n)=>{var r=setTimeout((()=>t("[SessionReplay] Timeout while trying to read body")),500);try{e.clone().text().then((e=>t(e)),(e=>n(e))).finally((()=>clearTimeout(r)))}catch(e){clearTimeout(r),t("[SessionReplay] Failed to read body")}}))}function Oo(){return Oo=r((function*(e){var{r:t,options:n,url:r}=e,{hostname:i,isHostDenied:o}=bo(r,n);return o?Promise.resolve(i+" is in deny list"):Fo(t)})),Oo.apply(this,arguments)}function Po(){return Po=r((function*(e){var{r:t,options:n,url:r}=e,i=function(e){var t,{r:n,options:r,url:i}=e;if("chunked"===n.headers.get("Transfer-Encoding"))return"Chunked Transfer-Encoding is not supported";var o=null===(t=n.headers.get("Content-Type"))||void 0===t?void 0:t.toLowerCase(),s=No.some((e=>null==o?void 0:o.startsWith(e)));if(o&&s)return"Content-Type ".concat(o," is not supported");var{hostname:a,isHostDenied:l}=bo(i,r);return l?a+" is in deny list":null}({r:t,options:n,url:r});return br(i)?Fo(t):Promise.resolve(i)})),Po.apply(this,arguments)}function Lo(e,t,n){if(!n.initiatorTypes.includes("fetch"))return()=>{};var i=ko("request",n.recordHeaders),o=ko("response",n.recordHeaders),s=yo(t,"fetch",(s=>function(){var a=r((function*(r,a){var l,c,u,d=new Request(r,a),h={};try{var p={};d.headers.forEach(((e,t)=>{p[t]=e})),i&&(h.requestHeaders=p),Eo({type:"request",headers:p,url:r,recordBody:n.recordBody})&&(h.requestBody=yield function(e){return Oo.apply(this,arguments)}({r:d,options:n,url:r})),c=t.performance.now(),l=yield s(d),u=t.performance.now();var v={};return l.headers.forEach(((e,t)=>{v[t]=e})),o&&(h.responseHeaders=v),Eo({type:"response",headers:v,url:r,recordBody:n.recordBody})&&(h.responseBody=yield function(e){return Po.apply(this,arguments)}({r:l,options:n,url:r})),l}finally{xo(t,"fetch",d.url,c,u).then((t=>{var n,r=Ao({entry:t,method:d.method,status:null===(n=l)||void 0===n?void 0:n.status,networkRequest:h,start:c,end:u,url:d.url,initiatorType:"fetch"});e({requests:r})})).catch((()=>{}))}}));return function(e,t){return a.apply(this,arguments)}}()));return()=>{s()}}var Do=null;function Bo(e,n,r){if(!("performance"in n))return()=>{};if(Do)return wo.warn("Network observer already initialised, doing nothing"),()=>{};var i=r?Object.assign({},ho,r):ho,o=n=>{var r=[];n.requests.forEach((e=>{var t=i.maskRequestFn(e);t&&r.push(t)})),r.length>0&&e(t(t({},n),{},{requests:r}))},s=Io(o,n,i),a=()=>{},l=()=>{};return(i.recordHeaders||i.recordBody)&&(a=function(e,t,n){if(!n.initiatorTypes.includes("xmlhttprequest"))return()=>{};var r=ko("request",n.recordHeaders),i=ko("response",n.recordHeaders),o=yo(t.XMLHttpRequest.prototype,"open",(o=>function(s,a){var l,c,u=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],d=arguments.length>3?arguments[3]:void 0,h=arguments.length>4?arguments[4]:void 0,p=this,v=new Request(a),g={},f={},m=p.setRequestHeader.bind(p);p.setRequestHeader=(e,t)=>(f[e]=t,m(e,t)),r&&(g.requestHeaders=f);var _=p.send.bind(p);p.send=e=>(Eo({type:"request",headers:f,url:a,recordBody:n.recordBody})&&(g.requestBody=Mo({body:e,options:n,url:a})),l=t.performance.now(),_(e)),p.addEventListener("readystatechange",(()=>{if(p.readyState===p.DONE){c=t.performance.now();var r={};p.getAllResponseHeaders().trim().split(/[\r\n]+/).forEach((e=>{var t=e.split(": "),n=t.shift(),i=t.join(": ");n&&(r[n]=i)})),i&&(g.responseHeaders=r),Eo({type:"response",headers:r,url:a,recordBody:n.recordBody})&&(g.responseBody=Mo({body:p.response,options:n,url:a})),xo(t,"xmlhttprequest",v.url,l,c).then((t=>{var n=Ao({entry:t,method:s,status:null==p?void 0:p.status,networkRequest:g,start:l,end:c,url:a.toString(),initiatorType:"xmlhttprequest"});e({requests:n})})).catch((()=>{}))}})),o.call(p,s,a,u,d,h)}));return()=>{o()}}(o,n,i),l=Lo(o,n,i)),Do=()=>{s(),a(),l()}}var Ho,qo,$o,Wo=e=>({name:"rrweb/network@1",observer:Bo,options:e});er.__PosthogExtensions__=er.__PosthogExtensions__||{},er.__PosthogExtensions__.rrwebPlugins={getRecordConsolePlugin:$n,getRecordNetworkPlugin:Wo},er.__PosthogExtensions__.rrweb={record:qt,version:"v2"},er.rrweb={record:qt,version:"v2"},er.rrwebConsoleRecord={getRecordConsolePlugin:$n},er.getRecordNetworkPlugin=Wo,function(e){e.Popover="popover",e.API="api",e.Widget="widget"}(Ho||(Ho={})),function(e){e.Open="open",e.MultipleChoice="multiple_choice",e.SingleChoice="single_choice",e.Rating="rating",e.Link="link"}(qo||(qo={})),function(e){e.NextQuestion="next_question",e.End="end",e.ResponseBased="response_based",e.SpecificQuestion="specific_question"}($o||($o={}));var Vo,Zo,Go,Uo,jo,zo,Yo,Xo,Jo={},Ko=[],Qo=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,es=Array.isArray;function ts(e,t){for(var n in t)e[n]=t[n];return e}function ns(e){var t=e.parentNode;t&&t.removeChild(e)}function rs(e,t,n){var r,i,o,s={};for(o in t)"key"==o?r=t[o]:"ref"==o?i=t[o]:s[o]=t[o];if(arguments.length>2&&(s.children=arguments.length>3?Vo.call(arguments,2):n),"function"==typeof e&&null!=e.defaultProps)for(o in e.defaultProps)void 0===s[o]&&(s[o]=e.defaultProps[o]);return is(e,s,r,i,null)}function is(e,t,n,r,i){var o={type:e,props:t,key:n,ref:r,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,constructor:void 0,__v:null==i?++Go:i,__i:-1,__u:0};return null==i&&null!=Zo.vnode&&Zo.vnode(o),o}function os(e){return e.children}function ss(e,t){this.props=e,this.context=t}function as(e,t){if(null==t)return e.__?as(e.__,e.__i+1):null;for(var n;t<e.__k.length;t++)if(null!=(n=e.__k[t])&&null!=n.__e)return n.__e;return"function"==typeof e.type?as(e):null}function ls(e){var t,n;if(null!=(e=e.__)&&null!=e.__c){for(e.__e=e.__c.base=null,t=0;t<e.__k.length;t++)if(null!=(n=e.__k[t])&&null!=n.__e){e.__e=e.__c.base=n.__e;break}return ls(e)}}function cs(e){(!e.__d&&(e.__d=!0)&&Uo.push(e)&&!us.__r++||jo!==Zo.debounceRendering)&&((jo=Zo.debounceRendering)||zo)(us)}function us(){var e,t,n,r,i,o,s,a,l;for(Uo.sort(Yo);e=Uo.shift();)e.__d&&(t=Uo.length,r=void 0,o=(i=(n=e).__v).__e,a=[],l=[],(s=n.__P)&&((r=ts({},i)).__v=i.__v+1,Zo.vnode&&Zo.vnode(r),_s(s,r,i,n.__n,void 0!==s.ownerSVGElement,32&i.__u?[o]:null,a,null==o?as(i):o,!!(32&i.__u),l),r.__.__k[r.__i]=r,ys(a,r,l),r.__e!=o&&ls(r)),Uo.length>t&&Uo.sort(Yo));us.__r=0}function ds(e,t,n,r,i,o,s,a,l,c,u){var d,h,p,v,g,f=r&&r.__k||Ko,m=t.length;for(n.__d=l,function(e,t,n){var r,i,o,s,a,l=t.length,c=n.length,u=c,d=0;for(e.__k=[],r=0;r<l;r++)null!=(i=e.__k[r]=null==(i=t[r])||"boolean"==typeof i||"function"==typeof i?null:"string"==typeof i||"number"==typeof i||"bigint"==typeof i||i.constructor==String?is(null,i,null,null,i):es(i)?is(os,{children:i},null,null,null):void 0===i.constructor&&i.__b>0?is(i.type,i.props,i.key,i.ref?i.ref:null,i.__v):i)?(i.__=e,i.__b=e.__b+1,a=ps(i,n,s=r+d,u),i.__i=a,o=null,-1!==a&&(u--,(o=n[a])&&(o.__u|=131072)),null==o||null===o.__v?(-1==a&&d--,"function"!=typeof i.type&&(i.__u|=65536)):a!==s&&(a===s+1?d++:a>s?u>l-s?d+=a-s:d--:d=a<s&&a==s-1?a-s:0,a!==r+d&&(i.__u|=65536))):(o=n[r])&&null==o.key&&o.__e&&(o.__e==e.__d&&(e.__d=as(o)),ws(o,o,!1),n[r]=null,u--);if(u)for(r=0;r<c;r++)null!=(o=n[r])&&0==(131072&o.__u)&&(o.__e==e.__d&&(e.__d=as(o)),ws(o,o))}(n,t,f),l=n.__d,d=0;d<m;d++)null!=(p=n.__k[d])&&"boolean"!=typeof p&&"function"!=typeof p&&(h=-1===p.__i?Jo:f[p.__i]||Jo,p.__i=d,_s(e,p,h,i,o,s,a,l,c,u),v=p.__e,p.ref&&h.ref!=p.ref&&(h.ref&&bs(h.ref,null,p),u.push(p.ref,p.__c||v,p)),null==g&&null!=v&&(g=v),65536&p.__u||h.__k===p.__k?l=hs(p,l,e):"function"==typeof p.type&&void 0!==p.__d?l=p.__d:v&&(l=v.nextSibling),p.__d=void 0,p.__u&=-196609);n.__d=l,n.__e=g}function hs(e,t,n){var r,i;if("function"==typeof e.type){for(r=e.__k,i=0;r&&i<r.length;i++)r[i]&&(r[i].__=e,t=hs(r[i],t,n));return t}return e.__e!=t&&(n.insertBefore(e.__e,t||null),t=e.__e),t&&t.nextSibling}function ps(e,t,n,r){var i=e.key,o=e.type,s=n-1,a=n+1,l=t[n];if(null===l||l&&i==l.key&&o===l.type)return n;if(r>(null!=l&&0==(131072&l.__u)?1:0))for(;s>=0||a<t.length;){if(s>=0){if((l=t[s])&&0==(131072&l.__u)&&i==l.key&&o===l.type)return s;s--}if(a<t.length){if((l=t[a])&&0==(131072&l.__u)&&i==l.key&&o===l.type)return a;a++}}return-1}function vs(e,t,n){"-"===t[0]?e.setProperty(t,null==n?"":n):e[t]=null==n?"":"number"!=typeof n||Qo.test(t)?n:n+"px"}function gs(e,t,n,r,i){var o;e:if("style"===t)if("string"==typeof n)e.style.cssText=n;else{if("string"==typeof r&&(e.style.cssText=r=""),r)for(t in r)n&&t in n||vs(e.style,t,"");if(n)for(t in n)r&&n[t]===r[t]||vs(e.style,t,n[t])}else if("o"===t[0]&&"n"===t[1])o=t!==(t=t.replace(/(PointerCapture)$|Capture$/,"$1")),t=t.toLowerCase()in e?t.toLowerCase().slice(2):t.slice(2),e.l||(e.l={}),e.l[t+o]=n,n?r?n.u=r.u:(n.u=Date.now(),e.addEventListener(t,o?ms:fs,o)):e.removeEventListener(t,o?ms:fs,o);else{if(i)t=t.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if("width"!==t&&"height"!==t&&"href"!==t&&"list"!==t&&"form"!==t&&"tabIndex"!==t&&"download"!==t&&"rowSpan"!==t&&"colSpan"!==t&&"role"!==t&&t in e)try{e[t]=null==n?"":n;break e}catch(e){}"function"==typeof n||(null==n||!1===n&&"-"!==t[4]?e.removeAttribute(t):e.setAttribute(t,n))}}function fs(e){var t=this.l[e.type+!1];if(e.t){if(e.t<=t.u)return}else e.t=Date.now();return t(Zo.event?Zo.event(e):e)}function ms(e){return this.l[e.type+!0](Zo.event?Zo.event(e):e)}function _s(e,t,n,r,i,o,s,a,l,c){var u,d,h,p,v,g,f,m,_,y,b,w,S,C,I,k=t.type;if(void 0!==t.constructor)return null;128&n.__u&&(l=!!(32&n.__u),o=[a=t.__e=n.__e]),(u=Zo.__b)&&u(t);e:if("function"==typeof k)try{if(m=t.props,_=(u=k.contextType)&&r[u.__c],y=u?_?_.props.value:u.__:r,n.__c?f=(d=t.__c=n.__c).__=d.__E:("prototype"in k&&k.prototype.render?t.__c=d=new k(m,y):(t.__c=d=new ss(m,y),d.constructor=k,d.render=Ss),_&&_.sub(d),d.props=m,d.state||(d.state={}),d.context=y,d.__n=r,h=d.__d=!0,d.__h=[],d._sb=[]),null==d.__s&&(d.__s=d.state),null!=k.getDerivedStateFromProps&&(d.__s==d.state&&(d.__s=ts({},d.__s)),ts(d.__s,k.getDerivedStateFromProps(m,d.__s))),p=d.props,v=d.state,d.__v=t,h)null==k.getDerivedStateFromProps&&null!=d.componentWillMount&&d.componentWillMount(),null!=d.componentDidMount&&d.__h.push(d.componentDidMount);else{if(null==k.getDerivedStateFromProps&&m!==p&&null!=d.componentWillReceiveProps&&d.componentWillReceiveProps(m,y),!d.__e&&(null!=d.shouldComponentUpdate&&!1===d.shouldComponentUpdate(m,d.__s,y)||t.__v===n.__v)){for(t.__v!==n.__v&&(d.props=m,d.state=d.__s,d.__d=!1),t.__e=n.__e,t.__k=n.__k,t.__k.forEach((function(e){e&&(e.__=t)})),b=0;b<d._sb.length;b++)d.__h.push(d._sb[b]);d._sb=[],d.__h.length&&s.push(d);break e}null!=d.componentWillUpdate&&d.componentWillUpdate(m,d.__s,y),null!=d.componentDidUpdate&&d.__h.push((function(){d.componentDidUpdate(p,v,g)}))}if(d.context=y,d.props=m,d.__P=e,d.__e=!1,w=Zo.__r,S=0,"prototype"in k&&k.prototype.render){for(d.state=d.__s,d.__d=!1,w&&w(t),u=d.render(d.props,d.state,d.context),C=0;C<d._sb.length;C++)d.__h.push(d._sb[C]);d._sb=[]}else do{d.__d=!1,w&&w(t),u=d.render(d.props,d.state,d.context),d.state=d.__s}while(d.__d&&++S<25);d.state=d.__s,null!=d.getChildContext&&(r=ts(ts({},r),d.getChildContext())),h||null==d.getSnapshotBeforeUpdate||(g=d.getSnapshotBeforeUpdate(p,v)),ds(e,es(I=null!=u&&u.type===os&&null==u.key?u.props.children:u)?I:[I],t,n,r,i,o,s,a,l,c),d.base=t.__e,t.__u&=-161,d.__h.length&&s.push(d),f&&(d.__E=d.__=null)}catch(e){t.__v=null,l||null!=o?(t.__e=a,t.__u|=l?160:32,o[o.indexOf(a)]=null):(t.__e=n.__e,t.__k=n.__k),Zo.__e(e,t,n)}else null==o&&t.__v===n.__v?(t.__k=n.__k,t.__e=n.__e):t.__e=function(e,t,n,r,i,o,s,a,l){var c,u,d,h,p,v,g,f=n.props,m=t.props,_=t.type;if("svg"===_&&(i=!0),null!=o)for(c=0;c<o.length;c++)if((p=o[c])&&"setAttribute"in p==!!_&&(_?p.localName===_:3===p.nodeType)){e=p,o[c]=null;break}if(null==e){if(null===_)return document.createTextNode(m);e=i?document.createElementNS("http://www.w3.org/2000/svg",_):document.createElement(_,m.is&&m),o=null,a=!1}if(null===_)f===m||a&&e.data===m||(e.data=m);else{if(o=o&&Vo.call(e.childNodes),f=n.props||Jo,!a&&null!=o)for(f={},c=0;c<e.attributes.length;c++)f[(p=e.attributes[c]).name]=p.value;for(c in f)p=f[c],"children"==c||("dangerouslySetInnerHTML"==c?d=p:"key"===c||c in m||gs(e,c,null,p,i));for(c in m)p=m[c],"children"==c?h=p:"dangerouslySetInnerHTML"==c?u=p:"value"==c?v=p:"checked"==c?g=p:"key"===c||a&&"function"!=typeof p||f[c]===p||gs(e,c,p,f[c],i);if(u)a||d&&(u.__html===d.__html||u.__html===e.innerHTML)||(e.innerHTML=u.__html),t.__k=[];else if(d&&(e.innerHTML=""),ds(e,es(h)?h:[h],t,n,r,i&&"foreignObject"!==_,o,s,o?o[0]:n.__k&&as(n,0),a,l),null!=o)for(c=o.length;c--;)null!=o[c]&&ns(o[c]);a||(c="value",void 0!==v&&(v!==e[c]||"progress"===_&&!v||"option"===_&&v!==f[c])&&gs(e,c,v,f[c],!1),c="checked",void 0!==g&&g!==e[c]&&gs(e,c,g,f[c],!1))}return e}(n.__e,t,n,r,i,o,s,l,c);(u=Zo.diffed)&&u(t)}function ys(e,t,n){t.__d=void 0;for(var r=0;r<n.length;r++)bs(n[r],n[++r],n[++r]);Zo.__c&&Zo.__c(t,e),e.some((function(t){try{e=t.__h,t.__h=[],e.some((function(e){e.call(t)}))}catch(e){Zo.__e(e,t.__v)}}))}function bs(e,t,n){try{"function"==typeof e?e(t):e.current=t}catch(e){Zo.__e(e,n)}}function ws(e,t,n){var r,i;if(Zo.unmount&&Zo.unmount(e),(r=e.ref)&&(r.current&&r.current!==e.__e||bs(r,null,t)),null!=(r=e.__c)){if(r.componentWillUnmount)try{r.componentWillUnmount()}catch(e){Zo.__e(e,t)}r.base=r.__P=null,e.__c=void 0}if(r=e.__k)for(i=0;i<r.length;i++)r[i]&&ws(r[i],t,n||"function"!=typeof e.type);n||null==e.__e||ns(e.__e),e.__=e.__e=e.__d=void 0}function Ss(e,t,n){return this.constructor(e,n)}function Cs(e,t,n){var r,i,o,s;Zo.__&&Zo.__(e,t),i=(r="function"==typeof n)?null:t.__k,o=[],s=[],_s(t,e=(!r&&n||t).__k=rs(os,null,[e]),i||Jo,Jo,void 0!==t.ownerSVGElement,!r&&n?[n]:i?null:t.firstChild?Vo.call(t.childNodes):null,o,!r&&n?n:i?i.__e:t.firstChild,r,s),ys(o,e,s)}function Is(e,t,n){var r,i,o,s,a=ts({},e.props);for(o in e.type&&e.type.defaultProps&&(s=e.type.defaultProps),t)"key"==o?r=t[o]:"ref"==o?i=t[o]:a[o]=void 0===t[o]&&void 0!==s?s[o]:t[o];return arguments.length>2&&(a.children=arguments.length>3?Vo.call(arguments,2):n),is(e.type,a,r||e.key,i||e.ref,null)}Vo=Ko.slice,Zo={__e:function(e,t,n,r){for(var i,o,s;t=t.__;)if((i=t.__c)&&!i.__)try{if((o=i.constructor)&&null!=o.getDerivedStateFromError&&(i.setState(o.getDerivedStateFromError(e)),s=i.__d),null!=i.componentDidCatch&&(i.componentDidCatch(e,r||{}),s=i.__d),s)return i.__E=i}catch(t){e=t}throw e}},Go=0,ss.prototype.setState=function(e,t){var n;n=null!=this.__s&&this.__s!==this.state?this.__s:this.__s=ts({},this.state),"function"==typeof e&&(e=e(ts({},n),this.props)),e&&ts(n,e),null!=e&&this.__v&&(t&&this._sb.push(t),cs(this))},ss.prototype.forceUpdate=function(e){this.__v&&(this.__e=!0,e&&this.__h.push(e),cs(this))},ss.prototype.render=os,Uo=[],zo="function"==typeof Promise?Promise.prototype.then.bind(Promise.resolve()):setTimeout,Yo=function(e,t){return e.__v.__b-t.__v.__b},us.__r=0,Xo=0;var ks,Es,xs,Ts,Ms=0,Rs=[],As=[],Ns=Zo.__b,Fs=Zo.__r,Os=Zo.diffed,Ps=Zo.__c,Ls=Zo.unmount;function Ds(e,t){Zo.__h&&Zo.__h(Es,e,Ms||t),Ms=0;var n=Es.__H||(Es.__H={__:[],__h:[]});return e>=n.__.length&&n.__.push({__V:As}),n.__[e]}function Bs(e){return Ms=1,function(e,t,n){var r=Ds(ks++,2);if(r.t=e,!r.__c&&(r.__=[Ys(void 0,t),function(e){var t=r.__N?r.__N[0]:r.__[0],n=r.t(t,e);t!==n&&(r.__N=[n,r.__[1]],r.__c.setState({}))}],r.__c=Es,!Es.u)){var i=function(e,t,n){if(!r.__c.__H)return!0;var i=r.__c.__H.__.filter((function(e){return e.__c}));if(i.every((function(e){return!e.__N})))return!o||o.call(this,e,t,n);var s=!1;return i.forEach((function(e){if(e.__N){var t=e.__[0];e.__=e.__N,e.__N=void 0,t!==e.__[0]&&(s=!0)}})),!(!s&&r.__c.props===e)&&(!o||o.call(this,e,t,n))};Es.u=!0;var o=Es.shouldComponentUpdate,s=Es.componentWillUpdate;Es.componentWillUpdate=function(e,t,n){if(this.__e){var r=o;o=void 0,i(e,t,n),o=r}s&&s.call(this,e,t,n)},Es.shouldComponentUpdate=i}return r.__N||r.__}(Ys,e)}function Hs(e,t){var n=Ds(ks++,3);!Zo.__s&&zs(n.__H,t)&&(n.__=e,n.i=t,Es.__H.__h.push(n))}function qs(e){return Ms=5,$s((function(){return{current:e}}),[])}function $s(e,t){var n=Ds(ks++,7);return zs(n.__H,t)?(n.__V=e(),n.i=t,n.__h=e,n.__V):n.__}function Ws(e){var t=Es.context[e.__c],n=Ds(ks++,9);return n.c=e,t?(null==n.__&&(n.__=!0,t.sub(Es)),t.props.value):e.__}function Vs(){for(var e;e=Rs.shift();)if(e.__P&&e.__H)try{e.__H.__h.forEach(Us),e.__H.__h.forEach(js),e.__H.__h=[]}catch(t){e.__H.__h=[],Zo.__e(t,e.__v)}}Zo.__b=function(e){Es=null,Ns&&Ns(e)},Zo.__r=function(e){Fs&&Fs(e),ks=0;var t=(Es=e.__c).__H;t&&(xs===Es?(t.__h=[],Es.__h=[],t.__.forEach((function(e){e.__N&&(e.__=e.__N),e.__V=As,e.__N=e.i=void 0}))):(t.__h.forEach(Us),t.__h.forEach(js),t.__h=[],ks=0)),xs=Es},Zo.diffed=function(e){Os&&Os(e);var t=e.__c;t&&t.__H&&(t.__H.__h.length&&(1!==Rs.push(t)&&Ts===Zo.requestAnimationFrame||((Ts=Zo.requestAnimationFrame)||Gs)(Vs)),t.__H.__.forEach((function(e){e.i&&(e.__H=e.i),e.__V!==As&&(e.__=e.__V),e.i=void 0,e.__V=As}))),xs=Es=null},Zo.__c=function(e,t){t.some((function(e){try{e.__h.forEach(Us),e.__h=e.__h.filter((function(e){return!e.__||js(e)}))}catch(n){t.some((function(e){e.__h&&(e.__h=[])})),t=[],Zo.__e(n,e.__v)}})),Ps&&Ps(e,t)},Zo.unmount=function(e){Ls&&Ls(e);var t,n=e.__c;n&&n.__H&&(n.__H.__.forEach((function(e){try{Us(e)}catch(e){t=e}})),n.__H=void 0,t&&Zo.__e(t,n.__v))};var Zs="function"==typeof requestAnimationFrame;function Gs(e){var t,n=function(){clearTimeout(r),Zs&&cancelAnimationFrame(t),setTimeout(e)},r=setTimeout(n,100);Zs&&(t=requestAnimationFrame(n))}function Us(e){var t=Es,n=e.__c;"function"==typeof n&&(e.__c=void 0,n()),Es=t}function js(e){var t=Es;e.__c=e.__(),Es=t}function zs(e,t){return!e||e.length!==t.length||t.some((function(t,n){return t!==e[n]}))}function Ys(e,t){return"function"==typeof t?t(e):t}var Xs=zn;var Js=Wn,Ks=zn,Qs="seenSurvey_",ea=Rr("[Surveys]"),ta=e=>"\n .survey-form, .thank-you-message {\n position: fixed;\n margin: 0px;\n bottom: 0px;\n color: black;\n font-weight: normal;\n font-family: ".concat((null==e?void 0:e.fontFamily)||"-apple-system",', BlinkMacSystemFont, "Inter", "Segoe UI", "Roboto", Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";\n text-align: left;\n max-width: ').concat(parseInt((null==e?void 0:e.maxWidth)||"300"),"px;\n width: 100%;\n z-index: ").concat(parseInt((null==e?void 0:e.zIndex)||"99999"),";\n border: 1.5px solid ").concat((null==e?void 0:e.borderColor)||"#c9c6c6",";\n border-bottom: 0px;\n ").concat({left:"left: 30px;",right:"right: 30px;",center:"\n left: 50%;\n transform: translateX(-50%);\n "}[(null==e?void 0:e.position)||"right"]||"right: 30px;","\n flex-direction: column;\n background: ").concat((null==e?void 0:e.backgroundColor)||"#eeeded",";\n border-top-left-radius: 10px;\n border-top-right-radius: 10px;\n box-shadow: -6px 0 16px -8px rgb(0 0 0 / 8%), -9px 0 28px 0 rgb(0 0 0 / 5%), -12px 0 48px 16px rgb(0 0 0 / 3%);\n }\n\n .survey-box, .thank-you-message-container {\n padding: 20px 25px 10px;\n display: flex;\n flex-direction: column;\n border-radius: 10px;\n }\n\n .thank-you-message {\n text-align: center;\n }\n\n .form-submit[disabled] {\n opacity: 0.6;\n filter: grayscale(50%);\n cursor: not-allowed;\n }\n .survey-form textarea {\n color: #2d2d2d;\n font-size: 14px;\n font-family: ").concat((null==e?void 0:e.fontFamily)||"-apple-system",', BlinkMacSystemFont, "Inter", "Segoe UI", "Roboto", Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";\n background: white;\n color: black;\n outline: none;\n padding-left: 10px;\n padding-right: 10px;\n padding-top: 10px;\n border-radius: 6px;\n border-color: ').concat((null==e?void 0:e.borderColor)||"#c9c6c6",";\n margin-top: 14px;\n width: 100%;\n box-sizing: border-box;\n }\n .survey-box:has(.survey-question:empty):not(:has(.survey-question-description)) textarea {\n margin-top: 0;\n }\n .form-submit {\n box-sizing: border-box;\n margin: 0;\n font-family: inherit;\n overflow: visible;\n text-transform: none;\n position: relative;\n display: inline-block;\n font-weight: 700;\n white-space: nowrap;\n text-align: center;\n border: 1.5px solid transparent;\n cursor: pointer;\n user-select: none;\n touch-action: manipulation;\n padding: 12px;\n font-size: 14px;\n border-radius: 6px;\n outline: 0;\n background: ").concat((null==e?void 0:e.submitButtonColor)||"black"," !important;\n text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.12);\n box-shadow: 0 2px 0 rgba(0, 0, 0, 0.045);\n width: 100%;\n }\n .form-cancel {\n display: flex;\n float: right;\n border: none;\n background: none;\n cursor: pointer;\n }\n .cancel-btn-wrapper {\n position: absolute;\n width: 35px;\n height: 35px;\n border-radius: 100%;\n top: 0;\n right: 0;\n transform: translate(50%, -50%);\n background: white;\n border: 1.5px solid ").concat((null==e?void 0:e.borderColor)||"#c9c6c6",";\n display: flex;\n justify-content: center;\n align-items: center;\n }\n .bolded { font-weight: 600; }\n .buttons {\n display: flex;\n justify-content: center;\n }\n .footer-branding {\n font-size: 11px;\n margin-top: 10px;\n text-align: center;\n display: flex;\n justify-content: center;\n gap: 4px;\n align-items: center;\n font-weight: 500;\n background: ").concat((null==e?void 0:e.backgroundColor)||"#eeeded",";\n text-decoration: none;\n backgroundColor: ").concat((null==e?void 0:e.backgroundColor)||"#eeeded",";\n color: ").concat(ra((null==e?void 0:e.backgroundColor)||"#eeeded"),";\n }\n .survey-question {\n font-weight: 500;\n font-size: 14px;\n background: ").concat((null==e?void 0:e.backgroundColor)||"#eeeded",";\n }\n .question-textarea-wrapper {\n display: flex;\n flex-direction: column;\n }\n .survey-question-description {\n font-size: 13px;\n padding-top: 5px;\n background: ").concat((null==e?void 0:e.backgroundColor)||"#eeeded",";\n }\n .ratings-number {\n font-size: 16px;\n font-weight: 600;\n padding: 8px 0px;\n border: none;\n }\n .ratings-number:hover {\n cursor: pointer;\n }\n .rating-options {\n margin-top: 14px;\n }\n .rating-options-number {\n display: grid;\n border-radius: 6px;\n overflow: hidden;\n border: 1.5px solid ").concat((null==e?void 0:e.borderColor)||"#c9c6c6",";\n }\n .rating-options-number > .ratings-number {\n border-right: 1px solid ").concat((null==e?void 0:e.borderColor)||"#c9c6c6",";\n }\n .rating-options-number > .ratings-number:last-of-type {\n border-right: 0px;\n }\n .rating-options-number .rating-active {\n background: ").concat((null==e?void 0:e.ratingButtonActiveColor)||"black",";\n }\n .rating-options-emoji {\n display: flex;\n justify-content: space-between;\n }\n .ratings-emoji {\n font-size: 16px;\n background-color: transparent;\n border: none;\n padding: 0px;\n }\n .ratings-emoji:hover {\n cursor: pointer;\n }\n .ratings-emoji.rating-active svg {\n fill: ").concat((null==e?void 0:e.ratingButtonActiveColor)||"black",";\n }\n .emoji-svg {\n fill: '#939393';\n }\n .rating-text {\n display: flex;\n flex-direction: row;\n font-size: 11px;\n justify-content: space-between;\n margin-top: 6px;\n background: ").concat((null==e?void 0:e.backgroundColor)||"#eeeded",";\n opacity: .60;\n }\n .multiple-choice-options {\n margin-top: 13px;\n font-size: 14px;\n }\n .survey-box:has(.survey-question:empty):not(:has(.survey-question-description)) .multiple-choice-options {\n margin-top: 0;\n }\n .multiple-choice-options .choice-option {\n display: flex;\n align-items: center;\n gap: 4px;\n font-size: 13px;\n cursor: pointer;\n margin-bottom: 5px;\n position: relative;\n }\n .multiple-choice-options > .choice-option:last-of-type {\n margin-bottom: 0px;\n }\n .multiple-choice-options input {\n cursor: pointer;\n position: absolute;\n opacity: 0;\n }\n .choice-check {\n position: absolute;\n right: 10px;\n background: white;\n }\n .choice-check svg {\n display: none;\n }\n .multiple-choice-options .choice-option:hover .choice-check svg {\n display: inline-block;\n opacity: .25;\n }\n .multiple-choice-options input:checked + label + .choice-check svg {\n display: inline-block;\n opacity: 100% !important;\n }\n .multiple-choice-options input:checked + label {\n font-weight: bold;\n border: 1.5px solid rgba(0,0,0);\n }\n .multiple-choice-options input:checked + label input {\n font-weight: bold;\n }\n .multiple-choice-options label {\n width: 100%;\n cursor: pointer;\n padding: 10px;\n border: 1.5px solid rgba(0,0,0,.25);\n border-radius: 4px;\n background: white;\n }\n .multiple-choice-options .choice-option-open label {\n padding-right: 30px;\n display: flex;\n flex-wrap: wrap;\n gap: 8px;\n max-width: 100%;\n }\n .multiple-choice-options .choice-option-open label span {\n width: 100%;\n }\n .multiple-choice-options .choice-option-open input:disabled + label {\n opacity: 0.6;\n }\n .multiple-choice-options .choice-option-open label input {\n position: relative;\n opacity: 1;\n flex-grow: 1;\n border: 0;\n outline: 0;\n }\n .thank-you-message-body {\n margin-top: 6px;\n font-size: 14px;\n background: ").concat((null==e?void 0:e.backgroundColor)||"#eeeded",";\n }\n .thank-you-message-header {\n margin: 10px 0px 0px;\n background: ").concat((null==e?void 0:e.backgroundColor)||"#eeeded",";\n }\n .thank-you-message-container .form-submit {\n margin-top: 20px;\n margin-bottom: 10px;\n }\n .thank-you-message-countdown {\n margin-left: 6px;\n }\n .bottom-section {\n margin-top: 14px;\n }\n ");function na(e){if("#"===e[0]){var t=e.replace(/^#/,"");return"rgb("+parseInt(t.slice(0,2),16)+","+parseInt(t.slice(2,4),16)+","+parseInt(t.slice(4,6),16)+")"}return"rgb(255, 255, 255)"}function ra(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:oa;"#"===t[0]&&(e=na(t)),t.startsWith("rgb")&&(e=t);var n=function(e){return{aliceblue:"#f0f8ff",antiquewhite:"#faebd7",aqua:"#00ffff",aquamarine:"#7fffd4",azure:"#f0ffff",beige:"#f5f5dc",bisque:"#ffe4c4",black:"#000000",blanchedalmond:"#ffebcd",blue:"#0000ff",blueviolet:"#8a2be2",brown:"#a52a2a",burlywood:"#deb887",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",cornflowerblue:"#6495ed",cornsilk:"#fff8dc",crimson:"#dc143c",cyan:"#00ffff",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkgray:"#a9a9a9",darkgreen:"#006400",darkkhaki:"#bdb76b",darkmagenta:"#8b008b",darkolivegreen:"#556b2f",darkorange:"#ff8c00",darkorchid:"#9932cc",darkred:"#8b0000",darksalmon:"#e9967a",darkseagreen:"#8fbc8f",darkslateblue:"#483d8b",darkslategray:"#2f4f4f",darkturquoise:"#00ced1",darkviolet:"#9400d3",deeppink:"#ff1493",deepskyblue:"#00bfff",dimgray:"#696969",dodgerblue:"#1e90ff",firebrick:"#b22222",floralwhite:"#fffaf0",forestgreen:"#228b22",fuchsia:"#ff00ff",gainsboro:"#dcdcdc",ghostwhite:"#f8f8ff",gold:"#ffd700",goldenrod:"#daa520",gray:"#808080",green:"#008000",greenyellow:"#adff2f",honeydew:"#f0fff0",hotpink:"#ff69b4","indianred ":"#cd5c5c",indigo:"#4b0082",ivory:"#fffff0",khaki:"#f0e68c",lavender:"#e6e6fa",lavenderblush:"#fff0f5",lawngreen:"#7cfc00",lemonchiffon:"#fffacd",lightblue:"#add8e6",lightcoral:"#f08080",lightcyan:"#e0ffff",lightgoldenrodyellow:"#fafad2",lightgrey:"#d3d3d3",lightgreen:"#90ee90",lightpink:"#ffb6c1",lightsalmon:"#ffa07a",lightseagreen:"#20b2aa",lightskyblue:"#87cefa",lightslategray:"#778899",lightsteelblue:"#b0c4de",lightyellow:"#ffffe0",lime:"#00ff00",limegreen:"#32cd32",linen:"#faf0e6",magenta:"#ff00ff",maroon:"#800000",mediumaquamarine:"#66cdaa",mediumblue:"#0000cd",mediumorchid:"#ba55d3",mediumpurple:"#9370d8",mediumseagreen:"#3cb371",mediumslateblue:"#7b68ee",mediumspringgreen:"#00fa9a",mediumturquoise:"#48d1cc",mediumvioletred:"#c71585",midnightblue:"#191970",mintcream:"#f5fffa",mistyrose:"#ffe4e1",moccasin:"#ffe4b5",navajowhite:"#ffdead",navy:"#000080",oldlace:"#fdf5e6",olive:"#808000",olivedrab:"#6b8e23",orange:"#ffa500",orangered:"#ff4500",orchid:"#da70d6",palegoldenrod:"#eee8aa",palegreen:"#98fb98",paleturquoise:"#afeeee",palevioletred:"#d87093",papayawhip:"#ffefd5",peachpuff:"#ffdab9",peru:"#cd853f",pink:"#ffc0cb",plum:"#dda0dd",powderblue:"#b0e0e6",purple:"#800080",red:"#ff0000",rosybrown:"#bc8f8f",royalblue:"#4169e1",saddlebrown:"#8b4513",salmon:"#fa8072",sandybrown:"#f4a460",seagreen:"#2e8b57",seashell:"#fff5ee",sienna:"#a0522d",silver:"#c0c0c0",skyblue:"#87ceeb",slateblue:"#6a5acd",slategray:"#708090",snow:"#fffafa",springgreen:"#00ff7f",steelblue:"#4682b4",tan:"#d2b48c",teal:"#008080",thistle:"#d8bfd8",tomato:"#ff6347",turquoise:"#40e0d0",violet:"#ee82ee",wheat:"#f5deb3",white:"#ffffff",whitesmoke:"#f5f5f5",yellow:"#ffff00",yellowgreen:"#9acd32"}[e.toLowerCase()]}(t);if(n&&(e=na(n)),!e)return"black";var r=e.match(/^rgba?\((\d+),\s*(\d+),\s*(\d+)(?:,\s*(\d+(?:\.\d+)?))?\)$/);if(r){var i=parseInt(r[1]),o=parseInt(r[2]),s=parseInt(r[3]);return Math.sqrt(i*i*.299+o*o*.587+s*s*.114)>127.5?"black":"white"}return"black"}var ia={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:"right"},oa="#eeeded",sa=function(){var e,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=arguments.length>1?arguments[1]:void 0,i=arguments.length>2?arguments[2]:void 0;i?(localStorage.setItem(ha(r),"true"),i.capture("survey sent",t(t({$survey_name:r.name,$survey_id:r.id,$survey_iteration:r.current_iteration,$survey_iteration_start_date:r.current_iteration_start_date,$survey_questions:r.questions.map((e=>e.question)),sessionRecordingUrl:null===(e=i.get_session_replay_url)||void 0===e?void 0:e.call(i)},n),{},{$set:{[pa(r,"responded")]:!0}})),Js.dispatchEvent(new Event("PHSurveySent"))):ea.error("[survey sent] event not captured, PostHog instance not found.")},aa=(e,t,n)=>{var r;t?n||(t.capture("survey dismissed",{$survey_name:e.name,$survey_id:e.id,$survey_iteration:e.current_iteration,$survey_iteration_start_date:e.current_iteration_start_date,sessionRecordingUrl:null===(r=t.get_session_replay_url)||void 0===r?void 0:r.call(t),$set:{[pa(e,"dismissed")]:!0}}),localStorage.setItem(ha(e),"true"),Js.dispatchEvent(new Event("PHSurveyClosed"))):ea.error("[survey dismissed] event not captured, PostHog instance not found.")},la=e=>e.map((e=>({sort:Math.floor(10*Math.random()),value:e}))).sort(((e,t)=>e.sort-t.sort)).map((e=>e.value)),ca=(e,t)=>e.length===t.length&&e.every(((e,n)=>e===t[n]))?t.reverse():t,ua=e=>(e.questions.forEach(((e,t)=>{e.originalQuestionIndex=t})),e.appearance&&e.appearance.shuffleQuestions?ca(e.questions,la(e.questions)):e.questions),da=e=>{var t,n;return!(null===(t=e.conditions)||void 0===t||null===(n=t.events)||void 0===n||!n.repeatedActivation||!(e=>{var t,n,r,i,o,s;return null!=(null===(t=e.conditions)||void 0===t||null===(n=t.events)||void 0===n||null===(r=n.values)||void 0===r?void 0:r.length)&&(null===(i=e.conditions)||void 0===i||null===(o=i.events)||void 0===o||null===(s=o.values)||void 0===s?void 0:s.length)>0})(e))},ha=e=>{var t="".concat(Qs).concat(e.id);return e.current_iteration&&e.current_iteration>0&&(t="".concat(Qs).concat(e.id,"_").concat(e.current_iteration)),t},pa=(e,t)=>{var n="$survey_".concat(t,"/").concat(e.id);return e.current_iteration&&e.current_iteration>0&&(n="$survey_".concat(t,"/").concat(e.id,"/").concat(e.current_iteration)),n},va=function(e,t){var n={__c:t="__cC"+Xo++,__:e,Consumer:function(e,t){return e.children(t)},Provider:function(e){var n,r;return this.getChildContext||(n=[],(r={})[t]=this,this.getChildContext=function(){return r},this.shouldComponentUpdate=function(e){this.props.value!==e.value&&n.some((function(e){e.__e=!0,cs(e)}))},this.sub=function(e){n.push(e);var t=e.componentWillUnmount;e.componentWillUnmount=function(){n.splice(n.indexOf(e),1),t&&t.call(e)}}),e.children}};return n.Provider.__=n.Consumer.contextType=n}({isPreviewMode:!1,previewPageIndex:0,handleCloseSurveyPopup:()=>{},isPopup:!0,onPreviewSubmit:()=>{}}),ga=e=>{var{component:t,children:n,renderAsHtml:r,style:i}=e;return Is(t,r?{dangerouslySetInnerHTML:{__html:n},style:i}:{children:n,style:i})},fa=0;function ma(e,t,n,r,i,o){var s,a,l={};for(a in t)"ref"==a?s=t[a]:l[a]=t[a];var c={type:e,props:l,key:n,ref:s,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,constructor:void 0,__v:--fa,__i:-1,__u:0,__source:i,__self:o};if("function"==typeof e&&(s=e.defaultProps))for(a in s)void 0===l[a]&&(l[a]=s[a]);return Zo.vnode&&Zo.vnode(c),c}var _a=ma("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 -960 960 960",width:"48",children:ma("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"})}),ya=ma("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 -960 960 960",width:"48",children:ma("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"})}),ba=ma("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 -960 960 960",width:"48",children:ma("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"})}),wa=ma("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 -960 960 960",width:"48",children:ma("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"})}),Sa=ma("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 -960 960 960",width:"48",children:ma("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"})}),Ca=ma("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:ma("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"})}),Ia=ma("svg",{width:"77",height:"14",viewBox:"0 0 77 14",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[ma("g",{"clip-path":"url(#clip0_2415_6911)",children:[ma("mask",{id:"mask0_2415_6911",style:{maskType:"luminance"},maskUnits:"userSpaceOnUse",x:"0",y:"0",width:"77",height:"14",children:ma("path",{d:"M0.5 0H76.5V14H0.5V0Z",fill:"white"})}),ma("g",{mask:"url(#mask0_2415_6911)",children:[ma("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"}),ma("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"}),ma("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"}),ma("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"}),ma("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"}),ma("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"})]})]}),ma("defs",{children:ma("clipPath",{id:"clip0_2415_6911",children:ma("rect",{width:"76",height:"14",fill:"white",transform:"translate(0.5)"})})})]}),ka=ma("svg",{width:"16",height:"12",viewBox:"0 0 16 12",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:ma("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"})});function Ea(){return ma("a",{href:"https://posthog.com",target:"_blank",rel:"noopener",className:"footer-branding",children:["Survey by ",Ia]})}function xa(e){var{text:t,submitDisabled:n,appearance:r,onSubmit:i,link:o,onPreviewSubmit:s}=e,{isPreviewMode:a,isPopup:l}=Ws(va),c=r.submitButtonTextColor||ra(r.submitButtonColor||ia.submitButtonColor);return ma("div",{className:"bottom-section",children:[ma("div",{className:"buttons",children:ma("button",{className:"form-submit",disabled:n&&!a,type:"button",style:l?{color:c}:{},onClick:()=>{a?null==s||s():(o&&(null==Wn||Wn.open(o)),i())},children:t})}),!r.whiteLabel&&ma(Ea,{})]})}function Ta(e){var{question:t,description:n,descriptionContentType:r,backgroundColor:i,forceDisableHtml:o}=e,{isPopup:s}=Ws(va);return ma("div",{style:s?{backgroundColor:i||ia.backgroundColor}:{},children:[ma("div",{className:"survey-question",children:t}),n&&ga({component:rs("div",{className:"survey-question-description"}),children:n,renderAsHtml:!o&&"text"!==r})]})}function Ma(e){var{onClick:t}=e,{isPreviewMode:n}=Ws(va);return ma("div",{className:"cancel-btn-wrapper",onClick:t,disabled:n,children:ma("button",{className:"form-cancel",onClick:t,disabled:n,children:Ca})})}function Ra(e){var{header:n,description:r,contentType:i,forceDisableHtml:o,appearance:s,onClose:a,styleOverrides:l}=e,c=ra(s.backgroundColor||ia.backgroundColor),{isPopup:u}=Ws(va);return ma(os,{children:ma("div",{className:"thank-you-message",style:t({},l),children:ma("div",{className:"thank-you-message-container",children:[u&&ma(Ma,{onClick:()=>a()}),ma("h3",{className:"thank-you-message-header",style:{color:c},children:n}),r&&ga({component:rs("div",{className:"thank-you-message-body"}),children:r,renderAsHtml:!o&&"text"!==i,style:{color:c}}),u&&ma(xa,{text:s.thankYouMessageCloseButtonText||"Close",submitDisabled:!1,appearance:s,onSubmit:()=>a()})]})})})}function Aa(e){var t,n=qs(null),[r,i]=Bs(null!==(t=e.defaultTextColor)&&void 0!==t?t:"black");return Hs((()=>{if(n.current){var e=function(e){var t=Js.getComputedStyle(e).backgroundColor;if("rgba(0, 0, 0, 0)"===t)return"black";var n=t.match(/^rgba?\((\d+),\s*(\d+),\s*(\d+)(?:,\s*(\d+(?:\.\d+)?))?\)$/);if(!n)return"black";var r=parseInt(n[1]),i=parseInt(n[2]),o=parseInt(n[3]);return Math.sqrt(r*r*.299+i*i*.587+o*o*.114)>127.5?"black":"white"}(n.current);i(e)}}),[e.appearance,e.forceUpdate]),{ref:n,textColor:r}}function Na(e){var{question:t,forceDisableHtml:n,appearance:r,onSubmit:i,onPreviewSubmit:o}=e,s=qs(null),[a,l]=Bs("");return ma("div",{ref:s,children:[ma(Ta,{question:t.question,description:t.description,descriptionContentType:t.descriptionContentType,backgroundColor:r.backgroundColor,forceDisableHtml:n}),ma("textarea",{rows:4,placeholder:null==r?void 0:r.placeholder,onInput:e=>l(e.currentTarget.value)}),ma(xa,{text:t.buttonText||"Submit",submitDisabled:!a&&!t.optional,appearance:r,onSubmit:()=>i(a),onPreviewSubmit:()=>o(a)})]})}function Fa(e){var{question:t,forceDisableHtml:n,appearance:r,onSubmit:i,onPreviewSubmit:o}=e;return ma(os,{children:[ma(Ta,{question:t.question,description:t.description,descriptionContentType:t.descriptionContentType,forceDisableHtml:n}),ma(xa,{text:t.buttonText||"Submit",submitDisabled:!1,link:t.link,appearance:r,onSubmit:()=>i("link clicked"),onPreviewSubmit:()=>o("link clicked")})]})}function Oa(e){var{question:t,forceDisableHtml:n,displayQuestionIndex:r,appearance:i,onSubmit:o,onPreviewSubmit:s}=e,a=t.scale,l=10===t.scale?0:1,[c,u]=Bs(null);return ma(os,{children:[ma(Ta,{question:t.question,description:t.description,descriptionContentType:t.descriptionContentType,forceDisableHtml:n,backgroundColor:i.backgroundColor}),ma("div",{className:"rating-section",children:[ma("div",{className:"rating-options",children:["emoji"===t.display&&ma("div",{className:"rating-options-emoji",children:(3===t.scale?Da:Ba).map(((e,t)=>{var n=t+1===c;return ma("button",{className:"ratings-emoji question-".concat(r,"-rating-").concat(t," ").concat(n?"rating-active":null),value:t+1,type:"button",onClick:()=>{u(t+1)},style:{fill:n?i.ratingButtonActiveColor:i.ratingButtonColor,borderColor:i.borderColor},children:e},t)}))}),"number"===t.display&&ma("div",{className:"rating-options-number",style:{gridTemplateColumns:"repeat(".concat(a-l+1,", minmax(0, 1fr))")},children:Wa(t.scale).map(((e,t)=>ma(Pa,{displayQuestionIndex:r,active:c===e,appearance:i,num:e,setActiveNumber:e=>{u(e)}},t)))})]}),ma("div",{className:"rating-text",children:[ma("div",{children:t.lowerBoundLabel}),ma("div",{children:t.upperBoundLabel})]})]}),ma(xa,{text:t.buttonText||(null==i?void 0:i.submitButtonText)||"Submit",submitDisabled:br(c)&&!t.optional,appearance:i,onSubmit:()=>o(c),onPreviewSubmit:()=>s(c)})]})}function Pa(e){var{num:t,active:n,displayQuestionIndex:r,appearance:i,setActiveNumber:o}=e,{textColor:s,ref:a}=Aa({appearance:i,defaultTextColor:"black",forceUpdate:n});return ma("button",{ref:a,className:"ratings-number question-".concat(r,"-rating-").concat(t," ").concat(n?"rating-active":null),type:"button",onClick:()=>{o(t)},style:{color:s,backgroundColor:n?i.ratingButtonActiveColor:i.ratingButtonColor,borderColor:i.borderColor},children:t})}function La(e){var{question:t,forceDisableHtml:n,displayQuestionIndex:r,appearance:i,onSubmit:o,onPreviewSubmit:s}=e,a=qs(null),l=$s((()=>(e=>{if(!e.shuffleOptions)return e.choices;var t=e.choices,n="";e.hasOpenChoice&&(n=t.pop());var r=ca(t,la(t));return e.hasOpenChoice&&(e.choices.push(n),r.push(n)),r})(t)),[t]),[c,u]=Bs(t.type===qo.MultipleChoice?[]:null),[d,h]=Bs(!1),[p,v]=Bs(""),g=t.type===qo.SingleChoice?"radio":"checkbox";return ma("div",{ref:a,children:[ma(Ta,{question:t.question,description:t.description,descriptionContentType:t.descriptionContentType,forceDisableHtml:n,backgroundColor:i.backgroundColor}),ma("div",{className:"multiple-choice-options",children:l.map(((e,n)=>{var i="choice-option",o=e,s=e;return t.hasOpenChoice&&n===t.choices.length-1&&(i+=" choice-option-open"),ma("div",{className:i,children:[ma("input",{type:g,id:"surveyQuestion".concat(r,"Choice").concat(n),name:"question".concat(r),value:o,disabled:!o,onInput:()=>t.hasOpenChoice&&n===t.choices.length-1?h(!d):t.type===qo.SingleChoice?u(o):t.type===qo.MultipleChoice&&dr(c)?c.includes(o)?u(c.filter((e=>e!==o))):u([...c,o]):void 0}),ma("label",{htmlFor:"surveyQuestion".concat(r,"Choice").concat(n),style:{color:"black"},children:t.hasOpenChoice&&n===t.choices.length-1?ma(os,{children:[ma("span",{children:[s,":"]}),ma("input",{type:"text",id:"surveyQuestion".concat(r,"Choice").concat(n,"Open"),name:"question".concat(r),onInput:e=>{var n=e.currentTarget.value;return t.type===qo.SingleChoice?u(n):t.type===qo.MultipleChoice&&dr(c)?v(n):void 0}})]}):s}),ma("span",{className:"choice-check",style:{color:"black"},children:ka})]})}))}),ma(xa,{text:t.buttonText||"Submit",submitDisabled:(br(c)||dr(c)&&!d&&0===c.length||dr(c)&&d&&!p&&0===c.length&&!t.optional)&&!t.optional,appearance:i,onSubmit:()=>{d&&t.type===qo.MultipleChoice?dr(c)&&o([...c,p]):o(c)},onPreviewSubmit:()=>{d&&t.type===qo.MultipleChoice?dr(c)&&s([...c,p]):s(c)}})]})}var Da=[ba,ya,_a],Ba=[wa,ba,ya,_a,Sa],Ha=[1,2,3,4,5],qa=[1,2,3,4,5,6,7],$a=[0,1,2,3,4,5,6,7,8,9,10];function Wa(e){switch(e){case 5:default:return Ha;case 7:return qa;case 10:return $a}}var Va=Rr("[Surveys]"),Za=Wn,Ga=zn;class Ua{constructor(e){var t=this;i(this,"canShowNextEventBasedSurvey",(()=>{var e,t=Ga.querySelectorAll("div[class^=PostHogSurvey]");return!(t.length>0)||1===(null===(e=t[t.length-1].shadowRoot)||void 0===e?void 0:e.childElementCount)})),i(this,"handlePopoverSurvey",(e=>{var t,n=null===(t=e.conditions)||void 0===t?void 0:t.seenSurveyWaitPeriodInDays,r=localStorage.getItem("lastSeenSurveyDate");if(n&&r){var i=new Date,o=Math.abs(i.getTime()-new Date(r).getTime());if(Math.ceil(o/864e5)<n)return}var s=(e=>!!localStorage.getItem(ha(e))&&!da(e))(e);if(!s){this.addSurveyToFocus(e.id);var a=((e,t,n)=>{var r=Ks.createElement("div");r.className="PostHogSurvey".concat(t);var i=r.attachShadow({mode:"open"});if(e){var o=Object.assign(Ks.createElement("style"),{innerText:e});i.appendChild(o)}return Ks.body.appendChild(r),i})(ta(null==e?void 0:e.appearance),e.id);Cs(ma(za,{posthog:this.posthog,survey:e,removeSurveyFromFocus:this.removeSurveyFromFocus,isPopup:!0},"popover-survey"),a)}})),i(this,"handleWidget",(e=>{var t=function(e){var t,n=Xs.createElement("div");n.className="PostHogWidget".concat(e.id);var r,i=n.attachShadow({mode:"open"}),o=(r=null===(t=e.appearance)||void 0===t?void 0:t.widgetColor,"\n .ph-survey-widget-tab {\n position: fixed;\n top: 50%;\n right: 0;\n background: ".concat(r||"#e0a045",";\n color: white;\n transform: rotate(-90deg) translate(0, -100%);\n transform-origin: right top;\n min-width: 40px;\n padding: 8px 12px;\n font-weight: 500;\n border-radius: 3px 3px 0 0;\n text-align: center;\n cursor: pointer;\n z-index: 9999999;\n }\n .ph-survey-widget-tab:hover {\n padding-bottom: 13px;\n }\n .ph-survey-widget-button {\n position: fixed;\n }\n "));return i.append(Object.assign(Xs.createElement("style"),{innerText:o})),Xs.body.appendChild(n),i}(e),n=ta(e.appearance);t.appendChild(Object.assign(Ga.createElement("style"),{innerText:n})),Cs(ma(Xa,{posthog:this.posthog,survey:e,removeSurveyFromFocus:this.removeSurveyFromFocus},"feedback-survey"),t)})),i(this,"handleWidgetSelector",(e=>{var t,n=(null===(t=e.appearance)||void 0===t?void 0:t.widgetSelector)&&Ga.querySelector(e.appearance.widgetSelector);if(n)if(0===Ga.querySelectorAll(".PostHogWidget".concat(e.id)).length)this.handleWidget(e);else if(1===Ga.querySelectorAll(".PostHogWidget".concat(e.id)).length&&!n.getAttribute("PHWidgetSurveyClickListener")){var r,i,o=null===(r=Ga.querySelector(".PostHogWidget".concat(e.id)))||void 0===r||null===(i=r.shadowRoot)||void 0===i?void 0:i.querySelector(".survey-form");n.addEventListener("click",(()=>{o&&(o.style.display="none"===o.style.display?"block":"none",o.addEventListener("PHSurveyClosed",(()=>{this.removeSurveyFromFocus(e.id),o.style.display="none"})))})),n.setAttribute("PHWidgetSurveyClickListener","true")}})),i(this,"canRenderSurvey",(e=>{var t={visible:!1};return e.end_date?(t.disabledReason="survey was completed on ".concat(e.end_date),t):e.type!=Ho.Popover?(t.disabledReason="Only Popover survey types can be rendered",t):!e.linked_flag_key||this.posthog.featureFlags.isFeatureEnabled(e.linked_flag_key)?!e.targeting_flag_key||this.posthog.featureFlags.isFeatureEnabled(e.targeting_flag_key)?!e.internal_targeting_flag_key||this.posthog.featureFlags.isFeatureEnabled(e.internal_targeting_flag_key)?(t.visible=!0,t):(t.disabledReason="internal targeting feature flag ".concat(e.internal_targeting_flag_key," is false"),t):(t.disabledReason="targeting feature flag ".concat(e.targeting_flag_key," is false"),t):(t.disabledReason="linked feature flag ".concat(e.linked_flag_key," is false"),t)})),i(this,"renderSurvey",((e,t)=>{Cs(ma(za,{posthog:this.posthog,survey:e,removeSurveyFromFocus:this.removeSurveyFromFocus,isPopup:!1},"popover-survey"),t)})),i(this,"callSurveysAndEvaluateDisplayLogic",(function(){var e,n=arguments.length>0&&void 0!==arguments[0]&&arguments[0];null===(e=t.posthog)||void 0===e||e.getActiveMatchingSurveys((e=>{var n=e.filter((e=>"api"!==e.type));t.sortSurveysByAppearanceDelay(n).forEach((e=>{if(br(t.surveyInFocus)){var n,r,i;if(e.type===Ho.Widget)"tab"===(null===(n=e.appearance)||void 0===n?void 0:n.widgetType)&&0===Ga.querySelectorAll(".PostHogWidget".concat(e.id)).length&&t.handleWidget(e),"selector"===(null===(r=e.appearance)||void 0===r?void 0:r.widgetType)&&null!==(i=e.appearance)&&void 0!==i&&i.widgetSelector&&t.handleWidgetSelector(e);e.type===Ho.Popover&&t.canShowNextEventBasedSurvey()&&t.handlePopoverSurvey(e)}}))}),n)})),i(this,"addSurveyToFocus",(e=>{br(this.surveyInFocus)||Va.error("Survey ".concat([...this.surveyInFocus]," already in focus. Cannot add survey ").concat(e,".")),this.surveyInFocus=e})),i(this,"removeSurveyFromFocus",(e=>{this.surveyInFocus!==e&&Va.error("Survey ".concat(e," is not in focus. Cannot remove survey ").concat(e,".")),this.surveyInFocus=null})),this.posthog=e,this.surveyInFocus=null}sortSurveysByAppearanceDelay(e){return e.sort(((e,t)=>{var n,r;return((null===(n=e.appearance)||void 0===n?void 0:n.surveyPopupDelaySeconds)||0)-((null===(r=t.appearance)||void 0===r?void 0:r.surveyPopupDelaySeconds)||0)}))}getTestAPI(){return{addSurveyToFocus:this.addSurveyToFocus,removeSurveyFromFocus:this.removeSurveyFromFocus,surveyInFocus:this.surveyInFocus,canShowNextEventBasedSurvey:this.canShowNextEventBasedSurvey,handleWidget:this.handleWidget,handlePopoverSurvey:this.handlePopoverSurvey,handleWidgetSelector:this.handleWidgetSelector,sortSurveysByAppearanceDelay:this.sortSurveysByAppearanceDelay}}}function ja(e){if(Ga&&Za){var t=new Ua(e);return t.callSurveysAndEvaluateDisplayLogic(!0),setInterval((()=>{t.callSurveysAndEvaluateDisplayLogic(!1)}),1e3),t}}function za(e){var n,r,i,o,s,a,{survey:l,forceDisableHtml:c,posthog:u,style:d,previewPageIndex:h,removeSurveyFromFocus:p,isPopup:v,onPreviewSubmit:g=(()=>{})}=e,f=Number.isInteger(h),m=null!==(n=l.appearance)&&void 0!==n&&n.surveyPopupDelaySeconds?1e3*l.appearance.surveyPopupDelaySeconds:0,{isPopupVisible:_,isSurveySent:y,setIsPopupVisible:b}=function(e,t,n,r,i){var[o,s]=Bs(r||0===n),[a,l]=Bs(!1);return Hs((()=>{if(t){if(!r){var o,a=()=>{i(e.id),s(!1)},c=()=>{var t,n;null!==(t=e.appearance)&&void 0!==t&&t.displayThankYouMessage?(l(!0),i(e.id),null!==(n=e.appearance)&&void 0!==n&&n.autoDisappear&&setTimeout((()=>{s(!1)}),5e3)):(i(e.id),s(!1))},u=()=>{var n;s(!0),Za.dispatchEvent(new Event("PHSurveyShown")),t.capture("survey shown",{$survey_name:e.name,$survey_id:e.id,$survey_iteration:e.current_iteration,$survey_iteration_start_date:e.current_iteration_start_date,sessionRecordingUrl:null===(n=t.get_session_replay_url)||void 0===n?void 0:n.call(t)}),localStorage.setItem("lastSeenSurveyDate",(new Date).toISOString())};return Za.addEventListener("PHSurveyClosed",a),Za.addEventListener("PHSurveySent",c),n>0?(o=setTimeout((()=>{u()}),n),()=>{clearTimeout(o),Za.removeEventListener("PHSurveyClosed",a),Za.removeEventListener("PHSurveySent",c)}):(u(),()=>{Za.removeEventListener("PHSurveyClosed",a),Za.removeEventListener("PHSurveySent",c)})}}else Va.error("usePopupVisibility hook called without a PostHog instance.")}),[]),{isPopupVisible:o,isSurveySent:a,setIsPopupVisible:s}}(l,u,m,f,p),w=y||h===l.questions.length,S=null!==(r=d)&&void 0!==r&&r.left&&Sr(null===(i=d)||void 0===i?void 0:i.left)?{left:d.left-40}:{};return f&&((d=d||{}).left="unset",d.right="unset",d.transform="unset"),_?ma(va.Provider,{value:{isPreviewMode:f,previewPageIndex:h,handleCloseSurveyPopup:()=>aa(l,u,f),isPopup:v||!1,onPreviewSubmit:g},children:w?ma(Ra,{header:(null===(o=l.appearance)||void 0===o?void 0:o.thankYouMessageHeader)||"Thank you!",description:(null===(s=l.appearance)||void 0===s?void 0:s.thankYouMessageDescription)||"",forceDisableHtml:!!c,contentType:null===(a=l.appearance)||void 0===a?void 0:a.thankYouMessageDescriptionContentType,appearance:l.appearance||ia,styleOverrides:t(t({},d),S),onClose:()=>b(!1)}):ma(Ya,{survey:l,forceDisableHtml:!!c,posthog:u,styleOverrides:d})}):ma(os,{})}function Ya(e){var n,r,{survey:i,forceDisableHtml:o,posthog:s,styleOverrides:a}=e,l=ra((null===(n=i.appearance)||void 0===n?void 0:n.backgroundColor)||ia.backgroundColor),[c,u]=Bs({}),{isPreviewMode:d,previewPageIndex:h,handleCloseSurveyPopup:p,isPopup:v,onPreviewSubmit:g}=Ws(va),[f,m]=Bs(h||0),_=$s((()=>ua(i)),[i]);Hs((()=>{m(null!=h?h:0)}),[h]);return ma("form",{className:"survey-form",style:v?t({color:l,borderColor:null===(r=i.appearance)||void 0===r?void 0:r.borderColor},a):{},children:_.map(((e,n)=>{var r,{originalQuestionIndex:a}=e;return(d?f===a:f===n)&&ma("div",{className:"survey-box",style:v?{backgroundColor:(null===(r=i.appearance)||void 0===r?void 0:r.backgroundColor)||ia.backgroundColor}:{},children:[v&&ma(Ma,{onClick:()=>p()}),Ja({question:e,forceDisableHtml:o,displayQuestionIndex:n,appearance:i.appearance||ia,onSubmit:e=>(e=>{var{res:n,originalQuestionIndex:r,displayQuestionIndex:o}=e;if(s){var a=0===r?"$survey_response":"$survey_response_".concat(r);if(u(t(t({},c),{},{[a]:n})),s.getNextSurveyStep){var l=s.getNextSurveyStep(i,o,n);l===$o.End?sa(t(t({},c),{},{[a]:n}),i,s):m(l)}else o===i.questions.length-1?sa(t(t({},c),{},{[a]:n}),i,s):m(o+1)}else Va.error("onNextButtonClick called without a PostHog instance.")})({res:e,originalQuestionIndex:a,displayQuestionIndex:n}),onPreviewSubmit:g})]})}))})}function Xa(e){var t,n,{survey:r,forceDisableHtml:i,posthog:o,readOnly:s,removeSurveyFromFocus:a}=e,[l,c]=Bs(!1),[u,d]=Bs({}),h=qs(null);return Hs((()=>{var e,t;if(o){if(!s){if("tab"===(null===(e=r.appearance)||void 0===e?void 0:e.widgetType)&&h.current){var n,i=h.current.getBoundingClientRect(),a={top:"50%",left:parseInt("".concat(i.right-360)),bottom:"auto",borderRadius:10,borderBottom:"1.5px solid ".concat((null===(n=r.appearance)||void 0===n?void 0:n.borderColor)||"#c9c6c6")};d(a)}if("selector"===(null===(t=r.appearance)||void 0===t?void 0:t.widgetType)){var u=Ga.querySelector(r.appearance.widgetSelector||"");null==u||u.addEventListener("click",(()=>{c(!l)})),null==u||u.setAttribute("PHWidgetSurveyClickListener","true")}}}else Va.error("FeedbackWidget called without a PostHog instance.")}),[]),ma(os,{children:["tab"===(null===(t=r.appearance)||void 0===t?void 0:t.widgetType)&&ma("div",{className:"ph-survey-widget-tab",ref:h,onClick:()=>!s&&c(!l),style:{color:ra(r.appearance.widgetColor)},children:[ma("div",{className:"ph-survey-widget-tab-icon"}),(null===(n=r.appearance)||void 0===n?void 0:n.widgetLabel)||""]}),l&&ma(za,{posthog:o,survey:r,forceDisableHtml:i,style:u,removeSurveyFromFocus:a,isPopup:!0},"feedback-widget-survey")]})}var Ja=e=>{var{question:n,forceDisableHtml:r,displayQuestionIndex:i,appearance:o,onSubmit:s,onPreviewSubmit:a}=e,l={[qo.Open]:Na,[qo.Link]:Fa,[qo.Rating]:Oa,[qo.SingleChoice]:La,[qo.MultipleChoice]:La},c={question:n,forceDisableHtml:r,appearance:o,onPreviewSubmit:e=>{a(e)},onSubmit:e=>{s(e)}},u={[qo.Open]:{},[qo.Link]:{},[qo.Rating]:{displayQuestionIndex:i},[qo.SingleChoice]:{displayQuestionIndex:i},[qo.MultipleChoice]:{displayQuestionIndex:i}},d=l[n.type],h=t(t({},c),u[n.type]);return ma(d,t({},h))};function Ka(e){return!mr(Event)&&Qa(e,Event)}function Qa(e,t){try{return e instanceof t}catch(e){return!1}}function el(e){return br(e)||!gr(e)&&!hr(e)}function tl(e,t){return Object.prototype.toString.call(e)==="[object ".concat(t,"]")}function nl(e){return tl(e,"DOMError")}er.__PosthogExtensions__=er.__PosthogExtensions__||{},er.__PosthogExtensions__.canActivateRepeatedly=da,er.__PosthogExtensions__.generateSurveys=ja,er.extendPostHogWithSurveys=ja;var rl=/\(error: (.*)\)/,il=50,ol="?";function sl(e,t,n,r){var i={platform:"web:javascript",filename:e,function:"<anonymous>"===t?ol:t,in_app:!0};return mr(n)||(i.lineno=n),mr(r)||(i.colno=r),i}var al=/^\s*at (\S+?)(?::(\d+))(?::(\d+))\s*$/i,ll=/^\s*at (?:(.+?\)(?: \[.+\])?|.*?) ?\((?:address at )?)?(?:async )?((?:<anonymous>|[-a-z]+:|.*bundle|\/)?.*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i,cl=/\((\S*)(?::(\d+))(?::(\d+))\)/,ul=/^\s*(.*?)(?:\((.*?)\))?(?:^|@)?((?:[-a-z]+)?:\/.*?|\[native code\]|[^@]*(?:bundle|\d+\.js)|\/[\w\-. /=]+)(?::(\d+))?(?::(\d+))?\s*$/i,dl=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i,hl=function(){for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];var i=n.sort(((e,t)=>e[0]-t[0])).map((e=>e[1]));return function(e){for(var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,r=[],o=e.split("\n"),s=n;s<o.length;s++){var a=o[s];if(!(a.length>1024)){var l=rl.test(a)?a.replace(rl,"$1"):a;if(!l.match(/\S*Error: /)){for(var c of i){var u=c(l);if(u){r.push(u);break}}if(r.length>=il)break}}}return function(e){if(!e.length)return[];var n=Array.from(e);return n.reverse(),n.slice(0,il).map((e=>t(t({},e),{},{filename:e.filename||pl(n).filename,function:e.function||ol})))}(r)}}(...[[30,e=>{var t=al.exec(e);if(t){var[,n,r,i]=t;return sl(n,ol,+r,+i)}var o=ll.exec(e);if(o){if(o[2]&&0===o[2].indexOf("eval")){var s=cl.exec(o[2]);s&&(o[2]=s[1],o[3]=s[2],o[4]=s[3])}var[a,l]=vl(o[1]||ol,o[2]);return sl(l,a,o[3]?+o[3]:void 0,o[4]?+o[4]:void 0)}}],[50,e=>{var t=ul.exec(e);if(t){if(t[3]&&t[3].indexOf(" > eval")>-1){var n=dl.exec(t[3]);n&&(t[1]=t[1]||"eval",t[3]=n[1],t[4]=n[2],t[5]="")}var r=t[3],i=t[1]||ol;return[i,r]=vl(i,r),sl(r,i,t[4]?+t[4]:void 0,t[5]?+t[5]:void 0)}}]]);function pl(e){return e[e.length-1]||{}}var vl=(e,t)=>{var n=-1!==e.indexOf("safari-extension"),r=-1!==e.indexOf("safari-web-extension");return n||r?[-1!==e.indexOf("@")?e.split("@")[0]:ol,n?"safari-extension:".concat(t):"safari-web-extension:".concat(t)]:[e,t]},gl=/^(?:[Uu]ncaught (?:exception: )?)?(?:((?:Eval|Internal|Range|Reference|Syntax|Type|URI|)Error): )?(.*)$/i;function fl(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=e.stacktrace||e.stack||"",r=function(e){if(e&&ml.test(e.message))return 1;return 0}(e);try{var i=hl(n,r);return i.slice(0,i.length-t)}catch(e){}return[]}var ml=/Minified React error #\d+;/i;function _l(e,t){var n,r,i=fl(e),o=null===(n=null==t?void 0:t.handled)||void 0===n||n,s=null!==(r=null==t?void 0:t.synthetic)&&void 0!==r&&r;return{$exception_list:[{type:null!=t&&t.overrideExceptionType?t.overrideExceptionType:e.name,value:null!=t&&t.overrideExceptionMessage?t.overrideExceptionMessage:function(e){var t=e.message;if(t.error&&"string"==typeof t.error.message)return t.error.message;return t}(e),stacktrace:{frames:i,type:"raw"},mechanism:{handled:o,synthetic:s}}],$exception_level:"error"}}function yl(e,t){var n,r,i,o=null===(n=null==t?void 0:t.handled)||void 0===n||n,s=null===(r=null==t?void 0:t.synthetic)||void 0===r||r,a={type:null!=t&&t.overrideExceptionType?t.overrideExceptionType:null!==(i=null==t?void 0:t.defaultExceptionType)&&void 0!==i?i:"Error",value:null!=t&&t.overrideExceptionMessage?t.overrideExceptionMessage:e||(null==t?void 0:t.defaultExceptionMessage),mechanism:{handled:o,synthetic:s}};if(null!=t&&t.syntheticException){var l=fl(t.syntheticException,1);l.length&&(a.stacktrace={frames:l,type:"raw"})}return{$exception_list:[a],$exception_level:"error"}}function bl(e){return _r(e)&&!yr(e)&&rr.indexOf(e)>=0}function wl(e,t){var n,r,i=null===(n=null==t?void 0:t.handled)||void 0===n||n,o=null===(r=null==t?void 0:t.synthetic)||void 0===r||r,s=null!=t&&t.overrideExceptionType?t.overrideExceptionType:Ka(e)?e.constructor.name:"Error",a=null!=t&&t.overrideExceptionMessage?t.overrideExceptionMessage:"Non-Error ".concat("exception"," captured with keys: ",function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:40,n=Object.keys(e);if(n.sort(),!n.length)return"[object has no keys]";for(var r=n.length;r>0;r--){var i=n.slice(0,r).join(", ");if(!(i.length>t))return r===n.length||i.length<=t?i:"".concat(i.slice(0,t),"...")}return""}(e)),l={type:s,value:a,mechanism:{handled:i,synthetic:o}};if(null!=t&&t.syntheticException){var c=fl(null==t?void 0:t.syntheticException,1);c.length&&(l.stacktrace={frames:c,type:"raw"})}return{$exception_list:[l],$exception_level:bl(e.level)?e.level:"error"}}function Sl(e,n){var[r,i,o,s,a]=e,l={$exception_list:[]},c=a||r;if(nl(c)||function(e){return tl(e,"DOMException")}(c)){var u=c;if(function(e){return"stack"in e}(c))l=_l(c,n);else{var d=u.name||(nl(u)?"DOMError":"DOMException"),h=u.message?"".concat(d,": ").concat(u.message):d,p=nl(u)?"DOMError":"DOMException";l=yl(h,t(t({},n),{},{overrideExceptionType:p,defaultExceptionMessage:h}))}return"code"in u&&(l.$exception_DOMException_code="".concat(u.code)),l}if(function(e){return tl(e,"ErrorEvent")}(c)&&c.error)return _l(c.error,n);if(function(e){switch(Object.prototype.toString.call(e)){case"[object Error]":case"[object Exception]":case"[object DOMException]":case"[object DOMError]":return!0;default:return Qa(e,Error)}}(c))return _l(c,n);if(function(e){return tl(e,"Object")}(c)||Ka(c))return wl(c,n);if(mr(a)&&_r(r)){var v="Error",g=r,f=r.match(gl);return f&&(v=f[1],g=f[2]),yl(g,t(t({},n),{},{overrideExceptionType:v,defaultExceptionMessage:g}))}return yl(c,n)}function Cl(e){var[t]=e,n=function(e){if(el(e))return e;try{if("reason"in e)return e.reason;if("detail"in e&&"reason"in e.detail)return e.detail.reason}catch(e){}return e}(t);return el(n)?yl("Non-Error promise rejection captured with value: ".concat(String(n)),{handled:!1,synthetic:!1,overrideExceptionType:"UnhandledRejection"}):Sl([n],{handled:!1,overrideExceptionType:"UnhandledRejection",defaultExceptionMessage:String(n)})}var Il=Rr("[ExceptionAutocapture]"),kl={wrapOnError:e=>{var t=Wn;t||Il.info("window not available, cannot wrap onerror");var n=t.onerror;return t.onerror=function(){for(var t,r=arguments.length,i=new Array(r),o=0;o<r;o++)i[o]=arguments[o];var s=Sl(i);return e(s),null!==(t=null==n?void 0:n(...i))&&void 0!==t&&t},t.onerror.__POSTHOG_INSTRUMENTED__=!0,()=>{var e;null===(e=t.onerror)||void 0===e||delete e.__POSTHOG_INSTRUMENTED__,t.onerror=n}},wrapUnhandledRejection:e=>{var t=Wn;t||Il.info("window not available, cannot wrap onUnhandledRejection");var n=t.onunhandledrejection;return t.onunhandledrejection=function(){for(var r,i=arguments.length,o=new Array(i),s=0;s<i;s++)o[s]=arguments[s];var a=Cl(o);return e(a),null!==(r=null==n?void 0:n.apply(t,o))&&void 0!==r&&r},t.onunhandledrejection.__POSTHOG_INSTRUMENTED__=!0,()=>{var e;null===(e=t.onunhandledrejection)||void 0===e||delete e.__POSTHOG_INSTRUMENTED__,t.onunhandledrejection=n}}};er.__PosthogExtensions__=er.__PosthogExtensions__||{},er.__PosthogExtensions__.errorWrappingFunctions=kl,er.__PosthogExtensions__.parseErrorAsProperties=Sl,er.posthogErrorWrappingFunctions=kl,er.parseErrorAsProperties=Sl;var El=(e,t)=>{if(e){var{sessionId:n,windowId:r}=e.checkAndGetSessionAndWindowId(!0);t.headers.set("X-POSTHOG-SESSION-ID",n),t.headers.set("X-POSTHOG-WINDOW-ID",r)}};er.__PosthogExtensions__=er.__PosthogExtensions__||{};var xl={_patchFetch:e=>yo(Wn,"fetch",(t=>function(){var n=r((function*(n,r){var i=new Request(n,r);return El(e,i),t(i)}));return function(e,t){return n.apply(this,arguments)}}())),_patchXHR:e=>yo(Wn.XMLHttpRequest.prototype,"open",(t=>function(n,r){var i=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],o=arguments.length>3?arguments[3]:void 0,s=arguments.length>4?arguments[4]:void 0,a=new Request(r);return El(e,a),t.call(this,n,a.url,i,o,s)}))};er.__PosthogExtensions__.tracingHeadersPatchFns=xl,er.postHogTracingHeadersPatchFns=xl;var Tl,Ml,Rl,Al=function(){var e=self.performance&&performance.getEntriesByType&&performance.getEntriesByType("navigation")[0];if(e&&e.responseStart>0&&e.responseStart<performance.now())return e},Nl=function(e){if("loading"===document.readyState)return"loading";var t=Al();if(t){if(e<t.domInteractive)return"loading";if(0===t.domContentLoadedEventStart||e<t.domContentLoadedEventStart)return"dom-interactive";if(0===t.domComplete||e<t.domComplete)return"dom-content-loaded"}return"complete"},Fl=function(e){var t=e.nodeName;return 1===e.nodeType?t.toLowerCase():t.toUpperCase().replace(/^#/,"")},Ol=function(e,t){var n="";try{for(;e&&9!==e.nodeType;){var r=e,i=r.id?"#"+r.id:Fl(r)+(r.classList&&r.classList.value&&r.classList.value.trim()&&r.classList.value.trim().length?"."+r.classList.value.trim().replace(/\s+/g,"."):"");if(n.length+i.length>(t||100)-1)return n||i;if(n=n?i+">"+n:i,r.id)break;e=r.parentNode}}catch(e){}return n},Pl=-1,Ll=function(){return Pl},Dl=function(e){addEventListener("pageshow",(function(t){t.persisted&&(Pl=t.timeStamp,e(t))}),!0)},Bl=function(){var e=Al();return e&&e.activationStart||0},Hl=function(e,t){var n=Al(),r="navigate";return Ll()>=0?r="back-forward-cache":n&&(document.prerendering||Bl()>0?r="prerender":document.wasDiscarded?r="restore":n.type&&(r=n.type.replace(/_/g,"-"))),{name:e,value:void 0===t?-1:t,rating:"good",delta:0,entries:[],id:"v4-".concat(Date.now(),"-").concat(Math.floor(8999999999999*Math.random())+1e12),navigationType:r}},ql=function(e,t,n){try{if(PerformanceObserver.supportedEntryTypes.includes(e)){var r=new PerformanceObserver((function(e){Promise.resolve().then((function(){t(e.getEntries())}))}));return r.observe(Object.assign({type:e,buffered:!0},n||{})),r}}catch(e){}},$l=function(e,t,n,r){var i,o;return function(s){t.value>=0&&(s||r)&&((o=t.value-(i||0))||void 0===i)&&(i=t.value,t.delta=o,t.rating=function(e,t){return e>t[1]?"poor":e>t[0]?"needs-improvement":"good"}(t.value,n),e(t))}},Wl=function(e){requestAnimationFrame((function(){return requestAnimationFrame((function(){return e()}))}))},Vl=function(e){document.addEventListener("visibilitychange",(function(){"hidden"===document.visibilityState&&e()}))},Zl=function(e){var t=!1;return function(){t||(e(),t=!0)}},Gl=-1,Ul=function(){return"hidden"!==document.visibilityState||document.prerendering?1/0:0},jl=function(e){"hidden"===document.visibilityState&&Gl>-1&&(Gl="visibilitychange"===e.type?e.timeStamp:0,Yl())},zl=function(){addEventListener("visibilitychange",jl,!0),addEventListener("prerenderingchange",jl,!0)},Yl=function(){removeEventListener("visibilitychange",jl,!0),removeEventListener("prerenderingchange",jl,!0)},Xl=function(){return Gl<0&&(Gl=Ul(),zl(),Dl((function(){setTimeout((function(){Gl=Ul(),zl()}),0)}))),{get firstHiddenTime(){return Gl}}},Jl=function(e){document.prerendering?addEventListener("prerenderingchange",(function(){return e()}),!0):e()},Kl=[1800,3e3],Ql=function(e,t){t=t||{},Jl((function(){var n,r=Xl(),i=Hl("FCP"),o=ql("paint",(function(e){e.forEach((function(e){"first-contentful-paint"===e.name&&(o.disconnect(),e.startTime<r.firstHiddenTime&&(i.value=Math.max(e.startTime-Bl(),0),i.entries.push(e),n(!0)))}))}));o&&(n=$l(e,i,Kl,t.reportAllChanges),Dl((function(r){i=Hl("FCP"),n=$l(e,i,Kl,t.reportAllChanges),Wl((function(){i.value=performance.now()-r.timeStamp,n(!0)}))})))}))},ec=[.1,.25],tc=0,nc=1/0,rc=0,ic=function(e){e.forEach((function(e){e.interactionId&&(nc=Math.min(nc,e.interactionId),rc=Math.max(rc,e.interactionId),tc=rc?(rc-nc)/7+1:0)}))},oc=function(){"interactionCount"in performance||Tl||(Tl=ql("event",ic,{type:"event",buffered:!0,durationThreshold:0}))},sc=[],ac=new Map,lc=0,cc=function(){return(Tl?tc:performance.interactionCount||0)-lc},uc=[],dc=function(e){if(uc.forEach((function(t){return t(e)})),e.interactionId||"first-input"===e.entryType){var t=sc[sc.length-1],n=ac.get(e.interactionId);if(n||sc.length<10||e.duration>t.latency){if(n)e.duration>n.latency?(n.entries=[e],n.latency=e.duration):e.duration===n.latency&&e.startTime===n.entries[0].startTime&&n.entries.push(e);else{var r={id:e.interactionId,latency:e.duration,entries:[e]};ac.set(r.id,r),sc.push(r)}sc.sort((function(e,t){return t.latency-e.latency})),sc.length>10&&sc.splice(10).forEach((function(e){return ac.delete(e.id)}))}}},hc=function(e){var t=self.requestIdleCallback||self.setTimeout,n=-1;return e=Zl(e),"hidden"===document.visibilityState?e():(n=t(e),Vl(e)),n},pc=[200,500],vc=[],gc=[],fc=new WeakMap,mc=new Map,_c=-1,yc=function(e){vc=vc.concat(e),bc()},bc=function(){_c<0&&(_c=hc(wc))},wc=function(){mc.size>10&&mc.forEach((function(e,t){ac.has(t)||mc.delete(t)}));var e=sc.map((function(e){return fc.get(e.entries[0])})),t=gc.length-50;gc=gc.filter((function(n,r){return r>=t||e.includes(n)}));for(var n=new Set,r=0;r<gc.length;r++){var i=gc[r];Sc(i.startTime,i.processingEnd).forEach((function(e){n.add(e)}))}for(var o=0;o<50;o++){var s=vc[vc.length-1-o];if(!s||s.startTime<Rl)break;n.add(s)}vc=Array.from(n),_c=-1};uc.push((function(e){e.interactionId&&e.target&&!mc.has(e.interactionId)&&mc.set(e.interactionId,e.target)}),(function(e){var t,n=e.startTime+e.duration;Rl=Math.max(Rl,e.processingEnd);for(var r=gc.length-1;r>=0;r--){var i=gc[r];if(Math.abs(n-i.renderTime)<=8){(t=i).startTime=Math.min(e.startTime,t.startTime),t.processingStart=Math.min(e.processingStart,t.processingStart),t.processingEnd=Math.max(e.processingEnd,t.processingEnd),t.entries.push(e);break}}t||(t={startTime:e.startTime,processingStart:e.processingStart,processingEnd:e.processingEnd,renderTime:n,entries:[e]},gc.push(t)),(e.interactionId||"first-input"===e.entryType)&&fc.set(e,t),bc()}));var Sc=function(e,t){for(var n,r=[],i=0;n=vc[i];i++)if(!(n.startTime+n.duration<e)){if(n.startTime>t)break;r.push(n)}return r},Cc=[2500,4e3],Ic={},kc={onLCP:function(e,t){!function(e,t){t=t||{},Jl((function(){var n,r=Xl(),i=Hl("LCP"),o=function(e){t.reportAllChanges||(e=e.slice(-1)),e.forEach((function(e){e.startTime<r.firstHiddenTime&&(i.value=Math.max(e.startTime-Bl(),0),i.entries=[e],n())}))},s=ql("largest-contentful-paint",o);if(s){n=$l(e,i,Cc,t.reportAllChanges);var a=Zl((function(){Ic[i.id]||(o(s.takeRecords()),s.disconnect(),Ic[i.id]=!0,n(!0))}));["keydown","click"].forEach((function(e){addEventListener(e,(function(){return hc(a)}),!0)})),Vl(a),Dl((function(r){i=Hl("LCP"),n=$l(e,i,Cc,t.reportAllChanges),Wl((function(){i.value=performance.now()-r.timeStamp,Ic[i.id]=!0,n(!0)}))}))}}))}((function(t){var n=function(e){var t={timeToFirstByte:0,resourceLoadDelay:0,resourceLoadDuration:0,elementRenderDelay:e.value};if(e.entries.length){var n=Al();if(n){var r=n.activationStart||0,i=e.entries[e.entries.length-1],o=i.url&&performance.getEntriesByType("resource").filter((function(e){return e.name===i.url}))[0],s=Math.max(0,n.responseStart-r),a=Math.max(s,o?(o.requestStart||o.startTime)-r:0),l=Math.max(a,o?o.responseEnd-r:0),c=Math.max(l,i.startTime-r);t={element:Ol(i.element),timeToFirstByte:s,resourceLoadDelay:a-s,resourceLoadDuration:l-a,elementRenderDelay:c-l,navigationEntry:n,lcpEntry:i},i.url&&(t.url=i.url),o&&(t.lcpResourceEntry=o)}}return Object.assign(e,{attribution:t})}(t);e(n)}),t)},onCLS:function(e,t){!function(e,t){t=t||{},Ql(Zl((function(){var n,r=Hl("CLS",0),i=0,o=[],s=function(e){e.forEach((function(e){if(!e.hadRecentInput){var t=o[0],n=o[o.length-1];i&&e.startTime-n.startTime<1e3&&e.startTime-t.startTime<5e3?(i+=e.value,o.push(e)):(i=e.value,o=[e])}})),i>r.value&&(r.value=i,r.entries=o,n())},a=ql("layout-shift",s);a&&(n=$l(e,r,ec,t.reportAllChanges),Vl((function(){s(a.takeRecords()),n(!0)})),Dl((function(){i=0,r=Hl("CLS",0),n=$l(e,r,ec,t.reportAllChanges),Wl((function(){return n()}))})),setTimeout(n,0))})))}((function(t){var n=function(e){var t,n={};if(e.entries.length){var r=e.entries.reduce((function(e,t){return e&&e.value>t.value?e:t}));if(r&&r.sources&&r.sources.length){var i=(t=r.sources).find((function(e){return e.node&&1===e.node.nodeType}))||t[0];i&&(n={largestShiftTarget:Ol(i.node),largestShiftTime:r.startTime,largestShiftValue:r.value,largestShiftSource:i,largestShiftEntry:r,loadState:Nl(r.startTime)})}}return Object.assign(e,{attribution:n})}(t);e(n)}),t)},onFCP:function(e,t){Ql((function(t){var n=function(e){var t={timeToFirstByte:0,firstByteToFCP:e.value,loadState:Nl(Ll())};if(e.entries.length){var n=Al(),r=e.entries[e.entries.length-1];if(n){var i=n.activationStart||0,o=Math.max(0,n.responseStart-i);t={timeToFirstByte:o,firstByteToFCP:e.value-o,loadState:Nl(e.entries[0].startTime),navigationEntry:n,fcpEntry:r}}}return Object.assign(e,{attribution:t})}(t);e(n)}),t)},onINP:function(e,t){Ml||(Ml=ql("long-animation-frame",yc)),function(e,t){"PerformanceEventTiming"in self&&"interactionId"in PerformanceEventTiming.prototype&&(t=t||{},Jl((function(){var n;oc();var r,i=Hl("INP"),o=function(e){hc((function(){e.forEach(dc);var t,n=(t=Math.min(sc.length-1,Math.floor(cc()/50)),sc[t]);n&&n.latency!==i.value&&(i.value=n.latency,i.entries=n.entries,r())}))},s=ql("event",o,{durationThreshold:null!==(n=t.durationThreshold)&&void 0!==n?n:40});r=$l(e,i,pc,t.reportAllChanges),s&&(s.observe({type:"first-input",buffered:!0}),Vl((function(){o(s.takeRecords()),r(!0)})),Dl((function(){lc=0,sc.length=0,ac.clear(),i=Hl("INP"),r=$l(e,i,pc,t.reportAllChanges)})))})))}((function(t){var n=function(e){var t=e.entries[0],n=fc.get(t),r=t.processingStart,i=n.processingEnd,o=n.entries.sort((function(e,t){return e.processingStart-t.processingStart})),s=Sc(t.startTime,i),a=e.entries.find((function(e){return e.target})),l=a&&a.target||mc.get(t.interactionId),c=[t.startTime+t.duration,i].concat(s.map((function(e){return e.startTime+e.duration}))),u=Math.max.apply(Math,c),d={interactionTarget:Ol(l),interactionTargetElement:l,interactionType:t.name.startsWith("key")?"keyboard":"pointer",interactionTime:t.startTime,nextPaintTime:u,processedEventEntries:o,longAnimationFrameEntries:s,inputDelay:r-t.startTime,processingDuration:i-r,presentationDelay:Math.max(u-i,0),loadState:Nl(t.startTime)};return Object.assign(e,{attribution:d})}(t);e(n)}),t)}};er.__PosthogExtensions__=er.__PosthogExtensions__||{},er.__PosthogExtensions__.postHogWebVitalsCallbacks=kc,er.postHogWebVitalsCallbacks=kc;class Ec{constructor(){this.clicks=[]}isRageClick(e,t,n){var r=this.clicks[this.clicks.length-1];if(r&&Math.abs(e-r.x)+Math.abs(t-r.y)<30&&n-r.timestamp<1e3){if(this.clicks.push({x:e,y:t,timestamp:n}),3===this.clicks.length)return!0}else this.clicks=[{x:e,y:t,timestamp:n}];return!1}}var xc=Rr("[AutoCapture]");function Tc(e,t){return t.length>e?t.slice(0,e)+"...":t}function Mc(e){if(e.previousElementSibling)return e.previousElementSibling;var t=e;do{t=t.previousSibling}while(t&&!Li(t));return t}function Rc(e,t,n,r){var i=e.tagName.toLowerCase(),o={tag_name:i};Ui.indexOf(i)>-1&&!n&&("a"===i.toLowerCase()||"button"===i.toLowerCase()?o.$el_text=Tc(1024,io(e)):o.$el_text=Tc(1024,Zi(e)));var s=Wi(e);s.length>0&&(o.classes=s.filter((function(e){return""!==e}))),Fr(e.attributes,(function(n){var i;if((!Xi(e)||-1!==["name","id","class","aria-label"].indexOf(n.name))&&((null==r||!r.includes(n.name))&&!t&&ro(n.value)&&(i=n.name,!_r(i)||"_ngcontent"!==i.substring(0,10)&&"_nghost"!==i.substring(0,7)))){var s=n.value;"class"===n.name&&(s=qi(s).join(" ")),o["attr__"+n.name]=Tc(1024,s)}}));for(var a=1,l=1,c=e;c=Mc(c);)a++,c.tagName===e.tagName&&l++;return o.nth_child=a,o.nth_of_type=l,o}function Ac(e,t){for(var n,r,{e:i,maskAllElementAttributes:o,maskAllText:s,elementAttributeIgnoreList:a,elementsChainAsString:l}=t,c=[e],u=e;u.parentNode&&!Di(u,"body");)Hi(u.parentNode)?(c.push(u.parentNode.host),u=u.parentNode.host):(c.push(u.parentNode),u=u.parentNode);var d,h=[],p={},v=!1,g=!1;if(Fr(c,(e=>{var t=Yi(e);"a"===e.tagName.toLowerCase()&&(v=e.getAttribute("href"),v=t&&v&&ro(v)&&v),ir(Wi(e),"ph-no-capture")&&(g=!0),h.push(Rc(e,o,s,a));var n=function(e){if(!Yi(e))return{};var t={};return Fr(e.attributes,(function(e){if(e.name&&0===e.name.indexOf("data-ph-capture-attribute")){var n=e.name.replace("data-ph-capture-attribute-",""),r=e.value;n&&r&&ro(r)&&(t[n]=r)}})),t}(e);Or(p,n)})),g)return{props:{},explicitNoCapture:g};if(s||("a"===e.tagName.toLowerCase()||"button"===e.tagName.toLowerCase()?h[0].$el_text=io(e):h[0].$el_text=Zi(e)),v){var f,m;h[0].attr__href=v;var _=null===(f=Ur(v))||void 0===f?void 0:f.host,y=null==Wn||null===(m=Wn.location)||void 0===m?void 0:m.host;_&&y&&_!==y&&(d=v)}return{props:Or({$event_type:i.type,$ce_version:1},l?{}:{$elements:h},{$elements_chain:so(h)},null!==(n=h[0])&&void 0!==n&&n.$el_text?{$el_text:null===(r=h[0])||void 0===r?void 0:r.$el_text}:{},d&&"click"===i.type?{$external_click_url:d}:{},p)}}class Nc{constructor(e){i(this,"_initialized",!1),i(this,"_isDisabledServerSide",null),i(this,"rageclicks",new Ec),i(this,"_elementsChainAsString",!1),this.instance=e,this._elementSelectors=null}get config(){var e,t,n=gr(this.instance.config.autocapture)?this.instance.config.autocapture:{};return n.url_allowlist=null===(e=n.url_allowlist)||void 0===e?void 0:e.map((e=>new RegExp(e))),n.url_ignorelist=null===(t=n.url_ignorelist)||void 0===t?void 0:t.map((e=>new RegExp(e))),n}_addDomEventHandlers(){if(this.isBrowserSupported()){if(Wn&&zn){var e=e=>{e=e||(null==Wn?void 0:Wn.event);try{this._captureEvent(e)}catch(e){xc.error("Failed to capture event",e)}},t=e=>{e=e||(null==Wn?void 0:Wn.event),this._captureEvent(e,tr)};$r(zn,"submit",e,!1,!0),$r(zn,"change",e,!1,!0),$r(zn,"click",e,!1,!0),this.config.capture_copied_text&&($r(zn,"copy",t,!1,!0),$r(zn,"cut",t,!1,!0))}}else xc.info("Disabling Automatic Event Collection because this browser is not supported")}startIfEnabled(){this.isEnabled&&!this._initialized&&(this._addDomEventHandlers(),this._initialized=!0)}onRemoteConfig(e){e.elementsChainAsString&&(this._elementsChainAsString=e.elementsChainAsString),this.instance.persistence&&this.instance.persistence.register({[ti]:!!e.autocapture_opt_out}),this._isDisabledServerSide=!!e.autocapture_opt_out,this.startIfEnabled()}setElementSelectors(e){this._elementSelectors=e}getElementSelectors(e){var t,n=[];return null===(t=this._elementSelectors)||void 0===t||t.forEach((t=>{var r=null==zn?void 0:zn.querySelectorAll(t);null==r||r.forEach((r=>{e===r&&n.push(t)}))})),n}get isEnabled(){var e,t,n=null===(e=this.instance.persistence)||void 0===e?void 0:e.props[ti],r=this._isDisabledServerSide;if(br(r)&&!Cr(n)&&!this.instance.config.advanced_disable_decide)return!1;var i=null!==(t=this._isDisabledServerSide)&&void 0!==t?t:!!n;return!!this.instance.config.autocapture&&!i}_captureEvent(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"$autocapture";if(this.isEnabled){var n,r=Gi(e);if(Bi(r)&&(r=r.parentNode||null),"$autocapture"===t&&"click"===e.type&&e instanceof MouseEvent)this.instance.config.rageclick&&null!==(n=this.rageclicks)&&void 0!==n&&n.isRageClick(e.clientX,e.clientY,(new Date).getTime())&&this._captureEvent(e,"$rageclick");var i=t===tr;if(r&&zi(r,e,this.config,i,i?["copy","cut"]:void 0)){var{props:o,explicitNoCapture:s}=Ac(r,{e:e,maskAllElementAttributes:this.instance.config.mask_all_element_attributes,maskAllText:this.instance.config.mask_all_text,elementAttributeIgnoreList:this.config.element_attribute_ignorelist,elementsChainAsString:this._elementsChainAsString});if(s)return!1;var a=this.getElementSelectors(r);if(a&&a.length>0&&(o.$element_selectors=a),t===tr){var l,c=Vi(null==Wn||null===(l=Wn.getSelection())||void 0===l?void 0:l.toString()),u=e.type||"clipboard";if(!c)return!1;o.$selected_content=c,o.$copy_type=u}return this.instance.capture(t,o),!0}}}isBrowserSupported(){return hr(null==zn?void 0:zn.querySelectorAll)}}var Fc={};function Oc(e){return function(e,t){var n=Fc[e];if(n)return n;var r=t[e];if(pr(r)&&!vr())return Fc[e]=r.bind(t);var i=t.document;if(i&&hr(i.createElement))try{var o=i.createElement("iframe");o.hidden=!0,i.head.appendChild(o);var s=o.contentWindow;s&&s[e]&&(r=s[e]),i.head.removeChild(o)}catch(t){Mr.warn("Could not create sandbox iframe for ".concat(e," check, bailing to assignableWindow.").concat(e,": "),t)}return r&&hr(r)?Fc[e]=r.bind(t):r}("MutationObserver",e)}function Pc(e,t){return Sr(e)&&e>=t}class Lc{asRequiredConfig(e){var t,n,r,i,o=this._defaultConfig((null==e?void 0:e.__onCapture)||this._captureDeadClick.bind(this));return{element_attribute_ignorelist:null!==(t=null==e?void 0:e.element_attribute_ignorelist)&&void 0!==t?t:o.element_attribute_ignorelist,scroll_threshold_ms:null!==(n=null==e?void 0:e.scroll_threshold_ms)&&void 0!==n?n:o.scroll_threshold_ms,selection_change_threshold_ms:null!==(r=null==e?void 0:e.selection_change_threshold_ms)&&void 0!==r?r:o.selection_change_threshold_ms,mutation_threshold_ms:null!==(i=null==e?void 0:e.mutation_threshold_ms)&&void 0!==i?i:o.mutation_threshold_ms,__onCapture:o.__onCapture}}constructor(e,t){i(this,"_clicks",[]),i(this,"_defaultConfig",(e=>({element_attribute_ignorelist:[],scroll_threshold_ms:100,selection_change_threshold_ms:100,mutation_threshold_ms:2500,__onCapture:e}))),i(this,"_onClick",(e=>{var t=function(e){var t=Gi(e);return t?{node:t,originalEvent:e,timestamp:Date.now()}:null}(e);br(t)||this._ignoreClick(t)||this._clicks.push(t),this._clicks.length&&mr(this._checkClickTimer)&&(this._checkClickTimer=er.setTimeout((()=>{this._checkClicks()}),1e3))})),i(this,"_onScroll",(()=>{var e=Date.now();e%50==0&&this._clicks.forEach((t=>{mr(t.scrollDelayMs)&&(t.scrollDelayMs=e-t.timestamp)}))})),i(this,"_onSelectionChange",(()=>{this._lastSelectionChanged=Date.now()})),this.instance=e,this._config=this.asRequiredConfig(t),this._onCapture=this._config.__onCapture}start(e){this._startClickObserver(),this._startScrollObserver(),this._startSelectionChangedObserver(),this._startMutationObserver(e)}_startMutationObserver(e){if(!this._mutationObserver){var t=Oc(er);this._mutationObserver=new t((e=>{this.onMutation(e)})),this._mutationObserver.observe(e,{attributes:!0,characterData:!0,childList:!0,subtree:!0})}}stop(){var e;null===(e=this._mutationObserver)||void 0===e||e.disconnect(),this._mutationObserver=void 0,er.removeEventListener("click",this._onClick),er.removeEventListener("scroll",this._onScroll,{capture:!0}),er.removeEventListener("selectionchange",this._onSelectionChange)}onMutation(e){this._lastMutation=Date.now()}_startClickObserver(){er.addEventListener("click",this._onClick)}_startScrollObserver(){er.addEventListener("scroll",this._onScroll,{capture:!0,passive:!0})}_startSelectionChangedObserver(){er.addEventListener("selectionchange",this._onSelectionChange)}_ignoreClick(e){if(!e)return!0;if(Pi(e.node))return!0;var t=this._clicks.some((t=>t.node===e.node&&Math.abs(t.timestamp-e.timestamp)<1e3));return!!t||!(!Di(e.node,"html")&&Li(e.node)&&!Ui.includes(e.node.tagName.toLowerCase()))}_checkClicks(){if(this._clicks.length){clearTimeout(this._checkClickTimer),this._checkClickTimer=void 0;var e=this._clicks;for(var t of(this._clicks=[],e)){var n;t.mutationDelayMs=null!==(n=t.mutationDelayMs)&&void 0!==n?n:this._lastMutation&&t.timestamp<=this._lastMutation?this._lastMutation-t.timestamp:void 0,t.absoluteDelayMs=Date.now()-t.timestamp,t.selectionChangedDelayMs=this._lastSelectionChanged&&t.timestamp<=this._lastSelectionChanged?this._lastSelectionChanged-t.timestamp:void 0;var r=Pc(t.scrollDelayMs,this._config.scroll_threshold_ms),i=Pc(t.selectionChangedDelayMs,this._config.selection_change_threshold_ms),o=Pc(t.mutationDelayMs,this._config.mutation_threshold_ms),s=Pc(t.absoluteDelayMs,1.1*this._config.mutation_threshold_ms),a=Sr(t.scrollDelayMs)&&t.scrollDelayMs<this._config.scroll_threshold_ms,l=Sr(t.mutationDelayMs)&&t.mutationDelayMs<this._config.mutation_threshold_ms,c=Sr(t.selectionChangedDelayMs)&&t.selectionChangedDelayMs<this._config.selection_change_threshold_ms;a||l||c||(r||o||s||i?this._onCapture(t,{$dead_click_last_mutation_timestamp:this._lastMutation,$dead_click_event_timestamp:t.timestamp,$dead_click_scroll_timeout:r,$dead_click_mutation_timeout:o,$dead_click_absolute_timeout:s,$dead_click_selection_changed_timeout:i}):t.absoluteDelayMs<this._config.mutation_threshold_ms&&this._clicks.push(t))}this._clicks.length&&mr(this._checkClickTimer)&&(this._checkClickTimer=er.setTimeout((()=>{this._checkClicks()}),1e3))}}_captureDeadClick(e,n){this.instance.capture("$dead_click",t(t(t({},n),Ac(e.node,{e:e.originalEvent,maskAllElementAttributes:this.instance.config.mask_all_element_attributes,maskAllText:this.instance.config.mask_all_text,elementAttributeIgnoreList:this._config.element_attribute_ignorelist,elementsChainAsString:!1}).props),{},{$dead_click_scroll_delay_ms:e.scrollDelayMs,$dead_click_mutation_delay_ms:e.mutationDelayMs,$dead_click_absolute_delay_ms:e.absoluteDelayMs,$dead_click_selection_changed_delay_ms:e.selectionChangedDelayMs}),{timestamp:new Date(e.timestamp)})}}er.__PosthogExtensions__=er.__PosthogExtensions__||{},er.__PosthogExtensions__.initDeadClicksAutocapture=(e,t)=>new Lc(e,t);var Dc=Rr("[FeatureFlags]"),Bc="$active_feature_flags",Hc="$override_feature_flags",qc="$feature_flag_payloads",$c=e=>{var t={};for(var[n,r]of Lr(e||{}))r&&(t[n]=r);return t};class Wc{constructor(e){i(this,"_override_warning",!1),i(this,"_hasLoadedFlags",!1),i(this,"_requestInFlight",!1),i(this,"_reloadingDisabled",!1),i(this,"_additionalReloadRequested",!1),i(this,"_decideCalled",!1),i(this,"_flagsLoadedFromRemote",!1),this.instance=e,this.featureFlagEventHandlers=[]}decide(){if(this.instance.config.__preview_remote_config)this._decideCalled=!0;else{var e=!this._reloadDebouncer&&(this.instance.config.advanced_disable_feature_flags||this.instance.config.advanced_disable_feature_flags_on_first_load);this._callDecideEndpoint({disableFlags:e})}}get hasLoadedFlags(){return this._hasLoadedFlags}getFlags(){return Object.keys(this.getFlagVariants())}getFlagVariants(){var e=this.instance.get_property(_i),t=this.instance.get_property(Hc);if(!t)return e||{};for(var n=Or({},e),r=Object.keys(t),i=0;i<r.length;i++)n[r[i]]=t[r[i]];return this._override_warning||(Dc.warn(" Overriding feature flags!",{enabledFlags:e,overriddenFlags:t,finalFlags:n}),this._override_warning=!0),n}getFlagPayloads(){return this.instance.get_property(qc)||{}}reloadFeatureFlags(){this._reloadingDisabled||this.instance.config.advanced_disable_feature_flags||this._reloadDebouncer||(this._reloadDebouncer=setTimeout((()=>{this._callDecideEndpoint()}),5))}clearDebouncer(){clearTimeout(this._reloadDebouncer),this._reloadDebouncer=void 0}ensureFlagsLoaded(){this._hasLoadedFlags||this._requestInFlight||this._reloadDebouncer||this.reloadFeatureFlags()}setAnonymousDistinctId(e){this.$anon_distinct_id=e}setReloadingPaused(e){this._reloadingDisabled=e}_callDecideEndpoint(e){if(this.clearDebouncer(),!this.instance.config.advanced_disable_decide)if(this._requestInFlight)this._additionalReloadRequested=!0;else{var t={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:this.instance.get_property(bi),group_properties:this.instance.get_property(wi)};(null!=e&&e.disableFlags||this.instance.config.advanced_disable_feature_flags)&&(t.disable_flags=!0),this._requestInFlight=!0,this.instance._send_request({method:"POST",url:this.instance.requestRouter.endpointFor("api","/decide/?v=3"),data:t,compression:this.instance.config.disable_compression?void 0:qn.Base64,timeout:this.instance.config.feature_flag_request_timeout_ms,callback:e=>{var n,r,i=!0;(200===e.statusCode&&(this.$anon_distinct_id=void 0,i=!1),this._requestInFlight=!1,this._decideCalled)||(this._decideCalled=!0,this.instance._onRemoteConfig(null!==(r=e.json)&&void 0!==r?r:{}));t.disable_flags||(this._flagsLoadedFromRemote=!i,this.receivedFeatureFlags(null!==(n=e.json)&&void 0!==n?n:{},i),this._additionalReloadRequested&&(this._additionalReloadRequested=!1,this._callDecideEndpoint()))}})}}getFeatureFlag(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(this._hasLoadedFlags||this.getFlags()&&this.getFlags().length>0){var n,r,i,o,s,a=this.getFlagVariants()[e],l="".concat(a),c=this.instance.get_property(Ii)||{};if(t.send_event||!("send_event"in t))if(!(e in c)||!c[e].includes(l))dr(c[e])?c[e].push(l):c[e]=[l],null===(n=this.instance.persistence)||void 0===n||n.register({[Ii]:c}),this.instance.capture("$feature_flag_called",{$feature_flag:e,$feature_flag_response:a,$feature_flag_payload:this.getFeatureFlagPayload(e)||null,$feature_flag_bootstrapped_response:(null===(r=this.instance.config.bootstrap)||void 0===r||null===(i=r.featureFlags)||void 0===i?void 0:i[e])||null,$feature_flag_bootstrapped_payload:(null===(o=this.instance.config.bootstrap)||void 0===o||null===(s=o.featureFlagPayloads)||void 0===s?void 0:s[e])||null,$used_bootstrap_value:!this._flagsLoadedFromRemote});return a}Dc.warn('getFeatureFlag for key "'+e+"\" failed. Feature flags didn't load in time.")}getFeatureFlagPayload(e){return this.getFlagPayloads()[e]}isFeatureEnabled(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(this._hasLoadedFlags||this.getFlags()&&this.getFlags().length>0)return!!this.getFeatureFlag(e,t);Dc.warn('isFeatureEnabled for key "'+e+"\" failed. Feature flags didn't load in time.")}addFeatureFlagsHandler(e){this.featureFlagEventHandlers.push(e)}removeFeatureFlagsHandler(e){this.featureFlagEventHandlers=this.featureFlagEventHandlers.filter((t=>t!==e))}receivedFeatureFlags(e,n){if(this.instance.persistence){this._hasLoadedFlags=!0;var r=this.getFlagVariants(),i=this.getFlagPayloads();!function(e,n){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},o=e.featureFlags,s=e.featureFlagPayloads;if(o)if(dr(o)){var a={};if(o)for(var l=0;l<o.length;l++)a[o[l]]=!0;n&&n.register({[Bc]:o,[_i]:a})}else{var c=o,u=s;e.errorsWhileComputingFlags&&(c=t(t({},r),c),u=t(t({},i),u)),n&&n.register({[Bc]:Object.keys($c(c)),[_i]:c||{},[qc]:u||{}})}}(e,this.instance.persistence,r,i),this._fireFeatureFlagsCallbacks(n)}}override(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(!this.instance.__loaded||!this.instance.persistence)return Dc.uninitializedWarning("posthog.feature_flags.override");if(this._override_warning=t,!1===e)this.instance.persistence.unregister(Hc);else if(dr(e)){for(var n={},r=0;r<e.length;r++)n[e[r]]=!0;this.instance.persistence.register({[Hc]:n})}else this.instance.persistence.register({[Hc]:e})}onFeatureFlags(e){if(this.addFeatureFlagsHandler(e),this._hasLoadedFlags){var{flags:t,flagVariants:n}=this._prepareFeatureFlagsForCallbacks();e(t,n)}return()=>this.removeFeatureFlagsHandler(e)}updateEarlyAccessFeatureEnrollment(e,n){var r,i=(this.instance.get_property(yi)||[]).find((t=>t.flagKey===e)),o={["$feature_enrollment/".concat(e)]:n},s={$feature_flag:e,$feature_enrollment:n,$set:o};i&&(s.$early_access_feature_name=i.name),this.instance.capture("$feature_enrollment_update",s),this.setPersonPropertiesForFlags(o,!1);var a=t(t({},this.getFlagVariants()),{},{[e]:n});null===(r=this.instance.persistence)||void 0===r||r.register({[Bc]:Object.keys($c(a)),[_i]:a}),this._fireFeatureFlagsCallbacks()}getEarlyAccessFeatures(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=this.instance.get_property(yi);if(n&&!t)return e(n);this.instance._send_request({url:this.instance.requestRouter.endpointFor("api","/api/early_access_features/?token=".concat(this.instance.config.token)),method:"GET",callback:t=>{var n;if(t.json){var r=t.json.earlyAccessFeatures;return null===(n=this.instance.persistence)||void 0===n||n.register({[yi]:r}),e(r)}}})}_prepareFeatureFlagsForCallbacks(){var e=this.getFlags(),t=this.getFlagVariants();return{flags:e.filter((e=>t[e])),flagVariants:Object.keys(t).filter((e=>t[e])).reduce(((e,n)=>(e[n]=t[n],e)),{})}}_fireFeatureFlagsCallbacks(e){var{flags:t,flagVariants:n}=this._prepareFeatureFlagsForCallbacks();this.featureFlagEventHandlers.forEach((r=>r(t,n,{errorsLoading:e})))}setPersonPropertiesForFlags(e){var n=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],r=this.instance.get_property(bi)||{};this.instance.register({[bi]:t(t({},r),e)}),n&&this.instance.reloadFeatureFlags()}resetPersonPropertiesForFlags(){this.instance.unregister(bi)}setGroupPropertiesForFlags(e){var n=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],r=this.instance.get_property(wi)||{};0!==Object.keys(r).length&&Object.keys(r).forEach((n=>{r[n]=t(t({},r[n]),e[n]),delete e[n]})),this.instance.register({[wi]:t(t({},r),e)}),n&&this.instance.reloadFeatureFlags()}resetGroupPropertiesForFlags(e){if(e){var n=this.instance.get_property(wi)||{};this.instance.register({[wi]:t(t({},n),{},{[e]:{}})})}else this.instance.unregister(wi)}}Math.trunc||(Math.trunc=function(e){return e<0?Math.ceil(e):Math.floor(e)}),Number.isInteger||(Number.isInteger=function(e){return Sr(e)&&isFinite(e)&&Math.floor(e)===e});var Vc="0123456789abcdef";class Zc{constructor(e){if(this.bytes=e,16!==e.length)throw new TypeError("not 128-bit length")}static fromFieldsV7(e,t,n,r){if(!Number.isInteger(e)||!Number.isInteger(t)||!Number.isInteger(n)||!Number.isInteger(r)||e<0||t<0||n<0||r<0||e>0xffffffffffff||t>4095||n>1073741823||r>4294967295)throw new RangeError("invalid field value");var i=new Uint8Array(16);return i[0]=e/Math.pow(2,40),i[1]=e/Math.pow(2,32),i[2]=e/Math.pow(2,24),i[3]=e/Math.pow(2,16),i[4]=e/Math.pow(2,8),i[5]=e,i[6]=112|t>>>8,i[7]=t,i[8]=128|n>>>24,i[9]=n>>>16,i[10]=n>>>8,i[11]=n,i[12]=r>>>24,i[13]=r>>>16,i[14]=r>>>8,i[15]=r,new Zc(i)}toString(){for(var e="",t=0;t<this.bytes.length;t++)e=e+Vc.charAt(this.bytes[t]>>>4)+Vc.charAt(15&this.bytes[t]),3!==t&&5!==t&&7!==t&&9!==t||(e+="-");if(36!==e.length)throw new Error("Invalid UUIDv7 was generated");return e}clone(){return new Zc(this.bytes.slice(0))}equals(e){return 0===this.compareTo(e)}compareTo(e){for(var t=0;t<16;t++){var n=this.bytes[t]-e.bytes[t];if(0!==n)return Math.sign(n)}return 0}}class Gc{constructor(){i(this,"timestamp",0),i(this,"counter",0),i(this,"random",new zc)}generate(){var e=this.generateOrAbort();if(mr(e)){this.timestamp=0;var t=this.generateOrAbort();if(mr(t))throw new Error("Could not generate UUID after timestamp reset");return t}return e}generateOrAbort(){var e=Date.now();if(e>this.timestamp)this.timestamp=e,this.resetCounter();else{if(!(e+1e4>this.timestamp))return;this.counter++,this.counter>4398046511103&&(this.timestamp++,this.resetCounter())}return Zc.fromFieldsV7(this.timestamp,Math.trunc(this.counter/Math.pow(2,30)),this.counter&Math.pow(2,30)-1,this.random.nextUint32())}resetCounter(){this.counter=1024*this.random.nextUint32()+(1023&this.random.nextUint32())}}var Uc,jc=e=>{if("undefined"!=typeof UUIDV7_DENY_WEAK_RNG&&UUIDV7_DENY_WEAK_RNG)throw new Error("no cryptographically strong RNG available");for(var t=0;t<e.length;t++)e[t]=65536*Math.trunc(65536*Math.random())+Math.trunc(65536*Math.random());return e};Wn&&!mr(Wn.crypto)&&crypto.getRandomValues&&(jc=e=>crypto.getRandomValues(e));class zc{constructor(){i(this,"buffer",new Uint32Array(8)),i(this,"cursor",1/0)}nextUint32(){return this.cursor>=this.buffer.length&&(jc(this.buffer),this.cursor=0),this.buffer[this.cursor++]}}var Yc=()=>Xc().toString(),Xc=()=>(Uc||(Uc=new Gc)).generate(),Jc="Thu, 01 Jan 1970 00:00:00 GMT",Kc="";var Qc=/[a-z0-9][a-z0-9-]+\.[a-z]{2,}$/i;function eu(e,t){if(t){var n=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:zn;if(Kc)return Kc;if(!t)return"";if(["localhost","127.0.0.1"].includes(e))return"";for(var n=e.split("."),r=Math.min(n.length,8),i="dmn_chk_"+Yc(),o=new RegExp("(^|;)\\s*"+i+"=1");!Kc&&r--;){var s=n.slice(r).join("."),a=i+"=1;domain=."+s;t.cookie=a,o.test(t.cookie)&&(t.cookie=a+";expires="+Jc,Kc=s)}return Kc}(e);if(!n){var r=(e=>{var t=e.match(Qc);return t?t[0]:""})(e);r!==n&&Mr.info("Warning: cookie subdomain discovery mismatch",r,n),n=r}return n?"; domain=."+n:""}return""}var tu={is_supported:()=>!!zn,error:function(e){Mr.error("cookieStore error: "+e)},get:function(e){if(zn){try{for(var t=e+"=",n=zn.cookie.split(";").filter((e=>e.length)),r=0;r<n.length;r++){for(var i=n[r];" "==i.charAt(0);)i=i.substring(1,i.length);if(0===i.indexOf(t))return decodeURIComponent(i.substring(t.length,i.length))}}catch(e){}return null}},parse:function(e){var t;try{t=JSON.parse(tu.get(e))||{}}catch(e){}return t},set:function(e,t,n,r,i){if(zn)try{var o="",s="",a=eu(zn.location.hostname,r);if(n){var l=new Date;l.setTime(l.getTime()+24*n*60*60*1e3),o="; expires="+l.toUTCString()}i&&(s="; secure");var c=e+"="+encodeURIComponent(JSON.stringify(t))+o+"; SameSite=Lax; path=/"+a+s;return c.length>3686.4&&Mr.warn("cookieStore warning: large cookie, len="+c.length),zn.cookie=c,c}catch(e){return}},remove:function(e,t){try{tu.set(e,"",-1,t)}catch(e){return}}},nu=null,ru={is_supported:function(){if(!br(nu))return nu;var e=!0;if(mr(Wn))e=!1;else try{var t="__mplssupport__";ru.set(t,"xyz"),'"xyz"'!==ru.get(t)&&(e=!1),ru.remove(t)}catch(t){e=!1}return e||Mr.error("localStorage unsupported; falling back to cookie store"),nu=e,e},error:function(e){Mr.error("localStorage error: "+e)},get:function(e){try{return null==Wn?void 0:Wn.localStorage.getItem(e)}catch(e){ru.error(e)}return null},parse:function(e){try{return JSON.parse(ru.get(e))||{}}catch(e){}return null},set:function(e,t){try{null==Wn||Wn.localStorage.setItem(e,JSON.stringify(t))}catch(e){ru.error(e)}},remove:function(e){try{null==Wn||Wn.localStorage.removeItem(e)}catch(e){ru.error(e)}}},iu=["distinct_id",vi,gi,Ai,Ri],ou=t(t({},ru),{},{parse:function(e){try{var t={};try{t=tu.parse(e)||{}}catch(e){}var n=Or(t,JSON.parse(ru.get(e)||"{}"));return ru.set(e,n),n}catch(e){}return null},set:function(e,t,n,r,i,o){try{ru.set(e,t,void 0,void 0,o);var s={};iu.forEach((e=>{t[e]&&(s[e]=t[e])})),Object.keys(s).length&&tu.set(e,s,n,r,i,o)}catch(e){ru.error(e)}},remove:function(e,t){try{null==Wn||Wn.localStorage.removeItem(e),tu.remove(e,t)}catch(e){ru.error(e)}}}),su={},au={is_supported:function(){return!0},error:function(e){Mr.error("memoryStorage error: "+e)},get:function(e){return su[e]||null},parse:function(e){return su[e]||null},set:function(e,t){su[e]=t},remove:function(e){delete su[e]}},lu=null,cu={is_supported:function(){if(!br(lu))return lu;if(lu=!0,mr(Wn))lu=!1;else try{var e="__support__";cu.set(e,"xyz"),'"xyz"'!==cu.get(e)&&(lu=!1),cu.remove(e)}catch(e){lu=!1}return lu},error:function(e){Mr.error("sessionStorage error: ",e)},get:function(e){try{return null==Wn?void 0:Wn.sessionStorage.getItem(e)}catch(e){cu.error(e)}return null},parse:function(e){try{return JSON.parse(cu.get(e))||null}catch(e){}return null},set:function(e,t){try{null==Wn||Wn.sessionStorage.setItem(e,JSON.stringify(t))}catch(e){cu.error(e)}},remove:function(e){try{null==Wn||Wn.sessionStorage.removeItem(e)}catch(e){cu.error(e)}}},uu="Mobile",du="iOS",hu="Android",pu="Tablet",vu=hu+" "+pu,gu="iPad",fu="Apple",mu=fu+" Watch",_u="Safari",yu="BlackBerry",bu="Samsung",wu=bu+"Browser",Su=bu+" Internet",Cu="Chrome",Iu=Cu+" OS",ku=Cu+" "+du,Eu="Internet Explorer",xu=Eu+" "+uu,Tu="Opera",Mu=Tu+" Mini",Ru="Edge",Au="Microsoft "+Ru,Nu="Firefox",Fu=Nu+" "+du,Ou="Nintendo",Pu="PlayStation",Lu="Xbox",Du=hu+" "+uu,Bu=uu+" "+_u,Hu="Windows",qu=Hu+" Phone",$u="Nokia",Wu="Ouya",Vu="Generic",Zu=Vu+" "+uu.toLowerCase(),Gu=Vu+" "+pu.toLowerCase(),Uu="Konqueror",ju="(\\d+(\\.\\d+)?)",zu=new RegExp("Version/"+ju),Yu=new RegExp(Lu,"i"),Xu=new RegExp(Pu+" \\w+","i"),Ju=new RegExp(Ou+" \\w+","i"),Ku=new RegExp(yu+"|PlayBook|BB10","i"),Qu={"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 ed=(e,t)=>t&&ir(t,fu)||function(e){return ir(e,_u)&&!ir(e,Cu)&&!ir(e,hu)}(e),td=function(e,t){return t=t||"",ir(e," OPR/")&&ir(e,"Mini")?Mu:ir(e," OPR/")?Tu:Ku.test(e)?yu:ir(e,"IE"+uu)||ir(e,"WPDesktop")?xu:ir(e,wu)?Su:ir(e,Ru)||ir(e,"Edg/")?Au:ir(e,"FBIOS")?"Facebook "+uu:ir(e,"UCWEB")||ir(e,"UCBrowser")?"UC Browser":ir(e,"CriOS")?ku:ir(e,"CrMo")||ir(e,Cu)?Cu:ir(e,hu)&&ir(e,_u)?Du:ir(e,"FxiOS")?Fu:ir(e.toLowerCase(),Uu.toLowerCase())?Uu:ed(e,t)?ir(e,uu)?Bu:_u:ir(e,Nu)?Nu:ir(e,"MSIE")||ir(e,"Trident/")?Eu:ir(e,"Gecko")?Nu:""},nd={[xu]:[new RegExp("rv:"+ju)],[Au]:[new RegExp(Ru+"?\\/"+ju)],[Cu]:[new RegExp("("+Cu+"|CrMo)\\/"+ju)],[ku]:[new RegExp("CriOS\\/"+ju)],"UC Browser":[new RegExp("(UCBrowser|UCWEB)\\/"+ju)],[_u]:[zu],[Bu]:[zu],[Tu]:[new RegExp("(Opera|OPR)\\/"+ju)],[Nu]:[new RegExp(Nu+"\\/"+ju)],[Fu]:[new RegExp("FxiOS\\/"+ju)],[Uu]:[new RegExp("Konqueror[:/]?"+ju,"i")],[yu]:[new RegExp(yu+" "+ju),zu],[Du]:[new RegExp("android\\s"+ju,"i")],[Su]:[new RegExp(wu+"\\/"+ju)],[Eu]:[new RegExp("(rv:|MSIE )"+ju)],Mozilla:[new RegExp("rv:"+ju)]},rd=[[new RegExp(Lu+"; "+Lu+" (.*?)[);]","i"),e=>[Lu,e&&e[1]||""]],[new RegExp(Ou,"i"),[Ou,""]],[new RegExp(Pu,"i"),[Pu,""]],[Ku,[yu,""]],[new RegExp(Hu,"i"),(e,t)=>{if(/Phone/.test(t)||/WPDesktop/.test(t))return[qu,""];if(new RegExp(uu).test(t)&&!/IEMobile\b/.test(t))return[Hu+" "+uu,""];var n=/Windows NT ([0-9.]+)/i.exec(t);if(n&&n[1]){var r=n[1],i=Qu[r]||"";return/arm/i.test(t)&&(i="RT"),[Hu,i]}return[Hu,""]}],[/((iPhone|iPad|iPod).*?OS (\d+)_(\d+)_?(\d+)?|iPhone)/,e=>{if(e&&e[3]){var t=[e[3],e[4],e[5]||"0"];return[du,t.join(".")]}return[du,""]}],[/(watch.*\/(\d+\.\d+\.\d+)|watch os,(\d+\.\d+),)/i,e=>{var t="";return e&&e.length>=3&&(t=mr(e[2])?e[3]:e[2]),["watchOS",t]}],[new RegExp("("+hu+" (\\d+)\\.(\\d+)\\.?(\\d+)?|"+hu+")","i"),e=>{if(e&&e[2]){var t=[e[2],e[3],e[4]||"0"];return[hu,t.join(".")]}return[hu,""]}],[/Mac OS X (\d+)[_.](\d+)[_.]?(\d+)?/i,e=>{var t=["Mac OS X",""];if(e&&e[1]){var n=[e[1],e[2],e[3]||"0"];t[1]=n.join(".")}return t}],[/Mac/i,["Mac OS X",""]],[/CrOS/,[Iu,""]],[/Linux|debian/i,["Linux",""]]],id=function(e){return Ju.test(e)?Ou:Xu.test(e)?Pu:Yu.test(e)?Lu:new RegExp(Wu,"i").test(e)?Wu:new RegExp("("+qu+"|WPDesktop)","i").test(e)?qu:/iPad/.test(e)?gu:/iPod/.test(e)?"iPod Touch":/iPhone/.test(e)?"iPhone":/(watch)(?: ?os[,/]|\d,\d\/)[\d.]+/i.test(e)?mu:Ku.test(e)?yu:/(kobo)\s(ereader|touch)/i.test(e)?"Kobo":new RegExp($u,"i").test(e)?$u:/(kf[a-z]{2}wi|aeo[c-r]{2})( bui|\))/i.test(e)||/(kf[a-z]+)( bui|\)).+silk\//i.test(e)?"Kindle Fire":/(Android|ZTE)/i.test(e)?!new RegExp(uu).test(e)||/(9138B|TB782B|Nexus [97]|pixel c|HUAWEISHT|BTV|noble nook|smart ultra 6)/i.test(e)?/pixel[\daxl ]{1,6}/i.test(e)&&!/pixel c/i.test(e)||/(huaweimed-al00|tah-|APA|SM-G92|i980|zte|U304AA)/i.test(e)||/lmy47v/i.test(e)&&!/QTAQZ3/i.test(e)?hu:vu:hu:new RegExp("(pda|"+uu+")","i").test(e)?Zu:new RegExp(pu,"i").test(e)&&!new RegExp(pu+" pc","i").test(e)?Gu:""},od="https?://(.*)",sd=["gclid","gclsrc","dclid","gbraid","wbraid","fbclid","msclkid","twclid","li_fat_id","igshid","ttclid","rdt_cid","irclid","_kx"],ad=Pr(["utm_source","utm_medium","utm_campaign","utm_content","utm_term","gad_source","mc_cid"],sd),ld="<masked>",cd={campaignParams:function(){var{customTrackedParams:e,maskPersonalDataProperties:t,customPersonalDataProperties:n}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(!zn)return{};var r=t?Pr([],sd,n||[]):[];return this._campaignParamsFromUrl(Xr(zn.URL,r,ld),e)},_campaignParamsFromUrl:function(e,t){var n=ad.concat(t||[]),r={};return Fr(n,(function(t){var n=Yr(e,t);r[t]=n||null})),r},_searchEngine:function(e){return e?0===e.search(od+"google.([^/?]*)")?"google":0===e.search(od+"bing.com")?"bing":0===e.search(od+"yahoo.com")?"yahoo":0===e.search(od+"duckduckgo.com")?"duckduckgo":null:null},_searchInfoFromReferrer:function(e){var t=cd._searchEngine(e),n="yahoo"!=t?"q":"p",r={};if(!br(t)){r.$search_engine=t;var i=zn?Yr(zn.referrer,n):"";i.length&&(r.ph_keyword=i)}return r},searchInfo:function(){var e=null==zn?void 0:zn.referrer;return e?this._searchInfoFromReferrer(e):{}},browser:td,browserVersion:function(e,t){var n=td(e,t),r=nd[n];if(mr(r))return null;for(var i=0;i<r.length;i++){var o=r[i],s=e.match(o);if(s)return parseFloat(s[s.length-2])}return null},browserLanguage:function(){return navigator.language||navigator.userLanguage},browserLanguagePrefix:function(){var e=this.browserLanguage();return"string"==typeof e?e.split("-")[0]:void 0},os:function(e){for(var t=0;t<rd.length;t++){var[n,r]=rd[t],i=n.exec(e),o=i&&(hr(r)?r(i,e):r);if(o)return o}return["",""]},device:id,deviceType:function(e){var t=id(e);return t===gu||t===vu||"Kobo"===t||"Kindle Fire"===t||t===Gu?pu:t===Ou||t===Lu||t===Pu||t===Wu?"Console":t===mu?"Wearable":t?uu:"Desktop"},referrer:function(){return(null==zn?void 0:zn.referrer)||"$direct"},referringDomain:function(){var e;return null!=zn&&zn.referrer&&(null===(e=Ur(zn.referrer))||void 0===e?void 0:e.host)||"$direct"},referrerInfo:function(){return{$referrer:this.referrer(),$referring_domain:this.referringDomain()}},initialPersonInfo:function(){return{r:this.referrer().substring(0,1e3),u:null==Yn?void 0:Yn.href.substring(0,1e3)}},initialPersonPropsFromInfo:function(e){var t,{r:n,u:r}=e,i={$initial_referrer:n,$initial_referring_domain:null==n?void 0:"$direct"==n?"$direct":null===(t=Ur(n))||void 0===t?void 0:t.host};if(r){i.$initial_current_url=r;var o=Ur(r);i.$initial_host=null==o?void 0:o.host,i.$initial_pathname=null==o?void 0:o.pathname,Fr(this._campaignParamsFromUrl(r),(function(e,t){i["$initial_"+sr(t)]=e}))}n&&Fr(this._searchInfoFromReferrer(n),(function(e,t){i["$initial_"+sr(t)]=e}));return i},timezone:function(){try{return Intl.DateTimeFormat().resolvedOptions().timeZone}catch(e){return}},timezoneOffset:function(){try{return(new Date).getTimezoneOffset()}catch(e){return}},properties:function(){var{maskPersonalDataProperties:e,customPersonalDataProperties:t}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(!Qn)return{};var n=e?Pr([],sd,t||[]):[],[r,i]=cd.os(Qn);return Or(Hr({$os:r,$os_version:i,$browser:cd.browser(Qn,navigator.vendor),$device:cd.device(Qn),$device_type:cd.deviceType(Qn),$timezone:cd.timezone(),$timezone_offset:cd.timezoneOffset()}),{$current_url:Xr(null==Yn?void 0:Yn.href,n,ld),$host:null==Yn?void 0:Yn.host,$pathname:null==Yn?void 0:Yn.pathname,$raw_user_agent:Qn.length>1e3?Qn.substring(0,997)+"...":Qn,$browser_version:cd.browserVersion(Qn,navigator.vendor),$browser_language:cd.browserLanguage(),$browser_language_prefix:cd.browserLanguagePrefix(),$screen_height:null==Wn?void 0:Wn.screen.height,$screen_width:null==Wn?void 0:Wn.screen.width,$viewport_height:null==Wn?void 0:Wn.innerHeight,$viewport_width:null==Wn?void 0:Wn.innerWidth,$lib:"web",$lib_version:xr.LIB_VERSION,$insert_id:Math.random().toString(36).substring(2,10)+Math.random().toString(36).substring(2,10),$time:Date.now()/1e3})},people_properties:function(){if(!Qn)return{};var[e,t]=cd.os(Qn);return Or(Hr({$os:e,$os_version:t,$browser:cd.browser(Qn,navigator.vendor)}),{$browser_version:cd.browserVersion(Qn,navigator.vendor)})}},ud=["cookie","localstorage","localstorage+cookie","sessionstorage","memory"];class dd{constructor(e){this.config=e,this.props={},this.campaign_params_saved=!1,this.name=(e=>{var t="";return e.token&&(t=e.token.replace(/\+/g,"PL").replace(/\//g,"SL").replace(/=/g,"EQ")),e.persistence_name?"ph_"+e.persistence_name:"ph_"+t+"_posthog"})(e),this.storage=this.buildStorage(e),this.load(),e.debug&&Mr.info("Persistence loaded",e.persistence,t({},this.props)),this.update_config(e,e),this.save()}buildStorage(e){-1===ud.indexOf(e.persistence.toLowerCase())&&(Mr.critical("Unknown persistence type "+e.persistence+"; falling back to localStorage+cookie"),e.persistence="localStorage+cookie");var t=e.persistence.toLowerCase();return"localstorage"===t&&ru.is_supported()?ru:"localstorage+cookie"===t&&ou.is_supported()?ou:"sessionstorage"===t&&cu.is_supported()?cu:"memory"===t?au:"cookie"===t?tu:ou.is_supported()?ou:tu}properties(){var e={};return Fr(this.props,(function(t,n){if(n===_i&&gr(t))for(var r=Object.keys(t),i=0;i<r.length;i++)e["$feature/".concat(r[i])]=t[r[i]];else s=n,a=!1,(br(o=Oi)?a:Un&&o.indexOf===Un?-1!=o.indexOf(s):(Fr(o,(function(e){if(a||(a=e===s))return Ar})),a))||(e[n]=t);var o,s,a})),e}load(){if(!this.disabled){var e=this.storage.parse(this.name);e&&(this.props=Or({},e))}}save(){this.disabled||this.storage.set(this.name,this.props,this.expire_days,this.cross_subdomain,this.secure,this.config.debug)}remove(){this.storage.remove(this.name,!1),this.storage.remove(this.name,!0)}clear(){this.remove(),this.props={}}register_once(e,t,n){if(gr(e)){mr(t)&&(t="None"),this.expire_days=mr(n)?this.default_expiry:n;var r=!1;if(Fr(e,((e,n)=>{this.props.hasOwnProperty(n)&&this.props[n]!==t||(this.props[n]=e,r=!0)})),r)return this.save(),!0}return!1}register(e,t){if(gr(e)){this.expire_days=mr(t)?this.default_expiry:t;var n=!1;if(Fr(e,((t,r)=>{e.hasOwnProperty(r)&&this.props[r]!==t&&(this.props[r]=t,n=!0)})),n)return this.save(),!0}return!1}unregister(e){e in this.props&&(delete this.props[e],this.save())}update_campaign_params(){if(!this.campaign_params_saved){var e=cd.campaignParams({customTrackedParams:this.config.custom_campaign_params,maskPersonalDataProperties:this.config.mask_personal_data_properties,customPersonalDataProperties:this.config.custom_personal_data_properties});fr(Hr(e))||this.register(e),this.campaign_params_saved=!0}}update_search_keyword(){this.register(cd.searchInfo())}update_referrer_info(){this.register_once(cd.referrerInfo(),void 0)}set_initial_person_info(){this.props[Ti]||this.props[Mi]||this.register_once({[Ri]:cd.initialPersonInfo()},void 0)}get_referrer_info(){return Hr({$referrer:this.props.$referrer,$referring_domain:this.props.$referring_domain})}get_initial_props(){var e={};Fr([Mi,Ti],(t=>{var n=this.props[t];n&&Fr(n,(function(t,n){e["$initial_"+sr(n)]=t}))}));var t=this.props[Ri];if(t){var n=cd.initialPersonPropsFromInfo(t);Or(e,n)}return e}safe_merge(e){return Fr(this.props,(function(t,n){n in e||(e[n]=t)})),e}update_config(e,t){if(this.default_expiry=this.expire_days=e.cookie_expiration,this.set_disabled(e.disable_persistence),this.set_cross_subdomain(e.cross_subdomain_cookie),this.set_secure(e.secure_cookie),e.persistence!==t.persistence){var n=this.buildStorage(e),r=this.props;this.clear(),this.storage=n,this.props=r,this.save()}}set_disabled(e){this.disabled=e,this.disabled?this.remove():this.save()}set_cross_subdomain(e){e!==this.cross_subdomain&&(this.cross_subdomain=e,this.remove(),this.save())}get_cross_subdomain(){return!!this.cross_subdomain}set_secure(e){e!==this.secure&&(this.secure=e,this.remove(),this.save())}set_event_timer(e,t){var n=this.props[ei]||{};n[e]=t,this.props[ei]=n,this.save()}remove_event_timer(e){var t=(this.props[ei]||{})[e];return mr(t)||(delete this.props[ei][e],this.save()),t}get_property(e){return this.props[e]}set_property(e,t){this.props[e]=t,this.save()}}function hd(e){var t,n;return(null===(t=JSON.stringify(e,(n=[],function(e,t){if(gr(t)){for(;n.length>0&&n[n.length-1]!==this;)n.pop();return n.includes(t)?"[Circular]":(n.push(t),t)}return t})))||void 0===t?void 0:t.length)||0}function pd(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:6606028.8;if(e.size>=t&&e.data.length>1){var n=Math.floor(e.data.length/2),r=e.data.slice(0,n),i=e.data.slice(n);return[pd({size:hd(r),data:r,sessionId:e.sessionId,windowId:e.windowId}),pd({size:hd(i),data:i,sessionId:e.sessionId,windowId:e.windowId})].flatMap((e=>e))}return[e]}var vd=(e=>(e[e.DomContentLoaded=0]="DomContentLoaded",e[e.Load=1]="Load",e[e.FullSnapshot=2]="FullSnapshot",e[e.IncrementalSnapshot=3]="IncrementalSnapshot",e[e.Meta=4]="Meta",e[e.Custom=5]="Custom",e[e.Plugin=6]="Plugin",e))(vd||{}),gd=(e=>(e[e.Mutation=0]="Mutation",e[e.MouseMove=1]="MouseMove",e[e.MouseInteraction=2]="MouseInteraction",e[e.Scroll=3]="Scroll",e[e.ViewportResize=4]="ViewportResize",e[e.Input=5]="Input",e[e.TouchMove=6]="TouchMove",e[e.MediaInteraction=7]="MediaInteraction",e[e.StyleSheetRule=8]="StyleSheetRule",e[e.CanvasMutation=9]="CanvasMutation",e[e.Font=10]="Font",e[e.Log=11]="Log",e[e.Drag=12]="Drag",e[e.StyleDeclaration=13]="StyleDeclaration",e[e.Selection=14]="Selection",e[e.AdoptedStyleSheet=15]="AdoptedStyleSheet",e[e.CustomElement=16]="CustomElement",e))(gd||{});function fd(e,t,n,r,i){return t>n&&(Mr.warn("min cannot be greater than max."),t=n),Sr(e)?e>n?(r&&Mr.warn(r+" cannot be greater than max: "+n+". Using max value instead."),n):e<t?(r&&Mr.warn(r+" cannot be less than min: "+t+". Using min value instead."),t):e:(r&&Mr.warn(r+" must be a number. using max or fallback. max: "+n+", fallback: "+i),fd(i||n,t,n,r))}class md{constructor(e){var t,n,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};i(this,"bucketSize",100),i(this,"refillRate",10),i(this,"mutationBuckets",{}),i(this,"loggedTracker",{}),i(this,"refillBuckets",(()=>{Object.keys(this.mutationBuckets).forEach((e=>{this.mutationBuckets[e]=this.mutationBuckets[e]+this.refillRate,this.mutationBuckets[e]>=this.bucketSize&&delete this.mutationBuckets[e]}))})),i(this,"getNodeOrRelevantParent",(e=>{var t=this.rrweb.mirror.getNode(e);if("svg"!==(null==t?void 0:t.nodeName)&&t instanceof Element){var n=t.closest("svg");if(n)return[this.rrweb.mirror.getId(n),n]}return[e,t]})),i(this,"numberOfChanges",(e=>{var t,n,r,i,o,s,a,l;return(null!==(t=null===(n=e.removes)||void 0===n?void 0:n.length)&&void 0!==t?t:0)+(null!==(r=null===(i=e.attributes)||void 0===i?void 0:i.length)&&void 0!==r?r:0)+(null!==(o=null===(s=e.texts)||void 0===s?void 0:s.length)&&void 0!==o?o:0)+(null!==(a=null===(l=e.adds)||void 0===l?void 0:l.length)&&void 0!==a?a:0)})),i(this,"throttleMutations",(e=>{if(3!==e.type||0!==e.data.source)return e;var t=e.data,n=this.numberOfChanges(t);t.attributes&&(t.attributes=t.attributes.filter((e=>{var t,n,r,[i,o]=this.getNodeOrRelevantParent(e.id);if(0===this.mutationBuckets[i])return!1;(this.mutationBuckets[i]=null!==(t=this.mutationBuckets[i])&&void 0!==t?t:this.bucketSize,this.mutationBuckets[i]=Math.max(this.mutationBuckets[i]-1,0),0===this.mutationBuckets[i])&&(this.loggedTracker[i]||(this.loggedTracker[i]=!0,null===(n=(r=this.options).onBlockedNode)||void 0===n||n.call(r,i,o)));return e})));var r=this.numberOfChanges(t);return 0!==r||n===r?e:void 0})),this.rrweb=e,this.options=r,this.refillRate=fd(null!==(t=this.options.refillRate)&&void 0!==t?t:this.refillRate,0,100,"mutation throttling refill rate"),this.bucketSize=fd(null!==(n=this.options.bucketSize)&&void 0!==n?n:this.bucketSize,0,100,"mutation throttling bucket size"),setInterval((()=>{this.refillBuckets()}),1e3)}}var _d=Uint8Array,yd=Uint16Array,bd=Uint32Array,wd=new _d([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]),Sd=new _d([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]),Cd=new _d([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),Id=function(e,t){for(var n=new yd(31),r=0;r<31;++r)n[r]=t+=1<<e[r-1];var i=new bd(n[30]);for(r=1;r<30;++r)for(var o=n[r];o<n[r+1];++o)i[o]=o-n[r]<<5|r;return[n,i]},kd=Id(wd,2),Ed=kd[0],xd=kd[1];Ed[28]=258,xd[258]=28;for(var Td=Id(Sd,0)[1],Md=new yd(32768),Rd=0;Rd<32768;++Rd){var Ad=(43690&Rd)>>>1|(21845&Rd)<<1;Ad=(61680&(Ad=(52428&Ad)>>>2|(13107&Ad)<<2))>>>4|(3855&Ad)<<4,Md[Rd]=((65280&Ad)>>>8|(255&Ad)<<8)>>>1}var Nd=function(e,t,n){for(var r=e.length,i=0,o=new yd(t);i<r;++i)++o[e[i]-1];var s,a=new yd(t);for(i=0;i<t;++i)a[i]=a[i-1]+o[i-1]<<1;if(n){s=new yd(1<<t);var l=15-t;for(i=0;i<r;++i)if(e[i])for(var c=i<<4|e[i],u=t-e[i],d=a[e[i]-1]++<<u,h=d|(1<<u)-1;d<=h;++d)s[Md[d]>>>l]=c}else for(s=new yd(r),i=0;i<r;++i)s[i]=Md[a[e[i]-1]++]>>>15-e[i];return s},Fd=new _d(288);for(Rd=0;Rd<144;++Rd)Fd[Rd]=8;for(Rd=144;Rd<256;++Rd)Fd[Rd]=9;for(Rd=256;Rd<280;++Rd)Fd[Rd]=7;for(Rd=280;Rd<288;++Rd)Fd[Rd]=8;var Od=new _d(32);for(Rd=0;Rd<32;++Rd)Od[Rd]=5;var Pd=Nd(Fd,9,0),Ld=Nd(Od,5,0),Dd=function(e){return(e/8>>0)+(7&e&&1)},Bd=function(e,t,n){(null==n||n>e.length)&&(n=e.length);var r=new(e instanceof yd?yd:e instanceof bd?bd:_d)(n-t);return r.set(e.subarray(t,n)),r},Hd=function(e,t,n){n<<=7&t;var r=t/8>>0;e[r]|=n,e[r+1]|=n>>>8},qd=function(e,t,n){n<<=7&t;var r=t/8>>0;e[r]|=n,e[r+1]|=n>>>8,e[r+2]|=n>>>16},$d=function(e,t){for(var n=[],r=0;r<e.length;++r)e[r]&&n.push({s:r,f:e[r]});var i=n.length,o=n.slice();if(!i)return[new _d(0),0];if(1==i){var s=new _d(n[0].s+1);return s[n[0].s]=1,[s,1]}n.sort((function(e,t){return e.f-t.f})),n.push({s:-1,f:25001});var a=n[0],l=n[1],c=0,u=1,d=2;for(n[0]={s:-1,f:a.f+l.f,l:a,r:l};u!=i-1;)a=n[n[c].f<n[d].f?c++:d++],l=n[c!=u&&n[c].f<n[d].f?c++:d++],n[u++]={s:-1,f:a.f+l.f,l:a,r:l};var h=o[0].s;for(r=1;r<i;++r)o[r].s>h&&(h=o[r].s);var p=new yd(h+1),v=Wd(n[u-1],p,0);if(v>t){r=0;var g=0,f=v-t,m=1<<f;for(o.sort((function(e,t){return p[t.s]-p[e.s]||e.f-t.f}));r<i;++r){var _=o[r].s;if(!(p[_]>t))break;g+=m-(1<<v-p[_]),p[_]=t}for(g>>>=f;g>0;){var y=o[r].s;p[y]<t?g-=1<<t-p[y]++-1:++r}for(;r>=0&&g;--r){var b=o[r].s;p[b]==t&&(--p[b],++g)}v=t}return[new _d(p),v]},Wd=function(e,t,n){return-1==e.s?Math.max(Wd(e.l,t,n+1),Wd(e.r,t,n+1)):t[e.s]=n},Vd=function(e){for(var t=e.length;t&&!e[--t];);for(var n=new yd(++t),r=0,i=e[0],o=1,s=function(e){n[r++]=e},a=1;a<=t;++a)if(e[a]==i&&a!=t)++o;else{if(!i&&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(i),--o;o>6;o-=6)s(8304);o>2&&(s(o-3<<5|8208),o=0)}for(;o--;)s(i);o=1,i=e[a]}return[n.subarray(0,r),t]},Zd=function(e,t){for(var n=0,r=0;r<t.length;++r)n+=e[r]*t[r];return n},Gd=function(e,t,n){var r=n.length,i=Dd(t+2);e[i]=255&r,e[i+1]=r>>>8,e[i+2]=255^e[i],e[i+3]=255^e[i+1];for(var o=0;o<r;++o)e[i+o+4]=n[o];return 8*(i+4+r)},Ud=function(e,t,n,r,i,o,s,a,l,c,u){Hd(t,u++,n),++i[256];for(var d=$d(i,15),h=d[0],p=d[1],v=$d(o,15),g=v[0],f=v[1],m=Vd(h),_=m[0],y=m[1],b=Vd(g),w=b[0],S=b[1],C=new yd(19),I=0;I<_.length;++I)C[31&_[I]]++;for(I=0;I<w.length;++I)C[31&w[I]]++;for(var k=$d(C,7),E=k[0],x=k[1],T=19;T>4&&!E[Cd[T-1]];--T);var M,R,A,N,F=c+5<<3,O=Zd(i,Fd)+Zd(o,Od)+s,P=Zd(i,h)+Zd(o,g)+s+14+3*T+Zd(C,E)+(2*C[16]+3*C[17]+7*C[18]);if(F<=O&&F<=P)return Gd(t,u,e.subarray(l,l+c));if(Hd(t,u,1+(P<O)),u+=2,P<O){M=Nd(h,p,0),R=h,A=Nd(g,f,0),N=g;var L=Nd(E,x,0);Hd(t,u,y-257),Hd(t,u+5,S-1),Hd(t,u+10,T-4),u+=14;for(I=0;I<T;++I)Hd(t,u+3*I,E[Cd[I]]);u+=3*T;for(var D=[_,w],B=0;B<2;++B){var H=D[B];for(I=0;I<H.length;++I){var q=31&H[I];Hd(t,u,L[q]),u+=E[q],q>15&&(Hd(t,u,H[I]>>>5&127),u+=H[I]>>>12)}}}else M=Pd,R=Fd,A=Ld,N=Od;for(I=0;I<a;++I)if(r[I]>255){q=r[I]>>>18&31;qd(t,u,M[q+257]),u+=R[q+257],q>7&&(Hd(t,u,r[I]>>>23&31),u+=wd[q]);var $=31&r[I];qd(t,u,A[$]),u+=N[$],$>3&&(qd(t,u,r[I]>>>5&8191),u+=Sd[$])}else qd(t,u,M[r[I]]),u+=R[r[I]];return qd(t,u,M[256]),u+R[256]},jd=new bd([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),zd=function(){for(var e=new bd(256),t=0;t<256;++t){for(var n=t,r=9;--r;)n=(1&n&&3988292384)^n>>>1;e[t]=n}return e}(),Yd=function(){var e=4294967295;return{p:function(t){for(var n=e,r=0;r<t.length;++r)n=zd[255&n^t[r]]^n>>>8;e=n},d:function(){return 4294967295^e}}},Xd=function(e,t,n,r,i){return function(e,t,n,r,i,o){var s=e.length,a=new _d(r+s+5*(1+Math.floor(s/7e3))+i),l=a.subarray(r,a.length-i),c=0;if(!t||s<8)for(var u=0;u<=s;u+=65535){var d=u+65535;d<s?c=Gd(l,c,e.subarray(u,d)):(l[u]=o,c=Gd(l,c,e.subarray(u,s)))}else{for(var h=jd[t-1],p=h>>>13,v=8191&h,g=(1<<n)-1,f=new yd(32768),m=new yd(g+1),_=Math.ceil(n/3),y=2*_,b=function(t){return(e[t]^e[t+1]<<_^e[t+2]<<y)&g},w=new bd(25e3),S=new yd(288),C=new yd(32),I=0,k=0,E=(u=0,0),x=0,T=0;u<s;++u){var M=b(u),R=32767&u,A=m[M];if(f[R]=A,m[M]=R,x<=u){var N=s-u;if((I>7e3||E>24576)&&N>423){c=Ud(e,l,0,w,S,C,k,E,T,u-T,c),E=I=k=0,T=u;for(var F=0;F<286;++F)S[F]=0;for(F=0;F<30;++F)C[F]=0}var O=2,P=0,L=v,D=R-A&32767;if(N>2&&M==b(u-D))for(var B=Math.min(p,N)-1,H=Math.min(32767,u),q=Math.min(258,N);D<=H&&--L&&R!=A;){if(e[u+O]==e[u+O-D]){for(var $=0;$<q&&e[u+$]==e[u+$-D];++$);if($>O){if(O=$,P=D,$>B)break;var W=Math.min(D,$-2),V=0;for(F=0;F<W;++F){var Z=u-D+F+32768&32767,G=Z-f[Z]+32768&32767;G>V&&(V=G,A=Z)}}}D+=(R=A)-(A=f[R])+32768&32767}if(P){w[E++]=268435456|xd[O]<<18|Td[P];var U=31&xd[O],j=31&Td[P];k+=wd[U]+Sd[j],++S[257+U],++C[j],x=u+O,++I}else w[E++]=e[u],++S[e[u]]}}c=Ud(e,l,o,w,S,C,k,E,T,u-T,c)}return Bd(a,0,r+Dd(c)+i)}(e,null==t.level?6:t.level,null==t.mem?Math.ceil(1.5*Math.max(8,Math.min(13,Math.log(e.length)))):12+t.mem,n,r,!i)},Jd=function(e,t,n){for(;n;++t)e[t]=n,n>>>=8},Kd=function(e,t){var n=t.filename;if(e[0]=31,e[1]=139,e[2]=8,e[8]=t.level<2?4:9==t.level?2:0,e[9]=3,0!=t.mtime&&Jd(e,4,Math.floor(new Date(t.mtime||Date.now())/1e3)),n){e[3]=8;for(var r=0;r<=n.length;++r)e[r+10]=n.charCodeAt(r)}},Qd=function(e){return 10+(e.filename&&e.filename.length+1||0)};function eh(e,t){void 0===t&&(t={});var n=Yd(),r=e.length;n.p(e);var i=Xd(e,t,Qd(t),8),o=i.length;return Kd(i,t),Jd(i,o-8,n.d()),Jd(i,o-4,r),i}function th(e,t){var n=e.length;if("undefined"!=typeof TextEncoder)return(new TextEncoder).encode(e);for(var r=new _d(e.length+(e.length>>>1)),i=0,o=function(e){r[i++]=e},s=0;s<n;++s){if(i+5>r.length){var a=new _d(i+8+(n-s<<1));a.set(r),r=a}var l=e.charCodeAt(s);l<128||t?o(l):l<2048?(o(192|l>>>6),o(128|63&l)):l>55295&&l<57344?(o(240|(l=65536+(1047552&l)|1023&e.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 Bd(r,0,i)}var nh="[SessionRecording]",rh=Rr(nh),ih=3e5,oh=[gd.MouseMove,gd.MouseInteraction,gd.Scroll,gd.ViewportResize,gd.Input,gd.TouchMove,gd.MediaInteraction,gd.Drag],sh=e=>({rrwebMethod:e,enqueuedAt:Date.now(),attempt:1});function ah(e){return function(e,t){for(var n="",r=0;r<e.length;){var i=e[r++];i<128||t?n+=String.fromCharCode(i):i<224?n+=String.fromCharCode((31&i)<<6|63&e[r++]):i<240?n+=String.fromCharCode((15&i)<<12|(63&e[r++])<<6|63&e[r++]):(i=((15&i)<<18|(63&e[r++])<<12|(63&e[r++])<<6|63&e[r++])-65536,n+=String.fromCharCode(55296|i>>10,56320|1023&i))}return n}(eh(th(JSON.stringify(e))),!0)}function lh(e){return e.type===vd.Custom&&"sessionIdle"===e.data.tag}function ch(e,t){return t.some((t=>"regex"===t.matching&&new RegExp(t.url).test(e)))}class uh{get sessionIdleThresholdMilliseconds(){return this.instance.config.session_recording.session_idle_threshold_ms||3e5}get rrwebRecord(){var e,t;return null==er||null===(e=er.__PosthogExtensions__)||void 0===e||null===(t=e.rrweb)||void 0===t?void 0:t.record}get started(){return this._captureStarted}get sessionManager(){if(!this.instance.sessionManager)throw new Error(nh+" must be started with a valid sessionManager.");return this.instance.sessionManager}get fullSnapshotIntervalMillis(){var e,t;return"trigger_pending"===this.triggerStatus?6e4:null!==(e=null===(t=this.instance.config.session_recording)||void 0===t?void 0:t.full_snapshot_interval_millis)&&void 0!==e?e:ih}get isSampled(){var e=this.instance.get_property(gi);return Cr(e)?e:null}get sessionDuration(){var e,t,n=null===(e=this.buffer)||void 0===e?void 0:e.data[(null===(t=this.buffer)||void 0===t?void 0:t.data.length)-1],{sessionStartTimestamp:r}=this.sessionManager.checkAndGetSessionAndWindowId(!0);return n?n.timestamp-r:null}get isRecordingEnabled(){var e=!!this.instance.get_property(ai),t=!this.instance.config.disable_session_recording;return Wn&&e&&t}get isConsoleLogCaptureEnabled(){var e=!!this.instance.get_property(li),t=this.instance.config.enable_recording_console_log;return null!=t?t:e}get canvasRecording(){var e,t,n,r,i,o,s=this.instance.config.session_recording.captureCanvas,a=this.instance.get_property(ui),l=null!==(e=null!==(t=null==s?void 0:s.recordCanvas)&&void 0!==t?t:null==a?void 0:a.enabled)&&void 0!==e&&e,c=null!==(n=null!==(r=null==s?void 0:s.canvasFps)&&void 0!==r?r:null==a?void 0:a.fps)&&void 0!==n?n:0,u=null!==(i=null!==(o=null==s?void 0:s.canvasQuality)&&void 0!==o?o:null==a?void 0:a.quality)&&void 0!==i?i:0;return{enabled:l,fps:fd(c,0,12,"canvas recording fps"),quality:fd(u,0,1,"canvas recording quality")}}get networkPayloadCapture(){var e,t,n=this.instance.get_property(ci),r={recordHeaders:null===(e=this.instance.config.session_recording)||void 0===e?void 0:e.recordHeaders,recordBody:null===(t=this.instance.config.session_recording)||void 0===t?void 0:t.recordBody},i=(null==r?void 0:r.recordHeaders)||(null==n?void 0:n.recordHeaders),o=(null==r?void 0:r.recordBody)||(null==n?void 0:n.recordBody),s=gr(this.instance.config.capture_performance)?this.instance.config.capture_performance.network_timing:this.instance.config.capture_performance,a=!!(Cr(s)?s:null==n?void 0:n.capturePerformance);return i||o||a?{recordHeaders:i,recordBody:o,recordPerformance:a}:void 0}get sampleRate(){var e=this.instance.get_property(di);return Sr(e)?e:null}get minimumDuration(){var e=this.instance.get_property(hi);return Sr(e)?e:null}get status(){return this.receivedDecide?this.isRecordingEnabled?this._urlBlocked?"paused":wr(this._linkedFlag)||this._linkedFlagSeen?"trigger_pending"===this.triggerStatus?"buffering":Cr(this.isSampled)?this.isSampled?"sampled":"disabled":"active":"buffering":"disabled":"buffering"}get urlTriggerStatus(){var e;return 0===this._urlTriggers.length?"trigger_disabled":(null===(e=this.instance)||void 0===e?void 0:e.get_property(fi))===this.sessionId?"trigger_activated":"trigger_pending"}get eventTriggerStatus(){var e;return 0===this._eventTriggers.length?"trigger_disabled":(null===(e=this.instance)||void 0===e?void 0:e.get_property(mi))===this.sessionId?"trigger_activated":"trigger_pending"}get triggerStatus(){var e="trigger_activated"===this.eventTriggerStatus||"trigger_activated"===this.urlTriggerStatus,t="trigger_pending"===this.eventTriggerStatus||"trigger_pending"===this.urlTriggerStatus;return e?"trigger_activated":t?"trigger_pending":"trigger_disabled"}constructor(e){if(i(this,"queuedRRWebEvents",[]),i(this,"isIdle",!1),i(this,"_linkedFlagSeen",!1),i(this,"_lastActivityTimestamp",Date.now()),i(this,"_linkedFlag",null),i(this,"_removePageViewCaptureHook",void 0),i(this,"_onSessionIdListener",void 0),i(this,"_persistDecideOnSessionListener",void 0),i(this,"_samplingSessionListener",void 0),i(this,"_urlTriggers",[]),i(this,"_urlBlocklist",[]),i(this,"_urlBlocked",!1),i(this,"_eventTriggers",[]),i(this,"_removeEventTriggerCaptureHook",void 0),i(this,"_forceAllowLocalhostNetworkCapture",!1),i(this,"_onBeforeUnload",(()=>{this._flushBuffer()})),i(this,"_onOffline",(()=>{this._tryAddCustomEvent("browser offline",{})})),i(this,"_onOnline",(()=>{this._tryAddCustomEvent("browser online",{})})),i(this,"_onVisibilityChange",(()=>{if(null!=zn&&zn.visibilityState){var e="window "+zn.visibilityState;this._tryAddCustomEvent(e,{})}})),this.instance=e,this._captureStarted=!1,this._endpoint="/s/",this.stopRrweb=void 0,this.receivedDecide=!1,!this.instance.sessionManager)throw rh.error("started without valid sessionManager"),new Error(nh+" started without valid sessionManager. This is a bug.");if(this.instance.config.__preview_experimental_cookieless_mode)throw new Error(nh+" cannot be used with __preview_experimental_cookieless_mode.");var{sessionId:t,windowId:n}=this.sessionManager.checkAndGetSessionAndWindowId();this.sessionId=t,this.windowId=n,this.buffer=this.clearBuffer(),this.sessionIdleThresholdMilliseconds>=this.sessionManager.sessionTimeoutMs&&rh.warn("session_idle_threshold_ms (".concat(this.sessionIdleThresholdMilliseconds,") is greater than the session timeout (").concat(this.sessionManager.sessionTimeoutMs,"). Session will never be detected as idle"))}startIfEnabledOrStop(e){this.isRecordingEnabled?(this._startCapture(e),null==Wn||Wn.addEventListener("beforeunload",this._onBeforeUnload),null==Wn||Wn.addEventListener("offline",this._onOffline),null==Wn||Wn.addEventListener("online",this._onOnline),null==Wn||Wn.addEventListener("visibilitychange",this._onVisibilityChange),this._setupSampling(),this._addEventTriggerListener(),wr(this._removePageViewCaptureHook)&&(this._removePageViewCaptureHook=this.instance.on("eventCaptured",(e=>{try{if("$pageview"===e.event){var t=null!=e&&e.properties.$current_url?this._maskUrl(null==e?void 0:e.properties.$current_url):"";if(!t)return;this._tryAddCustomEvent("$pageview",{href:t})}}catch(e){rh.error("Could not add $pageview to rrweb session",e)}}))),this._onSessionIdListener||(this._onSessionIdListener=this.sessionManager.onSessionId(((e,t,n)=>{var r,i,o,s;n&&(this._tryAddCustomEvent("$session_id_change",{sessionId:e,windowId:t,changeReason:n}),null===(r=this.instance)||void 0===r||null===(i=r.persistence)||void 0===i||i.unregister(mi),null===(o=this.instance)||void 0===o||null===(s=o.persistence)||void 0===s||s.unregister(fi))})))):this.stopRecording()}stopRecording(){var e,t,n,r;this._captureStarted&&this.stopRrweb&&(this.stopRrweb(),this.stopRrweb=void 0,this._captureStarted=!1,null==Wn||Wn.removeEventListener("beforeunload",this._onBeforeUnload),null==Wn||Wn.removeEventListener("offline",this._onOffline),null==Wn||Wn.removeEventListener("online",this._onOnline),null==Wn||Wn.removeEventListener("visibilitychange",this._onVisibilityChange),this.clearBuffer(),clearInterval(this._fullSnapshotTimer),null===(e=this._removePageViewCaptureHook)||void 0===e||e.call(this),this._removePageViewCaptureHook=void 0,null===(t=this._removeEventTriggerCaptureHook)||void 0===t||t.call(this),this._removeEventTriggerCaptureHook=void 0,null===(n=this._onSessionIdListener)||void 0===n||n.call(this),this._onSessionIdListener=void 0,null===(r=this._samplingSessionListener)||void 0===r||r.call(this),this._samplingSessionListener=void 0,rh.info("stopped"))}makeSamplingDecision(e){var t,n=this.sessionId!==e,r=this.sampleRate;if(Sr(r)){var i,o=this.isSampled,s=n||!Cr(o);if(s)i=Math.random()<r;else i=o;s&&(i?this._reportStarted("sampled"):rh.warn("Sample rate (".concat(r,") has determined that this sessionId (").concat(e,") will not be sent to the server.")),this._tryAddCustomEvent("samplingDecisionMade",{sampleRate:r,isSampled:i})),null===(t=this.instance.persistence)||void 0===t||t.register({[gi]:i})}else{var a;null===(a=this.instance.persistence)||void 0===a||a.register({[gi]:null})}}onRemoteConfig(e){var t,n,r,i,o,s;(this._tryAddCustomEvent("$remote_config_received",e),this._persistRemoteConfig(e),this._linkedFlag=(null===(t=e.sessionRecording)||void 0===t?void 0:t.linkedFlag)||null,null!==(n=e.sessionRecording)&&void 0!==n&&n.endpoint)&&(this._endpoint=null===(s=e.sessionRecording)||void 0===s?void 0:s.endpoint);if(this._setupSampling(),!wr(this._linkedFlag)&&!this._linkedFlagSeen){var a=_r(this._linkedFlag)?this._linkedFlag:this._linkedFlag.flag,l=_r(this._linkedFlag)?null:this._linkedFlag.variant;this.instance.onFeatureFlags(((e,t)=>{var n=gr(t)&&a in t,r=l?t[a]===l:n;r&&this._reportStarted("linked_flag_matched",{linkedFlag:a,linkedVariant:l}),this._linkedFlagSeen=r}))}null!==(r=e.sessionRecording)&&void 0!==r&&r.urlTriggers&&(this._urlTriggers=e.sessionRecording.urlTriggers),null!==(i=e.sessionRecording)&&void 0!==i&&i.urlBlocklist&&(this._urlBlocklist=e.sessionRecording.urlBlocklist),null!==(o=e.sessionRecording)&&void 0!==o&&o.eventTriggers&&(this._eventTriggers=e.sessionRecording.eventTriggers),this.receivedDecide=!0,this.startIfEnabledOrStop()}_setupSampling(){Sr(this.sampleRate)&&wr(this._samplingSessionListener)&&(this._samplingSessionListener=this.sessionManager.onSessionId((e=>{this.makeSamplingDecision(e)})))}_persistRemoteConfig(e){if(this.instance.persistence){var n,r=this.instance.persistence,i=()=>{var n,i,o,s,a,l,c,u,d=null===(n=e.sessionRecording)||void 0===n?void 0:n.sampleRate,h=wr(d)?null:parseFloat(d),p=null===(i=e.sessionRecording)||void 0===i?void 0:i.minimumDurationMilliseconds;r.register({[ai]:!!e.sessionRecording,[li]:null===(o=e.sessionRecording)||void 0===o?void 0:o.consoleLogRecordingEnabled,[ci]:t({capturePerformance:e.capturePerformance},null===(s=e.sessionRecording)||void 0===s?void 0:s.networkPayloadCapture),[ui]:{enabled:null===(a=e.sessionRecording)||void 0===a?void 0:a.recordCanvas,fps:null===(l=e.sessionRecording)||void 0===l?void 0:l.canvasFps,quality:null===(c=e.sessionRecording)||void 0===c?void 0:c.canvasQuality},[di]:h,[hi]:mr(p)?null:p,[pi]:null===(u=e.sessionRecording)||void 0===u?void 0:u.scriptConfig})};i(),null===(n=this._persistDecideOnSessionListener)||void 0===n||n.call(this),this._persistDecideOnSessionListener=this.sessionManager.onSessionId(i)}}log(e){var t,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"log";null===(t=this.instance.sessionRecording)||void 0===t||t.onRRwebEmit({type:6,data:{plugin:"rrweb/console@1",payload:{level:n,trace:[],payload:[JSON.stringify(e)]}},timestamp:Date.now()})}_startCapture(e){if(!mr(Object.assign)&&!mr(Array.from)&&!(this._captureStarted||this.instance.config.disable_session_recording||this.instance.consent.isOptedOut())){var t,n;if(this._captureStarted=!0,this.sessionManager.checkAndGetSessionAndWindowId(),this.rrwebRecord)this._onScriptLoaded();else null===(t=er.__PosthogExtensions__)||void 0===t||null===(n=t.loadExternalDependency)||void 0===n||n.call(t,this.instance,this.scriptName,(e=>{if(e)return rh.error("could not load recorder",e);this._onScriptLoaded()}));rh.info("starting"),"active"===this.status&&this._reportStarted(e||"recording_initialized")}}get scriptName(){var e,t,n;return(null===(e=this.instance)||void 0===e||null===(t=e.persistence)||void 0===t||null===(n=t.get_property(pi))||void 0===n?void 0:n.script)||"recorder"}isInteractiveEvent(e){var t;return 3===e.type&&-1!==oh.indexOf(null===(t=e.data)||void 0===t?void 0:t.source)}_updateWindowAndSessionIds(e){var t=this.isInteractiveEvent(e);t||this.isIdle||e.timestamp-this._lastActivityTimestamp>this.sessionIdleThresholdMilliseconds&&(this.isIdle=!0,clearInterval(this._fullSnapshotTimer),this._tryAddCustomEvent("sessionIdle",{eventTimestamp:e.timestamp,lastActivityTimestamp:this._lastActivityTimestamp,threshold:this.sessionIdleThresholdMilliseconds,bufferLength:this.buffer.data.length,bufferSize:this.buffer.size}),this._flushBuffer());var n=!1;if(t&&(this._lastActivityTimestamp=e.timestamp,this.isIdle&&(this.isIdle=!1,this._tryAddCustomEvent("sessionNoLongerIdle",{reason:"user activity",type:e.type}),n=!0)),!this.isIdle){var{windowId:r,sessionId:i}=this.sessionManager.checkAndGetSessionAndWindowId(!t,e.timestamp),o=this.sessionId!==i,s=this.windowId!==r;this.windowId=r,this.sessionId=i,o||s?(this.stopRecording(),this.startIfEnabledOrStop("session_id_changed")):n&&this._scheduleFullSnapshot()}}_tryRRWebMethod(e){try{return e.rrwebMethod(),!0}catch(t){return this.queuedRRWebEvents.length<10?this.queuedRRWebEvents.push({enqueuedAt:e.enqueuedAt||Date.now(),attempt:e.attempt++,rrwebMethod:e.rrwebMethod}):rh.warn("could not emit queued rrweb event.",t,e),!1}}_tryAddCustomEvent(e,t){return this._tryRRWebMethod(sh((()=>this.rrwebRecord.addCustomEvent(e,t))))}_tryTakeFullSnapshot(){return this._tryRRWebMethod(sh((()=>this.rrwebRecord.takeFullSnapshot())))}_onScriptLoaded(){var e,n={blockClass:"ph-no-capture",blockSelector:void 0,ignoreClass:"ph-ignore-input",maskTextClass:"ph-mask",maskTextSelector:void 0,maskTextFn:void 0,maskAllInputs:!0,maskInputOptions:{password:!0},maskInputFn:void 0,slimDOMOptions:{},collectFonts:!1,inlineStylesheet:!0,recordCrossOriginIframes:!1},r=this.instance.config.session_recording;for(var[i,o]of Object.entries(r||{}))i in n&&("maskInputOptions"===i?n.maskInputOptions=t({password:!0},o):n[i]=o);if(this.canvasRecording&&this.canvasRecording.enabled&&(n.recordCanvas=!0,n.sampling={canvas:this.canvasRecording.fps},n.dataURLOptions={type:"image/webp",quality:this.canvasRecording.quality}),this.rrwebRecord){this.mutationRateLimiter=null!==(e=this.mutationRateLimiter)&&void 0!==e?e:new md(this.rrwebRecord,{refillRate:this.instance.config.session_recording.__mutationRateLimiterRefillRate,bucketSize:this.instance.config.session_recording.__mutationRateLimiterBucketSize,onBlockedNode:(e,t)=>{var n="Too many mutations on node '".concat(e,"'. Rate limiting. This could be due to SVG animations or something similar");rh.info(n,{node:t}),this.log(nh+" "+n,"warn")}});var s=this._gatherRRWebPlugins();this.stopRrweb=this.rrwebRecord(t({emit:e=>{this.onRRwebEmit(e)},plugins:s},n)),this._lastActivityTimestamp=Date.now(),this.isIdle=!1,this._tryAddCustomEvent("$session_options",{sessionRecordingOptions:n,activePlugins:s.map((e=>null==e?void 0:e.name))}),this._tryAddCustomEvent("$posthog_config",{config:this.instance.config})}else rh.error("onScriptLoaded was called but rrwebRecord is not available. This indicates something has gone wrong.")}_scheduleFullSnapshot(){if(this._fullSnapshotTimer&&clearInterval(this._fullSnapshotTimer),!this.isIdle){var e=this.fullSnapshotIntervalMillis;e&&(this._fullSnapshotTimer=setInterval((()=>{this._tryTakeFullSnapshot()}),e))}}_gatherRRWebPlugins(){var e,t,n,r,i=[],o=null===(e=er.__PosthogExtensions__)||void 0===e||null===(t=e.rrwebPlugins)||void 0===t?void 0:t.getRecordConsolePlugin;o&&this.isConsoleLogCaptureEnabled&&i.push(o());var s=null===(n=er.__PosthogExtensions__)||void 0===n||null===(r=n.rrwebPlugins)||void 0===r?void 0:r.getRecordNetworkPlugin;this.networkPayloadCapture&&hr(s)&&(!Gr.includes(location.hostname)||this._forceAllowLocalhostNetworkCapture?i.push(s(_o(this.instance.config,this.networkPayloadCapture))):rh.info("NetworkCapture not started because we are on localhost."));return i}onRRwebEmit(e){var n;if(this._processQueuedEvents(),e&&gr(e)){if(e.type===vd.Meta){var r=this._maskUrl(e.data.href);if(this._lastHref=r,!r)return;e.data.href=r}else this._pageViewFallBack();if(this._checkUrlTriggerConditions(),"paused"!==this.status||function(e){return e.type===vd.Custom&&"recording paused"===e.data.tag}(e)){e.type===vd.FullSnapshot&&this._scheduleFullSnapshot(),e.type===vd.FullSnapshot&&"trigger_pending"===this.triggerStatus&&this.clearBuffer();var i=this.mutationRateLimiter?this.mutationRateLimiter.throttleMutations(e):e;if(i){var o=function(e){var t=e;if(t&&gr(t)&&6===t.type&&gr(t.data)&&"rrweb/console@1"===t.data.plugin){t.data.payload.payload.length>10&&(t.data.payload.payload=t.data.payload.payload.slice(0,10),t.data.payload.payload.push("...[truncated]"));for(var n=[],r=0;r<t.data.payload.payload.length;r++)t.data.payload.payload[r]&&t.data.payload.payload[r].length>2e3?n.push(t.data.payload.payload[r].slice(0,2e3)+"...[truncated]"):n.push(t.data.payload.payload[r]);return t.data.payload.payload=n,e}return e}(i);if(this._updateWindowAndSessionIds(o),!this.isIdle||lh(o)){if(lh(o)){var s=o.data.payload;if(s){var a=s.lastActivityTimestamp,l=s.threshold;o.timestamp=a+l}}var c=null===(n=this.instance.config.session_recording.compress_events)||void 0===n||n?function(e){if(hd(e)<1024)return e;try{if(e.type===vd.FullSnapshot)return t(t({},e),{},{data:ah(e.data),cv:"2024-10"});if(e.type===vd.IncrementalSnapshot&&e.data.source===gd.Mutation)return t(t({},e),{},{cv:"2024-10",data:t(t({},e.data),{},{texts:ah(e.data.texts),attributes:ah(e.data.attributes),removes:ah(e.data.removes),adds:ah(e.data.adds)})});if(e.type===vd.IncrementalSnapshot&&e.data.source===gd.StyleSheetRule)return t(t({},e),{},{cv:"2024-10",data:t(t({},e.data),{},{adds:ah(e.data.adds),removes:ah(e.data.removes)})})}catch(e){rh.error("could not compress event - will use uncompressed event",e)}return e}(o):o,u={$snapshot_bytes:hd(c),$snapshot_data:c,$session_id:this.sessionId,$window_id:this.windowId};"disabled"!==this.status?this._captureSnapshotBuffered(u):this.clearBuffer()}}}}}_pageViewFallBack(){if(!this.instance.config.capture_pageview&&Wn){var e=this._maskUrl(Wn.location.href);this._lastHref!==e&&(this._tryAddCustomEvent("$url_changed",{href:e}),this._lastHref=e)}}_processQueuedEvents(){if(this.queuedRRWebEvents.length){var e=[...this.queuedRRWebEvents];this.queuedRRWebEvents=[],e.forEach((e=>{Date.now()-e.enqueuedAt<=2e3&&this._tryRRWebMethod(e)}))}}_maskUrl(e){var t=this.instance.config.session_recording;if(t.maskNetworkRequestFn){var n,r={url:e};return null===(n=r=t.maskNetworkRequestFn(r))||void 0===n?void 0:n.url}return e}clearBuffer(){return this.buffer={size:0,data:[],sessionId:this.sessionId,windowId:this.windowId},this.buffer}_flushBuffer(){this.flushBufferTimer&&(clearTimeout(this.flushBufferTimer),this.flushBufferTimer=void 0);var e=this.minimumDuration,t=this.sessionDuration,n=Sr(t)&&t>=0,r=Sr(e)&&n&&t<e;if("buffering"===this.status||"paused"===this.status||r)return this.flushBufferTimer=setTimeout((()=>{this._flushBuffer()}),2e3),this.buffer;this.buffer.data.length>0&&pd(this.buffer).forEach((e=>{this._captureSnapshot({$snapshot_bytes:e.size,$snapshot_data:e.data,$session_id:e.sessionId,$window_id:e.windowId,$lib:"web",$lib_version:xr.LIB_VERSION})}));return this.clearBuffer()}_captureSnapshotBuffered(e){var t,n=2+((null===(t=this.buffer)||void 0===t?void 0:t.data.length)||0);!this.isIdle&&(this.buffer.size+e.$snapshot_bytes+n>943718.4||this.buffer.sessionId!==this.sessionId)&&(this.buffer=this._flushBuffer()),this.buffer.size+=e.$snapshot_bytes,this.buffer.data.push(e.$snapshot_data),this.flushBufferTimer||this.isIdle||(this.flushBufferTimer=setTimeout((()=>{this._flushBuffer()}),2e3))}_captureSnapshot(e){this.instance.capture("$snapshot",e,{_url:this.instance.requestRouter.endpointFor("api",this._endpoint),_noTruncate:!0,_batchKey:"recordings",skip_client_rate_limiting:!0})}_checkUrlTriggerConditions(){if(void 0!==Wn&&Wn.location.href){var e=Wn.location.href,t="paused"===this.status,n=ch(e,this._urlBlocklist);n&&!t?this._pauseRecording():!n&&t&&this._resumeRecording(),ch(e,this._urlTriggers)&&this._activateTrigger("url")}}_activateTrigger(e){var t,n;"trigger_pending"===this.triggerStatus&&(null===(t=this.instance)||void 0===t||null===(n=t.persistence)||void 0===n||n.register({["url"===e?fi:mi]:this.sessionId}),this._flushBuffer(),this._reportStarted(e+"_trigger_matched"))}_pauseRecording(){"paused"!==this.status&&(this._urlBlocked=!0,clearInterval(this._fullSnapshotTimer),rh.info("recording paused due to URL blocker"),this._tryAddCustomEvent("recording paused",{reason:"url blocker"}))}_resumeRecording(){"paused"===this.status&&(this._urlBlocked=!1,this._tryTakeFullSnapshot(),this._scheduleFullSnapshot(),this._tryAddCustomEvent("recording resumed",{reason:"left blocked url"}),rh.info("recording resumed"))}_addEventTriggerListener(){0!==this._eventTriggers.length&&wr(this._removeEventTriggerCaptureHook)&&(this._removeEventTriggerCaptureHook=this.instance.on("eventCaptured",(e=>{try{this._eventTriggers.includes(e.event)&&this._activateTrigger("event")}catch(e){rh.error("Could not activate event trigger",e)}})))}overrideLinkedFlag(){this._linkedFlagSeen=!0,this._tryTakeFullSnapshot(),this._reportStarted("linked_flag_overridden")}overrideSampling(){var e;null===(e=this.instance.persistence)||void 0===e||e.register({[gi]:!0}),this._tryTakeFullSnapshot(),this._reportStarted("sampling_overridden")}overrideTrigger(e){this._activateTrigger(e)}_reportStarted(e,t){this.instance.register_for_session({$session_recording_start_reason:e}),rh.info(e.replace("_"," "),t),ir(["recording_initialized","session_id_changed"],e)||this._tryAddCustomEvent(e,t)}}var dh=Rr("[RemoteConfig]");class hh{constructor(e){this.instance=e}get remoteConfig(){var e,t;return null===(e=er._POSTHOG_REMOTE_CONFIG)||void 0===e||null===(t=e[this.instance.config.token])||void 0===t?void 0:t.config}_loadRemoteConfigJs(e){var t,n,r;null!==(t=er.__PosthogExtensions__)&&void 0!==t&&t.loadExternalDependency?null===(n=er.__PosthogExtensions__)||void 0===n||null===(r=n.loadExternalDependency)||void 0===r||r.call(n,this.instance,"remote-config",(()=>e(this.remoteConfig))):(dh.error("PostHog Extensions not found. Cannot load remote config."),e())}_loadRemoteConfigJSON(e){this.instance._send_request({method:"GET",url:this.instance.requestRouter.endpointFor("assets","/array/".concat(this.instance.config.token,"/config")),callback:t=>{e(t.json)}})}load(){try{if(this.remoteConfig)return dh.info("Using preloaded remote config",this.remoteConfig),void this.onRemoteConfig(this.remoteConfig);if(this.instance.config.advanced_disable_decide)return void dh.warn("Remote config is disabled. Falling back to local config.");this._loadRemoteConfigJs((e=>{if(!e)return dh.info("No config found after loading remote JS config. Falling back to JSON."),void this._loadRemoteConfigJSON((e=>{this.onRemoteConfig(e)}));this.onRemoteConfig(e)}))}catch(e){dh.error("Error loading remote config",e)}}onRemoteConfig(e){e?this.instance.config.__preview_remote_config?(this.instance._onRemoteConfig(e),!1!==e.hasFeatureFlags&&this.instance.featureFlags.ensureFlagsLoaded()):dh.info("__preview_remote_config is disabled. Logging config instead",e):dh.error("Failed to fetch remote config from PostHog.")}}var ph,vh=null!=Wn&&Wn.location?Jr(Wn.location.hash,"__posthog")||Jr(location.hash,"state"):null,gh="_postHogToolbarParams",fh=Rr("[Toolbar]");!function(e){e[e.UNINITIALIZED=0]="UNINITIALIZED",e[e.LOADING=1]="LOADING",e[e.LOADED=2]="LOADED"}(ph||(ph={}));class mh{constructor(e){this.instance=e}setToolbarState(e){er.ph_toolbar_state=e}getToolbarState(){var e;return null!==(e=er.ph_toolbar_state)&&void 0!==e?e:ph.UNINITIALIZED}maybeLoadToolbar(){var e,t,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:void 0,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:void 0,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:void 0;if(!Wn||!zn)return!1;n=null!==(e=n)&&void 0!==e?e:Wn.location,i=null!==(t=i)&&void 0!==t?t:Wn.history;try{if(!r){try{Wn.localStorage.setItem("test","test"),Wn.localStorage.removeItem("test")}catch(e){return!1}r=null==Wn?void 0:Wn.localStorage}var o,s=vh||Jr(n.hash,"__posthog")||Jr(n.hash,"state"),a=s?Dr((()=>JSON.parse(atob(decodeURIComponent(s)))))||Dr((()=>JSON.parse(decodeURIComponent(s)))):null;return a&&"ph_authorize"===a.action?((o=a).source="url",o&&Object.keys(o).length>0&&(a.desiredHash?n.hash=a.desiredHash:i?i.replaceState(i.state,"",n.pathname+n.search):n.hash="")):((o=JSON.parse(r.getItem(gh)||"{}")).source="localstorage",delete o.userIntent),!(!o.token||this.instance.config.token!==o.token)&&(this.loadToolbar(o),!0)}catch(e){return!1}}_callLoadToolbar(e){var t=er.ph_load_toolbar||er.ph_load_editor;!wr(t)&&hr(t)?t(e,this.instance):fh.warn("No toolbar load function found")}loadToolbar(e){var n=!(null==zn||!zn.getElementById(Ni));if(!Wn||n)return!1;var r="custom"===this.instance.requestRouter.region&&this.instance.config.advanced_disable_toolbar_metrics,i=t(t({token:this.instance.config.token},e),{},{apiURL:this.instance.requestRouter.endpointFor("ui")},r?{instrument:!1}:{});if(Wn.localStorage.setItem(gh,JSON.stringify(t(t({},i),{},{source:void 0}))),this.getToolbarState()===ph.LOADED)this._callLoadToolbar(i);else if(this.getToolbarState()===ph.UNINITIALIZED){var o,s;this.setToolbarState(ph.LOADING),null===(o=er.__PosthogExtensions__)||void 0===o||null===(s=o.loadExternalDependency)||void 0===s||s.call(o,this.instance,"toolbar",(e=>{if(e)return fh.error("[Toolbar] Failed to load",e),void this.setToolbarState(ph.UNINITIALIZED);this.setToolbarState(ph.LOADED),this._callLoadToolbar(i)})),$r(Wn,"turbolinks:load",(()=>{this.setToolbarState(ph.UNINITIALIZED),this.loadToolbar(i)}))}return!0}_loadEditor(e){return this.loadToolbar(e)}maybeLoadEditor(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:void 0,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:void 0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:void 0;return this.maybeLoadToolbar(e,t,n)}}class _h{constructor(e){i(this,"isPaused",!0),i(this,"queue",[]),i(this,"flushTimeoutMs",3e3),this.sendRequest=e}enqueue(e){this.queue.push(e),this.flushTimeout||this.setFlushTimeout()}unload(){this.clearFlushTimeout();var e=this.queue.length>0?this.formatQueue():{},n=Object.values(e),r=[...n.filter((e=>0===e.url.indexOf("/e"))),...n.filter((e=>0!==e.url.indexOf("/e")))];r.map((e=>{this.sendRequest(t(t({},e),{},{transport:"sendBeacon"}))}))}enable(){this.isPaused=!1,this.setFlushTimeout()}setFlushTimeout(){var e=this;this.isPaused||(this.flushTimeout=setTimeout((()=>{if(this.clearFlushTimeout(),this.queue.length>0){var t=this.formatQueue(),n=function(n){var r=t[n],i=(new Date).getTime();r.data&&dr(r.data)&&Fr(r.data,(e=>{e.offset=Math.abs(e.timestamp-i),delete e.timestamp})),e.sendRequest(r)};for(var r in t)n(r)}}),this.flushTimeoutMs))}clearFlushTimeout(){clearTimeout(this.flushTimeout),this.flushTimeout=void 0}formatQueue(){var e={};return Fr(this.queue,(n=>{var r,i=n,o=(i?i.batchKey:null)||i.url;mr(e[o])&&(e[o]=t(t({},i),{},{data:[]})),null===(r=e[o].data)||void 0===r||r.push(i.data)})),this.queue=[],e}}var yh=function(e){var t,n,r,i,o="";for(t=n=0,r=(e=(e+"").replace(/\r\n/g,"\n").replace(/\r/g,"\n")).length,i=0;i<r;i++){var s=e.charCodeAt(i),a=null;s<128?n++: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),br(a)||(n>t&&(o+=e.substring(t,n)),o+=a,t=n=i+1)}return n>t&&(o+=e.substring(t,e.length)),o},bh=!!Jn||!!Xn,wh="text/plain",Sh=(e,n)=>{var[r,i]=e.split("?"),o=t({},n);null==i||i.split("&").forEach((e=>{var[t]=e.split("=");delete o[t]}));var s=zr(o);return s=s?(i?i+"&":"")+s:i,"".concat(r,"?").concat(s)},Ch=(e,t)=>JSON.stringify(e,((e,t)=>"bigint"==typeof t?t.toString():t),t),Ih=e=>{var{data:t,compression:n}=e;if(t){if(n===qn.GZipJS){var r=eh(th(Ch(t)),{mtime:0}),i=new Blob([r],{type:wh});return{contentType:wh,body:i,estimatedSize:i.size}}if(n===qn.Base64){var o=function(e){var t,n,r,i,o,s="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",a=0,l=0,c="",u=[];if(!e)return e;e=yh(e);do{t=(o=e.charCodeAt(a++)<<16|e.charCodeAt(a++)<<8|e.charCodeAt(a++))>>18&63,n=o>>12&63,r=o>>6&63,i=63&o,u[l++]=s.charAt(t)+s.charAt(n)+s.charAt(r)+s.charAt(i)}while(a<e.length);switch(c=u.join(""),e.length%3){case 1:c=c.slice(0,-2)+"==";break;case 2:c=c.slice(0,-1)+"="}return c}(Ch(t)),s=(e=>"data="+encodeURIComponent("string"==typeof e?e:Ch(e)))(o);return{contentType:"application/x-www-form-urlencoded",body:s,estimatedSize:new Blob([s]).size}}var a=Ch(t);return{contentType:"application/json",body:a,estimatedSize:new Blob([a]).size}}},kh=[];Xn&&kh.push({transport:"fetch",method:e=>{var n,r,{contentType:i,body:o,estimatedSize:s}=null!==(n=Ih(e))&&void 0!==n?n:{},a=new Headers;Fr(e.headers,(function(e,t){a.append(t,e)})),i&&a.append("Content-Type",i);var l=e.url,c=null;if(Kn){var u=new Kn;c={signal:u.signal,timeout:setTimeout((()=>u.abort()),e.timeout)}}Xn(l,t({method:(null==e?void 0:e.method)||"GET",headers:a,keepalive:"POST"===e.method&&(s||0)<52428.8,body:o,signal:null===(r=c)||void 0===r?void 0:r.signal},e.fetchOptions)).then((t=>t.text().then((n=>{var r,i={statusCode:t.status,text:n};if(200===t.status)try{i.json=JSON.parse(n)}catch(e){Mr.error(e)}null===(r=e.callback)||void 0===r||r.call(e,i)})))).catch((t=>{var n;Mr.error(t),null===(n=e.callback)||void 0===n||n.call(e,{statusCode:0,text:t})})).finally((()=>c?clearTimeout(c.timeout):null))}}),Jn&&kh.push({transport:"XHR",method:e=>{var t,n=new Jn;n.open(e.method||"GET",e.url,!0);var{contentType:r,body:i}=null!==(t=Ih(e))&&void 0!==t?t:{};Fr(e.headers,(function(e,t){n.setRequestHeader(t,e)})),r&&n.setRequestHeader("Content-Type",r),e.timeout&&(n.timeout=e.timeout),n.withCredentials=!0,n.onreadystatechange=()=>{if(4===n.readyState){var t,r={statusCode:n.status,text:n.responseText};if(200===n.status)try{r.json=JSON.parse(n.responseText)}catch(e){}null===(t=e.callback)||void 0===t||t.call(e,r)}},n.send(i)}}),null!=jn&&jn.sendBeacon&&kh.push({transport:"sendBeacon",method:e=>{var t=Sh(e.url,{beacon:"1"});try{var n,{contentType:r,body:i}=null!==(n=Ih(e))&&void 0!==n?n:{},o="string"==typeof i?new Blob([i],{type:r}):i;jn.sendBeacon(t,o)}catch(e){}}});var Eh=["retriesPerformedSoFar"];class xh{constructor(e){i(this,"isPolling",!1),i(this,"pollIntervalMs",3e3),i(this,"queue",[]),this.instance=e,this.queue=[],this.areWeOnline=!0,!mr(Wn)&&"onLine"in Wn.navigator&&(this.areWeOnline=Wn.navigator.onLine,Wn.addEventListener("online",(()=>{this.areWeOnline=!0,this.flush()})),Wn.addEventListener("offline",(()=>{this.areWeOnline=!1})))}retriableRequest(e){var{retriesPerformedSoFar:n}=e,r=o(e,Eh);Sr(n)&&n>0&&(r.url=Sh(r.url,{retry_count:n})),this.instance._send_request(t(t({},r),{},{callback:e=>{var i;200!==e.statusCode&&(e.statusCode<400||e.statusCode>=500)&&(null!=n?n:0)<10?this.enqueue(t({retriesPerformedSoFar:n},r)):null===(i=r.callback)||void 0===i||i.call(r,e)}}))}enqueue(e){var t=e.retriesPerformedSoFar||0;e.retriesPerformedSoFar=t+1;var n=function(e){var t=3e3*Math.pow(2,e),n=t/2,r=Math.min(18e5,t),i=(Math.random()-.5)*(r-n);return Math.ceil(r+i)}(t),r=Date.now()+n;this.queue.push({retryAt:r,requestOptions:e});var i="Enqueued failed request for retry in ".concat(n);navigator.onLine||(i+=" (Browser is offline)"),Mr.warn(i),this.isPolling||(this.isPolling=!0,this.poll())}poll(){this.poller&&clearTimeout(this.poller),this.poller=setTimeout((()=>{this.areWeOnline&&this.queue.length>0&&this.flush(),this.poll()}),this.pollIntervalMs)}flush(){var e=Date.now(),t=[],n=this.queue.filter((n=>n.retryAt<e||(t.push(n),!1)));if(this.queue=t,n.length>0)for(var{requestOptions:r}of n)this.retriableRequest(r)}unload(){for(var{requestOptions:e}of(this.poller&&(clearTimeout(this.poller),this.poller=void 0),this.queue))try{this.instance._send_request(t(t({},e),{},{transport:"sendBeacon"}))}catch(e){Mr.error(e)}this.queue=[]}}var Th,Mh=Rr("[SessionId]");class Rh{constructor(e,t,n){var r;if(i(this,"_sessionIdChangedHandlers",[]),!e.persistence)throw new Error("SessionIdManager requires a PostHogPersistence instance");if(e.config.__preview_experimental_cookieless_mode)throw new Error("SessionIdManager cannot be used with __preview_experimental_cookieless_mode");this.config=e.config,this.persistence=e.persistence,this._windowId=void 0,this._sessionId=void 0,this._sessionStartTimestamp=null,this._sessionActivityTimestamp=null,this._sessionIdGenerator=t||Yc,this._windowIdGenerator=n||Yc;var o=this.config.persistence_name||this.config.token,s=this.config.session_idle_timeout_seconds||1800;if(this._sessionTimeoutMs=1e3*fd(s,60,36e3,"session_idle_timeout_seconds",1800),e.register({$configured_session_timeout_ms:this._sessionTimeoutMs}),this.resetIdleTimer(),this._window_id_storage_key="ph_"+o+"_window_id",this._primary_window_exists_storage_key="ph_"+o+"_primary_window_exists",this._canUseSessionStorage()){var a=cu.parse(this._window_id_storage_key),l=cu.parse(this._primary_window_exists_storage_key);a&&!l?this._windowId=a:cu.remove(this._window_id_storage_key),cu.set(this._primary_window_exists_storage_key,!0)}if(null!==(r=this.config.bootstrap)&&void 0!==r&&r.sessionID)try{var c=(e=>{var t=e.replace(/-/g,"");if(32!==t.length)throw new Error("Not a valid UUID");if("7"!==t[12])throw new Error("Not a UUIDv7");return parseInt(t.substring(0,12),16)})(this.config.bootstrap.sessionID);this._setSessionId(this.config.bootstrap.sessionID,(new Date).getTime(),c)}catch(e){Mh.error("Invalid sessionID in bootstrap",e)}this._listenToReloadWindow()}get sessionTimeoutMs(){return this._sessionTimeoutMs}onSessionId(e){return mr(this._sessionIdChangedHandlers)&&(this._sessionIdChangedHandlers=[]),this._sessionIdChangedHandlers.push(e),this._sessionId&&e(this._sessionId,this._windowId),()=>{this._sessionIdChangedHandlers=this._sessionIdChangedHandlers.filter((t=>t!==e))}}_canUseSessionStorage(){return"memory"!==this.config.persistence&&!this.persistence.disabled&&cu.is_supported()}_setWindowId(e){e!==this._windowId&&(this._windowId=e,this._canUseSessionStorage()&&cu.set(this._window_id_storage_key,e))}_getWindowId(){return this._windowId?this._windowId:this._canUseSessionStorage()?cu.parse(this._window_id_storage_key):null}_setSessionId(e,t,n){e===this._sessionId&&t===this._sessionActivityTimestamp&&n===this._sessionStartTimestamp||(this._sessionStartTimestamp=n,this._sessionActivityTimestamp=t,this._sessionId=e,this.persistence.register({[vi]:[t,e,n]}))}_getSessionId(){if(this._sessionId&&this._sessionActivityTimestamp&&this._sessionStartTimestamp)return[this._sessionActivityTimestamp,this._sessionId,this._sessionStartTimestamp];var e=this.persistence.props[vi];return dr(e)&&2===e.length&&e.push(e[0]),e||[0,null,0]}resetSessionId(){this._setSessionId(null,null,null)}_listenToReloadWindow(){null==Wn||Wn.addEventListener("beforeunload",(()=>{this._canUseSessionStorage()&&cu.remove(this._primary_window_exists_storage_key)}))}checkAndGetSessionAndWindowId(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;if(this.config.__preview_experimental_cookieless_mode)throw new Error("checkAndGetSessionAndWindowId should not be called in __preview_experimental_cookieless_mode");var n=t||(new Date).getTime(),[r,i,o]=this._getSessionId(),s=this._getWindowId(),a=Sr(o)&&o>0&&Math.abs(n-o)>864e5,l=!1,c=!i,u=!e&&Math.abs(n-r)>this.sessionTimeoutMs;c||u||a?(i=this._sessionIdGenerator(),s=this._windowIdGenerator(),Mh.info("new session ID generated",{sessionId:i,windowId:s,changeReason:{noSessionId:c,activityTimeout:u,sessionPastMaximumLength:a}}),o=n,l=!0):s||(s=this._windowIdGenerator(),l=!0);var d=0===r||!e||a?n:r,h=0===o?(new Date).getTime():o;return this._setWindowId(s),this._setSessionId(i,d,h),e||this.resetIdleTimer(),l&&this._sessionIdChangedHandlers.forEach((e=>e(i,s,l?{noSessionId:c,activityTimeout:u,sessionPastMaximumLength:a}:void 0))),{sessionId:i,windowId:s,sessionStartTimestamp:h,changeReason:l?{noSessionId:c,activityTimeout:u,sessionPastMaximumLength:a}:void 0,lastActivityTimestamp:r}}resetIdleTimer(){clearTimeout(this._enforceIdleTimeout),this._enforceIdleTimeout=setTimeout((()=>{this.resetSessionId()}),1.1*this.sessionTimeoutMs)}}!function(e){e.US="us",e.EU="eu",e.CUSTOM="custom"}(Th||(Th={}));var Ah="i.posthog.com";class Nh{constructor(e){i(this,"_regionCache",{}),this.instance=e}get apiHost(){var e=this.instance.config.api_host.trim().replace(/\/$/,"");return"https://app.posthog.com"===e?"https://us.i.posthog.com":e}get uiHost(){var e,t=null===(e=this.instance.config.ui_host)||void 0===e?void 0:e.replace(/\/$/,"");return t||(t=this.apiHost.replace(".".concat(Ah),".posthog.com")),"https://app.posthog.com"===t?"https://us.posthog.com":t}get region(){return this._regionCache[this.apiHost]||(/https:\/\/(app|us|us-assets)(\.i)?\.posthog\.com/i.test(this.apiHost)?this._regionCache[this.apiHost]=Th.US:/https:\/\/(eu|eu-assets)(\.i)?\.posthog\.com/i.test(this.apiHost)?this._regionCache[this.apiHost]=Th.EU:this._regionCache[this.apiHost]=Th.CUSTOM),this._regionCache[this.apiHost]}endpointFor(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";if(t&&(t="/"===t[0]?t:"/".concat(t)),"ui"===e)return this.uiHost+t;if(this.region===Th.CUSTOM)return this.apiHost+t;var n=Ah+t;switch(e){case"assets":return"https://".concat(this.region,"-assets.").concat(n);case"api":return"https://".concat(this.region,".").concat(n)}}}var Fh="posthog-js";function Oh(e){var{organization:t,projectId:n,prefix:r,severityAllowList:i=["error"]}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return o=>{var s,a,l,c,u;if(!("*"===i||i.includes(o.level))||!e.__loaded)return o;o.tags||(o.tags={});var d=e.requestRouter.endpointFor("ui","/project/".concat(e.config.token,"/person/").concat(e.get_distinct_id()));o.tags["PostHog Person URL"]=d,e.sessionRecordingStarted()&&(o.tags["PostHog Recording URL"]=e.get_session_replay_url({withTimestamp:!0}));var h=(null===(s=o.exception)||void 0===s?void 0:s.values)||[];h.forEach((e=>{e.stacktrace&&(e.stacktrace.type="raw",e.stacktrace.frames.forEach((e=>{e.platform="web:javascript"})))}));var p={$exception_message:(null===(a=h[0])||void 0===a?void 0:a.value)||o.message,$exception_type:null===(l=h[0])||void 0===l?void 0:l.type,$exception_personURL:d,$exception_level:o.level,$exception_list:h,$sentry_event_id:o.event_id,$sentry_exception:o.exception,$sentry_exception_message:(null===(c=h[0])||void 0===c?void 0:c.value)||o.message,$sentry_exception_type:null===(u=h[0])||void 0===u?void 0:u.type,$sentry_tags:o.tags};return t&&n&&(p.$sentry_url=(r||"https://sentry.io/organizations/")+t+"/issues/?project="+n+"&query="+o.event_id),e.exceptions.sendExceptionEvent(p),o}}class Ph{constructor(e,t,n,r,i){this.name=Fh,this.setupOnce=function(o){o(Oh(e,{organization:t,projectId:n,prefix:r,severityAllowList:i}))}}}var Lh=Rr("[SegmentIntegration]");function Dh(e,t){var n=e.config.segment;if(!n)return t();!function(e,t){var n=e.config.segment;if(!n)return t();var r=n=>{var r=()=>n.anonymousId()||Yc();e.config.get_device_id=r,n.id()&&(e.register({distinct_id:n.id(),$device_id:r()}),e.persistence.set_property(ki,"identified")),t()},i=n.user();"then"in i&&hr(i.then)?i.then((e=>r(e))):r(i)}(e,(()=>{n.register((e=>{Promise&&Promise.resolve||Lh.warn("This browser does not have Promise support, and can not use the segment integration");var t=(t,n)=>{var r;if(!n)return t;t.event.userId||t.event.anonymousId===e.get_distinct_id()||(Lh.info("No userId set, resetting PostHog"),e.reset()),t.event.userId&&t.event.userId!==e.get_distinct_id()&&(Lh.info("UserId set, identifying with PostHog"),e.identify(t.event.userId));var i=e._calculate_event_properties(n,null!==(r=t.event.properties)&&void 0!==r?r:{},new Date);return t.event.properties=Object.assign({},i,t.event.properties),t};return{name:"PostHog JS",type:"enrichment",version:"1.0.0",isLoaded:()=>!0,load:()=>Promise.resolve(),track:e=>t(e,e.event.event),page:e=>t(e,"$pageview"),identify:e=>t(e,"$identify"),screen:e=>t(e,"$screen")}})(e)).then((()=>{t()}))}))}class Bh{constructor(e){this._instance=e}doPageView(e,t){var n,r=this._previousPageViewProperties(e,t);return this._currentPageview={pathname:null!==(n=null==Wn?void 0:Wn.location.pathname)&&void 0!==n?n:"",pageViewId:t,timestamp:e},this._instance.scrollManager.resetContext(),r}doPageLeave(e){var t;return this._previousPageViewProperties(e,null===(t=this._currentPageview)||void 0===t?void 0:t.pageViewId)}doEvent(){var e;return{$pageview_id:null===(e=this._currentPageview)||void 0===e?void 0:e.pageViewId}}_previousPageViewProperties(e,t){var n=this._currentPageview;if(!n)return{$pageview_id:t};var r={$pageview_id:t,$prev_pageview_id:n.pageViewId},i=this._instance.scrollManager.getContext();if(i&&!this._instance.config.disable_scroll_properties){var{maxScrollHeight:o,lastScrollY:s,maxScrollY:a,maxContentHeight:l,lastContentY:c,maxContentY:u}=i;if(!(mr(o)||mr(s)||mr(a)||mr(l)||mr(c)||mr(u))){o=Math.ceil(o),s=Math.ceil(s),a=Math.ceil(a),l=Math.ceil(l),c=Math.ceil(c),u=Math.ceil(u);var d=o<=1?1:fd(s/o,0,1),h=o<=1?1:fd(a/o,0,1),p=l<=1?1:fd(c/l,0,1),v=l<=1?1:fd(u/l,0,1);r=Or(r,{$prev_pageview_last_scroll:s,$prev_pageview_last_scroll_percentage:d,$prev_pageview_max_scroll:a,$prev_pageview_max_scroll_percentage:h,$prev_pageview_last_content:c,$prev_pageview_last_content_percentage:p,$prev_pageview_max_content:u,$prev_pageview_max_content_percentage:v})}}return n.pathname&&(r.$prev_pageview_pathname=n.pathname),n.timestamp&&(r.$prev_pageview_duration=(e.getTime()-n.timestamp.getTime())/1e3),r}}class Hh{constructor(){i(this,"events",{}),this.events={}}on(e,t){return this.events[e]||(this.events[e]=[]),this.events[e].push(t),()=>{this.events[e]=this.events[e].filter((e=>e!==t))}}emit(e,t){for(var n of this.events[e]||[])n(t);for(var r of this.events["*"]||[])r(e,t)}}class qh{constructor(e){i(this,"_debugEventEmitter",new Hh),i(this,"checkStep",((e,t)=>this.checkStepEvent(e,t)&&this.checkStepUrl(e,t)&&this.checkStepElement(e,t))),i(this,"checkStepEvent",((e,t)=>null==t||!t.event||(null==e?void 0:e.event)===(null==t?void 0:t.event))),this.instance=e,this.actionEvents=new Set,this.actionRegistry=new Set}init(){var e;if(!mr(null===(e=this.instance)||void 0===e?void 0:e._addCaptureHook)){var t;null===(t=this.instance)||void 0===t||t._addCaptureHook(((e,t)=>{this.on(e,t)}))}}register(e){var t,n;if(!mr(null===(t=this.instance)||void 0===t?void 0:t._addCaptureHook)&&(e.forEach((e=>{var t,n;null===(t=this.actionRegistry)||void 0===t||t.add(e),null===(n=e.steps)||void 0===n||n.forEach((e=>{var t;null===(t=this.actionEvents)||void 0===t||t.add((null==e?void 0:e.event)||"")}))})),null!==(n=this.instance)&&void 0!==n&&n.autocapture)){var r,i=new Set;e.forEach((e=>{var t;null===(t=e.steps)||void 0===t||t.forEach((e=>{null!=e&&e.selector&&i.add(null==e?void 0:e.selector)}))})),null===(r=this.instance)||void 0===r||r.autocapture.setElementSelectors(i)}}on(e,t){var n;null!=t&&0!=e.length&&(this.actionEvents.has(e)||this.actionEvents.has(null==t?void 0:t.event))&&this.actionRegistry&&(null===(n=this.actionRegistry)||void 0===n?void 0:n.size)>0&&this.actionRegistry.forEach((e=>{this.checkAction(t,e)&&this._debugEventEmitter.emit("actionCaptured",e.name)}))}_addActionHook(e){this.onAction("actionCaptured",(t=>e(t)))}checkAction(e,t){if(null==(null==t?void 0:t.steps))return!1;for(var n of t.steps)if(this.checkStep(e,n))return!0;return!1}onAction(e,t){return this._debugEventEmitter.on(e,t)}checkStepUrl(e,t){if(null!=t&&t.url){var n,r=null==e||null===(n=e.properties)||void 0===n?void 0:n.$current_url;if(!r||"string"!=typeof r)return!1;if(!qh.matchString(r,null==t?void 0:t.url,(null==t?void 0:t.url_matching)||"contains"))return!1}return!0}static matchString(e,t,n){switch(n){case"regex":return!!Wn&&jr(e,t);case"exact":return t===e;case"contains":var r=qh.escapeStringRegexp(t).replace(/_/g,".").replace(/%/g,".*");return jr(e,r);default:return!1}}static escapeStringRegexp(e){return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}checkStepElement(e,t){if((null!=t&&t.href||null!=t&&t.tag_name||null!=t&&t.text)&&!this.getElementsList(e).some((e=>!(null!=t&&t.href&&!qh.matchString(e.href||"",null==t?void 0:t.href,(null==t?void 0:t.href_matching)||"exact"))&&((null==t||!t.tag_name||e.tag_name===(null==t?void 0:t.tag_name))&&!(null!=t&&t.text&&!qh.matchString(e.text||"",null==t?void 0:t.text,(null==t?void 0:t.text_matching)||"exact")&&!qh.matchString(e.$el_text||"",null==t?void 0:t.text,(null==t?void 0:t.text_matching)||"exact"))))))return!1;if(null!=t&&t.selector){var n,r=null==e||null===(n=e.properties)||void 0===n?void 0:n.$element_selectors;if(!r)return!1;if(!r.includes(null==t?void 0:t.selector))return!1}return!0}getElementsList(e){return null==(null==e?void 0:e.properties.$elements)?[]:null==e?void 0:e.properties.$elements}}class $h{constructor(e){this.instance=e,this.eventToSurveys=new Map,this.actionToSurveys=new Map}register(e){var t;mr(null===(t=this.instance)||void 0===t?void 0:t._addCaptureHook)||(this.setupEventBasedSurveys(e),this.setupActionBasedSurveys(e))}setupActionBasedSurveys(e){var t=e.filter((e=>{var t,n,r,i;return(null===(t=e.conditions)||void 0===t?void 0:t.actions)&&(null===(n=e.conditions)||void 0===n||null===(r=n.actions)||void 0===r||null===(i=r.values)||void 0===i?void 0:i.length)>0}));if(0!==t.length){if(null==this.actionMatcher){this.actionMatcher=new qh(this.instance),this.actionMatcher.init();this.actionMatcher._addActionHook((e=>{this.onAction(e)}))}t.forEach((e=>{var t,n,r,i,o,s,a,l,c,u;e.conditions&&null!==(t=e.conditions)&&void 0!==t&&t.actions&&null!==(n=e.conditions)&&void 0!==n&&null!==(r=n.actions)&&void 0!==r&&r.values&&(null===(i=e.conditions)||void 0===i||null===(o=i.actions)||void 0===o||null===(s=o.values)||void 0===s?void 0:s.length)>0&&(null===(a=this.actionMatcher)||void 0===a||a.register(e.conditions.actions.values),null===(l=e.conditions)||void 0===l||null===(c=l.actions)||void 0===c||null===(u=c.values)||void 0===u||u.forEach((t=>{if(t&&t.name){var n=this.actionToSurveys.get(t.name);n&&n.push(e.id),this.actionToSurveys.set(t.name,n||[e.id])}})))}))}}setupEventBasedSurveys(e){var t;if(0!==e.filter((e=>{var t,n,r,i;return(null===(t=e.conditions)||void 0===t?void 0:t.events)&&(null===(n=e.conditions)||void 0===n||null===(r=n.events)||void 0===r||null===(i=r.values)||void 0===i?void 0:i.length)>0})).length){null===(t=this.instance)||void 0===t||t._addCaptureHook(((e,t)=>{this.onEvent(e,t)})),e.forEach((e=>{var t,n,r;null===(t=e.conditions)||void 0===t||null===(n=t.events)||void 0===n||null===(r=n.values)||void 0===r||r.forEach((t=>{if(t&&t.name){var n=this.eventToSurveys.get(t.name);n&&n.push(e.id),this.eventToSurveys.set(t.name,n||[e.id])}}))}))}}onEvent(e,t){var n,r,i=(null===(n=this.instance)||void 0===n||null===(r=n.persistence)||void 0===r?void 0:r.props[Ci])||[];if($h.SURVEY_SHOWN_EVENT_NAME==e&&t&&i.length>0){var o,s=null==t||null===(o=t.properties)||void 0===o?void 0:o.$survey_id;if(s){var a=i.indexOf(s);a>=0&&(i.splice(a,1),this._updateActivatedSurveys(i))}}else this.eventToSurveys.has(e)&&this._updateActivatedSurveys(i.concat(this.eventToSurveys.get(e)||[]))}onAction(e){var t,n,r=(null===(t=this.instance)||void 0===t||null===(n=t.persistence)||void 0===n?void 0:n.props[Ci])||[];this.actionToSurveys.has(e)&&this._updateActivatedSurveys(r.concat(this.actionToSurveys.get(e)||[]))}_updateActivatedSurveys(e){var t,n;null===(t=this.instance)||void 0===t||null===(n=t.persistence)||void 0===n||n.register({[Ci]:[...new Set(e)]})}getSurveys(){var e,t,n=null===(e=this.instance)||void 0===e||null===(t=e.persistence)||void 0===t?void 0:t.props[Ci];return n||[]}getEventToSurveys(){return this.eventToSurveys}_getActionMatcher(){return this.actionMatcher}}i($h,"SURVEY_SHOWN_EVENT_NAME","survey shown");var Wh=Rr("[Surveys]"),Vh={icontains:e=>!!Wn&&Wn.location.href.toLowerCase().indexOf(e.toLowerCase())>-1,not_icontains:e=>!!Wn&&-1===Wn.location.href.toLowerCase().indexOf(e.toLowerCase()),regex:e=>!!Wn&&jr(Wn.location.href,e),not_regex:e=>!!Wn&&!jr(Wn.location.href,e),exact:e=>(null==Wn?void 0:Wn.location.href)===e,is_not:e=>(null==Wn?void 0:Wn.location.href)!==e};function Zh(e,t,n){var r,i=e.questions[t],o=t+1;if(null===(r=i.branching)||void 0===r||!r.type)return t===e.questions.length-1?$o.End:o;if(i.branching.type===$o.End)return $o.End;if(i.branching.type===$o.SpecificQuestion){if(Number.isInteger(i.branching.index))return i.branching.index}else if(i.branching.type===$o.ResponseBased){if(i.type===qo.SingleChoice){var s,a,l=i.choices.indexOf("".concat(n));if(null!==(s=i.branching)&&void 0!==s&&null!==(a=s.responseValues)&&void 0!==a&&a.hasOwnProperty(l)){var c=i.branching.responseValues[l];return Number.isInteger(c)?c:c===$o.End?$o.End:o}}else if(i.type===qo.Rating){var u,d;if("number"!=typeof n||!Number.isInteger(n))throw new Error("The response type must be an integer");var h=function(e,t){if(3===t){if(e<1||e>3)throw new Error("The response must be in range 1-3");return 1===e?"negative":2===e?"neutral":"positive"}if(5===t){if(e<1||e>5)throw new Error("The response must be in range 1-5");return e<=2?"negative":3===e?"neutral":"positive"}if(7===t){if(e<1||e>7)throw new Error("The response must be in range 1-7");return e<=3?"negative":4===e?"neutral":"positive"}if(10===t){if(e<0||e>10)throw new Error("The response must be in range 0-10");return e<=6?"detractors":e<=8?"passives":"promoters"}throw new Error("The scale must be one of: 3, 5, 7, 10")}(n,i.scale);if(null!==(u=i.branching)&&void 0!==u&&null!==(d=u.responseValues)&&void 0!==d&&d.hasOwnProperty(h)){var p=i.branching.responseValues[h];return Number.isInteger(p)?p:p===$o.End?$o.End:o}}return o}return Wh.warn("Falling back to next question index due to unexpected branching type"),o}class Gh{constructor(e){i(this,"getNextSurveyStep",Zh),this.instance=e,this._surveyEventReceiver=null}onRemoteConfig(e){this._decideServerResponse=!!e.surveys,Wh.info("decideServerResponse set to ".concat(this._decideServerResponse)),this.loadIfEnabled()}reset(){localStorage.removeItem("lastSeenSurveyDate");var e=(()=>{for(var e=[],t=0;t<localStorage.length;t++){var n=localStorage.key(t);null!=n&&n.startsWith(Qs)&&e.push(n)}return e})();e.forEach((e=>localStorage.removeItem(e)))}loadIfEnabled(){if(!this._surveyManager)if(this.instance.config.disable_surveys)Wh.info("Disabled. Not loading surveys.");else{var e=null==er?void 0:er.__PosthogExtensions__;if(e){var t=e.generateSurveys;if(this._decideServerResponse)if(null==this._surveyEventReceiver&&(this._surveyEventReceiver=new $h(this.instance)),t)this._surveyManager=t(this.instance);else{var n=e.loadExternalDependency;n?n(this.instance,"surveys",(t=>{var n;t?Wh.error("Could not load surveys script",t):this._surveyManager=null===(n=e.generateSurveys)||void 0===n?void 0:n.call(e,this.instance)})):Wh.error("PostHog loadExternalDependency extension not found. Cannot load remote config.")}else Wh.warn("Decide not loaded yet. Not loading surveys.")}else Wh.error("PostHog Extensions not found.")}}getSurveys(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(this.instance.config.disable_surveys)return Wh.info("Disabled. Not loading surveys."),e([]);null==this._surveyEventReceiver&&(this._surveyEventReceiver=new $h(this.instance));var n=this.instance.get_property(Si);if(n&&!t)return Wh.info("Surveys already loaded, using existing data."),e(n);this.instance._send_request({url:this.instance.requestRouter.endpointFor("api","/api/surveys/?token=".concat(this.instance.config.token)),method:"GET",callback:t=>{var n,r=t.statusCode;if(200!==r||!t.json)return Wh.error("Surveys API could not be loaded, status: ".concat(r)),e([]);var i,o=t.json.surveys||[],s=o.filter((e=>{var t,n,r,i,o,s,a,l,c,u,d,h;return(null===(t=e.conditions)||void 0===t?void 0:t.events)&&(null===(n=e.conditions)||void 0===n||null===(r=n.events)||void 0===r?void 0:r.values)&&(null===(i=e.conditions)||void 0===i||null===(o=i.events)||void 0===o||null===(s=o.values)||void 0===s?void 0:s.length)>0||(null===(a=e.conditions)||void 0===a?void 0:a.actions)&&(null===(l=e.conditions)||void 0===l||null===(c=l.actions)||void 0===c?void 0:c.values)&&(null===(u=e.conditions)||void 0===u||null===(d=u.actions)||void 0===d||null===(h=d.values)||void 0===h?void 0:h.length)>0}));s.length>0&&(null===(i=this._surveyEventReceiver)||void 0===i||i.register(s));return null===(n=this.instance.persistence)||void 0===n||n.register({[Si]:o}),e(o)}})}getActiveMatchingSurveys(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];this.getSurveys((t=>{var n,r=t.filter((e=>!(!e.start_date||e.end_date))).filter((e=>{var t,n,r,i;if(!e.conditions)return!0;var o=null===(t=e.conditions)||void 0===t||!t.url||Vh[null!==(n=null===(r=e.conditions)||void 0===r?void 0:r.urlMatchType)&&void 0!==n?n:"icontains"](e.conditions.url),s=null===(i=e.conditions)||void 0===i||!i.selector||(null==zn?void 0:zn.querySelector(e.conditions.selector));return o&&s})),i=null===(n=this._surveyEventReceiver)||void 0===n?void 0:n.getSurveys(),o=r.filter((e=>{var t,n,r,o,s,a,l,c,u,d,h;if(!(e.linked_flag_key||e.targeting_flag_key||e.internal_targeting_flag_key||null!==(t=e.feature_flag_keys)&&void 0!==t&&t.length))return!0;var p=!e.linked_flag_key||this.instance.featureFlags.isFeatureEnabled(e.linked_flag_key),v=!e.targeting_flag_key||this.instance.featureFlags.isFeatureEnabled(e.targeting_flag_key),g=(null===(n=e.conditions)||void 0===n?void 0:n.events)&&(null===(r=e.conditions)||void 0===r||null===(o=r.events)||void 0===o?void 0:o.values)&&(null===(s=e.conditions)||void 0===s||null===(a=s.events)||void 0===a?void 0:a.values.length)>0,f=(null===(l=e.conditions)||void 0===l?void 0:l.actions)&&(null===(c=e.conditions)||void 0===c||null===(u=c.actions)||void 0===u?void 0:u.values)&&(null===(d=e.conditions)||void 0===d||null===(h=d.actions)||void 0===h?void 0:h.values.length)>0,m=!g&&!f||(null==i?void 0:i.includes(e.id)),_=this._canActivateRepeatedly(e),y=!(e.internal_targeting_flag_key&&!_)||this.instance.featureFlags.isFeatureEnabled(e.internal_targeting_flag_key),b=this.checkFlags(e);return p&&v&&y&&m&&b}));return e(o)}),t)}checkFlags(e){var t;return null===(t=e.feature_flag_keys)||void 0===t||!t.length||e.feature_flag_keys.every((e=>{var{key:t,value:n}=e;return!t||!n||this.instance.featureFlags.isFeatureEnabled(n)}))}_canActivateRepeatedly(e){var t;return wr(null===(t=er.__PosthogExtensions__)||void 0===t?void 0:t.canActivateRepeatedly)?(Wh.warn("init was not called"),!1):er.__PosthogExtensions__.canActivateRepeatedly(e)}canRenderSurvey(e){wr(this._surveyManager)?Wh.warn("init was not called"):this.getSurveys((t=>{var n=t.filter((t=>t.id===e))[0];this._surveyManager.canRenderSurvey(n)}))}renderSurvey(e,t){wr(this._surveyManager)?Wh.warn("init was not called"):this.getSurveys((n=>{var r=n.filter((t=>t.id===e))[0];this._surveyManager.renderSurvey(r,null==zn?void 0:zn.querySelector(t))}))}}var Uh=Rr("[RateLimiter]");class jh{constructor(e){var t,n;i(this,"serverLimits",{}),i(this,"lastEventRateLimited",!1),i(this,"checkForLimiting",(e=>{var t=e.text;if(t&&t.length)try{(JSON.parse(t).quota_limited||[]).forEach((e=>{Uh.info("".concat(e||"events"," is quota limited.")),this.serverLimits[e]=(new Date).getTime()+6e4}))}catch(e){return void Uh.warn('could not rate limit - continuing. Error: "'.concat(null==e?void 0:e.message,'"'),{text:t})}})),this.instance=e,this.captureEventsPerSecond=(null===(t=e.config.rate_limiting)||void 0===t?void 0:t.events_per_second)||10,this.captureEventsBurstLimit=Math.max((null===(n=e.config.rate_limiting)||void 0===n?void 0:n.events_burst_limit)||10*this.captureEventsPerSecond,this.captureEventsPerSecond),this.lastEventRateLimited=this.clientRateLimitContext(!0).isRateLimited}clientRateLimitContext(){var e,t,n,r=arguments.length>0&&void 0!==arguments[0]&&arguments[0],i=(new Date).getTime(),o=null!==(e=null===(t=this.instance.persistence)||void 0===t?void 0:t.get_property(xi))&&void 0!==e?e:{tokens:this.captureEventsBurstLimit,last:i};o.tokens+=(i-o.last)/1e3*this.captureEventsPerSecond,o.last=i,o.tokens>this.captureEventsBurstLimit&&(o.tokens=this.captureEventsBurstLimit);var s=o.tokens<1;return s||r||(o.tokens=Math.max(0,o.tokens-1)),!s||this.lastEventRateLimited||r||this.instance.capture("$$client_ingestion_warning",{$$client_ingestion_warning_message:"posthog-js client rate limited. Config is set to ".concat(this.captureEventsPerSecond," events per second and ").concat(this.captureEventsBurstLimit," events burst limit.")},{skip_client_rate_limiting:!0}),this.lastEventRateLimited=s,null===(n=this.instance.persistence)||void 0===n||n.set_property(xi,o),{isRateLimited:s,remainingTokens:o.tokens}}isServerRateLimited(e){var t=this.serverLimits[e||"events"]||!1;return!1!==t&&(new Date).getTime()<t}}var zh=e=>{var n=null==e?void 0:e.config;return t({initialPathName:(null==Yn?void 0:Yn.pathname)||"",referringDomain:cd.referringDomain()},cd.campaignParams({customTrackedParams:null==n?void 0:n.custom_campaign_params,maskPersonalDataProperties:null==n?void 0:n.mask_personal_data_properties,customPersonalDataProperties:null==n?void 0:n.custom_personal_data_properties}))};class Yh{constructor(e,t,n,r){i(this,"_onSessionIdCallback",(e=>{var t=this._getStoredProps();if(!t||t.sessionId!==e){var n={sessionId:e,props:this._sessionSourceParamGenerator(this.instance)};this._persistence.register({[Ei]:n})}})),this.instance=e,this._sessionIdManager=t,this._persistence=n,this._sessionSourceParamGenerator=r||zh,this._sessionIdManager.onSessionId(this._onSessionIdCallback)}_getStoredProps(){return this._persistence.props[Ei]}getSessionProps(){var e,t=null===(e=this._getStoredProps())||void 0===e?void 0:e.props;return t?{$client_session_initial_referring_host:t.referringDomain,$client_session_initial_pathname:t.initialPathName,$client_session_initial_utm_source:t.utm_source,$client_session_initial_utm_campaign:t.utm_campaign,$client_session_initial_utm_medium:t.utm_medium,$client_session_initial_utm_content:t.utm_content,$client_session_initial_utm_term:t.utm_term}:{}}}var Xh=["ahrefsbot","ahrefssiteaudit","applebot","baiduspider","better uptime bot","bingbot","bingpreview","bot.htm","bot.php","crawler","deepscan","duckduckbot","facebookexternal","facebookcatalog","http://yandex.com/bots","hubspot","ia_archiver","linkedinbot","mj12bot","msnbot","nessus","petalbot","pinterest","prerender","rogerbot","screaming frog","semrushbot","sitebulb","slurp","turnitin","twitterbot","vercelbot","yahoo! slurp","yandexbot","gptbot","oai-searchbot","chatgpt-user","headlesschrome","cypress","Google-HotelAdsVerifier","adsbot-google","apis-google","duplexweb-google","feedfetcher-google","google favicon","google web preview","google-read-aloud","googlebot","googleweblight","mediapartners-google","storebot-google","Bytespider;"],Jh=function(e,t){if(!e)return!1;var n=e.toLowerCase();return Xh.concat(t||[]).some((e=>{var t=e.toLowerCase();return-1!==n.indexOf(t)}))},Kh=function(e,t){if(!e)return!1;var n=e.userAgent;if(n&&Jh(n,t))return!0;try{var r=null==e?void 0:e.userAgentData;if(null!=r&&r.brands&&r.brands.some((e=>Jh(null==e?void 0:e.brand,t))))return!0}catch(e){}return!!e.webdriver},Qh=Rr("[Dead Clicks]"),ep=()=>!0,tp=e=>{var t,n=!(null===(t=e.instance.persistence)||void 0===t||!t.get_property(oi)),r=e.instance.config.capture_dead_clicks;return Cr(r)?r:n};class np{get lazyLoadedDeadClicksAutocapture(){return this._lazyLoadedDeadClicksAutocapture}constructor(e,t,n){this.instance=e,this.isEnabled=t,this.onCapture=n,this.startIfEnabled()}onRemoteConfig(e){this.instance.persistence&&this.instance.persistence.register({[oi]:null==e?void 0:e.captureDeadClicks}),this.startIfEnabled()}startIfEnabled(){this.isEnabled(this)&&this.loadScript((()=>{this.start()}))}loadScript(e){var t,n,r;null!==(t=er.__PosthogExtensions__)&&void 0!==t&&t.initDeadClicksAutocapture&&e(),null===(n=er.__PosthogExtensions__)||void 0===n||null===(r=n.loadExternalDependency)||void 0===r||r.call(n,this.instance,"dead-clicks-autocapture",(t=>{t?Qh.error("failed to load script",t):e()}))}start(){var e;if(zn){if(!this._lazyLoadedDeadClicksAutocapture&&null!==(e=er.__PosthogExtensions__)&&void 0!==e&&e.initDeadClicksAutocapture){var t=gr(this.instance.config.capture_dead_clicks)?this.instance.config.capture_dead_clicks:{};t.__onCapture=this.onCapture,this._lazyLoadedDeadClicksAutocapture=er.__PosthogExtensions__.initDeadClicksAutocapture(this.instance,t),this._lazyLoadedDeadClicksAutocapture.start(zn),Qh.info("starting...")}}else Qh.error("`document` not found. Cannot start.")}stop(){this._lazyLoadedDeadClicksAutocapture&&(this._lazyLoadedDeadClicksAutocapture.stop(),this._lazyLoadedDeadClicksAutocapture=void 0,Qh.info("stopping..."))}}var rp=Rr("[Heatmaps]");function ip(e){return gr(e)&&"clientX"in e&&"clientY"in e&&Sr(e.clientX)&&Sr(e.clientY)}class op{constructor(e){var t;i(this,"rageclicks",new Ec),i(this,"_enabledServerSide",!1),i(this,"_initialized",!1),i(this,"_flushInterval",null),this.instance=e,this._enabledServerSide=!(null===(t=this.instance.persistence)||void 0===t||!t.props[ni]),null==Wn||Wn.addEventListener("beforeunload",(()=>{this.flush()}))}get flushIntervalMilliseconds(){var e=5e3;return gr(this.instance.config.capture_heatmaps)&&this.instance.config.capture_heatmaps.flush_interval_milliseconds&&(e=this.instance.config.capture_heatmaps.flush_interval_milliseconds),e}get isEnabled(){return mr(this.instance.config.capture_heatmaps)?mr(this.instance.config.enable_heatmaps)?this._enabledServerSide:this.instance.config.enable_heatmaps:!1!==this.instance.config.capture_heatmaps}startIfEnabled(){if(this.isEnabled){if(this._initialized)return;rp.info("starting..."),this._setupListeners(),this._flushInterval=setInterval(this.flush.bind(this),this.flushIntervalMilliseconds)}else{var e,t;clearInterval(null!==(e=this._flushInterval)&&void 0!==e?e:void 0),null===(t=this.deadClicksCapture)||void 0===t||t.stop(),this.getAndClearBuffer()}}onRemoteConfig(e){var t=!!e.heatmaps;this.instance.persistence&&this.instance.persistence.register({[ni]:t}),this._enabledServerSide=t,this.startIfEnabled()}getAndClearBuffer(){var e=this.buffer;return this.buffer=void 0,e}_onDeadClick(e){this._onClick(e.originalEvent,"deadclick")}_setupListeners(){Wn&&zn&&($r(zn,"click",(e=>this._onClick(e||(null==Wn?void 0:Wn.event))),!1,!0),$r(zn,"mousemove",(e=>this._onMouseMove(e||(null==Wn?void 0:Wn.event))),!1,!0),this.deadClicksCapture=new np(this.instance,ep,this._onDeadClick.bind(this)),this.deadClicksCapture.startIfEnabled(),this._initialized=!0)}_getProperties(e,t){var n=this.instance.scrollManager.scrollY(),r=this.instance.scrollManager.scrollX(),i=this.instance.scrollManager.scrollElement(),o=function(e,t,n){for(var r=e;r&&Li(r)&&!Di(r,"body");){if(r===n)return!1;if(ir(t,null==Wn?void 0:Wn.getComputedStyle(r).position))return!0;r=ji(r)}return!1}(Gi(e),["fixed","sticky"],i);return{x:e.clientX+(o?0:r),y:e.clientY+(o?0:n),target_fixed:o,type:t}}_onClick(e){var n,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"click";if(!Pi(e.target)&&ip(e)){var i=this._getProperties(e,r);null!==(n=this.rageclicks)&&void 0!==n&&n.isRageClick(e.clientX,e.clientY,(new Date).getTime())&&this._capture(t(t({},i),{},{type:"rageclick"})),this._capture(i)}}_onMouseMove(e){!Pi(e.target)&&ip(e)&&(clearTimeout(this._mouseMoveTimeout),this._mouseMoveTimeout=setTimeout((()=>{this._capture(this._getProperties(e,"mousemove"))}),500))}_capture(e){if(Wn){var t=Wn.location.href;this.buffer=this.buffer||{},this.buffer[t]||(this.buffer[t]=[]),this.buffer[t].push(e)}}flush(){this.buffer&&!fr(this.buffer)&&this.instance.capture("$$heatmap",{$heatmap_data:this.getAndClearBuffer()})}}class sp{constructor(e){i(this,"_updateScrollData",(()=>{var e,t,n,r;this.context||(this.context={});var i=this.scrollElement(),o=this.scrollY(),s=i?Math.max(0,i.scrollHeight-i.clientHeight):0,a=o+((null==i?void 0:i.clientHeight)||0),l=(null==i?void 0:i.scrollHeight)||0;this.context.lastScrollY=Math.ceil(o),this.context.maxScrollY=Math.max(o,null!==(e=this.context.maxScrollY)&&void 0!==e?e:0),this.context.maxScrollHeight=Math.max(s,null!==(t=this.context.maxScrollHeight)&&void 0!==t?t:0),this.context.lastContentY=a,this.context.maxContentY=Math.max(a,null!==(n=this.context.maxContentY)&&void 0!==n?n:0),this.context.maxContentHeight=Math.max(l,null!==(r=this.context.maxContentHeight)&&void 0!==r?r:0)})),this.instance=e}getContext(){return this.context}resetContext(){var e=this.context;return setTimeout(this._updateScrollData,0),e}startMeasuringScrollPosition(){null==Wn||Wn.addEventListener("scroll",this._updateScrollData,{capture:!0,passive:!0}),null==Wn||Wn.addEventListener("scrollend",this._updateScrollData,{capture:!0,passive:!0}),null==Wn||Wn.addEventListener("resize",this._updateScrollData,{passive:!0})}scrollElement(){if(!this.instance.config.scroll_root_selector)return null==Wn?void 0:Wn.document.documentElement;var e=dr(this.instance.config.scroll_root_selector)?this.instance.config.scroll_root_selector:[this.instance.config.scroll_root_selector];for(var t of e){var n=null==Wn?void 0:Wn.document.querySelector(t);if(n)return n}}scrollY(){if(this.instance.config.scroll_root_selector){var e=this.scrollElement();return e&&e.scrollTop||0}return Wn&&(Wn.scrollY||Wn.pageYOffset||Wn.document.documentElement.scrollTop)||0}scrollX(){if(this.instance.config.scroll_root_selector){var e=this.scrollElement();return e&&e.scrollLeft||0}return Wn&&(Wn.scrollX||Wn.pageXOffset||Wn.document.documentElement.scrollLeft)||0}}var ap=Rr("[TracingHeaders]");class lp{constructor(e){i(this,"_restoreXHRPatch",void 0),i(this,"_restoreFetchPatch",void 0),i(this,"_startCapturing",(()=>{var e,t,n,r;mr(this._restoreXHRPatch)&&(null===(e=er.__PosthogExtensions__)||void 0===e||null===(t=e.tracingHeadersPatchFns)||void 0===t||t._patchXHR(this.instance.sessionManager));mr(this._restoreFetchPatch)&&(null===(n=er.__PosthogExtensions__)||void 0===n||null===(r=n.tracingHeadersPatchFns)||void 0===r||r._patchFetch(this.instance.sessionManager))})),this.instance=e}_loadScript(e){var t,n,r;null!==(t=er.__PosthogExtensions__)&&void 0!==t&&t.tracingHeadersPatchFns&&e(),null===(n=er.__PosthogExtensions__)||void 0===n||null===(r=n.loadExternalDependency)||void 0===r||r.call(n,this.instance,"tracing-headers",(t=>{if(t)return ap.error("failed to load script",t);e()}))}startIfEnabledOrStop(){var e,t;this.instance.config.__add_tracing_headers?this._loadScript(this._startCapturing):(null===(e=this._restoreXHRPatch)||void 0===e||e.call(this),null===(t=this._restoreFetchPatch)||void 0===t||t.call(this),this._restoreXHRPatch=void 0,this._restoreFetchPatch=void 0)}}var cp;!function(e){e[e.PENDING=-1]="PENDING",e[e.DENIED=0]="DENIED",e[e.GRANTED=1]="GRANTED"}(cp||(cp={}));class up{constructor(e){this.instance=e}get config(){return this.instance.config}get consent(){return this.getDnt()?cp.DENIED:this.storedConsent}isOptedOut(){return this.consent===cp.DENIED||this.consent===cp.PENDING&&this.config.opt_out_capturing_by_default}isOptedIn(){return!this.isOptedOut()}optInOut(e){this.storage.set(this.storageKey,e?1:0,this.config.cookie_expiration,this.config.cross_subdomain_cookie,this.config.secure_cookie)}reset(){this.storage.remove(this.storageKey,this.config.cross_subdomain_cookie)}get storageKey(){var{token:e,opt_out_capturing_cookie_prefix:t}=this.instance.config;return(t||"__ph_opt_in_out_")+e}get storedConsent(){var e=this.storage.get(this.storageKey);return"1"===e?cp.GRANTED:"0"===e?cp.DENIED:cp.PENDING}get storage(){if(!this._storage){var e=this.config.opt_out_capturing_persistence_type;this._storage="localStorage"===e?ru:tu;var t="localStorage"===e?tu:ru;t.get(this.storageKey)&&(this._storage.get(this.storageKey)||this.optInOut("1"===t.get(this.storageKey)),t.remove(this.storageKey,this.config.cross_subdomain_cookie))}return this._storage}getDnt(){return!!this.config.respect_dnt&&!!Zr([null==jn?void 0:jn.doNotTrack,null==jn?void 0:jn.msDoNotTrack,er.doNotTrack],(e=>ir([!0,1,"1","yes"],e)))}}var dp=Rr("[ExceptionAutocapture]");class hp{constructor(e){var t;i(this,"originalOnUnhandledRejectionHandler",void 0),i(this,"startCapturing",(()=>{var e,t,n,r;if(Wn&&this.isEnabled&&!this.hasHandlers&&!this.isCapturing){var i=null===(e=er.__PosthogExtensions__)||void 0===e||null===(t=e.errorWrappingFunctions)||void 0===t?void 0:t.wrapOnError,o=null===(n=er.__PosthogExtensions__)||void 0===n||null===(r=n.errorWrappingFunctions)||void 0===r?void 0:r.wrapUnhandledRejection;if(i&&o)try{this.unwrapOnError=i(this.captureException.bind(this)),this.unwrapUnhandledRejection=o(this.captureException.bind(this))}catch(e){dp.error("failed to start",e),this.stopCapturing()}else dp.error("failed to load error wrapping functions - cannot start")}})),this.instance=e,this.remoteEnabled=!(null===(t=this.instance.persistence)||void 0===t||!t.props[ri]),this.startIfEnabled()}get isEnabled(){var e;return null!==(e=this.remoteEnabled)&&void 0!==e&&e}get isCapturing(){var e;return!(null==Wn||null===(e=Wn.onerror)||void 0===e||!e.__POSTHOG_INSTRUMENTED__)}get hasHandlers(){return this.originalOnUnhandledRejectionHandler||this.unwrapOnError}startIfEnabled(){this.isEnabled&&!this.isCapturing&&(dp.info("enabled, starting..."),this.loadScript(this.startCapturing))}loadScript(e){var t,n;this.hasHandlers&&e(),null===(t=er.__PosthogExtensions__)||void 0===t||null===(n=t.loadExternalDependency)||void 0===n||n.call(t,this.instance,"exception-autocapture",(t=>{if(t)return dp.error("failed to load script",t);e()}))}stopCapturing(){var e,t;null===(e=this.unwrapOnError)||void 0===e||e.call(this),null===(t=this.unwrapUnhandledRejection)||void 0===t||t.call(this)}onRemoteConfig(e){var t=e.autocaptureExceptions;this.remoteEnabled=!!t||!1,this.instance.persistence&&this.instance.persistence.register({[ri]:this.remoteEnabled}),this.startIfEnabled()}captureException(e){var t=this.instance.requestRouter.endpointFor("ui");e.$exception_personURL="".concat(t,"/project/").concat(this.instance.config.token,"/person/").concat(this.instance.get_distinct_id()),this.instance.exceptions.sendExceptionEvent(e)}}var pp=Rr("[Web Vitals]"),vp=9e5;class gp{constructor(e){var n;i(this,"_enabledServerSide",!1),i(this,"_initialized",!1),i(this,"buffer",{url:void 0,metrics:[],firstMetricTimestamp:void 0}),i(this,"_flushToCapture",(()=>{clearTimeout(this._delayedFlushTimer),0!==this.buffer.metrics.length&&(this.instance.capture("$web_vitals",this.buffer.metrics.reduce(((e,n)=>t(t({},e),{},{["$web_vitals_".concat(n.name,"_event")]:t({},n),["$web_vitals_".concat(n.name,"_value")]:n.value})),{})),this.buffer={url:void 0,metrics:[],firstMetricTimestamp:void 0})})),i(this,"_addToBuffer",(e=>{var n,r=null===(n=this.instance.sessionManager)||void 0===n?void 0:n.checkAndGetSessionAndWindowId(!0);if(mr(r))pp.error("Could not read session ID. Dropping metrics!");else{this.buffer=this.buffer||{url:void 0,metrics:[],firstMetricTimestamp:void 0};var i=this._currentURL();if(!mr(i))if(wr(null==e?void 0:e.name)||wr(null==e?void 0:e.value))pp.error("Invalid metric received",e);else if(this._maxAllowedValue&&e.value>=this._maxAllowedValue)pp.error("Ignoring metric with value >= "+this._maxAllowedValue,e);else this.buffer.url!==i&&(this._flushToCapture(),this._delayedFlushTimer=setTimeout(this._flushToCapture,this.flushToCaptureTimeoutMs)),mr(this.buffer.url)&&(this.buffer.url=i),this.buffer.firstMetricTimestamp=mr(this.buffer.firstMetricTimestamp)?Date.now():this.buffer.firstMetricTimestamp,e.attribution&&e.attribution.interactionTargetElement&&(e.attribution.interactionTargetElement=void 0),this.buffer.metrics.push(t(t({},e),{},{$current_url:i,$session_id:r.sessionId,$window_id:r.windowId,timestamp:Date.now()})),this.buffer.metrics.length===this.allowedMetrics.length&&this._flushToCapture()}})),i(this,"_startCapturing",(()=>{var e,t,n,r,i=er.__PosthogExtensions__;mr(i)||mr(i.postHogWebVitalsCallbacks)||({onLCP:e,onCLS:t,onFCP:n,onINP:r}=i.postHogWebVitalsCallbacks),e&&t&&n&&r?(this.allowedMetrics.indexOf("LCP")>-1&&e(this._addToBuffer.bind(this)),this.allowedMetrics.indexOf("CLS")>-1&&t(this._addToBuffer.bind(this)),this.allowedMetrics.indexOf("FCP")>-1&&n(this._addToBuffer.bind(this)),this.allowedMetrics.indexOf("INP")>-1&&r(this._addToBuffer.bind(this)),this._initialized=!0):pp.error("web vitals callbacks not loaded - not starting")})),this.instance=e,this._enabledServerSide=!(null===(n=this.instance.persistence)||void 0===n||!n.props[ii]),this.startIfEnabled()}get allowedMetrics(){var e,t,n=gr(this.instance.config.capture_performance)?null===(e=this.instance.config.capture_performance)||void 0===e?void 0:e.web_vitals_allowed_metrics:void 0;return mr(n)?(null===(t=this.instance.persistence)||void 0===t?void 0:t.props[si])||["CLS","FCP","INP","LCP"]:n}get flushToCaptureTimeoutMs(){return(gr(this.instance.config.capture_performance)?this.instance.config.capture_performance.web_vitals_delayed_flush_ms:void 0)||5e3}get _maxAllowedValue(){var e=gr(this.instance.config.capture_performance)&&Sr(this.instance.config.capture_performance.__web_vitals_max_value)?this.instance.config.capture_performance.__web_vitals_max_value:vp;return 0<e&&e<=6e4?vp:e}get isEnabled(){var e=gr(this.instance.config.capture_performance)?this.instance.config.capture_performance.web_vitals:void 0;return Cr(e)?e:this._enabledServerSide}startIfEnabled(){this.isEnabled&&!this._initialized&&(pp.info("enabled, starting..."),this.loadScript(this._startCapturing))}onRemoteConfig(e){var t=gr(e.capturePerformance)&&!!e.capturePerformance.web_vitals,n=gr(e.capturePerformance)?e.capturePerformance.web_vitals_allowed_metrics:void 0;this.instance.persistence&&(this.instance.persistence.register({[ii]:t}),this.instance.persistence.register({[si]:n})),this._enabledServerSide=t,this.startIfEnabled()}loadScript(e){var t,n,r;null!==(t=er.__PosthogExtensions__)&&void 0!==t&&t.postHogWebVitalsCallbacks&&e(),null===(n=er.__PosthogExtensions__)||void 0===n||null===(r=n.loadExternalDependency)||void 0===r||r.call(n,this.instance,"web-vitals",(t=>{t?pp.error("failed to load script",t):e()}))}_currentURL(){var e=Wn?Wn.location.href:void 0;return e||pp.error("Could not determine current URL"),e}}var fp={icontains:(e,t)=>!!Wn&&t.href.toLowerCase().indexOf(e.toLowerCase())>-1,not_icontains:(e,t)=>!!Wn&&-1===t.href.toLowerCase().indexOf(e.toLowerCase()),regex:(e,t)=>!!Wn&&jr(t.href,e),not_regex:(e,t)=>!!Wn&&!jr(t.href,e),exact:(e,t)=>t.href===e,is_not:(e,t)=>t.href!==e};class mp{constructor(e){var t=this;i(this,"getWebExperimentsAndEvaluateDisplayLogic",(function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];t.getWebExperiments((e=>{mp.logInfo("retrieved web experiments from the server"),t._flagToExperiments=new Map,e.forEach((e=>{if(e.feature_flag_key){var n;if(t._flagToExperiments)mp.logInfo("setting flag key ",e.feature_flag_key," to web experiment ",e),null===(n=t._flagToExperiments)||void 0===n||n.set(e.feature_flag_key,e);var r=t.instance.getFeatureFlag(e.feature_flag_key);_r(r)&&e.variants[r]&&t.applyTransforms(e.name,r,e.variants[r].transforms)}else if(e.variants)for(var i in e.variants){var o=e.variants[i];mp.matchesTestVariant(o)&&t.applyTransforms(e.name,i,o.transforms)}}))}),e)})),this.instance=e,this.instance.onFeatureFlags((e=>{this.onFeatureFlags(e)}))}onFeatureFlags(e){if(this._is_bot())mp.logInfo("Refusing to render web experiment since the viewer is a likely bot");else if(!this.instance.config.disable_web_experiments){if(wr(this._flagToExperiments))return this._flagToExperiments=new Map,this.loadIfEnabled(),void this.previewWebExperiment();mp.logInfo("applying feature flags",e),e.forEach((e=>{var t;if(this._flagToExperiments&&null!==(t=this._flagToExperiments)&&void 0!==t&&t.has(e)){var n,r=this.instance.getFeatureFlag(e),i=null===(n=this._flagToExperiments)||void 0===n?void 0:n.get(e);r&&null!=i&&i.variants[r]&&this.applyTransforms(i.name,r,i.variants[r].transforms)}}))}}previewWebExperiment(){var e=mp.getWindowLocation();if(null!=e&&e.search){var t=Yr(null==e?void 0:e.search,"__experiment_id"),n=Yr(null==e?void 0:e.search,"__experiment_variant");t&&n&&(mp.logInfo("previewing web experiments ".concat(t," && ").concat(n)),this.getWebExperiments((e=>{this.showPreviewWebExperiment(parseInt(t),n,e)}),!1,!0))}}loadIfEnabled(){this.instance.config.disable_web_experiments||this.getWebExperimentsAndEvaluateDisplayLogic()}getWebExperiments(e,t,n){if(this.instance.config.disable_web_experiments&&!n)return e([]);var r=this.instance.get_property("$web_experiments");if(r&&!t)return e(r);this.instance._send_request({url:this.instance.requestRouter.endpointFor("api","/api/web_experiments/?token=".concat(this.instance.config.token)),method:"GET",callback:t=>{if(200!==t.statusCode||!t.json)return e([]);var n=t.json.experiments||[];return e(n)}})}showPreviewWebExperiment(e,t,n){var r=n.filter((t=>t.id===e));r&&r.length>0&&(mp.logInfo("Previewing web experiment [".concat(r[0].name,"] with variant [").concat(t,"]")),this.applyTransforms(r[0].name,t,r[0].variants[t].transforms))}static matchesTestVariant(e){return!wr(e.conditions)&&(mp.matchUrlConditions(e)&&mp.matchUTMConditions(e))}static matchUrlConditions(e){var t;if(wr(e.conditions)||wr(null===(t=e.conditions)||void 0===t?void 0:t.url))return!0;var n,r,i,o=mp.getWindowLocation();return!!o&&(null===(n=e.conditions)||void 0===n||!n.url||fp[null!==(r=null===(i=e.conditions)||void 0===i?void 0:i.urlMatchType)&&void 0!==r?r:"icontains"](e.conditions.url,o))}static getWindowLocation(){return null==Wn?void 0:Wn.location}static matchUTMConditions(e){var t;if(wr(e.conditions)||wr(null===(t=e.conditions)||void 0===t?void 0:t.utm))return!0;var n=cd.campaignParams();if(n.utm_source){var r,i,o,s,a,l,c,u,d,h,p,v,g,f,m,_,y=null===(r=e.conditions)||void 0===r||null===(i=r.utm)||void 0===i||!i.utm_campaign||(null===(o=e.conditions)||void 0===o||null===(s=o.utm)||void 0===s?void 0:s.utm_campaign)==n.utm_campaign,b=null===(a=e.conditions)||void 0===a||null===(l=a.utm)||void 0===l||!l.utm_source||(null===(c=e.conditions)||void 0===c||null===(u=c.utm)||void 0===u?void 0:u.utm_source)==n.utm_source,w=null===(d=e.conditions)||void 0===d||null===(h=d.utm)||void 0===h||!h.utm_medium||(null===(p=e.conditions)||void 0===p||null===(v=p.utm)||void 0===v?void 0:v.utm_medium)==n.utm_medium,S=null===(g=e.conditions)||void 0===g||null===(f=g.utm)||void 0===f||!f.utm_term||(null===(m=e.conditions)||void 0===m||null===(_=m.utm)||void 0===_?void 0:_.utm_term)==n.utm_term;return y&&w&&S&&b}return!1}static logInfo(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];Mr.info("[WebExperiments] ".concat(e),n)}applyTransforms(e,t,n){this._is_bot()?mp.logInfo("Refusing to render web experiment since the viewer is a likely bot"):"control"!==t?n.forEach((n=>{if(n.selector){var r;mp.logInfo("applying transform of variant ".concat(t," for experiment ").concat(e," "),n);var i=null===(r=document)||void 0===r?void 0:r.querySelectorAll(n.selector);null==i||i.forEach((e=>{var t=e;n.attributes&&n.attributes.forEach((e=>{switch(e.name){case"text":t.innerText=e.value;break;case"html":t.innerHTML=e.value;break;case"cssClass":t.className=e.value;break;default:t.setAttribute(e.name,e.value)}})),n.text&&(t.innerText=n.text),n.html&&(t.parentElement?t.parentElement.innerHTML=n.html:t.innerHTML=n.html),n.css&&t.setAttribute("style",n.css)}))}})):mp.logInfo("Control variants leave the page unmodified.")}_is_bot(){return jn&&this.instance?Kh(jn,this.instance.config.custom_blocked_useragents):void 0}}class _p{constructor(e){this.instance=e}sendExceptionEvent(e){this.instance.capture("$exception",e,{_noTruncate:!0,_batchKey:"exceptionEvent"})}}var yp=["$set_once","$set"],bp=Rr("[SiteApps]");class wp{constructor(e){this.instance=e,this.bufferedInvocations=[],this.apps={}}get isEnabled(){return!!this.instance.config.opt_in_site_apps}eventCollector(e,t){if(t){var n=this.globalsForEvent(t);this.bufferedInvocations.push(n),this.bufferedInvocations.length>1e3&&(this.bufferedInvocations=this.bufferedInvocations.slice(10))}}get siteAppLoaders(){var e,t;return null===(e=er._POSTHOG_REMOTE_CONFIG)||void 0===e||null===(t=e[this.instance.config.token])||void 0===t?void 0:t.siteApps}init(){if(this.isEnabled){var e=this.instance._addCaptureHook(this.eventCollector.bind(this));this.stopBuffering=()=>{e(),this.bufferedInvocations=[],this.stopBuffering=void 0}}}globalsForEvent(e){var n,r,i,s,a,l,c;if(!e)throw new Error("Event payload is required");var u={},d=this.instance.get_property("$groups")||[],h=this.instance.get_property("$stored_group_properties")||{};for(var[p,v]of Object.entries(h))u[p]={id:d[p],type:p,properties:v};var{$set_once:g,$set:f}=e;return{event:t(t({},o(e,yp)),{},{properties:t(t(t({},e.properties),f?{$set:t(t({},null!==(n=null===(r=e.properties)||void 0===r?void 0:r.$set)&&void 0!==n?n:{}),f)}:{}),g?{$set_once:t(t({},null!==(i=null===(s=e.properties)||void 0===s?void 0:s.$set_once)&&void 0!==i?i:{}),g)}:{}),elements_chain:null!==(a=null===(l=e.properties)||void 0===l?void 0:l.$elements_chain)&&void 0!==a?a:"",distinct_id:null===(c=e.properties)||void 0===c?void 0:c.distinct_id}),person:{properties:this.instance.get_property("$stored_person_properties")},groups:u}}setupSiteApp(e){var t={id:e.id,loaded:!1,errored:!1};this.apps[e.id]=t;var n=n=>{var r;for(var i of(this.apps[e.id].errored=!n,this.apps[e.id].loaded=!0,bp.info("Site app with id ".concat(e.id," ").concat(n?"loaded":"errored")),n&&this.bufferedInvocations.length&&(bp.info("Processing ".concat(this.bufferedInvocations.length," events for site app with id ").concat(e.id)),this.bufferedInvocations.forEach((e=>{var n;return null===(n=t.processEvent)||void 0===n?void 0:n.call(t,e)}))),Object.values(this.apps)))if(!i.loaded)return;null===(r=this.stopBuffering)||void 0===r||r.call(this)};try{var{processEvent:r}=e.init({posthog:this.instance,callback:e=>{n(e)}});r&&(t.processEvent=r)}catch(t){bp.error("Error while initializing PostHog app with config id ".concat(e.id),t),n(!1)}}onCapturedEvent(e){if(0!==Object.keys(this.apps).length){var t=this.globalsForEvent(e);for(var n of Object.values(this.apps))try{var r;null===(r=n.processEvent)||void 0===r||r.call(n,t)}catch(t){bp.error("Error while processing event ".concat(e.event," for site app ").concat(n.id),t)}}}onRemoteConfig(e){var t,n,r,i=this;if(null!==(t=this.siteAppLoaders)&&void 0!==t&&t.length){if(!this.isEnabled)return void bp.error('PostHog site apps are disabled. Enable the "opt_in_site_apps" config to proceed.');for(var o of this.siteAppLoaders)this.setupSiteApp(o);this.instance.on("eventCaptured",(e=>this.onCapturedEvent(e)))}else if(null===(n=this.stopBuffering)||void 0===n||n.call(this),null!==(r=e.siteApps)&&void 0!==r&&r.length)if(this.isEnabled){var s=function(e,t){var n,r;er["__$$ph_site_app_".concat(e)]=i.instance,null===(n=er.__PosthogExtensions__)||void 0===n||null===(r=n.loadSiteApp)||void 0===r||r.call(n,i.instance,t,(t=>{if(t)return bp.error("Error while initializing PostHog app with config id ".concat(e),t)}))};for(var{id:a,url:l}of e.siteApps)s(a,l)}else bp.error('PostHog site apps are disabled. Enable the "opt_in_site_apps" config to proceed.')}}function Sp(e,t,n){return Ch({distinct_id:e,userPropertiesToSet:t,userPropertiesToSetOnce:n})}var Cp={},Ip=()=>{},kp="posthog",Ep=!bh&&-1===(null==Qn?void 0:Qn.indexOf("MSIE"))&&-1===(null==Qn?void 0:Qn.indexOf("Mozilla")),xp=()=>{var e;return{api_host:"https://us.i.posthog.com",ui_host:null,token:"",autocapture:!0,rageclick:!0,cross_subdomain_cookie:Vr(null==zn?void 0:zn.location),persistence:"localStorage+cookie",persistence_name:"",loaded:Ip,save_campaign_params:!0,custom_campaign_params:[],custom_blocked_useragents:[],save_referrer:!0,capture_pageview:!0,capture_pageleave:"if_capture_pageview",debug:Yn&&_r(null==Yn?void 0:Yn.search)&&-1!==Yn.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_external_dependency_loading:!1,enable_recording_console_log:void 0,secure_cookie:"https:"===(null==Wn||null===(e=Wn.location)||void 0===e?void 0:e.protocol),ip:!0,opt_out_capturing_by_default:!1,opt_out_persistence_by_default:!1,opt_out_useragent_filter:!1,opt_out_capturing_persistence_type:"localStorage",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_decide:!1,advanced_disable_feature_flags:!1,advanced_disable_feature_flags_on_first_load:!1,advanced_disable_toolbar_metrics:!1,feature_flag_request_timeout_ms:3e3,on_request_error:e=>{var t="Bad HTTP status: "+e.statusCode+" "+e.text;Mr.error(t)},get_device_id:e=>e,capture_performance:void 0,name:"posthog",bootstrap:{},disable_compression:!1,session_idle_timeout_seconds:1800,person_profiles:"identified_only",before_send:void 0,_onCapture:Ip}},Tp=e=>{var t={};mr(e.process_person)||(t.person_profiles=e.process_person),mr(e.xhr_headers)||(t.request_headers=e.xhr_headers),mr(e.cookie_name)||(t.persistence_name=e.cookie_name),mr(e.disable_cookie)||(t.disable_persistence=e.disable_cookie),mr(e.store_google)||(t.save_campaign_params=e.store_google),mr(e.verbose)||(t.debug=e.verbose);var n=Or({},t,e);return dr(e.property_blacklist)&&(mr(e.property_denylist)?n.property_denylist=e.property_blacklist:dr(e.property_denylist)?n.property_denylist=[...e.property_blacklist,...e.property_denylist]:Mr.error("Invalid value for property_denylist config: "+e.property_denylist)),n};class Mp{constructor(){i(this,"__forceAllowLocalhost",!1)}get _forceAllowLocalhost(){return this.__forceAllowLocalhost}set _forceAllowLocalhost(e){Mr.error("WebPerformanceObserver is deprecated and has no impact on network capture. Use `_forceAllowLocalhostNetworkCapture` on `posthog.sessionRecording`"),this.__forceAllowLocalhost=e}}class Rp{get decideEndpointWasHit(){var e,t;return null!==(e=null===(t=this.featureFlags)||void 0===t?void 0:t.hasLoadedFlags)&&void 0!==e&&e}constructor(){i(this,"webPerformance",new Mp),i(this,"version",xr.LIB_VERSION),i(this,"_internalEventEmitter",new Hh),this.config=xp(),this.SentryIntegration=Ph,this.sentryIntegration=e=>function(e,t){var n=Oh(e,t);return{name:Fh,processEvent:e=>n(e)}}(this,e),this.__request_queue=[],this.__loaded=!1,this.analyticsDefaultEndpoint="/e/",this._initialPageviewCaptured=!1,this._initialPersonProfilesConfig=null,this._cachedIdentify=null,this.featureFlags=new Wc(this),this.toolbar=new mh(this),this.scrollManager=new sp(this),this.pageViewManager=new Bh(this),this.surveys=new Gh(this),this.experiments=new mp(this),this.exceptions=new _p(this),this.rateLimiter=new jh(this),this.requestRouter=new Nh(this),this.consent=new up(this),this.people={set:(e,t,n)=>{var r=_r(e)?{[e]:t}:e;this.setPersonProperties(r),null==n||n({})},set_once:(e,t,n)=>{var r=_r(e)?{[e]:t}:e;this.setPersonProperties(void 0,r),null==n||n({})}},this.on("eventCaptured",(e=>Mr.info('send "'.concat(null==e?void 0:e.event,'"'),e)))}init(e,t,n){if(n&&n!==kp){var r,i=null!==(r=Cp[n])&&void 0!==r?r:new Rp;return i._init(e,t,n),Cp[n]=i,Cp[kp][n]=i,i}return this._init(e,t,n)}_init(e){var n,r,i,o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},s=arguments.length>2?arguments[2]:void 0;if(mr(e)||yr(e))return Mr.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 Mr.warn("You have already initialized PostHog! Re-initializing is a no-op"),this;this.__loaded=!0,this.config={},this._triggered_notifs=[],o.person_profiles&&(this._initialPersonProfilesConfig=o.person_profiles),this.set_config(Or({},xp(),Tp(o),{name:s,token:e})),this.config.on_xhr_error&&Mr.error("on_xhr_error is deprecated. Use on_request_error instead"),this.compression=o.disable_compression?void 0:qn.GZipJS,this.persistence=new dd(this.config),this.sessionPersistence="sessionStorage"===this.config.persistence||"memory"===this.config.persistence?this.persistence:new dd(t(t({},this.config),{},{persistence:"sessionStorage"}));var a=t({},this.persistence.props),l=t({},this.sessionPersistence.props);if(this._requestQueue=new _h((e=>this._send_retriable_request(e))),this._retryQueue=new xh(this),this.__request_queue=[],this.config.__preview_experimental_cookieless_mode||(this.sessionManager=new Rh(this),this.sessionPropsManager=new Yh(this,this.sessionManager,this.persistence)),new lp(this).startIfEnabledOrStop(),this.siteApps=new wp(this),null===(n=this.siteApps)||void 0===n||n.init(),this.config.__preview_experimental_cookieless_mode||(this.sessionRecording=new uh(this),this.sessionRecording.startIfEnabledOrStop()),this.config.disable_scroll_properties||this.scrollManager.startMeasuringScrollPosition(),this.autocapture=new Nc(this),this.autocapture.startIfEnabled(),this.surveys.loadIfEnabled(),this.heatmaps=new op(this),this.heatmaps.startIfEnabled(),this.webVitalsAutocapture=new gp(this),this.exceptionObserver=new hp(this),this.exceptionObserver.startIfEnabled(),this.deadClicksAutocapture=new np(this,tp),this.deadClicksAutocapture.startIfEnabled(),xr.DEBUG=xr.DEBUG||this.config.debug,xr.DEBUG&&Mr.info("Starting in debug mode",{this:this,config:o,thisC:t({},this.config),p:a,s:l}),this._sync_opt_out_with_persistence(),void 0!==(null===(r=o.bootstrap)||void 0===r?void 0:r.distinctID)){var c,u,d=this.config.get_device_id(Yc()),h=null!==(c=o.bootstrap)&&void 0!==c&&c.isIdentifiedID?d:o.bootstrap.distinctID;this.persistence.set_property(ki,null!==(u=o.bootstrap)&&void 0!==u&&u.isIdentifiedID?"identified":"anonymous"),this.register({distinct_id:o.bootstrap.distinctID,$device_id:h})}if(this._hasBootstrappedFeatureFlags()){var p,v,g=Object.keys((null===(p=o.bootstrap)||void 0===p?void 0:p.featureFlags)||{}).filter((e=>{var t,n;return!(null===(t=o.bootstrap)||void 0===t||null===(n=t.featureFlags)||void 0===n||!n[e])})).reduce(((e,t)=>{var n,r;return e[t]=(null===(n=o.bootstrap)||void 0===n||null===(r=n.featureFlags)||void 0===r?void 0:r[t])||!1,e}),{}),f=Object.keys((null===(v=o.bootstrap)||void 0===v?void 0:v.featureFlagPayloads)||{}).filter((e=>g[e])).reduce(((e,t)=>{var n,r,i,s;null!==(n=o.bootstrap)&&void 0!==n&&null!==(r=n.featureFlagPayloads)&&void 0!==r&&r[t]&&(e[t]=null===(i=o.bootstrap)||void 0===i||null===(s=i.featureFlagPayloads)||void 0===s?void 0:s[t]);return e}),{});this.featureFlags.receivedFeatureFlags({featureFlags:g,featureFlagPayloads:f})}if(this.config.__preview_experimental_cookieless_mode)this.register_once({distinct_id:Fi,$device_id:null},"");else if(!this.get_distinct_id()){var m=this.config.get_device_id(Yc());this.register_once({distinct_id:m,$device_id:m},""),this.persistence.set_property(ki,"anonymous")}return null==Wn||null===(i=Wn.addEventListener)||void 0===i||i.call(Wn,"onpagehide"in self?"pagehide":"unload",this._handle_unload.bind(this)),this.toolbar.maybeLoadToolbar(),o.segment?Dh(this,(()=>this._loaded())):this._loaded(),hr(this.config._onCapture)&&this.config._onCapture!==Ip&&(Mr.warn("onCapture is deprecated. Please use `before_send` instead"),this.on("eventCaptured",(e=>this.config._onCapture(e.event,e)))),this}_onRemoteConfig(e){var t,n,r,i,o,s,a,l;if(!zn||!zn.body)return Mr.info("document not ready yet, trying again in 500 milliseconds..."),void setTimeout((()=>{this._onRemoteConfig(e)}),500);this.compression=void 0,e.supportedCompression&&!this.config.disable_compression&&(this.compression=ir(e.supportedCompression,qn.GZipJS)?qn.GZipJS:ir(e.supportedCompression,qn.Base64)?qn.Base64:void 0),null!==(t=e.analytics)&&void 0!==t&&t.endpoint&&(this.analyticsDefaultEndpoint=e.analytics.endpoint),this.set_config({person_profiles:this._initialPersonProfilesConfig?this._initialPersonProfilesConfig:"identified_only"}),null===(n=this.siteApps)||void 0===n||n.onRemoteConfig(e),null===(r=this.sessionRecording)||void 0===r||r.onRemoteConfig(e),null===(i=this.autocapture)||void 0===i||i.onRemoteConfig(e),null===(o=this.heatmaps)||void 0===o||o.onRemoteConfig(e),this.surveys.onRemoteConfig(e),null===(s=this.webVitalsAutocapture)||void 0===s||s.onRemoteConfig(e),null===(a=this.exceptionObserver)||void 0===a||a.onRemoteConfig(e),null===(l=this.deadClicksAutocapture)||void 0===l||l.onRemoteConfig(e)}_loaded(){try{this.config.loaded(this)}catch(e){Mr.critical("`loaded` function failed",e)}this._start_queue_if_opted_in(),this.config.capture_pageview&&setTimeout((()=>{this.consent.isOptedIn()&&this._captureInitialPageview()}),1),new hh(this).load(),this.featureFlags.decide()}_start_queue_if_opted_in(){var e;this.has_opted_out_capturing()||this.config.request_batching&&(null===(e=this._requestQueue)||void 0===e||e.enable())}_dom_loaded(){this.has_opted_out_capturing()||Nr(this.__request_queue,(e=>this._send_retriable_request(e))),this.__request_queue=[],this._start_queue_if_opted_in()}_handle_unload(){var e,t;this.config.request_batching?(this._shouldCapturePageleave()&&this.capture("$pageleave"),null===(e=this._requestQueue)||void 0===e||e.unload(),null===(t=this._retryQueue)||void 0===t||t.unload()):this._shouldCapturePageleave()&&this.capture("$pageleave",null,{transport:"sendBeacon"})}_send_request(e){this.__loaded&&(Ep?this.__request_queue.push(e):this.rateLimiter.isServerRateLimited(e.batchKey)||(e.transport=e.transport||this.config.api_transport,e.url=Sh(e.url,{ip:this.config.ip?1:0}),e.headers=t({},this.config.request_headers),e.compression="best-available"===e.compression?this.compression:e.compression,e.fetchOptions=e.fetchOptions||this.config.fetch_options,(e=>{var n,r,i,o=t({},e);o.timeout=o.timeout||6e4,o.url=Sh(o.url,{_:(new Date).getTime().toString(),ver:xr.LIB_VERSION,compression:o.compression});var s=null!==(n=o.transport)&&void 0!==n?n:"fetch",a=null!==(r=null===(i=Zr(kh,(e=>e.transport===s)))||void 0===i?void 0:i.method)&&void 0!==r?r:kh[0].method;if(!a)throw new Error("No available transport method");a(o)})(t(t({},e),{},{callback:t=>{var n,r,i;(this.rateLimiter.checkForLimiting(t),t.statusCode>=400)&&(null===(r=(i=this.config).on_request_error)||void 0===r||r.call(i,t));null===(n=e.callback)||void 0===n||n.call(e,t)}}))))}_send_retriable_request(e){this._retryQueue?this._retryQueue.retriableRequest(e):this._send_request(e)}_execute_array(e){var t,n=[],r=[],i=[];Nr(e,(e=>{e&&(t=e[0],dr(t)?i.push(e):hr(e)?e.call(this):dr(e)&&"alias"===t?n.push(e):dr(e)&&-1!==t.indexOf("capture")&&hr(this[t])?i.push(e):r.push(e))}));var o=function(e,t){Nr(e,(function(e){if(dr(e[0])){var n=t;Fr(e,(function(e){n=n[e[0]].apply(n,e.slice(1))}))}else this[e[0]].apply(this,e.slice(1))}),t)};o(n,this),o(r,this),o(i,this)}_hasBootstrappedFeatureFlags(){var e,t;return(null===(e=this.config.bootstrap)||void 0===e?void 0:e.featureFlags)&&Object.keys(null===(t=this.config.bootstrap)||void 0===t?void 0:t.featureFlags).length>0||!1}push(e){this._execute_array([e])}capture(e,n,r){var i;if(this.__loaded&&this.persistence&&this.sessionPersistence&&this._requestQueue){if(!this.consent.isOptedOut())if(!mr(e)&&_r(e)){if(this.config.opt_out_useragent_filter||!this._is_bot()){var o=null!=r&&r.skip_client_rate_limiting?void 0:this.rateLimiter.clientRateLimitContext();if(null==o||!o.isRateLimited){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==r?void 0:r.timestamp)||s,l=Yc(),c={uuid:l,event:e,properties:this._calculate_event_properties(e,n||{},a,l)};o&&(c.properties.$lib_rate_limit_remaining_tokens=o.remainingTokens),(null==r?void 0:r.$set)&&(c.$set=null==r?void 0:r.$set);var u=this._calculate_set_once_properties(null==r?void 0:r.$set_once);u&&(c.$set_once=u),(c=qr(c,null!=r&&r._noTruncate?null:this.config.properties_string_max_length)).timestamp=a,mr(null==r?void 0:r.timestamp)||(c.properties.$event_time_override_provided=!0,c.properties.$event_time_override_system_time=s);var d=t(t({},c.properties.$set),c.$set);if(fr(d)||this.setPersonPropertiesForFlags(d),!wr(this.config.before_send)){var h=this._runBeforeSend(c);if(!h)return;c=h}this._internalEventEmitter.emit("eventCaptured",c);var p={method:"POST",url:null!==(i=null==r?void 0:r._url)&&void 0!==i?i:this.requestRouter.endpointFor("api",this.analyticsDefaultEndpoint),data:c,compression:"best-available",batchKey:null==r?void 0:r._batchKey};return!this.config.request_batching||r&&(null==r||!r._batchKey)||null!=r&&r.send_instantly?this._send_retriable_request(p):this._requestQueue.enqueue(p),c}Mr.critical("This capture call is ignored due to client rate limiting.")}}else Mr.error("No event name provided to posthog.capture")}else Mr.uninitializedWarning("posthog.capture")}_addCaptureHook(e){return this.on("eventCaptured",(t=>e(t.event,t)))}_calculate_event_properties(e,n,r,i){if(r=r||new Date,!this.persistence||!this.sessionPersistence)return n;var o=this.persistence.remove_event_timer(e),s=t({},n);if(s.token=this.config.token,this.config.__preview_experimental_cookieless_mode&&(s.$cookieless_mode=!0),"$snapshot"===e){var a=t(t({},this.persistence.properties()),this.sessionPersistence.properties());return s.distinct_id=a.distinct_id,(!_r(s.distinct_id)&&!Sr(s.distinct_id)||yr(s.distinct_id))&&Mr.error("Invalid distinct_id for replay event. This indicates a bug in your implementation"),s}var l,c=cd.properties({maskPersonalDataProperties:this.config.mask_personal_data_properties,customPersonalDataProperties:this.config.custom_personal_data_properties});if(this.sessionManager){var{sessionId:u,windowId:d}=this.sessionManager.checkAndGetSessionAndWindowId();s.$session_id=u,s.$window_id=d}if(this.sessionRecording&&(s.$recording_status=this.sessionRecording.status),this.requestRouter.region===Th.CUSTOM&&(s.$lib_custom_api_host=this.config.api_host),l="$pageview"===e?this.pageViewManager.doPageView(r,i):"$pageleave"===e?this.pageViewManager.doPageLeave(r):this.pageViewManager.doEvent(),s=Or(s,l),"$pageview"===e&&zn&&(s.title=zn.title),!mr(o)){var h=r.getTime()-o;s.$duration=parseFloat((h/1e3).toFixed(3))}Qn&&this.config.opt_out_useragent_filter&&(s.$browser_type=this._is_bot()?"bot":"browser"),(s=Or({},c,this.persistence.properties(),this.sessionPersistence.properties(),s)).$is_identified=this._isIdentified(),dr(this.config.property_denylist)?Fr(this.config.property_denylist,(function(e){delete s[e]})):Mr.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&&(Mr.error("sanitize_properties is deprecated. Use before_send instead"),s=p(s,e));var v=this._hasPersonProcessing();return s.$process_person_profile=v,v&&this._requirePersonProcessing("_calculate_event_properties"),s}_calculate_set_once_properties(e){if(!this.persistence||!this._hasPersonProcessing())return e;var t=Or({},this.persistence.get_initial_props(),e||{}),n=this.config.sanitize_properties;return n&&(Mr.error("sanitize_properties is deprecated. Use before_send instead"),t=n(t,"$set_once")),fr(t)?void 0:t}register(e,t){var n;null===(n=this.persistence)||void 0===n||n.register(e,t)}register_once(e,t,n){var r;null===(r=this.persistence)||void 0===r||r.register_once(e,t,n)}register_for_session(e){var t;null===(t=this.sessionPersistence)||void 0===t||t.register(e)}unregister(e){var t;null===(t=this.persistence)||void 0===t||t.unregister(e)}unregister_for_session(e){var t;null===(t=this.sessionPersistence)||void 0===t||t.unregister(e)}_register_single(e,t){this.register({[e]:t})}getFeatureFlag(e,t){return this.featureFlags.getFeatureFlag(e,t)}getFeatureFlagPayload(e){var t=this.featureFlags.getFeatureFlagPayload(e);try{return JSON.parse(t)}catch(e){return t}}isFeatureEnabled(e,t){return this.featureFlags.isFeatureEnabled(e,t)}reloadFeatureFlags(){this.featureFlags.reloadFeatureFlags()}updateEarlyAccessFeatureEnrollment(e,t){this.featureFlags.updateEarlyAccessFeatureEnrollment(e,t)}getEarlyAccessFeatures(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return this.featureFlags.getEarlyAccessFeatures(e,t)}on(e,t){return this._internalEventEmitter.on(e,t)}onFeatureFlags(e){return this.featureFlags.onFeatureFlags(e)}onSessionId(e){var t,n;return null!==(t=null===(n=this.sessionManager)||void 0===n?void 0:n.onSessionId(e))&&void 0!==t?t:()=>{}}getSurveys(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];this.surveys.getSurveys(e,t)}getActiveMatchingSurveys(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];this.surveys.getActiveMatchingSurveys(e,t)}renderSurvey(e,t){this.surveys.renderSurvey(e,t)}canRenderSurvey(e){this.surveys.canRenderSurvey(e)}getNextSurveyStep(e,t,n){return this.surveys.getNextSurveyStep(e,t,n)}identify(e,t,n){if(!this.__loaded||!this.persistence)return Mr.uninitializedWarning("posthog.identify");if(Sr(e)&&(e=e.toString(),Mr.warn("The first argument to posthog.identify was a number, but it should be a string. It has been converted to a string.")),e){if(["distinct_id","distinctid"].includes(e.toLowerCase()))Mr.critical('The string "'.concat(e,'" was set in posthog.identify which indicates an error. This ID should be unique to the user and not a hardcoded string.'));else if(this._requirePersonProcessing("posthog.identify")){var r=this.get_distinct_id();if(this.register({$user_id:e}),!this.get_property("$device_id")){var i=r;this.register_once({$had_persisted_distinct_id:!0,$device_id:i},"")}e!==r&&e!==this.get_property(Qr)&&(this.unregister(Qr),this.register({distinct_id:e}));var o="anonymous"===(this.persistence.get_property(ki)||"anonymous");e!==r&&o?(this.persistence.set_property(ki,"identified"),this.setPersonPropertiesForFlags(t||{},!1),this.capture("$identify",{distinct_id:e,$anon_distinct_id:r},{$set:t||{},$set_once:n||{}}),this.featureFlags.setAnonymousDistinctId(r),this._cachedIdentify=Sp(e,t,n)):(t||n)&&(this._cachedIdentify!==Sp(e,t,n)?(this.setPersonProperties(t,n),this._cachedIdentify=Sp(e,t,n)):Mr.info("A duplicate posthog.identify call was made with the same properties. It has been ignored.")),e!==r&&(this.reloadFeatureFlags(),this.unregister(Ii))}}else Mr.error("Unique user id has not been set in posthog.identify")}setPersonProperties(e,t){(e||t)&&this._requirePersonProcessing("posthog.setPersonProperties")&&(this.setPersonPropertiesForFlags(e||{}),this.capture("$set",{$set:e||{},$set_once:t||{}}))}group(e,n,r){if(e&&n){if(this._requirePersonProcessing("posthog.group")){var i=this.getGroups();i[e]!==n&&this.resetGroupPropertiesForFlags(e),this.register({$groups:t(t({},i),{},{[e]:n})}),r&&(this.capture("$groupidentify",{$group_type:e,$group_key:n,$group_set:r}),this.setGroupPropertiesForFlags({[e]:r})),i[e]===n||r||this.reloadFeatureFlags()}}else Mr.error("posthog.group requires a group type and group key")}resetGroups(){this.register({$groups:{}}),this.resetGroupPropertiesForFlags(),this.reloadFeatureFlags()}setPersonPropertiesForFlags(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];this.featureFlags.setPersonPropertiesForFlags(e,t)}resetPersonPropertiesForFlags(){this.featureFlags.resetPersonPropertiesForFlags()}setGroupPropertiesForFlags(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];this._requirePersonProcessing("posthog.setGroupPropertiesForFlags")&&this.featureFlags.setGroupPropertiesForFlags(e,t)}resetGroupPropertiesForFlags(e){this.featureFlags.resetGroupPropertiesForFlags(e)}reset(e){var t,n,r,i;if(Mr.info("reset"),!this.__loaded)return Mr.uninitializedWarning("posthog.reset");var o=this.get_property("$device_id");if(this.consent.reset(),null===(t=this.persistence)||void 0===t||t.clear(),null===(n=this.sessionPersistence)||void 0===n||n.clear(),this.surveys.reset(),null===(r=this.persistence)||void 0===r||r.set_property(ki,"anonymous"),null===(i=this.sessionManager)||void 0===i||i.resetSessionId(),this._cachedIdentify=null,this.config.__preview_experimental_cookieless_mode)this.register_once({distinct_id:Fi,$device_id:null},"");else{var s=this.config.get_device_id(Yc());this.register_once({distinct_id:s,$device_id:e?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 e,t;return null!==(e=null===(t=this.sessionManager)||void 0===t?void 0:t.checkAndGetSessionAndWindowId(!0).sessionId)&&void 0!==e?e:""}get_session_replay_url(e){if(!this.sessionManager)return"";var{sessionId:t,sessionStartTimestamp:n}=this.sessionManager.checkAndGetSessionAndWindowId(!0),r=this.requestRouter.endpointFor("ui","/project/".concat(this.config.token,"/replay/").concat(t));if(null!=e&&e.withTimestamp&&n){var i,o=null!==(i=e.timestampLookBack)&&void 0!==i?i:10;if(!n)return r;var s=Math.max(Math.floor(((new Date).getTime()-n)/1e3)-o,0);r+="?t=".concat(s)}return r}alias(e,t){return e===this.get_property(Kr)?(Mr.critical("Attempting to create alias for existing People user - aborting."),-2):this._requirePersonProcessing("posthog.alias")?(mr(t)&&(t=this.get_distinct_id()),e!==t?(this._register_single(Qr,e),this.capture("$create_alias",{alias:e,distinct_id:t})):(Mr.warn("alias matches current distinct_id - skipping api call."),this.identify(e),-1)):void 0}set_config(e){var n,r,i,o,s=t({},this.config);gr(e)&&(Or(this.config,Tp(e)),null===(n=this.persistence)||void 0===n||n.update_config(this.config,s),this.sessionPersistence="sessionStorage"===this.config.persistence||"memory"===this.config.persistence?this.persistence:new dd(t(t({},this.config),{},{persistence:"sessionStorage"})),ru.is_supported()&&"true"===ru.get("ph_debug")&&(this.config.debug=!0),this.config.debug&&(xr.DEBUG=!0,Mr.info("set_config",{config:e,oldConfig:s,newConfig:t({},this.config)})),null===(r=this.sessionRecording)||void 0===r||r.startIfEnabledOrStop(),null===(i=this.autocapture)||void 0===i||i.startIfEnabled(),null===(o=this.heatmaps)||void 0===o||o.startIfEnabled(),this.surveys.loadIfEnabled(),this._sync_opt_out_with_persistence())}startSessionRecording(e){var t=!0===e,n={sampling:t||!(null==e||!e.sampling),linked_flag:t||!(null==e||!e.linked_flag),url_trigger:t||!(null==e||!e.url_trigger),event_trigger:t||!(null==e||!e.event_trigger)};if(Object.values(n).some(Boolean)){var r,i,o,s,a;if(null===(r=this.sessionManager)||void 0===r||r.checkAndGetSessionAndWindowId(),n.sampling)null===(i=this.sessionRecording)||void 0===i||i.overrideSampling();if(n.linked_flag)null===(o=this.sessionRecording)||void 0===o||o.overrideLinkedFlag();if(n.url_trigger)null===(s=this.sessionRecording)||void 0===s||s.overrideTrigger("url");if(n.event_trigger)null===(a=this.sessionRecording)||void 0===a||a.overrideTrigger("event")}this.set_config({disable_session_recording:!1})}stopSessionRecording(){this.set_config({disable_session_recording:!0})}sessionRecordingStarted(){var e;return!(null===(e=this.sessionRecording)||void 0===e||!e.started)}captureException(e,n){var r,i=new Error("PostHog syntheticException"),o=hr(null===(r=er.__PosthogExtensions__)||void 0===r?void 0:r.parseErrorAsProperties)?t(t({},er.__PosthogExtensions__.parseErrorAsProperties([e.message,void 0,void 0,void 0,e],{syntheticException:i})),n):t({$exception_level:"error",$exception_list:[{type:e.name,value:e.message,mechanism:{handled:!0,synthetic:!1}}]},n);this.exceptions.sendExceptionEvent(o)}loadToolbar(e){return this.toolbar.loadToolbar(e)}get_property(e){var t;return null===(t=this.persistence)||void 0===t?void 0:t.props[e]}getSessionProperty(e){var t;return null===(t=this.sessionPersistence)||void 0===t?void 0:t.props[e]}toString(){var e,t=null!==(e=this.config.name)&&void 0!==e?e:kp;return t!==kp&&(t=kp+"."+t),t}_isIdentified(){var e,t;return"identified"===(null===(e=this.persistence)||void 0===e?void 0:e.get_property(ki))||"identified"===(null===(t=this.sessionPersistence)||void 0===t?void 0:t.get_property(ki))}_hasPersonProcessing(){var e,t,n,r;return!("never"===this.config.person_profiles||"identified_only"===this.config.person_profiles&&!this._isIdentified()&&fr(this.getGroups())&&(null===(e=this.persistence)||void 0===e||null===(t=e.props)||void 0===t||!t[Qr])&&(null===(n=this.persistence)||void 0===n||null===(r=n.props)||void 0===r||!r[Ai]))}_shouldCapturePageleave(){return!0===this.config.capture_pageleave||"if_capture_pageview"===this.config.capture_pageleave&&this.config.capture_pageview}createPersonProfile(){this._hasPersonProcessing()||this._requirePersonProcessing("posthog.createPersonProfile")&&this.setPersonProperties({},{})}_requirePersonProcessing(e){return"never"===this.config.person_profiles?(Mr.error(e+' was called, but process_person is set to "never". This call will be ignored.'),!1):(this._register_single(Ai,!0),!0)}_sync_opt_out_with_persistence(){var e,t,n,r,i=this.consent.isOptedOut(),o=this.config.opt_out_persistence_by_default,s=this.config.disable_persistence||i&&!!o;(null===(e=this.persistence)||void 0===e?void 0:e.disabled)!==s&&(null===(n=this.persistence)||void 0===n||n.set_disabled(s));(null===(t=this.sessionPersistence)||void 0===t?void 0:t.disabled)!==s&&(null===(r=this.sessionPersistence)||void 0===r||r.set_disabled(s))}opt_in_capturing(e){var t;(this.consent.optInOut(!0),this._sync_opt_out_with_persistence(),mr(null==e?void 0:e.captureEventName)||null!=e&&e.captureEventName)&&this.capture(null!==(t=null==e?void 0:e.captureEventName)&&void 0!==t?t:"$opt_in",null==e?void 0:e.captureProperties,{send_instantly:!0});this.config.capture_pageview&&this._captureInitialPageview()}opt_out_capturing(){this.consent.optInOut(!1),this._sync_opt_out_with_persistence()}has_opted_in_capturing(){return this.consent.isOptedIn()}has_opted_out_capturing(){return this.consent.isOptedOut()}clear_opt_in_out_capturing(){this.consent.reset(),this._sync_opt_out_with_persistence()}_is_bot(){return jn?Kh(jn,this.config.custom_blocked_useragents):void 0}_captureInitialPageview(){zn&&!this._initialPageviewCaptured&&(this._initialPageviewCaptured=!0,this.capture("$pageview",{title:zn.title},{send_instantly:!0}))}debug(e){!1===e?(null==Wn||Wn.console.log("You've disabled debug mode."),localStorage&&localStorage.removeItem("ph_debug"),this.set_config({debug:!1})):(null==Wn||Wn.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}))}_runBeforeSend(e){if(wr(this.config.before_send))return e;var t=dr(this.config.before_send)?this.config.before_send:[this.config.before_send],n=e;for(var r of t){if(n=r(n),wr(n)){var i="Event '".concat(e.event,"' was rejected in beforeSend function");return Er(e.event)?Mr.warn("".concat(i,". This can cause unexpected behavior.")):Mr.info(i),null}n.properties&&!fr(n.properties)||Mr.warn("Event '".concat(e.event,"' has no properties after beforeSend function, this is likely an error."))}return n}getPageViewId(){var e;return null===(e=this.pageViewManager._currentPageview)||void 0===e?void 0:e.pageViewId}}!function(e,t){for(var n=0;n<t.length;n++)e.prototype[t[n]]=Br(e.prototype[t[n]])}(Rp,["identify"]);var Ap,Np;Ap=Cp[kp]=new Rp,(Np=er.posthog)&&Fr(Np._i,(function(e){if(e&&dr(e)){var t=Ap.init(e[0],e[1],e[2]),n=Np[e[2]]||Np;t&&(t._execute_array.call(t.people,n.people),t._execute_array(n))}})),er.posthog=Ap,function(){function e(){e.done||(e.done=!0,Ep=!1,Fr(Cp,(function(e){e._dom_loaded()})))}null!=zn&&zn.addEventListener&&("complete"===zn.readyState?e():zn.addEventListener("DOMContentLoaded",e,!1)),Wn&&$r(Wn,"load",e,!0)}()}();
|
|
1
|
+
!function(){"use strict";function e(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function t(t){for(var n=1;n<arguments.length;n++){var r=null!=arguments[n]?arguments[n]:{};n%2?e(Object(r),!0).forEach((function(e){i(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):e(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function n(e,t,n,r,i,o,s){try{var a=e[o](s),l=a.value}catch(e){return void n(e)}a.done?t(l):Promise.resolve(l).then(r,i)}function r(e){return function(){var t=this,r=arguments;return new Promise((function(i,o){var s=e.apply(t,r);function a(e){n(s,i,o,a,l,"next",e)}function l(e){n(s,i,o,a,l,"throw",e)}a(void 0)}))}}function i(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function o(e,t){if(null==e)return{};var n,r,i=function(e,t){if(null==e)return{};var n,r,i={},o=Object.keys(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||(i[n]=e[n]);return i}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}var s,a=["type"],l=Object.defineProperty,c=(e,t,n)=>((e,t,n)=>t in e?l(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n)(e,"symbol"!=typeof t?t+"":t,n),u=Object.defineProperty,d=(e,t,n)=>((e,t,n)=>t in e?u(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n)(e,"symbol"!=typeof t?t+"":t,n),h=(e=>(e[e.Document=0]="Document",e[e.DocumentType=1]="DocumentType",e[e.Element=2]="Element",e[e.Text=3]="Text",e[e.CDATA=4]="CDATA",e[e.Comment=5]="Comment",e))(h||{}),p={Node:["childNodes","parentNode","parentElement","textContent"],ShadowRoot:["host","styleSheets"],Element:["shadowRoot","querySelector","querySelectorAll"],MutationObserver:[]},v={Node:["contains","getRootNode"],ShadowRoot:["getSelection"],Element:[],MutationObserver:["constructor"]};var g={};function f(e){if(g[e])return g[e];var t=function(e){var t,n,r=null===globalThis||void 0===globalThis||null===(t=globalThis.Zone)||void 0===t||null===(n=t.__symbol__)||void 0===n?void 0:n.call(t,e);return r&&globalThis[r]?globalThis[r]:void 0}(e)||globalThis[e],n=t.prototype,r=e in p?p[e]:void 0,i=Boolean(r&&r.every((e=>{var t,r;return Boolean(null==(r=null==(t=Object.getOwnPropertyDescriptor(n,e))?void 0:t.get)?void 0:r.toString().includes("[native code]"))}))),o=e in v?v[e]:void 0,s=Boolean(o&&o.every((e=>{var t;return"function"==typeof n[e]&&(null==(t=n[e])?void 0:t.toString().includes("[native code]"))})));if(i&&s)return g[e]=t.prototype,t.prototype;try{var a=document.createElement("iframe");document.body.appendChild(a);var l=a.contentWindow;if(!l)return t.prototype;var c=l[e].prototype;return document.body.removeChild(a),c?g[e]=c:t.prototype}catch(e){return t.prototype}}var m={};function _(e,t,n){var r,i="".concat(e,".").concat(String(n));if(m[i])return m[i].call(t);var o=f(e),s=null==(r=Object.getOwnPropertyDescriptor(o,n))?void 0:r.get;return s?(m[i]=s,s.call(t)):t[n]}var y={};function b(e,t,n){var r="".concat(e,".").concat(String(n));if(y[r])return y[r].bind(t);var i=f(e)[n];return"function"!=typeof i?t[n]:(y[r]=i,i.bind(t))}var w={childNodes:function(e){return _("Node",e,"childNodes")},parentNode:function(e){return _("Node",e,"parentNode")},parentElement:function(e){return _("Node",e,"parentElement")},textContent:function(e){return _("Node",e,"textContent")},contains:function(e,t){return b("Node",e,"contains")(t)},getRootNode:function(e){return b("Node",e,"getRootNode")()},host:function(e){return e&&"host"in e?_("ShadowRoot",e,"host"):null},styleSheets:function(e){return e.styleSheets},shadowRoot:function(e){return e&&"shadowRoot"in e?_("Element",e,"shadowRoot"):null},querySelector:function(e,t){return _("Element",e,"querySelector")(t)},querySelectorAll:function(e,t){return _("Element",e,"querySelectorAll")(t)},mutationObserver:function(){return f("MutationObserver").constructor}};function S(e){return e.nodeType===e.ELEMENT_NODE}function C(e){var t=e&&"host"in e&&"mode"in e&&w.host(e)||null;return Boolean(t&&"shadowRoot"in t&&w.shadowRoot(t)===e)}function I(e){return"[object ShadowRoot]"===Object.prototype.toString.call(e)}function k(e){try{var t=e.rules||e.cssRules;if(!t)return null;var n=Array.from(t,(t=>E(t,e.href))).join("");return(r=n).includes(" background-clip: text;")&&!r.includes(" -webkit-background-clip: text;")&&(r=r.replace(/\sbackground-clip:\s*text;/g," -webkit-background-clip: text; background-clip: text;")),r}catch(e){return null}var r}function E(e,t){if(function(e){return"styleSheet"in e}(e)){var n;try{n=k(e.styleSheet)||function(e){var{cssText:t}=e;if(t.split('"').length<3)return t;var n=["@import","url(".concat(JSON.stringify(e.href),")")];return""===e.layerName?n.push("layer"):e.layerName&&n.push("layer(".concat(e.layerName,")")),e.supportsText&&n.push("supports(".concat(e.supportsText,")")),e.media.length&&n.push(e.media.mediaText),n.join(" ")+";"}(e)}catch(t){n=e.cssText}return e.styleSheet.href?B(n,e.styleSheet.href):n}var r,i=e.cssText;return function(e){return"selectorText"in e}(e)&&e.selectorText.includes(":")&&(r=/(\[(?:[\w-]+)[^\\])(:(?:[\w-]+)\])/gm,i=i.replace(r,"$1\\$2")),t?B(i,t):i}function x(e,t){return Array.from(e.styleSheets).find((e=>e.href===t))}let T=class{constructor(){d(this,"idNodeMap",new Map),d(this,"nodeMetaMap",new WeakMap)}getId(e){var t;if(!e)return-1;var n=null==(t=this.getMeta(e))?void 0:t.id;return null!=n?n:-1}getNode(e){return this.idNodeMap.get(e)||null}getIds(){return Array.from(this.idNodeMap.keys())}getMeta(e){return this.nodeMetaMap.get(e)||null}removeNodeFromMap(e){var t=this.getId(e);this.idNodeMap.delete(t),e.childNodes&&e.childNodes.forEach((e=>this.removeNodeFromMap(e)))}has(e){return this.idNodeMap.has(e)}hasNode(e){return this.nodeMetaMap.has(e)}add(e,t){var n=t.id;this.idNodeMap.set(n,e),this.nodeMetaMap.set(e,t)}replace(e,t){var n=this.getNode(e);if(n){var r=this.nodeMetaMap.get(n);r&&this.nodeMetaMap.set(t,r)}this.idNodeMap.set(e,t)}reset(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap}};function M(e){var{element:t,maskInputOptions:n,tagName:r,type:i,value:o,maskInputFn:s}=e,a=o||"",l=i&&R(i);return(n[r.toLowerCase()]||l&&n[l])&&(a=s?s(a,t):"*".repeat(a.length)),a}function R(e){return e.toLowerCase()}var A="__rrweb_original__";function N(e){var t=e.type;return e.hasAttribute("data-rr-is-password")?"password":t?R(t):null}function F(e,t){var n,r;try{r=new URL(e,null!=t?t:window.location.href)}catch(e){return null}var i=r.pathname.match(/\.([0-9a-z]+)(?:$)/i);return null!==(n=null==i?void 0:i[1])&&void 0!==n?n:null}var O=/url\((?:(')([^']*)'|(")(.*?)"|([^)]*))\)/gm,P=/^(?:[a-z+]+:)?\/\//i,L=/^www\..*/i,D=/^(data:)([^,]*),(.*)/i;function B(e,t){return(e||"").replace(O,((e,n,r,i,o,s)=>{var a,l=r||o||s,c=n||i||"";if(!l)return e;if(P.test(l)||L.test(l))return"url(".concat(c).concat(l).concat(c,")");if(D.test(l))return"url(".concat(c).concat(l).concat(c,")");if("/"===l[0])return"url(".concat(c).concat((a=t,(a.indexOf("//")>-1?a.split("/").slice(0,3).join("/"):a.split("/")[0]).split("?")[0]+l)).concat(c,")");var u=t.split("/"),d=l.split("/");for(var h of(u.pop(),d))"."!==h&&(".."===h?u.pop():u.push(h));return"url(".concat(c).concat(u.join("/")).concat(c,")")}))}var H,q,$=1,W=new RegExp("[^a-z0-9-_:]"),V=-2;function Z(){return $++}var G=/^[^ \t\n\r\u000c]+/,U=/^[, \t\n\r\u000c]+/;var j=new WeakMap;function z(e,t){return t&&""!==t.trim()?X(e,t):t}function Y(e){return Boolean("svg"===e.tagName||e.ownerSVGElement)}function X(e,t){var n=j.get(e);if(n||(n=e.createElement("a"),j.set(e,n)),t){if(t.startsWith("blob:")||t.startsWith("data:"))return t}else t="";return n.setAttribute("href",t),n.href}function J(e,t,n,r){return r?"src"===n||"href"===n&&("use"!==t||"#"!==r[0])||"xlink:href"===n&&"#"!==r[0]?z(e,r):"background"!==n||"table"!==t&&"td"!==t&&"th"!==t?"srcset"===n?function(e,t){if(""===t.trim())return t;var n=0;function r(e){var r,i=e.exec(t.substring(n));return i?(r=i[0],n+=r.length,r):""}for(var i=[];r(U),!(n>=t.length);){var o=r(G);if(","===o.slice(-1))o=z(e,o.substring(0,o.length-1)),i.push(o);else{var s="";o=z(e,o);for(var a=!1;;){var l=t.charAt(n);if(""===l){i.push((o+s).trim());break}if(a)")"===l&&(a=!1);else{if(","===l){n+=1,i.push((o+s).trim());break}"("===l&&(a=!0)}s+=l,n+=1}}}return i.join(", ")}(e,r):"style"===n?B(r,X(e)):"object"===t&&"data"===n?z(e,r):r:z(e,r):r}function K(e,t,n){return("video"===e||"audio"===e)&&"autoplay"===t}function Q(e,t,n){if(!e)return!1;if(e.nodeType!==e.ELEMENT_NODE)return!!n&&Q(w.parentNode(e),t,n);for(var r=e.classList.length;r--;){var i=e.classList[r];if(t.test(i))return!0}return!!n&&Q(w.parentNode(e),t,n)}function ee(e,t,n,r){var i;if(S(e)){if(i=e,!w.childNodes(i).length)return!1}else{if(null===w.parentElement(e))return!1;i=w.parentElement(e)}try{if("string"==typeof t){if(r){if(i.closest(".".concat(t)))return!0}else if(i.classList.contains(t))return!0}else if(Q(i,t,r))return!0;if(n)if(r){if(i.closest(n))return!0}else if(i.matches(n))return!0}catch(e){}return!1}function te(e,t){var{doc:n,mirror:r,blockClass:i,blockSelector:o,needsMask:s,inlineStylesheet:a,maskInputOptions:l={},maskTextFn:c,maskInputFn:u,dataURLOptions:d={},inlineImages:p,recordCanvas:v,keepIframeSrcFn:g,newlyAddedElement:f=!1}=t,m=function(e,t){if(!t.hasNode(e))return;var n=t.getId(e);return 1===n?void 0:n}(n,r);switch(e.nodeType){case e.DOCUMENT_NODE:return"CSS1Compat"!==e.compatMode?{type:h.Document,childNodes:[],compatMode:e.compatMode}:{type:h.Document,childNodes:[]};case e.DOCUMENT_TYPE_NODE:return{type:h.DocumentType,name:e.name,publicId:e.publicId,systemId:e.systemId,rootId:m};case e.ELEMENT_NODE:return function(e,t){for(var n,{doc:r,blockClass:i,blockSelector:o,inlineStylesheet:s,maskInputOptions:a={},maskInputFn:l,dataURLOptions:c={},inlineImages:u,recordCanvas:d,keepIframeSrcFn:p,newlyAddedElement:v=!1,rootId:g}=t,f=function(e,t,n){try{if("string"==typeof t){if(e.classList.contains(t))return!0}else for(var r=e.classList.length;r--;){var i=e.classList[r];if(t.test(i))return!0}if(n)return e.matches(n)}catch(e){}return!1}(e,i,o),m=function(e){if(e instanceof HTMLFormElement)return"form";var t=R(e.tagName);return W.test(t)?"div":t}(e),_={},y=e.attributes.length,b=0;b<y;b++){var S=e.attributes[b];K(m,S.name,S.value)||(_[S.name]=J(r,m,R(S.name),S.value))}if("link"===m&&s){var C=function(e){return null==e?void 0:e.href}(e);if(C){var I=x(r,C);if(!I&&C.includes(".css"))I=x(r,window.location.origin+"/"+C.replace(window.location.href,""));var E=null;I&&(E=k(I)),E&&(delete _.rel,delete _.href,_._cssText=E)}}if("style"===m&&e.sheet&&!(e.innerText||w.textContent(e)||"").trim().length){var T=k(e.sheet);T&&(_._cssText=T)}if("input"===m||"textarea"===m||"select"===m){var F=e.value,O=e.checked;"radio"!==_.type&&"checkbox"!==_.type&&"submit"!==_.type&&"button"!==_.type&&F?_.value=M({element:e,type:N(e),tagName:m,value:F,maskInputOptions:a,maskInputFn:l}):O&&(_.checked=O)}"option"===m&&(e.selected&&!a.select?_.selected=!0:delete _.selected);if("dialog"===m&&e.open)try{_.rr_open_mode=e.matches("dialog:modal")?"modal":"non-modal"}catch(e){_.rr_open_mode="modal",_.ph_rr_could_not_detect_modal=!0}if("canvas"===m&&d)if("2d"===e.__context)(function(e){var t=e.getContext("2d");if(!t)return!0;for(var n=0;n<e.width;n+=50)for(var r=0;r<e.height;r+=50){var i=t.getImageData,o=A in i?i[A]:i;if(new Uint32Array(o.call(t,n,r,Math.min(50,e.width-n),Math.min(50,e.height-r)).data.buffer).some((e=>0!==e)))return!1}return!0})(e)||(_.rr_dataURL=e.toDataURL(c.type,c.quality));else if(!("__context"in e)){var P=e.toDataURL(c.type,c.quality),L=r.createElement("canvas");L.width=e.width,L.height=e.height,P!==L.toDataURL(c.type,c.quality)&&(_.rr_dataURL=P)}if("img"===m&&u){H||(H=r.createElement("canvas"),q=H.getContext("2d"));var D=e,B=D.currentSrc||D.getAttribute("src")||"<unknown-src>",$=D.crossOrigin,V=()=>{D.removeEventListener("load",V);try{H.width=D.naturalWidth,H.height=D.naturalHeight,q.drawImage(D,0,0),_.rr_dataURL=H.toDataURL(c.type,c.quality)}catch(e){if("anonymous"!==D.crossOrigin)return D.crossOrigin="anonymous",void(D.complete&&0!==D.naturalWidth?V():D.addEventListener("load",V));console.warn("Cannot inline img src=".concat(B,"! Error: ").concat(e))}"anonymous"===D.crossOrigin&&($?_.crossOrigin=$:D.removeAttribute("crossorigin"))};D.complete&&0!==D.naturalWidth?V():D.addEventListener("load",V)}if("audio"===m||"video"===m){var Z=_;Z.rr_mediaState=e.paused?"paused":"played",Z.rr_mediaCurrentTime=e.currentTime,Z.rr_mediaPlaybackRate=e.playbackRate,Z.rr_mediaMuted=e.muted,Z.rr_mediaLoop=e.loop,Z.rr_mediaVolume=e.volume}v||(e.scrollLeft&&(_.rr_scrollLeft=e.scrollLeft),e.scrollTop&&(_.rr_scrollTop=e.scrollTop));if(f){var{width:G,height:U}=e.getBoundingClientRect();_={class:_.class,rr_width:"".concat(G,"px"),rr_height:"".concat(U,"px")}}"iframe"!==m||p(_.src)||(e.contentDocument||(_.rr_src=_.src),delete _.src);try{customElements.get(m)&&(n=!0)}catch(e){}return{type:h.Element,tagName:m,attributes:_,childNodes:[],isSVG:Y(e)||void 0,needBlock:f,rootId:g,isCustom:n}}(e,{doc:n,blockClass:i,blockSelector:o,inlineStylesheet:a,maskInputOptions:l,maskInputFn:u,dataURLOptions:d,inlineImages:p,recordCanvas:v,keepIframeSrcFn:g,newlyAddedElement:f,rootId:m});case e.TEXT_NODE:return function(e,t){var n,{needsMask:r,maskTextFn:i,rootId:o}=t,s=w.parentNode(e),a=s&&s.tagName,l=w.textContent(e),c="STYLE"===a||void 0,u="SCRIPT"===a||void 0;if(c&&l){try{e.nextSibling||e.previousSibling||(null==(n=s.sheet)?void 0:n.cssRules)&&(l=k(s.sheet))}catch(t){console.warn("Cannot get CSS styles from text's parentNode. Error: ".concat(t),e)}l=B(l,X(t.doc))}u&&(l="SCRIPT_PLACEHOLDER");!c&&!u&&l&&r&&(l=i?i(l,w.parentElement(e)):l.replace(/[\S]/g,"*"));return{type:h.Text,textContent:l||"",isStyle:c,rootId:o}}(e,{doc:n,needsMask:s,maskTextFn:c,rootId:m});case e.CDATA_SECTION_NODE:return{type:h.CDATA,textContent:"",rootId:m};case e.COMMENT_NODE:return{type:h.Comment,textContent:w.textContent(e)||"",rootId:m};default:return!1}}function ne(e){return null==e?"":e.toLowerCase()}function re(e,t){var{doc:n,mirror:r,blockClass:i,blockSelector:o,maskTextClass:s,maskTextSelector:a,skipChild:l=!1,inlineStylesheet:c=!0,maskInputOptions:u={},maskTextFn:d,maskInputFn:p,slimDOMOptions:v,dataURLOptions:g={},inlineImages:f=!1,recordCanvas:m=!1,onSerialize:_,onIframeLoad:y,iframeLoadTimeout:b=5e3,onStylesheetLoad:k,stylesheetLoadTimeout:E=5e3,keepIframeSrcFn:x=(()=>!1),newlyAddedElement:T=!1}=t,{needsMask:M}=t,{preserveWhiteSpace:R=!0}=t;M||(M=ee(e,s,a,void 0===M));var A,N=te(e,{doc:n,mirror:r,blockClass:i,blockSelector:o,needsMask:M,inlineStylesheet:c,maskInputOptions:u,maskTextFn:d,maskInputFn:p,dataURLOptions:g,inlineImages:f,recordCanvas:m,keepIframeSrcFn:x,newlyAddedElement:T});if(!N)return console.warn(e,"not serialized"),null;A=r.hasNode(e)?r.getId(e):!function(e,t){if(t.comment&&e.type===h.Comment)return!0;if(e.type===h.Element){if(t.script&&("script"===e.tagName||"link"===e.tagName&&("preload"===e.attributes.rel||"modulepreload"===e.attributes.rel)&&"script"===e.attributes.as||"link"===e.tagName&&"prefetch"===e.attributes.rel&&"string"==typeof e.attributes.href&&"js"===F(e.attributes.href)))return!0;if(t.headFavicon&&("link"===e.tagName&&"shortcut icon"===e.attributes.rel||"meta"===e.tagName&&(ne(e.attributes.name).match(/^msapplication-tile(image|color)$/)||"application-name"===ne(e.attributes.name)||"icon"===ne(e.attributes.rel)||"apple-touch-icon"===ne(e.attributes.rel)||"shortcut icon"===ne(e.attributes.rel))))return!0;if("meta"===e.tagName){if(t.headMetaDescKeywords&&ne(e.attributes.name).match(/^description|keywords$/))return!0;if(t.headMetaSocial&&(ne(e.attributes.property).match(/^(og|twitter|fb):/)||ne(e.attributes.name).match(/^(og|twitter):/)||"pinterest"===ne(e.attributes.name)))return!0;if(t.headMetaRobots&&("robots"===ne(e.attributes.name)||"googlebot"===ne(e.attributes.name)||"bingbot"===ne(e.attributes.name)))return!0;if(t.headMetaHttpEquiv&&void 0!==e.attributes["http-equiv"])return!0;if(t.headMetaAuthorship&&("author"===ne(e.attributes.name)||"generator"===ne(e.attributes.name)||"framework"===ne(e.attributes.name)||"publisher"===ne(e.attributes.name)||"progid"===ne(e.attributes.name)||ne(e.attributes.property).match(/^article:/)||ne(e.attributes.property).match(/^product:/)))return!0;if(t.headMetaVerification&&("google-site-verification"===ne(e.attributes.name)||"yandex-verification"===ne(e.attributes.name)||"csrf-token"===ne(e.attributes.name)||"p:domain_verify"===ne(e.attributes.name)||"verify-v1"===ne(e.attributes.name)||"verification"===ne(e.attributes.name)||"shopify-checkout-api-token"===ne(e.attributes.name)))return!0}}return!1}(N,v)&&(R||N.type!==h.Text||N.isStyle||N.textContent.replace(/^\s+|\s+$/gm,"").length)?Z():V;var O=Object.assign(N,{id:A});if(r.add(e,O),A===V)return null;_&&_(e);var P=!l;if(O.type===h.Element){P=P&&!O.needBlock,delete O.needBlock;var L=w.shadowRoot(e);L&&I(L)&&(O.isShadowHost=!0)}if((O.type===h.Document||O.type===h.Element)&&P){v.headWhitespace&&O.type===h.Element&&"head"===O.tagName&&(R=!1);var D={doc:n,mirror:r,blockClass:i,blockSelector:o,needsMask:M,maskTextClass:s,maskTextSelector:a,skipChild:l,inlineStylesheet:c,maskInputOptions:u,maskTextFn:d,maskInputFn:p,slimDOMOptions:v,dataURLOptions:g,inlineImages:f,recordCanvas:m,preserveWhiteSpace:R,onSerialize:_,onIframeLoad:y,iframeLoadTimeout:b,onStylesheetLoad:k,stylesheetLoadTimeout:E,keepIframeSrcFn:x};if(O.type===h.Element&&"textarea"===O.tagName&&void 0!==O.attributes.value);else for(var B of Array.from(w.childNodes(e))){var H=re(B,D);H&&O.childNodes.push(H)}var q=null;if(S(e)&&(q=w.shadowRoot(e)))for(var $ of Array.from(w.childNodes(q))){var W=re($,D);W&&(I(q)&&(W.isShadow=!0),O.childNodes.push(W))}}var G=w.parentNode(e);return G&&C(G)&&I(G)&&(O.isShadow=!0),O.type===h.Element&&"iframe"===O.tagName&&function(e,t,n){var r=e.contentWindow;if(r){var i,o=!1;try{i=r.document.readyState}catch(e){return}if("complete"===i){var s="about:blank";if(r.location.href!==s||e.src===s||""===e.src)return setTimeout(t,0),e.addEventListener("load",t);e.addEventListener("load",t)}else{var a=setTimeout((()=>{o||(t(),o=!0)}),n);e.addEventListener("load",(()=>{clearTimeout(a),o=!0,t()}))}}}(e,(()=>{var t=e.contentDocument;if(t&&y){var n=re(t,{doc:t,mirror:r,blockClass:i,blockSelector:o,needsMask:M,maskTextClass:s,maskTextSelector:a,skipChild:!1,inlineStylesheet:c,maskInputOptions:u,maskTextFn:d,maskInputFn:p,slimDOMOptions:v,dataURLOptions:g,inlineImages:f,recordCanvas:m,preserveWhiteSpace:R,onSerialize:_,onIframeLoad:y,iframeLoadTimeout:b,onStylesheetLoad:k,stylesheetLoadTimeout:E,keepIframeSrcFn:x});n&&y(e,n)}}),b),O.type===h.Element&&"link"===O.tagName&&"string"==typeof O.attributes.rel&&("stylesheet"===O.attributes.rel||"preload"===O.attributes.rel&&"string"==typeof O.attributes.href&&"css"===F(O.attributes.href))&&function(e,t,n){var r,i=!1;try{r=e.sheet}catch(e){return}if(!r){var o=setTimeout((()=>{i||(t(),i=!0)}),n);e.addEventListener("load",(()=>{clearTimeout(o),i=!0,t()}))}}(e,(()=>{if(k){var t=re(e,{doc:n,mirror:r,blockClass:i,blockSelector:o,needsMask:M,maskTextClass:s,maskTextSelector:a,skipChild:!1,inlineStylesheet:c,maskInputOptions:u,maskTextFn:d,maskInputFn:p,slimDOMOptions:v,dataURLOptions:g,inlineImages:f,recordCanvas:m,preserveWhiteSpace:R,onSerialize:_,onIframeLoad:y,iframeLoadTimeout:b,onStylesheetLoad:k,stylesheetLoadTimeout:E,keepIframeSrcFn:x});t&&k(e,t)}}),E),O}let ie=class e{constructor(){__publicField2(this,"parentElement",null),__publicField2(this,"parentNode",null),__publicField2(this,"ownerDocument"),__publicField2(this,"firstChild",null),__publicField2(this,"lastChild",null),__publicField2(this,"previousSibling",null),__publicField2(this,"nextSibling",null),__publicField2(this,"ELEMENT_NODE",1),__publicField2(this,"TEXT_NODE",3),__publicField2(this,"nodeType"),__publicField2(this,"nodeName"),__publicField2(this,"RRNodeType")}get childNodes(){for(var e=[],t=this.firstChild;t;)e.push(t),t=t.nextSibling;return e}contains(t){if(!(t instanceof e))return!1;if(t.ownerDocument!==this.ownerDocument)return!1;if(t===this)return!0;for(;t.parentNode;){if(t.parentNode===this)return!0;t=t.parentNode}return!1}appendChild(e){throw new Error("RRDomException: Failed to execute 'appendChild' on 'RRNode': This RRNode type does not support this method.")}insertBefore(e,t){throw new Error("RRDomException: Failed to execute 'insertBefore' on 'RRNode': This RRNode type does not support this method.")}removeChild(e){throw new Error("RRDomException: Failed to execute 'removeChild' on 'RRNode': This RRNode type does not support this method.")}toString(){return"RRNode"}};var oe={Node:["childNodes","parentNode","parentElement","textContent"],ShadowRoot:["host","styleSheets"],Element:["shadowRoot","querySelector","querySelectorAll"],MutationObserver:[]},se={Node:["contains","getRootNode"],ShadowRoot:["getSelection"],Element:[],MutationObserver:["constructor"]};var ae={};function le(e){if(ae[e])return ae[e];var t=function(e){var t,n,r=null===globalThis||void 0===globalThis||null===(t=globalThis.Zone)||void 0===t||null===(n=t.__symbol__)||void 0===n?void 0:n.call(t,e);return r&&globalThis[r]?globalThis[r]:void 0}(e)||globalThis[e],n=t.prototype,r=e in oe?oe[e]:void 0,i=Boolean(r&&r.every((e=>{var t,r;return Boolean(null==(r=null==(t=Object.getOwnPropertyDescriptor(n,e))?void 0:t.get)?void 0:r.toString().includes("[native code]"))}))),o=e in se?se[e]:void 0,s=Boolean(o&&o.every((e=>{var t;return"function"==typeof n[e]&&(null==(t=n[e])?void 0:t.toString().includes("[native code]"))})));if(i&&s)return ae[e]=t.prototype,t.prototype;try{var a=document.createElement("iframe");document.body.appendChild(a);var l=a.contentWindow;if(!l)return t.prototype;var c=l[e].prototype;return document.body.removeChild(a),c?ae[e]=c:n}catch(e){return n}}var ce={};function ue(e,t,n){var r,i="".concat(e,".").concat(String(n));if(ce[i])return ce[i].call(t);var o=le(e),s=null==(r=Object.getOwnPropertyDescriptor(o,n))?void 0:r.get;return s?(ce[i]=s,s.call(t)):t[n]}var de={};function he(e,t,n){var r="".concat(e,".").concat(String(n));if(de[r])return de[r].bind(t);var i=le(e)[n];return"function"!=typeof i?t[n]:(de[r]=i,i.bind(t))}function pe(){return le("MutationObserver").constructor}var ve={childNodes:function(e){return ue("Node",e,"childNodes")},parentNode:function(e){return ue("Node",e,"parentNode")},parentElement:function(e){return ue("Node",e,"parentElement")},textContent:function(e){return ue("Node",e,"textContent")},contains:function(e,t){return he("Node",e,"contains")(t)},getRootNode:function(e){return he("Node",e,"getRootNode")()},host:function(e){return e&&"host"in e?ue("ShadowRoot",e,"host"):null},styleSheets:function(e){return e.styleSheets},shadowRoot:function(e){return e&&"shadowRoot"in e?ue("Element",e,"shadowRoot"):null},querySelector:function(e,t){return ue("Element",e,"querySelector")(t)},querySelectorAll:function(e,t){return ue("Element",e,"querySelectorAll")(t)},mutationObserver:pe};function ge(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:document,r={capture:!0,passive:!0};return n.addEventListener(e,t,r),()=>n.removeEventListener(e,t,r)}var fe="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.",me={map:{},getId:()=>(console.error(fe),-1),getNode:()=>(console.error(fe),null),removeNodeFromMap(){console.error(fe)},has:()=>(console.error(fe),!1),reset(){console.error(fe)}};function _e(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=null,i=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();i||!1!==n.leading||(i=l);var c=t-(l-i),u=this;c<=0||c>t?(r&&(clearTimeout(r),r=null),i=l,e.apply(u,s)):r||!1===n.trailing||(r=setTimeout((()=>{i=!1===n.leading?0:Date.now(),r=null,e.apply(u,s)}),c))}}function ye(e,t,n,r){var i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:window,o=i.Object.getOwnPropertyDescriptor(e,t);return i.Object.defineProperty(e,t,r?n:{set(e){setTimeout((()=>{n.set.call(this,e)}),0),o&&o.set&&o.set.call(this,e)}}),()=>ye(e,t,o||{},!0)}function be(e,t,n){try{if(!(t in e))return()=>{};var r=e[t],i=n(r);return"function"==typeof i&&(i.prototype=i.prototype||{},Object.defineProperties(i,{__rrweb_original__:{enumerable:!1,value:r}})),e[t]=i,()=>{e[t]=r}}catch(e){return()=>{}}}"undefined"!=typeof window&&window.Proxy&&window.Reflect&&(me=new Proxy(me,{get:(e,t,n)=>("map"===t&&console.error(fe),Reflect.get(e,t,n))}));var we=Date.now;function Se(e){var t,n,r,i,o=e.document;return{left:o.scrollingElement?o.scrollingElement.scrollLeft:void 0!==e.pageXOffset?e.pageXOffset:o.documentElement.scrollLeft||(null==o?void 0:o.body)&&(null==(t=ve.parentElement(o.body))?void 0:t.scrollLeft)||(null==(n=null==o?void 0:o.body)?void 0:n.scrollLeft)||0,top:o.scrollingElement?o.scrollingElement.scrollTop:void 0!==e.pageYOffset?e.pageYOffset:(null==o?void 0:o.documentElement.scrollTop)||(null==o?void 0:o.body)&&(null==(r=ve.parentElement(o.body))?void 0:r.scrollTop)||(null==(i=null==o?void 0:o.body)?void 0:i.scrollTop)||0}}function Ce(){return window.innerHeight||document.documentElement&&document.documentElement.clientHeight||document.body&&document.body.clientHeight}function Ie(){return window.innerWidth||document.documentElement&&document.documentElement.clientWidth||document.body&&document.body.clientWidth}function ke(e){return e?e.nodeType===e.ELEMENT_NODE?e:ve.parentElement(e):null}function Ee(e,t,n,r){if(!e)return!1;var i=ke(e);if(!i)return!1;try{if("string"==typeof t){if(i.classList.contains(t))return!0;if(r&&null!==i.closest("."+t))return!0}else if(Q(i,t,r))return!0}catch(e){}if(n){if(i.matches(n))return!0;if(r&&null!==i.closest(n))return!0}return!1}function xe(e,t,n){return!("TITLE"!==e.tagName||!n.headTitleMutations)||t.getId(e)===V}function Te(e,t){if(C(e))return!1;var n=t.getId(e);if(!t.has(n))return!0;var r=ve.parentNode(e);return(!r||r.nodeType!==e.DOCUMENT_NODE)&&(!r||Te(r,t))}function Me(e){return Boolean(e.changedTouches)}function Re(e,t){return Boolean("IFRAME"===e.nodeName&&t.getMeta(e))}function Ae(e,t){return Boolean("LINK"===e.nodeName&&e.nodeType===e.ELEMENT_NODE&&e.getAttribute&&"stylesheet"===e.getAttribute("rel")&&t.getMeta(e))}function Ne(e){return!!e&&(e instanceof ie&&"shadowRoot"in e?Boolean(e.shadowRoot):Boolean(ve.shadowRoot(e)))}/[1-9][0-9]{12}/.test(Date.now().toString())||(we=()=>(new Date).getTime());let Fe=class{constructor(){c(this,"id",1),c(this,"styleIDMap",new WeakMap),c(this,"idStyleMap",new Map)}getId(e){var t;return null!==(t=this.styleIDMap.get(e))&&void 0!==t?t:-1}has(e){return this.styleIDMap.has(e)}add(e,t){return this.has(e)?this.getId(e):(n=void 0===t?this.id++:t,this.styleIDMap.set(e,n),this.idStyleMap.set(n,e),n);var n}getStyle(e){return this.idStyleMap.get(e)||null}reset(){this.styleIDMap=new WeakMap,this.idStyleMap=new Map,this.id=1}generateId(){return this.id++}};function Oe(e){var t,n=null;return"getRootNode"in e&&(null==(t=ve.getRootNode(e))?void 0:t.nodeType)===Node.DOCUMENT_FRAGMENT_NODE&&ve.host(ve.getRootNode(e))&&(n=ve.host(ve.getRootNode(e))),n}function Pe(e){var t=e.ownerDocument;if(!t)return!1;var n=function(e){for(var t,n=e;t=Oe(n);)n=t;return n}(e);return ve.contains(t,n)}function Le(e){var t=e.ownerDocument;return!!t&&(ve.contains(t,e)||Pe(e))}var De=(e=>(e[e.DomContentLoaded=0]="DomContentLoaded",e[e.Load=1]="Load",e[e.FullSnapshot=2]="FullSnapshot",e[e.IncrementalSnapshot=3]="IncrementalSnapshot",e[e.Meta=4]="Meta",e[e.Custom=5]="Custom",e[e.Plugin=6]="Plugin",e))(De||{}),Be=(e=>(e[e.Mutation=0]="Mutation",e[e.MouseMove=1]="MouseMove",e[e.MouseInteraction=2]="MouseInteraction",e[e.Scroll=3]="Scroll",e[e.ViewportResize=4]="ViewportResize",e[e.Input=5]="Input",e[e.TouchMove=6]="TouchMove",e[e.MediaInteraction=7]="MediaInteraction",e[e.StyleSheetRule=8]="StyleSheetRule",e[e.CanvasMutation=9]="CanvasMutation",e[e.Font=10]="Font",e[e.Log=11]="Log",e[e.Drag=12]="Drag",e[e.StyleDeclaration=13]="StyleDeclaration",e[e.Selection=14]="Selection",e[e.AdoptedStyleSheet=15]="AdoptedStyleSheet",e[e.CustomElement=16]="CustomElement",e))(Be||{}),He=(e=>(e[e.MouseUp=0]="MouseUp",e[e.MouseDown=1]="MouseDown",e[e.Click=2]="Click",e[e.ContextMenu=3]="ContextMenu",e[e.DblClick=4]="DblClick",e[e.Focus=5]="Focus",e[e.Blur=6]="Blur",e[e.TouchStart=7]="TouchStart",e[e.TouchMove_Departed=8]="TouchMove_Departed",e[e.TouchEnd=9]="TouchEnd",e[e.TouchCancel=10]="TouchCancel",e))(He||{}),qe=(e=>(e[e.Mouse=0]="Mouse",e[e.Pen=1]="Pen",e[e.Touch=2]="Touch",e))(qe||{}),$e=(e=>(e[e["2D"]=0]="2D",e[e.WebGL=1]="WebGL",e[e.WebGL2=2]="WebGL2",e))($e||{}),We=(e=>(e[e.Play=0]="Play",e[e.Pause=1]="Pause",e[e.Seeked=2]="Seeked",e[e.VolumeChange=3]="VolumeChange",e[e.RateChange=4]="RateChange",e))(We||{});function Ve(e){return"__ln"in e}class Ze{constructor(){c(this,"length",0),c(this,"head",null),c(this,"tail",null)}get(e){if(e>=this.length)throw new Error("Position outside of list range");for(var t=this.head,n=0;n<e;n++)t=(null==t?void 0:t.next)||null;return t}addNode(e){var t={value:e,previous:null,next:null};if(e.__ln=t,e.previousSibling&&Ve(e.previousSibling)){var n=e.previousSibling.__ln.next;t.next=n,t.previous=e.previousSibling.__ln,e.previousSibling.__ln.next=t,n&&(n.previous=t)}else if(e.nextSibling&&Ve(e.nextSibling)&&e.nextSibling.__ln.previous){var r=e.nextSibling.__ln.previous;t.previous=r,t.next=e.nextSibling.__ln,e.nextSibling.__ln.previous=t,r&&(r.next=t)}else this.head&&(this.head.previous=t),t.next=this.head,this.head=t;null===t.next&&(this.tail=t),this.length++}removeNode(e){var t=e.__ln;this.head&&(t.previous?(t.previous.next=t.next,t.next?t.next.previous=t.previous:this.tail=t.previous):(this.head=t.next,this.head?this.head.previous=null:this.tail=null),e.__ln&&delete e.__ln,this.length--)}}var Ge,Ue=(e,t)=>"".concat(e,"@").concat(t);class je{constructor(){c(this,"frozen",!1),c(this,"locked",!1),c(this,"texts",[]),c(this,"attributes",[]),c(this,"attributeMap",new WeakMap),c(this,"removes",[]),c(this,"mapRemoves",[]),c(this,"movedMap",{}),c(this,"addedSet",new Set),c(this,"movedSet",new Set),c(this,"droppedSet",new Set),c(this,"mutationCb"),c(this,"blockClass"),c(this,"blockSelector"),c(this,"maskTextClass"),c(this,"maskTextSelector"),c(this,"inlineStylesheet"),c(this,"maskInputOptions"),c(this,"maskTextFn"),c(this,"maskInputFn"),c(this,"keepIframeSrcFn"),c(this,"recordCanvas"),c(this,"inlineImages"),c(this,"slimDOMOptions"),c(this,"dataURLOptions"),c(this,"doc"),c(this,"mirror"),c(this,"iframeManager"),c(this,"stylesheetManager"),c(this,"shadowDomManager"),c(this,"canvasManager"),c(this,"processedNodeManager"),c(this,"unattachedDoc"),c(this,"processMutations",(e=>{e.forEach(this.processMutation),this.emit()})),c(this,"emit",(()=>{if(!this.frozen&&!this.locked){for(var e=[],t=new Set,n=new Ze,r=e=>{for(var t=e,n=V;n===V;)n=(t=t&&t.nextSibling)&&this.mirror.getId(t);return n},i=i=>{var o=ve.parentNode(i);if(o&&Le(i)&&"TEXTAREA"!==o.tagName){var s=C(o)?this.mirror.getId(Oe(i)):this.mirror.getId(o),a=r(i);if(-1===s||-1===a)return n.addNode(i);var l=re(i,{doc:this.doc,mirror:this.mirror,blockClass:this.blockClass,blockSelector:this.blockSelector,maskTextClass:this.maskTextClass,maskTextSelector:this.maskTextSelector,skipChild:!0,newlyAddedElement:!0,inlineStylesheet:this.inlineStylesheet,maskInputOptions:this.maskInputOptions,maskTextFn:this.maskTextFn,maskInputFn:this.maskInputFn,slimDOMOptions:this.slimDOMOptions,dataURLOptions:this.dataURLOptions,recordCanvas:this.recordCanvas,inlineImages:this.inlineImages,onSerialize:e=>{Re(e,this.mirror)&&this.iframeManager.addIframe(e),Ae(e,this.mirror)&&this.stylesheetManager.trackLinkElement(e),Ne(i)&&this.shadowDomManager.addShadowRoot(ve.shadowRoot(i),this.doc)},onIframeLoad:(e,t)=>{this.iframeManager.attachIframe(e,t),this.shadowDomManager.observeAttachShadow(e)},onStylesheetLoad:(e,t)=>{this.stylesheetManager.attachLinkElement(e,t)}});l&&(e.push({parentId:s,nextId:a,node:l}),t.add(l.id))}};this.mapRemoves.length;)this.mirror.removeNodeFromMap(this.mapRemoves.shift());for(var o of this.movedSet)Ye(this.removes,o,this.mirror)&&!this.movedSet.has(ve.parentNode(o))||i(o);for(var s of this.addedSet)Xe(this.droppedSet,s)||Ye(this.removes,s,this.mirror)?Xe(this.movedSet,s)?i(s):this.droppedSet.add(s):i(s);for(var a=null;n.length;){var l=null;if(a){var c=this.mirror.getId(ve.parentNode(a.value)),u=r(a.value);-1!==c&&-1!==u&&(l=a)}if(!l)for(var d=n.tail;d;){var h=d;if(d=d.previous,h){var p=this.mirror.getId(ve.parentNode(h.value));if(-1===r(h.value))continue;if(-1!==p){l=h;break}var v=h.value,g=ve.parentNode(v);if(g&&g.nodeType===Node.DOCUMENT_FRAGMENT_NODE){var f=ve.host(g);if(-1!==this.mirror.getId(f)){l=h;break}}}}if(!l){for(;n.head;)n.removeNode(n.head.value);break}a=l.previous,n.removeNode(l.value),i(l.value)}var m={texts:this.texts.map((e=>{var t=e.node,n=ve.parentNode(t);return n&&"TEXTAREA"===n.tagName&&this.genTextAreaValueMutation(n),{id:this.mirror.getId(t),value:e.value}})).filter((e=>!t.has(e.id))).filter((e=>this.mirror.has(e.id))),attributes:this.attributes.map((e=>{var{attributes:t}=e;if("string"==typeof t.style){var n=JSON.stringify(e.styleDiff),r=JSON.stringify(e._unchangedStyles);n.length<t.style.length&&(n+r).split("var(").length===t.style.split("var(").length&&(t.style=e.styleDiff)}return{id:this.mirror.getId(e.node),attributes:t}})).filter((e=>!t.has(e.id))).filter((e=>this.mirror.has(e.id))),removes:this.removes,adds:e};(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))}})),c(this,"genTextAreaValueMutation",(e=>{var t=this.attributeMap.get(e);t||(t={node:e,attributes:{},styleDiff:{},_unchangedStyles:{}},this.attributes.push(t),this.attributeMap.set(e,t)),t.attributes.value=Array.from(ve.childNodes(e),(e=>ve.textContent(e)||"")).join("")})),c(this,"processMutation",(e=>{if(!xe(e.target,this.mirror,this.slimDOMOptions))switch(e.type){case"characterData":var t=ve.textContent(e.target);Ee(e.target,this.blockClass,this.blockSelector,!1)||t===e.oldValue||this.texts.push({value:ee(e.target,this.maskTextClass,this.maskTextSelector,!0)&&t?this.maskTextFn?this.maskTextFn(t,ke(e.target)):t.replace(/[\S]/g,"*"):t,node:e.target});break;case"attributes":var n=e.target,r=e.attributeName,i=e.target.getAttribute(r);if("value"===r){var o=N(n);i=M({element:n,maskInputOptions:this.maskInputOptions,tagName:n.tagName,type:o,value:i,maskInputFn:this.maskInputFn})}if(Ee(e.target,this.blockClass,this.blockSelector,!1)||i===e.oldValue)return;var s=this.attributeMap.get(e.target);if("IFRAME"===n.tagName&&"src"===r&&!this.keepIframeSrcFn(i)){if(n.contentDocument)return;r="rr_src"}if(s||(s={node:e.target,attributes:{},styleDiff:{},_unchangedStyles:{}},this.attributes.push(s),this.attributeMap.set(e.target,s)),"type"===r&&"INPUT"===n.tagName&&"password"===(e.oldValue||"").toLowerCase()&&n.setAttribute("data-rr-is-password","true"),!K(n.tagName,r))if(s.attributes[r]=J(this.doc,R(n.tagName),R(r),i),"style"===r){if(!this.unattachedDoc)try{this.unattachedDoc=document.implementation.createHTMLDocument()}catch(e){this.unattachedDoc=this.doc}var a=this.unattachedDoc.createElement("span");for(var l of(e.oldValue&&a.setAttribute("style",e.oldValue),Array.from(n.style))){var c=n.style.getPropertyValue(l),u=n.style.getPropertyPriority(l);c!==a.style.getPropertyValue(l)||u!==a.style.getPropertyPriority(l)?s.styleDiff[l]=""===u?c:[c,u]:s._unchangedStyles[l]=[c,u]}for(var d of Array.from(a.style))""===n.style.getPropertyValue(d)&&(s.styleDiff[d]=!1)}else"open"===r&&"DIALOG"===n.tagName&&(n.matches("dialog:modal")?s.attributes.rr_open_mode="modal":s.attributes.rr_open_mode="non-modal");break;case"childList":if(Ee(e.target,this.blockClass,this.blockSelector,!0))return;if("TEXTAREA"===e.target.tagName)return void this.genTextAreaValueMutation(e.target);e.addedNodes.forEach((t=>this.genAdds(t,e.target))),e.removedNodes.forEach((t=>{var n=this.mirror.getId(t),r=C(e.target)?this.mirror.getId(ve.host(e.target)):this.mirror.getId(e.target);Ee(e.target,this.blockClass,this.blockSelector,!1)||xe(t,this.mirror,this.slimDOMOptions)||!function(e,t){return-1!==t.getId(e)}(t,this.mirror)||(this.addedSet.has(t)?(ze(this.addedSet,t),this.droppedSet.add(t)):this.addedSet.has(e.target)&&-1===n||Te(e.target,this.mirror)||(this.movedSet.has(t)&&this.movedMap[Ue(n,r)]?ze(this.movedSet,t):this.removes.push({parentId:r,id:n,isShadow:!(!C(e.target)||!I(e.target))||void 0})),this.mapRemoves.push(t))}))}})),c(this,"genAdds",((e,t)=>{if(!this.processedNodeManager.inOtherBuffer(e,this)&&!this.addedSet.has(e)&&!this.movedSet.has(e)){if(this.mirror.hasNode(e)){if(xe(e,this.mirror,this.slimDOMOptions))return;this.movedSet.add(e);var n=null;t&&this.mirror.hasNode(t)&&(n=this.mirror.getId(t)),n&&-1!==n&&(this.movedMap[Ue(this.mirror.getId(e),n)]=!0)}else this.addedSet.add(e),this.droppedSet.delete(e);Ee(e,this.blockClass,this.blockSelector,!1)||(ve.childNodes(e).forEach((e=>this.genAdds(e))),Ne(e)&&ve.childNodes(ve.shadowRoot(e)).forEach((t=>{this.processedNodeManager.add(t,this),this.genAdds(t,e)})))}}))}init(e){["mutationCb","blockClass","blockSelector","maskTextClass","maskTextSelector","inlineStylesheet","maskInputOptions","maskTextFn","maskInputFn","keepIframeSrcFn","recordCanvas","inlineImages","slimDOMOptions","dataURLOptions","doc","mirror","iframeManager","stylesheetManager","shadowDomManager","canvasManager","processedNodeManager"].forEach((t=>{this[t]=e[t]}))}freeze(){this.frozen=!0,this.canvasManager.freeze()}unfreeze(){this.frozen=!1,this.canvasManager.unfreeze(),this.emit()}isFrozen(){return this.frozen}lock(){this.locked=!0,this.canvasManager.lock()}unlock(){this.locked=!1,this.canvasManager.unlock(),this.emit()}reset(){this.shadowDomManager.reset(),this.canvasManager.reset()}}function ze(e,t){e.delete(t),ve.childNodes(t).forEach((t=>ze(e,t)))}function Ye(e,t,n){return 0!==e.length&&function(e,t,n){var r=ve.parentNode(t),i=function(){var t=n.getId(r);if(e.some((e=>e.id===t)))return{v:!0};r=ve.parentNode(r)};for(;r;){var o=i();if("object"==typeof o)return o.v}return!1}(e,t,n)}function Xe(e,t){return 0!==e.size&&Je(e,t)}function Je(e,t){var n=ve.parentNode(t);return!!n&&(!!e.has(n)||Je(e,n))}var Ke=e=>{if(!Ge)return e;return function(){try{return e(...arguments)}catch(e){if(Ge&&!0===Ge(e))return;throw e}}},Qe=[];function et(e){try{if("composedPath"in e){var t=e.composedPath();if(t.length)return t[0]}else if("path"in e&&e.path.length)return e.path[0]}catch(e){}return e&&e.target}function tt(e,t){var n=new je;Qe.push(n),n.init(e);var r=new(pe())(Ke(n.processMutations.bind(n)));return r.observe(t,{attributes:!0,attributeOldValue:!0,characterData:!0,characterDataOldValue:!0,childList:!0,subtree:!0}),r}function nt(e){var{mouseInteractionCb:n,doc:r,mirror:i,blockClass:o,blockSelector:s,sampling:a}=e;if(!1===a.mouseInteraction)return()=>{};var l=!0===a.mouseInteraction||void 0===a.mouseInteraction?{}:a.mouseInteraction,c=[],u=null;return Object.keys(He).filter((e=>Number.isNaN(Number(e))&&!e.endsWith("_Departed")&&!1!==l[e])).forEach((e=>{var a=R(e),l=(e=>r=>{var a=et(r);if(!Ee(a,o,s,!0)){var l=null,c=e;if("pointerType"in r){switch(r.pointerType){case"mouse":l=qe.Mouse;break;case"touch":l=qe.Touch;break;case"pen":l=qe.Pen}l===qe.Touch?He[e]===He.MouseDown?c="TouchStart":He[e]===He.MouseUp&&(c="TouchEnd"):qe.Pen}else Me(r)&&(l=qe.Touch);null!==l?(u=l,(c.startsWith("Touch")&&l===qe.Touch||c.startsWith("Mouse")&&l===qe.Mouse)&&(l=null)):He[e]===He.Click&&(l=u,u=null);var d=Me(r)?r.changedTouches[0]:r;if(d){var h=i.getId(a),{clientX:p,clientY:v}=d;Ke(n)(t({type:He[c],id:h,x:p,y:v},null!==l&&{pointerType:l}))}}})(e);if(window.PointerEvent)switch(He[e]){case He.MouseDown:case He.MouseUp:a=a.replace("mouse","pointer");break;case He.TouchStart:case He.TouchEnd:return}c.push(ge(a,l,r))})),Ke((()=>{c.forEach((e=>e()))}))}function rt(e){var{scrollCb:t,doc:n,mirror:r,blockClass:i,blockSelector:o,sampling:s}=e;return ge("scroll",Ke(_e(Ke((e=>{var s=et(e);if(s&&!Ee(s,i,o,!0)){var a=r.getId(s);if(s===n&&n.defaultView){var l=Se(n.defaultView);t({id:a,x:l.left,y:l.top})}else t({id:a,x:s.scrollLeft,y:s.scrollTop})}})),s.scroll||100)),n)}var it=["INPUT","TEXTAREA","SELECT"],ot=new WeakMap;function st(e){return function(e,t){if(ut("CSSGroupingRule")&&e.parentRule instanceof CSSGroupingRule||ut("CSSMediaRule")&&e.parentRule instanceof CSSMediaRule||ut("CSSSupportsRule")&&e.parentRule instanceof CSSSupportsRule||ut("CSSConditionRule")&&e.parentRule instanceof CSSConditionRule){var n=Array.from(e.parentRule.cssRules).indexOf(e);t.unshift(n)}else if(e.parentStyleSheet){var r=Array.from(e.parentStyleSheet.cssRules).indexOf(e);t.unshift(r)}return t}(e,[])}function at(e,t,n){var r,i;return e?(e.ownerNode?r=t.getId(e.ownerNode):i=n.getId(e),{styleId:i,id:r}):{}}function lt(e,t){var n,r,i,{mirror:o,stylesheetManager:s}=e,a=null;a="#document"===t.nodeName?o.getId(t):o.getId(ve.host(t));var l="#document"===t.nodeName?null==(n=t.defaultView)?void 0:n.Document:null==(i=null==(r=t.ownerDocument)?void 0:r.defaultView)?void 0:i.ShadowRoot,c=(null==l?void 0:l.prototype)?Object.getOwnPropertyDescriptor(null==l?void 0:l.prototype,"adoptedStyleSheets"):void 0;return null!==a&&-1!==a&&l&&c?(Object.defineProperty(t,"adoptedStyleSheets",{configurable:c.configurable,enumerable:c.enumerable,get(){var e;return null==(e=c.get)?void 0:e.call(this)},set(e){var t,n=null==(t=c.set)?void 0:t.call(this,e);if(null!==a&&-1!==a)try{s.adoptStyleSheets(e,a)}catch(e){}return n}}),Ke((()=>{Object.defineProperty(t,"adoptedStyleSheets",{configurable:c.configurable,enumerable:c.enumerable,get:c.get,set:c.set})}))):()=>{}}function ct(e){var n,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=e.doc.defaultView;if(!i)return()=>{};!function(e,t){var{mutationCb:n,mousemoveCb:r,mouseInteractionCb:i,scrollCb:o,viewportResizeCb:s,inputCb:a,mediaInteractionCb:l,styleSheetRuleCb:c,styleDeclarationCb:u,canvasMutationCb:d,fontCb:h,selectionCb:p,customElementCb:v}=e;e.mutationCb=function(){t.mutation&&t.mutation(...arguments),n(...arguments)},e.mousemoveCb=function(){t.mousemove&&t.mousemove(...arguments),r(...arguments)},e.mouseInteractionCb=function(){t.mouseInteraction&&t.mouseInteraction(...arguments),i(...arguments)},e.scrollCb=function(){t.scroll&&t.scroll(...arguments),o(...arguments)},e.viewportResizeCb=function(){t.viewportResize&&t.viewportResize(...arguments),s(...arguments)},e.inputCb=function(){t.input&&t.input(...arguments),a(...arguments)},e.mediaInteractionCb=function(){t.mediaInteaction&&t.mediaInteaction(...arguments),l(...arguments)},e.styleSheetRuleCb=function(){t.styleSheetRule&&t.styleSheetRule(...arguments),c(...arguments)},e.styleDeclarationCb=function(){t.styleDeclaration&&t.styleDeclaration(...arguments),u(...arguments)},e.canvasMutationCb=function(){t.canvasMutation&&t.canvasMutation(...arguments),d(...arguments)},e.fontCb=function(){t.font&&t.font(...arguments),h(...arguments)},e.selectionCb=function(){t.selection&&t.selection(...arguments),p(...arguments)},e.customElementCb=function(){t.customElement&&t.customElement(...arguments),v(...arguments)}}(e,r),e.recordDOM&&(n=tt(e,e.doc));var o=function(e){var{mousemoveCb:t,sampling:n,doc:r,mirror:i}=e;if(!1===n.mousemove)return()=>{};var o,s="number"==typeof n.mousemove?n.mousemove:50,a="number"==typeof n.mousemoveCallback?n.mousemoveCallback:500,l=[],c=_e(Ke((e=>{var n=Date.now()-o;t(l.map((e=>(e.timeOffset-=n,e))),e),l=[],o=null})),a),u=Ke(_e(Ke((e=>{var t=et(e),{clientX:n,clientY:r}=Me(e)?e.changedTouches[0]:e;o||(o=we()),l.push({x:n,y:r,id:i.getId(t),timeOffset:we()-o}),c("undefined"!=typeof DragEvent&&e instanceof DragEvent?Be.Drag:e instanceof MouseEvent?Be.MouseMove:Be.TouchMove)})),s,{trailing:!1})),d=[ge("mousemove",u,r),ge("touchmove",u,r),ge("drag",u,r)];return Ke((()=>{d.forEach((e=>e()))}))}(e),s=nt(e),a=rt(e),l=function(e,t){var{viewportResizeCb:n}=e,{win:r}=t,i=-1,o=-1;return ge("resize",Ke(_e(Ke((()=>{var e=Ce(),t=Ie();i===e&&o===t||(n({width:Number(t),height:Number(e)}),i=e,o=t)})),200)),r)}(e,{win:i}),c=function(e){var{inputCb:n,doc:r,mirror:i,blockClass:o,blockSelector:s,ignoreClass:a,ignoreSelector:l,maskInputOptions:c,maskInputFn:u,sampling:d,userTriggeredOnInput:h}=e;function p(e){var t=et(e),n=e.isTrusted,i=t&&t.tagName;if(t&&"OPTION"===i&&(t=ve.parentElement(t)),t&&i&&!(it.indexOf(i)<0)&&!Ee(t,o,s,!0)&&!(t.classList.contains(a)||l&&t.matches(l))){var d=t.value,p=!1,g=N(t)||"";"radio"===g||"checkbox"===g?p=t.checked:(c[i.toLowerCase()]||c[g])&&(d=M({element:t,maskInputOptions:c,tagName:i,type:g,value:d,maskInputFn:u})),v(t,h?{text:d,isChecked:p,userTriggered:n}:{text:d,isChecked:p});var f=t.name;"radio"===g&&f&&p&&r.querySelectorAll('input[type="radio"][name="'.concat(f,'"]')).forEach((e=>{if(e!==t){var n=e.value;v(e,h?{text:n,isChecked:!p,userTriggered:!1}:{text:n,isChecked:!p})}}))}}function v(e,r){var o=ot.get(e);if(!o||o.text!==r.text||o.isChecked!==r.isChecked){ot.set(e,r);var s=i.getId(e);Ke(n)(t(t({},r),{},{id:s}))}}var g=("last"===d.input?["change"]:["input","change"]).map((e=>ge(e,Ke(p),r))),f=r.defaultView;if(!f)return()=>{g.forEach((e=>e()))};var m=f.Object.getOwnPropertyDescriptor(f.HTMLInputElement.prototype,"value"),_=[[f.HTMLInputElement.prototype,"value"],[f.HTMLInputElement.prototype,"checked"],[f.HTMLSelectElement.prototype,"value"],[f.HTMLTextAreaElement.prototype,"value"],[f.HTMLSelectElement.prototype,"selectedIndex"],[f.HTMLOptionElement.prototype,"selected"]];return m&&m.set&&g.push(..._.map((e=>ye(e[0],e[1],{set(){Ke(p)({target:this,isTrusted:!1})}},!1,f)))),Ke((()=>{g.forEach((e=>e()))}))}(e),u=function(e){var{mediaInteractionCb:t,blockClass:n,blockSelector:r,mirror:i,sampling:o,doc:s}=e,a=Ke((e=>_e(Ke((o=>{var s=et(o);if(s&&!Ee(s,n,r,!0)){var{currentTime:a,volume:l,muted:c,playbackRate:u,loop:d}=s;t({type:e,id:i.getId(s),currentTime:a,volume:l,muted:c,playbackRate:u,loop:d})}})),o.media||500))),l=[ge("play",a(We.Play),s),ge("pause",a(We.Pause),s),ge("seeked",a(We.Seeked),s),ge("volumechange",a(We.VolumeChange),s),ge("ratechange",a(We.RateChange),s)];return Ke((()=>{l.forEach((e=>e()))}))}(e),d=()=>{},h=()=>{},p=()=>{},v=()=>{};e.recordDOM&&(d=function(e,t){var{styleSheetRuleCb:n,mirror:r,stylesheetManager:i}=e,{win:o}=t;if(!o.CSSStyleSheet||!o.CSSStyleSheet.prototype)return()=>{};var s=o.CSSStyleSheet.prototype.insertRule;o.CSSStyleSheet.prototype.insertRule=new Proxy(s,{apply:Ke(((e,t,o)=>{var[s,a]=o,{id:l,styleId:c}=at(t,r,i.styleMirror);return(l&&-1!==l||c&&-1!==c)&&n({id:l,styleId:c,adds:[{rule:s,index:a}]}),e.apply(t,o)}))}),o.CSSStyleSheet.prototype.addRule=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:this.cssRules.length,r="".concat(e," { ").concat(t," }");return o.CSSStyleSheet.prototype.insertRule.apply(this,[r,n])};var a,l,c=o.CSSStyleSheet.prototype.deleteRule;o.CSSStyleSheet.prototype.deleteRule=new Proxy(c,{apply:Ke(((e,t,o)=>{var[s]=o,{id:a,styleId:l}=at(t,r,i.styleMirror);return(a&&-1!==a||l&&-1!==l)&&n({id:a,styleId:l,removes:[{index:s}]}),e.apply(t,o)}))}),o.CSSStyleSheet.prototype.removeRule=function(e){return o.CSSStyleSheet.prototype.deleteRule.apply(this,[e])},o.CSSStyleSheet.prototype.replace&&(a=o.CSSStyleSheet.prototype.replace,o.CSSStyleSheet.prototype.replace=new Proxy(a,{apply:Ke(((e,t,o)=>{var[s]=o,{id:a,styleId:l}=at(t,r,i.styleMirror);return(a&&-1!==a||l&&-1!==l)&&n({id:a,styleId:l,replace:s}),e.apply(t,o)}))})),o.CSSStyleSheet.prototype.replaceSync&&(l=o.CSSStyleSheet.prototype.replaceSync,o.CSSStyleSheet.prototype.replaceSync=new Proxy(l,{apply:Ke(((e,t,o)=>{var[s]=o,{id:a,styleId:l}=at(t,r,i.styleMirror);return(a&&-1!==a||l&&-1!==l)&&n({id:a,styleId:l,replaceSync:s}),e.apply(t,o)}))}));var u={};dt("CSSGroupingRule")?u.CSSGroupingRule=o.CSSGroupingRule:(dt("CSSMediaRule")&&(u.CSSMediaRule=o.CSSMediaRule),dt("CSSConditionRule")&&(u.CSSConditionRule=o.CSSConditionRule),dt("CSSSupportsRule")&&(u.CSSSupportsRule=o.CSSSupportsRule));var d={};return Object.entries(u).forEach((e=>{var[t,o]=e;d[t]={insertRule:o.prototype.insertRule,deleteRule:o.prototype.deleteRule},o.prototype.insertRule=new Proxy(d[t].insertRule,{apply:Ke(((e,t,o)=>{var[s,a]=o,{id:l,styleId:c}=at(t.parentStyleSheet,r,i.styleMirror);return(l&&-1!==l||c&&-1!==c)&&n({id:l,styleId:c,adds:[{rule:s,index:[...st(t),a||0]}]}),e.apply(t,o)}))}),o.prototype.deleteRule=new Proxy(d[t].deleteRule,{apply:Ke(((e,t,o)=>{var[s]=o,{id:a,styleId:l}=at(t.parentStyleSheet,r,i.styleMirror);return(a&&-1!==a||l&&-1!==l)&&n({id:a,styleId:l,removes:[{index:[...st(t),s]}]}),e.apply(t,o)}))})})),Ke((()=>{o.CSSStyleSheet.prototype.insertRule=s,o.CSSStyleSheet.prototype.deleteRule=c,a&&(o.CSSStyleSheet.prototype.replace=a),l&&(o.CSSStyleSheet.prototype.replaceSync=l),Object.entries(u).forEach((e=>{var[t,n]=e;n.prototype.insertRule=d[t].insertRule,n.prototype.deleteRule=d[t].deleteRule}))}))}(e,{win:i}),h=lt(e,e.doc),p=function(e,t){var{styleDeclarationCb:n,mirror:r,ignoreCSSAttributes:i,stylesheetManager:o}=e,{win:s}=t,a=s.CSSStyleDeclaration.prototype.setProperty;s.CSSStyleDeclaration.prototype.setProperty=new Proxy(a,{apply:Ke(((e,t,s)=>{var l,[c,u,d]=s;if(i.has(c))return a.apply(t,[c,u,d]);var{id:h,styleId:p}=at(null==(l=t.parentRule)?void 0:l.parentStyleSheet,r,o.styleMirror);return(h&&-1!==h||p&&-1!==p)&&n({id:h,styleId:p,set:{property:c,value:u,priority:d},index:st(t.parentRule)}),e.apply(t,s)}))});var l=s.CSSStyleDeclaration.prototype.removeProperty;return s.CSSStyleDeclaration.prototype.removeProperty=new Proxy(l,{apply:Ke(((e,t,s)=>{var a,[c]=s;if(i.has(c))return l.apply(t,[c]);var{id:u,styleId:d}=at(null==(a=t.parentRule)?void 0:a.parentStyleSheet,r,o.styleMirror);return(u&&-1!==u||d&&-1!==d)&&n({id:u,styleId:d,remove:{property:c},index:st(t.parentRule)}),e.apply(t,s)}))}),Ke((()=>{s.CSSStyleDeclaration.prototype.setProperty=a,s.CSSStyleDeclaration.prototype.removeProperty=l}))}(e,{win:i}),e.collectFonts&&(v=function(e){var{fontCb:t,doc:n}=e,r=n.defaultView;if(!r)return()=>{};var i=[],o=new WeakMap,s=r.FontFace;r.FontFace=function(e,t,n){var r=new s(e,t,n);return o.set(r,{family:e,buffer:"string"!=typeof t,descriptors:n,fontSource:"string"==typeof t?t:JSON.stringify(Array.from(new Uint8Array(t)))}),r};var a=be(n.fonts,"add",(function(e){return function(n){return setTimeout(Ke((()=>{var e=o.get(n);e&&(t(e),o.delete(n))})),0),e.apply(this,[n])}}));return i.push((()=>{r.FontFace=s})),i.push(a),Ke((()=>{i.forEach((e=>e()))}))}(e)));var g=function(e){var{doc:t,mirror:n,blockClass:r,blockSelector:i,selectionCb:o}=e,s=!0,a=Ke((()=>{var e=t.getSelection();if(!(!e||s&&(null==e?void 0:e.isCollapsed))){s=e.isCollapsed||!1;for(var a=[],l=e.rangeCount||0,c=0;c<l;c++){var u=e.getRangeAt(c),{startContainer:d,startOffset:h,endContainer:p,endOffset:v}=u;Ee(d,r,i,!0)||Ee(p,r,i,!0)||a.push({start:n.getId(d),startOffset:h,end:n.getId(p),endOffset:v})}o({ranges:a})}}));return a(),ge("selectionchange",a)}(e),f=function(e){var{doc:t,customElementCb:n}=e,r=t.defaultView;if(!r||!r.customElements)return()=>{};var i=be(r.customElements,"define",(function(e){return function(t,r,i){try{n({define:{name:t}})}catch(e){console.warn("Custom element callback failed for ".concat(t))}return e.apply(this,[t,r,i])}}));return i}(e),m=[];for(var _ of e.plugins)m.push(_.observer(_.callback,i,_.options));return Ke((()=>{Qe.forEach((e=>e.reset())),null==n||n.disconnect(),o(),s(),a(),l(),c(),u(),d(),h(),p(),v(),g(),f(),m.forEach((e=>e()))}))}function ut(e){return void 0!==window[e]}function dt(e){return Boolean(void 0!==window[e]&&window[e].prototype&&"insertRule"in window[e].prototype&&"deleteRule"in window[e].prototype)}class ht{constructor(e){c(this,"iframeIdToRemoteIdMap",new WeakMap),c(this,"iframeRemoteIdToIdMap",new WeakMap),this.generateIdFn=e}getId(e,t,n,r){var i=n||this.getIdToRemoteIdMap(e),o=r||this.getRemoteIdToIdMap(e),s=i.get(t);return s||(s=this.generateIdFn(),i.set(t,s),o.set(s,t)),s}getIds(e,t){var n=this.getIdToRemoteIdMap(e),r=this.getRemoteIdToIdMap(e);return t.map((t=>this.getId(e,t,n,r)))}getRemoteId(e,t,n){var r=n||this.getRemoteIdToIdMap(e);if("number"!=typeof t)return t;var i=r.get(t);return i||-1}getRemoteIds(e,t){var n=this.getRemoteIdToIdMap(e);return t.map((t=>this.getRemoteId(e,t,n)))}reset(e){if(!e)return this.iframeIdToRemoteIdMap=new WeakMap,void(this.iframeRemoteIdToIdMap=new WeakMap);this.iframeIdToRemoteIdMap.delete(e),this.iframeRemoteIdToIdMap.delete(e)}getIdToRemoteIdMap(e){var t=this.iframeIdToRemoteIdMap.get(e);return t||(t=new Map,this.iframeIdToRemoteIdMap.set(e,t)),t}getRemoteIdToIdMap(e){var t=this.iframeRemoteIdToIdMap.get(e);return t||(t=new Map,this.iframeRemoteIdToIdMap.set(e,t)),t}}class pt{constructor(e){c(this,"iframes",new WeakMap),c(this,"crossOriginIframeMap",new WeakMap),c(this,"crossOriginIframeMirror",new ht(Z)),c(this,"crossOriginIframeStyleMirror"),c(this,"crossOriginIframeRootIdMap",new WeakMap),c(this,"mirror"),c(this,"mutationCb"),c(this,"wrappedEmit"),c(this,"loadListener"),c(this,"stylesheetManager"),c(this,"recordCrossOriginIframes"),this.mutationCb=e.mutationCb,this.wrappedEmit=e.wrappedEmit,this.stylesheetManager=e.stylesheetManager,this.recordCrossOriginIframes=e.recordCrossOriginIframes,this.crossOriginIframeStyleMirror=new ht(this.stylesheetManager.styleMirror.generateId.bind(this.stylesheetManager.styleMirror)),this.mirror=e.mirror,this.recordCrossOriginIframes&&window.addEventListener("message",this.handleMessage.bind(this))}addIframe(e){this.iframes.set(e,!0),e.contentWindow&&this.crossOriginIframeMap.set(e.contentWindow,e)}addLoadListener(e){this.loadListener=e}attachIframe(e,t){var n,r;this.mutationCb({adds:[{parentId:this.mirror.getId(e),nextId:null,node:t}],removes:[],texts:[],attributes:[],isAttachIframe:!0}),this.recordCrossOriginIframes&&(null==(n=e.contentWindow)||n.addEventListener("message",this.handleMessage.bind(this))),null==(r=this.loadListener)||r.call(this,e),e.contentDocument&&e.contentDocument.adoptedStyleSheets&&e.contentDocument.adoptedStyleSheets.length>0&&this.stylesheetManager.adoptStyleSheets(e.contentDocument.adoptedStyleSheets,this.mirror.getId(e.contentDocument))}handleMessage(e){var t=e;if("rrweb"===t.data.type&&t.origin===t.data.origin&&e.source){var n=this.crossOriginIframeMap.get(e.source);if(n){var r=this.transformCrossOriginEvent(n,t.data.event);r&&this.wrappedEmit(r,t.data.isCheckout)}}}transformCrossOriginEvent(e,t){var n;switch(t.type){case De.FullSnapshot:this.crossOriginIframeMirror.reset(e),this.crossOriginIframeStyleMirror.reset(e),this.replaceIdOnNode(t.data.node,e);var r=t.data.node.id;return this.crossOriginIframeRootIdMap.set(e,r),this.patchRootIdOnNode(t.data.node,r),{timestamp:t.timestamp,type:De.IncrementalSnapshot,data:{source:Be.Mutation,adds:[{parentId:this.mirror.getId(e),nextId:null,node:t.data.node}],removes:[],texts:[],attributes:[],isAttachIframe:!0}};case De.Meta:case De.Load:case De.DomContentLoaded:return!1;case De.Plugin:return t;case De.Custom:return this.replaceIds(t.data.payload,e,["id","parentId","previousId","nextId"]),t;case De.IncrementalSnapshot:switch(t.data.source){case Be.Mutation:return t.data.adds.forEach((t=>{this.replaceIds(t,e,["parentId","nextId","previousId"]),this.replaceIdOnNode(t.node,e);var n=this.crossOriginIframeRootIdMap.get(e);n&&this.patchRootIdOnNode(t.node,n)})),t.data.removes.forEach((t=>{this.replaceIds(t,e,["parentId","id"])})),t.data.attributes.forEach((t=>{this.replaceIds(t,e,["id"])})),t.data.texts.forEach((t=>{this.replaceIds(t,e,["id"])})),t;case Be.Drag:case Be.TouchMove:case Be.MouseMove:return t.data.positions.forEach((t=>{this.replaceIds(t,e,["id"])})),t;case Be.ViewportResize:return!1;case Be.MediaInteraction:case Be.MouseInteraction:case Be.Scroll:case Be.CanvasMutation:case Be.Input:return this.replaceIds(t.data,e,["id"]),t;case Be.StyleSheetRule:case Be.StyleDeclaration:return this.replaceIds(t.data,e,["id"]),this.replaceStyleIds(t.data,e,["styleId"]),t;case Be.Font:return t;case Be.Selection:return t.data.ranges.forEach((t=>{this.replaceIds(t,e,["start","end"])})),t;case Be.AdoptedStyleSheet:return this.replaceIds(t.data,e,["id"]),this.replaceStyleIds(t.data,e,["styleIds"]),null==(n=t.data.styles)||n.forEach((t=>{this.replaceStyleIds(t,e,["styleId"])})),t}}return!1}replace(e,t,n,r){for(var i of r)(Array.isArray(t[i])||"number"==typeof t[i])&&(Array.isArray(t[i])?t[i]=e.getIds(n,t[i]):t[i]=e.getId(n,t[i]));return t}replaceIds(e,t,n){return this.replace(this.crossOriginIframeMirror,e,t,n)}replaceStyleIds(e,t,n){return this.replace(this.crossOriginIframeStyleMirror,e,t,n)}replaceIdOnNode(e,t){this.replaceIds(e,t,["id","rootId"]),"childNodes"in e&&e.childNodes.forEach((e=>{this.replaceIdOnNode(e,t)}))}patchRootIdOnNode(e,t){e.type===h.Document||e.rootId||(e.rootId=t),"childNodes"in e&&e.childNodes.forEach((e=>{this.patchRootIdOnNode(e,t)}))}}class vt{constructor(e){c(this,"shadowDoms",new WeakSet),c(this,"mutationCb"),c(this,"scrollCb"),c(this,"bypassOptions"),c(this,"mirror"),c(this,"restoreHandlers",[]),this.mutationCb=e.mutationCb,this.scrollCb=e.scrollCb,this.bypassOptions=e.bypassOptions,this.mirror=e.mirror,this.init()}init(){this.reset(),this.patchAttachShadow(Element,document)}addShadowRoot(e,n){if(I(e)&&!this.shadowDoms.has(e)){this.shadowDoms.add(e);var r=tt(t(t({},this.bypassOptions),{},{doc:n,mutationCb:this.mutationCb,mirror:this.mirror,shadowDomManager:this}),e);this.restoreHandlers.push((()=>r.disconnect())),this.restoreHandlers.push(rt(t(t({},this.bypassOptions),{},{scrollCb:this.scrollCb,doc:e,mirror:this.mirror}))),setTimeout((()=>{e.adoptedStyleSheets&&e.adoptedStyleSheets.length>0&&this.bypassOptions.stylesheetManager.adoptStyleSheets(e.adoptedStyleSheets,this.mirror.getId(ve.host(e))),this.restoreHandlers.push(lt({mirror:this.mirror,stylesheetManager:this.bypassOptions.stylesheetManager},e))}),0)}}observeAttachShadow(e){e.contentWindow&&e.contentDocument&&this.patchAttachShadow(e.contentWindow.Element,e.contentDocument)}patchAttachShadow(e,t){var n=this;this.restoreHandlers.push(be(e.prototype,"attachShadow",(function(e){return function(r){var i=e.call(this,r),o=ve.shadowRoot(this);return o&&Le(this)&&n.addShadowRoot(o,t),i}})))}reset(){this.restoreHandlers.forEach((e=>{try{e()}catch(e){}})),this.restoreHandlers=[],this.shadowDoms=new WeakSet}}for(var gt="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",ft="undefined"==typeof Uint8Array?[]:new Uint8Array(256),mt=0;mt<64;mt++)ft[gt.charCodeAt(mt)]=mt;var _t=new Map;var yt=(e,t,n)=>{if(e&&(St(e,t)||"object"==typeof e)){var r=function(e,t){var n=_t.get(e);return n||(n=new Map,_t.set(e,n)),n.has(t)||n.set(t,[]),n.get(t)}(n,e.constructor.name),i=r.indexOf(e);return-1===i&&(i=r.length,r.push(e)),i}};function bt(e,t,n){if(e instanceof Array)return e.map((e=>bt(e,t,n)));if(null===e)return e;if(e instanceof Float32Array||e instanceof Float64Array||e instanceof Int32Array||e instanceof Uint32Array||e instanceof Uint8Array||e instanceof Uint16Array||e instanceof Int16Array||e instanceof Int8Array||e instanceof Uint8ClampedArray)return{rr_type:e.constructor.name,args:[Object.values(e)]};if(e instanceof ArrayBuffer)return{rr_type:e.constructor.name,base64:function(e){var t,n=new Uint8Array(e),r=n.length,i="";for(t=0;t<r;t+=3)i+=gt[n[t]>>2],i+=gt[(3&n[t])<<4|n[t+1]>>4],i+=gt[(15&n[t+1])<<2|n[t+2]>>6],i+=gt[63&n[t+2]];return r%3==2?i=i.substring(0,i.length-1)+"=":r%3==1&&(i=i.substring(0,i.length-2)+"=="),i}(e)};if(e instanceof DataView)return{rr_type:e.constructor.name,args:[bt(e.buffer,t,n),e.byteOffset,e.byteLength]};if(e instanceof HTMLImageElement){var r=e.constructor.name,{src:i}=e;return{rr_type:r,src:i}}if(e instanceof HTMLCanvasElement){return{rr_type:"HTMLImageElement",src:e.toDataURL()}}return e instanceof ImageData?{rr_type:e.constructor.name,args:[bt(e.data,t,n),e.width,e.height]}:St(e,t)||"object"==typeof e?{rr_type:e.constructor.name,index:yt(e,t,n)}:e}var wt=(e,t,n)=>e.map((e=>bt(e,t,n))),St=(e,t)=>{var n=["WebGLActiveInfo","WebGLBuffer","WebGLFramebuffer","WebGLProgram","WebGLRenderbuffer","WebGLShader","WebGLShaderPrecisionFormat","WebGLTexture","WebGLUniformLocation","WebGLVertexArrayObject","WebGLVertexArrayObjectOES"].filter((e=>"function"==typeof t[e]));return Boolean(n.find((n=>e instanceof t[n])))};function Ct(e,t,n,r){var i=[];try{var o=be(e.HTMLCanvasElement.prototype,"getContext",(function(e){return function(i){for(var o=arguments.length,s=new Array(o>1?o-1:0),a=1;a<o;a++)s[a-1]=arguments[a];if(!Ee(this,t,n,!0)){var l=function(e){return"experimental-webgl"===e?"webgl":e}(i);if("__context"in this||(this.__context=l),r&&["webgl","webgl2"].includes(l))if(s[0]&&"object"==typeof s[0]){var c=s[0];c.preserveDrawingBuffer||(c.preserveDrawingBuffer=!0)}else s.splice(0,1,{preserveDrawingBuffer:!0})}return e.apply(this,[i,...s])}}));i.push(o)}catch(e){console.error("failed to patch HTMLCanvasElement.prototype.getContext")}return()=>{i.forEach((e=>e()))}}function It(e,t,n,r,i,o){var s=[],a=Object.getOwnPropertyNames(e),l=function(a){if(["isContextLost","canvas","drawingBufferWidth","drawingBufferHeight"].includes(a))return"continue";try{if("function"!=typeof e[a])return"continue";var l=be(e,a,(function(e){return function(){for(var s=arguments.length,l=new Array(s),c=0;c<s;c++)l[c]=arguments[c];var u=e.apply(this,l);if(yt(u,o,this),"tagName"in this.canvas&&!Ee(this.canvas,r,i,!0)){var d=wt(l,o,this),h={type:t,property:a,args:d};n(this.canvas,h)}return u}}));s.push(l)}catch(r){var c=ye(e,a,{set(e){n(this.canvas,{type:t,property:a,args:[e],setter:!0})}});s.push(c)}};for(var c of a)l(c);return s}var kt,Et,xt,Tt,Mt="KGZ1bmN0aW9uKCkgewogICJ1c2Ugc3RyaWN0IjsKICB2YXIgY2hhcnMgPSAiQUJDREVGR0hJSktMTU5PUFFSU1RVVldYWVphYmNkZWZnaGlqa2xtbm9wcXJzdHV2d3h5ejAxMjM0NTY3ODkrLyI7CiAgdmFyIGxvb2t1cCA9IHR5cGVvZiBVaW50OEFycmF5ID09PSAidW5kZWZpbmVkIiA/IFtdIDogbmV3IFVpbnQ4QXJyYXkoMjU2KTsKICBmb3IgKHZhciBpID0gMDsgaSA8IGNoYXJzLmxlbmd0aDsgaSsrKSB7CiAgICBsb29rdXBbY2hhcnMuY2hhckNvZGVBdChpKV0gPSBpOwogIH0KICB2YXIgZW5jb2RlID0gZnVuY3Rpb24oYXJyYXlidWZmZXIpIHsKICAgIHZhciBieXRlcyA9IG5ldyBVaW50OEFycmF5KGFycmF5YnVmZmVyKSwgaTIsIGxlbiA9IGJ5dGVzLmxlbmd0aCwgYmFzZTY0ID0gIiI7CiAgICBmb3IgKGkyID0gMDsgaTIgPCBsZW47IGkyICs9IDMpIHsKICAgICAgYmFzZTY0ICs9IGNoYXJzW2J5dGVzW2kyXSA+PiAyXTsKICAgICAgYmFzZTY0ICs9IGNoYXJzWyhieXRlc1tpMl0gJiAzKSA8PCA0IHwgYnl0ZXNbaTIgKyAxXSA+PiA0XTsKICAgICAgYmFzZTY0ICs9IGNoYXJzWyhieXRlc1tpMiArIDFdICYgMTUpIDw8IDIgfCBieXRlc1tpMiArIDJdID4+IDZdOwogICAgICBiYXNlNjQgKz0gY2hhcnNbYnl0ZXNbaTIgKyAyXSAmIDYzXTsKICAgIH0KICAgIGlmIChsZW4gJSAzID09PSAyKSB7CiAgICAgIGJhc2U2NCA9IGJhc2U2NC5zdWJzdHJpbmcoMCwgYmFzZTY0Lmxlbmd0aCAtIDEpICsgIj0iOwogICAgfSBlbHNlIGlmIChsZW4gJSAzID09PSAxKSB7CiAgICAgIGJhc2U2NCA9IGJhc2U2NC5zdWJzdHJpbmcoMCwgYmFzZTY0Lmxlbmd0aCAtIDIpICsgIj09IjsKICAgIH0KICAgIHJldHVybiBiYXNlNjQ7CiAgfTsKICBjb25zdCBsYXN0QmxvYk1hcCA9IC8qIEBfX1BVUkVfXyAqLyBuZXcgTWFwKCk7CiAgY29uc3QgdHJhbnNwYXJlbnRCbG9iTWFwID0gLyogQF9fUFVSRV9fICovIG5ldyBNYXAoKTsKICBhc3luYyBmdW5jdGlvbiBnZXRUcmFuc3BhcmVudEJsb2JGb3Iod2lkdGgsIGhlaWdodCwgZGF0YVVSTE9wdGlvbnMpIHsKICAgIGNvbnN0IGlkID0gYCR7d2lkdGh9LSR7aGVpZ2h0fWA7CiAgICBpZiAoIk9mZnNjcmVlbkNhbnZhcyIgaW4gZ2xvYmFsVGhpcykgewogICAgICBpZiAodHJhbnNwYXJlbnRCbG9iTWFwLmhhcyhpZCkpIHJldHVybiB0cmFuc3BhcmVudEJsb2JNYXAuZ2V0KGlkKTsKICAgICAgY29uc3Qgb2Zmc2NyZWVuID0gbmV3IE9mZnNjcmVlbkNhbnZhcyh3aWR0aCwgaGVpZ2h0KTsKICAgICAgb2Zmc2NyZWVuLmdldENvbnRleHQoIjJkIik7CiAgICAgIGNvbnN0IGJsb2IgPSBhd2FpdCBvZmZzY3JlZW4uY29udmVydFRvQmxvYihkYXRhVVJMT3B0aW9ucyk7CiAgICAgIGNvbnN0IGFycmF5QnVmZmVyID0gYXdhaXQgYmxvYi5hcnJheUJ1ZmZlcigpOwogICAgICBjb25zdCBiYXNlNjQgPSBlbmNvZGUoYXJyYXlCdWZmZXIpOwogICAgICB0cmFuc3BhcmVudEJsb2JNYXAuc2V0KGlkLCBiYXNlNjQpOwogICAgICByZXR1cm4gYmFzZTY0OwogICAgfSBlbHNlIHsKICAgICAgcmV0dXJuICIiOwogICAgfQogIH0KICBjb25zdCB3b3JrZXIgPSBzZWxmOwogIHdvcmtlci5vbm1lc3NhZ2UgPSBhc3luYyBmdW5jdGlvbihlKSB7CiAgICBpZiAoIk9mZnNjcmVlbkNhbnZhcyIgaW4gZ2xvYmFsVGhpcykgewogICAgICBjb25zdCB7IGlkLCBiaXRtYXAsIHdpZHRoLCBoZWlnaHQsIGRhdGFVUkxPcHRpb25zIH0gPSBlLmRhdGE7CiAgICAgIGNvbnN0IHRyYW5zcGFyZW50QmFzZTY0ID0gZ2V0VHJhbnNwYXJlbnRCbG9iRm9yKAogICAgICAgIHdpZHRoLAogICAgICAgIGhlaWdodCwKICAgICAgICBkYXRhVVJMT3B0aW9ucwogICAgICApOwogICAgICBjb25zdCBvZmZzY3JlZW4gPSBuZXcgT2Zmc2NyZWVuQ2FudmFzKHdpZHRoLCBoZWlnaHQpOwogICAgICBjb25zdCBjdHggPSBvZmZzY3JlZW4uZ2V0Q29udGV4dCgiMmQiKTsKICAgICAgY3R4LmRyYXdJbWFnZShiaXRtYXAsIDAsIDApOwogICAgICBiaXRtYXAuY2xvc2UoKTsKICAgICAgY29uc3QgYmxvYiA9IGF3YWl0IG9mZnNjcmVlbi5jb252ZXJ0VG9CbG9iKGRhdGFVUkxPcHRpb25zKTsKICAgICAgY29uc3QgdHlwZSA9IGJsb2IudHlwZTsKICAgICAgY29uc3QgYXJyYXlCdWZmZXIgPSBhd2FpdCBibG9iLmFycmF5QnVmZmVyKCk7CiAgICAgIGNvbnN0IGJhc2U2NCA9IGVuY29kZShhcnJheUJ1ZmZlcik7CiAgICAgIGlmICghbGFzdEJsb2JNYXAuaGFzKGlkKSAmJiBhd2FpdCB0cmFuc3BhcmVudEJhc2U2NCA9PT0gYmFzZTY0KSB7CiAgICAgICAgbGFzdEJsb2JNYXAuc2V0KGlkLCBiYXNlNjQpOwogICAgICAgIHJldHVybiB3b3JrZXIucG9zdE1lc3NhZ2UoeyBpZCB9KTsKICAgICAgfQogICAgICBpZiAobGFzdEJsb2JNYXAuZ2V0KGlkKSA9PT0gYmFzZTY0KSByZXR1cm4gd29ya2VyLnBvc3RNZXNzYWdlKHsgaWQgfSk7CiAgICAgIHdvcmtlci5wb3N0TWVzc2FnZSh7CiAgICAgICAgaWQsCiAgICAgICAgdHlwZSwKICAgICAgICBiYXNlNjQsCiAgICAgICAgd2lkdGgsCiAgICAgICAgaGVpZ2h0CiAgICAgIH0pOwogICAgICBsYXN0QmxvYk1hcC5zZXQoaWQsIGJhc2U2NCk7CiAgICB9IGVsc2UgewogICAgICByZXR1cm4gd29ya2VyLnBvc3RNZXNzYWdlKHsgaWQ6IGUuZGF0YS5pZCB9KTsKICAgIH0KICB9Owp9KSgpOwovLyMgc291cmNlTWFwcGluZ1VSTD1pbWFnZS1iaXRtYXAtZGF0YS11cmwtd29ya2VyLUlKcEM3Z19iLmpzLm1hcAo=",Rt="undefined"!=typeof window&&window.Blob&&new Blob([(kt=Mt,Uint8Array.from(atob(kt),(e=>e.charCodeAt(0))))],{type:"text/javascript;charset=utf-8"});function At(e){var t;try{if(!(t=Rt&&(window.URL||window.webkitURL).createObjectURL(Rt)))throw"";var n=new Worker(t,{name:null==e?void 0:e.name});return n.addEventListener("error",(()=>{(window.URL||window.webkitURL).revokeObjectURL(t)})),n}catch(t){return new Worker("data:text/javascript;base64,"+Mt,{name:null==e?void 0:e.name})}finally{t&&(window.URL||window.webkitURL).revokeObjectURL(t)}}class Nt{constructor(e){c(this,"pendingCanvasMutations",new Map),c(this,"rafStamps",{latestId:0,invokeId:null}),c(this,"mirror"),c(this,"mutationCb"),c(this,"resetObservers"),c(this,"frozen",!1),c(this,"locked",!1),c(this,"processMutation",((e,t)=>{!(this.rafStamps.invokeId&&this.rafStamps.latestId!==this.rafStamps.invokeId)&&this.rafStamps.invokeId||(this.rafStamps.invokeId=this.rafStamps.latestId),this.pendingCanvasMutations.has(e)||this.pendingCanvasMutations.set(e,[]),this.pendingCanvasMutations.get(e).push(t)}));var{sampling:t="all",win:n,blockClass:r,blockSelector:i,recordCanvas:o,dataURLOptions:s}=e;this.mutationCb=e.mutationCb,this.mirror=e.mirror,o&&"all"===t&&this.initCanvasMutationObserver(n,r,i),o&&"number"==typeof t&&this.initCanvasFPSObserver(t,n,r,i,{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(e,t,n,i,o){var s=this,a=Ct(t,n,i,!0),l=new Map,c=new At;c.onmessage=e=>{var{id:t}=e.data;if(l.set(t,!1),"base64"in e.data){var{base64:n,type:r,width:i,height:o}=e.data;this.mutationCb({id:t,type:$e["2D"],commands:[{property:"clearRect",args:[0,0,i,o]},{property:"drawImage",args:[{rr_type:"ImageBitmap",args:[{rr_type:"Blob",data:[{rr_type:"ArrayBuffer",base64:n}],type:r}]},0,0]}]})}};var u,d=1e3/e,h=0,p=e=>{var a,v;h&&e-h<d?u=requestAnimationFrame(p):(h=e,(a=[],v=e=>{e.querySelectorAll("canvas").forEach((e=>{Ee(e,n,i,!0)||a.push(e)})),e.querySelectorAll("*").forEach((e=>{e.shadowRoot&&v(e.shadowRoot)}))},v(t.document),a).forEach(function(){var e=r((function*(e){var t,n=s.mirror.getId(e);if(!l.get(n)&&0!==e.width&&0!==e.height){if(l.set(n,!0),["webgl","webgl2"].includes(e.__context)){var r=e.getContext(e.__context);!1===(null==(t=null==r?void 0:r.getContextAttributes())?void 0:t.preserveDrawingBuffer)&&r.clear(r.COLOR_BUFFER_BIT)}var i=e.clientWidth||e.width,a=e.clientHeight||e.height,u=yield createImageBitmap(e,{resizeWidth:i,resizeHeight:a});c.postMessage({id:n,bitmap:u,width:i,height:a,dataURLOptions:o.dataURLOptions},[u])}}));return function(t){return e.apply(this,arguments)}}()),u=requestAnimationFrame(p))};u=requestAnimationFrame(p),this.resetObservers=()=>{a(),cancelAnimationFrame(u)}}initCanvasMutationObserver(e,t,n){this.startRAFTimestamping(),this.startPendingCanvasMutationFlusher();var r=Ct(e,t,n,!1),i=function(e,t,n,r){var i=[],o=Object.getOwnPropertyNames(t.CanvasRenderingContext2D.prototype),s=function(o){try{if("function"!=typeof t.CanvasRenderingContext2D.prototype[o])return"continue";var s=be(t.CanvasRenderingContext2D.prototype,o,(function(i){return function(){for(var s=arguments.length,a=new Array(s),l=0;l<s;l++)a[l]=arguments[l];return Ee(this.canvas,n,r,!0)||setTimeout((()=>{var n=wt(a,t,this);e(this.canvas,{type:$e["2D"],property:o,args:n})}),0),i.apply(this,a)}}));i.push(s)}catch(n){var a=ye(t.CanvasRenderingContext2D.prototype,o,{set(t){e(this.canvas,{type:$e["2D"],property:o,args:[t],setter:!0})}});i.push(a)}};for(var a of o)s(a);return()=>{i.forEach((e=>e()))}}(this.processMutation.bind(this),e,t,n),o=function(e,t,n,r){var i=[];return i.push(...It(t.WebGLRenderingContext.prototype,$e.WebGL,e,n,r,t)),void 0!==t.WebGL2RenderingContext&&i.push(...It(t.WebGL2RenderingContext.prototype,$e.WebGL2,e,n,r,t)),()=>{i.forEach((e=>e()))}}(this.processMutation.bind(this),e,t,n);this.resetObservers=()=>{r(),i(),o()}}startPendingCanvasMutationFlusher(){requestAnimationFrame((()=>this.flushPendingCanvasMutations()))}startRAFTimestamping(){var e=t=>{this.rafStamps.latestId=t,requestAnimationFrame(e)};requestAnimationFrame(e)}flushPendingCanvasMutations(){this.pendingCanvasMutations.forEach(((e,t)=>{var n=this.mirror.getId(t);this.flushPendingCanvasMutationFor(t,n)})),requestAnimationFrame((()=>this.flushPendingCanvasMutations()))}flushPendingCanvasMutationFor(e,t){if(!this.frozen&&!this.locked){var n=this.pendingCanvasMutations.get(e);if(n&&-1!==t){var r=n.map((e=>o(e,a))),{type:i}=n[0];this.mutationCb({id:t,type:i,commands:r}),this.pendingCanvasMutations.delete(e)}}}}class Ft{constructor(e){c(this,"trackedLinkElements",new WeakSet),c(this,"mutationCb"),c(this,"adoptedStyleSheetCb"),c(this,"styleMirror",new Fe),this.mutationCb=e.mutationCb,this.adoptedStyleSheetCb=e.adoptedStyleSheetCb}attachLinkElement(e,t){"_cssText"in t.attributes&&this.mutationCb({adds:[],removes:[],texts:[],attributes:[{id:t.id,attributes:t.attributes}]}),this.trackLinkElement(e)}trackLinkElement(e){this.trackedLinkElements.has(e)||(this.trackedLinkElements.add(e),this.trackStylesheetInLinkElement(e))}adoptStyleSheets(e,t){var n=this;if(0!==e.length){var r={id:t,styleIds:[]},i=[],o=function(e){var t=void 0;n.styleMirror.has(e)?t=n.styleMirror.getId(e):(t=n.styleMirror.add(e),i.push({styleId:t,rules:Array.from(e.rules||CSSRule,((t,n)=>({rule:E(t,e.href),index:n})))})),r.styleIds.push(t)};for(var s of e)o(s);i.length>0&&(r.styles=i),this.adoptedStyleSheetCb(r)}}reset(){this.styleMirror.reset(),this.trackedLinkElements=new WeakSet}trackStylesheetInLinkElement(e){}}class Ot{constructor(){c(this,"nodeMap",new WeakMap),c(this,"active",!1)}inOtherBuffer(e,t){var n=this.nodeMap.get(e);return n&&Array.from(n).some((e=>e!==t))}add(e,t){this.active||(this.active=!0,requestAnimationFrame((()=>{this.nodeMap=new WeakMap,this.active=!1}))),this.nodeMap.set(e,(this.nodeMap.get(e)||new Set).add(t))}destroy(){}}var Pt=!1;try{if(2!==Array.from([1],(e=>2*e))[0]){var Lt=document.createElement("iframe");document.body.appendChild(Lt),Array.from=(null==(s=Lt.contentWindow)?void 0:s.Array.from)||Array.from,document.body.removeChild(Lt)}}catch(e){console.debug("Unable to override Array.from",e)}var Dt,Bt,Ht=new T;function qt(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},{emit:n,checkoutEveryNms:r,checkoutEveryNth:i,blockClass:o="rr-block",blockSelector:s=null,ignoreClass:a="rr-ignore",ignoreSelector:l=null,maskTextClass:c="rr-mask",maskTextSelector:u=null,inlineStylesheet:d=!0,maskAllInputs:h,maskInputOptions:p,slimDOMOptions:v,maskInputFn:g,maskTextFn:f,hooks:m,packFn:_,sampling:y={},dataURLOptions:b={},mousemoveWait:w,recordDOM:S=!0,recordCanvas:C=!1,recordCrossOriginIframes:I=!1,recordAfter:k=("DOMContentLoaded"===e.recordAfter?e.recordAfter:"load"),userTriggeredOnInput:E=!1,collectFonts:x=!1,inlineImages:M=!1,plugins:R,keepIframeSrcFn:A=(()=>!1),ignoreCSSAttributes:N=new Set([]),errorHandler:F}=e;Ge=F;var O=!I||window.parent===window,P=!1;if(!O)try{window.parent.document&&(P=!1)}catch(e){P=!0}if(O&&!n)throw new Error("emit function is required");if(!O&&!P)return()=>{};void 0!==w&&void 0===y.mousemove&&(y.mousemove=w),Ht.reset();var L,D=!0===h?{color:!0,date:!0,"datetime-local":!0,email:!0,month:!0,number:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0,textarea:!0,select:!0,password:!0}:void 0!==p?p:{password:!0},B=!0===v||"all"===v?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaVerification:!0,headMetaAuthorship:"all"===v,headMetaDescKeywords:"all"===v,headTitleMutations:"all"===v}:v||{};!function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:window;"NodeList"in e&&!e.NodeList.prototype.forEach&&(e.NodeList.prototype.forEach=Array.prototype.forEach),"DOMTokenList"in e&&!e.DOMTokenList.prototype.forEach&&(e.DOMTokenList.prototype.forEach=Array.prototype.forEach)}();var H=0,q=e=>{for(var t of R||[])t.eventProcessor&&(e=t.eventProcessor(e));return _&&!P&&(e=_(e)),e};Et=(e,t)=>{var o,s=e;if(s.timestamp=we(),!(null==(o=Qe[0])?void 0:o.isFrozen())||s.type===De.FullSnapshot||s.type===De.IncrementalSnapshot&&s.data.source===Be.Mutation||Qe.forEach((e=>e.unfreeze())),O)null==n||n(q(s),t);else if(P){var a={type:"rrweb",event:q(s),origin:window.location.origin,isCheckout:t};window.parent.postMessage(a,"*")}if(s.type===De.FullSnapshot)L=s,H=0;else if(s.type===De.IncrementalSnapshot){if(s.data.source===Be.Mutation&&s.data.isAttachIframe)return;H++;var l=i&&H>=i,c=r&&s.timestamp-L.timestamp>r;(l||c)&&xt(!0)}};var $=e=>{Et({type:De.IncrementalSnapshot,data:t({source:Be.Mutation},e)})},W=e=>Et({type:De.IncrementalSnapshot,data:t({source:Be.Scroll},e)}),V=e=>Et({type:De.IncrementalSnapshot,data:t({source:Be.CanvasMutation},e)}),Z=new Ft({mutationCb:$,adoptedStyleSheetCb:e=>Et({type:De.IncrementalSnapshot,data:t({source:Be.AdoptedStyleSheet},e)})}),G=new pt({mirror:Ht,mutationCb:$,stylesheetManager:Z,recordCrossOriginIframes:I,wrappedEmit:Et});for(var U of R||[])U.getMirror&&U.getMirror({nodeMirror:Ht,crossOriginIframeMirror:G.crossOriginIframeMirror,crossOriginIframeStyleMirror:G.crossOriginIframeStyleMirror});var j=new Ot;Tt=new Nt({recordCanvas:C,mutationCb:V,win:window,blockClass:o,blockSelector:s,mirror:Ht,sampling:y.canvas,dataURLOptions:b});var z=new vt({mutationCb:$,scrollCb:W,bypassOptions:{blockClass:o,blockSelector:s,maskTextClass:c,maskTextSelector:u,inlineStylesheet:d,maskInputOptions:D,dataURLOptions:b,maskTextFn:f,maskInputFn:g,recordCanvas:C,inlineImages:M,sampling:y,slimDOMOptions:B,iframeManager:G,stylesheetManager:Z,canvasManager:Tt,keepIframeSrcFn:A,processedNodeManager:j},mirror:Ht});xt=function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(S){Et({type:De.Meta,data:{href:window.location.href,width:Ie(),height:Ce()}},e),Z.reset(),z.init(),Qe.forEach((e=>e.lock()));var t=function(e,t){var{mirror:n=new T,blockClass:r="rr-block",blockSelector:i=null,maskTextClass:o="rr-mask",maskTextSelector:s=null,inlineStylesheet:a=!0,inlineImages:l=!1,recordCanvas:c=!1,maskAllInputs:u=!1,maskTextFn:d,maskInputFn:h,slimDOM:p=!1,dataURLOptions:v,preserveWhiteSpace:g,onSerialize:f,onIframeLoad:m,iframeLoadTimeout:_,onStylesheetLoad:y,stylesheetLoadTimeout:b,keepIframeSrcFn:w=(()=>!1)}=t||{};return re(e,{doc:e,mirror:n,blockClass:r,blockSelector:i,maskTextClass:o,maskTextSelector:s,skipChild:!1,inlineStylesheet:a,maskInputOptions:!0===u?{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===u?{password:!0}:u,maskTextFn:d,maskInputFn:h,slimDOMOptions:!0===p||"all"===p?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaDescKeywords:"all"===p,headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaAuthorship:!0,headMetaVerification:!0}:!1===p?{}:p,dataURLOptions:v,inlineImages:l,recordCanvas:c,preserveWhiteSpace:g,onSerialize:f,onIframeLoad:m,iframeLoadTimeout:_,onStylesheetLoad:y,stylesheetLoadTimeout:b,keepIframeSrcFn:w,newlyAddedElement:!1})}(document,{mirror:Ht,blockClass:o,blockSelector:s,maskTextClass:c,maskTextSelector:u,inlineStylesheet:d,maskAllInputs:D,maskTextFn:f,maskInputFn:g,slimDOM:B,dataURLOptions:b,recordCanvas:C,inlineImages:M,onSerialize:e=>{Re(e,Ht)&&G.addIframe(e),Ae(e,Ht)&&Z.trackLinkElement(e),Ne(e)&&z.addShadowRoot(ve.shadowRoot(e),document)},onIframeLoad:(e,t)=>{G.attachIframe(e,t),z.observeAttachShadow(e)},onStylesheetLoad:(e,t)=>{Z.attachLinkElement(e,t)},keepIframeSrcFn:A});if(!t)return console.warn("Failed to snapshot the document");Et({type:De.FullSnapshot,data:{node:t,initialOffset:Se(window)}},e),Qe.forEach((e=>e.unlock())),document.adoptedStyleSheets&&document.adoptedStyleSheets.length>0&&Z.adoptStyleSheets(document.adoptedStyleSheets,Ht.getId(document))}};try{var Y=[],X=e=>{var n;return Ke(ct)({mutationCb:$,mousemoveCb:(e,t)=>Et({type:De.IncrementalSnapshot,data:{source:t,positions:e}}),mouseInteractionCb:e=>Et({type:De.IncrementalSnapshot,data:t({source:Be.MouseInteraction},e)}),scrollCb:W,viewportResizeCb:e=>Et({type:De.IncrementalSnapshot,data:t({source:Be.ViewportResize},e)}),inputCb:e=>Et({type:De.IncrementalSnapshot,data:t({source:Be.Input},e)}),mediaInteractionCb:e=>Et({type:De.IncrementalSnapshot,data:t({source:Be.MediaInteraction},e)}),styleSheetRuleCb:e=>Et({type:De.IncrementalSnapshot,data:t({source:Be.StyleSheetRule},e)}),styleDeclarationCb:e=>Et({type:De.IncrementalSnapshot,data:t({source:Be.StyleDeclaration},e)}),canvasMutationCb:V,fontCb:e=>Et({type:De.IncrementalSnapshot,data:t({source:Be.Font},e)}),selectionCb:e=>{Et({type:De.IncrementalSnapshot,data:t({source:Be.Selection},e)})},customElementCb:e=>{Et({type:De.IncrementalSnapshot,data:t({source:Be.CustomElement},e)})},blockClass:o,ignoreClass:a,ignoreSelector:l,maskTextClass:c,maskTextSelector:u,maskInputOptions:D,inlineStylesheet:d,sampling:y,recordDOM:S,recordCanvas:C,inlineImages:M,userTriggeredOnInput:E,collectFonts:x,doc:e,maskInputFn:g,maskTextFn:f,keepIframeSrcFn:A,blockSelector:s,slimDOMOptions:B,dataURLOptions:b,mirror:Ht,iframeManager:G,stylesheetManager:Z,shadowDomManager:z,processedNodeManager:j,canvasManager:Tt,ignoreCSSAttributes:N,plugins:(null==(n=null==R?void 0:R.filter((e=>e.observer)))?void 0:n.map((e=>({observer:e.observer,options:e.options,callback:t=>Et({type:De.Plugin,data:{plugin:e.name,payload:t}})}))))||[]},m)};G.addLoadListener((e=>{try{Y.push(X(e.contentDocument))}catch(e){console.warn(e)}}));var J=()=>{xt(),Y.push(X(document)),Pt=!0};return"interactive"===document.readyState||"complete"===document.readyState?J():(Y.push(ge("DOMContentLoaded",(()=>{Et({type:De.DomContentLoaded,data:{}}),"DOMContentLoaded"===k&&J()}))),Y.push(ge("load",(()=>{Et({type:De.Load,data:{}}),"load"===k&&J()}),window))),()=>{Y.forEach((e=>e())),j.destroy(),Pt=!1,Ge=void 0}}catch(e){console.warn(e)}}qt.addCustomEvent=(e,t)=>{if(!Pt)throw new Error("please add custom event after start recording");Et({type:De.Custom,data:{tag:e,payload:t}})},qt.freezePage=()=>{Qe.forEach((e=>e.freeze()))},qt.takeFullSnapshot=e=>{if(!Pt)throw new Error("please take full snapshot after start recording");xt(e)},qt.mirror=Ht,(Bt=Dt||(Dt={}))[Bt.NotStarted=0]="NotStarted",Bt[Bt.Running=1]="Running",Bt[Bt.Stopped=2]="Stopped";var $t,Wt=Object.defineProperty,Vt=(e,t,n)=>((e,t,n)=>t in e?Wt(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n)(e,"symbol"!=typeof t?t+"":t,n),Zt=Object.defineProperty,Gt=(e,t,n)=>((e,t,n)=>t in e?Zt(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n)(e,"symbol"!=typeof t?t+"":t,n),Ut=Object.defineProperty,jt=(e,t,n)=>((e,t,n)=>t in e?Ut(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n)(e,"symbol"!=typeof t?t+"":t,n),zt={Node:["childNodes","parentNode","parentElement","textContent"],ShadowRoot:["host","styleSheets"],Element:["shadowRoot","querySelector","querySelectorAll"],MutationObserver:[]},Yt={Node:["contains","getRootNode"],ShadowRoot:["getSelection"],Element:[],MutationObserver:["constructor"]},Xt={};function Jt(e){if(Xt[e])return Xt[e];var t=globalThis[e],n=t.prototype,r=e in zt?zt[e]:void 0,i=Boolean(r&&r.every((e=>{var t,r;return Boolean(null==(r=null==(t=Object.getOwnPropertyDescriptor(n,e))?void 0:t.get)?void 0:r.toString().includes("[native code]"))}))),o=e in Yt?Yt[e]:void 0,s=Boolean(o&&o.every((e=>{var t;return"function"==typeof n[e]&&(null==(t=n[e])?void 0:t.toString().includes("[native code]"))})));if(i&&s)return Xt[e]=t.prototype,t.prototype;try{var a=document.createElement("iframe");document.body.appendChild(a);var l=a.contentWindow;if(!l)return t.prototype;var c=l[e].prototype;return document.body.removeChild(a),c?Xt[e]=c:n}catch(e){return n}}var Kt={};function Qt(e,t,n){var r,i="".concat(e,".").concat(String(n));if(Kt[i])return Kt[i].call(t);var o=Jt(e),s=null==(r=Object.getOwnPropertyDescriptor(o,n))?void 0:r.get;return s?(Kt[i]=s,s.call(t)):t[n]}var en={};function tn(e,t,n){var r="".concat(e,".").concat(String(n));if(en[r])return en[r].bind(t);var i=Jt(e)[n];return"function"!=typeof i?t[n]:(en[r]=i,i.bind(t))}var nn={childNodes:function(e){return Qt("Node",e,"childNodes")},parentNode:function(e){return Qt("Node",e,"parentNode")},parentElement:function(e){return Qt("Node",e,"parentElement")},textContent:function(e){return Qt("Node",e,"textContent")},contains:function(e,t){return tn("Node",e,"contains")(t)},getRootNode:function(e){return tn("Node",e,"getRootNode")()},host:function(e){return e&&"host"in e?Qt("ShadowRoot",e,"host"):null},styleSheets:function(e){return e.styleSheets},shadowRoot:function(e){return e&&"shadowRoot"in e?Qt("Element",e,"shadowRoot"):null},querySelector:function(e,t){return Qt("Element",e,"querySelector")(t)},querySelectorAll:function(e,t){return Qt("Element",e,"querySelectorAll")(t)},mutationObserver:function(){return Jt("MutationObserver").constructor}};class rn{constructor(){jt(this,"idNodeMap",new Map),jt(this,"nodeMetaMap",new WeakMap)}getId(e){var t;if(!e)return-1;var n=null==(t=this.getMeta(e))?void 0:t.id;return null!=n?n:-1}getNode(e){return this.idNodeMap.get(e)||null}getIds(){return Array.from(this.idNodeMap.keys())}getMeta(e){return this.nodeMetaMap.get(e)||null}removeNodeFromMap(e){var t=this.getId(e);this.idNodeMap.delete(t),e.childNodes&&e.childNodes.forEach((e=>this.removeNodeFromMap(e)))}has(e){return this.idNodeMap.has(e)}hasNode(e){return this.nodeMetaMap.has(e)}add(e,t){var n=t.id;this.idNodeMap.set(n,e),this.nodeMetaMap.set(e,t)}replace(e,t){var n=this.getNode(e);if(n){var r=this.nodeMetaMap.get(n);r&&this.nodeMetaMap.set(t,r)}this.idNodeMap.set(e,t)}reset(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap}}function on(e,t,n){if(!e)return!1;if(e.nodeType!==e.ELEMENT_NODE)return!!n&&on(nn.parentNode(e),t,n);for(var r=e.classList.length;r--;){var i=e.classList[r];if(t.test(i))return!0}return!!n&&on(nn.parentNode(e),t,n)}class sn{constructor(){__publicField22(this,"parentElement",null),__publicField22(this,"parentNode",null),__publicField22(this,"ownerDocument"),__publicField22(this,"firstChild",null),__publicField22(this,"lastChild",null),__publicField22(this,"previousSibling",null),__publicField22(this,"nextSibling",null),__publicField22(this,"ELEMENT_NODE",1),__publicField22(this,"TEXT_NODE",3),__publicField22(this,"nodeType"),__publicField22(this,"nodeName"),__publicField22(this,"RRNodeType")}get childNodes(){for(var e=[],t=this.firstChild;t;)e.push(t),t=t.nextSibling;return e}contains(e){if(!(e instanceof sn))return!1;if(e.ownerDocument!==this.ownerDocument)return!1;if(e===this)return!0;for(;e.parentNode;){if(e.parentNode===this)return!0;e=e.parentNode}return!1}appendChild(e){throw new Error("RRDomException: Failed to execute 'appendChild' on 'RRNode': This RRNode type does not support this method.")}insertBefore(e,t){throw new Error("RRDomException: Failed to execute 'insertBefore' on 'RRNode': This RRNode type does not support this method.")}removeChild(e){throw new Error("RRDomException: Failed to execute 'removeChild' on 'RRNode': This RRNode type does not support this method.")}toString(){return"RRNode"}}var an={Node:["childNodes","parentNode","parentElement","textContent"],ShadowRoot:["host","styleSheets"],Element:["shadowRoot","querySelector","querySelectorAll"],MutationObserver:[]},ln={Node:["contains","getRootNode"],ShadowRoot:["getSelection"],Element:[],MutationObserver:["constructor"]},cn={};function un(e){if(cn[e])return cn[e];var t=globalThis[e],n=t.prototype,r=e in an?an[e]:void 0,i=Boolean(r&&r.every((e=>{var t,r;return Boolean(null==(r=null==(t=Object.getOwnPropertyDescriptor(n,e))?void 0:t.get)?void 0:r.toString().includes("[native code]"))}))),o=e in ln?ln[e]:void 0,s=Boolean(o&&o.every((e=>{var t;return"function"==typeof n[e]&&(null==(t=n[e])?void 0:t.toString().includes("[native code]"))})));if(i&&s)return cn[e]=t.prototype,t.prototype;try{var a=document.createElement("iframe");document.body.appendChild(a);var l=a.contentWindow;if(!l)return t.prototype;var c=l[e].prototype;return document.body.removeChild(a),c?cn[e]=c:n}catch(e){return n}}var dn={};function hn(e,t,n){var r,i="".concat(e,".").concat(String(n));if(dn[i])return dn[i].call(t);var o=un(e),s=null==(r=Object.getOwnPropertyDescriptor(o,n))?void 0:r.get;return s?(dn[i]=s,s.call(t)):t[n]}var pn={};function vn(e,t,n){var r="".concat(e,".").concat(String(n));if(pn[r])return pn[r].bind(t);var i=un(e)[n];return"function"!=typeof i?t[n]:(pn[r]=i,i.bind(t))}var gn={childNodes:function(e){return hn("Node",e,"childNodes")},parentNode:function(e){return hn("Node",e,"parentNode")},parentElement:function(e){return hn("Node",e,"parentElement")},textContent:function(e){return hn("Node",e,"textContent")},contains:function(e,t){return vn("Node",e,"contains")(t)},getRootNode:function(e){return vn("Node",e,"getRootNode")()},host:function(e){return e&&"host"in e?hn("ShadowRoot",e,"host"):null},styleSheets:function(e){return e.styleSheets},shadowRoot:function(e){return e&&"shadowRoot"in e?hn("Element",e,"shadowRoot"):null},querySelector:function(e,t){return hn("Element",e,"querySelector")(t)},querySelectorAll:function(e,t){return hn("Element",e,"querySelectorAll")(t)},mutationObserver:function(){return un("MutationObserver").constructor}};var fn="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.",mn={map:{},getId:()=>(console.error(fn),-1),getNode:()=>(console.error(fn),null),removeNodeFromMap(){console.error(fn)},has:()=>(console.error(fn),!1),reset(){console.error(fn)}};"undefined"!=typeof window&&window.Proxy&&window.Reflect&&(mn=new Proxy(mn,{get:(e,t,n)=>("map"===t&&console.error(fn),Reflect.get(e,t,n))}));var _n=Date.now;function yn(e){return e?e.nodeType===e.ELEMENT_NODE?e:gn.parentElement(e):null}/[1-9][0-9]{12}/.test(Date.now().toString())||(_n=()=>(new Date).getTime());function bn(e){var t,n=null;return"getRootNode"in e&&(null==(t=gn.getRootNode(e))?void 0:t.nodeType)===Node.DOCUMENT_FRAGMENT_NODE&&gn.host(gn.getRootNode(e))&&(n=gn.host(gn.getRootNode(e))),n}function wn(e){for(var t,n=e;t=bn(n);)n=t;return n}function Sn(e){var t=e.ownerDocument;if(!t)return!1;var n=wn(e);return gn.contains(t,n)}for(var Cn=Object.freeze(Object.defineProperty({__proto__:null,StyleSheetMirror:class{constructor(){Gt(this,"id",1),Gt(this,"styleIDMap",new WeakMap),Gt(this,"idStyleMap",new Map)}getId(e){var t;return null!==(t=this.styleIDMap.get(e))&&void 0!==t?t:-1}has(e){return this.styleIDMap.has(e)}add(e,t){return this.has(e)?this.getId(e):(n=void 0===t?this.id++:t,this.styleIDMap.set(e,n),this.idStyleMap.set(n,e),n);var n}getStyle(e){return this.idStyleMap.get(e)||null}reset(){this.styleIDMap=new WeakMap,this.idStyleMap=new Map,this.id=1}generateId(){return this.id++}},get _mirror(){return mn},closestElementOfNode:yn,getBaseDimension:function e(t,n){var r,i,o=null==(i=null==(r=t.ownerDocument)?void 0:r.defaultView)?void 0:i.frameElement;if(!o||o===n)return{x:0,y:0,relativeScale:1,absoluteScale:1};var s=o.getBoundingClientRect(),a=e(o,n),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 e(t,n){var r=t[n[0]];return 1===n.length?r:e(r.cssRules[n[1]].cssRules,n.slice(2))},getPositionsAndIndex:function(e){var t=[...e],n=t.pop();return{positions:t,index:n}},getRootShadowHost:wn,getShadowHost:bn,getWindowHeight:function(){return window.innerHeight||document.documentElement&&document.documentElement.clientHeight||document.body&&document.body.clientHeight},getWindowScroll:function(e){var t,n,r,i,o=e.document;return{left:o.scrollingElement?o.scrollingElement.scrollLeft:void 0!==e.pageXOffset?e.pageXOffset:o.documentElement.scrollLeft||(null==o?void 0:o.body)&&(null==(t=gn.parentElement(o.body))?void 0:t.scrollLeft)||(null==(n=null==o?void 0:o.body)?void 0:n.scrollLeft)||0,top:o.scrollingElement?o.scrollingElement.scrollTop:void 0!==e.pageYOffset?e.pageYOffset:(null==o?void 0:o.documentElement.scrollTop)||(null==o?void 0:o.body)&&(null==(r=gn.parentElement(o.body))?void 0:r.scrollTop)||(null==(i=null==o?void 0:o.body)?void 0:i.scrollTop)||0}},getWindowWidth:function(){return window.innerWidth||document.documentElement&&document.documentElement.clientWidth||document.body&&document.body.clientWidth},hasShadowRoot:function(e){return!!e&&(e instanceof sn&&"shadowRoot"in e?Boolean(e.shadowRoot):Boolean(gn.shadowRoot(e)))},hookSetter:function e(t,n,r,i){var o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:window,s=o.Object.getOwnPropertyDescriptor(t,n);return o.Object.defineProperty(t,n,i?r:{set(e){setTimeout((()=>{r.set.call(this,e)}),0),s&&s.set&&s.set.call(this,e)}}),()=>e(t,n,s||{},!0)},inDom:function(e){var t=e.ownerDocument;return!!t&&(gn.contains(t,e)||Sn(e))},isAncestorRemoved:function e(t,n){if(i=(r=t)&&"host"in r&&"mode"in r&&nn.host(r)||null,Boolean(i&&"shadowRoot"in i&&nn.shadowRoot(i)===r))return!1;var r,i,o=n.getId(t);if(!n.has(o))return!0;var s=gn.parentNode(t);return(!s||s.nodeType!==t.DOCUMENT_NODE)&&(!s||e(s,n))},isBlocked:function(e,t,n,r){if(!e)return!1;var i=yn(e);if(!i)return!1;try{if("string"==typeof t){if(i.classList.contains(t))return!0;if(r&&null!==i.closest("."+t))return!0}else if(on(i,t,r))return!0}catch(e){}if(n){if(i.matches(n))return!0;if(r&&null!==i.closest(n))return!0}return!1},isIgnored:function(e,t,n){return!("TITLE"!==e.tagName||!n.headTitleMutations)||-2===t.getId(e)},isSerialized:function(e,t){return-1!==t.getId(e)},isSerializedIframe:function(e,t){return Boolean("IFRAME"===e.nodeName&&t.getMeta(e))},isSerializedStylesheet:function(e,t){return Boolean("LINK"===e.nodeName&&e.nodeType===e.ELEMENT_NODE&&e.getAttribute&&"stylesheet"===e.getAttribute("rel")&&t.getMeta(e))},iterateResolveTree:function e(t,n){n(t.value);for(var r=t.children.length-1;r>=0;r--)e(t.children[r],n)},legacy_isTouchEvent:function(e){return Boolean(e.changedTouches)},get nowTimestamp(){return _n},on:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:document,r={capture:!0,passive:!0};return n.addEventListener(e,t,r),()=>n.removeEventListener(e,t,r)},patch:function(e,t,n){try{if(!(t in e))return()=>{};var r=e[t],i=n(r);return"function"==typeof i&&(i.prototype=i.prototype||{},Object.defineProperties(i,{__rrweb_original__:{enumerable:!1,value:r}})),e[t]=i,()=>{e[t]=r}}catch(e){return()=>{}}},polyfill:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:window;"NodeList"in e&&!e.NodeList.prototype.forEach&&(e.NodeList.prototype.forEach=Array.prototype.forEach),"DOMTokenList"in e&&!e.DOMTokenList.prototype.forEach&&(e.DOMTokenList.prototype.forEach=Array.prototype.forEach)},queueToResolveTrees:function(e){var t={},n=(e,n)=>{var r={value:e,parent:n,children:[]};return t[e.node.id]=r,r},r=[];for(var i of e){var{nextId:o,parentId:s}=i;if(o&&o in t){var a=t[o];if(a.parent){var l=a.parent.children.indexOf(a);a.parent.children.splice(l,0,n(i,a.parent))}else{var c=r.indexOf(a);r.splice(c,0,n(i,null))}}else if(s in t){var u=t[s];u.children.push(n(i,u))}else r.push(n(i,null))}return r},shadowHostInDom:Sn,throttle:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=null,i=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();i||!1!==n.leading||(i=l);var c=t-(l-i),u=this;c<=0||c>t?(r&&(clearTimeout(r),r=null),i=l,e.apply(u,s)):r||!1===n.trailing||(r=setTimeout((()=>{i=!1===n.leading?0:Date.now(),r=null,e.apply(u,s)}),c))}},uniqueTextMutations:function(e){for(var t=new Set,n=[],r=e.length;r--;){var i=e[r];t.has(i.id)||(n.push(i),t.add(i.id))}return n}},Symbol.toStringTag,{value:"Module"})),In="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",kn="undefined"==typeof Uint8Array?[]:new Uint8Array(256),En=0;En<64;En++)kn[In.charCodeAt(En)]=En;var xn;"undefined"!=typeof window&&window.Blob&&new Blob([(e=>Uint8Array.from(atob(e),(e=>e.charCodeAt(0))))("KGZ1bmN0aW9uKCkgewogICJ1c2Ugc3RyaWN0IjsKICB2YXIgY2hhcnMgPSAiQUJDREVGR0hJSktMTU5PUFFSU1RVVldYWVphYmNkZWZnaGlqa2xtbm9wcXJzdHV2d3h5ejAxMjM0NTY3ODkrLyI7CiAgdmFyIGxvb2t1cCA9IHR5cGVvZiBVaW50OEFycmF5ID09PSAidW5kZWZpbmVkIiA/IFtdIDogbmV3IFVpbnQ4QXJyYXkoMjU2KTsKICBmb3IgKHZhciBpID0gMDsgaSA8IGNoYXJzLmxlbmd0aDsgaSsrKSB7CiAgICBsb29rdXBbY2hhcnMuY2hhckNvZGVBdChpKV0gPSBpOwogIH0KICB2YXIgZW5jb2RlID0gZnVuY3Rpb24oYXJyYXlidWZmZXIpIHsKICAgIHZhciBieXRlcyA9IG5ldyBVaW50OEFycmF5KGFycmF5YnVmZmVyKSwgaTIsIGxlbiA9IGJ5dGVzLmxlbmd0aCwgYmFzZTY0ID0gIiI7CiAgICBmb3IgKGkyID0gMDsgaTIgPCBsZW47IGkyICs9IDMpIHsKICAgICAgYmFzZTY0ICs9IGNoYXJzW2J5dGVzW2kyXSA+PiAyXTsKICAgICAgYmFzZTY0ICs9IGNoYXJzWyhieXRlc1tpMl0gJiAzKSA8PCA0IHwgYnl0ZXNbaTIgKyAxXSA+PiA0XTsKICAgICAgYmFzZTY0ICs9IGNoYXJzWyhieXRlc1tpMiArIDFdICYgMTUpIDw8IDIgfCBieXRlc1tpMiArIDJdID4+IDZdOwogICAgICBiYXNlNjQgKz0gY2hhcnNbYnl0ZXNbaTIgKyAyXSAmIDYzXTsKICAgIH0KICAgIGlmIChsZW4gJSAzID09PSAyKSB7CiAgICAgIGJhc2U2NCA9IGJhc2U2NC5zdWJzdHJpbmcoMCwgYmFzZTY0Lmxlbmd0aCAtIDEpICsgIj0iOwogICAgfSBlbHNlIGlmIChsZW4gJSAzID09PSAxKSB7CiAgICAgIGJhc2U2NCA9IGJhc2U2NC5zdWJzdHJpbmcoMCwgYmFzZTY0Lmxlbmd0aCAtIDIpICsgIj09IjsKICAgIH0KICAgIHJldHVybiBiYXNlNjQ7CiAgfTsKICBjb25zdCBsYXN0QmxvYk1hcCA9IC8qIEBfX1BVUkVfXyAqLyBuZXcgTWFwKCk7CiAgY29uc3QgdHJhbnNwYXJlbnRCbG9iTWFwID0gLyogQF9fUFVSRV9fICovIG5ldyBNYXAoKTsKICBhc3luYyBmdW5jdGlvbiBnZXRUcmFuc3BhcmVudEJsb2JGb3Iod2lkdGgsIGhlaWdodCwgZGF0YVVSTE9wdGlvbnMpIHsKICAgIGNvbnN0IGlkID0gYCR7d2lkdGh9LSR7aGVpZ2h0fWA7CiAgICBpZiAoIk9mZnNjcmVlbkNhbnZhcyIgaW4gZ2xvYmFsVGhpcykgewogICAgICBpZiAodHJhbnNwYXJlbnRCbG9iTWFwLmhhcyhpZCkpIHJldHVybiB0cmFuc3BhcmVudEJsb2JNYXAuZ2V0KGlkKTsKICAgICAgY29uc3Qgb2Zmc2NyZWVuID0gbmV3IE9mZnNjcmVlbkNhbnZhcyh3aWR0aCwgaGVpZ2h0KTsKICAgICAgb2Zmc2NyZWVuLmdldENvbnRleHQoIjJkIik7CiAgICAgIGNvbnN0IGJsb2IgPSBhd2FpdCBvZmZzY3JlZW4uY29udmVydFRvQmxvYihkYXRhVVJMT3B0aW9ucyk7CiAgICAgIGNvbnN0IGFycmF5QnVmZmVyID0gYXdhaXQgYmxvYi5hcnJheUJ1ZmZlcigpOwogICAgICBjb25zdCBiYXNlNjQgPSBlbmNvZGUoYXJyYXlCdWZmZXIpOwogICAgICB0cmFuc3BhcmVudEJsb2JNYXAuc2V0KGlkLCBiYXNlNjQpOwogICAgICByZXR1cm4gYmFzZTY0OwogICAgfSBlbHNlIHsKICAgICAgcmV0dXJuICIiOwogICAgfQogIH0KICBjb25zdCB3b3JrZXIgPSBzZWxmOwogIHdvcmtlci5vbm1lc3NhZ2UgPSBhc3luYyBmdW5jdGlvbihlKSB7CiAgICBpZiAoIk9mZnNjcmVlbkNhbnZhcyIgaW4gZ2xvYmFsVGhpcykgewogICAgICBjb25zdCB7IGlkLCBiaXRtYXAsIHdpZHRoLCBoZWlnaHQsIGRhdGFVUkxPcHRpb25zIH0gPSBlLmRhdGE7CiAgICAgIGNvbnN0IHRyYW5zcGFyZW50QmFzZTY0ID0gZ2V0VHJhbnNwYXJlbnRCbG9iRm9yKAogICAgICAgIHdpZHRoLAogICAgICAgIGhlaWdodCwKICAgICAgICBkYXRhVVJMT3B0aW9ucwogICAgICApOwogICAgICBjb25zdCBvZmZzY3JlZW4gPSBuZXcgT2Zmc2NyZWVuQ2FudmFzKHdpZHRoLCBoZWlnaHQpOwogICAgICBjb25zdCBjdHggPSBvZmZzY3JlZW4uZ2V0Q29udGV4dCgiMmQiKTsKICAgICAgY3R4LmRyYXdJbWFnZShiaXRtYXAsIDAsIDApOwogICAgICBiaXRtYXAuY2xvc2UoKTsKICAgICAgY29uc3QgYmxvYiA9IGF3YWl0IG9mZnNjcmVlbi5jb252ZXJ0VG9CbG9iKGRhdGFVUkxPcHRpb25zKTsKICAgICAgY29uc3QgdHlwZSA9IGJsb2IudHlwZTsKICAgICAgY29uc3QgYXJyYXlCdWZmZXIgPSBhd2FpdCBibG9iLmFycmF5QnVmZmVyKCk7CiAgICAgIGNvbnN0IGJhc2U2NCA9IGVuY29kZShhcnJheUJ1ZmZlcik7CiAgICAgIGlmICghbGFzdEJsb2JNYXAuaGFzKGlkKSAmJiBhd2FpdCB0cmFuc3BhcmVudEJhc2U2NCA9PT0gYmFzZTY0KSB7CiAgICAgICAgbGFzdEJsb2JNYXAuc2V0KGlkLCBiYXNlNjQpOwogICAgICAgIHJldHVybiB3b3JrZXIucG9zdE1lc3NhZ2UoeyBpZCB9KTsKICAgICAgfQogICAgICBpZiAobGFzdEJsb2JNYXAuZ2V0KGlkKSA9PT0gYmFzZTY0KSByZXR1cm4gd29ya2VyLnBvc3RNZXNzYWdlKHsgaWQgfSk7CiAgICAgIHdvcmtlci5wb3N0TWVzc2FnZSh7CiAgICAgICAgaWQsCiAgICAgICAgdHlwZSwKICAgICAgICBiYXNlNjQsCiAgICAgICAgd2lkdGgsCiAgICAgICAgaGVpZ2h0CiAgICAgIH0pOwogICAgICBsYXN0QmxvYk1hcC5zZXQoaWQsIGJhc2U2NCk7CiAgICB9IGVsc2UgewogICAgICByZXR1cm4gd29ya2VyLnBvc3RNZXNzYWdlKHsgaWQ6IGUuZGF0YS5pZCB9KTsKICAgIH0KICB9Owp9KSgpOwovLyMgc291cmNlTWFwcGluZ1VSTD1pbWFnZS1iaXRtYXAtZGF0YS11cmwtd29ya2VyLUlKcEM3Z19iLmpzLm1hcAo=")],{type:"text/javascript;charset=utf-8"});try{if(2!==Array.from([1],(e=>2*e))[0]){var Tn=document.createElement("iframe");document.body.appendChild(Tn),Array.from=(null==($t=Tn.contentWindow)?void 0:$t.Array.from)||Array.from,document.body.removeChild(Tn)}}catch(e){console.debug("Unable to override Array.from",e)}new rn,function(e){e[e.NotStarted=0]="NotStarted",e[e.Running=1]="Running",e[e.Stopped=2]="Stopped"}(xn||(xn={}));class Mn{constructor(e){Vt(this,"fileName"),Vt(this,"functionName"),Vt(this,"lineNumber"),Vt(this,"columnNumber"),this.fileName=e.fileName||"",this.functionName=e.functionName||"",this.lineNumber=e.lineNumber,this.columnNumber=e.columnNumber}toString(){var e=this.lineNumber||"",t=this.columnNumber||"";return this.functionName?"".concat(this.functionName," (").concat(this.fileName,":").concat(e,":").concat(t,")"):"".concat(this.fileName,":").concat(e,":").concat(t)}}var Rn=/(^|@)\S+:\d+/,An=/^\s*at .*(\S+:\d+|\(native\))/m,Nn=/^(eval@)?(\[native code])?$/,Fn={parse:function(e){return e?void 0!==e.stacktrace||void 0!==e["opera#sourceloc"]?this.parseOpera(e):e.stack&&e.stack.match(An)?this.parseV8OrIE(e):e.stack?this.parseFFOrSafari(e):(console.warn("[console-record-plugin]: Failed to parse error object:",e),[]):[]},extractLocation:function(e){if(-1===e.indexOf(":"))return[e];var t=/(.+?)(?::(\d+))?(?::(\d+))?$/.exec(e.replace(/[()]/g,""));if(!t)throw new Error("Cannot parse given url: ".concat(e));return[t[1],t[2]||void 0,t[3]||void 0]},parseV8OrIE:function(e){return e.stack.split("\n").filter((function(e){return!!e.match(An)}),this).map((function(e){e.indexOf("(eval ")>-1&&(e=e.replace(/eval code/g,"eval").replace(/(\(eval at [^()]*)|(\),.*$)/g,""));var t=e.replace(/^\s+/,"").replace(/\(eval code/g,"("),n=t.match(/ (\((.+):(\d+):(\d+)\)$)/),r=(t=n?t.replace(n[0],""):t).split(/\s+/).slice(1),i=this.extractLocation(n?n[1]:r.pop()),o=r.join(" ")||void 0,s=["eval","<anonymous>"].indexOf(i[0])>-1?void 0:i[0];return new Mn({functionName:o,fileName:s,lineNumber:i[1],columnNumber:i[2]})}),this)},parseFFOrSafari:function(e){return e.stack.split("\n").filter((function(e){return!e.match(Nn)}),this).map((function(e){if(e.indexOf(" > eval")>-1&&(e=e.replace(/ line (\d+)(?: > eval line \d+)* > eval:\d+:\d+/g,":$1")),-1===e.indexOf("@")&&-1===e.indexOf(":"))return new Mn({functionName:e});var t=/((.*".+"[^@]*)?[^@]*)(?:@)/,n=e.match(t),r=n&&n[1]?n[1]:void 0,i=this.extractLocation(e.replace(t,""));return new Mn({functionName:r,fileName:i[0],lineNumber:i[1],columnNumber:i[2]})}),this)},parseOpera:function(e){return!e.stacktrace||e.message.indexOf("\n")>-1&&e.message.split("\n").length>e.stacktrace.split("\n").length?this.parseOpera9(e):e.stack?this.parseOpera11(e):this.parseOpera10(e)},parseOpera9:function(e){for(var t=/Line (\d+).*script (?:in )?(\S+)/i,n=e.message.split("\n"),r=[],i=2,o=n.length;i<o;i+=2){var s=t.exec(n[i]);s&&r.push(new Mn({fileName:s[2],lineNumber:parseFloat(s[1])}))}return r},parseOpera10:function(e){for(var t=/Line (\d+).*script (?:in )?(\S+)(?:: In function (\S+))?$/i,n=e.stacktrace.split("\n"),r=[],i=0,o=n.length;i<o;i+=2){var s=t.exec(n[i]);s&&r.push(new Mn({functionName:s[3]||void 0,fileName:s[2],lineNumber:parseFloat(s[1])}))}return r},parseOpera11:function(e){return e.stack.split("\n").filter((function(e){return!!e.match(Rn)&&!e.match(/^Error created at/)}),this).map((function(e){var t=e.split("@"),n=this.extractLocation(t.pop()),r=(t.shift()||"").replace(/<anonymous function(: (\w+))?>/,"$2").replace(/\([^)]*\)/g,"")||void 0;return new Mn({functionName:r,fileName:n[0],lineNumber:n[1],columnNumber:n[2]})}),this)}};function On(e){if(!e||!e.outerHTML)return"";for(var t="";e.parentElement;){var n=e.localName;if(!n)break;n=n.toLowerCase();var r=e.parentElement,i=[];if(r.children&&r.children.length>0)for(var o=0;o<r.children.length;o++){var s=r.children[o];s.localName&&s.localName.toLowerCase&&s.localName.toLowerCase()===n&&i.push(s)}i.length>1&&(n+=":eq(".concat(i.indexOf(e),")")),t=n+(t?">"+t:""),e=r}return t}function Pn(e){return"[object Object]"===Object.prototype.toString.call(e)}function Ln(e,t){if(0===t)return!0;var n=Object.keys(e);for(var r of n)if(Pn(e[r])&&Ln(e[r],t-1))return!0;return!1}function Dn(e,t){var n={numOfKeysLimit:50,depthOfLimit:4};Object.assign(n,t);var r=[],i=[];return JSON.stringify(e,(function(e,t){if(r.length>0){var o=r.indexOf(this);~o?r.splice(o+1):r.push(this),~o?i.splice(o,1/0,e):i.push(e),~r.indexOf(t)&&(t=r[0]===t?"[Circular ~]":"[Circular ~."+i.slice(0,r.indexOf(t)).join(".")+"]")}else r.push(t);if(null===t)return t;if(void 0===t)return"undefined";if(function(e){if(Pn(e)&&Object.keys(e).length>n.numOfKeysLimit)return!0;if("function"==typeof e)return!0;if(Pn(e)&&Ln(e,n.depthOfLimit))return!0;return!1}(t))return function(e){var t=e.toString();n.stringLengthLimit&&t.length>n.stringLengthLimit&&(t="".concat(t.slice(0,n.stringLengthLimit),"..."));return t}(t);if("bigint"==typeof t)return t.toString()+"n";if(t instanceof Event){var s={};for(var a in t){var l=t[a];Array.isArray(l)?s[a]=On(l.length?l[0]:null):s[a]=l}return s}return t instanceof Node?t instanceof HTMLElement?t?t.outerHTML:"":t.nodeName:t instanceof Error?t.stack?t.stack+"\nEnd of stack for Error object":t.name+": "+t.message:t}))}var Bn={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 Hn(e,t,n){var r,i=n?Object.assign({},Bn,n):Bn,o=i.logger;if(!o)return()=>{};r="string"==typeof o?t[o]:o;var s=0,a=!1,l=[];if(i.level.includes("error")){var c=t=>{var n=t.message,r=t.error,o=Fn.parse(r).map((e=>e.toString())),s=[Dn(n,i.stringifyOptions)];e({level:"error",trace:o,payload:s})};t.addEventListener("error",c),l.push((()=>{t.removeEventListener("error",c)}));var u=t=>{var n,r;t.reason instanceof Error?(n=t.reason,r=[Dn("Uncaught (in promise) ".concat(n.name,": ").concat(n.message),i.stringifyOptions)]):(n=new Error,r=[Dn("Uncaught (in promise)",i.stringifyOptions),Dn(t.reason,i.stringifyOptions)]);var o=Fn.parse(n).map((e=>e.toString()));e({level:"error",trace:o,payload:r})};t.addEventListener("unhandledrejection",u),l.push((()=>{t.removeEventListener("unhandledrejection",u)}))}for(var d of i.level)l.push(h(r,d));return()=>{l.forEach((e=>e()))};function h(t,n){var r=this;return t[n]?Cn.patch(t,n,(t=>function(){for(var o=arguments.length,l=new Array(o),c=0;c<o;c++)l[c]=arguments[c];if(t.apply(r,l),!("assert"===n&&l[0]||a)){a=!0;try{var u=Fn.parse(new Error).map((e=>e.toString())).splice(1),d=("assert"===n?l.slice(1):l).map((e=>Dn(e,i.stringifyOptions)));++s<i.lengthThreshold?e({level:n,trace:u,payload:d}):s===i.lengthThreshold&&e({level:"warn",trace:[],payload:[Dn("The number of log records reached the threshold.")]})}catch(e){t("rrweb logger error:",e,...l)}finally{a=!1}}})):()=>{}}}var qn,$n=e=>({name:"rrweb/console@1",observer:Hn,options:e}),Wn="undefined"!=typeof window?window:void 0,Vn="undefined"!=typeof globalThis?globalThis:Wn,Zn=Array.prototype,Gn=Zn.forEach,Un=Zn.indexOf,jn=null==Vn?void 0:Vn.navigator,zn=null==Vn?void 0:Vn.document,Yn=null==Vn?void 0:Vn.location,Xn=null==Vn?void 0:Vn.fetch,Jn=null!=Vn&&Vn.XMLHttpRequest&&"withCredentials"in new Vn.XMLHttpRequest?Vn.XMLHttpRequest:void 0,Kn=null==Vn?void 0:Vn.AbortController,Qn=null==jn?void 0:jn.userAgent,er=null!=Wn?Wn:{},tr="$copy_autocapture",nr=["$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(e){e.GZipJS="gzip-js",e.Base64="base64"}(qn||(qn={}));var rr=["fatal","error","warning","log","info","debug"];function ir(e,t){return-1!==e.indexOf(t)}var or=function(e){return e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"")},sr=function(e){return e.replace(/^\$/,"")};var ar=Array.isArray,lr=Object.prototype,cr=lr.hasOwnProperty,ur=lr.toString,dr=ar||function(e){return"[object Array]"===ur.call(e)},hr=e=>"function"==typeof e,pr=e=>hr(e)&&-1!==e.toString().indexOf("[native code]"),vr=()=>!!Wn.Zone,gr=e=>e===Object(e)&&!dr(e),fr=e=>{if(gr(e)){for(var t in e)if(cr.call(e,t))return!1;return!0}return!1},mr=e=>void 0===e,_r=e=>"[object String]"==ur.call(e),yr=e=>_r(e)&&0===e.trim().length,br=e=>null===e,wr=e=>mr(e)||br(e),Sr=e=>"[object Number]"==ur.call(e),Cr=e=>"[object Boolean]"===ur.call(e),Ir=e=>e instanceof Document,kr=e=>e instanceof FormData,Er=e=>ir(nr,e),xr={DEBUG:!1,LIB_VERSION:"1.211.2"},Tr=e=>{var t={_log:function(t){if(Wn&&(xr.DEBUG||er.POSTHOG_DEBUG)&&!mr(Wn.console)&&Wn.console){for(var n=("__rrweb_original__"in Wn.console[t]?Wn.console[t].__rrweb_original__:Wn.console[t]),r=arguments.length,i=new Array(r>1?r-1:0),o=1;o<r;o++)i[o-1]=arguments[o];n(e,...i)}},info:function(){for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];t._log("log",...n)},warn:function(){for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];t._log("warn",...n)},error:function(){for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];t._log("error",...n)},critical:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];console.error(e,...n)},uninitializedWarning:e=>{t.error("You must initialize PostHog before calling ".concat(e))},createLogger:t=>Tr("".concat(e," ").concat(t))};return t},Mr=Tr("[PostHog.js]"),Rr=Mr.createLogger,Ar={};function Nr(e,t,n){if(dr(e))if(Gn&&e.forEach===Gn)e.forEach(t,n);else if("length"in e&&e.length===+e.length)for(var r=0,i=e.length;r<i;r++)if(r in e&&t.call(n,e[r],r)===Ar)return}function Fr(e,t,n){if(!wr(e)){if(dr(e))return Nr(e,t,n);if(kr(e)){for(var r of e.entries())if(t.call(n,r[1],r[0])===Ar)return}else for(var i in e)if(cr.call(e,i)&&t.call(n,e[i],i)===Ar)return}}var Or=function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];return Nr(n,(function(t){for(var n in t)void 0!==t[n]&&(e[n]=t[n])})),e},Pr=function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];return Nr(n,(function(t){Nr(t,(function(t){e.push(t)}))})),e};function Lr(e){for(var t=Object.keys(e),n=t.length,r=new Array(n);n--;)r[n]=[t[n],e[t[n]]];return r}var Dr=function(e){try{return e()}catch(e){return}},Br=function(e){return function(){try{for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return e.apply(this,n)}catch(e){Mr.critical("Implementation error. Please turn on debug mode and open a ticket on https://app.posthog.com/home#panel=support%3Asupport%3A."),Mr.critical(e)}}},Hr=function(e){var t={};return Fr(e,(function(e,n){_r(e)&&e.length>0&&(t[n]=e)})),t};function qr(e,t){return n=e,r=e=>_r(e)&&!br(t)?e.slice(0,t):e,i=new Set,function e(t,n){return t!==Object(t)?r?r(t,n):t:i.has(t)?void 0:(i.add(t),dr(t)?(o=[],Nr(t,(t=>{o.push(e(t))}))):(o={},Fr(t,((t,n)=>{i.has(t)||(o[n]=e(t,n))}))),o);var o}(n);var n,r,i}var $r=function(){function e(t){return t&&(t.preventDefault=e.preventDefault,t.stopPropagation=e.stopPropagation),t}return e.preventDefault=function(){this.returnValue=!1},e.stopPropagation=function(){this.cancelBubble=!0},function(t,n,r,i,o){if(t)if(t.addEventListener&&!i)t.addEventListener(n,r,!!o);else{var s="on"+n,a=t[s];t[s]=function(t,n,r){return function(i){if(i=i||e(null==Wn?void 0:Wn.event)){var o,s=!0;hr(r)&&(o=r(i));var a=n.call(t,i);return!1!==o&&!1!==a||(s=!1),s}}}(t,r,a)}else Mr.error("No valid element provided to register_event")}}(),Wr=["herokuapp.com","vercel.app","netlify.app"];function Vr(e){var t=null==e?void 0:e.hostname;if(!_r(t))return!1;var n=t.split(".").slice(-2).join(".");for(var r of Wr)if(n===r)return!1;return!0}function Zr(e,t){for(var n=0;n<e.length;n++)if(t(e[n]))return e[n]}var Gr=["localhost","127.0.0.1"],Ur=e=>{var t=null==zn?void 0:zn.createElement("a");return mr(t)?null:(t.href=e,t)},jr=function(e,t){return!!function(e){try{new RegExp(e)}catch(e){return!1}return!0}(t)&&new RegExp(t).test(e)},zr=function(e){var t,n,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"&",i=[];return Fr(e,(function(e,r){mr(e)||mr(r)||"undefined"===r||(t=encodeURIComponent((e=>e instanceof File)(e)?e.name:e.toString()),n=encodeURIComponent(r),i[i.length]=n+"="+t)})),i.join(r)},Yr=function(e,t){for(var n,r=((e.split("#")[0]||"").split("?")[1]||"").split("&"),i=0;i<r.length;i++){var o=r[i].split("=");if(o[0]===t){n=o;break}}if(!dr(n)||n.length<2)return"";var s=n[1];try{s=decodeURIComponent(s)}catch(e){Mr.error("Skipping decoding for malformed query param: "+s)}return s.replace(/\+/g," ")},Xr=function(e,t,n){if(!e||!t||!t.length)return e;for(var r=e.split("#"),i=r[0]||"",o=r[1],s=i.split("?"),a=s[1],l=s[0],c=(a||"").split("&"),u=[],d=0;d<c.length;d++){var h=c[d].split("=");dr(h)&&(t.includes(h[0])?u.push(h[0]+"="+n):u.push(c[d]))}var p=l;return null!=a&&(p+="?"+u.join("&")),null!=o&&(p+="#"+o),p},Jr=function(e,t){var n=e.match(new RegExp(t+"=([^&]*)"));return n?n[1]:null},Kr="$people_distinct_id",Qr="__alias",ei="__timers",ti="$autocapture_disabled_server_side",ni="$heatmaps_enabled_server_side",ri="$exception_capture_enabled_server_side",ii="$web_vitals_enabled_server_side",oi="$dead_clicks_enabled_server_side",si="$web_vitals_allowed_metrics",ai="$session_recording_enabled_server_side",li="$console_log_recording_enabled_server_side",ci="$session_recording_network_payload_capture",ui="$session_recording_canvas_recording",di="$replay_sample_rate",hi="$replay_minimum_duration",pi="$replay_script_config",vi="$sesid",gi="$session_is_sampled",fi="$session_recording_url_trigger_activated_session",mi="$session_recording_event_trigger_activated_session",_i="$enabled_feature_flags",yi="$early_access_features",bi="$stored_person_properties",wi="$stored_group_properties",Si="$surveys",Ci="$surveys_activated",Ii="$flag_call_reported",ki="$user_state",Ei="$client_session_props",xi="$capture_rate_limit",Ti="$initial_campaign_params",Mi="$initial_referrer_info",Ri="$initial_person_info",Ai="$epp",Ni="__POSTHOG_TOOLBAR__",Fi="$posthog_cookieless",Oi=[Kr,Qr,"__cmpns",ei,ai,ni,vi,_i,ki,yi,wi,bi,Si,Ii,Ei,xi,Ti,Mi,Ai];function Pi(e){var t;return e instanceof Element&&(e.id===Ni||!(null===(t=e.closest)||void 0===t||!t.call(e,".toolbar-global-fade-container")))}function Li(e){return!!e&&1===e.nodeType}function Di(e,t){return!!e&&!!e.tagName&&e.tagName.toLowerCase()===t.toLowerCase()}function Bi(e){return!!e&&3===e.nodeType}function Hi(e){return!!e&&11===e.nodeType}function qi(e){return e?or(e).split(/\s+/):[]}function $i(e){var t=null==Wn?void 0:Wn.location.href;return!!(t&&e&&e.some((e=>t.match(e))))}function Wi(e){var t="";switch(typeof e.className){case"string":t=e.className;break;case"object":t=(e.className&&"baseVal"in e.className?e.className.baseVal:null)||e.getAttribute("class")||"";break;default:t=""}return qi(t)}function Vi(e){return wr(e)?null:or(e).split(/(\s+)/).filter((e=>ro(e))).join("").replace(/[\r\n]/g," ").replace(/[ ]+/g," ").substring(0,255)}function Zi(e){var t="";return Yi(e)&&!Xi(e)&&e.childNodes&&e.childNodes.length&&Fr(e.childNodes,(function(e){var n;Bi(e)&&e.textContent&&(t+=null!==(n=Vi(e.textContent))&&void 0!==n?n:"")})),or(t)}function Gi(e){return mr(e.target)?e.srcElement||null:null!==(t=e.target)&&void 0!==t&&t.shadowRoot?e.composedPath()[0]||null:e.target||null;var t}var Ui=["a","button","form","input","select","textarea","label"];function ji(e){var t=e.parentNode;return!(!t||!Li(t))&&t}function zi(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:void 0,r=arguments.length>3?arguments[3]:void 0,i=arguments.length>4?arguments[4]:void 0;if(!Wn||!e||Di(e,"html")||!Li(e))return!1;if(null!=n&&n.url_allowlist&&!$i(n.url_allowlist))return!1;if(null!=n&&n.url_ignorelist&&$i(n.url_ignorelist))return!1;if(null!=n&&n.dom_event_allowlist){var o=n.dom_event_allowlist;if(o&&!o.some((e=>t.type===e)))return!1}for(var s=!1,a=[e],l=!0,c=e;c.parentNode&&!Di(c,"body");)if(Hi(c.parentNode))a.push(c.parentNode.host),c=c.parentNode.host;else{if(!(l=ji(c)))break;if(r||Ui.indexOf(l.tagName.toLowerCase())>-1)s=!0;else{var u=Wn.getComputedStyle(l);u&&"pointer"===u.getPropertyValue("cursor")&&(s=!0)}a.push(l),c=l}if(!function(e,t){var n=null==t?void 0:t.element_allowlist;if(mr(n))return!0;var r=function(e){if(n.some((t=>e.tagName.toLowerCase()===t)))return{v:!0}};for(var i of e){var o=r(i);if("object"==typeof o)return o.v}return!1}(a,n))return!1;if(!function(e,t){var n=null==t?void 0:t.css_selector_allowlist;if(mr(n))return!0;var r=function(e){if(n.some((t=>e.matches(t))))return{v:!0}};for(var i of e){var o=r(i);if("object"==typeof o)return o.v}return!1}(a,n))return!1;var d=Wn.getComputedStyle(e);if(d&&"pointer"===d.getPropertyValue("cursor")&&"click"===t.type)return!0;var h=e.tagName.toLowerCase();switch(h){case"html":return!1;case"form":return(i||["submit"]).indexOf(t.type)>=0;case"input":case"select":case"textarea":return(i||["change","click"]).indexOf(t.type)>=0;default:return s?(i||["click"]).indexOf(t.type)>=0:(i||["click"]).indexOf(t.type)>=0&&(Ui.indexOf(h)>-1||"true"===e.getAttribute("contenteditable"))}}function Yi(e){for(var t=e;t.parentNode&&!Di(t,"body");t=t.parentNode){var n=Wi(t);if(ir(n,"ph-sensitive")||ir(n,"ph-no-capture"))return!1}if(ir(Wi(e),"ph-include"))return!0;var r=e.type||"";if(_r(r))switch(r.toLowerCase()){case"hidden":case"password":return!1}var i=e.name||e.id||"";if(_r(i)){if(/^cc|cardnum|ccnum|creditcard|csc|cvc|cvv|exp|pass|pwd|routing|seccode|securitycode|securitynum|socialsec|socsec|ssn/i.test(i.replace(/[^a-zA-Z0-9]/g,"")))return!1}return!0}function Xi(e){return!!(Di(e,"input")&&!["button","checkbox","submit","reset"].includes(e.type)||Di(e,"select")||Di(e,"textarea")||"true"===e.getAttribute("contenteditable"))}var Ji="(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})",Ki=new RegExp("^(?:".concat(Ji,")$")),Qi=new RegExp(Ji),eo="\\d{3}-?\\d{2}-?\\d{4}",to=new RegExp("^(".concat(eo,")$")),no=new RegExp("(".concat(eo,")"));function ro(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if(wr(e))return!1;if(_r(e)){if(e=or(e),(t?Ki:Qi).test((e||"").replace(/[- ]/g,"")))return!1;if((t?to:no).test(e))return!1}return!0}function io(e){var t=Zi(e);return ro(t="".concat(t," ").concat(oo(e)).trim())?t:""}function oo(e){var t="";return e&&e.childNodes&&e.childNodes.length&&Fr(e.childNodes,(function(e){var n;if(e&&"span"===(null===(n=e.tagName)||void 0===n?void 0:n.toLowerCase()))try{var r=Zi(e);t="".concat(t," ").concat(r).trim(),e.childNodes&&e.childNodes.length&&(t="".concat(t," ").concat(oo(e)).trim())}catch(e){Mr.error("[AutoCapture]",e)}})),t}function so(e){return function(e){var n=e.map((e=>{var n,r,i="";if(e.tag_name&&(i+=e.tag_name),e.attr_class)for(var o of(e.attr_class.sort(),e.attr_class))i+=".".concat(o.replace(/"/g,""));var s=t(t(t(t({},e.text?{text:e.text}:{}),{},{"nth-child":null!==(n=e.nth_child)&&void 0!==n?n:0,"nth-of-type":null!==(r=e.nth_of_type)&&void 0!==r?r:0},e.href?{href:e.href}:{}),e.attr_id?{attr_id:e.attr_id}:{}),e.attributes),a={};return Lr(s).sort(((e,t)=>{var[n]=e,[r]=t;return n.localeCompare(r)})).forEach((e=>{var[t,n]=e;return a[ao(t.toString())]=ao(n.toString())})),i+=":",i+=Lr(s).map((e=>{var[t,n]=e;return"".concat(t,'="').concat(n,'"')})).join("")}));return n.join(";")}(function(e){return e.map((e=>{var t,n,r={text:null===(t=e.$el_text)||void 0===t?void 0:t.slice(0,400),tag_name:e.tag_name,href:null===(n=e.attr__href)||void 0===n?void 0:n.slice(0,2048),attr_class:lo(e),attr_id:e.attr__id,nth_child:e.nth_child,nth_of_type:e.nth_of_type,attributes:{}};return Lr(e).filter((e=>{var[t]=e;return 0===t.indexOf("attr__")})).forEach((e=>{var[t,n]=e;return r.attributes[t]=n})),r}))}(e))}function ao(e){return e.replace(/"|\\"/g,'\\"')}function lo(e){var t=e.attr__class;return t?dr(t)?t:qi(t):void 0}var co="[SessionRecording]",uo="redacted",ho={initiatorTypes:["audio","beacon","body","css","early-hint","embed","fetch","frame","iframe","icon","image","img","input","link","navigation","object","ping","script","track","video","xmlhttprequest"],maskRequestFn:e=>e,recordHeaders:!1,recordBody:!1,recordInitialRequests:!1,recordPerformance:!1,performanceEntryTypeToObserve:["first-input","navigation","paint","resource"],payloadSizeLimitBytes:1e6,payloadHostDenyList:[".lr-ingest.io",".ingest.sentry.io",".clarity.ms","analytics.google.com"]},po=["authorization","x-forwarded-for","authorization","cookie","set-cookie","x-api-key","x-real-ip","remote-addr","forwarded","proxy-authorization","x-csrf-token","x-csrftoken","x-xsrf-token"],vo=["password","secret","passwd","api_key","apikey","auth","credentials","mysql_pwd","privatekey","private_key","token"],go=["/s/","/e/","/i/"];function fo(e,t,n,r){if(wr(e))return e;var i=(null==t?void 0:t["content-length"])||function(e){return new Blob([e]).size}(e);return _r(i)&&(i=parseInt(i)),i>n?co+" ".concat(r," body too large to record (").concat(i," bytes)"):e}function mo(e,t){if(wr(e))return e;var n=e;return ro(n,!1)||(n=co+" "+t+" body "+uo),Fr(vo,(e=>{var r,i;null!==(r=n)&&void 0!==r&&r.length&&-1!==(null===(i=n)||void 0===i?void 0:i.indexOf(e))&&(n=co+" "+t+" body "+uo+" as might contain: "+e)})),n}var _o=(e,n)=>{var r,i,o,s={payloadSizeLimitBytes:ho.payloadSizeLimitBytes,performanceEntryTypeToObserve:[...ho.performanceEntryTypeToObserve],payloadHostDenyList:[...n.payloadHostDenyList||[],...ho.payloadHostDenyList]},a=!1!==e.session_recording.recordHeaders&&n.recordHeaders,l=!1!==e.session_recording.recordBody&&n.recordBody,c=!1!==e.capture_performance&&n.recordPerformance,u=(r=s,o=Math.min(1e6,null!==(i=r.payloadSizeLimitBytes)&&void 0!==i?i:1e6),e=>(null!=e&&e.requestBody&&(e.requestBody=fo(e.requestBody,e.requestHeaders,o,"Request")),null!=e&&e.responseBody&&(e.responseBody=fo(e.responseBody,e.responseHeaders,o,"Response")),e)),d=t=>{return u(((e,t)=>{var n,r=Ur(e.name),i=0===t.indexOf("http")?null===(n=Ur(t))||void 0===n?void 0:n.pathname:t;"/"===i&&(i="");var o=null==r?void 0:r.pathname.replace(i||"","");if(!(r&&o&&go.some((e=>0===o.indexOf(e)))))return e})((r=(n=t).requestHeaders,wr(r)||Fr(Object.keys(null!=r?r:{}),(e=>{po.includes(e.toLowerCase())&&(r[e]=uo)})),n),e.api_host));var n,r},h=hr(e.session_recording.maskNetworkRequestFn);return h&&hr(e.session_recording.maskCapturedNetworkRequestFn)&&Mr.warn("Both `maskNetworkRequestFn` and `maskCapturedNetworkRequestFn` are defined. `maskNetworkRequestFn` will be ignored."),h&&(e.session_recording.maskCapturedNetworkRequestFn=n=>{var r=e.session_recording.maskNetworkRequestFn({url:n.name});return t(t({},n),{},{name:null==r?void 0:r.url})}),s.maskRequestFn=hr(e.session_recording.maskCapturedNetworkRequestFn)?t=>{var n,r,i,o=d(t);return o&&null!==(n=null===(r=(i=e.session_recording).maskCapturedNetworkRequestFn)||void 0===r?void 0:r.call(i,o))&&void 0!==n?n:void 0}:e=>function(e){if(!mr(e))return e.requestBody=mo(e.requestBody,"Request"),e.responseBody=mo(e.responseBody,"Response"),e}(d(e)),t(t(t({},ho),s),{},{recordHeaders:a,recordBody:l,recordPerformance:c,recordInitialRequests:c})};function yo(e,t,n){try{if(!(t in e))return()=>{};var r=e[t],i=n(r);return hr(i)&&(i.prototype=i.prototype||{},Object.defineProperties(i,{__posthog_wrapped__:{enumerable:!1,value:!0}})),e[t]=i,()=>{e[t]=r}}catch(e){return()=>{}}}function bo(e,t){var n,r=function(e){try{return"string"==typeof e?new URL(e).hostname:"url"in e?new URL(e.url).hostname:e.hostname}catch(e){return null}}(e),i={hostname:r,isHostDenied:!1};if(null===(n=t.payloadHostDenyList)||void 0===n||!n.length||null==r||!r.trim().length)return i;for(var o of t.payloadHostDenyList)if(r.endsWith(o))return{hostname:r,isHostDenied:!0};return i}var wo=Rr("[Recorder]"),So=e=>"navigation"===e.entryType,Co=e=>"resource"===e.entryType;function Io(e,t,n){if(n.recordInitialRequests){var r=t.performance.getEntries().filter((e=>So(e)||Co(e)&&n.initiatorTypes.includes(e.initiatorType)));e({requests:r.flatMap((e=>Ao({entry:e,method:void 0,status:void 0,networkRequest:{},isInitial:!0}))),isInitial:!0})}var i=new t.PerformanceObserver((t=>{var r=t.getEntries().filter((e=>So(e)||Co(e)&&n.initiatorTypes.includes(e.initiatorType)&&(e=>!n.recordBody&&!n.recordHeaders||"xmlhttprequest"!==e.initiatorType&&"fetch"!==e.initiatorType)(e)));e({requests:r.flatMap((e=>Ao({entry:e,method:void 0,status:void 0,networkRequest:{}})))})})),o=PerformanceObserver.supportedEntryTypes.filter((e=>n.performanceEntryTypeToObserve.includes(e)));return i.observe({entryTypes:o}),()=>{i.disconnect()}}function ko(e,t){return!!t&&(Cr(t)||t[e])}function Eo(e){var{type:t,recordBody:n,headers:r}=e;function i(e){var t=Object.keys(r).find((e=>"content-type"===e.toLowerCase())),n=t&&r[t];return e.some((e=>null==n?void 0:n.includes(e)))}if(!n)return!1;if(Cr(n))return!0;if(dr(n))return i(n);var o=n[t];return Cr(o)?o:i(o)}function xo(e,t,n,r,i){return To.apply(this,arguments)}function To(){return To=r((function*(e,t,n,r,i){var o=arguments.length>5&&void 0!==arguments[5]?arguments[5]:0;if(o>10)return wo.warn("Failed to get performance entry for request",{url:n,initiatorType:t}),null;var s=function(e,t){for(var n=e.length-1;n>=0;n-=1)if(t(e[n]))return e[n]}(e.performance.getEntriesByName(n),(e=>Co(e)&&e.initiatorType===t&&(mr(r)||e.startTime>=r)&&(mr(i)||e.startTime<=i)));return s||(yield new Promise((e=>setTimeout(e,50*o))),xo(e,t,n,r,i,o+1))})),To.apply(this,arguments)}function Mo(e){var{body:t,options:n,url:r}=e;if(wr(t))return null;var{hostname:i,isHostDenied:o}=bo(r,n);if(o)return i+" is in deny list";if(_r(t))return t;if(Ir(t))return t.textContent;if(kr(t))return zr(t);if(gr(t))try{return JSON.stringify(t)}catch(e){return"[SessionReplay] Failed to stringify response object"}return"[SessionReplay] Cannot read body of type "+toString.call(t)}var Ro=e=>!br(e)&&("navigation"===e.entryType||"resource"===e.entryType);function Ao(e){var{entry:n,method:r,status:i,networkRequest:o,isInitial:s,start:a,end:l,url:c,initiatorType:u}=e;a=n?n.startTime:a,l=n?n.responseEnd:l;var d=Math.floor(Date.now()-performance.now()),h=Math.floor(d+(a||0)),p=[t(t({},n?n.toJSON():{name:c}),{},{startTime:mr(a)?void 0:Math.round(a),endTime:mr(l)?void 0:Math.round(l),timeOrigin:d,timestamp:h,method:r,initiatorType:u||(n?n.initiatorType:void 0),status:i,requestHeaders:o.requestHeaders,requestBody:o.requestBody,responseHeaders:o.responseHeaders,responseBody:o.responseBody,isInitial:s})];if(Ro(n))for(var v of n.serverTiming||[])p.push({timeOrigin:d,timestamp:h,startTime:Math.round(n.startTime),name:v.name,duration:v.duration,entryType:"serverTiming"});return p}var No=["video/","audio/"];function Fo(e){return new Promise(((t,n)=>{var r=setTimeout((()=>t("[SessionReplay] Timeout while trying to read body")),500);try{e.clone().text().then((e=>t(e)),(e=>n(e))).finally((()=>clearTimeout(r)))}catch(e){clearTimeout(r),t("[SessionReplay] Failed to read body")}}))}function Oo(){return Oo=r((function*(e){var{r:t,options:n,url:r}=e,{hostname:i,isHostDenied:o}=bo(r,n);return o?Promise.resolve(i+" is in deny list"):Fo(t)})),Oo.apply(this,arguments)}function Po(){return Po=r((function*(e){var{r:t,options:n,url:r}=e,i=function(e){var t,{r:n,options:r,url:i}=e;if("chunked"===n.headers.get("Transfer-Encoding"))return"Chunked Transfer-Encoding is not supported";var o=null===(t=n.headers.get("Content-Type"))||void 0===t?void 0:t.toLowerCase(),s=No.some((e=>null==o?void 0:o.startsWith(e)));if(o&&s)return"Content-Type ".concat(o," is not supported");var{hostname:a,isHostDenied:l}=bo(i,r);return l?a+" is in deny list":null}({r:t,options:n,url:r});return br(i)?Fo(t):Promise.resolve(i)})),Po.apply(this,arguments)}function Lo(e,t,n){if(!n.initiatorTypes.includes("fetch"))return()=>{};var i=ko("request",n.recordHeaders),o=ko("response",n.recordHeaders),s=yo(t,"fetch",(s=>function(){var a=r((function*(r,a){var l,c,u,d=new Request(r,a),h={};try{var p={};d.headers.forEach(((e,t)=>{p[t]=e})),i&&(h.requestHeaders=p),Eo({type:"request",headers:p,url:r,recordBody:n.recordBody})&&(h.requestBody=yield function(e){return Oo.apply(this,arguments)}({r:d,options:n,url:r})),c=t.performance.now(),l=yield s(d),u=t.performance.now();var v={};return l.headers.forEach(((e,t)=>{v[t]=e})),o&&(h.responseHeaders=v),Eo({type:"response",headers:v,url:r,recordBody:n.recordBody})&&(h.responseBody=yield function(e){return Po.apply(this,arguments)}({r:l,options:n,url:r})),l}finally{xo(t,"fetch",d.url,c,u).then((t=>{var n,r=Ao({entry:t,method:d.method,status:null===(n=l)||void 0===n?void 0:n.status,networkRequest:h,start:c,end:u,url:d.url,initiatorType:"fetch"});e({requests:r})})).catch((()=>{}))}}));return function(e,t){return a.apply(this,arguments)}}()));return()=>{s()}}var Do=null;function Bo(e,n,r){if(!("performance"in n))return()=>{};if(Do)return wo.warn("Network observer already initialised, doing nothing"),()=>{};var i=r?Object.assign({},ho,r):ho,o=n=>{var r=[];n.requests.forEach((e=>{var t=i.maskRequestFn(e);t&&r.push(t)})),r.length>0&&e(t(t({},n),{},{requests:r}))},s=Io(o,n,i),a=()=>{},l=()=>{};return(i.recordHeaders||i.recordBody)&&(a=function(e,t,n){if(!n.initiatorTypes.includes("xmlhttprequest"))return()=>{};var r=ko("request",n.recordHeaders),i=ko("response",n.recordHeaders),o=yo(t.XMLHttpRequest.prototype,"open",(o=>function(s,a){var l,c,u=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],d=arguments.length>3?arguments[3]:void 0,h=arguments.length>4?arguments[4]:void 0,p=this,v=new Request(a),g={},f={},m=p.setRequestHeader.bind(p);p.setRequestHeader=(e,t)=>(f[e]=t,m(e,t)),r&&(g.requestHeaders=f);var _=p.send.bind(p);p.send=e=>(Eo({type:"request",headers:f,url:a,recordBody:n.recordBody})&&(g.requestBody=Mo({body:e,options:n,url:a})),l=t.performance.now(),_(e)),p.addEventListener("readystatechange",(()=>{if(p.readyState===p.DONE){c=t.performance.now();var r={};p.getAllResponseHeaders().trim().split(/[\r\n]+/).forEach((e=>{var t=e.split(": "),n=t.shift(),i=t.join(": ");n&&(r[n]=i)})),i&&(g.responseHeaders=r),Eo({type:"response",headers:r,url:a,recordBody:n.recordBody})&&(g.responseBody=Mo({body:p.response,options:n,url:a})),xo(t,"xmlhttprequest",v.url,l,c).then((t=>{var n=Ao({entry:t,method:s,status:null==p?void 0:p.status,networkRequest:g,start:l,end:c,url:a.toString(),initiatorType:"xmlhttprequest"});e({requests:n})})).catch((()=>{}))}})),o.call(p,s,a,u,d,h)}));return()=>{o()}}(o,n,i),l=Lo(o,n,i)),Do=()=>{s(),a(),l()}}var Ho=e=>({name:"rrweb/network@1",observer:Bo,options:e});er.__PosthogExtensions__=er.__PosthogExtensions__||{},er.__PosthogExtensions__.rrwebPlugins={getRecordConsolePlugin:$n,getRecordNetworkPlugin:Ho},er.__PosthogExtensions__.rrweb={record:qt,version:"v2"},er.rrweb={record:qt,version:"v2"},er.rrwebConsoleRecord={getRecordConsolePlugin:$n},er.getRecordNetworkPlugin=Ho;var qo,$o,Wo,Vo,Zo,Go,Uo,jo,zo={},Yo=[],Xo=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,Jo=Array.isArray;function Ko(e,t){for(var n in t)e[n]=t[n];return e}function Qo(e){var t=e.parentNode;t&&t.removeChild(e)}function es(e,t,n){var r,i,o,s={};for(o in t)"key"==o?r=t[o]:"ref"==o?i=t[o]:s[o]=t[o];if(arguments.length>2&&(s.children=arguments.length>3?qo.call(arguments,2):n),"function"==typeof e&&null!=e.defaultProps)for(o in e.defaultProps)void 0===s[o]&&(s[o]=e.defaultProps[o]);return ts(e,s,r,i,null)}function ts(e,t,n,r,i){var o={type:e,props:t,key:n,ref:r,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,constructor:void 0,__v:null==i?++Wo:i,__i:-1,__u:0};return null==i&&null!=$o.vnode&&$o.vnode(o),o}function ns(e){return e.children}function rs(e,t){this.props=e,this.context=t}function is(e,t){if(null==t)return e.__?is(e.__,e.__i+1):null;for(var n;t<e.__k.length;t++)if(null!=(n=e.__k[t])&&null!=n.__e)return n.__e;return"function"==typeof e.type?is(e):null}function os(e){var t,n;if(null!=(e=e.__)&&null!=e.__c){for(e.__e=e.__c.base=null,t=0;t<e.__k.length;t++)if(null!=(n=e.__k[t])&&null!=n.__e){e.__e=e.__c.base=n.__e;break}return os(e)}}function ss(e){(!e.__d&&(e.__d=!0)&&Vo.push(e)&&!as.__r++||Zo!==$o.debounceRendering)&&((Zo=$o.debounceRendering)||Go)(as)}function as(){var e,t,n,r,i,o,s,a,l;for(Vo.sort(Uo);e=Vo.shift();)e.__d&&(t=Vo.length,r=void 0,o=(i=(n=e).__v).__e,a=[],l=[],(s=n.__P)&&((r=Ko({},i)).__v=i.__v+1,$o.vnode&&$o.vnode(r),gs(s,r,i,n.__n,void 0!==s.ownerSVGElement,32&i.__u?[o]:null,a,null==o?is(i):o,!!(32&i.__u),l),r.__.__k[r.__i]=r,fs(a,r,l),r.__e!=o&&os(r)),Vo.length>t&&Vo.sort(Uo));as.__r=0}function ls(e,t,n,r,i,o,s,a,l,c,u){var d,h,p,v,g,f=r&&r.__k||Yo,m=t.length;for(n.__d=l,function(e,t,n){var r,i,o,s,a,l=t.length,c=n.length,u=c,d=0;for(e.__k=[],r=0;r<l;r++)null!=(i=e.__k[r]=null==(i=t[r])||"boolean"==typeof i||"function"==typeof i?null:"string"==typeof i||"number"==typeof i||"bigint"==typeof i||i.constructor==String?ts(null,i,null,null,i):Jo(i)?ts(ns,{children:i},null,null,null):void 0===i.constructor&&i.__b>0?ts(i.type,i.props,i.key,i.ref?i.ref:null,i.__v):i)?(i.__=e,i.__b=e.__b+1,a=us(i,n,s=r+d,u),i.__i=a,o=null,-1!==a&&(u--,(o=n[a])&&(o.__u|=131072)),null==o||null===o.__v?(-1==a&&d--,"function"!=typeof i.type&&(i.__u|=65536)):a!==s&&(a===s+1?d++:a>s?u>l-s?d+=a-s:d--:d=a<s&&a==s-1?a-s:0,a!==r+d&&(i.__u|=65536))):(o=n[r])&&null==o.key&&o.__e&&(o.__e==e.__d&&(e.__d=is(o)),_s(o,o,!1),n[r]=null,u--);if(u)for(r=0;r<c;r++)null!=(o=n[r])&&0==(131072&o.__u)&&(o.__e==e.__d&&(e.__d=is(o)),_s(o,o))}(n,t,f),l=n.__d,d=0;d<m;d++)null!=(p=n.__k[d])&&"boolean"!=typeof p&&"function"!=typeof p&&(h=-1===p.__i?zo:f[p.__i]||zo,p.__i=d,gs(e,p,h,i,o,s,a,l,c,u),v=p.__e,p.ref&&h.ref!=p.ref&&(h.ref&&ms(h.ref,null,p),u.push(p.ref,p.__c||v,p)),null==g&&null!=v&&(g=v),65536&p.__u||h.__k===p.__k?l=cs(p,l,e):"function"==typeof p.type&&void 0!==p.__d?l=p.__d:v&&(l=v.nextSibling),p.__d=void 0,p.__u&=-196609);n.__d=l,n.__e=g}function cs(e,t,n){var r,i;if("function"==typeof e.type){for(r=e.__k,i=0;r&&i<r.length;i++)r[i]&&(r[i].__=e,t=cs(r[i],t,n));return t}return e.__e!=t&&(n.insertBefore(e.__e,t||null),t=e.__e),t&&t.nextSibling}function us(e,t,n,r){var i=e.key,o=e.type,s=n-1,a=n+1,l=t[n];if(null===l||l&&i==l.key&&o===l.type)return n;if(r>(null!=l&&0==(131072&l.__u)?1:0))for(;s>=0||a<t.length;){if(s>=0){if((l=t[s])&&0==(131072&l.__u)&&i==l.key&&o===l.type)return s;s--}if(a<t.length){if((l=t[a])&&0==(131072&l.__u)&&i==l.key&&o===l.type)return a;a++}}return-1}function ds(e,t,n){"-"===t[0]?e.setProperty(t,null==n?"":n):e[t]=null==n?"":"number"!=typeof n||Xo.test(t)?n:n+"px"}function hs(e,t,n,r,i){var o;e:if("style"===t)if("string"==typeof n)e.style.cssText=n;else{if("string"==typeof r&&(e.style.cssText=r=""),r)for(t in r)n&&t in n||ds(e.style,t,"");if(n)for(t in n)r&&n[t]===r[t]||ds(e.style,t,n[t])}else if("o"===t[0]&&"n"===t[1])o=t!==(t=t.replace(/(PointerCapture)$|Capture$/,"$1")),t=t.toLowerCase()in e?t.toLowerCase().slice(2):t.slice(2),e.l||(e.l={}),e.l[t+o]=n,n?r?n.u=r.u:(n.u=Date.now(),e.addEventListener(t,o?vs:ps,o)):e.removeEventListener(t,o?vs:ps,o);else{if(i)t=t.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if("width"!==t&&"height"!==t&&"href"!==t&&"list"!==t&&"form"!==t&&"tabIndex"!==t&&"download"!==t&&"rowSpan"!==t&&"colSpan"!==t&&"role"!==t&&t in e)try{e[t]=null==n?"":n;break e}catch(e){}"function"==typeof n||(null==n||!1===n&&"-"!==t[4]?e.removeAttribute(t):e.setAttribute(t,n))}}function ps(e){var t=this.l[e.type+!1];if(e.t){if(e.t<=t.u)return}else e.t=Date.now();return t($o.event?$o.event(e):e)}function vs(e){return this.l[e.type+!0]($o.event?$o.event(e):e)}function gs(e,t,n,r,i,o,s,a,l,c){var u,d,h,p,v,g,f,m,_,y,b,w,S,C,I,k=t.type;if(void 0!==t.constructor)return null;128&n.__u&&(l=!!(32&n.__u),o=[a=t.__e=n.__e]),(u=$o.__b)&&u(t);e:if("function"==typeof k)try{if(m=t.props,_=(u=k.contextType)&&r[u.__c],y=u?_?_.props.value:u.__:r,n.__c?f=(d=t.__c=n.__c).__=d.__E:("prototype"in k&&k.prototype.render?t.__c=d=new k(m,y):(t.__c=d=new rs(m,y),d.constructor=k,d.render=ys),_&&_.sub(d),d.props=m,d.state||(d.state={}),d.context=y,d.__n=r,h=d.__d=!0,d.__h=[],d._sb=[]),null==d.__s&&(d.__s=d.state),null!=k.getDerivedStateFromProps&&(d.__s==d.state&&(d.__s=Ko({},d.__s)),Ko(d.__s,k.getDerivedStateFromProps(m,d.__s))),p=d.props,v=d.state,d.__v=t,h)null==k.getDerivedStateFromProps&&null!=d.componentWillMount&&d.componentWillMount(),null!=d.componentDidMount&&d.__h.push(d.componentDidMount);else{if(null==k.getDerivedStateFromProps&&m!==p&&null!=d.componentWillReceiveProps&&d.componentWillReceiveProps(m,y),!d.__e&&(null!=d.shouldComponentUpdate&&!1===d.shouldComponentUpdate(m,d.__s,y)||t.__v===n.__v)){for(t.__v!==n.__v&&(d.props=m,d.state=d.__s,d.__d=!1),t.__e=n.__e,t.__k=n.__k,t.__k.forEach((function(e){e&&(e.__=t)})),b=0;b<d._sb.length;b++)d.__h.push(d._sb[b]);d._sb=[],d.__h.length&&s.push(d);break e}null!=d.componentWillUpdate&&d.componentWillUpdate(m,d.__s,y),null!=d.componentDidUpdate&&d.__h.push((function(){d.componentDidUpdate(p,v,g)}))}if(d.context=y,d.props=m,d.__P=e,d.__e=!1,w=$o.__r,S=0,"prototype"in k&&k.prototype.render){for(d.state=d.__s,d.__d=!1,w&&w(t),u=d.render(d.props,d.state,d.context),C=0;C<d._sb.length;C++)d.__h.push(d._sb[C]);d._sb=[]}else do{d.__d=!1,w&&w(t),u=d.render(d.props,d.state,d.context),d.state=d.__s}while(d.__d&&++S<25);d.state=d.__s,null!=d.getChildContext&&(r=Ko(Ko({},r),d.getChildContext())),h||null==d.getSnapshotBeforeUpdate||(g=d.getSnapshotBeforeUpdate(p,v)),ls(e,Jo(I=null!=u&&u.type===ns&&null==u.key?u.props.children:u)?I:[I],t,n,r,i,o,s,a,l,c),d.base=t.__e,t.__u&=-161,d.__h.length&&s.push(d),f&&(d.__E=d.__=null)}catch(e){t.__v=null,l||null!=o?(t.__e=a,t.__u|=l?160:32,o[o.indexOf(a)]=null):(t.__e=n.__e,t.__k=n.__k),$o.__e(e,t,n)}else null==o&&t.__v===n.__v?(t.__k=n.__k,t.__e=n.__e):t.__e=function(e,t,n,r,i,o,s,a,l){var c,u,d,h,p,v,g,f=n.props,m=t.props,_=t.type;if("svg"===_&&(i=!0),null!=o)for(c=0;c<o.length;c++)if((p=o[c])&&"setAttribute"in p==!!_&&(_?p.localName===_:3===p.nodeType)){e=p,o[c]=null;break}if(null==e){if(null===_)return document.createTextNode(m);e=i?document.createElementNS("http://www.w3.org/2000/svg",_):document.createElement(_,m.is&&m),o=null,a=!1}if(null===_)f===m||a&&e.data===m||(e.data=m);else{if(o=o&&qo.call(e.childNodes),f=n.props||zo,!a&&null!=o)for(f={},c=0;c<e.attributes.length;c++)f[(p=e.attributes[c]).name]=p.value;for(c in f)p=f[c],"children"==c||("dangerouslySetInnerHTML"==c?d=p:"key"===c||c in m||hs(e,c,null,p,i));for(c in m)p=m[c],"children"==c?h=p:"dangerouslySetInnerHTML"==c?u=p:"value"==c?v=p:"checked"==c?g=p:"key"===c||a&&"function"!=typeof p||f[c]===p||hs(e,c,p,f[c],i);if(u)a||d&&(u.__html===d.__html||u.__html===e.innerHTML)||(e.innerHTML=u.__html),t.__k=[];else if(d&&(e.innerHTML=""),ls(e,Jo(h)?h:[h],t,n,r,i&&"foreignObject"!==_,o,s,o?o[0]:n.__k&&is(n,0),a,l),null!=o)for(c=o.length;c--;)null!=o[c]&&Qo(o[c]);a||(c="value",void 0!==v&&(v!==e[c]||"progress"===_&&!v||"option"===_&&v!==f[c])&&hs(e,c,v,f[c],!1),c="checked",void 0!==g&&g!==e[c]&&hs(e,c,g,f[c],!1))}return e}(n.__e,t,n,r,i,o,s,l,c);(u=$o.diffed)&&u(t)}function fs(e,t,n){t.__d=void 0;for(var r=0;r<n.length;r++)ms(n[r],n[++r],n[++r]);$o.__c&&$o.__c(t,e),e.some((function(t){try{e=t.__h,t.__h=[],e.some((function(e){e.call(t)}))}catch(e){$o.__e(e,t.__v)}}))}function ms(e,t,n){try{"function"==typeof e?e(t):e.current=t}catch(e){$o.__e(e,n)}}function _s(e,t,n){var r,i;if($o.unmount&&$o.unmount(e),(r=e.ref)&&(r.current&&r.current!==e.__e||ms(r,null,t)),null!=(r=e.__c)){if(r.componentWillUnmount)try{r.componentWillUnmount()}catch(e){$o.__e(e,t)}r.base=r.__P=null,e.__c=void 0}if(r=e.__k)for(i=0;i<r.length;i++)r[i]&&_s(r[i],t,n||"function"!=typeof e.type);n||null==e.__e||Qo(e.__e),e.__=e.__e=e.__d=void 0}function ys(e,t,n){return this.constructor(e,n)}function bs(e,t,n){var r,i,o,s;$o.__&&$o.__(e,t),i=(r="function"==typeof n)?null:t.__k,o=[],s=[],gs(t,e=(!r&&n||t).__k=es(ns,null,[e]),i||zo,zo,void 0!==t.ownerSVGElement,!r&&n?[n]:i?null:t.firstChild?qo.call(t.childNodes):null,o,!r&&n?n:i?i.__e:t.firstChild,r,s),fs(o,e,s)}function ws(e,t,n){var r,i,o,s,a=Ko({},e.props);for(o in e.type&&e.type.defaultProps&&(s=e.type.defaultProps),t)"key"==o?r=t[o]:"ref"==o?i=t[o]:a[o]=void 0===t[o]&&void 0!==s?s[o]:t[o];return arguments.length>2&&(a.children=arguments.length>3?qo.call(arguments,2):n),ts(e.type,a,r||e.key,i||e.ref,null)}qo=Yo.slice,$o={__e:function(e,t,n,r){for(var i,o,s;t=t.__;)if((i=t.__c)&&!i.__)try{if((o=i.constructor)&&null!=o.getDerivedStateFromError&&(i.setState(o.getDerivedStateFromError(e)),s=i.__d),null!=i.componentDidCatch&&(i.componentDidCatch(e,r||{}),s=i.__d),s)return i.__E=i}catch(t){e=t}throw e}},Wo=0,rs.prototype.setState=function(e,t){var n;n=null!=this.__s&&this.__s!==this.state?this.__s:this.__s=Ko({},this.state),"function"==typeof e&&(e=e(Ko({},n),this.props)),e&&Ko(n,e),null!=e&&this.__v&&(t&&this._sb.push(t),ss(this))},rs.prototype.forceUpdate=function(e){this.__v&&(this.__e=!0,e&&this.__h.push(e),ss(this))},rs.prototype.render=ns,Vo=[],Go="function"==typeof Promise?Promise.prototype.then.bind(Promise.resolve()):setTimeout,Uo=function(e,t){return e.__v.__b-t.__v.__b},as.__r=0,jo=0;var Ss=Wn,Cs=zn,Is="seenSurvey_",ks=Rr("[Surveys]"),Es=e=>"\n .survey-form, .thank-you-message {\n position: fixed;\n margin: 0px;\n bottom: 0px;\n color: black;\n font-weight: normal;\n font-family: ".concat((null==e?void 0:e.fontFamily)||"-apple-system",', BlinkMacSystemFont, "Inter", "Segoe UI", "Roboto", Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";\n text-align: left;\n max-width: ').concat(parseInt((null==e?void 0:e.maxWidth)||"300"),"px;\n width: 100%;\n z-index: ").concat(parseInt((null==e?void 0:e.zIndex)||"99999"),";\n border: 1.5px solid ").concat((null==e?void 0:e.borderColor)||"#c9c6c6",";\n border-bottom: 0px;\n ").concat({left:"left: 30px;",right:"right: 30px;",center:"\n left: 50%;\n transform: translateX(-50%);\n "}[(null==e?void 0:e.position)||"right"]||"right: 30px;","\n flex-direction: column;\n background: ").concat((null==e?void 0:e.backgroundColor)||"#eeeded",";\n border-top-left-radius: 10px;\n border-top-right-radius: 10px;\n box-shadow: -6px 0 16px -8px rgb(0 0 0 / 8%), -9px 0 28px 0 rgb(0 0 0 / 5%), -12px 0 48px 16px rgb(0 0 0 / 3%);\n }\n\n .survey-box, .thank-you-message-container {\n padding: 20px 25px 10px;\n display: flex;\n flex-direction: column;\n border-radius: 10px;\n }\n\n .thank-you-message {\n text-align: center;\n }\n\n .form-submit[disabled] {\n opacity: 0.6;\n filter: grayscale(50%);\n cursor: not-allowed;\n }\n .survey-form textarea {\n color: #2d2d2d;\n font-size: 14px;\n font-family: ").concat((null==e?void 0:e.fontFamily)||"-apple-system",', BlinkMacSystemFont, "Inter", "Segoe UI", "Roboto", Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";\n background: white;\n color: black;\n outline: none;\n padding-left: 10px;\n padding-right: 10px;\n padding-top: 10px;\n border-radius: 6px;\n border-color: ').concat((null==e?void 0:e.borderColor)||"#c9c6c6",";\n margin-top: 14px;\n width: 100%;\n box-sizing: border-box;\n }\n .survey-box:has(.survey-question:empty):not(:has(.survey-question-description)) textarea {\n margin-top: 0;\n }\n .form-submit {\n box-sizing: border-box;\n margin: 0;\n font-family: inherit;\n overflow: visible;\n text-transform: none;\n position: relative;\n display: inline-block;\n font-weight: 700;\n white-space: nowrap;\n text-align: center;\n border: 1.5px solid transparent;\n cursor: pointer;\n user-select: none;\n touch-action: manipulation;\n padding: 12px;\n font-size: 14px;\n border-radius: 6px;\n outline: 0;\n background: ").concat((null==e?void 0:e.submitButtonColor)||"black"," !important;\n text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.12);\n box-shadow: 0 2px 0 rgba(0, 0, 0, 0.045);\n width: 100%;\n }\n .form-cancel {\n display: flex;\n float: right;\n border: none;\n background: none;\n cursor: pointer;\n }\n .cancel-btn-wrapper {\n position: absolute;\n width: 35px;\n height: 35px;\n border-radius: 100%;\n top: 0;\n right: 0;\n transform: translate(50%, -50%);\n background: white;\n border: 1.5px solid ").concat((null==e?void 0:e.borderColor)||"#c9c6c6",";\n display: flex;\n justify-content: center;\n align-items: center;\n }\n .bolded { font-weight: 600; }\n .buttons {\n display: flex;\n justify-content: center;\n }\n .footer-branding {\n font-size: 11px;\n margin-top: 10px;\n text-align: center;\n display: flex;\n justify-content: center;\n gap: 4px;\n align-items: center;\n font-weight: 500;\n background: ").concat((null==e?void 0:e.backgroundColor)||"#eeeded",";\n text-decoration: none;\n backgroundColor: ").concat((null==e?void 0:e.backgroundColor)||"#eeeded",";\n color: ").concat(Ts((null==e?void 0:e.backgroundColor)||"#eeeded"),";\n }\n .survey-question {\n font-weight: 500;\n font-size: 14px;\n background: ").concat((null==e?void 0:e.backgroundColor)||"#eeeded",";\n }\n .question-textarea-wrapper {\n display: flex;\n flex-direction: column;\n }\n .survey-question-description {\n font-size: 13px;\n padding-top: 5px;\n background: ").concat((null==e?void 0:e.backgroundColor)||"#eeeded",";\n }\n .ratings-number {\n font-size: 16px;\n font-weight: 600;\n padding: 8px 0px;\n border: none;\n }\n .ratings-number:hover {\n cursor: pointer;\n }\n .rating-options {\n margin-top: 14px;\n }\n .rating-options-number {\n display: grid;\n border-radius: 6px;\n overflow: hidden;\n border: 1.5px solid ").concat((null==e?void 0:e.borderColor)||"#c9c6c6",";\n }\n .rating-options-number > .ratings-number {\n border-right: 1px solid ").concat((null==e?void 0:e.borderColor)||"#c9c6c6",";\n }\n .rating-options-number > .ratings-number:last-of-type {\n border-right: 0px;\n }\n .rating-options-number .rating-active {\n background: ").concat((null==e?void 0:e.ratingButtonActiveColor)||"black",";\n }\n .rating-options-emoji {\n display: flex;\n justify-content: space-between;\n }\n .ratings-emoji {\n font-size: 16px;\n background-color: transparent;\n border: none;\n padding: 0px;\n }\n .ratings-emoji:hover {\n cursor: pointer;\n }\n .ratings-emoji.rating-active svg {\n fill: ").concat((null==e?void 0:e.ratingButtonActiveColor)||"black",";\n }\n .emoji-svg {\n fill: '#939393';\n }\n .rating-text {\n display: flex;\n flex-direction: row;\n font-size: 11px;\n justify-content: space-between;\n margin-top: 6px;\n background: ").concat((null==e?void 0:e.backgroundColor)||"#eeeded",";\n opacity: .60;\n }\n .multiple-choice-options {\n margin-top: 13px;\n font-size: 14px;\n }\n .survey-box:has(.survey-question:empty):not(:has(.survey-question-description)) .multiple-choice-options {\n margin-top: 0;\n }\n .multiple-choice-options .choice-option {\n display: flex;\n align-items: center;\n gap: 4px;\n font-size: 13px;\n cursor: pointer;\n margin-bottom: 5px;\n position: relative;\n }\n .multiple-choice-options > .choice-option:last-of-type {\n margin-bottom: 0px;\n }\n .multiple-choice-options input {\n cursor: pointer;\n position: absolute;\n opacity: 0;\n }\n .choice-check {\n position: absolute;\n right: 10px;\n background: white;\n }\n .choice-check svg {\n display: none;\n }\n .multiple-choice-options .choice-option:hover .choice-check svg {\n display: inline-block;\n opacity: .25;\n }\n .multiple-choice-options input:checked + label + .choice-check svg {\n display: inline-block;\n opacity: 100% !important;\n }\n .multiple-choice-options input:checked + label {\n font-weight: bold;\n border: 1.5px solid rgba(0,0,0);\n }\n .multiple-choice-options input:checked + label input {\n font-weight: bold;\n }\n .multiple-choice-options label {\n width: 100%;\n cursor: pointer;\n padding: 10px;\n border: 1.5px solid rgba(0,0,0,.25);\n border-radius: 4px;\n background: white;\n }\n .multiple-choice-options .choice-option-open label {\n padding-right: 30px;\n display: flex;\n flex-wrap: wrap;\n gap: 8px;\n max-width: 100%;\n }\n .multiple-choice-options .choice-option-open label span {\n width: 100%;\n }\n .multiple-choice-options .choice-option-open input:disabled + label {\n opacity: 0.6;\n }\n .multiple-choice-options .choice-option-open label input {\n position: relative;\n opacity: 1;\n flex-grow: 1;\n border: 0;\n outline: 0;\n }\n .thank-you-message-body {\n margin-top: 6px;\n font-size: 14px;\n background: ").concat((null==e?void 0:e.backgroundColor)||"#eeeded",";\n }\n .thank-you-message-header {\n margin: 10px 0px 0px;\n background: ").concat((null==e?void 0:e.backgroundColor)||"#eeeded",";\n }\n .thank-you-message-container .form-submit {\n margin-top: 20px;\n margin-bottom: 10px;\n }\n .thank-you-message-countdown {\n margin-left: 6px;\n }\n .bottom-section {\n margin-top: 14px;\n }\n ");function xs(e){if("#"===e[0]){var t=e.replace(/^#/,"");return"rgb("+parseInt(t.slice(0,2),16)+","+parseInt(t.slice(2,4),16)+","+parseInt(t.slice(4,6),16)+")"}return"rgb(255, 255, 255)"}function Ts(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Fs;"#"===t[0]&&(e=xs(t)),t.startsWith("rgb")&&(e=t);var n=function(e){return{aliceblue:"#f0f8ff",antiquewhite:"#faebd7",aqua:"#00ffff",aquamarine:"#7fffd4",azure:"#f0ffff",beige:"#f5f5dc",bisque:"#ffe4c4",black:"#000000",blanchedalmond:"#ffebcd",blue:"#0000ff",blueviolet:"#8a2be2",brown:"#a52a2a",burlywood:"#deb887",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",cornflowerblue:"#6495ed",cornsilk:"#fff8dc",crimson:"#dc143c",cyan:"#00ffff",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkgray:"#a9a9a9",darkgreen:"#006400",darkkhaki:"#bdb76b",darkmagenta:"#8b008b",darkolivegreen:"#556b2f",darkorange:"#ff8c00",darkorchid:"#9932cc",darkred:"#8b0000",darksalmon:"#e9967a",darkseagreen:"#8fbc8f",darkslateblue:"#483d8b",darkslategray:"#2f4f4f",darkturquoise:"#00ced1",darkviolet:"#9400d3",deeppink:"#ff1493",deepskyblue:"#00bfff",dimgray:"#696969",dodgerblue:"#1e90ff",firebrick:"#b22222",floralwhite:"#fffaf0",forestgreen:"#228b22",fuchsia:"#ff00ff",gainsboro:"#dcdcdc",ghostwhite:"#f8f8ff",gold:"#ffd700",goldenrod:"#daa520",gray:"#808080",green:"#008000",greenyellow:"#adff2f",honeydew:"#f0fff0",hotpink:"#ff69b4","indianred ":"#cd5c5c",indigo:"#4b0082",ivory:"#fffff0",khaki:"#f0e68c",lavender:"#e6e6fa",lavenderblush:"#fff0f5",lawngreen:"#7cfc00",lemonchiffon:"#fffacd",lightblue:"#add8e6",lightcoral:"#f08080",lightcyan:"#e0ffff",lightgoldenrodyellow:"#fafad2",lightgrey:"#d3d3d3",lightgreen:"#90ee90",lightpink:"#ffb6c1",lightsalmon:"#ffa07a",lightseagreen:"#20b2aa",lightskyblue:"#87cefa",lightslategray:"#778899",lightsteelblue:"#b0c4de",lightyellow:"#ffffe0",lime:"#00ff00",limegreen:"#32cd32",linen:"#faf0e6",magenta:"#ff00ff",maroon:"#800000",mediumaquamarine:"#66cdaa",mediumblue:"#0000cd",mediumorchid:"#ba55d3",mediumpurple:"#9370d8",mediumseagreen:"#3cb371",mediumslateblue:"#7b68ee",mediumspringgreen:"#00fa9a",mediumturquoise:"#48d1cc",mediumvioletred:"#c71585",midnightblue:"#191970",mintcream:"#f5fffa",mistyrose:"#ffe4e1",moccasin:"#ffe4b5",navajowhite:"#ffdead",navy:"#000080",oldlace:"#fdf5e6",olive:"#808000",olivedrab:"#6b8e23",orange:"#ffa500",orangered:"#ff4500",orchid:"#da70d6",palegoldenrod:"#eee8aa",palegreen:"#98fb98",paleturquoise:"#afeeee",palevioletred:"#d87093",papayawhip:"#ffefd5",peachpuff:"#ffdab9",peru:"#cd853f",pink:"#ffc0cb",plum:"#dda0dd",powderblue:"#b0e0e6",purple:"#800080",red:"#ff0000",rosybrown:"#bc8f8f",royalblue:"#4169e1",saddlebrown:"#8b4513",salmon:"#fa8072",sandybrown:"#f4a460",seagreen:"#2e8b57",seashell:"#fff5ee",sienna:"#a0522d",silver:"#c0c0c0",skyblue:"#87ceeb",slateblue:"#6a5acd",slategray:"#708090",snow:"#fffafa",springgreen:"#00ff7f",steelblue:"#4682b4",tan:"#d2b48c",teal:"#008080",thistle:"#d8bfd8",tomato:"#ff6347",turquoise:"#40e0d0",violet:"#ee82ee",wheat:"#f5deb3",white:"#ffffff",whitesmoke:"#f5f5f5",yellow:"#ffff00",yellowgreen:"#9acd32"}[e.toLowerCase()]}(t);if(n&&(e=xs(n)),!e)return"black";var r=e.match(/^rgba?\((\d+),\s*(\d+),\s*(\d+)(?:,\s*(\d+(?:\.\d+)?))?\)$/);if(r){var i=parseInt(r[1]),o=parseInt(r[2]),s=parseInt(r[3]);return Math.sqrt(i*i*.299+o*o*.587+s*s*.114)>127.5?"black":"white"}return"black"}var Ms,Rs,As,Ns={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:"right"},Fs="#eeeded",Os=function(){var e,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=arguments.length>1?arguments[1]:void 0,i=arguments.length>2?arguments[2]:void 0;i?(localStorage.setItem(qs(r),"true"),i.capture("survey sent",t(t({$survey_name:r.name,$survey_id:r.id,$survey_iteration:r.current_iteration,$survey_iteration_start_date:r.current_iteration_start_date,$survey_questions:r.questions.map((e=>e.question)),sessionRecordingUrl:null===(e=i.get_session_replay_url)||void 0===e?void 0:e.call(i)},n),{},{$set:{[$s(r,"responded")]:!0}})),Ss.dispatchEvent(new Event("PHSurveySent"))):ks.error("[survey sent] event not captured, PostHog instance not found.")},Ps=(e,t,n)=>{var r;t?n||(t.capture("survey dismissed",{$survey_name:e.name,$survey_id:e.id,$survey_iteration:e.current_iteration,$survey_iteration_start_date:e.current_iteration_start_date,sessionRecordingUrl:null===(r=t.get_session_replay_url)||void 0===r?void 0:r.call(t),$set:{[$s(e,"dismissed")]:!0}}),localStorage.setItem(qs(e),"true"),Ss.dispatchEvent(new Event("PHSurveyClosed"))):ks.error("[survey dismissed] event not captured, PostHog instance not found.")},Ls=e=>e.map((e=>({sort:Math.floor(10*Math.random()),value:e}))).sort(((e,t)=>e.sort-t.sort)).map((e=>e.value)),Ds=(e,t)=>e.length===t.length&&e.every(((e,n)=>e===t[n]))?t.reverse():t,Bs=e=>(e.questions.forEach(((e,t)=>{e.originalQuestionIndex=t})),e.appearance&&e.appearance.shuffleQuestions?Ds(e.questions,Ls(e.questions)):e.questions),Hs=e=>{var t,n;return!(null===(t=e.conditions)||void 0===t||null===(n=t.events)||void 0===n||!n.repeatedActivation||!(e=>{var t,n,r,i,o,s;return null!=(null===(t=e.conditions)||void 0===t||null===(n=t.events)||void 0===n||null===(r=n.values)||void 0===r?void 0:r.length)&&(null===(i=e.conditions)||void 0===i||null===(o=i.events)||void 0===o||null===(s=o.values)||void 0===s?void 0:s.length)>0})(e))},qs=e=>{var t="".concat(Is).concat(e.id);return e.current_iteration&&e.current_iteration>0&&(t="".concat(Is).concat(e.id,"_").concat(e.current_iteration)),t},$s=(e,t)=>{var n="$survey_".concat(t,"/").concat(e.id);return e.current_iteration&&e.current_iteration>0&&(n="$survey_".concat(t,"/").concat(e.id,"/").concat(e.current_iteration)),n},Ws=function(e,t){var n={__c:t="__cC"+jo++,__:e,Consumer:function(e,t){return e.children(t)},Provider:function(e){var n,r;return this.getChildContext||(n=[],(r={})[t]=this,this.getChildContext=function(){return r},this.shouldComponentUpdate=function(e){this.props.value!==e.value&&n.some((function(e){e.__e=!0,ss(e)}))},this.sub=function(e){n.push(e);var t=e.componentWillUnmount;e.componentWillUnmount=function(){n.splice(n.indexOf(e),1),t&&t.call(e)}}),e.children}};return n.Provider.__=n.Consumer.contextType=n}({isPreviewMode:!1,previewPageIndex:0,handleCloseSurveyPopup:()=>{},isPopup:!0,onPreviewSubmit:()=>{}}),Vs=e=>{var{component:t,children:n,renderAsHtml:r,style:i}=e;return ws(t,r?{dangerouslySetInnerHTML:{__html:n},style:i}:{children:n,style:i})};!function(e){e.Popover="popover",e.API="api",e.Widget="widget"}(Ms||(Ms={})),function(e){e.Open="open",e.MultipleChoice="multiple_choice",e.SingleChoice="single_choice",e.Rating="rating",e.Link="link"}(Rs||(Rs={})),function(e){e.NextQuestion="next_question",e.End="end",e.ResponseBased="response_based",e.SpecificQuestion="specific_question"}(As||(As={}));class Zs{constructor(){i(this,"events",{}),this.events={}}on(e,t){return this.events[e]||(this.events[e]=[]),this.events[e].push(t),()=>{this.events[e]=this.events[e].filter((e=>e!==t))}}emit(e,t){for(var n of this.events[e]||[])n(t);for(var r of this.events["*"]||[])r(e,t)}}class Gs{constructor(e){i(this,"_debugEventEmitter",new Zs),i(this,"checkStep",((e,t)=>this.checkStepEvent(e,t)&&this.checkStepUrl(e,t)&&this.checkStepElement(e,t))),i(this,"checkStepEvent",((e,t)=>null==t||!t.event||(null==e?void 0:e.event)===(null==t?void 0:t.event))),this.instance=e,this.actionEvents=new Set,this.actionRegistry=new Set}init(){var e;if(!mr(null===(e=this.instance)||void 0===e?void 0:e._addCaptureHook)){var t;null===(t=this.instance)||void 0===t||t._addCaptureHook(((e,t)=>{this.on(e,t)}))}}register(e){var t,n;if(!mr(null===(t=this.instance)||void 0===t?void 0:t._addCaptureHook)&&(e.forEach((e=>{var t,n;null===(t=this.actionRegistry)||void 0===t||t.add(e),null===(n=e.steps)||void 0===n||n.forEach((e=>{var t;null===(t=this.actionEvents)||void 0===t||t.add((null==e?void 0:e.event)||"")}))})),null!==(n=this.instance)&&void 0!==n&&n.autocapture)){var r,i=new Set;e.forEach((e=>{var t;null===(t=e.steps)||void 0===t||t.forEach((e=>{null!=e&&e.selector&&i.add(null==e?void 0:e.selector)}))})),null===(r=this.instance)||void 0===r||r.autocapture.setElementSelectors(i)}}on(e,t){var n;null!=t&&0!=e.length&&(this.actionEvents.has(e)||this.actionEvents.has(null==t?void 0:t.event))&&this.actionRegistry&&(null===(n=this.actionRegistry)||void 0===n?void 0:n.size)>0&&this.actionRegistry.forEach((e=>{this.checkAction(t,e)&&this._debugEventEmitter.emit("actionCaptured",e.name)}))}_addActionHook(e){this.onAction("actionCaptured",(t=>e(t)))}checkAction(e,t){if(null==(null==t?void 0:t.steps))return!1;for(var n of t.steps)if(this.checkStep(e,n))return!0;return!1}onAction(e,t){return this._debugEventEmitter.on(e,t)}checkStepUrl(e,t){if(null!=t&&t.url){var n,r=null==e||null===(n=e.properties)||void 0===n?void 0:n.$current_url;if(!r||"string"!=typeof r)return!1;if(!Gs.matchString(r,null==t?void 0:t.url,(null==t?void 0:t.url_matching)||"contains"))return!1}return!0}static matchString(e,t,n){switch(n){case"regex":return!!Wn&&jr(e,t);case"exact":return t===e;case"contains":var r=Gs.escapeStringRegexp(t).replace(/_/g,".").replace(/%/g,".*");return jr(e,r);default:return!1}}static escapeStringRegexp(e){return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}checkStepElement(e,t){if((null!=t&&t.href||null!=t&&t.tag_name||null!=t&&t.text)&&!this.getElementsList(e).some((e=>!(null!=t&&t.href&&!Gs.matchString(e.href||"",null==t?void 0:t.href,(null==t?void 0:t.href_matching)||"exact"))&&((null==t||!t.tag_name||e.tag_name===(null==t?void 0:t.tag_name))&&!(null!=t&&t.text&&!Gs.matchString(e.text||"",null==t?void 0:t.text,(null==t?void 0:t.text_matching)||"exact")&&!Gs.matchString(e.$el_text||"",null==t?void 0:t.text,(null==t?void 0:t.text_matching)||"exact"))))))return!1;if(null!=t&&t.selector){var n,r=null==e||null===(n=e.properties)||void 0===n?void 0:n.$element_selectors;if(!r)return!1;if(!r.includes(null==t?void 0:t.selector))return!1}return!0}getElementsList(e){return null==(null==e?void 0:e.properties.$elements)?[]:null==e?void 0:e.properties.$elements}}class Us{constructor(e){this.instance=e,this.eventToSurveys=new Map,this.actionToSurveys=new Map}register(e){var t;mr(null===(t=this.instance)||void 0===t?void 0:t._addCaptureHook)||(this.setupEventBasedSurveys(e),this.setupActionBasedSurveys(e))}setupActionBasedSurveys(e){var t=e.filter((e=>{var t,n,r,i;return(null===(t=e.conditions)||void 0===t?void 0:t.actions)&&(null===(n=e.conditions)||void 0===n||null===(r=n.actions)||void 0===r||null===(i=r.values)||void 0===i?void 0:i.length)>0}));if(0!==t.length){if(null==this.actionMatcher){this.actionMatcher=new Gs(this.instance),this.actionMatcher.init();this.actionMatcher._addActionHook((e=>{this.onAction(e)}))}t.forEach((e=>{var t,n,r,i,o,s,a,l,c,u;e.conditions&&null!==(t=e.conditions)&&void 0!==t&&t.actions&&null!==(n=e.conditions)&&void 0!==n&&null!==(r=n.actions)&&void 0!==r&&r.values&&(null===(i=e.conditions)||void 0===i||null===(o=i.actions)||void 0===o||null===(s=o.values)||void 0===s?void 0:s.length)>0&&(null===(a=this.actionMatcher)||void 0===a||a.register(e.conditions.actions.values),null===(l=e.conditions)||void 0===l||null===(c=l.actions)||void 0===c||null===(u=c.values)||void 0===u||u.forEach((t=>{if(t&&t.name){var n=this.actionToSurveys.get(t.name);n&&n.push(e.id),this.actionToSurveys.set(t.name,n||[e.id])}})))}))}}setupEventBasedSurveys(e){var t;if(0!==e.filter((e=>{var t,n,r,i;return(null===(t=e.conditions)||void 0===t?void 0:t.events)&&(null===(n=e.conditions)||void 0===n||null===(r=n.events)||void 0===r||null===(i=r.values)||void 0===i?void 0:i.length)>0})).length){null===(t=this.instance)||void 0===t||t._addCaptureHook(((e,t)=>{this.onEvent(e,t)})),e.forEach((e=>{var t,n,r;null===(t=e.conditions)||void 0===t||null===(n=t.events)||void 0===n||null===(r=n.values)||void 0===r||r.forEach((t=>{if(t&&t.name){var n=this.eventToSurveys.get(t.name);n&&n.push(e.id),this.eventToSurveys.set(t.name,n||[e.id])}}))}))}}onEvent(e,t){var n,r,i=(null===(n=this.instance)||void 0===n||null===(r=n.persistence)||void 0===r?void 0:r.props[Ci])||[];if(Us.SURVEY_SHOWN_EVENT_NAME==e&&t&&i.length>0){var o,s=null==t||null===(o=t.properties)||void 0===o?void 0:o.$survey_id;if(s){var a=i.indexOf(s);a>=0&&(i.splice(a,1),this._updateActivatedSurveys(i))}}else this.eventToSurveys.has(e)&&this._updateActivatedSurveys(i.concat(this.eventToSurveys.get(e)||[]))}onAction(e){var t,n,r=(null===(t=this.instance)||void 0===t||null===(n=t.persistence)||void 0===n?void 0:n.props[Ci])||[];this.actionToSurveys.has(e)&&this._updateActivatedSurveys(r.concat(this.actionToSurveys.get(e)||[]))}_updateActivatedSurveys(e){var t,n;null===(t=this.instance)||void 0===t||null===(n=t.persistence)||void 0===n||n.register({[Ci]:[...new Set(e)]})}getSurveys(){var e,t,n=null===(e=this.instance)||void 0===e||null===(t=e.persistence)||void 0===t?void 0:t.props[Ci];return n||[]}getEventToSurveys(){return this.eventToSurveys}_getActionMatcher(){return this.actionMatcher}}i(Us,"SURVEY_SHOWN_EVENT_NAME","survey shown");var js=Rr("[Surveys]"),zs={icontains:e=>!!Wn&&Wn.location.href.toLowerCase().indexOf(e.toLowerCase())>-1,not_icontains:e=>!!Wn&&-1===Wn.location.href.toLowerCase().indexOf(e.toLowerCase()),regex:e=>!!Wn&&jr(Wn.location.href,e),not_regex:e=>!!Wn&&!jr(Wn.location.href,e),exact:e=>(null==Wn?void 0:Wn.location.href)===e,is_not:e=>(null==Wn?void 0:Wn.location.href)!==e};function Ys(e,t,n){var r,i=e.questions[t],o=t+1;if(null===(r=i.branching)||void 0===r||!r.type)return t===e.questions.length-1?As.End:o;if(i.branching.type===As.End)return As.End;if(i.branching.type===As.SpecificQuestion){if(Number.isInteger(i.branching.index))return i.branching.index}else if(i.branching.type===As.ResponseBased){if(i.type===Rs.SingleChoice){var s,a,l=i.choices.indexOf("".concat(n));if(null!==(s=i.branching)&&void 0!==s&&null!==(a=s.responseValues)&&void 0!==a&&a.hasOwnProperty(l)){var c=i.branching.responseValues[l];return Number.isInteger(c)?c:c===As.End?As.End:o}}else if(i.type===Rs.Rating){var u,d;if("number"!=typeof n||!Number.isInteger(n))throw new Error("The response type must be an integer");var h=function(e,t){if(3===t){if(e<1||e>3)throw new Error("The response must be in range 1-3");return 1===e?"negative":2===e?"neutral":"positive"}if(5===t){if(e<1||e>5)throw new Error("The response must be in range 1-5");return e<=2?"negative":3===e?"neutral":"positive"}if(7===t){if(e<1||e>7)throw new Error("The response must be in range 1-7");return e<=3?"negative":4===e?"neutral":"positive"}if(10===t){if(e<0||e>10)throw new Error("The response must be in range 0-10");return e<=6?"detractors":e<=8?"passives":"promoters"}throw new Error("The scale must be one of: 3, 5, 7, 10")}(n,i.scale);if(null!==(u=i.branching)&&void 0!==u&&null!==(d=u.responseValues)&&void 0!==d&&d.hasOwnProperty(h)){var p=i.branching.responseValues[h];return Number.isInteger(p)?p:p===As.End?As.End:o}}return o}return js.warn("Falling back to next question index due to unexpected branching type"),o}function Xs(e){var t,n,r;return null===(t=e.conditions)||void 0===t||!t.url||zs[null!==(n=null===(r=e.conditions)||void 0===r?void 0:r.urlMatchType)&&void 0!==n?n:"icontains"](e.conditions.url)}class Js{constructor(e){i(this,"getNextSurveyStep",Ys),this.instance=e,this._surveyEventReceiver=null}onRemoteConfig(e){this._decideServerResponse=!!e.surveys,js.info("decideServerResponse set to ".concat(this._decideServerResponse)),this.loadIfEnabled()}reset(){localStorage.removeItem("lastSeenSurveyDate");var e=(()=>{for(var e=[],t=0;t<localStorage.length;t++){var n=localStorage.key(t);null!=n&&n.startsWith(Is)&&e.push(n)}return e})();e.forEach((e=>localStorage.removeItem(e)))}loadIfEnabled(){if(!this._surveyManager)if(this.instance.config.disable_surveys)js.info("Disabled. Not loading surveys.");else{var e=null==er?void 0:er.__PosthogExtensions__;if(e){var t=e.generateSurveys;if(this._decideServerResponse)if(null==this._surveyEventReceiver&&(this._surveyEventReceiver=new Us(this.instance)),t)this._surveyManager=t(this.instance);else{var n=e.loadExternalDependency;n?n(this.instance,"surveys",(t=>{var n;t?js.error("Could not load surveys script",t):this._surveyManager=null===(n=e.generateSurveys)||void 0===n?void 0:n.call(e,this.instance)})):js.error("PostHog loadExternalDependency extension not found. Cannot load remote config.")}else js.warn("Decide not loaded yet. Not loading surveys.")}else js.error("PostHog Extensions not found.")}}getSurveys(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(this.instance.config.disable_surveys)return js.info("Disabled. Not loading surveys."),e([]);null==this._surveyEventReceiver&&(this._surveyEventReceiver=new Us(this.instance));var n=this.instance.get_property(Si);if(n&&!t)return js.info("Surveys already loaded, using existing data."),e(n);this.instance._send_request({url:this.instance.requestRouter.endpointFor("api","/api/surveys/?token=".concat(this.instance.config.token)),method:"GET",callback:t=>{var n,r=t.statusCode;if(200!==r||!t.json)return js.error("Surveys API could not be loaded, status: ".concat(r)),e([]);var i,o=t.json.surveys||[],s=o.filter((e=>{var t,n,r,i,o,s,a,l,c,u,d,h;return(null===(t=e.conditions)||void 0===t?void 0:t.events)&&(null===(n=e.conditions)||void 0===n||null===(r=n.events)||void 0===r?void 0:r.values)&&(null===(i=e.conditions)||void 0===i||null===(o=i.events)||void 0===o||null===(s=o.values)||void 0===s?void 0:s.length)>0||(null===(a=e.conditions)||void 0===a?void 0:a.actions)&&(null===(l=e.conditions)||void 0===l||null===(c=l.actions)||void 0===c?void 0:c.values)&&(null===(u=e.conditions)||void 0===u||null===(d=u.actions)||void 0===d||null===(h=d.values)||void 0===h?void 0:h.length)>0}));s.length>0&&(null===(i=this._surveyEventReceiver)||void 0===i||i.register(s));return null===(n=this.instance.persistence)||void 0===n||n.register({[Si]:o}),e(o)}})}getActiveMatchingSurveys(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];this.getSurveys((t=>{var n,r=t.filter((e=>!(!e.start_date||e.end_date))).filter((e=>{var t;if(!e.conditions)return!0;var n=Xs(e),r=null===(t=e.conditions)||void 0===t||!t.selector||(null==zn?void 0:zn.querySelector(e.conditions.selector));return n&&r})),i=null===(n=this._surveyEventReceiver)||void 0===n?void 0:n.getSurveys(),o=r.filter((e=>{var t,n,r,o,s,a,l,c,u,d,h;if(!(e.linked_flag_key||e.targeting_flag_key||e.internal_targeting_flag_key||null!==(t=e.feature_flag_keys)&&void 0!==t&&t.length))return!0;var p=!e.linked_flag_key||this.instance.featureFlags.isFeatureEnabled(e.linked_flag_key),v=!e.targeting_flag_key||this.instance.featureFlags.isFeatureEnabled(e.targeting_flag_key),g=(null===(n=e.conditions)||void 0===n?void 0:n.events)&&(null===(r=e.conditions)||void 0===r||null===(o=r.events)||void 0===o?void 0:o.values)&&(null===(s=e.conditions)||void 0===s||null===(a=s.events)||void 0===a?void 0:a.values.length)>0,f=(null===(l=e.conditions)||void 0===l?void 0:l.actions)&&(null===(c=e.conditions)||void 0===c||null===(u=c.actions)||void 0===u?void 0:u.values)&&(null===(d=e.conditions)||void 0===d||null===(h=d.actions)||void 0===h?void 0:h.values.length)>0,m=!g&&!f||(null==i?void 0:i.includes(e.id)),_=this._canActivateRepeatedly(e),y=!(e.internal_targeting_flag_key&&!_)||this.instance.featureFlags.isFeatureEnabled(e.internal_targeting_flag_key),b=this.checkFlags(e);return p&&v&&y&&m&&b}));return e(o)}),t)}checkFlags(e){var t;return null===(t=e.feature_flag_keys)||void 0===t||!t.length||e.feature_flag_keys.every((e=>{var{key:t,value:n}=e;return!t||!n||this.instance.featureFlags.isFeatureEnabled(n)}))}_canActivateRepeatedly(e){var t;return wr(null===(t=er.__PosthogExtensions__)||void 0===t?void 0:t.canActivateRepeatedly)?(js.warn("init was not called"),!1):er.__PosthogExtensions__.canActivateRepeatedly(e)}canRenderSurvey(e){wr(this._surveyManager)?js.warn("init was not called"):this.getSurveys((t=>{var n=t.filter((t=>t.id===e))[0];this._surveyManager.canRenderSurvey(n)}))}renderSurvey(e,t){wr(this._surveyManager)?js.warn("init was not called"):this.getSurveys((n=>{var r=n.filter((t=>t.id===e))[0];this._surveyManager.renderSurvey(r,null==zn?void 0:zn.querySelector(t))}))}}var Ks,Qs,ea,ta,na=0,ra=[],ia=[],oa=$o.__b,sa=$o.__r,aa=$o.diffed,la=$o.__c,ca=$o.unmount;function ua(e,t){$o.__h&&$o.__h(Qs,e,na||t),na=0;var n=Qs.__H||(Qs.__H={__:[],__h:[]});return e>=n.__.length&&n.__.push({__V:ia}),n.__[e]}function da(e){return na=1,function(e,t,n){var r=ua(Ks++,2);if(r.t=e,!r.__c&&(r.__=[Sa(void 0,t),function(e){var t=r.__N?r.__N[0]:r.__[0],n=r.t(t,e);t!==n&&(r.__N=[n,r.__[1]],r.__c.setState({}))}],r.__c=Qs,!Qs.u)){var i=function(e,t,n){if(!r.__c.__H)return!0;var i=r.__c.__H.__.filter((function(e){return e.__c}));if(i.every((function(e){return!e.__N})))return!o||o.call(this,e,t,n);var s=!1;return i.forEach((function(e){if(e.__N){var t=e.__[0];e.__=e.__N,e.__N=void 0,t!==e.__[0]&&(s=!0)}})),!(!s&&r.__c.props===e)&&(!o||o.call(this,e,t,n))};Qs.u=!0;var o=Qs.shouldComponentUpdate,s=Qs.componentWillUpdate;Qs.componentWillUpdate=function(e,t,n){if(this.__e){var r=o;o=void 0,i(e,t,n),o=r}s&&s.call(this,e,t,n)},Qs.shouldComponentUpdate=i}return r.__N||r.__}(Sa,e)}function ha(e,t){var n=ua(Ks++,3);!$o.__s&&wa(n.__H,t)&&(n.__=e,n.i=t,Qs.__H.__h.push(n))}function pa(e){return na=5,va((function(){return{current:e}}),[])}function va(e,t){var n=ua(Ks++,7);return wa(n.__H,t)?(n.__V=e(),n.i=t,n.__h=e,n.__V):n.__}function ga(e){var t=Qs.context[e.__c],n=ua(Ks++,9);return n.c=e,t?(null==n.__&&(n.__=!0,t.sub(Qs)),t.props.value):e.__}function fa(){for(var e;e=ra.shift();)if(e.__P&&e.__H)try{e.__H.__h.forEach(ya),e.__H.__h.forEach(ba),e.__H.__h=[]}catch(t){e.__H.__h=[],$o.__e(t,e.__v)}}$o.__b=function(e){Qs=null,oa&&oa(e)},$o.__r=function(e){sa&&sa(e),Ks=0;var t=(Qs=e.__c).__H;t&&(ea===Qs?(t.__h=[],Qs.__h=[],t.__.forEach((function(e){e.__N&&(e.__=e.__N),e.__V=ia,e.__N=e.i=void 0}))):(t.__h.forEach(ya),t.__h.forEach(ba),t.__h=[],Ks=0)),ea=Qs},$o.diffed=function(e){aa&&aa(e);var t=e.__c;t&&t.__H&&(t.__H.__h.length&&(1!==ra.push(t)&&ta===$o.requestAnimationFrame||((ta=$o.requestAnimationFrame)||_a)(fa)),t.__H.__.forEach((function(e){e.i&&(e.__H=e.i),e.__V!==ia&&(e.__=e.__V),e.i=void 0,e.__V=ia}))),ea=Qs=null},$o.__c=function(e,t){t.some((function(e){try{e.__h.forEach(ya),e.__h=e.__h.filter((function(e){return!e.__||ba(e)}))}catch(n){t.some((function(e){e.__h&&(e.__h=[])})),t=[],$o.__e(n,e.__v)}})),la&&la(e,t)},$o.unmount=function(e){ca&&ca(e);var t,n=e.__c;n&&n.__H&&(n.__H.__.forEach((function(e){try{ya(e)}catch(e){t=e}})),n.__H=void 0,t&&$o.__e(t,n.__v))};var ma="function"==typeof requestAnimationFrame;function _a(e){var t,n=function(){clearTimeout(r),ma&&cancelAnimationFrame(t),setTimeout(e)},r=setTimeout(n,100);ma&&(t=requestAnimationFrame(n))}function ya(e){var t=Qs,n=e.__c;"function"==typeof n&&(e.__c=void 0,n()),Qs=t}function ba(e){var t=Qs;e.__c=e.__(),Qs=t}function wa(e,t){return!e||e.length!==t.length||t.some((function(t,n){return t!==e[n]}))}function Sa(e,t){return"function"==typeof t?t(e):t}var Ca=zn;var Ia=0;function ka(e,t,n,r,i,o){var s,a,l={};for(a in t)"ref"==a?s=t[a]:l[a]=t[a];var c={type:e,props:l,key:n,ref:s,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,constructor:void 0,__v:--Ia,__i:-1,__u:0,__source:i,__self:o};if("function"==typeof e&&(s=e.defaultProps))for(a in s)void 0===l[a]&&(l[a]=s[a]);return $o.vnode&&$o.vnode(c),c}var Ea=ka("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 -960 960 960",width:"48",children:ka("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"})}),xa=ka("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 -960 960 960",width:"48",children:ka("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"})}),Ta=ka("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 -960 960 960",width:"48",children:ka("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"})}),Ma=ka("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 -960 960 960",width:"48",children:ka("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"})}),Ra=ka("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 -960 960 960",width:"48",children:ka("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"})}),Aa=ka("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:ka("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"})}),Na=ka("svg",{width:"77",height:"14",viewBox:"0 0 77 14",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[ka("g",{"clip-path":"url(#clip0_2415_6911)",children:[ka("mask",{id:"mask0_2415_6911",style:{maskType:"luminance"},maskUnits:"userSpaceOnUse",x:"0",y:"0",width:"77",height:"14",children:ka("path",{d:"M0.5 0H76.5V14H0.5V0Z",fill:"white"})}),ka("g",{mask:"url(#mask0_2415_6911)",children:[ka("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"}),ka("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"}),ka("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"}),ka("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"}),ka("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"}),ka("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"})]})]}),ka("defs",{children:ka("clipPath",{id:"clip0_2415_6911",children:ka("rect",{width:"76",height:"14",fill:"white",transform:"translate(0.5)"})})})]}),Fa=ka("svg",{width:"16",height:"12",viewBox:"0 0 16 12",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:ka("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"})});function Oa(){return ka("a",{href:"https://posthog.com",target:"_blank",rel:"noopener",className:"footer-branding",children:["Survey by ",Na]})}function Pa(e){var{text:t,submitDisabled:n,appearance:r,onSubmit:i,link:o,onPreviewSubmit:s}=e,{isPreviewMode:a,isPopup:l}=ga(Ws),c=r.submitButtonTextColor||Ts(r.submitButtonColor||Ns.submitButtonColor);return ka("div",{className:"bottom-section",children:[ka("div",{className:"buttons",children:ka("button",{className:"form-submit",disabled:n&&!a,type:"button",style:l?{color:c}:{},onClick:()=>{a?null==s||s():(o&&(null==Wn||Wn.open(o)),i())},children:t})}),!r.whiteLabel&&ka(Oa,{})]})}function La(e){var{question:t,description:n,descriptionContentType:r,backgroundColor:i,forceDisableHtml:o}=e,{isPopup:s}=ga(Ws);return ka("div",{style:s?{backgroundColor:i||Ns.backgroundColor}:{},children:[ka("div",{className:"survey-question",children:t}),n&&Vs({component:es("div",{className:"survey-question-description"}),children:n,renderAsHtml:!o&&"text"!==r})]})}function Da(e){var{onClick:t}=e,{isPreviewMode:n}=ga(Ws);return ka("div",{className:"cancel-btn-wrapper",onClick:t,disabled:n,children:ka("button",{className:"form-cancel",onClick:t,disabled:n,children:Aa})})}function Ba(e){var{header:n,description:r,contentType:i,forceDisableHtml:o,appearance:s,onClose:a,styleOverrides:l}=e,c=Ts(s.backgroundColor||Ns.backgroundColor),{isPopup:u}=ga(Ws);return ka(ns,{children:ka("div",{className:"thank-you-message",style:t({},l),children:ka("div",{className:"thank-you-message-container",children:[u&&ka(Da,{onClick:()=>a()}),ka("h3",{className:"thank-you-message-header",style:{color:c},children:n}),r&&Vs({component:es("div",{className:"thank-you-message-body"}),children:r,renderAsHtml:!o&&"text"!==i,style:{color:c}}),u&&ka(Pa,{text:s.thankYouMessageCloseButtonText||"Close",submitDisabled:!1,appearance:s,onSubmit:()=>a()})]})})})}function Ha(e){var t,n=pa(null),[r,i]=da(null!==(t=e.defaultTextColor)&&void 0!==t?t:"black");return ha((()=>{if(n.current){var e=function(e){var t=Ss.getComputedStyle(e).backgroundColor;if("rgba(0, 0, 0, 0)"===t)return"black";var n=t.match(/^rgba?\((\d+),\s*(\d+),\s*(\d+)(?:,\s*(\d+(?:\.\d+)?))?\)$/);if(!n)return"black";var r=parseInt(n[1]),i=parseInt(n[2]),o=parseInt(n[3]);return Math.sqrt(r*r*.299+i*i*.587+o*o*.114)>127.5?"black":"white"}(n.current);i(e)}}),[e.appearance,e.forceUpdate]),{ref:n,textColor:r}}function qa(e){var{question:t,forceDisableHtml:n,appearance:r,onSubmit:i,onPreviewSubmit:o}=e,s=pa(null),[a,l]=da("");return ka("div",{ref:s,children:[ka(La,{question:t.question,description:t.description,descriptionContentType:t.descriptionContentType,backgroundColor:r.backgroundColor,forceDisableHtml:n}),ka("textarea",{rows:4,placeholder:null==r?void 0:r.placeholder,onInput:e=>l(e.currentTarget.value)}),ka(Pa,{text:t.buttonText||"Submit",submitDisabled:!a&&!t.optional,appearance:r,onSubmit:()=>i(a),onPreviewSubmit:()=>o(a)})]})}function $a(e){var{question:t,forceDisableHtml:n,appearance:r,onSubmit:i,onPreviewSubmit:o}=e;return ka(ns,{children:[ka(La,{question:t.question,description:t.description,descriptionContentType:t.descriptionContentType,forceDisableHtml:n}),ka(Pa,{text:t.buttonText||"Submit",submitDisabled:!1,link:t.link,appearance:r,onSubmit:()=>i("link clicked"),onPreviewSubmit:()=>o("link clicked")})]})}function Wa(e){var{question:t,forceDisableHtml:n,displayQuestionIndex:r,appearance:i,onSubmit:o,onPreviewSubmit:s}=e,a=t.scale,l=10===t.scale?0:1,[c,u]=da(null);return ka(ns,{children:[ka(La,{question:t.question,description:t.description,descriptionContentType:t.descriptionContentType,forceDisableHtml:n,backgroundColor:i.backgroundColor}),ka("div",{className:"rating-section",children:[ka("div",{className:"rating-options",children:["emoji"===t.display&&ka("div",{className:"rating-options-emoji",children:(3===t.scale?Ga:Ua).map(((e,t)=>{var n=t+1===c;return ka("button",{className:"ratings-emoji question-".concat(r,"-rating-").concat(t," ").concat(n?"rating-active":null),value:t+1,type:"button",onClick:()=>{u(t+1)},style:{fill:n?i.ratingButtonActiveColor:i.ratingButtonColor,borderColor:i.borderColor},children:e},t)}))}),"number"===t.display&&ka("div",{className:"rating-options-number",style:{gridTemplateColumns:"repeat(".concat(a-l+1,", minmax(0, 1fr))")},children:Xa(t.scale).map(((e,t)=>ka(Va,{displayQuestionIndex:r,active:c===e,appearance:i,num:e,setActiveNumber:e=>{u(e)}},t)))})]}),ka("div",{className:"rating-text",children:[ka("div",{children:t.lowerBoundLabel}),ka("div",{children:t.upperBoundLabel})]})]}),ka(Pa,{text:t.buttonText||(null==i?void 0:i.submitButtonText)||"Submit",submitDisabled:br(c)&&!t.optional,appearance:i,onSubmit:()=>o(c),onPreviewSubmit:()=>s(c)})]})}function Va(e){var{num:t,active:n,displayQuestionIndex:r,appearance:i,setActiveNumber:o}=e,{textColor:s,ref:a}=Ha({appearance:i,defaultTextColor:"black",forceUpdate:n});return ka("button",{ref:a,className:"ratings-number question-".concat(r,"-rating-").concat(t," ").concat(n?"rating-active":null),type:"button",onClick:()=>{o(t)},style:{color:s,backgroundColor:n?i.ratingButtonActiveColor:i.ratingButtonColor,borderColor:i.borderColor},children:t})}function Za(e){var{question:t,forceDisableHtml:n,displayQuestionIndex:r,appearance:i,onSubmit:o,onPreviewSubmit:s}=e,a=pa(null),l=va((()=>(e=>{if(!e.shuffleOptions)return e.choices;var t=e.choices,n="";e.hasOpenChoice&&(n=t.pop());var r=Ds(t,Ls(t));return e.hasOpenChoice&&(e.choices.push(n),r.push(n)),r})(t)),[t]),[c,u]=da(t.type===Rs.MultipleChoice?[]:null),[d,h]=da(!1),[p,v]=da(""),g=t.type===Rs.SingleChoice?"radio":"checkbox";return ka("div",{ref:a,children:[ka(La,{question:t.question,description:t.description,descriptionContentType:t.descriptionContentType,forceDisableHtml:n,backgroundColor:i.backgroundColor}),ka("div",{className:"multiple-choice-options",children:l.map(((e,n)=>{var i="choice-option",o=e,s=e;return t.hasOpenChoice&&n===t.choices.length-1&&(i+=" choice-option-open"),ka("div",{className:i,children:[ka("input",{type:g,id:"surveyQuestion".concat(r,"Choice").concat(n),name:"question".concat(r),value:o,disabled:!o,onInput:()=>t.hasOpenChoice&&n===t.choices.length-1?h(!d):t.type===Rs.SingleChoice?u(o):t.type===Rs.MultipleChoice&&dr(c)?c.includes(o)?u(c.filter((e=>e!==o))):u([...c,o]):void 0}),ka("label",{htmlFor:"surveyQuestion".concat(r,"Choice").concat(n),style:{color:"black"},children:t.hasOpenChoice&&n===t.choices.length-1?ka(ns,{children:[ka("span",{children:[s,":"]}),ka("input",{type:"text",id:"surveyQuestion".concat(r,"Choice").concat(n,"Open"),name:"question".concat(r),onInput:e=>{var n=e.currentTarget.value;return t.type===Rs.SingleChoice?u(n):t.type===Rs.MultipleChoice&&dr(c)?v(n):void 0}})]}):s}),ka("span",{className:"choice-check",style:{color:"black"},children:Fa})]})}))}),ka(Pa,{text:t.buttonText||"Submit",submitDisabled:(br(c)||dr(c)&&!d&&0===c.length||dr(c)&&d&&!p&&0===c.length&&!t.optional)&&!t.optional,appearance:i,onSubmit:()=>{d&&t.type===Rs.MultipleChoice?dr(c)&&o([...c,p]):o(c)},onPreviewSubmit:()=>{d&&t.type===Rs.MultipleChoice?dr(c)&&s([...c,p]):s(c)}})]})}var Ga=[Ta,xa,Ea],Ua=[Ma,Ta,xa,Ea,Ra],ja=[1,2,3,4,5],za=[1,2,3,4,5,6,7],Ya=[0,1,2,3,4,5,6,7,8,9,10];function Xa(e){switch(e){case 5:default:return ja;case 7:return za;case 10:return Ya}}var Ja=Rr("[Surveys]"),Ka=Wn,Qa=zn;class el{constructor(e){var t=this;i(this,"canShowNextEventBasedSurvey",(()=>{var e,t=Qa.querySelectorAll("div[class^=PostHogSurvey]");return!(t.length>0)||1===(null===(e=t[t.length-1].shadowRoot)||void 0===e?void 0:e.childElementCount)})),i(this,"handlePopoverSurvey",(e=>{var t,n=null===(t=e.conditions)||void 0===t?void 0:t.seenSurveyWaitPeriodInDays,r=localStorage.getItem("lastSeenSurveyDate");if(n&&r){var i=new Date,o=Math.abs(i.getTime()-new Date(r).getTime());if(Math.ceil(o/864e5)<n)return}var s=(e=>!!localStorage.getItem(qs(e))&&!Hs(e))(e);if(!s){this.addSurveyToFocus(e.id);var a=((e,t,n)=>{var r=Cs.createElement("div");r.className="PostHogSurvey".concat(t);var i=r.attachShadow({mode:"open"});if(e){var o=Object.assign(Cs.createElement("style"),{innerText:e});i.appendChild(o)}return Cs.body.appendChild(r),i})(Es(null==e?void 0:e.appearance),e.id);bs(ka(nl,{posthog:this.posthog,survey:e,removeSurveyFromFocus:this.removeSurveyFromFocus,isPopup:!0},"popover-survey"),a)}})),i(this,"handleWidget",(e=>{var t=function(e){var t,n=Ca.createElement("div");n.className="PostHogWidget".concat(e.id);var r,i=n.attachShadow({mode:"open"}),o=(r=null===(t=e.appearance)||void 0===t?void 0:t.widgetColor,"\n .ph-survey-widget-tab {\n position: fixed;\n top: 50%;\n right: 0;\n background: ".concat(r||"#e0a045",";\n color: white;\n transform: rotate(-90deg) translate(0, -100%);\n transform-origin: right top;\n min-width: 40px;\n padding: 8px 12px;\n font-weight: 500;\n border-radius: 3px 3px 0 0;\n text-align: center;\n cursor: pointer;\n z-index: 9999999;\n }\n .ph-survey-widget-tab:hover {\n padding-bottom: 13px;\n }\n .ph-survey-widget-button {\n position: fixed;\n }\n "));return i.append(Object.assign(Ca.createElement("style"),{innerText:o})),Ca.body.appendChild(n),i}(e),n=Es(e.appearance);t.appendChild(Object.assign(Qa.createElement("style"),{innerText:n})),bs(ka(il,{posthog:this.posthog,survey:e,removeSurveyFromFocus:this.removeSurveyFromFocus},"feedback-survey"),t)})),i(this,"handleWidgetSelector",(e=>{var t,n=(null===(t=e.appearance)||void 0===t?void 0:t.widgetSelector)&&Qa.querySelector(e.appearance.widgetSelector);if(n)if(0===Qa.querySelectorAll(".PostHogWidget".concat(e.id)).length)this.handleWidget(e);else if(1===Qa.querySelectorAll(".PostHogWidget".concat(e.id)).length&&!n.getAttribute("PHWidgetSurveyClickListener")){var r,i,o=null===(r=Qa.querySelector(".PostHogWidget".concat(e.id)))||void 0===r||null===(i=r.shadowRoot)||void 0===i?void 0:i.querySelector(".survey-form");n.addEventListener("click",(()=>{o&&(o.style.display="none"===o.style.display?"block":"none",o.addEventListener("PHSurveyClosed",(()=>{this.removeSurveyFromFocus(e.id),o.style.display="none"})))})),n.setAttribute("PHWidgetSurveyClickListener","true")}})),i(this,"canRenderSurvey",(e=>{var t={visible:!1};return e.end_date?(t.disabledReason="survey was completed on ".concat(e.end_date),t):e.type!=Ms.Popover?(t.disabledReason="Only Popover survey types can be rendered",t):!e.linked_flag_key||this.posthog.featureFlags.isFeatureEnabled(e.linked_flag_key)?!e.targeting_flag_key||this.posthog.featureFlags.isFeatureEnabled(e.targeting_flag_key)?!e.internal_targeting_flag_key||this.posthog.featureFlags.isFeatureEnabled(e.internal_targeting_flag_key)?(t.visible=!0,t):(t.disabledReason="internal targeting feature flag ".concat(e.internal_targeting_flag_key," is false"),t):(t.disabledReason="targeting feature flag ".concat(e.targeting_flag_key," is false"),t):(t.disabledReason="linked feature flag ".concat(e.linked_flag_key," is false"),t)})),i(this,"renderSurvey",((e,t)=>{bs(ka(nl,{posthog:this.posthog,survey:e,removeSurveyFromFocus:this.removeSurveyFromFocus,isPopup:!1},"popover-survey"),t)})),i(this,"callSurveysAndEvaluateDisplayLogic",(function(){var e,n=arguments.length>0&&void 0!==arguments[0]&&arguments[0];null===(e=t.posthog)||void 0===e||e.getActiveMatchingSurveys((e=>{var n=e.filter((e=>"api"!==e.type));t.sortSurveysByAppearanceDelay(n).forEach((e=>{if(br(t.surveyInFocus)){var n,r,i;if(e.type===Ms.Widget)"tab"===(null===(n=e.appearance)||void 0===n?void 0:n.widgetType)&&0===Qa.querySelectorAll(".PostHogWidget".concat(e.id)).length&&t.handleWidget(e),"selector"===(null===(r=e.appearance)||void 0===r?void 0:r.widgetType)&&null!==(i=e.appearance)&&void 0!==i&&i.widgetSelector&&t.handleWidgetSelector(e);e.type===Ms.Popover&&t.canShowNextEventBasedSurvey()&&t.handlePopoverSurvey(e)}}))}),n)})),i(this,"addSurveyToFocus",(e=>{br(this.surveyInFocus)||Ja.error("Survey ".concat([...this.surveyInFocus]," already in focus. Cannot add survey ").concat(e,".")),this.surveyInFocus=e})),i(this,"removeSurveyFromFocus",(e=>{this.surveyInFocus!==e&&Ja.error("Survey ".concat(e," is not in focus. Cannot remove survey ").concat(e,".")),this.surveyInFocus=null})),this.posthog=e,this.surveyInFocus=null}sortSurveysByAppearanceDelay(e){return e.sort(((e,t)=>{var n,r;return((null===(n=e.appearance)||void 0===n?void 0:n.surveyPopupDelaySeconds)||0)-((null===(r=t.appearance)||void 0===r?void 0:r.surveyPopupDelaySeconds)||0)}))}getTestAPI(){return{addSurveyToFocus:this.addSurveyToFocus,removeSurveyFromFocus:this.removeSurveyFromFocus,surveyInFocus:this.surveyInFocus,canShowNextEventBasedSurvey:this.canShowNextEventBasedSurvey,handleWidget:this.handleWidget,handlePopoverSurvey:this.handlePopoverSurvey,handleWidgetSelector:this.handleWidgetSelector,sortSurveysByAppearanceDelay:this.sortSurveysByAppearanceDelay}}}function tl(e){if(Qa&&Ka){var t=new el(e);return t.callSurveysAndEvaluateDisplayLogic(!0),setInterval((()=>{t.callSurveysAndEvaluateDisplayLogic(!1)}),1e3),t}}function nl(e){var n,r,i,o,s,a,{survey:l,forceDisableHtml:c,posthog:u,style:d,previewPageIndex:h,removeSurveyFromFocus:p,isPopup:v,onPreviewSubmit:g=(()=>{})}=e,f=Number.isInteger(h),m=null!==(n=l.appearance)&&void 0!==n&&n.surveyPopupDelaySeconds?1e3*l.appearance.surveyPopupDelaySeconds:0,{isPopupVisible:_,isSurveySent:y,setIsPopupVisible:b}=function(e,t,n,r,i){var[o,s]=da(r||0===n),[a,l]=da(!1);return ha((()=>{if(t){if(!r){var o,a=()=>{i(e.id),s(!1)},c=()=>{var t,n;null!==(t=e.appearance)&&void 0!==t&&t.displayThankYouMessage?(l(!0),i(e.id),null!==(n=e.appearance)&&void 0!==n&&n.autoDisappear&&setTimeout((()=>{s(!1)}),5e3)):(i(e.id),s(!1))},u=()=>{var n;s(!0),Ka.dispatchEvent(new Event("PHSurveyShown")),t.capture("survey shown",{$survey_name:e.name,$survey_id:e.id,$survey_iteration:e.current_iteration,$survey_iteration_start_date:e.current_iteration_start_date,sessionRecordingUrl:null===(n=t.get_session_replay_url)||void 0===n?void 0:n.call(t)}),localStorage.setItem("lastSeenSurveyDate",(new Date).toISOString())};return Ka.addEventListener("PHSurveyClosed",a),Ka.addEventListener("PHSurveySent",c),n>0?(o=setTimeout((()=>{u()}),n),()=>{clearTimeout(o),Ka.removeEventListener("PHSurveyClosed",a),Ka.removeEventListener("PHSurveySent",c)}):(u(),()=>{Ka.removeEventListener("PHSurveyClosed",a),Ka.removeEventListener("PHSurveySent",c)})}}else Ja.error("usePopupVisibility hook called without a PostHog instance.")}),[]),ha((()=>{var t;if(!r&&null!==(t=e.conditions)&&void 0!==t&&t.url){var n=()=>{Xs(e)||(s(!1),i(e.id))};Ka.addEventListener("popstate",n),Ka.addEventListener("hashchange",n);var o=Ka.history.pushState,a=Ka.history.replaceState;return Ka.history.pushState=function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];o.apply(this,t),n()},Ka.history.replaceState=function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];a.apply(this,t),n()},()=>{Ka.removeEventListener("popstate",n),Ka.removeEventListener("hashchange",n),Ka.history.pushState=o,Ka.history.replaceState=a}}}),[r,e,i]),{isPopupVisible:o,isSurveySent:a,setIsPopupVisible:s}}(l,u,m,f,p),w=y||h===l.questions.length,S=null!==(r=d)&&void 0!==r&&r.left&&Sr(null===(i=d)||void 0===i?void 0:i.left)?{left:d.left-40}:{};return f&&((d=d||{}).left="unset",d.right="unset",d.transform="unset"),_?ka(Ws.Provider,{value:{isPreviewMode:f,previewPageIndex:h,handleCloseSurveyPopup:()=>Ps(l,u,f),isPopup:v||!1,onPreviewSubmit:g},children:w?ka(Ba,{header:(null===(o=l.appearance)||void 0===o?void 0:o.thankYouMessageHeader)||"Thank you!",description:(null===(s=l.appearance)||void 0===s?void 0:s.thankYouMessageDescription)||"",forceDisableHtml:!!c,contentType:null===(a=l.appearance)||void 0===a?void 0:a.thankYouMessageDescriptionContentType,appearance:l.appearance||Ns,styleOverrides:t(t({},d),S),onClose:()=>b(!1)}):ka(rl,{survey:l,forceDisableHtml:!!c,posthog:u,styleOverrides:d})}):ka(ns,{})}function rl(e){var n,r,{survey:i,forceDisableHtml:o,posthog:s,styleOverrides:a}=e,l=Ts((null===(n=i.appearance)||void 0===n?void 0:n.backgroundColor)||Ns.backgroundColor),[c,u]=da({}),{isPreviewMode:d,previewPageIndex:h,handleCloseSurveyPopup:p,isPopup:v,onPreviewSubmit:g}=ga(Ws),[f,m]=da(h||0),_=va((()=>Bs(i)),[i]);ha((()=>{m(null!=h?h:0)}),[h]);return ka("form",{className:"survey-form",style:v?t({color:l,borderColor:null===(r=i.appearance)||void 0===r?void 0:r.borderColor},a):{},children:_.map(((e,n)=>{var r,{originalQuestionIndex:a}=e;return(d?f===a:f===n)&&ka("div",{className:"survey-box",style:v?{backgroundColor:(null===(r=i.appearance)||void 0===r?void 0:r.backgroundColor)||Ns.backgroundColor}:{},children:[v&&ka(Da,{onClick:()=>p()}),ol({question:e,forceDisableHtml:o,displayQuestionIndex:n,appearance:i.appearance||Ns,onSubmit:e=>(e=>{var{res:n,originalQuestionIndex:r,displayQuestionIndex:o}=e;if(s){var a=0===r?"$survey_response":"$survey_response_".concat(r);if(u(t(t({},c),{},{[a]:n})),s.getNextSurveyStep){var l=s.getNextSurveyStep(i,o,n);l===As.End?Os(t(t({},c),{},{[a]:n}),i,s):m(l)}else o===i.questions.length-1?Os(t(t({},c),{},{[a]:n}),i,s):m(o+1)}else Ja.error("onNextButtonClick called without a PostHog instance.")})({res:e,originalQuestionIndex:a,displayQuestionIndex:n}),onPreviewSubmit:g})]})}))})}function il(e){var t,n,{survey:r,forceDisableHtml:i,posthog:o,readOnly:s,removeSurveyFromFocus:a}=e,[l,c]=da(!1),[u,d]=da({}),h=pa(null);return ha((()=>{var e,t;if(o){if(!s){if("tab"===(null===(e=r.appearance)||void 0===e?void 0:e.widgetType)&&h.current){var n,i=h.current.getBoundingClientRect(),a={top:"50%",left:parseInt("".concat(i.right-360)),bottom:"auto",borderRadius:10,borderBottom:"1.5px solid ".concat((null===(n=r.appearance)||void 0===n?void 0:n.borderColor)||"#c9c6c6")};d(a)}if("selector"===(null===(t=r.appearance)||void 0===t?void 0:t.widgetType)){var u=Qa.querySelector(r.appearance.widgetSelector||"");null==u||u.addEventListener("click",(()=>{c(!l)})),null==u||u.setAttribute("PHWidgetSurveyClickListener","true")}}}else Ja.error("FeedbackWidget called without a PostHog instance.")}),[]),ka(ns,{children:["tab"===(null===(t=r.appearance)||void 0===t?void 0:t.widgetType)&&ka("div",{className:"ph-survey-widget-tab",ref:h,onClick:()=>!s&&c(!l),style:{color:Ts(r.appearance.widgetColor)},children:[ka("div",{className:"ph-survey-widget-tab-icon"}),(null===(n=r.appearance)||void 0===n?void 0:n.widgetLabel)||""]}),l&&ka(nl,{posthog:o,survey:r,forceDisableHtml:i,style:u,removeSurveyFromFocus:a,isPopup:!0},"feedback-widget-survey")]})}var ol=e=>{var{question:n,forceDisableHtml:r,displayQuestionIndex:i,appearance:o,onSubmit:s,onPreviewSubmit:a}=e,l={[Rs.Open]:qa,[Rs.Link]:$a,[Rs.Rating]:Wa,[Rs.SingleChoice]:Za,[Rs.MultipleChoice]:Za},c={question:n,forceDisableHtml:r,appearance:o,onPreviewSubmit:e=>{a(e)},onSubmit:e=>{s(e)}},u={[Rs.Open]:{},[Rs.Link]:{},[Rs.Rating]:{displayQuestionIndex:i},[Rs.SingleChoice]:{displayQuestionIndex:i},[Rs.MultipleChoice]:{displayQuestionIndex:i}},d=l[n.type],h=t(t({},c),u[n.type]);return ka(d,t({},h))};function sl(e){return!mr(Event)&&al(e,Event)}function al(e,t){try{return e instanceof t}catch(e){return!1}}function ll(e){return br(e)||!gr(e)&&!hr(e)}function cl(e,t){return Object.prototype.toString.call(e)==="[object ".concat(t,"]")}function ul(e){return cl(e,"DOMError")}er.__PosthogExtensions__=er.__PosthogExtensions__||{},er.__PosthogExtensions__.canActivateRepeatedly=Hs,er.__PosthogExtensions__.generateSurveys=tl,er.extendPostHogWithSurveys=tl;var dl=/\(error: (.*)\)/,hl=50,pl="?";function vl(e,t,n,r){var i={platform:"web:javascript",filename:e,function:"<anonymous>"===t?pl:t,in_app:!0};return mr(n)||(i.lineno=n),mr(r)||(i.colno=r),i}var gl=/^\s*at (\S+?)(?::(\d+))(?::(\d+))\s*$/i,fl=/^\s*at (?:(.+?\)(?: \[.+\])?|.*?) ?\((?:address at )?)?(?:async )?((?:<anonymous>|[-a-z]+:|.*bundle|\/)?.*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i,ml=/\((\S*)(?::(\d+))(?::(\d+))\)/,_l=/^\s*(.*?)(?:\((.*?)\))?(?:^|@)?((?:[-a-z]+)?:\/.*?|\[native code\]|[^@]*(?:bundle|\d+\.js)|\/[\w\-. /=]+)(?::(\d+))?(?::(\d+))?\s*$/i,yl=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i,bl=function(){for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];var i=n.sort(((e,t)=>e[0]-t[0])).map((e=>e[1]));return function(e){for(var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,r=[],o=e.split("\n"),s=n;s<o.length;s++){var a=o[s];if(!(a.length>1024)){var l=dl.test(a)?a.replace(dl,"$1"):a;if(!l.match(/\S*Error: /)){for(var c of i){var u=c(l);if(u){r.push(u);break}}if(r.length>=hl)break}}}return function(e){if(!e.length)return[];var n=Array.from(e);return n.reverse(),n.slice(0,hl).map((e=>t(t({},e),{},{filename:e.filename||wl(n).filename,function:e.function||pl})))}(r)}}(...[[30,e=>{var t=gl.exec(e);if(t){var[,n,r,i]=t;return vl(n,pl,+r,+i)}var o=fl.exec(e);if(o){if(o[2]&&0===o[2].indexOf("eval")){var s=ml.exec(o[2]);s&&(o[2]=s[1],o[3]=s[2],o[4]=s[3])}var[a,l]=Sl(o[1]||pl,o[2]);return vl(l,a,o[3]?+o[3]:void 0,o[4]?+o[4]:void 0)}}],[50,e=>{var t=_l.exec(e);if(t){if(t[3]&&t[3].indexOf(" > eval")>-1){var n=yl.exec(t[3]);n&&(t[1]=t[1]||"eval",t[3]=n[1],t[4]=n[2],t[5]="")}var r=t[3],i=t[1]||pl;return[i,r]=Sl(i,r),vl(r,i,t[4]?+t[4]:void 0,t[5]?+t[5]:void 0)}}]]);function wl(e){return e[e.length-1]||{}}var Sl=(e,t)=>{var n=-1!==e.indexOf("safari-extension"),r=-1!==e.indexOf("safari-web-extension");return n||r?[-1!==e.indexOf("@")?e.split("@")[0]:pl,n?"safari-extension:".concat(t):"safari-web-extension:".concat(t)]:[e,t]},Cl=/^(?:[Uu]ncaught (?:exception: )?)?(?:((?:Eval|Internal|Range|Reference|Syntax|Type|URI|)Error): )?(.*)$/i;function Il(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=e.stacktrace||e.stack||"",r=function(e){if(e&&kl.test(e.message))return 1;return 0}(e);try{var i=bl(n,r);return i.slice(0,i.length-t)}catch(e){}return[]}var kl=/Minified React error #\d+;/i;function El(e,t){var n,r,i=Il(e),o=null===(n=null==t?void 0:t.handled)||void 0===n||n,s=null!==(r=null==t?void 0:t.synthetic)&&void 0!==r&&r;return{$exception_list:[{type:null!=t&&t.overrideExceptionType?t.overrideExceptionType:e.name,value:null!=t&&t.overrideExceptionMessage?t.overrideExceptionMessage:function(e){var t=e.message;if(t.error&&"string"==typeof t.error.message)return t.error.message;return t}(e),stacktrace:{frames:i,type:"raw"},mechanism:{handled:o,synthetic:s}}],$exception_level:"error"}}function xl(e,t){var n,r,i,o=null===(n=null==t?void 0:t.handled)||void 0===n||n,s=null===(r=null==t?void 0:t.synthetic)||void 0===r||r,a={type:null!=t&&t.overrideExceptionType?t.overrideExceptionType:null!==(i=null==t?void 0:t.defaultExceptionType)&&void 0!==i?i:"Error",value:null!=t&&t.overrideExceptionMessage?t.overrideExceptionMessage:e||(null==t?void 0:t.defaultExceptionMessage),mechanism:{handled:o,synthetic:s}};if(null!=t&&t.syntheticException){var l=Il(t.syntheticException,1);l.length&&(a.stacktrace={frames:l,type:"raw"})}return{$exception_list:[a],$exception_level:"error"}}function Tl(e){return _r(e)&&!yr(e)&&rr.indexOf(e)>=0}function Ml(e,t){var n,r,i=null===(n=null==t?void 0:t.handled)||void 0===n||n,o=null===(r=null==t?void 0:t.synthetic)||void 0===r||r,s=null!=t&&t.overrideExceptionType?t.overrideExceptionType:sl(e)?e.constructor.name:"Error",a=null!=t&&t.overrideExceptionMessage?t.overrideExceptionMessage:"Non-Error ".concat("exception"," captured with keys: ",function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:40,n=Object.keys(e);if(n.sort(),!n.length)return"[object has no keys]";for(var r=n.length;r>0;r--){var i=n.slice(0,r).join(", ");if(!(i.length>t))return r===n.length||i.length<=t?i:"".concat(i.slice(0,t),"...")}return""}(e)),l={type:s,value:a,mechanism:{handled:i,synthetic:o}};if(null!=t&&t.syntheticException){var c=Il(null==t?void 0:t.syntheticException,1);c.length&&(l.stacktrace={frames:c,type:"raw"})}return{$exception_list:[l],$exception_level:Tl(e.level)?e.level:"error"}}function Rl(e,n){var[r,i,o,s,a]=e,l={$exception_list:[]},c=a||r;if(ul(c)||function(e){return cl(e,"DOMException")}(c)){var u=c;if(function(e){return"stack"in e}(c))l=El(c,n);else{var d=u.name||(ul(u)?"DOMError":"DOMException"),h=u.message?"".concat(d,": ").concat(u.message):d,p=ul(u)?"DOMError":"DOMException";l=xl(h,t(t({},n),{},{overrideExceptionType:p,defaultExceptionMessage:h}))}return"code"in u&&(l.$exception_DOMException_code="".concat(u.code)),l}if(function(e){return cl(e,"ErrorEvent")}(c)&&c.error)return El(c.error,n);if(function(e){switch(Object.prototype.toString.call(e)){case"[object Error]":case"[object Exception]":case"[object DOMException]":case"[object DOMError]":return!0;default:return al(e,Error)}}(c))return El(c,n);if(function(e){return cl(e,"Object")}(c)||sl(c))return Ml(c,n);if(mr(a)&&_r(r)){var v="Error",g=r,f=r.match(Cl);return f&&(v=f[1],g=f[2]),xl(g,t(t({},n),{},{overrideExceptionType:v,defaultExceptionMessage:g}))}return xl(c,n)}function Al(e){var[t]=e,n=function(e){if(ll(e))return e;try{if("reason"in e)return e.reason;if("detail"in e&&"reason"in e.detail)return e.detail.reason}catch(e){}return e}(t);return ll(n)?xl("Non-Error promise rejection captured with value: ".concat(String(n)),{handled:!1,synthetic:!1,overrideExceptionType:"UnhandledRejection"}):Rl([n],{handled:!1,overrideExceptionType:"UnhandledRejection",defaultExceptionMessage:String(n)})}var Nl=Rr("[ExceptionAutocapture]"),Fl={wrapOnError:e=>{var t=Wn;t||Nl.info("window not available, cannot wrap onerror");var n=t.onerror;return t.onerror=function(){for(var t,r=arguments.length,i=new Array(r),o=0;o<r;o++)i[o]=arguments[o];var s=Rl(i);return e(s),null!==(t=null==n?void 0:n(...i))&&void 0!==t&&t},t.onerror.__POSTHOG_INSTRUMENTED__=!0,()=>{var e;null===(e=t.onerror)||void 0===e||delete e.__POSTHOG_INSTRUMENTED__,t.onerror=n}},wrapUnhandledRejection:e=>{var t=Wn;t||Nl.info("window not available, cannot wrap onUnhandledRejection");var n=t.onunhandledrejection;return t.onunhandledrejection=function(){for(var r,i=arguments.length,o=new Array(i),s=0;s<i;s++)o[s]=arguments[s];var a=Al(o);return e(a),null!==(r=null==n?void 0:n.apply(t,o))&&void 0!==r&&r},t.onunhandledrejection.__POSTHOG_INSTRUMENTED__=!0,()=>{var e;null===(e=t.onunhandledrejection)||void 0===e||delete e.__POSTHOG_INSTRUMENTED__,t.onunhandledrejection=n}}};er.__PosthogExtensions__=er.__PosthogExtensions__||{},er.__PosthogExtensions__.errorWrappingFunctions=Fl,er.__PosthogExtensions__.parseErrorAsProperties=Rl,er.posthogErrorWrappingFunctions=Fl,er.parseErrorAsProperties=Rl;var Ol=(e,t)=>{if(e){var{sessionId:n,windowId:r}=e.checkAndGetSessionAndWindowId(!0);t.headers.set("X-POSTHOG-SESSION-ID",n),t.headers.set("X-POSTHOG-WINDOW-ID",r)}};er.__PosthogExtensions__=er.__PosthogExtensions__||{};var Pl={_patchFetch:e=>yo(Wn,"fetch",(t=>function(){var n=r((function*(n,r){var i=new Request(n,r);return Ol(e,i),t(i)}));return function(e,t){return n.apply(this,arguments)}}())),_patchXHR:e=>yo(Wn.XMLHttpRequest.prototype,"open",(t=>function(n,r){var i=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],o=arguments.length>3?arguments[3]:void 0,s=arguments.length>4?arguments[4]:void 0,a=new Request(r);return Ol(e,a),t.call(this,n,a.url,i,o,s)}))};er.__PosthogExtensions__.tracingHeadersPatchFns=Pl,er.postHogTracingHeadersPatchFns=Pl;var Ll,Dl,Bl,Hl=function(){var e=self.performance&&performance.getEntriesByType&&performance.getEntriesByType("navigation")[0];if(e&&e.responseStart>0&&e.responseStart<performance.now())return e},ql=function(e){if("loading"===document.readyState)return"loading";var t=Hl();if(t){if(e<t.domInteractive)return"loading";if(0===t.domContentLoadedEventStart||e<t.domContentLoadedEventStart)return"dom-interactive";if(0===t.domComplete||e<t.domComplete)return"dom-content-loaded"}return"complete"},$l=function(e){var t=e.nodeName;return 1===e.nodeType?t.toLowerCase():t.toUpperCase().replace(/^#/,"")},Wl=function(e,t){var n="";try{for(;e&&9!==e.nodeType;){var r=e,i=r.id?"#"+r.id:$l(r)+(r.classList&&r.classList.value&&r.classList.value.trim()&&r.classList.value.trim().length?"."+r.classList.value.trim().replace(/\s+/g,"."):"");if(n.length+i.length>(t||100)-1)return n||i;if(n=n?i+">"+n:i,r.id)break;e=r.parentNode}}catch(e){}return n},Vl=-1,Zl=function(){return Vl},Gl=function(e){addEventListener("pageshow",(function(t){t.persisted&&(Vl=t.timeStamp,e(t))}),!0)},Ul=function(){var e=Hl();return e&&e.activationStart||0},jl=function(e,t){var n=Hl(),r="navigate";return Zl()>=0?r="back-forward-cache":n&&(document.prerendering||Ul()>0?r="prerender":document.wasDiscarded?r="restore":n.type&&(r=n.type.replace(/_/g,"-"))),{name:e,value:void 0===t?-1:t,rating:"good",delta:0,entries:[],id:"v4-".concat(Date.now(),"-").concat(Math.floor(8999999999999*Math.random())+1e12),navigationType:r}},zl=function(e,t,n){try{if(PerformanceObserver.supportedEntryTypes.includes(e)){var r=new PerformanceObserver((function(e){Promise.resolve().then((function(){t(e.getEntries())}))}));return r.observe(Object.assign({type:e,buffered:!0},n||{})),r}}catch(e){}},Yl=function(e,t,n,r){var i,o;return function(s){t.value>=0&&(s||r)&&((o=t.value-(i||0))||void 0===i)&&(i=t.value,t.delta=o,t.rating=function(e,t){return e>t[1]?"poor":e>t[0]?"needs-improvement":"good"}(t.value,n),e(t))}},Xl=function(e){requestAnimationFrame((function(){return requestAnimationFrame((function(){return e()}))}))},Jl=function(e){document.addEventListener("visibilitychange",(function(){"hidden"===document.visibilityState&&e()}))},Kl=function(e){var t=!1;return function(){t||(e(),t=!0)}},Ql=-1,ec=function(){return"hidden"!==document.visibilityState||document.prerendering?1/0:0},tc=function(e){"hidden"===document.visibilityState&&Ql>-1&&(Ql="visibilitychange"===e.type?e.timeStamp:0,rc())},nc=function(){addEventListener("visibilitychange",tc,!0),addEventListener("prerenderingchange",tc,!0)},rc=function(){removeEventListener("visibilitychange",tc,!0),removeEventListener("prerenderingchange",tc,!0)},ic=function(){return Ql<0&&(Ql=ec(),nc(),Gl((function(){setTimeout((function(){Ql=ec(),nc()}),0)}))),{get firstHiddenTime(){return Ql}}},oc=function(e){document.prerendering?addEventListener("prerenderingchange",(function(){return e()}),!0):e()},sc=[1800,3e3],ac=function(e,t){t=t||{},oc((function(){var n,r=ic(),i=jl("FCP"),o=zl("paint",(function(e){e.forEach((function(e){"first-contentful-paint"===e.name&&(o.disconnect(),e.startTime<r.firstHiddenTime&&(i.value=Math.max(e.startTime-Ul(),0),i.entries.push(e),n(!0)))}))}));o&&(n=Yl(e,i,sc,t.reportAllChanges),Gl((function(r){i=jl("FCP"),n=Yl(e,i,sc,t.reportAllChanges),Xl((function(){i.value=performance.now()-r.timeStamp,n(!0)}))})))}))},lc=[.1,.25],cc=0,uc=1/0,dc=0,hc=function(e){e.forEach((function(e){e.interactionId&&(uc=Math.min(uc,e.interactionId),dc=Math.max(dc,e.interactionId),cc=dc?(dc-uc)/7+1:0)}))},pc=function(){"interactionCount"in performance||Ll||(Ll=zl("event",hc,{type:"event",buffered:!0,durationThreshold:0}))},vc=[],gc=new Map,fc=0,mc=function(){return(Ll?cc:performance.interactionCount||0)-fc},_c=[],yc=function(e){if(_c.forEach((function(t){return t(e)})),e.interactionId||"first-input"===e.entryType){var t=vc[vc.length-1],n=gc.get(e.interactionId);if(n||vc.length<10||e.duration>t.latency){if(n)e.duration>n.latency?(n.entries=[e],n.latency=e.duration):e.duration===n.latency&&e.startTime===n.entries[0].startTime&&n.entries.push(e);else{var r={id:e.interactionId,latency:e.duration,entries:[e]};gc.set(r.id,r),vc.push(r)}vc.sort((function(e,t){return t.latency-e.latency})),vc.length>10&&vc.splice(10).forEach((function(e){return gc.delete(e.id)}))}}},bc=function(e){var t=self.requestIdleCallback||self.setTimeout,n=-1;return e=Kl(e),"hidden"===document.visibilityState?e():(n=t(e),Jl(e)),n},wc=[200,500],Sc=[],Cc=[],Ic=new WeakMap,kc=new Map,Ec=-1,xc=function(e){Sc=Sc.concat(e),Tc()},Tc=function(){Ec<0&&(Ec=bc(Mc))},Mc=function(){kc.size>10&&kc.forEach((function(e,t){gc.has(t)||kc.delete(t)}));var e=vc.map((function(e){return Ic.get(e.entries[0])})),t=Cc.length-50;Cc=Cc.filter((function(n,r){return r>=t||e.includes(n)}));for(var n=new Set,r=0;r<Cc.length;r++){var i=Cc[r];Rc(i.startTime,i.processingEnd).forEach((function(e){n.add(e)}))}for(var o=0;o<50;o++){var s=Sc[Sc.length-1-o];if(!s||s.startTime<Bl)break;n.add(s)}Sc=Array.from(n),Ec=-1};_c.push((function(e){e.interactionId&&e.target&&!kc.has(e.interactionId)&&kc.set(e.interactionId,e.target)}),(function(e){var t,n=e.startTime+e.duration;Bl=Math.max(Bl,e.processingEnd);for(var r=Cc.length-1;r>=0;r--){var i=Cc[r];if(Math.abs(n-i.renderTime)<=8){(t=i).startTime=Math.min(e.startTime,t.startTime),t.processingStart=Math.min(e.processingStart,t.processingStart),t.processingEnd=Math.max(e.processingEnd,t.processingEnd),t.entries.push(e);break}}t||(t={startTime:e.startTime,processingStart:e.processingStart,processingEnd:e.processingEnd,renderTime:n,entries:[e]},Cc.push(t)),(e.interactionId||"first-input"===e.entryType)&&Ic.set(e,t),Tc()}));var Rc=function(e,t){for(var n,r=[],i=0;n=Sc[i];i++)if(!(n.startTime+n.duration<e)){if(n.startTime>t)break;r.push(n)}return r},Ac=[2500,4e3],Nc={},Fc={onLCP:function(e,t){!function(e,t){t=t||{},oc((function(){var n,r=ic(),i=jl("LCP"),o=function(e){t.reportAllChanges||(e=e.slice(-1)),e.forEach((function(e){e.startTime<r.firstHiddenTime&&(i.value=Math.max(e.startTime-Ul(),0),i.entries=[e],n())}))},s=zl("largest-contentful-paint",o);if(s){n=Yl(e,i,Ac,t.reportAllChanges);var a=Kl((function(){Nc[i.id]||(o(s.takeRecords()),s.disconnect(),Nc[i.id]=!0,n(!0))}));["keydown","click"].forEach((function(e){addEventListener(e,(function(){return bc(a)}),!0)})),Jl(a),Gl((function(r){i=jl("LCP"),n=Yl(e,i,Ac,t.reportAllChanges),Xl((function(){i.value=performance.now()-r.timeStamp,Nc[i.id]=!0,n(!0)}))}))}}))}((function(t){var n=function(e){var t={timeToFirstByte:0,resourceLoadDelay:0,resourceLoadDuration:0,elementRenderDelay:e.value};if(e.entries.length){var n=Hl();if(n){var r=n.activationStart||0,i=e.entries[e.entries.length-1],o=i.url&&performance.getEntriesByType("resource").filter((function(e){return e.name===i.url}))[0],s=Math.max(0,n.responseStart-r),a=Math.max(s,o?(o.requestStart||o.startTime)-r:0),l=Math.max(a,o?o.responseEnd-r:0),c=Math.max(l,i.startTime-r);t={element:Wl(i.element),timeToFirstByte:s,resourceLoadDelay:a-s,resourceLoadDuration:l-a,elementRenderDelay:c-l,navigationEntry:n,lcpEntry:i},i.url&&(t.url=i.url),o&&(t.lcpResourceEntry=o)}}return Object.assign(e,{attribution:t})}(t);e(n)}),t)},onCLS:function(e,t){!function(e,t){t=t||{},ac(Kl((function(){var n,r=jl("CLS",0),i=0,o=[],s=function(e){e.forEach((function(e){if(!e.hadRecentInput){var t=o[0],n=o[o.length-1];i&&e.startTime-n.startTime<1e3&&e.startTime-t.startTime<5e3?(i+=e.value,o.push(e)):(i=e.value,o=[e])}})),i>r.value&&(r.value=i,r.entries=o,n())},a=zl("layout-shift",s);a&&(n=Yl(e,r,lc,t.reportAllChanges),Jl((function(){s(a.takeRecords()),n(!0)})),Gl((function(){i=0,r=jl("CLS",0),n=Yl(e,r,lc,t.reportAllChanges),Xl((function(){return n()}))})),setTimeout(n,0))})))}((function(t){var n=function(e){var t,n={};if(e.entries.length){var r=e.entries.reduce((function(e,t){return e&&e.value>t.value?e:t}));if(r&&r.sources&&r.sources.length){var i=(t=r.sources).find((function(e){return e.node&&1===e.node.nodeType}))||t[0];i&&(n={largestShiftTarget:Wl(i.node),largestShiftTime:r.startTime,largestShiftValue:r.value,largestShiftSource:i,largestShiftEntry:r,loadState:ql(r.startTime)})}}return Object.assign(e,{attribution:n})}(t);e(n)}),t)},onFCP:function(e,t){ac((function(t){var n=function(e){var t={timeToFirstByte:0,firstByteToFCP:e.value,loadState:ql(Zl())};if(e.entries.length){var n=Hl(),r=e.entries[e.entries.length-1];if(n){var i=n.activationStart||0,o=Math.max(0,n.responseStart-i);t={timeToFirstByte:o,firstByteToFCP:e.value-o,loadState:ql(e.entries[0].startTime),navigationEntry:n,fcpEntry:r}}}return Object.assign(e,{attribution:t})}(t);e(n)}),t)},onINP:function(e,t){Dl||(Dl=zl("long-animation-frame",xc)),function(e,t){"PerformanceEventTiming"in self&&"interactionId"in PerformanceEventTiming.prototype&&(t=t||{},oc((function(){var n;pc();var r,i=jl("INP"),o=function(e){bc((function(){e.forEach(yc);var t,n=(t=Math.min(vc.length-1,Math.floor(mc()/50)),vc[t]);n&&n.latency!==i.value&&(i.value=n.latency,i.entries=n.entries,r())}))},s=zl("event",o,{durationThreshold:null!==(n=t.durationThreshold)&&void 0!==n?n:40});r=Yl(e,i,wc,t.reportAllChanges),s&&(s.observe({type:"first-input",buffered:!0}),Jl((function(){o(s.takeRecords()),r(!0)})),Gl((function(){fc=0,vc.length=0,gc.clear(),i=jl("INP"),r=Yl(e,i,wc,t.reportAllChanges)})))})))}((function(t){var n=function(e){var t=e.entries[0],n=Ic.get(t),r=t.processingStart,i=n.processingEnd,o=n.entries.sort((function(e,t){return e.processingStart-t.processingStart})),s=Rc(t.startTime,i),a=e.entries.find((function(e){return e.target})),l=a&&a.target||kc.get(t.interactionId),c=[t.startTime+t.duration,i].concat(s.map((function(e){return e.startTime+e.duration}))),u=Math.max.apply(Math,c),d={interactionTarget:Wl(l),interactionTargetElement:l,interactionType:t.name.startsWith("key")?"keyboard":"pointer",interactionTime:t.startTime,nextPaintTime:u,processedEventEntries:o,longAnimationFrameEntries:s,inputDelay:r-t.startTime,processingDuration:i-r,presentationDelay:Math.max(u-i,0),loadState:ql(t.startTime)};return Object.assign(e,{attribution:d})}(t);e(n)}),t)}};er.__PosthogExtensions__=er.__PosthogExtensions__||{},er.__PosthogExtensions__.postHogWebVitalsCallbacks=Fc,er.postHogWebVitalsCallbacks=Fc;class Oc{constructor(){this.clicks=[]}isRageClick(e,t,n){var r=this.clicks[this.clicks.length-1];if(r&&Math.abs(e-r.x)+Math.abs(t-r.y)<30&&n-r.timestamp<1e3){if(this.clicks.push({x:e,y:t,timestamp:n}),3===this.clicks.length)return!0}else this.clicks=[{x:e,y:t,timestamp:n}];return!1}}var Pc=Rr("[AutoCapture]");function Lc(e,t){return t.length>e?t.slice(0,e)+"...":t}function Dc(e){if(e.previousElementSibling)return e.previousElementSibling;var t=e;do{t=t.previousSibling}while(t&&!Li(t));return t}function Bc(e,t,n,r){var i=e.tagName.toLowerCase(),o={tag_name:i};Ui.indexOf(i)>-1&&!n&&("a"===i.toLowerCase()||"button"===i.toLowerCase()?o.$el_text=Lc(1024,io(e)):o.$el_text=Lc(1024,Zi(e)));var s=Wi(e);s.length>0&&(o.classes=s.filter((function(e){return""!==e}))),Fr(e.attributes,(function(n){var i;if((!Xi(e)||-1!==["name","id","class","aria-label"].indexOf(n.name))&&((null==r||!r.includes(n.name))&&!t&&ro(n.value)&&(i=n.name,!_r(i)||"_ngcontent"!==i.substring(0,10)&&"_nghost"!==i.substring(0,7)))){var s=n.value;"class"===n.name&&(s=qi(s).join(" ")),o["attr__"+n.name]=Lc(1024,s)}}));for(var a=1,l=1,c=e;c=Dc(c);)a++,c.tagName===e.tagName&&l++;return o.nth_child=a,o.nth_of_type=l,o}function Hc(e,t){for(var n,r,{e:i,maskAllElementAttributes:o,maskAllText:s,elementAttributeIgnoreList:a,elementsChainAsString:l}=t,c=[e],u=e;u.parentNode&&!Di(u,"body");)Hi(u.parentNode)?(c.push(u.parentNode.host),u=u.parentNode.host):(c.push(u.parentNode),u=u.parentNode);var d,h=[],p={},v=!1,g=!1;if(Fr(c,(e=>{var t=Yi(e);"a"===e.tagName.toLowerCase()&&(v=e.getAttribute("href"),v=t&&v&&ro(v)&&v),ir(Wi(e),"ph-no-capture")&&(g=!0),h.push(Bc(e,o,s,a));var n=function(e){if(!Yi(e))return{};var t={};return Fr(e.attributes,(function(e){if(e.name&&0===e.name.indexOf("data-ph-capture-attribute")){var n=e.name.replace("data-ph-capture-attribute-",""),r=e.value;n&&r&&ro(r)&&(t[n]=r)}})),t}(e);Or(p,n)})),g)return{props:{},explicitNoCapture:g};if(s||("a"===e.tagName.toLowerCase()||"button"===e.tagName.toLowerCase()?h[0].$el_text=io(e):h[0].$el_text=Zi(e)),v){var f,m;h[0].attr__href=v;var _=null===(f=Ur(v))||void 0===f?void 0:f.host,y=null==Wn||null===(m=Wn.location)||void 0===m?void 0:m.host;_&&y&&_!==y&&(d=v)}return{props:Or({$event_type:i.type,$ce_version:1},l?{}:{$elements:h},{$elements_chain:so(h)},null!==(n=h[0])&&void 0!==n&&n.$el_text?{$el_text:null===(r=h[0])||void 0===r?void 0:r.$el_text}:{},d&&"click"===i.type?{$external_click_url:d}:{},p)}}class qc{constructor(e){i(this,"_initialized",!1),i(this,"_isDisabledServerSide",null),i(this,"rageclicks",new Oc),i(this,"_elementsChainAsString",!1),this.instance=e,this._elementSelectors=null}get config(){var e,t,n=gr(this.instance.config.autocapture)?this.instance.config.autocapture:{};return n.url_allowlist=null===(e=n.url_allowlist)||void 0===e?void 0:e.map((e=>new RegExp(e))),n.url_ignorelist=null===(t=n.url_ignorelist)||void 0===t?void 0:t.map((e=>new RegExp(e))),n}_addDomEventHandlers(){if(this.isBrowserSupported()){if(Wn&&zn){var e=e=>{e=e||(null==Wn?void 0:Wn.event);try{this._captureEvent(e)}catch(e){Pc.error("Failed to capture event",e)}},t=e=>{e=e||(null==Wn?void 0:Wn.event),this._captureEvent(e,tr)};$r(zn,"submit",e,!1,!0),$r(zn,"change",e,!1,!0),$r(zn,"click",e,!1,!0),this.config.capture_copied_text&&($r(zn,"copy",t,!1,!0),$r(zn,"cut",t,!1,!0))}}else Pc.info("Disabling Automatic Event Collection because this browser is not supported")}startIfEnabled(){this.isEnabled&&!this._initialized&&(this._addDomEventHandlers(),this._initialized=!0)}onRemoteConfig(e){e.elementsChainAsString&&(this._elementsChainAsString=e.elementsChainAsString),this.instance.persistence&&this.instance.persistence.register({[ti]:!!e.autocapture_opt_out}),this._isDisabledServerSide=!!e.autocapture_opt_out,this.startIfEnabled()}setElementSelectors(e){this._elementSelectors=e}getElementSelectors(e){var t,n=[];return null===(t=this._elementSelectors)||void 0===t||t.forEach((t=>{var r=null==zn?void 0:zn.querySelectorAll(t);null==r||r.forEach((r=>{e===r&&n.push(t)}))})),n}get isEnabled(){var e,t,n=null===(e=this.instance.persistence)||void 0===e?void 0:e.props[ti],r=this._isDisabledServerSide;if(br(r)&&!Cr(n)&&!this.instance.config.advanced_disable_decide)return!1;var i=null!==(t=this._isDisabledServerSide)&&void 0!==t?t:!!n;return!!this.instance.config.autocapture&&!i}_captureEvent(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"$autocapture";if(this.isEnabled){var n,r=Gi(e);if(Bi(r)&&(r=r.parentNode||null),"$autocapture"===t&&"click"===e.type&&e instanceof MouseEvent)this.instance.config.rageclick&&null!==(n=this.rageclicks)&&void 0!==n&&n.isRageClick(e.clientX,e.clientY,(new Date).getTime())&&this._captureEvent(e,"$rageclick");var i=t===tr;if(r&&zi(r,e,this.config,i,i?["copy","cut"]:void 0)){var{props:o,explicitNoCapture:s}=Hc(r,{e:e,maskAllElementAttributes:this.instance.config.mask_all_element_attributes,maskAllText:this.instance.config.mask_all_text,elementAttributeIgnoreList:this.config.element_attribute_ignorelist,elementsChainAsString:this._elementsChainAsString});if(s)return!1;var a=this.getElementSelectors(r);if(a&&a.length>0&&(o.$element_selectors=a),t===tr){var l,c=Vi(null==Wn||null===(l=Wn.getSelection())||void 0===l?void 0:l.toString()),u=e.type||"clipboard";if(!c)return!1;o.$selected_content=c,o.$copy_type=u}return this.instance.capture(t,o),!0}}}isBrowserSupported(){return hr(null==zn?void 0:zn.querySelectorAll)}}var $c={};function Wc(e){return function(e,t){var n=$c[e];if(n)return n;var r=t[e];if(pr(r)&&!vr())return $c[e]=r.bind(t);var i=t.document;if(i&&hr(i.createElement))try{var o=i.createElement("iframe");o.hidden=!0,i.head.appendChild(o);var s=o.contentWindow;s&&s[e]&&(r=s[e]),i.head.removeChild(o)}catch(t){Mr.warn("Could not create sandbox iframe for ".concat(e," check, bailing to assignableWindow.").concat(e,": "),t)}return r&&hr(r)?$c[e]=r.bind(t):r}("MutationObserver",e)}function Vc(e,t){return Sr(e)&&e>=t}class Zc{asRequiredConfig(e){var t,n,r,i,o=this._defaultConfig((null==e?void 0:e.__onCapture)||this._captureDeadClick.bind(this));return{element_attribute_ignorelist:null!==(t=null==e?void 0:e.element_attribute_ignorelist)&&void 0!==t?t:o.element_attribute_ignorelist,scroll_threshold_ms:null!==(n=null==e?void 0:e.scroll_threshold_ms)&&void 0!==n?n:o.scroll_threshold_ms,selection_change_threshold_ms:null!==(r=null==e?void 0:e.selection_change_threshold_ms)&&void 0!==r?r:o.selection_change_threshold_ms,mutation_threshold_ms:null!==(i=null==e?void 0:e.mutation_threshold_ms)&&void 0!==i?i:o.mutation_threshold_ms,__onCapture:o.__onCapture}}constructor(e,t){i(this,"_clicks",[]),i(this,"_defaultConfig",(e=>({element_attribute_ignorelist:[],scroll_threshold_ms:100,selection_change_threshold_ms:100,mutation_threshold_ms:2500,__onCapture:e}))),i(this,"_onClick",(e=>{var t=function(e){var t=Gi(e);return t?{node:t,originalEvent:e,timestamp:Date.now()}:null}(e);br(t)||this._ignoreClick(t)||this._clicks.push(t),this._clicks.length&&mr(this._checkClickTimer)&&(this._checkClickTimer=er.setTimeout((()=>{this._checkClicks()}),1e3))})),i(this,"_onScroll",(()=>{var e=Date.now();e%50==0&&this._clicks.forEach((t=>{mr(t.scrollDelayMs)&&(t.scrollDelayMs=e-t.timestamp)}))})),i(this,"_onSelectionChange",(()=>{this._lastSelectionChanged=Date.now()})),this.instance=e,this._config=this.asRequiredConfig(t),this._onCapture=this._config.__onCapture}start(e){this._startClickObserver(),this._startScrollObserver(),this._startSelectionChangedObserver(),this._startMutationObserver(e)}_startMutationObserver(e){if(!this._mutationObserver){var t=Wc(er);this._mutationObserver=new t((e=>{this.onMutation(e)})),this._mutationObserver.observe(e,{attributes:!0,characterData:!0,childList:!0,subtree:!0})}}stop(){var e;null===(e=this._mutationObserver)||void 0===e||e.disconnect(),this._mutationObserver=void 0,er.removeEventListener("click",this._onClick),er.removeEventListener("scroll",this._onScroll,{capture:!0}),er.removeEventListener("selectionchange",this._onSelectionChange)}onMutation(e){this._lastMutation=Date.now()}_startClickObserver(){er.addEventListener("click",this._onClick)}_startScrollObserver(){er.addEventListener("scroll",this._onScroll,{capture:!0,passive:!0})}_startSelectionChangedObserver(){er.addEventListener("selectionchange",this._onSelectionChange)}_ignoreClick(e){if(!e)return!0;if(Pi(e.node))return!0;var t=this._clicks.some((t=>t.node===e.node&&Math.abs(t.timestamp-e.timestamp)<1e3));return!!t||!(!Di(e.node,"html")&&Li(e.node)&&!Ui.includes(e.node.tagName.toLowerCase()))}_checkClicks(){if(this._clicks.length){clearTimeout(this._checkClickTimer),this._checkClickTimer=void 0;var e=this._clicks;for(var t of(this._clicks=[],e)){var n;t.mutationDelayMs=null!==(n=t.mutationDelayMs)&&void 0!==n?n:this._lastMutation&&t.timestamp<=this._lastMutation?this._lastMutation-t.timestamp:void 0,t.absoluteDelayMs=Date.now()-t.timestamp,t.selectionChangedDelayMs=this._lastSelectionChanged&&t.timestamp<=this._lastSelectionChanged?this._lastSelectionChanged-t.timestamp:void 0;var r=Vc(t.scrollDelayMs,this._config.scroll_threshold_ms),i=Vc(t.selectionChangedDelayMs,this._config.selection_change_threshold_ms),o=Vc(t.mutationDelayMs,this._config.mutation_threshold_ms),s=Vc(t.absoluteDelayMs,1.1*this._config.mutation_threshold_ms),a=Sr(t.scrollDelayMs)&&t.scrollDelayMs<this._config.scroll_threshold_ms,l=Sr(t.mutationDelayMs)&&t.mutationDelayMs<this._config.mutation_threshold_ms,c=Sr(t.selectionChangedDelayMs)&&t.selectionChangedDelayMs<this._config.selection_change_threshold_ms;a||l||c||(r||o||s||i?this._onCapture(t,{$dead_click_last_mutation_timestamp:this._lastMutation,$dead_click_event_timestamp:t.timestamp,$dead_click_scroll_timeout:r,$dead_click_mutation_timeout:o,$dead_click_absolute_timeout:s,$dead_click_selection_changed_timeout:i}):t.absoluteDelayMs<this._config.mutation_threshold_ms&&this._clicks.push(t))}this._clicks.length&&mr(this._checkClickTimer)&&(this._checkClickTimer=er.setTimeout((()=>{this._checkClicks()}),1e3))}}_captureDeadClick(e,n){this.instance.capture("$dead_click",t(t(t({},n),Hc(e.node,{e:e.originalEvent,maskAllElementAttributes:this.instance.config.mask_all_element_attributes,maskAllText:this.instance.config.mask_all_text,elementAttributeIgnoreList:this._config.element_attribute_ignorelist,elementsChainAsString:!1}).props),{},{$dead_click_scroll_delay_ms:e.scrollDelayMs,$dead_click_mutation_delay_ms:e.mutationDelayMs,$dead_click_absolute_delay_ms:e.absoluteDelayMs,$dead_click_selection_changed_delay_ms:e.selectionChangedDelayMs}),{timestamp:new Date(e.timestamp)})}}er.__PosthogExtensions__=er.__PosthogExtensions__||{},er.__PosthogExtensions__.initDeadClicksAutocapture=(e,t)=>new Zc(e,t);var Gc=Rr("[FeatureFlags]"),Uc="$active_feature_flags",jc="$override_feature_flags",zc="$feature_flag_payloads",Yc=e=>{var t={};for(var[n,r]of Lr(e||{}))r&&(t[n]=r);return t};class Xc{constructor(e){i(this,"_override_warning",!1),i(this,"_hasLoadedFlags",!1),i(this,"_requestInFlight",!1),i(this,"_reloadingDisabled",!1),i(this,"_additionalReloadRequested",!1),i(this,"_decideCalled",!1),i(this,"_flagsLoadedFromRemote",!1),this.instance=e,this.featureFlagEventHandlers=[]}decide(){if(this.instance.config.__preview_remote_config)this._decideCalled=!0;else{var e=!this._reloadDebouncer&&(this.instance.config.advanced_disable_feature_flags||this.instance.config.advanced_disable_feature_flags_on_first_load);this._callDecideEndpoint({disableFlags:e})}}get hasLoadedFlags(){return this._hasLoadedFlags}getFlags(){return Object.keys(this.getFlagVariants())}getFlagVariants(){var e=this.instance.get_property(_i),t=this.instance.get_property(jc);if(!t)return e||{};for(var n=Or({},e),r=Object.keys(t),i=0;i<r.length;i++)n[r[i]]=t[r[i]];return this._override_warning||(Gc.warn(" Overriding feature flags!",{enabledFlags:e,overriddenFlags:t,finalFlags:n}),this._override_warning=!0),n}getFlagPayloads(){return this.instance.get_property(zc)||{}}reloadFeatureFlags(){this._reloadingDisabled||this.instance.config.advanced_disable_feature_flags||this._reloadDebouncer||(this._reloadDebouncer=setTimeout((()=>{this._callDecideEndpoint()}),5))}clearDebouncer(){clearTimeout(this._reloadDebouncer),this._reloadDebouncer=void 0}ensureFlagsLoaded(){this._hasLoadedFlags||this._requestInFlight||this._reloadDebouncer||this.reloadFeatureFlags()}setAnonymousDistinctId(e){this.$anon_distinct_id=e}setReloadingPaused(e){this._reloadingDisabled=e}_callDecideEndpoint(e){if(this.clearDebouncer(),!this.instance.config.advanced_disable_decide)if(this._requestInFlight)this._additionalReloadRequested=!0;else{var t={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:this.instance.get_property(bi),group_properties:this.instance.get_property(wi)};(null!=e&&e.disableFlags||this.instance.config.advanced_disable_feature_flags)&&(t.disable_flags=!0),this._requestInFlight=!0,this.instance._send_request({method:"POST",url:this.instance.requestRouter.endpointFor("api","/decide/?v=3"),data:t,compression:this.instance.config.disable_compression?void 0:qn.Base64,timeout:this.instance.config.feature_flag_request_timeout_ms,callback:e=>{var n,r,i=!0;(200===e.statusCode&&(this.$anon_distinct_id=void 0,i=!1),this._requestInFlight=!1,this._decideCalled)||(this._decideCalled=!0,this.instance._onRemoteConfig(null!==(r=e.json)&&void 0!==r?r:{}));t.disable_flags||(this._flagsLoadedFromRemote=!i,this.receivedFeatureFlags(null!==(n=e.json)&&void 0!==n?n:{},i),this._additionalReloadRequested&&(this._additionalReloadRequested=!1,this._callDecideEndpoint()))}})}}getFeatureFlag(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(this._hasLoadedFlags||this.getFlags()&&this.getFlags().length>0){var n,r,i,o,s,a=this.getFlagVariants()[e],l="".concat(a),c=this.instance.get_property(Ii)||{};if(t.send_event||!("send_event"in t))if(!(e in c)||!c[e].includes(l))dr(c[e])?c[e].push(l):c[e]=[l],null===(n=this.instance.persistence)||void 0===n||n.register({[Ii]:c}),this.instance.capture("$feature_flag_called",{$feature_flag:e,$feature_flag_response:a,$feature_flag_payload:this.getFeatureFlagPayload(e)||null,$feature_flag_bootstrapped_response:(null===(r=this.instance.config.bootstrap)||void 0===r||null===(i=r.featureFlags)||void 0===i?void 0:i[e])||null,$feature_flag_bootstrapped_payload:(null===(o=this.instance.config.bootstrap)||void 0===o||null===(s=o.featureFlagPayloads)||void 0===s?void 0:s[e])||null,$used_bootstrap_value:!this._flagsLoadedFromRemote});return a}Gc.warn('getFeatureFlag for key "'+e+"\" failed. Feature flags didn't load in time.")}getFeatureFlagPayload(e){return this.getFlagPayloads()[e]}isFeatureEnabled(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(this._hasLoadedFlags||this.getFlags()&&this.getFlags().length>0)return!!this.getFeatureFlag(e,t);Gc.warn('isFeatureEnabled for key "'+e+"\" failed. Feature flags didn't load in time.")}addFeatureFlagsHandler(e){this.featureFlagEventHandlers.push(e)}removeFeatureFlagsHandler(e){this.featureFlagEventHandlers=this.featureFlagEventHandlers.filter((t=>t!==e))}receivedFeatureFlags(e,n){if(this.instance.persistence){this._hasLoadedFlags=!0;var r=this.getFlagVariants(),i=this.getFlagPayloads();!function(e,n){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},o=e.featureFlags,s=e.featureFlagPayloads;if(o)if(dr(o)){var a={};if(o)for(var l=0;l<o.length;l++)a[o[l]]=!0;n&&n.register({[Uc]:o,[_i]:a})}else{var c=o,u=s;e.errorsWhileComputingFlags&&(c=t(t({},r),c),u=t(t({},i),u)),n&&n.register({[Uc]:Object.keys(Yc(c)),[_i]:c||{},[zc]:u||{}})}}(e,this.instance.persistence,r,i),this._fireFeatureFlagsCallbacks(n)}}override(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(!this.instance.__loaded||!this.instance.persistence)return Gc.uninitializedWarning("posthog.feature_flags.override");if(this._override_warning=t,!1===e)this.instance.persistence.unregister(jc);else if(dr(e)){for(var n={},r=0;r<e.length;r++)n[e[r]]=!0;this.instance.persistence.register({[jc]:n})}else this.instance.persistence.register({[jc]:e})}onFeatureFlags(e){if(this.addFeatureFlagsHandler(e),this._hasLoadedFlags){var{flags:t,flagVariants:n}=this._prepareFeatureFlagsForCallbacks();e(t,n)}return()=>this.removeFeatureFlagsHandler(e)}updateEarlyAccessFeatureEnrollment(e,n){var r,i=(this.instance.get_property(yi)||[]).find((t=>t.flagKey===e)),o={["$feature_enrollment/".concat(e)]:n},s={$feature_flag:e,$feature_enrollment:n,$set:o};i&&(s.$early_access_feature_name=i.name),this.instance.capture("$feature_enrollment_update",s),this.setPersonPropertiesForFlags(o,!1);var a=t(t({},this.getFlagVariants()),{},{[e]:n});null===(r=this.instance.persistence)||void 0===r||r.register({[Uc]:Object.keys(Yc(a)),[_i]:a}),this._fireFeatureFlagsCallbacks()}getEarlyAccessFeatures(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=this.instance.get_property(yi);if(n&&!t)return e(n);this.instance._send_request({url:this.instance.requestRouter.endpointFor("api","/api/early_access_features/?token=".concat(this.instance.config.token)),method:"GET",callback:t=>{var n;if(t.json){var r=t.json.earlyAccessFeatures;return null===(n=this.instance.persistence)||void 0===n||n.register({[yi]:r}),e(r)}}})}_prepareFeatureFlagsForCallbacks(){var e=this.getFlags(),t=this.getFlagVariants();return{flags:e.filter((e=>t[e])),flagVariants:Object.keys(t).filter((e=>t[e])).reduce(((e,n)=>(e[n]=t[n],e)),{})}}_fireFeatureFlagsCallbacks(e){var{flags:t,flagVariants:n}=this._prepareFeatureFlagsForCallbacks();this.featureFlagEventHandlers.forEach((r=>r(t,n,{errorsLoading:e})))}setPersonPropertiesForFlags(e){var n=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],r=this.instance.get_property(bi)||{};this.instance.register({[bi]:t(t({},r),e)}),n&&this.instance.reloadFeatureFlags()}resetPersonPropertiesForFlags(){this.instance.unregister(bi)}setGroupPropertiesForFlags(e){var n=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],r=this.instance.get_property(wi)||{};0!==Object.keys(r).length&&Object.keys(r).forEach((n=>{r[n]=t(t({},r[n]),e[n]),delete e[n]})),this.instance.register({[wi]:t(t({},r),e)}),n&&this.instance.reloadFeatureFlags()}resetGroupPropertiesForFlags(e){if(e){var n=this.instance.get_property(wi)||{};this.instance.register({[wi]:t(t({},n),{},{[e]:{}})})}else this.instance.unregister(wi)}}Math.trunc||(Math.trunc=function(e){return e<0?Math.ceil(e):Math.floor(e)}),Number.isInteger||(Number.isInteger=function(e){return Sr(e)&&isFinite(e)&&Math.floor(e)===e});var Jc="0123456789abcdef";class Kc{constructor(e){if(this.bytes=e,16!==e.length)throw new TypeError("not 128-bit length")}static fromFieldsV7(e,t,n,r){if(!Number.isInteger(e)||!Number.isInteger(t)||!Number.isInteger(n)||!Number.isInteger(r)||e<0||t<0||n<0||r<0||e>0xffffffffffff||t>4095||n>1073741823||r>4294967295)throw new RangeError("invalid field value");var i=new Uint8Array(16);return i[0]=e/Math.pow(2,40),i[1]=e/Math.pow(2,32),i[2]=e/Math.pow(2,24),i[3]=e/Math.pow(2,16),i[4]=e/Math.pow(2,8),i[5]=e,i[6]=112|t>>>8,i[7]=t,i[8]=128|n>>>24,i[9]=n>>>16,i[10]=n>>>8,i[11]=n,i[12]=r>>>24,i[13]=r>>>16,i[14]=r>>>8,i[15]=r,new Kc(i)}toString(){for(var e="",t=0;t<this.bytes.length;t++)e=e+Jc.charAt(this.bytes[t]>>>4)+Jc.charAt(15&this.bytes[t]),3!==t&&5!==t&&7!==t&&9!==t||(e+="-");if(36!==e.length)throw new Error("Invalid UUIDv7 was generated");return e}clone(){return new Kc(this.bytes.slice(0))}equals(e){return 0===this.compareTo(e)}compareTo(e){for(var t=0;t<16;t++){var n=this.bytes[t]-e.bytes[t];if(0!==n)return Math.sign(n)}return 0}}class Qc{constructor(){i(this,"timestamp",0),i(this,"counter",0),i(this,"random",new nu)}generate(){var e=this.generateOrAbort();if(mr(e)){this.timestamp=0;var t=this.generateOrAbort();if(mr(t))throw new Error("Could not generate UUID after timestamp reset");return t}return e}generateOrAbort(){var e=Date.now();if(e>this.timestamp)this.timestamp=e,this.resetCounter();else{if(!(e+1e4>this.timestamp))return;this.counter++,this.counter>4398046511103&&(this.timestamp++,this.resetCounter())}return Kc.fromFieldsV7(this.timestamp,Math.trunc(this.counter/Math.pow(2,30)),this.counter&Math.pow(2,30)-1,this.random.nextUint32())}resetCounter(){this.counter=1024*this.random.nextUint32()+(1023&this.random.nextUint32())}}var eu,tu=e=>{if("undefined"!=typeof UUIDV7_DENY_WEAK_RNG&&UUIDV7_DENY_WEAK_RNG)throw new Error("no cryptographically strong RNG available");for(var t=0;t<e.length;t++)e[t]=65536*Math.trunc(65536*Math.random())+Math.trunc(65536*Math.random());return e};Wn&&!mr(Wn.crypto)&&crypto.getRandomValues&&(tu=e=>crypto.getRandomValues(e));class nu{constructor(){i(this,"buffer",new Uint32Array(8)),i(this,"cursor",1/0)}nextUint32(){return this.cursor>=this.buffer.length&&(tu(this.buffer),this.cursor=0),this.buffer[this.cursor++]}}var ru=()=>iu().toString(),iu=()=>(eu||(eu=new Qc)).generate(),ou="Thu, 01 Jan 1970 00:00:00 GMT",su="";var au=/[a-z0-9][a-z0-9-]+\.[a-z]{2,}$/i;function lu(e,t){if(t){var n=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:zn;if(su)return su;if(!t)return"";if(["localhost","127.0.0.1"].includes(e))return"";for(var n=e.split("."),r=Math.min(n.length,8),i="dmn_chk_"+ru(),o=new RegExp("(^|;)\\s*"+i+"=1");!su&&r--;){var s=n.slice(r).join("."),a=i+"=1;domain=."+s;t.cookie=a,o.test(t.cookie)&&(t.cookie=a+";expires="+ou,su=s)}return su}(e);if(!n){var r=(e=>{var t=e.match(au);return t?t[0]:""})(e);r!==n&&Mr.info("Warning: cookie subdomain discovery mismatch",r,n),n=r}return n?"; domain=."+n:""}return""}var cu={is_supported:()=>!!zn,error:function(e){Mr.error("cookieStore error: "+e)},get:function(e){if(zn){try{for(var t=e+"=",n=zn.cookie.split(";").filter((e=>e.length)),r=0;r<n.length;r++){for(var i=n[r];" "==i.charAt(0);)i=i.substring(1,i.length);if(0===i.indexOf(t))return decodeURIComponent(i.substring(t.length,i.length))}}catch(e){}return null}},parse:function(e){var t;try{t=JSON.parse(cu.get(e))||{}}catch(e){}return t},set:function(e,t,n,r,i){if(zn)try{var o="",s="",a=lu(zn.location.hostname,r);if(n){var l=new Date;l.setTime(l.getTime()+24*n*60*60*1e3),o="; expires="+l.toUTCString()}i&&(s="; secure");var c=e+"="+encodeURIComponent(JSON.stringify(t))+o+"; SameSite=Lax; path=/"+a+s;return c.length>3686.4&&Mr.warn("cookieStore warning: large cookie, len="+c.length),zn.cookie=c,c}catch(e){return}},remove:function(e,t){try{cu.set(e,"",-1,t)}catch(e){return}}},uu=null,du={is_supported:function(){if(!br(uu))return uu;var e=!0;if(mr(Wn))e=!1;else try{var t="__mplssupport__";du.set(t,"xyz"),'"xyz"'!==du.get(t)&&(e=!1),du.remove(t)}catch(t){e=!1}return e||Mr.error("localStorage unsupported; falling back to cookie store"),uu=e,e},error:function(e){Mr.error("localStorage error: "+e)},get:function(e){try{return null==Wn?void 0:Wn.localStorage.getItem(e)}catch(e){du.error(e)}return null},parse:function(e){try{return JSON.parse(du.get(e))||{}}catch(e){}return null},set:function(e,t){try{null==Wn||Wn.localStorage.setItem(e,JSON.stringify(t))}catch(e){du.error(e)}},remove:function(e){try{null==Wn||Wn.localStorage.removeItem(e)}catch(e){du.error(e)}}},hu=["distinct_id",vi,gi,Ai,Ri],pu=t(t({},du),{},{parse:function(e){try{var t={};try{t=cu.parse(e)||{}}catch(e){}var n=Or(t,JSON.parse(du.get(e)||"{}"));return du.set(e,n),n}catch(e){}return null},set:function(e,t,n,r,i,o){try{du.set(e,t,void 0,void 0,o);var s={};hu.forEach((e=>{t[e]&&(s[e]=t[e])})),Object.keys(s).length&&cu.set(e,s,n,r,i,o)}catch(e){du.error(e)}},remove:function(e,t){try{null==Wn||Wn.localStorage.removeItem(e),cu.remove(e,t)}catch(e){du.error(e)}}}),vu={},gu={is_supported:function(){return!0},error:function(e){Mr.error("memoryStorage error: "+e)},get:function(e){return vu[e]||null},parse:function(e){return vu[e]||null},set:function(e,t){vu[e]=t},remove:function(e){delete vu[e]}},fu=null,mu={is_supported:function(){if(!br(fu))return fu;if(fu=!0,mr(Wn))fu=!1;else try{var e="__support__";mu.set(e,"xyz"),'"xyz"'!==mu.get(e)&&(fu=!1),mu.remove(e)}catch(e){fu=!1}return fu},error:function(e){Mr.error("sessionStorage error: ",e)},get:function(e){try{return null==Wn?void 0:Wn.sessionStorage.getItem(e)}catch(e){mu.error(e)}return null},parse:function(e){try{return JSON.parse(mu.get(e))||null}catch(e){}return null},set:function(e,t){try{null==Wn||Wn.sessionStorage.setItem(e,JSON.stringify(t))}catch(e){mu.error(e)}},remove:function(e){try{null==Wn||Wn.sessionStorage.removeItem(e)}catch(e){mu.error(e)}}},_u="Mobile",yu="iOS",bu="Android",wu="Tablet",Su=bu+" "+wu,Cu="iPad",Iu="Apple",ku=Iu+" Watch",Eu="Safari",xu="BlackBerry",Tu="Samsung",Mu=Tu+"Browser",Ru=Tu+" Internet",Au="Chrome",Nu=Au+" OS",Fu=Au+" "+yu,Ou="Internet Explorer",Pu=Ou+" "+_u,Lu="Opera",Du=Lu+" Mini",Bu="Edge",Hu="Microsoft "+Bu,qu="Firefox",$u=qu+" "+yu,Wu="Nintendo",Vu="PlayStation",Zu="Xbox",Gu=bu+" "+_u,Uu=_u+" "+Eu,ju="Windows",zu=ju+" Phone",Yu="Nokia",Xu="Ouya",Ju="Generic",Ku=Ju+" "+_u.toLowerCase(),Qu=Ju+" "+wu.toLowerCase(),ed="Konqueror",td="(\\d+(\\.\\d+)?)",nd=new RegExp("Version/"+td),rd=new RegExp(Zu,"i"),id=new RegExp(Vu+" \\w+","i"),od=new RegExp(Wu+" \\w+","i"),sd=new RegExp(xu+"|PlayBook|BB10","i"),ad={"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 ld=(e,t)=>t&&ir(t,Iu)||function(e){return ir(e,Eu)&&!ir(e,Au)&&!ir(e,bu)}(e),cd=function(e,t){return t=t||"",ir(e," OPR/")&&ir(e,"Mini")?Du:ir(e," OPR/")?Lu:sd.test(e)?xu:ir(e,"IE"+_u)||ir(e,"WPDesktop")?Pu:ir(e,Mu)?Ru:ir(e,Bu)||ir(e,"Edg/")?Hu:ir(e,"FBIOS")?"Facebook "+_u:ir(e,"UCWEB")||ir(e,"UCBrowser")?"UC Browser":ir(e,"CriOS")?Fu:ir(e,"CrMo")||ir(e,Au)?Au:ir(e,bu)&&ir(e,Eu)?Gu:ir(e,"FxiOS")?$u:ir(e.toLowerCase(),ed.toLowerCase())?ed:ld(e,t)?ir(e,_u)?Uu:Eu:ir(e,qu)?qu:ir(e,"MSIE")||ir(e,"Trident/")?Ou:ir(e,"Gecko")?qu:""},ud={[Pu]:[new RegExp("rv:"+td)],[Hu]:[new RegExp(Bu+"?\\/"+td)],[Au]:[new RegExp("("+Au+"|CrMo)\\/"+td)],[Fu]:[new RegExp("CriOS\\/"+td)],"UC Browser":[new RegExp("(UCBrowser|UCWEB)\\/"+td)],[Eu]:[nd],[Uu]:[nd],[Lu]:[new RegExp("(Opera|OPR)\\/"+td)],[qu]:[new RegExp(qu+"\\/"+td)],[$u]:[new RegExp("FxiOS\\/"+td)],[ed]:[new RegExp("Konqueror[:/]?"+td,"i")],[xu]:[new RegExp(xu+" "+td),nd],[Gu]:[new RegExp("android\\s"+td,"i")],[Ru]:[new RegExp(Mu+"\\/"+td)],[Ou]:[new RegExp("(rv:|MSIE )"+td)],Mozilla:[new RegExp("rv:"+td)]},dd=[[new RegExp(Zu+"; "+Zu+" (.*?)[);]","i"),e=>[Zu,e&&e[1]||""]],[new RegExp(Wu,"i"),[Wu,""]],[new RegExp(Vu,"i"),[Vu,""]],[sd,[xu,""]],[new RegExp(ju,"i"),(e,t)=>{if(/Phone/.test(t)||/WPDesktop/.test(t))return[zu,""];if(new RegExp(_u).test(t)&&!/IEMobile\b/.test(t))return[ju+" "+_u,""];var n=/Windows NT ([0-9.]+)/i.exec(t);if(n&&n[1]){var r=n[1],i=ad[r]||"";return/arm/i.test(t)&&(i="RT"),[ju,i]}return[ju,""]}],[/((iPhone|iPad|iPod).*?OS (\d+)_(\d+)_?(\d+)?|iPhone)/,e=>{if(e&&e[3]){var t=[e[3],e[4],e[5]||"0"];return[yu,t.join(".")]}return[yu,""]}],[/(watch.*\/(\d+\.\d+\.\d+)|watch os,(\d+\.\d+),)/i,e=>{var t="";return e&&e.length>=3&&(t=mr(e[2])?e[3]:e[2]),["watchOS",t]}],[new RegExp("("+bu+" (\\d+)\\.(\\d+)\\.?(\\d+)?|"+bu+")","i"),e=>{if(e&&e[2]){var t=[e[2],e[3],e[4]||"0"];return[bu,t.join(".")]}return[bu,""]}],[/Mac OS X (\d+)[_.](\d+)[_.]?(\d+)?/i,e=>{var t=["Mac OS X",""];if(e&&e[1]){var n=[e[1],e[2],e[3]||"0"];t[1]=n.join(".")}return t}],[/Mac/i,["Mac OS X",""]],[/CrOS/,[Nu,""]],[/Linux|debian/i,["Linux",""]]],hd=function(e){return od.test(e)?Wu:id.test(e)?Vu:rd.test(e)?Zu:new RegExp(Xu,"i").test(e)?Xu:new RegExp("("+zu+"|WPDesktop)","i").test(e)?zu:/iPad/.test(e)?Cu:/iPod/.test(e)?"iPod Touch":/iPhone/.test(e)?"iPhone":/(watch)(?: ?os[,/]|\d,\d\/)[\d.]+/i.test(e)?ku:sd.test(e)?xu:/(kobo)\s(ereader|touch)/i.test(e)?"Kobo":new RegExp(Yu,"i").test(e)?Yu:/(kf[a-z]{2}wi|aeo[c-r]{2})( bui|\))/i.test(e)||/(kf[a-z]+)( bui|\)).+silk\//i.test(e)?"Kindle Fire":/(Android|ZTE)/i.test(e)?!new RegExp(_u).test(e)||/(9138B|TB782B|Nexus [97]|pixel c|HUAWEISHT|BTV|noble nook|smart ultra 6)/i.test(e)?/pixel[\daxl ]{1,6}/i.test(e)&&!/pixel c/i.test(e)||/(huaweimed-al00|tah-|APA|SM-G92|i980|zte|U304AA)/i.test(e)||/lmy47v/i.test(e)&&!/QTAQZ3/i.test(e)?bu:Su:bu:new RegExp("(pda|"+_u+")","i").test(e)?Ku:new RegExp(wu,"i").test(e)&&!new RegExp(wu+" pc","i").test(e)?Qu:""},pd="https?://(.*)",vd=["gclid","gclsrc","dclid","gbraid","wbraid","fbclid","msclkid","twclid","li_fat_id","igshid","ttclid","rdt_cid","irclid","_kx"],gd=Pr(["utm_source","utm_medium","utm_campaign","utm_content","utm_term","gad_source","mc_cid"],vd),fd="<masked>",md={campaignParams:function(){var{customTrackedParams:e,maskPersonalDataProperties:t,customPersonalDataProperties:n}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(!zn)return{};var r=t?Pr([],vd,n||[]):[];return this._campaignParamsFromUrl(Xr(zn.URL,r,fd),e)},_campaignParamsFromUrl:function(e,t){var n=gd.concat(t||[]),r={};return Fr(n,(function(t){var n=Yr(e,t);r[t]=n||null})),r},_searchEngine:function(e){return e?0===e.search(pd+"google.([^/?]*)")?"google":0===e.search(pd+"bing.com")?"bing":0===e.search(pd+"yahoo.com")?"yahoo":0===e.search(pd+"duckduckgo.com")?"duckduckgo":null:null},_searchInfoFromReferrer:function(e){var t=md._searchEngine(e),n="yahoo"!=t?"q":"p",r={};if(!br(t)){r.$search_engine=t;var i=zn?Yr(zn.referrer,n):"";i.length&&(r.ph_keyword=i)}return r},searchInfo:function(){var e=null==zn?void 0:zn.referrer;return e?this._searchInfoFromReferrer(e):{}},browser:cd,browserVersion:function(e,t){var n=cd(e,t),r=ud[n];if(mr(r))return null;for(var i=0;i<r.length;i++){var o=r[i],s=e.match(o);if(s)return parseFloat(s[s.length-2])}return null},browserLanguage:function(){return navigator.language||navigator.userLanguage},browserLanguagePrefix:function(){var e=this.browserLanguage();return"string"==typeof e?e.split("-")[0]:void 0},os:function(e){for(var t=0;t<dd.length;t++){var[n,r]=dd[t],i=n.exec(e),o=i&&(hr(r)?r(i,e):r);if(o)return o}return["",""]},device:hd,deviceType:function(e){var t=hd(e);return t===Cu||t===Su||"Kobo"===t||"Kindle Fire"===t||t===Qu?wu:t===Wu||t===Zu||t===Vu||t===Xu?"Console":t===ku?"Wearable":t?_u:"Desktop"},referrer:function(){return(null==zn?void 0:zn.referrer)||"$direct"},referringDomain:function(){var e;return null!=zn&&zn.referrer&&(null===(e=Ur(zn.referrer))||void 0===e?void 0:e.host)||"$direct"},referrerInfo:function(){return{$referrer:this.referrer(),$referring_domain:this.referringDomain()}},initialPersonInfo:function(){return{r:this.referrer().substring(0,1e3),u:null==Yn?void 0:Yn.href.substring(0,1e3)}},initialPersonPropsFromInfo:function(e){var t,{r:n,u:r}=e,i={$initial_referrer:n,$initial_referring_domain:null==n?void 0:"$direct"==n?"$direct":null===(t=Ur(n))||void 0===t?void 0:t.host};if(r){i.$initial_current_url=r;var o=Ur(r);i.$initial_host=null==o?void 0:o.host,i.$initial_pathname=null==o?void 0:o.pathname,Fr(this._campaignParamsFromUrl(r),(function(e,t){i["$initial_"+sr(t)]=e}))}n&&Fr(this._searchInfoFromReferrer(n),(function(e,t){i["$initial_"+sr(t)]=e}));return i},timezone:function(){try{return Intl.DateTimeFormat().resolvedOptions().timeZone}catch(e){return}},timezoneOffset:function(){try{return(new Date).getTimezoneOffset()}catch(e){return}},properties:function(){var{maskPersonalDataProperties:e,customPersonalDataProperties:t}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(!Qn)return{};var n=e?Pr([],vd,t||[]):[],[r,i]=md.os(Qn);return Or(Hr({$os:r,$os_version:i,$browser:md.browser(Qn,navigator.vendor),$device:md.device(Qn),$device_type:md.deviceType(Qn),$timezone:md.timezone(),$timezone_offset:md.timezoneOffset()}),{$current_url:Xr(null==Yn?void 0:Yn.href,n,fd),$host:null==Yn?void 0:Yn.host,$pathname:null==Yn?void 0:Yn.pathname,$raw_user_agent:Qn.length>1e3?Qn.substring(0,997)+"...":Qn,$browser_version:md.browserVersion(Qn,navigator.vendor),$browser_language:md.browserLanguage(),$browser_language_prefix:md.browserLanguagePrefix(),$screen_height:null==Wn?void 0:Wn.screen.height,$screen_width:null==Wn?void 0:Wn.screen.width,$viewport_height:null==Wn?void 0:Wn.innerHeight,$viewport_width:null==Wn?void 0:Wn.innerWidth,$lib:"web",$lib_version:xr.LIB_VERSION,$insert_id:Math.random().toString(36).substring(2,10)+Math.random().toString(36).substring(2,10),$time:Date.now()/1e3})},people_properties:function(){if(!Qn)return{};var[e,t]=md.os(Qn);return Or(Hr({$os:e,$os_version:t,$browser:md.browser(Qn,navigator.vendor)}),{$browser_version:md.browserVersion(Qn,navigator.vendor)})}},_d=["cookie","localstorage","localstorage+cookie","sessionstorage","memory"];class yd{constructor(e){this.config=e,this.props={},this.campaign_params_saved=!1,this.name=(e=>{var t="";return e.token&&(t=e.token.replace(/\+/g,"PL").replace(/\//g,"SL").replace(/=/g,"EQ")),e.persistence_name?"ph_"+e.persistence_name:"ph_"+t+"_posthog"})(e),this.storage=this.buildStorage(e),this.load(),e.debug&&Mr.info("Persistence loaded",e.persistence,t({},this.props)),this.update_config(e,e),this.save()}buildStorage(e){-1===_d.indexOf(e.persistence.toLowerCase())&&(Mr.critical("Unknown persistence type "+e.persistence+"; falling back to localStorage+cookie"),e.persistence="localStorage+cookie");var t=e.persistence.toLowerCase();return"localstorage"===t&&du.is_supported()?du:"localstorage+cookie"===t&&pu.is_supported()?pu:"sessionstorage"===t&&mu.is_supported()?mu:"memory"===t?gu:"cookie"===t?cu:pu.is_supported()?pu:cu}properties(){var e={};return Fr(this.props,(function(t,n){if(n===_i&&gr(t))for(var r=Object.keys(t),i=0;i<r.length;i++)e["$feature/".concat(r[i])]=t[r[i]];else s=n,a=!1,(br(o=Oi)?a:Un&&o.indexOf===Un?-1!=o.indexOf(s):(Fr(o,(function(e){if(a||(a=e===s))return Ar})),a))||(e[n]=t);var o,s,a})),e}load(){if(!this.disabled){var e=this.storage.parse(this.name);e&&(this.props=Or({},e))}}save(){this.disabled||this.storage.set(this.name,this.props,this.expire_days,this.cross_subdomain,this.secure,this.config.debug)}remove(){this.storage.remove(this.name,!1),this.storage.remove(this.name,!0)}clear(){this.remove(),this.props={}}register_once(e,t,n){if(gr(e)){mr(t)&&(t="None"),this.expire_days=mr(n)?this.default_expiry:n;var r=!1;if(Fr(e,((e,n)=>{this.props.hasOwnProperty(n)&&this.props[n]!==t||(this.props[n]=e,r=!0)})),r)return this.save(),!0}return!1}register(e,t){if(gr(e)){this.expire_days=mr(t)?this.default_expiry:t;var n=!1;if(Fr(e,((t,r)=>{e.hasOwnProperty(r)&&this.props[r]!==t&&(this.props[r]=t,n=!0)})),n)return this.save(),!0}return!1}unregister(e){e in this.props&&(delete this.props[e],this.save())}update_campaign_params(){if(!this.campaign_params_saved){var e=md.campaignParams({customTrackedParams:this.config.custom_campaign_params,maskPersonalDataProperties:this.config.mask_personal_data_properties,customPersonalDataProperties:this.config.custom_personal_data_properties});fr(Hr(e))||this.register(e),this.campaign_params_saved=!0}}update_search_keyword(){this.register(md.searchInfo())}update_referrer_info(){this.register_once(md.referrerInfo(),void 0)}set_initial_person_info(){this.props[Ti]||this.props[Mi]||this.register_once({[Ri]:md.initialPersonInfo()},void 0)}get_referrer_info(){return Hr({$referrer:this.props.$referrer,$referring_domain:this.props.$referring_domain})}get_initial_props(){var e={};Fr([Mi,Ti],(t=>{var n=this.props[t];n&&Fr(n,(function(t,n){e["$initial_"+sr(n)]=t}))}));var t=this.props[Ri];if(t){var n=md.initialPersonPropsFromInfo(t);Or(e,n)}return e}safe_merge(e){return Fr(this.props,(function(t,n){n in e||(e[n]=t)})),e}update_config(e,t){if(this.default_expiry=this.expire_days=e.cookie_expiration,this.set_disabled(e.disable_persistence),this.set_cross_subdomain(e.cross_subdomain_cookie),this.set_secure(e.secure_cookie),e.persistence!==t.persistence){var n=this.buildStorage(e),r=this.props;this.clear(),this.storage=n,this.props=r,this.save()}}set_disabled(e){this.disabled=e,this.disabled?this.remove():this.save()}set_cross_subdomain(e){e!==this.cross_subdomain&&(this.cross_subdomain=e,this.remove(),this.save())}get_cross_subdomain(){return!!this.cross_subdomain}set_secure(e){e!==this.secure&&(this.secure=e,this.remove(),this.save())}set_event_timer(e,t){var n=this.props[ei]||{};n[e]=t,this.props[ei]=n,this.save()}remove_event_timer(e){var t=(this.props[ei]||{})[e];return mr(t)||(delete this.props[ei][e],this.save()),t}get_property(e){return this.props[e]}set_property(e,t){this.props[e]=t,this.save()}}function bd(e){var t,n;return(null===(t=JSON.stringify(e,(n=[],function(e,t){if(gr(t)){for(;n.length>0&&n[n.length-1]!==this;)n.pop();return n.includes(t)?"[Circular]":(n.push(t),t)}return t})))||void 0===t?void 0:t.length)||0}function wd(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:6606028.8;if(e.size>=t&&e.data.length>1){var n=Math.floor(e.data.length/2),r=e.data.slice(0,n),i=e.data.slice(n);return[wd({size:bd(r),data:r,sessionId:e.sessionId,windowId:e.windowId}),wd({size:bd(i),data:i,sessionId:e.sessionId,windowId:e.windowId})].flatMap((e=>e))}return[e]}var Sd=(e=>(e[e.DomContentLoaded=0]="DomContentLoaded",e[e.Load=1]="Load",e[e.FullSnapshot=2]="FullSnapshot",e[e.IncrementalSnapshot=3]="IncrementalSnapshot",e[e.Meta=4]="Meta",e[e.Custom=5]="Custom",e[e.Plugin=6]="Plugin",e))(Sd||{}),Cd=(e=>(e[e.Mutation=0]="Mutation",e[e.MouseMove=1]="MouseMove",e[e.MouseInteraction=2]="MouseInteraction",e[e.Scroll=3]="Scroll",e[e.ViewportResize=4]="ViewportResize",e[e.Input=5]="Input",e[e.TouchMove=6]="TouchMove",e[e.MediaInteraction=7]="MediaInteraction",e[e.StyleSheetRule=8]="StyleSheetRule",e[e.CanvasMutation=9]="CanvasMutation",e[e.Font=10]="Font",e[e.Log=11]="Log",e[e.Drag=12]="Drag",e[e.StyleDeclaration=13]="StyleDeclaration",e[e.Selection=14]="Selection",e[e.AdoptedStyleSheet=15]="AdoptedStyleSheet",e[e.CustomElement=16]="CustomElement",e))(Cd||{});function Id(e,t,n,r,i){return t>n&&(Mr.warn("min cannot be greater than max."),t=n),Sr(e)?e>n?(r&&Mr.warn(r+" cannot be greater than max: "+n+". Using max value instead."),n):e<t?(r&&Mr.warn(r+" cannot be less than min: "+t+". Using min value instead."),t):e:(r&&Mr.warn(r+" must be a number. using max or fallback. max: "+n+", fallback: "+i),Id(i||n,t,n,r))}class kd{constructor(e){var t,n,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};i(this,"bucketSize",100),i(this,"refillRate",10),i(this,"mutationBuckets",{}),i(this,"loggedTracker",{}),i(this,"refillBuckets",(()=>{Object.keys(this.mutationBuckets).forEach((e=>{this.mutationBuckets[e]=this.mutationBuckets[e]+this.refillRate,this.mutationBuckets[e]>=this.bucketSize&&delete this.mutationBuckets[e]}))})),i(this,"getNodeOrRelevantParent",(e=>{var t=this.rrweb.mirror.getNode(e);if("svg"!==(null==t?void 0:t.nodeName)&&t instanceof Element){var n=t.closest("svg");if(n)return[this.rrweb.mirror.getId(n),n]}return[e,t]})),i(this,"numberOfChanges",(e=>{var t,n,r,i,o,s,a,l;return(null!==(t=null===(n=e.removes)||void 0===n?void 0:n.length)&&void 0!==t?t:0)+(null!==(r=null===(i=e.attributes)||void 0===i?void 0:i.length)&&void 0!==r?r:0)+(null!==(o=null===(s=e.texts)||void 0===s?void 0:s.length)&&void 0!==o?o:0)+(null!==(a=null===(l=e.adds)||void 0===l?void 0:l.length)&&void 0!==a?a:0)})),i(this,"throttleMutations",(e=>{if(3!==e.type||0!==e.data.source)return e;var t=e.data,n=this.numberOfChanges(t);t.attributes&&(t.attributes=t.attributes.filter((e=>{var t,n,r,[i,o]=this.getNodeOrRelevantParent(e.id);if(0===this.mutationBuckets[i])return!1;(this.mutationBuckets[i]=null!==(t=this.mutationBuckets[i])&&void 0!==t?t:this.bucketSize,this.mutationBuckets[i]=Math.max(this.mutationBuckets[i]-1,0),0===this.mutationBuckets[i])&&(this.loggedTracker[i]||(this.loggedTracker[i]=!0,null===(n=(r=this.options).onBlockedNode)||void 0===n||n.call(r,i,o)));return e})));var r=this.numberOfChanges(t);return 0!==r||n===r?e:void 0})),this.rrweb=e,this.options=r,this.refillRate=Id(null!==(t=this.options.refillRate)&&void 0!==t?t:this.refillRate,0,100,"mutation throttling refill rate"),this.bucketSize=Id(null!==(n=this.options.bucketSize)&&void 0!==n?n:this.bucketSize,0,100,"mutation throttling bucket size"),setInterval((()=>{this.refillBuckets()}),1e3)}}var Ed=Uint8Array,xd=Uint16Array,Td=Uint32Array,Md=new Ed([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]),Rd=new Ed([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]),Ad=new Ed([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),Nd=function(e,t){for(var n=new xd(31),r=0;r<31;++r)n[r]=t+=1<<e[r-1];var i=new Td(n[30]);for(r=1;r<30;++r)for(var o=n[r];o<n[r+1];++o)i[o]=o-n[r]<<5|r;return[n,i]},Fd=Nd(Md,2),Od=Fd[0],Pd=Fd[1];Od[28]=258,Pd[258]=28;for(var Ld=Nd(Rd,0)[1],Dd=new xd(32768),Bd=0;Bd<32768;++Bd){var Hd=(43690&Bd)>>>1|(21845&Bd)<<1;Hd=(61680&(Hd=(52428&Hd)>>>2|(13107&Hd)<<2))>>>4|(3855&Hd)<<4,Dd[Bd]=((65280&Hd)>>>8|(255&Hd)<<8)>>>1}var qd=function(e,t,n){for(var r=e.length,i=0,o=new xd(t);i<r;++i)++o[e[i]-1];var s,a=new xd(t);for(i=0;i<t;++i)a[i]=a[i-1]+o[i-1]<<1;if(n){s=new xd(1<<t);var l=15-t;for(i=0;i<r;++i)if(e[i])for(var c=i<<4|e[i],u=t-e[i],d=a[e[i]-1]++<<u,h=d|(1<<u)-1;d<=h;++d)s[Dd[d]>>>l]=c}else for(s=new xd(r),i=0;i<r;++i)s[i]=Dd[a[e[i]-1]++]>>>15-e[i];return s},$d=new Ed(288);for(Bd=0;Bd<144;++Bd)$d[Bd]=8;for(Bd=144;Bd<256;++Bd)$d[Bd]=9;for(Bd=256;Bd<280;++Bd)$d[Bd]=7;for(Bd=280;Bd<288;++Bd)$d[Bd]=8;var Wd=new Ed(32);for(Bd=0;Bd<32;++Bd)Wd[Bd]=5;var Vd=qd($d,9,0),Zd=qd(Wd,5,0),Gd=function(e){return(e/8>>0)+(7&e&&1)},Ud=function(e,t,n){(null==n||n>e.length)&&(n=e.length);var r=new(e instanceof xd?xd:e instanceof Td?Td:Ed)(n-t);return r.set(e.subarray(t,n)),r},jd=function(e,t,n){n<<=7&t;var r=t/8>>0;e[r]|=n,e[r+1]|=n>>>8},zd=function(e,t,n){n<<=7&t;var r=t/8>>0;e[r]|=n,e[r+1]|=n>>>8,e[r+2]|=n>>>16},Yd=function(e,t){for(var n=[],r=0;r<e.length;++r)e[r]&&n.push({s:r,f:e[r]});var i=n.length,o=n.slice();if(!i)return[new Ed(0),0];if(1==i){var s=new Ed(n[0].s+1);return s[n[0].s]=1,[s,1]}n.sort((function(e,t){return e.f-t.f})),n.push({s:-1,f:25001});var a=n[0],l=n[1],c=0,u=1,d=2;for(n[0]={s:-1,f:a.f+l.f,l:a,r:l};u!=i-1;)a=n[n[c].f<n[d].f?c++:d++],l=n[c!=u&&n[c].f<n[d].f?c++:d++],n[u++]={s:-1,f:a.f+l.f,l:a,r:l};var h=o[0].s;for(r=1;r<i;++r)o[r].s>h&&(h=o[r].s);var p=new xd(h+1),v=Xd(n[u-1],p,0);if(v>t){r=0;var g=0,f=v-t,m=1<<f;for(o.sort((function(e,t){return p[t.s]-p[e.s]||e.f-t.f}));r<i;++r){var _=o[r].s;if(!(p[_]>t))break;g+=m-(1<<v-p[_]),p[_]=t}for(g>>>=f;g>0;){var y=o[r].s;p[y]<t?g-=1<<t-p[y]++-1:++r}for(;r>=0&&g;--r){var b=o[r].s;p[b]==t&&(--p[b],++g)}v=t}return[new Ed(p),v]},Xd=function(e,t,n){return-1==e.s?Math.max(Xd(e.l,t,n+1),Xd(e.r,t,n+1)):t[e.s]=n},Jd=function(e){for(var t=e.length;t&&!e[--t];);for(var n=new xd(++t),r=0,i=e[0],o=1,s=function(e){n[r++]=e},a=1;a<=t;++a)if(e[a]==i&&a!=t)++o;else{if(!i&&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(i),--o;o>6;o-=6)s(8304);o>2&&(s(o-3<<5|8208),o=0)}for(;o--;)s(i);o=1,i=e[a]}return[n.subarray(0,r),t]},Kd=function(e,t){for(var n=0,r=0;r<t.length;++r)n+=e[r]*t[r];return n},Qd=function(e,t,n){var r=n.length,i=Gd(t+2);e[i]=255&r,e[i+1]=r>>>8,e[i+2]=255^e[i],e[i+3]=255^e[i+1];for(var o=0;o<r;++o)e[i+o+4]=n[o];return 8*(i+4+r)},eh=function(e,t,n,r,i,o,s,a,l,c,u){jd(t,u++,n),++i[256];for(var d=Yd(i,15),h=d[0],p=d[1],v=Yd(o,15),g=v[0],f=v[1],m=Jd(h),_=m[0],y=m[1],b=Jd(g),w=b[0],S=b[1],C=new xd(19),I=0;I<_.length;++I)C[31&_[I]]++;for(I=0;I<w.length;++I)C[31&w[I]]++;for(var k=Yd(C,7),E=k[0],x=k[1],T=19;T>4&&!E[Ad[T-1]];--T);var M,R,A,N,F=c+5<<3,O=Kd(i,$d)+Kd(o,Wd)+s,P=Kd(i,h)+Kd(o,g)+s+14+3*T+Kd(C,E)+(2*C[16]+3*C[17]+7*C[18]);if(F<=O&&F<=P)return Qd(t,u,e.subarray(l,l+c));if(jd(t,u,1+(P<O)),u+=2,P<O){M=qd(h,p,0),R=h,A=qd(g,f,0),N=g;var L=qd(E,x,0);jd(t,u,y-257),jd(t,u+5,S-1),jd(t,u+10,T-4),u+=14;for(I=0;I<T;++I)jd(t,u+3*I,E[Ad[I]]);u+=3*T;for(var D=[_,w],B=0;B<2;++B){var H=D[B];for(I=0;I<H.length;++I){var q=31&H[I];jd(t,u,L[q]),u+=E[q],q>15&&(jd(t,u,H[I]>>>5&127),u+=H[I]>>>12)}}}else M=Vd,R=$d,A=Zd,N=Wd;for(I=0;I<a;++I)if(r[I]>255){q=r[I]>>>18&31;zd(t,u,M[q+257]),u+=R[q+257],q>7&&(jd(t,u,r[I]>>>23&31),u+=Md[q]);var $=31&r[I];zd(t,u,A[$]),u+=N[$],$>3&&(zd(t,u,r[I]>>>5&8191),u+=Rd[$])}else zd(t,u,M[r[I]]),u+=R[r[I]];return zd(t,u,M[256]),u+R[256]},th=new Td([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),nh=function(){for(var e=new Td(256),t=0;t<256;++t){for(var n=t,r=9;--r;)n=(1&n&&3988292384)^n>>>1;e[t]=n}return e}(),rh=function(){var e=4294967295;return{p:function(t){for(var n=e,r=0;r<t.length;++r)n=nh[255&n^t[r]]^n>>>8;e=n},d:function(){return 4294967295^e}}},ih=function(e,t,n,r,i){return function(e,t,n,r,i,o){var s=e.length,a=new Ed(r+s+5*(1+Math.floor(s/7e3))+i),l=a.subarray(r,a.length-i),c=0;if(!t||s<8)for(var u=0;u<=s;u+=65535){var d=u+65535;d<s?c=Qd(l,c,e.subarray(u,d)):(l[u]=o,c=Qd(l,c,e.subarray(u,s)))}else{for(var h=th[t-1],p=h>>>13,v=8191&h,g=(1<<n)-1,f=new xd(32768),m=new xd(g+1),_=Math.ceil(n/3),y=2*_,b=function(t){return(e[t]^e[t+1]<<_^e[t+2]<<y)&g},w=new Td(25e3),S=new xd(288),C=new xd(32),I=0,k=0,E=(u=0,0),x=0,T=0;u<s;++u){var M=b(u),R=32767&u,A=m[M];if(f[R]=A,m[M]=R,x<=u){var N=s-u;if((I>7e3||E>24576)&&N>423){c=eh(e,l,0,w,S,C,k,E,T,u-T,c),E=I=k=0,T=u;for(var F=0;F<286;++F)S[F]=0;for(F=0;F<30;++F)C[F]=0}var O=2,P=0,L=v,D=R-A&32767;if(N>2&&M==b(u-D))for(var B=Math.min(p,N)-1,H=Math.min(32767,u),q=Math.min(258,N);D<=H&&--L&&R!=A;){if(e[u+O]==e[u+O-D]){for(var $=0;$<q&&e[u+$]==e[u+$-D];++$);if($>O){if(O=$,P=D,$>B)break;var W=Math.min(D,$-2),V=0;for(F=0;F<W;++F){var Z=u-D+F+32768&32767,G=Z-f[Z]+32768&32767;G>V&&(V=G,A=Z)}}}D+=(R=A)-(A=f[R])+32768&32767}if(P){w[E++]=268435456|Pd[O]<<18|Ld[P];var U=31&Pd[O],j=31&Ld[P];k+=Md[U]+Rd[j],++S[257+U],++C[j],x=u+O,++I}else w[E++]=e[u],++S[e[u]]}}c=eh(e,l,o,w,S,C,k,E,T,u-T,c)}return Ud(a,0,r+Gd(c)+i)}(e,null==t.level?6:t.level,null==t.mem?Math.ceil(1.5*Math.max(8,Math.min(13,Math.log(e.length)))):12+t.mem,n,r,!i)},oh=function(e,t,n){for(;n;++t)e[t]=n,n>>>=8},sh=function(e,t){var n=t.filename;if(e[0]=31,e[1]=139,e[2]=8,e[8]=t.level<2?4:9==t.level?2:0,e[9]=3,0!=t.mtime&&oh(e,4,Math.floor(new Date(t.mtime||Date.now())/1e3)),n){e[3]=8;for(var r=0;r<=n.length;++r)e[r+10]=n.charCodeAt(r)}},ah=function(e){return 10+(e.filename&&e.filename.length+1||0)};function lh(e,t){void 0===t&&(t={});var n=rh(),r=e.length;n.p(e);var i=ih(e,t,ah(t),8),o=i.length;return sh(i,t),oh(i,o-8,n.d()),oh(i,o-4,r),i}function ch(e,t){var n=e.length;if("undefined"!=typeof TextEncoder)return(new TextEncoder).encode(e);for(var r=new Ed(e.length+(e.length>>>1)),i=0,o=function(e){r[i++]=e},s=0;s<n;++s){if(i+5>r.length){var a=new Ed(i+8+(n-s<<1));a.set(r),r=a}var l=e.charCodeAt(s);l<128||t?o(l):l<2048?(o(192|l>>>6),o(128|63&l)):l>55295&&l<57344?(o(240|(l=65536+(1047552&l)|1023&e.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 Ud(r,0,i)}var uh="[SessionRecording]",dh=Rr(uh),hh=3e5,ph=[Cd.MouseMove,Cd.MouseInteraction,Cd.Scroll,Cd.ViewportResize,Cd.Input,Cd.TouchMove,Cd.MediaInteraction,Cd.Drag],vh=e=>({rrwebMethod:e,enqueuedAt:Date.now(),attempt:1});function gh(e){return function(e,t){for(var n="",r=0;r<e.length;){var i=e[r++];i<128||t?n+=String.fromCharCode(i):i<224?n+=String.fromCharCode((31&i)<<6|63&e[r++]):i<240?n+=String.fromCharCode((15&i)<<12|(63&e[r++])<<6|63&e[r++]):(i=((15&i)<<18|(63&e[r++])<<12|(63&e[r++])<<6|63&e[r++])-65536,n+=String.fromCharCode(55296|i>>10,56320|1023&i))}return n}(lh(ch(JSON.stringify(e))),!0)}function fh(e){return e.type===Sd.Custom&&"sessionIdle"===e.data.tag}function mh(e,t){return t.some((t=>"regex"===t.matching&&new RegExp(t.url).test(e)))}class _h{get sessionIdleThresholdMilliseconds(){return this.instance.config.session_recording.session_idle_threshold_ms||3e5}get rrwebRecord(){var e,t;return null==er||null===(e=er.__PosthogExtensions__)||void 0===e||null===(t=e.rrweb)||void 0===t?void 0:t.record}get started(){return this._captureStarted}get sessionManager(){if(!this.instance.sessionManager)throw new Error(uh+" must be started with a valid sessionManager.");return this.instance.sessionManager}get fullSnapshotIntervalMillis(){var e,t;return"trigger_pending"===this.triggerStatus?6e4:null!==(e=null===(t=this.instance.config.session_recording)||void 0===t?void 0:t.full_snapshot_interval_millis)&&void 0!==e?e:hh}get isSampled(){var e=this.instance.get_property(gi);return Cr(e)?e:null}get sessionDuration(){var e,t,n=null===(e=this.buffer)||void 0===e?void 0:e.data[(null===(t=this.buffer)||void 0===t?void 0:t.data.length)-1],{sessionStartTimestamp:r}=this.sessionManager.checkAndGetSessionAndWindowId(!0);return n?n.timestamp-r:null}get isRecordingEnabled(){var e=!!this.instance.get_property(ai),t=!this.instance.config.disable_session_recording;return Wn&&e&&t}get isConsoleLogCaptureEnabled(){var e=!!this.instance.get_property(li),t=this.instance.config.enable_recording_console_log;return null!=t?t:e}get canvasRecording(){var e,t,n,r,i,o,s=this.instance.config.session_recording.captureCanvas,a=this.instance.get_property(ui),l=null!==(e=null!==(t=null==s?void 0:s.recordCanvas)&&void 0!==t?t:null==a?void 0:a.enabled)&&void 0!==e&&e,c=null!==(n=null!==(r=null==s?void 0:s.canvasFps)&&void 0!==r?r:null==a?void 0:a.fps)&&void 0!==n?n:0,u=null!==(i=null!==(o=null==s?void 0:s.canvasQuality)&&void 0!==o?o:null==a?void 0:a.quality)&&void 0!==i?i:0;return{enabled:l,fps:Id(c,0,12,"canvas recording fps"),quality:Id(u,0,1,"canvas recording quality")}}get networkPayloadCapture(){var e,t,n=this.instance.get_property(ci),r={recordHeaders:null===(e=this.instance.config.session_recording)||void 0===e?void 0:e.recordHeaders,recordBody:null===(t=this.instance.config.session_recording)||void 0===t?void 0:t.recordBody},i=(null==r?void 0:r.recordHeaders)||(null==n?void 0:n.recordHeaders),o=(null==r?void 0:r.recordBody)||(null==n?void 0:n.recordBody),s=gr(this.instance.config.capture_performance)?this.instance.config.capture_performance.network_timing:this.instance.config.capture_performance,a=!!(Cr(s)?s:null==n?void 0:n.capturePerformance);return i||o||a?{recordHeaders:i,recordBody:o,recordPerformance:a}:void 0}get sampleRate(){var e=this.instance.get_property(di);return Sr(e)?e:null}get minimumDuration(){var e=this.instance.get_property(hi);return Sr(e)?e:null}get status(){return this.receivedDecide?this.isRecordingEnabled?this._urlBlocked?"paused":wr(this._linkedFlag)||this._linkedFlagSeen?"trigger_pending"===this.triggerStatus?"buffering":Cr(this.isSampled)?this.isSampled?"sampled":"disabled":"active":"buffering":"disabled":"buffering"}get urlTriggerStatus(){var e;return 0===this._urlTriggers.length?"trigger_disabled":(null===(e=this.instance)||void 0===e?void 0:e.get_property(fi))===this.sessionId?"trigger_activated":"trigger_pending"}get eventTriggerStatus(){var e;return 0===this._eventTriggers.length?"trigger_disabled":(null===(e=this.instance)||void 0===e?void 0:e.get_property(mi))===this.sessionId?"trigger_activated":"trigger_pending"}get triggerStatus(){var e="trigger_activated"===this.eventTriggerStatus||"trigger_activated"===this.urlTriggerStatus,t="trigger_pending"===this.eventTriggerStatus||"trigger_pending"===this.urlTriggerStatus;return e?"trigger_activated":t?"trigger_pending":"trigger_disabled"}constructor(e){if(i(this,"queuedRRWebEvents",[]),i(this,"isIdle",!1),i(this,"_linkedFlagSeen",!1),i(this,"_lastActivityTimestamp",Date.now()),i(this,"_linkedFlag",null),i(this,"_removePageViewCaptureHook",void 0),i(this,"_onSessionIdListener",void 0),i(this,"_persistDecideOnSessionListener",void 0),i(this,"_samplingSessionListener",void 0),i(this,"_urlTriggers",[]),i(this,"_urlBlocklist",[]),i(this,"_urlBlocked",!1),i(this,"_eventTriggers",[]),i(this,"_removeEventTriggerCaptureHook",void 0),i(this,"_forceAllowLocalhostNetworkCapture",!1),i(this,"_onBeforeUnload",(()=>{this._flushBuffer()})),i(this,"_onOffline",(()=>{this._tryAddCustomEvent("browser offline",{})})),i(this,"_onOnline",(()=>{this._tryAddCustomEvent("browser online",{})})),i(this,"_onVisibilityChange",(()=>{if(null!=zn&&zn.visibilityState){var e="window "+zn.visibilityState;this._tryAddCustomEvent(e,{})}})),this.instance=e,this._captureStarted=!1,this._endpoint="/s/",this.stopRrweb=void 0,this.receivedDecide=!1,!this.instance.sessionManager)throw dh.error("started without valid sessionManager"),new Error(uh+" started without valid sessionManager. This is a bug.");if(this.instance.config.__preview_experimental_cookieless_mode)throw new Error(uh+" cannot be used with __preview_experimental_cookieless_mode.");var{sessionId:t,windowId:n}=this.sessionManager.checkAndGetSessionAndWindowId();this.sessionId=t,this.windowId=n,this.buffer=this.clearBuffer(),this.sessionIdleThresholdMilliseconds>=this.sessionManager.sessionTimeoutMs&&dh.warn("session_idle_threshold_ms (".concat(this.sessionIdleThresholdMilliseconds,") is greater than the session timeout (").concat(this.sessionManager.sessionTimeoutMs,"). Session will never be detected as idle"))}startIfEnabledOrStop(e){this.isRecordingEnabled?(this._startCapture(e),null==Wn||Wn.addEventListener("beforeunload",this._onBeforeUnload),null==Wn||Wn.addEventListener("offline",this._onOffline),null==Wn||Wn.addEventListener("online",this._onOnline),null==Wn||Wn.addEventListener("visibilitychange",this._onVisibilityChange),this._setupSampling(),this._addEventTriggerListener(),wr(this._removePageViewCaptureHook)&&(this._removePageViewCaptureHook=this.instance.on("eventCaptured",(e=>{try{if("$pageview"===e.event){var t=null!=e&&e.properties.$current_url?this._maskUrl(null==e?void 0:e.properties.$current_url):"";if(!t)return;this._tryAddCustomEvent("$pageview",{href:t})}}catch(e){dh.error("Could not add $pageview to rrweb session",e)}}))),this._onSessionIdListener||(this._onSessionIdListener=this.sessionManager.onSessionId(((e,t,n)=>{var r,i,o,s;n&&(this._tryAddCustomEvent("$session_id_change",{sessionId:e,windowId:t,changeReason:n}),null===(r=this.instance)||void 0===r||null===(i=r.persistence)||void 0===i||i.unregister(mi),null===(o=this.instance)||void 0===o||null===(s=o.persistence)||void 0===s||s.unregister(fi))})))):this.stopRecording()}stopRecording(){var e,t,n,r;this._captureStarted&&this.stopRrweb&&(this.stopRrweb(),this.stopRrweb=void 0,this._captureStarted=!1,null==Wn||Wn.removeEventListener("beforeunload",this._onBeforeUnload),null==Wn||Wn.removeEventListener("offline",this._onOffline),null==Wn||Wn.removeEventListener("online",this._onOnline),null==Wn||Wn.removeEventListener("visibilitychange",this._onVisibilityChange),this.clearBuffer(),clearInterval(this._fullSnapshotTimer),null===(e=this._removePageViewCaptureHook)||void 0===e||e.call(this),this._removePageViewCaptureHook=void 0,null===(t=this._removeEventTriggerCaptureHook)||void 0===t||t.call(this),this._removeEventTriggerCaptureHook=void 0,null===(n=this._onSessionIdListener)||void 0===n||n.call(this),this._onSessionIdListener=void 0,null===(r=this._samplingSessionListener)||void 0===r||r.call(this),this._samplingSessionListener=void 0,dh.info("stopped"))}makeSamplingDecision(e){var t,n=this.sessionId!==e,r=this.sampleRate;if(Sr(r)){var i,o=this.isSampled,s=n||!Cr(o);if(s)i=Math.random()<r;else i=o;s&&(i?this._reportStarted("sampled"):dh.warn("Sample rate (".concat(r,") has determined that this sessionId (").concat(e,") will not be sent to the server.")),this._tryAddCustomEvent("samplingDecisionMade",{sampleRate:r,isSampled:i})),null===(t=this.instance.persistence)||void 0===t||t.register({[gi]:i})}else{var a;null===(a=this.instance.persistence)||void 0===a||a.register({[gi]:null})}}onRemoteConfig(e){var t,n,r,i,o,s;(this._tryAddCustomEvent("$remote_config_received",e),this._persistRemoteConfig(e),this._linkedFlag=(null===(t=e.sessionRecording)||void 0===t?void 0:t.linkedFlag)||null,null!==(n=e.sessionRecording)&&void 0!==n&&n.endpoint)&&(this._endpoint=null===(s=e.sessionRecording)||void 0===s?void 0:s.endpoint);if(this._setupSampling(),!wr(this._linkedFlag)&&!this._linkedFlagSeen){var a=_r(this._linkedFlag)?this._linkedFlag:this._linkedFlag.flag,l=_r(this._linkedFlag)?null:this._linkedFlag.variant;this.instance.onFeatureFlags(((e,t)=>{var n=gr(t)&&a in t,r=l?t[a]===l:n;r&&this._reportStarted("linked_flag_matched",{linkedFlag:a,linkedVariant:l}),this._linkedFlagSeen=r}))}null!==(r=e.sessionRecording)&&void 0!==r&&r.urlTriggers&&(this._urlTriggers=e.sessionRecording.urlTriggers),null!==(i=e.sessionRecording)&&void 0!==i&&i.urlBlocklist&&(this._urlBlocklist=e.sessionRecording.urlBlocklist),null!==(o=e.sessionRecording)&&void 0!==o&&o.eventTriggers&&(this._eventTriggers=e.sessionRecording.eventTriggers),this.receivedDecide=!0,this.startIfEnabledOrStop()}_setupSampling(){Sr(this.sampleRate)&&wr(this._samplingSessionListener)&&(this._samplingSessionListener=this.sessionManager.onSessionId((e=>{this.makeSamplingDecision(e)})))}_persistRemoteConfig(e){if(this.instance.persistence){var n,r=this.instance.persistence,i=()=>{var n,i,o,s,a,l,c,u,d=null===(n=e.sessionRecording)||void 0===n?void 0:n.sampleRate,h=wr(d)?null:parseFloat(d),p=null===(i=e.sessionRecording)||void 0===i?void 0:i.minimumDurationMilliseconds;r.register({[ai]:!!e.sessionRecording,[li]:null===(o=e.sessionRecording)||void 0===o?void 0:o.consoleLogRecordingEnabled,[ci]:t({capturePerformance:e.capturePerformance},null===(s=e.sessionRecording)||void 0===s?void 0:s.networkPayloadCapture),[ui]:{enabled:null===(a=e.sessionRecording)||void 0===a?void 0:a.recordCanvas,fps:null===(l=e.sessionRecording)||void 0===l?void 0:l.canvasFps,quality:null===(c=e.sessionRecording)||void 0===c?void 0:c.canvasQuality},[di]:h,[hi]:mr(p)?null:p,[pi]:null===(u=e.sessionRecording)||void 0===u?void 0:u.scriptConfig})};i(),null===(n=this._persistDecideOnSessionListener)||void 0===n||n.call(this),this._persistDecideOnSessionListener=this.sessionManager.onSessionId(i)}}log(e){var t,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"log";null===(t=this.instance.sessionRecording)||void 0===t||t.onRRwebEmit({type:6,data:{plugin:"rrweb/console@1",payload:{level:n,trace:[],payload:[JSON.stringify(e)]}},timestamp:Date.now()})}_startCapture(e){if(!mr(Object.assign)&&!mr(Array.from)&&!(this._captureStarted||this.instance.config.disable_session_recording||this.instance.consent.isOptedOut())){var t,n;if(this._captureStarted=!0,this.sessionManager.checkAndGetSessionAndWindowId(),this.rrwebRecord)this._onScriptLoaded();else null===(t=er.__PosthogExtensions__)||void 0===t||null===(n=t.loadExternalDependency)||void 0===n||n.call(t,this.instance,this.scriptName,(e=>{if(e)return dh.error("could not load recorder",e);this._onScriptLoaded()}));dh.info("starting"),"active"===this.status&&this._reportStarted(e||"recording_initialized")}}get scriptName(){var e,t,n;return(null===(e=this.instance)||void 0===e||null===(t=e.persistence)||void 0===t||null===(n=t.get_property(pi))||void 0===n?void 0:n.script)||"recorder"}isInteractiveEvent(e){var t;return 3===e.type&&-1!==ph.indexOf(null===(t=e.data)||void 0===t?void 0:t.source)}_updateWindowAndSessionIds(e){var t=this.isInteractiveEvent(e);t||this.isIdle||e.timestamp-this._lastActivityTimestamp>this.sessionIdleThresholdMilliseconds&&(this.isIdle=!0,clearInterval(this._fullSnapshotTimer),this._tryAddCustomEvent("sessionIdle",{eventTimestamp:e.timestamp,lastActivityTimestamp:this._lastActivityTimestamp,threshold:this.sessionIdleThresholdMilliseconds,bufferLength:this.buffer.data.length,bufferSize:this.buffer.size}),this._flushBuffer());var n=!1;if(t&&(this._lastActivityTimestamp=e.timestamp,this.isIdle&&(this.isIdle=!1,this._tryAddCustomEvent("sessionNoLongerIdle",{reason:"user activity",type:e.type}),n=!0)),!this.isIdle){var{windowId:r,sessionId:i}=this.sessionManager.checkAndGetSessionAndWindowId(!t,e.timestamp),o=this.sessionId!==i,s=this.windowId!==r;this.windowId=r,this.sessionId=i,o||s?(this.stopRecording(),this.startIfEnabledOrStop("session_id_changed")):n&&this._scheduleFullSnapshot()}}_tryRRWebMethod(e){try{return e.rrwebMethod(),!0}catch(t){return this.queuedRRWebEvents.length<10?this.queuedRRWebEvents.push({enqueuedAt:e.enqueuedAt||Date.now(),attempt:e.attempt++,rrwebMethod:e.rrwebMethod}):dh.warn("could not emit queued rrweb event.",t,e),!1}}_tryAddCustomEvent(e,t){return this._tryRRWebMethod(vh((()=>this.rrwebRecord.addCustomEvent(e,t))))}_tryTakeFullSnapshot(){return this._tryRRWebMethod(vh((()=>this.rrwebRecord.takeFullSnapshot())))}_onScriptLoaded(){var e,n={blockClass:"ph-no-capture",blockSelector:void 0,ignoreClass:"ph-ignore-input",maskTextClass:"ph-mask",maskTextSelector:void 0,maskTextFn:void 0,maskAllInputs:!0,maskInputOptions:{password:!0},maskInputFn:void 0,slimDOMOptions:{},collectFonts:!1,inlineStylesheet:!0,recordCrossOriginIframes:!1},r=this.instance.config.session_recording;for(var[i,o]of Object.entries(r||{}))i in n&&("maskInputOptions"===i?n.maskInputOptions=t({password:!0},o):n[i]=o);if(this.canvasRecording&&this.canvasRecording.enabled&&(n.recordCanvas=!0,n.sampling={canvas:this.canvasRecording.fps},n.dataURLOptions={type:"image/webp",quality:this.canvasRecording.quality}),this.rrwebRecord){this.mutationRateLimiter=null!==(e=this.mutationRateLimiter)&&void 0!==e?e:new kd(this.rrwebRecord,{refillRate:this.instance.config.session_recording.__mutationRateLimiterRefillRate,bucketSize:this.instance.config.session_recording.__mutationRateLimiterBucketSize,onBlockedNode:(e,t)=>{var n="Too many mutations on node '".concat(e,"'. Rate limiting. This could be due to SVG animations or something similar");dh.info(n,{node:t}),this.log(uh+" "+n,"warn")}});var s=this._gatherRRWebPlugins();this.stopRrweb=this.rrwebRecord(t({emit:e=>{this.onRRwebEmit(e)},plugins:s},n)),this._lastActivityTimestamp=Date.now(),this.isIdle=!1,this._tryAddCustomEvent("$session_options",{sessionRecordingOptions:n,activePlugins:s.map((e=>null==e?void 0:e.name))}),this._tryAddCustomEvent("$posthog_config",{config:this.instance.config})}else dh.error("onScriptLoaded was called but rrwebRecord is not available. This indicates something has gone wrong.")}_scheduleFullSnapshot(){if(this._fullSnapshotTimer&&clearInterval(this._fullSnapshotTimer),!this.isIdle){var e=this.fullSnapshotIntervalMillis;e&&(this._fullSnapshotTimer=setInterval((()=>{this._tryTakeFullSnapshot()}),e))}}_gatherRRWebPlugins(){var e,t,n,r,i=[],o=null===(e=er.__PosthogExtensions__)||void 0===e||null===(t=e.rrwebPlugins)||void 0===t?void 0:t.getRecordConsolePlugin;o&&this.isConsoleLogCaptureEnabled&&i.push(o());var s=null===(n=er.__PosthogExtensions__)||void 0===n||null===(r=n.rrwebPlugins)||void 0===r?void 0:r.getRecordNetworkPlugin;this.networkPayloadCapture&&hr(s)&&(!Gr.includes(location.hostname)||this._forceAllowLocalhostNetworkCapture?i.push(s(_o(this.instance.config,this.networkPayloadCapture))):dh.info("NetworkCapture not started because we are on localhost."));return i}onRRwebEmit(e){var n;if(this._processQueuedEvents(),e&&gr(e)){if(e.type===Sd.Meta){var r=this._maskUrl(e.data.href);if(this._lastHref=r,!r)return;e.data.href=r}else this._pageViewFallBack();if(this._checkUrlTriggerConditions(),"paused"!==this.status||function(e){return e.type===Sd.Custom&&"recording paused"===e.data.tag}(e)){e.type===Sd.FullSnapshot&&this._scheduleFullSnapshot(),e.type===Sd.FullSnapshot&&"trigger_pending"===this.triggerStatus&&this.clearBuffer();var i=this.mutationRateLimiter?this.mutationRateLimiter.throttleMutations(e):e;if(i){var o=function(e){var t=e;if(t&&gr(t)&&6===t.type&&gr(t.data)&&"rrweb/console@1"===t.data.plugin){t.data.payload.payload.length>10&&(t.data.payload.payload=t.data.payload.payload.slice(0,10),t.data.payload.payload.push("...[truncated]"));for(var n=[],r=0;r<t.data.payload.payload.length;r++)t.data.payload.payload[r]&&t.data.payload.payload[r].length>2e3?n.push(t.data.payload.payload[r].slice(0,2e3)+"...[truncated]"):n.push(t.data.payload.payload[r]);return t.data.payload.payload=n,e}return e}(i);if(this._updateWindowAndSessionIds(o),!this.isIdle||fh(o)){if(fh(o)){var s=o.data.payload;if(s){var a=s.lastActivityTimestamp,l=s.threshold;o.timestamp=a+l}}var c=null===(n=this.instance.config.session_recording.compress_events)||void 0===n||n?function(e){if(bd(e)<1024)return e;try{if(e.type===Sd.FullSnapshot)return t(t({},e),{},{data:gh(e.data),cv:"2024-10"});if(e.type===Sd.IncrementalSnapshot&&e.data.source===Cd.Mutation)return t(t({},e),{},{cv:"2024-10",data:t(t({},e.data),{},{texts:gh(e.data.texts),attributes:gh(e.data.attributes),removes:gh(e.data.removes),adds:gh(e.data.adds)})});if(e.type===Sd.IncrementalSnapshot&&e.data.source===Cd.StyleSheetRule)return t(t({},e),{},{cv:"2024-10",data:t(t({},e.data),{},{adds:gh(e.data.adds),removes:gh(e.data.removes)})})}catch(e){dh.error("could not compress event - will use uncompressed event",e)}return e}(o):o,u={$snapshot_bytes:bd(c),$snapshot_data:c,$session_id:this.sessionId,$window_id:this.windowId};"disabled"!==this.status?this._captureSnapshotBuffered(u):this.clearBuffer()}}}}}_pageViewFallBack(){if(!this.instance.config.capture_pageview&&Wn){var e=this._maskUrl(Wn.location.href);this._lastHref!==e&&(this._tryAddCustomEvent("$url_changed",{href:e}),this._lastHref=e)}}_processQueuedEvents(){if(this.queuedRRWebEvents.length){var e=[...this.queuedRRWebEvents];this.queuedRRWebEvents=[],e.forEach((e=>{Date.now()-e.enqueuedAt<=2e3&&this._tryRRWebMethod(e)}))}}_maskUrl(e){var t=this.instance.config.session_recording;if(t.maskNetworkRequestFn){var n,r={url:e};return null===(n=r=t.maskNetworkRequestFn(r))||void 0===n?void 0:n.url}return e}clearBuffer(){return this.buffer={size:0,data:[],sessionId:this.sessionId,windowId:this.windowId},this.buffer}_flushBuffer(){this.flushBufferTimer&&(clearTimeout(this.flushBufferTimer),this.flushBufferTimer=void 0);var e=this.minimumDuration,t=this.sessionDuration,n=Sr(t)&&t>=0,r=Sr(e)&&n&&t<e;if("buffering"===this.status||"paused"===this.status||r)return this.flushBufferTimer=setTimeout((()=>{this._flushBuffer()}),2e3),this.buffer;this.buffer.data.length>0&&wd(this.buffer).forEach((e=>{this._captureSnapshot({$snapshot_bytes:e.size,$snapshot_data:e.data,$session_id:e.sessionId,$window_id:e.windowId,$lib:"web",$lib_version:xr.LIB_VERSION})}));return this.clearBuffer()}_captureSnapshotBuffered(e){var t,n=2+((null===(t=this.buffer)||void 0===t?void 0:t.data.length)||0);!this.isIdle&&(this.buffer.size+e.$snapshot_bytes+n>943718.4||this.buffer.sessionId!==this.sessionId)&&(this.buffer=this._flushBuffer()),this.buffer.size+=e.$snapshot_bytes,this.buffer.data.push(e.$snapshot_data),this.flushBufferTimer||this.isIdle||(this.flushBufferTimer=setTimeout((()=>{this._flushBuffer()}),2e3))}_captureSnapshot(e){this.instance.capture("$snapshot",e,{_url:this.instance.requestRouter.endpointFor("api",this._endpoint),_noTruncate:!0,_batchKey:"recordings",skip_client_rate_limiting:!0})}_checkUrlTriggerConditions(){if(void 0!==Wn&&Wn.location.href){var e=Wn.location.href,t="paused"===this.status,n=mh(e,this._urlBlocklist);n&&!t?this._pauseRecording():!n&&t&&this._resumeRecording(),mh(e,this._urlTriggers)&&this._activateTrigger("url")}}_activateTrigger(e){var t,n;"trigger_pending"===this.triggerStatus&&(null===(t=this.instance)||void 0===t||null===(n=t.persistence)||void 0===n||n.register({["url"===e?fi:mi]:this.sessionId}),this._flushBuffer(),this._reportStarted(e+"_trigger_matched"))}_pauseRecording(){"paused"!==this.status&&(this._urlBlocked=!0,clearInterval(this._fullSnapshotTimer),dh.info("recording paused due to URL blocker"),this._tryAddCustomEvent("recording paused",{reason:"url blocker"}))}_resumeRecording(){"paused"===this.status&&(this._urlBlocked=!1,this._tryTakeFullSnapshot(),this._scheduleFullSnapshot(),this._tryAddCustomEvent("recording resumed",{reason:"left blocked url"}),dh.info("recording resumed"))}_addEventTriggerListener(){0!==this._eventTriggers.length&&wr(this._removeEventTriggerCaptureHook)&&(this._removeEventTriggerCaptureHook=this.instance.on("eventCaptured",(e=>{try{this._eventTriggers.includes(e.event)&&this._activateTrigger("event")}catch(e){dh.error("Could not activate event trigger",e)}})))}overrideLinkedFlag(){this._linkedFlagSeen=!0,this._tryTakeFullSnapshot(),this._reportStarted("linked_flag_overridden")}overrideSampling(){var e;null===(e=this.instance.persistence)||void 0===e||e.register({[gi]:!0}),this._tryTakeFullSnapshot(),this._reportStarted("sampling_overridden")}overrideTrigger(e){this._activateTrigger(e)}_reportStarted(e,t){this.instance.register_for_session({$session_recording_start_reason:e}),dh.info(e.replace("_"," "),t),ir(["recording_initialized","session_id_changed"],e)||this._tryAddCustomEvent(e,t)}}var yh=Rr("[RemoteConfig]");class bh{constructor(e){this.instance=e}get remoteConfig(){var e,t;return null===(e=er._POSTHOG_REMOTE_CONFIG)||void 0===e||null===(t=e[this.instance.config.token])||void 0===t?void 0:t.config}_loadRemoteConfigJs(e){var t,n,r;null!==(t=er.__PosthogExtensions__)&&void 0!==t&&t.loadExternalDependency?null===(n=er.__PosthogExtensions__)||void 0===n||null===(r=n.loadExternalDependency)||void 0===r||r.call(n,this.instance,"remote-config",(()=>e(this.remoteConfig))):(yh.error("PostHog Extensions not found. Cannot load remote config."),e())}_loadRemoteConfigJSON(e){this.instance._send_request({method:"GET",url:this.instance.requestRouter.endpointFor("assets","/array/".concat(this.instance.config.token,"/config")),callback:t=>{e(t.json)}})}load(){try{if(this.remoteConfig)return yh.info("Using preloaded remote config",this.remoteConfig),void this.onRemoteConfig(this.remoteConfig);if(this.instance.config.advanced_disable_decide)return void yh.warn("Remote config is disabled. Falling back to local config.");this._loadRemoteConfigJs((e=>{if(!e)return yh.info("No config found after loading remote JS config. Falling back to JSON."),void this._loadRemoteConfigJSON((e=>{this.onRemoteConfig(e)}));this.onRemoteConfig(e)}))}catch(e){yh.error("Error loading remote config",e)}}onRemoteConfig(e){e?this.instance.config.__preview_remote_config?(this.instance._onRemoteConfig(e),!1!==e.hasFeatureFlags&&this.instance.featureFlags.ensureFlagsLoaded()):yh.info("__preview_remote_config is disabled. Logging config instead",e):yh.error("Failed to fetch remote config from PostHog.")}}var wh,Sh=null!=Wn&&Wn.location?Jr(Wn.location.hash,"__posthog")||Jr(location.hash,"state"):null,Ch="_postHogToolbarParams",Ih=Rr("[Toolbar]");!function(e){e[e.UNINITIALIZED=0]="UNINITIALIZED",e[e.LOADING=1]="LOADING",e[e.LOADED=2]="LOADED"}(wh||(wh={}));class kh{constructor(e){this.instance=e}setToolbarState(e){er.ph_toolbar_state=e}getToolbarState(){var e;return null!==(e=er.ph_toolbar_state)&&void 0!==e?e:wh.UNINITIALIZED}maybeLoadToolbar(){var e,t,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:void 0,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:void 0,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:void 0;if(!Wn||!zn)return!1;n=null!==(e=n)&&void 0!==e?e:Wn.location,i=null!==(t=i)&&void 0!==t?t:Wn.history;try{if(!r){try{Wn.localStorage.setItem("test","test"),Wn.localStorage.removeItem("test")}catch(e){return!1}r=null==Wn?void 0:Wn.localStorage}var o,s=Sh||Jr(n.hash,"__posthog")||Jr(n.hash,"state"),a=s?Dr((()=>JSON.parse(atob(decodeURIComponent(s)))))||Dr((()=>JSON.parse(decodeURIComponent(s)))):null;return a&&"ph_authorize"===a.action?((o=a).source="url",o&&Object.keys(o).length>0&&(a.desiredHash?n.hash=a.desiredHash:i?i.replaceState(i.state,"",n.pathname+n.search):n.hash="")):((o=JSON.parse(r.getItem(Ch)||"{}")).source="localstorage",delete o.userIntent),!(!o.token||this.instance.config.token!==o.token)&&(this.loadToolbar(o),!0)}catch(e){return!1}}_callLoadToolbar(e){var t=er.ph_load_toolbar||er.ph_load_editor;!wr(t)&&hr(t)?t(e,this.instance):Ih.warn("No toolbar load function found")}loadToolbar(e){var n=!(null==zn||!zn.getElementById(Ni));if(!Wn||n)return!1;var r="custom"===this.instance.requestRouter.region&&this.instance.config.advanced_disable_toolbar_metrics,i=t(t({token:this.instance.config.token},e),{},{apiURL:this.instance.requestRouter.endpointFor("ui")},r?{instrument:!1}:{});if(Wn.localStorage.setItem(Ch,JSON.stringify(t(t({},i),{},{source:void 0}))),this.getToolbarState()===wh.LOADED)this._callLoadToolbar(i);else if(this.getToolbarState()===wh.UNINITIALIZED){var o,s;this.setToolbarState(wh.LOADING),null===(o=er.__PosthogExtensions__)||void 0===o||null===(s=o.loadExternalDependency)||void 0===s||s.call(o,this.instance,"toolbar",(e=>{if(e)return Ih.error("[Toolbar] Failed to load",e),void this.setToolbarState(wh.UNINITIALIZED);this.setToolbarState(wh.LOADED),this._callLoadToolbar(i)})),$r(Wn,"turbolinks:load",(()=>{this.setToolbarState(wh.UNINITIALIZED),this.loadToolbar(i)}))}return!0}_loadEditor(e){return this.loadToolbar(e)}maybeLoadEditor(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:void 0,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:void 0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:void 0;return this.maybeLoadToolbar(e,t,n)}}class Eh{constructor(e){i(this,"isPaused",!0),i(this,"queue",[]),i(this,"flushTimeoutMs",3e3),this.sendRequest=e}enqueue(e){this.queue.push(e),this.flushTimeout||this.setFlushTimeout()}unload(){this.clearFlushTimeout();var e=this.queue.length>0?this.formatQueue():{},n=Object.values(e),r=[...n.filter((e=>0===e.url.indexOf("/e"))),...n.filter((e=>0!==e.url.indexOf("/e")))];r.map((e=>{this.sendRequest(t(t({},e),{},{transport:"sendBeacon"}))}))}enable(){this.isPaused=!1,this.setFlushTimeout()}setFlushTimeout(){var e=this;this.isPaused||(this.flushTimeout=setTimeout((()=>{if(this.clearFlushTimeout(),this.queue.length>0){var t=this.formatQueue(),n=function(n){var r=t[n],i=(new Date).getTime();r.data&&dr(r.data)&&Fr(r.data,(e=>{e.offset=Math.abs(e.timestamp-i),delete e.timestamp})),e.sendRequest(r)};for(var r in t)n(r)}}),this.flushTimeoutMs))}clearFlushTimeout(){clearTimeout(this.flushTimeout),this.flushTimeout=void 0}formatQueue(){var e={};return Fr(this.queue,(n=>{var r,i=n,o=(i?i.batchKey:null)||i.url;mr(e[o])&&(e[o]=t(t({},i),{},{data:[]})),null===(r=e[o].data)||void 0===r||r.push(i.data)})),this.queue=[],e}}var xh=function(e){var t,n,r,i,o="";for(t=n=0,r=(e=(e+"").replace(/\r\n/g,"\n").replace(/\r/g,"\n")).length,i=0;i<r;i++){var s=e.charCodeAt(i),a=null;s<128?n++: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),br(a)||(n>t&&(o+=e.substring(t,n)),o+=a,t=n=i+1)}return n>t&&(o+=e.substring(t,e.length)),o},Th=!!Jn||!!Xn,Mh="text/plain",Rh=(e,n)=>{var[r,i]=e.split("?"),o=t({},n);null==i||i.split("&").forEach((e=>{var[t]=e.split("=");delete o[t]}));var s=zr(o);return s=s?(i?i+"&":"")+s:i,"".concat(r,"?").concat(s)},Ah=(e,t)=>JSON.stringify(e,((e,t)=>"bigint"==typeof t?t.toString():t),t),Nh=e=>{var{data:t,compression:n}=e;if(t){if(n===qn.GZipJS){var r=lh(ch(Ah(t)),{mtime:0}),i=new Blob([r],{type:Mh});return{contentType:Mh,body:i,estimatedSize:i.size}}if(n===qn.Base64){var o=function(e){var t,n,r,i,o,s="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",a=0,l=0,c="",u=[];if(!e)return e;e=xh(e);do{t=(o=e.charCodeAt(a++)<<16|e.charCodeAt(a++)<<8|e.charCodeAt(a++))>>18&63,n=o>>12&63,r=o>>6&63,i=63&o,u[l++]=s.charAt(t)+s.charAt(n)+s.charAt(r)+s.charAt(i)}while(a<e.length);switch(c=u.join(""),e.length%3){case 1:c=c.slice(0,-2)+"==";break;case 2:c=c.slice(0,-1)+"="}return c}(Ah(t)),s=(e=>"data="+encodeURIComponent("string"==typeof e?e:Ah(e)))(o);return{contentType:"application/x-www-form-urlencoded",body:s,estimatedSize:new Blob([s]).size}}var a=Ah(t);return{contentType:"application/json",body:a,estimatedSize:new Blob([a]).size}}},Fh=[];Xn&&Fh.push({transport:"fetch",method:e=>{var n,r,{contentType:i,body:o,estimatedSize:s}=null!==(n=Nh(e))&&void 0!==n?n:{},a=new Headers;Fr(e.headers,(function(e,t){a.append(t,e)})),i&&a.append("Content-Type",i);var l=e.url,c=null;if(Kn){var u=new Kn;c={signal:u.signal,timeout:setTimeout((()=>u.abort()),e.timeout)}}Xn(l,t({method:(null==e?void 0:e.method)||"GET",headers:a,keepalive:"POST"===e.method&&(s||0)<52428.8,body:o,signal:null===(r=c)||void 0===r?void 0:r.signal},e.fetchOptions)).then((t=>t.text().then((n=>{var r,i={statusCode:t.status,text:n};if(200===t.status)try{i.json=JSON.parse(n)}catch(e){Mr.error(e)}null===(r=e.callback)||void 0===r||r.call(e,i)})))).catch((t=>{var n;Mr.error(t),null===(n=e.callback)||void 0===n||n.call(e,{statusCode:0,text:t})})).finally((()=>c?clearTimeout(c.timeout):null))}}),Jn&&Fh.push({transport:"XHR",method:e=>{var t,n=new Jn;n.open(e.method||"GET",e.url,!0);var{contentType:r,body:i}=null!==(t=Nh(e))&&void 0!==t?t:{};Fr(e.headers,(function(e,t){n.setRequestHeader(t,e)})),r&&n.setRequestHeader("Content-Type",r),e.timeout&&(n.timeout=e.timeout),n.withCredentials=!0,n.onreadystatechange=()=>{if(4===n.readyState){var t,r={statusCode:n.status,text:n.responseText};if(200===n.status)try{r.json=JSON.parse(n.responseText)}catch(e){}null===(t=e.callback)||void 0===t||t.call(e,r)}},n.send(i)}}),null!=jn&&jn.sendBeacon&&Fh.push({transport:"sendBeacon",method:e=>{var t=Rh(e.url,{beacon:"1"});try{var n,{contentType:r,body:i}=null!==(n=Nh(e))&&void 0!==n?n:{},o="string"==typeof i?new Blob([i],{type:r}):i;jn.sendBeacon(t,o)}catch(e){}}});var Oh=["retriesPerformedSoFar"];class Ph{constructor(e){i(this,"isPolling",!1),i(this,"pollIntervalMs",3e3),i(this,"queue",[]),this.instance=e,this.queue=[],this.areWeOnline=!0,!mr(Wn)&&"onLine"in Wn.navigator&&(this.areWeOnline=Wn.navigator.onLine,Wn.addEventListener("online",(()=>{this.areWeOnline=!0,this.flush()})),Wn.addEventListener("offline",(()=>{this.areWeOnline=!1})))}retriableRequest(e){var{retriesPerformedSoFar:n}=e,r=o(e,Oh);Sr(n)&&n>0&&(r.url=Rh(r.url,{retry_count:n})),this.instance._send_request(t(t({},r),{},{callback:e=>{var i;200!==e.statusCode&&(e.statusCode<400||e.statusCode>=500)&&(null!=n?n:0)<10?this.enqueue(t({retriesPerformedSoFar:n},r)):null===(i=r.callback)||void 0===i||i.call(r,e)}}))}enqueue(e){var t=e.retriesPerformedSoFar||0;e.retriesPerformedSoFar=t+1;var n=function(e){var t=3e3*Math.pow(2,e),n=t/2,r=Math.min(18e5,t),i=(Math.random()-.5)*(r-n);return Math.ceil(r+i)}(t),r=Date.now()+n;this.queue.push({retryAt:r,requestOptions:e});var i="Enqueued failed request for retry in ".concat(n);navigator.onLine||(i+=" (Browser is offline)"),Mr.warn(i),this.isPolling||(this.isPolling=!0,this.poll())}poll(){this.poller&&clearTimeout(this.poller),this.poller=setTimeout((()=>{this.areWeOnline&&this.queue.length>0&&this.flush(),this.poll()}),this.pollIntervalMs)}flush(){var e=Date.now(),t=[],n=this.queue.filter((n=>n.retryAt<e||(t.push(n),!1)));if(this.queue=t,n.length>0)for(var{requestOptions:r}of n)this.retriableRequest(r)}unload(){for(var{requestOptions:e}of(this.poller&&(clearTimeout(this.poller),this.poller=void 0),this.queue))try{this.instance._send_request(t(t({},e),{},{transport:"sendBeacon"}))}catch(e){Mr.error(e)}this.queue=[]}}var Lh,Dh=Rr("[SessionId]");class Bh{constructor(e,t,n){var r;if(i(this,"_sessionIdChangedHandlers",[]),!e.persistence)throw new Error("SessionIdManager requires a PostHogPersistence instance");if(e.config.__preview_experimental_cookieless_mode)throw new Error("SessionIdManager cannot be used with __preview_experimental_cookieless_mode");this.config=e.config,this.persistence=e.persistence,this._windowId=void 0,this._sessionId=void 0,this._sessionStartTimestamp=null,this._sessionActivityTimestamp=null,this._sessionIdGenerator=t||ru,this._windowIdGenerator=n||ru;var o=this.config.persistence_name||this.config.token,s=this.config.session_idle_timeout_seconds||1800;if(this._sessionTimeoutMs=1e3*Id(s,60,36e3,"session_idle_timeout_seconds",1800),e.register({$configured_session_timeout_ms:this._sessionTimeoutMs}),this.resetIdleTimer(),this._window_id_storage_key="ph_"+o+"_window_id",this._primary_window_exists_storage_key="ph_"+o+"_primary_window_exists",this._canUseSessionStorage()){var a=mu.parse(this._window_id_storage_key),l=mu.parse(this._primary_window_exists_storage_key);a&&!l?this._windowId=a:mu.remove(this._window_id_storage_key),mu.set(this._primary_window_exists_storage_key,!0)}if(null!==(r=this.config.bootstrap)&&void 0!==r&&r.sessionID)try{var c=(e=>{var t=e.replace(/-/g,"");if(32!==t.length)throw new Error("Not a valid UUID");if("7"!==t[12])throw new Error("Not a UUIDv7");return parseInt(t.substring(0,12),16)})(this.config.bootstrap.sessionID);this._setSessionId(this.config.bootstrap.sessionID,(new Date).getTime(),c)}catch(e){Dh.error("Invalid sessionID in bootstrap",e)}this._listenToReloadWindow()}get sessionTimeoutMs(){return this._sessionTimeoutMs}onSessionId(e){return mr(this._sessionIdChangedHandlers)&&(this._sessionIdChangedHandlers=[]),this._sessionIdChangedHandlers.push(e),this._sessionId&&e(this._sessionId,this._windowId),()=>{this._sessionIdChangedHandlers=this._sessionIdChangedHandlers.filter((t=>t!==e))}}_canUseSessionStorage(){return"memory"!==this.config.persistence&&!this.persistence.disabled&&mu.is_supported()}_setWindowId(e){e!==this._windowId&&(this._windowId=e,this._canUseSessionStorage()&&mu.set(this._window_id_storage_key,e))}_getWindowId(){return this._windowId?this._windowId:this._canUseSessionStorage()?mu.parse(this._window_id_storage_key):null}_setSessionId(e,t,n){e===this._sessionId&&t===this._sessionActivityTimestamp&&n===this._sessionStartTimestamp||(this._sessionStartTimestamp=n,this._sessionActivityTimestamp=t,this._sessionId=e,this.persistence.register({[vi]:[t,e,n]}))}_getSessionId(){if(this._sessionId&&this._sessionActivityTimestamp&&this._sessionStartTimestamp)return[this._sessionActivityTimestamp,this._sessionId,this._sessionStartTimestamp];var e=this.persistence.props[vi];return dr(e)&&2===e.length&&e.push(e[0]),e||[0,null,0]}resetSessionId(){this._setSessionId(null,null,null)}_listenToReloadWindow(){null==Wn||Wn.addEventListener("beforeunload",(()=>{this._canUseSessionStorage()&&mu.remove(this._primary_window_exists_storage_key)}))}checkAndGetSessionAndWindowId(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;if(this.config.__preview_experimental_cookieless_mode)throw new Error("checkAndGetSessionAndWindowId should not be called in __preview_experimental_cookieless_mode");var n=t||(new Date).getTime(),[r,i,o]=this._getSessionId(),s=this._getWindowId(),a=Sr(o)&&o>0&&Math.abs(n-o)>864e5,l=!1,c=!i,u=!e&&Math.abs(n-r)>this.sessionTimeoutMs;c||u||a?(i=this._sessionIdGenerator(),s=this._windowIdGenerator(),Dh.info("new session ID generated",{sessionId:i,windowId:s,changeReason:{noSessionId:c,activityTimeout:u,sessionPastMaximumLength:a}}),o=n,l=!0):s||(s=this._windowIdGenerator(),l=!0);var d=0===r||!e||a?n:r,h=0===o?(new Date).getTime():o;return this._setWindowId(s),this._setSessionId(i,d,h),e||this.resetIdleTimer(),l&&this._sessionIdChangedHandlers.forEach((e=>e(i,s,l?{noSessionId:c,activityTimeout:u,sessionPastMaximumLength:a}:void 0))),{sessionId:i,windowId:s,sessionStartTimestamp:h,changeReason:l?{noSessionId:c,activityTimeout:u,sessionPastMaximumLength:a}:void 0,lastActivityTimestamp:r}}resetIdleTimer(){clearTimeout(this._enforceIdleTimeout),this._enforceIdleTimeout=setTimeout((()=>{this.resetSessionId()}),1.1*this.sessionTimeoutMs)}}!function(e){e.US="us",e.EU="eu",e.CUSTOM="custom"}(Lh||(Lh={}));var Hh="i.posthog.com";class qh{constructor(e){i(this,"_regionCache",{}),this.instance=e}get apiHost(){var e=this.instance.config.api_host.trim().replace(/\/$/,"");return"https://app.posthog.com"===e?"https://us.i.posthog.com":e}get uiHost(){var e,t=null===(e=this.instance.config.ui_host)||void 0===e?void 0:e.replace(/\/$/,"");return t||(t=this.apiHost.replace(".".concat(Hh),".posthog.com")),"https://app.posthog.com"===t?"https://us.posthog.com":t}get region(){return this._regionCache[this.apiHost]||(/https:\/\/(app|us|us-assets)(\.i)?\.posthog\.com/i.test(this.apiHost)?this._regionCache[this.apiHost]=Lh.US:/https:\/\/(eu|eu-assets)(\.i)?\.posthog\.com/i.test(this.apiHost)?this._regionCache[this.apiHost]=Lh.EU:this._regionCache[this.apiHost]=Lh.CUSTOM),this._regionCache[this.apiHost]}endpointFor(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";if(t&&(t="/"===t[0]?t:"/".concat(t)),"ui"===e)return this.uiHost+t;if(this.region===Lh.CUSTOM)return this.apiHost+t;var n=Hh+t;switch(e){case"assets":return"https://".concat(this.region,"-assets.").concat(n);case"api":return"https://".concat(this.region,".").concat(n)}}}var $h="posthog-js";function Wh(e){var{organization:t,projectId:n,prefix:r,severityAllowList:i=["error"]}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return o=>{var s,a,l,c,u;if(!("*"===i||i.includes(o.level))||!e.__loaded)return o;o.tags||(o.tags={});var d=e.requestRouter.endpointFor("ui","/project/".concat(e.config.token,"/person/").concat(e.get_distinct_id()));o.tags["PostHog Person URL"]=d,e.sessionRecordingStarted()&&(o.tags["PostHog Recording URL"]=e.get_session_replay_url({withTimestamp:!0}));var h=(null===(s=o.exception)||void 0===s?void 0:s.values)||[];h.forEach((e=>{e.stacktrace&&(e.stacktrace.type="raw",e.stacktrace.frames.forEach((e=>{e.platform="web:javascript"})))}));var p={$exception_message:(null===(a=h[0])||void 0===a?void 0:a.value)||o.message,$exception_type:null===(l=h[0])||void 0===l?void 0:l.type,$exception_personURL:d,$exception_level:o.level,$exception_list:h,$sentry_event_id:o.event_id,$sentry_exception:o.exception,$sentry_exception_message:(null===(c=h[0])||void 0===c?void 0:c.value)||o.message,$sentry_exception_type:null===(u=h[0])||void 0===u?void 0:u.type,$sentry_tags:o.tags};return t&&n&&(p.$sentry_url=(r||"https://sentry.io/organizations/")+t+"/issues/?project="+n+"&query="+o.event_id),e.exceptions.sendExceptionEvent(p),o}}class Vh{constructor(e,t,n,r,i){this.name=$h,this.setupOnce=function(o){o(Wh(e,{organization:t,projectId:n,prefix:r,severityAllowList:i}))}}}var Zh=Rr("[SegmentIntegration]");function Gh(e,t){var n=e.config.segment;if(!n)return t();!function(e,t){var n=e.config.segment;if(!n)return t();var r=n=>{var r=()=>n.anonymousId()||ru();e.config.get_device_id=r,n.id()&&(e.register({distinct_id:n.id(),$device_id:r()}),e.persistence.set_property(ki,"identified")),t()},i=n.user();"then"in i&&hr(i.then)?i.then((e=>r(e))):r(i)}(e,(()=>{n.register((e=>{Promise&&Promise.resolve||Zh.warn("This browser does not have Promise support, and can not use the segment integration");var t=(t,n)=>{var r;if(!n)return t;t.event.userId||t.event.anonymousId===e.get_distinct_id()||(Zh.info("No userId set, resetting PostHog"),e.reset()),t.event.userId&&t.event.userId!==e.get_distinct_id()&&(Zh.info("UserId set, identifying with PostHog"),e.identify(t.event.userId));var i=e._calculate_event_properties(n,null!==(r=t.event.properties)&&void 0!==r?r:{},new Date);return t.event.properties=Object.assign({},i,t.event.properties),t};return{name:"PostHog JS",type:"enrichment",version:"1.0.0",isLoaded:()=>!0,load:()=>Promise.resolve(),track:e=>t(e,e.event.event),page:e=>t(e,"$pageview"),identify:e=>t(e,"$identify"),screen:e=>t(e,"$screen")}})(e)).then((()=>{t()}))}))}class Uh{constructor(e){this._instance=e}doPageView(e,t){var n,r=this._previousPageViewProperties(e,t);return this._currentPageview={pathname:null!==(n=null==Wn?void 0:Wn.location.pathname)&&void 0!==n?n:"",pageViewId:t,timestamp:e},this._instance.scrollManager.resetContext(),r}doPageLeave(e){var t;return this._previousPageViewProperties(e,null===(t=this._currentPageview)||void 0===t?void 0:t.pageViewId)}doEvent(){var e;return{$pageview_id:null===(e=this._currentPageview)||void 0===e?void 0:e.pageViewId}}_previousPageViewProperties(e,t){var n=this._currentPageview;if(!n)return{$pageview_id:t};var r={$pageview_id:t,$prev_pageview_id:n.pageViewId},i=this._instance.scrollManager.getContext();if(i&&!this._instance.config.disable_scroll_properties){var{maxScrollHeight:o,lastScrollY:s,maxScrollY:a,maxContentHeight:l,lastContentY:c,maxContentY:u}=i;if(!(mr(o)||mr(s)||mr(a)||mr(l)||mr(c)||mr(u))){o=Math.ceil(o),s=Math.ceil(s),a=Math.ceil(a),l=Math.ceil(l),c=Math.ceil(c),u=Math.ceil(u);var d=o<=1?1:Id(s/o,0,1),h=o<=1?1:Id(a/o,0,1),p=l<=1?1:Id(c/l,0,1),v=l<=1?1:Id(u/l,0,1);r=Or(r,{$prev_pageview_last_scroll:s,$prev_pageview_last_scroll_percentage:d,$prev_pageview_max_scroll:a,$prev_pageview_max_scroll_percentage:h,$prev_pageview_last_content:c,$prev_pageview_last_content_percentage:p,$prev_pageview_max_content:u,$prev_pageview_max_content_percentage:v})}}return n.pathname&&(r.$prev_pageview_pathname=n.pathname),n.timestamp&&(r.$prev_pageview_duration=(e.getTime()-n.timestamp.getTime())/1e3),r}}var jh=Rr("[RateLimiter]");class zh{constructor(e){var t,n;i(this,"serverLimits",{}),i(this,"lastEventRateLimited",!1),i(this,"checkForLimiting",(e=>{var t=e.text;if(t&&t.length)try{(JSON.parse(t).quota_limited||[]).forEach((e=>{jh.info("".concat(e||"events"," is quota limited.")),this.serverLimits[e]=(new Date).getTime()+6e4}))}catch(e){return void jh.warn('could not rate limit - continuing. Error: "'.concat(null==e?void 0:e.message,'"'),{text:t})}})),this.instance=e,this.captureEventsPerSecond=(null===(t=e.config.rate_limiting)||void 0===t?void 0:t.events_per_second)||10,this.captureEventsBurstLimit=Math.max((null===(n=e.config.rate_limiting)||void 0===n?void 0:n.events_burst_limit)||10*this.captureEventsPerSecond,this.captureEventsPerSecond),this.lastEventRateLimited=this.clientRateLimitContext(!0).isRateLimited}clientRateLimitContext(){var e,t,n,r=arguments.length>0&&void 0!==arguments[0]&&arguments[0],i=(new Date).getTime(),o=null!==(e=null===(t=this.instance.persistence)||void 0===t?void 0:t.get_property(xi))&&void 0!==e?e:{tokens:this.captureEventsBurstLimit,last:i};o.tokens+=(i-o.last)/1e3*this.captureEventsPerSecond,o.last=i,o.tokens>this.captureEventsBurstLimit&&(o.tokens=this.captureEventsBurstLimit);var s=o.tokens<1;return s||r||(o.tokens=Math.max(0,o.tokens-1)),!s||this.lastEventRateLimited||r||this.instance.capture("$$client_ingestion_warning",{$$client_ingestion_warning_message:"posthog-js client rate limited. Config is set to ".concat(this.captureEventsPerSecond," events per second and ").concat(this.captureEventsBurstLimit," events burst limit.")},{skip_client_rate_limiting:!0}),this.lastEventRateLimited=s,null===(n=this.instance.persistence)||void 0===n||n.set_property(xi,o),{isRateLimited:s,remainingTokens:o.tokens}}isServerRateLimited(e){var t=this.serverLimits[e||"events"]||!1;return!1!==t&&(new Date).getTime()<t}}var Yh=e=>{var n=null==e?void 0:e.config;return t({initialPathName:(null==Yn?void 0:Yn.pathname)||"",referringDomain:md.referringDomain()},md.campaignParams({customTrackedParams:null==n?void 0:n.custom_campaign_params,maskPersonalDataProperties:null==n?void 0:n.mask_personal_data_properties,customPersonalDataProperties:null==n?void 0:n.custom_personal_data_properties}))};class Xh{constructor(e,t,n,r){i(this,"_onSessionIdCallback",(e=>{var t=this._getStoredProps();if(!t||t.sessionId!==e){var n={sessionId:e,props:this._sessionSourceParamGenerator(this.instance)};this._persistence.register({[Ei]:n})}})),this.instance=e,this._sessionIdManager=t,this._persistence=n,this._sessionSourceParamGenerator=r||Yh,this._sessionIdManager.onSessionId(this._onSessionIdCallback)}_getStoredProps(){return this._persistence.props[Ei]}getSessionProps(){var e,t=null===(e=this._getStoredProps())||void 0===e?void 0:e.props;return t?{$client_session_initial_referring_host:t.referringDomain,$client_session_initial_pathname:t.initialPathName,$client_session_initial_utm_source:t.utm_source,$client_session_initial_utm_campaign:t.utm_campaign,$client_session_initial_utm_medium:t.utm_medium,$client_session_initial_utm_content:t.utm_content,$client_session_initial_utm_term:t.utm_term}:{}}}var Jh=["ahrefsbot","ahrefssiteaudit","applebot","baiduspider","better uptime bot","bingbot","bingpreview","bot.htm","bot.php","crawler","deepscan","duckduckbot","facebookexternal","facebookcatalog","http://yandex.com/bots","hubspot","ia_archiver","linkedinbot","mj12bot","msnbot","nessus","petalbot","pinterest","prerender","rogerbot","screaming frog","semrushbot","sitebulb","slurp","turnitin","twitterbot","vercelbot","yahoo! slurp","yandexbot","gptbot","oai-searchbot","chatgpt-user","headlesschrome","cypress","Google-HotelAdsVerifier","adsbot-google","apis-google","duplexweb-google","feedfetcher-google","google favicon","google web preview","google-read-aloud","googlebot","googleweblight","mediapartners-google","storebot-google","Bytespider;"],Kh=function(e,t){if(!e)return!1;var n=e.toLowerCase();return Jh.concat(t||[]).some((e=>{var t=e.toLowerCase();return-1!==n.indexOf(t)}))},Qh=function(e,t){if(!e)return!1;var n=e.userAgent;if(n&&Kh(n,t))return!0;try{var r=null==e?void 0:e.userAgentData;if(null!=r&&r.brands&&r.brands.some((e=>Kh(null==e?void 0:e.brand,t))))return!0}catch(e){}return!!e.webdriver},ep=Rr("[Dead Clicks]"),tp=()=>!0,np=e=>{var t,n=!(null===(t=e.instance.persistence)||void 0===t||!t.get_property(oi)),r=e.instance.config.capture_dead_clicks;return Cr(r)?r:n};class rp{get lazyLoadedDeadClicksAutocapture(){return this._lazyLoadedDeadClicksAutocapture}constructor(e,t,n){this.instance=e,this.isEnabled=t,this.onCapture=n,this.startIfEnabled()}onRemoteConfig(e){this.instance.persistence&&this.instance.persistence.register({[oi]:null==e?void 0:e.captureDeadClicks}),this.startIfEnabled()}startIfEnabled(){this.isEnabled(this)&&this.loadScript((()=>{this.start()}))}loadScript(e){var t,n,r;null!==(t=er.__PosthogExtensions__)&&void 0!==t&&t.initDeadClicksAutocapture&&e(),null===(n=er.__PosthogExtensions__)||void 0===n||null===(r=n.loadExternalDependency)||void 0===r||r.call(n,this.instance,"dead-clicks-autocapture",(t=>{t?ep.error("failed to load script",t):e()}))}start(){var e;if(zn){if(!this._lazyLoadedDeadClicksAutocapture&&null!==(e=er.__PosthogExtensions__)&&void 0!==e&&e.initDeadClicksAutocapture){var t=gr(this.instance.config.capture_dead_clicks)?this.instance.config.capture_dead_clicks:{};t.__onCapture=this.onCapture,this._lazyLoadedDeadClicksAutocapture=er.__PosthogExtensions__.initDeadClicksAutocapture(this.instance,t),this._lazyLoadedDeadClicksAutocapture.start(zn),ep.info("starting...")}}else ep.error("`document` not found. Cannot start.")}stop(){this._lazyLoadedDeadClicksAutocapture&&(this._lazyLoadedDeadClicksAutocapture.stop(),this._lazyLoadedDeadClicksAutocapture=void 0,ep.info("stopping..."))}}var ip=Rr("[Heatmaps]");function op(e){return gr(e)&&"clientX"in e&&"clientY"in e&&Sr(e.clientX)&&Sr(e.clientY)}class sp{constructor(e){var t;i(this,"rageclicks",new Oc),i(this,"_enabledServerSide",!1),i(this,"_initialized",!1),i(this,"_flushInterval",null),this.instance=e,this._enabledServerSide=!(null===(t=this.instance.persistence)||void 0===t||!t.props[ni]),null==Wn||Wn.addEventListener("beforeunload",(()=>{this.flush()}))}get flushIntervalMilliseconds(){var e=5e3;return gr(this.instance.config.capture_heatmaps)&&this.instance.config.capture_heatmaps.flush_interval_milliseconds&&(e=this.instance.config.capture_heatmaps.flush_interval_milliseconds),e}get isEnabled(){return mr(this.instance.config.capture_heatmaps)?mr(this.instance.config.enable_heatmaps)?this._enabledServerSide:this.instance.config.enable_heatmaps:!1!==this.instance.config.capture_heatmaps}startIfEnabled(){if(this.isEnabled){if(this._initialized)return;ip.info("starting..."),this._setupListeners(),this._flushInterval=setInterval(this.flush.bind(this),this.flushIntervalMilliseconds)}else{var e,t;clearInterval(null!==(e=this._flushInterval)&&void 0!==e?e:void 0),null===(t=this.deadClicksCapture)||void 0===t||t.stop(),this.getAndClearBuffer()}}onRemoteConfig(e){var t=!!e.heatmaps;this.instance.persistence&&this.instance.persistence.register({[ni]:t}),this._enabledServerSide=t,this.startIfEnabled()}getAndClearBuffer(){var e=this.buffer;return this.buffer=void 0,e}_onDeadClick(e){this._onClick(e.originalEvent,"deadclick")}_setupListeners(){Wn&&zn&&($r(zn,"click",(e=>this._onClick(e||(null==Wn?void 0:Wn.event))),!1,!0),$r(zn,"mousemove",(e=>this._onMouseMove(e||(null==Wn?void 0:Wn.event))),!1,!0),this.deadClicksCapture=new rp(this.instance,tp,this._onDeadClick.bind(this)),this.deadClicksCapture.startIfEnabled(),this._initialized=!0)}_getProperties(e,t){var n=this.instance.scrollManager.scrollY(),r=this.instance.scrollManager.scrollX(),i=this.instance.scrollManager.scrollElement(),o=function(e,t,n){for(var r=e;r&&Li(r)&&!Di(r,"body");){if(r===n)return!1;if(ir(t,null==Wn?void 0:Wn.getComputedStyle(r).position))return!0;r=ji(r)}return!1}(Gi(e),["fixed","sticky"],i);return{x:e.clientX+(o?0:r),y:e.clientY+(o?0:n),target_fixed:o,type:t}}_onClick(e){var n,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"click";if(!Pi(e.target)&&op(e)){var i=this._getProperties(e,r);null!==(n=this.rageclicks)&&void 0!==n&&n.isRageClick(e.clientX,e.clientY,(new Date).getTime())&&this._capture(t(t({},i),{},{type:"rageclick"})),this._capture(i)}}_onMouseMove(e){!Pi(e.target)&&op(e)&&(clearTimeout(this._mouseMoveTimeout),this._mouseMoveTimeout=setTimeout((()=>{this._capture(this._getProperties(e,"mousemove"))}),500))}_capture(e){if(Wn){var t=Wn.location.href;this.buffer=this.buffer||{},this.buffer[t]||(this.buffer[t]=[]),this.buffer[t].push(e)}}flush(){this.buffer&&!fr(this.buffer)&&this.instance.capture("$$heatmap",{$heatmap_data:this.getAndClearBuffer()})}}class ap{constructor(e){i(this,"_updateScrollData",(()=>{var e,t,n,r;this.context||(this.context={});var i=this.scrollElement(),o=this.scrollY(),s=i?Math.max(0,i.scrollHeight-i.clientHeight):0,a=o+((null==i?void 0:i.clientHeight)||0),l=(null==i?void 0:i.scrollHeight)||0;this.context.lastScrollY=Math.ceil(o),this.context.maxScrollY=Math.max(o,null!==(e=this.context.maxScrollY)&&void 0!==e?e:0),this.context.maxScrollHeight=Math.max(s,null!==(t=this.context.maxScrollHeight)&&void 0!==t?t:0),this.context.lastContentY=a,this.context.maxContentY=Math.max(a,null!==(n=this.context.maxContentY)&&void 0!==n?n:0),this.context.maxContentHeight=Math.max(l,null!==(r=this.context.maxContentHeight)&&void 0!==r?r:0)})),this.instance=e}getContext(){return this.context}resetContext(){var e=this.context;return setTimeout(this._updateScrollData,0),e}startMeasuringScrollPosition(){null==Wn||Wn.addEventListener("scroll",this._updateScrollData,{capture:!0,passive:!0}),null==Wn||Wn.addEventListener("scrollend",this._updateScrollData,{capture:!0,passive:!0}),null==Wn||Wn.addEventListener("resize",this._updateScrollData,{passive:!0})}scrollElement(){if(!this.instance.config.scroll_root_selector)return null==Wn?void 0:Wn.document.documentElement;var e=dr(this.instance.config.scroll_root_selector)?this.instance.config.scroll_root_selector:[this.instance.config.scroll_root_selector];for(var t of e){var n=null==Wn?void 0:Wn.document.querySelector(t);if(n)return n}}scrollY(){if(this.instance.config.scroll_root_selector){var e=this.scrollElement();return e&&e.scrollTop||0}return Wn&&(Wn.scrollY||Wn.pageYOffset||Wn.document.documentElement.scrollTop)||0}scrollX(){if(this.instance.config.scroll_root_selector){var e=this.scrollElement();return e&&e.scrollLeft||0}return Wn&&(Wn.scrollX||Wn.pageXOffset||Wn.document.documentElement.scrollLeft)||0}}var lp=Rr("[TracingHeaders]");class cp{constructor(e){i(this,"_restoreXHRPatch",void 0),i(this,"_restoreFetchPatch",void 0),i(this,"_startCapturing",(()=>{var e,t,n,r;mr(this._restoreXHRPatch)&&(null===(e=er.__PosthogExtensions__)||void 0===e||null===(t=e.tracingHeadersPatchFns)||void 0===t||t._patchXHR(this.instance.sessionManager));mr(this._restoreFetchPatch)&&(null===(n=er.__PosthogExtensions__)||void 0===n||null===(r=n.tracingHeadersPatchFns)||void 0===r||r._patchFetch(this.instance.sessionManager))})),this.instance=e}_loadScript(e){var t,n,r;null!==(t=er.__PosthogExtensions__)&&void 0!==t&&t.tracingHeadersPatchFns&&e(),null===(n=er.__PosthogExtensions__)||void 0===n||null===(r=n.loadExternalDependency)||void 0===r||r.call(n,this.instance,"tracing-headers",(t=>{if(t)return lp.error("failed to load script",t);e()}))}startIfEnabledOrStop(){var e,t;this.instance.config.__add_tracing_headers?this._loadScript(this._startCapturing):(null===(e=this._restoreXHRPatch)||void 0===e||e.call(this),null===(t=this._restoreFetchPatch)||void 0===t||t.call(this),this._restoreXHRPatch=void 0,this._restoreFetchPatch=void 0)}}var up;!function(e){e[e.PENDING=-1]="PENDING",e[e.DENIED=0]="DENIED",e[e.GRANTED=1]="GRANTED"}(up||(up={}));class dp{constructor(e){this.instance=e}get config(){return this.instance.config}get consent(){return this.getDnt()?up.DENIED:this.storedConsent}isOptedOut(){return this.consent===up.DENIED||this.consent===up.PENDING&&this.config.opt_out_capturing_by_default}isOptedIn(){return!this.isOptedOut()}optInOut(e){this.storage.set(this.storageKey,e?1:0,this.config.cookie_expiration,this.config.cross_subdomain_cookie,this.config.secure_cookie)}reset(){this.storage.remove(this.storageKey,this.config.cross_subdomain_cookie)}get storageKey(){var{token:e,opt_out_capturing_cookie_prefix:t}=this.instance.config;return(t||"__ph_opt_in_out_")+e}get storedConsent(){var e=this.storage.get(this.storageKey);return"1"===e?up.GRANTED:"0"===e?up.DENIED:up.PENDING}get storage(){if(!this._storage){var e=this.config.opt_out_capturing_persistence_type;this._storage="localStorage"===e?du:cu;var t="localStorage"===e?cu:du;t.get(this.storageKey)&&(this._storage.get(this.storageKey)||this.optInOut("1"===t.get(this.storageKey)),t.remove(this.storageKey,this.config.cross_subdomain_cookie))}return this._storage}getDnt(){return!!this.config.respect_dnt&&!!Zr([null==jn?void 0:jn.doNotTrack,null==jn?void 0:jn.msDoNotTrack,er.doNotTrack],(e=>ir([!0,1,"1","yes"],e)))}}var hp=Rr("[ExceptionAutocapture]");class pp{constructor(e){var t;i(this,"originalOnUnhandledRejectionHandler",void 0),i(this,"startCapturing",(()=>{var e,t,n,r;if(Wn&&this.isEnabled&&!this.hasHandlers&&!this.isCapturing){var i=null===(e=er.__PosthogExtensions__)||void 0===e||null===(t=e.errorWrappingFunctions)||void 0===t?void 0:t.wrapOnError,o=null===(n=er.__PosthogExtensions__)||void 0===n||null===(r=n.errorWrappingFunctions)||void 0===r?void 0:r.wrapUnhandledRejection;if(i&&o)try{this.unwrapOnError=i(this.captureException.bind(this)),this.unwrapUnhandledRejection=o(this.captureException.bind(this))}catch(e){hp.error("failed to start",e),this.stopCapturing()}else hp.error("failed to load error wrapping functions - cannot start")}})),this.instance=e,this.remoteEnabled=!(null===(t=this.instance.persistence)||void 0===t||!t.props[ri]),this.startIfEnabled()}get isEnabled(){var e;return null!==(e=this.remoteEnabled)&&void 0!==e&&e}get isCapturing(){var e;return!(null==Wn||null===(e=Wn.onerror)||void 0===e||!e.__POSTHOG_INSTRUMENTED__)}get hasHandlers(){return this.originalOnUnhandledRejectionHandler||this.unwrapOnError}startIfEnabled(){this.isEnabled&&!this.isCapturing&&(hp.info("enabled, starting..."),this.loadScript(this.startCapturing))}loadScript(e){var t,n;this.hasHandlers&&e(),null===(t=er.__PosthogExtensions__)||void 0===t||null===(n=t.loadExternalDependency)||void 0===n||n.call(t,this.instance,"exception-autocapture",(t=>{if(t)return hp.error("failed to load script",t);e()}))}stopCapturing(){var e,t;null===(e=this.unwrapOnError)||void 0===e||e.call(this),null===(t=this.unwrapUnhandledRejection)||void 0===t||t.call(this)}onRemoteConfig(e){var t=e.autocaptureExceptions;this.remoteEnabled=!!t||!1,this.instance.persistence&&this.instance.persistence.register({[ri]:this.remoteEnabled}),this.startIfEnabled()}captureException(e){var t=this.instance.requestRouter.endpointFor("ui");e.$exception_personURL="".concat(t,"/project/").concat(this.instance.config.token,"/person/").concat(this.instance.get_distinct_id()),this.instance.exceptions.sendExceptionEvent(e)}}var vp=Rr("[Web Vitals]"),gp=9e5;class fp{constructor(e){var n;i(this,"_enabledServerSide",!1),i(this,"_initialized",!1),i(this,"buffer",{url:void 0,metrics:[],firstMetricTimestamp:void 0}),i(this,"_flushToCapture",(()=>{clearTimeout(this._delayedFlushTimer),0!==this.buffer.metrics.length&&(this.instance.capture("$web_vitals",this.buffer.metrics.reduce(((e,n)=>t(t({},e),{},{["$web_vitals_".concat(n.name,"_event")]:t({},n),["$web_vitals_".concat(n.name,"_value")]:n.value})),{})),this.buffer={url:void 0,metrics:[],firstMetricTimestamp:void 0})})),i(this,"_addToBuffer",(e=>{var n,r=null===(n=this.instance.sessionManager)||void 0===n?void 0:n.checkAndGetSessionAndWindowId(!0);if(mr(r))vp.error("Could not read session ID. Dropping metrics!");else{this.buffer=this.buffer||{url:void 0,metrics:[],firstMetricTimestamp:void 0};var i=this._currentURL();if(!mr(i))if(wr(null==e?void 0:e.name)||wr(null==e?void 0:e.value))vp.error("Invalid metric received",e);else if(this._maxAllowedValue&&e.value>=this._maxAllowedValue)vp.error("Ignoring metric with value >= "+this._maxAllowedValue,e);else this.buffer.url!==i&&(this._flushToCapture(),this._delayedFlushTimer=setTimeout(this._flushToCapture,this.flushToCaptureTimeoutMs)),mr(this.buffer.url)&&(this.buffer.url=i),this.buffer.firstMetricTimestamp=mr(this.buffer.firstMetricTimestamp)?Date.now():this.buffer.firstMetricTimestamp,e.attribution&&e.attribution.interactionTargetElement&&(e.attribution.interactionTargetElement=void 0),this.buffer.metrics.push(t(t({},e),{},{$current_url:i,$session_id:r.sessionId,$window_id:r.windowId,timestamp:Date.now()})),this.buffer.metrics.length===this.allowedMetrics.length&&this._flushToCapture()}})),i(this,"_startCapturing",(()=>{var e,t,n,r,i=er.__PosthogExtensions__;mr(i)||mr(i.postHogWebVitalsCallbacks)||({onLCP:e,onCLS:t,onFCP:n,onINP:r}=i.postHogWebVitalsCallbacks),e&&t&&n&&r?(this.allowedMetrics.indexOf("LCP")>-1&&e(this._addToBuffer.bind(this)),this.allowedMetrics.indexOf("CLS")>-1&&t(this._addToBuffer.bind(this)),this.allowedMetrics.indexOf("FCP")>-1&&n(this._addToBuffer.bind(this)),this.allowedMetrics.indexOf("INP")>-1&&r(this._addToBuffer.bind(this)),this._initialized=!0):vp.error("web vitals callbacks not loaded - not starting")})),this.instance=e,this._enabledServerSide=!(null===(n=this.instance.persistence)||void 0===n||!n.props[ii]),this.startIfEnabled()}get allowedMetrics(){var e,t,n=gr(this.instance.config.capture_performance)?null===(e=this.instance.config.capture_performance)||void 0===e?void 0:e.web_vitals_allowed_metrics:void 0;return mr(n)?(null===(t=this.instance.persistence)||void 0===t?void 0:t.props[si])||["CLS","FCP","INP","LCP"]:n}get flushToCaptureTimeoutMs(){return(gr(this.instance.config.capture_performance)?this.instance.config.capture_performance.web_vitals_delayed_flush_ms:void 0)||5e3}get _maxAllowedValue(){var e=gr(this.instance.config.capture_performance)&&Sr(this.instance.config.capture_performance.__web_vitals_max_value)?this.instance.config.capture_performance.__web_vitals_max_value:gp;return 0<e&&e<=6e4?gp:e}get isEnabled(){var e=gr(this.instance.config.capture_performance)?this.instance.config.capture_performance.web_vitals:void 0;return Cr(e)?e:this._enabledServerSide}startIfEnabled(){this.isEnabled&&!this._initialized&&(vp.info("enabled, starting..."),this.loadScript(this._startCapturing))}onRemoteConfig(e){var t=gr(e.capturePerformance)&&!!e.capturePerformance.web_vitals,n=gr(e.capturePerformance)?e.capturePerformance.web_vitals_allowed_metrics:void 0;this.instance.persistence&&(this.instance.persistence.register({[ii]:t}),this.instance.persistence.register({[si]:n})),this._enabledServerSide=t,this.startIfEnabled()}loadScript(e){var t,n,r;null!==(t=er.__PosthogExtensions__)&&void 0!==t&&t.postHogWebVitalsCallbacks&&e(),null===(n=er.__PosthogExtensions__)||void 0===n||null===(r=n.loadExternalDependency)||void 0===r||r.call(n,this.instance,"web-vitals",(t=>{t?vp.error("failed to load script",t):e()}))}_currentURL(){var e=Wn?Wn.location.href:void 0;return e||vp.error("Could not determine current URL"),e}}var mp={icontains:(e,t)=>!!Wn&&t.href.toLowerCase().indexOf(e.toLowerCase())>-1,not_icontains:(e,t)=>!!Wn&&-1===t.href.toLowerCase().indexOf(e.toLowerCase()),regex:(e,t)=>!!Wn&&jr(t.href,e),not_regex:(e,t)=>!!Wn&&!jr(t.href,e),exact:(e,t)=>t.href===e,is_not:(e,t)=>t.href!==e};class _p{constructor(e){var t=this;i(this,"getWebExperimentsAndEvaluateDisplayLogic",(function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];t.getWebExperiments((e=>{_p.logInfo("retrieved web experiments from the server"),t._flagToExperiments=new Map,e.forEach((e=>{if(e.feature_flag_key){var n;if(t._flagToExperiments)_p.logInfo("setting flag key ",e.feature_flag_key," to web experiment ",e),null===(n=t._flagToExperiments)||void 0===n||n.set(e.feature_flag_key,e);var r=t.instance.getFeatureFlag(e.feature_flag_key);_r(r)&&e.variants[r]&&t.applyTransforms(e.name,r,e.variants[r].transforms)}else if(e.variants)for(var i in e.variants){var o=e.variants[i];_p.matchesTestVariant(o)&&t.applyTransforms(e.name,i,o.transforms)}}))}),e)})),this.instance=e,this.instance.onFeatureFlags((e=>{this.onFeatureFlags(e)}))}onFeatureFlags(e){if(this._is_bot())_p.logInfo("Refusing to render web experiment since the viewer is a likely bot");else if(!this.instance.config.disable_web_experiments){if(wr(this._flagToExperiments))return this._flagToExperiments=new Map,this.loadIfEnabled(),void this.previewWebExperiment();_p.logInfo("applying feature flags",e),e.forEach((e=>{var t;if(this._flagToExperiments&&null!==(t=this._flagToExperiments)&&void 0!==t&&t.has(e)){var n,r=this.instance.getFeatureFlag(e),i=null===(n=this._flagToExperiments)||void 0===n?void 0:n.get(e);r&&null!=i&&i.variants[r]&&this.applyTransforms(i.name,r,i.variants[r].transforms)}}))}}previewWebExperiment(){var e=_p.getWindowLocation();if(null!=e&&e.search){var t=Yr(null==e?void 0:e.search,"__experiment_id"),n=Yr(null==e?void 0:e.search,"__experiment_variant");t&&n&&(_p.logInfo("previewing web experiments ".concat(t," && ").concat(n)),this.getWebExperiments((e=>{this.showPreviewWebExperiment(parseInt(t),n,e)}),!1,!0))}}loadIfEnabled(){this.instance.config.disable_web_experiments||this.getWebExperimentsAndEvaluateDisplayLogic()}getWebExperiments(e,t,n){if(this.instance.config.disable_web_experiments&&!n)return e([]);var r=this.instance.get_property("$web_experiments");if(r&&!t)return e(r);this.instance._send_request({url:this.instance.requestRouter.endpointFor("api","/api/web_experiments/?token=".concat(this.instance.config.token)),method:"GET",callback:t=>{if(200!==t.statusCode||!t.json)return e([]);var n=t.json.experiments||[];return e(n)}})}showPreviewWebExperiment(e,t,n){var r=n.filter((t=>t.id===e));r&&r.length>0&&(_p.logInfo("Previewing web experiment [".concat(r[0].name,"] with variant [").concat(t,"]")),this.applyTransforms(r[0].name,t,r[0].variants[t].transforms))}static matchesTestVariant(e){return!wr(e.conditions)&&(_p.matchUrlConditions(e)&&_p.matchUTMConditions(e))}static matchUrlConditions(e){var t;if(wr(e.conditions)||wr(null===(t=e.conditions)||void 0===t?void 0:t.url))return!0;var n,r,i,o=_p.getWindowLocation();return!!o&&(null===(n=e.conditions)||void 0===n||!n.url||mp[null!==(r=null===(i=e.conditions)||void 0===i?void 0:i.urlMatchType)&&void 0!==r?r:"icontains"](e.conditions.url,o))}static getWindowLocation(){return null==Wn?void 0:Wn.location}static matchUTMConditions(e){var t;if(wr(e.conditions)||wr(null===(t=e.conditions)||void 0===t?void 0:t.utm))return!0;var n=md.campaignParams();if(n.utm_source){var r,i,o,s,a,l,c,u,d,h,p,v,g,f,m,_,y=null===(r=e.conditions)||void 0===r||null===(i=r.utm)||void 0===i||!i.utm_campaign||(null===(o=e.conditions)||void 0===o||null===(s=o.utm)||void 0===s?void 0:s.utm_campaign)==n.utm_campaign,b=null===(a=e.conditions)||void 0===a||null===(l=a.utm)||void 0===l||!l.utm_source||(null===(c=e.conditions)||void 0===c||null===(u=c.utm)||void 0===u?void 0:u.utm_source)==n.utm_source,w=null===(d=e.conditions)||void 0===d||null===(h=d.utm)||void 0===h||!h.utm_medium||(null===(p=e.conditions)||void 0===p||null===(v=p.utm)||void 0===v?void 0:v.utm_medium)==n.utm_medium,S=null===(g=e.conditions)||void 0===g||null===(f=g.utm)||void 0===f||!f.utm_term||(null===(m=e.conditions)||void 0===m||null===(_=m.utm)||void 0===_?void 0:_.utm_term)==n.utm_term;return y&&w&&S&&b}return!1}static logInfo(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];Mr.info("[WebExperiments] ".concat(e),n)}applyTransforms(e,t,n){this._is_bot()?_p.logInfo("Refusing to render web experiment since the viewer is a likely bot"):"control"!==t?n.forEach((n=>{if(n.selector){var r;_p.logInfo("applying transform of variant ".concat(t," for experiment ").concat(e," "),n);var i=null===(r=document)||void 0===r?void 0:r.querySelectorAll(n.selector);null==i||i.forEach((e=>{var t=e;n.attributes&&n.attributes.forEach((e=>{switch(e.name){case"text":t.innerText=e.value;break;case"html":t.innerHTML=e.value;break;case"cssClass":t.className=e.value;break;default:t.setAttribute(e.name,e.value)}})),n.text&&(t.innerText=n.text),n.html&&(t.parentElement?t.parentElement.innerHTML=n.html:t.innerHTML=n.html),n.css&&t.setAttribute("style",n.css)}))}})):_p.logInfo("Control variants leave the page unmodified.")}_is_bot(){return jn&&this.instance?Qh(jn,this.instance.config.custom_blocked_useragents):void 0}}class yp{constructor(e){this.instance=e}sendExceptionEvent(e){this.instance.capture("$exception",e,{_noTruncate:!0,_batchKey:"exceptionEvent"})}}var bp=["$set_once","$set"],wp=Rr("[SiteApps]");class Sp{constructor(e){this.instance=e,this.bufferedInvocations=[],this.apps={}}get isEnabled(){return!!this.instance.config.opt_in_site_apps}eventCollector(e,t){if(t){var n=this.globalsForEvent(t);this.bufferedInvocations.push(n),this.bufferedInvocations.length>1e3&&(this.bufferedInvocations=this.bufferedInvocations.slice(10))}}get siteAppLoaders(){var e,t;return null===(e=er._POSTHOG_REMOTE_CONFIG)||void 0===e||null===(t=e[this.instance.config.token])||void 0===t?void 0:t.siteApps}init(){if(this.isEnabled){var e=this.instance._addCaptureHook(this.eventCollector.bind(this));this.stopBuffering=()=>{e(),this.bufferedInvocations=[],this.stopBuffering=void 0}}}globalsForEvent(e){var n,r,i,s,a,l,c;if(!e)throw new Error("Event payload is required");var u={},d=this.instance.get_property("$groups")||[],h=this.instance.get_property("$stored_group_properties")||{};for(var[p,v]of Object.entries(h))u[p]={id:d[p],type:p,properties:v};var{$set_once:g,$set:f}=e;return{event:t(t({},o(e,bp)),{},{properties:t(t(t({},e.properties),f?{$set:t(t({},null!==(n=null===(r=e.properties)||void 0===r?void 0:r.$set)&&void 0!==n?n:{}),f)}:{}),g?{$set_once:t(t({},null!==(i=null===(s=e.properties)||void 0===s?void 0:s.$set_once)&&void 0!==i?i:{}),g)}:{}),elements_chain:null!==(a=null===(l=e.properties)||void 0===l?void 0:l.$elements_chain)&&void 0!==a?a:"",distinct_id:null===(c=e.properties)||void 0===c?void 0:c.distinct_id}),person:{properties:this.instance.get_property("$stored_person_properties")},groups:u}}setupSiteApp(e){var t={id:e.id,loaded:!1,errored:!1};this.apps[e.id]=t;var n=n=>{var r;for(var i of(this.apps[e.id].errored=!n,this.apps[e.id].loaded=!0,wp.info("Site app with id ".concat(e.id," ").concat(n?"loaded":"errored")),n&&this.bufferedInvocations.length&&(wp.info("Processing ".concat(this.bufferedInvocations.length," events for site app with id ").concat(e.id)),this.bufferedInvocations.forEach((e=>{var n;return null===(n=t.processEvent)||void 0===n?void 0:n.call(t,e)}))),Object.values(this.apps)))if(!i.loaded)return;null===(r=this.stopBuffering)||void 0===r||r.call(this)};try{var{processEvent:r}=e.init({posthog:this.instance,callback:e=>{n(e)}});r&&(t.processEvent=r)}catch(t){wp.error("Error while initializing PostHog app with config id ".concat(e.id),t),n(!1)}}onCapturedEvent(e){if(0!==Object.keys(this.apps).length){var t=this.globalsForEvent(e);for(var n of Object.values(this.apps))try{var r;null===(r=n.processEvent)||void 0===r||r.call(n,t)}catch(t){wp.error("Error while processing event ".concat(e.event," for site app ").concat(n.id),t)}}}onRemoteConfig(e){var t,n,r,i=this;if(null!==(t=this.siteAppLoaders)&&void 0!==t&&t.length){if(!this.isEnabled)return void wp.error('PostHog site apps are disabled. Enable the "opt_in_site_apps" config to proceed.');for(var o of this.siteAppLoaders)this.setupSiteApp(o);this.instance.on("eventCaptured",(e=>this.onCapturedEvent(e)))}else if(null===(n=this.stopBuffering)||void 0===n||n.call(this),null!==(r=e.siteApps)&&void 0!==r&&r.length)if(this.isEnabled){var s=function(e,t){var n,r;er["__$$ph_site_app_".concat(e)]=i.instance,null===(n=er.__PosthogExtensions__)||void 0===n||null===(r=n.loadSiteApp)||void 0===r||r.call(n,i.instance,t,(t=>{if(t)return wp.error("Error while initializing PostHog app with config id ".concat(e),t)}))};for(var{id:a,url:l}of e.siteApps)s(a,l)}else wp.error('PostHog site apps are disabled. Enable the "opt_in_site_apps" config to proceed.')}}function Cp(e,t,n){return Ah({distinct_id:e,userPropertiesToSet:t,userPropertiesToSetOnce:n})}var Ip={},kp=()=>{},Ep="posthog",xp=!Th&&-1===(null==Qn?void 0:Qn.indexOf("MSIE"))&&-1===(null==Qn?void 0:Qn.indexOf("Mozilla")),Tp=()=>{var e;return{api_host:"https://us.i.posthog.com",ui_host:null,token:"",autocapture:!0,rageclick:!0,cross_subdomain_cookie:Vr(null==zn?void 0:zn.location),persistence:"localStorage+cookie",persistence_name:"",loaded:kp,save_campaign_params:!0,custom_campaign_params:[],custom_blocked_useragents:[],save_referrer:!0,capture_pageview:!0,capture_pageleave:"if_capture_pageview",debug:Yn&&_r(null==Yn?void 0:Yn.search)&&-1!==Yn.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_external_dependency_loading:!1,enable_recording_console_log:void 0,secure_cookie:"https:"===(null==Wn||null===(e=Wn.location)||void 0===e?void 0:e.protocol),ip:!0,opt_out_capturing_by_default:!1,opt_out_persistence_by_default:!1,opt_out_useragent_filter:!1,opt_out_capturing_persistence_type:"localStorage",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_decide:!1,advanced_disable_feature_flags:!1,advanced_disable_feature_flags_on_first_load:!1,advanced_disable_toolbar_metrics:!1,feature_flag_request_timeout_ms:3e3,on_request_error:e=>{var t="Bad HTTP status: "+e.statusCode+" "+e.text;Mr.error(t)},get_device_id:e=>e,capture_performance:void 0,name:"posthog",bootstrap:{},disable_compression:!1,session_idle_timeout_seconds:1800,person_profiles:"identified_only",before_send:void 0,_onCapture:kp}},Mp=e=>{var t={};mr(e.process_person)||(t.person_profiles=e.process_person),mr(e.xhr_headers)||(t.request_headers=e.xhr_headers),mr(e.cookie_name)||(t.persistence_name=e.cookie_name),mr(e.disable_cookie)||(t.disable_persistence=e.disable_cookie),mr(e.store_google)||(t.save_campaign_params=e.store_google),mr(e.verbose)||(t.debug=e.verbose);var n=Or({},t,e);return dr(e.property_blacklist)&&(mr(e.property_denylist)?n.property_denylist=e.property_blacklist:dr(e.property_denylist)?n.property_denylist=[...e.property_blacklist,...e.property_denylist]:Mr.error("Invalid value for property_denylist config: "+e.property_denylist)),n};class Rp{constructor(){i(this,"__forceAllowLocalhost",!1)}get _forceAllowLocalhost(){return this.__forceAllowLocalhost}set _forceAllowLocalhost(e){Mr.error("WebPerformanceObserver is deprecated and has no impact on network capture. Use `_forceAllowLocalhostNetworkCapture` on `posthog.sessionRecording`"),this.__forceAllowLocalhost=e}}class Ap{get decideEndpointWasHit(){var e,t;return null!==(e=null===(t=this.featureFlags)||void 0===t?void 0:t.hasLoadedFlags)&&void 0!==e&&e}constructor(){i(this,"webPerformance",new Rp),i(this,"version",xr.LIB_VERSION),i(this,"_internalEventEmitter",new Zs),this.config=Tp(),this.SentryIntegration=Vh,this.sentryIntegration=e=>function(e,t){var n=Wh(e,t);return{name:$h,processEvent:e=>n(e)}}(this,e),this.__request_queue=[],this.__loaded=!1,this.analyticsDefaultEndpoint="/e/",this._initialPageviewCaptured=!1,this._initialPersonProfilesConfig=null,this._cachedIdentify=null,this.featureFlags=new Xc(this),this.toolbar=new kh(this),this.scrollManager=new ap(this),this.pageViewManager=new Uh(this),this.surveys=new Js(this),this.experiments=new _p(this),this.exceptions=new yp(this),this.rateLimiter=new zh(this),this.requestRouter=new qh(this),this.consent=new dp(this),this.people={set:(e,t,n)=>{var r=_r(e)?{[e]:t}:e;this.setPersonProperties(r),null==n||n({})},set_once:(e,t,n)=>{var r=_r(e)?{[e]:t}:e;this.setPersonProperties(void 0,r),null==n||n({})}},this.on("eventCaptured",(e=>Mr.info('send "'.concat(null==e?void 0:e.event,'"'),e)))}init(e,t,n){if(n&&n!==Ep){var r,i=null!==(r=Ip[n])&&void 0!==r?r:new Ap;return i._init(e,t,n),Ip[n]=i,Ip[Ep][n]=i,i}return this._init(e,t,n)}_init(e){var n,r,i,o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},s=arguments.length>2?arguments[2]:void 0;if(mr(e)||yr(e))return Mr.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 Mr.warn("You have already initialized PostHog! Re-initializing is a no-op"),this;this.__loaded=!0,this.config={},this._triggered_notifs=[],o.person_profiles&&(this._initialPersonProfilesConfig=o.person_profiles),this.set_config(Or({},Tp(),Mp(o),{name:s,token:e})),this.config.on_xhr_error&&Mr.error("on_xhr_error is deprecated. Use on_request_error instead"),this.compression=o.disable_compression?void 0:qn.GZipJS,this.persistence=new yd(this.config),this.sessionPersistence="sessionStorage"===this.config.persistence||"memory"===this.config.persistence?this.persistence:new yd(t(t({},this.config),{},{persistence:"sessionStorage"}));var a=t({},this.persistence.props),l=t({},this.sessionPersistence.props);if(this._requestQueue=new Eh((e=>this._send_retriable_request(e))),this._retryQueue=new Ph(this),this.__request_queue=[],this.config.__preview_experimental_cookieless_mode||(this.sessionManager=new Bh(this),this.sessionPropsManager=new Xh(this,this.sessionManager,this.persistence)),new cp(this).startIfEnabledOrStop(),this.siteApps=new Sp(this),null===(n=this.siteApps)||void 0===n||n.init(),this.config.__preview_experimental_cookieless_mode||(this.sessionRecording=new _h(this),this.sessionRecording.startIfEnabledOrStop()),this.config.disable_scroll_properties||this.scrollManager.startMeasuringScrollPosition(),this.autocapture=new qc(this),this.autocapture.startIfEnabled(),this.surveys.loadIfEnabled(),this.heatmaps=new sp(this),this.heatmaps.startIfEnabled(),this.webVitalsAutocapture=new fp(this),this.exceptionObserver=new pp(this),this.exceptionObserver.startIfEnabled(),this.deadClicksAutocapture=new rp(this,np),this.deadClicksAutocapture.startIfEnabled(),xr.DEBUG=xr.DEBUG||this.config.debug,xr.DEBUG&&Mr.info("Starting in debug mode",{this:this,config:o,thisC:t({},this.config),p:a,s:l}),this._sync_opt_out_with_persistence(),void 0!==(null===(r=o.bootstrap)||void 0===r?void 0:r.distinctID)){var c,u,d=this.config.get_device_id(ru()),h=null!==(c=o.bootstrap)&&void 0!==c&&c.isIdentifiedID?d:o.bootstrap.distinctID;this.persistence.set_property(ki,null!==(u=o.bootstrap)&&void 0!==u&&u.isIdentifiedID?"identified":"anonymous"),this.register({distinct_id:o.bootstrap.distinctID,$device_id:h})}if(this._hasBootstrappedFeatureFlags()){var p,v,g=Object.keys((null===(p=o.bootstrap)||void 0===p?void 0:p.featureFlags)||{}).filter((e=>{var t,n;return!(null===(t=o.bootstrap)||void 0===t||null===(n=t.featureFlags)||void 0===n||!n[e])})).reduce(((e,t)=>{var n,r;return e[t]=(null===(n=o.bootstrap)||void 0===n||null===(r=n.featureFlags)||void 0===r?void 0:r[t])||!1,e}),{}),f=Object.keys((null===(v=o.bootstrap)||void 0===v?void 0:v.featureFlagPayloads)||{}).filter((e=>g[e])).reduce(((e,t)=>{var n,r,i,s;null!==(n=o.bootstrap)&&void 0!==n&&null!==(r=n.featureFlagPayloads)&&void 0!==r&&r[t]&&(e[t]=null===(i=o.bootstrap)||void 0===i||null===(s=i.featureFlagPayloads)||void 0===s?void 0:s[t]);return e}),{});this.featureFlags.receivedFeatureFlags({featureFlags:g,featureFlagPayloads:f})}if(this.config.__preview_experimental_cookieless_mode)this.register_once({distinct_id:Fi,$device_id:null},"");else if(!this.get_distinct_id()){var m=this.config.get_device_id(ru());this.register_once({distinct_id:m,$device_id:m},""),this.persistence.set_property(ki,"anonymous")}return null==Wn||null===(i=Wn.addEventListener)||void 0===i||i.call(Wn,"onpagehide"in self?"pagehide":"unload",this._handle_unload.bind(this)),this.toolbar.maybeLoadToolbar(),o.segment?Gh(this,(()=>this._loaded())):this._loaded(),hr(this.config._onCapture)&&this.config._onCapture!==kp&&(Mr.warn("onCapture is deprecated. Please use `before_send` instead"),this.on("eventCaptured",(e=>this.config._onCapture(e.event,e)))),this}_onRemoteConfig(e){var t,n,r,i,o,s,a,l;if(!zn||!zn.body)return Mr.info("document not ready yet, trying again in 500 milliseconds..."),void setTimeout((()=>{this._onRemoteConfig(e)}),500);this.compression=void 0,e.supportedCompression&&!this.config.disable_compression&&(this.compression=ir(e.supportedCompression,qn.GZipJS)?qn.GZipJS:ir(e.supportedCompression,qn.Base64)?qn.Base64:void 0),null!==(t=e.analytics)&&void 0!==t&&t.endpoint&&(this.analyticsDefaultEndpoint=e.analytics.endpoint),this.set_config({person_profiles:this._initialPersonProfilesConfig?this._initialPersonProfilesConfig:"identified_only"}),null===(n=this.siteApps)||void 0===n||n.onRemoteConfig(e),null===(r=this.sessionRecording)||void 0===r||r.onRemoteConfig(e),null===(i=this.autocapture)||void 0===i||i.onRemoteConfig(e),null===(o=this.heatmaps)||void 0===o||o.onRemoteConfig(e),this.surveys.onRemoteConfig(e),null===(s=this.webVitalsAutocapture)||void 0===s||s.onRemoteConfig(e),null===(a=this.exceptionObserver)||void 0===a||a.onRemoteConfig(e),null===(l=this.deadClicksAutocapture)||void 0===l||l.onRemoteConfig(e)}_loaded(){try{this.config.loaded(this)}catch(e){Mr.critical("`loaded` function failed",e)}this._start_queue_if_opted_in(),this.config.capture_pageview&&setTimeout((()=>{this.consent.isOptedIn()&&this._captureInitialPageview()}),1),new bh(this).load(),this.featureFlags.decide()}_start_queue_if_opted_in(){var e;this.has_opted_out_capturing()||this.config.request_batching&&(null===(e=this._requestQueue)||void 0===e||e.enable())}_dom_loaded(){this.has_opted_out_capturing()||Nr(this.__request_queue,(e=>this._send_retriable_request(e))),this.__request_queue=[],this._start_queue_if_opted_in()}_handle_unload(){var e,t;this.config.request_batching?(this._shouldCapturePageleave()&&this.capture("$pageleave"),null===(e=this._requestQueue)||void 0===e||e.unload(),null===(t=this._retryQueue)||void 0===t||t.unload()):this._shouldCapturePageleave()&&this.capture("$pageleave",null,{transport:"sendBeacon"})}_send_request(e){this.__loaded&&(xp?this.__request_queue.push(e):this.rateLimiter.isServerRateLimited(e.batchKey)||(e.transport=e.transport||this.config.api_transport,e.url=Rh(e.url,{ip:this.config.ip?1:0}),e.headers=t({},this.config.request_headers),e.compression="best-available"===e.compression?this.compression:e.compression,e.fetchOptions=e.fetchOptions||this.config.fetch_options,(e=>{var n,r,i,o=t({},e);o.timeout=o.timeout||6e4,o.url=Rh(o.url,{_:(new Date).getTime().toString(),ver:xr.LIB_VERSION,compression:o.compression});var s=null!==(n=o.transport)&&void 0!==n?n:"fetch",a=null!==(r=null===(i=Zr(Fh,(e=>e.transport===s)))||void 0===i?void 0:i.method)&&void 0!==r?r:Fh[0].method;if(!a)throw new Error("No available transport method");a(o)})(t(t({},e),{},{callback:t=>{var n,r,i;(this.rateLimiter.checkForLimiting(t),t.statusCode>=400)&&(null===(r=(i=this.config).on_request_error)||void 0===r||r.call(i,t));null===(n=e.callback)||void 0===n||n.call(e,t)}}))))}_send_retriable_request(e){this._retryQueue?this._retryQueue.retriableRequest(e):this._send_request(e)}_execute_array(e){var t,n=[],r=[],i=[];Nr(e,(e=>{e&&(t=e[0],dr(t)?i.push(e):hr(e)?e.call(this):dr(e)&&"alias"===t?n.push(e):dr(e)&&-1!==t.indexOf("capture")&&hr(this[t])?i.push(e):r.push(e))}));var o=function(e,t){Nr(e,(function(e){if(dr(e[0])){var n=t;Fr(e,(function(e){n=n[e[0]].apply(n,e.slice(1))}))}else this[e[0]].apply(this,e.slice(1))}),t)};o(n,this),o(r,this),o(i,this)}_hasBootstrappedFeatureFlags(){var e,t;return(null===(e=this.config.bootstrap)||void 0===e?void 0:e.featureFlags)&&Object.keys(null===(t=this.config.bootstrap)||void 0===t?void 0:t.featureFlags).length>0||!1}push(e){this._execute_array([e])}capture(e,n,r){var i;if(this.__loaded&&this.persistence&&this.sessionPersistence&&this._requestQueue){if(!this.consent.isOptedOut())if(!mr(e)&&_r(e)){if(this.config.opt_out_useragent_filter||!this._is_bot()){var o=null!=r&&r.skip_client_rate_limiting?void 0:this.rateLimiter.clientRateLimitContext();if(null==o||!o.isRateLimited){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==r?void 0:r.timestamp)||s,l=ru(),c={uuid:l,event:e,properties:this._calculate_event_properties(e,n||{},a,l)};o&&(c.properties.$lib_rate_limit_remaining_tokens=o.remainingTokens),(null==r?void 0:r.$set)&&(c.$set=null==r?void 0:r.$set);var u=this._calculate_set_once_properties(null==r?void 0:r.$set_once);u&&(c.$set_once=u),(c=qr(c,null!=r&&r._noTruncate?null:this.config.properties_string_max_length)).timestamp=a,mr(null==r?void 0:r.timestamp)||(c.properties.$event_time_override_provided=!0,c.properties.$event_time_override_system_time=s);var d=t(t({},c.properties.$set),c.$set);if(fr(d)||this.setPersonPropertiesForFlags(d),!wr(this.config.before_send)){var h=this._runBeforeSend(c);if(!h)return;c=h}this._internalEventEmitter.emit("eventCaptured",c);var p={method:"POST",url:null!==(i=null==r?void 0:r._url)&&void 0!==i?i:this.requestRouter.endpointFor("api",this.analyticsDefaultEndpoint),data:c,compression:"best-available",batchKey:null==r?void 0:r._batchKey};return!this.config.request_batching||r&&(null==r||!r._batchKey)||null!=r&&r.send_instantly?this._send_retriable_request(p):this._requestQueue.enqueue(p),c}Mr.critical("This capture call is ignored due to client rate limiting.")}}else Mr.error("No event name provided to posthog.capture")}else Mr.uninitializedWarning("posthog.capture")}_addCaptureHook(e){return this.on("eventCaptured",(t=>e(t.event,t)))}_calculate_event_properties(e,n,r,i){if(r=r||new Date,!this.persistence||!this.sessionPersistence)return n;var o=this.persistence.remove_event_timer(e),s=t({},n);if(s.token=this.config.token,this.config.__preview_experimental_cookieless_mode&&(s.$cookieless_mode=!0),"$snapshot"===e){var a=t(t({},this.persistence.properties()),this.sessionPersistence.properties());return s.distinct_id=a.distinct_id,(!_r(s.distinct_id)&&!Sr(s.distinct_id)||yr(s.distinct_id))&&Mr.error("Invalid distinct_id for replay event. This indicates a bug in your implementation"),s}var l,c=md.properties({maskPersonalDataProperties:this.config.mask_personal_data_properties,customPersonalDataProperties:this.config.custom_personal_data_properties});if(this.sessionManager){var{sessionId:u,windowId:d}=this.sessionManager.checkAndGetSessionAndWindowId();s.$session_id=u,s.$window_id=d}if(this.sessionRecording&&(s.$recording_status=this.sessionRecording.status),this.requestRouter.region===Lh.CUSTOM&&(s.$lib_custom_api_host=this.config.api_host),l="$pageview"===e?this.pageViewManager.doPageView(r,i):"$pageleave"===e?this.pageViewManager.doPageLeave(r):this.pageViewManager.doEvent(),s=Or(s,l),"$pageview"===e&&zn&&(s.title=zn.title),!mr(o)){var h=r.getTime()-o;s.$duration=parseFloat((h/1e3).toFixed(3))}Qn&&this.config.opt_out_useragent_filter&&(s.$browser_type=this._is_bot()?"bot":"browser"),(s=Or({},c,this.persistence.properties(),this.sessionPersistence.properties(),s)).$is_identified=this._isIdentified(),dr(this.config.property_denylist)?Fr(this.config.property_denylist,(function(e){delete s[e]})):Mr.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&&(Mr.error("sanitize_properties is deprecated. Use before_send instead"),s=p(s,e));var v=this._hasPersonProcessing();return s.$process_person_profile=v,v&&this._requirePersonProcessing("_calculate_event_properties"),s}_calculate_set_once_properties(e){if(!this.persistence||!this._hasPersonProcessing())return e;var t=Or({},this.persistence.get_initial_props(),e||{}),n=this.config.sanitize_properties;return n&&(Mr.error("sanitize_properties is deprecated. Use before_send instead"),t=n(t,"$set_once")),fr(t)?void 0:t}register(e,t){var n;null===(n=this.persistence)||void 0===n||n.register(e,t)}register_once(e,t,n){var r;null===(r=this.persistence)||void 0===r||r.register_once(e,t,n)}register_for_session(e){var t;null===(t=this.sessionPersistence)||void 0===t||t.register(e)}unregister(e){var t;null===(t=this.persistence)||void 0===t||t.unregister(e)}unregister_for_session(e){var t;null===(t=this.sessionPersistence)||void 0===t||t.unregister(e)}_register_single(e,t){this.register({[e]:t})}getFeatureFlag(e,t){return this.featureFlags.getFeatureFlag(e,t)}getFeatureFlagPayload(e){var t=this.featureFlags.getFeatureFlagPayload(e);try{return JSON.parse(t)}catch(e){return t}}isFeatureEnabled(e,t){return this.featureFlags.isFeatureEnabled(e,t)}reloadFeatureFlags(){this.featureFlags.reloadFeatureFlags()}updateEarlyAccessFeatureEnrollment(e,t){this.featureFlags.updateEarlyAccessFeatureEnrollment(e,t)}getEarlyAccessFeatures(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return this.featureFlags.getEarlyAccessFeatures(e,t)}on(e,t){return this._internalEventEmitter.on(e,t)}onFeatureFlags(e){return this.featureFlags.onFeatureFlags(e)}onSessionId(e){var t,n;return null!==(t=null===(n=this.sessionManager)||void 0===n?void 0:n.onSessionId(e))&&void 0!==t?t:()=>{}}getSurveys(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];this.surveys.getSurveys(e,t)}getActiveMatchingSurveys(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];this.surveys.getActiveMatchingSurveys(e,t)}renderSurvey(e,t){this.surveys.renderSurvey(e,t)}canRenderSurvey(e){this.surveys.canRenderSurvey(e)}getNextSurveyStep(e,t,n){return this.surveys.getNextSurveyStep(e,t,n)}identify(e,t,n){if(!this.__loaded||!this.persistence)return Mr.uninitializedWarning("posthog.identify");if(Sr(e)&&(e=e.toString(),Mr.warn("The first argument to posthog.identify was a number, but it should be a string. It has been converted to a string.")),e){if(["distinct_id","distinctid"].includes(e.toLowerCase()))Mr.critical('The string "'.concat(e,'" was set in posthog.identify which indicates an error. This ID should be unique to the user and not a hardcoded string.'));else if(this._requirePersonProcessing("posthog.identify")){var r=this.get_distinct_id();if(this.register({$user_id:e}),!this.get_property("$device_id")){var i=r;this.register_once({$had_persisted_distinct_id:!0,$device_id:i},"")}e!==r&&e!==this.get_property(Qr)&&(this.unregister(Qr),this.register({distinct_id:e}));var o="anonymous"===(this.persistence.get_property(ki)||"anonymous");e!==r&&o?(this.persistence.set_property(ki,"identified"),this.setPersonPropertiesForFlags(t||{},!1),this.capture("$identify",{distinct_id:e,$anon_distinct_id:r},{$set:t||{},$set_once:n||{}}),this.featureFlags.setAnonymousDistinctId(r),this._cachedIdentify=Cp(e,t,n)):(t||n)&&(this._cachedIdentify!==Cp(e,t,n)?(this.setPersonProperties(t,n),this._cachedIdentify=Cp(e,t,n)):Mr.info("A duplicate posthog.identify call was made with the same properties. It has been ignored.")),e!==r&&(this.reloadFeatureFlags(),this.unregister(Ii))}}else Mr.error("Unique user id has not been set in posthog.identify")}setPersonProperties(e,t){(e||t)&&this._requirePersonProcessing("posthog.setPersonProperties")&&(this.setPersonPropertiesForFlags(e||{}),this.capture("$set",{$set:e||{},$set_once:t||{}}))}group(e,n,r){if(e&&n){if(this._requirePersonProcessing("posthog.group")){var i=this.getGroups();i[e]!==n&&this.resetGroupPropertiesForFlags(e),this.register({$groups:t(t({},i),{},{[e]:n})}),r&&(this.capture("$groupidentify",{$group_type:e,$group_key:n,$group_set:r}),this.setGroupPropertiesForFlags({[e]:r})),i[e]===n||r||this.reloadFeatureFlags()}}else Mr.error("posthog.group requires a group type and group key")}resetGroups(){this.register({$groups:{}}),this.resetGroupPropertiesForFlags(),this.reloadFeatureFlags()}setPersonPropertiesForFlags(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];this.featureFlags.setPersonPropertiesForFlags(e,t)}resetPersonPropertiesForFlags(){this.featureFlags.resetPersonPropertiesForFlags()}setGroupPropertiesForFlags(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];this._requirePersonProcessing("posthog.setGroupPropertiesForFlags")&&this.featureFlags.setGroupPropertiesForFlags(e,t)}resetGroupPropertiesForFlags(e){this.featureFlags.resetGroupPropertiesForFlags(e)}reset(e){var t,n,r,i;if(Mr.info("reset"),!this.__loaded)return Mr.uninitializedWarning("posthog.reset");var o=this.get_property("$device_id");if(this.consent.reset(),null===(t=this.persistence)||void 0===t||t.clear(),null===(n=this.sessionPersistence)||void 0===n||n.clear(),this.surveys.reset(),null===(r=this.persistence)||void 0===r||r.set_property(ki,"anonymous"),null===(i=this.sessionManager)||void 0===i||i.resetSessionId(),this._cachedIdentify=null,this.config.__preview_experimental_cookieless_mode)this.register_once({distinct_id:Fi,$device_id:null},"");else{var s=this.config.get_device_id(ru());this.register_once({distinct_id:s,$device_id:e?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 e,t;return null!==(e=null===(t=this.sessionManager)||void 0===t?void 0:t.checkAndGetSessionAndWindowId(!0).sessionId)&&void 0!==e?e:""}get_session_replay_url(e){if(!this.sessionManager)return"";var{sessionId:t,sessionStartTimestamp:n}=this.sessionManager.checkAndGetSessionAndWindowId(!0),r=this.requestRouter.endpointFor("ui","/project/".concat(this.config.token,"/replay/").concat(t));if(null!=e&&e.withTimestamp&&n){var i,o=null!==(i=e.timestampLookBack)&&void 0!==i?i:10;if(!n)return r;var s=Math.max(Math.floor(((new Date).getTime()-n)/1e3)-o,0);r+="?t=".concat(s)}return r}alias(e,t){return e===this.get_property(Kr)?(Mr.critical("Attempting to create alias for existing People user - aborting."),-2):this._requirePersonProcessing("posthog.alias")?(mr(t)&&(t=this.get_distinct_id()),e!==t?(this._register_single(Qr,e),this.capture("$create_alias",{alias:e,distinct_id:t})):(Mr.warn("alias matches current distinct_id - skipping api call."),this.identify(e),-1)):void 0}set_config(e){var n,r,i,o,s=t({},this.config);gr(e)&&(Or(this.config,Mp(e)),null===(n=this.persistence)||void 0===n||n.update_config(this.config,s),this.sessionPersistence="sessionStorage"===this.config.persistence||"memory"===this.config.persistence?this.persistence:new yd(t(t({},this.config),{},{persistence:"sessionStorage"})),du.is_supported()&&"true"===du.get("ph_debug")&&(this.config.debug=!0),this.config.debug&&(xr.DEBUG=!0,Mr.info("set_config",{config:e,oldConfig:s,newConfig:t({},this.config)})),null===(r=this.sessionRecording)||void 0===r||r.startIfEnabledOrStop(),null===(i=this.autocapture)||void 0===i||i.startIfEnabled(),null===(o=this.heatmaps)||void 0===o||o.startIfEnabled(),this.surveys.loadIfEnabled(),this._sync_opt_out_with_persistence())}startSessionRecording(e){var t=!0===e,n={sampling:t||!(null==e||!e.sampling),linked_flag:t||!(null==e||!e.linked_flag),url_trigger:t||!(null==e||!e.url_trigger),event_trigger:t||!(null==e||!e.event_trigger)};if(Object.values(n).some(Boolean)){var r,i,o,s,a;if(null===(r=this.sessionManager)||void 0===r||r.checkAndGetSessionAndWindowId(),n.sampling)null===(i=this.sessionRecording)||void 0===i||i.overrideSampling();if(n.linked_flag)null===(o=this.sessionRecording)||void 0===o||o.overrideLinkedFlag();if(n.url_trigger)null===(s=this.sessionRecording)||void 0===s||s.overrideTrigger("url");if(n.event_trigger)null===(a=this.sessionRecording)||void 0===a||a.overrideTrigger("event")}this.set_config({disable_session_recording:!1})}stopSessionRecording(){this.set_config({disable_session_recording:!0})}sessionRecordingStarted(){var e;return!(null===(e=this.sessionRecording)||void 0===e||!e.started)}captureException(e,n){var r,i=new Error("PostHog syntheticException"),o=hr(null===(r=er.__PosthogExtensions__)||void 0===r?void 0:r.parseErrorAsProperties)?t(t({},er.__PosthogExtensions__.parseErrorAsProperties([e.message,void 0,void 0,void 0,e],{syntheticException:i})),n):t({$exception_level:"error",$exception_list:[{type:e.name,value:e.message,mechanism:{handled:!0,synthetic:!1}}]},n);this.exceptions.sendExceptionEvent(o)}loadToolbar(e){return this.toolbar.loadToolbar(e)}get_property(e){var t;return null===(t=this.persistence)||void 0===t?void 0:t.props[e]}getSessionProperty(e){var t;return null===(t=this.sessionPersistence)||void 0===t?void 0:t.props[e]}toString(){var e,t=null!==(e=this.config.name)&&void 0!==e?e:Ep;return t!==Ep&&(t=Ep+"."+t),t}_isIdentified(){var e,t;return"identified"===(null===(e=this.persistence)||void 0===e?void 0:e.get_property(ki))||"identified"===(null===(t=this.sessionPersistence)||void 0===t?void 0:t.get_property(ki))}_hasPersonProcessing(){var e,t,n,r;return!("never"===this.config.person_profiles||"identified_only"===this.config.person_profiles&&!this._isIdentified()&&fr(this.getGroups())&&(null===(e=this.persistence)||void 0===e||null===(t=e.props)||void 0===t||!t[Qr])&&(null===(n=this.persistence)||void 0===n||null===(r=n.props)||void 0===r||!r[Ai]))}_shouldCapturePageleave(){return!0===this.config.capture_pageleave||"if_capture_pageview"===this.config.capture_pageleave&&this.config.capture_pageview}createPersonProfile(){this._hasPersonProcessing()||this._requirePersonProcessing("posthog.createPersonProfile")&&this.setPersonProperties({},{})}_requirePersonProcessing(e){return"never"===this.config.person_profiles?(Mr.error(e+' was called, but process_person is set to "never". This call will be ignored.'),!1):(this._register_single(Ai,!0),!0)}_sync_opt_out_with_persistence(){var e,t,n,r,i=this.consent.isOptedOut(),o=this.config.opt_out_persistence_by_default,s=this.config.disable_persistence||i&&!!o;(null===(e=this.persistence)||void 0===e?void 0:e.disabled)!==s&&(null===(n=this.persistence)||void 0===n||n.set_disabled(s));(null===(t=this.sessionPersistence)||void 0===t?void 0:t.disabled)!==s&&(null===(r=this.sessionPersistence)||void 0===r||r.set_disabled(s))}opt_in_capturing(e){var t;(this.consent.optInOut(!0),this._sync_opt_out_with_persistence(),mr(null==e?void 0:e.captureEventName)||null!=e&&e.captureEventName)&&this.capture(null!==(t=null==e?void 0:e.captureEventName)&&void 0!==t?t:"$opt_in",null==e?void 0:e.captureProperties,{send_instantly:!0});this.config.capture_pageview&&this._captureInitialPageview()}opt_out_capturing(){this.consent.optInOut(!1),this._sync_opt_out_with_persistence()}has_opted_in_capturing(){return this.consent.isOptedIn()}has_opted_out_capturing(){return this.consent.isOptedOut()}clear_opt_in_out_capturing(){this.consent.reset(),this._sync_opt_out_with_persistence()}_is_bot(){return jn?Qh(jn,this.config.custom_blocked_useragents):void 0}_captureInitialPageview(){zn&&!this._initialPageviewCaptured&&(this._initialPageviewCaptured=!0,this.capture("$pageview",{title:zn.title},{send_instantly:!0}))}debug(e){!1===e?(null==Wn||Wn.console.log("You've disabled debug mode."),localStorage&&localStorage.removeItem("ph_debug"),this.set_config({debug:!1})):(null==Wn||Wn.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}))}_runBeforeSend(e){if(wr(this.config.before_send))return e;var t=dr(this.config.before_send)?this.config.before_send:[this.config.before_send],n=e;for(var r of t){if(n=r(n),wr(n)){var i="Event '".concat(e.event,"' was rejected in beforeSend function");return Er(e.event)?Mr.warn("".concat(i,". This can cause unexpected behavior.")):Mr.info(i),null}n.properties&&!fr(n.properties)||Mr.warn("Event '".concat(e.event,"' has no properties after beforeSend function, this is likely an error."))}return n}getPageViewId(){var e;return null===(e=this.pageViewManager._currentPageview)||void 0===e?void 0:e.pageViewId}}!function(e,t){for(var n=0;n<t.length;n++)e.prototype[t[n]]=Br(e.prototype[t[n]])}(Ap,["identify"]);var Np,Fp;Np=Ip[Ep]=new Ap,(Fp=er.posthog)&&Fr(Fp._i,(function(e){if(e&&dr(e)){var t=Np.init(e[0],e[1],e[2]),n=Fp[e[2]]||Fp;t&&(t._execute_array.call(t.people,n.people),t._execute_array(n))}})),er.posthog=Np,function(){function e(){e.done||(e.done=!0,xp=!1,Fr(Ip,(function(e){e._dom_loaded()})))}null!=zn&&zn.addEventListener&&("complete"===zn.readyState?e():zn.addEventListener("DOMContentLoaded",e,!1)),Wn&&$r(Wn,"load",e,!0)}()}();
|
|
2
2
|
//# sourceMappingURL=array.full.no-external.js.map
|