posthog-js 1.94.2 → 1.94.4
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/array.full.js +1 -1
- package/dist/array.full.js.map +1 -1
- package/dist/array.js +1 -1
- package/dist/array.js.map +1 -1
- package/dist/es.js +1 -1
- package/dist/es.js.map +1 -1
- package/dist/module.js +1 -1
- package/dist/module.js.map +1 -1
- package/lib/package.json +1 -1
- package/lib/src/autocapture.js +1 -1
- package/lib/src/autocapture.js.map +1 -1
- package/lib/src/utils/blocked-uas.js +8 -0
- package/lib/src/utils/blocked-uas.js.map +1 -1
- package/package.json +1 -1
package/dist/array.full.js
CHANGED
|
@@ -12,5 +12,5 @@
|
|
|
12
12
|
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
13
13
|
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
14
14
|
PERFORMANCE OF THIS SOFTWARE.
|
|
15
|
-
***************************************************************************** */function n(e){var t="function"==typeof Symbol&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function r(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,i,o=n.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(r=o.next()).done;)a.push(r.value)}catch(e){i={error:e}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return a}function i(e,t,n){if(n||2===arguments.length)for(var r,i=0,o=t.length;i<o;i++)!r&&i in t||(r||(r=Array.prototype.slice.call(t,0,i)),r[i]=t[i]);return e.concat(r||Array.prototype.slice.call(t))}function o(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 a(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?o(Object(n),!0).forEach((function(t){d(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):o(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function s(e){return s="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},s(e)}function u(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function l(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function c(e,t,n){return t&&l(e.prototype,t),n&&l(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function d(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function f(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&h(e,t)}function p(e){return p=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},p(e)}function h(e,t){return h=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},h(e,t)}function v(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}function g(e,t){if(t&&("object"==typeof t||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}function m(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=p(e);if(t){var i=p(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return g(this,n)}}function _(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null==n)return;var r,i,o=[],a=!0,s=!1;try{for(n=n.call(e);!(a=(r=n.next()).done)&&(o.push(r.value),!t||o.length!==t);a=!0);}catch(e){s=!0,i=e}finally{try{a||null==n.return||n.return()}finally{if(s)throw i}}return o}(e,t)||b(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function y(e){return function(e){if(Array.isArray(e))return k(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||b(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function b(e,t){if(e){if("string"==typeof e)return k(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?k(e,t):void 0}}function k(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function w(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=b(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,i=function(){};return{s:i,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,s=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return a=e.done,e},e:function(e){s=!0,o=e},f:function(){try{a||null==n.return||n.return()}finally{if(s)throw o}}}}function S(e){var t,n=null===(t=e)||void 0===t?void 0:t.host;return Boolean(n&&n.shadowRoot&&n.shadowRoot===e)}function C(e){var t=e.maskInputOptions,n=e.tagName,r=e.type,i=e.value,o=e.maskInputFn,a=i||"";return(t[n.toLowerCase()]||t[r])&&(a=o?o(a):"*".repeat(a.length)),a}!function(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||(e={}));var I="__rrweb_original__";var x,F,E=1,O=new RegExp("[^a-z0-9-_:]"),R=-2;function M(e){try{var t=e.rules||e.cssRules;return t?Array.from(t).map(T).join(""):null}catch(e){return null}}function T(e){var t=e.cssText;if(function(e){return"styleSheet"in e}(e))try{t=M(e.styleSheet)||t}catch(e){}return t}var P=/url\((?:(')([^']*)'|(")(.*?)"|([^)]*))\)/gm,N=/^(?!www\.|(?:http|ftp)s?:\/\/|[A-Za-z]:\\|\/\/|#).*/,L=/^(data:)([^,]*),(.*)/i;function D(e,t){return(e||"").replace(P,(function(e,n,r,i,o,a){var s,u=r||o||a,l=n||i||"";if(!u)return e;if(!N.test(u))return"url("+l+u+l+")";if(L.test(u))return"url("+l+u+l+")";if("/"===u[0])return"url("+l+(((s=t).indexOf("//")>-1?s.split("/").slice(0,3).join("/"):s.split("/")[0]).split("?")[0]+u)+l+")";var c=t.split("/"),d=u.split("/");c.pop();for(var f=0,p=d;f<p.length;f++){var h=p[f];"."!==h&&(".."===h?c.pop():c.push(h))}return"url("+l+c.join("/")+l+")"}))}var A,$,q,B,j,H,W=/^[^ \t\n\r\u000c]+/,V=/^[, \t\n\r\u000c]+/;function U(e,t){if(!t||""===t.trim())return t;var n=e.createElement("a");return n.href=t,n.href}function z(){var e=document.createElement("a");return e.href="",e.href}function G(e,t,n,r){return"src"===n||"href"===n&&r||"xlink:href"===n&&r&&"#"!==r[0]?U(e,r):"background"!==n||!r||"table"!==t&&"td"!==t&&"th"!==t?"srcset"===n&&r?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(V),!(n>=t.length);){var o=r(W);if(","===o.slice(-1))o=U(e,o.substring(0,o.length-1)),i.push(o);else{var a="";o=U(e,o);for(var s=!1;;){var u=t.charAt(n);if(""===u){i.push((o+a).trim());break}if(s)")"===u&&(s=!1);else{if(","===u){n+=1,i.push((o+a).trim());break}"("===u&&(s=!0)}a+=u,n+=1}}}return i.join(", ")}(e,r):"style"===n&&r?D(r,z()):"object"===t&&"data"===n&&r?U(e,r):r:U(e,r)}function Y(e,t,n){if(!e)return!1;if(e.nodeType===e.ELEMENT_NODE){if("string"==typeof t){if(e.classList.contains(t))return!0}else for(var r=0;r<e.classList.length;r++){var i=e.classList[r];if(t.test(i))return!0}return!(!n||!e.matches(n))||Y(e.parentNode,t,n)}return e.nodeType,e.TEXT_NODE,Y(e.parentNode,t,n)}function J(t,n){var r,i,o,a,s=n.doc,u=n.blockClass,l=n.blockSelector,c=n.maskTextClass,d=n.maskTextSelector,f=n.inlineStylesheet,p=n.maskInputOptions,h=void 0===p?{}:p,v=n.maskTextFn,g=n.maskInputFn,m=n.dataURLOptions,_=void 0===m?{}:m,y=n.inlineImages,b=n.recordCanvas,k=n.keepIframeSrcFn;if(s.__sn){var w=s.__sn.id;i=1===w?void 0:w}switch(t.nodeType){case t.DOCUMENT_NODE:return"CSS1Compat"!==t.compatMode?{type:e.Document,childNodes:[],compatMode:t.compatMode,rootId:i}:{type:e.Document,childNodes:[],rootId:i};case t.DOCUMENT_TYPE_NODE:return{type:e.DocumentType,name:t.name,publicId:t.publicId,systemId:t.systemId,rootId:i};case t.ELEMENT_NODE:for(var S=function(e,t,n){if("string"==typeof t){if(e.classList.contains(t))return!0}else for(var r=0;r<e.classList.length;r++){var i=e.classList[r];if(t.test(i))return!0}return!!n&&e.matches(n)}(t,u,l),E=function(e){if(e instanceof HTMLFormElement)return"form";var t=e.tagName.toLowerCase().trim();return O.test(t)?"div":t}(t),R={},T=0,P=Array.from(t.attributes);T<P.length;T++){var N=P[T],L=N.name,A=N.value;R[L]=G(s,E,L,A)}if("link"===E&&f){var $=Array.from(s.styleSheets).find((function(e){return e.href===t.href})),q=null;$&&(q=M($)),q&&(delete R.rel,delete R.href,R._cssText=D(q,$.href))}if("style"===E&&t.sheet&&!(t.innerText||t.textContent||"").trim().length)(q=M(t.sheet))&&(R._cssText=D(q,z()));if("input"===E||"textarea"===E||"select"===E){A=t.value;"radio"!==R.type&&"checkbox"!==R.type&&"submit"!==R.type&&"button"!==R.type&&A?R.value=C({type:R.type,tagName:E,value:A,maskInputOptions:h,maskInputFn:g}):t.checked&&(R.checked=t.checked)}if("option"===E&&(t.selected&&!h.select?R.selected=!0:delete R.selected),"canvas"===E&&b)if("2d"===t.__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=I in i?i[I]:i;if(new Uint32Array(o.call(t,n,r,Math.min(50,e.width-n),Math.min(50,e.height-r)).data.buffer).some((function(e){return 0!==e})))return!1}return!0})(t)||(R.rr_dataURL=t.toDataURL(_.type,_.quality));else if(!("__context"in t)){var B=t.toDataURL(_.type,_.quality),j=document.createElement("canvas");j.width=t.width,j.height=t.height,B!==j.toDataURL(_.type,_.quality)&&(R.rr_dataURL=B)}if("img"===E&&y){x||(x=s.createElement("canvas"),F=x.getContext("2d"));var H=t,W=H.crossOrigin;H.crossOrigin="anonymous";var V=function(){try{x.width=H.naturalWidth,x.height=H.naturalHeight,F.drawImage(H,0,0),R.rr_dataURL=x.toDataURL(_.type,_.quality)}catch(e){console.warn("Cannot inline img src="+H.currentSrc+"! Error: "+e)}W?R.crossOrigin=W:delete R.crossOrigin};H.complete&&0!==H.naturalWidth?V():H.onload=V}if("audio"!==E&&"video"!==E||(R.rr_mediaState=t.paused?"paused":"played",R.rr_mediaCurrentTime=t.currentTime),t.scrollLeft&&(R.rr_scrollLeft=t.scrollLeft),t.scrollTop&&(R.rr_scrollTop=t.scrollTop),S){var U=t.getBoundingClientRect(),J=U.width,Q=U.height;R={class:R.class,rr_width:J+"px",rr_height:Q+"px"}}return"iframe"!==E||k(R.src)||(t.contentDocument||(R.rr_src=R.src),delete R.src),{type:e.Element,tagName:E,attributes:R,childNodes:[],isSVG:(a=t,Boolean("svg"===a.tagName||a.ownerSVGElement)||void 0),needBlock:S,rootId:i};case t.TEXT_NODE:var X=t.parentNode&&t.parentNode.tagName,K=t.textContent,Z="STYLE"===X||void 0,ee="SCRIPT"===X||void 0;if(Z&&K){try{t.nextSibling||t.previousSibling||(null===(r=t.parentNode.sheet)||void 0===r?void 0:r.cssRules)&&(K=(o=t.parentNode.sheet).cssRules?Array.from(o.cssRules).map((function(e){return e.cssText||""})).join(""):"")}catch(e){console.warn("Cannot get CSS styles from text's parentNode. Error: "+e,t)}K=D(K,z())}return ee&&(K="SCRIPT_PLACEHOLDER"),!Z&&!ee&&Y(t,c,d)&&K&&(K=v?v(K):K.replace(/[\S]/g,"*")),{type:e.Text,textContent:K||"",isStyle:Z,rootId:i};case t.CDATA_SECTION_NODE:return{type:e.CDATA,textContent:"",rootId:i};case t.COMMENT_NODE:return{type:e.Comment,textContent:t.textContent||"",rootId:i};default:return!1}}function Q(e){return void 0===e?"":e.toLowerCase()}function X(t,n){var r,i=n.doc,o=n.map,a=n.blockClass,s=n.blockSelector,u=n.maskTextClass,l=n.maskTextSelector,c=n.skipChild,d=void 0!==c&&c,f=n.inlineStylesheet,p=void 0===f||f,h=n.maskInputOptions,v=void 0===h?{}:h,g=n.maskTextFn,m=n.maskInputFn,_=n.slimDOMOptions,y=n.dataURLOptions,b=void 0===y?{}:y,k=n.inlineImages,w=void 0!==k&&k,C=n.recordCanvas,I=void 0!==C&&C,x=n.onSerialize,F=n.onIframeLoad,O=n.iframeLoadTimeout,M=void 0===O?5e3:O,T=n.keepIframeSrcFn,P=void 0===T?function(){return!1}:T,N=n.preserveWhiteSpace,L=void 0===N||N,D=J(t,{doc:i,blockClass:a,blockSelector:s,maskTextClass:u,maskTextSelector:l,inlineStylesheet:p,maskInputOptions:v,maskTextFn:g,maskInputFn:m,dataURLOptions:b,inlineImages:w,recordCanvas:I,keepIframeSrcFn:P});if(!D)return console.warn(t,"not serialized"),null;r="__sn"in t?t.__sn.id:!function(t,n){if(n.comment&&t.type===e.Comment)return!0;if(t.type===e.Element){if(n.script&&("script"===t.tagName||"link"===t.tagName&&"preload"===t.attributes.rel&&"script"===t.attributes.as||"link"===t.tagName&&"prefetch"===t.attributes.rel&&"string"==typeof t.attributes.href&&t.attributes.href.endsWith(".js")))return!0;if(n.headFavicon&&("link"===t.tagName&&"shortcut icon"===t.attributes.rel||"meta"===t.tagName&&(Q(t.attributes.name).match(/^msapplication-tile(image|color)$/)||"application-name"===Q(t.attributes.name)||"icon"===Q(t.attributes.rel)||"apple-touch-icon"===Q(t.attributes.rel)||"shortcut icon"===Q(t.attributes.rel))))return!0;if("meta"===t.tagName){if(n.headMetaDescKeywords&&Q(t.attributes.name).match(/^description|keywords$/))return!0;if(n.headMetaSocial&&(Q(t.attributes.property).match(/^(og|twitter|fb):/)||Q(t.attributes.name).match(/^(og|twitter):/)||"pinterest"===Q(t.attributes.name)))return!0;if(n.headMetaRobots&&("robots"===Q(t.attributes.name)||"googlebot"===Q(t.attributes.name)||"bingbot"===Q(t.attributes.name)))return!0;if(n.headMetaHttpEquiv&&void 0!==t.attributes["http-equiv"])return!0;if(n.headMetaAuthorship&&("author"===Q(t.attributes.name)||"generator"===Q(t.attributes.name)||"framework"===Q(t.attributes.name)||"publisher"===Q(t.attributes.name)||"progid"===Q(t.attributes.name)||Q(t.attributes.property).match(/^article:/)||Q(t.attributes.property).match(/^product:/)))return!0;if(n.headMetaVerification&&("google-site-verification"===Q(t.attributes.name)||"yandex-verification"===Q(t.attributes.name)||"csrf-token"===Q(t.attributes.name)||"p:domain_verify"===Q(t.attributes.name)||"verify-v1"===Q(t.attributes.name)||"verification"===Q(t.attributes.name)||"shopify-checkout-api-token"===Q(t.attributes.name)))return!0}}return!1}(D,_)&&(L||D.type!==e.Text||D.isStyle||D.textContent.replace(/^\s+|\s+$/gm,"").length)?E++:R;var A=Object.assign(D,{id:r});if(t.__sn=A,r===R)return null;o[r]=t,x&&x(t);var $=!d;if(A.type===e.Element&&($=$&&!A.needBlock,delete A.needBlock,t.shadowRoot&&(A.isShadowHost=!0)),(A.type===e.Document||A.type===e.Element)&&$){_.headWhitespace&&D.type===e.Element&&"head"===D.tagName&&(L=!1);for(var q={doc:i,map:o,blockClass:a,blockSelector:s,maskTextClass:u,maskTextSelector:l,skipChild:d,inlineStylesheet:p,maskInputOptions:v,maskTextFn:g,maskInputFn:m,slimDOMOptions:_,dataURLOptions:b,inlineImages:w,recordCanvas:I,preserveWhiteSpace:L,onSerialize:x,onIframeLoad:F,iframeLoadTimeout:M,keepIframeSrcFn:P},B=0,j=Array.from(t.childNodes);B<j.length;B++){(V=X(j[B],q))&&A.childNodes.push(V)}if(function(e){return e.nodeType===e.ELEMENT_NODE}(t)&&t.shadowRoot)for(var H=0,W=Array.from(t.shadowRoot.childNodes);H<W.length;H++){var V;(V=X(W[H],q))&&(V.isShadow=!0,A.childNodes.push(V))}}return t.parentNode&&S(t.parentNode)&&(A.isShadow=!0),A.type===e.Element&&"iframe"===A.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 a="about:blank";r.location.href===a&&e.src!==a&&""!==e.src?e.addEventListener("load",t):setTimeout(t,0)}else{var s=setTimeout((function(){o||(t(),o=!0)}),n);e.addEventListener("load",(function(){clearTimeout(s),o=!0,t()}))}}}(t,(function(){var e=t.contentDocument;if(e&&F){var n=X(e,{doc:e,map:o,blockClass:a,blockSelector:s,maskTextClass:u,maskTextSelector:l,skipChild:!1,inlineStylesheet:p,maskInputOptions:v,maskTextFn:g,maskInputFn:m,slimDOMOptions:_,dataURLOptions:b,inlineImages:w,recordCanvas:I,preserveWhiteSpace:L,onSerialize:x,onIframeLoad:F,iframeLoadTimeout:M,keepIframeSrcFn:P});n&&F(t,n)}}),M),A}function K(e,t,n){void 0===n&&(n=document);var r={capture:!0,passive:!0};return n.addEventListener(e,t,r),function(){return n.removeEventListener(e,t,r)}}!function(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"}(A||(A={})),function(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"}($||($={})),function(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"}(q||(q={})),function(e){e[e["2D"]=0]="2D",e[e.WebGL=1]="WebGL",e[e.WebGL2=2]="WebGL2"}(B||(B={})),function(e){e[e.Play=0]="Play",e[e.Pause=1]="Pause",e[e.Seeked=2]="Seeked",e[e.VolumeChange=3]="VolumeChange"}(j||(j={})),function(e){e.Start="start",e.Pause="pause",e.Resume="resume",e.Resize="resize",e.Finish="finish",e.FullsnapshotRebuilded="fullsnapshot-rebuilded",e.LoadStylesheetStart="load-stylesheet-start",e.LoadStylesheetEnd="load-stylesheet-end",e.SkipStart="skip-start",e.SkipEnd="skip-end",e.MouseInteraction="mouse-interaction",e.EventCast="event-cast",e.CustomEvent="custom-event",e.Flush="flush",e.StateChange="state-change",e.PlayBack="play-back"}(H||(H={}));var Z="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.",ee={map:{},getId:function(){return console.error(Z),-1},getNode:function(){return console.error(Z),null},removeNodeFromMap:function(){console.error(Z)},has:function(){return console.error(Z),!1},reset:function(){console.error(Z)}};function te(e,t,n){void 0===n&&(n={});var r=null,i=0;return function(o){var a=Date.now();i||!1!==n.leading||(i=a);var s=t-(a-i),u=this,l=arguments;s<=0||s>t?(r&&(clearTimeout(r),r=null),i=a,e.apply(u,l)):r||!1===n.trailing||(r=setTimeout((function(){i=!1===n.leading?0:Date.now(),r=null,e.apply(u,l)}),s))}}function ne(e,t,n,r,i){void 0===i&&(i=window);var o=i.Object.getOwnPropertyDescriptor(e,t);return i.Object.defineProperty(e,t,r?n:{set:function(e){var t=this;setTimeout((function(){n.set.call(t,e)}),0),o&&o.set&&o.set.call(this,e)}}),function(){return ne(e,t,o||{},!0)}}function re(e,t,n){try{if(!(t in e))return function(){};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,function(){e[t]=r}}catch(e){return function(){}}}function ie(){return window.innerHeight||document.documentElement&&document.documentElement.clientHeight||document.body&&document.body.clientHeight}function oe(){return window.innerWidth||document.documentElement&&document.documentElement.clientWidth||document.body&&document.body.clientWidth}function ae(e,t){if(!e)return!1;if(e.nodeType===e.ELEMENT_NODE){var n=!1;if("string"==typeof t){if(void 0!==e.closest)return null!==e.closest("."+t);n=e.classList.contains(t)}else e.classList.forEach((function(e){t.test(e)&&(n=!0)}));return n||ae(e.parentNode,t)}return e.nodeType,e.TEXT_NODE,ae(e.parentNode,t)}function se(e){return"__sn"in e&&e.__sn.id===R}function ue(e,t){if(S(e))return!1;var n=t.getId(e);return!t.has(n)||(!e.parentNode||e.parentNode.nodeType!==e.DOCUMENT_NODE)&&(!e.parentNode||ue(e.parentNode,t))}function le(e){return Boolean(e.changedTouches)}function ce(t){return"__sn"in t&&(t.__sn.type===e.Element&&"iframe"===t.__sn.tagName)}function de(e){return Boolean(null==e?void 0:e.shadowRoot)}function fe(e){return"__ln"in e}"undefined"!=typeof window&&window.Proxy&&window.Reflect&&(ee=new Proxy(ee,{get:function(e,t,n){return"map"===t&&console.error(Z),Reflect.get(e,t,n)}}));var pe=function(){function e(){this.length=0,this.head=null}return e.prototype.get=function(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},e.prototype.addNode=function(e){var t={value:e,previous:null,next:null};if(e.__ln=t,e.previousSibling&&fe(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&&fe(e.nextSibling)&&e.nextSibling.__ln.previous){n=e.nextSibling.__ln.previous;t.previous=n,t.next=e.nextSibling.__ln,e.nextSibling.__ln.previous=t,n&&(n.next=t)}else this.head&&(this.head.previous=t),t.next=this.head,this.head=t;this.length++},e.prototype.removeNode=function(e){var t=e.__ln;this.head&&(t.previous?(t.previous.next=t.next,t.next&&(t.next.previous=t.previous)):(this.head=t.next,this.head&&(this.head.previous=null)),e.__ln&&delete e.__ln,this.length--)},e}(),he=function(e,t){return"".concat(e,"@").concat(t)};function ve(e){return"__sn"in e}var ge=function(){function e(){var e=this;this.frozen=!1,this.locked=!1,this.texts=[],this.attributes=[],this.removes=[],this.mapRemoves=[],this.movedMap={},this.addedSet=new Set,this.movedSet=new Set,this.droppedSet=new Set,this.processMutations=function(t){t.forEach(e.processMutation),e.emit()},this.emit=function(){var t,r,i,o;if(!e.frozen&&!e.locked){for(var a=[],s=new pe,u=function(t){for(var n=t,r=R;r===R;)r=(n=n&&n.nextSibling)&&e.mirror.getId(n);return r},l=function(t){for(var n,r,i,o,l,c=t.getRootNode?null===(n=t.getRootNode())||void 0===n?void 0:n.host:null,d=c;null===(i=null===(r=null==d?void 0:d.getRootNode)||void 0===r?void 0:r.call(d))||void 0===i?void 0:i.host;)d=(null===(l=null===(o=null==d?void 0:d.getRootNode)||void 0===o?void 0:o.call(d))||void 0===l?void 0:l.host)||null;var f=!(e.doc.contains(t)||null!==d&&e.doc.contains(d));if(t.parentNode&&!f){var p=S(t.parentNode)?e.mirror.getId(c):e.mirror.getId(t.parentNode),h=u(t);if(-1===p||-1===h)return s.addNode(t);var v=X(t,{doc:e.doc,map:e.mirror.map,blockClass:e.blockClass,blockSelector:e.blockSelector,maskTextClass:e.maskTextClass,maskTextSelector:e.maskTextSelector,skipChild:!0,inlineStylesheet:e.inlineStylesheet,maskInputOptions:e.maskInputOptions,maskTextFn:e.maskTextFn,maskInputFn:e.maskInputFn,slimDOMOptions:e.slimDOMOptions,recordCanvas:e.recordCanvas,inlineImages:e.inlineImages,onSerialize:function(n){ce(n)&&e.iframeManager.addIframe(n),de(t)&&e.shadowDomManager.addShadowRoot(t.shadowRoot,document)},onIframeLoad:function(t,n){e.iframeManager.attachIframe(t,n),e.shadowDomManager.observeAttachShadow(t)}});v&&a.push({parentId:p,nextId:h,node:v})}};e.mapRemoves.length;)e.mirror.removeNodeFromMap(e.mapRemoves.shift());try{for(var c=n(e.movedSet),d=c.next();!d.done;d=c.next()){var f=d.value;_e(e.removes,f,e.mirror)&&!e.movedSet.has(f.parentNode)||l(f)}}catch(e){t={error:e}}finally{try{d&&!d.done&&(r=c.return)&&r.call(c)}finally{if(t)throw t.error}}try{for(var p=n(e.addedSet),h=p.next();!h.done;h=p.next()){f=h.value;ye(e.droppedSet,f)||_e(e.removes,f,e.mirror)?ye(e.movedSet,f)?l(f):e.droppedSet.add(f):l(f)}}catch(e){i={error:e}}finally{try{h&&!h.done&&(o=p.return)&&o.call(p)}finally{if(i)throw i.error}}for(var v=null;s.length;){var g=null;if(v){var m=e.mirror.getId(v.value.parentNode),_=u(v.value);-1!==m&&-1!==_&&(g=v)}if(!g)for(var y=s.length-1;y>=0;y--){var b=s.get(y);if(b){m=e.mirror.getId(b.value.parentNode),_=u(b.value);if(-1!==m&&-1!==_){g=b;break}}}if(!g){for(;s.head;)s.removeNode(s.head.value);break}v=g.previous,s.removeNode(g.value),l(g.value)}var k={texts:e.texts.map((function(t){return{id:e.mirror.getId(t.node),value:t.value}})).filter((function(t){return e.mirror.has(t.id)})),attributes:e.attributes.map((function(t){return{id:e.mirror.getId(t.node),attributes:t.attributes}})).filter((function(t){return e.mirror.has(t.id)})),removes:e.removes,adds:a};(k.texts.length||k.attributes.length||k.removes.length||k.adds.length)&&(e.texts=[],e.attributes=[],e.removes=[],e.addedSet=new Set,e.movedSet=new Set,e.droppedSet=new Set,e.movedMap={},e.mutationCb(k))}},this.processMutation=function(t){var r,i,o,a;if(!se(t.target))switch(t.type){case"characterData":var s=t.target.textContent;ae(t.target,e.blockClass)||s===t.oldValue||e.texts.push({value:Y(t.target,e.maskTextClass,e.maskTextSelector)&&s?e.maskTextFn?e.maskTextFn(s):s.replace(/[\S]/g,"*"):s,node:t.target});break;case"attributes":var u=t.target;s=t.target.getAttribute(t.attributeName);if("value"===t.attributeName&&(s=C({maskInputOptions:e.maskInputOptions,tagName:t.target.tagName,type:t.target.getAttribute("type"),value:s,maskInputFn:e.maskInputFn})),ae(t.target,e.blockClass)||s===t.oldValue)return;var l=e.attributes.find((function(e){return e.node===t.target}));if(l||(l={node:t.target,attributes:{}},e.attributes.push(l)),"style"===t.attributeName){var c=e.doc.createElement("span");t.oldValue&&c.setAttribute("style",t.oldValue),void 0!==l.attributes.style&&null!==l.attributes.style||(l.attributes.style={});var d=l.attributes.style;try{for(var f=n(Array.from(u.style)),p=f.next();!p.done;p=f.next()){var h=p.value,v=u.style.getPropertyValue(h),g=u.style.getPropertyPriority(h);v===c.style.getPropertyValue(h)&&g===c.style.getPropertyPriority(h)||(d[h]=""===g?v:[v,g])}}catch(e){r={error:e}}finally{try{p&&!p.done&&(i=f.return)&&i.call(f)}finally{if(r)throw r.error}}try{for(var m=n(Array.from(c.style)),_=m.next();!_.done;_=m.next()){h=_.value;""===u.style.getPropertyValue(h)&&(d[h]=!1)}}catch(e){o={error:e}}finally{try{_&&!_.done&&(a=m.return)&&a.call(m)}finally{if(o)throw o.error}}}else l.attributes[t.attributeName]=G(e.doc,t.target.tagName,t.attributeName,s);break;case"childList":t.addedNodes.forEach((function(n){return e.genAdds(n,t.target)})),t.removedNodes.forEach((function(n){var r=e.mirror.getId(n),i=S(t.target)?e.mirror.getId(t.target.host):e.mirror.getId(t.target);ae(t.target,e.blockClass)||se(n)||(e.addedSet.has(n)?(me(e.addedSet,n),e.droppedSet.add(n)):e.addedSet.has(t.target)&&-1===r||ue(t.target,e.mirror)||(e.movedSet.has(n)&&e.movedMap[he(r,i)]?me(e.movedSet,n):e.removes.push({parentId:i,id:r,isShadow:!!S(t.target)||void 0})),e.mapRemoves.push(n))}))}},this.genAdds=function(t,n){if(!n||!ae(n,e.blockClass)){if(ve(t)){if(se(t))return;e.movedSet.add(t);var r=null;n&&ve(n)&&(r=n.__sn.id),r&&(e.movedMap[he(t.__sn.id,r)]=!0)}else e.addedSet.add(t),e.droppedSet.delete(t);ae(t,e.blockClass)||t.childNodes.forEach((function(t){return e.genAdds(t)}))}}}return e.prototype.init=function(e){var t=this;["mutationCb","blockClass","blockSelector","maskTextClass","maskTextSelector","inlineStylesheet","maskInputOptions","maskTextFn","maskInputFn","recordCanvas","inlineImages","slimDOMOptions","doc","mirror","iframeManager","shadowDomManager","canvasManager"].forEach((function(n){t[n]=e[n]}))},e.prototype.freeze=function(){this.frozen=!0,this.canvasManager.freeze()},e.prototype.unfreeze=function(){this.frozen=!1,this.canvasManager.unfreeze(),this.emit()},e.prototype.isFrozen=function(){return this.frozen},e.prototype.lock=function(){this.locked=!0,this.canvasManager.lock()},e.prototype.unlock=function(){this.locked=!1,this.canvasManager.unlock(),this.emit()},e.prototype.reset=function(){this.shadowDomManager.reset(),this.canvasManager.reset()},e}();function me(e,t){e.delete(t),t.childNodes.forEach((function(t){return me(e,t)}))}function _e(e,t,n){var r=t.parentNode;if(!r)return!1;var i=n.getId(r);return!!e.some((function(e){return e.id===i}))||_e(e,r,n)}function ye(e,t){var n=t.parentNode;return!!n&&(!!e.has(n)||ye(e,n))}var be=ge,ke=[],we="undefined"!=typeof CSSGroupingRule,Se="undefined"!=typeof CSSMediaRule,Ce="undefined"!=typeof CSSSupportsRule,Ie="undefined"!=typeof CSSConditionRule;function xe(e){try{if("composedPath"in e){var t=e.composedPath();if(t.length)return t[0]}else if("path"in e&&e.path.length)return e.path[0];return e.target}catch(t){return e.target}}function Fe(e,t){var n,r,i=new be;ke.push(i),i.init(e);var o=window.MutationObserver||window.__rrMutationObserver,a=null===(r=null===(n=null===window||void 0===window?void 0:window.Zone)||void 0===n?void 0:n.__symbol__)||void 0===r?void 0:r.call(n,"MutationObserver");a&&window[a]&&(o=window[a]);var s=new o(i.processMutations.bind(i));return s.observe(t,{attributes:!0,attributeOldValue:!0,characterData:!0,characterDataOldValue:!0,childList:!0,subtree:!0}),s}function Ee(e){var t=e.mouseInteractionCb,n=e.doc,r=e.mirror,i=e.blockClass,o=e.sampling;if(!1===o.mouseInteraction)return function(){};var a=!0===o.mouseInteraction||void 0===o.mouseInteraction?{}:o.mouseInteraction,s=[];return Object.keys(q).filter((function(e){return Number.isNaN(Number(e))&&!e.endsWith("_Departed")&&!1!==a[e]})).forEach((function(e){var o=e.toLowerCase(),a=function(e){return function(n){var o=xe(n);if(!ae(o,i)){var a=le(n)?n.changedTouches[0]:n;if(a){var s=r.getId(o),u=a.clientX,l=a.clientY;t({type:q[e],id:s,x:u,y:l})}}}}(e);s.push(K(o,a,n))})),function(){s.forEach((function(e){return e()}))}}function Oe(e){var t=e.scrollCb,n=e.doc,r=e.mirror,i=e.blockClass;return K("scroll",te((function(e){var o=xe(e);if(o&&!ae(o,i)){var a=r.getId(o);if(o===n){var s=n.scrollingElement||n.documentElement;t({id:a,x:s.scrollLeft,y:s.scrollTop})}else t({id:a,x:o.scrollLeft,y:o.scrollTop})}}),e.sampling.scroll||100),n)}function Re(e,n){var r=t({},e);return n||delete r.userTriggered,r}var Me=["INPUT","TEXTAREA","SELECT"],Te=new WeakMap;function Pe(e){return function(e,t){if(we&&e.parentRule instanceof CSSGroupingRule||Se&&e.parentRule instanceof CSSMediaRule||Ce&&e.parentRule instanceof CSSSupportsRule||Ie&&e.parentRule instanceof CSSConditionRule){var n=Array.from(e.parentRule.cssRules).indexOf(e);t.unshift(n)}else{n=Array.from(e.parentStyleSheet.cssRules).indexOf(e);t.unshift(n)}return t}(e,[])}function Ne(e,o){var a,s;void 0===o&&(o={});var u=e.doc.defaultView;if(!u)return function(){};!function(e,t){var n=e.mutationCb,o=e.mousemoveCb,a=e.mouseInteractionCb,s=e.scrollCb,u=e.viewportResizeCb,l=e.inputCb,c=e.mediaInteractionCb,d=e.styleSheetRuleCb,f=e.styleDeclarationCb,p=e.canvasMutationCb,h=e.fontCb;e.mutationCb=function(){for(var e=[],o=0;o<arguments.length;o++)e[o]=arguments[o];t.mutation&&t.mutation.apply(t,i([],r(e),!1)),n.apply(void 0,i([],r(e),!1))},e.mousemoveCb=function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];t.mousemove&&t.mousemove.apply(t,i([],r(e),!1)),o.apply(void 0,i([],r(e),!1))},e.mouseInteractionCb=function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];t.mouseInteraction&&t.mouseInteraction.apply(t,i([],r(e),!1)),a.apply(void 0,i([],r(e),!1))},e.scrollCb=function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];t.scroll&&t.scroll.apply(t,i([],r(e),!1)),s.apply(void 0,i([],r(e),!1))},e.viewportResizeCb=function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];t.viewportResize&&t.viewportResize.apply(t,i([],r(e),!1)),u.apply(void 0,i([],r(e),!1))},e.inputCb=function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];t.input&&t.input.apply(t,i([],r(e),!1)),l.apply(void 0,i([],r(e),!1))},e.mediaInteractionCb=function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];t.mediaInteaction&&t.mediaInteaction.apply(t,i([],r(e),!1)),c.apply(void 0,i([],r(e),!1))},e.styleSheetRuleCb=function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];t.styleSheetRule&&t.styleSheetRule.apply(t,i([],r(e),!1)),d.apply(void 0,i([],r(e),!1))},e.styleDeclarationCb=function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];t.styleDeclaration&&t.styleDeclaration.apply(t,i([],r(e),!1)),f.apply(void 0,i([],r(e),!1))},e.canvasMutationCb=function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];t.canvasMutation&&t.canvasMutation.apply(t,i([],r(e),!1)),p.apply(void 0,i([],r(e),!1))},e.fontCb=function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];t.font&&t.font.apply(t,i([],r(e),!1)),h.apply(void 0,i([],r(e),!1))}}(e,o);var l=Fe(e,e.doc),c=function(e){var t=e.mousemoveCb,n=e.sampling,r=e.doc,i=e.mirror;if(!1===n.mousemove)return function(){};var o,a="number"==typeof n.mousemove?n.mousemove:50,s="number"==typeof n.mousemoveCallback?n.mousemoveCallback:500,u=[],l=te((function(e){var n=Date.now()-o;t(u.map((function(e){return e.timeOffset-=n,e})),e),u=[],o=null}),s),c=te((function(e){var t=xe(e),n=le(e)?e.changedTouches[0]:e,r=n.clientX,a=n.clientY;o||(o=Date.now()),u.push({x:r,y:a,id:i.getId(t),timeOffset:Date.now()-o}),l("undefined"!=typeof DragEvent&&e instanceof DragEvent?$.Drag:e instanceof MouseEvent?$.MouseMove:$.TouchMove)}),a,{trailing:!1}),d=[K("mousemove",c,r),K("touchmove",c,r),K("drag",c,r)];return function(){d.forEach((function(e){return e()}))}}(e),d=Ee(e),f=Oe(e),p=function(e){var t=e.viewportResizeCb,n=-1,r=-1;return K("resize",te((function(){var e=ie(),i=oe();n===e&&r===i||(t({width:Number(i),height:Number(e)}),n=e,r=i)}),200),window)}(e),h=function(e){var n=e.inputCb,o=e.doc,a=e.mirror,s=e.blockClass,u=e.ignoreClass,l=e.maskInputOptions,c=e.maskInputFn,d=e.sampling,f=e.userTriggeredOnInput;function p(e){var t=xe(e),n=e.isTrusted;if(t&&"OPTION"===t.tagName&&(t=t.parentElement),t&&t.tagName&&!(Me.indexOf(t.tagName)<0)&&!ae(t,s)){var r=t.type;if(!t.classList.contains(u)){var i=t.value,a=!1;"radio"===r||"checkbox"===r?a=t.checked:(l[t.tagName.toLowerCase()]||l[r])&&(i=C({maskInputOptions:l,tagName:t.tagName,type:r,value:i,maskInputFn:c})),h(t,Re({text:i,isChecked:a,userTriggered:n},f));var d=t.name;"radio"===r&&d&&a&&o.querySelectorAll('input[type="radio"][name="'.concat(d,'"]')).forEach((function(e){e!==t&&h(e,Re({text:e.value,isChecked:!a,userTriggered:!1},f))}))}}}function h(e,r){var i=Te.get(e);if(!i||i.text!==r.text||i.isChecked!==r.isChecked){Te.set(e,r);var o=a.getId(e);n(t(t({},r),{id:o}))}}var v=("last"===d.input?["change"]:["input","change"]).map((function(e){return K(e,p,o)})),g=Object.getOwnPropertyDescriptor(HTMLInputElement.prototype,"value"),m=[[HTMLInputElement.prototype,"value"],[HTMLInputElement.prototype,"checked"],[HTMLSelectElement.prototype,"value"],[HTMLTextAreaElement.prototype,"value"],[HTMLSelectElement.prototype,"selectedIndex"],[HTMLOptionElement.prototype,"selected"]];return g&&g.set&&v.push.apply(v,i([],r(m.map((function(e){return ne(e[0],e[1],{set:function(){p({target:this})}})}))),!1)),function(){v.forEach((function(e){return e()}))}}(e),v=function(e){var t=e.mediaInteractionCb,n=e.blockClass,r=e.mirror,i=e.sampling,o=function(e){return te((function(i){var o=xe(i);if(o&&!ae(o,n)){var a=o,s=a.currentTime,u=a.volume,l=a.muted;t({type:e,id:r.getId(o),currentTime:s,volume:u,muted:l})}}),i.media||500)},a=[K("play",o(0)),K("pause",o(1)),K("seeked",o(2)),K("volumechange",o(3))];return function(){a.forEach((function(e){return e()}))}}(e),g=function(e,t){var n=e.styleSheetRuleCb,o=e.mirror,a=t.win,s=a.CSSStyleSheet.prototype.insertRule;a.CSSStyleSheet.prototype.insertRule=function(e,t){var r=o.getId(this.ownerNode);return-1!==r&&n({id:r,adds:[{rule:e,index:t}]}),s.apply(this,arguments)};var u=a.CSSStyleSheet.prototype.deleteRule;a.CSSStyleSheet.prototype.deleteRule=function(e){var t=o.getId(this.ownerNode);return-1!==t&&n({id:t,removes:[{index:e}]}),u.apply(this,arguments)};var l={};we?l.CSSGroupingRule=a.CSSGroupingRule:(Se&&(l.CSSMediaRule=a.CSSMediaRule),Ie&&(l.CSSConditionRule=a.CSSConditionRule),Ce&&(l.CSSSupportsRule=a.CSSSupportsRule));var c={};return Object.entries(l).forEach((function(e){var t=r(e,2),a=t[0],s=t[1];c[a]={insertRule:s.prototype.insertRule,deleteRule:s.prototype.deleteRule},s.prototype.insertRule=function(e,t){var s=o.getId(this.parentStyleSheet.ownerNode);return-1!==s&&n({id:s,adds:[{rule:e,index:i(i([],r(Pe(this)),!1),[t||0],!1)}]}),c[a].insertRule.apply(this,arguments)},s.prototype.deleteRule=function(e){var t=o.getId(this.parentStyleSheet.ownerNode);return-1!==t&&n({id:t,removes:[{index:i(i([],r(Pe(this)),!1),[e],!1)}]}),c[a].deleteRule.apply(this,arguments)}})),function(){a.CSSStyleSheet.prototype.insertRule=s,a.CSSStyleSheet.prototype.deleteRule=u,Object.entries(l).forEach((function(e){var t=r(e,2),n=t[0],i=t[1];i.prototype.insertRule=c[n].insertRule,i.prototype.deleteRule=c[n].deleteRule}))}}(e,{win:u}),m=function(e,t){var n=e.styleDeclarationCb,r=e.mirror,i=t.win,o=i.CSSStyleDeclaration.prototype.setProperty;i.CSSStyleDeclaration.prototype.setProperty=function(e,t,i){var a,s,u=r.getId(null===(s=null===(a=this.parentRule)||void 0===a?void 0:a.parentStyleSheet)||void 0===s?void 0:s.ownerNode);return-1!==u&&n({id:u,set:{property:e,value:t,priority:i},index:Pe(this.parentRule)}),o.apply(this,arguments)};var a=i.CSSStyleDeclaration.prototype.removeProperty;return i.CSSStyleDeclaration.prototype.removeProperty=function(e){var t,i,o=r.getId(null===(i=null===(t=this.parentRule)||void 0===t?void 0:t.parentStyleSheet)||void 0===i?void 0:i.ownerNode);return-1!==o&&n({id:o,remove:{property:e},index:Pe(this.parentRule)}),a.apply(this,arguments)},function(){i.CSSStyleDeclaration.prototype.setProperty=o,i.CSSStyleDeclaration.prototype.removeProperty=a}}(e,{win:u}),_=e.collectFonts?function(e){var t=e.fontCb,n=e.doc,r=n.defaultView;if(!r)return function(){};var i=[],o=new WeakMap,a=r.FontFace;r.FontFace=function(e,t,n){var r=new a(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 s=re(n.fonts,"add",(function(e){return function(n){return setTimeout((function(){var e=o.get(n);e&&(t(e),o.delete(n))}),0),e.apply(this,[n])}}));return i.push((function(){r.FontFace=a})),i.push(s),function(){i.forEach((function(e){return e()}))}}(e):function(){},y=[];try{for(var b=n(e.plugins),k=b.next();!k.done;k=b.next()){var w=k.value;y.push(w.observer(w.callback,u,w.options))}}catch(e){a={error:e}}finally{try{k&&!k.done&&(s=b.return)&&s.call(b)}finally{if(a)throw a.error}}return function(){ke.forEach((function(e){return e.reset()})),l.disconnect(),c(),d(),f(),p(),h(),v(),g(),m(),_(),y.forEach((function(e){return e()}))}}var Le=function(){function e(e){this.iframes=new WeakMap,this.mutationCb=e.mutationCb}return e.prototype.addIframe=function(e){this.iframes.set(e,!0)},e.prototype.addLoadListener=function(e){this.loadListener=e},e.prototype.attachIframe=function(e,t){var n;this.mutationCb({adds:[{parentId:e.__sn.id,nextId:null,node:t}],removes:[],texts:[],attributes:[],isAttachIframe:!0}),null===(n=this.loadListener)||void 0===n||n.call(this,e)},e}(),De=function(){function e(e){this.restorePatches=[],this.mutationCb=e.mutationCb,this.scrollCb=e.scrollCb,this.bypassOptions=e.bypassOptions,this.mirror=e.mirror;var t=this;this.restorePatches.push(re(HTMLElement.prototype,"attachShadow",(function(e){return function(){var n=e.apply(this,arguments);return this.shadowRoot&&t.addShadowRoot(this.shadowRoot,this.ownerDocument),n}})))}return e.prototype.addShadowRoot=function(e,n){Fe(t(t({},this.bypassOptions),{doc:n,mutationCb:this.mutationCb,mirror:this.mirror,shadowDomManager:this}),e),Oe(t(t({},this.bypassOptions),{scrollCb:this.scrollCb,doc:e,mirror:this.mirror}))},e.prototype.observeAttachShadow=function(e){if(e.contentWindow){var t=this;this.restorePatches.push(re(e.contentWindow.HTMLElement.prototype,"attachShadow",(function(n){return function(){var r=n.apply(this,arguments);return this.shadowRoot&&t.addShadowRoot(this.shadowRoot,e.contentDocument),r}})))}},e.prototype.reset=function(){this.restorePatches.forEach((function(e){return e()}))},e}();for(var Ae="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",$e="undefined"==typeof Uint8Array?[]:new Uint8Array(256),qe=0;qe<Ae.length;qe++)$e[Ae.charCodeAt(qe)]=qe;var Be=function(e){var t,n=new Uint8Array(e),r=n.length,i="";for(t=0;t<r;t+=3)i+=Ae[n[t]>>2],i+=Ae[(3&n[t])<<4|n[t+1]>>4],i+=Ae[(15&n[t+1])<<2|n[t+2]>>6],i+=Ae[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},je=new Map;var He=function(e,t,n){if(e&&(Ue(e,t)||"object"===s(e))){var r=function(e,t){var n=je.get(e);return n||(n=new Map,je.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 We(e,t,n){return e instanceof Array?e.map((function(e){return We(e,t,n)})):null===e?e: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?{rr_type:e.constructor.name,args:[Object.values(e)]}:e instanceof ArrayBuffer?{rr_type:e.constructor.name,base64:Be(e)}:e instanceof DataView?{rr_type:e.constructor.name,args:[We(e.buffer,t,n),e.byteOffset,e.byteLength]}:e instanceof HTMLImageElement?{rr_type:e.constructor.name,src:e.src}:e instanceof ImageData?{rr_type:e.constructor.name,args:[We(e.data,t,n),e.width,e.height]}:Ue(e,t)||"object"===s(e)?{rr_type:e.constructor.name,index:He(e,t,n)}:e}var Ve=function(e,t,n){return i([],r(e),!1).map((function(e){return We(e,t,n)}))},Ue=function(e,t){var n=["WebGLActiveInfo","WebGLBuffer","WebGLFramebuffer","WebGLProgram","WebGLRenderbuffer","WebGLShader","WebGLShaderPrecisionFormat","WebGLTexture","WebGLUniformLocation","WebGLVertexArrayObject","WebGLVertexArrayObjectOES"].filter((function(e){return"function"==typeof t[e]}));return Boolean(n.find((function(n){return e instanceof t[n]})))};function ze(e,t,o,a,s,u){var l,c,d=[],f=Object.getOwnPropertyNames(e),p=function(n){try{if("function"!=typeof e[n])return"continue";var l=re(e,n,(function(l){return function(){for(var c=[],d=0;d<arguments.length;d++)c[d]=arguments[d];var f=l.apply(this,c);if(He(f,u,e),!ae(this.canvas,a)){s.getId(this.canvas);var p=Ve(i([],r(c),!1),u,e),h={type:t,property:n,args:p};o(this.canvas,h)}return f}}));d.push(l)}catch(r){var c=ne(e,n,{set:function(e){o(this.canvas,{type:t,property:n,args:[e],setter:!0})}});d.push(c)}};try{for(var h=n(f),v=h.next();!v.done;v=h.next()){p(v.value)}}catch(e){l={error:e}}finally{try{v&&!v.done&&(c=h.return)&&c.call(h)}finally{if(l)throw l.error}}return d}var Ge,Ye,Je=function(){function e(e){this.pendingCanvasMutations=new Map,this.rafStamps={latestId:0,invokeId:null},this.frozen=!1,this.locked=!1,this.processMutation=function(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)},this.mutationCb=e.mutationCb,this.mirror=e.mirror,!0===e.recordCanvas&&this.initCanvasMutationObserver(e.win,e.blockClass)}return e.prototype.reset=function(){this.pendingCanvasMutations.clear(),this.resetObservers&&this.resetObservers()},e.prototype.freeze=function(){this.frozen=!0},e.prototype.unfreeze=function(){this.frozen=!1},e.prototype.lock=function(){this.locked=!0},e.prototype.unlock=function(){this.locked=!1},e.prototype.initCanvasMutationObserver=function(e,t){this.startRAFTimestamping(),this.startPendingCanvasMutationFlusher();var o=function(e,t){var n=[];try{var o=re(e.HTMLCanvasElement.prototype,"getContext",(function(e){return function(n){for(var o=[],a=1;a<arguments.length;a++)o[a-1]=arguments[a];return ae(this,t)||"__context"in this||(this.__context=n),e.apply(this,i([n],r(o),!1))}}));n.push(o)}catch(e){console.error("failed to patch HTMLCanvasElement.prototype.getContext")}return function(){n.forEach((function(e){return e()}))}}(e,t),a=function(e,t,o,a){var s,u,l=[],c=Object.getOwnPropertyNames(t.CanvasRenderingContext2D.prototype),d=function(n){try{if("function"!=typeof t.CanvasRenderingContext2D.prototype[n])return"continue";var a=re(t.CanvasRenderingContext2D.prototype,n,(function(t){return function(){for(var a=this,s=[],u=0;u<arguments.length;u++)s[u]=arguments[u];return ae(this.canvas,o)||setTimeout((function(){var t=i([],r(s),!1);if("drawImage"===n&&t[0]&&t[0]instanceof HTMLCanvasElement){var o=t[0],u=o.getContext("2d"),l=null==u?void 0:u.getImageData(0,0,o.width,o.height),c=null==l?void 0:l.data;t[0]=JSON.stringify(c)}e(a.canvas,{type:B["2D"],property:n,args:t})}),0),t.apply(this,s)}}));l.push(a)}catch(r){var s=ne(t.CanvasRenderingContext2D.prototype,n,{set:function(t){e(this.canvas,{type:B["2D"],property:n,args:[t],setter:!0})}});l.push(s)}};try{for(var f=n(c),p=f.next();!p.done;p=f.next())d(p.value)}catch(e){s={error:e}}finally{try{p&&!p.done&&(u=f.return)&&u.call(f)}finally{if(s)throw s.error}}return function(){l.forEach((function(e){return e()}))}}(this.processMutation.bind(this),e,t,this.mirror),s=function(e,t,n,o){var a=[];return a.push.apply(a,i([],r(ze(t.WebGLRenderingContext.prototype,B.WebGL,e,n,o,t)),!1)),void 0!==t.WebGL2RenderingContext&&a.push.apply(a,i([],r(ze(t.WebGL2RenderingContext.prototype,B.WebGL2,e,n,o,t)),!1)),function(){a.forEach((function(e){return e()}))}}(this.processMutation.bind(this),e,t,this.mirror);this.resetObservers=function(){o(),a(),s()}},e.prototype.startPendingCanvasMutationFlusher=function(){var e=this;requestAnimationFrame((function(){return e.flushPendingCanvasMutations()}))},e.prototype.startRAFTimestamping=function(){var e=this;requestAnimationFrame((function t(n){e.rafStamps.latestId=n,requestAnimationFrame(t)}))},e.prototype.flushPendingCanvasMutations=function(){var e=this;this.pendingCanvasMutations.forEach((function(t,n){var r=e.mirror.getId(n);e.flushPendingCanvasMutationFor(n,r)})),requestAnimationFrame((function(){return e.flushPendingCanvasMutations()}))},e.prototype.flushPendingCanvasMutationFor=function(e,t){if(!this.frozen&&!this.locked){var n=this.pendingCanvasMutations.get(e);if(n&&-1!==t){var r=n.map((function(e){e.type;var t=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]])}return n}(e,["type"]);return t})),i=n[0].type;this.mutationCb({id:t,type:i,commands:r}),this.pendingCanvasMutations.delete(e)}}},e}();function Qe(e){return t(t({},e),{timestamp:Date.now()})}var Xe={map:{},getId:function(e){return e&&e.__sn?e.__sn.id:-1},getNode:function(e){return this.map[e]||null},removeNodeFromMap:function(e){var t=this,n=e.__sn&&e.__sn.id;delete this.map[n],e.childNodes&&e.childNodes.forEach((function(e){return t.removeNodeFromMap(e)}))},has:function(e){return this.map.hasOwnProperty(e)},reset:function(){this.map={}}};function Ke(e){void 0===e&&(e={});var i=e.emit,o=e.checkoutEveryNms,a=e.checkoutEveryNth,s=e.blockClass,u=void 0===s?"rr-block":s,l=e.blockSelector,c=void 0===l?null:l,d=e.ignoreClass,f=void 0===d?"rr-ignore":d,p=e.maskTextClass,h=void 0===p?"rr-mask":p,v=e.maskTextSelector,g=void 0===v?null:v,m=e.inlineStylesheet,_=void 0===m||m,y=e.maskAllInputs,b=e.maskInputOptions,k=e.slimDOMOptions,w=e.maskInputFn,S=e.maskTextFn,C=e.hooks,I=e.packFn,x=e.sampling,F=void 0===x?{}:x,E=e.mousemoveWait,O=e.recordCanvas,R=void 0!==O&&O,M=e.userTriggeredOnInput,T=void 0!==M&&M,P=e.collectFonts,N=void 0!==P&&P,L=e.inlineImages,D=void 0!==L&&L,q=e.plugins,B=e.keepIframeSrcFn,j=void 0===B?function(){return!1}:B;if(!i)throw new Error("emit function is required");void 0!==E&&void 0===F.mousemove&&(F.mousemove=E);var H,W=!0===y?{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!==b?b:{password:!0},V=!0===k||"all"===k?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaVerification:!0,headMetaAuthorship:"all"===k,headMetaDescKeywords:"all"===k}:k||{};!function(e){void 0===e&&(e=window),"NodeList"in e&&!e.NodeList.prototype.forEach&&(e.NodeList.prototype.forEach=Array.prototype.forEach),"DOMTokenList"in e&&!e.DOMTokenList.prototype.forEach&&(e.DOMTokenList.prototype.forEach=Array.prototype.forEach),Node.prototype.contains||(Node.prototype.contains=function(e){if(!(0 in arguments))throw new TypeError("1 argument is required");do{if(this===e)return!0}while(e=e&&e.parentNode);return!1})}();var U=0;Ge=function(e,t){var r;if(!(null===(r=ke[0])||void 0===r?void 0:r.isFrozen())||e.type===A.FullSnapshot||e.type===A.IncrementalSnapshot&&e.data.source===$.Mutation||ke.forEach((function(e){return e.unfreeze()})),i(function(e){var t,r;try{for(var i=n(q||[]),o=i.next();!o.done;o=i.next()){var a=o.value;a.eventProcessor&&(e=a.eventProcessor(e))}}catch(e){t={error:e}}finally{try{o&&!o.done&&(r=i.return)&&r.call(i)}finally{if(t)throw t.error}}return I&&(e=I(e)),e}(e),t),e.type===A.FullSnapshot)H=e,U=0;else if(e.type===A.IncrementalSnapshot){if(e.data.source===$.Mutation&&e.data.isAttachIframe)return;U++;var s=a&&U>=a,u=o&&e.timestamp-H.timestamp>o;(s||u)&&Ye(!0)}};var z=function(e){Ge(Qe({type:A.IncrementalSnapshot,data:t({source:$.Mutation},e)}))},G=function(e){return Ge(Qe({type:A.IncrementalSnapshot,data:t({source:$.Scroll},e)}))},Y=function(e){return Ge(Qe({type:A.IncrementalSnapshot,data:t({source:$.CanvasMutation},e)}))},J=new Le({mutationCb:z}),Q=new Je({recordCanvas:R,mutationCb:Y,win:window,blockClass:u,mirror:Xe}),Z=new De({mutationCb:z,scrollCb:G,bypassOptions:{blockClass:u,blockSelector:c,maskTextClass:h,maskTextSelector:g,inlineStylesheet:_,maskInputOptions:W,maskTextFn:S,maskInputFn:w,recordCanvas:R,inlineImages:D,sampling:F,slimDOMOptions:V,iframeManager:J,canvasManager:Q},mirror:Xe});Ye=function(e){var t,n,i,o;void 0===e&&(e=!1),Ge(Qe({type:A.Meta,data:{href:window.location.href,width:oe(),height:ie()}}),e),ke.forEach((function(e){return e.lock()}));var a=r(function(e,t){var n=t||{},r=n.blockClass,i=void 0===r?"rr-block":r,o=n.blockSelector,a=void 0===o?null:o,s=n.maskTextClass,u=void 0===s?"rr-mask":s,l=n.maskTextSelector,c=void 0===l?null:l,d=n.inlineStylesheet,f=void 0===d||d,p=n.inlineImages,h=void 0!==p&&p,v=n.recordCanvas,g=void 0!==v&&v,m=n.maskAllInputs,_=void 0!==m&&m,y=n.maskTextFn,b=n.maskInputFn,k=n.slimDOM,w=void 0!==k&&k,S=n.dataURLOptions,C=n.preserveWhiteSpace,I=n.onSerialize,x=n.onIframeLoad,F=n.iframeLoadTimeout,E=n.keepIframeSrcFn,O={};return[X(e,{doc:e,map:O,blockClass:i,blockSelector:a,maskTextClass:u,maskTextSelector:c,skipChild:!1,inlineStylesheet:f,maskInputOptions:!0===_?{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===_?{password:!0}:_,maskTextFn:y,maskInputFn:b,slimDOMOptions:!0===w||"all"===w?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaDescKeywords:"all"===w,headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaAuthorship:!0,headMetaVerification:!0}:!1===w?{}:w,dataURLOptions:S,inlineImages:h,recordCanvas:g,preserveWhiteSpace:C,onSerialize:I,onIframeLoad:x,iframeLoadTimeout:F,keepIframeSrcFn:void 0===E?function(){return!1}:E}),O]}(document,{blockClass:u,blockSelector:c,maskTextClass:h,maskTextSelector:g,inlineStylesheet:_,maskAllInputs:W,maskTextFn:S,slimDOM:V,recordCanvas:R,inlineImages:D,onSerialize:function(e){ce(e)&&J.addIframe(e),de(e)&&Z.addShadowRoot(e.shadowRoot,document)},onIframeLoad:function(e,t){J.attachIframe(e,t),Z.observeAttachShadow(e)},keepIframeSrcFn:j}),2),s=a[0],l=a[1];if(!s)return console.warn("Failed to snapshot the document");Xe.map=l,Ge(Qe({type:A.FullSnapshot,data:{node:s,initialOffset:{left:void 0!==window.pageXOffset?window.pageXOffset:(null===document||void 0===document?void 0:document.documentElement.scrollLeft)||(null===(n=null===(t=null===document||void 0===document?void 0:document.body)||void 0===t?void 0:t.parentElement)||void 0===n?void 0:n.scrollLeft)||(null===document||void 0===document?void 0:document.body.scrollLeft)||0,top:void 0!==window.pageYOffset?window.pageYOffset:(null===document||void 0===document?void 0:document.documentElement.scrollTop)||(null===(o=null===(i=null===document||void 0===document?void 0:document.body)||void 0===i?void 0:i.parentElement)||void 0===o?void 0:o.scrollTop)||(null===document||void 0===document?void 0:document.body.scrollTop)||0}}})),ke.forEach((function(e){return e.unlock()}))};try{var ee=[];ee.push(K("DOMContentLoaded",(function(){Ge(Qe({type:A.DomContentLoaded,data:{}}))})));var te=function(e){var n;return Ne({mutationCb:z,mousemoveCb:function(e,t){return Ge(Qe({type:A.IncrementalSnapshot,data:{source:t,positions:e}}))},mouseInteractionCb:function(e){return Ge(Qe({type:A.IncrementalSnapshot,data:t({source:$.MouseInteraction},e)}))},scrollCb:G,viewportResizeCb:function(e){return Ge(Qe({type:A.IncrementalSnapshot,data:t({source:$.ViewportResize},e)}))},inputCb:function(e){return Ge(Qe({type:A.IncrementalSnapshot,data:t({source:$.Input},e)}))},mediaInteractionCb:function(e){return Ge(Qe({type:A.IncrementalSnapshot,data:t({source:$.MediaInteraction},e)}))},styleSheetRuleCb:function(e){return Ge(Qe({type:A.IncrementalSnapshot,data:t({source:$.StyleSheetRule},e)}))},styleDeclarationCb:function(e){return Ge(Qe({type:A.IncrementalSnapshot,data:t({source:$.StyleDeclaration},e)}))},canvasMutationCb:Y,fontCb:function(e){return Ge(Qe({type:A.IncrementalSnapshot,data:t({source:$.Font},e)}))},blockClass:u,ignoreClass:f,maskTextClass:h,maskTextSelector:g,maskInputOptions:W,inlineStylesheet:_,sampling:F,recordCanvas:R,inlineImages:D,userTriggeredOnInput:T,collectFonts:N,doc:e,maskInputFn:w,maskTextFn:S,blockSelector:c,slimDOMOptions:V,mirror:Xe,iframeManager:J,shadowDomManager:Z,canvasManager:Q,plugins:(null===(n=null==q?void 0:q.filter((function(e){return e.observer})))||void 0===n?void 0:n.map((function(e){return{observer:e.observer,options:e.options,callback:function(t){return Ge(Qe({type:A.Plugin,data:{plugin:e.name,payload:t}}))}}})))||[]},C)};J.addLoadListener((function(e){ee.push(te(e.contentDocument))}));var ne=function(){Ye(),ee.push(te(document))};return"interactive"===document.readyState||"complete"===document.readyState?ne():ee.push(K("load",(function(){Ge(Qe({type:A.Load,data:{}})),ne()}),window)),function(){ee.forEach((function(e){return e()}))}}catch(e){console.warn(e)}}Ke.addCustomEvent=function(e,t){if(!Ge)throw new Error("please add custom event after start recording");Ge(Qe({type:A.Custom,data:{tag:e,payload:t}}))},Ke.freezePage=function(){ke.forEach((function(e){return e.freeze()}))},Ke.takeFullSnapshot=function(e){if(!Ye)throw new Error("please take full snapshot after start recording");Ye(e)},Ke.mirror=Xe;var Ze=function(){function e(e){this.fileName=e.fileName||"",this.functionName=e.functionName||"",this.lineNumber=e.lineNumber,this.columnNumber=e.columnNumber}return e.prototype.toString=function(){var e=this.lineNumber||"",t=this.columnNumber||"";return this.functionName?this.functionName+" ("+this.fileName+":"+e+":"+t+")":this.fileName+":"+e+":"+t},e}(),et=/(^|@)\S+:\d+/,tt=/^\s*at .*(\S+:\d+|\(native\))/m,nt=/^(eval@)?(\[native code])?$/,rt={parse:function(e){if(!e)return[];if(void 0!==e.stacktrace||void 0!==e["opera#sourceloc"])return this.parseOpera(e);if(e.stack&&e.stack.match(tt))return this.parseV8OrIE(e);if(e.stack)return this.parseFFOrSafari(e);throw new Error("Cannot parse given Error object")},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(tt)}),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,a=["eval","<anonymous>"].indexOf(i[0])>-1?void 0:i[0];return new Ze({functionName:o,fileName:a,lineNumber:i[1],columnNumber:i[2]})}),this)},parseFFOrSafari:function(e){return e.stack.split("\n").filter((function(e){return!e.match(nt)}),this).map((function(e){if(e.indexOf(" > eval")>-1&&(e=e.replace(/ line (\d+)(?: > eval line \d+)* > eval:\d+:\d+/g,":$1")),-1===e.indexOf("@")&&-1===e.indexOf(":"))return new Ze({functionName:e});var t=/((.*".+"[^@]*)?[^@]*)(?:@)/,n=e.match(t),r=n&&n[1]?n[1]:void 0,i=this.extractLocation(e.replace(t,""));return new Ze({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 a=t.exec(n[i]);a&&r.push(new Ze({fileName:a[2],lineNumber:parseFloat(a[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 a=t.exec(n[i]);a&&r.push(new Ze({functionName:a[3]||void 0,fileName:a[2],lineNumber:parseFloat(a[1])}))}return r},parseOpera11:function(e){return e.stack.split("\n").filter((function(e){return!!e.match(et)&&!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 Ze({functionName:r,fileName:n[0],lineNumber:n[1],columnNumber:n[2]})}),this)}};function it(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 a=r.children[o];a.localName&&a.localName.toLowerCase&&a.localName.toLowerCase()===n&&i.push(a)}i.length>1&&(n+=":eq("+i.indexOf(e)+")"),t=n+(t?">"+t:""),e=r}return t}function ot(e){return"[object Object]"===Object.prototype.toString.call(e)}function at(e,t){var r,i;if(0===t)return!0;var o=Object.keys(e);try{for(var a=n(o),s=a.next();!s.done;s=a.next()){var u=s.value;if(ot(e[u])&&at(e[u],t-1))return!0}}catch(e){r={error:e}}finally{try{s&&!s.done&&(i=a.return)&&i.call(a)}finally{if(r)throw r.error}}return!1}function st(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(function(e){if(ot(e)&&Object.keys(e).length>n.numOfKeysLimit)return!0;if("function"==typeof e)return!0;if(ot(e)&&at(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(t instanceof Event){var a={};for(var s in t){var u=t[s];Array.isArray(u)?a[s]=it(u.length?u[0]:null):a[s]=u}return a}return t instanceof Node?t instanceof HTMLElement?t?t.outerHTML:"":t.nodeName:t instanceof Error?t.stack?t.stack+"\nEnd of stack for Error object":t.name+": "+t.message:t}))}var ut={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 lt(e,t,o){var a,s,u,l=o.logger;if(!l)return function(){};u="string"==typeof l?t[l]:l;var c=0,d=[];if(o.level.includes("error")&&window){var f=function(t){var n=t.message,r=t.error,i=rt.parse(r).map((function(e){return e.toString()})),a=[st(n,o.stringifyOptions)];e({level:"error",trace:i,payload:a})};window.addEventListener("error",f),d.push((function(){window&&window.removeEventListener("error",f)}))}try{for(var p=n(o.level),h=p.next();!h.done;h=p.next()){var v=h.value;d.push(g(u,v))}}catch(e){a={error:e}}finally{try{h&&!h.done&&(s=p.return)&&s.call(p)}finally{if(a)throw a.error}}return function(){d.forEach((function(e){return e()}))};function g(t,n){var a=this;return t[n]?re(t,n,(function(t){return function(){for(var s=[],u=0;u<arguments.length;u++)s[u]=arguments[u];t.apply(a,s);try{var l=rt.parse(new Error).map((function(e){return e.toString()})).splice(1),d=s.map((function(e){return st(e,o.stringifyOptions)}));++c<o.lengthThreshold?e({level:n,trace:l,payload:d}):c===o.lengthThreshold&&e({level:"warn",trace:[],payload:[st("The number of log records reached the threshold.")]})}catch(e){t.apply(void 0,i(["rrweb logger error:",e],r(s),!1))}}})):function(){}}}var ct=Array.prototype,dt=ct.forEach,ft=ct.indexOf,pt="undefined"!=typeof window?window:void 0,ht=null==pt?void 0:pt.navigator,vt=null==pt?void 0:pt.document,gt=null==ht?void 0:ht.userAgent,mt=null!=pt?pt:{};pt&&(pt.rrweb={record:Ke,version:"v1",rrwebVersion:"1.1.3"},pt.rrwebConsoleRecord={getRecordConsolePlugin:function(e){return{name:"rrweb/console@1",observer:lt,options:e?Object.assign({},ut,e):ut}}});var _t={DEBUG:!1,LIB_VERSION:"1.94.2"},yt=Array.isArray,bt=Object.prototype,kt=bt.hasOwnProperty,wt=bt.toString,St=yt||function(e){return"[object Array]"===wt.call(e)},Ct=function(e){return"[object Uint8Array]"===wt.call(e)},It=function(e){return"function"==typeof e},xt=function(e){return e===Object(e)&&!St(e)},Ft=function(e){if(xt(e)){for(var t in e)if(kt.call(e,t))return!1;return!0}return!1},Et=function(e){return void 0===e},Ot=function(e){return"[object String]"==wt.call(e)},Rt=function(e){return null===e},Mt=function(e){return"[object Number]"==wt.call(e)},Tt=function(e){return"[object Boolean]"===wt.call(e)},Pt="[PostHog.js]",Nt={_log:function(e){if(pt&&(_t.DEBUG||mt.POSTHOG_DEBUG)&&!Et(pt.console)&&pt.console){for(var t=("__rrweb_original__"in pt.console[e]?pt.console[e].__rrweb_original__:pt.console[e]),n=arguments.length,r=new Array(n>1?n-1:0),i=1;i<n;i++)r[i-1]=arguments[i];t.apply(void 0,[Pt].concat(r))}},info:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];Nt._log.apply(Nt,["log"].concat(t))},warn:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];Nt._log.apply(Nt,["warn"].concat(t))},error:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];Nt._log.apply(Nt,["error"].concat(t))},critical:function(){for(var e,t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];(e=console).error.apply(e,[Pt].concat(n))},uninitializedWarning:function(e){Nt.error("You must initialize PostHog before calling ".concat(e))}},Lt={},Dt=function(e){return e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"")};function At(e,t,n){if(St(e))if(dt&&e.forEach===dt)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)===Lt)return}function $t(e,t,n){if(!Rt(e)&&!Et(e)){if(St(e))return At(e,t,n);for(var r in e)if(kt.call(e,r)&&t.call(n,e[r],r)===Lt)return}}var qt=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 At(n,(function(t){for(var n in t)void 0!==t[n]&&(e[n]=t[n])})),e};function Bt(e,t){return-1!==e.indexOf(t)}function jt(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 Ht=function(){return Date.now=Date.now||function(){return+new Date},Date.now()},Wt=function(e){try{return e()}catch(e){return}},Vt=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){Nt.critical("Implementation error. Please turn on debug mode and open a ticket on https://app.posthog.com/home#panel=support%3Asupport%3A."),Nt.critical(e)}}},Ut=function(e){var t={};return $t(e,(function(e,n){Ot(e)&&e.length>0&&(t[n]=e)})),t};var zt=["$performance_raw"];function Gt(e,t){return n=e,r=function(e,n){return n&&zt.indexOf(n)>-1?e:Ot(e)&&!Rt(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),St(t)?(o=[],At(t,(function(t){o.push(e(t))}))):(o={},$t(t,(function(t,n){i.has(t)||(o[n]=e(t,n))}))),o);var o}(n);var n,r,i}function Yt(e){var t,n,r,i,o,a="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",s=0,u=0,l="",c=[];if(!e)return e;e=Jt(e);do{t=(o=e.charCodeAt(s++)<<16|e.charCodeAt(s++)<<8|e.charCodeAt(s++))>>18&63,n=o>>12&63,r=o>>6&63,i=63&o,c[u++]=a.charAt(t)+a.charAt(n)+a.charAt(r)+a.charAt(i)}while(s<e.length);switch(l=c.join(""),e.length%3){case 1:l=l.slice(0,-2)+"==";break;case 2:l=l.slice(0,-1)+"="}return l}var Jt=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 a=e.charCodeAt(i),s=null;a<128?n++:s=a>127&&a<2048?String.fromCharCode(a>>6|192,63&a|128):String.fromCharCode(a>>12|224,a>>6&63|128,63&a|128),Rt(s)||(n>t&&(o+=e.substring(t,n)),o+=s,t=n=i+1)}return n>t&&(o+=e.substring(t,e.length)),o},Qt=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 a="on"+n,s=t[a];t[a]=function(t,n,r){return function(i){if(i=i||e(null==pt?void 0:pt.event)){var o,a=!0;It(r)&&(o=r(i));var s=n.call(t,i);return!1!==o&&!1!==s||(a=!1),a}}}(t,r,s)}else Nt.error("No valid element provided to register_event")}}();function Xt(e,t){var n=function(){if(!vt)return t("document not found");var n=vt.createElement("script");n.type="text/javascript",n.src=e,n.onload=function(e){return t(void 0,e)},n.onerror=function(e){return t(e)};var r,i=vt.querySelectorAll("body > script");i.length>0?null===(r=i[0].parentNode)||void 0===r||r.insertBefore(n,i[0]):vt.body.appendChild(n)};null!=vt&&vt.body?n():null==vt||vt.addEventListener("DOMContentLoaded",n)}function Kt(e){return e?Dt(e).split(/\s+/):[]}function Zt(e){var t="";switch(s(e.className)){case"string":t=e.className;break;case"object":t=("baseVal"in e.className?e.className.baseVal:null)||e.getAttribute("class")||"";break;default:t=""}return Kt(t)}function en(e){var t="";return sn(e)&&!un(e)&&e.childNodes&&e.childNodes.length&&$t(e.childNodes,(function(e){rn(e)&&e.textContent&&(t+=Dt(e.textContent).split(/(\s+)/).filter(ln).join("").replace(/[\r\n]/g," ").replace(/[ ]+/g," ").substring(0,255))})),Dt(t)}function tn(e){return!!e&&1===e.nodeType}function nn(e,t){return!!e&&!!e.tagName&&e.tagName.toLowerCase()===t.toLowerCase()}function rn(e){return!!e&&3===e.nodeType}function on(e){return!!e&&11===e.nodeType}var an=["a","button","form","input","select","textarea","label"];function sn(e){for(var t=e;t.parentNode&&!nn(t,"body");t=t.parentNode){var n=Zt(t);if(Bt(n,"ph-sensitive")||Bt(n,"ph-no-capture"))return!1}if(Bt(Zt(e),"ph-include"))return!0;var r=e.type||"";if(Ot(r))switch(r.toLowerCase()){case"hidden":case"password":return!1}var i=e.name||e.id||"";if(Ot(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 un(e){return!!(nn(e,"input")&&!["button","checkbox","submit","reset"].includes(e.type)||nn(e,"select")||nn(e,"textarea")||"true"===e.getAttribute("contenteditable"))}function ln(e){if(Rt(e)||Et(e))return!1;if(Ot(e)){e=Dt(e);if(/^(?:(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}))$/.test((e||"").replace(/[- ]/g,"")))return!1;if(/(^\d{3}-?\d{2}-?\d{4}$)/.test(e))return!1}return!0}function cn(e){var t=en(e);return ln(t="".concat(t," ").concat(dn(e)).trim())?t:""}function dn(e){var t="";return e&&e.childNodes&&e.childNodes.length&&$t(e.childNodes,(function(e){var n;if(e&&"span"===(null===(n=e.tagName)||void 0===n?void 0:n.toLowerCase()))try{var r=en(e);t="".concat(t," ").concat(r).trim(),e.childNodes&&e.childNodes.length&&(t="".concat(t," ").concat(dn(e)).trim())}catch(e){Nt.error(e)}})),t}function fn(e){return function(e){var t=e.map((function(e){var t,n,r="";if(e.tag_name&&(r+=e.tag_name),e.attr_class){e.attr_class.sort();var i,o=w(e.attr_class);try{for(o.s();!(i=o.n()).done;){var s=i.value;r+=".".concat(s.replace(/"/g,""))}}catch(e){o.e(e)}finally{o.f()}}var u=a(a(a(a({},e.text?{text:e.text}:{}),{},{"nth-child":null!==(t=e.nth_child)&&void 0!==t?t:0,"nth-of-type":null!==(n=e.nth_of_type)&&void 0!==n?n:0},e.href?{href:e.href}:{}),e.attr_id?{attr_id:e.attr_id}:{}),e.attributes),l={};return jt(u).sort((function(e,t){var n=_(e,1)[0],r=_(t,1)[0];return n.localeCompare(r)})).forEach((function(e){var t=_(e,2),n=t[0],r=t[1];return l[pn(n.toString())]=pn(r.toString())})),r+=":",r+=jt(u).map((function(e){var t=_(e,2),n=t[0],r=t[1];return"".concat(n,'="').concat(r,'"')})).join("")}));return t.join(";")}(function(e){return e.map((function(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:hn(e),attr_id:e.attr__id,nth_child:e.nth_child,nth_of_type:e.nth_of_type,attributes:{}};return jt(e).filter((function(e){return 0===_(e,1)[0].indexOf("attr__")})).forEach((function(e){var t=_(e,2),n=t[0],i=t[1];return r.attributes[n]=i})),r}))}(e))}function pn(e){return e.replace(/"|\\"/g,'\\"')}function hn(e){var t=e.attr__class;return t?St(t)?t:Kt(t):void 0}var vn=function(){function e(t){u(this,e),this.clicks=[],this.enabled=t}return c(e,[{key:"isRageClick",value:function(e,t,n){if(!this.enabled)return!1;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}}]),e}(),gn="$people_distinct_id",mn="__alias",_n="__timers",yn="$autocapture_disabled_server_side",bn="$session_recording_enabled_server_side",kn="$console_log_recording_enabled_server_side",wn="$session_recording_recorder_version_server_side",Sn="$session_recording_network_payload_capture",Cn="$sesid",In="$session_is_sampled",xn="$enabled_feature_flags",Fn="$early_access_features",En="$stored_person_properties",On="$stored_group_properties",Rn="$surveys",Mn="$flag_call_reported",Tn="$user_state",Pn="$posthog_quota_limited",Nn="$client_session_props",Ln=[gn,mn,"__cmpns",_n,bn,Cn,xn,Tn,Pn,Fn,On,En,Rn,Mn,Nn];function Dn(e,t){return t.length>e?t.slice(0,e)+"...":t}var An={_initializedTokens:[],_isDisabledServerSide:null,_isAutocaptureEnabled:!1,_setIsAutocaptureEnabled:function(e){var t,n=Rt(this._isDisabledServerSide)?!(null===(t=e.persistence)||void 0===t||!t.props[yn]):this._isDisabledServerSide,r=!!e.config.autocapture;this._isAutocaptureEnabled=r&&!n},_previousElementSibling:function(e){if(e.previousElementSibling)return e.previousElementSibling;var t=e;do{t=t.previousSibling}while(t&&!tn(t));return t},_getAugmentPropertiesFromElement:function(e){if(!sn(e))return{};var t={};return $t(e.attributes,(function(e){if(0===e.name.indexOf("data-ph-capture-attribute")){var n=e.name.replace("data-ph-capture-attribute-",""),r=e.value;n&&r&&ln(r)&&(t[n]=r)}})),t},_getPropertiesFromElement:function(e,t,n){var r,i=e.tagName.toLowerCase(),o={tag_name:i};an.indexOf(i)>-1&&!n&&("a"===i.toLowerCase()||"button"===i.toLowerCase()?o.$el_text=Dn(1024,cn(e)):o.$el_text=Dn(1024,en(e)));var a=Zt(e);a.length>0&&(o.classes=a.filter((function(e){return""!==e})));var s=null===(r=this.config)||void 0===r?void 0:r.element_attribute_ignorelist;$t(e.attributes,(function(n){var r;if((!un(e)||-1!==["name","id","class"].indexOf(n.name))&&((null==s||!s.includes(n.name))&&!t&&ln(n.value)&&(r=n.name,!Ot(r)||"_ngcontent"!==r.substring(0,10)&&"_nghost"!==r.substring(0,7)))){var i=n.value;"class"===n.name&&(i=Kt(i).join()),o["attr__"+n.name]=Dn(1024,i)}}));for(var u=1,l=1,c=e;c=this._previousElementSibling(c);)u++,c.tagName===e.tagName&&l++;return o.nth_child=u,o.nth_of_type=l,o},_getDefaultProperties:function(e){return{$event_type:e,$ce_version:1}},_extractCustomPropertyValue:function(e){var t=[];return $t(null==vt?void 0:vt.querySelectorAll(e.css_selector),(function(e){var n;["input","select"].indexOf(e.tagName.toLowerCase())>-1?n=e.value:e.textContent&&(n=e.textContent),ln(n)&&t.push(n)})),t.join(", ")},_getCustomProperties:function(e){var t=this,n={};return $t(this._customProperties,(function(r){$t(r.event_selectors,(function(i){$t(null==vt?void 0:vt.querySelectorAll(i),(function(i){Bt(e,i)&&sn(i)&&(n[r.name]=t._extractCustomPropertyValue(r))}))}))})),n},_getEventTarget:function(e){return Et(e.target)?e.srcElement||null:null!==(t=e.target)&&void 0!==t&&t.shadowRoot?e.composedPath()[0]||null:e.target||null;var t},_captureEvent:function(e,t){var n,r=this,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"$autocapture",o=this._getEventTarget(e);(rn(o)&&(o=o.parentNode||null),"$autocapture"===i&&"click"===e.type&&e instanceof MouseEvent)&&(null!==(n=this.rageclicks)&&void 0!==n&&n.isRageClick(e.clientX,e.clientY,(new Date).getTime())&&this._captureEvent(e,t,"$rageclick"));if(o&&function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:void 0;if(!pt||!e||nn(e,"html")||!tn(e))return!1;if(null!=n&&n.url_allowlist){var r=pt.location.href,i=n.url_allowlist;if(i&&!i.some((function(e){return r.match(e)})))return!1}if(null!=n&&n.dom_event_allowlist){var o=n.dom_event_allowlist;if(o&&!o.some((function(e){return t.type===e})))return!1}if(null!=n&&n.element_allowlist){var a=n.element_allowlist;if(a&&!a.some((function(t){return e.tagName.toLowerCase()===t})))return!1}if(null!=n&&n.css_selector_allowlist){var s=n.css_selector_allowlist;if(s&&!s.some((function(t){return e.matches(t)})))return!1}for(var u=!1,l=[e],c=!0,d=e;d.parentNode&&!nn(d,"body");)if(on(d.parentNode))l.push(d.parentNode.host),d=d.parentNode.host;else{if(!(c=d.parentNode||!1))break;if(an.indexOf(c.tagName.toLowerCase())>-1)u=!0;else{var f=pt.getComputedStyle(c);f&&"pointer"===f.getPropertyValue("cursor")&&(u=!0)}l.push(c),d=c}var p=pt.getComputedStyle(e);if(p&&"pointer"===p.getPropertyValue("cursor")&&"click"===t.type)return!0;var h=e.tagName.toLowerCase();switch(h){case"html":return!1;case"form":return"submit"===t.type;case"input":case"select":case"textarea":return"change"===t.type||"click"===t.type;default:return u?"click"===t.type:"click"===t.type&&(an.indexOf(h)>-1||"true"===e.getAttribute("contenteditable"))}}(o,e,this.config)){for(var a,s,u=[o],l=o;l.parentNode&&!nn(l,"body");)on(l.parentNode)?(u.push(l.parentNode.host),l=l.parentNode.host):(u.push(l.parentNode),l=l.parentNode);var c,d=[],f={},p=!1;if($t(u,(function(e){var n=sn(e);"a"===e.tagName.toLowerCase()&&(c=e.getAttribute("href"),c=n&&ln(c)&&c),Bt(Zt(e),"ph-no-capture")&&(p=!0),d.push(r._getPropertiesFromElement(e,t.config.mask_all_element_attributes,t.config.mask_all_text));var i=r._getAugmentPropertiesFromElement(e);qt(f,i)})),t.config.mask_all_text||("a"===o.tagName.toLowerCase()||"button"===o.tagName.toLowerCase()?d[0].$el_text=cn(o):d[0].$el_text=en(o)),c&&(d[0].attr__href=c),p)return!1;var h=qt(this._getDefaultProperties(e.type),t.elementsChainAsString?{$elements_chain:fn(d)}:{$elements:d},null!==(a=d[0])&&void 0!==a&&a.$el_text?{$el_text:null===(s=d[0])||void 0===s?void 0:s.$el_text}:{},this._getCustomProperties(u),f);return t.capture(i,h),!0}},_navigate:function(e){pt&&(pt.location.href=e)},_addDomEventHandlers:function(e){var t=this;if(pt&&vt){var n=function(n){n=n||(null==pt?void 0:pt.event),t._captureEvent(n,e)};Qt(vt,"submit",n,!1,!0),Qt(vt,"change",n,!1,!0),Qt(vt,"click",n,!1,!0)}},_customProperties:[],rageclicks:null,config:void 0,init:function(e){var t;Tt(e.__autocapture)||(this.config=e.__autocapture),null!==(t=this.config)&&void 0!==t&&t.url_allowlist&&(this.config.url_allowlist=this.config.url_allowlist.map((function(e){return new RegExp(e)}))),this.rageclicks=new vn(e.config.rageclick)},afterDecideResponse:function(e,t){var n=t.config.token;this._initializedTokens.indexOf(n)>-1?Nt.info('autocapture already initialized for token "'+n+'"'):(t.persistence&&t.persistence.register(d({},yn,!!e.autocapture_opt_out)),this._isDisabledServerSide=!!e.autocapture_opt_out,this._setIsAutocaptureEnabled(t),this._initializedTokens.push(n),e&&e.config&&e.config.enable_collect_everything&&this._isAutocaptureEnabled?(e.custom_properties&&(this._customProperties=e.custom_properties),this._addDomEventHandlers(t)):t.__autocapture=!1)},enabledForProject:function(e,t,n){if(!e)return!0;t=Et(t)?10:t,n=Et(n)?10:n;for(var r=0,i=0;i<e.length;i++)r+=e.charCodeAt(i);return r%t<n},isBrowserSupported:function(){return It(null==vt?void 0:vt.querySelectorAll)}};!function(e){for(var t in e)It(e[t])&&(e[t]=e[t].bind(e))}(An),function(e){for(var t in e)It(e[t])&&(e[t]=Vt(e[t]))}(An);var $n="$active_feature_flags",qn="$override_feature_flags",Bn="$feature_flag_payloads",jn=function(e){var t,n={},r=w(jt(e||{}));try{for(r.s();!(t=r.n()).done;){var i=_(t.value,2),o=i[0],a=i[1];a&&(n[o]=a)}}catch(e){r.e(e)}finally{r.f()}return n},Hn=function(){function e(t){u(this,e),this.instance=t,this._override_warning=!1,this.featureFlagEventHandlers=[],this.reloadFeatureFlagsQueued=!1,this.reloadFeatureFlagsInAction=!1}return c(e,[{key:"getFlags",value:function(){return Object.keys(this.getFlagVariants())}},{key:"getFlagVariants",value:function(){var e=this.instance.get_property(xn),t=this.instance.get_property(qn);if(!t)return e||{};for(var n=qt({},e),r=Object.keys(t),i=0;i<r.length;i++)!1===t[r[i]]?delete n[r[i]]:n[r[i]]=t[r[i]];return this._override_warning||(Nt.warn(" Overriding feature flags!",{enabledFlags:e,overriddenFlags:t,finalFlags:n}),this._override_warning=!0),n}},{key:"getFlagPayloads",value:function(){return this.instance.get_property(Bn)||{}}},{key:"reloadFeatureFlags",value:function(){this.reloadFeatureFlagsQueued||(this.reloadFeatureFlagsQueued=!0,this._startReloadTimer())}},{key:"setAnonymousDistinctId",value:function(e){this.$anon_distinct_id=e}},{key:"setReloadingPaused",value:function(e){this.reloadFeatureFlagsInAction=e}},{key:"resetRequestQueue",value:function(){this.reloadFeatureFlagsQueued=!1}},{key:"_startReloadTimer",value:function(){var e=this;this.reloadFeatureFlagsQueued&&!this.reloadFeatureFlagsInAction&&setTimeout((function(){!e.reloadFeatureFlagsInAction&&e.reloadFeatureFlagsQueued&&(e.reloadFeatureFlagsQueued=!1,e._reloadFeatureFlagsRequest())}),5)}},{key:"_reloadFeatureFlagsRequest",value:function(){var e=this;if(!this.instance.config.advanced_disable_feature_flags){this.setReloadingPaused(!0);var t=this.instance.config.token,n=this.instance.get_property(En),r=this.instance.get_property(On),i=Yt(JSON.stringify({token:t,distinct_id:this.instance.get_distinct_id(),groups:this.instance.getGroups(),$anon_distinct_id:this.$anon_distinct_id,person_properties:n,group_properties:r,disable_flags:this.instance.config.advanced_disable_feature_flags||void 0}));this.instance._send_request(this.instance.config.api_host+"/decide/?v=3",{data:i},{method:"POST"},this.instance._prepare_callback((function(t){e.$anon_distinct_id=void 0,e.receivedFeatureFlags(t),e.setReloadingPaused(!1),e._startReloadTimer()})))}}},{key:"getFeatureFlag",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(this.instance.decideEndpointWasHit||this.getFlags()&&this.getFlags().length>0){var n,r=this.getFlagVariants()[e],i="".concat(r),o=this.instance.get_property(Mn)||{};if(t.send_event||!("send_event"in t))if(!(e in o)||!o[e].includes(i))St(o[e])?o[e].push(i):o[e]=[i],null===(n=this.instance.persistence)||void 0===n||n.register(d({},Mn,o)),this.instance.capture("$feature_flag_called",{$feature_flag:e,$feature_flag_response:r});return r}Nt.warn('getFeatureFlag for key "'+e+"\" failed. Feature flags didn't load in time.")}},{key:"getFeatureFlagPayload",value:function(e){return this.getFlagPayloads()[e]}},{key:"isFeatureEnabled",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(this.instance.decideEndpointWasHit||this.getFlags()&&this.getFlags().length>0)return!!this.getFeatureFlag(e,t);Nt.warn('isFeatureEnabled for key "'+e+"\" failed. Feature flags didn't load in time.")}},{key:"addFeatureFlagsHandler",value:function(e){this.featureFlagEventHandlers.push(e)}},{key:"removeFeatureFlagsHandler",value:function(e){this.featureFlagEventHandlers=this.featureFlagEventHandlers.filter((function(t){return t!==e}))}},{key:"receivedFeatureFlags",value:function(e){if(this.instance.persistence){this.instance.decideEndpointWasHit=!0;var t=this.getFlagVariants(),n=this.getFlagPayloads();!function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},i=e.featureFlags,o=e.featureFlagPayloads;if(i)if(St(i)){var s,u={};if(i)for(var l=0;l<i.length;l++)u[i[l]]=!0;t&&t.register((d(s={},$n,i),d(s,xn,u),s))}else{var c,f=i,p=o;e.errorsWhileComputingFlags&&(f=a(a({},n),f),p=a(a({},r),p)),t&&t.register((d(c={},$n,Object.keys(jn(f))),d(c,xn,f||{}),d(c,Bn,p||{}),c))}}(e,this.instance.persistence,t,n),this._fireFeatureFlagsCallbacks()}}},{key:"override",value:function(e){if(!this.instance.__loaded||!this.instance.persistence)return Nt.uninitializedWarning("posthog.feature_flags.override");if(this._override_warning=!1,!1===e)this.instance.persistence.unregister(qn);else if(St(e)){for(var t={},n=0;n<e.length;n++)t[e[n]]=!0;this.instance.persistence.register(d({},qn,t))}else this.instance.persistence.register(d({},qn,e))}},{key:"onFeatureFlags",value:function(e){var t=this;if(this.addFeatureFlagsHandler(e),this.instance.decideEndpointWasHit){var n=this._prepareFeatureFlagsForCallbacks(),r=n.flags,i=n.flagVariants;e(r,i)}return function(){return t.removeFeatureFlagsHandler(e)}}},{key:"updateEarlyAccessFeatureEnrollment",value:function(e,t){var n,r,i=d({},"$feature_enrollment/".concat(e),t);this.instance.capture("$feature_enrollment_update",{$feature_flag:e,$feature_enrollment:t,$set:i}),this.setPersonPropertiesForFlags(i,!1);var o=a(a({},this.getFlagVariants()),{},d({},e,t));null===(n=this.instance.persistence)||void 0===n||n.register((d(r={},$n,Object.keys(jn(o))),d(r,xn,o),r)),this._fireFeatureFlagsCallbacks()}},{key:"getEarlyAccessFeatures",value:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]&&arguments[1],r=this.instance.get_property(Fn);if(r&&!n)return e(r);this.instance._send_request("".concat(this.instance.config.api_host,"/api/early_access_features/?token=").concat(this.instance.config.token),{},{method:"GET"},(function(n){var r,i=n.earlyAccessFeatures;return null===(r=t.instance.persistence)||void 0===r||r.register(d({},Fn,i)),e(i)}))}},{key:"_prepareFeatureFlagsForCallbacks",value:function(){var e=this.getFlags(),t=this.getFlagVariants();return{flags:e.filter((function(e){return t[e]})),flagVariants:Object.keys(t).filter((function(e){return t[e]})).reduce((function(e,n){return e[n]=t[n],e}),{})}}},{key:"_fireFeatureFlagsCallbacks",value:function(){var e=this._prepareFeatureFlagsForCallbacks(),t=e.flags,n=e.flagVariants;this.featureFlagEventHandlers.forEach((function(e){return e(t,n)}))}},{key:"setPersonPropertiesForFlags",value:function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],n=this.instance.get_property(En)||{};this.instance.register(d({},En,a(a({},n),e))),t&&this.instance.reloadFeatureFlags()}},{key:"resetPersonPropertiesForFlags",value:function(){this.instance.unregister(En)}},{key:"setGroupPropertiesForFlags",value:function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],n=this.instance.get_property(On)||{};0!==Object.keys(n).length&&Object.keys(n).forEach((function(t){n[t]=a(a({},n[t]),e[t]),delete e[t]})),this.instance.register(d({},On,a(a({},n),e))),t&&this.instance.reloadFeatureFlags()}},{key:"resetGroupPropertiesForFlags",value:function(e){if(e){var t=this.instance.get_property(On)||{};this.instance.register(d({},On,a(a({},t),{},d({},e,{}))))}else this.instance.unregister(On)}}]),e}();Math.trunc||(Math.trunc=function(e){return e<0?Math.ceil(e):Math.floor(e)}),Number.isInteger||(Number.isInteger=function(e){return Mt(e)&&isFinite(e)&&Math.floor(e)===e});var Wn="0123456789abcdef",Vn=function(){function e(t){if(u(this,e),this.bytes=t,16!==t.length)throw new TypeError("not 128-bit length")}return c(e,[{key:"toString",value:function(){for(var e="",t=0;t<this.bytes.length;t++)e=e+Wn.charAt(this.bytes[t]>>>4)+Wn.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}},{key:"clone",value:function(){return new e(this.bytes.slice(0))}},{key:"equals",value:function(e){return 0===this.compareTo(e)}},{key:"compareTo",value:function(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}}],[{key:"fromFieldsV7",value:function(t,n,r,i){if(!Number.isInteger(t)||!Number.isInteger(n)||!Number.isInteger(r)||!Number.isInteger(i)||t<0||n<0||r<0||i<0||t>0xffffffffffff||n>4095||r>1073741823||i>4294967295)throw new RangeError("invalid field value");var o=new Uint8Array(16);return o[0]=t/Math.pow(2,40),o[1]=t/Math.pow(2,32),o[2]=t/Math.pow(2,24),o[3]=t/Math.pow(2,16),o[4]=t/Math.pow(2,8),o[5]=t,o[6]=112|n>>>8,o[7]=n,o[8]=128|r>>>24,o[9]=r>>>16,o[10]=r>>>8,o[11]=r,o[12]=i>>>24,o[13]=i>>>16,o[14]=i>>>8,o[15]=i,new e(o)}}]),e}(),Un=function(){function e(){u(this,e),d(this,"timestamp",0),d(this,"counter",0),d(this,"random",new Yn)}return c(e,[{key:"generate",value:function(){var e=this.generateOrAbort();if(Et(e)){this.timestamp=0;var t=this.generateOrAbort();if(Et(t))throw new Error("Could not generate UUID after timestamp reset");return t}return e}},{key:"generateOrAbort",value:function(){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 Vn.fromFieldsV7(this.timestamp,Math.trunc(this.counter/Math.pow(2,30)),this.counter&Math.pow(2,30)-1,this.random.nextUint32())}},{key:"resetCounter",value:function(){this.counter=1024*this.random.nextUint32()+(1023&this.random.nextUint32())}}]),e}(),zn=function(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};pt&&!Et(pt.crypto)&&crypto.getRandomValues&&(zn=function(e){return crypto.getRandomValues(e)});var Gn,Yn=function(){function e(){u(this,e),d(this,"buffer",new Uint32Array(8)),d(this,"cursor",1/0)}return c(e,[{key:"nextUint32",value:function(){return this.cursor>=this.buffer.length&&(zn(this.buffer),this.cursor=0),this.buffer[this.cursor++]}}]),e}(),Jn=function(){return Qn().toString()},Qn=function(){return(Gn||(Gn=new Un)).generate()},Xn="Thu, 01 Jan 1970 00:00:00 GMT",Kn="";var Zn=/[a-z0-9][a-z0-9-]+\.[a-z]{2,}$/i,er=function(e){var t=e.match(Zn);return t?t[0]:""};function tr(e,t){if(t){var n=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:vt;if(Kn)return Kn;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_"+Jn(),o=new RegExp("(^|;)\\s*"+i+"=1");!Kn&&r--;){var a=n.slice(r).join("."),s=i+"=1;domain=."+a;t.cookie=s,o.test(t.cookie)&&(t.cookie=s+";expires="+Xn,Kn=a)}return Kn}(e);if(!n){var r=er(e);r!==n&&Nt.info("Warning: cookie subdomain discovery mismatch",r,n),n=r}return n?"; domain=."+n:""}return""}var nr={is_supported:function(){return!!vt},error:function(e){Nt.error("cookieStore error: "+e)},get:function(e){if(vt){try{for(var t=e+"=",n=vt.cookie.split(";").filter((function(e){return 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(nr.get(e))||{}}catch(e){}return t},set:function(e,t,n,r,i){if(vt)try{var o="",a="",s=tr(vt.location.hostname,r);if(n){var u=new Date;u.setTime(u.getTime()+24*n*60*60*1e3),o="; expires="+u.toUTCString()}i&&(a="; secure");var l=e+"="+encodeURIComponent(JSON.stringify(t))+o+"; SameSite=Lax; path=/"+s+a;return l.length>3686.4&&Nt.warn("cookieStore warning: large cookie, len="+l.length),vt.cookie=l,l}catch(e){return}},remove:function(e,t){try{nr.set(e,"",-1,t)}catch(e){return}}},rr=null,ir={is_supported:function(){if(!Rt(rr))return rr;var e=!0;if(Et(pt))e=!1;else try{var t="__mplssupport__";ir.set(t,"xyz"),'"xyz"'!==ir.get(t)&&(e=!1),ir.remove(t)}catch(t){e=!1}return e||Nt.error("localStorage unsupported; falling back to cookie store"),rr=e,e},error:function(e){Nt.error("localStorage error: "+e)},get:function(e){try{return null==pt?void 0:pt.localStorage.getItem(e)}catch(e){ir.error(e)}return null},parse:function(e){try{return JSON.parse(ir.get(e))||{}}catch(e){}return null},set:function(e,t){try{null==pt||pt.localStorage.setItem(e,JSON.stringify(t))}catch(e){ir.error(e)}},remove:function(e){try{null==pt||pt.localStorage.removeItem(e)}catch(e){ir.error(e)}}},or=["distinct_id",Cn,In],ar=a(a({},ir),{},{parse:function(e){try{var t={};try{t=nr.parse(e)||{}}catch(e){}var n=qt(t,JSON.parse(ir.get(e)||"{}"));return ir.set(e,n),n}catch(e){}return null},set:function(e,t,n,r,i){try{ir.set(e,t);var o={};or.forEach((function(e){t[e]&&(o[e]=t[e])})),Object.keys(o).length&&nr.set(e,o,n,r,i)}catch(e){ir.error(e)}},remove:function(e,t){try{null==pt||pt.localStorage.removeItem(e),nr.remove(e,t)}catch(e){ir.error(e)}}}),sr={},ur={is_supported:function(){return!0},error:function(e){Nt.error("memoryStorage error: "+e)},get:function(e){return sr[e]||null},parse:function(e){return sr[e]||null},set:function(e,t){sr[e]=t},remove:function(e){delete sr[e]}},lr=null,cr={is_supported:function(){if(!Rt(lr))return lr;if(lr=!0,Et(pt))lr=!1;else try{var e="__support__";cr.set(e,"xyz"),'"xyz"'!==cr.get(e)&&(lr=!1),cr.remove(e)}catch(e){lr=!1}return lr},error:function(e){Nt.error("sessionStorage error: ",e)},get:function(e){try{return null==pt?void 0:pt.sessionStorage.getItem(e)}catch(e){cr.error(e)}return null},parse:function(e){try{return JSON.parse(cr.get(e))||null}catch(e){}return null},set:function(e,t){try{null==pt||pt.sessionStorage.setItem(e,JSON.stringify(t))}catch(e){cr.error(e)}},remove:function(e){try{null==pt||pt.sessionStorage.removeItem(e)}catch(e){cr.error(e)}}},dr=["localhost","127.0.0.1"],fr=function(e){var t=null==vt?void 0:vt.createElement("a");return Et(t)?null:(t.href=e,t)},pr=function(e,t){return!!function(e){try{new RegExp(e)}catch(e){return!1}return!0}(t)&&new RegExp(t).test(e)},hr=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(!St(n)||n.length<2)return"";var a=n[1];try{a=decodeURIComponent(a)}catch(e){Nt.error("Skipping decoding for malformed query param: "+a)}return a.replace(/\+/g," ")},vr=function(e,t){var n=e.match(new RegExp(t+"=([^&]*)"));return n?n[1]:null};var gr={campaignParams:function(e){var t=["utm_source","utm_medium","utm_campaign","utm_content","utm_term","gclid","gbraid","wbraid","fbclid","msclkid"].concat(e||[]),n={};return $t(t,(function(e){var t=vt?hr(vt.URL,e):"";t.length&&(n[e]=t)})),n},searchEngine:function(){var e=null==vt?void 0:vt.referrer;return e?0===e.search("https?://(.*)google.([^/?]*)")?"google":0===e.search("https?://(.*)bing.com")?"bing":0===e.search("https?://(.*)yahoo.com")?"yahoo":0===e.search("https?://(.*)duckduckgo.com")?"duckduckgo":null:null},searchInfo:function(){var e=gr.searchEngine(),t="yahoo"!=e?"q":"p",n={};if(!Rt(e)){n.$search_engine=e;var r=vt?hr(vt.referrer,t):"";r.length&&(n.ph_keyword=r)}return n},browser:function(e,t,n){return t=t||"",n||Bt(e," OPR/")?Bt(e,"Mini")?"Opera Mini":"Opera":/(BlackBerry|PlayBook|BB10)/i.test(e)?"BlackBerry":Bt(e,"IEMobile")||Bt(e,"WPDesktop")?"Internet Explorer Mobile":Bt(e,"SamsungBrowser/")?"Samsung Internet":Bt(e,"Edge")||Bt(e,"Edg/")?"Microsoft Edge":Bt(e,"FBIOS")?"Facebook Mobile":Bt(e,"Chrome")?"Chrome":Bt(e,"CriOS")?"Chrome iOS":Bt(e,"UCWEB")||Bt(e,"UCBrowser")?"UC Browser":Bt(e,"FxiOS")?"Firefox iOS":Bt(t,"Apple")||function(e){return Bt(e,"Safari")&&!Bt(e,"Chrome")&&!Bt(e,"Android")}(e)?Bt(e,"Mobile")?"Mobile Safari":"Safari":Bt(e,"Android")?"Android Mobile":Bt(e,"Konqueror")||Bt(e,"konqueror")?"Konqueror":Bt(e,"Firefox")?"Firefox":Bt(e,"MSIE")||Bt(e,"Trident/")?"Internet Explorer":Bt(e,"Gecko")?"Mozilla":""},browserVersion:function(e,t,n){var r={"Internet Explorer Mobile":[/rv:(\d+(\.\d+)?)/],"Microsoft Edge":[/Edge?\/(\d+(\.\d+)?)/],Chrome:[/Chrome\/(\d+(\.\d+)?)/],"Chrome iOS":[/CriOS\/(\d+(\.\d+)?)/],"UC Browser":[/(UCBrowser|UCWEB)\/(\d+(\.\d+)?)/],Safari:[/Version\/(\d+(\.\d+)?)/],"Mobile Safari":[/Version\/(\d+(\.\d+)?)/],Opera:[/(Opera|OPR)\/(\d+(\.\d+)?)/],Firefox:[/Firefox\/(\d+(\.\d+)?)/],"Firefox iOS":[/FxiOS\/(\d+(\.\d+)?)/],Konqueror:[/Konqueror[:/]?(\d+(\.\d+)?)/i],BlackBerry:[/BlackBerry (\d+(\.\d+)?)/,/Version\/(\d+(\.\d+)?)/],"Android Mobile":[/android\s(\d+(\.\d+)?)/],"Samsung Internet":[/SamsungBrowser\/(\d+(\.\d+)?)/],"Internet Explorer":[/(rv:|MSIE )(\d+(\.\d+)?)/],Mozilla:[/rv:(\d+(\.\d+)?)/]}[gr.browser(e,t,n)];if(Et(r))return null;for(var i=0;i<r.length;i++){var o=r[i],a=e.match(o);if(a)return parseFloat(a[a.length-2])}return null},browserLanguage:function(){return navigator.language||navigator.userLanguage},os:function(e){if(/Windows/i.test(e)){if(/Phone/.test(e)||/WPDesktop/.test(e))return{os_name:"Windows Phone",os_version:""};var t=/Windows NT ([0-9.]+)/i.exec(e);return t&&t[1]?{os_name:"Windows",os_version:t[1]}:{os_name:"Windows",os_version:""}}if(/(iPhone|iPad|iPod)/.test(e)){var n=/OS (\d+)_(\d+)_?(\d+)?/i.exec(e);return n&&n[1]?{os_name:"iOS",os_version:[n[1],n[2],n[3]||"0"].join(".")}:{os_name:"iOS",os_version:""}}if(/Android/.test(e)){var r=/Android (\d+)\.(\d+)\.?(\d+)?/i.exec(e);return r&&r[1]?{os_name:"Android",os_version:[r[1],r[2],r[3]||"0"].join(".")}:{os_name:"Android",os_version:""}}if(/(BlackBerry|PlayBook|BB10)/i.test(e))return{os_name:"BlackBerry",os_version:""};if(/Mac/i.test(e)){var i=/Mac OS X (\d+)[_.](\d+)[_.]?(\d+)?/i.exec(e);return i&&i[1]?{os_name:"Mac OS X",os_version:[i[1],i[2],i[3]||"0"].join(".")}:{os_name:"Mac OS X",os_version:""}}return/Linux/.test(e)?{os_name:"Linux",os_version:""}:/CrOS/.test(e)?{os_name:"Chrome OS",os_version:""}:{os_name:"",os_version:""}},device:function(e){return/Windows Phone/i.test(e)||/WPDesktop/.test(e)?"Windows Phone":/iPad/.test(e)?"iPad":/iPod/.test(e)?"iPod Touch":/iPhone/.test(e)?"iPhone":/(BlackBerry|PlayBook|BB10)/i.test(e)?"BlackBerry":/Android/.test(e)&&!/Mobile/.test(e)?"Android Tablet":/Android/.test(e)?"Android":""},deviceType:function(e){var t=this.device(e);return"iPad"===t||"Android Tablet"===t?"Tablet":t?"Mobile":"Desktop"},referrer:function(){return(null==vt?void 0:vt.referrer)||"$direct"},referringDomain:function(){var e;return null!=vt&&vt.referrer&&(null===(e=fr(vt.referrer))||void 0===e?void 0:e.host)||"$direct"},properties:function(){if(!gt)return{};var e=gr.os(gt),t=e.os_name,n=e.os_version;return qt(Ut({$os:t,$os_version:n,$browser:gr.browser(gt,navigator.vendor,mt.opera),$device:gr.device(gt),$device_type:gr.deviceType(gt)}),{$current_url:null==pt?void 0:pt.location.href,$host:null==pt?void 0:pt.location.host,$pathname:null==pt?void 0:pt.location.pathname,$raw_user_agent:gt.length>1e3?gt.substring(0,997)+"...":gt,$browser_version:gr.browserVersion(gt,navigator.vendor,mt.opera),$browser_language:gr.browserLanguage(),$screen_height:null==pt?void 0:pt.screen.height,$screen_width:null==pt?void 0:pt.screen.width,$viewport_height:null==pt?void 0:pt.innerHeight,$viewport_width:null==pt?void 0:pt.innerWidth,$lib:"web",$lib_version:_t.LIB_VERSION,$insert_id:Math.random().toString(36).substring(2,10)+Math.random().toString(36).substring(2,10),$time:Ht()/1e3})},people_properties:function(){if(!gt)return{};var e=gr.os(gt),t=e.os_name,n=e.os_version;return qt(Ut({$os:t,$os_version:n,$browser:gr.browser(gt,navigator.vendor,mt.opera)}),{$browser_version:gr.browserVersion(gt,navigator.vendor,mt.opera)})}},mr=["cookie","localstorage","localstorage+cookie","sessionstorage","memory"],_r=function(){function e(t){u(this,e);var n="";t.token&&(n=t.token.replace(/\+/g,"PL").replace(/\//g,"SL").replace(/=/g,"EQ")),this.props={},this.campaign_params_saved=!1,this.custom_campaign_params=t.custom_campaign_params||[],t.persistence_name?this.name="ph_"+t.persistence_name:this.name="ph_"+n+"_posthog",-1===mr.indexOf(t.persistence.toLowerCase())&&(Nt.critical("Unknown persistence type "+t.persistence+"; falling back to localStorage+cookie"),t.persistence="localStorage+cookie");var r=t.persistence.toLowerCase();"localstorage"===r&&ir.is_supported()?this.storage=ir:"localstorage+cookie"===r&&ar.is_supported()?this.storage=ar:"sessionstorage"===r&&cr.is_supported()?this.storage=cr:"memory"===r?this.storage=ur:"cookie"===r?this.storage=nr:ar.is_supported()?this.storage=ar:this.storage=nr,this.user_state="anonymous",this.load(),this.update_config(t),this.save()}return c(e,[{key:"properties",value:function(){var e={};return $t(this.props,(function(t,n){if(n===xn&&xt(t))for(var r=Object.keys(t),i=0;i<r.length;i++)e["$feature/".concat(r[i])]=t[r[i]];else a=n,s=!1,(Rt(o=Ln)?s:ft&&o.indexOf===ft?-1!=o.indexOf(a):($t(o,(function(e){if(s||(s=e===a))return Lt})),s))||(e[n]=t);var o,a,s})),e}},{key:"load",value:function(){if(!this.disabled){var e=this.storage.parse(this.name);e&&(this.props=qt({},e))}}},{key:"save",value:function(){this.disabled||this.storage.set(this.name,this.props,this.expire_days,this.cross_subdomain,this.secure)}},{key:"remove",value:function(){this.storage.remove(this.name,!1),this.storage.remove(this.name,!0)}},{key:"clear",value:function(){this.remove(),this.props={}}},{key:"register_once",value:function(e,t,n){var r=this;if(xt(e)){Et(t)&&(t="None"),this.expire_days=Et(n)?this.default_expiry:n;var i=!1;if($t(e,(function(e,n){r.props.hasOwnProperty(n)&&r.props[n]!==t||(r.props[n]=e,i=!0)})),i)return this.save(),!0}return!1}},{key:"register",value:function(e,t){var n=this;if(xt(e)){this.expire_days=Et(t)?this.default_expiry:t;var r=!1;if($t(e,(function(t,i){e.hasOwnProperty(i)&&n.props[i]!==t&&(n.props[i]=t,r=!0)})),r)return this.save(),!0}return!1}},{key:"unregister",value:function(e){e in this.props&&(delete this.props[e],this.save())}},{key:"update_campaign_params",value:function(){this.campaign_params_saved||(this.register(gr.campaignParams(this.custom_campaign_params)),this.campaign_params_saved=!0)}},{key:"update_search_keyword",value:function(){this.register(gr.searchInfo())}},{key:"update_referrer_info",value:function(){this.register({$referrer:this.props.$referrer||gr.referrer(),$referring_domain:this.props.$referring_domain||gr.referringDomain()})}},{key:"get_referrer_info",value:function(){return Ut({$referrer:this.props.$referrer,$referring_domain:this.props.$referring_domain})}},{key:"safe_merge",value:function(e){return $t(this.props,(function(t,n){n in e||(e[n]=t)})),e}},{key:"update_config",value:function(e){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)}},{key:"set_disabled",value:function(e){this.disabled=e,this.disabled?this.remove():this.save()}},{key:"set_cross_subdomain",value:function(e){e!==this.cross_subdomain&&(this.cross_subdomain=e,this.remove(),this.save())}},{key:"get_cross_subdomain",value:function(){return!!this.cross_subdomain}},{key:"set_secure",value:function(e){e!==this.secure&&(this.secure=e,this.remove(),this.save())}},{key:"set_event_timer",value:function(e,t){var n=this.props[_n]||{};n[e]=t,this.props[_n]=n,this.save()}},{key:"remove_event_timer",value:function(e){var t=(this.props[_n]||{})[e];return Et(t)||(delete this.props[_n][e],this.save()),t}},{key:"get_user_state",value:function(){return this.props[Tn]||"anonymous"}},{key:"set_user_state",value:function(e){this.props[Tn]=e,this.save()}},{key:"get_quota_limits",value:function(){return this.props[Pn]||{}}},{key:"set_quota_limits",value:function(e){this.props[Pn]=e,this.save()}}]),e}(),yr=2,br=4,kr=3,wr=6,Sr=0,Cr="rrweb/console@1";var Ir=c((function e(t){var n,r,i=this,o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};u(this,e),d(this,"bucketSize",100),d(this,"refillRate",10),d(this,"mutationBuckets",{}),d(this,"loggedTracker",{}),d(this,"refillBuckets",(function(){Object.keys(i.mutationBuckets).forEach((function(e){i.mutationBuckets[e]=i.mutationBuckets[e]+i.refillRate,i.mutationBuckets[e]>=i.bucketSize&&delete i.mutationBuckets[e]}))})),d(this,"getNodeOrRelevantParent",(function(e){var t=i.rrweb.mirror.getNode(e);if("svg"!==(null==t?void 0:t.nodeName)&&t instanceof Element){var n=t.closest("svg");if(n)return[i.rrweb.mirror.getId(n),n]}return[e,t]})),d(this,"numberOfChanges",(function(e){var t,n,r,i,o,a,s,u;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===(a=e.texts)||void 0===a?void 0:a.length)&&void 0!==o?o:0)+(null!==(s=null===(u=e.adds)||void 0===u?void 0:u.length)&&void 0!==s?s:0)})),d(this,"throttleMutations",(function(e){if(e.type!==kr||e.data.source!==Sr)return e;var t=e.data,n=i.numberOfChanges(t);t.attributes&&(t.attributes=t.attributes.filter((function(e){var t,n,r,o=_(i.getNodeOrRelevantParent(e.id),2),a=o[0],s=o[1];if(0===i.mutationBuckets[a])return!1;(i.mutationBuckets[a]=null!==(t=i.mutationBuckets[a])&&void 0!==t?t:i.bucketSize,i.mutationBuckets[a]=Math.max(i.mutationBuckets[a]-1,0),0===i.mutationBuckets[a])&&(i.loggedTracker[a]||(i.loggedTracker[a]=!0,null===(n=(r=i.options).onBlockedNode)||void 0===n||n.call(r,a,s)));return e})));var r=i.numberOfChanges(t);return 0!==r||n===r?e:void 0})),this.rrweb=t,this.options=o,this.refillRate=null!==(n=this.options.refillRate)&&void 0!==n?n:this.refillRate,this.bucketSize=null!==(r=this.options.bucketSize)&&void 0!==r?r:this.bucketSize,setInterval((function(){i.refillBuckets()}),1e3)})),xr=function(e){return 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}(xr||{}),Fr={initiatorTypes:["audio","beacon","body","css","early-hint","embed","fetch","frame","iframe","icon","image","img","input","link","navigation","object","ping","script","track","video","xmlhttprequest"],maskRequestFn:function(e){return e},recordHeaders:!1,recordBody:!1,recordInitialRequests:!1,recordPerformance:!1,performanceEntryTypeToObserve:["first-input","navigation","paint","resource"],payloadSizeLimitBytes:1e6},Er=["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"],Or=["/s/","/e/","/i/vo/e/"];function Rr(e,t,n,r){var i=null==t?void 0:t["content-length"];return i&&parseInt(i)>n?"".concat(r," body too large to record"):e}var Mr,Tr=function(e,t){var n,r,i,o=e.session_recording,s=!1!==o.recordHeaders&&t.recordHeaders,u=!1!==o.recordBody&&t.recordBody,l=!1!==o.recordPerformance&&t.recordPerformance,c=(n=o,i=Math.min(1e6,null!==(r=n.payloadSizeLimitBytes)&&void 0!==r?r:1e6),function(e){return null!=e&&e.requestBody&&(e.requestBody=Rr(e.requestBody,e.requestHeaders,i,"Request")),null!=e&&e.responseBody&&(e.responseBody=Rr(e.responseBody,e.responseHeaders,i,"Response")),e}),d=function(e){return c(function(e){var t=fr(e.name);if(!(t&&t.pathname&&Or.includes(t.pathname)))return e}((t=e,Object.keys(null!==(n=t.requestHeaders)&&void 0!==n?n:{}).forEach((function(e){var n;Er.includes(e.toLowerCase())&&(null===(n=t.requestHeaders)||void 0===n||delete n[e])})),t)));var t,n},f=It(e.session_recording.maskNetworkRequestFn);return f&&It(e.session_recording.maskCapturedNetworkRequestFn)&&Nt.warn("Both `maskNetworkRequestFn` and `maskCapturedNetworkRequestFn` are defined. `maskNetworkRequestFn` will be ignored."),f&&(e.session_recording.maskCapturedNetworkRequestFn=function(t){var n=e.session_recording.maskNetworkRequestFn({url:t.name});return a(a({},t),{},{name:null==n?void 0:n.url})}),o.maskRequestFn=It(e.session_recording.maskCapturedNetworkRequestFn)?function(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}:void 0,o.maskRequestFn||(o.maskRequestFn=d),a(a(a({},Fr),o),{},{recordHeaders:s,recordBody:u,recordPerformance:l,recordInitialRequests:l})},Pr="/s/",Nr=3e5;!function(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"}(Mr||(Mr={}));var Lr=[Mr.MouseMove,Mr.MouseInteraction,Mr.Scroll,Mr.ViewportResize,Mr.Input,Mr.TouchMove,Mr.MediaInteraction,Mr.Drag],Dr=function(){function e(t){var n=this;if(u(this,e),d(this,"isIdle",!1),d(this,"_linkedFlagSeen",!1),d(this,"_lastActivityTimestamp",Date.now()),d(this,"windowId",null),d(this,"sessionId",null),d(this,"_linkedFlag",null),d(this,"_sampleRate",null),d(this,"_minimumDuration",null),d(this,"_forceAllowLocalhostNetworkCapture",!1),this.instance=t,this._captureStarted=!1,this._endpoint=Pr,this.stopRrweb=void 0,this.receivedDecide=!1,null==pt||pt.addEventListener("beforeunload",(function(){n._flushBuffer()})),!this.instance.sessionManager)throw Nt.error("Session recording started without valid sessionManager"),new Error("Session recording started without valid sessionManager. This is a bug.");this.buffer=this.clearBuffer()}return c(e,[{key:"started",get:function(){return this._captureStarted}},{key:"sessionManager",get:function(){if(!this.instance.sessionManager)throw Nt.error("Session recording started without valid sessionManager"),new Error("Session recording started without valid sessionManager. This is a bug.");return this.instance.sessionManager}},{key:"isSampled",get:function(){return Mt(this._sampleRate)?this.instance.get_property(In):null}},{key:"sessionDuration",get:function(){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],r=this.sessionManager.checkAndGetSessionAndWindowId(!0).sessionStartTimestamp;return n?n.timestamp-r:null}},{key:"isRecordingEnabled",get:function(){var e=!!this.instance.get_property(bn),t=!this.instance.config.disable_session_recording;return pt&&e&&t}},{key:"isConsoleLogCaptureEnabled",get:function(){var e=!!this.instance.get_property(kn),t=this.instance.config.enable_recording_console_log;return null!=t?t:e}},{key:"recordingVersion",get:function(){var e,t=this.instance.get_property(wn);return(null===(e=this.instance.config.session_recording)||void 0===e?void 0:e.recorderVersion)||t||"v1"}},{key:"networkPayloadCapture",get:function(){var e,t,n=this.instance.get_property(Sn),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),a=this.instance.config.capture_performance||(null==n?void 0:n.capturePerformance);return i||o||a?{recordHeaders:i,recordBody:o,recordPerformance:a}:void 0}},{key:"status",get:function(){return this.receivedDecide?this.isRecordingEnabled?Ot(this._linkedFlag)&&!this._linkedFlagSeen?"buffering":Tt(this.isSampled)?this.isSampled?"sampled":"disabled":"active":"disabled":"buffering"}},{key:"startRecordingIfEnabled",value:function(){this.isRecordingEnabled?this.startCaptureAndTrySendingQueuedSnapshots():(this.stopRecording(),this.clearBuffer())}},{key:"stopRecording",value:function(){this._captureStarted&&this.stopRrweb&&(this.stopRrweb(),this.stopRrweb=void 0,this._captureStarted=!1)}},{key:"makeSamplingDecision",value:function(e){var t,n=this.sessionId!==e;if(Mt(this._sampleRate)){var r,i=this.isSampled;if(n||!Tt(i))r=Math.random()<this._sampleRate;else r=i;r||Nt.warn("[SessionSampling] Sample rate (".concat(this._sampleRate,") has determined that this sessionId (").concat(e,") will not be sent to the server.")),null===(t=this.instance.persistence)||void 0===t||t.register(d({},In,r))}else{var o;null===(o=this.instance.persistence)||void 0===o||o.register(d({},In,null))}}},{key:"afterDecideResponse",value:function(e){var t,n,r,i,o,s,u,l,c=this;this.instance.persistence&&this.instance.persistence.register((d(l={},bn,!!e.sessionRecording),d(l,kn,null===(o=e.sessionRecording)||void 0===o?void 0:o.consoleLogRecordingEnabled),d(l,wn,null===(s=e.sessionRecording)||void 0===s?void 0:s.recorderVersion),d(l,Sn,a({capturePerformance:e.capturePerformance},null===(u=e.sessionRecording)||void 0===u?void 0:u.networkPayloadCapture)),l));var f=null===(t=e.sessionRecording)||void 0===t?void 0:t.sampleRate;this._sampleRate=Et(f)||Rt(f)?null:parseFloat(f);var p,h=null===(n=e.sessionRecording)||void 0===n?void 0:n.minimumDurationMilliseconds;(this._minimumDuration=Et(h)?null:h,this._linkedFlag=(null===(r=e.sessionRecording)||void 0===r?void 0:r.linkedFlag)||null,null!==(i=e.sessionRecording)&&void 0!==i&&i.endpoint)&&(this._endpoint=null===(p=e.sessionRecording)||void 0===p?void 0:p.endpoint);if(Mt(this._sampleRate)&&this.sessionManager.onSessionId((function(e){c.makeSamplingDecision(e)})),Ot(this._linkedFlag)){var v=this._linkedFlag;this.instance.onFeatureFlags((function(e){c._linkedFlagSeen=e.includes(v)}))}this.receivedDecide=!0,this.startRecordingIfEnabled()}},{key:"log",value:function(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:Ht()})}},{key:"startCaptureAndTrySendingQueuedSnapshots",value:function(){this._startCapture()}},{key:"_startCapture",value:function(){var e=this;if(!Et(Object.assign)&&!this._captureStarted&&!this.instance.config.disable_session_recording){this._captureStarted=!0,this.sessionManager.checkAndGetSessionAndWindowId();var t="v2"===this.recordingVersion?"recorder-v2.js":"recorder.js";this.instance.__loaded_recorder_version!==this.recordingVersion?Xt(this.instance.config.api_host+"/static/".concat(t,"?v=").concat(_t.LIB_VERSION),(function(n){if(n)return Nt.error("Could not load ".concat(t),n);e._onScriptLoaded()})):this._onScriptLoaded()}}},{key:"_isInteractiveEvent",value:function(e){var t;return e.type===kr&&-1!==Lr.indexOf(null===(t=e.data)||void 0===t?void 0:t.source)}},{key:"_updateWindowAndSessionIds",value:function(e){var t=this._isInteractiveEvent(e);if(t||this.isIdle||e.timestamp-this._lastActivityTimestamp>Nr&&(this.isIdle=!0,this._tryAddCustomEvent("sessionIdle",{reason:"user inactivity",timeSinceLastActive:e.timestamp-this._lastActivityTimestamp,threshold:Nr})),t&&(this._lastActivityTimestamp=e.timestamp,this.isIdle&&(this.isIdle=!1,this._tryAddCustomEvent("sessionNoLongerIdle",{reason:"user activity",type:e.type}),this._tryTakeFullSnapshot())),!this.isIdle){var n=this.sessionManager.checkAndGetSessionAndWindowId(!t,e.timestamp),r=n.windowId,i=n.sessionId,o=this.sessionId!==i,a=this.windowId!==r;-1===[yr,br].indexOf(e.type)&&(a||o)&&this._tryTakeFullSnapshot(),this.windowId=r,this.sessionId=i}}},{key:"_tryRRwebMethod",value:function(e){if(!this._captureStarted)return!1;try{return e(),!0}catch(e){return Nt.error("[Session-Recording] using rrweb when not started.",e),!1}}},{key:"_tryAddCustomEvent",value:function(e,t){var n=this;return this._tryRRwebMethod((function(){var r;return null===(r=n.rrwebRecord)||void 0===r?void 0:r.addCustomEvent(e,t)}))}},{key:"_tryTakeFullSnapshot",value:function(){var e=this;return this._tryRRwebMethod((function(){var t;return null===(t=e.rrwebRecord)||void 0===t?void 0:t.takeFullSnapshot()}))}},{key:"_onScriptLoaded",value:function(){var e,t=this,n={blockClass:"ph-no-capture",blockSelector:void 0,ignoreClass:"ph-ignore-input",maskTextClass:"ph-mask",maskTextSelector:void 0,maskTextFn:void 0,maskAllInputs:!0,maskInputOptions:{},maskInputFn:void 0,slimDOMOptions:{},collectFonts:!1,inlineStylesheet:!0,recordCrossOriginIframes:!1};this.rrwebRecord=pt.rrweb?pt.rrweb.record:pt.rrwebRecord;for(var r=this.instance.config.session_recording,i=0,o=Object.entries(r||{});i<o.length;i++){var s=_(o[i],2),u=s[0],l=s[1];u in n&&(n[u]=l)}this.rrwebRecord?(this.mutationRateLimiter=null!==(e=this.mutationRateLimiter)&&void 0!==e?e:new Ir(this.rrwebRecord,{onBlockedNode:function(e,n){var r="Too many mutations on node '".concat(e,"'. Rate limiting. This could be due to SVG animations or something similar");Nt.info(r,{node:n}),t.log("[PostHog Recorder] "+r,"warn")}}),this.stopRrweb=this.rrwebRecord(a({emit:function(e){t.onRRwebEmit(e)},plugins:this._gatherRRWebPlugins()},n)),this.instance._addCaptureHook((function(e){try{if("$pageview"===e){var n=pt?t._maskUrl(pt.location.href):"";if(!n)return;t._tryAddCustomEvent("$pageview",{href:n})}}catch(e){Nt.error("Could not add $pageview to rrweb session",e)}})),this._lastActivityTimestamp=Date.now(),this.isIdle=!1):Nt.error("onScriptLoaded was called but rrwebRecord is not available. This indicates something has gone wrong.")}},{key:"_gatherRRWebPlugins",value:function(){var e=[];(mt.rrwebConsoleRecord&&this.isConsoleLogCaptureEnabled&&e.push(mt.rrwebConsoleRecord.getRecordConsolePlugin()),this.networkPayloadCapture&&It(mt.getRecordNetworkPlugin))&&(!dr.includes(location.hostname)||this._forceAllowLocalhostNetworkCapture?e.push(mt.getRecordNetworkPlugin(Tr(this.instance.config,this.networkPayloadCapture))):Nt.info("[SessionReplay-NetworkCapture] not started because we are on localhost."));return e}},{key:"onRRwebEmit",value:function(e){if(e&&xt(e)){if(e.type===xr.Meta){var t=this._maskUrl(e.data.href);if(!t)return;e.data.href=t}var n=this.mutationRateLimiter?this.mutationRateLimiter.throttleMutations(e):e;if(n){var r=function(e){var t=e;if(t&&xt(t)&&t.type===wr&&xt(t.data)&&t.data.plugin===Cr){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}(n),i=JSON.stringify(r).length;if(this._updateWindowAndSessionIds(r),!this.isIdle){var o={$snapshot_bytes:i,$snapshot_data:r,$session_id:this.sessionId,$window_id:this.windowId};"disabled"!==this.status?this._captureSnapshotBuffered(o):this.clearBuffer()}}}}},{key:"_maskUrl",value:function(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}},{key:"clearBuffer",value:function(){return this.buffer=void 0,{size:0,data:[],sessionId:this.sessionId,windowId:this.windowId}}},{key:"_flushBuffer",value:function(){var e=this;this.flushBufferTimer&&(clearTimeout(this.flushBufferTimer),this.flushBufferTimer=void 0);var t=this._minimumDuration,n=this.sessionDuration,r=Mt(n)&&n>=0,i=Mt(t)&&r&&n<t;return"buffering"===this.status||i?(this.flushBufferTimer=setTimeout((function(){e._flushBuffer()}),2e3),this.buffer||this.clearBuffer()):this.buffer&&0!==this.buffer.data.length?(this._captureSnapshot({$snapshot_bytes:this.buffer.size,$snapshot_data:this.buffer.data,$session_id:this.buffer.sessionId,$window_id:this.buffer.windowId}),this.clearBuffer()):this.buffer||this.clearBuffer()}},{key:"_captureSnapshotBuffered",value:function(e){var t,n=this,r=2+((null===(t=this.buffer)||void 0===t?void 0:t.data.length)||0);(!this.buffer||this.buffer.size+e.$snapshot_bytes+r>943718.4||this.buffer.sessionId&&this.buffer.sessionId!==this.sessionId)&&(this.buffer=this._flushBuffer()),Rt(this.buffer.sessionId)&&!Rt(this.sessionId)&&(this.buffer.sessionId=this.sessionId,this.buffer.windowId=this.windowId),this.buffer.size+=e.$snapshot_bytes,this.buffer.data.push(e.$snapshot_data),this.flushBufferTimer||(this.flushBufferTimer=setTimeout((function(){n._flushBuffer()}),2e3))}},{key:"_captureSnapshot",value:function(e){this.instance.capture("$snapshot",e,{transport:"XHR",method:"POST",endpoint:this._endpoint,_noTruncate:!0,_batchKey:"recordings",_metrics:{rrweb_full_snapshot:e.$snapshot_data.type===yr}})}}]),e}(),Ar=function(){function e(t){u(this,e),this.instance=t,this.instance.decideEndpointWasHit=this.instance._hasBootstrappedFeatureFlags()}return c(e,[{key:"call",value:function(){var e=this,t=Yt(JSON.stringify({token:this.instance.config.token,distinct_id:this.instance.get_distinct_id(),groups:this.instance.getGroups(),person_properties:this.instance.get_property(En),group_properties:this.instance.get_property(On),disable_flags:this.instance.config.advanced_disable_feature_flags||this.instance.config.advanced_disable_feature_flags_on_first_load||void 0}));this.instance._send_request("".concat(this.instance.config.api_host,"/decide/?v=3"),{data:t,verbose:!0},{method:"POST"},(function(t){return e.parseDecideResponse(t)}))}},{key:"parseDecideResponse",value:function(e){var t,n=this;if(this.instance.featureFlags.setReloadingPaused(!1),this.instance.featureFlags._startReloadTimer(),0!==(null==e?void 0:e.status)){if(!vt||!vt.body)return Nt.info("document not ready yet, trying again in 500 milliseconds..."),void setTimeout((function(){n.parseDecideResponse(e)}),500);this.instance.toolbar.afterDecideResponse(e),null===(t=this.instance.sessionRecording)||void 0===t||t.afterDecideResponse(e),An.afterDecideResponse(e,this.instance),this.instance._afterDecideResponse(e),this.instance.config.advanced_disable_feature_flags_on_first_load||this.instance.config.advanced_disable_feature_flags||this.instance.featureFlags.receivedFeatureFlags(e);var r=null==pt?void 0:pt.extendPostHogWithSurveys;e.surveys&&!r&&Xt(this.instance.config.api_host+"/static/surveys.js",(function(e){if(e)return Nt.error("Could not load surveys script",e);pt.extendPostHogWithSurveys(n.instance)}));var i=null==pt?void 0:pt.extendPostHogWithExceptionAutoCapture;if(e.autocaptureExceptions&&e.autocaptureExceptions&&Et(i)&&Xt(this.instance.config.api_host+"/static/exception-autocapture.js",(function(t){if(t)return Nt.error("Could not load exception autocapture script",t);pt.extendPostHogWithExceptionAutocapture(n.instance,e)})),e.siteApps)if(this.instance.config.opt_in_site_apps){var o,a=this.instance.config.api_host,s=w(e.siteApps);try{var u=function(){var e=o.value,t=e.id,r=e.url,i=[a,"/"===a[a.length-1]&&"/"===r[0]?r.substring(1):r].join("");mt["__$$ph_site_app_".concat(t)]=n.instance,Xt(i,(function(e){e&&Nt.error("Error while initializing PostHog app with config id ".concat(t),e)}))};for(s.s();!(o=s.n()).done;)u()}catch(e){s.e(e)}finally{s.f()}}else e.siteApps.length>0&&Nt.error('PostHog site apps are disabled. Enable the "opt_in_site_apps" config to proceed.')}else Nt.error("Failed to fetch feature flags from PostHog.")}}]),e}(),$r=["https://app.posthog.com","https://eu.posthog.com"],qr=["source"],Br=null!=pt&&pt.location?vr(pt.location.hash,"__posthog")||vr(location.hash,"state"):null,jr=function(){function e(t){u(this,e),this.instance=t}return c(e,[{key:"afterDecideResponse",value:function(e){var t=e.toolbarParams||e.editorParams||(e.toolbarVersion?{toolbarVersion:e.toolbarVersion}:{});e.isAuthenticated&&t.toolbarVersion&&0===t.toolbarVersion.indexOf("toolbar")&&this.loadToolbar(a({},t))}},{key:"maybeLoadToolbar",value:function(){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(!pt||!vt)return!1;n=null!==(e=n)&&void 0!==e?e:pt.location,i=null!==(t=i)&&void 0!==t?t:pt.history;try{if(!r){try{pt.localStorage.setItem("test","test"),pt.localStorage.removeItem("test")}catch(e){return!1}r=null==pt?void 0:pt.localStorage}var o,a=Br||vr(n.hash,"__posthog")||vr(n.hash,"state"),s=a?Wt((function(){return JSON.parse(atob(decodeURIComponent(a)))}))||Wt((function(){return JSON.parse(decodeURIComponent(a))})):null;return s&&"ph_authorize"===s.action?((o=s).source="url",o&&Object.keys(o).length>0&&(s.desiredHash?n.hash=s.desiredHash:i?i.replaceState("",vt.title,n.pathname+n.search):n.hash="")):((o=JSON.parse(r.getItem("_postHogToolbarParams")||"{}")).source="localstorage",delete o.userIntent),!(!o.token||this.instance.config.token!==o.token)&&(this.loadToolbar(o),!0)}catch(e){return!1}}},{key:"loadToolbar",value:function(e){var t=this;if(!pt||mt._postHogToolbarLoaded)return!1;mt._postHogToolbarLoaded=!0;var n=this.instance.config.api_host,r=3e5,i=Math.floor(Date.now()/r)*r,o="".concat(n).concat(n.endsWith("/")?"":"/","static/toolbar.js?t=").concat(i),s=!$r.includes(this.instance.config.api_host)&&this.instance.config.advanced_disable_toolbar_metrics,u=a(a({token:this.instance.config.token},e),{},{apiURL:n},s?{instrument:!1}:{});u.source;var l=v(u,qr);return pt.localStorage.setItem("_postHogToolbarParams",JSON.stringify(l)),Xt(o,(function(e){e?Nt.error("Failed to load toolbar",e):(mt.ph_load_toolbar||mt.ph_load_editor)(u,t.instance)})),Qt(pt,"turbolinks:load",(function(){mt._postHogToolbarLoaded=!1,t.loadToolbar(u)})),!0}},{key:"_loadEditor",value:function(e){return this.loadToolbar(e)}},{key:"maybeLoadEditor",value:function(){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)}}]),e}(),Hr="__ph_opt_in_out_";function Wr(e,t){Xr(!0,e,t)}function Vr(e,t){Xr(!1,e,t)}function Ur(e,t){return"1"===Qr(e,t)}function zr(e,t){return!!function(e){if(e&&e.respectDnt){var t=e&&e.window||pt,n=null==t?void 0:t.navigator,r=!1;return $t([null==n?void 0:n.doNotTrack,n.msDoNotTrack,t.doNotTrack],(function(e){Bt([!0,1,"1","yes"],e)&&(r=!0)})),r}return!1}(t)||"0"===Qr(e,t)}function Gr(e,t){Yr(t=t||{}).remove(Jr(e,t),!!t.crossSubdomainCookie)}function Yr(e){return"localStorage"===(e=e||{}).persistenceType?ir:"localStorage+cookie"===e.persistenceType?ar:nr}function Jr(e,t){return((t=t||{}).persistencePrefix||Hr)+e}function Qr(e,t){return Yr(t).get(Jr(e,t))}function Xr(e,t,n){Ot(t)&&t.length?(Yr(n=n||{}).set(Jr(t,n),e?1:0,Mt(n.cookieExpiration)?n.cookieExpiration:null,n.crossSubdomainCookie,n.secureCookie),n.capture&&e&&n.capture(n.captureEventName||"$opt_in",n.captureProperties||{},{send_instantly:!0})):Nt.error("gdpr."+(e?"optIn":"optOut")+" called with an invalid token")}var Kr=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:3e3;u(this,e),this.isPolling=!0,this._event_queue=[],this._empty_queue_count=0,this._poller=void 0,this._pollInterval=t}return c(e,[{key:"setPollInterval",value:function(e){this._pollInterval=e,this.isPolling&&this.poll()}},{key:"poll",value:function(){}},{key:"unload",value:function(){}},{key:"getTime",value:function(){return(new Date).getTime()}}]),e}(),Zr=function(e){f(n,e);var t=m(n);function n(e){var r,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:3e3;return u(this,n),(r=t.call(this,i)).handlePollRequest=e,r}return c(n,[{key:"enqueue",value:function(e,t,n){this._event_queue.push({url:e,data:t,options:n}),this.isPolling||(this.isPolling=!0,this.poll())}},{key:"poll",value:function(){var e=this;clearTimeout(this._poller),this._poller=setTimeout((function(){if(e._event_queue.length>0){var t=e.formatQueue(),n=function(n){var r=t[n],i=r.url,o=r.data,a=r.options;$t(o,(function(t,n){o[n].offset=Math.abs(o[n].timestamp-e.getTime()),delete o[n].timestamp})),e.handlePollRequest(i,o,a)};for(var r in t)n(r);e._event_queue.length=0,e._empty_queue_count=0}else e._empty_queue_count++;e._empty_queue_count>4&&(e.isPolling=!1,e._empty_queue_count=0),e.isPolling&&e.poll()}),this._pollInterval)}},{key:"unload",value:function(){var e=this;clearTimeout(this._poller);var t=this._event_queue.length>0?this.formatQueue():{};this._event_queue.length=0;var n=Object.values(t);[].concat(y(n.filter((function(e){return 0===e.url.indexOf("/e")}))),y(n.filter((function(e){return 0!==e.url.indexOf("/e")})))).map((function(t){var n=t.url,r=t.data,i=t.options;e.handlePollRequest(n,r,a(a({},i),{},{transport:"sendBeacon"}))}))}},{key:"formatQueue",value:function(){var e={};return $t(this._event_queue,(function(t){var n=t.url,r=t.data,i=t.options,o=(i?i._batchKey:null)||n;Et(e[o])&&(e[o]={data:[],url:n,options:i}),i&&e[o].options&&e[o].options._metrics&&!e[o].options._metrics.rrweb_full_snapshot&&(e[o].options._metrics.rrweb_full_snapshot=i._metrics.rrweb_full_snapshot),e[o].data.push(r)})),e}}]),n}(Kr),ei=Uint8Array,ti=Uint16Array,ni=Uint32Array,ri=new ei([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]),ii=new ei([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]),oi=new ei([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),ai=function(e,t){for(var n=new ti(31),r=0;r<31;++r)n[r]=t+=1<<e[r-1];var i=new ni(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]},si=ai(ri,2),ui=si[0],li=si[1];ui[28]=258,li[258]=28;for(var ci=ai(ii,0)[1],di=new ti(32768),fi=0;fi<32768;++fi){var pi=(43690&fi)>>>1|(21845&fi)<<1;pi=(61680&(pi=(52428&pi)>>>2|(13107&pi)<<2))>>>4|(3855&pi)<<4,di[fi]=((65280&pi)>>>8|(255&pi)<<8)>>>1}var hi=function(e,t,n){for(var r=e.length,i=0,o=new ti(t);i<r;++i)++o[e[i]-1];var a,s=new ti(t);for(i=0;i<t;++i)s[i]=s[i-1]+o[i-1]<<1;if(n){a=new ti(1<<t);var u=15-t;for(i=0;i<r;++i)if(e[i])for(var l=i<<4|e[i],c=t-e[i],d=s[e[i]-1]++<<c,f=d|(1<<c)-1;d<=f;++d)a[di[d]>>>u]=l}else for(a=new ti(r),i=0;i<r;++i)a[i]=di[s[e[i]-1]++]>>>15-e[i];return a},vi=new ei(288);for(fi=0;fi<144;++fi)vi[fi]=8;for(fi=144;fi<256;++fi)vi[fi]=9;for(fi=256;fi<280;++fi)vi[fi]=7;for(fi=280;fi<288;++fi)vi[fi]=8;var gi=new ei(32);for(fi=0;fi<32;++fi)gi[fi]=5;var mi,_i=hi(vi,9,0),yi=hi(gi,5,0),bi=function(e){return(e/8>>0)+(7&e&&1)},ki=function(e,t,n){(null==t||t<0)&&(t=0),(null==n||n>e.length)&&(n=e.length);var r=new(e instanceof ti?ti:e instanceof ni?ni:ei)(n-t);return r.set(e.subarray(t,n)),r},wi=function(e,t,n){n<<=7&t;var r=t/8>>0;e[r]|=n,e[r+1]|=n>>>8},Si=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},Ci=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 ei(0),0];if(1==i){var a=new ei(n[0].s+1);return a[n[0].s]=1,[a,1]}n.sort((function(e,t){return e.f-t.f})),n.push({s:-1,f:25001});var s=n[0],u=n[1],l=0,c=1,d=2;for(n[0]={s:-1,f:s.f+u.f,l:s,r:u};c!=i-1;)s=n[n[l].f<n[d].f?l++:d++],u=n[l!=c&&n[l].f<n[d].f?l++:d++],n[c++]={s:-1,f:s.f+u.f,l:s,r:u};var f=o[0].s;for(r=1;r<i;++r)o[r].s>f&&(f=o[r].s);var p=new ti(f+1),h=Ii(n[c-1],p,0);if(h>t){r=0;var v=0,g=h-t,m=1<<g;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;v+=m-(1<<h-p[_]),p[_]=t}for(v>>>=g;v>0;){var y=o[r].s;p[y]<t?v-=1<<t-p[y]++-1:++r}for(;r>=0&&v;--r){var b=o[r].s;p[b]==t&&(--p[b],++v)}h=t}return[new ei(p),h]},Ii=function e(t,n,r){return-1==t.s?Math.max(e(t.l,n,r+1),e(t.r,n,r+1)):n[t.s]=r},xi=function(e){for(var t=e.length;t&&!e[--t];);for(var n=new ti(++t),r=0,i=e[0],o=1,a=function(e){n[r++]=e},s=1;s<=t;++s)if(e[s]==i&&s!=t)++o;else{if(!i&&o>2){for(;o>138;o-=138)a(32754);o>2&&(a(o>10?o-11<<5|28690:o-3<<5|12305),o=0)}else if(o>3){for(a(i),--o;o>6;o-=6)a(8304);o>2&&(a(o-3<<5|8208),o=0)}for(;o--;)a(i);o=1,i=e[s]}return[n.subarray(0,r),t]},Fi=function(e,t){for(var n=0,r=0;r<t.length;++r)n+=e[r]*t[r];return n},Ei=function(e,t,n){var r=n.length,i=bi(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)},Oi=function(e,t,n,r,i,o,a,s,u,l,c){wi(t,c++,n),++i[256];for(var d=Ci(i,15),f=d[0],p=d[1],h=Ci(o,15),v=h[0],g=h[1],m=xi(f),_=m[0],y=m[1],b=xi(v),k=b[0],w=b[1],S=new ti(19),C=0;C<_.length;++C)S[31&_[C]]++;for(C=0;C<k.length;++C)S[31&k[C]]++;for(var I=Ci(S,7),x=I[0],F=I[1],E=19;E>4&&!x[oi[E-1]];--E);var O,R,M,T,P=l+5<<3,N=Fi(i,vi)+Fi(o,gi)+a,L=Fi(i,f)+Fi(o,v)+a+14+3*E+Fi(S,x)+(2*S[16]+3*S[17]+7*S[18]);if(P<=N&&P<=L)return Ei(t,c,e.subarray(u,u+l));if(wi(t,c,1+(L<N)),c+=2,L<N){O=hi(f,p,0),R=f,M=hi(v,g,0),T=v;var D=hi(x,F,0);wi(t,c,y-257),wi(t,c+5,w-1),wi(t,c+10,E-4),c+=14;for(C=0;C<E;++C)wi(t,c+3*C,x[oi[C]]);c+=3*E;for(var A=[_,k],$=0;$<2;++$){var q=A[$];for(C=0;C<q.length;++C){var B=31&q[C];wi(t,c,D[B]),c+=x[B],B>15&&(wi(t,c,q[C]>>>5&127),c+=q[C]>>>12)}}}else O=_i,R=vi,M=yi,T=gi;for(C=0;C<s;++C)if(r[C]>255){B=r[C]>>>18&31;Si(t,c,O[B+257]),c+=R[B+257],B>7&&(wi(t,c,r[C]>>>23&31),c+=ri[B]);var j=31&r[C];Si(t,c,M[j]),c+=T[j],j>3&&(Si(t,c,r[C]>>>5&8191),c+=ii[j])}else Si(t,c,O[r[C]]),c+=R[r[C]];return Si(t,c,O[256]),c+R[256]},Ri=new ni([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),Mi=new ei(0),Ti=function(){for(var e=new ni(256),t=0;t<256;++t){for(var n=t,r=9;--r;)n=(1&n&&3988292384)^n>>>1;e[t]=n}return e}(),Pi=function(){var e=4294967295;return{p:function(t){for(var n=e,r=0;r<t.length;++r)n=Ti[255&n^t[r]]^n>>>8;e=n},d:function(){return 4294967295^e}}},Ni=function(e,t,n,r,i){return function(e,t,n,r,i,o){var a=e.length,s=new ei(r+a+5*(1+Math.floor(a/7e3))+i),u=s.subarray(r,s.length-i),l=0;if(!t||a<8)for(var c=0;c<=a;c+=65535){var d=c+65535;d<a?l=Ei(u,l,e.subarray(c,d)):(u[c]=o,l=Ei(u,l,e.subarray(c,a)))}else{for(var f=Ri[t-1],p=f>>>13,h=8191&f,v=(1<<n)-1,g=new ti(32768),m=new ti(v+1),_=Math.ceil(n/3),y=2*_,b=function(t){return(e[t]^e[t+1]<<_^e[t+2]<<y)&v},k=new ni(25e3),w=new ti(288),S=new ti(32),C=0,I=0,x=(c=0,0),F=0,E=0;c<a;++c){var O=b(c),R=32767&c,M=m[O];if(g[R]=M,m[O]=R,F<=c){var T=a-c;if((C>7e3||x>24576)&&T>423){l=Oi(e,u,0,k,w,S,I,x,E,c-E,l),x=C=I=0,E=c;for(var P=0;P<286;++P)w[P]=0;for(P=0;P<30;++P)S[P]=0}var N=2,L=0,D=h,A=R-M&32767;if(T>2&&O==b(c-A))for(var $=Math.min(p,T)-1,q=Math.min(32767,c),B=Math.min(258,T);A<=q&&--D&&R!=M;){if(e[c+N]==e[c+N-A]){for(var j=0;j<B&&e[c+j]==e[c+j-A];++j);if(j>N){if(N=j,L=A,j>$)break;var H=Math.min(A,j-2),W=0;for(P=0;P<H;++P){var V=c-A+P+32768&32767,U=V-g[V]+32768&32767;U>W&&(W=U,M=V)}}}A+=(R=M)-(M=g[R])+32768&32767}if(L){k[x++]=268435456|li[N]<<18|ci[L];var z=31&li[N],G=31&ci[L];I+=ri[z]+ii[G],++w[257+z],++S[G],F=c+N,++C}else k[x++]=e[c],++w[e[c]]}}l=Oi(e,u,o,k,w,S,I,x,E,c-E,l),o||(l=Ei(u,l,Mi))}return ki(s,0,r+bi(l)+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)},Li=function(e,t,n){for(;n;++t)e[t]=n,n>>>=8},Di=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&&Li(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)}},Ai=function(e){return 10+(e.filename&&e.filename.length+1||0)};function $i(e,t){void 0===t&&(t={});var n=Pi(),r=e.length;n.p(e);var i=Ni(e,t,Ai(t),8),o=i.length;return Di(i,t),Li(i,o-8,n.d()),Li(i,o-4,r),i}function qi(e,t){var n=e.length;if(!t&&"undefined"!=typeof TextEncoder)return(new TextEncoder).encode(e);for(var r=new ei(e.length+(e.length>>>1)),i=0,o=function(e){r[i++]=e},a=0;a<n;++a){if(i+5>r.length){var s=new ei(i+8+(n-a<<1));s.set(r),r=s}var u=e.charCodeAt(a);u<128||t?o(u):u<2048?(o(192|u>>>6),o(128|63&u)):u>55295&&u<57344?(o(240|(u=65536+(1047552&u)|1023&e.charCodeAt(++a))>>>18),o(128|u>>>12&63),o(128|u>>>6&63),o(128|63&u)):(o(224|u>>>12),o(128|u>>>6&63),o(128|63&u))}return ki(r,0,i)}!function(e){e.GZipJS="gzip-js",e.Base64="base64"}(mi||(mi={}));var Bi=function(e,t,n){var r=t||{};r.ip=n.ip?1:0,r._=(new Date).getTime().toString(),r.ver=_t.LIB_VERSION;var i=e.split("?");if(i.length>1){var o,a=w(i[1].split("&"));try{for(a.s();!(o=a.n()).done;){var s=o.value.split("=")[0];Et(r[s])||delete r[s]}}catch(e){a.e(e)}finally{a.f()}}var u=e.indexOf("?")>-1?"&":"?";return e+u+function(e){var t,n,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"&",i=[];return $t(e,(function(e,r){Et(e)||Et(r)||"undefined"===r||(t=encodeURIComponent(e.toString()),n=encodeURIComponent(r),i[i.length]=n+"="+t)})),i.join(r)}(r)},ji=function e(t,n){if(n.blob&&t.buffer)return new Blob([Ct(t)?t:t.buffer],{type:"text/plain"});if(n.sendBeacon||n.blob){var r=e(t,{method:"POST"});return new Blob([r],{type:"application/x-www-form-urlencoded"})}return"POST"!==n.method?null:(i=St(t)||Ct(t)?"data="+encodeURIComponent(t):"data="+encodeURIComponent(t.data),"compression"in t&&t.compression&&(i+="&compression="+t.compression),i);var i},Hi=function(e){var t=e.url,n=e.data,r=e.headers,i=e.options,o=e.callback,a=e.retriesPerformedSoFar,s=e.retryQueue,u=e.onXHRError,l=e.timeout,c=void 0===l?6e4:l,d=e.onResponse;Mt(a)&&a>0&&(t=Bi(t,{retry_count:a},{}));var f=new XMLHttpRequest;f.open(i.method||"GET",t,!0);var p=ji(n,i);$t(r,(function(e,t){f.setRequestHeader(t,e)})),"POST"!==i.method||i.blob||f.setRequestHeader("Content-Type","application/x-www-form-urlencoded"),f.timeout=c,f.withCredentials=!0,f.onreadystatechange=function(){if(4===f.readyState)if(null==d||d(f),200===f.status){if(o){var e;try{e=JSON.parse(f.responseText)}catch(e){return void Nt.error(e)}o(e)}}else It(u)&&u(f),(f.status<400||f.status>500)&&s.enqueue({url:t,data:n,options:i,headers:r,retriesPerformedSoFar:(a||0)+1,callback:o}),null==o||o({status:0})},f.send(p)},Wi=18e5;var Vi=function(e){f(n,e);var t=m(n);function n(e,r){var i;return u(this,n),(i=t.call(this)).isPolling=!1,i.queue=[],i.areWeOnline=!0,i.onXHRError=e,i.rateLimiter=r,!Et(pt)&&"onLine"in pt.navigator&&(i.areWeOnline=pt.navigator.onLine,pt.addEventListener("online",(function(){i._handleWeAreNowOnline()})),pt.addEventListener("offline",(function(){i.areWeOnline=!1}))),i}return c(n,[{key:"enqueue",value:function(e){var t=e.retriesPerformedSoFar||0;if(!(t>=10)){var n=function(e){var t=3e3*Math.pow(2,e),n=t/2,r=Math.min(Wi,t),i=(Math.random()-.5)*(r-n);return Math.ceil(r+i)}(t),r=new Date(Date.now()+n);this.queue.push({retryAt:r,requestData:e});var i="Enqueued failed request for retry in ".concat(n);navigator.onLine||(i+=" (Browser is offline)"),Nt.warn(i),this.isPolling||(this.isPolling=!0,this.poll())}}},{key:"poll",value:function(){var e=this;this._poller&&clearTimeout(this._poller),this._poller=setTimeout((function(){e.areWeOnline&&e.queue.length>0&&e.flush(),e.poll()}),this._pollInterval)}},{key:"flush",value:function(){var e=new Date(Date.now()),t=this.queue.filter((function(t){return t.retryAt<e}));if(t.length>0){this.queue=this.queue.filter((function(t){return t.retryAt>=e}));var n,r=w(t);try{for(r.s();!(n=r.n()).done;){var i=n.value.requestData;this._executeXhrRequest(i)}}catch(e){r.e(e)}finally{r.f()}}}},{key:"unload",value:function(){this._poller&&(clearTimeout(this._poller),this._poller=void 0);var e,t=w(this.queue);try{for(t.s();!(e=t.n()).done;){var n=e.value.requestData,r=n.url,i=n.data,o=n.options;if(this.rateLimiter.isRateLimited(o._batchKey))Nt.warn("[RetryQueue] is quota limited. Dropping request.");else try{null==pt||pt.navigator.sendBeacon(r,ji(i,a(a({},o),{},{sendBeacon:!0})))}catch(e){Nt.error(e)}}}catch(e){t.e(e)}finally{t.f()}this.queue=[]}},{key:"_executeXhrRequest",value:function(e){var t=e.url,n=e.data,r=e.options,i=e.headers,o=e.callback,a=e.retriesPerformedSoFar;this.rateLimiter.isRateLimited(r._batchKey)||Hi({url:t,data:n||{},options:r||{},headers:i||{},retriesPerformedSoFar:a||0,callback:o,retryQueue:this,onXHRError:this.onXHRError,onResponse:this.rateLimiter.checkForLimiting})}},{key:"_handleWeAreNowOnline",value:function(){this.areWeOnline=!0,this.flush()}}]),n}(Kr),Ui=1800,zi=60,Gi=864e5,Yi=function(){function e(t,n,r,i){u(this,e),d(this,"_sessionIdChangedHandlers",[]),this.config=t,this.persistence=n,this._windowId=void 0,this._sessionId=void 0,this._sessionStartTimestamp=null,this._sessionActivityTimestamp=null,this._sessionIdGenerator=r||Jn,this._windowIdGenerator=i||Jn;var o=t.persistence_name||t.token,a=t.session_idle_timeout_seconds||Ui;if(Mt(a)?a>Ui?Nt.warn("session_idle_timeout_seconds cannot be greater than 30 minutes. Using 30 minutes instead."):a<zi&&Nt.warn("session_idle_timeout_seconds cannot be less than 60 seconds. Using 60 seconds instead."):(Nt.warn("session_idle_timeout_seconds must be a number. Defaulting to 30 minutes."),a=Ui),this._sessionTimeoutMs=1e3*Math.min(Math.max(a,zi),Ui),this._window_id_storage_key="ph_"+o+"_window_id",this._primary_window_exists_storage_key="ph_"+o+"_primary_window_exists",this._canUseSessionStorage()){var s=cr.parse(this._window_id_storage_key),l=cr.parse(this._primary_window_exists_storage_key);s&&!l?this._windowId=s:cr.remove(this._window_id_storage_key),cr.set(this._primary_window_exists_storage_key,!0)}this._listenToReloadWindow()}return c(e,[{key:"onSessionId",value:function(e){var t=this;return Et(this._sessionIdChangedHandlers)&&(this._sessionIdChangedHandlers=[]),this._sessionIdChangedHandlers.push(e),this._sessionId&&e(this._sessionId,this._windowId),function(){t._sessionIdChangedHandlers=t._sessionIdChangedHandlers.filter((function(t){return t!==e}))}}},{key:"_canUseSessionStorage",value:function(){return"memory"!==this.config.persistence&&!this.persistence.disabled&&cr.is_supported()}},{key:"_setWindowId",value:function(e){e!==this._windowId&&(this._windowId=e,this._canUseSessionStorage()&&cr.set(this._window_id_storage_key,e))}},{key:"_getWindowId",value:function(){return this._windowId?this._windowId:this._canUseSessionStorage()?cr.parse(this._window_id_storage_key):null}},{key:"_setSessionId",value:function(e,t,n){e===this._sessionId&&t===this._sessionActivityTimestamp&&n===this._sessionStartTimestamp||(this._sessionStartTimestamp=n,this._sessionActivityTimestamp=t,this._sessionId=e,this.persistence.register(d({},Cn,[t,e,n])))}},{key:"_getSessionId",value:function(){if(this._sessionId&&this._sessionActivityTimestamp&&this._sessionStartTimestamp)return[this._sessionActivityTimestamp,this._sessionId,this._sessionStartTimestamp];var e=this.persistence.props[Cn];return St(e)&&2===e.length&&e.push(e[0]),e||[0,null,0]}},{key:"resetSessionId",value:function(){this._setSessionId(null,null,null)}},{key:"_listenToReloadWindow",value:function(){var e=this;null==pt||pt.addEventListener("beforeunload",(function(){e._canUseSessionStorage()&&cr.remove(e._primary_window_exists_storage_key)}))}},{key:"checkAndGetSessionAndWindowId",value:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=(arguments.length>1&&void 0!==arguments[1]?arguments[1]:null)||(new Date).getTime(),n=_(this._getSessionId(),3),r=n[0],i=n[1],o=n[2],a=this._getWindowId(),s=o&&o>0&&Math.abs(t-o)>Gi,u=!1,l=!i,c=!e&&Math.abs(t-r)>this._sessionTimeoutMs;l||c||s?(i=this._sessionIdGenerator(),a=this._windowIdGenerator(),o=t,u=!0):a||(a=this._windowIdGenerator(),u=!0);var d=0===r||!e||s?t:r,f=0===o?(new Date).getTime():o;return this._setWindowId(a),this._setSessionId(i,d,f),u&&this._sessionIdChangedHandlers.forEach((function(e){return e(i,a)})),{sessionId:i,windowId:a,sessionStartTimestamp:f}}}]),e}(),Ji=c((function e(t,n,r,i){u(this,e),this.name="posthog-js",this.setupOnce=function(e){e((function(e){var o,a,s,u,l;if("error"!==e.level||!t.__loaded)return e;e.tags||(e.tags={});var c=t.config.ui_host||t.config.api_host;e.tags["PostHog Person URL"]=c+"/person/"+t.get_distinct_id(),t.sessionRecordingStarted()&&(e.tags["PostHog Recording URL"]=t.get_session_replay_url({withTimestamp:!0}));var d=(null===(o=e.exception)||void 0===o?void 0:o.values)||[],f={$exception_message:null===(a=d[0])||void 0===a?void 0:a.value,$exception_type:null===(s=d[0])||void 0===s?void 0:s.type,$exception_personURL:c+"/person/"+t.get_distinct_id(),$sentry_event_id:e.event_id,$sentry_exception:e.exception,$sentry_exception_message:null===(u=d[0])||void 0===u?void 0:u.value,$sentry_exception_type:null===(l=d[0])||void 0===l?void 0:l.type,$sentry_tags:e.tags};return n&&r&&(f.$sentry_url=(i||"https://sentry.io/organizations/")+n+"/issues/?project="+r+"&query="+e.event_id),t.capture("$exception",f),e}))}})),Qi=function(e){Promise&&Promise.resolve||Nt.warn("This browser does not have Promise support, and can not use the segment integration");var t=function(t,n){t.event.userId||t.event.anonymousId===e.get_distinct_id()||e.reset(),t.event.userId&&t.event.userId!==e.get_distinct_id()&&(e.register({distinct_id:t.event.userId}),e.reloadFeatureFlags());var r=e._calculate_event_properties(n,t.event.properties);return t.event.properties=Object.assign({},r,t.event.properties),t};return{name:"PostHog JS",type:"enrichment",version:"1.0.0",isLoaded:function(){return!0},load:function(){return Promise.resolve()},track:function(e){return t(e,e.event.event)},page:function(e){return t(e,"$pageview")},identify:function(e){return t(e,"$identify")},screen:function(e){return t(e,"$screen")}}},Xi=function(){function e(){var t=this;u(this,e),d(this,"_hasSeenPageView",!1),d(this,"_updateScrollData",(function(){var e,n,r,i;t._pageViewData||(t._pageViewData=t._createPageViewData());var o=t._pageViewData,a=t._scrollY(),s=t._scrollHeight(),u=t._contentY(),l=t._contentHeight();o.lastScrollY=a,o.maxScrollY=Math.max(a,null!==(e=o.maxScrollY)&&void 0!==e?e:0),o.maxScrollHeight=Math.max(s,null!==(n=o.maxScrollHeight)&&void 0!==n?n:0),o.lastContentY=u,o.maxContentY=Math.max(u,null!==(r=o.maxContentY)&&void 0!==r?r:0),o.maxContentHeight=Math.max(l,null!==(i=o.maxContentHeight)&&void 0!==i?i:0)}))}return c(e,[{key:"_createPageViewData",value:function(){var e;return{pathname:null!==(e=null==pt?void 0:pt.location.pathname)&&void 0!==e?e:""}}},{key:"doPageView",value:function(){var e,t;return this._hasSeenPageView?(t=this._pageViewData,this._pageViewData=this._createPageViewData()):(this._hasSeenPageView=!0,t=void 0,this._pageViewData||(this._pageViewData=this._createPageViewData())),setTimeout(this._updateScrollData,0),a({$prev_pageview_pathname:null===(e=t)||void 0===e?void 0:e.pathname},this._calculatePrevPageScrollProperties(t))}},{key:"doPageLeave",value:function(){var e=this._pageViewData;return a({$prev_pageview_pathname:null==e?void 0:e.pathname},this._calculatePrevPageScrollProperties(e))}},{key:"_calculatePrevPageScrollProperties",value:function(e){if(!e||null==e.maxScrollHeight||null==e.lastScrollY||null==e.maxScrollY||null==e.maxContentHeight||null==e.lastContentY||null==e.maxContentY)return{};var t=e.maxScrollHeight,n=e.lastScrollY,r=e.maxScrollY,i=e.maxContentHeight,o=e.lastContentY,a=e.maxContentY;return t=Math.ceil(t),n=Math.ceil(n),r=Math.ceil(r),i=Math.ceil(i),o=Math.ceil(o),a=Math.ceil(a),{$prev_pageview_last_scroll:n,$prev_pageview_last_scroll_percentage:t<=1?1:Ki(n/t,0,1),$prev_pageview_max_scroll:r,$prev_pageview_max_scroll_percentage:t<=1?1:Ki(r/t,0,1),$prev_pageview_last_content:o,$prev_pageview_last_content_percentage:i<=1?1:Ki(o/i,0,1),$prev_pageview_max_content:a,$prev_pageview_max_content_percentage:i<=1?1:Ki(a/i,0,1)}}},{key:"startMeasuringScrollPosition",value:function(){null==pt||pt.addEventListener("scroll",this._updateScrollData),null==pt||pt.addEventListener("scrollend",this._updateScrollData),null==pt||pt.addEventListener("resize",this._updateScrollData)}},{key:"stopMeasuringScrollPosition",value:function(){null==pt||pt.removeEventListener("scroll",this._updateScrollData),null==pt||pt.removeEventListener("scrollend",this._updateScrollData),null==pt||pt.removeEventListener("resize",this._updateScrollData)}},{key:"_scrollHeight",value:function(){return pt?Math.max(0,pt.document.documentElement.scrollHeight-pt.document.documentElement.clientHeight):0}},{key:"_scrollY",value:function(){return pt&&(pt.scrollY||pt.pageYOffset||pt.document.documentElement.scrollTop)||0}},{key:"_contentHeight",value:function(){return(null==pt?void 0:pt.document.documentElement.scrollHeight)||0}},{key:"_contentY",value:function(){var e=(null==pt?void 0:pt.document.documentElement.clientHeight)||0;return this._scrollY()+e}}]),e}();function Ki(e,t,n){return Math.max(t,Math.min(e,n))}var Zi,eo,to,no={icontains:function(e){return!!pt&&pt.location.href.toLowerCase().indexOf(e.toLowerCase())>-1},regex:function(e){return!!pt&&pr(pt.location.href,e)},exact:function(e){return(null==pt?void 0:pt.location.href)===e}},ro=function(){function e(t){u(this,e),this.instance=t}return c(e,[{key:"getSurveys",value:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]&&arguments[1],r=this.instance.get_property(Rn);if(r&&!n)return e(r);this.instance._send_request("".concat(this.instance.config.api_host,"/api/surveys/?token=").concat(this.instance.config.token),{},{method:"GET"},(function(n){var r,i=n.surveys||[];return null===(r=t.instance.persistence)||void 0===r||r.register(d({},Rn,i)),e(i)}))}},{key:"getActiveMatchingSurveys",value:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]&&arguments[1];this.getSurveys((function(n){var r=n.filter((function(e){return!(!e.start_date||e.end_date)})).filter((function(e){var t,n,r,i;if(!e.conditions)return!0;var o=null===(t=e.conditions)||void 0===t||!t.url||no[null!==(n=null===(r=e.conditions)||void 0===r?void 0:r.urlMatchType)&&void 0!==n?n:"icontains"](e.conditions.url),a=null===(i=e.conditions)||void 0===i||!i.selector||(null==vt?void 0:vt.querySelector(e.conditions.selector));return o&&a})).filter((function(e){if(!e.linked_flag_key&&!e.targeting_flag_key)return!0;var n=!e.linked_flag_key||t.instance.featureFlags.isFeatureEnabled(e.linked_flag_key),r=!e.targeting_flag_key||t.instance.featureFlags.isFeatureEnabled(e.targeting_flag_key);return n&&r}));return e(r)}),n)}}]),e}(),io=6e4,oo=function(){function e(){var t=this;u(this,e),d(this,"limits",{}),d(this,"checkForLimiting",(function(e){try{var n=e.responseText;if(!n||!n.length)return;(JSON.parse(n).quota_limited||[]).forEach((function(e){Nt.info("[RateLimiter] ".concat(e||"events"," is quota limited.")),t.limits[e]=(new Date).getTime()+io}))}catch(e){return void Nt.error(e)}}))}return c(e,[{key:"isRateLimited",value:function(e){var t=this.limits[e||"events"]||!1;return!1!==t&&(new Date).getTime()<t}}]),e}(),ao=function(){return a({initialPathName:(null==pt?void 0:pt.location.pathname)||"",referringDomain:gr.referringDomain()},gr.campaignParams())},so=function(){function e(t,n,r){var i=this;u(this,e),d(this,"_onSessionIdCallback",(function(e){var t=i._getStoredProps();if(!t||t.sessionId!==e){var n={sessionId:e,props:i._sessionSourceParamGenerator()};i._persistence.register(d({},Nn,n))}})),this._sessionIdManager=t,this._persistence=n,this._sessionSourceParamGenerator=r||ao,this._sessionIdManager.onSessionId(this._onSessionIdCallback)}return c(e,[{key:"_getStoredProps",value:function(){return this._persistence.props[Nn]}},{key:"getSessionProps",value:function(){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}:{}}}]),e}(),uo=["ahrefsbot","applebot","baiduspider","bingbot","bingpreview","bot.htm","bot.php","crawler","duckduckbot","facebookexternal","facebookcatalog","gptbot","hubspot","linkedinbot","mj12bot","petalbot","pinterest","prerender","rogerbot","screaming frog","semrushbot","sitebulb","twitterbot","yahoo! slurp","yandexbot","adsbot-google","apis-google","duplexweb-google","feedfetcher-google","google favicon","google web preview","google-read-aloud","googlebot","googleweblight","mediapartners-google","storebot-google"],lo=function(e,t){if(!e)return!1;var n=e.toLowerCase();return uo.concat(t||[]).some((function(e){var t=e.toLowerCase();return n.includes?n.includes(t):-1!==n.indexOf(t)}))};!function(e){e[e.INIT_MODULE=0]="INIT_MODULE",e[e.INIT_SNIPPET=1]="INIT_SNIPPET"}(Zi||(Zi={}));var co=function(){},fo={},po="posthog",ho=(null==pt?void 0:pt.XMLHttpRequest)&&"withCredentials"in new XMLHttpRequest,vo=!ho&&-1===(null==gt?void 0:gt.indexOf("MSIE"))&&-1===(null==gt?void 0:gt.indexOf("Mozilla")),go=function(){var e,t,n;return{api_host:"https://app.posthog.com",api_method:"POST",api_transport:"XHR",ui_host:null,token:"",autocapture:!0,rageclick:!0,cross_subdomain_cookie:(t=null==vt?void 0:vt.location,n=null==t?void 0:t.hostname,!!Ot(n)&&"herokuapp.com"!==n.split(".").slice(-2).join(".")),persistence:"localStorage+cookie",persistence_name:"",cookie_name:"",loaded:co,store_google:!0,custom_campaign_params:[],custom_blocked_useragents:[],save_referrer:!0,capture_pageview:!0,capture_pageleave:!0,debug:!1,verbose:!1,cookie_expiration:365,upgrade:!1,disable_session_recording:!1,disable_persistence:!1,disable_cookie:!1,enable_recording_console_log:void 0,secure_cookie:"https:"===(null==pt||null===(e=pt.location)||void 0===e?void 0:e.protocol),ip:!0,opt_out_capturing_by_default:!1,opt_out_persistence_by_default:!1,opt_out_capturing_persistence_type:"localStorage",opt_out_capturing_cookie_prefix:null,opt_in_site_apps:!1,property_blacklist:[],respect_dnt:!1,sanitize_properties:null,xhr_headers:{},inapp_protocol:"//",inapp_link_new_window:!1,request_batching:!0,properties_string_max_length:65535,session_recording:{},mask_all_element_attributes:!1,mask_all_text:!1,advanced_disable_decide:!1,advanced_disable_feature_flags:!1,advanced_disable_feature_flags_on_first_load:!1,advanced_disable_toolbar_metrics:!1,on_xhr_error:function(e){var t="Bad HTTP status: "+e.status+" "+e.statusText;Nt.error(t)},get_device_id:function(e){return e},_onCapture:co,capture_performance:void 0,name:"posthog",callback_fn:"posthog._jsc",bootstrap:{},disable_compression:!1,session_idle_timeout_seconds:1800}},mo=function(e,t,n,r){var i,o=n!==po&&to?n?to[n]:void 0:to,a={initComplete:!1,syncCode:!1},s=function(e){return function(t){a[e]||(a[e]=!0,a.initComplete&&a.syncCode&&(null==r||r(t)))}};if(o&&eo===Zi.INIT_MODULE)i=o;else{if(o&&!St(o))return void Nt.error("You have already initialized "+n);i=new yo}if(i._init(e,t,n,s("initComplete")),i.toolbar.maybeLoadToolbar(),i.sessionRecording=new Dr(i),i.sessionRecording.startRecordingIfEnabled(),i.config.__preview_measure_pageview_stats&&i.pageViewManager.startMeasuringScrollPosition(),i.__autocapture=i.config.autocapture,An._setIsAutocaptureEnabled(i),An._isAutocaptureEnabled){i.__autocapture=i.config.autocapture;An.enabledForProject(i.config.token,100,100)?An.isBrowserSupported()?An.init(i):(i.__autocapture=!1,Nt.info("Disabling Automatic Event Collection because this browser is not supported")):(i.__autocapture=!1,Nt.info("Not in active bucket: disabling Automatic Event Collection."))}return _t.DEBUG=_t.DEBUG||i.config.debug,!Et(o)&&St(o)&&(i._execute_array.call(i.people,o.people),i._execute_array(o)),s("syncCode")(i),i},_o=function(){function e(){u(this,e),d(this,"__forceAllowLocalhost",!1)}return c(e,[{key:"_forceAllowLocalhost",get:function(){return this.__forceAllowLocalhost},set:function(e){Nt.error("WebPerformanceObserver is deprecated and has no impact on network capture. Use `_forceAllowLocalhostNetworkCapture` on `posthog.sessionRecording`"),this.__forceAllowLocalhost=e}}]),e}(),yo=function(){function e(){var t=this;u(this,e),d(this,"webPerformance",new _o),this.config=go(),this.compression={},this.decideEndpointWasHit=!1,this.SentryIntegration=Ji,this.segmentIntegration=function(){return Qi(t)},this.__captureHooks=[],this.__request_queue=[],this.__loaded=!1,this.__loaded_recorder_version=void 0,this.__autocapture=void 0,this._jsc=function(){},this.analyticsDefaultEndpoint="/e/",this.elementsChainAsString=!1,this.featureFlags=new Hn(this),this.toolbar=new jr(this),this.pageViewManager=new Xi,this.surveys=new ro(this),this.rateLimiter=new oo,this.people={set:function(e,n,r){var i=Ot(e)?d({},e,n):e;t.setPersonProperties(i),null==r||r({})},set_once:function(e,n,r){var i=Ot(e)?d({},e,n):e;t.setPersonProperties(void 0,i),null==r||r({})}}}return c(e,[{key:"init",value:function(e,t,n){if(Et(n))Nt.critical("You must name your new library: init(token, config, name)");else{if(n!==po){var r=mo(e,t,n,(function(e){to[n]=e,e._loaded()}));return to[n]=r,r}Nt.critical("You must initialize the main posthog object right after you include the PostHog js snippet")}}},{key:"_init",value:function(e){var t,n,r,i=this,o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},s=arguments.length>2?arguments[2]:void 0,u=arguments.length>3?arguments[3]:void 0;this.__loaded=!0,this.config={},this._triggered_notifs=[];var l,c={segmentRegister:!1,syncCode:!1},d=function(e){return function(){c[e]||(c[e]=!0,c.segmentRegister&&c.syncCode&&(null==u||u(i)))}};(this.set_config(qt({},go(),o,{name:s,token:e,callback_fn:(s===po?s:po+"."+s)+"._jsc"})),this._jsc=function(){},null!=pt&&null!==(t=pt.rrweb)&&void 0!==t&&t.record||null!=pt&&pt.rrwebRecord)&&(this.__loaded_recorder_version=null==pt||null===(l=pt.rrweb)||void 0===l?void 0:l.version);if(this.persistence=new _r(this.config),this._requestQueue=new Zr(this._handle_queued_event.bind(this)),this._retryQueue=new Vi(this.config.on_xhr_error,this.rateLimiter),this.__captureHooks=[],this.__request_queue=[],this.sessionManager=new Yi(this.config,this.persistence),this.sessionPropsManager=new so(this.sessionManager,this.persistence),this.sessionPersistence="sessionStorage"===this.config.persistence?this.persistence:new _r(a(a({},this.config),{},{persistence:"sessionStorage"})),this._gdpr_init(),o.segment?(this.config.get_device_id=function(){return o.segment.user().anonymousId()},o.segment.user().id()&&(this.register({distinct_id:o.segment.user().id()}),this.persistence.set_user_state("identified")),o.segment.register(this.segmentIntegration()).then(d("segmentRegister"))):d("segmentRegister")(),void 0!==(null===(n=o.bootstrap)||void 0===n?void 0:n.distinctID)){var f,p,h=this.config.get_device_id(Jn()),v=null!==(f=o.bootstrap)&&void 0!==f&&f.isIdentifiedID?h:o.bootstrap.distinctID;this.persistence.set_user_state(null!==(p=o.bootstrap)&&void 0!==p&&p.isIdentifiedID?"identified":"anonymous"),this.register({distinct_id:o.bootstrap.distinctID,$device_id:v})}if(this._hasBootstrappedFeatureFlags()){var g,m,_=Object.keys((null===(g=o.bootstrap)||void 0===g?void 0:g.featureFlags)||{}).filter((function(e){var t,n;return!(null===(t=o.bootstrap)||void 0===t||null===(n=t.featureFlags)||void 0===n||!n[e])})).reduce((function(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}),{}),y=Object.keys((null===(m=o.bootstrap)||void 0===m?void 0:m.featureFlagPayloads)||{}).filter((function(e){return _[e]})).reduce((function(e,t){var n,r,i,a;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===(a=i.featureFlagPayloads)||void 0===a?void 0:a[t]);return e}),{});this.featureFlags.receivedFeatureFlags({featureFlags:_,featureFlagPayloads:y})}if(!this.get_distinct_id()){var b=this.config.get_device_id(Jn());this.register_once({distinct_id:b,$device_id:b},""),this.persistence.set_user_state("anonymous")}null==pt||null===(r=pt.addEventListener)||void 0===r||r.call(pt,"onpagehide"in self?"pagehide":"unload",this._handle_unload.bind(this)),d("syncCode")()}},{key:"_afterDecideResponse",value:function(e){var t;if(this.compression={},e.supportedCompression&&!this.config.disable_compression){var n,r={},i=w(e.supportedCompression);try{for(i.s();!(n=i.n()).done;){r[n.value]=!0}}catch(e){i.e(e)}finally{i.f()}this.compression=r}null!==(t=e.analytics)&&void 0!==t&&t.endpoint&&(this.analyticsDefaultEndpoint=e.analytics.endpoint),e.elementsChainAsString&&(this.elementsChainAsString=e.elementsChainAsString)}},{key:"_loaded",value:function(){var e=this.config.advanced_disable_decide;e||this.featureFlags.setReloadingPaused(!0);try{this.config.loaded(this)}catch(e){Nt.critical("`loaded` function failed",e)}this._start_queue_if_opted_in(),this.config.capture_pageview&&vt&&this.capture("$pageview",{title:vt.title},{send_instantly:!0}),e||(new Ar(this).call(),this.featureFlags.resetRequestQueue())}},{key:"_start_queue_if_opted_in",value:function(){var e;this.has_opted_out_capturing()||this.config.request_batching&&(null===(e=this._requestQueue)||void 0===e||e.poll())}},{key:"_dom_loaded",value:function(){var e=this;this.has_opted_out_capturing()||At(this.__request_queue,(function(t){e._send_request.apply(e,y(t))})),this.__request_queue=[],this._start_queue_if_opted_in()}},{key:"_prepare_callback",value:function(e,t){if(Et(e))return null;if(ho)return function(n){e(n,t)};var n=this._jsc,r=""+Math.floor(1e8*Math.random()),i=this.config.callback_fn+"["+r+"]";return n[r]=function(i){delete n[r],e(i,t)},i}},{key:"_handle_unload",value:function(){var e,t;this.config.request_batching?(this.config.capture_pageview&&this.config.capture_pageleave&&this.capture("$pageleave"),null===(e=this._requestQueue)||void 0===e||e.unload(),null===(t=this._retryQueue)||void 0===t||t.unload()):this.config.capture_pageview&&this.config.capture_pageleave&&this.capture("$pageleave",null,{transport:"sendBeacon"})}},{key:"_handle_queued_event",value:function(e,t,n){var r=JSON.stringify(t);this.__compress_and_send_json_request(e,r,n||fo,co)}},{key:"__compress_and_send_json_request",value:function(e,t,n,r){var i=function(e,t,n){return e===mi.GZipJS?[$i(qi(t),{mtime:0}),a(a({},n),{},{blob:!0,urlQueryArgs:{compression:mi.GZipJS}})]:[{data:Yt(t)},n]}(this.compression[mi.GZipJS]?mi.GZipJS:mi.Base64,t,n),o=_(i,2),s=o[0],u=o[1];this._send_request(e,s,u,r)}},{key:"_send_request",value:function(e,t,n,r){if(this.__loaded&&this._retryQueue&&!this.rateLimiter.isRateLimited(n._batchKey))if(vo)this.__request_queue.push([e,t,n,r]);else{var i={method:this.config.api_method,transport:this.config.api_transport,verbose:this.config.verbose};n=qt(i,n||{}),ho||(n.method="GET");var o=pt&&"sendBeacon"in pt.navigator&&"sendBeacon"===n.transport;if(e=Bi(e,n.urlQueryArgs||{},{ip:this.config.ip}),o)try{null==pt||pt.navigator.sendBeacon(e,ji(t,a(a({},n),{},{sendBeacon:!0})))}catch(e){}else if(ho||!vt)try{Hi({url:e,data:t,headers:this.config.xhr_headers,options:n,callback:r,retriesPerformedSoFar:0,retryQueue:this._retryQueue,onXHRError:this.config.on_xhr_error,onResponse:this.rateLimiter.checkForLimiting})}catch(e){Nt.error(e)}else{var s,u=vt.createElement("script");u.type="text/javascript",u.async=!0,u.defer=!0,u.src=e;var l=vt.getElementsByTagName("script")[0];null===(s=l.parentNode)||void 0===s||s.insertBefore(u,l)}}}},{key:"_execute_array",value:function(e){var t,n=this,r=[],i=[],o=[];At(e,(function(e){e&&(t=e[0],St(t)?o.push(e):It(e)?e.call(n):St(e)&&"alias"===t?r.push(e):St(e)&&-1!==t.indexOf("capture")&&It(n[t])?o.push(e):i.push(e))}));var a=function(e,t){At(e,(function(e){if(St(e[0])){var n=t;$t(e,(function(e){n=n[e[0]].apply(n,e.slice(1))}))}else this[e[0]].apply(this,e.slice(1))}),t)};a(r,this),a(i,this),a(o,this)}},{key:"_hasBootstrappedFeatureFlags",value:function(){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}},{key:"push",value:function(e){this._execute_array([e])}},{key:"capture",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:fo;if(!this.__loaded||!this.sessionPersistence||!this._requestQueue)return Nt.uninitializedWarning("posthog.capture");if(!function(e){var t=!1;try{var n=e.config.token,r=e.config.respect_dnt,i=e.config.opt_out_capturing_persistence_type,o=e.config.opt_out_capturing_cookie_prefix||void 0,a=e.config.window;n&&(t=zr(n,{respectDnt:r,persistenceType:i,persistencePrefix:o,window:a}))}catch(e){Nt.error("Unexpected error when checking capturing opt-out status: "+e)}return t}(this)){var r=(n=n||fo).transport;if(r&&(n.transport=r),!Et(e)&&Ot(e)){if(!gt||!lo(gt,this.config.custom_blocked_useragents)){this.sessionPersistence.update_search_keyword(),this.config.store_google&&this.sessionPersistence.update_campaign_params(),this.config.save_referrer&&this.sessionPersistence.update_referrer_info();var i={uuid:Jn(),event:e,properties:this._calculate_event_properties(e,t||{})};"$identify"===e&&(i.$set=n.$set,i.$set_once=n.$set_once),(i=Gt(i,n._noTruncate?null:this.config.properties_string_max_length)).timestamp=n.timestamp||new Date;var o=a(a({},i.properties.$set),i.$set);Ft(o)||this.setPersonPropertiesForFlags(o),Nt.info("send",i);var s=JSON.stringify(i),u=this.config.api_host+(n.endpoint||this.analyticsDefaultEndpoint),l=n!==fo;return!this.config.request_batching||l&&!n._batchKey||n.send_instantly?this.__compress_and_send_json_request(u,s,n):this._requestQueue.enqueue(u,i,n),this._invokeCaptureHooks(e,i),i}}else Nt.error("No event name provided to posthog.capture")}}},{key:"_addCaptureHook",value:function(e){this.__captureHooks.push(e)}},{key:"_invokeCaptureHooks",value:function(e,t){this.config._onCapture(e,t),$t(this.__captureHooks,(function(t){return t(e)}))}},{key:"_calculate_event_properties",value:function(e,t){if(!this.persistence||!this.sessionPersistence)return t;var n=this.persistence.remove_event_timer(e),r=a({},t);if(r.token=this.config.token,"$snapshot"===e){var i=a(a({},this.persistence.properties()),this.sessionPersistence.properties());return r.distinct_id=i.distinct_id,r}var o=gr.properties();if(this.sessionManager){var s=this.sessionManager.checkAndGetSessionAndWindowId(),u=s.sessionId,l=s.windowId;r.$session_id=u,r.$window_id=l}if(this.sessionPropsManager&&this.config.__preview_send_client_session_params&&("$pageview"===e||"$pageleave"===e||"$autocapture"===e)){var c=this.sessionPropsManager.getSessionProps();r=qt(r,c)}if(this.config.__preview_measure_pageview_stats){var d={};"$pageview"===e?d=this.pageViewManager.doPageView():"$pageleave"===e&&(d=this.pageViewManager.doPageLeave()),r=qt(r,d)}if("$pageview"===e&&vt&&(r.title=vt.title),"$performance_event"===e){var f=this.persistence.properties();return r.distinct_id=f.distinct_id,r.$current_url=o.$current_url,r}if(!Et(n)){var p=(new Date).getTime()-n;r.$duration=parseFloat((p/1e3).toFixed(3))}r=qt({},gr.properties(),this.persistence.properties(),this.sessionPersistence.properties(),r);var h=this.config.property_blacklist;St(h)?$t(h,(function(e){delete r[e]})):Nt.error("Invalid value for property_blacklist config: "+h);var v=this.config.sanitize_properties;return v&&(r=v(r,e)),r}},{key:"register",value:function(e,t){var n;null===(n=this.persistence)||void 0===n||n.register(e,t)}},{key:"register_once",value:function(e,t,n){var r;null===(r=this.persistence)||void 0===r||r.register_once(e,t,n)}},{key:"register_for_session",value:function(e){var t;null===(t=this.sessionPersistence)||void 0===t||t.register(e)}},{key:"unregister",value:function(e){var t;null===(t=this.persistence)||void 0===t||t.unregister(e)}},{key:"unregister_for_session",value:function(e){var t;null===(t=this.sessionPersistence)||void 0===t||t.unregister(e)}},{key:"_register_single",value:function(e,t){this.register(d({},e,t))}},{key:"getFeatureFlag",value:function(e,t){return this.featureFlags.getFeatureFlag(e,t)}},{key:"getFeatureFlagPayload",value:function(e){var t=this.featureFlags.getFeatureFlagPayload(e);try{return JSON.parse(t)}catch(e){return t}}},{key:"isFeatureEnabled",value:function(e,t){return this.featureFlags.isFeatureEnabled(e,t)}},{key:"reloadFeatureFlags",value:function(){this.featureFlags.reloadFeatureFlags()}},{key:"updateEarlyAccessFeatureEnrollment",value:function(e,t){this.featureFlags.updateEarlyAccessFeatureEnrollment(e,t)}},{key:"getEarlyAccessFeatures",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return this.featureFlags.getEarlyAccessFeatures(e,t)}},{key:"onFeatureFlags",value:function(e){return this.featureFlags.onFeatureFlags(e)}},{key:"onSessionId",value:function(e){var t,n;return null!==(t=null===(n=this.sessionManager)||void 0===n?void 0:n.onSessionId(e))&&void 0!==t?t:function(){}}},{key:"getSurveys",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];this.surveys.getSurveys(e,t)}},{key:"getActiveMatchingSurveys",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];this.surveys.getActiveMatchingSurveys(e,t)}},{key:"identify",value:function(e,t,n){if(!this.__loaded||!this.persistence)return Nt.uninitializedWarning("posthog.identify");if(e)if(["distinct_id","distinctid"].includes(e.toLowerCase()))Nt.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{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(mn)&&(this.unregister(mn),this.register({distinct_id:e}));var o="anonymous"===this.persistence.get_user_state();e!==r&&o?(this.persistence.set_user_state("identified"),this.setPersonPropertiesForFlags(t||{},!1),this.capture("$identify",{distinct_id:e,$anon_distinct_id:r},{$set:t||{},$set_once:n||{}}),this.featureFlags.setAnonymousDistinctId(r)):(t||n)&&this.setPersonProperties(t,n),e!==r&&(this.reloadFeatureFlags(),this.unregister(Mn))}else Nt.error("Unique user id has not been set in posthog.identify")}},{key:"setPersonProperties",value:function(e,t){(e||t)&&(this.setPersonPropertiesForFlags(e||{}),this.capture("$set",{$set:e||{},$set_once:t||{}}))}},{key:"group",value:function(e,t,n){if(e&&t){var r=this.getGroups();r[e]!==t&&this.resetGroupPropertiesForFlags(e),this.register({$groups:a(a({},r),{},d({},e,t))}),n&&(this.capture("$groupidentify",{$group_type:e,$group_key:t,$group_set:n}),this.setGroupPropertiesForFlags(d({},e,n))),r[e]===t||n||this.reloadFeatureFlags()}else Nt.error("posthog.group requires a group type and group key")}},{key:"resetGroups",value:function(){this.register({$groups:{}}),this.resetGroupPropertiesForFlags(),this.reloadFeatureFlags()}},{key:"setPersonPropertiesForFlags",value:function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];this.featureFlags.setPersonPropertiesForFlags(e,t)}},{key:"resetPersonPropertiesForFlags",value:function(){this.featureFlags.resetPersonPropertiesForFlags()}},{key:"setGroupPropertiesForFlags",value:function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];this.featureFlags.setGroupPropertiesForFlags(e,t)}},{key:"resetGroupPropertiesForFlags",value:function(e){this.featureFlags.resetGroupPropertiesForFlags(e)}},{key:"reset",value:function(e){var t,n,r,i;if(!this.__loaded)return Nt.uninitializedWarning("posthog.reset");var o=this.get_property("$device_id");null===(t=this.persistence)||void 0===t||t.clear(),null===(n=this.sessionPersistence)||void 0===n||n.clear(),null===(r=this.persistence)||void 0===r||r.set_user_state("anonymous"),null===(i=this.sessionManager)||void 0===i||i.resetSessionId();var a=this.config.get_device_id(Jn());this.register_once({distinct_id:a,$device_id:e?a:o},"")}},{key:"get_distinct_id",value:function(){return this.get_property("distinct_id")}},{key:"getGroups",value:function(){return this.get_property("$groups")||{}}},{key:"get_session_id",value:function(){var e,t;return null!==(e=null===(t=this.sessionManager)||void 0===t?void 0:t.checkAndGetSessionAndWindowId(!0).sessionId)&&void 0!==e?e:""}},{key:"get_session_replay_url",value:function(e){if(!this.sessionManager)return"";var t=this.config.ui_host||this.config.api_host,n=this.sessionManager.checkAndGetSessionAndWindowId(!0),r=n.sessionId,i=n.sessionStartTimestamp,o=t+"/replay/"+r;if(null!=e&&e.withTimestamp&&i){var a,s=null!==(a=e.timestampLookBack)&&void 0!==a?a:10;if(!i)return o;var u=Math.max(Math.floor(((new Date).getTime()-i)/1e3)-s,0);o+="?t=".concat(u)}return o}},{key:"alias",value:function(e,t){return e===this.get_property(gn)?(Nt.critical("Attempting to create alias for existing People user - aborting."),-2):(Et(t)&&(t=this.get_distinct_id()),e!==t?(this._register_single(mn,e),this.capture("$create_alias",{alias:e,distinct_id:t})):(Nt.warn("alias matches current distinct_id - skipping api call."),this.identify(e),-1))}},{key:"set_config",value:function(e){var t,n,r=a({},this.config);xt(e)&&(qt(this.config,e),this.config.persistence_name||(this.config.persistence_name=this.config.cookie_name),this.config.disable_persistence||(this.config.disable_persistence=this.config.disable_cookie),this.config.api_host=this.config.api_host.replace(/\/$/,""),null===(t=this.persistence)||void 0===t||t.update_config(this.config),null===(n=this.sessionPersistence)||void 0===n||n.update_config(this.config),ir.is_supported()&&"true"===ir.get("ph_debug")&&(this.config.debug=!0),this.config.debug&&(_t.DEBUG=!0),this.sessionRecording&&!Et(e.disable_session_recording)&&r.disable_session_recording!==e.disable_session_recording&&(e.disable_session_recording?this.sessionRecording.stopRecording():this.sessionRecording.startRecordingIfEnabled()))}},{key:"startSessionRecording",value:function(){this.set_config({disable_session_recording:!1})}},{key:"stopSessionRecording",value:function(){this.set_config({disable_session_recording:!0})}},{key:"sessionRecordingStarted",value:function(){var e;return!(null===(e=this.sessionRecording)||void 0===e||!e.started)}},{key:"loadToolbar",value:function(e){return this.toolbar.loadToolbar(e)}},{key:"get_property",value:function(e){var t;return null===(t=this.persistence)||void 0===t?void 0:t.props[e]}},{key:"getSessionProperty",value:function(e){var t;return null===(t=this.sessionPersistence)||void 0===t?void 0:t.props[e]}},{key:"toString",value:function(){var e,t=null!==(e=this.config.name)&&void 0!==e?e:po;return t!==po&&(t=po+"."+t),t}},{key:"_gdpr_init",value:function(){"localStorage"===this.config.opt_out_capturing_persistence_type&&ir.is_supported()&&(!this.has_opted_in_capturing()&&this.has_opted_in_capturing({persistence_type:"cookie"})&&this.opt_in_capturing({enable_persistence:!1}),!this.has_opted_out_capturing()&&this.has_opted_out_capturing({persistence_type:"cookie"})&&this.opt_out_capturing({clear_persistence:!1}),this.clear_opt_in_out_capturing({persistence_type:"cookie",enable_persistence:!1})),this.has_opted_out_capturing()?this._gdpr_update_persistence({clear_persistence:!0}):this.has_opted_in_capturing()||!this.config.opt_out_capturing_by_default&&!nr.get("ph_optout")||(nr.remove("ph_optout"),this.opt_out_capturing({clear_persistence:this.config.opt_out_persistence_by_default}))}},{key:"_gdpr_update_persistence",value:function(e){var t,n,r,i,o;if(e&&e.clear_persistence)r=!0;else{if(!e||!e.enable_persistence)return;r=!1}this.config.disable_persistence||(null===(t=this.persistence)||void 0===t?void 0:t.disabled)===r||(null===(i=this.persistence)||void 0===i||i.set_disabled(r));this.config.disable_persistence||(null===(n=this.sessionPersistence)||void 0===n?void 0:n.disabled)===r||(null===(o=this.sessionPersistence)||void 0===o||o.set_disabled(r))}},{key:"_gdpr_call_func",value:function(e,t){return t=qt({capture:this.capture.bind(this),persistence_type:this.config.opt_out_capturing_persistence_type,cookie_prefix:this.config.opt_out_capturing_cookie_prefix,cookie_expiration:this.config.cookie_expiration,cross_subdomain_cookie:this.config.cross_subdomain_cookie,secure_cookie:this.config.secure_cookie},t||{}),ir.is_supported()||"localStorage"!==t.persistence_type||(t.persistence_type="cookie"),e(this.config.token,{capture:t.capture,captureEventName:t.capture_event_name,captureProperties:t.capture_properties,persistenceType:t.persistence_type,persistencePrefix:t.cookie_prefix,cookieExpiration:t.cookie_expiration,crossSubdomainCookie:t.cross_subdomain_cookie,secureCookie:t.secure_cookie})}},{key:"opt_in_capturing",value:function(e){e=qt({enable_persistence:!0},e||{}),this._gdpr_call_func(Wr,e),this._gdpr_update_persistence(e)}},{key:"opt_out_capturing",value:function(e){var t=qt({clear_persistence:!0},e||{});this._gdpr_call_func(Vr,t),this._gdpr_update_persistence(t)}},{key:"has_opted_in_capturing",value:function(e){return this._gdpr_call_func(Ur,e)}},{key:"has_opted_out_capturing",value:function(e){return this._gdpr_call_func(zr,e)}},{key:"clear_opt_in_out_capturing",value:function(e){var t=qt({enable_persistence:!0},null!=e?e:{});this._gdpr_call_func(Gr,t),this._gdpr_update_persistence(t)}},{key:"debug",value:function(e){!1===e?(null==pt||pt.console.log("You've disabled debug mode."),localStorage&&localStorage.removeItem("ph_debug"),this.set_config({debug:!1})):(null==pt||pt.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}))}}]),e}();!function(e,t){for(var n=0;n<t.length;n++)e.prototype[t[n]]=Vt(e.prototype[t[n]])}(yo,["identify"]);var bo={},ko=function(){to.init=function(e,t,n){if(n)return to[n]||(to[n]=bo[n]=mo(e||"",t||{},n,(function(e){to[n]=bo[n]=e,e._loaded()}))),to[n];var r=to;return bo[po]?r=bo[po]:e&&(r=mo(e,t||{},po,(function(e){bo[po]=e,e._loaded()})),bo[po]=r),to=r,eo===Zi.INIT_SNIPPET&&(mt[po]=to),$t(bo,(function(e,t){t!==po&&(to[t]=e)})),r}},wo=function(){function e(){e.done||(e.done=!0,vo=!1,$t(bo,(function(e){e._dom_loaded()})))}null!=vt&&vt.addEventListener&&("complete"===vt.readyState?e():vt.addEventListener("DOMContentLoaded",e,!1)),pt&&Qt(pt,"load",e,!0)};eo=Zi.INIT_SNIPPET,Et(mt.posthog)&&(mt.posthog=[]),(to=mt.posthog).__loaded||to.config&&to.persistence?Nt.critical("PostHog library has already been downloaded at least once."):($t(to._i,(function(e){e&&St(e)&&(bo[e[2]]=mo.apply(void 0,y(e)))})),ko(),to.init(),$t(bo,(function(e){e._loaded()})),wo())}();
|
|
15
|
+
***************************************************************************** */function n(e){var t="function"==typeof Symbol&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function r(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,i,o=n.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(r=o.next()).done;)a.push(r.value)}catch(e){i={error:e}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return a}function i(e,t,n){if(n||2===arguments.length)for(var r,i=0,o=t.length;i<o;i++)!r&&i in t||(r||(r=Array.prototype.slice.call(t,0,i)),r[i]=t[i]);return e.concat(r||Array.prototype.slice.call(t))}function o(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 a(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?o(Object(n),!0).forEach((function(t){d(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):o(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function s(e){return s="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},s(e)}function u(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function l(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function c(e,t,n){return t&&l(e.prototype,t),n&&l(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function d(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function f(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&h(e,t)}function p(e){return p=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},p(e)}function h(e,t){return h=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},h(e,t)}function v(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}function g(e,t){if(t&&("object"==typeof t||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}function m(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=p(e);if(t){var i=p(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return g(this,n)}}function _(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null==n)return;var r,i,o=[],a=!0,s=!1;try{for(n=n.call(e);!(a=(r=n.next()).done)&&(o.push(r.value),!t||o.length!==t);a=!0);}catch(e){s=!0,i=e}finally{try{a||null==n.return||n.return()}finally{if(s)throw i}}return o}(e,t)||b(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function y(e){return function(e){if(Array.isArray(e))return k(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||b(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function b(e,t){if(e){if("string"==typeof e)return k(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?k(e,t):void 0}}function k(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function w(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=b(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,i=function(){};return{s:i,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,s=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return a=e.done,e},e:function(e){s=!0,o=e},f:function(){try{a||null==n.return||n.return()}finally{if(s)throw o}}}}function S(e){var t,n=null===(t=e)||void 0===t?void 0:t.host;return Boolean(n&&n.shadowRoot&&n.shadowRoot===e)}function C(e){var t=e.maskInputOptions,n=e.tagName,r=e.type,i=e.value,o=e.maskInputFn,a=i||"";return(t[n.toLowerCase()]||t[r])&&(a=o?o(a):"*".repeat(a.length)),a}!function(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||(e={}));var I="__rrweb_original__";var x,F,E=1,O=new RegExp("[^a-z0-9-_:]"),R=-2;function M(e){try{var t=e.rules||e.cssRules;return t?Array.from(t).map(T).join(""):null}catch(e){return null}}function T(e){var t=e.cssText;if(function(e){return"styleSheet"in e}(e))try{t=M(e.styleSheet)||t}catch(e){}return t}var P=/url\((?:(')([^']*)'|(")(.*?)"|([^)]*))\)/gm,N=/^(?!www\.|(?:http|ftp)s?:\/\/|[A-Za-z]:\\|\/\/|#).*/,L=/^(data:)([^,]*),(.*)/i;function D(e,t){return(e||"").replace(P,(function(e,n,r,i,o,a){var s,u=r||o||a,l=n||i||"";if(!u)return e;if(!N.test(u))return"url("+l+u+l+")";if(L.test(u))return"url("+l+u+l+")";if("/"===u[0])return"url("+l+(((s=t).indexOf("//")>-1?s.split("/").slice(0,3).join("/"):s.split("/")[0]).split("?")[0]+u)+l+")";var c=t.split("/"),d=u.split("/");c.pop();for(var f=0,p=d;f<p.length;f++){var h=p[f];"."!==h&&(".."===h?c.pop():c.push(h))}return"url("+l+c.join("/")+l+")"}))}var A,$,q,B,j,H,W=/^[^ \t\n\r\u000c]+/,V=/^[, \t\n\r\u000c]+/;function U(e,t){if(!t||""===t.trim())return t;var n=e.createElement("a");return n.href=t,n.href}function z(){var e=document.createElement("a");return e.href="",e.href}function G(e,t,n,r){return"src"===n||"href"===n&&r||"xlink:href"===n&&r&&"#"!==r[0]?U(e,r):"background"!==n||!r||"table"!==t&&"td"!==t&&"th"!==t?"srcset"===n&&r?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(V),!(n>=t.length);){var o=r(W);if(","===o.slice(-1))o=U(e,o.substring(0,o.length-1)),i.push(o);else{var a="";o=U(e,o);for(var s=!1;;){var u=t.charAt(n);if(""===u){i.push((o+a).trim());break}if(s)")"===u&&(s=!1);else{if(","===u){n+=1,i.push((o+a).trim());break}"("===u&&(s=!0)}a+=u,n+=1}}}return i.join(", ")}(e,r):"style"===n&&r?D(r,z()):"object"===t&&"data"===n&&r?U(e,r):r:U(e,r)}function Y(e,t,n){if(!e)return!1;if(e.nodeType===e.ELEMENT_NODE){if("string"==typeof t){if(e.classList.contains(t))return!0}else for(var r=0;r<e.classList.length;r++){var i=e.classList[r];if(t.test(i))return!0}return!(!n||!e.matches(n))||Y(e.parentNode,t,n)}return e.nodeType,e.TEXT_NODE,Y(e.parentNode,t,n)}function J(t,n){var r,i,o,a,s=n.doc,u=n.blockClass,l=n.blockSelector,c=n.maskTextClass,d=n.maskTextSelector,f=n.inlineStylesheet,p=n.maskInputOptions,h=void 0===p?{}:p,v=n.maskTextFn,g=n.maskInputFn,m=n.dataURLOptions,_=void 0===m?{}:m,y=n.inlineImages,b=n.recordCanvas,k=n.keepIframeSrcFn;if(s.__sn){var w=s.__sn.id;i=1===w?void 0:w}switch(t.nodeType){case t.DOCUMENT_NODE:return"CSS1Compat"!==t.compatMode?{type:e.Document,childNodes:[],compatMode:t.compatMode,rootId:i}:{type:e.Document,childNodes:[],rootId:i};case t.DOCUMENT_TYPE_NODE:return{type:e.DocumentType,name:t.name,publicId:t.publicId,systemId:t.systemId,rootId:i};case t.ELEMENT_NODE:for(var S=function(e,t,n){if("string"==typeof t){if(e.classList.contains(t))return!0}else for(var r=0;r<e.classList.length;r++){var i=e.classList[r];if(t.test(i))return!0}return!!n&&e.matches(n)}(t,u,l),E=function(e){if(e instanceof HTMLFormElement)return"form";var t=e.tagName.toLowerCase().trim();return O.test(t)?"div":t}(t),R={},T=0,P=Array.from(t.attributes);T<P.length;T++){var N=P[T],L=N.name,A=N.value;R[L]=G(s,E,L,A)}if("link"===E&&f){var $=Array.from(s.styleSheets).find((function(e){return e.href===t.href})),q=null;$&&(q=M($)),q&&(delete R.rel,delete R.href,R._cssText=D(q,$.href))}if("style"===E&&t.sheet&&!(t.innerText||t.textContent||"").trim().length)(q=M(t.sheet))&&(R._cssText=D(q,z()));if("input"===E||"textarea"===E||"select"===E){A=t.value;"radio"!==R.type&&"checkbox"!==R.type&&"submit"!==R.type&&"button"!==R.type&&A?R.value=C({type:R.type,tagName:E,value:A,maskInputOptions:h,maskInputFn:g}):t.checked&&(R.checked=t.checked)}if("option"===E&&(t.selected&&!h.select?R.selected=!0:delete R.selected),"canvas"===E&&b)if("2d"===t.__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=I in i?i[I]:i;if(new Uint32Array(o.call(t,n,r,Math.min(50,e.width-n),Math.min(50,e.height-r)).data.buffer).some((function(e){return 0!==e})))return!1}return!0})(t)||(R.rr_dataURL=t.toDataURL(_.type,_.quality));else if(!("__context"in t)){var B=t.toDataURL(_.type,_.quality),j=document.createElement("canvas");j.width=t.width,j.height=t.height,B!==j.toDataURL(_.type,_.quality)&&(R.rr_dataURL=B)}if("img"===E&&y){x||(x=s.createElement("canvas"),F=x.getContext("2d"));var H=t,W=H.crossOrigin;H.crossOrigin="anonymous";var V=function(){try{x.width=H.naturalWidth,x.height=H.naturalHeight,F.drawImage(H,0,0),R.rr_dataURL=x.toDataURL(_.type,_.quality)}catch(e){console.warn("Cannot inline img src="+H.currentSrc+"! Error: "+e)}W?R.crossOrigin=W:delete R.crossOrigin};H.complete&&0!==H.naturalWidth?V():H.onload=V}if("audio"!==E&&"video"!==E||(R.rr_mediaState=t.paused?"paused":"played",R.rr_mediaCurrentTime=t.currentTime),t.scrollLeft&&(R.rr_scrollLeft=t.scrollLeft),t.scrollTop&&(R.rr_scrollTop=t.scrollTop),S){var U=t.getBoundingClientRect(),J=U.width,Q=U.height;R={class:R.class,rr_width:J+"px",rr_height:Q+"px"}}return"iframe"!==E||k(R.src)||(t.contentDocument||(R.rr_src=R.src),delete R.src),{type:e.Element,tagName:E,attributes:R,childNodes:[],isSVG:(a=t,Boolean("svg"===a.tagName||a.ownerSVGElement)||void 0),needBlock:S,rootId:i};case t.TEXT_NODE:var X=t.parentNode&&t.parentNode.tagName,K=t.textContent,Z="STYLE"===X||void 0,ee="SCRIPT"===X||void 0;if(Z&&K){try{t.nextSibling||t.previousSibling||(null===(r=t.parentNode.sheet)||void 0===r?void 0:r.cssRules)&&(K=(o=t.parentNode.sheet).cssRules?Array.from(o.cssRules).map((function(e){return e.cssText||""})).join(""):"")}catch(e){console.warn("Cannot get CSS styles from text's parentNode. Error: "+e,t)}K=D(K,z())}return ee&&(K="SCRIPT_PLACEHOLDER"),!Z&&!ee&&Y(t,c,d)&&K&&(K=v?v(K):K.replace(/[\S]/g,"*")),{type:e.Text,textContent:K||"",isStyle:Z,rootId:i};case t.CDATA_SECTION_NODE:return{type:e.CDATA,textContent:"",rootId:i};case t.COMMENT_NODE:return{type:e.Comment,textContent:t.textContent||"",rootId:i};default:return!1}}function Q(e){return void 0===e?"":e.toLowerCase()}function X(t,n){var r,i=n.doc,o=n.map,a=n.blockClass,s=n.blockSelector,u=n.maskTextClass,l=n.maskTextSelector,c=n.skipChild,d=void 0!==c&&c,f=n.inlineStylesheet,p=void 0===f||f,h=n.maskInputOptions,v=void 0===h?{}:h,g=n.maskTextFn,m=n.maskInputFn,_=n.slimDOMOptions,y=n.dataURLOptions,b=void 0===y?{}:y,k=n.inlineImages,w=void 0!==k&&k,C=n.recordCanvas,I=void 0!==C&&C,x=n.onSerialize,F=n.onIframeLoad,O=n.iframeLoadTimeout,M=void 0===O?5e3:O,T=n.keepIframeSrcFn,P=void 0===T?function(){return!1}:T,N=n.preserveWhiteSpace,L=void 0===N||N,D=J(t,{doc:i,blockClass:a,blockSelector:s,maskTextClass:u,maskTextSelector:l,inlineStylesheet:p,maskInputOptions:v,maskTextFn:g,maskInputFn:m,dataURLOptions:b,inlineImages:w,recordCanvas:I,keepIframeSrcFn:P});if(!D)return console.warn(t,"not serialized"),null;r="__sn"in t?t.__sn.id:!function(t,n){if(n.comment&&t.type===e.Comment)return!0;if(t.type===e.Element){if(n.script&&("script"===t.tagName||"link"===t.tagName&&"preload"===t.attributes.rel&&"script"===t.attributes.as||"link"===t.tagName&&"prefetch"===t.attributes.rel&&"string"==typeof t.attributes.href&&t.attributes.href.endsWith(".js")))return!0;if(n.headFavicon&&("link"===t.tagName&&"shortcut icon"===t.attributes.rel||"meta"===t.tagName&&(Q(t.attributes.name).match(/^msapplication-tile(image|color)$/)||"application-name"===Q(t.attributes.name)||"icon"===Q(t.attributes.rel)||"apple-touch-icon"===Q(t.attributes.rel)||"shortcut icon"===Q(t.attributes.rel))))return!0;if("meta"===t.tagName){if(n.headMetaDescKeywords&&Q(t.attributes.name).match(/^description|keywords$/))return!0;if(n.headMetaSocial&&(Q(t.attributes.property).match(/^(og|twitter|fb):/)||Q(t.attributes.name).match(/^(og|twitter):/)||"pinterest"===Q(t.attributes.name)))return!0;if(n.headMetaRobots&&("robots"===Q(t.attributes.name)||"googlebot"===Q(t.attributes.name)||"bingbot"===Q(t.attributes.name)))return!0;if(n.headMetaHttpEquiv&&void 0!==t.attributes["http-equiv"])return!0;if(n.headMetaAuthorship&&("author"===Q(t.attributes.name)||"generator"===Q(t.attributes.name)||"framework"===Q(t.attributes.name)||"publisher"===Q(t.attributes.name)||"progid"===Q(t.attributes.name)||Q(t.attributes.property).match(/^article:/)||Q(t.attributes.property).match(/^product:/)))return!0;if(n.headMetaVerification&&("google-site-verification"===Q(t.attributes.name)||"yandex-verification"===Q(t.attributes.name)||"csrf-token"===Q(t.attributes.name)||"p:domain_verify"===Q(t.attributes.name)||"verify-v1"===Q(t.attributes.name)||"verification"===Q(t.attributes.name)||"shopify-checkout-api-token"===Q(t.attributes.name)))return!0}}return!1}(D,_)&&(L||D.type!==e.Text||D.isStyle||D.textContent.replace(/^\s+|\s+$/gm,"").length)?E++:R;var A=Object.assign(D,{id:r});if(t.__sn=A,r===R)return null;o[r]=t,x&&x(t);var $=!d;if(A.type===e.Element&&($=$&&!A.needBlock,delete A.needBlock,t.shadowRoot&&(A.isShadowHost=!0)),(A.type===e.Document||A.type===e.Element)&&$){_.headWhitespace&&D.type===e.Element&&"head"===D.tagName&&(L=!1);for(var q={doc:i,map:o,blockClass:a,blockSelector:s,maskTextClass:u,maskTextSelector:l,skipChild:d,inlineStylesheet:p,maskInputOptions:v,maskTextFn:g,maskInputFn:m,slimDOMOptions:_,dataURLOptions:b,inlineImages:w,recordCanvas:I,preserveWhiteSpace:L,onSerialize:x,onIframeLoad:F,iframeLoadTimeout:M,keepIframeSrcFn:P},B=0,j=Array.from(t.childNodes);B<j.length;B++){(V=X(j[B],q))&&A.childNodes.push(V)}if(function(e){return e.nodeType===e.ELEMENT_NODE}(t)&&t.shadowRoot)for(var H=0,W=Array.from(t.shadowRoot.childNodes);H<W.length;H++){var V;(V=X(W[H],q))&&(V.isShadow=!0,A.childNodes.push(V))}}return t.parentNode&&S(t.parentNode)&&(A.isShadow=!0),A.type===e.Element&&"iframe"===A.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 a="about:blank";r.location.href===a&&e.src!==a&&""!==e.src?e.addEventListener("load",t):setTimeout(t,0)}else{var s=setTimeout((function(){o||(t(),o=!0)}),n);e.addEventListener("load",(function(){clearTimeout(s),o=!0,t()}))}}}(t,(function(){var e=t.contentDocument;if(e&&F){var n=X(e,{doc:e,map:o,blockClass:a,blockSelector:s,maskTextClass:u,maskTextSelector:l,skipChild:!1,inlineStylesheet:p,maskInputOptions:v,maskTextFn:g,maskInputFn:m,slimDOMOptions:_,dataURLOptions:b,inlineImages:w,recordCanvas:I,preserveWhiteSpace:L,onSerialize:x,onIframeLoad:F,iframeLoadTimeout:M,keepIframeSrcFn:P});n&&F(t,n)}}),M),A}function K(e,t,n){void 0===n&&(n=document);var r={capture:!0,passive:!0};return n.addEventListener(e,t,r),function(){return n.removeEventListener(e,t,r)}}!function(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"}(A||(A={})),function(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"}($||($={})),function(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"}(q||(q={})),function(e){e[e["2D"]=0]="2D",e[e.WebGL=1]="WebGL",e[e.WebGL2=2]="WebGL2"}(B||(B={})),function(e){e[e.Play=0]="Play",e[e.Pause=1]="Pause",e[e.Seeked=2]="Seeked",e[e.VolumeChange=3]="VolumeChange"}(j||(j={})),function(e){e.Start="start",e.Pause="pause",e.Resume="resume",e.Resize="resize",e.Finish="finish",e.FullsnapshotRebuilded="fullsnapshot-rebuilded",e.LoadStylesheetStart="load-stylesheet-start",e.LoadStylesheetEnd="load-stylesheet-end",e.SkipStart="skip-start",e.SkipEnd="skip-end",e.MouseInteraction="mouse-interaction",e.EventCast="event-cast",e.CustomEvent="custom-event",e.Flush="flush",e.StateChange="state-change",e.PlayBack="play-back"}(H||(H={}));var Z="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.",ee={map:{},getId:function(){return console.error(Z),-1},getNode:function(){return console.error(Z),null},removeNodeFromMap:function(){console.error(Z)},has:function(){return console.error(Z),!1},reset:function(){console.error(Z)}};function te(e,t,n){void 0===n&&(n={});var r=null,i=0;return function(o){var a=Date.now();i||!1!==n.leading||(i=a);var s=t-(a-i),u=this,l=arguments;s<=0||s>t?(r&&(clearTimeout(r),r=null),i=a,e.apply(u,l)):r||!1===n.trailing||(r=setTimeout((function(){i=!1===n.leading?0:Date.now(),r=null,e.apply(u,l)}),s))}}function ne(e,t,n,r,i){void 0===i&&(i=window);var o=i.Object.getOwnPropertyDescriptor(e,t);return i.Object.defineProperty(e,t,r?n:{set:function(e){var t=this;setTimeout((function(){n.set.call(t,e)}),0),o&&o.set&&o.set.call(this,e)}}),function(){return ne(e,t,o||{},!0)}}function re(e,t,n){try{if(!(t in e))return function(){};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,function(){e[t]=r}}catch(e){return function(){}}}function ie(){return window.innerHeight||document.documentElement&&document.documentElement.clientHeight||document.body&&document.body.clientHeight}function oe(){return window.innerWidth||document.documentElement&&document.documentElement.clientWidth||document.body&&document.body.clientWidth}function ae(e,t){if(!e)return!1;if(e.nodeType===e.ELEMENT_NODE){var n=!1;if("string"==typeof t){if(void 0!==e.closest)return null!==e.closest("."+t);n=e.classList.contains(t)}else e.classList.forEach((function(e){t.test(e)&&(n=!0)}));return n||ae(e.parentNode,t)}return e.nodeType,e.TEXT_NODE,ae(e.parentNode,t)}function se(e){return"__sn"in e&&e.__sn.id===R}function ue(e,t){if(S(e))return!1;var n=t.getId(e);return!t.has(n)||(!e.parentNode||e.parentNode.nodeType!==e.DOCUMENT_NODE)&&(!e.parentNode||ue(e.parentNode,t))}function le(e){return Boolean(e.changedTouches)}function ce(t){return"__sn"in t&&(t.__sn.type===e.Element&&"iframe"===t.__sn.tagName)}function de(e){return Boolean(null==e?void 0:e.shadowRoot)}function fe(e){return"__ln"in e}"undefined"!=typeof window&&window.Proxy&&window.Reflect&&(ee=new Proxy(ee,{get:function(e,t,n){return"map"===t&&console.error(Z),Reflect.get(e,t,n)}}));var pe=function(){function e(){this.length=0,this.head=null}return e.prototype.get=function(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},e.prototype.addNode=function(e){var t={value:e,previous:null,next:null};if(e.__ln=t,e.previousSibling&&fe(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&&fe(e.nextSibling)&&e.nextSibling.__ln.previous){n=e.nextSibling.__ln.previous;t.previous=n,t.next=e.nextSibling.__ln,e.nextSibling.__ln.previous=t,n&&(n.next=t)}else this.head&&(this.head.previous=t),t.next=this.head,this.head=t;this.length++},e.prototype.removeNode=function(e){var t=e.__ln;this.head&&(t.previous?(t.previous.next=t.next,t.next&&(t.next.previous=t.previous)):(this.head=t.next,this.head&&(this.head.previous=null)),e.__ln&&delete e.__ln,this.length--)},e}(),he=function(e,t){return"".concat(e,"@").concat(t)};function ve(e){return"__sn"in e}var ge=function(){function e(){var e=this;this.frozen=!1,this.locked=!1,this.texts=[],this.attributes=[],this.removes=[],this.mapRemoves=[],this.movedMap={},this.addedSet=new Set,this.movedSet=new Set,this.droppedSet=new Set,this.processMutations=function(t){t.forEach(e.processMutation),e.emit()},this.emit=function(){var t,r,i,o;if(!e.frozen&&!e.locked){for(var a=[],s=new pe,u=function(t){for(var n=t,r=R;r===R;)r=(n=n&&n.nextSibling)&&e.mirror.getId(n);return r},l=function(t){for(var n,r,i,o,l,c=t.getRootNode?null===(n=t.getRootNode())||void 0===n?void 0:n.host:null,d=c;null===(i=null===(r=null==d?void 0:d.getRootNode)||void 0===r?void 0:r.call(d))||void 0===i?void 0:i.host;)d=(null===(l=null===(o=null==d?void 0:d.getRootNode)||void 0===o?void 0:o.call(d))||void 0===l?void 0:l.host)||null;var f=!(e.doc.contains(t)||null!==d&&e.doc.contains(d));if(t.parentNode&&!f){var p=S(t.parentNode)?e.mirror.getId(c):e.mirror.getId(t.parentNode),h=u(t);if(-1===p||-1===h)return s.addNode(t);var v=X(t,{doc:e.doc,map:e.mirror.map,blockClass:e.blockClass,blockSelector:e.blockSelector,maskTextClass:e.maskTextClass,maskTextSelector:e.maskTextSelector,skipChild:!0,inlineStylesheet:e.inlineStylesheet,maskInputOptions:e.maskInputOptions,maskTextFn:e.maskTextFn,maskInputFn:e.maskInputFn,slimDOMOptions:e.slimDOMOptions,recordCanvas:e.recordCanvas,inlineImages:e.inlineImages,onSerialize:function(n){ce(n)&&e.iframeManager.addIframe(n),de(t)&&e.shadowDomManager.addShadowRoot(t.shadowRoot,document)},onIframeLoad:function(t,n){e.iframeManager.attachIframe(t,n),e.shadowDomManager.observeAttachShadow(t)}});v&&a.push({parentId:p,nextId:h,node:v})}};e.mapRemoves.length;)e.mirror.removeNodeFromMap(e.mapRemoves.shift());try{for(var c=n(e.movedSet),d=c.next();!d.done;d=c.next()){var f=d.value;_e(e.removes,f,e.mirror)&&!e.movedSet.has(f.parentNode)||l(f)}}catch(e){t={error:e}}finally{try{d&&!d.done&&(r=c.return)&&r.call(c)}finally{if(t)throw t.error}}try{for(var p=n(e.addedSet),h=p.next();!h.done;h=p.next()){f=h.value;ye(e.droppedSet,f)||_e(e.removes,f,e.mirror)?ye(e.movedSet,f)?l(f):e.droppedSet.add(f):l(f)}}catch(e){i={error:e}}finally{try{h&&!h.done&&(o=p.return)&&o.call(p)}finally{if(i)throw i.error}}for(var v=null;s.length;){var g=null;if(v){var m=e.mirror.getId(v.value.parentNode),_=u(v.value);-1!==m&&-1!==_&&(g=v)}if(!g)for(var y=s.length-1;y>=0;y--){var b=s.get(y);if(b){m=e.mirror.getId(b.value.parentNode),_=u(b.value);if(-1!==m&&-1!==_){g=b;break}}}if(!g){for(;s.head;)s.removeNode(s.head.value);break}v=g.previous,s.removeNode(g.value),l(g.value)}var k={texts:e.texts.map((function(t){return{id:e.mirror.getId(t.node),value:t.value}})).filter((function(t){return e.mirror.has(t.id)})),attributes:e.attributes.map((function(t){return{id:e.mirror.getId(t.node),attributes:t.attributes}})).filter((function(t){return e.mirror.has(t.id)})),removes:e.removes,adds:a};(k.texts.length||k.attributes.length||k.removes.length||k.adds.length)&&(e.texts=[],e.attributes=[],e.removes=[],e.addedSet=new Set,e.movedSet=new Set,e.droppedSet=new Set,e.movedMap={},e.mutationCb(k))}},this.processMutation=function(t){var r,i,o,a;if(!se(t.target))switch(t.type){case"characterData":var s=t.target.textContent;ae(t.target,e.blockClass)||s===t.oldValue||e.texts.push({value:Y(t.target,e.maskTextClass,e.maskTextSelector)&&s?e.maskTextFn?e.maskTextFn(s):s.replace(/[\S]/g,"*"):s,node:t.target});break;case"attributes":var u=t.target;s=t.target.getAttribute(t.attributeName);if("value"===t.attributeName&&(s=C({maskInputOptions:e.maskInputOptions,tagName:t.target.tagName,type:t.target.getAttribute("type"),value:s,maskInputFn:e.maskInputFn})),ae(t.target,e.blockClass)||s===t.oldValue)return;var l=e.attributes.find((function(e){return e.node===t.target}));if(l||(l={node:t.target,attributes:{}},e.attributes.push(l)),"style"===t.attributeName){var c=e.doc.createElement("span");t.oldValue&&c.setAttribute("style",t.oldValue),void 0!==l.attributes.style&&null!==l.attributes.style||(l.attributes.style={});var d=l.attributes.style;try{for(var f=n(Array.from(u.style)),p=f.next();!p.done;p=f.next()){var h=p.value,v=u.style.getPropertyValue(h),g=u.style.getPropertyPriority(h);v===c.style.getPropertyValue(h)&&g===c.style.getPropertyPriority(h)||(d[h]=""===g?v:[v,g])}}catch(e){r={error:e}}finally{try{p&&!p.done&&(i=f.return)&&i.call(f)}finally{if(r)throw r.error}}try{for(var m=n(Array.from(c.style)),_=m.next();!_.done;_=m.next()){h=_.value;""===u.style.getPropertyValue(h)&&(d[h]=!1)}}catch(e){o={error:e}}finally{try{_&&!_.done&&(a=m.return)&&a.call(m)}finally{if(o)throw o.error}}}else l.attributes[t.attributeName]=G(e.doc,t.target.tagName,t.attributeName,s);break;case"childList":t.addedNodes.forEach((function(n){return e.genAdds(n,t.target)})),t.removedNodes.forEach((function(n){var r=e.mirror.getId(n),i=S(t.target)?e.mirror.getId(t.target.host):e.mirror.getId(t.target);ae(t.target,e.blockClass)||se(n)||(e.addedSet.has(n)?(me(e.addedSet,n),e.droppedSet.add(n)):e.addedSet.has(t.target)&&-1===r||ue(t.target,e.mirror)||(e.movedSet.has(n)&&e.movedMap[he(r,i)]?me(e.movedSet,n):e.removes.push({parentId:i,id:r,isShadow:!!S(t.target)||void 0})),e.mapRemoves.push(n))}))}},this.genAdds=function(t,n){if(!n||!ae(n,e.blockClass)){if(ve(t)){if(se(t))return;e.movedSet.add(t);var r=null;n&&ve(n)&&(r=n.__sn.id),r&&(e.movedMap[he(t.__sn.id,r)]=!0)}else e.addedSet.add(t),e.droppedSet.delete(t);ae(t,e.blockClass)||t.childNodes.forEach((function(t){return e.genAdds(t)}))}}}return e.prototype.init=function(e){var t=this;["mutationCb","blockClass","blockSelector","maskTextClass","maskTextSelector","inlineStylesheet","maskInputOptions","maskTextFn","maskInputFn","recordCanvas","inlineImages","slimDOMOptions","doc","mirror","iframeManager","shadowDomManager","canvasManager"].forEach((function(n){t[n]=e[n]}))},e.prototype.freeze=function(){this.frozen=!0,this.canvasManager.freeze()},e.prototype.unfreeze=function(){this.frozen=!1,this.canvasManager.unfreeze(),this.emit()},e.prototype.isFrozen=function(){return this.frozen},e.prototype.lock=function(){this.locked=!0,this.canvasManager.lock()},e.prototype.unlock=function(){this.locked=!1,this.canvasManager.unlock(),this.emit()},e.prototype.reset=function(){this.shadowDomManager.reset(),this.canvasManager.reset()},e}();function me(e,t){e.delete(t),t.childNodes.forEach((function(t){return me(e,t)}))}function _e(e,t,n){var r=t.parentNode;if(!r)return!1;var i=n.getId(r);return!!e.some((function(e){return e.id===i}))||_e(e,r,n)}function ye(e,t){var n=t.parentNode;return!!n&&(!!e.has(n)||ye(e,n))}var be=ge,ke=[],we="undefined"!=typeof CSSGroupingRule,Se="undefined"!=typeof CSSMediaRule,Ce="undefined"!=typeof CSSSupportsRule,Ie="undefined"!=typeof CSSConditionRule;function xe(e){try{if("composedPath"in e){var t=e.composedPath();if(t.length)return t[0]}else if("path"in e&&e.path.length)return e.path[0];return e.target}catch(t){return e.target}}function Fe(e,t){var n,r,i=new be;ke.push(i),i.init(e);var o=window.MutationObserver||window.__rrMutationObserver,a=null===(r=null===(n=null===window||void 0===window?void 0:window.Zone)||void 0===n?void 0:n.__symbol__)||void 0===r?void 0:r.call(n,"MutationObserver");a&&window[a]&&(o=window[a]);var s=new o(i.processMutations.bind(i));return s.observe(t,{attributes:!0,attributeOldValue:!0,characterData:!0,characterDataOldValue:!0,childList:!0,subtree:!0}),s}function Ee(e){var t=e.mouseInteractionCb,n=e.doc,r=e.mirror,i=e.blockClass,o=e.sampling;if(!1===o.mouseInteraction)return function(){};var a=!0===o.mouseInteraction||void 0===o.mouseInteraction?{}:o.mouseInteraction,s=[];return Object.keys(q).filter((function(e){return Number.isNaN(Number(e))&&!e.endsWith("_Departed")&&!1!==a[e]})).forEach((function(e){var o=e.toLowerCase(),a=function(e){return function(n){var o=xe(n);if(!ae(o,i)){var a=le(n)?n.changedTouches[0]:n;if(a){var s=r.getId(o),u=a.clientX,l=a.clientY;t({type:q[e],id:s,x:u,y:l})}}}}(e);s.push(K(o,a,n))})),function(){s.forEach((function(e){return e()}))}}function Oe(e){var t=e.scrollCb,n=e.doc,r=e.mirror,i=e.blockClass;return K("scroll",te((function(e){var o=xe(e);if(o&&!ae(o,i)){var a=r.getId(o);if(o===n){var s=n.scrollingElement||n.documentElement;t({id:a,x:s.scrollLeft,y:s.scrollTop})}else t({id:a,x:o.scrollLeft,y:o.scrollTop})}}),e.sampling.scroll||100),n)}function Re(e,n){var r=t({},e);return n||delete r.userTriggered,r}var Me=["INPUT","TEXTAREA","SELECT"],Te=new WeakMap;function Pe(e){return function(e,t){if(we&&e.parentRule instanceof CSSGroupingRule||Se&&e.parentRule instanceof CSSMediaRule||Ce&&e.parentRule instanceof CSSSupportsRule||Ie&&e.parentRule instanceof CSSConditionRule){var n=Array.from(e.parentRule.cssRules).indexOf(e);t.unshift(n)}else{n=Array.from(e.parentStyleSheet.cssRules).indexOf(e);t.unshift(n)}return t}(e,[])}function Ne(e,o){var a,s;void 0===o&&(o={});var u=e.doc.defaultView;if(!u)return function(){};!function(e,t){var n=e.mutationCb,o=e.mousemoveCb,a=e.mouseInteractionCb,s=e.scrollCb,u=e.viewportResizeCb,l=e.inputCb,c=e.mediaInteractionCb,d=e.styleSheetRuleCb,f=e.styleDeclarationCb,p=e.canvasMutationCb,h=e.fontCb;e.mutationCb=function(){for(var e=[],o=0;o<arguments.length;o++)e[o]=arguments[o];t.mutation&&t.mutation.apply(t,i([],r(e),!1)),n.apply(void 0,i([],r(e),!1))},e.mousemoveCb=function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];t.mousemove&&t.mousemove.apply(t,i([],r(e),!1)),o.apply(void 0,i([],r(e),!1))},e.mouseInteractionCb=function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];t.mouseInteraction&&t.mouseInteraction.apply(t,i([],r(e),!1)),a.apply(void 0,i([],r(e),!1))},e.scrollCb=function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];t.scroll&&t.scroll.apply(t,i([],r(e),!1)),s.apply(void 0,i([],r(e),!1))},e.viewportResizeCb=function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];t.viewportResize&&t.viewportResize.apply(t,i([],r(e),!1)),u.apply(void 0,i([],r(e),!1))},e.inputCb=function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];t.input&&t.input.apply(t,i([],r(e),!1)),l.apply(void 0,i([],r(e),!1))},e.mediaInteractionCb=function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];t.mediaInteaction&&t.mediaInteaction.apply(t,i([],r(e),!1)),c.apply(void 0,i([],r(e),!1))},e.styleSheetRuleCb=function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];t.styleSheetRule&&t.styleSheetRule.apply(t,i([],r(e),!1)),d.apply(void 0,i([],r(e),!1))},e.styleDeclarationCb=function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];t.styleDeclaration&&t.styleDeclaration.apply(t,i([],r(e),!1)),f.apply(void 0,i([],r(e),!1))},e.canvasMutationCb=function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];t.canvasMutation&&t.canvasMutation.apply(t,i([],r(e),!1)),p.apply(void 0,i([],r(e),!1))},e.fontCb=function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];t.font&&t.font.apply(t,i([],r(e),!1)),h.apply(void 0,i([],r(e),!1))}}(e,o);var l=Fe(e,e.doc),c=function(e){var t=e.mousemoveCb,n=e.sampling,r=e.doc,i=e.mirror;if(!1===n.mousemove)return function(){};var o,a="number"==typeof n.mousemove?n.mousemove:50,s="number"==typeof n.mousemoveCallback?n.mousemoveCallback:500,u=[],l=te((function(e){var n=Date.now()-o;t(u.map((function(e){return e.timeOffset-=n,e})),e),u=[],o=null}),s),c=te((function(e){var t=xe(e),n=le(e)?e.changedTouches[0]:e,r=n.clientX,a=n.clientY;o||(o=Date.now()),u.push({x:r,y:a,id:i.getId(t),timeOffset:Date.now()-o}),l("undefined"!=typeof DragEvent&&e instanceof DragEvent?$.Drag:e instanceof MouseEvent?$.MouseMove:$.TouchMove)}),a,{trailing:!1}),d=[K("mousemove",c,r),K("touchmove",c,r),K("drag",c,r)];return function(){d.forEach((function(e){return e()}))}}(e),d=Ee(e),f=Oe(e),p=function(e){var t=e.viewportResizeCb,n=-1,r=-1;return K("resize",te((function(){var e=ie(),i=oe();n===e&&r===i||(t({width:Number(i),height:Number(e)}),n=e,r=i)}),200),window)}(e),h=function(e){var n=e.inputCb,o=e.doc,a=e.mirror,s=e.blockClass,u=e.ignoreClass,l=e.maskInputOptions,c=e.maskInputFn,d=e.sampling,f=e.userTriggeredOnInput;function p(e){var t=xe(e),n=e.isTrusted;if(t&&"OPTION"===t.tagName&&(t=t.parentElement),t&&t.tagName&&!(Me.indexOf(t.tagName)<0)&&!ae(t,s)){var r=t.type;if(!t.classList.contains(u)){var i=t.value,a=!1;"radio"===r||"checkbox"===r?a=t.checked:(l[t.tagName.toLowerCase()]||l[r])&&(i=C({maskInputOptions:l,tagName:t.tagName,type:r,value:i,maskInputFn:c})),h(t,Re({text:i,isChecked:a,userTriggered:n},f));var d=t.name;"radio"===r&&d&&a&&o.querySelectorAll('input[type="radio"][name="'.concat(d,'"]')).forEach((function(e){e!==t&&h(e,Re({text:e.value,isChecked:!a,userTriggered:!1},f))}))}}}function h(e,r){var i=Te.get(e);if(!i||i.text!==r.text||i.isChecked!==r.isChecked){Te.set(e,r);var o=a.getId(e);n(t(t({},r),{id:o}))}}var v=("last"===d.input?["change"]:["input","change"]).map((function(e){return K(e,p,o)})),g=Object.getOwnPropertyDescriptor(HTMLInputElement.prototype,"value"),m=[[HTMLInputElement.prototype,"value"],[HTMLInputElement.prototype,"checked"],[HTMLSelectElement.prototype,"value"],[HTMLTextAreaElement.prototype,"value"],[HTMLSelectElement.prototype,"selectedIndex"],[HTMLOptionElement.prototype,"selected"]];return g&&g.set&&v.push.apply(v,i([],r(m.map((function(e){return ne(e[0],e[1],{set:function(){p({target:this})}})}))),!1)),function(){v.forEach((function(e){return e()}))}}(e),v=function(e){var t=e.mediaInteractionCb,n=e.blockClass,r=e.mirror,i=e.sampling,o=function(e){return te((function(i){var o=xe(i);if(o&&!ae(o,n)){var a=o,s=a.currentTime,u=a.volume,l=a.muted;t({type:e,id:r.getId(o),currentTime:s,volume:u,muted:l})}}),i.media||500)},a=[K("play",o(0)),K("pause",o(1)),K("seeked",o(2)),K("volumechange",o(3))];return function(){a.forEach((function(e){return e()}))}}(e),g=function(e,t){var n=e.styleSheetRuleCb,o=e.mirror,a=t.win,s=a.CSSStyleSheet.prototype.insertRule;a.CSSStyleSheet.prototype.insertRule=function(e,t){var r=o.getId(this.ownerNode);return-1!==r&&n({id:r,adds:[{rule:e,index:t}]}),s.apply(this,arguments)};var u=a.CSSStyleSheet.prototype.deleteRule;a.CSSStyleSheet.prototype.deleteRule=function(e){var t=o.getId(this.ownerNode);return-1!==t&&n({id:t,removes:[{index:e}]}),u.apply(this,arguments)};var l={};we?l.CSSGroupingRule=a.CSSGroupingRule:(Se&&(l.CSSMediaRule=a.CSSMediaRule),Ie&&(l.CSSConditionRule=a.CSSConditionRule),Ce&&(l.CSSSupportsRule=a.CSSSupportsRule));var c={};return Object.entries(l).forEach((function(e){var t=r(e,2),a=t[0],s=t[1];c[a]={insertRule:s.prototype.insertRule,deleteRule:s.prototype.deleteRule},s.prototype.insertRule=function(e,t){var s=o.getId(this.parentStyleSheet.ownerNode);return-1!==s&&n({id:s,adds:[{rule:e,index:i(i([],r(Pe(this)),!1),[t||0],!1)}]}),c[a].insertRule.apply(this,arguments)},s.prototype.deleteRule=function(e){var t=o.getId(this.parentStyleSheet.ownerNode);return-1!==t&&n({id:t,removes:[{index:i(i([],r(Pe(this)),!1),[e],!1)}]}),c[a].deleteRule.apply(this,arguments)}})),function(){a.CSSStyleSheet.prototype.insertRule=s,a.CSSStyleSheet.prototype.deleteRule=u,Object.entries(l).forEach((function(e){var t=r(e,2),n=t[0],i=t[1];i.prototype.insertRule=c[n].insertRule,i.prototype.deleteRule=c[n].deleteRule}))}}(e,{win:u}),m=function(e,t){var n=e.styleDeclarationCb,r=e.mirror,i=t.win,o=i.CSSStyleDeclaration.prototype.setProperty;i.CSSStyleDeclaration.prototype.setProperty=function(e,t,i){var a,s,u=r.getId(null===(s=null===(a=this.parentRule)||void 0===a?void 0:a.parentStyleSheet)||void 0===s?void 0:s.ownerNode);return-1!==u&&n({id:u,set:{property:e,value:t,priority:i},index:Pe(this.parentRule)}),o.apply(this,arguments)};var a=i.CSSStyleDeclaration.prototype.removeProperty;return i.CSSStyleDeclaration.prototype.removeProperty=function(e){var t,i,o=r.getId(null===(i=null===(t=this.parentRule)||void 0===t?void 0:t.parentStyleSheet)||void 0===i?void 0:i.ownerNode);return-1!==o&&n({id:o,remove:{property:e},index:Pe(this.parentRule)}),a.apply(this,arguments)},function(){i.CSSStyleDeclaration.prototype.setProperty=o,i.CSSStyleDeclaration.prototype.removeProperty=a}}(e,{win:u}),_=e.collectFonts?function(e){var t=e.fontCb,n=e.doc,r=n.defaultView;if(!r)return function(){};var i=[],o=new WeakMap,a=r.FontFace;r.FontFace=function(e,t,n){var r=new a(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 s=re(n.fonts,"add",(function(e){return function(n){return setTimeout((function(){var e=o.get(n);e&&(t(e),o.delete(n))}),0),e.apply(this,[n])}}));return i.push((function(){r.FontFace=a})),i.push(s),function(){i.forEach((function(e){return e()}))}}(e):function(){},y=[];try{for(var b=n(e.plugins),k=b.next();!k.done;k=b.next()){var w=k.value;y.push(w.observer(w.callback,u,w.options))}}catch(e){a={error:e}}finally{try{k&&!k.done&&(s=b.return)&&s.call(b)}finally{if(a)throw a.error}}return function(){ke.forEach((function(e){return e.reset()})),l.disconnect(),c(),d(),f(),p(),h(),v(),g(),m(),_(),y.forEach((function(e){return e()}))}}var Le=function(){function e(e){this.iframes=new WeakMap,this.mutationCb=e.mutationCb}return e.prototype.addIframe=function(e){this.iframes.set(e,!0)},e.prototype.addLoadListener=function(e){this.loadListener=e},e.prototype.attachIframe=function(e,t){var n;this.mutationCb({adds:[{parentId:e.__sn.id,nextId:null,node:t}],removes:[],texts:[],attributes:[],isAttachIframe:!0}),null===(n=this.loadListener)||void 0===n||n.call(this,e)},e}(),De=function(){function e(e){this.restorePatches=[],this.mutationCb=e.mutationCb,this.scrollCb=e.scrollCb,this.bypassOptions=e.bypassOptions,this.mirror=e.mirror;var t=this;this.restorePatches.push(re(HTMLElement.prototype,"attachShadow",(function(e){return function(){var n=e.apply(this,arguments);return this.shadowRoot&&t.addShadowRoot(this.shadowRoot,this.ownerDocument),n}})))}return e.prototype.addShadowRoot=function(e,n){Fe(t(t({},this.bypassOptions),{doc:n,mutationCb:this.mutationCb,mirror:this.mirror,shadowDomManager:this}),e),Oe(t(t({},this.bypassOptions),{scrollCb:this.scrollCb,doc:e,mirror:this.mirror}))},e.prototype.observeAttachShadow=function(e){if(e.contentWindow){var t=this;this.restorePatches.push(re(e.contentWindow.HTMLElement.prototype,"attachShadow",(function(n){return function(){var r=n.apply(this,arguments);return this.shadowRoot&&t.addShadowRoot(this.shadowRoot,e.contentDocument),r}})))}},e.prototype.reset=function(){this.restorePatches.forEach((function(e){return e()}))},e}();for(var Ae="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",$e="undefined"==typeof Uint8Array?[]:new Uint8Array(256),qe=0;qe<Ae.length;qe++)$e[Ae.charCodeAt(qe)]=qe;var Be=function(e){var t,n=new Uint8Array(e),r=n.length,i="";for(t=0;t<r;t+=3)i+=Ae[n[t]>>2],i+=Ae[(3&n[t])<<4|n[t+1]>>4],i+=Ae[(15&n[t+1])<<2|n[t+2]>>6],i+=Ae[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},je=new Map;var He=function(e,t,n){if(e&&(Ue(e,t)||"object"===s(e))){var r=function(e,t){var n=je.get(e);return n||(n=new Map,je.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 We(e,t,n){return e instanceof Array?e.map((function(e){return We(e,t,n)})):null===e?e: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?{rr_type:e.constructor.name,args:[Object.values(e)]}:e instanceof ArrayBuffer?{rr_type:e.constructor.name,base64:Be(e)}:e instanceof DataView?{rr_type:e.constructor.name,args:[We(e.buffer,t,n),e.byteOffset,e.byteLength]}:e instanceof HTMLImageElement?{rr_type:e.constructor.name,src:e.src}:e instanceof ImageData?{rr_type:e.constructor.name,args:[We(e.data,t,n),e.width,e.height]}:Ue(e,t)||"object"===s(e)?{rr_type:e.constructor.name,index:He(e,t,n)}:e}var Ve=function(e,t,n){return i([],r(e),!1).map((function(e){return We(e,t,n)}))},Ue=function(e,t){var n=["WebGLActiveInfo","WebGLBuffer","WebGLFramebuffer","WebGLProgram","WebGLRenderbuffer","WebGLShader","WebGLShaderPrecisionFormat","WebGLTexture","WebGLUniformLocation","WebGLVertexArrayObject","WebGLVertexArrayObjectOES"].filter((function(e){return"function"==typeof t[e]}));return Boolean(n.find((function(n){return e instanceof t[n]})))};function ze(e,t,o,a,s,u){var l,c,d=[],f=Object.getOwnPropertyNames(e),p=function(n){try{if("function"!=typeof e[n])return"continue";var l=re(e,n,(function(l){return function(){for(var c=[],d=0;d<arguments.length;d++)c[d]=arguments[d];var f=l.apply(this,c);if(He(f,u,e),!ae(this.canvas,a)){s.getId(this.canvas);var p=Ve(i([],r(c),!1),u,e),h={type:t,property:n,args:p};o(this.canvas,h)}return f}}));d.push(l)}catch(r){var c=ne(e,n,{set:function(e){o(this.canvas,{type:t,property:n,args:[e],setter:!0})}});d.push(c)}};try{for(var h=n(f),v=h.next();!v.done;v=h.next()){p(v.value)}}catch(e){l={error:e}}finally{try{v&&!v.done&&(c=h.return)&&c.call(h)}finally{if(l)throw l.error}}return d}var Ge,Ye,Je=function(){function e(e){this.pendingCanvasMutations=new Map,this.rafStamps={latestId:0,invokeId:null},this.frozen=!1,this.locked=!1,this.processMutation=function(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)},this.mutationCb=e.mutationCb,this.mirror=e.mirror,!0===e.recordCanvas&&this.initCanvasMutationObserver(e.win,e.blockClass)}return e.prototype.reset=function(){this.pendingCanvasMutations.clear(),this.resetObservers&&this.resetObservers()},e.prototype.freeze=function(){this.frozen=!0},e.prototype.unfreeze=function(){this.frozen=!1},e.prototype.lock=function(){this.locked=!0},e.prototype.unlock=function(){this.locked=!1},e.prototype.initCanvasMutationObserver=function(e,t){this.startRAFTimestamping(),this.startPendingCanvasMutationFlusher();var o=function(e,t){var n=[];try{var o=re(e.HTMLCanvasElement.prototype,"getContext",(function(e){return function(n){for(var o=[],a=1;a<arguments.length;a++)o[a-1]=arguments[a];return ae(this,t)||"__context"in this||(this.__context=n),e.apply(this,i([n],r(o),!1))}}));n.push(o)}catch(e){console.error("failed to patch HTMLCanvasElement.prototype.getContext")}return function(){n.forEach((function(e){return e()}))}}(e,t),a=function(e,t,o,a){var s,u,l=[],c=Object.getOwnPropertyNames(t.CanvasRenderingContext2D.prototype),d=function(n){try{if("function"!=typeof t.CanvasRenderingContext2D.prototype[n])return"continue";var a=re(t.CanvasRenderingContext2D.prototype,n,(function(t){return function(){for(var a=this,s=[],u=0;u<arguments.length;u++)s[u]=arguments[u];return ae(this.canvas,o)||setTimeout((function(){var t=i([],r(s),!1);if("drawImage"===n&&t[0]&&t[0]instanceof HTMLCanvasElement){var o=t[0],u=o.getContext("2d"),l=null==u?void 0:u.getImageData(0,0,o.width,o.height),c=null==l?void 0:l.data;t[0]=JSON.stringify(c)}e(a.canvas,{type:B["2D"],property:n,args:t})}),0),t.apply(this,s)}}));l.push(a)}catch(r){var s=ne(t.CanvasRenderingContext2D.prototype,n,{set:function(t){e(this.canvas,{type:B["2D"],property:n,args:[t],setter:!0})}});l.push(s)}};try{for(var f=n(c),p=f.next();!p.done;p=f.next())d(p.value)}catch(e){s={error:e}}finally{try{p&&!p.done&&(u=f.return)&&u.call(f)}finally{if(s)throw s.error}}return function(){l.forEach((function(e){return e()}))}}(this.processMutation.bind(this),e,t,this.mirror),s=function(e,t,n,o){var a=[];return a.push.apply(a,i([],r(ze(t.WebGLRenderingContext.prototype,B.WebGL,e,n,o,t)),!1)),void 0!==t.WebGL2RenderingContext&&a.push.apply(a,i([],r(ze(t.WebGL2RenderingContext.prototype,B.WebGL2,e,n,o,t)),!1)),function(){a.forEach((function(e){return e()}))}}(this.processMutation.bind(this),e,t,this.mirror);this.resetObservers=function(){o(),a(),s()}},e.prototype.startPendingCanvasMutationFlusher=function(){var e=this;requestAnimationFrame((function(){return e.flushPendingCanvasMutations()}))},e.prototype.startRAFTimestamping=function(){var e=this;requestAnimationFrame((function t(n){e.rafStamps.latestId=n,requestAnimationFrame(t)}))},e.prototype.flushPendingCanvasMutations=function(){var e=this;this.pendingCanvasMutations.forEach((function(t,n){var r=e.mirror.getId(n);e.flushPendingCanvasMutationFor(n,r)})),requestAnimationFrame((function(){return e.flushPendingCanvasMutations()}))},e.prototype.flushPendingCanvasMutationFor=function(e,t){if(!this.frozen&&!this.locked){var n=this.pendingCanvasMutations.get(e);if(n&&-1!==t){var r=n.map((function(e){e.type;var t=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]])}return n}(e,["type"]);return t})),i=n[0].type;this.mutationCb({id:t,type:i,commands:r}),this.pendingCanvasMutations.delete(e)}}},e}();function Qe(e){return t(t({},e),{timestamp:Date.now()})}var Xe={map:{},getId:function(e){return e&&e.__sn?e.__sn.id:-1},getNode:function(e){return this.map[e]||null},removeNodeFromMap:function(e){var t=this,n=e.__sn&&e.__sn.id;delete this.map[n],e.childNodes&&e.childNodes.forEach((function(e){return t.removeNodeFromMap(e)}))},has:function(e){return this.map.hasOwnProperty(e)},reset:function(){this.map={}}};function Ke(e){void 0===e&&(e={});var i=e.emit,o=e.checkoutEveryNms,a=e.checkoutEveryNth,s=e.blockClass,u=void 0===s?"rr-block":s,l=e.blockSelector,c=void 0===l?null:l,d=e.ignoreClass,f=void 0===d?"rr-ignore":d,p=e.maskTextClass,h=void 0===p?"rr-mask":p,v=e.maskTextSelector,g=void 0===v?null:v,m=e.inlineStylesheet,_=void 0===m||m,y=e.maskAllInputs,b=e.maskInputOptions,k=e.slimDOMOptions,w=e.maskInputFn,S=e.maskTextFn,C=e.hooks,I=e.packFn,x=e.sampling,F=void 0===x?{}:x,E=e.mousemoveWait,O=e.recordCanvas,R=void 0!==O&&O,M=e.userTriggeredOnInput,T=void 0!==M&&M,P=e.collectFonts,N=void 0!==P&&P,L=e.inlineImages,D=void 0!==L&&L,q=e.plugins,B=e.keepIframeSrcFn,j=void 0===B?function(){return!1}:B;if(!i)throw new Error("emit function is required");void 0!==E&&void 0===F.mousemove&&(F.mousemove=E);var H,W=!0===y?{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!==b?b:{password:!0},V=!0===k||"all"===k?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaVerification:!0,headMetaAuthorship:"all"===k,headMetaDescKeywords:"all"===k}:k||{};!function(e){void 0===e&&(e=window),"NodeList"in e&&!e.NodeList.prototype.forEach&&(e.NodeList.prototype.forEach=Array.prototype.forEach),"DOMTokenList"in e&&!e.DOMTokenList.prototype.forEach&&(e.DOMTokenList.prototype.forEach=Array.prototype.forEach),Node.prototype.contains||(Node.prototype.contains=function(e){if(!(0 in arguments))throw new TypeError("1 argument is required");do{if(this===e)return!0}while(e=e&&e.parentNode);return!1})}();var U=0;Ge=function(e,t){var r;if(!(null===(r=ke[0])||void 0===r?void 0:r.isFrozen())||e.type===A.FullSnapshot||e.type===A.IncrementalSnapshot&&e.data.source===$.Mutation||ke.forEach((function(e){return e.unfreeze()})),i(function(e){var t,r;try{for(var i=n(q||[]),o=i.next();!o.done;o=i.next()){var a=o.value;a.eventProcessor&&(e=a.eventProcessor(e))}}catch(e){t={error:e}}finally{try{o&&!o.done&&(r=i.return)&&r.call(i)}finally{if(t)throw t.error}}return I&&(e=I(e)),e}(e),t),e.type===A.FullSnapshot)H=e,U=0;else if(e.type===A.IncrementalSnapshot){if(e.data.source===$.Mutation&&e.data.isAttachIframe)return;U++;var s=a&&U>=a,u=o&&e.timestamp-H.timestamp>o;(s||u)&&Ye(!0)}};var z=function(e){Ge(Qe({type:A.IncrementalSnapshot,data:t({source:$.Mutation},e)}))},G=function(e){return Ge(Qe({type:A.IncrementalSnapshot,data:t({source:$.Scroll},e)}))},Y=function(e){return Ge(Qe({type:A.IncrementalSnapshot,data:t({source:$.CanvasMutation},e)}))},J=new Le({mutationCb:z}),Q=new Je({recordCanvas:R,mutationCb:Y,win:window,blockClass:u,mirror:Xe}),Z=new De({mutationCb:z,scrollCb:G,bypassOptions:{blockClass:u,blockSelector:c,maskTextClass:h,maskTextSelector:g,inlineStylesheet:_,maskInputOptions:W,maskTextFn:S,maskInputFn:w,recordCanvas:R,inlineImages:D,sampling:F,slimDOMOptions:V,iframeManager:J,canvasManager:Q},mirror:Xe});Ye=function(e){var t,n,i,o;void 0===e&&(e=!1),Ge(Qe({type:A.Meta,data:{href:window.location.href,width:oe(),height:ie()}}),e),ke.forEach((function(e){return e.lock()}));var a=r(function(e,t){var n=t||{},r=n.blockClass,i=void 0===r?"rr-block":r,o=n.blockSelector,a=void 0===o?null:o,s=n.maskTextClass,u=void 0===s?"rr-mask":s,l=n.maskTextSelector,c=void 0===l?null:l,d=n.inlineStylesheet,f=void 0===d||d,p=n.inlineImages,h=void 0!==p&&p,v=n.recordCanvas,g=void 0!==v&&v,m=n.maskAllInputs,_=void 0!==m&&m,y=n.maskTextFn,b=n.maskInputFn,k=n.slimDOM,w=void 0!==k&&k,S=n.dataURLOptions,C=n.preserveWhiteSpace,I=n.onSerialize,x=n.onIframeLoad,F=n.iframeLoadTimeout,E=n.keepIframeSrcFn,O={};return[X(e,{doc:e,map:O,blockClass:i,blockSelector:a,maskTextClass:u,maskTextSelector:c,skipChild:!1,inlineStylesheet:f,maskInputOptions:!0===_?{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===_?{password:!0}:_,maskTextFn:y,maskInputFn:b,slimDOMOptions:!0===w||"all"===w?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaDescKeywords:"all"===w,headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaAuthorship:!0,headMetaVerification:!0}:!1===w?{}:w,dataURLOptions:S,inlineImages:h,recordCanvas:g,preserveWhiteSpace:C,onSerialize:I,onIframeLoad:x,iframeLoadTimeout:F,keepIframeSrcFn:void 0===E?function(){return!1}:E}),O]}(document,{blockClass:u,blockSelector:c,maskTextClass:h,maskTextSelector:g,inlineStylesheet:_,maskAllInputs:W,maskTextFn:S,slimDOM:V,recordCanvas:R,inlineImages:D,onSerialize:function(e){ce(e)&&J.addIframe(e),de(e)&&Z.addShadowRoot(e.shadowRoot,document)},onIframeLoad:function(e,t){J.attachIframe(e,t),Z.observeAttachShadow(e)},keepIframeSrcFn:j}),2),s=a[0],l=a[1];if(!s)return console.warn("Failed to snapshot the document");Xe.map=l,Ge(Qe({type:A.FullSnapshot,data:{node:s,initialOffset:{left:void 0!==window.pageXOffset?window.pageXOffset:(null===document||void 0===document?void 0:document.documentElement.scrollLeft)||(null===(n=null===(t=null===document||void 0===document?void 0:document.body)||void 0===t?void 0:t.parentElement)||void 0===n?void 0:n.scrollLeft)||(null===document||void 0===document?void 0:document.body.scrollLeft)||0,top:void 0!==window.pageYOffset?window.pageYOffset:(null===document||void 0===document?void 0:document.documentElement.scrollTop)||(null===(o=null===(i=null===document||void 0===document?void 0:document.body)||void 0===i?void 0:i.parentElement)||void 0===o?void 0:o.scrollTop)||(null===document||void 0===document?void 0:document.body.scrollTop)||0}}})),ke.forEach((function(e){return e.unlock()}))};try{var ee=[];ee.push(K("DOMContentLoaded",(function(){Ge(Qe({type:A.DomContentLoaded,data:{}}))})));var te=function(e){var n;return Ne({mutationCb:z,mousemoveCb:function(e,t){return Ge(Qe({type:A.IncrementalSnapshot,data:{source:t,positions:e}}))},mouseInteractionCb:function(e){return Ge(Qe({type:A.IncrementalSnapshot,data:t({source:$.MouseInteraction},e)}))},scrollCb:G,viewportResizeCb:function(e){return Ge(Qe({type:A.IncrementalSnapshot,data:t({source:$.ViewportResize},e)}))},inputCb:function(e){return Ge(Qe({type:A.IncrementalSnapshot,data:t({source:$.Input},e)}))},mediaInteractionCb:function(e){return Ge(Qe({type:A.IncrementalSnapshot,data:t({source:$.MediaInteraction},e)}))},styleSheetRuleCb:function(e){return Ge(Qe({type:A.IncrementalSnapshot,data:t({source:$.StyleSheetRule},e)}))},styleDeclarationCb:function(e){return Ge(Qe({type:A.IncrementalSnapshot,data:t({source:$.StyleDeclaration},e)}))},canvasMutationCb:Y,fontCb:function(e){return Ge(Qe({type:A.IncrementalSnapshot,data:t({source:$.Font},e)}))},blockClass:u,ignoreClass:f,maskTextClass:h,maskTextSelector:g,maskInputOptions:W,inlineStylesheet:_,sampling:F,recordCanvas:R,inlineImages:D,userTriggeredOnInput:T,collectFonts:N,doc:e,maskInputFn:w,maskTextFn:S,blockSelector:c,slimDOMOptions:V,mirror:Xe,iframeManager:J,shadowDomManager:Z,canvasManager:Q,plugins:(null===(n=null==q?void 0:q.filter((function(e){return e.observer})))||void 0===n?void 0:n.map((function(e){return{observer:e.observer,options:e.options,callback:function(t){return Ge(Qe({type:A.Plugin,data:{plugin:e.name,payload:t}}))}}})))||[]},C)};J.addLoadListener((function(e){ee.push(te(e.contentDocument))}));var ne=function(){Ye(),ee.push(te(document))};return"interactive"===document.readyState||"complete"===document.readyState?ne():ee.push(K("load",(function(){Ge(Qe({type:A.Load,data:{}})),ne()}),window)),function(){ee.forEach((function(e){return e()}))}}catch(e){console.warn(e)}}Ke.addCustomEvent=function(e,t){if(!Ge)throw new Error("please add custom event after start recording");Ge(Qe({type:A.Custom,data:{tag:e,payload:t}}))},Ke.freezePage=function(){ke.forEach((function(e){return e.freeze()}))},Ke.takeFullSnapshot=function(e){if(!Ye)throw new Error("please take full snapshot after start recording");Ye(e)},Ke.mirror=Xe;var Ze=function(){function e(e){this.fileName=e.fileName||"",this.functionName=e.functionName||"",this.lineNumber=e.lineNumber,this.columnNumber=e.columnNumber}return e.prototype.toString=function(){var e=this.lineNumber||"",t=this.columnNumber||"";return this.functionName?this.functionName+" ("+this.fileName+":"+e+":"+t+")":this.fileName+":"+e+":"+t},e}(),et=/(^|@)\S+:\d+/,tt=/^\s*at .*(\S+:\d+|\(native\))/m,nt=/^(eval@)?(\[native code])?$/,rt={parse:function(e){if(!e)return[];if(void 0!==e.stacktrace||void 0!==e["opera#sourceloc"])return this.parseOpera(e);if(e.stack&&e.stack.match(tt))return this.parseV8OrIE(e);if(e.stack)return this.parseFFOrSafari(e);throw new Error("Cannot parse given Error object")},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(tt)}),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,a=["eval","<anonymous>"].indexOf(i[0])>-1?void 0:i[0];return new Ze({functionName:o,fileName:a,lineNumber:i[1],columnNumber:i[2]})}),this)},parseFFOrSafari:function(e){return e.stack.split("\n").filter((function(e){return!e.match(nt)}),this).map((function(e){if(e.indexOf(" > eval")>-1&&(e=e.replace(/ line (\d+)(?: > eval line \d+)* > eval:\d+:\d+/g,":$1")),-1===e.indexOf("@")&&-1===e.indexOf(":"))return new Ze({functionName:e});var t=/((.*".+"[^@]*)?[^@]*)(?:@)/,n=e.match(t),r=n&&n[1]?n[1]:void 0,i=this.extractLocation(e.replace(t,""));return new Ze({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 a=t.exec(n[i]);a&&r.push(new Ze({fileName:a[2],lineNumber:parseFloat(a[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 a=t.exec(n[i]);a&&r.push(new Ze({functionName:a[3]||void 0,fileName:a[2],lineNumber:parseFloat(a[1])}))}return r},parseOpera11:function(e){return e.stack.split("\n").filter((function(e){return!!e.match(et)&&!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 Ze({functionName:r,fileName:n[0],lineNumber:n[1],columnNumber:n[2]})}),this)}};function it(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 a=r.children[o];a.localName&&a.localName.toLowerCase&&a.localName.toLowerCase()===n&&i.push(a)}i.length>1&&(n+=":eq("+i.indexOf(e)+")"),t=n+(t?">"+t:""),e=r}return t}function ot(e){return"[object Object]"===Object.prototype.toString.call(e)}function at(e,t){var r,i;if(0===t)return!0;var o=Object.keys(e);try{for(var a=n(o),s=a.next();!s.done;s=a.next()){var u=s.value;if(ot(e[u])&&at(e[u],t-1))return!0}}catch(e){r={error:e}}finally{try{s&&!s.done&&(i=a.return)&&i.call(a)}finally{if(r)throw r.error}}return!1}function st(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(function(e){if(ot(e)&&Object.keys(e).length>n.numOfKeysLimit)return!0;if("function"==typeof e)return!0;if(ot(e)&&at(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(t instanceof Event){var a={};for(var s in t){var u=t[s];Array.isArray(u)?a[s]=it(u.length?u[0]:null):a[s]=u}return a}return t instanceof Node?t instanceof HTMLElement?t?t.outerHTML:"":t.nodeName:t instanceof Error?t.stack?t.stack+"\nEnd of stack for Error object":t.name+": "+t.message:t}))}var ut={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 lt(e,t,o){var a,s,u,l=o.logger;if(!l)return function(){};u="string"==typeof l?t[l]:l;var c=0,d=[];if(o.level.includes("error")&&window){var f=function(t){var n=t.message,r=t.error,i=rt.parse(r).map((function(e){return e.toString()})),a=[st(n,o.stringifyOptions)];e({level:"error",trace:i,payload:a})};window.addEventListener("error",f),d.push((function(){window&&window.removeEventListener("error",f)}))}try{for(var p=n(o.level),h=p.next();!h.done;h=p.next()){var v=h.value;d.push(g(u,v))}}catch(e){a={error:e}}finally{try{h&&!h.done&&(s=p.return)&&s.call(p)}finally{if(a)throw a.error}}return function(){d.forEach((function(e){return e()}))};function g(t,n){var a=this;return t[n]?re(t,n,(function(t){return function(){for(var s=[],u=0;u<arguments.length;u++)s[u]=arguments[u];t.apply(a,s);try{var l=rt.parse(new Error).map((function(e){return e.toString()})).splice(1),d=s.map((function(e){return st(e,o.stringifyOptions)}));++c<o.lengthThreshold?e({level:n,trace:l,payload:d}):c===o.lengthThreshold&&e({level:"warn",trace:[],payload:[st("The number of log records reached the threshold.")]})}catch(e){t.apply(void 0,i(["rrweb logger error:",e],r(s),!1))}}})):function(){}}}var ct=Array.prototype,dt=ct.forEach,ft=ct.indexOf,pt="undefined"!=typeof window?window:void 0,ht=null==pt?void 0:pt.navigator,vt=null==pt?void 0:pt.document,gt=null==ht?void 0:ht.userAgent,mt=null!=pt?pt:{};pt&&(pt.rrweb={record:Ke,version:"v1",rrwebVersion:"1.1.3"},pt.rrwebConsoleRecord={getRecordConsolePlugin:function(e){return{name:"rrweb/console@1",observer:lt,options:e?Object.assign({},ut,e):ut}}});var _t={DEBUG:!1,LIB_VERSION:"1.94.4"},yt=Array.isArray,bt=Object.prototype,kt=bt.hasOwnProperty,wt=bt.toString,St=yt||function(e){return"[object Array]"===wt.call(e)},Ct=function(e){return"[object Uint8Array]"===wt.call(e)},It=function(e){return"function"==typeof e},xt=function(e){return e===Object(e)&&!St(e)},Ft=function(e){if(xt(e)){for(var t in e)if(kt.call(e,t))return!1;return!0}return!1},Et=function(e){return void 0===e},Ot=function(e){return"[object String]"==wt.call(e)},Rt=function(e){return null===e},Mt=function(e){return"[object Number]"==wt.call(e)},Tt=function(e){return"[object Boolean]"===wt.call(e)},Pt="[PostHog.js]",Nt={_log:function(e){if(pt&&(_t.DEBUG||mt.POSTHOG_DEBUG)&&!Et(pt.console)&&pt.console){for(var t=("__rrweb_original__"in pt.console[e]?pt.console[e].__rrweb_original__:pt.console[e]),n=arguments.length,r=new Array(n>1?n-1:0),i=1;i<n;i++)r[i-1]=arguments[i];t.apply(void 0,[Pt].concat(r))}},info:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];Nt._log.apply(Nt,["log"].concat(t))},warn:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];Nt._log.apply(Nt,["warn"].concat(t))},error:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];Nt._log.apply(Nt,["error"].concat(t))},critical:function(){for(var e,t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];(e=console).error.apply(e,[Pt].concat(n))},uninitializedWarning:function(e){Nt.error("You must initialize PostHog before calling ".concat(e))}},Lt={},Dt=function(e){return e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"")};function At(e,t,n){if(St(e))if(dt&&e.forEach===dt)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)===Lt)return}function $t(e,t,n){if(!Rt(e)&&!Et(e)){if(St(e))return At(e,t,n);for(var r in e)if(kt.call(e,r)&&t.call(n,e[r],r)===Lt)return}}var qt=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 At(n,(function(t){for(var n in t)void 0!==t[n]&&(e[n]=t[n])})),e};function Bt(e,t){return-1!==e.indexOf(t)}function jt(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 Ht=function(){return Date.now=Date.now||function(){return+new Date},Date.now()},Wt=function(e){try{return e()}catch(e){return}},Vt=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){Nt.critical("Implementation error. Please turn on debug mode and open a ticket on https://app.posthog.com/home#panel=support%3Asupport%3A."),Nt.critical(e)}}},Ut=function(e){var t={};return $t(e,(function(e,n){Ot(e)&&e.length>0&&(t[n]=e)})),t};var zt=["$performance_raw"];function Gt(e,t){return n=e,r=function(e,n){return n&&zt.indexOf(n)>-1?e:Ot(e)&&!Rt(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),St(t)?(o=[],At(t,(function(t){o.push(e(t))}))):(o={},$t(t,(function(t,n){i.has(t)||(o[n]=e(t,n))}))),o);var o}(n);var n,r,i}function Yt(e){var t,n,r,i,o,a="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",s=0,u=0,l="",c=[];if(!e)return e;e=Jt(e);do{t=(o=e.charCodeAt(s++)<<16|e.charCodeAt(s++)<<8|e.charCodeAt(s++))>>18&63,n=o>>12&63,r=o>>6&63,i=63&o,c[u++]=a.charAt(t)+a.charAt(n)+a.charAt(r)+a.charAt(i)}while(s<e.length);switch(l=c.join(""),e.length%3){case 1:l=l.slice(0,-2)+"==";break;case 2:l=l.slice(0,-1)+"="}return l}var Jt=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 a=e.charCodeAt(i),s=null;a<128?n++:s=a>127&&a<2048?String.fromCharCode(a>>6|192,63&a|128):String.fromCharCode(a>>12|224,a>>6&63|128,63&a|128),Rt(s)||(n>t&&(o+=e.substring(t,n)),o+=s,t=n=i+1)}return n>t&&(o+=e.substring(t,e.length)),o},Qt=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 a="on"+n,s=t[a];t[a]=function(t,n,r){return function(i){if(i=i||e(null==pt?void 0:pt.event)){var o,a=!0;It(r)&&(o=r(i));var s=n.call(t,i);return!1!==o&&!1!==s||(a=!1),a}}}(t,r,s)}else Nt.error("No valid element provided to register_event")}}();function Xt(e,t){var n=function(){if(!vt)return t("document not found");var n=vt.createElement("script");n.type="text/javascript",n.src=e,n.onload=function(e){return t(void 0,e)},n.onerror=function(e){return t(e)};var r,i=vt.querySelectorAll("body > script");i.length>0?null===(r=i[0].parentNode)||void 0===r||r.insertBefore(n,i[0]):vt.body.appendChild(n)};null!=vt&&vt.body?n():null==vt||vt.addEventListener("DOMContentLoaded",n)}function Kt(e){return e?Dt(e).split(/\s+/):[]}function Zt(e){var t="";switch(s(e.className)){case"string":t=e.className;break;case"object":t=("baseVal"in e.className?e.className.baseVal:null)||e.getAttribute("class")||"";break;default:t=""}return Kt(t)}function en(e){var t="";return sn(e)&&!un(e)&&e.childNodes&&e.childNodes.length&&$t(e.childNodes,(function(e){rn(e)&&e.textContent&&(t+=Dt(e.textContent).split(/(\s+)/).filter(ln).join("").replace(/[\r\n]/g," ").replace(/[ ]+/g," ").substring(0,255))})),Dt(t)}function tn(e){return!!e&&1===e.nodeType}function nn(e,t){return!!e&&!!e.tagName&&e.tagName.toLowerCase()===t.toLowerCase()}function rn(e){return!!e&&3===e.nodeType}function on(e){return!!e&&11===e.nodeType}var an=["a","button","form","input","select","textarea","label"];function sn(e){for(var t=e;t.parentNode&&!nn(t,"body");t=t.parentNode){var n=Zt(t);if(Bt(n,"ph-sensitive")||Bt(n,"ph-no-capture"))return!1}if(Bt(Zt(e),"ph-include"))return!0;var r=e.type||"";if(Ot(r))switch(r.toLowerCase()){case"hidden":case"password":return!1}var i=e.name||e.id||"";if(Ot(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 un(e){return!!(nn(e,"input")&&!["button","checkbox","submit","reset"].includes(e.type)||nn(e,"select")||nn(e,"textarea")||"true"===e.getAttribute("contenteditable"))}function ln(e){if(Rt(e)||Et(e))return!1;if(Ot(e)){e=Dt(e);if(/^(?:(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}))$/.test((e||"").replace(/[- ]/g,"")))return!1;if(/(^\d{3}-?\d{2}-?\d{4}$)/.test(e))return!1}return!0}function cn(e){var t=en(e);return ln(t="".concat(t," ").concat(dn(e)).trim())?t:""}function dn(e){var t="";return e&&e.childNodes&&e.childNodes.length&&$t(e.childNodes,(function(e){var n;if(e&&"span"===(null===(n=e.tagName)||void 0===n?void 0:n.toLowerCase()))try{var r=en(e);t="".concat(t," ").concat(r).trim(),e.childNodes&&e.childNodes.length&&(t="".concat(t," ").concat(dn(e)).trim())}catch(e){Nt.error(e)}})),t}function fn(e){return function(e){var t=e.map((function(e){var t,n,r="";if(e.tag_name&&(r+=e.tag_name),e.attr_class){e.attr_class.sort();var i,o=w(e.attr_class);try{for(o.s();!(i=o.n()).done;){var s=i.value;r+=".".concat(s.replace(/"/g,""))}}catch(e){o.e(e)}finally{o.f()}}var u=a(a(a(a({},e.text?{text:e.text}:{}),{},{"nth-child":null!==(t=e.nth_child)&&void 0!==t?t:0,"nth-of-type":null!==(n=e.nth_of_type)&&void 0!==n?n:0},e.href?{href:e.href}:{}),e.attr_id?{attr_id:e.attr_id}:{}),e.attributes),l={};return jt(u).sort((function(e,t){var n=_(e,1)[0],r=_(t,1)[0];return n.localeCompare(r)})).forEach((function(e){var t=_(e,2),n=t[0],r=t[1];return l[pn(n.toString())]=pn(r.toString())})),r+=":",r+=jt(u).map((function(e){var t=_(e,2),n=t[0],r=t[1];return"".concat(n,'="').concat(r,'"')})).join("")}));return t.join(";")}(function(e){return e.map((function(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:hn(e),attr_id:e.attr__id,nth_child:e.nth_child,nth_of_type:e.nth_of_type,attributes:{}};return jt(e).filter((function(e){return 0===_(e,1)[0].indexOf("attr__")})).forEach((function(e){var t=_(e,2),n=t[0],i=t[1];return r.attributes[n]=i})),r}))}(e))}function pn(e){return e.replace(/"|\\"/g,'\\"')}function hn(e){var t=e.attr__class;return t?St(t)?t:Kt(t):void 0}var vn=function(){function e(t){u(this,e),this.clicks=[],this.enabled=t}return c(e,[{key:"isRageClick",value:function(e,t,n){if(!this.enabled)return!1;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}}]),e}(),gn="$people_distinct_id",mn="__alias",_n="__timers",yn="$autocapture_disabled_server_side",bn="$session_recording_enabled_server_side",kn="$console_log_recording_enabled_server_side",wn="$session_recording_recorder_version_server_side",Sn="$session_recording_network_payload_capture",Cn="$sesid",In="$session_is_sampled",xn="$enabled_feature_flags",Fn="$early_access_features",En="$stored_person_properties",On="$stored_group_properties",Rn="$surveys",Mn="$flag_call_reported",Tn="$user_state",Pn="$posthog_quota_limited",Nn="$client_session_props",Ln=[gn,mn,"__cmpns",_n,bn,Cn,xn,Tn,Pn,Fn,On,En,Rn,Mn,Nn];function Dn(e,t){return t.length>e?t.slice(0,e)+"...":t}var An={_initializedTokens:[],_isDisabledServerSide:null,_isAutocaptureEnabled:!1,_setIsAutocaptureEnabled:function(e){var t,n=Rt(this._isDisabledServerSide)?!(null===(t=e.persistence)||void 0===t||!t.props[yn]):this._isDisabledServerSide,r=!!e.config.autocapture;this._isAutocaptureEnabled=r&&!n},_previousElementSibling:function(e){if(e.previousElementSibling)return e.previousElementSibling;var t=e;do{t=t.previousSibling}while(t&&!tn(t));return t},_getAugmentPropertiesFromElement:function(e){if(!sn(e))return{};var t={};return $t(e.attributes,(function(e){if(0===e.name.indexOf("data-ph-capture-attribute")){var n=e.name.replace("data-ph-capture-attribute-",""),r=e.value;n&&r&&ln(r)&&(t[n]=r)}})),t},_getPropertiesFromElement:function(e,t,n){var r,i=e.tagName.toLowerCase(),o={tag_name:i};an.indexOf(i)>-1&&!n&&("a"===i.toLowerCase()||"button"===i.toLowerCase()?o.$el_text=Dn(1024,cn(e)):o.$el_text=Dn(1024,en(e)));var a=Zt(e);a.length>0&&(o.classes=a.filter((function(e){return""!==e})));var s=null===(r=this.config)||void 0===r?void 0:r.element_attribute_ignorelist;$t(e.attributes,(function(n){var r;if((!un(e)||-1!==["name","id","class"].indexOf(n.name))&&((null==s||!s.includes(n.name))&&!t&&ln(n.value)&&(r=n.name,!Ot(r)||"_ngcontent"!==r.substring(0,10)&&"_nghost"!==r.substring(0,7)))){var i=n.value;"class"===n.name&&(i=Kt(i).join(" ")),o["attr__"+n.name]=Dn(1024,i)}}));for(var u=1,l=1,c=e;c=this._previousElementSibling(c);)u++,c.tagName===e.tagName&&l++;return o.nth_child=u,o.nth_of_type=l,o},_getDefaultProperties:function(e){return{$event_type:e,$ce_version:1}},_extractCustomPropertyValue:function(e){var t=[];return $t(null==vt?void 0:vt.querySelectorAll(e.css_selector),(function(e){var n;["input","select"].indexOf(e.tagName.toLowerCase())>-1?n=e.value:e.textContent&&(n=e.textContent),ln(n)&&t.push(n)})),t.join(", ")},_getCustomProperties:function(e){var t=this,n={};return $t(this._customProperties,(function(r){$t(r.event_selectors,(function(i){$t(null==vt?void 0:vt.querySelectorAll(i),(function(i){Bt(e,i)&&sn(i)&&(n[r.name]=t._extractCustomPropertyValue(r))}))}))})),n},_getEventTarget:function(e){return Et(e.target)?e.srcElement||null:null!==(t=e.target)&&void 0!==t&&t.shadowRoot?e.composedPath()[0]||null:e.target||null;var t},_captureEvent:function(e,t){var n,r=this,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"$autocapture",o=this._getEventTarget(e);(rn(o)&&(o=o.parentNode||null),"$autocapture"===i&&"click"===e.type&&e instanceof MouseEvent)&&(null!==(n=this.rageclicks)&&void 0!==n&&n.isRageClick(e.clientX,e.clientY,(new Date).getTime())&&this._captureEvent(e,t,"$rageclick"));if(o&&function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:void 0;if(!pt||!e||nn(e,"html")||!tn(e))return!1;if(null!=n&&n.url_allowlist){var r=pt.location.href,i=n.url_allowlist;if(i&&!i.some((function(e){return r.match(e)})))return!1}if(null!=n&&n.dom_event_allowlist){var o=n.dom_event_allowlist;if(o&&!o.some((function(e){return t.type===e})))return!1}if(null!=n&&n.element_allowlist){var a=n.element_allowlist;if(a&&!a.some((function(t){return e.tagName.toLowerCase()===t})))return!1}if(null!=n&&n.css_selector_allowlist){var s=n.css_selector_allowlist;if(s&&!s.some((function(t){return e.matches(t)})))return!1}for(var u=!1,l=[e],c=!0,d=e;d.parentNode&&!nn(d,"body");)if(on(d.parentNode))l.push(d.parentNode.host),d=d.parentNode.host;else{if(!(c=d.parentNode||!1))break;if(an.indexOf(c.tagName.toLowerCase())>-1)u=!0;else{var f=pt.getComputedStyle(c);f&&"pointer"===f.getPropertyValue("cursor")&&(u=!0)}l.push(c),d=c}var p=pt.getComputedStyle(e);if(p&&"pointer"===p.getPropertyValue("cursor")&&"click"===t.type)return!0;var h=e.tagName.toLowerCase();switch(h){case"html":return!1;case"form":return"submit"===t.type;case"input":case"select":case"textarea":return"change"===t.type||"click"===t.type;default:return u?"click"===t.type:"click"===t.type&&(an.indexOf(h)>-1||"true"===e.getAttribute("contenteditable"))}}(o,e,this.config)){for(var a,s,u=[o],l=o;l.parentNode&&!nn(l,"body");)on(l.parentNode)?(u.push(l.parentNode.host),l=l.parentNode.host):(u.push(l.parentNode),l=l.parentNode);var c,d=[],f={},p=!1;if($t(u,(function(e){var n=sn(e);"a"===e.tagName.toLowerCase()&&(c=e.getAttribute("href"),c=n&&ln(c)&&c),Bt(Zt(e),"ph-no-capture")&&(p=!0),d.push(r._getPropertiesFromElement(e,t.config.mask_all_element_attributes,t.config.mask_all_text));var i=r._getAugmentPropertiesFromElement(e);qt(f,i)})),t.config.mask_all_text||("a"===o.tagName.toLowerCase()||"button"===o.tagName.toLowerCase()?d[0].$el_text=cn(o):d[0].$el_text=en(o)),c&&(d[0].attr__href=c),p)return!1;var h=qt(this._getDefaultProperties(e.type),t.elementsChainAsString?{$elements_chain:fn(d)}:{$elements:d},null!==(a=d[0])&&void 0!==a&&a.$el_text?{$el_text:null===(s=d[0])||void 0===s?void 0:s.$el_text}:{},this._getCustomProperties(u),f);return t.capture(i,h),!0}},_navigate:function(e){pt&&(pt.location.href=e)},_addDomEventHandlers:function(e){var t=this;if(pt&&vt){var n=function(n){n=n||(null==pt?void 0:pt.event),t._captureEvent(n,e)};Qt(vt,"submit",n,!1,!0),Qt(vt,"change",n,!1,!0),Qt(vt,"click",n,!1,!0)}},_customProperties:[],rageclicks:null,config:void 0,init:function(e){var t;Tt(e.__autocapture)||(this.config=e.__autocapture),null!==(t=this.config)&&void 0!==t&&t.url_allowlist&&(this.config.url_allowlist=this.config.url_allowlist.map((function(e){return new RegExp(e)}))),this.rageclicks=new vn(e.config.rageclick)},afterDecideResponse:function(e,t){var n=t.config.token;this._initializedTokens.indexOf(n)>-1?Nt.info('autocapture already initialized for token "'+n+'"'):(t.persistence&&t.persistence.register(d({},yn,!!e.autocapture_opt_out)),this._isDisabledServerSide=!!e.autocapture_opt_out,this._setIsAutocaptureEnabled(t),this._initializedTokens.push(n),e&&e.config&&e.config.enable_collect_everything&&this._isAutocaptureEnabled?(e.custom_properties&&(this._customProperties=e.custom_properties),this._addDomEventHandlers(t)):t.__autocapture=!1)},enabledForProject:function(e,t,n){if(!e)return!0;t=Et(t)?10:t,n=Et(n)?10:n;for(var r=0,i=0;i<e.length;i++)r+=e.charCodeAt(i);return r%t<n},isBrowserSupported:function(){return It(null==vt?void 0:vt.querySelectorAll)}};!function(e){for(var t in e)It(e[t])&&(e[t]=e[t].bind(e))}(An),function(e){for(var t in e)It(e[t])&&(e[t]=Vt(e[t]))}(An);var $n="$active_feature_flags",qn="$override_feature_flags",Bn="$feature_flag_payloads",jn=function(e){var t,n={},r=w(jt(e||{}));try{for(r.s();!(t=r.n()).done;){var i=_(t.value,2),o=i[0],a=i[1];a&&(n[o]=a)}}catch(e){r.e(e)}finally{r.f()}return n},Hn=function(){function e(t){u(this,e),this.instance=t,this._override_warning=!1,this.featureFlagEventHandlers=[],this.reloadFeatureFlagsQueued=!1,this.reloadFeatureFlagsInAction=!1}return c(e,[{key:"getFlags",value:function(){return Object.keys(this.getFlagVariants())}},{key:"getFlagVariants",value:function(){var e=this.instance.get_property(xn),t=this.instance.get_property(qn);if(!t)return e||{};for(var n=qt({},e),r=Object.keys(t),i=0;i<r.length;i++)!1===t[r[i]]?delete n[r[i]]:n[r[i]]=t[r[i]];return this._override_warning||(Nt.warn(" Overriding feature flags!",{enabledFlags:e,overriddenFlags:t,finalFlags:n}),this._override_warning=!0),n}},{key:"getFlagPayloads",value:function(){return this.instance.get_property(Bn)||{}}},{key:"reloadFeatureFlags",value:function(){this.reloadFeatureFlagsQueued||(this.reloadFeatureFlagsQueued=!0,this._startReloadTimer())}},{key:"setAnonymousDistinctId",value:function(e){this.$anon_distinct_id=e}},{key:"setReloadingPaused",value:function(e){this.reloadFeatureFlagsInAction=e}},{key:"resetRequestQueue",value:function(){this.reloadFeatureFlagsQueued=!1}},{key:"_startReloadTimer",value:function(){var e=this;this.reloadFeatureFlagsQueued&&!this.reloadFeatureFlagsInAction&&setTimeout((function(){!e.reloadFeatureFlagsInAction&&e.reloadFeatureFlagsQueued&&(e.reloadFeatureFlagsQueued=!1,e._reloadFeatureFlagsRequest())}),5)}},{key:"_reloadFeatureFlagsRequest",value:function(){var e=this;if(!this.instance.config.advanced_disable_feature_flags){this.setReloadingPaused(!0);var t=this.instance.config.token,n=this.instance.get_property(En),r=this.instance.get_property(On),i=Yt(JSON.stringify({token:t,distinct_id:this.instance.get_distinct_id(),groups:this.instance.getGroups(),$anon_distinct_id:this.$anon_distinct_id,person_properties:n,group_properties:r,disable_flags:this.instance.config.advanced_disable_feature_flags||void 0}));this.instance._send_request(this.instance.config.api_host+"/decide/?v=3",{data:i},{method:"POST"},this.instance._prepare_callback((function(t){e.$anon_distinct_id=void 0,e.receivedFeatureFlags(t),e.setReloadingPaused(!1),e._startReloadTimer()})))}}},{key:"getFeatureFlag",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(this.instance.decideEndpointWasHit||this.getFlags()&&this.getFlags().length>0){var n,r=this.getFlagVariants()[e],i="".concat(r),o=this.instance.get_property(Mn)||{};if(t.send_event||!("send_event"in t))if(!(e in o)||!o[e].includes(i))St(o[e])?o[e].push(i):o[e]=[i],null===(n=this.instance.persistence)||void 0===n||n.register(d({},Mn,o)),this.instance.capture("$feature_flag_called",{$feature_flag:e,$feature_flag_response:r});return r}Nt.warn('getFeatureFlag for key "'+e+"\" failed. Feature flags didn't load in time.")}},{key:"getFeatureFlagPayload",value:function(e){return this.getFlagPayloads()[e]}},{key:"isFeatureEnabled",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(this.instance.decideEndpointWasHit||this.getFlags()&&this.getFlags().length>0)return!!this.getFeatureFlag(e,t);Nt.warn('isFeatureEnabled for key "'+e+"\" failed. Feature flags didn't load in time.")}},{key:"addFeatureFlagsHandler",value:function(e){this.featureFlagEventHandlers.push(e)}},{key:"removeFeatureFlagsHandler",value:function(e){this.featureFlagEventHandlers=this.featureFlagEventHandlers.filter((function(t){return t!==e}))}},{key:"receivedFeatureFlags",value:function(e){if(this.instance.persistence){this.instance.decideEndpointWasHit=!0;var t=this.getFlagVariants(),n=this.getFlagPayloads();!function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},i=e.featureFlags,o=e.featureFlagPayloads;if(i)if(St(i)){var s,u={};if(i)for(var l=0;l<i.length;l++)u[i[l]]=!0;t&&t.register((d(s={},$n,i),d(s,xn,u),s))}else{var c,f=i,p=o;e.errorsWhileComputingFlags&&(f=a(a({},n),f),p=a(a({},r),p)),t&&t.register((d(c={},$n,Object.keys(jn(f))),d(c,xn,f||{}),d(c,Bn,p||{}),c))}}(e,this.instance.persistence,t,n),this._fireFeatureFlagsCallbacks()}}},{key:"override",value:function(e){if(!this.instance.__loaded||!this.instance.persistence)return Nt.uninitializedWarning("posthog.feature_flags.override");if(this._override_warning=!1,!1===e)this.instance.persistence.unregister(qn);else if(St(e)){for(var t={},n=0;n<e.length;n++)t[e[n]]=!0;this.instance.persistence.register(d({},qn,t))}else this.instance.persistence.register(d({},qn,e))}},{key:"onFeatureFlags",value:function(e){var t=this;if(this.addFeatureFlagsHandler(e),this.instance.decideEndpointWasHit){var n=this._prepareFeatureFlagsForCallbacks(),r=n.flags,i=n.flagVariants;e(r,i)}return function(){return t.removeFeatureFlagsHandler(e)}}},{key:"updateEarlyAccessFeatureEnrollment",value:function(e,t){var n,r,i=d({},"$feature_enrollment/".concat(e),t);this.instance.capture("$feature_enrollment_update",{$feature_flag:e,$feature_enrollment:t,$set:i}),this.setPersonPropertiesForFlags(i,!1);var o=a(a({},this.getFlagVariants()),{},d({},e,t));null===(n=this.instance.persistence)||void 0===n||n.register((d(r={},$n,Object.keys(jn(o))),d(r,xn,o),r)),this._fireFeatureFlagsCallbacks()}},{key:"getEarlyAccessFeatures",value:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]&&arguments[1],r=this.instance.get_property(Fn);if(r&&!n)return e(r);this.instance._send_request("".concat(this.instance.config.api_host,"/api/early_access_features/?token=").concat(this.instance.config.token),{},{method:"GET"},(function(n){var r,i=n.earlyAccessFeatures;return null===(r=t.instance.persistence)||void 0===r||r.register(d({},Fn,i)),e(i)}))}},{key:"_prepareFeatureFlagsForCallbacks",value:function(){var e=this.getFlags(),t=this.getFlagVariants();return{flags:e.filter((function(e){return t[e]})),flagVariants:Object.keys(t).filter((function(e){return t[e]})).reduce((function(e,n){return e[n]=t[n],e}),{})}}},{key:"_fireFeatureFlagsCallbacks",value:function(){var e=this._prepareFeatureFlagsForCallbacks(),t=e.flags,n=e.flagVariants;this.featureFlagEventHandlers.forEach((function(e){return e(t,n)}))}},{key:"setPersonPropertiesForFlags",value:function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],n=this.instance.get_property(En)||{};this.instance.register(d({},En,a(a({},n),e))),t&&this.instance.reloadFeatureFlags()}},{key:"resetPersonPropertiesForFlags",value:function(){this.instance.unregister(En)}},{key:"setGroupPropertiesForFlags",value:function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],n=this.instance.get_property(On)||{};0!==Object.keys(n).length&&Object.keys(n).forEach((function(t){n[t]=a(a({},n[t]),e[t]),delete e[t]})),this.instance.register(d({},On,a(a({},n),e))),t&&this.instance.reloadFeatureFlags()}},{key:"resetGroupPropertiesForFlags",value:function(e){if(e){var t=this.instance.get_property(On)||{};this.instance.register(d({},On,a(a({},t),{},d({},e,{}))))}else this.instance.unregister(On)}}]),e}();Math.trunc||(Math.trunc=function(e){return e<0?Math.ceil(e):Math.floor(e)}),Number.isInteger||(Number.isInteger=function(e){return Mt(e)&&isFinite(e)&&Math.floor(e)===e});var Wn="0123456789abcdef",Vn=function(){function e(t){if(u(this,e),this.bytes=t,16!==t.length)throw new TypeError("not 128-bit length")}return c(e,[{key:"toString",value:function(){for(var e="",t=0;t<this.bytes.length;t++)e=e+Wn.charAt(this.bytes[t]>>>4)+Wn.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}},{key:"clone",value:function(){return new e(this.bytes.slice(0))}},{key:"equals",value:function(e){return 0===this.compareTo(e)}},{key:"compareTo",value:function(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}}],[{key:"fromFieldsV7",value:function(t,n,r,i){if(!Number.isInteger(t)||!Number.isInteger(n)||!Number.isInteger(r)||!Number.isInteger(i)||t<0||n<0||r<0||i<0||t>0xffffffffffff||n>4095||r>1073741823||i>4294967295)throw new RangeError("invalid field value");var o=new Uint8Array(16);return o[0]=t/Math.pow(2,40),o[1]=t/Math.pow(2,32),o[2]=t/Math.pow(2,24),o[3]=t/Math.pow(2,16),o[4]=t/Math.pow(2,8),o[5]=t,o[6]=112|n>>>8,o[7]=n,o[8]=128|r>>>24,o[9]=r>>>16,o[10]=r>>>8,o[11]=r,o[12]=i>>>24,o[13]=i>>>16,o[14]=i>>>8,o[15]=i,new e(o)}}]),e}(),Un=function(){function e(){u(this,e),d(this,"timestamp",0),d(this,"counter",0),d(this,"random",new Yn)}return c(e,[{key:"generate",value:function(){var e=this.generateOrAbort();if(Et(e)){this.timestamp=0;var t=this.generateOrAbort();if(Et(t))throw new Error("Could not generate UUID after timestamp reset");return t}return e}},{key:"generateOrAbort",value:function(){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 Vn.fromFieldsV7(this.timestamp,Math.trunc(this.counter/Math.pow(2,30)),this.counter&Math.pow(2,30)-1,this.random.nextUint32())}},{key:"resetCounter",value:function(){this.counter=1024*this.random.nextUint32()+(1023&this.random.nextUint32())}}]),e}(),zn=function(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};pt&&!Et(pt.crypto)&&crypto.getRandomValues&&(zn=function(e){return crypto.getRandomValues(e)});var Gn,Yn=function(){function e(){u(this,e),d(this,"buffer",new Uint32Array(8)),d(this,"cursor",1/0)}return c(e,[{key:"nextUint32",value:function(){return this.cursor>=this.buffer.length&&(zn(this.buffer),this.cursor=0),this.buffer[this.cursor++]}}]),e}(),Jn=function(){return Qn().toString()},Qn=function(){return(Gn||(Gn=new Un)).generate()},Xn="Thu, 01 Jan 1970 00:00:00 GMT",Kn="";var Zn=/[a-z0-9][a-z0-9-]+\.[a-z]{2,}$/i,er=function(e){var t=e.match(Zn);return t?t[0]:""};function tr(e,t){if(t){var n=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:vt;if(Kn)return Kn;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_"+Jn(),o=new RegExp("(^|;)\\s*"+i+"=1");!Kn&&r--;){var a=n.slice(r).join("."),s=i+"=1;domain=."+a;t.cookie=s,o.test(t.cookie)&&(t.cookie=s+";expires="+Xn,Kn=a)}return Kn}(e);if(!n){var r=er(e);r!==n&&Nt.info("Warning: cookie subdomain discovery mismatch",r,n),n=r}return n?"; domain=."+n:""}return""}var nr={is_supported:function(){return!!vt},error:function(e){Nt.error("cookieStore error: "+e)},get:function(e){if(vt){try{for(var t=e+"=",n=vt.cookie.split(";").filter((function(e){return 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(nr.get(e))||{}}catch(e){}return t},set:function(e,t,n,r,i){if(vt)try{var o="",a="",s=tr(vt.location.hostname,r);if(n){var u=new Date;u.setTime(u.getTime()+24*n*60*60*1e3),o="; expires="+u.toUTCString()}i&&(a="; secure");var l=e+"="+encodeURIComponent(JSON.stringify(t))+o+"; SameSite=Lax; path=/"+s+a;return l.length>3686.4&&Nt.warn("cookieStore warning: large cookie, len="+l.length),vt.cookie=l,l}catch(e){return}},remove:function(e,t){try{nr.set(e,"",-1,t)}catch(e){return}}},rr=null,ir={is_supported:function(){if(!Rt(rr))return rr;var e=!0;if(Et(pt))e=!1;else try{var t="__mplssupport__";ir.set(t,"xyz"),'"xyz"'!==ir.get(t)&&(e=!1),ir.remove(t)}catch(t){e=!1}return e||Nt.error("localStorage unsupported; falling back to cookie store"),rr=e,e},error:function(e){Nt.error("localStorage error: "+e)},get:function(e){try{return null==pt?void 0:pt.localStorage.getItem(e)}catch(e){ir.error(e)}return null},parse:function(e){try{return JSON.parse(ir.get(e))||{}}catch(e){}return null},set:function(e,t){try{null==pt||pt.localStorage.setItem(e,JSON.stringify(t))}catch(e){ir.error(e)}},remove:function(e){try{null==pt||pt.localStorage.removeItem(e)}catch(e){ir.error(e)}}},or=["distinct_id",Cn,In],ar=a(a({},ir),{},{parse:function(e){try{var t={};try{t=nr.parse(e)||{}}catch(e){}var n=qt(t,JSON.parse(ir.get(e)||"{}"));return ir.set(e,n),n}catch(e){}return null},set:function(e,t,n,r,i){try{ir.set(e,t);var o={};or.forEach((function(e){t[e]&&(o[e]=t[e])})),Object.keys(o).length&&nr.set(e,o,n,r,i)}catch(e){ir.error(e)}},remove:function(e,t){try{null==pt||pt.localStorage.removeItem(e),nr.remove(e,t)}catch(e){ir.error(e)}}}),sr={},ur={is_supported:function(){return!0},error:function(e){Nt.error("memoryStorage error: "+e)},get:function(e){return sr[e]||null},parse:function(e){return sr[e]||null},set:function(e,t){sr[e]=t},remove:function(e){delete sr[e]}},lr=null,cr={is_supported:function(){if(!Rt(lr))return lr;if(lr=!0,Et(pt))lr=!1;else try{var e="__support__";cr.set(e,"xyz"),'"xyz"'!==cr.get(e)&&(lr=!1),cr.remove(e)}catch(e){lr=!1}return lr},error:function(e){Nt.error("sessionStorage error: ",e)},get:function(e){try{return null==pt?void 0:pt.sessionStorage.getItem(e)}catch(e){cr.error(e)}return null},parse:function(e){try{return JSON.parse(cr.get(e))||null}catch(e){}return null},set:function(e,t){try{null==pt||pt.sessionStorage.setItem(e,JSON.stringify(t))}catch(e){cr.error(e)}},remove:function(e){try{null==pt||pt.sessionStorage.removeItem(e)}catch(e){cr.error(e)}}},dr=["localhost","127.0.0.1"],fr=function(e){var t=null==vt?void 0:vt.createElement("a");return Et(t)?null:(t.href=e,t)},pr=function(e,t){return!!function(e){try{new RegExp(e)}catch(e){return!1}return!0}(t)&&new RegExp(t).test(e)},hr=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(!St(n)||n.length<2)return"";var a=n[1];try{a=decodeURIComponent(a)}catch(e){Nt.error("Skipping decoding for malformed query param: "+a)}return a.replace(/\+/g," ")},vr=function(e,t){var n=e.match(new RegExp(t+"=([^&]*)"));return n?n[1]:null};var gr={campaignParams:function(e){var t=["utm_source","utm_medium","utm_campaign","utm_content","utm_term","gclid","gbraid","wbraid","fbclid","msclkid"].concat(e||[]),n={};return $t(t,(function(e){var t=vt?hr(vt.URL,e):"";t.length&&(n[e]=t)})),n},searchEngine:function(){var e=null==vt?void 0:vt.referrer;return e?0===e.search("https?://(.*)google.([^/?]*)")?"google":0===e.search("https?://(.*)bing.com")?"bing":0===e.search("https?://(.*)yahoo.com")?"yahoo":0===e.search("https?://(.*)duckduckgo.com")?"duckduckgo":null:null},searchInfo:function(){var e=gr.searchEngine(),t="yahoo"!=e?"q":"p",n={};if(!Rt(e)){n.$search_engine=e;var r=vt?hr(vt.referrer,t):"";r.length&&(n.ph_keyword=r)}return n},browser:function(e,t,n){return t=t||"",n||Bt(e," OPR/")?Bt(e,"Mini")?"Opera Mini":"Opera":/(BlackBerry|PlayBook|BB10)/i.test(e)?"BlackBerry":Bt(e,"IEMobile")||Bt(e,"WPDesktop")?"Internet Explorer Mobile":Bt(e,"SamsungBrowser/")?"Samsung Internet":Bt(e,"Edge")||Bt(e,"Edg/")?"Microsoft Edge":Bt(e,"FBIOS")?"Facebook Mobile":Bt(e,"Chrome")?"Chrome":Bt(e,"CriOS")?"Chrome iOS":Bt(e,"UCWEB")||Bt(e,"UCBrowser")?"UC Browser":Bt(e,"FxiOS")?"Firefox iOS":Bt(t,"Apple")||function(e){return Bt(e,"Safari")&&!Bt(e,"Chrome")&&!Bt(e,"Android")}(e)?Bt(e,"Mobile")?"Mobile Safari":"Safari":Bt(e,"Android")?"Android Mobile":Bt(e,"Konqueror")||Bt(e,"konqueror")?"Konqueror":Bt(e,"Firefox")?"Firefox":Bt(e,"MSIE")||Bt(e,"Trident/")?"Internet Explorer":Bt(e,"Gecko")?"Mozilla":""},browserVersion:function(e,t,n){var r={"Internet Explorer Mobile":[/rv:(\d+(\.\d+)?)/],"Microsoft Edge":[/Edge?\/(\d+(\.\d+)?)/],Chrome:[/Chrome\/(\d+(\.\d+)?)/],"Chrome iOS":[/CriOS\/(\d+(\.\d+)?)/],"UC Browser":[/(UCBrowser|UCWEB)\/(\d+(\.\d+)?)/],Safari:[/Version\/(\d+(\.\d+)?)/],"Mobile Safari":[/Version\/(\d+(\.\d+)?)/],Opera:[/(Opera|OPR)\/(\d+(\.\d+)?)/],Firefox:[/Firefox\/(\d+(\.\d+)?)/],"Firefox iOS":[/FxiOS\/(\d+(\.\d+)?)/],Konqueror:[/Konqueror[:/]?(\d+(\.\d+)?)/i],BlackBerry:[/BlackBerry (\d+(\.\d+)?)/,/Version\/(\d+(\.\d+)?)/],"Android Mobile":[/android\s(\d+(\.\d+)?)/],"Samsung Internet":[/SamsungBrowser\/(\d+(\.\d+)?)/],"Internet Explorer":[/(rv:|MSIE )(\d+(\.\d+)?)/],Mozilla:[/rv:(\d+(\.\d+)?)/]}[gr.browser(e,t,n)];if(Et(r))return null;for(var i=0;i<r.length;i++){var o=r[i],a=e.match(o);if(a)return parseFloat(a[a.length-2])}return null},browserLanguage:function(){return navigator.language||navigator.userLanguage},os:function(e){if(/Windows/i.test(e)){if(/Phone/.test(e)||/WPDesktop/.test(e))return{os_name:"Windows Phone",os_version:""};var t=/Windows NT ([0-9.]+)/i.exec(e);return t&&t[1]?{os_name:"Windows",os_version:t[1]}:{os_name:"Windows",os_version:""}}if(/(iPhone|iPad|iPod)/.test(e)){var n=/OS (\d+)_(\d+)_?(\d+)?/i.exec(e);return n&&n[1]?{os_name:"iOS",os_version:[n[1],n[2],n[3]||"0"].join(".")}:{os_name:"iOS",os_version:""}}if(/Android/.test(e)){var r=/Android (\d+)\.(\d+)\.?(\d+)?/i.exec(e);return r&&r[1]?{os_name:"Android",os_version:[r[1],r[2],r[3]||"0"].join(".")}:{os_name:"Android",os_version:""}}if(/(BlackBerry|PlayBook|BB10)/i.test(e))return{os_name:"BlackBerry",os_version:""};if(/Mac/i.test(e)){var i=/Mac OS X (\d+)[_.](\d+)[_.]?(\d+)?/i.exec(e);return i&&i[1]?{os_name:"Mac OS X",os_version:[i[1],i[2],i[3]||"0"].join(".")}:{os_name:"Mac OS X",os_version:""}}return/Linux/.test(e)?{os_name:"Linux",os_version:""}:/CrOS/.test(e)?{os_name:"Chrome OS",os_version:""}:{os_name:"",os_version:""}},device:function(e){return/Windows Phone/i.test(e)||/WPDesktop/.test(e)?"Windows Phone":/iPad/.test(e)?"iPad":/iPod/.test(e)?"iPod Touch":/iPhone/.test(e)?"iPhone":/(BlackBerry|PlayBook|BB10)/i.test(e)?"BlackBerry":/Android/.test(e)&&!/Mobile/.test(e)?"Android Tablet":/Android/.test(e)?"Android":""},deviceType:function(e){var t=this.device(e);return"iPad"===t||"Android Tablet"===t?"Tablet":t?"Mobile":"Desktop"},referrer:function(){return(null==vt?void 0:vt.referrer)||"$direct"},referringDomain:function(){var e;return null!=vt&&vt.referrer&&(null===(e=fr(vt.referrer))||void 0===e?void 0:e.host)||"$direct"},properties:function(){if(!gt)return{};var e=gr.os(gt),t=e.os_name,n=e.os_version;return qt(Ut({$os:t,$os_version:n,$browser:gr.browser(gt,navigator.vendor,mt.opera),$device:gr.device(gt),$device_type:gr.deviceType(gt)}),{$current_url:null==pt?void 0:pt.location.href,$host:null==pt?void 0:pt.location.host,$pathname:null==pt?void 0:pt.location.pathname,$raw_user_agent:gt.length>1e3?gt.substring(0,997)+"...":gt,$browser_version:gr.browserVersion(gt,navigator.vendor,mt.opera),$browser_language:gr.browserLanguage(),$screen_height:null==pt?void 0:pt.screen.height,$screen_width:null==pt?void 0:pt.screen.width,$viewport_height:null==pt?void 0:pt.innerHeight,$viewport_width:null==pt?void 0:pt.innerWidth,$lib:"web",$lib_version:_t.LIB_VERSION,$insert_id:Math.random().toString(36).substring(2,10)+Math.random().toString(36).substring(2,10),$time:Ht()/1e3})},people_properties:function(){if(!gt)return{};var e=gr.os(gt),t=e.os_name,n=e.os_version;return qt(Ut({$os:t,$os_version:n,$browser:gr.browser(gt,navigator.vendor,mt.opera)}),{$browser_version:gr.browserVersion(gt,navigator.vendor,mt.opera)})}},mr=["cookie","localstorage","localstorage+cookie","sessionstorage","memory"],_r=function(){function e(t){u(this,e);var n="";t.token&&(n=t.token.replace(/\+/g,"PL").replace(/\//g,"SL").replace(/=/g,"EQ")),this.props={},this.campaign_params_saved=!1,this.custom_campaign_params=t.custom_campaign_params||[],t.persistence_name?this.name="ph_"+t.persistence_name:this.name="ph_"+n+"_posthog",-1===mr.indexOf(t.persistence.toLowerCase())&&(Nt.critical("Unknown persistence type "+t.persistence+"; falling back to localStorage+cookie"),t.persistence="localStorage+cookie");var r=t.persistence.toLowerCase();"localstorage"===r&&ir.is_supported()?this.storage=ir:"localstorage+cookie"===r&&ar.is_supported()?this.storage=ar:"sessionstorage"===r&&cr.is_supported()?this.storage=cr:"memory"===r?this.storage=ur:"cookie"===r?this.storage=nr:ar.is_supported()?this.storage=ar:this.storage=nr,this.user_state="anonymous",this.load(),this.update_config(t),this.save()}return c(e,[{key:"properties",value:function(){var e={};return $t(this.props,(function(t,n){if(n===xn&&xt(t))for(var r=Object.keys(t),i=0;i<r.length;i++)e["$feature/".concat(r[i])]=t[r[i]];else a=n,s=!1,(Rt(o=Ln)?s:ft&&o.indexOf===ft?-1!=o.indexOf(a):($t(o,(function(e){if(s||(s=e===a))return Lt})),s))||(e[n]=t);var o,a,s})),e}},{key:"load",value:function(){if(!this.disabled){var e=this.storage.parse(this.name);e&&(this.props=qt({},e))}}},{key:"save",value:function(){this.disabled||this.storage.set(this.name,this.props,this.expire_days,this.cross_subdomain,this.secure)}},{key:"remove",value:function(){this.storage.remove(this.name,!1),this.storage.remove(this.name,!0)}},{key:"clear",value:function(){this.remove(),this.props={}}},{key:"register_once",value:function(e,t,n){var r=this;if(xt(e)){Et(t)&&(t="None"),this.expire_days=Et(n)?this.default_expiry:n;var i=!1;if($t(e,(function(e,n){r.props.hasOwnProperty(n)&&r.props[n]!==t||(r.props[n]=e,i=!0)})),i)return this.save(),!0}return!1}},{key:"register",value:function(e,t){var n=this;if(xt(e)){this.expire_days=Et(t)?this.default_expiry:t;var r=!1;if($t(e,(function(t,i){e.hasOwnProperty(i)&&n.props[i]!==t&&(n.props[i]=t,r=!0)})),r)return this.save(),!0}return!1}},{key:"unregister",value:function(e){e in this.props&&(delete this.props[e],this.save())}},{key:"update_campaign_params",value:function(){this.campaign_params_saved||(this.register(gr.campaignParams(this.custom_campaign_params)),this.campaign_params_saved=!0)}},{key:"update_search_keyword",value:function(){this.register(gr.searchInfo())}},{key:"update_referrer_info",value:function(){this.register({$referrer:this.props.$referrer||gr.referrer(),$referring_domain:this.props.$referring_domain||gr.referringDomain()})}},{key:"get_referrer_info",value:function(){return Ut({$referrer:this.props.$referrer,$referring_domain:this.props.$referring_domain})}},{key:"safe_merge",value:function(e){return $t(this.props,(function(t,n){n in e||(e[n]=t)})),e}},{key:"update_config",value:function(e){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)}},{key:"set_disabled",value:function(e){this.disabled=e,this.disabled?this.remove():this.save()}},{key:"set_cross_subdomain",value:function(e){e!==this.cross_subdomain&&(this.cross_subdomain=e,this.remove(),this.save())}},{key:"get_cross_subdomain",value:function(){return!!this.cross_subdomain}},{key:"set_secure",value:function(e){e!==this.secure&&(this.secure=e,this.remove(),this.save())}},{key:"set_event_timer",value:function(e,t){var n=this.props[_n]||{};n[e]=t,this.props[_n]=n,this.save()}},{key:"remove_event_timer",value:function(e){var t=(this.props[_n]||{})[e];return Et(t)||(delete this.props[_n][e],this.save()),t}},{key:"get_user_state",value:function(){return this.props[Tn]||"anonymous"}},{key:"set_user_state",value:function(e){this.props[Tn]=e,this.save()}},{key:"get_quota_limits",value:function(){return this.props[Pn]||{}}},{key:"set_quota_limits",value:function(e){this.props[Pn]=e,this.save()}}]),e}(),yr=2,br=4,kr=3,wr=6,Sr=0,Cr="rrweb/console@1";var Ir=c((function e(t){var n,r,i=this,o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};u(this,e),d(this,"bucketSize",100),d(this,"refillRate",10),d(this,"mutationBuckets",{}),d(this,"loggedTracker",{}),d(this,"refillBuckets",(function(){Object.keys(i.mutationBuckets).forEach((function(e){i.mutationBuckets[e]=i.mutationBuckets[e]+i.refillRate,i.mutationBuckets[e]>=i.bucketSize&&delete i.mutationBuckets[e]}))})),d(this,"getNodeOrRelevantParent",(function(e){var t=i.rrweb.mirror.getNode(e);if("svg"!==(null==t?void 0:t.nodeName)&&t instanceof Element){var n=t.closest("svg");if(n)return[i.rrweb.mirror.getId(n),n]}return[e,t]})),d(this,"numberOfChanges",(function(e){var t,n,r,i,o,a,s,u;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===(a=e.texts)||void 0===a?void 0:a.length)&&void 0!==o?o:0)+(null!==(s=null===(u=e.adds)||void 0===u?void 0:u.length)&&void 0!==s?s:0)})),d(this,"throttleMutations",(function(e){if(e.type!==kr||e.data.source!==Sr)return e;var t=e.data,n=i.numberOfChanges(t);t.attributes&&(t.attributes=t.attributes.filter((function(e){var t,n,r,o=_(i.getNodeOrRelevantParent(e.id),2),a=o[0],s=o[1];if(0===i.mutationBuckets[a])return!1;(i.mutationBuckets[a]=null!==(t=i.mutationBuckets[a])&&void 0!==t?t:i.bucketSize,i.mutationBuckets[a]=Math.max(i.mutationBuckets[a]-1,0),0===i.mutationBuckets[a])&&(i.loggedTracker[a]||(i.loggedTracker[a]=!0,null===(n=(r=i.options).onBlockedNode)||void 0===n||n.call(r,a,s)));return e})));var r=i.numberOfChanges(t);return 0!==r||n===r?e:void 0})),this.rrweb=t,this.options=o,this.refillRate=null!==(n=this.options.refillRate)&&void 0!==n?n:this.refillRate,this.bucketSize=null!==(r=this.options.bucketSize)&&void 0!==r?r:this.bucketSize,setInterval((function(){i.refillBuckets()}),1e3)})),xr=function(e){return 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}(xr||{}),Fr={initiatorTypes:["audio","beacon","body","css","early-hint","embed","fetch","frame","iframe","icon","image","img","input","link","navigation","object","ping","script","track","video","xmlhttprequest"],maskRequestFn:function(e){return e},recordHeaders:!1,recordBody:!1,recordInitialRequests:!1,recordPerformance:!1,performanceEntryTypeToObserve:["first-input","navigation","paint","resource"],payloadSizeLimitBytes:1e6},Er=["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"],Or=["/s/","/e/","/i/vo/e/"];function Rr(e,t,n,r){var i=null==t?void 0:t["content-length"];return i&&parseInt(i)>n?"".concat(r," body too large to record"):e}var Mr,Tr=function(e,t){var n,r,i,o=e.session_recording,s=!1!==o.recordHeaders&&t.recordHeaders,u=!1!==o.recordBody&&t.recordBody,l=!1!==o.recordPerformance&&t.recordPerformance,c=(n=o,i=Math.min(1e6,null!==(r=n.payloadSizeLimitBytes)&&void 0!==r?r:1e6),function(e){return null!=e&&e.requestBody&&(e.requestBody=Rr(e.requestBody,e.requestHeaders,i,"Request")),null!=e&&e.responseBody&&(e.responseBody=Rr(e.responseBody,e.responseHeaders,i,"Response")),e}),d=function(e){return c(function(e){var t=fr(e.name);if(!(t&&t.pathname&&Or.includes(t.pathname)))return e}((t=e,Object.keys(null!==(n=t.requestHeaders)&&void 0!==n?n:{}).forEach((function(e){var n;Er.includes(e.toLowerCase())&&(null===(n=t.requestHeaders)||void 0===n||delete n[e])})),t)));var t,n},f=It(e.session_recording.maskNetworkRequestFn);return f&&It(e.session_recording.maskCapturedNetworkRequestFn)&&Nt.warn("Both `maskNetworkRequestFn` and `maskCapturedNetworkRequestFn` are defined. `maskNetworkRequestFn` will be ignored."),f&&(e.session_recording.maskCapturedNetworkRequestFn=function(t){var n=e.session_recording.maskNetworkRequestFn({url:t.name});return a(a({},t),{},{name:null==n?void 0:n.url})}),o.maskRequestFn=It(e.session_recording.maskCapturedNetworkRequestFn)?function(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}:void 0,o.maskRequestFn||(o.maskRequestFn=d),a(a(a({},Fr),o),{},{recordHeaders:s,recordBody:u,recordPerformance:l,recordInitialRequests:l})},Pr="/s/",Nr=3e5;!function(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"}(Mr||(Mr={}));var Lr=[Mr.MouseMove,Mr.MouseInteraction,Mr.Scroll,Mr.ViewportResize,Mr.Input,Mr.TouchMove,Mr.MediaInteraction,Mr.Drag],Dr=function(){function e(t){var n=this;if(u(this,e),d(this,"isIdle",!1),d(this,"_linkedFlagSeen",!1),d(this,"_lastActivityTimestamp",Date.now()),d(this,"windowId",null),d(this,"sessionId",null),d(this,"_linkedFlag",null),d(this,"_sampleRate",null),d(this,"_minimumDuration",null),d(this,"_forceAllowLocalhostNetworkCapture",!1),this.instance=t,this._captureStarted=!1,this._endpoint=Pr,this.stopRrweb=void 0,this.receivedDecide=!1,null==pt||pt.addEventListener("beforeunload",(function(){n._flushBuffer()})),!this.instance.sessionManager)throw Nt.error("Session recording started without valid sessionManager"),new Error("Session recording started without valid sessionManager. This is a bug.");this.buffer=this.clearBuffer()}return c(e,[{key:"started",get:function(){return this._captureStarted}},{key:"sessionManager",get:function(){if(!this.instance.sessionManager)throw Nt.error("Session recording started without valid sessionManager"),new Error("Session recording started without valid sessionManager. This is a bug.");return this.instance.sessionManager}},{key:"isSampled",get:function(){return Mt(this._sampleRate)?this.instance.get_property(In):null}},{key:"sessionDuration",get:function(){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],r=this.sessionManager.checkAndGetSessionAndWindowId(!0).sessionStartTimestamp;return n?n.timestamp-r:null}},{key:"isRecordingEnabled",get:function(){var e=!!this.instance.get_property(bn),t=!this.instance.config.disable_session_recording;return pt&&e&&t}},{key:"isConsoleLogCaptureEnabled",get:function(){var e=!!this.instance.get_property(kn),t=this.instance.config.enable_recording_console_log;return null!=t?t:e}},{key:"recordingVersion",get:function(){var e,t=this.instance.get_property(wn);return(null===(e=this.instance.config.session_recording)||void 0===e?void 0:e.recorderVersion)||t||"v1"}},{key:"networkPayloadCapture",get:function(){var e,t,n=this.instance.get_property(Sn),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),a=this.instance.config.capture_performance||(null==n?void 0:n.capturePerformance);return i||o||a?{recordHeaders:i,recordBody:o,recordPerformance:a}:void 0}},{key:"status",get:function(){return this.receivedDecide?this.isRecordingEnabled?Ot(this._linkedFlag)&&!this._linkedFlagSeen?"buffering":Tt(this.isSampled)?this.isSampled?"sampled":"disabled":"active":"disabled":"buffering"}},{key:"startRecordingIfEnabled",value:function(){this.isRecordingEnabled?this.startCaptureAndTrySendingQueuedSnapshots():(this.stopRecording(),this.clearBuffer())}},{key:"stopRecording",value:function(){this._captureStarted&&this.stopRrweb&&(this.stopRrweb(),this.stopRrweb=void 0,this._captureStarted=!1)}},{key:"makeSamplingDecision",value:function(e){var t,n=this.sessionId!==e;if(Mt(this._sampleRate)){var r,i=this.isSampled;if(n||!Tt(i))r=Math.random()<this._sampleRate;else r=i;r||Nt.warn("[SessionSampling] Sample rate (".concat(this._sampleRate,") has determined that this sessionId (").concat(e,") will not be sent to the server.")),null===(t=this.instance.persistence)||void 0===t||t.register(d({},In,r))}else{var o;null===(o=this.instance.persistence)||void 0===o||o.register(d({},In,null))}}},{key:"afterDecideResponse",value:function(e){var t,n,r,i,o,s,u,l,c=this;this.instance.persistence&&this.instance.persistence.register((d(l={},bn,!!e.sessionRecording),d(l,kn,null===(o=e.sessionRecording)||void 0===o?void 0:o.consoleLogRecordingEnabled),d(l,wn,null===(s=e.sessionRecording)||void 0===s?void 0:s.recorderVersion),d(l,Sn,a({capturePerformance:e.capturePerformance},null===(u=e.sessionRecording)||void 0===u?void 0:u.networkPayloadCapture)),l));var f=null===(t=e.sessionRecording)||void 0===t?void 0:t.sampleRate;this._sampleRate=Et(f)||Rt(f)?null:parseFloat(f);var p,h=null===(n=e.sessionRecording)||void 0===n?void 0:n.minimumDurationMilliseconds;(this._minimumDuration=Et(h)?null:h,this._linkedFlag=(null===(r=e.sessionRecording)||void 0===r?void 0:r.linkedFlag)||null,null!==(i=e.sessionRecording)&&void 0!==i&&i.endpoint)&&(this._endpoint=null===(p=e.sessionRecording)||void 0===p?void 0:p.endpoint);if(Mt(this._sampleRate)&&this.sessionManager.onSessionId((function(e){c.makeSamplingDecision(e)})),Ot(this._linkedFlag)){var v=this._linkedFlag;this.instance.onFeatureFlags((function(e){c._linkedFlagSeen=e.includes(v)}))}this.receivedDecide=!0,this.startRecordingIfEnabled()}},{key:"log",value:function(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:Ht()})}},{key:"startCaptureAndTrySendingQueuedSnapshots",value:function(){this._startCapture()}},{key:"_startCapture",value:function(){var e=this;if(!Et(Object.assign)&&!this._captureStarted&&!this.instance.config.disable_session_recording){this._captureStarted=!0,this.sessionManager.checkAndGetSessionAndWindowId();var t="v2"===this.recordingVersion?"recorder-v2.js":"recorder.js";this.instance.__loaded_recorder_version!==this.recordingVersion?Xt(this.instance.config.api_host+"/static/".concat(t,"?v=").concat(_t.LIB_VERSION),(function(n){if(n)return Nt.error("Could not load ".concat(t),n);e._onScriptLoaded()})):this._onScriptLoaded()}}},{key:"_isInteractiveEvent",value:function(e){var t;return e.type===kr&&-1!==Lr.indexOf(null===(t=e.data)||void 0===t?void 0:t.source)}},{key:"_updateWindowAndSessionIds",value:function(e){var t=this._isInteractiveEvent(e);if(t||this.isIdle||e.timestamp-this._lastActivityTimestamp>Nr&&(this.isIdle=!0,this._tryAddCustomEvent("sessionIdle",{reason:"user inactivity",timeSinceLastActive:e.timestamp-this._lastActivityTimestamp,threshold:Nr})),t&&(this._lastActivityTimestamp=e.timestamp,this.isIdle&&(this.isIdle=!1,this._tryAddCustomEvent("sessionNoLongerIdle",{reason:"user activity",type:e.type}),this._tryTakeFullSnapshot())),!this.isIdle){var n=this.sessionManager.checkAndGetSessionAndWindowId(!t,e.timestamp),r=n.windowId,i=n.sessionId,o=this.sessionId!==i,a=this.windowId!==r;-1===[yr,br].indexOf(e.type)&&(a||o)&&this._tryTakeFullSnapshot(),this.windowId=r,this.sessionId=i}}},{key:"_tryRRwebMethod",value:function(e){if(!this._captureStarted)return!1;try{return e(),!0}catch(e){return Nt.error("[Session-Recording] using rrweb when not started.",e),!1}}},{key:"_tryAddCustomEvent",value:function(e,t){var n=this;return this._tryRRwebMethod((function(){var r;return null===(r=n.rrwebRecord)||void 0===r?void 0:r.addCustomEvent(e,t)}))}},{key:"_tryTakeFullSnapshot",value:function(){var e=this;return this._tryRRwebMethod((function(){var t;return null===(t=e.rrwebRecord)||void 0===t?void 0:t.takeFullSnapshot()}))}},{key:"_onScriptLoaded",value:function(){var e,t=this,n={blockClass:"ph-no-capture",blockSelector:void 0,ignoreClass:"ph-ignore-input",maskTextClass:"ph-mask",maskTextSelector:void 0,maskTextFn:void 0,maskAllInputs:!0,maskInputOptions:{},maskInputFn:void 0,slimDOMOptions:{},collectFonts:!1,inlineStylesheet:!0,recordCrossOriginIframes:!1};this.rrwebRecord=pt.rrweb?pt.rrweb.record:pt.rrwebRecord;for(var r=this.instance.config.session_recording,i=0,o=Object.entries(r||{});i<o.length;i++){var s=_(o[i],2),u=s[0],l=s[1];u in n&&(n[u]=l)}this.rrwebRecord?(this.mutationRateLimiter=null!==(e=this.mutationRateLimiter)&&void 0!==e?e:new Ir(this.rrwebRecord,{onBlockedNode:function(e,n){var r="Too many mutations on node '".concat(e,"'. Rate limiting. This could be due to SVG animations or something similar");Nt.info(r,{node:n}),t.log("[PostHog Recorder] "+r,"warn")}}),this.stopRrweb=this.rrwebRecord(a({emit:function(e){t.onRRwebEmit(e)},plugins:this._gatherRRWebPlugins()},n)),this.instance._addCaptureHook((function(e){try{if("$pageview"===e){var n=pt?t._maskUrl(pt.location.href):"";if(!n)return;t._tryAddCustomEvent("$pageview",{href:n})}}catch(e){Nt.error("Could not add $pageview to rrweb session",e)}})),this._lastActivityTimestamp=Date.now(),this.isIdle=!1):Nt.error("onScriptLoaded was called but rrwebRecord is not available. This indicates something has gone wrong.")}},{key:"_gatherRRWebPlugins",value:function(){var e=[];(mt.rrwebConsoleRecord&&this.isConsoleLogCaptureEnabled&&e.push(mt.rrwebConsoleRecord.getRecordConsolePlugin()),this.networkPayloadCapture&&It(mt.getRecordNetworkPlugin))&&(!dr.includes(location.hostname)||this._forceAllowLocalhostNetworkCapture?e.push(mt.getRecordNetworkPlugin(Tr(this.instance.config,this.networkPayloadCapture))):Nt.info("[SessionReplay-NetworkCapture] not started because we are on localhost."));return e}},{key:"onRRwebEmit",value:function(e){if(e&&xt(e)){if(e.type===xr.Meta){var t=this._maskUrl(e.data.href);if(!t)return;e.data.href=t}var n=this.mutationRateLimiter?this.mutationRateLimiter.throttleMutations(e):e;if(n){var r=function(e){var t=e;if(t&&xt(t)&&t.type===wr&&xt(t.data)&&t.data.plugin===Cr){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}(n),i=JSON.stringify(r).length;if(this._updateWindowAndSessionIds(r),!this.isIdle){var o={$snapshot_bytes:i,$snapshot_data:r,$session_id:this.sessionId,$window_id:this.windowId};"disabled"!==this.status?this._captureSnapshotBuffered(o):this.clearBuffer()}}}}},{key:"_maskUrl",value:function(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}},{key:"clearBuffer",value:function(){return this.buffer=void 0,{size:0,data:[],sessionId:this.sessionId,windowId:this.windowId}}},{key:"_flushBuffer",value:function(){var e=this;this.flushBufferTimer&&(clearTimeout(this.flushBufferTimer),this.flushBufferTimer=void 0);var t=this._minimumDuration,n=this.sessionDuration,r=Mt(n)&&n>=0,i=Mt(t)&&r&&n<t;return"buffering"===this.status||i?(this.flushBufferTimer=setTimeout((function(){e._flushBuffer()}),2e3),this.buffer||this.clearBuffer()):this.buffer&&0!==this.buffer.data.length?(this._captureSnapshot({$snapshot_bytes:this.buffer.size,$snapshot_data:this.buffer.data,$session_id:this.buffer.sessionId,$window_id:this.buffer.windowId}),this.clearBuffer()):this.buffer||this.clearBuffer()}},{key:"_captureSnapshotBuffered",value:function(e){var t,n=this,r=2+((null===(t=this.buffer)||void 0===t?void 0:t.data.length)||0);(!this.buffer||this.buffer.size+e.$snapshot_bytes+r>943718.4||this.buffer.sessionId&&this.buffer.sessionId!==this.sessionId)&&(this.buffer=this._flushBuffer()),Rt(this.buffer.sessionId)&&!Rt(this.sessionId)&&(this.buffer.sessionId=this.sessionId,this.buffer.windowId=this.windowId),this.buffer.size+=e.$snapshot_bytes,this.buffer.data.push(e.$snapshot_data),this.flushBufferTimer||(this.flushBufferTimer=setTimeout((function(){n._flushBuffer()}),2e3))}},{key:"_captureSnapshot",value:function(e){this.instance.capture("$snapshot",e,{transport:"XHR",method:"POST",endpoint:this._endpoint,_noTruncate:!0,_batchKey:"recordings",_metrics:{rrweb_full_snapshot:e.$snapshot_data.type===yr}})}}]),e}(),Ar=function(){function e(t){u(this,e),this.instance=t,this.instance.decideEndpointWasHit=this.instance._hasBootstrappedFeatureFlags()}return c(e,[{key:"call",value:function(){var e=this,t=Yt(JSON.stringify({token:this.instance.config.token,distinct_id:this.instance.get_distinct_id(),groups:this.instance.getGroups(),person_properties:this.instance.get_property(En),group_properties:this.instance.get_property(On),disable_flags:this.instance.config.advanced_disable_feature_flags||this.instance.config.advanced_disable_feature_flags_on_first_load||void 0}));this.instance._send_request("".concat(this.instance.config.api_host,"/decide/?v=3"),{data:t,verbose:!0},{method:"POST"},(function(t){return e.parseDecideResponse(t)}))}},{key:"parseDecideResponse",value:function(e){var t,n=this;if(this.instance.featureFlags.setReloadingPaused(!1),this.instance.featureFlags._startReloadTimer(),0!==(null==e?void 0:e.status)){if(!vt||!vt.body)return Nt.info("document not ready yet, trying again in 500 milliseconds..."),void setTimeout((function(){n.parseDecideResponse(e)}),500);this.instance.toolbar.afterDecideResponse(e),null===(t=this.instance.sessionRecording)||void 0===t||t.afterDecideResponse(e),An.afterDecideResponse(e,this.instance),this.instance._afterDecideResponse(e),this.instance.config.advanced_disable_feature_flags_on_first_load||this.instance.config.advanced_disable_feature_flags||this.instance.featureFlags.receivedFeatureFlags(e);var r=null==pt?void 0:pt.extendPostHogWithSurveys;e.surveys&&!r&&Xt(this.instance.config.api_host+"/static/surveys.js",(function(e){if(e)return Nt.error("Could not load surveys script",e);pt.extendPostHogWithSurveys(n.instance)}));var i=null==pt?void 0:pt.extendPostHogWithExceptionAutoCapture;if(e.autocaptureExceptions&&e.autocaptureExceptions&&Et(i)&&Xt(this.instance.config.api_host+"/static/exception-autocapture.js",(function(t){if(t)return Nt.error("Could not load exception autocapture script",t);pt.extendPostHogWithExceptionAutocapture(n.instance,e)})),e.siteApps)if(this.instance.config.opt_in_site_apps){var o,a=this.instance.config.api_host,s=w(e.siteApps);try{var u=function(){var e=o.value,t=e.id,r=e.url,i=[a,"/"===a[a.length-1]&&"/"===r[0]?r.substring(1):r].join("");mt["__$$ph_site_app_".concat(t)]=n.instance,Xt(i,(function(e){e&&Nt.error("Error while initializing PostHog app with config id ".concat(t),e)}))};for(s.s();!(o=s.n()).done;)u()}catch(e){s.e(e)}finally{s.f()}}else e.siteApps.length>0&&Nt.error('PostHog site apps are disabled. Enable the "opt_in_site_apps" config to proceed.')}else Nt.error("Failed to fetch feature flags from PostHog.")}}]),e}(),$r=["https://app.posthog.com","https://eu.posthog.com"],qr=["source"],Br=null!=pt&&pt.location?vr(pt.location.hash,"__posthog")||vr(location.hash,"state"):null,jr=function(){function e(t){u(this,e),this.instance=t}return c(e,[{key:"afterDecideResponse",value:function(e){var t=e.toolbarParams||e.editorParams||(e.toolbarVersion?{toolbarVersion:e.toolbarVersion}:{});e.isAuthenticated&&t.toolbarVersion&&0===t.toolbarVersion.indexOf("toolbar")&&this.loadToolbar(a({},t))}},{key:"maybeLoadToolbar",value:function(){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(!pt||!vt)return!1;n=null!==(e=n)&&void 0!==e?e:pt.location,i=null!==(t=i)&&void 0!==t?t:pt.history;try{if(!r){try{pt.localStorage.setItem("test","test"),pt.localStorage.removeItem("test")}catch(e){return!1}r=null==pt?void 0:pt.localStorage}var o,a=Br||vr(n.hash,"__posthog")||vr(n.hash,"state"),s=a?Wt((function(){return JSON.parse(atob(decodeURIComponent(a)))}))||Wt((function(){return JSON.parse(decodeURIComponent(a))})):null;return s&&"ph_authorize"===s.action?((o=s).source="url",o&&Object.keys(o).length>0&&(s.desiredHash?n.hash=s.desiredHash:i?i.replaceState("",vt.title,n.pathname+n.search):n.hash="")):((o=JSON.parse(r.getItem("_postHogToolbarParams")||"{}")).source="localstorage",delete o.userIntent),!(!o.token||this.instance.config.token!==o.token)&&(this.loadToolbar(o),!0)}catch(e){return!1}}},{key:"loadToolbar",value:function(e){var t=this;if(!pt||mt._postHogToolbarLoaded)return!1;mt._postHogToolbarLoaded=!0;var n=this.instance.config.api_host,r=3e5,i=Math.floor(Date.now()/r)*r,o="".concat(n).concat(n.endsWith("/")?"":"/","static/toolbar.js?t=").concat(i),s=!$r.includes(this.instance.config.api_host)&&this.instance.config.advanced_disable_toolbar_metrics,u=a(a({token:this.instance.config.token},e),{},{apiURL:n},s?{instrument:!1}:{});u.source;var l=v(u,qr);return pt.localStorage.setItem("_postHogToolbarParams",JSON.stringify(l)),Xt(o,(function(e){e?Nt.error("Failed to load toolbar",e):(mt.ph_load_toolbar||mt.ph_load_editor)(u,t.instance)})),Qt(pt,"turbolinks:load",(function(){mt._postHogToolbarLoaded=!1,t.loadToolbar(u)})),!0}},{key:"_loadEditor",value:function(e){return this.loadToolbar(e)}},{key:"maybeLoadEditor",value:function(){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)}}]),e}(),Hr="__ph_opt_in_out_";function Wr(e,t){Xr(!0,e,t)}function Vr(e,t){Xr(!1,e,t)}function Ur(e,t){return"1"===Qr(e,t)}function zr(e,t){return!!function(e){if(e&&e.respectDnt){var t=e&&e.window||pt,n=null==t?void 0:t.navigator,r=!1;return $t([null==n?void 0:n.doNotTrack,n.msDoNotTrack,t.doNotTrack],(function(e){Bt([!0,1,"1","yes"],e)&&(r=!0)})),r}return!1}(t)||"0"===Qr(e,t)}function Gr(e,t){Yr(t=t||{}).remove(Jr(e,t),!!t.crossSubdomainCookie)}function Yr(e){return"localStorage"===(e=e||{}).persistenceType?ir:"localStorage+cookie"===e.persistenceType?ar:nr}function Jr(e,t){return((t=t||{}).persistencePrefix||Hr)+e}function Qr(e,t){return Yr(t).get(Jr(e,t))}function Xr(e,t,n){Ot(t)&&t.length?(Yr(n=n||{}).set(Jr(t,n),e?1:0,Mt(n.cookieExpiration)?n.cookieExpiration:null,n.crossSubdomainCookie,n.secureCookie),n.capture&&e&&n.capture(n.captureEventName||"$opt_in",n.captureProperties||{},{send_instantly:!0})):Nt.error("gdpr."+(e?"optIn":"optOut")+" called with an invalid token")}var Kr=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:3e3;u(this,e),this.isPolling=!0,this._event_queue=[],this._empty_queue_count=0,this._poller=void 0,this._pollInterval=t}return c(e,[{key:"setPollInterval",value:function(e){this._pollInterval=e,this.isPolling&&this.poll()}},{key:"poll",value:function(){}},{key:"unload",value:function(){}},{key:"getTime",value:function(){return(new Date).getTime()}}]),e}(),Zr=function(e){f(n,e);var t=m(n);function n(e){var r,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:3e3;return u(this,n),(r=t.call(this,i)).handlePollRequest=e,r}return c(n,[{key:"enqueue",value:function(e,t,n){this._event_queue.push({url:e,data:t,options:n}),this.isPolling||(this.isPolling=!0,this.poll())}},{key:"poll",value:function(){var e=this;clearTimeout(this._poller),this._poller=setTimeout((function(){if(e._event_queue.length>0){var t=e.formatQueue(),n=function(n){var r=t[n],i=r.url,o=r.data,a=r.options;$t(o,(function(t,n){o[n].offset=Math.abs(o[n].timestamp-e.getTime()),delete o[n].timestamp})),e.handlePollRequest(i,o,a)};for(var r in t)n(r);e._event_queue.length=0,e._empty_queue_count=0}else e._empty_queue_count++;e._empty_queue_count>4&&(e.isPolling=!1,e._empty_queue_count=0),e.isPolling&&e.poll()}),this._pollInterval)}},{key:"unload",value:function(){var e=this;clearTimeout(this._poller);var t=this._event_queue.length>0?this.formatQueue():{};this._event_queue.length=0;var n=Object.values(t);[].concat(y(n.filter((function(e){return 0===e.url.indexOf("/e")}))),y(n.filter((function(e){return 0!==e.url.indexOf("/e")})))).map((function(t){var n=t.url,r=t.data,i=t.options;e.handlePollRequest(n,r,a(a({},i),{},{transport:"sendBeacon"}))}))}},{key:"formatQueue",value:function(){var e={};return $t(this._event_queue,(function(t){var n=t.url,r=t.data,i=t.options,o=(i?i._batchKey:null)||n;Et(e[o])&&(e[o]={data:[],url:n,options:i}),i&&e[o].options&&e[o].options._metrics&&!e[o].options._metrics.rrweb_full_snapshot&&(e[o].options._metrics.rrweb_full_snapshot=i._metrics.rrweb_full_snapshot),e[o].data.push(r)})),e}}]),n}(Kr),ei=Uint8Array,ti=Uint16Array,ni=Uint32Array,ri=new ei([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]),ii=new ei([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]),oi=new ei([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),ai=function(e,t){for(var n=new ti(31),r=0;r<31;++r)n[r]=t+=1<<e[r-1];var i=new ni(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]},si=ai(ri,2),ui=si[0],li=si[1];ui[28]=258,li[258]=28;for(var ci=ai(ii,0)[1],di=new ti(32768),fi=0;fi<32768;++fi){var pi=(43690&fi)>>>1|(21845&fi)<<1;pi=(61680&(pi=(52428&pi)>>>2|(13107&pi)<<2))>>>4|(3855&pi)<<4,di[fi]=((65280&pi)>>>8|(255&pi)<<8)>>>1}var hi=function(e,t,n){for(var r=e.length,i=0,o=new ti(t);i<r;++i)++o[e[i]-1];var a,s=new ti(t);for(i=0;i<t;++i)s[i]=s[i-1]+o[i-1]<<1;if(n){a=new ti(1<<t);var u=15-t;for(i=0;i<r;++i)if(e[i])for(var l=i<<4|e[i],c=t-e[i],d=s[e[i]-1]++<<c,f=d|(1<<c)-1;d<=f;++d)a[di[d]>>>u]=l}else for(a=new ti(r),i=0;i<r;++i)a[i]=di[s[e[i]-1]++]>>>15-e[i];return a},vi=new ei(288);for(fi=0;fi<144;++fi)vi[fi]=8;for(fi=144;fi<256;++fi)vi[fi]=9;for(fi=256;fi<280;++fi)vi[fi]=7;for(fi=280;fi<288;++fi)vi[fi]=8;var gi=new ei(32);for(fi=0;fi<32;++fi)gi[fi]=5;var mi,_i=hi(vi,9,0),yi=hi(gi,5,0),bi=function(e){return(e/8>>0)+(7&e&&1)},ki=function(e,t,n){(null==t||t<0)&&(t=0),(null==n||n>e.length)&&(n=e.length);var r=new(e instanceof ti?ti:e instanceof ni?ni:ei)(n-t);return r.set(e.subarray(t,n)),r},wi=function(e,t,n){n<<=7&t;var r=t/8>>0;e[r]|=n,e[r+1]|=n>>>8},Si=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},Ci=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 ei(0),0];if(1==i){var a=new ei(n[0].s+1);return a[n[0].s]=1,[a,1]}n.sort((function(e,t){return e.f-t.f})),n.push({s:-1,f:25001});var s=n[0],u=n[1],l=0,c=1,d=2;for(n[0]={s:-1,f:s.f+u.f,l:s,r:u};c!=i-1;)s=n[n[l].f<n[d].f?l++:d++],u=n[l!=c&&n[l].f<n[d].f?l++:d++],n[c++]={s:-1,f:s.f+u.f,l:s,r:u};var f=o[0].s;for(r=1;r<i;++r)o[r].s>f&&(f=o[r].s);var p=new ti(f+1),h=Ii(n[c-1],p,0);if(h>t){r=0;var v=0,g=h-t,m=1<<g;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;v+=m-(1<<h-p[_]),p[_]=t}for(v>>>=g;v>0;){var y=o[r].s;p[y]<t?v-=1<<t-p[y]++-1:++r}for(;r>=0&&v;--r){var b=o[r].s;p[b]==t&&(--p[b],++v)}h=t}return[new ei(p),h]},Ii=function e(t,n,r){return-1==t.s?Math.max(e(t.l,n,r+1),e(t.r,n,r+1)):n[t.s]=r},xi=function(e){for(var t=e.length;t&&!e[--t];);for(var n=new ti(++t),r=0,i=e[0],o=1,a=function(e){n[r++]=e},s=1;s<=t;++s)if(e[s]==i&&s!=t)++o;else{if(!i&&o>2){for(;o>138;o-=138)a(32754);o>2&&(a(o>10?o-11<<5|28690:o-3<<5|12305),o=0)}else if(o>3){for(a(i),--o;o>6;o-=6)a(8304);o>2&&(a(o-3<<5|8208),o=0)}for(;o--;)a(i);o=1,i=e[s]}return[n.subarray(0,r),t]},Fi=function(e,t){for(var n=0,r=0;r<t.length;++r)n+=e[r]*t[r];return n},Ei=function(e,t,n){var r=n.length,i=bi(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)},Oi=function(e,t,n,r,i,o,a,s,u,l,c){wi(t,c++,n),++i[256];for(var d=Ci(i,15),f=d[0],p=d[1],h=Ci(o,15),v=h[0],g=h[1],m=xi(f),_=m[0],y=m[1],b=xi(v),k=b[0],w=b[1],S=new ti(19),C=0;C<_.length;++C)S[31&_[C]]++;for(C=0;C<k.length;++C)S[31&k[C]]++;for(var I=Ci(S,7),x=I[0],F=I[1],E=19;E>4&&!x[oi[E-1]];--E);var O,R,M,T,P=l+5<<3,N=Fi(i,vi)+Fi(o,gi)+a,L=Fi(i,f)+Fi(o,v)+a+14+3*E+Fi(S,x)+(2*S[16]+3*S[17]+7*S[18]);if(P<=N&&P<=L)return Ei(t,c,e.subarray(u,u+l));if(wi(t,c,1+(L<N)),c+=2,L<N){O=hi(f,p,0),R=f,M=hi(v,g,0),T=v;var D=hi(x,F,0);wi(t,c,y-257),wi(t,c+5,w-1),wi(t,c+10,E-4),c+=14;for(C=0;C<E;++C)wi(t,c+3*C,x[oi[C]]);c+=3*E;for(var A=[_,k],$=0;$<2;++$){var q=A[$];for(C=0;C<q.length;++C){var B=31&q[C];wi(t,c,D[B]),c+=x[B],B>15&&(wi(t,c,q[C]>>>5&127),c+=q[C]>>>12)}}}else O=_i,R=vi,M=yi,T=gi;for(C=0;C<s;++C)if(r[C]>255){B=r[C]>>>18&31;Si(t,c,O[B+257]),c+=R[B+257],B>7&&(wi(t,c,r[C]>>>23&31),c+=ri[B]);var j=31&r[C];Si(t,c,M[j]),c+=T[j],j>3&&(Si(t,c,r[C]>>>5&8191),c+=ii[j])}else Si(t,c,O[r[C]]),c+=R[r[C]];return Si(t,c,O[256]),c+R[256]},Ri=new ni([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),Mi=new ei(0),Ti=function(){for(var e=new ni(256),t=0;t<256;++t){for(var n=t,r=9;--r;)n=(1&n&&3988292384)^n>>>1;e[t]=n}return e}(),Pi=function(){var e=4294967295;return{p:function(t){for(var n=e,r=0;r<t.length;++r)n=Ti[255&n^t[r]]^n>>>8;e=n},d:function(){return 4294967295^e}}},Ni=function(e,t,n,r,i){return function(e,t,n,r,i,o){var a=e.length,s=new ei(r+a+5*(1+Math.floor(a/7e3))+i),u=s.subarray(r,s.length-i),l=0;if(!t||a<8)for(var c=0;c<=a;c+=65535){var d=c+65535;d<a?l=Ei(u,l,e.subarray(c,d)):(u[c]=o,l=Ei(u,l,e.subarray(c,a)))}else{for(var f=Ri[t-1],p=f>>>13,h=8191&f,v=(1<<n)-1,g=new ti(32768),m=new ti(v+1),_=Math.ceil(n/3),y=2*_,b=function(t){return(e[t]^e[t+1]<<_^e[t+2]<<y)&v},k=new ni(25e3),w=new ti(288),S=new ti(32),C=0,I=0,x=(c=0,0),F=0,E=0;c<a;++c){var O=b(c),R=32767&c,M=m[O];if(g[R]=M,m[O]=R,F<=c){var T=a-c;if((C>7e3||x>24576)&&T>423){l=Oi(e,u,0,k,w,S,I,x,E,c-E,l),x=C=I=0,E=c;for(var P=0;P<286;++P)w[P]=0;for(P=0;P<30;++P)S[P]=0}var N=2,L=0,D=h,A=R-M&32767;if(T>2&&O==b(c-A))for(var $=Math.min(p,T)-1,q=Math.min(32767,c),B=Math.min(258,T);A<=q&&--D&&R!=M;){if(e[c+N]==e[c+N-A]){for(var j=0;j<B&&e[c+j]==e[c+j-A];++j);if(j>N){if(N=j,L=A,j>$)break;var H=Math.min(A,j-2),W=0;for(P=0;P<H;++P){var V=c-A+P+32768&32767,U=V-g[V]+32768&32767;U>W&&(W=U,M=V)}}}A+=(R=M)-(M=g[R])+32768&32767}if(L){k[x++]=268435456|li[N]<<18|ci[L];var z=31&li[N],G=31&ci[L];I+=ri[z]+ii[G],++w[257+z],++S[G],F=c+N,++C}else k[x++]=e[c],++w[e[c]]}}l=Oi(e,u,o,k,w,S,I,x,E,c-E,l),o||(l=Ei(u,l,Mi))}return ki(s,0,r+bi(l)+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)},Li=function(e,t,n){for(;n;++t)e[t]=n,n>>>=8},Di=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&&Li(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)}},Ai=function(e){return 10+(e.filename&&e.filename.length+1||0)};function $i(e,t){void 0===t&&(t={});var n=Pi(),r=e.length;n.p(e);var i=Ni(e,t,Ai(t),8),o=i.length;return Di(i,t),Li(i,o-8,n.d()),Li(i,o-4,r),i}function qi(e,t){var n=e.length;if(!t&&"undefined"!=typeof TextEncoder)return(new TextEncoder).encode(e);for(var r=new ei(e.length+(e.length>>>1)),i=0,o=function(e){r[i++]=e},a=0;a<n;++a){if(i+5>r.length){var s=new ei(i+8+(n-a<<1));s.set(r),r=s}var u=e.charCodeAt(a);u<128||t?o(u):u<2048?(o(192|u>>>6),o(128|63&u)):u>55295&&u<57344?(o(240|(u=65536+(1047552&u)|1023&e.charCodeAt(++a))>>>18),o(128|u>>>12&63),o(128|u>>>6&63),o(128|63&u)):(o(224|u>>>12),o(128|u>>>6&63),o(128|63&u))}return ki(r,0,i)}!function(e){e.GZipJS="gzip-js",e.Base64="base64"}(mi||(mi={}));var Bi=function(e,t,n){var r=t||{};r.ip=n.ip?1:0,r._=(new Date).getTime().toString(),r.ver=_t.LIB_VERSION;var i=e.split("?");if(i.length>1){var o,a=w(i[1].split("&"));try{for(a.s();!(o=a.n()).done;){var s=o.value.split("=")[0];Et(r[s])||delete r[s]}}catch(e){a.e(e)}finally{a.f()}}var u=e.indexOf("?")>-1?"&":"?";return e+u+function(e){var t,n,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"&",i=[];return $t(e,(function(e,r){Et(e)||Et(r)||"undefined"===r||(t=encodeURIComponent(e.toString()),n=encodeURIComponent(r),i[i.length]=n+"="+t)})),i.join(r)}(r)},ji=function e(t,n){if(n.blob&&t.buffer)return new Blob([Ct(t)?t:t.buffer],{type:"text/plain"});if(n.sendBeacon||n.blob){var r=e(t,{method:"POST"});return new Blob([r],{type:"application/x-www-form-urlencoded"})}return"POST"!==n.method?null:(i=St(t)||Ct(t)?"data="+encodeURIComponent(t):"data="+encodeURIComponent(t.data),"compression"in t&&t.compression&&(i+="&compression="+t.compression),i);var i},Hi=function(e){var t=e.url,n=e.data,r=e.headers,i=e.options,o=e.callback,a=e.retriesPerformedSoFar,s=e.retryQueue,u=e.onXHRError,l=e.timeout,c=void 0===l?6e4:l,d=e.onResponse;Mt(a)&&a>0&&(t=Bi(t,{retry_count:a},{}));var f=new XMLHttpRequest;f.open(i.method||"GET",t,!0);var p=ji(n,i);$t(r,(function(e,t){f.setRequestHeader(t,e)})),"POST"!==i.method||i.blob||f.setRequestHeader("Content-Type","application/x-www-form-urlencoded"),f.timeout=c,f.withCredentials=!0,f.onreadystatechange=function(){if(4===f.readyState)if(null==d||d(f),200===f.status){if(o){var e;try{e=JSON.parse(f.responseText)}catch(e){return void Nt.error(e)}o(e)}}else It(u)&&u(f),(f.status<400||f.status>500)&&s.enqueue({url:t,data:n,options:i,headers:r,retriesPerformedSoFar:(a||0)+1,callback:o}),null==o||o({status:0})},f.send(p)},Wi=18e5;var Vi=function(e){f(n,e);var t=m(n);function n(e,r){var i;return u(this,n),(i=t.call(this)).isPolling=!1,i.queue=[],i.areWeOnline=!0,i.onXHRError=e,i.rateLimiter=r,!Et(pt)&&"onLine"in pt.navigator&&(i.areWeOnline=pt.navigator.onLine,pt.addEventListener("online",(function(){i._handleWeAreNowOnline()})),pt.addEventListener("offline",(function(){i.areWeOnline=!1}))),i}return c(n,[{key:"enqueue",value:function(e){var t=e.retriesPerformedSoFar||0;if(!(t>=10)){var n=function(e){var t=3e3*Math.pow(2,e),n=t/2,r=Math.min(Wi,t),i=(Math.random()-.5)*(r-n);return Math.ceil(r+i)}(t),r=new Date(Date.now()+n);this.queue.push({retryAt:r,requestData:e});var i="Enqueued failed request for retry in ".concat(n);navigator.onLine||(i+=" (Browser is offline)"),Nt.warn(i),this.isPolling||(this.isPolling=!0,this.poll())}}},{key:"poll",value:function(){var e=this;this._poller&&clearTimeout(this._poller),this._poller=setTimeout((function(){e.areWeOnline&&e.queue.length>0&&e.flush(),e.poll()}),this._pollInterval)}},{key:"flush",value:function(){var e=new Date(Date.now()),t=this.queue.filter((function(t){return t.retryAt<e}));if(t.length>0){this.queue=this.queue.filter((function(t){return t.retryAt>=e}));var n,r=w(t);try{for(r.s();!(n=r.n()).done;){var i=n.value.requestData;this._executeXhrRequest(i)}}catch(e){r.e(e)}finally{r.f()}}}},{key:"unload",value:function(){this._poller&&(clearTimeout(this._poller),this._poller=void 0);var e,t=w(this.queue);try{for(t.s();!(e=t.n()).done;){var n=e.value.requestData,r=n.url,i=n.data,o=n.options;if(this.rateLimiter.isRateLimited(o._batchKey))Nt.warn("[RetryQueue] is quota limited. Dropping request.");else try{null==pt||pt.navigator.sendBeacon(r,ji(i,a(a({},o),{},{sendBeacon:!0})))}catch(e){Nt.error(e)}}}catch(e){t.e(e)}finally{t.f()}this.queue=[]}},{key:"_executeXhrRequest",value:function(e){var t=e.url,n=e.data,r=e.options,i=e.headers,o=e.callback,a=e.retriesPerformedSoFar;this.rateLimiter.isRateLimited(r._batchKey)||Hi({url:t,data:n||{},options:r||{},headers:i||{},retriesPerformedSoFar:a||0,callback:o,retryQueue:this,onXHRError:this.onXHRError,onResponse:this.rateLimiter.checkForLimiting})}},{key:"_handleWeAreNowOnline",value:function(){this.areWeOnline=!0,this.flush()}}]),n}(Kr),Ui=1800,zi=60,Gi=864e5,Yi=function(){function e(t,n,r,i){u(this,e),d(this,"_sessionIdChangedHandlers",[]),this.config=t,this.persistence=n,this._windowId=void 0,this._sessionId=void 0,this._sessionStartTimestamp=null,this._sessionActivityTimestamp=null,this._sessionIdGenerator=r||Jn,this._windowIdGenerator=i||Jn;var o=t.persistence_name||t.token,a=t.session_idle_timeout_seconds||Ui;if(Mt(a)?a>Ui?Nt.warn("session_idle_timeout_seconds cannot be greater than 30 minutes. Using 30 minutes instead."):a<zi&&Nt.warn("session_idle_timeout_seconds cannot be less than 60 seconds. Using 60 seconds instead."):(Nt.warn("session_idle_timeout_seconds must be a number. Defaulting to 30 minutes."),a=Ui),this._sessionTimeoutMs=1e3*Math.min(Math.max(a,zi),Ui),this._window_id_storage_key="ph_"+o+"_window_id",this._primary_window_exists_storage_key="ph_"+o+"_primary_window_exists",this._canUseSessionStorage()){var s=cr.parse(this._window_id_storage_key),l=cr.parse(this._primary_window_exists_storage_key);s&&!l?this._windowId=s:cr.remove(this._window_id_storage_key),cr.set(this._primary_window_exists_storage_key,!0)}this._listenToReloadWindow()}return c(e,[{key:"onSessionId",value:function(e){var t=this;return Et(this._sessionIdChangedHandlers)&&(this._sessionIdChangedHandlers=[]),this._sessionIdChangedHandlers.push(e),this._sessionId&&e(this._sessionId,this._windowId),function(){t._sessionIdChangedHandlers=t._sessionIdChangedHandlers.filter((function(t){return t!==e}))}}},{key:"_canUseSessionStorage",value:function(){return"memory"!==this.config.persistence&&!this.persistence.disabled&&cr.is_supported()}},{key:"_setWindowId",value:function(e){e!==this._windowId&&(this._windowId=e,this._canUseSessionStorage()&&cr.set(this._window_id_storage_key,e))}},{key:"_getWindowId",value:function(){return this._windowId?this._windowId:this._canUseSessionStorage()?cr.parse(this._window_id_storage_key):null}},{key:"_setSessionId",value:function(e,t,n){e===this._sessionId&&t===this._sessionActivityTimestamp&&n===this._sessionStartTimestamp||(this._sessionStartTimestamp=n,this._sessionActivityTimestamp=t,this._sessionId=e,this.persistence.register(d({},Cn,[t,e,n])))}},{key:"_getSessionId",value:function(){if(this._sessionId&&this._sessionActivityTimestamp&&this._sessionStartTimestamp)return[this._sessionActivityTimestamp,this._sessionId,this._sessionStartTimestamp];var e=this.persistence.props[Cn];return St(e)&&2===e.length&&e.push(e[0]),e||[0,null,0]}},{key:"resetSessionId",value:function(){this._setSessionId(null,null,null)}},{key:"_listenToReloadWindow",value:function(){var e=this;null==pt||pt.addEventListener("beforeunload",(function(){e._canUseSessionStorage()&&cr.remove(e._primary_window_exists_storage_key)}))}},{key:"checkAndGetSessionAndWindowId",value:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=(arguments.length>1&&void 0!==arguments[1]?arguments[1]:null)||(new Date).getTime(),n=_(this._getSessionId(),3),r=n[0],i=n[1],o=n[2],a=this._getWindowId(),s=o&&o>0&&Math.abs(t-o)>Gi,u=!1,l=!i,c=!e&&Math.abs(t-r)>this._sessionTimeoutMs;l||c||s?(i=this._sessionIdGenerator(),a=this._windowIdGenerator(),o=t,u=!0):a||(a=this._windowIdGenerator(),u=!0);var d=0===r||!e||s?t:r,f=0===o?(new Date).getTime():o;return this._setWindowId(a),this._setSessionId(i,d,f),u&&this._sessionIdChangedHandlers.forEach((function(e){return e(i,a)})),{sessionId:i,windowId:a,sessionStartTimestamp:f}}}]),e}(),Ji=c((function e(t,n,r,i){u(this,e),this.name="posthog-js",this.setupOnce=function(e){e((function(e){var o,a,s,u,l;if("error"!==e.level||!t.__loaded)return e;e.tags||(e.tags={});var c=t.config.ui_host||t.config.api_host;e.tags["PostHog Person URL"]=c+"/person/"+t.get_distinct_id(),t.sessionRecordingStarted()&&(e.tags["PostHog Recording URL"]=t.get_session_replay_url({withTimestamp:!0}));var d=(null===(o=e.exception)||void 0===o?void 0:o.values)||[],f={$exception_message:null===(a=d[0])||void 0===a?void 0:a.value,$exception_type:null===(s=d[0])||void 0===s?void 0:s.type,$exception_personURL:c+"/person/"+t.get_distinct_id(),$sentry_event_id:e.event_id,$sentry_exception:e.exception,$sentry_exception_message:null===(u=d[0])||void 0===u?void 0:u.value,$sentry_exception_type:null===(l=d[0])||void 0===l?void 0:l.type,$sentry_tags:e.tags};return n&&r&&(f.$sentry_url=(i||"https://sentry.io/organizations/")+n+"/issues/?project="+r+"&query="+e.event_id),t.capture("$exception",f),e}))}})),Qi=function(e){Promise&&Promise.resolve||Nt.warn("This browser does not have Promise support, and can not use the segment integration");var t=function(t,n){t.event.userId||t.event.anonymousId===e.get_distinct_id()||e.reset(),t.event.userId&&t.event.userId!==e.get_distinct_id()&&(e.register({distinct_id:t.event.userId}),e.reloadFeatureFlags());var r=e._calculate_event_properties(n,t.event.properties);return t.event.properties=Object.assign({},r,t.event.properties),t};return{name:"PostHog JS",type:"enrichment",version:"1.0.0",isLoaded:function(){return!0},load:function(){return Promise.resolve()},track:function(e){return t(e,e.event.event)},page:function(e){return t(e,"$pageview")},identify:function(e){return t(e,"$identify")},screen:function(e){return t(e,"$screen")}}},Xi=function(){function e(){var t=this;u(this,e),d(this,"_hasSeenPageView",!1),d(this,"_updateScrollData",(function(){var e,n,r,i;t._pageViewData||(t._pageViewData=t._createPageViewData());var o=t._pageViewData,a=t._scrollY(),s=t._scrollHeight(),u=t._contentY(),l=t._contentHeight();o.lastScrollY=a,o.maxScrollY=Math.max(a,null!==(e=o.maxScrollY)&&void 0!==e?e:0),o.maxScrollHeight=Math.max(s,null!==(n=o.maxScrollHeight)&&void 0!==n?n:0),o.lastContentY=u,o.maxContentY=Math.max(u,null!==(r=o.maxContentY)&&void 0!==r?r:0),o.maxContentHeight=Math.max(l,null!==(i=o.maxContentHeight)&&void 0!==i?i:0)}))}return c(e,[{key:"_createPageViewData",value:function(){var e;return{pathname:null!==(e=null==pt?void 0:pt.location.pathname)&&void 0!==e?e:""}}},{key:"doPageView",value:function(){var e,t;return this._hasSeenPageView?(t=this._pageViewData,this._pageViewData=this._createPageViewData()):(this._hasSeenPageView=!0,t=void 0,this._pageViewData||(this._pageViewData=this._createPageViewData())),setTimeout(this._updateScrollData,0),a({$prev_pageview_pathname:null===(e=t)||void 0===e?void 0:e.pathname},this._calculatePrevPageScrollProperties(t))}},{key:"doPageLeave",value:function(){var e=this._pageViewData;return a({$prev_pageview_pathname:null==e?void 0:e.pathname},this._calculatePrevPageScrollProperties(e))}},{key:"_calculatePrevPageScrollProperties",value:function(e){if(!e||null==e.maxScrollHeight||null==e.lastScrollY||null==e.maxScrollY||null==e.maxContentHeight||null==e.lastContentY||null==e.maxContentY)return{};var t=e.maxScrollHeight,n=e.lastScrollY,r=e.maxScrollY,i=e.maxContentHeight,o=e.lastContentY,a=e.maxContentY;return t=Math.ceil(t),n=Math.ceil(n),r=Math.ceil(r),i=Math.ceil(i),o=Math.ceil(o),a=Math.ceil(a),{$prev_pageview_last_scroll:n,$prev_pageview_last_scroll_percentage:t<=1?1:Ki(n/t,0,1),$prev_pageview_max_scroll:r,$prev_pageview_max_scroll_percentage:t<=1?1:Ki(r/t,0,1),$prev_pageview_last_content:o,$prev_pageview_last_content_percentage:i<=1?1:Ki(o/i,0,1),$prev_pageview_max_content:a,$prev_pageview_max_content_percentage:i<=1?1:Ki(a/i,0,1)}}},{key:"startMeasuringScrollPosition",value:function(){null==pt||pt.addEventListener("scroll",this._updateScrollData),null==pt||pt.addEventListener("scrollend",this._updateScrollData),null==pt||pt.addEventListener("resize",this._updateScrollData)}},{key:"stopMeasuringScrollPosition",value:function(){null==pt||pt.removeEventListener("scroll",this._updateScrollData),null==pt||pt.removeEventListener("scrollend",this._updateScrollData),null==pt||pt.removeEventListener("resize",this._updateScrollData)}},{key:"_scrollHeight",value:function(){return pt?Math.max(0,pt.document.documentElement.scrollHeight-pt.document.documentElement.clientHeight):0}},{key:"_scrollY",value:function(){return pt&&(pt.scrollY||pt.pageYOffset||pt.document.documentElement.scrollTop)||0}},{key:"_contentHeight",value:function(){return(null==pt?void 0:pt.document.documentElement.scrollHeight)||0}},{key:"_contentY",value:function(){var e=(null==pt?void 0:pt.document.documentElement.clientHeight)||0;return this._scrollY()+e}}]),e}();function Ki(e,t,n){return Math.max(t,Math.min(e,n))}var Zi,eo,to,no={icontains:function(e){return!!pt&&pt.location.href.toLowerCase().indexOf(e.toLowerCase())>-1},regex:function(e){return!!pt&&pr(pt.location.href,e)},exact:function(e){return(null==pt?void 0:pt.location.href)===e}},ro=function(){function e(t){u(this,e),this.instance=t}return c(e,[{key:"getSurveys",value:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]&&arguments[1],r=this.instance.get_property(Rn);if(r&&!n)return e(r);this.instance._send_request("".concat(this.instance.config.api_host,"/api/surveys/?token=").concat(this.instance.config.token),{},{method:"GET"},(function(n){var r,i=n.surveys||[];return null===(r=t.instance.persistence)||void 0===r||r.register(d({},Rn,i)),e(i)}))}},{key:"getActiveMatchingSurveys",value:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]&&arguments[1];this.getSurveys((function(n){var r=n.filter((function(e){return!(!e.start_date||e.end_date)})).filter((function(e){var t,n,r,i;if(!e.conditions)return!0;var o=null===(t=e.conditions)||void 0===t||!t.url||no[null!==(n=null===(r=e.conditions)||void 0===r?void 0:r.urlMatchType)&&void 0!==n?n:"icontains"](e.conditions.url),a=null===(i=e.conditions)||void 0===i||!i.selector||(null==vt?void 0:vt.querySelector(e.conditions.selector));return o&&a})).filter((function(e){if(!e.linked_flag_key&&!e.targeting_flag_key)return!0;var n=!e.linked_flag_key||t.instance.featureFlags.isFeatureEnabled(e.linked_flag_key),r=!e.targeting_flag_key||t.instance.featureFlags.isFeatureEnabled(e.targeting_flag_key);return n&&r}));return e(r)}),n)}}]),e}(),io=6e4,oo=function(){function e(){var t=this;u(this,e),d(this,"limits",{}),d(this,"checkForLimiting",(function(e){try{var n=e.responseText;if(!n||!n.length)return;(JSON.parse(n).quota_limited||[]).forEach((function(e){Nt.info("[RateLimiter] ".concat(e||"events"," is quota limited.")),t.limits[e]=(new Date).getTime()+io}))}catch(e){return void Nt.error(e)}}))}return c(e,[{key:"isRateLimited",value:function(e){var t=this.limits[e||"events"]||!1;return!1!==t&&(new Date).getTime()<t}}]),e}(),ao=function(){return a({initialPathName:(null==pt?void 0:pt.location.pathname)||"",referringDomain:gr.referringDomain()},gr.campaignParams())},so=function(){function e(t,n,r){var i=this;u(this,e),d(this,"_onSessionIdCallback",(function(e){var t=i._getStoredProps();if(!t||t.sessionId!==e){var n={sessionId:e,props:i._sessionSourceParamGenerator()};i._persistence.register(d({},Nn,n))}})),this._sessionIdManager=t,this._persistence=n,this._sessionSourceParamGenerator=r||ao,this._sessionIdManager.onSessionId(this._onSessionIdCallback)}return c(e,[{key:"_getStoredProps",value:function(){return this._persistence.props[Nn]}},{key:"getSessionProps",value:function(){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}:{}}}]),e}(),uo=["ahrefsbot","ahrefssiteaudit","applebot","baiduspider","bingbot","bingpreview","bot.htm","bot.php","crawler","duckduckbot","facebookexternal","facebookcatalog","gptbot","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","adsbot-google","apis-google","duplexweb-google","feedfetcher-google","google favicon","google web preview","google-read-aloud","googlebot","googleweblight","mediapartners-google","storebot-google"],lo=function(e,t){if(!e)return!1;var n=e.toLowerCase();return uo.concat(t||[]).some((function(e){var t=e.toLowerCase();return n.includes?n.includes(t):-1!==n.indexOf(t)}))};!function(e){e[e.INIT_MODULE=0]="INIT_MODULE",e[e.INIT_SNIPPET=1]="INIT_SNIPPET"}(Zi||(Zi={}));var co=function(){},fo={},po="posthog",ho=(null==pt?void 0:pt.XMLHttpRequest)&&"withCredentials"in new XMLHttpRequest,vo=!ho&&-1===(null==gt?void 0:gt.indexOf("MSIE"))&&-1===(null==gt?void 0:gt.indexOf("Mozilla")),go=function(){var e,t,n;return{api_host:"https://app.posthog.com",api_method:"POST",api_transport:"XHR",ui_host:null,token:"",autocapture:!0,rageclick:!0,cross_subdomain_cookie:(t=null==vt?void 0:vt.location,n=null==t?void 0:t.hostname,!!Ot(n)&&"herokuapp.com"!==n.split(".").slice(-2).join(".")),persistence:"localStorage+cookie",persistence_name:"",cookie_name:"",loaded:co,store_google:!0,custom_campaign_params:[],custom_blocked_useragents:[],save_referrer:!0,capture_pageview:!0,capture_pageleave:!0,debug:!1,verbose:!1,cookie_expiration:365,upgrade:!1,disable_session_recording:!1,disable_persistence:!1,disable_cookie:!1,enable_recording_console_log:void 0,secure_cookie:"https:"===(null==pt||null===(e=pt.location)||void 0===e?void 0:e.protocol),ip:!0,opt_out_capturing_by_default:!1,opt_out_persistence_by_default:!1,opt_out_capturing_persistence_type:"localStorage",opt_out_capturing_cookie_prefix:null,opt_in_site_apps:!1,property_blacklist:[],respect_dnt:!1,sanitize_properties:null,xhr_headers:{},inapp_protocol:"//",inapp_link_new_window:!1,request_batching:!0,properties_string_max_length:65535,session_recording:{},mask_all_element_attributes:!1,mask_all_text:!1,advanced_disable_decide:!1,advanced_disable_feature_flags:!1,advanced_disable_feature_flags_on_first_load:!1,advanced_disable_toolbar_metrics:!1,on_xhr_error:function(e){var t="Bad HTTP status: "+e.status+" "+e.statusText;Nt.error(t)},get_device_id:function(e){return e},_onCapture:co,capture_performance:void 0,name:"posthog",callback_fn:"posthog._jsc",bootstrap:{},disable_compression:!1,session_idle_timeout_seconds:1800}},mo=function(e,t,n,r){var i,o=n!==po&&to?n?to[n]:void 0:to,a={initComplete:!1,syncCode:!1},s=function(e){return function(t){a[e]||(a[e]=!0,a.initComplete&&a.syncCode&&(null==r||r(t)))}};if(o&&eo===Zi.INIT_MODULE)i=o;else{if(o&&!St(o))return void Nt.error("You have already initialized "+n);i=new yo}if(i._init(e,t,n,s("initComplete")),i.toolbar.maybeLoadToolbar(),i.sessionRecording=new Dr(i),i.sessionRecording.startRecordingIfEnabled(),i.config.__preview_measure_pageview_stats&&i.pageViewManager.startMeasuringScrollPosition(),i.__autocapture=i.config.autocapture,An._setIsAutocaptureEnabled(i),An._isAutocaptureEnabled){i.__autocapture=i.config.autocapture;An.enabledForProject(i.config.token,100,100)?An.isBrowserSupported()?An.init(i):(i.__autocapture=!1,Nt.info("Disabling Automatic Event Collection because this browser is not supported")):(i.__autocapture=!1,Nt.info("Not in active bucket: disabling Automatic Event Collection."))}return _t.DEBUG=_t.DEBUG||i.config.debug,!Et(o)&&St(o)&&(i._execute_array.call(i.people,o.people),i._execute_array(o)),s("syncCode")(i),i},_o=function(){function e(){u(this,e),d(this,"__forceAllowLocalhost",!1)}return c(e,[{key:"_forceAllowLocalhost",get:function(){return this.__forceAllowLocalhost},set:function(e){Nt.error("WebPerformanceObserver is deprecated and has no impact on network capture. Use `_forceAllowLocalhostNetworkCapture` on `posthog.sessionRecording`"),this.__forceAllowLocalhost=e}}]),e}(),yo=function(){function e(){var t=this;u(this,e),d(this,"webPerformance",new _o),this.config=go(),this.compression={},this.decideEndpointWasHit=!1,this.SentryIntegration=Ji,this.segmentIntegration=function(){return Qi(t)},this.__captureHooks=[],this.__request_queue=[],this.__loaded=!1,this.__loaded_recorder_version=void 0,this.__autocapture=void 0,this._jsc=function(){},this.analyticsDefaultEndpoint="/e/",this.elementsChainAsString=!1,this.featureFlags=new Hn(this),this.toolbar=new jr(this),this.pageViewManager=new Xi,this.surveys=new ro(this),this.rateLimiter=new oo,this.people={set:function(e,n,r){var i=Ot(e)?d({},e,n):e;t.setPersonProperties(i),null==r||r({})},set_once:function(e,n,r){var i=Ot(e)?d({},e,n):e;t.setPersonProperties(void 0,i),null==r||r({})}}}return c(e,[{key:"init",value:function(e,t,n){if(Et(n))Nt.critical("You must name your new library: init(token, config, name)");else{if(n!==po){var r=mo(e,t,n,(function(e){to[n]=e,e._loaded()}));return to[n]=r,r}Nt.critical("You must initialize the main posthog object right after you include the PostHog js snippet")}}},{key:"_init",value:function(e){var t,n,r,i=this,o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},s=arguments.length>2?arguments[2]:void 0,u=arguments.length>3?arguments[3]:void 0;this.__loaded=!0,this.config={},this._triggered_notifs=[];var l,c={segmentRegister:!1,syncCode:!1},d=function(e){return function(){c[e]||(c[e]=!0,c.segmentRegister&&c.syncCode&&(null==u||u(i)))}};(this.set_config(qt({},go(),o,{name:s,token:e,callback_fn:(s===po?s:po+"."+s)+"._jsc"})),this._jsc=function(){},null!=pt&&null!==(t=pt.rrweb)&&void 0!==t&&t.record||null!=pt&&pt.rrwebRecord)&&(this.__loaded_recorder_version=null==pt||null===(l=pt.rrweb)||void 0===l?void 0:l.version);if(this.persistence=new _r(this.config),this._requestQueue=new Zr(this._handle_queued_event.bind(this)),this._retryQueue=new Vi(this.config.on_xhr_error,this.rateLimiter),this.__captureHooks=[],this.__request_queue=[],this.sessionManager=new Yi(this.config,this.persistence),this.sessionPropsManager=new so(this.sessionManager,this.persistence),this.sessionPersistence="sessionStorage"===this.config.persistence?this.persistence:new _r(a(a({},this.config),{},{persistence:"sessionStorage"})),this._gdpr_init(),o.segment?(this.config.get_device_id=function(){return o.segment.user().anonymousId()},o.segment.user().id()&&(this.register({distinct_id:o.segment.user().id()}),this.persistence.set_user_state("identified")),o.segment.register(this.segmentIntegration()).then(d("segmentRegister"))):d("segmentRegister")(),void 0!==(null===(n=o.bootstrap)||void 0===n?void 0:n.distinctID)){var f,p,h=this.config.get_device_id(Jn()),v=null!==(f=o.bootstrap)&&void 0!==f&&f.isIdentifiedID?h:o.bootstrap.distinctID;this.persistence.set_user_state(null!==(p=o.bootstrap)&&void 0!==p&&p.isIdentifiedID?"identified":"anonymous"),this.register({distinct_id:o.bootstrap.distinctID,$device_id:v})}if(this._hasBootstrappedFeatureFlags()){var g,m,_=Object.keys((null===(g=o.bootstrap)||void 0===g?void 0:g.featureFlags)||{}).filter((function(e){var t,n;return!(null===(t=o.bootstrap)||void 0===t||null===(n=t.featureFlags)||void 0===n||!n[e])})).reduce((function(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}),{}),y=Object.keys((null===(m=o.bootstrap)||void 0===m?void 0:m.featureFlagPayloads)||{}).filter((function(e){return _[e]})).reduce((function(e,t){var n,r,i,a;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===(a=i.featureFlagPayloads)||void 0===a?void 0:a[t]);return e}),{});this.featureFlags.receivedFeatureFlags({featureFlags:_,featureFlagPayloads:y})}if(!this.get_distinct_id()){var b=this.config.get_device_id(Jn());this.register_once({distinct_id:b,$device_id:b},""),this.persistence.set_user_state("anonymous")}null==pt||null===(r=pt.addEventListener)||void 0===r||r.call(pt,"onpagehide"in self?"pagehide":"unload",this._handle_unload.bind(this)),d("syncCode")()}},{key:"_afterDecideResponse",value:function(e){var t;if(this.compression={},e.supportedCompression&&!this.config.disable_compression){var n,r={},i=w(e.supportedCompression);try{for(i.s();!(n=i.n()).done;){r[n.value]=!0}}catch(e){i.e(e)}finally{i.f()}this.compression=r}null!==(t=e.analytics)&&void 0!==t&&t.endpoint&&(this.analyticsDefaultEndpoint=e.analytics.endpoint),e.elementsChainAsString&&(this.elementsChainAsString=e.elementsChainAsString)}},{key:"_loaded",value:function(){var e=this.config.advanced_disable_decide;e||this.featureFlags.setReloadingPaused(!0);try{this.config.loaded(this)}catch(e){Nt.critical("`loaded` function failed",e)}this._start_queue_if_opted_in(),this.config.capture_pageview&&vt&&this.capture("$pageview",{title:vt.title},{send_instantly:!0}),e||(new Ar(this).call(),this.featureFlags.resetRequestQueue())}},{key:"_start_queue_if_opted_in",value:function(){var e;this.has_opted_out_capturing()||this.config.request_batching&&(null===(e=this._requestQueue)||void 0===e||e.poll())}},{key:"_dom_loaded",value:function(){var e=this;this.has_opted_out_capturing()||At(this.__request_queue,(function(t){e._send_request.apply(e,y(t))})),this.__request_queue=[],this._start_queue_if_opted_in()}},{key:"_prepare_callback",value:function(e,t){if(Et(e))return null;if(ho)return function(n){e(n,t)};var n=this._jsc,r=""+Math.floor(1e8*Math.random()),i=this.config.callback_fn+"["+r+"]";return n[r]=function(i){delete n[r],e(i,t)},i}},{key:"_handle_unload",value:function(){var e,t;this.config.request_batching?(this.config.capture_pageview&&this.config.capture_pageleave&&this.capture("$pageleave"),null===(e=this._requestQueue)||void 0===e||e.unload(),null===(t=this._retryQueue)||void 0===t||t.unload()):this.config.capture_pageview&&this.config.capture_pageleave&&this.capture("$pageleave",null,{transport:"sendBeacon"})}},{key:"_handle_queued_event",value:function(e,t,n){var r=JSON.stringify(t);this.__compress_and_send_json_request(e,r,n||fo,co)}},{key:"__compress_and_send_json_request",value:function(e,t,n,r){var i=function(e,t,n){return e===mi.GZipJS?[$i(qi(t),{mtime:0}),a(a({},n),{},{blob:!0,urlQueryArgs:{compression:mi.GZipJS}})]:[{data:Yt(t)},n]}(this.compression[mi.GZipJS]?mi.GZipJS:mi.Base64,t,n),o=_(i,2),s=o[0],u=o[1];this._send_request(e,s,u,r)}},{key:"_send_request",value:function(e,t,n,r){if(this.__loaded&&this._retryQueue&&!this.rateLimiter.isRateLimited(n._batchKey))if(vo)this.__request_queue.push([e,t,n,r]);else{var i={method:this.config.api_method,transport:this.config.api_transport,verbose:this.config.verbose};n=qt(i,n||{}),ho||(n.method="GET");var o=pt&&"sendBeacon"in pt.navigator&&"sendBeacon"===n.transport;if(e=Bi(e,n.urlQueryArgs||{},{ip:this.config.ip}),o)try{null==pt||pt.navigator.sendBeacon(e,ji(t,a(a({},n),{},{sendBeacon:!0})))}catch(e){}else if(ho||!vt)try{Hi({url:e,data:t,headers:this.config.xhr_headers,options:n,callback:r,retriesPerformedSoFar:0,retryQueue:this._retryQueue,onXHRError:this.config.on_xhr_error,onResponse:this.rateLimiter.checkForLimiting})}catch(e){Nt.error(e)}else{var s,u=vt.createElement("script");u.type="text/javascript",u.async=!0,u.defer=!0,u.src=e;var l=vt.getElementsByTagName("script")[0];null===(s=l.parentNode)||void 0===s||s.insertBefore(u,l)}}}},{key:"_execute_array",value:function(e){var t,n=this,r=[],i=[],o=[];At(e,(function(e){e&&(t=e[0],St(t)?o.push(e):It(e)?e.call(n):St(e)&&"alias"===t?r.push(e):St(e)&&-1!==t.indexOf("capture")&&It(n[t])?o.push(e):i.push(e))}));var a=function(e,t){At(e,(function(e){if(St(e[0])){var n=t;$t(e,(function(e){n=n[e[0]].apply(n,e.slice(1))}))}else this[e[0]].apply(this,e.slice(1))}),t)};a(r,this),a(i,this),a(o,this)}},{key:"_hasBootstrappedFeatureFlags",value:function(){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}},{key:"push",value:function(e){this._execute_array([e])}},{key:"capture",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:fo;if(!this.__loaded||!this.sessionPersistence||!this._requestQueue)return Nt.uninitializedWarning("posthog.capture");if(!function(e){var t=!1;try{var n=e.config.token,r=e.config.respect_dnt,i=e.config.opt_out_capturing_persistence_type,o=e.config.opt_out_capturing_cookie_prefix||void 0,a=e.config.window;n&&(t=zr(n,{respectDnt:r,persistenceType:i,persistencePrefix:o,window:a}))}catch(e){Nt.error("Unexpected error when checking capturing opt-out status: "+e)}return t}(this)){var r=(n=n||fo).transport;if(r&&(n.transport=r),!Et(e)&&Ot(e)){if(!gt||!lo(gt,this.config.custom_blocked_useragents)){this.sessionPersistence.update_search_keyword(),this.config.store_google&&this.sessionPersistence.update_campaign_params(),this.config.save_referrer&&this.sessionPersistence.update_referrer_info();var i={uuid:Jn(),event:e,properties:this._calculate_event_properties(e,t||{})};"$identify"===e&&(i.$set=n.$set,i.$set_once=n.$set_once),(i=Gt(i,n._noTruncate?null:this.config.properties_string_max_length)).timestamp=n.timestamp||new Date;var o=a(a({},i.properties.$set),i.$set);Ft(o)||this.setPersonPropertiesForFlags(o),Nt.info("send",i);var s=JSON.stringify(i),u=this.config.api_host+(n.endpoint||this.analyticsDefaultEndpoint),l=n!==fo;return!this.config.request_batching||l&&!n._batchKey||n.send_instantly?this.__compress_and_send_json_request(u,s,n):this._requestQueue.enqueue(u,i,n),this._invokeCaptureHooks(e,i),i}}else Nt.error("No event name provided to posthog.capture")}}},{key:"_addCaptureHook",value:function(e){this.__captureHooks.push(e)}},{key:"_invokeCaptureHooks",value:function(e,t){this.config._onCapture(e,t),$t(this.__captureHooks,(function(t){return t(e)}))}},{key:"_calculate_event_properties",value:function(e,t){if(!this.persistence||!this.sessionPersistence)return t;var n=this.persistence.remove_event_timer(e),r=a({},t);if(r.token=this.config.token,"$snapshot"===e){var i=a(a({},this.persistence.properties()),this.sessionPersistence.properties());return r.distinct_id=i.distinct_id,r}var o=gr.properties();if(this.sessionManager){var s=this.sessionManager.checkAndGetSessionAndWindowId(),u=s.sessionId,l=s.windowId;r.$session_id=u,r.$window_id=l}if(this.sessionPropsManager&&this.config.__preview_send_client_session_params&&("$pageview"===e||"$pageleave"===e||"$autocapture"===e)){var c=this.sessionPropsManager.getSessionProps();r=qt(r,c)}if(this.config.__preview_measure_pageview_stats){var d={};"$pageview"===e?d=this.pageViewManager.doPageView():"$pageleave"===e&&(d=this.pageViewManager.doPageLeave()),r=qt(r,d)}if("$pageview"===e&&vt&&(r.title=vt.title),"$performance_event"===e){var f=this.persistence.properties();return r.distinct_id=f.distinct_id,r.$current_url=o.$current_url,r}if(!Et(n)){var p=(new Date).getTime()-n;r.$duration=parseFloat((p/1e3).toFixed(3))}r=qt({},gr.properties(),this.persistence.properties(),this.sessionPersistence.properties(),r);var h=this.config.property_blacklist;St(h)?$t(h,(function(e){delete r[e]})):Nt.error("Invalid value for property_blacklist config: "+h);var v=this.config.sanitize_properties;return v&&(r=v(r,e)),r}},{key:"register",value:function(e,t){var n;null===(n=this.persistence)||void 0===n||n.register(e,t)}},{key:"register_once",value:function(e,t,n){var r;null===(r=this.persistence)||void 0===r||r.register_once(e,t,n)}},{key:"register_for_session",value:function(e){var t;null===(t=this.sessionPersistence)||void 0===t||t.register(e)}},{key:"unregister",value:function(e){var t;null===(t=this.persistence)||void 0===t||t.unregister(e)}},{key:"unregister_for_session",value:function(e){var t;null===(t=this.sessionPersistence)||void 0===t||t.unregister(e)}},{key:"_register_single",value:function(e,t){this.register(d({},e,t))}},{key:"getFeatureFlag",value:function(e,t){return this.featureFlags.getFeatureFlag(e,t)}},{key:"getFeatureFlagPayload",value:function(e){var t=this.featureFlags.getFeatureFlagPayload(e);try{return JSON.parse(t)}catch(e){return t}}},{key:"isFeatureEnabled",value:function(e,t){return this.featureFlags.isFeatureEnabled(e,t)}},{key:"reloadFeatureFlags",value:function(){this.featureFlags.reloadFeatureFlags()}},{key:"updateEarlyAccessFeatureEnrollment",value:function(e,t){this.featureFlags.updateEarlyAccessFeatureEnrollment(e,t)}},{key:"getEarlyAccessFeatures",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return this.featureFlags.getEarlyAccessFeatures(e,t)}},{key:"onFeatureFlags",value:function(e){return this.featureFlags.onFeatureFlags(e)}},{key:"onSessionId",value:function(e){var t,n;return null!==(t=null===(n=this.sessionManager)||void 0===n?void 0:n.onSessionId(e))&&void 0!==t?t:function(){}}},{key:"getSurveys",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];this.surveys.getSurveys(e,t)}},{key:"getActiveMatchingSurveys",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];this.surveys.getActiveMatchingSurveys(e,t)}},{key:"identify",value:function(e,t,n){if(!this.__loaded||!this.persistence)return Nt.uninitializedWarning("posthog.identify");if(e)if(["distinct_id","distinctid"].includes(e.toLowerCase()))Nt.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{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(mn)&&(this.unregister(mn),this.register({distinct_id:e}));var o="anonymous"===this.persistence.get_user_state();e!==r&&o?(this.persistence.set_user_state("identified"),this.setPersonPropertiesForFlags(t||{},!1),this.capture("$identify",{distinct_id:e,$anon_distinct_id:r},{$set:t||{},$set_once:n||{}}),this.featureFlags.setAnonymousDistinctId(r)):(t||n)&&this.setPersonProperties(t,n),e!==r&&(this.reloadFeatureFlags(),this.unregister(Mn))}else Nt.error("Unique user id has not been set in posthog.identify")}},{key:"setPersonProperties",value:function(e,t){(e||t)&&(this.setPersonPropertiesForFlags(e||{}),this.capture("$set",{$set:e||{},$set_once:t||{}}))}},{key:"group",value:function(e,t,n){if(e&&t){var r=this.getGroups();r[e]!==t&&this.resetGroupPropertiesForFlags(e),this.register({$groups:a(a({},r),{},d({},e,t))}),n&&(this.capture("$groupidentify",{$group_type:e,$group_key:t,$group_set:n}),this.setGroupPropertiesForFlags(d({},e,n))),r[e]===t||n||this.reloadFeatureFlags()}else Nt.error("posthog.group requires a group type and group key")}},{key:"resetGroups",value:function(){this.register({$groups:{}}),this.resetGroupPropertiesForFlags(),this.reloadFeatureFlags()}},{key:"setPersonPropertiesForFlags",value:function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];this.featureFlags.setPersonPropertiesForFlags(e,t)}},{key:"resetPersonPropertiesForFlags",value:function(){this.featureFlags.resetPersonPropertiesForFlags()}},{key:"setGroupPropertiesForFlags",value:function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];this.featureFlags.setGroupPropertiesForFlags(e,t)}},{key:"resetGroupPropertiesForFlags",value:function(e){this.featureFlags.resetGroupPropertiesForFlags(e)}},{key:"reset",value:function(e){var t,n,r,i;if(!this.__loaded)return Nt.uninitializedWarning("posthog.reset");var o=this.get_property("$device_id");null===(t=this.persistence)||void 0===t||t.clear(),null===(n=this.sessionPersistence)||void 0===n||n.clear(),null===(r=this.persistence)||void 0===r||r.set_user_state("anonymous"),null===(i=this.sessionManager)||void 0===i||i.resetSessionId();var a=this.config.get_device_id(Jn());this.register_once({distinct_id:a,$device_id:e?a:o},"")}},{key:"get_distinct_id",value:function(){return this.get_property("distinct_id")}},{key:"getGroups",value:function(){return this.get_property("$groups")||{}}},{key:"get_session_id",value:function(){var e,t;return null!==(e=null===(t=this.sessionManager)||void 0===t?void 0:t.checkAndGetSessionAndWindowId(!0).sessionId)&&void 0!==e?e:""}},{key:"get_session_replay_url",value:function(e){if(!this.sessionManager)return"";var t=this.config.ui_host||this.config.api_host,n=this.sessionManager.checkAndGetSessionAndWindowId(!0),r=n.sessionId,i=n.sessionStartTimestamp,o=t+"/replay/"+r;if(null!=e&&e.withTimestamp&&i){var a,s=null!==(a=e.timestampLookBack)&&void 0!==a?a:10;if(!i)return o;var u=Math.max(Math.floor(((new Date).getTime()-i)/1e3)-s,0);o+="?t=".concat(u)}return o}},{key:"alias",value:function(e,t){return e===this.get_property(gn)?(Nt.critical("Attempting to create alias for existing People user - aborting."),-2):(Et(t)&&(t=this.get_distinct_id()),e!==t?(this._register_single(mn,e),this.capture("$create_alias",{alias:e,distinct_id:t})):(Nt.warn("alias matches current distinct_id - skipping api call."),this.identify(e),-1))}},{key:"set_config",value:function(e){var t,n,r=a({},this.config);xt(e)&&(qt(this.config,e),this.config.persistence_name||(this.config.persistence_name=this.config.cookie_name),this.config.disable_persistence||(this.config.disable_persistence=this.config.disable_cookie),this.config.api_host=this.config.api_host.replace(/\/$/,""),null===(t=this.persistence)||void 0===t||t.update_config(this.config),null===(n=this.sessionPersistence)||void 0===n||n.update_config(this.config),ir.is_supported()&&"true"===ir.get("ph_debug")&&(this.config.debug=!0),this.config.debug&&(_t.DEBUG=!0),this.sessionRecording&&!Et(e.disable_session_recording)&&r.disable_session_recording!==e.disable_session_recording&&(e.disable_session_recording?this.sessionRecording.stopRecording():this.sessionRecording.startRecordingIfEnabled()))}},{key:"startSessionRecording",value:function(){this.set_config({disable_session_recording:!1})}},{key:"stopSessionRecording",value:function(){this.set_config({disable_session_recording:!0})}},{key:"sessionRecordingStarted",value:function(){var e;return!(null===(e=this.sessionRecording)||void 0===e||!e.started)}},{key:"loadToolbar",value:function(e){return this.toolbar.loadToolbar(e)}},{key:"get_property",value:function(e){var t;return null===(t=this.persistence)||void 0===t?void 0:t.props[e]}},{key:"getSessionProperty",value:function(e){var t;return null===(t=this.sessionPersistence)||void 0===t?void 0:t.props[e]}},{key:"toString",value:function(){var e,t=null!==(e=this.config.name)&&void 0!==e?e:po;return t!==po&&(t=po+"."+t),t}},{key:"_gdpr_init",value:function(){"localStorage"===this.config.opt_out_capturing_persistence_type&&ir.is_supported()&&(!this.has_opted_in_capturing()&&this.has_opted_in_capturing({persistence_type:"cookie"})&&this.opt_in_capturing({enable_persistence:!1}),!this.has_opted_out_capturing()&&this.has_opted_out_capturing({persistence_type:"cookie"})&&this.opt_out_capturing({clear_persistence:!1}),this.clear_opt_in_out_capturing({persistence_type:"cookie",enable_persistence:!1})),this.has_opted_out_capturing()?this._gdpr_update_persistence({clear_persistence:!0}):this.has_opted_in_capturing()||!this.config.opt_out_capturing_by_default&&!nr.get("ph_optout")||(nr.remove("ph_optout"),this.opt_out_capturing({clear_persistence:this.config.opt_out_persistence_by_default}))}},{key:"_gdpr_update_persistence",value:function(e){var t,n,r,i,o;if(e&&e.clear_persistence)r=!0;else{if(!e||!e.enable_persistence)return;r=!1}this.config.disable_persistence||(null===(t=this.persistence)||void 0===t?void 0:t.disabled)===r||(null===(i=this.persistence)||void 0===i||i.set_disabled(r));this.config.disable_persistence||(null===(n=this.sessionPersistence)||void 0===n?void 0:n.disabled)===r||(null===(o=this.sessionPersistence)||void 0===o||o.set_disabled(r))}},{key:"_gdpr_call_func",value:function(e,t){return t=qt({capture:this.capture.bind(this),persistence_type:this.config.opt_out_capturing_persistence_type,cookie_prefix:this.config.opt_out_capturing_cookie_prefix,cookie_expiration:this.config.cookie_expiration,cross_subdomain_cookie:this.config.cross_subdomain_cookie,secure_cookie:this.config.secure_cookie},t||{}),ir.is_supported()||"localStorage"!==t.persistence_type||(t.persistence_type="cookie"),e(this.config.token,{capture:t.capture,captureEventName:t.capture_event_name,captureProperties:t.capture_properties,persistenceType:t.persistence_type,persistencePrefix:t.cookie_prefix,cookieExpiration:t.cookie_expiration,crossSubdomainCookie:t.cross_subdomain_cookie,secureCookie:t.secure_cookie})}},{key:"opt_in_capturing",value:function(e){e=qt({enable_persistence:!0},e||{}),this._gdpr_call_func(Wr,e),this._gdpr_update_persistence(e)}},{key:"opt_out_capturing",value:function(e){var t=qt({clear_persistence:!0},e||{});this._gdpr_call_func(Vr,t),this._gdpr_update_persistence(t)}},{key:"has_opted_in_capturing",value:function(e){return this._gdpr_call_func(Ur,e)}},{key:"has_opted_out_capturing",value:function(e){return this._gdpr_call_func(zr,e)}},{key:"clear_opt_in_out_capturing",value:function(e){var t=qt({enable_persistence:!0},null!=e?e:{});this._gdpr_call_func(Gr,t),this._gdpr_update_persistence(t)}},{key:"debug",value:function(e){!1===e?(null==pt||pt.console.log("You've disabled debug mode."),localStorage&&localStorage.removeItem("ph_debug"),this.set_config({debug:!1})):(null==pt||pt.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}))}}]),e}();!function(e,t){for(var n=0;n<t.length;n++)e.prototype[t[n]]=Vt(e.prototype[t[n]])}(yo,["identify"]);var bo={},ko=function(){to.init=function(e,t,n){if(n)return to[n]||(to[n]=bo[n]=mo(e||"",t||{},n,(function(e){to[n]=bo[n]=e,e._loaded()}))),to[n];var r=to;return bo[po]?r=bo[po]:e&&(r=mo(e,t||{},po,(function(e){bo[po]=e,e._loaded()})),bo[po]=r),to=r,eo===Zi.INIT_SNIPPET&&(mt[po]=to),$t(bo,(function(e,t){t!==po&&(to[t]=e)})),r}},wo=function(){function e(){e.done||(e.done=!0,vo=!1,$t(bo,(function(e){e._dom_loaded()})))}null!=vt&&vt.addEventListener&&("complete"===vt.readyState?e():vt.addEventListener("DOMContentLoaded",e,!1)),pt&&Qt(pt,"load",e,!0)};eo=Zi.INIT_SNIPPET,Et(mt.posthog)&&(mt.posthog=[]),(to=mt.posthog).__loaded||to.config&&to.persistence?Nt.critical("PostHog library has already been downloaded at least once."):($t(to._i,(function(e){e&&St(e)&&(bo[e[2]]=mo.apply(void 0,y(e)))})),ko(),to.init(),$t(bo,(function(e){e._loaded()})),wo())}();
|
|
16
16
|
//# sourceMappingURL=array.full.js.map
|