PageSourceSearch

https://markwise.app/js/mw-events-DL4GPaTJ.js

js markwise.app collected 2026-09-24 13:43:49 UTC 195,279 bytes, 2 lines download raw bytes

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

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.