1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[19079],{93894:(e,t,i)=>{let s,n,r,o,a,l;i.d(t,{Ay:()=>nC});let u="undefined"!=typeof window?window:void 0,c="undefined"!=typeof globalThis?globalThis:u,d=Array.prototype,h=d.forEach,_=d.indexOf,p=null==c?void 0:c.navigator,g=null==c?void 0:c.document,f=null==c?void 0:c.location,v=null==c?void 0:c.fetch,m=null!=c&&c.XMLHttpRequest&&"withCredentials"in new c.XMLHttpRequest?c.XMLHttpRequest:void 0,y=null==c?void 0:c.AbortController,b=null==p?void 0:p.userAgent,w=null!=u?u:{},S={DEBUG:!1,LIB_VERSION:"1.181.0"},E=Array.isArray,k=Object.prototype,x=k.hasOwnProperty,I=k.toString,P=E||function(e){return"[object Array]"===I.call(e)},F=function(e){return"function"==typeof e},R=function(e){return e===Object(e)&&!P(e)},C=function(e){if(R(e)){for(let t in e)if(x.call(e,t))return!1;return!0}return!1},T=function(e){return void 0===e},$=function(e){return"[object String]"==I.call(e)},A=function(e){return $(e)&&0===e.trim().length},M=function(e){return null===e},L=function(e){return T(e)||M(e)},D=function(e){return"[object Number]"==I.call(e)},O=function(e){return"[object Boolean]"===I.call(e)},N="[PostHog.js]",q={_log:function(e){if(u&&(S.DEBUG||w.POSTHOG_DEBUG)&&!T(u.console)&&u.console){let n="__rrweb_original__"in u.console[e]?u.console[e].__rrweb_original__:u.console[e];for(var t=arguments.length,i=Array(t>1?t-1:0),s=1;s<t;s++)i[s-1]=arguments[s];n(N,...i)}},info:function(){for(var e=arguments.length,t=Array(e),i=0;i<e;i++)t[i]=arguments[i];q._log("log",...t)},warn:function(){for(var e=arguments.length,t=Array(e),i=0;i<e;i++)t[i]=arguments[i];q._log("warn",...t)},error:function(){for(var e=arguments.length,t=Array(e),i=0;i<e;i++)t[i]=arguments[i];q._log("error",...t)},critical:function(){for(var e=arguments.length,t=Array(e),i=0;i<e;i++)t[i]=arguments[i];console.error(N,...t)},uninitializedWarning:e=>{q.error(`You must initialize PostHog before calling ${e}`)}},B=(e,t,i)=>{if(e.config.disable_external_dependency_loading)return q.warn(`${t} was requested but loading of external scripts is disabled.`),i("Loading of external scripts is disabled");let s=()=>{var e;if(!g)return i("document not found");let s=g.createElement("script");s.type="text/javascript",s.crossOrigin="anonymous",s.src=t,s.onload=e=>i(void 0,e),s.onerror=e=>i(e);let n=g.querySelectorAll("body > script");n.length>0?null==(e=n[0].parentNode)||e.insertBefore(s,n[0]):g.body.appendChild(s)};null!=g&&g.body?s():null==g||g.addEventListener("DOMContentLoaded",s)};w.__PosthogExtensions__=w.__PosthogExtensions__||{},w.__PosthogExtensions__.loadExternalDependency=(e,t,i)=>{let s=`/static/${t}.js?v=${e.version}`;"toolbar"===t&&(s=`${s}&t=${3e5*Math.floor(Date.now()/3e5)}`);let n=e.requestRouter.endpointFor("assets",s);B(e,n,i)},w.__PosthogExtensions__.loadSiteApp=(e,t,i)=>{let s=e.requestRouter.endpointFor("api",t);B(e,s,i)};let H={},U=function(e){return e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"")};function W(e,t,i){if(P(e)){if(h&&e.forEach===h)e.forEach(t,i);else if("length"in e&&e.length===+e.length){for(let s=0,n=e.length;s<n;s++)if(s in e&&t.call(i,e[s],s)===H)return}}}function z(e,t,i){if(!L(e)){if(P(e))return W(e,t,i);if(e instanceof FormData){for(let s of e.entries())if(t.call(i,s[1],s[0])===H)return}else for(let s in e)if(x.call(e,s)&&t.call(i,e[s],s)===H)return}}let V=function(e){for(var t=arguments.length,i=Array(t>1?t-1:0),s=1;s<t;s++)i[s-1]=arguments[s];return W(i,function(t){for(let i in t)void 0!==t[i]&&(e[i]=t[i])}),e};function G(e,t){return -1!==e.indexOf(t)}function j(e){let t=Object.keys(e),i=t.length,s=Array(i);for(;i--;)s[i]=[t[i],e[t[i]]];return s}let Q=function(e){try{return e()}catch{return}},J=function(e){return function(){try{for(var t=arguments.length,i=Array(t),s=0;s<t;s++)i[s]=arguments[s];return e.apply(this,i)}catch(e){q.critical("Implementation error. Please turn on debug mode and open a ticket on https://app.posthog.com/home#panel=support%3Asupport%3A."),q.critical(e)}}},Y=function(e){let t={};return z(e,function(e,i){$(e)&&e.length>0&&(t[i]=e)}),t},X=function(e){return e.replace(/^\$/,"")},K=function(e){let t,i,s,n="",r=0;for(t=i=0,r=(e=(e+"").replace(/\r\n/g,"\n").replace(/\r/g,"\n")).length,s=0;s<r;s++){let r=e.charCodeAt(s),o=null;r<128?i++:o=r>127&&r<2048?String.fromCharCode(r>>6|192,63&r|128):String.fromCharCode(r>>12|224,r>>
16&63|128,63&r|128),M(o)||(i>t&&(n+=e.substring(t,i)),n+=o,t=i=s+1)}return i>t&&(n+=e.substring(t,e.length)),n},Z=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,i,s,n,r){if(t)if(t.addEventListener&&!n)t.addEventListener(i,s,!!r);else{let n="on"+i,r=t[n];t[n]=function(i){if(!(i=i||e(null==u?void 0:u.event)))return;let n,o=!0;F(r)&&(n=r(i));let a=s.call(t,i);return!1!==n&&!1!==a||(o=!1),o}}else q.error("No valid element provided to register_event")}}();function ee(e,t){for(let i=0;i<e.length;i++)if(t(e[i]))return e[i]}!function(e){e.GZipJS="gzip-js",e.Base64="base64"}(s||(s={}));let et="$people_distinct_id",ei="__alias",es="__timers",en="$autocapture_disabled_server_side",er="$heatmaps_enabled_server_side",eo="$exception_capture_enabled_server_side",ea="$exception_capture_endpoint_suffix",el="$web_vitals_enabled_server_side",eu="$dead_clicks_enabled_server_side",ec="$web_vitals_allowed_metrics",ed="$session_recording_enabled_server_side",eh="$console_log_recording_enabled_server_side",e_="$session_recording_network_payload_capture",ep="$session_recording_canvas_recording",eg="$replay_sample_rate",ef="$replay_minimum_duration",ev="$sesid",em="$session_is_sampled",ey="$session_recording_url_trigger_activated_session",eb="$session_recording_url_trigger_status",ew="$enabled_feature_flags",eS="$early_access_features",eE="$stored_person_properties",ek="$stored_group_properties",ex="$surveys",eI="$surveys_activated",eP="$flag_call_reported",eF="$user_state",eR="$client_session_props",eC="$capture_rate_limit",eT="$initial_campaign_params",e$="$initial_referrer_info",eA="$initial_person_info",eM="$epp",eL="__POSTHOG_TOOLBAR__",eD=[et,ei,"__cmpns",es,ed,er,ev,ew,eF,eS,ek,eE,ex,eP,eR,eC,eT,e$,eM],eO="$active_feature_flags",eN="$override_feature_flags",eq="$feature_flag_payloads",eB=e=>{let t={};for(let[i,s]of j(e||{}))s&&(t[i]=s);return t};class eH{constructor(e){this.instance=e,this._override_warning=!1,this.featureFlagEventHandlers=[],this.reloadFeatureFlagsQueued=!1,this.reloadFeatureFlagsInAction=!1}getFlags(){return Object.keys(this.getFlagVariants())}getFlagVariants(){let e=this.instance.get_property(ew),t=this.instance.get_property(eN);if(!t)return e||{};let i=V({},e),s=Object.keys(t);for(let e=0;e<s.length;e++)i[s[e]]=t[s[e]];return this._override_warning||(q.warn(" Overriding feature flags!",{enabledFlags:e,overriddenFlags:t,finalFlags:i}),this._override_warning=!0),i}getFlagPayloads(){return this.instance.get_property(eq)||{}}reloadFeatureFlags(){this.reloadFeatureFlagsQueued||(this.reloadFeatureFlagsQueued=!0,this._startReloadTimer())}setAnonymousDistinctId(e){this.$anon_distinct_id=e}setReloadingPaused(e){this.reloadFeatureFlagsInAction=e}resetRequestQueue(){this.reloadFeatureFlagsQueued=!1}_startReloadTimer(){this.reloadFeatureFlagsQueued&&!this.reloadFeatureFlagsInAction&&setTimeout(()=>{!this.reloadFeatureFlagsInAction&&this.reloadFeatureFlagsQueued&&(this.reloadFeatureFlagsQueued=!1,this._reloadFeatureFlagsRequest())},5)}_reloadFeatureFlagsRequest(){if(this.instance.config.advanced_disable_feature_flags)return;this.setReloadingPaused(!0);let e=this.instance.config.token,t=this.instance.get_property(eE),i=this.instance.get_property(ek),n={token:e,distinct_id:this.instance.get_distinct_id(),groups:this.instance.getGroups(),$anon_distinct_id:this.$anon_distinct_id,person_properties:t,group_properties:i,disable_flags:this.instance.config.advanced_disable_feature_flags||void 0};this.instance._send_request({method:"POST",url:this.instance.requestRouter.endpointFor("api","/decide/?v=3"),data:n,compression:this.instance.config.disable_compression?void 0:s.Base64,timeout:this.instance.config.feature_flag_request_timeout_ms,callback:e=>{var t;this.setReloadingPaused(!1);let i=!0;200===e.statusCode&&(this.$anon_distinct_id=void 0,i=!1),this.receivedFeatureFlags(null!=(t=e.json)?t:{},i),this._startReloadTimer()}})}getFeatureFlag(e){var t;let i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(!(this.instance.decideEndpointWasHit||this.getFlags()&&this.getFlags().length>0))return void q.warn('getFeatureFlag for key "'+e+"\" failed. Feature flags didn't load in time.");let s=this.getFlagVariants()[e],n=`${s}`,r=this.instance.get_property(eP)||{};return!i.send_event&&"send_event"in i||e in r&&r[e].includes(n)||(P(r[e])?r[e].push(n):r[e]=[n],null==(t=this.instance.persistence)||t.register({[eP]:r}),this.instance.capture("$feature_flag_called",{$feature_flag:e,$feature_flag_response:s})),s}getFeatureFlagPayload(e){return this.getFlagPayloads()[e]}isFeatureEnabled(e){let 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);q.warn('isFeatureEnabled for key "'+e+"\" failed. Feature flags didn't load in time.")}addFeatureFlagsHandler(e){this.featureFlagEventHandlers.push(e)}removeFeatureFlagsHandler(e){this.featureFlagEventHandlers=this.featureFlagEventHandlers.filter(t=>t!==e)}receivedFeatureFlags(e,t){if(!this.instance.persistence)return;this.instance.decideEndpointWasHit=!0;let i=this.getFlagVariants(),s=this.getFlagPayloads();!function(e,t){let i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},s=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},n=e.featureFlags,r=e.featureFlagPayloads;if(!n)return;if(P(n)){let e={};if(n)for(let t=0;t<n.length;t++)e[n[t]]=!0;return t&&t.register({[eO]:n,[ew]:e})}let o=n,a=r;e.errorsWhileComputingFlags&&(o={...i,...o},a={...s,...a}
1),t&&t.register({[eO]:Object.keys(eB(o)),[ew]:o||{},[eq]:a||{}})}(e,this.instance.persistence,i,s),this._fireFeatureFlagsCallbacks(t)}override(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(!this.instance.__loaded||!this.instance.persistence)return q.uninitializedWarning("posthog.feature_flags.override");if(this._override_warning=t,!1===e)this.instance.persistence.unregister(eN);else if(P(e)){let t={};for(let i=0;i<e.length;i++)t[e[i]]=!0;this.instance.persistence.register({[eN]:t})}else this.instance.persistence.register({[eN]:e})}onFeatureFlags(e){if(this.addFeatureFlagsHandler(e),this.instance.decideEndpointWasHit){let{flags:t,flagVariants:i}=this._prepareFeatureFlagsForCallbacks();e(t,i)}return()=>this.removeFeatureFlagsHandler(e)}updateEarlyAccessFeatureEnrollment(e,t){var i;let s={[`$feature_enrollment/${e}`]:t};this.instance.capture("$feature_enrollment_update",{$feature_flag:e,$feature_enrollment:t,$set:s}),this.setPersonPropertiesForFlags(s,!1);let n={...this.getFlagVariants(),[e]:t};null==(i=this.instance.persistence)||i.register({[eO]:Object.keys(eB(n)),[ew]:n}),this._fireFeatureFlagsCallbacks()}getEarlyAccessFeatures(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],i=this.instance.get_property(eS);if(i&&!t)return e(i);this.instance._send_request({transport:"XHR",url:this.instance.requestRouter.endpointFor("api",`/api/early_access_features/?token=${this.instance.config.token}`),method:"GET",callback:t=>{var i;if(!t.json)return;let s=t.json.earlyAccessFeatures;return null==(i=this.instance.persistence)||i.register({[eS]:s}),e(s)}})}_prepareFeatureFlagsForCallbacks(){let e=this.getFlags(),t=this.getFlagVariants();return{flags:e.filter(e=>t[e]),flagVariants:Object.keys(t).filter(e=>t[e]).reduce((e,i)=>(e[i]=t[i],e),{})}}_fireFeatureFlagsCallbacks(e){let{flags:t,flagVariants:i}=this._prepareFeatureFlagsForCallbacks();this.featureFlagEventHandlers.forEach(s=>s(t,i,{errorsLoading:e}))}setPersonPropertiesForFlags(e){let t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],i=this.instance.get_property(eE)||{};this.instance.register({[eE]:{...i,...e}}),t&&this.instance.reloadFeatureFlags()}resetPersonPropertiesForFlags(){this.instance.unregister(eE)}setGroupPropertiesForFlags(e){let t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],i=this.instance.get_property(ek)||{};
10!==Object.keys(i).length&&Object.keys(i).forEach(t=>{i[t]={...i[t],...e[t]},delete e[t]}),this.instance.register({[ek]:{...i,...e}}),t&&this.instance.reloadFeatureFlags()}resetGroupPropertiesForFlags(e){if(e){let t=this.instance.get_property(ek)||{};this.instance.register({[ek]:{...t,[e]:{}}})}else this.instance.unregister(ek)}}Math.trunc||(Math.trunc=function(e){return e<0?Math.ceil(e):Math.floor(e)}),Number.isInteger||(Number.isInteger=function(e){return D(e)&&isFinite(e)&&Math.floor(e)===e});let eU="0123456789abcdef";class eW{constructor(e){if(this.bytes=e,16!==e.length)throw TypeError("not 128-bit length")}static fromFieldsV7(e,t,i,s){if(!Number.isInteger(e)||!Number.isInteger(t)||!Number.isInteger(i)||!Number.isInteger(s)||e<0||t<0||i<0||s<0||e>0xffffffffffff||t>4095||i>0x3fffffff||s>0xffffffff)throw RangeError("invalid field value");let n=new Uint8Array(16);return n[0]=e/0x10000000000,n[1]=e/0x100000000,n[2]=e/0x1000000,n[3]=e/65536,n[4]=e/256,n[5]=e,n[6]=112|t>>>8,n[7]=t,n[8]=128|i>>>24,n[9]=i>>>16,n[10]=i>>>8,n[11]=i,n[12]=s>>>24,n[13]=s>>>16,n[14]=s>>>8,n[15]=s,new eW(n)}toString(){let e="";for(let t=0;t<this.bytes.length;t++)e=e+eU.charAt(this.bytes[t]>>>4)+eU.charAt(15&this.bytes[t]),3!==t&&5!==t&&7!==t&&9!==t||(e+="-");if(36!==e.length)throw Error("Invalid UUIDv7 was generated");return e}clone(){return new eW(this.bytes.slice(0))}equals(e){return 0===this.compareTo(e)}compareTo(e){for(let t=0;t<16;t++){let i=this.bytes[t]-e.bytes[t];if(0!==i)return Math.sign(i)}return 0}}class ez{timestamp=0;counter=0;random=new ej;generate(){let e=this.generateOrAbort();if(T(e)){this.timestamp=0;let e=this.generateOrAbort();if(T(e))throw Error("Could not generate UUID after timestamp reset");return e}return e}generateOrAbort(){let e=Date.now();if(e>this.timestamp)this.timestamp=e,this.resetCounter();else{if(!(e+1e4>this.timestamp))return;this.counter++,this.counter>0x3ffffffffff&&(this.timestamp++,this.resetCounter())}return eW.fromFieldsV7(this.timestamp,Math.trunc(this.counter/0x40000000),this.counter&0x40000000-1,this.random.nextUint32())}resetCounter(){this.counter=1024*this.random.nextUint32()+(1023&this.random.nextUint32())}}let eV,eG=e=>{if("undefined"!=typeof UUIDV7_DENY_WEAK_RNG&&UUIDV7_DENY_WEAK_RNG)throw Error("no cryptographically strong RNG available");for(let t=0;t<e.length;t++)e[t]=65536*Math.trunc(65536*Math.random())+Math.trunc(65536*Math.random());return e};u&&!T(u.crypto)&&crypto.getRandomValues&&(eG=e=>crypto.getRandomValues(e));class ej{buffer=new Uint32Array(8);cursor=1/0;nextUint32(){return this.cursor>=this.buffer.length&&(eG(this.buffer),this.cursor=0),this.buffer[this.cursor++]}}let eQ=()=>eJ().toString(),eJ=()=>(eV||(eV=new ez)).generate(),eY="",eX=/[a-z0-9][a-z0-9-]+\.[a-z]{2,}$/i,eK={is_supported:()=>!!g,error:function(e){q.error("cookieStore error: "+e)},get:function(e){if(g){try{let t=e+"=",i=g.cookie.split(";").filter(e=>e.length);for(let e=0;e<i.length;e++){let s=i[e];for(;" "==s.charAt(0);)s=s.substring(1,s.length);if(0===s.indexOf(t))return decodeURIComponent(s.substring(t.length,s.length))}}catch{}return null}},parse:function(e){let t;try{t=JSON.parse(eK.get(e))||{}}catch{}return t},set:function(e,t,i,s,n){if(g)try{let r="",o="",a=function(e,t){if(t){let t=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:g;if(eY)return eY;if(!t||["localhost","127.0.0.1"].includes(e))return"";let i=e.split("."),s=Math.min(i.length,8),n="dmn_chk_"+eQ(),r=RegExp("(^|;)\\s*"+n+"=1");for(;!eY&&s--;){let e=i.slice(s).join("."),o=n+"=1;domain=."+e;t.cookie=o,r.test(t.cookie)&&(t.cookie=o+";expires=Thu, 01 Jan 1970 00:00:00 GMT",eY=e)}return eY}(e);if(!t){let i=(e=>{let t=e.match(eX);return t?t[0]:""})(e);i!==t&&q.info("Warning: cookie subdomain discovery mismatch",i,t),t=i}return t?"; domain=."+t:""}return""}(g.location.hostname,s);if(i){let e=new Date;e.setTime(e.getTime()+24*i*36e5),r="; expires="+e.toUTCString()}n&&(o="; secure");let l=e+"="+encodeURIComponent(JSON.stringify(t))+r+"; SameSite=Lax; path=/"+a+o;return l.length>3686.4&&q.warn("cookieStore warning: large cookie, len="+l.length),g.co
1okie=l,l}catch{return}},remove:function(e,t){try{eK.set(e,"",-1,t)}catch{return}}},eZ=null,e0={is_supported:function(){if(!M(eZ))return eZ;let e=!0;if(T(u))e=!1;else try{let t="__mplssupport__";e0.set(t,"xyz"),'"xyz"'!==e0.get(t)&&(e=!1),e0.remove(t)}catch{e=!1}return e||q.error("localStorage unsupported; falling back to cookie store"),eZ=e,e},error:function(e){q.error("localStorage error: "+e)},get:function(e){try{return null==u?void 0:u.localStorage.getItem(e)}catch(e){e0.error(e)}return null},parse:function(e){try{return JSON.parse(e0.get(e))||{}}catch{}return null},set:function(e,t){try{null==u||u.localStorage.setItem(e,JSON.stringify(t))}catch(e){e0.error(e)}},remove:function(e){try{null==u||u.localStorage.removeItem(e)}catch(e){e0.error(e)}}},e1=["distinct_id",ev,em,eM],e2={...e0,parse:function(e){try{let t={};try{t=eK.parse(e)||{}}catch{}let i=V(t,JSON.parse(e0.get(e)||"{}"));return e0.set(e,i),i}catch{}return null},set:function(e,t,i,s,n,r){try{e0.set(e,t,void 0,void 0,r);let o={};e1.forEach(e=>{t[e]&&(o[e]=t[e])}),Object.keys(o).length&&eK.set(e,o,i,s,n,r)}catch(e){e0.error(e)}},remove:function(e,t){try{null==u||u.localStorage.removeItem(e),eK.remove(e,t)}catch(e){e0.error(e)}}},e3={},e5={is_supported:function(){return!0},error:function(e){q.error("memoryStorage error: "+e)},get:function(e){return e3[e]||null},parse:function(e){return e3[e]||null},set:function(e,t){e3[e]=t},remove:function(e){delete e3[e]}},e6=null,e8={is_supported:function(){if(!M(e6))return e6;if(e6=!0,T(u))e6=!1;else try{let e="__support__";e8.set(e,"xyz"),'"xyz"'!==e8.get(e)&&(e6=!1),e8.remove(e)}catch{e6=!1}return e6},error:function(e){q.error("sessionStorage error: ",e)},get:function(e){try{return null==u?void 0:u.sessionStorage.getItem(e)}catch(e){e8.error(e)}return null},parse:function(e){try{return JSON.parse(e8.get(e))||null}catch{}return null},set:function(e,t){try{null==u||u.sessionStorage.setItem(e,JSON.stringify(t))}catch(e){e8.error(e)}},remove:function(e){try{null==u||u.sessionStorage.removeItem(e)}catch(e){e8.error(e)}}},e4=["localhost","127.0.0.1"],e7=e=>{let t=null==g?void 0:g.createElement("a");return T(t)?null:(t.href=e,t)},e9=function(e,t){return!!function(e){try{new RegExp(e)}catch{return!1}return!0}(t)&&new RegExp(t).test(e)},te=function(e){let t,i,s=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"&",n=[];return z(e,function(e,s){T(e)||T(s)||"undefined"===s||(t=encodeURIComponent(e instanceof File?e.name:e.toString()),i=encodeURIComponent(s),n[n.length]=i+"="+t)}),n.join(s)},tt=function(e,t){let i,s=((e.split("#")[0]||"").split("?")[1]||"").split("&");for(let e=0;e<s.length;e++){let n=s[e].split("=");if(n[0]===t){i=n;break}}if(!P(i)||i.length<2)return"";{let e=i[1];try{e=decodeURIComponent(e)}catch{q.error("Skipping decoding for malformed query param: "+e)}return e.replace(/\+/g," ")}},ti=function(e,t){let i=e.match(RegExp(t+"=([^&]*)"));return i?i[1]:null},ts="Mobile",tn="Android",tr="Tablet",to=tn+" "+tr,ta="iPad",tl="Apple",tu=tl+" Watch",tc="Safari",td="BlackBerry",th="Samsung",t_=th+"Browser",tp=th+" Internet",tg="Chrome",tf=tg+" OS",tv=tg+" iOS",tm="Internet Explorer",ty=tm+" "+ts,tb="Opera",tw=tb+" Mini",tS="Edge",tE="Microsoft "+tS,tk="Firefox",tx=tk+" iOS",tI="Nintendo",tP="PlayStation",tF="Xbox",tR=tn+" "+ts,tC=ts+" "+tc,tT="Windows",t$=tT+" Phone",tA="Nokia",tM="Ouya",tL="Generic",tD=tL+" "+ts.toLowerCase(),tO=tL+" "+tr.toLowerCase(),tN="Konqueror",tq="(\\d+(\\.\\d+)?)",tB=RegExp("Version/"+tq),tH=RegExp(tF,"i"),tU=RegExp(tP+" \\w+","i"),tW=RegExp(tI+" \\w+","i"),tz=RegExp(td+"|PlayBook|BB10","i"),tV={"NT3.51":"NT 3.11","NT4.0":"NT 4.0","5.0":"2000",5.1:"XP",5.2:"XP","6.0":"Vista",6.1:"7",6.2:"8",6.3:"8.1",6.4:"10","10.0":"10"},tG=function(e,t){let i;return t=t||"",G(e," OPR/")&&G(e,"Mini")?tw:G(e," OPR/")?tb:tz.test(e)?td:G(e,"IE"+ts)||G(e,"WPDesktop")?ty:G(e,t_)?tp:G(e,tS)||G(e,"Edg/")?tE:G(e,"FBIOS")?"Facebook "+ts:G(e,"UCWEB")||G(e,"UCBrowser")?"UC Browser":G(e,"CriOS")?tv:G(e,"CrMo")?tg:G(e,tn)&&G(e,tc)?tR:G(e,tg)?tg:G(e,"FxiOS")?tx:G(e.toLowerCase(),tN.toLowerCase())?tN:(i=t)&&G(i,tl)||G(e,tc)&&!G(e,tg)&&!G(e,tn)?G(e,ts)?tC:tc:G(e,tk)?tk:G(e,"MSIE")||G(e,"Trident/")?tm:G(e,"Gecko")?tk:""},tj={[ty]:[RegExp("rv:"+tq)],[tE]:[RegExp(tS+"?\\/"+tq)],[tg]:[RegExp("("+tg+"|CrMo)\\/"+tq)],[tv]:[RegExp("CriOS\\/"+tq)],"UC Browser":[RegExp("(UCBrowser|UCWEB)\\/"+tq)],[tc]:[tB],[tC]:[tB],[tb]:[RegExp("(Opera|OPR)\\/"+tq)],[tk]:[RegExp(tk+"\\/"+tq)],[tx]:[RegExp("FxiOS\\/"+tq)],[tN]:[RegExp("Konqueror[:/]?"+tq,"i")],[td]:[RegExp(td+" "+tq),tB],[tR]:[RegExp("android\\s"+tq,"i")],[tp]:[RegExp(t_+"\\/"+tq)],[tm]:[RegExp("(rv:|MSIE )"+tq)],Mozilla:[RegExp("rv:"+tq)]},tQ=[[RegExp(tF+"; "+tF+" (.*?)[);]","i"),e=>[tF,e&&e[1]||""]],[RegExp(tI,"i"),[tI,""]],[RegExp(tP,"i"),[tP,""]],[tz,[td,""]],[RegExp(tT,"i"),(e,t)=>{if(/Phone/.test(t)||/WPDesktop/.test(t))return[t$,""];if(new RegExp(ts).test(t)&&!/IEMobile\b/.test(t))return[tT+" "+ts,""];let i=/Windows NT ([0-9.]+)/i.exec(t);if(i&&i[1]){let e=tV[i[1]]||"";return/arm/i.test(t)&&(e="RT"),[tT,e]}return[tT,""]}],[/((iPhone|iPad|iPod).*?OS (\d+)_(\d+)_?(\d+)?|iPhone)/,e=>e&&e[3]?["iOS",[e[3],e[4],e[5]||"0"].join(".")]:["iOS",""]],[/(watch.*\/(\d+\.\d+\.\d+)|watch os,(\d+\.\d+),)/i,e=>{let t="";return e&&e.length>=3&&(t=T(e[2])?e[3]:e[2]),["watchOS",t]}],[RegExp("("+tn+" (\\d+)\\.(\\d+)\\.?(\\d+)?|"+tn+")","i"),e=>e&&e[2]?[tn,[e[2],e[3],e[4]||"0"].join(".")]:[tn,""]],[/Mac OS X (\d+)[_.](\d+)[_.]?(\d+)?/i,e=>{let t=["Mac OS X",""];if(e&&e[1]){let i=[e[1],e[2],e[3]||"0"];t[1]=i.join(".")}return t}],[/Mac/i,["Mac OS X",""]],[/CrOS/,[tf,""]],[/Linux|debian/i,["Linux",""]]],tJ=function(e){return tW.test(e)?tI:tU.test(e)?tP:tH.test(e)?tF:RegExp(tM,"i").test(e)?tM:RegExp("("+t$+"|WPDesktop)","i").test(e)?t$:/iPad/.test(e)?ta:/iPod/.test(e)?"iPod Touch":/iPhone/.test(e)?"iPhone":/(watch)(?: ?os[,/]|\d,\d\/)[\d.]+/i.test(e)?tu:tz.test(e)?td:/(kobo)\s(ereader|touch)/i.test(e)?"Kobo":RegExp(tA,"i").test(e)?tA:/(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(ts).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)?tn:to:tn:RegExp("(pda|"+ts+")","i").test(e)?tD:RegExp(tr,"i").test(e)&&!RegExp(tr+" pc","i").test(e)?tO:""},tY="https?://(.*)",tX=["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"],tK={campaignParams:function(e){return g?this._campaignParamsFromUrl(g.URL,e):{}},_campaignParamsFromUrl:function(e,t){let i=tX.concat(t||[]),s={};return z(i,function(t){let i=tt(e,t);s[t]=i||null}),s},_searchEngine:function(e){return e?0===e.search(tY+"google.([^/?]*)")?"google":0===e.search(tY+"bing.com")?"bing":0===e.search(tY+"yahoo.com")?"yahoo":0===e.search(tY+"duckduckgo.com")?"duckduckgo":null:null},_searchInfoFromReferrer:function(e){let t=tK._searchEngine(e),i={};if(!M(t)){i.$search_engine=t;let e=g?tt(g.referrer,"yahoo"!=t?"q":"p"):"";e.length&&(i.ph_keyword=e)}return i},searchInfo:function(){let e=null==g?void 0:g.referrer;return e?this._searchInfoFromReferrer(e):{}},browser:tG,browserVersion:function(e,t){let i=tj[tG(e,t)];if(T(i))return null;for(let t=0;t<i.length;t++){let s=i[t],n=e.match(s);if(n)return parseFloat(n[n.length-2])}return null},browserLanguage:function(){return navigator.language||navigator.userLanguage},os:function(e){for(let t=0;t<tQ.length;t++){let[i,s]=tQ[t],n=i.exec(e),r=n&&(F(s)?s(n,e):s);if(r)return r}return["",""]},device:tJ,deviceType:function(e){let t=tJ(e);return t===ta||t===to||"Kobo"===t||"Kindle Fire"===t||t===tO?tr:t===tI||t===tF||t===tP||t===tM?"Console":t===tu?"Wearable":t?ts:"Desktop"},referrer:function(){return(null==g?void 0:g.referrer)||"$direct"},referringDomain:function(){var e;return null!=g&&g.referrer&&(null==(e=e7(g.referrer))?void 0:e.host)||"$direct"},referrerInfo:function(){return{$referrer:this.referrer(),$referring_domain:this.referringDomain()}},initialPersonInfo:function(){return{r:this.referrer(),u:null==f?void 0:f.href}},initialPersonPropsFromInfo:function(e){var t;let{r:i,u:s}=e,n={$initial_referrer:i,$initial_referring_domain:null==i?void 0:"$direct"==i?"$direct":null==(t=e7(i))?void 0:t.host};
1if(s){n.$initial_current_url=s;let e=e7(s);n.$initial_host=null==e?void 0:e.host,n.$initial_pathname=null==e?void 0:e.pathname,z(this._campaignParamsFromUrl(s),function(e,t){n["$initial_"+X(t)]=e})}return i&&z(this._searchInfoFromReferrer(i),function(e,t){n["$initial_"+X(t)]=e}),n},timezone:function(){try{return Intl.DateTimeFormat().resolvedOptions().timeZone}catch{return}},properties:function(){if(!b)return{};let[e,t]=tK.os(b);return V(Y({$os:e,$os_version:t,$browser:tK.browser(b,navigator.vendor),$device:tK.device(b),$device_type:tK.deviceType(b),$timezone:tK.timezone()}),{$current_url:null==f?void 0:f.href,$host:null==f?void 0:f.host,$pathname:null==f?void 0:f.pathname,$raw_user_agent:b.length>1e3?b.substring(0,997)+"...":b,$browser_version:tK.browserVersion(b,navigator.vendor),$browser_language:tK.browserLanguage(),$screen_height:null==u?void 0:u.screen.height,$screen_width:null==u?void 0:u.screen.width,$viewport_height:null==u?void 0:u.innerHeight,$viewport_width:null==u?void 0:u.innerWidth,$lib:"web",$lib_version:S.LIB_VERSION,$insert_id:Math.random().toString(36).substring(2,10)+Math.random().toString(36).substring(2,10),$time:Date.now()/1e3})},people_properties:function(){if(!b)return{};let[e,t]=tK.os(b);return V(Y({$os:e,$os_version:t,$browser:tK.browser(b,navigator.vendor)}),{$browser_version:tK.browserVersion(b,navigator.vendor)})}},tZ=["cookie","localstorage","localstorage+cookie","sessionstorage","memory"];class t0{constructor(e){this.config=e,this.props={},this.campaign_params_saved=!1,this.name=(e=>{let t="";return e.token&&(t=e.token.replace(/\+/g,"PL").replace(/\//g,"SL").replace(/=/g,"EQ")),e.persistence_name?"ph_"+e.persistence_name:"ph_"+t+"_posthog"})(e),this.storage=this.buildStorage(e),this.load(),e.debug&&q.info("Persistence loaded",e.persistence,{...this.props}),this.update_config(e,e),this.save()}buildStorage(e){-1===tZ.indexOf(e.persistence.toLowerCase())&&(q.critical("Unknown persistence type "+e.persistence+"; falling back to localStorage+cookie"),e.persistence="localStorage+cookie");let t=e.persistence.toLowerCase();return"localstorage"===t&&e0.is_supported()?e0:"localstorage+cookie"===t&&e2.is_supported()?e2:"sessionstorage"===t&&e8.is_supported()?e8:"memory"===t?e5:"cookie"===t?eK:e2.is_supported()?e2:eK}properties(){let e={};return z(this.props,function(t,i){if(i===ew&&R(t)){let i=Object.keys(t);for(let s=0;s<i.length;s++)e[`$feature/${i[s]}`]=t[i[s]]}else{let s;s=!1,(M(eD)?s:_&&eD.indexOf===_?-1!=eD.indexOf(i):(z(eD,function(e){if(s||(s=e===i))return H}),s))||(e[i]=t)}}),e}load(){if(this.disabled)return;let e=this.storage.parse(this.name);e&&(this.props=V({},e))}save(){this.disabled||this.storage.set(this.name,this.props,this.expire_days,this.cross_subdomain,this.secure,this.config.debug)}remove(){this.storage.remove(this.name,!1),this.storage.remove(this.name,!0)}clear(){this.remove(),this.props={}}register_once(e,t,i){if(R(e)){T(t)&&(t="None"),this.expire_days=T(i)?this.default_expiry:i;let s=!1;if(z(e,(e,i)=>{this.props.hasOwnProperty(i)&&this.props[i]!==t||(this.props[i]=e,s=!0)}),s)return this.save(),!0}return!1}register(e,t){if(R(e)){this.expire_days=T(t)?this.default_expiry:t;let i=!1;if(z(e,(t,s)=>{e.hasOwnProperty(s)&&this.props[s]!==t&&(this.props[s]=t,i=!0)}),i)return this.save(),!0}return!1}unregister(e){e in this.props&&(delete this.props[e],this.save())}update_campaign_params(){this.campaign_params_saved||(C(Y(tK.campaignParams(this.config.custom_campaign_params)))||this.register(tK.campaignParams(this.config.custom_campaign_params)),this.campaign_params_saved=!0)}update_search_keyword(){this.register(tK.searchInfo())}update_referrer_info(){this.register_once(tK.referrerInfo(),void 0)}set_initial_person_info(){this.props[eT]||this.props[e$]||this.register_once({[eA]:tK.initialPersonInfo()},void 0)}get_referrer_info(){return Y({$referrer:this.props.$referrer,$referring_domain:this.props.$referring_domain})}get_initial_props(){let e={};z([e$,eT],t=>{let i=this.props[t];i&&z(i,function(t,i){e["$initial_"+X(i)]=t})});let t=this.props[eA];return t&&V(e,tK.initialPersonPropsFromInfo(t)),e}safe_merge(e){return z(this.props,function(t,i){i in e||(e[i]=t)}),e}update_config(e,t){if(this.default_expiry=this.expire_days=e.cookie_expiration,this.set_disabled(e.disable_persistence),this.set_cross_subdomain(e.cross_subdomain_cookie),this.set_secure(e.secure_cookie),e.persistence!==t.persistence){let t=this.buildStorage(e),i=this.props;this.clear(),this.storage=t,this.props=i,this.save()}}set_disabled(e){this.disabled=e,this.disabled?this.remove():this.save()}set_cross_subdomain(e){e!==this.cross_subdomain&&(this.cross_subdomain=e,this.remove(),this.save())}
1get_cross_subdomain(){return!!this.cross_subdomain}set_secure(e){e!==this.secure&&(this.secure=e,this.remove(),this.save())}set_event_timer(e,t){let i=this.props[es]||{};i[e]=t,this.props[es]=i,this.save()}remove_event_timer(e){let t=(this.props[es]||{})[e];return T(t)||(delete this.props[es][e],this.save()),t}get_property(e){return this.props[e]}set_property(e,t){this.props[e]=t,this.save()}}function t1(e){var t;return(null==(t=JSON.stringify(e,function(){let e=[];return function(t,i){if(R(i)){for(;e.length>0&&e.at(-1)!==this;)e.pop();return e.includes(i)?"[Circular]":(e.push(i),i)}return i}}()))?void 0:t.length)||0}var t2=(e=>(e[e.DomContentLoaded=0]="DomContentLoaded",e[e.Load=1]="Load",e[e.FullSnapshot=2]="FullSnapshot",e[e.IncrementalSnapshot=3]="IncrementalSnapshot",e[e.Meta=4]="Meta",e[e.Custom=5]="Custom",e[e.Plugin=6]="Plugin",e))(t2||{}),t3=(e=>(e[e.Mutation=0]="Mutation",e[e.MouseMove=1]="MouseMove",e[e.MouseInteraction=2]="MouseInteraction",e[e.Scroll=3]="Scroll",e[e.ViewportResize=4]="ViewportResize",e[e.Input=5]="Input",e[e.TouchMove=6]="TouchMove",e[e.MediaInteraction=7]="MediaInteraction",e[e.StyleSheetRule=8]="StyleSheetRule",e[e.CanvasMutation=9]="CanvasMutation",e[e.Font=10]="Font",e[e.Log=11]="Log",e[e.Drag=12]="Drag",e[e.StyleDeclaration=13]="StyleDeclaration",e[e.Selection=14]="Selection",e[e.AdoptedStyleSheet=15]="AdoptedStyleSheet",e[e.CustomElement=16]="CustomElement",e))(t3||{});function t5(e){var t;return e.id===eL||!(null==(t=e.closest)||!t.call(e,"#"+eL))}function t6(e){return!!e&&1===e.nodeType}function t8(e,t){return!!e&&!!e.tagName&&e.tagName.toLowerCase()===t.toLowerCase()}function t4(e){return!!e&&3===e.nodeType}function t7(e){return!!e&&11===e.nodeType}function t9(e){return e?U(e).split(/\s+/):[]}function ie(e){let t=null==u?void 0:u.location.href;return!!(t&&e&&e.some(e=>t.match(e)))}function it(e){let t="";switch(typeof e.className){case"string":t=e.className;break;case"object":t=(e.className&&"baseVal"in e.className?e.className.baseVal:null)||e.getAttribute("class")||"";break;default:t=""}return t9(t)}function ii(e){return L(e)?null:U(e).split(/(\s+)/).filter(e=>iv(e)).join("").replace(/[\r\n]/g," ").replace(/[ ]+/g," ").substring(0,255)}function is(e){let t="";return il(e)&&!iu(e)&&e.childNodes&&e.childNodes.length&&z(e.childNodes,function(e){var i;t4(e)&&e.textContent&&(t+=null!=(i=ii(e.textContent))?i:"")}),U(t)}function ir(e){var t;return T(e.target)?e.srcElement||null:null!=(t=e.target)&&t.shadowRoot?e.composedPath()[0]||null:e.target||null}let io=["a","button","form","input","select","textarea","label"];function ia(e){let t=e.parentNode;return!(!t||!t6(t))&&t}function il(e){for(let t=e;t.parentNode&&!t8(t,"body");t=t.parentNode){let e=it(t);if(G(e,"ph-sensitive")||G(e,"ph-no-capture"))return!1}if(G(it(e),"ph-include"))return!0;let t=e.type||"";if($(t))switch(t.toLowerCase()){case"hidden":case"password":return!1}let i=e.name||e.id||"";return!($(i)&&/^cc|cardnum|ccnum|creditcard|csc|cvc|cvv|exp|pass|pwd|routing|seccode|securitycode|securitynum|socialsec|socsec|ssn/i.test(i.replace(/[^a-zA-Z0-9]/g,"")))}function iu(e){return!!(t8(e,"input")&&!["button","checkbox","submit","reset"].includes(e.type)||t8(e,"select")||t8(e,"textarea")||"true"===e.getAttribute("contenteditable"))}let ic="(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})",id=RegExp(`^(?:${ic})$`),ih=new RegExp(ic),i_="\\d{3}-?\\d{2}-?\\d{4}",ip=RegExp(`^(${i_})$`),ig=RegExp(`(${i_})`);function iv(e){let t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return!(L(e)||$(e)&&(e=U(e),(t?id:ih).test((e||"").replace(/[- ]/g,""))||(t?ip:ig).test(e)))&&!0}function im(e){let t=is(e);return iv(t=`${t} ${(function e(t){let i="";return t&&t.childNodes&&t.childNodes.length&&z(t.childNodes,function(t){var s;if(t&&"span"===(null==(s=t.tagName)?void 0:s.toLowerCase()))try{let s=is(t);i=`${i} ${s}`.trim(),t.childNodes&&t.childNodes.length&&(i=`${i} ${e(t)}`.trim())}catch(e){q.error(e)}}),i})(e)}`.trim())?t:""}function iy(e){return e.replace(/"|\\"/g,'\\"')}let ib="[SessionRecording]",iw="redacted",iS={initiatorTypes:["audio","beacon","body","css","early-hint","embed","fetch","frame","iframe","icon","image","img","input","link","navigation","object","ping","script","track","video","xmlhttprequest"],maskRequestFn:e=>e,recordHeaders:!1,recordBody:!1,recordInitialRequests:!1,recordPerformance:!1,performanceEntryTypeToObserve:["first-input","navigation","paint","resource"],payloadSizeLimitBytes:1e6,payloadHostDenyList:[".lr-ingest.io",".ingest.sentry.io"]},iE=["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"],ik=["password","secret","passwd","api_key","apikey","auth","credentials","mysql_pwd","privatekey","private_key","token"],ix=["/s/","/e/","/i/"];function iI(e,t,i,s){if(L(e))return e;let n=(null==t?void 0:t["content-length"])||new Blob([e]).size;return $(n)&&(n=parseInt(n)),n>i?ib+` ${s} body too large to record (${n} bytes)`:e}function iP(e,t){if(L(e))return e;let i=e;
1return iv(i,!1)||(i=ib+" "+t+" body "+iw),z(ik,e=>{var s,n;null!=(s=i)&&s.length&&-1!==(null==(n=i)?void 0:n.indexOf(e))&&(i=ib+" "+t+" body "+iw+" as might contain: "+e)}),i}function iF(e,t,i,s){return t>i&&(q.warn("min cannot be greater than max."),t=i),D(e)?e>i?(s&&q.warn(s+" cannot be greater than max: "+i+". Using max value instead."),i):e<t?(s&&q.warn(s+" cannot be less than min: "+t+". Using min value instead."),t):e:(s&&q.warn(s+" must be a number. Defaulting to max value:"+i),i)}class iR{bucketSize=100;refillRate=10;mutationBuckets={};loggedTracker={};constructor(e){var t,i;let s=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this.rrweb=e,this.options=s,this.refillRate=iF(null!=(t=this.options.refillRate)?t:this.refillRate,0,100,"mutation throttling refill rate"),this.bucketSize=iF(null!=(i=this.options.bucketSize)?i:this.bucketSize,0,100,"mutation throttling bucket size"),setInterval(()=>{this.refillBuckets()},1e3)}refillBuckets=()=>{Object.keys(this.mutationBuckets).forEach(e=>{this.mutationBuckets[e]=this.mutationBuckets[e]+this.refillRate,this.mutationBuckets[e]>=this.bucketSize&&delete this.mutationBuckets[e]})};getNodeOrRelevantParent=e=>{let t=this.rrweb.mirror.getNode(e);if("svg"!==(null==t?void 0:t.nodeName)&&t instanceof Element){let e=t.closest("svg");if(e)return[this.rrweb.mirror.getId(e),e]}return[e,t]};numberOfChanges=e=>{var t,i,s,n,r,o,a,l;return(null!=(t=null==(i=e.removes)?void 0:i.length)?t:0)+(null!=(s=null==(n=e.attributes)?void 0:n.length)?s:0)+(null!=(r=null==(o=e.texts)?void 0:o.length)?r:0)+(null!=(a=null==(l=e.adds)?void 0:l.length)?a:0)};throttleMutations=e=>{if(3!==e.type||0!==e.data.source)return e;let t=e.data,i=this.numberOfChanges(t);t.attributes&&(t.attributes=t.attributes.filter(e=>{var t,i,s;let[n,r]=this.getNodeOrRelevantParent(e.id);return 0!==this.mutationBuckets[n]&&(this.mutationBuckets[n]=null!=(t=this.mutationBuckets[n])?t:this.bucketSize,this.mutationBuckets[n]=Math.max(this.mutationBuckets[n]-1,0),0===this.mutationBuckets[n]&&(this.loggedTracker[n]||(this.loggedTracker[n]=!0,null==(i=(s=this.options).onBlockedNode)||i.call(s,n,r))),e)}));let s=this.numberOfChanges(t);return 0!==s||i===s?e:void 0}}var iC=Uint8Array,iT=Uint16Array,i$=Uint32Array,iA=new iC([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]),iM=new iC([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]),iL=new iC([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),iD=function(e,t){for(var i=new iT(31),s=0;s<31;++s)i[s]=t+=1<<e[s-1];var n=new i$(i[30]);for(s=1;s<30;++s)for(var r=i[s];r<i[s+1];++r)n[r]=r-i[s]<<5|s;return[i,n]},iO=iD(iA,2),iN=iO[0],iq=iO[1];iN[28]=258,iq[258]=28;for(var iB=iD(iM,0)[1],iH=new iT(32768),iU=0;iU<32768;++iU){var iW=(43690&iU)>>>1|(21845&iU)<<1;iW=(61680&(iW=(52428&iW)>>>2|(13107&iW)<<2))>>>4|(3855&iW)<<4,iH[iU]=((65280&iW)>>>8|(255&iW)<<8)>>>1}var iz=function(e,t,i){for(var s=e.length,n=0,r=new iT(t);n<s;++n)++r[e[n]-1];var o,a=new iT(t);for(n=0;n<t;++n)a[n]=a[n-1]+r[n-1]<<1;if(i){o=new iT(1<<t);var l=15-t;for(n=0;n<s;++n)if(e[n])for(var u=n<<4|e[n],c=t-e[n],d=a[e[n]-1]++<<c,h=d|(1<<c)-1;d<=h;++d)o[iH[d]>>>l]=u}else for(o=new iT(s),n=0;n<s;++n)o[n]=iH[a[e[n]-1]++]>>>15-e[n];return o},iV=new iC(288);for(iU=0;iU<144;++iU)iV[iU]=8;for(iU=144;iU<256;++iU)iV[iU]=9;for(iU=256;iU<280;++iU)iV[iU]=7;for(iU=280;iU<288;++iU)iV[iU]=8;var iG=new iC(32);for(iU=0;iU<32;++iU)iG[iU]=5;var ij=iz(iV,9,0),iQ=iz(iG,5,0),iJ=function(e){return(e/8|0)+(7&e&&1)},iY=function(e,t,i){(null==i||i>e.length)&&(i=e.length);var s=new(e instanceof iT?iT:e instanceof i$?i$:iC)(i-t);return s.set(e.subarray(t,i)),s},iX=function(e,t,i){i<<=7&t;var s=t/8|0;e[s]|=i,e[s+1]|=i>>>8},iK=function(e,t,i){i<<=7&t;var s=t/8|0;e[s]|=i,e[s+1]|=i>>>8,e[s+2]|=i>>>16},iZ=function(e,t){for(var i=[],s=0;s<e.length;++s)e[s]&&i.push({s:s,f:e[s]});var n=i.length,r=i.slice();if(!n)return[new iC(0),0];if(1==n){var o=new iC(i[0].s+1);return o[i[0].s]=1,[o,1]}i.sort(function(e,t){return e.f-t.f}),i.push({s:-1,f:25001});var a=i[0],l=i[1],u=0,c=1,d=2;for(i[0]={s:-1,f:a.f+l.f,l:a,r:l};c!=n-1;)a=i[i[u].f<i[d].f?u++:d++],l=i[u!=c&&i[u].f<i[d].f?u++:d++],i[c++]={s:-1,f:a.f+l.f,l:a,r:l};var h=r[0].s;for(s=1;s<n;++s)r[s].s>h&&(h=r[s].s);var _=new iT(h+1),p=i0(i[c-1],_,0);if(p>t){s=0;var g=0,f=p-t,v=1<<f;for(r.sort(function(e,t){return _[t.s]-_[e.s]||e.f-t.f});s<n;++s){var m=r[s].s;if(!(_[m]>t))break;g+=v-(1<<p-_[m]),_[m]=t}for(g>>>=f;g>0;){var y=r[s].s;_[y]<t?g-=1<<t-_[y]++-1:++s}for(;s>=0&&g;--s){var b=r[s].s;_[b]==t&&(--_[b],++g)}p=t}return[new iC(_),p]},i0=function(e,t,i){return -1==e.s?Math.max(i0(e.l,t,i+1),i0(e.r,t,i+1)):t[e.s]=i},i1=function(e){for(var t=e.length;t&&!e[--t];);for(var i=new iT(++t),s=0,n=e[0],r=1,o=function(e){i[s++]=e},a=1;a<=t;++a)if(e[a]==n&&a!=t)++r;else{if(!n&&r>2){for(;r>138;r-=138)o(32754);r>2&&(o(r>10?r-11<<5|28690:r-3<<5|12305),r=0)}else if(r>3){for(o(n),--r;r>6;r-=6)o(8304);r>2&&(o(r-3<<5|8208),r=0)}for(;r--;)o(n);r=1,n=e[a]}return[i.subarray(0,s),t]},i2=function(e,t){for(var i=0,s=0;s<t.length;++s)i+=e[s]*t[s];return i},i3=function(e,t,i){var s=i.length,n=iJ(t+2);e[n]=255&s,e[n+1]=s>>>8,e[n+2]=255^e[n],e[n+3]=255^e[n+1];for(var r=0;r<s;++r)e[n+r+4]=i[r];return 8*(n+4+s)},i5=function(e,t,i,s,n,r,o,a,l,u,c){iX(t,c++,i),++n[256];for(var d=iZ(n,15),h=d[0],_=d[1],p=iZ(r,15),g=p[0],f=p[1],v=i1(h),m=v[0],y=v[1],b=i1(g),w=b[0],S=b[1],E=new iT(19),k=0;k<m.length;++k)E[31&m[k]]++;for(k=0;k<w.length;++k)E[31&w[k]]++;for(var x=iZ(E,7),I=x[0],P=x[1],F=19;F>4&&!I[iL[F-1]];--F);var R,C,T,$,A=u+5<<3,M=i2(n,iV)+i2(r,iG)+o,L=i2(n,h)+i2(r,g)+o+14+3*F+i2(E,I)+(2*E[16]+3*E[17]+7*E[18]);if(A<=M&&A<=L)return i3(t,c,e.subarray(l,l+u));if(iX(t,c,1+(L<M)),c+=2,L<M){R=iz(h,_,0),C=h,T=iz(g,f,0),$=g;var D=iz(I,P,0);for(iX(t,c,y-257),iX(t,c+5,S-1),iX(t,c+10,F-4),c+=14,k=0;k<F;++k)iX(t,c+3*k,I[iL[k]]);c+=3*F;for(var O=[m,w],N=0;N<2;++N){var q=O[N];for(k=0;k<q.length;++k){var B=31&q[k];iX(t,c,D[B]),c+=I[B],B>15&&(iX(t,c,q[k]>>>5&127),c+=q[k]>>>12)}}}else R=ij,C=iV,T=iQ,$=iG;
1for(k=0;k<a;++k)if(s[k]>255){iK(t,c,R[(B=s[k]>>>18&31)+257]),c+=C[B+257],B>7&&(iX(t,c,s[k]>>>23&31),c+=iA[B]);var H=31&s[k];iK(t,c,T[H]),c+=$[H],H>3&&(iK(t,c,s[k]>>>5&8191),c+=iM[H])}else iK(t,c,R[s[k]]),c+=C[s[k]];return iK(t,c,R[256]),c+C[256]},i6=new i$([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),i8=function(){for(var e=new i$(256),t=0;t<256;++t){for(var i=t,s=9;--s;)i=(1&i&&0xedb88320)^i>>>1;e[t]=i}return e}(),i4=function(){var e=0xffffffff;return{p:function(t){for(var i=e,s=0;s<t.length;++s)i=i8[255&i^t[s]]^i>>>8;e=i},d:function(){return 0xffffffff^e}}},i7=function(e,t,i){for(;i;++t)e[t]=i,i>>>=8},i9=function(e,t){var i=t.filename;if(e[0]=31,e[1]=139,e[2]=8,e[8]=t.level<2?4:2*(9==t.level),e[9]=3,0!=t.mtime&&i7(e,4,Math.floor(new Date(t.mtime||Date.now())/1e3)),i){e[3]=8;for(var s=0;s<=i.length;++s)e[s+10]=i.charCodeAt(s)}};function se(e,t){void 0===t&&(t={});var i,s,n,r=i4(),o=e.length;r.p(e);var a=(s=t,n=10+((i=t).filename&&i.filename.length+1||0),function(e,t,i,s,n,r){var o=e.length,a=new iC(s+o+5*(1+Math.floor(o/7e3))+8),l=a.subarray(s,a.length-n),u=0;if(!t||o<8)for(var c=0;c<=o;c+=65535){var d=c+65535;d<o?u=i3(l,u,e.subarray(c,d)):(l[c]=r,u=i3(l,u,e.subarray(c,o)))}else{for(var h=i6[t-1],_=h>>>13,p=8191&h,g=(1<<i)-1,f=new iT(32768),v=new iT(g+1),m=Math.ceil(i/3),y=2*m,b=function(t){return(e[t]^e[t+1]<<m^e[t+2]<<y)&g},w=new i$(25e3),S=new iT(288),E=new iT(32),k=0,x=0,I=(c=0,0),P=0,F=0;c<o;++c){var R=b(c),C=32767&c,T=v[R];if(f[C]=T,v[R]=C,P<=c){var $=o-c;if((k>7e3||I>24576)&&$>423){u=i5(e,l,0,w,S,E,x,I,F,c-F,u),I=k=x=0,F=c;for(var A=0;A<286;++A)S[A]=0;for(A=0;A<30;++A)E[A]=0}var M=2,L=0,D=p,O=C-T&32767;if($>2&&R==b(c-O))for(var N=Math.min(_,$)-1,q=Math.min(32767,c),B=Math.min(258,$);O<=q&&--D&&C!=T;){if(e[c+M]==e[c+M-O]){for(var H=0;H<B&&e[c+H]==e[c+H-O];++H);if(H>M){if(M=H,L=O,H>N)break;var U=Math.min(O,H-2),W=0;for(A=0;A<U;++A){var z=c-O+A+32768&32767,V=z-f[z]+32768&32767;V>W&&(W=V,T=z)}}}O+=(C=T)-(T=f[C])+32768&32767}if(L){w[I++]=0x10000000|iq[M]<<18|iB[L];var G=31&iq[M],j=31&iB[L];x+=iA[G]+iM[j],++S[257+G],++E[j],P=c+M,++k}else w[I++]=e[c],++S[e[c]]}}u=i5(e,l,r,w,S,E,x,I,F,c-F,u)}return iY(a,0,s+iJ(u)+n)}(e,null==s.level?6:s.level,null==s.mem?Math.ceil(1.5*Math.max(8,Math.min(13,Math.log(e.length)))):12+s.mem,n,8,!0)),l=a.length;return i9(a,t),i7(a,l-8,r.d()),i7(a,l-4,o),a}function st(e,t){var i=e.length;if("undefined"!=typeof TextEncoder)return(new TextEncoder).encode(e);for(var s=new iC(e.length+(e.length>>>1)),n=0,r=function(e){s[n++]=e},o=0;o<i;++o){if(n+5>s.length){var a=new iC(n+8+(i-o<<1));a.set(s),s=a}var l=e.charCodeAt(o);l<128||t?r(l):(l<2048?r(192|l>>>6):(l>55295&&l<57344?(r(240|(l=65536+(1047552&l)|1023&e.charCodeAt(++o))>>>18),r(128|l>>>12&63)):r(224|l>>>12),r(128|l>>>6&63)),r(128|63&l))}return iY(s,0,n)}
1let si=[t3.MouseMove,t3.MouseInteraction,t3.Scroll,t3.ViewportResize,t3.Input,t3.TouchMove,t3.MediaInteraction,t3.Drag],ss=["trigger_activated","trigger_pending","trigger_disabled"],sn=e=>({rrwebMethod:e,enqueuedAt:Date.now(),attempt:1}),sr="[SessionRecording]";function so(e){return function(e,t){for(var i="",s=0;s<e.length;){var n=e[s++];n<128||t?i+=String.fromCharCode(n):n<224?i+=String.fromCharCode((31&n)<<6|63&e[s++]):n<240?i+=String.fromCharCode((15&n)<<12|(63&e[s++])<<6|63&e[s++]):i+=String.fromCharCode(55296|(n=((15&n)<<18|(63&e[s++])<<12|(63&e[s++])<<6|63&e[s++])-65536)>>10,56320|1023&n)}return i}(se(st(JSON.stringify(e))),!0)}function sa(e){return e.type===t2.Custom&&"sessionIdle"===e.data.tag}class sl{queuedRRWebEvents=[];isIdle=!1;_linkedFlagSeen=!1;_lastActivityTimestamp=Date.now();_linkedFlag=null;_removePageViewCaptureHook=void 0;_onSessionIdListener=void 0;_persistDecideOnSessionListener=void 0;_samplingSessionListener=void 0;_urlTriggers=[];_forceAllowLocalhostNetworkCapture=!1;get sessionIdleThresholdMilliseconds(){return this.instance.config.session_recording.session_idle_threshold_ms||3e5}get rrwebRecord(){var e,t;return null==w||null==(e=w.__PosthogExtensions__)||null==(t=e.rrweb)?void 0:t.record}get started(){return this._captureStarted}get sessionManager(){if(!this.instance.sessionManager)throw Error(sr+" must be started with a valid sessionManager.");return this.instance.sessionManager}get fullSnapshotIntervalMillis(){var e,t;return"trigger_pending"===this.urlTriggerStatus?6e4:null!=(e=null==(t=this.instance.config.session_recording)?void 0:t.full_snapshot_interval_millis)?e:3e5}get isSampled(){let e=this.instance.get_property(em);return O(e)?e:null}get sessionDuration(){var e,t;let i=null==(e=this.buffer)?void 0:e.data[(null==(t=this.buffer)?void 0:t.data.length)-1],{sessionStartTimestamp:s}=this.sessionManager.checkAndGetSessionAndWindowId(!0);return i?i.timestamp-s:null}get isRecordingEnabled(){let e=!!this.instance.get_property(ed),t=!this.instance.config.disable_session_recording;return u&&e&&t}get isConsoleLogCaptureEnabled(){let e=!!this.instance.get_property(eh),t=this.instance.config.enable_recording_console_log;return null!=t?t:e}get canvasRecording(){var e,t,i,s,n,r;let o=this.instance.config.session_recording.captureCanvas,a=this.instance.get_property(ep),l=null!=(e=null!=(t=null==o?void 0:o.recordCanvas)?t:null==a?void 0:a.enabled)&&e,u=null!=(i=null!=(s=null==o?void 0:o.canvasFps)?s:null==a?void 0:a.fps)?i:0,c=null!=(n=null!=(r=null==o?void 0:o.canvasQuality)?r:null==a?void 0:a.quality)?n:0;return{enabled:l,fps:iF(u,0,12,"canvas recording fps"),quality:iF(c,0,1,"canvas recording quality")}}get networkPayloadCapture(){var e,t;let i=this.instance.get_property(e_),s={recordHeaders:null==(e=this.instance.config.session_recording)?void 0:e.recordHeaders,recordBody:null==(t=this.instance.config.session_recording)?void 0:t.recordBody},n=(null==s?void 0:s.recordHeaders)||(null==i?void 0:i.recordHeaders),r=(null==s?void 0:s.recordBody)||(null==i?void 0:i.recordBody),o=R(this.instance.config.capture_performance)?this.instance.config.capture_performance.network_timing:this.instance.config.capture_performance,a=!!(O(o)?o:null==i?void 0:i.capturePerformance);return n||r||a?{recordHeaders:n,recordBody:r,recordPerformance:a}:void 0}get sampleRate(){let e=this.instance.get_property(eg);return D(e)?e:null}get minimumDuration(){let e=this.instance.get_property(ef);return D(e)?e:null}get status(){return this.receivedDecide?this.isRecordingEnabled?L(this._linkedFlag)||this._linkedFlagSeen?"trigger_pending"===this.urlTriggerStatus?"buffering":O(this.isSampled)?this.isSampled?"sampled":"disabled":"active":"buffering":"disabled":"buffering"}get urlTriggerStatus(){var e,t,i,s,n,r;if(this.receivedDecide&&0===this._urlTriggers.length)return"trigger_disabled";let o=null==(e=this.instance)?void 0:e.get_property(eb);return(null==(t=this.instance)?void 0:t.get_property(ey))!==this.sessionId?(null==(i=this.instance)||null==(s=i.persistence)||s.unregister(ey),null==(n=this.instance)||null==(r=n.persistence)||r.unregister(eb),"trigger_pending"):ss.includes(o)?o:"trigger_pending"}set urlTriggerStatus(e){var t,i;null==(t=this.instance)||null==(i=t.persistence)||i.register({[ey]:this.sessionId,[eb]:e})}constructor(e){if(this.instance=e,this._captureStarted=!1,this._endpoint="/s/",this.stopRrweb=void 0,this.receivedDecide=!1,!this.instance.sessionManager)throw q.error(sr+" started without valid sessionManager"),Error(sr+" started without valid sessionManager. This is a bug.");let{sessionId:t,windowId:i}=this.sessionManager.checkAndGetSessionAndWindowId();this.sessionId=t,this.windowId=i,this.buffer=this.clearBuffer(),this.sessionIdleThresholdMilliseconds>=this.sessionManager.sessionTimeoutMs&&q.warn(sr+` session_idle_threshold_ms (${this.sessionIdleThresholdMilliseconds}) is greater than the session timeout (${this.sessionManager.sessionTimeoutMs}
1). Session will never be detected as idle`)}_onBeforeUnload=()=>{this._flushBuffer()};_onOffline=()=>{this._tryAddCustomEvent("browser offline",{})};_onOnline=()=>{this._tryAddCustomEvent("browser online",{})};_onVisibilityChange=()=>{if(null!=g&&g.visibilityState){let e="window "+g.visibilityState;this._tryAddCustomEvent(e,{})}};startIfEnabledOrStop(e){this.isRecordingEnabled?(this._startCapture(e),null==u||u.addEventListener("beforeunload",this._onBeforeUnload),null==u||u.addEventListener("offline",this._onOffline),null==u||u.addEventListener("online",this._onOnline),null==u||u.addEventListener("visibilitychange",this._onVisibilityChange),this._setupSampling(),L(this._removePageViewCaptureHook)&&(this._removePageViewCaptureHook=this.instance._addCaptureHook(e=>{try{if("$pageview"===e){let e=u?this._maskUrl(u.location.href):"";if(!e)return;this._tryAddCustomEvent("$pageview",{href:e})}}catch(e){q.error("Could not add $pageview to rrweb session",e)}})),this._onSessionIdListener||(this._onSessionIdListener=this.sessionManager.onSessionId((e,t,i)=>{var s,n,r,o;i&&(this._tryAddCustomEvent("$session_id_change",{sessionId:e,windowId:t,changeReason:i}),null==(s=this.instance)||null==(n=s.persistence)||n.unregister(ey),null==(r=this.instance)||null==(o=r.persistence)||o.unregister(eb))}))):this.stopRecording()}stopRecording(){var e,t,i;this._captureStarted&&this.stopRrweb&&(this.stopRrweb(),this.stopRrweb=void 0,this._captureStarted=!1,null==u||u.removeEventListener("beforeunload",this._onBeforeUnload),null==u||u.removeEventListener("offline",this._onOffline),null==u||u.removeEventListener("online",this._onOnline),null==u||u.removeEventListener("visibilitychange",this._onVisibilityChange),this.clearBuffer(),clearInterval(this._fullSnapshotTimer),null==(e=this._removePageViewCaptureHook)||e.call(this),this._removePageViewCaptureHook=void 0,null==(t=this._onSessionIdListener)||t.call(this),this._onSessionIdListener=void 0,null==(i=this._samplingSessionListener)||i.call(this),this._samplingSessionListener=void 0,q.info(sr+" stopped"))}makeSamplingDecision(e){var t,i;let s,n=this.sessionId!==e,r=this.sampleRate;if(!D(r))return void(null==(i=this.instance.persistence)||i.register({[em]:null}));let o=this.isSampled,a=n||!O(o);s=a?Math.random()<r:o,a&&(s?this._reportStarted("sampling"):q.warn(sr+` Sample rate (${r}) has determined that this sessionId (${e}) will not be sent to the server.`),this._tryAddCustomEvent("samplingDecisionMade",{sampleRate:r,isSampled:s})),null==(t=this.instance.persistence)||t.register({[em]:s})}afterDecideResponse(e){var t,i,s,n;if(this._persistDecideResponse(e),this._linkedFlag=(null==(t=e.sessionRecording)?void 0:t.linkedFlag)||null,null!=(i=e.sessionRecording)&&i.endpoint&&(this._endpoint=null==(n=e.sessionRecording)?void 0:n.endpoint),this._setupSampling(),!L(this._linkedFlag)&&!this._linkedFlagSeen){let e=$(this._linkedFlag)?this._linkedFlag:this._linkedFlag.flag,t=$(this._linkedFlag)?null:this._linkedFlag.variant;this.instance.onFeatureFlags((i,s)=>{let n=R(s)&&e in s,r=t?s[e]===t:n;if(r){let i={linkedFlag:e,linkedVariant:t},s="linked flag matched";q.info(sr+" "+s,i),this._tryAddCustomEvent(s,i),this._reportStarted("linked_flag_match")}this._linkedFlagSeen=r})}null!=(s=e.sessionRecording)&&s.urlTriggers&&(this._urlTriggers=e.sessionRecording.urlTriggers),this.receivedDecide=!0,this.startIfEnabledOrStop()}_setupSampling(){D(this.sampleRate)&&L(this._samplingSessionListener)&&(this._samplingSessionListener=this.sessionManager.onSessionId(e=>{this.makeSamplingDecision(e)}))}_persistDecideResponse(e){if(this.instance.persistence){var t;let i=this.instance.persistence,s=()=>{var t,s,n,r,o,a,l;let u=null==(t=e.sessionRecording)?void 0:t.sampleRate,c=L(u)?null:parseFloat(u),d=null==(s=e.sessionRecording)?void 0:s.minimumDurationMilliseconds;i.register({[ed]:!!e.sessionRecording,[eh]:null==(n=e.sessionRecording)?void 0:n.consoleLogRecordingEnabled,[e_]:{capturePerformance:e.capturePerformance,...null==(r=e.sessionRecording)?void 0:r.networkPayloadCapture},[ep]:{enabled:null==(o=e.sessionRecording)?void 0:o.recordCanvas,fps:null==(a=e.sessionRecording)?void 0:a.canvasFps,quality:null==(l=e.sessionRecording)?void 0:l.canvasQuality},[eg]:c,[ef]:T(d)?null:d})};s(),null==(t=this._persistDecideOnSessionListener)||t.call(this),this._persistDecideOnSessionListener=this.sessionManager.onSessionId(s)}}log(e){var t;let i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"log";null==(t=this.instance.sessionRecording)||t.onRRwebEmit({type:6,data:{plugin:"rrweb/console@1",payload:{level:i,trace:[],payload:[JSON.stringify(e)]}},timestamp:Date.now()})}_startCapture(e){if(!T(Object.assign)&&!T(Array.from)&&!(this._captureStarted||this.instance.config.disable_session_recording||this.instance.consent.isOptedOut())){var t,i;(this._captureStarted=!0,this.sessionManager.checkAndGetSessionAndWindowId(),this.rrwebRecord)?this._onScriptLoaded():null==(t=w.__PosthogExtensions__)||null==(i=t.loadExternalDependency)||i.call(t,this.instance,"recorder",e=>{if(e)return q.error(sr+" could not load recorder",e);this._onScriptLoaded()}),q.info(sr+" starting"),"active"===this.status&&this._reportStarted(e||"recording_initialized")}}isInteractiveEvent(e){var t;return 3===e.type&&-1!==si.indexOf(null==(t=e.data)?void 0:t.source)}_updateWindowAndSessionIds(e){let t=this.isInteractiveEvent(e);t||this.isIdle||!(e.timestamp-this._lastActivityTimestamp>this.sessionIdleThresholdMilliseconds)||(this.isIdle=!0,clearInterval(this._fullSnapshotTimer),this._tryAddCustomEvent("sessionIdle",{eventTimestamp:e.timestamp,lastActivityTimestamp:this._lastActivityTimestamp,threshold:this.sessionIdleThresholdMilliseconds,bufferLength:this.buffer.data.length,bufferSize:this.buffer.size}),this._flushBuffer());let i=!1;if(t&&(this._lastActivityTimestamp=e.timestamp,this.isIdle&&(this.isIdle=!1,this._tryAddCustomEvent("sessionNoLongerIdle",{reason:"user activity",type:e.type}),i=!0)),this.isIdle)return;let{windowId:s,sessionId:n}=this.sessionManager.checkAndGetSessionAndWindowId(!t,e.timestamp),r=this.sessionId!==n,o=this.windowId!==s;this.windowId=s,this.sessionId=n,r||o?(this.stopRecording(),this.startIfEnabledOrStop("session_id_changed")):i&&this._scheduleFullSnapshot()}_tryRRWebMethod(e){try{return e.rrwebMethod(),!0}catch(t){return this.queuedRRWebEvents.length<10?this.queuedRRWebEvents.push({enqueuedAt:e.enqueuedAt||Date.now(),attempt:e.attempt++,rrwebMethod:e.rrwebMethod}
1):q.warn(sr+" could not emit queued rrweb event.",t,e),!1}}_tryAddCustomEvent(e,t){return this._tryRRWebMethod(sn(()=>this.rrwebRecord.addCustomEvent(e,t)))}_tryTakeFullSnapshot(){return this._tryRRWebMethod(sn(()=>this.rrwebRecord.takeFullSnapshot()))}_onScriptLoaded(){var e;let t={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};for(let[e,i]of Object.entries(this.instance.config.session_recording||{}))e in t&&("maskInputOptions"===e?t.maskInputOptions={password:!0,...i}:t[e]=i);if(this.canvasRecording&&this.canvasRecording.enabled&&(t.recordCanvas=!0,t.sampling={canvas:this.canvasRecording.fps},t.dataURLOptions={type:"image/webp",quality:this.canvasRecording.quality}),!this.rrwebRecord)return void q.error(sr+"onScriptLoaded was called but rrwebRecord is not available. This indicates something has gone wrong.");this.mutationRateLimiter=null!=(e=this.mutationRateLimiter)?e:new iR(this.rrwebRecord,{refillRate:this.instance.config.session_recording.__mutationRateLimiterRefillRate,bucketSize:this.instance.config.session_recording.__mutationRateLimiterBucketSize,onBlockedNode:(e,t)=>{let i=`Too many mutations on node '${e}'. Rate limiting. This could be due to SVG animations or something similar`;q.info(i,{node:t}),this.log(sr+" "+i,"warn")}});let i=this._gatherRRWebPlugins();this.stopRrweb=this.rrwebRecord({emit:e=>{this.onRRwebEmit(e)},plugins:i,...t}),this._lastActivityTimestamp=Date.now(),this.isIdle=!1,this._tryAddCustomEvent("$session_options",{sessionRecordingOptions:t,activePlugins:i.map(e=>null==e?void 0:e.name)}),this._tryAddCustomEvent("$posthog_config",{config:this.instance.config})}_scheduleFullSnapshot(){if(this._fullSnapshotTimer&&clearInterval(this._fullSnapshotTimer),this.isIdle)return;let e=this.fullSnapshotIntervalMillis;e&&(this._fullSnapshotTimer=setInterval(()=>{this._tryTakeFullSnapshot()},e))}_gatherRRWebPlugins(){var e,t,i,s;let n=[],r=null==(e=w.__PosthogExtensions__)||null==(t=e.rrwebPlugins)?void 0:t.getRecordConsolePlugin;r&&this.isConsoleLogCaptureEnabled&&n.push(r());let o=null==(i=w.__PosthogExtensions__)||null==(s=i.rrwebPlugins)?void 0:s.getRecordNetworkPlugin;return this.networkPayloadCapture&&F(o)&&(!e4.includes(location.hostname)||this._forceAllowLocalhostNetworkCapture?n.push(o(((e,t)=>{let i={payloadSizeLimitBytes:iS.payloadSizeLimitBytes,performanceEntryTypeToObserve:[...iS.performanceEntryTypeToObserve],payloadHostDenyList:[...t.payloadHostDenyList||[],...iS.payloadHostDenyList]},s=!1!==e.session_recording.recordHeaders&&t.recordHeaders,n=!1!==e.session_recording.recordBody&&t.recordBody,r=!1!==e.capture_performance&&t.recordPerformance,o=(e=>{var t;let i=Math.min(1e6,null!=(t=e.payloadSizeLimitBytes)?t:1e6);return e=>(null!=e&&e.requestBody&&(e.requestBody=iI(e.requestBody,e.requestHeaders,i,"Request")),null!=e&&e.responseBody&&(e.responseBody=iI(e.responseBody,e.responseHeaders,i,"Response")),e)})(i),a=e=>o((e=>{let t=e7(e.name);if(!(t&&t.pathname&&ix.some(e=>0===t.pathname.indexOf(e))))return e})((e=>{let t=e.requestHeaders;return L(t)||z(Object.keys(null!=t?t:{}),e=>{iE.includes(e.toLowerCase())&&(t[e]=iw)}),e})(e))),l=F(e.session_recording.maskNetworkRequestFn);return l&&F(e.session_recording.maskCapturedNetworkRequestFn)&&q.warn("Both `maskNetworkRequestFn` and `maskCapturedNetworkRequestFn` are defined. `maskNetworkRequestFn` will be ignored."),l&&(e.session_recording.maskCapturedNetworkRequestFn=t=>{let i=e.session_recording.maskNetworkRequestFn({url:t.name});return{...t,name:null==i?void 0:i.url}}),i.maskRequestFn=F(e.session_recording.maskCapturedNetworkRequestFn)?t=>{var i,s,n;let r=a(t);return r&&null!=(i=null==(s=(n=e.session_recording).maskCapturedNetworkRequestFn)?void 0:s.call(n,r))?i:void 0}:e=>(function(e){if(!T(e))return e.requestBody=iP(e.requestBody,"Request"),e.responseBody=iP(e.responseBody,"Response"),e})(a(e)),{...iS,...i,recordHeaders:s,recordBody:n,recordPerformance:r,recordInitialRequests:r}})(this.instance.config,this.networkPayloadCapture))):q.info(sr+" NetworkCapture not started because we are on localhost.")),n}onRRwebEmit(e){var t;if(this._processQueuedEvents(),!e||!R(e))return;if(e.type===t2.Meta){let t=this._maskUrl(e.data.href);if(this._lastHref=t,!t)return;e.data.href=t}else this._pageViewFallBack();this._checkUrlTrigger(),e.type===t2.FullSnapshot&&this._scheduleFullSnapshot(),e.type===t2.FullSnapshot&&"trigger_pending"===this.urlTriggerStatus&&this.clearBuffer();let i=this.mutationRateLimiter?this.mutationRateLimiter.throttleMutations(e):e;if(!i)return;let s=function(e){if(e&&R(e)&&6===e.type&&R(e.data)&&"rrweb/console@1"===e.data.plugin){e.data.payload.payload.length>10&&(e.data.payload.payload=e.data.payload.payload.slice(0,10),e.data.payload.payload.push("...[truncated]"));let t=[];for(let i=0;i<e.data.payload.payload.length;i++)e.data.payload.payload[i]&&e.data.payload.payload[i].length>2e3?t.push(e.data.payload.payload[i].slice(0,2e3)+"...[truncated]"):t.push(e.data.payload.payload[i]);return e.data.payload.payload=t,e}return e}(i);if(this._updateWindowAndSessionIds(s),this.isIdle&&!sa(s))return;if(sa(s)){let e=s.data.payload;e&&(s.timestamp=e.lastActivityTimestamp+e.threshold)}let n=null==(t=this.instance.config.session_recording.compress_events)||t?function(e){if(1024>t1(e))return e;try{if(e.type===t2.FullSnapshot)return{...e,data:so(e.data),cv:"2024-10"};if(e.type===t2.IncrementalSnapshot&&e.data.source===t3.Mutation)return{...e,cv:"2024-10",data:{...e.data,texts:so(e.data.texts),attributes:so(e.data.attributes),removes:so(e.data.removes),adds:so(e.data.adds)}};if(e.type===t2.IncrementalSnapshot&&e.data.source===t3.StyleSheetRule)return{...e,cv:"2024-10",data:{...e.data,adds:so(e.data.adds),removes:so(e.data.removes)}}}catch(e){q.error(sr+" could not compress event - will use uncompressed event",e)}return e}(s):s,r={$snapshot_bytes:t1(n),$snapshot_data:n,$session_id:this.sessionId,$window_id:this.windowId};"disabled"!==this.status?this._captureSnapshotBuffered(r):this.clearBuffer()}_pageViewFallBack(){if(this.instance.config.capture_pageview||!u)return;let e=this._maskUrl(u.location.href);this._lastHref!==e&&(this._tryAddCustomEvent("$url_changed",{href:e}),this._lastHref=e)}_processQueuedEvents(){if(this.queuedRRWebEvents.length){let e=[...this.queuedRRWebEvents];
1this.queuedRRWebEvents=[],e.forEach(e=>{Date.now()-e.enqueuedAt<=2e3&&this._tryRRWebMethod(e)})}}_maskUrl(e){let t=this.instance.config.session_recording;if(t.maskNetworkRequestFn){var i;let s={url:e};return null==(i=s=t.maskNetworkRequestFn(s))?void 0:i.url}return e}clearBuffer(){return this.buffer={size:0,data:[],sessionId:this.sessionId,windowId:this.windowId},this.buffer}_flushBuffer(){this.flushBufferTimer&&(clearTimeout(this.flushBufferTimer),this.flushBufferTimer=void 0);let e=this.minimumDuration,t=this.sessionDuration,i=D(t)&&t>=0,s=D(e)&&i&&t<e;return"buffering"===this.status||s?(this.flushBufferTimer=setTimeout(()=>{this._flushBuffer()},2e3),this.buffer):(this.buffer.data.length>0&&(function e(t){let i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:6606028.8;if(t.size>=i&&t.data.length>1){let i=Math.floor(t.data.length/2),s=t.data.slice(0,i),n=t.data.slice(i);return[e({size:t1(s),data:s,sessionId:t.sessionId,windowId:t.windowId}),e({size:t1(n),data:n,sessionId:t.sessionId,windowId:t.windowId})].flatMap(e=>e)}return[t]})(this.buffer).forEach(e=>{this._captureSnapshot({$snapshot_bytes:e.size,$snapshot_data:e.data,$session_id:e.sessionId,$window_id:e.windowId})}),this.clearBuffer())}_captureSnapshotBuffered(e){var t;let i=2+((null==(t=this.buffer)?void 0:t.data.length)||0);!this.isIdle&&(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.isIdle||(this.flushBufferTimer=setTimeout(()=>{this._flushBuffer()},2e3))}_captureSnapshot(e){this.instance.capture("$snapshot",e,{_url:this.instance.requestRouter.endpointFor("api",this._endpoint),_noTruncate:!0,_batchKey:"recordings",skip_client_rate_limiting:!0})}_checkUrlTrigger(){if(void 0===u||!u.location.href)return;let e=u.location.href;this._urlTriggers.some(t=>"regex"===t.matching&&new RegExp(t.url).test(e))&&this._activateUrlTrigger()}_activateUrlTrigger(){"trigger_pending"===this.urlTriggerStatus&&(this.urlTriggerStatus="trigger_activated",this._tryAddCustomEvent("url trigger activated",{}),this._flushBuffer(),q.info(sr+" recording triggered by URL pattern match"))}overrideLinkedFlag(){this._linkedFlagSeen=!0,this._reportStarted("linked_flag_override")}overrideSampling(){var e;null==(e=this.instance.persistence)||e.register({[em]:!0}),this._reportStarted("sampling_override")}_reportStarted(e){(arguments.length>1&&void 0!==arguments[1]?arguments[1]:()=>!0)()&&this.instance.register_for_session({$session_recording_start_reason:e})}}class su{constructor(e){this.instance=e,this.instance.decideEndpointWasHit=this.instance._hasBootstrappedFeatureFlags()}call(){let e={token:this.instance.config.token,distinct_id:this.instance.get_distinct_id(),groups:this.instance.getGroups(),person_properties:this.instance.get_property(eE),group_properties:this.instance.get_property(ek),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:e,compression:this.instance.config.disable_compression?void 0:s.Base64,timeout:this.instance.config.feature_flag_request_timeout_ms,callback:e=>this.parseDecideResponse(e.json)})}parseDecideResponse(e){this.instance.featureFlags.setReloadingPaused(!1),this.instance.featureFlags._startReloadTimer();let t=!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:{},t),t)q.error("Failed to fetch feature flags from PostHog.");else{if(!g||!g.body)return q.info("document not ready yet, trying again in 500 milliseconds..."),void setTimeout(()=>{this.parseDecideResponse(e)},500);if(this.instance._afterDecideResponse(e),e.siteApps)if(this.instance.config.opt_in_site_apps)for(let{id:t,url:r}of e.siteApps){var i,s,n;w[`__$$ph_site_app_${t}`]=this.instance,null==(i=w.__PosthogExtensions__)||null==(s=(n=i).loadSiteApp)||s.call(n,this.instance,r,e=>
1{if(e)return q.error(`Error while initializing PostHog app with config id ${t}`,e)})}else e.siteApps.length>0&&q.error('PostHog site apps are disabled. Enable the "opt_in_site_apps" config to proceed.')}}}let sc=null!=u&&u.location?ti(u.location.hash,"__posthog")||ti(location.hash,"state"):null,sd="_postHogToolbarParams";!function(e){e[e.UNINITIALIZED=0]="UNINITIALIZED",e[e.LOADING=1]="LOADING",e[e.LOADED=2]="LOADED"}(sC||(sC={}));class sh{constructor(e){this.instance=e}setToolbarState(e){w.ph_toolbar_state=e}getToolbarState(){var e;return null!=(e=w.ph_toolbar_state)?e:sC.UNINITIALIZED}maybeLoadToolbar(){var e,t;let i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:void 0,s=arguments.length>1&&void 0!==arguments[1]?arguments[1]:void 0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:void 0;if(!u||!g)return!1;i=null!=(e=i)?e:u.location,n=null!=(t=n)?t:u.history;try{let e;if(!s){try{u.localStorage.setItem("test","test"),u.localStorage.removeItem("test")}catch{return!1}s=null==u?void 0:u.localStorage}let t=sc||ti(i.hash,"__posthog")||ti(i.hash,"state"),r=t?Q(()=>JSON.parse(atob(decodeURIComponent(t))))||Q(()=>JSON.parse(decodeURIComponent(t))):null;return r&&"ph_authorize"===r.action?((e=r).source="url",e&&Object.keys(e).length>0&&(r.desiredHash?i.hash=r.desiredHash:n?n.replaceState(n.state,"",i.pathname+i.search):i.hash="")):((e=JSON.parse(s.getItem(sd)||"{}")).source="localstorage",delete e.userIntent),!(!e.token||this.instance.config.token!==e.token)&&(this.loadToolbar(e),!0)}catch{return!1}}_callLoadToolbar(e){(w.ph_load_toolbar||w.ph_load_editor)(e,this.instance)}loadToolbar(e){let t=!(null==g||!g.getElementById(eL));if(!u||t)return!1;let i="custom"===this.instance.requestRouter.region&&this.instance.config.advanced_disable_toolbar_metrics,s={token:this.instance.config.token,...e,apiURL:this.instance.requestRouter.endpointFor("ui"),...i?{instrument:!1}:{}};if(u.localStorage.setItem(sd,JSON.stringify({...s,source:void 0})),this.getToolbarState()===sC.LOADED)this._callLoadToolbar(s);else if(this.getToolbarState()===sC.UNINITIALIZED){var n,r;this.setToolbarState(sC.LOADING),null==(n=w.__PosthogExtensions__)||null==(r=n.loadExternalDependency)||r.call(n,this.instance,"toolbar",e=>{if(e)return q.error("Failed to load toolbar",e),void this.setToolbarState(sC.UNINITIALIZED);this.setToolbarState(sC.LOADED),this._callLoadToolbar(s)}),Z(u,"turbolinks:load",()=>{this.setToolbarState(sC.UNINITIALIZED),this.loadToolbar(s)})}return!0}_loadEditor(e){return this.loadToolbar(e)}maybeLoadEditor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:void 0,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:void 0,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:void 0;return this.maybeLoadToolbar(e,t,i)}}class s_{isPaused=!0;queue=[];flushTimeoutMs=3e3;constructor(e){this.sendRequest=e}enqueue(e){this.queue.push(e),this.flushTimeout||this.setFlushTimeout()}unload(){this.clearFlushTimeout();let e=Object.values(this.queue.length>0?this.formatQueue():{});[...e.filter(e=>0===e.url.indexOf("/e")),...e.filter(e=>0!==e.url.indexOf("/e"))].map(e=>{this.sendRequest({...e,transport:"sendBeacon"})})}enable(){this.isPaused=!1,this.setFlushTimeout()}setFlushTimeout(){this.isPaused||(this.flushTimeout=setTimeout(()=>{if(this.clearFlushTimeout(),this.queue.length>0){let e=this.formatQueue();for(let t in e){let i=e[t],s=(new Date).getTime();i.data&&P(i.data)&&z(i.data,e=>{e.offset=Math.abs(e.timestamp-s),delete e.timestamp}),this.sendRequest(i)}}},this.flushTimeoutMs))}clearFlushTimeout(){clearTimeout(this.flushTimeout),this.flushTimeout=void 0}formatQueue(){let e={};return z(this.queue,t=>{var i;let s=(t?t.batchKey:null)||t.url;T(e[s])&&(e[s]={...t,data:[]}),null==(i=e[s].data)||i.push(t.data)}),this.queue=[],e}}let sp=!!m||!!v,sg="text/plain",sf=(e,t)=>{let[i,s]=e.split("?"),n={...t};null==s||s.split("&").forEach(e=>{let[t]=e.split("=");delete n[t]});let r=te(n);return r=r?(s?s+"&":"")+r:s,`${i}?${r}`},sv=e=>{let{data:t,compression:i}=e;if(!t)return;if(i===s.GZipJS){let e=new Blob([se(st(JSON.stringify(t)),{mtime:0}
1)],{type:sg});return{contentType:sg,body:e,estimatedSize:e.size}}if(i===s.Base64){let e=(e=>"data="+encodeURIComponent("string"==typeof e?e:JSON.stringify(e)))(function(e){let t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",i,s,n,r,o,a,l=0,u=0,c="",d=[];if(!e)return e;e=K(e);do i=e.charCodeAt(l++),s=(a=i<<16|e.charCodeAt(l++)<<8|e.charCodeAt(l++))>>18&63,n=a>>12&63,r=a>>6&63,o=63&a,d[u++]=t.charAt(s)+t.charAt(n)+t.charAt(r)+t.charAt(o);while(l<e.length);switch(c=d.join(""),e.length%3){case 1:c=c.slice(0,-2)+"==";break;case 2:c=c.slice(0,-1)+"="}return c}(JSON.stringify(t)));return{contentType:"application/x-www-form-urlencoded",body:e,estimatedSize:new Blob([e]).size}}let n=JSON.stringify(t);return{contentType:"application/json",body:n,estimatedSize:new Blob([n]).size}},sm=[];m&&sm.push({transport:"XHR",method:e=>{var t;let i=new m;i.open(e.method||"GET",e.url,!0);let{contentType:s,body:n}=null!=(t=sv(e))?t:{};z(e.headers,function(e,t){i.setRequestHeader(t,e)}),s&&i.setRequestHeader("Content-Type",s),e.timeout&&(i.timeout=e.timeout),i.withCredentials=!0,i.onreadystatechange=()=>{if(4===i.readyState){var t;let s={statusCode:i.status,text:i.responseText};if(200===i.status)try{s.json=JSON.parse(i.responseText)}catch{}null==(t=e.callback)||t.call(e,s)}},i.send(n)}}),v&&sm.push({transport:"fetch",method:e=>{var t,i;let{contentType:s,body:n,estimatedSize:r}=null!=(t=sv(e))?t:{},o=new Headers;z(e.headers,function(e,t){o.append(t,e)}),s&&o.append("Content-Type",s);let a=e.url,l=null;if(y){let t=new y;l={signal:t.signal,timeout:setTimeout(()=>t.abort(),e.timeout)}}v(a,{method:(null==e?void 0:e.method)||"GET",headers:o,keepalive:"POST"===e.method&&52428.8>(r||0),body:n,signal:null==(i=l)?void 0:i.signal}).then(t=>t.text().then(i=>{var s;let n={statusCode:t.status,text:i};if(200===t.status)try{n.json=JSON.parse(i)}catch(e){q.error(e)}null==(s=e.callback)||s.call(e,n)})).catch(t=>{var i;q.error(t),null==(i=e.callback)||i.call(e,{statusCode:0,text:t})}).finally(()=>l?clearTimeout(l.timeout):null)}}),null!=p&&p.sendBeacon&&sm.push({transport:"sendBeacon",method:e=>{let t=sf(e.url,{beacon:"1"});try{var i;let{contentType:s,body:n}=null!=(i=sv(e))?i:{},r="string"==typeof n?new Blob([n],{type:s}):n;p.sendBeacon(t,r)}catch{}}});class sy{isPolling=!1;pollIntervalMs=3e3;queue=[];constructor(e){this.instance=e,this.queue=[],this.areWeOnline=!0,!T(u)&&"onLine"in u.navigator&&(this.areWeOnline=u.navigator.onLine,u.addEventListener("online",()=>{this.areWeOnline=!0,this.flush()}),u.addEventListener("offline",()=>{this.areWeOnline=!1}))}retriableRequest(e){let{retriesPerformedSoFar:t,...i}=e;D(t)&&t>0&&(i.url=sf(i.url,{retry_count:t})),this.instance._send_request({...i,callback:e=>{var s;200!==e.statusCode&&(e.statusCode<400||e.statusCode>=500)&&(null!=t?t:0)<10?this.enqueue({retriesPerformedSoFar:t,...i}):null==(s=i.callback)||s.call(i,e)}})}enqueue(e){let t=e.retriesPerformedSoFar||0;e.retriesPerformedSoFar=t+1;let i=function(e){let t=3e3*2**e,i=Math.min(18e5,t),s=(Math.random()-.5)*(i-t/2);return Math.ceil(i+s)}(t),s=Date.now()+i;this.queue.push({retryAt:s,requestOptions:e});let n=`Enqueued failed request for retry in ${i}`;navigator.onLine||(n+=" (Browser is offline)"),q.warn(n),this.isPolling||(this.isPolling=!0,this.poll())}poll(){this.poller&&clearTimeout(this.poller),this.poller=setTimeout(()=>{this.areWeOnline&&this.queue.length>0&&this.flush(),this.poll()},this.pollIntervalMs)}flush(){let e=Date.now(),t=[],i=this.queue.filter(i=>i.retryAt<e||(t.push(i),!1));if(this.queue=t,i.length>0)for(let{requestOptions:e}of i)this.retriableRequest(e)}unload(){for(let{requestOptions:e}of(this.poller&&(clearTimeout(this.poller),this.poller=void 0),this.queue))try{this.instance._send_request({...e,transport:"sendBeacon"})}catch(e){q.error(e)}this.queue=[]}}class sb{_sessionIdChangedHandlers=[];constructor(e,t,i,s){var n;this.config=e,this.persistence=t,this._windowId=void 0,this._sessionId=void 0,this._sessionStartTimestamp=null,this._sessionActivityTimestamp=null,this._sessionIdGenerator=i||eQ,this._windowIdGenerator=s||eQ;let r=e.persistence_name||e.token,o=e.session_idle_timeout_seconds||1800;if(this._sessionTimeoutMs=1e3*iF(o,60,1800,"session_idle_timeout_seconds"),this._window_id_storage_key="ph_"+r+"_window_id",this._primary_window_exists_storage_key="ph_"+r+"_primary_window_exists",this._canUseSessionStorage()){let e=e8.parse(this._window_id_storage_key),t=e8.parse(this._primary_window_exists_storage_key);e&&!t?this._windowId=e:e8.remove(this._window_id_storage_key),e8.set(this._primary_window_exists_storage_key,!0)}if(null!=(n=this.config.bootstrap)&&n.sessionID)try{let e=(e=>{let t=e.replace(/-/g,"");if(32!==t.length)throw Error("Not a valid UUID");if("7"!==t[12])throw Error("Not a UUIDv7");return parseInt(t.substring(0,12),16)})(this.config.bootstrap.sessionID);this._setSessionId(this.config.bootstrap.sessionID,(new Date).getTime(),e)}catch(e){q.error("Invalid sessionID in bootstrap",e)}this._listenToReloadWindow()}get sessionTimeoutMs(){return this._sessionTimeoutMs}
1onSessionId(e){return T(this._sessionIdChangedHandlers)&&(this._sessionIdChangedHandlers=[]),this._sessionIdChangedHandlers.push(e),this._sessionId&&e(this._sessionId,this._windowId),()=>{this._sessionIdChangedHandlers=this._sessionIdChangedHandlers.filter(t=>t!==e)}}_canUseSessionStorage(){return"memory"!==this.config.persistence&&!this.persistence.disabled&&e8.is_supported()}_setWindowId(e){e!==this._windowId&&(this._windowId=e,this._canUseSessionStorage()&&e8.set(this._window_id_storage_key,e))}_getWindowId(){return this._windowId?this._windowId:this._canUseSessionStorage()?e8.parse(this._window_id_storage_key):null}_setSessionId(e,t,i){e===this._sessionId&&t===this._sessionActivityTimestamp&&i===this._sessionStartTimestamp||(this._sessionStartTimestamp=i,this._sessionActivityTimestamp=t,this._sessionId=e,this.persistence.register({[ev]:[t,e,i]}))}_getSessionId(){if(this._sessionId&&this._sessionActivityTimestamp&&this._sessionStartTimestamp)return[this._sessionActivityTimestamp,this._sessionId,this._sessionStartTimestamp];let e=this.persistence.props[ev];return P(e)&&2===e.length&&e.push(e[0]),e||[0,null,0]}resetSessionId(){this._setSessionId(null,null,null)}_listenToReloadWindow(){null==u||u.addEventListener("beforeunload",()=>{this._canUseSessionStorage()&&e8.remove(this._primary_window_exists_storage_key)})}checkAndGetSessionAndWindowId(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=(arguments.length>1&&void 0!==arguments[1]?arguments[1]:null)||(new Date).getTime(),[i,s,n]=this._getSessionId(),r=this._getWindowId(),o=D(n)&&n>0&&Math.abs(t-n)>864e5,a=!1,l=!s,u=!e&&Math.abs(t-i)>this.sessionTimeoutMs;l||u||o?(s=this._sessionIdGenerator(),r=this._windowIdGenerator(),q.info("[SessionId] new session ID generated",{sessionId:s,windowId:r,changeReason:{noSessionId:l,activityTimeout:u,sessionPastMaximumLength:o}}),n=t,a=!0):r||(r=this._windowIdGenerator(),a=!0);let c=0===i||!e||o?t:i,d=0===n?(new Date).getTime():n;return this._setWindowId(r),this._setSessionId(s,c,d),a&&this._sessionIdChangedHandlers.forEach(e=>e(s,r,a?{noSessionId:l,activityTimeout:u,sessionPastMaximumLength:o}:void 0)),{sessionId:s,windowId:r,sessionStartTimestamp:d,changeReason:a?{noSessionId:l,activityTimeout:u,sessionPastMaximumLength:o}:void 0,lastActivityTimestamp:i}}}!function(e){e.US="us",e.EU="eu",e.CUSTOM="custom"}(n||(n={}));let sw="i.posthog.com";class sS{_regionCache={};constructor(e){this.instance=e}get apiHost(){let e=this.instance.config.api_host.trim().replace(/\/$/,"");return"https://app.posthog.com"===e?"https://us.i.posthog.com":e}get uiHost(){var e;let t=null==(e=this.instance.config.ui_host)?void 0:e.replace(/\/$/,"");return t||(t=this.apiHost.replace(`.${sw}`,".posthog.com")),"https://app.posthog.com"===t?"https://us.posthog.com":t}get region(){return this._regionCache[this.apiHost]||(/https:\/\/(app|us|us-assets)(\.i)?\.posthog\.com/i.test(this.apiHost)?this._regionCache[this.apiHost]=n.US:/https:\/\/(eu|eu-assets)(\.i)?\.posthog\.com/i.test(this.apiHost)?this._regionCache[this.apiHost]=n.EU:this._regionCache[this.apiHost]=n.CUSTOM),this._regionCache[this.apiHost]}endpointFor(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";if(t&&(t="/"===t[0]?t:`/${t}`),"ui"===e)return this.uiHost+t;if(this.region===n.CUSTOM)return this.apiHost+t;let i=sw+t;switch(e){case"assets":return`https://${this.region}-assets.${i}`;case"api":return`https://${this.region}.${i}`}}}let sE="posthog-js";function sk(e){let{organization:t,projectId:i,prefix:s,severityAllowList:n=["error"]}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return r=>{var o,a,l,u,c;if(!("*"===n||n.includes(r.level))||!e.__loaded)return r;r.tags||(r.tags={});let d=e.requestRouter.endpointFor("ui",`/project/${e.config.token}/person/${e.get_distinct_id()}`);r.tags["PostHog Person URL"]=d,e.sessionRecordingStarted()&&(r.tags["PostHog Recording URL"]=e.get_session_replay_url({withTimestamp:!0}));let h=(null==(o=r.exception)?void 0:o.values)||[],_={$exception_message:(null==(a=h[0])?void 0:a.value)||r.message,$exception_type:null==(l=h[0])?void 0:l.type,$exception_personURL:d,$exception_level:r.level,$exception_list:h,$sentry_event_id:r.event_id,$sentry_exception:r.exception,$sentry_exception_message:(null==(u=h[0])?void 0:u.value)||r.message,$sentry_exception_type:null==(c=h[
10])?void 0:c.type,$sentry_tags:r.tags,$level:r.level};return t&&i&&(_.$sentry_url=(s||"https://sentry.io/organizations/")+t+"/issues/?project="+i+"&query="+r.event_id),e.exceptions.sendExceptionEvent(_),r}}class sx{constructor(e,t,i,s,n){this.name=sE,this.setupOnce=function(r){r(sk(e,{organization:t,projectId:i,prefix:s,severityAllowList:n}))}}}class sI{constructor(e){this._instance=e}doPageView(e){var t;let i=this._previousPageViewProperties(e);return this._currentPath=null!=(t=null==u?void 0:u.location.pathname)?t:"",this._instance.scrollManager.resetContext(),this._prevPageviewTimestamp=e,i}doPageLeave(e){return this._previousPageViewProperties(e)}_previousPageViewProperties(e){let t=this._currentPath,i=this._prevPageviewTimestamp,s=this._instance.scrollManager.getContext();if(!i)return{};let n={};if(s){let{maxScrollHeight:e,lastScrollY:t,maxScrollY:i,maxContentHeight:r,lastContentY:o,maxContentY:a}=s;T(e)||T(t)||T(i)||T(r)||T(o)||T(a)||(e=Math.ceil(e),t=Math.ceil(t),i=Math.ceil(i),r=Math.ceil(r),o=Math.ceil(o),a=Math.ceil(a),n={$prev_pageview_last_scroll:t,$prev_pageview_last_scroll_percentage:e<=1?1:iF(t/e,0,1),$prev_pageview_max_scroll:i,$prev_pageview_max_scroll_percentage:e<=1?1:iF(i/e,0,1),$prev_pageview_last_content:o,$prev_pageview_last_content_percentage:r<=1?1:iF(o/r,0,1),$prev_pageview_max_content:a,$prev_pageview_max_content_percentage:r<=1?1:iF(a/r,0,1)})}return t&&(n.$prev_pageview_pathname=t),i&&(n.$prev_pageview_duration=(e.getTime()-i.getTime())/1e3),n}}!function(e){e.Popover="popover",e.API="api",e.Widget="widget"}(r||(r={})),function(e){e.Open="open",e.MultipleChoice="multiple_choice",e.SingleChoice="single_choice",e.Rating="rating",e.Link="link"}(o||(o={})),function(e){e.NextQuestion="next_question",e.End="end",e.ResponseBased="response_based",e.SpecificQuestion="specific_question"}(a||(a={}));class sP{events={};constructor(){this.events={}}on(e,t){return this.events[e]||(this.events[e]=[]),this.events[e].push(t),()=>{this.events[e]=this.events[e].filter(e=>e!==t)}}emit(e,t){for(let i of this.events[e]||[])i(t);for(let i of this.events["*"]||[])i(e,t)}}class sF{_debugEventEmitter=new sP;constructor(e){this.instance=e,this.actionEvents=new Set,this.actionRegistry=new Set}init(){var e,t;if(!T(null==(e=this.instance)?void 0:e._addCaptureHook)){let e=(e,t)=>{this.on(e,t)};null==(t=this.instance)||t._addCaptureHook(e)}}register(e){var t,i,s;if(!T(null==(t=this.instance)?void 0:t._addCaptureHook)&&(e.forEach(e=>{var t,i;null==(t=this.actionRegistry)||t.add(e),null==(i=e.steps)||i.forEach(e=>{var t;null==(t=this.actionEvents)||t.add((null==e?void 0:e.event)||"")})}),null!=(i=this.instance)&&i.autocapture)){let t=new Set;e.forEach(e=>{var i;null==(i=e.steps)||i.forEach(e=>{null!=e&&e.selector&&t.add(null==e?void 0:e.selector)})}),null==(s=this.instance)||s.autocapture.setElementSelectors(t)}}on(e,t){var i;null!=t&&0!=e.length&&(this.actionEvents.has(e)||this.actionEvents.has(null==t?void 0:t.event))&&this.actionRegistry&&(null==(i=this.actionRegistry)?void 0:i.size)>0&&this.actionRegistry.forEach(e=>{this.checkAction(t,e)&&this._debugEventEmitter.emit("actionCaptured",e.name)})}_addActionHook(e){this.onAction("actionCaptured",t=>e(t))}checkAction(e,t){if(null==(null==t?void 0:t.steps))return!1;for(let i of t.steps)if(this.checkStep(e,i))return!0;return!1}onAction(e,t){return this._debugEventEmitter.on(e,t)}checkStep=(e,t)=>this.checkStepEvent(e,t)&&this.checkStepUrl(e,t)&&this.checkStepElement(e,t);checkStepEvent=(e,t)=>null==t||!t.event||(null==e?void 0:e.event)===(null==t?void 0:t.event);checkStepUrl(e,t){if(null!=t&&t.url){var i;let s=null==e||null==(i=e.properties)?void 0:i.$current_url;if(!s||"string"!=typeof s||!sF.matchString(s,null==t?void 0:t.url,(null==t?void 0:t.url_matching)||"contains"))return!1}return!0}static matchString(e,t,i){switch(i){case"regex":return!!u&&e9(e,t);case"exact":return t===e;case"contains":return e9(e,sF.escapeStringRegexp(t).replace(/_/g,".").replace(/%/g,".*"));default:return!1}}static escapeStringRegexp(e){return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}checkStepElement(e,t){if((null!=t&&t.href||null!=t&&t.tag_name||null!=t&&t.text)&&!this.getElementsList(e).some(e=>!(null!=t&&t.href&&!sF.matchString(e.href||"",null==t?void 0:t.href,(null==t?void 0:t.href_matching)||"exact"))&&(null==t||!t.tag_name||e.tag_name===(null==t?void 0:t.tag_name))&&
1!(null!=t&&t.text&&!sF.matchString(e.text||"",null==t?void 0:t.text,(null==t?void 0:t.text_matching)||"exact")&&!sF.matchString(e.$el_text||"",null==t?void 0:t.text,(null==t?void 0:t.text_matching)||"exact"))))return!1;if(null!=t&&t.selector){var i;let s=null==e||null==(i=e.properties)?void 0:i.$element_selectors;if(!s||!s.includes(null==t?void 0:t.selector))return!1}return!0}getElementsList(e){return null==(null==e?void 0:e.properties.$elements)?[]:null==e?void 0:e.properties.$elements}}class sR{static SURVEY_SHOWN_EVENT_NAME="survey shown";constructor(e){this.instance=e,this.eventToSurveys=new Map,this.actionToSurveys=new Map}register(e){var t;T(null==(t=this.instance)?void 0:t._addCaptureHook)||(this.setupEventBasedSurveys(e),this.setupActionBasedSurveys(e))}setupActionBasedSurveys(e){let t=e.filter(e=>{var t,i,s,n;return(null==(t=e.conditions)?void 0:t.actions)&&(null==(i=e.conditions)||null==(s=i.actions)||null==(n=s.values)?void 0:n.length)>0});if(0!==t.length){if(null==this.actionMatcher){this.actionMatcher=new sF(this.instance),this.actionMatcher.init();let e=e=>{this.onAction(e)};this.actionMatcher._addActionHook(e)}t.forEach(e=>{var t,i,s,n,r,o,a,l,u,c;e.conditions&&null!=(t=e.conditions)&&t.actions&&null!=(i=e.conditions)&&null!=(s=i.actions)&&s.values&&(null==(n=e.conditions)||null==(r=n.actions)||null==(o=r.values)?void 0:o.length)>0&&(null==(a=this.actionMatcher)||a.register(e.conditions.actions.values),null==(l=e.conditions)||null==(u=l.actions)||null==(c=u.values)||c.forEach(t=>{if(t&&t.name){let i=this.actionToSurveys.get(t.name);i&&i.push(e.id),this.actionToSurveys.set(t.name,i||[e.id])}}))})}}setupEventBasedSurveys(e){var t;0!==e.filter(e=>{var t,i,s,n;return(null==(t=e.conditions)?void 0:t.events)&&(null==(i=e.conditions)||null==(s=i.events)||null==(n=s.values)?void 0:n.length)>0}).length&&(null==(t=this.instance)||t._addCaptureHook((e,t)=>{this.onEvent(e,t)}),e.forEach(e=>{var t,i,s;null==(t=e.conditions)||null==(i=t.events)||null==(s=i.values)||s.forEach(t=>{if(t&&t.name){let i=this.eventToSurveys.get(t.name);i&&i.push(e.id),this.eventToSurveys.set(t.name,i||[e.id])}})}))}onEvent(e,t){var i,s,n;let r=(null==(i=this.instance)||null==(s=i.persistence)?void 0:s.props[eI])||[];if(sR.SURVEY_SHOWN_EVENT_NAME==e&&t&&r.length>0){let e=null==t||null==(n=t.properties)?void 0:n.$survey_id;if(e){let t=r.indexOf(e);t>=0&&(r.splice(t,1),this._updateActivatedSurveys(r))}}else this.eventToSurveys.has(e)&&this._updateActivatedSurveys(r.concat(this.eventToSurveys.get(e)||[]))}onAction(e){var t,i;let s=(null==(t=this.instance)||null==(i=t.persistence)?void 0:i.props[eI])||[];this.actionToSurveys.has(e)&&this._updateActivatedSurveys(s.concat(this.actionToSurveys.get(e)||[]))}_updateActivatedSurveys(e){var t,i;null==(t=this.instance)||null==(i=t.persistence)||i.register({[eI]:[...new Set(e)]})}getSurveys(){var e,t;return(null==(e=this.instance)||null==(t=e.persistence)?void 0:t.props[eI])||[]}getEventToSurveys(){return this.eventToSurveys}_getActionMatcher(){return this.actionMatcher}}var sC,sT,s$,sA,sM,sL,sD,sO,sN,sq={},sB=[],sH=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,sU=Array.isArray;function sW(e,t){for(var i in t)e[i]=t[i];return e}function sz(e){var t=e.parentNode;t&&t.removeChild(e)}function sV(e,t,i,s,n){var r={type:e,props:t,key:i,ref:s,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,constructor:void 0,__v:null==n?++sA:n,__i:-1,__u:0};return null==n&&null!=s$.vnode&&s$.vnode(r),r}function sG(e){return e.children}function sj(e,t){this.props=e,this.context=t}function sQ(e,t){if(null==t)return e.__?sQ(e.__,e.__i+1):null;for(var i;t<e.__k.length;t++)if(null!=(i=e.__k[t])&&null!=i.__e)return i.__e;return"function"==typeof e.type?sQ(e):null}function sJ(e){(!e.__d&&(e.__d=!0)&&sM.push(e)&&!sY.__r++||sL!==s$.debounceRendering)&&((sL=s$.debounceRendering)||sD)(sY)}function sY(){var e,t,i,s,n,r,o,a,l;for(sM.sort(sO);e=sM.shift();)e.__d&&(t=sM.length,s=void 0,r=(n=(i=e).__v).__e,a=[],l=[],(o=i.__P)&&((s=sW({},n)).__v=n.__v+1,s$.vnode&&s$.vnode(s),s2(o,s,n,i.__n,void 0!==o.ownerSVGElement,32&n.__u?[r]:null,a,null==r?sQ(n):r,!!(32&n.__u),l),s.__.__k[s.__i]=s,function(e,t,i){t.__d=void 0;for(var s=0;s<i.length;s++)s3(i[s],i[++s],i[++s]);s$.__c&&s$.__c(t,e),e.some(function(t){try{e=t.__h,t.__h=[],e.some(function(e){e.call(t)})}catch(e){s$.__e(e,t.__v)}})}(a,s,l),s.__e!=r&&function e(t){var i,s;if(null!=(t=t.__)&&null!=t.__c){for(t.__e=t.__c.base=null,i=0;i<t.__k.length;i++)if(null!=(s=t.__k[i])&&null!=s.__e){t.__e=t.__c.base=s.__e;break}return e(t)}}(s)),sM.length>t&&sM.sort(sO));sY.__r=0}function sX(e,t,i,s,n,r,o,a,l,u,c){var d,h,_,p,g,f=s&&s.__k||sB,v=t.length;for(i.__d=l,function(e,t,i){var s,n,r,o,a,l=t.length,u=i.length,c=u,d=0;for(e.__k=[],s=0;s<l;s++)null!=(n=e.__k[s]=null==(n=t[s])||"boolean"==typeof n||"function"==typeof n?null:"string"==typeof n||"number"==typeof n||"bigint"==typeof n||n.constructor==String?sV(null,n,null,null,n):sU(n)?sV(sG,{children:n},null,null,null):void 0===n.constructor&&n.__b>0?sV(n.type,n.props,n.key,n.ref?n.ref:null,n.__v):n)?(n.__=e,n.__b=e.__b+1,a=function(e,t,i,s){var n=e.key,r=e.type,o=i-1,a=i+1,l=t[i];if(null===l||l&&n==l.key&&r===l.type)return i;if(s>+(null!=l&&0==(131072&l.__u)))for(;o>=0||a<t.length;){if(o>=0){if((l=t[o])&&0==(131072&l.__u)&&n==l.key&&r===l.type)return o;o--}if(a<t.length){if((l=t[a])&&0==(131072&l.__u)&&n==l.key&&r===l.type)return a;a++}}return -1}(n,i,o=s+d,c),n.__i=a,r=null,-1!==a&&(c--,(r=i[a])&&(r.__u|=131072)),null==r||null===r.__v?(-1==a&&d--,"function"!=typeof n.type&&(n.__u|=65536)):a!==o&&(a===o+1?d++:a>o?c>l-o?d+=a-o:d--:d=a<o&&a==o-1?a-o:0,a!==s+d&&(n.__u|=65536))):(r=i[s])&&null==r.key&&r.__e&&(r.__e==e.__d&&(e.__d=sQ(r)),s5(r,r,!1),i[s]=null,c--);if(c)for(s=0;s<u;s++)null!=(r=i[s])&&0==(131072&r.__u)&&(r.__e==e.__d&&(e.__d=sQ(r)),s5(r,r))}(i,t,f),l=i.__d,d=0;d<v;d++)null!=(_=i.__k[d])&&"boolean"!=typeof _&&"function"!=typeof _&&(h=-1===_.__i?sq:f[_.__i]||sq,_.__i=d,s2(e,_,h,n,r,o,a,l,u,c),p=_.__e,_.ref&&h.ref!=_.ref&&(h.ref&&s3(h.ref,null,_),c.push(_.ref,_.__c||p,_)),null==g&&null!=p&&(g=p),65536&_.__u||h.__k===_.__k?l=function e(t,i,s){var n,r;if("function"==typeof t.type){for(n=t.__k,r=0;n&&r<n.length;r++)n[r]&&(n[r].__=t,i=e(n[r],i,s));return i}return t.__e!=i&&(s.insertBefore(t.__e,i||null),i=t.__e),i&&i.nextSibling}
vendor: 5,956 bytes, line 1
1(_,l,e):"function"==typeof _.type&&void 0!==_.__d?l=_.__d:p&&(l=p.nextSibling),_.__d=void 0,_.__u&=-196609);i.__d=l,i.__e=g}function sK(e,t,i){"-"===t[0]?e.setProperty(t,null==i?"":i):e[t]=null==i?"":"number"!=typeof i||sH.test(t)?i:i+"px"}function sZ(e,t,i,s,n){var r;e:if("style"===t)if("string"==typeof i)e.style.cssText=i;else{if("string"==typeof s&&(e.style.cssText=s=""),s)for(t in s)i&&t in i||sK(e.style,t,"");if(i)for(t in i)s&&i[t]===s[t]||sK(e.style,t,i[t])}else if("o"===t[0]&&"n"===t[1])r=t!==(t=t.replace(/(PointerCapture)$|Capture$/,"$1")),t=t.toLowerCase()in e?t.toLowerCase().slice(2):t.slice(2),e.l||(e.l={}),e.l[t+r]=i,i?s?i.u=s.u:(i.u=Date.now(),e.addEventListener(t,r?s1:s0,r)):e.removeEventListener(t,r?s1:s0,r);else{if(n)t=t.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if("width"!==t&&"height"!==t&&"href"!==t&&"list"!==t&&"form"!==t&&"tabIndex"!==t&&"download"!==t&&"rowSpan"!==t&&"colSpan"!==t&&"role"!==t&&t in e)try{e[t]=null==i?"":i;break e}catch(e){}"function"==typeof i||(null==i||!1===i&&"-"!==t[4]?e.removeAttribute(t):e.setAttribute(t,i))}}function s0(e){var t=this.l[e.type+!1];if(e.t){if(e.t<=t.u)return}else e.t=Date.now();return t(s$.event?s$.event(e):e)}function s1(e){return this.l[e.type+!0](s$.event?s$.event(e):e)}function s2(e,t,i,s,n,r,o,a,l,u){var c,d,h,_,p,g,f,v,m,y,b,w,S,E,k,x=t.type;if(void 0!==t.constructor)return null;128&i.__u&&(l=!!(32&i.__u),r=[a=t.__e=i.__e]),(c=s$.__b)&&c(t);e:if("function"==typeof x)try{if(v=t.props,m=(c=x.contextType)&&s[c.__c],y=c?m?m.props.value:c.__:s,i.__c?f=(d=t.__c=i.__c).__=d.__E:("prototype"in x&&x.prototype.render?t.__c=d=new x(v,y):(t.__c=d=new sj(v,y),d.constructor=x,d.render=s6),m&&m.sub(d),d.props=v,d.state||(d.state={}),d.context=y,d.__n=s,h=d.__d=!0,d.__h=[],d._sb=[]),null==d.__s&&(d.__s=d.state),null!=x.getDerivedStateFromProps&&(d.__s==d.state&&(d.__s=sW({},d.__s)),sW(d.__s,x.getDerivedStateFromProps(v,d.__s))),_=d.props,p=d.state,d.__v=t,h)null==x.getDerivedStateFromProps&&null!=d.componentWillMount&&d.componentWillMount(),null!=d.componentDidMount&&d.__h.push(d.componentDidMount);else{if(null==x.getDerivedStateFromProps&&v!==_&&null!=d.componentWillReceiveProps&&d.componentWillReceiveProps(v,y),!d.__e&&(null!=d.shouldComponentUpdate&&!1===d.shouldComponentUpdate(v,d.__s,y)||t.__v===i.__v)){for(t.__v!==i.__v&&(d.props=v,d.state=d.__s,d.__d=!1),t.__e=i.__e,t.__k=i.__k,t.__k.forEach(function(e){e&&(e.__=t)}),b=0;b<d._sb.length;b++)d.__h.push(d._sb[b]);d._sb=[],d.__h.length&&o.push(d);break e}null!=d.componentWillUpdate&&d.componentWillUpdate(v,d.__s,y),null!=d.componentDidUpdate&&d.__h.push(function(){d.componentDidUpdate(_,p,g)})}if(d.context=y,d.props=v,d.__P=e,d.__e=!1,w=s$.__r,S=0,"prototype"in x&&x.prototype.render){for(d.state=d.__s,d.__d=!1,w&&w(t),c=d.render(d.props,d.state,d.context),E=0;E<d._sb.length;E++)d.__h.push(d._sb[E]);d._sb=[]}else do d.__d=!1,w&&w(t),c=d.render(d.props,d.state,d.context),d.state=d.__s;while(d.__d&&++S<25);d.state=d.__s,null!=d.getChildContext&&(s=sW(sW({},s),d.getChildContext())),h||null==d.getSnapshotBeforeUpdate||(g=d.getSnapshotBeforeUpdate(_,p)),sX(e,sU(k=null!=c&&c.type===sG&&null==c.key?c.props.children:c)?k:[k],t,i,s,n,r,o,a,l,u),d.base=t.__e,t.__u&=-161,d.__h.length&&o.push(d),f&&(d.__E=d.__=null)}catch(e){t.__v=null,l||null!=r?(t.__e=a,t.__u|=l?160:32,r[r.indexOf(a)]=null):(t.__e=i.__e,t.__k=i.__k),s$.__e(e,t,i)}else null==r&&t.__v===i.__v?(t.__k=i.__k,t.__e=i.__e):t.__e=function(e,t,i,s,n,r,o,a,l){var u,c,d,h,_,p,g,f=i.props,v=t.props,m=t.type;if("svg"===m&&(n=!0),null!=r){for(u=0;u<r.length;u++)if((_=r[u])&&"setAttribute"in _==!!m&&(m?_.localName===m:3===_.nodeType)){e=_,r[u]=null;break}}if(null==e){if(null===m)return document.createTextNode(v);e=n?document.createElementNS("http://www.w3.org/2000/svg",m):document.createElement(m,v.is&&v),r=null,a=!1}if(null===m)f===v||a&&e.data===v||(e.data=v);else{if(r=r&&sT.call(e.childNodes),f=i.props||sq,!a&&null!=r)for(f={},u=0;u<e.attributes.length;u++)f[(_=e.attributes[u]).name]=_.value;for(u in f)_=f[u],"children"==u||("dangerouslySetInnerHTML"==u?d=_:"key"===u||u in v||sZ(e,u,null,_,n));for(u in v)_=v[u],"children"==u?h=_:"dangerouslySetInnerHTML"==u?c=_:"value"==u?p=_:"checked"==u?g=_:"key"===u||a&&"function"!=typeof _||f[u]===_||sZ(e,u,_,f[u],n);if(c)a||d&&(c.__html===d.__html||c.__html===e.innerHTML)||(e.innerHTML=c.__html),t.__k=[];else if(d&&(e.innerHTML=""),sX(e,sU(h)?h:[h],t,i,s,n&&"foreignObject"!==m,r,o,r?r[0]:i.__k&&sQ(i,0),a,l),null!=r)for(u=r.length;u--;)null!=r[u]&&sz(r[u]);a||(u="value",void 0===p||p===e[u]&&("progress"!==m||p)&&("option"!==m||p===f[u])||sZ(e,u,p,f[u],!1),u="checked",void 0!==g&&g!==e[u]&&sZ(e,u,g,f[u],!1))}return e}(i.__e,t,i,s,n,r,o,l,u);(c=s$.diffed)&&c(t)}function s3(e,t,i){try{"function"==typeof e?e(t):e.current=t}catch(e){s$.__e(e,i)}}function s5(e,t,i){var s,n;if(s$.unmount&&s$.unmount(e),(s=e.ref)&&(s.current&&s.current!==e.__e||s3(s,null,t)),null!=(s=e.__c)){if(s.componentWillUnmount)try{s.componentWillUnmount()}catch(e){s$.__e(e,t)}s.base=s.__P=null,e.__c=void 0}if(s=e.__k)for(n=0;n<s.length;n++)s[n]&&s5(s[n],t,i||"function"!=typeof e.type);i||null==e.__e||sz(e.__e),e.__=e.__e=e.__d=void 0}function s6(e,t,i){return this.constructor(e,i)}sT=sB.slice,s$={__e:function(e,t,i,s){for(var n,r,o;t=t.__;)if((n=t.__c)&&!n.__)try{if((r=n.constructor)&&null!=r.getDerivedStateFromError&&(n.setState(r.getDerivedStateFromError(e)),o=n.__d),null!=n.componentDidCatch&&(n.componentDidCatch(e,s||{}),o=n.__d),o)return n.__E=n}catch(t){e=t}throw e}},sA=0,sj.prototype.setState=function(e,t){var i;i=null!=this.__s&&this.__s!==this.state?this.__s:this.__s=sW({},this.state),"function"==typeof e&&(e=e(sW({},i),this.props)),e&&sW(i,e),null!=e&&this.__v&&(t&&this._sb.push(t),sJ(this))},sj.prototype.forceUpdate=function(e){this.__v&&(this.__e=!0,e&&this.__h.push(e),sJ(this))},sj.prototype.render=sG,sM=[],sD="function"==typeof Promise?Promise.prototype.then.bind(Prom
1ise.resolve()):setTimeout,sO=function(e,t){return e.__v.__b-t.__v.__b},sY.__r=0,sN=0,function(e,t){var i={__c:t="__cC"+sN++,__:e,Consumer:function(e,t){return e.children(t)},Provider:function(e){var i,s;return this.getChildContext||(i=[],(s={})[t]=this,this.getChildContext=function(){return s},this.shouldComponentUpdate=function(e){this.props.value!==e.value&&i.some(function(e){e.__e=!0,sJ(e)})},this.sub=function(e){i.push(e);var t=e.componentWillUnmount;e.componentWillUnmount=function(){i.splice(i.indexOf(e),1),t&&t.call(e)}}),e.children}};i.Provider.__=i.Consumer.contextType=i}({isPreviewMode:!1,previewPageIndex:0,handleCloseSurveyPopup:()=>{},isPopup:!0});let s8="[Surveys]",s4={icontains:e=>!!u&&u.location.href.toLowerCase().indexOf(e.toLowerCase())>-1,not_icontains:e=>!!u&&-1===u.location.href.toLowerCase().indexOf(e.toLowerCase()),regex:e=>!!u&&e9(u.location.href,e),not_regex:e=>!!u&&!e9(u.location.href,e),exact:e=>(null==u?void 0:u.location.href)===e,is_not:e=>(null==u?void 0:u.location.href)!==e};class s7{constructor(e){this.instance=e,this._surveyEventReceiver=null}afterDecideResponse(e){this._decideServerResponse=!!e.surveys,this.loadIfEnabled()}reset(){localStorage.removeItem("lastSeenSurveyDate"),(()=>{let e=[];for(let t=0;t<localStorage.length;t++){let i=localStorage.key(t);null!=i&&i.startsWith("seenSurvey_")&&e.push(i)}return e}
1)().forEach(e=>localStorage.removeItem(e))}loadIfEnabled(){var e,t,i;let s=null==w||null==(e=w.__PosthogExtensions__)?void 0:e.generateSurveys;this.instance.config.disable_surveys||!this._decideServerResponse||s||(null==this._surveyEventReceiver&&(this._surveyEventReceiver=new sR(this.instance)),null==(t=w.__PosthogExtensions__)||null==(i=t.loadExternalDependency)||i.call(t,this.instance,"surveys",e=>{var t,i;if(e)return q.error(s8,"Could not load surveys script",e);this._surveyManager=null==(t=w.__PosthogExtensions__)||null==(i=t.generateSurveys)?void 0:i.call(t,this.instance)}))}getSurveys(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(this.instance.config.disable_surveys)return e([]);null==this._surveyEventReceiver&&(this._surveyEventReceiver=new sR(this.instance));let i=this.instance.get_property(ex);if(i&&!t)return e(i);this.instance._send_request({url:this.instance.requestRouter.endpointFor("api",`/api/surveys/?token=${this.instance.config.token}`),method:"GET",transport:"XHR",callback:t=>{var i,s;if(200!==t.statusCode||!t.json)return e([]);let n=t.json.surveys||[],r=n.filter(e=>{var t,i,s,n,r,o,a,l,u,c,d,h;return(null==(t=e.conditions)?void 0:t.events)&&(null==(i=e.conditions)||null==(s=i.events)?void 0:s.values)&&(null==(n=e.conditions)||null==(r=n.events)||null==(o=r.values)?void 0:o.length)>0||(null==(a=e.conditions)?void 0:a.actions)&&(null==(l=e.conditions)||null==(u=l.actions)?void 0:u.values)&&(null==(c=e.conditions)||null==(d=c.actions)||null==(h=d.values)?void 0:h.length)>0});return r.length>0&&(null==(s=this._surveyEventReceiver)||s.register(r)),null==(i=this.instance.persistence)||i.register({[ex]:n}),e(n)}})}getActiveMatchingSurveys(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];this.getSurveys(t=>{var i;let s=t.filter(e=>!(!e.start_date||e.end_date)).filter(e=>{var t,i,s,n;if(!e.conditions)return!0;let r=null==(t=e.conditions)||!t.url||s4[null!=(i=null==(s=e.conditions)?void 0:s.urlMatchType)?i:"icontains"](e.conditions.url),o=null==(n=e.conditions)||!n.selector||(null==g?void 0:g.querySelector(e.conditions.selector));return r&&o}),n=null==(i=this._surveyEventReceiver)?void 0:i.getSurveys();return e(s.filter(e=>{var t,i,s,r,o,a,l,u,c,d;if(!e.linked_flag_key&&!e.targeting_flag_key&&!e.internal_targeting_flag_key)return!0;let h=!e.linked_flag_key||this.instance.featureFlags.isFeatureEnabled(e.linked_flag_key),_=!e.targeting_flag_key||this.instance.featureFlags.isFeatureEnabled(e.targeting_flag_key),p=(null==(t=e.conditions)?void 0:t.events)&&(null==(i=e.conditions)||null==(s=i.events)?void 0:s.values)&&(null==(r=e.conditions)||null==(o=r.events)?void 0:o.values.length)>0,g=(null==(a=e.conditions)?void 0:a.actions)&&(null==(l=e.conditions)||null==(u=l.actions)?void 0:u.values)&&(null==(c=e.conditions)||null==(d=c.actions)?void 0:d.values.length)>0,f=!p&&!g||(null==n?void 0:n.includes(e.id)),v=this._canActivateRepeatedly(e),m=!(e.internal_targeting_flag_key&&!v)||this.instance.featureFlags.isFeatureEnabled(e.internal_targeting_flag_key);return h&&_&&m&&f}))},t)}getNextSurveyStep(e,t,i){var s,n,r,l,u;let c=e.questions[t],d=t+1;if(null==(s=c.branching)||!s.type)return t===e.questions.length-1?a.End:d;if(c.branching.type===a.End)return a.End;if(c.branching.type===a.SpecificQuestion){if(Number.isInteger(c.branching.index))return c.branching.index}else if(c.branching.type===a.ResponseBased){if(c.type===o.SingleChoice){let e=c.choices.indexOf(`${i}`);if(null!=(n=c.branching)&&null!=(r=n.responseValues)&&r.hasOwnProperty(e)){let t=c.branching.responseValues[e];return Number.isInteger(t)?t:t===a.End?a.End:d}}else if(c.type===o.Rating){if("number"!=typeof i||!Number.isInteger(i))throw Error("The response type must be an integer");let e=function(e,t){if(3===t){if(e<1||e>3)throw 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 Error("The response must be in range 1-5");return e<=2?"negative":3===e?"neutral":"positive"}if(7===t){if(e<1||e>7)throw Error("The response must be in range 1-7");return e<=3?"negative":4===e?"neutral":"positive"}if(10===t){if(e<0||e>10)throw Error("The response must be in range 0-10");return e<=6?"detractors":e<=8?"passives":"promoters"}throw Error("The scale must be one of: 3, 5, 7, 10")}(i,c.scale);if(null!=(l=c.branching)&&null!=(u=l.responseValues)&&u.hasOwnProperty(e)){let t=c.branching.responseValues[e];return Number.isInteger(t)?t:t===a.End?a.End:d}}return d}return q.warn(s8,"Falling back to next question index due to unexpected branching type"),d}_canActivateRepeatedly(e){var t;return L(null==(t=w.__PosthogExtensions__)?void 0:t.canActivateRepeatedly)?(q.warn(s8,"canActivateRepeatedly is not defined, must init before calling"),!1):w.__PosthogExtensions__.canActivateRepeatedly(e)}canRenderSurvey(e){L(this._surveyManager)?q.warn(s8,"canActivateRepeatedly is not defined, must init before calling"):this.getSurveys(t=>{let i=t.filter(t=>t.id===e)[0];this._surveyManager.canRenderSurvey(i)})}renderSurvey(e,t){L(this._surveyManager)?q.warn(s8,"canActivateRepeatedly is not defined, must init before calling"):this.getSurveys(i=>{let s=i.filter(t=>t.id===e)[0];this._surveyManager.renderSurvey(s,null==g?void 0:g.querySelector(t))})}}class s9{serverLimits={};lastEventRateLimited=!1;constructor(e){var t,i;this.instance=e,this.captureEventsPerSecond=(null==(t=e.config.rate_limiting)?void 0:t.events_per_second)||10,this.captureEventsBurstLimit=Math.max((null==(i=e.config.rate_limiting)?void 0:i.events_burst_limit)||10*this.captureEventsPerSecond,this.captureEventsPerSecond),this.lastEventRateLimited=this.clientRateLimitContext(!0).isRateLimited}clientRateLimitContext(){var e,t,i;let s=arguments.length>0&&void 0!==arguments[0]&&arguments[0],n=(new Date).getTime(),r=null!=(e=null==(t=this.instance.persistence)?void 0:t.get_property(eC))?e:{tokens:this.captureEventsBurstLimit,last:n};r.tokens+=(n-r.last)/1e3*this.captureEventsPerSecond,r.last=n,r.tokens>this.captureEventsBurstLimit&&(r.tokens=this.captureEventsBurstLimit);let o=r.tokens<1;return o||s||(r.tokens=Math.max(0,r.tokens-1)),!o||this.lastEventRateLimited||s||this.instance.capture("$$client_ingestion_warning",{$$client_ingestion_warning_message:`posthog-js client rate limited. Config is set to ${this.captureEventsPerSecond} events per second and ${this.captureEventsBurstLimit} events burst limit.`},{skip_client_rate_limiting:!0}),this.lastEventRateLimited=o,null==(i=this.instance.persistence)||i.set_property(eC,r),{isRateLimited:o,remainingTokens:r.tokens}}isServerRateLimited(e){let t=this.serverLimits[e||"events"]||!1;return!1!==t&&(new Date).getTime()<t}checkForLimiting=e=>{let t=e.text;
1if(t&&t.length)try{(JSON.parse(t).quota_limited||[]).forEach(e=>{q.info(`[RateLimiter] ${e||"events"} is quota limited.`),this.serverLimits[e]=(new Date).getTime()+6e4})}catch(e){return void q.warn(`[RateLimiter] could not rate limit - continuing. Error: "${null==e?void 0:e.message}"`,{text:t})}}}let ne=()=>({initialPathName:(null==f?void 0:f.pathname)||"",referringDomain:tK.referringDomain(),...tK.campaignParams()});class nt{constructor(e,t,i){this._sessionIdManager=e,this._persistence=t,this._sessionSourceParamGenerator=i||ne,this._sessionIdManager.onSessionId(this._onSessionIdCallback)}_getStoredProps(){return this._persistence.props[eR]}_onSessionIdCallback=e=>{let t=this._getStoredProps();if(t&&t.sessionId===e)return;let i={sessionId:e,props:this._sessionSourceParamGenerator()};this._persistence.register({[eR]:i})};getSessionProps(){var e;let t=null==(e=this._getStoredProps())?void 0:e.props;return t?{$client_session_initial_referring_host:t.referringDomain,$client_session_initial_pathname:t.initialPathName,$client_session_initial_utm_source:t.utm_source,$client_session_initial_utm_campaign:t.utm_campaign,$client_session_initial_utm_medium:t.utm_medium,$client_session_initial_utm_content:t.utm_content,$client_session_initial_utm_term:t.utm_term}:{}}}let ni=["ahrefsbot","ahrefssiteaudit","applebot","baiduspider","bingbot","bingpreview","bot.htm","bot.php","crawler","deepscan","duckduckbot","facebookexternal","facebookcatalog","gptbot","http://yandex.com/bots","hubspot","ia_archiver","linkedinbot","mj12bot","msnbot","nessus","petalbot","pinterest","prerender","rogerbot","screaming frog","semrushbot","sitebulb","slurp","turnitin","twitterbot","vercelbot","yahoo! slurp","yandexbot","headlesschrome","cypress","Google-HotelAdsVerifier","adsbot-google","apis-google","duplexweb-google","feedfetcher-google","google favicon","google web preview","google-read-aloud","googlebot","googleweblight","mediapartners-google","storebot-google","Bytespider;"],ns=function(e,t){if(!e)return!1;let i=e.toLowerCase();return ni.concat(t||[]).some(e=>{let t=e.toLowerCase();return -1!==i.indexOf(t)})},nn=function(e,t){if(!e)return!1;let i=e.userAgent;if(i&&ns(i,t))return!0;try{let i=null==e?void 0:e.userAgentData;if(null!=i&&i.brands&&i.brands.some(e=>ns(null==e?void 0:e.brand,t)))return!0}catch{}return!!e.webdriver};class nr{constructor(){this.clicks=[]}isRageClick(e,t,i){let s=this.clicks[this.clicks.length-1];if(s&&Math.abs(e-s.x)+Math.abs(t-s.y)<30&&i-s.timestamp<1e3){if(this.clicks.push({x:e,y:t,timestamp:i}),3===this.clicks.length)return!0}else this.clicks=[{x:e,y:t,timestamp:i}];return!1}}class no{rageclicks=new nr;_enabledServerSide=!1;_initialized=!1;_flushInterval=null;constructor(e){var t;this.instance=e,this._enabledServerSide=!(null==(t=this.instance.persistence)||!t.props[er]),null==u||u.addEventListener("beforeunload",()=>{this.flush()})}get flushIntervalMilliseconds(){let e=5e3;return R(this.instance.config.capture_heatmaps)&&this.instance.config.capture_heatmaps.flush_interval_milliseconds&&(e=this.instance.config.capture_heatmaps.flush_interval_milliseconds),e}get isEnabled(){return T(this.instance.config.capture_heatmaps)?T(this.instance.config.enable_heatmaps)?this._enabledServerSide:this.instance.config.enable_heatmaps:!1!==this.instance.config.capture_heatmaps}startIfEnabled(){if(this.isEnabled)this._initialized||(q.info("[heatmaps] starting..."),this._setupListeners(),this._flushInterval=setInterval(this.flush.bind(this),this.flushIntervalMilliseconds));else{var e;clearInterval(null!=(e=this._flushInterval)?e:void 0),this.getAndClearBuffer()}}afterDecideResponse(e){let t=!!e.heatmaps;this.instance.persistence&&this.instance.persistence.register({[er]:t}),this._enabledServerSide=t,this.startIfEnabled()}getAndClearBuffer(){let e=this.buffer;return this.buffer=void 0,e}_setupListeners(){u&&g&&(Z(g,"click",e=>this._onClick(e||(null==u?void 0:u.event)),!1,!0),Z(g,"mousemove",e=>this._onMouseMove(e||(null==u?void 0:u.event)),!1,!0),this._initialized=!0)}_getProperties(e,t){let i=this.instance.scrollManager.scrollY(),s=this.instance.scrollManager.scrollX(),n=this.instance.scrollManager.scrollElement(),r=function(e,t,i){let s=e;for(;s&&t6(s)&&!t8(s,"body")&&s!==i;){if(G(t,null==u?void 0:u.getComputedStyle(s).position))return!0;s=ia(s)}return!1}(ir(e),["fixed","sticky"],n);return{x:e.clientX+(r?0:s),y:e.clientY+(r?0:i),target_fixed:r,type:t}}_onClick(e){var t;if(t5(e.target))return;let i=this._getProperties(e,"click");null!=(t=this.rageclicks)&&t.isRageClick(e.clientX,e.clientY,(new Date).getTime())&&this._capture({...i,type:"rageclick"}),this._capture(i)}_onMouseMove(e){t5(e.target)||(clearTimeout(this._mouseMoveTimeout),this._mouseMoveTimeout=setTimeout(()=>{this._capture(this._getProperties(e,"mousemove"))},500))}_capture(e){if(!u)return;let t=u.location.href;this.buffer=this.buffer||{},this.buffer[t]||(this.buffer[t]=[]),this.buffer[t].push(e)}flush(){this.buffer&&!C(this.buffer)&&this.instance.capture("$$heatmap",{$heatmap_data:this.getAndClearBuffer()})}}class na{constructor(e){this.instance=e}getContext(){return this.context}resetContext(){let e=this.context;return setTimeout(this._updateScrollData,0),e}_updateScrollData=()=>{var e,t,i,s;this.context||(this.context={});let n=this.scrollElement(),r=this.scrollY(),o=n?Math.max(0,n.scrollHeight-n.clientHeight):0,a=r+((null==n?void 0:n.clientHeight)||0),l=(null==n?void 0:n.scrollHeight)||0;this.context.lastScrollY=Math.ceil(r),this.context.maxScrollY=Math.max(r,null!=(e=this.context.maxScrollY)?e:0),this.context.maxScrollHeight=Math.max(o,null!=(t=this.context.maxScrollHeight)?t:0),this.context.lastContentY=a,this.context.maxContentY=Math.max(a,null!=(i=this.context.maxContentY)?i:0),this.context.maxContentHeight=Math.max(l,null!=(s=this.context.maxContentHeight)?s:0)};startMeasuringScrollPosition(){null==u||u.addEventListener("scroll",this._updateScrollData,!0),null==u||u.addEventListener("scrollend",this._updateScrollData,!0),null==u||u.addEventListener("resize",this._updateScrollData)}scrollElement(){if(!this.instance.config.scroll_root_selector)return null==u?void 0:u.document.documentElement;for(let e of P(this.instance.config.scroll_root_selector)?this.instance.config.scroll_root_selector:[this.instance.config.scroll_root_selector]){let t=null==u?void 0:u.document.querySelector(e);
1if(t)return t}}scrollY(){if(this.instance.config.scroll_root_selector){let e=this.scrollElement();return e&&e.scrollTop||0}return u&&(u.scrollY||u.pageYOffset||u.document.documentElement.scrollTop)||0}scrollX(){if(this.instance.config.scroll_root_selector){let e=this.scrollElement();return e&&e.scrollLeft||0}return u&&(u.scrollX||u.pageXOffset||u.document.documentElement.scrollLeft)||0}}let nl="$copy_autocapture";function nu(e,t){return t.length>e?t.slice(0,e)+"...":t}class nc{_initialized=!1;_isDisabledServerSide=null;rageclicks=new nr;_elementsChainAsString=!1;constructor(e){this.instance=e,this._elementSelectors=null}get config(){var e,t;let i=R(this.instance.config.autocapture)?this.instance.config.autocapture:{};return i.url_allowlist=null==(e=i.url_allowlist)?void 0:e.map(e=>new RegExp(e)),i.url_ignorelist=null==(t=i.url_ignorelist)?void 0:t.map(e=>new RegExp(e)),i}_addDomEventHandlers(){if(!this.isBrowserSupported())return void q.info("Disabling Automatic Event Collection because this browser is not supported");if(!u||!g)return;let e=e=>{e=e||(null==u?void 0:u.event);try{this._captureEvent(e)}catch(e){q.error("Failed to capture event",e)}},t=e=>{e=e||(null==u?void 0:u.event),this._captureEvent(e,nl)};Z(g,"submit",e,!1,!0),Z(g,"change",e,!1,!0),Z(g,"click",e,!1,!0),this.config.capture_copied_text&&(Z(g,"copy",t,!1,!0),Z(g,"cut",t,!1,!0))}startIfEnabled(){this.isEnabled&&!this._initialized&&(this._addDomEventHandlers(),this._initialized=!0)}afterDecideResponse(e){e.elementsChainAsString&&(this._elementsC
1hainAsString=e.elementsChainAsString),this.instance.persistence&&this.instance.persistence.register({[en]:!!e.autocapture_opt_out}),this._isDisabledServerSide=!!e.autocapture_opt_out,this.startIfEnabled()}setElementSelectors(e){this._elementSelectors=e}getElementSelectors(e){var t;let i=[];return null==(t=this._elementSelectors)||t.forEach(t=>{let s=null==g?void 0:g.querySelectorAll(t);null==s||s.forEach(s=>{e===s&&i.push(t)})}),i}get isEnabled(){var e,t;let i=null==(e=this.instance.persistence)?void 0:e.props[en];if(M(this._isDisabledServerSide)&&!O(i)&&!this.instance.config.advanced_disable_decide)return!1;let s=null!=(t=this._isDisabledServerSide)?t:!!i;return!!this.instance.config.autocapture&&!s}_captureEvent(e){var t,i;let s=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"$autocapture";if(!this.isEnabled)return;let n=ir(e);t4(n)&&(n=n.parentNode||null),"$autocapture"===s&&"click"===e.type&&e instanceof MouseEvent&&this.instance.config.rageclick&&null!=(t=this.rageclicks)&&t.isRageClick(e.clientX,e.clientY,(new Date).getTime())&&this._captureEvent(e,"$rageclick");let r=s===nl;if(n&&function(e,t){let i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:void 0,s=arguments.length>3?arguments[3]:void 0,n=arguments.length>4?arguments[4]:void 0;if(!u||!e||t8(e,"html")||!t6(e)||null!=i&&i.url_allowlist&&!ie(i.url_allowlist)||null!=i&&i.url_ignorelist&&ie(i.url_ignorelist))return!1;if(null!=i&&i.dom_event_allowlist){let e=i.dom_event_allowlist;if(e&&!e.some(e=>t.type===e))return!1}let r=!1,o=[e],a=!0,l=e;for(;l.parentNode&&!t8(l,"body");)if(t7(l.parentNode))o.push(l.parentNode.host),l=l.parentNode.host;else{if(!(a=ia(l)))break;if(s||io.indexOf(a.tagName.toLowerCase())>-1)r=!0;else{let e=u.getComputedStyle(a);e&&"pointer"===e.getPropertyValue("cursor")&&(r=!0)}o.push(a),l=a}if(!function(e,t){let i=null==t?void 0:t.element_allowlist;if(T(i))return!0;for(let t of e)if(i.some(e=>t.tagName.toLowerCase()===e))return!0;return!1}(o,i)||!function(e,t){let i=null==t?void 0:t.css_selector_allowlist;if(T(i))return!0;for(let t of e)if(i.some(e=>t.matches(e)))return!0;return!1}(o,i))return!1;let c=u.getComputedStyle(e);if(c&&"pointer"===c.getPropertyValue("cursor")&&"click"===t.type)return!0;let d=e.tagName.toLowerCase();switch(d){case"html":return!1;case"form":return(n||["submit"]).indexOf(t.type)>=0;case"input":case"select":case"textarea":return(n||["change","click"]).indexOf(t.type)>=0;default:return r?(n||["click"]).indexOf(t.type)>=0:(n||["click"]).indexOf(t.type)>=0&&(io.indexOf(d)>-1||"true"===e.getAttribute("contenteditable"))}}(n,e,this.config,r,r?["copy","cut"]:void 0)){let{props:t,explicitNoCapture:r}=function(e,t){var i,s,n,r;let{e:o,maskAllElementAttributes:a,maskAllText:l,elementAttributeIgnoreList:c,elementsChainAsString:d}=t,h=[e],_=e;for(;_.parentNode&&!t8(_,"body");)t7(_.parentNode)?(h.push(_.parentNode.host),_=_.parentNode.host):(h.push(_.parentNode),_=_.parentNode);let p=[],g={},f,v=!1,m=!1;if(z(h,e=>{let t=il(e);"a"===e.tagName.toLowerCase()&&(v=e.getAttribute("href"),v=t&&v&&iv(v)&&v),G(it(e),"ph-no-capture")&&(m=!0),p.push(function(e,t,i,s){let n=e.tagName.toLowerCase(),r={tag_name:n};io.indexOf(n)>-1&&!i&&("a"===n.toLowerCase()||"button"===n.toLowerCase()?r.$el_text=nu(1024,im(e)):r.$el_text=nu(1024,is(e)));let o=it(e);o.length>0&&(r.classes=o.filter(function(e){return""!==e})),z(e.attributes,function(i){var n;if((!iu(e)||-1!==["name","id","class","aria-label"].indexOf(i.name))&&(null==s||!s.includes(i.name))&&!t&&iv(i.value)&&(!$(n=i.name)||"_ngcontent"!==n.substring(0,10)&&"_nghost"!==n.substring(0,7))){let e=i.value;"class"===i.name&&(e=t9(e).join(" ")),r["attr__"+i.name]=nu(1024,e)}});let a=1,l=1,u=e;for(;u=function(e){if(e.previousElementSibling)return e.previousElementSibling;let t=e;do t=t.previousSibling;while(t&&!t6(t));return t}(u);)a++,u.tagName===e.tagName&&l++;return r.nth_child=a,r.nth_of_type=l,r}(e,a,l,c)),V(g,function(e){if(!il(e))return{};let t={};return z(e.attributes,function(e){if(e.name&&0===e.name.indexOf("data-ph-capture-attribute")){let i=e.name.replace("data-ph-capture-attribute-",""),s=e.value;i&&s&&iv(s)&&(t[i]=s)}}),t}(e))}),m)return{props:{},explicitNoCapture:m};if(l||("a"===e.tagName.toLowerCase()||"button"===e.tagName.toLowerCase()?p[0].$el_text=im(e):p[0].$el_text=is(e)),v){p[0].attr__href=v;let e=null==(n=e7(v))?void 0:n.host,t=null==u||null==(r=u.location)?void 0:r.host;e&&t&&e!==t&&(f=v)}return{props:V({$event_type:o.type,$ce_version:1},d?{$elements_chain:p.map(e=>{var t,i;let s={text:null==(t=e.$el_text)?void 0:t.slice(0,400),tag_name:e.tag_name,href:null==(i=e.attr__href)?void 0:i.slice(0,2048),attr_class:function(e){let t=e.attr__class;return t?P(t)?t:t9(t):void 0}(e),attr_id:e.attr__id,nth_child:e.nth_child,nth_of_type:e.nth_of_type,attributes:{}};return j(e).filter(e=>{let[t]=e;return 0===t.indexOf("attr__")}
1).forEach(e=>{let[t,i]=e;return s.attributes[t]=i}),s}).map(e=>{var t,i;let s="";if(e.tag_name&&(s+=e.tag_name),e.attr_class)for(let t of(e.attr_class.sort(),e.attr_class))s+=`.${t.replace(/"/g,"")}`;let n={...e.text?{text:e.text}:{},"nth-child":null!=(t=e.nth_child)?t:0,"nth-of-type":null!=(i=e.nth_of_type)?i:0,...e.href?{href:e.href}:{},...e.attr_id?{attr_id:e.attr_id}:{},...e.attributes},r={};return j(n).sort((e,t)=>{let[i]=e,[s]=t;return i.localeCompare(s)}).forEach(e=>{let[t,i]=e;return r[iy(t.toString())]=iy(i.toString())}),s+=":",s+=j(n).map(e=>{let[t,i]=e;return`${t}="${i}"`}).join("")}).join(";")}:{$elements:p},null!=(i=p[0])&&i.$el_text?{$el_text:null==(s=p[0])?void 0:s.$el_text}:{},f&&"click"===o.type?{$external_click_url:f}:{},g)}}(n,{e:e,maskAllElementAttributes:this.instance.config.mask_all_element_attributes,maskAllText:this.instance.config.mask_all_text,elementAttributeIgnoreList:this.config.element_attribute_ignorelist,elementsChainAsString:this._elementsChainAsString});if(r)return!1;let o=this.getElementSelectors(n);if(o&&o.length>0&&(t.$element_selectors=o),s===nl){let s=ii(null==u||null==(i=u.getSelection())?void 0:i.toString()),n=e.type||"clipboard";if(!s)return!1;t.$selected_content=s,t.$copy_type=n}return this.instance.capture(s,t),!0}}isBrowserSupported(){return F(null==g?void 0:g.querySelectorAll)}}class nd{_restoreXHRPatch=void 0;_restoreFetchPatch=void 0;constructor(e){this.instance=e}_loadScript(e){var t,i,s;null!=(t=w.__PosthogExtensions__)&&t.tracingHeadersPatchFns&&e(),null==(i=w.__PosthogExtensions__)||null==(s=i.loadExternalDependency)||s.call(i,this.instance,"tracing-headers",t=>{if(t)return q.error("[TRACING-HEADERS] failed to load script",t);e()})}startIfEnabledOrStop(){var e,t;this.instance.config.__add_tracing_headers?this._loadScript(this._startCapturing):(null==(e=this._restoreXHRPatch)||e.call(this),null==(t=this._restoreFetchPatch)||t.call(this),this._restoreXHRPatch=void 0,this._restoreFetchPatch=void 0)}_startCapturing=()=>{var e,t,i,s;T(this._restoreXHRPatch)&&(null==(e=w.__PosthogExtensions__)||null==(t=e.tracingHeadersPatchFns)||t._patchXHR(this.instance.sessionManager)),T(this._restoreFetchPatch)&&(null==(i=w.__PosthogExtensions__)||null==(s=i.tracingHeadersPatchFns)||s._patchFetch(this.instance.sessionManager))}}!function(e){e[e.PENDING=-1]="PENDING",e[e.DENIED=0]="DENIED",e[e.GRANTED=1]="GRANTED"}(l||(l={}));class nh{constructor(e){this.instance=e}get config(){return this.instance.config}get consent(){return this.getDnt()?l.DENIED:this.storedConsent}isOptedOut(){return this.consent===l.DENIED||this.consent===l.PENDING&&this.config.opt_out_capturing_by_default}isOptedIn(){return!this.isOptedOut()}optInOut(e){this.storage.set(this.storageKey,+!!e,this.config.cookie_expiration,this.config.cross_subdomain_cookie,this.config.secure_cookie)}reset(){this.storage.remove(this.storageKey,this.config.cross_subdomain_cookie)}get storageKey(){let{token:e,opt_out_capturing_cookie_prefix:t}=this.instance.config;return(t||"__ph_opt_in_out_")+e}get storedConsent(){let e=this.storage.get(this.storageKey);return"1"===e?l.GRANTED:"0"===e?l.DENIED:l.PENDING}get storage(){if(!this._storage){let e=this.config.opt_out_capturing_persistence_type;this._storage="localStorage"===e?e0:eK;let t="localStorage"===e?eK:e0;t.get(this.storageKey)&&(this._storage.get(this.storageKey)||this.optInOut("1"===t.get(this.storageKey)),t.remove(this.storageKey,this.config.cross_subdomain_cookie))}return this._storage}getDnt(){return!!this.config.respect_dnt&&!!ee([null==p?void 0:p.doNotTrack,null==p?void 0:p.msDoNotTrack,w.doNotTrack],e=>G([!0,1,"1","yes"],e))}}let n_="[Exception Autocapture]";class np{originalOnUnhandledRejectionHandler=void 0;constructor(e){var t;this.instance=e,this.remoteEnabled=!(null==(t=this.instance.persistence)||!t.props[eo]),this.startIfEnabled()}get isEnabled(){var e;return null!=(e=this.remoteEnabled)&&e}get isCapturing(){var e;return!(null==u||null==(e=u.onerror)||!e.__POSTHOG_INSTRUMENTED__)}get hasHandlers(){return this.originalOnUnhandledRejectionHandler||this.unwrapOnError}startIfEnabled(){this.isEnabled&&!this.isCapturing&&(q.info(n_+" enabled, starting..."),this.loadScript(this.startCapturing))}loadScript(e){var t,i;this.hasHandlers&&e(),null==(t=w.__PosthogExtensions__)||null==(i=t.loadExternalDependency)||i.call(t,this.instance,"exception-autocapture",t=>{if(t)return q.error(n_+" failed to load script",t);e()})}startCapturing=()=>{var e,t,i,s;if(!u||!this.isEnabled||this.hasHandlers||this.isCapturing)return;let n=null==(e=w.__PosthogExtensions__)||null==(t=e.errorWrappingFunctions)?void 0:t.wrapOnError,r=null==(i=w.__PosthogExtensions__)||null==(s=i.errorWrappingFunctions)?void 0:s.wrapUnhandledRejection;if(n&&r)try{this.unwrapOnError=n(this.captureException.bind(this)),this.unwrapUnhandledRejection=r(this.captureException.bind(this))}catch(e){q.error(n_+" failed to start",e),this.stopCapturing()}else q.error(n_+" failed to load error wrapping functions - cannot start")};stopCapturing(){var e,t;null==(e=this.unwrapOnError)||e.call(this),null==(t=this.unwrapUnhandledRejection)||t.call(this)}afterDecideResponse(e){let t=e.autocaptureExceptions;this.remoteEnabled=!!t,this.instance.persistence&&this.instance.persistence.register({[eo]:this.remoteEnabled}),this.startIfEnabled()}captureException(e){let t=this.instance.requestRouter.endpointFor("ui");e.$exception_personURL=`${t}/project/${this.instance.config.token}/person/${this.instance.get_distinct_id()}`,this.instance.exceptions.sendExceptionEvent(e)}}let ng="[Web Vitals]";class nf{_enabledServerSide=!1;_initialized=!1;buffer={url:void 0,metrics:[],firstMetricTimestamp:void 0};constructor(e){var t;this.instance=e,this._enabledServerSide=!(null==(t=this.instance.persistence)||!t.props[el]),this.startIfEnabled()}get allowedMetrics(){var e,t;let i=R(this.instance.config.capture_performance)?null==(e=this.instance.config.capture_performance)?void 0:e.web_vitals_allowed_metrics:void 0;return T(i)?(null==(t=this.instance.persistence)?void 0:t.props[ec])||["CLS","FCP","INP","LCP"]:i}get flushToCaptureTimeoutMs(){return(R(this.instance.config.capture_performance)?this.instance.config.capture_performance.web_vitals_delayed_flush_ms:void 0)||5e3}get _maxAllowedValue(){let e=R(this.instance.config.capture_performance)&&D(this.instance.config.capture_performance.__web_vitals_max_value)?this.instance.config.capture_performance.__web_vitals_max_value:9e5;return 0<e&&e<=6e4?9e5:e}get isEnabled(){let e=R(this.instance.config.capture_performance)?this.instance.config.capture_performance.web_vitals:void 0;return O(e)?e:this._enabledServerSide}startIfEnabled(){this.isEnabled&&!this._initialized&&(q.info(ng+" enabled, starting..."),this.loadScript(this._startCapturing))}afterDecideResponse(e){let t=R(e.capturePerformance)&&!!e.capturePerformance.web_vitals,i=R(e.capturePerformance)?e.capturePerformance.web_vitals_allowed_metrics:void 0;this.instance.persistence&&(this.instance.persistence.register({[el]:t}),this.instance.persistence.register({[ec]:i})),this._enabledServerSide=t,this.startIfEnabled()}loadScript(e){var t,i,s;null!=(t=w.__PosthogExtensions__)&&t.postHogWebVitalsCallbacks&&e(),null==(i=w.__PosthogExtensions__)||null==(s=i.loadExternalDependency)||s.call(i,this.instance,"web-vitals",t=>{t?q.error(ng+" failed to load script",t):e()})}_currentURL(){let e=u?u.location.href:void 0;return e||q.error(ng+"Could not determine current URL"),e}_flushToCapture=()=>{clearTimeout(this._delayedFlushTimer),0!==this.buffer.metrics.length&&(this.instance.capture("$web_vitals",this.buffer.metrics.reduce((e,t)=>
1({...e,[`$web_vitals_${t.name}_event`]:{...t},[`$web_vitals_${t.name}_value`]:t.value}),{})),this.buffer={url:void 0,metrics:[],firstMetricTimestamp:void 0})};_addToBuffer=e=>{var t;let i=null==(t=this.instance.sessionManager)?void 0:t.checkAndGetSessionAndWindowId(!0);if(T(i))return void q.error(ng+"Could not read session ID. Dropping metrics!");this.buffer=this.buffer||{url:void 0,metrics:[],firstMetricTimestamp:void 0};let s=this._currentURL();if(!T(s)){if(L(null==e?void 0:e.name)||L(null==e?void 0:e.value))return void q.error(ng+"Invalid metric received",e);if(this._maxAllowedValue&&e.value>=this._maxAllowedValue)return void q.error(ng+"Ignoring metric with value >= "+this._maxAllowedValue,e);this.buffer.url!==s&&(this._flushToCapture(),this._delayedFlushTimer=setTimeout(this._flushToCapture,this.flushToCaptureTimeoutMs)),T(this.buffer.url)&&(this.buffer.url=s),this.buffer.firstMetricTimestamp=T(this.buffer.firstMetricTimestamp)?Date.now():this.buffer.firstMetricTimestamp,e.attribution&&e.attribution.interactionTargetElement&&(e.attribution.interactionTargetElement=void 0),this.buffer.metrics.push({...e,$current_url:s,$session_id:i.sessionId,$window_id:i.windowId,timestamp:Date.now()}),this.buffer.metrics.length===this.allowedMetrics.length&&this._flushToCapture()}};_startCapturing=()=>{let e,t,i,s,n=w.__PosthogExtensions__;T(n)||T(n.postHogWebVitalsCallbacks)||({onLCP:e,onCLS:t,onFCP:i,onINP:s}=n.postHogWebVitalsCallbacks),e&&t&&i&&s?(this.allowedMetrics.indexOf("LCP")>-1&&e(this._addToBuffer.bind(this)),this.allowedMetrics.indexOf("CLS")>-1&&t(this._addToBuffer.bind(this)),this.allowedMetrics.indexOf("FCP")>-1&&i(this._addToBuffer.bind(this)),this.allowedMetrics.indexOf("INP")>-1&&s(this._addToBuffer.bind(this)),this._initialized=!0):q.error(ng+"web vitals callbacks not loaded - not starting")}}let nv={icontains:(e,t)=>!!u&&t.href.toLowerCase().indexOf(e.toLowerCase())>-1,not_icontains:(e,t)=>!!u&&-1===t.href.toLowerCase().indexOf(e.toLowerCase()),regex:(e,t)=>!!u&&e9(t.href,e),not_regex:(e,t)=>!!u&&!e9(t.href,e),exact:(e,t)=>t.href===e,is_not:(e,t)=>t.href!==e};class nm{constructor(e){this.instance=e;let t=e=>{this.applyFeatureFlagChanges(e)};this.instance.onFeatureFlags&&this.instance.onFeatureFlags(t),this._flagToExperiments=new Map}applyFeatureFlagChanges(e){L(this._flagToExperiments)||this.instance.config.disable_web_experiments||(nm.logInfo("applying feature flags",e),e.forEach(e=>{var t,i;if(this._flagToExperiments&&null!=(t=this._flagToExperiments)&&t.has(e)){let t=this.instance.getFeatureFlag(e),s=null==(i=this._flagToExperiments)?void 0:i.get(e);t&&null!=s&&s.variants[t]&&this.applyTransforms(s.name,t,s.variants[t].transforms)}}))}afterDecideResponse(e){this._is_bot()?nm.logInfo("Refusing to render web experiment since the viewer is a likely bot"):(this._featureFlags=e.featureFlags,this.loadIfEnabled(),this.previewWebExperiment())}previewWebExperiment(){let e=nm.getWindowLocation();if(null!=e&&e.search){let t=tt(null==e?void 0:e.search,"__experiment_id"),i=tt(null==e?void 0:e.search,"__experiment_variant");t&&i&&(nm.logInfo(`previewing web experiments ${t} && ${i}`),this.getWebExperiments(e=>{this.showPreviewWebExperiment(parseInt(t),i,e)},!1,!0))}}loadIfEnabled(){this.instance.config.disable_web_experiments||this.getWebExperimentsAndEvaluateDisplayLogic()}getWebExperimentsAndEvaluateDisplayLogic=(()=>{var e=this;return function(){let t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];e.getWebExperiments(t=>{nm.logInfo("retrieved web experiments from the server"),e._flagToExperiments=new Map,t.forEach(t=>{if(t.feature_flag_key&&e._featureFlags&&e._featureFlags[t.feature_flag_key]){var i;e._flagToExperiments&&(nm.logInfo("setting flag key ",t.feature_flag_key," to web experiment ",t),null==(i=e._flagToExperiments)||i.set(t.feature_flag_key,t));let s=e._featureFlags[t.feature_flag_key];s&&t.variants[s]&&e.applyTransforms(t.name,s,t.variants[s].transforms)}else if(t.variants)for(let i in t.variants){let s=t.variants[i];nm.matchesTestVariant(s)&&e.applyTransforms(t.name,i,s.transforms)}})},t)}})();getWebExperiments(e,t,i){if(this.instance.config.disable_web_experiments&&!i)return e([]);let s=this.instance.get_property("$web_experiments");if(s&&!t)return e(s);this.instance._send_request({url:this.instance.requestRouter.endpointFor("api",`/api/web_experiments/?token=${this.instance.config.token}`),method:"GET",transport:"XHR",callback:t=>200===t.statusCode&&t.json?e(t.json.experiments||[]):e([])})}showPreviewWebExperiment(e,t,i){let s=i.filter(t=>t.id===e);s&&s.length>0&&(nm.logInfo(`Previewing web experiment [${s[0].name}] with variant [${t}]`),this.applyTransforms(s[0].name,t,s[0].variants[t].transforms,!0))}static matchesTestVariant(e){return!L(e.conditions)&&nm.matchUrlConditions(e)&&nm.matchUTMConditions(e)}static matchUrlConditions(e){var t,i,s,n;if(L(e.conditions)||L(null==(t=e.conditions)?void 0:t.url))return!0;let r=nm.getWindowLocation();return!!r&&(null==(i=e.conditions)||!i.url||nv[null!=(s=null==(n=e.conditions)?void 0:n.urlMatchType)?s:"icontains"](e.conditions.url,r))}
1static getWindowLocation(){return null==u?void 0:u.location}static matchUTMConditions(e){var t,i,s,n,r,o,a,l,u,c,d,h,_,p,g,f,v;if(L(e.conditions)||L(null==(t=e.conditions)?void 0:t.utm))return!0;let m=tK.campaignParams();if(m.utm_source){let t=null==(i=e.conditions)||null==(s=i.utm)||!s.utm_campaign||(null==(n=e.conditions)||null==(r=n.utm)?void 0:r.utm_campaign)==m.utm_campaign,y=null==(o=e.conditions)||null==(a=o.utm)||!a.utm_source||(null==(l=e.conditions)||null==(u=l.utm)?void 0:u.utm_source)==m.utm_source,b=null==(c=e.conditions)||null==(d=c.utm)||!d.utm_medium||(null==(h=e.conditions)||null==(_=h.utm)?void 0:_.utm_medium)==m.utm_medium,w=null==(p=e.conditions)||null==(g=p.utm)||!g.utm_term||(null==(f=e.conditions)||null==(v=f.utm)?void 0:v.utm_term)==m.utm_term;return t&&b&&w&&y}return!1}static logInfo(e){for(var t=arguments.length,i=Array(t>1?t-1:0),s=1;s<t;s++)i[s-1]=arguments[s];q.info(`[WebExperiments] ${e}`,i)}applyTransforms(e,t,i,s){var n;this._is_bot()?nm.logInfo("Refusing to render web experiment since the viewer is a likely bot"):"control"!==t?i.forEach(i=>{if(i.selector){var n,r;nm.logInfo(`applying transform of variant ${t} for experiment ${e} `,i);let o=0,a=null==(n=document)?void 0:n.querySelectorAll(i.selector);null==a||a.forEach(e=>{o+=1,i.attributes&&i.attributes.forEach(t=>{switch(t.name){case"text":e.innerText=t.value;break;case"html":e.innerHTML=t.value;break;case"cssClass":e.className=t.value;break;default:e.setAttribute(t.name,t.value)}}),i.text&&(e.innerText=i.text),i.html&&(e.parentElement?e.parentElement.innerHTML=i.html:e.innerHTML=i.html),i.css&&e.setAttribute("style",i.css)}),this.instance&&this.instance.capture&&this.instance.capture("$web_experiment_applied",{$web_experiment_name:e,$web_experiment_variant:t,$web_experiment_preview:s,$web_experiment_document_url:null==(r=nm.getWindowLocation())?void 0:r.href,$web_experiment_elements_modified:o})}}):(nm.logInfo("Control variants leave the page unmodified."),this.instance&&this.instance.capture&&this.instance.capture("$web_experiment_applied",{$web_experiment_name:e,$web_experiment_preview:s,$web_experiment_variant:t,$web_experiment_document_url:null==(n=nm.getWindowLocation())?void 0:n.href,$web_experiment_elements_modified:0}))}_is_bot(){return p&&this.instance?nn(p,this.instance.config.custom_blocked_useragents):void 0}}class ny{constructor(e){var t;this.instance=e,this._endpointSuffix=(null==(t=this.instance.persistence)?void 0:t.props[ea])||"/e/"}get endpoint(){return this.instance.requestRouter.endpointFor("api",this._endpointSuffix)}afterDecideResponse(e){let t=e.autocaptureExceptions;this._endpointSuffix=R(t)&&t.endpoint||"/e/",this.instance.persistence&&this.instance.persistence.register({[ea]:this._endpointSuffix})}sendExceptionEvent(e){this.instance.capture("$exception",e,{_noTruncate:!0,_batchKey:"exceptionEvent",_url:this.endpoint})}}let nb="[Dead Clicks]";class nw{get lazyLoadedDeadClicksAutocapture(){return this._lazyLoadedDeadClicksAutocapture}constructor(e){this.instance=e,this.startIfEnabled()}get isRemoteEnabled(){var e;return!(null==(e=this.instance.persistence)||!e.get_property(eu))}get isEnabled(){let e=this.instance.config.capture_dead_clicks;return O(e)?e:this.isRemoteEnabled}afterDecideResponse(e){this.instance.persistence&&this.instance.persistence.register({[eu]:null==e?void 0:e.captureDeadClicks}),this.startIfEnabled()}startIfEnabled(){this.isEnabled&&this.loadScript(this.start.bind(this))}loadScript(e){var t,i,s;null!=(t=w.__PosthogExtensions__)&&t.initDeadClicksAutocapture&&e(),null==(i=w.__PosthogExtensions__)||null==(s=i.loadExternalDependency)||s.call(i,this.instance,"dead-clicks-autocapture",t=>{t?q.error(nb+" failed to load script",t):e()})}start(){var e;g?!this._lazyLoadedDeadClicksAutocapture&&null!=(e=w.__PosthogExtensions__)&&e.initDeadClicksAutocapture&&(this._lazyLoadedDeadClicksAutocapture=w.__PosthogExtensions__.initDeadClicksAutocapture(this.instance,R(this.instance.config.capture_dead_clicks)?this.instance.config.capture_dead_clicks:void 0),this._lazyLoadedDeadClicksAutocapture.start(g),q.info(`${nb} starting...`)):q.error(nb+" `document` not found. Cannot start.")}stop(){this._lazyLoadedDeadClicksAutocapture&&(this._lazyLoadedDeadClicksAutocapture.stop(),this._lazyLoadedDeadClicksAutocapture=void 0,q.info(`${nb} stopping...`))}}let nS={},nE=()=>{},nk="posthog",nx=!sp&&-1===(null==b?void 0:b.indexOf("MSIE"))&&-1===(null==b?void 0:b.indexOf("Mozilla")),nI=()=>{var e;return{api_host:"https://us.i.posthog.com",ui_host:null,token:"",autocapture:!0,rageclick:!0,cross_subdomain_cookie:function(e){let t=null==e?void 0:e.hostname;return!!$(t)&&"herokuapp.com"!==t.split(".").slice(-2).join(".")}(null==g?void 0:g.location),persistence:"localStorage+cookie",persistence_name:"",loaded:nE,store_google:!0,custom_campaign_params:[],custom_blocked_useragents:[],save_referrer:!0,capture_pageview:!0,capture_pageleave:"if_capture_pageview",debug:f&&$(null==f?void 0:f.search)&&-1!==f.search.indexOf("__posthog_debug=true")||!1,verbose
1:!1,cookie_expiration:365,upgrade:!1,disable_session_recording:!1,disable_persistence:!1,disable_web_experiments:!0,disable_surveys:!1,enable_recording_console_log:void 0,secure_cookie:"https:"===(null==u||null==(e=u.location)?void 0:e.protocol),ip:!0,opt_out_capturing_by_default:!1,opt_out_persistence_by_default:!1,opt_out_useragent_filter:!1,opt_out_capturing_persistence_type:"localStorage",opt_out_capturing_cookie_prefix:null,opt_in_site_apps:!1,property_denylist:[],respect_dnt:!1,sanitize_properties:null,request_headers:{},inapp_protocol:"//",inapp_link_new_window:!1,request_batching:!0,properties_string_max_length:65535,session_recording:{},mask_all_element_attributes:!1,mask_all_text:!1,advanced_disable_decide:!1,advanced_disable_feature_flags:!1,advanced_disable_feature_flags_on_first_load:!1,advanced_disable_toolbar_metrics:!1,feature_flag_request_timeout_ms:3e3,on_request_error:e=>{let t="Bad HTTP status: "+e.statusCode+" "+e.text;q.error(t)},get_device_id:e=>e,_onCapture:nE,capture_performance:void 0,name:"posthog",bootstrap:{},disable_compression:!1,session_idle_timeout_seconds:1800,person_profiles:"identified_only",__add_tracing_headers:!1}},nP=e=>{let t={};T(e.process_person)||(t.person_profiles=e.process_person),T(e.xhr_headers)||(t.request_headers=e.xhr_headers),T(e.cookie_name)||(t.persistence_name=e.cookie_name),T(e.disable_cookie)||(t.disable_persistence=e.disable_cookie);let i=V({},t,e);return P(e.property_blacklist)&&(T(e.property_denylist)?i.property_denylist=e.property_blacklist:P(e.property_denylist)?i.property_denylist=[...e.property_blacklist,...e.property_denylist]:q.error("Invalid value for property_denylist config: "+e.property_denylist)),i};class nF{get _forceAllowLocalhost(){return this.__forceAllowLocalhost}set _forceAllowLocalhost(e){q.error("WebPerformanceObserver is deprecated and has no impact on network capture. Use `_forceAllowLocalhostNetworkCapture` on `posthog.sessionRecording`"),this.__forceAllowLocalhost=e}__forceAllowLocalhost=!1}class nR{webPerformance=new nF;version=S.LIB_VERSION;_internalEventEmitter=new sP;constructor(){this.config=nI(),this.decideEndpointWasHit=!1,this.SentryIntegration=sx,this.sentryIntegration=e=>(function(e,t){let i=sk(e,t);return{name:sE,processEvent:e=>i(e)}})(this,e),this.__request_queue=[],this.__loaded=!1,this.analyticsDefaultEndpoint="/e/",this._initialPageviewCaptured=!1,this._initialPersonProfilesConfig=null,this.featureFlags=new eH(this),this.toolbar=new sh(this),this.scrollManager=new na(this),this.pageViewManager=new sI(this),this.surveys=new s7(this),this.experiments=new nm(this),this.exceptions=new ny(this),this.rateLimiter=new s9(this),this.requestRouter=new sS(this),this.consent=new nh(this),this.people={set:(e,t,i)=>{let s=$(e)?{[e]:t}:e;this.setPersonProperties(s),null==i||i({})},set_once:(e,t,i)=>{let s=$(e)?{[e]:t}:e;this.setPersonProperties(void 0,s),null==i||i({})}},this.on("eventCaptured",e=>q.info(`send "${null==e?void 0:e.event}"`,e))}init(e,t,i){if(i&&i!==nk){var s;let n=null!=(s=nS[i])?s:new nR;return n._init(e,t,i),nS[i]=n,nS[nk][i]=n,n}return this._init(e,t,i)}_init(e){var t,i,n,r,o,a;let l=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},c=arguments.length>2?arguments[2]:void 0;if(T(e)||A(e))return q.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 q.warn("You have already initialized PostHog! Re-initializing is a no-op"),this;this.__loaded=!0,this.config={},this._triggered_notifs=[],l.person_profiles&&(this._initialPersonProfilesConfig=l.person_profiles),this.set_config(V({},nI(),nP(l),{name:c,token:e})),this.config.on_xhr_error&&q.error("[posthog] on_xhr_error is deprecated. Use on_request_error instead"),this.compression=l.disable_compression?void 0:s.GZipJS,this.persistence=new t0(this.config),this.sessionPersistence="sessionStorage"===this.config.persistence?this.persistence:new t0({...this.config,persistence:"sessionStorage"});let d={...this.persistence.props},h={...this.sessionPersistence.props};if(this._requestQueue=new s_(e=>this._send_retriable_request(e)),this._retryQueue=new sy(this),this.__request_queue=[],this.sessionManager=new sb(this.config,this.persistence),this.sessionPropsManager=new nt(this.sessionManager,this.persistence),new nd(this).startIfEnabledOrStop(),this.sessionRecording=new sl(this),this.sessionRecording.startIfEnabledOrStop(),this.config.disable_scroll_properties||this.scrollManager.startMeasuringScrollPosition(),this.autocapture=new nc(this),this.autocapture.startIfEnabled(),this.surveys.loadIfEnabled(),this.heatmaps=new no(this),this.heatmaps.startIfEnabled(),this.webVitalsAutocapture=new nf(this),this.exceptionObserver=new np(this),this.exceptionObserver.startIfEnabled(),this.deadClicksAutocapture=new nw(this),this.deadClicksAutocapture.startIfEnabled(),S.DEBUG=S.DEBUG||this.config.debug,S.DEBUG&&q.info("Starting in debug mode",{this:this,config:l,thisC:{...this.config},p:d,s:h}),this._sync_opt_out_with_persistence(),void 0!==(null==(t=l.bootstrap)?void 0:t.distinctID)
1){let e=this.config.get_device_id(eQ()),t=null!=(n=l.bootstrap)&&n.isIdentifiedID?e:l.bootstrap.distinctID;this.persistence.set_property(eF,null!=(r=l.bootstrap)&&r.isIdentifiedID?"identified":"anonymous"),this.register({distinct_id:l.bootstrap.distinctID,$device_id:t})}if(this._hasBootstrappedFeatureFlags()){let e=Object.keys((null==(o=l.bootstrap)?void 0:o.featureFlags)||{}).filter(e=>{var t,i;return!(null==(t=l.bootstrap)||null==(i=t.featureFlags)||!i[e])}).reduce((e,t)=>{var i,s;return e[t]=(null==(i=l.bootstrap)||null==(s=i.featureFlags)?void 0:s[t])||!1,e},{}),t=Object.keys((null==(a=l.bootstrap)?void 0:a.featureFlagPayloads)||{}).filter(t=>e[t]).reduce((e,t)=>{var i,s,n,r;return null!=(i=l.bootstrap)&&null!=(s=i.featureFlagPayloads)&&s[t]&&(e[t]=null==(n=l.bootstrap)||null==(r=n.featureFlagPayloads)?void 0:r[t]),e},{});this.featureFlags.receivedFeatureFlags({featureFlags:e,featureFlagPayloads:t})}if(!this.get_distinct_id()){let e=this.config.get_device_id(eQ());this.register_once({distinct_id:e,$device_id:e},""),this.persistence.set_property(eF,"anonymous")}return null==u||null==(i=u.addEventListener)||i.call(u,"onpagehide"in self?"pagehide":"unload",this._handle_unload.bind(this)),this.toolbar.maybeLoadToolbar(),l.segment?function(e,t){let i=e.config.segment;if(!i)return t();!function(e,t){let i=e.config.segment;if(!i)return t();let s=i=>{let s=()=>i.anonymousId()||eQ();e.config.get_device_id=s,i.id()&&(e.register({distinct_id:i.id(),$device_id:s()}),e.persistence.set_property(eF,"identified")),t()},n=i.user();"then"in n&&F(n.then)?n.then(e=>s(e)):s(n)}(e,()=>{i.register((e=>{Promise&&Promise.resolve||q.warn("This browser does not have Promise support, and can not use the segment integration");let t=(t,i)=>{var s;if(!i)return t;t.event.userId||t.event.anonymousId===e.get_distinct_id()||(q.info("Segment integration does not have a userId set, resetting PostHog"),e.reset()),t.event.userId&&t.event.userId!==e.get_distinct_id()&&(q.info("Segment integration has a userId set, identifying with PostHog"),e.identify(t.event.userId));let n=e._calculate_event_properties(i,null!=(s=t.event.properties)?s:{},new Date);return t.event.properties=Object.assign({},n,t.event.properties),t};return{name:"PostHog JS",type:"enrichment",version:"1.0.0",isLoaded:()=>!0,load:()=>Promise.resolve(),track:e=>t(e,e.event.event),page:e=>t(e,"$pageview"),identify:e=>t(e,"$identify"),screen:e=>t(e,"$screen")}})(e)).then(()=>{t()})})}(this,()=>this._loaded()):this._loaded(),F(this.config._onCapture)&&this.on("eventCaptured",e=>this.config._onCapture(e.event,e)),this}_afterDecideResponse(e){var t,i,n,r,o,a,l,u,c,d;this.compression=void 0,e.supportedCompression&&!this.config.disable_compression&&(this.compression=G(e.supportedCompression,s.GZipJS)?s.GZipJS:G(e.supportedCompression,s.Base64)?s.Base64:void 0),null!=(t=e.analytics)&&t.endpoint&&(this.analyticsDefaultEndpoint=e.analytics.endpoint),this.set_config({person_profiles:this._initialPersonProfilesConfig?this._initialPersonProfilesConfig:e.defaultIdentifiedOnly?"identified_only":"always"}),null==(i=this.sessionRecording)||i.afterDecideResponse(e),null==(n=this.autocapture)||n.afterDecideResponse(e),null==(r=this.heatmaps)||r.afterDecideResponse(e),null==(o=this.experiments)||o.afterDecideResponse(e),null==(a=this.surveys)||a.afterDecideResponse(e),null==(l=this.webVitalsAutocapture)||l.afterDecideResponse(e),null==(u=this.exceptions)||u.afterDecideResponse(e),null==(c=this.exceptionObserver)||c.afterDecideResponse(e),null==(d=this.deadClicksAutocapture)||d.afterDecideResponse(e)}_loaded(){let e=this.config.advanced_disable_decide;e||this.featureFlags.setReloadingPaused(!0);try{this.config.loaded(this)}catch(e){q.critical("`loaded` function failed",e)}this._start_queue_if_opted_in(),this.config.capture_pageview&&setTimeout(()=>{this.consent.isOptedIn()&&this._captureInitialPageview()},1),e||(new su(this).call(),this.featureFlags.resetRequestQueue())}_start_queue_if_opted_in(){var e;this.has_opted_out_capturing()||this.config.request_batching&&(null==(e=this._requestQueue)||e.enable())}_dom_loaded(){this.has_opted_out_capturing()||W(this.__request_queue,e=>this._send_retriable_request(e)),this.__request_queue=[],this._start_queue_if_opted_in()}_handle_unload(){var e,t;this.config.request_batching?(this._shouldCapturePageleave()&&this.capture("$pageleave"),null==(e=this._requestQueue)||e.unload(),null==(t=this._retryQueue)||t.unload()):this._shouldCapturePageleave()&&this.capture("$pageleave",null,{transport:"sendBeacon"})}_send_request(e){this.__loaded&&(nx?this.__request_queue.push(e):this.rateLimiter.isServerRateLimited(e.batchKey)||(e.transport=e.transport||this.config.api_transport,e.url=sf(e.url,{ip:+!!this.config.ip}),e.headers={...this.config.request_headers},e.compression="best-available"===e.compression?this.compression:e.compression,(e=>{var t,i,s;let n={...e};n.timeout=n.timeout||6e4,n.url=sf(n.url,{_:(new Date).getTime().toString(),ver:S.LIB_VERSION,compression:n.compression});
1let r=null!=(t=n.transport)?t:"XHR",o=null!=(i=null==(s=ee(sm,e=>e.transport===r))?void 0:s.method)?i:sm[0].method;if(!o)throw Error("No available transport method");o(n)})({...e,callback:t=>{var i,s,n;this.rateLimiter.checkForLimiting(t),t.statusCode>=400&&(null==(s=(n=this.config).on_request_error)||s.call(n,t)),null==(i=e.callback)||i.call(e,t)}})))}_send_retriable_request(e){this._retryQueue?this._retryQueue.retriableRequest(e):this._send_request(e)}_execute_array(e){let t,i=[],s=[],n=[];W(e,e=>{e&&(P(t=e[0])?n.push(e):F(e)?e.call(this):P(e)&&"alias"===t?i.push(e):P(e)&&-1!==t.indexOf("capture")&&F(this[t])?n.push(e):s.push(e))});let r=function(e,t){W(e,function(e){if(P(e[0])){let i=t;z(e,function(e){i=i[e[0]].apply(i,e.slice(1))})}else this[e[0]].apply(this,e.slice(1))},t)};r(i,this),r(s,this),r(n,this)}_hasBootstrappedFeatureFlags(){var e,t;return(null==(e=this.config.bootstrap)?void 0:e.featureFlags)&&Object.keys(null==(t=this.config.bootstrap)?void 0:t.featureFlags).length>0||!1}push(e){this._execute_array([e])}capture(e,t,i){var s;if(!(this.__loaded&&this.persistence&&this.sessionPersistence&&this._requestQueue))return void q.uninitializedWarning("posthog.capture");if(this.consent.isOptedOut())return;if(T(e)||!$(e))return void q.error("No event name provided to posthog.capture");if(!this.config.opt_out_useragent_filter&&this._is_bot())return;let n=null!=i&&i.skip_client_rate_limiting?void 0:this.rateLimiter.clientRateLimitContext();if(null!=n&&n.isRateLimited)return void q.critical("This capture call is ignored due to client rate limiting.");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();let r=new Date,o=(null==i?void 0:i.timestamp)||r,a={uuid:eQ(),event:e,properties:this._calculate_event_properties(e,t||{},o)};n&&(a.properties.$lib_rate_limit_remaining_tokens=n.remainingTokens),(null==i?void 0:i.$set)&&(a.$set=null==i?void 0:i.$set);let l=this._calculate_set_once_properties(null==i?void 0:i.$set_once);l&&(a.$set_once=l),(a=function(e,t){var i=e=>$(e)&&!M(t)?e.slice(0,t):e;let s=new Set;return function e(t,n){let r;return t!==Object(t)?i?i(t,n):t:s.has(t)?void 0:(s.add(t),P(t)?(r=[],W(t,t=>{r.push(e(t))})):(r={},z(t,(t,i)=>{s.has(t)||(r[i]=e(t,i))})),r)}(e)}(a,null!=i&&i._noTruncate?null:this.config.properties_string_max_length)).timestamp=o,T(null==i?void 0:i.timestamp)||(a.properties.$event_time_override_provided=!0,a.properties.$event_time_override_system_time=r);let u={...a.properties.$set,...a.$set};C(u)||this.setPersonPropertiesForFlags(u),this._internalEventEmitter.emit("eventCaptured",a);let c={method:"POST",url:null!=(s=null==i?void 0:i._url)?s:this.requestRouter.endpointFor("api",this.analyticsDefaultEndpoint),data:a,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(c):this._requestQueue.enqueue(c),a}_addCaptureHook(e){return this.on("eventCaptured",t=>e(t.event,t))}_calculate_event_properties(e,t,i){if(i=i||new Date,!this.persistence||!this.sessionPersistence)return t;let s=this.persistence.remove_event_timer(e),r={...t};if(r.token=this.config.token,"$snapshot"===e){let e={...this.persistence.properties(),...this.sessionPersistence.properties()};return r.distinct_id=e.distinct_id,(!$(r.distinct_id)&&!D(r.distinct_id)||A(r.distinct_id))&&q.error("Invalid distinct_id for replay event. This indicates a bug in your implementation"),r}let o=tK.properties();if(this.sessionManager){let{sessionId:e,windowId:t}=this.sessionManager.checkAndGetSessionAndWindowId();r.$session_id=e,r.$window_id=t}if(this.requestRouter.region===n.CUSTOM&&(r.$lib_custom_api_host=this.config.api_host),this.sessionPropsManager&&this.config.__preview_send_client_session_params&&("$pageview"===e||"$pageleave"===e||"$autocapture"===e)){let e=this.sessionPropsManager.getSessionProps();r=V(r,e)}if(!this.config.disable_scroll_properties){let t={};
1"$pageview"===e?t=this.pageViewManager.doPageView(i):"$pageleave"===e&&(t=this.pageViewManager.doPageLeave(i)),r=V(r,t)}if("$pageview"===e&&g&&(r.title=g.title),!T(s)){let e=i.getTime()-s;r.$duration=parseFloat((e/1e3).toFixed(3))}b&&this.config.opt_out_useragent_filter&&(r.$browser_type=this._is_bot()?"bot":"browser"),(r=V({},o,this.persistence.properties(),this.sessionPersistence.properties(),r)).$is_identified=this._isIdentified(),P(this.config.property_denylist)?z(this.config.property_denylist,function(e){delete r[e]}):q.error("Invalid value for property_denylist config: "+this.config.property_denylist+" or property_blacklist config: "+this.config.property_blacklist);let a=this.config.sanitize_properties;a&&(r=a(r,e));let l=this._hasPersonProcessing();return r.$process_person_profile=l,l&&this._requirePersonProcessing("_calculate_event_properties"),r}_calculate_set_once_properties(e){if(!this.persistence||!this._hasPersonProcessing())return e;let t=V({},this.persistence.get_initial_props(),e||{}),i=this.config.sanitize_properties;return i&&(t=i(t,"$set_once")),C(t)?void 0:t}register(e,t){var i;null==(i=this.persistence)||i.register(e,t)}register_once(e,t,i){var s;null==(s=this.persistence)||s.register_once(e,t,i)}register_for_session(e){var t;null==(t=this.sessionPersistence)||t.register(e)}unregister(e){var t;null==(t=this.persistence)||t.unregister(e)}unregister_for_session(e){var t;null==(t=this.sessionPersistence)||t.unregister(e)}_register_single(e,t){this.register({[e]:t})}getFeatureFlag(e,t){return this.featureFlags.getFeatureFlag(e,t)}getFeatureFlagPayload(e){let t=this.featureFlags.getFeatureFlagPayload(e);try{return JSON.parse(t)}catch{return t}}isFeatureEnabled(e,t){return this.featureFlags.isFeatureEnabled(e,t)}reloadFeatureFlags(){this.featureFlags.reloadFeatureFlags()}updateEarlyAccessFeatureEnrollment(e,t){this.featureFlags.updateEarlyAccessFeatureEnrollment(e,t)}getEarlyAccessFeatures(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return this.featureFlags.getEarlyAccessFeatures(e,t)}on(e,t){return this._internalEventEmitter.on(e,t)}onFeatureFlags(e){return this.featureFlags.onFeatureFlags(e)}onSessionId(e){var t,i;return null!=(t=null==(i=this.sessionManager)?void 0:i.onSessionId(e))?t:()=>{}}getSurveys(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];this.surveys.getSurveys(e,t)}getActiveMatchingSurveys(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];this.surveys.getActiveMatchingSurveys(e,t)}renderSurvey(e,t){this.surveys.renderSurvey(e,t)}canRenderSurvey(e){this.surveys.canRenderSurvey(e)}getNextSurveyStep(e,t,i){return this.surveys.getNextSurveyStep(e,t,i)}identify(e,t,i){if(!this.__loaded||!this.persistence)return q.uninitializedWarning("posthog.identify");if(D(e)&&(e=e.toString(),q.warn("The first argument to posthog.identify was a number, but it should be a string. It has been converted to a string.")),!e)return void q.error("Unique user id has not been set in posthog.identify");if(["distinct_id","distinctid"].includes(e.toLowerCase()))return void q.critical(`The string "${e}" was set in posthog.identify which indicates an error. This ID should be unique to the user and not a hardcoded string.`);if(!this._requirePersonProcessing("posthog.identify"))return;let s=this.get_distinct_id();this.register({$user_id:e}),this.get_property("$device_id")||this.register_once({$had_persisted_distinct_id:!0,$device_id:s},""),e!==s&&e!==this.get_property(ei)&&(this.unregister(ei),this.register({distinct_id:e}));let n="anonymous"===(this.persistence.get_property(eF)||"anonymous");e!==s&&n?(this.persistence.set_property(eF,"identified"),this.setPersonPropertiesForFlags(t||{},!1),this.capture("$identify",{distinct_id:e,$anon_distinct_id:s},{$set:t||{},$set_once:i||{}}),this.featureFlags.setAnonymousDistinctId(s)):(t||i)&&this.setPersonProperties(t,i),e!==s&&(this.reloadFeatureFlags(),this.unregister(eP))}setPersonProperties(e,t){(e||t)&&this._requirePersonProcessing("posthog.setPersonProperties")&&(this.setPersonPropertiesForFlags(e||{}),this.capture("$set",{$set:e||{},$set_once:t||{}}))}group(e,t,i){if(!e||!t)return void q.error("posthog.group requires a group type and group key");if(!this._requirePersonProcessing("posthog.group"))return;let s=this.getGroups();s[e]!==t&&this.resetGroupPropertiesForFlags(e),this.register({$groups:{...s,[e]:t}}),i&&(this.capture("$groupidentify",{$group_type:e,$group_key:t,$group_set:i}),this.setGroupPropertiesForFlags({[e]:i})),s[e]===t||i||this.reloadFeatureFlags()}resetGroups(){this.register({$groups:{}}),this.resetGroupPropertiesForFlags(),this.reloadFeatureFlags()}setPersonPropertiesForFlags(e){let t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];this._requirePersonProcessing("posthog.setPersonPropertiesForFlags")&&this.featureFlags.setPersonPropertiesForFlags(e,t)}resetPersonPropertiesForFlags(){this.featureFlags.resetPersonPropertiesForFlags()}setGroupPropertiesForFlags(e){let t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];this._requirePersonProcessing("posthog.setGroupPropertiesForFlags")&&this.featureFlags.setGroupPropertiesForFlags(e,t)}resetGroupPropertiesForFlags(e){this.featureFlags.resetGroupPropertiesForFlags(e)}reset(e){var t,i,s,n,r;if(q.info("reset"),!this.__loaded)return q.uninitializedWarning("posthog.reset");let o=this.get_property("$device_id");this.consent.reset(),null==(t=this.persistence)||t.clear(),null==(i=this.sessionPersistence)||i.clear(),null==(s=this.surveys)||s.reset(),null==(n=this.persistence)||n.set_property(eF,"anonymous"),null==(r=this.sessionManager)||r.resetSessionId();let a=this.config.get_device_id(eQ());this.register_once({distinct_id:a,$device_id:e?a:o},"")}get_distinct_id(){return this.get_property("distinct_id")}getGroups(){return this.get_property("$groups")||{}}get_session_id(){var e,t;return null!=(e=null==(t=this.sessionManager)?void 0:t.checkAndGetSessionAndWindowId(!0).sessionId)?e:""}get_session_replay_url(e){if(!this.sessionManager)return"";let{sessionId:t,sessionStartTimestamp:i}=this.sessionManager.checkAndGetSessionAndWindowId(!0),s=this.requestRouter.endpointFor("ui",`/project/${this.config.token}/replay/${t}`);if(null!=e&&e.withTimestamp&&i){var n;let t=null!=(n=e.timestampLookBack)?n:10;if(!i)return s;s+=`?t=${Math.max(Math.floor(((new Date).getTime()-i)/1e3)-t,0)}`}return s}alias(e,t){return e===this.get_property(et)?(q.critical("Attempting to create alias for existing People user - aborting."),-2):this._requirePersonProcessing("posthog.alias")?(T(t)&&(t=this.get_distinct_id()),e!==t?(this._register_single(ei,e),this.capture("$create_alias",{alias:e,distinct_id:t})):(q.warn("alias matches current distinct_id - skipping api call."),this.identify(e),-1)):void 0}set_config(e){var t,i,s,n;let r={...this.config};R(e)&&(V(this.config,nP(e)),null==(t=this.persistence)||t.update_config(this.config,r),this.sessionPersistence="sessionStorage"===this.config.persistence?this.persistence:new t0({...this.config,persistence:"sessionStorage"}),e0.is_supported()&&"true"===e0.get("ph_debug")&&(this.config.debug=!0),this.config.debug&&(S.DEBUG=!0,q.info("set_config",{config:e,oldConfig:r,newConfig:{...this.config}})),null==(i=this.sessionRecording)||i.startIfEnabledOrStop(),null==(s=this.autocapture)||s.startIfEnabled(),null==(n=this.heatmaps)||n.startIfEnabled(),this.surveys.loadIfEnabled(),this._sync_opt_out_with_persistence())}startSessionRecording(e){let t=O(e)&&e;if(t||null!=e&&e.sampling||null!=e&&e.linked_flag){var i,s,n;let r=null==(i=this.sessionManager)?void 0:i.checkAndGetSessionAndWindowId();(t||null!=e&&e.sampling)&&(null==(s=this.sessionRecording)||s.overrideSampling(),q.info("Session recording started with sampling override for session: ",null==r?void 0:r.sessionId)),(t||null!=e&&e.linked_flag)&&(null==(n=this.sessionRecording)||n.overrideLinkedFlag(),q.info("Session recording started with linked_flags override"))}this.set_config({disable_session_recording:!1})}stopSessionRecording(){this.set_config({disable_session_recording:!0})}sessionRecordingStarted(){var e;return!(null==(e=this.sessionRecording)||!e.started)}captureException(e,t){var i;let s=Error("PostHog syntheticException"),n=F(null==(i=w.__PosthogExtensions__)?void 0:i.parseErrorAsProperties)?w.__PosthogExtensions__.parseErrorAsProperties([e.message,void 0,void 0,void 0,e],{syntheticException:s}):{$exception_level:"error",$exception_list:[{type:e.name,value:e.message,mechanism:{handled:!0,synthetic:!1}}],...t};this.exceptions.sendExceptionEvent(n)}loadToolbar(e){return this.toolbar.loadToolbar(e)}get_property(e){var t;return null==(t=this.persistence)?void 0:t.props[e]}getSessionProperty(e){var t;return null==(t=this.sessionPersistence)?void 0:t.props[e]}toString(){var e;let t=null!=(e=this.config.name)?e:nk;return t!==nk&&(t=nk+"."+t),t}_isIdentified(){var e,t;return"identified"===(null==(e=this.persistence)?void 0:e.get_property(eF))||"identified"===(null==(t=this.sessionPersistence)?void 0:t.get_property(eF))}_hasPersonProcessing(){var e,t,i,s;return!("never"===this.config.person_profiles||"identified_only"===this.config.person_profiles&&
1!this._isIdentified()&&C(this.getGroups())&&(null==(e=this.persistence)||null==(t=e.props)||!t[ei])&&(null==(i=this.persistence)||null==(s=i.props)||!s[eM]))}_shouldCapturePageleave(){return!0===this.config.capture_pageleave||"if_capture_pageview"===this.config.capture_pageleave&&this.config.capture_pageview}createPersonProfile(){this._hasPersonProcessing()||this._requirePersonProcessing("posthog.createPersonProfile")&&this.setPersonProperties({},{})}_requirePersonProcessing(e){return"never"===this.config.person_profiles?(q.error(e+' was called, but process_person is set to "never". This call will be ignored.'),!1):(this._register_single(eM,!0),!0)}_sync_opt_out_with_persistence(){var e,t,i,s;let n=this.consent.isOptedOut(),r=this.config.opt_out_persistence_by_default,o=this.config.disable_persistence||n&&!!r;(null==(e=this.persistence)?void 0:e.disabled)!==o&&(null==(i=this.persistence)||i.set_disabled(o)),(null==(t=this.sessionPersistence)?void 0:t.disabled)!==o&&(null==(s=this.sessionPersistence)||s.set_disabled(o))}opt_in_capturing(e){var t;this.consent.optInOut(!0),this._sync_opt_out_with_persistence(),(T(null==e?void 0:e.captureEventName)||null!=e&&e.captureEventName)&&this.capture(null!=(t=null==e?void 0:e.captureEventName)?t:"$opt_in",null==e?void 0:e.captureProperties,{send_instantly:!0}),this.config.capture_pageview&&this._captureInitialPageview()}opt_out_capturing(){this.consent.optInOut(!1),this._sync_opt_out_with_persistence()}has_opted_in_capturing(){return this.consent.isOptedIn()}has_opted_out_capturing(){return this.consent.isOptedOut()}clear_opt_in_out_capturing(){this.consent.reset(),this._sync_opt_out_with_persistence()}_is_bot(){return p?nn(p,this.config.custom_blocked_useragents):void 0}_captureInitialPageview(){g&&!this._initialPageviewCaptured&&(this._initialPageviewCaptured=!0,this.capture("$pageview",{title:g.title},{send_instantly:!0}))}debug(e){!1===e?(null==u||u.console.log("You've disabled debug mode."),localStorage&&localStorage.removeItem("ph_debug"),this.set_config({debug:!1})):(null==u||u.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}))}}!function(e,t){for(let i=0;i<t.length;i++)e.prototype[t[i]]=J(e.prototype[t[i]])}(nR,["identify"]);let nC=function(){let e=nS[nk]=new nR;return function(){function e(){e.done||(e.done=!0,nx=!1,z(nS,function(e){e._dom_loaded()}))}null!=g&&g.addEventListener&&("complete"===g.readyState?e():g.addEventListener("DOMContentLoaded",e,!1)),u&&Z(u,"load",e,!0)}(),e}()}}]); 2//# sourceMappingURL=61521074.67d59daa8365af05.js.map
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.