signalpilot-ai-internal 0.7.6__py3-none-any.whl → 0.10.0__py3-none-any.whl
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.
- signalpilot_ai_internal/_version.py +1 -1
- signalpilot_ai_internal/file_scanner_service.py +2 -1
- signalpilot_ai_internal/schema_search_config.yml +8 -8
- {signalpilot_ai_internal-0.7.6.data → signalpilot_ai_internal-0.10.0.data}/data/share/jupyter/labextensions/signalpilot-ai-internal/package.json +5 -3
- {signalpilot_ai_internal-0.7.6.data → signalpilot_ai_internal-0.10.0.data}/data/share/jupyter/labextensions/signalpilot-ai-internal/schemas/signalpilot-ai-internal/package.json.orig +4 -2
- signalpilot_ai_internal-0.10.0.data/data/share/jupyter/labextensions/signalpilot-ai-internal/static/330.af2e9cb5def5ae2b84d5.js +1 -0
- signalpilot_ai_internal-0.10.0.data/data/share/jupyter/labextensions/signalpilot-ai-internal/static/353.972abe1d2d66f083f9cc.js +1 -0
- signalpilot_ai_internal-0.10.0.data/data/share/jupyter/labextensions/signalpilot-ai-internal/static/476.ad22ccddd74ee306fb56.js +1 -0
- signalpilot_ai_internal-0.10.0.data/data/share/jupyter/labextensions/signalpilot-ai-internal/static/57.e9acd2e1f9739037f1ab.js +1 -0
- signalpilot_ai_internal-0.10.0.data/data/share/jupyter/labextensions/signalpilot-ai-internal/static/785.2d75de1a8d2c3131a8db.js +1 -0
- signalpilot_ai_internal-0.10.0.data/data/share/jupyter/labextensions/signalpilot-ai-internal/static/786.770dc7bcab77e14cc135.js +7 -0
- signalpilot_ai_internal-0.10.0.data/data/share/jupyter/labextensions/signalpilot-ai-internal/static/801.ca9e114a30896b669a3c.js +1 -0
- signalpilot_ai_internal-0.10.0.data/data/share/jupyter/labextensions/signalpilot-ai-internal/static/880.25ddd15aca09421d3765.js +1 -0
- signalpilot_ai_internal-0.10.0.data/data/share/jupyter/labextensions/signalpilot-ai-internal/static/remoteEntry.b05b2f0c9617ba28370d.js +1 -0
- {signalpilot_ai_internal-0.7.6.data → signalpilot_ai_internal-0.10.0.data}/data/share/jupyter/labextensions/signalpilot-ai-internal/static/third-party-licenses.json +20 -20
- {signalpilot_ai_internal-0.7.6.dist-info → signalpilot_ai_internal-0.10.0.dist-info}/METADATA +1 -1
- signalpilot_ai_internal-0.10.0.dist-info/RECORD +50 -0
- {signalpilot_ai_internal-0.7.6.dist-info → signalpilot_ai_internal-0.10.0.dist-info}/WHEEL +1 -1
- signalpilot_ai_internal-0.7.6.data/data/share/jupyter/labextensions/signalpilot-ai-internal/static/353.72484b768a04f89bd3dd.js +0 -1
- signalpilot_ai_internal-0.7.6.data/data/share/jupyter/labextensions/signalpilot-ai-internal/static/476.9b4f05a99f5003f82094.js +0 -1
- signalpilot_ai_internal-0.7.6.data/data/share/jupyter/labextensions/signalpilot-ai-internal/static/490.b4ccb9601c8112407c5d.js +0 -1
- signalpilot_ai_internal-0.7.6.data/data/share/jupyter/labextensions/signalpilot-ai-internal/static/785.3aa564fc148b37d1d719.js +0 -1
- signalpilot_ai_internal-0.7.6.data/data/share/jupyter/labextensions/signalpilot-ai-internal/static/839.ed04fa601a43e8dd24d1.js +0 -1
- signalpilot_ai_internal-0.7.6.data/data/share/jupyter/labextensions/signalpilot-ai-internal/static/898.4e9edb7f224152c1dcb4.js +0 -2
- signalpilot_ai_internal-0.7.6.data/data/share/jupyter/labextensions/signalpilot-ai-internal/static/898.4e9edb7f224152c1dcb4.js.LICENSE.txt +0 -1
- signalpilot_ai_internal-0.7.6.data/data/share/jupyter/labextensions/signalpilot-ai-internal/static/remoteEntry.ee8951353b00c13b8070.js +0 -1
- signalpilot_ai_internal-0.7.6.dist-info/RECORD +0 -49
- {signalpilot_ai_internal-0.7.6.data → signalpilot_ai_internal-0.10.0.data}/data/etc/jupyter/jupyter_server_config.d/signalpilot_ai.json +0 -0
- {signalpilot_ai_internal-0.7.6.data → signalpilot_ai_internal-0.10.0.data}/data/share/jupyter/labextensions/signalpilot-ai-internal/install.json +0 -0
- {signalpilot_ai_internal-0.7.6.data → signalpilot_ai_internal-0.10.0.data}/data/share/jupyter/labextensions/signalpilot-ai-internal/schemas/signalpilot-ai-internal/plugin.json +0 -0
- {signalpilot_ai_internal-0.7.6.data → signalpilot_ai_internal-0.10.0.data}/data/share/jupyter/labextensions/signalpilot-ai-internal/static/122.e2dadf63dc64d7b5f1ee.js +0 -0
- {signalpilot_ai_internal-0.7.6.data → signalpilot_ai_internal-0.10.0.data}/data/share/jupyter/labextensions/signalpilot-ai-internal/static/220.328403b5545f268b95c6.js +0 -0
- {signalpilot_ai_internal-0.7.6.data → signalpilot_ai_internal-0.10.0.data}/data/share/jupyter/labextensions/signalpilot-ai-internal/static/262.726e1da31a50868cb297.js +0 -0
- {signalpilot_ai_internal-0.7.6.data → signalpilot_ai_internal-0.10.0.data}/data/share/jupyter/labextensions/signalpilot-ai-internal/static/364.dbec4c2dc12e7b050dcc.js +0 -0
- {signalpilot_ai_internal-0.7.6.data → signalpilot_ai_internal-0.10.0.data}/data/share/jupyter/labextensions/signalpilot-ai-internal/static/384.fa432bdb7fb6b1c95ad6.js +0 -0
- {signalpilot_ai_internal-0.7.6.data → signalpilot_ai_internal-0.10.0.data}/data/share/jupyter/labextensions/signalpilot-ai-internal/static/439.37e271d7a80336daabe2.js +0 -0
- {signalpilot_ai_internal-0.7.6.data → signalpilot_ai_internal-0.10.0.data}/data/share/jupyter/labextensions/signalpilot-ai-internal/static/481.73c7a9290b7d35a8b9c1.js +0 -0
- {signalpilot_ai_internal-0.7.6.data → signalpilot_ai_internal-0.10.0.data}/data/share/jupyter/labextensions/signalpilot-ai-internal/static/512.b58fc0093d080b8ee61c.js +0 -0
- {signalpilot_ai_internal-0.7.6.data → signalpilot_ai_internal-0.10.0.data}/data/share/jupyter/labextensions/signalpilot-ai-internal/static/553.b4042a795c91d9ff71ef.js +0 -0
- {signalpilot_ai_internal-0.7.6.data → signalpilot_ai_internal-0.10.0.data}/data/share/jupyter/labextensions/signalpilot-ai-internal/static/553.b4042a795c91d9ff71ef.js.LICENSE.txt +0 -0
- {signalpilot_ai_internal-0.7.6.data → signalpilot_ai_internal-0.10.0.data}/data/share/jupyter/labextensions/signalpilot-ai-internal/static/635.9720593ee20b768da3ca.js +0 -0
- {signalpilot_ai_internal-0.7.6.data → signalpilot_ai_internal-0.10.0.data}/data/share/jupyter/labextensions/signalpilot-ai-internal/static/713.8e6edc9a965bdd578ca7.js +0 -0
- {signalpilot_ai_internal-0.7.6.data → signalpilot_ai_internal-0.10.0.data}/data/share/jupyter/labextensions/signalpilot-ai-internal/static/741.dc49867fafb03ea2ba4d.js +0 -0
- {signalpilot_ai_internal-0.7.6.data → signalpilot_ai_internal-0.10.0.data}/data/share/jupyter/labextensions/signalpilot-ai-internal/static/742.91e7b516c8699eea3373.js +0 -0
- {signalpilot_ai_internal-0.7.6.data → signalpilot_ai_internal-0.10.0.data}/data/share/jupyter/labextensions/signalpilot-ai-internal/static/888.34054db17bcf6e87ec95.js +0 -0
- {signalpilot_ai_internal-0.7.6.data → signalpilot_ai_internal-0.10.0.data}/data/share/jupyter/labextensions/signalpilot-ai-internal/static/style.js +0 -0
- {signalpilot_ai_internal-0.7.6.dist-info → signalpilot_ai_internal-0.10.0.dist-info}/licenses/LICENSE +0 -0
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";(self.webpackChunksignalpilot_ai_internal=self.webpackChunksignalpilot_ai_internal||[]).push([[476],{55476:(e,t,i)=>{i.r(t),i.d(t,{COPY_AUTOCAPTURE_EVENT:()=>ai,Compression:()=>li,DisplaySurveyType:()=>Eo,PostHog:()=>_a,SurveyEventName:()=>bo,SurveyEventProperties:()=>wo,SurveyPosition:()=>vo,SurveyQuestionBranchingType:()=>mo,SurveyQuestionType:()=>fo,SurveySchedule:()=>yo,SurveyType:()=>_o,SurveyWidgetType:()=>go,default:()=>ma,posthog:()=>ma,severityLevels:()=>ci});var s="undefined"!=typeof window?window:void 0,r="undefined"!=typeof globalThis?globalThis:s,n=Array.prototype,o=n.forEach,a=n.indexOf,l=null==r?void 0:r.navigator,c=null==r?void 0:r.document,u=null==r?void 0:r.location,h=null==r?void 0:r.fetch,d=null!=r&&r.XMLHttpRequest&&"withCredentials"in new r.XMLHttpRequest?r.XMLHttpRequest:void 0,p=null==r?void 0:r.AbortController,g=null==l?void 0:l.userAgent,v=null!=s?s:{},_={DEBUG:!1,LIB_VERSION:"1.268.5"};function f(e,t,i,s,r,n,o){try{var a=e[n](o),l=a.value}catch(e){return void i(e)}a.done?t(l):Promise.resolve(l).then(s,r)}function m(e){return function(){var t=this,i=arguments;return new Promise(function(s,r){var n=e.apply(t,i);function o(e){f(n,s,r,o,a,"next",e)}function a(e){f(n,s,r,o,a,"throw",e)}o(void 0)})}}function y(){return y=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var i=arguments[t];for(var s in i)({}).hasOwnProperty.call(i,s)&&(e[s]=i[s])}return e},y.apply(null,arguments)}function b(e,t){if(null==e)return{};var i={};for(var s in e)if({}.hasOwnProperty.call(e,s)){if(-1!==t.indexOf(s))continue;i[s]=e[s]}return i}var w=["$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 E(e,t){return-1!==e.indexOf(t)}var k=function(e){return e.trim()},S=function(e){return e.replace(/^\$/,"")},x=Array.isArray,I=Object.prototype,P=I.hasOwnProperty,F=I.toString,$=x||function(e){return"[object Array]"===F.call(e)},R=e=>"function"==typeof e,C=e=>e===Object(e)&&!$(e),T=e=>{if(C(e)){for(var t in e)if(P.call(e,t))return!1;return!0}return!1},A=e=>void 0===e,O=e=>"[object String]"==F.call(e),M=e=>O(e)&&0===e.trim().length,L=e=>null===e,D=e=>A(e)||L(e),N=e=>"[object Number]"==F.call(e),H=e=>"[object Boolean]"===F.call(e),j=e=>E(w,e);function q(e){return null===e||"object"!=typeof e}function B(e,t){return Object.prototype.toString.call(e)==="[object "+t+"]"}function U(e){return!A(Event)&&function(e,t){try{return e instanceof t}catch(e){return!1}}(e,Event)}var z=[!0,"true",1,"1","yes"],G=e=>E(z,e),W=[!1,"false",0,"0","no"];function V(e,t,i,s,r){return t>i&&(s.warn("min cannot be greater than max."),t=i),N(e)?e>i?(s.warn(" cannot be greater than max: "+i+". Using max value instead."),i):e<t?(s.warn(" cannot be less than min: "+t+". Using min value instead."),t):e:(s.warn(" must be a number. using max or fallback. max: "+i+", fallback: "+r),V(r||i,t,i,s))}class Y{constructor(e){this.t=e,this.i={},this.o=()=>{Object.keys(this.i).forEach(e=>{var t=this.h(e)+this.m;t>=this.S?delete this.i[e]:this.k(e,t)})},this.h=e=>this.i[String(e)],this.k=(e,t)=>{this.i[String(e)]=t},this.consumeRateLimit=e=>{var t,i,s=null!==(t=this.h(e))&&void 0!==t?t:this.S;if(0===(s=Math.max(s-1,0)))return!0;this.k(e,s);var r=0===s;return r&&(null==(i=this.$)||i.call(this,e)),r},this.$=this.t.$,this.S=V(this.t.bucketSize,0,100,this.t.P),this.m=V(this.t.refillRate,0,this.S,this.t.P),this.R=V(this.t.refillInterval,0,864e5,this.t.P),this.I=setInterval(()=>{this.o()},this.R)}stop(){this.I&&(clearInterval(this.I),this.I=void 0)}}var X,J,K,Z=e=>e instanceof Error;function Q(e){var t=globalThis._posthogChunkIds;if(t){var i=Object.keys(t);return K&&i.length===J||(J=i.length,K=i.reduce((i,s)=>{X||(X={});var r=X[s];if(r)i[r[0]]=r[1];else for(var n=e(s),o=n.length-1;o>=0;o--){var a=n[o],l=null==a?void 0:a.filename,c=t[s];if(l&&c){i[l]=c,X[s]=[l,c];break}}return i},{})),K}}var ee="?";function te(e,t,i,s){var r={platform:"web:javascript",filename:e,function:"<anonymous>"===t?ee:t,in_app:!0};return A(i)||(r.lineno=i),A(s)||(r.colno=s),r}var ie=(e,t)=>{var i=-1!==e.indexOf("safari-extension"),s=-1!==e.indexOf("safari-web-extension");return i||s?[-1!==e.indexOf("@")?e.split("@")[0]:ee,i?"safari-extension:"+t:"safari-web-extension:"+t]:[e,t]},se=/^\s*at (\S+?)(?::(\d+))(?::(\d+))\s*$/i,re=/^\s*at (?:(.+?\)(?: \[.+\])?|.*?) ?\((?:address at )?)?(?:async )?((?:<anonymous>|[-a-z]+:|.*bundle|\/)?.*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i,ne=/\((\S*)(?::(\d+))(?::(\d+))\)/,oe=e=>{var t=se.exec(e);if(t){var[,i,s,r]=t;return te(i,ee,+s,+r)}var n=re.exec(e);if(n){if(n[2]&&0===n[2].indexOf("eval")){var o=ne.exec(n[2]);o&&(n[2]=o[1],n[3]=o[2],n[4]=o[3])}var[a,l]=ie(n[1]||ee,n[2]);return te(l,a,n[3]?+n[3]:void 0,n[4]?+n[4]:void 0)}},ae=/^\s*(.*?)(?:\((.*?)\))?(?:^|@)?((?:[-a-z]+)?:\/.*?|\[native code\]|[^@]*(?:bundle|\d+\.js)|\/[\w\-. /=]+)(?::(\d+))?(?::(\d+))?\s*$/i,le=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i,ce=e=>{var t=ae.exec(e);if(t){if(t[3]&&t[3].indexOf(" > eval")>-1){var i=le.exec(t[3]);i&&(t[1]=t[1]||"eval",t[3]=i[1],t[4]=i[2],t[5]="")}var s=t[3],r=t[1]||ee;return[r,s]=ie(r,s),te(s,r,t[4]?+t[4]:void 0,t[5]?+t[5]:void 0)}},ue=/\(error: (.*)\)/;class he{constructor(e,t,i){void 0===e&&(e=[]),void 0===t&&(t=[]),void 0===i&&(i=[]),this.coercers=e,this.modifiers=i,this.stackParser=function(){for(var e=arguments.length,t=new Array(e),i=0;i<e;i++)t[i]=arguments[i];return function(e,i){void 0===i&&(i=0);for(var s=[],r=e.split("\n"),n=i;n<r.length;n++){var o=r[n];if(!(o.length>1024)){var a=ue.test(o)?o.replace(ue,"$1"):o;if(!a.match(/\S*Error: /)){for(var l of t){var c=l(a);if(c){s.push(c);break}}if(s.length>=50)break}}}return function(e){if(!e.length)return[];var t=Array.from(e);return t.reverse(),t.slice(0,50).map(e=>{return y({},e,{filename:e.filename||(i=t,i[i.length-1]||{}).filename,function:e.function||ee});var i})}(s)}}(...t)}buildFromUnknown(e,t){void 0===t&&(t={});var i=t&&t.mechanism||{handled:!0,type:"generic"},s=this.buildCoercingContext(i,t,0).apply(e),r=this.buildParsingContext(),n=this.parseStacktrace(s,r);return{$exception_list:this.convertToExceptionList(n,i),$exception_level:"error"}}modifyFrames(e){var t=this;return m(function*(){for(var i of e)i.stacktrace&&i.stacktrace.frames&&$(i.stacktrace.frames)&&(i.stacktrace.frames=yield t.applyModifiers(i.stacktrace.frames));return e})()}coerceFallback(e){var t;return{type:"Error",value:"Unknown error",stack:null==(t=e.syntheticException)?void 0:t.stack,synthetic:!0}}parseStacktrace(e,t){var i,s;return null!=e.cause&&(i=this.parseStacktrace(e.cause,t)),""!=e.stack&&null!=e.stack&&(s=this.applyChunkIds(this.stackParser(e.stack,e.synthetic?1:0),t.chunkIdMap)),y({},e,{cause:i,stack:s})}applyChunkIds(e,t){return e.map(e=>(e.filename&&t&&(e.chunk_id=t[e.filename]),e))}applyCoercers(e,t){for(var i of this.coercers)if(i.match(e))return i.coerce(e,t);return this.coerceFallback(t)}applyModifiers(e){var t=this;return m(function*(){var i=e;for(var s of t.modifiers)i=yield s(i);return i})()}convertToExceptionList(e,t){var i,s,r,n={type:e.type,value:e.value,mechanism:{type:null!==(i=t.type)&&void 0!==i?i:"generic",handled:null===(s=t.handled)||void 0===s||s,synthetic:null!==(r=e.synthetic)&&void 0!==r&&r}};e.stack&&(n.stacktrace={type:"raw",frames:e.stack});var o=[n];return null!=e.cause&&o.push(...this.convertToExceptionList(e.cause,y({},t,{handled:!0}))),o}buildParsingContext(){return{chunkIdMap:Q(this.stackParser)}}buildCoercingContext(e,t,i){void 0===i&&(i=0);var s=(i,s)=>{if(s<=4){var r=this.buildCoercingContext(e,t,s);return this.applyCoercers(i,r)}};return y({},t,{syntheticException:0==i?t.syntheticException:void 0,mechanism:e,apply:e=>s(e,i),next:e=>s(e,i+1)})}}class de{match(e){return this.isDOMException(e)||this.isDOMError(e)}coerce(e,t){var i=O(e.stack);return{type:this.getType(e),value:this.getValue(e),stack:i?e.stack:void 0,cause:e.cause?t.next(e.cause):void 0,synthetic:!1}}getType(e){return this.isDOMError(e)?"DOMError":"DOMException"}getValue(e){var t=e.name||(this.isDOMError(e)?"DOMError":"DOMException");return e.message?t+": "+e.message:t}isDOMException(e){return B(e,"DOMException")}isDOMError(e){return B(e,"DOMError")}}class pe{match(e){return(e=>e instanceof Error)(e)}coerce(e,t){return{type:this.getType(e),value:this.getMessage(e,t),stack:this.getStack(e),cause:e.cause?t.next(e.cause):void 0,synthetic:!1}}getType(e){return e.name||e.constructor.name}getMessage(e,t){var i=e.message;return i.error&&"string"==typeof i.error.message?String(i.error.message):String(i)}getStack(e){return e.stacktrace||e.stack||void 0}}class ge{constructor(){}match(e){return B(e,"ErrorEvent")&&null!=e.error}coerce(e,t){var i;return t.apply(e.error)||{type:"ErrorEvent",value:e.message,stack:null==(i=t.syntheticException)?void 0:i.stack,synthetic:!0}}}var ve=/^(?:[Uu]ncaught (?:exception: )?)?(?:((?:Eval|Internal|Range|Reference|Syntax|Type|URI|)Error): )?(.*)$/i;class _e{match(e){return"string"==typeof e}coerce(e,t){var i,[s,r]=this.getInfos(e);return{type:null!=s?s:"Error",value:null!=r?r:e,stack:null==(i=t.syntheticException)?void 0:i.stack,synthetic:!0}}getInfos(e){var t="Error",i=e,s=e.match(ve);return s&&(t=s[1],i=s[2]),[t,i]}}var fe=["fatal","error","warning","log","info","debug"];function me(e,t){void 0===t&&(t=40);var i=Object.keys(e);if(i.sort(),!i.length)return"[object has no keys]";for(var s=i.length;s>0;s--){var r=i.slice(0,s).join(", ");if(!(r.length>t))return s===i.length||r.length<=t?r:r.slice(0,t)+"..."}return""}class ye{match(e){return"object"==typeof e&&null!==e}coerce(e,t){var i,s=this.getErrorPropertyFromObject(e);return s?t.apply(s):{type:this.getType(e),value:this.getValue(e),stack:null==(i=t.syntheticException)?void 0:i.stack,level:this.isSeverityLevel(e.level)?e.level:"error",synthetic:!0}}getType(e){return U(e)?e.constructor.name:"Error"}getValue(e){if("name"in e&&"string"==typeof e.name){var t="'"+e.name+"' captured as exception";return"message"in e&&"string"==typeof e.message&&(t+=" with message: '"+e.message+"'"),t}if("message"in e&&"string"==typeof e.message)return e.message;var i=this.getObjectClassName(e);return(i&&"Object"!==i?"'"+i+"'":"Object")+" captured as exception with keys: "+me(e)}isSeverityLevel(e){return O(e)&&!M(e)&&fe.indexOf(e)>=0}getErrorPropertyFromObject(e){for(var t in e)if(Object.prototype.hasOwnProperty.call(e,t)){var i=e[t];if(Z(i))return i}}getObjectClassName(e){try{var t=Object.getPrototypeOf(e);return t?t.constructor.name:void 0}catch(e){return}}}class be{match(e){return U(e)}coerce(e,t){var i,s=e.constructor.name;return{type:s,value:s+" captured as exception with keys: "+me(e),stack:null==(i=t.syntheticException)?void 0:i.stack,synthetic:!0}}}class we{match(e){return q(e)}coerce(e,t){var i;return{type:"Error",value:"Primitive value captured as exception: "+String(e),stack:null==(i=t.syntheticException)?void 0:i.stack,synthetic:!0}}}class Ee{match(e){return B(e,"PromiseRejectionEvent")}coerce(e,t){var i,s=this.getUnhandledRejectionReason(e);return q(s)?{type:"UnhandledRejection",value:"Non-Error promise rejection captured with value: "+String(s),stack:null==(i=t.syntheticException)?void 0:i.stack,synthetic:!0}:t.apply(s)}getUnhandledRejectionReason(e){if(q(e))return e;try{if("reason"in e)return e.reason;if("detail"in e&&"reason"in e.detail)return e.detail.reason}catch(e){}return e}}var ke=e=>{var t={T:function(t){if(s&&(_.DEBUG||v.POSTHOG_DEBUG)&&!A(s.console)&&s.console){for(var i=("__rrweb_original__"in s.console[t]?s.console[t].__rrweb_original__:s.console[t]),r=arguments.length,n=new Array(r>1?r-1:0),o=1;o<r;o++)n[o-1]=arguments[o];i(e,...n)}},info:function(){for(var e=arguments.length,i=new Array(e),s=0;s<e;s++)i[s]=arguments[s];t.T("log",...i)},warn:function(){for(var e=arguments.length,i=new Array(e),s=0;s<e;s++)i[s]=arguments[s];t.T("warn",...i)},error:function(){for(var e=arguments.length,i=new Array(e),s=0;s<e;s++)i[s]=arguments[s];t.T("error",...i)},critical:function(){for(var t=arguments.length,i=new Array(t),s=0;s<t;s++)i[s]=arguments[s];console.error(e,...i)},uninitializedWarning:e=>{t.error("You must initialize PostHog before calling "+e)},createLogger:t=>ke(e+" "+t)};return t},Se=ke("[PostHog.js]"),xe=Se.createLogger,Ie=xe("[ExternalScriptsLoader]"),Pe=(e,t,i)=>{if(e.config.disable_external_dependency_loading)return Ie.warn(t+" was requested but loading of external scripts is disabled."),i("Loading of external scripts is disabled");var s=null==c?void 0:c.querySelectorAll("script");if(s)for(var r,n=function(){if(s[o].src===t){var e=s[o];return e.__posthog_loading_callback_fired?{v:i()}:(e.addEventListener("load",t=>{e.__posthog_loading_callback_fired=!0,i(void 0,t)}),e.onerror=e=>i(e),{v:void 0})}},o=0;o<s.length;o++)if(r=n())return r.v;var a=()=>{if(!c)return i("document not found");var s=c.createElement("script");if(s.type="text/javascript",s.crossOrigin="anonymous",s.src=t,s.onload=e=>{s.__posthog_loading_callback_fired=!0,i(void 0,e)},s.onerror=e=>i(e),e.config.prepare_external_dependency_script&&(s=e.config.prepare_external_dependency_script(s)),!s)return i("prepare_external_dependency_script returned null");var r,n=c.querySelectorAll("body > script");n.length>0?null==(r=n[0].parentNode)||r.insertBefore(s,n[0]):c.body.appendChild(s)};null!=c&&c.body?a():null==c||c.addEventListener("DOMContentLoaded",a)};v.__PosthogExtensions__=v.__PosthogExtensions__||{},v.__PosthogExtensions__.loadExternalDependency=(e,t,i)=>{var s="/static/"+t+".js?v="+e.version;if("remote-config"===t&&(s="/array/"+e.config.token+"/config.js"),"toolbar"===t){var r=3e5;s=s+"&t="+Math.floor(Date.now()/r)*r}var n=e.requestRouter.endpointFor("assets",s);Pe(e,n,i)},v.__PosthogExtensions__.loadSiteApp=(e,t,i)=>{var s=e.requestRouter.endpointFor("api",t);Pe(e,s,i)};var Fe={};function $e(e,t,i){if($(e))if(o&&e.forEach===o)e.forEach(t,i);else if("length"in e&&e.length===+e.length)for(var s=0,r=e.length;s<r;s++)if(s in e&&t.call(i,e[s],s)===Fe)return}function Re(e,t,i){if(!D(e)){if($(e))return $e(e,t,i);if((e=>e instanceof FormData)(e)){for(var s of e.entries())if(t.call(i,s[1],s[0])===Fe)return}else for(var r in e)if(P.call(e,r)&&t.call(i,e[r],r)===Fe)return}}var Ce=function(e){for(var t=arguments.length,i=new Array(t>1?t-1:0),s=1;s<t;s++)i[s-1]=arguments[s];return $e(i,function(t){for(var i in t)void 0!==t[i]&&(e[i]=t[i])}),e},Te=function(e){for(var t=arguments.length,i=new Array(t>1?t-1:0),s=1;s<t;s++)i[s-1]=arguments[s];return $e(i,function(t){$e(t,function(t){e.push(t)})}),e};function Ae(e){for(var t=Object.keys(e),i=t.length,s=new Array(i);i--;)s[i]=[t[i],e[t[i]]];return s}var Oe=function(e){try{return e()}catch(e){return}},Me=function(e){return function(){try{for(var t=arguments.length,i=new Array(t),s=0;s<t;s++)i[s]=arguments[s];return e.apply(this,i)}catch(e){Se.critical("Implementation error. Please turn on debug mode and open a ticket on https://app.posthog.com/home#panel=support%3Asupport%3A."),Se.critical(e)}}},Le=function(e){var t={};return Re(e,function(e,i){(O(e)&&e.length>0||N(e))&&(t[i]=e)}),t},De=["herokuapp.com","vercel.app","netlify.app"];function Ne(e){var t=null==e?void 0:e.hostname;if(!O(t))return!1;var i=t.split(".").slice(-2).join(".");for(var s of De)if(i===s)return!1;return!0}function He(e,t){for(var i=0;i<e.length;i++)if(t(e[i]))return e[i]}function je(e,t,i,s){var{capture:r=!1,passive:n=!0}=null!=s?s:{};null==e||e.addEventListener(t,i,{capture:r,passive:n})}var qe="$people_distinct_id",Be="__alias",Ue="__timers",ze="$autocapture_disabled_server_side",Ge="$heatmaps_enabled_server_side",We="$exception_capture_enabled_server_side",Ve="$error_tracking_suppression_rules",Ye="$error_tracking_capture_extension_exceptions",Xe="$web_vitals_enabled_server_side",Je="$dead_clicks_enabled_server_side",Ke="$web_vitals_allowed_metrics",Ze="$session_recording_remote_config",Qe="$session_recording_enabled_server_side",et="$console_log_recording_enabled_server_side",tt="$session_recording_network_payload_capture",it="$session_recording_masking",st="$session_recording_canvas_recording",rt="$replay_sample_rate",nt="$replay_minimum_duration",ot="$replay_script_config",at="$sesid",lt="$session_is_sampled",ct="$session_recording_url_trigger_activated_session",ut="$session_recording_event_trigger_activated_session",ht="$enabled_feature_flags",dt="$early_access_features",pt="$feature_flag_details",gt="$stored_person_properties",vt="$stored_group_properties",_t="$surveys",ft="$surveys_activated",mt="$flag_call_reported",yt="$user_state",bt="$client_session_props",wt="$capture_rate_limit",Et="$initial_campaign_params",kt="$initial_referrer_info",St="$initial_person_info",xt="$epp",It="__POSTHOG_TOOLBAR__",Pt="$posthog_cookieless",Ft=[qe,Be,"__cmpns",Ue,Qe,Ge,at,ht,Ve,yt,dt,pt,vt,gt,_t,mt,bt,wt,Et,kt,xt,St];function $t(e){return e instanceof Element&&(e.id===It||!(null==e.closest||!e.closest(".toolbar-global-fade-container")))}function Rt(e){return!!e&&1===e.nodeType}function Ct(e,t){return!!e&&!!e.tagName&&e.tagName.toLowerCase()===t.toLowerCase()}function Tt(e){return!!e&&3===e.nodeType}function At(e){return!!e&&11===e.nodeType}function Ot(e){return e?k(e).split(/\s+/):[]}function Mt(e){var t=null==s?void 0:s.location.href;return!!(t&&e&&e.some(e=>t.match(e)))}function Lt(e){var t="";switch(typeof e.className){case"string":t=e.className;break;case"object":t=(e.className&&"baseVal"in e.className?e.className.baseVal:null)||e.getAttribute("class")||"";break;default:t=""}return Ot(t)}function Dt(e){return D(e)?null:k(e).split(/(\s+)/).filter(e=>ei(e)).join("").replace(/[\r\n]/g," ").replace(/[ ]+/g," ").substring(0,255)}function Nt(e){var t="";return Wt(e)&&!Vt(e)&&e.childNodes&&e.childNodes.length&&Re(e.childNodes,function(e){var i;Tt(e)&&e.textContent&&(t+=null!==(i=Dt(e.textContent))&&void 0!==i?i:"")}),k(t)}function Ht(e){return A(e.target)?e.srcElement||null:null!=(t=e.target)&&t.shadowRoot?e.composedPath()[0]||null:e.target||null;var t}var jt=["a","button","form","input","select","textarea","label"];function qt(e,t){if(A(t))return!0;var i,s=function(e){if(t.some(t=>e.matches(t)))return{v:!0}};for(var r of e)if(i=s(r))return i.v;return!1}function Bt(e){var t=e.parentNode;return!(!t||!Rt(t))&&t}var Ut=[".ph-no-rageclick",".ph-no-capture"],zt=e=>!e||Ct(e,"html")||!Rt(e),Gt=(e,t)=>{if(!s||zt(e))return{parentIsUsefulElement:!1,targetElementList:[]};for(var i=!1,r=[e],n=e;n.parentNode&&!Ct(n,"body");)if(At(n.parentNode))r.push(n.parentNode.host),n=n.parentNode.host;else{var o=Bt(n);if(!o)break;if(t||jt.indexOf(o.tagName.toLowerCase())>-1)i=!0;else{var a=s.getComputedStyle(o);a&&"pointer"===a.getPropertyValue("cursor")&&(i=!0)}r.push(o),n=o}return{parentIsUsefulElement:i,targetElementList:r}};function Wt(e){for(var t=e;t.parentNode&&!Ct(t,"body");t=t.parentNode){var i=Lt(t);if(E(i,"ph-sensitive")||E(i,"ph-no-capture"))return!1}if(E(Lt(e),"ph-include"))return!0;var s=e.type||"";if(O(s))switch(s.toLowerCase()){case"hidden":case"password":return!1}var r=e.name||e.id||"";return!O(r)||!/^cc|cardnum|ccnum|creditcard|csc|cvc|cvv|exp|pass|pwd|routing|seccode|securitycode|securitynum|socialsec|socsec|ssn/i.test(r.replace(/[^a-zA-Z0-9]/g,""))}function Vt(e){return!!(Ct(e,"input")&&!["button","checkbox","submit","reset"].includes(e.type)||Ct(e,"select")||Ct(e,"textarea")||"true"===e.getAttribute("contenteditable"))}var Yt="(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})",Xt=new RegExp("^(?:"+Yt+")$"),Jt=new RegExp(Yt),Kt="\\d{3}-?\\d{2}-?\\d{4}",Zt=new RegExp("^("+Kt+")$"),Qt=new RegExp("("+Kt+")");function ei(e,t){if(void 0===t&&(t=!0),D(e))return!1;if(O(e)){if(e=k(e),(t?Xt:Jt).test((e||"").replace(/[- ]/g,"")))return!1;if((t?Zt:Qt).test(e))return!1}return!0}function ti(e){var t=Nt(e);return ei(t=(t+" "+ii(e)).trim())?t:""}function ii(e){var t="";return e&&e.childNodes&&e.childNodes.length&&Re(e.childNodes,function(e){var i;if(e&&"span"===(null==(i=e.tagName)?void 0:i.toLowerCase()))try{var s=Nt(e);t=(t+" "+s).trim(),e.childNodes&&e.childNodes.length&&(t=(t+" "+ii(e)).trim())}catch(e){Se.error("[AutoCapture]",e)}}),t}function si(e){return function(e){var t=e.map(e=>{var t,i,s="";if(e.tag_name&&(s+=e.tag_name),e.attr_class)for(var r of(e.attr_class.sort(),e.attr_class))s+="."+r.replace(/"/g,"");var n=y({},e.text?{text:e.text}:{},{"nth-child":null!==(t=e.nth_child)&&void 0!==t?t:0,"nth-of-type":null!==(i=e.nth_of_type)&&void 0!==i?i:0},e.href?{href:e.href}:{},e.attr_id?{attr_id:e.attr_id}:{},e.attributes),o={};return Ae(n).sort((e,t)=>{var[i]=e,[s]=t;return i.localeCompare(s)}).forEach(e=>{var[t,i]=e;return o[ri(t.toString())]=ri(i.toString())}),(s+=":")+Ae(o).map(e=>{var[t,i]=e;return t+'="'+i+'"'}).join("")});return t.join(";")}(function(e){return e.map(e=>{var t,i,s={text:null==(t=e.$el_text)?void 0:t.slice(0,400),tag_name:e.tag_name,href:null==(i=e.attr__href)?void 0:i.slice(0,2048),attr_class:ni(e),attr_id:e.attr__id,nth_child:e.nth_child,nth_of_type:e.nth_of_type,attributes:{}};return Ae(e).filter(e=>{var[t]=e;return 0===t.indexOf("attr__")}).forEach(e=>{var[t,i]=e;return s.attributes[t]=i}),s})}(e))}function ri(e){return e.replace(/"|\\"/g,'\\"')}function ni(e){var t=e.attr__class;return t?$(t)?t:Ot(t):void 0}class oi{constructor(){this.clicks=[]}isRageClick(e,t,i){var s=this.clicks[this.clicks.length-1];if(s&&Math.abs(e-s.x)+Math.abs(t-s.y)<30&&i-s.timestamp<1e3){if(this.clicks.push({x:e,y:t,timestamp:i}),3===this.clicks.length)return!0}else this.clicks=[{x:e,y:t,timestamp:i}];return!1}}var ai="$copy_autocapture",li=function(e){return e.GZipJS="gzip-js",e.Base64="base64",e}({}),ci=["fatal","error","warning","log","info","debug"],ui=["localhost","127.0.0.1"],hi=e=>{var t=null==c?void 0:c.createElement("a");return A(t)?null:(t.href=e,t)},di=function(e,t){for(var i,s=((e.split("#")[0]||"").split(/\?(.*)/)[1]||"").replace(/^\?+/g,"").split("&"),r=0;r<s.length;r++){var n=s[r].split("=");if(n[0]===t){i=n;break}}if(!$(i)||i.length<2)return"";var o=i[1];try{o=decodeURIComponent(o)}catch(e){Se.error("Skipping decoding for malformed query param: "+o)}return o.replace(/\+/g," ")},pi=function(e,t,i){if(!e||!t||!t.length)return e;for(var s=e.split("#"),r=s[0]||"",n=s[1],o=r.split("?"),a=o[1],l=o[0],c=(a||"").split("&"),u=[],h=0;h<c.length;h++){var d=c[h].split("=");$(d)&&(t.includes(d[0])?u.push(d[0]+"="+i):u.push(c[h]))}var p=l;return null!=a&&(p+="?"+u.join("&")),null!=n&&(p+="#"+n),p},gi=function(e,t){var i=e.match(new RegExp(t+"=([^&]*)"));return i?i[1]:null},vi=xe("[AutoCapture]");function _i(e,t){return t.length>e?t.slice(0,e)+"...":t}function fi(e){if(e.previousElementSibling)return e.previousElementSibling;var t=e;do{t=t.previousSibling}while(t&&!Rt(t));return t}class mi{constructor(e){this.C=!1,this.M=null,this.rageclicks=new oi,this.O=!1,this.instance=e,this.F=null}get A(){var e,t,i=C(this.instance.config.autocapture)?this.instance.config.autocapture:{};return i.url_allowlist=null==(e=i.url_allowlist)?void 0:e.map(e=>new RegExp(e)),i.url_ignorelist=null==(t=i.url_ignorelist)?void 0:t.map(e=>new RegExp(e)),i}D(){if(this.isBrowserSupported()){if(s&&c){var e=e=>{e=e||(null==s?void 0:s.event);try{this.j(e)}catch(e){vi.error("Failed to capture event",e)}};if(je(c,"submit",e,{capture:!0}),je(c,"change",e,{capture:!0}),je(c,"click",e,{capture:!0}),this.A.capture_copied_text){var t=e=>{e=e||(null==s?void 0:s.event),this.j(e,ai)};je(c,"copy",t,{capture:!0}),je(c,"cut",t,{capture:!0})}}}else vi.info("Disabling Automatic Event Collection because this browser is not supported")}startIfEnabled(){this.isEnabled&&!this.C&&(this.D(),this.C=!0)}onRemoteConfig(e){e.elementsChainAsString&&(this.O=e.elementsChainAsString),this.instance.persistence&&this.instance.persistence.register({[ze]:!!e.autocapture_opt_out}),this.M=!!e.autocapture_opt_out,this.startIfEnabled()}setElementSelectors(e){this.F=e}getElementSelectors(e){var t,i=[];return null==(t=this.F)||t.forEach(t=>{var s=null==c?void 0:c.querySelectorAll(t);null==s||s.forEach(s=>{e===s&&i.push(t)})}),i}get isEnabled(){var e,t,i=null==(e=this.instance.persistence)?void 0:e.props[ze],s=this.M;if(L(s)&&!H(i)&&!this.instance.L())return!1;var r=null!==(t=this.M)&&void 0!==t?t:!!i;return!!this.instance.config.autocapture&&!r}j(e,t){if(void 0===t&&(t="$autocapture"),this.isEnabled){var i,r=Ht(e);Tt(r)&&(r=r.parentNode||null),"$autocapture"===t&&"click"===e.type&&e instanceof MouseEvent&&this.instance.config.rageclick&&null!=(i=this.rageclicks)&&i.isRageClick(e.clientX,e.clientY,(new Date).getTime())&&function(e,t){if(!s||zt(e))return!1;var i,r;if(!1===(i=H(t)?!!t&&Ut:null!==(r=null==t?void 0:t.css_selector_ignorelist)&&void 0!==r?r:Ut))return!1;var{targetElementList:n}=Gt(e,!1);return!qt(n,i)}(r,this.instance.config.rageclick)&&this.j(e,"$rageclick");var n=t===ai;if(r&&function(e,t,i,r,n){var o,a,l,c;if(void 0===i&&(i=void 0),!s||zt(e))return!1;if(null!=(o=i)&&o.url_allowlist&&!Mt(i.url_allowlist))return!1;if(null!=(a=i)&&a.url_ignorelist&&Mt(i.url_ignorelist))return!1;if(null!=(l=i)&&l.dom_event_allowlist){var u=i.dom_event_allowlist;if(u&&!u.some(e=>t.type===e))return!1}var{parentIsUsefulElement:h,targetElementList:d}=Gt(e,r);if(!function(e,t){var i=null==t?void 0:t.element_allowlist;if(A(i))return!0;var s,r=function(e){if(i.some(t=>e.tagName.toLowerCase()===t))return{v:!0}};for(var n of e)if(s=r(n))return s.v;return!1}(d,i))return!1;if(!qt(d,null==(c=i)?void 0:c.css_selector_allowlist))return!1;var p=s.getComputedStyle(e);if(p&&"pointer"===p.getPropertyValue("cursor")&&"click"===t.type)return!0;var g=e.tagName.toLowerCase();switch(g){case"html":return!1;case"form":return(n||["submit"]).indexOf(t.type)>=0;case"input":case"select":case"textarea":return(n||["change","click"]).indexOf(t.type)>=0;default:return h?(n||["click"]).indexOf(t.type)>=0:(n||["click"]).indexOf(t.type)>=0&&(jt.indexOf(g)>-1||"true"===e.getAttribute("contenteditable"))}}(r,e,this.A,n,n?["copy","cut"]:void 0)){var{props:o,explicitNoCapture:a}=function(e,t){for(var i,r,{e:n,maskAllElementAttributes:o,maskAllText:a,elementAttributeIgnoreList:l,elementsChainAsString:c}=t,u=[e],h=e;h.parentNode&&!Ct(h,"body");)At(h.parentNode)?(u.push(h.parentNode.host),h=h.parentNode.host):(u.push(h.parentNode),h=h.parentNode);var d,p=[],g={},v=!1,_=!1;if(Re(u,e=>{var t=Wt(e);"a"===e.tagName.toLowerCase()&&(v=e.getAttribute("href"),v=t&&v&&ei(v)&&v),E(Lt(e),"ph-no-capture")&&(_=!0),p.push(function(e,t,i,s){var r=e.tagName.toLowerCase(),n={tag_name:r};jt.indexOf(r)>-1&&!i&&("a"===r.toLowerCase()||"button"===r.toLowerCase()?n.$el_text=_i(1024,ti(e)):n.$el_text=_i(1024,Nt(e)));var o=Lt(e);o.length>0&&(n.classes=o.filter(function(e){return""!==e})),Re(e.attributes,function(i){var r;if((!Vt(e)||-1!==["name","id","class","aria-label"].indexOf(i.name))&&(null==s||!s.includes(i.name))&&!t&&ei(i.value)&&(r=i.name,!O(r)||"_ngcontent"!==r.substring(0,10)&&"_nghost"!==r.substring(0,7))){var o=i.value;"class"===i.name&&(o=Ot(o).join(" ")),n["attr__"+i.name]=_i(1024,o)}});for(var a=1,l=1,c=e;c=fi(c);)a++,c.tagName===e.tagName&&l++;return n.nth_child=a,n.nth_of_type=l,n}(e,o,a,l));var i=function(e){if(!Wt(e))return{};var t={};return Re(e.attributes,function(e){if(e.name&&0===e.name.indexOf("data-ph-capture-attribute")){var i=e.name.replace("data-ph-capture-attribute-",""),s=e.value;i&&s&&ei(s)&&(t[i]=s)}}),t}(e);Ce(g,i)}),_)return{props:{},explicitNoCapture:_};if(a||("a"===e.tagName.toLowerCase()||"button"===e.tagName.toLowerCase()?p[0].$el_text=ti(e):p[0].$el_text=Nt(e)),v){var f,m;p[0].attr__href=v;var y=null==(f=hi(v))?void 0:f.host,b=null==s||null==(m=s.location)?void 0:m.host;y&&b&&y!==b&&(d=v)}return{props:Ce({$event_type:n.type,$ce_version:1},c?{}:{$elements:p},{$elements_chain:si(p)},null!=(i=p[0])&&i.$el_text?{$el_text:null==(r=p[0])?void 0:r.$el_text}:{},d&&"click"===n.type?{$external_click_url:d}:{},g)}}(r,{e,maskAllElementAttributes:this.instance.config.mask_all_element_attributes,maskAllText:this.instance.config.mask_all_text,elementAttributeIgnoreList:this.A.element_attribute_ignorelist,elementsChainAsString:this.O});if(a)return!1;var l=this.getElementSelectors(r);if(l&&l.length>0&&(o.$element_selectors=l),t===ai){var c,u=Dt(null==s||null==(c=s.getSelection())?void 0:c.toString()),h=e.type||"clipboard";if(!u)return!1;o.$selected_content=u,o.$copy_type=h}return this.instance.capture(t,o),!0}}}isBrowserSupported(){return R(null==c?void 0:c.querySelectorAll)}}Math.trunc||(Math.trunc=function(e){return e<0?Math.ceil(e):Math.floor(e)}),Number.isInteger||(Number.isInteger=function(e){return N(e)&&isFinite(e)&&Math.floor(e)===e});var yi="0123456789abcdef";class bi{constructor(e){if(this.bytes=e,16!==e.length)throw new TypeError("not 128-bit length")}static fromFieldsV7(e,t,i,s){if(!Number.isInteger(e)||!Number.isInteger(t)||!Number.isInteger(i)||!Number.isInteger(s)||e<0||t<0||i<0||s<0||e>0xffffffffffff||t>4095||i>1073741823||s>4294967295)throw new RangeError("invalid field value");var r=new Uint8Array(16);return r[0]=e/Math.pow(2,40),r[1]=e/Math.pow(2,32),r[2]=e/Math.pow(2,24),r[3]=e/Math.pow(2,16),r[4]=e/Math.pow(2,8),r[5]=e,r[6]=112|t>>>8,r[7]=t,r[8]=128|i>>>24,r[9]=i>>>16,r[10]=i>>>8,r[11]=i,r[12]=s>>>24,r[13]=s>>>16,r[14]=s>>>8,r[15]=s,new bi(r)}toString(){for(var e="",t=0;t<this.bytes.length;t++)e=e+yi.charAt(this.bytes[t]>>>4)+yi.charAt(15&this.bytes[t]),3!==t&&5!==t&&7!==t&&9!==t||(e+="-");if(36!==e.length)throw new Error("Invalid UUIDv7 was generated");return e}clone(){return new bi(this.bytes.slice(0))}equals(e){return 0===this.compareTo(e)}compareTo(e){for(var t=0;t<16;t++){var i=this.bytes[t]-e.bytes[t];if(0!==i)return Math.sign(i)}return 0}}class wi{constructor(){this.N=0,this.U=0,this.q=new Si}generate(){var e=this.generateOrAbort();if(A(e)){this.N=0;var t=this.generateOrAbort();if(A(t))throw new Error("Could not generate UUID after timestamp reset");return t}return e}generateOrAbort(){var e=Date.now();if(e>this.N)this.N=e,this.B();else{if(!(e+1e4>this.N))return;this.U++,this.U>4398046511103&&(this.N++,this.B())}return bi.fromFieldsV7(this.N,Math.trunc(this.U/Math.pow(2,30)),this.U&Math.pow(2,30)-1,this.q.nextUint32())}B(){this.U=1024*this.q.nextUint32()+(1023&this.q.nextUint32())}}var Ei,ki=e=>{if("undefined"!=typeof UUIDV7_DENY_WEAK_RNG&&UUIDV7_DENY_WEAK_RNG)throw new Error("no cryptographically strong RNG available");for(var t=0;t<e.length;t++)e[t]=65536*Math.trunc(65536*Math.random())+Math.trunc(65536*Math.random());return e};s&&!A(s.crypto)&&crypto.getRandomValues&&(ki=e=>crypto.getRandomValues(e));class Si{constructor(){this.H=new Uint32Array(8),this.W=1/0}nextUint32(){return this.W>=this.H.length&&(ki(this.H),this.W=0),this.H[this.W++]}}var xi=()=>Ii().toString(),Ii=()=>(Ei||(Ei=new wi)).generate(),Pi="",Fi=/[a-z0-9][a-z0-9-]+\.[a-z]{2,}$/i,$i={G:()=>!!c,V:function(e){Se.error("cookieStore error: "+e)},J:function(e){if(c){try{for(var t=e+"=",i=c.cookie.split(";").filter(e=>e.length),s=0;s<i.length;s++){for(var r=i[s];" "==r.charAt(0);)r=r.substring(1,r.length);if(0===r.indexOf(t))return decodeURIComponent(r.substring(t.length,r.length))}}catch(e){}return null}},K:function(e){var t;try{t=JSON.parse($i.J(e))||{}}catch(e){}return t},Y:function(e,t,i,s,r){if(c)try{var n="",o="",a=function(e,t){if(t){var i=function(e,t){if(void 0===t&&(t=c),Pi)return Pi;if(!t)return"";if(["localhost","127.0.0.1"].includes(e))return"";for(var i=e.split("."),s=Math.min(i.length,8),r="dmn_chk_"+xi();!Pi&&s--;){var n=i.slice(s).join("."),o=r+"=1;domain=."+n+";path=/";t.cookie=o+";max-age=3",t.cookie.includes(r)&&(t.cookie=o+";max-age=0",Pi=n)}return Pi}(e);if(!i){var s=(e=>{var t=e.match(Fi);return t?t[0]:""})(e);s!==i&&Se.info("Warning: cookie subdomain discovery mismatch",s,i),i=s}return i?"; domain=."+i:""}return""}(c.location.hostname,s);if(i){var l=new Date;l.setTime(l.getTime()+24*i*60*60*1e3),n="; expires="+l.toUTCString()}r&&(o="; secure");var u=e+"="+encodeURIComponent(JSON.stringify(t))+n+"; SameSite=Lax; path=/"+a+o;return u.length>3686.4&&Se.warn("cookieStore warning: large cookie, len="+u.length),c.cookie=u,u}catch(e){return}},X:function(e,t){if(null!=c&&c.cookie)try{$i.Y(e,"",-1,t)}catch(e){return}}},Ri=null,Ci={G:function(){if(!L(Ri))return Ri;var e=!0;if(A(s))e=!1;else try{var t="__mplssupport__";Ci.Y(t,"xyz"),'"xyz"'!==Ci.J(t)&&(e=!1),Ci.X(t)}catch(t){e=!1}return e||Se.error("localStorage unsupported; falling back to cookie store"),Ri=e,e},V:function(e){Se.error("localStorage error: "+e)},J:function(e){try{return null==s?void 0:s.localStorage.getItem(e)}catch(e){Ci.V(e)}return null},K:function(e){try{return JSON.parse(Ci.J(e))||{}}catch(e){}return null},Y:function(e,t){try{null==s||s.localStorage.setItem(e,JSON.stringify(t))}catch(e){Ci.V(e)}},X:function(e){try{null==s||s.localStorage.removeItem(e)}catch(e){Ci.V(e)}}},Ti=["distinct_id",at,lt,xt,St],Ai=y({},Ci,{K:function(e){try{var t={};try{t=$i.K(e)||{}}catch(e){}var i=Ce(t,JSON.parse(Ci.J(e)||"{}"));return Ci.Y(e,i),i}catch(e){}return null},Y:function(e,t,i,s,r,n){try{Ci.Y(e,t,void 0,void 0,n);var o={};Ti.forEach(e=>{t[e]&&(o[e]=t[e])}),Object.keys(o).length&&$i.Y(e,o,i,s,r,n)}catch(e){Ci.V(e)}},X:function(e,t){try{null==s||s.localStorage.removeItem(e),$i.X(e,t)}catch(e){Ci.V(e)}}}),Oi={},Mi={G:function(){return!0},V:function(e){Se.error("memoryStorage error: "+e)},J:function(e){return Oi[e]||null},K:function(e){return Oi[e]||null},Y:function(e,t){Oi[e]=t},X:function(e){delete Oi[e]}},Li=null,Di={G:function(){if(!L(Li))return Li;if(Li=!0,A(s))Li=!1;else try{var e="__support__";Di.Y(e,"xyz"),'"xyz"'!==Di.J(e)&&(Li=!1),Di.X(e)}catch(e){Li=!1}return Li},V:function(e){Se.error("sessionStorage error: ",e)},J:function(e){try{return null==s?void 0:s.sessionStorage.getItem(e)}catch(e){Di.V(e)}return null},K:function(e){try{return JSON.parse(Di.J(e))||null}catch(e){}return null},Y:function(e,t){try{null==s||s.sessionStorage.setItem(e,JSON.stringify(t))}catch(e){Di.V(e)}},X:function(e){try{null==s||s.sessionStorage.removeItem(e)}catch(e){Di.V(e)}}},Ni=function(e){return e[e.PENDING=-1]="PENDING",e[e.DENIED=0]="DENIED",e[e.GRANTED=1]="GRANTED",e}({});class Hi{constructor(e){this._instance=e}get A(){return this._instance.config}get consent(){return this.Z()?Ni.DENIED:this.tt}isOptedOut(){return"always"===this.A.cookieless_mode||this.consent===Ni.DENIED||this.consent===Ni.PENDING&&(this.A.opt_out_capturing_by_default||"on_reject"===this.A.cookieless_mode)}isOptedIn(){return!this.isOptedOut()}isExplicitlyOptedOut(){return this.consent===Ni.DENIED}optInOut(e){this.it.Y(this.et,e?1:0,this.A.cookie_expiration,this.A.cross_subdomain_cookie,this.A.secure_cookie)}reset(){this.it.X(this.et,this.A.cross_subdomain_cookie)}get et(){var{token:e,opt_out_capturing_cookie_prefix:t,consent_persistence_name:i}=this._instance.config;return i||(t?t+e:"__ph_opt_in_out_"+e)}get tt(){var e=this.it.J(this.et);return G(e)?Ni.GRANTED:E(W,e)?Ni.DENIED:Ni.PENDING}get it(){if(!this.rt){var e=this.A.opt_out_capturing_persistence_type;this.rt="localStorage"===e?Ci:$i;var t="localStorage"===e?$i:Ci;t.J(this.et)&&(this.rt.J(this.et)||this.optInOut(G(t.J(this.et))),t.X(this.et,this.A.cross_subdomain_cookie))}return this.rt}Z(){return!!this.A.respect_dnt&&!!He([null==l?void 0:l.doNotTrack,null==l?void 0:l.msDoNotTrack,v.doNotTrack],e=>G(e))}}var ji=xe("[Dead Clicks]"),qi=()=>!0,Bi=e=>{var t,i=!(null==(t=e.instance.persistence)||!t.get_property(Je)),s=e.instance.config.capture_dead_clicks;return H(s)?s:i};class Ui{get lazyLoadedDeadClicksAutocapture(){return this.st}constructor(e,t,i){this.instance=e,this.isEnabled=t,this.onCapture=i,this.startIfEnabled()}onRemoteConfig(e){this.instance.persistence&&this.instance.persistence.register({[Je]:null==e?void 0:e.captureDeadClicks}),this.startIfEnabled()}startIfEnabled(){this.isEnabled(this)&&this.nt(()=>{this.ot()})}nt(e){var t,i;null!=(t=v.__PosthogExtensions__)&&t.initDeadClicksAutocapture&&e(),null==(i=v.__PosthogExtensions__)||null==i.loadExternalDependency||i.loadExternalDependency(this.instance,"dead-clicks-autocapture",t=>{t?ji.error("failed to load script",t):e()})}ot(){var e;if(c){if(!this.st&&null!=(e=v.__PosthogExtensions__)&&e.initDeadClicksAutocapture){var t=C(this.instance.config.capture_dead_clicks)?this.instance.config.capture_dead_clicks:{};t.__onCapture=this.onCapture,this.st=v.__PosthogExtensions__.initDeadClicksAutocapture(this.instance,t),this.st.start(c),ji.info("starting...")}}else ji.error("`document` not found. Cannot start.")}stop(){this.st&&(this.st.stop(),this.st=void 0,ji.info("stopping..."))}}var zi=xe("[ExceptionAutocapture]");class Gi{constructor(e){var t,i,r;this.lt=()=>{var e;if(s&&this.isEnabled&&null!=(e=v.__PosthogExtensions__)&&e.errorWrappingFunctions){var t=v.__PosthogExtensions__.errorWrappingFunctions.wrapOnError,i=v.__PosthogExtensions__.errorWrappingFunctions.wrapUnhandledRejection,r=v.__PosthogExtensions__.errorWrappingFunctions.wrapConsoleError;try{!this.ut&&this.A.capture_unhandled_errors&&(this.ut=t(this.captureException.bind(this))),!this.ht&&this.A.capture_unhandled_rejections&&(this.ht=i(this.captureException.bind(this))),!this.dt&&this.A.capture_console_errors&&(this.dt=r(this.captureException.bind(this)))}catch(e){zi.error("failed to start",e),this.vt()}}},this._instance=e,this.ct=!(null==(t=this._instance.persistence)||!t.props[We]),this.A=this.ft(),this.gt=new Y({refillRate:null!==(i=this._instance.config.error_tracking.__exceptionRateLimiterRefillRate)&&void 0!==i?i:1,bucketSize:null!==(r=this._instance.config.error_tracking.__exceptionRateLimiterBucketSize)&&void 0!==r?r:10,refillInterval:1e4,P:zi}),this.startIfEnabled()}ft(){var e=this._instance.config.capture_exceptions,t={capture_unhandled_errors:!1,capture_unhandled_rejections:!1,capture_console_errors:!1};return C(e)?t=y({},t,e):(A(e)?this.ct:e)&&(t=y({},t,{capture_unhandled_errors:!0,capture_unhandled_rejections:!0})),t}get isEnabled(){return this.A.capture_console_errors||this.A.capture_unhandled_errors||this.A.capture_unhandled_rejections}startIfEnabled(){this.isEnabled&&(zi.info("enabled"),this.nt(this.lt))}nt(e){var t,i;null!=(t=v.__PosthogExtensions__)&&t.errorWrappingFunctions&&e(),null==(i=v.__PosthogExtensions__)||null==i.loadExternalDependency||i.loadExternalDependency(this._instance,"exception-autocapture",t=>{if(t)return zi.error("failed to load script",t);e()})}vt(){var e,t,i;null==(e=this.ut)||e.call(this),this.ut=void 0,null==(t=this.ht)||t.call(this),this.ht=void 0,null==(i=this.dt)||i.call(this),this.dt=void 0}onRemoteConfig(e){var t=e.autocaptureExceptions;this.ct=!!t||!1,this.A=this.ft(),this._instance.persistence&&this._instance.persistence.register({[We]:this.ct}),this.startIfEnabled()}captureException(e){var t,i,s=null!==(t=null==e||null==(i=e.$exception_list)||null==(i=i[0])?void 0:i.type)&&void 0!==t?t:"Exception";this.gt.consumeRateLimit(s)?zi.info("Skipping exception capture because of client rate limiting.",{exception:s}):this._instance.exceptions.sendExceptionEvent(e)}}function Wi(e,t,i){try{if(!(t in e))return()=>{};var s=e[t],r=i(s);return R(r)&&(r.prototype=r.prototype||{},Object.defineProperties(r,{__posthog_wrapped__:{enumerable:!1,value:!0}})),e[t]=r,()=>{e[t]=s}}catch(e){return()=>{}}}class Vi{constructor(e){var t;this._instance=e,this._t=(null==s||null==(t=s.location)?void 0:t.pathname)||""}get isEnabled(){return"history_change"===this._instance.config.capture_pageview}startIfEnabled(){this.isEnabled&&(Se.info("History API monitoring enabled, starting..."),this.monitorHistoryChanges())}stop(){this.yt&&this.yt(),this.yt=void 0,Se.info("History API monitoring stopped")}monitorHistoryChanges(){var e,t;if(s&&s.history){var i=this;null!=(e=s.history.pushState)&&e.__posthog_wrapped__||Wi(s.history,"pushState",e=>function(t,s,r){e.call(this,t,s,r),i.bt("pushState")}),null!=(t=s.history.replaceState)&&t.__posthog_wrapped__||Wi(s.history,"replaceState",e=>function(t,s,r){e.call(this,t,s,r),i.bt("replaceState")}),this.wt()}}bt(e){try{var t,i=null==s||null==(t=s.location)?void 0:t.pathname;if(!i)return;i!==this._t&&this.isEnabled&&this._instance.capture("$pageview",{navigation_type:e}),this._t=i}catch(t){Se.error("Error capturing "+e+" pageview",t)}}wt(){if(!this.yt){var e=()=>{this.bt("popstate")};je(s,"popstate",e),this.yt=()=>{s&&s.removeEventListener("popstate",e)}}}}function Yi(e){var t,i;return(null==(t=JSON.stringify(e,(i=[],function(e,t){if(C(t)){for(;i.length>0&&i[i.length-1]!==this;)i.pop();return i.includes(t)?"[Circular]":(i.push(t),t)}return t})))?void 0:t.length)||0}function Xi(e,t){if(void 0===t&&(t=6606028.8),e.size>=t&&e.data.length>1){var i=Math.floor(e.data.length/2),s=e.data.slice(0,i),r=e.data.slice(i);return[Xi({size:Yi(s),data:s,sessionId:e.sessionId,windowId:e.windowId}),Xi({size:Yi(r),data:r,sessionId:e.sessionId,windowId:e.windowId})].flatMap(e=>e)}return[e]}var Ji=(e=>(e[e.DomContentLoaded=0]="DomContentLoaded",e[e.Load=1]="Load",e[e.FullSnapshot=2]="FullSnapshot",e[e.IncrementalSnapshot=3]="IncrementalSnapshot",e[e.Meta=4]="Meta",e[e.Custom=5]="Custom",e[e.Plugin=6]="Plugin",e))(Ji||{}),Ki=(e=>(e[e.Mutation=0]="Mutation",e[e.MouseMove=1]="MouseMove",e[e.MouseInteraction=2]="MouseInteraction",e[e.Scroll=3]="Scroll",e[e.ViewportResize=4]="ViewportResize",e[e.Input=5]="Input",e[e.TouchMove=6]="TouchMove",e[e.MediaInteraction=7]="MediaInteraction",e[e.StyleSheetRule=8]="StyleSheetRule",e[e.CanvasMutation=9]="CanvasMutation",e[e.Font=10]="Font",e[e.Log=11]="Log",e[e.Drag=12]="Drag",e[e.StyleDeclaration=13]="StyleDeclaration",e[e.Selection=14]="Selection",e[e.AdoptedStyleSheet=15]="AdoptedStyleSheet",e[e.CustomElement=16]="CustomElement",e))(Ki||{}),Zi="[SessionRecording]",Qi="redacted",es={initiatorTypes:["audio","beacon","body","css","early-hint","embed","fetch","frame","iframe","icon","image","img","input","link","navigation","object","ping","script","track","video","xmlhttprequest"],maskRequestFn:e=>e,recordHeaders:!1,recordBody:!1,recordInitialRequests:!1,recordPerformance:!1,performanceEntryTypeToObserve:["first-input","navigation","paint","resource"],payloadSizeLimitBytes:1e6,payloadHostDenyList:[".lr-ingest.io",".ingest.sentry.io",".clarity.ms","analytics.google.com","bam.nr-data.net"]},ts=["authorization","x-forwarded-for","authorization","cookie","set-cookie","x-api-key","x-real-ip","remote-addr","forwarded","proxy-authorization","x-csrf-token","x-csrftoken","x-xsrf-token"],is=["password","secret","passwd","api_key","apikey","auth","credentials","mysql_pwd","privatekey","private_key","token"],ss=["/s/","/e/","/i/"];function rs(e,t,i,s){if(D(e))return e;var r=(null==t?void 0:t["content-length"])||function(e){return new Blob([e]).size}(e);return O(r)&&(r=parseInt(r)),r>i?Zi+" "+s+" body too large to record ("+r+" bytes)":e}function ns(e,t){if(D(e))return e;var i=e;return ei(i,!1)||(i=Zi+" "+t+" body "+Qi),Re(is,e=>{var s,r;null!=(s=i)&&s.length&&-1!==(null==(r=i)?void 0:r.indexOf(e))&&(i=Zi+" "+t+" body "+Qi+" as might contain: "+e)}),i}class os{constructor(e,t){var i,s;void 0===t&&(t={}),this.St={},this.kt=e=>{if(!this.St[e]){var t,i;this.St[e]=!0;var s=this.$t(e);null==(t=(i=this.t).onBlockedNode)||t.call(i,e,s)}},this.xt=e=>{var t=this.$t(e);if("svg"!==(null==t?void 0:t.nodeName)&&t instanceof Element){var i=t.closest("svg");if(i)return[this._rrweb.mirror.getId(i),i]}return[e,t]},this.$t=e=>this._rrweb.mirror.getNode(e),this.Et=e=>{var t,i,s,r,n,o,a,l;return(null!==(t=null==(i=e.removes)?void 0:i.length)&&void 0!==t?t:0)+(null!==(s=null==(r=e.attributes)?void 0:r.length)&&void 0!==s?s:0)+(null!==(n=null==(o=e.texts)?void 0:o.length)&&void 0!==n?n:0)+(null!==(a=null==(l=e.adds)?void 0:l.length)&&void 0!==a?a:0)},this.throttleMutations=e=>{if(3!==e.type||0!==e.data.source)return e;var t=e.data,i=this.Et(t);t.attributes&&(t.attributes=t.attributes.filter(e=>{var[t]=this.xt(e.id);return!this.gt.consumeRateLimit(t)&&e}));var s=this.Et(t);return 0!==s||i===s?e:void 0},this._rrweb=e,this.t=t,this.gt=new Y({bucketSize:null!==(i=this.t.bucketSize)&&void 0!==i?i:100,refillRate:null!==(s=this.t.refillRate)&&void 0!==s?s:10,refillInterval:1e3,$:this.kt,P:Se})}}var as=Uint8Array,ls=Uint16Array,cs=Uint32Array,us=new as([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]),hs=new as([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]),ds=new as([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),ps=function(e,t){for(var i=new ls(31),s=0;s<31;++s)i[s]=t+=1<<e[s-1];var r=new cs(i[30]);for(s=1;s<30;++s)for(var n=i[s];n<i[s+1];++n)r[n]=n-i[s]<<5|s;return[i,r]},gs=ps(us,2),vs=gs[0],_s=gs[1];vs[28]=258,_s[258]=28;for(var fs=ps(hs,0)[1],ms=new ls(32768),ys=0;ys<32768;++ys){var bs=(43690&ys)>>>1|(21845&ys)<<1;bs=(61680&(bs=(52428&bs)>>>2|(13107&bs)<<2))>>>4|(3855&bs)<<4,ms[ys]=((65280&bs)>>>8|(255&bs)<<8)>>>1}var ws=function(e,t,i){for(var s=e.length,r=0,n=new ls(t);r<s;++r)++n[e[r]-1];var o,a=new ls(t);for(r=0;r<t;++r)a[r]=a[r-1]+n[r-1]<<1;if(i){o=new ls(1<<t);var l=15-t;for(r=0;r<s;++r)if(e[r])for(var c=r<<4|e[r],u=t-e[r],h=a[e[r]-1]++<<u,d=h|(1<<u)-1;h<=d;++h)o[ms[h]>>>l]=c}else for(o=new ls(s),r=0;r<s;++r)o[r]=ms[a[e[r]-1]++]>>>15-e[r];return o},Es=new as(288);for(ys=0;ys<144;++ys)Es[ys]=8;for(ys=144;ys<256;++ys)Es[ys]=9;for(ys=256;ys<280;++ys)Es[ys]=7;for(ys=280;ys<288;++ys)Es[ys]=8;var ks=new as(32);for(ys=0;ys<32;++ys)ks[ys]=5;var Ss=ws(Es,9,0),xs=ws(ks,5,0),Is=function(e){return(e/8|0)+(7&e&&1)},Ps=function(e,t,i){(null==i||i>e.length)&&(i=e.length);var s=new(e instanceof ls?ls:e instanceof cs?cs:as)(i-t);return s.set(e.subarray(t,i)),s},Fs=function(e,t,i){i<<=7&t;var s=t/8|0;e[s]|=i,e[s+1]|=i>>>8},$s=function(e,t,i){i<<=7&t;var s=t/8|0;e[s]|=i,e[s+1]|=i>>>8,e[s+2]|=i>>>16},Rs=function(e,t){for(var i=[],s=0;s<e.length;++s)e[s]&&i.push({s,f:e[s]});var r=i.length,n=i.slice();if(!r)return[new as(0),0];if(1==r){var o=new as(i[0].s+1);return o[i[0].s]=1,[o,1]}i.sort(function(e,t){return e.f-t.f}),i.push({s:-1,f:25001});var a=i[0],l=i[1],c=0,u=1,h=2;for(i[0]={s:-1,f:a.f+l.f,l:a,r:l};u!=r-1;)a=i[i[c].f<i[h].f?c++:h++],l=i[c!=u&&i[c].f<i[h].f?c++:h++],i[u++]={s:-1,f:a.f+l.f,l:a,r:l};var d=n[0].s;for(s=1;s<r;++s)n[s].s>d&&(d=n[s].s);var p=new ls(d+1),g=Cs(i[u-1],p,0);if(g>t){s=0;var v=0,_=g-t,f=1<<_;for(n.sort(function(e,t){return p[t.s]-p[e.s]||e.f-t.f});s<r;++s){var m=n[s].s;if(!(p[m]>t))break;v+=f-(1<<g-p[m]),p[m]=t}for(v>>>=_;v>0;){var y=n[s].s;p[y]<t?v-=1<<t-p[y]++-1:++s}for(;s>=0&&v;--s){var b=n[s].s;p[b]==t&&(--p[b],++v)}g=t}return[new as(p),g]},Cs=function(e,t,i){return-1==e.s?Math.max(Cs(e.l,t,i+1),Cs(e.r,t,i+1)):t[e.s]=i},Ts=function(e){for(var t=e.length;t&&!e[--t];);for(var i=new ls(++t),s=0,r=e[0],n=1,o=function(e){i[s++]=e},a=1;a<=t;++a)if(e[a]==r&&a!=t)++n;else{if(!r&&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(r),--n;n>6;n-=6)o(8304);n>2&&(o(n-3<<5|8208),n=0)}for(;n--;)o(r);n=1,r=e[a]}return[i.subarray(0,s),t]},As=function(e,t){for(var i=0,s=0;s<t.length;++s)i+=e[s]*t[s];return i},Os=function(e,t,i){var s=i.length,r=Is(t+2);e[r]=255&s,e[r+1]=s>>>8,e[r+2]=255^e[r],e[r+3]=255^e[r+1];for(var n=0;n<s;++n)e[r+n+4]=i[n];return 8*(r+4+s)},Ms=function(e,t,i,s,r,n,o,a,l,c,u){Fs(t,u++,i),++r[256];for(var h=Rs(r,15),d=h[0],p=h[1],g=Rs(n,15),v=g[0],_=g[1],f=Ts(d),m=f[0],y=f[1],b=Ts(v),w=b[0],E=b[1],k=new ls(19),S=0;S<m.length;++S)k[31&m[S]]++;for(S=0;S<w.length;++S)k[31&w[S]]++;for(var x=Rs(k,7),I=x[0],P=x[1],F=19;F>4&&!I[ds[F-1]];--F);var $,R,C,T,A=c+5<<3,O=As(r,Es)+As(n,ks)+o,M=As(r,d)+As(n,v)+o+14+3*F+As(k,I)+(2*k[16]+3*k[17]+7*k[18]);if(A<=O&&A<=M)return Os(t,u,e.subarray(l,l+c));if(Fs(t,u,1+(M<O)),u+=2,M<O){$=ws(d,p,0),R=d,C=ws(v,_,0),T=v;var L=ws(I,P,0);for(Fs(t,u,y-257),Fs(t,u+5,E-1),Fs(t,u+10,F-4),u+=14,S=0;S<F;++S)Fs(t,u+3*S,I[ds[S]]);u+=3*F;for(var D=[m,w],N=0;N<2;++N){var H=D[N];for(S=0;S<H.length;++S){var j=31&H[S];Fs(t,u,L[j]),u+=I[j],j>15&&(Fs(t,u,H[S]>>>5&127),u+=H[S]>>>12)}}}else $=Ss,R=Es,C=xs,T=ks;for(S=0;S<a;++S)if(s[S]>255){j=s[S]>>>18&31,$s(t,u,$[j+257]),u+=R[j+257],j>7&&(Fs(t,u,s[S]>>>23&31),u+=us[j]);var q=31&s[S];$s(t,u,C[q]),u+=T[q],q>3&&($s(t,u,s[S]>>>5&8191),u+=hs[q])}else $s(t,u,$[s[S]]),u+=R[s[S]];return $s(t,u,$[256]),u+R[256]},Ls=new cs([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),Ds=function(){for(var e=new cs(256),t=0;t<256;++t){for(var i=t,s=9;--s;)i=(1&i&&3988292384)^i>>>1;e[t]=i}return e}(),Ns=function(e,t,i){for(;i;++t)e[t]=i,i>>>=8};function Hs(e,t){void 0===t&&(t={});var i=function(){var e=4294967295;return{p:function(t){for(var i=e,s=0;s<t.length;++s)i=Ds[255&i^t[s]]^i>>>8;e=i},d:function(){return 4294967295^e}}}(),s=e.length;i.p(e);var r=function(e,t,i){return function(e,t,i,s,r,n){var o=e.length,a=new as(s+o+5*(1+Math.floor(o/7e3))+8),l=a.subarray(s,a.length-8),c=0;if(!t||o<8)for(var u=0;u<=o;u+=65535){var h=u+65535;h<o?c=Os(l,c,e.subarray(u,h)):(l[u]=n,c=Os(l,c,e.subarray(u,o)))}else{for(var d=Ls[t-1],p=d>>>13,g=8191&d,v=(1<<i)-1,_=new ls(32768),f=new ls(v+1),m=Math.ceil(i/3),y=2*m,b=function(t){return(e[t]^e[t+1]<<m^e[t+2]<<y)&v},w=new cs(25e3),E=new ls(288),k=new ls(32),S=0,x=0,I=(u=0,0),P=0,F=0;u<o;++u){var $=b(u),R=32767&u,C=f[$];if(_[R]=C,f[$]=R,P<=u){var T=o-u;if((S>7e3||I>24576)&&T>423){c=Ms(e,l,0,w,E,k,x,I,F,u-F,c),I=S=x=0,F=u;for(var A=0;A<286;++A)E[A]=0;for(A=0;A<30;++A)k[A]=0}var O=2,M=0,L=g,D=R-C&32767;if(T>2&&$==b(u-D))for(var N=Math.min(p,T)-1,H=Math.min(32767,u),j=Math.min(258,T);D<=H&&--L&&R!=C;){if(e[u+O]==e[u+O-D]){for(var q=0;q<j&&e[u+q]==e[u+q-D];++q);if(q>O){if(O=q,M=D,q>N)break;var B=Math.min(D,q-2),U=0;for(A=0;A<B;++A){var z=u-D+A+32768&32767,G=z-_[z]+32768&32767;G>U&&(U=G,C=z)}}}D+=(R=C)-(C=_[R])+32768&32767}if(M){w[I++]=268435456|_s[O]<<18|fs[M];var W=31&_s[O],V=31&fs[M];x+=us[W]+hs[V],++E[257+W],++k[V],P=u+O,++S}else w[I++]=e[u],++E[e[u]]}}c=Ms(e,l,n,w,E,k,x,I,F,u-F,c)}return Ps(a,0,s+Is(c)+8)}(e,null==t.level?6:t.level,null==t.mem?Math.ceil(1.5*Math.max(8,Math.min(13,Math.log(e.length)))):12+t.mem,i,0,!0)}(e,t,function(e){return 10+(e.filename&&e.filename.length+1||0)}(t)),n=r.length;return function(e,t){var i=t.filename;if(e[0]=31,e[1]=139,e[2]=8,e[8]=t.level<2?4:9==t.level?2:0,e[9]=3,0!=t.mtime&&Ns(e,4,Math.floor(new Date(t.mtime||Date.now())/1e3)),i){e[3]=8;for(var s=0;s<=i.length;++s)e[s+10]=i.charCodeAt(s)}}(r,t),Ns(r,n-8,i.d()),Ns(r,n-4,s),r}function js(e,t){var i=e.length;if("undefined"!=typeof TextEncoder)return(new TextEncoder).encode(e);for(var s=new as(e.length+(e.length>>>1)),r=0,n=function(e){s[r++]=e},o=0;o<i;++o){if(r+5>s.length){var a=new as(r+8+(i-o<<1));a.set(s),s=a}var l=e.charCodeAt(o);l<128||t?n(l):l<2048?(n(192|l>>>6),n(128|63&l)):l>55295&&l<57344?(n(240|(l=65536+(1047552&l)|1023&e.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 Ps(s,0,r)}var qs="disabled",Bs="sampled",Us="active",zs="buffering",Gs="paused",Ws="trigger",Vs=Ws+"_activated",Ys=Ws+"_pending",Xs=Ws+"_"+qs;function Js(e,t){return t.some(t=>"regex"===t.matching&&new RegExp(t.url).test(e))}class Ks{constructor(e){this.Pt=e}triggerStatus(e){var t=this.Pt.map(t=>t.triggerStatus(e));return t.includes(Vs)?Vs:t.includes(Ys)?Ys:Xs}stop(){this.Pt.forEach(e=>e.stop())}}class Zs{constructor(e){this.Pt=e}triggerStatus(e){var t=new Set;for(var i of this.Pt)t.add(i.triggerStatus(e));switch(t.delete(Xs),t.size){case 0:return Xs;case 1:return Array.from(t)[0];default:return Ys}}stop(){this.Pt.forEach(e=>e.stop())}}class Qs{triggerStatus(){return Ys}stop(){}}var er=e=>"sessionRecording"in e;class tr{constructor(e){this.Rt=[],this.It=[],this.urlBlocked=!1,this._instance=e}onConfig(e){var t,i;this.Rt=(er(e)?null==(t=e.sessionRecording)?void 0:t.urlTriggers:null==e?void 0:e.urlTriggers)||[],this.It=(er(e)?null==(i=e.sessionRecording)?void 0:i.urlBlocklist:null==e?void 0:e.urlBlocklist)||[]}onRemoteConfig(e){this.onConfig(e)}Tt(e){var t;return 0===this.Rt.length?Xs:(null==(t=this._instance)?void 0:t.get_property(ct))===e?Vs:Ys}triggerStatus(e){var t=this.Tt(e),i=t===Vs?Vs:t===Ys?Ys:Xs;return this._instance.register_for_session({$sdk_debug_replay_url_trigger_status:i}),i}checkUrlTriggerConditions(e,t,i){if(void 0!==s&&s.location.href){var r=s.location.href,n=this.urlBlocked,o=Js(r,this.It);n&&o||(o&&!n?e():!o&&n&&t(),Js(r,this.Rt)&&i("url"))}}stop(){}}class ir{constructor(e){this.linkedFlag=null,this.linkedFlagSeen=!1,this.Ct=()=>{},this._instance=e}triggerStatus(){var e=Ys;return D(this.linkedFlag)&&(e=Xs),this.linkedFlagSeen&&(e=Vs),this._instance.register_for_session({$sdk_debug_replay_linked_flag_trigger_status:e}),e}onConfig(e,t){var i;if(this.linkedFlag=(er(e)?null==(i=e.sessionRecording)?void 0:i.linkedFlag:null==e?void 0:e.linkedFlag)||null,!D(this.linkedFlag)&&!this.linkedFlagSeen){var s=O(this.linkedFlag)?this.linkedFlag:this.linkedFlag.flag,r=O(this.linkedFlag)?null:this.linkedFlag.variant;this.Ct=this._instance.onFeatureFlags((e,i)=>{var n=!1;if(C(i)&&s in i){var o=i[s];n=H(o)?!0===o:r?o===r:!!o}this.linkedFlagSeen=n,n&&t(s,r)})}}onRemoteConfig(e,t){this.onConfig(e,t)}stop(){this.Ct()}}class sr{constructor(e){this.Mt=[],this._instance=e}onConfig(e){var t;this.Mt=(er(e)?null==(t=e.sessionRecording)?void 0:t.eventTriggers:null==e?void 0:e.eventTriggers)||[]}onRemoteConfig(e){this.onConfig(e)}Ot(e){var t;return 0===this.Mt.length?Xs:(null==(t=this._instance)?void 0:t.get_property(ut))===e?Vs:Ys}triggerStatus(e){var t=this.Ot(e),i=t===Vs?Vs:t===Ys?Ys:Xs;return this._instance.register_for_session({$sdk_debug_replay_event_trigger_status:i}),i}stop(){}}function rr(e){return e.isRecordingEnabled?zs:qs}function nr(e){if(!e.receivedFlags)return zs;if(!e.isRecordingEnabled)return qs;if(e.urlTriggerMatching.urlBlocked)return Gs;var t=!0===e.isSampled,i=new Ks([e.eventTriggerMatching,e.urlTriggerMatching,e.linkedFlagMatching]).triggerStatus(e.sessionId);return t?Bs:i===Vs?Us:i===Ys?zs:!1===e.isSampled?qs:Us}function or(e){if(!e.receivedFlags)return zs;if(!e.isRecordingEnabled)return qs;if(e.urlTriggerMatching.urlBlocked)return Gs;var t=new Zs([e.eventTriggerMatching,e.urlTriggerMatching,e.linkedFlagMatching]).triggerStatus(e.sessionId),i=t!==Xs,s=H(e.isSampled);return i&&t===Ys?zs:i&&t===Xs||s&&!e.isSampled?qs:!0===e.isSampled?Bs:Us}var ar="[SessionRecording]",lr=xe(ar);function cr(){var e;return null==v||null==(e=v.__PosthogExtensions__)||null==(e=e.rrweb)?void 0:e.record}var ur=[Ki.MouseMove,Ki.MouseInteraction,Ki.Scroll,Ki.ViewportResize,Ki.Input,Ki.TouchMove,Ki.MediaInteraction,Ki.Drag],hr=e=>({rrwebMethod:e,enqueuedAt:Date.now(),attempt:1});function dr(e){return function(e){for(var t="",i=0;i<e.length;){var s=e[i++];t+=String.fromCharCode(s)}return t}(Hs(js(JSON.stringify(e))))}function pr(e){return e.type===Ji.Custom&&"sessionIdle"===e.data.tag}class gr{get sessionId(){return this.Ft}get At(){return this._instance.config.session_recording.session_idle_threshold_ms||3e5}get started(){return this.Dt}get jt(){if(!this._instance.sessionManager)throw new Error(ar+" must be started with a valid sessionManager.");return this._instance.sessionManager}get Lt(){var e,t;return this.Nt.triggerStatus(this.sessionId)===Ys?6e4:null!==(e=null==(t=this._instance.config.session_recording)?void 0:t.full_snapshot_interval_millis)&&void 0!==e?e:3e5}get Ut(){var e=this._instance.get_property(lt);return H(e)?e:null}get zt(){var e,t,i=null==(e=this.H)?void 0:e.data[(null==(t=this.H)?void 0:t.data.length)-1],{sessionStartTimestamp:s}=this.jt.checkAndGetSessionAndWindowId(!0);return i?i.timestamp-s:null}get qt(){var e=!!this._instance.get_property(Qe),t=!this._instance.config.disable_session_recording;return s&&e&&t}get Bt(){var e=!!this._instance.get_property(et),t=this._instance.config.enable_recording_console_log;return null!=t?t:e}get Ht(){var e,t,i,s,r,n,o=this._instance.config.session_recording.captureCanvas,a=this._instance.get_property(st),l=null!==(e=null!==(t=null==o?void 0:o.recordCanvas)&&void 0!==t?t:null==a?void 0:a.enabled)&&void 0!==e&&e,c=null!==(i=null!==(s=null==o?void 0:o.canvasFps)&&void 0!==s?s:null==a?void 0:a.fps)&&void 0!==i?i:4,u=null!==(r=null!==(n=null==o?void 0:o.canvasQuality)&&void 0!==n?n:null==a?void 0:a.quality)&&void 0!==r?r:.4;if("string"==typeof u){var h=parseFloat(u);u=isNaN(h)?.4:h}return{enabled:l,fps:V(c,0,12,lr.createLogger("canvas recording fps"),4),quality:V(u,0,1,lr.createLogger("canvas recording quality"),.4)}}get Wt(){var e,t,i=this._instance.get_property(tt),s={recordHeaders:null==(e=this._instance.config.session_recording)?void 0:e.recordHeaders,recordBody:null==(t=this._instance.config.session_recording)?void 0:t.recordBody},r=(null==s?void 0:s.recordHeaders)||(null==i?void 0:i.recordHeaders),n=(null==s?void 0:s.recordBody)||(null==i?void 0:i.recordBody),o=C(this._instance.config.capture_performance)?this._instance.config.capture_performance.network_timing:this._instance.config.capture_performance,a=!!(H(o)?o:null==i?void 0:i.capturePerformance);return r||n||a?{recordHeaders:r,recordBody:n,recordPerformance:a}:void 0}get Gt(){var e,t,i,s,r,n,o=this._instance.get_property(it),a={maskAllInputs:null==(e=this._instance.config.session_recording)?void 0:e.maskAllInputs,maskTextSelector:null==(t=this._instance.config.session_recording)?void 0:t.maskTextSelector,blockSelector:null==(i=this._instance.config.session_recording)?void 0:i.blockSelector},l=null!==(s=null==a?void 0:a.maskAllInputs)&&void 0!==s?s:null==o?void 0:o.maskAllInputs,c=null!==(r=null==a?void 0:a.maskTextSelector)&&void 0!==r?r:null==o?void 0:o.maskTextSelector,u=null!==(n=null==a?void 0:a.blockSelector)&&void 0!==n?n:null==o?void 0:o.blockSelector;return A(l)&&A(c)&&A(u)?void 0:{maskAllInputs:null==l||l,maskTextSelector:c,blockSelector:u}}get Vt(){var e=this._instance.get_property(rt);return N(e)?e:null}get Jt(){var e=this._instance.get_property(nt);return N(e)?e:null}get status(){return this.Kt?this.Yt({receivedFlags:this.Kt,isRecordingEnabled:this.qt,isSampled:this.Ut,urlTriggerMatching:this.Xt,eventTriggerMatching:this.Qt,linkedFlagMatching:this.Zt,sessionId:this.sessionId}):zs}constructor(e){if(this.Yt=rr,this.Kt=!1,this.ti=[],this.ii="unknown",this.ei=Date.now(),this.Nt=new Qs,this.ri=void 0,this.si=void 0,this.ni=void 0,this.oi=void 0,this.ai=void 0,this._forceAllowLocalhostNetworkCapture=!1,this.li=()=>{this.ui()},this.hi=()=>{this.tryAddCustomEvent("browser offline",{})},this.di=()=>{this.tryAddCustomEvent("browser online",{})},this.vi=()=>{if(null!=c&&c.visibilityState){var e="window "+c.visibilityState;this.tryAddCustomEvent(e,{})}},this._instance=e,this.Dt=!1,this.ci="/s/",this.fi=void 0,this.Kt=!1,!this._instance.sessionManager)throw lr.error("started without valid sessionManager"),new Error(ar+" started without valid sessionManager. This is a bug.");if("always"===this._instance.config.cookieless_mode)throw new Error(ar+' cannot be used with cookieless_mode="always"');this.Zt=new ir(this._instance),this.Xt=new tr(this._instance),this.Qt=new sr(this._instance);var{sessionId:t,windowId:i}=this.jt.checkAndGetSessionAndWindowId();this.Ft=t,this.pi=i,this.H=this.gi(),this.At>=this.jt.sessionTimeoutMs&&lr.warn("session_idle_threshold_ms ("+this.At+") is greater than the session timeout ("+this.jt.sessionTimeoutMs+"). Session will never be detected as idle")}startIfEnabledOrStop(e){this.qt?(this.mi(e),je(s,"beforeunload",this.li),je(s,"offline",this.hi),je(s,"online",this.di),je(s,"visibilitychange",this.vi),this.yi(),this.bi(),D(this.ri)&&(this.ri=this._instance.on("eventCaptured",e=>{try{if("$pageview"===e.event){var t=null!=e&&e.properties.$current_url?this.wi(null==e?void 0:e.properties.$current_url):"";if(!t)return;this.tryAddCustomEvent("$pageview",{href:t})}}catch(e){lr.error("Could not add $pageview to rrweb session",e)}})),this.si||(this.si=this.jt.onSessionId((e,t,i)=>{var s,r;i&&(this.tryAddCustomEvent("$session_id_change",{sessionId:e,windowId:t,changeReason:i}),null==(s=this._instance)||null==(s=s.persistence)||s.unregister(ut),null==(r=this._instance)||null==(r=r.persistence)||r.unregister(ct))}))):this.stopRecording()}stopRecording(){var e,t,i,r;this.Dt&&this.fi&&(this.fi(),this.fi=void 0,this.Dt=!1,null==s||s.removeEventListener("beforeunload",this.li),null==s||s.removeEventListener("offline",this.hi),null==s||s.removeEventListener("online",this.di),null==s||s.removeEventListener("visibilitychange",this.vi),this.gi(),clearInterval(this.Si),null==(e=this.ri)||e.call(this),this.ri=void 0,null==(t=this.ai)||t.call(this),this.ai=void 0,null==(i=this.si)||i.call(this),this.si=void 0,null==(r=this.oi)||r.call(this),this.oi=void 0,this.Qt.stop(),this.Xt.stop(),this.Zt.stop(),lr.info("stopped"))}ki(){var e;null==(e=this._instance.persistence)||e.unregister(lt)}$i(e){var t,i=this.Ft!==e,s=this.Vt;if(N(s)){var r=this.Ut,n=i||!H(r),o=n?function(e,t){return function(e){for(var t=0,i=0;i<e.length;i++)t=(t<<5)-t+e.charCodeAt(i),t|=0;return Math.abs(t)}(e)%100<V(100*t,0,100,Se)}(e,s):r;n&&(o?this.xi(Bs):lr.warn("Sample rate ("+s+") has determined that this sessionId ("+e+") will not be sent to the server."),this.tryAddCustomEvent("samplingDecisionMade",{sampleRate:s,isSampled:o})),null==(t=this._instance.persistence)||t.register({[lt]:o})}else this.ki()}onRemoteConfig(e){var t,i,s,r;this.tryAddCustomEvent("$remote_config_received",e),this.Ei(e),null!=(t=e.sessionRecording)&&t.endpoint&&(this.ci=null==(r=e.sessionRecording)?void 0:r.endpoint),this.yi(),"any"===(null==(i=e.sessionRecording)?void 0:i.triggerMatchType)?(this.Yt=nr,this.Nt=new Ks([this.Qt,this.Xt])):(this.Yt=or,this.Nt=new Zs([this.Qt,this.Xt])),this._instance.register_for_session({$sdk_debug_replay_remote_trigger_matching_config:null==(s=e.sessionRecording)?void 0:s.triggerMatchType}),this.Xt.onConfig(e),this.Qt.onConfig(e),this.Zt.onConfig(e,(e,t)=>{this.xi("linked_flag_matched",{flag:e,variant:t})}),this.Kt=!0,this.startIfEnabledOrStop()}yi(){N(this.Vt)&&D(this.oi)&&(this.oi=this.jt.onSessionId(e=>{this.$i(e)}))}Ei(e){if(this._instance.persistence){var t,i=this._instance.persistence,s=()=>{var t,s,r,n,o,a,l,c,u,h=null==(t=e.sessionRecording)?void 0:t.sampleRate,d=D(h)?null:parseFloat(h);D(d)&&this.ki();var p=null==(s=e.sessionRecording)?void 0:s.minimumDurationMilliseconds;i.register({[Qe]:!!e.sessionRecording,[et]:null==(r=e.sessionRecording)?void 0:r.consoleLogRecordingEnabled,[tt]:y({capturePerformance:e.capturePerformance},null==(n=e.sessionRecording)?void 0:n.networkPayloadCapture),[it]:null==(o=e.sessionRecording)?void 0:o.masking,[st]:{enabled:null==(a=e.sessionRecording)?void 0:a.recordCanvas,fps:null==(l=e.sessionRecording)?void 0:l.canvasFps,quality:null==(c=e.sessionRecording)?void 0:c.canvasQuality},[rt]:d,[nt]:A(p)?null:p,[ot]:null==(u=e.sessionRecording)?void 0:u.scriptConfig})};s(),null==(t=this.ni)||t.call(this),this.ni=this.jt.onSessionId(s)}}log(e,t){var i;void 0===t&&(t="log"),null==(i=this._instance.sessionRecording)||i.onRRwebEmit({type:6,data:{plugin:"rrweb/console@1",payload:{level:t,trace:[],payload:[JSON.stringify(e)]}},timestamp:Date.now()})}mi(e){var t;A(Object.assign)||A(Array.from)||this.Dt||this._instance.config.disable_session_recording||this._instance.consent.isOptedOut()||(this.Dt=!0,this.jt.checkAndGetSessionAndWindowId(),cr()?this.Pi():null==(t=v.__PosthogExtensions__)||null==t.loadExternalDependency||t.loadExternalDependency(this._instance,this.Ri,e=>{if(e)return lr.error("could not load recorder",e);this.Pi()}),lr.info("starting"),this.status===Us&&this.xi(e||"recording_initialized"))}get Ri(){var e;return(null==(e=this._instance)||null==(e=e.persistence)||null==(e=e.get_property(ot))?void 0:e.script)||"recorder"}Ii(e){var t;return 3===e.type&&-1!==ur.indexOf(null==(t=e.data)?void 0:t.source)}Ti(e){var t=this.Ii(e);t||this.ii||e.timestamp-this.ei>this.At&&(this.ii=!0,clearInterval(this.Si),this.tryAddCustomEvent("sessionIdle",{eventTimestamp:e.timestamp,lastActivityTimestamp:this.ei,threshold:this.At,bufferLength:this.H.data.length,bufferSize:this.H.size}),this.ui());var i=!1;if(t&&(this.ei=e.timestamp,this.ii)){var s="unknown"===this.ii;this.ii=!1,s||(this.tryAddCustomEvent("sessionNoLongerIdle",{reason:"user activity",type:e.type}),i=!0)}if(!this.ii){var{windowId:r,sessionId:n}=this.jt.checkAndGetSessionAndWindowId(!t,e.timestamp),o=this.Ft!==n,a=this.pi!==r;this.pi=r,this.Ft=n,o||a?(this.stopRecording(),this.startIfEnabledOrStop("session_id_changed")):i&&this.Ci()}}Mi(e){try{return e.rrwebMethod(),!0}catch(t){return this.ti.length<10?this.ti.push({enqueuedAt:e.enqueuedAt||Date.now(),attempt:e.attempt++,rrwebMethod:e.rrwebMethod}):lr.warn("could not emit queued rrweb event.",t,e),!1}}tryAddCustomEvent(e,t){return this.Mi(hr(()=>cr().addCustomEvent(e,t)))}Oi(){return this.Mi(hr(()=>cr().takeFullSnapshot()))}Pi(){var e,t,i,s,r={blockClass:"ph-no-capture",blockSelector:void 0,ignoreClass:"ph-ignore-input",maskTextClass:"ph-mask",maskTextSelector:void 0,maskTextFn:void 0,maskAllInputs:!0,maskInputOptions:{password:!0},maskInputFn:void 0,slimDOMOptions:{},collectFonts:!1,inlineStylesheet:!0,recordCrossOriginIframes:!1},n=this._instance.config.session_recording;for(var[o,a]of Object.entries(n||{}))o in r&&("maskInputOptions"===o?r.maskInputOptions=y({password:!0},a):r[o]=a);this.Ht&&this.Ht.enabled&&(r.recordCanvas=!0,r.sampling={canvas:this.Ht.fps},r.dataURLOptions={type:"image/webp",quality:this.Ht.quality}),this.Gt&&(r.maskAllInputs=null===(t=this.Gt.maskAllInputs)||void 0===t||t,r.maskTextSelector=null!==(i=this.Gt.maskTextSelector)&&void 0!==i?i:void 0,r.blockSelector=null!==(s=this.Gt.blockSelector)&&void 0!==s?s:void 0);var l=cr();if(l){this.Fi=null!==(e=this.Fi)&&void 0!==e?e:new os(l,{refillRate:this._instance.config.session_recording.__mutationThrottlerRefillRate,bucketSize:this._instance.config.session_recording.__mutationThrottlerBucketSize,onBlockedNode:(e,t)=>{var i="Too many mutations on node '"+e+"'. Rate limiting. This could be due to SVG animations or something similar";lr.info(i,{node:t}),this.log(ar+" "+i,"warn")}});var c=this.Ai();this.fi=l(y({emit:e=>{this.onRRwebEmit(e)},plugins:c},r)),this.ei=Date.now(),this.ii=H(this.ii)?this.ii:"unknown",this.tryAddCustomEvent("$session_options",{sessionRecordingOptions:r,activePlugins:c.map(e=>null==e?void 0:e.name)}),this.tryAddCustomEvent("$posthog_config",{config:this._instance.config})}else lr.error("onScriptLoaded was called but rrwebRecord is not available. This indicates something has gone wrong.")}Ci(){if(this.Si&&clearInterval(this.Si),!0!==this.ii){var e=this.Lt;e&&(this.Si=setInterval(()=>{this.Oi()},e))}}Ai(){var e,t,i=[],s=null==(e=v.__PosthogExtensions__)||null==(e=e.rrwebPlugins)?void 0:e.getRecordConsolePlugin;s&&this.Bt&&i.push(s());var r=null==(t=v.__PosthogExtensions__)||null==(t=t.rrwebPlugins)?void 0:t.getRecordNetworkPlugin;return this.Wt&&R(r)&&(!ui.includes(location.hostname)||this._forceAllowLocalhostNetworkCapture?i.push(r(((e,t)=>{var i,s,r,n={payloadSizeLimitBytes:es.payloadSizeLimitBytes,performanceEntryTypeToObserve:[...es.performanceEntryTypeToObserve],payloadHostDenyList:[...t.payloadHostDenyList||[],...es.payloadHostDenyList]},o=!1!==e.session_recording.recordHeaders&&t.recordHeaders,a=!1!==e.session_recording.recordBody&&t.recordBody,l=!1!==e.capture_performance&&t.recordPerformance,c=(i=n,r=Math.min(1e6,null!==(s=i.payloadSizeLimitBytes)&&void 0!==s?s:1e6),e=>(null!=e&&e.requestBody&&(e.requestBody=rs(e.requestBody,e.requestHeaders,r,"Request")),null!=e&&e.responseBody&&(e.responseBody=rs(e.responseBody,e.responseHeaders,r,"Response")),e)),u=t=>{return c(((e,t)=>{var i,s=hi(e.name),r=0===t.indexOf("http")?null==(i=hi(t))?void 0:i.pathname:t;"/"===r&&(r="");var n=null==s?void 0:s.pathname.replace(r||"","");if(!(s&&n&&ss.some(e=>0===n.indexOf(e))))return e})((s=(i=t).requestHeaders,D(s)||Re(Object.keys(null!=s?s:{}),e=>{ts.includes(e.toLowerCase())&&(s[e]=Qi)}),i),e.api_host));var i,s},h=R(e.session_recording.maskNetworkRequestFn);return h&&R(e.session_recording.maskCapturedNetworkRequestFn)&&Se.warn("Both `maskNetworkRequestFn` and `maskCapturedNetworkRequestFn` are defined. `maskNetworkRequestFn` will be ignored."),h&&(e.session_recording.maskCapturedNetworkRequestFn=t=>{var i=e.session_recording.maskNetworkRequestFn({url:t.name});return y({},t,{name:null==i?void 0:i.url})}),n.maskRequestFn=R(e.session_recording.maskCapturedNetworkRequestFn)?t=>{var i,s=u(t);return s&&null!==(i=null==e.session_recording.maskCapturedNetworkRequestFn?void 0:e.session_recording.maskCapturedNetworkRequestFn(s))&&void 0!==i?i:void 0}:e=>function(e){if(!A(e))return e.requestBody=ns(e.requestBody,"Request"),e.responseBody=ns(e.responseBody,"Response"),e}(u(e)),y({},es,n,{recordHeaders:o,recordBody:a,recordPerformance:l,recordInitialRequests:l})})(this._instance.config,this.Wt))):lr.info("NetworkCapture not started because we are on localhost.")),i}onRRwebEmit(e){var t;if(this.Di(),e&&C(e)){if(e.type===Ji.Meta){var i=this.wi(e.data.href);if(this.ji=i,!i)return;e.data.href=i}else this.Li();if(this.Xt.checkUrlTriggerConditions(()=>this.Ni(),()=>this.Ui(),e=>this.zi(e)),!this.Xt.urlBlocked||(s=e).type===Ji.Custom&&"recording paused"===s.data.tag){var s;e.type===Ji.FullSnapshot&&this.Ci(),e.type===Ji.FullSnapshot&&this.Kt&&this.Nt.triggerStatus(this.sessionId)===Ys&&this.gi();var r=this.Fi?this.Fi.throttleMutations(e):e;if(r){var n=function(e){var t=e;if(t&&C(t)&&6===t.type&&C(t.data)&&"rrweb/console@1"===t.data.plugin){t.data.payload.payload.length>10&&(t.data.payload.payload=t.data.payload.payload.slice(0,10),t.data.payload.payload.push("...[truncated]"));for(var i=[],s=0;s<t.data.payload.payload.length;s++)t.data.payload.payload[s]&&t.data.payload.payload[s].length>2e3?i.push(t.data.payload.payload[s].slice(0,2e3)+"...[truncated]"):i.push(t.data.payload.payload[s]);return t.data.payload.payload=i,e}return e}(r);if(this.Ti(n),!0!==this.ii||pr(n)){if(pr(n)){var o=n.data.payload;if(o){var a=o.lastActivityTimestamp,l=o.threshold;n.timestamp=a+l}}var c=null===(t=this._instance.config.session_recording.compress_events)||void 0===t||t?function(e){if(Yi(e)<1024)return e;try{if(e.type===Ji.FullSnapshot)return y({},e,{data:dr(e.data),cv:"2024-10"});if(e.type===Ji.IncrementalSnapshot&&e.data.source===Ki.Mutation)return y({},e,{cv:"2024-10",data:y({},e.data,{texts:dr(e.data.texts),attributes:dr(e.data.attributes),removes:dr(e.data.removes),adds:dr(e.data.adds)})});if(e.type===Ji.IncrementalSnapshot&&e.data.source===Ki.StyleSheetRule)return y({},e,{cv:"2024-10",data:y({},e.data,{adds:e.data.adds?dr(e.data.adds):void 0,removes:e.data.removes?dr(e.data.removes):void 0})})}catch(e){lr.error("could not compress event - will use uncompressed event",e)}return e}(n):n,u={$snapshot_bytes:Yi(c),$snapshot_data:c,$session_id:this.Ft,$window_id:this.pi};this.status!==qs?this.qi(u):this.gi()}}}}}Li(){if(!this._instance.config.capture_pageview&&s){var e=this.wi(s.location.href);this.ji!==e&&(this.tryAddCustomEvent("$url_changed",{href:e}),this.ji=e)}}Di(){if(this.ti.length){var e=[...this.ti];this.ti=[],e.forEach(e=>{Date.now()-e.enqueuedAt<=2e3&&this.Mi(e)})}}wi(e){var t=this._instance.config.session_recording;if(t.maskNetworkRequestFn){var i,s={url:e};return null==(i=s=t.maskNetworkRequestFn(s))?void 0:i.url}return e}gi(){return this.H={size:0,data:[],sessionId:this.Ft,windowId:this.pi},this.H}ui(){this.Bi&&(clearTimeout(this.Bi),this.Bi=void 0);var e=this.Jt,t=this.zt,i=N(t)&&t>=0,s=N(e)&&i&&t<e;return this.status===zs||this.status===Gs||this.status===qs||s?(this.Bi=setTimeout(()=>{this.ui()},2e3),this.H):(this.H.data.length>0&&Xi(this.H).forEach(e=>{this.Hi({$snapshot_bytes:e.size,$snapshot_data:e.data,$session_id:e.sessionId,$window_id:e.windowId,$lib:"web",$lib_version:_.LIB_VERSION})}),this.gi())}qi(e){var t,i=2+((null==(t=this.H)?void 0:t.data.length)||0);!this.ii&&(this.H.size+e.$snapshot_bytes+i>943718.4||this.H.sessionId!==this.Ft)&&(this.H=this.ui()),this.H.size+=e.$snapshot_bytes,this.H.data.push(e.$snapshot_data),this.Bi||this.ii||(this.Bi=setTimeout(()=>{this.ui()},2e3))}Hi(e){this._instance.capture("$snapshot",e,{_url:this._instance.requestRouter.endpointFor("api",this.ci),_noTruncate:!0,_batchKey:"recordings",skip_client_rate_limiting:!0})}zi(e){var t;this.Nt.triggerStatus(this.sessionId)===Ys&&(null==(t=this._instance)||null==(t=t.persistence)||t.register({["url"===e?ct:ut]:this.Ft}),this.ui(),this.xi(e+"_trigger_matched"))}Ni(){this.Xt.urlBlocked||(this.Xt.urlBlocked=!0,clearInterval(this.Si),lr.info("recording paused due to URL blocker"),this.tryAddCustomEvent("recording paused",{reason:"url blocker"}))}Ui(){this.Xt.urlBlocked&&(this.Xt.urlBlocked=!1,this.Oi(),this.Ci(),this.tryAddCustomEvent("recording resumed",{reason:"left blocked url"}),lr.info("recording resumed"))}bi(){0!==this.Qt.Mt.length&&D(this.ai)&&(this.ai=this._instance.on("eventCaptured",e=>{try{this.Qt.Mt.includes(e.event)&&this.zi("event")}catch(e){lr.error("Could not activate event trigger",e)}}))}overrideLinkedFlag(){this.Zt.linkedFlagSeen=!0,this.Oi(),this.xi("linked_flag_overridden")}overrideSampling(){var e;null==(e=this._instance.persistence)||e.register({[lt]:!0}),this.Oi(),this.xi("sampling_overridden")}overrideTrigger(e){this.zi(e)}xi(e,t){this._instance.register_for_session({$session_recording_start_reason:e}),lr.info(e.replace("_"," "),t),E(["recording_initialized","session_id_changed"],e)||this.tryAddCustomEvent(e,t)}get sdkDebugProperties(){var{sessionStartTimestamp:e}=this.jt.checkAndGetSessionAndWindowId(!0);return{$recording_status:this.status,$sdk_debug_replay_internal_buffer_length:this.H.data.length,$sdk_debug_replay_internal_buffer_size:this.H.size,$sdk_debug_current_session_duration:this.zt,$sdk_debug_session_start:e}}}var vr=xe("[SegmentIntegration]"),_r="posthog-js";function fr(e,t){var{organization:i,projectId:s,prefix:r,severityAllowList:n=["error"],sendExceptionsToPostHog:o=!0}=void 0===t?{}:t;return t=>{var a,l,c,u,h;if("*"!==n&&!n.includes(t.level)||!e.__loaded)return t;t.tags||(t.tags={});var d=e.requestRouter.endpointFor("ui","/project/"+e.config.token+"/person/"+e.get_distinct_id());t.tags["PostHog Person URL"]=d,e.sessionRecordingStarted()&&(t.tags["PostHog Recording URL"]=e.get_session_replay_url({withTimestamp:!0}));var p=(null==(a=t.exception)?void 0:a.values)||[],g=p.map(e=>y({},e,{stacktrace:e.stacktrace?y({},e.stacktrace,{type:"raw",frames:(e.stacktrace.frames||[]).map(e=>y({},e,{platform:"web:javascript"}))}):void 0})),v={$exception_message:(null==(l=p[0])?void 0:l.value)||t.message,$exception_type:null==(c=p[0])?void 0:c.type,$exception_personURL:d,$exception_level:t.level,$exception_list:g,$sentry_event_id:t.event_id,$sentry_exception:t.exception,$sentry_exception_message:(null==(u=p[0])?void 0:u.value)||t.message,$sentry_exception_type:null==(h=p[0])?void 0:h.type,$sentry_tags:t.tags};return i&&s&&(v.$sentry_url=(r||"https://sentry.io/organizations/")+i+"/issues/?project="+s+"&query="+t.event_id),o&&e.exceptions.sendExceptionEvent(v),t}}class mr{constructor(e,t,i,s,r,n){this.name=_r,this.setupOnce=function(o){o(fr(e,{organization:t,projectId:i,prefix:s,severityAllowList:r,sendExceptionsToPostHog:null==n||n}))}}}var yr=null!=s&&s.location?gi(s.location.hash,"__posthog")||gi(location.hash,"state"):null,br="_postHogToolbarParams",wr=xe("[Toolbar]"),Er=function(e){return e[e.UNINITIALIZED=0]="UNINITIALIZED",e[e.LOADING=1]="LOADING",e[e.LOADED=2]="LOADED",e}(Er||{});class kr{constructor(e){this.instance=e}Wi(e){v.ph_toolbar_state=e}Gi(){var e;return null!==(e=v.ph_toolbar_state)&&void 0!==e?e:Er.UNINITIALIZED}maybeLoadToolbar(e,t,i){if(void 0===e&&(e=void 0),void 0===t&&(t=void 0),void 0===i&&(i=void 0),!s||!c)return!1;e=null!=e?e:s.location,i=null!=i?i:s.history;try{if(!t){try{s.localStorage.setItem("test","test"),s.localStorage.removeItem("test")}catch(e){return!1}t=null==s?void 0:s.localStorage}var r,n=yr||gi(e.hash,"__posthog")||gi(e.hash,"state"),o=n?Oe(()=>JSON.parse(atob(decodeURIComponent(n))))||Oe(()=>JSON.parse(decodeURIComponent(n))):null;return o&&"ph_authorize"===o.action?((r=o).source="url",r&&Object.keys(r).length>0&&(o.desiredHash?e.hash=o.desiredHash:i?i.replaceState(i.state,"",e.pathname+e.search):e.hash="")):((r=JSON.parse(t.getItem(br)||"{}")).source="localstorage",delete r.userIntent),!(!r.token||this.instance.config.token!==r.token||(this.loadToolbar(r),0))}catch(e){return!1}}Vi(e){var t=v.ph_load_toolbar||v.ph_load_editor;!D(t)&&R(t)?t(e,this.instance):wr.warn("No toolbar load function found")}loadToolbar(e){var t=!(null==c||!c.getElementById(It));if(!s||t)return!1;var i="custom"===this.instance.requestRouter.region&&this.instance.config.advanced_disable_toolbar_metrics,r=y({token:this.instance.config.token},e,{apiURL:this.instance.requestRouter.endpointFor("ui")},i?{instrument:!1}:{});if(s.localStorage.setItem(br,JSON.stringify(y({},r,{source:void 0}))),this.Gi()===Er.LOADED)this.Vi(r);else if(this.Gi()===Er.UNINITIALIZED){var n;this.Wi(Er.LOADING),null==(n=v.__PosthogExtensions__)||null==n.loadExternalDependency||n.loadExternalDependency(this.instance,"toolbar",e=>{if(e)return wr.error("[Toolbar] Failed to load",e),void this.Wi(Er.UNINITIALIZED);this.Wi(Er.LOADED),this.Vi(r)}),je(s,"turbolinks:load",()=>{this.Wi(Er.UNINITIALIZED),this.loadToolbar(r)})}return!0}Ji(e){return this.loadToolbar(e)}maybeLoadEditor(e,t,i){return void 0===e&&(e=void 0),void 0===t&&(t=void 0),void 0===i&&(i=void 0),this.maybeLoadToolbar(e,t,i)}}var Sr=xe("[TracingHeaders]");class xr{constructor(e){this.Ki=void 0,this.Yi=void 0,this.lt=()=>{var e,t;A(this.Ki)&&(null==(e=v.__PosthogExtensions__)||null==(e=e.tracingHeadersPatchFns)||e._patchXHR(this._instance.config.__add_tracing_headers||[],this._instance.get_distinct_id(),this._instance.sessionManager)),A(this.Yi)&&(null==(t=v.__PosthogExtensions__)||null==(t=t.tracingHeadersPatchFns)||t._patchFetch(this._instance.config.__add_tracing_headers||[],this._instance.get_distinct_id(),this._instance.sessionManager))},this._instance=e}nt(e){var t,i;null!=(t=v.__PosthogExtensions__)&&t.tracingHeadersPatchFns&&e(),null==(i=v.__PosthogExtensions__)||null==i.loadExternalDependency||i.loadExternalDependency(this._instance,"tracing-headers",t=>{if(t)return Sr.error("failed to load script",t);e()})}startIfEnabledOrStop(){var e,t;this._instance.config.__add_tracing_headers?this.nt(this.lt):(null==(e=this.Ki)||e.call(this),null==(t=this.Yi)||t.call(this),this.Ki=void 0,this.Yi=void 0)}}var Ir=xe("[Web Vitals]"),Pr=9e5;class Fr{constructor(e){var t;this.Xi=!1,this.C=!1,this.H={url:void 0,metrics:[],firstMetricTimestamp:void 0},this.Qi=()=>{clearTimeout(this.Zi),0!==this.H.metrics.length&&(this._instance.capture("$web_vitals",this.H.metrics.reduce((e,t)=>y({},e,{["$web_vitals_"+t.name+"_event"]:y({},t),["$web_vitals_"+t.name+"_value"]:t.value}),{})),this.H={url:void 0,metrics:[],firstMetricTimestamp:void 0})},this.te=e=>{var t,i=null==(t=this._instance.sessionManager)?void 0:t.checkAndGetSessionAndWindowId(!0);if(A(i))Ir.error("Could not read session ID. Dropping metrics!");else{this.H=this.H||{url:void 0,metrics:[],firstMetricTimestamp:void 0};var s=this.ie();A(s)||(D(null==e?void 0:e.name)||D(null==e?void 0:e.value)?Ir.error("Invalid metric received",e):this.ee&&e.value>=this.ee?Ir.error("Ignoring metric with value >= "+this.ee,e):(this.H.url!==s&&(this.Qi(),this.Zi=setTimeout(this.Qi,this.flushToCaptureTimeoutMs)),A(this.H.url)&&(this.H.url=s),this.H.firstMetricTimestamp=A(this.H.firstMetricTimestamp)?Date.now():this.H.firstMetricTimestamp,e.attribution&&e.attribution.interactionTargetElement&&(e.attribution.interactionTargetElement=void 0),this.H.metrics.push(y({},e,{$current_url:s,$session_id:i.sessionId,$window_id:i.windowId,timestamp:Date.now()})),this.H.metrics.length===this.allowedMetrics.length&&this.Qi()))}},this.lt=()=>{var e,t,i,s,r=v.__PosthogExtensions__;A(r)||A(r.postHogWebVitalsCallbacks)||({onLCP:e,onCLS:t,onFCP:i,onINP:s}=r.postHogWebVitalsCallbacks),e&&t&&i&&s?(this.allowedMetrics.indexOf("LCP")>-1&&e(this.te.bind(this)),this.allowedMetrics.indexOf("CLS")>-1&&t(this.te.bind(this)),this.allowedMetrics.indexOf("FCP")>-1&&i(this.te.bind(this)),this.allowedMetrics.indexOf("INP")>-1&&s(this.te.bind(this)),this.C=!0):Ir.error("web vitals callbacks not loaded - not starting")},this._instance=e,this.Xi=!(null==(t=this._instance.persistence)||!t.props[Xe]),this.startIfEnabled()}get allowedMetrics(){var e,t,i=C(this._instance.config.capture_performance)?null==(e=this._instance.config.capture_performance)?void 0:e.web_vitals_allowed_metrics:void 0;return A(i)?(null==(t=this._instance.persistence)?void 0:t.props[Ke])||["CLS","FCP","INP","LCP"]:i}get flushToCaptureTimeoutMs(){return(C(this._instance.config.capture_performance)?this._instance.config.capture_performance.web_vitals_delayed_flush_ms:void 0)||5e3}get ee(){var e=C(this._instance.config.capture_performance)&&N(this._instance.config.capture_performance.__web_vitals_max_value)?this._instance.config.capture_performance.__web_vitals_max_value:Pr;return 0<e&&e<=6e4?Pr:e}get isEnabled(){var e=null==u?void 0:u.protocol;if("http:"!==e&&"https:"!==e)return Ir.info("Web Vitals are disabled on non-http/https protocols"),!1;var t=C(this._instance.config.capture_performance)?this._instance.config.capture_performance.web_vitals:H(this._instance.config.capture_performance)?this._instance.config.capture_performance:void 0;return H(t)?t:this.Xi}startIfEnabled(){this.isEnabled&&!this.C&&(Ir.info("enabled, starting..."),this.nt(this.lt))}onRemoteConfig(e){var t=C(e.capturePerformance)&&!!e.capturePerformance.web_vitals,i=C(e.capturePerformance)?e.capturePerformance.web_vitals_allowed_metrics:void 0;this._instance.persistence&&(this._instance.persistence.register({[Xe]:t}),this._instance.persistence.register({[Ke]:i})),this.Xi=t,this.startIfEnabled()}nt(e){var t,i;null!=(t=v.__PosthogExtensions__)&&t.postHogWebVitalsCallbacks&&e(),null==(i=v.__PosthogExtensions__)||null==i.loadExternalDependency||i.loadExternalDependency(this._instance,"web-vitals",t=>{t?Ir.error("failed to load script",t):e()})}ie(){var e=s?s.location.href:void 0;return e||Ir.error("Could not determine current URL"),e}}var $r=xe("[Heatmaps]");function Rr(e){return C(e)&&"clientX"in e&&"clientY"in e&&N(e.clientX)&&N(e.clientY)}class Cr{constructor(e){var t;this.rageclicks=new oi,this.Xi=!1,this.C=!1,this.re=null,this.instance=e,this.Xi=!(null==(t=this.instance.persistence)||!t.props[Ge])}get flushIntervalMilliseconds(){var e=5e3;return C(this.instance.config.capture_heatmaps)&&this.instance.config.capture_heatmaps.flush_interval_milliseconds&&(e=this.instance.config.capture_heatmaps.flush_interval_milliseconds),e}get isEnabled(){return A(this.instance.config.capture_heatmaps)?A(this.instance.config.enable_heatmaps)?this.Xi:this.instance.config.enable_heatmaps:!1!==this.instance.config.capture_heatmaps}startIfEnabled(){if(this.isEnabled){if(this.C)return;$r.info("starting..."),this.se(),this.re=setInterval(this.ne.bind(this),this.flushIntervalMilliseconds)}else{var e,t;clearInterval(null!==(e=this.re)&&void 0!==e?e:void 0),null==(t=this.oe)||t.stop(),this.getAndClearBuffer()}}onRemoteConfig(e){var t=!!e.heatmaps;this.instance.persistence&&this.instance.persistence.register({[Ge]:t}),this.Xi=t,this.startIfEnabled()}getAndClearBuffer(){var e=this.H;return this.H=void 0,e}ae(e){this.le(e.originalEvent,"deadclick")}se(){s&&c&&(je(s,"beforeunload",this.ne.bind(this)),je(c,"click",e=>this.le(e||(null==s?void 0:s.event)),{capture:!0}),je(c,"mousemove",e=>this.ue(e||(null==s?void 0:s.event)),{capture:!0}),this.oe=new Ui(this.instance,qi,this.ae.bind(this)),this.oe.startIfEnabled(),this.C=!0)}he(e,t){var i=this.instance.scrollManager.scrollY(),r=this.instance.scrollManager.scrollX(),n=this.instance.scrollManager.scrollElement(),o=function(e,t,i){for(var r=e;r&&Rt(r)&&!Ct(r,"body");){if(r===i)return!1;if(E(t,null==s?void 0:s.getComputedStyle(r).position))return!0;r=Bt(r)}return!1}(Ht(e),["fixed","sticky"],n);return{x:e.clientX+(o?0:r),y:e.clientY+(o?0:i),target_fixed:o,type:t}}le(e,t){var i;if(void 0===t&&(t="click"),!$t(e.target)&&Rr(e)){var s=this.he(e,t);null!=(i=this.rageclicks)&&i.isRageClick(e.clientX,e.clientY,(new Date).getTime())&&this.de(y({},s,{type:"rageclick"})),this.de(s)}}ue(e){!$t(e.target)&&Rr(e)&&(clearTimeout(this.ve),this.ve=setTimeout(()=>{this.de(this.he(e,"mousemove"))},500))}de(e){if(s){var t=s.location.href;this.H=this.H||{},this.H[t]||(this.H[t]=[]),this.H[t].push(e)}}ne(){this.H&&!T(this.H)&&this.instance.capture("$$heatmap",{$heatmap_data:this.getAndClearBuffer()})}}class Tr{constructor(e){this._instance=e}doPageView(e,t){var i,r=this.ce(e,t);return this.fe={pathname:null!==(i=null==s?void 0:s.location.pathname)&&void 0!==i?i:"",pageViewId:t,timestamp:e},this._instance.scrollManager.resetContext(),r}doPageLeave(e){var t;return this.ce(e,null==(t=this.fe)?void 0:t.pageViewId)}doEvent(){var e;return{$pageview_id:null==(e=this.fe)?void 0:e.pageViewId}}ce(e,t){var i=this.fe;if(!i)return{$pageview_id:t};var s={$pageview_id:t,$prev_pageview_id:i.pageViewId},r=this._instance.scrollManager.getContext();if(r&&!this._instance.config.disable_scroll_properties){var{maxScrollHeight:n,lastScrollY:o,maxScrollY:a,maxContentHeight:l,lastContentY:c,maxContentY:u}=r;if(!(A(n)||A(o)||A(a)||A(l)||A(c)||A(u))){n=Math.ceil(n),o=Math.ceil(o),a=Math.ceil(a),l=Math.ceil(l),c=Math.ceil(c),u=Math.ceil(u);var h=n<=1?1:V(o/n,0,1,Se),d=n<=1?1:V(a/n,0,1,Se),p=l<=1?1:V(c/l,0,1,Se),g=l<=1?1:V(u/l,0,1,Se);s=Ce(s,{$prev_pageview_last_scroll:o,$prev_pageview_last_scroll_percentage:h,$prev_pageview_max_scroll:a,$prev_pageview_max_scroll_percentage:d,$prev_pageview_last_content:c,$prev_pageview_last_content_percentage:p,$prev_pageview_max_content:u,$prev_pageview_max_content_percentage:g})}}return i.pathname&&(s.$prev_pageview_pathname=i.pathname),i.timestamp&&(s.$prev_pageview_duration=(e.getTime()-i.timestamp.getTime())/1e3),s}}var Ar=!!d||!!h,Or="text/plain",Mr=(e,t)=>{var[i,s]=e.split("?"),r=y({},t);null==s||s.split("&").forEach(e=>{var[t]=e.split("=");delete r[t]});var n=function(e,t){var i,s;void 0===t&&(t="&");var r=[];return Re(e,function(e,t){A(e)||A(t)||"undefined"===t||(i=encodeURIComponent((e=>e instanceof File)(e)?e.name:e.toString()),s=encodeURIComponent(t),r[r.length]=s+"="+i)}),r.join(t)}(r);return i+"?"+(n?(s?s+"&":"")+n:s)},Lr=(e,t)=>JSON.stringify(e,(e,t)=>"bigint"==typeof t?t.toString():t,t),Dr=e=>{var{data:t,compression:i}=e;if(t){if(i===li.GZipJS){var s=Hs(js(Lr(t)),{mtime:0}),r=new Blob([s],{type:Or});return{contentType:Or,body:r,estimatedSize:r.size}}if(i===li.Base64){var n=function(e){var t,i,s,r,n,o="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",a=0,l=0,c="",u=[];if(!e)return e;e=function(e){var t,i,s,r,n="";for(t=i=0,s=(e=(e+"").replace(/\r\n/g,"\n").replace(/\r/g,"\n")).length,r=0;r<s;r++){var o=e.charCodeAt(r),a=null;o<128?i++: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),L(a)||(i>t&&(n+=e.substring(t,i)),n+=a,t=i=r+1)}return i>t&&(n+=e.substring(t,e.length)),n}(e);do{t=(n=e.charCodeAt(a++)<<16|e.charCodeAt(a++)<<8|e.charCodeAt(a++))>>18&63,i=n>>12&63,s=n>>6&63,r=63&n,u[l++]=o.charAt(t)+o.charAt(i)+o.charAt(s)+o.charAt(r)}while(a<e.length);switch(c=u.join(""),e.length%3){case 1:c=c.slice(0,-2)+"==";break;case 2:c=c.slice(0,-1)+"="}return c}(Lr(t)),o=(e=>"data="+encodeURIComponent("string"==typeof e?e:Lr(e)))(n);return{contentType:"application/x-www-form-urlencoded",body:o,estimatedSize:new Blob([o]).size}}var a=Lr(t);return{contentType:"application/json",body:a,estimatedSize:new Blob([a]).size}}},Nr=[];h&&Nr.push({transport:"fetch",method:e=>{var t,i,{contentType:s,body:r,estimatedSize:n}=null!==(t=Dr(e))&&void 0!==t?t:{},o=new Headers;Re(e.headers,function(e,t){o.append(t,e)}),s&&o.append("Content-Type",s);var a=e.url,l=null;if(p){var c=new p;l={signal:c.signal,timeout:setTimeout(()=>c.abort(),e.timeout)}}h(a,y({method:(null==e?void 0:e.method)||"GET",headers:o,keepalive:"POST"===e.method&&(n||0)<52428.8,body:r,signal:null==(i=l)?void 0:i.signal},e.fetchOptions)).then(t=>t.text().then(i=>{var s={statusCode:t.status,text:i};if(200===t.status)try{s.json=JSON.parse(i)}catch(e){Se.error(e)}null==e.callback||e.callback(s)})).catch(t=>{Se.error(t),null==e.callback||e.callback({statusCode:0,text:t})}).finally(()=>l?clearTimeout(l.timeout):null)}}),d&&Nr.push({transport:"XHR",method:e=>{var t,i=new d;i.open(e.method||"GET",e.url,!0);var{contentType:s,body:r}=null!==(t=Dr(e))&&void 0!==t?t:{};Re(e.headers,function(e,t){i.setRequestHeader(t,e)}),s&&i.setRequestHeader("Content-Type",s),e.timeout&&(i.timeout=e.timeout),e.disableXHRCredentials||(i.withCredentials=!0),i.onreadystatechange=()=>{if(4===i.readyState){var t={statusCode:i.status,text:i.responseText};if(200===i.status)try{t.json=JSON.parse(i.responseText)}catch(e){}null==e.callback||e.callback(t)}},i.send(r)}}),null!=l&&l.sendBeacon&&Nr.push({transport:"sendBeacon",method:e=>{var t=Mr(e.url,{beacon:"1"});try{var i,{contentType:s,body:r}=null!==(i=Dr(e))&&void 0!==i?i:{},n="string"==typeof r?new Blob([r],{type:s}):r;l.sendBeacon(t,n)}catch(e){}}});var Hr=function(e,t){if(!function(e){try{new RegExp(e)}catch(e){return!1}return!0}(t))return!1;try{return new RegExp(t).test(e)}catch(e){return!1}};function jr(e,t,i){return Lr({distinct_id:e,userPropertiesToSet:t,userPropertiesToSetOnce:i})}var qr={exact:(e,t)=>t.some(t=>e.some(e=>t===e)),is_not:(e,t)=>t.every(t=>e.every(e=>t!==e)),regex:(e,t)=>t.some(t=>e.some(e=>Hr(t,e))),not_regex:(e,t)=>t.every(t=>e.every(e=>!Hr(t,e))),icontains:(e,t)=>t.map(Br).some(t=>e.map(Br).some(e=>t.includes(e))),not_icontains:(e,t)=>t.map(Br).every(t=>e.map(Br).every(e=>!t.includes(e)))},Br=e=>e.toLowerCase(),Ur=xe("[Error tracking]");class zr{constructor(e){var t,i;this.pe=[],this.ge=new he([new de,new Ee,new ge,new pe,new be,new ye,new _e,new we],[oe,ce]),this._instance=e,this.pe=null!==(t=null==(i=this._instance.persistence)?void 0:i.get_property(Ve))&&void 0!==t?t:[]}onRemoteConfig(e){var t,i,s,r=null!==(t=null==(i=e.errorTracking)?void 0:i.suppressionRules)&&void 0!==t?t:[],n=null==(s=e.errorTracking)?void 0:s.captureExtensionExceptions;this.pe=r,this._instance.persistence&&this._instance.persistence.register({[Ve]:this.pe,[Ye]:n})}get _e(){var e,t=!!this._instance.get_property(Ye),i=this._instance.config.error_tracking.captureExtensionExceptions;return null!==(e=null!=i?i:t)&&void 0!==e&&e}buildProperties(e,t){return this.ge.buildFromUnknown(e,{syntheticException:null==t?void 0:t.syntheticException,mechanism:{handled:null==t?void 0:t.handled}})}sendExceptionEvent(e){if(this.me(e))Ur.info("Skipping exception capture because a suppression rule matched");else{if(this._e||!this.ye(e))return this._instance.capture("$exception",e,{_noTruncate:!0,_batchKey:"exceptionEvent"});Ur.info("Skipping exception capture because it was thrown by an extension")}}me(e){var t=e.$exception_list;if(!t||!$(t)||0===t.length)return!1;var i=t.reduce((e,t)=>{var{type:i,value:s}=t;return O(i)&&i.length>0&&e.$exception_types.push(i),O(s)&&s.length>0&&e.$exception_values.push(s),e},{$exception_types:[],$exception_values:[]});return this.pe.some(e=>{var t=e.values.map(e=>{var t,s=qr[e.operator],r=$(e.value)?e.value:[e.value],n=null!==(t=i[e.key])&&void 0!==t?t:[];return r.length>0&&s(r,n)});return"OR"===e.type?t.some(Boolean):t.every(Boolean)})}ye(e){var t=e.$exception_list;return!(!t||!$(t))&&t.flatMap(e=>{var t,i;return null!==(t=null==(i=e.stacktrace)?void 0:i.frames)&&void 0!==t?t:[]}).some(e=>e.filename&&e.filename.startsWith("chrome-extension://"))}}var Gr="Mobile",Wr="iOS",Vr="Android",Yr="Tablet",Xr=Vr+" "+Yr,Jr="iPad",Kr="Apple",Zr=Kr+" Watch",Qr="Safari",en="BlackBerry",tn="Samsung",sn=tn+"Browser",rn=tn+" Internet",nn="Chrome",on=nn+" OS",an=nn+" "+Wr,ln="Internet Explorer",cn=ln+" "+Gr,un="Opera",hn=un+" Mini",dn="Edge",pn="Microsoft "+dn,gn="Firefox",vn=gn+" "+Wr,_n="Nintendo",fn="PlayStation",mn="Xbox",yn=Vr+" "+Gr,bn=Gr+" "+Qr,wn="Windows",En=wn+" Phone",kn="Nokia",Sn="Ouya",xn="Generic",In=xn+" "+Gr.toLowerCase(),Pn=xn+" "+Yr.toLowerCase(),Fn="Konqueror",$n="(\\d+(\\.\\d+)?)",Rn=new RegExp("Version/"+$n),Cn=new RegExp(mn,"i"),Tn=new RegExp(fn+" \\w+","i"),An=new RegExp(_n+" \\w+","i"),On=new RegExp(en+"|PlayBook|BB10","i"),Mn={"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"},Ln=function(e,t){return t=t||"",E(e," OPR/")&&E(e,"Mini")?hn:E(e," OPR/")?un:On.test(e)?en:E(e,"IE"+Gr)||E(e,"WPDesktop")?cn:E(e,sn)?rn:E(e,dn)||E(e,"Edg/")?pn:E(e,"FBIOS")?"Facebook "+Gr:E(e,"UCWEB")||E(e,"UCBrowser")?"UC Browser":E(e,"CriOS")?an:E(e,"CrMo")||E(e,nn)?nn:E(e,Vr)&&E(e,Qr)?yn:E(e,"FxiOS")?vn:E(e.toLowerCase(),Fn.toLowerCase())?Fn:((e,t)=>t&&E(t,Kr)||function(e){return E(e,Qr)&&!E(e,nn)&&!E(e,Vr)}(e))(e,t)?E(e,Gr)?bn:Qr:E(e,gn)?gn:E(e,"MSIE")||E(e,"Trident/")?ln:E(e,"Gecko")?gn:""},Dn={[cn]:[new RegExp("rv:"+$n)],[pn]:[new RegExp(dn+"?\\/"+$n)],[nn]:[new RegExp("("+nn+"|CrMo)\\/"+$n)],[an]:[new RegExp("CriOS\\/"+$n)],"UC Browser":[new RegExp("(UCBrowser|UCWEB)\\/"+$n)],[Qr]:[Rn],[bn]:[Rn],[un]:[new RegExp("(Opera|OPR)\\/"+$n)],[gn]:[new RegExp(gn+"\\/"+$n)],[vn]:[new RegExp("FxiOS\\/"+$n)],[Fn]:[new RegExp("Konqueror[:/]?"+$n,"i")],[en]:[new RegExp(en+" "+$n),Rn],[yn]:[new RegExp("android\\s"+$n,"i")],[rn]:[new RegExp(sn+"\\/"+$n)],[ln]:[new RegExp("(rv:|MSIE )"+$n)],Mozilla:[new RegExp("rv:"+$n)]},Nn=function(e,t){var i=Ln(e,t),s=Dn[i];if(A(s))return null;for(var r=0;r<s.length;r++){var n=s[r],o=e.match(n);if(o)return parseFloat(o[o.length-2])}return null},Hn=[[new RegExp(mn+"; "+mn+" (.*?)[);]","i"),e=>[mn,e&&e[1]||""]],[new RegExp(_n,"i"),[_n,""]],[new RegExp(fn,"i"),[fn,""]],[On,[en,""]],[new RegExp(wn,"i"),(e,t)=>{if(/Phone/.test(t)||/WPDesktop/.test(t))return[En,""];if(new RegExp(Gr).test(t)&&!/IEMobile\b/.test(t))return[wn+" "+Gr,""];var i=/Windows NT ([0-9.]+)/i.exec(t);if(i&&i[1]){var s=i[1],r=Mn[s]||"";return/arm/i.test(t)&&(r="RT"),[wn,r]}return[wn,""]}],[/((iPhone|iPad|iPod).*?OS (\d+)_(\d+)_?(\d+)?|iPhone)/,e=>{if(e&&e[3]){var t=[e[3],e[4],e[5]||"0"];return[Wr,t.join(".")]}return[Wr,""]}],[/(watch.*\/(\d+\.\d+\.\d+)|watch os,(\d+\.\d+),)/i,e=>{var t="";return e&&e.length>=3&&(t=A(e[2])?e[3]:e[2]),["watchOS",t]}],[new RegExp("("+Vr+" (\\d+)\\.(\\d+)\\.?(\\d+)?|"+Vr+")","i"),e=>{if(e&&e[2]){var t=[e[2],e[3],e[4]||"0"];return[Vr,t.join(".")]}return[Vr,""]}],[/Mac OS X (\d+)[_.](\d+)[_.]?(\d+)?/i,e=>{var t=["Mac OS X",""];if(e&&e[1]){var i=[e[1],e[2],e[3]||"0"];t[1]=i.join(".")}return t}],[/Mac/i,["Mac OS X",""]],[/CrOS/,[on,""]],[/Linux|debian/i,["Linux",""]]],jn=function(e){return An.test(e)?_n:Tn.test(e)?fn:Cn.test(e)?mn:new RegExp(Sn,"i").test(e)?Sn:new RegExp("("+En+"|WPDesktop)","i").test(e)?En:/iPad/.test(e)?Jr:/iPod/.test(e)?"iPod Touch":/iPhone/.test(e)?"iPhone":/(watch)(?: ?os[,/]|\d,\d\/)[\d.]+/i.test(e)?Zr:On.test(e)?en:/(kobo)\s(ereader|touch)/i.test(e)?"Kobo":new RegExp(kn,"i").test(e)?kn:/(kf[a-z]{2}wi|aeo[c-r]{2})( bui|\))/i.test(e)||/(kf[a-z]+)( bui|\)).+silk\//i.test(e)?"Kindle Fire":/(Android|ZTE)/i.test(e)?!new RegExp(Gr).test(e)||/(9138B|TB782B|Nexus [97]|pixel c|HUAWEISHT|BTV|noble nook|smart ultra 6)/i.test(e)?/pixel[\daxl ]{1,6}/i.test(e)&&!/pixel c/i.test(e)||/(huaweimed-al00|tah-|APA|SM-G92|i980|zte|U304AA)/i.test(e)||/lmy47v/i.test(e)&&!/QTAQZ3/i.test(e)?Vr:Xr:Vr:new RegExp("(pda|"+Gr+")","i").test(e)?In:new RegExp(Yr,"i").test(e)&&!new RegExp(Yr+" pc","i").test(e)?Pn:""},qn="https?://(.*)",Bn=["gclid","gclsrc","dclid","gbraid","wbraid","fbclid","msclkid","twclid","li_fat_id","igshid","ttclid","rdt_cid","epik","qclid","sccid","irclid","_kx"],Un=Te(["utm_source","utm_medium","utm_campaign","utm_content","utm_term","gad_source","mc_cid"],Bn),zn="<masked>",Gn=["li_fat_id"];function Wn(e,t,i){if(!c)return{};var s,r=t?Te([],Bn,i||[]):[],n=Vn(pi(c.URL,r,zn),e),o=(s={},Re(Gn,function(e){var t=$i.J(e);s[e]=t||null}),s);return Ce(o,n)}function Vn(e,t){var i=Un.concat(t||[]),s={};return Re(i,function(t){var i=di(e,t);s[t]=i||null}),s}function Yn(e){var t=function(e){return e?0===e.search(qn+"google.([^/?]*)")?"google":0===e.search(qn+"bing.com")?"bing":0===e.search(qn+"yahoo.com")?"yahoo":0===e.search(qn+"duckduckgo.com")?"duckduckgo":null:null}(e),i="yahoo"!=t?"q":"p",s={};if(!L(t)){s.$search_engine=t;var r=c?di(c.referrer,i):"";r.length&&(s.ph_keyword=r)}return s}function Xn(){return navigator.language||navigator.userLanguage}function Jn(){return(null==c?void 0:c.referrer)||"$direct"}function Kn(e,t){var i=e?Te([],Bn,t||[]):[],s=null==u?void 0:u.href.substring(0,1e3);return{r:Jn().substring(0,1e3),u:s?pi(s,i,zn):void 0}}function Zn(e){var t,{r:i,u:s}=e,r={$referrer:i,$referring_domain:null==i?void 0:"$direct"==i?"$direct":null==(t=hi(i))?void 0:t.host};if(s){r.$current_url=s;var n=hi(s);r.$host=null==n?void 0:n.host,r.$pathname=null==n?void 0:n.pathname;var o=Vn(s);Ce(r,o)}if(i){var a=Yn(i);Ce(r,a)}return r}function Qn(){try{return Intl.DateTimeFormat().resolvedOptions().timeZone}catch(e){return}}function eo(){try{return(new Date).getTimezoneOffset()}catch(e){return}}function to(e,t){if(!g)return{};var i,r,n,o=e?Te([],Bn,t||[]):[],[a,l]=function(e){for(var t=0;t<Hn.length;t++){var[i,s]=Hn[t],r=i.exec(e),n=r&&(R(s)?s(r,e):s);if(n)return n}return["",""]}(g);return Ce(Le({$os:a,$os_version:l,$browser:Ln(g,navigator.vendor),$device:jn(g),$device_type:(r=g,n=jn(r),n===Jr||n===Xr||"Kobo"===n||"Kindle Fire"===n||n===Pn?Yr:n===_n||n===mn||n===fn||n===Sn?"Console":n===Zr?"Wearable":n?Gr:"Desktop"),$timezone:Qn(),$timezone_offset:eo()}),{$current_url:pi(null==u?void 0:u.href,o,zn),$host:null==u?void 0:u.host,$pathname:null==u?void 0:u.pathname,$raw_user_agent:g.length>1e3?g.substring(0,997)+"...":g,$browser_version:Nn(g,navigator.vendor),$browser_language:Xn(),$browser_language_prefix:(i=Xn(),"string"==typeof i?i.split("-")[0]:void 0),$screen_height:null==s?void 0:s.screen.height,$screen_width:null==s?void 0:s.screen.width,$viewport_height:null==s?void 0:s.innerHeight,$viewport_width:null==s?void 0:s.innerWidth,$lib:"web",$lib_version:_.LIB_VERSION,$insert_id:Math.random().toString(36).substring(2,10)+Math.random().toString(36).substring(2,10),$time:Date.now()/1e3})}var io=xe("[FeatureFlags]"),so="$active_feature_flags",ro="$override_feature_flags",no="$feature_flag_payloads",oo="$override_feature_flag_payloads",ao="$feature_flag_request_id",lo=e=>{var t={};for(var[i,s]of Ae(e||{}))s&&(t[i]=s);return t},co=function(e){return e.FeatureFlags="feature_flags",e.Recordings="recordings",e}({});class uo{constructor(e){this.be=!1,this.we=!1,this.Se=!1,this.ke=!1,this.$e=!1,this.xe=!1,this.Ee=!1,this._instance=e,this.featureFlagEventHandlers=[]}flags(){if(this._instance.config.__preview_remote_config)this.xe=!0;else{var e=!this.Pe&&(this._instance.config.advanced_disable_feature_flags||this._instance.config.advanced_disable_feature_flags_on_first_load);this.Re({disableFlags:e})}}get hasLoadedFlags(){return this.we}getFlags(){return Object.keys(this.getFlagVariants())}getFlagsWithDetails(){var e=this._instance.get_property(pt),t=this._instance.get_property(ro),i=this._instance.get_property(oo);if(!i&&!t)return e||{};var s=Ce({},e||{}),r=[...new Set([...Object.keys(i||{}),...Object.keys(t||{})])];for(var n of r){var o,a,l=s[n],c=null==t?void 0:t[n],u=A(c)?null!==(o=null==l?void 0:l.enabled)&&void 0!==o&&o:!!c,h=A(c)?l.variant:"string"==typeof c?c:void 0,d=null==i?void 0:i[n],p=y({},l,{enabled:u,variant:u?null!=h?h:null==l?void 0:l.variant:void 0});u!==(null==l?void 0:l.enabled)&&(p.original_enabled=null==l?void 0:l.enabled),h!==(null==l?void 0:l.variant)&&(p.original_variant=null==l?void 0:l.variant),d&&(p.metadata=y({},null==l?void 0:l.metadata,{payload:d,original_payload:null==l||null==(a=l.metadata)?void 0:a.payload})),s[n]=p}return this.be||(io.warn(" Overriding feature flag details!",{flagDetails:e,overriddenPayloads:i,finalDetails:s}),this.be=!0),s}getFlagVariants(){var e=this._instance.get_property(ht),t=this._instance.get_property(ro);if(!t)return e||{};for(var i=Ce({},e),s=Object.keys(t),r=0;r<s.length;r++)i[s[r]]=t[s[r]];return this.be||(io.warn(" Overriding feature flags!",{enabledFlags:e,overriddenFlags:t,finalFlags:i}),this.be=!0),i}getFlagPayloads(){var e=this._instance.get_property(no),t=this._instance.get_property(oo);if(!t)return e||{};for(var i=Ce({},e||{}),s=Object.keys(t),r=0;r<s.length;r++)i[s[r]]=t[s[r]];return this.be||(io.warn(" Overriding feature flag payloads!",{flagPayloads:e,overriddenPayloads:t,finalPayloads:i}),this.be=!0),i}reloadFeatureFlags(){this.ke||this._instance.config.advanced_disable_feature_flags||this.Pe||(this.Pe=setTimeout(()=>{this.Re()},5))}Ie(){clearTimeout(this.Pe),this.Pe=void 0}ensureFlagsLoaded(){this.we||this.Se||this.Pe||this.reloadFeatureFlags()}setAnonymousDistinctId(e){this.$anon_distinct_id=e}setReloadingPaused(e){this.ke=e}Re(e){var t;if(this.Ie(),!this._instance.L())if(this.Se)this.$e=!0;else{var i={token:this._instance.config.token,distinct_id:this._instance.get_distinct_id(),groups:this._instance.getGroups(),$anon_distinct_id:this.$anon_distinct_id,person_properties:y({},(null==(t=this._instance.persistence)?void 0:t.get_initial_props())||{},this._instance.get_property(gt)||{}),group_properties:this._instance.get_property(vt)};(null!=e&&e.disableFlags||this._instance.config.advanced_disable_feature_flags)&&(i.disable_flags=!0);var s=this._instance.config.__preview_remote_config,r=s?"/flags/?v=2":"/flags/?v=2&config=true",n=this._instance.config.advanced_only_evaluate_survey_feature_flags?"&only_evaluate_survey_feature_flags=true":"",o=this._instance.requestRouter.endpointFor("api",r+n);s&&(i.timezone=Qn()),this.Se=!0,this._instance.Te({method:"POST",url:o,data:i,compression:this._instance.config.disable_compression?void 0:li.Base64,timeout:this._instance.config.feature_flag_request_timeout_ms,callback:e=>{var t,s,r=!0;if(200===e.statusCode&&(this.$e||(this.$anon_distinct_id=void 0),r=!1),this.Se=!1,this.xe||(this.xe=!0,this._instance.Ce(null!==(s=e.json)&&void 0!==s?s:{})),!i.disable_flags||this.$e)if(this.Ee=!r,e.json&&null!=(t=e.json.quotaLimited)&&t.includes(co.FeatureFlags))io.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;i.disable_flags||this.receivedFeatureFlags(null!==(n=e.json)&&void 0!==n?n:{},r),this.$e&&(this.$e=!1,this.Re())}}})}}getFeatureFlag(e,t){if(void 0===t&&(t={}),this.we||this.getFlags()&&this.getFlags().length>0){var i=this.getFlagVariants()[e],s=""+i,r=this._instance.get_property(ao)||void 0,n=this._instance.get_property(mt)||{};if((t.send_event||!("send_event"in t))&&(!(e in n)||!n[e].includes(s))){var o,a,l,c,u,h,d,p,g;$(n[e])?n[e].push(s):n[e]=[s],null==(o=this._instance.persistence)||o.register({[mt]:n});var v=this.getFeatureFlagDetails(e),_={$feature_flag:e,$feature_flag_response:i,$feature_flag_payload:this.getFeatureFlagPayload(e)||null,$feature_flag_request_id:r,$feature_flag_bootstrapped_response:(null==(a=this._instance.config.bootstrap)||null==(a=a.featureFlags)?void 0:a[e])||null,$feature_flag_bootstrapped_payload:(null==(l=this._instance.config.bootstrap)||null==(l=l.featureFlagPayloads)?void 0:l[e])||null,$used_bootstrap_value:!this.Ee};A(null==v||null==(c=v.metadata)?void 0:c.version)||(_.$feature_flag_version=v.metadata.version);var f,m=null!==(u=null==v||null==(h=v.reason)?void 0:h.description)&&void 0!==u?u:null==v||null==(d=v.reason)?void 0:d.code;m&&(_.$feature_flag_reason=m),null!=v&&null!=(p=v.metadata)&&p.id&&(_.$feature_flag_id=v.metadata.id),A(null==v?void 0:v.original_variant)&&A(null==v?void 0:v.original_enabled)||(_.$feature_flag_original_response=A(v.original_variant)?v.original_enabled:v.original_variant),null!=v&&null!=(g=v.metadata)&&g.original_payload&&(_.$feature_flag_original_payload=null==v||null==(f=v.metadata)?void 0:f.original_payload),this._instance.capture("$feature_flag_called",_)}return i}io.warn('getFeatureFlag for key "'+e+"\" failed. Feature flags didn't load in time.")}getFeatureFlagDetails(e){return this.getFlagsWithDetails()[e]}getFeatureFlagPayload(e){return this.getFlagPayloads()[e]}getRemoteConfigPayload(e,t){var i=this._instance.config.token;this._instance.Te({method:"POST",url:this._instance.requestRouter.endpointFor("api","/flags/?v=2&config=true"),data:{distinct_id:this._instance.get_distinct_id(),token:i},compression:this._instance.config.disable_compression?void 0:li.Base64,timeout:this._instance.config.feature_flag_request_timeout_ms,callback:i=>{var s,r=null==(s=i.json)?void 0:s.featureFlagPayloads;t((null==r?void 0:r[e])||void 0)}})}isFeatureEnabled(e,t){if(void 0===t&&(t={}),this.we||this.getFlags()&&this.getFlags().length>0){var i=this.getFeatureFlag(e,t);return A(i)?void 0:!!i}io.warn('isFeatureEnabled for key "'+e+"\" failed. Feature flags didn't load in time.")}addFeatureFlagsHandler(e){this.featureFlagEventHandlers.push(e)}removeFeatureFlagsHandler(e){this.featureFlagEventHandlers=this.featureFlagEventHandlers.filter(t=>t!==e)}receivedFeatureFlags(e,t){if(this._instance.persistence){this.we=!0;var i=this.getFlagVariants(),s=this.getFlagPayloads(),r=this.getFlagsWithDetails();!function(e,t,i,s,r){void 0===i&&(i={}),void 0===s&&(s={}),void 0===r&&(r={});var n=(e=>{var t=e.flags;return t?(e.featureFlags=Object.fromEntries(Object.keys(t).map(e=>{var i;return[e,null!==(i=t[e].variant)&&void 0!==i?i:t[e].enabled]})),e.featureFlagPayloads=Object.fromEntries(Object.keys(t).filter(e=>t[e].enabled).filter(e=>{var i;return null==(i=t[e].metadata)?void 0:i.payload}).map(e=>{var i;return[e,null==(i=t[e].metadata)?void 0:i.payload]}))):io.warn("Using an older version of the feature flags endpoint. Please upgrade your PostHog server to the latest version"),e})(e),o=n.flags,a=n.featureFlags,l=n.featureFlagPayloads;if(a){var c=e.requestId;if($(a)){io.warn("v1 of the feature flags endpoint is deprecated. Please use the latest version.");var u={};if(a)for(var h=0;h<a.length;h++)u[a[h]]=!0;t&&t.register({[so]:a,[ht]:u})}else{var d=a,p=l,g=o;e.errorsWhileComputingFlags&&(d=y({},i,d),p=y({},s,p),g=y({},r,g)),t&&t.register(y({[so]:Object.keys(lo(d)),[ht]:d||{},[no]:p||{},[pt]:g||{}},c?{[ao]:c}:{}))}}}(e,this._instance.persistence,i,s,r),this.Me(t)}}override(e,t){void 0===t&&(t=!1),io.warn("override is deprecated. Please use overrideFeatureFlags instead."),this.overrideFeatureFlags({flags:e,suppressWarning:t})}overrideFeatureFlags(e){if(!this._instance.__loaded||!this._instance.persistence)return io.uninitializedWarning("posthog.featureFlags.overrideFeatureFlags");if(!1===e)return this._instance.persistence.unregister(ro),this._instance.persistence.unregister(oo),void this.Me();if(e&&"object"==typeof e&&("flags"in e||"payloads"in e)){var t,i=e;if(this.be=Boolean(null!==(t=i.suppressWarning)&&void 0!==t&&t),"flags"in i)if(!1===i.flags)this._instance.persistence.unregister(ro);else if(i.flags)if($(i.flags)){for(var s={},r=0;r<i.flags.length;r++)s[i.flags[r]]=!0;this._instance.persistence.register({[ro]:s})}else this._instance.persistence.register({[ro]:i.flags});return"payloads"in i&&(!1===i.payloads?this._instance.persistence.unregister(oo):i.payloads&&this._instance.persistence.register({[oo]:i.payloads})),void this.Me()}this.Me()}onFeatureFlags(e){if(this.addFeatureFlagsHandler(e),this.we){var{flags:t,flagVariants:i}=this.Oe();e(t,i)}return()=>this.removeFeatureFlagsHandler(e)}updateEarlyAccessFeatureEnrollment(e,t,i){var s,r=(this._instance.get_property(dt)||[]).find(t=>t.flagKey===e),n={["$feature_enrollment/"+e]:t},o={$feature_flag:e,$feature_enrollment:t,$set:n};r&&(o.$early_access_feature_name=r.name),i&&(o.$feature_enrollment_stage=i),this._instance.capture("$feature_enrollment_update",o),this.setPersonPropertiesForFlags(n,!1);var a=y({},this.getFlagVariants(),{[e]:t});null==(s=this._instance.persistence)||s.register({[so]:Object.keys(lo(a)),[ht]:a}),this.Me()}getEarlyAccessFeatures(e,t,i){void 0===t&&(t=!1);var s=this._instance.get_property(dt),r=i?"&"+i.map(e=>"stage="+e).join("&"):"";if(s&&!t)return e(s);this._instance.Te({url:this._instance.requestRouter.endpointFor("api","/api/early_access_features/?token="+this._instance.config.token+r),method:"GET",callback:t=>{var i,s;if(t.json){var r=t.json.earlyAccessFeatures;return null==(i=this._instance.persistence)||i.unregister(dt),null==(s=this._instance.persistence)||s.register({[dt]:r}),e(r)}}})}Oe(){var e=this.getFlags(),t=this.getFlagVariants();return{flags:e.filter(e=>t[e]),flagVariants:Object.keys(t).filter(e=>t[e]).reduce((e,i)=>(e[i]=t[i],e),{})}}Me(e){var{flags:t,flagVariants:i}=this.Oe();this.featureFlagEventHandlers.forEach(s=>s(t,i,{errorsLoading:e}))}setPersonPropertiesForFlags(e,t){void 0===t&&(t=!0);var i=this._instance.get_property(gt)||{};this._instance.register({[gt]:y({},i,e)}),t&&this._instance.reloadFeatureFlags()}resetPersonPropertiesForFlags(){this._instance.unregister(gt)}setGroupPropertiesForFlags(e,t){void 0===t&&(t=!0);var i=this._instance.get_property(vt)||{};0!==Object.keys(i).length&&Object.keys(i).forEach(t=>{i[t]=y({},i[t],e[t]),delete e[t]}),this._instance.register({[vt]:y({},i,e)}),t&&this._instance.reloadFeatureFlags()}resetGroupPropertiesForFlags(e){if(e){var t=this._instance.get_property(vt)||{};this._instance.register({[vt]:y({},t,{[e]:{}})})}else this._instance.unregister(vt)}reset(){this.we=!1,this.Se=!1,this.ke=!1,this.$e=!1,this.xe=!1,this.Ee=!1,this.$anon_distinct_id=void 0,this.Ie(),this.be=!1}}var ho=["cookie","localstorage","localstorage+cookie","sessionstorage","memory"];class po{constructor(e,t){this.A=e,this.props={},this.Fe=!1,this.Ae=(e=>{var t="";return e.token&&(t=e.token.replace(/\+/g,"PL").replace(/\//g,"SL").replace(/=/g,"EQ")),e.persistence_name?"ph_"+e.persistence_name:"ph_"+t+"_posthog"})(e),this.it=this.De(e),this.load(),e.debug&&Se.info("Persistence loaded",e.persistence,y({},this.props)),this.update_config(e,e,t),this.save()}isDisabled(){return!!this.je}De(e){-1===ho.indexOf(e.persistence.toLowerCase())&&(Se.critical("Unknown persistence type "+e.persistence+"; falling back to localStorage+cookie"),e.persistence="localStorage+cookie");var t=e.persistence.toLowerCase();return"localstorage"===t&&Ci.G()?Ci:"localstorage+cookie"===t&&Ai.G()?Ai:"sessionstorage"===t&&Di.G()?Di:"memory"===t?Mi:"cookie"===t?$i:Ai.G()?Ai:$i}properties(){var e={};return Re(this.props,function(t,i){if(i===ht&&C(t))for(var s=Object.keys(t),r=0;r<s.length;r++)e["$feature/"+s[r]]=t[s[r]];else o=i,l=!1,(L(n=Ft)?l:a&&n.indexOf===a?-1!=n.indexOf(o):(Re(n,function(e){if(l||(l=e===o))return Fe}),l))||(e[i]=t);var n,o,l}),e}load(){if(!this.je){var e=this.it.K(this.Ae);e&&(this.props=Ce({},e))}}save(){this.je||this.it.Y(this.Ae,this.props,this.Le,this.Ne,this.Ue,this.A.debug)}remove(){this.it.X(this.Ae,!1),this.it.X(this.Ae,!0)}clear(){this.remove(),this.props={}}register_once(e,t,i){if(C(e)){A(t)&&(t="None"),this.Le=A(i)?this.ze:i;var s=!1;if(Re(e,(e,i)=>{this.props.hasOwnProperty(i)&&this.props[i]!==t||(this.props[i]=e,s=!0)}),s)return this.save(),!0}return!1}register(e,t){if(C(e)){this.Le=A(t)?this.ze:t;var i=!1;if(Re(e,(t,s)=>{e.hasOwnProperty(s)&&this.props[s]!==t&&(this.props[s]=t,i=!0)}),i)return this.save(),!0}return!1}unregister(e){e in this.props&&(delete this.props[e],this.save())}update_campaign_params(){if(!this.Fe){var e=Wn(this.A.custom_campaign_params,this.A.mask_personal_data_properties,this.A.custom_personal_data_properties);T(Le(e))||this.register(e),this.Fe=!0}}update_search_keyword(){var e;this.register((e=null==c?void 0:c.referrer)?Yn(e):{})}update_referrer_info(){var e;this.register_once({$referrer:Jn(),$referring_domain:null!=c&&c.referrer&&(null==(e=hi(c.referrer))?void 0:e.host)||"$direct"},void 0)}set_initial_person_info(){this.props[Et]||this.props[kt]||this.register_once({[St]:Kn(this.A.mask_personal_data_properties,this.A.custom_personal_data_properties)},void 0)}get_initial_props(){var e={};Re([kt,Et],t=>{var i=this.props[t];i&&Re(i,function(t,i){e["$initial_"+S(i)]=t})});var t,i,s=this.props[St];if(s){var r=(t=Zn(s),i={},Re(t,function(e,t){i["$initial_"+S(t)]=e}),i);Ce(e,r)}return e}safe_merge(e){return Re(this.props,function(t,i){i in e||(e[i]=t)}),e}update_config(e,t,i){if(this.ze=this.Le=e.cookie_expiration,this.set_disabled(e.disable_persistence||!!i),this.set_cross_subdomain(e.cross_subdomain_cookie),this.set_secure(e.secure_cookie),e.persistence!==t.persistence){var s=this.De(e),r=this.props;this.clear(),this.it=s,this.props=r,this.save()}}set_disabled(e){this.je=e,this.je?this.remove():this.save()}set_cross_subdomain(e){e!==this.Ne&&(this.Ne=e,this.remove(),this.save())}set_secure(e){e!==this.Ue&&(this.Ue=e,this.remove(),this.save())}set_event_timer(e,t){var i=this.props[Ue]||{};i[e]=t,this.props[Ue]=i,this.save()}remove_event_timer(e){var t=(this.props[Ue]||{})[e];return A(t)||(delete this.props[Ue][e],this.save()),t}get_property(e){return this.props[e]}set_property(e,t){this.props[e]=t,this.save()}}var go=function(e){return e.Button="button",e.Tab="tab",e.Selector="selector",e}({}),vo=function(e){return e.TopLeft="top_left",e.TopRight="top_right",e.TopCenter="top_center",e.MiddleLeft="middle_left",e.MiddleRight="middle_right",e.MiddleCenter="middle_center",e.Left="left",e.Center="center",e.Right="right",e.NextToTrigger="next_to_trigger",e}({}),_o=function(e){return e.Popover="popover",e.API="api",e.Widget="widget",e.ExternalSurvey="external_survey",e}({}),fo=function(e){return e.Open="open",e.MultipleChoice="multiple_choice",e.SingleChoice="single_choice",e.Rating="rating",e.Link="link",e}({}),mo=function(e){return e.NextQuestion="next_question",e.End="end",e.ResponseBased="response_based",e.SpecificQuestion="specific_question",e}({}),yo=function(e){return e.Once="once",e.Recurring="recurring",e.Always="always",e}({}),bo=function(e){return e.SHOWN="survey shown",e.DISMISSED="survey dismissed",e.SENT="survey sent",e}({}),wo=function(e){return e.SURVEY_ID="$survey_id",e.SURVEY_NAME="$survey_name",e.SURVEY_RESPONSE="$survey_response",e.SURVEY_ITERATION="$survey_iteration",e.SURVEY_ITERATION_START_DATE="$survey_iteration_start_date",e.SURVEY_PARTIALLY_COMPLETED="$survey_partially_completed",e.SURVEY_SUBMISSION_ID="$survey_submission_id",e.SURVEY_QUESTIONS="$survey_questions",e.SURVEY_COMPLETED="$survey_completed",e}({}),Eo=function(e){return e.Popover="popover",e.Inline="inline",e}({});class ko{constructor(){this.qe={},this.qe={}}on(e,t){return this.qe[e]||(this.qe[e]=[]),this.qe[e].push(t),()=>{this.qe[e]=this.qe[e].filter(e=>e!==t)}}emit(e,t){for(var i of this.qe[e]||[])i(t);for(var s of this.qe["*"]||[])s(e,t)}}class So{constructor(e){this.Be=new ko,this.He=(e,t)=>this.We(e,t)&&this.Ge(e,t)&&this.Ve(e,t),this.We=(e,t)=>null==t||!t.event||(null==e?void 0:e.event)===(null==t?void 0:t.event),this._instance=e,this.Je=new Set,this.Ke=new Set}init(){var e,t;A(null==(e=this._instance)?void 0:e.Ye)||null==(t=this._instance)||t.Ye((e,t)=>{this.on(e,t)})}register(e){var t,i;if(!A(null==(t=this._instance)?void 0:t.Ye)&&(e.forEach(e=>{var t,i;null==(t=this.Ke)||t.add(e),null==(i=e.steps)||i.forEach(e=>{var t;null==(t=this.Je)||t.add((null==e?void 0:e.event)||"")})}),null!=(i=this._instance)&&i.autocapture)){var s,r=new Set;e.forEach(e=>{var t;null==(t=e.steps)||t.forEach(e=>{null!=e&&e.selector&&r.add(null==e?void 0:e.selector)})}),null==(s=this._instance)||s.autocapture.setElementSelectors(r)}}on(e,t){var i;null!=t&&0!=e.length&&(this.Je.has(e)||this.Je.has(null==t?void 0:t.event))&&this.Ke&&(null==(i=this.Ke)?void 0:i.size)>0&&this.Ke.forEach(e=>{this.Xe(t,e)&&this.Be.emit("actionCaptured",e.name)})}Qe(e){this.onAction("actionCaptured",t=>e(t))}Xe(e,t){if(null==(null==t?void 0:t.steps))return!1;for(var i of t.steps)if(this.He(e,i))return!0;return!1}onAction(e,t){return this.Be.on(e,t)}Ge(e,t){if(null!=t&&t.url){var i,s=null==e||null==(i=e.properties)?void 0:i.$current_url;if(!s||"string"!=typeof s)return!1;if(!So.Ze(s,null==t?void 0:t.url,(null==t?void 0:t.url_matching)||"contains"))return!1}return!0}static Ze(e,t,i){switch(i){case"regex":return!!s&&Hr(e,t);case"exact":return t===e;case"contains":var r=So.tr(t).replace(/_/g,".").replace(/%/g,".*");return Hr(e,r);default:return!1}}static tr(e){return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}Ve(e,t){if((null!=t&&t.href||null!=t&&t.tag_name||null!=t&&t.text)&&!this.ir(e).some(e=>!(null!=t&&t.href&&!So.Ze(e.href||"",null==t?void 0:t.href,(null==t?void 0:t.href_matching)||"exact")||null!=t&&t.tag_name&&e.tag_name!==(null==t?void 0:t.tag_name)||null!=t&&t.text&&!So.Ze(e.text||"",null==t?void 0:t.text,(null==t?void 0:t.text_matching)||"exact")&&!So.Ze(e.$el_text||"",null==t?void 0:t.text,(null==t?void 0:t.text_matching)||"exact"))))return!1;if(null!=t&&t.selector){var i,s=null==e||null==(i=e.properties)?void 0:i.$element_selectors;if(!s)return!1;if(!s.includes(null==t?void 0:t.selector))return!1}return!0}ir(e){return null==(null==e?void 0:e.properties.$elements)?[]:null==e?void 0:e.properties.$elements}}var xo=xe("[Surveys]"),Io="seenSurvey_",Po=(e,t)=>{var i="$survey_"+t+"/"+e.id;return e.current_iteration&&e.current_iteration>0&&(i="$survey_"+t+"/"+e.id+"/"+e.current_iteration),i},Fo=e=>{var t=""+Io+e.id;return e.current_iteration&&e.current_iteration>0&&(t=""+Io+e.id+"_"+e.current_iteration),t},$o=[_o.Popover,_o.Widget,_o.API],Ro={ignoreConditions:!1,ignoreDelay:!1,displayType:Eo.Popover};class Co{constructor(e){this._instance=e,this.er=new Map,this.rr=new Map}register(e){var t;A(null==(t=this._instance)?void 0:t.Ye)||(this.sr(e),this.nr(e))}nr(e){var t=e.filter(e=>{var t,i;return(null==(t=e.conditions)?void 0:t.actions)&&(null==(i=e.conditions)||null==(i=i.actions)||null==(i=i.values)?void 0:i.length)>0});0!==t.length&&(null==this.ar&&(this.ar=new So(this._instance),this.ar.init(),this.ar.Qe(e=>{this.onAction(e)})),t.forEach(e=>{var t,i,s,r,n;e.conditions&&null!=(t=e.conditions)&&t.actions&&null!=(i=e.conditions)&&null!=(i=i.actions)&&i.values&&(null==(s=e.conditions)||null==(s=s.actions)||null==(s=s.values)?void 0:s.length)>0&&(null==(r=this.ar)||r.register(e.conditions.actions.values),null==(n=e.conditions)||null==(n=n.actions)||null==(n=n.values)||n.forEach(t=>{if(t&&t.name){var i=this.rr.get(t.name);i&&i.push(e.id),this.rr.set(t.name,i||[e.id])}}))}))}sr(e){var t;0!==e.filter(e=>{var t,i;return(null==(t=e.conditions)?void 0:t.events)&&(null==(i=e.conditions)||null==(i=i.events)||null==(i=i.values)?void 0:i.length)>0}).length&&(null==(t=this._instance)||t.Ye((e,t)=>{this.onEvent(e,t)}),e.forEach(e=>{var t;null==(t=e.conditions)||null==(t=t.events)||null==(t=t.values)||t.forEach(t=>{if(t&&t.name){var i=this.er.get(t.name);i&&i.push(e.id),this.er.set(t.name,i||[e.id])}})}))}onEvent(e,t){var i,s,r=(null==(i=this._instance)||null==(i=i.persistence)?void 0:i.props[ft])||[];if(bo.SHOWN===e&&t&&r.length>0){var n;xo.info("survey event matched, removing survey from activated surveys",{event:e,eventPayload:t,existingActivatedSurveys:r});var o=null==t||null==(n=t.properties)?void 0:n.$survey_id;if(o){var a=r.indexOf(o);a>=0&&(r.splice(a,1),this.lr(r))}}else if(this.er.has(e)){xo.info("survey event name matched",{event:e,eventPayload:t,surveys:this.er.get(e)});var l=[];null==(s=this._instance)||s.getSurveys(t=>{l=t.filter(t=>{var i;return null==(i=this.er.get(e))?void 0:i.includes(t.id)})});var c=l.filter(i=>{var s,r=null==(s=i.conditions)||null==(s=s.events)||null==(s=s.values)?void 0:s.find(t=>t.name===e);return!!r&&(!r.propertyFilters||Object.entries(r.propertyFilters).every(e=>{var i,[s,r]=e,n=null==t||null==(i=t.properties)?void 0:i[s];if(A(n)||L(n))return!1;var o=[String(n)],a=qr[r.operator];return a?a(r.values,o):(xo.warn("Unknown property comparison operator: "+r.operator),!1)}))});this.lr(r.concat(c.map(e=>e.id)||[]))}}onAction(e){var t,i=(null==(t=this._instance)||null==(t=t.persistence)?void 0:t.props[ft])||[];this.rr.has(e)&&this.lr(i.concat(this.rr.get(e)||[]))}lr(e){var t;xo.info("updating activated surveys",{activatedSurveys:e}),null==(t=this._instance)||null==(t=t.persistence)||t.register({[ft]:[...new Set(e)]})}getSurveys(){var e;return(null==(e=this._instance)||null==(e=e.persistence)?void 0:e.props[ft])||[]}getEventToSurveys(){return this.er}ur(){return this.ar}}class To{constructor(e){this.hr=void 0,this._surveyManager=null,this.dr=!1,this.vr=!1,this.cr=[],this._instance=e,this._surveyEventReceiver=null}onRemoteConfig(e){if(!this._instance.config.disable_surveys){var t=e.surveys;if(D(t))return xo.warn("Flags not loaded yet. Not loading surveys.");var i=$(t);this.hr=i?t.length>0:t,xo.info("flags response received, isSurveysEnabled: "+this.hr),this.loadIfEnabled()}}reset(){localStorage.removeItem("lastSeenSurveyDate");for(var e=[],t=0;t<localStorage.length;t++){var i=localStorage.key(t);(null!=i&&i.startsWith(Io)||null!=i&&i.startsWith("inProgressSurvey_"))&&e.push(i)}e.forEach(e=>localStorage.removeItem(e))}loadIfEnabled(){if(!this._surveyManager)if(this.vr)xo.info("Already initializing surveys, skipping...");else if(this._instance.config.disable_surveys)xo.info("Disabled. Not loading surveys.");else if(this._instance.config.cookieless_mode&&this._instance.consent.isOptedOut())xo.info("Not loading surveys in cookieless mode without consent.");else{var e=null==v?void 0:v.__PosthogExtensions__;if(e){if(!A(this.hr)||this._instance.config.advanced_enable_surveys){var t=this.hr||this._instance.config.advanced_enable_surveys;this.vr=!0;try{var i=e.generateSurveys;if(i)return void this.pr(i,t);var s=e.loadExternalDependency;if(!s)return void this.gr("PostHog loadExternalDependency extension not found.");s(this._instance,"surveys",i=>{i||!e.generateSurveys?this.gr("Could not load surveys script",i):this.pr(e.generateSurveys,t)})}catch(e){throw this.gr("Error initializing surveys",e),e}finally{this.vr=!1}}}else xo.error("PostHog Extensions not found.")}}pr(e,t){this._surveyManager=e(this._instance,t),this._surveyEventReceiver=new Co(this._instance),xo.info("Surveys loaded successfully"),this._r({isLoaded:!0})}gr(e,t){xo.error(e,t),this._r({isLoaded:!1,error:e})}onSurveysLoaded(e){return this.cr.push(e),this._surveyManager&&this._r({isLoaded:!0}),()=>{this.cr=this.cr.filter(t=>t!==e)}}getSurveys(e,t){if(void 0===t&&(t=!1),this._instance.config.disable_surveys)return xo.info("Disabled. Not loading surveys."),e([]);var i=this._instance.get_property(_t);if(i&&!t)return e(i,{isLoaded:!0});if(this.dr)return e([],{isLoaded:!1,error:"Surveys are already being loaded"});try{this.dr=!0,this._instance.Te({url:this._instance.requestRouter.endpointFor("api","/api/surveys/?token="+this._instance.config.token),method:"GET",timeout:this._instance.config.surveys_request_timeout_ms,callback:t=>{var i;this.dr=!1;var s=t.statusCode;if(200!==s||!t.json){var r="Surveys API could not be loaded, status: "+s;return xo.error(r),e([],{isLoaded:!1,error:r})}var n,o=t.json.surveys||[],a=o.filter(e=>function(e){return!(!e.start_date||e.end_date)}(e)&&(function(e){var t;return!(null==(t=e.conditions)||null==(t=t.events)||null==(t=t.values)||!t.length)}(e)||function(e){var t;return!(null==(t=e.conditions)||null==(t=t.actions)||null==(t=t.values)||!t.length)}(e)));return a.length>0&&(null==(n=this._surveyEventReceiver)||n.register(a)),null==(i=this._instance.persistence)||i.register({[_t]:o}),e(o,{isLoaded:!0})}})}catch(e){throw this.dr=!1,e}}_r(e){for(var t of this.cr)try{if(!e.isLoaded)return t([],e);this.getSurveys(t)}catch(e){xo.error("Error in survey callback",e)}}getActiveMatchingSurveys(e,t){if(void 0===t&&(t=!1),!D(this._surveyManager))return this._surveyManager.getActiveMatchingSurveys(e,t);xo.warn("init was not called")}mr(e){var t=null;return this.getSurveys(i=>{var s;t=null!==(s=i.find(t=>t.id===e))&&void 0!==s?s:null}),t}yr(e){if(D(this._surveyManager))return{eligible:!1,reason:"SDK is not enabled or survey functionality is not yet loaded"};var t="string"==typeof e?this.mr(e):e;return t?this._surveyManager.checkSurveyEligibility(t):{eligible:!1,reason:"Survey not found"}}canRenderSurvey(e){if(D(this._surveyManager))return xo.warn("init was not called"),{visible:!1,disabledReason:"SDK is not enabled or survey functionality is not yet loaded"};var t=this.yr(e);return{visible:t.eligible,disabledReason:t.reason}}canRenderSurveyAsync(e,t){return D(this._surveyManager)?(xo.warn("init was not called"),Promise.resolve({visible:!1,disabledReason:"SDK is not enabled or survey functionality is not yet loaded"})):new Promise(i=>{this.getSurveys(t=>{var s,r=null!==(s=t.find(t=>t.id===e))&&void 0!==s?s:null;if(r){var n=this.yr(r);i({visible:n.eligible,disabledReason:n.reason})}else i({visible:!1,disabledReason:"Survey not found"})},t)})}renderSurvey(e,t){var i;if(D(this._surveyManager))xo.warn("init was not called");else{var s="string"==typeof e?this.mr(e):e;if(null!=s&&s.id)if($o.includes(s.type)){var r=null==c?void 0:c.querySelector(t);if(r)return null!=(i=s.appearance)&&i.surveyPopupDelaySeconds?(xo.info("Rendering survey "+s.id+" with delay of "+s.appearance.surveyPopupDelaySeconds+" seconds"),void setTimeout(()=>{var e,t;xo.info("Rendering survey "+s.id+" with delay of "+(null==(e=s.appearance)?void 0:e.surveyPopupDelaySeconds)+" seconds"),null==(t=this._surveyManager)||t.renderSurvey(s,r),xo.info("Survey "+s.id+" rendered")},1e3*s.appearance.surveyPopupDelaySeconds)):void this._surveyManager.renderSurvey(s,r);xo.warn("Survey element not found")}else xo.warn("Surveys of type "+s.type+" cannot be rendered in the app");else xo.warn("Survey not found")}}displaySurvey(e,t){var i;if(D(this._surveyManager))xo.warn("init was not called");else{var s=this.mr(e);if(s){var r=s;if(null!=(i=s.appearance)&&i.surveyPopupDelaySeconds&&t.ignoreDelay&&(r=y({},s,{appearance:y({},s.appearance,{surveyPopupDelaySeconds:0})})),!1===t.ignoreConditions){var n=this.canRenderSurvey(s);if(!n.visible)return void xo.warn("Survey is not eligible to be displayed: ",n.disabledReason)}t.displayType!==Eo.Inline?this._surveyManager.handlePopoverSurvey(r):this.renderSurvey(r,t.selector)}else xo.warn("Survey not found")}}}var Ao=xe("[RateLimiter]");class Oo{constructor(e){var t,i;this.serverLimits={},this.lastEventRateLimited=!1,this.checkForLimiting=e=>{var t=e.text;if(t&&t.length)try{(JSON.parse(t).quota_limited||[]).forEach(e=>{Ao.info((e||"events")+" is quota limited."),this.serverLimits[e]=(new Date).getTime()+6e4})}catch(e){return void Ao.warn('could not rate limit - continuing. Error: "'+(null==e?void 0:e.message)+'"',{text:t})}},this.instance=e,this.captureEventsPerSecond=(null==(t=e.config.rate_limiting)?void 0:t.events_per_second)||10,this.captureEventsBurstLimit=Math.max((null==(i=e.config.rate_limiting)?void 0:i.events_burst_limit)||10*this.captureEventsPerSecond,this.captureEventsPerSecond),this.lastEventRateLimited=this.clientRateLimitContext(!0).isRateLimited}clientRateLimitContext(e){var t,i,s;void 0===e&&(e=!1);var r=(new Date).getTime(),n=null!==(t=null==(i=this.instance.persistence)?void 0:i.get_property(wt))&&void 0!==t?t:{tokens:this.captureEventsBurstLimit,last:r};n.tokens+=(r-n.last)/1e3*this.captureEventsPerSecond,n.last=r,n.tokens>this.captureEventsBurstLimit&&(n.tokens=this.captureEventsBurstLimit);var o=n.tokens<1;return o||e||(n.tokens=Math.max(0,n.tokens-1)),!o||this.lastEventRateLimited||e||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==(s=this.instance.persistence)||s.set_property(wt,n),{isRateLimited:o,remainingTokens:n.tokens}}isServerRateLimited(e){var t=this.serverLimits[e||"events"]||!1;return!1!==t&&(new Date).getTime()<t}}var Mo=xe("[RemoteConfig]");class Lo{constructor(e){this._instance=e}get remoteConfig(){var e;return null==(e=v._POSTHOG_REMOTE_CONFIG)||null==(e=e[this._instance.config.token])?void 0:e.config}br(e){var t,i;null!=(t=v.__PosthogExtensions__)&&t.loadExternalDependency?null==(i=v.__PosthogExtensions__)||null==i.loadExternalDependency||i.loadExternalDependency(this._instance,"remote-config",()=>e(this.remoteConfig)):(Mo.error("PostHog Extensions not found. Cannot load remote config."),e())}wr(e){this._instance.Te({method:"GET",url:this._instance.requestRouter.endpointFor("assets","/array/"+this._instance.config.token+"/config"),callback:t=>{e(t.json)}})}load(){try{if(this.remoteConfig)return Mo.info("Using preloaded remote config",this.remoteConfig),void this.Ce(this.remoteConfig);if(this._instance.L())return void Mo.warn("Remote config is disabled. Falling back to local config.");this.br(e=>{if(!e)return Mo.info("No config found after loading remote JS config. Falling back to JSON."),void this.wr(e=>{this.Ce(e)});this.Ce(e)})}catch(e){Mo.error("Error loading remote config",e)}}Ce(e){e?this._instance.config.__preview_remote_config?(this._instance.Ce(e),!1!==e.hasFeatureFlags&&this._instance.featureFlags.ensureFlagsLoaded()):Mo.info("__preview_remote_config is disabled. Logging config instead",e):Mo.error("Failed to fetch remote config from PostHog.")}}var Do=3e3;class No{constructor(e,t){this.Sr=!0,this.kr=[],this.$r=V((null==t?void 0:t.flush_interval_ms)||Do,250,5e3,Se.createLogger("flush interval"),Do),this.Er=e}enqueue(e){this.kr.push(e),this.Pr||this.Rr()}unload(){this.Ir();var e=this.kr.length>0?this.Tr():{},t=Object.values(e);[...t.filter(e=>0===e.url.indexOf("/e")),...t.filter(e=>0!==e.url.indexOf("/e"))].map(e=>{this.Er(y({},e,{transport:"sendBeacon"}))})}enable(){this.Sr=!1,this.Rr()}Rr(){var e=this;this.Sr||(this.Pr=setTimeout(()=>{if(this.Ir(),this.kr.length>0){var t=this.Tr(),i=function(){var i=t[s],r=(new Date).getTime();i.data&&$(i.data)&&Re(i.data,e=>{e.offset=Math.abs(e.timestamp-r),delete e.timestamp}),e.Er(i)};for(var s in t)i()}},this.$r))}Ir(){clearTimeout(this.Pr),this.Pr=void 0}Tr(){var e={};return Re(this.kr,t=>{var i,s=t,r=(s?s.batchKey:null)||s.url;A(e[r])&&(e[r]=y({},s,{data:[]})),null==(i=e[r].data)||i.push(s.data)}),this.kr=[],e}}var Ho=["retriesPerformedSoFar"];class jo{constructor(e){this.Cr=!1,this.Mr=3e3,this.kr=[],this._instance=e,this.kr=[],this.Or=!0,!A(s)&&"onLine"in s.navigator&&(this.Or=s.navigator.onLine,je(s,"online",()=>{this.Or=!0,this.ne()}),je(s,"offline",()=>{this.Or=!1}))}get length(){return this.kr.length}retriableRequest(e){var{retriesPerformedSoFar:t}=e,i=b(e,Ho);N(t)&&t>0&&(i.url=Mr(i.url,{retry_count:t})),this._instance.Te(y({},i,{callback:e=>{200!==e.statusCode&&(e.statusCode<400||e.statusCode>=500)&&(null!=t?t:0)<10?this.Fr(y({retriesPerformedSoFar:t},i)):null==i.callback||i.callback(e)}}))}Fr(e){var t=e.retriesPerformedSoFar||0;e.retriesPerformedSoFar=t+1;var i=function(e){var t=3e3*Math.pow(2,e),i=t/2,s=Math.min(18e5,t),r=(Math.random()-.5)*(s-i);return Math.ceil(s+r)}(t),s=Date.now()+i;this.kr.push({retryAt:s,requestOptions:e});var r="Enqueued failed request for retry in "+i;navigator.onLine||(r+=" (Browser is offline)"),Se.warn(r),this.Cr||(this.Cr=!0,this.Ar())}Ar(){this.Dr&&clearTimeout(this.Dr),this.Dr=setTimeout(()=>{this.Or&&this.kr.length>0&&this.ne(),this.Ar()},this.Mr)}ne(){var e=Date.now(),t=[],i=this.kr.filter(i=>i.retryAt<e||(t.push(i),!1));if(this.kr=t,i.length>0)for(var{requestOptions:s}of i)this.retriableRequest(s)}unload(){for(var{requestOptions:e}of(this.Dr&&(clearTimeout(this.Dr),this.Dr=void 0),this.kr))try{this._instance.Te(y({},e,{transport:"sendBeacon"}))}catch(e){Se.error(e)}this.kr=[]}}class qo{constructor(e){this.jr=()=>{var e,t,i,s;this.Lr||(this.Lr={});var r=this.scrollElement(),n=this.scrollY(),o=r?Math.max(0,r.scrollHeight-r.clientHeight):0,a=n+((null==r?void 0:r.clientHeight)||0),l=(null==r?void 0:r.scrollHeight)||0;this.Lr.lastScrollY=Math.ceil(n),this.Lr.maxScrollY=Math.max(n,null!==(e=this.Lr.maxScrollY)&&void 0!==e?e:0),this.Lr.maxScrollHeight=Math.max(o,null!==(t=this.Lr.maxScrollHeight)&&void 0!==t?t:0),this.Lr.lastContentY=a,this.Lr.maxContentY=Math.max(a,null!==(i=this.Lr.maxContentY)&&void 0!==i?i:0),this.Lr.maxContentHeight=Math.max(l,null!==(s=this.Lr.maxContentHeight)&&void 0!==s?s:0)},this._instance=e}getContext(){return this.Lr}resetContext(){var e=this.Lr;return setTimeout(this.jr,0),e}startMeasuringScrollPosition(){je(s,"scroll",this.jr,{capture:!0}),je(s,"scrollend",this.jr,{capture:!0}),je(s,"resize",this.jr)}scrollElement(){if(!this._instance.config.scroll_root_selector)return null==s?void 0:s.document.documentElement;var e=$(this._instance.config.scroll_root_selector)?this._instance.config.scroll_root_selector:[this._instance.config.scroll_root_selector];for(var t of e){var i=null==s?void 0:s.document.querySelector(t);if(i)return i}}scrollY(){if(this._instance.config.scroll_root_selector){var e=this.scrollElement();return e&&e.scrollTop||0}return s&&(s.scrollY||s.pageYOffset||s.document.documentElement.scrollTop)||0}scrollX(){if(this._instance.config.scroll_root_selector){var e=this.scrollElement();return e&&e.scrollLeft||0}return s&&(s.scrollX||s.pageXOffset||s.document.documentElement.scrollLeft)||0}}var Bo=e=>Kn(null==e?void 0:e.config.mask_personal_data_properties,null==e?void 0:e.config.custom_personal_data_properties);class Uo{constructor(e,t,i,s){this.Nr=e=>{var t=this.Ur();if(!t||t.sessionId!==e){var i={sessionId:e,props:this.zr(this._instance)};this.qr.register({[bt]:i})}},this._instance=e,this.Br=t,this.qr=i,this.zr=s||Bo,this.Br.onSessionId(this.Nr)}Ur(){return this.qr.props[bt]}getSetOnceProps(){var e,t=null==(e=this.Ur())?void 0:e.props;return t?"r"in t?Zn(t):{$referring_domain:t.referringDomain,$pathname:t.initialPathName,utm_source:t.utm_source,utm_campaign:t.utm_campaign,utm_medium:t.utm_medium,utm_content:t.utm_content,utm_term:t.utm_term}:{}}getSessionProps(){var e={};return Re(Le(this.getSetOnceProps()),(t,i)=>{"$current_url"===i&&(i="url"),e["$session_entry_"+S(i)]=t}),e}}var zo=xe("[SessionId]");class Go{constructor(e,t,i){var s;if(this.Hr=[],this.Wr=(e,t)=>Math.abs(e-t)>this.sessionTimeoutMs,!e.persistence)throw new Error("SessionIdManager requires a PostHogPersistence instance");if("always"===e.config.cookieless_mode)throw new Error('SessionIdManager cannot be used with cookieless_mode="always"');this.A=e.config,this.qr=e.persistence,this.pi=void 0,this.Ft=void 0,this._sessionStartTimestamp=null,this._sessionActivityTimestamp=null,this.Gr=t||xi,this.Vr=i||xi;var r=this.A.persistence_name||this.A.token,n=this.A.session_idle_timeout_seconds||1800;if(this._sessionTimeoutMs=1e3*V(n,60,36e3,zo.createLogger("session_idle_timeout_seconds"),1800),e.register({$configured_session_timeout_ms:this._sessionTimeoutMs}),this.Jr(),this.Kr="ph_"+r+"_window_id",this.Yr="ph_"+r+"_primary_window_exists",this.Xr()){var o=Di.K(this.Kr),a=Di.K(this.Yr);o&&!a?this.pi=o:Di.X(this.Kr),Di.Y(this.Yr,!0)}if(null!=(s=this.A.bootstrap)&&s.sessionID)try{var l=(()=>{var e=this.A.bootstrap.sessionID.replace(/-/g,"");if(32!==e.length)throw new Error("Not a valid UUID");if("7"!==e[12])throw new Error("Not a UUIDv7");return parseInt(e.substring(0,12),16)})();this.Qr(this.A.bootstrap.sessionID,(new Date).getTime(),l)}catch(e){zo.error("Invalid sessionID in bootstrap",e)}this.Zr()}get sessionTimeoutMs(){return this._sessionTimeoutMs}onSessionId(e){return A(this.Hr)&&(this.Hr=[]),this.Hr.push(e),this.Ft&&e(this.Ft,this.pi),()=>{this.Hr=this.Hr.filter(t=>t!==e)}}Xr(){return"memory"!==this.A.persistence&&!this.qr.je&&Di.G()}ts(e){e!==this.pi&&(this.pi=e,this.Xr()&&Di.Y(this.Kr,e))}es(){return this.pi?this.pi:this.Xr()?Di.K(this.Kr):null}Qr(e,t,i){e===this.Ft&&t===this._sessionActivityTimestamp&&i===this._sessionStartTimestamp||(this._sessionStartTimestamp=i,this._sessionActivityTimestamp=t,this.Ft=e,this.qr.register({[at]:[t,e,i]}))}rs(){if(this.Ft&&this._sessionActivityTimestamp&&this._sessionStartTimestamp)return[this._sessionActivityTimestamp,this.Ft,this._sessionStartTimestamp];var e=this.qr.props[at];return $(e)&&2===e.length&&e.push(e[0]),e||[0,null,0]}resetSessionId(){this.Qr(null,null,null)}Zr(){je(s,"beforeunload",()=>{this.Xr()&&Di.X(this.Yr)},{capture:!1})}checkAndGetSessionAndWindowId(e,t){if(void 0===e&&(e=!1),void 0===t&&(t=null),"always"===this.A.cookieless_mode)throw new Error('checkAndGetSessionAndWindowId should not be called with cookieless_mode="always"');var i=t||(new Date).getTime(),[s,r,n]=this.rs(),o=this.es(),a=N(n)&&n>0&&Math.abs(i-n)>864e5,l=!1,c=!r,u=!e&&this.Wr(i,s);c||u||a?(r=this.Gr(),o=this.Vr(),zo.info("new session ID generated",{sessionId:r,windowId:o,changeReason:{noSessionId:c,activityTimeout:u,sessionPastMaximumLength:a}}),n=i,l=!0):o||(o=this.Vr(),l=!0);var h=0===s||!e||a?i:s,d=0===n?(new Date).getTime():n;return this.ts(o),this.Qr(r,h,d),e||this.Jr(),l&&this.Hr.forEach(e=>e(r,o,l?{noSessionId:c,activityTimeout:u,sessionPastMaximumLength:a}:void 0)),{sessionId:r,windowId:o,sessionStartTimestamp:d,changeReason:l?{noSessionId:c,activityTimeout:u,sessionPastMaximumLength:a}:void 0,lastActivityTimestamp:s}}Jr(){clearTimeout(this.ss),this.ss=setTimeout(()=>{var[e]=this.rs();this.Wr((new Date).getTime(),e)&&this.resetSessionId()},1.1*this.sessionTimeoutMs)}}var Wo=["$set_once","$set"],Vo=xe("[SiteApps]");class Yo{constructor(e){this._instance=e,this.ns=[],this.apps={}}get isEnabled(){return!!this._instance.config.opt_in_site_apps}os(e,t){if(t){var i=this.globalsForEvent(t);this.ns.push(i),this.ns.length>1e3&&(this.ns=this.ns.slice(10))}}get siteAppLoaders(){var e;return null==(e=v._POSTHOG_REMOTE_CONFIG)||null==(e=e[this._instance.config.token])?void 0:e.siteApps}init(){if(this.isEnabled){var e=this._instance.Ye(this.os.bind(this));this.ls=()=>{e(),this.ns=[],this.ls=void 0}}}globalsForEvent(e){var t,i,s,r,n,o,a;if(!e)throw new Error("Event payload is required");var l={},c=this._instance.get_property("$groups")||[],u=this._instance.get_property("$stored_group_properties")||{};for(var[h,d]of Object.entries(u))l[h]={id:c[h],type:h,properties:d};var{$set_once:p,$set:g}=e;return{event:y({},b(e,Wo),{properties:y({},e.properties,g?{$set:y({},null!==(t=null==(i=e.properties)?void 0:i.$set)&&void 0!==t?t:{},g)}:{},p?{$set_once:y({},null!==(s=null==(r=e.properties)?void 0:r.$set_once)&&void 0!==s?s:{},p)}:{}),elements_chain:null!==(n=null==(o=e.properties)?void 0:o.$elements_chain)&&void 0!==n?n:"",distinct_id:null==(a=e.properties)?void 0:a.distinct_id}),person:{properties:this._instance.get_property("$stored_person_properties")},groups:l}}setupSiteApp(e){var t=this.apps[e.id],i=()=>{var i;!t.errored&&this.ns.length&&(Vo.info("Processing "+this.ns.length+" events for site app with id "+e.id),this.ns.forEach(e=>null==t.processEvent?void 0:t.processEvent(e)),t.processedBuffer=!0),Object.values(this.apps).every(e=>e.processedBuffer||e.errored)&&(null==(i=this.ls)||i.call(this))},s=!1,r=r=>{t.errored=!r,t.loaded=!0,Vo.info("Site app with id "+e.id+" "+(r?"loaded":"errored")),s&&i()};try{var{processEvent:n}=e.init({posthog:this._instance,callback:e=>{r(e)}});n&&(t.processEvent=n),s=!0}catch(t){Vo.error("Error while initializing PostHog app with config id "+e.id,t),r(!1)}if(s&&t.loaded)try{i()}catch(i){Vo.error("Error while processing buffered events PostHog app with config id "+e.id,i),t.errored=!0}}us(){var e=this.siteAppLoaders||[];for(var t of e)this.apps[t.id]={id:t.id,loaded:!1,errored:!1,processedBuffer:!1};for(var i of e)this.setupSiteApp(i)}hs(e){if(0!==Object.keys(this.apps).length){var t=this.globalsForEvent(e);for(var i of Object.values(this.apps))try{null==i.processEvent||i.processEvent(t)}catch(t){Vo.error("Error while processing event "+e.event+" for site app "+i.id,t)}}}onRemoteConfig(e){var t,i,s,r=this;if(null!=(t=this.siteAppLoaders)&&t.length)return this.isEnabled?(this.us(),void this._instance.on("eventCaptured",e=>this.hs(e))):void Vo.error('PostHog site apps are disabled. Enable the "opt_in_site_apps" config to proceed.');if(null==(i=this.ls)||i.call(this),null!=(s=e.siteApps)&&s.length)if(this.isEnabled){var n=function(e){var t;v["__$$ph_site_app_"+e]=r._instance,null==(t=v.__PosthogExtensions__)||null==t.loadSiteApp||t.loadSiteApp(r._instance,a,t=>{if(t)return Vo.error("Error while initializing PostHog app with config id "+e,t)})};for(var{id:o,url:a}of e.siteApps)n(o)}else Vo.error('PostHog site apps are disabled. Enable the "opt_in_site_apps" config to proceed.')}}var Xo=["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"],Jo=function(e,t){if(!e)return!1;var i=e.toLowerCase();return Xo.concat(t||[]).some(e=>{var t=e.toLowerCase();return-1!==i.indexOf(t)})},Ko=function(e,t){if(!e)return!1;var i=e.userAgent;if(i&&Jo(i,t))return!0;try{var s=null==e?void 0:e.userAgentData;if(null!=s&&s.brands&&s.brands.some(e=>Jo(null==e?void 0:e.brand,t)))return!0}catch(e){}return!!e.webdriver},Zo=function(e){return e.US="us",e.EU="eu",e.CUSTOM="custom",e}({}),Qo="i.posthog.com";class ea{constructor(e){this.ds={},this.instance=e}get apiHost(){var e=this.instance.config.api_host.trim().replace(/\/$/,"");return"https://app.posthog.com"===e?"https://us.i.posthog.com":e}get uiHost(){var e,t=null==(e=this.instance.config.ui_host)?void 0:e.replace(/\/$/,"");return t||(t=this.apiHost.replace("."+Qo,".posthog.com")),"https://app.posthog.com"===t?"https://us.posthog.com":t}get region(){return this.ds[this.apiHost]||(/https:\/\/(app|us|us-assets)(\.i)?\.posthog\.com/i.test(this.apiHost)?this.ds[this.apiHost]=Zo.US:/https:\/\/(eu|eu-assets)(\.i)?\.posthog\.com/i.test(this.apiHost)?this.ds[this.apiHost]=Zo.EU:this.ds[this.apiHost]=Zo.CUSTOM),this.ds[this.apiHost]}endpointFor(e,t){if(void 0===t&&(t=""),t&&(t="/"===t[0]?t:"/"+t),"ui"===e)return this.uiHost+t;if(this.region===Zo.CUSTOM)return this.apiHost+t;var i=Qo+t;switch(e){case"assets":return"https://"+this.region+"-assets."+i;case"api":return"https://"+this.region+"."+i}}}var ta={icontains:(e,t)=>!!s&&t.href.toLowerCase().indexOf(e.toLowerCase())>-1,not_icontains:(e,t)=>!!s&&-1===t.href.toLowerCase().indexOf(e.toLowerCase()),regex:(e,t)=>!!s&&Hr(t.href,e),not_regex:(e,t)=>!!s&&!Hr(t.href,e),exact:(e,t)=>t.href===e,is_not:(e,t)=>t.href!==e};class ia{constructor(e){var t=this;this.getWebExperimentsAndEvaluateDisplayLogic=function(e){void 0===e&&(e=!1),t.getWebExperiments(e=>{ia.vs("retrieved web experiments from the server"),t.cs=new Map,e.forEach(e=>{if(e.feature_flag_key){var i;t.cs&&(ia.vs("setting flag key ",e.feature_flag_key," to web experiment ",e),null==(i=t.cs)||i.set(e.feature_flag_key,e));var s=t._instance.getFeatureFlag(e.feature_flag_key);O(s)&&e.variants[s]&&t.fs(e.name,s,e.variants[s].transforms)}else if(e.variants)for(var r in e.variants){var n=e.variants[r];ia.ps(n)&&t.fs(e.name,r,n.transforms)}})},e)},this._instance=e,this._instance.onFeatureFlags(e=>{this.onFeatureFlags(e)})}onFeatureFlags(e){if(this._is_bot())ia.vs("Refusing to render web experiment since the viewer is a likely bot");else if(!this._instance.config.disable_web_experiments){if(D(this.cs))return this.cs=new Map,this.loadIfEnabled(),void this.previewWebExperiment();ia.vs("applying feature flags",e),e.forEach(e=>{var t;if(this.cs&&null!=(t=this.cs)&&t.has(e)){var i,s=this._instance.getFeatureFlag(e),r=null==(i=this.cs)?void 0:i.get(e);s&&null!=r&&r.variants[s]&&this.fs(r.name,s,r.variants[s].transforms)}})}}previewWebExperiment(){var e=ia.getWindowLocation();if(null!=e&&e.search){var t=di(null==e?void 0:e.search,"__experiment_id"),i=di(null==e?void 0:e.search,"__experiment_variant");t&&i&&(ia.vs("previewing web experiments "+t+" && "+i),this.getWebExperiments(e=>{this.gs(parseInt(t),i,e)},!1,!0))}}loadIfEnabled(){this._instance.config.disable_web_experiments||this.getWebExperimentsAndEvaluateDisplayLogic()}getWebExperiments(e,t,i){if(this._instance.config.disable_web_experiments&&!i)return e([]);var s=this._instance.get_property("$web_experiments");if(s&&!t)return e(s);this._instance.Te({url:this._instance.requestRouter.endpointFor("api","/api/web_experiments/?token="+this._instance.config.token),method:"GET",callback:t=>{if(200!==t.statusCode||!t.json)return e([]);var i=t.json.experiments||[];return e(i)}})}gs(e,t,i){var s=i.filter(t=>t.id===e);s&&s.length>0&&(ia.vs("Previewing web experiment ["+s[0].name+"] with variant ["+t+"]"),this.fs(s[0].name,t,s[0].variants[t].transforms))}static ps(e){return!D(e.conditions)&&ia._s(e)&&ia.ys(e)}static _s(e){var t;if(D(e.conditions)||D(null==(t=e.conditions)?void 0:t.url))return!0;var i,s,r,n=ia.getWindowLocation();return!!n&&(null==(i=e.conditions)||!i.url||ta[null!==(s=null==(r=e.conditions)?void 0:r.urlMatchType)&&void 0!==s?s:"icontains"](e.conditions.url,n))}static getWindowLocation(){return null==s?void 0:s.location}static ys(e){var t;if(D(e.conditions)||D(null==(t=e.conditions)?void 0:t.utm))return!0;var i=Wn();if(i.utm_source){var s,r,n,o,a,l,c,u,h=null==(s=e.conditions)||null==(s=s.utm)||!s.utm_campaign||(null==(r=e.conditions)||null==(r=r.utm)?void 0:r.utm_campaign)==i.utm_campaign,d=null==(n=e.conditions)||null==(n=n.utm)||!n.utm_source||(null==(o=e.conditions)||null==(o=o.utm)?void 0:o.utm_source)==i.utm_source,p=null==(a=e.conditions)||null==(a=a.utm)||!a.utm_medium||(null==(l=e.conditions)||null==(l=l.utm)?void 0:l.utm_medium)==i.utm_medium,g=null==(c=e.conditions)||null==(c=c.utm)||!c.utm_term||(null==(u=e.conditions)||null==(u=u.utm)?void 0:u.utm_term)==i.utm_term;return h&&p&&g&&d}return!1}static vs(e){for(var t=arguments.length,i=new Array(t>1?t-1:0),s=1;s<t;s++)i[s-1]=arguments[s];Se.info("[WebExperiments] "+e,i)}fs(e,t,i){this._is_bot()?ia.vs("Refusing to render web experiment since the viewer is a likely bot"):"control"!==t?i.forEach(i=>{if(i.selector){var s;ia.vs("applying transform of variant "+t+" for experiment "+e+" ",i);var r=null==(s=document)?void 0:s.querySelectorAll(i.selector);null==r||r.forEach(e=>{var t=e;i.html&&(t.innerHTML=i.html),i.css&&t.setAttribute("style",i.css)})}}):ia.vs("Control variants leave the page unmodified.")}_is_bot(){return l&&this._instance?Ko(l,this._instance.config.custom_blocked_useragents):void 0}}var sa=xe("[PostHog ExternalIntegrations]"),ra={intercom:"intercom-integration",crispChat:"crisp-chat-integration"};class na{constructor(e){this._instance=e}nt(e,t){var i;null==(i=v.__PosthogExtensions__)||null==i.loadExternalDependency||i.loadExternalDependency(this._instance,e,e=>{if(e)return sa.error("failed to load script",e);t()})}startIfEnabledOrStop(){var e=this,t=function(t){var i,r,n;!s||null!=(i=v.__PosthogExtensions__)&&null!=(i=i.integrations)&&i[t]||e.nt(ra[t],()=>{var i;null==(i=v.__PosthogExtensions__)||null==(i=i.integrations)||null==(i=i[t])||i.start(e._instance)}),!s&&null!=(r=v.__PosthogExtensions__)&&null!=(r=r.integrations)&&r[t]&&(null==(n=v.__PosthogExtensions__)||null==(n=n.integrations)||null==(n=n[t])||n.stop())};for(var[i,s]of Object.entries(null!==(r=this._instance.config.integrations)&&void 0!==r?r:{})){var r;t(i)}}}var oa="[SessionRecording]",aa=xe(oa);class la{get started(){var e;return!(null==(e=this.bs)||!e.isStarted)}get status(){var e;return(null==(e=this.bs)?void 0:e.status)||"lazy_loading"}constructor(e){if(this._forceAllowLocalhostNetworkCapture=!1,this.ni=void 0,this._instance=e,!this._instance.sessionManager)throw aa.error("started without valid sessionManager"),new Error(oa+" started without valid sessionManager. This is a bug.");if("always"===this._instance.config.cookieless_mode)throw new Error(oa+' cannot be used with cookieless_mode="always"')}get qt(){var e,t=!(null==(e=this._instance.get_property(Ze))||!e.enabled),i=!this._instance.config.disable_session_recording,r=this._instance.config.disable_session_recording||this._instance.consent.isOptedOut();return s&&t&&i&&!r}startIfEnabledOrStop(e){var t;if(!this.qt||null==(t=this.bs)||!t.isStarted){var i=!A(Object.assign)&&!A(Array.from);this.qt&&i?(this.ws(e),aa.info("starting")):this.stopRecording()}}ws(e){var t,i,s;this.qt&&(null!=v&&null!=(t=v.__PosthogExtensions__)&&null!=(t=t.rrweb)&&t.record&&null!=(i=v.__PosthogExtensions__)&&i.initSessionRecording?this.Pi(e):null==(s=v.__PosthogExtensions__)||null==s.loadExternalDependency||s.loadExternalDependency(this._instance,this.Ri,t=>{if(t)return aa.error("could not load recorder",t);this.Pi(e)}))}stopRecording(){var e;null==(e=this.bs)||e.stop()}ki(){var e;null==(e=this._instance.persistence)||e.unregister(lt)}Ei(e){if(this._instance.persistence){var t,i,s=this._instance.persistence,r=()=>{var t=e.sessionRecording,i=null==t?void 0:t.sampleRate,r=D(i)?null:parseFloat(i);D(r)&&this.ki();var n=null==t?void 0:t.minimumDurationMilliseconds;s.register({[Ze]:y({enabled:!!t},t,{networkPayloadCapture:y({capturePerformance:e.capturePerformance},null==t?void 0:t.networkPayloadCapture),canvasRecording:{enabled:null==t?void 0:t.recordCanvas,fps:null==t?void 0:t.canvasFps,quality:null==t?void 0:t.canvasQuality},sampleRate:r,minimumDurationMilliseconds:A(n)?null:n,endpoint:null==t?void 0:t.endpoint,triggerMatchType:null==t?void 0:t.triggerMatchType,masking:null==t?void 0:t.masking,urlTriggers:null==t?void 0:t.urlTriggers})})};r(),null==(t=this.ni)||t.call(this),this.ni=null==(i=this._instance.sessionManager)?void 0:i.onSessionId(r)}}onRemoteConfig(e){"sessionRecording"in e?(this.Ei(e),this.startIfEnabledOrStop()):aa.info("skipping remote config with no sessionRecording",e)}log(e,t){var i;void 0===t&&(t="log"),null!=(i=this.bs)&&i.log?this.bs.log(e,t):aa.warn("log called before recorder was ready")}get Ri(){var e,t,i=null==(e=this._instance)||null==(e=e.persistence)?void 0:e.get_property(Ze);return(null==i||null==(t=i.scriptConfig)?void 0:t.script)||"lazy-recorder"}Pi(e){var t,i;if(null==(t=v.__PosthogExtensions__)||!t.initSessionRecording)throw Error("Called on script loaded before session recording is available");this.bs||(this.bs=null==(i=v.__PosthogExtensions__)?void 0:i.initSessionRecording(this._instance),this.bs._forceAllowLocalhostNetworkCapture=this._forceAllowLocalhostNetworkCapture),this.bs.start(e)}onRRwebEmit(e){var t;null==(t=this.bs)||null==t.onRRwebEmit||t.onRRwebEmit(e)}overrideLinkedFlag(){var e;null==(e=this.bs)||e.overrideLinkedFlag()}overrideSampling(){var e;null==(e=this.bs)||e.overrideSampling()}overrideTrigger(e){var t;null==(t=this.bs)||t.overrideTrigger(e)}get sdkDebugProperties(){var e;return(null==(e=this.bs)?void 0:e.sdkDebugProperties)||{$recording_status:this.status}}tryAddCustomEvent(e,t){var i;return!(null==(i=this.bs)||!i.tryAddCustomEvent(e,t))}}var ca={},ua=()=>{},ha="posthog",da=!Ar&&-1===(null==g?void 0:g.indexOf("MSIE"))&&-1===(null==g?void 0:g.indexOf("Mozilla")),pa=e=>{var t;return{api_host:"https://us.i.posthog.com",ui_host:null,token:"",autocapture:!0,rageclick:!0,cross_subdomain_cookie:Ne(null==c?void 0:c.location),persistence:"localStorage+cookie",persistence_name:"",loaded:ua,save_campaign_params:!0,custom_campaign_params:[],custom_blocked_useragents:[],save_referrer:!0,capture_pageview:"2025-05-24"!==e||"history_change",capture_pageleave:"if_capture_pageview",defaults:null!=e?e:"unset",debug:u&&O(null==u?void 0:u.search)&&-1!==u.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_external_dependency_loading:!1,enable_recording_console_log:void 0,secure_cookie:"https:"===(null==s||null==(t=s.location)?void 0:t.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,session_recording:{},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:e=>{var t="Bad HTTP status: "+e.statusCode+" "+e.text;Se.error(t)},get_device_id:e=>e,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:Do},error_tracking:{},_onCapture:ua,__preview_eager_load_replay:!0}},ga=e=>{var t={};A(e.process_person)||(t.person_profiles=e.process_person),A(e.xhr_headers)||(t.request_headers=e.xhr_headers),A(e.cookie_name)||(t.persistence_name=e.cookie_name),A(e.disable_cookie)||(t.disable_persistence=e.disable_cookie),A(e.store_google)||(t.save_campaign_params=e.store_google),A(e.verbose)||(t.debug=e.verbose);var i=Ce({},t,e);return $(e.property_blacklist)&&(A(e.property_denylist)?i.property_denylist=e.property_blacklist:$(e.property_denylist)?i.property_denylist=[...e.property_blacklist,...e.property_denylist]:Se.error("Invalid value for property_denylist config: "+e.property_denylist)),i};class va{constructor(){this.__forceAllowLocalhost=!1}get Ss(){return this.__forceAllowLocalhost}set Ss(e){Se.error("WebPerformanceObserver is deprecated and has no impact on network capture. Use `_forceAllowLocalhostNetworkCapture` on `posthog.sessionRecording`"),this.__forceAllowLocalhost=e}}class _a{get decideEndpointWasHit(){var e,t;return null!==(e=null==(t=this.featureFlags)?void 0:t.hasLoadedFlags)&&void 0!==e&&e}get flagsEndpointWasHit(){var e,t;return null!==(e=null==(t=this.featureFlags)?void 0:t.hasLoadedFlags)&&void 0!==e&&e}constructor(){this.webPerformance=new va,this.ks=!1,this.version=_.LIB_VERSION,this.$s=new ko,this._calculate_event_properties=this.calculateEventProperties.bind(this),this.config=pa(),this.SentryIntegration=mr,this.sentryIntegration=e=>function(e,t){var i=fr(e,t);return{name:_r,processEvent:e=>i(e)}}(this,e),this.__request_queue=[],this.__loaded=!1,this.analyticsDefaultEndpoint="/e/",this.xs=!1,this.Es=null,this.Ps=null,this.Rs=null,this.featureFlags=new uo(this),this.toolbar=new kr(this),this.scrollManager=new qo(this),this.pageViewManager=new Tr(this),this.surveys=new To(this),this.experiments=new ia(this),this.exceptions=new zr(this),this.rateLimiter=new Oo(this),this.requestRouter=new ea(this),this.consent=new Hi(this),this.externalIntegrations=new na(this),this.people={set:(e,t,i)=>{var s=O(e)?{[e]:t}:e;this.setPersonProperties(s),null==i||i({})},set_once:(e,t,i)=>{var s=O(e)?{[e]:t}:e;this.setPersonProperties(void 0,s),null==i||i({})}},this.on("eventCaptured",e=>Se.info('send "'+(null==e?void 0:e.event)+'"',e))}init(e,t,i){if(i&&i!==ha){var s,r=null!==(s=ca[i])&&void 0!==s?s:new _a;return r._init(e,t,i),ca[i]=r,ca[ha][i]=r,r}return this._init(e,t,i)}_init(e,t,i){var r,n;if(void 0===t&&(t={}),A(e)||M(e))return Se.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 Se.warn("You have already initialized PostHog! Re-initializing is a no-op"),this;this.__loaded=!0,this.config={},this.Is=t,this.Ts=[],t.person_profiles&&(this.Ps=t.person_profiles),this.set_config(Ce({},pa(t.defaults),ga(t),{name:i,token:e})),this.config.on_xhr_error&&Se.error("on_xhr_error is deprecated. Use on_request_error instead"),this.compression=t.disable_compression?void 0:li.GZipJS;var o=this.Cs();this.persistence=new po(this.config,o),this.sessionPersistence="sessionStorage"===this.config.persistence||"memory"===this.config.persistence?this.persistence:new po(y({},this.config,{persistence:"sessionStorage"}),o);var a=y({},this.persistence.props),l=y({},this.sessionPersistence.props);this.register({$initialization_time:(new Date).toISOString()}),this.Ms=new No(e=>this.Os(e),this.config.request_queue_config),this.Fs=new jo(this),this.__request_queue=[];var c="always"===this.config.cookieless_mode||"on_reject"===this.config.cookieless_mode&&this.consent.isExplicitlyOptedOut();if(c||(this.sessionManager=new Go(this),this.sessionPropsManager=new Uo(this,this.sessionManager,this.persistence)),new xr(this).startIfEnabledOrStop(),this.siteApps=new Yo(this),null==(r=this.siteApps)||r.init(),c||(this.config.__preview_eager_load_replay?this.sessionRecording=new gr(this):this.sessionRecording=new la(this),this.sessionRecording.startIfEnabledOrStop()),this.config.disable_scroll_properties||this.scrollManager.startMeasuringScrollPosition(),this.autocapture=new mi(this),this.autocapture.startIfEnabled(),this.surveys.loadIfEnabled(),this.heatmaps=new Cr(this),this.heatmaps.startIfEnabled(),this.webVitalsAutocapture=new Fr(this),this.exceptionObserver=new Gi(this),this.exceptionObserver.startIfEnabled(),this.deadClicksAutocapture=new Ui(this,Bi),this.deadClicksAutocapture.startIfEnabled(),this.historyAutocapture=new Vi(this),this.historyAutocapture.startIfEnabled(),_.DEBUG=_.DEBUG||this.config.debug,_.DEBUG&&Se.info("Starting in debug mode",{this:this,config:t,thisC:y({},this.config),p:a,s:l}),void 0!==(null==(n=t.bootstrap)?void 0:n.distinctID)){var u,h,d=this.config.get_device_id(xi()),p=null!=(u=t.bootstrap)&&u.isIdentifiedID?d:t.bootstrap.distinctID;this.persistence.set_property(yt,null!=(h=t.bootstrap)&&h.isIdentifiedID?"identified":"anonymous"),this.register({distinct_id:t.bootstrap.distinctID,$device_id:p})}if(this.As()){var g,v,f=Object.keys((null==(g=t.bootstrap)?void 0:g.featureFlags)||{}).filter(e=>{var i;return!(null==(i=t.bootstrap)||null==(i=i.featureFlags)||!i[e])}).reduce((e,i)=>{var s;return e[i]=(null==(s=t.bootstrap)||null==(s=s.featureFlags)?void 0:s[i])||!1,e},{}),m=Object.keys((null==(v=t.bootstrap)?void 0:v.featureFlagPayloads)||{}).filter(e=>f[e]).reduce((e,i)=>{var s,r;return null!=(s=t.bootstrap)&&null!=(s=s.featureFlagPayloads)&&s[i]&&(e[i]=null==(r=t.bootstrap)||null==(r=r.featureFlagPayloads)?void 0:r[i]),e},{});this.featureFlags.receivedFeatureFlags({featureFlags:f,featureFlagPayloads:m})}if(c)this.register_once({distinct_id:Pt,$device_id:null},"");else if(!this.get_distinct_id()){var b=this.config.get_device_id(xi());this.register_once({distinct_id:b,$device_id:b},""),this.persistence.set_property(yt,"anonymous")}return je(s,"onpagehide"in self?"pagehide":"unload",this._handle_unload.bind(this),{passive:!1}),this.toolbar.maybeLoadToolbar(),t.segment?function(e,t){var i=e.config.segment;if(!i)return t();!function(e,t){var i=e.config.segment;if(!i)return t();var s=i=>{var s=()=>i.anonymousId()||xi();e.config.get_device_id=s,i.id()&&(e.register({distinct_id:i.id(),$device_id:s()}),e.persistence.set_property(yt,"identified")),t()},r=i.user();"then"in r&&R(r.then)?r.then(e=>s(e)):s(r)}(e,()=>{i.register((e=>{Promise&&Promise.resolve||vr.warn("This browser does not have Promise support, and can not use the segment integration");var t=(t,i)=>{if(!i)return t;t.event.userId||t.event.anonymousId===e.get_distinct_id()||(vr.info("No userId set, resetting PostHog"),e.reset()),t.event.userId&&t.event.userId!==e.get_distinct_id()&&(vr.info("UserId set, identifying with PostHog"),e.identify(t.event.userId));var s=e.calculateEventProperties(i,t.event.properties);return t.event.properties=Object.assign({},s,t.event.properties),t};return{name:"PostHog JS",type:"enrichment",version:"1.0.0",isLoaded:()=>!0,load:()=>Promise.resolve(),track:e=>t(e,e.event.event),page:e=>t(e,"$pageview"),identify:e=>t(e,"$identify"),screen:e=>t(e,"$screen")}})(e)).then(()=>{t()})})}(this,()=>this.Ds()):this.Ds(),R(this.config._onCapture)&&this.config._onCapture!==ua&&(Se.warn("onCapture is deprecated. Please use `before_send` instead"),this.on("eventCaptured",e=>this.config._onCapture(e.event,e))),this.config.ip&&Se.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}Ce(e){var t,i,s,r,n,o,a,l;if(!c||!c.body)return Se.info("document not ready yet, trying again in 500 milliseconds..."),void setTimeout(()=>{this.Ce(e)},500);this.compression=void 0,e.supportedCompression&&!this.config.disable_compression&&(this.compression=E(e.supportedCompression,li.GZipJS)?li.GZipJS:E(e.supportedCompression,li.Base64)?li.Base64:void 0),null!=(t=e.analytics)&&t.endpoint&&(this.analyticsDefaultEndpoint=e.analytics.endpoint),this.set_config({person_profiles:this.Ps?this.Ps:"identified_only"}),null==(i=this.siteApps)||i.onRemoteConfig(e),null==(s=this.sessionRecording)||s.onRemoteConfig(e),null==(r=this.autocapture)||r.onRemoteConfig(e),null==(n=this.heatmaps)||n.onRemoteConfig(e),this.surveys.onRemoteConfig(e),null==(o=this.webVitalsAutocapture)||o.onRemoteConfig(e),null==(a=this.exceptionObserver)||a.onRemoteConfig(e),this.exceptions.onRemoteConfig(e),null==(l=this.deadClicksAutocapture)||l.onRemoteConfig(e)}Ds(){try{this.config.loaded(this)}catch(e){Se.critical("`loaded` function failed",e)}this.js(),this.config.capture_pageview&&setTimeout(()=>{(this.consent.isOptedIn()||"always"===this.config.cookieless_mode)&&this.Ls()},1),new Lo(this).load(),this.featureFlags.flags()}js(){var e;this.is_capturing()&&this.config.request_batching&&(null==(e=this.Ms)||e.enable())}_dom_loaded(){this.is_capturing()&&$e(this.__request_queue,e=>this.Os(e)),this.__request_queue=[],this.js()}_handle_unload(){var e,t;this.config.request_batching?(this.Ns()&&this.capture("$pageleave"),null==(e=this.Ms)||e.unload(),null==(t=this.Fs)||t.unload()):this.Ns()&&this.capture("$pageleave",null,{transport:"sendBeacon"})}Te(e){this.__loaded&&(da?this.__request_queue.push(e):this.rateLimiter.isServerRateLimited(e.batchKey)||(e.transport=e.transport||this.config.api_transport,e.url=Mr(e.url,{ip:this.config.ip?1:0}),e.headers=y({},this.config.request_headers),e.compression="best-available"===e.compression?this.compression:e.compression,e.disableXHRCredentials=this.config.__preview_disable_xhr_credentials,this.config.__preview_disable_beacon&&(e.disableTransport=["sendBeacon"]),e.fetchOptions=e.fetchOptions||this.config.fetch_options,(e=>{var t,i,s,r=y({},e);r.timeout=r.timeout||6e4,r.url=Mr(r.url,{_:(new Date).getTime().toString(),ver:_.LIB_VERSION,compression:r.compression});var n=null!==(t=r.transport)&&void 0!==t?t:"fetch",o=Nr.filter(e=>!r.disableTransport||!e.transport||!r.disableTransport.includes(e.transport)),a=null!==(i=null==(s=He(o,e=>e.transport===n))?void 0:s.method)&&void 0!==i?i:o[0].method;if(!a)throw new Error("No available transport method");a(r)})(y({},e,{callback:t=>{var i,s;this.rateLimiter.checkForLimiting(t),t.statusCode>=400&&(null==(i=(s=this.config).on_request_error)||i.call(s,t)),null==e.callback||e.callback(t)}}))))}Os(e){this.Fs?this.Fs.retriableRequest(e):this.Te(e)}_execute_array(e){var t,i=[],s=[],r=[];$e(e,e=>{e&&(t=e[0],$(t)?r.push(e):R(e)?e.call(this):$(e)&&"alias"===t?i.push(e):$(e)&&-1!==t.indexOf("capture")&&R(this[t])?r.push(e):s.push(e))});var n=function(e,t){$e(e,function(e){if($(e[0])){var i=t;Re(e,function(e){i=i[e[0]].apply(i,e.slice(1))})}else this[e[0]].apply(this,e.slice(1))},t)};n(i,this),n(s,this),n(r,this)}As(){var e,t;return(null==(e=this.config.bootstrap)?void 0:e.featureFlags)&&Object.keys(null==(t=this.config.bootstrap)?void 0:t.featureFlags).length>0||!1}push(e){this._execute_array([e])}capture(e,t,i){var s;if(this.__loaded&&this.persistence&&this.sessionPersistence&&this.Ms){if(this.is_capturing())if(!A(e)&&O(e)){if(this.config.opt_out_useragent_filter||!this._is_bot()){var r=null!=i&&i.skip_client_rate_limiting?void 0:this.rateLimiter.clientRateLimitContext();if(null==r||!r.isRateLimited){null!=t&&t.$current_url&&!O(null==t?void 0:t.$current_url)&&(Se.error("Invalid `$current_url` property provided to `posthog.capture`. Input must be a string. Ignoring provided value."),null==t||delete t.$current_url),this.sessionPersistence.update_search_keyword(),this.config.save_campaign_params&&this.sessionPersistence.update_campaign_params(),this.config.save_referrer&&this.sessionPersistence.update_referrer_info(),(this.config.save_campaign_params||this.config.save_referrer)&&this.persistence.set_initial_person_info();var n=new Date,o=(null==i?void 0:i.timestamp)||n,a=xi(),l={uuid:a,event:e,properties:this.calculateEventProperties(e,t||{},o,a)};r&&(l.properties.$lib_rate_limit_remaining_tokens=r.remainingTokens),(null==i?void 0:i.$set)&&(l.$set=null==i?void 0:i.$set);var c,u=this.Us(null==i?void 0:i.$set_once);if(u&&(l.$set_once=u),(l=function(e,t){return i=e,s=e=>O(e)&&!L(t)?e.slice(0,t):e,r=new Set,function e(t,i){return t!==Object(t)?s?s(t):t:r.has(t)?void 0:(r.add(t),$(t)?(n=[],$e(t,t=>{n.push(e(t))})):(n={},Re(t,(t,i)=>{r.has(t)||(n[i]=e(t))})),n);var n}(i);var i,s,r}(l,null!=i&&i._noTruncate?null:this.config.properties_string_max_length)).timestamp=o,A(null==i?void 0:i.timestamp)||(l.properties.$event_time_override_provided=!0,l.properties.$event_time_override_system_time=n),e===bo.DISMISSED||e===bo.SENT){var h=null==t?void 0:t[wo.SURVEY_ID],d=null==t?void 0:t[wo.SURVEY_ITERATION];c={id:h,current_iteration:d},localStorage.getItem(Fo(c))||localStorage.setItem(Fo(c),"true"),l.$set=y({},l.$set,{[Po({id:h,current_iteration:d},e===bo.SENT?"responded":"dismissed")]:!0})}var p=y({},l.properties.$set,l.$set);if(T(p)||this.setPersonPropertiesForFlags(p),!D(this.config.before_send)){var g=this.zs(l);if(!g)return;l=g}this.$s.emit("eventCaptured",l);var v={method:"POST",url:null!==(s=null==i?void 0:i._url)&&void 0!==s?s:this.requestRouter.endpointFor("api",this.analyticsDefaultEndpoint),data:l,compression:"best-available",batchKey:null==i?void 0:i._batchKey};return!this.config.request_batching||i&&(null==i||!i._batchKey)||null!=i&&i.send_instantly?this.Os(v):this.Ms.enqueue(v),l}Se.critical("This capture call is ignored due to client rate limiting.")}}else Se.error("No event name provided to posthog.capture")}else Se.uninitializedWarning("posthog.capture")}Ye(e){return this.on("eventCaptured",t=>e(t.event,t))}calculateEventProperties(e,t,i,s,r){if(i=i||new Date,!this.persistence||!this.sessionPersistence)return t;var n=r?void 0:this.persistence.remove_event_timer(e),o=y({},t);if(o.token=this.config.token,o.$config_defaults=this.config.defaults,("always"==this.config.cookieless_mode||"on_reject"==this.config.cookieless_mode&&this.consent.isExplicitlyOptedOut())&&(o.$cookieless_mode=!0),"$snapshot"===e){var a=y({},this.persistence.properties(),this.sessionPersistence.properties());return o.distinct_id=a.distinct_id,(!O(o.distinct_id)&&!N(o.distinct_id)||M(o.distinct_id))&&Se.error("Invalid distinct_id for replay event. This indicates a bug in your implementation"),o}var l,u=to(this.config.mask_personal_data_properties,this.config.custom_personal_data_properties);if(this.sessionManager){var{sessionId:h,windowId:d}=this.sessionManager.checkAndGetSessionAndWindowId(r,i.getTime());o.$session_id=h,o.$window_id=d}this.sessionPropsManager&&Ce(o,this.sessionPropsManager.getSessionProps());try{var p;this.sessionRecording&&Ce(o,this.sessionRecording.sdkDebugProperties),o.$sdk_debug_retry_queue_size=null==(p=this.Fs)?void 0:p.length}catch(e){o.$sdk_debug_error_capturing_properties=String(e)}if(this.requestRouter.region===Zo.CUSTOM&&(o.$lib_custom_api_host=this.config.api_host),l="$pageview"!==e||r?"$pageleave"!==e||r?this.pageViewManager.doEvent():this.pageViewManager.doPageLeave(i):this.pageViewManager.doPageView(i,s),o=Ce(o,l),"$pageview"===e&&c&&(o.title=c.title),!A(n)){var v=i.getTime()-n;o.$duration=parseFloat((v/1e3).toFixed(3))}g&&this.config.opt_out_useragent_filter&&(o.$browser_type=this._is_bot()?"bot":"browser"),(o=Ce({},u,this.persistence.properties(),this.sessionPersistence.properties(),o)).$is_identified=this._isIdentified(),$(this.config.property_denylist)?Re(this.config.property_denylist,function(e){delete o[e]}):Se.error("Invalid value for property_denylist config: "+this.config.property_denylist+" or property_blacklist config: "+this.config.property_blacklist);var _=this.config.sanitize_properties;_&&(Se.error("sanitize_properties is deprecated. Use before_send instead"),o=_(o,e));var f=this.qs();return o.$process_person_profile=f,f&&!r&&this.Bs("_calculate_event_properties"),o}Us(e){var t;if(!this.persistence||!this.qs())return e;if(this.ks)return e;var i=this.persistence.get_initial_props(),s=null==(t=this.sessionPropsManager)?void 0:t.getSetOnceProps(),r=Ce({},i,s||{},e||{}),n=this.config.sanitize_properties;return n&&(Se.error("sanitize_properties is deprecated. Use before_send instead"),r=n(r,"$set_once")),this.ks=!0,T(r)?void 0:r}register(e,t){var i;null==(i=this.persistence)||i.register(e,t)}register_once(e,t,i){var s;null==(s=this.persistence)||s.register_once(e,t,i)}register_for_session(e){var t;null==(t=this.sessionPersistence)||t.register(e)}unregister(e){var t;null==(t=this.persistence)||t.unregister(e)}unregister_for_session(e){var t;null==(t=this.sessionPersistence)||t.unregister(e)}Hs(e,t){this.register({[e]:t})}getFeatureFlag(e,t){return this.featureFlags.getFeatureFlag(e,t)}getFeatureFlagPayload(e){var t=this.featureFlags.getFeatureFlagPayload(e);try{return JSON.parse(t)}catch(e){return t}}isFeatureEnabled(e,t){return this.featureFlags.isFeatureEnabled(e,t)}reloadFeatureFlags(){this.featureFlags.reloadFeatureFlags()}updateEarlyAccessFeatureEnrollment(e,t,i){this.featureFlags.updateEarlyAccessFeatureEnrollment(e,t,i)}getEarlyAccessFeatures(e,t,i){return void 0===t&&(t=!1),this.featureFlags.getEarlyAccessFeatures(e,t,i)}on(e,t){return this.$s.on(e,t)}onFeatureFlags(e){return this.featureFlags.onFeatureFlags(e)}onSurveysLoaded(e){return this.surveys.onSurveysLoaded(e)}onSessionId(e){var t,i;return null!==(t=null==(i=this.sessionManager)?void 0:i.onSessionId(e))&&void 0!==t?t:()=>{}}getSurveys(e,t){void 0===t&&(t=!1),this.surveys.getSurveys(e,t)}getActiveMatchingSurveys(e,t){void 0===t&&(t=!1),this.surveys.getActiveMatchingSurveys(e,t)}renderSurvey(e,t){this.surveys.renderSurvey(e,t)}displaySurvey(e,t){void 0===t&&(t=Ro),this.surveys.displaySurvey(e,t)}canRenderSurvey(e){return this.surveys.canRenderSurvey(e)}canRenderSurveyAsync(e,t){return void 0===t&&(t=!1),this.surveys.canRenderSurveyAsync(e,t)}identify(e,t,i){if(!this.__loaded||!this.persistence)return Se.uninitializedWarning("posthog.identify");if(N(e)&&(e=e.toString(),Se.warn("The first argument to posthog.identify was a number, but it should be a string. It has been converted to a string.")),e)if(["distinct_id","distinctid"].includes(e.toLowerCase()))Se.critical('The string "'+e+'" was set in posthog.identify which indicates an error. This ID should be unique to the user and not a hardcoded string.');else if(e!==Pt){if(this.Bs("posthog.identify")){var s=this.get_distinct_id();if(this.register({$user_id:e}),!this.get_property("$device_id")){var r=s;this.register_once({$had_persisted_distinct_id:!0,$device_id:r},"")}e!==s&&e!==this.get_property(Be)&&(this.unregister(Be),this.register({distinct_id:e}));var n="anonymous"===(this.persistence.get_property(yt)||"anonymous");e!==s&&n?(this.persistence.set_property(yt,"identified"),this.setPersonPropertiesForFlags(y({},i||{},t||{}),!1),this.capture("$identify",{distinct_id:e,$anon_distinct_id:s},{$set:t||{},$set_once:i||{}}),this.Rs=jr(e,t,i),this.featureFlags.setAnonymousDistinctId(s)):(t||i)&&this.setPersonProperties(t,i),e!==s&&(this.reloadFeatureFlags(),this.unregister(mt))}}else Se.critical('The string "'+Pt+'" was set in posthog.identify which indicates an error. This ID is only used as a sentinel value.');else Se.error("Unique user id has not been set in posthog.identify")}setPersonProperties(e,t){if((e||t)&&this.Bs("posthog.setPersonProperties")){var i=jr(this.get_distinct_id(),e,t);this.Rs!==i?(this.setPersonPropertiesForFlags(y({},t||{},e||{})),this.capture("$set",{$set:e||{},$set_once:t||{}}),this.Rs=i):Se.info("A duplicate setPersonProperties call was made with the same properties. It has been ignored.")}}group(e,t,i){if(e&&t){if(this.Bs("posthog.group")){var s=this.getGroups();s[e]!==t&&this.resetGroupPropertiesForFlags(e),this.register({$groups:y({},s,{[e]:t})}),i&&(this.capture("$groupidentify",{$group_type:e,$group_key:t,$group_set:i}),this.setGroupPropertiesForFlags({[e]:i})),s[e]===t||i||this.reloadFeatureFlags()}}else Se.error("posthog.group requires a group type and group key")}resetGroups(){this.register({$groups:{}}),this.resetGroupPropertiesForFlags(),this.reloadFeatureFlags()}setPersonPropertiesForFlags(e,t){void 0===t&&(t=!0),this.featureFlags.setPersonPropertiesForFlags(e,t)}resetPersonPropertiesForFlags(){this.featureFlags.resetPersonPropertiesForFlags()}setGroupPropertiesForFlags(e,t){void 0===t&&(t=!0),this.Bs("posthog.setGroupPropertiesForFlags")&&this.featureFlags.setGroupPropertiesForFlags(e,t)}resetGroupPropertiesForFlags(e){this.featureFlags.resetGroupPropertiesForFlags(e)}reset(e){var t,i,s,r;if(Se.info("reset"),!this.__loaded)return Se.uninitializedWarning("posthog.reset");var n=this.get_property("$device_id");if(this.consent.reset(),null==(t=this.persistence)||t.clear(),null==(i=this.sessionPersistence)||i.clear(),this.surveys.reset(),this.featureFlags.reset(),null==(s=this.persistence)||s.set_property(yt,"anonymous"),null==(r=this.sessionManager)||r.resetSessionId(),this.Rs=null,"always"===this.config.cookieless_mode)this.register_once({distinct_id:Pt,$device_id:null},"");else{var o=this.config.get_device_id(xi());this.register_once({distinct_id:o,$device_id:e?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 e,t;return null!==(e=null==(t=this.sessionManager)?void 0:t.checkAndGetSessionAndWindowId(!0).sessionId)&&void 0!==e?e:""}get_session_replay_url(e){if(!this.sessionManager)return"";var{sessionId:t,sessionStartTimestamp:i}=this.sessionManager.checkAndGetSessionAndWindowId(!0),s=this.requestRouter.endpointFor("ui","/project/"+this.config.token+"/replay/"+t);if(null!=e&&e.withTimestamp&&i){var r,n=null!==(r=e.timestampLookBack)&&void 0!==r?r:10;if(!i)return s;s+="?t="+Math.max(Math.floor(((new Date).getTime()-i)/1e3)-n,0)}return s}alias(e,t){return e===this.get_property(qe)?(Se.critical("Attempting to create alias for existing People user - aborting."),-2):this.Bs("posthog.alias")?(A(t)&&(t=this.get_distinct_id()),e!==t?(this.Hs(Be,e),this.capture("$create_alias",{alias:e,distinct_id:t})):(Se.warn("alias matches current distinct_id - skipping api call."),this.identify(e),-1)):void 0}set_config(e){var t=y({},this.config);if(C(e)){var i,s,r,n,o;Ce(this.config,ga(e));var a=this.Cs();null==(i=this.persistence)||i.update_config(this.config,t,a),this.sessionPersistence="sessionStorage"===this.config.persistence||"memory"===this.config.persistence?this.persistence:new po(y({},this.config,{persistence:"sessionStorage"}),a),Ci.G()&&"true"===Ci.J("ph_debug")&&(this.config.debug=!0),this.config.debug&&(_.DEBUG=!0,Se.info("set_config",{config:e,oldConfig:t,newConfig:y({},this.config)})),null==(s=this.sessionRecording)||s.startIfEnabledOrStop(),null==(r=this.autocapture)||r.startIfEnabled(),null==(n=this.heatmaps)||n.startIfEnabled(),this.surveys.loadIfEnabled(),this.Ws(),null==(o=this.externalIntegrations)||o.startIfEnabledOrStop()}}startSessionRecording(e){var t,i,s,r,n,o=!0===e,a={sampling:o||!(null==e||!e.sampling),linked_flag:o||!(null==e||!e.linked_flag),url_trigger:o||!(null==e||!e.url_trigger),event_trigger:o||!(null==e||!e.event_trigger)};Object.values(a).some(Boolean)&&(null==(t=this.sessionManager)||t.checkAndGetSessionAndWindowId(),a.sampling&&(null==(i=this.sessionRecording)||i.overrideSampling()),a.linked_flag&&(null==(s=this.sessionRecording)||s.overrideLinkedFlag()),a.url_trigger&&(null==(r=this.sessionRecording)||r.overrideTrigger("url")),a.event_trigger&&(null==(n=this.sessionRecording)||n.overrideTrigger("event"))),this.set_config({disable_session_recording:!1})}stopSessionRecording(){this.set_config({disable_session_recording:!0})}sessionRecordingStarted(){var e;return!(null==(e=this.sessionRecording)||!e.started)}captureException(e,t){var i=new Error("PostHog syntheticException"),s=this.exceptions.buildProperties(e,{handled:!0,syntheticException:i});return this.exceptions.sendExceptionEvent(y({},s,t))}loadToolbar(e){return this.toolbar.loadToolbar(e)}get_property(e){var t;return null==(t=this.persistence)?void 0:t.props[e]}getSessionProperty(e){var t;return null==(t=this.sessionPersistence)?void 0:t.props[e]}toString(){var e,t=null!==(e=this.config.name)&&void 0!==e?e:ha;return t!==ha&&(t=ha+"."+t),t}_isIdentified(){var e,t;return"identified"===(null==(e=this.persistence)?void 0:e.get_property(yt))||"identified"===(null==(t=this.sessionPersistence)?void 0:t.get_property(yt))}qs(){var e,t;return!("never"===this.config.person_profiles||"identified_only"===this.config.person_profiles&&!this._isIdentified()&&T(this.getGroups())&&(null==(e=this.persistence)||null==(e=e.props)||!e[Be])&&(null==(t=this.persistence)||null==(t=t.props)||!t[xt]))}Ns(){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.qs()||this.Bs("posthog.createPersonProfile")&&this.setPersonProperties({},{})}Bs(e){return"never"===this.config.person_profiles?(Se.error(e+' was called, but process_person is set to "never". This call will be ignored.'),!1):(this.Hs(xt,!0),!0)}Cs(){if("always"===this.config.cookieless_mode)return!0;var e=this.consent.isOptedOut(),t=this.config.opt_out_persistence_by_default||"on_reject"===this.config.cookieless_mode;return this.config.disable_persistence||e&&!!t}Ws(){var e,t,i,s,r=this.Cs();return(null==(e=this.persistence)?void 0:e.je)!==r&&(null==(i=this.persistence)||i.set_disabled(r)),(null==(t=this.sessionPersistence)?void 0:t.je)!==r&&(null==(s=this.sessionPersistence)||s.set_disabled(r)),r}opt_in_capturing(e){var t;"always"!==this.config.cookieless_mode?("on_reject"===this.config.cookieless_mode&&this.consent.isExplicitlyOptedOut()&&(this.reset(!0),this.sessionManager=new Go(this),this.persistence&&(this.sessionPropsManager=new Uo(this,this.sessionManager,this.persistence)),this.sessionRecording=new gr(this),this.sessionRecording.startIfEnabledOrStop()),this.consent.optInOut(!0),this.Ws(),"on_reject"==this.config.cookieless_mode&&this.surveys.loadIfEnabled(),(A(null==e?void 0:e.captureEventName)||null!=e&&e.captureEventName)&&this.capture(null!==(t=null==e?void 0:e.captureEventName)&&void 0!==t?t:"$opt_in",null==e?void 0:e.captureProperties,{send_instantly:!0}),this.config.capture_pageview&&this.Ls()):Se.warn('Consent opt in/out is not valid with cookieless_mode="always" and will be ignored')}opt_out_capturing(){var e;"always"!==this.config.cookieless_mode?("on_reject"===this.config.cookieless_mode&&this.consent.isOptedIn()&&this.reset(!0),this.consent.optInOut(!1),this.Ws(),"on_reject"===this.config.cookieless_mode&&(this.register({distinct_id:Pt,$device_id:null}),this.sessionManager=void 0,this.sessionPropsManager=void 0,null==(e=this.sessionRecording)||e.stopRecording(),this.sessionRecording=void 0,this.Ls())):Se.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 e=this.consent.consent;return e===Ni.GRANTED?"granted":e===Ni.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.Ws()}_is_bot(){return l?Ko(l,this.config.custom_blocked_useragents):void 0}Ls(){c&&("visible"===c.visibilityState?this.xs||(this.xs=!0,this.capture("$pageview",{title:c.title},{send_instantly:!0}),this.Es&&(c.removeEventListener("visibilitychange",this.Es),this.Es=null)):this.Es||(this.Es=this.Ls.bind(this),je(c,"visibilitychange",this.Es)))}debug(e){!1===e?(null==s||s.console.log("You've disabled debug mode."),localStorage&&localStorage.removeItem("ph_debug"),this.set_config({debug:!1})):(null==s||s.console.log("You're now in debug mode. All calls to PostHog will be logged in your console.\nYou can disable this with `posthog.debug(false)`."),localStorage&&localStorage.setItem("ph_debug","true"),this.set_config({debug:!0}))}L(){var e,t,i,s,r,n,o=this.Is||{};return"advanced_disable_flags"in o?!!o.advanced_disable_flags:!1!==this.config.advanced_disable_flags?!!this.config.advanced_disable_flags:!0===this.config.advanced_disable_decide?(Se.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):(i="advanced_disable_decide",s=Se,r=(t="advanced_disable_flags")in(e=o)&&!A(e[t]),n=i in e&&!A(e[i]),r?e[t]:!!n&&(s&&s.warn("Config field '"+i+"' is deprecated. Please use '"+t+"' instead. The old field will be removed in a future major version."),e[i]))}zs(e){if(D(this.config.before_send))return e;var t=$(this.config.before_send)?this.config.before_send:[this.config.before_send],i=e;for(var s of t){if(i=s(i),D(i)){var r="Event '"+e.event+"' was rejected in beforeSend function";return j(e.event)?Se.warn(r+". This can cause unexpected behavior."):Se.info(r),null}i.properties&&!T(i.properties)||Se.warn("Event '"+e.event+"' has no properties after beforeSend function, this is likely an error.")}return i}getPageViewId(){var e;return null==(e=this.pageViewManager.fe)?void 0:e.pageViewId}captureTraceFeedback(e,t){this.capture("$ai_feedback",{$ai_trace_id:String(e),$ai_feedback_text:t})}captureTraceMetric(e,t,i){this.capture("$ai_metric",{$ai_trace_id:String(e),$ai_metric_name:t,$ai_metric_value:String(i)})}}!function(e,t){for(var i=0;i<t.length;i++)e.prototype[t[i]]=Me(e.prototype[t[i]])}(_a,["identify"]);var fa,ma=(fa=ca[ha]=new _a,function(){function e(){e.done||(e.done=!0,da=!1,Re(ca,function(e){e._dom_loaded()}))}null!=c&&c.addEventListener?"complete"===c.readyState?e():je(c,"DOMContentLoaded",e,{capture:!1}):s&&Se.error("Browser doesn't support `document.addEventListener` so PostHog couldn't be initialized")}(),fa)}}]);
|