{"version":3,"file":"posthog-pTsyP16K.js","sources":["../../../node_modules/posthog-js/dist/module.js"],"sourcesContent":["function e(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 t(t){for(var n=1;n=0||(r[n]=e[n]);return r}(e,t);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);for(i=0;i=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function u(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:\"undefined\"!=typeof Symbol&&e[Symbol.iterator]||e[\"@@iterator\"];if(null==n)return;var i,r,s=[],o=!0,a=!1;try{for(n=n.call(e);!(o=(i=n.next()).done)&&(s.push(i.value),!t||s.length!==t);o=!0);}catch(e){a=!0,r=e}finally{try{o||null==n.return||n.return()}finally{if(a)throw r}}return s}(e,t)||c(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 l(e){return function(e){if(Array.isArray(e))return d(e)}(e)||function(e){if(\"undefined\"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e[\"@@iterator\"])return Array.from(e)}(e)||c(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 c(e,t){if(e){if(\"string\"==typeof e)return d(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)?d(e,t):void 0}}function d(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,i=new Array(t);n=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 s,o=!0,a=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return o=e.done,e},e:function(e){a=!0,s=e},f:function(){try{o||null==n.return||n.return()}finally{if(a)throw s}}}}var f={DEBUG:!1,LIB_VERSION:\"1.157.2\"},v=Array.isArray,p=Object.prototype,g=p.hasOwnProperty,_=p.toString,m=v||function(e){return\"[object Array]\"===_.call(e)},y=function(e){return\"function\"==typeof e},b=function(e){return e===Object(e)&&!m(e)},k=function(e){if(b(e)){for(var t in e)if(g.call(e,t))return!1;return!0}return!1},w=function(e){return void 0===e},S=function(e){return\"[object String]\"==_.call(e)},E=function(e){return S(e)&&0===e.trim().length},I=function(e){return null===e},R=function(e){return w(e)||I(e)},F=function(e){return\"[object Number]\"==_.call(e)},x=function(e){return\"[object Boolean]\"===_.call(e)},P=function(e){return e instanceof FormData},T=\"undefined\"!=typeof window?window:void 0,C=\"undefined\"!=typeof globalThis?globalThis:T,$=Array.prototype,O=$.forEach,M=$.indexOf,A=null==C?void 0:C.navigator,L=null==C?void 0:C.document,D=null==C?void 0:C.location,N=null==C?void 0:C.fetch,q=null!=C&&C.XMLHttpRequest&&\"withCredentials\"in new C.XMLHttpRequest?C.XMLHttpRequest:void 0,B=null==C?void 0:C.AbortController,H=null==A?void 0:A.userAgent,U=null!=T?T:{},j=\"[PostHog.js]\",G={_log:function(e){if(T&&(f.DEBUG||U.POSTHOG_DEBUG)&&!w(T.console)&&T.console){for(var t=(\"__rrweb_original__\"in T.console[e]?T.console[e].__rrweb_original__:T.console[e]),n=arguments.length,i=new Array(n>1?n-1:0),r=1;r1?t-1:0),i=1;i0&&(t[n]=e)})),t},ne=function(e){return e.replace(/^\\$/,\"\")};function ie(e,t){return n=e,i=function(e){return S(e)&&!I(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),m(t)?(s=[],z(t,(function(t){s.push(e(t))}))):(s={},Q(t,(function(t,n){r.has(t)||(s[n]=e(t,n))}))),s);var s}(n);var n,i,r}var re,se=function(e){var t,n,i,r,s=\"\";for(t=n=0,i=(e=(e+\"\").replace(/\\r\\n/g,\"\\n\").replace(/\\r/g,\"\\n\")).length,r=0;r127&&o<2048?String.fromCharCode(o>>6|192,63&o|128):String.fromCharCode(o>>12|224,o>>6&63|128,63&o|128),I(a)||(n>t&&(s+=e.substring(t,n)),s+=a,t=n=r+1)}return n>t&&(s+=e.substring(t,e.length)),s},oe=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,s){if(t)if(t.addEventListener&&!r)t.addEventListener(n,i,!!s);else{var o=\"on\"+n,a=t[o];t[o]=function(t,n,i){return function(r){if(r=r||e(null==T?void 0:T.event)){var s,o=!0;y(i)&&(s=i(r));var a=n.call(t,r);return!1!==s&&!1!==a||(o=!1),o}}}(t,i,a)}else G.error(\"No valid element provided to register_event\")}}();function ae(e,t){for(var n=0;n1&&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),s=this.instance.get_property(Ce)||{};if(t.send_event||!(\"send_event\"in t))if(!(e in s)||!s[e].includes(r))m(s[e])?s[e].push(r):s[e]=[r],null===(n=this.instance.persistence)||void 0===n||n.register(o({},Ce,s)),this.instance.capture(\"$feature_flag_called\",{$feature_flag:e,$feature_flag_response:i});return i}G.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);G.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,n){if(this.instance.persistence){this.instance.decideEndpointWasHit=!0;var i=this.getFlagVariants(),r=this.getFlagPayloads();!function(e,n){var i,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},s=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},a=e.featureFlags,u=e.featureFlagPayloads;if(a)if(m(a)){var l,c={};if(a)for(var d=0;d1&&void 0!==arguments[1]&&arguments[1];if(!this.instance.__loaded||!this.instance.persistence)return G.uninitializedWarning(\"posthog.feature_flags.override\");if(this._override_warning=t,!1===e)this.instance.persistence.unregister(Ue);else if(m(e)){for(var n={},i=0;i1&&void 0!==arguments[1]&&arguments[1],i=this.instance.get_property(Re);if(i&&!n)return e(i);this.instance._send_request({transport:\"XHR\",url:this.instance.requestRouter.endpointFor(\"api\",\"/api/early_access_features/?token=\".concat(this.instance.config.token)),method:\"GET\",callback:function(n){var i;if(n.json){var r=n.json.earlyAccessFeatures;return null===(i=t.instance.persistence)||void 0===i||i.register(o({},Re,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(e){var t=this._prepareFeatureFlagsForCallbacks(),n=t.flags,i=t.flagVariants;this.featureFlagEventHandlers.forEach((function(t){return t(n,i,{errorsLoading:e})}))}},{key:\"setPersonPropertiesForFlags\",value:function(e){var n=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],i=this.instance.get_property(Fe)||{};this.instance.register(o({},Fe,t(t({},i),e))),n&&this.instance.reloadFeatureFlags()}},{key:\"resetPersonPropertiesForFlags\",value:function(){this.instance.unregister(Fe)}},{key:\"setGroupPropertiesForFlags\",value:function(e){var n=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],i=this.instance.get_property(xe)||{};0!==Object.keys(i).length&&Object.keys(i).forEach((function(n){i[n]=t(t({},i[n]),e[n]),delete e[n]})),this.instance.register(o({},xe,t(t({},i),e))),n&&this.instance.reloadFeatureFlags()}},{key:\"resetGroupPropertiesForFlags\",value:function(e){if(e){var n=this.instance.get_property(xe)||{};this.instance.register(o({},xe,t(t({},n),{},o({},e,{}))))}else this.instance.unregister(xe)}}]),e}();Math.trunc||(Math.trunc=function(e){return e<0?Math.ceil(e):Math.floor(e)}),Number.isInteger||(Number.isInteger=function(e){return F(e)&&isFinite(e)&&Math.floor(e)===e});var Ve=\"0123456789abcdef\",ze=function(){function e(t){if(i(this,e),this.bytes=t,16!==t.length)throw new TypeError(\"not 128-bit length\")}return s(e,[{key:\"toString\",value:function(){for(var e=\"\",t=0;t>>4)+Ve.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 s=new Uint8Array(16);return s[0]=t/Math.pow(2,40),s[1]=t/Math.pow(2,32),s[2]=t/Math.pow(2,24),s[3]=t/Math.pow(2,16),s[4]=t/Math.pow(2,8),s[5]=t,s[6]=112|n>>>8,s[7]=n,s[8]=128|i>>>24,s[9]=i>>>16,s[10]=i>>>8,s[11]=i,s[12]=r>>>24,s[13]=r>>>16,s[14]=r>>>8,s[15]=r,new e(s)}}]),e}(),Qe=function(){function e(){i(this,e),o(this,\"timestamp\",0),o(this,\"counter\",0),o(this,\"random\",new Xe)}return s(e,[{key:\"generate\",value:function(){var e=this.generateOrAbort();if(w(e)){this.timestamp=0;var t=this.generateOrAbort();if(w(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 ze.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}(),Je=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=this.buffer.length&&(Je(this.buffer),this.cursor=0),this.buffer[this.cursor++]}}]),e}(),Ke=function(){return Ze().toString()},Ze=function(){return(Ye||(Ye=new Qe)).generate()},et=\"Thu, 01 Jan 1970 00:00:00 GMT\",tt=\"\";var nt=/[a-z0-9][a-z0-9-]+\\.[a-z]{2,}$/i;function it(e,t){if(t){var n=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:L;if(tt)return tt;if(!t)return\"\";if([\"localhost\",\"127.0.0.1\"].includes(e))return\"\";for(var n=e.split(\".\"),i=Math.min(n.length,8),r=\"dmn_chk_\"+Ke(),s=new RegExp(\"(^|;)\\\\s*\"+r+\"=1\");!tt&&i--;){var o=n.slice(i).join(\".\"),a=r+\"=1;domain=.\"+o;t.cookie=a,s.test(t.cookie)&&(t.cookie=a+\";expires=\"+et,tt=o)}return tt}(e);if(!n){var i=function(e){var t=e.match(nt);return t?t[0]:\"\"}(e);i!==n&&G.info(\"Warning: cookie subdomain discovery mismatch\",i,n),n=i}return n?\"; domain=.\"+n:\"\"}return\"\"}var rt,st={is_supported:function(){return!!L},error:function(e){G.error(\"cookieStore error: \"+e)},get:function(e){if(L){try{for(var t=e+\"=\",n=L.cookie.split(\";\").filter((function(e){return e.length})),i=0;i3686.4&&G.warn(\"cookieStore warning: large cookie, len=\"+l.length),L.cookie=l,l}catch(e){return}},remove:function(e,t){try{st.set(e,\"\",-1,t)}catch(e){return}}},ot=null,at={is_supported:function(){if(!I(ot))return ot;var e=!0;if(w(T))e=!1;else try{var t=\"__mplssupport__\";at.set(t,\"xyz\"),'\"xyz\"'!==at.get(t)&&(e=!1),at.remove(t)}catch(t){e=!1}return e||G.error(\"localStorage unsupported; falling back to cookie store\"),ot=e,e},error:function(e){G.error(\"localStorage error: \"+e)},get:function(e){try{return null==T?void 0:T.localStorage.getItem(e)}catch(e){at.error(e)}return null},parse:function(e){try{return JSON.parse(at.get(e))||{}}catch(e){}return null},set:function(e,t){try{null==T||T.localStorage.setItem(e,JSON.stringify(t))}catch(e){at.error(e)}},remove:function(e){try{null==T||T.localStorage.removeItem(e)}catch(e){at.error(e)}}},ut=[\"distinct_id\",Se,Ee,Ne],lt=t(t({},at),{},{parse:function(e){try{var t={};try{t=st.parse(e)||{}}catch(e){}var n=J(t,JSON.parse(at.get(e)||\"{}\"));return at.set(e,n),n}catch(e){}return null},set:function(e,t,n,i,r,s){try{at.set(e,t,void 0,void 0,s);var o={};ut.forEach((function(e){t[e]&&(o[e]=t[e])})),Object.keys(o).length&&st.set(e,o,n,i,r,s)}catch(e){at.error(e)}},remove:function(e,t){try{null==T||T.localStorage.removeItem(e),st.remove(e,t)}catch(e){at.error(e)}}}),ct={},dt={is_supported:function(){return!0},error:function(e){G.error(\"memoryStorage error: \"+e)},get:function(e){return ct[e]||null},parse:function(e){return ct[e]||null},set:function(e,t){ct[e]=t},remove:function(e){delete ct[e]}},ht=null,ft={is_supported:function(){if(!I(ht))return ht;if(ht=!0,w(T))ht=!1;else try{var e=\"__support__\";ft.set(e,\"xyz\"),'\"xyz\"'!==ft.get(e)&&(ht=!1),ft.remove(e)}catch(e){ht=!1}return ht},error:function(e){G.error(\"sessionStorage error: \",e)},get:function(e){try{return null==T?void 0:T.sessionStorage.getItem(e)}catch(e){ft.error(e)}return null},parse:function(e){try{return JSON.parse(ft.get(e))||null}catch(e){}return null},set:function(e,t){try{null==T||T.sessionStorage.setItem(e,JSON.stringify(t))}catch(e){ft.error(e)}},remove:function(e){try{null==T||T.sessionStorage.removeItem(e)}catch(e){ft.error(e)}}},vt=[\"localhost\",\"127.0.0.1\"],pt=function(e){var t=null==L?void 0:L.createElement(\"a\");return w(t)?null:(t.href=e,t)},gt=function(e,t){return!!function(e){try{new RegExp(e)}catch(e){return!1}return!0}(t)&&new RegExp(t).test(e)},_t=function(e){var t,n,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:\"&\",r=[];return Q(e,(function(e,i){w(e)||w(i)||\"undefined\"===i||(t=encodeURIComponent(function(e){return e instanceof File}(e)?e.name:e.toString()),n=encodeURIComponent(i),r[r.length]=n+\"=\"+t)})),r.join(i)},mt=function(e,t){for(var n,i=((e.split(\"#\")[0]||\"\").split(\"?\")[1]||\"\").split(\"&\"),r=0;r=3&&(t=w(e[2])?e[3]:e[2]),[\"watchOS\",t]}],[new RegExp(\"(\"+wt+\" (\\\\d+)\\\\.(\\\\d+)\\\\.?(\\\\d+)?|\"+wt+\")\",\"i\"),function(e){if(e&&e[2]){var t=[e[2],e[3],e[4]||\"0\"];return[wt,t.join(\".\")]}return[wt,\"\"]}],[/Mac OS X (\\d+)[_.](\\d+)[_.]?(\\d+)?/i,function(e){var t=[\"Mac OS X\",\"\"];if(e&&e[1]){var n=[e[1],e[2],e[3]||\"0\"];t[1]=n.join(\".\")}return t}],[/Mac/i,[\"Mac OS X\",\"\"]],[/CrOS/,[Mt,\"\"]],[/Linux|debian/i,[\"Linux\",\"\"]]],pn=function(e){return un.test(e)?Gt:an.test(e)?Wt:on.test(e)?Vt:new RegExp(Kt,\"i\").test(e)?Kt:new RegExp(\"(\"+Yt+\"|WPDesktop)\",\"i\").test(e)?Yt:/iPad/.test(e)?It:/iPod/.test(e)?\"iPod Touch\":/iPhone/.test(e)?\"iPhone\":/(watch)(?: ?os[,/]|\\d,\\d\\/)[\\d.]+/i.test(e)?Ft:ln.test(e)?Pt:/(kobo)\\s(ereader|touch)/i.test(e)?\"Kobo\":new RegExp(Xt,\"i\").test(e)?Xt:/(kf[a-z]{2}wi|aeo[c-r]{2})( bui|\\))/i.test(e)||/(kf[a-z]+)( bui|\\)).+silk\\//i.test(e)?\"Kindle Fire\":/(Android|ZTE)/i.test(e)?!new RegExp(bt).test(e)||/(9138B|TB782B|Nexus [97]|pixel c|HUAWEISHT|BTV|noble nook|smart ultra 6)/i.test(e)?/pixel[\\daxl ]{1,6}/i.test(e)&&!/pixel c/i.test(e)||/(huaweimed-al00|tah-|APA|SM-G92|i980|zte|U304AA)/i.test(e)||/lmy47v/i.test(e)&&!/QTAQZ3/i.test(e)?wt:Et:wt:new RegExp(\"(pda|\"+bt+\")\",\"i\").test(e)?en:new RegExp(St,\"i\").test(e)&&!new RegExp(St+\" pc\",\"i\").test(e)?tn:\"\"},gn=\"https?://(.*)\",_n=[\"utm_source\",\"utm_medium\",\"utm_campaign\",\"utm_content\",\"utm_term\",\"gclid\",\"gad_source\",\"gclsrc\",\"dclid\",\"gbraid\",\"wbraid\",\"fbclid\",\"msclkid\",\"twclid\",\"li_fat_id\",\"mc_cid\",\"igshid\",\"ttclid\",\"rdt_cid\"],mn={campaignParams:function(e){return L?this._campaignParamsFromUrl(L.URL,e):{}},_campaignParamsFromUrl:function(e,t){var n=_n.concat(t||[]),i={};return Q(n,(function(t){var n=mt(e,t);n&&(i[t]=n)})),i},_searchEngine:function(e){return e?0===e.search(gn+\"google.([^/?]*)\")?\"google\":0===e.search(gn+\"bing.com\")?\"bing\":0===e.search(gn+\"yahoo.com\")?\"yahoo\":0===e.search(gn+\"duckduckgo.com\")?\"duckduckgo\":null:null},_searchInfoFromReferrer:function(e){var t=mn._searchEngine(e),n=\"yahoo\"!=t?\"q\":\"p\",i={};if(!I(t)){i.$search_engine=t;var r=L?mt(L.referrer,n):\"\";r.length&&(i.ph_keyword=r)}return i},searchInfo:function(){var e=null==L?void 0:L.referrer;return e?this._searchInfoFromReferrer(e):{}},browser:hn,browserVersion:function(e,t){var n=hn(e,t),i=fn[n];if(w(i))return null;for(var r=0;r1e3?H.substring(0,997)+\"...\":H,$browser_version:mn.browserVersion(H,navigator.vendor),$browser_language:mn.browserLanguage(),$screen_height:null==T?void 0:T.screen.height,$screen_width:null==T?void 0:T.screen.width,$viewport_height:null==T?void 0:T.innerHeight,$viewport_width:null==T?void 0:T.innerWidth,$lib:\"web\",$lib_version:f.LIB_VERSION,$insert_id:Math.random().toString(36).substring(2,10)+Math.random().toString(36).substring(2,10),$time:K()/1e3})},people_properties:function(){if(!H)return{};var e=u(mn.os(H),2),t=e[0],n=e[1];return J(te({$os:t,$os_version:n,$browser:mn.browser(H,navigator.vendor)}),{$browser_version:mn.browserVersion(H,navigator.vendor)})}},yn=[\"cookie\",\"localstorage\",\"localstorage+cookie\",\"sessionstorage\",\"memory\"],bn=function(){function e(n){i(this,e),this.config=n,this.props={},this.campaign_params_saved=!1,this.name=function(e){var t=\"\";return e.token&&(t=e.token.replace(/\\+/g,\"PL\").replace(/\\//g,\"SL\").replace(/=/g,\"EQ\")),e.persistence_name?\"ph_\"+e.persistence_name:\"ph_\"+t+\"_posthog\"}(n),this.storage=this.buildStorage(n),this.load(),n.debug&&G.info(\"Persistence loaded\",n.persistence,t({},this.props)),this.update_config(n,n),this.save()}return s(e,[{key:\"buildStorage\",value:function(e){-1===yn.indexOf(e.persistence.toLowerCase())&&(G.critical(\"Unknown persistence type \"+e.persistence+\"; falling back to localStorage+cookie\"),e.persistence=\"localStorage+cookie\");var t=e.persistence.toLowerCase();return\"localstorage\"===t&&at.is_supported()?at:\"localstorage+cookie\"===t&<.is_supported()?lt:\"sessionstorage\"===t&&ft.is_supported()?ft:\"memory\"===t?dt:\"cookie\"===t?st:lt.is_supported()?lt:st}},{key:\"properties\",value:function(){var e={};return Q(this.props,(function(t,n){if(n===Ie&&b(t))for(var i=Object.keys(t),r=0;r0&&t.at(-1)!==this;)t.pop();return t.includes(n)?\"[Circular]\":(t.push(n),n)}return n})).length;var t}var wn=2,Sn=4;function En(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:6606028.8;if(e.size>=t&&e.data.length>1){var n=Math.floor(e.data.length/2),i=e.data.slice(0,n),r=e.data.slice(n);return[En({size:kn(i),data:i,sessionId:e.sessionId,windowId:e.windowId}),En({size:kn(r),data:r,sessionId:e.sessionId,windowId:e.windowId})].flatMap((function(e){return e}))}return[e]}var In=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}(In||{}),Rn=function(e){return e[e.Mutation=0]=\"Mutation\",e[e.MouseMove=1]=\"MouseMove\",e[e.MouseInteraction=2]=\"MouseInteraction\",e[e.Scroll=3]=\"Scroll\",e[e.ViewportResize=4]=\"ViewportResize\",e[e.Input=5]=\"Input\",e[e.TouchMove=6]=\"TouchMove\",e[e.MediaInteraction=7]=\"MediaInteraction\",e[e.StyleSheetRule=8]=\"StyleSheetRule\",e[e.CanvasMutation=9]=\"CanvasMutation\",e[e.Font=10]=\"Font\",e[e.Log=11]=\"Log\",e[e.Drag=12]=\"Drag\",e[e.StyleDeclaration=13]=\"StyleDeclaration\",e[e.Selection=14]=\"Selection\",e[e.AdoptedStyleSheet=15]=\"AdoptedStyleSheet\",e[e.CustomElement=16]=\"CustomElement\",e}(Rn||{});function Fn(e){return e?V(e).split(/\\s+/):[]}function xn(e){var t=null==T?void 0:T.location.href;return!!(t&&e&&e.some((function(e){return t.match(e)})))}function Pn(e){var t=\"\";switch(n(e.className)){case\"string\":t=e.className;break;case\"object\":t=(e.className&&\"baseVal\"in e.className?e.className.baseVal:null)||e.getAttribute(\"class\")||\"\";break;default:t=\"\"}return Fn(t)}function Tn(e){return R(e)?null:V(e).split(/(\\s+)/).filter((function(e){return zn(e)})).join(\"\").replace(/[\\r\\n]/g,\" \").replace(/[ ]+/g,\" \").substring(0,255)}function Cn(e){var t=\"\";return qn(e)&&!Bn(e)&&e.childNodes&&e.childNodes.length&&Q(e.childNodes,(function(e){var n;Mn(e)&&e.textContent&&(t+=null!==(n=Tn(e.textContent))&&void 0!==n?n:\"\")})),V(t)}function $n(e){return!!e&&1===e.nodeType}function On(e,t){return!!e&&!!e.tagName&&e.tagName.toLowerCase()===t.toLowerCase()}function Mn(e){return!!e&&3===e.nodeType}function An(e){return!!e&&11===e.nodeType}var Ln=[\"a\",\"button\",\"form\",\"input\",\"select\",\"textarea\",\"label\"];function Dn(e){var t=e.parentNode;return!(!t||!$n(t))&&t}function Nn(e,t){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:void 0,r=arguments.length>3?arguments[3]:void 0,s=arguments.length>4?arguments[4]:void 0;if(!T||!e||On(e,\"html\")||!$n(e))return!1;if(null!=i&&i.url_allowlist&&!xn(i.url_allowlist))return!1;if(null!=i&&i.url_ignorelist&&xn(i.url_ignorelist))return!1;if(null!=i&&i.dom_event_allowlist){var o=i.dom_event_allowlist;if(o&&!o.some((function(e){return t.type===e})))return!1}for(var a=!1,u=[e],l=!0,c=e;c.parentNode&&!On(c,\"body\");)if(An(c.parentNode))u.push(c.parentNode.host),c=c.parentNode.host;else{if(!(l=Dn(c)))break;if(r||Ln.indexOf(l.tagName.toLowerCase())>-1)a=!0;else{var d=T.getComputedStyle(l);d&&\"pointer\"===d.getPropertyValue(\"cursor\")&&(a=!0)}u.push(l),c=l}if(!function(e,t){var i=null==t?void 0:t.element_allowlist;if(w(i))return!0;var r,s=h(e);try{var o=function(){var e=r.value;if(i.some((function(t){return e.tagName.toLowerCase()===t})))return{v:!0}};for(s.s();!(r=s.n()).done;){var a=o();if(\"object\"===n(a))return a.v}}catch(e){s.e(e)}finally{s.f()}return!1}(u,i))return!1;if(!function(e,t){var i=null==t?void 0:t.css_selector_allowlist;if(w(i))return!0;var r,s=h(e);try{var o=function(){var e=r.value;if(i.some((function(t){return e.matches(t)})))return{v:!0}};for(s.s();!(r=s.n()).done;){var a=o();if(\"object\"===n(a))return a.v}}catch(e){s.e(e)}finally{s.f()}return!1}(u,i))return!1;var f=T.getComputedStyle(e);if(f&&\"pointer\"===f.getPropertyValue(\"cursor\")&&\"click\"===t.type)return!0;var v=e.tagName.toLowerCase();switch(v){case\"html\":return!1;case\"form\":return(s||[\"submit\"]).indexOf(t.type)>=0;case\"input\":case\"select\":case\"textarea\":return(s||[\"change\",\"click\"]).indexOf(t.type)>=0;default:return a?(s||[\"click\"]).indexOf(t.type)>=0:(s||[\"click\"]).indexOf(t.type)>=0&&(Ln.indexOf(v)>-1||\"true\"===e.getAttribute(\"contenteditable\"))}}function qn(e){for(var t=e;t.parentNode&&!On(t,\"body\");t=t.parentNode){var n=Pn(t);if(Y(n,\"ph-sensitive\")||Y(n,\"ph-no-capture\"))return!1}if(Y(Pn(e),\"ph-include\"))return!0;var i=e.type||\"\";if(S(i))switch(i.toLowerCase()){case\"hidden\":case\"password\":return!1}var r=e.name||e.id||\"\";if(S(r)){if(/^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,\"\")))return!1}return!0}function Bn(e){return!!(On(e,\"input\")&&![\"button\",\"checkbox\",\"submit\",\"reset\"].includes(e.type)||On(e,\"select\")||On(e,\"textarea\")||\"true\"===e.getAttribute(\"contenteditable\"))}var Hn=\"(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})\",Un=new RegExp(\"^(?:\".concat(Hn,\")$\")),jn=new RegExp(Hn),Gn=\"\\\\d{3}-?\\\\d{2}-?\\\\d{4}\",Wn=new RegExp(\"^(\".concat(Gn,\")$\")),Vn=new RegExp(\"(\".concat(Gn,\")\"));function zn(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if(R(e))return!1;if(S(e)){if(e=V(e),(t?Un:jn).test((e||\"\").replace(/[- ]/g,\"\")))return!1;if((t?Wn:Vn).test(e))return!1}return!0}function Qn(e){var t=Cn(e);return zn(t=\"\".concat(t,\" \").concat(Jn(e)).trim())?t:\"\"}function Jn(e){var t=\"\";return e&&e.childNodes&&e.childNodes.length&&Q(e.childNodes,(function(e){var n;if(e&&\"span\"===(null===(n=e.tagName)||void 0===n?void 0:n.toLowerCase()))try{var i=Cn(e);t=\"\".concat(t,\" \").concat(i).trim(),e.childNodes&&e.childNodes.length&&(t=\"\".concat(t,\" \").concat(Jn(e)).trim())}catch(e){G.error(e)}})),t}function Yn(e){return function(e){var n=e.map((function(e){var n,i,r=\"\";if(e.tag_name&&(r+=e.tag_name),e.attr_class){e.attr_class.sort();var s,o=h(e.attr_class);try{for(o.s();!(s=o.n()).done;){var a=s.value;r+=\".\".concat(a.replace(/\"/g,\"\"))}}catch(e){o.e(e)}finally{o.f()}}var l=t(t(t(t({},e.text?{text:e.text}:{}),{},{\"nth-child\":null!==(n=e.nth_child)&&void 0!==n?n:0,\"nth-of-type\":null!==(i=e.nth_of_type)&&void 0!==i?i:0},e.href?{href:e.href}:{}),e.attr_id?{attr_id:e.attr_id}:{}),e.attributes),c={};return X(l).sort((function(e,t){var n=u(e,1)[0],i=u(t,1)[0];return n.localeCompare(i)})).forEach((function(e){var t=u(e,2),n=t[0],i=t[1];return c[Xn(n.toString())]=Xn(i.toString())})),r+=\":\",r+=X(l).map((function(e){var t=u(e,2),n=t[0],i=t[1];return\"\".concat(n,'=\"').concat(i,'\"')})).join(\"\")}));return n.join(\";\")}(function(e){return e.map((function(e){var t,n,i={text:null===(t=e.$el_text)||void 0===t?void 0:t.slice(0,400),tag_name:e.tag_name,href:null===(n=e.attr__href)||void 0===n?void 0:n.slice(0,2048),attr_class:Kn(e),attr_id:e.attr__id,nth_child:e.nth_child,nth_of_type:e.nth_of_type,attributes:{}};return X(e).filter((function(e){return 0===u(e,1)[0].indexOf(\"attr__\")})).forEach((function(e){var t=u(e,2),n=t[0],r=t[1];return i.attributes[n]=r})),i}))}(e))}function Xn(e){return e.replace(/\"|\\\\\"/g,'\\\\\"')}function Kn(e){var t=e.attr__class;return t?m(t)?t:Fn(t):void 0}var Zn=\"[SessionRecording]\",ei=\"redacted\",ti={initiatorTypes:[\"audio\",\"beacon\",\"body\",\"css\",\"early-hint\",\"embed\",\"fetch\",\"frame\",\"iframe\",\"icon\",\"image\",\"img\",\"input\",\"link\",\"navigation\",\"object\",\"ping\",\"script\",\"track\",\"video\",\"xmlhttprequest\"],maskRequestFn:function(e){return e},recordHeaders:!1,recordBody:!1,recordInitialRequests:!1,recordPerformance:!1,performanceEntryTypeToObserve:[\"first-input\",\"navigation\",\"paint\",\"resource\"],payloadSizeLimitBytes:1e6,payloadHostDenyList:[\".lr-ingest.io\",\".ingest.sentry.io\"]},ni=[\"authorization\",\"x-forwarded-for\",\"authorization\",\"cookie\",\"set-cookie\",\"x-api-key\",\"x-real-ip\",\"remote-addr\",\"forwarded\",\"proxy-authorization\",\"x-csrf-token\",\"x-csrftoken\",\"x-xsrf-token\"],ii=[\"password\",\"secret\",\"passwd\",\"api_key\",\"apikey\",\"auth\",\"credentials\",\"mysql_pwd\",\"privatekey\",\"private_key\",\"token\"],ri=[\"/s/\",\"/e/\",\"/i/\"];function si(e,t,n,i){if(R(e))return e;var r=(null==t?void 0:t[\"content-length\"])||function(e){return new Blob([e]).size}(e);return S(r)&&(r=parseInt(r)),r>n?Zn+\" \".concat(i,\" body too large to record (\").concat(r,\" bytes)\"):e}function oi(e,t){if(R(e))return e;var n=e;return zn(n,!1)||(n=Zn+\" \"+t+\" body \"+ei),Q(ii,(function(e){var i,r;null!==(i=n)&&void 0!==i&&i.length&&-1!==(null===(r=n)||void 0===r?void 0:r.indexOf(e))&&(n=Zn+\" \"+t+\" body \"+ei+\" as might contain: \"+e)})),n}var ai,ui=function(e,n){var i,r,s,o={payloadSizeLimitBytes:ti.payloadSizeLimitBytes,performanceEntryTypeToObserve:l(ti.performanceEntryTypeToObserve),payloadHostDenyList:[].concat(l(n.payloadHostDenyList||[]),l(ti.payloadHostDenyList))},a=!1!==e.session_recording.recordHeaders&&n.recordHeaders,u=!1!==e.session_recording.recordBody&&n.recordBody,c=!1!==e.capture_performance&&n.recordPerformance,d=(i=o,s=Math.min(1e6,null!==(r=i.payloadSizeLimitBytes)&&void 0!==r?r:1e6),function(e){return null!=e&&e.requestBody&&(e.requestBody=si(e.requestBody,e.requestHeaders,s,\"Request\")),null!=e&&e.responseBody&&(e.responseBody=si(e.responseBody,e.responseHeaders,s,\"Response\")),e}),h=function(e){return d(function(e){var t=pt(e.name);if(!(t&&t.pathname&&ri.some((function(e){return 0===t.pathname.indexOf(e)}))))return e}((n=(t=e).requestHeaders,R(n)||Q(Object.keys(null!=n?n:{}),(function(e){ni.includes(e.toLowerCase())&&(n[e]=ei)})),t)));var t,n},f=y(e.session_recording.maskNetworkRequestFn);return f&&y(e.session_recording.maskCapturedNetworkRequestFn)&&G.warn(\"Both `maskNetworkRequestFn` and `maskCapturedNetworkRequestFn` are defined. `maskNetworkRequestFn` will be ignored.\"),f&&(e.session_recording.maskCapturedNetworkRequestFn=function(n){var i=e.session_recording.maskNetworkRequestFn({url:n.name});return t(t({},n),{},{name:null==i?void 0:i.url})}),o.maskRequestFn=y(e.session_recording.maskCapturedNetworkRequestFn)?function(t){var n,i,r,s=h(t);return s&&null!==(n=null===(i=(r=e.session_recording).maskCapturedNetworkRequestFn)||void 0===i?void 0:i.call(r,s))&&void 0!==n?n:void 0}:function(e){return function(e){if(!w(e))return e.requestBody=oi(e.requestBody,\"Request\"),e.responseBody=oi(e.responseBody,\"Response\"),e}(h(e))},t(t(t({},ti),o),{},{recordHeaders:a,recordBody:u,recordPerformance:c,recordInitialRequests:c})},li=s((function e(t){var n,r,s=this,a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};i(this,e),o(this,\"bucketSize\",100),o(this,\"refillRate\",10),o(this,\"mutationBuckets\",{}),o(this,\"loggedTracker\",{}),o(this,\"refillBuckets\",(function(){Object.keys(s.mutationBuckets).forEach((function(e){s.mutationBuckets[e]=s.mutationBuckets[e]+s.refillRate,s.mutationBuckets[e]>=s.bucketSize&&delete s.mutationBuckets[e]}))})),o(this,\"getNodeOrRelevantParent\",(function(e){var t=s.rrweb.mirror.getNode(e);if(\"svg\"!==(null==t?void 0:t.nodeName)&&t instanceof Element){var n=t.closest(\"svg\");if(n)return[s.rrweb.mirror.getId(n),n]}return[e,t]})),o(this,\"numberOfChanges\",(function(e){var t,n,i,r,s,o,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!==(s=null===(o=e.texts)||void 0===o?void 0:o.length)&&void 0!==s?s:0)+(null!==(a=null===(u=e.adds)||void 0===u?void 0:u.length)&&void 0!==a?a:0)})),o(this,\"throttleMutations\",(function(e){if(3!==e.type||0!==e.data.source)return e;var t=e.data,n=s.numberOfChanges(t);t.attributes&&(t.attributes=t.attributes.filter((function(e){var t,n,i,r=u(s.getNodeOrRelevantParent(e.id),2),o=r[0],a=r[1];if(0===s.mutationBuckets[o])return!1;(s.mutationBuckets[o]=null!==(t=s.mutationBuckets[o])&&void 0!==t?t:s.bucketSize,s.mutationBuckets[o]=Math.max(s.mutationBuckets[o]-1,0),0===s.mutationBuckets[o])&&(s.loggedTracker[o]||(s.loggedTracker[o]=!0,null===(n=(i=s.options).onBlockedNode)||void 0===n||n.call(i,o,a)));return e})));var i=s.numberOfChanges(t);return 0!==i||n===i?e:void 0})),this.rrweb=t,this.options=a,this.refillRate=null!==(n=this.options.refillRate)&&void 0!==n?n:this.refillRate,this.bucketSize=null!==(r=this.options.bucketSize)&&void 0!==r?r:this.bucketSize,setInterval((function(){s.refillBuckets()}),1e3)})),ci=3e5,di=[Rn.MouseMove,Rn.MouseInteraction,Rn.Scroll,Rn.ViewportResize,Rn.Input,Rn.TouchMove,Rn.MediaInteraction,Rn.Drag],hi=function(e){return{rrwebMethod:e,enqueuedAt:Date.now(),attempt:1}},fi=\"[SessionRecording]\",vi=function(){function e(t){var n=this;if(i(this,e),o(this,\"queuedRRWebEvents\",[]),o(this,\"isIdle\",!1),o(this,\"_linkedFlagSeen\",!1),o(this,\"_lastActivityTimestamp\",Date.now()),o(this,\"_linkedFlag\",null),o(this,\"_forceAllowLocalhostNetworkCapture\",!1),o(this,\"_samplingSessionListener\",null),this.instance=t,this._captureStarted=!1,this._endpoint=\"/s/\",this.stopRrweb=void 0,this.receivedDecide=!1,null==T||T.addEventListener(\"beforeunload\",(function(){n._flushBuffer()})),null==T||T.addEventListener(\"offline\",(function(){n._tryAddCustomEvent(\"browser offline\",{})})),null==T||T.addEventListener(\"online\",(function(){n._tryAddCustomEvent(\"browser online\",{})})),null==T||T.addEventListener(\"visibilitychange\",(function(){if(null!=L&&L.visibilityState){var e=\"window \"+L.visibilityState;n._tryAddCustomEvent(e,{})}})),!this.instance.sessionManager)throw G.error(fi+\" started without valid sessionManager\"),new Error(fi+\" started without valid sessionManager. This is a bug.\");var r=this.sessionManager.checkAndGetSessionAndWindowId(),s=r.sessionId,a=r.windowId;this.sessionId=s,this.windowId=a,this.buffer=this.clearBuffer(),this._setupSampling()}return s(e,[{key:\"rrwebRecord\",get:function(){var e;return null==U||null===(e=U.rrweb)||void 0===e?void 0:e.record}},{key:\"started\",get:function(){return this._captureStarted}},{key:\"sessionManager\",get:function(){if(!this.instance.sessionManager)throw new Error(fi+\" must be started with a valid sessionManager.\");return this.instance.sessionManager}},{key:\"fullSnapshotIntervalMillis\",get:function(){var e;return(null===(e=this.instance.config.session_recording)||void 0===e?void 0:e.full_snapshot_interval_millis)||ci}},{key:\"isSampled\",get:function(){var e=this.instance.get_property(Ee);return x(e)?e: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(_e),t=!this.instance.config.disable_session_recording;return T&&e&&t}},{key:\"isConsoleLogCaptureEnabled\",get:function(){var e=!!this.instance.get_property(me),t=this.instance.config.enable_recording_console_log;return null!=t?t:e}},{key:\"canvasRecording\",get:function(){var e=this.instance.get_property(be);return e&&e.fps&&e.quality?{enabled:e.enabled,fps:e.fps,quality:e.quality}:void 0}},{key:\"networkPayloadCapture\",get:function(){var e,t,n=this.instance.get_property(ye),i={recordHeaders:null===(e=this.instance.config.session_recording)||void 0===e?void 0:e.recordHeaders,recordBody:null===(t=this.instance.config.session_recording)||void 0===t?void 0:t.recordBody},r=(null==i?void 0:i.recordHeaders)||(null==n?void 0:n.recordHeaders),s=(null==i?void 0:i.recordBody)||(null==n?void 0:n.recordBody),o=b(this.instance.config.capture_performance)?this.instance.config.capture_performance.network_timing:this.instance.config.capture_performance,a=!!(x(o)?o:null==n?void 0:n.capturePerformance);return r||s||a?{recordHeaders:r,recordBody:s,recordPerformance:a}:void 0}},{key:\"sampleRate\",get:function(){var e=this.instance.get_property(ke);return F(e)?e:null}},{key:\"minimumDuration\",get:function(){var e=this.instance.get_property(we);return F(e)?e:null}},{key:\"status\",get:function(){return this.receivedDecide?this.isRecordingEnabled?R(this._linkedFlag)||this._linkedFlagSeen?x(this.isSampled)?this.isSampled?\"sampled\":\"disabled\":\"active\":\"buffering\":\"disabled\":\"buffering\"}},{key:\"startIfEnabledOrStop\",value:function(){this.isRecordingEnabled?(this._startCapture(),G.info(fi+\" started\")):(this.stopRecording(),this.clearBuffer())}},{key:\"stopRecording\",value:function(){this._captureStarted&&this.stopRrweb&&(this.stopRrweb(),this.stopRrweb=void 0,this._captureStarted=!1,G.info(fi+\" stopped\"))}},{key:\"makeSamplingDecision\",value:function(e){var t,n=this.sessionId!==e,i=this.sampleRate;if(F(i)){var r,s=this.isSampled,a=n||!x(s);if(a)r=Math.random()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:K()})}},{key:\"_startCapture\",value:function(){var e=this;w(Object.assign)||this._captureStarted||this.instance.config.disable_session_recording||this.instance.consent.isOptedOut()||(this._captureStarted=!0,this.sessionManager.checkAndGetSessionAndWindowId(),this.rrwebRecord?this._onScriptLoaded():this.instance.requestRouter.loadScript(\"/static/recorder.js?v=\".concat(f.LIB_VERSION),(function(t){if(t)return G.error(fi+\" could not load recorder.js\",t);e._onScriptLoaded()})))}},{key:\"isInteractiveEvent\",value:function(e){var t;return 3===e.type&&-1!==di.indexOf(null===(t=e.data)||void 0===t?void 0:t.source)}},{key:\"_updateWindowAndSessionIds\",value:function(e){var t=this.isInteractiveEvent(e);t||this.isIdle||e.timestamp-this._lastActivityTimestamp>3e5&&(this.isIdle=!0,clearTimeout(this._fullSnapshotTimer),this._flushBuffer());var n=!1;if(t&&(this._lastActivityTimestamp=e.timestamp,this.isIdle&&(this.isIdle=!1,this._tryAddCustomEvent(\"sessionNoLongerIdle\",{reason:\"user activity\",type:e.type}),n=!0)),!this.isIdle){var i=this.sessionManager.checkAndGetSessionAndWindowId(!t,e.timestamp),r=i.windowId,s=i.sessionId,o=this.sessionId!==s,a=this.windowId!==r;this.windowId=r,this.sessionId=s,(n||-1===[wn,Sn].indexOf(e.type)&&(a||o||w(this._fullSnapshotTimer)))&&this._tryTakeFullSnapshot()}}},{key:\"_tryRRWebMethod\",value:function(e){try{return e.rrwebMethod(),!0}catch(t){return this.queuedRRWebEvents.length<10?this.queuedRRWebEvents.push({enqueuedAt:e.enqueuedAt||Date.now(),attempt:e.attempt++,rrwebMethod:e.rrwebMethod}):G.warn(fi+\" could not emit queued rrweb event.\",t,e),!1}}},{key:\"_tryAddCustomEvent\",value:function(e,t){var n=this;return this._tryRRWebMethod(hi((function(){return n.rrwebRecord.addCustomEvent(e,t)})))}},{key:\"_tryTakeFullSnapshot\",value:function(){var e=this;return this._tryRRWebMethod(hi((function(){return e.rrwebRecord.takeFullSnapshot()})))}},{key:\"_onScriptLoaded\",value:function(){for(var e,n=this,i={blockClass:\"ph-no-capture\",blockSelector:void 0,ignoreClass:\"ph-ignore-input\",maskTextClass:\"ph-mask\",maskTextSelector:void 0,maskTextFn:void 0,maskAllInputs:!0,maskInputOptions:{password:!0},maskInputFn:void 0,slimDOMOptions:{},collectFonts:!1,inlineStylesheet:!0,recordCrossOriginIframes:!1},r=this.instance.config.session_recording,s=0,o=Object.entries(r||{});s10&&(t.data.payload.payload=t.data.payload.payload.slice(0,10),t.data.payload.payload.push(\"...[truncated]\"));for(var n=[],i=0;i2e3?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=kn(i);if(this._updateWindowAndSessionIds(i),!this.isIdle||i.type===In.Custom){var s={$snapshot_bytes:r,$snapshot_data:i,$session_id:this.sessionId,$window_id:this.windowId};\"disabled\"!==this.status?this._captureSnapshotBuffered(s):this.clearBuffer()}}}}},{key:\"_pageViewFallBack\",value:function(){if(!this.instance.config.capture_pageview&&T){var e=this._maskUrl(T.location.href);this._lastHref!==e&&(this._tryAddCustomEvent(\"$url_changed\",{href:e}),this._lastHref=e)}}},{key:\"_processQueuedEvents\",value:function(){var e=this;if(this.queuedRRWebEvents.length){var t=l(this.queuedRRWebEvents);this.queuedRRWebEvents=[],t.forEach((function(t){Date.now()-t.enqueuedAt<=2e3&&e._tryRRWebMethod(t)}))}}},{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={size:0,data:[],sessionId:this.sessionId,windowId:this.windowId},this.buffer}},{key:\"_flushBuffer\",value:function(){var e=this;this.flushBufferTimer&&(clearTimeout(this.flushBufferTimer),this.flushBufferTimer=void 0);var t=this.minimumDuration,n=this.sessionDuration,i=F(n)&&n>=0,r=F(t)&&i&&n0&&En(this.buffer).forEach((function(t){e._captureSnapshot({$snapshot_bytes:t.size,$snapshot_data:t.data,$session_id:t.sessionId,$window_id:t.windowId})}));return 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.size+e.$snapshot_bytes+i>943718.4||this.buffer.sessionId!==this.sessionId)&&(this.buffer=this._flushBuffer()),this.buffer.size+=e.$snapshot_bytes,this.buffer.data.push(e.$snapshot_data),this.flushBufferTimer||(this.flushBufferTimer=setTimeout((function(){n._flushBuffer()}),2e3))}},{key:\"_captureSnapshot\",value:function(e){this.instance.capture(\"$snapshot\",e,{_url:this.instance.requestRouter.endpointFor(\"api\",this._endpoint),_noTruncate:!0,_batchKey:\"recordings\"})}},{key:\"overrideLinkedFlag\",value:function(){this._linkedFlagSeen=!0}}]),e}(),pi=function(){function e(t){i(this,e),this.instance=t,this.instance.decideEndpointWasHit=this.instance._hasBootstrappedFeatureFlags()}return s(e,[{key:\"call\",value:function(){var e=this,t={token:this.instance.config.token,distinct_id:this.instance.get_distinct_id(),groups:this.instance.getGroups(),person_properties:this.instance.get_property(Fe),group_properties:this.instance.get_property(xe),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({method:\"POST\",url:this.instance.requestRouter.endpointFor(\"api\",\"/decide/?v=3\"),data:t,compression:this.instance.config.disable_compression?void 0:re.Base64,timeout:this.instance.config.feature_flag_request_timeout_ms,callback:function(t){return e.parseDecideResponse(t.json)}})}},{key:\"parseDecideResponse\",value:function(e){var t=this;this.instance.featureFlags.setReloadingPaused(!1),this.instance.featureFlags._startReloadTimer();var n=!e;if(this.instance.config.advanced_disable_feature_flags_on_first_load||this.instance.config.advanced_disable_feature_flags||this.instance.featureFlags.receivedFeatureFlags(null!=e?e:{},n),n)G.error(\"Failed to fetch feature flags from PostHog.\");else{if(!L||!L.body)return G.info(\"document not ready yet, trying again in 500 milliseconds...\"),void setTimeout((function(){t.parseDecideResponse(e)}),500);if(this.instance._afterDecideResponse(e),e.siteApps)if(this.instance.config.opt_in_site_apps){var i,r=h(e.siteApps);try{var s=function(){var e=i.value,n=e.id,r=e.url,s=t.instance.requestRouter.endpointFor(\"api\",r);U[\"__$$ph_site_app_\".concat(n)]=t.instance,t.instance.requestRouter.loadScript(s,(function(e){if(e)return G.error(\"Error while initializing PostHog app with config id \".concat(n),e)}))};for(r.s();!(i=r.n()).done;)s()}catch(e){r.e(e)}finally{r.f()}}else e.siteApps.length>0&&G.error('PostHog site apps are disabled. Enable the \"opt_in_site_apps\" config to proceed.')}}}]),e}(),gi=null!=T&&T.location?yt(T.location.hash,\"__posthog\")||yt(location.hash,\"state\"):null,_i=\"_postHogToolbarParams\";!function(e){e[e.UNINITIALIZED=0]=\"UNINITIALIZED\",e[e.LOADING=1]=\"LOADING\",e[e.LOADED=2]=\"LOADED\"}(ai||(ai={}));var mi=function(){function e(t){i(this,e),this.instance=t}return s(e,[{key:\"setToolbarState\",value:function(e){U.ph_toolbar_state=e}},{key:\"getToolbarState\",value:function(){var e;return null!==(e=U.ph_toolbar_state)&&void 0!==e?e:ai.UNINITIALIZED}},{key:\"maybeLoadToolbar\",value:function(){var e,t,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:void 0,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:void 0,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:void 0;if(!T||!L)return!1;n=null!==(e=n)&&void 0!==e?e:T.location,r=null!==(t=r)&&void 0!==t?t:T.history;try{if(!i){try{T.localStorage.setItem(\"test\",\"test\"),T.localStorage.removeItem(\"test\")}catch(e){return!1}i=null==T?void 0:T.localStorage}var s,o=gi||yt(n.hash,\"__posthog\")||yt(n.hash,\"state\"),a=o?Z((function(){return JSON.parse(atob(decodeURIComponent(o)))}))||Z((function(){return JSON.parse(decodeURIComponent(o))})):null;return a&&\"ph_authorize\"===a.action?((s=a).source=\"url\",s&&Object.keys(s).length>0&&(a.desiredHash?n.hash=a.desiredHash:r?r.replaceState(r.state,\"\",n.pathname+n.search):n.hash=\"\")):((s=JSON.parse(i.getItem(_i)||\"{}\")).source=\"localstorage\",delete s.userIntent),!(!s.token||this.instance.config.token!==s.token)&&(this.loadToolbar(s),!0)}catch(e){return!1}}},{key:\"_callLoadToolbar\",value:function(e){(U.ph_load_toolbar||U.ph_load_editor)(e,this.instance)}},{key:\"loadToolbar\",value:function(e){var n=this,i=!(null==L||!L.getElementById(qe));if(!T||i)return!1;var r=\"custom\"===this.instance.requestRouter.region&&this.instance.config.advanced_disable_toolbar_metrics,s=t(t({token:this.instance.config.token},e),{},{apiURL:this.instance.requestRouter.endpointFor(\"ui\")},r?{instrument:!1}:{});if(T.localStorage.setItem(_i,JSON.stringify(t(t({},s),{},{source:void 0}))),this.getToolbarState()===ai.LOADED)this._callLoadToolbar(s);else if(this.getToolbarState()===ai.UNINITIALIZED){this.setToolbarState(ai.LOADING);var o=3e5,a=Math.floor(Date.now()/o)*o;this.instance.requestRouter.loadScript(\"/static/toolbar.js?t=\".concat(a),(function(e){if(e)return G.error(\"Failed to load toolbar\",e),void n.setToolbarState(ai.UNINITIALIZED);n.setToolbarState(ai.LOADED),n._callLoadToolbar(s)})),oe(T,\"turbolinks:load\",(function(){n.setToolbarState(ai.UNINITIALIZED),n.loadToolbar(s)}))}return!0}},{key:\"_loadEditor\",value:function(e){return this.loadToolbar(e)}},{key:\"maybeLoadEditor\",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:void 0,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:void 0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:void 0;return this.maybeLoadToolbar(e,t,n)}}]),e}(),yi=function(){function e(t){i(this,e),o(this,\"isPaused\",!0),o(this,\"queue\",[]),o(this,\"flushTimeoutMs\",3e3),this.sendRequest=t}return s(e,[{key:\"enqueue\",value:function(e){this.queue.push(e),this.flushTimeout||this.setFlushTimeout()}},{key:\"unload\",value:function(){var e=this;this.clearFlushTimeout();var n=this.queue.length>0?this.formatQueue():{},i=Object.values(n);[].concat(l(i.filter((function(e){return 0===e.url.indexOf(\"/e\")}))),l(i.filter((function(e){return 0!==e.url.indexOf(\"/e\")})))).map((function(n){e.sendRequest(t(t({},n),{},{transport:\"sendBeacon\"}))}))}},{key:\"enable\",value:function(){this.isPaused=!1,this.setFlushTimeout()}},{key:\"setFlushTimeout\",value:function(){var e=this;this.isPaused||(this.flushTimeout=setTimeout((function(){if(e.clearFlushTimeout(),e.queue.length>0){var t=e.formatQueue(),n=function(n){var i=t[n],r=(new Date).getTime();i.data&&m(i.data)&&Q(i.data,(function(e){e.offset=Math.abs(e.timestamp-r),delete e.timestamp})),e.sendRequest(i)};for(var i in t)n(i)}}),this.flushTimeoutMs))}},{key:\"clearFlushTimeout\",value:function(){clearTimeout(this.flushTimeout),this.flushTimeout=void 0}},{key:\"formatQueue\",value:function(){var e={};return Q(this.queue,(function(n){var i,r=n,s=(r?r.batchKey:null)||r.url;w(e[s])&&(e[s]=t(t({},r),{},{data:[]})),null===(i=e[s].data)||void 0===i||i.push(r.data)})),this.queue=[],e}}]),e}(),bi=Uint8Array,ki=Uint16Array,wi=Uint32Array,Si=new bi([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]),Ei=new bi([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]),Ii=new bi([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),Ri=function(e,t){for(var n=new ki(31),i=0;i<31;++i)n[i]=t+=1<>>1|(21845&$i)<<1;Oi=(61680&(Oi=(52428&Oi)>>>2|(13107&Oi)<<2))>>>4|(3855&Oi)<<4,Ci[$i]=((65280&Oi)>>>8|(255&Oi)<<8)>>>1}var Mi=function(e,t,n){for(var i=e.length,r=0,s=new ki(t);r>>u]=l}else for(o=new ki(i),r=0;r>>15-e[r];return o},Ai=new bi(288);for($i=0;$i<144;++$i)Ai[$i]=8;for($i=144;$i<256;++$i)Ai[$i]=9;for($i=256;$i<280;++$i)Ai[$i]=7;for($i=280;$i<288;++$i)Ai[$i]=8;var Li=new bi(32);for($i=0;$i<32;++$i)Li[$i]=5;var Di=Mi(Ai,9,0),Ni=Mi(Li,5,0),qi=function(e){return(e/8>>0)+(7&e&&1)},Bi=function(e,t,n){(null==t||t<0)&&(t=0),(null==n||n>e.length)&&(n=e.length);var i=new(e instanceof ki?ki:e instanceof wi?wi:bi)(n-t);return i.set(e.subarray(t,n)),i},Hi=function(e,t,n){n<<=7&t;var i=t/8>>0;e[i]|=n,e[i+1]|=n>>>8},Ui=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},ji=function(e,t){for(var n=[],i=0;ih&&(h=s[i].s);var f=new ki(h+1),v=Gi(n[c-1],f,0);if(v>t){i=0;var p=0,g=v-t,_=1<t))break;p+=_-(1<>>=g;p>0;){var y=s[i].s;f[y]=0&&p;--i){var b=s[i].s;f[b]==t&&(--f[b],++p)}v=t}return[new bi(f),v]},Gi=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},Wi=function(e){for(var t=e.length;t&&!e[--t];);for(var n=new ki(++t),i=0,r=e[0],s=1,o=function(e){n[i++]=e},a=1;a<=t;++a)if(e[a]==r&&a!=t)++s;else{if(!r&&s>2){for(;s>138;s-=138)o(32754);s>2&&(o(s>10?s-11<<5|28690:s-3<<5|12305),s=0)}else if(s>3){for(o(r),--s;s>6;s-=6)o(8304);s>2&&(o(s-3<<5|8208),s=0)}for(;s--;)o(r);s=1,r=e[a]}return[n.subarray(0,i),t]},Vi=function(e,t){for(var n=0,i=0;i>>8,e[r+2]=255^e[r],e[r+3]=255^e[r+1];for(var s=0;s4&&!R[Ii[x-1]];--x);var P,T,C,$,O=l+5<<3,M=Vi(r,Ai)+Vi(s,Li)+o,A=Vi(r,h)+Vi(s,p)+o+14+3*x+Vi(S,R)+(2*S[16]+3*S[17]+7*S[18]);if(O<=M&&O<=A)return zi(t,c,e.subarray(u,u+l));if(Hi(t,c,1+(A15&&(Hi(t,c,q[E]>>>5&127),c+=q[E]>>>12)}}}else P=Di,T=Ai,C=Ni,$=Li;for(E=0;E255){B=i[E]>>>18&31;Ui(t,c,P[B+257]),c+=T[B+257],B>7&&(Hi(t,c,i[E]>>>23&31),c+=Si[B]);var H=31&i[E];Ui(t,c,C[H]),c+=$[H],H>3&&(Ui(t,c,i[E]>>>5&8191),c+=Ei[H])}else Ui(t,c,P[i[E]]),c+=T[i[E]];return Ui(t,c,P[256]),c+T[256]},Ji=new wi([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),Yi=new bi(0),Xi=function(){for(var e=new wi(256),t=0;t<256;++t){for(var n=t,i=9;--i;)n=(1&n&&3988292384)^n>>>1;e[t]=n}return e}(),Ki=function(e,t,n,i,r){return function(e,t,n,i,r,s){var o=e.length,a=new bi(i+o+5*(1+Math.floor(o/7e3))+r),u=a.subarray(i,a.length-r),l=0;if(!t||o<8)for(var c=0;c<=o;c+=65535){var d=c+65535;d>>13,v=8191&h,p=(1<7e3||R>24576)&&$>423){l=Qi(e,u,0,k,w,S,I,R,x,c-x,l),R=E=I=0,x=c;for(var O=0;O<286;++O)w[O]=0;for(O=0;O<30;++O)S[O]=0}var M=2,A=0,L=v,D=T-C&32767;if($>2&&P==b(c-D))for(var N=Math.min(f,$)-1,q=Math.min(32767,c),B=Math.min(258,$);D<=q&&--L&&T!=C;){if(e[c+M]==e[c+M-D]){for(var H=0;HM){if(M=H,A=D,H>N)break;var U=Math.min(D,H-2),j=0;for(O=0;Oj&&(j=W,C=G)}}}D+=(T=C)-(C=g[T])+32768&32767}if(A){k[R++]=268435456|Pi[M]<<18|Ti[A];var V=31&Pi[M],z=31&Ti[A];I+=Si[V]+Ei[z],++w[257+V],++S[z],F=c+M,++E}else k[R++]=e[c],++w[e[c]]}}l=Qi(e,u,s,k,w,S,I,R,x,c-x,l),s||(l=zi(u,l,Yi))}return Bi(a,0,i+qi(l)+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)},Zi=function(e,t,n){for(;n;++t)e[t]=n,n>>>=8};function er(e,t){void 0===t&&(t={});var n=function(){var e=4294967295;return{p:function(t){for(var n=e,i=0;i>>8;e=n},d:function(){return 4294967295^e}}}(),i=e.length;n.p(e);var r,s=Ki(e,t,10+((r=t).filename&&r.filename.length+1||0),8),o=s.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&&Zi(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)}}(s,t),Zi(s,o-8,n.d()),Zi(s,o-4,i),s}var tr=!!q||!!N,nr=\"text/plain\",ir=function(e,n){var i=u(e.split(\"?\"),2),r=i[0],s=i[1],o=t({},n);null==s||s.split(\"&\").forEach((function(e){var t=u(e.split(\"=\"),1)[0];delete o[t]}));var a=_t(o);return a=a?(s?s+\"&\":\"\")+a:s,\"\".concat(r,\"?\").concat(a)},rr=function(e){return\"data=\"+encodeURIComponent(\"string\"==typeof e?e:JSON.stringify(e))},sr=function(e){var t=e.data,n=e.compression;if(t){if(n===re.GZipJS){var i=er(function(e,t){var n=e.length;if(!t&&\"undefined\"!=typeof TextEncoder)return(new TextEncoder).encode(e);for(var i=new bi(e.length+(e.length>>>1)),r=0,s=function(e){i[r++]=e},o=0;oi.length){var a=new bi(r+8+(n-o<<1));a.set(i),i=a}var u=e.charCodeAt(o);u<128||t?s(u):u<2048?(s(192|u>>>6),s(128|63&u)):u>55295&&u<57344?(s(240|(u=65536+(1047552&u)|1023&e.charCodeAt(++o))>>>18),s(128|u>>>12&63),s(128|u>>>6&63),s(128|63&u)):(s(224|u>>>12),s(128|u>>>6&63),s(128|63&u))}return Bi(i,0,r)}(JSON.stringify(t)),{mtime:0});return{contentType:nr,body:new Blob([i],{type:nr})}}if(n===re.Base64){var r=function(e){var t,n,i,r,s,o=\"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=\",a=0,u=0,l=\"\",c=[];if(!e)return e;e=se(e);do{t=(s=e.charCodeAt(a++)<<16|e.charCodeAt(a++)<<8|e.charCodeAt(a++))>>18&63,n=s>>12&63,i=s>>6&63,r=63&s,c[u++]=o.charAt(t)+o.charAt(n)+o.charAt(i)+o.charAt(r)}while(a0&&(r.url=ir(r.url,{retry_count:i})),this.instance._send_request(t(t({},r),{},{callback:function(e){var s;200!==e.statusCode&&(e.statusCode<400||e.statusCode>=500)&&(null!=i?i:0)<10?n.enqueue(t({retriesPerformedSoFar:i},r)):null===(s=r.callback)||void 0===s||s.call(r,e)}}))}},{key:\"enqueue\",value:function(e){var t=e.retriesPerformedSoFar||0;e.retriesPerformedSoFar=t+1;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=Date.now()+n;this.queue.push({retryAt:i,requestOptions:e});var r=\"Enqueued failed request for retry in \".concat(n);navigator.onLine||(r+=\" (Browser is offline)\"),G.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.pollIntervalMs)}},{key:\"flush\",value:function(){var e=Date.now(),t=[],n=this.queue.filter((function(n){return n.retryAt0){var i,r=h(n);try{for(r.s();!(i=r.n()).done;){var s=i.value.requestOptions;this.retriableRequest(s)}}catch(e){r.e(e)}finally{r.f()}}}},{key:\"unload\",value:function(){this.poller&&(clearTimeout(this.poller),this.poller=void 0);var e,n=h(this.queue);try{for(n.s();!(e=n.n()).done;){var i=e.value.requestOptions;try{this.instance._send_request(t(t({},i),{},{transport:\"sendBeacon\"}))}catch(e){G.error(e)}}}catch(e){n.e(e)}finally{n.f()}this.queue=[]}}]),e}(),cr=1800,dr=function(){function e(t,n,r,s){var a;i(this,e),o(this,\"_sessionIdChangedHandlers\",[]),this.config=t,this.persistence=n,this._windowId=void 0,this._sessionId=void 0,this._sessionStartTimestamp=null,this._sessionActivityTimestamp=null,this._sessionIdGenerator=r||Ke,this._windowIdGenerator=s||Ke;var u=t.persistence_name||t.token,l=t.session_idle_timeout_seconds||cr;if(F(l)?l>cr?G.warn(\"session_idle_timeout_seconds cannot be greater than 30 minutes. Using 30 minutes instead.\"):l<60&&G.warn(\"session_idle_timeout_seconds cannot be less than 60 seconds. Using 60 seconds instead.\"):(G.warn(\"session_idle_timeout_seconds must be a number. Defaulting to 30 minutes.\"),l=cr),this._sessionTimeoutMs=1e3*Math.min(Math.max(l,60),cr),this._window_id_storage_key=\"ph_\"+u+\"_window_id\",this._primary_window_exists_storage_key=\"ph_\"+u+\"_primary_window_exists\",this._canUseSessionStorage()){var c=ft.parse(this._window_id_storage_key),d=ft.parse(this._primary_window_exists_storage_key);c&&!d?this._windowId=c:ft.remove(this._window_id_storage_key),ft.set(this._primary_window_exists_storage_key,!0)}if(null!==(a=this.config.bootstrap)&&void 0!==a&&a.sessionID)try{var h=function(e){var t=e.replace(/-/g,\"\");if(32!==t.length)throw new Error(\"Not a valid UUID\");if(\"7\"!==t[12])throw new Error(\"Not a UUIDv7\");return parseInt(t.substring(0,12),16)}(this.config.bootstrap.sessionID);this._setSessionId(this.config.bootstrap.sessionID,(new Date).getTime(),h)}catch(e){G.error(\"Invalid sessionID in bootstrap\",e)}this._listenToReloadWindow()}return s(e,[{key:\"onSessionId\",value:function(e){var t=this;return w(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&&ft.is_supported()}},{key:\"_setWindowId\",value:function(e){e!==this._windowId&&(this._windowId=e,this._canUseSessionStorage()&&ft.set(this._window_id_storage_key,e))}},{key:\"_getWindowId\",value:function(){return this._windowId?this._windowId:this._canUseSessionStorage()?ft.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(o({},Se,[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[Se];return m(e)&&2===e.length&&e.push(e[0]),e||[0,null,0]}},{key:\"resetSessionId\",value:function(){this._setSessionId(null,null,null)}},{key:\"_listenToReloadWindow\",value:function(){var e=this;null==T||T.addEventListener(\"beforeunload\",(function(){e._canUseSessionStorage()&&ft.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=u(this._getSessionId(),3),i=n[0],r=n[1],s=n[2],o=this._getWindowId(),a=s&&s>0&&Math.abs(t-s)>864e5,l=!1,c=!r,d=!e&&Math.abs(t-i)>this._sessionTimeoutMs;c||d||a?(r=this._sessionIdGenerator(),o=this._windowIdGenerator(),G.info(\"[SessionId] new session ID generated\",{sessionId:r,windowId:o,changeReason:{noSessionId:c,activityTimeout:d,sessionPastMaximumLength:a}}),s=t,l=!0):o||(o=this._windowIdGenerator(),l=!0);var h=0===i||!e||a?t:i,f=0===s?(new Date).getTime():s;return this._setWindowId(o),this._setSessionId(r,h,f),l&&this._sessionIdChangedHandlers.forEach((function(e){return e(r,o)})),{sessionId:r,windowId:o,sessionStartTimestamp:f}}}]),e}();!function(e){e.US=\"us\",e.EU=\"eu\",e.CUSTOM=\"custom\"}(ur||(ur={}));var hr=\"i.posthog.com\",fr=function(){function e(t){i(this,e),o(this,\"_regionCache\",{}),this.instance=t}return s(e,[{key:\"apiHost\",get:function(){return this.instance.config.api_host.trim().replace(/\\/$/,\"\")}},{key:\"uiHost\",get:function(){var e,t=null===(e=this.instance.config.ui_host)||void 0===e?void 0:e.replace(/\\/$/,\"\");return\"https://app.posthog.com\"===t?\"https://us.posthog.com\":t}},{key:\"region\",get:function(){return this._regionCache[this.apiHost]||(/https:\\/\\/(app|us|us-assets)(\\.i)?\\.posthog\\.com/i.test(this.apiHost)?this._regionCache[this.apiHost]=ur.US:/https:\\/\\/(eu|eu-assets)(\\.i)?\\.posthog\\.com/i.test(this.apiHost)?this._regionCache[this.apiHost]=ur.EU:this._regionCache[this.apiHost]=ur.CUSTOM),this._regionCache[this.apiHost]}},{key:\"endpointFor\",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:\"\";if(t&&(t=\"/\"===t[0]?t:\"/\".concat(t)),\"ui\"===e)return(this.uiHost||this.apiHost.replace(\".\".concat(hr),\".posthog.com\"))+t;if(this.region===ur.CUSTOM)return this.apiHost+t;var n=hr+t;switch(e){case\"assets\":return\"https://\".concat(this.region,\"-assets.\").concat(n);case\"api\":return\"https://\".concat(this.region,\".\").concat(n)}}},{key:\"loadScript\",value:function(e,t){if(this.instance.config.disable_external_dependency_loading)return G.warn(\"\".concat(e,\" was requested but loading of external scripts is disabled.\")),t(\"Loading of external scripts is disabled\");var n=\"/\"===e[0]?this.endpointFor(\"assets\",e):e,i=function(){if(!L)return t(\"document not found\");var e=L.createElement(\"script\");e.type=\"text/javascript\",e.src=n,e.onload=function(e){return t(void 0,e)},e.onerror=function(e){return t(e)};var i,r=L.querySelectorAll(\"body > script\");r.length>0?null===(i=r[0].parentNode)||void 0===i||i.insertBefore(e,r[0]):L.body.appendChild(e)};null!=L&&L.body?i():null==L||L.addEventListener(\"DOMContentLoaded\",i)}}]),e}(),vr=\"/e/\",pr=\"[Exception Capture]\",gr=function(){function e(t){var n,r,s=this;i(this,e),o(this,\"originalOnUnhandledRejectionHandler\",void 0),o(this,\"startCapturing\",(function(){var e;if(T&&s.isEnabled&&!s.hasHandlers&&(null===(e=T.onerror)||void 0===e||!e.__POSTHOG_INSTRUMENTED__)){var t=T.posthogErrorWrappingFunctions.wrapOnError,n=T.posthogErrorWrappingFunctions.wrapUnhandledRejection;if(t&&n)try{s.unwrapOnError=t(s.captureException.bind(s)),s.unwrapUnhandledRejection=n(s.captureException.bind(s))}catch(e){G.error(pr+\" failed to start\",e),s.stopCapturing()}else G.error(pr+\" failed to load error wrapping functions - cannot start\")}})),this.instance=t,this.remoteEnabled=!(null===(n=this.instance.persistence)||void 0===n||!n.props[ve]),this._endpoint=(null===(r=this.instance.persistence)||void 0===r?void 0:r.props[pe])||vr,this.startIfEnabled()}return s(e,[{key:\"endpoint\",get:function(){return this._endpoint}},{key:\"isEnabled\",get:function(){var e;return null!==(e=this.remoteEnabled)&&void 0!==e&&e}},{key:\"isCapturing\",get:function(){var e;return!(null==T||null===(e=T.onerror)||void 0===e||!e.__POSTHOG_INSTRUMENTED__)}},{key:\"hasHandlers\",get:function(){return this.originalOnUnhandledRejectionHandler||this.unwrapOnError}},{key:\"startIfEnabled\",value:function(){this.isEnabled&&!this.isCapturing&&(G.info(pr+\" enabled, starting...\"),this.loadScript(this.startCapturing))}},{key:\"loadScript\",value:function(e){this.hasHandlers&&e(),this.instance.requestRouter.loadScript(\"/static/exception-autocapture.js?v=\".concat(f.LIB_VERSION),(function(t){if(t)return G.error(pr+\" failed to load script\",t);e()}))}},{key:\"stopCapturing\",value:function(){var e,t;null===(e=this.unwrapOnError)||void 0===e||e.call(this),null===(t=this.unwrapUnhandledRejection)||void 0===t||t.call(this)}},{key:\"afterDecideResponse\",value:function(e){var t=e.autocaptureExceptions;this.remoteEnabled=!!t||!1,this._endpoint=b(t)&&t.endpoint||vr,this.instance.persistence&&(this.instance.persistence.register(o({},ve,this.remoteEnabled)),this.instance.persistence.register(o({},pe,this._endpoint))),this.startIfEnabled()}},{key:\"captureException\",value:function(e){var t=this.instance.requestRouter.endpointFor(\"ui\");e.$exception_personURL=\"\".concat(t,\"/project/\").concat(this.instance.config.token,\"/person/\").concat(this.instance.get_distinct_id()),this.sendExceptionEvent(e)}},{key:\"sendExceptionEvent\",value:function(e){this.instance.capture(\"$exception\",e,{_noTruncate:!0,_batchKey:\"exceptionEvent\",_url:this.endpoint})}}]),e}(),_r=\"posthog-js\";function mr(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=t.organization,i=t.projectId,r=t.prefix,s=t.severityAllowList,o=void 0===s?[\"error\"]:s;return function(t){var s,a,u,l,c,d;if(!(\"*\"===o||o.includes(t.level))||!e.__loaded)return t;t.tags||(t.tags={});var h=e.requestRouter.endpointFor(\"ui\",\"/project/\".concat(e.config.token,\"/person/\").concat(e.get_distinct_id()));t.tags[\"PostHog Person URL\"]=h,e.sessionRecordingStarted()&&(t.tags[\"PostHog Recording URL\"]=e.get_session_replay_url({withTimestamp:!0}));var f=(null===(s=t.exception)||void 0===s?void 0:s.values)||[],v={$exception_message:(null===(a=f[0])||void 0===a?void 0:a.value)||t.message,$exception_type:null===(u=f[0])||void 0===u?void 0:u.type,$exception_personURL:h,$exception_level:t.level,$sentry_event_id:t.event_id,$sentry_exception:t.exception,$sentry_exception_message:(null===(l=f[0])||void 0===l?void 0:l.value)||t.message,$sentry_exception_type:null===(c=f[0])||void 0===c?void 0:c.type,$sentry_tags:t.tags,$level:t.level};return n&&i&&(v.$sentry_url=(r||\"https://sentry.io/organizations/\")+n+\"/issues/?project=\"+i+\"&query=\"+t.event_id),e.capture(\"$exception\",v,{_url:(null===(d=e.exceptionObserver)||void 0===d?void 0:d.endpoint)||vr}),t}}var yr=s((function e(t,n,r,s,o){i(this,e),this.name=_r,this.setupOnce=function(e){e(mr(t,{organization:n,projectId:r,prefix:s,severityAllowList:o}))}}));function br(e,t){var n=e.config.segment;if(!n)return t();!function(e,t){var n=e.config.segment;if(!n)return t();var i=function(n){var i=function(){return n.anonymousId()||Ke()};e.config.get_device_id=i,n.id()&&(e.register({distinct_id:n.id(),$device_id:i()}),e.persistence.set_property($e,\"identified\")),t()},r=n.user();\"then\"in r&&y(r.then)?r.then((function(e){return i(e)})):i(r)}(e,(function(){n.register(function(e){Promise&&Promise.resolve||G.warn(\"This browser does not have Promise support, and can not use the segment integration\");var t=function(t,n){var i;if(!n)return t;t.event.userId||t.event.anonymousId===e.get_distinct_id()||e.reset(),t.event.userId&&t.event.userId!==e.get_distinct_id()&&(e.register({distinct_id:t.event.userId}),e.reloadFeatureFlags());var r=e._calculate_event_properties(n,null!==(i=t.event.properties)&&void 0!==i?i:{},new Date);return t.event.properties=Object.assign({},r,t.event.properties),t};return{name:\"PostHog JS\",type:\"enrichment\",version:\"1.0.0\",isLoaded:function(){return!0},load:function(){return Promise.resolve()},track:function(e){return t(e,e.event.event)},page:function(e){return t(e,\"$pageview\")},identify:function(e){return t(e,\"$identify\")},screen:function(e){return t(e,\"$screen\")}}}(e)).then((function(){t()}))}))}var kr,wr,Sr,Er=function(){function e(t){i(this,e),this._instance=t}return s(e,[{key:\"doPageView\",value:function(e){var t,n=this._previousPageViewProperties(e);return this._currentPath=null!==(t=null==T?void 0:T.location.pathname)&&void 0!==t?t:\"\",this._instance.scrollManager.resetContext(),this._prevPageviewTimestamp=e,n}},{key:\"doPageLeave\",value:function(e){return this._previousPageViewProperties(e)}},{key:\"_previousPageViewProperties\",value:function(e){var t=this._currentPath,n=this._prevPageviewTimestamp,i=this._instance.scrollManager.getContext();if(!n)return{};var r={};if(i){var s=i.maxScrollHeight,o=i.lastScrollY,a=i.maxScrollY,u=i.maxContentHeight,l=i.lastContentY,c=i.maxContentY;if(!(w(s)||w(o)||w(a)||w(u)||w(l)||w(c)))s=Math.ceil(s),o=Math.ceil(o),a=Math.ceil(a),u=Math.ceil(u),l=Math.ceil(l),c=Math.ceil(c),r={$prev_pageview_last_scroll:o,$prev_pageview_last_scroll_percentage:s<=1?1:Ir(o/s,0,1),$prev_pageview_max_scroll:a,$prev_pageview_max_scroll_percentage:s<=1?1:Ir(a/s,0,1),$prev_pageview_last_content:l,$prev_pageview_last_content_percentage:u<=1?1:Ir(l/u,0,1),$prev_pageview_max_content:c,$prev_pageview_max_content_percentage:u<=1?1:Ir(c/u,0,1)}}return t&&(r.$prev_pageview_pathname=t),n&&(r.$prev_pageview_duration=(e.getTime()-n.getTime())/1e3),r}}]),e}();function Ir(e,t,n){return Math.max(t,Math.min(e,n))}!function(e){e.Popover=\"popover\",e.API=\"api\",e.Widget=\"widget\"}(kr||(kr={})),function(e){e.Open=\"open\",e.MultipleChoice=\"multiple_choice\",e.SingleChoice=\"single_choice\",e.Rating=\"rating\",e.Link=\"link\"}(wr||(wr={})),function(e){e.NextQuestion=\"next_question\",e.End=\"end\",e.ResponseBased=\"response_based\",e.SpecificQuestion=\"specific_question\"}(Sr||(Sr={}));var Rr=function(){function e(){i(this,e),o(this,\"events\",{}),this.events={}}return s(e,[{key:\"on\",value:function(e,t){var n=this;return this.events[e]||(this.events[e]=[]),this.events[e].push(t),function(){n.events[e]=n.events[e].filter((function(e){return e!==t}))}}},{key:\"emit\",value:function(e,t){var n,i=h(this.events[e]||[]);try{for(i.s();!(n=i.n()).done;){(0,n.value)(t)}}catch(e){i.e(e)}finally{i.f()}var r,s=h(this.events[\"*\"]||[]);try{for(s.s();!(r=s.n()).done;){(0,r.value)(e,t)}}catch(e){s.e(e)}finally{s.f()}}}]),e}(),Fr=function(){function e(t){var n=this;i(this,e),o(this,\"_debugEventEmitter\",new Rr),o(this,\"checkStep\",(function(e,t){return n.checkStepEvent(e,t)&&n.checkStepUrl(e,t)&&n.checkStepElement(e,t)})),o(this,\"checkStepEvent\",(function(e,t){return null==t||!t.event||(null==e?void 0:e.event)===(null==t?void 0:t.event)})),this.instance=t,this.actionEvents=new Set,this.actionRegistry=new Set}return s(e,[{key:\"init\",value:function(){var e,t=this;if(!w(null===(e=this.instance)||void 0===e?void 0:e._addCaptureHook)){var n;null===(n=this.instance)||void 0===n||n._addCaptureHook((function(e,n){t.on(e,n)}))}}},{key:\"register\",value:function(e){var t,n,i=this;if(!w(null===(t=this.instance)||void 0===t?void 0:t._addCaptureHook)&&(e.forEach((function(e){var t,n;null===(t=i.actionRegistry)||void 0===t||t.add(e),null===(n=e.steps)||void 0===n||n.forEach((function(e){var t;null===(t=i.actionEvents)||void 0===t||t.add((null==e?void 0:e.event)||\"\")}))})),null!==(n=this.instance)&&void 0!==n&&n.autocapture)){var r,s=new Set;e.forEach((function(e){var t;null===(t=e.steps)||void 0===t||t.forEach((function(e){null!=e&&e.selector&&s.add(null==e?void 0:e.selector)}))})),null===(r=this.instance)||void 0===r||r.autocapture.setElementSelectors(s)}}},{key:\"on\",value:function(e,t){var n,i=this;null!=t&&0!=e.length&&(this.actionEvents.has(e)||this.actionEvents.has(null==t?void 0:t.event))&&this.actionRegistry&&(null===(n=this.actionRegistry)||void 0===n?void 0:n.size)>0&&this.actionRegistry.forEach((function(e){i.checkAction(t,e)&&i._debugEventEmitter.emit(\"actionCaptured\",e.name)}))}},{key:\"_addActionHook\",value:function(e){this.onAction(\"actionCaptured\",(function(t){return e(t)}))}},{key:\"checkAction\",value:function(e,t){if(null==(null==t?void 0:t.steps))return!1;var n,i=h(t.steps);try{for(i.s();!(n=i.n()).done;){var r=n.value;if(this.checkStep(e,r))return!0}}catch(e){i.e(e)}finally{i.f()}return!1}},{key:\"onAction\",value:function(e,t){return this._debugEventEmitter.on(e,t)}},{key:\"checkStepUrl\",value:function(t,n){if(null!=n&&n.url){var i,r=null==t||null===(i=t.properties)||void 0===i?void 0:i.$current_url;if(!r||\"string\"!=typeof r)return!1;if(!e.matchString(r,null==n?void 0:n.url,(null==n?void 0:n.url_matching)||\"contains\"))return!1}return!0}},{key:\"checkStepElement\",value:function(t,n){if((null!=n&&n.href||null!=n&&n.tag_name||null!=n&&n.text)&&!this.getElementsList(t).some((function(t){return!(null!=n&&n.href&&!e.matchString(t.href||\"\",null==n?void 0:n.href,(null==n?void 0:n.href_matching)||\"exact\"))&&((null==n||!n.tag_name||t.tag_name===(null==n?void 0:n.tag_name))&&!(null!=n&&n.text&&!e.matchString(t.text||\"\",null==n?void 0:n.text,(null==n?void 0:n.text_matching)||\"exact\")&&!e.matchString(t.$el_text||\"\",null==n?void 0:n.text,(null==n?void 0:n.text_matching)||\"exact\")))})))return!1;if(null!=n&&n.selector){var i,r=null==t||null===(i=t.properties)||void 0===i?void 0:i.$element_selectors;if(!r)return!1;if(!r.includes(null==n?void 0:n.selector))return!1}return!0}},{key:\"getElementsList\",value:function(e){return null==(null==e?void 0:e.properties.$elements)?[]:null==e?void 0:e.properties.$elements}}],[{key:\"matchString\",value:function(t,n,i){switch(i){case\"regex\":return!!T&>(t,n);case\"exact\":return n===t;case\"contains\":var r=e.escapeStringRegexp(n).replace(/_/g,\".\").replace(/%/g,\".*\");return gt(t,r);default:return!1}}},{key:\"escapeStringRegexp\",value:function(e){return e.replace(/[|\\\\{}()[\\]^$+*?.]/g,\"\\\\$&\").replace(/-/g,\"\\\\x2d\")}}]),e}(),xr=function(){function e(t){i(this,e),this.instance=t,this.eventToSurveys=new Map,this.actionToSurveys=new Map}return s(e,[{key:\"register\",value:function(e){var t;w(null===(t=this.instance)||void 0===t?void 0:t._addCaptureHook)||(this.setupEventBasedSurveys(e),this.setupActionBasedSurveys(e))}},{key:\"setupActionBasedSurveys\",value:function(e){var t=this,n=e.filter((function(e){var t,n,i,r;return(null===(t=e.conditions)||void 0===t?void 0:t.actions)&&(null===(n=e.conditions)||void 0===n||null===(i=n.actions)||void 0===i||null===(r=i.values)||void 0===r?void 0:r.length)>0}));if(0!==n.length){if(null==this.actionMatcher){this.actionMatcher=new Fr(this.instance),this.actionMatcher.init();this.actionMatcher._addActionHook((function(e){t.onAction(e)}))}n.forEach((function(e){var n,i,r,s,o,a,u,l,c,d;e.conditions&&null!==(n=e.conditions)&&void 0!==n&&n.actions&&null!==(i=e.conditions)&&void 0!==i&&null!==(r=i.actions)&&void 0!==r&&r.values&&(null===(s=e.conditions)||void 0===s||null===(o=s.actions)||void 0===o||null===(a=o.values)||void 0===a?void 0:a.length)>0&&(null===(u=t.actionMatcher)||void 0===u||u.register(e.conditions.actions.values),null===(l=e.conditions)||void 0===l||null===(c=l.actions)||void 0===c||null===(d=c.values)||void 0===d||d.forEach((function(n){if(n&&n.name){var i=t.actionToSurveys.get(n.name);i&&i.push(e.id),t.actionToSurveys.set(n.name,i||[e.id])}})))}))}}},{key:\"setupEventBasedSurveys\",value:function(e){var t,n=this;if(0!==e.filter((function(e){var t,n,i,r;return(null===(t=e.conditions)||void 0===t?void 0:t.events)&&(null===(n=e.conditions)||void 0===n||null===(i=n.events)||void 0===i||null===(r=i.values)||void 0===r?void 0:r.length)>0})).length){null===(t=this.instance)||void 0===t||t._addCaptureHook((function(e,t){n.onEvent(e,t)})),e.forEach((function(e){var t,i,r;null===(t=e.conditions)||void 0===t||null===(i=t.events)||void 0===i||null===(r=i.values)||void 0===r||r.forEach((function(t){if(t&&t.name){var i=n.eventToSurveys.get(t.name);i&&i.push(e.id),n.eventToSurveys.set(t.name,i||[e.id])}}))}))}}},{key:\"onEvent\",value:function(t,n){var i,r,s=(null===(i=this.instance)||void 0===i||null===(r=i.persistence)||void 0===r?void 0:r.props[Te])||[];if(e.SURVEY_SHOWN_EVENT_NAME==t&&n&&s.length>0){var o,a=null==n||null===(o=n.properties)||void 0===o?void 0:o.$survey_id;if(a){var u=s.indexOf(a);u>=0&&(s.splice(u,1),this._updateActivatedSurveys(s))}}else this.eventToSurveys.has(t)&&this._updateActivatedSurveys(s.concat(this.eventToSurveys.get(t)||[]))}},{key:\"onAction\",value:function(e){var t,n,i=(null===(t=this.instance)||void 0===t||null===(n=t.persistence)||void 0===n?void 0:n.props[Te])||[];this.actionToSurveys.has(e)&&this._updateActivatedSurveys(i.concat(this.actionToSurveys.get(e)||[]))}},{key:\"_updateActivatedSurveys\",value:function(e){var t,n;null===(t=this.instance)||void 0===t||null===(n=t.persistence)||void 0===n||n.register(o({},Te,l(new Set(e))))}},{key:\"getSurveys\",value:function(){var e,t,n=null===(e=this.instance)||void 0===e||null===(t=e.persistence)||void 0===t?void 0:t.props[Te];return n||[]}},{key:\"getEventToSurveys\",value:function(){return this.eventToSurveys}},{key:\"_getActionMatcher\",value:function(){return this.actionMatcher}}]),e}();o(xr,\"SURVEY_SHOWN_EVENT_NAME\",\"survey shown\");var Pr=\"[Surveys]\",Tr={icontains:function(e){return!!T&&T.location.href.toLowerCase().indexOf(e.toLowerCase())>-1},not_icontains:function(e){return!!T&&-1===T.location.href.toLowerCase().indexOf(e.toLowerCase())},regex:function(e){return!!T&>(T.location.href,e)},not_regex:function(e){return!!T&&!gt(T.location.href,e)},exact:function(e){return(null==T?void 0:T.location.href)===e},is_not:function(e){return(null==T?void 0:T.location.href)!==e}};var Cr=function(){function e(t){i(this,e),this.instance=t,this._surveyEventReceiver=null}return s(e,[{key:\"afterDecideResponse\",value:function(e){this._decideServerResponse=!!e.surveys,this.loadIfEnabled()}},{key:\"loadIfEnabled\",value:function(){var e=this,t=null==U?void 0:U.extendPostHogWithSurveys;this.instance.config.disable_surveys||!this._decideServerResponse||t||(null==this._surveyEventReceiver&&(this._surveyEventReceiver=new xr(this.instance)),this.instance.requestRouter.loadScript(\"/static/surveys.js\",(function(t){if(t)return G.error(Pr,\"Could not load surveys script\",t);e._surveyManager=U.extendPostHogWithSurveys(e.instance)})))}},{key:\"getSurveys\",value:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(this.instance.config.disable_surveys)return e([]);null==this._surveyEventReceiver&&(this._surveyEventReceiver=new xr(this.instance));var i=this.instance.get_property(Pe);if(i&&!n)return e(i);this.instance._send_request({url:this.instance.requestRouter.endpointFor(\"api\",\"/api/surveys/?token=\".concat(this.instance.config.token)),method:\"GET\",transport:\"XHR\",callback:function(n){var i;if(200!==n.statusCode||!n.json)return e([]);var r,s=n.json.surveys||[],a=s.filter((function(e){var t,n,i,r,s,o,a,u,l,c,d,h;return(null===(t=e.conditions)||void 0===t?void 0:t.events)&&(null===(n=e.conditions)||void 0===n||null===(i=n.events)||void 0===i?void 0:i.values)&&(null===(r=e.conditions)||void 0===r||null===(s=r.events)||void 0===s||null===(o=s.values)||void 0===o?void 0:o.length)>0||(null===(a=e.conditions)||void 0===a?void 0:a.actions)&&(null===(u=e.conditions)||void 0===u||null===(l=u.actions)||void 0===l?void 0:l.values)&&(null===(c=e.conditions)||void 0===c||null===(d=c.actions)||void 0===d||null===(h=d.values)||void 0===h?void 0:h.length)>0}));a.length>0&&(null===(r=t._surveyEventReceiver)||void 0===r||r.register(a));return null===(i=t.instance.persistence)||void 0===i||i.register(o({},Pe,s)),e(s)}})}},{key:\"getActiveMatchingSurveys\",value:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]&&arguments[1];this.getSurveys((function(n){var i,r=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 s=null===(t=e.conditions)||void 0===t||!t.url||Tr[null!==(n=null===(i=e.conditions)||void 0===i?void 0:i.urlMatchType)&&void 0!==n?n:\"icontains\"](e.conditions.url),o=null===(r=e.conditions)||void 0===r||!r.selector||(null==L?void 0:L.querySelector(e.conditions.selector));return s&&o})),s=null===(i=t._surveyEventReceiver)||void 0===i?void 0:i.getSurveys(),o=r.filter((function(e){var n,i,r,o,a,u,l,c,d,h;if(!e.linked_flag_key&&!e.targeting_flag_key&&!e.internal_targeting_flag_key)return!0;var f=!e.linked_flag_key||t.instance.featureFlags.isFeatureEnabled(e.linked_flag_key),v=!e.targeting_flag_key||t.instance.featureFlags.isFeatureEnabled(e.targeting_flag_key),p=(null===(n=e.conditions)||void 0===n?void 0:n.events)&&(null===(i=e.conditions)||void 0===i||null===(r=i.events)||void 0===r?void 0:r.values)&&(null===(o=e.conditions)||void 0===o||null===(a=o.events)||void 0===a?void 0:a.values.length)>0,g=(null===(u=e.conditions)||void 0===u?void 0:u.actions)&&(null===(l=e.conditions)||void 0===l||null===(c=l.actions)||void 0===c?void 0:c.values)&&(null===(d=e.conditions)||void 0===d||null===(h=d.actions)||void 0===h?void 0:h.values.length)>0,_=!p&&!g||(null==s?void 0:s.includes(e.id)),m=t._canActivateRepeatedly(e),y=!(e.internal_targeting_flag_key&&!m)||t.instance.featureFlags.isFeatureEnabled(e.internal_targeting_flag_key);return f&&v&&y&&_}));return e(o)}),n)}},{key:\"getNextSurveyStep\",value:function(e,t,n){var i,r=e.questions[t],s=t+1;if(null===(i=r.branching)||void 0===i||!i.type)return t===e.questions.length-1?Sr.End:s;if(r.branching.type===Sr.End)return Sr.End;if(r.branching.type===Sr.SpecificQuestion){if(Number.isInteger(r.branching.index))return r.branching.index}else if(r.branching.type===Sr.ResponseBased){if(r.type===wr.SingleChoice){var o,a,u=r.choices.indexOf(\"\".concat(n));if(null!==(o=r.branching)&&void 0!==o&&null!==(a=o.responseValues)&&void 0!==a&&a.hasOwnProperty(u)){var l=r.branching.responseValues[u];return Number.isInteger(l)?l:l===Sr.End?Sr.End:s}}else if(r.type===wr.Rating){var c,d;if(\"number\"!=typeof n||!Number.isInteger(n))throw new Error(\"The response type must be an integer\");var h=function(e,t){if(3===t){if(e<1||e>3)throw new Error(\"The response must be in range 1-3\");return 1===e?\"negative\":2===e?\"neutral\":\"positive\"}if(5===t){if(e<1||e>5)throw new Error(\"The response must be in range 1-5\");return e<=2?\"negative\":3===e?\"neutral\":\"positive\"}if(10===t){if(e<0||e>10)throw new Error(\"The response must be in range 0-10\");return e<=6?\"detractors\":e<=8?\"passives\":\"promoters\"}throw new Error(\"The scale must be one of: 3, 5, 10\")}(n,r.scale);if(null!==(c=r.branching)&&void 0!==c&&null!==(d=c.responseValues)&&void 0!==d&&d.hasOwnProperty(h)){var f=r.branching.responseValues[h];return Number.isInteger(f)?f:f===Sr.End?Sr.End:s}}return s}return G.warn(Pr,\"Falling back to next question index due to unexpected branching type\"),s}},{key:\"_canActivateRepeatedly\",value:function(e){return R(U.__PosthogExtensions__.canActivateRepeatedly)&&G.warn(Pr,\"canActivateRepeatedly is not defined, must init before calling\"),U.__PosthogExtensions__.canActivateRepeatedly(e)}},{key:\"canRenderSurvey\",value:function(e){var t=this;R(this._surveyManager)?G.warn(Pr,\"canActivateRepeatedly is not defined, must init before calling\"):this.getSurveys((function(n){var i=n.filter((function(t){return t.id===e}))[0];t._surveyManager.canRenderSurvey(i)}))}},{key:\"renderSurvey\",value:function(e,t){var n=this;R(this._surveyManager)?G.warn(Pr,\"canActivateRepeatedly is not defined, must init before calling\"):this.getSurveys((function(i){var r=i.filter((function(t){return t.id===e}))[0];n._surveyManager.renderSurvey(r,null==L?void 0:L.querySelector(t))}))}}]),e}(),$r=function(){function e(t){var n,r,s=this;i(this,e),o(this,\"serverLimits\",{}),o(this,\"lastEventRateLimited\",!1),o(this,\"checkForLimiting\",(function(e){var t=e.text;if(t&&t.length)try{(JSON.parse(t).quota_limited||[]).forEach((function(e){G.info(\"[RateLimiter] \".concat(e||\"events\",\" is quota limited.\")),s.serverLimits[e]=(new Date).getTime()+6e4}))}catch(e){return void G.warn('[RateLimiter] could not rate limit - continuing. Error: \"'.concat(null==e?void 0:e.message,'\"'),{text:t})}})),this.instance=t,this.captureEventsPerSecond=(null===(n=t.config.rate_limiting)||void 0===n?void 0:n.events_per_second)||10,this.captureEventsBurstLimit=Math.max((null===(r=t.config.rate_limiting)||void 0===r?void 0:r.events_burst_limit)||10*this.captureEventsPerSecond,this.captureEventsPerSecond),this.lastEventRateLimited=this.clientRateLimitContext(!0).isRateLimited}return s(e,[{key:\"clientRateLimitContext\",value:function(){var e,t,n,i=arguments.length>0&&void 0!==arguments[0]&&arguments[0],r=(new Date).getTime(),s=null!==(e=null===(t=this.instance.persistence)||void 0===t?void 0:t.get_property(Me))&&void 0!==e?e:{tokens:this.captureEventsBurstLimit,last:r};s.tokens+=(r-s.last)/1e3*this.captureEventsPerSecond,s.last=r,s.tokens>this.captureEventsBurstLimit&&(s.tokens=this.captureEventsBurstLimit);var o=s.tokens<1;return o||i||(s.tokens=Math.max(0,s.tokens-1)),!o||this.lastEventRateLimited||i||this.instance.capture(\"$$client_ingestion_warning\",{$$client_ingestion_warning_message:\"posthog-js client rate limited. Config is set to \".concat(this.captureEventsPerSecond,\" events per second and \").concat(this.captureEventsBurstLimit,\" events burst limit.\")},{skip_client_rate_limiting:!0}),this.lastEventRateLimited=o,null===(n=this.instance.persistence)||void 0===n||n.set_property(Me,s),{isRateLimited:o,remainingTokens:s.tokens}}},{key:\"isServerRateLimited\",value:function(e){var t=this.serverLimits[e||\"events\"]||!1;return!1!==t&&(new Date).getTime()e?t.slice(0,e)+\"...\":t}var jr,Gr=function(){function e(t){i(this,e),o(this,\"_initialized\",!1),o(this,\"_isDisabledServerSide\",null),o(this,\"rageclicks\",new Dr),o(this,\"_elementsChainAsString\",!1),this.instance=t,this._elementSelectors=null}return s(e,[{key:\"config\",get:function(){var e,t,n=b(this.instance.config.autocapture)?this.instance.config.autocapture:{};return n.url_allowlist=null===(e=n.url_allowlist)||void 0===e?void 0:e.map((function(e){return new RegExp(e)})),n.url_ignorelist=null===(t=n.url_ignorelist)||void 0===t?void 0:t.map((function(e){return new RegExp(e)})),n}},{key:\"_addDomEventHandlers\",value:function(){var e=this;if(this.isBrowserSupported()){if(T&&L){var t=function(t){t=t||(null==T?void 0:T.event);try{e._captureEvent(t)}catch(e){G.error(\"Failed to capture event\",e)}},n=function(t){t=t||(null==T?void 0:T.event),e._captureEvent(t,Hr)};oe(L,\"submit\",t,!1,!0),oe(L,\"change\",t,!1,!0),oe(L,\"click\",t,!1,!0),this.config.capture_copied_text&&(oe(L,\"copy\",n,!1,!0),oe(L,\"cut\",n,!1,!0))}}else G.info(\"Disabling Automatic Event Collection because this browser is not supported\")}},{key:\"startIfEnabled\",value:function(){this.isEnabled&&!this._initialized&&(this._addDomEventHandlers(),this._initialized=!0)}},{key:\"afterDecideResponse\",value:function(e){e.elementsChainAsString&&(this._elementsChainAsString=e.elementsChainAsString),this.instance.persistence&&this.instance.persistence.register(o({},he,!!e.autocapture_opt_out)),this._isDisabledServerSide=!!e.autocapture_opt_out,this.startIfEnabled()}},{key:\"setElementSelectors\",value:function(e){this._elementSelectors=e}},{key:\"getElementSelectors\",value:function(e){var t,n=[];return null===(t=this._elementSelectors)||void 0===t||t.forEach((function(t){var i=null==L?void 0:L.querySelectorAll(t);null==i||i.forEach((function(i){e===i&&n.push(t)}))})),n}},{key:\"isEnabled\",get:function(){var e,t,n=null===(e=this.instance.persistence)||void 0===e?void 0:e.props[he],i=this._isDisabledServerSide;if(I(i)&&!x(n)&&!this.instance.config.advanced_disable_decide)return!1;var r=null!==(t=this._isDisabledServerSide)&&void 0!==t?t:!!n;return!!this.instance.config.autocapture&&!r}},{key:\"_previousElementSibling\",value:function(e){if(e.previousElementSibling)return e.previousElementSibling;var t=e;do{t=t.previousSibling}while(t&&!$n(t));return t}},{key:\"_getAugmentPropertiesFromElement\",value:function(e){if(!qn(e))return{};var t={};return Q(e.attributes,(function(e){if(e.name&&0===e.name.indexOf(\"data-ph-capture-attribute\")){var n=e.name.replace(\"data-ph-capture-attribute-\",\"\"),i=e.value;n&&i&&zn(i)&&(t[n]=i)}})),t}},{key:\"_getPropertiesFromElement\",value:function(e,t,n){var i,r=e.tagName.toLowerCase(),s={tag_name:r};Ln.indexOf(r)>-1&&!n&&(\"a\"===r.toLowerCase()||\"button\"===r.toLowerCase()?s.$el_text=Ur(1024,Qn(e)):s.$el_text=Ur(1024,Cn(e)));var o=Pn(e);o.length>0&&(s.classes=o.filter((function(e){return\"\"!==e})));var a=null===(i=this.config)||void 0===i?void 0:i.element_attribute_ignorelist;Q(e.attributes,(function(n){var i;if((!Bn(e)||-1!==[\"name\",\"id\",\"class\",\"aria-label\"].indexOf(n.name))&&((null==a||!a.includes(n.name))&&!t&&zn(n.value)&&(i=n.name,!S(i)||\"_ngcontent\"!==i.substring(0,10)&&\"_nghost\"!==i.substring(0,7)))){var r=n.value;\"class\"===n.name&&(r=Fn(r).join(\" \")),s[\"attr__\"+n.name]=Ur(1024,r)}}));for(var u=1,l=1,c=e;c=this._previousElementSibling(c);)u++,c.tagName===e.tagName&&l++;return s.nth_child=u,s.nth_of_type=l,s}},{key:\"_getDefaultProperties\",value:function(e){return{$event_type:e,$ce_version:1}}},{key:\"_getEventTarget\",value:function(e){return w(e.target)?e.srcElement||null:null!==(t=e.target)&&void 0!==t&&t.shadowRoot?e.composedPath()[0]||null:e.target||null;var t}},{key:\"_captureEvent\",value:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:\"$autocapture\";if(this.isEnabled){var i,r=this._getEventTarget(e);if(Mn(r)&&(r=r.parentNode||null),\"$autocapture\"===n&&\"click\"===e.type&&e instanceof MouseEvent)this.instance.config.rageclick&&null!==(i=this.rageclicks)&&void 0!==i&&i.isRageClick(e.clientX,e.clientY,(new Date).getTime())&&this._captureEvent(e,\"$rageclick\");var s=n===Hr;if(r&&Nn(r,e,this.config,s,s?[\"copy\",\"cut\"]:void 0)){for(var o,a,u=[r],l=r;l.parentNode&&!On(l,\"body\");)An(l.parentNode)?(u.push(l.parentNode.host),l=l.parentNode.host):(u.push(l.parentNode),l=l.parentNode);var c,d,h=[],f={},v=!1;if(Q(u,(function(e){var n=qn(e);\"a\"===e.tagName.toLowerCase()&&(c=e.getAttribute(\"href\"),c=n&&zn(c)&&c),Y(Pn(e),\"ph-no-capture\")&&(v=!0),h.push(t._getPropertiesFromElement(e,t.instance.config.mask_all_element_attributes,t.instance.config.mask_all_text));var i=t._getAugmentPropertiesFromElement(e);J(f,i)})),this.instance.config.mask_all_text||(\"a\"===r.tagName.toLowerCase()||\"button\"===r.tagName.toLowerCase()?h[0].$el_text=Qn(r):h[0].$el_text=Cn(r)),c){var p,g;h[0].attr__href=c;var _=null===(p=pt(c))||void 0===p?void 0:p.host,m=null==T||null===(g=T.location)||void 0===g?void 0:g.host;_&&m&&_!==m&&(d=c)}if(v)return!1;var y=J(this._getDefaultProperties(e.type),this._elementsChainAsString?{$elements_chain:Yn(h)}:{$elements:h},null!==(o=h[0])&&void 0!==o&&o.$el_text?{$el_text:null===(a=h[0])||void 0===a?void 0:a.$el_text}:{},d&&\"click\"===e.type?{$external_click_url:d}:{},f),b=this.getElementSelectors(r);if(b&&b.length>0&&(y.$element_selectors=b),n===Hr){var k,w=Tn(null==T||null===(k=T.getSelection())||void 0===k?void 0:k.toString()),S=e.type||\"clipboard\";if(!w)return!1;y.$selected_content=w,y.$copy_type=S}return this.instance.capture(n,y),!0}}}},{key:\"isBrowserSupported\",value:function(){return y(null==L?void 0:L.querySelectorAll)}}]),e}(),Wr=function(){function e(t){var n=this;i(this,e),o(this,\"_restoreXHRPatch\",void 0),o(this,\"_restoreFetchPatch\",void 0),o(this,\"_startCapturing\",(function(){w(n._restoreXHRPatch)&&U.postHogTracingHeadersPatchFns._patchXHR(n.instance.sessionManager),w(n._restoreFetchPatch)&&U.postHogTracingHeadersPatchFns._patchFetch(n.instance.sessionManager)})),this.instance=t}return s(e,[{key:\"_loadScript\",value:function(e){U.postHogTracingHeadersPatchFns&&e(),this.instance.requestRouter.loadScript(\"/static/tracing-headers.js?v=\".concat(f.LIB_VERSION),(function(t){if(t)return G.error(\"[TRACING-HEADERS] failed to load script\",t);e()}))}},{key:\"startIfEnabledOrStop\",value:function(){var e,t;this.instance.config.__add_tracing_headers?this._loadScript(this._startCapturing):(null===(e=this._restoreXHRPatch)||void 0===e||e.call(this),null===(t=this._restoreFetchPatch)||void 0===t||t.call(this),this._restoreXHRPatch=void 0,this._restoreFetchPatch=void 0)}}]),e}();!function(e){e[e.PENDING=-1]=\"PENDING\",e[e.DENIED=0]=\"DENIED\",e[e.GRANTED=1]=\"GRANTED\"}(jr||(jr={}));var Vr=function(){function e(t){i(this,e),this.instance=t}return s(e,[{key:\"config\",get:function(){return this.instance.config}},{key:\"consent\",get:function(){return this.getDnt()?jr.DENIED:this.storedConsent}},{key:\"isOptedOut\",value:function(){return this.consent===jr.DENIED||this.consent===jr.PENDING&&this.config.opt_out_capturing_by_default}},{key:\"isOptedIn\",value:function(){return!this.isOptedOut()}},{key:\"optInOut\",value:function(e){this.storage.set(this.storageKey,e?1:0,this.config.cookie_expiration,this.config.cross_subdomain_cookie,this.config.secure_cookie)}},{key:\"reset\",value:function(){this.storage.remove(this.storageKey,this.config.cross_subdomain_cookie)}},{key:\"storageKey\",get:function(){var e=this.instance.config,t=e.token;return(e.opt_out_capturing_cookie_prefix||\"__ph_opt_in_out_\")+t}},{key:\"storedConsent\",get:function(){var e=this.storage.get(this.storageKey);return\"1\"===e?jr.GRANTED:\"0\"===e?jr.DENIED:jr.PENDING}},{key:\"storage\",get:function(){if(!this._storage){var e=this.config.opt_out_capturing_persistence_type;this._storage=\"localStorage\"===e?at:st;var t=\"localStorage\"===e?st:at;t.get(this.storageKey)&&(this._storage.get(this.storageKey)||this.optInOut(\"1\"===t.get(this.storageKey)),t.remove(this.storageKey,this.config.cross_subdomain_cookie))}return this._storage}},{key:\"getDnt\",value:function(){return!!this.config.respect_dnt&&!!ae([null==A?void 0:A.doNotTrack,null==A?void 0:A.msDoNotTrack,U.doNotTrack],(function(e){return Y([!0,1,\"1\",\"yes\"],e)}))}}]),e}(),zr=9e5,Qr=\"[Web Vitals]\",Jr=function(){function e(n){var r,s=this;i(this,e),o(this,\"_enabledServerSide\",!1),o(this,\"_initialized\",!1),o(this,\"buffer\",{url:void 0,metrics:[],firstMetricTimestamp:void 0}),o(this,\"_flushToCapture\",(function(){clearTimeout(s._delayedFlushTimer),0!==s.buffer.metrics.length&&(s.instance.capture(\"$web_vitals\",s.buffer.metrics.reduce((function(e,n){var i;return t(t({},e),{},(o(i={},\"$web_vitals_\".concat(n.name,\"_event\"),t({},n)),o(i,\"$web_vitals_\".concat(n.name,\"_value\"),n.value),i))}),{})),s.buffer={url:void 0,metrics:[],firstMetricTimestamp:void 0})})),o(this,\"_addToBuffer\",(function(e){var n,i=null===(n=s.instance.sessionManager)||void 0===n?void 0:n.checkAndGetSessionAndWindowId(!0);if(w(i))G.error(Qr+\"Could not read session ID. Dropping metrics!\");else{s.buffer=s.buffer||{url:void 0,metrics:[],firstMetricTimestamp:void 0};var r=s._currentURL();if(!w(r))if(R(null==e?void 0:e.name)||R(null==e?void 0:e.value))G.error(Qr+\"Invalid metric received\",e);else if(s._maxAllowedValue&&e.value>=s._maxAllowedValue)G.error(Qr+\"Ignoring metric with value >= \"+s._maxAllowedValue,e);else s.buffer.url!==r&&(s._flushToCapture(),s._delayedFlushTimer=setTimeout(s._flushToCapture,8e3)),w(s.buffer.url)&&(s.buffer.url=r),s.buffer.firstMetricTimestamp=w(s.buffer.firstMetricTimestamp)?Date.now():s.buffer.firstMetricTimestamp,s.buffer.metrics.push(t(t({},e),{},{$current_url:r,$session_id:i.sessionId,$window_id:i.windowId,timestamp:Date.now()})),4===s.buffer.metrics.length&&s._flushToCapture()}})),o(this,\"_startCapturing\",(function(){var e=U.postHogWebVitalsCallbacks,t=e.onLCP,n=e.onCLS,i=e.onFCP,r=e.onINP;t&&n&&i&&r?(t(s._addToBuffer),n(s._addToBuffer),i(s._addToBuffer),r(s._addToBuffer),s._initialized=!0):G.error(Qr+\"web vitals callbacks not loaded - not starting\")})),this.instance=n,this._enabledServerSide=!(null===(r=this.instance.persistence)||void 0===r||!r.props[ge]),this.startIfEnabled()}return s(e,[{key:\"_maxAllowedValue\",get:function(){var e=b(this.instance.config.capture_performance)&&F(this.instance.config.capture_performance.__web_vitals_max_value)?this.instance.config.capture_performance.__web_vitals_max_value:zr;return 01&&void 0!==arguments[1]?arguments[1]:{},o=arguments.length>2?arguments[2]:void 0;if(w(e)||E(e))return G.critical(\"PostHog was initialized without a token. This likely indicates a misconfiguration. Please check the first argument passed to posthog.init()\"),this;if(this.__loaded)return G.warn(\"You have already initialized PostHog! Re-initializing is a no-op\"),this;this.__loaded=!0,this.config={},this._triggered_notifs=[],this.set_config(J({},es(),ts(s),{name:o,token:e})),this.config.on_xhr_error&&G.error(\"[posthog] on_xhr_error is deprecated. Use on_request_error instead\"),this.compression=s.disable_compression?void 0:re.GZipJS,this.persistence=new bn(this.config),this.sessionPersistence=\"sessionStorage\"===this.config.persistence?this.persistence:new bn(t(t({},this.config),{},{persistence:\"sessionStorage\"}));var a=t({},this.persistence.props),u=t({},this.sessionPersistence.props);if(this._requestQueue=new yi((function(e){return r._send_retriable_request(e)})),this._retryQueue=new lr(this),this.__request_queue=[],this.sessionManager=new dr(this.config,this.persistence),this.sessionPropsManager=new Mr(this.sessionManager,this.persistence),new Wr(this).startIfEnabledOrStop(),this.sessionRecording=new vi(this),this.sessionRecording.startIfEnabledOrStop(),this.config.disable_scroll_properties||this.scrollManager.startMeasuringScrollPosition(),this.autocapture=new Gr(this),this.autocapture.startIfEnabled(),this.surveys.loadIfEnabled(),this.heatmaps=new qr(this),this.heatmaps.startIfEnabled(),this.webVitalsAutocapture=new Jr(this),this.exceptionObserver=new gr(this),this.exceptionObserver.startIfEnabled(),f.DEBUG=f.DEBUG||this.config.debug,f.DEBUG&&G.info(\"Starting in debug mode\",{this:this,config:s,thisC:t({},this.config),p:a,s:u}),this._sync_opt_out_with_persistence(),void 0!==(null===(n=s.bootstrap)||void 0===n?void 0:n.distinctID)){var l,c,d=this.config.get_device_id(Ke()),h=null!==(l=s.bootstrap)&&void 0!==l&&l.isIdentifiedID?d:s.bootstrap.distinctID;this.persistence.set_property($e,null!==(c=s.bootstrap)&&void 0!==c&&c.isIdentifiedID?\"identified\":\"anonymous\"),this.register({distinct_id:s.bootstrap.distinctID,$device_id:h})}if(this._hasBootstrappedFeatureFlags()){var v,p,g=Object.keys((null===(v=s.bootstrap)||void 0===v?void 0:v.featureFlags)||{}).filter((function(e){var t,n;return!(null===(t=s.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=s.bootstrap)||void 0===n||null===(i=n.featureFlags)||void 0===i?void 0:i[t])||!1,e}),{}),_=Object.keys((null===(p=s.bootstrap)||void 0===p?void 0:p.featureFlagPayloads)||{}).filter((function(e){return g[e]})).reduce((function(e,t){var n,i,r,o;null!==(n=s.bootstrap)&&void 0!==n&&null!==(i=n.featureFlagPayloads)&&void 0!==i&&i[t]&&(e[t]=null===(r=s.bootstrap)||void 0===r||null===(o=r.featureFlagPayloads)||void 0===o?void 0:o[t]);return e}),{});this.featureFlags.receivedFeatureFlags({featureFlags:g,featureFlagPayloads:_})}if(!this.get_distinct_id()){var m=this.config.get_device_id(Ke());this.register_once({distinct_id:m,$device_id:m},\"\"),this.persistence.set_property($e,\"anonymous\")}return null==T||null===(i=T.addEventListener)||void 0===i||i.call(T,\"onpagehide\"in self?\"pagehide\":\"unload\",this._handle_unload.bind(this)),this.toolbar.maybeLoadToolbar(),s.segment?br(this,(function(){return r._loaded()})):this._loaded(),y(this.config._onCapture)&&this.on(\"eventCaptured\",(function(e){return r.config._onCapture(e.event,e)})),this}},{key:\"_afterDecideResponse\",value:function(e){var t,n,i,r,s,o,a;this.compression=void 0,e.supportedCompression&&!this.config.disable_compression&&(this.compression=Y(e.supportedCompression,re.GZipJS)?re.GZipJS:Y(e.supportedCompression,re.Base64)?re.Base64:void 0),null!==(t=e.analytics)&&void 0!==t&&t.endpoint&&(this.analyticsDefaultEndpoint=e.analytics.endpoint),null===(n=this.sessionRecording)||void 0===n||n.afterDecideResponse(e),null===(i=this.autocapture)||void 0===i||i.afterDecideResponse(e),null===(r=this.heatmaps)||void 0===r||r.afterDecideResponse(e),null===(s=this.surveys)||void 0===s||s.afterDecideResponse(e),null===(o=this.webVitalsAutocapture)||void 0===o||o.afterDecideResponse(e),null===(a=this.exceptionObserver)||void 0===a||a.afterDecideResponse(e)}},{key:\"_loaded\",value:function(){var e=this,t=this.config.advanced_disable_decide;t||this.featureFlags.setReloadingPaused(!0);try{this.config.loaded(this)}catch(e){G.critical(\"`loaded` function failed\",e)}this._start_queue_if_opted_in(),this.config.capture_pageview&&setTimeout((function(){L&&e.capture(\"$pageview\",{title:L.title},{send_instantly:!0})}),1),t||(new pi(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.enable())}},{key:\"_dom_loaded\",value:function(){var e=this;this.has_opted_out_capturing()||z(this.__request_queue,(function(t){return e._send_retriable_request(t)})),this.__request_queue=[],this._start_queue_if_opted_in()}},{key:\"_handle_unload\",value:function(){var e,t;this.config.request_batching?(this._shouldCapturePageleave()&&this.capture(\"$pageleave\"),null===(e=this._requestQueue)||void 0===e||e.unload(),null===(t=this._retryQueue)||void 0===t||t.unload()):this._shouldCapturePageleave()&&this.capture(\"$pageleave\",null,{transport:\"sendBeacon\"})}},{key:\"_send_request\",value:function(e){var n=this;this.__loaded&&(Zr?this.__request_queue.push(e):this.rateLimiter.isServerRateLimited(e.batchKey)||(e.transport=e.transport||this.config.api_transport,e.url=ir(e.url,{ip:this.config.ip?1:0}),e.headers=t({},this.config.request_headers),e.compression=\"best-available\"===e.compression?this.compression:e.compression,function(e){var n,i,r,s=t({},e);s.timeout=s.timeout||6e4,s.url=ir(s.url,{_:(new Date).getTime().toString(),ver:f.LIB_VERSION,compression:s.compression});var o=null!==(n=s.transport)&&void 0!==n?n:\"XHR\",a=null!==(i=null===(r=ae(or,(function(e){return e.transport===o})))||void 0===r?void 0:r.method)&&void 0!==i?i:or[0].method;if(!a)throw new Error(\"No available transport method\");a(s)}(t(t({},e),{},{callback:function(t){var i,r,s;(n.rateLimiter.checkForLimiting(t),t.statusCode>=400)&&(null===(r=(s=n.config).on_request_error)||void 0===r||r.call(s,t));null===(i=e.callback)||void 0===i||i.call(e,t)}}))))}},{key:\"_send_retriable_request\",value:function(e){this._retryQueue?this._retryQueue.retriableRequest(e):this._send_request(e)}},{key:\"_execute_array\",value:function(e){var t,n=this,i=[],r=[],s=[];z(e,(function(e){e&&(t=e[0],m(t)?s.push(e):y(e)?e.call(n):m(e)&&\"alias\"===t?i.push(e):m(e)&&-1!==t.indexOf(\"capture\")&&y(n[t])?s.push(e):r.push(e))}));var o=function(e,t){z(e,(function(e){if(m(e[0])){var n=t;Q(e,(function(e){n=n[e[0]].apply(n,e.slice(1))}))}else this[e[0]].apply(this,e.slice(1))}),t)};o(i,this),o(r,this),o(s,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,n,i){var r;if(this.__loaded&&this.persistence&&this.sessionPersistence&&this._requestQueue){if(!this.consent.isOptedOut())if(!w(e)&&S(e)){if(this.config.opt_out_useragent_filter||!this._is_bot()){var s=null!=i&&i.skip_client_rate_limiting?void 0:this.rateLimiter.clientRateLimitContext();if(null==s||!s.isRateLimited){this.sessionPersistence.update_search_keyword(),this.config.store_google&&this.sessionPersistence.update_campaign_params(),this.config.save_referrer&&this.sessionPersistence.update_referrer_info(),(this.config.store_google||this.config.save_referrer)&&this.persistence.set_initial_person_info();var o=new Date,a=(null==i?void 0:i.timestamp)||o,u={uuid:Ke(),event:e,properties:this._calculate_event_properties(e,n||{},a)};s&&(u.properties.$lib_rate_limit_remaining_tokens=s.remainingTokens),(null==i?void 0:i.$set)&&(u.$set=null==i?void 0:i.$set);var l=this._calculate_set_once_properties(null==i?void 0:i.$set_once);l&&(u.$set_once=l),(u=ie(u,null!=i&&i._noTruncate?null:this.config.properties_string_max_length)).timestamp=a,w(null==i?void 0:i.timestamp)||(u.properties.$event_time_override_provided=!0,u.properties.$event_time_override_system_time=o);var c=t(t({},u.properties.$set),u.$set);k(c)||this.setPersonPropertiesForFlags(c),this._internalEventEmitter.emit(\"eventCaptured\",u);var d={method:\"POST\",url:null!==(r=null==i?void 0:i._url)&&void 0!==r?r:this.requestRouter.endpointFor(\"api\",this.analyticsDefaultEndpoint),data:u,compression:\"best-available\",batchKey:null==i?void 0:i._batchKey};return!this.config.request_batching||i&&(null==i||!i._batchKey)||null!=i&&i.send_instantly?this._send_retriable_request(d):this._requestQueue.enqueue(d),u}G.critical(\"This capture call is ignored due to client rate limiting.\")}}else G.error(\"No event name provided to posthog.capture\")}else G.uninitializedWarning(\"posthog.capture\")}},{key:\"_addCaptureHook\",value:function(e){this.on(\"eventCaptured\",(function(t){return e(t.event,t)}))}},{key:\"_calculate_event_properties\",value:function(e,n,i){if(i=i||new Date,!this.persistence||!this.sessionPersistence)return n;var r=this.persistence.remove_event_timer(e),s=t({},n);if(s.token=this.config.token,\"$snapshot\"===e){var o=t(t({},this.persistence.properties()),this.sessionPersistence.properties());return s.distinct_id=o.distinct_id,(!S(s.distinct_id)&&!F(s.distinct_id)||E(s.distinct_id))&&G.error(\"Invalid distinct_id for replay event. This indicates a bug in your implementation\"),s}var a=mn.properties();if(this.sessionManager){var u=this.sessionManager.checkAndGetSessionAndWindowId(),l=u.sessionId,c=u.windowId;s.$session_id=l,s.$window_id=c}if(this.requestRouter.region===ur.CUSTOM&&(s.$lib_custom_api_host=this.config.api_host),this.sessionPropsManager&&this.config.__preview_send_client_session_params&&(\"$pageview\"===e||\"$pageleave\"===e||\"$autocapture\"===e)){var d=this.sessionPropsManager.getSessionProps();s=J(s,d)}if(!this.config.disable_scroll_properties){var h={};\"$pageview\"===e?h=this.pageViewManager.doPageView(i):\"$pageleave\"===e&&(h=this.pageViewManager.doPageLeave(i)),s=J(s,h)}if(\"$pageview\"===e&&L&&(s.title=L.title),!w(r)){var f=i.getTime()-r;s.$duration=parseFloat((f/1e3).toFixed(3))}H&&this.config.opt_out_useragent_filter&&(s.$browser_type=this._is_bot()?\"bot\":\"browser\"),(s=J({},a,this.persistence.properties(),this.sessionPersistence.properties(),s)).$is_identified=this._isIdentified(),m(this.config.property_denylist)?Q(this.config.property_denylist,(function(e){delete s[e]})):G.error(\"Invalid value for property_denylist config: \"+this.config.property_denylist+\" or property_blacklist config: \"+this.config.property_blacklist);var v=this.config.sanitize_properties;return v&&(s=v(s,e)),s.$process_person_profile=this._hasPersonProcessing(),s}},{key:\"_calculate_set_once_properties\",value:function(e){if(!this.persistence||!this._hasPersonProcessing())return e;var t=J({},this.persistence.get_initial_props(),e||{});return k(t)?void 0:t}},{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(o({},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:\"on\",value:function(e,t){return this._internalEventEmitter.on(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:\"renderSurvey\",value:function(e,t){this.surveys.renderSurvey(e,t)}},{key:\"canRenderSurvey\",value:function(e){this.surveys.canRenderSurvey(e)}},{key:\"getNextSurveyStep\",value:function(e,t,n){return this.surveys.getNextSurveyStep(e,t,n)}},{key:\"identify\",value:function(e,t,n){if(!this.__loaded||!this.persistence)return G.uninitializedWarning(\"posthog.identify\");if(F(e)&&(e=e.toString(),G.warn(\"The first argument to posthog.identify was a number, but it should be a string. It has been converted to a string.\")),e){if([\"distinct_id\",\"distinctid\"].includes(e.toLowerCase()))G.critical('The string \"'.concat(e,'\" was set in posthog.identify which indicates an error. This ID should be unique to the user and not a hardcoded string.'));else if(this._requirePersonProcessing(\"posthog.identify\")){var 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(ce)&&(this.unregister(ce),this.register({distinct_id:e}));var s=\"anonymous\"===(this.persistence.get_property($e)||\"anonymous\");e!==i&&s?(this.persistence.set_property($e,\"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(Ce))}}else G.error(\"Unique user id has not been set in posthog.identify\")}},{key:\"setPersonProperties\",value:function(e,t){(e||t)&&this._requirePersonProcessing(\"posthog.setPersonProperties\")&&(this.setPersonPropertiesForFlags(e||{}),this.capture(\"$set\",{$set:e||{},$set_once:t||{}}))}},{key:\"group\",value:function(e,n,i){if(e&&n){if(this._requirePersonProcessing(\"posthog.group\")){var r=this.getGroups();r[e]!==n&&this.resetGroupPropertiesForFlags(e),this.register({$groups:t(t({},r),{},o({},e,n))}),i&&(this.capture(\"$groupidentify\",{$group_type:e,$group_key:n,$group_set:i}),this.setGroupPropertiesForFlags(o({},e,i))),r[e]===n||i||this.reloadFeatureFlags()}}else G.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._requirePersonProcessing(\"posthog.setPersonPropertiesForFlags\")&&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._requirePersonProcessing(\"posthog.setGroupPropertiesForFlags\")&&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(G.info(\"reset\"),!this.__loaded)return G.uninitializedWarning(\"posthog.reset\");var s=this.get_property(\"$device_id\");this.consent.reset(),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_property($e,\"anonymous\"),null===(r=this.sessionManager)||void 0===r||r.resetSessionId();var o=this.config.get_device_id(Ke());this.register_once({distinct_id:o,$device_id:e?o:s},\"\")}},{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.sessionManager.checkAndGetSessionAndWindowId(!0),n=t.sessionId,i=t.sessionStartTimestamp,r=this.requestRouter.endpointFor(\"ui\",\"/project/\".concat(this.config.token,\"/replay/\").concat(n));if(null!=e&&e.withTimestamp&&i){var s,o=null!==(s=e.timestampLookBack)&&void 0!==s?s:10;if(!i)return r;var a=Math.max(Math.floor(((new Date).getTime()-i)/1e3)-o,0);r+=\"?t=\".concat(a)}return r}},{key:\"alias\",value:function(e,t){return e===this.get_property(le)?(G.critical(\"Attempting to create alias for existing People user - aborting.\"),-2):this._requirePersonProcessing(\"posthog.alias\")?(w(t)&&(t=this.get_distinct_id()),e!==t?(this._register_single(ce,e),this.capture(\"$create_alias\",{alias:e,distinct_id:t})):(G.warn(\"alias matches current distinct_id - skipping api call.\"),this.identify(e),-1)):void 0}},{key:\"set_config\",value:function(e){var n,i,r,s,o=t({},this.config);b(e)&&(J(this.config,ts(e)),null===(n=this.persistence)||void 0===n||n.update_config(this.config,o),this.sessionPersistence=\"sessionStorage\"===this.config.persistence?this.persistence:new bn(t(t({},this.config),{},{persistence:\"sessionStorage\"})),at.is_supported()&&\"true\"===at.get(\"ph_debug\")&&(this.config.debug=!0),this.config.debug&&(f.DEBUG=!0,G.info(\"set_config\",{config:e,oldConfig:o,newConfig:t({},this.config)})),null===(i=this.sessionRecording)||void 0===i||i.startIfEnabledOrStop(),null===(r=this.autocapture)||void 0===r||r.startIfEnabled(),null===(s=this.heatmaps)||void 0===s||s.startIfEnabled(),this.surveys.loadIfEnabled(),this._sync_opt_out_with_persistence())}},{key:\"startSessionRecording\",value:function(e){var t,n=x(e)&&e;if(n||null!=e&&e.sampling){var i,r,s=null===(i=this.sessionManager)||void 0===i?void 0:i.checkAndGetSessionAndWindowId();null===(r=this.persistence)||void 0===r||r.register(o({},Ee,!0)),G.info(\"Session recording started with sampling override for session: \",null==s?void 0:s.sessionId)}(n||null!=e&&e.linked_flag)&&(null===(t=this.sessionRecording)||void 0===t||t.overrideLinkedFlag(),G.info(\"Session recording started with linked_flags override\"));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:Kr;return t!==Kr&&(t=Kr+\".\"+t),t}},{key:\"_isIdentified\",value:function(){var e,t;return\"identified\"===(null===(e=this.persistence)||void 0===e?void 0:e.get_property($e))||\"identified\"===(null===(t=this.sessionPersistence)||void 0===t?void 0:t.get_property($e))}},{key:\"_hasPersonProcessing\",value:function(){var e,t,n,i;return!(\"never\"===this.config.person_profiles||\"identified_only\"===this.config.person_profiles&&!this._isIdentified()&&k(this.getGroups())&&(null===(e=this.persistence)||void 0===e||null===(t=e.props)||void 0===t||!t[ce])&&(null===(n=this.persistence)||void 0===n||null===(i=n.props)||void 0===i||!i[Ne]))}},{key:\"_shouldCapturePageleave\",value:function(){return!0===this.config.capture_pageleave||\"if_capture_pageview\"===this.config.capture_pageleave&&this.config.capture_pageview}},{key:\"createPersonProfile\",value:function(){this._hasPersonProcessing()||this._requirePersonProcessing(\"posthog.createPersonProfile\")&&this.setPersonProperties({},{})}},{key:\"_requirePersonProcessing\",value:function(e){return\"never\"===this.config.person_profiles?(G.error(e+' was called, but process_person is set to \"never\". This call will be ignored.'),!1):(this._register_single(Ne,!0),!0)}},{key:\"_sync_opt_out_with_persistence\",value:function(){var e,t,n,i,r=this.consent.isOptedOut(),s=this.config.opt_out_persistence_by_default,o=this.config.disable_persistence||r&&!!s;(null===(e=this.persistence)||void 0===e?void 0:e.disabled)!==o&&(null===(n=this.persistence)||void 0===n||n.set_disabled(o));(null===(t=this.sessionPersistence)||void 0===t?void 0:t.disabled)!==o&&(null===(i=this.sessionPersistence)||void 0===i||i.set_disabled(o))}},{key:\"opt_in_capturing\",value:function(e){var t;this.consent.optInOut(!0),this._sync_opt_out_with_persistence(),(w(null==e?void 0:e.captureEventName)||null!=e&&e.captureEventName)&&this.capture(null!==(t=null==e?void 0:e.captureEventName)&&void 0!==t?t:\"$opt_in\",null==e?void 0:e.captureProperties,{send_instantly:!0})}},{key:\"opt_out_capturing\",value:function(){this.consent.optInOut(!1),this._sync_opt_out_with_persistence()}},{key:\"has_opted_in_capturing\",value:function(){return this.consent.isOptedIn()}},{key:\"has_opted_out_capturing\",value:function(){return this.consent.isOptedOut()}},{key:\"clear_opt_in_out_capturing\",value:function(){this.consent.reset(),this._sync_opt_out_with_persistence()}},{key:\"_is_bot\",value:function(){return A?function(e,t){if(!e)return!1;var n=e.userAgent;if(n&&Lr(n,t))return!0;try{var i=null==e?void 0:e.userAgentData;if(null!=i&&i.brands&&i.brands.some((function(e){return Lr(null==e?void 0:e.brand,t)})))return!0}catch(e){}return!!e.webdriver}(A,this.config.custom_blocked_useragents):void 0}},{key:\"debug\",value:function(e){!1===e?(null==T||T.console.log(\"You've disabled debug mode.\"),localStorage&&localStorage.removeItem(\"ph_debug\"),this.set_config({debug:!1})):(null==T||T.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