diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-05-05 11:19:16 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-05-05 12:07:37 +0000 |
commit | b485aab7e71c1625cfc27e0f92c9509f42378458 (patch) | |
tree | ae9abe108601079d1679194de237c9a435ae5b55 /web/gui/v2/9893.b40d1bffe447771a2e43.chunk.js | |
parent | Adding upstream version 1.44.3. (diff) | |
download | netdata-b485aab7e71c1625cfc27e0f92c9509f42378458.tar.xz netdata-b485aab7e71c1625cfc27e0f92c9509f42378458.zip |
Adding upstream version 1.45.3+dfsg.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to '')
-rw-r--r-- | web/gui/v2/9893.b40d1bffe447771a2e43.chunk.js | 1 |
1 files changed, 0 insertions, 1 deletions
diff --git a/web/gui/v2/9893.b40d1bffe447771a2e43.chunk.js b/web/gui/v2/9893.b40d1bffe447771a2e43.chunk.js deleted file mode 100644 index a30201dfc..000000000 --- a/web/gui/v2/9893.b40d1bffe447771a2e43.chunk.js +++ /dev/null @@ -1 +0,0 @@ -!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},t=(new Error).stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="cbaa299a-848b-4e08-8c81-c467adba81ee",e._sentryDebugIdIdentifier="sentry-dbid-cbaa299a-848b-4e08-8c81-c467adba81ee")}catch(e){}}();var _global="undefined"!==typeof window?window:"undefined"!==typeof global?global:"undefined"!==typeof self?self:{};_global.SENTRY_RELEASE={id:"8b7b01b6c705cf50f8050ce0fb8fc6b58fe68567"},(self.webpackChunkcloud_frontend=self.webpackChunkcloud_frontend||[]).push([[9893],{99893:function(e,t,n){function i(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,i)}return n}function r(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?i(Object(n),!0).forEach((function(t){c(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):i(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function o(e){return o="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},o(e)}function s(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function a(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}function u(e,t,n){return t&&a(e.prototype,t),n&&a(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function c(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function l(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&&f(e,t)}function d(e){return d=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},d(e)}function f(e,t){return f=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},f(e,t)}function h(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,i=d(e);if(t){var r=d(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return function(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)}(this,n)}}function p(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){var i,r,o=[],s=!0,a=!1;try{for(n=n.call(e);!(s=(i=n.next()).done)&&(o.push(i.value),!t||o.length!==t);s=!0);}catch(e){a=!0,r=e}finally{try{s||null==n.return||n.return()}finally{if(a)throw r}}return o}}(e,t)||g(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 _(e){return function(e){if(Array.isArray(e))return v(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||g(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 g(e,t){if(e){if("string"==typeof e)return v(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)?v(e,t):void 0}}function v(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,i=new Array(t);n<t;n++)i[n]=e[n];return i}function m(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=g(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var i=0,r=function(){};return{s:r,n:function(){return i>=e.length?{done:!0}:{done:!1,value:e[i++]}},e:function(e){throw e},f:r}}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,s=!0,a=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return s=e.done,e},e:function(e){a=!0,o=e},f:function(){try{s||null==n.return||n.return()}finally{if(a)throw o}}}}n.r(t),n.d(t,{Compression:function(){return Xt},PostHog:function(){return Qn},SurveyQuestionType:function(){return Xn},SurveyType:function(){return Jn},default:function(){return Zn},posthog:function(){return Zn}});var y={DEBUG:!1,LIB_VERSION:"1.88.2"},b=Array.isArray,w=Object.prototype,k=w.hasOwnProperty,S=w.toString,F=b||function(e){return"[object Array]"===S.call(e)},P=function(e){return"[object Uint8Array]"===S.call(e)},I=function(e){try{return/^\s*\bfunction\b/.test(e)}catch(e){return!1}},E=function(e){return e===Object(e)&&!F(e)},x=function(e){return void 0===e},O=function(e){return"[object String]"==S.call(e)},R=function(e){return null===e},T=function(e){return"[object Number]"==S.call(e)},$=function(e){return"[object Boolean]"===S.call(e)},C=Array.prototype,M=C.forEach,A=C.indexOf,D="undefined"!=typeof window?window:{},L=D.navigator||{userAgent:""},N=D.document||{},B=L.userAgent,q="[PostHog.js]",j={_log:function(e){if((y.DEBUG||D.POSTHOG_DEBUG)&&!x(D.console)&&D.console){for(var t=("__rrweb_original__"in D.console[e]?D.console[e].__rrweb_original__:D.console[e]),n=arguments.length,i=new Array(n>1?n-1:0),r=1;r<n;r++)i[r-1]=arguments[r];t.apply(void 0,[q].concat(i))}},info:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];j._log.apply(j,["log"].concat(t))},warn:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];j._log.apply(j,["warn"].concat(t))},error:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];j._log.apply(j,["error"].concat(t))},critical:function(){for(var e,t=arguments.length,n=new Array(t),i=0;i<t;i++)n[i]=arguments[i];(e=console).error.apply(e,[q].concat(n))},uninitializedWarning:function(e){j.error("You must initialize PostHog before calling ".concat(e))}},H={},V=function(e){return e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"")};function U(e,t,n){if(F(e))if(M&&e.forEach===M)e.forEach(t,n);else if("length"in e&&e.length===+e.length)for(var i=0,r=e.length;i<r;i++)if(i in e&&t.call(n,e[i],i)===H)return}function W(e,t,n){if(!R(e)&&!x(e)){if(F(e))return U(e,t,n);for(var i in e)if(k.call(e,i)&&t.call(n,e[i],i)===H)return}}var G=function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),i=1;i<t;i++)n[i-1]=arguments[i];return U(n,(function(t){for(var n in t)void 0!==t[n]&&(e[n]=t[n])})),e};function z(e,t){return-1!==e.indexOf(t)}var Y=function(){return Date.now=Date.now||function(){return+new Date},Date.now()},Q=function(e){try{return e()}catch(e){return}},J=function(e){return function(){try{for(var t=arguments.length,n=new Array(t),i=0;i<t;i++)n[i]=arguments[i];return e.apply(this,n)}catch(e){j.critical("Implementation error. Please turn on debug and contact support@posthog.com."),j.critical(e)}}},X=function(e){var t={};return W(e,(function(e,n){O(e)&&e.length>0&&(t[n]=e)})),t},K=["$performance_raw"];function Z(e){var t,n,i,r,o,s="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",a=0,u=0,c="",l=[];if(!e)return e;e=ee(e);do{t=(o=e.charCodeAt(a++)<<16|e.charCodeAt(a++)<<8|e.charCodeAt(a++))>>18&63,n=o>>12&63,i=o>>6&63,r=63&o,l[u++]=s.charAt(t)+s.charAt(n)+s.charAt(i)+s.charAt(r)}while(a<e.length);switch(c=l.join(""),e.length%3){case 1:c=c.slice(0,-2)+"==";break;case 2:c=c.slice(0,-1)+"="}return c}var ee=function(e){var t,n,i,r,o="";for(t=n=0,i=(e=(e+"").replace(/\r\n/g,"\n").replace(/\r/g,"\n")).length,r=0;r<i;r++){var s=e.charCodeAt(r),a=null;s<128?n++:a=s>127&&s<2048?String.fromCharCode(s>>6|192,63&s|128):String.fromCharCode(s>>12|224,s>>6&63|128,63&s|128),R(a)||(n>t&&(o+=e.substring(t,n)),o+=a,t=n=r+1)}return n>t&&(o+=e.substring(t,e.length)),o},te=["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"],ne=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,i,r,o){if(t)if(t.addEventListener&&!r)t.addEventListener(n,i,!!o);else{var s="on"+n,a=t[s];t[s]=function(t,n,i){return function(r){if(r=r||e(window.event)){var o,s=!0;I(i)&&(o=i(r));var a=n.call(t,r);return!1!==o&&!1!==a||(s=!1),s}}}(t,i,a)}else j.error("No valid element provided to register_event")}}();function ie(e,t){var n=function(){var n=N.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 i,r=N.querySelectorAll("body > script");r.length>0?null===(i=r[0].parentNode)||void 0===i||i.insertBefore(n,r[0]):N.body.appendChild(n)};N.body?n():N.addEventListener("DOMContentLoaded",n)}function re(e){switch(o(e.className)){case"string":return e.className;case"object":return("baseVal"in e.className?e.className.baseVal:null)||e.getAttribute("class")||"";default:return""}}function oe(e){var t="";return de(e)&&!fe(e)&&e.childNodes&&e.childNodes.length&&W(e.childNodes,(function(e){ue(e)&&e.textContent&&(t+=V(e.textContent).split(/(\s+)/).filter(he).join("").replace(/[\r\n]/g," ").replace(/[ ]+/g," ").substring(0,255))})),V(t)}function se(e){return!!e&&1===e.nodeType}function ae(e,t){return!!e&&!!e.tagName&&e.tagName.toLowerCase()===t.toLowerCase()}function ue(e){return!!e&&3===e.nodeType}function ce(e){return!!e&&11===e.nodeType}var le=["a","button","form","input","select","textarea","label"];function de(e){for(var t=e;t.parentNode&&!ae(t,"body");t=t.parentNode){var n=re(t).split(" ");if(z(n,"ph-sensitive")||z(n,"ph-no-capture"))return!1}if(z(re(e).split(" "),"ph-include"))return!0;var i=e.type||"";if(O(i))switch(i.toLowerCase()){case"hidden":case"password":return!1}var r=e.name||e.id||"";return!O(r)||!/^cc|cardnum|ccnum|creditcard|csc|cvc|cvv|exp|pass|pwd|routing|seccode|securitycode|securitynum|socialsec|socsec|ssn/i.test(r.replace(/[^a-zA-Z0-9]/g,""))}function fe(e){return!!(ae(e,"input")&&!["button","checkbox","submit","reset"].includes(e.type)||ae(e,"select")||ae(e,"textarea")||"true"===e.getAttribute("contenteditable"))}function he(e){if(R(e)||x(e))return!1;if(O(e)){if(e=V(e),/^(?:(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 pe(e){var t=oe(e);return he(t="".concat(t," ").concat(_e(e)).trim())?t:""}function _e(e){var t="";return e&&e.childNodes&&e.childNodes.length&&W(e.childNodes,(function(e){var n;if(e&&"span"===(null===(n=e.tagName)||void 0===n?void 0:n.toLowerCase()))try{var i=oe(e);t="".concat(t," ").concat(i).trim(),e.childNodes&&e.childNodes.length&&(t="".concat(t," ").concat(_e(e)).trim())}catch(e){j.error(e)}})),t}var ge=function(){function e(t){s(this,e),this.clicks=[],this.enabled=t}return u(e,[{key:"isRageClick",value:function(e,t,n){if(!this.enabled)return!1;var i=this.clicks[this.clicks.length-1];if(i&&Math.abs(e-i.x)+Math.abs(t-i.y)<30&&n-i.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}(),ve="$people_distinct_id",me="__alias",ye="__timers",be="$autocapture_disabled_server_side",we="$session_recording_enabled_server_side",ke="$console_log_recording_enabled_server_side",Se="$session_recording_recorder_version_server_side",Fe="$sesid",Pe="$session_is_sampled",Ie="$enabled_feature_flags",Ee="$early_access_features",xe="$stored_person_properties",Oe="$stored_group_properties",Re="$surveys",Te="$flag_call_reported",$e="$user_state",Ce="$posthog_quota_limited",Me="$client_session_props",Ae=[ve,me,"__cmpns",ye,we,Fe,Ie,$e,Ce,Ee,Oe,xe,Re,Te,Me];function De(e,t){return t.length>e?t.slice(0,e)+"...":t}var Le={_initializedTokens:[],_isDisabledServerSide:null,_isAutocaptureEnabled:!1,_setIsAutocaptureEnabled:function(e){var t,n=R(this._isDisabledServerSide)?!(null===(t=e.persistence)||void 0===t||!t.props[be]):this._isDisabledServerSide,i=!!e.config.autocapture;this._isAutocaptureEnabled=i&&!n},_previousElementSibling:function(e){if(e.previousElementSibling)return e.previousElementSibling;var t=e;do{t=t.previousSibling}while(t&&!se(t));return t},_getAugmentPropertiesFromElement:function(e){if(!de(e))return{};var t={};return W(e.attributes,(function(e){if(0===e.name.indexOf("data-ph-capture-attribute")){var n=e.name.replace("data-ph-capture-attribute-",""),i=e.value;n&&i&&he(i)&&(t[n]=i)}})),t},_getPropertiesFromElement:function(e,t,n){var i,r=e.tagName.toLowerCase(),o={tag_name:r};le.indexOf(r)>-1&&!n&&("a"===r.toLowerCase()||"button"===r.toLowerCase()?o.$el_text=De(1024,pe(e)):o.$el_text=De(1024,oe(e)));var s=re(e);s.length>0&&(o.classes=s.split(" ").filter((function(e){return""!==e})));var a=null===(i=this.config)||void 0===i?void 0:i.element_attribute_ignorelist;W(e.attributes,(function(n){var i;fe(e)&&-1===["name","id","class"].indexOf(n.name)||null!=a&&a.includes(n.name)||!t&&he(n.value)&&(i=n.name,!O(i)||"_ngcontent"!==i.substring(0,10)&&"_nghost"!==i.substring(0,7))&&(o["attr__"+n.name]=De(1024,n.value))}));for(var u=1,c=1,l=e;l=this._previousElementSibling(l);)u++,l.tagName===e.tagName&&c++;return o.nth_child=u,o.nth_of_type=c,o},_getDefaultProperties:function(e){return{$event_type:e,$ce_version:1}},_extractCustomPropertyValue:function(e){var t=[];return W(document.querySelectorAll(e.css_selector),(function(e){var n;["input","select"].indexOf(e.tagName.toLowerCase())>-1?n=e.value:e.textContent&&(n=e.textContent),he(n)&&t.push(n)})),t.join(", ")},_getCustomProperties:function(e){var t=this,n={};return W(this._customProperties,(function(i){W(i.event_selectors,(function(r){W(document.querySelectorAll(r),(function(r){z(e,r)&&de(r)&&(n[i.name]=t._extractCustomPropertyValue(i))}))}))})),n},_getEventTarget:function(e){return x(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,i=this,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"$autocapture",o=this._getEventTarget(e);if(ue(o)&&(o=o.parentNode||null),"$autocapture"===r&&"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"),o&&function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:void 0;if(!e||ae(e,"html")||!se(e))return!1;if(null!=n&&n.url_allowlist){var i=window.location.href,r=n.url_allowlist;if(r&&!r.some((function(e){return i.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 s=n.element_allowlist;if(s&&!s.some((function(t){return e.tagName.toLowerCase()===t})))return!1}if(null!=n&&n.css_selector_allowlist){var a=n.css_selector_allowlist;if(a&&!a.some((function(t){return e.matches(t)})))return!1}for(var u=!1,c=[e],l=!0,d=e;d.parentNode&&!ae(d,"body");)if(ce(d.parentNode))c.push(d.parentNode.host),d=d.parentNode.host;else{if(!(l=d.parentNode||!1))break;if(le.indexOf(l.tagName.toLowerCase())>-1)u=!0;else{var f=window.getComputedStyle(l);f&&"pointer"===f.getPropertyValue("cursor")&&(u=!0)}c.push(l),d=l}var h=window.getComputedStyle(e);if(h&&"pointer"===h.getPropertyValue("cursor")&&"click"===t.type)return!0;var p=e.tagName.toLowerCase();switch(p){case"html":return!1;case"form":return"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&&(le.indexOf(p)>-1||"true"===e.getAttribute("contenteditable"))}}(o,e,this.config)){for(var s,a,u=[o],c=o;c.parentNode&&!ae(c,"body");)ce(c.parentNode)?(u.push(c.parentNode.host),c=c.parentNode.host):(u.push(c.parentNode),c=c.parentNode);var l,d=[],f={},h=!1;if(W(u,(function(e){var n=de(e);"a"===e.tagName.toLowerCase()&&(l=e.getAttribute("href"),l=n&&he(l)&&l),z(re(e).split(" "),"ph-no-capture")&&(h=!0),d.push(i._getPropertiesFromElement(e,t.config.mask_all_element_attributes,t.config.mask_all_text));var r=i._getAugmentPropertiesFromElement(e);G(f,r)})),t.config.mask_all_text||("a"===o.tagName.toLowerCase()||"button"===o.tagName.toLowerCase()?d[0].$el_text=pe(o):d[0].$el_text=oe(o)),l&&(d[0].attr__href=l),h)return!1;var p=G(this._getDefaultProperties(e.type),{$elements:d},null!==(s=d[0])&&void 0!==s&&s.$el_text?{$el_text:null===(a=d[0])||void 0===a?void 0:a.$el_text}:{},this._getCustomProperties(u),f);return t.capture(r,p),!0}},_navigate:function(e){window.location.href=e},_addDomEventHandlers:function(e){var t=this,n=function(n){n=n||window.event,t._captureEvent(n,e)};ne(document,"submit",n,!1,!0),ne(document,"change",n,!1,!0),ne(document,"click",n,!1,!0)},_customProperties:[],rageclicks:null,config:void 0,init:function(e){var t;$(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 ge(e.config.rageclick)},afterDecideResponse:function(e,t){var n=t.config.token;this._initializedTokens.indexOf(n)>-1?j.info('autocapture already initialized for token "'+n+'"'):(t.persistence&&t.persistence.register(c({},be,!!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=x(t)?10:t,n=x(n)?10:n;for(var i=0,r=0;r<e.length;r++)i+=e.charCodeAt(r);return i%t<n},isBrowserSupported:function(){return I(document.querySelectorAll)}};!function(e){for(var t in e)I(e[t])&&(e[t]=e[t].bind(e))}(Le),function(e){for(var t in e)I(e[t])&&(e[t]=J(e[t]))}(Le);var Ne,Be="$active_feature_flags",qe="$override_feature_flags",je="$feature_flag_payloads",He=function(e){var t,n={},i=m(function(e){for(var t=Object.keys(e),n=t.length,i=new Array(n);n--;)i[n]=[t[n],e[t[n]]];return i}(e||{}));try{for(i.s();!(t=i.n()).done;){var r=p(t.value,2),o=r[0],s=r[1];s&&(n[o]=s)}}catch(e){i.e(e)}finally{i.f()}return n},Ve=function(){function e(t){s(this,e),this.instance=t,this._override_warning=!1,this.featureFlagEventHandlers=[],this.reloadFeatureFlagsQueued=!1,this.reloadFeatureFlagsInAction=!1}return u(e,[{key:"getFlags",value:function(){return Object.keys(this.getFlagVariants())}},{key:"getFlagVariants",value:function(){var e=this.instance.get_property(Ie),t=this.instance.get_property(qe);if(!t)return e||{};for(var n=G({},e),i=Object.keys(t),r=0;r<i.length;r++)!1===t[i[r]]?delete n[i[r]]:n[i[r]]=t[i[r]];return this._override_warning||(j.warn(" Overriding feature flags!",{enabledFlags:e,overriddenFlags:t,finalFlags:n}),this._override_warning=!0),n}},{key:"getFlagPayloads",value:function(){return this.instance.get_property(je)||{}}},{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;this.setReloadingPaused(!0);var t=this.instance.config.token,n=this.instance.get_property(xe),i=this.instance.get_property(Oe),r=Z(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:i,disable_flags:this.instance.config.advanced_disable_feature_flags||void 0}));this.instance._send_request(this.instance.config.api_host+"/decide/?v=3",{data:r},{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,i=this.getFlagVariants()[e],r="".concat(i),o=this.instance.get_property(Te)||{};return!t.send_event&&"send_event"in t||e in o&&o[e].includes(r)||(F(o[e])?o[e].push(r):o[e]=[r],null===(n=this.instance.persistence)||void 0===n||n.register(c({},Te,o)),this.instance.capture("$feature_flag_called",{$feature_flag:e,$feature_flag_response:i})),i}j.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);j.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]:{},i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},o=e.featureFlags,s=e.featureFlagPayloads;if(o)if(F(o)){var a,u={};if(o)for(var l=0;l<o.length;l++)u[o[l]]=!0;t&&t.register((c(a={},Be,o),c(a,Ie,u),a))}else{var d,f=o,h=s;e.errorsWhileComputingFlags&&(f=r(r({},n),f),h=r(r({},i),h)),t&&t.register((c(d={},Be,Object.keys(He(f))),c(d,Ie,f||{}),c(d,je,h||{}),d))}}(e,this.instance.persistence,t,n),this._fireFeatureFlagsCallbacks()}}},{key:"override",value:function(e){if(!this.instance.__loaded||!this.instance.persistence)return j.uninitializedWarning("posthog.feature_flags.override");if(this._override_warning=!1,!1===e)this.instance.persistence.unregister(qe);else if(F(e)){for(var t={},n=0;n<e.length;n++)t[e[n]]=!0;this.instance.persistence.register(c({},qe,t))}else this.instance.persistence.register(c({},qe,e))}},{key:"onFeatureFlags",value:function(e){var t=this;if(this.addFeatureFlagsHandler(e),this.instance.decideEndpointWasHit){var n=this._prepareFeatureFlagsForCallbacks(),i=n.flags,r=n.flagVariants;e(i,r)}return function(){return t.removeFeatureFlagsHandler(e)}}},{key:"updateEarlyAccessFeatureEnrollment",value:function(e,t){var n,i,o=c({},"$feature_enrollment/".concat(e),t);this.instance.capture("$feature_enrollment_update",{$feature_flag:e,$feature_enrollment:t,$set:o}),this.setPersonPropertiesForFlags(o,!1);var s=r(r({},this.getFlagVariants()),{},c({},e,t));null===(n=this.instance.persistence)||void 0===n||n.register((c(i={},Be,Object.keys(He(s))),c(i,Ie,s),i)),this._fireFeatureFlagsCallbacks()}},{key:"getEarlyAccessFeatures",value:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]&&arguments[1],i=this.instance.get_property(Ee);if(i&&!n)return e(i);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 i,r=n.earlyAccessFeatures;return null===(i=t.instance.persistence)||void 0===i||i.register(c({},Ee,r)),e(r)}))}},{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(xe)||{};this.instance.register(c({},xe,r(r({},n),e))),t&&this.instance.reloadFeatureFlags()}},{key:"resetPersonPropertiesForFlags",value:function(){this.instance.unregister(xe)}},{key:"setGroupPropertiesForFlags",value:function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],n=this.instance.get_property(Oe)||{};0!==Object.keys(n).length&&Object.keys(n).forEach((function(t){n[t]=r(r({},n[t]),e[t]),delete e[t]})),this.instance.register(c({},Oe,r(r({},n),e))),t&&this.instance.reloadFeatureFlags()}},{key:"resetGroupPropertiesForFlags",value:function(e){if(e){var t=this.instance.get_property(Oe)||{};this.instance.register(c({},Oe,r(r({},t),{},c({},e,{}))))}else this.instance.unregister(Oe)}}]),e}(),Ue=/[a-z0-9][a-z0-9-]+\.[a-z]{2,}$/i,We={is_supported:function(){return!0},error:function(e){j.error("cookieStore error: "+e)},get:function(e){try{for(var t=e+"=",n=document.cookie.split(";").filter((function(e){return e.length})),i=0;i<n.length;i++){for(var r=n[i];" "==r.charAt(0);)r=r.substring(1,r.length);if(0===r.indexOf(t))return decodeURIComponent(r.substring(t.length,r.length))}}catch(e){}return null},parse:function(e){var t;try{t=JSON.parse(We.get(e))||{}}catch(e){}return t},set:function(e,t,n,i,r){try{var o="",s="",a="";if(i){var u=document.location.hostname.match(Ue),c=u?u[0]:"";o=c?"; domain=."+c:""}if(n){var l=new Date;l.setTime(l.getTime()+24*n*60*60*1e3),s="; expires="+l.toUTCString()}r&&(a="; secure");var d=e+"="+encodeURIComponent(JSON.stringify(t))+s+"; SameSite=Lax; path=/"+o+a;return document.cookie=d,d}catch(e){return}},remove:function(e,t){try{We.set(e,"",-1,t)}catch(e){return}}},Ge=null,ze={is_supported:function(){if(!R(Ge))return Ge;var e=!0;if(x(window))e=!1;else try{var t="__mplssupport__";ze.set(t,"xyz"),'"xyz"'!==ze.get(t)&&(e=!1),ze.remove(t)}catch(t){e=!1}return e||j.error("localStorage unsupported; falling back to cookie store"),Ge=e,e},error:function(e){j.error("localStorage error: "+e)},get:function(e){try{return window.localStorage.getItem(e)}catch(e){ze.error(e)}return null},parse:function(e){try{return JSON.parse(ze.get(e))||{}}catch(e){}return null},set:function(e,t){try{window.localStorage.setItem(e,JSON.stringify(t))}catch(e){ze.error(e)}},remove:function(e){try{window.localStorage.removeItem(e)}catch(e){ze.error(e)}}},Ye=["distinct_id",Fe,Pe],Qe=r(r({},ze),{},{parse:function(e){try{var t={};try{t=We.parse(e)||{}}catch(e){}var n=G(t,JSON.parse(ze.get(e)||"{}"));return ze.set(e,n),n}catch(e){}return null},set:function(e,t,n,i,r){try{ze.set(e,t);var o={};Ye.forEach((function(e){t[e]&&(o[e]=t[e])})),Object.keys(o).length&&We.set(e,o,n,i,r)}catch(e){ze.error(e)}},remove:function(e,t){try{window.localStorage.removeItem(e),We.remove(e,t)}catch(e){ze.error(e)}}}),Je={},Xe={is_supported:function(){return!0},error:function(e){j.error("memoryStorage error: "+e)},get:function(e){return Je[e]||null},parse:function(e){return Je[e]||null},set:function(e,t){Je[e]=t},remove:function(e){delete Je[e]}},Ke=null,Ze={is_supported:function(){if(!R(Ke))return Ke;if(Ke=!0,x(window))Ke=!1;else try{var e="__support__";Ze.set(e,"xyz"),'"xyz"'!==Ze.get(e)&&(Ke=!1),Ze.remove(e)}catch(e){Ke=!1}return Ke},error:function(e){j.error("sessionStorage error: ",e)},get:function(e){try{return window.sessionStorage.getItem(e)}catch(e){Ze.error(e)}return null},parse:function(e){try{return JSON.parse(Ze.get(e))||null}catch(e){}return null},set:function(e,t){try{window.sessionStorage.setItem(e,JSON.stringify(t))}catch(e){Ze.error(e)}},remove:function(e){try{window.sessionStorage.removeItem(e)}catch(e){Ze.error(e)}}},et=["localhost","127.0.0.1"],tt=function(e,t){for(var n,i=((e.split("#")[0]||"").split("?")[1]||"").split("&"),r=0;r<i.length;r++){var o=i[r].split("=");if(o[0]===t){n=o;break}}if(!F(n)||n.length<2)return"";var s=n[1];try{s=decodeURIComponent(s)}catch(e){j.error("Skipping decoding for malformed query param: "+s)}return s.replace(/\+/g," ")},nt=function(e,t){var n=e.match(new RegExp(t+"=([^&]*)"));return n?n[1]:null},it={campaignParams:function(e){var t=["utm_source","utm_medium","utm_campaign","utm_content","utm_term","gclid","fbclid","msclkid"].concat(e||[]),n={};return W(t,(function(e){var t=tt(N.URL,e);t.length&&(n[e]=t)})),n},searchEngine:function(){var e=N.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=it.searchEngine(),t="yahoo"!=e?"q":"p",n={};if(!R(e)){n.$search_engine=e;var i=tt(N.referrer,t);i.length&&(n.ph_keyword=i)}return n},browser:function(e,t,n){return t=t||"",n||z(e," OPR/")?z(e,"Mini")?"Opera Mini":"Opera":/(BlackBerry|PlayBook|BB10)/i.test(e)?"BlackBerry":z(e,"IEMobile")||z(e,"WPDesktop")?"Internet Explorer Mobile":z(e,"SamsungBrowser/")?"Samsung Internet":z(e,"Edge")||z(e,"Edg/")?"Microsoft Edge":z(e,"FBIOS")?"Facebook Mobile":z(e,"Chrome")?"Chrome":z(e,"CriOS")?"Chrome iOS":z(e,"UCWEB")||z(e,"UCBrowser")?"UC Browser":z(e,"FxiOS")?"Firefox iOS":z(t,"Apple")||function(e){return z(e,"Safari")&&!z(e,"Chrome")&&!z(e,"Android")}(e)?z(e,"Mobile")?"Mobile Safari":"Safari":z(e,"Android")?"Android Mobile":z(e,"Konqueror")||z(e,"konqueror")?"Konqueror":z(e,"Firefox")?"Firefox":z(e,"MSIE")||z(e,"Trident/")?"Internet Explorer":z(e,"Gecko")?"Mozilla":""},browserVersion:function(e,t,n){var i={"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+)?)/]}[it.browser(e,t,n)];if(x(i))return null;for(var r=0;r<i.length;r++){var o=i[r],s=e.match(o);if(s)return parseFloat(s[s.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 i=/Android (\d+)\.(\d+)\.?(\d+)?/i.exec(e);return i&&i[1]?{os_name:"Android",os_version:[i[1],i[2],i[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 r=/Mac OS X (\d+)[_.](\d+)[_.]?(\d+)?/i.exec(e);return r&&r[1]?{os_name:"Mac OS X",os_version:[r[1],r[2],r[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 N.referrer||"$direct"},referringDomain:function(){if(!N.referrer)return"$direct";var e=N.createElement("a");return e.href=N.referrer,e.host},properties:function(){var e,t,n,i,r,o,s,a=it.os(B),u=a.os_name,c=a.os_version;return G(X({$os:u,$os_version:c,$browser:it.browser(B,navigator.vendor,window.opera),$device:it.device(B),$device_type:it.deviceType(B)}),{$current_url:null===(e=window)||void 0===e?void 0:e.location.href,$host:null===(t=window)||void 0===t?void 0:t.location.host,$pathname:null===(n=window)||void 0===n?void 0:n.location.pathname,$raw_user_agent:B.length>1e3?B.substring(0,997)+"...":B,$browser_version:it.browserVersion(B,navigator.vendor,window.opera),$browser_language:it.browserLanguage(),$screen_height:null===(i=window)||void 0===i?void 0:i.screen.height,$screen_width:null===(r=window)||void 0===r?void 0:r.screen.width,$viewport_height:null===(o=window)||void 0===o?void 0:o.innerHeight,$viewport_width:null===(s=window)||void 0===s?void 0:s.innerWidth,$lib:"web",$lib_version:y.LIB_VERSION,$insert_id:Math.random().toString(36).substring(2,10)+Math.random().toString(36).substring(2,10),$time:Y()/1e3})},people_properties:function(){var e=it.os(B),t=e.os_name,n=e.os_version;return G(X({$os:t,$os_version:n,$browser:it.browser(B,navigator.vendor,window.opera)}),{$browser_version:it.browserVersion(B,navigator.vendor,window.opera)})}},rt=["cookie","localstorage","localstorage+cookie","sessionstorage","memory"],ot=function(){function e(t){s(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===rt.indexOf(t.persistence.toLowerCase())&&(j.critical("Unknown persistence type "+t.persistence+"; falling back to cookie"),t.persistence="cookie");var i=t.persistence.toLowerCase();"localstorage"===i&&ze.is_supported()?this.storage=ze:"localstorage+cookie"===i&&Qe.is_supported()?this.storage=Qe:"sessionstorage"===i&&Ze.is_supported()?this.storage=Ze:this.storage="memory"===i?Xe:We,this.user_state="anonymous",this.load(),this.update_config(t),this.save()}return u(e,[{key:"properties",value:function(){var e={};return W(this.props,(function(t,n){if(n===Ie&&E(t))for(var i=Object.keys(t),r=0;r<i.length;r++)e["$feature/".concat(i[r])]=t[i[r]];else s=n,a=!1,(R(o=Ae)?a:A&&o.indexOf===A?-1!=o.indexOf(s):(W(o,(function(e){if(a||(a=e===s))return H})),a))||(e[n]=t);var o,s,a})),e}},{key:"load",value:function(){if(!this.disabled){var e=this.storage.parse(this.name);e&&(this.props=G({},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 i=this;if(E(e)){x(t)&&(t="None"),this.expire_days=x(n)?this.default_expiry:n;var r=!1;if(W(e,(function(e,n){i.props.hasOwnProperty(n)&&i.props[n]!==t||(i.props[n]=e,r=!0)})),r)return this.save(),!0}return!1}},{key:"register",value:function(e,t){var n=this;if(E(e)){this.expire_days=x(t)?this.default_expiry:t;var i=!1;if(W(e,(function(t,r){e.hasOwnProperty(r)&&n.props[r]!==t&&(n.props[r]=t,i=!0)})),i)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(it.campaignParams(this.custom_campaign_params)),this.campaign_params_saved=!0)}},{key:"update_search_keyword",value:function(){this.register(it.searchInfo())}},{key:"update_referrer_info",value:function(){this.register({$referrer:this.props.$referrer||it.referrer(),$referring_domain:this.props.$referring_domain||it.referringDomain()})}},{key:"get_referrer_info",value:function(){return X({$referrer:this.props.$referrer,$referring_domain:this.props.$referring_domain})}},{key:"safe_merge",value:function(e){return W(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[ye]||{};n[e]=t,this.props[ye]=n,this.save()}},{key:"remove_event_timer",value:function(e){var t=(this.props[ye]||{})[e];return x(t)||(delete this.props[ye][e],this.save()),t}},{key:"get_user_state",value:function(){return this.props[$e]||"anonymous"}},{key:"set_user_state",value:function(e){this.props[$e]=e,this.save()}},{key:"get_quota_limits",value:function(){return this.props[Ce]||{}}},{key:"set_quota_limits",value:function(e){this.props[Ce]=e,this.save()}}]),e}(),st=2,at=4,ut=u((function e(t){var n,i,r=this,o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};s(this,e),c(this,"bucketSize",100),c(this,"refillRate",10),c(this,"mutationBuckets",{}),c(this,"loggedTracker",{}),c(this,"refillBuckets",(function(){Object.keys(r.mutationBuckets).forEach((function(e){r.mutationBuckets[e]=r.mutationBuckets[e]+r.refillRate,r.mutationBuckets[e]>=r.bucketSize&&delete r.mutationBuckets[e]}))})),c(this,"getNodeOrRelevantParent",(function(e){var t=r.rrweb.mirror.getNode(e);if("svg"!==(null==t?void 0:t.nodeName)&&t instanceof Element){var n=t.closest("svg");if(n)return[r.rrweb.mirror.getId(n),n]}return[e,t]})),c(this,"numberOfChanges",(function(e){var t,n,i,r,o,s,a,u;return(null!==(t=null===(n=e.removes)||void 0===n?void 0:n.length)&&void 0!==t?t:0)+(null!==(i=null===(r=e.attributes)||void 0===r?void 0:r.length)&&void 0!==i?i:0)+(null!==(o=null===(s=e.texts)||void 0===s?void 0:s.length)&&void 0!==o?o:0)+(null!==(a=null===(u=e.adds)||void 0===u?void 0:u.length)&&void 0!==a?a:0)})),c(this,"throttleMutations",(function(e){if(3!==e.type||0!==e.data.source)return e;var t=e.data,n=r.numberOfChanges(t);t.attributes&&(t.attributes=t.attributes.filter((function(e){var t,n,i,o=p(r.getNodeOrRelevantParent(e.id),2),s=o[0],a=o[1];return 0!==r.mutationBuckets[s]&&(r.mutationBuckets[s]=null!==(t=r.mutationBuckets[s])&&void 0!==t?t:r.bucketSize,r.mutationBuckets[s]=Math.max(r.mutationBuckets[s]-1,0),0===r.mutationBuckets[s]&&(r.loggedTracker[s]||(r.loggedTracker[s]=!0,null===(n=(i=r.options).onBlockedNode)||void 0===n||n.call(i,s,a))),e)})));var i=r.numberOfChanges(t);return 0!==i||n===i?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!==(i=this.options.bucketSize)&&void 0!==i?i:this.bucketSize,setInterval((function(){r.refillBuckets()}),1e3)})),ct=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}(ct||{});!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"}(Ne||(Ne={}));var lt=[Ne.MouseMove,Ne.MouseInteraction,Ne.Scroll,Ne.ViewportResize,Ne.Input,Ne.TouchMove,Ne.MediaInteraction,Ne.Drag],dt=function(){function e(t){var n=this;if(s(this,e),c(this,"isIdle",!1),c(this,"_linkedFlagSeen",!1),c(this,"_lastActivityTimestamp",Date.now()),c(this,"windowId",null),c(this,"sessionId",null),c(this,"_linkedFlag",null),c(this,"_sampleRate",null),c(this,"_minimumDuration",null),this.instance=t,this._captureStarted=!1,this._endpoint="/s/",this.stopRrweb=void 0,this.receivedDecide=!1,window.addEventListener("beforeunload",(function(){n._flushBuffer()})),!this.instance.sessionManager)throw j.error("Session recording started without valid sessionManager"),new Error("Session recording started without valid sessionManager. This is a bug.");this.buffer=this.clearBuffer()}return u(e,[{key:"started",get:function(){return this._captureStarted}},{key:"sessionManager",get:function(){if(!this.instance.sessionManager)throw j.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 T(this._sampleRate)?this.instance.get_property(Pe):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],i=this.sessionManager.checkAndGetSessionAndWindowId(!0).sessionStartTimestamp;return n?n.timestamp-i:null}},{key:"isRecordingEnabled",get:function(){var e=!!this.instance.get_property(we),t=!this.instance.config.disable_session_recording;return e&&t}},{key:"isConsoleLogCaptureEnabled",get:function(){var e=!!this.instance.get_property(ke),t=this.instance.config.enable_recording_console_log;return null!=t?t:e}},{key:"recordingVersion",get:function(){var e,t=this.instance.get_property(Se);return(null===(e=this.instance.config.session_recording)||void 0===e?void 0:e.recorderVersion)||t||"v1"}},{key:"status",get:function(){return this.receivedDecide?this.isRecordingEnabled?O(this._linkedFlag)&&!this._linkedFlagSeen?"buffering":$(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(T(this._sampleRate)){var i,r=this.isSampled;(i=n||!$(r)?Math.random()<this._sampleRate:r)||j.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(c({},Pe,i))}else{var o;null===(o=this.instance.persistence)||void 0===o||o.register(c({},Pe,null))}}},{key:"afterDecideResponse",value:function(e){var t,n,i,r,o,s,a,u=this;this.instance.persistence&&this.instance.persistence.register((c(a={},we,!!e.sessionRecording),c(a,ke,null===(o=e.sessionRecording)||void 0===o?void 0:o.consoleLogRecordingEnabled),c(a,Se,null===(s=e.sessionRecording)||void 0===s?void 0:s.recorderVersion),a));var l=null===(t=e.sessionRecording)||void 0===t?void 0:t.sampleRate;this._sampleRate=x(l)||R(l)?null:parseFloat(l);var d,f=null===(n=e.sessionRecording)||void 0===n?void 0:n.minimumDurationMilliseconds;if(this._minimumDuration=x(f)?null:f,this._linkedFlag=(null===(i=e.sessionRecording)||void 0===i?void 0:i.linkedFlag)||null,null!==(r=e.sessionRecording)&&void 0!==r&&r.endpoint&&(this._endpoint=null===(d=e.sessionRecording)||void 0===d?void 0:d.endpoint),T(this._sampleRate)&&this.sessionManager.onSessionId((function(e){u.makeSamplingDecision(e)})),O(this._linkedFlag)){var h=this._linkedFlag;this.instance.onFeatureFlags((function(e){u._linkedFlagSeen=e.includes(h)}))}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:Y()})}},{key:"startCaptureAndTrySendingQueuedSnapshots",value:function(){this._startCapture()}},{key:"_startCapture",value:function(){var e=this;if(!x(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?ie(this.instance.config.api_host+"/static/".concat(t,"?v=").concat(y.LIB_VERSION),(function(n){if(n)return j.error("Could not load ".concat(t),n);e._onScriptLoaded()})):this._onScriptLoaded()}}},{key:"_isInteractiveEvent",value:function(e){var t;return 3===e.type&&-1!==lt.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>3e5&&(this.isIdle=!0),t&&(this._lastActivityTimestamp=e.timestamp,this.isIdle&&(this.isIdle=!1,this._tryTakeFullSnapshot())),!this.isIdle){var n=this.sessionManager.checkAndGetSessionAndWindowId(!t,e.timestamp),i=n.windowId,r=n.sessionId,o=this.sessionId!==r,s=this.windowId!==i;-1===[st,at].indexOf(e.type)&&(s||o)&&this._tryTakeFullSnapshot(),this.windowId=i,this.sessionId=r}}},{key:"_tryTakeFullSnapshot",value:function(){if(!this._captureStarted)return!1;try{var e;return null===(e=this.rrwebRecord)||void 0===e||e.takeFullSnapshot(),!0}catch(e){return j.error("Error taking full snapshot.",e),!1}}},{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=window.rrweb?window.rrweb.record:window.rrwebRecord;for(var i=this.instance.config.session_recording,o=0,s=Object.entries(i||{});o<s.length;o++){var a=p(s[o],2),u=a[0],c=a[1];u in n&&(n[u]=c)}this.rrwebRecord?(this.mutationRateLimiter=null!==(e=this.mutationRateLimiter)&&void 0!==e?e:new ut(this.rrwebRecord,{onBlockedNode:function(e,n){var i="Too many mutations on node '".concat(e,"'. Rate limiting. This could be due to SVG animations or something similar");j.info(i,{node:n}),t.log("[PostHog Recorder] "+i,"warn")}}),this.stopRrweb=this.rrwebRecord(r({emit:function(e){t.onRRwebEmit(e)},plugins:window.rrwebConsoleRecord&&this.isConsoleLogCaptureEnabled?[window.rrwebConsoleRecord.getRecordConsolePlugin()]:[]},n)),this.instance._addCaptureHook((function(e){try{if("$pageview"===e){var n,i=t._maskUrl(window.location.href);if(!i)return;null===(n=t.rrwebRecord)||void 0===n||n.addCustomEvent("$pageview",{href:i})}}catch(e){j.error("Could not add $pageview to rrweb session",e)}})),this._lastActivityTimestamp=Date.now(),this.isIdle=!1):j.error("onScriptLoaded was called but rrwebRecord is not available. This indicates something has gone wrong.")}},{key:"onRRwebEmit",value:function(e){if(e&&E(e)){if(e.type===ct.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 i=function(e){var t=e;if(t&&E(t)&&6===t.type&&E(t.data)&&"rrweb/console@1"===t.data.plugin){t.data.payload.payload.length>10&&(t.data.payload.payload=t.data.payload.payload.slice(0,10),t.data.payload.payload.push("...[truncated]"));for(var n=[],i=0;i<t.data.payload.payload.length;i++)t.data.payload.payload[i]&&t.data.payload.payload[i].length>2e3?n.push(t.data.payload.payload[i].slice(0,2e3)+"...[truncated]"):n.push(t.data.payload.payload[i]);return t.data.payload.payload=n,e}return e}(n),r=JSON.stringify(i).length;if(this._updateWindowAndSessionIds(i),!this.isIdle){var o={$snapshot_bytes:r,$snapshot_data:i,$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,i={url:e};return null===(n=i=t.maskNetworkRequestFn(i))||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,i=T(t)&&T(n)&&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,i=2+((null===(t=this.buffer)||void 0===t?void 0:t.data.length)||0);(!this.buffer||this.buffer.size+e.$snapshot_bytes+i>943718.4||this.buffer.sessionId&&this.buffer.sessionId!==this.sessionId)&&(this.buffer=this._flushBuffer()),R(this.buffer.sessionId)&&!R(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===st}})}}]),e}(),ft={entryType:0,timeOrigin:1,name:2,startTime:3,redirectStart:4,redirectEnd:5,workerStart:6,fetchStart:7,domainLookupStart:8,domainLookupEnd:9,connectStart:10,secureConnectionStart:11,connectEnd:12,requestStart:13,responseStart:14,responseEnd:15,decodedBodySize:16,encodedBodySize:17,initiatorType:18,nextHopProtocol:19,renderBlockingStatus:20,responseStatus:21,transferSize:22,element:23,renderTime:24,loadTime:25,size:26,id:27,url:28,domComplete:29,domContentLoadedEvent:30,domInteractive:31,loadEventEnd:32,loadEventStart:33,redirectCount:34,navigationType:35,unloadEventEnd:36,unloadEventStart:37,duration:39,timestamp:40},ht=["first-input","navigation","paint","resource"],pt=["/s/","/e/"],_t=function(){function e(t){s(this,e),c(this,"_forceAllowLocalhost",!1),this.instance=t}return u(e,[{key:"startObservingIfEnabled",value:function(){this.isEnabled()?this.startObserving():this.stopObserving()}},{key:"startObserving",value:function(){var e,t,n=this;if(!this.observer)if(x(null===(e=window)||void 0===e||null===(t=e.PerformanceObserver)||void 0===t?void 0:t.supportedEntryTypes))j.info("[PerformanceObserver] not started because PerformanceObserver is not supported by this browser.");else if(!et.includes(location.hostname)||this._forceAllowLocalhost)try{this.observer=new PerformanceObserver((function(e){e.getEntries().forEach((function(e){n._capturePerformanceEvent(e)}))}));var i=PerformanceObserver.supportedEntryTypes.filter((function(e){return ht.includes(e)}));i.forEach((function(e){var t;null===(t=n.observer)||void 0===t||t.observe({type:e,buffered:!0})}))}catch(e){j.error("PostHog failed to start performance observer",e),this.stopObserving()}else j.info("[PerformanceObserver] not started because we are on localhost.")}},{key:"stopObserving",value:function(){this.observer&&(this.observer.disconnect(),this.observer=void 0)}},{key:"isObserving",value:function(){return!!this.observer}},{key:"isEnabled",value:function(){var e,t;return null!==(e=null!==(t=this.instance.config.capture_performance)&&void 0!==t?t:this.remoteEnabled)&&void 0!==e&&e}},{key:"afterDecideResponse",value:function(e){this.remoteEnabled=e.capturePerformance||!1,this.isEnabled()&&this.startObserving()}},{key:"_capturePerformanceEvent",value:function(e){if(0===e.name.indexOf(this.instance.config.api_host)){var t=e.name.replace(this.instance.config.api_host,"");if(pt.find((function(e){return 0===t.indexOf(e)})))return}var n={url:e.name},i=this.instance.config.session_recording;if(i.maskNetworkRequestFn&&(n=i.maskNetworkRequestFn(n)),n){var r=e.toJSON();r.name=n.url;var o={},s=Math.floor(Date.now()-performance.now());for(var a in o[ft.timeOrigin]=s,o[ft.timestamp]=Math.floor(s+e.startTime),ft)x(r[a])||(o[ft[a]]=r[a]);if(this.capturePerformanceEvent(o),gt(e)){var u,l=m(e.serverTiming||[]);try{for(l.s();!(u=l.n()).done;){var d,f=u.value;this.capturePerformanceEvent((c(d={},ft.timeOrigin,s),c(d,ft.timestamp,Math.floor(s+e.startTime)),c(d,ft.name,f.name),c(d,ft.duration,f.duration),c(d,ft.entryType,"serverTiming"),d))}}catch(e){l.e(e)}finally{l.f()}}}}},{key:"capturePerformanceEvent",value:function(e){var t,n=e[ft.timestamp];null===(t=this.instance.sessionRecording)||void 0===t||t.onRRwebEmit({type:6,data:{plugin:"posthog/network@1",payload:e},timestamp:n})}}]),e}(),gt=function(e){return"navigation"===e.entryType||"resource"===e.entryType},vt=function(){function e(t){s(this,e),this.instance=t,this.instance.decideEndpointWasHit=this.instance._hasBootstrappedFeatureFlags()}return u(e,[{key:"call",value:function(){var e=this,t=Z(JSON.stringify({token:this.instance.config.token,distinct_id:this.instance.get_distinct_id(),groups:this.instance.getGroups(),person_properties:this.instance.get_property(xe),group_properties:this.instance.get_property(Oe),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,i,r,o=this;if(this.instance.featureFlags.setReloadingPaused(!1),this.instance.featureFlags._startReloadTimer(),0!==(null==e?void 0:e.status)){if(!document||!document.body)return j.info("document not ready yet, trying again in 500 milliseconds..."),void setTimeout((function(){o.parseDecideResponse(e)}),500);this.instance.toolbar.afterDecideResponse(e),null===(t=this.instance.sessionRecording)||void 0===t||t.afterDecideResponse(e),Le.afterDecideResponse(e,this.instance),null===(n=this.instance.webPerformance)||void 0===n||n.afterDecideResponse(e),this.instance._afterDecideResponse(e),this.instance.config.advanced_disable_feature_flags_on_first_load||this.instance.featureFlags.receivedFeatureFlags(e);var s=null===(i=window)||void 0===i?void 0:i.extendPostHogWithSurveys;e.surveys&&!s&&ie(this.instance.config.api_host+"/static/surveys.js",(function(e){if(e)return j.error("Could not load surveys script",e);window.extendPostHogWithSurveys(o.instance)}));var a=null===(r=window)||void 0===r?void 0:r.extendPostHogWithExceptionAutoCapture;if(e.autocaptureExceptions&&e.autocaptureExceptions&&x(a)&&ie(this.instance.config.api_host+"/static/exception-autocapture.js",(function(t){if(t)return j.error("Could not load exception autocapture script",t);window.extendPostHogWithExceptionAutocapture(o.instance,e)})),e.siteApps)if(this.instance.config.opt_in_site_apps){var u,c=this.instance.config.api_host,l=m(e.siteApps);try{var d=function(){var e=u.value,t=e.id,n=e.url,i=[c,"/"===c[c.length-1]&&"/"===n[0]?n.substring(1):n].join("");window["__$$ph_site_app_".concat(t)]=o.instance,ie(i,(function(e){e&&j.error("Error while initializing PostHog app with config id ".concat(t),e)}))};for(l.s();!(u=l.n()).done;)d()}catch(e){l.e(e)}finally{l.f()}}else e.siteApps.length>0&&j.error('PostHog site apps are disabled. Enable the "opt_in_site_apps" config to proceed.')}else j.error("Failed to fetch feature flags from PostHog.")}}]),e}(),mt=["https://app.posthog.com","https://eu.posthog.com"],yt=["source"],bt=D.location?nt(D.location.hash,"__posthog")||nt(location.hash,"state"):null,wt=function(){function e(t){s(this,e),this.instance=t}return u(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(r({},t))}},{key:"maybeLoadToolbar",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:D.location,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:void 0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:D.history;try{if(!t){try{D.localStorage.setItem("test","test"),D.localStorage.removeItem("test")}catch(e){return!1}t=D.localStorage}var i,r=bt||nt(e.hash,"__posthog")||nt(e.hash,"state"),o=r?Q((function(){return JSON.parse(atob(decodeURIComponent(r)))}))||Q((function(){return JSON.parse(decodeURIComponent(r))})):null;return o&&"ph_authorize"===o.action?((i=o).source="url",i&&Object.keys(i).length>0&&(o.desiredHash?e.hash=o.desiredHash:n?n.replaceState("",document.title,e.pathname+e.search):e.hash="")):((i=JSON.parse(t.getItem("_postHogToolbarParams")||"{}")).source="localstorage",delete i.userIntent),!(!i.token||this.instance.config.token!==i.token)&&(this.loadToolbar(i),!0)}catch(e){return!1}}},{key:"loadToolbar",value:function(e){var t=this;if(D._postHogToolbarLoaded)return!1;D._postHogToolbarLoaded=!0;var n=this.instance.config.api_host,i=3e5,o=Math.floor(Date.now()/i)*i,s="".concat(n).concat(n.endsWith("/")?"":"/","static/toolbar.js?t=").concat(o),a=!mt.includes(this.instance.config.api_host)&&this.instance.config.advanced_disable_toolbar_metrics,u=r(r({token:this.instance.config.token},e),{},{apiURL:n},a?{instrument:!1}:{});u.source;var c=function(e,t){if(null==e)return{};var n,i,r=function(e,t){if(null==e)return{};var n,i,r={},o=Object.keys(e);for(i=0;i<o.length;i++)n=o[i],t.indexOf(n)>=0||(r[n]=e[n]);return r}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(i=0;i<o.length;i++)n=o[i],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}(u,yt);return D.localStorage.setItem("_postHogToolbarParams",JSON.stringify(c)),ie(s,(function(e){e?j.error("Failed to load toolbar",e):(D.ph_load_toolbar||D.ph_load_editor)(u,t.instance)})),ne(D,"turbolinks:load",(function(){D._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]:D.location,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:void 0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:D.history;return this.maybeLoadToolbar(e,t,n)}}]),e}(),kt="__ph_opt_in_out_";function St(e,t){Tt(!0,e,t)}function Ft(e,t){Tt(!1,e,t)}function Pt(e,t){return"1"===Rt(e,t)}function It(e,t){return!!function(e){if(e&&e.respectDnt){var t=e&&e.window||D,n=t.navigator||{},i=!1;return W([n.doNotTrack,n.msDoNotTrack,t.doNotTrack],(function(e){z([!0,1,"1","yes"],e)&&(i=!0)})),i}return!1}(t)||"0"===Rt(e,t)}function Et(e,t){xt(t=t||{}).remove(Ot(e,t),!!t.crossSubdomainCookie)}function xt(e){return"localStorage"===(e=e||{}).persistenceType?ze:"localStorage+cookie"===e.persistenceType?Qe:We}function Ot(e,t){return((t=t||{}).persistencePrefix||kt)+e}function Rt(e,t){return xt(t).get(Ot(e,t))}function Tt(e,t,n){O(t)&&t.length?(xt(n=n||{}).set(Ot(t,n),e?1:0,T(n.cookieExpiration)?n.cookieExpiration:null,n.crossSubdomainCookie,n.secureCookie),n.capture&&e&&n.capture(n.captureEventName||"$opt_in",n.captureProperties||{},{send_instantly:!0})):j.error("gdpr."+(e?"optIn":"optOut")+" called with an invalid token")}var $t=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:3e3;s(this,e),this.isPolling=!0,this._event_queue=[],this._empty_queue_count=0,this._poller=void 0,this._pollInterval=t}return u(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}(),Ct=function(e){l(n,$t);var t=h(n);function n(e){var i,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:3e3;return s(this,n),(i=t.call(this,r)).handlePollRequest=e,i}return u(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 i=t[n],r=i.url,o=i.data,s=i.options;W(o,(function(t,n){o[n].offset=Math.abs(o[n].timestamp-e.getTime()),delete o[n].timestamp})),e.handlePollRequest(r,o,s)};for(var i in t)n(i);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(_(n.filter((function(e){return 0===e.url.indexOf("/e")}))),_(n.filter((function(e){return 0!==e.url.indexOf("/e")})))).map((function(t){var n=t.url,i=t.data,o=t.options;e.handlePollRequest(n,i,r(r({},o),{},{transport:"sendBeacon"}))}))}},{key:"formatQueue",value:function(){var e={};return W(this._event_queue,(function(t){var n=t.url,i=t.data,r=t.options,o=(r?r._batchKey:null)||n;x(e[o])&&(e[o]={data:[],url:n,options:r}),r&&e[o].options&&e[o].options._metrics&&!e[o].options._metrics.rrweb_full_snapshot&&(e[o].options._metrics.rrweb_full_snapshot=r._metrics.rrweb_full_snapshot),e[o].data.push(i)})),e}}]),n}(),Mt=Uint8Array,At=Uint16Array,Dt=Uint32Array,Lt=new Mt([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]),Nt=new Mt([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]),Bt=new Mt([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),qt=function(e,t){for(var n=new At(31),i=0;i<31;++i)n[i]=t+=1<<e[i-1];var r=new Dt(n[30]);for(i=1;i<30;++i)for(var o=n[i];o<n[i+1];++o)r[o]=o-n[i]<<5|i;return[n,r]},jt=qt(Lt,2),Ht=jt[0],Vt=jt[1];Ht[28]=258,Vt[258]=28;for(var Ut=qt(Nt,0)[1],Wt=new At(32768),Gt=0;Gt<32768;++Gt){var zt=(43690&Gt)>>>1|(21845&Gt)<<1;zt=(61680&(zt=(52428&zt)>>>2|(13107&zt)<<2))>>>4|(3855&zt)<<4,Wt[Gt]=((65280&zt)>>>8|(255&zt)<<8)>>>1}var Yt=function(e,t,n){for(var i=e.length,r=0,o=new At(t);r<i;++r)++o[e[r]-1];var s,a=new At(t);for(r=0;r<t;++r)a[r]=a[r-1]+o[r-1]<<1;if(n){s=new At(1<<t);var u=15-t;for(r=0;r<i;++r)if(e[r])for(var c=r<<4|e[r],l=t-e[r],d=a[e[r]-1]++<<l,f=d|(1<<l)-1;d<=f;++d)s[Wt[d]>>>u]=c}else for(s=new At(i),r=0;r<i;++r)s[r]=Wt[a[e[r]-1]++]>>>15-e[r];return s},Qt=new Mt(288);for(Gt=0;Gt<144;++Gt)Qt[Gt]=8;for(Gt=144;Gt<256;++Gt)Qt[Gt]=9;for(Gt=256;Gt<280;++Gt)Qt[Gt]=7;for(Gt=280;Gt<288;++Gt)Qt[Gt]=8;var Jt=new Mt(32);for(Gt=0;Gt<32;++Gt)Jt[Gt]=5;var Xt,Kt=Yt(Qt,9,0),Zt=Yt(Jt,5,0),en=function(e){return(e/8>>0)+(7&e&&1)},tn=function(e,t,n){(null==t||t<0)&&(t=0),(null==n||n>e.length)&&(n=e.length);var i=new(e instanceof At?At:e instanceof Dt?Dt:Mt)(n-t);return i.set(e.subarray(t,n)),i},nn=function(e,t,n){n<<=7&t;var i=t/8>>0;e[i]|=n,e[i+1]|=n>>>8},rn=function(e,t,n){n<<=7&t;var i=t/8>>0;e[i]|=n,e[i+1]|=n>>>8,e[i+2]|=n>>>16},on=function(e,t){for(var n=[],i=0;i<e.length;++i)e[i]&&n.push({s:i,f:e[i]});var r=n.length,o=n.slice();if(!r)return[new Mt(0),0];if(1==r){var s=new Mt(n[0].s+1);return s[n[0].s]=1,[s,1]}n.sort((function(e,t){return e.f-t.f})),n.push({s:-1,f:25001});var a=n[0],u=n[1],c=0,l=1,d=2;for(n[0]={s:-1,f:a.f+u.f,l:a,r:u};l!=r-1;)a=n[n[c].f<n[d].f?c++:d++],u=n[c!=l&&n[c].f<n[d].f?c++:d++],n[l++]={s:-1,f:a.f+u.f,l:a,r:u};var f=o[0].s;for(i=1;i<r;++i)o[i].s>f&&(f=o[i].s);var h=new At(f+1),p=sn(n[l-1],h,0);if(p>t){i=0;var _=0,g=p-t,v=1<<g;for(o.sort((function(e,t){return h[t.s]-h[e.s]||e.f-t.f}));i<r;++i){var m=o[i].s;if(!(h[m]>t))break;_+=v-(1<<p-h[m]),h[m]=t}for(_>>>=g;_>0;){var y=o[i].s;h[y]<t?_-=1<<t-h[y]++-1:++i}for(;i>=0&&_;--i){var b=o[i].s;h[b]==t&&(--h[b],++_)}p=t}return[new Mt(h),p]},sn=function e(t,n,i){return-1==t.s?Math.max(e(t.l,n,i+1),e(t.r,n,i+1)):n[t.s]=i},an=function(e){for(var t=e.length;t&&!e[--t];);for(var n=new At(++t),i=0,r=e[0],o=1,s=function(e){n[i++]=e},a=1;a<=t;++a)if(e[a]==r&&a!=t)++o;else{if(!r&&o>2){for(;o>138;o-=138)s(32754);o>2&&(s(o>10?o-11<<5|28690:o-3<<5|12305),o=0)}else if(o>3){for(s(r),--o;o>6;o-=6)s(8304);o>2&&(s(o-3<<5|8208),o=0)}for(;o--;)s(r);o=1,r=e[a]}return[n.subarray(0,i),t]},un=function(e,t){for(var n=0,i=0;i<t.length;++i)n+=e[i]*t[i];return n},cn=function(e,t,n){var i=n.length,r=en(t+2);e[r]=255&i,e[r+1]=i>>>8,e[r+2]=255^e[r],e[r+3]=255^e[r+1];for(var o=0;o<i;++o)e[r+o+4]=n[o];return 8*(r+4+i)},ln=function(e,t,n,i,r,o,s,a,u,c,l){nn(t,l++,n),++r[256];for(var d=on(r,15),f=d[0],h=d[1],p=on(o,15),_=p[0],g=p[1],v=an(f),m=v[0],y=v[1],b=an(_),w=b[0],k=b[1],S=new At(19),F=0;F<m.length;++F)S[31&m[F]]++;for(F=0;F<w.length;++F)S[31&w[F]]++;for(var P=on(S,7),I=P[0],E=P[1],x=19;x>4&&!I[Bt[x-1]];--x);var O,R,T,$,C=c+5<<3,M=un(r,Qt)+un(o,Jt)+s,A=un(r,f)+un(o,_)+s+14+3*x+un(S,I)+(2*S[16]+3*S[17]+7*S[18]);if(C<=M&&C<=A)return cn(t,l,e.subarray(u,u+c));if(nn(t,l,1+(A<M)),l+=2,A<M){O=Yt(f,h,0),R=f,T=Yt(_,g,0),$=_;var D=Yt(I,E,0);for(nn(t,l,y-257),nn(t,l+5,k-1),nn(t,l+10,x-4),l+=14,F=0;F<x;++F)nn(t,l+3*F,I[Bt[F]]);l+=3*x;for(var L=[m,w],N=0;N<2;++N){var B=L[N];for(F=0;F<B.length;++F){var q=31&B[F];nn(t,l,D[q]),l+=I[q],q>15&&(nn(t,l,B[F]>>>5&127),l+=B[F]>>>12)}}}else O=Kt,R=Qt,T=Zt,$=Jt;for(F=0;F<a;++F)if(i[F]>255){q=i[F]>>>18&31,rn(t,l,O[q+257]),l+=R[q+257],q>7&&(nn(t,l,i[F]>>>23&31),l+=Lt[q]);var j=31&i[F];rn(t,l,T[j]),l+=$[j],j>3&&(rn(t,l,i[F]>>>5&8191),l+=Nt[j])}else rn(t,l,O[i[F]]),l+=R[i[F]];return rn(t,l,O[256]),l+R[256]},dn=new Dt([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),fn=new Mt(0),hn=function(){for(var e=new Dt(256),t=0;t<256;++t){for(var n=t,i=9;--i;)n=(1&n&&3988292384)^n>>>1;e[t]=n}return e}(),pn=function(e,t,n){for(;n;++t)e[t]=n,n>>>=8};function _n(e,t){void 0===t&&(t={});var n=function(){var e=4294967295;return{p:function(t){for(var n=e,i=0;i<t.length;++i)n=hn[255&n^t[i]]^n>>>8;e=n},d:function(){return 4294967295^e}}}(),i=e.length;n.p(e);var r=function(e,t,n,i,r){return function(e,t,n,i,r,o){var s=e.length,a=new Mt(i+s+5*(1+Math.floor(s/7e3))+r),u=a.subarray(i,a.length-r),c=0;if(!t||s<8)for(var l=0;l<=s;l+=65535){var d=l+65535;d<s?c=cn(u,c,e.subarray(l,d)):(u[l]=o,c=cn(u,c,e.subarray(l,s)))}else{for(var f=dn[t-1],h=f>>>13,p=8191&f,_=(1<<n)-1,g=new At(32768),v=new At(_+1),m=Math.ceil(n/3),y=2*m,b=function(t){return(e[t]^e[t+1]<<m^e[t+2]<<y)&_},w=new Dt(25e3),k=new At(288),S=new At(32),F=0,P=0,I=(l=0,0),E=0,x=0;l<s;++l){var O=b(l),R=32767&l,T=v[O];if(g[R]=T,v[O]=R,E<=l){var $=s-l;if((F>7e3||I>24576)&&$>423){c=ln(e,u,0,w,k,S,P,I,x,l-x,c),I=F=P=0,x=l;for(var C=0;C<286;++C)k[C]=0;for(C=0;C<30;++C)S[C]=0}var M=2,A=0,D=p,L=R-T&32767;if($>2&&O==b(l-L))for(var N=Math.min(h,$)-1,B=Math.min(32767,l),q=Math.min(258,$);L<=B&&--D&&R!=T;){if(e[l+M]==e[l+M-L]){for(var j=0;j<q&&e[l+j]==e[l+j-L];++j);if(j>M){if(M=j,A=L,j>N)break;var H=Math.min(L,j-2),V=0;for(C=0;C<H;++C){var U=l-L+C+32768&32767,W=U-g[U]+32768&32767;W>V&&(V=W,T=U)}}}L+=(R=T)-(T=g[R])+32768&32767}if(A){w[I++]=268435456|Vt[M]<<18|Ut[A];var G=31&Vt[M],z=31&Ut[A];P+=Lt[G]+Nt[z],++k[257+G],++S[z],E=l+M,++F}else w[I++]=e[l],++k[e[l]]}}c=ln(e,u,o,w,k,S,P,I,x,l-x,c),o||(c=cn(u,c,fn))}return tn(a,0,i+en(c)+r)}(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,i,!r)}(e,t,function(e){return 10+(e.filename&&e.filename.length+1||0)}(t),8),o=r.length;return 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&&pn(e,4,Math.floor(new Date(t.mtime||Date.now())/1e3)),n){e[3]=8;for(var i=0;i<=n.length;++i)e[i+10]=n.charCodeAt(i)}}(r,t),pn(r,o-8,n.d()),pn(r,o-4,i),r}function gn(e,t){var n=e.length;if(!t&&"undefined"!=typeof TextEncoder)return(new TextEncoder).encode(e);for(var i=new Mt(e.length+(e.length>>>1)),r=0,o=function(e){i[r++]=e},s=0;s<n;++s){if(r+5>i.length){var a=new Mt(r+8+(n-s<<1));a.set(i),i=a}var u=e.charCodeAt(s);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(++s))>>>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 tn(i,0,r)}!function(e){e.GZipJS="gzip-js",e.Base64="base64"}(Xt||(Xt={}));var vn=function(e,t,n){var i=t||{};i.ip=n.ip?1:0,i._=(new Date).getTime().toString(),i.ver=y.LIB_VERSION;var r=e.split("?");if(r.length>1){var o,s=m(r[1].split("&"));try{for(s.s();!(o=s.n()).done;){var a=o.value.split("=")[0];x(i[a])||delete i[a]}}catch(e){s.e(e)}finally{s.f()}}var u=e.indexOf("?")>-1?"&":"?";return e+u+function(e){var t,n,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"&",r=[];return W(e,(function(e,i){x(e)||x(i)||"undefined"===i||(t=encodeURIComponent(e.toString()),n=encodeURIComponent(i),r[r.length]=n+"="+t)})),r.join(i)}(i)},mn=function e(t,n){if(n.blob&&t.buffer)return new Blob([P(t)?t:t.buffer],{type:"text/plain"});if(n.sendBeacon||n.blob){var i=e(t,{method:"POST"});return new Blob([i],{type:"application/x-www-form-urlencoded"})}return"POST"!==n.method?null:(r=F(t)||P(t)?"data="+encodeURIComponent(t):"data="+encodeURIComponent(t.data),"compression"in t&&t.compression&&(r+="&compression="+t.compression),r);var r},yn=function(e){var t=e.url,n=e.data,i=e.headers,r=e.options,o=e.callback,s=e.retriesPerformedSoFar,a=e.retryQueue,u=e.onXHRError,c=e.timeout,l=void 0===c?6e4:c,d=e.onResponse;T(s)&&s>0&&(t=vn(t,{retry_count:s},{}));var f=new XMLHttpRequest;f.open(r.method||"GET",t,!0);var h=mn(n,r);W(i,(function(e,t){f.setRequestHeader(t,e)})),"POST"!==r.method||r.blob||f.setRequestHeader("Content-Type","application/x-www-form-urlencoded"),f.timeout=l,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 j.error(e)}o(e)}}else I(u)&&u(f),(f.status<400||f.status>500)&&a.enqueue({url:t,data:n,options:r,headers:i,retriesPerformedSoFar:(s||0)+1,callback:o}),null==o||o({status:0})},f.send(h)},bn=function(e){l(n,$t);var t=h(n);function n(e,i){var r;return s(this,n),(r=t.call(this)).isPolling=!1,r.queue=[],r.areWeOnline=!0,r.onXHRError=e,r.rateLimiter=i,!x(window)&&"onLine"in window.navigator&&(r.areWeOnline=window.navigator.onLine,window.addEventListener("online",(function(){r._handleWeAreNowOnline()})),window.addEventListener("offline",(function(){r.areWeOnline=!1}))),r}return u(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,i=Math.min(18e5,t),r=(Math.random()-.5)*(i-n);return Math.ceil(i+r)}(t),i=new Date(Date.now()+n);this.queue.push({retryAt:i,requestData:e});var r="Enqueued failed request for retry in ".concat(n);navigator.onLine||(r+=" (Browser is offline)"),j.warn(r),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,i=m(t);try{for(i.s();!(n=i.n()).done;){var r=n.value.requestData;this._executeXhrRequest(r)}}catch(e){i.e(e)}finally{i.f()}}}},{key:"unload",value:function(){this._poller&&(clearTimeout(this._poller),this._poller=void 0);var e,t=m(this.queue);try{for(t.s();!(e=t.n()).done;){var n=e.value.requestData,i=n.url,o=n.data,s=n.options;if(this.rateLimiter.isRateLimited(s._batchKey))j.warn("[RetryQueue] is quota limited. Dropping request.");else try{window.navigator.sendBeacon(i,mn(o,r(r({},s),{},{sendBeacon:!0})))}catch(e){j.error(e)}}}catch(e){t.e(e)}finally{t.f()}this.queue=[]}},{key:"_executeXhrRequest",value:function(e){var t=e.url,n=e.data,i=e.options,r=e.headers,o=e.callback,s=e.retriesPerformedSoFar;this.rateLimiter.isRateLimited(i._batchKey)||yn({url:t,data:n||{},options:i||{},headers:r||{},retriesPerformedSoFar:s||0,callback:o,retryQueue:this,onXHRError:this.onXHRError,onResponse:this.rateLimiter.checkForLimiting})}},{key:"_handleWeAreNowOnline",value:function(){this.areWeOnline=!0,this.flush()}}]),n}();Math.trunc||(Math.trunc=function(e){return e<0?Math.ceil(e):Math.floor(e)}),Number.isInteger||(Number.isInteger=function(e){return T(e)&&isFinite(e)&&Math.floor(e)===e});var wn="0123456789abcdef",kn=function(){function e(t){if(s(this,e),this.bytes=t,16!==t.length)throw new TypeError("not 128-bit length")}return u(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,i,r){if(!Number.isInteger(t)||!Number.isInteger(n)||!Number.isInteger(i)||!Number.isInteger(r)||t<0||n<0||i<0||r<0||t>0xffffffffffff||n>4095||i>1073741823||r>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|i>>>24,o[9]=i>>>16,o[10]=i>>>8,o[11]=i,o[12]=r>>>24,o[13]=r>>>16,o[14]=r>>>8,o[15]=r,new e(o)}}]),e}(),Sn=function(){function e(){s(this,e),c(this,"timestamp",0),c(this,"counter",0),c(this,"random",new In)}return u(e,[{key:"generate",value:function(){var e=this.generateOrAbort();if(x(e)){this.timestamp=0;var t=this.generateOrAbort();if(x(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 kn.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}(),Fn=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};!x(D.crypto)&&crypto.getRandomValues&&(Fn=function(e){return crypto.getRandomValues(e)});var Pn,In=function(){function e(){s(this,e),c(this,"buffer",new Uint32Array(8)),c(this,"cursor",1/0)}return u(e,[{key:"nextUint32",value:function(){return this.cursor>=this.buffer.length&&(Fn(this.buffer),this.cursor=0),this.buffer[this.cursor++]}}]),e}(),En=function(){return xn().toString()},xn=function(){return(Pn||(Pn=new Sn)).generate()},On=1800,Rn=function(){function e(t,n,i,r){s(this,e),c(this,"_sessionIdChangedHandlers",[]),this.config=t,this.persistence=n,this._windowId=void 0,this._sessionId=void 0,this._sessionStartTimestamp=null,this._sessionActivityTimestamp=null,this._sessionIdGenerator=i||En,this._windowIdGenerator=r||En;var o=t.persistence_name||t.token,a=t.session_idle_timeout_seconds||On;if(T(a)?a>On?j.warn("session_idle_timeout_seconds cannot be greater than 30 minutes. Using 30 minutes instead."):a<60&&j.warn("session_idle_timeout_seconds cannot be less than 60 seconds. Using 60 seconds instead."):(j.warn("session_idle_timeout_seconds must be a number. Defaulting to 30 minutes."),a=On),this._sessionTimeoutMs=1e3*Math.min(Math.max(a,60),On),this._window_id_storage_key="ph_"+o+"_window_id",this._primary_window_exists_storage_key="ph_"+o+"_primary_window_exists",this._canUseSessionStorage()){var u=Ze.parse(this._window_id_storage_key),l=Ze.parse(this._primary_window_exists_storage_key);u&&!l?this._windowId=u:Ze.remove(this._window_id_storage_key),Ze.set(this._primary_window_exists_storage_key,!0)}this._listenToReloadWindow()}return u(e,[{key:"onSessionId",value:function(e){var t=this;return x(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&&Ze.is_supported()}},{key:"_setWindowId",value:function(e){e!==this._windowId&&(this._windowId=e,this._canUseSessionStorage()&&Ze.set(this._window_id_storage_key,e))}},{key:"_getWindowId",value:function(){return this._windowId?this._windowId:this._canUseSessionStorage()?Ze.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(c({},Fe,[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[Fe];return F(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;D.addEventListener("beforeunload",(function(){e._canUseSessionStorage()&&Ze.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=p(this._getSessionId(),3),i=n[0],r=n[1],o=n[2],s=this._getWindowId(),a=o&&o>0&&Math.abs(t-o)>864e5,u=!1,c=!r,l=!e&&Math.abs(t-i)>this._sessionTimeoutMs;c||l||a?(r=this._sessionIdGenerator(),s=this._windowIdGenerator(),o=t,u=!0):s||(s=this._windowIdGenerator(),u=!0);var d=0===i||!e||a?t:i,f=0===o?(new Date).getTime():o;return this._setWindowId(s),this._setSessionId(r,d,f),u&&this._sessionIdChangedHandlers.forEach((function(e){return e(r,s)})),{sessionId:r,windowId:s,sessionStartTimestamp:f}}}]),e}(),Tn=u((function e(t,n,i,r){s(this,e),this.name="posthog-js",this.setupOnce=function(e){e((function(e){var o,s,a,u,c;if("error"!==e.level||!t.__loaded)return e;e.tags||(e.tags={});var l=t.config.ui_host||t.config.api_host;e.tags["PostHog Person URL"]=l+"/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===(s=d[0])||void 0===s?void 0:s.value,$exception_type:null===(a=d[0])||void 0===a?void 0:a.type,$exception_personURL:l+"/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===(c=d[0])||void 0===c?void 0:c.type,$sentry_tags:e.tags};return n&&i&&(f.$sentry_url=(r||"https://sentry.io/organizations/")+n+"/issues/?project="+i+"&query="+e.event_id),t.capture("$exception",f),e}))}})),$n=function(){function e(){var t=this;s(this,e),c(this,"_hasSeenPageView",!1),c(this,"_updateScrollData",(function(){var e,n,i,r;t._pageViewData||(t._pageViewData=t._createPageViewData());var o=t._pageViewData,s=t._scrollY(),a=t._scrollHeight(),u=t._contentY(),c=t._contentHeight();o.lastScrollY=s,o.maxScrollY=Math.max(s,null!==(e=o.maxScrollY)&&void 0!==e?e:0),o.maxScrollHeight=Math.max(a,null!==(n=o.maxScrollHeight)&&void 0!==n?n:0),o.lastContentY=u,o.maxContentY=Math.max(u,null!==(i=o.maxContentY)&&void 0!==i?i:0),o.maxContentHeight=Math.max(c,null!==(r=o.maxContentHeight)&&void 0!==r?r:0)}))}return u(e,[{key:"_createPageViewData",value:function(){return{pathname:D.location.pathname}}},{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),r({$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 r({$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,i=e.maxScrollY,r=e.maxContentHeight,o=e.lastContentY,s=e.maxContentY;return t=Math.ceil(t),n=Math.ceil(n),i=Math.ceil(i),r=Math.ceil(r),o=Math.ceil(o),s=Math.ceil(s),{$prev_pageview_last_scroll:n,$prev_pageview_last_scroll_percentage:t<=1?1:Cn(n/t,0,1),$prev_pageview_max_scroll:i,$prev_pageview_max_scroll_percentage:t<=1?1:Cn(i/t,0,1),$prev_pageview_last_content:o,$prev_pageview_last_content_percentage:r<=1?1:Cn(o/r,0,1),$prev_pageview_max_content:s,$prev_pageview_max_content_percentage:r<=1?1:Cn(s/r,0,1)}}},{key:"startMeasuringScrollPosition",value:function(){D.addEventListener("scroll",this._updateScrollData),D.addEventListener("scrollend",this._updateScrollData),D.addEventListener("resize",this._updateScrollData)}},{key:"stopMeasuringScrollPosition",value:function(){D.removeEventListener("scroll",this._updateScrollData),D.removeEventListener("scrollend",this._updateScrollData),D.removeEventListener("resize",this._updateScrollData)}},{key:"_scrollHeight",value:function(){return Math.max(0,D.document.documentElement.scrollHeight-D.document.documentElement.clientHeight)}},{key:"_scrollY",value:function(){return D.scrollY||D.pageYOffset||D.document.documentElement.scrollTop||0}},{key:"_contentHeight",value:function(){return D.document.documentElement.scrollHeight||0}},{key:"_contentY",value:function(){var e=D.document.documentElement.clientHeight||0;return this._scrollY()+e}}]),e}();function Cn(e,t,n){return Math.max(t,Math.min(e,n))}var Mn,An,Dn,Ln={icontains:function(e){return window.location.href.toLowerCase().indexOf(e.toLowerCase())>-1},regex:function(e){return function(e,t){return!!function(e){try{new RegExp(e)}catch(e){return!1}return!0}(t)&&new RegExp(t).test(e)}(window.location.href,e)},exact:function(e){return window.location.href===e}},Nn=function(){function e(t){s(this,e),this.instance=t}return u(e,[{key:"getSurveys",value:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]&&arguments[1],i=this.instance.get_property(Re);if(i&&!n)return e(i);this.instance._send_request("".concat(this.instance.config.api_host,"/api/surveys/?token=").concat(this.instance.config.token),{},{method:"GET"},(function(n){var i,r=n.surveys||[];return null===(i=t.instance.persistence)||void 0===i||i.register(c({},Re,r)),e(r)}))}},{key:"getActiveMatchingSurveys",value:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]&&arguments[1];this.getSurveys((function(n){var i=n.filter((function(e){return!(!e.start_date||e.end_date)})).filter((function(e){var t,n,i,r;if(!e.conditions)return!0;var o=null===(t=e.conditions)||void 0===t||!t.url||Ln[null!==(n=null===(i=e.conditions)||void 0===i?void 0:i.urlMatchType)&&void 0!==n?n:"icontains"](e.conditions.url),s=null===(r=e.conditions)||void 0===r||!r.selector||document.querySelector(e.conditions.selector);return o&&s})).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),i=!e.targeting_flag_key||t.instance.featureFlags.isFeatureEnabled(e.targeting_flag_key);return n&&i}));return e(i)}),n)}}]),e}(),Bn=function(){function e(){var t=this;s(this,e),c(this,"limits",{}),c(this,"checkForLimiting",(function(e){try{var n=e.responseText;if(!n||!n.length)return;(JSON.parse(n).quota_limited||[]).forEach((function(e){j.info("[RateLimiter] ".concat(e||"events"," is quota limited.")),t.limits[e]=(new Date).getTime()+6e4}))}catch(e){return void j.error(e)}}))}return u(e,[{key:"isRateLimited",value:function(e){var t=this.limits[e||"events"]||!1;return!1!==t&&(new Date).getTime()<t}}]),e}(),qn=function(){return r({initialPathName:D.location.pathname,referringDomain:it.referringDomain()},it.campaignParams())},jn=function(){function e(t,n,i){var r=this;s(this,e),c(this,"_onSessionIdCallback",(function(e){var t=r._getStoredProps();if(!t||t.sessionId!==e){var n={sessionId:e,props:r._sessionSourceParamGenerator()};r._persistence.register(c({},Me,n))}})),this._sessionIdManager=t,this._persistence=n,this._sessionSourceParamGenerator=i||qn,this._sessionIdManager.onSessionId(this._onSessionIdCallback)}return u(e,[{key:"_getStoredProps",value:function(){return this._persistence.props[Me]}},{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}();!function(e){e[e.INIT_MODULE=0]="INIT_MODULE",e[e.INIT_SNIPPET=1]="INIT_SNIPPET"}(Mn||(Mn={}));var Hn=function(){},Vn={},Un="posthog",Wn=D.XMLHttpRequest&&"withCredentials"in new XMLHttpRequest,Gn=!Wn&&-1===B.indexOf("MSIE")&&-1===B.indexOf("Mozilla"),zn=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==N?void 0:N.location,n=null==t?void 0:t.hostname,!!O(n)&&"herokuapp.com"!==n.split(".").slice(-2).join(".")),persistence:"cookie",persistence_name:"",cookie_name:"",loaded:Hn,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==D||null===(e=D.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;j.error(t)},get_device_id:function(e){return e},_onCapture:Hn,capture_performance:void 0,name:"posthog",callback_fn:"posthog._jsc",bootstrap:{},disable_compression:!1,session_idle_timeout_seconds:1800}},Yn=function(e,t,n,i){var r,o=n!==Un&&Dn?n?Dn[n]:void 0:Dn,s={initComplete:!1,syncCode:!1},a=function(e){return function(t){s[e]||(s[e]=!0,s.initComplete&&s.syncCode&&(null==i||i(t)))}};if(o&&An===Mn.INIT_MODULE)r=o;else{if(o&&!F(o))return void j.error("You have already initialized "+n);r=new Qn}return r._init(e,t,n,a("initComplete")),r.toolbar.maybeLoadToolbar(),r.sessionRecording=new dt(r),r.sessionRecording.startRecordingIfEnabled(),r.webPerformance=new _t(r),r.webPerformance.startObservingIfEnabled(),r.config.__preview_measure_pageview_stats&&r.pageViewManager.startMeasuringScrollPosition(),r.__autocapture=r.config.autocapture,Le._setIsAutocaptureEnabled(r),Le._isAutocaptureEnabled&&(r.__autocapture=r.config.autocapture,Le.enabledForProject(r.config.token,100,100)?Le.isBrowserSupported()?Le.init(r):(r.__autocapture=!1,j.info("Disabling Automatic Event Collection because this browser is not supported")):(r.__autocapture=!1,j.info("Not in active bucket: disabling Automatic Event Collection."))),y.DEBUG=y.DEBUG||r.config.debug,!x(o)&&F(o)&&(r._execute_array.call(r.people,o.people),r._execute_array(o)),a("syncCode")(r),r},Qn=function(){function e(){var t=this;s(this,e),this.config=zn(),this.compression={},this.decideEndpointWasHit=!1,this.SentryIntegration=Tn,this.segmentIntegration=function(){return function(e){Promise&&Promise.resolve||j.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 i=e._calculate_event_properties(n,t.event.properties);return t.event.properties=Object.assign({},i,t.event.properties),t};return{name:"PostHog JS",type:"enrichment",version:"1.0.0",isLoaded: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")}}}(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.featureFlags=new Ve(this),this.toolbar=new wt(this),this.pageViewManager=new $n,this.surveys=new Nn(this),this.rateLimiter=new Bn,this.people={set:function(e,n,i){var r=O(e)?c({},e,n):e;t.setPersonProperties(r),null==i||i({})},set_once:function(e,n,i){var r=O(e)?c({},e,n):e;t.setPersonProperties(void 0,r),null==i||i({})}}}return u(e,[{key:"init",value:function(e,t,n){if(x(n))j.critical("You must name your new library: init(token, config, name)");else{if(n!==Un){var i=Yn(e,t,n,(function(e){Dn[n]=e,e._loaded()}));return Dn[n]=i,i}j.critical("You must initialize the main posthog object right after you include the PostHog js snippet")}}},{key:"_init",value:function(e){var t,n,i=this,o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},s=arguments.length>2?arguments[2]:void 0,a=arguments.length>3?arguments[3]:void 0;this.__loaded=!0,this.config={},this._triggered_notifs=[];var u,c={segmentRegister:!1,syncCode:!1},l=function(e){return function(){c[e]||(c[e]=!0,c.segmentRegister&&c.syncCode&&(null==a||a(i)))}};if(this.set_config(G({},zn(),o,{name:s,token:e,callback_fn:(s===Un?s:Un+"."+s)+"._jsc"})),this._jsc=function(){},(null!=D&&null!==(t=D.rrweb)&&void 0!==t&&t.record||null!=D&&D.rrwebRecord)&&(this.__loaded_recorder_version=null==D||null===(u=D.rrweb)||void 0===u?void 0:u.version),this.persistence=new ot(this.config),this._requestQueue=new Ct(this._handle_queued_event.bind(this)),this._retryQueue=new bn(this.config.on_xhr_error,this.rateLimiter),this.__captureHooks=[],this.__request_queue=[],this.sessionManager=new Rn(this.config,this.persistence),this.sessionPropsManager=new jn(this.sessionManager,this.persistence),this.sessionPersistence="sessionStorage"===this.config.persistence?this.persistence:new ot(r(r({},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(l("segmentRegister"))):l("segmentRegister")(),void 0!==(null===(n=o.bootstrap)||void 0===n?void 0:n.distinctID)){var d,f,h=this.config.get_device_id(En()),p=null!==(d=o.bootstrap)&&void 0!==d&&d.isIdentifiedID?h:o.bootstrap.distinctID;this.persistence.set_user_state(null!==(f=o.bootstrap)&&void 0!==f&&f.isIdentifiedID?"identified":"anonymous"),this.register({distinct_id:o.bootstrap.distinctID,$device_id:p})}if(this._hasBootstrappedFeatureFlags()){var _,g,v=Object.keys((null===(_=o.bootstrap)||void 0===_?void 0:_.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,i;return e[t]=(null===(n=o.bootstrap)||void 0===n||null===(i=n.featureFlags)||void 0===i?void 0:i[t])||!1,e}),{}),m=Object.keys((null===(g=o.bootstrap)||void 0===g?void 0:g.featureFlagPayloads)||{}).filter((function(e){return v[e]})).reduce((function(e,t){var n,i,r,s;return null!==(n=o.bootstrap)&&void 0!==n&&null!==(i=n.featureFlagPayloads)&&void 0!==i&&i[t]&&(e[t]=null===(r=o.bootstrap)||void 0===r||null===(s=r.featureFlagPayloads)||void 0===s?void 0:s[t]),e}),{});this.featureFlags.receivedFeatureFlags({featureFlags:v,featureFlagPayloads:m})}if(!this.get_distinct_id()){var y=this.config.get_device_id(En());this.register_once({distinct_id:y,$device_id:y},""),this.persistence.set_user_state("anonymous")}D.addEventListener&&D.addEventListener("onpagehide"in self?"pagehide":"unload",this._handle_unload.bind(this)),l("syncCode")()}},{key:"_afterDecideResponse",value:function(e){var t;if(this.compression={},e.supportedCompression&&!this.config.disable_compression){var n,i={},r=m(e.supportedCompression);try{for(r.s();!(n=r.n()).done;)i[n.value]=!0}catch(e){r.e(e)}finally{r.f()}this.compression=i}null!==(t=e.analytics)&&void 0!==t&&t.endpoint&&(this.analyticsDefaultEndpoint=e.analytics.endpoint)}},{key:"_loaded",value:function(){var e=this.config.advanced_disable_decide;e||this.featureFlags.setReloadingPaused(!0);try{this.config.loaded(this)}catch(e){j.critical("`loaded` function failed",e)}this._start_queue_if_opted_in(),this.config.capture_pageview&&this.capture("$pageview",{title:N.title},{send_instantly:!0}),e||(new vt(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()||U(this.__request_queue,(function(t){e._send_request.apply(e,_(t))})),this.__request_queue=[],this._start_queue_if_opted_in()}},{key:"_prepare_callback",value:function(e,t){if(x(e))return null;if(Wn)return function(n){e(n,t)};var n=this._jsc,i=""+Math.floor(1e8*Math.random()),r=this.config.callback_fn+"["+i+"]";return n[i]=function(r){delete n[i],e(r,t)},r}},{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 i=JSON.stringify(t);this.__compress_and_send_json_request(e,i,n||Vn,Hn)}},{key:"__compress_and_send_json_request",value:function(e,t,n,i){var o=function(e,t,n){return e===Xt.GZipJS?[_n(gn(t),{mtime:0}),r(r({},n),{},{blob:!0,urlQueryArgs:{compression:Xt.GZipJS}})]:[{data:Z(t)},n]}(this.compression[Xt.GZipJS]?Xt.GZipJS:Xt.Base64,t,n),s=p(o,2),a=s[0],u=s[1];this._send_request(e,a,u,i)}},{key:"_send_request",value:function(e,t,n,i){if(this.__loaded&&this._retryQueue&&!this.rateLimiter.isRateLimited(n._batchKey))if(Gn)this.__request_queue.push([e,t,n,i]);else{var o={method:this.config.api_method,transport:this.config.api_transport,verbose:this.config.verbose};n=G(o,n||{}),Wn||(n.method="GET");var s="sendBeacon"in D.navigator&&"sendBeacon"===n.transport;if(e=vn(e,n.urlQueryArgs||{},{ip:this.config.ip}),s)try{D.navigator.sendBeacon(e,mn(t,r(r({},n),{},{sendBeacon:!0})))}catch(e){}else if(Wn)try{yn({url:e,data:t,headers:this.config.xhr_headers,options:n,callback:i,retriesPerformedSoFar:0,retryQueue:this._retryQueue,onXHRError:this.config.on_xhr_error,onResponse:this.rateLimiter.checkForLimiting})}catch(e){j.error(e)}else{var a,u=N.createElement("script");u.type="text/javascript",u.async=!0,u.defer=!0,u.src=e;var c=N.getElementsByTagName("script")[0];null===(a=c.parentNode)||void 0===a||a.insertBefore(u,c)}}}},{key:"_execute_array",value:function(e){var t,n=this,i=[],r=[],o=[];U(e,(function(e){e&&(t=e[0],F(t)?o.push(e):I(e)?e.call(n):F(e)&&"alias"===t?i.push(e):F(e)&&-1!==t.indexOf("capture")&&I(n[t])?o.push(e):r.push(e))}));var s=function(e,t){U(e,(function(e){if(F(e[0])){var n=t;W(e,(function(e){n=n[e[0]].apply(n,e.slice(1))}))}else this[e[0]].apply(this,e.slice(1))}),t)};s(i,this),s(r,this),s(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]:Vn;if(!this.__loaded||!this.sessionPersistence||!this._requestQueue)return j.uninitializedWarning("posthog.capture");if(!function(e){var t=!1;try{var n=e.config.token,i=e.config.respect_dnt,r=e.config.opt_out_capturing_persistence_type,o=e.config.opt_out_capturing_cookie_prefix||void 0,s=e.config.window;n&&(t=It(n,{respectDnt:i,persistenceType:r,persistencePrefix:o,window:s}))}catch(e){j.error("Unexpected error when checking capturing opt-out status: "+e)}return t}(this)){var i=(n=n||Vn).transport;if(i&&(n.transport=i),!x(e)&&O(e)){if(!function(e,t){if(!e)return!1;var n=e.toLowerCase();return te.concat(t||[]).some((function(e){var t=e.toLowerCase();return n.includes?n.includes(t):-1!==n.indexOf(t)}))}(B,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 o={uuid:En(),event:e,properties:this._calculate_event_properties(e,t||{})};"$identify"===e&&(o.$set=n.$set,o.$set_once=n.$set_once),(o=function(e,t){return n=e,i=function(e,n){return n&&K.indexOf(n)>-1?e:O(e)&&!R(t)?e.slice(0,t):e},r=new Set,function e(t,n){return t!==Object(t)?i?i(t,n):t:r.has(t)?void 0:(r.add(t),F(t)?(o=[],U(t,(function(t){o.push(e(t))}))):(o={},W(t,(function(t,n){r.has(t)||(o[n]=e(t,n))}))),o);var o}(n);var n,i,r}(o,n._noTruncate?null:this.config.properties_string_max_length)).timestamp=n.timestamp||new Date;var s=r(r({},o.properties.$set),o.$set);(function(e){if(E(e)){for(var t in e)if(k.call(e,t))return!1;return!0}return!1})(s)||this.setPersonPropertiesForFlags(s),j.info("send",o);var a=JSON.stringify(o),u=this.config.api_host+(n.endpoint||this.analyticsDefaultEndpoint),c=n!==Vn;return!this.config.request_batching||c&&!n._batchKey||n.send_instantly?this.__compress_and_send_json_request(u,a,n):this._requestQueue.enqueue(u,o,n),this._invokeCaptureHooks(e,o),o}}else j.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),W(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),i=r({},t);if(i.token=this.config.token,"$snapshot"===e){var o=r(r({},this.persistence.properties()),this.sessionPersistence.properties());return i.distinct_id=o.distinct_id,i}var s=it.properties();if(this.sessionManager){var a=this.sessionManager.checkAndGetSessionAndWindowId(),u=a.sessionId,c=a.windowId;i.$session_id=u,i.$window_id=c}if(this.sessionPropsManager&&this.config.__preview_send_client_session_params&&("$pageview"===e||"$pageleave"===e||"$autocapture"===e)){var l=this.sessionPropsManager.getSessionProps();i=G(i,l)}if(this.config.__preview_measure_pageview_stats){var d={};"$pageview"===e?d=this.pageViewManager.doPageView():"$pageleave"===e&&(d=this.pageViewManager.doPageLeave()),i=G(i,d)}if("$pageview"===e&&(i.title=N.title),"$performance_event"===e){var f=this.persistence.properties();return i.distinct_id=f.distinct_id,i.$current_url=s.$current_url,i}if(!x(n)){var h=(new Date).getTime()-n;i.$duration=parseFloat((h/1e3).toFixed(3))}i=G({},it.properties(),this.persistence.properties(),this.sessionPersistence.properties(),i);var p=this.config.property_blacklist;F(p)?W(p,(function(e){delete i[e]})):j.error("Invalid value for property_blacklist config: "+p);var _=this.config.sanitize_properties;return _&&(i=_(i,e)),i}},{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 i;null===(i=this.persistence)||void 0===i||i.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(c({},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 j.uninitializedWarning("posthog.identify");if(e){var i=this.get_distinct_id();if(this.register({$user_id:e}),!this.get_property("$device_id")){var r=i;this.register_once({$had_persisted_distinct_id:!0,$device_id:r},"")}e!==i&&e!==this.get_property(me)&&(this.unregister(me),this.register({distinct_id:e}));var o="anonymous"===this.persistence.get_user_state();e!==i&&o?(this.persistence.set_user_state("identified"),this.setPersonPropertiesForFlags(t||{},!1),this.capture("$identify",{distinct_id:e,$anon_distinct_id:i},{$set:t||{},$set_once:n||{}}),this.featureFlags.setAnonymousDistinctId(i)):(t||n)&&this.setPersonProperties(t,n),e!==i&&(this.reloadFeatureFlags(),this.unregister(Te))}else j.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 i=this.getGroups();i[e]!==t&&this.resetGroupPropertiesForFlags(e),this.register({$groups:r(r({},i),{},c({},e,t))}),n&&(this.capture("$groupidentify",{$group_type:e,$group_key:t,$group_set:n}),this.setGroupPropertiesForFlags(c({},e,n))),i[e]===t||n||this.reloadFeatureFlags()}else j.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,i,r;if(!this.__loaded)return j.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===(i=this.persistence)||void 0===i||i.set_user_state("anonymous"),null===(r=this.sessionManager)||void 0===r||r.resetSessionId();var s=this.config.get_device_id(En());this.register_once({distinct_id:s,$device_id:e?s: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),i=n.sessionId,r=n.sessionStartTimestamp,o=t+"/replay/"+i;if(null!=e&&e.withTimestamp&&r){var s,a=null!==(s=e.timestampLookBack)&&void 0!==s?s:10;if(!r)return o;var u=Math.max(Math.floor(((new Date).getTime()-r)/1e3)-a,0);o+="?t=".concat(u)}return o}},{key:"alias",value:function(e,t){return e===this.get_property(ve)?(j.critical("Attempting to create alias for existing People user - aborting."),-2):(x(t)&&(t=this.get_distinct_id()),e!==t?(this._register_single(me,e),this.capture("$create_alias",{alias:e,distinct_id:t})):(j.warn("alias matches current distinct_id - skipping api call."),this.identify(e),-1))}},{key:"set_config",value:function(e){var t,n,i=r({},this.config);E(e)&&(G(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),null===(t=this.persistence)||void 0===t||t.update_config(this.config),null===(n=this.sessionPersistence)||void 0===n||n.update_config(this.config),ze.is_supported()&&"true"===ze.get("ph_debug")&&(this.config.debug=!0),this.config.debug&&(y.DEBUG=!0),this.sessionRecording&&!x(e.disable_session_recording)&&i.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:Un;return t!==Un&&(t=Un+"."+t),t}},{key:"_gdpr_init",value:function(){"localStorage"===this.config.opt_out_capturing_persistence_type&&ze.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&&!We.get("ph_optout")||(We.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,i,r,o;if(e&&e.clear_persistence)i=!0;else{if(!e||!e.enable_persistence)return;i=!1}this.config.disable_persistence||(null===(t=this.persistence)||void 0===t?void 0:t.disabled)===i||null===(r=this.persistence)||void 0===r||r.set_disabled(i),this.config.disable_persistence||(null===(n=this.sessionPersistence)||void 0===n?void 0:n.disabled)===i||null===(o=this.sessionPersistence)||void 0===o||o.set_disabled(i)}},{key:"_gdpr_call_func",value:function(e,t){return t=G({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||{}),ze.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=G({enable_persistence:!0},e||{}),this._gdpr_call_func(St,e),this._gdpr_update_persistence(e)}},{key:"opt_out_capturing",value:function(e){var t=G({clear_persistence:!0},e||{});this._gdpr_call_func(Ft,t),this._gdpr_update_persistence(t)}},{key:"has_opted_in_capturing",value:function(e){return this._gdpr_call_func(Pt,e)}},{key:"has_opted_out_capturing",value:function(e){return this._gdpr_call_func(It,e)}},{key:"clear_opt_in_out_capturing",value:function(e){var t=G({enable_persistence:!0},null!=e?e:{});this._gdpr_call_func(Et,t),this._gdpr_update_persistence(t)}},{key:"debug",value:function(e){!1===e?(D.console.log("You've disabled debug mode."),localStorage&&localStorage.removeItem("ph_debug"),this.set_config({debug:!1})):(D.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]]=J(e.prototype[t[n]])}(Qn,["identify"]);var Jn,Xn,Kn={};!function(e){e.Popover="popover",e.API="api"}(Jn||(Jn={})),function(e){e.Open="open",e.MultipleChoice="multiple_choice",e.SingleChoice="single_choice",e.Rating="rating",e.Link="link"}(Xn||(Xn={}));var Zn=(An=Mn.INIT_MODULE,(Dn=new Qn).init=function(e,t,n){if(n)return Dn[n]||(Dn[n]=Kn[n]=Yn(e||"",t||{},n,(function(e){Dn[n]=Kn[n]=e,e._loaded()}))),Dn[n];var i=Dn;return Kn[Un]?i=Kn[Un]:e&&(i=Yn(e,t||{},Un,(function(e){Kn[Un]=e,e._loaded()})),Kn[Un]=i),Dn=i,An===Mn.INIT_SNIPPET&&(D[Un]=Dn),W(Kn,(function(e,t){t!==Un&&(Dn[t]=e)})),i},Dn.init(),function(){function e(){e.done||(e.done=!0,Gn=!1,W(Kn,(function(e){e._dom_loaded()})))}N.addEventListener&&("complete"===N.readyState?e():N.addEventListener("DOMContentLoaded",e,!1)),ne(D,"load",e,!0)}(),Dn)}}]);
\ No newline at end of file |