PageSourceSearch

https://glbth.com/chunk-3PODDIIR.js

js glbth.com collected 2026-10-04 16:54:04 UTC 190,583 bytes, 2 lines download raw bytes

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

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.