posthog-js 1.307.1 → 1.307.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/array.full.es5.js +1 -1
- package/dist/array.full.js +1 -1
- package/dist/array.full.no-external.js +1 -1
- package/dist/array.js +1 -1
- package/dist/array.no-external.js +1 -1
- package/dist/customizations.full.js +1 -1
- package/dist/lazy-recorder.js +1 -1
- package/dist/main.js +1 -1
- package/dist/module.full.js +1 -1
- package/dist/module.full.no-external.js +1 -1
- package/dist/module.js +1 -1
- package/dist/module.no-external.js +1 -1
- package/dist/posthog-recorder.js +1 -1
- package/lib/package.json +1 -1
- package/package.json +2 -2
package/dist/module.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
var t="undefined"!=typeof window?window:void 0,i="undefined"!=typeof globalThis?globalThis:t;"undefined"==typeof self&&(i.self=i),"undefined"==typeof File&&(i.File=function(){});var e=Array.prototype,r=e.forEach,s=e.indexOf,n=null==i?void 0:i.navigator,o=null==i?void 0:i.document,a=null==i?void 0:i.location,l=null==i?void 0:i.fetch,u=null!=i&&i.XMLHttpRequest&&"withCredentials"in new i.XMLHttpRequest?i.XMLHttpRequest:void 0,h=null==i?void 0:i.AbortController,d=null==n?void 0:n.userAgent,v=null!=t?t:{},c={DEBUG:!1,LIB_VERSION:"1.307.1"};function f(t,i,e,r,s,n,o){try{var a=t[n](o),l=a.value}catch(t){return void e(t)}a.done?i(l):Promise.resolve(l).then(r,s)}function p(t){return function(){var i=this,e=arguments;return new Promise((function(r,s){var n=t.apply(i,e);function o(t){f(n,r,s,o,a,"next",t)}function a(t){f(n,r,s,o,a,"throw",t)}o(void 0)}))}}function g(){return g=Object.assign?Object.assign.bind():function(t){for(var i=1;i<arguments.length;i++){var e=arguments[i];for(var r in e)({}).hasOwnProperty.call(e,r)&&(t[r]=e[r])}return t},g.apply(null,arguments)}function _(t,i){if(null==t)return{};var e={};for(var r in t)if({}.hasOwnProperty.call(t,r)){if(-1!==i.indexOf(r))continue;e[r]=t[r]}return e}var m=["amazonbot","amazonproductbot","app.hypefactors.com","applebot","archive.org_bot","awariobot","backlinksextendedbot","baiduspider","bingbot","bingpreview","chrome-lighthouse","dataforseobot","deepscan","duckduckbot","facebookexternal","facebookcatalog","http://yandex.com/bots","hubspot","ia_archiver","leikibot","linkedinbot","meta-externalagent","mj12bot","msnbot","nessus","petalbot","pinterest","prerender","rogerbot","screaming frog","sebot-wa","sitebulb","slackbot","slurp","trendictionbot","turnitin","twitterbot","vercel-screenshot","vercelbot","yahoo! slurp","yandexbot","zoombot","bot.htm","bot.php","(bot;","bot/","crawler","ahrefsbot","ahrefssiteaudit","semrushbot","siteauditbot","splitsignalbot","gptbot","oai-searchbot","chatgpt-user","perplexitybot","better uptime bot","sentryuptimebot","uptimerobot","headlesschrome","cypress","google-hoteladsverifier","adsbot-google","apis-google","duplexweb-google","feedfetcher-google","google favicon","google web preview","google-read-aloud","googlebot","googleother","google-cloudvertexbot","googleweblight","mediapartners-google","storebot-google","google-inspectiontool","bytespider"],y=function(t,i){if(void 0===i&&(i=[]),!t)return!1;var e=t.toLowerCase();return m.concat(i).some((t=>{var i=t.toLowerCase();return-1!==e.indexOf(i)}))},b=["$snapshot","$pageview","$pageleave","$set","survey dismissed","survey sent","survey shown","$identify","$groupidentify","$create_alias","$$client_ingestion_warning","$web_experiment_applied","$feature_enrollment_update","$feature_flag_called"];function w(t,i){return-1!==t.indexOf(i)}var x=function(t){return t.trim()},E=function(t){return t.replace(/^\$/,"")};var S=Array.isArray,k=Object.prototype,P=k.hasOwnProperty,T=k.toString,C=S||function(t){return"[object Array]"===T.call(t)},R=t=>"function"==typeof t,I=t=>t===Object(t)&&!C(t),F=t=>{if(I(t)){for(var i in t)if(P.call(t,i))return!1;return!0}return!1},M=t=>void 0===t,O=t=>"[object String]"==T.call(t),A=t=>O(t)&&0===t.trim().length,D=t=>null===t,j=t=>M(t)||D(t),L=t=>"[object Number]"==T.call(t),N=t=>"[object Boolean]"===T.call(t),U=t=>t instanceof FormData,z=t=>w(b,t);function H(t){return null===t||"object"!=typeof t}function B(t,i){return Object.prototype.toString.call(t)==="[object "+i+"]"}function q(t){return!M(Event)&&function(t,i){try{return t instanceof i}catch(t){return!1}}(t,Event)}var W=[!0,"true",1,"1","yes"],G=t=>w(W,t),V=[!1,"false",0,"0","no"];function J(t,i,e,r,s){return i>e&&(r.warn("min cannot be greater than max."),i=e),L(t)?t>e?(r.warn(" cannot be greater than max: "+e+". Using max value instead."),e):t<i?(r.warn(" cannot be less than min: "+i+". Using min value instead."),i):t:(r.warn(" must be a number. using max or fallback. max: "+e+", fallback: "+s),J(s||e,i,e,r))}class K{constructor(t){this.t={},this.i=t.i,this.o=J(t.bucketSize,0,100,t.h),this.m=J(t.refillRate,0,this.o,t.h),this.S=J(t.refillInterval,0,864e5,t.h)}$(t,i){var e=i-t.lastAccess,r=Math.floor(e/this.S);if(r>0){var s=r*this.m;t.tokens=Math.min(t.tokens+s,this.o),t.lastAccess=t.lastAccess+r*this.S}}consumeRateLimit(t){var i,e=Date.now(),r=String(t),s=this.t[r];return s?this.$(s,e):(s={tokens:this.o,lastAccess:e},this.t[r]=s),0===s.tokens||(s.tokens--,0===s.tokens&&(null==(i=this.i)||i.call(this,t)),0===s.tokens)}stop(){this.t={}}}var Y,X,Q,Z=t=>t instanceof Error;function tt(t){var i=globalThis._posthogChunkIds;if(i){var e=Object.keys(i);return Q&&e.length===X||(X=e.length,Q=e.reduce(((e,r)=>{Y||(Y={});var s=Y[r];if(s)e[s[0]]=s[1];else for(var n=t(r),o=n.length-1;o>=0;o--){var a=n[o],l=null==a?void 0:a.filename,u=i[r];if(l&&u){e[l]=u,Y[r]=[l,u];break}}return e}),{})),Q}}class it{constructor(t,i,e){void 0===e&&(e=[]),this.coercers=t,this.stackParser=i,this.modifiers=e}buildFromUnknown(t,i){void 0===i&&(i={});var e=i&&i.mechanism||{handled:!0,type:"generic"},r=this.buildCoercingContext(e,i,0).apply(t),s=this.buildParsingContext(),n=this.parseStacktrace(r,s);return{$exception_list:this.convertToExceptionList(n,e),$exception_level:"error"}}modifyFrames(t){var i=this;return p((function*(){for(var e of t)e.stacktrace&&e.stacktrace.frames&&C(e.stacktrace.frames)&&(e.stacktrace.frames=yield i.applyModifiers(e.stacktrace.frames));return t}))()}coerceFallback(t){var i;return{type:"Error",value:"Unknown error",stack:null==(i=t.syntheticException)?void 0:i.stack,synthetic:!0}}parseStacktrace(t,i){var e,r;return null!=t.cause&&(e=this.parseStacktrace(t.cause,i)),""!=t.stack&&null!=t.stack&&(r=this.applyChunkIds(this.stackParser(t.stack,t.synthetic?1:0),i.chunkIdMap)),g({},t,{cause:e,stack:r})}applyChunkIds(t,i){return t.map((t=>(t.filename&&i&&(t.chunk_id=i[t.filename]),t)))}applyCoercers(t,i){for(var e of this.coercers)if(e.match(t))return e.coerce(t,i);return this.coerceFallback(i)}applyModifiers(t){var i=this;return p((function*(){var e=t;for(var r of i.modifiers)e=yield r(e);return e}))()}convertToExceptionList(t,i){var e,r,s,n={type:t.type,value:t.value,mechanism:{type:null!==(e=i.type)&&void 0!==e?e:"generic",handled:null===(r=i.handled)||void 0===r||r,synthetic:null!==(s=t.synthetic)&&void 0!==s&&s}};t.stack&&(n.stacktrace={type:"raw",frames:t.stack});var o=[n];return null!=t.cause&&o.push(...this.convertToExceptionList(t.cause,g({},i,{handled:!0}))),o}buildParsingContext(){return{chunkIdMap:tt(this.stackParser)}}buildCoercingContext(t,i,e){void 0===e&&(e=0);var r=(e,r)=>{if(r<=4){var s=this.buildCoercingContext(t,i,r);return this.applyCoercers(e,s)}};return g({},i,{syntheticException:0==e?i.syntheticException:void 0,mechanism:t,apply:t=>r(t,e),next:t=>r(t,e+1)})}}var et="?";function rt(t,i,e,r,s){var n={platform:t,filename:i,function:"<anonymous>"===e?et:e,in_app:!0};return M(r)||(n.lineno=r),M(s)||(n.colno=s),n}var st=(t,i)=>{var e=-1!==t.indexOf("safari-extension"),r=-1!==t.indexOf("safari-web-extension");return e||r?[-1!==t.indexOf("@")?t.split("@")[0]:et,e?"safari-extension:"+i:"safari-web-extension:"+i]:[t,i]},nt=/^\s*at (\S+?)(?::(\d+))(?::(\d+))\s*$/i,ot=/^\s*at (?:(.+?\)(?: \[.+\])?|.*?) ?\((?:address at )?)?(?:async )?((?:<anonymous>|[-a-z]+:|.*bundle|\/)?.*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i,at=/\((\S*)(?::(\d+))(?::(\d+))\)/,lt=(t,i)=>{var e=nt.exec(t);if(e){var[,r,s,n]=e;return rt(i,r,et,+s,+n)}var o=ot.exec(t);if(o){if(o[2]&&0===o[2].indexOf("eval")){var a=at.exec(o[2]);a&&(o[2]=a[1],o[3]=a[2],o[4]=a[3])}var[l,u]=st(o[1]||et,o[2]);return rt(i,u,l,o[3]?+o[3]:void 0,o[4]?+o[4]:void 0)}},ut=/^\s*(.*?)(?:\((.*?)\))?(?:^|@)?((?:[-a-z]+)?:\/.*?|\[native code\]|[^@]*(?:bundle|\d+\.js)|\/[\w\-. /=]+)(?::(\d+))?(?::(\d+))?\s*$/i,ht=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i,dt=(t,i)=>{var e=ut.exec(t);if(e){if(e[3]&&e[3].indexOf(" > eval")>-1){var r=ht.exec(e[3]);r&&(e[1]=e[1]||"eval",e[3]=r[1],e[4]=r[2],e[5]="")}var s=e[3],n=e[1]||et;return[n,s]=st(n,s),rt(i,s,n,e[4]?+e[4]:void 0,e[5]?+e[5]:void 0)}},vt=/\(error: (.*)\)/,ct=50;function ft(t){for(var i=arguments.length,e=new Array(i>1?i-1:0),r=1;r<i;r++)e[r-1]=arguments[r];return function(i,r){void 0===r&&(r=0);for(var s=[],n=i.split("\n"),o=r;o<n.length;o++){var a=n[o];if(!(a.length>1024)){var l=vt.test(a)?a.replace(vt,"$1"):a;if(!l.match(/\S*Error: /)){for(var u of e){var h=u(l,t);if(h){s.push(h);break}}if(s.length>=ct)break}}}return function(t){if(!t.length)return[];var i=Array.from(t);return i.reverse(),i.slice(0,ct).map((t=>{return g({},t,{filename:t.filename||(e=i,e[e.length-1]||{}).filename,function:t.function||et});var e}))}(s)}}class pt{match(t){return this.isDOMException(t)||this.isDOMError(t)}coerce(t,i){var e=O(t.stack);return{type:this.getType(t),value:this.getValue(t),stack:e?t.stack:void 0,cause:t.cause?i.next(t.cause):void 0,synthetic:!1}}getType(t){return this.isDOMError(t)?"DOMError":"DOMException"}getValue(t){var i=t.name||(this.isDOMError(t)?"DOMError":"DOMException");return t.message?i+": "+t.message:i}isDOMException(t){return B(t,"DOMException")}isDOMError(t){return B(t,"DOMError")}}class gt{match(t){return(t=>t instanceof Error)(t)}coerce(t,i){return{type:this.getType(t),value:this.getMessage(t,i),stack:this.getStack(t),cause:t.cause?i.next(t.cause):void 0,synthetic:!1}}getType(t){return t.name||t.constructor.name}getMessage(t,i){var e=t.message;return e.error&&"string"==typeof e.error.message?String(e.error.message):String(e)}getStack(t){return t.stacktrace||t.stack||void 0}}class _t{constructor(){}match(t){return B(t,"ErrorEvent")&&null!=t.error}coerce(t,i){var e,r=i.apply(t.error);return r||{type:"ErrorEvent",value:t.message,stack:null==(e=i.syntheticException)?void 0:e.stack,synthetic:!0}}}var mt=/^(?:[Uu]ncaught (?:exception: )?)?(?:((?:Eval|Internal|Range|Reference|Syntax|Type|URI|)Error): )?(.*)$/i;class yt{match(t){return"string"==typeof t}coerce(t,i){var e,[r,s]=this.getInfos(t);return{type:null!=r?r:"Error",value:null!=s?s:t,stack:null==(e=i.syntheticException)?void 0:e.stack,synthetic:!0}}getInfos(t){var i="Error",e=t,r=t.match(mt);return r&&(i=r[1],e=r[2]),[i,e]}}var bt=["fatal","error","warning","log","info","debug"];function wt(t,i){void 0===i&&(i=40);var e=Object.keys(t);if(e.sort(),!e.length)return"[object has no keys]";for(var r=e.length;r>0;r--){var s=e.slice(0,r).join(", ");if(!(s.length>i))return r===e.length||s.length<=i?s:s.slice(0,i)+"..."}return""}class xt{match(t){return"object"==typeof t&&null!==t}coerce(t,i){var e,r=this.getErrorPropertyFromObject(t);return r?i.apply(r):{type:this.getType(t),value:this.getValue(t),stack:null==(e=i.syntheticException)?void 0:e.stack,level:this.isSeverityLevel(t.level)?t.level:"error",synthetic:!0}}getType(t){return q(t)?t.constructor.name:"Error"}getValue(t){if("name"in t&&"string"==typeof t.name){var i="'"+t.name+"' captured as exception";return"message"in t&&"string"==typeof t.message&&(i+=" with message: '"+t.message+"'"),i}if("message"in t&&"string"==typeof t.message)return t.message;var e=this.getObjectClassName(t);return(e&&"Object"!==e?"'"+e+"'":"Object")+" captured as exception with keys: "+wt(t)}isSeverityLevel(t){return O(t)&&!A(t)&&bt.indexOf(t)>=0}getErrorPropertyFromObject(t){for(var i in t)if(Object.prototype.hasOwnProperty.call(t,i)){var e=t[i];if(Z(e))return e}}getObjectClassName(t){try{var i=Object.getPrototypeOf(t);return i?i.constructor.name:void 0}catch(t){return}}}class Et{match(t){return q(t)}coerce(t,i){var e,r=t.constructor.name;return{type:r,value:r+" captured as exception with keys: "+wt(t),stack:null==(e=i.syntheticException)?void 0:e.stack,synthetic:!0}}}class St{match(t){return H(t)}coerce(t,i){var e;return{type:"Error",value:"Primitive value captured as exception: "+String(t),stack:null==(e=i.syntheticException)?void 0:e.stack,synthetic:!0}}}class $t{match(t){return B(t,"PromiseRejectionEvent")}coerce(t,i){var e,r=this.getUnhandledRejectionReason(t);return H(r)?{type:"UnhandledRejection",value:"Non-Error promise rejection captured with value: "+String(r),stack:null==(e=i.syntheticException)?void 0:e.stack,synthetic:!0}:i.apply(r)}getUnhandledRejectionReason(t){if(H(t))return t;try{if("reason"in t)return t.reason;if("detail"in t&&"reason"in t.detail)return t.detail.reason}catch(t){}return t}}var kt=function(i,e){var{debugEnabled:r}=void 0===e?{}:e,s={k:function(e){if(t&&(c.DEBUG||v.POSTHOG_DEBUG||r)&&!M(t.console)&&t.console){for(var s=("__rrweb_original__"in t.console[e]?t.console[e].__rrweb_original__:t.console[e]),n=arguments.length,o=new Array(n>1?n-1:0),a=1;a<n;a++)o[a-1]=arguments[a];s(i,...o)}},info:function(){for(var t=arguments.length,i=new Array(t),e=0;e<t;e++)i[e]=arguments[e];s.k("log",...i)},warn:function(){for(var t=arguments.length,i=new Array(t),e=0;e<t;e++)i[e]=arguments[e];s.k("warn",...i)},error:function(){for(var t=arguments.length,i=new Array(t),e=0;e<t;e++)i[e]=arguments[e];s.k("error",...i)},critical:function(){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];console.error(i,...e)},uninitializedWarning:t=>{s.error("You must initialize PostHog before calling "+t)},createLogger:(t,e)=>kt(i+" "+t,e)};return s},Pt=kt("[PostHog.js]"),Tt=Pt.createLogger,Ct=Tt("[ExternalScriptsLoader]"),Rt=(t,i,e)=>{if(t.config.disable_external_dependency_loading)return Ct.warn(i+" was requested but loading of external scripts is disabled."),e("Loading of external scripts is disabled");var r=null==o?void 0:o.querySelectorAll("script");if(r)for(var s,n=function(){if(r[a].src===i){var t=r[a];return t.__posthog_loading_callback_fired?{v:e()}:(t.addEventListener("load",(i=>{t.__posthog_loading_callback_fired=!0,e(void 0,i)})),t.onerror=t=>e(t),{v:void 0})}},a=0;a<r.length;a++)if(s=n())return s.v;var l=()=>{if(!o)return e("document not found");var r=o.createElement("script");if(r.type="text/javascript",r.crossOrigin="anonymous",r.src=i,r.onload=t=>{r.__posthog_loading_callback_fired=!0,e(void 0,t)},r.onerror=t=>e(t),t.config.prepare_external_dependency_script&&(r=t.config.prepare_external_dependency_script(r)),!r)return e("prepare_external_dependency_script returned null");var s,n=o.querySelectorAll("body > script");n.length>0?null==(s=n[0].parentNode)||s.insertBefore(r,n[0]):o.body.appendChild(r)};null!=o&&o.body?l():null==o||o.addEventListener("DOMContentLoaded",l)};v.__PosthogExtensions__=v.__PosthogExtensions__||{},v.__PosthogExtensions__.loadExternalDependency=(t,i,e)=>{var r="/static/"+i+".js?v="+t.version;if("remote-config"===i&&(r="/array/"+t.config.token+"/config.js"),"toolbar"===i){var s=3e5;r=r+"&t="+Math.floor(Date.now()/s)*s}var n=t.requestRouter.endpointFor("assets",r);Rt(t,n,e)},v.__PosthogExtensions__.loadSiteApp=(t,i,e)=>{var r=t.requestRouter.endpointFor("api",i);Rt(t,r,e)};var It={};function Ft(t,i,e){if(C(t))if(r&&t.forEach===r)t.forEach(i,e);else if("length"in t&&t.length===+t.length)for(var s=0,n=t.length;s<n;s++)if(s in t&&i.call(e,t[s],s)===It)return}function Mt(t,i,e){if(!j(t)){if(C(t))return Ft(t,i,e);if(U(t)){for(var r of t.entries())if(i.call(e,r[1],r[0])===It)return}else for(var s in t)if(P.call(t,s)&&i.call(e,t[s],s)===It)return}}var Ot=function(t){for(var i=arguments.length,e=new Array(i>1?i-1:0),r=1;r<i;r++)e[r-1]=arguments[r];return Ft(e,(function(i){for(var e in i)void 0!==i[e]&&(t[e]=i[e])})),t},At=function(t){for(var i=arguments.length,e=new Array(i>1?i-1:0),r=1;r<i;r++)e[r-1]=arguments[r];return Ft(e,(function(i){Ft(i,(function(i){t.push(i)}))})),t};function Dt(t){for(var i=Object.keys(t),e=i.length,r=new Array(e);e--;)r[e]=[i[e],t[i[e]]];return r}var jt=function(t){try{return t()}catch(t){return}},Lt=function(t){return function(){try{for(var i=arguments.length,e=new Array(i),r=0;r<i;r++)e[r]=arguments[r];return t.apply(this,e)}catch(t){Pt.critical("Implementation error. Please turn on debug mode and open a ticket on https://app.posthog.com/home#panel=support%3Asupport%3A."),Pt.critical(t)}}},Nt=function(t){var i={};return Mt(t,(function(t,e){(O(t)&&t.length>0||L(t))&&(i[e]=t)})),i};function Ut(t,i){return e=t,r=t=>O(t)&&!D(i)?t.slice(0,i):t,s=new Set,function t(i,e){return i!==Object(i)?r?r(i,e):i:s.has(i)?void 0:(s.add(i),C(i)?(n=[],Ft(i,(i=>{n.push(t(i))}))):(n={},Mt(i,((i,e)=>{s.has(i)||(n[e]=t(i,e))}))),n);var n}(e);var e,r,s}var zt=["herokuapp.com","vercel.app","netlify.app"];function Ht(t){var i=null==t?void 0:t.hostname;if(!O(i))return!1;var e=i.split(".").slice(-2).join(".");for(var r of zt)if(e===r)return!1;return!0}function Bt(t,i){for(var e=0;e<t.length;e++)if(i(t[e]))return t[e]}function qt(t,i,e,r){var{capture:s=!1,passive:n=!0}=null!=r?r:{};null==t||t.addEventListener(i,e,{capture:s,passive:n})}var Wt="$people_distinct_id",Gt="__alias",Vt="__timers",Jt="$autocapture_disabled_server_side",Kt="$heatmaps_enabled_server_side",Yt="$exception_capture_enabled_server_side",Xt="$error_tracking_suppression_rules",Qt="$error_tracking_capture_extension_exceptions",Zt="$web_vitals_enabled_server_side",ti="$dead_clicks_enabled_server_side",ii="$web_vitals_allowed_metrics",ei="$session_recording_remote_config",ri="$sesid",si="$session_is_sampled",ni="$enabled_feature_flags",oi="$early_access_features",ai="$feature_flag_details",li="$stored_person_properties",ui="$stored_group_properties",hi="$surveys",di="$surveys_activated",vi="$flag_call_reported",ci="$user_state",fi="$client_session_props",pi="$capture_rate_limit",gi="$initial_campaign_params",_i="$initial_referrer_info",mi="$initial_person_info",yi="$epp",bi="__POSTHOG_TOOLBAR__",wi="$posthog_cookieless",xi=[Wt,Gt,"__cmpns",Vt,"$session_recording_enabled_server_side",Kt,ri,ni,Xt,ci,oi,ai,ui,li,hi,vi,fi,pi,gi,_i,yi,mi,"$conversations_widget_session_id","$conversations_ticket_id","$conversations_widget_state","$conversations_user_traits"];function Ei(t){return t instanceof Element&&(t.id===bi||!(null==t.closest||!t.closest(".toolbar-global-fade-container")))}function Si(t){return!!t&&1===t.nodeType}function $i(t,i){return!!t&&!!t.tagName&&t.tagName.toLowerCase()===i.toLowerCase()}function ki(t){return!!t&&3===t.nodeType}function Pi(t){return!!t&&11===t.nodeType}function Ti(t){return t?x(t).split(/\s+/):[]}function Ci(i){var e=null==t?void 0:t.location.href;return!!(e&&i&&i.some((t=>e.match(t))))}function Ri(t){var i="";switch(typeof t.className){case"string":i=t.className;break;case"object":i=(t.className&&"baseVal"in t.className?t.className.baseVal:null)||t.getAttribute("class")||"";break;default:i=""}return Ti(i)}function Ii(t){return j(t)?null:x(t).split(/(\s+)/).filter((t=>Qi(t))).join("").replace(/[\r\n]/g," ").replace(/[ ]+/g," ").substring(0,255)}function Fi(t){var i="";return qi(t)&&!Wi(t)&&t.childNodes&&t.childNodes.length&&Mt(t.childNodes,(function(t){var e;ki(t)&&t.textContent&&(i+=null!==(e=Ii(t.textContent))&&void 0!==e?e:"")})),x(i)}function Mi(t){return M(t.target)?t.srcElement||null:null!=(i=t.target)&&i.shadowRoot?t.composedPath()[0]||null:t.target||null;var i}var Oi=["a","button","form","input","select","textarea","label"];function Ai(t,i){if(M(i))return!0;var e,r=function(t){if(i.some((i=>t.matches(i))))return{v:!0}};for(var s of t)if(e=r(s))return e.v;return!1}function Di(t){var i=t.parentNode;return!(!i||!Si(i))&&i}var ji=["next","previous","prev",">","<"],Li=10;var Ni=[".ph-no-rageclick",".ph-no-capture"];function Ui(i,e){if(!t||zi(i))return!1;var r,s,n;N(e)?(r=!!e&&Ni,s=void 0):(r=null!==(n=null==e?void 0:e.css_selector_ignorelist)&&void 0!==n?n:Ni,s=null==e?void 0:e.content_ignorelist);if(!1===r)return!1;var{targetElementList:o}=Hi(i,!1);return!function(t,i){if(!1===t||M(t))return!1;var e;if(!0===t)e=ji;else{if(!C(t))return!1;if(t.length>Li)return Pt.error("[PostHog] content_ignorelist array cannot exceed "+Li+" items. Use css_selector_ignorelist for more complex matching."),!1;e=t.map((t=>t.toLowerCase()))}return i.some((t=>{var{safeText:i,ariaLabel:r}=t;return e.some((t=>i.includes(t)||r.includes(t)))}))}(s,o.map((t=>{var i;return{safeText:Fi(t).toLowerCase(),ariaLabel:(null==(i=t.getAttribute("aria-label"))?void 0:i.toLowerCase().trim())||""}})))&&!Ai(o,r)}var zi=t=>!t||$i(t,"html")||!Si(t),Hi=(i,e)=>{if(!t||zi(i))return{parentIsUsefulElement:!1,targetElementList:[]};for(var r=!1,s=[i],n=i;n.parentNode&&!$i(n,"body");)if(Pi(n.parentNode))s.push(n.parentNode.host),n=n.parentNode.host;else{var o=Di(n);if(!o)break;if(e||Oi.indexOf(o.tagName.toLowerCase())>-1)r=!0;else{var a=t.getComputedStyle(o);a&&"pointer"===a.getPropertyValue("cursor")&&(r=!0)}s.push(o),n=o}return{parentIsUsefulElement:r,targetElementList:s}};function Bi(i,e,r,s,n){var o,a,l,u;if(void 0===r&&(r=void 0),!t||zi(i))return!1;if(null!=(o=r)&&o.url_allowlist&&!Ci(r.url_allowlist))return!1;if(null!=(a=r)&&a.url_ignorelist&&Ci(r.url_ignorelist))return!1;if(null!=(l=r)&&l.dom_event_allowlist){var h=r.dom_event_allowlist;if(h&&!h.some((t=>e.type===t)))return!1}var{parentIsUsefulElement:d,targetElementList:v}=Hi(i,s);if(!function(t,i){var e=null==i?void 0:i.element_allowlist;if(M(e))return!0;var r,s=function(t){if(e.some((i=>t.tagName.toLowerCase()===i)))return{v:!0}};for(var n of t)if(r=s(n))return r.v;return!1}(v,r))return!1;if(!Ai(v,null==(u=r)?void 0:u.css_selector_allowlist))return!1;var c=t.getComputedStyle(i);if(c&&"pointer"===c.getPropertyValue("cursor")&&"click"===e.type)return!0;var f=i.tagName.toLowerCase();switch(f){case"html":return!1;case"form":return(n||["submit"]).indexOf(e.type)>=0;case"input":case"select":case"textarea":return(n||["change","click"]).indexOf(e.type)>=0;default:return d?(n||["click"]).indexOf(e.type)>=0:(n||["click"]).indexOf(e.type)>=0&&(Oi.indexOf(f)>-1||"true"===i.getAttribute("contenteditable"))}}function qi(t){for(var i=t;i.parentNode&&!$i(i,"body");i=i.parentNode){var e=Ri(i);if(w(e,"ph-sensitive")||w(e,"ph-no-capture"))return!1}if(w(Ri(t),"ph-include"))return!0;var r=t.type||"";if(O(r))switch(r.toLowerCase()){case"hidden":case"password":return!1}var s=t.name||t.id||"";if(O(s)){if(/^cc|cardnum|ccnum|creditcard|csc|cvc|cvv|exp|pass|pwd|routing|seccode|securitycode|securitynum|socialsec|socsec|ssn/i.test(s.replace(/[^a-zA-Z0-9]/g,"")))return!1}return!0}function Wi(t){return!!($i(t,"input")&&!["button","checkbox","submit","reset"].includes(t.type)||$i(t,"select")||$i(t,"textarea")||"true"===t.getAttribute("contenteditable"))}var Gi="(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})",Vi=new RegExp("^(?:"+Gi+")$"),Ji=new RegExp(Gi),Ki="\\d{3}-?\\d{2}-?\\d{4}",Yi=new RegExp("^("+Ki+")$"),Xi=new RegExp("("+Ki+")");function Qi(t,i){if(void 0===i&&(i=!0),j(t))return!1;if(O(t)){if(t=x(t),(i?Vi:Ji).test((t||"").replace(/[- ]/g,"")))return!1;if((i?Yi:Xi).test(t))return!1}return!0}function Zi(t){var i=Fi(t);return Qi(i=(i+" "+te(t)).trim())?i:""}function te(t){var i="";return t&&t.childNodes&&t.childNodes.length&&Mt(t.childNodes,(function(t){var e;if(t&&"span"===(null==(e=t.tagName)?void 0:e.toLowerCase()))try{var r=Fi(t);i=(i+" "+r).trim(),t.childNodes&&t.childNodes.length&&(i=(i+" "+te(t)).trim())}catch(t){Pt.error("[AutoCapture]",t)}})),i}function ie(t){return function(t){var i=t.map((t=>{var i,e,r="";if(t.tag_name&&(r+=t.tag_name),t.attr_class)for(var s of(t.attr_class.sort(),t.attr_class))r+="."+s.replace(/"/g,"");var n=g({},t.text?{text:t.text}:{},{"nth-child":null!==(i=t.nth_child)&&void 0!==i?i:0,"nth-of-type":null!==(e=t.nth_of_type)&&void 0!==e?e:0},t.href?{href:t.href}:{},t.attr_id?{attr_id:t.attr_id}:{},t.attributes),o={};return Dt(n).sort(((t,i)=>{var[e]=t,[r]=i;return e.localeCompare(r)})).forEach((t=>{var[i,e]=t;return o[ee(i.toString())]=ee(e.toString())})),r+=":",r+=Dt(o).map((t=>{var[i,e]=t;return i+'="'+e+'"'})).join("")}));return i.join(";")}(function(t){return t.map((t=>{var i,e,r={text:null==(i=t.$el_text)?void 0:i.slice(0,400),tag_name:t.tag_name,href:null==(e=t.attr__href)?void 0:e.slice(0,2048),attr_class:re(t),attr_id:t.attr__id,nth_child:t.nth_child,nth_of_type:t.nth_of_type,attributes:{}};return Dt(t).filter((t=>{var[i]=t;return 0===i.indexOf("attr__")})).forEach((t=>{var[i,e]=t;return r.attributes[i]=e})),r}))}(t))}function ee(t){return t.replace(/"|\\"/g,'\\"')}function re(t){var i=t.attr__class;return i?C(i)?i:Ti(i):void 0}class se{constructor(t){this.disabled=!1===t;var i=I(t)?t:{};this.thresholdPx=i.threshold_px||30,this.timeoutMs=i.timeout_ms||1e3,this.clickCount=i.click_count||3,this.clicks=[]}isRageClick(t,i,e){if(this.disabled)return!1;var r=this.clicks[this.clicks.length-1];if(r&&Math.abs(t-r.x)+Math.abs(i-r.y)<this.thresholdPx&&e-r.timestamp<this.timeoutMs){if(this.clicks.push({x:t,y:i,timestamp:e}),this.clicks.length===this.clickCount)return!0}else this.clicks=[{x:t,y:i,timestamp:e}];return!1}}var ne="$copy_autocapture",oe=function(t){return t.GZipJS="gzip-js",t.Base64="base64",t}({}),ae=["fatal","error","warning","log","info","debug"],le=t=>{var i=null==o?void 0:o.createElement("a");return M(i)?null:(i.href=t,i)},ue=function(t,i){var e,r;void 0===i&&(i="&");var s=[];return Mt(t,(function(t,i){M(t)||M(i)||"undefined"===i||(e=encodeURIComponent((t=>t instanceof File)(t)?t.name:t.toString()),r=encodeURIComponent(i),s[s.length]=r+"="+e)})),s.join(i)},he=function(t,i){for(var e,r=((t.split("#")[0]||"").split(/\?(.*)/)[1]||"").replace(/^\?+/g,"").split("&"),s=0;s<r.length;s++){var n=r[s].split("=");if(n[0]===i){e=n;break}}if(!C(e)||e.length<2)return"";var o=e[1];try{o=decodeURIComponent(o)}catch(t){Pt.error("Skipping decoding for malformed query param: "+o)}return o.replace(/\+/g," ")},de=function(t,i,e){if(!t||!i||!i.length)return t;for(var r=t.split("#"),s=r[0]||"",n=r[1],o=s.split("?"),a=o[1],l=o[0],u=(a||"").split("&"),h=[],d=0;d<u.length;d++){var v=u[d].split("=");C(v)&&(i.includes(v[0])?h.push(v[0]+"="+e):h.push(u[d]))}var c=l;return null!=a&&(c+="?"+h.join("&")),null!=n&&(c+="#"+n),c},ve=function(t,i){var e=t.match(new RegExp(i+"=([^&]*)"));return e?e[1]:null},ce=Tt("[AutoCapture]");function fe(t,i){return i.length>t?i.slice(0,t)+"...":i}function pe(t){if(t.previousElementSibling)return t.previousElementSibling;var i=t;do{i=i.previousSibling}while(i&&!Si(i));return i}function ge(t,i,e,r){var s=t.tagName.toLowerCase(),n={tag_name:s};Oi.indexOf(s)>-1&&!e&&("a"===s.toLowerCase()||"button"===s.toLowerCase()?n.$el_text=fe(1024,Zi(t)):n.$el_text=fe(1024,Fi(t)));var o=Ri(t);o.length>0&&(n.classes=o.filter((function(t){return""!==t}))),Mt(t.attributes,(function(e){var s;if((!Wi(t)||-1!==["name","id","class","aria-label"].indexOf(e.name))&&((null==r||!r.includes(e.name))&&!i&&Qi(e.value)&&(s=e.name,!O(s)||"_ngcontent"!==s.substring(0,10)&&"_nghost"!==s.substring(0,7)))){var o=e.value;"class"===e.name&&(o=Ti(o).join(" ")),n["attr__"+e.name]=fe(1024,o)}}));for(var a=1,l=1,u=t;u=pe(u);)a++,u.tagName===t.tagName&&l++;return n.nth_child=a,n.nth_of_type=l,n}function _e(i,e){for(var r,s,{e:n,maskAllElementAttributes:o,maskAllText:a,elementAttributeIgnoreList:l,elementsChainAsString:u}=e,h=[i],d=i;d.parentNode&&!$i(d,"body");)Pi(d.parentNode)?(h.push(d.parentNode.host),d=d.parentNode.host):(h.push(d.parentNode),d=d.parentNode);var v,c=[],f={},p=!1,g=!1;if(Mt(h,(t=>{var i=qi(t);"a"===t.tagName.toLowerCase()&&(p=t.getAttribute("href"),p=i&&p&&Qi(p)&&p),w(Ri(t),"ph-no-capture")&&(g=!0),c.push(ge(t,o,a,l));var e=function(t){if(!qi(t))return{};var i={};return Mt(t.attributes,(function(t){if(t.name&&0===t.name.indexOf("data-ph-capture-attribute")){var e=t.name.replace("data-ph-capture-attribute-",""),r=t.value;e&&r&&Qi(r)&&(i[e]=r)}})),i}(t);Ot(f,e)})),g)return{props:{},explicitNoCapture:g};if(a||("a"===i.tagName.toLowerCase()||"button"===i.tagName.toLowerCase()?c[0].$el_text=Zi(i):c[0].$el_text=Fi(i)),p){var _,m;c[0].attr__href=p;var y=null==(_=le(p))?void 0:_.host,b=null==t||null==(m=t.location)?void 0:m.host;y&&b&&y!==b&&(v=p)}return{props:Ot({$event_type:n.type,$ce_version:1},u?{}:{$elements:c},{$elements_chain:ie(c)},null!=(r=c[0])&&r.$el_text?{$el_text:null==(s=c[0])?void 0:s.$el_text}:{},v&&"click"===n.type?{$external_click_url:v}:{},f)}}class me{constructor(t){this.P=!1,this.T=null,this.C=!1,this.instance=t,this.rageclicks=new se(t.config.rageclick),this.R=null}get I(){var t,i,e=I(this.instance.config.autocapture)?this.instance.config.autocapture:{};return e.url_allowlist=null==(t=e.url_allowlist)?void 0:t.map((t=>new RegExp(t))),e.url_ignorelist=null==(i=e.url_ignorelist)?void 0:i.map((t=>new RegExp(t))),e}F(){if(this.isBrowserSupported()){if(t&&o){var i=i=>{i=i||(null==t?void 0:t.event);try{this.M(i)}catch(t){ce.error("Failed to capture event",t)}};if(qt(o,"submit",i,{capture:!0}),qt(o,"change",i,{capture:!0}),qt(o,"click",i,{capture:!0}),this.I.capture_copied_text){var e=i=>{i=i||(null==t?void 0:t.event),this.M(i,ne)};qt(o,"copy",e,{capture:!0}),qt(o,"cut",e,{capture:!0})}}}else ce.info("Disabling Automatic Event Collection because this browser is not supported")}startIfEnabled(){this.isEnabled&&!this.P&&(this.F(),this.P=!0)}onRemoteConfig(t){t.elementsChainAsString&&(this.C=t.elementsChainAsString),this.instance.persistence&&this.instance.persistence.register({[Jt]:!!t.autocapture_opt_out}),this.T=!!t.autocapture_opt_out,this.startIfEnabled()}setElementSelectors(t){this.R=t}getElementSelectors(t){var i,e=[];return null==(i=this.R)||i.forEach((i=>{var r=null==o?void 0:o.querySelectorAll(i);null==r||r.forEach((r=>{t===r&&e.push(i)}))})),e}get isEnabled(){var t,i,e=null==(t=this.instance.persistence)?void 0:t.props[Jt],r=this.T;if(D(r)&&!N(e)&&!this.instance.O())return!1;var s=null!==(i=this.T)&&void 0!==i?i:!!e;return!!this.instance.config.autocapture&&!s}M(i,e){if(void 0===e&&(e="$autocapture"),this.isEnabled){var r,s=Mi(i);if(ki(s)&&(s=s.parentNode||null),"$autocapture"===e&&"click"===i.type&&i instanceof MouseEvent)this.instance.config.rageclick&&null!=(r=this.rageclicks)&&r.isRageClick(i.clientX,i.clientY,i.timeStamp||(new Date).getTime())&&Ui(s,this.instance.config.rageclick)&&this.M(i,"$rageclick");var n=e===ne;if(s&&Bi(s,i,this.I,n,n?["copy","cut"]:void 0)){var{props:o,explicitNoCapture:a}=_e(s,{e:i,maskAllElementAttributes:this.instance.config.mask_all_element_attributes,maskAllText:this.instance.config.mask_all_text,elementAttributeIgnoreList:this.I.element_attribute_ignorelist,elementsChainAsString:this.C});if(a)return!1;var l=this.getElementSelectors(s);if(l&&l.length>0&&(o.$element_selectors=l),e===ne){var u,h=Ii(null==t||null==(u=t.getSelection())?void 0:u.toString()),d=i.type||"clipboard";if(!h)return!1;o.$selected_content=h,o.$copy_type=d}return this.instance.capture(e,o),!0}}}isBrowserSupported(){return R(null==o?void 0:o.querySelectorAll)}}Math.trunc||(Math.trunc=function(t){return t<0?Math.ceil(t):Math.floor(t)}),Number.isInteger||(Number.isInteger=function(t){return L(t)&&isFinite(t)&&Math.floor(t)===t});var ye="0123456789abcdef";class be{constructor(t){if(this.bytes=t,16!==t.length)throw new TypeError("not 128-bit length")}static fromFieldsV7(t,i,e,r){if(!Number.isInteger(t)||!Number.isInteger(i)||!Number.isInteger(e)||!Number.isInteger(r)||t<0||i<0||e<0||r<0||t>0xffffffffffff||i>4095||e>1073741823||r>4294967295)throw new RangeError("invalid field value");var s=new Uint8Array(16);return s[0]=t/Math.pow(2,40),s[1]=t/Math.pow(2,32),s[2]=t/Math.pow(2,24),s[3]=t/Math.pow(2,16),s[4]=t/Math.pow(2,8),s[5]=t,s[6]=112|i>>>8,s[7]=i,s[8]=128|e>>>24,s[9]=e>>>16,s[10]=e>>>8,s[11]=e,s[12]=r>>>24,s[13]=r>>>16,s[14]=r>>>8,s[15]=r,new be(s)}toString(){for(var t="",i=0;i<this.bytes.length;i++)t=t+ye.charAt(this.bytes[i]>>>4)+ye.charAt(15&this.bytes[i]),3!==i&&5!==i&&7!==i&&9!==i||(t+="-");if(36!==t.length)throw new Error("Invalid UUIDv7 was generated");return t}clone(){return new be(this.bytes.slice(0))}equals(t){return 0===this.compareTo(t)}compareTo(t){for(var i=0;i<16;i++){var e=this.bytes[i]-t.bytes[i];if(0!==e)return Math.sign(e)}return 0}}class we{constructor(){this.A=0,this.D=0,this.j=new Se}generate(){var t=this.generateOrAbort();if(M(t)){this.A=0;var i=this.generateOrAbort();if(M(i))throw new Error("Could not generate UUID after timestamp reset");return i}return t}generateOrAbort(){var t=Date.now();if(t>this.A)this.A=t,this.L();else{if(!(t+1e4>this.A))return;this.D++,this.D>4398046511103&&(this.A++,this.L())}return be.fromFieldsV7(this.A,Math.trunc(this.D/Math.pow(2,30)),this.D&Math.pow(2,30)-1,this.j.nextUint32())}L(){this.D=1024*this.j.nextUint32()+(1023&this.j.nextUint32())}}var xe,Ee=t=>{if("undefined"!=typeof UUIDV7_DENY_WEAK_RNG&&UUIDV7_DENY_WEAK_RNG)throw new Error("no cryptographically strong RNG available");for(var i=0;i<t.length;i++)t[i]=65536*Math.trunc(65536*Math.random())+Math.trunc(65536*Math.random());return t};t&&!M(t.crypto)&&crypto.getRandomValues&&(Ee=t=>crypto.getRandomValues(t));class Se{constructor(){this.N=new Uint32Array(8),this.U=1/0}nextUint32(){return this.U>=this.N.length&&(Ee(this.N),this.U=0),this.N[this.U++]}}var $e=()=>ke().toString(),ke=()=>(xe||(xe=new we)).generate(),Pe="";var Te=/[a-z0-9][a-z0-9-]+\.[a-z]{2,}$/i;function Ce(t,i){if(i){var e=function(t,i){if(void 0===i&&(i=o),Pe)return Pe;if(!i)return"";if(["localhost","127.0.0.1"].includes(t))return"";for(var e=t.split("."),r=Math.min(e.length,8),s="dmn_chk_"+$e();!Pe&&r--;){var n=e.slice(r).join("."),a=s+"=1;domain=."+n+";path=/";i.cookie=a+";max-age=3",i.cookie.includes(s)&&(i.cookie=a+";max-age=0",Pe=n)}return Pe}(t);if(!e){var r=(t=>{var i=t.match(Te);return i?i[0]:""})(t);r!==e&&Pt.info("Warning: cookie subdomain discovery mismatch",r,e),e=r}return e?"; domain=."+e:""}return""}var Re={H:()=>!!o,B:function(t){Pt.error("cookieStore error: "+t)},q:function(t){if(o){try{for(var i=t+"=",e=o.cookie.split(";").filter((t=>t.length)),r=0;r<e.length;r++){for(var s=e[r];" "==s.charAt(0);)s=s.substring(1,s.length);if(0===s.indexOf(i))return decodeURIComponent(s.substring(i.length,s.length))}}catch(t){}return null}},W:function(t){var i;try{i=JSON.parse(Re.q(t))||{}}catch(t){}return i},G:function(t,i,e,r,s){if(o)try{var n="",a="",l=Ce(o.location.hostname,r);if(e){var u=new Date;u.setTime(u.getTime()+24*e*60*60*1e3),n="; expires="+u.toUTCString()}s&&(a="; secure");var h=t+"="+encodeURIComponent(JSON.stringify(i))+n+"; SameSite=Lax; path=/"+l+a;return h.length>3686.4&&Pt.warn("cookieStore warning: large cookie, len="+h.length),o.cookie=h,h}catch(t){return}},V:function(t,i){if(null!=o&&o.cookie)try{Re.G(t,"",-1,i)}catch(t){return}}},Ie=null,Fe={H:function(){if(!D(Ie))return Ie;var i=!0;if(M(t))i=!1;else try{var e="__mplssupport__";Fe.G(e,"xyz"),'"xyz"'!==Fe.q(e)&&(i=!1),Fe.V(e)}catch(t){i=!1}return i||Pt.error("localStorage unsupported; falling back to cookie store"),Ie=i,i},B:function(t){Pt.error("localStorage error: "+t)},q:function(i){try{return null==t?void 0:t.localStorage.getItem(i)}catch(t){Fe.B(t)}return null},W:function(t){try{return JSON.parse(Fe.q(t))||{}}catch(t){}return null},G:function(i,e){try{null==t||t.localStorage.setItem(i,JSON.stringify(e))}catch(t){Fe.B(t)}},V:function(i){try{null==t||t.localStorage.removeItem(i)}catch(t){Fe.B(t)}}},Me=["distinct_id",ri,si,yi,mi],Oe=g({},Fe,{W:function(t){try{var i={};try{i=Re.W(t)||{}}catch(t){}var e=Ot(i,JSON.parse(Fe.q(t)||"{}"));return Fe.G(t,e),e}catch(t){}return null},G:function(t,i,e,r,s,n){try{Fe.G(t,i,void 0,void 0,n);var o={};Me.forEach((t=>{i[t]&&(o[t]=i[t])})),Object.keys(o).length&&Re.G(t,o,e,r,s,n)}catch(t){Fe.B(t)}},V:function(i,e){try{null==t||t.localStorage.removeItem(i),Re.V(i,e)}catch(t){Fe.B(t)}}}),Ae={},De={H:function(){return!0},B:function(t){Pt.error("memoryStorage error: "+t)},q:function(t){return Ae[t]||null},W:function(t){return Ae[t]||null},G:function(t,i){Ae[t]=i},V:function(t){delete Ae[t]}},je=null,Le={H:function(){if(!D(je))return je;if(je=!0,M(t))je=!1;else try{var i="__support__";Le.G(i,"xyz"),'"xyz"'!==Le.q(i)&&(je=!1),Le.V(i)}catch(t){je=!1}return je},B:function(t){Pt.error("sessionStorage error: ",t)},q:function(i){try{return null==t?void 0:t.sessionStorage.getItem(i)}catch(t){Le.B(t)}return null},W:function(t){try{return JSON.parse(Le.q(t))||null}catch(t){}return null},G:function(i,e){try{null==t||t.sessionStorage.setItem(i,JSON.stringify(e))}catch(t){Le.B(t)}},V:function(i){try{null==t||t.sessionStorage.removeItem(i)}catch(t){Le.B(t)}}},Ne=function(t){return t[t.PENDING=-1]="PENDING",t[t.DENIED=0]="DENIED",t[t.GRANTED=1]="GRANTED",t}({});class Ue{constructor(t){this._instance=t}get I(){return this._instance.config}get consent(){return this.J()?Ne.DENIED:this.K}isOptedOut(){return"always"===this.I.cookieless_mode||(this.consent===Ne.DENIED||this.consent===Ne.PENDING&&(this.I.opt_out_capturing_by_default||"on_reject"===this.I.cookieless_mode))}isOptedIn(){return!this.isOptedOut()}isExplicitlyOptedOut(){return this.consent===Ne.DENIED}optInOut(t){this.Y.G(this.X,t?1:0,this.I.cookie_expiration,this.I.cross_subdomain_cookie,this.I.secure_cookie)}reset(){this.Y.V(this.X,this.I.cross_subdomain_cookie)}get X(){var{token:t,opt_out_capturing_cookie_prefix:i,consent_persistence_name:e}=this._instance.config;return e||(i?i+t:"__ph_opt_in_out_"+t)}get K(){var t=this.Y.q(this.X);return G(t)?Ne.GRANTED:w(V,t)?Ne.DENIED:Ne.PENDING}get Y(){if(!this.Z){var t=this.I.opt_out_capturing_persistence_type;this.Z="localStorage"===t?Fe:Re;var i="localStorage"===t?Re:Fe;i.q(this.X)&&(this.Z.q(this.X)||this.optInOut(G(i.q(this.X))),i.V(this.X,this.I.cross_subdomain_cookie))}return this.Z}J(){return!!this.I.respect_dnt&&!!Bt([null==n?void 0:n.doNotTrack,null==n?void 0:n.msDoNotTrack,v.doNotTrack],(t=>G(t)))}}var ze=Tt("[Dead Clicks]"),He=()=>!0,Be=t=>{var i,e=!(null==(i=t.instance.persistence)||!i.get_property(ti)),r=t.instance.config.capture_dead_clicks;return N(r)?r:!!I(r)||e};class qe{get lazyLoadedDeadClicksAutocapture(){return this.tt}constructor(t,i,e){this.instance=t,this.isEnabled=i,this.onCapture=e,this.startIfEnabled()}onRemoteConfig(t){this.instance.persistence&&this.instance.persistence.register({[ti]:null==t?void 0:t.captureDeadClicks}),this.startIfEnabled()}startIfEnabled(){this.isEnabled(this)&&this.it((()=>{this.et()}))}it(t){var i,e;null!=(i=v.__PosthogExtensions__)&&i.initDeadClicksAutocapture&&t(),null==(e=v.__PosthogExtensions__)||null==e.loadExternalDependency||e.loadExternalDependency(this.instance,"dead-clicks-autocapture",(i=>{i?ze.error("failed to load script",i):t()}))}et(){var t;if(o){if(!this.tt&&null!=(t=v.__PosthogExtensions__)&&t.initDeadClicksAutocapture){var i=I(this.instance.config.capture_dead_clicks)?this.instance.config.capture_dead_clicks:{};i.__onCapture=this.onCapture,this.tt=v.__PosthogExtensions__.initDeadClicksAutocapture(this.instance,i),this.tt.start(o),ze.info("starting...")}}else ze.error("`document` not found. Cannot start.")}stop(){this.tt&&(this.tt.stop(),this.tt=void 0,ze.info("stopping..."))}}var We=Tt("[ExceptionAutocapture]");class Ge{constructor(i){var e,r,s;this.rt=()=>{var i;if(t&&this.isEnabled&&null!=(i=v.__PosthogExtensions__)&&i.errorWrappingFunctions){var e=v.__PosthogExtensions__.errorWrappingFunctions.wrapOnError,r=v.__PosthogExtensions__.errorWrappingFunctions.wrapUnhandledRejection,s=v.__PosthogExtensions__.errorWrappingFunctions.wrapConsoleError;try{!this.st&&this.I.capture_unhandled_errors&&(this.st=e(this.captureException.bind(this))),!this.nt&&this.I.capture_unhandled_rejections&&(this.nt=r(this.captureException.bind(this))),!this.ot&&this.I.capture_console_errors&&(this.ot=s(this.captureException.bind(this)))}catch(t){We.error("failed to start",t),this.lt()}}},this._instance=i,this.ut=!(null==(e=this._instance.persistence)||!e.props[Yt]),this.I=this.ht(),this.dt=new K({refillRate:null!==(r=this._instance.config.error_tracking.__exceptionRateLimiterRefillRate)&&void 0!==r?r:1,bucketSize:null!==(s=this._instance.config.error_tracking.__exceptionRateLimiterBucketSize)&&void 0!==s?s:10,refillInterval:1e4,h:We}),this.startIfEnabled()}ht(){var t=this._instance.config.capture_exceptions,i={capture_unhandled_errors:!1,capture_unhandled_rejections:!1,capture_console_errors:!1};return I(t)?i=g({},i,t):(M(t)?this.ut:t)&&(i=g({},i,{capture_unhandled_errors:!0,capture_unhandled_rejections:!0})),i}get isEnabled(){return this.I.capture_console_errors||this.I.capture_unhandled_errors||this.I.capture_unhandled_rejections}startIfEnabled(){this.isEnabled&&(We.info("enabled"),this.it(this.rt))}it(t){var i,e;null!=(i=v.__PosthogExtensions__)&&i.errorWrappingFunctions&&t(),null==(e=v.__PosthogExtensions__)||null==e.loadExternalDependency||e.loadExternalDependency(this._instance,"exception-autocapture",(i=>{if(i)return We.error("failed to load script",i);t()}))}lt(){var t,i,e;null==(t=this.st)||t.call(this),this.st=void 0,null==(i=this.nt)||i.call(this),this.nt=void 0,null==(e=this.ot)||e.call(this),this.ot=void 0}onRemoteConfig(t){var i=t.autocaptureExceptions;this.ut=!!i||!1,this.I=this.ht(),this._instance.persistence&&this._instance.persistence.register({[Yt]:this.ut}),this.startIfEnabled()}captureException(t){var i,e,r=null!==(i=null==t||null==(e=t.$exception_list)||null==(e=e[0])?void 0:e.type)&&void 0!==i?i:"Exception";this.dt.consumeRateLimit(r)?We.info("Skipping exception capture because of client rate limiting.",{exception:r}):this._instance.exceptions.sendExceptionEvent(t)}}function Ve(t,i,e){try{if(!(i in t))return()=>{};var r=t[i],s=e(r);return R(s)&&(s.prototype=s.prototype||{},Object.defineProperties(s,{__posthog_wrapped__:{enumerable:!1,value:!0}})),t[i]=s,()=>{t[i]=r}}catch(t){return()=>{}}}class Je{constructor(i){var e;this._instance=i,this.vt=(null==t||null==(e=t.location)?void 0:e.pathname)||""}get isEnabled(){return"history_change"===this._instance.config.capture_pageview}startIfEnabled(){this.isEnabled&&(Pt.info("History API monitoring enabled, starting..."),this.monitorHistoryChanges())}stop(){this.ct&&this.ct(),this.ct=void 0,Pt.info("History API monitoring stopped")}monitorHistoryChanges(){var i,e;if(t&&t.history){var r=this;null!=(i=t.history.pushState)&&i.__posthog_wrapped__||Ve(t.history,"pushState",(t=>function(i,e,s){t.call(this,i,e,s),r.ft("pushState")})),null!=(e=t.history.replaceState)&&e.__posthog_wrapped__||Ve(t.history,"replaceState",(t=>function(i,e,s){t.call(this,i,e,s),r.ft("replaceState")})),this.gt()}}ft(i){try{var e,r=null==t||null==(e=t.location)?void 0:e.pathname;if(!r)return;r!==this.vt&&this.isEnabled&&this._instance.capture("$pageview",{navigation_type:i}),this.vt=r}catch(t){Pt.error("Error capturing "+i+" pageview",t)}}gt(){if(!this.ct){var i=()=>{this.ft("popstate")};qt(t,"popstate",i),this.ct=()=>{t&&t.removeEventListener("popstate",i)}}}}var Ke=Tt("[SegmentIntegration]");function Ye(t,i){var e=t.config.segment;if(!e)return i();!function(t,i){var e=t.config.segment;if(!e)return i();var r=e=>{var r=()=>e.anonymousId()||$e();t.config.get_device_id=r,e.id()&&(t.register({distinct_id:e.id(),$device_id:r()}),t.persistence.set_property(ci,"identified")),i()},s=e.user();"then"in s&&R(s.then)?s.then((t=>r(t))):r(s)}(t,(()=>{e.register((t=>{Promise&&Promise.resolve||Ke.warn("This browser does not have Promise support, and can not use the segment integration");var i=(i,e)=>{if(!e)return i;i.event.userId||i.event.anonymousId===t.get_distinct_id()||(Ke.info("No userId set, resetting PostHog"),t.reset()),i.event.userId&&i.event.userId!==t.get_distinct_id()&&(Ke.info("UserId set, identifying with PostHog"),t.identify(i.event.userId));var r=t.calculateEventProperties(e,i.event.properties);return i.event.properties=Object.assign({},r,i.event.properties),i};return{name:"PostHog JS",type:"enrichment",version:"1.0.0",isLoaded:()=>!0,load:()=>Promise.resolve(),track:t=>i(t,t.event.event),page:t=>i(t,"$pageview"),identify:t=>i(t,"$identify"),screen:t=>i(t,"$screen")}})(t)).then((()=>{i()}))}))}var Xe="posthog-js";function Qe(t,i){var{organization:e,projectId:r,prefix:s,severityAllowList:n=["error"],sendExceptionsToPostHog:o=!0}=void 0===i?{}:i;return i=>{var a,l,u,h,d;if(!("*"===n||n.includes(i.level))||!t.__loaded)return i;i.tags||(i.tags={});var v=t.requestRouter.endpointFor("ui","/project/"+t.config.token+"/person/"+t.get_distinct_id());i.tags["PostHog Person URL"]=v,t.sessionRecordingStarted()&&(i.tags["PostHog Recording URL"]=t.get_session_replay_url({withTimestamp:!0}));var c=(null==(a=i.exception)?void 0:a.values)||[],f=c.map((t=>g({},t,{stacktrace:t.stacktrace?g({},t.stacktrace,{type:"raw",frames:(t.stacktrace.frames||[]).map((t=>g({},t,{platform:"web:javascript"})))}):void 0}))),p={$exception_message:(null==(l=c[0])?void 0:l.value)||i.message,$exception_type:null==(u=c[0])?void 0:u.type,$exception_level:i.level,$exception_list:f,$sentry_event_id:i.event_id,$sentry_exception:i.exception,$sentry_exception_message:(null==(h=c[0])?void 0:h.value)||i.message,$sentry_exception_type:null==(d=c[0])?void 0:d.type,$sentry_tags:i.tags};return e&&r&&(p.$sentry_url=(s||"https://sentry.io/organizations/")+e+"/issues/?project="+r+"&query="+i.event_id),o&&t.exceptions.sendExceptionEvent(p),i}}class Ze{constructor(t,i,e,r,s,n){this.name=Xe,this.setupOnce=function(o){o(Qe(t,{organization:i,projectId:e,prefix:r,severityAllowList:s,sendExceptionsToPostHog:null==n||n}))}}}var tr=null!=t&&t.location?ve(t.location.hash,"__posthog")||ve(location.hash,"state"):null,ir="_postHogToolbarParams",er=Tt("[Toolbar]"),rr=function(t){return t[t.UNINITIALIZED=0]="UNINITIALIZED",t[t.LOADING=1]="LOADING",t[t.LOADED=2]="LOADED",t}(rr||{});class sr{constructor(t){this.instance=t}_t(t){v.ph_toolbar_state=t}yt(){var t;return null!==(t=v.ph_toolbar_state)&&void 0!==t?t:rr.UNINITIALIZED}maybeLoadToolbar(i,e,r){if(void 0===i&&(i=void 0),void 0===e&&(e=void 0),void 0===r&&(r=void 0),!t||!o)return!1;i=null!=i?i:t.location,r=null!=r?r:t.history;try{if(!e){try{t.localStorage.setItem("test","test"),t.localStorage.removeItem("test")}catch(t){return!1}e=null==t?void 0:t.localStorage}var s,n=tr||ve(i.hash,"__posthog")||ve(i.hash,"state"),a=n?jt((()=>JSON.parse(atob(decodeURIComponent(n)))))||jt((()=>JSON.parse(decodeURIComponent(n)))):null;return a&&"ph_authorize"===a.action?((s=a).source="url",s&&Object.keys(s).length>0&&(a.desiredHash?i.hash=a.desiredHash:r?r.replaceState(r.state,"",i.pathname+i.search):i.hash="")):((s=JSON.parse(e.getItem(ir)||"{}")).source="localstorage",delete s.userIntent),!(!s.token||this.instance.config.token!==s.token)&&(this.loadToolbar(s),!0)}catch(t){return!1}}bt(t){var i=v.ph_load_toolbar||v.ph_load_editor;!j(i)&&R(i)?i(t,this.instance):er.warn("No toolbar load function found")}loadToolbar(i){var e=!(null==o||!o.getElementById(bi));if(!t||e)return!1;var r="custom"===this.instance.requestRouter.region&&this.instance.config.advanced_disable_toolbar_metrics,s=g({token:this.instance.config.token},i,{apiURL:this.instance.requestRouter.endpointFor("ui")},r?{instrument:!1}:{});if(t.localStorage.setItem(ir,JSON.stringify(g({},s,{source:void 0}))),this.yt()===rr.LOADED)this.bt(s);else if(this.yt()===rr.UNINITIALIZED){var n;this._t(rr.LOADING),null==(n=v.__PosthogExtensions__)||null==n.loadExternalDependency||n.loadExternalDependency(this.instance,"toolbar",(t=>{if(t)return er.error("[Toolbar] Failed to load",t),void this._t(rr.UNINITIALIZED);this._t(rr.LOADED),this.bt(s)})),qt(t,"turbolinks:load",(()=>{this._t(rr.UNINITIALIZED),this.loadToolbar(s)}))}return!0}wt(t){return this.loadToolbar(t)}maybeLoadEditor(t,i,e){return void 0===t&&(t=void 0),void 0===i&&(i=void 0),void 0===e&&(e=void 0),this.maybeLoadToolbar(t,i,e)}}var nr=Tt("[TracingHeaders]");class or{constructor(t){this.xt=void 0,this.Et=void 0,this.rt=()=>{var t,i;M(this.xt)&&(null==(t=v.__PosthogExtensions__)||null==(t=t.tracingHeadersPatchFns)||t._patchXHR(this._instance.config.__add_tracing_headers||[],this._instance.get_distinct_id(),this._instance.sessionManager));M(this.Et)&&(null==(i=v.__PosthogExtensions__)||null==(i=i.tracingHeadersPatchFns)||i._patchFetch(this._instance.config.__add_tracing_headers||[],this._instance.get_distinct_id(),this._instance.sessionManager))},this._instance=t}it(t){var i,e;null!=(i=v.__PosthogExtensions__)&&i.tracingHeadersPatchFns&&t(),null==(e=v.__PosthogExtensions__)||null==e.loadExternalDependency||e.loadExternalDependency(this._instance,"tracing-headers",(i=>{if(i)return nr.error("failed to load script",i);t()}))}startIfEnabledOrStop(){var t,i;this._instance.config.__add_tracing_headers?this.it(this.rt):(null==(t=this.xt)||t.call(this),null==(i=this.Et)||i.call(this),this.xt=void 0,this.Et=void 0)}}var ar="Mobile",lr="iOS",ur="Android",hr="Tablet",dr=ur+" "+hr,vr="iPad",cr="Apple",fr=cr+" Watch",pr="Safari",gr="BlackBerry",_r="Samsung",mr=_r+"Browser",yr=_r+" Internet",br="Chrome",wr=br+" OS",xr=br+" "+lr,Er="Internet Explorer",Sr=Er+" "+ar,$r="Opera",kr=$r+" Mini",Pr="Edge",Tr="Microsoft "+Pr,Cr="Firefox",Rr=Cr+" "+lr,Ir="Nintendo",Fr="PlayStation",Mr="Xbox",Or=ur+" "+ar,Ar=ar+" "+pr,Dr="Windows",jr=Dr+" Phone",Lr="Nokia",Nr="Ouya",Ur="Generic",zr=Ur+" "+ar.toLowerCase(),Hr=Ur+" "+hr.toLowerCase(),Br="Konqueror",qr="(\\d+(\\.\\d+)?)",Wr=new RegExp("Version/"+qr),Gr=new RegExp(Mr,"i"),Vr=new RegExp(Fr+" \\w+","i"),Jr=new RegExp(Ir+" \\w+","i"),Kr=new RegExp(gr+"|PlayBook|BB10","i"),Yr={"NT3.51":"NT 3.11","NT4.0":"NT 4.0","5.0":"2000",5.1:"XP",5.2:"XP","6.0":"Vista",6.1:"7",6.2:"8",6.3:"8.1",6.4:"10","10.0":"10"};var Xr=(t,i)=>i&&w(i,cr)||function(t){return w(t,pr)&&!w(t,br)&&!w(t,ur)}(t),Qr=function(t,i){return i=i||"",w(t," OPR/")&&w(t,"Mini")?kr:w(t," OPR/")?$r:Kr.test(t)?gr:w(t,"IE"+ar)||w(t,"WPDesktop")?Sr:w(t,mr)?yr:w(t,Pr)||w(t,"Edg/")?Tr:w(t,"FBIOS")?"Facebook "+ar:w(t,"UCWEB")||w(t,"UCBrowser")?"UC Browser":w(t,"CriOS")?xr:w(t,"CrMo")||w(t,br)?br:w(t,ur)&&w(t,pr)?Or:w(t,"FxiOS")?Rr:w(t.toLowerCase(),Br.toLowerCase())?Br:Xr(t,i)?w(t,ar)?Ar:pr:w(t,Cr)?Cr:w(t,"MSIE")||w(t,"Trident/")?Er:w(t,"Gecko")?Cr:""},Zr={[Sr]:[new RegExp("rv:"+qr)],[Tr]:[new RegExp(Pr+"?\\/"+qr)],[br]:[new RegExp("("+br+"|CrMo)\\/"+qr)],[xr]:[new RegExp("CriOS\\/"+qr)],"UC Browser":[new RegExp("(UCBrowser|UCWEB)\\/"+qr)],[pr]:[Wr],[Ar]:[Wr],[$r]:[new RegExp("(Opera|OPR)\\/"+qr)],[Cr]:[new RegExp(Cr+"\\/"+qr)],[Rr]:[new RegExp("FxiOS\\/"+qr)],[Br]:[new RegExp("Konqueror[:/]?"+qr,"i")],[gr]:[new RegExp(gr+" "+qr),Wr],[Or]:[new RegExp("android\\s"+qr,"i")],[yr]:[new RegExp(mr+"\\/"+qr)],[Er]:[new RegExp("(rv:|MSIE )"+qr)],Mozilla:[new RegExp("rv:"+qr)]},ts=function(t,i){var e=Qr(t,i),r=Zr[e];if(M(r))return null;for(var s=0;s<r.length;s++){var n=r[s],o=t.match(n);if(o)return parseFloat(o[o.length-2])}return null},is=[[new RegExp(Mr+"; "+Mr+" (.*?)[);]","i"),t=>[Mr,t&&t[1]||""]],[new RegExp(Ir,"i"),[Ir,""]],[new RegExp(Fr,"i"),[Fr,""]],[Kr,[gr,""]],[new RegExp(Dr,"i"),(t,i)=>{if(/Phone/.test(i)||/WPDesktop/.test(i))return[jr,""];if(new RegExp(ar).test(i)&&!/IEMobile\b/.test(i))return[Dr+" "+ar,""];var e=/Windows NT ([0-9.]+)/i.exec(i);if(e&&e[1]){var r=e[1],s=Yr[r]||"";return/arm/i.test(i)&&(s="RT"),[Dr,s]}return[Dr,""]}],[/((iPhone|iPad|iPod).*?OS (\d+)_(\d+)_?(\d+)?|iPhone)/,t=>{if(t&&t[3]){var i=[t[3],t[4],t[5]||"0"];return[lr,i.join(".")]}return[lr,""]}],[/(watch.*\/(\d+\.\d+\.\d+)|watch os,(\d+\.\d+),)/i,t=>{var i="";return t&&t.length>=3&&(i=M(t[2])?t[3]:t[2]),["watchOS",i]}],[new RegExp("("+ur+" (\\d+)\\.(\\d+)\\.?(\\d+)?|"+ur+")","i"),t=>{if(t&&t[2]){var i=[t[2],t[3],t[4]||"0"];return[ur,i.join(".")]}return[ur,""]}],[/Mac OS X (\d+)[_.](\d+)[_.]?(\d+)?/i,t=>{var i=["Mac OS X",""];if(t&&t[1]){var e=[t[1],t[2],t[3]||"0"];i[1]=e.join(".")}return i}],[/Mac/i,["Mac OS X",""]],[/CrOS/,[wr,""]],[/Linux|debian/i,["Linux",""]]],es=function(t){return Jr.test(t)?Ir:Vr.test(t)?Fr:Gr.test(t)?Mr:new RegExp(Nr,"i").test(t)?Nr:new RegExp("("+jr+"|WPDesktop)","i").test(t)?jr:/iPad/.test(t)?vr:/iPod/.test(t)?"iPod Touch":/iPhone/.test(t)?"iPhone":/(watch)(?: ?os[,/]|\d,\d\/)[\d.]+/i.test(t)?fr:Kr.test(t)?gr:/(kobo)\s(ereader|touch)/i.test(t)?"Kobo":new RegExp(Lr,"i").test(t)?Lr:/(kf[a-z]{2}wi|aeo[c-r]{2})( bui|\))/i.test(t)||/(kf[a-z]+)( bui|\)).+silk\//i.test(t)?"Kindle Fire":/(Android|ZTE)/i.test(t)?!new RegExp(ar).test(t)||/(9138B|TB782B|Nexus [97]|pixel c|HUAWEISHT|BTV|noble nook|smart ultra 6)/i.test(t)?/pixel[\daxl ]{1,6}/i.test(t)&&!/pixel c/i.test(t)||/(huaweimed-al00|tah-|APA|SM-G92|i980|zte|U304AA)/i.test(t)||/lmy47v/i.test(t)&&!/QTAQZ3/i.test(t)?ur:dr:ur:new RegExp("(pda|"+ar+")","i").test(t)?zr:new RegExp(hr,"i").test(t)&&!new RegExp(hr+" pc","i").test(t)?Hr:""},rs="https?://(.*)",ss=["gclid","gclsrc","dclid","gbraid","wbraid","fbclid","msclkid","twclid","li_fat_id","igshid","ttclid","rdt_cid","epik","qclid","sccid","irclid","_kx"],ns=At(["utm_source","utm_medium","utm_campaign","utm_content","utm_term","gad_source","mc_cid"],ss),os="<masked>",as=["li_fat_id"];function ls(t,i,e){if(!o)return{};var r,s=i?At([],ss,e||[]):[],n=us(de(o.URL,s,os),t),a=(r={},Mt(as,(function(t){var i=Re.q(t);r[t]=i||null})),r);return Ot(a,n)}function us(t,i){var e=ns.concat(i||[]),r={};return Mt(e,(function(i){var e=he(t,i);r[i]=e||null})),r}function hs(t){var i=function(t){return t?0===t.search(rs+"google.([^/?]*)")?"google":0===t.search(rs+"bing.com")?"bing":0===t.search(rs+"yahoo.com")?"yahoo":0===t.search(rs+"duckduckgo.com")?"duckduckgo":null:null}(t),e="yahoo"!=i?"q":"p",r={};if(!D(i)){r.$search_engine=i;var s=o?he(o.referrer,e):"";s.length&&(r.ph_keyword=s)}return r}function ds(){return navigator.language||navigator.userLanguage}function vs(){return(null==o?void 0:o.referrer)||"$direct"}function cs(t,i){var e=t?At([],ss,i||[]):[],r=null==a?void 0:a.href.substring(0,1e3);return{r:vs().substring(0,1e3),u:r?de(r,e,os):void 0}}function fs(t){var i,{r:e,u:r}=t,s={$referrer:e,$referring_domain:null==e?void 0:"$direct"==e?"$direct":null==(i=le(e))?void 0:i.host};if(r){s.$current_url=r;var n=le(r);s.$host=null==n?void 0:n.host,s.$pathname=null==n?void 0:n.pathname;var o=us(r);Ot(s,o)}if(e){var a=hs(e);Ot(s,a)}return s}function ps(){try{return Intl.DateTimeFormat().resolvedOptions().timeZone}catch(t){return}}function gs(){try{return(new Date).getTimezoneOffset()}catch(t){return}}function _s(i,e){if(!d)return{};var r,s,n,o=i?At([],ss,e||[]):[],[l,u]=function(t){for(var i=0;i<is.length;i++){var[e,r]=is[i],s=e.exec(t),n=s&&(R(r)?r(s,t):r);if(n)return n}return["",""]}(d);return Ot(Nt({$os:l,$os_version:u,$browser:Qr(d,navigator.vendor),$device:es(d),$device_type:(s=d,n=es(s),n===vr||n===dr||"Kobo"===n||"Kindle Fire"===n||n===Hr?hr:n===Ir||n===Mr||n===Fr||n===Nr?"Console":n===fr?"Wearable":n?ar:"Desktop"),$timezone:ps(),$timezone_offset:gs()}),{$current_url:de(null==a?void 0:a.href,o,os),$host:null==a?void 0:a.host,$pathname:null==a?void 0:a.pathname,$raw_user_agent:d.length>1e3?d.substring(0,997)+"...":d,$browser_version:ts(d,navigator.vendor),$browser_language:ds(),$browser_language_prefix:(r=ds(),"string"==typeof r?r.split("-")[0]:void 0),$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:c.LIB_VERSION,$insert_id:Math.random().toString(36).substring(2,10)+Math.random().toString(36).substring(2,10),$time:Date.now()/1e3})}var ms=Tt("[Web Vitals]"),ys=9e5;class bs{constructor(t){var i;this.St=!1,this.P=!1,this.N={url:void 0,metrics:[],firstMetricTimestamp:void 0},this.$t=()=>{clearTimeout(this.kt),0!==this.N.metrics.length&&(this._instance.capture("$web_vitals",this.N.metrics.reduce(((t,i)=>g({},t,{["$web_vitals_"+i.name+"_event"]:g({},i),["$web_vitals_"+i.name+"_value"]:i.value})),{})),this.N={url:void 0,metrics:[],firstMetricTimestamp:void 0})},this.Pt=t=>{var i,e=null==(i=this._instance.sessionManager)?void 0:i.checkAndGetSessionAndWindowId(!0);if(M(e))ms.error("Could not read session ID. Dropping metrics!");else{this.N=this.N||{url:void 0,metrics:[],firstMetricTimestamp:void 0};var r=this.Tt();if(!M(r))if(j(null==t?void 0:t.name)||j(null==t?void 0:t.value))ms.error("Invalid metric received",t);else if(this.Ct&&t.value>=this.Ct)ms.error("Ignoring metric with value >= "+this.Ct,t);else this.N.url!==r&&(this.$t(),this.kt=setTimeout(this.$t,this.flushToCaptureTimeoutMs)),M(this.N.url)&&(this.N.url=r),this.N.firstMetricTimestamp=M(this.N.firstMetricTimestamp)?Date.now():this.N.firstMetricTimestamp,t.attribution&&t.attribution.interactionTargetElement&&(t.attribution.interactionTargetElement=void 0),this.N.metrics.push(g({},t,{$current_url:r,$session_id:e.sessionId,$window_id:e.windowId,timestamp:Date.now()})),this.N.metrics.length===this.allowedMetrics.length&&this.$t()}},this.rt=()=>{var t,i,e,r,s=v.__PosthogExtensions__;M(s)||M(s.postHogWebVitalsCallbacks)||({onLCP:t,onCLS:i,onFCP:e,onINP:r}=s.postHogWebVitalsCallbacks),t&&i&&e&&r?(this.allowedMetrics.indexOf("LCP")>-1&&t(this.Pt.bind(this)),this.allowedMetrics.indexOf("CLS")>-1&&i(this.Pt.bind(this)),this.allowedMetrics.indexOf("FCP")>-1&&e(this.Pt.bind(this)),this.allowedMetrics.indexOf("INP")>-1&&r(this.Pt.bind(this)),this.P=!0):ms.error("web vitals callbacks not loaded - not starting")},this._instance=t,this.St=!(null==(i=this._instance.persistence)||!i.props[Zt]),this.startIfEnabled()}get allowedMetrics(){var t,i,e=I(this._instance.config.capture_performance)?null==(t=this._instance.config.capture_performance)?void 0:t.web_vitals_allowed_metrics:void 0;return M(e)?(null==(i=this._instance.persistence)?void 0:i.props[ii])||["CLS","FCP","INP","LCP"]:e}get flushToCaptureTimeoutMs(){return(I(this._instance.config.capture_performance)?this._instance.config.capture_performance.web_vitals_delayed_flush_ms:void 0)||5e3}get Ct(){var t=I(this._instance.config.capture_performance)&&L(this._instance.config.capture_performance.__web_vitals_max_value)?this._instance.config.capture_performance.__web_vitals_max_value:ys;return 0<t&&t<=6e4?ys:t}get isEnabled(){var t=null==a?void 0:a.protocol;if("http:"!==t&&"https:"!==t)return ms.info("Web Vitals are disabled on non-http/https protocols"),!1;var i=I(this._instance.config.capture_performance)?this._instance.config.capture_performance.web_vitals:N(this._instance.config.capture_performance)?this._instance.config.capture_performance:void 0;return N(i)?i:this.St}startIfEnabled(){this.isEnabled&&!this.P&&(ms.info("enabled, starting..."),this.it(this.rt))}onRemoteConfig(t){var i=I(t.capturePerformance)&&!!t.capturePerformance.web_vitals,e=I(t.capturePerformance)?t.capturePerformance.web_vitals_allowed_metrics:void 0;this._instance.persistence&&(this._instance.persistence.register({[Zt]:i}),this._instance.persistence.register({[ii]:e})),this.St=i,this.startIfEnabled()}it(t){var i,e;null!=(i=v.__PosthogExtensions__)&&i.postHogWebVitalsCallbacks&&t(),null==(e=v.__PosthogExtensions__)||null==e.loadExternalDependency||e.loadExternalDependency(this._instance,"web-vitals",(i=>{i?ms.error("failed to load script",i):t()}))}Tt(){var i=t?t.location.href:void 0;if(i){var e=this._instance.config.mask_personal_data_properties,r=this._instance.config.custom_personal_data_properties,s=e?At([],ss,r||[]):[];return de(i,s,os)}ms.error("Could not determine current URL")}}var ws=Tt("[Heatmaps]");function xs(t){return I(t)&&"clientX"in t&&"clientY"in t&&L(t.clientX)&&L(t.clientY)}class Es{constructor(t){var i;this.St=!1,this.P=!1,this.Rt=null,this.instance=t,this.St=!(null==(i=this.instance.persistence)||!i.props[Kt]),this.rageclicks=new se(t.config.rageclick)}get flushIntervalMilliseconds(){var t=5e3;return I(this.instance.config.capture_heatmaps)&&this.instance.config.capture_heatmaps.flush_interval_milliseconds&&(t=this.instance.config.capture_heatmaps.flush_interval_milliseconds),t}get isEnabled(){return M(this.instance.config.capture_heatmaps)?M(this.instance.config.enable_heatmaps)?this.St:this.instance.config.enable_heatmaps:!1!==this.instance.config.capture_heatmaps}startIfEnabled(){if(this.isEnabled){if(this.P)return;ws.info("starting..."),this.It(),this.Ft()}else{var t;clearInterval(null!==(t=this.Rt)&&void 0!==t?t:void 0),this.Mt(),this.getAndClearBuffer()}}onRemoteConfig(t){var i=!!t.heatmaps;this.instance.persistence&&this.instance.persistence.register({[Kt]:i}),this.St=i,this.startIfEnabled()}getAndClearBuffer(){var t=this.N;return this.N=void 0,t}Ot(t){this.At(t.originalEvent,"deadclick")}Ft(){this.Rt&&clearInterval(this.Rt),this.Rt=function(t){return"visible"===(null==t?void 0:t.visibilityState)}(o)?setInterval(this.Dt.bind(this),this.flushIntervalMilliseconds):null}It(){t&&o&&(this.jt=this.Dt.bind(this),qt(t,"beforeunload",this.jt),this.Lt=i=>this.At(i||(null==t?void 0:t.event)),qt(o,"click",this.Lt,{capture:!0}),this.Nt=i=>this.Ut(i||(null==t?void 0:t.event)),qt(o,"mousemove",this.Nt,{capture:!0}),this.zt=new qe(this.instance,He,this.Ot.bind(this)),this.zt.startIfEnabled(),this.Ht=this.Ft.bind(this),qt(o,"visibilitychange",this.Ht),this.P=!0)}Mt(){var i;t&&o&&(this.jt&&t.removeEventListener("beforeunload",this.jt),this.Lt&&o.removeEventListener("click",this.Lt,{capture:!0}),this.Nt&&o.removeEventListener("mousemove",this.Nt,{capture:!0}),this.Ht&&o.removeEventListener("visibilitychange",this.Ht),clearTimeout(this.Bt),null==(i=this.zt)||i.stop(),this.P=!1)}qt(i,e){var r=this.instance.scrollManager.scrollY(),s=this.instance.scrollManager.scrollX(),n=this.instance.scrollManager.scrollElement(),o=function(i,e,r){for(var s=i;s&&Si(s)&&!$i(s,"body");){if(s===r)return!1;if(w(e,null==t?void 0:t.getComputedStyle(s).position))return!0;s=Di(s)}return!1}(Mi(i),["fixed","sticky"],n);return{x:i.clientX+(o?0:s),y:i.clientY+(o?0:r),target_fixed:o,type:e}}At(t,i){var e;if(void 0===i&&(i="click"),!Ei(t.target)&&xs(t)){var r=this.qt(t,i);null!=(e=this.rageclicks)&&e.isRageClick(t.clientX,t.clientY,(new Date).getTime())&&this.Wt(g({},r,{type:"rageclick"})),this.Wt(r)}}Ut(t){!Ei(t.target)&&xs(t)&&(clearTimeout(this.Bt),this.Bt=setTimeout((()=>{this.Wt(this.qt(t,"mousemove"))}),500))}Wt(i){if(t){var e=t.location.href,r=this.instance.config.mask_personal_data_properties,s=this.instance.config.custom_personal_data_properties,n=r?At([],ss,s||[]):[],o=de(e,n,os);this.N=this.N||{},this.N[o]||(this.N[o]=[]),this.N[o].push(i)}}Dt(){this.N&&!F(this.N)&&this.instance.capture("$$heatmap",{$heatmap_data:this.getAndClearBuffer()})}}class Ss{constructor(t){this._instance=t}doPageView(i,e){var r,s=this.Gt(i,e);return this.Vt={pathname:null!==(r=null==t?void 0:t.location.pathname)&&void 0!==r?r:"",pageViewId:e,timestamp:i},this._instance.scrollManager.resetContext(),s}doPageLeave(t){var i;return this.Gt(t,null==(i=this.Vt)?void 0:i.pageViewId)}doEvent(){var t;return{$pageview_id:null==(t=this.Vt)?void 0:t.pageViewId}}Gt(t,i){var e=this.Vt;if(!e)return{$pageview_id:i};var r={$pageview_id:i,$prev_pageview_id:e.pageViewId},s=this._instance.scrollManager.getContext();if(s&&!this._instance.config.disable_scroll_properties){var{maxScrollHeight:n,lastScrollY:o,maxScrollY:a,maxContentHeight:l,lastContentY:u,maxContentY:h}=s;if(!(M(n)||M(o)||M(a)||M(l)||M(u)||M(h))){n=Math.ceil(n),o=Math.ceil(o),a=Math.ceil(a),l=Math.ceil(l),u=Math.ceil(u),h=Math.ceil(h);var d=n<=1?1:J(o/n,0,1,Pt),v=n<=1?1:J(a/n,0,1,Pt),c=l<=1?1:J(u/l,0,1,Pt),f=l<=1?1:J(h/l,0,1,Pt);r=Ot(r,{$prev_pageview_last_scroll:o,$prev_pageview_last_scroll_percentage:d,$prev_pageview_max_scroll:a,$prev_pageview_max_scroll_percentage:v,$prev_pageview_last_content:u,$prev_pageview_last_content_percentage:c,$prev_pageview_max_content:h,$prev_pageview_max_content_percentage:f})}}return e.pathname&&(r.$prev_pageview_pathname=e.pathname),e.timestamp&&(r.$prev_pageview_duration=(t.getTime()-e.timestamp.getTime())/1e3),r}}var $s=Uint8Array,ks=Uint16Array,Ps=Uint32Array,Ts=new $s([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]),Cs=new $s([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]),Rs=new $s([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),Is=function(t,i){for(var e=new ks(31),r=0;r<31;++r)e[r]=i+=1<<t[r-1];var s=new Ps(e[30]);for(r=1;r<30;++r)for(var n=e[r];n<e[r+1];++n)s[n]=n-e[r]<<5|r;return[e,s]},Fs=Is(Ts,2),Ms=Fs[0],Os=Fs[1];Ms[28]=258,Os[258]=28;for(var As=Is(Cs,0)[1],Ds=new ks(32768),js=0;js<32768;++js){var Ls=(43690&js)>>>1|(21845&js)<<1;Ls=(61680&(Ls=(52428&Ls)>>>2|(13107&Ls)<<2))>>>4|(3855&Ls)<<4,Ds[js]=((65280&Ls)>>>8|(255&Ls)<<8)>>>1}var Ns=function(t,i,e){for(var r=t.length,s=0,n=new ks(i);s<r;++s)++n[t[s]-1];var o,a=new ks(i);for(s=0;s<i;++s)a[s]=a[s-1]+n[s-1]<<1;if(e){o=new ks(1<<i);var l=15-i;for(s=0;s<r;++s)if(t[s])for(var u=s<<4|t[s],h=i-t[s],d=a[t[s]-1]++<<h,v=d|(1<<h)-1;d<=v;++d)o[Ds[d]>>>l]=u}else for(o=new ks(r),s=0;s<r;++s)o[s]=Ds[a[t[s]-1]++]>>>15-t[s];return o},Us=new $s(288);for(js=0;js<144;++js)Us[js]=8;for(js=144;js<256;++js)Us[js]=9;for(js=256;js<280;++js)Us[js]=7;for(js=280;js<288;++js)Us[js]=8;var zs=new $s(32);for(js=0;js<32;++js)zs[js]=5;var Hs=Ns(Us,9,0),Bs=Ns(zs,5,0),qs=function(t){return(t/8>>0)+(7&t&&1)},Ws=function(t,i,e){(null==e||e>t.length)&&(e=t.length);var r=new(t instanceof ks?ks:t instanceof Ps?Ps:$s)(e-i);return r.set(t.subarray(i,e)),r},Gs=function(t,i,e){e<<=7&i;var r=i/8>>0;t[r]|=e,t[r+1]|=e>>>8},Vs=function(t,i,e){e<<=7&i;var r=i/8>>0;t[r]|=e,t[r+1]|=e>>>8,t[r+2]|=e>>>16},Js=function(t,i){for(var e=[],r=0;r<t.length;++r)t[r]&&e.push({s:r,f:t[r]});var s=e.length,n=e.slice();if(!s)return[new $s(0),0];if(1==s){var o=new $s(e[0].s+1);return o[e[0].s]=1,[o,1]}e.sort((function(t,i){return t.f-i.f})),e.push({s:-1,f:25001});var a=e[0],l=e[1],u=0,h=1,d=2;for(e[0]={s:-1,f:a.f+l.f,l:a,r:l};h!=s-1;)a=e[e[u].f<e[d].f?u++:d++],l=e[u!=h&&e[u].f<e[d].f?u++:d++],e[h++]={s:-1,f:a.f+l.f,l:a,r:l};var v=n[0].s;for(r=1;r<s;++r)n[r].s>v&&(v=n[r].s);var c=new ks(v+1),f=Ks(e[h-1],c,0);if(f>i){r=0;var p=0,g=f-i,_=1<<g;for(n.sort((function(t,i){return c[i.s]-c[t.s]||t.f-i.f}));r<s;++r){var m=n[r].s;if(!(c[m]>i))break;p+=_-(1<<f-c[m]),c[m]=i}for(p>>>=g;p>0;){var y=n[r].s;c[y]<i?p-=1<<i-c[y]++-1:++r}for(;r>=0&&p;--r){var b=n[r].s;c[b]==i&&(--c[b],++p)}f=i}return[new $s(c),f]},Ks=function(t,i,e){return-1==t.s?Math.max(Ks(t.l,i,e+1),Ks(t.r,i,e+1)):i[t.s]=e},Ys=function(t){for(var i=t.length;i&&!t[--i];);for(var e=new ks(++i),r=0,s=t[0],n=1,o=function(t){e[r++]=t},a=1;a<=i;++a)if(t[a]==s&&a!=i)++n;else{if(!s&&n>2){for(;n>138;n-=138)o(32754);n>2&&(o(n>10?n-11<<5|28690:n-3<<5|12305),n=0)}else if(n>3){for(o(s),--n;n>6;n-=6)o(8304);n>2&&(o(n-3<<5|8208),n=0)}for(;n--;)o(s);n=1,s=t[a]}return[e.subarray(0,r),i]},Xs=function(t,i){for(var e=0,r=0;r<i.length;++r)e+=t[r]*i[r];return e},Qs=function(t,i,e){var r=e.length,s=qs(i+2);t[s]=255&r,t[s+1]=r>>>8,t[s+2]=255^t[s],t[s+3]=255^t[s+1];for(var n=0;n<r;++n)t[s+n+4]=e[n];return 8*(s+4+r)},Zs=function(t,i,e,r,s,n,o,a,l,u,h){Gs(i,h++,e),++s[256];for(var d=Js(s,15),v=d[0],c=d[1],f=Js(n,15),p=f[0],g=f[1],_=Ys(v),m=_[0],y=_[1],b=Ys(p),w=b[0],x=b[1],E=new ks(19),S=0;S<m.length;++S)E[31&m[S]]++;for(S=0;S<w.length;++S)E[31&w[S]]++;for(var k=Js(E,7),P=k[0],T=k[1],C=19;C>4&&!P[Rs[C-1]];--C);var R,I,F,M,O=u+5<<3,A=Xs(s,Us)+Xs(n,zs)+o,D=Xs(s,v)+Xs(n,p)+o+14+3*C+Xs(E,P)+(2*E[16]+3*E[17]+7*E[18]);if(O<=A&&O<=D)return Qs(i,h,t.subarray(l,l+u));if(Gs(i,h,1+(D<A)),h+=2,D<A){R=Ns(v,c,0),I=v,F=Ns(p,g,0),M=p;var j=Ns(P,T,0);Gs(i,h,y-257),Gs(i,h+5,x-1),Gs(i,h+10,C-4),h+=14;for(S=0;S<C;++S)Gs(i,h+3*S,P[Rs[S]]);h+=3*C;for(var L=[m,w],N=0;N<2;++N){var U=L[N];for(S=0;S<U.length;++S){var z=31&U[S];Gs(i,h,j[z]),h+=P[z],z>15&&(Gs(i,h,U[S]>>>5&127),h+=U[S]>>>12)}}}else R=Hs,I=Us,F=Bs,M=zs;for(S=0;S<a;++S)if(r[S]>255){z=r[S]>>>18&31;Vs(i,h,R[z+257]),h+=I[z+257],z>7&&(Gs(i,h,r[S]>>>23&31),h+=Ts[z]);var H=31&r[S];Vs(i,h,F[H]),h+=M[H],H>3&&(Vs(i,h,r[S]>>>5&8191),h+=Cs[H])}else Vs(i,h,R[r[S]]),h+=I[r[S]];return Vs(i,h,R[256]),h+I[256]},tn=new Ps([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),en=function(){for(var t=new Ps(256),i=0;i<256;++i){for(var e=i,r=9;--r;)e=(1&e&&3988292384)^e>>>1;t[i]=e}return t}(),rn=function(t,i,e,r,s){return function(t,i,e,r,s,n){var o=t.length,a=new $s(r+o+5*(1+Math.floor(o/7e3))+s),l=a.subarray(r,a.length-s),u=0;if(!i||o<8)for(var h=0;h<=o;h+=65535){var d=h+65535;d<o?u=Qs(l,u,t.subarray(h,d)):(l[h]=n,u=Qs(l,u,t.subarray(h,o)))}else{for(var v=tn[i-1],c=v>>>13,f=8191&v,p=(1<<e)-1,g=new ks(32768),_=new ks(p+1),m=Math.ceil(e/3),y=2*m,b=function(i){return(t[i]^t[i+1]<<m^t[i+2]<<y)&p},w=new Ps(25e3),x=new ks(288),E=new ks(32),S=0,k=0,P=(h=0,0),T=0,C=0;h<o;++h){var R=b(h),I=32767&h,F=_[R];if(g[I]=F,_[R]=I,T<=h){var M=o-h;if((S>7e3||P>24576)&&M>423){u=Zs(t,l,0,w,x,E,k,P,C,h-C,u),P=S=k=0,C=h;for(var O=0;O<286;++O)x[O]=0;for(O=0;O<30;++O)E[O]=0}var A=2,D=0,j=f,L=I-F&32767;if(M>2&&R==b(h-L))for(var N=Math.min(c,M)-1,U=Math.min(32767,h),z=Math.min(258,M);L<=U&&--j&&I!=F;){if(t[h+A]==t[h+A-L]){for(var H=0;H<z&&t[h+H]==t[h+H-L];++H);if(H>A){if(A=H,D=L,H>N)break;var B=Math.min(L,H-2),q=0;for(O=0;O<B;++O){var W=h-L+O+32768&32767,G=W-g[W]+32768&32767;G>q&&(q=G,F=W)}}}L+=(I=F)-(F=g[I])+32768&32767}if(D){w[P++]=268435456|Os[A]<<18|As[D];var V=31&Os[A],J=31&As[D];k+=Ts[V]+Cs[J],++x[257+V],++E[J],T=h+A,++S}else w[P++]=t[h],++x[t[h]]}}u=Zs(t,l,n,w,x,E,k,P,C,h-C,u)}return Ws(a,0,r+qs(u)+s)}(t,null==i.level?6:i.level,null==i.mem?Math.ceil(1.5*Math.max(8,Math.min(13,Math.log(t.length)))):12+i.mem,e,r,!0)},sn=function(t,i,e){for(;e;++i)t[i]=e,e>>>=8};function nn(t,i){void 0===i&&(i={});var e=function(){var t=4294967295;return{p:function(i){for(var e=t,r=0;r<i.length;++r)e=en[255&e^i[r]]^e>>>8;t=e},d:function(){return 4294967295^t}}}(),r=t.length;e.p(t);var s,n=rn(t,i,10+((s=i).filename&&s.filename.length+1||0),8),o=n.length;return function(t,i){var e=i.filename;if(t[0]=31,t[1]=139,t[2]=8,t[8]=i.level<2?4:9==i.level?2:0,t[9]=3,0!=i.mtime&&sn(t,4,Math.floor(new Date(i.mtime||Date.now())/1e3)),e){t[3]=8;for(var r=0;r<=e.length;++r)t[r+10]=e.charCodeAt(r)}}(n,i),sn(n,o-8,e.d()),sn(n,o-4,r),n}var on=function(t){var i,e,r,s,n="";for(i=e=0,r=(t=(t+"").replace(/\r\n/g,"\n").replace(/\r/g,"\n")).length,s=0;s<r;s++){var o=t.charCodeAt(s),a=null;o<128?e++: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),D(a)||(e>i&&(n+=t.substring(i,e)),n+=a,i=e=s+1)}return e>i&&(n+=t.substring(i,t.length)),n},an=!!u||!!l,ln="text/plain",un=function(t,i,e){var r;void 0===e&&(e=!0);var[s,n]=t.split("?"),o=g({},i),a=null!==(r=null==n?void 0:n.split("&").map((t=>{var i,[r,s]=t.split("="),n=e&&null!==(i=o[r])&&void 0!==i?i:s;return delete o[r],r+"="+n})))&&void 0!==r?r:[],l=ue(o);return l&&a.push(l),s+"?"+a.join("&")},hn=(t,i)=>JSON.stringify(t,((t,i)=>"bigint"==typeof i?i.toString():i),i),dn=t=>{var{data:i,compression:e}=t;if(i){if(e===oe.GZipJS){var r=nn(function(t,i){var e=t.length;if("undefined"!=typeof TextEncoder)return(new TextEncoder).encode(t);for(var r=new $s(t.length+(t.length>>>1)),s=0,n=function(t){r[s++]=t},o=0;o<e;++o){if(s+5>r.length){var a=new $s(s+8+(e-o<<1));a.set(r),r=a}var l=t.charCodeAt(o);l<128||i?n(l):l<2048?(n(192|l>>>6),n(128|63&l)):l>55295&&l<57344?(n(240|(l=65536+(1047552&l)|1023&t.charCodeAt(++o))>>>18),n(128|l>>>12&63),n(128|l>>>6&63),n(128|63&l)):(n(224|l>>>12),n(128|l>>>6&63),n(128|63&l))}return Ws(r,0,s)}(hn(i)),{mtime:0}),s=new Blob([r],{type:ln});return{contentType:ln,body:s,estimatedSize:s.size}}if(e===oe.Base64){var n=function(t){var i,e,r,s,n,o="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",a=0,l=0,u="",h=[];if(!t)return t;t=on(t);do{i=(n=t.charCodeAt(a++)<<16|t.charCodeAt(a++)<<8|t.charCodeAt(a++))>>18&63,e=n>>12&63,r=n>>6&63,s=63&n,h[l++]=o.charAt(i)+o.charAt(e)+o.charAt(r)+o.charAt(s)}while(a<t.length);switch(u=h.join(""),t.length%3){case 1:u=u.slice(0,-2)+"==";break;case 2:u=u.slice(0,-1)+"="}return u}(hn(i)),o=(t=>"data="+encodeURIComponent("string"==typeof t?t:hn(t)))(n);return{contentType:"application/x-www-form-urlencoded",body:o,estimatedSize:new Blob([o]).size}}var a=hn(i);return{contentType:"application/json",body:a,estimatedSize:new Blob([a]).size}}},vn=[];l&&vn.push({transport:"fetch",method:t=>{var i,e,{contentType:r,body:s,estimatedSize:n}=null!==(i=dn(t))&&void 0!==i?i:{},o=new Headers;Mt(t.headers,(function(t,i){o.append(i,t)})),r&&o.append("Content-Type",r);var a=t.url,u=null;if(h){var d=new h;u={signal:d.signal,timeout:setTimeout((()=>d.abort()),t.timeout)}}l(a,g({method:(null==t?void 0:t.method)||"GET",headers:o,keepalive:"POST"===t.method&&(n||0)<52428.8,body:s,signal:null==(e=u)?void 0:e.signal},t.fetchOptions)).then((i=>i.text().then((e=>{var r={statusCode:i.status,text:e};if(200===i.status)try{r.json=JSON.parse(e)}catch(t){Pt.error(t)}null==t.callback||t.callback(r)})))).catch((i=>{Pt.error(i),null==t.callback||t.callback({statusCode:0,text:i})})).finally((()=>u?clearTimeout(u.timeout):null))}}),u&&vn.push({transport:"XHR",method:t=>{var i,e=new u;e.open(t.method||"GET",t.url,!0);var{contentType:r,body:s}=null!==(i=dn(t))&&void 0!==i?i:{};Mt(t.headers,(function(t,i){e.setRequestHeader(i,t)})),r&&e.setRequestHeader("Content-Type",r),t.timeout&&(e.timeout=t.timeout),t.disableXHRCredentials||(e.withCredentials=!0),e.onreadystatechange=()=>{if(4===e.readyState){var i={statusCode:e.status,text:e.responseText};if(200===e.status)try{i.json=JSON.parse(e.responseText)}catch(t){}null==t.callback||t.callback(i)}},e.send(s)}}),null!=n&&n.sendBeacon&&vn.push({transport:"sendBeacon",method:t=>{var i=un(t.url,{beacon:"1"});try{var e,{contentType:r,body:s}=null!==(e=dn(t))&&void 0!==e?e:{},o="string"==typeof s?new Blob([s],{type:r}):s;n.sendBeacon(i,o)}catch(t){}}});var cn=function(t,i){if(!function(t){try{new RegExp(t)}catch(t){return!1}return!0}(i))return!1;try{return new RegExp(i).test(t)}catch(t){return!1}};function fn(t,i,e){return hn({distinct_id:t,userPropertiesToSet:i,userPropertiesToSetOnce:e})}var pn={exact:(t,i)=>i.some((i=>t.some((t=>i===t)))),is_not:(t,i)=>i.every((i=>t.every((t=>i!==t)))),regex:(t,i)=>i.some((i=>t.some((t=>cn(i,t))))),not_regex:(t,i)=>i.every((i=>t.every((t=>!cn(i,t))))),icontains:(t,i)=>i.map(gn).some((i=>t.map(gn).some((t=>i.includes(t))))),not_icontains:(t,i)=>i.map(gn).every((i=>t.map(gn).every((t=>!i.includes(t)))))},gn=t=>t.toLowerCase();function _n(t,i){return!t||Object.entries(t).every((t=>{var[e,r]=t,s=null==i?void 0:i[e];if(M(s)||D(s))return!1;var n=[String(s)],o=pn[r.operator];return!!o&&o(r.values,n)}))}var mn=Tt("[Error tracking]");class yn{constructor(t){var i,e;this.Jt=[],this.Kt=new it([new pt,new $t,new _t,new gt,new Et,new xt,new yt,new St],ft("web:javascript",lt,dt)),this._instance=t,this.Jt=null!==(i=null==(e=this._instance.persistence)?void 0:e.get_property(Xt))&&void 0!==i?i:[]}onRemoteConfig(t){var i,e,r,s=null!==(i=null==(e=t.errorTracking)?void 0:e.suppressionRules)&&void 0!==i?i:[],n=null==(r=t.errorTracking)?void 0:r.captureExtensionExceptions;this.Jt=s,this._instance.persistence&&this._instance.persistence.register({[Xt]:this.Jt,[Qt]:n})}get Yt(){var t,i=!!this._instance.get_property(Qt),e=this._instance.config.error_tracking.captureExtensionExceptions;return null!==(t=null!=e?e:i)&&void 0!==t&&t}buildProperties(t,i){return this.Kt.buildFromUnknown(t,{syntheticException:null==i?void 0:i.syntheticException,mechanism:{handled:null==i?void 0:i.handled}})}sendExceptionEvent(t){var i=t.$exception_list;if(this.Xt(i)){if(this.Qt(i))return void mn.info("Skipping exception capture because a suppression rule matched");if(!this.Yt&&this.Zt(i))return void mn.info("Skipping exception capture because it was thrown by an extension");if(!this._instance.config.error_tracking.__capturePostHogExceptions&&this.ti(i))return void mn.info("Skipping exception capture because it was thrown by the PostHog SDK")}return this._instance.capture("$exception",t,{_noTruncate:!0,_batchKey:"exceptionEvent"})}Qt(t){if(0===t.length)return!1;var i=t.reduce(((t,i)=>{var{type:e,value:r}=i;return O(e)&&e.length>0&&t.$exception_types.push(e),O(r)&&r.length>0&&t.$exception_values.push(r),t}),{$exception_types:[],$exception_values:[]});return this.Jt.some((t=>{var e=t.values.map((t=>{var e,r=pn[t.operator],s=C(t.value)?t.value:[t.value],n=null!==(e=i[t.key])&&void 0!==e?e:[];return s.length>0&&r(s,n)}));return"OR"===t.type?e.some(Boolean):e.every(Boolean)}))}Zt(t){return t.flatMap((t=>{var i,e;return null!==(i=null==(e=t.stacktrace)?void 0:e.frames)&&void 0!==i?i:[]})).some((t=>t.filename&&t.filename.startsWith("chrome-extension://")))}ti(t){if(t.length>0){var i,e,r,s,n=null!==(i=null==(e=t[0].stacktrace)?void 0:e.frames)&&void 0!==i?i:[],o=n[n.length-1];return null!==(r=null==o||null==(s=o.filename)?void 0:s.includes("posthog.com/static"))&&void 0!==r&&r}return!1}Xt(t){return!j(t)&&C(t)}}var bn=Tt("[FeatureFlags]"),wn=Tt("[FeatureFlags]",{debugEnabled:!0}),xn="$active_feature_flags",En="$override_feature_flags",Sn="$feature_flag_payloads",$n="$override_feature_flag_payloads",kn="$feature_flag_request_id",Pn="$feature_flag_evaluated_at",Tn=t=>{var i={};for(var[e,r]of Dt(t||{}))r&&(i[e]=r);return i},Cn=t=>{var i=t.flags;return i?(t.featureFlags=Object.fromEntries(Object.keys(i).map((t=>{var e;return[t,null!==(e=i[t].variant)&&void 0!==e?e:i[t].enabled]}))),t.featureFlagPayloads=Object.fromEntries(Object.keys(i).filter((t=>i[t].enabled)).filter((t=>{var e;return null==(e=i[t].metadata)?void 0:e.payload})).map((t=>{var e;return[t,null==(e=i[t].metadata)?void 0:e.payload]})))):bn.warn("Using an older version of the feature flags endpoint. Please upgrade your PostHog server to the latest version"),t},Rn=function(t){return t.FeatureFlags="feature_flags",t.Recordings="recordings",t}({});class In{constructor(t){this.ii=!1,this.ei=!1,this.ri=!1,this.si=!1,this.ni=!1,this.oi=!1,this.ai=!1,this._instance=t,this.featureFlagEventHandlers=[]}li(){var t=this._instance.config.evaluation_environments;return null!=t&&t.length?t.filter((t=>{var i=t&&"string"==typeof t&&t.trim().length>0;return i||bn.error("Invalid evaluation environment found:",t,"Expected non-empty string"),i})):[]}ui(){return this.li().length>0}flags(){if(this._instance.config.__preview_remote_config)this.oi=!0;else{var t=!this.hi&&(this._instance.config.advanced_disable_feature_flags||this._instance.config.advanced_disable_feature_flags_on_first_load);this.di({disableFlags:t})}}get hasLoadedFlags(){return this.ei}getFlags(){return Object.keys(this.getFlagVariants())}getFlagsWithDetails(){var t=this._instance.get_property(ai),i=this._instance.get_property(En),e=this._instance.get_property($n);if(!e&&!i)return t||{};var r=Ot({},t||{}),s=[...new Set([...Object.keys(e||{}),...Object.keys(i||{})])];for(var n of s){var o,a,l=r[n],u=null==i?void 0:i[n],h=M(u)?null!==(o=null==l?void 0:l.enabled)&&void 0!==o&&o:!!u,d=M(u)?l.variant:"string"==typeof u?u:void 0,v=null==e?void 0:e[n],c=g({},l,{enabled:h,variant:h?null!=d?d:null==l?void 0:l.variant:void 0});if(h!==(null==l?void 0:l.enabled)&&(c.original_enabled=null==l?void 0:l.enabled),d!==(null==l?void 0:l.variant)&&(c.original_variant=null==l?void 0:l.variant),v)c.metadata=g({},null==l?void 0:l.metadata,{payload:v,original_payload:null==l||null==(a=l.metadata)?void 0:a.payload});r[n]=c}return this.ii||(bn.warn(" Overriding feature flag details!",{flagDetails:t,overriddenPayloads:e,finalDetails:r}),this.ii=!0),r}getFlagVariants(){var t=this._instance.get_property(ni),i=this._instance.get_property(En);if(!i)return t||{};for(var e=Ot({},t),r=Object.keys(i),s=0;s<r.length;s++)e[r[s]]=i[r[s]];return this.ii||(bn.warn(" Overriding feature flags!",{enabledFlags:t,overriddenFlags:i,finalFlags:e}),this.ii=!0),e}getFlagPayloads(){var t=this._instance.get_property(Sn),i=this._instance.get_property($n);if(!i)return t||{};for(var e=Ot({},t||{}),r=Object.keys(i),s=0;s<r.length;s++)e[r[s]]=i[r[s]];return this.ii||(bn.warn(" Overriding feature flag payloads!",{flagPayloads:t,overriddenPayloads:i,finalPayloads:e}),this.ii=!0),e}reloadFeatureFlags(){this.si||this._instance.config.advanced_disable_feature_flags||this.hi||(this.hi=setTimeout((()=>{this.di()}),5))}vi(){clearTimeout(this.hi),this.hi=void 0}ensureFlagsLoaded(){this.ei||this.ri||this.hi||this.reloadFeatureFlags()}setAnonymousDistinctId(t){this.$anon_distinct_id=t}setReloadingPaused(t){this.si=t}di(t){var i;if(this.vi(),!this._instance.O())if(this.ri)this.ni=!0;else{var e=this._instance.config.token,r=this._instance.get_property("$device_id"),s={token:e,distinct_id:this._instance.get_distinct_id(),groups:this._instance.getGroups(),$anon_distinct_id:this.$anon_distinct_id,person_properties:g({},(null==(i=this._instance.persistence)?void 0:i.get_initial_props())||{},this._instance.get_property(li)||{}),group_properties:this._instance.get_property(ui)};D(r)||M(r)||(s.$device_id=r),(null!=t&&t.disableFlags||this._instance.config.advanced_disable_feature_flags)&&(s.disable_flags=!0),this.ui()&&(s.evaluation_environments=this.li());var n=this._instance.config.__preview_remote_config,o=n?"/flags/?v=2":"/flags/?v=2&config=true",a=this._instance.config.advanced_only_evaluate_survey_feature_flags?"&only_evaluate_survey_feature_flags=true":"",l=this._instance.requestRouter.endpointFor("flags",o+a);n&&(s.timezone=ps()),this.ri=!0,this._instance._send_request({method:"POST",url:l,data:s,compression:this._instance.config.disable_compression?void 0:oe.Base64,timeout:this._instance.config.feature_flag_request_timeout_ms,callback:t=>{var i,e,r=!0;(200===t.statusCode&&(this.ni||(this.$anon_distinct_id=void 0),r=!1),this.ri=!1,this.oi)||(this.oi=!0,this._instance.ci(null!==(e=t.json)&&void 0!==e?e:{}));if(!s.disable_flags||this.ni)if(this.ai=!r,t.json&&null!=(i=t.json.quotaLimited)&&i.includes(Rn.FeatureFlags))bn.warn("You have hit your feature flags quota limit, and will not be able to load feature flags until the quota is reset. Please visit https://posthog.com/docs/billing/limits-alerts to learn more.");else{var n;if(!s.disable_flags)this.receivedFeatureFlags(null!==(n=t.json)&&void 0!==n?n:{},r);this.ni&&(this.ni=!1,this.di())}}})}}getFeatureFlag(t,i){if(void 0===i&&(i={}),this.ei||this.getFlags()&&this.getFlags().length>0){var e=this.getFlagVariants()[t],r=""+e,s=this._instance.get_property(kn)||void 0,n=this._instance.get_property(Pn)||void 0,o=this._instance.get_property(vi)||{};if((i.send_event||!("send_event"in i))&&(!(t in o)||!o[t].includes(r))){var a,l,u,h,d,v,c,f,p;C(o[t])?o[t].push(r):o[t]=[r],null==(a=this._instance.persistence)||a.register({[vi]:o});var g=this.getFeatureFlagDetails(t),_={$feature_flag:t,$feature_flag_response:e,$feature_flag_payload:this.getFeatureFlagPayload(t)||null,$feature_flag_request_id:s,$feature_flag_evaluated_at:n,$feature_flag_bootstrapped_response:(null==(l=this._instance.config.bootstrap)||null==(l=l.featureFlags)?void 0:l[t])||null,$feature_flag_bootstrapped_payload:(null==(u=this._instance.config.bootstrap)||null==(u=u.featureFlagPayloads)?void 0:u[t])||null,$used_bootstrap_value:!this.ai};M(null==g||null==(h=g.metadata)?void 0:h.version)||(_.$feature_flag_version=g.metadata.version);var m,y=null!==(d=null==g||null==(v=g.reason)?void 0:v.description)&&void 0!==d?d:null==g||null==(c=g.reason)?void 0:c.code;if(y&&(_.$feature_flag_reason=y),null!=g&&null!=(f=g.metadata)&&f.id&&(_.$feature_flag_id=g.metadata.id),M(null==g?void 0:g.original_variant)&&M(null==g?void 0:g.original_enabled)||(_.$feature_flag_original_response=M(g.original_variant)?g.original_enabled:g.original_variant),null!=g&&null!=(p=g.metadata)&&p.original_payload)_.$feature_flag_original_payload=null==g||null==(m=g.metadata)?void 0:m.original_payload;this._instance.capture("$feature_flag_called",_)}return e}bn.warn('getFeatureFlag for key "'+t+"\" failed. Feature flags didn't load in time.")}getFeatureFlagDetails(t){return this.getFlagsWithDetails()[t]}getFeatureFlagPayload(t){return this.getFlagPayloads()[t]}getRemoteConfigPayload(t,i){var e=this._instance.config.token,r={distinct_id:this._instance.get_distinct_id(),token:e};this.ui()&&(r.evaluation_environments=this.li()),this._instance._send_request({method:"POST",url:this._instance.requestRouter.endpointFor("flags","/flags/?v=2&config=true"),data:r,compression:this._instance.config.disable_compression?void 0:oe.Base64,timeout:this._instance.config.feature_flag_request_timeout_ms,callback:e=>{var r,s=null==(r=e.json)?void 0:r.featureFlagPayloads;i((null==s?void 0:s[t])||void 0)}})}isFeatureEnabled(t,i){if(void 0===i&&(i={}),this.ei||this.getFlags()&&this.getFlags().length>0){var e=this.getFeatureFlag(t,i);return M(e)?void 0:!!e}bn.warn('isFeatureEnabled for key "'+t+"\" failed. Feature flags didn't load in time.")}addFeatureFlagsHandler(t){this.featureFlagEventHandlers.push(t)}removeFeatureFlagsHandler(t){this.featureFlagEventHandlers=this.featureFlagEventHandlers.filter((i=>i!==t))}receivedFeatureFlags(t,i){if(this._instance.persistence){this.ei=!0;var e=this.getFlagVariants(),r=this.getFlagPayloads(),s=this.getFlagsWithDetails();!function(t,i,e,r,s){void 0===e&&(e={}),void 0===r&&(r={}),void 0===s&&(s={});var n=Cn(t),o=n.flags,a=n.featureFlags,l=n.featureFlagPayloads;if(a){var u=t.requestId,h=t.evaluatedAt;if(C(a)){bn.warn("v1 of the feature flags endpoint is deprecated. Please use the latest version.");var d={};if(a)for(var v=0;v<a.length;v++)d[a[v]]=!0;i&&i.register({[xn]:a,[ni]:d})}else{var c=a,f=l,p=o;t.errorsWhileComputingFlags&&(c=g({},e,c),f=g({},r,f),p=g({},s,p)),i&&i.register(g({[xn]:Object.keys(Tn(c)),[ni]:c||{},[Sn]:f||{},[ai]:p||{}},u?{[kn]:u}:{},h?{[Pn]:h}:{}))}}}(t,this._instance.persistence,e,r,s),this.fi(i)}}override(t,i){void 0===i&&(i=!1),bn.warn("override is deprecated. Please use overrideFeatureFlags instead."),this.overrideFeatureFlags({flags:t,suppressWarning:i})}overrideFeatureFlags(t){if(!this._instance.__loaded||!this._instance.persistence)return bn.uninitializedWarning("posthog.featureFlags.overrideFeatureFlags");if(!1===t)return this._instance.persistence.unregister(En),this._instance.persistence.unregister($n),this.fi(),wn.info("All overrides cleared");if(t&&"object"==typeof t&&("flags"in t||"payloads"in t)){var i,e=t;if(this.ii=Boolean(null!==(i=e.suppressWarning)&&void 0!==i&&i),"flags"in e)if(!1===e.flags)this._instance.persistence.unregister(En),wn.info("Flag overrides cleared");else if(e.flags){if(C(e.flags)){for(var r={},s=0;s<e.flags.length;s++)r[e.flags[s]]=!0;this._instance.persistence.register({[En]:r})}else this._instance.persistence.register({[En]:e.flags});wn.info("Flag overrides set",{flags:e.flags})}return"payloads"in e&&(!1===e.payloads?(this._instance.persistence.unregister($n),wn.info("Payload overrides cleared")):e.payloads&&(this._instance.persistence.register({[$n]:e.payloads}),wn.info("Payload overrides set",{payloads:e.payloads}))),void this.fi()}this.fi()}onFeatureFlags(t){if(this.addFeatureFlagsHandler(t),this.ei){var{flags:i,flagVariants:e}=this.pi();t(i,e)}return()=>this.removeFeatureFlagsHandler(t)}updateEarlyAccessFeatureEnrollment(t,i,e){var r,s=(this._instance.get_property(oi)||[]).find((i=>i.flagKey===t)),n={["$feature_enrollment/"+t]:i},o={$feature_flag:t,$feature_enrollment:i,$set:n};s&&(o.$early_access_feature_name=s.name),e&&(o.$feature_enrollment_stage=e),this._instance.capture("$feature_enrollment_update",o),this.setPersonPropertiesForFlags(n,!1);var a=g({},this.getFlagVariants(),{[t]:i});null==(r=this._instance.persistence)||r.register({[xn]:Object.keys(Tn(a)),[ni]:a}),this.fi()}getEarlyAccessFeatures(t,i,e){void 0===i&&(i=!1);var r=this._instance.get_property(oi),s=e?"&"+e.map((t=>"stage="+t)).join("&"):"";if(r&&!i)return t(r);this._instance._send_request({url:this._instance.requestRouter.endpointFor("api","/api/early_access_features/?token="+this._instance.config.token+s),method:"GET",callback:i=>{var e,r;if(i.json){var s=i.json.earlyAccessFeatures;return null==(e=this._instance.persistence)||e.unregister(oi),null==(r=this._instance.persistence)||r.register({[oi]:s}),t(s)}}})}pi(){var t=this.getFlags(),i=this.getFlagVariants();return{flags:t.filter((t=>i[t])),flagVariants:Object.keys(i).filter((t=>i[t])).reduce(((t,e)=>(t[e]=i[e],t)),{})}}fi(t){var{flags:i,flagVariants:e}=this.pi();this.featureFlagEventHandlers.forEach((r=>r(i,e,{errorsLoading:t})))}setPersonPropertiesForFlags(t,i){void 0===i&&(i=!0);var e=this._instance.get_property(li)||{};this._instance.register({[li]:g({},e,t)}),i&&this._instance.reloadFeatureFlags()}resetPersonPropertiesForFlags(){this._instance.unregister(li)}setGroupPropertiesForFlags(t,i){void 0===i&&(i=!0);var e=this._instance.get_property(ui)||{};0!==Object.keys(e).length&&Object.keys(e).forEach((i=>{e[i]=g({},e[i],t[i]),delete t[i]})),this._instance.register({[ui]:g({},e,t)}),i&&this._instance.reloadFeatureFlags()}resetGroupPropertiesForFlags(t){if(t){var i=this._instance.get_property(ui)||{};this._instance.register({[ui]:g({},i,{[t]:{}})})}else this._instance.unregister(ui)}reset(){this.ei=!1,this.ri=!1,this.si=!1,this.ni=!1,this.oi=!1,this.ai=!1,this.$anon_distinct_id=void 0,this.vi(),this.ii=!1}}var Fn=["cookie","localstorage","localstorage+cookie","sessionstorage","memory"];class Mn{constructor(t,i){this.I=t,this.props={},this.gi=!1,this.mi=(t=>{var i="";return t.token&&(i=t.token.replace(/\+/g,"PL").replace(/\//g,"SL").replace(/=/g,"EQ")),t.persistence_name?"ph_"+t.persistence_name:"ph_"+i+"_posthog"})(t),this.Y=this.yi(t),this.load(),t.debug&&Pt.info("Persistence loaded",t.persistence,g({},this.props)),this.update_config(t,t,i),this.save()}isDisabled(){return!!this.bi}yi(t){-1===Fn.indexOf(t.persistence.toLowerCase())&&(Pt.critical("Unknown persistence type "+t.persistence+"; falling back to localStorage+cookie"),t.persistence="localStorage+cookie");var i=t.persistence.toLowerCase();return"localstorage"===i&&Fe.H()?Fe:"localstorage+cookie"===i&&Oe.H()?Oe:"sessionstorage"===i&&Le.H()?Le:"memory"===i?De:"cookie"===i?Re:Oe.H()?Oe:Re}properties(){var t={};return Mt(this.props,(function(i,e){if(e===ni&&I(i))for(var r=Object.keys(i),n=0;n<r.length;n++)t["$feature/"+r[n]]=i[r[n]];else a=e,l=!1,(D(o=xi)?l:s&&o.indexOf===s?-1!=o.indexOf(a):(Mt(o,(function(t){if(l||(l=t===a))return It})),l))||(t[e]=i);var o,a,l})),t}load(){if(!this.bi){var t=this.Y.W(this.mi);t&&(this.props=Ot({},t))}}save(){this.bi||this.Y.G(this.mi,this.props,this.wi,this.xi,this.Ei,this.I.debug)}remove(){this.Y.V(this.mi,!1),this.Y.V(this.mi,!0)}clear(){this.remove(),this.props={}}register_once(t,i,e){if(I(t)){M(i)&&(i="None"),this.wi=M(e)?this.Si:e;var r=!1;if(Mt(t,((t,e)=>{this.props.hasOwnProperty(e)&&this.props[e]!==i||(this.props[e]=t,r=!0)})),r)return this.save(),!0}return!1}register(t,i){if(I(t)){this.wi=M(i)?this.Si:i;var e=!1;if(Mt(t,((i,r)=>{t.hasOwnProperty(r)&&this.props[r]!==i&&(this.props[r]=i,e=!0)})),e)return this.save(),!0}return!1}unregister(t){t in this.props&&(delete this.props[t],this.save())}update_campaign_params(){if(!this.gi){var t=ls(this.I.custom_campaign_params,this.I.mask_personal_data_properties,this.I.custom_personal_data_properties);F(Nt(t))||this.register(t),this.gi=!0}}update_search_keyword(){var t;this.register((t=null==o?void 0:o.referrer)?hs(t):{})}update_referrer_info(){var t;this.register_once({$referrer:vs(),$referring_domain:null!=o&&o.referrer&&(null==(t=le(o.referrer))?void 0:t.host)||"$direct"},void 0)}set_initial_person_info(){this.props[gi]||this.props[_i]||this.register_once({[mi]:cs(this.I.mask_personal_data_properties,this.I.custom_personal_data_properties)},void 0)}get_initial_props(){var t={};Mt([_i,gi],(i=>{var e=this.props[i];e&&Mt(e,(function(i,e){t["$initial_"+E(e)]=i}))}));var i,e,r=this.props[mi];if(r){var s=(i=fs(r),e={},Mt(i,(function(t,i){e["$initial_"+E(i)]=t})),e);Ot(t,s)}return t}safe_merge(t){return Mt(this.props,(function(i,e){e in t||(t[e]=i)})),t}update_config(t,i,e){if(this.Si=this.wi=t.cookie_expiration,this.set_disabled(t.disable_persistence||!!e),this.set_cross_subdomain(t.cross_subdomain_cookie),this.set_secure(t.secure_cookie),t.persistence!==i.persistence){var r=this.yi(t),s=this.props;this.clear(),this.Y=r,this.props=s,this.save()}}set_disabled(t){this.bi=t,this.bi?this.remove():this.save()}set_cross_subdomain(t){t!==this.xi&&(this.xi=t,this.remove(),this.save())}set_secure(t){t!==this.Ei&&(this.Ei=t,this.remove(),this.save())}set_event_timer(t,i){var e=this.props[Vt]||{};e[t]=i,this.props[Vt]=e,this.save()}remove_event_timer(t){var i=(this.props[Vt]||{})[t];return M(i)||(delete this.props[Vt][t],this.save()),i}get_property(t){return this.props[t]}set_property(t,i){this.props[t]=i,this.save()}}var On=Tt("[Product Tours]"),An="ph_product_tours";class Dn{constructor(t){this.$i=null,this.ki=null,this.Pi=void 0,this.Ti=!1,this._instance=t}onRemoteConfig(t){if(this._instance.config.disable_product_tours)On.info("Product tours disabled via config");else{var i=t.productTours;j(i)?On.info("Product tours not enabled in remote config"):(this.Pi=i,On.info("Remote config received, isProductToursEnabled: "+this.Pi),this.loadIfEnabled())}}loadIfEnabled(){var t;if(!this.ki)if(this.Ti)On.info("Already initializing product tours, skipping...");else if(this._instance.config.disable_product_tours)On.info("Product tours disabled via config");else{var i=null==v?void 0:v.__PosthogExtensions__;if(i){var e=null==(t=this._instance.featureFlags)?void 0:t.isFeatureEnabled("product-tours-2025");if(!M(this.Pi)||e){var r=this.Pi||e;if(r){this.Ti=!0;try{var s=i.generateProductTours;if(s)return void this.Ci(s,r);var n=i.loadExternalDependency;if(!n)return On.error("PostHog loadExternalDependency extension not found."),void(this.Ti=!1);n(this._instance,"product-tours",(t=>{t||!i.generateProductTours?On.error("Could not load product tours script",t):this.Ci(i.generateProductTours,r),this.Ti=!1}))}catch(t){On.error("Error initializing product tours",t),this.Ti=!1}}else On.info("Product tours not enabled")}else On.info("Waiting for remote config or feature flag to enable product tours")}else On.error("PostHog Extensions not found.")}}Ci(t,i){this.ki=t(this._instance,i)||null,On.info("Product tours loaded successfully")}getProductTours(t,i){if(void 0===i&&(i=!1),!C(this.$i)||i){var e=this._instance.persistence;if(e){var r=e.props[An];if(C(r)&&!i)return this.$i=r,void t(r,{isLoaded:!0})}this._instance._send_request({url:this._instance.requestRouter.endpointFor("api","/api/product_tours/?token="+this._instance.config.token),method:"GET",callback:i=>{var r=i.statusCode;if(200!==r||!i.json){var s="Product Tours API could not be loaded, status: "+r;return On.error(s),void t([],{isLoaded:!1,error:s})}var n=C(i.json.product_tours)?i.json.product_tours:[];this.$i=n,e&&e.register({[An]:n}),t(n,{isLoaded:!0})}})}else t(this.$i,{isLoaded:!0})}getActiveProductTours(t){if(j(this.ki))return On.warn("Product tours not loaded yet"),void t([],{isLoaded:!1,error:"Product tours not loaded"});this.ki.getActiveProductTours(t)}showProductTour(t){var i;On.info("showProductTour("+t+")"),null==(i=this.ki)||i.showTourById(t)}dismissProductTour(){var t;null==(t=this.ki)||t.dismissTour("user_clicked_skip")}nextStep(){var t;null==(t=this.ki)||t.nextStep()}previousStep(){var t;null==(t=this.ki)||t.previousStep()}clearCache(){this.$i=null;var t=this._instance.persistence;t&&t.unregister(An)}resetTour(t){var i;null==(i=this.ki)||i.resetTour(t)}resetAllTours(){var t;null==(t=this.ki)||t.resetAllTours()}}var jn=function(t){return t.Activation="events",t.Cancellation="cancelEvents",t}({}),Ln=function(t){return t.Button="button",t.Tab="tab",t.Selector="selector",t}({}),Nn=function(t){return t.TopLeft="top_left",t.TopRight="top_right",t.TopCenter="top_center",t.MiddleLeft="middle_left",t.MiddleRight="middle_right",t.MiddleCenter="middle_center",t.Left="left",t.Center="center",t.Right="right",t.NextToTrigger="next_to_trigger",t}({}),Un=function(t){return t.Top="top",t.Left="left",t.Right="right",t.Bottom="bottom",t}({}),zn=function(t){return t.Popover="popover",t.API="api",t.Widget="widget",t.ExternalSurvey="external_survey",t}({}),Hn=function(t){return t.Open="open",t.MultipleChoice="multiple_choice",t.SingleChoice="single_choice",t.Rating="rating",t.Link="link",t}({}),Bn=function(t){return t.NextQuestion="next_question",t.End="end",t.ResponseBased="response_based",t.SpecificQuestion="specific_question",t}({}),qn=function(t){return t.Once="once",t.Recurring="recurring",t.Always="always",t}({}),Wn=function(t){return t.SHOWN="survey shown",t.DISMISSED="survey dismissed",t.SENT="survey sent",t}({}),Gn=function(t){return t.SURVEY_ID="$survey_id",t.SURVEY_NAME="$survey_name",t.SURVEY_RESPONSE="$survey_response",t.SURVEY_ITERATION="$survey_iteration",t.SURVEY_ITERATION_START_DATE="$survey_iteration_start_date",t.SURVEY_PARTIALLY_COMPLETED="$survey_partially_completed",t.SURVEY_SUBMISSION_ID="$survey_submission_id",t.SURVEY_QUESTIONS="$survey_questions",t.SURVEY_COMPLETED="$survey_completed",t}({}),Vn=function(t){return t.Popover="popover",t.Inline="inline",t}({});class Jn{constructor(){this.Ri={},this.Ri={}}on(t,i){return this.Ri[t]||(this.Ri[t]=[]),this.Ri[t].push(i),()=>{this.Ri[t]=this.Ri[t].filter((t=>t!==i))}}emit(t,i){for(var e of this.Ri[t]||[])e(i);for(var r of this.Ri["*"]||[])r(t,i)}}function Kn(t,i,e){if(j(t))return!1;switch(e){case"exact":return t===i;case"contains":var r=i.replace(/[.*+?^${}()|[\]\\]/g,"\\$&").replace(/_/g,".").replace(/%/g,".*");return new RegExp(r,"i").test(t);case"regex":try{return new RegExp(i).test(t)}catch(t){return!1}default:return!1}}class Yn{constructor(t){this.Ii=new Jn,this.Fi=(t,i)=>this.Mi(t,i)&&this.Oi(t,i)&&this.Ai(t,i)&&this.Di(t,i),this.Mi=(t,i)=>null==i||!i.event||(null==t?void 0:t.event)===(null==i?void 0:i.event),this._instance=t,this.ji=new Set,this.Li=new Set}init(){var t;if(!M(null==(t=this._instance)?void 0:t.Ni)){var i;null==(i=this._instance)||i.Ni(((t,i)=>{this.on(t,i)}))}}register(t){var i,e;if(!M(null==(i=this._instance)?void 0:i.Ni)&&(t.forEach((t=>{var i,e;null==(i=this.Li)||i.add(t),null==(e=t.steps)||e.forEach((t=>{var i;null==(i=this.ji)||i.add((null==t?void 0:t.event)||"")}))})),null!=(e=this._instance)&&e.autocapture)){var r,s=new Set;t.forEach((t=>{var i;null==(i=t.steps)||i.forEach((t=>{null!=t&&t.selector&&s.add(null==t?void 0:t.selector)}))})),null==(r=this._instance)||r.autocapture.setElementSelectors(s)}}on(t,i){var e;null!=i&&0!=t.length&&(this.ji.has(t)||this.ji.has(null==i?void 0:i.event))&&this.Li&&(null==(e=this.Li)?void 0:e.size)>0&&this.Li.forEach((t=>{this.Ui(i,t)&&this.Ii.emit("actionCaptured",t.name)}))}zi(t){this.onAction("actionCaptured",(i=>t(i)))}Ui(t,i){if(null==(null==i?void 0:i.steps))return!1;for(var e of i.steps)if(this.Fi(t,e))return!0;return!1}onAction(t,i){return this.Ii.on(t,i)}Oi(t,i){if(null!=i&&i.url){var e,r=null==t||null==(e=t.properties)?void 0:e.$current_url;if(!r||"string"!=typeof r)return!1;if(!Kn(r,i.url,i.url_matching||"contains"))return!1}return!0}Ai(t,i){return!!this.Hi(t,i)&&(!!this.Bi(t,i)&&!!this.qi(t,i))}Hi(t,i){var e;if(null==i||!i.href)return!0;var r=this.Wi(t);if(r.length>0)return r.some((t=>Kn(t.href,i.href,i.href_matching||"exact")));var s,n=(null==t||null==(e=t.properties)?void 0:e.$elements_chain)||"";return!!n&&Kn((s=n.match(/(?::|")href="(.*?)"/))?s[1]:"",i.href,i.href_matching||"exact")}Bi(t,i){var e;if(null==i||!i.text)return!0;var r=this.Wi(t);if(r.length>0)return r.some((t=>Kn(t.text,i.text,i.text_matching||"exact")||Kn(t.$el_text,i.text,i.text_matching||"exact")));var s,n,o,a=(null==t||null==(e=t.properties)?void 0:e.$elements_chain)||"";return!!a&&(s=function(t){for(var i,e=[],r=/(?::|")text="(.*?)"/g;!j(i=r.exec(t));)e.includes(i[1])||e.push(i[1]);return e}(a),n=i.text,o=i.text_matching||"exact",s.some((t=>Kn(t,n,o))))}qi(t,i){var e,r;if(null==i||!i.selector)return!0;var s=null==t||null==(e=t.properties)?void 0:e.$element_selectors;if(null!=s&&s.includes(i.selector))return!0;var n=(null==t||null==(r=t.properties)?void 0:r.$elements_chain)||"";if(i.selector_regex&&n)try{return new RegExp(i.selector_regex).test(n)}catch(t){return!1}return!1}Wi(t){var i;return null==(null==t||null==(i=t.properties)?void 0:i.$elements)?[]:null==t?void 0:t.properties.$elements}Di(t,i){return null==i||!i.properties||0===i.properties.length||_n(i.properties.reduce(((t,i)=>{var e=C(i.value)?i.value.map(String):null!=i.value?[String(i.value)]:[];return t[i.key]={values:e,operator:i.operator||"exact"},t}),{}),null==t?void 0:t.properties)}}var Xn=Tt("[Surveys]");var Qn="seenSurvey_",Zn=(t,i)=>{var e="$survey_"+i+"/"+t.id;return t.current_iteration&&t.current_iteration>0&&(e="$survey_"+i+"/"+t.id+"/"+t.current_iteration),e},to=t=>{var i=""+Qn+t.id;return t.current_iteration&&t.current_iteration>0&&(i=""+Qn+t.id+"_"+t.current_iteration),i},io=[zn.Popover,zn.Widget,zn.API],eo={ignoreConditions:!1,ignoreDelay:!1,displayType:Vn.Popover};class ro{constructor(t){this._instance=t,this.Gi=new Map,this.Vi=new Map,this.Ji=new Map}Ki(t,i){return!!t&&_n(t.propertyFilters,null==i?void 0:i.properties)}Yi(t,i){var e=new Map;return t.forEach((t=>{var r;null==(r=t.conditions)||null==(r=r[i])||null==(r=r.values)||r.forEach((i=>{if(null!=i&&i.name){var r=e.get(i.name)||[];r.push(t.id),e.set(i.name,r)}}))})),e}Xi(t,i,e){var r,s=(e===jn.Activation?this.Gi:this.Vi).get(t),n=[];return null==(r=this._instance)||r.getSurveys((t=>{n=t.filter((t=>null==s?void 0:s.includes(t.id)))})),n.filter((r=>{var s,n=null==(s=r.conditions)||null==(s=s[e])||null==(s=s.values)?void 0:s.find((i=>i.name===t));return this.Ki(n,i)}))}register(t){var i;M(null==(i=this._instance)?void 0:i.Ni)||(this.Qi(t),this.Zi(t))}Zi(t){var i=t.filter((t=>{var i,e;return(null==(i=t.conditions)?void 0:i.actions)&&(null==(e=t.conditions)||null==(e=e.actions)||null==(e=e.values)?void 0:e.length)>0}));if(0!==i.length){if(null==this.te){this.te=new Yn(this._instance),this.te.init();this.te.zi((t=>{this.onAction(t)}))}i.forEach((t=>{var i,e,r,s,n;t.conditions&&null!=(i=t.conditions)&&i.actions&&null!=(e=t.conditions)&&null!=(e=e.actions)&&e.values&&(null==(r=t.conditions)||null==(r=r.actions)||null==(r=r.values)?void 0:r.length)>0&&(null==(s=this.te)||s.register(t.conditions.actions.values),null==(n=t.conditions)||null==(n=n.actions)||null==(n=n.values)||n.forEach((i=>{if(i&&i.name){var e=this.Ji.get(i.name);e&&e.push(t.id),this.Ji.set(i.name,e||[t.id])}})))}))}}Qi(t){var i,e=t.filter((t=>{var i,e;return(null==(i=t.conditions)?void 0:i.events)&&(null==(e=t.conditions)||null==(e=e.events)||null==(e=e.values)?void 0:e.length)>0})),r=t.filter((t=>{var i,e;return(null==(i=t.conditions)?void 0:i.cancelEvents)&&(null==(e=t.conditions)||null==(e=e.cancelEvents)||null==(e=e.values)?void 0:e.length)>0}));if(0!==e.length||0!==r.length){null==(i=this._instance)||i.Ni(((t,i)=>{this.onEvent(t,i)})),this.Gi=this.Yi(t,jn.Activation),this.Vi=this.Yi(t,jn.Cancellation)}}onEvent(t,i){var e,r=(null==(e=this._instance)||null==(e=e.persistence)?void 0:e.props[di])||[];if(Wn.SHOWN===t&&i&&r.length>0){var s;Xn.info("survey event matched, removing survey from activated surveys",{event:t,eventPayload:i,existingActivatedSurveys:r});var n=null==i||null==(s=i.properties)?void 0:s.$survey_id;if(n){var o=r.indexOf(n);o>=0&&(r.splice(o,1),this.ie(r))}}else{if(this.Vi.has(t)){var a=this.Xi(t,i,jn.Cancellation);a.length>0&&(Xn.info("cancel event matched, cancelling surveys",{event:t,surveysToCancel:a.map((t=>t.id))}),a.forEach((t=>{var i,e=r.indexOf(t.id);e>=0&&r.splice(e,1),null==(i=this._instance)||i.cancelPendingSurvey(t.id)})),this.ie(r))}if(this.Gi.has(t)){Xn.info("survey event name matched",{event:t,eventPayload:i,surveys:this.Gi.get(t)});var l=this.Xi(t,i,jn.Activation);this.ie(r.concat(l.map((t=>t.id))||[]))}}}onAction(t){var i,e=(null==(i=this._instance)||null==(i=i.persistence)?void 0:i.props[di])||[];this.Ji.has(t)&&this.ie(e.concat(this.Ji.get(t)||[]))}ie(t){var i;Xn.info("updating activated surveys",{activatedSurveys:t}),null==(i=this._instance)||null==(i=i.persistence)||i.register({[di]:[...new Set(t)]})}getSurveys(){var t,i=null==(t=this._instance)||null==(t=t.persistence)?void 0:t.props[di];return i||[]}getEventToSurveys(){return this.Gi}ee(){return this.te}}class so{constructor(t){this.re=void 0,this._surveyManager=null,this.se=!1,this.ne=!1,this.oe=[],this._instance=t,this._surveyEventReceiver=null}onRemoteConfig(t){if(!this._instance.config.disable_surveys){var i=t.surveys;if(j(i))return Xn.warn("Flags not loaded yet. Not loading surveys.");var e=C(i);this.re=e?i.length>0:i,Xn.info("flags response received, isSurveysEnabled: "+this.re),this.loadIfEnabled()}}reset(){localStorage.removeItem("lastSeenSurveyDate");for(var t=[],i=0;i<localStorage.length;i++){var e=localStorage.key(i);(null!=e&&e.startsWith(Qn)||null!=e&&e.startsWith("inProgressSurvey_"))&&t.push(e)}t.forEach((t=>localStorage.removeItem(t)))}loadIfEnabled(){if(!this._surveyManager)if(this.ne)Xn.info("Already initializing surveys, skipping...");else if(this._instance.config.disable_surveys)Xn.info("Disabled. Not loading surveys.");else if(this._instance.config.cookieless_mode&&this._instance.consent.isOptedOut())Xn.info("Not loading surveys in cookieless mode without consent.");else{var t=null==v?void 0:v.__PosthogExtensions__;if(t){if(!M(this.re)||this._instance.config.advanced_enable_surveys){var i=this.re||this._instance.config.advanced_enable_surveys;this.ne=!0;try{var e=t.generateSurveys;if(e)return void this.ae(e,i);var r=t.loadExternalDependency;if(!r)return void this.le("PostHog loadExternalDependency extension not found.");r(this._instance,"surveys",(e=>{e||!t.generateSurveys?this.le("Could not load surveys script",e):this.ae(t.generateSurveys,i)}))}catch(t){throw this.le("Error initializing surveys",t),t}finally{this.ne=!1}}}else Xn.error("PostHog Extensions not found.")}}ae(t,i){this._surveyManager=t(this._instance,i),this._surveyEventReceiver=new ro(this._instance),Xn.info("Surveys loaded successfully"),this.ue({isLoaded:!0})}le(t,i){Xn.error(t,i),this.ue({isLoaded:!1,error:t})}onSurveysLoaded(t){return this.oe.push(t),this._surveyManager&&this.ue({isLoaded:!0}),()=>{this.oe=this.oe.filter((i=>i!==t))}}getSurveys(t,i){if(void 0===i&&(i=!1),this._instance.config.disable_surveys)return Xn.info("Disabled. Not loading surveys."),t([]);var e=this._instance.get_property(hi);if(e&&!i)return t(e,{isLoaded:!0});if(this.se)return t([],{isLoaded:!1,error:"Surveys are already being loaded"});try{this.se=!0,this._instance._send_request({url:this._instance.requestRouter.endpointFor("api","/api/surveys/?token="+this._instance.config.token),method:"GET",timeout:this._instance.config.surveys_request_timeout_ms,callback:i=>{var e;this.se=!1;var r=i.statusCode;if(200!==r||!i.json){var s="Surveys API could not be loaded, status: "+r;return Xn.error(s),t([],{isLoaded:!1,error:s})}var n,o=i.json.surveys||[],a=o.filter((t=>function(t){return!(!t.start_date||t.end_date)}(t)&&(function(t){var i;return!(null==(i=t.conditions)||null==(i=i.events)||null==(i=i.values)||!i.length)}(t)||function(t){var i;return!(null==(i=t.conditions)||null==(i=i.actions)||null==(i=i.values)||!i.length)}(t))));a.length>0&&(null==(n=this._surveyEventReceiver)||n.register(a));return null==(e=this._instance.persistence)||e.register({[hi]:o}),t(o,{isLoaded:!0})}})}catch(t){throw this.se=!1,t}}ue(t){for(var i of this.oe)try{if(!t.isLoaded)return i([],t);this.getSurveys(i)}catch(t){Xn.error("Error in survey callback",t)}}getActiveMatchingSurveys(t,i){if(void 0===i&&(i=!1),!j(this._surveyManager))return this._surveyManager.getActiveMatchingSurveys(t,i);Xn.warn("init was not called")}he(t){var i=null;return this.getSurveys((e=>{var r;i=null!==(r=e.find((i=>i.id===t)))&&void 0!==r?r:null})),i}de(t){if(j(this._surveyManager))return{eligible:!1,reason:"SDK is not enabled or survey functionality is not yet loaded"};var i="string"==typeof t?this.he(t):t;return i?this._surveyManager.checkSurveyEligibility(i):{eligible:!1,reason:"Survey not found"}}canRenderSurvey(t){if(j(this._surveyManager))return Xn.warn("init was not called"),{visible:!1,disabledReason:"SDK is not enabled or survey functionality is not yet loaded"};var i=this.de(t);return{visible:i.eligible,disabledReason:i.reason}}canRenderSurveyAsync(t,i){return j(this._surveyManager)?(Xn.warn("init was not called"),Promise.resolve({visible:!1,disabledReason:"SDK is not enabled or survey functionality is not yet loaded"})):new Promise((e=>{this.getSurveys((i=>{var r,s=null!==(r=i.find((i=>i.id===t)))&&void 0!==r?r:null;if(s){var n=this.de(s);e({visible:n.eligible,disabledReason:n.reason})}else e({visible:!1,disabledReason:"Survey not found"})}),i)}))}renderSurvey(t,i){var e;if(j(this._surveyManager))Xn.warn("init was not called");else{var r="string"==typeof t?this.he(t):t;if(null!=r&&r.id)if(io.includes(r.type)){var s=null==o?void 0:o.querySelector(i);if(s)return null!=(e=r.appearance)&&e.surveyPopupDelaySeconds?(Xn.info("Rendering survey "+r.id+" with delay of "+r.appearance.surveyPopupDelaySeconds+" seconds"),void setTimeout((()=>{var t,i;Xn.info("Rendering survey "+r.id+" with delay of "+(null==(t=r.appearance)?void 0:t.surveyPopupDelaySeconds)+" seconds"),null==(i=this._surveyManager)||i.renderSurvey(r,s),Xn.info("Survey "+r.id+" rendered")}),1e3*r.appearance.surveyPopupDelaySeconds)):void this._surveyManager.renderSurvey(r,s);Xn.warn("Survey element not found")}else Xn.warn("Surveys of type "+r.type+" cannot be rendered in the app");else Xn.warn("Survey not found")}}displaySurvey(t,i){var e;if(j(this._surveyManager))Xn.warn("init was not called");else{var r=this.he(t);if(r){var s=r;if(null!=(e=r.appearance)&&e.surveyPopupDelaySeconds&&i.ignoreDelay&&(s=g({},r,{appearance:g({},r.appearance,{surveyPopupDelaySeconds:0})})),!1===i.ignoreConditions){var n=this.canRenderSurvey(r);if(!n.visible)return void Xn.warn("Survey is not eligible to be displayed: ",n.disabledReason)}i.displayType!==Vn.Inline?this._surveyManager.handlePopoverSurvey(s):this.renderSurvey(s,i.selector)}else Xn.warn("Survey not found")}}cancelPendingSurvey(t){j(this._surveyManager)?Xn.warn("init was not called"):this._surveyManager.cancelSurvey(t)}}var no=Tt("[Conversations]");class oo{constructor(t){this.ve=void 0,this._conversationsManager=null,this.Ti=!1,this.ce=null,this._instance=t}onRemoteConfig(t){if(!this._instance.config.disable_conversations){var i=t.conversations;j(i)||(N(i)?this.ve=i:(this.ve=i.enabled,this.ce=i),this.loadIfEnabled())}}reset(){var t;null==(t=this._conversationsManager)||t.reset(),this._conversationsManager=null,this.ve=void 0,this.ce=null}loadIfEnabled(){if(!this._conversationsManager&&!this.Ti&&!(this._instance.config.disable_conversations||this._instance.config.cookieless_mode&&this._instance.consent.isOptedOut())){var i=null==v?void 0:v.__PosthogExtensions__;if(i&&!M(this.ve)&&this.ve)if(this.ce&&this.ce.token){if(function(i){var e;if(!i||0===i.length)return!0;var r=null==t||null==(e=t.location)?void 0:e.hostname;return!r||i.some((t=>{var i=function(t){var i=t.replace(/^https?:\/\//,"");return(i=i.split("/")[0].split("?")[0].split(":")[0])||null}(t);if(!i)return!1;if(i.startsWith("*.")){var e=i.slice(2);return r.endsWith("."+e)||r===e}return r===i}))}(this.ce.domains)){this.Ti=!0;try{var e=i.initConversations;if(e)return this.Ci(e),void(this.Ti=!1);var r=i.loadExternalDependency;if(!r)return void this.fe("PostHog loadExternalDependency extension not found.");r(this._instance,"conversations",(t=>{t||!i.initConversations?this.fe("Could not load conversations script",t):this.Ci(i.initConversations),this.Ti=!1}))}catch(t){this.fe("Error initializing conversations",t),this.Ti=!1}}}else no.error("Conversations enabled but missing token in remote config.")}}Ci(t){if(this.ce)try{this._conversationsManager=t(this.ce,this._instance),no.info("Conversations loaded successfully")}catch(t){this.fe("Error completing conversations initialization",t)}else no.error("Cannot complete initialization: remote config is null")}fe(t,i){no.error(t,i),this._conversationsManager=null,this.Ti=!1}enable(){this._conversationsManager?this._conversationsManager.enable():no.warn("Conversations not loaded yet.")}disable(){this._conversationsManager&&this._conversationsManager.disable()}isLoaded(){return!D(this._conversationsManager)}isEnabled(){return!0===this.ve}}var ao=Tt("[RateLimiter]");class lo{constructor(t){var i,e;this.serverLimits={},this.lastEventRateLimited=!1,this.checkForLimiting=t=>{var i=t.text;if(i&&i.length)try{(JSON.parse(i).quota_limited||[]).forEach((t=>{ao.info((t||"events")+" is quota limited."),this.serverLimits[t]=(new Date).getTime()+6e4}))}catch(t){return void ao.warn('could not rate limit - continuing. Error: "'+(null==t?void 0:t.message)+'"',{text:i})}},this.instance=t,this.captureEventsPerSecond=(null==(i=t.config.rate_limiting)?void 0:i.events_per_second)||10,this.captureEventsBurstLimit=Math.max((null==(e=t.config.rate_limiting)?void 0:e.events_burst_limit)||10*this.captureEventsPerSecond,this.captureEventsPerSecond),this.lastEventRateLimited=this.clientRateLimitContext(!0).isRateLimited}clientRateLimitContext(t){var i,e,r;void 0===t&&(t=!1);var s=(new Date).getTime(),n=null!==(i=null==(e=this.instance.persistence)?void 0:e.get_property(pi))&&void 0!==i?i:{tokens:this.captureEventsBurstLimit,last:s};n.tokens+=(s-n.last)/1e3*this.captureEventsPerSecond,n.last=s,n.tokens>this.captureEventsBurstLimit&&(n.tokens=this.captureEventsBurstLimit);var o=n.tokens<1;return o||t||(n.tokens=Math.max(0,n.tokens-1)),!o||this.lastEventRateLimited||t||this.instance.capture("$$client_ingestion_warning",{$$client_ingestion_warning_message:"posthog-js client rate limited. Config is set to "+this.captureEventsPerSecond+" events per second and "+this.captureEventsBurstLimit+" events burst limit."},{skip_client_rate_limiting:!0}),this.lastEventRateLimited=o,null==(r=this.instance.persistence)||r.set_property(pi,n),{isRateLimited:o,remainingTokens:n.tokens}}isServerRateLimited(t){var i=this.serverLimits[t||"events"]||!1;return!1!==i&&(new Date).getTime()<i}}var uo=Tt("[RemoteConfig]");class ho{constructor(t){this._instance=t}get remoteConfig(){var t;return null==(t=v._POSTHOG_REMOTE_CONFIG)||null==(t=t[this._instance.config.token])?void 0:t.config}pe(t){var i,e;null!=(i=v.__PosthogExtensions__)&&i.loadExternalDependency?null==(e=v.__PosthogExtensions__)||null==e.loadExternalDependency||e.loadExternalDependency(this._instance,"remote-config",(()=>t(this.remoteConfig))):(uo.error("PostHog Extensions not found. Cannot load remote config."),t())}ge(t){this._instance._send_request({method:"GET",url:this._instance.requestRouter.endpointFor("assets","/array/"+this._instance.config.token+"/config"),callback:i=>{t(i.json)}})}load(){try{if(this.remoteConfig)return uo.info("Using preloaded remote config",this.remoteConfig),void this.ci(this.remoteConfig);if(this._instance.O())return void uo.warn("Remote config is disabled. Falling back to local config.");this.pe((t=>{if(!t)return uo.info("No config found after loading remote JS config. Falling back to JSON."),void this.ge((t=>{this.ci(t)}));this.ci(t)}))}catch(t){uo.error("Error loading remote config",t)}}ci(t){t?this._instance.config.__preview_remote_config?(this._instance.ci(t),!1!==t.hasFeatureFlags&&this._instance.featureFlags.ensureFlagsLoaded()):uo.info("__preview_remote_config is disabled. Logging config instead",t):uo.error("Failed to fetch remote config from PostHog.")}}var vo=3e3;class co{constructor(t,i){this._e=!0,this.me=[],this.ye=J((null==i?void 0:i.flush_interval_ms)||vo,250,5e3,Pt.createLogger("flush interval"),vo),this.be=t}enqueue(t){this.me.push(t),this.we||this.xe()}unload(){this.Ee();var t=this.me.length>0?this.Se():{},i=Object.values(t);[...i.filter((t=>0===t.url.indexOf("/e"))),...i.filter((t=>0!==t.url.indexOf("/e")))].map((t=>{this.be(g({},t,{transport:"sendBeacon"}))}))}enable(){this._e=!1,this.xe()}xe(){var t=this;this._e||(this.we=setTimeout((()=>{if(this.Ee(),this.me.length>0){var i=this.Se(),e=function(){var e=i[r],s=(new Date).getTime();e.data&&C(e.data)&&Mt(e.data,(t=>{t.offset=Math.abs(t.timestamp-s),delete t.timestamp})),t.be(e)};for(var r in i)e()}}),this.ye))}Ee(){clearTimeout(this.we),this.we=void 0}Se(){var t={};return Mt(this.me,(i=>{var e,r=i,s=(r?r.batchKey:null)||r.url;M(t[s])&&(t[s]=g({},r,{data:[]})),null==(e=t[s].data)||e.push(r.data)})),this.me=[],t}}var fo=["retriesPerformedSoFar"];class po{constructor(i){this.$e=!1,this.ke=3e3,this.me=[],this._instance=i,this.me=[],this.Pe=!0,!M(t)&&"onLine"in t.navigator&&(this.Pe=t.navigator.onLine,this.Te=()=>{this.Pe=!0,this.Dt()},this.Ce=()=>{this.Pe=!1},qt(t,"online",this.Te),qt(t,"offline",this.Ce))}get length(){return this.me.length}retriableRequest(t){var{retriesPerformedSoFar:i}=t,e=_(t,fo);L(i)&&i>0&&(e.url=un(e.url,{retry_count:i})),this._instance._send_request(g({},e,{callback:t=>{200!==t.statusCode&&(t.statusCode<400||t.statusCode>=500)&&(null!=i?i:0)<10?this.Re(g({retriesPerformedSoFar:i},e)):null==e.callback||e.callback(t)}}))}Re(t){var i=t.retriesPerformedSoFar||0;t.retriesPerformedSoFar=i+1;var e=function(t){var i=3e3*Math.pow(2,t),e=i/2,r=Math.min(18e5,i),s=(Math.random()-.5)*(r-e);return Math.ceil(r+s)}(i),r=Date.now()+e;this.me.push({retryAt:r,requestOptions:t});var s="Enqueued failed request for retry in "+e;navigator.onLine||(s+=" (Browser is offline)"),Pt.warn(s),this.$e||(this.$e=!0,this.Ie())}Ie(){if(this.Fe&&clearTimeout(this.Fe),0===this.me.length)return this.$e=!1,void(this.Fe=void 0);this.Fe=setTimeout((()=>{this.Pe&&this.me.length>0&&this.Dt(),this.Ie()}),this.ke)}Dt(){var t=Date.now(),i=[],e=this.me.filter((e=>e.retryAt<t||(i.push(e),!1)));if(this.me=i,e.length>0)for(var{requestOptions:r}of e)this.retriableRequest(r)}unload(){for(var{requestOptions:i}of(this.Fe&&(clearTimeout(this.Fe),this.Fe=void 0),this.$e=!1,M(t)||(this.Te&&(t.removeEventListener("online",this.Te),this.Te=void 0),this.Ce&&(t.removeEventListener("offline",this.Ce),this.Ce=void 0)),this.me))try{this._instance._send_request(g({},i,{transport:"sendBeacon"}))}catch(t){Pt.error(t)}this.me=[]}}class go{constructor(t){this.Me=()=>{var t,i,e,r;this.Oe||(this.Oe={});var s=this.scrollElement(),n=this.scrollY(),o=s?Math.max(0,s.scrollHeight-s.clientHeight):0,a=n+((null==s?void 0:s.clientHeight)||0),l=(null==s?void 0:s.scrollHeight)||0;this.Oe.lastScrollY=Math.ceil(n),this.Oe.maxScrollY=Math.max(n,null!==(t=this.Oe.maxScrollY)&&void 0!==t?t:0),this.Oe.maxScrollHeight=Math.max(o,null!==(i=this.Oe.maxScrollHeight)&&void 0!==i?i:0),this.Oe.lastContentY=a,this.Oe.maxContentY=Math.max(a,null!==(e=this.Oe.maxContentY)&&void 0!==e?e:0),this.Oe.maxContentHeight=Math.max(l,null!==(r=this.Oe.maxContentHeight)&&void 0!==r?r:0)},this._instance=t}getContext(){return this.Oe}resetContext(){var t=this.Oe;return setTimeout(this.Me,0),t}startMeasuringScrollPosition(){qt(t,"scroll",this.Me,{capture:!0}),qt(t,"scrollend",this.Me,{capture:!0}),qt(t,"resize",this.Me)}scrollElement(){if(!this._instance.config.scroll_root_selector)return null==t?void 0:t.document.documentElement;var i=C(this._instance.config.scroll_root_selector)?this._instance.config.scroll_root_selector:[this._instance.config.scroll_root_selector];for(var e of i){var r=null==t?void 0:t.document.querySelector(e);if(r)return r}}scrollY(){if(this._instance.config.scroll_root_selector){var i=this.scrollElement();return i&&i.scrollTop||0}return t&&(t.scrollY||t.pageYOffset||t.document.documentElement.scrollTop)||0}scrollX(){if(this._instance.config.scroll_root_selector){var i=this.scrollElement();return i&&i.scrollLeft||0}return t&&(t.scrollX||t.pageXOffset||t.document.documentElement.scrollLeft)||0}}var _o=t=>cs(null==t?void 0:t.config.mask_personal_data_properties,null==t?void 0:t.config.custom_personal_data_properties);class mo{constructor(t,i,e,r){this.Ae=t=>{var i=this.De();if(!i||i.sessionId!==t){var e={sessionId:t,props:this.je(this._instance)};this.Le.register({[fi]:e})}},this._instance=t,this.Ne=i,this.Le=e,this.je=r||_o,this.Ne.onSessionId(this.Ae)}De(){return this.Le.props[fi]}getSetOnceProps(){var t,i=null==(t=this.De())?void 0:t.props;return i?"r"in i?fs(i):{$referring_domain:i.referringDomain,$pathname:i.initialPathName,utm_source:i.utm_source,utm_campaign:i.utm_campaign,utm_medium:i.utm_medium,utm_content:i.utm_content,utm_term:i.utm_term}:{}}getSessionProps(){var t={};return Mt(Nt(this.getSetOnceProps()),((i,e)=>{"$current_url"===e&&(e="url"),t["$session_entry_"+E(e)]=i})),t}}var yo=Tt("[SessionId]");class bo{on(t,i){return this.Ue.on(t,i)}constructor(t,i,e){var r;if(this.ze=[],this.He=void 0,this.Ue=new Jn,this.Be=(t,i)=>Math.abs(t-i)>this.sessionTimeoutMs,!t.persistence)throw new Error("SessionIdManager requires a PostHogPersistence instance");if("always"===t.config.cookieless_mode)throw new Error('SessionIdManager cannot be used with cookieless_mode="always"');this.I=t.config,this.Le=t.persistence,this.qe=void 0,this.We=void 0,this._sessionStartTimestamp=null,this._sessionActivityTimestamp=null,this.Ge=i||$e,this.Ve=e||$e;var s=this.I.persistence_name||this.I.token,n=this.I.session_idle_timeout_seconds||1800;if(this._sessionTimeoutMs=1e3*J(n,60,36e3,yo.createLogger("session_idle_timeout_seconds"),1800),t.register({$configured_session_timeout_ms:this._sessionTimeoutMs}),this.Je(),this.Ke="ph_"+s+"_window_id",this.Ye="ph_"+s+"_primary_window_exists",this.Xe()){var o=Le.W(this.Ke),a=Le.W(this.Ye);o&&!a?this.qe=o:Le.V(this.Ke),Le.G(this.Ye,!0)}if(null!=(r=this.I.bootstrap)&&r.sessionID)try{var l=(t=>{var i=t.replace(/-/g,"");if(32!==i.length)throw new Error("Not a valid UUID");if("7"!==i[12])throw new Error("Not a UUIDv7");return parseInt(i.substring(0,12),16)})(this.I.bootstrap.sessionID);this.Qe(this.I.bootstrap.sessionID,(new Date).getTime(),l)}catch(t){yo.error("Invalid sessionID in bootstrap",t)}this.Ze()}get sessionTimeoutMs(){return this._sessionTimeoutMs}onSessionId(t){return M(this.ze)&&(this.ze=[]),this.ze.push(t),this.We&&t(this.We,this.qe),()=>{this.ze=this.ze.filter((i=>i!==t))}}Xe(){return"memory"!==this.I.persistence&&!this.Le.bi&&Le.H()}tr(t){t!==this.qe&&(this.qe=t,this.Xe()&&Le.G(this.Ke,t))}ir(){return this.qe?this.qe:this.Xe()?Le.W(this.Ke):null}Qe(t,i,e){t===this.We&&i===this._sessionActivityTimestamp&&e===this._sessionStartTimestamp||(this._sessionStartTimestamp=e,this._sessionActivityTimestamp=i,this.We=t,this.Le.register({[ri]:[i,t,e]}))}er(){var t=this.Le.props[ri];return C(t)&&2===t.length&&t.push(t[0]),t||[0,null,0]}resetSessionId(){this.Qe(null,null,null)}destroy(){clearTimeout(this.rr),this.rr=void 0,this.He&&t&&(t.removeEventListener("beforeunload",this.He,{capture:!1}),this.He=void 0),this.ze=[]}Ze(){this.He=()=>{this.Xe()&&Le.V(this.Ye)},qt(t,"beforeunload",this.He,{capture:!1})}checkAndGetSessionAndWindowId(t,i){if(void 0===t&&(t=!1),void 0===i&&(i=null),"always"===this.I.cookieless_mode)throw new Error('checkAndGetSessionAndWindowId should not be called with cookieless_mode="always"');var e=i||(new Date).getTime(),[r,s,n]=this.er(),o=this.ir(),a=L(n)&&n>0&&Math.abs(e-n)>864e5,l=!1,u=!s,h=!u&&!t&&this.Be(e,r);u||h||a?(s=this.Ge(),o=this.Ve(),yo.info("new session ID generated",{sessionId:s,windowId:o,changeReason:{noSessionId:u,activityTimeout:h,sessionPastMaximumLength:a}}),n=e,l=!0):o||(o=this.Ve(),l=!0);var d=0===r||!t||a?e:r,v=0===n?(new Date).getTime():n;return this.tr(o),this.Qe(s,d,v),t||this.Je(),l&&this.ze.forEach((t=>t(s,o,l?{noSessionId:u,activityTimeout:h,sessionPastMaximumLength:a}:void 0))),{sessionId:s,windowId:o,sessionStartTimestamp:v,changeReason:l?{noSessionId:u,activityTimeout:h,sessionPastMaximumLength:a}:void 0,lastActivityTimestamp:r}}Je(){clearTimeout(this.rr),this.rr=setTimeout((()=>{var[t]=this.er();if(this.Be((new Date).getTime(),t)){var i=this.We;this.resetSessionId(),this.Ue.emit("forcedIdleReset",{idleSessionId:i})}}),1.1*this.sessionTimeoutMs)}}var wo=["$set_once","$set"],xo=Tt("[SiteApps]");class Eo{constructor(t){this._instance=t,this.sr=[],this.apps={}}get isEnabled(){return!!this._instance.config.opt_in_site_apps}nr(t,i){if(i){var e=this.globalsForEvent(i);this.sr.push(e),this.sr.length>1e3&&(this.sr=this.sr.slice(10))}}get siteAppLoaders(){var t;return null==(t=v._POSTHOG_REMOTE_CONFIG)||null==(t=t[this._instance.config.token])?void 0:t.siteApps}init(){if(this.isEnabled){var t=this._instance.Ni(this.nr.bind(this));this.ar=()=>{t(),this.sr=[],this.ar=void 0}}}globalsForEvent(t){var i,e,r,s,n,o,a;if(!t)throw new Error("Event payload is required");var l={},u=this._instance.get_property("$groups")||[],h=this._instance.get_property("$stored_group_properties")||{};for(var[d,v]of Object.entries(h))l[d]={id:u[d],type:d,properties:v};var{$set_once:c,$set:f}=t;return{event:g({},_(t,wo),{properties:g({},t.properties,f?{$set:g({},null!==(i=null==(e=t.properties)?void 0:e.$set)&&void 0!==i?i:{},f)}:{},c?{$set_once:g({},null!==(r=null==(s=t.properties)?void 0:s.$set_once)&&void 0!==r?r:{},c)}:{}),elements_chain:null!==(n=null==(o=t.properties)?void 0:o.$elements_chain)&&void 0!==n?n:"",distinct_id:null==(a=t.properties)?void 0:a.distinct_id}),person:{properties:this._instance.get_property("$stored_person_properties")},groups:l}}setupSiteApp(t){var i=this.apps[t.id],e=()=>{var e;(!i.errored&&this.sr.length&&(xo.info("Processing "+this.sr.length+" events for site app with id "+t.id),this.sr.forEach((t=>null==i.processEvent?void 0:i.processEvent(t))),i.processedBuffer=!0),Object.values(this.apps).every((t=>t.processedBuffer||t.errored)))&&(null==(e=this.ar)||e.call(this))},r=!1,s=s=>{i.errored=!s,i.loaded=!0,xo.info("Site app with id "+t.id+" "+(s?"loaded":"errored")),r&&e()};try{var{processEvent:n}=t.init({posthog:this._instance,callback:t=>{s(t)}});n&&(i.processEvent=n),r=!0}catch(i){xo.error("Error while initializing PostHog app with config id "+t.id,i),s(!1)}if(r&&i.loaded)try{e()}catch(e){xo.error("Error while processing buffered events PostHog app with config id "+t.id,e),i.errored=!0}}lr(){var t=this.siteAppLoaders||[];for(var i of t)this.apps[i.id]={id:i.id,loaded:!1,errored:!1,processedBuffer:!1};for(var e of t)this.setupSiteApp(e)}ur(t){if(0!==Object.keys(this.apps).length){var i=this.globalsForEvent(t);for(var e of Object.values(this.apps))try{null==e.processEvent||e.processEvent(i)}catch(i){xo.error("Error while processing event "+t.event+" for site app "+e.id,i)}}}onRemoteConfig(t){var i,e,r,s=this;if(null!=(i=this.siteAppLoaders)&&i.length)return this.isEnabled?(this.lr(),void this._instance.on("eventCaptured",(t=>this.ur(t)))):void xo.error('PostHog site apps are disabled. Enable the "opt_in_site_apps" config to proceed.');if(null==(e=this.ar)||e.call(this),null!=(r=t.siteApps)&&r.length)if(this.isEnabled){var n=function(t){var i;v["__$$ph_site_app_"+t]=s._instance,null==(i=v.__PosthogExtensions__)||null==i.loadSiteApp||i.loadSiteApp(s._instance,a,(i=>{if(i)return xo.error("Error while initializing PostHog app with config id "+t,i)}))};for(var{id:o,url:a}of t.siteApps)n(o)}else xo.error('PostHog site apps are disabled. Enable the "opt_in_site_apps" config to proceed.')}}var So=function(t,i){if(!t)return!1;var e=t.userAgent;if(e&&y(e,i))return!0;try{var r=null==t?void 0:t.userAgentData;if(null!=r&&r.brands&&r.brands.some((t=>y(null==t?void 0:t.brand,i))))return!0}catch(t){}return!!t.webdriver},$o=function(t){return t.US="us",t.EU="eu",t.CUSTOM="custom",t}({}),ko="i.posthog.com";class Po{constructor(t){this.hr={},this.instance=t}get apiHost(){var t=this.instance.config.api_host.trim().replace(/\/$/,"");return"https://app.posthog.com"===t?"https://us.i.posthog.com":t}get flagsApiHost(){var t=this.instance.config.flags_api_host;return t?t.trim().replace(/\/$/,""):this.apiHost}get uiHost(){var t,i=null==(t=this.instance.config.ui_host)?void 0:t.replace(/\/$/,"");return i||(i=this.apiHost.replace("."+ko,".posthog.com")),"https://app.posthog.com"===i?"https://us.posthog.com":i}get region(){return this.hr[this.apiHost]||(/https:\/\/(app|us|us-assets)(\.i)?\.posthog\.com/i.test(this.apiHost)?this.hr[this.apiHost]=$o.US:/https:\/\/(eu|eu-assets)(\.i)?\.posthog\.com/i.test(this.apiHost)?this.hr[this.apiHost]=$o.EU:this.hr[this.apiHost]=$o.CUSTOM),this.hr[this.apiHost]}endpointFor(t,i){if(void 0===i&&(i=""),i&&(i="/"===i[0]?i:"/"+i),"ui"===t)return this.uiHost+i;if("flags"===t)return this.flagsApiHost+i;if(this.region===$o.CUSTOM)return this.apiHost+i;var e=ko+i;switch(t){case"assets":return"https://"+this.region+"-assets."+e;case"api":return"https://"+this.region+"."+e}}}var To={icontains:(i,e)=>!!t&&e.href.toLowerCase().indexOf(i.toLowerCase())>-1,not_icontains:(i,e)=>!!t&&-1===e.href.toLowerCase().indexOf(i.toLowerCase()),regex:(i,e)=>!!t&&cn(e.href,i),not_regex:(i,e)=>!!t&&!cn(e.href,i),exact:(t,i)=>i.href===t,is_not:(t,i)=>i.href!==t};class Co{constructor(t){var i=this;this.getWebExperimentsAndEvaluateDisplayLogic=function(t){void 0===t&&(t=!1),i.getWebExperiments((t=>{Co.dr("retrieved web experiments from the server"),i.vr=new Map,t.forEach((t=>{if(t.feature_flag_key){var e;if(i.vr)Co.dr("setting flag key ",t.feature_flag_key," to web experiment ",t),null==(e=i.vr)||e.set(t.feature_flag_key,t);var r=i._instance.getFeatureFlag(t.feature_flag_key);O(r)&&t.variants[r]&&i.cr(t.name,r,t.variants[r].transforms)}else if(t.variants)for(var s in t.variants){var n=t.variants[s];Co.pr(n)&&i.cr(t.name,s,n.transforms)}}))}),t)},this._instance=t,this._instance.onFeatureFlags((t=>{this.onFeatureFlags(t)}))}onFeatureFlags(t){if(this._is_bot())Co.dr("Refusing to render web experiment since the viewer is a likely bot");else if(!this._instance.config.disable_web_experiments){if(j(this.vr))return this.vr=new Map,this.loadIfEnabled(),void this.previewWebExperiment();Co.dr("applying feature flags",t),t.forEach((t=>{var i;if(this.vr&&null!=(i=this.vr)&&i.has(t)){var e,r=this._instance.getFeatureFlag(t),s=null==(e=this.vr)?void 0:e.get(t);r&&null!=s&&s.variants[r]&&this.cr(s.name,r,s.variants[r].transforms)}}))}}previewWebExperiment(){var t=Co.getWindowLocation();if(null!=t&&t.search){var i=he(null==t?void 0:t.search,"__experiment_id"),e=he(null==t?void 0:t.search,"__experiment_variant");i&&e&&(Co.dr("previewing web experiments "+i+" && "+e),this.getWebExperiments((t=>{this.gr(parseInt(i),e,t)}),!1,!0))}}loadIfEnabled(){this._instance.config.disable_web_experiments||this.getWebExperimentsAndEvaluateDisplayLogic()}getWebExperiments(t,i,e){if(this._instance.config.disable_web_experiments&&!e)return t([]);var r=this._instance.get_property("$web_experiments");if(r&&!i)return t(r);this._instance._send_request({url:this._instance.requestRouter.endpointFor("api","/api/web_experiments/?token="+this._instance.config.token),method:"GET",callback:i=>{if(200!==i.statusCode||!i.json)return t([]);var e=i.json.experiments||[];return t(e)}})}gr(t,i,e){var r=e.filter((i=>i.id===t));r&&r.length>0&&(Co.dr("Previewing web experiment ["+r[0].name+"] with variant ["+i+"]"),this.cr(r[0].name,i,r[0].variants[i].transforms))}static pr(t){return!j(t.conditions)&&(Co._r(t)&&Co.mr(t))}static _r(t){var i;if(j(t.conditions)||j(null==(i=t.conditions)?void 0:i.url))return!0;var e,r,s,n=Co.getWindowLocation();return!!n&&(null==(e=t.conditions)||!e.url||To[null!==(r=null==(s=t.conditions)?void 0:s.urlMatchType)&&void 0!==r?r:"icontains"](t.conditions.url,n))}static getWindowLocation(){return null==t?void 0:t.location}static mr(t){var i;if(j(t.conditions)||j(null==(i=t.conditions)?void 0:i.utm))return!0;var e=ls();if(e.utm_source){var r,s,n,o,a,l,u,h,d=null==(r=t.conditions)||null==(r=r.utm)||!r.utm_campaign||(null==(s=t.conditions)||null==(s=s.utm)?void 0:s.utm_campaign)==e.utm_campaign,v=null==(n=t.conditions)||null==(n=n.utm)||!n.utm_source||(null==(o=t.conditions)||null==(o=o.utm)?void 0:o.utm_source)==e.utm_source,c=null==(a=t.conditions)||null==(a=a.utm)||!a.utm_medium||(null==(l=t.conditions)||null==(l=l.utm)?void 0:l.utm_medium)==e.utm_medium,f=null==(u=t.conditions)||null==(u=u.utm)||!u.utm_term||(null==(h=t.conditions)||null==(h=h.utm)?void 0:h.utm_term)==e.utm_term;return d&&c&&f&&v}return!1}static dr(t){for(var i=arguments.length,e=new Array(i>1?i-1:0),r=1;r<i;r++)e[r-1]=arguments[r];Pt.info("[WebExperiments] "+t,e)}cr(t,i,e){this._is_bot()?Co.dr("Refusing to render web experiment since the viewer is a likely bot"):"control"!==i?e.forEach((e=>{if(e.selector){var r;Co.dr("applying transform of variant "+i+" for experiment "+t+" ",e);var s=null==(r=document)?void 0:r.querySelectorAll(e.selector);null==s||s.forEach((t=>{var i=t;e.html&&(i.innerHTML=e.html),e.css&&i.setAttribute("style",e.css)}))}})):Co.dr("Control variants leave the page unmodified.")}_is_bot(){return n&&this._instance?So(n,this._instance.config.custom_blocked_useragents):void 0}}var Ro=Tt("[PostHog ExternalIntegrations]"),Io={intercom:"intercom-integration",crispChat:"crisp-chat-integration"};class Fo{constructor(t){this._instance=t}it(t,i){var e;null==(e=v.__PosthogExtensions__)||null==e.loadExternalDependency||e.loadExternalDependency(this._instance,t,(t=>{if(t)return Ro.error("failed to load script",t);i()}))}startIfEnabledOrStop(){var t=this,i=function(i){var e,s,n;(!r||null!=(e=v.__PosthogExtensions__)&&null!=(e=e.integrations)&&e[i]||t.it(Io[i],(()=>{var e;null==(e=v.__PosthogExtensions__)||null==(e=e.integrations)||null==(e=e[i])||e.start(t._instance)})),!r&&null!=(s=v.__PosthogExtensions__)&&null!=(s=s.integrations)&&s[i])&&(null==(n=v.__PosthogExtensions__)||null==(n=n.integrations)||null==(n=n[i])||n.stop())};for(var[e,r]of Object.entries(null!==(s=this._instance.config.integrations)&&void 0!==s?s:{})){var s;i(e)}}}var Mo="[SessionRecording]",Oo=Tt(Mo);class Ao{get started(){var t;return!(null==(t=this.yr)||!t.isStarted)}get status(){return this.yr?this.yr.status:this.br&&!this.wr?"disabled":"lazy_loading"}constructor(t){if(this._forceAllowLocalhostNetworkCapture=!1,this.br=!1,this.Er=void 0,this._instance=t,!this._instance.sessionManager)throw Oo.error("started without valid sessionManager"),new Error(Mo+" started without valid sessionManager. This is a bug.");if("always"===this._instance.config.cookieless_mode)throw new Error(Mo+' cannot be used with cookieless_mode="always"')}get wr(){var i,e=!(null==(i=this._instance.get_property(ei))||!i.enabled),r=!this._instance.config.disable_session_recording,s=this._instance.config.disable_session_recording||this._instance.consent.isOptedOut();return t&&e&&r&&!s}startIfEnabledOrStop(t){var i;if(!this.wr||null==(i=this.yr)||!i.isStarted){var e=!M(Object.assign)&&!M(Array.from);this.wr&&e?(this.Sr(t),Oo.info("starting")):this.stopRecording()}}Sr(t){var i,e,r;this.wr&&(null!=v&&null!=(i=v.__PosthogExtensions__)&&null!=(i=i.rrweb)&&i.record&&null!=(e=v.__PosthogExtensions__)&&e.initSessionRecording?this.$r(t):null==(r=v.__PosthogExtensions__)||null==r.loadExternalDependency||r.loadExternalDependency(this._instance,this.kr,(i=>{if(i)return Oo.error("could not load recorder",i);this.$r(t)})))}stopRecording(){var t,i;null==(t=this.Er)||t.call(this),this.Er=void 0,null==(i=this.yr)||i.stop()}Pr(){var t;null==(t=this._instance.persistence)||t.unregister(si)}Tr(t){if(this._instance.persistence){var i,e,r=this._instance.persistence,s=()=>{var i=!1===t.sessionRecording?void 0:t.sessionRecording,e=null==i?void 0:i.sampleRate,s=j(e)?null:parseFloat(e);j(s)&&this.Pr();var n=null==i?void 0:i.minimumDurationMilliseconds;r.register({[ei]:g({enabled:!!i},i,{networkPayloadCapture:g({capturePerformance:t.capturePerformance},null==i?void 0:i.networkPayloadCapture),canvasRecording:{enabled:null==i?void 0:i.recordCanvas,fps:null==i?void 0:i.canvasFps,quality:null==i?void 0:i.canvasQuality},sampleRate:s,minimumDurationMilliseconds:M(n)?null:n,endpoint:null==i?void 0:i.endpoint,triggerMatchType:null==i?void 0:i.triggerMatchType,masking:null==i?void 0:i.masking,urlTriggers:null==i?void 0:i.urlTriggers})})};s(),null==(i=this.Er)||i.call(this),this.Er=null==(e=this._instance.sessionManager)?void 0:e.onSessionId(s)}}onRemoteConfig(t){"sessionRecording"in t?!1!==t.sessionRecording?(this.Tr(t),this.br=!0,this.startIfEnabledOrStop()):this.br=!0:Oo.info("skipping remote config with no sessionRecording",t)}log(t,i){var e;void 0===i&&(i="log"),null!=(e=this.yr)&&e.log?this.yr.log(t,i):Oo.warn("log called before recorder was ready")}get kr(){var t,i,e=null==(t=this._instance)||null==(t=t.persistence)?void 0:t.get_property(ei);return(null==e||null==(i=e.scriptConfig)?void 0:i.script)||"lazy-recorder"}$r(t){var i,e;if(null==(i=v.__PosthogExtensions__)||!i.initSessionRecording)throw Error("Called on script loaded before session recording is available");this.yr||(this.yr=null==(e=v.__PosthogExtensions__)?void 0:e.initSessionRecording(this._instance),this.yr._forceAllowLocalhostNetworkCapture=this._forceAllowLocalhostNetworkCapture);this.yr.start(t)}onRRwebEmit(t){var i;null==(i=this.yr)||null==i.onRRwebEmit||i.onRRwebEmit(t)}overrideLinkedFlag(){var t,i;this.yr||(null==(i=this._instance.persistence)||i.register({$replay_override_linked_flag:!0}));null==(t=this.yr)||t.overrideLinkedFlag()}overrideSampling(){var t,i;this.yr||(null==(i=this._instance.persistence)||i.register({$replay_override_sampling:!0}));null==(t=this.yr)||t.overrideSampling()}overrideTrigger(t){var i,e;this.yr||(null==(e=this._instance.persistence)||e.register({["url"===t?"$replay_override_url_trigger":"$replay_override_event_trigger"]:!0}));null==(i=this.yr)||i.overrideTrigger(t)}get sdkDebugProperties(){var t;return(null==(t=this.yr)?void 0:t.sdkDebugProperties)||{$recording_status:this.status}}tryAddCustomEvent(t,i){var e;return!(null==(e=this.yr)||!e.tryAddCustomEvent(t,i))}}var Do={},jo=()=>{},Lo="posthog",No=!an&&-1===(null==d?void 0:d.indexOf("MSIE"))&&-1===(null==d?void 0:d.indexOf("Mozilla")),Uo=i=>{var e;return g({api_host:"https://us.i.posthog.com",flags_api_host:null,ui_host:null,token:"",autocapture:!0,cross_subdomain_cookie:Ht(null==o?void 0:o.location),persistence:"localStorage+cookie",persistence_name:"",loaded:jo,save_campaign_params:!0,custom_campaign_params:[],custom_blocked_useragents:[],save_referrer:!0,capture_pageleave:"if_capture_pageview",defaults:null!=i?i:"unset",__preview_deferred_init_extensions:!1,debug:a&&O(null==a?void 0:a.search)&&-1!==a.search.indexOf("__posthog_debug=true")||!1,cookie_expiration:365,upgrade:!1,disable_session_recording:!1,disable_persistence:!1,disable_web_experiments:!0,disable_surveys:!1,disable_surveys_automatic_display:!1,disable_conversations:!1,disable_product_tours:!0,disable_external_dependency_loading:!1,enable_recording_console_log:void 0,secure_cookie:"https:"===(null==t||null==(e=t.location)?void 0:e.protocol),ip:!1,opt_out_capturing_by_default:!1,opt_out_persistence_by_default:!1,opt_out_useragent_filter:!1,opt_out_capturing_persistence_type:"localStorage",consent_persistence_name:null,opt_out_capturing_cookie_prefix:null,opt_in_site_apps:!1,property_denylist:[],respect_dnt:!1,sanitize_properties:null,request_headers:{},request_batching:!0,properties_string_max_length:65535,mask_all_element_attributes:!1,mask_all_text:!1,mask_personal_data_properties:!1,custom_personal_data_properties:[],advanced_disable_flags:!1,advanced_disable_decide:!1,advanced_disable_feature_flags:!1,advanced_disable_feature_flags_on_first_load:!1,advanced_only_evaluate_survey_feature_flags:!1,advanced_enable_surveys:!1,advanced_disable_toolbar_metrics:!1,feature_flag_request_timeout_ms:3e3,surveys_request_timeout_ms:1e4,on_request_error:t=>{var i="Bad HTTP status: "+t.statusCode+" "+t.text;Pt.error(i)},get_device_id:t=>t,capture_performance:void 0,name:"posthog",bootstrap:{},disable_compression:!1,session_idle_timeout_seconds:1800,person_profiles:"identified_only",before_send:void 0,request_queue_config:{flush_interval_ms:vo},error_tracking:{},_onCapture:jo,__preview_eager_load_replay:!1},(t=>({rageclick:!(t&&t>="2025-11-30")||{content_ignorelist:!0},capture_pageview:!(t&&t>="2025-05-24")||"history_change",session_recording:t&&t>="2025-11-30"?{strictMinimumDuration:!0}:{}}))(i))},zo=t=>{var i={};M(t.process_person)||(i.person_profiles=t.process_person),M(t.xhr_headers)||(i.request_headers=t.xhr_headers),M(t.cookie_name)||(i.persistence_name=t.cookie_name),M(t.disable_cookie)||(i.disable_persistence=t.disable_cookie),M(t.store_google)||(i.save_campaign_params=t.store_google),M(t.verbose)||(i.debug=t.verbose);var e=Ot({},i,t);return C(t.property_blacklist)&&(M(t.property_denylist)?e.property_denylist=t.property_blacklist:C(t.property_denylist)?e.property_denylist=[...t.property_blacklist,...t.property_denylist]:Pt.error("Invalid value for property_denylist config: "+t.property_denylist)),e};class Ho{constructor(){this.__forceAllowLocalhost=!1}get Cr(){return this.__forceAllowLocalhost}set Cr(t){Pt.error("WebPerformanceObserver is deprecated and has no impact on network capture. Use `_forceAllowLocalhostNetworkCapture` on `posthog.sessionRecording`"),this.__forceAllowLocalhost=t}}class Bo{get decideEndpointWasHit(){var t,i;return null!==(t=null==(i=this.featureFlags)?void 0:i.hasLoadedFlags)&&void 0!==t&&t}get flagsEndpointWasHit(){var t,i;return null!==(t=null==(i=this.featureFlags)?void 0:i.hasLoadedFlags)&&void 0!==t&&t}constructor(){this.webPerformance=new Ho,this.Rr=!1,this.version=c.LIB_VERSION,this.Ir=new Jn,this._calculate_event_properties=this.calculateEventProperties.bind(this),this.config=Uo(),this.SentryIntegration=Ze,this.sentryIntegration=t=>function(t,i){var e=Qe(t,i);return{name:Xe,processEvent:t=>e(t)}}(this,t),this.__request_queue=[],this.__loaded=!1,this.analyticsDefaultEndpoint="/e/",this.Fr=!1,this.Mr=null,this.Or=null,this.Ar=null,this.featureFlags=new In(this),this.toolbar=new sr(this),this.scrollManager=new go(this),this.pageViewManager=new Ss(this),this.surveys=new so(this),this.conversations=new oo(this),this.productTours=new Dn(this),this.experiments=new Co(this),this.exceptions=new yn(this),this.rateLimiter=new lo(this),this.requestRouter=new Po(this),this.consent=new Ue(this),this.externalIntegrations=new Fo(this),this.people={set:(t,i,e)=>{var r=O(t)?{[t]:i}:t;this.setPersonProperties(r),null==e||e({})},set_once:(t,i,e)=>{var r=O(t)?{[t]:i}:t;this.setPersonProperties(void 0,r),null==e||e({})}},this.on("eventCaptured",(t=>Pt.info('send "'+(null==t?void 0:t.event)+'"',t)))}init(t,i,e){if(e&&e!==Lo){var r,s=null!==(r=Do[e])&&void 0!==r?r:new Bo;return s._init(t,i,e),Do[e]=s,Do[Lo][e]=s,s}return this._init(t,i,e)}_init(i,e,r){var s;if(void 0===e&&(e={}),M(i)||A(i))return Pt.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 console.warn("[PostHog.js]","You have already initialized PostHog! Re-initializing is a no-op"),this;this.__loaded=!0,this.config={},e.debug=this.Dr(e.debug),this.jr=e,this.Lr=[],e.person_profiles&&(this.Or=e.person_profiles),this.set_config(Ot({},Uo(e.defaults),zo(e),{name:r,token:i})),this.config.on_xhr_error&&Pt.error("on_xhr_error is deprecated. Use on_request_error instead"),this.compression=e.disable_compression?void 0:oe.GZipJS;var n=this.Nr();this.persistence=new Mn(this.config,n),this.sessionPersistence="sessionStorage"===this.config.persistence||"memory"===this.config.persistence?this.persistence:new Mn(g({},this.config,{persistence:"sessionStorage"}),n);var o=g({},this.persistence.props),a=g({},this.sessionPersistence.props);this.register({$initialization_time:(new Date).toISOString()}),this.Ur=new co((t=>this.zr(t)),this.config.request_queue_config),this.Hr=new po(this),this.__request_queue=[];var l="always"===this.config.cookieless_mode||"on_reject"===this.config.cookieless_mode&&this.consent.isExplicitlyOptedOut();if(l||(this.sessionManager=new bo(this),this.sessionPropsManager=new mo(this,this.sessionManager,this.persistence)),this.config.__preview_deferred_init_extensions?(Pt.info("Deferring extension initialization to improve startup performance"),setTimeout((()=>{this.Br(l)}),0)):(Pt.info("Initializing extensions synchronously"),this.Br(l)),c.DEBUG=c.DEBUG||this.config.debug,c.DEBUG&&Pt.info("Starting in debug mode",{this:this,config:e,thisC:g({},this.config),p:o,s:a}),void 0!==(null==(s=e.bootstrap)?void 0:s.distinctID)){var u,h,d=this.config.get_device_id($e()),v=null!=(u=e.bootstrap)&&u.isIdentifiedID?d:e.bootstrap.distinctID;this.persistence.set_property(ci,null!=(h=e.bootstrap)&&h.isIdentifiedID?"identified":"anonymous"),this.register({distinct_id:e.bootstrap.distinctID,$device_id:v})}if(this.qr()){var f,p,_=Object.keys((null==(f=e.bootstrap)?void 0:f.featureFlags)||{}).filter((t=>{var i;return!(null==(i=e.bootstrap)||null==(i=i.featureFlags)||!i[t])})).reduce(((t,i)=>{var r;return t[i]=(null==(r=e.bootstrap)||null==(r=r.featureFlags)?void 0:r[i])||!1,t}),{}),m=Object.keys((null==(p=e.bootstrap)?void 0:p.featureFlagPayloads)||{}).filter((t=>_[t])).reduce(((t,i)=>{var r,s;null!=(r=e.bootstrap)&&null!=(r=r.featureFlagPayloads)&&r[i]&&(t[i]=null==(s=e.bootstrap)||null==(s=s.featureFlagPayloads)?void 0:s[i]);return t}),{});this.featureFlags.receivedFeatureFlags({featureFlags:_,featureFlagPayloads:m})}if(l)this.register_once({distinct_id:wi,$device_id:null},"");else if(!this.get_distinct_id()){var y=this.config.get_device_id($e());this.register_once({distinct_id:y,$device_id:y},""),this.persistence.set_property(ci,"anonymous")}return qt(t,"onpagehide"in self?"pagehide":"unload",this._handle_unload.bind(this),{passive:!1}),this.toolbar.maybeLoadToolbar(),e.segment?Ye(this,(()=>this.Wr())):this.Wr(),R(this.config._onCapture)&&this.config._onCapture!==jo&&(Pt.warn("onCapture is deprecated. Please use `before_send` instead"),this.on("eventCaptured",(t=>this.config._onCapture(t.event,t)))),this.config.ip&&Pt.warn('The `ip` config option has NO EFFECT AT ALL and has been deprecated. Use a custom transformation or "Discard IP data" project setting instead. See https://posthog.com/tutorials/web-redact-properties#hiding-customer-ip-address for more information.'),this}Br(t){var i=performance.now();this.historyAutocapture=new Je(this),this.historyAutocapture.startIfEnabled();var e=[];e.push((()=>{new or(this).startIfEnabledOrStop()})),e.push((()=>{var t;this.siteApps=new Eo(this),null==(t=this.siteApps)||t.init()})),t||e.push((()=>{this.sessionRecording=new Ao(this),this.sessionRecording.startIfEnabledOrStop()})),this.config.disable_scroll_properties||e.push((()=>{this.scrollManager.startMeasuringScrollPosition()})),e.push((()=>{this.autocapture=new me(this),this.autocapture.startIfEnabled()})),e.push((()=>{this.surveys.loadIfEnabled()})),e.push((()=>{this.conversations.loadIfEnabled()})),e.push((()=>{this.productTours.loadIfEnabled()})),e.push((()=>{this.heatmaps=new Es(this),this.heatmaps.startIfEnabled()})),e.push((()=>{this.webVitalsAutocapture=new bs(this)})),e.push((()=>{this.exceptionObserver=new Ge(this),this.exceptionObserver.startIfEnabled()})),e.push((()=>{this.deadClicksAutocapture=new qe(this,Be),this.deadClicksAutocapture.startIfEnabled()})),e.push((()=>{if(this.Gr){var t=this.Gr;this.Gr=void 0,this.ci(t)}})),this.Vr(e,i)}Vr(t,i){for(;t.length>0;){if(this.config.__preview_deferred_init_extensions)if(performance.now()-i>=30&&t.length>0)return void setTimeout((()=>{this.Vr(t,i)}),0);var e=t.shift();if(e)try{e()}catch(t){Pt.error("Error initializing extension:",t)}}var r=Math.round(performance.now()-i);this.register_for_session({$sdk_debug_extensions_init_method:this.config.__preview_deferred_init_extensions?"deferred":"synchronous",$sdk_debug_extensions_init_time_ms:r}),this.config.__preview_deferred_init_extensions&&Pt.info("PostHog extensions initialized ("+r+"ms)")}ci(t){var i,e,r,s,n,a,l,u;if(!o||!o.body)return Pt.info("document not ready yet, trying again in 500 milliseconds..."),void setTimeout((()=>{this.ci(t)}),500);this.config.__preview_deferred_init_extensions&&(this.Gr=t),this.compression=void 0,t.supportedCompression&&!this.config.disable_compression&&(this.compression=w(t.supportedCompression,oe.GZipJS)?oe.GZipJS:w(t.supportedCompression,oe.Base64)?oe.Base64:void 0),null!=(i=t.analytics)&&i.endpoint&&(this.analyticsDefaultEndpoint=t.analytics.endpoint),this.set_config({person_profiles:this.Or?this.Or:"identified_only"}),null==(e=this.siteApps)||e.onRemoteConfig(t),null==(r=this.sessionRecording)||r.onRemoteConfig(t),null==(s=this.autocapture)||s.onRemoteConfig(t),null==(n=this.heatmaps)||n.onRemoteConfig(t),this.surveys.onRemoteConfig(t),this.conversations.onRemoteConfig(t),this.productTours.onRemoteConfig(t),null==(a=this.webVitalsAutocapture)||a.onRemoteConfig(t),null==(l=this.exceptionObserver)||l.onRemoteConfig(t),this.exceptions.onRemoteConfig(t),null==(u=this.deadClicksAutocapture)||u.onRemoteConfig(t)}Wr(){try{this.config.loaded(this)}catch(t){Pt.critical("`loaded` function failed",t)}this.Jr(),this.config.capture_pageview&&setTimeout((()=>{(this.consent.isOptedIn()||"always"===this.config.cookieless_mode)&&this.Kr()}),1),new ho(this).load(),this.featureFlags.flags()}Jr(){var t;this.is_capturing()&&(this.config.request_batching&&(null==(t=this.Ur)||t.enable()))}_dom_loaded(){this.is_capturing()&&Ft(this.__request_queue,(t=>this.zr(t))),this.__request_queue=[],this.Jr()}_handle_unload(){var t,i;this.config.request_batching?(this.Yr()&&this.capture("$pageleave"),null==(t=this.Ur)||t.unload(),null==(i=this.Hr)||i.unload()):this.Yr()&&this.capture("$pageleave",null,{transport:"sendBeacon"})}_send_request(t){this.__loaded&&(No?this.__request_queue.push(t):this.rateLimiter.isServerRateLimited(t.batchKey)||(t.transport=t.transport||this.config.api_transport,t.url=un(t.url,{ip:this.config.ip?1:0}),t.headers=g({},this.config.request_headers,t.headers),t.compression="best-available"===t.compression?this.compression:t.compression,t.disableXHRCredentials=this.config.__preview_disable_xhr_credentials,this.config.__preview_disable_beacon&&(t.disableTransport=["sendBeacon"]),t.fetchOptions=t.fetchOptions||this.config.fetch_options,(t=>{var i,e,r,s=g({},t);s.timeout=s.timeout||6e4,s.url=un(s.url,{_:(new Date).getTime().toString(),ver:c.LIB_VERSION,compression:s.compression});var n=null!==(i=s.transport)&&void 0!==i?i:"fetch",o=vn.filter((t=>!s.disableTransport||!t.transport||!s.disableTransport.includes(t.transport))),a=null!==(e=null==(r=Bt(o,(t=>t.transport===n)))?void 0:r.method)&&void 0!==e?e:o[0].method;if(!a)throw new Error("No available transport method");a(s)})(g({},t,{callback:i=>{var e,r;(this.rateLimiter.checkForLimiting(i),i.statusCode>=400)&&(null==(e=(r=this.config).on_request_error)||e.call(r,i));null==t.callback||t.callback(i)}}))))}zr(t){this.Hr?this.Hr.retriableRequest(t):this._send_request(t)}_execute_array(t){var i,e=[],r=[],s=[];Ft(t,(t=>{t&&(i=t[0],C(i)?s.push(t):R(t)?t.call(this):C(t)&&"alias"===i?e.push(t):C(t)&&-1!==i.indexOf("capture")&&R(this[i])?s.push(t):r.push(t))}));var n=function(t,i){Ft(t,(function(t){if(C(t[0])){var e=i;Mt(t,(function(t){e=e[t[0]].apply(e,t.slice(1))}))}else this[t[0]].apply(this,t.slice(1))}),i)};n(e,this),n(r,this),n(s,this)}qr(){var t,i;return(null==(t=this.config.bootstrap)?void 0:t.featureFlags)&&Object.keys(null==(i=this.config.bootstrap)?void 0:i.featureFlags).length>0||!1}push(t){this._execute_array([t])}capture(t,i,e){var r;if(this.__loaded&&this.persistence&&this.sessionPersistence&&this.Ur){if(this.is_capturing())if(!M(t)&&O(t)){var s=!this.config.opt_out_useragent_filter&&this._is_bot();if(!(s&&!this.config.__preview_capture_bot_pageviews)){var n=null!=e&&e.skip_client_rate_limiting?void 0:this.rateLimiter.clientRateLimitContext();if(null==n||!n.isRateLimited){null!=i&&i.$current_url&&!O(null==i?void 0:i.$current_url)&&(Pt.error("Invalid `$current_url` property provided to `posthog.capture`. Input must be a string. Ignoring provided value."),null==i||delete i.$current_url),this.sessionPersistence.update_search_keyword(),this.config.save_campaign_params&&this.sessionPersistence.update_campaign_params(),this.config.save_referrer&&this.sessionPersistence.update_referrer_info(),(this.config.save_campaign_params||this.config.save_referrer)&&this.persistence.set_initial_person_info();var o=new Date,a=(null==e?void 0:e.timestamp)||o,l=$e(),u={uuid:l,event:t,properties:this.calculateEventProperties(t,i||{},a,l)};"$pageview"===t&&this.config.__preview_capture_bot_pageviews&&s&&(u.event="$bot_pageview",u.properties.$browser_type="bot"),n&&(u.properties.$lib_rate_limit_remaining_tokens=n.remainingTokens),(null==e?void 0:e.$set)&&(u.$set=null==e?void 0:e.$set);var h,d="$groupidentify"!==t,v=this.Xr(null==e?void 0:e.$set_once,d);if(v&&(u.$set_once=v),(u=Ut(u,null!=e&&e._noTruncate?null:this.config.properties_string_max_length)).timestamp=a,M(null==e?void 0:e.timestamp)||(u.properties.$event_time_override_provided=!0,u.properties.$event_time_override_system_time=o),t===Wn.DISMISSED||t===Wn.SENT){var c=null==i?void 0:i[Gn.SURVEY_ID],f=null==i?void 0:i[Gn.SURVEY_ITERATION];h={id:c,current_iteration:f},localStorage.getItem(to(h))||localStorage.setItem(to(h),"true"),u.$set=g({},u.$set,{[Zn({id:c,current_iteration:f},t===Wn.SENT?"responded":"dismissed")]:!0})}var p=g({},u.properties.$set,u.$set);if(F(p)||this.setPersonPropertiesForFlags(p),!j(this.config.before_send)){var _=this.Qr(u);if(!_)return;u=_}this.Ir.emit("eventCaptured",u);var m={method:"POST",url:null!==(r=null==e?void 0:e._url)&&void 0!==r?r:this.requestRouter.endpointFor("api",this.analyticsDefaultEndpoint),data:u,compression:"best-available",batchKey:null==e?void 0:e._batchKey};return!this.config.request_batching||e&&(null==e||!e._batchKey)||null!=e&&e.send_instantly?this.zr(m):this.Ur.enqueue(m),u}Pt.critical("This capture call is ignored due to client rate limiting.")}}else Pt.error("No event name provided to posthog.capture")}else Pt.uninitializedWarning("posthog.capture")}Ni(t){return this.on("eventCaptured",(i=>t(i.event,i)))}calculateEventProperties(t,i,e,r,s){if(e=e||new Date,!this.persistence||!this.sessionPersistence)return i;var n=s?void 0:this.persistence.remove_event_timer(t),a=g({},i);if(a.token=this.config.token,a.$config_defaults=this.config.defaults,("always"==this.config.cookieless_mode||"on_reject"==this.config.cookieless_mode&&this.consent.isExplicitlyOptedOut())&&(a.$cookieless_mode=!0),"$snapshot"===t){var l=g({},this.persistence.properties(),this.sessionPersistence.properties());return a.distinct_id=l.distinct_id,(!O(a.distinct_id)&&!L(a.distinct_id)||A(a.distinct_id))&&Pt.error("Invalid distinct_id for replay event. This indicates a bug in your implementation"),a}var u,h=_s(this.config.mask_personal_data_properties,this.config.custom_personal_data_properties);if(this.sessionManager){var{sessionId:v,windowId:c}=this.sessionManager.checkAndGetSessionAndWindowId(s,e.getTime());a.$session_id=v,a.$window_id=c}this.sessionPropsManager&&Ot(a,this.sessionPropsManager.getSessionProps());try{var f;this.sessionRecording&&Ot(a,this.sessionRecording.sdkDebugProperties),a.$sdk_debug_retry_queue_size=null==(f=this.Hr)?void 0:f.length}catch(t){a.$sdk_debug_error_capturing_properties=String(t)}if(this.requestRouter.region===$o.CUSTOM&&(a.$lib_custom_api_host=this.config.api_host),u="$pageview"!==t||s?"$pageleave"!==t||s?this.pageViewManager.doEvent():this.pageViewManager.doPageLeave(e):this.pageViewManager.doPageView(e,r),a=Ot(a,u),"$pageview"===t&&o&&(a.title=o.title),!M(n)){var p=e.getTime()-n;a.$duration=parseFloat((p/1e3).toFixed(3))}d&&this.config.opt_out_useragent_filter&&(a.$browser_type=this._is_bot()?"bot":"browser"),(a=Ot({},h,this.persistence.properties(),this.sessionPersistence.properties(),a)).$is_identified=this._isIdentified(),C(this.config.property_denylist)?Mt(this.config.property_denylist,(function(t){delete a[t]})):Pt.error("Invalid value for property_denylist config: "+this.config.property_denylist+" or property_blacklist config: "+this.config.property_blacklist);var _=this.config.sanitize_properties;_&&(Pt.error("sanitize_properties is deprecated. Use before_send instead"),a=_(a,t));var m=this.Zr();return a.$process_person_profile=m,m&&!s&&this.ts("_calculate_event_properties"),a}Xr(t,i){var e;if(void 0===i&&(i=!0),!this.persistence||!this.Zr())return t;if(this.Rr)return t;var r=this.persistence.get_initial_props(),s=null==(e=this.sessionPropsManager)?void 0:e.getSetOnceProps(),n=Ot({},r,s||{},t||{}),o=this.config.sanitize_properties;return o&&(Pt.error("sanitize_properties is deprecated. Use before_send instead"),n=o(n,"$set_once")),i&&(this.Rr=!0),F(n)?void 0:n}register(t,i){var e;null==(e=this.persistence)||e.register(t,i)}register_once(t,i,e){var r;null==(r=this.persistence)||r.register_once(t,i,e)}register_for_session(t){var i;null==(i=this.sessionPersistence)||i.register(t)}unregister(t){var i;null==(i=this.persistence)||i.unregister(t)}unregister_for_session(t){var i;null==(i=this.sessionPersistence)||i.unregister(t)}es(t,i){this.register({[t]:i})}getFeatureFlag(t,i){return this.featureFlags.getFeatureFlag(t,i)}getFeatureFlagPayload(t){var i=this.featureFlags.getFeatureFlagPayload(t);try{return JSON.parse(i)}catch(t){return i}}isFeatureEnabled(t,i){return this.featureFlags.isFeatureEnabled(t,i)}reloadFeatureFlags(){this.featureFlags.reloadFeatureFlags()}updateEarlyAccessFeatureEnrollment(t,i,e){this.featureFlags.updateEarlyAccessFeatureEnrollment(t,i,e)}getEarlyAccessFeatures(t,i,e){return void 0===i&&(i=!1),this.featureFlags.getEarlyAccessFeatures(t,i,e)}on(t,i){return this.Ir.on(t,i)}onFeatureFlags(t){return this.featureFlags.onFeatureFlags(t)}onSurveysLoaded(t){return this.surveys.onSurveysLoaded(t)}onSessionId(t){var i,e;return null!==(i=null==(e=this.sessionManager)?void 0:e.onSessionId(t))&&void 0!==i?i:()=>{}}getSurveys(t,i){void 0===i&&(i=!1),this.surveys.getSurveys(t,i)}getActiveMatchingSurveys(t,i){void 0===i&&(i=!1),this.surveys.getActiveMatchingSurveys(t,i)}renderSurvey(t,i){this.surveys.renderSurvey(t,i)}displaySurvey(t,i){void 0===i&&(i=eo),this.surveys.displaySurvey(t,i)}cancelPendingSurvey(t){this.surveys.cancelPendingSurvey(t)}canRenderSurvey(t){return this.surveys.canRenderSurvey(t)}canRenderSurveyAsync(t,i){return void 0===i&&(i=!1),this.surveys.canRenderSurveyAsync(t,i)}identify(t,i,e){if(!this.__loaded||!this.persistence)return Pt.uninitializedWarning("posthog.identify");if(L(t)&&(t=t.toString(),Pt.warn("The first argument to posthog.identify was a number, but it should be a string. It has been converted to a string.")),t)if(["distinct_id","distinctid"].includes(t.toLowerCase()))Pt.critical('The string "'+t+'" was set in posthog.identify which indicates an error. This ID should be unique to the user and not a hardcoded string.');else if(t!==wi){if(this.ts("posthog.identify")){var r=this.get_distinct_id();if(this.register({$user_id:t}),!this.get_property("$device_id")){var s=r;this.register_once({$had_persisted_distinct_id:!0,$device_id:s},"")}t!==r&&t!==this.get_property(Gt)&&(this.unregister(Gt),this.register({distinct_id:t}));var n="anonymous"===(this.persistence.get_property(ci)||"anonymous");t!==r&&n?(this.persistence.set_property(ci,"identified"),this.setPersonPropertiesForFlags(g({},e||{},i||{}),!1),this.capture("$identify",{distinct_id:t,$anon_distinct_id:r},{$set:i||{},$set_once:e||{}}),this.Ar=fn(t,i,e),this.featureFlags.setAnonymousDistinctId(r)):(i||e)&&this.setPersonProperties(i,e),t!==r&&(this.reloadFeatureFlags(),this.unregister(vi))}}else Pt.critical('The string "'+wi+'" was set in posthog.identify which indicates an error. This ID is only used as a sentinel value.');else Pt.error("Unique user id has not been set in posthog.identify")}setPersonProperties(t,i){if((t||i)&&this.ts("posthog.setPersonProperties")){var e=fn(this.get_distinct_id(),t,i);this.Ar!==e?(this.setPersonPropertiesForFlags(g({},i||{},t||{})),this.capture("$set",{$set:t||{},$set_once:i||{}}),this.Ar=e):Pt.info("A duplicate setPersonProperties call was made with the same properties. It has been ignored.")}}group(t,i,e){if(t&&i){var r=this.getGroups();r[t]!==i&&this.resetGroupPropertiesForFlags(t),this.register({$groups:g({},r,{[t]:i})}),e&&(this.capture("$groupidentify",{$group_type:t,$group_key:i,$group_set:e}),this.setGroupPropertiesForFlags({[t]:e})),r[t]===i||e||this.reloadFeatureFlags()}else Pt.error("posthog.group requires a group type and group key")}resetGroups(){this.register({$groups:{}}),this.resetGroupPropertiesForFlags(),this.reloadFeatureFlags()}setPersonPropertiesForFlags(t,i){void 0===i&&(i=!0),this.featureFlags.setPersonPropertiesForFlags(t,i)}resetPersonPropertiesForFlags(){this.featureFlags.resetPersonPropertiesForFlags()}setGroupPropertiesForFlags(t,i){void 0===i&&(i=!0),this.ts("posthog.setGroupPropertiesForFlags")&&this.featureFlags.setGroupPropertiesForFlags(t,i)}resetGroupPropertiesForFlags(t){this.featureFlags.resetGroupPropertiesForFlags(t)}reset(t){var i,e,r,s;if(Pt.info("reset"),!this.__loaded)return Pt.uninitializedWarning("posthog.reset");var n=this.get_property("$device_id");if(this.consent.reset(),null==(i=this.persistence)||i.clear(),null==(e=this.sessionPersistence)||e.clear(),this.surveys.reset(),this.featureFlags.reset(),null==(r=this.persistence)||r.set_property(ci,"anonymous"),null==(s=this.sessionManager)||s.resetSessionId(),this.Ar=null,"always"===this.config.cookieless_mode)this.register_once({distinct_id:wi,$device_id:null},"");else{var o=this.config.get_device_id($e());this.register_once({distinct_id:o,$device_id:t?o:n},"")}this.register({$last_posthog_reset:(new Date).toISOString()},1)}get_distinct_id(){return this.get_property("distinct_id")}getGroups(){return this.get_property("$groups")||{}}get_session_id(){var t,i;return null!==(t=null==(i=this.sessionManager)?void 0:i.checkAndGetSessionAndWindowId(!0).sessionId)&&void 0!==t?t:""}get_session_replay_url(t){if(!this.sessionManager)return"";var{sessionId:i,sessionStartTimestamp:e}=this.sessionManager.checkAndGetSessionAndWindowId(!0),r=this.requestRouter.endpointFor("ui","/project/"+this.config.token+"/replay/"+i);if(null!=t&&t.withTimestamp&&e){var s,n=null!==(s=t.timestampLookBack)&&void 0!==s?s:10;if(!e)return r;r+="?t="+Math.max(Math.floor(((new Date).getTime()-e)/1e3)-n,0)}return r}alias(t,i){return t===this.get_property(Wt)?(Pt.critical("Attempting to create alias for existing People user - aborting."),-2):this.ts("posthog.alias")?(M(i)&&(i=this.get_distinct_id()),t!==i?(this.es(Gt,t),this.capture("$create_alias",{alias:t,distinct_id:i})):(Pt.warn("alias matches current distinct_id - skipping api call."),this.identify(t),-1)):void 0}set_config(t){var i=g({},this.config);if(I(t)){var e,r,s,n,o;Ot(this.config,zo(t));var a=this.Nr();null==(e=this.persistence)||e.update_config(this.config,i,a),this.sessionPersistence="sessionStorage"===this.config.persistence||"memory"===this.config.persistence?this.persistence:new Mn(g({},this.config,{persistence:"sessionStorage"}),a);var l=this.Dr(this.config.debug);N(l)&&(this.config.debug=l),N(this.config.debug)&&(this.config.debug?(c.DEBUG=!0,Fe.H()&&Fe.G("ph_debug","true"),Pt.info("set_config",{config:t,oldConfig:i,newConfig:g({},this.config)})):(c.DEBUG=!1,Fe.H()&&Fe.V("ph_debug"))),null==(r=this.sessionRecording)||r.startIfEnabledOrStop(),null==(s=this.autocapture)||s.startIfEnabled(),null==(n=this.heatmaps)||n.startIfEnabled(),this.surveys.loadIfEnabled(),this.rs(),null==(o=this.externalIntegrations)||o.startIfEnabledOrStop()}}startSessionRecording(t){var i=!0===t,e={sampling:i||!(null==t||!t.sampling),linked_flag:i||!(null==t||!t.linked_flag),url_trigger:i||!(null==t||!t.url_trigger),event_trigger:i||!(null==t||!t.event_trigger)};if(Object.values(e).some(Boolean)){var r,s,n,o,a;if(null==(r=this.sessionManager)||r.checkAndGetSessionAndWindowId(),e.sampling)null==(s=this.sessionRecording)||s.overrideSampling();if(e.linked_flag)null==(n=this.sessionRecording)||n.overrideLinkedFlag();if(e.url_trigger)null==(o=this.sessionRecording)||o.overrideTrigger("url");if(e.event_trigger)null==(a=this.sessionRecording)||a.overrideTrigger("event")}this.set_config({disable_session_recording:!1})}stopSessionRecording(){this.set_config({disable_session_recording:!0})}sessionRecordingStarted(){var t;return!(null==(t=this.sessionRecording)||!t.started)}captureException(t,i){var e=new Error("PostHog syntheticException"),r=this.exceptions.buildProperties(t,{handled:!0,syntheticException:e});return this.exceptions.sendExceptionEvent(g({},r,i))}loadToolbar(t){return this.toolbar.loadToolbar(t)}get_property(t){var i;return null==(i=this.persistence)?void 0:i.props[t]}getSessionProperty(t){var i;return null==(i=this.sessionPersistence)?void 0:i.props[t]}toString(){var t,i=null!==(t=this.config.name)&&void 0!==t?t:Lo;return i!==Lo&&(i=Lo+"."+i),i}_isIdentified(){var t,i;return"identified"===(null==(t=this.persistence)?void 0:t.get_property(ci))||"identified"===(null==(i=this.sessionPersistence)?void 0:i.get_property(ci))}Zr(){var t,i;return!("never"===this.config.person_profiles||"identified_only"===this.config.person_profiles&&!this._isIdentified()&&F(this.getGroups())&&(null==(t=this.persistence)||null==(t=t.props)||!t[Gt])&&(null==(i=this.persistence)||null==(i=i.props)||!i[yi]))}Yr(){return!0===this.config.capture_pageleave||"if_capture_pageview"===this.config.capture_pageleave&&(!0===this.config.capture_pageview||"history_change"===this.config.capture_pageview)}createPersonProfile(){this.Zr()||this.ts("posthog.createPersonProfile")&&this.setPersonProperties({},{})}ts(t){return"never"===this.config.person_profiles?(Pt.error(t+' was called, but process_person is set to "never". This call will be ignored.'),!1):(this.es(yi,!0),!0)}Nr(){if("always"===this.config.cookieless_mode)return!0;var t=this.consent.isOptedOut(),i=this.config.opt_out_persistence_by_default||"on_reject"===this.config.cookieless_mode;return this.config.disable_persistence||t&&!!i}rs(){var t,i,e,r,s=this.Nr();(null==(t=this.persistence)?void 0:t.bi)!==s&&(null==(e=this.persistence)||e.set_disabled(s));(null==(i=this.sessionPersistence)?void 0:i.bi)!==s&&(null==(r=this.sessionPersistence)||r.set_disabled(s));return s}opt_in_capturing(t){var i;if("always"!==this.config.cookieless_mode){var e,r;if("on_reject"===this.config.cookieless_mode&&this.consent.isExplicitlyOptedOut())this.reset(!0),null==(e=this.sessionManager)||e.destroy(),this.sessionManager=new bo(this),this.persistence&&(this.sessionPropsManager=new mo(this,this.sessionManager,this.persistence)),this.sessionRecording=new Ao(this),this.sessionRecording.startIfEnabledOrStop();if(this.consent.optInOut(!0),this.rs(),this.Jr(),null==(i=this.sessionRecording)||i.startIfEnabledOrStop(),"on_reject"==this.config.cookieless_mode&&this.surveys.loadIfEnabled(),M(null==t?void 0:t.captureEventName)||null!=t&&t.captureEventName)this.capture(null!==(r=null==t?void 0:t.captureEventName)&&void 0!==r?r:"$opt_in",null==t?void 0:t.captureProperties,{send_instantly:!0});this.config.capture_pageview&&this.Kr()}else Pt.warn('Consent opt in/out is not valid with cookieless_mode="always" and will be ignored')}opt_out_capturing(){var t,i;"always"!==this.config.cookieless_mode?("on_reject"===this.config.cookieless_mode&&this.consent.isOptedIn()&&this.reset(!0),this.consent.optInOut(!1),this.rs(),"on_reject"===this.config.cookieless_mode&&(this.register({distinct_id:wi,$device_id:null}),null==(t=this.sessionManager)||t.destroy(),this.sessionManager=void 0,this.sessionPropsManager=void 0,null==(i=this.sessionRecording)||i.stopRecording(),this.sessionRecording=void 0,this.Kr())):Pt.warn('Consent opt in/out is not valid with cookieless_mode="always" and will be ignored')}has_opted_in_capturing(){return this.consent.isOptedIn()}has_opted_out_capturing(){return this.consent.isOptedOut()}get_explicit_consent_status(){var t=this.consent.consent;return t===Ne.GRANTED?"granted":t===Ne.DENIED?"denied":"pending"}is_capturing(){return"always"===this.config.cookieless_mode||("on_reject"===this.config.cookieless_mode?this.consent.isExplicitlyOptedOut()||this.consent.isOptedIn():!this.has_opted_out_capturing())}clear_opt_in_out_capturing(){this.consent.reset(),this.rs()}_is_bot(){return n?So(n,this.config.custom_blocked_useragents):void 0}Kr(){o&&("visible"===o.visibilityState?this.Fr||(this.Fr=!0,this.capture("$pageview",{title:o.title},{send_instantly:!0}),this.Mr&&(o.removeEventListener("visibilitychange",this.Mr),this.Mr=null)):this.Mr||(this.Mr=this.Kr.bind(this),qt(o,"visibilitychange",this.Mr)))}debug(i){!1===i?(null==t||t.console.log("You've disabled debug mode."),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)`."),this.set_config({debug:!0}))}O(){var t,i,e,r,s,n,o,a=this.jr||{};return"advanced_disable_flags"in a?!!a.advanced_disable_flags:!1!==this.config.advanced_disable_flags?!!this.config.advanced_disable_flags:!0===this.config.advanced_disable_decide?(Pt.warn("Config field 'advanced_disable_decide' is deprecated. Please use 'advanced_disable_flags' instead. The old field will be removed in a future major version."),!0):(e="advanced_disable_decide",r=!1,s=Pt,n=(i="advanced_disable_flags")in(t=a)&&!M(t[i]),o=e in t&&!M(t[e]),n?t[i]:o?(s&&s.warn("Config field '"+e+"' is deprecated. Please use '"+i+"' instead. The old field will be removed in a future major version."),t[e]):r)}Qr(t){if(j(this.config.before_send))return t;var i=C(this.config.before_send)?this.config.before_send:[this.config.before_send],e=t;for(var r of i){if(e=r(e),j(e)){var s="Event '"+t.event+"' was rejected in beforeSend function";return z(t.event)?Pt.warn(s+". This can cause unexpected behavior."):Pt.info(s),null}e.properties&&!F(e.properties)||Pt.warn("Event '"+t.event+"' has no properties after beforeSend function, this is likely an error.")}return e}getPageViewId(){var t;return null==(t=this.pageViewManager.Vt)?void 0:t.pageViewId}captureTraceFeedback(t,i){this.capture("$ai_feedback",{$ai_trace_id:String(t),$ai_feedback_text:i})}captureTraceMetric(t,i,e){this.capture("$ai_metric",{$ai_trace_id:String(t),$ai_metric_name:i,$ai_metric_value:String(e)})}Dr(t){var i=N(t)&&!t,e=Fe.H()&&"true"===Fe.q("ph_debug");return!i&&(!!e||t)}}!function(t,i){for(var e=0;e<i.length;e++)t.prototype[i[e]]=Lt(t.prototype[i[e]])}(Bo,["identify"]);var qo,Wo={backgroundColor:"#ffffff",textColor:"#1d1f27",buttonColor:"#1d1f27",buttonTextColor:"#ffffff",borderRadius:8,borderColor:"#e5e7eb",whiteLabel:!1},Go=(qo=Do[Lo]=new Bo,function(){function i(){i.done||(i.done=!0,No=!1,Mt(Do,(function(t){t._dom_loaded()})))}null!=o&&o.addEventListener?"complete"===o.readyState?i():qt(o,"DOMContentLoaded",i,{capture:!1}):t&&Pt.error("Browser doesn't support `document.addEventListener` so PostHog couldn't be initialized")}(),qo);export{ne as COPY_AUTOCAPTURE_EVENT,oe as Compression,Wo as DEFAULT_PRODUCT_TOUR_APPEARANCE,Vn as DisplaySurveyType,Bo as PostHog,Wn as SurveyEventName,Gn as SurveyEventProperties,jn as SurveyEventType,Nn as SurveyPosition,Bn as SurveyQuestionBranchingType,Hn as SurveyQuestionType,qn as SurveySchedule,Un as SurveyTabPosition,zn as SurveyType,Ln as SurveyWidgetType,Go as default,Go as posthog,ae as severityLevels};
|
|
1
|
+
var t="undefined"!=typeof window?window:void 0,i="undefined"!=typeof globalThis?globalThis:t;"undefined"==typeof self&&(i.self=i),"undefined"==typeof File&&(i.File=function(){});var e=Array.prototype,r=e.forEach,s=e.indexOf,n=null==i?void 0:i.navigator,o=null==i?void 0:i.document,a=null==i?void 0:i.location,l=null==i?void 0:i.fetch,u=null!=i&&i.XMLHttpRequest&&"withCredentials"in new i.XMLHttpRequest?i.XMLHttpRequest:void 0,h=null==i?void 0:i.AbortController,d=null==n?void 0:n.userAgent,v=null!=t?t:{},c={DEBUG:!1,LIB_VERSION:"1.307.2"};function f(t,i,e,r,s,n,o){try{var a=t[n](o),l=a.value}catch(t){return void e(t)}a.done?i(l):Promise.resolve(l).then(r,s)}function p(t){return function(){var i=this,e=arguments;return new Promise((function(r,s){var n=t.apply(i,e);function o(t){f(n,r,s,o,a,"next",t)}function a(t){f(n,r,s,o,a,"throw",t)}o(void 0)}))}}function g(){return g=Object.assign?Object.assign.bind():function(t){for(var i=1;i<arguments.length;i++){var e=arguments[i];for(var r in e)({}).hasOwnProperty.call(e,r)&&(t[r]=e[r])}return t},g.apply(null,arguments)}function _(t,i){if(null==t)return{};var e={};for(var r in t)if({}.hasOwnProperty.call(t,r)){if(-1!==i.indexOf(r))continue;e[r]=t[r]}return e}var m=["amazonbot","amazonproductbot","app.hypefactors.com","applebot","archive.org_bot","awariobot","backlinksextendedbot","baiduspider","bingbot","bingpreview","chrome-lighthouse","dataforseobot","deepscan","duckduckbot","facebookexternal","facebookcatalog","http://yandex.com/bots","hubspot","ia_archiver","leikibot","linkedinbot","meta-externalagent","mj12bot","msnbot","nessus","petalbot","pinterest","prerender","rogerbot","screaming frog","sebot-wa","sitebulb","slackbot","slurp","trendictionbot","turnitin","twitterbot","vercel-screenshot","vercelbot","yahoo! slurp","yandexbot","zoombot","bot.htm","bot.php","(bot;","bot/","crawler","ahrefsbot","ahrefssiteaudit","semrushbot","siteauditbot","splitsignalbot","gptbot","oai-searchbot","chatgpt-user","perplexitybot","better uptime bot","sentryuptimebot","uptimerobot","headlesschrome","cypress","google-hoteladsverifier","adsbot-google","apis-google","duplexweb-google","feedfetcher-google","google favicon","google web preview","google-read-aloud","googlebot","googleother","google-cloudvertexbot","googleweblight","mediapartners-google","storebot-google","google-inspectiontool","bytespider"],y=function(t,i){if(void 0===i&&(i=[]),!t)return!1;var e=t.toLowerCase();return m.concat(i).some((t=>{var i=t.toLowerCase();return-1!==e.indexOf(i)}))},b=["$snapshot","$pageview","$pageleave","$set","survey dismissed","survey sent","survey shown","$identify","$groupidentify","$create_alias","$$client_ingestion_warning","$web_experiment_applied","$feature_enrollment_update","$feature_flag_called"];function w(t,i){return-1!==t.indexOf(i)}var x=function(t){return t.trim()},E=function(t){return t.replace(/^\$/,"")};var S=Array.isArray,k=Object.prototype,P=k.hasOwnProperty,T=k.toString,C=S||function(t){return"[object Array]"===T.call(t)},R=t=>"function"==typeof t,I=t=>t===Object(t)&&!C(t),F=t=>{if(I(t)){for(var i in t)if(P.call(t,i))return!1;return!0}return!1},M=t=>void 0===t,O=t=>"[object String]"==T.call(t),A=t=>O(t)&&0===t.trim().length,D=t=>null===t,j=t=>M(t)||D(t),L=t=>"[object Number]"==T.call(t),N=t=>"[object Boolean]"===T.call(t),U=t=>t instanceof FormData,z=t=>w(b,t);function H(t){return null===t||"object"!=typeof t}function B(t,i){return Object.prototype.toString.call(t)==="[object "+i+"]"}function q(t){return!M(Event)&&function(t,i){try{return t instanceof i}catch(t){return!1}}(t,Event)}var W=[!0,"true",1,"1","yes"],G=t=>w(W,t),V=[!1,"false",0,"0","no"];function J(t,i,e,r,s){return i>e&&(r.warn("min cannot be greater than max."),i=e),L(t)?t>e?(r.warn(" cannot be greater than max: "+e+". Using max value instead."),e):t<i?(r.warn(" cannot be less than min: "+i+". Using min value instead."),i):t:(r.warn(" must be a number. using max or fallback. max: "+e+", fallback: "+s),J(s||e,i,e,r))}class K{constructor(t){this.t={},this.i=t.i,this.o=J(t.bucketSize,0,100,t.h),this.m=J(t.refillRate,0,this.o,t.h),this.S=J(t.refillInterval,0,864e5,t.h)}$(t,i){var e=i-t.lastAccess,r=Math.floor(e/this.S);if(r>0){var s=r*this.m;t.tokens=Math.min(t.tokens+s,this.o),t.lastAccess=t.lastAccess+r*this.S}}consumeRateLimit(t){var i,e=Date.now(),r=String(t),s=this.t[r];return s?this.$(s,e):(s={tokens:this.o,lastAccess:e},this.t[r]=s),0===s.tokens||(s.tokens--,0===s.tokens&&(null==(i=this.i)||i.call(this,t)),0===s.tokens)}stop(){this.t={}}}var Y,X,Q,Z=t=>t instanceof Error;function tt(t){var i=globalThis._posthogChunkIds;if(i){var e=Object.keys(i);return Q&&e.length===X||(X=e.length,Q=e.reduce(((e,r)=>{Y||(Y={});var s=Y[r];if(s)e[s[0]]=s[1];else for(var n=t(r),o=n.length-1;o>=0;o--){var a=n[o],l=null==a?void 0:a.filename,u=i[r];if(l&&u){e[l]=u,Y[r]=[l,u];break}}return e}),{})),Q}}class it{constructor(t,i,e){void 0===e&&(e=[]),this.coercers=t,this.stackParser=i,this.modifiers=e}buildFromUnknown(t,i){void 0===i&&(i={});var e=i&&i.mechanism||{handled:!0,type:"generic"},r=this.buildCoercingContext(e,i,0).apply(t),s=this.buildParsingContext(),n=this.parseStacktrace(r,s);return{$exception_list:this.convertToExceptionList(n,e),$exception_level:"error"}}modifyFrames(t){var i=this;return p((function*(){for(var e of t)e.stacktrace&&e.stacktrace.frames&&C(e.stacktrace.frames)&&(e.stacktrace.frames=yield i.applyModifiers(e.stacktrace.frames));return t}))()}coerceFallback(t){var i;return{type:"Error",value:"Unknown error",stack:null==(i=t.syntheticException)?void 0:i.stack,synthetic:!0}}parseStacktrace(t,i){var e,r;return null!=t.cause&&(e=this.parseStacktrace(t.cause,i)),""!=t.stack&&null!=t.stack&&(r=this.applyChunkIds(this.stackParser(t.stack,t.synthetic?1:0),i.chunkIdMap)),g({},t,{cause:e,stack:r})}applyChunkIds(t,i){return t.map((t=>(t.filename&&i&&(t.chunk_id=i[t.filename]),t)))}applyCoercers(t,i){for(var e of this.coercers)if(e.match(t))return e.coerce(t,i);return this.coerceFallback(i)}applyModifiers(t){var i=this;return p((function*(){var e=t;for(var r of i.modifiers)e=yield r(e);return e}))()}convertToExceptionList(t,i){var e,r,s,n={type:t.type,value:t.value,mechanism:{type:null!==(e=i.type)&&void 0!==e?e:"generic",handled:null===(r=i.handled)||void 0===r||r,synthetic:null!==(s=t.synthetic)&&void 0!==s&&s}};t.stack&&(n.stacktrace={type:"raw",frames:t.stack});var o=[n];return null!=t.cause&&o.push(...this.convertToExceptionList(t.cause,g({},i,{handled:!0}))),o}buildParsingContext(){return{chunkIdMap:tt(this.stackParser)}}buildCoercingContext(t,i,e){void 0===e&&(e=0);var r=(e,r)=>{if(r<=4){var s=this.buildCoercingContext(t,i,r);return this.applyCoercers(e,s)}};return g({},i,{syntheticException:0==e?i.syntheticException:void 0,mechanism:t,apply:t=>r(t,e),next:t=>r(t,e+1)})}}var et="?";function rt(t,i,e,r,s){var n={platform:t,filename:i,function:"<anonymous>"===e?et:e,in_app:!0};return M(r)||(n.lineno=r),M(s)||(n.colno=s),n}var st=(t,i)=>{var e=-1!==t.indexOf("safari-extension"),r=-1!==t.indexOf("safari-web-extension");return e||r?[-1!==t.indexOf("@")?t.split("@")[0]:et,e?"safari-extension:"+i:"safari-web-extension:"+i]:[t,i]},nt=/^\s*at (\S+?)(?::(\d+))(?::(\d+))\s*$/i,ot=/^\s*at (?:(.+?\)(?: \[.+\])?|.*?) ?\((?:address at )?)?(?:async )?((?:<anonymous>|[-a-z]+:|.*bundle|\/)?.*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i,at=/\((\S*)(?::(\d+))(?::(\d+))\)/,lt=(t,i)=>{var e=nt.exec(t);if(e){var[,r,s,n]=e;return rt(i,r,et,+s,+n)}var o=ot.exec(t);if(o){if(o[2]&&0===o[2].indexOf("eval")){var a=at.exec(o[2]);a&&(o[2]=a[1],o[3]=a[2],o[4]=a[3])}var[l,u]=st(o[1]||et,o[2]);return rt(i,u,l,o[3]?+o[3]:void 0,o[4]?+o[4]:void 0)}},ut=/^\s*(.*?)(?:\((.*?)\))?(?:^|@)?((?:[-a-z]+)?:\/.*?|\[native code\]|[^@]*(?:bundle|\d+\.js)|\/[\w\-. /=]+)(?::(\d+))?(?::(\d+))?\s*$/i,ht=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i,dt=(t,i)=>{var e=ut.exec(t);if(e){if(e[3]&&e[3].indexOf(" > eval")>-1){var r=ht.exec(e[3]);r&&(e[1]=e[1]||"eval",e[3]=r[1],e[4]=r[2],e[5]="")}var s=e[3],n=e[1]||et;return[n,s]=st(n,s),rt(i,s,n,e[4]?+e[4]:void 0,e[5]?+e[5]:void 0)}},vt=/\(error: (.*)\)/,ct=50;function ft(t){for(var i=arguments.length,e=new Array(i>1?i-1:0),r=1;r<i;r++)e[r-1]=arguments[r];return function(i,r){void 0===r&&(r=0);for(var s=[],n=i.split("\n"),o=r;o<n.length;o++){var a=n[o];if(!(a.length>1024)){var l=vt.test(a)?a.replace(vt,"$1"):a;if(!l.match(/\S*Error: /)){for(var u of e){var h=u(l,t);if(h){s.push(h);break}}if(s.length>=ct)break}}}return function(t){if(!t.length)return[];var i=Array.from(t);return i.reverse(),i.slice(0,ct).map((t=>{return g({},t,{filename:t.filename||(e=i,e[e.length-1]||{}).filename,function:t.function||et});var e}))}(s)}}class pt{match(t){return this.isDOMException(t)||this.isDOMError(t)}coerce(t,i){var e=O(t.stack);return{type:this.getType(t),value:this.getValue(t),stack:e?t.stack:void 0,cause:t.cause?i.next(t.cause):void 0,synthetic:!1}}getType(t){return this.isDOMError(t)?"DOMError":"DOMException"}getValue(t){var i=t.name||(this.isDOMError(t)?"DOMError":"DOMException");return t.message?i+": "+t.message:i}isDOMException(t){return B(t,"DOMException")}isDOMError(t){return B(t,"DOMError")}}class gt{match(t){return(t=>t instanceof Error)(t)}coerce(t,i){return{type:this.getType(t),value:this.getMessage(t,i),stack:this.getStack(t),cause:t.cause?i.next(t.cause):void 0,synthetic:!1}}getType(t){return t.name||t.constructor.name}getMessage(t,i){var e=t.message;return e.error&&"string"==typeof e.error.message?String(e.error.message):String(e)}getStack(t){return t.stacktrace||t.stack||void 0}}class _t{constructor(){}match(t){return B(t,"ErrorEvent")&&null!=t.error}coerce(t,i){var e,r=i.apply(t.error);return r||{type:"ErrorEvent",value:t.message,stack:null==(e=i.syntheticException)?void 0:e.stack,synthetic:!0}}}var mt=/^(?:[Uu]ncaught (?:exception: )?)?(?:((?:Eval|Internal|Range|Reference|Syntax|Type|URI|)Error): )?(.*)$/i;class yt{match(t){return"string"==typeof t}coerce(t,i){var e,[r,s]=this.getInfos(t);return{type:null!=r?r:"Error",value:null!=s?s:t,stack:null==(e=i.syntheticException)?void 0:e.stack,synthetic:!0}}getInfos(t){var i="Error",e=t,r=t.match(mt);return r&&(i=r[1],e=r[2]),[i,e]}}var bt=["fatal","error","warning","log","info","debug"];function wt(t,i){void 0===i&&(i=40);var e=Object.keys(t);if(e.sort(),!e.length)return"[object has no keys]";for(var r=e.length;r>0;r--){var s=e.slice(0,r).join(", ");if(!(s.length>i))return r===e.length||s.length<=i?s:s.slice(0,i)+"..."}return""}class xt{match(t){return"object"==typeof t&&null!==t}coerce(t,i){var e,r=this.getErrorPropertyFromObject(t);return r?i.apply(r):{type:this.getType(t),value:this.getValue(t),stack:null==(e=i.syntheticException)?void 0:e.stack,level:this.isSeverityLevel(t.level)?t.level:"error",synthetic:!0}}getType(t){return q(t)?t.constructor.name:"Error"}getValue(t){if("name"in t&&"string"==typeof t.name){var i="'"+t.name+"' captured as exception";return"message"in t&&"string"==typeof t.message&&(i+=" with message: '"+t.message+"'"),i}if("message"in t&&"string"==typeof t.message)return t.message;var e=this.getObjectClassName(t);return(e&&"Object"!==e?"'"+e+"'":"Object")+" captured as exception with keys: "+wt(t)}isSeverityLevel(t){return O(t)&&!A(t)&&bt.indexOf(t)>=0}getErrorPropertyFromObject(t){for(var i in t)if(Object.prototype.hasOwnProperty.call(t,i)){var e=t[i];if(Z(e))return e}}getObjectClassName(t){try{var i=Object.getPrototypeOf(t);return i?i.constructor.name:void 0}catch(t){return}}}class Et{match(t){return q(t)}coerce(t,i){var e,r=t.constructor.name;return{type:r,value:r+" captured as exception with keys: "+wt(t),stack:null==(e=i.syntheticException)?void 0:e.stack,synthetic:!0}}}class St{match(t){return H(t)}coerce(t,i){var e;return{type:"Error",value:"Primitive value captured as exception: "+String(t),stack:null==(e=i.syntheticException)?void 0:e.stack,synthetic:!0}}}class $t{match(t){return B(t,"PromiseRejectionEvent")}coerce(t,i){var e,r=this.getUnhandledRejectionReason(t);return H(r)?{type:"UnhandledRejection",value:"Non-Error promise rejection captured with value: "+String(r),stack:null==(e=i.syntheticException)?void 0:e.stack,synthetic:!0}:i.apply(r)}getUnhandledRejectionReason(t){if(H(t))return t;try{if("reason"in t)return t.reason;if("detail"in t&&"reason"in t.detail)return t.detail.reason}catch(t){}return t}}var kt=function(i,e){var{debugEnabled:r}=void 0===e?{}:e,s={k:function(e){if(t&&(c.DEBUG||v.POSTHOG_DEBUG||r)&&!M(t.console)&&t.console){for(var s=("__rrweb_original__"in t.console[e]?t.console[e].__rrweb_original__:t.console[e]),n=arguments.length,o=new Array(n>1?n-1:0),a=1;a<n;a++)o[a-1]=arguments[a];s(i,...o)}},info:function(){for(var t=arguments.length,i=new Array(t),e=0;e<t;e++)i[e]=arguments[e];s.k("log",...i)},warn:function(){for(var t=arguments.length,i=new Array(t),e=0;e<t;e++)i[e]=arguments[e];s.k("warn",...i)},error:function(){for(var t=arguments.length,i=new Array(t),e=0;e<t;e++)i[e]=arguments[e];s.k("error",...i)},critical:function(){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];console.error(i,...e)},uninitializedWarning:t=>{s.error("You must initialize PostHog before calling "+t)},createLogger:(t,e)=>kt(i+" "+t,e)};return s},Pt=kt("[PostHog.js]"),Tt=Pt.createLogger,Ct=Tt("[ExternalScriptsLoader]"),Rt=(t,i,e)=>{if(t.config.disable_external_dependency_loading)return Ct.warn(i+" was requested but loading of external scripts is disabled."),e("Loading of external scripts is disabled");var r=null==o?void 0:o.querySelectorAll("script");if(r)for(var s,n=function(){if(r[a].src===i){var t=r[a];return t.__posthog_loading_callback_fired?{v:e()}:(t.addEventListener("load",(i=>{t.__posthog_loading_callback_fired=!0,e(void 0,i)})),t.onerror=t=>e(t),{v:void 0})}},a=0;a<r.length;a++)if(s=n())return s.v;var l=()=>{if(!o)return e("document not found");var r=o.createElement("script");if(r.type="text/javascript",r.crossOrigin="anonymous",r.src=i,r.onload=t=>{r.__posthog_loading_callback_fired=!0,e(void 0,t)},r.onerror=t=>e(t),t.config.prepare_external_dependency_script&&(r=t.config.prepare_external_dependency_script(r)),!r)return e("prepare_external_dependency_script returned null");var s,n=o.querySelectorAll("body > script");n.length>0?null==(s=n[0].parentNode)||s.insertBefore(r,n[0]):o.body.appendChild(r)};null!=o&&o.body?l():null==o||o.addEventListener("DOMContentLoaded",l)};v.__PosthogExtensions__=v.__PosthogExtensions__||{},v.__PosthogExtensions__.loadExternalDependency=(t,i,e)=>{var r="/static/"+i+".js?v="+t.version;if("remote-config"===i&&(r="/array/"+t.config.token+"/config.js"),"toolbar"===i){var s=3e5;r=r+"&t="+Math.floor(Date.now()/s)*s}var n=t.requestRouter.endpointFor("assets",r);Rt(t,n,e)},v.__PosthogExtensions__.loadSiteApp=(t,i,e)=>{var r=t.requestRouter.endpointFor("api",i);Rt(t,r,e)};var It={};function Ft(t,i,e){if(C(t))if(r&&t.forEach===r)t.forEach(i,e);else if("length"in t&&t.length===+t.length)for(var s=0,n=t.length;s<n;s++)if(s in t&&i.call(e,t[s],s)===It)return}function Mt(t,i,e){if(!j(t)){if(C(t))return Ft(t,i,e);if(U(t)){for(var r of t.entries())if(i.call(e,r[1],r[0])===It)return}else for(var s in t)if(P.call(t,s)&&i.call(e,t[s],s)===It)return}}var Ot=function(t){for(var i=arguments.length,e=new Array(i>1?i-1:0),r=1;r<i;r++)e[r-1]=arguments[r];return Ft(e,(function(i){for(var e in i)void 0!==i[e]&&(t[e]=i[e])})),t},At=function(t){for(var i=arguments.length,e=new Array(i>1?i-1:0),r=1;r<i;r++)e[r-1]=arguments[r];return Ft(e,(function(i){Ft(i,(function(i){t.push(i)}))})),t};function Dt(t){for(var i=Object.keys(t),e=i.length,r=new Array(e);e--;)r[e]=[i[e],t[i[e]]];return r}var jt=function(t){try{return t()}catch(t){return}},Lt=function(t){return function(){try{for(var i=arguments.length,e=new Array(i),r=0;r<i;r++)e[r]=arguments[r];return t.apply(this,e)}catch(t){Pt.critical("Implementation error. Please turn on debug mode and open a ticket on https://app.posthog.com/home#panel=support%3Asupport%3A."),Pt.critical(t)}}},Nt=function(t){var i={};return Mt(t,(function(t,e){(O(t)&&t.length>0||L(t))&&(i[e]=t)})),i};function Ut(t,i){return e=t,r=t=>O(t)&&!D(i)?t.slice(0,i):t,s=new Set,function t(i,e){return i!==Object(i)?r?r(i,e):i:s.has(i)?void 0:(s.add(i),C(i)?(n=[],Ft(i,(i=>{n.push(t(i))}))):(n={},Mt(i,((i,e)=>{s.has(i)||(n[e]=t(i,e))}))),n);var n}(e);var e,r,s}var zt=["herokuapp.com","vercel.app","netlify.app"];function Ht(t){var i=null==t?void 0:t.hostname;if(!O(i))return!1;var e=i.split(".").slice(-2).join(".");for(var r of zt)if(e===r)return!1;return!0}function Bt(t,i){for(var e=0;e<t.length;e++)if(i(t[e]))return t[e]}function qt(t,i,e,r){var{capture:s=!1,passive:n=!0}=null!=r?r:{};null==t||t.addEventListener(i,e,{capture:s,passive:n})}var Wt="$people_distinct_id",Gt="__alias",Vt="__timers",Jt="$autocapture_disabled_server_side",Kt="$heatmaps_enabled_server_side",Yt="$exception_capture_enabled_server_side",Xt="$error_tracking_suppression_rules",Qt="$error_tracking_capture_extension_exceptions",Zt="$web_vitals_enabled_server_side",ti="$dead_clicks_enabled_server_side",ii="$web_vitals_allowed_metrics",ei="$session_recording_remote_config",ri="$sesid",si="$session_is_sampled",ni="$enabled_feature_flags",oi="$early_access_features",ai="$feature_flag_details",li="$stored_person_properties",ui="$stored_group_properties",hi="$surveys",di="$surveys_activated",vi="$flag_call_reported",ci="$user_state",fi="$client_session_props",pi="$capture_rate_limit",gi="$initial_campaign_params",_i="$initial_referrer_info",mi="$initial_person_info",yi="$epp",bi="__POSTHOG_TOOLBAR__",wi="$posthog_cookieless",xi=[Wt,Gt,"__cmpns",Vt,"$session_recording_enabled_server_side",Kt,ri,ni,Xt,ci,oi,ai,ui,li,hi,vi,fi,pi,gi,_i,yi,mi,"$conversations_widget_session_id","$conversations_ticket_id","$conversations_widget_state","$conversations_user_traits"];function Ei(t){return t instanceof Element&&(t.id===bi||!(null==t.closest||!t.closest(".toolbar-global-fade-container")))}function Si(t){return!!t&&1===t.nodeType}function $i(t,i){return!!t&&!!t.tagName&&t.tagName.toLowerCase()===i.toLowerCase()}function ki(t){return!!t&&3===t.nodeType}function Pi(t){return!!t&&11===t.nodeType}function Ti(t){return t?x(t).split(/\s+/):[]}function Ci(i){var e=null==t?void 0:t.location.href;return!!(e&&i&&i.some((t=>e.match(t))))}function Ri(t){var i="";switch(typeof t.className){case"string":i=t.className;break;case"object":i=(t.className&&"baseVal"in t.className?t.className.baseVal:null)||t.getAttribute("class")||"";break;default:i=""}return Ti(i)}function Ii(t){return j(t)?null:x(t).split(/(\s+)/).filter((t=>Qi(t))).join("").replace(/[\r\n]/g," ").replace(/[ ]+/g," ").substring(0,255)}function Fi(t){var i="";return qi(t)&&!Wi(t)&&t.childNodes&&t.childNodes.length&&Mt(t.childNodes,(function(t){var e;ki(t)&&t.textContent&&(i+=null!==(e=Ii(t.textContent))&&void 0!==e?e:"")})),x(i)}function Mi(t){return M(t.target)?t.srcElement||null:null!=(i=t.target)&&i.shadowRoot?t.composedPath()[0]||null:t.target||null;var i}var Oi=["a","button","form","input","select","textarea","label"];function Ai(t,i){if(M(i))return!0;var e,r=function(t){if(i.some((i=>t.matches(i))))return{v:!0}};for(var s of t)if(e=r(s))return e.v;return!1}function Di(t){var i=t.parentNode;return!(!i||!Si(i))&&i}var ji=["next","previous","prev",">","<"],Li=10;var Ni=[".ph-no-rageclick",".ph-no-capture"];function Ui(i,e){if(!t||zi(i))return!1;var r,s,n;N(e)?(r=!!e&&Ni,s=void 0):(r=null!==(n=null==e?void 0:e.css_selector_ignorelist)&&void 0!==n?n:Ni,s=null==e?void 0:e.content_ignorelist);if(!1===r)return!1;var{targetElementList:o}=Hi(i,!1);return!function(t,i){if(!1===t||M(t))return!1;var e;if(!0===t)e=ji;else{if(!C(t))return!1;if(t.length>Li)return Pt.error("[PostHog] content_ignorelist array cannot exceed "+Li+" items. Use css_selector_ignorelist for more complex matching."),!1;e=t.map((t=>t.toLowerCase()))}return i.some((t=>{var{safeText:i,ariaLabel:r}=t;return e.some((t=>i.includes(t)||r.includes(t)))}))}(s,o.map((t=>{var i;return{safeText:Fi(t).toLowerCase(),ariaLabel:(null==(i=t.getAttribute("aria-label"))?void 0:i.toLowerCase().trim())||""}})))&&!Ai(o,r)}var zi=t=>!t||$i(t,"html")||!Si(t),Hi=(i,e)=>{if(!t||zi(i))return{parentIsUsefulElement:!1,targetElementList:[]};for(var r=!1,s=[i],n=i;n.parentNode&&!$i(n,"body");)if(Pi(n.parentNode))s.push(n.parentNode.host),n=n.parentNode.host;else{var o=Di(n);if(!o)break;if(e||Oi.indexOf(o.tagName.toLowerCase())>-1)r=!0;else{var a=t.getComputedStyle(o);a&&"pointer"===a.getPropertyValue("cursor")&&(r=!0)}s.push(o),n=o}return{parentIsUsefulElement:r,targetElementList:s}};function Bi(i,e,r,s,n){var o,a,l,u;if(void 0===r&&(r=void 0),!t||zi(i))return!1;if(null!=(o=r)&&o.url_allowlist&&!Ci(r.url_allowlist))return!1;if(null!=(a=r)&&a.url_ignorelist&&Ci(r.url_ignorelist))return!1;if(null!=(l=r)&&l.dom_event_allowlist){var h=r.dom_event_allowlist;if(h&&!h.some((t=>e.type===t)))return!1}var{parentIsUsefulElement:d,targetElementList:v}=Hi(i,s);if(!function(t,i){var e=null==i?void 0:i.element_allowlist;if(M(e))return!0;var r,s=function(t){if(e.some((i=>t.tagName.toLowerCase()===i)))return{v:!0}};for(var n of t)if(r=s(n))return r.v;return!1}(v,r))return!1;if(!Ai(v,null==(u=r)?void 0:u.css_selector_allowlist))return!1;var c=t.getComputedStyle(i);if(c&&"pointer"===c.getPropertyValue("cursor")&&"click"===e.type)return!0;var f=i.tagName.toLowerCase();switch(f){case"html":return!1;case"form":return(n||["submit"]).indexOf(e.type)>=0;case"input":case"select":case"textarea":return(n||["change","click"]).indexOf(e.type)>=0;default:return d?(n||["click"]).indexOf(e.type)>=0:(n||["click"]).indexOf(e.type)>=0&&(Oi.indexOf(f)>-1||"true"===i.getAttribute("contenteditable"))}}function qi(t){for(var i=t;i.parentNode&&!$i(i,"body");i=i.parentNode){var e=Ri(i);if(w(e,"ph-sensitive")||w(e,"ph-no-capture"))return!1}if(w(Ri(t),"ph-include"))return!0;var r=t.type||"";if(O(r))switch(r.toLowerCase()){case"hidden":case"password":return!1}var s=t.name||t.id||"";if(O(s)){if(/^cc|cardnum|ccnum|creditcard|csc|cvc|cvv|exp|pass|pwd|routing|seccode|securitycode|securitynum|socialsec|socsec|ssn/i.test(s.replace(/[^a-zA-Z0-9]/g,"")))return!1}return!0}function Wi(t){return!!($i(t,"input")&&!["button","checkbox","submit","reset"].includes(t.type)||$i(t,"select")||$i(t,"textarea")||"true"===t.getAttribute("contenteditable"))}var Gi="(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})",Vi=new RegExp("^(?:"+Gi+")$"),Ji=new RegExp(Gi),Ki="\\d{3}-?\\d{2}-?\\d{4}",Yi=new RegExp("^("+Ki+")$"),Xi=new RegExp("("+Ki+")");function Qi(t,i){if(void 0===i&&(i=!0),j(t))return!1;if(O(t)){if(t=x(t),(i?Vi:Ji).test((t||"").replace(/[- ]/g,"")))return!1;if((i?Yi:Xi).test(t))return!1}return!0}function Zi(t){var i=Fi(t);return Qi(i=(i+" "+te(t)).trim())?i:""}function te(t){var i="";return t&&t.childNodes&&t.childNodes.length&&Mt(t.childNodes,(function(t){var e;if(t&&"span"===(null==(e=t.tagName)?void 0:e.toLowerCase()))try{var r=Fi(t);i=(i+" "+r).trim(),t.childNodes&&t.childNodes.length&&(i=(i+" "+te(t)).trim())}catch(t){Pt.error("[AutoCapture]",t)}})),i}function ie(t){return function(t){var i=t.map((t=>{var i,e,r="";if(t.tag_name&&(r+=t.tag_name),t.attr_class)for(var s of(t.attr_class.sort(),t.attr_class))r+="."+s.replace(/"/g,"");var n=g({},t.text?{text:t.text}:{},{"nth-child":null!==(i=t.nth_child)&&void 0!==i?i:0,"nth-of-type":null!==(e=t.nth_of_type)&&void 0!==e?e:0},t.href?{href:t.href}:{},t.attr_id?{attr_id:t.attr_id}:{},t.attributes),o={};return Dt(n).sort(((t,i)=>{var[e]=t,[r]=i;return e.localeCompare(r)})).forEach((t=>{var[i,e]=t;return o[ee(i.toString())]=ee(e.toString())})),r+=":",r+=Dt(o).map((t=>{var[i,e]=t;return i+'="'+e+'"'})).join("")}));return i.join(";")}(function(t){return t.map((t=>{var i,e,r={text:null==(i=t.$el_text)?void 0:i.slice(0,400),tag_name:t.tag_name,href:null==(e=t.attr__href)?void 0:e.slice(0,2048),attr_class:re(t),attr_id:t.attr__id,nth_child:t.nth_child,nth_of_type:t.nth_of_type,attributes:{}};return Dt(t).filter((t=>{var[i]=t;return 0===i.indexOf("attr__")})).forEach((t=>{var[i,e]=t;return r.attributes[i]=e})),r}))}(t))}function ee(t){return t.replace(/"|\\"/g,'\\"')}function re(t){var i=t.attr__class;return i?C(i)?i:Ti(i):void 0}class se{constructor(t){this.disabled=!1===t;var i=I(t)?t:{};this.thresholdPx=i.threshold_px||30,this.timeoutMs=i.timeout_ms||1e3,this.clickCount=i.click_count||3,this.clicks=[]}isRageClick(t,i,e){if(this.disabled)return!1;var r=this.clicks[this.clicks.length-1];if(r&&Math.abs(t-r.x)+Math.abs(i-r.y)<this.thresholdPx&&e-r.timestamp<this.timeoutMs){if(this.clicks.push({x:t,y:i,timestamp:e}),this.clicks.length===this.clickCount)return!0}else this.clicks=[{x:t,y:i,timestamp:e}];return!1}}var ne="$copy_autocapture",oe=function(t){return t.GZipJS="gzip-js",t.Base64="base64",t}({}),ae=["fatal","error","warning","log","info","debug"],le=t=>{var i=null==o?void 0:o.createElement("a");return M(i)?null:(i.href=t,i)},ue=function(t,i){var e,r;void 0===i&&(i="&");var s=[];return Mt(t,(function(t,i){M(t)||M(i)||"undefined"===i||(e=encodeURIComponent((t=>t instanceof File)(t)?t.name:t.toString()),r=encodeURIComponent(i),s[s.length]=r+"="+e)})),s.join(i)},he=function(t,i){for(var e,r=((t.split("#")[0]||"").split(/\?(.*)/)[1]||"").replace(/^\?+/g,"").split("&"),s=0;s<r.length;s++){var n=r[s].split("=");if(n[0]===i){e=n;break}}if(!C(e)||e.length<2)return"";var o=e[1];try{o=decodeURIComponent(o)}catch(t){Pt.error("Skipping decoding for malformed query param: "+o)}return o.replace(/\+/g," ")},de=function(t,i,e){if(!t||!i||!i.length)return t;for(var r=t.split("#"),s=r[0]||"",n=r[1],o=s.split("?"),a=o[1],l=o[0],u=(a||"").split("&"),h=[],d=0;d<u.length;d++){var v=u[d].split("=");C(v)&&(i.includes(v[0])?h.push(v[0]+"="+e):h.push(u[d]))}var c=l;return null!=a&&(c+="?"+h.join("&")),null!=n&&(c+="#"+n),c},ve=function(t,i){var e=t.match(new RegExp(i+"=([^&]*)"));return e?e[1]:null},ce=Tt("[AutoCapture]");function fe(t,i){return i.length>t?i.slice(0,t)+"...":i}function pe(t){if(t.previousElementSibling)return t.previousElementSibling;var i=t;do{i=i.previousSibling}while(i&&!Si(i));return i}function ge(t,i,e,r){var s=t.tagName.toLowerCase(),n={tag_name:s};Oi.indexOf(s)>-1&&!e&&("a"===s.toLowerCase()||"button"===s.toLowerCase()?n.$el_text=fe(1024,Zi(t)):n.$el_text=fe(1024,Fi(t)));var o=Ri(t);o.length>0&&(n.classes=o.filter((function(t){return""!==t}))),Mt(t.attributes,(function(e){var s;if((!Wi(t)||-1!==["name","id","class","aria-label"].indexOf(e.name))&&((null==r||!r.includes(e.name))&&!i&&Qi(e.value)&&(s=e.name,!O(s)||"_ngcontent"!==s.substring(0,10)&&"_nghost"!==s.substring(0,7)))){var o=e.value;"class"===e.name&&(o=Ti(o).join(" ")),n["attr__"+e.name]=fe(1024,o)}}));for(var a=1,l=1,u=t;u=pe(u);)a++,u.tagName===t.tagName&&l++;return n.nth_child=a,n.nth_of_type=l,n}function _e(i,e){for(var r,s,{e:n,maskAllElementAttributes:o,maskAllText:a,elementAttributeIgnoreList:l,elementsChainAsString:u}=e,h=[i],d=i;d.parentNode&&!$i(d,"body");)Pi(d.parentNode)?(h.push(d.parentNode.host),d=d.parentNode.host):(h.push(d.parentNode),d=d.parentNode);var v,c=[],f={},p=!1,g=!1;if(Mt(h,(t=>{var i=qi(t);"a"===t.tagName.toLowerCase()&&(p=t.getAttribute("href"),p=i&&p&&Qi(p)&&p),w(Ri(t),"ph-no-capture")&&(g=!0),c.push(ge(t,o,a,l));var e=function(t){if(!qi(t))return{};var i={};return Mt(t.attributes,(function(t){if(t.name&&0===t.name.indexOf("data-ph-capture-attribute")){var e=t.name.replace("data-ph-capture-attribute-",""),r=t.value;e&&r&&Qi(r)&&(i[e]=r)}})),i}(t);Ot(f,e)})),g)return{props:{},explicitNoCapture:g};if(a||("a"===i.tagName.toLowerCase()||"button"===i.tagName.toLowerCase()?c[0].$el_text=Zi(i):c[0].$el_text=Fi(i)),p){var _,m;c[0].attr__href=p;var y=null==(_=le(p))?void 0:_.host,b=null==t||null==(m=t.location)?void 0:m.host;y&&b&&y!==b&&(v=p)}return{props:Ot({$event_type:n.type,$ce_version:1},u?{}:{$elements:c},{$elements_chain:ie(c)},null!=(r=c[0])&&r.$el_text?{$el_text:null==(s=c[0])?void 0:s.$el_text}:{},v&&"click"===n.type?{$external_click_url:v}:{},f)}}class me{constructor(t){this.P=!1,this.T=null,this.C=!1,this.instance=t,this.rageclicks=new se(t.config.rageclick),this.R=null}get I(){var t,i,e=I(this.instance.config.autocapture)?this.instance.config.autocapture:{};return e.url_allowlist=null==(t=e.url_allowlist)?void 0:t.map((t=>new RegExp(t))),e.url_ignorelist=null==(i=e.url_ignorelist)?void 0:i.map((t=>new RegExp(t))),e}F(){if(this.isBrowserSupported()){if(t&&o){var i=i=>{i=i||(null==t?void 0:t.event);try{this.M(i)}catch(t){ce.error("Failed to capture event",t)}};if(qt(o,"submit",i,{capture:!0}),qt(o,"change",i,{capture:!0}),qt(o,"click",i,{capture:!0}),this.I.capture_copied_text){var e=i=>{i=i||(null==t?void 0:t.event),this.M(i,ne)};qt(o,"copy",e,{capture:!0}),qt(o,"cut",e,{capture:!0})}}}else ce.info("Disabling Automatic Event Collection because this browser is not supported")}startIfEnabled(){this.isEnabled&&!this.P&&(this.F(),this.P=!0)}onRemoteConfig(t){t.elementsChainAsString&&(this.C=t.elementsChainAsString),this.instance.persistence&&this.instance.persistence.register({[Jt]:!!t.autocapture_opt_out}),this.T=!!t.autocapture_opt_out,this.startIfEnabled()}setElementSelectors(t){this.R=t}getElementSelectors(t){var i,e=[];return null==(i=this.R)||i.forEach((i=>{var r=null==o?void 0:o.querySelectorAll(i);null==r||r.forEach((r=>{t===r&&e.push(i)}))})),e}get isEnabled(){var t,i,e=null==(t=this.instance.persistence)?void 0:t.props[Jt],r=this.T;if(D(r)&&!N(e)&&!this.instance.O())return!1;var s=null!==(i=this.T)&&void 0!==i?i:!!e;return!!this.instance.config.autocapture&&!s}M(i,e){if(void 0===e&&(e="$autocapture"),this.isEnabled){var r,s=Mi(i);if(ki(s)&&(s=s.parentNode||null),"$autocapture"===e&&"click"===i.type&&i instanceof MouseEvent)this.instance.config.rageclick&&null!=(r=this.rageclicks)&&r.isRageClick(i.clientX,i.clientY,i.timeStamp||(new Date).getTime())&&Ui(s,this.instance.config.rageclick)&&this.M(i,"$rageclick");var n=e===ne;if(s&&Bi(s,i,this.I,n,n?["copy","cut"]:void 0)){var{props:o,explicitNoCapture:a}=_e(s,{e:i,maskAllElementAttributes:this.instance.config.mask_all_element_attributes,maskAllText:this.instance.config.mask_all_text,elementAttributeIgnoreList:this.I.element_attribute_ignorelist,elementsChainAsString:this.C});if(a)return!1;var l=this.getElementSelectors(s);if(l&&l.length>0&&(o.$element_selectors=l),e===ne){var u,h=Ii(null==t||null==(u=t.getSelection())?void 0:u.toString()),d=i.type||"clipboard";if(!h)return!1;o.$selected_content=h,o.$copy_type=d}return this.instance.capture(e,o),!0}}}isBrowserSupported(){return R(null==o?void 0:o.querySelectorAll)}}Math.trunc||(Math.trunc=function(t){return t<0?Math.ceil(t):Math.floor(t)}),Number.isInteger||(Number.isInteger=function(t){return L(t)&&isFinite(t)&&Math.floor(t)===t});var ye="0123456789abcdef";class be{constructor(t){if(this.bytes=t,16!==t.length)throw new TypeError("not 128-bit length")}static fromFieldsV7(t,i,e,r){if(!Number.isInteger(t)||!Number.isInteger(i)||!Number.isInteger(e)||!Number.isInteger(r)||t<0||i<0||e<0||r<0||t>0xffffffffffff||i>4095||e>1073741823||r>4294967295)throw new RangeError("invalid field value");var s=new Uint8Array(16);return s[0]=t/Math.pow(2,40),s[1]=t/Math.pow(2,32),s[2]=t/Math.pow(2,24),s[3]=t/Math.pow(2,16),s[4]=t/Math.pow(2,8),s[5]=t,s[6]=112|i>>>8,s[7]=i,s[8]=128|e>>>24,s[9]=e>>>16,s[10]=e>>>8,s[11]=e,s[12]=r>>>24,s[13]=r>>>16,s[14]=r>>>8,s[15]=r,new be(s)}toString(){for(var t="",i=0;i<this.bytes.length;i++)t=t+ye.charAt(this.bytes[i]>>>4)+ye.charAt(15&this.bytes[i]),3!==i&&5!==i&&7!==i&&9!==i||(t+="-");if(36!==t.length)throw new Error("Invalid UUIDv7 was generated");return t}clone(){return new be(this.bytes.slice(0))}equals(t){return 0===this.compareTo(t)}compareTo(t){for(var i=0;i<16;i++){var e=this.bytes[i]-t.bytes[i];if(0!==e)return Math.sign(e)}return 0}}class we{constructor(){this.A=0,this.D=0,this.j=new Se}generate(){var t=this.generateOrAbort();if(M(t)){this.A=0;var i=this.generateOrAbort();if(M(i))throw new Error("Could not generate UUID after timestamp reset");return i}return t}generateOrAbort(){var t=Date.now();if(t>this.A)this.A=t,this.L();else{if(!(t+1e4>this.A))return;this.D++,this.D>4398046511103&&(this.A++,this.L())}return be.fromFieldsV7(this.A,Math.trunc(this.D/Math.pow(2,30)),this.D&Math.pow(2,30)-1,this.j.nextUint32())}L(){this.D=1024*this.j.nextUint32()+(1023&this.j.nextUint32())}}var xe,Ee=t=>{if("undefined"!=typeof UUIDV7_DENY_WEAK_RNG&&UUIDV7_DENY_WEAK_RNG)throw new Error("no cryptographically strong RNG available");for(var i=0;i<t.length;i++)t[i]=65536*Math.trunc(65536*Math.random())+Math.trunc(65536*Math.random());return t};t&&!M(t.crypto)&&crypto.getRandomValues&&(Ee=t=>crypto.getRandomValues(t));class Se{constructor(){this.N=new Uint32Array(8),this.U=1/0}nextUint32(){return this.U>=this.N.length&&(Ee(this.N),this.U=0),this.N[this.U++]}}var $e=()=>ke().toString(),ke=()=>(xe||(xe=new we)).generate(),Pe="";var Te=/[a-z0-9][a-z0-9-]+\.[a-z]{2,}$/i;function Ce(t,i){if(i){var e=function(t,i){if(void 0===i&&(i=o),Pe)return Pe;if(!i)return"";if(["localhost","127.0.0.1"].includes(t))return"";for(var e=t.split("."),r=Math.min(e.length,8),s="dmn_chk_"+$e();!Pe&&r--;){var n=e.slice(r).join("."),a=s+"=1;domain=."+n+";path=/";i.cookie=a+";max-age=3",i.cookie.includes(s)&&(i.cookie=a+";max-age=0",Pe=n)}return Pe}(t);if(!e){var r=(t=>{var i=t.match(Te);return i?i[0]:""})(t);r!==e&&Pt.info("Warning: cookie subdomain discovery mismatch",r,e),e=r}return e?"; domain=."+e:""}return""}var Re={H:()=>!!o,B:function(t){Pt.error("cookieStore error: "+t)},q:function(t){if(o){try{for(var i=t+"=",e=o.cookie.split(";").filter((t=>t.length)),r=0;r<e.length;r++){for(var s=e[r];" "==s.charAt(0);)s=s.substring(1,s.length);if(0===s.indexOf(i))return decodeURIComponent(s.substring(i.length,s.length))}}catch(t){}return null}},W:function(t){var i;try{i=JSON.parse(Re.q(t))||{}}catch(t){}return i},G:function(t,i,e,r,s){if(o)try{var n="",a="",l=Ce(o.location.hostname,r);if(e){var u=new Date;u.setTime(u.getTime()+24*e*60*60*1e3),n="; expires="+u.toUTCString()}s&&(a="; secure");var h=t+"="+encodeURIComponent(JSON.stringify(i))+n+"; SameSite=Lax; path=/"+l+a;return h.length>3686.4&&Pt.warn("cookieStore warning: large cookie, len="+h.length),o.cookie=h,h}catch(t){return}},V:function(t,i){if(null!=o&&o.cookie)try{Re.G(t,"",-1,i)}catch(t){return}}},Ie=null,Fe={H:function(){if(!D(Ie))return Ie;var i=!0;if(M(t))i=!1;else try{var e="__mplssupport__";Fe.G(e,"xyz"),'"xyz"'!==Fe.q(e)&&(i=!1),Fe.V(e)}catch(t){i=!1}return i||Pt.error("localStorage unsupported; falling back to cookie store"),Ie=i,i},B:function(t){Pt.error("localStorage error: "+t)},q:function(i){try{return null==t?void 0:t.localStorage.getItem(i)}catch(t){Fe.B(t)}return null},W:function(t){try{return JSON.parse(Fe.q(t))||{}}catch(t){}return null},G:function(i,e){try{null==t||t.localStorage.setItem(i,JSON.stringify(e))}catch(t){Fe.B(t)}},V:function(i){try{null==t||t.localStorage.removeItem(i)}catch(t){Fe.B(t)}}},Me=["distinct_id",ri,si,yi,mi],Oe=g({},Fe,{W:function(t){try{var i={};try{i=Re.W(t)||{}}catch(t){}var e=Ot(i,JSON.parse(Fe.q(t)||"{}"));return Fe.G(t,e),e}catch(t){}return null},G:function(t,i,e,r,s,n){try{Fe.G(t,i,void 0,void 0,n);var o={};Me.forEach((t=>{i[t]&&(o[t]=i[t])})),Object.keys(o).length&&Re.G(t,o,e,r,s,n)}catch(t){Fe.B(t)}},V:function(i,e){try{null==t||t.localStorage.removeItem(i),Re.V(i,e)}catch(t){Fe.B(t)}}}),Ae={},De={H:function(){return!0},B:function(t){Pt.error("memoryStorage error: "+t)},q:function(t){return Ae[t]||null},W:function(t){return Ae[t]||null},G:function(t,i){Ae[t]=i},V:function(t){delete Ae[t]}},je=null,Le={H:function(){if(!D(je))return je;if(je=!0,M(t))je=!1;else try{var i="__support__";Le.G(i,"xyz"),'"xyz"'!==Le.q(i)&&(je=!1),Le.V(i)}catch(t){je=!1}return je},B:function(t){Pt.error("sessionStorage error: ",t)},q:function(i){try{return null==t?void 0:t.sessionStorage.getItem(i)}catch(t){Le.B(t)}return null},W:function(t){try{return JSON.parse(Le.q(t))||null}catch(t){}return null},G:function(i,e){try{null==t||t.sessionStorage.setItem(i,JSON.stringify(e))}catch(t){Le.B(t)}},V:function(i){try{null==t||t.sessionStorage.removeItem(i)}catch(t){Le.B(t)}}},Ne=function(t){return t[t.PENDING=-1]="PENDING",t[t.DENIED=0]="DENIED",t[t.GRANTED=1]="GRANTED",t}({});class Ue{constructor(t){this._instance=t}get I(){return this._instance.config}get consent(){return this.J()?Ne.DENIED:this.K}isOptedOut(){return"always"===this.I.cookieless_mode||(this.consent===Ne.DENIED||this.consent===Ne.PENDING&&(this.I.opt_out_capturing_by_default||"on_reject"===this.I.cookieless_mode))}isOptedIn(){return!this.isOptedOut()}isExplicitlyOptedOut(){return this.consent===Ne.DENIED}optInOut(t){this.Y.G(this.X,t?1:0,this.I.cookie_expiration,this.I.cross_subdomain_cookie,this.I.secure_cookie)}reset(){this.Y.V(this.X,this.I.cross_subdomain_cookie)}get X(){var{token:t,opt_out_capturing_cookie_prefix:i,consent_persistence_name:e}=this._instance.config;return e||(i?i+t:"__ph_opt_in_out_"+t)}get K(){var t=this.Y.q(this.X);return G(t)?Ne.GRANTED:w(V,t)?Ne.DENIED:Ne.PENDING}get Y(){if(!this.Z){var t=this.I.opt_out_capturing_persistence_type;this.Z="localStorage"===t?Fe:Re;var i="localStorage"===t?Re:Fe;i.q(this.X)&&(this.Z.q(this.X)||this.optInOut(G(i.q(this.X))),i.V(this.X,this.I.cross_subdomain_cookie))}return this.Z}J(){return!!this.I.respect_dnt&&!!Bt([null==n?void 0:n.doNotTrack,null==n?void 0:n.msDoNotTrack,v.doNotTrack],(t=>G(t)))}}var ze=Tt("[Dead Clicks]"),He=()=>!0,Be=t=>{var i,e=!(null==(i=t.instance.persistence)||!i.get_property(ti)),r=t.instance.config.capture_dead_clicks;return N(r)?r:!!I(r)||e};class qe{get lazyLoadedDeadClicksAutocapture(){return this.tt}constructor(t,i,e){this.instance=t,this.isEnabled=i,this.onCapture=e,this.startIfEnabled()}onRemoteConfig(t){this.instance.persistence&&this.instance.persistence.register({[ti]:null==t?void 0:t.captureDeadClicks}),this.startIfEnabled()}startIfEnabled(){this.isEnabled(this)&&this.it((()=>{this.et()}))}it(t){var i,e;null!=(i=v.__PosthogExtensions__)&&i.initDeadClicksAutocapture&&t(),null==(e=v.__PosthogExtensions__)||null==e.loadExternalDependency||e.loadExternalDependency(this.instance,"dead-clicks-autocapture",(i=>{i?ze.error("failed to load script",i):t()}))}et(){var t;if(o){if(!this.tt&&null!=(t=v.__PosthogExtensions__)&&t.initDeadClicksAutocapture){var i=I(this.instance.config.capture_dead_clicks)?this.instance.config.capture_dead_clicks:{};i.__onCapture=this.onCapture,this.tt=v.__PosthogExtensions__.initDeadClicksAutocapture(this.instance,i),this.tt.start(o),ze.info("starting...")}}else ze.error("`document` not found. Cannot start.")}stop(){this.tt&&(this.tt.stop(),this.tt=void 0,ze.info("stopping..."))}}var We=Tt("[ExceptionAutocapture]");class Ge{constructor(i){var e,r,s;this.rt=()=>{var i;if(t&&this.isEnabled&&null!=(i=v.__PosthogExtensions__)&&i.errorWrappingFunctions){var e=v.__PosthogExtensions__.errorWrappingFunctions.wrapOnError,r=v.__PosthogExtensions__.errorWrappingFunctions.wrapUnhandledRejection,s=v.__PosthogExtensions__.errorWrappingFunctions.wrapConsoleError;try{!this.st&&this.I.capture_unhandled_errors&&(this.st=e(this.captureException.bind(this))),!this.nt&&this.I.capture_unhandled_rejections&&(this.nt=r(this.captureException.bind(this))),!this.ot&&this.I.capture_console_errors&&(this.ot=s(this.captureException.bind(this)))}catch(t){We.error("failed to start",t),this.lt()}}},this._instance=i,this.ut=!(null==(e=this._instance.persistence)||!e.props[Yt]),this.I=this.ht(),this.dt=new K({refillRate:null!==(r=this._instance.config.error_tracking.__exceptionRateLimiterRefillRate)&&void 0!==r?r:1,bucketSize:null!==(s=this._instance.config.error_tracking.__exceptionRateLimiterBucketSize)&&void 0!==s?s:10,refillInterval:1e4,h:We}),this.startIfEnabled()}ht(){var t=this._instance.config.capture_exceptions,i={capture_unhandled_errors:!1,capture_unhandled_rejections:!1,capture_console_errors:!1};return I(t)?i=g({},i,t):(M(t)?this.ut:t)&&(i=g({},i,{capture_unhandled_errors:!0,capture_unhandled_rejections:!0})),i}get isEnabled(){return this.I.capture_console_errors||this.I.capture_unhandled_errors||this.I.capture_unhandled_rejections}startIfEnabled(){this.isEnabled&&(We.info("enabled"),this.it(this.rt))}it(t){var i,e;null!=(i=v.__PosthogExtensions__)&&i.errorWrappingFunctions&&t(),null==(e=v.__PosthogExtensions__)||null==e.loadExternalDependency||e.loadExternalDependency(this._instance,"exception-autocapture",(i=>{if(i)return We.error("failed to load script",i);t()}))}lt(){var t,i,e;null==(t=this.st)||t.call(this),this.st=void 0,null==(i=this.nt)||i.call(this),this.nt=void 0,null==(e=this.ot)||e.call(this),this.ot=void 0}onRemoteConfig(t){var i=t.autocaptureExceptions;this.ut=!!i||!1,this.I=this.ht(),this._instance.persistence&&this._instance.persistence.register({[Yt]:this.ut}),this.startIfEnabled()}captureException(t){var i,e,r=null!==(i=null==t||null==(e=t.$exception_list)||null==(e=e[0])?void 0:e.type)&&void 0!==i?i:"Exception";this.dt.consumeRateLimit(r)?We.info("Skipping exception capture because of client rate limiting.",{exception:r}):this._instance.exceptions.sendExceptionEvent(t)}}function Ve(t,i,e){try{if(!(i in t))return()=>{};var r=t[i],s=e(r);return R(s)&&(s.prototype=s.prototype||{},Object.defineProperties(s,{__posthog_wrapped__:{enumerable:!1,value:!0}})),t[i]=s,()=>{t[i]=r}}catch(t){return()=>{}}}class Je{constructor(i){var e;this._instance=i,this.vt=(null==t||null==(e=t.location)?void 0:e.pathname)||""}get isEnabled(){return"history_change"===this._instance.config.capture_pageview}startIfEnabled(){this.isEnabled&&(Pt.info("History API monitoring enabled, starting..."),this.monitorHistoryChanges())}stop(){this.ct&&this.ct(),this.ct=void 0,Pt.info("History API monitoring stopped")}monitorHistoryChanges(){var i,e;if(t&&t.history){var r=this;null!=(i=t.history.pushState)&&i.__posthog_wrapped__||Ve(t.history,"pushState",(t=>function(i,e,s){t.call(this,i,e,s),r.ft("pushState")})),null!=(e=t.history.replaceState)&&e.__posthog_wrapped__||Ve(t.history,"replaceState",(t=>function(i,e,s){t.call(this,i,e,s),r.ft("replaceState")})),this.gt()}}ft(i){try{var e,r=null==t||null==(e=t.location)?void 0:e.pathname;if(!r)return;r!==this.vt&&this.isEnabled&&this._instance.capture("$pageview",{navigation_type:i}),this.vt=r}catch(t){Pt.error("Error capturing "+i+" pageview",t)}}gt(){if(!this.ct){var i=()=>{this.ft("popstate")};qt(t,"popstate",i),this.ct=()=>{t&&t.removeEventListener("popstate",i)}}}}var Ke=Tt("[SegmentIntegration]");function Ye(t,i){var e=t.config.segment;if(!e)return i();!function(t,i){var e=t.config.segment;if(!e)return i();var r=e=>{var r=()=>e.anonymousId()||$e();t.config.get_device_id=r,e.id()&&(t.register({distinct_id:e.id(),$device_id:r()}),t.persistence.set_property(ci,"identified")),i()},s=e.user();"then"in s&&R(s.then)?s.then((t=>r(t))):r(s)}(t,(()=>{e.register((t=>{Promise&&Promise.resolve||Ke.warn("This browser does not have Promise support, and can not use the segment integration");var i=(i,e)=>{if(!e)return i;i.event.userId||i.event.anonymousId===t.get_distinct_id()||(Ke.info("No userId set, resetting PostHog"),t.reset()),i.event.userId&&i.event.userId!==t.get_distinct_id()&&(Ke.info("UserId set, identifying with PostHog"),t.identify(i.event.userId));var r=t.calculateEventProperties(e,i.event.properties);return i.event.properties=Object.assign({},r,i.event.properties),i};return{name:"PostHog JS",type:"enrichment",version:"1.0.0",isLoaded:()=>!0,load:()=>Promise.resolve(),track:t=>i(t,t.event.event),page:t=>i(t,"$pageview"),identify:t=>i(t,"$identify"),screen:t=>i(t,"$screen")}})(t)).then((()=>{i()}))}))}var Xe="posthog-js";function Qe(t,i){var{organization:e,projectId:r,prefix:s,severityAllowList:n=["error"],sendExceptionsToPostHog:o=!0}=void 0===i?{}:i;return i=>{var a,l,u,h,d;if(!("*"===n||n.includes(i.level))||!t.__loaded)return i;i.tags||(i.tags={});var v=t.requestRouter.endpointFor("ui","/project/"+t.config.token+"/person/"+t.get_distinct_id());i.tags["PostHog Person URL"]=v,t.sessionRecordingStarted()&&(i.tags["PostHog Recording URL"]=t.get_session_replay_url({withTimestamp:!0}));var c=(null==(a=i.exception)?void 0:a.values)||[],f=c.map((t=>g({},t,{stacktrace:t.stacktrace?g({},t.stacktrace,{type:"raw",frames:(t.stacktrace.frames||[]).map((t=>g({},t,{platform:"web:javascript"})))}):void 0}))),p={$exception_message:(null==(l=c[0])?void 0:l.value)||i.message,$exception_type:null==(u=c[0])?void 0:u.type,$exception_level:i.level,$exception_list:f,$sentry_event_id:i.event_id,$sentry_exception:i.exception,$sentry_exception_message:(null==(h=c[0])?void 0:h.value)||i.message,$sentry_exception_type:null==(d=c[0])?void 0:d.type,$sentry_tags:i.tags};return e&&r&&(p.$sentry_url=(s||"https://sentry.io/organizations/")+e+"/issues/?project="+r+"&query="+i.event_id),o&&t.exceptions.sendExceptionEvent(p),i}}class Ze{constructor(t,i,e,r,s,n){this.name=Xe,this.setupOnce=function(o){o(Qe(t,{organization:i,projectId:e,prefix:r,severityAllowList:s,sendExceptionsToPostHog:null==n||n}))}}}var tr=null!=t&&t.location?ve(t.location.hash,"__posthog")||ve(location.hash,"state"):null,ir="_postHogToolbarParams",er=Tt("[Toolbar]"),rr=function(t){return t[t.UNINITIALIZED=0]="UNINITIALIZED",t[t.LOADING=1]="LOADING",t[t.LOADED=2]="LOADED",t}(rr||{});class sr{constructor(t){this.instance=t}_t(t){v.ph_toolbar_state=t}yt(){var t;return null!==(t=v.ph_toolbar_state)&&void 0!==t?t:rr.UNINITIALIZED}maybeLoadToolbar(i,e,r){if(void 0===i&&(i=void 0),void 0===e&&(e=void 0),void 0===r&&(r=void 0),!t||!o)return!1;i=null!=i?i:t.location,r=null!=r?r:t.history;try{if(!e){try{t.localStorage.setItem("test","test"),t.localStorage.removeItem("test")}catch(t){return!1}e=null==t?void 0:t.localStorage}var s,n=tr||ve(i.hash,"__posthog")||ve(i.hash,"state"),a=n?jt((()=>JSON.parse(atob(decodeURIComponent(n)))))||jt((()=>JSON.parse(decodeURIComponent(n)))):null;return a&&"ph_authorize"===a.action?((s=a).source="url",s&&Object.keys(s).length>0&&(a.desiredHash?i.hash=a.desiredHash:r?r.replaceState(r.state,"",i.pathname+i.search):i.hash="")):((s=JSON.parse(e.getItem(ir)||"{}")).source="localstorage",delete s.userIntent),!(!s.token||this.instance.config.token!==s.token)&&(this.loadToolbar(s),!0)}catch(t){return!1}}bt(t){var i=v.ph_load_toolbar||v.ph_load_editor;!j(i)&&R(i)?i(t,this.instance):er.warn("No toolbar load function found")}loadToolbar(i){var e=!(null==o||!o.getElementById(bi));if(!t||e)return!1;var r="custom"===this.instance.requestRouter.region&&this.instance.config.advanced_disable_toolbar_metrics,s=g({token:this.instance.config.token},i,{apiURL:this.instance.requestRouter.endpointFor("ui")},r?{instrument:!1}:{});if(t.localStorage.setItem(ir,JSON.stringify(g({},s,{source:void 0}))),this.yt()===rr.LOADED)this.bt(s);else if(this.yt()===rr.UNINITIALIZED){var n;this._t(rr.LOADING),null==(n=v.__PosthogExtensions__)||null==n.loadExternalDependency||n.loadExternalDependency(this.instance,"toolbar",(t=>{if(t)return er.error("[Toolbar] Failed to load",t),void this._t(rr.UNINITIALIZED);this._t(rr.LOADED),this.bt(s)})),qt(t,"turbolinks:load",(()=>{this._t(rr.UNINITIALIZED),this.loadToolbar(s)}))}return!0}wt(t){return this.loadToolbar(t)}maybeLoadEditor(t,i,e){return void 0===t&&(t=void 0),void 0===i&&(i=void 0),void 0===e&&(e=void 0),this.maybeLoadToolbar(t,i,e)}}var nr=Tt("[TracingHeaders]");class or{constructor(t){this.xt=void 0,this.Et=void 0,this.rt=()=>{var t,i;M(this.xt)&&(null==(t=v.__PosthogExtensions__)||null==(t=t.tracingHeadersPatchFns)||t._patchXHR(this._instance.config.__add_tracing_headers||[],this._instance.get_distinct_id(),this._instance.sessionManager));M(this.Et)&&(null==(i=v.__PosthogExtensions__)||null==(i=i.tracingHeadersPatchFns)||i._patchFetch(this._instance.config.__add_tracing_headers||[],this._instance.get_distinct_id(),this._instance.sessionManager))},this._instance=t}it(t){var i,e;null!=(i=v.__PosthogExtensions__)&&i.tracingHeadersPatchFns&&t(),null==(e=v.__PosthogExtensions__)||null==e.loadExternalDependency||e.loadExternalDependency(this._instance,"tracing-headers",(i=>{if(i)return nr.error("failed to load script",i);t()}))}startIfEnabledOrStop(){var t,i;this._instance.config.__add_tracing_headers?this.it(this.rt):(null==(t=this.xt)||t.call(this),null==(i=this.Et)||i.call(this),this.xt=void 0,this.Et=void 0)}}var ar="Mobile",lr="iOS",ur="Android",hr="Tablet",dr=ur+" "+hr,vr="iPad",cr="Apple",fr=cr+" Watch",pr="Safari",gr="BlackBerry",_r="Samsung",mr=_r+"Browser",yr=_r+" Internet",br="Chrome",wr=br+" OS",xr=br+" "+lr,Er="Internet Explorer",Sr=Er+" "+ar,$r="Opera",kr=$r+" Mini",Pr="Edge",Tr="Microsoft "+Pr,Cr="Firefox",Rr=Cr+" "+lr,Ir="Nintendo",Fr="PlayStation",Mr="Xbox",Or=ur+" "+ar,Ar=ar+" "+pr,Dr="Windows",jr=Dr+" Phone",Lr="Nokia",Nr="Ouya",Ur="Generic",zr=Ur+" "+ar.toLowerCase(),Hr=Ur+" "+hr.toLowerCase(),Br="Konqueror",qr="(\\d+(\\.\\d+)?)",Wr=new RegExp("Version/"+qr),Gr=new RegExp(Mr,"i"),Vr=new RegExp(Fr+" \\w+","i"),Jr=new RegExp(Ir+" \\w+","i"),Kr=new RegExp(gr+"|PlayBook|BB10","i"),Yr={"NT3.51":"NT 3.11","NT4.0":"NT 4.0","5.0":"2000",5.1:"XP",5.2:"XP","6.0":"Vista",6.1:"7",6.2:"8",6.3:"8.1",6.4:"10","10.0":"10"};var Xr=(t,i)=>i&&w(i,cr)||function(t){return w(t,pr)&&!w(t,br)&&!w(t,ur)}(t),Qr=function(t,i){return i=i||"",w(t," OPR/")&&w(t,"Mini")?kr:w(t," OPR/")?$r:Kr.test(t)?gr:w(t,"IE"+ar)||w(t,"WPDesktop")?Sr:w(t,mr)?yr:w(t,Pr)||w(t,"Edg/")?Tr:w(t,"FBIOS")?"Facebook "+ar:w(t,"UCWEB")||w(t,"UCBrowser")?"UC Browser":w(t,"CriOS")?xr:w(t,"CrMo")||w(t,br)?br:w(t,ur)&&w(t,pr)?Or:w(t,"FxiOS")?Rr:w(t.toLowerCase(),Br.toLowerCase())?Br:Xr(t,i)?w(t,ar)?Ar:pr:w(t,Cr)?Cr:w(t,"MSIE")||w(t,"Trident/")?Er:w(t,"Gecko")?Cr:""},Zr={[Sr]:[new RegExp("rv:"+qr)],[Tr]:[new RegExp(Pr+"?\\/"+qr)],[br]:[new RegExp("("+br+"|CrMo)\\/"+qr)],[xr]:[new RegExp("CriOS\\/"+qr)],"UC Browser":[new RegExp("(UCBrowser|UCWEB)\\/"+qr)],[pr]:[Wr],[Ar]:[Wr],[$r]:[new RegExp("(Opera|OPR)\\/"+qr)],[Cr]:[new RegExp(Cr+"\\/"+qr)],[Rr]:[new RegExp("FxiOS\\/"+qr)],[Br]:[new RegExp("Konqueror[:/]?"+qr,"i")],[gr]:[new RegExp(gr+" "+qr),Wr],[Or]:[new RegExp("android\\s"+qr,"i")],[yr]:[new RegExp(mr+"\\/"+qr)],[Er]:[new RegExp("(rv:|MSIE )"+qr)],Mozilla:[new RegExp("rv:"+qr)]},ts=function(t,i){var e=Qr(t,i),r=Zr[e];if(M(r))return null;for(var s=0;s<r.length;s++){var n=r[s],o=t.match(n);if(o)return parseFloat(o[o.length-2])}return null},is=[[new RegExp(Mr+"; "+Mr+" (.*?)[);]","i"),t=>[Mr,t&&t[1]||""]],[new RegExp(Ir,"i"),[Ir,""]],[new RegExp(Fr,"i"),[Fr,""]],[Kr,[gr,""]],[new RegExp(Dr,"i"),(t,i)=>{if(/Phone/.test(i)||/WPDesktop/.test(i))return[jr,""];if(new RegExp(ar).test(i)&&!/IEMobile\b/.test(i))return[Dr+" "+ar,""];var e=/Windows NT ([0-9.]+)/i.exec(i);if(e&&e[1]){var r=e[1],s=Yr[r]||"";return/arm/i.test(i)&&(s="RT"),[Dr,s]}return[Dr,""]}],[/((iPhone|iPad|iPod).*?OS (\d+)_(\d+)_?(\d+)?|iPhone)/,t=>{if(t&&t[3]){var i=[t[3],t[4],t[5]||"0"];return[lr,i.join(".")]}return[lr,""]}],[/(watch.*\/(\d+\.\d+\.\d+)|watch os,(\d+\.\d+),)/i,t=>{var i="";return t&&t.length>=3&&(i=M(t[2])?t[3]:t[2]),["watchOS",i]}],[new RegExp("("+ur+" (\\d+)\\.(\\d+)\\.?(\\d+)?|"+ur+")","i"),t=>{if(t&&t[2]){var i=[t[2],t[3],t[4]||"0"];return[ur,i.join(".")]}return[ur,""]}],[/Mac OS X (\d+)[_.](\d+)[_.]?(\d+)?/i,t=>{var i=["Mac OS X",""];if(t&&t[1]){var e=[t[1],t[2],t[3]||"0"];i[1]=e.join(".")}return i}],[/Mac/i,["Mac OS X",""]],[/CrOS/,[wr,""]],[/Linux|debian/i,["Linux",""]]],es=function(t){return Jr.test(t)?Ir:Vr.test(t)?Fr:Gr.test(t)?Mr:new RegExp(Nr,"i").test(t)?Nr:new RegExp("("+jr+"|WPDesktop)","i").test(t)?jr:/iPad/.test(t)?vr:/iPod/.test(t)?"iPod Touch":/iPhone/.test(t)?"iPhone":/(watch)(?: ?os[,/]|\d,\d\/)[\d.]+/i.test(t)?fr:Kr.test(t)?gr:/(kobo)\s(ereader|touch)/i.test(t)?"Kobo":new RegExp(Lr,"i").test(t)?Lr:/(kf[a-z]{2}wi|aeo[c-r]{2})( bui|\))/i.test(t)||/(kf[a-z]+)( bui|\)).+silk\//i.test(t)?"Kindle Fire":/(Android|ZTE)/i.test(t)?!new RegExp(ar).test(t)||/(9138B|TB782B|Nexus [97]|pixel c|HUAWEISHT|BTV|noble nook|smart ultra 6)/i.test(t)?/pixel[\daxl ]{1,6}/i.test(t)&&!/pixel c/i.test(t)||/(huaweimed-al00|tah-|APA|SM-G92|i980|zte|U304AA)/i.test(t)||/lmy47v/i.test(t)&&!/QTAQZ3/i.test(t)?ur:dr:ur:new RegExp("(pda|"+ar+")","i").test(t)?zr:new RegExp(hr,"i").test(t)&&!new RegExp(hr+" pc","i").test(t)?Hr:""},rs="https?://(.*)",ss=["gclid","gclsrc","dclid","gbraid","wbraid","fbclid","msclkid","twclid","li_fat_id","igshid","ttclid","rdt_cid","epik","qclid","sccid","irclid","_kx"],ns=At(["utm_source","utm_medium","utm_campaign","utm_content","utm_term","gad_source","mc_cid"],ss),os="<masked>",as=["li_fat_id"];function ls(t,i,e){if(!o)return{};var r,s=i?At([],ss,e||[]):[],n=us(de(o.URL,s,os),t),a=(r={},Mt(as,(function(t){var i=Re.q(t);r[t]=i||null})),r);return Ot(a,n)}function us(t,i){var e=ns.concat(i||[]),r={};return Mt(e,(function(i){var e=he(t,i);r[i]=e||null})),r}function hs(t){var i=function(t){return t?0===t.search(rs+"google.([^/?]*)")?"google":0===t.search(rs+"bing.com")?"bing":0===t.search(rs+"yahoo.com")?"yahoo":0===t.search(rs+"duckduckgo.com")?"duckduckgo":null:null}(t),e="yahoo"!=i?"q":"p",r={};if(!D(i)){r.$search_engine=i;var s=o?he(o.referrer,e):"";s.length&&(r.ph_keyword=s)}return r}function ds(){return navigator.language||navigator.userLanguage}function vs(){return(null==o?void 0:o.referrer)||"$direct"}function cs(t,i){var e=t?At([],ss,i||[]):[],r=null==a?void 0:a.href.substring(0,1e3);return{r:vs().substring(0,1e3),u:r?de(r,e,os):void 0}}function fs(t){var i,{r:e,u:r}=t,s={$referrer:e,$referring_domain:null==e?void 0:"$direct"==e?"$direct":null==(i=le(e))?void 0:i.host};if(r){s.$current_url=r;var n=le(r);s.$host=null==n?void 0:n.host,s.$pathname=null==n?void 0:n.pathname;var o=us(r);Ot(s,o)}if(e){var a=hs(e);Ot(s,a)}return s}function ps(){try{return Intl.DateTimeFormat().resolvedOptions().timeZone}catch(t){return}}function gs(){try{return(new Date).getTimezoneOffset()}catch(t){return}}function _s(i,e){if(!d)return{};var r,s,n,o=i?At([],ss,e||[]):[],[l,u]=function(t){for(var i=0;i<is.length;i++){var[e,r]=is[i],s=e.exec(t),n=s&&(R(r)?r(s,t):r);if(n)return n}return["",""]}(d);return Ot(Nt({$os:l,$os_version:u,$browser:Qr(d,navigator.vendor),$device:es(d),$device_type:(s=d,n=es(s),n===vr||n===dr||"Kobo"===n||"Kindle Fire"===n||n===Hr?hr:n===Ir||n===Mr||n===Fr||n===Nr?"Console":n===fr?"Wearable":n?ar:"Desktop"),$timezone:ps(),$timezone_offset:gs()}),{$current_url:de(null==a?void 0:a.href,o,os),$host:null==a?void 0:a.host,$pathname:null==a?void 0:a.pathname,$raw_user_agent:d.length>1e3?d.substring(0,997)+"...":d,$browser_version:ts(d,navigator.vendor),$browser_language:ds(),$browser_language_prefix:(r=ds(),"string"==typeof r?r.split("-")[0]:void 0),$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:c.LIB_VERSION,$insert_id:Math.random().toString(36).substring(2,10)+Math.random().toString(36).substring(2,10),$time:Date.now()/1e3})}var ms=Tt("[Web Vitals]"),ys=9e5;class bs{constructor(t){var i;this.St=!1,this.P=!1,this.N={url:void 0,metrics:[],firstMetricTimestamp:void 0},this.$t=()=>{clearTimeout(this.kt),0!==this.N.metrics.length&&(this._instance.capture("$web_vitals",this.N.metrics.reduce(((t,i)=>g({},t,{["$web_vitals_"+i.name+"_event"]:g({},i),["$web_vitals_"+i.name+"_value"]:i.value})),{})),this.N={url:void 0,metrics:[],firstMetricTimestamp:void 0})},this.Pt=t=>{var i,e=null==(i=this._instance.sessionManager)?void 0:i.checkAndGetSessionAndWindowId(!0);if(M(e))ms.error("Could not read session ID. Dropping metrics!");else{this.N=this.N||{url:void 0,metrics:[],firstMetricTimestamp:void 0};var r=this.Tt();if(!M(r))if(j(null==t?void 0:t.name)||j(null==t?void 0:t.value))ms.error("Invalid metric received",t);else if(this.Ct&&t.value>=this.Ct)ms.error("Ignoring metric with value >= "+this.Ct,t);else this.N.url!==r&&(this.$t(),this.kt=setTimeout(this.$t,this.flushToCaptureTimeoutMs)),M(this.N.url)&&(this.N.url=r),this.N.firstMetricTimestamp=M(this.N.firstMetricTimestamp)?Date.now():this.N.firstMetricTimestamp,t.attribution&&t.attribution.interactionTargetElement&&(t.attribution.interactionTargetElement=void 0),this.N.metrics.push(g({},t,{$current_url:r,$session_id:e.sessionId,$window_id:e.windowId,timestamp:Date.now()})),this.N.metrics.length===this.allowedMetrics.length&&this.$t()}},this.rt=()=>{var t,i,e,r,s=v.__PosthogExtensions__;M(s)||M(s.postHogWebVitalsCallbacks)||({onLCP:t,onCLS:i,onFCP:e,onINP:r}=s.postHogWebVitalsCallbacks),t&&i&&e&&r?(this.allowedMetrics.indexOf("LCP")>-1&&t(this.Pt.bind(this)),this.allowedMetrics.indexOf("CLS")>-1&&i(this.Pt.bind(this)),this.allowedMetrics.indexOf("FCP")>-1&&e(this.Pt.bind(this)),this.allowedMetrics.indexOf("INP")>-1&&r(this.Pt.bind(this)),this.P=!0):ms.error("web vitals callbacks not loaded - not starting")},this._instance=t,this.St=!(null==(i=this._instance.persistence)||!i.props[Zt]),this.startIfEnabled()}get allowedMetrics(){var t,i,e=I(this._instance.config.capture_performance)?null==(t=this._instance.config.capture_performance)?void 0:t.web_vitals_allowed_metrics:void 0;return M(e)?(null==(i=this._instance.persistence)?void 0:i.props[ii])||["CLS","FCP","INP","LCP"]:e}get flushToCaptureTimeoutMs(){return(I(this._instance.config.capture_performance)?this._instance.config.capture_performance.web_vitals_delayed_flush_ms:void 0)||5e3}get Ct(){var t=I(this._instance.config.capture_performance)&&L(this._instance.config.capture_performance.__web_vitals_max_value)?this._instance.config.capture_performance.__web_vitals_max_value:ys;return 0<t&&t<=6e4?ys:t}get isEnabled(){var t=null==a?void 0:a.protocol;if("http:"!==t&&"https:"!==t)return ms.info("Web Vitals are disabled on non-http/https protocols"),!1;var i=I(this._instance.config.capture_performance)?this._instance.config.capture_performance.web_vitals:N(this._instance.config.capture_performance)?this._instance.config.capture_performance:void 0;return N(i)?i:this.St}startIfEnabled(){this.isEnabled&&!this.P&&(ms.info("enabled, starting..."),this.it(this.rt))}onRemoteConfig(t){var i=I(t.capturePerformance)&&!!t.capturePerformance.web_vitals,e=I(t.capturePerformance)?t.capturePerformance.web_vitals_allowed_metrics:void 0;this._instance.persistence&&(this._instance.persistence.register({[Zt]:i}),this._instance.persistence.register({[ii]:e})),this.St=i,this.startIfEnabled()}it(t){var i,e;null!=(i=v.__PosthogExtensions__)&&i.postHogWebVitalsCallbacks&&t(),null==(e=v.__PosthogExtensions__)||null==e.loadExternalDependency||e.loadExternalDependency(this._instance,"web-vitals",(i=>{i?ms.error("failed to load script",i):t()}))}Tt(){var i=t?t.location.href:void 0;if(i){var e=this._instance.config.mask_personal_data_properties,r=this._instance.config.custom_personal_data_properties,s=e?At([],ss,r||[]):[];return de(i,s,os)}ms.error("Could not determine current URL")}}var ws=Tt("[Heatmaps]");function xs(t){return I(t)&&"clientX"in t&&"clientY"in t&&L(t.clientX)&&L(t.clientY)}class Es{constructor(t){var i;this.St=!1,this.P=!1,this.Rt=null,this.instance=t,this.St=!(null==(i=this.instance.persistence)||!i.props[Kt]),this.rageclicks=new se(t.config.rageclick)}get flushIntervalMilliseconds(){var t=5e3;return I(this.instance.config.capture_heatmaps)&&this.instance.config.capture_heatmaps.flush_interval_milliseconds&&(t=this.instance.config.capture_heatmaps.flush_interval_milliseconds),t}get isEnabled(){return M(this.instance.config.capture_heatmaps)?M(this.instance.config.enable_heatmaps)?this.St:this.instance.config.enable_heatmaps:!1!==this.instance.config.capture_heatmaps}startIfEnabled(){if(this.isEnabled){if(this.P)return;ws.info("starting..."),this.It(),this.Ft()}else{var t;clearInterval(null!==(t=this.Rt)&&void 0!==t?t:void 0),this.Mt(),this.getAndClearBuffer()}}onRemoteConfig(t){var i=!!t.heatmaps;this.instance.persistence&&this.instance.persistence.register({[Kt]:i}),this.St=i,this.startIfEnabled()}getAndClearBuffer(){var t=this.N;return this.N=void 0,t}Ot(t){this.At(t.originalEvent,"deadclick")}Ft(){this.Rt&&clearInterval(this.Rt),this.Rt=function(t){return"visible"===(null==t?void 0:t.visibilityState)}(o)?setInterval(this.Dt.bind(this),this.flushIntervalMilliseconds):null}It(){t&&o&&(this.jt=this.Dt.bind(this),qt(t,"beforeunload",this.jt),this.Lt=i=>this.At(i||(null==t?void 0:t.event)),qt(o,"click",this.Lt,{capture:!0}),this.Nt=i=>this.Ut(i||(null==t?void 0:t.event)),qt(o,"mousemove",this.Nt,{capture:!0}),this.zt=new qe(this.instance,He,this.Ot.bind(this)),this.zt.startIfEnabled(),this.Ht=this.Ft.bind(this),qt(o,"visibilitychange",this.Ht),this.P=!0)}Mt(){var i;t&&o&&(this.jt&&t.removeEventListener("beforeunload",this.jt),this.Lt&&o.removeEventListener("click",this.Lt,{capture:!0}),this.Nt&&o.removeEventListener("mousemove",this.Nt,{capture:!0}),this.Ht&&o.removeEventListener("visibilitychange",this.Ht),clearTimeout(this.Bt),null==(i=this.zt)||i.stop(),this.P=!1)}qt(i,e){var r=this.instance.scrollManager.scrollY(),s=this.instance.scrollManager.scrollX(),n=this.instance.scrollManager.scrollElement(),o=function(i,e,r){for(var s=i;s&&Si(s)&&!$i(s,"body");){if(s===r)return!1;if(w(e,null==t?void 0:t.getComputedStyle(s).position))return!0;s=Di(s)}return!1}(Mi(i),["fixed","sticky"],n);return{x:i.clientX+(o?0:s),y:i.clientY+(o?0:r),target_fixed:o,type:e}}At(t,i){var e;if(void 0===i&&(i="click"),!Ei(t.target)&&xs(t)){var r=this.qt(t,i);null!=(e=this.rageclicks)&&e.isRageClick(t.clientX,t.clientY,(new Date).getTime())&&this.Wt(g({},r,{type:"rageclick"})),this.Wt(r)}}Ut(t){!Ei(t.target)&&xs(t)&&(clearTimeout(this.Bt),this.Bt=setTimeout((()=>{this.Wt(this.qt(t,"mousemove"))}),500))}Wt(i){if(t){var e=t.location.href,r=this.instance.config.mask_personal_data_properties,s=this.instance.config.custom_personal_data_properties,n=r?At([],ss,s||[]):[],o=de(e,n,os);this.N=this.N||{},this.N[o]||(this.N[o]=[]),this.N[o].push(i)}}Dt(){this.N&&!F(this.N)&&this.instance.capture("$$heatmap",{$heatmap_data:this.getAndClearBuffer()})}}class Ss{constructor(t){this._instance=t}doPageView(i,e){var r,s=this.Gt(i,e);return this.Vt={pathname:null!==(r=null==t?void 0:t.location.pathname)&&void 0!==r?r:"",pageViewId:e,timestamp:i},this._instance.scrollManager.resetContext(),s}doPageLeave(t){var i;return this.Gt(t,null==(i=this.Vt)?void 0:i.pageViewId)}doEvent(){var t;return{$pageview_id:null==(t=this.Vt)?void 0:t.pageViewId}}Gt(t,i){var e=this.Vt;if(!e)return{$pageview_id:i};var r={$pageview_id:i,$prev_pageview_id:e.pageViewId},s=this._instance.scrollManager.getContext();if(s&&!this._instance.config.disable_scroll_properties){var{maxScrollHeight:n,lastScrollY:o,maxScrollY:a,maxContentHeight:l,lastContentY:u,maxContentY:h}=s;if(!(M(n)||M(o)||M(a)||M(l)||M(u)||M(h))){n=Math.ceil(n),o=Math.ceil(o),a=Math.ceil(a),l=Math.ceil(l),u=Math.ceil(u),h=Math.ceil(h);var d=n<=1?1:J(o/n,0,1,Pt),v=n<=1?1:J(a/n,0,1,Pt),c=l<=1?1:J(u/l,0,1,Pt),f=l<=1?1:J(h/l,0,1,Pt);r=Ot(r,{$prev_pageview_last_scroll:o,$prev_pageview_last_scroll_percentage:d,$prev_pageview_max_scroll:a,$prev_pageview_max_scroll_percentage:v,$prev_pageview_last_content:u,$prev_pageview_last_content_percentage:c,$prev_pageview_max_content:h,$prev_pageview_max_content_percentage:f})}}return e.pathname&&(r.$prev_pageview_pathname=e.pathname),e.timestamp&&(r.$prev_pageview_duration=(t.getTime()-e.timestamp.getTime())/1e3),r}}var $s=Uint8Array,ks=Uint16Array,Ps=Uint32Array,Ts=new $s([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]),Cs=new $s([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]),Rs=new $s([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),Is=function(t,i){for(var e=new ks(31),r=0;r<31;++r)e[r]=i+=1<<t[r-1];var s=new Ps(e[30]);for(r=1;r<30;++r)for(var n=e[r];n<e[r+1];++n)s[n]=n-e[r]<<5|r;return[e,s]},Fs=Is(Ts,2),Ms=Fs[0],Os=Fs[1];Ms[28]=258,Os[258]=28;for(var As=Is(Cs,0)[1],Ds=new ks(32768),js=0;js<32768;++js){var Ls=(43690&js)>>>1|(21845&js)<<1;Ls=(61680&(Ls=(52428&Ls)>>>2|(13107&Ls)<<2))>>>4|(3855&Ls)<<4,Ds[js]=((65280&Ls)>>>8|(255&Ls)<<8)>>>1}var Ns=function(t,i,e){for(var r=t.length,s=0,n=new ks(i);s<r;++s)++n[t[s]-1];var o,a=new ks(i);for(s=0;s<i;++s)a[s]=a[s-1]+n[s-1]<<1;if(e){o=new ks(1<<i);var l=15-i;for(s=0;s<r;++s)if(t[s])for(var u=s<<4|t[s],h=i-t[s],d=a[t[s]-1]++<<h,v=d|(1<<h)-1;d<=v;++d)o[Ds[d]>>>l]=u}else for(o=new ks(r),s=0;s<r;++s)o[s]=Ds[a[t[s]-1]++]>>>15-t[s];return o},Us=new $s(288);for(js=0;js<144;++js)Us[js]=8;for(js=144;js<256;++js)Us[js]=9;for(js=256;js<280;++js)Us[js]=7;for(js=280;js<288;++js)Us[js]=8;var zs=new $s(32);for(js=0;js<32;++js)zs[js]=5;var Hs=Ns(Us,9,0),Bs=Ns(zs,5,0),qs=function(t){return(t/8>>0)+(7&t&&1)},Ws=function(t,i,e){(null==e||e>t.length)&&(e=t.length);var r=new(t instanceof ks?ks:t instanceof Ps?Ps:$s)(e-i);return r.set(t.subarray(i,e)),r},Gs=function(t,i,e){e<<=7&i;var r=i/8>>0;t[r]|=e,t[r+1]|=e>>>8},Vs=function(t,i,e){e<<=7&i;var r=i/8>>0;t[r]|=e,t[r+1]|=e>>>8,t[r+2]|=e>>>16},Js=function(t,i){for(var e=[],r=0;r<t.length;++r)t[r]&&e.push({s:r,f:t[r]});var s=e.length,n=e.slice();if(!s)return[new $s(0),0];if(1==s){var o=new $s(e[0].s+1);return o[e[0].s]=1,[o,1]}e.sort((function(t,i){return t.f-i.f})),e.push({s:-1,f:25001});var a=e[0],l=e[1],u=0,h=1,d=2;for(e[0]={s:-1,f:a.f+l.f,l:a,r:l};h!=s-1;)a=e[e[u].f<e[d].f?u++:d++],l=e[u!=h&&e[u].f<e[d].f?u++:d++],e[h++]={s:-1,f:a.f+l.f,l:a,r:l};var v=n[0].s;for(r=1;r<s;++r)n[r].s>v&&(v=n[r].s);var c=new ks(v+1),f=Ks(e[h-1],c,0);if(f>i){r=0;var p=0,g=f-i,_=1<<g;for(n.sort((function(t,i){return c[i.s]-c[t.s]||t.f-i.f}));r<s;++r){var m=n[r].s;if(!(c[m]>i))break;p+=_-(1<<f-c[m]),c[m]=i}for(p>>>=g;p>0;){var y=n[r].s;c[y]<i?p-=1<<i-c[y]++-1:++r}for(;r>=0&&p;--r){var b=n[r].s;c[b]==i&&(--c[b],++p)}f=i}return[new $s(c),f]},Ks=function(t,i,e){return-1==t.s?Math.max(Ks(t.l,i,e+1),Ks(t.r,i,e+1)):i[t.s]=e},Ys=function(t){for(var i=t.length;i&&!t[--i];);for(var e=new ks(++i),r=0,s=t[0],n=1,o=function(t){e[r++]=t},a=1;a<=i;++a)if(t[a]==s&&a!=i)++n;else{if(!s&&n>2){for(;n>138;n-=138)o(32754);n>2&&(o(n>10?n-11<<5|28690:n-3<<5|12305),n=0)}else if(n>3){for(o(s),--n;n>6;n-=6)o(8304);n>2&&(o(n-3<<5|8208),n=0)}for(;n--;)o(s);n=1,s=t[a]}return[e.subarray(0,r),i]},Xs=function(t,i){for(var e=0,r=0;r<i.length;++r)e+=t[r]*i[r];return e},Qs=function(t,i,e){var r=e.length,s=qs(i+2);t[s]=255&r,t[s+1]=r>>>8,t[s+2]=255^t[s],t[s+3]=255^t[s+1];for(var n=0;n<r;++n)t[s+n+4]=e[n];return 8*(s+4+r)},Zs=function(t,i,e,r,s,n,o,a,l,u,h){Gs(i,h++,e),++s[256];for(var d=Js(s,15),v=d[0],c=d[1],f=Js(n,15),p=f[0],g=f[1],_=Ys(v),m=_[0],y=_[1],b=Ys(p),w=b[0],x=b[1],E=new ks(19),S=0;S<m.length;++S)E[31&m[S]]++;for(S=0;S<w.length;++S)E[31&w[S]]++;for(var k=Js(E,7),P=k[0],T=k[1],C=19;C>4&&!P[Rs[C-1]];--C);var R,I,F,M,O=u+5<<3,A=Xs(s,Us)+Xs(n,zs)+o,D=Xs(s,v)+Xs(n,p)+o+14+3*C+Xs(E,P)+(2*E[16]+3*E[17]+7*E[18]);if(O<=A&&O<=D)return Qs(i,h,t.subarray(l,l+u));if(Gs(i,h,1+(D<A)),h+=2,D<A){R=Ns(v,c,0),I=v,F=Ns(p,g,0),M=p;var j=Ns(P,T,0);Gs(i,h,y-257),Gs(i,h+5,x-1),Gs(i,h+10,C-4),h+=14;for(S=0;S<C;++S)Gs(i,h+3*S,P[Rs[S]]);h+=3*C;for(var L=[m,w],N=0;N<2;++N){var U=L[N];for(S=0;S<U.length;++S){var z=31&U[S];Gs(i,h,j[z]),h+=P[z],z>15&&(Gs(i,h,U[S]>>>5&127),h+=U[S]>>>12)}}}else R=Hs,I=Us,F=Bs,M=zs;for(S=0;S<a;++S)if(r[S]>255){z=r[S]>>>18&31;Vs(i,h,R[z+257]),h+=I[z+257],z>7&&(Gs(i,h,r[S]>>>23&31),h+=Ts[z]);var H=31&r[S];Vs(i,h,F[H]),h+=M[H],H>3&&(Vs(i,h,r[S]>>>5&8191),h+=Cs[H])}else Vs(i,h,R[r[S]]),h+=I[r[S]];return Vs(i,h,R[256]),h+I[256]},tn=new Ps([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),en=function(){for(var t=new Ps(256),i=0;i<256;++i){for(var e=i,r=9;--r;)e=(1&e&&3988292384)^e>>>1;t[i]=e}return t}(),rn=function(t,i,e,r,s){return function(t,i,e,r,s,n){var o=t.length,a=new $s(r+o+5*(1+Math.floor(o/7e3))+s),l=a.subarray(r,a.length-s),u=0;if(!i||o<8)for(var h=0;h<=o;h+=65535){var d=h+65535;d<o?u=Qs(l,u,t.subarray(h,d)):(l[h]=n,u=Qs(l,u,t.subarray(h,o)))}else{for(var v=tn[i-1],c=v>>>13,f=8191&v,p=(1<<e)-1,g=new ks(32768),_=new ks(p+1),m=Math.ceil(e/3),y=2*m,b=function(i){return(t[i]^t[i+1]<<m^t[i+2]<<y)&p},w=new Ps(25e3),x=new ks(288),E=new ks(32),S=0,k=0,P=(h=0,0),T=0,C=0;h<o;++h){var R=b(h),I=32767&h,F=_[R];if(g[I]=F,_[R]=I,T<=h){var M=o-h;if((S>7e3||P>24576)&&M>423){u=Zs(t,l,0,w,x,E,k,P,C,h-C,u),P=S=k=0,C=h;for(var O=0;O<286;++O)x[O]=0;for(O=0;O<30;++O)E[O]=0}var A=2,D=0,j=f,L=I-F&32767;if(M>2&&R==b(h-L))for(var N=Math.min(c,M)-1,U=Math.min(32767,h),z=Math.min(258,M);L<=U&&--j&&I!=F;){if(t[h+A]==t[h+A-L]){for(var H=0;H<z&&t[h+H]==t[h+H-L];++H);if(H>A){if(A=H,D=L,H>N)break;var B=Math.min(L,H-2),q=0;for(O=0;O<B;++O){var W=h-L+O+32768&32767,G=W-g[W]+32768&32767;G>q&&(q=G,F=W)}}}L+=(I=F)-(F=g[I])+32768&32767}if(D){w[P++]=268435456|Os[A]<<18|As[D];var V=31&Os[A],J=31&As[D];k+=Ts[V]+Cs[J],++x[257+V],++E[J],T=h+A,++S}else w[P++]=t[h],++x[t[h]]}}u=Zs(t,l,n,w,x,E,k,P,C,h-C,u)}return Ws(a,0,r+qs(u)+s)}(t,null==i.level?6:i.level,null==i.mem?Math.ceil(1.5*Math.max(8,Math.min(13,Math.log(t.length)))):12+i.mem,e,r,!0)},sn=function(t,i,e){for(;e;++i)t[i]=e,e>>>=8};function nn(t,i){void 0===i&&(i={});var e=function(){var t=4294967295;return{p:function(i){for(var e=t,r=0;r<i.length;++r)e=en[255&e^i[r]]^e>>>8;t=e},d:function(){return 4294967295^t}}}(),r=t.length;e.p(t);var s,n=rn(t,i,10+((s=i).filename&&s.filename.length+1||0),8),o=n.length;return function(t,i){var e=i.filename;if(t[0]=31,t[1]=139,t[2]=8,t[8]=i.level<2?4:9==i.level?2:0,t[9]=3,0!=i.mtime&&sn(t,4,Math.floor(new Date(i.mtime||Date.now())/1e3)),e){t[3]=8;for(var r=0;r<=e.length;++r)t[r+10]=e.charCodeAt(r)}}(n,i),sn(n,o-8,e.d()),sn(n,o-4,r),n}var on=function(t){var i,e,r,s,n="";for(i=e=0,r=(t=(t+"").replace(/\r\n/g,"\n").replace(/\r/g,"\n")).length,s=0;s<r;s++){var o=t.charCodeAt(s),a=null;o<128?e++: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),D(a)||(e>i&&(n+=t.substring(i,e)),n+=a,i=e=s+1)}return e>i&&(n+=t.substring(i,t.length)),n},an=!!u||!!l,ln="text/plain",un=function(t,i,e){var r;void 0===e&&(e=!0);var[s,n]=t.split("?"),o=g({},i),a=null!==(r=null==n?void 0:n.split("&").map((t=>{var i,[r,s]=t.split("="),n=e&&null!==(i=o[r])&&void 0!==i?i:s;return delete o[r],r+"="+n})))&&void 0!==r?r:[],l=ue(o);return l&&a.push(l),s+"?"+a.join("&")},hn=(t,i)=>JSON.stringify(t,((t,i)=>"bigint"==typeof i?i.toString():i),i),dn=t=>{var{data:i,compression:e}=t;if(i){if(e===oe.GZipJS){var r=nn(function(t,i){var e=t.length;if("undefined"!=typeof TextEncoder)return(new TextEncoder).encode(t);for(var r=new $s(t.length+(t.length>>>1)),s=0,n=function(t){r[s++]=t},o=0;o<e;++o){if(s+5>r.length){var a=new $s(s+8+(e-o<<1));a.set(r),r=a}var l=t.charCodeAt(o);l<128||i?n(l):l<2048?(n(192|l>>>6),n(128|63&l)):l>55295&&l<57344?(n(240|(l=65536+(1047552&l)|1023&t.charCodeAt(++o))>>>18),n(128|l>>>12&63),n(128|l>>>6&63),n(128|63&l)):(n(224|l>>>12),n(128|l>>>6&63),n(128|63&l))}return Ws(r,0,s)}(hn(i)),{mtime:0}),s=new Blob([r],{type:ln});return{contentType:ln,body:s,estimatedSize:s.size}}if(e===oe.Base64){var n=function(t){var i,e,r,s,n,o="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",a=0,l=0,u="",h=[];if(!t)return t;t=on(t);do{i=(n=t.charCodeAt(a++)<<16|t.charCodeAt(a++)<<8|t.charCodeAt(a++))>>18&63,e=n>>12&63,r=n>>6&63,s=63&n,h[l++]=o.charAt(i)+o.charAt(e)+o.charAt(r)+o.charAt(s)}while(a<t.length);switch(u=h.join(""),t.length%3){case 1:u=u.slice(0,-2)+"==";break;case 2:u=u.slice(0,-1)+"="}return u}(hn(i)),o=(t=>"data="+encodeURIComponent("string"==typeof t?t:hn(t)))(n);return{contentType:"application/x-www-form-urlencoded",body:o,estimatedSize:new Blob([o]).size}}var a=hn(i);return{contentType:"application/json",body:a,estimatedSize:new Blob([a]).size}}},vn=[];l&&vn.push({transport:"fetch",method:t=>{var i,e,{contentType:r,body:s,estimatedSize:n}=null!==(i=dn(t))&&void 0!==i?i:{},o=new Headers;Mt(t.headers,(function(t,i){o.append(i,t)})),r&&o.append("Content-Type",r);var a=t.url,u=null;if(h){var d=new h;u={signal:d.signal,timeout:setTimeout((()=>d.abort()),t.timeout)}}l(a,g({method:(null==t?void 0:t.method)||"GET",headers:o,keepalive:"POST"===t.method&&(n||0)<52428.8,body:s,signal:null==(e=u)?void 0:e.signal},t.fetchOptions)).then((i=>i.text().then((e=>{var r={statusCode:i.status,text:e};if(200===i.status)try{r.json=JSON.parse(e)}catch(t){Pt.error(t)}null==t.callback||t.callback(r)})))).catch((i=>{Pt.error(i),null==t.callback||t.callback({statusCode:0,text:i})})).finally((()=>u?clearTimeout(u.timeout):null))}}),u&&vn.push({transport:"XHR",method:t=>{var i,e=new u;e.open(t.method||"GET",t.url,!0);var{contentType:r,body:s}=null!==(i=dn(t))&&void 0!==i?i:{};Mt(t.headers,(function(t,i){e.setRequestHeader(i,t)})),r&&e.setRequestHeader("Content-Type",r),t.timeout&&(e.timeout=t.timeout),t.disableXHRCredentials||(e.withCredentials=!0),e.onreadystatechange=()=>{if(4===e.readyState){var i={statusCode:e.status,text:e.responseText};if(200===e.status)try{i.json=JSON.parse(e.responseText)}catch(t){}null==t.callback||t.callback(i)}},e.send(s)}}),null!=n&&n.sendBeacon&&vn.push({transport:"sendBeacon",method:t=>{var i=un(t.url,{beacon:"1"});try{var e,{contentType:r,body:s}=null!==(e=dn(t))&&void 0!==e?e:{},o="string"==typeof s?new Blob([s],{type:r}):s;n.sendBeacon(i,o)}catch(t){}}});var cn=function(t,i){if(!function(t){try{new RegExp(t)}catch(t){return!1}return!0}(i))return!1;try{return new RegExp(i).test(t)}catch(t){return!1}};function fn(t,i,e){return hn({distinct_id:t,userPropertiesToSet:i,userPropertiesToSetOnce:e})}var pn={exact:(t,i)=>i.some((i=>t.some((t=>i===t)))),is_not:(t,i)=>i.every((i=>t.every((t=>i!==t)))),regex:(t,i)=>i.some((i=>t.some((t=>cn(i,t))))),not_regex:(t,i)=>i.every((i=>t.every((t=>!cn(i,t))))),icontains:(t,i)=>i.map(gn).some((i=>t.map(gn).some((t=>i.includes(t))))),not_icontains:(t,i)=>i.map(gn).every((i=>t.map(gn).every((t=>!i.includes(t)))))},gn=t=>t.toLowerCase();function _n(t,i){return!t||Object.entries(t).every((t=>{var[e,r]=t,s=null==i?void 0:i[e];if(M(s)||D(s))return!1;var n=[String(s)],o=pn[r.operator];return!!o&&o(r.values,n)}))}var mn=Tt("[Error tracking]");class yn{constructor(t){var i,e;this.Jt=[],this.Kt=new it([new pt,new $t,new _t,new gt,new Et,new xt,new yt,new St],ft("web:javascript",lt,dt)),this._instance=t,this.Jt=null!==(i=null==(e=this._instance.persistence)?void 0:e.get_property(Xt))&&void 0!==i?i:[]}onRemoteConfig(t){var i,e,r,s=null!==(i=null==(e=t.errorTracking)?void 0:e.suppressionRules)&&void 0!==i?i:[],n=null==(r=t.errorTracking)?void 0:r.captureExtensionExceptions;this.Jt=s,this._instance.persistence&&this._instance.persistence.register({[Xt]:this.Jt,[Qt]:n})}get Yt(){var t,i=!!this._instance.get_property(Qt),e=this._instance.config.error_tracking.captureExtensionExceptions;return null!==(t=null!=e?e:i)&&void 0!==t&&t}buildProperties(t,i){return this.Kt.buildFromUnknown(t,{syntheticException:null==i?void 0:i.syntheticException,mechanism:{handled:null==i?void 0:i.handled}})}sendExceptionEvent(t){var i=t.$exception_list;if(this.Xt(i)){if(this.Qt(i))return void mn.info("Skipping exception capture because a suppression rule matched");if(!this.Yt&&this.Zt(i))return void mn.info("Skipping exception capture because it was thrown by an extension");if(!this._instance.config.error_tracking.__capturePostHogExceptions&&this.ti(i))return void mn.info("Skipping exception capture because it was thrown by the PostHog SDK")}return this._instance.capture("$exception",t,{_noTruncate:!0,_batchKey:"exceptionEvent"})}Qt(t){if(0===t.length)return!1;var i=t.reduce(((t,i)=>{var{type:e,value:r}=i;return O(e)&&e.length>0&&t.$exception_types.push(e),O(r)&&r.length>0&&t.$exception_values.push(r),t}),{$exception_types:[],$exception_values:[]});return this.Jt.some((t=>{var e=t.values.map((t=>{var e,r=pn[t.operator],s=C(t.value)?t.value:[t.value],n=null!==(e=i[t.key])&&void 0!==e?e:[];return s.length>0&&r(s,n)}));return"OR"===t.type?e.some(Boolean):e.every(Boolean)}))}Zt(t){return t.flatMap((t=>{var i,e;return null!==(i=null==(e=t.stacktrace)?void 0:e.frames)&&void 0!==i?i:[]})).some((t=>t.filename&&t.filename.startsWith("chrome-extension://")))}ti(t){if(t.length>0){var i,e,r,s,n=null!==(i=null==(e=t[0].stacktrace)?void 0:e.frames)&&void 0!==i?i:[],o=n[n.length-1];return null!==(r=null==o||null==(s=o.filename)?void 0:s.includes("posthog.com/static"))&&void 0!==r&&r}return!1}Xt(t){return!j(t)&&C(t)}}var bn=Tt("[FeatureFlags]"),wn=Tt("[FeatureFlags]",{debugEnabled:!0}),xn="$active_feature_flags",En="$override_feature_flags",Sn="$feature_flag_payloads",$n="$override_feature_flag_payloads",kn="$feature_flag_request_id",Pn="$feature_flag_evaluated_at",Tn=t=>{var i={};for(var[e,r]of Dt(t||{}))r&&(i[e]=r);return i},Cn=t=>{var i=t.flags;return i?(t.featureFlags=Object.fromEntries(Object.keys(i).map((t=>{var e;return[t,null!==(e=i[t].variant)&&void 0!==e?e:i[t].enabled]}))),t.featureFlagPayloads=Object.fromEntries(Object.keys(i).filter((t=>i[t].enabled)).filter((t=>{var e;return null==(e=i[t].metadata)?void 0:e.payload})).map((t=>{var e;return[t,null==(e=i[t].metadata)?void 0:e.payload]})))):bn.warn("Using an older version of the feature flags endpoint. Please upgrade your PostHog server to the latest version"),t},Rn=function(t){return t.FeatureFlags="feature_flags",t.Recordings="recordings",t}({});class In{constructor(t){this.ii=!1,this.ei=!1,this.ri=!1,this.si=!1,this.ni=!1,this.oi=!1,this.ai=!1,this._instance=t,this.featureFlagEventHandlers=[]}li(){var t=this._instance.config.evaluation_environments;return null!=t&&t.length?t.filter((t=>{var i=t&&"string"==typeof t&&t.trim().length>0;return i||bn.error("Invalid evaluation environment found:",t,"Expected non-empty string"),i})):[]}ui(){return this.li().length>0}flags(){if(this._instance.config.__preview_remote_config)this.oi=!0;else{var t=!this.hi&&(this._instance.config.advanced_disable_feature_flags||this._instance.config.advanced_disable_feature_flags_on_first_load);this.di({disableFlags:t})}}get hasLoadedFlags(){return this.ei}getFlags(){return Object.keys(this.getFlagVariants())}getFlagsWithDetails(){var t=this._instance.get_property(ai),i=this._instance.get_property(En),e=this._instance.get_property($n);if(!e&&!i)return t||{};var r=Ot({},t||{}),s=[...new Set([...Object.keys(e||{}),...Object.keys(i||{})])];for(var n of s){var o,a,l=r[n],u=null==i?void 0:i[n],h=M(u)?null!==(o=null==l?void 0:l.enabled)&&void 0!==o&&o:!!u,d=M(u)?l.variant:"string"==typeof u?u:void 0,v=null==e?void 0:e[n],c=g({},l,{enabled:h,variant:h?null!=d?d:null==l?void 0:l.variant:void 0});if(h!==(null==l?void 0:l.enabled)&&(c.original_enabled=null==l?void 0:l.enabled),d!==(null==l?void 0:l.variant)&&(c.original_variant=null==l?void 0:l.variant),v)c.metadata=g({},null==l?void 0:l.metadata,{payload:v,original_payload:null==l||null==(a=l.metadata)?void 0:a.payload});r[n]=c}return this.ii||(bn.warn(" Overriding feature flag details!",{flagDetails:t,overriddenPayloads:e,finalDetails:r}),this.ii=!0),r}getFlagVariants(){var t=this._instance.get_property(ni),i=this._instance.get_property(En);if(!i)return t||{};for(var e=Ot({},t),r=Object.keys(i),s=0;s<r.length;s++)e[r[s]]=i[r[s]];return this.ii||(bn.warn(" Overriding feature flags!",{enabledFlags:t,overriddenFlags:i,finalFlags:e}),this.ii=!0),e}getFlagPayloads(){var t=this._instance.get_property(Sn),i=this._instance.get_property($n);if(!i)return t||{};for(var e=Ot({},t||{}),r=Object.keys(i),s=0;s<r.length;s++)e[r[s]]=i[r[s]];return this.ii||(bn.warn(" Overriding feature flag payloads!",{flagPayloads:t,overriddenPayloads:i,finalPayloads:e}),this.ii=!0),e}reloadFeatureFlags(){this.si||this._instance.config.advanced_disable_feature_flags||this.hi||(this.hi=setTimeout((()=>{this.di()}),5))}vi(){clearTimeout(this.hi),this.hi=void 0}ensureFlagsLoaded(){this.ei||this.ri||this.hi||this.reloadFeatureFlags()}setAnonymousDistinctId(t){this.$anon_distinct_id=t}setReloadingPaused(t){this.si=t}di(t){var i;if(this.vi(),!this._instance.O())if(this.ri)this.ni=!0;else{var e=this._instance.config.token,r=this._instance.get_property("$device_id"),s={token:e,distinct_id:this._instance.get_distinct_id(),groups:this._instance.getGroups(),$anon_distinct_id:this.$anon_distinct_id,person_properties:g({},(null==(i=this._instance.persistence)?void 0:i.get_initial_props())||{},this._instance.get_property(li)||{}),group_properties:this._instance.get_property(ui)};D(r)||M(r)||(s.$device_id=r),(null!=t&&t.disableFlags||this._instance.config.advanced_disable_feature_flags)&&(s.disable_flags=!0),this.ui()&&(s.evaluation_environments=this.li());var n=this._instance.config.__preview_remote_config,o=n?"/flags/?v=2":"/flags/?v=2&config=true",a=this._instance.config.advanced_only_evaluate_survey_feature_flags?"&only_evaluate_survey_feature_flags=true":"",l=this._instance.requestRouter.endpointFor("flags",o+a);n&&(s.timezone=ps()),this.ri=!0,this._instance._send_request({method:"POST",url:l,data:s,compression:this._instance.config.disable_compression?void 0:oe.Base64,timeout:this._instance.config.feature_flag_request_timeout_ms,callback:t=>{var i,e,r=!0;(200===t.statusCode&&(this.ni||(this.$anon_distinct_id=void 0),r=!1),this.ri=!1,this.oi)||(this.oi=!0,this._instance.ci(null!==(e=t.json)&&void 0!==e?e:{}));if(!s.disable_flags||this.ni)if(this.ai=!r,t.json&&null!=(i=t.json.quotaLimited)&&i.includes(Rn.FeatureFlags))bn.warn("You have hit your feature flags quota limit, and will not be able to load feature flags until the quota is reset. Please visit https://posthog.com/docs/billing/limits-alerts to learn more.");else{var n;if(!s.disable_flags)this.receivedFeatureFlags(null!==(n=t.json)&&void 0!==n?n:{},r);this.ni&&(this.ni=!1,this.di())}}})}}getFeatureFlag(t,i){if(void 0===i&&(i={}),this.ei||this.getFlags()&&this.getFlags().length>0){var e=this.getFlagVariants()[t],r=""+e,s=this._instance.get_property(kn)||void 0,n=this._instance.get_property(Pn)||void 0,o=this._instance.get_property(vi)||{};if((i.send_event||!("send_event"in i))&&(!(t in o)||!o[t].includes(r))){var a,l,u,h,d,v,c,f,p;C(o[t])?o[t].push(r):o[t]=[r],null==(a=this._instance.persistence)||a.register({[vi]:o});var g=this.getFeatureFlagDetails(t),_={$feature_flag:t,$feature_flag_response:e,$feature_flag_payload:this.getFeatureFlagPayload(t)||null,$feature_flag_request_id:s,$feature_flag_evaluated_at:n,$feature_flag_bootstrapped_response:(null==(l=this._instance.config.bootstrap)||null==(l=l.featureFlags)?void 0:l[t])||null,$feature_flag_bootstrapped_payload:(null==(u=this._instance.config.bootstrap)||null==(u=u.featureFlagPayloads)?void 0:u[t])||null,$used_bootstrap_value:!this.ai};M(null==g||null==(h=g.metadata)?void 0:h.version)||(_.$feature_flag_version=g.metadata.version);var m,y=null!==(d=null==g||null==(v=g.reason)?void 0:v.description)&&void 0!==d?d:null==g||null==(c=g.reason)?void 0:c.code;if(y&&(_.$feature_flag_reason=y),null!=g&&null!=(f=g.metadata)&&f.id&&(_.$feature_flag_id=g.metadata.id),M(null==g?void 0:g.original_variant)&&M(null==g?void 0:g.original_enabled)||(_.$feature_flag_original_response=M(g.original_variant)?g.original_enabled:g.original_variant),null!=g&&null!=(p=g.metadata)&&p.original_payload)_.$feature_flag_original_payload=null==g||null==(m=g.metadata)?void 0:m.original_payload;this._instance.capture("$feature_flag_called",_)}return e}bn.warn('getFeatureFlag for key "'+t+"\" failed. Feature flags didn't load in time.")}getFeatureFlagDetails(t){return this.getFlagsWithDetails()[t]}getFeatureFlagPayload(t){return this.getFlagPayloads()[t]}getRemoteConfigPayload(t,i){var e=this._instance.config.token,r={distinct_id:this._instance.get_distinct_id(),token:e};this.ui()&&(r.evaluation_environments=this.li()),this._instance._send_request({method:"POST",url:this._instance.requestRouter.endpointFor("flags","/flags/?v=2&config=true"),data:r,compression:this._instance.config.disable_compression?void 0:oe.Base64,timeout:this._instance.config.feature_flag_request_timeout_ms,callback:e=>{var r,s=null==(r=e.json)?void 0:r.featureFlagPayloads;i((null==s?void 0:s[t])||void 0)}})}isFeatureEnabled(t,i){if(void 0===i&&(i={}),this.ei||this.getFlags()&&this.getFlags().length>0){var e=this.getFeatureFlag(t,i);return M(e)?void 0:!!e}bn.warn('isFeatureEnabled for key "'+t+"\" failed. Feature flags didn't load in time.")}addFeatureFlagsHandler(t){this.featureFlagEventHandlers.push(t)}removeFeatureFlagsHandler(t){this.featureFlagEventHandlers=this.featureFlagEventHandlers.filter((i=>i!==t))}receivedFeatureFlags(t,i){if(this._instance.persistence){this.ei=!0;var e=this.getFlagVariants(),r=this.getFlagPayloads(),s=this.getFlagsWithDetails();!function(t,i,e,r,s){void 0===e&&(e={}),void 0===r&&(r={}),void 0===s&&(s={});var n=Cn(t),o=n.flags,a=n.featureFlags,l=n.featureFlagPayloads;if(a){var u=t.requestId,h=t.evaluatedAt;if(C(a)){bn.warn("v1 of the feature flags endpoint is deprecated. Please use the latest version.");var d={};if(a)for(var v=0;v<a.length;v++)d[a[v]]=!0;i&&i.register({[xn]:a,[ni]:d})}else{var c=a,f=l,p=o;t.errorsWhileComputingFlags&&(c=g({},e,c),f=g({},r,f),p=g({},s,p)),i&&i.register(g({[xn]:Object.keys(Tn(c)),[ni]:c||{},[Sn]:f||{},[ai]:p||{}},u?{[kn]:u}:{},h?{[Pn]:h}:{}))}}}(t,this._instance.persistence,e,r,s),this.fi(i)}}override(t,i){void 0===i&&(i=!1),bn.warn("override is deprecated. Please use overrideFeatureFlags instead."),this.overrideFeatureFlags({flags:t,suppressWarning:i})}overrideFeatureFlags(t){if(!this._instance.__loaded||!this._instance.persistence)return bn.uninitializedWarning("posthog.featureFlags.overrideFeatureFlags");if(!1===t)return this._instance.persistence.unregister(En),this._instance.persistence.unregister($n),this.fi(),wn.info("All overrides cleared");if(t&&"object"==typeof t&&("flags"in t||"payloads"in t)){var i,e=t;if(this.ii=Boolean(null!==(i=e.suppressWarning)&&void 0!==i&&i),"flags"in e)if(!1===e.flags)this._instance.persistence.unregister(En),wn.info("Flag overrides cleared");else if(e.flags){if(C(e.flags)){for(var r={},s=0;s<e.flags.length;s++)r[e.flags[s]]=!0;this._instance.persistence.register({[En]:r})}else this._instance.persistence.register({[En]:e.flags});wn.info("Flag overrides set",{flags:e.flags})}return"payloads"in e&&(!1===e.payloads?(this._instance.persistence.unregister($n),wn.info("Payload overrides cleared")):e.payloads&&(this._instance.persistence.register({[$n]:e.payloads}),wn.info("Payload overrides set",{payloads:e.payloads}))),void this.fi()}this.fi()}onFeatureFlags(t){if(this.addFeatureFlagsHandler(t),this.ei){var{flags:i,flagVariants:e}=this.pi();t(i,e)}return()=>this.removeFeatureFlagsHandler(t)}updateEarlyAccessFeatureEnrollment(t,i,e){var r,s=(this._instance.get_property(oi)||[]).find((i=>i.flagKey===t)),n={["$feature_enrollment/"+t]:i},o={$feature_flag:t,$feature_enrollment:i,$set:n};s&&(o.$early_access_feature_name=s.name),e&&(o.$feature_enrollment_stage=e),this._instance.capture("$feature_enrollment_update",o),this.setPersonPropertiesForFlags(n,!1);var a=g({},this.getFlagVariants(),{[t]:i});null==(r=this._instance.persistence)||r.register({[xn]:Object.keys(Tn(a)),[ni]:a}),this.fi()}getEarlyAccessFeatures(t,i,e){void 0===i&&(i=!1);var r=this._instance.get_property(oi),s=e?"&"+e.map((t=>"stage="+t)).join("&"):"";if(r&&!i)return t(r);this._instance._send_request({url:this._instance.requestRouter.endpointFor("api","/api/early_access_features/?token="+this._instance.config.token+s),method:"GET",callback:i=>{var e,r;if(i.json){var s=i.json.earlyAccessFeatures;return null==(e=this._instance.persistence)||e.unregister(oi),null==(r=this._instance.persistence)||r.register({[oi]:s}),t(s)}}})}pi(){var t=this.getFlags(),i=this.getFlagVariants();return{flags:t.filter((t=>i[t])),flagVariants:Object.keys(i).filter((t=>i[t])).reduce(((t,e)=>(t[e]=i[e],t)),{})}}fi(t){var{flags:i,flagVariants:e}=this.pi();this.featureFlagEventHandlers.forEach((r=>r(i,e,{errorsLoading:t})))}setPersonPropertiesForFlags(t,i){void 0===i&&(i=!0);var e=this._instance.get_property(li)||{};this._instance.register({[li]:g({},e,t)}),i&&this._instance.reloadFeatureFlags()}resetPersonPropertiesForFlags(){this._instance.unregister(li)}setGroupPropertiesForFlags(t,i){void 0===i&&(i=!0);var e=this._instance.get_property(ui)||{};0!==Object.keys(e).length&&Object.keys(e).forEach((i=>{e[i]=g({},e[i],t[i]),delete t[i]})),this._instance.register({[ui]:g({},e,t)}),i&&this._instance.reloadFeatureFlags()}resetGroupPropertiesForFlags(t){if(t){var i=this._instance.get_property(ui)||{};this._instance.register({[ui]:g({},i,{[t]:{}})})}else this._instance.unregister(ui)}reset(){this.ei=!1,this.ri=!1,this.si=!1,this.ni=!1,this.oi=!1,this.ai=!1,this.$anon_distinct_id=void 0,this.vi(),this.ii=!1}}var Fn=["cookie","localstorage","localstorage+cookie","sessionstorage","memory"];class Mn{constructor(t,i){this.I=t,this.props={},this.gi=!1,this.mi=(t=>{var i="";return t.token&&(i=t.token.replace(/\+/g,"PL").replace(/\//g,"SL").replace(/=/g,"EQ")),t.persistence_name?"ph_"+t.persistence_name:"ph_"+i+"_posthog"})(t),this.Y=this.yi(t),this.load(),t.debug&&Pt.info("Persistence loaded",t.persistence,g({},this.props)),this.update_config(t,t,i),this.save()}isDisabled(){return!!this.bi}yi(t){-1===Fn.indexOf(t.persistence.toLowerCase())&&(Pt.critical("Unknown persistence type "+t.persistence+"; falling back to localStorage+cookie"),t.persistence="localStorage+cookie");var i=t.persistence.toLowerCase();return"localstorage"===i&&Fe.H()?Fe:"localstorage+cookie"===i&&Oe.H()?Oe:"sessionstorage"===i&&Le.H()?Le:"memory"===i?De:"cookie"===i?Re:Oe.H()?Oe:Re}properties(){var t={};return Mt(this.props,(function(i,e){if(e===ni&&I(i))for(var r=Object.keys(i),n=0;n<r.length;n++)t["$feature/"+r[n]]=i[r[n]];else a=e,l=!1,(D(o=xi)?l:s&&o.indexOf===s?-1!=o.indexOf(a):(Mt(o,(function(t){if(l||(l=t===a))return It})),l))||(t[e]=i);var o,a,l})),t}load(){if(!this.bi){var t=this.Y.W(this.mi);t&&(this.props=Ot({},t))}}save(){this.bi||this.Y.G(this.mi,this.props,this.wi,this.xi,this.Ei,this.I.debug)}remove(){this.Y.V(this.mi,!1),this.Y.V(this.mi,!0)}clear(){this.remove(),this.props={}}register_once(t,i,e){if(I(t)){M(i)&&(i="None"),this.wi=M(e)?this.Si:e;var r=!1;if(Mt(t,((t,e)=>{this.props.hasOwnProperty(e)&&this.props[e]!==i||(this.props[e]=t,r=!0)})),r)return this.save(),!0}return!1}register(t,i){if(I(t)){this.wi=M(i)?this.Si:i;var e=!1;if(Mt(t,((i,r)=>{t.hasOwnProperty(r)&&this.props[r]!==i&&(this.props[r]=i,e=!0)})),e)return this.save(),!0}return!1}unregister(t){t in this.props&&(delete this.props[t],this.save())}update_campaign_params(){if(!this.gi){var t=ls(this.I.custom_campaign_params,this.I.mask_personal_data_properties,this.I.custom_personal_data_properties);F(Nt(t))||this.register(t),this.gi=!0}}update_search_keyword(){var t;this.register((t=null==o?void 0:o.referrer)?hs(t):{})}update_referrer_info(){var t;this.register_once({$referrer:vs(),$referring_domain:null!=o&&o.referrer&&(null==(t=le(o.referrer))?void 0:t.host)||"$direct"},void 0)}set_initial_person_info(){this.props[gi]||this.props[_i]||this.register_once({[mi]:cs(this.I.mask_personal_data_properties,this.I.custom_personal_data_properties)},void 0)}get_initial_props(){var t={};Mt([_i,gi],(i=>{var e=this.props[i];e&&Mt(e,(function(i,e){t["$initial_"+E(e)]=i}))}));var i,e,r=this.props[mi];if(r){var s=(i=fs(r),e={},Mt(i,(function(t,i){e["$initial_"+E(i)]=t})),e);Ot(t,s)}return t}safe_merge(t){return Mt(this.props,(function(i,e){e in t||(t[e]=i)})),t}update_config(t,i,e){if(this.Si=this.wi=t.cookie_expiration,this.set_disabled(t.disable_persistence||!!e),this.set_cross_subdomain(t.cross_subdomain_cookie),this.set_secure(t.secure_cookie),t.persistence!==i.persistence){var r=this.yi(t),s=this.props;this.clear(),this.Y=r,this.props=s,this.save()}}set_disabled(t){this.bi=t,this.bi?this.remove():this.save()}set_cross_subdomain(t){t!==this.xi&&(this.xi=t,this.remove(),this.save())}set_secure(t){t!==this.Ei&&(this.Ei=t,this.remove(),this.save())}set_event_timer(t,i){var e=this.props[Vt]||{};e[t]=i,this.props[Vt]=e,this.save()}remove_event_timer(t){var i=(this.props[Vt]||{})[t];return M(i)||(delete this.props[Vt][t],this.save()),i}get_property(t){return this.props[t]}set_property(t,i){this.props[t]=i,this.save()}}var On=Tt("[Product Tours]"),An="ph_product_tours";class Dn{constructor(t){this.$i=null,this.ki=null,this.Pi=void 0,this.Ti=!1,this._instance=t}onRemoteConfig(t){if(this._instance.config.disable_product_tours)On.info("Product tours disabled via config");else{var i=t.productTours;j(i)?On.info("Product tours not enabled in remote config"):(this.Pi=i,On.info("Remote config received, isProductToursEnabled: "+this.Pi),this.loadIfEnabled())}}loadIfEnabled(){var t;if(!this.ki)if(this.Ti)On.info("Already initializing product tours, skipping...");else if(this._instance.config.disable_product_tours)On.info("Product tours disabled via config");else{var i=null==v?void 0:v.__PosthogExtensions__;if(i){var e=null==(t=this._instance.featureFlags)?void 0:t.isFeatureEnabled("product-tours-2025");if(!M(this.Pi)||e){var r=this.Pi||e;if(r){this.Ti=!0;try{var s=i.generateProductTours;if(s)return void this.Ci(s,r);var n=i.loadExternalDependency;if(!n)return On.error("PostHog loadExternalDependency extension not found."),void(this.Ti=!1);n(this._instance,"product-tours",(t=>{t||!i.generateProductTours?On.error("Could not load product tours script",t):this.Ci(i.generateProductTours,r),this.Ti=!1}))}catch(t){On.error("Error initializing product tours",t),this.Ti=!1}}else On.info("Product tours not enabled")}else On.info("Waiting for remote config or feature flag to enable product tours")}else On.error("PostHog Extensions not found.")}}Ci(t,i){this.ki=t(this._instance,i)||null,On.info("Product tours loaded successfully")}getProductTours(t,i){if(void 0===i&&(i=!1),!C(this.$i)||i){var e=this._instance.persistence;if(e){var r=e.props[An];if(C(r)&&!i)return this.$i=r,void t(r,{isLoaded:!0})}this._instance._send_request({url:this._instance.requestRouter.endpointFor("api","/api/product_tours/?token="+this._instance.config.token),method:"GET",callback:i=>{var r=i.statusCode;if(200!==r||!i.json){var s="Product Tours API could not be loaded, status: "+r;return On.error(s),void t([],{isLoaded:!1,error:s})}var n=C(i.json.product_tours)?i.json.product_tours:[];this.$i=n,e&&e.register({[An]:n}),t(n,{isLoaded:!0})}})}else t(this.$i,{isLoaded:!0})}getActiveProductTours(t){if(j(this.ki))return On.warn("Product tours not loaded yet"),void t([],{isLoaded:!1,error:"Product tours not loaded"});this.ki.getActiveProductTours(t)}showProductTour(t){var i;On.info("showProductTour("+t+")"),null==(i=this.ki)||i.showTourById(t)}dismissProductTour(){var t;null==(t=this.ki)||t.dismissTour("user_clicked_skip")}nextStep(){var t;null==(t=this.ki)||t.nextStep()}previousStep(){var t;null==(t=this.ki)||t.previousStep()}clearCache(){this.$i=null;var t=this._instance.persistence;t&&t.unregister(An)}resetTour(t){var i;null==(i=this.ki)||i.resetTour(t)}resetAllTours(){var t;null==(t=this.ki)||t.resetAllTours()}}var jn=function(t){return t.Activation="events",t.Cancellation="cancelEvents",t}({}),Ln=function(t){return t.Button="button",t.Tab="tab",t.Selector="selector",t}({}),Nn=function(t){return t.TopLeft="top_left",t.TopRight="top_right",t.TopCenter="top_center",t.MiddleLeft="middle_left",t.MiddleRight="middle_right",t.MiddleCenter="middle_center",t.Left="left",t.Center="center",t.Right="right",t.NextToTrigger="next_to_trigger",t}({}),Un=function(t){return t.Top="top",t.Left="left",t.Right="right",t.Bottom="bottom",t}({}),zn=function(t){return t.Popover="popover",t.API="api",t.Widget="widget",t.ExternalSurvey="external_survey",t}({}),Hn=function(t){return t.Open="open",t.MultipleChoice="multiple_choice",t.SingleChoice="single_choice",t.Rating="rating",t.Link="link",t}({}),Bn=function(t){return t.NextQuestion="next_question",t.End="end",t.ResponseBased="response_based",t.SpecificQuestion="specific_question",t}({}),qn=function(t){return t.Once="once",t.Recurring="recurring",t.Always="always",t}({}),Wn=function(t){return t.SHOWN="survey shown",t.DISMISSED="survey dismissed",t.SENT="survey sent",t}({}),Gn=function(t){return t.SURVEY_ID="$survey_id",t.SURVEY_NAME="$survey_name",t.SURVEY_RESPONSE="$survey_response",t.SURVEY_ITERATION="$survey_iteration",t.SURVEY_ITERATION_START_DATE="$survey_iteration_start_date",t.SURVEY_PARTIALLY_COMPLETED="$survey_partially_completed",t.SURVEY_SUBMISSION_ID="$survey_submission_id",t.SURVEY_QUESTIONS="$survey_questions",t.SURVEY_COMPLETED="$survey_completed",t}({}),Vn=function(t){return t.Popover="popover",t.Inline="inline",t}({});class Jn{constructor(){this.Ri={},this.Ri={}}on(t,i){return this.Ri[t]||(this.Ri[t]=[]),this.Ri[t].push(i),()=>{this.Ri[t]=this.Ri[t].filter((t=>t!==i))}}emit(t,i){for(var e of this.Ri[t]||[])e(i);for(var r of this.Ri["*"]||[])r(t,i)}}function Kn(t,i,e){if(j(t))return!1;switch(e){case"exact":return t===i;case"contains":var r=i.replace(/[.*+?^${}()|[\]\\]/g,"\\$&").replace(/_/g,".").replace(/%/g,".*");return new RegExp(r,"i").test(t);case"regex":try{return new RegExp(i).test(t)}catch(t){return!1}default:return!1}}class Yn{constructor(t){this.Ii=new Jn,this.Fi=(t,i)=>this.Mi(t,i)&&this.Oi(t,i)&&this.Ai(t,i)&&this.Di(t,i),this.Mi=(t,i)=>null==i||!i.event||(null==t?void 0:t.event)===(null==i?void 0:i.event),this._instance=t,this.ji=new Set,this.Li=new Set}init(){var t;if(!M(null==(t=this._instance)?void 0:t.Ni)){var i;null==(i=this._instance)||i.Ni(((t,i)=>{this.on(t,i)}))}}register(t){var i,e;if(!M(null==(i=this._instance)?void 0:i.Ni)&&(t.forEach((t=>{var i,e;null==(i=this.Li)||i.add(t),null==(e=t.steps)||e.forEach((t=>{var i;null==(i=this.ji)||i.add((null==t?void 0:t.event)||"")}))})),null!=(e=this._instance)&&e.autocapture)){var r,s=new Set;t.forEach((t=>{var i;null==(i=t.steps)||i.forEach((t=>{null!=t&&t.selector&&s.add(null==t?void 0:t.selector)}))})),null==(r=this._instance)||r.autocapture.setElementSelectors(s)}}on(t,i){var e;null!=i&&0!=t.length&&(this.ji.has(t)||this.ji.has(null==i?void 0:i.event))&&this.Li&&(null==(e=this.Li)?void 0:e.size)>0&&this.Li.forEach((t=>{this.Ui(i,t)&&this.Ii.emit("actionCaptured",t.name)}))}zi(t){this.onAction("actionCaptured",(i=>t(i)))}Ui(t,i){if(null==(null==i?void 0:i.steps))return!1;for(var e of i.steps)if(this.Fi(t,e))return!0;return!1}onAction(t,i){return this.Ii.on(t,i)}Oi(t,i){if(null!=i&&i.url){var e,r=null==t||null==(e=t.properties)?void 0:e.$current_url;if(!r||"string"!=typeof r)return!1;if(!Kn(r,i.url,i.url_matching||"contains"))return!1}return!0}Ai(t,i){return!!this.Hi(t,i)&&(!!this.Bi(t,i)&&!!this.qi(t,i))}Hi(t,i){var e;if(null==i||!i.href)return!0;var r=this.Wi(t);if(r.length>0)return r.some((t=>Kn(t.href,i.href,i.href_matching||"exact")));var s,n=(null==t||null==(e=t.properties)?void 0:e.$elements_chain)||"";return!!n&&Kn((s=n.match(/(?::|")href="(.*?)"/))?s[1]:"",i.href,i.href_matching||"exact")}Bi(t,i){var e;if(null==i||!i.text)return!0;var r=this.Wi(t);if(r.length>0)return r.some((t=>Kn(t.text,i.text,i.text_matching||"exact")||Kn(t.$el_text,i.text,i.text_matching||"exact")));var s,n,o,a=(null==t||null==(e=t.properties)?void 0:e.$elements_chain)||"";return!!a&&(s=function(t){for(var i,e=[],r=/(?::|")text="(.*?)"/g;!j(i=r.exec(t));)e.includes(i[1])||e.push(i[1]);return e}(a),n=i.text,o=i.text_matching||"exact",s.some((t=>Kn(t,n,o))))}qi(t,i){var e,r;if(null==i||!i.selector)return!0;var s=null==t||null==(e=t.properties)?void 0:e.$element_selectors;if(null!=s&&s.includes(i.selector))return!0;var n=(null==t||null==(r=t.properties)?void 0:r.$elements_chain)||"";if(i.selector_regex&&n)try{return new RegExp(i.selector_regex).test(n)}catch(t){return!1}return!1}Wi(t){var i;return null==(null==t||null==(i=t.properties)?void 0:i.$elements)?[]:null==t?void 0:t.properties.$elements}Di(t,i){return null==i||!i.properties||0===i.properties.length||_n(i.properties.reduce(((t,i)=>{var e=C(i.value)?i.value.map(String):null!=i.value?[String(i.value)]:[];return t[i.key]={values:e,operator:i.operator||"exact"},t}),{}),null==t?void 0:t.properties)}}var Xn=Tt("[Surveys]");var Qn="seenSurvey_",Zn=(t,i)=>{var e="$survey_"+i+"/"+t.id;return t.current_iteration&&t.current_iteration>0&&(e="$survey_"+i+"/"+t.id+"/"+t.current_iteration),e},to=t=>{var i=""+Qn+t.id;return t.current_iteration&&t.current_iteration>0&&(i=""+Qn+t.id+"_"+t.current_iteration),i},io=[zn.Popover,zn.Widget,zn.API],eo={ignoreConditions:!1,ignoreDelay:!1,displayType:Vn.Popover};class ro{constructor(t){this._instance=t,this.Gi=new Map,this.Vi=new Map,this.Ji=new Map}Ki(t,i){return!!t&&_n(t.propertyFilters,null==i?void 0:i.properties)}Yi(t,i){var e=new Map;return t.forEach((t=>{var r;null==(r=t.conditions)||null==(r=r[i])||null==(r=r.values)||r.forEach((i=>{if(null!=i&&i.name){var r=e.get(i.name)||[];r.push(t.id),e.set(i.name,r)}}))})),e}Xi(t,i,e){var r,s=(e===jn.Activation?this.Gi:this.Vi).get(t),n=[];return null==(r=this._instance)||r.getSurveys((t=>{n=t.filter((t=>null==s?void 0:s.includes(t.id)))})),n.filter((r=>{var s,n=null==(s=r.conditions)||null==(s=s[e])||null==(s=s.values)?void 0:s.find((i=>i.name===t));return this.Ki(n,i)}))}register(t){var i;M(null==(i=this._instance)?void 0:i.Ni)||(this.Qi(t),this.Zi(t))}Zi(t){var i=t.filter((t=>{var i,e;return(null==(i=t.conditions)?void 0:i.actions)&&(null==(e=t.conditions)||null==(e=e.actions)||null==(e=e.values)?void 0:e.length)>0}));if(0!==i.length){if(null==this.te){this.te=new Yn(this._instance),this.te.init();this.te.zi((t=>{this.onAction(t)}))}i.forEach((t=>{var i,e,r,s,n;t.conditions&&null!=(i=t.conditions)&&i.actions&&null!=(e=t.conditions)&&null!=(e=e.actions)&&e.values&&(null==(r=t.conditions)||null==(r=r.actions)||null==(r=r.values)?void 0:r.length)>0&&(null==(s=this.te)||s.register(t.conditions.actions.values),null==(n=t.conditions)||null==(n=n.actions)||null==(n=n.values)||n.forEach((i=>{if(i&&i.name){var e=this.Ji.get(i.name);e&&e.push(t.id),this.Ji.set(i.name,e||[t.id])}})))}))}}Qi(t){var i,e=t.filter((t=>{var i,e;return(null==(i=t.conditions)?void 0:i.events)&&(null==(e=t.conditions)||null==(e=e.events)||null==(e=e.values)?void 0:e.length)>0})),r=t.filter((t=>{var i,e;return(null==(i=t.conditions)?void 0:i.cancelEvents)&&(null==(e=t.conditions)||null==(e=e.cancelEvents)||null==(e=e.values)?void 0:e.length)>0}));if(0!==e.length||0!==r.length){null==(i=this._instance)||i.Ni(((t,i)=>{this.onEvent(t,i)})),this.Gi=this.Yi(t,jn.Activation),this.Vi=this.Yi(t,jn.Cancellation)}}onEvent(t,i){var e,r=(null==(e=this._instance)||null==(e=e.persistence)?void 0:e.props[di])||[];if(Wn.SHOWN===t&&i&&r.length>0){var s;Xn.info("survey event matched, removing survey from activated surveys",{event:t,eventPayload:i,existingActivatedSurveys:r});var n=null==i||null==(s=i.properties)?void 0:s.$survey_id;if(n){var o=r.indexOf(n);o>=0&&(r.splice(o,1),this.ie(r))}}else{if(this.Vi.has(t)){var a=this.Xi(t,i,jn.Cancellation);a.length>0&&(Xn.info("cancel event matched, cancelling surveys",{event:t,surveysToCancel:a.map((t=>t.id))}),a.forEach((t=>{var i,e=r.indexOf(t.id);e>=0&&r.splice(e,1),null==(i=this._instance)||i.cancelPendingSurvey(t.id)})),this.ie(r))}if(this.Gi.has(t)){Xn.info("survey event name matched",{event:t,eventPayload:i,surveys:this.Gi.get(t)});var l=this.Xi(t,i,jn.Activation);this.ie(r.concat(l.map((t=>t.id))||[]))}}}onAction(t){var i,e=(null==(i=this._instance)||null==(i=i.persistence)?void 0:i.props[di])||[];this.Ji.has(t)&&this.ie(e.concat(this.Ji.get(t)||[]))}ie(t){var i;Xn.info("updating activated surveys",{activatedSurveys:t}),null==(i=this._instance)||null==(i=i.persistence)||i.register({[di]:[...new Set(t)]})}getSurveys(){var t,i=null==(t=this._instance)||null==(t=t.persistence)?void 0:t.props[di];return i||[]}getEventToSurveys(){return this.Gi}ee(){return this.te}}class so{constructor(t){this.re=void 0,this._surveyManager=null,this.se=!1,this.ne=!1,this.oe=[],this._instance=t,this._surveyEventReceiver=null}onRemoteConfig(t){if(!this._instance.config.disable_surveys){var i=t.surveys;if(j(i))return Xn.warn("Flags not loaded yet. Not loading surveys.");var e=C(i);this.re=e?i.length>0:i,Xn.info("flags response received, isSurveysEnabled: "+this.re),this.loadIfEnabled()}}reset(){localStorage.removeItem("lastSeenSurveyDate");for(var t=[],i=0;i<localStorage.length;i++){var e=localStorage.key(i);(null!=e&&e.startsWith(Qn)||null!=e&&e.startsWith("inProgressSurvey_"))&&t.push(e)}t.forEach((t=>localStorage.removeItem(t)))}loadIfEnabled(){if(!this._surveyManager)if(this.ne)Xn.info("Already initializing surveys, skipping...");else if(this._instance.config.disable_surveys)Xn.info("Disabled. Not loading surveys.");else if(this._instance.config.cookieless_mode&&this._instance.consent.isOptedOut())Xn.info("Not loading surveys in cookieless mode without consent.");else{var t=null==v?void 0:v.__PosthogExtensions__;if(t){if(!M(this.re)||this._instance.config.advanced_enable_surveys){var i=this.re||this._instance.config.advanced_enable_surveys;this.ne=!0;try{var e=t.generateSurveys;if(e)return void this.ae(e,i);var r=t.loadExternalDependency;if(!r)return void this.le("PostHog loadExternalDependency extension not found.");r(this._instance,"surveys",(e=>{e||!t.generateSurveys?this.le("Could not load surveys script",e):this.ae(t.generateSurveys,i)}))}catch(t){throw this.le("Error initializing surveys",t),t}finally{this.ne=!1}}}else Xn.error("PostHog Extensions not found.")}}ae(t,i){this._surveyManager=t(this._instance,i),this._surveyEventReceiver=new ro(this._instance),Xn.info("Surveys loaded successfully"),this.ue({isLoaded:!0})}le(t,i){Xn.error(t,i),this.ue({isLoaded:!1,error:t})}onSurveysLoaded(t){return this.oe.push(t),this._surveyManager&&this.ue({isLoaded:!0}),()=>{this.oe=this.oe.filter((i=>i!==t))}}getSurveys(t,i){if(void 0===i&&(i=!1),this._instance.config.disable_surveys)return Xn.info("Disabled. Not loading surveys."),t([]);var e=this._instance.get_property(hi);if(e&&!i)return t(e,{isLoaded:!0});if(this.se)return t([],{isLoaded:!1,error:"Surveys are already being loaded"});try{this.se=!0,this._instance._send_request({url:this._instance.requestRouter.endpointFor("api","/api/surveys/?token="+this._instance.config.token),method:"GET",timeout:this._instance.config.surveys_request_timeout_ms,callback:i=>{var e;this.se=!1;var r=i.statusCode;if(200!==r||!i.json){var s="Surveys API could not be loaded, status: "+r;return Xn.error(s),t([],{isLoaded:!1,error:s})}var n,o=i.json.surveys||[],a=o.filter((t=>function(t){return!(!t.start_date||t.end_date)}(t)&&(function(t){var i;return!(null==(i=t.conditions)||null==(i=i.events)||null==(i=i.values)||!i.length)}(t)||function(t){var i;return!(null==(i=t.conditions)||null==(i=i.actions)||null==(i=i.values)||!i.length)}(t))));a.length>0&&(null==(n=this._surveyEventReceiver)||n.register(a));return null==(e=this._instance.persistence)||e.register({[hi]:o}),t(o,{isLoaded:!0})}})}catch(t){throw this.se=!1,t}}ue(t){for(var i of this.oe)try{if(!t.isLoaded)return i([],t);this.getSurveys(i)}catch(t){Xn.error("Error in survey callback",t)}}getActiveMatchingSurveys(t,i){if(void 0===i&&(i=!1),!j(this._surveyManager))return this._surveyManager.getActiveMatchingSurveys(t,i);Xn.warn("init was not called")}he(t){var i=null;return this.getSurveys((e=>{var r;i=null!==(r=e.find((i=>i.id===t)))&&void 0!==r?r:null})),i}de(t){if(j(this._surveyManager))return{eligible:!1,reason:"SDK is not enabled or survey functionality is not yet loaded"};var i="string"==typeof t?this.he(t):t;return i?this._surveyManager.checkSurveyEligibility(i):{eligible:!1,reason:"Survey not found"}}canRenderSurvey(t){if(j(this._surveyManager))return Xn.warn("init was not called"),{visible:!1,disabledReason:"SDK is not enabled or survey functionality is not yet loaded"};var i=this.de(t);return{visible:i.eligible,disabledReason:i.reason}}canRenderSurveyAsync(t,i){return j(this._surveyManager)?(Xn.warn("init was not called"),Promise.resolve({visible:!1,disabledReason:"SDK is not enabled or survey functionality is not yet loaded"})):new Promise((e=>{this.getSurveys((i=>{var r,s=null!==(r=i.find((i=>i.id===t)))&&void 0!==r?r:null;if(s){var n=this.de(s);e({visible:n.eligible,disabledReason:n.reason})}else e({visible:!1,disabledReason:"Survey not found"})}),i)}))}renderSurvey(t,i){var e;if(j(this._surveyManager))Xn.warn("init was not called");else{var r="string"==typeof t?this.he(t):t;if(null!=r&&r.id)if(io.includes(r.type)){var s=null==o?void 0:o.querySelector(i);if(s)return null!=(e=r.appearance)&&e.surveyPopupDelaySeconds?(Xn.info("Rendering survey "+r.id+" with delay of "+r.appearance.surveyPopupDelaySeconds+" seconds"),void setTimeout((()=>{var t,i;Xn.info("Rendering survey "+r.id+" with delay of "+(null==(t=r.appearance)?void 0:t.surveyPopupDelaySeconds)+" seconds"),null==(i=this._surveyManager)||i.renderSurvey(r,s),Xn.info("Survey "+r.id+" rendered")}),1e3*r.appearance.surveyPopupDelaySeconds)):void this._surveyManager.renderSurvey(r,s);Xn.warn("Survey element not found")}else Xn.warn("Surveys of type "+r.type+" cannot be rendered in the app");else Xn.warn("Survey not found")}}displaySurvey(t,i){var e;if(j(this._surveyManager))Xn.warn("init was not called");else{var r=this.he(t);if(r){var s=r;if(null!=(e=r.appearance)&&e.surveyPopupDelaySeconds&&i.ignoreDelay&&(s=g({},r,{appearance:g({},r.appearance,{surveyPopupDelaySeconds:0})})),!1===i.ignoreConditions){var n=this.canRenderSurvey(r);if(!n.visible)return void Xn.warn("Survey is not eligible to be displayed: ",n.disabledReason)}i.displayType!==Vn.Inline?this._surveyManager.handlePopoverSurvey(s):this.renderSurvey(s,i.selector)}else Xn.warn("Survey not found")}}cancelPendingSurvey(t){j(this._surveyManager)?Xn.warn("init was not called"):this._surveyManager.cancelSurvey(t)}}var no=Tt("[Conversations]");class oo{constructor(t){this.ve=void 0,this._conversationsManager=null,this.Ti=!1,this.ce=null,this._instance=t}onRemoteConfig(t){if(!this._instance.config.disable_conversations){var i=t.conversations;j(i)||(N(i)?this.ve=i:(this.ve=i.enabled,this.ce=i),this.loadIfEnabled())}}reset(){var t;null==(t=this._conversationsManager)||t.reset(),this._conversationsManager=null,this.ve=void 0,this.ce=null}loadIfEnabled(){if(!this._conversationsManager&&!this.Ti&&!(this._instance.config.disable_conversations||this._instance.config.cookieless_mode&&this._instance.consent.isOptedOut())){var i=null==v?void 0:v.__PosthogExtensions__;if(i&&!M(this.ve)&&this.ve)if(this.ce&&this.ce.token){if(function(i){var e;if(!i||0===i.length)return!0;var r=null==t||null==(e=t.location)?void 0:e.hostname;return!r||i.some((t=>{var i=function(t){var i=t.replace(/^https?:\/\//,"");return(i=i.split("/")[0].split("?")[0].split(":")[0])||null}(t);if(!i)return!1;if(i.startsWith("*.")){var e=i.slice(2);return r.endsWith("."+e)||r===e}return r===i}))}(this.ce.domains)){this.Ti=!0;try{var e=i.initConversations;if(e)return this.Ci(e),void(this.Ti=!1);var r=i.loadExternalDependency;if(!r)return void this.fe("PostHog loadExternalDependency extension not found.");r(this._instance,"conversations",(t=>{t||!i.initConversations?this.fe("Could not load conversations script",t):this.Ci(i.initConversations),this.Ti=!1}))}catch(t){this.fe("Error initializing conversations",t),this.Ti=!1}}}else no.error("Conversations enabled but missing token in remote config.")}}Ci(t){if(this.ce)try{this._conversationsManager=t(this.ce,this._instance),no.info("Conversations loaded successfully")}catch(t){this.fe("Error completing conversations initialization",t)}else no.error("Cannot complete initialization: remote config is null")}fe(t,i){no.error(t,i),this._conversationsManager=null,this.Ti=!1}enable(){this._conversationsManager?this._conversationsManager.enable():no.warn("Conversations not loaded yet.")}disable(){this._conversationsManager&&this._conversationsManager.disable()}isLoaded(){return!D(this._conversationsManager)}isEnabled(){return!0===this.ve}}var ao=Tt("[RateLimiter]");class lo{constructor(t){var i,e;this.serverLimits={},this.lastEventRateLimited=!1,this.checkForLimiting=t=>{var i=t.text;if(i&&i.length)try{(JSON.parse(i).quota_limited||[]).forEach((t=>{ao.info((t||"events")+" is quota limited."),this.serverLimits[t]=(new Date).getTime()+6e4}))}catch(t){return void ao.warn('could not rate limit - continuing. Error: "'+(null==t?void 0:t.message)+'"',{text:i})}},this.instance=t,this.captureEventsPerSecond=(null==(i=t.config.rate_limiting)?void 0:i.events_per_second)||10,this.captureEventsBurstLimit=Math.max((null==(e=t.config.rate_limiting)?void 0:e.events_burst_limit)||10*this.captureEventsPerSecond,this.captureEventsPerSecond),this.lastEventRateLimited=this.clientRateLimitContext(!0).isRateLimited}clientRateLimitContext(t){var i,e,r;void 0===t&&(t=!1);var s=(new Date).getTime(),n=null!==(i=null==(e=this.instance.persistence)?void 0:e.get_property(pi))&&void 0!==i?i:{tokens:this.captureEventsBurstLimit,last:s};n.tokens+=(s-n.last)/1e3*this.captureEventsPerSecond,n.last=s,n.tokens>this.captureEventsBurstLimit&&(n.tokens=this.captureEventsBurstLimit);var o=n.tokens<1;return o||t||(n.tokens=Math.max(0,n.tokens-1)),!o||this.lastEventRateLimited||t||this.instance.capture("$$client_ingestion_warning",{$$client_ingestion_warning_message:"posthog-js client rate limited. Config is set to "+this.captureEventsPerSecond+" events per second and "+this.captureEventsBurstLimit+" events burst limit."},{skip_client_rate_limiting:!0}),this.lastEventRateLimited=o,null==(r=this.instance.persistence)||r.set_property(pi,n),{isRateLimited:o,remainingTokens:n.tokens}}isServerRateLimited(t){var i=this.serverLimits[t||"events"]||!1;return!1!==i&&(new Date).getTime()<i}}var uo=Tt("[RemoteConfig]");class ho{constructor(t){this._instance=t}get remoteConfig(){var t;return null==(t=v._POSTHOG_REMOTE_CONFIG)||null==(t=t[this._instance.config.token])?void 0:t.config}pe(t){var i,e;null!=(i=v.__PosthogExtensions__)&&i.loadExternalDependency?null==(e=v.__PosthogExtensions__)||null==e.loadExternalDependency||e.loadExternalDependency(this._instance,"remote-config",(()=>t(this.remoteConfig))):(uo.error("PostHog Extensions not found. Cannot load remote config."),t())}ge(t){this._instance._send_request({method:"GET",url:this._instance.requestRouter.endpointFor("assets","/array/"+this._instance.config.token+"/config"),callback:i=>{t(i.json)}})}load(){try{if(this.remoteConfig)return uo.info("Using preloaded remote config",this.remoteConfig),void this.ci(this.remoteConfig);if(this._instance.O())return void uo.warn("Remote config is disabled. Falling back to local config.");this.pe((t=>{if(!t)return uo.info("No config found after loading remote JS config. Falling back to JSON."),void this.ge((t=>{this.ci(t)}));this.ci(t)}))}catch(t){uo.error("Error loading remote config",t)}}ci(t){t?this._instance.config.__preview_remote_config?(this._instance.ci(t),!1!==t.hasFeatureFlags&&this._instance.featureFlags.ensureFlagsLoaded()):uo.info("__preview_remote_config is disabled. Logging config instead",t):uo.error("Failed to fetch remote config from PostHog.")}}var vo=3e3;class co{constructor(t,i){this._e=!0,this.me=[],this.ye=J((null==i?void 0:i.flush_interval_ms)||vo,250,5e3,Pt.createLogger("flush interval"),vo),this.be=t}enqueue(t){this.me.push(t),this.we||this.xe()}unload(){this.Ee();var t=this.me.length>0?this.Se():{},i=Object.values(t);[...i.filter((t=>0===t.url.indexOf("/e"))),...i.filter((t=>0!==t.url.indexOf("/e")))].map((t=>{this.be(g({},t,{transport:"sendBeacon"}))}))}enable(){this._e=!1,this.xe()}xe(){var t=this;this._e||(this.we=setTimeout((()=>{if(this.Ee(),this.me.length>0){var i=this.Se(),e=function(){var e=i[r],s=(new Date).getTime();e.data&&C(e.data)&&Mt(e.data,(t=>{t.offset=Math.abs(t.timestamp-s),delete t.timestamp})),t.be(e)};for(var r in i)e()}}),this.ye))}Ee(){clearTimeout(this.we),this.we=void 0}Se(){var t={};return Mt(this.me,(i=>{var e,r=i,s=(r?r.batchKey:null)||r.url;M(t[s])&&(t[s]=g({},r,{data:[]})),null==(e=t[s].data)||e.push(r.data)})),this.me=[],t}}var fo=["retriesPerformedSoFar"];class po{constructor(i){this.$e=!1,this.ke=3e3,this.me=[],this._instance=i,this.me=[],this.Pe=!0,!M(t)&&"onLine"in t.navigator&&(this.Pe=t.navigator.onLine,this.Te=()=>{this.Pe=!0,this.Dt()},this.Ce=()=>{this.Pe=!1},qt(t,"online",this.Te),qt(t,"offline",this.Ce))}get length(){return this.me.length}retriableRequest(t){var{retriesPerformedSoFar:i}=t,e=_(t,fo);L(i)&&i>0&&(e.url=un(e.url,{retry_count:i})),this._instance._send_request(g({},e,{callback:t=>{200!==t.statusCode&&(t.statusCode<400||t.statusCode>=500)&&(null!=i?i:0)<10?this.Re(g({retriesPerformedSoFar:i},e)):null==e.callback||e.callback(t)}}))}Re(t){var i=t.retriesPerformedSoFar||0;t.retriesPerformedSoFar=i+1;var e=function(t){var i=3e3*Math.pow(2,t),e=i/2,r=Math.min(18e5,i),s=(Math.random()-.5)*(r-e);return Math.ceil(r+s)}(i),r=Date.now()+e;this.me.push({retryAt:r,requestOptions:t});var s="Enqueued failed request for retry in "+e;navigator.onLine||(s+=" (Browser is offline)"),Pt.warn(s),this.$e||(this.$e=!0,this.Ie())}Ie(){if(this.Fe&&clearTimeout(this.Fe),0===this.me.length)return this.$e=!1,void(this.Fe=void 0);this.Fe=setTimeout((()=>{this.Pe&&this.me.length>0&&this.Dt(),this.Ie()}),this.ke)}Dt(){var t=Date.now(),i=[],e=this.me.filter((e=>e.retryAt<t||(i.push(e),!1)));if(this.me=i,e.length>0)for(var{requestOptions:r}of e)this.retriableRequest(r)}unload(){for(var{requestOptions:i}of(this.Fe&&(clearTimeout(this.Fe),this.Fe=void 0),this.$e=!1,M(t)||(this.Te&&(t.removeEventListener("online",this.Te),this.Te=void 0),this.Ce&&(t.removeEventListener("offline",this.Ce),this.Ce=void 0)),this.me))try{this._instance._send_request(g({},i,{transport:"sendBeacon"}))}catch(t){Pt.error(t)}this.me=[]}}class go{constructor(t){this.Me=()=>{var t,i,e,r;this.Oe||(this.Oe={});var s=this.scrollElement(),n=this.scrollY(),o=s?Math.max(0,s.scrollHeight-s.clientHeight):0,a=n+((null==s?void 0:s.clientHeight)||0),l=(null==s?void 0:s.scrollHeight)||0;this.Oe.lastScrollY=Math.ceil(n),this.Oe.maxScrollY=Math.max(n,null!==(t=this.Oe.maxScrollY)&&void 0!==t?t:0),this.Oe.maxScrollHeight=Math.max(o,null!==(i=this.Oe.maxScrollHeight)&&void 0!==i?i:0),this.Oe.lastContentY=a,this.Oe.maxContentY=Math.max(a,null!==(e=this.Oe.maxContentY)&&void 0!==e?e:0),this.Oe.maxContentHeight=Math.max(l,null!==(r=this.Oe.maxContentHeight)&&void 0!==r?r:0)},this._instance=t}getContext(){return this.Oe}resetContext(){var t=this.Oe;return setTimeout(this.Me,0),t}startMeasuringScrollPosition(){qt(t,"scroll",this.Me,{capture:!0}),qt(t,"scrollend",this.Me,{capture:!0}),qt(t,"resize",this.Me)}scrollElement(){if(!this._instance.config.scroll_root_selector)return null==t?void 0:t.document.documentElement;var i=C(this._instance.config.scroll_root_selector)?this._instance.config.scroll_root_selector:[this._instance.config.scroll_root_selector];for(var e of i){var r=null==t?void 0:t.document.querySelector(e);if(r)return r}}scrollY(){if(this._instance.config.scroll_root_selector){var i=this.scrollElement();return i&&i.scrollTop||0}return t&&(t.scrollY||t.pageYOffset||t.document.documentElement.scrollTop)||0}scrollX(){if(this._instance.config.scroll_root_selector){var i=this.scrollElement();return i&&i.scrollLeft||0}return t&&(t.scrollX||t.pageXOffset||t.document.documentElement.scrollLeft)||0}}var _o=t=>cs(null==t?void 0:t.config.mask_personal_data_properties,null==t?void 0:t.config.custom_personal_data_properties);class mo{constructor(t,i,e,r){this.Ae=t=>{var i=this.De();if(!i||i.sessionId!==t){var e={sessionId:t,props:this.je(this._instance)};this.Le.register({[fi]:e})}},this._instance=t,this.Ne=i,this.Le=e,this.je=r||_o,this.Ne.onSessionId(this.Ae)}De(){return this.Le.props[fi]}getSetOnceProps(){var t,i=null==(t=this.De())?void 0:t.props;return i?"r"in i?fs(i):{$referring_domain:i.referringDomain,$pathname:i.initialPathName,utm_source:i.utm_source,utm_campaign:i.utm_campaign,utm_medium:i.utm_medium,utm_content:i.utm_content,utm_term:i.utm_term}:{}}getSessionProps(){var t={};return Mt(Nt(this.getSetOnceProps()),((i,e)=>{"$current_url"===e&&(e="url"),t["$session_entry_"+E(e)]=i})),t}}var yo=Tt("[SessionId]");class bo{on(t,i){return this.Ue.on(t,i)}constructor(t,i,e){var r;if(this.ze=[],this.He=void 0,this.Ue=new Jn,this.Be=(t,i)=>Math.abs(t-i)>this.sessionTimeoutMs,!t.persistence)throw new Error("SessionIdManager requires a PostHogPersistence instance");if("always"===t.config.cookieless_mode)throw new Error('SessionIdManager cannot be used with cookieless_mode="always"');this.I=t.config,this.Le=t.persistence,this.qe=void 0,this.We=void 0,this._sessionStartTimestamp=null,this._sessionActivityTimestamp=null,this.Ge=i||$e,this.Ve=e||$e;var s=this.I.persistence_name||this.I.token,n=this.I.session_idle_timeout_seconds||1800;if(this._sessionTimeoutMs=1e3*J(n,60,36e3,yo.createLogger("session_idle_timeout_seconds"),1800),t.register({$configured_session_timeout_ms:this._sessionTimeoutMs}),this.Je(),this.Ke="ph_"+s+"_window_id",this.Ye="ph_"+s+"_primary_window_exists",this.Xe()){var o=Le.W(this.Ke),a=Le.W(this.Ye);o&&!a?this.qe=o:Le.V(this.Ke),Le.G(this.Ye,!0)}if(null!=(r=this.I.bootstrap)&&r.sessionID)try{var l=(t=>{var i=t.replace(/-/g,"");if(32!==i.length)throw new Error("Not a valid UUID");if("7"!==i[12])throw new Error("Not a UUIDv7");return parseInt(i.substring(0,12),16)})(this.I.bootstrap.sessionID);this.Qe(this.I.bootstrap.sessionID,(new Date).getTime(),l)}catch(t){yo.error("Invalid sessionID in bootstrap",t)}this.Ze()}get sessionTimeoutMs(){return this._sessionTimeoutMs}onSessionId(t){return M(this.ze)&&(this.ze=[]),this.ze.push(t),this.We&&t(this.We,this.qe),()=>{this.ze=this.ze.filter((i=>i!==t))}}Xe(){return"memory"!==this.I.persistence&&!this.Le.bi&&Le.H()}tr(t){t!==this.qe&&(this.qe=t,this.Xe()&&Le.G(this.Ke,t))}ir(){return this.qe?this.qe:this.Xe()?Le.W(this.Ke):null}Qe(t,i,e){t===this.We&&i===this._sessionActivityTimestamp&&e===this._sessionStartTimestamp||(this._sessionStartTimestamp=e,this._sessionActivityTimestamp=i,this.We=t,this.Le.register({[ri]:[i,t,e]}))}er(){var t=this.Le.props[ri];return C(t)&&2===t.length&&t.push(t[0]),t||[0,null,0]}resetSessionId(){this.Qe(null,null,null)}destroy(){clearTimeout(this.rr),this.rr=void 0,this.He&&t&&(t.removeEventListener("beforeunload",this.He,{capture:!1}),this.He=void 0),this.ze=[]}Ze(){this.He=()=>{this.Xe()&&Le.V(this.Ye)},qt(t,"beforeunload",this.He,{capture:!1})}checkAndGetSessionAndWindowId(t,i){if(void 0===t&&(t=!1),void 0===i&&(i=null),"always"===this.I.cookieless_mode)throw new Error('checkAndGetSessionAndWindowId should not be called with cookieless_mode="always"');var e=i||(new Date).getTime(),[r,s,n]=this.er(),o=this.ir(),a=L(n)&&n>0&&Math.abs(e-n)>864e5,l=!1,u=!s,h=!u&&!t&&this.Be(e,r);u||h||a?(s=this.Ge(),o=this.Ve(),yo.info("new session ID generated",{sessionId:s,windowId:o,changeReason:{noSessionId:u,activityTimeout:h,sessionPastMaximumLength:a}}),n=e,l=!0):o||(o=this.Ve(),l=!0);var d=0===r||!t||a?e:r,v=0===n?(new Date).getTime():n;return this.tr(o),this.Qe(s,d,v),t||this.Je(),l&&this.ze.forEach((t=>t(s,o,l?{noSessionId:u,activityTimeout:h,sessionPastMaximumLength:a}:void 0))),{sessionId:s,windowId:o,sessionStartTimestamp:v,changeReason:l?{noSessionId:u,activityTimeout:h,sessionPastMaximumLength:a}:void 0,lastActivityTimestamp:r}}Je(){clearTimeout(this.rr),this.rr=setTimeout((()=>{var[t]=this.er();if(this.Be((new Date).getTime(),t)){var i=this.We;this.resetSessionId(),this.Ue.emit("forcedIdleReset",{idleSessionId:i})}}),1.1*this.sessionTimeoutMs)}}var wo=["$set_once","$set"],xo=Tt("[SiteApps]");class Eo{constructor(t){this._instance=t,this.sr=[],this.apps={}}get isEnabled(){return!!this._instance.config.opt_in_site_apps}nr(t,i){if(i){var e=this.globalsForEvent(i);this.sr.push(e),this.sr.length>1e3&&(this.sr=this.sr.slice(10))}}get siteAppLoaders(){var t;return null==(t=v._POSTHOG_REMOTE_CONFIG)||null==(t=t[this._instance.config.token])?void 0:t.siteApps}init(){if(this.isEnabled){var t=this._instance.Ni(this.nr.bind(this));this.ar=()=>{t(),this.sr=[],this.ar=void 0}}}globalsForEvent(t){var i,e,r,s,n,o,a;if(!t)throw new Error("Event payload is required");var l={},u=this._instance.get_property("$groups")||[],h=this._instance.get_property("$stored_group_properties")||{};for(var[d,v]of Object.entries(h))l[d]={id:u[d],type:d,properties:v};var{$set_once:c,$set:f}=t;return{event:g({},_(t,wo),{properties:g({},t.properties,f?{$set:g({},null!==(i=null==(e=t.properties)?void 0:e.$set)&&void 0!==i?i:{},f)}:{},c?{$set_once:g({},null!==(r=null==(s=t.properties)?void 0:s.$set_once)&&void 0!==r?r:{},c)}:{}),elements_chain:null!==(n=null==(o=t.properties)?void 0:o.$elements_chain)&&void 0!==n?n:"",distinct_id:null==(a=t.properties)?void 0:a.distinct_id}),person:{properties:this._instance.get_property("$stored_person_properties")},groups:l}}setupSiteApp(t){var i=this.apps[t.id],e=()=>{var e;(!i.errored&&this.sr.length&&(xo.info("Processing "+this.sr.length+" events for site app with id "+t.id),this.sr.forEach((t=>null==i.processEvent?void 0:i.processEvent(t))),i.processedBuffer=!0),Object.values(this.apps).every((t=>t.processedBuffer||t.errored)))&&(null==(e=this.ar)||e.call(this))},r=!1,s=s=>{i.errored=!s,i.loaded=!0,xo.info("Site app with id "+t.id+" "+(s?"loaded":"errored")),r&&e()};try{var{processEvent:n}=t.init({posthog:this._instance,callback:t=>{s(t)}});n&&(i.processEvent=n),r=!0}catch(i){xo.error("Error while initializing PostHog app with config id "+t.id,i),s(!1)}if(r&&i.loaded)try{e()}catch(e){xo.error("Error while processing buffered events PostHog app with config id "+t.id,e),i.errored=!0}}lr(){var t=this.siteAppLoaders||[];for(var i of t)this.apps[i.id]={id:i.id,loaded:!1,errored:!1,processedBuffer:!1};for(var e of t)this.setupSiteApp(e)}ur(t){if(0!==Object.keys(this.apps).length){var i=this.globalsForEvent(t);for(var e of Object.values(this.apps))try{null==e.processEvent||e.processEvent(i)}catch(i){xo.error("Error while processing event "+t.event+" for site app "+e.id,i)}}}onRemoteConfig(t){var i,e,r,s=this;if(null!=(i=this.siteAppLoaders)&&i.length)return this.isEnabled?(this.lr(),void this._instance.on("eventCaptured",(t=>this.ur(t)))):void xo.error('PostHog site apps are disabled. Enable the "opt_in_site_apps" config to proceed.');if(null==(e=this.ar)||e.call(this),null!=(r=t.siteApps)&&r.length)if(this.isEnabled){var n=function(t){var i;v["__$$ph_site_app_"+t]=s._instance,null==(i=v.__PosthogExtensions__)||null==i.loadSiteApp||i.loadSiteApp(s._instance,a,(i=>{if(i)return xo.error("Error while initializing PostHog app with config id "+t,i)}))};for(var{id:o,url:a}of t.siteApps)n(o)}else xo.error('PostHog site apps are disabled. Enable the "opt_in_site_apps" config to proceed.')}}var So=function(t,i){if(!t)return!1;var e=t.userAgent;if(e&&y(e,i))return!0;try{var r=null==t?void 0:t.userAgentData;if(null!=r&&r.brands&&r.brands.some((t=>y(null==t?void 0:t.brand,i))))return!0}catch(t){}return!!t.webdriver},$o=function(t){return t.US="us",t.EU="eu",t.CUSTOM="custom",t}({}),ko="i.posthog.com";class Po{constructor(t){this.hr={},this.instance=t}get apiHost(){var t=this.instance.config.api_host.trim().replace(/\/$/,"");return"https://app.posthog.com"===t?"https://us.i.posthog.com":t}get flagsApiHost(){var t=this.instance.config.flags_api_host;return t?t.trim().replace(/\/$/,""):this.apiHost}get uiHost(){var t,i=null==(t=this.instance.config.ui_host)?void 0:t.replace(/\/$/,"");return i||(i=this.apiHost.replace("."+ko,".posthog.com")),"https://app.posthog.com"===i?"https://us.posthog.com":i}get region(){return this.hr[this.apiHost]||(/https:\/\/(app|us|us-assets)(\.i)?\.posthog\.com/i.test(this.apiHost)?this.hr[this.apiHost]=$o.US:/https:\/\/(eu|eu-assets)(\.i)?\.posthog\.com/i.test(this.apiHost)?this.hr[this.apiHost]=$o.EU:this.hr[this.apiHost]=$o.CUSTOM),this.hr[this.apiHost]}endpointFor(t,i){if(void 0===i&&(i=""),i&&(i="/"===i[0]?i:"/"+i),"ui"===t)return this.uiHost+i;if("flags"===t)return this.flagsApiHost+i;if(this.region===$o.CUSTOM)return this.apiHost+i;var e=ko+i;switch(t){case"assets":return"https://"+this.region+"-assets."+e;case"api":return"https://"+this.region+"."+e}}}var To={icontains:(i,e)=>!!t&&e.href.toLowerCase().indexOf(i.toLowerCase())>-1,not_icontains:(i,e)=>!!t&&-1===e.href.toLowerCase().indexOf(i.toLowerCase()),regex:(i,e)=>!!t&&cn(e.href,i),not_regex:(i,e)=>!!t&&!cn(e.href,i),exact:(t,i)=>i.href===t,is_not:(t,i)=>i.href!==t};class Co{constructor(t){var i=this;this.getWebExperimentsAndEvaluateDisplayLogic=function(t){void 0===t&&(t=!1),i.getWebExperiments((t=>{Co.dr("retrieved web experiments from the server"),i.vr=new Map,t.forEach((t=>{if(t.feature_flag_key){var e;if(i.vr)Co.dr("setting flag key ",t.feature_flag_key," to web experiment ",t),null==(e=i.vr)||e.set(t.feature_flag_key,t);var r=i._instance.getFeatureFlag(t.feature_flag_key);O(r)&&t.variants[r]&&i.cr(t.name,r,t.variants[r].transforms)}else if(t.variants)for(var s in t.variants){var n=t.variants[s];Co.pr(n)&&i.cr(t.name,s,n.transforms)}}))}),t)},this._instance=t,this._instance.onFeatureFlags((t=>{this.onFeatureFlags(t)}))}onFeatureFlags(t){if(this._is_bot())Co.dr("Refusing to render web experiment since the viewer is a likely bot");else if(!this._instance.config.disable_web_experiments){if(j(this.vr))return this.vr=new Map,this.loadIfEnabled(),void this.previewWebExperiment();Co.dr("applying feature flags",t),t.forEach((t=>{var i;if(this.vr&&null!=(i=this.vr)&&i.has(t)){var e,r=this._instance.getFeatureFlag(t),s=null==(e=this.vr)?void 0:e.get(t);r&&null!=s&&s.variants[r]&&this.cr(s.name,r,s.variants[r].transforms)}}))}}previewWebExperiment(){var t=Co.getWindowLocation();if(null!=t&&t.search){var i=he(null==t?void 0:t.search,"__experiment_id"),e=he(null==t?void 0:t.search,"__experiment_variant");i&&e&&(Co.dr("previewing web experiments "+i+" && "+e),this.getWebExperiments((t=>{this.gr(parseInt(i),e,t)}),!1,!0))}}loadIfEnabled(){this._instance.config.disable_web_experiments||this.getWebExperimentsAndEvaluateDisplayLogic()}getWebExperiments(t,i,e){if(this._instance.config.disable_web_experiments&&!e)return t([]);var r=this._instance.get_property("$web_experiments");if(r&&!i)return t(r);this._instance._send_request({url:this._instance.requestRouter.endpointFor("api","/api/web_experiments/?token="+this._instance.config.token),method:"GET",callback:i=>{if(200!==i.statusCode||!i.json)return t([]);var e=i.json.experiments||[];return t(e)}})}gr(t,i,e){var r=e.filter((i=>i.id===t));r&&r.length>0&&(Co.dr("Previewing web experiment ["+r[0].name+"] with variant ["+i+"]"),this.cr(r[0].name,i,r[0].variants[i].transforms))}static pr(t){return!j(t.conditions)&&(Co._r(t)&&Co.mr(t))}static _r(t){var i;if(j(t.conditions)||j(null==(i=t.conditions)?void 0:i.url))return!0;var e,r,s,n=Co.getWindowLocation();return!!n&&(null==(e=t.conditions)||!e.url||To[null!==(r=null==(s=t.conditions)?void 0:s.urlMatchType)&&void 0!==r?r:"icontains"](t.conditions.url,n))}static getWindowLocation(){return null==t?void 0:t.location}static mr(t){var i;if(j(t.conditions)||j(null==(i=t.conditions)?void 0:i.utm))return!0;var e=ls();if(e.utm_source){var r,s,n,o,a,l,u,h,d=null==(r=t.conditions)||null==(r=r.utm)||!r.utm_campaign||(null==(s=t.conditions)||null==(s=s.utm)?void 0:s.utm_campaign)==e.utm_campaign,v=null==(n=t.conditions)||null==(n=n.utm)||!n.utm_source||(null==(o=t.conditions)||null==(o=o.utm)?void 0:o.utm_source)==e.utm_source,c=null==(a=t.conditions)||null==(a=a.utm)||!a.utm_medium||(null==(l=t.conditions)||null==(l=l.utm)?void 0:l.utm_medium)==e.utm_medium,f=null==(u=t.conditions)||null==(u=u.utm)||!u.utm_term||(null==(h=t.conditions)||null==(h=h.utm)?void 0:h.utm_term)==e.utm_term;return d&&c&&f&&v}return!1}static dr(t){for(var i=arguments.length,e=new Array(i>1?i-1:0),r=1;r<i;r++)e[r-1]=arguments[r];Pt.info("[WebExperiments] "+t,e)}cr(t,i,e){this._is_bot()?Co.dr("Refusing to render web experiment since the viewer is a likely bot"):"control"!==i?e.forEach((e=>{if(e.selector){var r;Co.dr("applying transform of variant "+i+" for experiment "+t+" ",e);var s=null==(r=document)?void 0:r.querySelectorAll(e.selector);null==s||s.forEach((t=>{var i=t;e.html&&(i.innerHTML=e.html),e.css&&i.setAttribute("style",e.css)}))}})):Co.dr("Control variants leave the page unmodified.")}_is_bot(){return n&&this._instance?So(n,this._instance.config.custom_blocked_useragents):void 0}}var Ro=Tt("[PostHog ExternalIntegrations]"),Io={intercom:"intercom-integration",crispChat:"crisp-chat-integration"};class Fo{constructor(t){this._instance=t}it(t,i){var e;null==(e=v.__PosthogExtensions__)||null==e.loadExternalDependency||e.loadExternalDependency(this._instance,t,(t=>{if(t)return Ro.error("failed to load script",t);i()}))}startIfEnabledOrStop(){var t=this,i=function(i){var e,s,n;(!r||null!=(e=v.__PosthogExtensions__)&&null!=(e=e.integrations)&&e[i]||t.it(Io[i],(()=>{var e;null==(e=v.__PosthogExtensions__)||null==(e=e.integrations)||null==(e=e[i])||e.start(t._instance)})),!r&&null!=(s=v.__PosthogExtensions__)&&null!=(s=s.integrations)&&s[i])&&(null==(n=v.__PosthogExtensions__)||null==(n=n.integrations)||null==(n=n[i])||n.stop())};for(var[e,r]of Object.entries(null!==(s=this._instance.config.integrations)&&void 0!==s?s:{})){var s;i(e)}}}var Mo="[SessionRecording]",Oo=Tt(Mo);class Ao{get started(){var t;return!(null==(t=this.yr)||!t.isStarted)}get status(){return this.yr?this.yr.status:this.br&&!this.wr?"disabled":"lazy_loading"}constructor(t){if(this._forceAllowLocalhostNetworkCapture=!1,this.br=!1,this.Er=void 0,this._instance=t,!this._instance.sessionManager)throw Oo.error("started without valid sessionManager"),new Error(Mo+" started without valid sessionManager. This is a bug.");if("always"===this._instance.config.cookieless_mode)throw new Error(Mo+' cannot be used with cookieless_mode="always"')}get wr(){var i,e=!(null==(i=this._instance.get_property(ei))||!i.enabled),r=!this._instance.config.disable_session_recording,s=this._instance.config.disable_session_recording||this._instance.consent.isOptedOut();return t&&e&&r&&!s}startIfEnabledOrStop(t){var i;if(!this.wr||null==(i=this.yr)||!i.isStarted){var e=!M(Object.assign)&&!M(Array.from);this.wr&&e?(this.Sr(t),Oo.info("starting")):this.stopRecording()}}Sr(t){var i,e,r;this.wr&&(null!=v&&null!=(i=v.__PosthogExtensions__)&&null!=(i=i.rrweb)&&i.record&&null!=(e=v.__PosthogExtensions__)&&e.initSessionRecording?this.$r(t):null==(r=v.__PosthogExtensions__)||null==r.loadExternalDependency||r.loadExternalDependency(this._instance,this.kr,(i=>{if(i)return Oo.error("could not load recorder",i);this.$r(t)})))}stopRecording(){var t,i;null==(t=this.Er)||t.call(this),this.Er=void 0,null==(i=this.yr)||i.stop()}Pr(){var t;null==(t=this._instance.persistence)||t.unregister(si)}Tr(t){if(this._instance.persistence){var i,e,r=this._instance.persistence,s=()=>{var i=!1===t.sessionRecording?void 0:t.sessionRecording,e=null==i?void 0:i.sampleRate,s=j(e)?null:parseFloat(e);j(s)&&this.Pr();var n=null==i?void 0:i.minimumDurationMilliseconds;r.register({[ei]:g({enabled:!!i},i,{networkPayloadCapture:g({capturePerformance:t.capturePerformance},null==i?void 0:i.networkPayloadCapture),canvasRecording:{enabled:null==i?void 0:i.recordCanvas,fps:null==i?void 0:i.canvasFps,quality:null==i?void 0:i.canvasQuality},sampleRate:s,minimumDurationMilliseconds:M(n)?null:n,endpoint:null==i?void 0:i.endpoint,triggerMatchType:null==i?void 0:i.triggerMatchType,masking:null==i?void 0:i.masking,urlTriggers:null==i?void 0:i.urlTriggers})})};s(),null==(i=this.Er)||i.call(this),this.Er=null==(e=this._instance.sessionManager)?void 0:e.onSessionId(s)}}onRemoteConfig(t){"sessionRecording"in t?!1!==t.sessionRecording?(this.Tr(t),this.br=!0,this.startIfEnabledOrStop()):this.br=!0:Oo.info("skipping remote config with no sessionRecording",t)}log(t,i){var e;void 0===i&&(i="log"),null!=(e=this.yr)&&e.log?this.yr.log(t,i):Oo.warn("log called before recorder was ready")}get kr(){var t,i,e=null==(t=this._instance)||null==(t=t.persistence)?void 0:t.get_property(ei);return(null==e||null==(i=e.scriptConfig)?void 0:i.script)||"lazy-recorder"}$r(t){var i,e;if(null==(i=v.__PosthogExtensions__)||!i.initSessionRecording)throw Error("Called on script loaded before session recording is available");this.yr||(this.yr=null==(e=v.__PosthogExtensions__)?void 0:e.initSessionRecording(this._instance),this.yr._forceAllowLocalhostNetworkCapture=this._forceAllowLocalhostNetworkCapture);this.yr.start(t)}onRRwebEmit(t){var i;null==(i=this.yr)||null==i.onRRwebEmit||i.onRRwebEmit(t)}overrideLinkedFlag(){var t,i;this.yr||(null==(i=this._instance.persistence)||i.register({$replay_override_linked_flag:!0}));null==(t=this.yr)||t.overrideLinkedFlag()}overrideSampling(){var t,i;this.yr||(null==(i=this._instance.persistence)||i.register({$replay_override_sampling:!0}));null==(t=this.yr)||t.overrideSampling()}overrideTrigger(t){var i,e;this.yr||(null==(e=this._instance.persistence)||e.register({["url"===t?"$replay_override_url_trigger":"$replay_override_event_trigger"]:!0}));null==(i=this.yr)||i.overrideTrigger(t)}get sdkDebugProperties(){var t;return(null==(t=this.yr)?void 0:t.sdkDebugProperties)||{$recording_status:this.status}}tryAddCustomEvent(t,i){var e;return!(null==(e=this.yr)||!e.tryAddCustomEvent(t,i))}}var Do={},jo=()=>{},Lo="posthog",No=!an&&-1===(null==d?void 0:d.indexOf("MSIE"))&&-1===(null==d?void 0:d.indexOf("Mozilla")),Uo=i=>{var e;return g({api_host:"https://us.i.posthog.com",flags_api_host:null,ui_host:null,token:"",autocapture:!0,cross_subdomain_cookie:Ht(null==o?void 0:o.location),persistence:"localStorage+cookie",persistence_name:"",loaded:jo,save_campaign_params:!0,custom_campaign_params:[],custom_blocked_useragents:[],save_referrer:!0,capture_pageleave:"if_capture_pageview",defaults:null!=i?i:"unset",__preview_deferred_init_extensions:!1,debug:a&&O(null==a?void 0:a.search)&&-1!==a.search.indexOf("__posthog_debug=true")||!1,cookie_expiration:365,upgrade:!1,disable_session_recording:!1,disable_persistence:!1,disable_web_experiments:!0,disable_surveys:!1,disable_surveys_automatic_display:!1,disable_conversations:!1,disable_product_tours:!0,disable_external_dependency_loading:!1,enable_recording_console_log:void 0,secure_cookie:"https:"===(null==t||null==(e=t.location)?void 0:e.protocol),ip:!1,opt_out_capturing_by_default:!1,opt_out_persistence_by_default:!1,opt_out_useragent_filter:!1,opt_out_capturing_persistence_type:"localStorage",consent_persistence_name:null,opt_out_capturing_cookie_prefix:null,opt_in_site_apps:!1,property_denylist:[],respect_dnt:!1,sanitize_properties:null,request_headers:{},request_batching:!0,properties_string_max_length:65535,mask_all_element_attributes:!1,mask_all_text:!1,mask_personal_data_properties:!1,custom_personal_data_properties:[],advanced_disable_flags:!1,advanced_disable_decide:!1,advanced_disable_feature_flags:!1,advanced_disable_feature_flags_on_first_load:!1,advanced_only_evaluate_survey_feature_flags:!1,advanced_enable_surveys:!1,advanced_disable_toolbar_metrics:!1,feature_flag_request_timeout_ms:3e3,surveys_request_timeout_ms:1e4,on_request_error:t=>{var i="Bad HTTP status: "+t.statusCode+" "+t.text;Pt.error(i)},get_device_id:t=>t,capture_performance:void 0,name:"posthog",bootstrap:{},disable_compression:!1,session_idle_timeout_seconds:1800,person_profiles:"identified_only",before_send:void 0,request_queue_config:{flush_interval_ms:vo},error_tracking:{},_onCapture:jo,__preview_eager_load_replay:!1},(t=>({rageclick:!(t&&t>="2025-11-30")||{content_ignorelist:!0},capture_pageview:!(t&&t>="2025-05-24")||"history_change",session_recording:t&&t>="2025-11-30"?{strictMinimumDuration:!0}:{}}))(i))},zo=t=>{var i={};M(t.process_person)||(i.person_profiles=t.process_person),M(t.xhr_headers)||(i.request_headers=t.xhr_headers),M(t.cookie_name)||(i.persistence_name=t.cookie_name),M(t.disable_cookie)||(i.disable_persistence=t.disable_cookie),M(t.store_google)||(i.save_campaign_params=t.store_google),M(t.verbose)||(i.debug=t.verbose);var e=Ot({},i,t);return C(t.property_blacklist)&&(M(t.property_denylist)?e.property_denylist=t.property_blacklist:C(t.property_denylist)?e.property_denylist=[...t.property_blacklist,...t.property_denylist]:Pt.error("Invalid value for property_denylist config: "+t.property_denylist)),e};class Ho{constructor(){this.__forceAllowLocalhost=!1}get Cr(){return this.__forceAllowLocalhost}set Cr(t){Pt.error("WebPerformanceObserver is deprecated and has no impact on network capture. Use `_forceAllowLocalhostNetworkCapture` on `posthog.sessionRecording`"),this.__forceAllowLocalhost=t}}class Bo{get decideEndpointWasHit(){var t,i;return null!==(t=null==(i=this.featureFlags)?void 0:i.hasLoadedFlags)&&void 0!==t&&t}get flagsEndpointWasHit(){var t,i;return null!==(t=null==(i=this.featureFlags)?void 0:i.hasLoadedFlags)&&void 0!==t&&t}constructor(){this.webPerformance=new Ho,this.Rr=!1,this.version=c.LIB_VERSION,this.Ir=new Jn,this._calculate_event_properties=this.calculateEventProperties.bind(this),this.config=Uo(),this.SentryIntegration=Ze,this.sentryIntegration=t=>function(t,i){var e=Qe(t,i);return{name:Xe,processEvent:t=>e(t)}}(this,t),this.__request_queue=[],this.__loaded=!1,this.analyticsDefaultEndpoint="/e/",this.Fr=!1,this.Mr=null,this.Or=null,this.Ar=null,this.featureFlags=new In(this),this.toolbar=new sr(this),this.scrollManager=new go(this),this.pageViewManager=new Ss(this),this.surveys=new so(this),this.conversations=new oo(this),this.productTours=new Dn(this),this.experiments=new Co(this),this.exceptions=new yn(this),this.rateLimiter=new lo(this),this.requestRouter=new Po(this),this.consent=new Ue(this),this.externalIntegrations=new Fo(this),this.people={set:(t,i,e)=>{var r=O(t)?{[t]:i}:t;this.setPersonProperties(r),null==e||e({})},set_once:(t,i,e)=>{var r=O(t)?{[t]:i}:t;this.setPersonProperties(void 0,r),null==e||e({})}},this.on("eventCaptured",(t=>Pt.info('send "'+(null==t?void 0:t.event)+'"',t)))}init(t,i,e){if(e&&e!==Lo){var r,s=null!==(r=Do[e])&&void 0!==r?r:new Bo;return s._init(t,i,e),Do[e]=s,Do[Lo][e]=s,s}return this._init(t,i,e)}_init(i,e,r){var s;if(void 0===e&&(e={}),M(i)||A(i))return Pt.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 console.warn("[PostHog.js]","You have already initialized PostHog! Re-initializing is a no-op"),this;this.__loaded=!0,this.config={},e.debug=this.Dr(e.debug),this.jr=e,this.Lr=[],e.person_profiles&&(this.Or=e.person_profiles),this.set_config(Ot({},Uo(e.defaults),zo(e),{name:r,token:i})),this.config.on_xhr_error&&Pt.error("on_xhr_error is deprecated. Use on_request_error instead"),this.compression=e.disable_compression?void 0:oe.GZipJS;var n=this.Nr();this.persistence=new Mn(this.config,n),this.sessionPersistence="sessionStorage"===this.config.persistence||"memory"===this.config.persistence?this.persistence:new Mn(g({},this.config,{persistence:"sessionStorage"}),n);var o=g({},this.persistence.props),a=g({},this.sessionPersistence.props);this.register({$initialization_time:(new Date).toISOString()}),this.Ur=new co((t=>this.zr(t)),this.config.request_queue_config),this.Hr=new po(this),this.__request_queue=[];var l="always"===this.config.cookieless_mode||"on_reject"===this.config.cookieless_mode&&this.consent.isExplicitlyOptedOut();if(l||(this.sessionManager=new bo(this),this.sessionPropsManager=new mo(this,this.sessionManager,this.persistence)),this.config.__preview_deferred_init_extensions?(Pt.info("Deferring extension initialization to improve startup performance"),setTimeout((()=>{this.Br(l)}),0)):(Pt.info("Initializing extensions synchronously"),this.Br(l)),c.DEBUG=c.DEBUG||this.config.debug,c.DEBUG&&Pt.info("Starting in debug mode",{this:this,config:e,thisC:g({},this.config),p:o,s:a}),void 0!==(null==(s=e.bootstrap)?void 0:s.distinctID)){var u,h,d=this.config.get_device_id($e()),v=null!=(u=e.bootstrap)&&u.isIdentifiedID?d:e.bootstrap.distinctID;this.persistence.set_property(ci,null!=(h=e.bootstrap)&&h.isIdentifiedID?"identified":"anonymous"),this.register({distinct_id:e.bootstrap.distinctID,$device_id:v})}if(this.qr()){var f,p,_=Object.keys((null==(f=e.bootstrap)?void 0:f.featureFlags)||{}).filter((t=>{var i;return!(null==(i=e.bootstrap)||null==(i=i.featureFlags)||!i[t])})).reduce(((t,i)=>{var r;return t[i]=(null==(r=e.bootstrap)||null==(r=r.featureFlags)?void 0:r[i])||!1,t}),{}),m=Object.keys((null==(p=e.bootstrap)?void 0:p.featureFlagPayloads)||{}).filter((t=>_[t])).reduce(((t,i)=>{var r,s;null!=(r=e.bootstrap)&&null!=(r=r.featureFlagPayloads)&&r[i]&&(t[i]=null==(s=e.bootstrap)||null==(s=s.featureFlagPayloads)?void 0:s[i]);return t}),{});this.featureFlags.receivedFeatureFlags({featureFlags:_,featureFlagPayloads:m})}if(l)this.register_once({distinct_id:wi,$device_id:null},"");else if(!this.get_distinct_id()){var y=this.config.get_device_id($e());this.register_once({distinct_id:y,$device_id:y},""),this.persistence.set_property(ci,"anonymous")}return qt(t,"onpagehide"in self?"pagehide":"unload",this._handle_unload.bind(this),{passive:!1}),this.toolbar.maybeLoadToolbar(),e.segment?Ye(this,(()=>this.Wr())):this.Wr(),R(this.config._onCapture)&&this.config._onCapture!==jo&&(Pt.warn("onCapture is deprecated. Please use `before_send` instead"),this.on("eventCaptured",(t=>this.config._onCapture(t.event,t)))),this.config.ip&&Pt.warn('The `ip` config option has NO EFFECT AT ALL and has been deprecated. Use a custom transformation or "Discard IP data" project setting instead. See https://posthog.com/tutorials/web-redact-properties#hiding-customer-ip-address for more information.'),this}Br(t){var i=performance.now();this.historyAutocapture=new Je(this),this.historyAutocapture.startIfEnabled();var e=[];e.push((()=>{new or(this).startIfEnabledOrStop()})),e.push((()=>{var t;this.siteApps=new Eo(this),null==(t=this.siteApps)||t.init()})),t||e.push((()=>{this.sessionRecording=new Ao(this),this.sessionRecording.startIfEnabledOrStop()})),this.config.disable_scroll_properties||e.push((()=>{this.scrollManager.startMeasuringScrollPosition()})),e.push((()=>{this.autocapture=new me(this),this.autocapture.startIfEnabled()})),e.push((()=>{this.surveys.loadIfEnabled()})),e.push((()=>{this.conversations.loadIfEnabled()})),e.push((()=>{this.productTours.loadIfEnabled()})),e.push((()=>{this.heatmaps=new Es(this),this.heatmaps.startIfEnabled()})),e.push((()=>{this.webVitalsAutocapture=new bs(this)})),e.push((()=>{this.exceptionObserver=new Ge(this),this.exceptionObserver.startIfEnabled()})),e.push((()=>{this.deadClicksAutocapture=new qe(this,Be),this.deadClicksAutocapture.startIfEnabled()})),e.push((()=>{if(this.Gr){var t=this.Gr;this.Gr=void 0,this.ci(t)}})),this.Vr(e,i)}Vr(t,i){for(;t.length>0;){if(this.config.__preview_deferred_init_extensions)if(performance.now()-i>=30&&t.length>0)return void setTimeout((()=>{this.Vr(t,i)}),0);var e=t.shift();if(e)try{e()}catch(t){Pt.error("Error initializing extension:",t)}}var r=Math.round(performance.now()-i);this.register_for_session({$sdk_debug_extensions_init_method:this.config.__preview_deferred_init_extensions?"deferred":"synchronous",$sdk_debug_extensions_init_time_ms:r}),this.config.__preview_deferred_init_extensions&&Pt.info("PostHog extensions initialized ("+r+"ms)")}ci(t){var i,e,r,s,n,a,l,u;if(!o||!o.body)return Pt.info("document not ready yet, trying again in 500 milliseconds..."),void setTimeout((()=>{this.ci(t)}),500);this.config.__preview_deferred_init_extensions&&(this.Gr=t),this.compression=void 0,t.supportedCompression&&!this.config.disable_compression&&(this.compression=w(t.supportedCompression,oe.GZipJS)?oe.GZipJS:w(t.supportedCompression,oe.Base64)?oe.Base64:void 0),null!=(i=t.analytics)&&i.endpoint&&(this.analyticsDefaultEndpoint=t.analytics.endpoint),this.set_config({person_profiles:this.Or?this.Or:"identified_only"}),null==(e=this.siteApps)||e.onRemoteConfig(t),null==(r=this.sessionRecording)||r.onRemoteConfig(t),null==(s=this.autocapture)||s.onRemoteConfig(t),null==(n=this.heatmaps)||n.onRemoteConfig(t),this.surveys.onRemoteConfig(t),this.conversations.onRemoteConfig(t),this.productTours.onRemoteConfig(t),null==(a=this.webVitalsAutocapture)||a.onRemoteConfig(t),null==(l=this.exceptionObserver)||l.onRemoteConfig(t),this.exceptions.onRemoteConfig(t),null==(u=this.deadClicksAutocapture)||u.onRemoteConfig(t)}Wr(){try{this.config.loaded(this)}catch(t){Pt.critical("`loaded` function failed",t)}this.Jr(),this.config.capture_pageview&&setTimeout((()=>{(this.consent.isOptedIn()||"always"===this.config.cookieless_mode)&&this.Kr()}),1),new ho(this).load(),this.featureFlags.flags()}Jr(){var t;this.is_capturing()&&(this.config.request_batching&&(null==(t=this.Ur)||t.enable()))}_dom_loaded(){this.is_capturing()&&Ft(this.__request_queue,(t=>this.zr(t))),this.__request_queue=[],this.Jr()}_handle_unload(){var t,i;this.config.request_batching?(this.Yr()&&this.capture("$pageleave"),null==(t=this.Ur)||t.unload(),null==(i=this.Hr)||i.unload()):this.Yr()&&this.capture("$pageleave",null,{transport:"sendBeacon"})}_send_request(t){this.__loaded&&(No?this.__request_queue.push(t):this.rateLimiter.isServerRateLimited(t.batchKey)||(t.transport=t.transport||this.config.api_transport,t.url=un(t.url,{ip:this.config.ip?1:0}),t.headers=g({},this.config.request_headers,t.headers),t.compression="best-available"===t.compression?this.compression:t.compression,t.disableXHRCredentials=this.config.__preview_disable_xhr_credentials,this.config.__preview_disable_beacon&&(t.disableTransport=["sendBeacon"]),t.fetchOptions=t.fetchOptions||this.config.fetch_options,(t=>{var i,e,r,s=g({},t);s.timeout=s.timeout||6e4,s.url=un(s.url,{_:(new Date).getTime().toString(),ver:c.LIB_VERSION,compression:s.compression});var n=null!==(i=s.transport)&&void 0!==i?i:"fetch",o=vn.filter((t=>!s.disableTransport||!t.transport||!s.disableTransport.includes(t.transport))),a=null!==(e=null==(r=Bt(o,(t=>t.transport===n)))?void 0:r.method)&&void 0!==e?e:o[0].method;if(!a)throw new Error("No available transport method");a(s)})(g({},t,{callback:i=>{var e,r;(this.rateLimiter.checkForLimiting(i),i.statusCode>=400)&&(null==(e=(r=this.config).on_request_error)||e.call(r,i));null==t.callback||t.callback(i)}}))))}zr(t){this.Hr?this.Hr.retriableRequest(t):this._send_request(t)}_execute_array(t){var i,e=[],r=[],s=[];Ft(t,(t=>{t&&(i=t[0],C(i)?s.push(t):R(t)?t.call(this):C(t)&&"alias"===i?e.push(t):C(t)&&-1!==i.indexOf("capture")&&R(this[i])?s.push(t):r.push(t))}));var n=function(t,i){Ft(t,(function(t){if(C(t[0])){var e=i;Mt(t,(function(t){e=e[t[0]].apply(e,t.slice(1))}))}else this[t[0]].apply(this,t.slice(1))}),i)};n(e,this),n(r,this),n(s,this)}qr(){var t,i;return(null==(t=this.config.bootstrap)?void 0:t.featureFlags)&&Object.keys(null==(i=this.config.bootstrap)?void 0:i.featureFlags).length>0||!1}push(t){this._execute_array([t])}capture(t,i,e){var r;if(this.__loaded&&this.persistence&&this.sessionPersistence&&this.Ur){if(this.is_capturing())if(!M(t)&&O(t)){var s=!this.config.opt_out_useragent_filter&&this._is_bot();if(!(s&&!this.config.__preview_capture_bot_pageviews)){var n=null!=e&&e.skip_client_rate_limiting?void 0:this.rateLimiter.clientRateLimitContext();if(null==n||!n.isRateLimited){null!=i&&i.$current_url&&!O(null==i?void 0:i.$current_url)&&(Pt.error("Invalid `$current_url` property provided to `posthog.capture`. Input must be a string. Ignoring provided value."),null==i||delete i.$current_url),this.sessionPersistence.update_search_keyword(),this.config.save_campaign_params&&this.sessionPersistence.update_campaign_params(),this.config.save_referrer&&this.sessionPersistence.update_referrer_info(),(this.config.save_campaign_params||this.config.save_referrer)&&this.persistence.set_initial_person_info();var o=new Date,a=(null==e?void 0:e.timestamp)||o,l=$e(),u={uuid:l,event:t,properties:this.calculateEventProperties(t,i||{},a,l)};"$pageview"===t&&this.config.__preview_capture_bot_pageviews&&s&&(u.event="$bot_pageview",u.properties.$browser_type="bot"),n&&(u.properties.$lib_rate_limit_remaining_tokens=n.remainingTokens),(null==e?void 0:e.$set)&&(u.$set=null==e?void 0:e.$set);var h,d="$groupidentify"!==t,v=this.Xr(null==e?void 0:e.$set_once,d);if(v&&(u.$set_once=v),(u=Ut(u,null!=e&&e._noTruncate?null:this.config.properties_string_max_length)).timestamp=a,M(null==e?void 0:e.timestamp)||(u.properties.$event_time_override_provided=!0,u.properties.$event_time_override_system_time=o),t===Wn.DISMISSED||t===Wn.SENT){var c=null==i?void 0:i[Gn.SURVEY_ID],f=null==i?void 0:i[Gn.SURVEY_ITERATION];h={id:c,current_iteration:f},localStorage.getItem(to(h))||localStorage.setItem(to(h),"true"),u.$set=g({},u.$set,{[Zn({id:c,current_iteration:f},t===Wn.SENT?"responded":"dismissed")]:!0})}var p=g({},u.properties.$set,u.$set);if(F(p)||this.setPersonPropertiesForFlags(p),!j(this.config.before_send)){var _=this.Qr(u);if(!_)return;u=_}this.Ir.emit("eventCaptured",u);var m={method:"POST",url:null!==(r=null==e?void 0:e._url)&&void 0!==r?r:this.requestRouter.endpointFor("api",this.analyticsDefaultEndpoint),data:u,compression:"best-available",batchKey:null==e?void 0:e._batchKey};return!this.config.request_batching||e&&(null==e||!e._batchKey)||null!=e&&e.send_instantly?this.zr(m):this.Ur.enqueue(m),u}Pt.critical("This capture call is ignored due to client rate limiting.")}}else Pt.error("No event name provided to posthog.capture")}else Pt.uninitializedWarning("posthog.capture")}Ni(t){return this.on("eventCaptured",(i=>t(i.event,i)))}calculateEventProperties(t,i,e,r,s){if(e=e||new Date,!this.persistence||!this.sessionPersistence)return i;var n=s?void 0:this.persistence.remove_event_timer(t),a=g({},i);if(a.token=this.config.token,a.$config_defaults=this.config.defaults,("always"==this.config.cookieless_mode||"on_reject"==this.config.cookieless_mode&&this.consent.isExplicitlyOptedOut())&&(a.$cookieless_mode=!0),"$snapshot"===t){var l=g({},this.persistence.properties(),this.sessionPersistence.properties());return a.distinct_id=l.distinct_id,(!O(a.distinct_id)&&!L(a.distinct_id)||A(a.distinct_id))&&Pt.error("Invalid distinct_id for replay event. This indicates a bug in your implementation"),a}var u,h=_s(this.config.mask_personal_data_properties,this.config.custom_personal_data_properties);if(this.sessionManager){var{sessionId:v,windowId:c}=this.sessionManager.checkAndGetSessionAndWindowId(s,e.getTime());a.$session_id=v,a.$window_id=c}this.sessionPropsManager&&Ot(a,this.sessionPropsManager.getSessionProps());try{var f;this.sessionRecording&&Ot(a,this.sessionRecording.sdkDebugProperties),a.$sdk_debug_retry_queue_size=null==(f=this.Hr)?void 0:f.length}catch(t){a.$sdk_debug_error_capturing_properties=String(t)}if(this.requestRouter.region===$o.CUSTOM&&(a.$lib_custom_api_host=this.config.api_host),u="$pageview"!==t||s?"$pageleave"!==t||s?this.pageViewManager.doEvent():this.pageViewManager.doPageLeave(e):this.pageViewManager.doPageView(e,r),a=Ot(a,u),"$pageview"===t&&o&&(a.title=o.title),!M(n)){var p=e.getTime()-n;a.$duration=parseFloat((p/1e3).toFixed(3))}d&&this.config.opt_out_useragent_filter&&(a.$browser_type=this._is_bot()?"bot":"browser"),(a=Ot({},h,this.persistence.properties(),this.sessionPersistence.properties(),a)).$is_identified=this._isIdentified(),C(this.config.property_denylist)?Mt(this.config.property_denylist,(function(t){delete a[t]})):Pt.error("Invalid value for property_denylist config: "+this.config.property_denylist+" or property_blacklist config: "+this.config.property_blacklist);var _=this.config.sanitize_properties;_&&(Pt.error("sanitize_properties is deprecated. Use before_send instead"),a=_(a,t));var m=this.Zr();return a.$process_person_profile=m,m&&!s&&this.ts("_calculate_event_properties"),a}Xr(t,i){var e;if(void 0===i&&(i=!0),!this.persistence||!this.Zr())return t;if(this.Rr)return t;var r=this.persistence.get_initial_props(),s=null==(e=this.sessionPropsManager)?void 0:e.getSetOnceProps(),n=Ot({},r,s||{},t||{}),o=this.config.sanitize_properties;return o&&(Pt.error("sanitize_properties is deprecated. Use before_send instead"),n=o(n,"$set_once")),i&&(this.Rr=!0),F(n)?void 0:n}register(t,i){var e;null==(e=this.persistence)||e.register(t,i)}register_once(t,i,e){var r;null==(r=this.persistence)||r.register_once(t,i,e)}register_for_session(t){var i;null==(i=this.sessionPersistence)||i.register(t)}unregister(t){var i;null==(i=this.persistence)||i.unregister(t)}unregister_for_session(t){var i;null==(i=this.sessionPersistence)||i.unregister(t)}es(t,i){this.register({[t]:i})}getFeatureFlag(t,i){return this.featureFlags.getFeatureFlag(t,i)}getFeatureFlagPayload(t){var i=this.featureFlags.getFeatureFlagPayload(t);try{return JSON.parse(i)}catch(t){return i}}isFeatureEnabled(t,i){return this.featureFlags.isFeatureEnabled(t,i)}reloadFeatureFlags(){this.featureFlags.reloadFeatureFlags()}updateEarlyAccessFeatureEnrollment(t,i,e){this.featureFlags.updateEarlyAccessFeatureEnrollment(t,i,e)}getEarlyAccessFeatures(t,i,e){return void 0===i&&(i=!1),this.featureFlags.getEarlyAccessFeatures(t,i,e)}on(t,i){return this.Ir.on(t,i)}onFeatureFlags(t){return this.featureFlags.onFeatureFlags(t)}onSurveysLoaded(t){return this.surveys.onSurveysLoaded(t)}onSessionId(t){var i,e;return null!==(i=null==(e=this.sessionManager)?void 0:e.onSessionId(t))&&void 0!==i?i:()=>{}}getSurveys(t,i){void 0===i&&(i=!1),this.surveys.getSurveys(t,i)}getActiveMatchingSurveys(t,i){void 0===i&&(i=!1),this.surveys.getActiveMatchingSurveys(t,i)}renderSurvey(t,i){this.surveys.renderSurvey(t,i)}displaySurvey(t,i){void 0===i&&(i=eo),this.surveys.displaySurvey(t,i)}cancelPendingSurvey(t){this.surveys.cancelPendingSurvey(t)}canRenderSurvey(t){return this.surveys.canRenderSurvey(t)}canRenderSurveyAsync(t,i){return void 0===i&&(i=!1),this.surveys.canRenderSurveyAsync(t,i)}identify(t,i,e){if(!this.__loaded||!this.persistence)return Pt.uninitializedWarning("posthog.identify");if(L(t)&&(t=t.toString(),Pt.warn("The first argument to posthog.identify was a number, but it should be a string. It has been converted to a string.")),t)if(["distinct_id","distinctid"].includes(t.toLowerCase()))Pt.critical('The string "'+t+'" was set in posthog.identify which indicates an error. This ID should be unique to the user and not a hardcoded string.');else if(t!==wi){if(this.ts("posthog.identify")){var r=this.get_distinct_id();if(this.register({$user_id:t}),!this.get_property("$device_id")){var s=r;this.register_once({$had_persisted_distinct_id:!0,$device_id:s},"")}t!==r&&t!==this.get_property(Gt)&&(this.unregister(Gt),this.register({distinct_id:t}));var n="anonymous"===(this.persistence.get_property(ci)||"anonymous");t!==r&&n?(this.persistence.set_property(ci,"identified"),this.setPersonPropertiesForFlags(g({},e||{},i||{}),!1),this.capture("$identify",{distinct_id:t,$anon_distinct_id:r},{$set:i||{},$set_once:e||{}}),this.Ar=fn(t,i,e),this.featureFlags.setAnonymousDistinctId(r)):(i||e)&&this.setPersonProperties(i,e),t!==r&&(this.reloadFeatureFlags(),this.unregister(vi))}}else Pt.critical('The string "'+wi+'" was set in posthog.identify which indicates an error. This ID is only used as a sentinel value.');else Pt.error("Unique user id has not been set in posthog.identify")}setPersonProperties(t,i){if((t||i)&&this.ts("posthog.setPersonProperties")){var e=fn(this.get_distinct_id(),t,i);this.Ar!==e?(this.setPersonPropertiesForFlags(g({},i||{},t||{})),this.capture("$set",{$set:t||{},$set_once:i||{}}),this.Ar=e):Pt.info("A duplicate setPersonProperties call was made with the same properties. It has been ignored.")}}group(t,i,e){if(t&&i){var r=this.getGroups();r[t]!==i&&this.resetGroupPropertiesForFlags(t),this.register({$groups:g({},r,{[t]:i})}),e&&(this.capture("$groupidentify",{$group_type:t,$group_key:i,$group_set:e}),this.setGroupPropertiesForFlags({[t]:e})),r[t]===i||e||this.reloadFeatureFlags()}else Pt.error("posthog.group requires a group type and group key")}resetGroups(){this.register({$groups:{}}),this.resetGroupPropertiesForFlags(),this.reloadFeatureFlags()}setPersonPropertiesForFlags(t,i){void 0===i&&(i=!0),this.featureFlags.setPersonPropertiesForFlags(t,i)}resetPersonPropertiesForFlags(){this.featureFlags.resetPersonPropertiesForFlags()}setGroupPropertiesForFlags(t,i){void 0===i&&(i=!0),this.ts("posthog.setGroupPropertiesForFlags")&&this.featureFlags.setGroupPropertiesForFlags(t,i)}resetGroupPropertiesForFlags(t){this.featureFlags.resetGroupPropertiesForFlags(t)}reset(t){var i,e,r,s;if(Pt.info("reset"),!this.__loaded)return Pt.uninitializedWarning("posthog.reset");var n=this.get_property("$device_id");if(this.consent.reset(),null==(i=this.persistence)||i.clear(),null==(e=this.sessionPersistence)||e.clear(),this.surveys.reset(),this.featureFlags.reset(),null==(r=this.persistence)||r.set_property(ci,"anonymous"),null==(s=this.sessionManager)||s.resetSessionId(),this.Ar=null,"always"===this.config.cookieless_mode)this.register_once({distinct_id:wi,$device_id:null},"");else{var o=this.config.get_device_id($e());this.register_once({distinct_id:o,$device_id:t?o:n},"")}this.register({$last_posthog_reset:(new Date).toISOString()},1)}get_distinct_id(){return this.get_property("distinct_id")}getGroups(){return this.get_property("$groups")||{}}get_session_id(){var t,i;return null!==(t=null==(i=this.sessionManager)?void 0:i.checkAndGetSessionAndWindowId(!0).sessionId)&&void 0!==t?t:""}get_session_replay_url(t){if(!this.sessionManager)return"";var{sessionId:i,sessionStartTimestamp:e}=this.sessionManager.checkAndGetSessionAndWindowId(!0),r=this.requestRouter.endpointFor("ui","/project/"+this.config.token+"/replay/"+i);if(null!=t&&t.withTimestamp&&e){var s,n=null!==(s=t.timestampLookBack)&&void 0!==s?s:10;if(!e)return r;r+="?t="+Math.max(Math.floor(((new Date).getTime()-e)/1e3)-n,0)}return r}alias(t,i){return t===this.get_property(Wt)?(Pt.critical("Attempting to create alias for existing People user - aborting."),-2):this.ts("posthog.alias")?(M(i)&&(i=this.get_distinct_id()),t!==i?(this.es(Gt,t),this.capture("$create_alias",{alias:t,distinct_id:i})):(Pt.warn("alias matches current distinct_id - skipping api call."),this.identify(t),-1)):void 0}set_config(t){var i=g({},this.config);if(I(t)){var e,r,s,n,o;Ot(this.config,zo(t));var a=this.Nr();null==(e=this.persistence)||e.update_config(this.config,i,a),this.sessionPersistence="sessionStorage"===this.config.persistence||"memory"===this.config.persistence?this.persistence:new Mn(g({},this.config,{persistence:"sessionStorage"}),a);var l=this.Dr(this.config.debug);N(l)&&(this.config.debug=l),N(this.config.debug)&&(this.config.debug?(c.DEBUG=!0,Fe.H()&&Fe.G("ph_debug","true"),Pt.info("set_config",{config:t,oldConfig:i,newConfig:g({},this.config)})):(c.DEBUG=!1,Fe.H()&&Fe.V("ph_debug"))),null==(r=this.sessionRecording)||r.startIfEnabledOrStop(),null==(s=this.autocapture)||s.startIfEnabled(),null==(n=this.heatmaps)||n.startIfEnabled(),this.surveys.loadIfEnabled(),this.rs(),null==(o=this.externalIntegrations)||o.startIfEnabledOrStop()}}startSessionRecording(t){var i=!0===t,e={sampling:i||!(null==t||!t.sampling),linked_flag:i||!(null==t||!t.linked_flag),url_trigger:i||!(null==t||!t.url_trigger),event_trigger:i||!(null==t||!t.event_trigger)};if(Object.values(e).some(Boolean)){var r,s,n,o,a;if(null==(r=this.sessionManager)||r.checkAndGetSessionAndWindowId(),e.sampling)null==(s=this.sessionRecording)||s.overrideSampling();if(e.linked_flag)null==(n=this.sessionRecording)||n.overrideLinkedFlag();if(e.url_trigger)null==(o=this.sessionRecording)||o.overrideTrigger("url");if(e.event_trigger)null==(a=this.sessionRecording)||a.overrideTrigger("event")}this.set_config({disable_session_recording:!1})}stopSessionRecording(){this.set_config({disable_session_recording:!0})}sessionRecordingStarted(){var t;return!(null==(t=this.sessionRecording)||!t.started)}captureException(t,i){var e=new Error("PostHog syntheticException"),r=this.exceptions.buildProperties(t,{handled:!0,syntheticException:e});return this.exceptions.sendExceptionEvent(g({},r,i))}loadToolbar(t){return this.toolbar.loadToolbar(t)}get_property(t){var i;return null==(i=this.persistence)?void 0:i.props[t]}getSessionProperty(t){var i;return null==(i=this.sessionPersistence)?void 0:i.props[t]}toString(){var t,i=null!==(t=this.config.name)&&void 0!==t?t:Lo;return i!==Lo&&(i=Lo+"."+i),i}_isIdentified(){var t,i;return"identified"===(null==(t=this.persistence)?void 0:t.get_property(ci))||"identified"===(null==(i=this.sessionPersistence)?void 0:i.get_property(ci))}Zr(){var t,i;return!("never"===this.config.person_profiles||"identified_only"===this.config.person_profiles&&!this._isIdentified()&&F(this.getGroups())&&(null==(t=this.persistence)||null==(t=t.props)||!t[Gt])&&(null==(i=this.persistence)||null==(i=i.props)||!i[yi]))}Yr(){return!0===this.config.capture_pageleave||"if_capture_pageview"===this.config.capture_pageleave&&(!0===this.config.capture_pageview||"history_change"===this.config.capture_pageview)}createPersonProfile(){this.Zr()||this.ts("posthog.createPersonProfile")&&this.setPersonProperties({},{})}ts(t){return"never"===this.config.person_profiles?(Pt.error(t+' was called, but process_person is set to "never". This call will be ignored.'),!1):(this.es(yi,!0),!0)}Nr(){if("always"===this.config.cookieless_mode)return!0;var t=this.consent.isOptedOut(),i=this.config.opt_out_persistence_by_default||"on_reject"===this.config.cookieless_mode;return this.config.disable_persistence||t&&!!i}rs(){var t,i,e,r,s=this.Nr();(null==(t=this.persistence)?void 0:t.bi)!==s&&(null==(e=this.persistence)||e.set_disabled(s));(null==(i=this.sessionPersistence)?void 0:i.bi)!==s&&(null==(r=this.sessionPersistence)||r.set_disabled(s));return s}opt_in_capturing(t){var i;if("always"!==this.config.cookieless_mode){var e,r;if("on_reject"===this.config.cookieless_mode&&this.consent.isExplicitlyOptedOut())this.reset(!0),null==(e=this.sessionManager)||e.destroy(),this.sessionManager=new bo(this),this.persistence&&(this.sessionPropsManager=new mo(this,this.sessionManager,this.persistence)),this.sessionRecording=new Ao(this),this.sessionRecording.startIfEnabledOrStop();if(this.consent.optInOut(!0),this.rs(),this.Jr(),null==(i=this.sessionRecording)||i.startIfEnabledOrStop(),"on_reject"==this.config.cookieless_mode&&this.surveys.loadIfEnabled(),M(null==t?void 0:t.captureEventName)||null!=t&&t.captureEventName)this.capture(null!==(r=null==t?void 0:t.captureEventName)&&void 0!==r?r:"$opt_in",null==t?void 0:t.captureProperties,{send_instantly:!0});this.config.capture_pageview&&this.Kr()}else Pt.warn('Consent opt in/out is not valid with cookieless_mode="always" and will be ignored')}opt_out_capturing(){var t,i;"always"!==this.config.cookieless_mode?("on_reject"===this.config.cookieless_mode&&this.consent.isOptedIn()&&this.reset(!0),this.consent.optInOut(!1),this.rs(),"on_reject"===this.config.cookieless_mode&&(this.register({distinct_id:wi,$device_id:null}),null==(t=this.sessionManager)||t.destroy(),this.sessionManager=void 0,this.sessionPropsManager=void 0,null==(i=this.sessionRecording)||i.stopRecording(),this.sessionRecording=void 0,this.Kr())):Pt.warn('Consent opt in/out is not valid with cookieless_mode="always" and will be ignored')}has_opted_in_capturing(){return this.consent.isOptedIn()}has_opted_out_capturing(){return this.consent.isOptedOut()}get_explicit_consent_status(){var t=this.consent.consent;return t===Ne.GRANTED?"granted":t===Ne.DENIED?"denied":"pending"}is_capturing(){return"always"===this.config.cookieless_mode||("on_reject"===this.config.cookieless_mode?this.consent.isExplicitlyOptedOut()||this.consent.isOptedIn():!this.has_opted_out_capturing())}clear_opt_in_out_capturing(){this.consent.reset(),this.rs()}_is_bot(){return n?So(n,this.config.custom_blocked_useragents):void 0}Kr(){o&&("visible"===o.visibilityState?this.Fr||(this.Fr=!0,this.capture("$pageview",{title:o.title},{send_instantly:!0}),this.Mr&&(o.removeEventListener("visibilitychange",this.Mr),this.Mr=null)):this.Mr||(this.Mr=this.Kr.bind(this),qt(o,"visibilitychange",this.Mr)))}debug(i){!1===i?(null==t||t.console.log("You've disabled debug mode."),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)`."),this.set_config({debug:!0}))}O(){var t,i,e,r,s,n,o,a=this.jr||{};return"advanced_disable_flags"in a?!!a.advanced_disable_flags:!1!==this.config.advanced_disable_flags?!!this.config.advanced_disable_flags:!0===this.config.advanced_disable_decide?(Pt.warn("Config field 'advanced_disable_decide' is deprecated. Please use 'advanced_disable_flags' instead. The old field will be removed in a future major version."),!0):(e="advanced_disable_decide",r=!1,s=Pt,n=(i="advanced_disable_flags")in(t=a)&&!M(t[i]),o=e in t&&!M(t[e]),n?t[i]:o?(s&&s.warn("Config field '"+e+"' is deprecated. Please use '"+i+"' instead. The old field will be removed in a future major version."),t[e]):r)}Qr(t){if(j(this.config.before_send))return t;var i=C(this.config.before_send)?this.config.before_send:[this.config.before_send],e=t;for(var r of i){if(e=r(e),j(e)){var s="Event '"+t.event+"' was rejected in beforeSend function";return z(t.event)?Pt.warn(s+". This can cause unexpected behavior."):Pt.info(s),null}e.properties&&!F(e.properties)||Pt.warn("Event '"+t.event+"' has no properties after beforeSend function, this is likely an error.")}return e}getPageViewId(){var t;return null==(t=this.pageViewManager.Vt)?void 0:t.pageViewId}captureTraceFeedback(t,i){this.capture("$ai_feedback",{$ai_trace_id:String(t),$ai_feedback_text:i})}captureTraceMetric(t,i,e){this.capture("$ai_metric",{$ai_trace_id:String(t),$ai_metric_name:i,$ai_metric_value:String(e)})}Dr(t){var i=N(t)&&!t,e=Fe.H()&&"true"===Fe.q("ph_debug");return!i&&(!!e||t)}}!function(t,i){for(var e=0;e<i.length;e++)t.prototype[i[e]]=Lt(t.prototype[i[e]])}(Bo,["identify"]);var qo,Wo={backgroundColor:"#ffffff",textColor:"#1d1f27",buttonColor:"#1d1f27",buttonTextColor:"#ffffff",borderRadius:8,borderColor:"#e5e7eb",whiteLabel:!1},Go=(qo=Do[Lo]=new Bo,function(){function i(){i.done||(i.done=!0,No=!1,Mt(Do,(function(t){t._dom_loaded()})))}null!=o&&o.addEventListener?"complete"===o.readyState?i():qt(o,"DOMContentLoaded",i,{capture:!1}):t&&Pt.error("Browser doesn't support `document.addEventListener` so PostHog couldn't be initialized")}(),qo);export{ne as COPY_AUTOCAPTURE_EVENT,oe as Compression,Wo as DEFAULT_PRODUCT_TOUR_APPEARANCE,Vn as DisplaySurveyType,Bo as PostHog,Wn as SurveyEventName,Gn as SurveyEventProperties,jn as SurveyEventType,Nn as SurveyPosition,Bn as SurveyQuestionBranchingType,Hn as SurveyQuestionType,qn as SurveySchedule,Un as SurveyTabPosition,zn as SurveyType,Ln as SurveyWidgetType,Go as default,Go as posthog,ae as severityLevels};
|
|
2
2
|
//# sourceMappingURL=module.js.map
|