@leanbase.com/js 0.2.2-alpha.0 → 0.2.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/leanbase.d.ts +0 -3
- package/dist/leanbase.iife.js +1 -1
- package/dist/leanbase.iife.js.map +1 -1
- package/dist/main.js +1 -1
- package/dist/main.js.map +1 -1
- package/dist/module.d.ts +0 -708
- package/dist/module.js +1 -1
- package/dist/module.js.map +1 -1
- package/dist/types.d.ts +0 -135
- package/dist/version.d.ts +1 -1
- package/lib/leanbase.d.ts +0 -3
- package/lib/leanbase.js +0 -25
- package/lib/leanbase.js.map +1 -1
- package/lib/types.d.ts +0 -135
- package/lib/types.js.map +1 -1
- package/lib/version.d.ts +1 -1
- package/lib/version.js +1 -1
- package/lib/version.js.map +1 -1
- package/package.json +1 -6
- package/dist/extensions/replay/external/config.d.ts +0 -9
- package/dist/extensions/replay/external/denylist.d.ts +0 -5
- package/dist/extensions/replay/external/lazy-loaded-session-recorder.d.ts +0 -153
- package/dist/extensions/replay/external/mutation-throttler.d.ts +0 -20
- package/dist/extensions/replay/external/network-plugin.d.ts +0 -15
- package/dist/extensions/replay/external/sessionrecording-utils.d.ts +0 -19
- package/dist/extensions/replay/external/triggerMatching.d.ts +0 -102
- package/dist/extensions/replay/rrweb-plugins/patch.d.ts +0 -3
- package/dist/extensions/replay/session-recording.d.ts +0 -75
- package/dist/extensions/replay/types/rrweb-types.d.ts +0 -439
- package/dist/extensions/replay/types/rrweb.d.ts +0 -82
- package/dist/extensions/sampling.d.ts +0 -4
- package/dist/utils/logger.d.ts +0 -10
- package/lib/extensions/replay/external/config.d.ts +0 -9
- package/lib/extensions/replay/external/config.js +0 -221
- package/lib/extensions/replay/external/config.js.map +0 -1
- package/lib/extensions/replay/external/denylist.d.ts +0 -5
- package/lib/extensions/replay/external/denylist.js +0 -28
- package/lib/extensions/replay/external/denylist.js.map +0 -1
- package/lib/extensions/replay/external/lazy-loaded-session-recorder.d.ts +0 -153
- package/lib/extensions/replay/external/lazy-loaded-session-recorder.js +0 -1042
- package/lib/extensions/replay/external/lazy-loaded-session-recorder.js.map +0 -1
- package/lib/extensions/replay/external/mutation-throttler.d.ts +0 -20
- package/lib/extensions/replay/external/mutation-throttler.js +0 -77
- package/lib/extensions/replay/external/mutation-throttler.js.map +0 -1
- package/lib/extensions/replay/external/network-plugin.d.ts +0 -15
- package/lib/extensions/replay/external/network-plugin.js +0 -503
- package/lib/extensions/replay/external/network-plugin.js.map +0 -1
- package/lib/extensions/replay/external/sessionrecording-utils.d.ts +0 -19
- package/lib/extensions/replay/external/sessionrecording-utils.js +0 -125
- package/lib/extensions/replay/external/sessionrecording-utils.js.map +0 -1
- package/lib/extensions/replay/external/triggerMatching.d.ts +0 -102
- package/lib/extensions/replay/external/triggerMatching.js +0 -342
- package/lib/extensions/replay/external/triggerMatching.js.map +0 -1
- package/lib/extensions/replay/rrweb-plugins/patch.d.ts +0 -3
- package/lib/extensions/replay/rrweb-plugins/patch.js +0 -32
- package/lib/extensions/replay/rrweb-plugins/patch.js.map +0 -1
- package/lib/extensions/replay/session-recording.d.ts +0 -75
- package/lib/extensions/replay/session-recording.js +0 -279
- package/lib/extensions/replay/session-recording.js.map +0 -1
- package/lib/extensions/replay/types/rrweb-types.d.ts +0 -439
- package/lib/extensions/replay/types/rrweb-types.js +0 -83
- package/lib/extensions/replay/types/rrweb-types.js.map +0 -1
- package/lib/extensions/replay/types/rrweb.d.ts +0 -82
- package/lib/extensions/replay/types/rrweb.js +0 -9
- package/lib/extensions/replay/types/rrweb.js.map +0 -1
- package/lib/extensions/sampling.d.ts +0 -4
- package/lib/extensions/sampling.js +0 -23
- package/lib/extensions/sampling.js.map +0 -1
- package/lib/utils/logger.d.ts +0 -10
- package/lib/utils/logger.js +0 -15
- package/lib/utils/logger.js.map +0 -1
package/dist/leanbase.d.ts
CHANGED
|
@@ -8,7 +8,6 @@ import { SessionPropsManager } from './session-props';
|
|
|
8
8
|
import { PageViewManager } from './page-view';
|
|
9
9
|
import { ScrollManager } from './scroll-manager';
|
|
10
10
|
import { ConsentManager } from './consent';
|
|
11
|
-
import { SessionRecording } from './extensions/replay/session-recording';
|
|
12
11
|
export declare class Leanbase extends PostHogCore {
|
|
13
12
|
config: LeanbaseConfig;
|
|
14
13
|
scrollManager: ScrollManager;
|
|
@@ -19,7 +18,6 @@ export declare class Leanbase extends PostHogCore {
|
|
|
19
18
|
sessionPersistence?: LeanbasePersistence;
|
|
20
19
|
sessionManager?: SessionIdManager;
|
|
21
20
|
sessionPropsManager?: SessionPropsManager;
|
|
22
|
-
sessionRecording?: SessionRecording;
|
|
23
21
|
isRemoteConfigLoaded?: boolean;
|
|
24
22
|
personProcessingSetOncePropertiesSent: boolean;
|
|
25
23
|
isLoaded: boolean;
|
|
@@ -37,7 +35,6 @@ export declare class Leanbase extends PostHogCore {
|
|
|
37
35
|
getLibraryVersion(): string;
|
|
38
36
|
getCustomUserAgent(): void;
|
|
39
37
|
getPersistedProperty<T>(key: PostHogPersistedProperty): T | undefined;
|
|
40
|
-
getPersistedProperty<T>(key: string): T | undefined;
|
|
41
38
|
setPersistedProperty<T>(key: PostHogPersistedProperty, value: T | null): void;
|
|
42
39
|
calculateEventProperties(eventName: string, eventProperties: PostHogEventProperties, timestamp: Date, uuid: string, readOnly?: boolean): Properties;
|
|
43
40
|
isIdentified(): boolean;
|
package/dist/leanbase.iife.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
!function(){"use strict";function e(e,t,r,i,s,n,o){try{var a=e[n](o),l=a.value}catch(e){return void r(e)}a.done?t(l):Promise.resolve(l).then(i,s)}function t(t){return function(){var r=this,i=arguments;return new Promise((function(s,n){var o=t.apply(r,i);function a(t){e(o,s,n,a,l,"next",t)}function l(t){e(o,s,n,a,l,"throw",t)}a(void 0)}))}}function r(){return r=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var i in r)({}).hasOwnProperty.call(r,i)&&(e[i]=r[i])}return e},r.apply(null,arguments)}var i=e=>{if("flags"in e)return r({},e,{featureFlags:n(e.flags),featureFlagPayloads:o(e.flags)});var t,i=null!==(t=e.featureFlags)&&void 0!==t?t:{},a=Object.fromEntries(Object.entries(e.featureFlagPayloads||{}).map((e=>{var[t,r]=e;return[t,l(r)]}))),u=Object.fromEntries(Object.entries(i).map((e=>{var[t,r]=e;return[t,s(t,r,a[t])]})));return r({},e,{featureFlags:i,featureFlagPayloads:a,flags:u})};function s(e,t,r){return{key:e,enabled:"string"==typeof t||t,variant:"string"==typeof t?t:void 0,reason:void 0,metadata:{id:void 0,version:void 0,payload:r?JSON.stringify(r):void 0,description:void 0}}}var n=e=>Object.fromEntries(Object.entries(null!=e?e:{}).map((e=>{var[t,r]=e;return[t,a(r)]})).filter((e=>{var[,t]=e;return void 0!==t}))),o=e=>{var t=null!=e?e:{};return Object.fromEntries(Object.keys(t).filter((e=>{var r=t[e];return r.enabled&&r.metadata&&void 0!==r.metadata.payload})).map((e=>{var r,i=null==(r=t[e].metadata)?void 0:r.payload;return[e,i?l(i):void 0]})))},a=e=>{var t;return void 0===e?void 0:null!==(t=e.variant)&&void 0!==t?t:e.enabled},l=e=>{if("string"!=typeof e)return e;try{return JSON.parse(e)}catch(t){return e}},u=(e,t)=>{var r=[...new Set([...Object.keys(null!=e?e:{}),...Object.keys(null!=t?t:{})])].filter((r=>!!e[r]||!!t[r])).reduce(((t,r)=>{var i;return t[r]=null===(i=e[r])||void 0===i||i,t}),{});return i({featureFlags:r,featureFlagPayloads:null!=t?t:{}})};function c(e){return"string"==typeof e||e}function d(e){return"string"==typeof e?e:void 0}var h="0123456789abcdef";let g=class e{constructor(e){this.bytes=e}static ofInner(t){if(16===t.length)return new e(t);throw new TypeError("not 128-bit length")}static fromFieldsV7(t,r,i,s){if(!Number.isInteger(t)||!Number.isInteger(r)||!Number.isInteger(i)||!Number.isInteger(s)||t<0||r<0||i<0||s<0||t>0xffffffffffff||r>4095||i>1073741823||s>4294967295)throw new RangeError("invalid field value");var n=new Uint8Array(16);return n[0]=t/Math.pow(2,40),n[1]=t/Math.pow(2,32),n[2]=t/Math.pow(2,24),n[3]=t/Math.pow(2,16),n[4]=t/256,n[5]=t,n[6]=112|r>>>8,n[7]=r,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 e(n)}static parse(t){var r,i,s,n,o;switch(t.length){case 32:o=null==(r=/^[0-9a-f]{32}$/i.exec(t))?void 0:r[0];break;case 36:o=null==(i=/^([0-9a-f]{8})-([0-9a-f]{4})-([0-9a-f]{4})-([0-9a-f]{4})-([0-9a-f]{12})$/i.exec(t))?void 0:i.slice(1,6).join("");break;case 38:o=null==(s=/^\{([0-9a-f]{8})-([0-9a-f]{4})-([0-9a-f]{4})-([0-9a-f]{4})-([0-9a-f]{12})\}$/i.exec(t))?void 0:s.slice(1,6).join("");break;case 45:o=null==(n=/^urn:uuid:([0-9a-f]{8})-([0-9a-f]{4})-([0-9a-f]{4})-([0-9a-f]{4})-([0-9a-f]{12})$/i.exec(t))?void 0:n.slice(1,6).join("")}if(o){for(var a=new Uint8Array(16),l=0;l<16;l+=4){var u=parseInt(o.substring(2*l,2*l+8),16);a[l+0]=u>>>24,a[l+1]=u>>>16,a[l+2]=u>>>8,a[l+3]=u}return new e(a)}throw new SyntaxError("could not parse UUID string")}toString(){for(var e="",t=0;t<this.bytes.length;t++)e+=h.charAt(this.bytes[t]>>>4),e+=h.charAt(15&this.bytes[t]),3!==t&&5!==t&&7!==t&&9!==t||(e+="-");return e}toHex(){for(var e="",t=0;t<this.bytes.length;t++)e+=h.charAt(this.bytes[t]>>>4),e+=h.charAt(15&this.bytes[t]);return e}toJSON(){return this.toString()}getVariant(){var e=this.bytes[8]>>>4;if(e<0)throw new Error("unreachable");if(e<=7)return this.bytes.every((e=>0===e))?"NIL":"VAR_0";if(e<=11)return"VAR_10";if(e<=13)return"VAR_110";if(e<=15)return this.bytes.every((e=>255===e))?"MAX":"VAR_RESERVED";throw new Error("unreachable")}getVersion(){return"VAR_10"===this.getVariant()?this.bytes[6]>>>4:void 0}clone(){return new e(this.bytes.slice(0))}equals(e){return 0===this.compareTo(e)}compareTo(e){for(var t=0;t<16;t++){var r=this.bytes[t]-e.bytes[t];if(0!==r)return Math.sign(r)}return 0}},p=class{constructor(e){this.timestamp=0,this.counter=0,this.random=null!=e?e:f()}generate(){return this.generateOrResetCore(Date.now(),1e4)}generateOrAbort(){return this.generateOrAbortCore(Date.now(),1e4)}generateOrResetCore(e,t){var r=this.generateOrAbortCore(e,t);return void 0===r&&(this.timestamp=0,r=this.generateOrAbortCore(e,t)),r}generateOrAbortCore(e,t){if(!Number.isInteger(e)||e<1||e>0xffffffffffff)throw new RangeError("`unixTsMs` must be a 48-bit positive integer");if(t<0||t>0xffffffffffff)throw new RangeError("`rollbackAllowance` out of reasonable range");if(e>this.timestamp)this.timestamp=e,this.resetCounter();else{if(!(e+t>=this.timestamp))return;this.counter++,this.counter>4398046511103&&(this.timestamp++,this.resetCounter())}return g.fromFieldsV7(this.timestamp,Math.trunc(this.counter/Math.pow(2,30)),this.counter&Math.pow(2,30)-1,this.random.nextUint32())}resetCounter(){this.counter=1024*this.random.nextUint32()+(1023&this.random.nextUint32())}generateV4(){var e=new Uint8Array(Uint32Array.of(this.random.nextUint32(),this.random.nextUint32(),this.random.nextUint32(),this.random.nextUint32()).buffer);return e[6]=64|e[6]>>>4,e[8]=128|e[8]>>>2,g.ofInner(e)}};var _,f=()=>({nextUint32:()=>65536*Math.trunc(65536*Math.random())+Math.trunc(65536*Math.random())}),v=()=>m().toString(),m=()=>(_||(_=new p)).generate(),y=function(e){return e.AnonymousId="anonymous_id",e.DistinctId="distinct_id",e.Props="props",e.FeatureFlagDetails="feature_flag_details",e.FeatureFlags="feature_flags",e.FeatureFlagPayloads="feature_flag_payloads",e.BootstrapFeatureFlagDetails="bootstrap_feature_flag_details",e.BootstrapFeatureFlags="bootstrap_feature_flags",e.BootstrapFeatureFlagPayloads="bootstrap_feature_flag_payloads",e.OverrideFeatureFlags="override_feature_flags",e.Queue="queue",e.OptedOut="opted_out",e.SessionId="session_id",e.SessionStartTimestamp="session_start_timestamp",e.SessionLastTimestamp="session_timestamp",e.PersonProperties="person_properties",e.GroupProperties="group_properties",e.InstalledAppBuild="installed_app_build",e.InstalledAppVersion="installed_app_version",e.SessionReplay="session_replay",e.SurveyLastSeenDate="survey_last_seen_date",e.SurveysSeen="surveys_seen",e.Surveys="surveys",e.RemoteConfig="remote_config",e.FlagsEndpointWasHit="flags_endpoint_was_hit",e}({}),b=function(e){return e.GZipJS="gzip-js",e.Base64="base64",e}({});function w(e,t){return-1!==e.indexOf(t)}var P=function(e){return e.trim()},S=function(e){return e.replace(/^\$/,"")},I=Array.isArray,F=Object.prototype,x=F.hasOwnProperty,E=F.toString,k=I||function(e){return"[object Array]"===E.call(e)},C=e=>"function"==typeof e,R=e=>e===Object(e)&&!k(e),A=e=>{if(R(e)){for(var t in e)if(x.call(e,t))return!1;return!0}return!1},O=e=>void 0===e,T=e=>"[object String]"==E.call(e),L=e=>null===e,M=e=>O(e)||L(e),D=e=>"[object Number]"==E.call(e),N=e=>"[object Boolean]"===E.call(e),j=e=>e instanceof FormData,U=e=>e instanceof Error,z=[!0,"true",1,"1","yes"],q=e=>w(z,e),B=[!1,"false",0,"0","no"];function H(e,t,r,i,s){return t>r&&(i.warn("min cannot be greater than max."),t=r),D(e)?e>r?(i.warn(" cannot be greater than max: "+r+". Using max value instead."),r):e<t?(i.warn(" cannot be less than min: "+t+". Using min value instead."),t):e:(i.warn(" must be a number. using max or fallback. max: "+r+", fallback: "+s),H(s||r,t,r,i))}class G{add(e){var t=v();return this.promiseByIds[t]=e,e.catch((()=>{})).finally((()=>{delete this.promiseByIds[t]})),e}join(){var e=this;return t((function*(){for(var t=Object.values(e.promiseByIds),r=t.length;r>0;)yield Promise.all(t),r=(t=Object.values(e.promiseByIds)).length}))()}get length(){return Object.keys(this.promiseByIds).length}constructor(){this.promiseByIds={}}}function V(){return(V=t((function*(e,t){for(var r=null,i=0;i<t.retryCount+1;i++){i>0&&(yield new Promise((e=>setTimeout(e,t.retryDelay))));try{return yield e()}catch(e){if(r=e,!t.retryCheck(e))throw e}}throw r}))).apply(this,arguments)}function K(){return(new Date).toISOString()}function W(e,t){var r=setTimeout(e,t);return(null==r?void 0:r.unref)&&(null==r||r.unref()),r}function J(e){return Promise.all(e.map((e=>(null!=e?e:Promise.resolve()).then((e=>({status:"fulfilled",value:e})),(e=>({status:"rejected",reason:e}))))))}let Q=class{constructor(){this.events={},this.events={}}on(e,t){return this.events[e]||(this.events[e]=[]),this.events[e].push(t),()=>{this.events[e]=this.events[e].filter((e=>e!==t))}}emit(e,t){for(var r of this.events[e]||[])r(t);for(var i of this.events["*"]||[])i(e,t)}};function Y(e,t){return X.apply(this,arguments)}function X(){return(X=t((function*(e,t){void 0===t&&(t=!0);try{var r=new Blob([e],{type:"text/plain"}).stream().pipeThrough(new CompressionStream("gzip"));return yield new Response(r).blob()}catch(e){return t&&console.error("Failed to gzip compress data",e),null}}))).apply(this,arguments)}var Z=(e,t,r)=>{function i(i){for(var s=arguments.length,n=new Array(s>1?s-1:0),o=1;o<s;o++)n[o-1]=arguments[o];t((()=>{(0,r[i])(e,...n)}))}var s={info:function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];i("log",...t)},warn:function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];i("warn",...t)},error:function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];i("error",...t)},critical:function(){for(var t=arguments.length,i=new Array(t),s=0;s<t;s++)i[s]=arguments[s];r.error(e,...i)},createLogger:i=>Z(e+" "+i,t,r)};return s};function ee(e,t){return Z(e,t,(void 0===r&&(r=console),{log:r.log.bind(r),warn:r.warn.bind(r),error:r.error.bind(r),debug:r.debug.bind(r)}));var r}class te extends Error{constructor(e,t){super("HTTP error while fetching PostHog: status="+e.status+", reqByteLength="+t),this.response=e,this.reqByteLength=t,this.name="PostHogFetchHttpError"}get status(){return this.response.status}get text(){return this.response.text()}get json(){return this.response.json()}}class re extends Error{constructor(e){super("Network error while fetching PostHog",e instanceof Error?{cause:e}:{}),this.error=e,this.name="PostHogFetchNetworkError"}}var ie=(e,t)=>void 0!==t?{[e]:t}:{};function se(e){return ne.apply(this,arguments)}function ne(){return(ne=t((function*(e){if(e instanceof te){var t="";try{t=yield e.text}catch(e){}console.error("Error while flushing PostHog: message="+e.message+", response body="+t,e)}else console.error("Error while flushing PostHog",e);return Promise.resolve()}))).apply(this,arguments)}function oe(e){return"object"==typeof e&&(e instanceof te||e instanceof re)}function ae(e){return"object"==typeof e&&e instanceof te&&413===e.status}var le=function(e){return e.FeatureFlags="feature_flags",e.Recordings="recordings",e}({});class ue{constructor(e,t){var r,i,s,n,o,a,l,u,c,d,h,g,p,_,f,v,m,y,b;void 0===t&&(t={}),this.flushPromise=null,this.shutdownPromise=null,this.promiseQueue=new G,this._events=new Q,this._isInitialized=!1,function(e,t){if(!e||"string"!=typeof e||function(e){return 0===e.trim().length}(e))throw new Error(t)}(e,"You must pass your PostHog project's api key."),this.apiKey=e,this.host=null==(b=t.host||"https://us.i.posthog.com")?void 0:b.replace(/\/+$/,""),this.flushAt=t.flushAt?Math.max(t.flushAt,1):20,this.maxBatchSize=Math.max(this.flushAt,null!==(r=t.maxBatchSize)&&void 0!==r?r:100),this.maxQueueSize=Math.max(this.flushAt,null!==(i=t.maxQueueSize)&&void 0!==i?i:1e3),this.flushInterval=null!==(s=t.flushInterval)&&void 0!==s?s:1e4,this.preloadFeatureFlags=null===(n=t.preloadFeatureFlags)||void 0===n||n,this.defaultOptIn=null===(o=t.defaultOptIn)||void 0===o||o,this.disableSurveys=null!==(a=t.disableSurveys)&&void 0!==a&&a,this._retryOptions={retryCount:null!==(l=t.fetchRetryCount)&&void 0!==l?l:3,retryDelay:null!==(u=t.fetchRetryDelay)&&void 0!==u?u:3e3,retryCheck:oe},this.requestTimeout=null!==(c=t.requestTimeout)&&void 0!==c?c:1e4,this.featureFlagsRequestTimeoutMs=null!==(d=t.featureFlagsRequestTimeoutMs)&&void 0!==d?d:3e3,this.remoteConfigRequestTimeoutMs=null!==(h=t.remoteConfigRequestTimeoutMs)&&void 0!==h?h:3e3,this.disableGeoip=null===(g=t.disableGeoip)||void 0===g||g,this.disabled=null!==(p=t.disabled)&&void 0!==p&&p,this.historicalMigration=null!==(_=null==(f=t)?void 0:f.historicalMigration)&&void 0!==_&&_,this.evaluationEnvironments=null==(v=t)?void 0:v.evaluationEnvironments,this._initPromise=Promise.resolve(),this._isInitialized=!0,this._logger=ee("[PostHog]",this.logMsgIfDebug.bind(this)),this.disableCompression=!("CompressionStream"in globalThis)||null!==(m=null==(y=t)?void 0:y.disableCompression)&&void 0!==m&&m}logMsgIfDebug(e){this.isDebug&&e()}wrap(e){if(!this.disabled)return this._isInitialized?e():void this._initPromise.then((()=>e()));this._logger.warn("The client is disabled")}getCommonEventProperties(){return{$lib:this.getLibraryId(),$lib_version:this.getLibraryVersion()}}get optedOut(){var e;return null!==(e=this.getPersistedProperty(y.OptedOut))&&void 0!==e?e:!this.defaultOptIn}optIn(){var e=this;return t((function*(){e.wrap((()=>{e.setPersistedProperty(y.OptedOut,!1)}))}))()}optOut(){var e=this;return t((function*(){e.wrap((()=>{e.setPersistedProperty(y.OptedOut,!0)}))}))()}on(e,t){return this._events.on(e,t)}debug(e){var t;if(void 0===e&&(e=!0),null==(t=this.removeDebugCallback)||t.call(this),e){var r=this.on("*",((e,t)=>this._logger.info(e,t)));this.removeDebugCallback=()=>{r(),this.removeDebugCallback=void 0}}}get isDebug(){return!!this.removeDebugCallback}get isDisabled(){return this.disabled}buildPayload(e){return{distinct_id:e.distinct_id,event:e.event,properties:r({},e.properties||{},this.getCommonEventProperties())}}addPendingPromise(e){return this.promiseQueue.add(e)}identifyStateless(e,t,i){this.wrap((()=>{var s=r({},this.buildPayload({distinct_id:e,event:"$identify",properties:t}));this.enqueue("identify",s,i)}))}identifyStatelessImmediate(e,i,s){var n=this;return t((function*(){var t=r({},n.buildPayload({distinct_id:e,event:"$identify",properties:i}));yield n.sendImmediate("identify",t,s)}))()}captureStateless(e,t,r,i){this.wrap((()=>{var s=this.buildPayload({distinct_id:e,event:t,properties:r});this.enqueue("capture",s,i)}))}captureStatelessImmediate(e,r,i,s){var n=this;return t((function*(){var t=n.buildPayload({distinct_id:e,event:r,properties:i});yield n.sendImmediate("capture",t,s)}))()}aliasStateless(e,t,i,s){this.wrap((()=>{var n=this.buildPayload({event:"$create_alias",distinct_id:t,properties:r({},i||{},{distinct_id:t,alias:e})});this.enqueue("alias",n,s)}))}aliasStatelessImmediate(e,i,s,n){var o=this;return t((function*(){var t=o.buildPayload({event:"$create_alias",distinct_id:i,properties:r({},s||{},{distinct_id:i,alias:e})});yield o.sendImmediate("alias",t,n)}))()}groupIdentifyStateless(e,t,i,s,n,o){this.wrap((()=>{var a=this.buildPayload({distinct_id:n||"$"+e+"_"+t,event:"$groupidentify",properties:r({$group_type:e,$group_key:t,$group_set:i||{}},o||{})});this.enqueue("capture",a,s)}))}getRemoteConfig(){var e=this;return t((function*(){yield e._initPromise;var t=e.host;"https://us.i.posthog.com"===t?t="https://us-assets.i.posthog.com":"https://eu.i.posthog.com"===t&&(t="https://eu-assets.i.posthog.com");var i=t+"/array/"+e.apiKey+"/config",s={method:"GET",headers:r({},e.getCustomHeaders(),{"Content-Type":"application/json"})};return e.fetchWithRetry(i,s,{retryCount:0},e.remoteConfigRequestTimeoutMs).then((e=>e.json())).catch((t=>{e._logger.error("Remote config could not be loaded",t),e._events.emit("error",t)}))}))()}getFlags(e,s,n,o,a,l){var u=this;return t((function*(){void 0===s&&(s={}),void 0===n&&(n={}),void 0===o&&(o={}),void 0===a&&(a={}),void 0===l&&(l=!0),yield u._initPromise;var t=l?"&config=true":"",c=u.host+"/flags/?v=2"+t,d=r({token:u.apiKey,distinct_id:e,groups:s,person_properties:n,group_properties:o},a);u.evaluationEnvironments&&u.evaluationEnvironments.length>0&&(d.evaluation_environments=u.evaluationEnvironments);var h={method:"POST",headers:r({},u.getCustomHeaders(),{"Content-Type":"application/json"}),body:JSON.stringify(d)};return u._logger.info("Flags URL",c),u.fetchWithRetry(c,h,{retryCount:0},u.featureFlagsRequestTimeoutMs).then((e=>e.json())).then((e=>i(e))).catch((e=>{u._events.emit("error",e)}))}))()}getFeatureFlagStateless(e,r,i,s,n,o){var l=this;return t((function*(){void 0===i&&(i={}),void 0===s&&(s={}),void 0===n&&(n={}),yield l._initPromise;var t=yield l.getFeatureFlagDetailStateless(e,r,i,s,n,o);if(void 0===t)return{response:void 0,requestId:void 0};var u=a(t.response);return void 0===u&&(u=!1),{response:u,requestId:t.requestId}}))()}getFeatureFlagDetailStateless(e,r,i,s,n,o){var a=this;return t((function*(){void 0===i&&(i={}),void 0===s&&(s={}),void 0===n&&(n={}),yield a._initPromise;var t=yield a.getFeatureFlagDetailsStateless(r,i,s,n,o,[e]);if(void 0!==t)return{response:t.flags[e],requestId:t.requestId}}))()}getFeatureFlagPayloadStateless(e,r,i,s,n,o){var a=this;return t((function*(){void 0===i&&(i={}),void 0===s&&(s={}),void 0===n&&(n={}),yield a._initPromise;var t=yield a.getFeatureFlagPayloadsStateless(r,i,s,n,o,[e]);if(t){var l=t[e];return void 0===l?null:l}}))()}getFeatureFlagPayloadsStateless(e,r,i,s,n,o){var a=this;return t((function*(){return void 0===r&&(r={}),void 0===i&&(i={}),void 0===s&&(s={}),yield a._initPromise,(yield a.getFeatureFlagsAndPayloadsStateless(e,r,i,s,n,o)).payloads}))()}getFeatureFlagsStateless(e,r,i,s,n,o){var a=this;return t((function*(){return void 0===r&&(r={}),void 0===i&&(i={}),void 0===s&&(s={}),yield a._initPromise,yield a.getFeatureFlagsAndPayloadsStateless(e,r,i,s,n,o)}))()}getFeatureFlagsAndPayloadsStateless(e,r,i,s,n,o){var a=this;return t((function*(){void 0===r&&(r={}),void 0===i&&(i={}),void 0===s&&(s={}),yield a._initPromise;var t=yield a.getFeatureFlagDetailsStateless(e,r,i,s,n,o);return t?{flags:t.featureFlags,payloads:t.featureFlagPayloads,requestId:t.requestId}:{flags:void 0,payloads:void 0,requestId:void 0}}))()}getFeatureFlagDetailsStateless(e,r,i,s,n,o){var a=this;return t((function*(){var t;void 0===r&&(r={}),void 0===i&&(i={}),void 0===s&&(s={}),yield a._initPromise;var l={};(null!=n?n:a.disableGeoip)&&(l.geoip_disable=!0),o&&(l.flag_keys_to_evaluate=o);var u=yield a.getFlags(e,r,i,s,l);if(void 0!==u)return u.errorsWhileComputingFlags&&console.error("[FEATURE FLAGS] Error while computing feature flags, some flags may be missing or incorrect. Learn more at https://posthog.com/docs/feature-flags/best-practices"),null!=(t=u.quotaLimited)&&t.includes("feature_flags")?(console.warn("[FEATURE FLAGS] Feature flags quota limit exceeded - feature flags unavailable. Learn more about billing limits at https://posthog.com/docs/billing/limits-alerts"),{flags:{},featureFlags:{},featureFlagPayloads:{},requestId:null==u?void 0:u.requestId}):u}))()}getSurveysStateless(){var e=this;return t((function*(){if(yield e._initPromise,!0===e.disableSurveys)return e._logger.info("Loading surveys is disabled."),[];var t=e.host+"/api/surveys/?token="+e.apiKey,i={method:"GET",headers:r({},e.getCustomHeaders(),{"Content-Type":"application/json"})},s=yield e.fetchWithRetry(t,i).then((t=>{if(200!==t.status||!t.json){var r="Surveys API could not be loaded: "+t.status,i=new Error(r);return e._logger.error(i),void e._events.emit("error",new Error(r))}return t.json()})).catch((t=>{e._logger.error("Surveys API could not be loaded",t),e._events.emit("error",t)})),n=null==s?void 0:s.surveys;return n&&e._logger.info("Surveys fetched from API: ",JSON.stringify(n)),null!=n?n:[]}))()}get props(){return this._props||(this._props=this.getPersistedProperty(y.Props)),this._props||{}}set props(e){this._props=e}register(e){var i=this;return t((function*(){i.wrap((()=>{i.props=r({},i.props,e),i.setPersistedProperty(y.Props,i.props)}))}))()}unregister(e){var r=this;return t((function*(){r.wrap((()=>{delete r.props[e],r.setPersistedProperty(y.Props,r.props)}))}))()}enqueue(e,t,r){this.wrap((()=>{if(this.optedOut)this._events.emit(e,"Library is disabled. Not sending event. To re-enable, call posthog.optIn()");else{var i=this.prepareMessage(e,t,r),s=this.getPersistedProperty(y.Queue)||[];s.length>=this.maxQueueSize&&(s.shift(),this._logger.info("Queue is full, the oldest event is dropped.")),s.push({message:i}),this.setPersistedProperty(y.Queue,s),this._events.emit(e,i),s.length>=this.flushAt&&this.flushBackground(),this.flushInterval&&!this._flushTimer&&(this._flushTimer=W((()=>this.flushBackground()),this.flushInterval))}}))}sendImmediate(e,i,s){var n=this;return t((function*(){if(n.disabled)n._logger.warn("The client is disabled");else if(n._isInitialized||(yield n._initPromise),n.optedOut)n._events.emit(e,"Library is disabled. Not sending event. To re-enable, call posthog.optIn()");else{var t={api_key:n.apiKey,batch:[n.prepareMessage(e,i,s)],sent_at:K()};n.historicalMigration&&(t.historical_migration=!0);var o=JSON.stringify(t),a=n.host+"/batch/",l=n.disableCompression?null:yield Y(o,n.isDebug),u={method:"POST",headers:r({},n.getCustomHeaders(),{"Content-Type":"application/json"},null!==l&&{"Content-Encoding":"gzip"}),body:l||o};try{yield n.fetchWithRetry(a,u)}catch(e){n._events.emit("error",e)}}}))()}prepareMessage(e,t,i){var s,n=r({},t,{type:e,library:this.getLibraryId(),library_version:this.getLibraryVersion(),timestamp:null!=i&&i.timestamp?null==i?void 0:i.timestamp:K(),uuid:null!=i&&i.uuid?i.uuid:v()});return(null!==(s=null==i?void 0:i.disableGeoip)&&void 0!==s?s:this.disableGeoip)&&(n.properties||(n.properties={}),n.properties.$geoip_disable=!0),n.distinctId&&(n.distinct_id=n.distinctId,delete n.distinctId),n}clearFlushTimer(){this._flushTimer&&(clearTimeout(this._flushTimer),this._flushTimer=void 0)}flushBackground(){this.flush().catch(function(){var e=t((function*(e){yield se(e)}));return function(t){return e.apply(this,arguments)}}())}flush(){var e=this;return t((function*(){var t=J([e.flushPromise]).then((()=>e._flush()));return e.flushPromise=t,e.addPendingPromise(t),J([t]).then((()=>{e.flushPromise===t&&(e.flushPromise=null)})),t}))()}getCustomHeaders(){var e=this.getCustomUserAgent(),t={};return e&&""!==e&&(t["User-Agent"]=e),t}_flush(){var e=this;return t((function*(){e.clearFlushTimer(),yield e._initPromise;var t=e.getPersistedProperty(y.Queue)||[];if(t.length){for(var i=[],s=t.length,n=function*(){var s=t.slice(0,e.maxBatchSize),n=s.map((e=>e.message)),o=()=>{var r=(e.getPersistedProperty(y.Queue)||[]).slice(s.length);e.setPersistedProperty(y.Queue,r),t=r},a={api_key:e.apiKey,batch:n,sent_at:K()};e.historicalMigration&&(a.historical_migration=!0);var l=JSON.stringify(a),u=e.host+"/batch/",c=e.disableCompression?null:yield Y(l,e.isDebug),d={method:"POST",headers:r({},e.getCustomHeaders(),{"Content-Type":"application/json"},null!==c&&{"Content-Encoding":"gzip"}),body:c||l},h={retryCheck:e=>!ae(e)&&oe(e)};try{yield e.fetchWithRetry(u,d,h)}catch(t){if(ae(t)&&n.length>1)return e.maxBatchSize=Math.max(1,Math.floor(n.length/2)),e._logger.warn("Received 413 when sending batch of size "+n.length+", reducing batch size to "+e.maxBatchSize),1;throw t instanceof re||o(),e._events.emit("error",t),t}o(),i.push(...n)};t.length>0&&i.length<s;)yield*n();e._events.emit("flush",i)}}))()}fetchWithRetry(e,i,s,n){var o=this;return t((function*(){var a,l;null!==(l=(a=AbortSignal).timeout)&&void 0!==l||(a.timeout=function(e){var t=new AbortController;return setTimeout((()=>t.abort()),e),t.signal});var u=i.body?i.body:"",c=-1;try{c=u instanceof Blob?u.size:Buffer.byteLength(u,"utf8")}catch(e){if(u instanceof Blob)c=u.size;else{var d=(new TextEncoder).encode(u);c=d.length}}return yield function(e,t){return V.apply(this,arguments)}(t((function*(){var t=null;try{t=yield o.fetch(e,r({signal:AbortSignal.timeout(null!=n?n:o.requestTimeout)},i))}catch(e){throw new re(e)}if(!("no-cors"===i.mode)&&(t.status<200||t.status>=400))throw new te(t,c);return t})),r({},o._retryOptions,s))}))()}_shutdown(e){var r=this;return t((function*(){void 0===e&&(e=3e4),yield r._initPromise;var i=!1;r.clearFlushTimer();var s=function(){var e=t((function*(){try{for(yield r.promiseQueue.join();;){if(0===(r.getPersistedProperty(y.Queue)||[]).length)break;if(yield r.flush(),i)break}}catch(e){if(!oe(e))throw e;yield se(e)}}));return function(){return e.apply(this,arguments)}}();return Promise.race([new Promise(((t,s)=>{W((()=>{r._logger.error("Timed out while shutting down PostHog"),i=!0,s("Timeout while shutting down PostHog. Some events may not have been sent.")}),e)})),s()])}))()}shutdown(e){var r=this;return t((function*(){return void 0===e&&(e=3e4),r.shutdownPromise?r._logger.warn("shutdown() called while already shutting down. shutdown() is meant to be called once before process exit - use flush() for per-request cleanup"):r.shutdownPromise=r._shutdown(e).finally((()=>{r.shutdownPromise=null})),r.shutdownPromise}))()}}class ce extends ue{constructor(e,t){var i,s,n,o;super(e,r({},t,{disableGeoip:null!==(i=null==t?void 0:t.disableGeoip)&&void 0!==i&&i,featureFlagsRequestTimeoutMs:null!==(s=null==t?void 0:t.featureFlagsRequestTimeoutMs)&&void 0!==s?s:1e4})),this.flagCallReported={},this._sessionMaxLengthSeconds=86400,this.sessionProps={},this.sendFeatureFlagEvent=null===(n=null==t?void 0:t.sendFeatureFlagEvent)||void 0===n||n,this._sessionExpirationTimeSeconds=null!==(o=null==t?void 0:t.sessionExpirationTimeSeconds)&&void 0!==o?o:1800}setupBootstrap(e){var t,i=null==e?void 0:e.bootstrap;if(i){if(i.distinctId)if(i.isIdentifiedId){this.getPersistedProperty(y.DistinctId)||this.setPersistedProperty(y.DistinctId,i.distinctId)}else{this.getPersistedProperty(y.AnonymousId)||this.setPersistedProperty(y.AnonymousId,i.distinctId)}var s=i.featureFlags,n=null!==(t=i.featureFlagPayloads)&&void 0!==t?t:{};if(s&&Object.keys(s).length){var o=u(s,n);if(Object.keys(o.flags).length>0){this.setBootstrappedFeatureFlagDetails(o);var a=this.getKnownFeatureFlagDetails()||{flags:{},requestId:void 0},l={flags:r({},o.flags,a.flags),requestId:o.requestId};this.setKnownFeatureFlagDetails(l)}}}}clearProps(){this.props=void 0,this.sessionProps={},this.flagCallReported={}}on(e,t){return this._events.on(e,t)}reset(e){this.wrap((()=>{var t=[y.Queue,...e||[]];for(var r of(this.clearProps(),Object.keys(y)))t.includes(y[r])||this.setPersistedProperty(y[r],null);this.reloadFeatureFlags()}))}getCommonEventProperties(){var e=this.getFeatureFlags(),t={};if(e)for(var[i,s]of Object.entries(e))t["$feature/"+i]=s;return r({},ie("$active_feature_flags",e?Object.keys(e):void 0),t,super.getCommonEventProperties())}enrichProperties(e){return r({},this.props,this.sessionProps,e||{},this.getCommonEventProperties(),{$session_id:this.getSessionId()})}getSessionId(){if(!this._isInitialized)return"";var e=this.getPersistedProperty(y.SessionId),t=this.getPersistedProperty(y.SessionLastTimestamp)||0,r=this.getPersistedProperty(y.SessionStartTimestamp)||0,i=Date.now(),s=i-r;return(!e||i-t>1e3*this._sessionExpirationTimeSeconds||s>1e3*this._sessionMaxLengthSeconds)&&(e=v(),this.setPersistedProperty(y.SessionId,e),this.setPersistedProperty(y.SessionStartTimestamp,i)),this.setPersistedProperty(y.SessionLastTimestamp,i),e}resetSessionId(){this.wrap((()=>{this.setPersistedProperty(y.SessionId,null),this.setPersistedProperty(y.SessionLastTimestamp,null),this.setPersistedProperty(y.SessionStartTimestamp,null)}))}getAnonymousId(){if(!this._isInitialized)return"";var e=this.getPersistedProperty(y.AnonymousId);return e||(e=v(),this.setPersistedProperty(y.AnonymousId,e)),e}getDistinctId(){return this._isInitialized?this.getPersistedProperty(y.DistinctId)||this.getAnonymousId():""}registerForSession(e){this.sessionProps=r({},this.sessionProps,e)}unregisterForSession(e){delete this.sessionProps[e]}identify(e,t,i){this.wrap((()=>{var s=this.getDistinctId();e=e||s,null!=t&&t.$groups&&this.groups(t.$groups);var n=null==t?void 0:t.$set_once;null==t||delete t.$set_once;var o=(null==t?void 0:t.$set)||t,a=this.enrichProperties(r({$anon_distinct_id:this.getAnonymousId()},ie("$set",o),ie("$set_once",n)));e!==s&&(this.setPersistedProperty(y.AnonymousId,s),this.setPersistedProperty(y.DistinctId,e),this.reloadFeatureFlags()),super.identifyStateless(e,a,i)}))}capture(e,t,r){this.wrap((()=>{var i=this.getDistinctId();null!=t&&t.$groups&&this.groups(t.$groups);var s=this.enrichProperties(t);super.captureStateless(i,e,s,r)}))}alias(e){this.wrap((()=>{var t=this.getDistinctId(),r=this.enrichProperties({});super.aliasStateless(e,t,r)}))}autocapture(e,t,i,s){void 0===i&&(i={}),this.wrap((()=>{var n={distinct_id:this.getDistinctId(),event:"$autocapture",properties:r({},this.enrichProperties(i),{$event_type:e,$elements:t})};this.enqueue("autocapture",n,s)}))}groups(e){this.wrap((()=>{var t=this.props.$groups||{};this.register({$groups:r({},t,e)}),Object.keys(e).find((r=>t[r]!==e[r]))&&this.reloadFeatureFlags()}))}group(e,t,r,i){this.wrap((()=>{this.groups({[e]:t}),r&&this.groupIdentify(e,t,r,i)}))}groupIdentify(e,t,r,i){this.wrap((()=>{var s=this.getDistinctId(),n=this.enrichProperties({});super.groupIdentifyStateless(e,t,r,i,s,n)}))}setPersonPropertiesForFlags(e){this.wrap((()=>{var t=this.getPersistedProperty(y.PersonProperties)||{};this.setPersistedProperty(y.PersonProperties,r({},t,e))}))}resetPersonPropertiesForFlags(){this.wrap((()=>{this.setPersistedProperty(y.PersonProperties,null)}))}setGroupPropertiesForFlags(e){this.wrap((()=>{var t=this.getPersistedProperty(y.GroupProperties)||{};0!==Object.keys(t).length&&Object.keys(t).forEach((i=>{t[i]=r({},t[i],e[i]),delete e[i]})),this.setPersistedProperty(y.GroupProperties,r({},t,e))}))}resetGroupPropertiesForFlags(){this.wrap((()=>{this.setPersistedProperty(y.GroupProperties,null)}))}remoteConfigAsync(){var e=this;return t((function*(){return yield e._initPromise,e._remoteConfigResponsePromise?e._remoteConfigResponsePromise:e._remoteConfigAsync()}))()}flagsAsync(e,r){var i=this;return t((function*(){return void 0===e&&(e=!0),void 0===r&&(r=!0),yield i._initPromise,i._flagsResponsePromise?i._flagsResponsePromise:i._flagsAsync(e,r)}))()}cacheSessionReplay(e,t){var r=null==t?void 0:t.sessionRecording;r?(this.setPersistedProperty(y.SessionReplay,r),this._logger.info("Session replay config from "+e+": ",JSON.stringify(r))):"boolean"==typeof r&&!1===r&&(this._logger.info("Session replay config from "+e+" disabled."),this.setPersistedProperty(y.SessionReplay,null))}_remoteConfigAsync(){var e=()=>super.getRemoteConfig,i=this;return t((function*(){return i._remoteConfigResponsePromise=i._initPromise.then((()=>{var t=i.getPersistedProperty(y.RemoteConfig);return i._logger.info("Cached remote config: ",JSON.stringify(t)),e().call(i).then((e=>{if(e){var s,n=r({},e);if(delete n.surveys,i._logger.info("Fetched remote config: ",JSON.stringify(n)),!1===i.disableSurveys){var o=e.surveys,a=!0;Array.isArray(o)?i._logger.info("Surveys fetched from remote config: ",JSON.stringify(o)):(i._logger.info("There are no surveys."),a=!1),a?i.setPersistedProperty(y.Surveys,o):i.setPersistedProperty(y.Surveys,null)}else i.setPersistedProperty(y.Surveys,null);i.setPersistedProperty(y.RemoteConfig,n),i.cacheSessionReplay("remote config",e),!1===e.hasFeatureFlags?(i.setKnownFeatureFlagDetails({flags:{}}),i._logger.warn("Remote config has no feature flags, will not load feature flags.")):!1!==i.preloadFeatureFlags&&i.reloadFeatureFlags(),null!=(s=e.supportedCompression)&&s.includes(b.GZipJS)||(i.disableCompression=!0),t=e}return t}))})).finally((()=>{i._remoteConfigResponsePromise=void 0})),i._remoteConfigResponsePromise}))()}_flagsAsync(e,i){var s=()=>super.getFlags,n=this;return t((function*(){return void 0===e&&(e=!0),void 0===i&&(i=!0),n._flagsResponsePromise=n._initPromise.then(t((function*(){var t,o=n.getDistinctId(),a=n.props.$groups||{},l=n.getPersistedProperty(y.PersonProperties)||{},u=n.getPersistedProperty(y.GroupProperties)||{},c={$anon_distinct_id:e?n.getAnonymousId():void 0},d=yield s().call(n,o,a,l,u,c,i);if(null!=d&&null!=(t=d.quotaLimited)&&t.includes(le.FeatureFlags))return n.setKnownFeatureFlagDetails(null),console.warn("[FEATURE FLAGS] Feature flags quota limit exceeded - unsetting all flags. Learn more about billing limits at https://posthog.com/docs/billing/limits-alerts"),d;if(null!=d&&d.featureFlags){n.sendFeatureFlagEvent&&(n.flagCallReported={});var h=d;if(d.errorsWhileComputingFlags){var g=n.getKnownFeatureFlagDetails();n._logger.info("Cached feature flags: ",JSON.stringify(g)),h=r({},d,{flags:r({},null==g?void 0:g.flags,d.flags)})}n.setKnownFeatureFlagDetails(h),n.setPersistedProperty(y.FlagsEndpointWasHit,!0),n.cacheSessionReplay("flags",d)}return d}))).finally((()=>{n._flagsResponsePromise=void 0})),n._flagsResponsePromise}))()}setKnownFeatureFlagDetails(e){this.wrap((()=>{var t;this.setPersistedProperty(y.FeatureFlagDetails,e),this._events.emit("featureflags",n(null!==(t=null==e?void 0:e.flags)&&void 0!==t?t:{}))}))}getKnownFeatureFlagDetails(){var e=this.getPersistedProperty(y.FeatureFlagDetails);if(!e){var t=this.getPersistedProperty(y.FeatureFlags),r=this.getPersistedProperty(y.FeatureFlagPayloads);if(void 0===t&&void 0===r)return;return u(null!=t?t:{},null!=r?r:{})}return i(e)}getKnownFeatureFlags(){var e=this.getKnownFeatureFlagDetails();if(e)return n(e.flags)}getKnownFeatureFlagPayloads(){var e=this.getKnownFeatureFlagDetails();if(e)return o(e.flags)}getBootstrappedFeatureFlagDetails(){var e=this.getPersistedProperty(y.BootstrapFeatureFlagDetails);if(e)return e}setBootstrappedFeatureFlagDetails(e){this.setPersistedProperty(y.BootstrapFeatureFlagDetails,e)}getBootstrappedFeatureFlags(){var e=this.getBootstrappedFeatureFlagDetails();if(e)return n(e.flags)}getBootstrappedFeatureFlagPayloads(){var e=this.getBootstrappedFeatureFlagDetails();if(e)return o(e.flags)}getFeatureFlag(e){var t=this.getFeatureFlagDetails();if(t){var i=t.flags[e],s=a(i);if(void 0===s&&(s=!1),this.sendFeatureFlagEvent&&!this.flagCallReported[e]){var n,o,l,u,c,d,h,g=null==(n=this.getBootstrappedFeatureFlags())?void 0:n[e],p=null==(o=this.getBootstrappedFeatureFlagPayloads())?void 0:o[e];this.flagCallReported[e]=!0,this.capture("$feature_flag_called",r({$feature_flag:e,$feature_flag_response:s},ie("$feature_flag_id",null==i||null==(l=i.metadata)?void 0:l.id),ie("$feature_flag_version",null==i||null==(u=i.metadata)?void 0:u.version),ie("$feature_flag_reason",null!==(c=null==i||null==(d=i.reason)?void 0:d.description)&&void 0!==c?c:null==i||null==(h=i.reason)?void 0:h.code),ie("$feature_flag_bootstrapped_response",g),ie("$feature_flag_bootstrapped_payload",p),{$used_bootstrap_value:!this.getPersistedProperty(y.FlagsEndpointWasHit)},ie("$feature_flag_request_id",t.requestId)))}return s}}getFeatureFlagPayload(e){var t=this.getFeatureFlagPayloads();if(t){var r=t[e];return void 0===r?null:r}}getFeatureFlagPayloads(){var e;return null==(e=this.getFeatureFlagDetails())?void 0:e.featureFlagPayloads}getFeatureFlags(){var e;return null==(e=this.getFeatureFlagDetails())?void 0:e.featureFlags}getFeatureFlagDetails(){var e,t=this.getKnownFeatureFlagDetails(),s=this.getPersistedProperty(y.OverrideFeatureFlags);if(!s)return t;var n,o,a=null!==(e=(t=null!=t?t:{featureFlags:{},featureFlagPayloads:{},flags:{}}).flags)&&void 0!==e?e:{};for(var l in s)s[l]?a[l]=(n=a[l],o=s[l],r({},n,{enabled:c(o),variant:d(o)})):delete a[l];var u=r({},t,{flags:a});return i(u)}getFeatureFlagsAndPayloads(){return{flags:this.getFeatureFlags(),payloads:this.getFeatureFlagPayloads()}}isFeatureEnabled(e){var t=this.getFeatureFlag(e);if(void 0!==t)return!!t}reloadFeatureFlags(e){this.flagsAsync(!0).then((t=>{null==e||null==e.cb||e.cb(void 0,null==t?void 0:t.featureFlags)})).catch((t=>{null==e||null==e.cb||e.cb(t,void 0),null!=e&&e.cb||this._logger.info("Error reloading feature flags",t)}))}reloadRemoteConfigAsync(){var e=this;return t((function*(){return yield e.remoteConfigAsync()}))()}reloadFeatureFlagsAsync(e){var r=this;return t((function*(){var t;return null==(t=yield r.flagsAsync(null==e||e))?void 0:t.featureFlags}))()}onFeatureFlags(e){var r=this;return this.on("featureflags",t((function*(){var t=r.getFeatureFlags();t&&e(t)})))}onFeatureFlag(e,r){var i=this;return this.on("featureflags",t((function*(){var t=i.getFeatureFlag(e);void 0!==t&&r(t)})))}overrideFeatureFlag(e){var r=this;return t((function*(){r.wrap((()=>null===e?r.setPersistedProperty(y.OverrideFeatureFlags,null):r.setPersistedProperty(y.OverrideFeatureFlags,e)))}))()}captureException(e,t){var i=r({$exception_level:"error",$exception_list:[{type:U(e)?e.name:"Error",value:U(e)?e.message:e,mechanism:{handled:!0,synthetic:!1}}]},t);this.capture("$exception",i)}captureTraceFeedback(e,t){this.capture("$ai_feedback",{$ai_feedback_text:t,$ai_trace_id:String(e)})}captureTraceMetric(e,t,r){this.capture("$ai_metric",{$ai_metric_name:t,$ai_metric_value:String(r),$ai_trace_id:String(e)})}}var de={},he=Array.prototype,ge=he.forEach,pe=he.indexOf,_e="undefined"!=typeof window?window:void 0,fe="undefined"!=typeof globalThis?globalThis:_e,ve=null==fe?void 0:fe.navigator,me=null==fe?void 0:fe.document,ye=null==fe?void 0:fe.location;null==fe||fe.fetch,null!=fe&&fe.XMLHttpRequest&&"withCredentials"in new fe.XMLHttpRequest&&fe.XMLHttpRequest,null==fe||fe.AbortController;var be=null==ve?void 0:ve.userAgent,we=null!=_e?_e:{};function Pe(e,t,r){if(k(e))if(ge&&e.forEach===ge)e.forEach(t,r);else if("length"in e&&e.length===+e.length)for(var i=0,s=e.length;i<s;i++)if(i in e&&t.call(r,e[i],i)===de)return}function Se(e,t,r){if(!M(e)){if(k(e))return Pe(e,t,r);if(j(e)){for(var i of e.entries())if(t.call(r,i[1],i[0])===de)return}else for(var s in e)if(x.call(e,s)&&t.call(r,e[s],s)===de)return}}var Ie=function(e){for(var t=arguments.length,r=new Array(t>1?t-1:0),i=1;i<t;i++)r[i-1]=arguments[i];return Pe(r,(function(t){for(var r in t)void 0!==t[r]&&(e[r]=t[r])})),e},Fe=function(e){for(var t=arguments.length,r=new Array(t>1?t-1:0),i=1;i<t;i++)r[i-1]=arguments[i];return Pe(r,(function(t){Pe(t,(function(t){e.push(t)}))})),e};function xe(e){for(var t=Object.keys(e),r=t.length,i=new Array(r);r--;)i[r]=[t[r],e[t[r]]];return i}function Ee(e,t,r,i){var{capture:s=!1,passive:n=!0}=null!=i?i:{};null==e||e.addEventListener(t,r,{capture:s,passive:n})}var ke=function(e){var t={};return Se(e,(function(e,r){(T(e)&&e.length>0||D(e))&&(t[r]=e)})),t},Ce=["herokuapp.com","vercel.app","netlify.app"];function Re(e){var t=null==e?void 0:e.hostname;if(!T(t))return!1;var r=t.split(".").slice(-2).join(".");for(var i of Ce)if(r===i)return!1;return!0}function $e(e,t){return r=e,i=e=>T(e)&&!L(t)?e.slice(0,t):e,s=new Set,function e(t,r){return t!==Object(t)?i?i(t,r):t:s.has(t)?void 0:(s.add(t),k(t)?(n=[],Pe(t,(t=>{n.push(e(t))}))):(n={},Se(t,((t,r)=>{s.has(t)||(n[r]=e(t,r))}))),n);var n}(r);var r,i,s}var Ae="__timers",Oe="$autocapture_disabled_server_side",Te="$session_recording_remote_config",Le="$sesid",Me="$session_is_sampled",De="$enabled_feature_flags",Ne="$user_state",je="$client_session_props",Ue="$initial_campaign_params",ze="$initial_referrer_info",qe="$initial_person_info",Be="$epp",He=["$people_distinct_id","__alias","__cmpns",Ae,"$session_recording_enabled_server_side","$heatmaps_enabled_server_side",Le,De,"$error_tracking_suppression_rules",Ne,"$early_access_features","$feature_flag_details","$stored_group_properties","$stored_person_properties","$surveys","$flag_call_reported",je,"$capture_rate_limit",Ue,ze,Be,qe,y.Queue,y.FeatureFlagDetails,y.FlagsEndpointWasHit,y.AnonymousId,y.RemoteConfig,y.Surveys,y.FeatureFlags],Ge="[Leanbase]",Ve={info:function(){if("undefined"!=typeof console){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];console.log(Ge,...t)}},warn:function(){if("undefined"!=typeof console){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];console.warn(Ge,...t)}},error:function(){if("undefined"!=typeof console){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];console.error(Ge,...t)}},critical:function(){if("undefined"!=typeof console){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];console.error(Ge,"CRITICAL:",...t)}}};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});var Ke="0123456789abcdef";class We{constructor(e){if(this.bytes=e,16!==e.length)throw new TypeError("not 128-bit length")}static fromFieldsV7(e,t,r,i){if(!Number.isInteger(e)||!Number.isInteger(t)||!Number.isInteger(r)||!Number.isInteger(i)||e<0||t<0||r<0||i<0||e>0xffffffffffff||t>4095||r>1073741823||i>4294967295)throw new RangeError("invalid field value");var s=new Uint8Array(16);return s[0]=e/Math.pow(2,40),s[1]=e/Math.pow(2,32),s[2]=e/Math.pow(2,24),s[3]=e/Math.pow(2,16),s[4]=e/Math.pow(2,8),s[5]=e,s[6]=112|t>>>8,s[7]=t,s[8]=128|r>>>24,s[9]=r>>>16,s[10]=r>>>8,s[11]=r,s[12]=i>>>24,s[13]=i>>>16,s[14]=i>>>8,s[15]=i,new We(s)}toString(){for(var e="",t=0;t<this.bytes.length;t++)e=e+Ke.charAt(this.bytes[t]>>>4)+Ke.charAt(15&this.bytes[t]),3!==t&&5!==t&&7!==t&&9!==t||(e+="-");if(36!==e.length)throw new Error("Invalid UUIDv7 was generated");return e}clone(){return new We(this.bytes.slice(0))}equals(e){return 0===this.compareTo(e)}compareTo(e){for(var t=0;t<16;t++){var r=this.bytes[t]-e.bytes[t];if(0!==r)return Math.sign(r)}return 0}}class Je{constructor(){this._timestamp=0,this._counter=0,this._random=new Xe}generate(){var e=this.generateOrAbort();if(O(e)){this._timestamp=0;var t=this.generateOrAbort();if(O(t))throw new Error("Could not generate UUID after timestamp reset");return t}return e}generateOrAbort(){var e=Date.now();if(e>this._timestamp)this._timestamp=e,this._resetCounter();else{if(!(e+1e4>this._timestamp))return;this._counter++,this._counter>4398046511103&&(this._timestamp++,this._resetCounter())}return We.fromFieldsV7(this._timestamp,Math.trunc(this._counter/Math.pow(2,30)),this._counter&Math.pow(2,30)-1,this._random.nextUint32())}_resetCounter(){this._counter=1024*this._random.nextUint32()+(1023&this._random.nextUint32())}}var Qe,Ye=e=>{if("undefined"!=typeof UUIDV7_DENY_WEAK_RNG&&UUIDV7_DENY_WEAK_RNG)throw new Error("no cryptographically strong RNG available");for(var t=0;t<e.length;t++)e[t]=65536*Math.trunc(65536*Math.random())+Math.trunc(65536*Math.random());return e};_e&&!O(_e.crypto)&&crypto.getRandomValues&&(Ye=e=>crypto.getRandomValues(e));class Xe{constructor(){this._buffer=new Uint32Array(8),this._cursor=1/0}nextUint32(){return this._cursor>=this._buffer.length&&(Ye(this._buffer),this._cursor=0),this._buffer[this._cursor++]}}var Ze=()=>et().toString(),et=()=>(Qe||(Qe=new Je)).generate(),tt="";var rt=/[a-z0-9][a-z0-9-]+\.[a-z]{2,}$/i;function it(e,t){if(t){var r=function(e,t){if(void 0===t&&(t=me),tt)return tt;if(!t)return"";if(["localhost","127.0.0.1"].includes(e))return"";for(var r=e.split("."),i=Math.min(r.length,8),s="dmn_chk_"+Ze();!tt&&i--;){var n=r.slice(i).join("."),o=s+"=1;domain=."+n+";path=/";t.cookie=o+";max-age=3",t.cookie.includes(s)&&(t.cookie=o+";max-age=0",tt=n)}return tt}(e);if(!r){var i=(e=>{var t=e.match(rt);return t?t[0]:""})(e);i!==r&&Ve.info("Warning: cookie subdomain discovery mismatch",i,r),r=i}return r?"; domain=."+r:""}return""}var st={_is_supported:()=>!!me,_error:function(e){Ve.error("cookieStore error: "+e)},_get:function(e){if(me){try{for(var t=e+"=",r=me.cookie.split(";").filter((e=>e.length)),i=0;i<r.length;i++){for(var s=r[i];" "==s.charAt(0);)s=s.substring(1,s.length);if(0===s.indexOf(t))return decodeURIComponent(s.substring(t.length,s.length))}}catch(e){}return null}},_parse:function(e){var t;try{t=JSON.parse(st._get(e))||{}}catch(e){}return t},_set:function(e,t,r,i,s){if(me)try{var n="",o="",a=it(me.location.hostname,i);if(r){var l=new Date;l.setTime(l.getTime()+24*r*60*60*1e3),n="; expires="+l.toUTCString()}s&&(o="; secure");var u=e+"="+encodeURIComponent(JSON.stringify(t))+n+"; SameSite=Lax; path=/"+a+o;return u.length>3686.4&&Ve.warn("cookieStore warning: large cookie, len="+u.length),me.cookie=u,u}catch(e){return}},_remove:function(e,t){if(null!=me&&me.cookie)try{st._set(e,"",-1,t)}catch(e){return}}},nt=null,ot={_is_supported:function(){if(!L(nt))return nt;var e=!0;if(O(_e))e=!1;else try{var t="__mplssupport__";ot._set(t,"xyz"),'"xyz"'!==ot._get(t)&&(e=!1),ot._remove(t)}catch(t){e=!1}return e||Ve.error("localStorage unsupported; falling back to cookie store"),nt=e,e},_error:function(e){Ve.error("localStorage error: "+e)},_get:function(e){try{return null==_e?void 0:_e.localStorage.getItem(e)}catch(e){ot._error(e)}return null},_parse:function(e){try{return JSON.parse(ot._get(e))||{}}catch(e){}return null},_set:function(e,t){try{null==_e||_e.localStorage.setItem(e,JSON.stringify(t))}catch(e){ot._error(e)}},_remove:function(e){try{null==_e||_e.localStorage.removeItem(e)}catch(e){ot._error(e)}}},at=["distinct_id",Le,Me,Be,qe],lt=r({},ot,{_parse:function(e){try{var t={};try{t=st._parse(e)||{}}catch(e){}var r=Ie(t,JSON.parse(ot._get(e)||"{}"));return ot._set(e,r),r}catch(e){}return null},_set:function(e,t,r,i,s,n){try{ot._set(e,t,void 0,void 0,n);var o={};at.forEach((e=>{t[e]&&(o[e]=t[e])})),Object.keys(o).length&&st._set(e,o,r,i,s,n)}catch(e){ot._error(e)}},_remove:function(e,t){try{null==_e||_e.localStorage.removeItem(e),st._remove(e,t)}catch(e){ot._error(e)}}}),ut={},ct={_is_supported:function(){return!0},_error:function(e){Ve.error("memoryStorage error: "+e)},_get:function(e){return ut[e]||null},_parse:function(e){return ut[e]||null},_set:function(e,t){ut[e]=t},_remove:function(e){delete ut[e]}},dt=null,ht={_is_supported:function(){if(!L(dt))return dt;if(dt=!0,O(_e))dt=!1;else try{var e="__support__";ht._set(e,"xyz"),'"xyz"'!==ht._get(e)&&(dt=!1),ht._remove(e)}catch(e){dt=!1}return dt},_error:function(e){Ve.error("sessionStorage error: ",e)},_get:function(e){try{return null==_e?void 0:_e.sessionStorage.getItem(e)}catch(e){ht._error(e)}return null},_parse:function(e){try{return JSON.parse(ht._get(e))||null}catch(e){}return null},_set:function(e,t){try{null==_e||_e.sessionStorage.setItem(e,JSON.stringify(t))}catch(e){ht._error(e)}},_remove:function(e){try{null==_e||_e.sessionStorage.removeItem(e)}catch(e){ht._error(e)}}},gt=e=>{var t=null==me?void 0:me.createElement("a");return O(t)?null:(t.href=e,t)},pt=function(e,t){for(var r,i=((e.split("#")[0]||"").split(/\?(.*)/)[1]||"").replace(/^\?+/g,"").split("&"),s=0;s<i.length;s++){var n=i[s].split("=");if(n[0]===t){r=n;break}}if(!k(r)||r.length<2)return"";var o=r[1];try{o=decodeURIComponent(o)}catch(e){Ve.error("Skipping decoding for malformed query param: "+o)}return o.replace(/\+/g," ")},_t=function(e,t,r){if(!e||!t||!t.length)return e;for(var i=e.split("#"),s=i[0]||"",n=i[1],o=s.split("?"),a=o[1],l=o[0],u=(a||"").split("&"),c=[],d=0;d<u.length;d++){var h=u[d].split("=");k(h)&&(t.includes(h[0])?c.push(h[0]+"="+r):c.push(u[d]))}var g=l;return null!=a&&(g+="?"+c.join("&")),null!=n&&(g+="#"+n),g},ft="Mobile",vt="iOS",mt="Android",yt="Tablet",bt=mt+" "+yt,wt="iPad",Pt="Apple",St=Pt+" Watch",It="Safari",Ft="BlackBerry",xt="Samsung",Et=xt+"Browser",kt=xt+" Internet",Ct="Chrome",Rt=Ct+" OS",$t=Ct+" "+vt,At="Internet Explorer",Ot=At+" "+ft,Tt="Opera",Lt=Tt+" Mini",Mt="Edge",Dt="Microsoft "+Mt,Nt="Firefox",jt=Nt+" "+vt,Ut="Nintendo",zt="PlayStation",qt="Xbox",Bt=mt+" "+ft,Ht=ft+" "+It,Gt="Windows",Vt=Gt+" Phone",Kt="Nokia",Wt="Ouya",Jt="Generic",Qt=Jt+" "+ft.toLowerCase(),Yt=Jt+" "+yt.toLowerCase(),Xt="Konqueror",Zt="(\\d+(\\.\\d+)?)",er=new RegExp("Version/"+Zt),tr=new RegExp(qt,"i"),rr=new RegExp(zt+" \\w+","i"),ir=new RegExp(Ut+" \\w+","i"),sr=new RegExp(Ft+"|PlayBook|BB10","i"),nr={"NT3.51":"NT 3.11","NT4.0":"NT 4.0","5.0":"2000",5.1:"XP",5.2:"XP","6.0":"Vista",6.1:"7",6.2:"8",6.3:"8.1",6.4:"10","10.0":"10"};var or=(e,t)=>t&&w(t,Pt)||function(e){return w(e,It)&&!w(e,Ct)&&!w(e,mt)}(e),ar=function(e,t){return t=t||"",w(e," OPR/")&&w(e,"Mini")?Lt:w(e," OPR/")?Tt:sr.test(e)?Ft:w(e,"IE"+ft)||w(e,"WPDesktop")?Ot:w(e,Et)?kt:w(e,Mt)||w(e,"Edg/")?Dt:w(e,"FBIOS")?"Facebook "+ft:w(e,"UCWEB")||w(e,"UCBrowser")?"UC Browser":w(e,"CriOS")?$t:w(e,"CrMo")||w(e,Ct)?Ct:w(e,mt)&&w(e,It)?Bt:w(e,"FxiOS")?jt:w(e.toLowerCase(),Xt.toLowerCase())?Xt:or(e,t)?w(e,ft)?Ht:It:w(e,Nt)?Nt:w(e,"MSIE")||w(e,"Trident/")?At:w(e,"Gecko")?Nt:""},lr={[Ot]:[new RegExp("rv:"+Zt)],[Dt]:[new RegExp(Mt+"?\\/"+Zt)],[Ct]:[new RegExp("("+Ct+"|CrMo)\\/"+Zt)],[$t]:[new RegExp("CriOS\\/"+Zt)],"UC Browser":[new RegExp("(UCBrowser|UCWEB)\\/"+Zt)],[It]:[er],[Ht]:[er],[Tt]:[new RegExp("(Opera|OPR)\\/"+Zt)],[Nt]:[new RegExp(Nt+"\\/"+Zt)],[jt]:[new RegExp("FxiOS\\/"+Zt)],[Xt]:[new RegExp("Konqueror[:/]?"+Zt,"i")],[Ft]:[new RegExp(Ft+" "+Zt),er],[Bt]:[new RegExp("android\\s"+Zt,"i")],[kt]:[new RegExp(Et+"\\/"+Zt)],[At]:[new RegExp("(rv:|MSIE )"+Zt)],Mozilla:[new RegExp("rv:"+Zt)]},ur=function(e,t){var r=ar(e,t),i=lr[r];if(O(i))return null;for(var s=0;s<i.length;s++){var n=i[s],o=e.match(n);if(o)return parseFloat(o[o.length-2])}return null},cr=[[new RegExp(qt+"; "+qt+" (.*?)[);]","i"),e=>[qt,e&&e[1]||""]],[new RegExp(Ut,"i"),[Ut,""]],[new RegExp(zt,"i"),[zt,""]],[sr,[Ft,""]],[new RegExp(Gt,"i"),(e,t)=>{if(/Phone/.test(t)||/WPDesktop/.test(t))return[Vt,""];if(new RegExp(ft).test(t)&&!/IEMobile\b/.test(t))return[Gt+" "+ft,""];var r=/Windows NT ([0-9.]+)/i.exec(t);if(r&&r[1]){var i=r[1],s=nr[i]||"";return/arm/i.test(t)&&(s="RT"),[Gt,s]}return[Gt,""]}],[/((iPhone|iPad|iPod).*?OS (\d+)_(\d+)_?(\d+)?|iPhone)/,e=>{if(e&&e[3]){var t=[e[3],e[4],e[5]||"0"];return[vt,t.join(".")]}return[vt,""]}],[/(watch.*\/(\d+\.\d+\.\d+)|watch os,(\d+\.\d+),)/i,e=>{var t="";return e&&e.length>=3&&(t=O(e[2])?e[3]:e[2]),["watchOS",t]}],[new RegExp("("+mt+" (\\d+)\\.(\\d+)\\.?(\\d+)?|"+mt+")","i"),e=>{if(e&&e[2]){var t=[e[2],e[3],e[4]||"0"];return[mt,t.join(".")]}return[mt,""]}],[/Mac OS X (\d+)[_.](\d+)[_.]?(\d+)?/i,e=>{var t=["Mac OS X",""];if(e&&e[1]){var r=[e[1],e[2],e[3]||"0"];t[1]=r.join(".")}return t}],[/Mac/i,["Mac OS X",""]],[/CrOS/,[Rt,""]],[/Linux|debian/i,["Linux",""]]],dr=function(e){return ir.test(e)?Ut:rr.test(e)?zt:tr.test(e)?qt:new RegExp(Wt,"i").test(e)?Wt:new RegExp("("+Vt+"|WPDesktop)","i").test(e)?Vt:/iPad/.test(e)?wt:/iPod/.test(e)?"iPod Touch":/iPhone/.test(e)?"iPhone":/(watch)(?: ?os[,/]|\d,\d\/)[\d.]+/i.test(e)?St:sr.test(e)?Ft:/(kobo)\s(ereader|touch)/i.test(e)?"Kobo":new RegExp(Kt,"i").test(e)?Kt:/(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(ft).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)?mt:bt:mt:new RegExp("(pda|"+ft+")","i").test(e)?Qt:new RegExp(yt,"i").test(e)&&!new RegExp(yt+" pc","i").test(e)?Yt:""},hr={LIB_VERSION:"0.2.2-alpha.0"},gr="https?://(.*)",pr=["gclid","gclsrc","dclid","gbraid","wbraid","fbclid","msclkid","twclid","li_fat_id","igshid","ttclid","rdt_cid","epik","qclid","sccid","irclid","_kx"],_r=Fe(["utm_source","utm_medium","utm_campaign","utm_content","utm_term","gad_source","mc_cid"],pr),fr="<masked>",vr=["li_fat_id"];function mr(e,t,r){if(!me)return{};var i,s=t?Fe([],pr,r||[]):[],n=yr(_t(me.URL,s,fr),e),o=(i={},Se(vr,(function(e){var t=st._get(e);i[e]=t||null})),i);return Ie(o,n)}function yr(e,t){var r=_r.concat(t||[]),i={};return Se(r,(function(t){var r=pt(e,t);i[t]=r||null})),i}function br(e){var t=function(e){return e?0===e.search(gr+"google.([^/?]*)")?"google":0===e.search(gr+"bing.com")?"bing":0===e.search(gr+"yahoo.com")?"yahoo":0===e.search(gr+"duckduckgo.com")?"duckduckgo":null:null}(e),r="yahoo"!=t?"q":"p",i={};if(!L(t)){i.$search_engine=t;var s=me?pt(me.referrer,r):"";s.length&&(i.ph_keyword=s)}return i}function wr(){return navigator.language||navigator.userLanguage}function Pr(){return(null==me?void 0:me.referrer)||"$direct"}function Sr(e,t){var r=e?Fe([],pr,t||[]):[],i=null==ye?void 0:ye.href.substring(0,1e3);return{r:Pr().substring(0,1e3),u:i?_t(i,r,fr):void 0}}function Ir(e){var t,{r:r,u:i}=e,s={$referrer:r,$referring_domain:null==r?void 0:"$direct"==r?"$direct":null==(t=gt(r))?void 0:t.host};if(i){s.$current_url=i;var n=gt(i);s.$host=null==n?void 0:n.host,s.$pathname=null==n?void 0:n.pathname;var o=yr(i);Ie(s,o)}if(r){var a=br(r);Ie(s,a)}return s}function Fr(){try{return Intl.DateTimeFormat().resolvedOptions().timeZone}catch(e){return}}function xr(){try{return(new Date).getTimezoneOffset()}catch(e){return}}function Er(e,t){if(!be)return{};var r,i,s,n=e?Fe([],pr,t||[]):[],[o,a]=function(e){for(var t=0;t<cr.length;t++){var[r,i]=cr[t],s=r.exec(e),n=s&&(C(i)?i(s,e):i);if(n)return n}return["",""]}(be);return Ie(ke({$os:o,$os_version:a,$browser:ar(be,navigator.vendor),$device:dr(be),$device_type:(i=be,s=dr(i),s===wt||s===bt||"Kobo"===s||"Kindle Fire"===s||s===Yt?yt:s===Ut||s===qt||s===zt||s===Wt?"Console":s===St?"Wearable":s?ft:"Desktop"),$timezone:Fr(),$timezone_offset:xr()}),{$current_url:_t(null==ye?void 0:ye.href,n,fr),$host:null==ye?void 0:ye.host,$pathname:null==ye?void 0:ye.pathname,$raw_user_agent:be.length>1e3?be.substring(0,997)+"...":be,$browser_version:ur(be,navigator.vendor),$browser_language:wr(),$browser_language_prefix:(r=wr(),"string"==typeof r?r.split("-")[0]:void 0),$screen_height:null==_e?void 0:_e.screen.height,$screen_width:null==_e?void 0:_e.screen.width,$viewport_height:null==_e?void 0:_e.innerHeight,$viewport_width:null==_e?void 0:_e.innerWidth,$lib:"web",$lib_version:hr.LIB_VERSION,$insert_id:Math.random().toString(36).substring(2,10)+Math.random().toString(36).substring(2,10),$time:Date.now()/1e3})}var kr=["cookie","localstorage","localstorage+cookie","sessionstorage","memory"];class Cr{constructor(e,t){this._config=e,this.props={},this._campaign_params_saved=!1,this._name=(e=>{var t="";return e.token&&(t=e.token.replace(/\+/g,"PL").replace(/\//g,"SL").replace(/=/g,"EQ")),e.persistence_name?e.persistence_name:"leanbase_"+t})(e),this._storage=this._buildStorage(e),this.load(),e.debug&&Ve.info("Persistence loaded",e.persistence,r({},this.props)),this.update_config(e,e,t),this.save()}isDisabled(){return!!this._disabled}_buildStorage(e){-1===kr.indexOf(e.persistence.toLowerCase())&&(Ve.info("Unknown persistence type "+e.persistence+"; falling back to localStorage+cookie"),e.persistence="localStorage+cookie");var t=e.persistence.toLowerCase();return"localstorage"===t&&ot._is_supported()?ot:"localstorage+cookie"===t&<._is_supported()?lt:"sessionstorage"===t&&ht._is_supported()?ht:"memory"===t?ct:"cookie"===t?st:lt._is_supported()?lt:st}properties(){var e={};return Se(this.props,(function(t,r){if(r===De&&R(t))for(var i=Object.keys(t),s=0;s<i.length;s++)e["$feature/"+i[s]]=t[i[s]];else o=r,a=!1,(L(n=He)?a:pe&&n.indexOf===pe?-1!=n.indexOf(o):(Se(n,(function(e){if(a||(a=e===o))return de})),a))||(e[r]=t);var n,o,a})),e}load(){if(!this._disabled){var e=this._storage._parse(this._name);e&&(this.props=Ie({},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,r){if(R(e)){O(t)&&(t="None"),this._expire_days=O(r)?this._default_expiry:r;var i=!1;if(Se(e,((e,r)=>{this.props.hasOwnProperty(r)&&this.props[r]!==t||(this.props[r]=e,i=!0)})),i)return this.save(),!0}return!1}register(e,t){if(R(e)){this._expire_days=O(t)?this._default_expiry:t;var r=!1;if(Se(e,((t,i)=>{e.hasOwnProperty(i)&&this.props[i]!==t&&(this.props[i]=t,r=!0)})),r)return this.save(),!0}return!1}unregister(e){e in this.props&&(delete this.props[e],this.save())}update_campaign_params(){if(!this._campaign_params_saved){var e=mr(this._config.custom_campaign_params,this._config.mask_personal_data_properties,this._config.custom_personal_data_properties);A(ke(e))||this.register(e),this._campaign_params_saved=!0}}update_search_keyword(){var e;this.register((e=null==me?void 0:me.referrer)?br(e):{})}update_referrer_info(){var e;this.register_once({$referrer:Pr(),$referring_domain:null!=me&&me.referrer&&(null==(e=gt(me.referrer))?void 0:e.host)||"$direct"},void 0)}set_initial_person_info(){this.props[Ue]||this.props[ze]||this.register_once({[qe]:Sr(this._config.mask_personal_data_properties,this._config.custom_personal_data_properties)},void 0)}get_initial_props(){var e={};Se([ze,Ue],(t=>{var r=this.props[t];r&&Se(r,(function(t,r){e["$initial_"+S(r)]=t}))}));var t,r,i=this.props[qe];if(i){var s=(t=Ir(i),r={},Se(t,(function(e,t){r["$initial_"+S(t)]=e})),r);Ie(e,s)}return e}safe_merge(e){return Se(this.props,(function(t,r){r in e||(e[r]=t)})),e}update_config(e,t,r){if(this._default_expiry=this._expire_days=e.cookie_expiration,this.set_disabled(e.disable_persistence||!!r),this.set_cross_subdomain(e.cross_subdomain_cookie),this.set_secure(e.secure_cookie),e.persistence!==t.persistence){var i=this._buildStorage(e),s=this.props;this.clear(),this._storage=i,this.props=s,this.save()}}set_disabled(e){if(this._disabled=e,this._disabled)return this.remove();this.save()}set_cross_subdomain(e){e!==this._cross_subdomain&&(this._cross_subdomain=e,this.remove(),this.save())}set_secure(e){e!==this._secure&&(this._secure=e,this.remove(),this.save())}set_event_timer(e,t){var r=this.props[Ae]||{};r[e]=t,this.props[Ae]=r,this.save()}remove_event_timer(e){var t=(this.props[Ae]||{})[e];return O(t)||(delete this.props[Ae][e],this.save()),t}get_property(e){return this.props[e]}set_property(e,t){this.props[e]=t,this.save()}}function Rr(e){return!!e&&1===e.nodeType}function $r(e,t){return!!e&&!!e.tagName&&e.tagName.toLowerCase()===t.toLowerCase()}function Ar(e){return!!e&&3===e.nodeType}function Or(e){return!!e&&11===e.nodeType}function Tr(e){return e?P(e).split(/\s+/):[]}function Lr(e){var t,r=null==(t=window)?void 0:t.location.href;return!!(r&&e&&e.some((e=>r.match(e))))}function Mr(e){var t="";switch(typeof e.className){case"string":t=e.className;break;case"object":t=(e.className&&"baseVal"in e.className?e.className.baseVal:null)||e.getAttribute("class")||"";break;default:t=""}return Tr(t)}function Dr(e){return M(e)?null:P(e).split(/(\s+)/).filter((e=>ei(e))).join("").replace(/[\r\n]/g," ").replace(/[ ]+/g," ").substring(0,255)}function Nr(e){var t="";return Vr(e)&&!Kr(e)&&e.childNodes&&e.childNodes.length&&Se(e.childNodes,(function(e){var r;Ar(e)&&e.textContent&&(t+=null!==(r=Dr(e.textContent))&&void 0!==r?r:"")})),P(t)}var jr=["a","button","form","input","select","textarea","label"];function Ur(e,t){if(O(t))return!0;var r,i=function(e){if(t.some((t=>e.matches(t))))return{v:!0}};for(var s of e)if(r=i(s))return r.v;return!1}function zr(e){var t=e.parentNode;return!(!t||!Rr(t))&&t}var qr=[".ph-no-rageclick",".ph-no-capture"];var Br=e=>!e||$r(e,"html")||!Rr(e),Hr=(e,t)=>{if(!window||Br(e))return{parentIsUsefulElement:!1,targetElementList:[]};for(var r=!1,i=[e],s=e;s.parentNode&&!$r(s,"body");)if(Or(s.parentNode))i.push(s.parentNode.host),s=s.parentNode.host;else{var n=zr(s);if(!n)break;if(t||jr.indexOf(n.tagName.toLowerCase())>-1)r=!0;else{var o=window.getComputedStyle(n);o&&"pointer"===o.getPropertyValue("cursor")&&(r=!0)}i.push(n),s=n}return{parentIsUsefulElement:r,targetElementList:i}};function Gr(e,t,r,i,s){var n,o,a,l;if(void 0===r&&(r=void 0),!window||Br(e))return!1;if(null!=(n=r)&&n.url_allowlist&&!Lr(r.url_allowlist))return!1;if(null!=(o=r)&&o.url_ignorelist&&Lr(r.url_ignorelist))return!1;if(null!=(a=r)&&a.dom_event_allowlist){var u=r.dom_event_allowlist;if(u&&!u.some((e=>t.type===e)))return!1}var{parentIsUsefulElement:c,targetElementList:d}=Hr(e,i);if(!function(e,t){var r=null==t?void 0:t.element_allowlist;if(O(r))return!0;var i,s=function(e){if(r.some((t=>e.tagName.toLowerCase()===t)))return{v:!0}};for(var n of e)if(i=s(n))return i.v;return!1}(d,r))return!1;if(!Ur(d,null==(l=r)?void 0:l.css_selector_allowlist))return!1;var h=window.getComputedStyle(e);if(h&&"pointer"===h.getPropertyValue("cursor")&&"click"===t.type)return!0;var g=e.tagName.toLowerCase();switch(g){case"html":return!1;case"form":return(s||["submit"]).indexOf(t.type)>=0;case"input":case"select":case"textarea":return(s||["change","click"]).indexOf(t.type)>=0;default:return c?(s||["click"]).indexOf(t.type)>=0:(s||["click"]).indexOf(t.type)>=0&&(jr.indexOf(g)>-1||"true"===e.getAttribute("contenteditable"))}}function Vr(e){for(var t=e;t.parentNode&&!$r(t,"body");t=t.parentNode){var r=Mr(t);if(w(r,"ph-sensitive")||w(r,"ph-no-capture"))return!1}if(w(Mr(e),"ph-include"))return!0;var i=e.type||"";if(T(i))switch(i.toLowerCase()){case"hidden":case"password":return!1}var s=e.name||e.id||"";if(T(s)){if(/^cc|cardnum|ccnum|creditcard|csc|cvc|cvv|exp|pass|pwd|routing|seccode|securitycode|securitynum|socialsec|socsec|ssn/i.test(s.replace(/[^a-zA-Z0-9]/g,"")))return!1}return!0}function Kr(e){return!!($r(e,"input")&&!["button","checkbox","submit","reset"].includes(e.type)||$r(e,"select")||$r(e,"textarea")||"true"===e.getAttribute("contenteditable"))}var Wr="(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})",Jr=new RegExp("^(?:"+Wr+")$"),Qr=new RegExp(Wr),Yr="\\d{3}-?\\d{2}-?\\d{4}",Xr=new RegExp("^("+Yr+")$"),Zr=new RegExp("("+Yr+")");function ei(e,t){if(void 0===t&&(t=!0),M(e))return!1;if(T(e)){if(e=P(e),(t?Jr:Qr).test((e||"").replace(/[- ]/g,"")))return!1;if((t?Xr:Zr).test(e))return!1}return!0}function ti(e){var t=Nr(e);return ei(t=(t+" "+ri(e)).trim())?t:""}function ri(e){var t="";return e&&e.childNodes&&e.childNodes.length&&Se(e.childNodes,(function(e){var r;if(e&&"span"===(null==(r=e.tagName)?void 0:r.toLowerCase()))try{var i=Nr(e);t=(t+" "+i).trim(),e.childNodes&&e.childNodes.length&&(t=(t+" "+ri(e)).trim())}catch(e){Ve.error("[AutoCapture]",e)}})),t}function ii(e){return function(e){var t=e.map((e=>{var t,i,s="";if(e.tag_name&&(s+=e.tag_name),e.attr_class)for(var n of(e.attr_class.sort(),e.attr_class))s+="."+n.replace(/"/g,"");var o=r({},e.text?{text:e.text}:{},{"nth-child":null!==(t=e.nth_child)&&void 0!==t?t:0,"nth-of-type":null!==(i=e.nth_of_type)&&void 0!==i?i:0},e.href?{href:e.href}:{},e.attr_id?{attr_id:e.attr_id}:{},e.attributes),a={};return xe(o).sort(((e,t)=>{var[r]=e,[i]=t;return r.localeCompare(i)})).forEach((e=>{var[t,r]=e;return a[si(t.toString())]=si(r.toString())})),s+=":",s+=xe(a).map((e=>{var[t,r]=e;return t+'="'+r+'"'})).join("")}));return t.join(";")}(function(e){return e.map((e=>{var t,r,i={text:null==(t=e.$el_text)?void 0:t.slice(0,400),tag_name:e.tag_name,href:null==(r=e.attr__href)?void 0:r.slice(0,2048),attr_class:ni(e),attr_id:e.attr__id,nth_child:e.nth_child,nth_of_type:e.nth_of_type,attributes:{}};return xe(e).filter((e=>{var[t]=e;return 0===t.indexOf("attr__")})).forEach((e=>{var[t,r]=e;return i.attributes[t]=r})),i}))}(e))}function si(e){return e.replace(/"|\\"/g,'\\"')}function ni(e){var t=e.attr__class;return t?k(t)?t:Tr(t):void 0}class oi{constructor(){this.clicks=[]}isRageClick(e,t,r){var i=this.clicks[this.clicks.length-1];if(i&&Math.abs(e-i.x)+Math.abs(t-i.y)<30&&r-i.timestamp<1e3){if(this.clicks.push({x:e,y:t,timestamp:r}),3===this.clicks.length)return!0}else this.clicks=[{x:e,y:t,timestamp:r}];return!1}}var ai,li="$copy_autocapture";function ui(e,t){return t.length>e?t.slice(0,e)+"...":t}function ci(e){if(e.previousElementSibling)return e.previousElementSibling;var t=e;do{t=t.previousSibling}while(t&&!Rr(t));return t}function di(e,t,r,i){var s=e.tagName.toLowerCase(),n={tag_name:s};jr.indexOf(s)>-1&&!r&&("a"===s.toLowerCase()||"button"===s.toLowerCase()?n.$el_text=ui(1024,ti(e)):n.$el_text=ui(1024,Nr(e)));var o=Mr(e);o.length>0&&(n.classes=o.filter((function(e){return""!==e}))),Se(e.attributes,(function(r){var s;if((!Kr(e)||-1!==["name","id","class","aria-label"].indexOf(r.name))&&((null==i||!i.includes(r.name))&&!t&&ei(r.value)&&(s=r.name,!T(s)||"_ngcontent"!==s.substring(0,10)&&"_nghost"!==s.substring(0,7)))){var o=r.value;"class"===r.name&&(o=Tr(o).join(" ")),n["attr__"+r.name]=ui(1024,o)}}));for(var a=1,l=1,u=e;u=ci(u);)a++,u.tagName===e.tagName&&l++;return n.nth_child=a,n.nth_of_type=l,n}function hi(e,t){for(var r,i,{e:s,maskAllElementAttributes:n,maskAllText:o,elementAttributeIgnoreList:a,elementsChainAsString:l}=t,u=[e],c=e;c.parentNode&&!$r(c,"body");)Or(c.parentNode)?(u.push(c.parentNode.host),c=c.parentNode.host):(u.push(c.parentNode),c=c.parentNode);var d,h=[],g={},p=!1,_=!1;if(Se(u,(e=>{var t=Vr(e);"a"===e.tagName.toLowerCase()&&(p=e.getAttribute("href"),p=t&&p&&ei(p)&&p),w(Mr(e),"ph-no-capture")&&(_=!0),h.push(di(e,n,o,a));var r=function(e){if(!Vr(e))return{};var t={};return Se(e.attributes,(function(e){if(e.name&&0===e.name.indexOf("data-ph-capture-attribute")){var r=e.name.replace("data-ph-capture-attribute-",""),i=e.value;r&&i&&ei(i)&&(t[r]=i)}})),t}(e);Ie(g,r)})),_)return{props:{},explicitNoCapture:_};if(o||("a"===e.tagName.toLowerCase()||"button"===e.tagName.toLowerCase()?h[0].$el_text=ti(e):h[0].$el_text=Nr(e)),p){var f,v;h[0].attr__href=p;var m=null==(f=gt(p))?void 0:f.host,y=null==_e||null==(v=_e.location)?void 0:v.host;m&&y&&m!==y&&(d=p)}return{props:Ie({$event_type:s.type,$ce_version:1},l?{}:{$elements:h},{$elements_chain:ii(h)},null!=(r=h[0])&&r.$el_text?{$el_text:null==(i=h[0])?void 0:i.$el_text}:{},d&&"click"===s.type?{$external_click_url:d}:{},g)}}!function(e){e.GZipJS="gzip-js",e.Base64="base64"}(ai||(ai={}));class gi{constructor(e){this._initialized=!1,this._isDisabledServerSide=null,this.rageclicks=new oi,this._elementsChainAsString=!1,this.instance=e,this._elementSelectors=null}get _config(){var e,t,r=R(this.instance.config.autocapture)?this.instance.config.autocapture:{};return r.url_allowlist=null==(e=r.url_allowlist)?void 0:e.map((e=>new RegExp(e))),r.url_ignorelist=null==(t=r.url_ignorelist)?void 0:t.map((e=>new RegExp(e))),r}_addDomEventHandlers(){if(this.isBrowserSupported()){if(_e&&me){var e=e=>{e=e||(null==_e?void 0:_e.event);try{this._captureEvent(e)}catch(e){Ve.error("Failed to capture event",e)}};if(Ee(me,"submit",e,{capture:!0}),Ee(me,"change",e,{capture:!0}),Ee(me,"click",e,{capture:!0}),this._config.capture_copied_text){var t=e=>{e=e||(null==_e?void 0:_e.event),this._captureEvent(e,li)};Ee(me,"copy",t,{capture:!0}),Ee(me,"cut",t,{capture:!0})}}}else Ve.info("Disabling Automatic Event Collection because this browser is not supported")}startIfEnabled(){this.isEnabled&&!this._initialized&&(this._addDomEventHandlers(),this._initialized=!0)}onRemoteConfig(e){e.elementsChainAsString&&(this._elementsChainAsString=e.elementsChainAsString),this.instance.persistence&&this.instance.persistence.register({[Oe]:!!e.autocapture_opt_out}),this._isDisabledServerSide=!!e.autocapture_opt_out,this.startIfEnabled()}setElementSelectors(e){this._elementSelectors=e}getElementSelectors(e){var t,r=[];return null==(t=this._elementSelectors)||t.forEach((t=>{var i=null==me?void 0:me.querySelectorAll(t);null==i||i.forEach((i=>{e===i&&r.push(t)}))})),r}get isEnabled(){var e,t,r=null==(e=this.instance.persistence)?void 0:e.props[Oe],i=this._isDisabledServerSide;if(L(i)&&!N(r))return!1;var s=null!==(t=this._isDisabledServerSide)&&void 0!==t?t:!!r;return!!this.instance.config.autocapture&&!s}_captureEvent(e,t){if(void 0===t&&(t="$autocapture"),this.isEnabled){var r,i=function(e){return O(e.target)?e.srcElement||null:null!=(t=e.target)&&t.shadowRoot?e.composedPath()[0]||null:e.target||null;var t}(e);if(Ar(i)&&(i=i.parentNode||null),"$autocapture"===t&&"click"===e.type&&e instanceof MouseEvent)this.instance.config.rageclick&&null!=(r=this.rageclicks)&&r.isRageClick(e.clientX,e.clientY,(new Date).getTime())&&function(e,t){if(!window||Br(e))return!1;var r,i;if(!1===(r=N(t)?!!t&&qr:null!==(i=null==t?void 0:t.css_selector_ignorelist)&&void 0!==i?i:qr))return!1;var{targetElementList:s}=Hr(e,!1);return!Ur(s,r)}(i,this.instance.config.rageclick)&&this._captureEvent(e,"$rageclick");var s=t===li;if(i&&Gr(i,e,this._config,s,s?["copy","cut"]:void 0)){var{props:n,explicitNoCapture:o}=hi(i,{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(o)return!1;var a=this.getElementSelectors(i);if(a&&a.length>0&&(n.$element_selectors=a),t===li){var l,u=Dr(null==_e||null==(l=_e.getSelection())?void 0:l.toString()),c=e.type||"clipboard";if(!u)return!1;n.$selected_content=u,n.$copy_type=c}return this.instance.capture(t,n),!0}}}isBrowserSupported(){return C(null==me?void 0:me.querySelectorAll)}}class pi{constructor(){this._events={},this._events={}}on(e,t){return this._events[e]||(this._events[e]=[]),this._events[e].push(t),()=>{this._events[e]=this._events[e].filter((e=>e!==t))}}emit(e,t){for(var r of this._events[e]||[])r(t);for(var i of this._events["*"]||[])i(e,t)}}class _i{on(e,t){return this._eventEmitter.on(e,t)}constructor(e,t,r){var i;if(this._sessionIdChangedHandlers=[],this._beforeUnloadListener=void 0,this._eventEmitter=new pi,this._sessionHasBeenIdleTooLong=(e,t)=>Math.abs(e-t)>this.sessionTimeoutMs,!e.persistence)throw new Error("SessionIdManager requires a LeanbasePersistence instance");if("always"===e.config.cookieless_mode)throw new Error('SessionIdManager cannot be used with cookieless_mode="always"');this._config=e.config,this._persistence=e.persistence,this._windowId=void 0,this._sessionId=void 0,this._sessionStartTimestamp=null,this._sessionActivityTimestamp=null,this._sessionIdGenerator=t||Ze,this._windowIdGenerator=r||Ze;var s=this._config.persistence_name||this._config.token,n=this._config.session_idle_timeout_seconds||1800;if(this._sessionTimeoutMs=1e3*H(n,60,36e3,Ve,1800),e.register({$configured_session_timeout_ms:this._sessionTimeoutMs}),this._resetIdleTimer(),this._window_id_storage_key="ph_"+s+"_window_id",this._primary_window_exists_storage_key="ph_"+s+"_primary_window_exists",this._canUseSessionStorage()){var o=ht._parse(this._window_id_storage_key),a=ht._parse(this._primary_window_exists_storage_key);o&&!a?this._windowId=o:ht._remove(this._window_id_storage_key),ht._set(this._primary_window_exists_storage_key,!0)}if(null!=(i=this._config.bootstrap)&&i.sessionID)try{var l=(e=>{var t=e.replace(/-/g,"");if(32!==t.length)throw new Error("Not a valid UUID");if("7"!==t[12])throw new Error("Not a UUIDv7");return parseInt(t.substring(0,12),16)})(this._config.bootstrap.sessionID);this._setSessionId(this._config.bootstrap.sessionID,(new Date).getTime(),l)}catch(e){Ve.error("Invalid sessionID in bootstrap",e)}this._listenToReloadWindow()}get sessionTimeoutMs(){return this._sessionTimeoutMs}onSessionId(e){return O(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&&ht._is_supported()}_setWindowId(e){e!==this._windowId&&(this._windowId=e,this._canUseSessionStorage()&&ht._set(this._window_id_storage_key,e))}_getWindowId(){return this._windowId?this._windowId:this._canUseSessionStorage()?ht._parse(this._window_id_storage_key):null}_setSessionId(e,t,r){e===this._sessionId&&t===this._sessionActivityTimestamp&&r===this._sessionStartTimestamp||(this._sessionStartTimestamp=r,this._sessionActivityTimestamp=t,this._sessionId=e,this._persistence.register({[Le]:[t,e,r]}))}_getSessionId(){if(this._sessionId&&this._sessionActivityTimestamp&&this._sessionStartTimestamp)return[this._sessionActivityTimestamp,this._sessionId,this._sessionStartTimestamp];var e=this._persistence.props[Le];return k(e)&&2===e.length&&e.push(e[0]),e||[0,null,0]}resetSessionId(){this._setSessionId(null,null,null)}destroy(){clearTimeout(this._enforceIdleTimeout),this._enforceIdleTimeout=void 0,this._beforeUnloadListener&&_e&&(_e.removeEventListener("beforeunload",this._beforeUnloadListener,{capture:!1}),this._beforeUnloadListener=void 0),this._sessionIdChangedHandlers=[]}_listenToReloadWindow(){this._beforeUnloadListener=()=>{this._canUseSessionStorage()&&ht._remove(this._primary_window_exists_storage_key)},Ee(_e,"beforeunload",this._beforeUnloadListener,{capture:!1})}checkAndGetSessionAndWindowId(e,t){if(void 0===e&&(e=!1),void 0===t&&(t=null),"always"===this._config.cookieless_mode)throw new Error('checkAndGetSessionAndWindowId should not be called with cookieless_mode="always"');var r=t||(new Date).getTime(),[i,s,n]=this._getSessionId(),o=this._getWindowId(),a=D(n)&&n>0&&Math.abs(r-n)>864e5,l=!1,u=!s,c=!e&&this._sessionHasBeenIdleTooLong(r,i);u||c||a?(s=this._sessionIdGenerator(),o=this._windowIdGenerator(),Ve.info("new session ID generated",{sessionId:s,windowId:o,changeReason:{noSessionId:u,activityTimeout:c,sessionPastMaximumLength:a}}),n=r,l=!0):o||(o=this._windowIdGenerator(),l=!0);var d=0===i||!e||a?r:i,h=0===n?(new Date).getTime():n;return this._setWindowId(o),this._setSessionId(s,d,h),e||this._resetIdleTimer(),l&&this._sessionIdChangedHandlers.forEach((e=>e(s,o,l?{noSessionId:u,activityTimeout:c,sessionPastMaximumLength:a}:void 0))),{sessionId:s,windowId:o,sessionStartTimestamp:h,changeReason:l?{noSessionId:u,activityTimeout:c,sessionPastMaximumLength:a}:void 0,lastActivityTimestamp:i}}_resetIdleTimer(){clearTimeout(this._enforceIdleTimeout),this._enforceIdleTimeout=setTimeout((()=>{var[e]=this._getSessionId();if(this._sessionHasBeenIdleTooLong((new Date).getTime(),e)){var t=this._sessionId;this.resetSessionId(),this._eventEmitter.emit("forcedIdleReset",{idleSessionId:t})}}),1.1*this.sessionTimeoutMs)}}var fi=e=>Sr(null==e?void 0:e.config.mask_personal_data_properties,null==e?void 0:e.config.custom_personal_data_properties);class vi{constructor(e,t,r,i){this._onSessionIdCallback=e=>{var t=this._getStored();if(!t||t.sessionId!==e){var r={sessionId:e,props:this._sessionSourceParamGenerator(this._instance)};this._persistence.register({[je]:r})}},this._instance=e,this._sessionIdManager=t,this._persistence=r,this._sessionSourceParamGenerator=i||fi,this._sessionIdManager.onSessionId(this._onSessionIdCallback)}_getStored(){return this._persistence.props[je]}getSetOnceProps(){var e,t=null==(e=this._getStored())?void 0:e.props;return t?"r"in t?Ir(t):{$referring_domain:t.referringDomain,$pathname:t.initialPathName,utm_source:t.utm_source,utm_campaign:t.utm_campaign,utm_medium:t.utm_medium,utm_content:t.utm_content,utm_term:t.utm_term}:{}}getSessionProps(){var e={};return Se(ke(this.getSetOnceProps()),((t,r)=>{"$current_url"===r&&(r="url"),e["$session_entry_"+S(r)]=t})),e}}class mi{constructor(e){this._instance=e}doPageView(e,t){var r,i=this._previousPageViewProperties(e,t);return this._currentPageview={pathname:null!==(r=null==_e?void 0:_e.location.pathname)&&void 0!==r?r:"",pageViewId:t,timestamp:e},this._instance.scrollManager.resetContext(),i}doPageLeave(e){var t;return this._previousPageViewProperties(e,null==(t=this._currentPageview)?void 0:t.pageViewId)}doEvent(){var e;return{$pageview_id:null==(e=this._currentPageview)?void 0:e.pageViewId}}_previousPageViewProperties(e,t){var r=this._currentPageview;if(!r)return{$pageview_id:t};var i={$pageview_id:t,$prev_pageview_id:r.pageViewId},s=this._instance.scrollManager.getContext();if(s&&!this._instance.config.disable_scroll_properties){var{maxScrollHeight:n,lastScrollY:o,maxScrollY:a,maxContentHeight:l,lastContentY:u,maxContentY:c}=s;if(!(O(n)||O(o)||O(a)||O(l)||O(u)||O(c))){n=Math.ceil(n),o=Math.ceil(o),a=Math.ceil(a),l=Math.ceil(l),u=Math.ceil(u),c=Math.ceil(c);var d=n<=1?1:H(o/n,0,1,Ve),h=n<=1?1:H(a/n,0,1,Ve),g=l<=1?1:H(u/l,0,1,Ve),p=l<=1?1:H(c/l,0,1,Ve);i=Ie(i,{$prev_pageview_last_scroll:o,$prev_pageview_last_scroll_percentage:d,$prev_pageview_max_scroll:a,$prev_pageview_max_scroll_percentage:h,$prev_pageview_last_content:u,$prev_pageview_last_content_percentage:g,$prev_pageview_max_content:c,$prev_pageview_max_content_percentage:p})}}return r.pathname&&(i.$prev_pageview_pathname=r.pathname),r.timestamp&&(i.$prev_pageview_duration=(e.getTime()-r.timestamp.getTime())/1e3),i}}class yi{constructor(e){this._instance=e,this._updateScrollData=()=>{var e,t,r,i;this._context||(this._context={});var s=this.scrollElement(),n=this.scrollY(),o=s?Math.max(0,s.scrollHeight-s.clientHeight):0,a=n+((null==s?void 0:s.clientHeight)||0),l=(null==s?void 0:s.scrollHeight)||0;this._context.lastScrollY=Math.ceil(n),this._context.maxScrollY=Math.max(n,null!==(e=this._context.maxScrollY)&&void 0!==e?e:0),this._context.maxScrollHeight=Math.max(o,null!==(t=this._context.maxScrollHeight)&&void 0!==t?t:0),this._context.lastContentY=a,this._context.maxContentY=Math.max(a,null!==(r=this._context.maxContentY)&&void 0!==r?r:0),this._context.maxContentHeight=Math.max(l,null!==(i=this._context.maxContentHeight)&&void 0!==i?i:0)}}getContext(){return this._context}resetContext(){var e=this._context;return setTimeout(this._updateScrollData,0),e}startMeasuringScrollPosition(){Ee(_e,"scroll",this._updateScrollData,{capture:!0}),Ee(_e,"scrollend",this._updateScrollData,{capture:!0}),Ee(_e,"resize",this._updateScrollData)}scrollElement(){if(!this._instance.config.scroll_root_selector)return null==_e?void 0:_e.document.documentElement;var e=k(this._instance.config.scroll_root_selector)?this._instance.config.scroll_root_selector:[this._instance.config.scroll_root_selector];for(var t of e){var r=null==_e?void 0:_e.document.querySelector(t);if(r)return r}}scrollY(){if(this._instance.config.scroll_root_selector){var e=this.scrollElement();return e&&e.scrollTop||0}return _e&&(_e.scrollY||_e.pageYOffset||_e.document.documentElement.scrollTop)||0}scrollX(){if(this._instance.config.scroll_root_selector){var e=this.scrollElement();return e&&e.scrollLeft||0}return _e&&(_e.scrollX||_e.pageXOffset||_e.document.documentElement.scrollLeft)||0}}var bi,wi=["amazonbot","amazonproductbot","app.hypefactors.com","applebot","archive.org_bot","awariobot","backlinksextendedbot","baiduspider","bingbot","bingpreview","chrome-lighthouse","dataforseobot","deepscan","duckduckbot","facebookexternal","facebookcatalog","http://yandex.com/bots","hubspot","ia_archiver","leikibot","linkedinbot","meta-externalagent","mj12bot","msnbot","nessus","petalbot","pinterest","prerender","rogerbot","screaming frog","sebot-wa","sitebulb","slackbot","slurp","trendictionbot","turnitin","twitterbot","vercel-screenshot","vercelbot","yahoo! slurp","yandexbot","zoombot","bot.htm","bot.php","(bot;","bot/","crawler","ahrefsbot","ahrefssiteaudit","semrushbot","siteauditbot","splitsignalbot","gptbot","oai-searchbot","chatgpt-user","perplexitybot","better uptime bot","sentryuptimebot","uptimerobot","headlesschrome","cypress","google-hoteladsverifier","adsbot-google","apis-google","duplexweb-google","feedfetcher-google","google favicon","google web preview","google-read-aloud","googlebot","googleother","google-cloudvertexbot","googleweblight","mediapartners-google","storebot-google","google-inspectiontool","bytespider"],Pi=function(e,t){if(!e)return!1;var r=e.toLowerCase();return wi.concat(t||[]).some((e=>{var t=e.toLowerCase();return-1!==r.indexOf(t)}))};!function(e){e[e.PENDING=-1]="PENDING",e[e.DENIED=0]="DENIED",e[e.GRANTED=1]="GRANTED"}(bi||(bi={}));class Si{constructor(e){this._instance=e}get _config(){return this._instance.config}get consent(){return this._getDnt()?bi.DENIED:this._storedConsent}isOptedOut(){return"always"===this._config.cookieless_mode||(this.consent===bi.DENIED||this.consent===bi.PENDING&&(this._config.opt_out_capturing_by_default||"on_reject"===this._config.cookieless_mode))}isOptedIn(){return!this.isOptedOut()}isExplicitlyOptedOut(){return this.consent===bi.DENIED}optInOut(e){this._storage._set(this._storageKey,e?1:0,this._config.cookie_expiration,this._config.cross_subdomain_cookie,this._config.secure_cookie)}reset(){this._storage._remove(this._storageKey,this._config.cross_subdomain_cookie)}get _storageKey(){var{token:e,opt_out_capturing_cookie_prefix:t,consent_persistence_name:r}=this._instance.config;return r||(t?t+e:"__lb_opt_in_out_"+e)}get _storedConsent(){var e=this._storage._get(this._storageKey);return q(e)?bi.GRANTED:w(B,e)?bi.DENIED:bi.PENDING}get _storage(){if(!this._persistentStore){var e=this._config.opt_out_capturing_persistence_type;this._persistentStore="localStorage"===e?ot:st;var t="localStorage"===e?st:ot;t._get(this._storageKey)&&(this._persistentStore._get(this._storageKey)||this.optInOut(q(t._get(this._storageKey))),t._remove(this._storageKey,this._config.cross_subdomain_cookie))}return this._persistentStore}_getDnt(){return!!this._config.respect_dnt&&!!function(e,t){for(var r=0;r<e.length;r++)if(t(e[r]))return e[r]}([null==ve?void 0:ve.doNotTrack,null==ve?void 0:ve.msDoNotTrack,we.doNotTrack],(e=>q(e)))}}var Ii="[SessionRecording]",Fi=function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return Ve.info(Ii,...t)},xi=function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return Ve.warn(Ii,...t)},Ei=function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return Ve.error(Ii,...t)};class ki{get started(){var e;return!(null==(e=this._lazyLoadedSessionRecording)||!e.isStarted)}get status(){return this._lazyLoadedSessionRecording?this._lazyLoadedSessionRecording.status:this._receivedFlags&&!this._isRecordingEnabled?"disabled":"lazy_loading"}constructor(e){if(this._instance=e,this._forceAllowLocalhostNetworkCapture=!1,this._receivedFlags=!1,this._bootstrapFailed=!1,this._warnedMissingConsent=!1,this._warnedMissingLoader=!1,this._persistFlagsOnSessionListener=void 0,!this._instance.sessionManager)throw Ei("started without valid sessionManager"),new Error(Ii+" started without valid sessionManager. This is a bug.");if("always"===this._instance.config.cookieless_mode)throw new Error(Ii+' cannot be used with cookieless_mode="always"')}get _isRecordingEnabled(){var e,t,r=this._instance.getPersistedProperty(Te),i=!(null==r||!r.enabled),s=!this._instance.config.disable_session_recording,n=null==(e=this._instance.consent)||null==e.isOptedOut?void 0:e.isOptedOut();null!=(t=this._instance.consent)&&t.isOptedOut||this._warnedMissingConsent||(xi("consent API missing; disabling session recording"),this._warnedMissingConsent=!0);var o=this._instance.config.disable_session_recording||!1!==n;return _e&&i&&s&&!o}startIfEnabledOrStop(e){var t;if(!this._isRecordingEnabled||null==(t=this._lazyLoadedSessionRecording)||!t.isStarted){var r=!O(Object.assign)&&!O(Array.from);this._isRecordingEnabled&&r?(this._lazyLoadAndStart(e),Fi("starting")):this.stopRecording()}}_lazyLoadAndStart(e){var t,r,i;if(this._isRecordingEnabled&&!this._bootstrapFailed)if(null!=(t=we.__LeanbaseExtensions__)&&null!=(t=t.rrweb)&&t.record&&null!=(r=we.__LeanbaseExtensions__)&&r.initSessionRecording)this._onScriptLoaded(e);else{var s=null==(i=we.__LeanbaseExtensions__)?void 0:i.loadExternalDependency;if(!s&&!this._warnedMissingLoader)return xi("Session recording disabled: __LeanbaseExtensions__.loadExternalDependency missing"),this._warnedMissingLoader=!0,this._bootstrapFailed=!0,void this.stopRecording();s&&s(this._instance,this._scriptName,(t=>{if(t)return Ei("could not load recorder",t),void(this._bootstrapFailed=!0);this._onScriptLoaded(e)}))}}stopRecording(){var e,t;null==(e=this._persistFlagsOnSessionListener)||e.call(this),this._persistFlagsOnSessionListener=void 0,null==(t=this._lazyLoadedSessionRecording)||t.stop()}_resetSampling(){var e;null==(e=this._instance.persistence)||e.unregister(Me)}_persistRemoteConfig(e){if(this._instance.persistence){var t,i,s=this._instance.persistence,n=()=>{var t=!1===e.sessionRecording?void 0:e.sessionRecording,i=null==t?void 0:t.sampleRate,n=M(i)?null:parseFloat(i);M(n)&&this._resetSampling();var o=null==t?void 0:t.minimumDurationMilliseconds;s.register({[Te]:r({enabled:!!t},t,{networkPayloadCapture:r({capturePerformance:e.capturePerformance},null==t?void 0:t.networkPayloadCapture),canvasRecording:{enabled:null==t?void 0:t.recordCanvas,fps:null==t?void 0:t.canvasFps,quality:null==t?void 0:t.canvasQuality},sampleRate:n,minimumDurationMilliseconds:O(o)?null:o,endpoint:null==t?void 0:t.endpoint,triggerMatchType:null==t?void 0:t.triggerMatchType,masking:null==t?void 0:t.masking,urlTriggers:null==t?void 0:t.urlTriggers})})};n(),null==(t=this._persistFlagsOnSessionListener)||t.call(this),this._persistFlagsOnSessionListener=null==(i=this._instance.sessionManager)?void 0:i.onSessionId(n)}}_clearRemoteConfig(){var e;null==(e=this._instance.persistence)||e.unregister(Te),this._resetSampling()}onRemoteConfig(e){"sessionRecording"in e?(this._receivedFlags=!0,!1!==e.sessionRecording?(this._persistRemoteConfig(e),this.startIfEnabledOrStop()):this._receivedFlags=!0):Fi("skipping remote config with no sessionRecording",e)}log(e,t){var r;void 0===t&&(t="log"),null!=(r=this._lazyLoadedSessionRecording)&&r.log?this._lazyLoadedSessionRecording.log(e,t):Ve.warn("log called before recorder was ready")}get _scriptName(){var e,t,r=null==(e=this._instance)||null==(e=e.persistence)?void 0:e.get_property(Te);return(null==r||null==(t=r.scriptConfig)?void 0:t.script)||"lazy-recorder"}_onScriptLoaded(e){var t;if(!this._bootstrapFailed){var r=null==(t=we.__LeanbaseExtensions__)?void 0:t.initSessionRecording;if(!r)return this._warnedMissingLoader||(xi("Session recording disabled: initSessionRecording missing"),this._warnedMissingLoader=!0),this._bootstrapFailed=!0,void this.stopRecording();this._lazyLoadedSessionRecording||(this._lazyLoadedSessionRecording=r(this._instance),this._lazyLoadedSessionRecording._forceAllowLocalhostNetworkCapture=this._forceAllowLocalhostNetworkCapture),this._lazyLoadedSessionRecording.start(e)}}onRRwebEmit(e){var t;null==(t=this._lazyLoadedSessionRecording)||null==t.onRRwebEmit||t.onRRwebEmit(e)}overrideLinkedFlag(){var e;null==(e=this._lazyLoadedSessionRecording)||e.overrideLinkedFlag()}overrideSampling(){var e;null==(e=this._lazyLoadedSessionRecording)||e.overrideSampling()}overrideTrigger(e){var t;null==(t=this._lazyLoadedSessionRecording)||t.overrideTrigger(e)}get sdkDebugProperties(){var e;return(null==(e=this._lazyLoadedSessionRecording)?void 0:e.sdkDebugProperties)||{$recording_status:this.status}}tryAddCustomEvent(e,t){var r;return!(null==(r=this._lazyLoadedSessionRecording)||!r.tryAddCustomEvent(e,t))}}var Ci=()=>{var e;return{host:"https://i.leanbase.co",token:"",autocapture:!0,rageclick:!0,disable_session_recording:!1,session_recording:{forceClientRecording:!0},enable_recording_console_log:void 0,persistence:"localStorage+cookie",capture_pageview:!0,capture_pageleave:"if_capture_pageview",persistence_name:"",mask_all_element_attributes:!1,cookie_expiration:365,cross_subdomain_cookie:Re(null==me?void 0:me.location),custom_campaign_params:[],custom_personal_data_properties:[],disable_persistence:!1,mask_personal_data_properties:!1,secure_cookie:"https:"===(null==(e=window)||null==(e=e.location)?void 0:e.protocol),mask_all_text:!1,bootstrap:{},session_idle_timeout_seconds:1800,save_campaign_params:!0,save_referrer:!0,opt_out_useragent_filter:!1,properties_string_max_length:65535,opt_out_capturing_by_default:!1,opt_out_persistence_by_default:!1,opt_out_capturing_persistence_type:"localStorage",consent_persistence_name:null,opt_out_capturing_cookie_prefix:null,respect_dnt:!1,getDeviceId:e=>e,loaded:()=>{}}};class Ri extends ce{constructor(e,t){var r=Ie(Ci(),t||{},{token:e});super(e,r),this.personProcessingSetOncePropertiesSent=!1,this.isLoaded=!1,this.config=r,this.visibilityStateListener=null,this.initialPageviewCaptured=!1,this.scrollManager=new yi(this),this.pageViewManager=new mi(this),this.consent=new Si(this),this.init(e,r)}init(e,t){var i,s,n;this.setConfig(Ie(Ci(),t,{token:e})),this.isLoaded=!0;var o=this._isPersistenceDisabled();this.persistence=new Cr(this.config),this.sessionPersistence="sessionStorage"===this.config.persistence||"memory"===this.config.persistence?this.persistence:new Cr(r({},this.config,{persistence:"sessionStorage"}),o);var a="always"===this.config.cookieless_mode||"on_reject"===this.config.cookieless_mode&&this.consent.isExplicitlyOptedOut();if(a||(this.sessionManager=new _i(this),this.sessionPropsManager=new vi(this,this.sessionManager,this.persistence)),"always"!==this.config.cookieless_mode&&(this.sessionManager=new _i(this),this.sessionPropsManager=new vi(this,this.sessionManager,this.persistence)),this.replayAutocapture=new gi(this),this.replayAutocapture.startIfEnabled(),this.sessionManager&&"always"!==this.config.cookieless_mode&&(this.sessionRecording=new ki(this),this.sessionRecording.startIfEnabledOrStop()),!1!==this.config.preloadFeatureFlags&&this.reloadFeatureFlags(),null==(i=(s=this.config).loaded)||i.call(s,this),this.config.capture_pageview&&setTimeout((()=>{(this.consent.isOptedIn()||"always"===this.config.cookieless_mode)&&this.captureInitialPageview()}),1),this.config.disable_scroll_properties||this.scrollManager.startMeasuringScrollPosition(),void 0!==(null==(n=this.config.bootstrap)?void 0:n.distinctId)){var l,u,c=this.config.getDeviceId(Ze()),d=null!=(l=this.config.bootstrap)&&l.isIdentifiedId?c:this.config.bootstrap.distinctId;this.persistence.set_property(Ne,null!=(u=this.config.bootstrap)&&u.isIdentifiedId?"identified":"anonymous"),this.register({distinct_id:this.config.bootstrap.distinctId,$device_id:d})}if(a&&this.persistence.register_once({distinct_id:"$posthog_cookieless",$device_id:null},""),!a&&!this.getDistinctId()){var h=Ze();this.persistence.register_once({distinct_id:h,$device_id:h},""),this.persistence.set_property(Ne,"anonymous")}return Ee(me,"DOMContentLoaded",(()=>{this.loadRemoteConfig()})),Ee(window,"onpagehide"in self?"pagehide":"unload",this.capturePageLeave.bind(this),{passive:!1}),this}captureInitialPageview(){me&&("visible"===me.visibilityState?this.initialPageviewCaptured||(this.initialPageviewCaptured=!0,this.capture("$pageview",{title:me.title}),this.visibilityStateListener&&(me.removeEventListener("visibilitychange",this.visibilityStateListener),this.visibilityStateListener=null)):this.visibilityStateListener||(this.visibilityStateListener=this.captureInitialPageview.bind(this),Ee(me,"visibilitychange",this.visibilityStateListener)))}capturePageLeave(){var{capture_pageleave:e,capture_pageview:t}=this.config;!0!==e&&("if_capture_pageview"!==e||!0!==t&&"history_change"!==t)||this.capture("$pageleave")}loadRemoteConfig(){var e=this;return t((function*(){if(!e.isRemoteConfigLoaded){var t=yield e.reloadRemoteConfigAsync();t&&e.onRemoteConfig(t)}}))()}onRemoteConfig(e){var t,r;me&&me.body?(this.isRemoteConfigLoaded=!0,null==(t=this.replayAutocapture)||t.onRemoteConfig(e),null==(r=this.sessionRecording)||r.onRemoteConfig(e)):setTimeout((()=>{this.onRemoteConfig(e)}),500)}fetch(e,t){var r="undefined"!=typeof fetch?fetch:void 0!==globalThis.fetch?globalThis.fetch:void 0;return r?r(e,t):Promise.reject(new Error("Fetch API is not available in this environment."))}setConfig(e){var t,i,s,n=r({},this.config);R(e)&&(Ie(this.config,e),null==(t=this.persistence)||t.update_config(this.config,n),null==(i=this.replayAutocapture)||i.startIfEnabled(),null==(s=this.sessionRecording)||s.startIfEnabledOrStop());var o="sessionStorage"===this.config.persistence||"memory"===this.config.persistence;this.sessionPersistence=o?this.persistence:new Cr(r({},this.config,{persistence:"sessionStorage"}))}getLibraryId(){return"leanbase"}getLibraryVersion(){return hr.LIB_VERSION}getCustomUserAgent(){}getPersistedProperty(e){var t;return null==(t=this.persistence)?void 0:t.get_property(e)}setPersistedProperty(e,t){var r;null==(r=this.persistence)||r.set_property(e,t)}calculateEventProperties(e,t,i,s,n){var o;if(!this.persistence||!this.sessionPersistence)return t;i=i||new Date;var a,l=n||null==(o=this.persistence)?void 0:o.remove_event_timer(e),u=r({},t);if(u.token=this.config.token,("always"==this.config.cookieless_mode||"on_reject"==this.config.cookieless_mode&&this.consent.isExplicitlyOptedOut())&&(u.$cookieless_mode=!0),"$snapshot"===e){var c=r({},this.persistence.properties());return u.distinct_id=c.distinct_id,(!T(u.distinct_id)&&!D(u.distinct_id)||(a=u.distinct_id,T(a)&&0===a.trim().length))&&Ve.error("Invalid distinct_id for replay event. This indicates a bug in your implementation"),u}var d=Er(this.config.mask_personal_data_properties,this.config.custom_personal_data_properties);if(this.sessionManager){var{sessionId:h,windowId:g}=this.sessionManager.checkAndGetSessionAndWindowId(n,i.getTime());u.$session_id=h,u.$window_id=g}this.sessionPropsManager&&Ie(u,this.sessionPropsManager.getSessionProps());try{this.sessionRecording&&Ie(u,this.sessionRecording.sdkDebugProperties)}catch(e){u.$sdk_debug_error_capturing_properties=String(e)}var p=this.pageViewManager.doEvent();if("$pageview"!==e||n||(p=this.pageViewManager.doPageView(i,s)),"$pageleave"!==e||n||(p=this.pageViewManager.doPageLeave(i)),u=Ie(u,p),"$pageview"===e&&me&&(u.title=me.title),!O(l)){var _=i.getTime()-l;u.$duration=parseFloat((_/1e3).toFixed(3))}return be&&this.config.opt_out_useragent_filter&&(u.$browser_type=function(e,t){if(!e)return!1;var r=e.userAgent;if(r&&Pi(r,t))return!0;try{var i=null==e?void 0:e.userAgentData;if(null!=i&&i.brands&&i.brands.some((e=>Pi(null==e?void 0:e.brand,t))))return!0}catch(e){}return!!e.webdriver}(ve,[])?"bot":"browser"),(u=Ie({},d,this.persistence.properties(),this.sessionPersistence.properties(),u)).$is_identified=this.isIdentified(),u}isIdentified(){var e,t;return"identified"===(null==(e=this.persistence)?void 0:e.get_property(Ne))||"identified"===(null==(t=this.sessionPersistence)?void 0:t.get_property(Ne))}isCapturing(){return this.consent.isOptedIn()}calculateSetOnceProperties(e){var t;if(!this.persistence)return e;if(this.personProcessingSetOncePropertiesSent)return e;var r=this.persistence.get_initial_props(),i=null==(t=this.sessionPropsManager)?void 0:t.getSetOnceProps(),s=Ie({},r,i||{},e||{});return this.personProcessingSetOncePropertiesSent=!0,A(s)?void 0:s}capture(e,t,i){if(this.isLoaded&&this.sessionPersistence&&this.persistence&&this.isCapturing())if(!O(e)&&T(e)){null!=t&&t.$current_url&&!T(null==t?void 0:t.$current_url)&&(Ve.error("Invalid `$current_url` property provided to `posthog.capture`. Input must be a string. Ignoring provided value."),null==t||delete t.$current_url),this.sessionPersistence.update_search_keyword(),this.config.save_campaign_params&&this.sessionPersistence.update_campaign_params(),this.config.save_referrer&&this.sessionPersistence.update_referrer_info(),(this.config.save_campaign_params||this.config.save_referrer)&&this.persistence.set_initial_person_info();var s=new Date,n=(null==i?void 0:i.timestamp)||s,o=Ze(),a={uuid:o,event:e,properties:this.calculateEventProperties(e,t||{},n,o)};(null==i?void 0:i.$set)&&(a.$set=null==i?void 0:i.$set);var l=this.calculateSetOnceProperties(null==i?void 0:i.$set_once);l&&(a.$set_once=l),(a=$e(a,null!=i&&i._noTruncate?null:this.config.properties_string_max_length)).timestamp=n,O(null==i?void 0:i.timestamp)||(a.properties.$event_time_override_provided=!0,a.properties.$event_time_override_system_time=s);var u=r({},a.properties.$set,a.$set);A(u)||this.setPersonPropertiesForFlags(u),super.capture(a.event,a.properties,i)}else Ve.error("No event name provided to posthog.capture")}identify(e,t,r){super.identify(e,t,r)}destroy(){var e;null==(e=this.persistence)||e.clear()}_isPersistenceDisabled(){if("always"===this.config.cookieless_mode)return!0;var e=this.consent.isOptedOut(),t=this.config.opt_out_persistence_by_default||"on_reject"===this.config.cookieless_mode;return this.config.disable_persistence||e&&!!t}}var $i,Ai,Oi={_instance:null,_queue:[],init(e,t){this._instance=new Ri(e,t);var r=this._queue;for(var{fn:i,args:s}of(this._queue=[],r))this[i](...s)},capture(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];if(this._instance)return this._instance.capture(...t);this._queue.push({fn:"capture",args:t})},captureException(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];if(this._instance)return this._instance.captureException(...t);this._queue.push({fn:"captureException",args:t})},identify(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];if(this._instance)return this._instance.identify(...t);this._queue.push({fn:"identify",args:t})},group(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];if(this._instance)return this._instance.group(...t);this._queue.push({fn:"group",args:t})},alias(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];if(this._instance)return this._instance.alias(...t);this._queue.push({fn:"alias",args:t})},reset(){var e;null==(e=this._instance)||e.reset(),this._instance=null},getInstance(){return this._instance}};$i=globalThis,(Ai=$i.leanbase)&&"object"==typeof Ai&&k(Ai._queue)&&(Oi._queue=Ai._queue),$i.leanbase=Oi,$i.Leanbase=$i.leanbase}();
|
|
1
|
+
!function(){"use strict";function e(e,t,r,i,s,n,o){try{var a=e[n](o),l=a.value}catch(e){return void r(e)}a.done?t(l):Promise.resolve(l).then(i,s)}function t(t){return function(){var r=this,i=arguments;return new Promise((function(s,n){var o=t.apply(r,i);function a(t){e(o,s,n,a,l,"next",t)}function l(t){e(o,s,n,a,l,"throw",t)}a(void 0)}))}}function r(){return r=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var i in r)({}).hasOwnProperty.call(r,i)&&(e[i]=r[i])}return e},r.apply(null,arguments)}var i=e=>{if("flags"in e)return r({},e,{featureFlags:n(e.flags),featureFlagPayloads:o(e.flags)});var t,i=null!==(t=e.featureFlags)&&void 0!==t?t:{},a=Object.fromEntries(Object.entries(e.featureFlagPayloads||{}).map((e=>{var[t,r]=e;return[t,l(r)]}))),u=Object.fromEntries(Object.entries(i).map((e=>{var[t,r]=e;return[t,s(t,r,a[t])]})));return r({},e,{featureFlags:i,featureFlagPayloads:a,flags:u})};function s(e,t,r){return{key:e,enabled:"string"==typeof t||t,variant:"string"==typeof t?t:void 0,reason:void 0,metadata:{id:void 0,version:void 0,payload:r?JSON.stringify(r):void 0,description:void 0}}}var n=e=>Object.fromEntries(Object.entries(null!=e?e:{}).map((e=>{var[t,r]=e;return[t,a(r)]})).filter((e=>{var[,t]=e;return void 0!==t}))),o=e=>{var t=null!=e?e:{};return Object.fromEntries(Object.keys(t).filter((e=>{var r=t[e];return r.enabled&&r.metadata&&void 0!==r.metadata.payload})).map((e=>{var r,i=null==(r=t[e].metadata)?void 0:r.payload;return[e,i?l(i):void 0]})))},a=e=>{var t;return void 0===e?void 0:null!==(t=e.variant)&&void 0!==t?t:e.enabled},l=e=>{if("string"!=typeof e)return e;try{return JSON.parse(e)}catch(t){return e}},u=(e,t)=>{var r=[...new Set([...Object.keys(null!=e?e:{}),...Object.keys(null!=t?t:{})])].filter((r=>!!e[r]||!!t[r])).reduce(((t,r)=>{var i;return t[r]=null===(i=e[r])||void 0===i||i,t}),{});return i({featureFlags:r,featureFlagPayloads:null!=t?t:{}})};function c(e){return"string"==typeof e||e}function d(e){return"string"==typeof e?e:void 0}var h="0123456789abcdef";let p=class e{constructor(e){this.bytes=e}static ofInner(t){if(16===t.length)return new e(t);throw new TypeError("not 128-bit length")}static fromFieldsV7(t,r,i,s){if(!Number.isInteger(t)||!Number.isInteger(r)||!Number.isInteger(i)||!Number.isInteger(s)||t<0||r<0||i<0||s<0||t>0xffffffffffff||r>4095||i>1073741823||s>4294967295)throw new RangeError("invalid field value");var n=new Uint8Array(16);return n[0]=t/Math.pow(2,40),n[1]=t/Math.pow(2,32),n[2]=t/Math.pow(2,24),n[3]=t/Math.pow(2,16),n[4]=t/256,n[5]=t,n[6]=112|r>>>8,n[7]=r,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 e(n)}static parse(t){var r,i,s,n,o;switch(t.length){case 32:o=null==(r=/^[0-9a-f]{32}$/i.exec(t))?void 0:r[0];break;case 36:o=null==(i=/^([0-9a-f]{8})-([0-9a-f]{4})-([0-9a-f]{4})-([0-9a-f]{4})-([0-9a-f]{12})$/i.exec(t))?void 0:i.slice(1,6).join("");break;case 38:o=null==(s=/^\{([0-9a-f]{8})-([0-9a-f]{4})-([0-9a-f]{4})-([0-9a-f]{4})-([0-9a-f]{12})\}$/i.exec(t))?void 0:s.slice(1,6).join("");break;case 45:o=null==(n=/^urn:uuid:([0-9a-f]{8})-([0-9a-f]{4})-([0-9a-f]{4})-([0-9a-f]{4})-([0-9a-f]{12})$/i.exec(t))?void 0:n.slice(1,6).join("")}if(o){for(var a=new Uint8Array(16),l=0;l<16;l+=4){var u=parseInt(o.substring(2*l,2*l+8),16);a[l+0]=u>>>24,a[l+1]=u>>>16,a[l+2]=u>>>8,a[l+3]=u}return new e(a)}throw new SyntaxError("could not parse UUID string")}toString(){for(var e="",t=0;t<this.bytes.length;t++)e+=h.charAt(this.bytes[t]>>>4),e+=h.charAt(15&this.bytes[t]),3!==t&&5!==t&&7!==t&&9!==t||(e+="-");return e}toHex(){for(var e="",t=0;t<this.bytes.length;t++)e+=h.charAt(this.bytes[t]>>>4),e+=h.charAt(15&this.bytes[t]);return e}toJSON(){return this.toString()}getVariant(){var e=this.bytes[8]>>>4;if(e<0)throw new Error("unreachable");if(e<=7)return this.bytes.every((e=>0===e))?"NIL":"VAR_0";if(e<=11)return"VAR_10";if(e<=13)return"VAR_110";if(e<=15)return this.bytes.every((e=>255===e))?"MAX":"VAR_RESERVED";throw new Error("unreachable")}getVersion(){return"VAR_10"===this.getVariant()?this.bytes[6]>>>4:void 0}clone(){return new e(this.bytes.slice(0))}equals(e){return 0===this.compareTo(e)}compareTo(e){for(var t=0;t<16;t++){var r=this.bytes[t]-e.bytes[t];if(0!==r)return Math.sign(r)}return 0}},g=class{constructor(e){this.timestamp=0,this.counter=0,this.random=null!=e?e:_()}generate(){return this.generateOrResetCore(Date.now(),1e4)}generateOrAbort(){return this.generateOrAbortCore(Date.now(),1e4)}generateOrResetCore(e,t){var r=this.generateOrAbortCore(e,t);return void 0===r&&(this.timestamp=0,r=this.generateOrAbortCore(e,t)),r}generateOrAbortCore(e,t){if(!Number.isInteger(e)||e<1||e>0xffffffffffff)throw new RangeError("`unixTsMs` must be a 48-bit positive integer");if(t<0||t>0xffffffffffff)throw new RangeError("`rollbackAllowance` out of reasonable range");if(e>this.timestamp)this.timestamp=e,this.resetCounter();else{if(!(e+t>=this.timestamp))return;this.counter++,this.counter>4398046511103&&(this.timestamp++,this.resetCounter())}return p.fromFieldsV7(this.timestamp,Math.trunc(this.counter/Math.pow(2,30)),this.counter&Math.pow(2,30)-1,this.random.nextUint32())}resetCounter(){this.counter=1024*this.random.nextUint32()+(1023&this.random.nextUint32())}generateV4(){var e=new Uint8Array(Uint32Array.of(this.random.nextUint32(),this.random.nextUint32(),this.random.nextUint32(),this.random.nextUint32()).buffer);return e[6]=64|e[6]>>>4,e[8]=128|e[8]>>>2,p.ofInner(e)}};var f,_=()=>({nextUint32:()=>65536*Math.trunc(65536*Math.random())+Math.trunc(65536*Math.random())}),v=()=>m().toString(),m=()=>(f||(f=new g)).generate(),y=function(e){return e.AnonymousId="anonymous_id",e.DistinctId="distinct_id",e.Props="props",e.FeatureFlagDetails="feature_flag_details",e.FeatureFlags="feature_flags",e.FeatureFlagPayloads="feature_flag_payloads",e.BootstrapFeatureFlagDetails="bootstrap_feature_flag_details",e.BootstrapFeatureFlags="bootstrap_feature_flags",e.BootstrapFeatureFlagPayloads="bootstrap_feature_flag_payloads",e.OverrideFeatureFlags="override_feature_flags",e.Queue="queue",e.OptedOut="opted_out",e.SessionId="session_id",e.SessionStartTimestamp="session_start_timestamp",e.SessionLastTimestamp="session_timestamp",e.PersonProperties="person_properties",e.GroupProperties="group_properties",e.InstalledAppBuild="installed_app_build",e.InstalledAppVersion="installed_app_version",e.SessionReplay="session_replay",e.SurveyLastSeenDate="survey_last_seen_date",e.SurveysSeen="surveys_seen",e.Surveys="surveys",e.RemoteConfig="remote_config",e.FlagsEndpointWasHit="flags_endpoint_was_hit",e}({}),b=function(e){return e.GZipJS="gzip-js",e.Base64="base64",e}({});function w(e,t){return-1!==e.indexOf(t)}var P=function(e){return e.trim()},S=function(e){return e.replace(/^\$/,"")},I=Array.isArray,F=Object.prototype,x=F.hasOwnProperty,E=F.toString,k=I||function(e){return"[object Array]"===E.call(e)},C=e=>"function"==typeof e,A=e=>e===Object(e)&&!k(e),O=e=>{if(A(e)){for(var t in e)if(x.call(e,t))return!1;return!0}return!1},T=e=>void 0===e,R=e=>"[object String]"==E.call(e),D=e=>null===e,M=e=>T(e)||D(e),N=e=>"[object Number]"==E.call(e),L=e=>"[object Boolean]"===E.call(e),j=e=>e instanceof FormData,U=e=>e instanceof Error,q=[!0,"true",1,"1","yes"],B=e=>w(q,e),H=[!1,"false",0,"0","no"];function z(e,t,r,i,s){return t>r&&(i.warn("min cannot be greater than max."),t=r),N(e)?e>r?(i.warn(" cannot be greater than max: "+r+". Using max value instead."),r):e<t?(i.warn(" cannot be less than min: "+t+". Using min value instead."),t):e:(i.warn(" must be a number. using max or fallback. max: "+r+", fallback: "+s),z(s||r,t,r,i))}class G{add(e){var t=v();return this.promiseByIds[t]=e,e.catch((()=>{})).finally((()=>{delete this.promiseByIds[t]})),e}join(){var e=this;return t((function*(){for(var t=Object.values(e.promiseByIds),r=t.length;r>0;)yield Promise.all(t),r=(t=Object.values(e.promiseByIds)).length}))()}get length(){return Object.keys(this.promiseByIds).length}constructor(){this.promiseByIds={}}}function V(){return(V=t((function*(e,t){for(var r=null,i=0;i<t.retryCount+1;i++){i>0&&(yield new Promise((e=>setTimeout(e,t.retryDelay))));try{return yield e()}catch(e){if(r=e,!t.retryCheck(e))throw e}}throw r}))).apply(this,arguments)}function K(){return(new Date).toISOString()}function W(e,t){var r=setTimeout(e,t);return(null==r?void 0:r.unref)&&(null==r||r.unref()),r}function J(e){return Promise.all(e.map((e=>(null!=e?e:Promise.resolve()).then((e=>({status:"fulfilled",value:e})),(e=>({status:"rejected",reason:e}))))))}let Q=class{constructor(){this.events={},this.events={}}on(e,t){return this.events[e]||(this.events[e]=[]),this.events[e].push(t),()=>{this.events[e]=this.events[e].filter((e=>e!==t))}}emit(e,t){for(var r of this.events[e]||[])r(t);for(var i of this.events["*"]||[])i(e,t)}};function Y(e,t){return X.apply(this,arguments)}function X(){return(X=t((function*(e,t){void 0===t&&(t=!0);try{var r=new Blob([e],{type:"text/plain"}).stream().pipeThrough(new CompressionStream("gzip"));return yield new Response(r).blob()}catch(e){return t&&console.error("Failed to gzip compress data",e),null}}))).apply(this,arguments)}var Z=(e,t,r)=>{function i(i){for(var s=arguments.length,n=new Array(s>1?s-1:0),o=1;o<s;o++)n[o-1]=arguments[o];t((()=>{(0,r[i])(e,...n)}))}var s={info:function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];i("log",...t)},warn:function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];i("warn",...t)},error:function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];i("error",...t)},critical:function(){for(var t=arguments.length,i=new Array(t),s=0;s<t;s++)i[s]=arguments[s];r.error(e,...i)},createLogger:i=>Z(e+" "+i,t,r)};return s};function ee(e,t){return Z(e,t,(void 0===r&&(r=console),{log:r.log.bind(r),warn:r.warn.bind(r),error:r.error.bind(r),debug:r.debug.bind(r)}));var r}class te extends Error{constructor(e,t){super("HTTP error while fetching PostHog: status="+e.status+", reqByteLength="+t),this.response=e,this.reqByteLength=t,this.name="PostHogFetchHttpError"}get status(){return this.response.status}get text(){return this.response.text()}get json(){return this.response.json()}}class re extends Error{constructor(e){super("Network error while fetching PostHog",e instanceof Error?{cause:e}:{}),this.error=e,this.name="PostHogFetchNetworkError"}}var ie=(e,t)=>void 0!==t?{[e]:t}:{};function se(e){return ne.apply(this,arguments)}function ne(){return(ne=t((function*(e){if(e instanceof te){var t="";try{t=yield e.text}catch(e){}console.error("Error while flushing PostHog: message="+e.message+", response body="+t,e)}else console.error("Error while flushing PostHog",e);return Promise.resolve()}))).apply(this,arguments)}function oe(e){return"object"==typeof e&&(e instanceof te||e instanceof re)}function ae(e){return"object"==typeof e&&e instanceof te&&413===e.status}var le=function(e){return e.FeatureFlags="feature_flags",e.Recordings="recordings",e}({});class ue{constructor(e,t){var r,i,s,n,o,a,l,u,c,d,h,p,g,f,_,v,m,y,b;void 0===t&&(t={}),this.flushPromise=null,this.shutdownPromise=null,this.promiseQueue=new G,this._events=new Q,this._isInitialized=!1,function(e,t){if(!e||"string"!=typeof e||function(e){return 0===e.trim().length}(e))throw new Error(t)}(e,"You must pass your PostHog project's api key."),this.apiKey=e,this.host=null==(b=t.host||"https://us.i.posthog.com")?void 0:b.replace(/\/+$/,""),this.flushAt=t.flushAt?Math.max(t.flushAt,1):20,this.maxBatchSize=Math.max(this.flushAt,null!==(r=t.maxBatchSize)&&void 0!==r?r:100),this.maxQueueSize=Math.max(this.flushAt,null!==(i=t.maxQueueSize)&&void 0!==i?i:1e3),this.flushInterval=null!==(s=t.flushInterval)&&void 0!==s?s:1e4,this.preloadFeatureFlags=null===(n=t.preloadFeatureFlags)||void 0===n||n,this.defaultOptIn=null===(o=t.defaultOptIn)||void 0===o||o,this.disableSurveys=null!==(a=t.disableSurveys)&&void 0!==a&&a,this._retryOptions={retryCount:null!==(l=t.fetchRetryCount)&&void 0!==l?l:3,retryDelay:null!==(u=t.fetchRetryDelay)&&void 0!==u?u:3e3,retryCheck:oe},this.requestTimeout=null!==(c=t.requestTimeout)&&void 0!==c?c:1e4,this.featureFlagsRequestTimeoutMs=null!==(d=t.featureFlagsRequestTimeoutMs)&&void 0!==d?d:3e3,this.remoteConfigRequestTimeoutMs=null!==(h=t.remoteConfigRequestTimeoutMs)&&void 0!==h?h:3e3,this.disableGeoip=null===(p=t.disableGeoip)||void 0===p||p,this.disabled=null!==(g=t.disabled)&&void 0!==g&&g,this.historicalMigration=null!==(f=null==(_=t)?void 0:_.historicalMigration)&&void 0!==f&&f,this.evaluationEnvironments=null==(v=t)?void 0:v.evaluationEnvironments,this._initPromise=Promise.resolve(),this._isInitialized=!0,this._logger=ee("[PostHog]",this.logMsgIfDebug.bind(this)),this.disableCompression=!("CompressionStream"in globalThis)||null!==(m=null==(y=t)?void 0:y.disableCompression)&&void 0!==m&&m}logMsgIfDebug(e){this.isDebug&&e()}wrap(e){if(!this.disabled)return this._isInitialized?e():void this._initPromise.then((()=>e()));this._logger.warn("The client is disabled")}getCommonEventProperties(){return{$lib:this.getLibraryId(),$lib_version:this.getLibraryVersion()}}get optedOut(){var e;return null!==(e=this.getPersistedProperty(y.OptedOut))&&void 0!==e?e:!this.defaultOptIn}optIn(){var e=this;return t((function*(){e.wrap((()=>{e.setPersistedProperty(y.OptedOut,!1)}))}))()}optOut(){var e=this;return t((function*(){e.wrap((()=>{e.setPersistedProperty(y.OptedOut,!0)}))}))()}on(e,t){return this._events.on(e,t)}debug(e){var t;if(void 0===e&&(e=!0),null==(t=this.removeDebugCallback)||t.call(this),e){var r=this.on("*",((e,t)=>this._logger.info(e,t)));this.removeDebugCallback=()=>{r(),this.removeDebugCallback=void 0}}}get isDebug(){return!!this.removeDebugCallback}get isDisabled(){return this.disabled}buildPayload(e){return{distinct_id:e.distinct_id,event:e.event,properties:r({},e.properties||{},this.getCommonEventProperties())}}addPendingPromise(e){return this.promiseQueue.add(e)}identifyStateless(e,t,i){this.wrap((()=>{var s=r({},this.buildPayload({distinct_id:e,event:"$identify",properties:t}));this.enqueue("identify",s,i)}))}identifyStatelessImmediate(e,i,s){var n=this;return t((function*(){var t=r({},n.buildPayload({distinct_id:e,event:"$identify",properties:i}));yield n.sendImmediate("identify",t,s)}))()}captureStateless(e,t,r,i){this.wrap((()=>{var s=this.buildPayload({distinct_id:e,event:t,properties:r});this.enqueue("capture",s,i)}))}captureStatelessImmediate(e,r,i,s){var n=this;return t((function*(){var t=n.buildPayload({distinct_id:e,event:r,properties:i});yield n.sendImmediate("capture",t,s)}))()}aliasStateless(e,t,i,s){this.wrap((()=>{var n=this.buildPayload({event:"$create_alias",distinct_id:t,properties:r({},i||{},{distinct_id:t,alias:e})});this.enqueue("alias",n,s)}))}aliasStatelessImmediate(e,i,s,n){var o=this;return t((function*(){var t=o.buildPayload({event:"$create_alias",distinct_id:i,properties:r({},s||{},{distinct_id:i,alias:e})});yield o.sendImmediate("alias",t,n)}))()}groupIdentifyStateless(e,t,i,s,n,o){this.wrap((()=>{var a=this.buildPayload({distinct_id:n||"$"+e+"_"+t,event:"$groupidentify",properties:r({$group_type:e,$group_key:t,$group_set:i||{}},o||{})});this.enqueue("capture",a,s)}))}getRemoteConfig(){var e=this;return t((function*(){yield e._initPromise;var t=e.host;"https://us.i.posthog.com"===t?t="https://us-assets.i.posthog.com":"https://eu.i.posthog.com"===t&&(t="https://eu-assets.i.posthog.com");var i=t+"/array/"+e.apiKey+"/config",s={method:"GET",headers:r({},e.getCustomHeaders(),{"Content-Type":"application/json"})};return e.fetchWithRetry(i,s,{retryCount:0},e.remoteConfigRequestTimeoutMs).then((e=>e.json())).catch((t=>{e._logger.error("Remote config could not be loaded",t),e._events.emit("error",t)}))}))()}getFlags(e,s,n,o,a,l){var u=this;return t((function*(){void 0===s&&(s={}),void 0===n&&(n={}),void 0===o&&(o={}),void 0===a&&(a={}),void 0===l&&(l=!0),yield u._initPromise;var t=l?"&config=true":"",c=u.host+"/flags/?v=2"+t,d=r({token:u.apiKey,distinct_id:e,groups:s,person_properties:n,group_properties:o},a);u.evaluationEnvironments&&u.evaluationEnvironments.length>0&&(d.evaluation_environments=u.evaluationEnvironments);var h={method:"POST",headers:r({},u.getCustomHeaders(),{"Content-Type":"application/json"}),body:JSON.stringify(d)};return u._logger.info("Flags URL",c),u.fetchWithRetry(c,h,{retryCount:0},u.featureFlagsRequestTimeoutMs).then((e=>e.json())).then((e=>i(e))).catch((e=>{u._events.emit("error",e)}))}))()}getFeatureFlagStateless(e,r,i,s,n,o){var l=this;return t((function*(){void 0===i&&(i={}),void 0===s&&(s={}),void 0===n&&(n={}),yield l._initPromise;var t=yield l.getFeatureFlagDetailStateless(e,r,i,s,n,o);if(void 0===t)return{response:void 0,requestId:void 0};var u=a(t.response);return void 0===u&&(u=!1),{response:u,requestId:t.requestId}}))()}getFeatureFlagDetailStateless(e,r,i,s,n,o){var a=this;return t((function*(){void 0===i&&(i={}),void 0===s&&(s={}),void 0===n&&(n={}),yield a._initPromise;var t=yield a.getFeatureFlagDetailsStateless(r,i,s,n,o,[e]);if(void 0!==t)return{response:t.flags[e],requestId:t.requestId}}))()}getFeatureFlagPayloadStateless(e,r,i,s,n,o){var a=this;return t((function*(){void 0===i&&(i={}),void 0===s&&(s={}),void 0===n&&(n={}),yield a._initPromise;var t=yield a.getFeatureFlagPayloadsStateless(r,i,s,n,o,[e]);if(t){var l=t[e];return void 0===l?null:l}}))()}getFeatureFlagPayloadsStateless(e,r,i,s,n,o){var a=this;return t((function*(){return void 0===r&&(r={}),void 0===i&&(i={}),void 0===s&&(s={}),yield a._initPromise,(yield a.getFeatureFlagsAndPayloadsStateless(e,r,i,s,n,o)).payloads}))()}getFeatureFlagsStateless(e,r,i,s,n,o){var a=this;return t((function*(){return void 0===r&&(r={}),void 0===i&&(i={}),void 0===s&&(s={}),yield a._initPromise,yield a.getFeatureFlagsAndPayloadsStateless(e,r,i,s,n,o)}))()}getFeatureFlagsAndPayloadsStateless(e,r,i,s,n,o){var a=this;return t((function*(){void 0===r&&(r={}),void 0===i&&(i={}),void 0===s&&(s={}),yield a._initPromise;var t=yield a.getFeatureFlagDetailsStateless(e,r,i,s,n,o);return t?{flags:t.featureFlags,payloads:t.featureFlagPayloads,requestId:t.requestId}:{flags:void 0,payloads:void 0,requestId:void 0}}))()}getFeatureFlagDetailsStateless(e,r,i,s,n,o){var a=this;return t((function*(){var t;void 0===r&&(r={}),void 0===i&&(i={}),void 0===s&&(s={}),yield a._initPromise;var l={};(null!=n?n:a.disableGeoip)&&(l.geoip_disable=!0),o&&(l.flag_keys_to_evaluate=o);var u=yield a.getFlags(e,r,i,s,l);if(void 0!==u)return u.errorsWhileComputingFlags&&console.error("[FEATURE FLAGS] Error while computing feature flags, some flags may be missing or incorrect. Learn more at https://posthog.com/docs/feature-flags/best-practices"),null!=(t=u.quotaLimited)&&t.includes("feature_flags")?(console.warn("[FEATURE FLAGS] Feature flags quota limit exceeded - feature flags unavailable. Learn more about billing limits at https://posthog.com/docs/billing/limits-alerts"),{flags:{},featureFlags:{},featureFlagPayloads:{},requestId:null==u?void 0:u.requestId}):u}))()}getSurveysStateless(){var e=this;return t((function*(){if(yield e._initPromise,!0===e.disableSurveys)return e._logger.info("Loading surveys is disabled."),[];var t=e.host+"/api/surveys/?token="+e.apiKey,i={method:"GET",headers:r({},e.getCustomHeaders(),{"Content-Type":"application/json"})},s=yield e.fetchWithRetry(t,i).then((t=>{if(200!==t.status||!t.json){var r="Surveys API could not be loaded: "+t.status,i=new Error(r);return e._logger.error(i),void e._events.emit("error",new Error(r))}return t.json()})).catch((t=>{e._logger.error("Surveys API could not be loaded",t),e._events.emit("error",t)})),n=null==s?void 0:s.surveys;return n&&e._logger.info("Surveys fetched from API: ",JSON.stringify(n)),null!=n?n:[]}))()}get props(){return this._props||(this._props=this.getPersistedProperty(y.Props)),this._props||{}}set props(e){this._props=e}register(e){var i=this;return t((function*(){i.wrap((()=>{i.props=r({},i.props,e),i.setPersistedProperty(y.Props,i.props)}))}))()}unregister(e){var r=this;return t((function*(){r.wrap((()=>{delete r.props[e],r.setPersistedProperty(y.Props,r.props)}))}))()}enqueue(e,t,r){this.wrap((()=>{if(this.optedOut)this._events.emit(e,"Library is disabled. Not sending event. To re-enable, call posthog.optIn()");else{var i=this.prepareMessage(e,t,r),s=this.getPersistedProperty(y.Queue)||[];s.length>=this.maxQueueSize&&(s.shift(),this._logger.info("Queue is full, the oldest event is dropped.")),s.push({message:i}),this.setPersistedProperty(y.Queue,s),this._events.emit(e,i),s.length>=this.flushAt&&this.flushBackground(),this.flushInterval&&!this._flushTimer&&(this._flushTimer=W((()=>this.flushBackground()),this.flushInterval))}}))}sendImmediate(e,i,s){var n=this;return t((function*(){if(n.disabled)n._logger.warn("The client is disabled");else if(n._isInitialized||(yield n._initPromise),n.optedOut)n._events.emit(e,"Library is disabled. Not sending event. To re-enable, call posthog.optIn()");else{var t={api_key:n.apiKey,batch:[n.prepareMessage(e,i,s)],sent_at:K()};n.historicalMigration&&(t.historical_migration=!0);var o=JSON.stringify(t),a=n.host+"/batch/",l=n.disableCompression?null:yield Y(o,n.isDebug),u={method:"POST",headers:r({},n.getCustomHeaders(),{"Content-Type":"application/json"},null!==l&&{"Content-Encoding":"gzip"}),body:l||o};try{yield n.fetchWithRetry(a,u)}catch(e){n._events.emit("error",e)}}}))()}prepareMessage(e,t,i){var s,n=r({},t,{type:e,library:this.getLibraryId(),library_version:this.getLibraryVersion(),timestamp:null!=i&&i.timestamp?null==i?void 0:i.timestamp:K(),uuid:null!=i&&i.uuid?i.uuid:v()});return(null!==(s=null==i?void 0:i.disableGeoip)&&void 0!==s?s:this.disableGeoip)&&(n.properties||(n.properties={}),n.properties.$geoip_disable=!0),n.distinctId&&(n.distinct_id=n.distinctId,delete n.distinctId),n}clearFlushTimer(){this._flushTimer&&(clearTimeout(this._flushTimer),this._flushTimer=void 0)}flushBackground(){this.flush().catch(function(){var e=t((function*(e){yield se(e)}));return function(t){return e.apply(this,arguments)}}())}flush(){var e=this;return t((function*(){var t=J([e.flushPromise]).then((()=>e._flush()));return e.flushPromise=t,e.addPendingPromise(t),J([t]).then((()=>{e.flushPromise===t&&(e.flushPromise=null)})),t}))()}getCustomHeaders(){var e=this.getCustomUserAgent(),t={};return e&&""!==e&&(t["User-Agent"]=e),t}_flush(){var e=this;return t((function*(){e.clearFlushTimer(),yield e._initPromise;var t=e.getPersistedProperty(y.Queue)||[];if(t.length){for(var i=[],s=t.length,n=function*(){var s=t.slice(0,e.maxBatchSize),n=s.map((e=>e.message)),o=()=>{var r=(e.getPersistedProperty(y.Queue)||[]).slice(s.length);e.setPersistedProperty(y.Queue,r),t=r},a={api_key:e.apiKey,batch:n,sent_at:K()};e.historicalMigration&&(a.historical_migration=!0);var l=JSON.stringify(a),u=e.host+"/batch/",c=e.disableCompression?null:yield Y(l,e.isDebug),d={method:"POST",headers:r({},e.getCustomHeaders(),{"Content-Type":"application/json"},null!==c&&{"Content-Encoding":"gzip"}),body:c||l},h={retryCheck:e=>!ae(e)&&oe(e)};try{yield e.fetchWithRetry(u,d,h)}catch(t){if(ae(t)&&n.length>1)return e.maxBatchSize=Math.max(1,Math.floor(n.length/2)),e._logger.warn("Received 413 when sending batch of size "+n.length+", reducing batch size to "+e.maxBatchSize),1;throw t instanceof re||o(),e._events.emit("error",t),t}o(),i.push(...n)};t.length>0&&i.length<s;)yield*n();e._events.emit("flush",i)}}))()}fetchWithRetry(e,i,s,n){var o=this;return t((function*(){var a,l;null!==(l=(a=AbortSignal).timeout)&&void 0!==l||(a.timeout=function(e){var t=new AbortController;return setTimeout((()=>t.abort()),e),t.signal});var u=i.body?i.body:"",c=-1;try{c=u instanceof Blob?u.size:Buffer.byteLength(u,"utf8")}catch(e){if(u instanceof Blob)c=u.size;else{var d=(new TextEncoder).encode(u);c=d.length}}return yield function(e,t){return V.apply(this,arguments)}(t((function*(){var t=null;try{t=yield o.fetch(e,r({signal:AbortSignal.timeout(null!=n?n:o.requestTimeout)},i))}catch(e){throw new re(e)}if(!("no-cors"===i.mode)&&(t.status<200||t.status>=400))throw new te(t,c);return t})),r({},o._retryOptions,s))}))()}_shutdown(e){var r=this;return t((function*(){void 0===e&&(e=3e4),yield r._initPromise;var i=!1;r.clearFlushTimer();var s=function(){var e=t((function*(){try{for(yield r.promiseQueue.join();;){if(0===(r.getPersistedProperty(y.Queue)||[]).length)break;if(yield r.flush(),i)break}}catch(e){if(!oe(e))throw e;yield se(e)}}));return function(){return e.apply(this,arguments)}}();return Promise.race([new Promise(((t,s)=>{W((()=>{r._logger.error("Timed out while shutting down PostHog"),i=!0,s("Timeout while shutting down PostHog. Some events may not have been sent.")}),e)})),s()])}))()}shutdown(e){var r=this;return t((function*(){return void 0===e&&(e=3e4),r.shutdownPromise?r._logger.warn("shutdown() called while already shutting down. shutdown() is meant to be called once before process exit - use flush() for per-request cleanup"):r.shutdownPromise=r._shutdown(e).finally((()=>{r.shutdownPromise=null})),r.shutdownPromise}))()}}class ce extends ue{constructor(e,t){var i,s,n,o;super(e,r({},t,{disableGeoip:null!==(i=null==t?void 0:t.disableGeoip)&&void 0!==i&&i,featureFlagsRequestTimeoutMs:null!==(s=null==t?void 0:t.featureFlagsRequestTimeoutMs)&&void 0!==s?s:1e4})),this.flagCallReported={},this._sessionMaxLengthSeconds=86400,this.sessionProps={},this.sendFeatureFlagEvent=null===(n=null==t?void 0:t.sendFeatureFlagEvent)||void 0===n||n,this._sessionExpirationTimeSeconds=null!==(o=null==t?void 0:t.sessionExpirationTimeSeconds)&&void 0!==o?o:1800}setupBootstrap(e){var t,i=null==e?void 0:e.bootstrap;if(i){if(i.distinctId)if(i.isIdentifiedId){this.getPersistedProperty(y.DistinctId)||this.setPersistedProperty(y.DistinctId,i.distinctId)}else{this.getPersistedProperty(y.AnonymousId)||this.setPersistedProperty(y.AnonymousId,i.distinctId)}var s=i.featureFlags,n=null!==(t=i.featureFlagPayloads)&&void 0!==t?t:{};if(s&&Object.keys(s).length){var o=u(s,n);if(Object.keys(o.flags).length>0){this.setBootstrappedFeatureFlagDetails(o);var a=this.getKnownFeatureFlagDetails()||{flags:{},requestId:void 0},l={flags:r({},o.flags,a.flags),requestId:o.requestId};this.setKnownFeatureFlagDetails(l)}}}}clearProps(){this.props=void 0,this.sessionProps={},this.flagCallReported={}}on(e,t){return this._events.on(e,t)}reset(e){this.wrap((()=>{var t=[y.Queue,...e||[]];for(var r of(this.clearProps(),Object.keys(y)))t.includes(y[r])||this.setPersistedProperty(y[r],null);this.reloadFeatureFlags()}))}getCommonEventProperties(){var e=this.getFeatureFlags(),t={};if(e)for(var[i,s]of Object.entries(e))t["$feature/"+i]=s;return r({},ie("$active_feature_flags",e?Object.keys(e):void 0),t,super.getCommonEventProperties())}enrichProperties(e){return r({},this.props,this.sessionProps,e||{},this.getCommonEventProperties(),{$session_id:this.getSessionId()})}getSessionId(){if(!this._isInitialized)return"";var e=this.getPersistedProperty(y.SessionId),t=this.getPersistedProperty(y.SessionLastTimestamp)||0,r=this.getPersistedProperty(y.SessionStartTimestamp)||0,i=Date.now(),s=i-r;return(!e||i-t>1e3*this._sessionExpirationTimeSeconds||s>1e3*this._sessionMaxLengthSeconds)&&(e=v(),this.setPersistedProperty(y.SessionId,e),this.setPersistedProperty(y.SessionStartTimestamp,i)),this.setPersistedProperty(y.SessionLastTimestamp,i),e}resetSessionId(){this.wrap((()=>{this.setPersistedProperty(y.SessionId,null),this.setPersistedProperty(y.SessionLastTimestamp,null),this.setPersistedProperty(y.SessionStartTimestamp,null)}))}getAnonymousId(){if(!this._isInitialized)return"";var e=this.getPersistedProperty(y.AnonymousId);return e||(e=v(),this.setPersistedProperty(y.AnonymousId,e)),e}getDistinctId(){return this._isInitialized?this.getPersistedProperty(y.DistinctId)||this.getAnonymousId():""}registerForSession(e){this.sessionProps=r({},this.sessionProps,e)}unregisterForSession(e){delete this.sessionProps[e]}identify(e,t,i){this.wrap((()=>{var s=this.getDistinctId();e=e||s,null!=t&&t.$groups&&this.groups(t.$groups);var n=null==t?void 0:t.$set_once;null==t||delete t.$set_once;var o=(null==t?void 0:t.$set)||t,a=this.enrichProperties(r({$anon_distinct_id:this.getAnonymousId()},ie("$set",o),ie("$set_once",n)));e!==s&&(this.setPersistedProperty(y.AnonymousId,s),this.setPersistedProperty(y.DistinctId,e),this.reloadFeatureFlags()),super.identifyStateless(e,a,i)}))}capture(e,t,r){this.wrap((()=>{var i=this.getDistinctId();null!=t&&t.$groups&&this.groups(t.$groups);var s=this.enrichProperties(t);super.captureStateless(i,e,s,r)}))}alias(e){this.wrap((()=>{var t=this.getDistinctId(),r=this.enrichProperties({});super.aliasStateless(e,t,r)}))}autocapture(e,t,i,s){void 0===i&&(i={}),this.wrap((()=>{var n={distinct_id:this.getDistinctId(),event:"$autocapture",properties:r({},this.enrichProperties(i),{$event_type:e,$elements:t})};this.enqueue("autocapture",n,s)}))}groups(e){this.wrap((()=>{var t=this.props.$groups||{};this.register({$groups:r({},t,e)}),Object.keys(e).find((r=>t[r]!==e[r]))&&this.reloadFeatureFlags()}))}group(e,t,r,i){this.wrap((()=>{this.groups({[e]:t}),r&&this.groupIdentify(e,t,r,i)}))}groupIdentify(e,t,r,i){this.wrap((()=>{var s=this.getDistinctId(),n=this.enrichProperties({});super.groupIdentifyStateless(e,t,r,i,s,n)}))}setPersonPropertiesForFlags(e){this.wrap((()=>{var t=this.getPersistedProperty(y.PersonProperties)||{};this.setPersistedProperty(y.PersonProperties,r({},t,e))}))}resetPersonPropertiesForFlags(){this.wrap((()=>{this.setPersistedProperty(y.PersonProperties,null)}))}setGroupPropertiesForFlags(e){this.wrap((()=>{var t=this.getPersistedProperty(y.GroupProperties)||{};0!==Object.keys(t).length&&Object.keys(t).forEach((i=>{t[i]=r({},t[i],e[i]),delete e[i]})),this.setPersistedProperty(y.GroupProperties,r({},t,e))}))}resetGroupPropertiesForFlags(){this.wrap((()=>{this.setPersistedProperty(y.GroupProperties,null)}))}remoteConfigAsync(){var e=this;return t((function*(){return yield e._initPromise,e._remoteConfigResponsePromise?e._remoteConfigResponsePromise:e._remoteConfigAsync()}))()}flagsAsync(e,r){var i=this;return t((function*(){return void 0===e&&(e=!0),void 0===r&&(r=!0),yield i._initPromise,i._flagsResponsePromise?i._flagsResponsePromise:i._flagsAsync(e,r)}))()}cacheSessionReplay(e,t){var r=null==t?void 0:t.sessionRecording;r?(this.setPersistedProperty(y.SessionReplay,r),this._logger.info("Session replay config from "+e+": ",JSON.stringify(r))):"boolean"==typeof r&&!1===r&&(this._logger.info("Session replay config from "+e+" disabled."),this.setPersistedProperty(y.SessionReplay,null))}_remoteConfigAsync(){var e=()=>super.getRemoteConfig,i=this;return t((function*(){return i._remoteConfigResponsePromise=i._initPromise.then((()=>{var t=i.getPersistedProperty(y.RemoteConfig);return i._logger.info("Cached remote config: ",JSON.stringify(t)),e().call(i).then((e=>{if(e){var s,n=r({},e);if(delete n.surveys,i._logger.info("Fetched remote config: ",JSON.stringify(n)),!1===i.disableSurveys){var o=e.surveys,a=!0;Array.isArray(o)?i._logger.info("Surveys fetched from remote config: ",JSON.stringify(o)):(i._logger.info("There are no surveys."),a=!1),a?i.setPersistedProperty(y.Surveys,o):i.setPersistedProperty(y.Surveys,null)}else i.setPersistedProperty(y.Surveys,null);i.setPersistedProperty(y.RemoteConfig,n),i.cacheSessionReplay("remote config",e),!1===e.hasFeatureFlags?(i.setKnownFeatureFlagDetails({flags:{}}),i._logger.warn("Remote config has no feature flags, will not load feature flags.")):!1!==i.preloadFeatureFlags&&i.reloadFeatureFlags(),null!=(s=e.supportedCompression)&&s.includes(b.GZipJS)||(i.disableCompression=!0),t=e}return t}))})).finally((()=>{i._remoteConfigResponsePromise=void 0})),i._remoteConfigResponsePromise}))()}_flagsAsync(e,i){var s=()=>super.getFlags,n=this;return t((function*(){return void 0===e&&(e=!0),void 0===i&&(i=!0),n._flagsResponsePromise=n._initPromise.then(t((function*(){var t,o=n.getDistinctId(),a=n.props.$groups||{},l=n.getPersistedProperty(y.PersonProperties)||{},u=n.getPersistedProperty(y.GroupProperties)||{},c={$anon_distinct_id:e?n.getAnonymousId():void 0},d=yield s().call(n,o,a,l,u,c,i);if(null!=d&&null!=(t=d.quotaLimited)&&t.includes(le.FeatureFlags))return n.setKnownFeatureFlagDetails(null),console.warn("[FEATURE FLAGS] Feature flags quota limit exceeded - unsetting all flags. Learn more about billing limits at https://posthog.com/docs/billing/limits-alerts"),d;if(null!=d&&d.featureFlags){n.sendFeatureFlagEvent&&(n.flagCallReported={});var h=d;if(d.errorsWhileComputingFlags){var p=n.getKnownFeatureFlagDetails();n._logger.info("Cached feature flags: ",JSON.stringify(p)),h=r({},d,{flags:r({},null==p?void 0:p.flags,d.flags)})}n.setKnownFeatureFlagDetails(h),n.setPersistedProperty(y.FlagsEndpointWasHit,!0),n.cacheSessionReplay("flags",d)}return d}))).finally((()=>{n._flagsResponsePromise=void 0})),n._flagsResponsePromise}))()}setKnownFeatureFlagDetails(e){this.wrap((()=>{var t;this.setPersistedProperty(y.FeatureFlagDetails,e),this._events.emit("featureflags",n(null!==(t=null==e?void 0:e.flags)&&void 0!==t?t:{}))}))}getKnownFeatureFlagDetails(){var e=this.getPersistedProperty(y.FeatureFlagDetails);if(!e){var t=this.getPersistedProperty(y.FeatureFlags),r=this.getPersistedProperty(y.FeatureFlagPayloads);if(void 0===t&&void 0===r)return;return u(null!=t?t:{},null!=r?r:{})}return i(e)}getKnownFeatureFlags(){var e=this.getKnownFeatureFlagDetails();if(e)return n(e.flags)}getKnownFeatureFlagPayloads(){var e=this.getKnownFeatureFlagDetails();if(e)return o(e.flags)}getBootstrappedFeatureFlagDetails(){var e=this.getPersistedProperty(y.BootstrapFeatureFlagDetails);if(e)return e}setBootstrappedFeatureFlagDetails(e){this.setPersistedProperty(y.BootstrapFeatureFlagDetails,e)}getBootstrappedFeatureFlags(){var e=this.getBootstrappedFeatureFlagDetails();if(e)return n(e.flags)}getBootstrappedFeatureFlagPayloads(){var e=this.getBootstrappedFeatureFlagDetails();if(e)return o(e.flags)}getFeatureFlag(e){var t=this.getFeatureFlagDetails();if(t){var i=t.flags[e],s=a(i);if(void 0===s&&(s=!1),this.sendFeatureFlagEvent&&!this.flagCallReported[e]){var n,o,l,u,c,d,h,p=null==(n=this.getBootstrappedFeatureFlags())?void 0:n[e],g=null==(o=this.getBootstrappedFeatureFlagPayloads())?void 0:o[e];this.flagCallReported[e]=!0,this.capture("$feature_flag_called",r({$feature_flag:e,$feature_flag_response:s},ie("$feature_flag_id",null==i||null==(l=i.metadata)?void 0:l.id),ie("$feature_flag_version",null==i||null==(u=i.metadata)?void 0:u.version),ie("$feature_flag_reason",null!==(c=null==i||null==(d=i.reason)?void 0:d.description)&&void 0!==c?c:null==i||null==(h=i.reason)?void 0:h.code),ie("$feature_flag_bootstrapped_response",p),ie("$feature_flag_bootstrapped_payload",g),{$used_bootstrap_value:!this.getPersistedProperty(y.FlagsEndpointWasHit)},ie("$feature_flag_request_id",t.requestId)))}return s}}getFeatureFlagPayload(e){var t=this.getFeatureFlagPayloads();if(t){var r=t[e];return void 0===r?null:r}}getFeatureFlagPayloads(){var e;return null==(e=this.getFeatureFlagDetails())?void 0:e.featureFlagPayloads}getFeatureFlags(){var e;return null==(e=this.getFeatureFlagDetails())?void 0:e.featureFlags}getFeatureFlagDetails(){var e,t=this.getKnownFeatureFlagDetails(),s=this.getPersistedProperty(y.OverrideFeatureFlags);if(!s)return t;var n,o,a=null!==(e=(t=null!=t?t:{featureFlags:{},featureFlagPayloads:{},flags:{}}).flags)&&void 0!==e?e:{};for(var l in s)s[l]?a[l]=(n=a[l],o=s[l],r({},n,{enabled:c(o),variant:d(o)})):delete a[l];var u=r({},t,{flags:a});return i(u)}getFeatureFlagsAndPayloads(){return{flags:this.getFeatureFlags(),payloads:this.getFeatureFlagPayloads()}}isFeatureEnabled(e){var t=this.getFeatureFlag(e);if(void 0!==t)return!!t}reloadFeatureFlags(e){this.flagsAsync(!0).then((t=>{null==e||null==e.cb||e.cb(void 0,null==t?void 0:t.featureFlags)})).catch((t=>{null==e||null==e.cb||e.cb(t,void 0),null!=e&&e.cb||this._logger.info("Error reloading feature flags",t)}))}reloadRemoteConfigAsync(){var e=this;return t((function*(){return yield e.remoteConfigAsync()}))()}reloadFeatureFlagsAsync(e){var r=this;return t((function*(){var t;return null==(t=yield r.flagsAsync(null==e||e))?void 0:t.featureFlags}))()}onFeatureFlags(e){var r=this;return this.on("featureflags",t((function*(){var t=r.getFeatureFlags();t&&e(t)})))}onFeatureFlag(e,r){var i=this;return this.on("featureflags",t((function*(){var t=i.getFeatureFlag(e);void 0!==t&&r(t)})))}overrideFeatureFlag(e){var r=this;return t((function*(){r.wrap((()=>null===e?r.setPersistedProperty(y.OverrideFeatureFlags,null):r.setPersistedProperty(y.OverrideFeatureFlags,e)))}))()}captureException(e,t){var i=r({$exception_level:"error",$exception_list:[{type:U(e)?e.name:"Error",value:U(e)?e.message:e,mechanism:{handled:!0,synthetic:!1}}]},t);this.capture("$exception",i)}captureTraceFeedback(e,t){this.capture("$ai_feedback",{$ai_feedback_text:t,$ai_trace_id:String(e)})}captureTraceMetric(e,t,r){this.capture("$ai_metric",{$ai_metric_name:t,$ai_metric_value:String(r),$ai_trace_id:String(e)})}}var de={},he=Array.prototype,pe=he.forEach,ge=he.indexOf,fe="undefined"!=typeof window?window:void 0,_e="undefined"!=typeof globalThis?globalThis:fe,ve=null==_e?void 0:_e.navigator,me=null==_e?void 0:_e.document,ye=null==_e?void 0:_e.location;null==_e||_e.fetch,null!=_e&&_e.XMLHttpRequest&&"withCredentials"in new _e.XMLHttpRequest&&_e.XMLHttpRequest,null==_e||_e.AbortController;var be=null==ve?void 0:ve.userAgent,we=null!=fe?fe:{};function Pe(e,t,r){if(k(e))if(pe&&e.forEach===pe)e.forEach(t,r);else if("length"in e&&e.length===+e.length)for(var i=0,s=e.length;i<s;i++)if(i in e&&t.call(r,e[i],i)===de)return}function Se(e,t,r){if(!M(e)){if(k(e))return Pe(e,t,r);if(j(e)){for(var i of e.entries())if(t.call(r,i[1],i[0])===de)return}else for(var s in e)if(x.call(e,s)&&t.call(r,e[s],s)===de)return}}var Ie=function(e){for(var t=arguments.length,r=new Array(t>1?t-1:0),i=1;i<t;i++)r[i-1]=arguments[i];return Pe(r,(function(t){for(var r in t)void 0!==t[r]&&(e[r]=t[r])})),e},Fe=function(e){for(var t=arguments.length,r=new Array(t>1?t-1:0),i=1;i<t;i++)r[i-1]=arguments[i];return Pe(r,(function(t){Pe(t,(function(t){e.push(t)}))})),e};function xe(e){for(var t=Object.keys(e),r=t.length,i=new Array(r);r--;)i[r]=[t[r],e[t[r]]];return i}function Ee(e,t,r,i){var{capture:s=!1,passive:n=!0}=null!=i?i:{};null==e||e.addEventListener(t,r,{capture:s,passive:n})}var ke=function(e){var t={};return Se(e,(function(e,r){(R(e)&&e.length>0||N(e))&&(t[r]=e)})),t},$e=["herokuapp.com","vercel.app","netlify.app"];function Ce(e){var t=null==e?void 0:e.hostname;if(!R(t))return!1;var r=t.split(".").slice(-2).join(".");for(var i of $e)if(r===i)return!1;return!0}function Ae(e,t){return r=e,i=e=>R(e)&&!D(t)?e.slice(0,t):e,s=new Set,function e(t,r){return t!==Object(t)?i?i(t,r):t:s.has(t)?void 0:(s.add(t),k(t)?(n=[],Pe(t,(t=>{n.push(e(t))}))):(n={},Se(t,((t,r)=>{s.has(t)||(n[r]=e(t,r))}))),n);var n}(r);var r,i,s}var Oe="__timers",Te="$autocapture_disabled_server_side",Re="$sesid",De="$enabled_feature_flags",Me="$user_state",Ne="$client_session_props",Le="$initial_campaign_params",je="$initial_referrer_info",Ue="$initial_person_info",qe="$epp",Be=["$people_distinct_id","__alias","__cmpns",Oe,"$session_recording_enabled_server_side","$heatmaps_enabled_server_side",Re,De,"$error_tracking_suppression_rules",Me,"$early_access_features","$feature_flag_details","$stored_group_properties","$stored_person_properties","$surveys","$flag_call_reported",Ne,"$capture_rate_limit",Le,je,qe,Ue,y.Queue,y.FeatureFlagDetails,y.FlagsEndpointWasHit,y.AnonymousId,y.RemoteConfig,y.Surveys,y.FeatureFlags],He="[Leanbase]",ze={info:function(){if("undefined"!=typeof console){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];console.log(He,...t)}},warn:function(){if("undefined"!=typeof console){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];console.warn(He,...t)}},error:function(){if("undefined"!=typeof console){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];console.error(He,...t)}},critical:function(){if("undefined"!=typeof console){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];console.error(He,"CRITICAL:",...t)}}};Math.trunc||(Math.trunc=function(e){return e<0?Math.ceil(e):Math.floor(e)}),Number.isInteger||(Number.isInteger=function(e){return N(e)&&isFinite(e)&&Math.floor(e)===e});var Ge="0123456789abcdef";class Ve{constructor(e){if(this.bytes=e,16!==e.length)throw new TypeError("not 128-bit length")}static fromFieldsV7(e,t,r,i){if(!Number.isInteger(e)||!Number.isInteger(t)||!Number.isInteger(r)||!Number.isInteger(i)||e<0||t<0||r<0||i<0||e>0xffffffffffff||t>4095||r>1073741823||i>4294967295)throw new RangeError("invalid field value");var s=new Uint8Array(16);return s[0]=e/Math.pow(2,40),s[1]=e/Math.pow(2,32),s[2]=e/Math.pow(2,24),s[3]=e/Math.pow(2,16),s[4]=e/Math.pow(2,8),s[5]=e,s[6]=112|t>>>8,s[7]=t,s[8]=128|r>>>24,s[9]=r>>>16,s[10]=r>>>8,s[11]=r,s[12]=i>>>24,s[13]=i>>>16,s[14]=i>>>8,s[15]=i,new Ve(s)}toString(){for(var e="",t=0;t<this.bytes.length;t++)e=e+Ge.charAt(this.bytes[t]>>>4)+Ge.charAt(15&this.bytes[t]),3!==t&&5!==t&&7!==t&&9!==t||(e+="-");if(36!==e.length)throw new Error("Invalid UUIDv7 was generated");return e}clone(){return new Ve(this.bytes.slice(0))}equals(e){return 0===this.compareTo(e)}compareTo(e){for(var t=0;t<16;t++){var r=this.bytes[t]-e.bytes[t];if(0!==r)return Math.sign(r)}return 0}}class Ke{constructor(){this._timestamp=0,this._counter=0,this._random=new Qe}generate(){var e=this.generateOrAbort();if(T(e)){this._timestamp=0;var t=this.generateOrAbort();if(T(t))throw new Error("Could not generate UUID after timestamp reset");return t}return e}generateOrAbort(){var e=Date.now();if(e>this._timestamp)this._timestamp=e,this._resetCounter();else{if(!(e+1e4>this._timestamp))return;this._counter++,this._counter>4398046511103&&(this._timestamp++,this._resetCounter())}return Ve.fromFieldsV7(this._timestamp,Math.trunc(this._counter/Math.pow(2,30)),this._counter&Math.pow(2,30)-1,this._random.nextUint32())}_resetCounter(){this._counter=1024*this._random.nextUint32()+(1023&this._random.nextUint32())}}var We,Je=e=>{if("undefined"!=typeof UUIDV7_DENY_WEAK_RNG&&UUIDV7_DENY_WEAK_RNG)throw new Error("no cryptographically strong RNG available");for(var t=0;t<e.length;t++)e[t]=65536*Math.trunc(65536*Math.random())+Math.trunc(65536*Math.random());return e};fe&&!T(fe.crypto)&&crypto.getRandomValues&&(Je=e=>crypto.getRandomValues(e));class Qe{constructor(){this._buffer=new Uint32Array(8),this._cursor=1/0}nextUint32(){return this._cursor>=this._buffer.length&&(Je(this._buffer),this._cursor=0),this._buffer[this._cursor++]}}var Ye=()=>Xe().toString(),Xe=()=>(We||(We=new Ke)).generate(),Ze="";var et=/[a-z0-9][a-z0-9-]+\.[a-z]{2,}$/i;function tt(e,t){if(t){var r=function(e,t){if(void 0===t&&(t=me),Ze)return Ze;if(!t)return"";if(["localhost","127.0.0.1"].includes(e))return"";for(var r=e.split("."),i=Math.min(r.length,8),s="dmn_chk_"+Ye();!Ze&&i--;){var n=r.slice(i).join("."),o=s+"=1;domain=."+n+";path=/";t.cookie=o+";max-age=3",t.cookie.includes(s)&&(t.cookie=o+";max-age=0",Ze=n)}return Ze}(e);if(!r){var i=(e=>{var t=e.match(et);return t?t[0]:""})(e);i!==r&&ze.info("Warning: cookie subdomain discovery mismatch",i,r),r=i}return r?"; domain=."+r:""}return""}var rt={_is_supported:()=>!!me,_error:function(e){ze.error("cookieStore error: "+e)},_get:function(e){if(me){try{for(var t=e+"=",r=me.cookie.split(";").filter((e=>e.length)),i=0;i<r.length;i++){for(var s=r[i];" "==s.charAt(0);)s=s.substring(1,s.length);if(0===s.indexOf(t))return decodeURIComponent(s.substring(t.length,s.length))}}catch(e){}return null}},_parse:function(e){var t;try{t=JSON.parse(rt._get(e))||{}}catch(e){}return t},_set:function(e,t,r,i,s){if(me)try{var n="",o="",a=tt(me.location.hostname,i);if(r){var l=new Date;l.setTime(l.getTime()+24*r*60*60*1e3),n="; expires="+l.toUTCString()}s&&(o="; secure");var u=e+"="+encodeURIComponent(JSON.stringify(t))+n+"; SameSite=Lax; path=/"+a+o;return u.length>3686.4&&ze.warn("cookieStore warning: large cookie, len="+u.length),me.cookie=u,u}catch(e){return}},_remove:function(e,t){if(null!=me&&me.cookie)try{rt._set(e,"",-1,t)}catch(e){return}}},it=null,st={_is_supported:function(){if(!D(it))return it;var e=!0;if(T(fe))e=!1;else try{var t="__mplssupport__";st._set(t,"xyz"),'"xyz"'!==st._get(t)&&(e=!1),st._remove(t)}catch(t){e=!1}return e||ze.error("localStorage unsupported; falling back to cookie store"),it=e,e},_error:function(e){ze.error("localStorage error: "+e)},_get:function(e){try{return null==fe?void 0:fe.localStorage.getItem(e)}catch(e){st._error(e)}return null},_parse:function(e){try{return JSON.parse(st._get(e))||{}}catch(e){}return null},_set:function(e,t){try{null==fe||fe.localStorage.setItem(e,JSON.stringify(t))}catch(e){st._error(e)}},_remove:function(e){try{null==fe||fe.localStorage.removeItem(e)}catch(e){st._error(e)}}},nt=["distinct_id",Re,"$session_is_sampled",qe,Ue],ot=r({},st,{_parse:function(e){try{var t={};try{t=rt._parse(e)||{}}catch(e){}var r=Ie(t,JSON.parse(st._get(e)||"{}"));return st._set(e,r),r}catch(e){}return null},_set:function(e,t,r,i,s,n){try{st._set(e,t,void 0,void 0,n);var o={};nt.forEach((e=>{t[e]&&(o[e]=t[e])})),Object.keys(o).length&&rt._set(e,o,r,i,s,n)}catch(e){st._error(e)}},_remove:function(e,t){try{null==fe||fe.localStorage.removeItem(e),rt._remove(e,t)}catch(e){st._error(e)}}}),at={},lt={_is_supported:function(){return!0},_error:function(e){ze.error("memoryStorage error: "+e)},_get:function(e){return at[e]||null},_parse:function(e){return at[e]||null},_set:function(e,t){at[e]=t},_remove:function(e){delete at[e]}},ut=null,ct={_is_supported:function(){if(!D(ut))return ut;if(ut=!0,T(fe))ut=!1;else try{var e="__support__";ct._set(e,"xyz"),'"xyz"'!==ct._get(e)&&(ut=!1),ct._remove(e)}catch(e){ut=!1}return ut},_error:function(e){ze.error("sessionStorage error: ",e)},_get:function(e){try{return null==fe?void 0:fe.sessionStorage.getItem(e)}catch(e){ct._error(e)}return null},_parse:function(e){try{return JSON.parse(ct._get(e))||null}catch(e){}return null},_set:function(e,t){try{null==fe||fe.sessionStorage.setItem(e,JSON.stringify(t))}catch(e){ct._error(e)}},_remove:function(e){try{null==fe||fe.sessionStorage.removeItem(e)}catch(e){ct._error(e)}}},dt=e=>{var t=null==me?void 0:me.createElement("a");return T(t)?null:(t.href=e,t)},ht=function(e,t){for(var r,i=((e.split("#")[0]||"").split(/\?(.*)/)[1]||"").replace(/^\?+/g,"").split("&"),s=0;s<i.length;s++){var n=i[s].split("=");if(n[0]===t){r=n;break}}if(!k(r)||r.length<2)return"";var o=r[1];try{o=decodeURIComponent(o)}catch(e){ze.error("Skipping decoding for malformed query param: "+o)}return o.replace(/\+/g," ")},pt=function(e,t,r){if(!e||!t||!t.length)return e;for(var i=e.split("#"),s=i[0]||"",n=i[1],o=s.split("?"),a=o[1],l=o[0],u=(a||"").split("&"),c=[],d=0;d<u.length;d++){var h=u[d].split("=");k(h)&&(t.includes(h[0])?c.push(h[0]+"="+r):c.push(u[d]))}var p=l;return null!=a&&(p+="?"+c.join("&")),null!=n&&(p+="#"+n),p},gt="Mobile",ft="iOS",_t="Android",vt="Tablet",mt=_t+" "+vt,yt="iPad",bt="Apple",wt=bt+" Watch",Pt="Safari",St="BlackBerry",It="Samsung",Ft=It+"Browser",xt=It+" Internet",Et="Chrome",kt=Et+" OS",$t=Et+" "+ft,Ct="Internet Explorer",At=Ct+" "+gt,Ot="Opera",Tt=Ot+" Mini",Rt="Edge",Dt="Microsoft "+Rt,Mt="Firefox",Nt=Mt+" "+ft,Lt="Nintendo",jt="PlayStation",Ut="Xbox",qt=_t+" "+gt,Bt=gt+" "+Pt,Ht="Windows",zt=Ht+" Phone",Gt="Nokia",Vt="Ouya",Kt="Generic",Wt=Kt+" "+gt.toLowerCase(),Jt=Kt+" "+vt.toLowerCase(),Qt="Konqueror",Yt="(\\d+(\\.\\d+)?)",Xt=new RegExp("Version/"+Yt),Zt=new RegExp(Ut,"i"),er=new RegExp(jt+" \\w+","i"),tr=new RegExp(Lt+" \\w+","i"),rr=new RegExp(St+"|PlayBook|BB10","i"),ir={"NT3.51":"NT 3.11","NT4.0":"NT 4.0","5.0":"2000",5.1:"XP",5.2:"XP","6.0":"Vista",6.1:"7",6.2:"8",6.3:"8.1",6.4:"10","10.0":"10"};var sr=(e,t)=>t&&w(t,bt)||function(e){return w(e,Pt)&&!w(e,Et)&&!w(e,_t)}(e),nr=function(e,t){return t=t||"",w(e," OPR/")&&w(e,"Mini")?Tt:w(e," OPR/")?Ot:rr.test(e)?St:w(e,"IE"+gt)||w(e,"WPDesktop")?At:w(e,Ft)?xt:w(e,Rt)||w(e,"Edg/")?Dt:w(e,"FBIOS")?"Facebook "+gt:w(e,"UCWEB")||w(e,"UCBrowser")?"UC Browser":w(e,"CriOS")?$t:w(e,"CrMo")||w(e,Et)?Et:w(e,_t)&&w(e,Pt)?qt:w(e,"FxiOS")?Nt:w(e.toLowerCase(),Qt.toLowerCase())?Qt:sr(e,t)?w(e,gt)?Bt:Pt:w(e,Mt)?Mt:w(e,"MSIE")||w(e,"Trident/")?Ct:w(e,"Gecko")?Mt:""},or={[At]:[new RegExp("rv:"+Yt)],[Dt]:[new RegExp(Rt+"?\\/"+Yt)],[Et]:[new RegExp("("+Et+"|CrMo)\\/"+Yt)],[$t]:[new RegExp("CriOS\\/"+Yt)],"UC Browser":[new RegExp("(UCBrowser|UCWEB)\\/"+Yt)],[Pt]:[Xt],[Bt]:[Xt],[Ot]:[new RegExp("(Opera|OPR)\\/"+Yt)],[Mt]:[new RegExp(Mt+"\\/"+Yt)],[Nt]:[new RegExp("FxiOS\\/"+Yt)],[Qt]:[new RegExp("Konqueror[:/]?"+Yt,"i")],[St]:[new RegExp(St+" "+Yt),Xt],[qt]:[new RegExp("android\\s"+Yt,"i")],[xt]:[new RegExp(Ft+"\\/"+Yt)],[Ct]:[new RegExp("(rv:|MSIE )"+Yt)],Mozilla:[new RegExp("rv:"+Yt)]},ar=function(e,t){var r=nr(e,t),i=or[r];if(T(i))return null;for(var s=0;s<i.length;s++){var n=i[s],o=e.match(n);if(o)return parseFloat(o[o.length-2])}return null},lr=[[new RegExp(Ut+"; "+Ut+" (.*?)[);]","i"),e=>[Ut,e&&e[1]||""]],[new RegExp(Lt,"i"),[Lt,""]],[new RegExp(jt,"i"),[jt,""]],[rr,[St,""]],[new RegExp(Ht,"i"),(e,t)=>{if(/Phone/.test(t)||/WPDesktop/.test(t))return[zt,""];if(new RegExp(gt).test(t)&&!/IEMobile\b/.test(t))return[Ht+" "+gt,""];var r=/Windows NT ([0-9.]+)/i.exec(t);if(r&&r[1]){var i=r[1],s=ir[i]||"";return/arm/i.test(t)&&(s="RT"),[Ht,s]}return[Ht,""]}],[/((iPhone|iPad|iPod).*?OS (\d+)_(\d+)_?(\d+)?|iPhone)/,e=>{if(e&&e[3]){var t=[e[3],e[4],e[5]||"0"];return[ft,t.join(".")]}return[ft,""]}],[/(watch.*\/(\d+\.\d+\.\d+)|watch os,(\d+\.\d+),)/i,e=>{var t="";return e&&e.length>=3&&(t=T(e[2])?e[3]:e[2]),["watchOS",t]}],[new RegExp("("+_t+" (\\d+)\\.(\\d+)\\.?(\\d+)?|"+_t+")","i"),e=>{if(e&&e[2]){var t=[e[2],e[3],e[4]||"0"];return[_t,t.join(".")]}return[_t,""]}],[/Mac OS X (\d+)[_.](\d+)[_.]?(\d+)?/i,e=>{var t=["Mac OS X",""];if(e&&e[1]){var r=[e[1],e[2],e[3]||"0"];t[1]=r.join(".")}return t}],[/Mac/i,["Mac OS X",""]],[/CrOS/,[kt,""]],[/Linux|debian/i,["Linux",""]]],ur=function(e){return tr.test(e)?Lt:er.test(e)?jt:Zt.test(e)?Ut:new RegExp(Vt,"i").test(e)?Vt:new RegExp("("+zt+"|WPDesktop)","i").test(e)?zt:/iPad/.test(e)?yt:/iPod/.test(e)?"iPod Touch":/iPhone/.test(e)?"iPhone":/(watch)(?: ?os[,/]|\d,\d\/)[\d.]+/i.test(e)?wt:rr.test(e)?St:/(kobo)\s(ereader|touch)/i.test(e)?"Kobo":new RegExp(Gt,"i").test(e)?Gt:/(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(gt).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)?_t:mt:_t:new RegExp("(pda|"+gt+")","i").test(e)?Wt:new RegExp(vt,"i").test(e)&&!new RegExp(vt+" pc","i").test(e)?Jt:""},cr={LIB_VERSION:"0.2.2"},dr="https?://(.*)",hr=["gclid","gclsrc","dclid","gbraid","wbraid","fbclid","msclkid","twclid","li_fat_id","igshid","ttclid","rdt_cid","epik","qclid","sccid","irclid","_kx"],pr=Fe(["utm_source","utm_medium","utm_campaign","utm_content","utm_term","gad_source","mc_cid"],hr),gr="<masked>",fr=["li_fat_id"];function _r(e,t,r){if(!me)return{};var i,s=t?Fe([],hr,r||[]):[],n=vr(pt(me.URL,s,gr),e),o=(i={},Se(fr,(function(e){var t=rt._get(e);i[e]=t||null})),i);return Ie(o,n)}function vr(e,t){var r=pr.concat(t||[]),i={};return Se(r,(function(t){var r=ht(e,t);i[t]=r||null})),i}function mr(e){var t=function(e){return e?0===e.search(dr+"google.([^/?]*)")?"google":0===e.search(dr+"bing.com")?"bing":0===e.search(dr+"yahoo.com")?"yahoo":0===e.search(dr+"duckduckgo.com")?"duckduckgo":null:null}(e),r="yahoo"!=t?"q":"p",i={};if(!D(t)){i.$search_engine=t;var s=me?ht(me.referrer,r):"";s.length&&(i.ph_keyword=s)}return i}function yr(){return navigator.language||navigator.userLanguage}function br(){return(null==me?void 0:me.referrer)||"$direct"}function wr(e,t){var r=e?Fe([],hr,t||[]):[],i=null==ye?void 0:ye.href.substring(0,1e3);return{r:br().substring(0,1e3),u:i?pt(i,r,gr):void 0}}function Pr(e){var t,{r:r,u:i}=e,s={$referrer:r,$referring_domain:null==r?void 0:"$direct"==r?"$direct":null==(t=dt(r))?void 0:t.host};if(i){s.$current_url=i;var n=dt(i);s.$host=null==n?void 0:n.host,s.$pathname=null==n?void 0:n.pathname;var o=vr(i);Ie(s,o)}if(r){var a=mr(r);Ie(s,a)}return s}function Sr(){try{return Intl.DateTimeFormat().resolvedOptions().timeZone}catch(e){return}}function Ir(){try{return(new Date).getTimezoneOffset()}catch(e){return}}function Fr(e,t){if(!be)return{};var r,i,s,n=e?Fe([],hr,t||[]):[],[o,a]=function(e){for(var t=0;t<lr.length;t++){var[r,i]=lr[t],s=r.exec(e),n=s&&(C(i)?i(s,e):i);if(n)return n}return["",""]}(be);return Ie(ke({$os:o,$os_version:a,$browser:nr(be,navigator.vendor),$device:ur(be),$device_type:(i=be,s=ur(i),s===yt||s===mt||"Kobo"===s||"Kindle Fire"===s||s===Jt?vt:s===Lt||s===Ut||s===jt||s===Vt?"Console":s===wt?"Wearable":s?gt:"Desktop"),$timezone:Sr(),$timezone_offset:Ir()}),{$current_url:pt(null==ye?void 0:ye.href,n,gr),$host:null==ye?void 0:ye.host,$pathname:null==ye?void 0:ye.pathname,$raw_user_agent:be.length>1e3?be.substring(0,997)+"...":be,$browser_version:ar(be,navigator.vendor),$browser_language:yr(),$browser_language_prefix:(r=yr(),"string"==typeof r?r.split("-")[0]:void 0),$screen_height:null==fe?void 0:fe.screen.height,$screen_width:null==fe?void 0:fe.screen.width,$viewport_height:null==fe?void 0:fe.innerHeight,$viewport_width:null==fe?void 0:fe.innerWidth,$lib:"web",$lib_version:cr.LIB_VERSION,$insert_id:Math.random().toString(36).substring(2,10)+Math.random().toString(36).substring(2,10),$time:Date.now()/1e3})}var xr=["cookie","localstorage","localstorage+cookie","sessionstorage","memory"];class Er{constructor(e,t){this._config=e,this.props={},this._campaign_params_saved=!1,this._name=(e=>{var t="";return e.token&&(t=e.token.replace(/\+/g,"PL").replace(/\//g,"SL").replace(/=/g,"EQ")),e.persistence_name?e.persistence_name:"leanbase_"+t})(e),this._storage=this._buildStorage(e),this.load(),e.debug&&ze.info("Persistence loaded",e.persistence,r({},this.props)),this.update_config(e,e,t),this.save()}isDisabled(){return!!this._disabled}_buildStorage(e){-1===xr.indexOf(e.persistence.toLowerCase())&&(ze.info("Unknown persistence type "+e.persistence+"; falling back to localStorage+cookie"),e.persistence="localStorage+cookie");var t=e.persistence.toLowerCase();return"localstorage"===t&&st._is_supported()?st:"localstorage+cookie"===t&&ot._is_supported()?ot:"sessionstorage"===t&&ct._is_supported()?ct:"memory"===t?lt:"cookie"===t?rt:ot._is_supported()?ot:rt}properties(){var e={};return Se(this.props,(function(t,r){if(r===De&&A(t))for(var i=Object.keys(t),s=0;s<i.length;s++)e["$feature/"+i[s]]=t[i[s]];else o=r,a=!1,(D(n=Be)?a:ge&&n.indexOf===ge?-1!=n.indexOf(o):(Se(n,(function(e){if(a||(a=e===o))return de})),a))||(e[r]=t);var n,o,a})),e}load(){if(!this._disabled){var e=this._storage._parse(this._name);e&&(this.props=Ie({},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,r){if(A(e)){T(t)&&(t="None"),this._expire_days=T(r)?this._default_expiry:r;var i=!1;if(Se(e,((e,r)=>{this.props.hasOwnProperty(r)&&this.props[r]!==t||(this.props[r]=e,i=!0)})),i)return this.save(),!0}return!1}register(e,t){if(A(e)){this._expire_days=T(t)?this._default_expiry:t;var r=!1;if(Se(e,((t,i)=>{e.hasOwnProperty(i)&&this.props[i]!==t&&(this.props[i]=t,r=!0)})),r)return this.save(),!0}return!1}unregister(e){e in this.props&&(delete this.props[e],this.save())}update_campaign_params(){if(!this._campaign_params_saved){var e=_r(this._config.custom_campaign_params,this._config.mask_personal_data_properties,this._config.custom_personal_data_properties);O(ke(e))||this.register(e),this._campaign_params_saved=!0}}update_search_keyword(){var e;this.register((e=null==me?void 0:me.referrer)?mr(e):{})}update_referrer_info(){var e;this.register_once({$referrer:br(),$referring_domain:null!=me&&me.referrer&&(null==(e=dt(me.referrer))?void 0:e.host)||"$direct"},void 0)}set_initial_person_info(){this.props[Le]||this.props[je]||this.register_once({[Ue]:wr(this._config.mask_personal_data_properties,this._config.custom_personal_data_properties)},void 0)}get_initial_props(){var e={};Se([je,Le],(t=>{var r=this.props[t];r&&Se(r,(function(t,r){e["$initial_"+S(r)]=t}))}));var t,r,i=this.props[Ue];if(i){var s=(t=Pr(i),r={},Se(t,(function(e,t){r["$initial_"+S(t)]=e})),r);Ie(e,s)}return e}safe_merge(e){return Se(this.props,(function(t,r){r in e||(e[r]=t)})),e}update_config(e,t,r){if(this._default_expiry=this._expire_days=e.cookie_expiration,this.set_disabled(e.disable_persistence||!!r),this.set_cross_subdomain(e.cross_subdomain_cookie),this.set_secure(e.secure_cookie),e.persistence!==t.persistence){var i=this._buildStorage(e),s=this.props;this.clear(),this._storage=i,this.props=s,this.save()}}set_disabled(e){if(this._disabled=e,this._disabled)return this.remove();this.save()}set_cross_subdomain(e){e!==this._cross_subdomain&&(this._cross_subdomain=e,this.remove(),this.save())}set_secure(e){e!==this._secure&&(this._secure=e,this.remove(),this.save())}set_event_timer(e,t){var r=this.props[Oe]||{};r[e]=t,this.props[Oe]=r,this.save()}remove_event_timer(e){var t=(this.props[Oe]||{})[e];return T(t)||(delete this.props[Oe][e],this.save()),t}get_property(e){return this.props[e]}set_property(e,t){this.props[e]=t,this.save()}}function kr(e){return!!e&&1===e.nodeType}function $r(e,t){return!!e&&!!e.tagName&&e.tagName.toLowerCase()===t.toLowerCase()}function Cr(e){return!!e&&3===e.nodeType}function Ar(e){return!!e&&11===e.nodeType}function Or(e){return e?P(e).split(/\s+/):[]}function Tr(e){var t,r=null==(t=window)?void 0:t.location.href;return!!(r&&e&&e.some((e=>r.match(e))))}function Rr(e){var t="";switch(typeof e.className){case"string":t=e.className;break;case"object":t=(e.className&&"baseVal"in e.className?e.className.baseVal:null)||e.getAttribute("class")||"";break;default:t=""}return Or(t)}function Dr(e){return M(e)?null:P(e).split(/(\s+)/).filter((e=>Xr(e))).join("").replace(/[\r\n]/g," ").replace(/[ ]+/g," ").substring(0,255)}function Mr(e){var t="";return zr(e)&&!Gr(e)&&e.childNodes&&e.childNodes.length&&Se(e.childNodes,(function(e){var r;Cr(e)&&e.textContent&&(t+=null!==(r=Dr(e.textContent))&&void 0!==r?r:"")})),P(t)}var Nr=["a","button","form","input","select","textarea","label"];function Lr(e,t){if(T(t))return!0;var r,i=function(e){if(t.some((t=>e.matches(t))))return{v:!0}};for(var s of e)if(r=i(s))return r.v;return!1}function jr(e){var t=e.parentNode;return!(!t||!kr(t))&&t}var Ur=[".ph-no-rageclick",".ph-no-capture"];var qr=e=>!e||$r(e,"html")||!kr(e),Br=(e,t)=>{if(!window||qr(e))return{parentIsUsefulElement:!1,targetElementList:[]};for(var r=!1,i=[e],s=e;s.parentNode&&!$r(s,"body");)if(Ar(s.parentNode))i.push(s.parentNode.host),s=s.parentNode.host;else{var n=jr(s);if(!n)break;if(t||Nr.indexOf(n.tagName.toLowerCase())>-1)r=!0;else{var o=window.getComputedStyle(n);o&&"pointer"===o.getPropertyValue("cursor")&&(r=!0)}i.push(n),s=n}return{parentIsUsefulElement:r,targetElementList:i}};function Hr(e,t,r,i,s){var n,o,a,l;if(void 0===r&&(r=void 0),!window||qr(e))return!1;if(null!=(n=r)&&n.url_allowlist&&!Tr(r.url_allowlist))return!1;if(null!=(o=r)&&o.url_ignorelist&&Tr(r.url_ignorelist))return!1;if(null!=(a=r)&&a.dom_event_allowlist){var u=r.dom_event_allowlist;if(u&&!u.some((e=>t.type===e)))return!1}var{parentIsUsefulElement:c,targetElementList:d}=Br(e,i);if(!function(e,t){var r=null==t?void 0:t.element_allowlist;if(T(r))return!0;var i,s=function(e){if(r.some((t=>e.tagName.toLowerCase()===t)))return{v:!0}};for(var n of e)if(i=s(n))return i.v;return!1}(d,r))return!1;if(!Lr(d,null==(l=r)?void 0:l.css_selector_allowlist))return!1;var h=window.getComputedStyle(e);if(h&&"pointer"===h.getPropertyValue("cursor")&&"click"===t.type)return!0;var p=e.tagName.toLowerCase();switch(p){case"html":return!1;case"form":return(s||["submit"]).indexOf(t.type)>=0;case"input":case"select":case"textarea":return(s||["change","click"]).indexOf(t.type)>=0;default:return c?(s||["click"]).indexOf(t.type)>=0:(s||["click"]).indexOf(t.type)>=0&&(Nr.indexOf(p)>-1||"true"===e.getAttribute("contenteditable"))}}function zr(e){for(var t=e;t.parentNode&&!$r(t,"body");t=t.parentNode){var r=Rr(t);if(w(r,"ph-sensitive")||w(r,"ph-no-capture"))return!1}if(w(Rr(e),"ph-include"))return!0;var i=e.type||"";if(R(i))switch(i.toLowerCase()){case"hidden":case"password":return!1}var s=e.name||e.id||"";if(R(s)){if(/^cc|cardnum|ccnum|creditcard|csc|cvc|cvv|exp|pass|pwd|routing|seccode|securitycode|securitynum|socialsec|socsec|ssn/i.test(s.replace(/[^a-zA-Z0-9]/g,"")))return!1}return!0}function Gr(e){return!!($r(e,"input")&&!["button","checkbox","submit","reset"].includes(e.type)||$r(e,"select")||$r(e,"textarea")||"true"===e.getAttribute("contenteditable"))}var Vr="(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})",Kr=new RegExp("^(?:"+Vr+")$"),Wr=new RegExp(Vr),Jr="\\d{3}-?\\d{2}-?\\d{4}",Qr=new RegExp("^("+Jr+")$"),Yr=new RegExp("("+Jr+")");function Xr(e,t){if(void 0===t&&(t=!0),M(e))return!1;if(R(e)){if(e=P(e),(t?Kr:Wr).test((e||"").replace(/[- ]/g,"")))return!1;if((t?Qr:Yr).test(e))return!1}return!0}function Zr(e){var t=Mr(e);return Xr(t=(t+" "+ei(e)).trim())?t:""}function ei(e){var t="";return e&&e.childNodes&&e.childNodes.length&&Se(e.childNodes,(function(e){var r;if(e&&"span"===(null==(r=e.tagName)?void 0:r.toLowerCase()))try{var i=Mr(e);t=(t+" "+i).trim(),e.childNodes&&e.childNodes.length&&(t=(t+" "+ei(e)).trim())}catch(e){ze.error("[AutoCapture]",e)}})),t}function ti(e){return function(e){var t=e.map((e=>{var t,i,s="";if(e.tag_name&&(s+=e.tag_name),e.attr_class)for(var n of(e.attr_class.sort(),e.attr_class))s+="."+n.replace(/"/g,"");var o=r({},e.text?{text:e.text}:{},{"nth-child":null!==(t=e.nth_child)&&void 0!==t?t:0,"nth-of-type":null!==(i=e.nth_of_type)&&void 0!==i?i:0},e.href?{href:e.href}:{},e.attr_id?{attr_id:e.attr_id}:{},e.attributes),a={};return xe(o).sort(((e,t)=>{var[r]=e,[i]=t;return r.localeCompare(i)})).forEach((e=>{var[t,r]=e;return a[ri(t.toString())]=ri(r.toString())})),s+=":",s+=xe(a).map((e=>{var[t,r]=e;return t+'="'+r+'"'})).join("")}));return t.join(";")}(function(e){return e.map((e=>{var t,r,i={text:null==(t=e.$el_text)?void 0:t.slice(0,400),tag_name:e.tag_name,href:null==(r=e.attr__href)?void 0:r.slice(0,2048),attr_class:ii(e),attr_id:e.attr__id,nth_child:e.nth_child,nth_of_type:e.nth_of_type,attributes:{}};return xe(e).filter((e=>{var[t]=e;return 0===t.indexOf("attr__")})).forEach((e=>{var[t,r]=e;return i.attributes[t]=r})),i}))}(e))}function ri(e){return e.replace(/"|\\"/g,'\\"')}function ii(e){var t=e.attr__class;return t?k(t)?t:Or(t):void 0}class si{constructor(){this.clicks=[]}isRageClick(e,t,r){var i=this.clicks[this.clicks.length-1];if(i&&Math.abs(e-i.x)+Math.abs(t-i.y)<30&&r-i.timestamp<1e3){if(this.clicks.push({x:e,y:t,timestamp:r}),3===this.clicks.length)return!0}else this.clicks=[{x:e,y:t,timestamp:r}];return!1}}var ni,oi="$copy_autocapture";function ai(e,t){return t.length>e?t.slice(0,e)+"...":t}function li(e){if(e.previousElementSibling)return e.previousElementSibling;var t=e;do{t=t.previousSibling}while(t&&!kr(t));return t}function ui(e,t,r,i){var s=e.tagName.toLowerCase(),n={tag_name:s};Nr.indexOf(s)>-1&&!r&&("a"===s.toLowerCase()||"button"===s.toLowerCase()?n.$el_text=ai(1024,Zr(e)):n.$el_text=ai(1024,Mr(e)));var o=Rr(e);o.length>0&&(n.classes=o.filter((function(e){return""!==e}))),Se(e.attributes,(function(r){var s;if((!Gr(e)||-1!==["name","id","class","aria-label"].indexOf(r.name))&&((null==i||!i.includes(r.name))&&!t&&Xr(r.value)&&(s=r.name,!R(s)||"_ngcontent"!==s.substring(0,10)&&"_nghost"!==s.substring(0,7)))){var o=r.value;"class"===r.name&&(o=Or(o).join(" ")),n["attr__"+r.name]=ai(1024,o)}}));for(var a=1,l=1,u=e;u=li(u);)a++,u.tagName===e.tagName&&l++;return n.nth_child=a,n.nth_of_type=l,n}function ci(e,t){for(var r,i,{e:s,maskAllElementAttributes:n,maskAllText:o,elementAttributeIgnoreList:a,elementsChainAsString:l}=t,u=[e],c=e;c.parentNode&&!$r(c,"body");)Ar(c.parentNode)?(u.push(c.parentNode.host),c=c.parentNode.host):(u.push(c.parentNode),c=c.parentNode);var d,h=[],p={},g=!1,f=!1;if(Se(u,(e=>{var t=zr(e);"a"===e.tagName.toLowerCase()&&(g=e.getAttribute("href"),g=t&&g&&Xr(g)&&g),w(Rr(e),"ph-no-capture")&&(f=!0),h.push(ui(e,n,o,a));var r=function(e){if(!zr(e))return{};var t={};return Se(e.attributes,(function(e){if(e.name&&0===e.name.indexOf("data-ph-capture-attribute")){var r=e.name.replace("data-ph-capture-attribute-",""),i=e.value;r&&i&&Xr(i)&&(t[r]=i)}})),t}(e);Ie(p,r)})),f)return{props:{},explicitNoCapture:f};if(o||("a"===e.tagName.toLowerCase()||"button"===e.tagName.toLowerCase()?h[0].$el_text=Zr(e):h[0].$el_text=Mr(e)),g){var _,v;h[0].attr__href=g;var m=null==(_=dt(g))?void 0:_.host,y=null==fe||null==(v=fe.location)?void 0:v.host;m&&y&&m!==y&&(d=g)}return{props:Ie({$event_type:s.type,$ce_version:1},l?{}:{$elements:h},{$elements_chain:ti(h)},null!=(r=h[0])&&r.$el_text?{$el_text:null==(i=h[0])?void 0:i.$el_text}:{},d&&"click"===s.type?{$external_click_url:d}:{},p)}}!function(e){e.GZipJS="gzip-js",e.Base64="base64"}(ni||(ni={}));class di{constructor(e){this._initialized=!1,this._isDisabledServerSide=null,this.rageclicks=new si,this._elementsChainAsString=!1,this.instance=e,this._elementSelectors=null}get _config(){var e,t,r=A(this.instance.config.autocapture)?this.instance.config.autocapture:{};return r.url_allowlist=null==(e=r.url_allowlist)?void 0:e.map((e=>new RegExp(e))),r.url_ignorelist=null==(t=r.url_ignorelist)?void 0:t.map((e=>new RegExp(e))),r}_addDomEventHandlers(){if(this.isBrowserSupported()){if(fe&&me){var e=e=>{e=e||(null==fe?void 0:fe.event);try{this._captureEvent(e)}catch(e){ze.error("Failed to capture event",e)}};if(Ee(me,"submit",e,{capture:!0}),Ee(me,"change",e,{capture:!0}),Ee(me,"click",e,{capture:!0}),this._config.capture_copied_text){var t=e=>{e=e||(null==fe?void 0:fe.event),this._captureEvent(e,oi)};Ee(me,"copy",t,{capture:!0}),Ee(me,"cut",t,{capture:!0})}}}else ze.info("Disabling Automatic Event Collection because this browser is not supported")}startIfEnabled(){this.isEnabled&&!this._initialized&&(this._addDomEventHandlers(),this._initialized=!0)}onRemoteConfig(e){e.elementsChainAsString&&(this._elementsChainAsString=e.elementsChainAsString),this.instance.persistence&&this.instance.persistence.register({[Te]:!!e.autocapture_opt_out}),this._isDisabledServerSide=!!e.autocapture_opt_out,this.startIfEnabled()}setElementSelectors(e){this._elementSelectors=e}getElementSelectors(e){var t,r=[];return null==(t=this._elementSelectors)||t.forEach((t=>{var i=null==me?void 0:me.querySelectorAll(t);null==i||i.forEach((i=>{e===i&&r.push(t)}))})),r}get isEnabled(){var e,t,r=null==(e=this.instance.persistence)?void 0:e.props[Te],i=this._isDisabledServerSide;if(D(i)&&!L(r))return!1;var s=null!==(t=this._isDisabledServerSide)&&void 0!==t?t:!!r;return!!this.instance.config.autocapture&&!s}_captureEvent(e,t){if(void 0===t&&(t="$autocapture"),this.isEnabled){var r,i=function(e){return T(e.target)?e.srcElement||null:null!=(t=e.target)&&t.shadowRoot?e.composedPath()[0]||null:e.target||null;var t}(e);if(Cr(i)&&(i=i.parentNode||null),"$autocapture"===t&&"click"===e.type&&e instanceof MouseEvent)this.instance.config.rageclick&&null!=(r=this.rageclicks)&&r.isRageClick(e.clientX,e.clientY,(new Date).getTime())&&function(e,t){if(!window||qr(e))return!1;var r,i;if(!1===(r=L(t)?!!t&&Ur:null!==(i=null==t?void 0:t.css_selector_ignorelist)&&void 0!==i?i:Ur))return!1;var{targetElementList:s}=Br(e,!1);return!Lr(s,r)}(i,this.instance.config.rageclick)&&this._captureEvent(e,"$rageclick");var s=t===oi;if(i&&Hr(i,e,this._config,s,s?["copy","cut"]:void 0)){var{props:n,explicitNoCapture:o}=ci(i,{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(o)return!1;var a=this.getElementSelectors(i);if(a&&a.length>0&&(n.$element_selectors=a),t===oi){var l,u=Dr(null==fe||null==(l=fe.getSelection())?void 0:l.toString()),c=e.type||"clipboard";if(!u)return!1;n.$selected_content=u,n.$copy_type=c}return this.instance.capture(t,n),!0}}}isBrowserSupported(){return C(null==me?void 0:me.querySelectorAll)}}class hi{constructor(){this._events={},this._events={}}on(e,t){return this._events[e]||(this._events[e]=[]),this._events[e].push(t),()=>{this._events[e]=this._events[e].filter((e=>e!==t))}}emit(e,t){for(var r of this._events[e]||[])r(t);for(var i of this._events["*"]||[])i(e,t)}}class pi{on(e,t){return this._eventEmitter.on(e,t)}constructor(e,t,r){var i;if(this._sessionIdChangedHandlers=[],this._beforeUnloadListener=void 0,this._eventEmitter=new hi,this._sessionHasBeenIdleTooLong=(e,t)=>Math.abs(e-t)>this.sessionTimeoutMs,!e.persistence)throw new Error("SessionIdManager requires a LeanbasePersistence instance");if("always"===e.config.cookieless_mode)throw new Error('SessionIdManager cannot be used with cookieless_mode="always"');this._config=e.config,this._persistence=e.persistence,this._windowId=void 0,this._sessionId=void 0,this._sessionStartTimestamp=null,this._sessionActivityTimestamp=null,this._sessionIdGenerator=t||Ye,this._windowIdGenerator=r||Ye;var s=this._config.persistence_name||this._config.token,n=this._config.session_idle_timeout_seconds||1800;if(this._sessionTimeoutMs=1e3*z(n,60,36e3,ze,1800),e.register({$configured_session_timeout_ms:this._sessionTimeoutMs}),this._resetIdleTimer(),this._window_id_storage_key="ph_"+s+"_window_id",this._primary_window_exists_storage_key="ph_"+s+"_primary_window_exists",this._canUseSessionStorage()){var o=ct._parse(this._window_id_storage_key),a=ct._parse(this._primary_window_exists_storage_key);o&&!a?this._windowId=o:ct._remove(this._window_id_storage_key),ct._set(this._primary_window_exists_storage_key,!0)}if(null!=(i=this._config.bootstrap)&&i.sessionID)try{var l=(e=>{var t=e.replace(/-/g,"");if(32!==t.length)throw new Error("Not a valid UUID");if("7"!==t[12])throw new Error("Not a UUIDv7");return parseInt(t.substring(0,12),16)})(this._config.bootstrap.sessionID);this._setSessionId(this._config.bootstrap.sessionID,(new Date).getTime(),l)}catch(e){ze.error("Invalid sessionID in bootstrap",e)}this._listenToReloadWindow()}get sessionTimeoutMs(){return this._sessionTimeoutMs}onSessionId(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&&ct._is_supported()}_setWindowId(e){e!==this._windowId&&(this._windowId=e,this._canUseSessionStorage()&&ct._set(this._window_id_storage_key,e))}_getWindowId(){return this._windowId?this._windowId:this._canUseSessionStorage()?ct._parse(this._window_id_storage_key):null}_setSessionId(e,t,r){e===this._sessionId&&t===this._sessionActivityTimestamp&&r===this._sessionStartTimestamp||(this._sessionStartTimestamp=r,this._sessionActivityTimestamp=t,this._sessionId=e,this._persistence.register({[Re]:[t,e,r]}))}_getSessionId(){if(this._sessionId&&this._sessionActivityTimestamp&&this._sessionStartTimestamp)return[this._sessionActivityTimestamp,this._sessionId,this._sessionStartTimestamp];var e=this._persistence.props[Re];return k(e)&&2===e.length&&e.push(e[0]),e||[0,null,0]}resetSessionId(){this._setSessionId(null,null,null)}destroy(){clearTimeout(this._enforceIdleTimeout),this._enforceIdleTimeout=void 0,this._beforeUnloadListener&&fe&&(fe.removeEventListener("beforeunload",this._beforeUnloadListener,{capture:!1}),this._beforeUnloadListener=void 0),this._sessionIdChangedHandlers=[]}_listenToReloadWindow(){this._beforeUnloadListener=()=>{this._canUseSessionStorage()&&ct._remove(this._primary_window_exists_storage_key)},Ee(fe,"beforeunload",this._beforeUnloadListener,{capture:!1})}checkAndGetSessionAndWindowId(e,t){if(void 0===e&&(e=!1),void 0===t&&(t=null),"always"===this._config.cookieless_mode)throw new Error('checkAndGetSessionAndWindowId should not be called with cookieless_mode="always"');var r=t||(new Date).getTime(),[i,s,n]=this._getSessionId(),o=this._getWindowId(),a=N(n)&&n>0&&Math.abs(r-n)>864e5,l=!1,u=!s,c=!e&&this._sessionHasBeenIdleTooLong(r,i);u||c||a?(s=this._sessionIdGenerator(),o=this._windowIdGenerator(),ze.info("new session ID generated",{sessionId:s,windowId:o,changeReason:{noSessionId:u,activityTimeout:c,sessionPastMaximumLength:a}}),n=r,l=!0):o||(o=this._windowIdGenerator(),l=!0);var d=0===i||!e||a?r:i,h=0===n?(new Date).getTime():n;return this._setWindowId(o),this._setSessionId(s,d,h),e||this._resetIdleTimer(),l&&this._sessionIdChangedHandlers.forEach((e=>e(s,o,l?{noSessionId:u,activityTimeout:c,sessionPastMaximumLength:a}:void 0))),{sessionId:s,windowId:o,sessionStartTimestamp:h,changeReason:l?{noSessionId:u,activityTimeout:c,sessionPastMaximumLength:a}:void 0,lastActivityTimestamp:i}}_resetIdleTimer(){clearTimeout(this._enforceIdleTimeout),this._enforceIdleTimeout=setTimeout((()=>{var[e]=this._getSessionId();if(this._sessionHasBeenIdleTooLong((new Date).getTime(),e)){var t=this._sessionId;this.resetSessionId(),this._eventEmitter.emit("forcedIdleReset",{idleSessionId:t})}}),1.1*this.sessionTimeoutMs)}}var gi=e=>wr(null==e?void 0:e.config.mask_personal_data_properties,null==e?void 0:e.config.custom_personal_data_properties);class fi{constructor(e,t,r,i){this._onSessionIdCallback=e=>{var t=this._getStored();if(!t||t.sessionId!==e){var r={sessionId:e,props:this._sessionSourceParamGenerator(this._instance)};this._persistence.register({[Ne]:r})}},this._instance=e,this._sessionIdManager=t,this._persistence=r,this._sessionSourceParamGenerator=i||gi,this._sessionIdManager.onSessionId(this._onSessionIdCallback)}_getStored(){return this._persistence.props[Ne]}getSetOnceProps(){var e,t=null==(e=this._getStored())?void 0:e.props;return t?"r"in t?Pr(t):{$referring_domain:t.referringDomain,$pathname:t.initialPathName,utm_source:t.utm_source,utm_campaign:t.utm_campaign,utm_medium:t.utm_medium,utm_content:t.utm_content,utm_term:t.utm_term}:{}}getSessionProps(){var e={};return Se(ke(this.getSetOnceProps()),((t,r)=>{"$current_url"===r&&(r="url"),e["$session_entry_"+S(r)]=t})),e}}class _i{constructor(e){this._instance=e}doPageView(e,t){var r,i=this._previousPageViewProperties(e,t);return this._currentPageview={pathname:null!==(r=null==fe?void 0:fe.location.pathname)&&void 0!==r?r:"",pageViewId:t,timestamp:e},this._instance.scrollManager.resetContext(),i}doPageLeave(e){var t;return this._previousPageViewProperties(e,null==(t=this._currentPageview)?void 0:t.pageViewId)}doEvent(){var e;return{$pageview_id:null==(e=this._currentPageview)?void 0:e.pageViewId}}_previousPageViewProperties(e,t){var r=this._currentPageview;if(!r)return{$pageview_id:t};var i={$pageview_id:t,$prev_pageview_id:r.pageViewId},s=this._instance.scrollManager.getContext();if(s&&!this._instance.config.disable_scroll_properties){var{maxScrollHeight:n,lastScrollY:o,maxScrollY:a,maxContentHeight:l,lastContentY:u,maxContentY:c}=s;if(!(T(n)||T(o)||T(a)||T(l)||T(u)||T(c))){n=Math.ceil(n),o=Math.ceil(o),a=Math.ceil(a),l=Math.ceil(l),u=Math.ceil(u),c=Math.ceil(c);var d=n<=1?1:z(o/n,0,1,ze),h=n<=1?1:z(a/n,0,1,ze),p=l<=1?1:z(u/l,0,1,ze),g=l<=1?1:z(c/l,0,1,ze);i=Ie(i,{$prev_pageview_last_scroll:o,$prev_pageview_last_scroll_percentage:d,$prev_pageview_max_scroll:a,$prev_pageview_max_scroll_percentage:h,$prev_pageview_last_content:u,$prev_pageview_last_content_percentage:p,$prev_pageview_max_content:c,$prev_pageview_max_content_percentage:g})}}return r.pathname&&(i.$prev_pageview_pathname=r.pathname),r.timestamp&&(i.$prev_pageview_duration=(e.getTime()-r.timestamp.getTime())/1e3),i}}class vi{constructor(e){this._instance=e,this._updateScrollData=()=>{var e,t,r,i;this._context||(this._context={});var s=this.scrollElement(),n=this.scrollY(),o=s?Math.max(0,s.scrollHeight-s.clientHeight):0,a=n+((null==s?void 0:s.clientHeight)||0),l=(null==s?void 0:s.scrollHeight)||0;this._context.lastScrollY=Math.ceil(n),this._context.maxScrollY=Math.max(n,null!==(e=this._context.maxScrollY)&&void 0!==e?e:0),this._context.maxScrollHeight=Math.max(o,null!==(t=this._context.maxScrollHeight)&&void 0!==t?t:0),this._context.lastContentY=a,this._context.maxContentY=Math.max(a,null!==(r=this._context.maxContentY)&&void 0!==r?r:0),this._context.maxContentHeight=Math.max(l,null!==(i=this._context.maxContentHeight)&&void 0!==i?i:0)}}getContext(){return this._context}resetContext(){var e=this._context;return setTimeout(this._updateScrollData,0),e}startMeasuringScrollPosition(){Ee(fe,"scroll",this._updateScrollData,{capture:!0}),Ee(fe,"scrollend",this._updateScrollData,{capture:!0}),Ee(fe,"resize",this._updateScrollData)}scrollElement(){if(!this._instance.config.scroll_root_selector)return null==fe?void 0:fe.document.documentElement;var e=k(this._instance.config.scroll_root_selector)?this._instance.config.scroll_root_selector:[this._instance.config.scroll_root_selector];for(var t of e){var r=null==fe?void 0:fe.document.querySelector(t);if(r)return r}}scrollY(){if(this._instance.config.scroll_root_selector){var e=this.scrollElement();return e&&e.scrollTop||0}return fe&&(fe.scrollY||fe.pageYOffset||fe.document.documentElement.scrollTop)||0}scrollX(){if(this._instance.config.scroll_root_selector){var e=this.scrollElement();return e&&e.scrollLeft||0}return fe&&(fe.scrollX||fe.pageXOffset||fe.document.documentElement.scrollLeft)||0}}var mi,yi=["amazonbot","amazonproductbot","app.hypefactors.com","applebot","archive.org_bot","awariobot","backlinksextendedbot","baiduspider","bingbot","bingpreview","chrome-lighthouse","dataforseobot","deepscan","duckduckbot","facebookexternal","facebookcatalog","http://yandex.com/bots","hubspot","ia_archiver","leikibot","linkedinbot","meta-externalagent","mj12bot","msnbot","nessus","petalbot","pinterest","prerender","rogerbot","screaming frog","sebot-wa","sitebulb","slackbot","slurp","trendictionbot","turnitin","twitterbot","vercel-screenshot","vercelbot","yahoo! slurp","yandexbot","zoombot","bot.htm","bot.php","(bot;","bot/","crawler","ahrefsbot","ahrefssiteaudit","semrushbot","siteauditbot","splitsignalbot","gptbot","oai-searchbot","chatgpt-user","perplexitybot","better uptime bot","sentryuptimebot","uptimerobot","headlesschrome","cypress","google-hoteladsverifier","adsbot-google","apis-google","duplexweb-google","feedfetcher-google","google favicon","google web preview","google-read-aloud","googlebot","googleother","google-cloudvertexbot","googleweblight","mediapartners-google","storebot-google","google-inspectiontool","bytespider"],bi=function(e,t){if(!e)return!1;var r=e.toLowerCase();return yi.concat(t||[]).some((e=>{var t=e.toLowerCase();return-1!==r.indexOf(t)}))};!function(e){e[e.PENDING=-1]="PENDING",e[e.DENIED=0]="DENIED",e[e.GRANTED=1]="GRANTED"}(mi||(mi={}));class wi{constructor(e){this._instance=e}get _config(){return this._instance.config}get consent(){return this._getDnt()?mi.DENIED:this._storedConsent}isOptedOut(){return"always"===this._config.cookieless_mode||(this.consent===mi.DENIED||this.consent===mi.PENDING&&(this._config.opt_out_capturing_by_default||"on_reject"===this._config.cookieless_mode))}isOptedIn(){return!this.isOptedOut()}isExplicitlyOptedOut(){return this.consent===mi.DENIED}optInOut(e){this._storage._set(this._storageKey,e?1:0,this._config.cookie_expiration,this._config.cross_subdomain_cookie,this._config.secure_cookie)}reset(){this._storage._remove(this._storageKey,this._config.cross_subdomain_cookie)}get _storageKey(){var{token:e,opt_out_capturing_cookie_prefix:t,consent_persistence_name:r}=this._instance.config;return r||(t?t+e:"__lb_opt_in_out_"+e)}get _storedConsent(){var e=this._storage._get(this._storageKey);return B(e)?mi.GRANTED:w(H,e)?mi.DENIED:mi.PENDING}get _storage(){if(!this._persistentStore){var e=this._config.opt_out_capturing_persistence_type;this._persistentStore="localStorage"===e?st:rt;var t="localStorage"===e?rt:st;t._get(this._storageKey)&&(this._persistentStore._get(this._storageKey)||this.optInOut(B(t._get(this._storageKey))),t._remove(this._storageKey,this._config.cross_subdomain_cookie))}return this._persistentStore}_getDnt(){return!!this._config.respect_dnt&&!!function(e,t){for(var r=0;r<e.length;r++)if(t(e[r]))return e[r]}([null==ve?void 0:ve.doNotTrack,null==ve?void 0:ve.msDoNotTrack,we.doNotTrack],(e=>B(e)))}}var Pi=()=>{var e;return{host:"https://i.leanbase.co",token:"",autocapture:!0,rageclick:!0,persistence:"localStorage+cookie",capture_pageview:!0,capture_pageleave:"if_capture_pageview",persistence_name:"",mask_all_element_attributes:!1,cookie_expiration:365,cross_subdomain_cookie:Ce(null==me?void 0:me.location),custom_campaign_params:[],custom_personal_data_properties:[],disable_persistence:!1,mask_personal_data_properties:!1,secure_cookie:"https:"===(null==(e=window)||null==(e=e.location)?void 0:e.protocol),mask_all_text:!1,bootstrap:{},session_idle_timeout_seconds:1800,save_campaign_params:!0,save_referrer:!0,opt_out_useragent_filter:!1,properties_string_max_length:65535,opt_out_capturing_by_default:!1,opt_out_persistence_by_default:!1,opt_out_capturing_persistence_type:"localStorage",consent_persistence_name:null,opt_out_capturing_cookie_prefix:null,respect_dnt:!1,getDeviceId:e=>e,loaded:()=>{}}};class Si extends ce{constructor(e,t){var r=Ie(Pi(),t||{},{token:e});super(e,r),this.personProcessingSetOncePropertiesSent=!1,this.isLoaded=!1,this.config=r,this.visibilityStateListener=null,this.initialPageviewCaptured=!1,this.scrollManager=new vi(this),this.pageViewManager=new _i(this),this.consent=new wi(this),this.init(e,r)}init(e,t){var i,s,n;this.setConfig(Ie(Pi(),t,{token:e})),this.isLoaded=!0;var o=this._isPersistenceDisabled();this.persistence=new Er(this.config),this.sessionPersistence="sessionStorage"===this.config.persistence||"memory"===this.config.persistence?this.persistence:new Er(r({},this.config,{persistence:"sessionStorage"}),o);var a="always"===this.config.cookieless_mode||"on_reject"===this.config.cookieless_mode&&this.consent.isExplicitlyOptedOut();if(a||(this.sessionManager=new pi(this),this.sessionPropsManager=new fi(this,this.sessionManager,this.persistence)),this.replayAutocapture=new di(this),this.replayAutocapture.startIfEnabled(),!1!==this.config.preloadFeatureFlags&&this.reloadFeatureFlags(),null==(i=(s=this.config).loaded)||i.call(s,this),this.config.capture_pageview&&setTimeout((()=>{(this.consent.isOptedIn()||"always"===this.config.cookieless_mode)&&this.captureInitialPageview()}),1),this.config.disable_scroll_properties||this.scrollManager.startMeasuringScrollPosition(),void 0!==(null==(n=this.config.bootstrap)?void 0:n.distinctId)){var l,u,c=this.config.getDeviceId(Ye()),d=null!=(l=this.config.bootstrap)&&l.isIdentifiedId?c:this.config.bootstrap.distinctId;this.persistence.set_property(Me,null!=(u=this.config.bootstrap)&&u.isIdentifiedId?"identified":"anonymous"),this.register({distinct_id:this.config.bootstrap.distinctId,$device_id:d})}if(a&&this.persistence.register_once({distinct_id:"$posthog_cookieless",$device_id:null},""),!a&&!this.getDistinctId()){var h=Ye();this.persistence.register_once({distinct_id:h,$device_id:h},""),this.persistence.set_property(Me,"anonymous")}return Ee(me,"DOMContentLoaded",(()=>{this.loadRemoteConfig()})),Ee(window,"onpagehide"in self?"pagehide":"unload",this.capturePageLeave.bind(this),{passive:!1}),this}captureInitialPageview(){me&&("visible"===me.visibilityState?this.initialPageviewCaptured||(this.initialPageviewCaptured=!0,this.capture("$pageview",{title:me.title}),this.visibilityStateListener&&(me.removeEventListener("visibilitychange",this.visibilityStateListener),this.visibilityStateListener=null)):this.visibilityStateListener||(this.visibilityStateListener=this.captureInitialPageview.bind(this),Ee(me,"visibilitychange",this.visibilityStateListener)))}capturePageLeave(){var{capture_pageleave:e,capture_pageview:t}=this.config;!0!==e&&("if_capture_pageview"!==e||!0!==t&&"history_change"!==t)||this.capture("$pageleave")}loadRemoteConfig(){var e=this;return t((function*(){if(!e.isRemoteConfigLoaded){var t=yield e.reloadRemoteConfigAsync();t&&e.onRemoteConfig(t)}}))()}onRemoteConfig(e){var t;me&&me.body?(this.isRemoteConfigLoaded=!0,null==(t=this.replayAutocapture)||t.onRemoteConfig(e)):setTimeout((()=>{this.onRemoteConfig(e)}),500)}fetch(e,t){var r="undefined"!=typeof fetch?fetch:void 0!==globalThis.fetch?globalThis.fetch:void 0;return r?r(e,t):Promise.reject(new Error("Fetch API is not available in this environment."))}setConfig(e){var t,i,s=r({},this.config);A(e)&&(Ie(this.config,e),null==(t=this.persistence)||t.update_config(this.config,s),null==(i=this.replayAutocapture)||i.startIfEnabled());var n="sessionStorage"===this.config.persistence||"memory"===this.config.persistence;this.sessionPersistence=n?this.persistence:new Er(r({},this.config,{persistence:"sessionStorage"}))}getLibraryId(){return"leanbase"}getLibraryVersion(){return cr.LIB_VERSION}getCustomUserAgent(){}getPersistedProperty(e){var t;return null==(t=this.persistence)?void 0:t.get_property(e)}setPersistedProperty(e,t){var r;null==(r=this.persistence)||r.set_property(e,t)}calculateEventProperties(e,t,i,s,n){var o;if(!this.persistence||!this.sessionPersistence)return t;i=i||new Date;var a,l=n||null==(o=this.persistence)?void 0:o.remove_event_timer(e),u=r({},t);if(u.token=this.config.token,("always"==this.config.cookieless_mode||"on_reject"==this.config.cookieless_mode&&this.consent.isExplicitlyOptedOut())&&(u.$cookieless_mode=!0),"$snapshot"===e){var c=r({},this.persistence.properties());return u.distinct_id=c.distinct_id,(!R(u.distinct_id)&&!N(u.distinct_id)||(a=u.distinct_id,R(a)&&0===a.trim().length))&&ze.error("Invalid distinct_id for replay event. This indicates a bug in your implementation"),u}var d=Fr(this.config.mask_personal_data_properties,this.config.custom_personal_data_properties);if(this.sessionManager){var{sessionId:h,windowId:p}=this.sessionManager.checkAndGetSessionAndWindowId(n,i.getTime());u.$session_id=h,u.$window_id=p}this.sessionPropsManager&&Ie(u,this.sessionPropsManager.getSessionProps());var g=this.pageViewManager.doEvent();if("$pageview"!==e||n||(g=this.pageViewManager.doPageView(i,s)),"$pageleave"!==e||n||(g=this.pageViewManager.doPageLeave(i)),u=Ie(u,g),"$pageview"===e&&me&&(u.title=me.title),!T(l)){var f=i.getTime()-l;u.$duration=parseFloat((f/1e3).toFixed(3))}return be&&this.config.opt_out_useragent_filter&&(u.$browser_type=function(e,t){if(!e)return!1;var r=e.userAgent;if(r&&bi(r,t))return!0;try{var i=null==e?void 0:e.userAgentData;if(null!=i&&i.brands&&i.brands.some((e=>bi(null==e?void 0:e.brand,t))))return!0}catch(e){}return!!e.webdriver}(ve,[])?"bot":"browser"),(u=Ie({},d,this.persistence.properties(),this.sessionPersistence.properties(),u)).$is_identified=this.isIdentified(),u}isIdentified(){var e,t;return"identified"===(null==(e=this.persistence)?void 0:e.get_property(Me))||"identified"===(null==(t=this.sessionPersistence)?void 0:t.get_property(Me))}isCapturing(){return this.consent.isOptedIn()}calculateSetOnceProperties(e){var t;if(!this.persistence)return e;if(this.personProcessingSetOncePropertiesSent)return e;var r=this.persistence.get_initial_props(),i=null==(t=this.sessionPropsManager)?void 0:t.getSetOnceProps(),s=Ie({},r,i||{},e||{});return this.personProcessingSetOncePropertiesSent=!0,O(s)?void 0:s}capture(e,t,i){if(this.isLoaded&&this.sessionPersistence&&this.persistence&&this.isCapturing())if(!T(e)&&R(e)){null!=t&&t.$current_url&&!R(null==t?void 0:t.$current_url)&&(ze.error("Invalid `$current_url` property provided to `posthog.capture`. Input must be a string. Ignoring provided value."),null==t||delete t.$current_url),this.sessionPersistence.update_search_keyword(),this.config.save_campaign_params&&this.sessionPersistence.update_campaign_params(),this.config.save_referrer&&this.sessionPersistence.update_referrer_info(),(this.config.save_campaign_params||this.config.save_referrer)&&this.persistence.set_initial_person_info();var s=new Date,n=(null==i?void 0:i.timestamp)||s,o=Ye(),a={uuid:o,event:e,properties:this.calculateEventProperties(e,t||{},n,o)};(null==i?void 0:i.$set)&&(a.$set=null==i?void 0:i.$set);var l=this.calculateSetOnceProperties(null==i?void 0:i.$set_once);l&&(a.$set_once=l),(a=Ae(a,null!=i&&i._noTruncate?null:this.config.properties_string_max_length)).timestamp=n,T(null==i?void 0:i.timestamp)||(a.properties.$event_time_override_provided=!0,a.properties.$event_time_override_system_time=s);var u=r({},a.properties.$set,a.$set);O(u)||this.setPersonPropertiesForFlags(u),super.capture(a.event,a.properties,i)}else ze.error("No event name provided to posthog.capture")}identify(e,t,r){super.identify(e,t,r)}destroy(){var e;null==(e=this.persistence)||e.clear()}_isPersistenceDisabled(){if("always"===this.config.cookieless_mode)return!0;var e=this.consent.isOptedOut(),t=this.config.opt_out_persistence_by_default||"on_reject"===this.config.cookieless_mode;return this.config.disable_persistence||e&&!!t}}var Ii,Fi,xi={_instance:null,_queue:[],init(e,t){this._instance=new Si(e,t);var r=this._queue;for(var{fn:i,args:s}of(this._queue=[],r))this[i](...s)},capture(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];if(this._instance)return this._instance.capture(...t);this._queue.push({fn:"capture",args:t})},captureException(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];if(this._instance)return this._instance.captureException(...t);this._queue.push({fn:"captureException",args:t})},identify(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];if(this._instance)return this._instance.identify(...t);this._queue.push({fn:"identify",args:t})},group(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];if(this._instance)return this._instance.group(...t);this._queue.push({fn:"group",args:t})},alias(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];if(this._instance)return this._instance.alias(...t);this._queue.push({fn:"alias",args:t})},reset(){var e;null==(e=this._instance)||e.reset(),this._instance=null},getInstance(){return this._instance}};Ii=globalThis,(Fi=Ii.leanbase)&&"object"==typeof Fi&&k(Fi._queue)&&(xi._queue=Fi._queue),Ii.leanbase=xi,Ii.Leanbase=Ii.leanbase}();
|
|
2
2
|
//# sourceMappingURL=leanbase.iife.js.map
|