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