@mcp-use/inspector 0.13.0-canary.8 → 0.13.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cli.js +2 -2
- package/dist/client/assets/{browser-C25bUfYp.js → browser-I_PMdsM0.js} +142 -142
- package/dist/client/assets/{display-A5IEINAP-ByZ9IIJl.js → display-A5IEINAP-5VPyRE5O.js} +2 -2
- package/dist/client/assets/embeddings-BNrmfKFy.js +1 -0
- package/dist/client/assets/fs-u42MReIY.js +1 -0
- package/dist/client/assets/index-BSdThYb2.js +7 -0
- package/dist/client/assets/index-BeJAljgp.js +1676 -0
- package/dist/client/assets/index-C5URJhI3.js +33 -0
- package/dist/client/assets/index-C74O6YE7.js +49 -0
- package/dist/client/assets/index-C8I8qFXo.js +80 -0
- package/dist/client/assets/index-CGBDt1uT.js +71 -0
- package/dist/client/assets/{index-DTt5KCEV.js → index-CJtjIp1D.js} +1 -1
- package/dist/client/assets/index-DQ7i0BFM.css +1 -0
- package/dist/client/assets/index-VuReKekR.js +40 -0
- package/dist/client/assets/{index-BRrjjTR6.js → index-rCIx5_U5.js} +2 -2
- package/dist/client/assets/llms-Bhs98QIx.js +2 -0
- package/dist/client/assets/module-D4IOASh4.js +4 -0
- package/dist/client/assets/path-B4EKd5uv.js +1 -0
- package/dist/client/assets/{winston-7dQlPZMw.js → winston-CO4zA-JC.js} +24 -24
- package/dist/client/index.html +3 -3
- package/dist/server/{chunk-OS2WTNLR.js → chunk-JEKCWLHD.js} +1 -1
- package/dist/server/{chunk-Z5QIR3IS.js → chunk-MCMZDGO6.js} +2 -2
- package/dist/server/{chunk-WLIY2SQG.js → chunk-XGILHZOF.js} +1 -1
- package/dist/server/cli.js +2 -2
- package/dist/server/index.js +3 -3
- package/dist/server/middleware.js +3 -3
- package/dist/server/server.js +2 -2
- package/dist/server/shared-routes.js +2 -2
- package/dist/server/shared-utils-browser.d.ts.map +1 -1
- package/dist/server/shared-utils-browser.js +1 -1
- package/package.json +29 -33
- package/dist/client/assets/embeddings-CgzAByVu.js +0 -1
- package/dist/client/assets/index-9hzrT5HP.js +0 -7
- package/dist/client/assets/index-CEBAtJQV.js +0 -33
- package/dist/client/assets/index-DPEqrSDR.js +0 -80
- package/dist/client/assets/index-Ddy9yyxP.js +0 -71
- package/dist/client/assets/index-Dq7UrqnC.js +0 -25
- package/dist/client/assets/index-FyLdp58J.js +0 -1707
- package/dist/client/assets/index-VOipG1yN.js +0 -8
- package/dist/client/assets/index-beDRbW3x.css +0 -1
- package/dist/client/assets/langfuse-74RGPTAH-ThX8caF_.js +0 -1
- package/dist/client/assets/module-DXhXtM9n.js +0 -4
- package/dist/client/assets/path-C8e-fwNk.js +0 -1
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
var d=typeof window<"u"?window:void 0,q=typeof globalThis<"u"?globalThis:d;typeof self>"u"&&(q.self=q),typeof File>"u"&&(q.File=function(){});var os=Array.prototype,lr=os.forEach,ur=os.indexOf,Q=q?.navigator,m=q?.document,Y=q?.location,Ei=q?.fetch,xi=q!=null&&q.XMLHttpRequest&&"withCredentials"in new q.XMLHttpRequest?q.XMLHttpRequest:void 0,cr=q?.AbortController,z=Q?.userAgent,x=d??{},_e={DEBUG:!1,LIB_VERSION:"1.306.1"};function hr(r,e,t,i,s,n,a){try{var o=r[n](a),l=o.value}catch(c){return void t(c)}o.done?e(l):Promise.resolve(l).then(i,s)}function dr(r){return function(){var e=this,t=arguments;return new Promise((function(i,s){var n=r.apply(e,t);function a(l){hr(n,i,s,a,o,"next",l)}function o(l){hr(n,i,s,a,o,"throw",l)}a(void 0)}))}}function b(){return b=Object.assign?Object.assign.bind():function(r){for(var e=1;e<arguments.length;e++){var t=arguments[e];for(var i in t)({}).hasOwnProperty.call(t,i)&&(r[i]=t[i])}return r},b.apply(null,arguments)}function ls(r,e){if(r==null)return{};var t={};for(var i in r)if({}.hasOwnProperty.call(r,i)){if(e.indexOf(i)!==-1)continue;t[i]=r[i]}return t}var wn=["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"],pr=function(r,e){if(e===void 0&&(e=[]),!r)return!1;var t=r.toLowerCase();return wn.concat(e).some((i=>{var s=i.toLowerCase();return t.indexOf(s)!==-1}))},En=["$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 S(r,e){return r.indexOf(e)!==-1}var Qt=function(r){return r.trim()},ki=function(r){return r.replace(/^\$/,"")},xn=Array.isArray,us=Object.prototype,cs=us.hasOwnProperty,ei=us.toString,T=xn||function(r){return ei.call(r)==="[object Array]"},Te=r=>typeof r=="function",H=r=>r===Object(r)&&!T(r),ze=r=>{if(H(r)){for(var e in r)if(cs.call(r,e))return!1;return!0}return!1},_=r=>r===void 0,U=r=>ei.call(r)=="[object String]",Si=r=>U(r)&&r.trim().length===0,we=r=>r===null,F=r=>_(r)||we(r),fe=r=>ei.call(r)=="[object Number]",Ce=r=>ei.call(r)==="[object Boolean]",kn=r=>r instanceof FormData,Sn=r=>S(En,r);function Pi(r){return r===null||typeof r!="object"}function Nt(r,e){return Object.prototype.toString.call(r)==="[object "+e+"]"}function hs(r){return!_(Event)&&(function(e,t){try{return e instanceof t}catch{return!1}})(r,Event)}var Pn=[!0,"true",1,"1","yes"],ni=r=>S(Pn,r),In=[!1,"false",0,"0","no"];function he(r,e,t,i,s){return e>t&&(i.warn("min cannot be greater than max."),e=t),fe(r)?r>t?(i.warn(" cannot be greater than max: "+t+". Using max value instead."),t):r<e?(i.warn(" cannot be less than min: "+e+". Using min value instead."),e):r:(i.warn(" must be a number. using max or fallback. max: "+t+", fallback: "+s),he(s||t,e,t,i))}class $n{constructor(e){this.t={},this.i=e.i,this.o=he(e.bucketSize,0,100,e.h),this.m=he(e.refillRate,0,this.o,e.h),this.S=he(e.refillInterval,0,864e5,e.h)}$(e,t){var i=t-e.lastAccess,s=Math.floor(i/this.S);if(s>0){var n=s*this.m;e.tokens=Math.min(e.tokens+n,this.o),e.lastAccess=e.lastAccess+s*this.S}}consumeRateLimit(e){var t,i=Date.now(),s=String(e),n=this.t[s];return n?this.$(n,i):(n={tokens:this.o,lastAccess:i},this.t[s]=n),n.tokens===0||(n.tokens--,n.tokens===0&&((t=this.i)==null||t.call(this,e)),n.tokens===0)}stop(){this.t={}}}var $t,fr,ai,Fn=r=>r instanceof Error;function Tn(r){var e=globalThis._posthogChunkIds;if(e){var t=Object.keys(e);return ai&&t.length===fr||(fr=t.length,ai=t.reduce(((i,s)=>{$t||($t={});var n=$t[s];if(n)i[n[0]]=n[1];else for(var a=r(s),o=a.length-1;o>=0;o--){var l=a[o],c=l?.filename,u=e[s];if(c&&u){i[c]=u,$t[s]=[c,u];break}}return i}),{})),ai}}class Cn{constructor(e,t,i){i===void 0&&(i=[]),this.coercers=e,this.stackParser=t,this.modifiers=i}buildFromUnknown(e,t){t===void 0&&(t={});var i=t&&t.mechanism||{handled:!0,type:"generic"},s=this.buildCoercingContext(i,t,0).apply(e),n=this.buildParsingContext(),a=this.parseStacktrace(s,n);return{$exception_list:this.convertToExceptionList(a,i),$exception_level:"error"}}modifyFrames(e){var t=this;return dr((function*(){for(var i of e)i.stacktrace&&i.stacktrace.frames&&T(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:(t=e.syntheticException)==null?void 0:t.stack,synthetic:!0}}parseStacktrace(e,t){var i,s;return e.cause!=null&&(i=this.parseStacktrace(e.cause,t)),e.stack!=""&&e.stack!=null&&(s=this.applyChunkIds(this.stackParser(e.stack,e.synthetic?1:0),t.chunkIdMap)),b({},e,{cause:i,stack:s})}applyChunkIds(e,t){return e.map((i=>(i.filename&&t&&(i.chunk_id=t[i.filename]),i)))}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 dr((function*(){var i=e;for(var s of t.modifiers)i=yield s(i);return i}))()}convertToExceptionList(e,t){var i,s,n,a={type:e.type,value:e.value,mechanism:{type:(i=t.type)!==null&&i!==void 0?i:"generic",handled:(s=t.handled)===null||s===void 0||s,synthetic:(n=e.synthetic)!==null&&n!==void 0&&n}};e.stack&&(a.stacktrace={type:"raw",frames:e.stack});var o=[a];return e.cause!=null&&o.push(...this.convertToExceptionList(e.cause,b({},t,{handled:!0}))),o}buildParsingContext(){return{chunkIdMap:Tn(this.stackParser)}}buildCoercingContext(e,t,i){i===void 0&&(i=0);var s=(n,a)=>{if(a<=4){var o=this.buildCoercingContext(e,t,a);return this.applyCoercers(n,o)}};return b({},t,{syntheticException:i==0?t.syntheticException:void 0,mechanism:e,apply:n=>s(n,i),next:n=>s(n,i+1)})}}var Ke="?";function Ii(r,e,t,i,s){var n={platform:r,filename:e,function:t==="<anonymous>"?Ke:t,in_app:!0};return _(i)||(n.lineno=i),_(s)||(n.colno=s),n}var ds=(r,e)=>{var t=r.indexOf("safari-extension")!==-1,i=r.indexOf("safari-web-extension")!==-1;return t||i?[r.indexOf("@")!==-1?r.split("@")[0]:Ke,t?"safari-extension:"+e:"safari-web-extension:"+e]:[r,e]},Rn=/^\s*at (\S+?)(?::(\d+))(?::(\d+))\s*$/i,On=/^\s*at (?:(.+?\)(?: \[.+\])?|.*?) ?\((?:address at )?)?(?:async )?((?:<anonymous>|[-a-z]+:|.*bundle|\/)?.*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i,Mn=/\((\S*)(?::(\d+))(?::(\d+))\)/,An=(r,e)=>{var t=Rn.exec(r);if(t){var[,i,s,n]=t;return Ii(e,i,Ke,+s,+n)}var a=On.exec(r);if(a){if(a[2]&&a[2].indexOf("eval")===0){var o=Mn.exec(a[2]);o&&(a[2]=o[1],a[3]=o[2],a[4]=o[3])}var[l,c]=ds(a[1]||Ke,a[2]);return Ii(e,c,l,a[3]?+a[3]:void 0,a[4]?+a[4]:void 0)}},Dn=/^\s*(.*?)(?:\((.*?)\))?(?:^|@)?((?:[-a-z]+)?:\/.*?|\[native code\]|[^@]*(?:bundle|\d+\.js)|\/[\w\-. /=]+)(?::(\d+))?(?::(\d+))?\s*$/i,Ln=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i,Nn=(r,e)=>{var t=Dn.exec(r);if(t){if(t[3]&&t[3].indexOf(" > eval")>-1){var i=Ln.exec(t[3]);i&&(t[1]=t[1]||"eval",t[3]=i[1],t[4]=i[2],t[5]="")}var s=t[3],n=t[1]||Ke;return[n,s]=ds(n,s),Ii(e,s,n,t[4]?+t[4]:void 0,t[5]?+t[5]:void 0)}},gr=/\(error: (.*)\)/,vr=50;function Un(r){for(var e=arguments.length,t=new Array(e>1?e-1:0),i=1;i<e;i++)t[i-1]=arguments[i];return function(s,n){n===void 0&&(n=0);for(var a=[],o=s.split(`
|
|
2
|
+
`),l=n;l<o.length;l++){var c=o[l];if(!(c.length>1024)){var u=gr.test(c)?c.replace(gr,"$1"):c;if(!u.match(/\S*Error: /)){for(var h of t){var p=h(u,r);if(p){a.push(p);break}}if(a.length>=vr)break}}}return(function(f){if(!f.length)return[];var v=Array.from(f);return v.reverse(),v.slice(0,vr).map((g=>{return b({},g,{filename:g.filename||(E=v,E[E.length-1]||{}).filename,function:g.function||Ke});var E}))})(a)}}class Hn{match(e){return this.isDOMException(e)||this.isDOMError(e)}coerce(e,t){var i=U(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 Nt(e,"DOMException")}isDOMError(e){return Nt(e,"DOMError")}}class jn{match(e){return(t=>t 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&&typeof i.error.message=="string"?String(i.error.message):String(i)}getStack(e){return e.stacktrace||e.stack||void 0}}class qn{constructor(){}match(e){return Nt(e,"ErrorEvent")&&e.error!=null}coerce(e,t){var i,s=t.apply(e.error);return s||{type:"ErrorEvent",value:e.message,stack:(i=t.syntheticException)==null?void 0:i.stack,synthetic:!0}}}var Bn=/^(?:[Uu]ncaught (?:exception: )?)?(?:((?:Eval|Internal|Range|Reference|Syntax|Type|URI|)Error): )?(.*)$/i;class Vn{match(e){return typeof e=="string"}coerce(e,t){var i,[s,n]=this.getInfos(e);return{type:s??"Error",value:n??e,stack:(i=t.syntheticException)==null?void 0:i.stack,synthetic:!0}}getInfos(e){var t="Error",i=e,s=e.match(Bn);return s&&(t=s[1],i=s[2]),[t,i]}}var Gn=["fatal","error","warning","log","info","debug"];function ps(r,e){e===void 0&&(e=40);var t=Object.keys(r);if(t.sort(),!t.length)return"[object has no keys]";for(var i=t.length;i>0;i--){var s=t.slice(0,i).join(", ");if(!(s.length>e))return i===t.length||s.length<=e?s:s.slice(0,e)+"..."}return""}class Wn{match(e){return typeof e=="object"&&e!==null}coerce(e,t){var i,s=this.getErrorPropertyFromObject(e);return s?t.apply(s):{type:this.getType(e),value:this.getValue(e),stack:(i=t.syntheticException)==null?void 0:i.stack,level:this.isSeverityLevel(e.level)?e.level:"error",synthetic:!0}}getType(e){return hs(e)?e.constructor.name:"Error"}getValue(e){if("name"in e&&typeof e.name=="string"){var t="'"+e.name+"' captured as exception";return"message"in e&&typeof e.message=="string"&&(t+=" with message: '"+e.message+"'"),t}if("message"in e&&typeof e.message=="string")return e.message;var i=this.getObjectClassName(e);return(i&&i!=="Object"?"'"+i+"'":"Object")+" captured as exception with keys: "+ps(e)}isSeverityLevel(e){return U(e)&&!Si(e)&&Gn.indexOf(e)>=0}getErrorPropertyFromObject(e){for(var t in e)if(Object.prototype.hasOwnProperty.call(e,t)){var i=e[t];if(Fn(i))return i}}getObjectClassName(e){try{var t=Object.getPrototypeOf(e);return t?t.constructor.name:void 0}catch{return}}}class zn{match(e){return hs(e)}coerce(e,t){var i,s=e.constructor.name;return{type:s,value:s+" captured as exception with keys: "+ps(e),stack:(i=t.syntheticException)==null?void 0:i.stack,synthetic:!0}}}class Yn{match(e){return Pi(e)}coerce(e,t){var i;return{type:"Error",value:"Primitive value captured as exception: "+String(e),stack:(i=t.syntheticException)==null?void 0:i.stack,synthetic:!0}}}class Jn{match(e){return Nt(e,"PromiseRejectionEvent")}coerce(e,t){var i,s=this.getUnhandledRejectionReason(e);return Pi(s)?{type:"UnhandledRejection",value:"Non-Error promise rejection captured with value: "+String(s),stack:(i=t.syntheticException)==null?void 0:i.stack,synthetic:!0}:t.apply(s)}getUnhandledRejectionReason(e){if(Pi(e))return e;try{if("reason"in e)return e.reason;if("detail"in e&&"reason"in e.detail)return e.detail.reason}catch{}return e}}var fs=function(r,e){var{debugEnabled:t}=e===void 0?{}:e,i={k:function(s){if(d&&(_e.DEBUG||x.POSTHOG_DEBUG||t)&&!_(d.console)&&d.console){for(var n=("__rrweb_original__"in d.console[s])?d.console[s].__rrweb_original__:d.console[s],a=arguments.length,o=new Array(a>1?a-1:0),l=1;l<a;l++)o[l-1]=arguments[l];n(r,...o)}},info:function(){for(var s=arguments.length,n=new Array(s),a=0;a<s;a++)n[a]=arguments[a];i.k("log",...n)},warn:function(){for(var s=arguments.length,n=new Array(s),a=0;a<s;a++)n[a]=arguments[a];i.k("warn",...n)},error:function(){for(var s=arguments.length,n=new Array(s),a=0;a<s;a++)n[a]=arguments[a];i.k("error",...n)},critical:function(){for(var s=arguments.length,n=new Array(s),a=0;a<s;a++)n[a]=arguments[a];console.error(r,...n)},uninitializedWarning:s=>{i.error("You must initialize PostHog before calling "+s)},createLogger:(s,n)=>fs(r+" "+s,n)};return i},y=fs("[PostHog.js]"),N=y.createLogger,Xn=N("[ExternalScriptsLoader]"),_r=(r,e,t)=>{if(r.config.disable_external_dependency_loading)return Xn.warn(e+" was requested but loading of external scripts is disabled."),t("Loading of external scripts is disabled");var i=m?.querySelectorAll("script");if(i){for(var s,n=function(){if(i[a].src===e){var l=i[a];return l.__posthog_loading_callback_fired?{v:t()}:(l.addEventListener("load",(c=>{l.__posthog_loading_callback_fired=!0,t(void 0,c)})),l.onerror=c=>t(c),{v:void 0})}},a=0;a<i.length;a++)if(s=n())return s.v}var o=()=>{if(!m)return t("document not found");var l=m.createElement("script");if(l.type="text/javascript",l.crossOrigin="anonymous",l.src=e,l.onload=h=>{l.__posthog_loading_callback_fired=!0,t(void 0,h)},l.onerror=h=>t(h),r.config.prepare_external_dependency_script&&(l=r.config.prepare_external_dependency_script(l)),!l)return t("prepare_external_dependency_script returned null");var c,u=m.querySelectorAll("body > script");u.length>0?(c=u[0].parentNode)==null||c.insertBefore(l,u[0]):m.body.appendChild(l)};m!=null&&m.body?o():m?.addEventListener("DOMContentLoaded",o)};x.__PosthogExtensions__=x.__PosthogExtensions__||{},x.__PosthogExtensions__.loadExternalDependency=(r,e,t)=>{var i="/static/"+e+".js?v="+r.version;if(e==="remote-config"&&(i="/array/"+r.config.token+"/config.js"),e==="toolbar"){var s=3e5;i=i+"&t="+Math.floor(Date.now()/s)*s}var n=r.requestRouter.endpointFor("assets",i);_r(r,n,t)},x.__PosthogExtensions__.loadSiteApp=(r,e,t)=>{var i=r.requestRouter.endpointFor("api",e);_r(r,i,t)};var Ut={};function Re(r,e,t){if(T(r)){if(lr&&r.forEach===lr)r.forEach(e,t);else if("length"in r&&r.length===+r.length){for(var i=0,s=r.length;i<s;i++)if(i in r&&e.call(t,r[i],i)===Ut)return}}}function R(r,e,t){if(!F(r)){if(T(r))return Re(r,e,t);if(kn(r)){for(var i of r.entries())if(e.call(t,i[1],i[0])===Ut)return}else for(var s in r)if(cs.call(r,s)&&e.call(t,r[s],s)===Ut)return}}var D=function(r){for(var e=arguments.length,t=new Array(e>1?e-1:0),i=1;i<e;i++)t[i-1]=arguments[i];return Re(t,(function(s){for(var n in s)s[n]!==void 0&&(r[n]=s[n])})),r},et=function(r){for(var e=arguments.length,t=new Array(e>1?e-1:0),i=1;i<e;i++)t[i-1]=arguments[i];return Re(t,(function(s){Re(s,(function(n){r.push(n)}))})),r};function At(r){for(var e=Object.keys(r),t=e.length,i=new Array(t);t--;)i[t]=[e[t],r[e[t]]];return i}var mr=function(r){try{return r()}catch{return}},Kn=function(r){return function(){try{for(var e=arguments.length,t=new Array(e),i=0;i<e;i++)t[i]=arguments[i];return r.apply(this,t)}catch(s){y.critical("Implementation error. Please turn on debug mode and open a ticket on https://app.posthog.com/home#panel=support%3Asupport%3A."),y.critical(s)}}},zi=function(r){var e={};return R(r,(function(t,i){(U(t)&&t.length>0||fe(t))&&(e[i]=t)})),e};function Zn(r,e){return t=r,i=n=>U(n)&&!we(e)?n.slice(0,e):n,s=new Set,(function n(a,o){return a!==Object(a)?i?i(a,o):a:s.has(a)?void 0:(s.add(a),T(a)?(l=[],Re(a,(c=>{l.push(n(c))}))):(l={},R(a,((c,u)=>{s.has(c)||(l[u]=n(c,u))}))),l);var l})(t);var t,i,s}var Qn=["herokuapp.com","vercel.app","netlify.app"];function ea(r){var e=r?.hostname;if(!U(e))return!1;var t=e.split(".").slice(-2).join(".");for(var i of Qn)if(t===i)return!1;return!0}function gs(r,e){for(var t=0;t<r.length;t++)if(e(r[t]))return r[t]}function L(r,e,t,i){var{capture:s=!1,passive:n=!0}=i??{};r?.addEventListener(e,t,{capture:s,passive:n})}var vs="$people_distinct_id",ht="__alias",dt="__timers",yr="$autocapture_disabled_server_side",$i="$heatmaps_enabled_server_side",br="$exception_capture_enabled_server_side",Fi="$error_tracking_suppression_rules",wr="$error_tracking_capture_extension_exceptions",Er="$web_vitals_enabled_server_side",_s="$dead_clicks_enabled_server_side",xr="$web_vitals_allowed_metrics",oi="$session_recording_remote_config",Ht="$sesid",ms="$session_is_sampled",Ye="$enabled_feature_flags",pt="$early_access_features",Ti="$feature_flag_details",ft="$stored_person_properties",Ne="$stored_group_properties",Ci="$surveys",Ft="$surveys_activated",jt="$flag_call_reported",me="$user_state",Ri="$client_session_props",Oi="$capture_rate_limit",Mi="$initial_campaign_params",Ai="$initial_referrer_info",qt="$initial_person_info",Bt="$epp",ys="__POSTHOG_TOOLBAR__",it="$posthog_cookieless",ta=[vs,ht,"__cmpns",dt,"$session_recording_enabled_server_side",$i,Ht,Ye,Fi,me,pt,Ti,Ne,ft,Ci,jt,Ri,Oi,Mi,Ai,Bt,qt];function kr(r){return r instanceof Element&&(r.id===ys||!(r.closest==null||!r.closest(".toolbar-global-fade-container")))}function ti(r){return!!r&&r.nodeType===1}function Oe(r,e){return!!r&&!!r.tagName&&r.tagName.toLowerCase()===e.toLowerCase()}function bs(r){return!!r&&r.nodeType===3}function ws(r){return!!r&&r.nodeType===11}function Yi(r){return r?Qt(r).split(/\s+/):[]}function Sr(r){var e=d?.location.href;return!!(e&&r&&r.some((t=>e.match(t))))}function Vt(r){var e="";switch(typeof r.className){case"string":e=r.className;break;case"object":e=(r.className&&"baseVal"in r.className?r.className.baseVal:null)||r.getAttribute("class")||"";break;default:e=""}return Yi(e)}function Es(r){return F(r)?null:Qt(r).split(/(\s+)/).filter((e=>bt(e))).join("").replace(/[\r\n]/g," ").replace(/[ ]+/g," ").substring(0,255)}function St(r){var e="";return Di(r)&&!Is(r)&&r.childNodes&&r.childNodes.length&&R(r.childNodes,(function(t){var i;bs(t)&&t.textContent&&(e+=(i=Es(t.textContent))!==null&&i!==void 0?i:"")})),Qt(e)}function xs(r){return _(r.target)?r.srcElement||null:(e=r.target)!=null&&e.shadowRoot?r.composedPath()[0]||null:r.target||null;var e}var Ji=["a","button","form","input","select","textarea","label"];function ks(r,e){if(_(e))return!0;var t,i=function(n){if(e.some((a=>n.matches(a))))return{v:!0}};for(var s of r)if(t=i(s))return t.v;return!1}function Ss(r){var e=r.parentNode;return!(!e||!ti(e))&&e}var ia=["next","previous","prev",">","<"],Pr=10,Ir=[".ph-no-rageclick",".ph-no-capture"];function ra(r,e){if(!d||Xi(r))return!1;var t,i,s;if(Ce(e)?(t=!!e&&Ir,i=void 0):(t=(s=e?.css_selector_ignorelist)!==null&&s!==void 0?s:Ir,i=e?.content_ignorelist),t===!1)return!1;var{targetElementList:n}=Ps(r,!1);return!(function(a,o){if(a===!1||_(a))return!1;var l;if(a===!0)l=ia;else{if(!T(a))return!1;if(a.length>Pr)return y.error("[PostHog] content_ignorelist array cannot exceed "+Pr+" items. Use css_selector_ignorelist for more complex matching."),!1;l=a.map((c=>c.toLowerCase()))}return o.some((c=>{var{safeText:u,ariaLabel:h}=c;return l.some((p=>u.includes(p)||h.includes(p)))}))})(i,n.map((a=>{var o;return{safeText:St(a).toLowerCase(),ariaLabel:((o=a.getAttribute("aria-label"))==null?void 0:o.toLowerCase().trim())||""}})))&&!ks(n,t)}var Xi=r=>!r||Oe(r,"html")||!ti(r),Ps=(r,e)=>{if(!d||Xi(r))return{parentIsUsefulElement:!1,targetElementList:[]};for(var t=!1,i=[r],s=r;s.parentNode&&!Oe(s,"body");)if(ws(s.parentNode))i.push(s.parentNode.host),s=s.parentNode.host;else{var n=Ss(s);if(!n)break;if(e||Ji.indexOf(n.tagName.toLowerCase())>-1)t=!0;else{var a=d.getComputedStyle(n);a&&a.getPropertyValue("cursor")==="pointer"&&(t=!0)}i.push(n),s=n}return{parentIsUsefulElement:t,targetElementList:i}};function sa(r,e,t,i,s){var n,a,o,l;if(t===void 0&&(t=void 0),!d||Xi(r)||(n=t)!=null&&n.url_allowlist&&!Sr(t.url_allowlist)||(a=t)!=null&&a.url_ignorelist&&Sr(t.url_ignorelist))return!1;if((o=t)!=null&&o.dom_event_allowlist){var c=t.dom_event_allowlist;if(c&&!c.some((v=>e.type===v)))return!1}var{parentIsUsefulElement:u,targetElementList:h}=Ps(r,i);if(!(function(v,g){var E=g?.element_allowlist;if(_(E))return!0;var w,k=function(P){if(E.some((O=>P.tagName.toLowerCase()===O)))return{v:!0}};for(var $ of v)if(w=k($))return w.v;return!1})(h,t)||!ks(h,(l=t)==null?void 0:l.css_selector_allowlist))return!1;var p=d.getComputedStyle(r);if(p&&p.getPropertyValue("cursor")==="pointer"&&e.type==="click")return!0;var f=r.tagName.toLowerCase();switch(f){case"html":return!1;case"form":return(s||["submit"]).indexOf(e.type)>=0;case"input":case"select":case"textarea":return(s||["change","click"]).indexOf(e.type)>=0;default:return u?(s||["click"]).indexOf(e.type)>=0:(s||["click"]).indexOf(e.type)>=0&&(Ji.indexOf(f)>-1||r.getAttribute("contenteditable")==="true")}}function Di(r){for(var e=r;e.parentNode&&!Oe(e,"body");e=e.parentNode){var t=Vt(e);if(S(t,"ph-sensitive")||S(t,"ph-no-capture"))return!1}if(S(Vt(r),"ph-include"))return!0;var i=r.type||"";if(U(i))switch(i.toLowerCase()){case"hidden":case"password":return!1}var s=r.name||r.id||"";return!(U(s)&&/^cc|cardnum|ccnum|creditcard|csc|cvc|cvv|exp|pass|pwd|routing|seccode|securitycode|securitynum|socialsec|socsec|ssn/i.test(s.replace(/[^a-zA-Z0-9]/g,"")))}function Is(r){return!!(Oe(r,"input")&&!["button","checkbox","submit","reset"].includes(r.type)||Oe(r,"select")||Oe(r,"textarea")||r.getAttribute("contenteditable")==="true")}var $s="(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})",na=new RegExp("^(?:"+$s+")$"),aa=new RegExp($s),Fs="\\d{3}-?\\d{2}-?\\d{4}",oa=new RegExp("^("+Fs+")$"),la=new RegExp("("+Fs+")");function bt(r,e){return e===void 0&&(e=!0),!(F(r)||U(r)&&(r=Qt(r),(e?na:aa).test((r||"").replace(/[- ]/g,""))||(e?oa:la).test(r)))}function Ts(r){var e=St(r);return bt(e=(e+" "+Cs(r)).trim())?e:""}function Cs(r){var e="";return r&&r.childNodes&&r.childNodes.length&&R(r.childNodes,(function(t){var i;if(t&&((i=t.tagName)==null?void 0:i.toLowerCase())==="span")try{var s=St(t);e=(e+" "+s).trim(),t.childNodes&&t.childNodes.length&&(e=(e+" "+Cs(t)).trim())}catch(n){y.error("[AutoCapture]",n)}})),e}function ua(r){return(function(e){var t=e.map((i=>{var s,n,a="";if(i.tag_name&&(a+=i.tag_name),i.attr_class)for(var o of(i.attr_class.sort(),i.attr_class))a+="."+o.replace(/"/g,"");var l=b({},i.text?{text:i.text}:{},{"nth-child":(s=i.nth_child)!==null&&s!==void 0?s:0,"nth-of-type":(n=i.nth_of_type)!==null&&n!==void 0?n:0},i.href?{href:i.href}:{},i.attr_id?{attr_id:i.attr_id}:{},i.attributes),c={};return At(l).sort(((u,h)=>{var[p]=u,[f]=h;return p.localeCompare(f)})).forEach((u=>{var[h,p]=u;return c[$r(h.toString())]=$r(p.toString())})),a+=":",a+=At(c).map((u=>{var[h,p]=u;return h+'="'+p+'"'})).join("")}));return t.join(";")})((function(e){return e.map((t=>{var i,s,n={text:(i=t.$el_text)==null?void 0:i.slice(0,400),tag_name:t.tag_name,href:(s=t.attr__href)==null?void 0:s.slice(0,2048),attr_class:ca(t),attr_id:t.attr__id,nth_child:t.nth_child,nth_of_type:t.nth_of_type,attributes:{}};return At(t).filter((a=>{var[o]=a;return o.indexOf("attr__")===0})).forEach((a=>{var[o,l]=a;return n.attributes[o]=l})),n}))})(r))}function $r(r){return r.replace(/"|\\"/g,'\\"')}function ca(r){var e=r.attr__class;return e?T(e)?e:Yi(e):void 0}class Rs{constructor(e){this.disabled=e===!1;var t=H(e)?e:{};this.thresholdPx=t.threshold_px||30,this.timeoutMs=t.timeout_ms||1e3,this.clickCount=t.click_count||3,this.clicks=[]}isRageClick(e,t,i){if(this.disabled)return!1;var s=this.clicks[this.clicks.length-1];if(s&&Math.abs(e-s.x)+Math.abs(t-s.y)<this.thresholdPx&&i-s.timestamp<this.timeoutMs){if(this.clicks.push({x:e,y:t,timestamp:i}),this.clicks.length===this.clickCount)return!0}else this.clicks=[{x:e,y:t,timestamp:i}];return!1}}var li="$copy_autocapture",be=(function(r){return r.GZipJS="gzip-js",r.Base64="base64",r})({}),Ao=["fatal","error","warning","log","info","debug"],Gt=r=>{var e=m?.createElement("a");return _(e)?null:(e.href=r,e)},ha=function(r,e){var t,i;e===void 0&&(e="&");var s=[];return R(r,(function(n,a){_(n)||_(a)||a==="undefined"||(t=encodeURIComponent((o=>o instanceof File)(n)?n.name:n.toString()),i=encodeURIComponent(a),s[s.length]=i+"="+t)})),s.join(e)},Wt=function(r,e){for(var t,i=((r.split("#")[0]||"").split(/\?(.*)/)[1]||"").replace(/^\?+/g,"").split("&"),s=0;s<i.length;s++){var n=i[s].split("=");if(n[0]===e){t=n;break}}if(!T(t)||t.length<2)return"";var a=t[1];try{a=decodeURIComponent(a)}catch{y.error("Skipping decoding for malformed query param: "+a)}return a.replace(/\+/g," ")},Pt=function(r,e,t){if(!r||!e||!e.length)return r;for(var i=r.split("#"),s=i[0]||"",n=i[1],a=s.split("?"),o=a[1],l=a[0],c=(o||"").split("&"),u=[],h=0;h<c.length;h++){var p=c[h].split("=");T(p)&&(e.includes(p[0])?u.push(p[0]+"="+t):u.push(c[h]))}var f=l;return o!=null&&(f+="?"+u.join("&")),n!=null&&(f+="#"+n),f},zt=function(r,e){var t=r.match(new RegExp(e+"=([^&]*)"));return t?t[1]:null},Fr=N("[AutoCapture]");function ui(r,e){return e.length>r?e.slice(0,r)+"...":e}function da(r){if(r.previousElementSibling)return r.previousElementSibling;var e=r;do e=e.previousSibling;while(e&&!ti(e));return e}function pa(r,e,t,i){var s=r.tagName.toLowerCase(),n={tag_name:s};Ji.indexOf(s)>-1&&!t&&(s.toLowerCase()==="a"||s.toLowerCase()==="button"?n.$el_text=ui(1024,Ts(r)):n.$el_text=ui(1024,St(r)));var a=Vt(r);a.length>0&&(n.classes=a.filter((function(u){return u!==""}))),R(r.attributes,(function(u){var h;if((!Is(r)||["name","id","class","aria-label"].indexOf(u.name)!==-1)&&(i==null||!i.includes(u.name))&&!e&&bt(u.value)&&(h=u.name,!U(h)||h.substring(0,10)!=="_ngcontent"&&h.substring(0,7)!=="_nghost")){var p=u.value;u.name==="class"&&(p=Yi(p).join(" ")),n["attr__"+u.name]=ui(1024,p)}}));for(var o=1,l=1,c=r;c=da(c);)o++,c.tagName===r.tagName&&l++;return n.nth_child=o,n.nth_of_type=l,n}function fa(r,e){for(var t,i,{e:s,maskAllElementAttributes:n,maskAllText:a,elementAttributeIgnoreList:o,elementsChainAsString:l}=e,c=[r],u=r;u.parentNode&&!Oe(u,"body");)ws(u.parentNode)?(c.push(u.parentNode.host),u=u.parentNode.host):(c.push(u.parentNode),u=u.parentNode);var h,p=[],f={},v=!1,g=!1;if(R(c,(P=>{var O=Di(P);P.tagName.toLowerCase()==="a"&&(v=P.getAttribute("href"),v=O&&v&&bt(v)&&v),S(Vt(P),"ph-no-capture")&&(g=!0),p.push(pa(P,n,a,o));var se=(function(X){if(!Di(X))return{};var I={};return R(X.attributes,(function(oe){if(oe.name&&oe.name.indexOf("data-ph-capture-attribute")===0){var K=oe.name.replace("data-ph-capture-attribute-",""),ne=oe.value;K&&ne&&bt(ne)&&(I[K]=ne)}})),I})(P);D(f,se)})),g)return{props:{},explicitNoCapture:g};if(a||(r.tagName.toLowerCase()==="a"||r.tagName.toLowerCase()==="button"?p[0].$el_text=Ts(r):p[0].$el_text=St(r)),v){var E,w;p[0].attr__href=v;var k=(E=Gt(v))==null?void 0:E.host,$=d==null||(w=d.location)==null?void 0:w.host;k&&$&&k!==$&&(h=v)}return{props:D({$event_type:s.type,$ce_version:1},l?{}:{$elements:p},{$elements_chain:ua(p)},(t=p[0])!=null&&t.$el_text?{$el_text:(i=p[0])==null?void 0:i.$el_text}:{},h&&s.type==="click"?{$external_click_url:h}:{},f)}}class ga{constructor(e){this.P=!1,this.T=null,this.R=!1,this.instance=e,this.rageclicks=new Rs(e.config.rageclick),this.C=null}get I(){var e,t,i=H(this.instance.config.autocapture)?this.instance.config.autocapture:{};return i.url_allowlist=(e=i.url_allowlist)==null?void 0:e.map((s=>new RegExp(s))),i.url_ignorelist=(t=i.url_ignorelist)==null?void 0:t.map((s=>new RegExp(s))),i}F(){if(this.isBrowserSupported()){if(d&&m){var e=i=>{i=i||d?.event;try{this.M(i)}catch(s){Fr.error("Failed to capture event",s)}};if(L(m,"submit",e,{capture:!0}),L(m,"change",e,{capture:!0}),L(m,"click",e,{capture:!0}),this.I.capture_copied_text){var t=i=>{i=i||d?.event,this.M(i,li)};L(m,"copy",t,{capture:!0}),L(m,"cut",t,{capture:!0})}}}else Fr.info("Disabling Automatic Event Collection because this browser is not supported")}startIfEnabled(){this.isEnabled&&!this.P&&(this.F(),this.P=!0)}onRemoteConfig(e){e.elementsChainAsString&&(this.R=e.elementsChainAsString),this.instance.persistence&&this.instance.persistence.register({[yr]:!!e.autocapture_opt_out}),this.T=!!e.autocapture_opt_out,this.startIfEnabled()}setElementSelectors(e){this.C=e}getElementSelectors(e){var t,i=[];return(t=this.C)==null||t.forEach((s=>{var n=m?.querySelectorAll(s);n?.forEach((a=>{e===a&&i.push(s)}))})),i}get isEnabled(){var e,t,i=(e=this.instance.persistence)==null?void 0:e.props[yr],s=this.T;if(we(s)&&!Ce(i)&&!this.instance.O())return!1;var n=(t=this.T)!==null&&t!==void 0?t:!!i;return!!this.instance.config.autocapture&&!n}M(e,t){if(t===void 0&&(t="$autocapture"),this.isEnabled){var i,s=xs(e);bs(s)&&(s=s.parentNode||null),t==="$autocapture"&&e.type==="click"&&e instanceof MouseEvent&&this.instance.config.rageclick&&(i=this.rageclicks)!=null&&i.isRageClick(e.clientX,e.clientY,e.timeStamp||new Date().getTime())&&ra(s,this.instance.config.rageclick)&&this.M(e,"$rageclick");var n=t===li;if(s&&sa(s,e,this.I,n,n?["copy","cut"]:void 0)){var{props:a,explicitNoCapture:o}=fa(s,{e,maskAllElementAttributes:this.instance.config.mask_all_element_attributes,maskAllText:this.instance.config.mask_all_text,elementAttributeIgnoreList:this.I.element_attribute_ignorelist,elementsChainAsString:this.R});if(o)return!1;var l=this.getElementSelectors(s);if(l&&l.length>0&&(a.$element_selectors=l),t===li){var c,u=Es(d==null||(c=d.getSelection())==null?void 0:c.toString()),h=e.type||"clipboard";if(!u)return!1;a.$selected_content=u,a.$copy_type=h}return this.instance.capture(t,a),!0}}}isBrowserSupported(){return Te(m?.querySelectorAll)}}Math.trunc||(Math.trunc=function(r){return r<0?Math.ceil(r):Math.floor(r)}),Number.isInteger||(Number.isInteger=function(r){return fe(r)&&isFinite(r)&&Math.floor(r)===r});var Tr="0123456789abcdef";class Yt{constructor(e){if(this.bytes=e,e.length!==16)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 n=new Uint8Array(16);return n[0]=e/Math.pow(2,40),n[1]=e/Math.pow(2,32),n[2]=e/Math.pow(2,24),n[3]=e/Math.pow(2,16),n[4]=e/Math.pow(2,8),n[5]=e,n[6]=112|t>>>8,n[7]=t,n[8]=128|i>>>24,n[9]=i>>>16,n[10]=i>>>8,n[11]=i,n[12]=s>>>24,n[13]=s>>>16,n[14]=s>>>8,n[15]=s,new Yt(n)}toString(){for(var e="",t=0;t<this.bytes.length;t++)e=e+Tr.charAt(this.bytes[t]>>>4)+Tr.charAt(15&this.bytes[t]),t!==3&&t!==5&&t!==7&&t!==9||(e+="-");if(e.length!==36)throw new Error("Invalid UUIDv7 was generated");return e}clone(){return new Yt(this.bytes.slice(0))}equals(e){return this.compareTo(e)===0}compareTo(e){for(var t=0;t<16;t++){var i=this.bytes[t]-e.bytes[t];if(i!==0)return Math.sign(i)}return 0}}class va{constructor(){this.A=0,this.D=0,this.j=new _a}generate(){var e=this.generateOrAbort();if(_(e)){this.A=0;var t=this.generateOrAbort();if(_(t))throw new Error("Could not generate UUID after timestamp reset");return t}return e}generateOrAbort(){var e=Date.now();if(e>this.A)this.A=e,this.L();else{if(!(e+1e4>this.A))return;this.D++,this.D>4398046511103&&(this.A++,this.L())}return Yt.fromFieldsV7(this.A,Math.trunc(this.D/Math.pow(2,30)),this.D&Math.pow(2,30)-1,this.j.nextUint32())}L(){this.D=1024*this.j.nextUint32()+(1023&this.j.nextUint32())}}var Cr,Os=r=>{if(typeof UUIDV7_DENY_WEAK_RNG<"u"&&UUIDV7_DENY_WEAK_RNG)throw new Error("no cryptographically strong RNG available");for(var e=0;e<r.length;e++)r[e]=65536*Math.trunc(65536*Math.random())+Math.trunc(65536*Math.random());return r};d&&!_(d.crypto)&&crypto.getRandomValues&&(Os=r=>crypto.getRandomValues(r));class _a{constructor(){this.N=new Uint32Array(8),this.U=1/0}nextUint32(){return this.U>=this.N.length&&(Os(this.N),this.U=0),this.N[this.U++]}}var Fe=()=>ma().toString(),ma=()=>(Cr||(Cr=new va)).generate(),rt="",ya=/[a-z0-9][a-z0-9-]+\.[a-z]{2,}$/i;function ba(r,e){if(e){var t=(function(s,n){if(n===void 0&&(n=m),rt)return rt;if(!n||["localhost","127.0.0.1"].includes(s))return"";for(var a=s.split("."),o=Math.min(a.length,8),l="dmn_chk_"+Fe();!rt&&o--;){var c=a.slice(o).join("."),u=l+"=1;domain=."+c+";path=/";n.cookie=u+";max-age=3",n.cookie.includes(l)&&(n.cookie=u+";max-age=0",rt=c)}return rt})(r);if(!t){var i=(s=>{var n=s.match(ya);return n?n[0]:""})(r);i!==t&&y.info("Warning: cookie subdomain discovery mismatch",i,t),t=i}return t?"; domain=."+t:""}return""}var pe={H:()=>!!m,B:function(r){y.error("cookieStore error: "+r)},q:function(r){if(m){try{for(var e=r+"=",t=m.cookie.split(";").filter((n=>n.length)),i=0;i<t.length;i++){for(var s=t[i];s.charAt(0)==" ";)s=s.substring(1,s.length);if(s.indexOf(e)===0)return decodeURIComponent(s.substring(e.length,s.length))}}catch{}return null}},W:function(r){var e;try{e=JSON.parse(pe.q(r))||{}}catch{}return e},G:function(r,e,t,i,s){if(m)try{var n="",a="",o=ba(m.location.hostname,i);if(t){var l=new Date;l.setTime(l.getTime()+24*t*60*60*1e3),n="; expires="+l.toUTCString()}s&&(a="; secure");var c=r+"="+encodeURIComponent(JSON.stringify(e))+n+"; SameSite=Lax; path=/"+o+a;return c.length>3686.4&&y.warn("cookieStore warning: large cookie, len="+c.length),m.cookie=c,c}catch{return}},V:function(r,e){if(m!=null&&m.cookie)try{pe.G(r,"",-1,e)}catch{return}}},ci=null,A={H:function(){if(!we(ci))return ci;var r=!0;if(_(d))r=!1;else try{var e="__mplssupport__";A.G(e,"xyz"),A.q(e)!=='"xyz"'&&(r=!1),A.V(e)}catch{r=!1}return r||y.error("localStorage unsupported; falling back to cookie store"),ci=r,r},B:function(r){y.error("localStorage error: "+r)},q:function(r){try{return d?.localStorage.getItem(r)}catch(e){A.B(e)}return null},W:function(r){try{return JSON.parse(A.q(r))||{}}catch{}return null},G:function(r,e){try{d?.localStorage.setItem(r,JSON.stringify(e))}catch(t){A.B(t)}},V:function(r){try{d?.localStorage.removeItem(r)}catch(e){A.B(e)}}},wa=["distinct_id",Ht,ms,Bt,qt],Tt=b({},A,{W:function(r){try{var e={};try{e=pe.W(r)||{}}catch{}var t=D(e,JSON.parse(A.q(r)||"{}"));return A.G(r,t),t}catch{}return null},G:function(r,e,t,i,s,n){try{A.G(r,e,void 0,void 0,n);var a={};wa.forEach((o=>{e[o]&&(a[o]=e[o])})),Object.keys(a).length&&pe.G(r,a,t,i,s,n)}catch(o){A.B(o)}},V:function(r,e){try{d?.localStorage.removeItem(r),pe.V(r,e)}catch(t){A.B(t)}}}),Ct={},Ea={H:function(){return!0},B:function(r){y.error("memoryStorage error: "+r)},q:function(r){return Ct[r]||null},W:function(r){return Ct[r]||null},G:function(r,e){Ct[r]=e},V:function(r){delete Ct[r]}},Ae=null,j={H:function(){if(!we(Ae))return Ae;if(Ae=!0,_(d))Ae=!1;else try{var r="__support__";j.G(r,"xyz"),j.q(r)!=='"xyz"'&&(Ae=!1),j.V(r)}catch{Ae=!1}return Ae},B:function(r){y.error("sessionStorage error: ",r)},q:function(r){try{return d?.sessionStorage.getItem(r)}catch(e){j.B(e)}return null},W:function(r){try{return JSON.parse(j.q(r))||null}catch{}return null},G:function(r,e){try{d?.sessionStorage.setItem(r,JSON.stringify(e))}catch(t){j.B(t)}},V:function(r){try{d?.sessionStorage.removeItem(r)}catch(e){j.B(e)}}},ye=(function(r){return r[r.PENDING=-1]="PENDING",r[r.DENIED=0]="DENIED",r[r.GRANTED=1]="GRANTED",r})({});class xa{constructor(e){this._instance=e}get I(){return this._instance.config}get consent(){return this.J()?ye.DENIED:this.K}isOptedOut(){return this.I.cookieless_mode==="always"||this.consent===ye.DENIED||this.consent===ye.PENDING&&(this.I.opt_out_capturing_by_default||this.I.cookieless_mode==="on_reject")}isOptedIn(){return!this.isOptedOut()}isExplicitlyOptedOut(){return this.consent===ye.DENIED}optInOut(e){this.Y.G(this.X,e?1:0,this.I.cookie_expiration,this.I.cross_subdomain_cookie,this.I.secure_cookie)}reset(){this.Y.V(this.X,this.I.cross_subdomain_cookie)}get X(){var{token: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 K(){var e=this.Y.q(this.X);return ni(e)?ye.GRANTED:S(In,e)?ye.DENIED:ye.PENDING}get Y(){if(!this.Z){var e=this.I.opt_out_capturing_persistence_type;this.Z=e==="localStorage"?A:pe;var t=e==="localStorage"?pe:A;t.q(this.X)&&(this.Z.q(this.X)||this.optInOut(ni(t.q(this.X))),t.V(this.X,this.I.cross_subdomain_cookie))}return this.Z}J(){return!!this.I.respect_dnt&&!!gs([Q?.doNotTrack,Q?.msDoNotTrack,x.doNotTrack],(e=>ni(e)))}}var Rt=N("[Dead Clicks]"),ka=()=>!0,Sa=r=>{var e,t=!((e=r.instance.persistence)==null||!e.get_property(_s)),i=r.instance.config.capture_dead_clicks;return Ce(i)?i:!!H(i)||t};class Ms{get lazyLoadedDeadClicksAutocapture(){return this.tt}constructor(e,t,i){this.instance=e,this.isEnabled=t,this.onCapture=i,this.startIfEnabled()}onRemoteConfig(e){this.instance.persistence&&this.instance.persistence.register({[_s]:e?.captureDeadClicks}),this.startIfEnabled()}startIfEnabled(){this.isEnabled(this)&&this.it((()=>{this.et()}))}it(e){var t,i;(t=x.__PosthogExtensions__)!=null&&t.initDeadClicksAutocapture&&e(),(i=x.__PosthogExtensions__)==null||i.loadExternalDependency==null||i.loadExternalDependency(this.instance,"dead-clicks-autocapture",(s=>{s?Rt.error("failed to load script",s):e()}))}et(){var e;if(m){if(!this.tt&&(e=x.__PosthogExtensions__)!=null&&e.initDeadClicksAutocapture){var t=H(this.instance.config.capture_dead_clicks)?this.instance.config.capture_dead_clicks:{};t.__onCapture=this.onCapture,this.tt=x.__PosthogExtensions__.initDeadClicksAutocapture(this.instance,t),this.tt.start(m),Rt.info("starting...")}}else Rt.error("`document` not found. Cannot start.")}stop(){this.tt&&(this.tt.stop(),this.tt=void 0,Rt.info("stopping..."))}}var st=N("[ExceptionAutocapture]");class Pa{constructor(e){var t,i,s;this.rt=()=>{var n;if(d&&this.isEnabled&&(n=x.__PosthogExtensions__)!=null&&n.errorWrappingFunctions){var a=x.__PosthogExtensions__.errorWrappingFunctions.wrapOnError,o=x.__PosthogExtensions__.errorWrappingFunctions.wrapUnhandledRejection,l=x.__PosthogExtensions__.errorWrappingFunctions.wrapConsoleError;try{!this.st&&this.I.capture_unhandled_errors&&(this.st=a(this.captureException.bind(this))),!this.nt&&this.I.capture_unhandled_rejections&&(this.nt=o(this.captureException.bind(this))),!this.ot&&this.I.capture_console_errors&&(this.ot=l(this.captureException.bind(this)))}catch(c){st.error("failed to start",c),this.lt()}}},this._instance=e,this.ut=!((t=this._instance.persistence)==null||!t.props[br]),this.I=this.ht(),this.dt=new $n({refillRate:(i=this._instance.config.error_tracking.__exceptionRateLimiterRefillRate)!==null&&i!==void 0?i:1,bucketSize:(s=this._instance.config.error_tracking.__exceptionRateLimiterBucketSize)!==null&&s!==void 0?s:10,refillInterval:1e4,h:st}),this.startIfEnabled()}ht(){var e=this._instance.config.capture_exceptions,t={capture_unhandled_errors:!1,capture_unhandled_rejections:!1,capture_console_errors:!1};return H(e)?t=b({},t,e):(_(e)?this.ut:e)&&(t=b({},t,{capture_unhandled_errors:!0,capture_unhandled_rejections:!0})),t}get isEnabled(){return this.I.capture_console_errors||this.I.capture_unhandled_errors||this.I.capture_unhandled_rejections}startIfEnabled(){this.isEnabled&&(st.info("enabled"),this.it(this.rt))}it(e){var t,i;(t=x.__PosthogExtensions__)!=null&&t.errorWrappingFunctions&&e(),(i=x.__PosthogExtensions__)==null||i.loadExternalDependency==null||i.loadExternalDependency(this._instance,"exception-autocapture",(s=>{if(s)return st.error("failed to load script",s);e()}))}lt(){var e,t,i;(e=this.st)==null||e.call(this),this.st=void 0,(t=this.nt)==null||t.call(this),this.nt=void 0,(i=this.ot)==null||i.call(this),this.ot=void 0}onRemoteConfig(e){var t=e.autocaptureExceptions;this.ut=!!t||!1,this.I=this.ht(),this._instance.persistence&&this._instance.persistence.register({[br]:this.ut}),this.startIfEnabled()}captureException(e){var t,i,s=(t=e==null||(i=e.$exception_list)==null||(i=i[0])==null?void 0:i.type)!==null&&t!==void 0?t:"Exception";this.dt.consumeRateLimit(s)?st.info("Skipping exception capture because of client rate limiting.",{exception:s}):this._instance.exceptions.sendExceptionEvent(e)}}function Rr(r,e,t){try{if(!(e in r))return()=>{};var i=r[e],s=t(i);return Te(s)&&(s.prototype=s.prototype||{},Object.defineProperties(s,{__posthog_wrapped__:{enumerable:!1,value:!0}})),r[e]=s,()=>{r[e]=i}}catch{return()=>{}}}class Ia{constructor(e){var t;this._instance=e,this.vt=(d==null||(t=d.location)==null?void 0:t.pathname)||""}get isEnabled(){return this._instance.config.capture_pageview==="history_change"}startIfEnabled(){this.isEnabled&&(y.info("History API monitoring enabled, starting..."),this.monitorHistoryChanges())}stop(){this.ct&&this.ct(),this.ct=void 0,y.info("History API monitoring stopped")}monitorHistoryChanges(){var e,t;if(d&&d.history){var i=this;(e=d.history.pushState)!=null&&e.__posthog_wrapped__||Rr(d.history,"pushState",(s=>function(n,a,o){s.call(this,n,a,o),i.ft("pushState")})),(t=d.history.replaceState)!=null&&t.__posthog_wrapped__||Rr(d.history,"replaceState",(s=>function(n,a,o){s.call(this,n,a,o),i.ft("replaceState")})),this.gt()}}ft(e){try{var t,i=d==null||(t=d.location)==null?void 0:t.pathname;if(!i)return;i!==this.vt&&this.isEnabled&&this._instance.capture("$pageview",{navigation_type:e}),this.vt=i}catch(s){y.error("Error capturing "+e+" pageview",s)}}gt(){if(!this.ct){var e=()=>{this.ft("popstate")};L(d,"popstate",e),this.ct=()=>{d&&d.removeEventListener("popstate",e)}}}}var hi=N("[SegmentIntegration]");function $a(r,e){var t=r.config.segment;if(!t)return e();(function(i,s){var n=i.config.segment;if(!n)return s();var a=l=>{var c=()=>l.anonymousId()||Fe();i.config.get_device_id=c,l.id()&&(i.register({distinct_id:l.id(),$device_id:c()}),i.persistence.set_property(me,"identified")),s()},o=n.user();"then"in o&&Te(o.then)?o.then((l=>a(l))):a(o)})(r,(()=>{t.register((i=>{Promise&&Promise.resolve||hi.warn("This browser does not have Promise support, and can not use the segment integration");var s=(n,a)=>{if(!a)return n;n.event.userId||n.event.anonymousId===i.get_distinct_id()||(hi.info("No userId set, resetting PostHog"),i.reset()),n.event.userId&&n.event.userId!==i.get_distinct_id()&&(hi.info("UserId set, identifying with PostHog"),i.identify(n.event.userId));var o=i.calculateEventProperties(a,n.event.properties);return n.event.properties=Object.assign({},o,n.event.properties),n};return{name:"PostHog JS",type:"enrichment",version:"1.0.0",isLoaded:()=>!0,load:()=>Promise.resolve(),track:n=>s(n,n.event.event),page:n=>s(n,"$pageview"),identify:n=>s(n,"$identify"),screen:n=>s(n,"$screen")}})(r)).then((()=>{e()}))}))}var As="posthog-js";function Ds(r,e){var{organization:t,projectId:i,prefix:s,severityAllowList:n=["error"],sendExceptionsToPostHog:a=!0}=e===void 0?{}:e;return o=>{var l,c,u,h,p;if(!(n==="*"||n.includes(o.level))||!r.__loaded)return o;o.tags||(o.tags={});var f=r.requestRouter.endpointFor("ui","/project/"+r.config.token+"/person/"+r.get_distinct_id());o.tags["PostHog Person URL"]=f,r.sessionRecordingStarted()&&(o.tags["PostHog Recording URL"]=r.get_session_replay_url({withTimestamp:!0}));var v=((l=o.exception)==null?void 0:l.values)||[],g=v.map((w=>b({},w,{stacktrace:w.stacktrace?b({},w.stacktrace,{type:"raw",frames:(w.stacktrace.frames||[]).map((k=>b({},k,{platform:"web:javascript"})))}):void 0}))),E={$exception_message:((c=v[0])==null?void 0:c.value)||o.message,$exception_type:(u=v[0])==null?void 0:u.type,$exception_level:o.level,$exception_list:g,$sentry_event_id:o.event_id,$sentry_exception:o.exception,$sentry_exception_message:((h=v[0])==null?void 0:h.value)||o.message,$sentry_exception_type:(p=v[0])==null?void 0:p.type,$sentry_tags:o.tags};return t&&i&&(E.$sentry_url=(s||"https://sentry.io/organizations/")+t+"/issues/?project="+i+"&query="+o.event_id),a&&r.exceptions.sendExceptionEvent(E),o}}class Fa{constructor(e,t,i,s,n,a){this.name=As,this.setupOnce=function(o){o(Ds(e,{organization:t,projectId:i,prefix:s,severityAllowList:n,sendExceptionsToPostHog:a==null||a}))}}}var Ta=d!=null&&d.location?zt(d.location.hash,"__posthog")||zt(location.hash,"state"):null,Or="_postHogToolbarParams",Mr=N("[Toolbar]"),$e=(function(r){return r[r.UNINITIALIZED=0]="UNINITIALIZED",r[r.LOADING=1]="LOADING",r[r.LOADED=2]="LOADED",r})($e||{});class Ca{constructor(e){this.instance=e}_t(e){x.ph_toolbar_state=e}yt(){var e;return(e=x.ph_toolbar_state)!==null&&e!==void 0?e:$e.UNINITIALIZED}maybeLoadToolbar(e,t,i){if(e===void 0&&(e=void 0),t===void 0&&(t=void 0),i===void 0&&(i=void 0),!d||!m)return!1;e=e??d.location,i=i??d.history;try{if(!t){try{d.localStorage.setItem("test","test"),d.localStorage.removeItem("test")}catch{return!1}t=d?.localStorage}var s,n=Ta||zt(e.hash,"__posthog")||zt(e.hash,"state"),a=n?mr((()=>JSON.parse(atob(decodeURIComponent(n)))))||mr((()=>JSON.parse(decodeURIComponent(n)))):null;return a&&a.action==="ph_authorize"?((s=a).source="url",s&&Object.keys(s).length>0&&(a.desiredHash?e.hash=a.desiredHash:i?i.replaceState(i.state,"",e.pathname+e.search):e.hash="")):((s=JSON.parse(t.getItem(Or)||"{}")).source="localstorage",delete s.userIntent),!(!s.token||this.instance.config.token!==s.token)&&(this.loadToolbar(s),!0)}catch{return!1}}bt(e){var t=x.ph_load_toolbar||x.ph_load_editor;!F(t)&&Te(t)?t(e,this.instance):Mr.warn("No toolbar load function found")}loadToolbar(e){var t=!(m==null||!m.getElementById(ys));if(!d||t)return!1;var i=this.instance.requestRouter.region==="custom"&&this.instance.config.advanced_disable_toolbar_metrics,s=b({token:this.instance.config.token},e,{apiURL:this.instance.requestRouter.endpointFor("ui")},i?{instrument:!1}:{});if(d.localStorage.setItem(Or,JSON.stringify(b({},s,{source:void 0}))),this.yt()===$e.LOADED)this.bt(s);else if(this.yt()===$e.UNINITIALIZED){var n;this._t($e.LOADING),(n=x.__PosthogExtensions__)==null||n.loadExternalDependency==null||n.loadExternalDependency(this.instance,"toolbar",(a=>{if(a)return Mr.error("[Toolbar] Failed to load",a),void this._t($e.UNINITIALIZED);this._t($e.LOADED),this.bt(s)})),L(d,"turbolinks:load",(()=>{this._t($e.UNINITIALIZED),this.loadToolbar(s)}))}return!0}wt(e){return this.loadToolbar(e)}maybeLoadEditor(e,t,i){return e===void 0&&(e=void 0),t===void 0&&(t=void 0),i===void 0&&(i=void 0),this.maybeLoadToolbar(e,t,i)}}var Ra=N("[TracingHeaders]");class Oa{constructor(e){this.xt=void 0,this.Et=void 0,this.rt=()=>{var t,i;_(this.xt)&&((t=x.__PosthogExtensions__)==null||(t=t.tracingHeadersPatchFns)==null||t._patchXHR(this._instance.config.__add_tracing_headers||[],this._instance.get_distinct_id(),this._instance.sessionManager)),_(this.Et)&&((i=x.__PosthogExtensions__)==null||(i=i.tracingHeadersPatchFns)==null||i._patchFetch(this._instance.config.__add_tracing_headers||[],this._instance.get_distinct_id(),this._instance.sessionManager))},this._instance=e}it(e){var t,i;(t=x.__PosthogExtensions__)!=null&&t.tracingHeadersPatchFns&&e(),(i=x.__PosthogExtensions__)==null||i.loadExternalDependency==null||i.loadExternalDependency(this._instance,"tracing-headers",(s=>{if(s)return Ra.error("failed to load script",s);e()}))}startIfEnabledOrStop(){var e,t;this._instance.config.__add_tracing_headers?this.it(this.rt):((e=this.xt)==null||e.call(this),(t=this.Et)==null||t.call(this),this.xt=void 0,this.Et=void 0)}}var ie="Mobile",Jt="iOS",de="Android",wt="Tablet",Ls=de+" "+wt,Ns="iPad",Us="Apple",Hs=Us+" Watch",Et="Safari",Ze="BlackBerry",js="Samsung",qs=js+"Browser",Bs=js+" Internet",Ue="Chrome",Ma=Ue+" OS",Vs=Ue+" "+Jt,Ki="Internet Explorer",Gs=Ki+" "+ie,Zi="Opera",Aa=Zi+" Mini",Qi="Edge",Ws="Microsoft "+Qi,Je="Firefox",zs=Je+" "+Jt,xt="Nintendo",kt="PlayStation",Xe="Xbox",Ys=de+" "+ie,Js=ie+" "+Et,gt="Windows",Li=gt+" Phone",Ar="Nokia",Ni="Ouya",Xs="Generic",Da=Xs+" "+ie.toLowerCase(),Ks=Xs+" "+wt.toLowerCase(),Ui="Konqueror",W="(\\d+(\\.\\d+)?)",di=new RegExp("Version/"+W),La=new RegExp(Xe,"i"),Na=new RegExp(kt+" \\w+","i"),Ua=new RegExp(xt+" \\w+","i"),er=new RegExp(Ze+"|PlayBook|BB10","i"),Ha={"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"},ja=(r,e)=>e&&S(e,Us)||(function(t){return S(t,Et)&&!S(t,Ue)&&!S(t,de)})(r),Zs=function(r,e){return e=e||"",S(r," OPR/")&&S(r,"Mini")?Aa:S(r," OPR/")?Zi:er.test(r)?Ze:S(r,"IE"+ie)||S(r,"WPDesktop")?Gs:S(r,qs)?Bs:S(r,Qi)||S(r,"Edg/")?Ws:S(r,"FBIOS")?"Facebook "+ie:S(r,"UCWEB")||S(r,"UCBrowser")?"UC Browser":S(r,"CriOS")?Vs:S(r,"CrMo")||S(r,Ue)?Ue:S(r,de)&&S(r,Et)?Ys:S(r,"FxiOS")?zs:S(r.toLowerCase(),Ui.toLowerCase())?Ui:ja(r,e)?S(r,ie)?Js:Et:S(r,Je)?Je:S(r,"MSIE")||S(r,"Trident/")?Ki:S(r,"Gecko")?Je:""},qa={[Gs]:[new RegExp("rv:"+W)],[Ws]:[new RegExp(Qi+"?\\/"+W)],[Ue]:[new RegExp("("+Ue+"|CrMo)\\/"+W)],[Vs]:[new RegExp("CriOS\\/"+W)],"UC Browser":[new RegExp("(UCBrowser|UCWEB)\\/"+W)],[Et]:[di],[Js]:[di],[Zi]:[new RegExp("(Opera|OPR)\\/"+W)],[Je]:[new RegExp(Je+"\\/"+W)],[zs]:[new RegExp("FxiOS\\/"+W)],[Ui]:[new RegExp("Konqueror[:/]?"+W,"i")],[Ze]:[new RegExp(Ze+" "+W),di],[Ys]:[new RegExp("android\\s"+W,"i")],[Bs]:[new RegExp(qs+"\\/"+W)],[Ki]:[new RegExp("(rv:|MSIE )"+W)],Mozilla:[new RegExp("rv:"+W)]},Ba=function(r,e){var t=Zs(r,e),i=qa[t];if(_(i))return null;for(var s=0;s<i.length;s++){var n=i[s],a=r.match(n);if(a)return parseFloat(a[a.length-2])}return null},Dr=[[new RegExp(Xe+"; "+Xe+" (.*?)[);]","i"),r=>[Xe,r&&r[1]||""]],[new RegExp(xt,"i"),[xt,""]],[new RegExp(kt,"i"),[kt,""]],[er,[Ze,""]],[new RegExp(gt,"i"),(r,e)=>{if(/Phone/.test(e)||/WPDesktop/.test(e))return[Li,""];if(new RegExp(ie).test(e)&&!/IEMobile\b/.test(e))return[gt+" "+ie,""];var t=/Windows NT ([0-9.]+)/i.exec(e);if(t&&t[1]){var i=t[1],s=Ha[i]||"";return/arm/i.test(e)&&(s="RT"),[gt,s]}return[gt,""]}],[/((iPhone|iPad|iPod).*?OS (\d+)_(\d+)_?(\d+)?|iPhone)/,r=>{if(r&&r[3]){var e=[r[3],r[4],r[5]||"0"];return[Jt,e.join(".")]}return[Jt,""]}],[/(watch.*\/(\d+\.\d+\.\d+)|watch os,(\d+\.\d+),)/i,r=>{var e="";return r&&r.length>=3&&(e=_(r[2])?r[3]:r[2]),["watchOS",e]}],[new RegExp("("+de+" (\\d+)\\.(\\d+)\\.?(\\d+)?|"+de+")","i"),r=>{if(r&&r[2]){var e=[r[2],r[3],r[4]||"0"];return[de,e.join(".")]}return[de,""]}],[/Mac OS X (\d+)[_.](\d+)[_.]?(\d+)?/i,r=>{var e=["Mac OS X",""];if(r&&r[1]){var t=[r[1],r[2],r[3]||"0"];e[1]=t.join(".")}return e}],[/Mac/i,["Mac OS X",""]],[/CrOS/,[Ma,""]],[/Linux|debian/i,["Linux",""]]],Lr=function(r){return Ua.test(r)?xt:Na.test(r)?kt:La.test(r)?Xe:new RegExp(Ni,"i").test(r)?Ni:new RegExp("("+Li+"|WPDesktop)","i").test(r)?Li:/iPad/.test(r)?Ns:/iPod/.test(r)?"iPod Touch":/iPhone/.test(r)?"iPhone":/(watch)(?: ?os[,/]|\d,\d\/)[\d.]+/i.test(r)?Hs:er.test(r)?Ze:/(kobo)\s(ereader|touch)/i.test(r)?"Kobo":new RegExp(Ar,"i").test(r)?Ar:/(kf[a-z]{2}wi|aeo[c-r]{2})( bui|\))/i.test(r)||/(kf[a-z]+)( bui|\)).+silk\//i.test(r)?"Kindle Fire":/(Android|ZTE)/i.test(r)?!new RegExp(ie).test(r)||/(9138B|TB782B|Nexus [97]|pixel c|HUAWEISHT|BTV|noble nook|smart ultra 6)/i.test(r)?/pixel[\daxl ]{1,6}/i.test(r)&&!/pixel c/i.test(r)||/(huaweimed-al00|tah-|APA|SM-G92|i980|zte|U304AA)/i.test(r)||/lmy47v/i.test(r)&&!/QTAQZ3/i.test(r)?de:Ls:de:new RegExp("(pda|"+ie+")","i").test(r)?Da:new RegExp(wt,"i").test(r)&&!new RegExp(wt+" pc","i").test(r)?Ks:""},Ot="https?://(.*)",tt=["gclid","gclsrc","dclid","gbraid","wbraid","fbclid","msclkid","twclid","li_fat_id","igshid","ttclid","rdt_cid","epik","qclid","sccid","irclid","_kx"],Va=et(["utm_source","utm_medium","utm_campaign","utm_content","utm_term","gad_source","mc_cid"],tt),It="<masked>",Ga=["li_fat_id"];function Qs(r,e,t){if(!m)return{};var i,s=e?et([],tt,t||[]):[],n=en(Pt(m.URL,s,It),r),a=(i={},R(Ga,(function(o){var l=pe.q(o);i[o]=l||null})),i);return D(a,n)}function en(r,e){var t=Va.concat(e||[]),i={};return R(t,(function(s){var n=Wt(r,s);i[s]=n||null})),i}function tn(r){var e=(function(n){return n?n.search(Ot+"google.([^/?]*)")===0?"google":n.search(Ot+"bing.com")===0?"bing":n.search(Ot+"yahoo.com")===0?"yahoo":n.search(Ot+"duckduckgo.com")===0?"duckduckgo":null:null})(r),t=e!="yahoo"?"q":"p",i={};if(!we(e)){i.$search_engine=e;var s=m?Wt(m.referrer,t):"";s.length&&(i.ph_keyword=s)}return i}function Nr(){return navigator.language||navigator.userLanguage}function rn(){return m?.referrer||"$direct"}function sn(r,e){var t=r?et([],tt,e||[]):[],i=Y?.href.substring(0,1e3);return{r:rn().substring(0,1e3),u:i?Pt(i,t,It):void 0}}function nn(r){var e,{r:t,u:i}=r,s={$referrer:t,$referring_domain:t==null?void 0:t=="$direct"?"$direct":(e=Gt(t))==null?void 0:e.host};if(i){s.$current_url=i;var n=Gt(i);s.$host=n?.host,s.$pathname=n?.pathname;var a=en(i);D(s,a)}if(t){var o=tn(t);D(s,o)}return s}function an(){try{return Intl.DateTimeFormat().resolvedOptions().timeZone}catch{return}}function Wa(){try{return new Date().getTimezoneOffset()}catch{return}}function za(r,e){if(!z)return{};var t,i,s,n=r?et([],tt,e||[]):[],[a,o]=(function(l){for(var c=0;c<Dr.length;c++){var[u,h]=Dr[c],p=u.exec(l),f=p&&(Te(h)?h(p,l):h);if(f)return f}return["",""]})(z);return D(zi({$os:a,$os_version:o,$browser:Zs(z,navigator.vendor),$device:Lr(z),$device_type:(i=z,s=Lr(i),s===Ns||s===Ls||s==="Kobo"||s==="Kindle Fire"||s===Ks?wt:s===xt||s===Xe||s===kt||s===Ni?"Console":s===Hs?"Wearable":s?ie:"Desktop"),$timezone:an(),$timezone_offset:Wa()}),{$current_url:Pt(Y?.href,n,It),$host:Y?.host,$pathname:Y?.pathname,$raw_user_agent:z.length>1e3?z.substring(0,997)+"...":z,$browser_version:Ba(z,navigator.vendor),$browser_language:Nr(),$browser_language_prefix:(t=Nr(),typeof t=="string"?t.split("-")[0]:void 0),$screen_height:d?.screen.height,$screen_width:d?.screen.width,$viewport_height:d?.innerHeight,$viewport_width:d?.innerWidth,$lib:"web",$lib_version:_e.LIB_VERSION,$insert_id:Math.random().toString(36).substring(2,10)+Math.random().toString(36).substring(2,10),$time:Date.now()/1e3})}var Pe=N("[Web Vitals]"),Ur=9e5;class Ya{constructor(e){var t;this.St=!1,this.P=!1,this.N={url:void 0,metrics:[],firstMetricTimestamp:void 0},this.$t=()=>{clearTimeout(this.kt),this.N.metrics.length!==0&&(this._instance.capture("$web_vitals",this.N.metrics.reduce(((i,s)=>b({},i,{["$web_vitals_"+s.name+"_event"]:b({},s),["$web_vitals_"+s.name+"_value"]:s.value})),{})),this.N={url:void 0,metrics:[],firstMetricTimestamp:void 0})},this.Pt=i=>{var s,n=(s=this._instance.sessionManager)==null?void 0:s.checkAndGetSessionAndWindowId(!0);if(_(n))Pe.error("Could not read session ID. Dropping metrics!");else{this.N=this.N||{url:void 0,metrics:[],firstMetricTimestamp:void 0};var a=this.Tt();_(a)||(F(i?.name)||F(i?.value)?Pe.error("Invalid metric received",i):this.Rt&&i.value>=this.Rt?Pe.error("Ignoring metric with value >= "+this.Rt,i):(this.N.url!==a&&(this.$t(),this.kt=setTimeout(this.$t,this.flushToCaptureTimeoutMs)),_(this.N.url)&&(this.N.url=a),this.N.firstMetricTimestamp=_(this.N.firstMetricTimestamp)?Date.now():this.N.firstMetricTimestamp,i.attribution&&i.attribution.interactionTargetElement&&(i.attribution.interactionTargetElement=void 0),this.N.metrics.push(b({},i,{$current_url:a,$session_id:n.sessionId,$window_id:n.windowId,timestamp:Date.now()})),this.N.metrics.length===this.allowedMetrics.length&&this.$t()))}},this.rt=()=>{var i,s,n,a,o=x.__PosthogExtensions__;_(o)||_(o.postHogWebVitalsCallbacks)||({onLCP:i,onCLS:s,onFCP:n,onINP:a}=o.postHogWebVitalsCallbacks),i&&s&&n&&a?(this.allowedMetrics.indexOf("LCP")>-1&&i(this.Pt.bind(this)),this.allowedMetrics.indexOf("CLS")>-1&&s(this.Pt.bind(this)),this.allowedMetrics.indexOf("FCP")>-1&&n(this.Pt.bind(this)),this.allowedMetrics.indexOf("INP")>-1&&a(this.Pt.bind(this)),this.P=!0):Pe.error("web vitals callbacks not loaded - not starting")},this._instance=e,this.St=!((t=this._instance.persistence)==null||!t.props[Er]),this.startIfEnabled()}get allowedMetrics(){var e,t,i=H(this._instance.config.capture_performance)?(e=this._instance.config.capture_performance)==null?void 0:e.web_vitals_allowed_metrics:void 0;return _(i)?((t=this._instance.persistence)==null?void 0:t.props[xr])||["CLS","FCP","INP","LCP"]:i}get flushToCaptureTimeoutMs(){return(H(this._instance.config.capture_performance)?this._instance.config.capture_performance.web_vitals_delayed_flush_ms:void 0)||5e3}get Rt(){var e=H(this._instance.config.capture_performance)&&fe(this._instance.config.capture_performance.__web_vitals_max_value)?this._instance.config.capture_performance.__web_vitals_max_value:Ur;return 0<e&&e<=6e4?Ur:e}get isEnabled(){var e=Y?.protocol;if(e!=="http:"&&e!=="https:")return Pe.info("Web Vitals are disabled on non-http/https protocols"),!1;var t=H(this._instance.config.capture_performance)?this._instance.config.capture_performance.web_vitals:Ce(this._instance.config.capture_performance)?this._instance.config.capture_performance:void 0;return Ce(t)?t:this.St}startIfEnabled(){this.isEnabled&&!this.P&&(Pe.info("enabled, starting..."),this.it(this.rt))}onRemoteConfig(e){var t=H(e.capturePerformance)&&!!e.capturePerformance.web_vitals,i=H(e.capturePerformance)?e.capturePerformance.web_vitals_allowed_metrics:void 0;this._instance.persistence&&(this._instance.persistence.register({[Er]:t}),this._instance.persistence.register({[xr]:i})),this.St=t,this.startIfEnabled()}it(e){var t,i;(t=x.__PosthogExtensions__)!=null&&t.postHogWebVitalsCallbacks&&e(),(i=x.__PosthogExtensions__)==null||i.loadExternalDependency==null||i.loadExternalDependency(this._instance,"web-vitals",(s=>{s?Pe.error("failed to load script",s):e()}))}Tt(){var e=d?d.location.href:void 0;if(e){var t=this._instance.config.mask_personal_data_properties,i=this._instance.config.custom_personal_data_properties,s=t?et([],tt,i||[]):[];return Pt(e,s,It)}Pe.error("Could not determine current URL")}}var Ja=N("[Heatmaps]");function Hr(r){return H(r)&&"clientX"in r&&"clientY"in r&&fe(r.clientX)&&fe(r.clientY)}class Xa{constructor(e){var t;this.St=!1,this.P=!1,this.Ct=null,this.instance=e,this.St=!((t=this.instance.persistence)==null||!t.props[$i]),this.rageclicks=new Rs(e.config.rageclick)}get flushIntervalMilliseconds(){var e=5e3;return H(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 _(this.instance.config.capture_heatmaps)?_(this.instance.config.enable_heatmaps)?this.St:this.instance.config.enable_heatmaps:this.instance.config.capture_heatmaps!==!1}startIfEnabled(){if(this.isEnabled){if(this.P)return;Ja.info("starting..."),this.It(),this.Ft()}else{var e;clearInterval((e=this.Ct)!==null&&e!==void 0?e:void 0),this.Mt(),this.getAndClearBuffer()}}onRemoteConfig(e){var t=!!e.heatmaps;this.instance.persistence&&this.instance.persistence.register({[$i]:t}),this.St=t,this.startIfEnabled()}getAndClearBuffer(){var e=this.N;return this.N=void 0,e}Ot(e){this.At(e.originalEvent,"deadclick")}Ft(){this.Ct&&clearInterval(this.Ct),this.Ct=(function(e){return e?.visibilityState==="visible"})(m)?setInterval(this.Dt.bind(this),this.flushIntervalMilliseconds):null}It(){d&&m&&(this.jt=this.Dt.bind(this),L(d,"beforeunload",this.jt),this.Lt=e=>this.At(e||d?.event),L(m,"click",this.Lt,{capture:!0}),this.Nt=e=>this.Ut(e||d?.event),L(m,"mousemove",this.Nt,{capture:!0}),this.zt=new Ms(this.instance,ka,this.Ot.bind(this)),this.zt.startIfEnabled(),this.Ht=this.Ft.bind(this),L(m,"visibilitychange",this.Ht),this.P=!0)}Mt(){var e;d&&m&&(this.jt&&d.removeEventListener("beforeunload",this.jt),this.Lt&&m.removeEventListener("click",this.Lt,{capture:!0}),this.Nt&&m.removeEventListener("mousemove",this.Nt,{capture:!0}),this.Ht&&m.removeEventListener("visibilitychange",this.Ht),clearTimeout(this.Bt),(e=this.zt)==null||e.stop(),this.P=!1)}qt(e,t){var i=this.instance.scrollManager.scrollY(),s=this.instance.scrollManager.scrollX(),n=this.instance.scrollManager.scrollElement(),a=(function(o,l,c){for(var u=o;u&&ti(u)&&!Oe(u,"body");){if(u===c)return!1;if(S(l,d?.getComputedStyle(u).position))return!0;u=Ss(u)}return!1})(xs(e),["fixed","sticky"],n);return{x:e.clientX+(a?0:s),y:e.clientY+(a?0:i),target_fixed:a,type:t}}At(e,t){var i;if(t===void 0&&(t="click"),!kr(e.target)&&Hr(e)){var s=this.qt(e,t);(i=this.rageclicks)!=null&&i.isRageClick(e.clientX,e.clientY,new Date().getTime())&&this.Wt(b({},s,{type:"rageclick"})),this.Wt(s)}}Ut(e){!kr(e.target)&&Hr(e)&&(clearTimeout(this.Bt),this.Bt=setTimeout((()=>{this.Wt(this.qt(e,"mousemove"))}),500))}Wt(e){if(d){var t=d.location.href,i=this.instance.config.mask_personal_data_properties,s=this.instance.config.custom_personal_data_properties,n=i?et([],tt,s||[]):[],a=Pt(t,n,It);this.N=this.N||{},this.N[a]||(this.N[a]=[]),this.N[a].push(e)}}Dt(){this.N&&!ze(this.N)&&this.instance.capture("$$heatmap",{$heatmap_data:this.getAndClearBuffer()})}}class Ka{constructor(e){this._instance=e}doPageView(e,t){var i,s=this.Gt(e,t);return this.Vt={pathname:(i=d?.location.pathname)!==null&&i!==void 0?i:"",pageViewId:t,timestamp:e},this._instance.scrollManager.resetContext(),s}doPageLeave(e){var t;return this.Gt(e,(t=this.Vt)==null?void 0:t.pageViewId)}doEvent(){var e;return{$pageview_id:(e=this.Vt)==null?void 0:e.pageViewId}}Gt(e,t){var i=this.Vt;if(!i)return{$pageview_id:t};var s={$pageview_id:t,$prev_pageview_id:i.pageViewId},n=this._instance.scrollManager.getContext();if(n&&!this._instance.config.disable_scroll_properties){var{maxScrollHeight:a,lastScrollY:o,maxScrollY:l,maxContentHeight:c,lastContentY:u,maxContentY:h}=n;if(!(_(a)||_(o)||_(l)||_(c)||_(u)||_(h))){a=Math.ceil(a),o=Math.ceil(o),l=Math.ceil(l),c=Math.ceil(c),u=Math.ceil(u),h=Math.ceil(h);var p=a<=1?1:he(o/a,0,1,y),f=a<=1?1:he(l/a,0,1,y),v=c<=1?1:he(u/c,0,1,y),g=c<=1?1:he(h/c,0,1,y);s=D(s,{$prev_pageview_last_scroll:o,$prev_pageview_last_scroll_percentage:p,$prev_pageview_max_scroll:l,$prev_pageview_max_scroll_percentage:f,$prev_pageview_last_content:u,$prev_pageview_last_content_percentage:v,$prev_pageview_max_content:h,$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 re=Uint8Array,J=Uint16Array,Qe=Uint32Array,tr=new re([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]),ir=new re([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]),jr=new re([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),on=function(r,e){for(var t=new J(31),i=0;i<31;++i)t[i]=e+=1<<r[i-1];var s=new Qe(t[30]);for(i=1;i<30;++i)for(var n=t[i];n<t[i+1];++n)s[n]=n-t[i]<<5|i;return[t,s]},ln=on(tr,2),Za=ln[0],Hi=ln[1];Za[28]=258,Hi[258]=28;for(var qr=on(ir,0)[1],un=new J(32768),M=0;M<32768;++M){var De=(43690&M)>>>1|(21845&M)<<1;De=(61680&(De=(52428&De)>>>2|(13107&De)<<2))>>>4|(3855&De)<<4,un[M]=((65280&De)>>>8|(255&De)<<8)>>>1}var mt=function(r,e,t){for(var i=r.length,s=0,n=new J(e);s<i;++s)++n[r[s]-1];var a,o=new J(e);for(s=0;s<e;++s)o[s]=o[s-1]+n[s-1]<<1;for(a=new J(i),s=0;s<i;++s)a[s]=un[o[r[s]-1]++]>>>15-r[s];return a},He=new re(288);for(M=0;M<144;++M)He[M]=8;for(M=144;M<256;++M)He[M]=9;for(M=256;M<280;++M)He[M]=7;for(M=280;M<288;++M)He[M]=8;var Xt=new re(32);for(M=0;M<32;++M)Xt[M]=5;var Qa=mt(He,9),eo=mt(Xt,5),cn=function(r){return(r/8>>0)+(7&r&&1)},hn=function(r,e,t){(t==null||t>r.length)&&(t=r.length);var i=new(r instanceof J?J:r instanceof Qe?Qe:re)(t-e);return i.set(r.subarray(e,t)),i},ve=function(r,e,t){t<<=7&e;var i=e/8>>0;r[i]|=t,r[i+1]|=t>>>8},nt=function(r,e,t){t<<=7&e;var i=e/8>>0;r[i]|=t,r[i+1]|=t>>>8,r[i+2]|=t>>>16},pi=function(r,e){for(var t=[],i=0;i<r.length;++i)r[i]&&t.push({s:i,f:r[i]});var s=t.length,n=t.slice();if(!s)return[new re(0),0];if(s==1){var a=new re(t[0].s+1);return a[t[0].s]=1,[a,1]}t.sort((function(O,se){return O.f-se.f})),t.push({s:-1,f:25001});var o=t[0],l=t[1],c=0,u=1,h=2;for(t[0]={s:-1,f:o.f+l.f,l:o,r:l};u!=s-1;)o=t[t[c].f<t[h].f?c++:h++],l=t[c!=u&&t[c].f<t[h].f?c++:h++],t[u++]={s:-1,f:o.f+l.f,l:o,r:l};var p=n[0].s;for(i=1;i<s;++i)n[i].s>p&&(p=n[i].s);var f=new J(p+1),v=ji(t[u-1],f,0);if(v>e){i=0;var g=0,E=v-e,w=1<<E;for(n.sort((function(O,se){return f[se.s]-f[O.s]||O.f-se.f}));i<s;++i){var k=n[i].s;if(!(f[k]>e))break;g+=w-(1<<v-f[k]),f[k]=e}for(g>>>=E;g>0;){var $=n[i].s;f[$]<e?g-=1<<e-f[$]++-1:++i}for(;i>=0&&g;--i){var P=n[i].s;f[P]==e&&(--f[P],++g)}v=e}return[new re(f),v]},ji=function(r,e,t){return r.s==-1?Math.max(ji(r.l,e,t+1),ji(r.r,e,t+1)):e[r.s]=t},Br=function(r){for(var e=r.length;e&&!r[--e];);for(var t=new J(++e),i=0,s=r[0],n=1,a=function(l){t[i++]=l},o=1;o<=e;++o)if(r[o]==s&&o!=e)++n;else{if(!s&&n>2){for(;n>138;n-=138)a(32754);n>2&&(a(n>10?n-11<<5|28690:n-3<<5|12305),n=0)}else if(n>3){for(a(s),--n;n>6;n-=6)a(8304);n>2&&(a(n-3<<5|8208),n=0)}for(;n--;)a(s);n=1,s=r[o]}return[t.subarray(0,i),e]},at=function(r,e){for(var t=0,i=0;i<e.length;++i)t+=r[i]*e[i];return t},qi=function(r,e,t){var i=t.length,s=cn(e+2);r[s]=255&i,r[s+1]=i>>>8,r[s+2]=255^r[s],r[s+3]=255^r[s+1];for(var n=0;n<i;++n)r[s+n+4]=t[n];return 8*(s+4+i)},Vr=function(r,e,t,i,s,n,a,o,l,c,u){ve(e,u++,t),++s[256];for(var h=pi(s,15),p=h[0],f=h[1],v=pi(n,15),g=v[0],E=v[1],w=Br(p),k=w[0],$=w[1],P=Br(g),O=P[0],se=P[1],X=new J(19),I=0;I<k.length;++I)X[31&k[I]]++;for(I=0;I<O.length;++I)X[31&O[I]]++;for(var oe=pi(X,7),K=oe[0],ne=oe[1],ee=19;ee>4&&!K[jr[ee-1]];--ee);var ge,le,ue,je,Ee=c+5<<3,Me=at(s,He)+at(n,Xt)+a,ce=at(s,p)+at(n,g)+a+14+3*ee+at(X,K)+(2*X[16]+3*X[17]+7*X[18]);if(Ee<=Me&&Ee<=ce)return qi(e,u,r.subarray(l,l+c));if(ve(e,u,1+(ce<Me)),u+=2,ce<Me){ge=mt(p,f),le=p,ue=mt(g,E),je=g;var xe=mt(K,ne);for(ve(e,u,$-257),ve(e,u+5,se-1),ve(e,u+10,ee-4),u+=14,I=0;I<ee;++I)ve(e,u+3*I,K[jr[I]]);u+=3*ee;for(var qe=[k,O],V=0;V<2;++V){var te=qe[V];for(I=0;I<te.length;++I){var Z=31&te[I];ve(e,u,xe[Z]),u+=K[Z],Z>15&&(ve(e,u,te[I]>>>5&127),u+=te[I]>>>12)}}}else ge=Qa,le=He,ue=eo,je=Xt;for(I=0;I<o;++I)if(i[I]>255){Z=i[I]>>>18&31,nt(e,u,ge[Z+257]),u+=le[Z+257],Z>7&&(ve(e,u,i[I]>>>23&31),u+=tr[Z]);var Be=31&i[I];nt(e,u,ue[Be]),u+=je[Be],Be>3&&(nt(e,u,i[I]>>>5&8191),u+=ir[Be])}else nt(e,u,ge[i[I]]),u+=le[i[I]];return nt(e,u,ge[256]),u+le[256]},to=new Qe([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),io=(function(){for(var r=new Qe(256),e=0;e<256;++e){for(var t=e,i=9;--i;)t=(1&t&&3988292384)^t>>>1;r[e]=t}return r})(),ro=function(r,e,t,i,s){return(function(n,a,o,l,c,u){var h=n.length,p=new re(l+h+5*(1+Math.floor(h/7e3))+c),f=p.subarray(l,p.length-c),v=0;if(!a||h<8)for(var g=0;g<=h;g+=65535){var E=g+65535;E<h?v=qi(f,v,n.subarray(g,E)):(f[g]=u,v=qi(f,v,n.subarray(g,h)))}else{for(var w=to[a-1],k=w>>>13,$=8191&w,P=(1<<o)-1,O=new J(32768),se=new J(P+1),X=Math.ceil(o/3),I=2*X,oe=function(si){return(n[si]^n[si+1]<<X^n[si+2]<<I)&P},K=new Qe(25e3),ne=new J(288),ee=new J(32),ge=0,le=0,ue=(g=0,0),je=0,Ee=0;g<h;++g){var Me=oe(g),ce=32767&g,xe=se[Me];if(O[ce]=xe,se[Me]=ce,je<=g){var qe=h-g;if((ge>7e3||ue>24576)&&qe>423){v=Vr(n,f,0,K,ne,ee,le,ue,Ee,g-Ee,v),ue=ge=le=0,Ee=g;for(var V=0;V<286;++V)ne[V]=0;for(V=0;V<30;++V)ee[V]=0}var te=2,Z=0,Be=$,ke=ce-xe&32767;if(qe>2&&Me==oe(g-ke))for(var _n=Math.min(k,qe)-1,mn=Math.min(32767,g),yn=Math.min(258,qe);ke<=mn&&--Be&&ce!=xe;){if(n[g+te]==n[g+te-ke]){for(var Se=0;Se<yn&&n[g+Se]==n[g+Se-ke];++Se);if(Se>te){if(te=Se,Z=ke,Se>_n)break;var bn=Math.min(ke,Se-2),sr=0;for(V=0;V<bn;++V){var ri=g-ke+V+32768&32767,nr=ri-O[ri]+32768&32767;nr>sr&&(sr=nr,xe=ri)}}}ke+=(ce=xe)-(xe=O[ce])+32768&32767}if(Z){K[ue++]=268435456|Hi[te]<<18|qr[Z];var ar=31&Hi[te],or=31&qr[Z];le+=tr[ar]+ir[or],++ne[257+ar],++ee[or],je=g+te,++ge}else K[ue++]=n[g],++ne[n[g]]}}v=Vr(n,f,u,K,ne,ee,le,ue,Ee,g-Ee,v)}return hn(p,0,l+cn(v)+c)})(r,e.level==null?6:e.level,e.mem==null?Math.ceil(1.5*Math.max(8,Math.min(13,Math.log(r.length)))):12+e.mem,t,i,!0)},fi=function(r,e,t){for(;t;++e)r[e]=t,t>>>=8};function so(r,e){e===void 0&&(e={});var t=(function(){var o=4294967295;return{p:function(l){for(var c=o,u=0;u<l.length;++u)c=io[255&c^l[u]]^c>>>8;o=c},d:function(){return 4294967295^o}}})(),i=r.length;t.p(r);var s,n=ro(r,e,10+((s=e).filename&&s.filename.length+1||0),8),a=n.length;return(function(o,l){var c=l.filename;if(o[0]=31,o[1]=139,o[2]=8,o[8]=l.level<2?4:l.level==9?2:0,o[9]=3,l.mtime!=0&&fi(o,4,Math.floor(new Date(l.mtime||Date.now())/1e3)),c){o[3]=8;for(var u=0;u<=c.length;++u)o[u+10]=c.charCodeAt(u)}})(n,e),fi(n,a-8,t.d()),fi(n,a-4,i),n}var no=function(r){var e,t,i,s,n="";for(e=t=0,i=(r=(r+"").replace(/\r\n/g,`
|
|
3
|
+
`).replace(/\r/g,`
|
|
4
|
+
`)).length,s=0;s<i;s++){var a=r.charCodeAt(s),o=null;a<128?t++:o=a>127&&a<2048?String.fromCharCode(a>>6|192,63&a|128):String.fromCharCode(a>>12|224,a>>6&63|128,63&a|128),we(o)||(t>e&&(n+=r.substring(e,t)),n+=o,e=t=s+1)}return t>e&&(n+=r.substring(e,r.length)),n},ao=!!xi||!!Ei,Gr="text/plain",Kt=function(r,e,t){var i;t===void 0&&(t=!0);var[s,n]=r.split("?"),a=b({},e),o=(i=n?.split("&").map((c=>{var u,[h,p]=c.split("="),f=t&&(u=a[h])!==null&&u!==void 0?u:p;return delete a[h],h+"="+f})))!==null&&i!==void 0?i:[],l=ha(a);return l&&o.push(l),s+"?"+o.join("&")},vt=(r,e)=>JSON.stringify(r,((t,i)=>typeof i=="bigint"?i.toString():i),e),gi=r=>{var{data:e,compression:t}=r;if(e){if(t===be.GZipJS){var i=so((function(l,c){var u=l.length;if(typeof TextEncoder<"u")return new TextEncoder().encode(l);for(var h=new re(l.length+(l.length>>>1)),p=0,f=function(w){h[p++]=w},v=0;v<u;++v){if(p+5>h.length){var g=new re(p+8+(u-v<<1));g.set(h),h=g}var E=l.charCodeAt(v);E<128||c?f(E):E<2048?(f(192|E>>>6),f(128|63&E)):E>55295&&E<57344?(f(240|(E=65536+(1047552&E)|1023&l.charCodeAt(++v))>>>18),f(128|E>>>12&63),f(128|E>>>6&63),f(128|63&E)):(f(224|E>>>12),f(128|E>>>6&63),f(128|63&E))}return hn(h,0,p)})(vt(e)),{mtime:0}),s=new Blob([i],{type:Gr});return{contentType:Gr,body:s,estimatedSize:s.size}}if(t===be.Base64){var n=(function(l){var c,u,h,p,f,v="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",g=0,E=0,w="",k=[];if(!l)return l;l=no(l);do c=(f=l.charCodeAt(g++)<<16|l.charCodeAt(g++)<<8|l.charCodeAt(g++))>>18&63,u=f>>12&63,h=f>>6&63,p=63&f,k[E++]=v.charAt(c)+v.charAt(u)+v.charAt(h)+v.charAt(p);while(g<l.length);switch(w=k.join(""),l.length%3){case 1:w=w.slice(0,-2)+"==";break;case 2:w=w.slice(0,-1)+"="}return w})(vt(e)),a=(l=>"data="+encodeURIComponent(typeof l=="string"?l:vt(l)))(n);return{contentType:"application/x-www-form-urlencoded",body:a,estimatedSize:new Blob([a]).size}}var o=vt(e);return{contentType:"application/json",body:o,estimatedSize:new Blob([o]).size}}},Dt=[];Ei&&Dt.push({transport:"fetch",method:r=>{var e,t,{contentType:i,body:s,estimatedSize:n}=(e=gi(r))!==null&&e!==void 0?e:{},a=new Headers;R(r.headers,(function(u,h){a.append(h,u)})),i&&a.append("Content-Type",i);var o=r.url,l=null;if(cr){var c=new cr;l={signal:c.signal,timeout:setTimeout((()=>c.abort()),r.timeout)}}Ei(o,b({method:r?.method||"GET",headers:a,keepalive:r.method==="POST"&&(n||0)<52428.8,body:s,signal:(t=l)==null?void 0:t.signal},r.fetchOptions)).then((u=>u.text().then((h=>{var p={statusCode:u.status,text:h};if(u.status===200)try{p.json=JSON.parse(h)}catch(f){y.error(f)}r.callback==null||r.callback(p)})))).catch((u=>{y.error(u),r.callback==null||r.callback({statusCode:0,text:u})})).finally((()=>l?clearTimeout(l.timeout):null))}}),xi&&Dt.push({transport:"XHR",method:r=>{var e,t=new xi;t.open(r.method||"GET",r.url,!0);var{contentType:i,body:s}=(e=gi(r))!==null&&e!==void 0?e:{};R(r.headers,(function(n,a){t.setRequestHeader(a,n)})),i&&t.setRequestHeader("Content-Type",i),r.timeout&&(t.timeout=r.timeout),r.disableXHRCredentials||(t.withCredentials=!0),t.onreadystatechange=()=>{if(t.readyState===4){var n={statusCode:t.status,text:t.responseText};if(t.status===200)try{n.json=JSON.parse(t.responseText)}catch{}r.callback==null||r.callback(n)}},t.send(s)}}),Q!=null&&Q.sendBeacon&&Dt.push({transport:"sendBeacon",method:r=>{var e=Kt(r.url,{beacon:"1"});try{var t,{contentType:i,body:s}=(t=gi(r))!==null&&t!==void 0?t:{},n=typeof s=="string"?new Blob([s],{type:i}):s;Q.sendBeacon(e,n)}catch{}}});var Zt=function(r,e){if(!(function(t){try{new RegExp(t)}catch{return!1}return!0})(e))return!1;try{return new RegExp(e).test(r)}catch{return!1}};function Wr(r,e,t){return vt({distinct_id:r,userPropertiesToSet:e,userPropertiesToSetOnce:t})}var dn={exact:(r,e)=>e.some((t=>r.some((i=>t===i)))),is_not:(r,e)=>e.every((t=>r.every((i=>t!==i)))),regex:(r,e)=>e.some((t=>r.some((i=>Zt(t,i))))),not_regex:(r,e)=>e.every((t=>r.every((i=>!Zt(t,i))))),icontains:(r,e)=>e.map(Mt).some((t=>r.map(Mt).some((i=>t.includes(i))))),not_icontains:(r,e)=>e.map(Mt).every((t=>r.map(Mt).every((i=>!t.includes(i)))))},Mt=r=>r.toLowerCase();function pn(r,e){return!r||Object.entries(r).every((t=>{var[i,s]=t,n=e?.[i];if(_(n)||we(n))return!1;var a=[String(n)],o=dn[s.operator];return!!o&&o(s.values,a)}))}var vi=N("[Error tracking]");class oo{constructor(e){var t,i;this.Jt=[],this.Kt=new Cn([new Hn,new Jn,new qn,new jn,new zn,new Wn,new Vn,new Yn],Un("web:javascript",An,Nn)),this._instance=e,this.Jt=(t=(i=this._instance.persistence)==null?void 0:i.get_property(Fi))!==null&&t!==void 0?t:[]}onRemoteConfig(e){var t,i,s,n=(t=(i=e.errorTracking)==null?void 0:i.suppressionRules)!==null&&t!==void 0?t:[],a=(s=e.errorTracking)==null?void 0:s.captureExtensionExceptions;this.Jt=n,this._instance.persistence&&this._instance.persistence.register({[Fi]:this.Jt,[wr]:a})}get Yt(){var e,t=!!this._instance.get_property(wr),i=this._instance.config.error_tracking.captureExtensionExceptions;return(e=i??t)!==null&&e!==void 0&&e}buildProperties(e,t){return this.Kt.buildFromUnknown(e,{syntheticException:t?.syntheticException,mechanism:{handled:t?.handled}})}sendExceptionEvent(e){var t=e.$exception_list;if(this.Xt(t)){if(this.Qt(t))return void vi.info("Skipping exception capture because a suppression rule matched");if(!this.Yt&&this.Zt(t))return void vi.info("Skipping exception capture because it was thrown by an extension");if(!this._instance.config.error_tracking.__capturePostHogExceptions&&this.ti(t))return void vi.info("Skipping exception capture because it was thrown by the PostHog SDK")}return this._instance.capture("$exception",e,{_noTruncate:!0,_batchKey:"exceptionEvent"})}Qt(e){if(e.length===0)return!1;var t=e.reduce(((i,s)=>{var{type:n,value:a}=s;return U(n)&&n.length>0&&i.$exception_types.push(n),U(a)&&a.length>0&&i.$exception_values.push(a),i}),{$exception_types:[],$exception_values:[]});return this.Jt.some((i=>{var s=i.values.map((n=>{var a,o=dn[n.operator],l=T(n.value)?n.value:[n.value],c=(a=t[n.key])!==null&&a!==void 0?a:[];return l.length>0&&o(l,c)}));return i.type==="OR"?s.some(Boolean):s.every(Boolean)}))}Zt(e){return e.flatMap((t=>{var i,s;return(i=(s=t.stacktrace)==null?void 0:s.frames)!==null&&i!==void 0?i:[]})).some((t=>t.filename&&t.filename.startsWith("chrome-extension://")))}ti(e){if(e.length>0){var t,i,s,n,a=(t=(i=e[0].stacktrace)==null?void 0:i.frames)!==null&&t!==void 0?t:[],o=a[a.length-1];return(s=o==null||(n=o.filename)==null?void 0:n.includes("posthog.com/static"))!==null&&s!==void 0&&s}return!1}Xt(e){return!F(e)&&T(e)}}var ae=N("[FeatureFlags]"),ot=N("[FeatureFlags]",{debugEnabled:!0}),_i="$active_feature_flags",Ve="$override_feature_flags",zr="$feature_flag_payloads",lt="$override_feature_flag_payloads",Yr="$feature_flag_request_id",Jr="$feature_flag_evaluated_at",Xr=r=>{var e={};for(var[t,i]of At(r||{}))i&&(e[t]=i);return e},lo=r=>{var e=r.flags;return e?(r.featureFlags=Object.fromEntries(Object.keys(e).map((t=>{var i;return[t,(i=e[t].variant)!==null&&i!==void 0?i:e[t].enabled]}))),r.featureFlagPayloads=Object.fromEntries(Object.keys(e).filter((t=>e[t].enabled)).filter((t=>{var i;return(i=e[t].metadata)==null?void 0:i.payload})).map((t=>{var i;return[t,(i=e[t].metadata)==null?void 0:i.payload]})))):ae.warn("Using an older version of the feature flags endpoint. Please upgrade your PostHog server to the latest version"),r},uo=(function(r){return r.FeatureFlags="feature_flags",r.Recordings="recordings",r})({});class co{constructor(e){this.ii=!1,this.ei=!1,this.ri=!1,this.si=!1,this.ni=!1,this.oi=!1,this.ai=!1,this._instance=e,this.featureFlagEventHandlers=[]}li(){var e=this._instance.config.evaluation_environments;return e!=null&&e.length?e.filter((t=>{var i=t&&typeof t=="string"&&t.trim().length>0;return i||ae.error("Invalid evaluation environment found:",t,"Expected non-empty string"),i})):[]}ui(){return this.li().length>0}flags(){if(this._instance.config.__preview_remote_config)this.oi=!0;else{var e=!this.hi&&(this._instance.config.advanced_disable_feature_flags||this._instance.config.advanced_disable_feature_flags_on_first_load);this.di({disableFlags:e})}}get hasLoadedFlags(){return this.ei}getFlags(){return Object.keys(this.getFlagVariants())}getFlagsWithDetails(){var e=this._instance.get_property(Ti),t=this._instance.get_property(Ve),i=this._instance.get_property(lt);if(!i&&!t)return e||{};var s=D({},e||{}),n=[...new Set([...Object.keys(i||{}),...Object.keys(t||{})])];for(var a of n){var o,l,c=s[a],u=t?.[a],h=_(u)?(o=c?.enabled)!==null&&o!==void 0&&o:!!u,p=_(u)?c.variant:typeof u=="string"?u:void 0,f=i?.[a],v=b({},c,{enabled:h,variant:h?p??c?.variant:void 0});h!==c?.enabled&&(v.original_enabled=c?.enabled),p!==c?.variant&&(v.original_variant=c?.variant),f&&(v.metadata=b({},c?.metadata,{payload:f,original_payload:c==null||(l=c.metadata)==null?void 0:l.payload})),s[a]=v}return this.ii||(ae.warn(" Overriding feature flag details!",{flagDetails:e,overriddenPayloads:i,finalDetails:s}),this.ii=!0),s}getFlagVariants(){var e=this._instance.get_property(Ye),t=this._instance.get_property(Ve);if(!t)return e||{};for(var i=D({},e),s=Object.keys(t),n=0;n<s.length;n++)i[s[n]]=t[s[n]];return this.ii||(ae.warn(" Overriding feature flags!",{enabledFlags:e,overriddenFlags:t,finalFlags:i}),this.ii=!0),i}getFlagPayloads(){var e=this._instance.get_property(zr),t=this._instance.get_property(lt);if(!t)return e||{};for(var i=D({},e||{}),s=Object.keys(t),n=0;n<s.length;n++)i[s[n]]=t[s[n]];return this.ii||(ae.warn(" Overriding feature flag payloads!",{flagPayloads:e,overriddenPayloads:t,finalPayloads:i}),this.ii=!0),i}reloadFeatureFlags(){this.si||this._instance.config.advanced_disable_feature_flags||this.hi||(this.hi=setTimeout((()=>{this.di()}),5))}vi(){clearTimeout(this.hi),this.hi=void 0}ensureFlagsLoaded(){this.ei||this.ri||this.hi||this.reloadFeatureFlags()}setAnonymousDistinctId(e){this.$anon_distinct_id=e}setReloadingPaused(e){this.si=e}di(e){var t;if(this.vi(),!this._instance.O())if(this.ri)this.ni=!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:b({},((t=this._instance.persistence)==null?void 0:t.get_initial_props())||{},this._instance.get_property(ft)||{}),group_properties:this._instance.get_property(Ne)};(e!=null&&e.disableFlags||this._instance.config.advanced_disable_feature_flags)&&(i.disable_flags=!0),this.ui()&&(i.evaluation_environments=this.li());var s=this._instance.config.__preview_remote_config,n=s?"/flags/?v=2":"/flags/?v=2&config=true",a=this._instance.config.advanced_only_evaluate_survey_feature_flags?"&only_evaluate_survey_feature_flags=true":"",o=this._instance.requestRouter.endpointFor("flags",n+a);s&&(i.timezone=an()),this.ri=!0,this._instance.ci({method:"POST",url:o,data:i,compression:this._instance.config.disable_compression?void 0:be.Base64,timeout:this._instance.config.feature_flag_request_timeout_ms,callback:l=>{var c,u,h=!0;if(l.statusCode===200&&(this.ni||(this.$anon_distinct_id=void 0),h=!1),this.ri=!1,this.oi||(this.oi=!0,this._instance.fi((u=l.json)!==null&&u!==void 0?u:{})),!i.disable_flags||this.ni)if(this.ai=!h,l.json&&(c=l.json.quotaLimited)!=null&&c.includes(uo.FeatureFlags))ae.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 p;i.disable_flags||this.receivedFeatureFlags((p=l.json)!==null&&p!==void 0?p:{},h),this.ni&&(this.ni=!1,this.di())}}})}}getFeatureFlag(e,t){if(t===void 0&&(t={}),this.ei||this.getFlags()&&this.getFlags().length>0){var i=this.getFlagVariants()[e],s=""+i,n=this._instance.get_property(Yr)||void 0,a=this._instance.get_property(Jr)||void 0,o=this._instance.get_property(jt)||{};if((t.send_event||!("send_event"in t))&&(!(e in o)||!o[e].includes(s))){var l,c,u,h,p,f,v,g,E;T(o[e])?o[e].push(s):o[e]=[s],(l=this._instance.persistence)==null||l.register({[jt]:o});var w=this.getFeatureFlagDetails(e),k={$feature_flag:e,$feature_flag_response:i,$feature_flag_payload:this.getFeatureFlagPayload(e)||null,$feature_flag_request_id:n,$feature_flag_evaluated_at:a,$feature_flag_bootstrapped_response:((c=this._instance.config.bootstrap)==null||(c=c.featureFlags)==null?void 0:c[e])||null,$feature_flag_bootstrapped_payload:((u=this._instance.config.bootstrap)==null||(u=u.featureFlagPayloads)==null?void 0:u[e])||null,$used_bootstrap_value:!this.ai};_(w==null||(h=w.metadata)==null?void 0:h.version)||(k.$feature_flag_version=w.metadata.version);var $,P=(p=w==null||(f=w.reason)==null?void 0:f.description)!==null&&p!==void 0?p:w==null||(v=w.reason)==null?void 0:v.code;P&&(k.$feature_flag_reason=P),w!=null&&(g=w.metadata)!=null&&g.id&&(k.$feature_flag_id=w.metadata.id),_(w?.original_variant)&&_(w?.original_enabled)||(k.$feature_flag_original_response=_(w.original_variant)?w.original_enabled:w.original_variant),w!=null&&(E=w.metadata)!=null&&E.original_payload&&(k.$feature_flag_original_payload=w==null||($=w.metadata)==null?void 0:$.original_payload),this._instance.capture("$feature_flag_called",k)}return i}ae.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,s={distinct_id:this._instance.get_distinct_id(),token:i};this.ui()&&(s.evaluation_environments=this.li()),this._instance.ci({method:"POST",url:this._instance.requestRouter.endpointFor("flags","/flags/?v=2&config=true"),data:s,compression:this._instance.config.disable_compression?void 0:be.Base64,timeout:this._instance.config.feature_flag_request_timeout_ms,callback:n=>{var a,o=(a=n.json)==null?void 0:a.featureFlagPayloads;t(o?.[e]||void 0)}})}isFeatureEnabled(e,t){if(t===void 0&&(t={}),this.ei||this.getFlags()&&this.getFlags().length>0){var i=this.getFeatureFlag(e,t);return _(i)?void 0:!!i}ae.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.ei=!0;var i=this.getFlagVariants(),s=this.getFlagPayloads(),n=this.getFlagsWithDetails();(function(a,o,l,c,u){l===void 0&&(l={}),c===void 0&&(c={}),u===void 0&&(u={});var h=lo(a),p=h.flags,f=h.featureFlags,v=h.featureFlagPayloads;if(f){var g=a.requestId,E=a.evaluatedAt;if(T(f)){ae.warn("v1 of the feature flags endpoint is deprecated. Please use the latest version.");var w={};if(f)for(var k=0;k<f.length;k++)w[f[k]]=!0;o&&o.register({[_i]:f,[Ye]:w})}else{var $=f,P=v,O=p;a.errorsWhileComputingFlags&&($=b({},l,$),P=b({},c,P),O=b({},u,O)),o&&o.register(b({[_i]:Object.keys(Xr($)),[Ye]:$||{},[zr]:P||{},[Ti]:O||{}},g?{[Yr]:g}:{},E?{[Jr]:E}:{}))}}})(e,this._instance.persistence,i,s,n),this.pi(t)}}override(e,t){t===void 0&&(t=!1),ae.warn("override is deprecated. Please use overrideFeatureFlags instead."),this.overrideFeatureFlags({flags:e,suppressWarning:t})}overrideFeatureFlags(e){if(!this._instance.__loaded||!this._instance.persistence)return ae.uninitializedWarning("posthog.featureFlags.overrideFeatureFlags");if(e===!1)return this._instance.persistence.unregister(Ve),this._instance.persistence.unregister(lt),this.pi(),ot.info("All overrides cleared");if(e&&typeof e=="object"&&("flags"in e||"payloads"in e)){var t,i=e;if(this.ii=!!((t=i.suppressWarning)!==null&&t!==void 0&&t),"flags"in i){if(i.flags===!1)this._instance.persistence.unregister(Ve),ot.info("Flag overrides cleared");else if(i.flags){if(T(i.flags)){for(var s={},n=0;n<i.flags.length;n++)s[i.flags[n]]=!0;this._instance.persistence.register({[Ve]:s})}else this._instance.persistence.register({[Ve]:i.flags});ot.info("Flag overrides set",{flags:i.flags})}}return"payloads"in i&&(i.payloads===!1?(this._instance.persistence.unregister(lt),ot.info("Payload overrides cleared")):i.payloads&&(this._instance.persistence.register({[lt]:i.payloads}),ot.info("Payload overrides set",{payloads:i.payloads}))),void this.pi()}this.pi()}onFeatureFlags(e){if(this.addFeatureFlagsHandler(e),this.ei){var{flags:t,flagVariants:i}=this.gi();e(t,i)}return()=>this.removeFeatureFlagsHandler(e)}updateEarlyAccessFeatureEnrollment(e,t,i){var s,n=(this._instance.get_property(pt)||[]).find((c=>c.flagKey===e)),a={["$feature_enrollment/"+e]:t},o={$feature_flag:e,$feature_enrollment:t,$set:a};n&&(o.$early_access_feature_name=n.name),i&&(o.$feature_enrollment_stage=i),this._instance.capture("$feature_enrollment_update",o),this.setPersonPropertiesForFlags(a,!1);var l=b({},this.getFlagVariants(),{[e]:t});(s=this._instance.persistence)==null||s.register({[_i]:Object.keys(Xr(l)),[Ye]:l}),this.pi()}getEarlyAccessFeatures(e,t,i){t===void 0&&(t=!1);var s=this._instance.get_property(pt),n=i?"&"+i.map((a=>"stage="+a)).join("&"):"";if(s&&!t)return e(s);this._instance.ci({url:this._instance.requestRouter.endpointFor("api","/api/early_access_features/?token="+this._instance.config.token+n),method:"GET",callback:a=>{var o,l;if(a.json){var c=a.json.earlyAccessFeatures;return(o=this._instance.persistence)==null||o.unregister(pt),(l=this._instance.persistence)==null||l.register({[pt]:c}),e(c)}}})}gi(){var e=this.getFlags(),t=this.getFlagVariants();return{flags:e.filter((i=>t[i])),flagVariants:Object.keys(t).filter((i=>t[i])).reduce(((i,s)=>(i[s]=t[s],i)),{})}}pi(e){var{flags:t,flagVariants:i}=this.gi();this.featureFlagEventHandlers.forEach((s=>s(t,i,{errorsLoading:e})))}setPersonPropertiesForFlags(e,t){t===void 0&&(t=!0);var i=this._instance.get_property(ft)||{};this._instance.register({[ft]:b({},i,e)}),t&&this._instance.reloadFeatureFlags()}resetPersonPropertiesForFlags(){this._instance.unregister(ft)}setGroupPropertiesForFlags(e,t){t===void 0&&(t=!0);var i=this._instance.get_property(Ne)||{};Object.keys(i).length!==0&&Object.keys(i).forEach((s=>{i[s]=b({},i[s],e[s]),delete e[s]})),this._instance.register({[Ne]:b({},i,e)}),t&&this._instance.reloadFeatureFlags()}resetGroupPropertiesForFlags(e){if(e){var t=this._instance.get_property(Ne)||{};this._instance.register({[Ne]:b({},t,{[e]:{}})})}else this._instance.unregister(Ne)}reset(){this.ei=!1,this.ri=!1,this.si=!1,this.ni=!1,this.oi=!1,this.ai=!1,this.$anon_distinct_id=void 0,this.vi(),this.ii=!1}}var ho=["cookie","localstorage","localstorage+cookie","sessionstorage","memory"];class mi{constructor(e,t){this.I=e,this.props={},this.mi=!1,this.yi=(i=>{var s="";return i.token&&(s=i.token.replace(/\+/g,"PL").replace(/\//g,"SL").replace(/=/g,"EQ")),i.persistence_name?"ph_"+i.persistence_name:"ph_"+s+"_posthog"})(e),this.Y=this.bi(e),this.load(),e.debug&&y.info("Persistence loaded",e.persistence,b({},this.props)),this.update_config(e,e,t),this.save()}isDisabled(){return!!this.wi}bi(e){ho.indexOf(e.persistence.toLowerCase())===-1&&(y.critical("Unknown persistence type "+e.persistence+"; falling back to localStorage+cookie"),e.persistence="localStorage+cookie");var t=e.persistence.toLowerCase();return t==="localstorage"&&A.H()?A:t==="localstorage+cookie"&&Tt.H()?Tt:t==="sessionstorage"&&j.H()?j:t==="memory"?Ea:t==="cookie"?pe:Tt.H()?Tt:pe}properties(){var e={};return R(this.props,(function(t,i){if(i===Ye&&H(t))for(var s=Object.keys(t),n=0;n<s.length;n++)e["$feature/"+s[n]]=t[s[n]];else o=i,l=!1,(we(a=ta)?l:ur&&a.indexOf===ur?a.indexOf(o)!=-1:(R(a,(function(c){if(l||(l=c===o))return Ut})),l))||(e[i]=t);var a,o,l})),e}load(){if(!this.wi){var e=this.Y.W(this.yi);e&&(this.props=D({},e))}}save(){this.wi||this.Y.G(this.yi,this.props,this.xi,this.Ei,this.Si,this.I.debug)}remove(){this.Y.V(this.yi,!1),this.Y.V(this.yi,!0)}clear(){this.remove(),this.props={}}register_once(e,t,i){if(H(e)){_(t)&&(t="None"),this.xi=_(i)?this.$i:i;var s=!1;if(R(e,((n,a)=>{this.props.hasOwnProperty(a)&&this.props[a]!==t||(this.props[a]=n,s=!0)})),s)return this.save(),!0}return!1}register(e,t){if(H(e)){this.xi=_(t)?this.$i:t;var i=!1;if(R(e,((s,n)=>{e.hasOwnProperty(n)&&this.props[n]!==s&&(this.props[n]=s,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.mi){var e=Qs(this.I.custom_campaign_params,this.I.mask_personal_data_properties,this.I.custom_personal_data_properties);ze(zi(e))||this.register(e),this.mi=!0}}update_search_keyword(){var e;this.register((e=m?.referrer)?tn(e):{})}update_referrer_info(){var e;this.register_once({$referrer:rn(),$referring_domain:m!=null&&m.referrer&&((e=Gt(m.referrer))==null?void 0:e.host)||"$direct"},void 0)}set_initial_person_info(){this.props[Mi]||this.props[Ai]||this.register_once({[qt]:sn(this.I.mask_personal_data_properties,this.I.custom_personal_data_properties)},void 0)}get_initial_props(){var e={};R([Ai,Mi],(a=>{var o=this.props[a];o&&R(o,(function(l,c){e["$initial_"+ki(c)]=l}))}));var t,i,s=this.props[qt];if(s){var n=(t=nn(s),i={},R(t,(function(a,o){i["$initial_"+ki(o)]=a})),i);D(e,n)}return e}safe_merge(e){return R(this.props,(function(t,i){i in e||(e[i]=t)})),e}update_config(e,t,i){if(this.$i=this.xi=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.bi(e),n=this.props;this.clear(),this.Y=s,this.props=n,this.save()}}set_disabled(e){this.wi=e,this.wi?this.remove():this.save()}set_cross_subdomain(e){e!==this.Ei&&(this.Ei=e,this.remove(),this.save())}set_secure(e){e!==this.Si&&(this.Si=e,this.remove(),this.save())}set_event_timer(e,t){var i=this.props[dt]||{};i[e]=t,this.props[dt]=i,this.save()}remove_event_timer(e){var t=(this.props[dt]||{})[e];return _(t)||(delete this.props[dt][e],this.save()),t}get_property(e){return this.props[e]}set_property(e,t){this.props[e]=t,this.save()}}var G=N("[Product Tours]"),yi="ph_product_tours";class po{constructor(e){this.ki=null,this.Pi=null,this.Ti=void 0,this.Ri=!1,this._instance=e}onRemoteConfig(e){if(this._instance.config.disable_product_tours)G.info("Product tours disabled via config");else{var t=e.productTours;F(t)?G.info("Product tours not enabled in remote config"):(this.Ti=t,G.info("Remote config received, isProductToursEnabled: "+this.Ti),this.loadIfEnabled())}}loadIfEnabled(){var e;if(!this.Pi)if(this.Ri)G.info("Already initializing product tours, skipping...");else if(this._instance.config.disable_product_tours)G.info("Product tours disabled via config");else{var t=x?.__PosthogExtensions__;if(t){var i=(e=this._instance.featureFlags)==null?void 0:e.isFeatureEnabled("product-tours-2025");if(!_(this.Ti)||i){var s=this.Ti||i;if(s){this.Ri=!0;try{var n=t.generateProductTours;if(n)return void this.Ci(n,s);var a=t.loadExternalDependency;if(!a)return G.error("PostHog loadExternalDependency extension not found."),void(this.Ri=!1);a(this._instance,"product-tours",(o=>{o||!t.generateProductTours?G.error("Could not load product tours script",o):this.Ci(t.generateProductTours,s),this.Ri=!1}))}catch(o){G.error("Error initializing product tours",o),this.Ri=!1}}else G.info("Product tours not enabled")}else G.info("Waiting for remote config or feature flag to enable product tours")}else G.error("PostHog Extensions not found.")}}Ci(e,t){this.Pi=e(this._instance,t)||null,G.info("Product tours loaded successfully")}getProductTours(e,t){if(t===void 0&&(t=!1),!T(this.ki)||t){var i=this._instance.persistence;if(i){var s=i.props[yi];if(T(s)&&!t)return this.ki=s,void e(s,{isLoaded:!0})}this._instance.ci({url:this._instance.requestRouter.endpointFor("api","/api/product_tours/?token="+this._instance.config.token),method:"GET",callback:n=>{var a=n.statusCode;if(a!==200||!n.json){var o="Product Tours API could not be loaded, status: "+a;return G.error(o),void e([],{isLoaded:!1,error:o})}var l=T(n.json.product_tours)?n.json.product_tours:[];this.ki=l,i&&i.register({[yi]:l}),e(l,{isLoaded:!0})}})}else e(this.ki,{isLoaded:!0})}getActiveProductTours(e){if(F(this.Pi))return G.warn("Product tours not loaded yet"),void e([],{isLoaded:!1,error:"Product tours not loaded"});this.Pi.getActiveProductTours(e)}showProductTour(e){var t;G.info("showProductTour("+e+")"),(t=this.Pi)==null||t.showTourById(e)}dismissProductTour(){var e;(e=this.Pi)==null||e.dismissTour("user_clicked_skip")}nextStep(){var e;(e=this.Pi)==null||e.nextStep()}previousStep(){var e;(e=this.Pi)==null||e.previousStep()}clearCache(){this.ki=null;var e=this._instance.persistence;e&&e.unregister(yi)}resetTour(e){var t;(t=this.Pi)==null||t.resetTour(e)}resetAllTours(){var e;(e=this.Pi)==null||e.resetAllTours()}}var ut=(function(r){return r.Activation="events",r.Cancellation="cancelEvents",r})({}),Do=(function(r){return r.Button="button",r.Tab="tab",r.Selector="selector",r})({}),Lo=(function(r){return r.TopLeft="top_left",r.TopRight="top_right",r.TopCenter="top_center",r.MiddleLeft="middle_left",r.MiddleRight="middle_right",r.MiddleCenter="middle_center",r.Left="left",r.Center="center",r.Right="right",r.NextToTrigger="next_to_trigger",r})({}),No=(function(r){return r.Top="top",r.Left="left",r.Right="right",r.Bottom="bottom",r})({}),bi=(function(r){return r.Popover="popover",r.API="api",r.Widget="widget",r.ExternalSurvey="external_survey",r})({}),Uo=(function(r){return r.Open="open",r.MultipleChoice="multiple_choice",r.SingleChoice="single_choice",r.Rating="rating",r.Link="link",r})({}),Ho=(function(r){return r.NextQuestion="next_question",r.End="end",r.ResponseBased="response_based",r.SpecificQuestion="specific_question",r})({}),jo=(function(r){return r.Once="once",r.Recurring="recurring",r.Always="always",r})({}),Lt=(function(r){return r.SHOWN="survey shown",r.DISMISSED="survey dismissed",r.SENT="survey sent",r})({}),Kr=(function(r){return r.SURVEY_ID="$survey_id",r.SURVEY_NAME="$survey_name",r.SURVEY_RESPONSE="$survey_response",r.SURVEY_ITERATION="$survey_iteration",r.SURVEY_ITERATION_START_DATE="$survey_iteration_start_date",r.SURVEY_PARTIALLY_COMPLETED="$survey_partially_completed",r.SURVEY_SUBMISSION_ID="$survey_submission_id",r.SURVEY_QUESTIONS="$survey_questions",r.SURVEY_COMPLETED="$survey_completed",r})({}),fn=(function(r){return r.Popover="popover",r.Inline="inline",r})({});class rr{constructor(){this.Ii={},this.Ii={}}on(e,t){return this.Ii[e]||(this.Ii[e]=[]),this.Ii[e].push(t),()=>{this.Ii[e]=this.Ii[e].filter((i=>i!==t))}}emit(e,t){for(var i of this.Ii[e]||[])i(t);for(var s of this.Ii["*"]||[])s(e,t)}}function Ge(r,e,t){if(F(r))return!1;switch(t){case"exact":return r===e;case"contains":var i=e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&").replace(/_/g,".").replace(/%/g,".*");return new RegExp(i,"i").test(r);case"regex":try{return new RegExp(e).test(r)}catch{return!1}default:return!1}}class fo{constructor(e){this.Fi=new rr,this.Mi=(t,i)=>this.Oi(t,i)&&this.Ai(t,i)&&this.Di(t,i)&&this.ji(t,i),this.Oi=(t,i)=>i==null||!i.event||t?.event===i?.event,this._instance=e,this.Li=new Set,this.Ni=new Set}init(){var e;if(!_((e=this._instance)==null?void 0:e.Ui)){var t;(t=this._instance)==null||t.Ui(((i,s)=>{this.on(i,s)}))}}register(e){var t,i;if(!_((t=this._instance)==null?void 0:t.Ui)&&(e.forEach((a=>{var o,l;(o=this.Ni)==null||o.add(a),(l=a.steps)==null||l.forEach((c=>{var u;(u=this.Li)==null||u.add(c?.event||"")}))})),(i=this._instance)!=null&&i.autocapture)){var s,n=new Set;e.forEach((a=>{var o;(o=a.steps)==null||o.forEach((l=>{l!=null&&l.selector&&n.add(l?.selector)}))})),(s=this._instance)==null||s.autocapture.setElementSelectors(n)}}on(e,t){var i;t!=null&&e.length!=0&&(this.Li.has(e)||this.Li.has(t?.event))&&this.Ni&&((i=this.Ni)==null?void 0:i.size)>0&&this.Ni.forEach((s=>{this.zi(t,s)&&this.Fi.emit("actionCaptured",s.name)}))}Hi(e){this.onAction("actionCaptured",(t=>e(t)))}zi(e,t){if(t?.steps==null)return!1;for(var i of t.steps)if(this.Mi(e,i))return!0;return!1}onAction(e,t){return this.Fi.on(e,t)}Ai(e,t){if(t!=null&&t.url){var i,s=e==null||(i=e.properties)==null?void 0:i.$current_url;if(!s||typeof s!="string"||!Ge(s,t.url,t.url_matching||"contains"))return!1}return!0}Di(e,t){return!!this.Bi(e,t)&&!!this.qi(e,t)&&!!this.Wi(e,t)}Bi(e,t){var i;if(t==null||!t.href)return!0;var s=this.Gi(e);if(s.length>0)return s.some((o=>Ge(o.href,t.href,t.href_matching||"exact")));var n,a=(e==null||(i=e.properties)==null?void 0:i.$elements_chain)||"";return!!a&&Ge((n=a.match(/(?::|")href="(.*?)"/))?n[1]:"",t.href,t.href_matching||"exact")}qi(e,t){var i;if(t==null||!t.text)return!0;var s=this.Gi(e);if(s.length>0)return s.some((c=>Ge(c.text,t.text,t.text_matching||"exact")||Ge(c.$el_text,t.text,t.text_matching||"exact")));var n,a,o,l=(e==null||(i=e.properties)==null?void 0:i.$elements_chain)||"";return!!l&&(n=(function(c){for(var u,h=[],p=/(?::|")text="(.*?)"/g;!F(u=p.exec(c));)h.includes(u[1])||h.push(u[1]);return h})(l),a=t.text,o=t.text_matching||"exact",n.some((c=>Ge(c,a,o))))}Wi(e,t){var i,s;if(t==null||!t.selector)return!0;var n=e==null||(i=e.properties)==null?void 0:i.$element_selectors;if(n!=null&&n.includes(t.selector))return!0;var a=(e==null||(s=e.properties)==null?void 0:s.$elements_chain)||"";if(t.selector_regex&&a)try{return new RegExp(t.selector_regex).test(a)}catch{return!1}return!1}Gi(e){var t;return(e==null||(t=e.properties)==null?void 0:t.$elements)==null?[]:e?.properties.$elements}ji(e,t){return t==null||!t.properties||t.properties.length===0||pn(t.properties.reduce(((i,s)=>{var n=T(s.value)?s.value.map(String):s.value!=null?[String(s.value)]:[];return i[s.key]={values:n,operator:s.operator||"exact"},i}),{}),e?.properties)}}var C=N("[Surveys]"),Bi="seenSurvey_",go=(r,e)=>{var t="$survey_"+e+"/"+r.id;return r.current_iteration&&r.current_iteration>0&&(t="$survey_"+e+"/"+r.id+"/"+r.current_iteration),t},Zr=r=>{var e=""+Bi+r.id;return r.current_iteration&&r.current_iteration>0&&(e=""+Bi+r.id+"_"+r.current_iteration),e},vo=[bi.Popover,bi.Widget,bi.API],_o={ignoreConditions:!1,ignoreDelay:!1,displayType:fn.Popover};class mo{constructor(e){this._instance=e,this.Vi=new Map,this.Ji=new Map,this.Ki=new Map}Yi(e,t){return!!e&&pn(e.propertyFilters,t?.properties)}Xi(e,t){var i=new Map;return e.forEach((s=>{var n;(n=s.conditions)==null||(n=n[t])==null||(n=n.values)==null||n.forEach((a=>{if(a!=null&&a.name){var o=i.get(a.name)||[];o.push(s.id),i.set(a.name,o)}}))})),i}Qi(e,t,i){var s,n=(i===ut.Activation?this.Vi:this.Ji).get(e),a=[];return(s=this._instance)==null||s.getSurveys((o=>{a=o.filter((l=>n?.includes(l.id)))})),a.filter((o=>{var l,c=(l=o.conditions)==null||(l=l[i])==null||(l=l.values)==null?void 0:l.find((u=>u.name===e));return this.Yi(c,t)}))}register(e){var t;_((t=this._instance)==null?void 0:t.Ui)||(this.Zi(e),this.te(e))}te(e){var t=e.filter((i=>{var s,n;return((s=i.conditions)==null?void 0:s.actions)&&((n=i.conditions)==null||(n=n.actions)==null||(n=n.values)==null?void 0:n.length)>0}));t.length!==0&&(this.ie==null&&(this.ie=new fo(this._instance),this.ie.init(),this.ie.Hi((i=>{this.onAction(i)}))),t.forEach((i=>{var s,n,a,o,l;i.conditions&&(s=i.conditions)!=null&&s.actions&&(n=i.conditions)!=null&&(n=n.actions)!=null&&n.values&&((a=i.conditions)==null||(a=a.actions)==null||(a=a.values)==null?void 0:a.length)>0&&((o=this.ie)==null||o.register(i.conditions.actions.values),(l=i.conditions)==null||(l=l.actions)==null||(l=l.values)==null||l.forEach((c=>{if(c&&c.name){var u=this.Ki.get(c.name);u&&u.push(i.id),this.Ki.set(c.name,u||[i.id])}})))})))}Zi(e){var t,i=e.filter((n=>{var a,o;return((a=n.conditions)==null?void 0:a.events)&&((o=n.conditions)==null||(o=o.events)==null||(o=o.values)==null?void 0:o.length)>0})),s=e.filter((n=>{var a,o;return((a=n.conditions)==null?void 0:a.cancelEvents)&&((o=n.conditions)==null||(o=o.cancelEvents)==null||(o=o.values)==null?void 0:o.length)>0}));(i.length!==0||s.length!==0)&&((t=this._instance)==null||t.Ui(((n,a)=>{this.onEvent(n,a)})),this.Vi=this.Xi(e,ut.Activation),this.Ji=this.Xi(e,ut.Cancellation))}onEvent(e,t){var i,s=((i=this._instance)==null||(i=i.persistence)==null?void 0:i.props[Ft])||[];if(Lt.SHOWN===e&&t&&s.length>0){var n;C.info("survey event matched, removing survey from activated surveys",{event:e,eventPayload:t,existingActivatedSurveys:s});var a=t==null||(n=t.properties)==null?void 0:n.$survey_id;if(a){var o=s.indexOf(a);o>=0&&(s.splice(o,1),this.ee(s))}}else{if(this.Ji.has(e)){var l=this.Qi(e,t,ut.Cancellation);l.length>0&&(C.info("cancel event matched, cancelling surveys",{event:e,surveysToCancel:l.map((u=>u.id))}),l.forEach((u=>{var h,p=s.indexOf(u.id);p>=0&&s.splice(p,1),(h=this._instance)==null||h.cancelPendingSurvey(u.id)})),this.ee(s))}if(this.Vi.has(e)){C.info("survey event name matched",{event:e,eventPayload:t,surveys:this.Vi.get(e)});var c=this.Qi(e,t,ut.Activation);this.ee(s.concat(c.map((u=>u.id))||[]))}}}onAction(e){var t,i=((t=this._instance)==null||(t=t.persistence)==null?void 0:t.props[Ft])||[];this.Ki.has(e)&&this.ee(i.concat(this.Ki.get(e)||[]))}ee(e){var t;C.info("updating activated surveys",{activatedSurveys:e}),(t=this._instance)==null||(t=t.persistence)==null||t.register({[Ft]:[...new Set(e)]})}getSurveys(){var e,t=(e=this._instance)==null||(e=e.persistence)==null?void 0:e.props[Ft];return t||[]}getEventToSurveys(){return this.Vi}re(){return this.ie}}class yo{constructor(e){this.se=void 0,this._surveyManager=null,this.ne=!1,this.oe=!1,this.ae=[],this._instance=e,this._surveyEventReceiver=null}onRemoteConfig(e){if(!this._instance.config.disable_surveys){var t=e.surveys;if(F(t))return C.warn("Flags not loaded yet. Not loading surveys.");var i=T(t);this.se=i?t.length>0:t,C.info("flags response received, isSurveysEnabled: "+this.se),this.loadIfEnabled()}}reset(){localStorage.removeItem("lastSeenSurveyDate");for(var e=[],t=0;t<localStorage.length;t++){var i=localStorage.key(t);(i!=null&&i.startsWith(Bi)||i!=null&&i.startsWith("inProgressSurvey_"))&&e.push(i)}e.forEach((s=>localStorage.removeItem(s)))}loadIfEnabled(){if(!this._surveyManager)if(this.oe)C.info("Already initializing surveys, skipping...");else if(this._instance.config.disable_surveys)C.info("Disabled. Not loading surveys.");else if(this._instance.config.cookieless_mode&&this._instance.consent.isOptedOut())C.info("Not loading surveys in cookieless mode without consent.");else{var e=x?.__PosthogExtensions__;if(e){if(!_(this.se)||this._instance.config.advanced_enable_surveys){var t=this.se||this._instance.config.advanced_enable_surveys;this.oe=!0;try{var i=e.generateSurveys;if(i)return void this.le(i,t);var s=e.loadExternalDependency;if(!s)return void this.ue("PostHog loadExternalDependency extension not found.");s(this._instance,"surveys",(n=>{n||!e.generateSurveys?this.ue("Could not load surveys script",n):this.le(e.generateSurveys,t)}))}catch(n){throw this.ue("Error initializing surveys",n),n}finally{this.oe=!1}}}else C.error("PostHog Extensions not found.")}}le(e,t){this._surveyManager=e(this._instance,t),this._surveyEventReceiver=new mo(this._instance),C.info("Surveys loaded successfully"),this.he({isLoaded:!0})}ue(e,t){C.error(e,t),this.he({isLoaded:!1,error:e})}onSurveysLoaded(e){return this.ae.push(e),this._surveyManager&&this.he({isLoaded:!0}),()=>{this.ae=this.ae.filter((t=>t!==e))}}getSurveys(e,t){if(t===void 0&&(t=!1),this._instance.config.disable_surveys)return C.info("Disabled. Not loading surveys."),e([]);var i=this._instance.get_property(Ci);if(i&&!t)return e(i,{isLoaded:!0});if(this.ne)return e([],{isLoaded:!1,error:"Surveys are already being loaded"});try{this.ne=!0,this._instance.ci({url:this._instance.requestRouter.endpointFor("api","/api/surveys/?token="+this._instance.config.token),method:"GET",timeout:this._instance.config.surveys_request_timeout_ms,callback:s=>{var n;this.ne=!1;var a=s.statusCode;if(a!==200||!s.json){var o="Surveys API could not be loaded, status: "+a;return C.error(o),e([],{isLoaded:!1,error:o})}var l,c=s.json.surveys||[],u=c.filter((h=>(function(p){return!(!p.start_date||p.end_date)})(h)&&((function(p){var f;return!((f=p.conditions)==null||(f=f.events)==null||(f=f.values)==null||!f.length)})(h)||(function(p){var f;return!((f=p.conditions)==null||(f=f.actions)==null||(f=f.values)==null||!f.length)})(h))));return u.length>0&&((l=this._surveyEventReceiver)==null||l.register(u)),(n=this._instance.persistence)==null||n.register({[Ci]:c}),e(c,{isLoaded:!0})}})}catch(s){throw this.ne=!1,s}}he(e){for(var t of this.ae)try{if(!e.isLoaded)return t([],e);this.getSurveys(t)}catch(i){C.error("Error in survey callback",i)}}getActiveMatchingSurveys(e,t){if(t===void 0&&(t=!1),!F(this._surveyManager))return this._surveyManager.getActiveMatchingSurveys(e,t);C.warn("init was not called")}de(e){var t=null;return this.getSurveys((i=>{var s;t=(s=i.find((n=>n.id===e)))!==null&&s!==void 0?s:null})),t}ve(e){if(F(this._surveyManager))return{eligible:!1,reason:"SDK is not enabled or survey functionality is not yet loaded"};var t=typeof e=="string"?this.de(e):e;return t?this._surveyManager.checkSurveyEligibility(t):{eligible:!1,reason:"Survey not found"}}canRenderSurvey(e){if(F(this._surveyManager))return C.warn("init was not called"),{visible:!1,disabledReason:"SDK is not enabled or survey functionality is not yet loaded"};var t=this.ve(e);return{visible:t.eligible,disabledReason:t.reason}}canRenderSurveyAsync(e,t){return F(this._surveyManager)?(C.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((s=>{var n,a=(n=s.find((l=>l.id===e)))!==null&&n!==void 0?n:null;if(a){var o=this.ve(a);i({visible:o.eligible,disabledReason:o.reason})}else i({visible:!1,disabledReason:"Survey not found"})}),t)}))}renderSurvey(e,t){var i;if(F(this._surveyManager))C.warn("init was not called");else{var s=typeof e=="string"?this.de(e):e;if(s!=null&&s.id)if(vo.includes(s.type)){var n=m?.querySelector(t);if(n)return(i=s.appearance)!=null&&i.surveyPopupDelaySeconds?(C.info("Rendering survey "+s.id+" with delay of "+s.appearance.surveyPopupDelaySeconds+" seconds"),void setTimeout((()=>{var a,o;C.info("Rendering survey "+s.id+" with delay of "+((a=s.appearance)==null?void 0:a.surveyPopupDelaySeconds)+" seconds"),(o=this._surveyManager)==null||o.renderSurvey(s,n),C.info("Survey "+s.id+" rendered")}),1e3*s.appearance.surveyPopupDelaySeconds)):void this._surveyManager.renderSurvey(s,n);C.warn("Survey element not found")}else C.warn("Surveys of type "+s.type+" cannot be rendered in the app");else C.warn("Survey not found")}}displaySurvey(e,t){var i;if(F(this._surveyManager))C.warn("init was not called");else{var s=this.de(e);if(s){var n=s;if((i=s.appearance)!=null&&i.surveyPopupDelaySeconds&&t.ignoreDelay&&(n=b({},s,{appearance:b({},s.appearance,{surveyPopupDelaySeconds:0})})),t.ignoreConditions===!1){var a=this.canRenderSurvey(s);if(!a.visible)return void C.warn("Survey is not eligible to be displayed: ",a.disabledReason)}t.displayType!==fn.Inline?this._surveyManager.handlePopoverSurvey(n):this.renderSurvey(n,t.selector)}else C.warn("Survey not found")}}cancelPendingSurvey(e){F(this._surveyManager)?C.warn("init was not called"):this._surveyManager.cancelSurvey(e)}}var Qr=N("[RateLimiter]");class bo{constructor(e){var t,i;this.serverLimits={},this.lastEventRateLimited=!1,this.checkForLimiting=s=>{var n=s.text;if(n&&n.length)try{(JSON.parse(n).quota_limited||[]).forEach((a=>{Qr.info((a||"events")+" is quota limited."),this.serverLimits[a]=new Date().getTime()+6e4}))}catch(a){return void Qr.warn('could not rate limit - continuing. Error: "'+a?.message+'"',{text:n})}},this.instance=e,this.captureEventsPerSecond=((t=e.config.rate_limiting)==null?void 0:t.events_per_second)||10,this.captureEventsBurstLimit=Math.max(((i=e.config.rate_limiting)==null?void 0:i.events_burst_limit)||10*this.captureEventsPerSecond,this.captureEventsPerSecond),this.lastEventRateLimited=this.clientRateLimitContext(!0).isRateLimited}clientRateLimitContext(e){var t,i,s;e===void 0&&(e=!1);var n=new Date().getTime(),a=(t=(i=this.instance.persistence)==null?void 0:i.get_property(Oi))!==null&&t!==void 0?t:{tokens:this.captureEventsBurstLimit,last:n};a.tokens+=(n-a.last)/1e3*this.captureEventsPerSecond,a.last=n,a.tokens>this.captureEventsBurstLimit&&(a.tokens=this.captureEventsBurstLimit);var o=a.tokens<1;return o||e||(a.tokens=Math.max(0,a.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,(s=this.instance.persistence)==null||s.set_property(Oi,a),{isRateLimited:o,remainingTokens:a.tokens}}isServerRateLimited(e){var t=this.serverLimits[e||"events"]||!1;return t!==!1&&new Date().getTime()<t}}var Le=N("[RemoteConfig]");class wo{constructor(e){this._instance=e}get remoteConfig(){var e;return(e=x._POSTHOG_REMOTE_CONFIG)==null||(e=e[this._instance.config.token])==null?void 0:e.config}ce(e){var t,i;(t=x.__PosthogExtensions__)!=null&&t.loadExternalDependency?(i=x.__PosthogExtensions__)==null||i.loadExternalDependency==null||i.loadExternalDependency(this._instance,"remote-config",(()=>e(this.remoteConfig))):(Le.error("PostHog Extensions not found. Cannot load remote config."),e())}fe(e){this._instance.ci({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 Le.info("Using preloaded remote config",this.remoteConfig),void this.fi(this.remoteConfig);if(this._instance.O())return void Le.warn("Remote config is disabled. Falling back to local config.");this.ce((e=>{if(!e)return Le.info("No config found after loading remote JS config. Falling back to JSON."),void this.fe((t=>{this.fi(t)}));this.fi(e)}))}catch(e){Le.error("Error loading remote config",e)}}fi(e){e?this._instance.config.__preview_remote_config?(this._instance.fi(e),e.hasFeatureFlags!==!1&&this._instance.featureFlags.ensureFlagsLoaded()):Le.info("__preview_remote_config is disabled. Logging config instead",e):Le.error("Failed to fetch remote config from PostHog.")}}var Vi=3e3;class Eo{constructor(e,t){this.pe=!0,this.ge=[],this._e=he(t?.flush_interval_ms||Vi,250,5e3,y.createLogger("flush interval"),Vi),this.me=e}enqueue(e){this.ge.push(e),this.ye||this.be()}unload(){this.we();var e=this.ge.length>0?this.xe():{},t=Object.values(e);[...t.filter((i=>i.url.indexOf("/e")===0)),...t.filter((i=>i.url.indexOf("/e")!==0))].map((i=>{this.me(b({},i,{transport:"sendBeacon"}))}))}enable(){this.pe=!1,this.be()}be(){var e=this;this.pe||(this.ye=setTimeout((()=>{if(this.we(),this.ge.length>0){var t=this.xe(),i=function(){var n=t[s],a=new Date().getTime();n.data&&T(n.data)&&R(n.data,(o=>{o.offset=Math.abs(o.timestamp-a),delete o.timestamp})),e.me(n)};for(var s in t)i()}}),this._e))}we(){clearTimeout(this.ye),this.ye=void 0}xe(){var e={};return R(this.ge,(t=>{var i,s=t,n=(s?s.batchKey:null)||s.url;_(e[n])&&(e[n]=b({},s,{data:[]})),(i=e[n].data)==null||i.push(s.data)})),this.ge=[],e}}var xo=["retriesPerformedSoFar"];class ko{constructor(e){this.Ee=!1,this.Se=3e3,this.ge=[],this._instance=e,this.ge=[],this.$e=!0,!_(d)&&"onLine"in d.navigator&&(this.$e=d.navigator.onLine,this.ke=()=>{this.$e=!0,this.Dt()},this.Pe=()=>{this.$e=!1},L(d,"online",this.ke),L(d,"offline",this.Pe))}get length(){return this.ge.length}retriableRequest(e){var{retriesPerformedSoFar:t}=e,i=ls(e,xo);fe(t)&&t>0&&(i.url=Kt(i.url,{retry_count:t})),this._instance.ci(b({},i,{callback:s=>{s.statusCode!==200&&(s.statusCode<400||s.statusCode>=500)&&(t??0)<10?this.Te(b({retriesPerformedSoFar:t},i)):i.callback==null||i.callback(s)}}))}Te(e){var t=e.retriesPerformedSoFar||0;e.retriesPerformedSoFar=t+1;var i=(function(a){var o=3e3*Math.pow(2,a),l=o/2,c=Math.min(18e5,o),u=(Math.random()-.5)*(c-l);return Math.ceil(c+u)})(t),s=Date.now()+i;this.ge.push({retryAt:s,requestOptions:e});var n="Enqueued failed request for retry in "+i;navigator.onLine||(n+=" (Browser is offline)"),y.warn(n),this.Ee||(this.Ee=!0,this.Re())}Re(){if(this.Ce&&clearTimeout(this.Ce),this.ge.length===0)return this.Ee=!1,void(this.Ce=void 0);this.Ce=setTimeout((()=>{this.$e&&this.ge.length>0&&this.Dt(),this.Re()}),this.Se)}Dt(){var e=Date.now(),t=[],i=this.ge.filter((n=>n.retryAt<e||(t.push(n),!1)));if(this.ge=t,i.length>0)for(var{requestOptions:s}of i)this.retriableRequest(s)}unload(){for(var{requestOptions:e}of(this.Ce&&(clearTimeout(this.Ce),this.Ce=void 0),this.Ee=!1,_(d)||(this.ke&&(d.removeEventListener("online",this.ke),this.ke=void 0),this.Pe&&(d.removeEventListener("offline",this.Pe),this.Pe=void 0)),this.ge))try{this._instance.ci(b({},e,{transport:"sendBeacon"}))}catch(t){y.error(t)}this.ge=[]}}class So{constructor(e){this.Ie=()=>{var t,i,s,n;this.Fe||(this.Fe={});var a=this.scrollElement(),o=this.scrollY(),l=a?Math.max(0,a.scrollHeight-a.clientHeight):0,c=o+(a?.clientHeight||0),u=a?.scrollHeight||0;this.Fe.lastScrollY=Math.ceil(o),this.Fe.maxScrollY=Math.max(o,(t=this.Fe.maxScrollY)!==null&&t!==void 0?t:0),this.Fe.maxScrollHeight=Math.max(l,(i=this.Fe.maxScrollHeight)!==null&&i!==void 0?i:0),this.Fe.lastContentY=c,this.Fe.maxContentY=Math.max(c,(s=this.Fe.maxContentY)!==null&&s!==void 0?s:0),this.Fe.maxContentHeight=Math.max(u,(n=this.Fe.maxContentHeight)!==null&&n!==void 0?n:0)},this._instance=e}getContext(){return this.Fe}resetContext(){var e=this.Fe;return setTimeout(this.Ie,0),e}startMeasuringScrollPosition(){L(d,"scroll",this.Ie,{capture:!0}),L(d,"scrollend",this.Ie,{capture:!0}),L(d,"resize",this.Ie)}scrollElement(){if(!this._instance.config.scroll_root_selector)return d?.document.documentElement;var e=T(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=d?.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 d&&(d.scrollY||d.pageYOffset||d.document.documentElement.scrollTop)||0}scrollX(){if(this._instance.config.scroll_root_selector){var e=this.scrollElement();return e&&e.scrollLeft||0}return d&&(d.scrollX||d.pageXOffset||d.document.documentElement.scrollLeft)||0}}var Po=r=>sn(r?.config.mask_personal_data_properties,r?.config.custom_personal_data_properties);class es{constructor(e,t,i,s){this.Me=n=>{var a=this.Oe();if(!a||a.sessionId!==n){var o={sessionId:n,props:this.Ae(this._instance)};this.De.register({[Ri]:o})}},this._instance=e,this.je=t,this.De=i,this.Ae=s||Po,this.je.onSessionId(this.Me)}Oe(){return this.De.props[Ri]}getSetOnceProps(){var e,t=(e=this.Oe())==null?void 0:e.props;return t?"r"in t?nn(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 R(zi(this.getSetOnceProps()),((t,i)=>{i==="$current_url"&&(i="url"),e["$session_entry_"+ki(i)]=t})),e}}var wi=N("[SessionId]");class ts{on(e,t){return this.Le.on(e,t)}constructor(e,t,i){var s;if(this.Ne=[],this.Ue=void 0,this.Le=new rr,this.ze=(u,h)=>Math.abs(u-h)>this.sessionTimeoutMs,!e.persistence)throw new Error("SessionIdManager requires a PostHogPersistence instance");if(e.config.cookieless_mode==="always")throw new Error('SessionIdManager cannot be used with cookieless_mode="always"');this.I=e.config,this.De=e.persistence,this.He=void 0,this.Be=void 0,this._sessionStartTimestamp=null,this._sessionActivityTimestamp=null,this.qe=t||Fe,this.We=i||Fe;var n=this.I.persistence_name||this.I.token,a=this.I.session_idle_timeout_seconds||1800;if(this._sessionTimeoutMs=1e3*he(a,60,36e3,wi.createLogger("session_idle_timeout_seconds"),1800),e.register({$configured_session_timeout_ms:this._sessionTimeoutMs}),this.Ge(),this.Ve="ph_"+n+"_window_id",this.Je="ph_"+n+"_primary_window_exists",this.Ke()){var o=j.W(this.Ve),l=j.W(this.Je);o&&!l?this.He=o:j.V(this.Ve),j.G(this.Je,!0)}if((s=this.I.bootstrap)!=null&&s.sessionID)try{var c=(u=>{var h=u.replace(/-/g,"");if(h.length!==32)throw new Error("Not a valid UUID");if(h[12]!=="7")throw new Error("Not a UUIDv7");return parseInt(h.substring(0,12),16)})(this.I.bootstrap.sessionID);this.Ye(this.I.bootstrap.sessionID,new Date().getTime(),c)}catch(u){wi.error("Invalid sessionID in bootstrap",u)}this.Xe()}get sessionTimeoutMs(){return this._sessionTimeoutMs}onSessionId(e){return _(this.Ne)&&(this.Ne=[]),this.Ne.push(e),this.Be&&e(this.Be,this.He),()=>{this.Ne=this.Ne.filter((t=>t!==e))}}Ke(){return this.I.persistence!=="memory"&&!this.De.wi&&j.H()}Qe(e){e!==this.He&&(this.He=e,this.Ke()&&j.G(this.Ve,e))}Ze(){return this.He?this.He:this.Ke()?j.W(this.Ve):null}Ye(e,t,i){e===this.Be&&t===this._sessionActivityTimestamp&&i===this._sessionStartTimestamp||(this._sessionStartTimestamp=i,this._sessionActivityTimestamp=t,this.Be=e,this.De.register({[Ht]:[t,e,i]}))}tr(){var e=this.De.props[Ht];return T(e)&&e.length===2&&e.push(e[0]),e||[0,null,0]}resetSessionId(){this.Ye(null,null,null)}destroy(){clearTimeout(this.ir),this.ir=void 0,this.Ue&&d&&(d.removeEventListener("beforeunload",this.Ue,{capture:!1}),this.Ue=void 0),this.Ne=[]}Xe(){this.Ue=()=>{this.Ke()&&j.V(this.Je)},L(d,"beforeunload",this.Ue,{capture:!1})}checkAndGetSessionAndWindowId(e,t){if(e===void 0&&(e=!1),t===void 0&&(t=null),this.I.cookieless_mode==="always")throw new Error('checkAndGetSessionAndWindowId should not be called with cookieless_mode="always"');var i=t||new Date().getTime(),[s,n,a]=this.tr(),o=this.Ze(),l=fe(a)&&a>0&&Math.abs(i-a)>864e5,c=!1,u=!n,h=!u&&!e&&this.ze(i,s);u||h||l?(n=this.qe(),o=this.We(),wi.info("new session ID generated",{sessionId:n,windowId:o,changeReason:{noSessionId:u,activityTimeout:h,sessionPastMaximumLength:l}}),a=i,c=!0):o||(o=this.We(),c=!0);var p=s===0||!e||l?i:s,f=a===0?new Date().getTime():a;return this.Qe(o),this.Ye(n,p,f),e||this.Ge(),c&&this.Ne.forEach((v=>v(n,o,c?{noSessionId:u,activityTimeout:h,sessionPastMaximumLength:l}:void 0))),{sessionId:n,windowId:o,sessionStartTimestamp:f,changeReason:c?{noSessionId:u,activityTimeout:h,sessionPastMaximumLength:l}:void 0,lastActivityTimestamp:s}}Ge(){clearTimeout(this.ir),this.ir=setTimeout((()=>{var[e]=this.tr();if(this.ze(new Date().getTime(),e)){var t=this.Be;this.resetSessionId(),this.Le.emit("forcedIdleReset",{idleSessionId:t})}}),1.1*this.sessionTimeoutMs)}}var Io=["$set_once","$set"],Ie=N("[SiteApps]");class $o{constructor(e){this._instance=e,this.er=[],this.apps={}}get isEnabled(){return!!this._instance.config.opt_in_site_apps}rr(e,t){if(t){var i=this.globalsForEvent(t);this.er.push(i),this.er.length>1e3&&(this.er=this.er.slice(10))}}get siteAppLoaders(){var e;return(e=x._POSTHOG_REMOTE_CONFIG)==null||(e=e[this._instance.config.token])==null?void 0:e.siteApps}init(){if(this.isEnabled){var e=this._instance.Ui(this.rr.bind(this));this.sr=()=>{e(),this.er=[],this.sr=void 0}}}globalsForEvent(e){var t,i,s,n,a,o,l;if(!e)throw new Error("Event payload is required");var c={},u=this._instance.get_property("$groups")||[],h=this._instance.get_property("$stored_group_properties")||{};for(var[p,f]of Object.entries(h))c[p]={id:u[p],type:p,properties:f};var{$set_once:v,$set:g}=e;return{event:b({},ls(e,Io),{properties:b({},e.properties,g?{$set:b({},(t=(i=e.properties)==null?void 0:i.$set)!==null&&t!==void 0?t:{},g)}:{},v?{$set_once:b({},(s=(n=e.properties)==null?void 0:n.$set_once)!==null&&s!==void 0?s:{},v)}:{}),elements_chain:(a=(o=e.properties)==null?void 0:o.$elements_chain)!==null&&a!==void 0?a:"",distinct_id:(l=e.properties)==null?void 0:l.distinct_id}),person:{properties:this._instance.get_property("$stored_person_properties")},groups:c}}setupSiteApp(e){var t=this.apps[e.id],i=()=>{var o;!t.errored&&this.er.length&&(Ie.info("Processing "+this.er.length+" events for site app with id "+e.id),this.er.forEach((l=>t.processEvent==null?void 0:t.processEvent(l))),t.processedBuffer=!0),Object.values(this.apps).every((l=>l.processedBuffer||l.errored))&&((o=this.sr)==null||o.call(this))},s=!1,n=o=>{t.errored=!o,t.loaded=!0,Ie.info("Site app with id "+e.id+" "+(o?"loaded":"errored")),s&&i()};try{var{processEvent:a}=e.init({posthog:this._instance,callback:o=>{n(o)}});a&&(t.processEvent=a),s=!0}catch(o){Ie.error("Error while initializing PostHog app with config id "+e.id,o),n(!1)}if(s&&t.loaded)try{i()}catch(o){Ie.error("Error while processing buffered events PostHog app with config id "+e.id,o),t.errored=!0}}nr(){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)}ar(e){if(Object.keys(this.apps).length!==0){var t=this.globalsForEvent(e);for(var i of Object.values(this.apps))try{i.processEvent==null||i.processEvent(t)}catch(s){Ie.error("Error while processing event "+e.event+" for site app "+i.id,s)}}}onRemoteConfig(e){var t,i,s,n=this;if((t=this.siteAppLoaders)!=null&&t.length)return this.isEnabled?(this.nr(),void this._instance.on("eventCaptured",(c=>this.ar(c)))):void Ie.error('PostHog site apps are disabled. Enable the "opt_in_site_apps" config to proceed.');if((i=this.sr)==null||i.call(this),(s=e.siteApps)!=null&&s.length)if(this.isEnabled){var a=function(c){var u;x["__$$ph_site_app_"+c]=n._instance,(u=x.__PosthogExtensions__)==null||u.loadSiteApp==null||u.loadSiteApp(n._instance,l,(h=>{if(h)return Ie.error("Error while initializing PostHog app with config id "+c,h)}))};for(var{id:o,url:l}of e.siteApps)a(o)}else Ie.error('PostHog site apps are disabled. Enable the "opt_in_site_apps" config to proceed.')}}var gn=function(r,e){if(!r)return!1;var t=r.userAgent;if(t&&pr(t,e))return!0;try{var i=r?.userAgentData;if(i!=null&&i.brands&&i.brands.some((s=>pr(s?.brand,e))))return!0}catch{}return!!r.webdriver},_t=(function(r){return r.US="us",r.EU="eu",r.CUSTOM="custom",r})({}),is="i.posthog.com";class Fo{constructor(e){this.lr={},this.instance=e}get apiHost(){var e=this.instance.config.api_host.trim().replace(/\/$/,"");return e==="https://app.posthog.com"?"https://us.i.posthog.com":e}get flagsApiHost(){var e=this.instance.config.flags_api_host;return e?e.trim().replace(/\/$/,""):this.apiHost}get uiHost(){var e,t=(e=this.instance.config.ui_host)==null?void 0:e.replace(/\/$/,"");return t||(t=this.apiHost.replace("."+is,".posthog.com")),t==="https://app.posthog.com"?"https://us.posthog.com":t}get region(){return this.lr[this.apiHost]||(/https:\/\/(app|us|us-assets)(\.i)?\.posthog\.com/i.test(this.apiHost)?this.lr[this.apiHost]=_t.US:/https:\/\/(eu|eu-assets)(\.i)?\.posthog\.com/i.test(this.apiHost)?this.lr[this.apiHost]=_t.EU:this.lr[this.apiHost]=_t.CUSTOM),this.lr[this.apiHost]}endpointFor(e,t){if(t===void 0&&(t=""),t&&(t=t[0]==="/"?t:"/"+t),e==="ui")return this.uiHost+t;if(e==="flags")return this.flagsApiHost+t;if(this.region===_t.CUSTOM)return this.apiHost+t;var i=is+t;switch(e){case"assets":return"https://"+this.region+"-assets."+i;case"api":return"https://"+this.region+"."+i}}}var To={icontains:(r,e)=>!!d&&e.href.toLowerCase().indexOf(r.toLowerCase())>-1,not_icontains:(r,e)=>!!d&&e.href.toLowerCase().indexOf(r.toLowerCase())===-1,regex:(r,e)=>!!d&&Zt(e.href,r),not_regex:(r,e)=>!!d&&!Zt(e.href,r),exact:(r,e)=>e.href===r,is_not:(r,e)=>e.href!==r};class B{constructor(e){var t=this;this.getWebExperimentsAndEvaluateDisplayLogic=function(i){i===void 0&&(i=!1),t.getWebExperiments((s=>{B.ur("retrieved web experiments from the server"),t.hr=new Map,s.forEach((n=>{if(n.feature_flag_key){var a;t.hr&&(B.ur("setting flag key ",n.feature_flag_key," to web experiment ",n),(a=t.hr)==null||a.set(n.feature_flag_key,n));var o=t._instance.getFeatureFlag(n.feature_flag_key);U(o)&&n.variants[o]&&t.dr(n.name,o,n.variants[o].transforms)}else if(n.variants)for(var l in n.variants){var c=n.variants[l];B.vr(c)&&t.dr(n.name,l,c.transforms)}}))}),i)},this._instance=e,this._instance.onFeatureFlags((i=>{this.onFeatureFlags(i)}))}onFeatureFlags(e){if(this._is_bot())B.ur("Refusing to render web experiment since the viewer is a likely bot");else if(!this._instance.config.disable_web_experiments){if(F(this.hr))return this.hr=new Map,this.loadIfEnabled(),void this.previewWebExperiment();B.ur("applying feature flags",e),e.forEach((t=>{var i;if(this.hr&&(i=this.hr)!=null&&i.has(t)){var s,n=this._instance.getFeatureFlag(t),a=(s=this.hr)==null?void 0:s.get(t);n&&a!=null&&a.variants[n]&&this.dr(a.name,n,a.variants[n].transforms)}}))}}previewWebExperiment(){var e=B.getWindowLocation();if(e!=null&&e.search){var t=Wt(e?.search,"__experiment_id"),i=Wt(e?.search,"__experiment_variant");t&&i&&(B.ur("previewing web experiments "+t+" && "+i),this.getWebExperiments((s=>{this.cr(parseInt(t),i,s)}),!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.ci({url:this._instance.requestRouter.endpointFor("api","/api/web_experiments/?token="+this._instance.config.token),method:"GET",callback:n=>{if(n.statusCode!==200||!n.json)return e([]);var a=n.json.experiments||[];return e(a)}})}cr(e,t,i){var s=i.filter((n=>n.id===e));s&&s.length>0&&(B.ur("Previewing web experiment ["+s[0].name+"] with variant ["+t+"]"),this.dr(s[0].name,t,s[0].variants[t].transforms))}static vr(e){return!F(e.conditions)&&B.pr(e)&&B.gr(e)}static pr(e){var t;if(F(e.conditions)||F((t=e.conditions)==null?void 0:t.url))return!0;var i,s,n,a=B.getWindowLocation();return!!a&&((i=e.conditions)==null||!i.url||To[(s=(n=e.conditions)==null?void 0:n.urlMatchType)!==null&&s!==void 0?s:"icontains"](e.conditions.url,a))}static getWindowLocation(){return d?.location}static gr(e){var t;if(F(e.conditions)||F((t=e.conditions)==null?void 0:t.utm))return!0;var i=Qs();if(i.utm_source){var s,n,a,o,l,c,u,h,p=(s=e.conditions)==null||(s=s.utm)==null||!s.utm_campaign||((n=e.conditions)==null||(n=n.utm)==null?void 0:n.utm_campaign)==i.utm_campaign,f=(a=e.conditions)==null||(a=a.utm)==null||!a.utm_source||((o=e.conditions)==null||(o=o.utm)==null?void 0:o.utm_source)==i.utm_source,v=(l=e.conditions)==null||(l=l.utm)==null||!l.utm_medium||((c=e.conditions)==null||(c=c.utm)==null?void 0:c.utm_medium)==i.utm_medium,g=(u=e.conditions)==null||(u=u.utm)==null||!u.utm_term||((h=e.conditions)==null||(h=h.utm)==null?void 0:h.utm_term)==i.utm_term;return p&&v&&g&&f}return!1}static ur(e){for(var t=arguments.length,i=new Array(t>1?t-1:0),s=1;s<t;s++)i[s-1]=arguments[s];y.info("[WebExperiments] "+e,i)}dr(e,t,i){this._is_bot()?B.ur("Refusing to render web experiment since the viewer is a likely bot"):t!=="control"?i.forEach((s=>{if(s.selector){var n;B.ur("applying transform of variant "+t+" for experiment "+e+" ",s);var a=(n=document)==null?void 0:n.querySelectorAll(s.selector);a?.forEach((o=>{var l=o;s.html&&(l.innerHTML=s.html),s.css&&l.setAttribute("style",s.css)}))}})):B.ur("Control variants leave the page unmodified.")}_is_bot(){return Q&&this._instance?gn(Q,this._instance.config.custom_blocked_useragents):void 0}}var Co=N("[PostHog ExternalIntegrations]"),Ro={intercom:"intercom-integration",crispChat:"crisp-chat-integration"};class Oo{constructor(e){this._instance=e}it(e,t){var i;(i=x.__PosthogExtensions__)==null||i.loadExternalDependency==null||i.loadExternalDependency(this._instance,e,(s=>{if(s)return Co.error("failed to load script",s);t()}))}startIfEnabledOrStop(){var e=this,t=function(a){var o,l,c;!s||(o=x.__PosthogExtensions__)!=null&&(o=o.integrations)!=null&&o[a]||e.it(Ro[a],(()=>{var u;(u=x.__PosthogExtensions__)==null||(u=u.integrations)==null||(u=u[a])==null||u.start(e._instance)})),!s&&(l=x.__PosthogExtensions__)!=null&&(l=l.integrations)!=null&&l[a]&&((c=x.__PosthogExtensions__)==null||(c=c.integrations)==null||(c=c[a])==null||c.stop())};for(var[i,s]of Object.entries((n=this._instance.config.integrations)!==null&&n!==void 0?n:{})){var n;t(i)}}}var Gi="[SessionRecording]",ct=N(Gi);class rs{get started(){var e;return!((e=this._r)==null||!e.isStarted)}get status(){return this._r?this._r.status:this.mr&&!this.yr?"disabled":"lazy_loading"}constructor(e){if(this._forceAllowLocalhostNetworkCapture=!1,this.mr=!1,this.br=void 0,this._instance=e,!this._instance.sessionManager)throw ct.error("started without valid sessionManager"),new Error(Gi+" started without valid sessionManager. This is a bug.");if(this._instance.config.cookieless_mode==="always")throw new Error(Gi+' cannot be used with cookieless_mode="always"')}get yr(){var e,t=!((e=this._instance.get_property(oi))==null||!e.enabled),i=!this._instance.config.disable_session_recording,s=this._instance.config.disable_session_recording||this._instance.consent.isOptedOut();return d&&t&&i&&!s}startIfEnabledOrStop(e){var t;if(!this.yr||(t=this._r)==null||!t.isStarted){var i=!_(Object.assign)&&!_(Array.from);this.yr&&i?(this.wr(e),ct.info("starting")):this.stopRecording()}}wr(e){var t,i,s;this.yr&&(x!=null&&(t=x.__PosthogExtensions__)!=null&&(t=t.rrweb)!=null&&t.record&&(i=x.__PosthogExtensions__)!=null&&i.initSessionRecording?this.Er(e):(s=x.__PosthogExtensions__)==null||s.loadExternalDependency==null||s.loadExternalDependency(this._instance,this.Sr,(n=>{if(n)return ct.error("could not load recorder",n);this.Er(e)})))}stopRecording(){var e,t;(e=this.br)==null||e.call(this),this.br=void 0,(t=this._r)==null||t.stop()}$r(){var e;(e=this._instance.persistence)==null||e.unregister(ms)}kr(e){if(this._instance.persistence){var t,i,s=this._instance.persistence,n=()=>{var a=e.sessionRecording===!1?void 0:e.sessionRecording,o=a?.sampleRate,l=F(o)?null:parseFloat(o);F(l)&&this.$r();var c=a?.minimumDurationMilliseconds;s.register({[oi]:b({enabled:!!a},a,{networkPayloadCapture:b({capturePerformance:e.capturePerformance},a?.networkPayloadCapture),canvasRecording:{enabled:a?.recordCanvas,fps:a?.canvasFps,quality:a?.canvasQuality},sampleRate:l,minimumDurationMilliseconds:_(c)?null:c,endpoint:a?.endpoint,triggerMatchType:a?.triggerMatchType,masking:a?.masking,urlTriggers:a?.urlTriggers})})};n(),(t=this.br)==null||t.call(this),this.br=(i=this._instance.sessionManager)==null?void 0:i.onSessionId(n)}}onRemoteConfig(e){"sessionRecording"in e?e.sessionRecording!==!1?(this.kr(e),this.mr=!0,this.startIfEnabledOrStop()):this.mr=!0:ct.info("skipping remote config with no sessionRecording",e)}log(e,t){var i;t===void 0&&(t="log"),(i=this._r)!=null&&i.log?this._r.log(e,t):ct.warn("log called before recorder was ready")}get Sr(){var e,t,i=(e=this._instance)==null||(e=e.persistence)==null?void 0:e.get_property(oi);return(i==null||(t=i.scriptConfig)==null?void 0:t.script)||"lazy-recorder"}Er(e){var t,i;if((t=x.__PosthogExtensions__)==null||!t.initSessionRecording)throw Error("Called on script loaded before session recording is available");this._r||(this._r=(i=x.__PosthogExtensions__)==null?void 0:i.initSessionRecording(this._instance),this._r._forceAllowLocalhostNetworkCapture=this._forceAllowLocalhostNetworkCapture),this._r.start(e)}onRRwebEmit(e){var t;(t=this._r)==null||t.onRRwebEmit==null||t.onRRwebEmit(e)}overrideLinkedFlag(){var e,t;this._r||(t=this._instance.persistence)==null||t.register({$replay_override_linked_flag:!0}),(e=this._r)==null||e.overrideLinkedFlag()}overrideSampling(){var e,t;this._r||(t=this._instance.persistence)==null||t.register({$replay_override_sampling:!0}),(e=this._r)==null||e.overrideSampling()}overrideTrigger(e){var t,i;this._r||(i=this._instance.persistence)==null||i.register({[e==="url"?"$replay_override_url_trigger":"$replay_override_event_trigger"]:!0}),(t=this._r)==null||t.overrideTrigger(e)}get sdkDebugProperties(){var e;return((e=this._r)==null?void 0:e.sdkDebugProperties)||{$recording_status:this.status}}tryAddCustomEvent(e,t){var i;return!((i=this._r)==null||!i.tryAddCustomEvent(e,t))}}var yt={},Wi=()=>{},We="posthog",vn=!ao&&z?.indexOf("MSIE")===-1&&z?.indexOf("Mozilla")===-1,ss=r=>{var e;return b({api_host:"https://us.i.posthog.com",flags_api_host:null,ui_host:null,token:"",autocapture:!0,cross_subdomain_cookie:ea(m?.location),persistence:"localStorage+cookie",persistence_name:"",loaded:Wi,save_campaign_params:!0,custom_campaign_params:[],custom_blocked_useragents:[],save_referrer:!0,capture_pageleave:"if_capture_pageview",defaults:r??"unset",__preview_deferred_init_extensions:!1,debug:Y&&U(Y?.search)&&Y.search.indexOf("__posthog_debug=true")!==-1||!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_product_tours:!0,disable_external_dependency_loading:!1,enable_recording_console_log:void 0,secure_cookie:(d==null||(e=d.location)==null?void 0:e.protocol)==="https:",ip:!1,opt_out_capturing_by_default:!1,opt_out_persistence_by_default:!1,opt_out_useragent_filter:!1,opt_out_capturing_persistence_type:"localStorage",consent_persistence_name:null,opt_out_capturing_cookie_prefix:null,opt_in_site_apps:!1,property_denylist:[],respect_dnt:!1,sanitize_properties:null,request_headers:{},request_batching:!0,properties_string_max_length:65535,mask_all_element_attributes:!1,mask_all_text:!1,mask_personal_data_properties:!1,custom_personal_data_properties:[],advanced_disable_flags:!1,advanced_disable_decide:!1,advanced_disable_feature_flags:!1,advanced_disable_feature_flags_on_first_load:!1,advanced_only_evaluate_survey_feature_flags:!1,advanced_enable_surveys:!1,advanced_disable_toolbar_metrics:!1,feature_flag_request_timeout_ms:3e3,surveys_request_timeout_ms:1e4,on_request_error:t=>{var i="Bad HTTP status: "+t.statusCode+" "+t.text;y.error(i)},get_device_id:t=>t,capture_performance:void 0,name:"posthog",bootstrap:{},disable_compression:!1,session_idle_timeout_seconds:1800,person_profiles:"identified_only",before_send:void 0,request_queue_config:{flush_interval_ms:Vi},error_tracking:{},_onCapture:Wi,__preview_eager_load_replay:!1},(t=>({rageclick:!(t&&t>="2025-11-30")||{content_ignorelist:!0},capture_pageview:!(t&&t>="2025-05-24")||"history_change",session_recording:t&&t>="2025-11-30"?{strictMinimumDuration:!0}:{}}))(r))},ns=r=>{var e={};_(r.process_person)||(e.person_profiles=r.process_person),_(r.xhr_headers)||(e.request_headers=r.xhr_headers),_(r.cookie_name)||(e.persistence_name=r.cookie_name),_(r.disable_cookie)||(e.disable_persistence=r.disable_cookie),_(r.store_google)||(e.save_campaign_params=r.store_google),_(r.verbose)||(e.debug=r.verbose);var t=D({},e,r);return T(r.property_blacklist)&&(_(r.property_denylist)?t.property_denylist=r.property_blacklist:T(r.property_denylist)?t.property_denylist=[...r.property_blacklist,...r.property_denylist]:y.error("Invalid value for property_denylist config: "+r.property_denylist)),t};class Mo{constructor(){this.__forceAllowLocalhost=!1}get Pr(){return this.__forceAllowLocalhost}set Pr(e){y.error("WebPerformanceObserver is deprecated and has no impact on network capture. Use `_forceAllowLocalhostNetworkCapture` on `posthog.sessionRecording`"),this.__forceAllowLocalhost=e}}class ii{get decideEndpointWasHit(){var e,t;return(e=(t=this.featureFlags)==null?void 0:t.hasLoadedFlags)!==null&&e!==void 0&&e}get flagsEndpointWasHit(){var e,t;return(e=(t=this.featureFlags)==null?void 0:t.hasLoadedFlags)!==null&&e!==void 0&&e}constructor(){this.webPerformance=new Mo,this.Tr=!1,this.version=_e.LIB_VERSION,this.Rr=new rr,this._calculate_event_properties=this.calculateEventProperties.bind(this),this.config=ss(),this.SentryIntegration=Fa,this.sentryIntegration=e=>(function(t,i){var s=Ds(t,i);return{name:As,processEvent:n=>s(n)}})(this,e),this.__request_queue=[],this.__loaded=!1,this.analyticsDefaultEndpoint="/e/",this.Cr=!1,this.Ir=null,this.Fr=null,this.Mr=null,this.featureFlags=new co(this),this.toolbar=new Ca(this),this.scrollManager=new So(this),this.pageViewManager=new Ka(this),this.surveys=new yo(this),this.productTours=new po(this),this.experiments=new B(this),this.exceptions=new oo(this),this.rateLimiter=new bo(this),this.requestRouter=new Fo(this),this.consent=new xa(this),this.externalIntegrations=new Oo(this),this.people={set:(e,t,i)=>{var s=U(e)?{[e]:t}:e;this.setPersonProperties(s),i?.({})},set_once:(e,t,i)=>{var s=U(e)?{[e]:t}:e;this.setPersonProperties(void 0,s),i?.({})}},this.on("eventCaptured",(e=>y.info('send "'+e?.event+'"',e)))}init(e,t,i){if(i&&i!==We){var s,n=(s=yt[i])!==null&&s!==void 0?s:new ii;return n._init(e,t,i),yt[i]=n,yt[We][i]=n,n}return this._init(e,t,i)}_init(e,t,i){var s;if(t===void 0&&(t={}),_(e)||Si(e))return y.critical("PostHog was initialized without a token. This likely indicates a misconfiguration. Please check the first argument passed to posthog.init()"),this;if(this.__loaded)return console.warn("[PostHog.js]","You have already initialized PostHog! Re-initializing is a no-op"),this;this.__loaded=!0,this.config={},t.debug=this.Or(t.debug),this.Ar=t,this.Dr=[],t.person_profiles&&(this.Fr=t.person_profiles),this.set_config(D({},ss(t.defaults),ns(t),{name:i,token:e})),this.config.on_xhr_error&&y.error("on_xhr_error is deprecated. Use on_request_error instead"),this.compression=t.disable_compression?void 0:be.GZipJS;var n=this.jr();this.persistence=new mi(this.config,n),this.sessionPersistence=this.config.persistence==="sessionStorage"||this.config.persistence==="memory"?this.persistence:new mi(b({},this.config,{persistence:"sessionStorage"}),n);var a=b({},this.persistence.props),o=b({},this.sessionPersistence.props);this.register({$initialization_time:new Date().toISOString()}),this.Lr=new Eo((k=>this.Nr(k)),this.config.request_queue_config),this.Ur=new ko(this),this.__request_queue=[];var l=this.config.cookieless_mode==="always"||this.config.cookieless_mode==="on_reject"&&this.consent.isExplicitlyOptedOut();if(l||(this.sessionManager=new ts(this),this.sessionPropsManager=new es(this,this.sessionManager,this.persistence)),this.config.__preview_deferred_init_extensions?(y.info("Deferring extension initialization to improve startup performance"),setTimeout((()=>{this.zr(l)}),0)):(y.info("Initializing extensions synchronously"),this.zr(l)),_e.DEBUG=_e.DEBUG||this.config.debug,_e.DEBUG&&y.info("Starting in debug mode",{this:this,config:t,thisC:b({},this.config),p:a,s:o}),((s=t.bootstrap)==null?void 0:s.distinctID)!==void 0){var c,u,h=this.config.get_device_id(Fe()),p=(c=t.bootstrap)!=null&&c.isIdentifiedID?h:t.bootstrap.distinctID;this.persistence.set_property(me,(u=t.bootstrap)!=null&&u.isIdentifiedID?"identified":"anonymous"),this.register({distinct_id:t.bootstrap.distinctID,$device_id:p})}if(this.Hr()){var f,v,g=Object.keys(((f=t.bootstrap)==null?void 0:f.featureFlags)||{}).filter((k=>{var $;return!(($=t.bootstrap)==null||($=$.featureFlags)==null||!$[k])})).reduce(((k,$)=>{var P;return k[$]=((P=t.bootstrap)==null||(P=P.featureFlags)==null?void 0:P[$])||!1,k}),{}),E=Object.keys(((v=t.bootstrap)==null?void 0:v.featureFlagPayloads)||{}).filter((k=>g[k])).reduce(((k,$)=>{var P,O;return(P=t.bootstrap)!=null&&(P=P.featureFlagPayloads)!=null&&P[$]&&(k[$]=(O=t.bootstrap)==null||(O=O.featureFlagPayloads)==null?void 0:O[$]),k}),{});this.featureFlags.receivedFeatureFlags({featureFlags:g,featureFlagPayloads:E})}if(l)this.register_once({distinct_id:it,$device_id:null},"");else if(!this.get_distinct_id()){var w=this.config.get_device_id(Fe());this.register_once({distinct_id:w,$device_id:w},""),this.persistence.set_property(me,"anonymous")}return L(d,"onpagehide"in self?"pagehide":"unload",this._handle_unload.bind(this),{passive:!1}),this.toolbar.maybeLoadToolbar(),t.segment?$a(this,(()=>this.Br())):this.Br(),Te(this.config._onCapture)&&this.config._onCapture!==Wi&&(y.warn("onCapture is deprecated. Please use `before_send` instead"),this.on("eventCaptured",(k=>this.config._onCapture(k.event,k)))),this.config.ip&&y.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}zr(e){var t=performance.now();this.historyAutocapture=new Ia(this),this.historyAutocapture.startIfEnabled();var i=[];i.push((()=>{new Oa(this).startIfEnabledOrStop()})),i.push((()=>{var s;this.siteApps=new $o(this),(s=this.siteApps)==null||s.init()})),e||i.push((()=>{this.sessionRecording=new rs(this),this.sessionRecording.startIfEnabledOrStop()})),this.config.disable_scroll_properties||i.push((()=>{this.scrollManager.startMeasuringScrollPosition()})),i.push((()=>{this.autocapture=new ga(this),this.autocapture.startIfEnabled()})),i.push((()=>{this.surveys.loadIfEnabled()})),i.push((()=>{this.productTours.loadIfEnabled()})),i.push((()=>{this.heatmaps=new Xa(this),this.heatmaps.startIfEnabled()})),i.push((()=>{this.webVitalsAutocapture=new Ya(this)})),i.push((()=>{this.exceptionObserver=new Pa(this),this.exceptionObserver.startIfEnabled()})),i.push((()=>{this.deadClicksAutocapture=new Ms(this,Sa),this.deadClicksAutocapture.startIfEnabled()})),i.push((()=>{if(this.qr){var s=this.qr;this.qr=void 0,this.fi(s)}})),this.Wr(i,t)}Wr(e,t){for(;e.length>0;){if(this.config.__preview_deferred_init_extensions&&performance.now()-t>=30&&e.length>0)return void setTimeout((()=>{this.Wr(e,t)}),0);var i=e.shift();if(i)try{i()}catch(n){y.error("Error initializing extension:",n)}}var s=Math.round(performance.now()-t);this.register_for_session({$sdk_debug_extensions_init_method:this.config.__preview_deferred_init_extensions?"deferred":"synchronous",$sdk_debug_extensions_init_time_ms:s}),this.config.__preview_deferred_init_extensions&&y.info("PostHog extensions initialized ("+s+"ms)")}fi(e){var t,i,s,n,a,o,l,c;if(!m||!m.body)return y.info("document not ready yet, trying again in 500 milliseconds..."),void setTimeout((()=>{this.fi(e)}),500);this.config.__preview_deferred_init_extensions&&(this.qr=e),this.compression=void 0,e.supportedCompression&&!this.config.disable_compression&&(this.compression=S(e.supportedCompression,be.GZipJS)?be.GZipJS:S(e.supportedCompression,be.Base64)?be.Base64:void 0),(t=e.analytics)!=null&&t.endpoint&&(this.analyticsDefaultEndpoint=e.analytics.endpoint),this.set_config({person_profiles:this.Fr?this.Fr:"identified_only"}),(i=this.siteApps)==null||i.onRemoteConfig(e),(s=this.sessionRecording)==null||s.onRemoteConfig(e),(n=this.autocapture)==null||n.onRemoteConfig(e),(a=this.heatmaps)==null||a.onRemoteConfig(e),this.surveys.onRemoteConfig(e),this.productTours.onRemoteConfig(e),(o=this.webVitalsAutocapture)==null||o.onRemoteConfig(e),(l=this.exceptionObserver)==null||l.onRemoteConfig(e),this.exceptions.onRemoteConfig(e),(c=this.deadClicksAutocapture)==null||c.onRemoteConfig(e)}Br(){try{this.config.loaded(this)}catch(e){y.critical("`loaded` function failed",e)}this.Gr(),this.config.capture_pageview&&setTimeout((()=>{(this.consent.isOptedIn()||this.config.cookieless_mode==="always")&&this.Vr()}),1),new wo(this).load(),this.featureFlags.flags()}Gr(){var e;this.is_capturing()&&this.config.request_batching&&((e=this.Lr)==null||e.enable())}_dom_loaded(){this.is_capturing()&&Re(this.__request_queue,(e=>this.Nr(e))),this.__request_queue=[],this.Gr()}_handle_unload(){var e,t;this.config.request_batching?(this.Jr()&&this.capture("$pageleave"),(e=this.Lr)==null||e.unload(),(t=this.Ur)==null||t.unload()):this.Jr()&&this.capture("$pageleave",null,{transport:"sendBeacon"})}ci(e){this.__loaded&&(vn?this.__request_queue.push(e):this.rateLimiter.isServerRateLimited(e.batchKey)||(e.transport=e.transport||this.config.api_transport,e.url=Kt(e.url,{ip:this.config.ip?1:0}),e.headers=b({},this.config.request_headers),e.compression=e.compression==="best-available"?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,(t=>{var i,s,n,a=b({},t);a.timeout=a.timeout||6e4,a.url=Kt(a.url,{_:new Date().getTime().toString(),ver:_e.LIB_VERSION,compression:a.compression});var o=(i=a.transport)!==null&&i!==void 0?i:"fetch",l=Dt.filter((u=>!a.disableTransport||!u.transport||!a.disableTransport.includes(u.transport))),c=(s=(n=gs(l,(u=>u.transport===o)))==null?void 0:n.method)!==null&&s!==void 0?s:l[0].method;if(!c)throw new Error("No available transport method");c(a)})(b({},e,{callback:t=>{var i,s;this.rateLimiter.checkForLimiting(t),t.statusCode>=400&&((i=(s=this.config).on_request_error)==null||i.call(s,t)),e.callback==null||e.callback(t)}}))))}Nr(e){this.Ur?this.Ur.retriableRequest(e):this.ci(e)}_execute_array(e){var t,i=[],s=[],n=[];Re(e,(o=>{o&&(t=o[0],T(t)?n.push(o):Te(o)?o.call(this):T(o)&&t==="alias"?i.push(o):T(o)&&t.indexOf("capture")!==-1&&Te(this[t])?n.push(o):s.push(o))}));var a=function(o,l){Re(o,(function(c){if(T(c[0])){var u=l;R(c,(function(h){u=u[h[0]].apply(u,h.slice(1))}))}else this[c[0]].apply(this,c.slice(1))}),l)};a(i,this),a(s,this),a(n,this)}Hr(){var e,t;return((e=this.config.bootstrap)==null?void 0:e.featureFlags)&&Object.keys((t=this.config.bootstrap)==null?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.Lr){if(this.is_capturing())if(!_(e)&&U(e)){var n=!this.config.opt_out_useragent_filter&&this._is_bot();if(!(n&&!this.config.__preview_capture_bot_pageviews)){var a=i!=null&&i.skip_client_rate_limiting?void 0:this.rateLimiter.clientRateLimitContext();if(a==null||!a.isRateLimited){t!=null&&t.$current_url&&!U(t?.$current_url)&&(y.error("Invalid `$current_url` property provided to `posthog.capture`. Input must be a string. Ignoring provided value."),t==null||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 o=new Date,l=i?.timestamp||o,c=Fe(),u={uuid:c,event:e,properties:this.calculateEventProperties(e,t||{},l,c)};e==="$pageview"&&this.config.__preview_capture_bot_pageviews&&n&&(u.event="$bot_pageview",u.properties.$browser_type="bot"),a&&(u.properties.$lib_rate_limit_remaining_tokens=a.remainingTokens),i?.$set&&(u.$set=i?.$set);var h,p=e!=="$groupidentify",f=this.Kr(i?.$set_once,p);if(f&&(u.$set_once=f),(u=Zn(u,i!=null&&i._noTruncate?null:this.config.properties_string_max_length)).timestamp=l,_(i?.timestamp)||(u.properties.$event_time_override_provided=!0,u.properties.$event_time_override_system_time=o),e===Lt.DISMISSED||e===Lt.SENT){var v=t?.[Kr.SURVEY_ID],g=t?.[Kr.SURVEY_ITERATION];h={id:v,current_iteration:g},localStorage.getItem(Zr(h))||localStorage.setItem(Zr(h),"true"),u.$set=b({},u.$set,{[go({id:v,current_iteration:g},e===Lt.SENT?"responded":"dismissed")]:!0})}var E=b({},u.properties.$set,u.$set);if(ze(E)||this.setPersonPropertiesForFlags(E),!F(this.config.before_send)){var w=this.Yr(u);if(!w)return;u=w}this.Rr.emit("eventCaptured",u);var k={method:"POST",url:(s=i?._url)!==null&&s!==void 0?s:this.requestRouter.endpointFor("api",this.analyticsDefaultEndpoint),data:u,compression:"best-available",batchKey:i?._batchKey};return!this.config.request_batching||i&&(i==null||!i._batchKey)||i!=null&&i.send_instantly?this.Nr(k):this.Lr.enqueue(k),u}y.critical("This capture call is ignored due to client rate limiting.")}}else y.error("No event name provided to posthog.capture")}else y.uninitializedWarning("posthog.capture")}Ui(e){return this.on("eventCaptured",(t=>e(t.event,t)))}calculateEventProperties(e,t,i,s,n){if(i=i||new Date,!this.persistence||!this.sessionPersistence)return t;var a=n?void 0:this.persistence.remove_event_timer(e),o=b({},t);if(o.token=this.config.token,o.$config_defaults=this.config.defaults,(this.config.cookieless_mode=="always"||this.config.cookieless_mode=="on_reject"&&this.consent.isExplicitlyOptedOut())&&(o.$cookieless_mode=!0),e==="$snapshot"){var l=b({},this.persistence.properties(),this.sessionPersistence.properties());return o.distinct_id=l.distinct_id,(!U(o.distinct_id)&&!fe(o.distinct_id)||Si(o.distinct_id))&&y.error("Invalid distinct_id for replay event. This indicates a bug in your implementation"),o}var c,u=za(this.config.mask_personal_data_properties,this.config.custom_personal_data_properties);if(this.sessionManager){var{sessionId:h,windowId:p}=this.sessionManager.checkAndGetSessionAndWindowId(n,i.getTime());o.$session_id=h,o.$window_id=p}this.sessionPropsManager&&D(o,this.sessionPropsManager.getSessionProps());try{var f;this.sessionRecording&&D(o,this.sessionRecording.sdkDebugProperties),o.$sdk_debug_retry_queue_size=(f=this.Ur)==null?void 0:f.length}catch(w){o.$sdk_debug_error_capturing_properties=String(w)}if(this.requestRouter.region===_t.CUSTOM&&(o.$lib_custom_api_host=this.config.api_host),c=e!=="$pageview"||n?e!=="$pageleave"||n?this.pageViewManager.doEvent():this.pageViewManager.doPageLeave(i):this.pageViewManager.doPageView(i,s),o=D(o,c),e==="$pageview"&&m&&(o.title=m.title),!_(a)){var v=i.getTime()-a;o.$duration=parseFloat((v/1e3).toFixed(3))}z&&this.config.opt_out_useragent_filter&&(o.$browser_type=this._is_bot()?"bot":"browser"),(o=D({},u,this.persistence.properties(),this.sessionPersistence.properties(),o)).$is_identified=this._isIdentified(),T(this.config.property_denylist)?R(this.config.property_denylist,(function(w){delete o[w]})):y.error("Invalid value for property_denylist config: "+this.config.property_denylist+" or property_blacklist config: "+this.config.property_blacklist);var g=this.config.sanitize_properties;g&&(y.error("sanitize_properties is deprecated. Use before_send instead"),o=g(o,e));var E=this.Xr();return o.$process_person_profile=E,E&&!n&&this.Qr("_calculate_event_properties"),o}Kr(e,t){var i;if(t===void 0&&(t=!0),!this.persistence||!this.Xr()||this.Tr)return e;var s=this.persistence.get_initial_props(),n=(i=this.sessionPropsManager)==null?void 0:i.getSetOnceProps(),a=D({},s,n||{},e||{}),o=this.config.sanitize_properties;return o&&(y.error("sanitize_properties is deprecated. Use before_send instead"),a=o(a,"$set_once")),t&&(this.Tr=!0),ze(a)?void 0:a}register(e,t){var i;(i=this.persistence)==null||i.register(e,t)}register_once(e,t,i){var s;(s=this.persistence)==null||s.register_once(e,t,i)}register_for_session(e){var t;(t=this.sessionPersistence)==null||t.register(e)}unregister(e){var t;(t=this.persistence)==null||t.unregister(e)}unregister_for_session(e){var t;(t=this.sessionPersistence)==null||t.unregister(e)}Zr(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{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 t===void 0&&(t=!1),this.featureFlags.getEarlyAccessFeatures(e,t,i)}on(e,t){return this.Rr.on(e,t)}onFeatureFlags(e){return this.featureFlags.onFeatureFlags(e)}onSurveysLoaded(e){return this.surveys.onSurveysLoaded(e)}onSessionId(e){var t,i;return(t=(i=this.sessionManager)==null?void 0:i.onSessionId(e))!==null&&t!==void 0?t:()=>{}}getSurveys(e,t){t===void 0&&(t=!1),this.surveys.getSurveys(e,t)}getActiveMatchingSurveys(e,t){t===void 0&&(t=!1),this.surveys.getActiveMatchingSurveys(e,t)}renderSurvey(e,t){this.surveys.renderSurvey(e,t)}displaySurvey(e,t){t===void 0&&(t=_o),this.surveys.displaySurvey(e,t)}cancelPendingSurvey(e){this.surveys.cancelPendingSurvey(e)}canRenderSurvey(e){return this.surveys.canRenderSurvey(e)}canRenderSurveyAsync(e,t){return t===void 0&&(t=!1),this.surveys.canRenderSurveyAsync(e,t)}identify(e,t,i){if(!this.__loaded||!this.persistence)return y.uninitializedWarning("posthog.identify");if(fe(e)&&(e=e.toString(),y.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()))y.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!==it){if(this.Qr("posthog.identify")){var s=this.get_distinct_id();if(this.register({$user_id:e}),!this.get_property("$device_id")){var n=s;this.register_once({$had_persisted_distinct_id:!0,$device_id:n},"")}e!==s&&e!==this.get_property(ht)&&(this.unregister(ht),this.register({distinct_id:e}));var a=(this.persistence.get_property(me)||"anonymous")==="anonymous";e!==s&&a?(this.persistence.set_property(me,"identified"),this.setPersonPropertiesForFlags(b({},i||{},t||{}),!1),this.capture("$identify",{distinct_id:e,$anon_distinct_id:s},{$set:t||{},$set_once:i||{}}),this.Mr=Wr(e,t,i),this.featureFlags.setAnonymousDistinctId(s)):(t||i)&&this.setPersonProperties(t,i),e!==s&&(this.reloadFeatureFlags(),this.unregister(jt))}}else y.critical('The string "'+it+'" was set in posthog.identify which indicates an error. This ID is only used as a sentinel value.');else y.error("Unique user id has not been set in posthog.identify")}setPersonProperties(e,t){if((e||t)&&this.Qr("posthog.setPersonProperties")){var i=Wr(this.get_distinct_id(),e,t);this.Mr!==i?(this.setPersonPropertiesForFlags(b({},t||{},e||{})),this.capture("$set",{$set:e||{},$set_once:t||{}}),this.Mr=i):y.info("A duplicate setPersonProperties call was made with the same properties. It has been ignored.")}}group(e,t,i){if(e&&t){var s=this.getGroups();s[e]!==t&&this.resetGroupPropertiesForFlags(e),this.register({$groups:b({},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 y.error("posthog.group requires a group type and group key")}resetGroups(){this.register({$groups:{}}),this.resetGroupPropertiesForFlags(),this.reloadFeatureFlags()}setPersonPropertiesForFlags(e,t){t===void 0&&(t=!0),this.featureFlags.setPersonPropertiesForFlags(e,t)}resetPersonPropertiesForFlags(){this.featureFlags.resetPersonPropertiesForFlags()}setGroupPropertiesForFlags(e,t){t===void 0&&(t=!0),this.Qr("posthog.setGroupPropertiesForFlags")&&this.featureFlags.setGroupPropertiesForFlags(e,t)}resetGroupPropertiesForFlags(e){this.featureFlags.resetGroupPropertiesForFlags(e)}reset(e){var t,i,s,n;if(y.info("reset"),!this.__loaded)return y.uninitializedWarning("posthog.reset");var a=this.get_property("$device_id");if(this.consent.reset(),(t=this.persistence)==null||t.clear(),(i=this.sessionPersistence)==null||i.clear(),this.surveys.reset(),this.featureFlags.reset(),(s=this.persistence)==null||s.set_property(me,"anonymous"),(n=this.sessionManager)==null||n.resetSessionId(),this.Mr=null,this.config.cookieless_mode==="always")this.register_once({distinct_id:it,$device_id:null},"");else{var o=this.config.get_device_id(Fe());this.register_once({distinct_id:o,$device_id:e?o:a},"")}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(e=(t=this.sessionManager)==null?void 0:t.checkAndGetSessionAndWindowId(!0).sessionId)!==null&&e!==void 0?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(e!=null&&e.withTimestamp&&i){var n,a=(n=e.timestampLookBack)!==null&&n!==void 0?n:10;if(!i)return s;s+="?t="+Math.max(Math.floor((new Date().getTime()-i)/1e3)-a,0)}return s}alias(e,t){return e===this.get_property(vs)?(y.critical("Attempting to create alias for existing People user - aborting."),-2):this.Qr("posthog.alias")?(_(t)&&(t=this.get_distinct_id()),e!==t?(this.Zr(ht,e),this.capture("$create_alias",{alias:e,distinct_id:t})):(y.warn("alias matches current distinct_id - skipping api call."),this.identify(e),-1)):void 0}set_config(e){var t=b({},this.config);if(H(e)){var i,s,n,a,o;D(this.config,ns(e));var l=this.jr();(i=this.persistence)==null||i.update_config(this.config,t,l),this.sessionPersistence=this.config.persistence==="sessionStorage"||this.config.persistence==="memory"?this.persistence:new mi(b({},this.config,{persistence:"sessionStorage"}),l);var c=this.Or(this.config.debug);Ce(c)&&(this.config.debug=c),Ce(this.config.debug)&&(this.config.debug?(_e.DEBUG=!0,A.H()&&A.G("ph_debug","true"),y.info("set_config",{config:e,oldConfig:t,newConfig:b({},this.config)})):(_e.DEBUG=!1,A.H()&&A.V("ph_debug"))),(s=this.sessionRecording)==null||s.startIfEnabledOrStop(),(n=this.autocapture)==null||n.startIfEnabled(),(a=this.heatmaps)==null||a.startIfEnabled(),this.surveys.loadIfEnabled(),this.ts(),(o=this.externalIntegrations)==null||o.startIfEnabledOrStop()}}startSessionRecording(e){var t=e===!0,i={sampling:t||!(e==null||!e.sampling),linked_flag:t||!(e==null||!e.linked_flag),url_trigger:t||!(e==null||!e.url_trigger),event_trigger:t||!(e==null||!e.event_trigger)};if(Object.values(i).some(Boolean)){var s,n,a,o,l;(s=this.sessionManager)==null||s.checkAndGetSessionAndWindowId(),i.sampling&&((n=this.sessionRecording)==null||n.overrideSampling()),i.linked_flag&&((a=this.sessionRecording)==null||a.overrideLinkedFlag()),i.url_trigger&&((o=this.sessionRecording)==null||o.overrideTrigger("url")),i.event_trigger&&((l=this.sessionRecording)==null||l.overrideTrigger("event"))}this.set_config({disable_session_recording:!1})}stopSessionRecording(){this.set_config({disable_session_recording:!0})}sessionRecordingStarted(){var e;return!((e=this.sessionRecording)==null||!e.started)}captureException(e,t){var i=new Error("PostHog syntheticException"),s=this.exceptions.buildProperties(e,{handled:!0,syntheticException:i});return this.exceptions.sendExceptionEvent(b({},s,t))}loadToolbar(e){return this.toolbar.loadToolbar(e)}get_property(e){var t;return(t=this.persistence)==null?void 0:t.props[e]}getSessionProperty(e){var t;return(t=this.sessionPersistence)==null?void 0:t.props[e]}toString(){var e,t=(e=this.config.name)!==null&&e!==void 0?e:We;return t!==We&&(t=We+"."+t),t}_isIdentified(){var e,t;return((e=this.persistence)==null?void 0:e.get_property(me))==="identified"||((t=this.sessionPersistence)==null?void 0:t.get_property(me))==="identified"}Xr(){var e,t;return!(this.config.person_profiles==="never"||this.config.person_profiles==="identified_only"&&!this._isIdentified()&&ze(this.getGroups())&&((e=this.persistence)==null||(e=e.props)==null||!e[ht])&&((t=this.persistence)==null||(t=t.props)==null||!t[Bt]))}Jr(){return this.config.capture_pageleave===!0||this.config.capture_pageleave==="if_capture_pageview"&&(this.config.capture_pageview===!0||this.config.capture_pageview==="history_change")}createPersonProfile(){this.Xr()||this.Qr("posthog.createPersonProfile")&&this.setPersonProperties({},{})}Qr(e){return this.config.person_profiles==="never"?(y.error(e+' was called, but process_person is set to "never". This call will be ignored.'),!1):(this.Zr(Bt,!0),!0)}jr(){if(this.config.cookieless_mode==="always")return!0;var e=this.consent.isOptedOut(),t=this.config.opt_out_persistence_by_default||this.config.cookieless_mode==="on_reject";return this.config.disable_persistence||e&&!!t}ts(){var e,t,i,s,n=this.jr();return((e=this.persistence)==null?void 0:e.wi)!==n&&((i=this.persistence)==null||i.set_disabled(n)),((t=this.sessionPersistence)==null?void 0:t.wi)!==n&&((s=this.sessionPersistence)==null||s.set_disabled(n)),n}opt_in_capturing(e){var t;if(this.config.cookieless_mode!=="always"){var i,s;this.config.cookieless_mode==="on_reject"&&this.consent.isExplicitlyOptedOut()&&(this.reset(!0),(i=this.sessionManager)==null||i.destroy(),this.sessionManager=new ts(this),this.persistence&&(this.sessionPropsManager=new es(this,this.sessionManager,this.persistence)),this.sessionRecording=new rs(this),this.sessionRecording.startIfEnabledOrStop()),this.consent.optInOut(!0),this.ts(),this.Gr(),(t=this.sessionRecording)==null||t.startIfEnabledOrStop(),this.config.cookieless_mode=="on_reject"&&this.surveys.loadIfEnabled(),(_(e?.captureEventName)||e!=null&&e.captureEventName)&&this.capture((s=e?.captureEventName)!==null&&s!==void 0?s:"$opt_in",e?.captureProperties,{send_instantly:!0}),this.config.capture_pageview&&this.Vr()}else y.warn('Consent opt in/out is not valid with cookieless_mode="always" and will be ignored')}opt_out_capturing(){var e,t;this.config.cookieless_mode!=="always"?(this.config.cookieless_mode==="on_reject"&&this.consent.isOptedIn()&&this.reset(!0),this.consent.optInOut(!1),this.ts(),this.config.cookieless_mode==="on_reject"&&(this.register({distinct_id:it,$device_id:null}),(e=this.sessionManager)==null||e.destroy(),this.sessionManager=void 0,this.sessionPropsManager=void 0,(t=this.sessionRecording)==null||t.stopRecording(),this.sessionRecording=void 0,this.Vr())):y.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===ye.GRANTED?"granted":e===ye.DENIED?"denied":"pending"}is_capturing(){return this.config.cookieless_mode==="always"||(this.config.cookieless_mode==="on_reject"?this.consent.isExplicitlyOptedOut()||this.consent.isOptedIn():!this.has_opted_out_capturing())}clear_opt_in_out_capturing(){this.consent.reset(),this.ts()}_is_bot(){return Q?gn(Q,this.config.custom_blocked_useragents):void 0}Vr(){m&&(m.visibilityState==="visible"?this.Cr||(this.Cr=!0,this.capture("$pageview",{title:m.title},{send_instantly:!0}),this.Ir&&(m.removeEventListener("visibilitychange",this.Ir),this.Ir=null)):this.Ir||(this.Ir=this.Vr.bind(this),L(m,"visibilitychange",this.Ir)))}debug(e){e===!1?(d?.console.log("You've disabled debug mode."),this.set_config({debug:!1})):(d?.console.log("You're now in debug mode. All calls to PostHog will be logged in your console.\nYou can disable this with `posthog.debug(false)`."),this.set_config({debug:!0}))}O(){var e,t,i,s,n,a,o,l=this.Ar||{};return"advanced_disable_flags"in l?!!l.advanced_disable_flags:this.config.advanced_disable_flags!==!1?!!this.config.advanced_disable_flags:this.config.advanced_disable_decide===!0?(y.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=!1,n=y,a=(t="advanced_disable_flags")in(e=l)&&!_(e[t]),o=i in e&&!_(e[i]),a?e[t]:o?(n&&n.warn("Config field '"+i+"' is deprecated. Please use '"+t+"' instead. The old field will be removed in a future major version."),e[i]):s)}Yr(e){if(F(this.config.before_send))return e;var t=T(this.config.before_send)?this.config.before_send:[this.config.before_send],i=e;for(var s of t){if(i=s(i),F(i)){var n="Event '"+e.event+"' was rejected in beforeSend function";return Sn(e.event)?y.warn(n+". This can cause unexpected behavior."):y.info(n),null}i.properties&&!ze(i.properties)||y.warn("Event '"+e.event+"' has no properties after beforeSend function, this is likely an error.")}return i}getPageViewId(){var e;return(e=this.pageViewManager.Vt)==null?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)})}Or(e){var t=Ce(e)&&!e,i=A.H()&&A.q("ph_debug")==="true";return!t&&(!!i||e)}}(function(r,e){for(var t=0;t<e.length;t++)r.prototype[e[t]]=Kn(r.prototype[e[t]])})(ii,["identify"]);var as,qo={backgroundColor:"#ffffff",textColor:"#1d1f27",buttonColor:"#1d1f27",buttonTextColor:"#ffffff",borderRadius:8,borderColor:"#e5e7eb",whiteLabel:!1},Bo=(as=yt[We]=new ii,(function(){function r(){r.done||(r.done=!0,vn=!1,R(yt,(function(e){e._dom_loaded()})))}m!=null&&m.addEventListener?m.readyState==="complete"?r():L(m,"DOMContentLoaded",r,{capture:!1}):d&&y.error("Browser doesn't support `document.addEventListener` so PostHog couldn't be initialized")})(),as);export{li as COPY_AUTOCAPTURE_EVENT,be as Compression,qo as DEFAULT_PRODUCT_TOUR_APPEARANCE,fn as DisplaySurveyType,ii as PostHog,Lt as SurveyEventName,Kr as SurveyEventProperties,ut as SurveyEventType,Lo as SurveyPosition,Ho as SurveyQuestionBranchingType,Uo as SurveyQuestionType,jo as SurveySchedule,No as SurveyTabPosition,bi as SurveyType,Do as SurveyWidgetType,Bo as default,Bo as posthog,Ao as severityLevels};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{f as e}from"./fs-u42MReIY.js";import{g as r}from"./index-BeJAljgp.js";import{p as a}from"./path-MNZaYwxc.js";const m=r(e),p=r(a);export{p as a,m as r};
|