PageSourceSearch

https://brendabeckelmanbooks.com/_next/static/chunks/3vx104o3o2pnh.js

js brendabeckelmanbooks.com collected 2026-10-10 02:18:51 UTC 160,409 bytes, 4 lines download raw bytes

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

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.