vendor: 24,784 bytes, lines 1-2
1var d=typeof window<"u"?window:void 0,W=typeof globalThis<"u"?globalThis:d;typeof self>"u"&&(W.self=W),typeof File>"u"&&(W.File=function(){});var bs=Array.prototype,gr=bs.forEach,fr=bs.indexOf,te=W==null?void 0:W.navigator,m=W==null?void 0:W.document,B=W==null?void 0:W.location,$i=W==null?void 0:W.fetch,Ii=W!=null&&W.XMLHttpRequest&&"withCredentials"in new W.XMLHttpRequest?W.XMLHttpRequest:void 0,mr=W==null?void 0:W.AbortController,Z=te==null?void 0:te.userAgent,w=d??{},ye={DEBUG:!1,LIB_VERSION:"1.359.1"};function yr(i,e,t,r,s,n,o){try{var a=i[n](o),l=a.value}catch(u){return void t(u)}a.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 o(l){yr(n,r,s,o,a,"next",l)}function a(l){yr(n,r,s,o,a,"throw",l)}o(void 0)})}}function f(){return f=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},f.apply(null,arguments)}function ws(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"],Mn=["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"],br=function(i,e){if(e===void 0&&(e=[]),!i)return!1;var t=i.toLowerCase();return Mn.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(/^\$/,"")},An=Array.isArray,Es=Object.prototype,xs=Es.hasOwnProperty,ni=Es.toString,$=An||function(i){return ni.call(i)==="[object Array]"},xe=i=>typeof i=="function",H=i=>i===Object(i)&&!$(i),Xe=i=>{if(H(i)){for(var e in i)if(xs.call(i,e))return!1;return!0}return!1},b=i=>i===void 0,q=i=>ni.call(i)=="[object String]",Ri=i=>q(i)&&i.trim().length===0,le=i=>i===null,O=i=>b(i)||le(i),ge=i=>ni.call(i)=="[object Number]"&&i==i,Ye=i=>ge(i)&&i>0,Se=i=>ni.call(i)==="[object Boolean]",Ln=i=>i instanceof FormData,Nn=i=>k(Fn,i);function Fi(i){return i===null||typeof i!="object"}function Ht(i,e){return Object.prototype.toString.call(i)==="[object "+e+"]"}function ks(i){return!b(Event)&&function(e,t){try{return e instanceof t}catch{return!1}}(i,Event)}var Dn=[!0,"true",1,"1","yes"],ui=i=>k(Dn,i),Un=[!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),ge(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 jn{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",Vt="iOS",ke="Android",et="Tablet",Ss=ke+" "+et,Ts="iPad",Ps="Apple",Os=Ps+" Watch",Tt="Safari",tt="BlackBerry",$s="Samsung",Is=$s+"Browser",Cs=$s+" Internet",qe="Chrome",qn=qe+" OS",Rs=qe+" "+Vt,tr="Internet Explorer",Fs=tr+" "+ie,ir="Opera",Hn=ir+" Mini",rr="Edge",Ms="Microsoft "+rr,Qe="Firefox",As=Qe+" "+Vt,Pt="Nintendo",Ot="PlayStation",Je="Xbox",Ls=ke+" "+ie,Ns=ie+" "+Tt,gt="Windows",Mi=gt+" Phone",wr="Nokia",Ai="Ouya",Ds="Generic",Vn=Ds+" "+ie.toLowerCase(),Us=Ds+" "+et.toLowerCase(),Li="Konqueror",Y="(\\d+(\\.\\d+)?)",hi=new RegExp("Version/"+Y),Bn=new RegExp(Je,"i"),Wn=new RegExp(Ot+" \\w+","i"),zn=new RegExp(Pt+" \\w+","i"),sr=new RegExp(tt+"|PlayBook|BB10","i"),Gn={"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"},Ft,Er,di,Yn=(i,e)=>e&&k(e,Ps)||function(t){return k(t,Tt)&&!k(t,qe)&&!k(t,ke)}(i),js=function(i,e){return e=e||"",k(i," OPR/")&&k(i,"Mini")?Hn:k(i," OPR/")?ir:sr.test(i)?tt:k(i,"IE"+ie)||k(i,"WPDesktop")?Fs:k(i,Is)?Cs:k(i,rr)||k(i,"Edg/")?Ms:k(i,"FBIOS")?"Facebook "+ie:k(i,"UCWEB")||k(i,"UCBrowser")?"UC Browser":k(i,"CriOS")?Rs:k(i,"CrMo")||k(i,qe)?qe:k(i,ke)&&k(i,Tt)?Ls:k(i,"FxiOS")?As:k(i.toLowerCase(),Li.toLowerCase())?Li:Yn(i,e)?k(i,ie)?Ns:Tt:k(i,Qe)?Qe:k(i,"MSIE")||k(i,"Trident/")?tr:k(i,"Gecko")?Qe:""},Kn={[Fs]:[new RegExp("rv:"+Y)],[Ms]:[new RegExp(rr+"?\\/"+Y)],[qe]:[new RegExp("("+qe+"|CrMo)\\/"+Y)],[Rs]:[new RegExp("CriOS\\/"+Y)],"UC Browser":[new RegExp("(UCBrowser|UCWEB)\\/"+Y)],[Tt]:[hi],[Ns]:[hi],[ir]:[new RegExp("(Opera|OPR)\\/"+Y)],[Qe]:[new RegExp(Qe+"\\/"+Y)],[As]:[new RegExp("FxiOS\\/"+Y)],[Li]:[new RegExp("Konqueror[:/]?"+Y,"i")],[tt]:[new RegExp(tt+" "+Y),hi],[Ls]:[new RegExp("android\\s"+Y,"i")],[Cs]:[new RegExp(Is+"\\/"+Y)],[tr]:[new RegExp("(rv:|MSIE )"+Y)],Mozilla:[new RegExp("rv:"+Y)]},Xn=function(i,e){var t=js(i,e),r=Kn[t];if(b(r))return null;for(var s=0;s<r.length;s++){var n=r[s],o=i.match(n);if(o)return parseFloat(o[o.length-2])}return null},xr=[[new RegExp(Je+"; "+Je+" (.*?)[);]","i"),i=>[Je,i&&i[1]||""]],[new RegExp(Pt,"i"),[Pt,""]],[new RegExp(Ot,"i"),[Ot,""]],[sr,[tt,""]],[new RegExp(gt,"i"),(i,e)=>{if(/Phone/.test(e)||/WPDesktop/.test(e))return[Mi,""];if(new RegExp(ie).test(e)&&!/IEMobile\b/.test(e))return[gt+" "+ie,""];var t=/Windows NT ([0-9.]+)/i.exec(e);if(t&&t[1]){var r=t[1],s=Gn[r]||"";return/arm/i.test(e)&&(s="RT"),[gt,s]}return[gt,""]}],[/((iPhone|iPad|iPod).*?OS (\d+)_(\d+)_?(\d+)?|iPhone)/,i=>{if(i&&i[3]){var e=[i[3],i[4],i[5]||"0"];return[Vt,e.join(".")]}return[Vt,""]}],[/(watch.*\/(\d+\.\d+\.\d+)|watch os,(\d+\.\d+),)/i,i=>{var e="";return i&&i.length>=3&&(e=b(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/,[qn,""]],[/Linux|debian/i,["Linux",""]]],kr=function(i){return zn.test(i)?Pt:Wn.test(i)?Ot:Bn.test(i)?Je:new RegExp(Ai,"i").test(i)?Ai:new RegExp("("+Mi+"|WPDesktop)","i").test(i)?Mi:/iPad/.test(i)?Ts:/iPod/.test(i)?"iPod Touch":/iPhone/.test(i)?"iPhone":/(watch)(?: ?os[,/]|\d,\d\/)[\d.]+/i.test(i)?Os:sr.test(i)?tt:/(kobo)\s(ereader|touch)/i.test(i)?"Kobo":new RegExp(wr,"i").test(i)?wr:/(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:Ss:new RegExp("(pda|"+ie+")","i").test(i)?Vn:new RegExp(et,"i").test(i)&&!new RegExp(et+" pc","i").test(i)?Us:""},Zn=i=>i instanceof Error;function Qn(i){var e=globalThis._posthogChunkIds;if(e){var t=Object.keys(e);return di&&t.length===Er||(Er=t.length,di=t.reduce((r,s)=>{Ft||(Ft={});var n=Ft[s];if(n)r[n[0]]=n[1];else for(var o=i(s),a=o.length-1;a>=0;a--){var l=o[a],u=l==null?void 0:l.filename,c=e[s];if(u&&c){r[u]=c,Ft[s]=[u,c];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),o=this.parseStacktrace(s,n);return{$exception_list:this.convertToExceptionList(o,r),$exception_level:"error"}}modifyFrames(e){var t=this;return be(function*(){for(var r of e)r.stacktrace&&r.stacktrace.frames&&$(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)),f({},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,o={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&&(o.stacktrace={type:"raw",frames:e.stack});var a=[o];return e.cause!=null&&a.push(...this.convertToExceptionList(e.cause,f({},t,{handled:!0}))),a}buildParsingContext(e){var t;return{chunkIdMap:Qn(this.stackParser),skipFirstLines:(t=e.skipFirstLines)!==null&&t!==void 0?t:1}}buildCoercingContext(e,t,r){r===void 0&&(r=0);var s=(n,o)=>{if(o<=4){var a=this.buildCoercingContext(e,t,o);return this.applyCoercers(n,a)}};return f({},t,{syntheticException:r==0?t.syntheticException:void 0,mechanism:e,apply:n=>s(n,r),next:n=>s(n,r+1)})}}var it="?";function Ni(i,e,t,r,s){var n={platform:i,filename:e,function:t==="<anonymous>"?it:t,in_app:!0};return b(r)||(n.lineno=r),b(s)||(n.colno=s),n}var qs=(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]},eo=/^\s*at (\S+?)(?::(\d+))(?::(\d+))\s*$/i,to=/^\s*at (?:(.+?\)(?: \[.+\])?|.*?) ?\((?:address at )?)?(?:async )?((?:<anonymous>|[-a-z]+:|.*bundle|\/)?.*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i,io=/\((\S*)(?::(\d+))(?::(\d+))\)/,ro=(i,e)=>{var t=eo.exec(i);if(t){var[,r,s,n]=t;return Ni(e,r,it,+s,+n)}var o=to.exec(i);if(o){if(o[2]&&o[2].indexOf("eval")===0){var a=io.exec(o[2]);a&&(o[2]=a[1],o[3]=a[2],o[4]=a[3])}var[l,u]=qs(o[1]||it,o[2]);return Ni(e,u,l,o[3]?+o[3]:void 0,o[4]?+o[4]:void 0)}},so=/^\s*(.*?)(?:\((.*?)\))?(?:^|@)?((?:[-a-z]+)?:\/.*?|\[native code\]|[^@]*(?:bundle|\d+\.js)|\/[\w\-. /=]+)(?::(\d+))?(?::(\d+))?\s*$/i,no=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i,oo=(i,e)=>{var t=so.exec(i);if(t){if(t[3]&&t[3].indexOf(" > eval")>-1){var r=no.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]=qs(n,s),Ni(e,s,n,t[4]?+t[4]:void 0,t[5]?+t[5]:void 0)}},Sr=/\(error: (.*)\)/,Tr=50;function ao(){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 o=[],a=s.split(` 2`),l=n;l<a.length;l++){var u=a[l];if(!(u.length>1024)){var c=Sr.test(u)?u.replace(Sr,"$1"):u;if(!c.match(/\S*Error: /)){for(var h of t){var p=h(c,i);if(p){o.push(p);break}}if(o.length>=Tr)break}}}return function(v){if(!v.length)return[];var g=Array.from(v);return g.reverse(),g.slice(0,Tr).map(_=>{return f({},_,{filename:_.filename||(x=g,x[x.length-1]||{}).filename,function:_.function||it});var x})}(o)}}("web:javascript",ro,oo)}class lo{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 co{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 uo{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 ho=/^(?:[Uu]ncaught (?:exception: )?)?(?:((?:Eval|Internal|Range|Reference|Syntax|Type|URI|)Error): )?(.*)$/i;class po{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(ho);return s&&(t=s[1],r=s[2]),[t,r]}}var vo=["fatal","error","warning","log","info","debug"];function Hs(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 _o{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 ks(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: "+Hs(e)}isSeverityLevel(e){return q(e)&&!Ri(e)&&vo.indexOf(e)>=0}getErrorPropertyFromObject(e){for(var t in e)if(Object.prototype.hasOwnProperty.call(e,t)){var r=e[t];if(Zn(r))return r}}getObjectClassName(e){try{var t=Object.getPrototypeOf(e);return t?t.constructor.name:void 0}catch{return}}}class go{match(e){return ks(e)}coerce(e,t){var r,s=e.constructor.name;return{type:s,value:s+" captured as exception with keys: "+Hs(e),stack:(r=t.syntheticException)==null?void 0:r.stack,synthetic:!0}}}class fo{match(e){return Fi(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 mo{match(e){return Ht(e,"PromiseRejectionEvent")}coerce(e,t){var r,s=this.getUnhandledRejectionReason(e);return Fi(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){if(Fi(e))return e;try{if("reason"in e)return e.reason;if("detail"in e&&"reason"in e.detail)return e.detail.reason}catch{}return e}}var Vs=function(i,e){var{debugEnabled:t}=e===void 0?{}:e,r={k:function(s){if(d&&(ye.DEBUG||w.POSTHOG_DEBUG||t)&&!b(d.console)&&d.console){for(var n=("__rrweb_original__"in d.console[s])?d.console[s].__rrweb_original__:d.console[s],o=arguments.length,a=new Array(o>1?o-1:0),l=1;l<o;l++)a[l-1]=arguments[l];n(i,...a)}},info:function(){for(var s=arguments.length,n=new Array(s),o=0;o<s;o++)n[o]=arguments[o];r.k("log",...n)},warn:function(){for(var s=arguments.length,n=new Array(s),o=0;o<s;o++)n[o]=arguments[o];r.k("warn",...n)},error:function(){for(var s=arguments.length,n=new Array(s),o=0;o<s;o++)n[o]=arguments[o];r.k("error",...n)},critical:function(){for(var s=arguments.length,n=new Array(s),o=0;o<s;o++)n[o]=arguments[o];console.error(i,...n)},uninitializedWarning:s=>{r.error("You must initialize PostHog before calling "+s)},createLogger:(s,n)=>Vs(i+" "+s,n)};return r},y=Vs("[PostHog.js]"),D=y.createLogger,yo=D("[ExternalScriptsLoader]"),Pr=(i,e,t)=>{if(i.config.disable_external_dependency_loading)return yo.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[o].src===e){var l=r[o];return l.__posthog_loading_callback_fired?{v:t()}:(l.addEventListener("load",u=>{l.__posthog_loading_callback_fired=!0,t(void 0,u)}),l.onerror=u=>t(u),{v:void 0})}},o=0;o<r.length;o++)if(s=n())return s.v}var a=()=>{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 u,c=m.querySelectorAll("body > script");c.length>0?(u=c[0].parentNode)==null||u.insertBefore(l,c[0]):m.body.appendChild(l)}};m!=null&&m.body?a():m==null||m.addEventListener("DOMContentLoaded",a)};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);Pr(i,n,t)},w.__PosthogExtensions__.loadSiteApp=(i,e,t)=>{var r=i.requestRouter.endpointFor("api",e);Pr(i,r,t)};var Bt={};function Me(i,e,t){if($(i)){if(gr&&i.forEach===gr)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)===Bt)return}}}function M(i,e,t){if(!O(i)){if($(i))return Me(i,e,t);if(Ln(i)){for(var r of i.entries())if(e.call(t,r[1],r[0])===Bt)return}else for(var s in i)if(xs.call(i,s)&&e.call(t,i[s],s)===Bt)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 Me(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 Me(t,function(s){Me(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 Or=function(i){try{return i()}catch{return}},bo=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){y.critical("Implementation error. Please turn on debug mode and open a ticket on https://app.posthog.com/home#panel=support%3Asupport%3A."),y.critical(s)}}},nr=function(i){var e={};return M(i,function(t,r){(q(t)&&t.length>0||ge(t))&&(e[r]=t)}),e};function wo(i,e){return t=i,r=n=>q(n)&&!le(e)?n.slice(0,e):n,s=new Set,function n(o,a){return o!==Object(o)?r?r(o,a):o:s.has(o)?void 0:(s.add(o),$(o)?(l=[],Me(o,u=>{l.push(n(u))})):(l={},M(o,(u,c)=>{s.has(u)||(l[c]=n(u,c))})),l);var l}(t);var t,r,s}var Eo=["herokuapp.com","vercel.app","netlify.app"];function xo(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 Eo)if(t===r)return!1;return!0}function Bs(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 Ws(i){return i.name==="ph_toolbar_internal"}var zs="$people_distinct_id",ft="__alias",mt="__timers",$r="$autocapture_disabled_server_side",Di="$heatmaps_enabled_server_side",Ir="$exception_capture_enabled_server_side",Ui="$error_tracking_suppression_rules",Cr="$error_tracking_capture_extension_exceptions",Rr="$web_vitals_enabled_server_side",Gs="$dead_clicks_enabled_server_side",Fr="$product_tours_enabled_server_side",Mr="$web_vitals_allowed_metrics",Mt="$session_recording_remote_config",Wt="$sesid",Ys="$session_is_sampled",Ze="$enabled_feature_flags",yt="$early_access_features",ji="$feature_flag_details",bt="$stored_person_properties",je="$stored_group_properties",qi="$surveys",zt="$flag_call_reported",Hi="$feature_flag_errors",Gt="$feature_flag_evaluated_at",de="$user_state",Vi="$client_session_props",Bi="$capture_rate_limit",Wi="$initial_campaign_params",zi="$initial_referrer_info",Yt="$initial_person_info",Kt="$epp",Ks="__POSTHOG_TOOLBAR__",ot="$posthog_cookieless",ko=[zs,ft,"__cmpns",mt,"$session_recording_enabled_server_side",Di,Wt,Ze,Ui,de,yt,ji,je,bt,qi,zt,Hi,Gt,Vi,Bi,Wi,zi,Kt,Yt];Math.trunc||(Math.trunc=function(i){return i<0?Math.ceil(i):Math.floor(i)}),Number.isInteger||(Number.isInteger=function(i){return ge(i)&&isFinite(i)&&Math.floor(i)===i});var Ar="0123456789abcdef";class Xt{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 Xt(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 Xt(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 So{constructor(){this.P=0,this.T=0,this.R=new To}generate(){var e=this.generateOrAbort();if(b(e)){this.P=0;var t=this.generateOrAbort();if(b(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 Xt.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 Lr,Xs=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&&!b(d.crypto)&&crypto.getRandomValues&&(Xs=i=>crypto.getRandomValues(i));class To{constructor(){this.C=new Uint32Array(8),this.F=1/0}nextUint32(){return this.F>=this.C.length&&(Xs(this.C),this.F=0),this.C[this.F++]}}var Fe=()=>Po().toString(),Po=()=>(Lr||(Lr=new So)).generate(),at="",Oo=/[a-z0-9][a-z0-9-]+\.[a-z]{2,}$/i;function $o(i,e){if(e){var t=function(s,n){if(n===void 0&&(n=m),at)return at;if(!n||["localhost","127.0.0.1"].includes(s))return"";for(var o=s.split("."),a=Math.min(o.length,8),l="dmn_chk_"+Fe();!at&&a--;){var u=o.slice(a).join("."),c=l+"=1;domain=."+u+";path=/";n.cookie=c+";max-age=3",n.cookie.includes(l)&&(n.cookie=c+";max-age=0",at=u)}return at}(i);if(!t){var r=(s=>{var n=s.match(Oo);return n?n[0]:""})(i);r!==t&&y.info("Warning: cookie subdomain discovery mismatch",r,t),t=r}return t?"; domain=."+t:""}return""}var pe={O:()=>!!m,M:function(i){y.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},L:function(i,e,t,r,s){if(m)try{var n="",o="",a=$o(m.location.hostname,r);if(t){var l=new Date;l.setTime(l.getTime()+24*t*60*60*1e3),n="; expires="+l.toUTCString()}s&&(o="; secure");var u=i+"="+encodeURIComponent(JSON.stringify(e))+n+"; SameSite=Lax; path=/"+a+o;return u.length>3686.4&&y.warn("cookieStore warning: large cookie, len="+u.length),m.cookie=u,u}catch{return}},j:function(i,e){if(m!=null&&m.cookie)try{pe.L(i,"",-1,e)}catch{return}}},pi=null,N={O:function(){if(!le(pi))return pi;var i=!0;if(b(d))i=!1;else try{var e="__mplssupport__";N.L(e,"xyz"),N.A(e)!=='"xyz"'&&(i=!1),N.j(e)}catch{i=!1}return i||y.error("localStorage unsupported; falling back to cookie store"),pi=i,i},M:function(i){y.error("localStorage error: "+i)},A:function(i){try{return d==null?void 0:d.localStorage.getItem(i)}catch(e){N.M(e)}return null},D:function(i){try{return JSON.parse(N.A(i))||{}}catch{}return null},L:function(i,e){try{d==null||d.localStorage.setItem(i,JSON.stringify(e))}catch(t){N.M(t)}},j:function(i){try{d==null||d.localStorage.removeItem(i)}catch(e){N.M(e)}}},Io=["$device_id","distinct_id",Wt,Ys,Kt,Yt,de],At={},Co={O:function(){return!0},M:function(i){y.error("memoryStorage error: "+i)},A:function(i){return At[i]||null},D:function(i){return At[i]||null},L:function(i,e){At[i]=e},j:function(i){delete At[i]}},Ne=null,V={O:function(){if(!le(Ne))return Ne;if(Ne=!0,b(d))Ne=!1;else try{var i="__support__";V.L(i,"xyz"),V.A(i)!=='"xyz"'&&(Ne=!1),V.j(i)}catch{Ne=!1}return Ne},M:function(i){y.error("sessionStorage error: ",i)},A:function(i){try{return d==null?void 0:d.sessionStorage.getItem(i)}catch(e){V.M(e)}return null},D:function(i){try{return JSON.parse(V.A(i))||null}catch{}return null},L:function(i,e){try{d==null||d.sessionStorage.setItem(i,JSON.stringify(e))}catch(t){V.M(t)}},j:function(i){try{d==null||d.sessionStorage.removeItem(i)}catch(e){V.M(e)}}},we=function(i){return i[i.PENDING=-1]="PENDING",i[i.DENIED=0]="DENIED",i[i.GRANTED=1]="GRANTED",i}({});class Ro{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.L(this.q,e?1:0,this.N.cookie_expiration,this.N.cross_subdomain_cookie,this.N.secure_cookie)}reset(){this.B.j(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 ui(e)?we.GRANTED:k(Un,e)?we.DENIED:we.PENDING}get B(){if(!this.V){var e=this.N.opt_out_capturing_persistence_type;this.V=e==="localStorage"?N:pe;var t=e==="localStorage"?pe:N;t.A(this.q)&&(this.V.A(this.q)||this.optInOut(ui(t.A(this.q))),t.j(this.q,this.N.cross_subdomain_cookie))}return this.V}U(){return!!this.N.respect_dnt&&!!Bs([te==null?void 0:te.doNotTrack,te==null?void 0:te.msDoNotTrack,w.doNotTrack],e=>ui(e))}}var Lt=D("[Dead Clicks]"),Fo=()=>!0,Mo=i=>{var e,t=!((e=i.instance.persistence)==null||!e.get_property(Gs)),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({[Gs]: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?Lt.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),Lt.info("starting...")}}else Lt.error("`document` not found. Cannot start.")}stop(){this.W&&(this.W.stop(),this.W=void 0,Lt.info("stopping..."))}}var vi=D("[SegmentIntegration]");function Ao(i,e){var t=i.config.segment;if(!t)return e();(function(r,s){var n=r.config.segment;if(!n)return s();var o=l=>{var u=()=>l.anonymousId()||Fe();r.config.get_device_id=u,l.id()&&(r.register({distinct_id:l.id(),$device_id:u()}),r.persistence.set_property(de,"identified")),s()},a=n.user();"then"in a&&xe(a.then)?a.then(o):o(a)})(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,o)=>
vendor: 5,154 bytes, line 2
2{if(!o)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 a=r.calculateEventProperties(o,n.event.properties);return n.event.properties=Object.assign({},a,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 Zs="posthog-js";function Qs(i,e){var{organization:t,projectId:r,prefix:s,severityAllowList:n=["error"],sendExceptionsToPostHog:o=!0}=e===void 0?{}:e;return a=>{var l,u,c,h,p;if(!(n==="*"||n.includes(a.level))||!i.__loaded)return a;a.tags||(a.tags={});var v=i.requestRouter.endpointFor("ui","/project/"+i.config.token+"/person/"+i.get_distinct_id());a.tags["PostHog Person URL"]=v,i.sessionRecordingStarted()&&(a.tags["PostHog Recording URL"]=i.get_session_replay_url({withTimestamp:!0}));var g,_=((l=a.exception)==null?void 0:l.values)||[],x=_.map(T=>f({},T,{stacktrace:T.stacktrace?f({},T.stacktrace,{type:"raw",frames:(T.stacktrace.frames||[]).map(C=>f({},C,{platform:"web:javascript"}))}):void 0})),S={$exception_message:((u=_[0])==null?void 0:u.value)||a.message,$exception_type:(c=_[0])==null?void 0:c.type,$exception_level:a.level,$exception_list:x,$sentry_event_id:a.event_id,$sentry_exception:a.exception,$sentry_exception_message:((h=_[0])==null?void 0:h.value)||a.message,$sentry_exception_type:(p=_[0])==null?void 0:p.type,$sentry_tags:a.tags};return t&&r&&(S.$sentry_url=(s||"https://sentry.io/organizations/")+t+"/issues/?project="+r+"&query="+a.event_id),o&&((g=i.exceptions)==null||g.sendExceptionEvent(S)),a}}class Lo{constructor(e,t,r,s,n,o){this.name=Zs,this.setupOnce=function(a){a(Qs(e,{organization:t,projectId:r,prefix:s,severityAllowList:n,sendExceptionsToPostHog:o==null||o}))}}}class Dr{constructor(e){this.J=(t,r,s)=>{s&&(s.noSessionId||s.activityTimeout||s.sessionPastMaximumLength)&&(y.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:o,lastScrollY:a,maxScrollY:l,maxContentHeight:u,lastContentY:c,maxContentY:h}=n;if(!(b(o)||b(a)||b(l)||b(u)||b(c)||b(h))){o=Math.ceil(o),a=Math.ceil(a),l=Math.ceil(l),u=Math.ceil(u),c=Math.ceil(c),h=Math.ceil(h);var p=o<=1?1:_e(a/o,0,1,y),v=o<=1?1:_e(l/o,0,1,y),g=u<=1?1:_e(c/u,0,1,y),_=u<=1?1:_e(h/u,0,1,y);s=U(s,{$prev_pageview_last_scroll:a,$prev_pageview_last_scroll_percentage:p,$prev_pageview_max_scroll:l,$prev_pageview_max_scroll_percentage:v,$prev_pageview_last_content:c,$prev_pageview_last_content_percentage:g,$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 Zt=i=>{var e=m==null?void 0:m.createElement("a");return b(e)?null:(e.href=i,e)},No=function(i,e){var t,r;e===void 0&&(e="&");var s=[];return M(i,function(n,o){b(n)||b(o)||o==="undefined"||(t=encodeURIComponent((a=>a instanceof File)(n)?n.name:n.toString()),r=encodeURIComponent(o),s[s.length]=r+"="+t)}),s.join(e)},Qt=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(!$(t)||t.length<2)return"";var o=t[1];try{o=decodeURIComponent(o)}catch{y.error("Skipping decoding for malformed query param: "+o)}return o.replace(/\+/g," ")},$t=function(i,e,t){if(!i||!e||!e.length)return i;for(var r=i.split("#"),s=r[0]||"",n=r[1],o=s.split("?"),a=o[1],l=o[0],u=(a||"").split("&"),c=[],h=0;h<u.length;h++){var p=u[h].split("=");$(p)&&(e.includes(p[0])?c.push(p[0]+"="+t):c.push(u[h]))}var v=l;return a!=null&&(v+="?"+c.join("&")),n!=null&&(v+="#"+n),v},Jt=function(i,e){var t=i.match(new RegExp(e+"=([^&]*)"));return t?t[1]:null},Nt="https?://(.*)",st=["gclid","gclsrc","dclid","gbraid","wbraid","fbclid","msclkid","twclid","li_fat_id","igshid","ttclid","rdt_cid","epik","qclid","sccid","irclid","_kx"],Do=rt(["utm_source","utm_medium","utm_campaign","utm_content","utm_term","gad_source","mc_cid"],st),It="<masked>",Uo=["li_fat_id"];function Js(i,e,t){if(!m)return{};
2var r,s=e?rt([],st,t||[]):[],n=en($t(m.URL,s,It),i),o=(r={},M(Uo,function(a){var l=pe.A(a);r[a]=l||null}),r);return U(o,n)}function en(i,e){var t=Do.concat(e||[]),r={};return M(t,function(s){var n=Qt(i,s);r[s]=n||null}),r}function tn(i){var e=function(n){return n?n.search(Nt+"google.([^/?]*)")===0?"google":n.search(Nt+"bing.com")===0?"bing":n.search(Nt+"yahoo.com")===0?"yahoo":n.search(Nt+"duckduckgo.com")===0?"duckduckgo":null:null}(i),t=e!="yahoo"?"q":"p",r={};if(!le(e)){r.$search_engine=e;var s=m?Qt(m.referrer,t):"";s.length&&(r.ph_keyword=s)}return r}function Ur(){return navigator.language||navigator.userLanguage}function rn(){return(m==null?void 0:m.referrer)||"$direct"}function sn(i,e){var t=i?rt([],st,e||[]):[],r=B==null?void 0:B.href.substring(0,1e3);return{r:rn().substring(0,1e3),u:r?$t(r,t,It):void 0}}function nn(i){var e,{r:t,u:r}=i,s={$referrer:t,$referring_domain:t==null?void 0:t=="$direct"?"$direct":(e=Zt(t))==null?void 0:e.host};if(r){s.$current_url=r;var n=Zt(r);s.$host=n==null?void 0:n.host,s.$pathname=n==null?void 0:n.pathname;var o=en(r);U(s,o)}if(t){var a=tn(t);U(s,a)}return s}function on(){try{return Intl.DateTimeFormat().resolvedOptions().timeZone}catch{return}}function jo(){try{return new Date().getTimezoneOffset()}catch{return}}function qo(i,e){var t,r,s,n;if(!Z)return{};var o,a,l,u,c,h,p,v,g=i?rt([],st,e||[]):[],[_,x]=function(S){for(var T=0;T<xr.length;T++){var[C,E]=xr[T],R=C.exec(S),I=R&&(xe(E)?E(R,S):E);if(I)return I}return["",""]}(Z);return U(nr({$os:_,$os_version:x,$browser:js(Z,navigator.vendor),$device:kr(Z),$device_type:(a=Z,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=kr(a),v===Ts||v===Ss||v==="Kobo"||v==="Kindle Fire"||v===Us?et:v===Pt||v===Je||v===Ot||v===Ai?"Console":v===Os?"Wearable":v?ie:(l==null?void 0:l.userAgentDataPlatform)==="Android"&&((u=l==null?void 0:l.maxTouchPoints)!==null&&u!==void 0?u:0)>0?Math.min((c=l==null?void 0:l.screenWidth)!==null&&c!==void 0?c: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:on(),$timezone_offset:jo()}),{$current_url:$t(B==null?void 0:B.href,g,It),$host:B==null?void 0:B.host,$pathname:B==null?void 0:B.pathname,$raw_user_agent:Z.length>1e3?Z.substring(0,997)+"...":Z,$browser_version:Xn(Z,navigator.vendor),$browser_language:Ur(),$browser_language_prefix:(o=Ur(),typeof o=="string"?o.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 Ho=["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&&y.info("Persistence loaded",e.persistence,f({},this.props)),this.update_config(e,e,t),this.save()}isDisabled(){return!!this.st}rt(e){Ho.indexOf(e.persistence.toLowerCase())===-1&&(y.critical("Unknown persistence type "+e.persistence+"; falling back to localStorage+cookie"),e.persistence="localStorage+cookie");var t=function(s){s===void 0&&(s=[]);var n=[...Io,...s];return f({},N,{D:function(o){try{var a={};try{a=pe.D(o)||{}}catch{}var l=U(a,JSON.parse(N.A(o)||"{}"));return N.L(o,l),l}catch{}return null},L:function(o,a,l,u,c,h){try{N.L(o,a,void 0,void 0,h);var p={};n.forEach(v=>{a[v]&&(p[v]=a[v])}),Object.keys(p).length&&pe.L(o,p,l,u,c,h)}catch(v){N.M(v)}},j:function(o,a){try{d==null||d.localStorage.removeItem(o),pe.j(o,a)}catch(l){N.M(l)}}})}(e.cookie_persisted_properties||[]),r=e.persistence.toLowerCase();return r==="localstorage"&&N.O()?N:r==="localstorage+cookie"&&t.O()?t:r==="sessionstorage"&&V.O()?V:r==="memory"?Co:r==="cookie"?pe:t.O()?t:pe}nt(e){var t=e??this.N.feature_flag_cache_ttl_ms;if(!t||t<=0)return!1;var r=this.props[Gt];return!r||typeof r!="number"||Date.now()-r>t}properties(){var e={};return M(this.props,(t,r)=>{if(r===Ze&&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 a=r,l=!1,(le(o=ko)?l:fr&&o.indexOf===fr?o.indexOf(a)!=-1:(M(o,function(u){if(l||(l=u===a))return Bt}),l))||(e[r]=t);var o,a,l}),e}load(){if(!this.st){var e=this.B.D(this.et);e&&(this.props=U({},e))}}save(){this.st||this.B.L(this.et,this.props,this.ot,this.ut,this.ht,this.N.debug)}remove(){this.B.j(this.et,!1),this.B.j(this.et,!0)}clear(){this.remove(),this.props={}}register_once(e,t,r){if(H(e)){b(t)&&(t="None"),this.ot=b(r)?this.dt:r;var s=!1;if(M(e,(n,o)=>{this.props.hasOwnProperty(o)&&this.props[o]!==t||(this.props[o]=n,s=!0)}),s)return this.save(),!0}return!1}register(e,t){if(H(e)){this.ot=b(t)?this.dt:t;var r=!1;if(M(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);Xe(nr(e))||this.register(e),this.it=!0}}update_search_keyword(){var e;this.register((e=m==null?void 0:m.referrer)?tn(e):{})}update_referrer_info(){var e;this.register_once({$referrer:rn(),$referring_domain:m!=null&&m.referrer&&((e=Zt(m.referrer))==null?void 0:e.host)||"$direct"},void 0)}set_initial_person_info(){this.props[Wi]||this.props[zi]||this.register_once({[Yt]:sn(this.N.mask_personal_data_properties,this.N.custom_personal_data_properties)},void 0)}get_initial_props(){var e={};M([zi,Wi],o=>{var a=this.props[o];
vendor: 4,893 bytes, line 2
2a&&M(a,function(l,u){e["$initial_"+Ci(u)]=l})});var t,r,s=this.props[Yt];if(s){var n=(t=nn(s),r={},M(t,function(o,a){r["$initial_"+Ci(a)]=o}),r);U(e,n)}return e}safe_merge(e){return M(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||!((o,a)=>{if(o.length!==a.length)return!1;var l=[...o].sort(),u=[...a].sort();return l.every((c,h)=>c===u[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 b(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"},il={Button:"button",Tab:"tab",Selector:"selector"},rl={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"},sl={Top:"top",Left:"left",Right:"right",Bottom:"bottom"},gi={Popover:"popover",API:"api",Widget:"widget",ExternalSurvey:"external_survey"},nl={Open:"open",MultipleChoice:"multiple_choice",SingleChoice:"single_choice",Rating:"rating",Link:"link"},ol={NextQuestion:"next_question",End:"end",ResponseBased:"response_based",SpecificQuestion:"specific_question"},al={Once:"once",Recurring:"recurring",Always:"always"},wt={SHOWN:"survey shown",DISMISSED:"survey dismissed",SENT:"survey sent",ABANDONED:"survey abandoned"},fi={SURVEY_ID:"$survey_id",SURVEY_NAME:"$survey_name",SURVEY_RESPONSE:"$survey_response",SURVEY_ITERATION:"$survey_iteration",SURVEY_ITERATION_START_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"},Gi={Popover:"popover",Inline:"inline"},ll={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},Vo=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}({}),jr=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}({}),qr=D("[RateLimiter]");class Bo{constructor(e){this.serverLimits={},this.lastEventRateLimited=!1,this.checkForLimiting=t=>{var r=t.text;
2if(r&&r.length)try{(JSON.parse(r).quota_limited||[]).forEach(s=>{qr.info((s||"events")+" is quota limited."),this.serverLimits[s]=new Date().getTime()+6e4})}catch(s){return void qr.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:o}=this,a=new Date().getTime(),l=(t=(r=this.instance.persistence)==null?void 0:r.get_property(Bi))!==null&&t!==void 0?t:{tokens:n,last:a};l.tokens+=(a-l.last)/1e3*o,l.last=a,l.tokens>n&&(l.tokens=n);var u=l.tokens<1;return u||e||(l.tokens=Math.max(0,l.tokens-1)),!u||this.lastEventRateLimited||e||this.instance.capture("$$client_ingestion_warning",{$$client_ingestion_warning_message:"posthog-js client rate limited. Config is set to "+o+" events per second and "+n+" events burst limit."},{skip_client_rate_limiting:!0}),this.lastEventRateLimited=u,(s=this.instance.persistence)==null||s.set_property(Bi,l),{isRateLimited:u,remainingTokens:l.tokens}}isServerRateLimited(e){var t=this.serverLimits[e||"events"]||!1;return t!==!1&&new Date().getTime()<t}}var ct=D("[RemoteConfig]");class an{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 ct.info("Using preloaded remote config",this.remoteConfig),this.ft(this.remoteConfig),void this._t();if(this._instance.bt())return void ct.warn("Remote config is disabled. Falling back to local config.");this.vt(e=>{if(!e)return ct.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){ct.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){e||ct.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||this._instance.featureFlags.ensureFlagsLoaded())}}var cl=["fatal","error","warning","log","info","debug"],Ee=function(i){return i.GZipJS="gzip-js",i.Base64="base64",i}({}),oe=Uint8Array,Q=Uint16Array,nt=Uint32Array,or=new oe([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 oe([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]),Hr=new oe([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),ln=function(i,e){for(var t=new Q(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]},cn=ln(or,2),Wo=cn[0],Yi=cn[1];Wo[28]=258,Yi[258]=28;for(var Vr=ln(ar,0)[1],un=new Q(32768),L=0;L<32768;++L){var De=(43690&L)>>>1|(21845&L)<<1;De=(61680&(De=(52428&De)>>>2|(13107&De)<<2))>>>4|(3855&De)<<4,un[L]=((65280&De)>>>8|(255&De)<<8)>>>1}var kt=function(i,e,t){for(var r=i.length,s=0,n=new Q(e);s<r;++s)++n[i[s]-1];var o,a=new Q(e);for(s=0;s<e;++s)a[s]=a[s-1]+n[s-1]<<1;for(o=new Q(r),s=0;s<r;++s)o[s]=un[a[i[s]-1]++]>>>15-i[s];return o},He=new oe(288);for(L=0;L<144;++L)He[L]=8;for(L=144;L<256;++L)He[L]=9;for(L=256;L<280;++L)He[L]=7;for(L=280;L<288;++L)He[L]=8;var ei=new oe(32);for(L=0;L<32;++L)ei[L]=5;var zo=kt(He,9),Go=kt(ei,5),hn=function(i){return(i/8>>0)+(7&i&&1)},dn=function(i,e,t){(t==null||t>i.length)&&(t=i.length);var r=new(i instanceof Q?Q:i instanceof nt?nt:oe)(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},ut=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 oe(0),0];if(s==1){var o=new oe(t[0].s+1);return o[t[0].s]=1,[o,1]}t.sort(function(R,I){return R.f-I.f}),t.push({s:-1,f:25001});var a=t[0],l=t[1],u=0,c=1,h=2;for(t[0]={s:-1,f:a.f+l.f,l:a,r:l};c!=s-1;)a=t[t[u].f<t[h].f?u++:h++],l=t[u!=c&&t[u].f<t[h].f?u++:h++],t[c++]={s:-1,f:a.f+l.f,l:a,r:l};var p=n[0].s;for(r=1;r<s;++r)n[r].s>p&&(p=n[r].s);var v=new Q(p+1),g=Ki(t[c-1],v,0);if(g>e){r=0;var _=0,x=g-e,S=1<<x;for(n.sort(function(R,I){return v[I.s]-v[R.s]||R.f-I.f});r<s;++r){var T=n[r].s;if(!(v[T]>e))break;_+=S-(1<<g-v[T]),v[T]=e}for(_>>>=x;_>0;
vendor: 19,125 bytes, lines 2-4
2){var C=n[r].s;v[C]<e?_-=1<<e-v[C]++-1:++r}for(;r>=0&&_;--r){var E=n[r].s;v[E]==e&&(--v[E],++_)}g=e}return[new oe(v),g]},Ki=function(i,e,t){return i.s==-1?Math.max(Ki(i.l,e,t+1),Ki(i.r,e,t+1)):e[i.s]=t},Br=function(i){for(var e=i.length;e&&!i[--e];);for(var t=new Q(++e),r=0,s=i[0],n=1,o=function(l){t[r++]=l},a=1;a<=e;++a)if(i[a]==s&&a!=e)++n;else{if(!s&&n>2){for(;n>138;n-=138)o(32754);n>2&&(o(n>10?n-11<<5|28690:n-3<<5|12305),n=0)}else if(n>3){for(o(s),--n;n>6;n-=6)o(8304);n>2&&(o(n-3<<5|8208),n=0)}for(;n--;)o(s);n=1,s=i[a]}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},Xi=function(i,e,t){var r=t.length,s=hn(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,o,a,l,u,c){me(e,c++,t),++s[256];for(var h=mi(s,15),p=h[0],v=h[1],g=mi(n,15),_=g[0],x=g[1],S=Br(p),T=S[0],C=S[1],E=Br(_),R=E[0],I=E[1],A=new Q(19),P=0;P<T.length;++P)A[31&T[P]]++;for(P=0;P<R.length;++P)A[31&R[P]]++;for(var J=mi(A,7),K=J[0],ae=J[1],re=19;re>4&&!K[Hr[re-1]];--re);var fe,ce,ue,Ve,Te=u+5<<3,Le=ht(s,He)+ht(n,ei)+o,he=ht(s,p)+ht(n,_)+o+14+3*re+ht(A,K)+(2*A[16]+3*A[17]+7*A[18]);if(Te<=Le&&Te<=he)return Xi(e,c,i.subarray(l,l+u));if(me(e,c,1+(he<Le)),c+=2,he<Le){fe=kt(p,v),ce=p,ue=kt(_,x),Ve=_;var Pe=kt(K,ae);for(me(e,c,C-257),me(e,c+5,I-1),me(e,c+10,re-4),c+=14,P=0;P<re;++P)me(e,c+3*P,K[Hr[P]]);c+=3*re;for(var Be=[T,R],G=0;G<2;++G){var se=Be[G];for(P=0;P<se.length;++P){var ee=31&se[P];me(e,c,Pe[ee]),c+=K[ee],ee>15&&(me(e,c,se[P]>>>5&127),c+=se[P]>>>12)}}}else fe=zo,ce=He,ue=Go,Ve=ei;for(P=0;P<a;++P)if(r[P]>255){ee=r[P]>>>18&31,ut(e,c,fe[ee+257]),c+=ce[ee+257],ee>7&&(me(e,c,r[P]>>>23&31),c+=or[ee]);var We=31&r[P];ut(e,c,ue[We]),c+=Ve[We],We>3&&(ut(e,c,r[P]>>>5&8191),c+=ar[We])}else ut(e,c,fe[r[P]]),c+=ce[r[P]];return ut(e,c,fe[256]),c+ce[256]},Yo=new nt([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),Ko=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}(),Xo=function(i,e,t,r,s){return function(n,o,a,l,u,c){var h=n.length,p=new oe(l+h+5*(1+Math.floor(h/7e3))+u),v=p.subarray(l,p.length-u),g=0;if(!o||h<8)for(var _=0;_<=h;_+=65535){var x=_+65535;x<h?g=Xi(v,g,n.subarray(_,x)):(v[_]=c,g=Xi(v,g,n.subarray(_,h)))}else{for(var S=Yo[o-1],T=S>>>13,C=8191&S,E=(1<<a)-1,R=new Q(32768),I=new Q(E+1),A=Math.ceil(a/3),P=2*A,J=function(ci){return(n[ci]^n[ci+1]<<A^n[ci+2]<<P)&E},K=new nt(25e3),ae=new Q(288),re=new Q(32),fe=0,ce=0,ue=(_=0,0),Ve=0,Te=0;_<h;++_){var Le=J(_),he=32767&_,Pe=I[Le];if(R[he]=Pe,I[Le]=he,Ve<=_){var Be=h-_;if((fe>7e3||ue>24576)&&Be>423){g=Wr(n,v,0,K,ae,re,ce,ue,Te,_-Te,g),ue=fe=ce=0,Te=_;for(var G=0;G<286;++G)ae[G]=0;for(G=0;G<30;++G)re[G]=0}var se=2,ee=0,We=C,Oe=he-Pe&32767;if(Be>2&&Le==J(_-Oe))for(var $n=Math.min(T,Be)-1,In=Math.min(32767,_),Cn=Math.min(258,Be);Oe<=In&&--We&&he!=Pe;){if(n[_+se]==n[_+se-Oe]){for(var $e=0;$e<Cn&&n[_+$e]==n[_+$e-Oe];++$e);if($e>se){if(se=$e,ee=Oe,$e>$n)break;var Rn=Math.min(Oe,$e-2),dr=0;for(G=0;G<Rn;++G){var li=_-Oe+G+32768&32767,pr=li-R[li]+32768&32767;pr>dr&&(dr=pr,Pe=li)}}}Oe+=(he=Pe)-(Pe=R[he])+32768&32767}if(ee){K[ue++]=268435456|Yi[se]<<18|Vr[ee];var vr=31&Yi[se],_r=31&Vr[ee];ce+=or[vr]+ar[_r],++ae[257+vr],++re[_r],Ve=_+se,++fe}else K[ue++]=n[_],++ae[n[_]]}}g=Wr(n,v,c,K,ae,re,ce,ue,Te,_-Te,g)}return dn(p,0,l+hn(g)+u)}(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 Zo(i,e){e===void 0&&(e={});var t=function(){var a=4294967295;return{p:function(l){for(var u=a,c=0;c<l.length;++c)u=Ko[255&u^l[c]]^u>>>8;a=u},d:function(){return 4294967295^a}}}(),r=i.length;t.p(i);var s,n=Xo(i,e,10+((s=e).filename&&s.filename.length+1||0),8),o=n.length;return function(a,l){var u=l.filename;if(a[0]=31,a[1]=139,a[2]=8,a[8]=l.level<2?4:l.level==9?2:0,a[9]=3,l.mtime!=0&&yi(a,4,Math.floor(new Date(l.mtime||Date.now())/1e3)),u){a[3]=8;for(var c=0;c<=u.length;++c)a[c+10]=u.charCodeAt(c)}}(n,e),yi(n,o-8,t.d()),yi(n,o-4,r),n}var Qo=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 o=i.charCodeAt(s),a=null;o<128?t++:a=o>127&&o<2048?String.fromCharCode(o>>6|192,63&o|128):String.fromCharCode(o>>12|224,o>>6&63|128,63&o|128),le(a)||(t>e&&(n+=i.substring(e,t)),n+=a,e=t=s+1)}return t>e&&(n+=i.substring(e,i.length)),n},Jo=!!Ii||!!$i,ti=function(i,e,t){var r;t===void 0&&(t=!0);var[s,n]=i.split("?"),o=f({},e),a=(r=n==null?void 0:n.split("&").map(u=>{var c,[h,p]=u.split("="),v=t&&(c=o[h])!==null&&c!==void 0?c:p;return delete o[h],h+"="+v}))!==null&&r!==void 0?r:[],l=No(o);return l&&a.push(l),s+"?"+a.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=Zo(function(a,l){var u=a.length;if(typeof TextEncoder<"u")return new TextEncoder().encode(a);for(var c=new oe(a.length+(a.length>>>1)),h=0,p=function(x){c[h++]=x},v=0;v<u;++v){if(h+5>c.length){var g=new oe(h+8+(u-v<<1));g.set(c),c=g}var _=a.charCodeAt(v);_<128||l?p(_):_<2048?(p(192|_>>>6),p(128|63&_)):_>55295&&_<57344?(p(240|(_=65536+(1047552&_)|1023&a.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 dn(c,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(a){var l,u,c,h,p,v="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",g=0,_=0,x="",S=[];if(!a)return a;a=Qo(a);do l=(p=a.charCodeAt(g++)<<16|a.charCodeAt(g++)<<8|a.charCodeAt(g++))>>18&63,u=p>>12&63,c=p>>6&63,h=63&p,S[_++]=v.charAt(l)+v.charAt(u)+v.charAt(c)+v.charAt(h);while(g<a.length);switch(x=S.join(""),a.length%3){case 1:x=x.slice(0,-2)+"==";break;case 2:x=x.slice(0,-1)+"="}return x}(Et(e)),n=(a=>"data="+encodeURIComponent(typeof a=="string"?a:Et(a)))(s);return{contentType:"application/x-www-form-urlencoded",body:n,estimatedSize:new Blob([n]).size}}var o=Et(e);return{contentType:"application/json",body:o,estimatedSize:new Blob([o]).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:{},o=new Headers;M(i.headers,function(c,h){o.append(h,c)}),r&&o.append("Content-Type",r);var a=i.url,l=null;if(mr){var u=new mr;l={signal:u.signal,timeout:setTimeout(()=>u.abort(),i.timeout)}}$i(a,f({method:(i==null?void 0:i.method)||"GET",headers:o,keepalive:i.method==="POST"&&(n||0)<52428.8,body:s,signal:(t=l)==null?void 0:t.signal},i.fetchOptions)).then(c=>c.text().then(h=>{var p={statusCode:c.status,text:h};if(c.status===200)try{p.json=JSON.parse(h)}catch(v){y.error(v)}i.callback==null||i.callback(p)})).catch(c=>{y.error(c),i.callback==null||i.callback({statusCode:0,error:c})}).finally(()=>l?clearTimeout(l.timeout):null)}}),Ii&&qt.push({transport:"XHR",method:i=>{var e,t=new Ii;t.open(i.method||"GET",i.url,!0);var{contentType:r,body:s}=(e=bi(i))!==null&&e!==void 0?e:{};M(i.headers,function(n,o){t.setRequestHeader(o,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 Zi=3e3;class ea{constructor(e,t){this.wt=!0,this.Et=[],this.xt=_e((t==null?void 0:t.flush_interval_ms)||Zi,250,5e3,y.createLogger("flush interval"),Zi),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(f({},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],o=new Date().getTime();n.data&&$(n.data)&&M(n.data,a=>{a.offset=Math.abs(a.timestamp-o),delete a.timestamp}),e.St(n)};for(var s in t)r()}},this.xt))}Pt(){clearTimeout(this.$t),this.$t=void 0}Tt(){var e={};return M(this.Et,t=>{var r,s=t,n=(s?s.batchKey:null)||s.url;b(e[n])&&(e[n]=f({},s,{data:[]})),(r=e[n].data)==null||r.push(s.data)}),this.Et=[],e}}var ta=["retriesPerformedSoFar"];class ia{constructor(e){this.Rt=!1,this.It=3e3,this.Et=[],this._instance=e,this.Et=[],this.Ct=!0,!b(d)&&"onLine"in d.navigator&&(this.Ct=d.navigator.onLine,this.Ft=()=>{this.Ct=!0,this.Ot()},this.Mt=()=>{this.Ct=!1},j(d,"online",this.Ft),j(d,"offline",this.Mt))}get length(){return this.Et.length}retriableRequest(e){var{retriesPerformedSoFar:t}=e,r=ws(e,ta);Ye(t)&&(r.url=ti(r.url,{retry_count:t})),this._instance._send_request(f({},r,{callback:s=>{s.statusCode!==200&&(s.statusCode<400||s.statusCode>=500)&&(t??0)<10?this.At(f({retriesPerformedSoFar:t},r)):r.callback==null||r.callback(s)}}))}At(e){var t=e.retriesPerformedSoFar||0;e.retriesPerformedSoFar=t+1;var r=function(o){var a=3e3*Math.pow(2,o),l=a/2,u=Math.min(18e5,a),c=(Math.random()-.5)*(u-l);return Math.ceil(u+c)}(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)"),y.warn(n),this.Rt||(this.Rt=!0,this.Dt())}Dt(){if(this.Lt&&clearTimeout(this.Lt),this.Et.length===0)return this.Rt=!1,void(this.Lt=void 0);this.Lt=setTimeout(()=>{this.Ct&&this.Et.length>0&&this.Ot(),this.Dt()},this.It)}Ot(){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.Lt&&(clearTimeout(this.Lt),this.Lt=void 0),this.Rt=!1,b(d)||(this.Ft&&(d.removeEventListener("online",this.Ft),this.Ft=void 0),this.Mt&&(d.removeEventListener("offline",this.Mt),this.Mt=void 0)),this.Et))try{this._instance._send_request(f({},e,{transport:"sendBeacon"}))}catch(t){y.error(t)}this.Et=[]}}class ra{constructor(e){this.jt=()=>{var t,r,s,n;this.Nt||(this.Nt={});var o=this.scrollElement(),a=this.scrollY(),l=o?Math.max(0,o.scrollHeight-o.clientHeight):0,u=a+((o==null?void 0:o.clientHeight)||0),c=(o==null?void 0:o.scrollHeight)||0;this.Nt.lastScrollY=Math.ceil(a),this.Nt.maxScrollY=Math.max(a,(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=u,this.Nt.maxContentY=Math.max(u,(s=this.Nt.maxContentY)!==null&&s!==void 0?s:0),this.Nt.maxContentHeight=Math.max(c,(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.jt,0),e}startMeasuringScrollPosition(){j(d,"scroll",this.jt,{capture:!0}),j(d,"scrollend",this.jt,{capture:!0}),j(d,"resize",this.jt)}scrollElement(){if(!this._instance.config.scroll_root_selector)return d==null?void 0:d.document.documentElement;var e=$(this._instance.config.scroll_root_selector)?this._instance.config.scroll_root_selector:[this._instance.config.scroll_root_selector];for(var t of e){var 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 sa=i=>sn(i==null?void 0:i.config.mask_personal_data_properties,i==null?void 0:i.config.custom_personal_data_properties);class zr{constructor(e,t,r,s){this.Ut=n=>{var o=this.zt();if(!o||o.sessionId!==n){var a={sessionId:n,props:this.Ht(this._instance)};this.Bt.register({[Vi]:a})}},this._instance=e,this.qt=t,this.Bt=r,this.Ht=s||sa,this.qt.onSessionId(this.Ut)}zt(){return this.Bt.props[Vi]}getSetOnceProps(){var e,t=(e=this.zt())==null?void 0:e.props;return t?"r"in t?nn(t):{$referring_domain:t.referringDomain,$pathname:t.initialPathName,utm_source:t.utm_source,utm_campaign:t.utm_campaign,utm_medium:t.utm_medium,utm_content:t.utm_content,utm_term:t.utm_term}:{}}getSessionProps(){var e={};return M(nr(this.getSetOnceProps()),(t,r)=>{r==="$current_url"&&(r="url"),e["$session_entry_"+Ci(r)]=t}),e}}class lr{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 lr,this.Jt=(c,h)=>!(!Ye(c)||!Ye(h))&&Math.abs(c-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||Fe,this.Zt=r||Fe;var n=this.N.persistence_name||this.N.token,o=this.N.session_idle_timeout_seconds||1800;if(this._sessionTimeoutMs=1e3*_e(o,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 a=V.D(this.ii),l=V.D(this.ei);a&&!l?this.Kt=a:V.j(this.ii),V.L(this.ei,!0)}if((s=this.N.bootstrap)!=null&&s.sessionID)try{var u=(c=>{var h=c.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(),u)}catch(c){wi.error("Invalid sessionID in bootstrap",c)}this.ni()}get sessionTimeoutMs(){return this._sessionTimeoutMs}onSessionId(e){return b(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&&V.O()}oi(e){e!==this.Kt&&(this.Kt=e,this.ri()&&V.L(this.ii,e))}ai(){return this.Kt?this.Kt:this.ri()?V.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({[Wt]:[t,e,r]}))}li(){var e=this.Bt.props[Wt];return $(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()&&V.j(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,o]=this.li(),a=this.ai(),l=Ye(o)&&Math.abs(r-o)>864e5,u=!1,c=!n,h=!c&&!e&&this.Jt(r,s);c||h||l?(n=this.Qt(),a=this.Zt(),wi.info("new session ID generated",{sessionId:n,windowId:a,changeReason:{noSessionId:c,activityTimeout:h,sessionPastMaximumLength:l}}),o=r,u=!0):a||(a=this.Zt(),u=!0);var p=Ye(s)&&e&&!l?s:r,v=Ye(o)?o:new Date().getTime();return this.oi(a),this.si(n,p,v),e||this.ti(),u&&this.Gt.forEach(g=>g(n,a,u?{noSessionId:c,activityTimeout:h,sessionPastMaximumLength:l}:void 0)),{sessionId:n,windowId:a,sessionStartTimestamp:v,changeReason:u?{noSessionId:c,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 pn=function(i,e){if(!i)return!1;var t=i.userAgent;if(t&&br(t,e))return!0;try{var r=i==null?void 0:i.userAgentData;if(r!=null&&r.brands&&r.brands.some(s=>br(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 Yr(i,e,t){return Et({distinct_id:i,userPropertiesToSet:e,userPropertiesToSetOnce:t})}var vn={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 _n(i,e){return!i||Object.entries(i).every(t=>{var[r,s]=t,n=e==null?void 0:e[r];if(b(n)||le(n))return!1;var o=[String(n)],a=vn[s.operator];return!!a&&a(s.values,o)})}var xt=function(i){return i.US="us",i.EU="eu",i.CUSTOM="custom",i}({}),Kr="i.posthog.com";class na{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("."+Kr,".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=Kr+t;switch(e){case"assets":return"https://"+this.region+"-assets."+r;case"api":return"https://"+this.region+"."+r}}}var F=D("[Surveys]"),gn="seenSurvey_",oa=(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})(gn,i),aa=[gi.Popover,gi.Widget,gi.API],la={ignoreConditions:!1,ignoreDelay:!1,displayType:Gi.Popover}
4,ca=D("[PostHog ExternalIntegrations]"),ua={intercom:"intercom-integration",crispChat:"crisp-chat-integration"};class ha{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 ca.error("failed to load script",s);t()})}startIfEnabledOrStop(){var e=this,t=function(o){var a,l,u;!s||(a=w.__PosthogExtensions__)!=null&&(a=a.integrations)!=null&&a[o]||e.G(ua[o],()=>{var c;(c=w.__PosthogExtensions__)==null||(c=c.integrations)==null||(c=c[o])==null||c.start(e._instance)}),!s&&(l=w.__PosthogExtensions__)!=null&&(l=l.integrations)!=null&&l[o]&&((u=w.__PosthogExtensions__)==null||(u=u.integrations)==null||(u=u[o])==null||u.stop())};for(var[r,s]of Object.entries((n=this._instance.config.integrations)!==null&&n!==void 0?n:{})){var n;t(r)}}}var da=()=>{},Ei=()=>({}),Zr={$anon_distinct_id:void 0,di:!1,featureFlagEventHandlers:[],hasLoadedFlags:!1,getFlags:()=>[],getFlagsWithDetails:Ei,getFlagVariants:Ei,getFlagPayloads:Ei,onFeatureFlags:()=>()=>{},vi:()=>({flags:[],flagVariants:{}})},pa=typeof Proxy<"u"?new Proxy(Zr,{get:(i,e)=>(y.error("[PostHog] Feature flags is not yet loaded or not included in this bundle"),e in i?i[e]:da)}):Zr,St={},xi=0,Qi=()=>{},Ke="posthog",fn=!Jo&&(Z==null?void 0:Z.indexOf("MSIE"))===-1&&(Z==null?void 0:Z.indexOf("Mozilla"))===-1,Qr=i=>{var e;return f({api_host:"https://us.i.posthog.com",flags_api_host:null,ui_host:null,token:"",autocapture:!0,cross_subdomain_cookie:xo(m==null?void 0:m.location),persistence:"localStorage+cookie",persistence_name:"",cookie_persisted_properties:[],loaded:Qi,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:B&&q(B==null?void 0:B.search)&&B.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;y.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:Zi},error_tracking:{},_onCapture:Qi,__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={};b(i.process_person)||(e.person_profiles=i.process_person),b(i.xhr_headers)||(e.request_headers=i.xhr_headers),b(i.cookie_name)||(e.persistence_name=i.cookie_name),b(i.disable_cookie)||(e.disable_persistence=i.disable_cookie),b(i.store_google)||(e.save_campaign_params=i.store_google),b(i.verbose)||(e.debug=i.verbose);var t=U({},e,i);return $(i.property_blacklist)&&(b(i.property_denylist)?t.property_denylist=i.property_blacklist:$(i.property_denylist)?t.property_denylist=[...i.property_blacklist,...i.property_denylist]:y.error("Invalid value for property_denylist config: "+i.property_denylist)),t};class va{constructor(){this.__forceAllowLocalhost=!1}get ci(){return this.__forceAllowLocalhost}set ci(e){y.error("WebPerformanceObserver is deprecated and has no impact on network capture. Use `_forceAllowLocalhostNetworkCapture` on `posthog.sessionRecording`"),this.__forceAllowLocalhost=e}}class ve{fi(e,t){if(e){var r=this.pi.indexOf(e);r!==-1&&this.pi.splice(r,1)}return this.pi.push(t),t.initialize==null||t.initialize(),t}get featureFlags(){var e;return(e=this.gi)!==null&&e!==void 0?e:pa}get decideEndpointWasHit(){var e,t;return(e=(t=this.gi)==null?void 0:t.hasLoadedFlags)!==null&&e!==void 0&&e}get flagsEndpointWasHit(){var e,t;return(e=(t=this.gi)==null?void 0:t.hasLoadedFlags)!==null&&e!==void 0&&e}constructor(){var e;this.webPerformance=new va,this.mi=!1,this.version=ye.LIB_VERSION,this.bi=new lr,this.pi=[],this._calculate_event_properties=this.calculateEventProperties.bind(this),this.config=Qr(),this.SentryIntegration=Lo,this.sentryIntegration=r=>function(s,n){var o=Qs(s,n);return{name:Zs,processEvent:a=>o(a)}}(this,r),this.__request_queue=[],this.__loaded=!1,this.analyticsDefaultEndpoint="/e/",this.yi=!1,this.wi=null,this.Ei=null,this.xi=null,this.scrollManager=new ra(this),this.pageViewM
4anager=new Dr(this),this.rateLimiter=new Bo(this),this.requestRouter=new na(this),this.consent=new Ro(this),this.externalIntegrations=new ha(this);var t=(e=ve.__defaultExtensionClasses)!==null&&e!==void 0?e:{};this.gi=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 o=q(r)?{[r]:s}:r;this.setPersonProperties(o),n==null||n({})},set_once:(r,s,n)=>{var o=q(r)?{[r]:s}:r;this.setPersonProperties(void 0,o),n==null||n({})}},this.on("eventCaptured",r=>y.info('send "'+(r==null?void 0:r.event)+'"',r))}init(e,t,r){if(r&&r!==Ke){var s,n=(s=St[r])!==null&&s!==void 0?s:new ve;return n._init(e,t,r),St[r]=n,St[Ke][r]=n,n}return this._init(e,t,r)}_init(e,t,r){var s;if(t===void 0&&(t={}),b(e)||Ri(e))return y.critical("PostHog was initialized without a token. This likely indicates a misconfiguration. Please check the first argument passed to posthog.init()"),this;if(this.__loaded)return console.warn("[PostHog.js]","You have already initialized PostHog! Re-initializing is a no-op"),this;this.__loaded=!0,this.config={},t.debug=this.Si(t.debug),this.$i=t,this.ki=[],t.person_profiles?this.Ei=t.person_profiles:t.process_person&&(this.Ei=t.process_person),this.set_config(U({},Qr(t.defaults),Jr(t),{name:r,token:e})),this.config.on_xhr_error&&y.error("on_xhr_error is deprecated. Use on_request_error instead"),this.compression=t.disable_compression?void 0:Ee.GZipJS;var n=this.Pi();this.persistence=new _i(this.config,n),this.sessionPersistence=this.config.persistence==="sessionStorage"||this.config.persistence==="memory"?this.persistence:new _i(f({},this.config,{persistence:"sessionStorage"}),n);var o=f({},this.persistence.props),a=f({},this.sessionPersistence.props);this.register({$initialization_time:new Date().toISOString()}),this.Ti=new ea(g=>this.Ri(g),this.config.request_queue_config),this.Ii=new ia(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?(y.info("Deferring extension initialization to improve startup performance"),setTimeout(()=>{this.Ci(l)},0)):(y.info("Initializing extensions synchronously"),this.Ci(l)),ye.DEBUG=ye.DEBUG||this.config.debug,ye.DEBUG&&y.info("Starting in debug mode",{this:this,config:t,thisC:f({},this.config),p:o,s:a}),((s=t.bootstrap)==null?void 0:s.distinctID)!==void 0){var u,c,h=this.config.get_device_id(Fe()),p=(u=t.bootstrap)!=null&&u.isIdentifiedID?h:t.bootstrap.distinctID;this.persistence.set_property(de,(c=t.bootstrap)!=null&&c.isIdentifiedID?"identified":"anonymous"),this.register({distinct_id:t.bootstrap.distinctID,$device_id:p})}if(l)this.register_once({distinct_id:ot,$device_id:null},"");else if(!this.get_distinct_id()){var v=this.config.get_device_id(Fe());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?Ao(this,()=>this.Fi()):this.Fi(),xe(this.config._onCapture)&&this.config._onCapture!==Qi&&(y.warn("onCapture is deprecated. Please use `before_send` instead"),this.on("eventCaptured",g=>this.config._onCapture(g.event,g))),this.config.ip&&y.warn('The `ip` config option has NO EFFECT AT ALL and has been deprecated. Use a custom transformation or "Discard IP data" project setting instead. See https://posthog.com/tutorials/web-redact-properties#hiding-customer-ip-address for more information.'),this}Ci(e){var t,r,s,n,o,a,l,u=performance.now(),c=f({},ve.__defaultExtensionClasses,this.config.__extensionClasses),h=[];c.featureFlags&&this.pi.push(this.gi=(t=this.gi)!==null&&t!==void 0?t:new c.featureFlags(this)),c.exceptions&&this.pi.push(this.exceptions=(r=this.exceptions)!==null&&r!==void 0?r:new c.exceptions(this)),c.historyAutocapture&&this.pi.push(this.historyAutocapture=new c.historyAutocapture(this)),c.tracingHeaders&&this.pi.push(new c.tracingHeaders(this)),c.siteApps&&this.pi.push(this.siteApps=new c.siteApps(this)),c.sessionRecording&&!e&&this.pi.push(this.sessionRecording=new c.sessionRecording(this)),this.config.disable_scroll_properties||h.push(()=>{this.scrollManager.startMeasuringScrollPosition()}),c.autocapture&&this.pi.push(this.autocapture=new c.autocapture(this)),c.surveys&&this.pi.push(this.surveys=(s=this.surveys)!==null&&s!==void 0?s:new c.surveys(this)),c.logs&&this.pi.push(this.logs=(n=this.logs)!==null&&n!==void 0?n:new c.logs(this)),c.conversations&&this.pi.push(this.conversations=(o=this.conversations)!==null&&o!==void 0?o:new c.conversations(this)),c.productTours&&this.pi.push(this.productTours=new c.productTours(this)),c.heatmaps&&this.pi.push(this.heatmaps=new c.heatmaps(this)),c.webVitalsAutocapture&&this.pi.push(this.webVitalsAutocapture=new c.webVitalsAutocapture(this)),c.exceptionObserver&&this.pi.push(this.exceptionObserver=new c.exceptionObserver(this)),c.deadClicksAutocapture&&this.pi.push(this.deadClicksAutocapture=new c.deadClicksAutocapture(this,Mo)),c.toolbar&&this.pi.push(this.toolbar=(a=this.toolbar)!==null&&a!==void 0?a:new c.toolbar(this)),c.experiments&&this.pi.push(this.experiments=(l=this.experiments)!==null&&l!==void 0?l:new c.experiments(this)),this.pi.forEach(p=>{p.initialize&&h.push(()=>{p.initialize==null||p.initialize()})}),h.push(()=>
4{if(this.Oi){var p=this.Oi;this.Oi=void 0,this.ft(p)}}),this.Mi(h,u)}Mi(e,t){for(;e.length>0;){if(this.config.__preview_deferred_init_extensions&&performance.now()-t>=30&&e.length>0)return void setTimeout(()=>{this.Mi(e,t)},0);var r=e.shift();if(r)try{r()}catch(n){y.error("Error initializing extension:",n)}}var s=Math.round(performance.now()-t);this.register_for_session({$sdk_debug_extensions_init_method:this.config.__preview_deferred_init_extensions?"deferred":"synchronous",$sdk_debug_extensions_init_time_ms:s}),this.config.__preview_deferred_init_extensions&&y.info("PostHog extensions initialized ("+s+"ms)")}ft(e){var t;if(!m||!m.body)return y.info("document not ready yet, trying again in 500 milliseconds..."),void setTimeout(()=>{this.ft(e)},500);this.config.__preview_deferred_init_extensions&&(this.Oi=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.Ei?this.Ei:"identified_only"}),this.pi.forEach(r=>r.onRemoteConfig==null?void 0:r.onRemoteConfig(e))}Fi(){try{this.config.loaded(this)}catch(r){y.critical("`loaded` function failed",r)}if(this.Ai(),this.config.internal_or_test_user_hostname&&B!=null&&B.hostname){var e=B.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.Di()},1),this.Li=new an(this),this.Li.load()}Ai(){var e;this.is_capturing()&&this.config.request_batching&&((e=this.Ti)==null||e.enable())}_dom_loaded(){this.is_capturing()&&Me(this.__request_queue,e=>this.Ri(e)),this.__request_queue=[],this.Ai()}_handle_unload(){var e,t,r;(e=this.surveys)==null||e.handlePageUnload(),this.config.request_batching?(this.ji()&&this.capture("$pageleave"),(t=this.Ti)==null||t.unload(),(r=this.Ii)==null||r.unload()):this.ji()&&this.capture("$pageleave",null,{transport:"sendBeacon"})}_send_request(e){this.__loaded&&(fn?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=f({},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,o=f({},t);o.timeout=o.timeout||6e4,o.url=ti(o.url,{_:new Date().getTime().toString(),ver:ye.LIB_VERSION,compression:o.compression});var a=(r=o.transport)!==null&&r!==void 0?r:"fetch",l=qt.filter(c=>!o.disableTransport||!c.transport||!o.disableTransport.includes(c.transport)),u=(s=(n=Bs(l,c=>c.transport===a))==null?void 0:n.method)!==null&&s!==void 0?s:l[0].method;if(!u)throw new Error("No available transport method");u(o)})(f({},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)}}))))}Ri(e){this.Ii?this.Ii.retriableRequest(e):this._send_request(e)}_execute_array(e){xi++;try{var t,r=[],s=[],n=[];Me(e,a=>{a&&(t=a[0],$(t)?n.push(a):xe(a)?a.call(this):$(a)&&t==="alias"?r.push(a):$(a)&&t.indexOf("capture")!==-1&&xe(this[t])?n.push(a):s.push(a))});var o=function(a,l){Me(a,function(u){if($(u[0])){var c=l;M(u,function(h){c=c[h[0]].apply(c,h.slice(1))})}else this[u[0]].apply(this,u.slice(1))},l)};o(r,this),o(s,this),o(n,this)}finally{xi--}}push(e){if(xi>0&&$(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.Ti){if(this.is_capturing())if(!b(e)&&q(e)){var n=!this.config.opt_out_useragent_filter&&this._is_bot();if(!(n&&!this.config.__preview_capture_bot_pageviews)){var o=r!=null&&r.skip_client_rate_limiting?void 0:this.rateLimiter.clientRateLimitContext();if(o==null||!o.isRateLimited){t!=null&&t.$current_url&&!q(t==null?void 0:t.$current_url)&&(y.error("Invalid `$current_url` property provided to `posthog.capture`. Input must be a string. Ignoring provided value."),t==null||delete t.$current_url),e!=="$exception"||r!=null&&r.Ni||y.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 a=new Date,l=(r==null?void 0:r.timestamp)||a,u=Fe(),c={uuid:u,event:e,properties:this.calculateEventProperties(e,t||{},l,u)};e==="$pageview"&&this.config.__preview_capture_bot_pageviews&&n&&(c.event="$bot_pageview",c.properties.$browser_type="bot"),o&&(c.properties.$lib_rate_limit_remaining_tokens=o.remainingTokens),r!=null&&r.$set&&(c.$set=r==null?void 0:r.$set);var h,p=e!=="$groupidentify",v=this.Ui(r==null?void 0:r.$set_once,p);if(v&&(c.$set_once=v),(c=wo(c,r!=null&&r._noTruncate?null:this.config.properties_string_max_length)).timestamp=l,b(r==null?void 0:r.timestamp)||(c.properties.$event_time_override_provided=!0,c.properties.$event_time_override_system_time=a),e===wt.DISMISSED||e===wt.SENT){var g=t==null?void 0:t[fi.SURVEY_ID],_=t==null?void 0:t[fi.SURVEY_ITERATION];h={id:g,current_iteration:_},localStorage.getItem(Xr(h))||localStorage.setItem(Xr(h),"true"),c.$set=f({},c.$set,{[oa({id:g,current_iteration:_},e===wt.SENT?"responded":"dismissed")]:!0})}else e===wt.SHOWN&&(c.$set=f({},c.$set,{[fi.SURVEY_LAST_SEEN_DATE]:new Date().toISOString()}));if(e===Vo.SHOWN){var x=t==null?void 0:t[jr.TOUR_TYPE];x&&(c.$set=f({},c.$set,{[jr.TOUR_LAST_SEEN_DATE+"/"+x]:new Date().toISOString()}))}var S=f({},c.properties.$set,c.$set);if(Xe(S)||this.setPersonPropertiesForFlags(S),!O(this.config.before_send)){var T=this.zi(c);if(!T)return;c=T}this.bi.emit("eventCaptured",c);var C={method:"POST",url:(s=r==null?void 0:r._url)!==null&&s!==void 0?s:this.requestRouter.endpointFor("api",this.analyticsDefaultEndpoint),data:c,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.Ri(C):this.Ti.enqueue(C),c}y.critical("This capture call is ignored due to client rate limiting.")}}else y.error("No event name provided to posthog.capture")}else y.uninitializedWarning("posthog.capture")}_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 o=n?void 0:this.persistence.remove_event_timer(e),a=f({},t);if(a.token=this.config.token,a.$config_defaults=this.config.defaults,(this.config.cookieless_mode=="always"||this.config.cookieless_mode=="on_reject"&&this.consent.isExplicitlyOptedOut())&&(a.$cookieless_mode=!0),e==="$snapshot"){var l=f({},this.persistence.properties(),this.sessionPersistence.properties());return a.distinct_id=l.distinct_id,(!q(a.distinct_id)&&!ge(a.distinct_id)||Ri(a.distinct_id))&&y.error("Invalid distinct_id for replay event. This indicates a bug in your implementation"),a}var u,c=qo(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());a.$session_id=h,a.$window_id=p}this.sessionPropsManager&&U(a,this.sessionPropsManager.getSessionProps());try{var v;this.sessionRecording&&U(a,this.sessionRecording.sdkDebugProperties),a.$sdk_debug_retry_queue_size=(v=this.Ii)==null?void 0:v.length}catch(S){a.$sdk_debug_error_capturing_properties=String(S)}if(this.requestRouter.region===xt.CUSTOM&&(a.$lib_custom_api_host=this.config.api_host),u=e!=="$pageview"||n?e!=="$pageleave"||n?this.pageViewM
4anager.doEvent():this.pageViewManager.doPageLeave(r):this.pageViewManager.doPageView(r,s),a=U(a,u),e==="$pageview"&&m&&(a.title=m.title),!b(o)){var g=r.getTime()-o;a.$duration=parseFloat((g/1e3).toFixed(3))}Z&&this.config.opt_out_useragent_filter&&(a.$browser_type=this._is_bot()?"bot":"browser"),(a=U({},c,this.persistence.properties(),this.sessionPersistence.properties(),a)).$is_identified=this._isIdentified(),$(this.config.property_denylist)?M(this.config.property_denylist,function(S){delete a[S]}):y.error("Invalid value for property_denylist config: "+this.config.property_denylist+" or property_blacklist config: "+this.config.property_blacklist);var _=this.config.sanitize_properties;_&&(y.error("sanitize_properties is deprecated. Use before_send instead"),a=_(a,e));var x=this.Hi();return a.$process_person_profile=x,x&&!n&&this.Bi("_calculate_event_properties"),a}Ui(e,t){var r;if(t===void 0&&(t=!0),!this.persistence||!this.Hi()||this.mi)return e;var s=this.persistence.get_initial_props(),n=(r=this.sessionPropsManager)==null?void 0:r.getSetOnceProps(),o=U({},s,n||{},e||{}),a=this.config.sanitize_properties;return a&&(y.error("sanitize_properties is deprecated. Use before_send instead"),o=a(o,"$set_once")),t&&(this.mi=!0),Xe(o)?void 0:o}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)}qi(e,t){this.register({[e]:t})}getFeatureFlag(e,t){var r;return(r=this.gi)==null?void 0:r.getFeatureFlag(e,t)}getFeatureFlagPayload(e){var t;return(t=this.gi)==null?void 0:t.getFeatureFlagPayload(e)}getFeatureFlagResult(e,t){var r;return(r=this.gi)==null?void 0:r.getFeatureFlagResult(e,t)}isFeatureEnabled(e,t){var r;return(r=this.gi)==null?void 0:r.isFeatureEnabled(e,t)}reloadFeatureFlags(){var e;(e=this.gi)==null||e.reloadFeatureFlags()}updateFlags(e,t,r){var s;(s=this.gi)==null||s.updateFlags(e,t,r)}updateEarlyAccessFeatureEnrollment(e,t,r){var s;(s=this.gi)==null||s.updateEarlyAccessFeatureEnrollment(e,t,r)}getEarlyAccessFeatures(e,t,r){var s;return t===void 0&&(t=!1),(s=this.gi)==null?void 0:s.getEarlyAccessFeatures(e,t,r)}on(e,t){return this.bi.on(e,t)}onFeatureFlags(e){return this.gi?this.gi.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=la),(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 y.uninitializedWarning("posthog.identify");if(ge(e)&&(e=e.toString(),y.warn("The first argument to posthog.identify was a number, but it should be a string. It has been converted to a string.")),e)if(["distinct_id","distinctid"].includes(e.toLowerCase()))y.critical('The string "'+e+'" was set in posthog.identify which indicates an error. This ID should be unique to the user and n
4ot a hardcoded string.');else if(e!==ot){if(this.Bi("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(ft)&&(this.unregister(ft),this.register({distinct_id:e}));var o,a=(this.persistence.get_property(de)||"anonymous")==="anonymous";e!==s&&a?(this.persistence.set_property(de,"identified"),this.setPersonPropertiesForFlags(f({},r||{},t||{}),!1),this.capture("$identify",{distinct_id:e,$anon_distinct_id:s},{$set:t||{},$set_once:r||{}}),this.xi=Yr(e,t,r),(o=this.gi)==null||o.setAnonymousDistinctId(s)):(t||r)&&this.setPersonProperties(t,r),e!==s&&(this.reloadFeatureFlags(),this.unregister(zt))}}else y.critical('The string "'+ot+'" was set in posthog.identify which indicates an error. This ID is only used as a sentinel value.');else y.error("Unique user id has not been set in posthog.identify")}setPersonProperties(e,t){if((e||t)&&this.Bi("posthog.setPersonProperties")){var r=Yr(this.get_distinct_id(),e,t);this.xi!==r?(this.setPersonPropertiesForFlags(f({},t||{},e||{})),this.capture("$set",{$set:e||{},$set_once:t||{}}),this.xi=r):y.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:f({},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 y.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.gi)==null||r.setPersonPropertiesForFlags(e,t)}resetPersonPropertiesForFlags(){var e;(e=this.gi)==null||e.resetPersonPropertiesForFlags()}setGroupPropertiesForFlags(e,t){var r;t===void 0&&(t=!0),this.Bi("posthog.setGroupPropertiesForFlags")&&((r=this.gi)==null||r.setGroupPropertiesForFlags(e,t))}resetGroupPropertiesForFlags(e){var t;(t=this.gi)==null||t.resetGroupPropertiesForFlags(e)}reset(e){var t,r,s,n,o,a,l;if(y.info("reset"),!this.__loaded)return y.uninitializedWarning("posthog.reset");var u=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.Li)==null||n.stop(),(o=this.gi)==null||o.reset(),(a=this.persistence)==null||a.set_property(de,"anonymous"),(l=this.sessionManager)==null||l.resetSessionId(),this.xi=null,this.config.cookieless_mode==="always")this.register_once({distinct_id:ot,$device_id:null},"");else{var c=this.config.get_device_id(Fe());this.register_once({distinct_id:c,$device_id:e?c:u},"")}this.register({$last_posthog_reset:new Date().toISOString()},1)}get_distinct_id(){return this.get_property("distinct_id")}getGroups(){return this.get_property("$groups")||{}}get_session_id(){var e,t;return(e=(t=this.sessionManager)==null?void 0:t.checkAndGetSessionAndWindowId(!0).sessionId)!==null&&e!==void 0?e:""}get_session_replay_url(e){if(!this.sessionManager)return"";var{sessionId:t,sessionStartTimestamp:r}=this.sessionManager.checkAndGetSessionAndWindowId(!0),s=this.requestRouter.endpointFor("ui","/project/"+this.config.token+"/replay/"+t);if(e!=null&&e.withTimestamp&&r){var n,o=(n=e.timestampLookBack)!==null&&n!==void 0?n:10;if(!r)return s;s+="?t="+Math.max(Math.floor((new Date().getTime()-r)/1e3)-o,0)}return s}alias(e,t){return e===this.get_property(zs)?(y.critical("Attempting to create alias for existing People user - aborting."),-2):this.Bi("posthog.alias")?(b(t)&&(t=this.get_distinct_id()),e!==t?(this.qi(ft,e),this.capture("$create_alias",{alias:e,distinct_id:t})):(y.warn("alias matches current distinct_id - skipping api call."),this.identify(e),-1)):void 0}set_config(e){var t=f({},this.config);if(H(e)){var r,s,n,o,a,l,u,c,h;U(this.config,Jr(e));var p=this.Pi();(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(f({},this.config,{persistence:"sessionStorage"}),p);var v=this.Si(this.config.debug);Se(v)&&(this.config.debug=v),Se(this.config.debug)&&(this.config.debug?(ye.DEBUG=!0,N.O()&&N.L("p
4h_debug","true"),y.info("set_config",{config:e,oldConfig:t,newConfig:f({},this.config)})):(ye.DEBUG=!1,N.O()&&N.j("ph_debug"))),(s=this.exceptionObserver)==null||s.onConfigChange(),(n=this.sessionRecording)==null||n.startIfEnabledOrStop(),(o=this.autocapture)==null||o.startIfEnabled(),(a=this.heatmaps)==null||a.startIfEnabled(),(l=this.exceptionObserver)==null||l.startIfEnabledOrStop(),(u=this.deadClicksAutocapture)==null||u.startIfEnabledOrStop(),(c=this.surveys)==null||c.loadIfEnabled(),this.Vi(),(h=this.externalIntegrations)==null||h.startIfEnabledOrStop()}}startSessionRecording(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,o,a,l;(s=this.sessionManager)==null||s.checkAndGetSessionAndWindowId(),r.sampling&&((n=this.sessionRecording)==null||n.overrideSampling()),r.linked_flag&&((o=this.sessionRecording)==null||o.overrideLinkedFlag()),r.url_trigger&&((a=this.sessionRecording)==null||a.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(f({},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:Ke;return t!==Ke&&(t=Ke+"."+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"}Hi(){var e,t;return!(this.config.person_profiles==="never"||this.config.person_profiles==="identified_only"&&!this._isIdentified()&&Xe(this.getGroups())&&((e=this.persistence)==null||(e=e.props)==null||!e[ft])&&((t=this.persistence)==null||(t=t.props)==null||!t[Kt]))}ji(){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.Hi()||this.Bi("posthog.createPersonProfile")&&this.setPersonProperties({},{})}setInternalOrTestUser(){this.Bi("posthog.setInternalOrTestUser")&&this.setPersonProperties({$internal_or_test_user:!0})}Bi(e){return this.config.person_profiles==="never"?(y.error(e+' was called, but process_person is set to "never". This call will be ignored.'),!1):(this.qi(Kt,!0),!0)}Pi(){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}Vi(){var e,t,r,s,n=this.Pi();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,o,a;this.reset(!0),(r=this.sessionManager)==null||r.destroy(),(s=this.pageViewManager)==null||s.destroy(),this.sessionManager=new Gr(this),this.pageViewManager=new Dr(this),this.persistence&&(this.sessionPropsManager=new zr(this,this.sessionManager,this.persistence));var l=(n=(o=this.config.__extensionClasses)==null?void 0:o.sessionRecording)!==null&&n!==void 0?n:(a=ve.__defaultExtensionClasses)==null?void 0:a.sessionRecording;l&&(this.sessionRecording=this.fi(this.sessionRecording,new l(this)))}var u,c;this.consent.optInOut(!0),this.Vi(),this.Ai(),(t=this.sessionRecording)==null||t.startIfEnabledOrStop(),this.config.cookieless_mode=="on_reject"&&((u=this.surveys)==null||u.loadIfEnabled()),(b(e==null?void 0:e.captureEventName)||e!=null&&e.captureEventName)&&this.capture((c=e==null?void 0:e.captureEventName)!==null&&c!==void 0?c:"$opt_in",e==null?void 0:e.captureProperties,{send_instantly:!0}),this.config.capture_pageview&&this.Di()}
vendor: 11,302 bytes, line 4
4else y.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.Vi(),this.config.cookieless_mode==="on_reject"&&(this.register({distinct_id:ot,$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.Di())):y.warn('Consent opt in/out is not valid with cookieless_mode="always" and will be ignored')}has_opted_in_capturing(){return this.consent.isOptedIn()}has_opted_out_capturing(){return this.consent.isOptedOut()}get_explicit_consent_status(){var e=this.consent.consent;return e===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.Vi()}_is_bot(){return te?pn(te,this.config.custom_blocked_useragents):void 0}Di(){m&&(m.visibilityState==="visible"?this.yi||(this.yi=!0,this.capture("$pageview",{title:m.title},{send_instantly:!0}),this.wi&&(m.removeEventListener("visibilitychange",this.wi),this.wi=null)):this.wi||(this.wi=this.Di.bind(this),j(m,"visibilitychange",this.wi)))}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,o,a,l=this.$i||{};return"advanced_disable_flags"in l?!!l.advanced_disable_flags:this.config.advanced_disable_flags!==!1?!!this.config.advanced_disable_flags:this.config.advanced_disable_decide===!0?(y.warn("Config field 'advanced_disable_decide' is deprecated. Please use 'advanced_disable_flags' instead. The old field will be removed in a future major version."),!0):(r="advanced_disable_decide",s=!1,n=y,o=(t="advanced_disable_flags")in(e=l)&&!O(e[t]),a=r in e&&!O(e[r]),o?e[t]:a?(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)}zi(e){if(O(this.config.before_send))return e;var t=$(this.config.before_send)?this.config.before_send:[this.config.before_send],r=e;for(var s of t){if(r=s(r),O(r)){var n="Event '"+e.event+"' was rejected in beforeSend function";return Nn(e.event)?y.warn(n+". This can cause unexpected behavior."):y.info(n),null}r.properties&&!Xe(r.properties)||y.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)})}Si(e){var t=Se(e)&&!e,r=N.O()&&N.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]]=bo(i.prototype[e[t]])}(ve,["identify"]);function es(i){return i instanceof Element&&(i.id===Ks||!(i.closest==null||!i.closest(".toolbar-global-fade-container")))}function oi(i){return!!i&&i.nodeType===1}function Ae(i,e){return!!i&&!!i.tagName&&i.tagName.toLowerCase()===e.toLowerCase()}function mn(i){return!!i&&i.nodeType===3}function yn(i){return!!i&&i.nodeType===11}function cr(i){return i?si(i).split(/\s+/):[]}function ts(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 cr(e)}function bn(i){return O(i)?null:si(i).split(/(\s+)/).filter(e=>Ct(e)).join("").replace(/[\r\n]/g," ").replace(/[ ]+/g," ").substring(0,255)}function Rt(i){var e="";return Ji(i)&&!kn(i)&&i.childNodes&&i.childNodes.length&&M(i.childNodes,function(t){var r;mn(t)&&t.textContent&&(e+=(r=bn(t.textContent))!==null&&r!==void 0?r:"")}),si(e)}function is(i){return b(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 wn(i,e){if(b(e))return!0;var t,r=function(n){if(e.some(o=>n.matches(o)))return{v:!0}};for(var s of i)if(t=r(s))return t.v;return!1}function En(i){var e=i.parentNode;return!(!e||!oi(e))&&e}var _a=["next","previous","prev",">","<"],rs=10,ss=[".ph-no-rageclick",".ph-no-capture"];function ga(i,e){if(!d||hr(i))return!1;var t,r,s;if(Se(e)?(t=!!e&&ss,r=void 0):(t=(s=e==null?void 0:e.css_selector_ignorelist)!==null&&s!==void 0?s:ss,r=e==null?void 0:e.content_ignorelist),t===!1)return!1;var{targetElementList:n}=xn(i,!1);return!function(o,a){if(o===!1||b(o))return!1;var l;if(o===!0)l=_a;else{if(!$(o))return!1;if(o.length>rs)return y.error("[PostHog] content_ignorelist array cannot exceed "+rs+" items. Use css_selector_ignorelist for more complex matching."),!1;l=o.map(u=>u.toLowerCase())}return a.some(u=>{var{safeText:c,ariaLabel:h}=u;return l.some(p=>c.includes(p)||h.includes(p))})}(r,n.map(o=>{var a;return{safeText:Rt(o).toLowerCase(),ariaLabel:((a=o.getAttribute("aria-label"))==null?void 0:a.toLowerCase().trim())||""}}))&&!wn(n,t)}var hr=i=>!i||Ae(i,"html")||!oi(i),xn=(i,e)=>{if(!d||hr(i))return{parentIsUsefulElement:!1,targetElementList:[]};for(var t=!1,r=[i],s=i;s.parentNode&&!Ae(s,"body");)if(yn(s.parentNode))r.push(s.parentNode.host),s=s.parentNode.host;else{var n=En(s);if(!n)break;if(e||ur.indexOf(n.tagName.toLowerCase())>-1)t=!0;else{var o=d.getComputedStyle(n);o&&o.getPropertyValue("cursor")==="pointer"&&(t=!0)}r.push(n),s=n}return{parentIsUsefulElement:t,targetElementList:r}};function fa(i,e,t,r,s){var n,o,a,l;if(t===void 0&&(t=void 0),!d||hr(i)||(n=t)!=null&&n.url_allowlist&&!ts(t.url_allowlist)||(o=t)!=null&&o.url_ignorelist&&ts(t.url_ignorelist))return!1;if((a=t)!=null&&a.dom_event_allowlist){var u=t.dom_event_allowlist;if(u&&!u.some(g=>e.type===g))return!1}var{parentIsUsefulElement:c,targetElementList:h}=xn(i,r);if(!function(g,_){var x=_==null?void 0:_.element_allowlist;if(b(x))return!0;var S,T=function(E){if(x.some(R=>E.tagName.toLowerCase()===R))return{v:!0}};for(var C of g)if(S=T(C))return S.v;return!1}(h,t)||!wn(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 c?(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&&!Ae(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 kn(i){return!!(Ae(i,"input")&&!["button","checkbox","submit","reset"].includes(i.type)||Ae(i,"select")||Ae(i,"textarea")||i.getAttribute("contenteditable")==="true")}var Sn="(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})",ma=new RegExp("^(?:"+Sn+")$"),ya=new RegExp(Sn),Tn="\\d{3}-?\\d{2}-?\\d{4}",ba=new RegExp("^("+Tn+")$"),wa=new RegExp("("+Tn+")");function Ct(i,e){return e===void 0&&(e=!0),!(O(i)||q(i)&&(i=si(i),(e?ma:ya).test((i||"").replace(/[- ]/g,""))||(e?ba:wa).test(i)))}function Pn(i){var e=Rt(i);return Ct(e=(e+" "+On(i)).trim())?e:""}function On(i){var e="";return i&&i.childNodes&&i.childNodes.length&&M(i.childNodes,function(t){var r;if(t&&((r=t.tagName)==null?void 0:r.toLowerCase())==="span")try{var s=Rt(t);e=(e+" "+s).trim(),t.childNodes&&t.childNodes.length&&(e=(e+" "+On(t)).trim())}catch(n){y.error("[AutoCapture]",n)}}),e}function Ea(i){return function(e){var t=e.map(r=>{var s,n,o="";if(r.tag_name&&(o+=r.tag_name),r.attr_class)for(var a of(r.attr_class.sort(),r.attr_class))o+="."+a.replace(/"/g,"");var l=f({},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),u={};return jt(l).sort((c,h)=>{var[p]=c,[v]=h;return p.localeCompare(v)}).forEach(c=>{var[h,p]=c;return u[ns(h.toString())]=ns(p.toString())}),o+=":",o+=jt(u).map(c=>{var[h,p]=c;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:xa(t),attr_id:t.attr__id,nth_child:t.nth_child,nth_of_type:t.nth_of_type,attributes:{}};return jt(t).filter(o=>{var[a]=o;return a.indexOf("attr__")===0}).forEach(o=>{var[a,l]=o;return n.attributes[a]=l}),n})}(i))}function ns(i){return i.replace(/"|\\"/g,'\\"')}function xa(i){var e=i.attr__class;return e?$(e)?e:cr(e):void 0}class os{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 ki="$copy_autocapture",as=D("[AutoCapture]");function Si(i,e){return e.length>i?e.slice(0,i)+"...":e}function ka(i){if(i.previousElementSibling)return i.previousElementSibling;var e=i;do e=e.previousSibling;while(e&&!oi(e));return e}function Sa(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=Si(1024,Pn(i)):n.$el_text=Si(1024,Rt(i)));var o=ri(i);o.length>0&&(n.classes=o.filter(function(c){return c!==""})),M(i.attributes,function(c){var h;if((!kn(i)||["name","id","class","aria-label"].indexOf(c.name)!==-1)&&(r==null||!r.includes(c.name))&&!e&&Ct(c.value)&&(h=c.name,!q(h)||h.substring(0,10)!=="_ngcontent"&&h.substring(0,7)!=="_nghost")){var p=c.value;c.name==="class"&&(p=cr(p).join(" ")),n["attr__"+c.name]=Si(1024,p)}});for(var a=1,l=1,u=i;u=ka(u);)a++,u.tagName===i.tagName&&l++;return n.nth_child=a,n.nth_of_type=l,n}function Ta(i,e){for(var t,r,{e:s,maskAllElementAttributes:n,maskAllText:o,elementAttributeIgnoreList:a,elementsC
4hainAsString:l}=e,u=[i],c=i;c.parentNode&&!Ae(c,"body");)yn(c.parentNode)?(u.push(c.parentNode.host),c=c.parentNode.host):(u.push(c.parentNode),c=c.parentNode);var h,p=[],v={},g=!1,_=!1;if(M(u,E=>{var R=Ji(E);E.tagName.toLowerCase()==="a"&&(g=E.getAttribute("href"),g=R&&g&&Ct(g)&&g),k(ri(E),"ph-no-capture")&&(_=!0),p.push(Sa(E,n,o,a));var I=function(A){if(!Ji(A))return{};var P={};return M(A.attributes,function(J){if(J.name&&J.name.indexOf("data-ph-capture-attribute")===0){var K=J.name.replace("data-ph-capture-attribute-",""),ae=J.value;K&&ae&&Ct(ae)&&(P[K]=ae)}}),P}(E);U(v,I)}),_)return{props:{},explicitNoCapture:_};if(o||(i.tagName.toLowerCase()==="a"||i.tagName.toLowerCase()==="button"?p[0].$el_text=Pn(i):p[0].$el_text=Rt(i)),g){var x,S;p[0].attr__href=g;var T=(x=Zt(g))==null?void 0:x.host,C=d==null||(S=d.location)==null?void 0:S.host;T&&C&&T!==C&&(h=g)}return{props:U({$event_type:s.type,$ce_version:1},l?{}:{$elements:p},{$elements_chain:Ea(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 ls(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 Pa=D("[TracingHeaders]"),Ie=D("[Web Vitals]"),cs=9e5,us="disabled",hs="lazy_loading",pt="awaiting_config",Ut="missing_config";D("[SessionRecording]");var er="[SessionRecording]",Ue=D(er),Oa=D("[Heatmaps]");function ds(i){return H(i)&&"clientX"in i&&"clientY"in i&&ge(i.clientX)&&ge(i.clientY)}var ps=D("[Product Tours]"),Ti="ph_product_tours",$a=["$set_once","$set"],Ce=D("[SiteApps]");function ze(i,e,t){if(O(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 Ia{constructor(e){this.Wi=new lr,this.Gi=(t,r)=>this.Yi(t,r)&&this.Ji(t,r)&&this.Ki(t,r)&&this.Xi(t,r),this.Yi=(t,r)=>r==null||!r.event||(t==null?void 0:t.event)===(r==null?void 0:r.event),this._instance=e,this.Qi=new Set,this.Zi=new Set}init(){var e;if(!b((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(!b((t=this._instance)==null?void 0:t._addCaptureHook)&&(e.forEach(o=>{var a,l;(a=this.Zi)==null||a.add(o),(l=o.steps)==null||l.forEach(u=>{var c;(c=this.Qi)==null||c.add((u==null?void 0:u.event)||"")})}),(r=this._instance)!=null&&r.autocapture)){var s,n=new Set;e.forEach(o=>{var a;(a=o.steps)==null||a.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.Qi.has(e)||this.Qi.has(t==null?void 0:t.event))&&this.Zi&&((r=this.Zi)==null?void 0:r.size)>0&&this.Zi.forEach(s=>{this.te(t,s)&&this.Wi.emit("actionCaptured",s.name)})}ie(e){this.onAction("actionCaptured",t=>e(t))}te(e,t){if((t==null?void 0:t.steps)==null)return!1;for(var r of t.steps)if(this.Gi(e,r))return!0;return!1}onAction(e,t){return this.Wi.on(e,t)}Ji(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"||!ze(s,t.url,t.url_matching||"contains"))return!1}return!0}Ki(e,t){return!!this.ee(e,t)&&!!this.re(e,t)&&!!this.se(e,t)}ee(e,t){var r;if(t==null||!t.href)return!0;var s=this.ne(e);if(s.length>0)return s.some(a=>ze(a.href,t.href,t.href_matching||"exact"));var n,o=(e==null||(r=e.properties)==null?void 0:r.$elements_chain)||"";return!!o&&ze((n=o.match(/(?::|")href="(.*?)"/))?n[1]:"",t.href,t.href_matching||"exact")}re(e,t){var r;if(t==null||!t.text)return!0;var s=this.ne(e);if(s.length>0)return s.some(u=>ze(u.text,t.text,t.text_matching||"exact")||ze(u.$el_text,t.text,t.text_matching||"exact"));var n,o,a,l=(e==null||(r=e.properties)==null?void 0:r.$elements_chain)||"";return!!l&&(n=function(u){for(var c,h=[],p=/(?::|")text="(.*?)"/g;!O(c=p.exec(u));)h.includes(c[1])||h.push(c[1]);return h}(l),o=t.text,a=t.text_matching||"exact",n.some(u=>ze(u,o,a)))}se(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 o=(e==null||(s=e.properties)==null?void 0:s.$elements_chain)||"";if(t.selector_regex&&o)try{return new RegExp(t.selector_regex).test(o)}catch{return!1}return!1}ne(e){var t;return(e==null||(t=e.properties)==null?void 0:t.$elements)==null?[]:e==null?void 0:e.properties.$elements}Xi(e,t){return t==null||!t.properties||t.properties.length===0||_n(t.properties.reduce((r,s)=>{var n=$(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 Ca{constructor(e){this._instance=e,this.oe=new Map,this.ae=new Map,this.le=new Map}ue(e,t){return!!e&&_n(e.propertyFilters,t==null?void 0:t.properties)}he(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(o=>{if(o!=null&&o.name){var a=r.get(o.name)||[];a.push(s.id),r.set(o.name,a)}})}),r}de(e,t,r){var s=(r===lt.Activation?this.oe:this.ae).get(e),n=[];return this.ve(o=>{n=o.filter(a=>s==null?void 0:s.includes(a.id))}),n.filter(o=>{var a,l=(a=o.conditions)==null||(a=a[r])==null||(a=a.values)==null?void 0:a.find(u=>u.name===e);return this.ue(l,t)})}register(e){var t;b((t=this._instance)==null?void 0:t._addCaptureHook)||(this.ce(e),this.fe(e))}fe(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.pe==null&&(this.pe=new Ia(this._instance),this.pe.init(),this.pe.ie(r=>{this.onAction(r)})),t.forEach(r=>{var s,n,o,a,l;r.conditions&&(s=r.conditions)!=null&&s.actions&&(n=r.conditions)!=null&&(n=n.actions)!=null&&n.values&&((o=r.conditions)==null||(o=o.actions)==null||(o=o.values)==null?void 0:o.length)>0&&((a=this.pe)==null||a.register(r.conditions.actions.values),(l=r.conditions)==null||(l=l.actions)==null||(l=l.values)==null||l.forEach(u=>{if(u&&u.name){var c=this.le.get(u.name);c&&c.push(r.id),this.le.set(u.name,c||[r.id])}}))}))}ce(e){var t,r=e.filter(n=>{var o,a;return((o=n.conditions)==null?void 0:o.events)&&((a=n.conditions)==null||(a=a.events)==null||(a=a.values)==null?void 0:a.length)>0}),s=e.filter(n=>{var o,a;return((o=n.conditions)==null?void 0:o.cancelEvents)&&((a=n.conditions)==null||(a=a.cancelEvents)==null||(a=a.values)==null?void 0:a.length)>0});(r.length!==0||s.length!==0)&&((t=this._instance)==null||t._addCaptureHook((n,o)=>{this.onEvent(n,o)}),this.oe=this.he(e,lt.Activation),this.ae=this.he(e,lt.Cancellation))}onEvent(e,t){var r,s=this._e(),n=this.ge(),o=this.me(),a=((r=this._instance)==null||(r=r.persistence)==null?void 0:r.props[n])||[];if(o===e&&t&&a.length>0){var l,u;s.info("event matched, removing item from activated items",{event:e,eventPayload:t,existingActivatedItems:a});var c=(t==null||(l=t.properties)==null?void 0:l.$survey_id)||(t==null||(u=t.properties)==null?void 0:u.$product_tour_id);if(c){var h=a.indexOf(c);h>=0&&(a.splice(h,1),this.be(a))}}else{if(this.ae.has(e)){var p=this.de(e,t,lt.Cancellation);p.length>0&&(s.info("cancel event matched, cancelling items",{event:e,itemsToCancel:p.map(g=>g.id)}),p.forEach(g=>{var _=a.indexOf(g.id);_>=0&&a.splice(_,1),this.ye(g.id)}),this.be(a))}if(this.oe.has(e)){s.info("event name matched",{event:e,eventPayload:t,items:this.oe.get(e)});var v=this.de(e,t,lt.Activation);this.be(a.concat(v.map(g=>g.id)||[]))}}}onAction(e){var t,r=this.ge(),s=((t=this._instance)==null||(t=t.persistence)==null?void 0:t.props[r])||[];this.le.has(e)&&this.be(s.concat(this.le.get(e)||[]))}be(e){var t,r=this._e(),s=this.ge(),n=[...new Set(e)].filter(o=>!this.we(o));r.info("updating activated items",{activatedItems:n}),(t=this._instance)==null||(t=t.persistence)==null||t.register({[s]:n})}getActivatedIds(){var e,t=this.ge(),r=(e=this._instance)==null||(e=e.persistence)==null?void 0:e.props[t];return r||[]}getEventToItemsMap(){return this.oe}Ee(){return this.pe}}class Ra extends Ca{constructor(e){super(e)}ge(){return"$surveys_activated"}me(){return wt.SHOWN}ve(e){var t;(t=this._instance)==null||t.getSurveys(e)}ye(e){var t;(t=this._instance)==null||t.cancelPendingSurvey(e)}_e(){return F}we(){return!1}getSurveys(){return this.getActivatedIds()}getEventToSurveys(){return this.getEventToItemsMap()}}var Fa=d!=null&&d.location?Jt(d.location.hash,"__posthog")||Jt(location.hash,"state"):null,vs="_postHogToolbarParams",_s=D("[Toolbar]"),Re=function(i){return i[i.UNINITIALIZED=0]="UNINITIALIZED",i[i.LOADING=1]="LOADING",i[i.LOADED=2]="LOADED",i}(Re||{}),X=D("[FeatureFlags]"),vt=D("[FeatureFlags]",{debugEnabled:!0}),Ma="errors_while_computing_flags",Aa="flag_missing",La="quota_limited",Na="timeout",Da="connection_error",Ua="unknown_error",ja=i=>"api_error_"+i,Pi="$active_feature_flags",Ge="$override_feature_flags",gs="$feature_flag_payloads",_t="$override_feature_flag_payloads",fs="$feature_flag_request_id",ms=i=>{var e={};for(var[t,r]of jt(i||{}))r&&(e[t]=r);return e},qa=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]}))):X.warn("Using an older version of the feature flags endpoint. Please upgrade your PostHog server to the latest version"),i},Ha=function(i){return i.FeatureFlags="feature_flags",i.Recordings="recordings",i}({}),Oi=D("[Error tracking]"),Va={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 z{constructor(e){var t=this;this.getWebExperimentsAndEvaluateDisplayLogic=function(r){r===void 0&&(r=!1),t.getWebExperiments(s=>{z.xe("retrieved web experiments from the server"),t.Se=new Map,s.forEach(n=>{if(n.feature_flag_key){var o;t.Se&&(z.xe("setting flag key ",n.feature_flag_key," to web experiment ",n),(o=t.Se)==null||o.set(n.feature_flag_key,n));var a=t._instance.getFeatureFlag(n.feature_flag_key);q(a)&&n.variants[a]&&t.$e(n.name,a,n.variants[a].transforms)}else if(n.variants)for(var l in n.variants){var u=n.variants[l];z.ke(u)&&t.$e(n.name,l,u.transforms)}})},r)},this._instance=e,this._instance.onFeatureFlags(r=>{this.onFeatureFlags(r)})}initialize(){}onFeatureFlags(e){if(this._is_bot())z.xe("Refusing to render web experiment since the viewer is a likely bot");else if(!this._instance.config.disable_web_experiments){if(O(this.Se))return this.Se=new Map,this.loadIfEnabled(),void this.previewWebExperiment();z.xe("applying feature flags",e),e.forEach(t=>{var r;if(this.Se&&(r=this.Se)!=null&&r.has(t)){var s,n=this._instance.getFeatureFlag(t),o=(s=this.Se)==null?void 0:s.get(t);n&&o!=null&&o.variants[n]&&this.$e(o.name,n,o.variants[n].transforms)}})}}previewWebExperiment(){var e=z.getWindowLocation();if(e!=null&&e.search){var t=Qt(e==null?void 0:e.search,"__experiment_id"),r=Qt(e==null?void 0:e.search,"__experiment_variant");t&&r&&(z.xe("previewing web experiments "+t+" && "+r),this.getWebExperiments(s=>{this.Pe(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 o=n.json.experiments||[];return e(o)}})}Pe(e,t,r){var s=r.filter(n=>n.id===e);s&&s.length>0&&(z.xe("Previewing web experiment ["+s[0].name+"] with variant ["+t+"]"),this.$e(s[0].name,t,s[0].variants[t].transforms))}static ke(e){return!O(e.conditions)&&z.Te(e)&&z.Re(e)}static Te(e){var t;if(O(e.conditions)||O((t=e.conditions)==null?void 0:t.url))return!0;var r,s,n,o=z.getWindowLocation();return!!o&&((r=e.conditions)==null||!r.url||Va[(s=(n=e.conditions)==null?void 0:n.urlMatchType)!==null&&s!==void 0?s:"icontains"](e.conditions.url,o))}
4static getWindowLocation(){return d==null?void 0:d.location}static Re(e){var t;if(O(e.conditions)||O((t=e.conditions)==null?void 0:t.utm))return!0;var r=Js();if(r.utm_source){var s,n,o,a,l,u,c,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=(o=e.conditions)==null||(o=o.utm)==null||!o.utm_source||((a=e.conditions)==null||(a=a.utm)==null?void 0:a.utm_source)==r.utm_source,g=(l=e.conditions)==null||(l=l.utm)==null||!l.utm_medium||((u=e.conditions)==null||(u=u.utm)==null?void 0:u.utm_medium)==r.utm_medium,_=(c=e.conditions)==null||(c=c.utm)==null||!c.utm_term||((h=e.conditions)==null||(h=h.utm)==null?void 0:h.utm_term)==r.utm_term;return p&&g&&_&&v}return!1}static xe(e){for(var t=arguments.length,r=new Array(t>1?t-1:0),s=1;s<t;s++)r[s-1]=arguments[s];y.info("[WebExperiments] "+e,r)}$e(e,t,r){this._is_bot()?z.xe("Refusing to render web experiment since the viewer is a likely bot"):t!=="control"?r.forEach(s=>{if(s.selector){var n;z.xe("applying transform of variant "+t+" for experiment "+e+" ",s);var o=(n=document)==null?void 0:n.querySelectorAll(s.selector);o==null||o.forEach(a=>{var l=a;s.html&&(l.innerHTML=s.html),s.css&&l.setAttribute("style",s.css)})}}):z.xe("Control variants leave the page unmodified.")}_is_bot(){return te&&this._instance?pn(te,this._instance.config.custom_blocked_useragents):void 0}}var ne=D("[Conversations]"),ai={featureFlags:class{constructor(i){this.di=!1,this.Ie=!1,this.Ce=!1,this.Fe=!1,this.Oe=!1,this.Me=!1,this.Ae=!1,this.De=!1,this._instance=i,this.featureFlagEventHandlers=[]}Le(){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}je(){return!!this.Le()&&(this.De||this.Ce||(this.De=!0,X.warn("Feature flag cache is stale, triggering refresh..."),this.reloadFeatureFlags()),!0)}Ne(){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.Ae||(X.warn("evaluation_environments is deprecated. Use evaluation_contexts instead. evaluation_environments will be removed in a future version."),this.Ae=!0),e!=null&&e.length?e.filter(t=>{var r=t&&typeof t=="string"&&t.trim().length>0;return r||X.error("Invalid evaluation context found:",t,"Expected non-empty string"),r}):[]}Ue(){return this.Ne().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,o=(s=(n=t.bootstrap)==null?void 0:n.featureFlagPayloads)!==null&&s!==void 0?s:{},a=Object.keys(r).filter(u=>!!r[u]).reduce((u,c)=>(u[c]=r[c]||!1,u),{}),l=Object.keys(o).filter(u=>a[u]).reduce((u,c)=>(o[c]&&(u[c]=o[c]),u),{});this.receivedFeatureFlags({featureFlags:a,featureFlagPayloads:l})}}updateFlags(i,e,t){var r=t!=null&&t.merge?this.getFlagVariants():{},s=t!=null&&t.merge?this.getFlagPayloads():{},n=f({},r,i),o=f({},s,e),a={};for(var[l,u]of Object.entries(n)){var c=typeof u=="string";a[l]={key:l,enabled:!!c||!!u,variant:c?u:void 0,reason:void 0,metadata:b(o==null?void 0:o[l])?void 0:{id:0,version:void 0,description:void 0,payload:o[l]}}}this.receivedFeatureFlags({flags:a})}get hasLoadedFlags(){return this.Ie}getFlags(){return Object.keys(this.getFlagVariants())}getFlagsWithDetails(){var i=this._instance.get_property(ji),e=this._instance.get_property(Ge),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 o,a,l=r[n],u=e==null?void 0:e[n],c=b(u)?(o=l==null?void 0:l.enabled)!==null&&o!==void 0&&o:!!u,h=b(u)?l.variant:typeof u=="string"?u:void 0,p=t==null?void 0:t[n],v=f({},l,{enabled:c,variant:c?h??(l==null?void 0:l.variant):void 0});c!==(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=f({},l==null?void 0:l.metadata,{payload:p,original_payload:l==null||(a=l.metadata)==null?void 0:a.payload})),r[n]=v}return this.di||(X.warn(" Overriding feature flag details!",{flagDetails:i,overriddenPayloads:t,finalDetails:r}),this.di=!0),r}getFlagVariants(){var i=this._instance.get_property(Ze),e=this._instance.get_property(Ge);
4if(!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.di||(X.warn(" Overriding feature flags!",{enabledFlags:i,overriddenFlags:e,finalFlags:t}),this.di=!0),t}getFlagPayloads(){var i=this._instance.get_property(gs),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.di||(X.warn(" Overriding feature flag payloads!",{flagPayloads:i,overriddenPayloads:e,finalPayloads:t}),this.di=!0),t}reloadFeatureFlags(){this.Fe||this._instance.config.advanced_disable_feature_flags||this.ze||(this._instance.bi.emit("featureFlagsReloading",!0),this.ze=setTimeout(()=>{this.He()},5))}Be(){clearTimeout(this.ze),this.ze=void 0}ensureFlagsLoaded(){this.Ie||this.Ce||this.ze||this.reloadFeatureFlags()}setAnonymousDistinctId(i){this.$anon_distinct_id=i}setReloadingPaused(i){this.Fe=i}He(i){var e;if(this.Be(),!this._instance.bt())if(this.Ce)this.Oe=!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:f({},((e=this._instance.persistence)==null?void 0:e.get_initial_props())||{},this._instance.get_property(bt)||{}),group_properties:this._instance.get_property(je),timezone:on()};le(r)||b(r)||(s.$device_id=r),(i!=null&&i.disableFlags||this._instance.config.advanced_disable_feature_flags)&&(s.disable_flags=!0),this.Ue()&&(s.evaluation_contexts=this.Ne());var n=this._instance.config.advanced_only_evaluate_survey_feature_flags?"&only_evaluate_survey_feature_flags=true":"",o=this._instance.requestRouter.endpointFor("flags","/flags/?v=2"+n);this.Ce=!0,this._instance._send_request({method:"POST",url:o,data:s,compression:this._instance.config.disable_compression?void 0:Ee.Base64,timeout:this._instance.config.feature_flag_request_timeout_ms,callback:a=>{var l,u,c,h=!0;if(a.statusCode===200&&(this.Oe||(this.$anon_distinct_id=void 0),h=!1),this.Ce=!1,!s.disable_flags||this.Oe){this.Me=!h;var p=[];a.error?a.error instanceof Error?p.push(a.error.name==="AbortError"?Na:Da):p.push(Ua):a.statusCode!==200&&p.push(ja(a.statusCode)),(l=a.json)!=null&&l.errorsWhileComputingFlags&&p.push(Ma);var v=!((u=a.json)==null||(u=u.quotaLimited)==null||!u.includes(Ha.FeatureFlags));if(v&&p.push(La),(c=this._instance.persistence)==null||c.register({[Hi]:p}),v)X.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 g;s.disable_flags||this.receivedFeatureFlags((g=a.json)!==null&&g!==void 0?g:{},h),this.Oe&&(this.Oe=!1,this.He())}}}})}}getFeatureFlag(i,e){var t;if(e===void 0&&(e={}),!e.fresh||this.Me)if(this.Ie||this.getFlags()&&this.getFlags().length>0){if(!this.je()){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 X.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.Me)if(this.Ie||this.getFlags()&&this.getFlags().length>0){if(!this.je()){var t=this.getFlagVariants(),r=i in t,s=t[i],n=this.getFlagPayloads()[i],o=String(s),a=this._instance.get_property(fs)||void 0,l=this._instance.get_property(Gt)||void 0,u=this._instance.get_property(zt)||{};if((e.send_event||!("send_event"in e))&&(!(i in u)||!u[i].includes(o))){var c,h,p,v,g,_,x,S,T,C;$(u[i])?u[i].push(o):u[i]=[o],(c=this._instance.persistence)==null||c.register({[zt]:u});var E=this.getFeatureFlagDetails(i),R=[...(h=this._instance.get_property(Hi))!==null&&h!==void 0?h:[]];b(s)&&R.push(Aa);var I={$feature_flag:i,$feature_flag_response:s,$feature_flag_payload:n||null,$feature_flag_request_id:a,$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.Me};b(E==null||(g=E.metadata)==null?void 0:g.version)||(I.$feature_flag_version=E.metadata.version);var A,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&&(I.$feature_flag_reason=P),E!=null&&(T=E.metadata)!=null&&T.id&&(I.$feature_flag_id=E.metadata.id),b(E==null?void 0:E.original_variant)&&b(E==null?void 0:E.original_enabled)||(I.$feature_flag_original_response=b(E.original_variant)?E.original_enabled:E.original_variant),E!=null&&(C=E.metadata)!=null&&C.original_payload&&(I.$feature_flag_original_payload=E==null||(A=E.metadata)==null?void 0:A.original_payload),R.length&&(I.$feature_flag_error=R.join(",")),this._instance.capture("$feature_flag_called",I)}if(r){var J=n;if(!b(n))try{J=JSON.parse(n)}catch{}return{key:i,enabled:!!s,variant:typeof s=="string"?s:void 0,payload:J}}}}else X.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.Ue()&&(r.evaluation_contexts=this.Ne()),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,o=(n=s.json)==null?void 0:n.featureFlagPayloads;e((o==null?void 0:o[i])||void 0)}})}isFeatureEnabled(i,e){if(e===void 0&&(e={}),!e.fresh||this.Me){if(this.Ie||this.getFlags()&&this.getFlags().length>0){var t=this.getFeatureFlag(i,e);return b(t)?void 0:!!t}X.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.Ie=!0;var t=this.getFlagVariants(),r=this.getFlagPayloads(),s=this.getFlagsWithDetails();(function(n,o,a,l,u){a===void 0&&(a={}),l===void 0&&(l={}),u===void 0&&(u={});var c=qa(n),h=c.flags,p=c.featureFlags,v=c.featureFlagPayloads;if(p){var g=n.requestId,_=n.evaluatedAt;if($(p)){X.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;o&&o.register({[Pi]:p,[Ze]:x})}else{var T=p,C=v,E=h;if(n.errorsWhileComputingFlags)if(h){var R=new Set(Object.keys(h).filter(I=>{var A;
vendor: 1,718 bytes, line 4
4return!((A=h[I])!=null&&A.failed)}));T=f({},a,Object.fromEntries(Object.entries(T).filter(I=>{var[A]=I;return R.has(A)}))),C=f({},l,Object.fromEntries(Object.entries(C||{}).filter(I=>{var[A]=I;return R.has(A)}))),E=f({},u,Object.fromEntries(Object.entries(E||{}).filter(I=>{var[A]=I;return R.has(A)})))}else T=f({},a,T),C=f({},l,C),E=f({},u,E);o&&o.register(f({[Pi]:Object.keys(ms(T)),[Ze]:T||{},[gs]:C||{},[ji]:E||{}},g?{[fs]:g}:{},_?{[Gt]:_}:{}))}}})(i,this._instance.persistence,t,r,s),e||(this.De=!1),this.qe(e)}}override(i,e){e===void 0&&(e=!1),X.warn("override is deprecated. Please use overrideFeatureFlags instead."),this.overrideFeatureFlags({flags:i,suppressWarning:e})}overrideFeatureFlags(i){if(!this._instance.__loaded||!this._instance.persistence)return X.uninitializedWarning("posthog.featureFlags.overrideFeatureFlags");if(i===!1)return this._instance.persistence.unregister(Ge),this._instance.persistence.unregister(_t),this.qe(),vt.info("All overrides cleared");if(i&&typeof i=="object"&&("flags"in i||"payloads"in i)){var e,t=i;if(this.di=!!((e=t.suppressWarning)!==null&&e!==void 0&&e),"flags"in t){if(t.flags===!1)this._instance.persistence.unregister(Ge),vt.info("Flag overrides cleared");else if(t.flags){if($(t.flags)){for(var r={},s=0;s<t.flags.length;s++)r[t.flags[s]]=!0;this._instance.persistence.register({[Ge]:r})}else this._instance.persistence.register({[Ge]: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.qe()}this.qe()}
4onFeatureFlags(i){if(this.addFeatureFlagsHandler(i),this.Ie){var{flags:e,flagVariants:t}=this.vi();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},o={$feature_flag:i,$feature_enrollment:e,$set:n};s&&(o.$early_access_feature_name=s.name),t&&(o.$feature_enrollment_stage=t),this._instance.capture("$feature_enrollment_update",o),this.setPersonPropertiesForFlags(n,!1);var a=f({},this.getFlagVariants(),{[i]:e});(r=this._instance.persistence)==null||r.register({[Pi]:Object.keys(ms(a)),[Ze]:a}),this.qe()}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 o,a;if(n.json){var l=n.json.earlyAccessFeatures;return(o=this._instance.persistence)==null||o.unregister(yt),(a=this._instance.persistence)==null||a.register({[yt]:l}),i(l)}}})}vi(){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),{})}}qe(i){var{flags:e,flagVariants:t}=this.vi();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]:f({},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]=f({},t[r],i[r]),delete i[r]}),this._instance.register({[je]:f({},t,i)}),e&&this._instance.reloadFeatureFlags()}resetGroupPropertiesForFlags(i){if(i){var e=this._instance.get_property(je)||{};this._instance.register({[je]:f({},e,{[i]:{}})})}else this._instance.unregister(je)}reset(){this.Ie=!1,this.Ce=!1,this.Fe=!1,this.Oe=!1,this.Me=!1,this.$anon_distinct_id=void 0,this.Be(),this.di=!1}}},Ba={sessionRecording:class{get started(){var i;return!((i=this.Ve)==null||!i.isStarted)}get status(){var i,e;return this.We===pt||this.We===Ut?this.We:(i=(e=this.Ve)==null?void 0:e.status)!==null&&i!==void 0?i:this.We}constructor(i){if(this._forceAllowLocalhostNetworkCapture=!1,this.We=us,this.Ge=void 0,this._instance=i,!this._instance.sessionManager)throw Ue.error("started without valid sessionManager"),new Error(er+" started without valid sessionManager. This is a bug.");if(this._instance.config.cookieless_mode==="always")throw new Error(er+' cannot be used with cookieless_mode="always"')}initialize(){this.startIfEnabledOrStop()}get Ye(){var i,e=!((i=this._instance.get_property(Mt))==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.Ye||(e=this.Ve)==null||!e.isStarted){var t=!b(Object.assign)&&!b(Array.from);this.Ye&&t?(this.Je(i),Ue.info("starting")):(this.We=us,this.stopRecording())}}Je(i){var e,t,r;this.Ye&&(this.We!==pt&&this.We!==Ut&&(this.We=hs),w!=null&&(e=w.__PosthogExtensions__)!=null&&(e=e.rrweb)!=null&&e.record&&(t=w.__PosthogExtensions__)!=null&&t.initSessionRecording?this.Ke(i):(r=w.__PosthogExtensions__)==null||r.loadExternalDependency==null||r.loadExternalDependency(this._instance,this.Xe,s=>{if(s)return Ue.error("could not load recorder",s);this.Ke(i)}))}stopRecording(){var i,e;(i=this.Ge)==null||i.call(this),this.Ge=void 0,(e=this.Ve)==null||e.stop()}Qe(){var i,e;(i=this.Ge)==null||i.call(this),this.Ge=void 0,(e=this.Ve)==null||e.discard()}Ze(){var i;(i=this._instance.persistence)==null||i.unregister(Ys)}tr(i,e){if(O(i))return null;var t,r=ge(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)}ir(i){if(this._instance.persistence){var e,t,r=this._instance.persistence,s=()=>{var n,o=i.sessionRecording===!1?void 0:i.sessionRecording,a=this.tr((n=this._instance.config.session_recording)==null?void 0:n.sampleRate,"session_recording.sampleRate"),l=this.tr(o==null?void 0:o.sampleRate,"remote config sampleRate"),u=a??l;O(u)&&this.Ze();var c=o==null?void 0:o.minimumDurationMilliseconds;r.register({[Mt]:f({cache_timestamp:Date.now(),enabled:!!o},o,{networkPayloadCapture:f({capturePerformance:i.capturePerformance},o==null?void 0:o.networkPayloadCapture),canvasRecording:{enabled:o==null?void 0:o.recordCanvas,fps:o==null?void 0:o.canvasFps,quality:o==null?void 0:o.canvasQuality},sampleRate:u,minimumDurationMilliseconds:b(c)?null:c,endpoint:o==null?void 0:o.endpoint,triggerMatchType:o==null?void 0:o.triggerMatchType,masking:o==null?void 0:o.masking,urlTriggers:o==null?void 0:o.urlTriggers})})};s(),(e=this.Ge)==null||e.call(this),this.Ge=(t=this._instance.sessionManager)==null?void 0:t.onSessionId(s)}}onRemoteConfig(i){return"sessionRecording"in i?i.sessionRecording===!1?(this.ir(i),void this.Qe()):(this.ir(i),void this.startIfEnabledOrStop()):(this.We===pt&&(this.We=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.Ve)!=null&&t.log?this.Ve.log(i,e):Ue.warn("log called before recorder was ready")}get Xe(){var i,e,t=(i=this._instance)==null||(i=i.persistence)==null?void 0:i.get_property(Mt);return(t==null||(e=t.scriptConfig)==null?void 0:e.script)||"lazy-recorder"}er(){var i,e=this._instance.get_property(Mt);if(!e)return!1;var t=(i=(typeof e=="object"?e:JSON.parse(e)).cache_timestamp)!==null&&i!==void 0?i:0;return Date.now()-t<=36e5}Ke(i){var e,t;if((e=w.__PosthogExtensions__)==null||!e.initSessionRecording)throw Error("Called on script loaded before session recording is available");if(this.Ve||(this.Ve=(t=w.__PosthogExtensions__)==null?void 0:t.initSessionRecording(this._instance),this.Ve._forceAllowLocalhostNetworkCapture=this._forceAllowLocalhostNetworkCapture),!this.er())return this.We===Ut||this.We===pt?void 0:(this.We=pt,Ue.info("persisted remote config is stale, requesting fresh config before starting"),void new an(this._instance).load());this.We=hs,this.Ve.start(i)}onRRwebEmit(i){var e;(e=this.Ve)==null||e.onRRwebEmit==null||e.onRRwebEmit(i)}overrideLinkedFlag(){var i,e;this.Ve||(e=this._instance.persistence)==null||e.register({$replay_override_linked_flag:!0}),(i=this.Ve)==null||i.overrideLinkedFlag()}overrideSampling(){var i,e;this.Ve||(e=this._instance.persistence)==null||e.register({$replay_override_sampling:!0}),(i=this.Ve)==null||i.overrideSampling()}overrideTrigger(i){var e,t;this.Ve||(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.Ve)==null||e.overrideTrigger(i)}get sdkDebugProperties(){var i;return((i=this.Ve)==null?void 0:i.sdkDebugProperties)||{$recording_status:this.status}}tryAddCustomEvent(i,e){var t;return!((t=this.Ve)==null||!t.tryAddCustomEvent(i,e))}}},Wa={autocapture:class{constructor(i){this.rr=!1,this.sr=null,this.nr=!1,this.instance=i,this.rageclicks=new os(i.config.rageclick),this.ar=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}lr(){if(this.isBrowserSupported()){if(d&&m){var i=t=>{t=t||(d==null?void 0:d.event);try{this.ur(t)}catch(r){as.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.ur(t,ki)};j(m,"copy",e,{capture:!0}),j(m,"cut",e,{capture:!0})}}}else as.info("Disabling Automatic Event Collection because this browser is not supported")}startIfEnabled(){this.isEnabled&&!this.rr&&(this.lr(),this.rr=!0)}onRemoteConfig(i){i.elementsChainAsString&&(this.nr=i.elementsChainAsString),this.instance.persistence&&this.instance.persistence.register({[$r]:!!i.autocapture_opt_out}),this.sr=!!i.autocapture_opt_out,this.startIfEnabled()}setElementSelectors(i){this.ar=i}getElementSelectors(i){var e,t=[];return(e=this.ar)==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.sr;if(le(r)&&!Se(t)&&!this.instance.bt())return!1;var s=(e=this.sr)!==null&&e!==void 0?e:!!t;return!!this.instance.config.autocapture&&!s}ur(i,e){if(e===void 0&&(e="$autocapture"),this.isEnabled){var t,r=is(i);mn(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())&&ga(r,this.instance.config.rageclick)&&this.ur(i,"$rageclick");var s=e===ki;if(r&&fa(r,i,this.N,s,s?["copy","cut"]:void 0)){var{props:n,explicitNoCapture:o}=Ta(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.nr});if(o)return!1;var a=this.getElementSelectors(r);if(a&&a.length>0&&(n.$element_selectors=a),e===ki){var l,u=bn(d==null||(l=d.getSelection())==null?void 0:l.toString()),c=i.type||"clipboard";if(!u)return!1;n.$selected_content=u,n.$copy_type=c}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.hr=(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&&(y.info("History API monitoring enabled, starting..."),this.monitorHistoryChanges())}stop(){this.dr&&this.dr(),this.dr=void 0,y.info("History API monitoring stopped")}monitorHistoryChanges(){var i,e;if(d&&d.history){var t=this;(i=d.history.pushState)!=null&&i.__posthog_wrapped__||ls(d.history,"pushState",r=>function(s,n,o){r.call(this,s,n,o),t.vr("pushState")}),(e=d.history.replaceState)!=null&&e.__posthog_wrapped__||ls(d.history,"replaceState",r=>function(s,n,o){r.call(this,s,n,o),t.vr("replaceState")}),this.cr()}}vr(i){try{var e,t=d==null||(e=d.location)==null?void 0:e.pathname;if(!t)return;t!==this.hr&&this.isEnabled&&this._instance.capture("$pageview",{navigation_type:i}),this.hr=t}catch(r){y.error("Error capturing "+i+" pageview",r)}}cr(){if(!this.dr){var i=()=>{this.vr("popstate")};j(d,"popstate",i),this.dr=()=>{d&&d.removeEventListener("popstate",i)}}}},heatmaps:class{constructor(i){var e;this.pr=!1,this.rr=!1,this._r=null,this.instance=i,this.pr=!((e=this.instance.persistence)==null||!e.props[Di]),this.rageclicks=new os(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 O(this.instance.config.capture_heatmaps)?O(this.instance.config.enable_heatmaps)?this.pr:this.instance.config.enable_heatmaps:this.instance.config.capture_heatmaps!==!1}startIfEnabled(){if(this.isEnabled){if(this.rr)return;Oa.info("starting..."),this.gr(),this.mr()}else{var i;clearInterval((i=this._r)!==null&&i!==void 0?i:void 0),this.br(),this.getAndClearBuffer()}}onRemoteConfig(i){if("heatmaps"in i){var e=!!i.heatmaps;this.instance.persistence&&this.instance.persistence.register({[Di]:e}),this.pr=e,this.startIfEnabled()}}getAndClearBuffer(){var i=this.C;return this.C=void 0,i}yr(i){this.wr(i.originalEvent,"deadclick")}mr(){this._r&&clearInterval(this._r),this._r=function(i){return(i==null?void 0:i.visibilityState)==="visible"}(m)?setInterval(this.Ot.bind(this),this.flushIntervalMilliseconds):null}gr(){d&&m&&(this.Er=this.Ot.bind(this),j(d,"beforeunload",this.Er),this.Sr=i=>this.wr(i||(d==null?void 0:d.event)),j(m,"click",this.Sr,{capture:!0}),this.$r=i=>this.kr(i||(d==null?void 0:d.event)),j(m,"mousemove",this.$r,{capture:!0}),this.Pr=new Nr(this.instance,Fo,this.yr.bind(this)),this.Pr.startIfEnabledOrStop(),this.Tr=this.mr.bind(this),j(m,"visibilitychange",this.Tr),this.rr=!0)}br(){var i;d&&m&&(this.Er&&d.removeEventListener("beforeunload",this.Er),this.Sr&&m.removeEventListener("click",this.Sr,{capture:!0}),this.$r&&m.removeEventListener("mousemove",this.$r,{capture:!0}),this.Tr&&m.removeEventListener("visibilitychange",this.Tr),clearTimeout(this.Rr),(i=this.Pr)==null||i.stop(),this.rr=!1)}Ir(i,e){var t=this.instance.scrollManager.scrollY(),r=this.instance.scrollManager.scrollX(),s=this.instance.scrollManager.scrollElement(),n=function(o,a,l){for(var u=o;u&&oi(u)&&!Ae(u,"body");){if(u===l)return!1;if(k(a,d==null?void 0:d.getComputedStyle(u).position))return!0;u=En(u)}return!1}(is(i),["fixed","sticky"],s);return{x:i.clientX+(n?0:r),y:i.clientY+(n?0:t),target_fixed:n,type:e}}wr(i,e){var t;if(e===void 0&&(e="click"),!es(i.target)&&ds(i)){var r=this.Ir(i,e);(t=this.rageclicks)!=null&&t.isRageClick(i.clientX,i.clientY,new Date().getTime())&&this.Cr(f({},r,{type:"rageclick"})),this.Cr(r)}}kr(i){!es(i.target)&&ds(i)&&(clearTimeout(this.Rr),this.Rr=setTimeout(()=>{this.Cr(this.Ir(i,"mousemove"))},500))}Cr(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=$t(e,s,It);this.C=this.C||{},this.C[n]||(this.C[n]=[]),this.C[n].push(i)}}Ot(){this.C&&!Xe(this.C)&&this.instance.capture("$$heatmap",{$heatmap_data:this.getAndClearBuffer()})}},deadClicksAutocapture:Nr,webVitalsAutocapture:class{constructor(i){var e;this.pr=!1,this.rr=!1,this.C={url:void 0,metrics:[],firstMetricTimestamp:void 0},this.Fr=()=>{clearTimeout(this.Or),this.C.metrics.length!==0&&(this._instance.capture("$web_vitals",this.C.metrics.reduce((t,r)=>f({},t,{["$web_vitals_"+r.name+"_event"]:f({},r),["$web_vitals_"+r.name+"_value"]:r.value}),{})),this.C={url:void 0,metrics:[],firstMetricTimestamp:void 0})},this.Mr=t=>{var r,s=(r=this._instance.sessionManager)==null?void 0:r.checkAndGetSessionAndWindowId(!0);if(b(s))Ie.error("Could not read session ID. Dropping metrics!");else{this.C=this.C||{url:void 0,metrics:[],firstMetricTimestamp:void 0};var n=this.Ar();b(n)||(O(t==null?void 0:t.name)||O(t==null?void 0:t.value)?Ie.error("Invalid metric received",t):this.Dr&&t.value>=this.Dr?Ie.error("Ignoring metric with value >= "+this.Dr,t):(this.C.url!==n&&(this.Fr(),this.Or=setTimeout(this.Fr,this.flushToCaptureTimeoutMs)),b(this.C.url)&&(this.C.url=n),this.C.firstMetricTimestamp=b(this.C.firstMetricTimestamp)?Date.now():this.C.firstMetricTimestamp,t.attribution&&t.attribution.interactionTargetElement&&(t.attribution.interactionTargetElement=void 0),this.C.metrics.push(f({},t,{$current_url:n,$session_id:s.sessionId,$window_id:s.windowId,timestamp:Date.now()})),this.C.metrics.length===this.allowedMetrics.length&&this.Fr()))}},this.Lr=()=>{if(!this.rr){var t,r,s,n,o=w.__PosthogExtensions__;b(o)||b(o.postHogWebVitalsCallbacks)||({onLCP:t,onCLS:r,onFCP:s,onINP:n}=o.postHogWebVitalsCallbacks),t&&r&&s&&n?(this.allowedMetrics.indexOf("LCP")>-1&&t(this.Mr.bind(this)),this.allowedMetrics.indexOf("CLS")>-1&&r(this.Mr.bind(this)),this.allowedMetrics.indexOf("FCP")>-1&&s(this.Mr.bind(this)),this.allowedMetrics.indexOf("INP")>-1&&n(this.Mr.bind(this)),this.rr=!0):Ie.error("web vitals callbacks not loaded - not starting")}},this._instance=i,this.pr=!((e=this._instance.persistence)==null||!e.props[Rr]),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 O(t)?((e=this._instance.persistence)==null?void 0:e.props[Mr])||["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 Dr(){var i=H(this._instance.config.capture_performance)&&ge(this._instance.config.capture_performance.__web_vitals_max_value)?this._instance.config.capture_performance.__web_vitals_max_value:cs;return 0<i&&i<=6e4?cs:i}get isEnabled(){var i=B==null?void 0:B.protocol;if(i!=="http:"&&i!=="https:")return Ie.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.pr}startIfEnabled(){this.isEnabled&&!this.rr&&(Ie.info("enabled, starting..."),this.G(this.Lr))}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({[Rr]:e}),this._instance.persistence.register({[Mr]:t})),this.pr=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?Ie.error("failed to load script",s):i()})}}Ar(){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 $t(i,r,It)}Ie.error("Could not determine current URL")}}},za={exceptionObserver:class{constructor(i){var e,t,r;this.Lr=()=>{var s;if(d&&this.isEnabled&&(s=w.__PosthogExtensions__)!=null&&s.errorWrappingFunctions){var n=w.__PosthogExtensions__.errorWrappingFunctions.wrapOnError,o=w.__PosthogExtensions__.errorWrappingFunctions.wrapUnhandledRejection,a=w.__PosthogExtensions__.errorWrappingFunctions.wrapConsoleError;try{!this.jr&&this.N.capture_unhandled_errors&&(this.jr=n(this.captureException.bind(this))),!this.Nr&&this.N.capture_unhandled_rejections&&(this.Nr=o(this.captureException.bind(this))),!this.Ur&&this.N.capture_console_errors&&(this.Ur=a(this.captureException.bind(this)))}catch(l){dt.error("failed to start",l),this.zr()}}},this._instance=i,this.Hr=!((e=this._instance.persistence)==null||!e.props[Ir]),this.Br=new jn({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.qr(),this.startIfEnabledOrStop()}qr(){var i=this._instance.config.capture_exceptions,e={capture_unhandled_errors:!1,capture_unhandled_rejections:!1,capture_console_errors:!1};return H(i)?e=f({},e,i):(b(i)?this.Hr:i)&&(e=f({},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.zr(),this.G(this.Lr)):this.zr()}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()})}zr(){var i,e,t;(i=this.jr)==null||i.call(this),this.jr=void 0,(e=this.Nr)==null||e.call(this),this.Nr=void 0,(t=this.Ur)==null||t.call(this),this.Ur=void 0}onRemoteConfig(i){if("autocaptureExceptions"in i){var e=i.autocaptureExceptions;this.Hr=!!e||!1,this._instance.persistence&&this._instance.persistence.register({[Ir]:this.Hr}),this.N=this.qr(),this.startIfEnabledOrStop()}}onConfigChange(){this.N=this.qr()}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.Br.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.Vr=[],this.Wr=new Jn([new lo,new mo,new uo,new co,new go,new _o,new po,new fo],ao()),this._instance=i,this.Vr=(e=(t=this._instance.persistence)==null?void 0:t.get_property(Ui))!==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.Vr=s,this._instance.persistence&&this._instance.persistence.register({[Ui]:this.Vr,[Cr]:n})}}get Gr(){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.Wr.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.Yr(e)){if(this.Jr(e))return void Oi.info("Skipping exception capture because a suppression rule matched");if(!this.Gr&&this.Kr(e))return void Oi.info("Skipping exception capture because it was thrown by an extension");if(!this._instance.config.error_tracking.__capturePostHogExceptions&&this.Xr(e))return void Oi.info("Skipping exception capture because it was thrown by the PostHog SDK")}return this._instance.capture("$exception",i,{_noTruncate:!0,_batchKey:"exceptionEvent",Ni:!0}
vendor: 20,712 bytes, line 4
4)}Jr(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.Vr.some(t=>{var r=t.values.map(s=>{var n,o=vn[s.operator],a=$(s.value)?s.value:[s.value],l=(n=e[s.key])!==null&&n!==void 0?n:[];return a.length>0&&o(a,l)});return t.type==="OR"?r.some(Boolean):r.every(Boolean)})}Kr(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://"))}Xr(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:[],o=n[n.length-1];return(r=o==null||(s=o.filename)==null?void 0:s.includes("posthog.com/static"))!==null&&r!==void 0&&r}return!1}Yr(i){return!O(i)&&$(i)}}},Ga=f({productTours:class{constructor(i){this.Qr=null,this.Zr=null,this._instance=i}initialize(){this.loadIfEnabled()}onRemoteConfig(i){"productTours"in i&&(this._instance.persistence&&this._instance.persistence.register({[Fr]:!!i.productTours}),this.loadIfEnabled())}loadIfEnabled(){var i,e;this.Qr||(i=this._instance).config.disable_product_tours||(e=i.persistence)==null||!e.get_property(Fr)||this.G(()=>this.ts())}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?ps.error("Could not load product tours script",r):i()})}ts(){var i;!this.Qr&&(i=w.__PosthogExtensions__)!=null&&i.generateProductTours&&(this.Qr=w.__PosthogExtensions__.generateProductTours(this._instance,!0))}getProductTours(i,e){if(e===void 0&&(e=!1),!$(this.Zr)||e){var t=this._instance.persistence;if(t){var r=t.props[Ti];if($(r)&&!e)return this.Zr=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 o="Product Tours API could not be loaded, status: "+n;return ps.error(o),void i([],{isLoaded:!1,error:o})}var a=$(s.json.product_tours)?s.json.product_tours:[];this.Zr=a,t&&t.register({[Ti]:a}),i(a,{isLoaded:!0})}})}else i(this.Zr,{isLoaded:!0})}getActiveProductTours(i){O(this.Qr)?i([],{isLoaded:!1,error:"Product tours not loaded"}):this.Qr.getActiveProductTours(i)}showProductTour(i){var e;(e=this.Qr)==null||e.showTourById(i)}previewTour(i){this.Qr?this.Qr.previewTour(i):this.G(()=>{var e;this.ts(),(e=this.Qr)==null||e.previewTour(i)})}dismissProductTour(){var i;(i=this.Qr)==null||i.dismissTour("user_clicked_skip")}nextStep(){var i;(i=this.Qr)==null||i.nextStep()}previousStep(){var i;(i=this.Qr)==null||i.previousStep()}clearCache(){var i;this.Zr=null,(i=this._instance.persistence)==null||i.unregister(Ti)}resetTour(i){var e;(e=this.Qr)==null||e.resetTour(i)}resetAllTours(){var i;(i=this.Qr)==null||i.resetAllTours()}cancelPendingTour(i){var e;(e=this.Qr)==null||e.cancelPendingTour(i)}}},ai),Ya={siteApps:class{constructor(i){this._instance=i,this.es=[],this.apps={}}get isEnabled(){return!!this._instance.config.opt_in_site_apps}rs(i,e){if(e){var t=this.globalsForEvent(e);this.es.push(t),this.es.length>1e3&&(this.es=this.es.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.rs.bind(this));this.ss=()=>{i(),this.es=[],this.ss=void 0}}}globalsForEvent(i){var e,t,r,s,n,o,a;if(!i)throw new Error("Event payload is required");var l={},u=this._instance.get_property("$groups")||[],c=this._instance.get_property("$stored_group_properties")||{};for(var[h,p]of Object.entries(c))l[h]={id:u[h],type:h,properties:p};var{$set_once:v,$set:g}=i;return{event:f({},ws(i,$a),{properties:f({},i.properties,g?{$set:f({},(e=(t=i.properties)==null?void 0:t.$set)!==null&&e!==void 0?e:{},g)}:{},v?{$set_once:f({},(r=(s=i.properties)==null?void 0:s.$set_once)!==null&&r!==void 0?r:{},v)}:{}),elements_chain:(n=(o=i.properties)==null?void 0:o.$elements_chain)!==null&&n!==void 0?n:"",distinct_id:(a=i.properties)==null?void 0:a.distinct_id}),person:{properties:this._instance.get_property("$stored_person_properties")},groups:l}}setupSiteApp(i){var e=this.apps[i.id],t=()=>{var o;!e.errored&&this.es.length&&(Ce.info("Processing "+this.es.length+" events for site app with id "+i.id),this.es.forEach(a=>e.processEvent==null?void 0:e.processEvent(a)),e.processedBuffer=!0),Object.values(this.apps).every(a=>a.processedBuffer||a.errored)&&((o=this.ss)==null||o.call(this))},r=!1,s=o=>{e.errored=!o,e.loaded=!0,Ce.info("Site app with id "+i.id+" "+(o?"loaded":"errored")),r&&t()};try{var{processEvent:n}=i.init({posthog:this._instance,callback:o=>{s(o)}});n&&(e.processEvent=n),r=!0}catch(o){Ce.error("Error while initializing PostHog app with config id "+i.id,o),s(!1)}if(r&&e.loaded)try{t()}catch(o){Ce.error("Error while processing buffered events PostHog app with config id "+i.id,o),e.errored=!0}}ns(){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)}os(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){Ce.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.ns(),void this._instance.on("eventCaptured",l=>this.os(l))):void Ce.error('PostHog site apps are disabled. Enable the "opt_in_site_apps" config to proceed.');if((t=this.ss)==null||t.call(this),(r=i.siteApps)!=null&&r.length)if(this.isEnabled){var n=function(l){var u;w["__$$ph_site_app_"+l]=s._instance,(u=w.__PosthogExtensions__)==null||u.loadSiteApp==null||u.loadSiteApp(s._instance,a,c=>{if(c)return Ce.error("Error while initializing PostHog app with config id "+l,c)})};for(var{id:o,url:a}of i.siteApps)n(o)}else Ce.error('PostHog site apps are disabled. Enable the "opt_in_site_apps" config to proceed.')}}},Ka={tracingHeaders:class{constructor(i){this.ls=void 0,this.us=void 0,this.Lr=()=>{var e,t;b(this.ls)&&((e=w.__PosthogExtensions__)==null||(e=e.tracingHeadersPatchFns)==null||e._patchXHR(this._instance.config.__add_tracing_headers||[],this._instance.get_distinct_id(),this._instance.sessionManager)),b(this.us)&&((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 Pa.error("failed to load script",r);i()})}startIfEnabledOrStop(){var i,e;this._instance.config.__add_tracing_headers?this.G(this.Lr):((i=this.ls)==null||i.call(this),(e=this.us)==null||e.call(this),this.ls=void 0,this.us=void 0)}}},Xa=f({surveys:class{constructor(i){this.hs=void 0,this._surveyManager=null,this.ds=!1,this.vs=[],this.cs=null,this._instance=i,this._surveyEventReceiver=null}initialize(){this.loadIfEnabled()}onRemoteConfig(i){if(!this._instance.config.disable_surveys){var e=i.surveys;if(O(e))return F.warn("Flags not loaded yet. Not loading surveys.");var t=$(e);this.hs=t?e.length>0:e,F.info("flags response received, isSurveysEnabled: "+this.hs),this.loadIfEnabled()}}reset(){localStorage.removeItem("lastSeenSurveyDate");for(var i=[],e=0;e<localStorage.length;e++){var t=localStorage.key(e);(t!=null&&t.startsWith(gn)||t!=null&&t.startsWith("inProgressSurvey_"))&&i.push(t)}i.forEach(r=>localStorage.removeItem(r))}loadIfEnabled(){if(!this._surveyManager)if(this.ds)F.info("Already initializing surveys, skipping...");else if(this._instance.config.disable_surveys)F.info("Disabled. Not loading surveys.");else if(this._instance.config.cookieless_mode&&this._instance.consent.isOptedOut())F.info("Not loading surveys in cookieless mode without consent.");else{var i=w==null?void 0:w.__PosthogExtensions__;if(i){if(!b(this.hs)||this._instance.config.advanced_enable_surveys){var e=this.hs||this._instance.config.advanced_enable_surveys;this.ds=!0;try{var t=i.generateSurveys;if(t)return void this.fs(t,e);var r=i.loadExternalDependency;if(!r)return void this.ps("PostHog loadExternalDependency extension not found.");r(this._instance,"surveys",s=>{s||!i.generateSurveys?this.ps("Could not load surveys script",s):this.fs(i.generateSurveys,e)})}catch(s){throw this.ps("Error initializing surveys",s),s}finally{this.ds=!1}}}else F.error("PostHog Extensions not found.")}}fs(i,e){this._surveyManager=i(this._instance,e),this._surveyEventReceiver=new Ra(this._instance),F.info("Surveys loaded successfully"),this._s({isLoaded:!0})}ps(i,e){F.error(i,e),this._s({isLoaded:!1,error:i})}onSurveysLoaded(i){return this.vs.push(i),this._surveyManager&&this._s({isLoaded:!0}),()=>{this.vs=this.vs.filter(e=>e!==i)}}getSurveys(i,e){if(e===void 0&&(e=!1),this._instance.config.disable_surveys)return F.info("Disabled. Not loading surveys."),i([]);var t,r=this._instance.get_property(qi);if(r&&!e)return i(r,{isLoaded:!0});typeof Promise<"u"&&this.cs?this.cs.then(s=>{var{surveys:n,context:o}=s;return i(n,o)}):(typeof Promise<"u"&&(this.cs=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.cs=null;var o=s.statusCode;if(o!==200||!s.json){var a="Surveys API could not be loaded, status: "+o;F.error(a);var l={isLoaded:!1,error:a};return i([],l),void(t==null||t({surveys:[],context:l}))}var u,c=s.json.surveys||[],h=c.filter(v=>function(g){return!(!g.start_date||g.end_date)}(v)&&(function(g){var _;return!((_=g.conditions)==null||(_=_.events)==null||(_=_.values)==null||!_.length)}(v)||function(g){var _;return!((_=g.conditions)==null||(_=_.actions)==null||(_=_.values)==null||!_.length)}(v)));h.length>0&&((u=this._surveyEventReceiver)==null||u.register(h)),(n=this._instance.persistence)==null||n.register({[qi]:c});var p={isLoaded:!0};i(c,p),t==null||t({surveys:c,context:p})}}))}_s(i){for(var e of this.vs)try{if(!i.isLoaded)return e([],i);this.getSurveys(e)}catch(t){F.error("Error in survey callback",t)}}getActiveMatchingSurveys(i,e){if(e===void 0&&(e=!1),!O(this._surveyManager))return this._surveyManager.getActiveMatchingSurveys(i,e);F.warn("init was not called")}gs(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}bs(i){if(O(this._surveyManager))return{eligible:!1,reason:"SDK is not enabled or survey functionality is not yet loaded"};var e=typeof i=="string"?this.gs(i):i;return e?this._surveyManager.checkSurveyEligibility(e):{eligible:!1,reason:"Survey not found"}}canRenderSurvey(i){if(O(this._surveyManager))return F.warn("init was not called"),{visible:!1,disabledReason:"SDK is not enabled or survey functionality is not yet loaded"};var e=this.bs(i);return{visible:e.eligible,disabledReason:e.reason}}canRenderSurveyAsync(i,e){return O(this._surveyManager)?(F.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(a=>a.id===i))!==null&&s!==void 0?s:null;if(n){var o=this.bs(n);t({visible:o.eligible,disabledReason:o.reason})}else t({visible:!1,disabledReason:"Survey not found"})},e)})}renderSurvey(i,e,t){var r;if(O(this._surveyManager))F.warn("init was not called");else{var s=typeof i=="string"?this.gs(i):i;if(s!=null&&s.id)if(aa.includes(s.type)){var n=m==null?void 0:m.querySelector(e);if(n)return(r=s.appearance)!=null&&r.surveyPopupDelaySeconds?(F.info("Rendering survey "+s.id+" with delay of "+s.appearance.surveyPopupDelaySeconds+" seconds"),void setTimeout(()=>{var o,a;F.info("Rendering survey "+s.id+" with delay of "+((o=s.appearance)==null?void 0:o.surveyPopupDelaySeconds)+" seconds"),(a=this._surveyManager)==null||a.renderSurvey(s,n,t),F.info("Survey "+s.id+" rendered")},1e3*s.appearance.surveyPopupDelaySeconds)):void this._surveyManager.renderSurvey(s,n,t);F.warn("Survey element not found")}else F.warn("Surveys of type "+s.type+" cannot be rendered in the app");else F.warn("Survey not found")}}displaySurvey(i,e){var t;if(O(this._surveyManager))F.warn("init was not called");else{var r=this.gs(i);if(r){var s=r;if((t=r.appearance)!=null&&t.surveyPopupDelaySeconds&&e.ignoreDelay&&(s=f({},r,{appearance:f({},r.appearance,{surveyPopupDelaySeconds:0})})),e.displayType!==Gi.Popover&&e.initialResponses&&F.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 F.warn("Survey is not eligible to be displayed: ",n.disabledReason)}e.displayType!==Gi.Inline?this._surveyManager.handlePopoverSurvey(s,e):this.renderSurvey(s,e.selector,e.properties)}else F.warn("Survey not found")}}cancelPendingSurvey(i){O(this._surveyManager)?F.warn("init was not called"):this._surveyManager.cancelSurvey(i)}handlePageUnload(){var i;(i=this._surveyManager)==null||i.handlePageUnload()}}},ai),Za={toolbar:class{constructor(i){this.instance=i}ys(i){w.ph_toolbar_state=i}ws(){var i;return(i=w.ph_toolbar_state)!==null&&i!==void 0?i:Re.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),Ws(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=Fa||Jt(i.hash,"__posthog")||Jt(i.hash,"state"),n=s?Or(()=>JSON.parse(atob(decodeURIComponent(s))))||Or(()=>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(vs)||"{}")).source="localstorage",delete r.userIntent),!(!r.token||this.instance.config.token!==r.token)&&(this.loadToolbar(r),!0)}catch{return!1}}Es(i){var e=w.ph_load_toolbar||w.ph_load_editor;!O(e)&&xe(e)?e(i,this.instance):_s.warn("No toolbar load function found")}loadToolbar(i){var e=!(m==null||!m.getElementById(Ks));if(!d||e)return!1;var t=this.instance.requestRouter.region==="custom"&&this.instance.config.advanced_disable_toolbar_metrics,r=f({token:this.instance.config.token},i,{apiURL:this.instance.requestRouter.endpointFor("ui")},t?{instrument:!1}:{});if(d.localStorage.setItem(vs,JSON.stringify(f({},r,{source:void 0}))),this.ws()===Re.LOADED)this.Es(r);else if(this.ws()===Re.UNINITIALIZED){var s;this.ys(Re.LOADING),(s=w.__PosthogExtensions__)==null||s.loadExternalDependency==null||s.loadExternalDependency(this.instance,"toolbar",n=>{if(n)return _s.error("[Toolbar] Failed to load",n),void this.ys(Re.UNINITIALIZED);this.ys(Re.LOADED),this.Es(r)}),j(d,"turbolinks:load",()=>{this.ys(Re.UNINITIALIZED),this.loadToolbar(r)})}return!0}xs(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)}}},Qa=f({experiments:z},ai),Ja={conversations:class{constructor(i){this.Ss=void 0,this._conversationsManager=null,this.$s=!1,this.ks=null,this._instance=i}initialize(){this.loadIfEnabled()}onRemoteConfig(i){if(!this._instance.config.disable_conversations){var e=i.conversations;O(e)||(Se(e)?this.Ss=e:(this.Ss=e.enabled,this.ks=e),this.loadIfEnabled())}}reset(){var i;(i=this._conversationsManager)==null||i.reset(),this._conversationsManager=null,this.Ss=void 0,this.ks=null}loadIfEnabled(){if(!(this._conversationsManager||this.$s||this._instance.config.disable_conversations||Ws(this._instance.config)||this._instance.config.cookieless_mode&&this._instance.consent.isOptedOut())){var i=w==null?void 0:w.__PosthogExtensions__;if(i&&!b(this.Ss)&&this.Ss)if(this.ks&&this.ks.token){this.$s=!0;try{var e=i.initConversations;if(e)return this.Ps(e),void(this.$s=!1);var t=i.loadExternalDependency;if(!t)return void this.Ts("PostHog loadExternalDependency extension not found.");t(this._instance,"conversations",r=>{r||!i.initConversations?this.Ts("Could not load conversations script",r):this.Ps(i.initConversations),this.$s=!1})}catch(r){this.Ts("Error initializing conversations",r),this.$s=!1}}else ne.error("Conversations enabled but missing token in remote config.")}}Ps(i){if(this.ks)try{this._conversationsManager=i(this.ks,this._instance),ne.info("Conversations loaded successfully")}catch(e){this.Ts("Error completing conversations initialization",e)}else ne.error("Cannot complete initialization: remote config is null")}Ts(i,e){ne.error(i,e),this._conversationsManager=null,this.$s=!1}show(){this._conversationsManager?this._conversationsManager.show():ne.warn("Conversations not loaded yet.")}hide(){this._conversationsManager&&this._conversationsManager.hide()}isAvailable(){return this.Ss===!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}}},el={logs:class{constructor(i){var e;this.Rs=!1,this.Is=!1,this._instance=i,this._instance&&(e=this._instance.config.logs)!=null&&e.captureConsoleLogs&&(this.Rs=!0)}initialize(){this.loadIfEnabled()}onRemoteConfig(i){var e,t=(e=i.logs)==null?void 0:e.captureConsoleLogs;!O(t)&&t&&(this.Rs=!0,this.loadIfEnabled())}reset(){}loadIfEnabled(){if(this.Rs&&!this.Is){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.Is=!0)}):i.error("PostHog loadExternalDependency extension not found.")}else i.error("PostHog Extensions not found.")}}}},tl=f({},ai,Ba,Wa,za,Ga,Ya,Xa,Ka,Za,Qa,Ja,el);ve.__defaultExtensionClasses=f({},tl);var ys,ul=(ys=St[Ke]=new ve,function(){function i(){i.done||(i.done=!0,fn=!1,M(St,function(e){e._dom_loaded()}))}m!=null&&m.addEventListener?m.readyState==="complete"?i():j(m,"DOMContentLoaded",i,{capture:!1}):d&&y.error("Browser doesn't support `document.addEventListener` so PostHog couldn't be initialized")}(),ys);export{Ee as Compression,ll as DEFAULT_PRODUCT_TOUR_APPEARANCE,Gi as DisplaySurveyType,ve as PostHog,Vo as ProductTourEventName,jr as ProductTourEventProperties,wt as SurveyEventName,fi as SurveyEventProperties,lt as SurveyEventType,rl as SurveyPosition,ol as SurveyQuestionBranchingType,nl as SurveyQuestionType,al as SurveySchedule,sl as SurveyTabPosition,gi as SurveyType,il as SurveyWidgetType,ul as default,ul as posthog,cl as severityLevels};
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.