PageSourceSearch

https://www.predictasearch.com/assets/module-S5PDfqT3.js

js predictasearch.com collected 2026-09-28 07:56:38 UTC 188,994 bytes, 2 lines download raw bytes

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

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.