1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[8229],{26614:(e,t,i)=>{i.d(t,{Ay:()=>nm});var s="undefined"!=typeof window?window:void 0,r="undefined"!=typeof globalThis?globalThis:s;"undefined"==typeof self&&(r.self=r),"undefined"==typeof File&&(r.File=function(){});var n=Array.prototype,o=n.forEach,a=n.indexOf,l=null==r?void 0:r.navigator,c=null==r?void 0:r.document,u=null==r?void 0:r.location,h=null==r?void 0:r.fetch,d=null!=r&&r.XMLHttpRequest&&"withCredentials"in new r.XMLHttpRequest?r.XMLHttpRequest:void 0,p=null==r?void 0:r.AbortController,g=null==l?void 0:l.userAgent,_=null!=s?s:{},v={DEBUG:!1,LIB_VERSION:"1.324.1"};function f(e,t,i,s,r,n,o){try{var a=e[n](o),l=a.value}catch(e){return void i(e)}a.done?t(l):Promise.resolve(l).then(s,r)}function m(e){return function(){var t=this,i=arguments;return new Promise(function(s,r){var n=e.apply(t,i);function o(e){f(n,s,r,o,a,"next",e)}function a(e){f(n,s,r,o,a,"throw",e)}o(void 0)})}}function y(){return(y=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var i=arguments[t];for(var s in i)({}).hasOwnProperty.call(i,s)&&(e[s]=i[s])}return e}).apply(null,arguments)}function b(e,t){if(null==e)return{};var i={};for(var s in e)if(({}).hasOwnProperty.call(e,s)){if(-1!==t.indexOf(s))continue;i[s]=e[s]}return i}var w=["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"],E=function(e,t){if(void 0===t&&(t=[]),!e)return!1;var i=e.toLowerCase();return w.concat(t).some(e=>{var t=e.toLowerCase();return -1!==i.indexOf(t)})},x=["$snapshot","$pageview","$pageleave","$set","survey dismissed","survey sent","survey shown","$identify","$groupidentify","$create_alias","$$client_ingestion_warning","$web_experiment_applied","$feature_enrollment_update","$feature_flag_called"];function k(e,t){return -1!==e.indexOf(t)}var S=function(e){return e.trim()},P=function(e){return e.replace(/^\$/,"")},$=Array.isArray,R=Object.prototype,I=R.hasOwnProperty,F=R.toString,C=$||function(e){return"[object Array]"===F.call(e)},T=e=>"function"==typeof e,O=e=>e===Object(e)&&!C(e),M=e=>{if(O(e)){for(var t in e)if(I.call(e,t))return!1;return!0}return!1},A=e=>void 0===e,L=e=>"[object String]"==F.call(e),D=e=>L(e)&&0===e.trim().length,N=e=>null===e,j=e=>A(e)||N(e),H=e=>"[object Number]"==F.call(e)&&e==e,q=e=>H(e)&&e>0,U=e=>"[object Boolean]"===F.call(e),V=e=>k(x,e);function B(e){return null===e||"object"!=typeof e}function G(e,t){return Object.prototype.toString.call(e)==="[object "+t+"]"}function W(e){return!A(Event)&&function(e,t){try{return e instanceof t}catch(e){return!1}}(e,Event)}var z=[!0,"true",1,"1","yes"],Y=e=>k(z,e),X=[!1,"false",0,"0","no"];function K(e,t,i,s,r){return t>i&&(s.warn("min cannot be greater than max."),t=i),H(e)?e>i?(s.warn(" cannot be greater than max: "+i+". Using max value instead."),i):e<t?(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),K(r||i,t,i,s))}class J{constructor(e){this.t={},this.i=e.i,this.o=K(e.bucketSize,0,100,e.h),this.m=K(e.refillRate,0,this.o,e.h),this.$=K(e.refillInterval,0,864e5,e.h)}S(e,t){var i=Math.floor((t-e.lastAccess)/this.$);if(i>0){var s=i*this.m;e.tokens=Math.min(e.tokens+s,this.o),e.lastAccess=e.lastAccess+i*this.$}}consumeRateLimit(e){var t,i=Date.now(),s=String(e),r=this.t[s];return r?this.S(r,i):(r={tokens:this.o,lastAccess:i},this.t[s]=r),0===r.tokens||(r.tokens--,0===r.tokens&&(null==(t=this.i)||t.call(this,e)),0===r.tokens)}stop(){this.t={}}}var Z,Q,ee,et="Mobile",ei="Android",es="Tablet",er=ei+" "+es,en="iPad",eo="Apple",ea=eo+" Watch",el="Safari",ec="BlackBerry",eu="Samsung",eh=eu+"Browser",ed=eu+" Internet",ep="Chrome",eg=ep+" OS",e_=ep+" iOS",ev="Internet Explorer",ef=ev+" "+et,em="Opera",ey=em+" Mini",eb="Edge",ew="Microsoft "+eb,eE="Firefox",ex=eE+" iOS",ek="Nintendo",eS="PlayStation",eP="Xbox",e$=ei+" "+et,eR=et+" "+el,eI="Windows",eF=eI+" Phone",eC="Nokia",eT="Ouya",eO="Generic",eM=eO+" "+et.toLowerCase(),eA=eO+" "+es.toLowerCase(),eL="Konqueror",eD="(\\d+(\\.\\d+)?)",eN=RegExp("Version/"+eD),ej=RegExp(eP,"i"),eH=RegExp(eS+" \\w+","i"),eq=RegExp(ek+" \\w+","i"),eU=RegExp(ec+"|PlayBook|BB10","i"),eV={"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"},eB=function(e,t){let i;return t=t||"",k(e," OPR/")&&k(e,"Mini")?ey:k(e," OPR/")?em:eU.test(e)?ec:k(e,"IE"+et)||k(e,"WPDesktop")?ef:k(e,eh)?ed:k(e,eb)||k(e,"Edg/")?ew:k(e,"FBIOS")?"Facebook "+et:k(e,"UCWEB")||k(e,"UCBrowser")?"UC Browser":k(e,"CriOS")?e_:k(e,"CrMo")||k(e,ep)?ep:k(e,ei)&&k(e,el)?e$:k(e,"FxiOS")?ex:k(e.toLowerCase(),eL.toLowerCase())?eL:(i=t)&&k(i,eo)||k(e,el)&&!k(e,ep)&&!k(e,ei)?k(e,et)?eR:el:k(e,eE)?eE:k(e,"MSIE")||k(e,"Trident/")?ev:k(e,"Gecko")?eE:""},eG={[ef]:[RegExp("rv:"+eD)],[ew]:[RegExp(eb+"?\\/"+eD)],[ep]:[RegExp("("+ep+"|CrMo)\\/"+eD)],[e_]:[RegExp("CriOS\\/"+eD)],"UC Browser":[RegExp("(UCBrowser|UCWEB)\\/"+eD)],[el]:[eN],[eR]:[eN],[em]:[RegExp("(Opera|OPR)\\/"+eD)],[eE]:[RegExp(eE+"\\/"+eD)],[ex]:[RegExp("FxiOS\\/"+eD)],[eL]:[RegExp("Konqueror[:/]?"+eD,"i")],[ec]:[RegExp(ec+" "+eD),eN],[e$]:[RegExp("android\\s"+eD,"i")],[ed]:[RegExp(eh+"\\/"+eD)],[ev]:[RegExp("(rv:|MSIE )"+eD)],Mozilla:[RegExp("rv:"+eD)]},eW=function(e,t){var i=eG[eB(e,t)];if(A(i))return null;for(var s=0;s<i.length;s++){var r=i[s],n=e.match(r);if(n)return parseFloat(n[n.length-2])}return null},ez=[[RegExp(eP+"; "+eP+" (.*?)[);]","i"),e=>[eP,e&&e[1]||""]],[RegExp(ek,"i"),[ek,""]],[RegExp(eS,"i"),[eS,""]],[eU,[ec,""]],[RegExp(eI,"i"),(e,t)=>{if(/Phone/.test(t)||/WPDesktop/.test(t))return[eF,""];if(new RegExp(et).test(t)&&!/IEMobile\b/.test(t))return[eI+" "+et,""];var i=/Windows NT ([0-9.]+)/i.exec(t);if(i&&i[1]){var s=eV[i[1]]||"";return/arm/i.test(t)&&(s="RT"),[eI,s]}return[eI,""]}],[/((iPhone|iPad|iPod).*?OS (\d+)_(\d+)_?(\d+)?|iPhone)/,e=>e&&e[3]?["iOS",[e[3],e[4],e[5]||"0"].join(".")]:["iOS",""]],[/(watch.*\/(\d+\.\d+\.\d+)|watch os,(\d+\.\d+),)/i,e=>{var t="";return e&&e.length>=3&&(t=A(e[2])?e[3]:e[2]),["watchOS",t]}],[RegExp("("+ei+" (\\d+)\\.(\\d+)\\.?(\\d+)?|"+ei+")","i"),e=>e&&e[2]?[ei,[e[2],e[3],e[4]||"0"].join(".")]:[ei,""]],[/Mac OS X (\d+)[_.](\d+)[_.]?(\d+)?/i,e=>{var t=["Mac OS X",""];if(e&&e[1]){var i=[e[1],e[2],e[3]||"0"];t[1]=i.join(".")}return t}],[/Mac/i,["Mac OS X",""]],[/CrOS/,[eg,""]],[/Linux|debian/i,["Linux",""]]],eY=function(e){return eq.test(e)?ek:eH.test(e)?eS:ej.test(e)?eP:Reg
1Exp(eT,"i").test(e)?eT:RegExp("("+eF+"|WPDesktop)","i").test(e)?eF:/iPad/.test(e)?en:/iPod/.test(e)?"iPod Touch":/iPhone/.test(e)?"iPhone":/(watch)(?: ?os[,/]|\d,\d\/)[\d.]+/i.test(e)?ea:eU.test(e)?ec:/(kobo)\s(ereader|touch)/i.test(e)?"Kobo":RegExp(eC,"i").test(e)?eC:/(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(et).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)?ei:er:RegExp("(pda|"+et+")","i").test(e)?eM:RegExp(es,"i").test(e)&&!RegExp(es+" pc","i").test(e)?eA:""},eX=e=>e instanceof Error;class eK{constructor(e,t,i){void 0===i&&(i=[]),this.coercers=e,this.stackParser=t,this.modifiers=i}buildFromUnknown(e,t){void 0===t&&(t={});var i=t&&t.mechanism||{handled:!0,type:"generic"},s=this.buildCoercingContext(i,t,0).apply(e),r=this.buildParsingContext(),n=this.parseStacktrace(s,r);return{$exception_list:this.convertToExceptionList(n,i),$exception_level:"error"}}modifyFrames(e){var t=this;return m(function*(){for(var i of e)i.stacktrace&&i.stacktrace.frames&&C(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:null==(t=e.syntheticException)?void 0:t.stack,synthetic:!0}}parseStacktrace(e,t){var i,s;return null!=e.cause&&(i=this.parseStacktrace(e.cause,t)),""!=e.stack&&null!=e.stack&&(s=this.applyChunkIds(this.stackParser(e.stack,+!!e.synthetic),t.chunkIdMap)),y({},e,{cause:i,stack:s})}applyChunkIds(e,t){return e.map(e=>(e.filename&&t&&(e.chunk_id=t[e.filename]),e))}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 m(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:null!=(i=t.type)?i:"generic",handled:null==(s=t.handled)||s,synthetic:null!=(r=e.synthetic)&&r}};e.stack&&(n.stacktrace={type:"raw",frames:e.stack});var o=[n];return null!=e.cause&&o.push(...this.convertToExceptionList(e.cause,y({},t,{handled:!0}))),o}buildParsingContext(){return{chunkIdMap:function(e){var t=globalThis._posthogChunkIds;if(t){var i=Object.keys(t);return ee&&i.length===Q||(Q=i.length,ee=i.reduce((i,s)=>{Z||(Z={});var r=Z[s];if(r)i[r[0]]=r[1];else for(var n=e(s),o=n.length-1;o>=0;o--){var a=n[o],l=null==a?void 0:a.filename,c=t[s];if(l&&c){i[l]=c,Z[s]=[l,c];break}}return i},{})),ee}}(this.stackParser)}}buildCoercingContext(e,t,i){void 0===i&&(i=0);var s=(i,s)=>{if(s<=4){var r=this.buildCoercingContext(e,t,s);return this.applyCoercers(i,r)}};return y({},t,{syntheticException:0==i?t.syntheticException:void 0,mechanism:e,apply:e=>s(e,i),next:e=>s(e,i+1)})}}function eJ(e,t,i,s,r){var n={platform:e,filename:t,function:"<anonymous>"===i?"?":i,in_app:!0};return A(s)||(n.lineno=s),A(r)||(n.colno=r),n}var eZ=(e,t)=>{var i=-1!==e.indexOf("safari-extension"),s=-1!==e.indexOf("safari-web-extension");return i||s?[-1!==e.indexOf("@")?e.split("@")[0]:"?",i?"safari-extension:"+t:"safari-web-extension:"+t]:[e,t]},eQ=/^\s*at (\S+?)(?::(\d+))(?::(\d+))\s*$/i,e0=/^\s*at (?:(.+?\)(?: \[.+\])?|.*?) ?\((?:address at )?)?(?:async )?((?:<anonymous>|[-a-z]+:|.*bundle|\/)?.*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i,e1=/\((\S*)(?::(\d+))(?::(\d+))\)/,e2=(e,t)=>{var i=eQ.exec(e);if(i){var[,s,r,n]=i;return eJ(t,s,"?",+r,+n)}var o=e0.exec(e);if(o){if(o[2]&&0===o[2].indexOf("eval")){var a=e1.exec(o[2]);a&&(o[2]=a[1],o[3]=a[2],o[4]=a[3])}var[l,c]=eZ(o[1]||"?",o[2]);return eJ(t,c,l,o[3]?+o[3]:void 0,o[4]?+o[4]:void 0)}},e3=/^\s*(.*?)(?:\((.*?)\))?(?:^|@)?((?:[-a-z]+)?:\/.*?|\[native code\]|[^@]*(?:bundle|\d+\.js)|\/[\w\-. /=]+)(?::(\d+))?(?::(\d+))?\s*$/i,e5=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i,e8=(e,t)=>{var i=e3.exec(e);if(i){if(i[3]&&i[3].indexOf(" > eval")>-1){var s=e5.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]||"?";return[n,r]=eZ(n,r),eJ(t,r,n,i[4]?+i[4]:void 0,i[5]?+i[5]:void 0)}},e6=/\(error: (.*)\)/;class e4{match(e){return this.isDOMException(e)||this.isDOMError(e)}coerce(e,t){var i=L(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 G(e,"DOMException")}isDOMError(e){return G(e,"DOMError")}}class e7{match(e){return e instanceof Error}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 i.error&&"string"==typeof i.error.message?String(i.error.message):String(i)}getStack(e){return e.stacktrace||e.stack||void 0}}class e9{constructor(){}match(e){return G(e,"ErrorEvent")&&null!=e.error}coerce(e,t){var i;return t.apply(e.error)||{type:"ErrorEvent",value:e.message,stack:null==(i=t.syntheticException)?void 0:i.stack,synthetic:!0}}}var te=/^(?:[Uu]ncaught (?:exception: )?)?(?:((?:Eval|Internal|Range|Reference|Syntax|Type|URI|)Error): )?(.*)$/i;class tt{match(e){return"string"==typeof e}coerce(e,t){var i,[s,r]=this.getInfos(e);return{type:null!=s?s:"Error",value:null!=r?r:e,stack:null==(i=t.syntheticException)?void 0:i.stack,synthetic:!0}}getInfos(e){var t="Error",i=e,s=e.match(te);return s&&(t=s[1],i=s[2]),[t,i]}}var ti=["fatal","error","warning","log","info","debug"];function ts(e,t){void 0===t&&(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(", ");
1if(!(r.length>t))return s===i.length||r.length<=t?r:r.slice(0,t)+"..."}return""}class tr{match(e){return"object"==typeof e&&null!==e}coerce(e,t){var i,s=this.getErrorPropertyFromObject(e);return s?t.apply(s):{type:this.getType(e),value:this.getValue(e),stack:null==(i=t.syntheticException)?void 0:i.stack,level:this.isSeverityLevel(e.level)?e.level:"error",synthetic:!0}}getType(e){return W(e)?e.constructor.name:"Error"}getValue(e){if("name"in e&&"string"==typeof e.name){var t="'"+e.name+"' captured as exception";return"message"in e&&"string"==typeof e.message&&(t+=" with message: '"+e.message+"'"),t}if("message"in e&&"string"==typeof e.message)return e.message;var i=this.getObjectClassName(e);return(i&&"Object"!==i?"'"+i+"'":"Object")+" captured as exception with keys: "+ts(e)}isSeverityLevel(e){return L(e)&&!D(e)&&ti.indexOf(e)>=0}getErrorPropertyFromObject(e){for(var t in e)if(Object.prototype.hasOwnProperty.call(e,t)){var i=e[t];if(eX(i))return i}}getObjectClassName(e){try{var t=Object.getPrototypeOf(e);return t?t.constructor.name:void 0}catch(e){return}}}class tn{match(e){return W(e)}coerce(e,t){var i,s=e.constructor.name;return{type:s,value:s+" captured as exception with keys: "+ts(e),stack:null==(i=t.syntheticException)?void 0:i.stack,synthetic:!0}}}class to{match(e){return B(e)}coerce(e,t){var i;return{type:"Error",value:"Primitive value captured as exception: "+String(e),stack:null==(i=t.syntheticException)?void 0:i.stack,synthetic:!0}}}class ta{match(e){return G(e,"PromiseRejectionEvent")}coerce(e,t){var i,s=this.getUnhandledRejectionReason(e);return B(s)?{type:"UnhandledRejection",value:"Non-Error promise rejection captured with value: "+String(s),stack:null==(i=t.syntheticException)?void 0:i.stack,synthetic:!0}:t.apply(s)}getUnhandledRejectionReason(e){if(B(e))return e;try{if("reason"in e)return e.reason;if("detail"in e&&"reason"in e.detail)return e.detail.reason}catch(e){}return e}}var tl=function(e,t){var{debugEnabled:i}=void 0===t?{}:t,r={k:function(t){if(s&&(v.DEBUG||_.POSTHOG_DEBUG||i)&&!A(s.console)&&s.console){for(var r=("__rrweb_original__"in s.console[t])?s.console[t].__rrweb_original__:s.console[t],n=arguments.length,o=Array(n>1?n-1:0),a=1;a<n;a++)o[a-1]=arguments[a];r(e,...o)}},info:function(){for(var e=arguments.length,t=Array(e),i=0;i<e;i++)t[i]=arguments[i];r.k("log",...t)},warn:function(){for(var e=arguments.length,t=Array(e),i=0;i<e;i++)t[i]=arguments[i];r.k("warn",...t)},error:function(){for(var e=arguments.length,t=Array(e),i=0;i<e;i++)t[i]=arguments[i];r.k("error",...t)},critical:function(){for(var t=arguments.length,i=Array(t),s=0;s<t;s++)i[s]=arguments[s];console.error(e,...i)},uninitializedWarning:e=>{r.error("You must initialize PostHog before calling "+e)},createLogger:(t,i)=>tl(e+" "+t,i)};return r},tc=tl("[PostHog.js]"),tu=tc.createLogger,th=tu("[ExternalScriptsLoader]"),td=(e,t,i)=>{if(e.config.disable_external_dependency_loading)return th.warn(t+" was requested but loading of external scripts is disabled."),i("Loading of external scripts is disabled");var s=null==c?void 0:c.querySelectorAll("script");if(s){for(var r,n=0;n<s.length;n++)if(r=function(){if(s[n].src===t){var e=s[n];return e.__posthog_loading_callback_fired?{v:i()}:(e.addEventListener("load",t=>{e.__posthog_loading_callback_fired=!0,i(void 0,t)}),e.onerror=e=>i(e),{v:void 0})}}())return r.v}var o=()=>{if(!c)return i("document not found");var s=c.createElement("script");if(s.type="text/javascript",s.crossOrigin="anonymous",s.src=t,s.onload=e=>{s.__posthog_loading_callback_fired=!0,i(void 0,e)},s.onerror=e=>i(e),e.config.prepare_external_dependency_script&&(s=e.config.prepare_external_dependency_script(s)),!s)return i("prepare_external_dependency_script returned null");var r,n=c.querySelectorAll("body > script");n.length>0?null==(r=n[0].parentNode)||r.insertBefore(s,n[0]):c.body.appendChild(s)};null!=c&&c.body?o():null==c||c.addEventListener("DOMContentLoaded",o)};_.__PosthogExtensions__=_.__PosthogExtensions__||{},_.__PosthogExtensions__.loadExternalDependency=(e,t,i)=>{var s="/static/"+t+".js?v="+e.version;"remote-config"===t&&(s="/array/"+e.config.token+"/config.js"),"toolbar"===t&&(s=s+"&t="+3e5*Math.floor(Date.now()/3e5));var r=e.requestRouter.endpointFor("assets",s);td(e,r,i)},_.__PosthogExtensions__.loadSiteApp=(e,t,i)=>{var s=e.requestRouter.endpointFor("api",t);td(e,s,i)};var tp={};function tg(e,t,i){if(C(e)){if(o&&e.forEach===o)e.forEach(t,i);else if("length"in e&&e.length===+e.length){for(var s=0,r=e.length;s<r;s++)if(s in e&&t.call(i,e[s],s)===tp)return}}}function t_(e,t,i){if(!j(e)){if(C(e))return tg(e,t,i);if(e instanceof FormData){for(var s of e.entries())if(t.call(i,s[1],s[0])===tp)return}else for(var r in e)if(I.call(e,r)&&t.call(i,e[r],r)===tp)return}}var tv=function(e){for(var t=arguments.length,i=Array(t>1?t-1:0),s=1;s<t;s++)i[s-1]=arguments[s];return tg(i,function(t){for(var i in t)void 0!==t[i]&&(e[i]=t[i])}),e},tf=function(e){for(var t=arguments.length,i=Array(t>1?t-1:0),s=1;s<t;s++)i[s-1]=arguments[s];return tg(i,function(t){tg(t,function(t){e.push(t)})}),e};function tm(e){for(var t=Object.keys(e),i=t.length,s=Array(i);i--;)s[i]=[t[i],e[t[i]]];return s}var ty=function(e){try{return e()}catch(e){return}},tb=function(e){return function(){try{for(var t=arguments.length,i=Array(t),s=0;s<t;s++)i[s]=arguments[s];return e.apply(this,i)}catch(e){tc.critical("Implementation error. Please turn on debug mode and open a ticket on https://app.posthog.com/home#panel=support%3Asupport%3A."),tc.critical(e)}}},tw=function(e){var t={};return t_(e,function(e,i){(L(e)&&e.length>0||H(e))&&(t[i]=e)}),t},tE=["herokuapp.com","vercel.app","netlify.app"];function tx(e,t){for(var i=0;i<e.length;i++)if(t(e[i]))return e[i]}function tk(e,t,i,s){var{capture:r=!1,passive:n=!0}=null!=s?s:{};null==e||e.addEventListener(t,i,{capture:r,passive:n})}var tS="$people_distinct_id",tP="__alias",t$="__timers",tR="$autocapture_disabled_server_side",tI="$heatmaps_enabled_server_side",tF="$exception_capture_enabled_server_side",tC="$error_tracking_suppression_rules",tT="$error_tracking_capture_extension_exceptions",tO="$web_vitals_enabled_server_side",tM="$dead_clicks_enabled_server_side",tA="$product_tours_enabled_server_side",tL="$web_vitals_allowed_metrics",tD="$session_recording_remote_config",tN="$sesid",tj="$session_is_sampled",tH="$enabled_feature_flags",tq="$early_access_features",tU="$feature_flag_details",tV="$stored_person_properties",tB="$stored_group_properties",tG="$surveys",tW="$flag_call_reported",tz="$user_state",tY="$client_session_props",tX="$capture_rate_limit",tK="$initial_campaign_params",tJ="$initial_referrer_info",tZ="$initial_person_info",tQ="$epp",t0="__POSTHOG_TOOLBAR__",t1="$posthog_cookieless",t2=[tS,tP,"__cmpns",t$,"$session_recording_enabled_server_side",tI,tN,tH,tC,tz,tq,tU,tB,tV,tG,tW,tY,tX,tK,tJ,tQ,tZ,"$conversations_widget_session_id","$conversations_ticket_id","$conversations_widget_state","$conversations_user_traits"];function t3(e){return e instanceof Element&&(e.id===t0||!(null==e.closest||!e.closest(".toolbar-global-fade-container")))}function t5(e){return!!e&&1===e.nodeType}function t8(e,t){return!!e&&!!e.tagName&&e.tagName.toLowerCase()===t.toLowerCase()}
1function t6(e){return!!e&&3===e.nodeType}function t4(e){return!!e&&11===e.nodeType}function t7(e){return e?S(e).split(/\s+/):[]}function t9(e){var t=null==s?void 0:s.location.href;return!!(t&&e&&e.some(e=>t.match(e)))}function ie(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 t7(t)}function it(e){return j(e)?null:S(e).split(/(\s+)/).filter(e=>iw(e)).join("").replace(/[\r\n]/g," ").replace(/[ ]+/g," ").substring(0,255)}function ii(e){var t="";return id(e)&&!ip(e)&&e.childNodes&&e.childNodes.length&&t_(e.childNodes,function(e){var i;t6(e)&&e.textContent&&(t+=null!=(i=it(e.textContent))?i:"")}),S(t)}function is(e){var t;return A(e.target)?e.srcElement||null:null!=(t=e.target)&&t.shadowRoot?e.composedPath()[0]||null:e.target||null}var ir=["a","button","form","input","select","textarea","label"];function io(e,t){if(A(t))return!0;var i,s=function(e){if(t.some(t=>e.matches(t)))return{v:!0}};for(var r of e)if(i=s(r))return i.v;return!1}function ia(e){var t=e.parentNode;return!(!t||!t5(t))&&t}var il=["next","previous","prev",">","<"],ic=[".ph-no-rageclick",".ph-no-capture"],iu=e=>!e||t8(e,"html")||!t5(e),ih=(e,t)=>{if(!s||iu(e))return{parentIsUsefulElement:!1,targetElementList:[]};for(var i=!1,r=[e],n=e;n.parentNode&&!t8(n,"body");)if(t4(n.parentNode))r.push(n.parentNode.host),n=n.parentNode.host;else{var o=ia(n);if(!o)break;if(t||ir.indexOf(o.tagName.toLowerCase())>-1)i=!0;else{var a=s.getComputedStyle(o);a&&"pointer"===a.getPropertyValue("cursor")&&(i=!0)}r.push(o),n=o}return{parentIsUsefulElement:i,targetElementList:r}};function id(e){for(var t=e;t.parentNode&&!t8(t,"body");t=t.parentNode){var i=ie(t);if(k(i,"ph-sensitive")||k(i,"ph-no-capture"))return!1}if(k(ie(e),"ph-include"))return!0;var s=e.type||"";if(L(s))switch(s.toLowerCase()){case"hidden":case"password":return!1}var r=e.name||e.id||"";return!(L(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 ip(e){return!!(t8(e,"input")&&!["button","checkbox","submit","reset"].includes(e.type)||t8(e,"select")||t8(e,"textarea")||"true"===e.getAttribute("contenteditable"))}var ig="(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})",i_=RegExp("^(?:"+ig+")$"),iv=new RegExp(ig),im="\\d{3}-?\\d{2}-?\\d{4}",iy=RegExp("^("+im+")$"),ib=RegExp("("+im+")");function iw(e,t){return void 0===t&&(t=!0),!(j(e)||L(e)&&(e=S(e),(t?i_:iv).test((e||"").replace(/[- ]/g,""))||(t?iy:ib).test(e)))&&!0}function iE(e){var t=ii(e);return iw(t=(t+" "+function e(t){var i="";return t&&t.childNodes&&t.childNodes.length&&t_(t.childNodes,function(t){var s;if(t&&"span"===(null==(s=t.tagName)?void 0:s.toLowerCase()))try{var r=ii(t);i=(i+" "+r).trim(),t.childNodes&&t.childNodes.length&&(i=(i+" "+e(t)).trim())}catch(e){tc.error("[AutoCapture]",e)}}),i}(e)).trim())?t:""}function ix(e){return e.replace(/"|\\"/g,'\\"')}class ik{constructor(e){this.disabled=!1===e;var t=O(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&&i-s.timestamp<this.timeoutMs){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}}var iS=e=>{var t=null==c?void 0:c.createElement("a");return A(t)?null:(t.href=e,t)},iP=function(e,t){void 0===t&&(t="&");var i,s,r=[];return t_(e,function(e,t){A(e)||A(t)||"undefined"===t||(i=encodeURIComponent(e instanceof File?e.name:e.toString()),s=encodeURIComponent(t),r[r.length]=s+"="+i)}),r.join(t)},i$=function(e,t){for(var i,s=((e.split("#")[0]||"").split(/\?(.*)/)[1]||"").replace(/^\?+/g,"").split("&"),r=0;r<s.length;r++){var n=s[r].split("=");if(n[0]===t){i=n;break}}if(!C(i)||i.length<2)return"";var o=i[1];try{o=decodeURIComponent(o)}catch(e){tc.error("Skipping decoding for malformed query param: "+o)}return o.replace(/\+/g," ")},iR=function(e,t,i){if(!e||!t||!t.length)return e;for(var s=e.split("#"),r=s[0]||"",n=s[1],o=r.split("?"),a=o[1],l=o[0],c=(a||"").split("&"),u=[],h=0;h<c.length;h++){var d=c[h].split("=");C(d)&&(t.includes(d[0])?u.push(d[0]+"="+i):u.push(c[h]))}var p=l;return null!=a&&(p+="?"+u.join("&")),null!=n&&(p+="#"+n),p},iI=function(e,t){var i=e.match(RegExp(t+"=([^&]*)"));return i?i[1]:null},iF="$copy_autocapture",iC=tu("[AutoCapture]");function iT(e,t){return t.length>e?t.slice(0,e)+"...":t}class iO{constructor(e){this.P=!1,this.T=null,this.I=!1,this.instance=e,this.rageclicks=new ik(e.config.rageclick),this.C=null}get R(){var e,t,i=O(this.instance.config.autocapture)?this.instance.config.autocapture:{};return i.url_allowlist=null==(e=i.url_allowlist)?void 0:e.map(e=>new RegExp(e)),i.url_ignorelist=null==(t=i.url_ignorelist)?void 0:t.map(e=>new RegExp(e)),i}
1F(){if(this.isBrowserSupported()){if(s&&c){var e=e=>{e=e||(null==s?void 0:s.event);try{this.M(e)}catch(e){iC.error("Failed to capture event",e)}};if(tk(c,"submit",e,{capture:!0}),tk(c,"change",e,{capture:!0}),tk(c,"click",e,{capture:!0}),this.R.capture_copied_text){var t=e=>{e=e||(null==s?void 0:s.event),this.M(e,iF)};tk(c,"copy",t,{capture:!0}),tk(c,"cut",t,{capture:!0})}}}else iC.info("Disabling Automatic Event Collection because this browser is not supported")}startIfEnabled(){this.isEnabled&&!this.P&&(this.F(),this.P=!0)}onRemoteConfig(e){e.elementsChainAsString&&(this.I=e.elementsChainAsString),this.instance.persistence&&this.instance.persistence.register({[tR]:!!e.autocapture_opt_out}),this.T=!!e.autocapture_opt_out,this.startIfEnabled()}setElementSelectors(e){this.C=e}getElementSelectors(e){var t,i=[];return null==(t=this.C)||t.forEach(t=>{var s=null==c?void 0:c.querySelectorAll(t);null==s||s.forEach(s=>{e===s&&i.push(t)})}),i}get isEnabled(){var e,t,i=null==(e=this.instance.persistence)?void 0:e.props[tR];if(N(this.T)&&!U(i)&&!this.instance.O())return!1;var s=null!=(t=this.T)?t:!!i;return!!this.instance.config.autocapture&&!s}M(e,t){if(void 0===t&&(t="$autocapture"),this.isEnabled){var i,r=is(e);t6(r)&&(r=r.parentNode||null),"$autocapture"===t&&"click"===e.type&&e instanceof MouseEvent&&this.instance.config.rageclick&&null!=(i=this.rageclicks)&&i.isRageClick(e.clientX,e.clientY,e.timeStamp||(new Date).getTime())&&function(e,t){if(!s||iu(e)||(U(t)?(i=!!t&&ic,r=void 0):(i=null!=(n=null==t?void 0:t.css_selector_ignorelist)?n:ic,r=null==t?void 0:t.content_ignorelist),!1===i))return!1;var i,r,n,{targetElementList:o}=ih(e,!1);return!function(e,t){var i;if(!1===e||A(e))return!1;if(!0===e)i=il;else{if(!C(e))return!1;if(e.length>10)return tc.error("[PostHog] content_ignorelist array cannot exceed 10 items. Use css_selector_ignorelist for more complex matching."),!1;i=e.map(e=>e.toLowerCase())}return t.some(e=>{var{safeText:t,ariaLabel:s}=e;return i.some(e=>t.includes(e)||s.includes(e))})}(r,o.map(e=>{var t;return{safeText:ii(e).toLowerCase(),ariaLabel:(null==(t=e.getAttribute("aria-label"))?void 0:t.toLowerCase().trim())||""}}))&&!io(o,i)}(r,this.instance.config.rageclick)&&this.M(e,"$rageclick");var n=t===iF;if(r&&function(e,t,i,r,n){if(void 0===i&&(i=void 0),!s||iu(e)||null!=(o=i)&&o.url_allowlist&&!t9(i.url_allowlist)||null!=(a=i)&&a.url_ignorelist&&t9(i.url_ignorelist))return!1;if(null!=(l=i)&&l.dom_event_allowlist){var o,a,l,c,u=i.dom_event_allowlist;if(u&&!u.some(e=>t.type===e))return!1}var{parentIsUsefulElement:h,targetElementList:d}=ih(e,r);if(!function(e,t){var i=null==t?void 0:t.element_allowlist;if(A(i))return!0;var s,r=function(e){if(i.some(t=>e.tagName.toLowerCase()===t))return{v:!0}};for(var n of e)if(s=r(n))return s.v;return!1}(d,i)||!io(d,null==(c=i)?void 0:c.css_selector_allowlist))return!1;var p=s.getComputedStyle(e);if(p&&"pointer"===p.getPropertyValue("cursor")&&"click"===t.type)return!0;var g=e.tagName.toLowerCase();switch(g){case"html":return!1;case"form":return(n||["submit"]).indexOf(t.type)>=0;case"input":case"select":case"textarea":return(n||["change","click"]).indexOf(t.type)>=0;default:return h?(n||["click"]).indexOf(t.type)>=0:(n||["click"]).indexOf(t.type)>=0&&(ir.indexOf(g)>-1||"true"===e.getAttribute("contenteditable"))}}(r,e,this.R,n,n?["copy","cut"]:void 0)){var{props:o,explicitNoCapture:a}=function(e,t){for(var i,r,{e:n,maskAllElementAttributes:o,maskAllText:a,elementAttributeIgnoreList:l,elementsChainAsString:c}=t,u=[e],h=e;h.parentNode&&!t8(h,"body");)t4(h.parentNode)?(u.push(h.parentNode.host),h=h.parentNode.host):(u.push(h.parentNode),h=h.parentNode);var d,p=[],g={},_=!1,v=!1;if(t_(u,e=>{var t=id(e);"a"===e.tagName.toLowerCase()&&(_=e.getAttribute("href"),_=t&&_&&iw(_)&&_),k(ie(e),"ph-no-capture")&&(v=!0),p.push(function(e,t,i,s){var r=e.tagName.toLowerCase(),n={tag_name:r};ir.indexOf(r)>-1&&!i&&("a"===r.toLowerCase()||"button"===r.toLowerCase()?n.$el_text=iT(1024,iE(e)):n.$el_text=iT(1024,ii(e)));var o=ie(e);o.length>0&&(n.classes=o.filter(function(e){return""!==e})),t_(e.attributes,function(i){var r;if((!ip(e)||-1!==["name","id","class","aria-label"].indexOf(i.name))&&(null==s||!s.includes(i.name))&&
1!t&&iw(i.value)&&(!L(r=i.name)||"_ngcontent"!==r.substring(0,10)&&"_nghost"!==r.substring(0,7))){var o=i.value;"class"===i.name&&(o=t7(o).join(" ")),n["attr__"+i.name]=iT(1024,o)}});for(var a=1,l=1,c=e;c=function(e){if(e.previousElementSibling)return e.previousElementSibling;var t=e;do t=t.previousSibling;while(t&&!t5(t));return t}(c);)a++,c.tagName===e.tagName&&l++;return n.nth_child=a,n.nth_of_type=l,n}(e,o,a,l)),tv(g,function(e){if(!id(e))return{};var t={};return t_(e.attributes,function(e){if(e.name&&0===e.name.indexOf("data-ph-capture-attribute")){var i=e.name.replace("data-ph-capture-attribute-",""),s=e.value;i&&s&&iw(s)&&(t[i]=s)}}),t}(e))}),v)return{props:{},explicitNoCapture:v};if(a||("a"===e.tagName.toLowerCase()||"button"===e.tagName.toLowerCase()?p[0].$el_text=iE(e):p[0].$el_text=ii(e)),_){p[0].attr__href=_;var f,m,b=null==(f=iS(_))?void 0:f.host,w=null==s||null==(m=s.location)?void 0:m.host;b&&w&&b!==w&&(d=_)}return{props:tv({$event_type:n.type,$ce_version:1},c?{}:{$elements:p},{$elements_chain:p.map(e=>{var t,i,s,r={text:null==(i=e.$el_text)?void 0:i.slice(0,400),tag_name:e.tag_name,href:null==(s=e.attr__href)?void 0:s.slice(0,2048),attr_class:(t=e.attr__class)?C(t)?t:t7(t):void 0,attr_id:e.attr__id,nth_child:e.nth_child,nth_of_type:e.nth_of_type,attributes:{}};return tm(e).filter(e=>{var[t]=e;return 0===t.indexOf("attr__")}).forEach(e=>{var[t,i]=e;return r.attributes[t]=i}),r}).map(e=>{var t,i,s="";if(e.tag_name&&(s+=e.tag_name),e.attr_class)for(var r of(e.attr_class.sort(),e.attr_class))s+="."+r.replace(/"/g,"");var n=y({},e.text?{text:e.text}:{},{"nth-child":null!=(t=e.nth_child)?t:0,"nth-of-type":null!=(i=e.nth_of_type)?i:0},e.href?{href:e.href}:{},e.attr_id?{attr_id:e.attr_id}:{},e.attributes),o={};return tm(n).sort((e,t)=>{var[i]=e,[s]=t;return i.localeCompare(s)}).forEach(e=>{var[t,i]=e;return o[ix(t.toString())]=ix(i.toString())}),s+=":",s+=tm(o).map(e=>{var[t,i]=e;return t+'="'+i+'"'}).join("")}).join(";")},null!=(i=p[0])&&i.$el_text?{$el_text:null==(r=p[0])?void 0:r.$el_text}:{},d&&"click"===n.type?{$external_click_url:d}:{},g)}}(r,{e:e,maskAllElementAttributes:this.instance.config.mask_all_element_attributes,maskAllText:this.instance.config.mask_all_text,elementAttributeIgnoreList:this.R.element_attribute_ignorelist,elementsChainAsString:this.I});if(a)return!1;var l=this.getElementSelectors(r);if(l&&l.length>0&&(o.$element_selectors=l),t===iF){var c,u=it(null==s||null==(c=s.get
1Selection())?void 0:c.toString()),h=e.type||"clipboard";if(!u)return!1;o.$selected_content=u,o.$copy_type=h}return this.instance.capture(t,o),!0}}}isBrowserSupported(){return T(null==c?void 0:c.querySelectorAll)}}Math.trunc||(Math.trunc=function(e){return e<0?Math.ceil(e):Math.floor(e)}),Number.isInteger||(Number.isInteger=function(e){return H(e)&&isFinite(e)&&Math.floor(e)===e});var iM="0123456789abcdef";class iA{constructor(e){if(this.bytes=e,16!==e.length)throw TypeError("not 128-bit length")}static fromFieldsV7(e,t,i,s){if(!Number.isInteger(e)||!Number.isInteger(t)||!Number.isInteger(i)||!Number.isInteger(s)||e<0||t<0||i<0||s<0||e>0xffffffffffff||t>4095||i>0x3fffffff||s>0xffffffff)throw RangeError("invalid field value");var r=new Uint8Array(16);return r[0]=e/0x10000000000,r[1]=e/0x100000000,r[2]=e/0x1000000,r[3]=e/65536,r[4]=e/256,r[5]=e,r[6]=112|t>>>8,r[7]=t,r[8]=128|i>>>24,r[9]=i>>>16,r[10]=i>>>8,r[11]=i,r[12]=s>>>24,r[13]=s>>>16,r[14]=s>>>8,r[15]=s,new iA(r)}toString(){for(var e="",t=0;t<this.bytes.length;t++)e=e+iM.charAt(this.bytes[t]>>>4)+iM.charAt(15&this.bytes[t]),3!==t&&5!==t&&7!==t&&9!==t||(e+="-");if(36!==e.length)throw Error("Invalid UUIDv7 was generated");return e}clone(){return new iA(this.bytes.slice(0))}equals(e){return 0===this.compareTo(e)}compareTo(e){for(var t=0;t<16;t++){var i=this.bytes[t]-e.bytes[t];if(0!==i)return Math.sign(i)}return 0}}class iL{constructor(){this.A=0,this.D=0,this.j=new ij}generate(){var e=this.generateOrAbort();if(A(e)){this.A=0;var t=this.generateOrAbort();if(A(t))throw Error("Could not generate UUID after timestamp reset");return t}return e}generateOrAbort(){var e=Date.now();if(e>this.A)this.A=e,this.L();else{if(!(e+1e4>this.A))return;this.D++,this.D>0x3ffffffffff&&(this.A++,this.L())}return iA.fromFieldsV7(this.A,Math.trunc(this.D/0x40000000),0x3fffffff&this.D,this.j.nextUint32())}L(){this.D=1024*this.j.nextUint32()+(1023&this.j.nextUint32())}}var iD,iN=e=>{if("undefined"!=typeof UUIDV7_DENY_WEAK_RNG&&UUIDV7_DENY_WEAK_RNG)throw Error("no cryptographically strong RNG available");for(var t=0;t<e.length;t++)e[t]=65536*Math.trunc(65536*Math.random())+Math.trunc(65536*Math.random());return e};s&&!A(s.crypto)&&crypto.getRandomValues&&(iN=e=>crypto.getRandomValues(e));class ij{constructor(){this.N=new Uint32Array(8),this.U=1/0}nextUint32(){return this.U>=this.N.length&&(iN(this.N),this.U=0),this.N[this.U++]}}var iH=()=>iq().toString(),iq=()=>(iD||(iD=new iL)).generate(),iU="",iV=/[a-z0-9][a-z0-9-]+\.[a-z]{2,}$/i,iB={H:()=>!!c,B:function(e){tc.error("cookieStore error: "+e)},q:function(e){if(c){try{for(var t=e+"=",i=c.cookie.split(";").filter(e=>e.length),s=0;s<i.length;s++){for(var r=i[s];" "==r.charAt(0);)r=r.substring(1,r.length);if(0===r.indexOf(t))return decodeURIComponent(r.substring(t.length,r.length))}}catch(e){}return null}},W:function(e){var t;try{t=JSON.parse(iB.q(e))||{}}catch(e){}return t},G:function(e,t,i,s,r){if(c)try{var n="",o="",a=function(e,t){if(t){var i=function(e,t){if(void 0===t&&(t=c),iU)return iU;if(!t||["localhost","127.0.0.1"].includes(e))return"";for(var i=e.split("."),s=Math.min(i.length,8),r="dmn_chk_"+iH();!iU&&s--;){var n=i.slice(s).join("."),o=r+"=1;domain=."+n+";path=/";t.cookie=o+";max-age=3",t.cookie.includes(r)&&(t.cookie=o+";max-age=0",iU=n)}return iU}(e);if(!i){var s,r=(s=e.match(iV))?s[0]:"";r!==i&&tc.info("Warning: cookie subdomain discovery mismatch",r,i),i=r}return i?"; domain=."+i:""}return""}(c.location.hostname,s);if(i){var l=new Date;l.setTime(l.getTime()+24*i*36e5),n="; expires="+l.toUTCString()}r&&(o="; secure");var u=e+"="+encodeURIComponent(JSON.stringify(t))+n+"; SameSite=Lax; path=/"+a+o;return u.length>3686.4&&tc.warn("cookieStore warning: large cookie, len="+u.length),c.cookie=u,u}catch(e){return}},V:function(e,t){if(null!=c&&c.cookie)try{iB.G(e,"",-1,t)}catch(e){return}}},iG=null,iW={H:function(){if(!N(iG))return iG;var e=!0;if(A(s))e=!1;else try{var t="__mplssupport__";iW.G(t,"xyz"),'"xyz"'!==iW.q(t)&&(e=!1),iW.V(t)}catch(t){e=!1}return e||tc.error("localStorage unsupported; falling back to cookie store"),iG=e,e},B:function(e){tc.error("localStorage error: "+e)},q:function(e){try{return null==s?void 0:s.localStorage.getItem(e)}catch(e){iW.B(e)}return null},W:function(e){try{return JSON.parse(iW.q(e))||{}}catch(e){}return null},G:function(e,t){try{null==s||s.localStorage.setItem(e,JSON.stringify(t))}catch(e){iW.B(e)}},V:function(e){try{null==s||s.localStorage.removeItem(e)}catch(e){iW.B(e)}}},iz=["$device_id","distinct_id",tN,tj,tQ,tZ],iY={},iX={H:function(){return!0},B:function(e){tc.error("memoryStorage error: "+e)},q:function(e){return iY[e]||null},W:function(e){return iY[e]||null},G:function(e,t){iY[e]=t},V:function(e){delete iY[e]}},iK=null,iJ={H:function(){if(!N(iK))return iK;if(iK=!0,A(s))iK=!1;else try{var e="__support__";iJ.G(e,"xyz"),'"xyz"'!==iJ.q(e)&&(iK=!1),iJ.V(e)}catch(e){iK=!1}return iK},B:function(e){tc.error("sessionStorage error: ",e)},q:function(e){try{return null==s?void 0:s.sessionStorage.getItem(e)}catch(e){iJ.B(e)}return null},W:function(e){try{return JSON.parse(iJ.q(e))||null}catch(e){}return null},G:function(e,t){try{null==s||s.sessionStorage.setItem(e,JSON.stringify(t))}catch(e){iJ.B(e)}},V:function(e){try{null==s||s.sessionStorage.removeItem(e)}catch(e){iJ.B(e)}}}
1,iZ=function(e){return e[e.PENDING=-1]="PENDING",e[e.DENIED=0]="DENIED",e[e.GRANTED=1]="GRANTED",e}({});class iQ{constructor(e){this._instance=e}get R(){return this._instance.config}get consent(){return this.J()?iZ.DENIED:this.K}isOptedOut(){return"always"===this.R.cookieless_mode||this.consent===iZ.DENIED||this.consent===iZ.PENDING&&(this.R.opt_out_capturing_by_default||"on_reject"===this.R.cookieless_mode)}isOptedIn(){return!this.isOptedOut()}isExplicitlyOptedOut(){return this.consent===iZ.DENIED}optInOut(e){this.Y.G(this.X,+!!e,this.R.cookie_expiration,this.R.cross_subdomain_cookie,this.R.secure_cookie)}reset(){this.Y.V(this.X,this.R.cross_subdomain_cookie)}get X(){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 K(){var e=this.Y.q(this.X);return Y(e)?iZ.GRANTED:k(X,e)?iZ.DENIED:iZ.PENDING}get Y(){if(!this.Z){var e=this.R.opt_out_capturing_persistence_type;this.Z="localStorage"===e?iW:iB;var t="localStorage"===e?iB:iW;t.q(this.X)&&(this.Z.q(this.X)||this.optInOut(Y(t.q(this.X))),t.V(this.X,this.R.cross_subdomain_cookie))}return this.Z}J(){return!!this.R.respect_dnt&&!!tx([null==l?void 0:l.doNotTrack,null==l?void 0:l.msDoNotTrack,_.doNotTrack],e=>Y(e))}}var i0=tu("[Dead Clicks]"),i1=()=>!0,i2=e=>{var t,i=!(null==(t=e.instance.persistence)||!t.get_property(tM)),s=e.instance.config.capture_dead_clicks;return U(s)?s:!!O(s)||i};class i3{get lazyLoadedDeadClicksAutocapture(){return this.tt}constructor(e,t,i){this.instance=e,this.isEnabled=t,this.onCapture=i,this.startIfEnabled()}onRemoteConfig(e){this.instance.persistence&&this.instance.persistence.register({[tM]:null==e?void 0:e.captureDeadClicks}),this.startIfEnabled()}startIfEnabled(){this.isEnabled(this)&&this.it(()=>{this.et()})}it(e){var t,i;null!=(t=_.__PosthogExtensions__)&&t.initDeadClicksAutocapture&&e(),null==(i=_.__PosthogExtensions__)||null==i.loadExternalDependency||i.loadExternalDependency(this.instance,"dead-clicks-autocapture",t=>{t?i0.error("failed to load script",t):e()})}et(){var e;if(c){if(!this.tt&&null!=(e=_.__PosthogExtensions__)&&e.initDeadClicksAutocapture){var t=O(this.instance.config.capture_dead_clicks)?this.instance.config.capture_dead_clicks:{};t.__onCapture=this.onCapture,this.tt=_.__PosthogExtensions__.initDeadClicksAutocapture(this.instance,t),this.tt.start(c),i0.info("starting...")}}else i0.error("`document` not found. Cannot start.")}stop(){this.tt&&(this.tt.stop(),this.tt=void 0,i0.info("stopping..."))}}var i5=tu("[ExceptionAutocapture]");class i8{constructor(e){var t,i,r;this.rt=()=>{var e;if(s&&this.isEnabled&&null!=(e=_.__PosthogExtensions__)&&e.errorWrappingFunctions){var t=_.__PosthogExtensions__.errorWrappingFunctions.wrapOnError,i=_.__PosthogExtensions__.errorWrappingFunctions.wrapUnhandledRejection,r=_.__PosthogExtensions__.errorWrappingFunctions.wrapConsoleError;try{!this.st&&this.R.capture_unhandled_errors&&(this.st=t(this.captureException.bind(this))),!this.nt&&this.R.capture_unhandled_rejections&&(this.nt=i(this.captureException.bind(this))),!this.ot&&this.R.capture_console_errors&&(this.ot=r(this.captureException.bind(this)))}catch(e){i5.error("failed to start",e),this.ut()}}},this._instance=e,this.ht=!(null==(t=this._instance.persistence)||!t.props[tF]),this.dt=new J({refillRate:null!=(i=this._instance.config.error_tracking.__exceptionRateLimiterRefillRate)?i:1,bucketSize:null!=(r=this._instance.config.error_tracking.__exceptionRateLimiterBucketSize)?r:10,refillInterval:1e4,h:i5}),this.R=this.vt(),this.startIfEnabledOrStop()}vt(){var e=this._instance.config.capture_exceptions,t={capture_unhandled_errors:!1,capture_unhandled_rejections:!1,capture_console_errors:!1};return O(e)?t=y({},t,e):(A(e)?this.ht:e)&&(t=y({},t,{capture_unhandled_errors:!0,capture_unhandled_rejections:!0})),t}get isEnabled(){return this.R.capture_console_errors||this.R.capture_unhandled_errors||this.R.capture_unhandled_rejections}startIfEnabledOrStop(){this.isEnabled?(i5.info("enabled"),this.ut(),this.it(this.rt)):this.ut()}it(e){var t,i;
1null!=(t=_.__PosthogExtensions__)&&t.errorWrappingFunctions&&e(),null==(i=_.__PosthogExtensions__)||null==i.loadExternalDependency||i.loadExternalDependency(this._instance,"exception-autocapture",t=>{if(t)return i5.error("failed to load script",t);e()})}ut(){var e,t,i;null==(e=this.st)||e.call(this),this.st=void 0,null==(t=this.nt)||t.call(this),this.nt=void 0,null==(i=this.ot)||i.call(this),this.ot=void 0}onRemoteConfig(e){var t=e.autocaptureExceptions;this.ht=!!t,this._instance.persistence&&this._instance.persistence.register({[tF]:this.ht}),this.R=this.vt(),this.startIfEnabledOrStop()}onConfigChange(){this.R=this.vt()}captureException(e){var t,i,s=null!=(t=null==e||null==(i=e.$exception_list)||null==(i=i[0])?void 0:i.type)?t:"Exception";this.dt.consumeRateLimit(s)?i5.info("Skipping exception capture because of client rate limiting.",{exception:s}):this._instance.exceptions.sendExceptionEvent(e)}}function i6(e,t,i){try{if(!(t in e))return()=>{};var s=e[t],r=i(s);return T(r)&&(r.prototype=r.prototype||{},Object.defineProperties(r,{__posthog_wrapped__:{enumerable:!1,value:!0}})),e[t]=r,()=>{e[t]=s}}catch(e){return()=>{}}}class i4{constructor(e){var t;this._instance=e,this.ct=(null==s||null==(t=s.location)?void 0:t.pathname)||""}get isEnabled(){return"history_change"===this._instance.config.capture_pageview}startIfEnabled(){this.isEnabled&&(tc.info("History API monitoring enabled, starting..."),this.monitorHistoryChanges())}stop(){this.ft&&this.ft(),this.ft=void 0,tc.info("History API monitoring stopped")}monitorHistoryChanges(){var e,t;if(s&&s.history){var i=this;null!=(e=s.history.pushState)&&e.__posthog_wrapped__||i6(s.history,"pushState",e=>function(t,s,r){e.call(this,t,s,r),i._t("pushState")}),null!=(t=s.history.replaceState)&&t.__posthog_wrapped__||i6(s.history,"replaceState",e=>function(t,s,r){e.call(this,t,s,r),i._t("replaceState")}),this.yt()}}_t(e){try{var t,i=null==s||null==(t=s.location)?void 0:t.pathname;if(!i)return;i!==this.ct&&this.isEnabled&&this._instance.capture("$pageview",{navigation_type:e}),this.ct=i}catch(t){tc.error("Error capturing "+e+" pageview",t)}}yt(){if(!this.ft){var e=()=>{this._t("popstate")};tk(s,"popstate",e),this.ft=()=>{s&&s.removeEventListener("popstate",e)}}}}var i7=tu("[SegmentIntegration]"),i9="posthog-js";function se(e,t){var{organization:i,projectId:s,prefix:r,severityAllowList:n=["error"],sendExceptionsToPostHog:o=!0}=void 0===t?{}:t;return t=>{if(!("*"===n||n.includes(t.level))||!e.__loaded)return t;t.tags||(t.tags={});var a,l,c,u,h,d=e.requestRouter.endpointFor("ui","/project/"+e.config.token+"/person/"+e.get_distinct_id());t.tags["PostHog Person URL"]=d,e.sessionRecordingStarted()&&(t.tags["PostHog Recording URL"]=e.get_session_replay_url({withTimestamp:!0}));var p=(null==(a=t.exception)?void 0:a.values)||[],g=p.map(e=>y({},e,{stacktrace:e.stacktrace?y({},e.stacktrace,{type:"raw",frames:(e.stacktrace.frames||[]).map(e=>y({},e,{platform:"web:javascript"}))}):void 0})),_={$exception_message:(null==(l=p[0])?void 0:l.value)||t.message,$exception_type:null==(c=p[0])?void 0:c.type,$exception_level:t.level,$exception_list:g,$sentry_event_id:t.event_id,$sentry_exception:t.exception,$sentry_exception_message:(null==(u=p[0])?void 0:u.value)||t.message,$sentry_exception_type:null==(h=p[0])?void 0:h.type,$sentry_tags:t.tags};return i&&s&&(_.$sentry_url=(r||"https://sentry.io/organizations/")+i+"/issues/?project="+s+"&query="+t.event_id),o&&e.exceptions.sendExceptionEvent(_),t}}class st{constructor(e,t,i,s,r,n){this.name=i9,this.setupOnce=function(o){o(se(e,{organization:t,projectId:i,prefix:s,severityAllowList:r,sendExceptionsToPostHog:null==n||n}))}}}var si=null!=s&&s.location?iI(s.location.hash,"__posthog")||iI(location.hash,"state"):null,ss="_postHogToolbarParams",sr=tu("[Toolbar]"),sn=function(e){return e[e.UNINITIALIZED=0]="UNINITIALIZED",e[e.LOADING=1]="LOADING",e[e.LOADED=2]="LOADED",e}(sn||{});class so{constructor(e){this.instance=e}bt(e){_.ph_toolbar_state=e}wt(){var e;return null!=(e=_.ph_toolbar_state)?e:sn.UNINITIALIZED}maybeLoadToolbar(e,t,i){if(void 0===e&&(e=void 0),void 0===t&&(t=void 0),void 0===i&&(i=void 0),!s||!c)return!1;e=null!=e?e:s.location,i=null!=i?i:s.history;try{if(!t){try{s.localStorage.setItem("test","test"),s.localStorage.removeItem("test")}catch(e){return!1}t=null==s?void 0:s.localStorage}var r,n=si||iI(e.hash,"__posthog")||iI(e.hash,"state"),o=n?ty(()=>JSON.parse(atob(decodeURIComponent(n))))||ty(()=>JSON.parse(decodeURIComponent(n))):null;return o&&"ph_authorize"===o.action?((r=o).source="url",r&&Object.keys(r).length>0&&(o.desiredHash?e.hash=o.desiredHash:i?i.replaceState(i.state,"",e.pathname+e.search):e.hash="")):((r=JSON.parse(t.getItem(ss)||"{}")).source="localstorage",delete r.userIntent),!(!r.token||this.instance.config.token!==r.token)&&(this.loadToolbar(r),!0)}catch(e){return!1}}xt(e){var t=_.ph_load_toolbar||_.ph_load_editor;!j(t)&&T(t)?t(e,this.instance):sr.warn("No toolbar load function found")}loadToolbar(e){var t,i=!(null==c||!c.getElementById(t0));if(!s||i)return!1;var r="custom"===this.instance.requestRouter.region&&this.instance.config.advanced_disable_toolbar_metrics,n=y({token:this.instance.config.token},e,{apiURL:this.instance.requestRouter.endpointFor("ui")},r?{instrument:!1}:{});return(s.localStorage.setItem(ss,JSON.stringify(y({},n,{source:void 0}))),this.wt()===sn.LOADED)?this.xt(n):this.wt()===sn.UNINITIALIZED&&(this.bt(sn.LOADING),null==(t=_.__PosthogExtensions__)||null==t.loadExternalDependency||t.loadExternalDependency(this.instance,"toolbar",e=>{if(e)return sr.error("[Toolbar] Failed to load",e),void this.bt(sn.UNINITIALIZED);this.bt(sn.LOADED),this.xt(n)}),tk(s,"turbolinks:load",()=>{this.bt(sn.UNINITIALIZED),this.loadToolbar(n)})),!0}Et(e){return this.loadToolbar(e)}maybeLoadEditor(e,t,i){return void 0===e&&(e=void 0),void 0===t&&(t=void 0),void 0===i&&(i=void 0),this.maybeLoadToolbar(e,t,i)}}var sa=tu("[TracingHeaders]");
1class sl{constructor(e){this.$t=void 0,this.St=void 0,this.rt=()=>{var e,t;A(this.$t)&&(null==(e=_.__PosthogExtensions__)||null==(e=e.tracingHeadersPatchFns)||e._patchXHR(this._instance.config.__add_tracing_headers||[],this._instance.get_distinct_id(),this._instance.sessionManager)),A(this.St)&&(null==(t=_.__PosthogExtensions__)||null==(t=t.tracingHeadersPatchFns)||t._patchFetch(this._instance.config.__add_tracing_headers||[],this._instance.get_distinct_id(),this._instance.sessionManager))},this._instance=e}it(e){var t,i;null!=(t=_.__PosthogExtensions__)&&t.tracingHeadersPatchFns&&e(),null==(i=_.__PosthogExtensions__)||null==i.loadExternalDependency||i.loadExternalDependency(this._instance,"tracing-headers",t=>{if(t)return sa.error("failed to load script",t);e()})}startIfEnabledOrStop(){var e,t;this._instance.config.__add_tracing_headers?this.it(this.rt):(null==(e=this.$t)||e.call(this),null==(t=this.St)||t.call(this),this.$t=void 0,this.St=void 0)}}var sc="https?://(.*)",su=["gclid","gclsrc","dclid","gbraid","wbraid","fbclid","msclkid","twclid","li_fat_id","igshid","ttclid","rdt_cid","epik","qclid","sccid","irclid","_kx"],sh=tf(["utm_source","utm_medium","utm_campaign","utm_content","utm_term","gad_source","mc_cid"],su),sd="<masked>",sp=["li_fat_id"];function sg(e,t,i){if(!c)return{};var s,r=t?tf([],su,i||[]):[],n=s_(iR(c.URL,r,sd),e);return tv((s={},t_(sp,function(e){var t=iB.q(e);s[e]=t||null}),s),n)}function s_(e,t){var i=sh.concat(t||[]),s={};return t_(i,function(t){var i=i$(e,t);s[t]=i||null}),s}function sv(e){var t=e?0===e.search(sc+"google.([^/?]*)")?"google":0===e.search(sc+"bing.com")?"bing":0===e.search(sc+"yahoo.com")?"yahoo":0===e.search(sc+"duckduckgo.com")?"duckduckgo":null:null,i={};if(!N(t)){i.$search_engine=t;var s=c?i$(c.referrer,"yahoo"!=t?"q":"p"):"";s.length&&(i.ph_keyword=s)}return i}function sf(){return navigator.language||navigator.userLanguage}function sm(){return(null==c?void 0:c.referrer)||"$direct"}function sy(e,t){var i=e?tf([],su,t||[]):[],s=null==u?void 0:u.href.substring(0,1e3);return{r:sm().substring(0,1e3),u:s?iR(s,i,sd):void 0}}function sb(e){var t,{r:i,u:s}=e,r={$referrer:i,$referring_domain:null==i?void 0:"$direct"==i?"$direct":null==(t=iS(i))?void 0:t.host};if(s){r.$current_url=s;var n=iS(s);r.$host=null==n?void 0:n.host,r.$pathname=null==n?void 0:n.pathname,tv(r,s_(s))}return i&&tv(r,sv(i)),r}function sw(){try{return Intl.DateTimeFormat().resolvedOptions().timeZone}catch(e){return}}var sE=tu("[Web Vitals]");class sx{constructor(e){var t;this.kt=!1,this.P=!1,this.N={url:void 0,metrics:[],firstMetricTimestamp:void 0},this.Pt=()=>{clearTimeout(this.Tt),0!==this.N.metrics.length&&(this._instance.capture("$web_vitals",this.N.metrics.reduce((e,t)=>y({},e,{["$web_vitals_"+t.name+"_event"]:y({},t),["$web_vitals_"+t.name+"_value"]:t.value}),{})),this.N={url:void 0,metrics:[],firstMetricTimestamp:void 0})},this.It=e=>{var t,i=null==(t=this._instance.sessionManager)?void 0:t.checkAndGetSessionAndWindowId(!0);if(A(i))sE.error("Could not read session ID. Dropping metrics!");else{this.N=this.N||{url:void 0,metrics:[],firstMetricTimestamp:void 0};var s=this.Ct();A(s)||(j(null==e?void 0:e.name)||j(null==e?void 0:e.value)?sE.error("Invalid metric received",e):this.Rt&&e.value>=this.Rt?sE.error("Ignoring metric with value >= "+this.Rt,e):(this.N.url!==s&&(this.Pt(),this.Tt=setTimeout(this.Pt,this.flushToCaptureTimeoutMs)),A(this.N.url)&&(this.N.url=s),this.N.firstMetricTimestamp=A(this.N.firstMetricTimestamp)?Date.now():this.N.firstMetricTimestamp,e.attribution&&e.attribution.interactionTargetElement&&(e.attribution.interactionTargetElement=void 0),this.N.metrics.push(y({},e,{$current_url:s,$session_id:i.sessionId,$window_id:i.windowId,timestamp:Date.now()})),this.N.metrics.length===this.allowedMetrics.length&&this.Pt()))}},this.rt=()=>{var e,t,i,s,r=_.__PosthogExtensions__;A(r)||A(r.postHogWebVitalsCallbacks)||({onLCP:e,onCLS:t,onFCP:i,onINP:s}=r.postHogWebVitalsCallbacks),e&&t&&i&&s?(this.allowedMetrics.indexOf("LCP")>-1&&e(this.It.bind(this)),this.allowedMetrics.indexOf("CLS")>-1&&t(this.It.bind(this)),this.allowedMetrics.indexOf("FCP")>-1&&i(this.It.bind(this)),this.allowedMetrics.indexOf("INP")>-1&&s(this.It.bind(this)),this.P=!0):sE.error("web vitals callbacks not loaded - not starting")},this._instance=e,this.kt=!(null==(t=this._instance.persistence)||!t.props[tO]),this.startIfEnabled()}get allowedMetrics(){var e,t,i=O(this._instance.config.capture_performance)?null==(e=this._instance.config.capture_performance)?void 0:e.web_vitals_allowed_metrics:void 0;return A(i)?(null==(t=this._instance.persistence)?void 0:t.props[tL])||["CLS","FCP","INP","LCP"]:i}get flushToCaptureTimeoutMs(){return(O(this._instance.config.capture_performance)?this._instance.config.capture_performance.web_vitals_delayed_flush_ms:void 0)||5e3}get Rt(){var e=O(this._instance.config.capture_performance)&&H(this._instance.config.capture_performance.__web_vitals_max_value)?this._instance.config.capture_performance.__web_vitals_max_value:9e5;return 0<e&&e<=6e4?9e5:e}get isEnabled(){var e=null==u?void 0:u.protocol;if("http:"!==e&&"https:"!==e)return sE.info("Web Vitals are disabled on non-http/https protocols"),!1;var t=O(this._instance.config.capture_performance)?this._instance.config.capture_performance.web_vitals:U(this._instance.config.capture_performance)?this._instance.config.capture_performance:void 0;return U(t)?t:this.kt}startIfEnabled(){this.isEnabled&&!this.P&&(sE.info("enabled, starting..."),this.it(this.rt))}onRemoteConfig(e){var t=O(e.capturePerformance)&&!!e.capturePerformance.web_vitals,i=O(e.capturePerformance)?e.capturePerformance.web_vitals_allowed_metrics:void 0;this._instance.persistence&&(this._instance.persistence.register({[tO]:t}),this._instance.persistence.register({[tL]:i})),this.kt=t,this.startIfEnabled()}it(e){var t,i;null!=(t=_.__PosthogExtensions__)&&t.postHogWebVitalsCallbacks&&e(),null==(i=_.__PosthogExtensions__)||null==i.loadExternalDependency||i.loadExternalDependency(this._instance,"web-vitals",t=>{t?sE.error("failed to load script",t):e()})}Ct(){var e=s?s.location.href:void 0;if(e){var t=this._instance.config.mask_personal_data_properties,i=this._instance.config.custom_personal_data_properties;return iR(e,t?tf([],su,i||[]):[],sd)}sE.error("Could not determine current URL")}}var sk=tu("[Heatmaps]");function sS(e){return O(e)&&"clientX"in e&&"clientY"in e&&H(e.clientX)&&H(e.clientY)}class sP{constructor(e){var t;this.kt=!1,this.P=!1,this.Ft=null,this.instance=e,this.kt=!(null==(t=this.instance.persistence)||!t.props[tI]),this.rageclicks=new ik(e.config.rageclick)}get flushIntervalMilliseconds(){var e=5e3;return O(this.instance.config.capture_heatmaps)&&this.instance.config.capture_heatmaps.flush_interval_milliseconds&&(e=this.instance.config.capture_heatmaps.flush_interval_milliseconds),e}get isEnabled(){return A(this.instance.config.capture_heatmaps)?A(this.instance.config.enable_heatmaps)?this.kt:this.instance.config.enable_heatmaps:!1!==this.instance.config.capture_heatmaps}startIfEnabled(){if(this.isEnabled)this.P||(sk.info("starting..."),this.Mt(),this.Ot());else{var e;clearInterval(null!=(e=this.Ft)?e:void 0),this.At(),this.getAndClearBuffer()}}onRemoteConfig(e){var t=!!e.heatmaps;this.instance.persistence&&this.instance.persistence.register({[tI]:t}),this.kt=t,this.startIfEnabled()}getAndClearBuffer(){var e=this.N;return this.N=void 0,e}Dt(e){this.jt(e.originalEvent,"deadclick")}Ot(){this.Ft&&clearInterval(this.Ft),this.Ft="visible"===(null==c?void 0:c.visibilityState)?setInterval(this.Lt.bind(this),this.flushIntervalMilliseconds):null}
1Mt(){s&&c&&(this.Nt=this.Lt.bind(this),tk(s,"beforeunload",this.Nt),this.Ut=e=>this.jt(e||(null==s?void 0:s.event)),tk(c,"click",this.Ut,{capture:!0}),this.zt=e=>this.Ht(e||(null==s?void 0:s.event)),tk(c,"mousemove",this.zt,{capture:!0}),this.Bt=new i3(this.instance,i1,this.Dt.bind(this)),this.Bt.startIfEnabled(),this.qt=this.Ot.bind(this),tk(c,"visibilitychange",this.qt),this.P=!0)}At(){var e;s&&c&&(this.Nt&&s.removeEventListener("beforeunload",this.Nt),this.Ut&&c.removeEventListener("click",this.Ut,{capture:!0}),this.zt&&c.removeEventListener("mousemove",this.zt,{capture:!0}),this.qt&&c.removeEventListener("visibilitychange",this.qt),clearTimeout(this.Wt),null==(e=this.Bt)||e.stop(),this.P=!1)}Gt(e,t){var i=this.instance.scrollManager.scrollY(),r=this.instance.scrollManager.scrollX(),n=this.instance.scrollManager.scrollElement(),o=function(e,t,i){for(var r=e;r&&t5(r)&&!t8(r,"body")&&r!==i;){if(k(t,null==s?void 0:s.getComputedStyle(r).position))return!0;r=ia(r)}return!1}(is(e),["fixed","sticky"],n);return{x:e.clientX+(o?0:r),y:e.clientY+(o?0:i),target_fixed:o,type:t}}jt(e,t){var i;if(void 0===t&&(t="click"),!t3(e.target)&&sS(e)){var s=this.Gt(e,t);null!=(i=this.rageclicks)&&i.isRageClick(e.clientX,e.clientY,(new Date).getTime())&&this.Vt(y({},s,{type:"rageclick"})),this.Vt(s)}}Ht(e){!t3(e.target)&&sS(e)&&(clearTimeout(this.Wt),this.Wt=setTimeout(()=>{this.Vt(this.Gt(e,"mousemove"))},500))}Vt(e){if(s){var t=s.location.href,i=this.instance.config.mask_personal_data_properties,r=this.instance.config.custom_personal_data_properties,n=iR(t,i?tf([],su,r||[]):[],sd);this.N=this.N||{},this.N[n]||(this.N[n]=[]),this.N[n].push(e)}}Lt(){this.N&&!M(this.N)&&this.instance.capture("$$heatmap",{$heatmap_data:this.getAndClearBuffer()})}}class s${constructor(e){this.Jt=(e,t,i)=>{i&&(i.noSessionId||i.activityTimeout||i.sessionPastMaximumLength)&&(tc.info("[PageViewManager] Session rotated, clearing pageview state",{sessionId:e,changeReason:i}),this.Kt=void 0,this._instance.scrollManager.resetContext())},this._instance=e,this.Yt()}Yt(){var e;this.Xt=null==(e=this._instance.sessionManager)?void 0:e.onSessionId(this.Jt)}destroy(){var e;null==(e=this.Xt)||e.call(this),this.Xt=void 0}doPageView(e,t){var i,r=this.Qt(e,t);return this.Kt={pathname:null!=(i=null==s?void 0:s.location.pathname)?i:"",pageViewId:t,timestamp:e},this._instance.scrollManager.resetContext(),r}doPageLeave(e){var t;return this.Qt(e,null==(t=this.Kt)?void 0:t.pageViewId)}doEvent(){var e;return{$pageview_id:null==(e=this.Kt)?void 0:e.pageViewId}}Qt(e,t){var i=this.Kt;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(!(A(n)||A(o)||A(a)||A(l)||A(c)||A(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 h=n<=1?1:K(o/n,0,1,tc),d=n<=1?1:K(a/n,0,1,tc),p=l<=1?1:K(c/l,0,1,tc),g=l<=1?1:K(u/l,0,1,tc);s=tv(s,{$prev_pageview_last_scroll:o,$prev_pageview_last_scroll_percentage:h,$prev_pageview_max_scroll:a,$prev_pageview_max_scroll_percentage:d,$prev_pageview_last_content:c,$prev_pageview_last_content_percentage:p,$prev_pageview_max_content:u,$prev_pageview_max_content_percentage:g})}}return i.pathname&&(s.$prev_pageview_pathname=i.pathname),i.timestamp&&(s.$prev_pageview_duration=(e.getTime()-i.timestamp.getTime())/1e3),s}}var sR=function(e){return e.GZipJS="gzip-js",e.Base64="base64",e}({}),sI=Uint8Array,sF=Uint16Array,sC=Uint32Array,sT=new sI([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]),sO=new sI([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]),sM=new sI([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),sA=function(e,t){for(var i=new sF(31),s=0;s<31;++s)i[s]=t+=1<<e[s-1];var r=new sC(i[30]);for(s=1;s<30;++s)for(var n=i[s];n<i[s+1];++n)r[n]=n-i[s]<<5|s;return[i,r]},sL=sA(sT,2),sD=sL[0],sN=sL[1];sD[28]=258,sN[258]=28;for(var sj=sA(sO,0)[1],sH=new sF(32768),sq=0;sq<32768;++sq){var sU=(43690&sq)>>>1|(21845&sq)<<1;sU=(61680&(sU=(52428&sU)>>>2|(13107&sU)<<2))>>>4|(3855&sU)<<4,sH[sq]=((65280&sU)>>>8|(255&sU)<<8)>>>1}var sV=function(e,t,i){for(var s=e.length,r=0,n=new sF(t);r<s;++r)++n[e[r]-1];var o,a=new sF(t);for(r=0;r<t;++r)a[r]=a[r-1]+n[r-1]<<1;if(i){o=new sF(1<<t);var l=15-t;for(r=0;r<s;++r)if(e[r])for(var c=r<<4|e[r],u=t-e[r],h=a[e[r]-1]++<<u,d=h|(1<<u)-1;h<=d;++h)o[sH[h]>>>l]=c}else for(o=new sF(s),r=0;r<s;++r)o[r]=sH[a[e[r]-1]++]>>>15-e[r];return o},sB=new sI(288);for(sq=0;sq<144;++sq)sB[sq]=8;for(sq=144;sq<256;++sq)sB[sq]=9;for(sq=256;sq<280;++sq)sB[sq]=7;for(sq=280;sq<288;++sq)sB[sq]=8;var sG=new sI(32);for(sq=0;sq<32;++sq)sG[sq]=5;var sW=sV(sB,9,0),sz=sV(sG,5,0),sY=function(e){return(e/8|0)+(7&e&&1)},sX=function(e,t,i){(null==i||i>e.length)&&(i=e.length);var s=new(e instanceof sF?sF:e instanceof sC?sC:sI)(i-t);return s.set(e.subarray(t,i)),s},sK=function(e,t,i){i<<=7&t;var s=t/8|0;e[s]|=i,e[s+1]|=i>>>8},sJ=function(e,t,i){i<<=7&t;var s=t/8|0;e[s]|=i,e[s+1]|=i>>>8,e[s+2]|=i>>>16},sZ=function(e,t){for(var i=[],s=0;s<e.length;++s)e[s]&&i.push({s:s,f:e[s]});var r=i.length,n=i.slice();if(!r)return[new sI(0),0];if(1==r){var o=new sI(i[0].s+1);return o[i[0].s]=1,[o,1]}i.sort(function(e,t){return e.f-t.f}),i.push({s:-1,f:25001});var a=i[0],l=i[1],c=0,u=1,h=2;for(i[0]={s:-1,f:a.f+l.f,l:a,r:l};u!=r-1;)a=i[i[c].f<i[h].f?c++:h++],l=i[c!=u&&i[c].f<i[h].f?c++:h++],i[u++]={s:-1,f:a.f+l.f,l:a,r:l};var d=n[0].s;for(s=1;s<r;++s)n[s].s>d&&(d=n[s].s);var p=new sF(d+1),g=sQ(i[u-1],p,0);if(g>t){s=0;var _=0,v=g-t,f=1<<v;for(n.sort(function(e,t){return p[t.s]-p[e.s]||e.f-t.f});s<r;++s){var m=n[s].s;if(!(p[m]>t))break;_+=f-(1<<g-p[m]),p[m]=t}for(_>>>=v;_>0;){var y=n[s].s;p[y]<t?_-=1<<t-p[y]++-1:++s}for(;s>=0&&_;--s){var b=n[s].s;p[b]==t&&(--p[b],++_)}g=t}return[new sI(p),g]},sQ=function(e,t,i){return -1==e.s?Math.max(sQ(e.l,t,i+1),sQ(e.r,t,i+1)):t[e.s]=i},s0=function(e){for(var t=e.length;t&&!e[--t];);for(var i=new sF(++t),s=0,r=e[0],n=1,o=function(e){i[s++]=e},a=1;a<=t;++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]},s1=function(e,t){for(var i=0,s=0;s<t.length;++s)i+=e[s]*t[s];return i},s2=function(e,t,i){var s=i.length,r=sY(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;n<s;++n)e[r+n+4]=i[n];return 8*(r+4+s)},s3=function(e,t,i,s,r,n,o,a,l,c,u){sK(t,u++,i),++r[256];for(var h=sZ(r,15),d=h[0],p=h[1],g=sZ(n,15),_=g[0],v=g[1],f=s0(d),m=f[0],y=f[1],b=s0(_),w=b[0],E=b[1],x=new sF(19),k=0;k<m.length;++k)x[31&m[k]]++;for(k=0;k<w.length;++k)x[31&w[k]]++;for(var S=sZ(x,7),P=S[0],$=S[1],R=19;R>4&&!P[sM[R-1]];--R);var I,F,C,T,O=c+5<<3,M=s1(r,sB)+s1(n,sG)+o,A=s1(r,d)+s1(n,_)+o+14+3*R+s1(x,P)+(2*x[16]+3*x[17]+7*x[18]);if(O<=M&&O<=A)return s2(t,u,e.subarray(l,l+c));
1if(sK(t,u,1+(A<M)),u+=2,A<M){I=sV(d,p,0),F=d,C=sV(_,v,0),T=_;var L=sV(P,$,0);for(sK(t,u,y-257),sK(t,u+5,E-1),sK(t,u+10,R-4),u+=14,k=0;k<R;++k)sK(t,u+3*k,P[sM[k]]);u+=3*R;for(var D=[m,w],N=0;N<2;++N){var j=D[N];for(k=0;k<j.length;++k){var H=31&j[k];sK(t,u,L[H]),u+=P[H],H>15&&(sK(t,u,j[k]>>>5&127),u+=j[k]>>>12)}}}else I=sW,F=sB,C=sz,T=sG;for(k=0;k<a;++k)if(s[k]>255){sJ(t,u,I[(H=s[k]>>>18&31)+257]),u+=F[H+257],H>7&&(sK(t,u,s[k]>>>23&31),u+=sT[H]);var q=31&s[k];sJ(t,u,C[q]),u+=T[q],q>3&&(sJ(t,u,s[k]>>>5&8191),u+=sO[q])}else sJ(t,u,I[s[k]]),u+=F[s[k]];return sJ(t,u,I[256]),u+F[256]},s5=new sC([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),s8=function(){for(var e=new sC(256),t=0;t<256;++t){for(var i=t,s=9;--s;)i=(1&i&&0xedb88320)^i>>>1;e[t]=i}return e}(),s6=function(e,t,i){for(;i;++t)e[t]=i,i>>>=8},s4=function(e){var t,i,s,r,n="";for(t=i=0,s=(e=(e+"").replace(/\r\n/g,"\n").replace(/\r/g,"\n")).length,r=0;r<s;r++){var o=e.charCodeAt(r),a=null;o<128?i++:a=o>127&&o<2048?String.fromCharCode(o>>6|192,63&o|128):String.fromCharCode(o>>12|224,o>>6&63|128,63&o|128),N(a)||(i>t&&(n+=e.substring(t,i)),n+=a,t=i=r+1)}return i>t&&(n+=e.substring(t,e.length)),n},s7=!!d||!!h,s9="text/plain",re=function(e,t,i){void 0===i&&(i=!0);var s,[r,n]=e.split("?"),o=y({},t),a=null!=(s=null==n?void 0:n.split("&").map(e=>{var t,[s,r]=e.split("="),n=i&&null!=(t=o[s])?t:r;return delete o[s],s+"="+n}))?s:[],l=iP(o);return l&&a.push(l),r+"?"+a.join("&")},rt=(e,t)=>JSON.stringify(e,(e,t)=>"bigint"==typeof t?t.toString():t,t),ri=e=>{var{data:t,compression:i}=e;if(t){if(i===sR.GZipJS){var s=new Blob([function(e,t){void 0===t&&(t={});var i=(r=0xffffffff,{p:function(e){for(var t=r,i=0;i<e.length;++i)t=s8[255&t^e[i]]^t>>>8;r=t},d:function(){return 0xffffffff^r}}),s=e.length;i.p(e);var r,n,o,a,l=(n=t,o=10+((a=t).filename&&a.filename.length+1||0),function(e,t,i,s,r,n){var o=e.length,a=new sI(s+o+5*(1+Math.floor(o/7e3))+8),l=a.subarray(s,a.length-r),c=0;if(!t||o<8)for(var u=0;u<=o;u+=65535){var h=u+65535;h<o?c=s2(l,c,e.subarray(u,h)):(l[u]=n,c=s2(l,c,e.subarray(u,o)))}else{for(var d=s5[t-1],p=d>>>13,g=8191&d,_=(1<<i)-1,v=new sF(32768),f=new sF(_+1),m=Math.ceil(i/3),y=2*m,b=function(t){return(e[t]^e[t+1]<<m^e[t+2]<<y)&_},w=new sC(25e3),E=new sF(288),x=new sF(32),k=0,S=0,P=(u=0,0),$=0,R=0;u<o;++u){var I=b(u),F=32767&u,C=f[I];if(v[F]=C,f[I]=F,$<=u){var T=o-u;if((k>7e3||P>24576)&&T>423){c=s3(e,l,0,w,E,x,S,P,R,u-R,c),P=k=S=0,R=u;for(var O=0;O<286;++O)E[O]=0;for(O=0;O<30;++O)x[O]=0}var M=2,A=0,L=g,D=F-C&32767;if(T>2&&I==b(u-D))for(var N=Math.min(p,T)-1,j=Math.min(32767,u),H=Math.min(258,T);D<=j&&--L&&F!=C;){if(e[u+M]==e[u+M-D]){for(var q=0;q<H&&e[u+q]==e[u+q-D];++q);if(q>M){if(M=q,A=D,q>N)break;var U=Math.min(D,q-2),V=0;for(O=0;O<U;++O){var B=u-D+O+32768&32767,G=B-v[B]+32768&32767;G>V&&(V=G,C=B)}}}D+=(F=C)-(C=v[F])+32768&32767}if(A){w[P++]=0x10000000|sN[M]<<18|sj[A];var W=31&sN[M],z=31&sj[A];S+=sT[W]+sO[z],++E[257+W],++x[z],$=u+M,++k}else w[P++]=e[u],++E[e[u]]}}c=s3(e,l,n,w,E,x,S,P,R,u-R,c)}return sX(a,0,s+sY(c)+r)}(e,null==n.level?6:n.level,null==n.mem?Math.ceil(1.5*Math.max(8,Math.min(13,Math.log(e.length)))):12+n.mem,o,8,!0)),c=l.length;return function(e,t){var i=t.filename;if(e[0]=31,e[1]=139,e[2]=8,e[8]=t.level<2?4:2*(9==t.level),e[9]=3,0!=t.mtime&&s6(e,4,Math.floor(new Date(t.mtime||Date.now())/1e3)),i){e[3]=8;for(var s=0;s<=i.length;++s)e[s+10]=i.charCodeAt(s)}}(l,t),s6(l,c-8,i.d()),s6(l,c-4,s),l}(function(e,t){var i=e.length;if("undefined"!=typeof TextEncoder)return(new TextEncoder).encode(e);for(var s=new sI(e.length+(e.length>>>1)),r=0,n=function(e){s[r++]=e},o=0;o<i;++o){if(r+5>s.length){var a=new sI(r+8+(i-o<<1));a.set(s),s=a}var l=e.charCodeAt(o);l<128?n(l):(l<2048?n(192|l>>>6):(l>55295&&l<57344?(n(240|(l=65536+(1047552&l)|1023&e.charCodeAt(++o))>>>18),n(128|l>>>12&63)):n(224|l>>>12),n(128|l>>>6&63)),n(128|63&l))}return sX(s,0,r)}(rt(t)),{mtime:0})],{type:s9});return{contentType:s9,body:s,estimatedSize:s.size}}if(i===sR.Base64){var r=(e=>"data="+encodeURIComponent("string"==typeof e?e:rt(e)))(function(e){var t,i,s,r,n,o="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789
1+/=",a=0,l=0,c="",u=[];if(!e)return e;e=s4(e);do t=(n=e.charCodeAt(a++)<<16|e.charCodeAt(a++)<<8|e.charCodeAt(a++))>>18&63,i=n>>12&63,s=n>>6&63,r=63&n,u[l++]=o.charAt(t)+o.charAt(i)+o.charAt(s)+o.charAt(r);while(a<e.length);switch(c=u.join(""),e.length%3){case 1:c=c.slice(0,-2)+"==";break;case 2:c=c.slice(0,-1)+"="}return c}(rt(t)));return{contentType:"application/x-www-form-urlencoded",body:r,estimatedSize:new Blob([r]).size}}var n=rt(t);return{contentType:"application/json",body:n,estimatedSize:new Blob([n]).size}}},rs=[];h&&rs.push({transport:"fetch",method:e=>{var t,i,{contentType:s,body:r,estimatedSize:n}=null!=(t=ri(e))?t:{},o=new Headers;t_(e.headers,function(e,t){o.append(t,e)}),s&&o.append("Content-Type",s);var a=e.url,l=null;if(p){var c=new p;l={signal:c.signal,timeout:setTimeout(()=>c.abort(),e.timeout)}}h(a,y({method:(null==e?void 0:e.method)||"GET",headers:o,keepalive:"POST"===e.method&&52428.8>(n||0),body:r,signal:null==(i=l)?void 0:i.signal},e.fetchOptions)).then(t=>t.text().then(i=>{var s={statusCode:t.status,text:i};if(200===t.status)try{s.json=JSON.parse(i)}catch(e){tc.error(e)}null==e.callback||e.callback(s)})).catch(t=>{tc.error(t),null==e.callback||e.callback({statusCode:0,text:t})}).finally(()=>l?clearTimeout(l.timeout):null)}}),d&&rs.push({transport:"XHR",method:e=>{var t,i=new d;i.open(e.method||"GET",e.url,!0);var{contentType:s,body:r}=null!=(t=ri(e))?t:{};t_(e.headers,function(e,t){i.setRequestHeader(t,e)}),s&&i.setRequestHeader("Content-Type",s),e.timeout&&(i.timeout=e.timeout),e.disableXHRCredentials||(i.withCredentials=!0),i.onreadystatechange=()=>{if(4===i.readyState){var t={statusCode:i.status,text:i.responseText};if(200===i.status)try{t.json=JSON.parse(i.responseText)}catch(e){}null==e.callback||e.callback(t)}},i.send(r)}}),null!=l&&l.sendBeacon&&rs.push({transport:"sendBeacon",method:e=>{var t=re(e.url,{beacon:"1"});try{var i,{contentType:s,body:r}=null!=(i=ri(e))?i:{},n="string"==typeof r?new Blob([r],{type:s}):r;l.sendBeacon(t,n)}catch(e){}}});var rr=function(e,t){if(!function(e){try{new RegExp(e)}catch(e){return!1}return!0}(t))return!1;try{return new RegExp(t).test(e)}catch(e){return!1}};function rn(e,t,i){return rt({distinct_id:e,userPropertiesToSet:t,userPropertiesToSetOnce:i})}var ro={exact:(e,t)=>t.some(t=>e.some(e=>t===e)),is_not:(e,t)=>t.every(t=>e.every(e=>t!==e)),regex:(e,t)=>t.some(t=>e.some(e=>rr(t,e))),not_regex:(e,t)=>t.every(t=>e.every(e=>!rr(t,e))),icontains:(e,t)=>t.map(ra).some(t=>e.map(ra).some(e=>t.includes(e))),not_icontains:(e,t)=>t.map(ra).every(t=>e.map(ra).every(e=>!t.includes(e))),gt:(e,t)=>t.some(t=>{var i=parseFloat(t);return!isNaN(i)&&e.some(e=>i>parseFloat(e))}),lt:(e,t)=>t.some(t=>{var i=parseFloat(t);return!isNaN(i)&&e.some(e=>i<parseFloat(e))})},ra=e=>e.toLowerCase();function rl(e,t){return!e||Object.entries(e).every(e=>{var[i,s]=e,r=null==t?void 0:t[i];if(A(r)||N(r))return!1;var n=[String(r)],o=ro[s.operator];return!!o&&o(s.values,n)})}var rc=tu("[Error tracking]");class ru{constructor(e){var t,i;this.Zt=[],this.ti=new eK([new e4,new ta,new e9,new e7,new tn,new tr,new tt,new to],function(e){for(var t=arguments.length,i=Array(t>1?t-1:0),s=1;s<t;s++)i[s-1]=arguments[s];return function(t,s){void 0===s&&(s=0);for(var r=[],n=t.split("\n"),o=s;o<n.length;o++){var a=n[o];if(!(a.length>1024)){var l=e6.test(a)?a.replace(e6,"$1"):a;if(!l.match(/\S*Error: /)){for(var c of i){var u=c(l,e);if(u){r.push(u);break}}if(r.length>=50)break}}}if(!r.length)return[];var h=Array.from(r);return h.reverse(),h.slice(0,50).map(e=>y({},e,{filename:e.filename||(h[h.length-1]||{}).filename,function:e.function||"?"}))}}("web:javascript",e2,e8)),this._instance=e,this.Zt=null!=(t=null==(i=this._instance.persistence)?void 0:i.get_property(tC))?t:[]}onRemoteConfig(e){var t,i,s,r=null!=(t=null==(i=e.errorTracking)?void 0:i.suppressionRules)?t:[],n=null==(s=e.errorTracking)?void 0:s.captureExtensionExceptions;this.Zt=r,this._instance.persistence&&this._instance.persistence.register({[tC]:this.Zt,[tT]:n})}get ii(){var e,t=!!this._instance.get_property(tT),i=this._instance.config.error_tracking.captureExtensionExceptions;return null!=(e=null!=i?i:t)&&e}buildProperties(e,t){return this.ti.buildFromUnknown(e,{syntheticException:null==t?void 0:t.syntheticException,mechanism:{handled:null==t?void 0:t.handled}})}sendExceptionEvent(e){var t=e.$exception_list;if(this.ei(t)){if(this.ri(t))return void rc.info("Skipping exception capture because a suppression rule matched");if(!this.ii&&this.si(t))return void rc.info("Skipping exception capture because it was thrown by an extension");if(!this._instance.config.error_tracking.__capturePostHogExceptions&&this.ni(t))return void rc.info("Skipping exception capture because it was thrown by the PostHog SDK")}return this._instance.capture("$exception",e,{_noTruncate:!0,_batchKey:"exceptionEvent"})}ri(e){if(0===e.length)return!1;var t=e.reduce((e,t)=>
1{var{type:i,value:s}=t;return L(i)&&i.length>0&&e.$exception_types.push(i),L(s)&&s.length>0&&e.$exception_values.push(s),e},{$exception_types:[],$exception_values:[]});return this.Zt.some(e=>{var i=e.values.map(e=>{var i,s=ro[e.operator],r=C(e.value)?e.value:[e.value],n=null!=(i=t[e.key])?i:[];return r.length>0&&s(r,n)});return"OR"===e.type?i.some(Boolean):i.every(Boolean)})}si(e){return e.flatMap(e=>{var t,i;return null!=(t=null==(i=e.stacktrace)?void 0:i.frames)?t:[]}).some(e=>e.filename&&e.filename.startsWith("chrome-extension://"))}ni(e){if(e.length>0){var t,i,s,r,n=null!=(t=null==(i=e[0].stacktrace)?void 0:i.frames)?t:[],o=n[n.length-1];return null!=(s=null==o||null==(r=o.filename)?void 0:r.includes("posthog.com/static"))&&s}return!1}ei(e){return!j(e)&&C(e)}}var rh=tu("[FeatureFlags]"),rd=tu("[FeatureFlags]",{debugEnabled:!0}),rp="$active_feature_flags",rg="$override_feature_flags",r_="$feature_flag_payloads",rv="$override_feature_flag_payloads",rf="$feature_flag_request_id",rm="$feature_flag_evaluated_at",ry=e=>{var t={};for(var[i,s]of tm(e||{}))s&&(t[i]=s);return t},rb=function(e){return e.FeatureFlags="feature_flags",e.Recordings="recordings",e}({});class rw{constructor(e){this.oi=!1,this.ai=!1,this.li=!1,this.ui=!1,this.hi=!1,this.di=!1,this.vi=!1,this._instance=e,this.featureFlagEventHandlers=[]}ci(){var e=this._instance.config.evaluation_environments;return null!=e&&e.length?e.filter(e=>{var t=e&&"string"==typeof e&&e.trim().length>0;return t||rh.error("Invalid evaluation environment found:",e,"Expected non-empty string"),t}):[]}fi(){return this.ci().length>0}flags(){if(this._instance.config.__preview_remote_config)this.di=!0;else{var e=!this.pi&&(this._instance.config.advanced_disable_feature_flags||this._instance.config.advanced_disable_feature_flags_on_first_load);this.gi({disableFlags:e})}}get hasLoadedFlags(){return this.ai}getFlags(){return Object.keys(this.getFlagVariants())}getFlagsWithDetails(){var e=this._instance.get_property(tU),t=this._instance.get_property(rg),i=this._instance.get_property(rv);if(!i&&!t)return e||{};var s=tv({},e||{});for(var r of[...new Set([...Object.keys(i||{}),...Object.keys(t||{})])]){var n,o,a=s[r],l=null==t?void 0:t[r],c=A(l)?null!=(n=null==a?void 0:a.enabled)&&n:!!l,u=A(l)?a.variant:"string"==typeof l?l:void 0,h=null==i?void 0:i[r],d=y({},a,{enabled:c,variant:c?null!=u?u:null==a?void 0:a.variant:void 0});c!==(null==a?void 0:a.enabled)&&(d.original_enabled=null==a?void 0:a.enabled),u!==(null==a?void 0:a.variant)&&(d.original_variant=null==a?void 0:a.variant),h&&(d.metadata=y({},null==a?void 0:a.metadata,{payload:h,original_payload:null==a||null==(o=a.metadata)?void 0:o.payload})),s[r]=d}return this.oi||(rh.warn(" Overriding feature flag details!",{flagDetails:e,overriddenPayloads:i,finalDetails:s}),this.oi=!0),s}getFlagVariants(){var e=this._instance.get_property(tH),t=this._instance.get_property(rg);if(!t)return e||{};for(var i=tv({},e),s=Object.keys(t),r=0;r<s.length;r++)i[s[r]]=t[s[r]];return this.oi||(rh.warn(" Overriding feature flags!",{enabledFlags:e,overriddenFlags:t,finalFlags:i}),this.oi=!0),i}getFlagPayloads(){var e=this._instance.get_property(r_),t=this._instance.get_property(rv);if(!t)return e||{};for(var i=tv({},e||{}),s=Object.keys(t),r=0;r<s.length;r++)i[s[r]]=t[s[r]];return this.oi||(rh.warn(" Overriding feature flag payloads!",{flagPayloads:e,overriddenPayloads:t,finalPayloads:i}),this.oi=!0),i}reloadFeatureFlags(){this.ui||this._instance.config.advanced_disable_feature_flags||this.pi||(this.pi=setTimeout(()=>{this.gi()},5))}mi(){clearTimeout(this.pi),this.pi=void 0}ensureFlagsLoaded(){this.ai||this.li||this.pi||this.reloadFeatureFlags()}setAnonymousDistinctId(e){this.$anon_distinct_id=e}setReloadingPaused(e){this.ui=e}gi(e){var t;if(this.mi(),!this._instance.O())if(this.li)this.hi=!0;else{var i=this._instance.config.token,s=this._instance.get_property("$device_id"),r={token:i,distinct_id:this._instance.get_distinct_id(),groups:this._instance.getGroups(),$anon_distinct_id:this.$anon_distinct_id,person_properties:y({},(null==(t=this._instance.persistence)?void 0:t.get_initial_props())||{},this._instance.get_property(tV)||{}),group_properties:this._instance.get_property(tB)};N(s)||A(s)||(r.$device_id=s),(null!=e&&e.disableFlags||this._instance.config.advanced_disable_feature_flags)&&(r.disable_flags=!0),this.fi()&&(r.evaluation_environments=this.ci());var n=this._instance.config.__preview_remote_config,o=this._instance.config.advanced_only_evaluate_survey_feature_flags?"&only_evaluate_survey_feature_flags=true":"",a=this._instance.requestRouter.endpointFor("flags",(n?"/flags/?v=2":"/flags/?v=2&config=true")+o);n&&(r.timezone=sw()),this.li=!0,this._instance._send_request({method:"POST",url:a,data:r,compression:this._instance.config.disable_compression?void 0:sR.Base64,timeout:this._instance.config.feature_flag_request_timeout_ms,callback:e=>{var t,i,s,n=!0;200===e.statusCode&&(this.hi||(this.$anon_distinct_id=void 0),n=!1),this.li=!1,this.di||(this.di=!0,this._instance.yi(null!=(s=e.json)?s:{})),(!r.disable_flags||this.hi)&&((this.vi=!n,e.json&&null!=(i=e.json.quotaLimited)&&i.includes(rb.FeatureFlags))?rh.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(null!=(t=e.json)?t:{},n),this.hi&&(this.hi=!1,this.gi())))}})}}getFeatureFlag(e,t){if(void 0===t&&(t={}),this.ai||this.getFlags()&&this.getFlags().length>0){var i=this.getFlagVariants()[e],s=""+i,r=this._instance.get_property(rf)||void 0,n=this._instance.get_property(rm)||void 0,o=this._instance.get_property(tW)||{};if((t.send_event||!("send_event"in t))&&(!(e in o)||!o[e].includes(s))){C(o[e])?o[e].push(s):o[e]=[s],null==(c=this._instance.persistence)||c.register({[tW]:o});var a=this.getFeatureFlagDetails(e),l={$feature_flag:e,$feature_flag_response:i,$feature_flag_payload:this.getFeatureFlagPayload(e)||null,$feature_flag_request_id:r,$feature_flag_evaluated_at:n,$feature_flag_bootstrapped_response:(null==(u=this._instance.config.bootstrap)||null==(u=u.featureFlags)?void 0:u[e])||null,$feature_flag_bootstrapped_payload:(null==(h=this._instance.config.bootstrap)||null==(h=h.featureFlagPayloads)?void 0:h[e])||null,$used_bootstrap_value:!this.vi};A(null==a||null==(d=a.metadata)?void 0:d.version)||(l.$feature_flag_version=a.metadata.version);var c,u,h,d,p,g,_,v,f,m,y=null!=(p=null==a||null==(g=a.reason)?void 0:g.description)?p:null==a||null==(_=a.reason)?void 0:_.code;y&&(l.$feature_flag_reason=y),null!=a&&null!=(v=a.metadata)&&v.id&&(l.$feature_flag_id=a.metadata.id),A(null==a?void 0:a.original_variant)&&A(null==a?void 0:a.original_enabled)||(l.$feature_flag_original_response=A(a.original_variant)?a.original_enabled:a.original_variant),null!=a&&null!=(f=a.metadata)&&f.original_payload&&(l.$feature_flag_original_payload=null==a||null==(m
1=a.metadata)?void 0:m.original_payload),this._instance.capture("$feature_flag_called",l)}return i}rh.warn('getFeatureFlag for key "'+e+"\" failed. Feature flags didn't load in time.")}getFeatureFlagDetails(e){return this.getFlagsWithDetails()[e]}getFeatureFlagPayload(e){return this.getFlagPayloads()[e]}getRemoteConfigPayload(e,t){var i=this._instance.config.token,s={distinct_id:this._instance.get_distinct_id(),token:i};this.fi()&&(s.evaluation_environments=this.ci()),this._instance._send_request({method:"POST",url:this._instance.requestRouter.endpointFor("flags","/flags/?v=2&config=true"),data:s,compression:this._instance.config.disable_compression?void 0:sR.Base64,timeout:this._instance.config.feature_flag_request_timeout_ms,callback:i=>{var s,r=null==(s=i.json)?void 0:s.featureFlagPayloads;t((null==r?void 0:r[e])||void 0)}})}isFeatureEnabled(e,t){if(void 0===t&&(t={}),this.ai||this.getFlags()&&this.getFlags().length>0){var i=this.getFeatureFlag(e,t);return A(i)?void 0:!!i}rh.warn('isFeatureEnabled for key "'+e+"\" failed. Feature flags didn't load in time.")}addFeatureFlagsHandler(e){this.featureFlagEventHandlers.push(e)}removeFeatureFlagsHandler(e){this.featureFlagEventHandlers=this.featureFlagEventHandlers.filter(t=>t!==e)}receivedFeatureFlags(e,t){if(this._instance.persistence){this.ai=!0;var i=this.getFlagVariants(),s=this.getFlagPayloads(),r=this.getFlagsWithDetails();!function(e,t,i,s,r){void 0===i&&(i={}),void 0===s&&(s={}),void 0===r&&(r={});var n,o=((n=e.flags)?(e.featureFlags=Object.fromEntries(Object.keys(n).map(e=>{var t;return[e,null!=(t=n[e].variant)?t:n[e].enabled]})),e.featureFlagPayloads=Object.fromEntries(Object.keys(n).filter(e=>n[e].enabled).filter(e=>{var t;return null==(t=n[e].metadata)?void 0:t.payload}).map(e=>{var t;return[e,null==(t=n[e].metadata)?void 0:t.payload]}))):rh.warn("Using an older version of the feature flags endpoint. Please upgrade your PostHog server to the latest version"),e),a=o.flags,l=o.featureFlags,c=o.featureFlagPayloads;if(l){var u=e.requestId,h=e.evaluatedAt;if(C(l)){rh.warn("v1 of the feature flags endpoint is deprecated. Please use the latest version.");var d={};if(l)for(var p=0;p<l.length;p++)d[l[p]]=!0;t&&t.register({[rp]:l,[tH]:d})}else{var g=l,_=c,v=a;e.errorsWhileComputingFlags&&(g=y({},i,g),_=y({},s,_),v=y({},r,v)),t&&t.register(y({[rp]:Object.keys(ry(g)),[tH]:g||{},[r_]:_||{},[tU]:v||{}},u?{[rf]:u}:{},h?{[rm]:h}:{}))}}}(e,this._instance.persistence,i,s,r),this.bi(t)}}override(e,t){void 0===t&&(t=!1),rh.warn("override is deprecated. Please use overrideFeatureFlags instead."),this.overrideFeatureFlags({flags:e,suppressWarning:t})}overrideFeatureFlags(e){if(!this._instance.__loaded||!this._instance.persistence)return rh.uninitializedWarning("posthog.featureFlags.overrideFeatureFlags");if(!1===e)return this._instance.persistence.unregister(rg),this._instance.persistence.unregister(rv),this.bi(),rd.info("All overrides cleared");if(e&&"object"==typeof e&&("flags"in e||"payloads"in e)){var t;if(this.oi=!!(null!=(t=e.suppressWarning)&&t),"flags"in e){if(!1===e.flags)this._instance.persistence.unregister(rg),rd.info("Flag overrides cleared");else if(e.flags){if(C(e.flags)){for(var i={},s=0;s<e.flags.length;s++)i[e.flags[s]]=!0;this._instance.persistence.register({[rg]:i})}else this._instance.persistence.register({[rg]:e.flags});rd.info("Flag overrides set",{flags:e.flags})}}return"payloads"in e&&(!1===e.payloads?(this._instance.persistence.unregister(rv),rd.info("Payload overrides cleared")):e.payloads&&(this._instance.persistence.register({[rv]:e.payloads}),rd.info("Payload overrides set",{payloads:e.payloads}))),void this.bi()}this.bi()}onFeatureFlags(e){if(this.addFeatureFlagsHandler(e),this.ai){var{flags:t,flagVariants:i}=this.wi();e(t,i)}return()=>this.removeFeatureFlagsHandler(e)}updateEarlyAccessFeatureEnrollment(e,t,i){var s,r=(this._instance.get_property(tq)||[]).find(t=>t.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=y({},this.getFlagVariants(),{[e]:t});null==(s=this._instance.persistence)||s.register({[rp]:Object.keys(ry(a)),[tH]:a}),this.bi()}getEarlyAccessFeatures(e,t,i){void 0===t&&(t=!1);var s=this._instance.get_property(tq),r=i?"&"+i.map(e=>"stage="+e).join("&"):"";if(s&&!t)return e(s);this._instance._send_request({url:this._instance.requestRouter.endpointFor("api","/api/early_access_features/?token="+this._instance.config.token+r),method:"GET",callback:t=>{var i,s;if(t.json){var r=t.json.earlyAccessFeatures;return null==(i=this._instance.persistence)||i.unregister(tq),null==(s=this._instance.persistence)||s.register({[tq]:r}),e(r)}}})}wi(){var e=this.getFlags(),t=this.getFlagVariants();return{flags:e.filter(e=>t[e]),flagVariants:Object.keys(t).filter(e=>t[e]).reduce((e,i)=>(e[i]=t[i],e),{})}}bi(e){var{flags:t,flagVariants:i}=this.wi();
1this.featureFlagEventHandlers.forEach(s=>s(t,i,{errorsLoading:e}))}setPersonPropertiesForFlags(e,t){void 0===t&&(t=!0);var i=this._instance.get_property(tV)||{};this._instance.register({[tV]:y({},i,e)}),t&&this._instance.reloadFeatureFlags()}resetPersonPropertiesForFlags(){this._instance.unregister(tV)}setGroupPropertiesForFlags(e,t){void 0===t&&(t=!0);var i=this._instance.get_property(tB)||{};0!==Object.keys(i).length&&Object.keys(i).forEach(t=>{i[t]=y({},i[t],e[t]),delete e[t]}),this._instance.register({[tB]:y({},i,e)}),t&&this._instance.reloadFeatureFlags()}resetGroupPropertiesForFlags(e){if(e){var t=this._instance.get_property(tB)||{};this._instance.register({[tB]:y({},t,{[e]:{}})})}else this._instance.unregister(tB)}reset(){this.ai=!1,this.li=!1,this.ui=!1,this.hi=!1,this.di=!1,this.vi=!1,this.$anon_distinct_id=void 0,this.mi(),this.oi=!1}}var rE=["cookie","localstorage","localstorage+cookie","sessionstorage","memory"];class rx{constructor(e,t){this.R=e,this.props={},this.xi=!1,this.Ei=(e=>{var t="";return e.token&&(t=e.token.replace(/\+/g,"PL").replace(/\//g,"SL").replace(/=/g,"EQ")),e.persistence_name?"ph_"+e.persistence_name:"ph_"+t+"_posthog"})(e),this.Y=this.$i(e),this.load(),e.debug&&tc.info("Persistence loaded",e.persistence,y({},this.props)),this.update_config(e,e,t),this.save()}isDisabled(){return!!this.Si}$i(e){-1===rE.indexOf(e.persistence.toLowerCase())&&(tc.critical("Unknown persistence type "+e.persistence+"; falling back to localStorage+cookie"),e.persistence="localStorage+cookie");var t,i,r=(void 0===(t=e.cookie_persisted_properties||[])&&(t=[]),i=[...iz,...t],y({},iW,{W:function(e){try{var t={};try{t=iB.W(e)||{}}catch(e){}var i=tv(t,JSON.parse(iW.q(e)||"{}"));return iW.G(e,i),i}catch(e){}return null},G:function(e,t,s,r,n,o){try{iW.G(e,t,void 0,void 0,o);var a={};i.forEach(e=>{t[e]&&(a[e]=t[e])}),Object.keys(a).length&&iB.G(e,a,s,r,n,o)}catch(e){iW.B(e)}},V:function(e,t){try{null==s||s.localStorage.removeItem(e),iB.V(e,t)}catch(e){iW.B(e)}}})),n=e.persistence.toLowerCase();return"localstorage"===n&&iW.H()?iW:"localstorage+cookie"===n&&r.H()?r:"sessionstorage"===n&&iJ.H()?iJ:"memory"===n?iX:"cookie"===n?iB:r.H()?r:iB}properties(){var e={};return t_(this.props,function(t,i){if(i===tH&&O(t))for(var s,r=Object.keys(t),n=0;n<r.length;n++)e["$feature/"+r[n]]=t[r[n]];else s=!1,(N(t2)?s:a&&t2.indexOf===a?-1!=t2.indexOf(i):(t_(t2,function(e){if(s||(s=e===i))return tp}),s))||(e[i]=t)}),e}load(){if(!this.Si){var e=this.Y.W(this.Ei);e&&(this.props=tv({},e))}}save(){this.Si||this.Y.G(this.Ei,this.props,this.ki,this.Pi,this.Ti,this.R.debug)}remove(){this.Y.V(this.Ei,!1),this.Y.V(this.Ei,!0)}clear(){this.remove(),this.props={}}register_once(e,t,i){if(O(e)){A(t)&&(t="None"),this.ki=A(i)?this.Ii:i;var s=!1;if(t_(e,(e,i)=>{this.props.hasOwnProperty(i)&&this.props[i]!==t||(this.props[i]=e,s=!0)}),s)return this.save(),!0}return!1}register(e,t){if(O(e)){this.ki=A(t)?this.Ii:t;var i=!1;if(t_(e,(t,s)=>{e.hasOwnProperty(s)&&this.props[s]!==t&&(this.props[s]=t,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.xi){var e=sg(this.R.custom_campaign_params,this.R.mask_personal_data_properties,this.R.custom_personal_data_properties);M(tw(e))||this.register(e),this.xi=!0}}update_search_keyword(){var e;this.register((e=null==c?void 0:c.referrer)?sv(e):{})}update_referrer_info(){var e;this.register_once({$referrer:sm(),$referring_domain:null!=c&&c.referrer&&(null==(e=iS(c.referrer))?void 0:e.host)||"$direct"},void 0)}set_initial_person_info(){this.props[tK]||this.props[tJ]||this.register_once({[tZ]:sy(this.R.mask_personal_data_properties,this.R.custom_personal_data_properties)},void 0)}get_initial_props(){var e={};t_([tJ,tK],t=>{var i=this.props[t];i&&t_(i,function(t,i){e["$initial_"+P(i)]=t})});var t,i,s=this.props[tZ];return s&&tv(e,(t=sb(s),i={},t_(t,function(e,t){i["$initial_"+P(t)]=e}),i)),e}safe_merge(e){return t_(this.props,function(t,i){i in e||(e[i]=t)}),e}update_config(e,t,i){if(this.Ii=this.ki=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||!((e,t)=>{if(e.length!==t.length)return!1;var i=[...e].sort(),s=[...t].sort();return i.every((e,t)=>e===s[t])})(e.cookie_persisted_properties||[],t.cookie_persisted_properties||[])){var s=this.$i(e),r=this.props;this.clear(),this.Y=s,this.props=r,this.save()}}set_disabled(e){this.Si=e,this.Si?this.remove():this.save()}set_cross_subdomain(e){e!==this.Pi&&(this.Pi=e,this.remove(),this.save())}set_secure(e){e!==this.Ti&&(this.Ti=e,this.remove(),this.save())}set_event_timer(e,t){var i=this.props[t$]||{};i[e]=t,this.props[t$]=i,this.save()}remove_event_timer(e){var t=(this.props[t$]||{})[e];return A(t)||(delete this.props[t$][e],this.save()),t}get_property(e){return this.props[e]}set_property(e,t){this.props[e]=t,this.save()}}var rk=tu("[Product Tours]"),rS="ph_product_tours";class rP{constructor(e){this.Ci=null,this.Ri=null,this._instance=e}onRemoteConfig(e){this._instance.persistence&&this._instance.persistence.register({[tA]:!(null==e||!e.productTours)}),this.loadIfEnabled()}loadIfEnabled(){var e,t;this.Ci||(e=this._instance).config.disable_product_tours||null==(t=e.persistence)||!t.get_property(tA)||this.it(()=>this.Fi())}it(e){var t,i;null!=(t=_.__PosthogExtensions__)&&t.generateProductTours?e():null==(i=_.__PosthogExtensions__)||null==i.loadExternalDependency||i.loadExternalDependency(this._instance,"product-tours",t=>{t?rk.error("Could not load product tours script",t):e()})}Fi(){var e;!this.Ci&&null!=(e=_.__PosthogExtensions__)&&e.generateProductTours&&(this.Ci=_.__PosthogExtensions__.generateProductTours(this._instance,!0))}getProductTours(e,t){if(void 0===t&&(t=!1),!C(this.Ri)||t){var i=this._instance.persistence;if(i){var s=i.props[rS];if(C(s)&&!t)return this.Ri=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:t=>{var s=t.statusCode;if(200!==s||!t.json){var r="Product Tours API could not be loaded, status: "+s;return rk.error(r),void e([],{isLoaded:!1,error:r})}var n=C(t.json.product_tours)?t.json.product_tours:[];this.Ri=n,i&&i.register({[rS]:n}),e(n,{isLoaded:!0})}})}else e(this.Ri,{isLoaded:!0})}getActiveProductTours(e){j(this.Ci)?e([],{isLoaded:!1,error:"Product tours not loaded"}):this.Ci.getActiveProductTours(e)}showProductTour(e){var t;null==(t=this.Ci)||t.showTourById(e)}previewTour(e){this.Ci?this.Ci.previewTour(e):this.it(()=>{var t;this.Fi(),null==(t=this.Ci)||t.previewTour(e)})}dismissProductTour(){var e;null==(e=this.Ci)||e.dismissTour("user_clicked_skip")}nextStep(){var e;null==(e=this.Ci)||e.nextStep()}previousStep(){var e;null==(e=this.Ci)||e.previousStep()}clearCache(){var e;this.Ri=null,null==(e=this._instance.persistence)||e.unregister(rS)}resetTour(e){var t;null==(t=this.Ci)||t.resetTour(e)}resetAllTours(){var e;null==(e=this.Ci)||e.resetAllTours()}cancelPendingTour(e){var t;null==(t=this.Ci)||t.cancelPendingTour(e)}}var r$=function(e){return e.Activation="events",e.Cancellation="cancelEvents",e}({}),rR=(function(e){e.Button="button",e.Tab="tab",e.Selector="selector"}({}),function(e){e.TopLeft="top_left",e.TopRight="top_right",e.TopCenter="top_center",e.MiddleLeft="middle_left",e.MiddleRight="middle_right",e.MiddleCenter="middle_center",e.Left="left",e.Center="center",e.Right="right",e.NextToTrigger="next_to_trigger"}({}),function(e){e.Top="top",e.Left="left",e.Right="right",e.Bottom="bottom"}({}),function(e){return e.Popover="popover",e.API="api",e.Widget="widget",e.ExternalSurvey="external_survey",e}({})),rI=(function(e){e.Open="open",e.MultipleChoice="multiple_choice",e.SingleChoice="single_choice",e.Rating="rating",e.Link="link"}({}),function(e){e.NextQuestion="next_question",e.End="end",e.ResponseBased="response_based",e.SpecificQuestion="specific_question"}({}),function(e){e.Once="once",e.Recurring="recurring",e.Always="always"}({}),function(e){return e.SHOWN="survey shown",e.DISMISSED="survey dismissed",e.SENT="survey sent",e.ABANDONED="survey abandoned",e}({})),rF=function(e){return e.SURVEY_ID="$survey_id",e.SURVEY_NAME="$survey_name",e.SURVEY_RESPONSE="$survey_response",e.SURVEY_ITERATION="$survey_iteration",e.SURVEY_ITERATION_
1START_DATE="$survey_iteration_start_date",e.SURVEY_PARTIALLY_COMPLETED="$survey_partially_completed",e.SURVEY_SUBMISSION_ID="$survey_submission_id",e.SURVEY_QUESTIONS="$survey_questions",e.SURVEY_COMPLETED="$survey_completed",e.PRODUCT_TOUR_ID="$product_tour_id",e.SURVEY_LAST_SEEN_DATE="$survey_last_seen_date",e}({}),rC=function(e){return e.Popover="popover",e.Inline="inline",e}({}),rT=tu("[Surveys]"),rO="seenSurvey_",rM=e=>((e,t)=>{var i=""+e+t.id;return t.current_iteration&&t.current_iteration>0&&(i=""+e+t.id+"_"+t.current_iteration),i})(rO,e),rA=[rR.Popover,rR.Widget,rR.API],rL={ignoreConditions:!1,ignoreDelay:!1,displayType:rC.Popover};class rD{constructor(){this.Mi={},this.Mi={}}on(e,t){return this.Mi[e]||(this.Mi[e]=[]),this.Mi[e].push(t),()=>{this.Mi[e]=this.Mi[e].filter(e=>e!==t)}}emit(e,t){for(var i of this.Mi[e]||[])i(t);for(var s of this.Mi["*"]||[])s(e,t)}}function rN(e,t,i){if(j(e))return!1;switch(i){case"exact":return e===t;case"contains":return RegExp(t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&").replace(/_/g,".").replace(/%/g,".*"),"i").test(e);case"regex":try{return new RegExp(t).test(e)}catch(e){return!1}default:return!1}}class rj{constructor(e){this.Oi=new rD,this.Ai=(e,t)=>this.Di(e,t)&&this.ji(e,t)&&this.Li(e,t)&&this.Ni(e,t),this.Di=(e,t)=>null==t||!t.event||(null==e?void 0:e.event)===(null==t?void 0:t.event),this._instance=e,this.Ui=new Set,this.zi=new Set}init(){var e,t;A(null==(e=this._instance)?void 0:e.Hi)||null==(t=this._instance)||t.Hi((e,t)=>{this.on(e,t)})}register(e){var t,i;if(!A(null==(t=this._instance)?void 0:t.Hi)&&(e.forEach(e=>{var t,i;null==(t=this.zi)||t.add(e),null==(i=e.steps)||i.forEach(e=>{var t;null==(t=this.Ui)||t.add((null==e?void 0:e.event)||"")})}),null!=(i=this._instance)&&i.autocapture)){var s,r=new Set;e.forEach(e=>{var t;null==(t=e.steps)||t.forEach(e=>{null!=e&&e.selector&&r.add(null==e?void 0:e.selector)})}),null==(s=this._instance)||s.autocapture.setElementSelectors(r)}}on(e,t){var i;null!=t&&0!=e.length&&(this.Ui.has(e)||this.Ui.has(null==t?void 0:t.event))&&this.zi&&(null==(i=this.zi)?void 0:i.size)>0&&this.zi.forEach(e=>{this.Bi(t,e)&&this.Oi.emit("actionCaptured",e.name)})}qi(e){this.onAction("actionCaptured",t=>e(t))}Bi(e,t){if(null==(null==t?void 0:t.steps))return!1;for(var i of t.steps)if(this.Ai(e,i))return!0;return!1}onAction(e,t){return this.Oi.on(e,t)}ji(e,t){if(null!=t&&t.url){var i,s=null==e||null==(i=e.properties)?void 0:i.$current_url;if(!s||"string"!=typeof s||!rN(s,t.url,t.url_matching||"contains"))return!1}return!0}Li(e,t){return!!this.Wi(e,t)&&!!this.Gi(e,t)&&!!this.Vi(e,t)}Wi(e,t){if(null==t||!t.href)return!0;var i=this.Ji(e);if(i.length>0)return i.some(e=>rN(e.href,t.href,t.href_matching||"exact"));var s,r,n=(null==e||null==(s=e.properties)?void 0:s.$elements_chain)||"";return!!n&&rN((r=n.match(/(?::|")href="(.*?)"/))?r[1]:"",t.href,t.href_matching||"exact")}Gi(e,t){if(null==t||!t.text)return!0;var i=this.Ji(e);if(i.length>0)return i.some(e=>rN(e.text,t.text,t.text_matching||"exact")||rN(e.$el_text,t.text,t.text_matching||"exact"));var s,r,n,o,a=(null==e||null==(s=e.properties)?void 0:s.$elements_chain)||"";return!!a&&(r=function(e){for(var t,i=[],s=/(?::|")text="(.*?)"/g;!j(t=s.exec(e));)i.includes(t[1])||i.push(t[1]);return i}(a),n=t.text,o=t.text_matching||"exact",r.some(e=>rN(e,n,o)))}Vi(e,t){if(null==t||!t.selector)return!0;var i,s,r=null==e||null==(i=e.properties)?void 0:i.$element_selectors;if(null!=r&&r.includes(t.selector))return!0;var n=(null==e||null==(s=e.properties)?void 0:s.$elements_chain)||"";if(t.selector_regex&&n)try{return new RegExp(t.selector_regex).test(n)}catch(e){}return!1}Ji(e){var t;return null==(null==e||null==(t=e.properties)?void 0:t.$elements)?[]:null==e?void 0:e.properties.$elements}Ni(e,t){return null==t||!t.properties||0===t.properties.length||rl(t.properties.reduce((e,t)=>{var i=C(t.value)?t.value.map(String):null!=t.value?[String(t.value)]:[];return e[t.key]={values:i,operator:t.operator||"exact"},e},{}),null==e?void 0:e.properties)}}class rH{constructor(e){this._instance=e,this.Ki=new Map,this.Yi=new Map,this.Xi=new Map}Qi(e,t){return!!e&&rl(e.propertyFilters,null==t?void 0:t.properties)}Zi(e,t){var i=new Map;
1return e.forEach(e=>{var s;null==(s=e.conditions)||null==(s=s[t])||null==(s=s.values)||s.forEach(t=>{if(null!=t&&t.name){var s=i.get(t.name)||[];s.push(e.id),i.set(t.name,s)}})}),i}te(e,t,i){var s=(i===r$.Activation?this.Ki:this.Yi).get(e),r=[];return this.ie(e=>{r=e.filter(e=>null==s?void 0:s.includes(e.id))}),r.filter(s=>{var r,n=null==(r=s.conditions)||null==(r=r[i])||null==(r=r.values)?void 0:r.find(t=>t.name===e);return this.Qi(n,t)})}register(e){var t;A(null==(t=this._instance)?void 0:t.Hi)||(this.ee(e),this.re(e))}re(e){var t=e.filter(e=>{var t,i;return(null==(t=e.conditions)?void 0:t.actions)&&(null==(i=e.conditions)||null==(i=i.actions)||null==(i=i.values)?void 0:i.length)>0});0!==t.length&&(null==this.se&&(this.se=new rj(this._instance),this.se.init(),this.se.qi(e=>{this.onAction(e)})),t.forEach(e=>{var t,i,s,r,n;e.conditions&&null!=(t=e.conditions)&&t.actions&&null!=(i=e.conditions)&&null!=(i=i.actions)&&i.values&&(null==(s=e.conditions)||null==(s=s.actions)||null==(s=s.values)?void 0:s.length)>0&&(null==(r=this.se)||r.register(e.conditions.actions.values),null==(n=e.conditions)||null==(n=n.actions)||null==(n=n.values)||n.forEach(t=>{if(t&&t.name){var i=this.Xi.get(t.name);i&&i.push(e.id),this.Xi.set(t.name,i||[e.id])}}))}))}ee(e){var t,i=e.filter(e=>{var t,i;return(null==(t=e.conditions)?void 0:t.events)&&(null==(i=e.conditions)||null==(i=i.events)||null==(i=i.values)?void 0:i.length)>0}),s=e.filter(e=>{var t,i;return(null==(t=e.conditions)?void 0:t.cancelEvents)&&(null==(i=e.conditions)||null==(i=i.cancelEvents)||null==(i=i.values)?void 0:i.length)>0});(0!==i.length||0!==s.length)&&(null==(t=this._instance)||t.Hi((e,t)=>{this.onEvent(e,t)}),this.Ki=this.Zi(e,r$.Activation),this.Yi=this.Zi(e,r$.Cancellation))}onEvent(e,t){var i,s=this.ne(),r=this.oe(),n=this.ae(),o=(null==(i=this._instance)||null==(i=i.persistence)?void 0:i.props[r])||[];if(n===e&&t&&o.length>0){s.info("event matched, removing item from activated items",{event:e,eventPayload:t,existingActivatedItems:o});var a,l,c=(null==t||null==(a=t.properties)?void 0:a.$survey_id)||(null==t||null==(l=t.properties)?void 0:l.$product_tour_id);if(c){var u=o.indexOf(c);u>=0&&(o.splice(u,1),this.le(o))}}else{if(this.Yi.has(e)){var h=this.te(e,t,r$.Cancellation);h.length>0&&(s.info("cancel event matched, cancelling items",{event:e,itemsToCancel:h.map(e=>e.id)}),h.forEach(e=>{var t=o.indexOf(e.id);t>=0&&o.splice(t,1),this.ue(e.id)}),this.le(o))}if(this.Ki.has(e)){s.info("event name matched",{event:e,eventPayload:t,items:this.Ki.get(e)});var d=this.te(e,t,r$.Activation);this.le(o.concat(d.map(e=>e.id)||[]))}}}onAction(e){var t,i=this.oe(),s=(null==(t=this._instance)||null==(t=t.persistence)?void 0:t.props[i])||[];this.Xi.has(e)&&this.le(s.concat(this.Xi.get(e)||[]))}le(e){var t,i=this.ne(),s=this.oe(),r=[...new Set(e)].filter(e=>!this.he(e));i.info("updating activated items",{activatedItems:r}),null==(t=this._instance)||null==(t=t.persistence)||t.register({[s]:r})}getActivatedIds(){var e,t=this.oe();return(null==(e=this._instance)||null==(e=e.persistence)?void 0:e.props[t])||[]}getEventToItemsMap(){return this.Ki}de(){return this.se}}class rq extends rH{constructor(e){super(e)}oe(){return"$surveys_activated"}ae(){return rI.SHOWN}ie(e){var t;null==(t=this._instance)||t.getSurveys(e)}ue(e){var t;null==(t=this._instance)||t.cancelPendingSurvey(e)}ne(){return rT}he(){return!1}getSurveys(){return this.getActivatedIds()}getEventToSurveys(){return this.getEventToItemsMap()}}class rU{constructor(e){this.ve=void 0,this._surveyManager=null,this.ce=!1,this.fe=[],this.pe=null,this._instance=e,this._surveyEventReceiver=null}onRemoteConfig(e){if(!this._instance.config.disable_surveys){var t=e.surveys;if(j(t))return rT.warn("Flags not loaded yet. Not loading surveys.");var i=C(t);this.ve=i?t.length>0:t,rT.info("flags response received, isSurveysEnabled: "+this.ve),this.loadIfEnabled()}}reset(){localStorage.removeItem("lastSeenSurveyDate");for(var e=[],t=0;t<localStorage.length;t++){var i=localStorage.key(t);(null!=i&&i.startsWith(rO)||null!=i&&i.startsWith("inProgressSurvey_"))&&e.push(i)}
1e.forEach(e=>localStorage.removeItem(e))}loadIfEnabled(){if(!this._surveyManager)if(this.ce)rT.info("Already initializing surveys, skipping...");else if(this._instance.config.disable_surveys)rT.info("Disabled. Not loading surveys.");else if(this._instance.config.cookieless_mode&&this._instance.consent.isOptedOut())rT.info("Not loading surveys in cookieless mode without consent.");else{var e=null==_?void 0:_.__PosthogExtensions__;if(e){if(!A(this.ve)||this._instance.config.advanced_enable_surveys){var t=this.ve||this._instance.config.advanced_enable_surveys;this.ce=!0;try{var i=e.generateSurveys;if(i)return void this.ge(i,t);var s=e.loadExternalDependency;if(!s)return void this._e("PostHog loadExternalDependency extension not found.");s(this._instance,"surveys",i=>{i||!e.generateSurveys?this._e("Could not load surveys script",i):this.ge(e.generateSurveys,t)})}catch(e){throw this._e("Error initializing surveys",e),e}finally{this.ce=!1}}}else rT.error("PostHog Extensions not found.")}}ge(e,t){this._surveyManager=e(this._instance,t),this._surveyEventReceiver=new rq(this._instance),rT.info("Surveys loaded successfully"),this.me({isLoaded:!0})}_e(e,t){rT.error(e,t),this.me({isLoaded:!1,error:e})}onSurveysLoaded(e){return this.fe.push(e),this._surveyManager&&this.me({isLoaded:!0}),()=>{this.fe=this.fe.filter(t=>t!==e)}}getSurveys(e,t){if(void 0===t&&(t=!1),this._instance.config.disable_surveys)return rT.info("Disabled. Not loading surveys."),e([]);var i,s=this._instance.get_property(tG);if(s&&!t)return e(s,{isLoaded:!0});"undefined"!=typeof Promise&&this.pe?this.pe.then(t=>{var{surveys:i,context:s}=t;return e(i,s)}):("undefined"!=typeof Promise&&(this.pe=new Promise(e=>{i=e})),this._instance._send_request({url:this._instance.requestRouter.endpointFor("api","/api/surveys/?token="+this._instance.config.token),method:"GET",timeout:this._instance.config.surveys_request_timeout_ms,callback:t=>{this.pe=null;var s=t.statusCode;if(200!==s||!t.json){var r="Surveys API could not be loaded, status: "+s;rT.error(r);var n={isLoaded:!1,error:r};return e([],n),void(null==i||i({surveys:[],context:n}))}var o,a,l=t.json.surveys||[],c=l.filter(e=>{var t,i;return!(!e.start_date||e.end_date)&&(!(null==(t=e.conditions)||null==(t=t.events)||null==(t=t.values)||!t.length)||!(null==(i=e.conditions)||null==(i=i.actions)||null==(i=i.values)||!i.length))});c.length>0&&(null==(a=this._surveyEventReceiver)||a.register(c)),null==(o=this._instance.persistence)||o.register({[tG]:l});var u={isLoaded:!0};e(l,u),null==i||i({surveys:l,context:u})}}))}me(e){for(var t of this.fe)try{if(!e.isLoaded)return t([],e);this.getSurveys(t)}catch(e){rT.error("Error in survey callback",e)}}getActiveMatchingSurveys(e,t){if(void 0===t&&(t=!1),!j(this._surveyManager))return this._surveyManager.getActiveMatchingSurveys(e,t);rT.warn("init was not called")}ye(e){var t=null;return this.getSurveys(i=>{var s;t=null!=(s=i.find(t=>t.id===e))?s:null}),t}be(e){if(j(this._surveyManager))return{eligible:!1,reason:"SDK is not enabled or survey functionality is not yet loaded"};var t="string"==typeof e?this.ye(e):e;return t?this._surveyManager.checkSurveyEligibility(t):{eligible:!1,reason:"Survey not found"}}canRenderSurvey(e){if(j(this._surveyManager))return rT.warn("init was not called"),{visible:!1,disabledReason:"SDK is not enabled or survey functionality is not yet loaded"};var t=this.be(e);return{visible:t.eligible,disabledReason:t.reason}}canRenderSurveyAsync(e,t){return j(this._surveyManager)?(rT.warn("init was not called"),Promise.resolve({visible:!1,disabledReason:"SDK is not enabled or survey functionality is not yet loaded"})):new Promise(i=>{this.getSurveys(t=>{var s,r=null!=(s=t.find(t=>t.id===e))?s:null;if(r){var n=this.be(r);i({visible:n.eligible,disabledReason:n.reason})}else i({visible:!1,disabledReason:"Survey not found"})},t)})}renderSurvey(e,t,i){var s;if(j(this._surveyManager))rT.warn("init was not called");else{var r="string"==typeof e?this.ye(e):e;if(null!=r&&r.id)if(rA.includes(r.type)){var n=null==c?void 0:c.querySelector(t);if(n)return null!=(s=r.appearance)&&s.surveyPopupDelaySeconds?(rT.info("Rendering survey "+r.id+" with delay of "+r.appearance.surveyPopupDelaySeconds+" seconds"),void setTimeout(()=>{var e,t;rT.info("Rendering survey "+r.id+" with delay of "+(null==(e=r.appearance)?void 0:e.surveyPopupDelaySeconds)+" seconds"),null==(t=this._surveyManager)||t.renderSurvey(r,n,i),rT.info("Survey "+r.id+" rendered")},1e3*r.appearance.surveyPopupDelaySeconds)):void this._surveyManager.renderSurvey(r,n,i);rT.warn("Survey element not found")}else rT.warn("Surveys of type "+r.type+" cannot be rendered in the app");else rT.warn("Survey not found")}}displaySurvey(e,t){var i;if(j(this._surveyManager))rT.warn("init was not called");else{var s=this.ye(e);if(s){var r=s;if(null!=(i=s.appearance)&&i.surveyPopupDelaySeconds&&t.ignoreDelay&&(r=y({},s,{appearance:y({},s.appearance,{surveyPopupDelaySeconds:0})}
1)),!1===t.ignoreConditions){var n=this.canRenderSurvey(s);if(!n.visible)return void rT.warn("Survey is not eligible to be displayed: ",n.disabledReason)}t.displayType!==rC.Inline?this._surveyManager.handlePopoverSurvey(r,t.properties):this.renderSurvey(r,t.selector,t.properties)}else rT.warn("Survey not found")}}cancelPendingSurvey(e){j(this._surveyManager)?rT.warn("init was not called"):this._surveyManager.cancelSurvey(e)}handlePageUnload(){var e;null==(e=this._surveyManager)||e.handlePageUnload()}}var rV=tu("[Conversations]");class rB{constructor(e){this.we=void 0,this._conversationsManager=null,this.xe=!1,this.Ee=null,this._instance=e}onRemoteConfig(e){if(!this._instance.config.disable_conversations){var t=e.conversations;j(t)||(U(t)?this.we=t:(this.we=t.enabled,this.Ee=t),this.loadIfEnabled())}}reset(){var e;null==(e=this._conversationsManager)||e.reset(),this._conversationsManager=null,this.we=void 0,this.Ee=null}loadIfEnabled(){if(!this._conversationsManager&&!this.xe&&!(this._instance.config.disable_conversations||this._instance.config.cookieless_mode&&this._instance.consent.isOptedOut())){var e=null==_?void 0:_.__PosthogExtensions__;if(e&&!A(this.we)&&this.we)if(this.Ee&&this.Ee.token){this.xe=!0;try{var t=e.initConversations;if(t)return this.$e(t),void(this.xe=!1);var i=e.loadExternalDependency;if(!i)return void this.Se("PostHog loadExternalDependency extension not found.");i(this._instance,"conversations",t=>{t||!e.initConversations?this.Se("Could not load conversations script",t):this.$e(e.initConversations),this.xe=!1})}catch(e){this.Se("Error initializing conversations",e),this.xe=!1}}else rV.error("Conversations enabled but missing token in remote config.")}}$e(e){if(this.Ee)try{this._conversationsManager=e(this.Ee,this._instance),rV.info("Conversations loaded successfully")}catch(e){this.Se("Error completing conversations initialization",e)}else rV.error("Cannot complete initialization: remote config is null")}Se(e,t){rV.error(e,t),this._conversationsManager=null,this.xe=!1}show(){this._conversationsManager?this._conversationsManager.show():rV.warn("Conversations not loaded yet.")}hide(){this._conversationsManager&&this._conversationsManager.hide()}isAvailable(){return!0===this.we&&!N(this._conversationsManager)}isVisible(){var e,t;return null!=(e=null==(t=this._conversationsManager)?void 0:t.isVisible())&&e}sendMessage(e,t,i){var s=this;return m(function*(){return s._conversationsManager?s._conversationsManager.sendMessage(e,t,i):(rV.warn("Conversations not available yet."),null)})()}getMessages(e,t){var i=this;return m(function*(){return i._conversationsManager?i._conversationsManager.getMessages(e,t):(rV.warn("Conversations not available yet."),null)})()}markAsRead(e){var t=this;return m(function*(){return t._conversationsManager?t._conversationsManager.markAsRead(e):(rV.warn("Conversations not available yet."),null)})()}getTickets(e){var t=this;return m(function*(){return t._conversationsManager?t._conversationsManager.getTickets(e):(rV.warn("Conversations not available yet."),null)})()}getCurrentTicketId(){var e,t;return null!=(e=null==(t=this._conversationsManager)?void 0:t.getCurrentTicketId())?e:null}getWidgetSessionId(){var e,t;return null!=(e=null==(t=this._conversationsManager)?void 0:t.getWidgetSessionId())?e:null}}class rG{constructor(e){var t;this.ke=!1,this.Pe=!1,this._instance=e,this._instance&&null!=(t=this._instance.config.logs)&&t.captureConsoleLogs&&(this.ke=!0)}onRemoteConfig(e){var t,i=null==(t=e.logs)?void 0:t.captureConsoleLogs;!j(i)&&i&&(this.ke=!0,this.loadIfEnabled())}reset(){}loadIfEnabled(){if(this.ke&&!this.Pe){var e=tu("[logs]"),t=null==_?void 0:_.__PosthogExtensions__;if(t){var i=t.loadExternalDependency;i?i(this._instance,"logs",i=>{var s;i||null==(s=t.logs)||!s.initializeLogs?e.error("Could not load logs script",i):(t.logs.initializeLogs(this._instance),this.Pe=!0)}):e.error("PostHog loadExternalDependency extension not found.")}else e.error("PostHog Extensions not found.")}}}var rW=tu("[RateLimiter]");class rz{constructor(e){var t,i;this.serverLimits={},this.lastEventRateLimited=!1,this.checkForLimiting=e=>{var t=e.text;
1if(t&&t.length)try{(JSON.parse(t).quota_limited||[]).forEach(e=>{rW.info((e||"events")+" is quota limited."),this.serverLimits[e]=(new Date).getTime()+6e4})}catch(e){return void rW.warn('could not rate limit - continuing. Error: "'+(null==e?void 0:e.message)+'"',{text:t})}},this.instance=e,this.captureEventsPerSecond=(null==(t=e.config.rate_limiting)?void 0:t.events_per_second)||10,this.captureEventsBurstLimit=Math.max((null==(i=e.config.rate_limiting)?void 0:i.events_burst_limit)||10*this.captureEventsPerSecond,this.captureEventsPerSecond),this.lastEventRateLimited=this.clientRateLimitContext(!0).isRateLimited}clientRateLimitContext(e){void 0===e&&(e=!1);var t,i,s,r=(new Date).getTime(),n=null!=(t=null==(i=this.instance.persistence)?void 0:i.get_property(tX))?t:{tokens:this.captureEventsBurstLimit,last:r};n.tokens+=(r-n.last)/1e3*this.captureEventsPerSecond,n.last=r,n.tokens>this.captureEventsBurstLimit&&(n.tokens=this.captureEventsBurstLimit);var o=n.tokens<1;return o||e||(n.tokens=Math.max(0,n.tokens-1)),!o||this.lastEventRateLimited||e||this.instance.capture("$$client_ingestion_warning",{$$client_ingestion_warning_message:"posthog-js client rate limited. Config is set to "+this.captureEventsPerSecond+" events per second and "+this.captureEventsBurstLimit+" events burst limit."},{skip_client_rate_limiting:!0}),this.lastEventRateLimited=o,null==(s=this.instance.persistence)||s.set_property(tX,n),{isRateLimited:o,remainingTokens:n.tokens}}isServerRateLimited(e){var t=this.serverLimits[e||"events"]||!1;return!1!==t&&(new Date).getTime()<t}}var rY=tu("[RemoteConfig]");class rX{constructor(e){this._instance=e}get remoteConfig(){var e;return null==(e=_._POSTHOG_REMOTE_CONFIG)||null==(e=e[this._instance.config.token])?void 0:e.config}Te(e){var t,i;null!=(t=_.__PosthogExtensions__)&&t.loadExternalDependency?null==(i=_.__PosthogExtensions__)||null==i.loadExternalDependency||i.loadExternalDependency(this._instance,"remote-config",()=>e(this.remoteConfig)):(rY.error("PostHog Extensions not found. Cannot load remote config."),e())}Ie(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 rY.info("Using preloaded remote config",this.remoteConfig),void this.yi(this.remoteConfig);if(this._instance.O())return void rY.warn("Remote config is disabled. Falling back to local config.");this.Te(e=>{if(!e)return rY.info("No config found after loading remote JS config. Falling back to JSON."),void this.Ie(e=>{this.yi(e)});this.yi(e)})}catch(e){rY.error("Error loading remote config",e)}}yi(e){e?this._instance.config.__preview_remote_config?(this._instance.yi(e),!1!==e.hasFeatureFlags&&this._instance.featureFlags.ensureFlagsLoaded()):rY.info("__preview_remote_config is disabled. Logging config instead",e):rY.error("Failed to fetch remote config from PostHog.")}}class rK{constructor(e,t){this.Ce=!0,this.Re=[],this.Fe=K((null==t?void 0:t.flush_interval_ms)||3e3,250,5e3,tc.createLogger("flush interval"),3e3),this.Me=e}enqueue(e){this.Re.push(e),this.Oe||this.Ae()}unload(){this.De();var e=Object.values(this.Re.length>0?this.je():{});[...e.filter(e=>0===e.url.indexOf("/e")),...e.filter(e=>0!==e.url.indexOf("/e"))].map(e=>{this.Me(y({},e,{transport:"sendBeacon"}))})}enable(){this.Ce=!1,this.Ae()}Ae(){var e=this;this.Ce||(this.Oe=setTimeout(()=>{if(this.De(),this.Re.length>0){var t=this.je();for(var i in t)!function(){var s=t[i],r=(new Date).getTime();s.data&&C(s.data)&&t_(s.data,e=>{e.offset=Math.abs(e.timestamp-r),delete e.timestamp}),e.Me(s)}()}},this.Fe))}De(){clearTimeout(this.Oe),this.Oe=void 0}je(){var e={};return t_(this.Re,t=>{var i,s=(t?t.batchKey:null)||t.url;A(e[s])&&(e[s]=y({},t,{data:[]})),null==(i=e[s].data)||i.push(t.data)}),this.Re=[],e}}var rJ=["retriesPerformedSoFar"];class rZ{constructor(e){this.Le=!1,this.Ne=3e3,this.Re=[],this._instance=e,this.Re=[],this.Ue=!0,!A(s)&&"onLine"in s.navigator&&(this.Ue=s.navigator.onLine,this.ze=()=>{this.Ue=!0,this.Lt()},this.He=()=>{this.Ue=!1},tk(s,"online",this.ze),tk(s,"offline",this.He))}get length(){return this.Re.length}retriableRequest(e){var{retriesPerformedSoFar:t}=e,i=b(e,rJ);q(t)&&(i.url=re(i.url,{retry_count:t})),this._instance._send_request(y({},i,{callback:e=>{200!==e.statusCode&&(e.statusCode<400||e.statusCode>=500)&&(null!=t?t:0)<10?this.Be(y({retriesPerformedSoFar:t},i)):null==i.callback||i.callback(e)}}))}Be(e){var t,i,s,r=e.retriesPerformedSoFar||0;e.retriesPerformedSoFar=r+1;var n=(s=(Math.random()-.5)*((i=Math.min(18e5,t=3e3*Math.pow(2,r)))-t/2),Math.ceil(i+s)),o=Date.now()+n;this.Re.push({retryAt:o,requestOptions:e});var a="Enqueued failed request for retry in "+n;navigator.onLine||(a+=" (Browser is offline)"),tc.warn(a),this.Le||(this.Le=!0,this.qe())}qe(){if(this.We&&clearTimeout(this.We),0===this.Re.length)return this.Le=!1,void(this.We=void 0);this.We=setTimeout(()=>{this.Ue&&this.Re.length>0&&this.Lt(),this.qe()},this.Ne)}
1Lt(){var e=Date.now(),t=[],i=this.Re.filter(i=>i.retryAt<e||(t.push(i),!1));if(this.Re=t,i.length>0)for(var{requestOptions:s}of i)this.retriableRequest(s)}unload(){for(var{requestOptions:e}of(this.We&&(clearTimeout(this.We),this.We=void 0),this.Le=!1,A(s)||(this.ze&&(s.removeEventListener("online",this.ze),this.ze=void 0),this.He&&(s.removeEventListener("offline",this.He),this.He=void 0)),this.Re))try{this._instance._send_request(y({},e,{transport:"sendBeacon"}))}catch(e){tc.error(e)}this.Re=[]}}class rQ{constructor(e){this.Ge=()=>{this.Ve||(this.Ve={});var e,t,i,s,r=this.scrollElement(),n=this.scrollY(),o=r?Math.max(0,r.scrollHeight-r.clientHeight):0,a=n+((null==r?void 0:r.clientHeight)||0),l=(null==r?void 0:r.scrollHeight)||0;this.Ve.lastScrollY=Math.ceil(n),this.Ve.maxScrollY=Math.max(n,null!=(e=this.Ve.maxScrollY)?e:0),this.Ve.maxScrollHeight=Math.max(o,null!=(t=this.Ve.maxScrollHeight)?t:0),this.Ve.lastContentY=a,this.Ve.maxContentY=Math.max(a,null!=(i=this.Ve.maxContentY)?i:0),this.Ve.maxContentHeight=Math.max(l,null!=(s=this.Ve.maxContentHeight)?s:0)},this._instance=e}getContext(){return this.Ve}resetContext(){var e=this.Ve;return setTimeout(this.Ge,0),e}startMeasuringScrollPosition(){tk(s,"scroll",this.Ge,{capture:!0}),tk(s,"scrollend",this.Ge,{capture:!0}),tk(s,"resize",this.Ge)}scrollElement(){if(!this._instance.config.scroll_root_selector)return null==s?void 0:s.document.documentElement;for(var e of C(this._instance.config.scroll_root_selector)?this._instance.config.scroll_root_selector:[this._instance.config.scroll_root_selector]){var t=null==s?void 0:s.document.querySelector(e);if(t)return t}}scrollY(){if(this._instance.config.scroll_root_selector){var e=this.scrollElement();return e&&e.scrollTop||0}return s&&(s.scrollY||s.pageYOffset||s.document.documentElement.scrollTop)||0}scrollX(){if(this._instance.config.scroll_root_selector){var e=this.scrollElement();return e&&e.scrollLeft||0}return s&&(s.scrollX||s.pageXOffset||s.document.documentElement.scrollLeft)||0}}var r0=e=>sy(null==e?void 0:e.config.mask_personal_data_properties,null==e?void 0:e.config.custom_personal_data_properties);class r1{constructor(e,t,i,s){this.Je=e=>{var t=this.Ke();if(!t||t.sessionId!==e){var i={sessionId:e,props:this.Ye(this._instance)};this.Xe.register({[tY]:i})}},this._instance=e,this.Qe=t,this.Xe=i,this.Ye=s||r0,this.Qe.onSessionId(this.Je)}Ke(){return this.Xe.props[tY]}getSetOnceProps(){var e,t=null==(e=this.Ke())?void 0:e.props;return t?"r"in t?sb(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 t_(tw(this.getSetOnceProps()),(t,i)=>{"$current_url"===i&&(i="url"),e["$session_entry_"+P(i)]=t}),e}}var r2=tu("[SessionId]");class r3{on(e,t){return this.Ze.on(e,t)}constructor(e,t,i){if(this.tr=[],this.ir=void 0,this.Ze=new rD,this.er=(e,t)=>!(!q(e)||!q(t))&&Math.abs(e-t)>this.sessionTimeoutMs,!e.persistence)throw Error("SessionIdManager requires a PostHogPersistence instance");if("always"===e.config.cookieless_mode)throw Error('SessionIdManager cannot be used with cookieless_mode="always"');this.R=e.config,this.Xe=e.persistence,this.rr=void 0,this.sr=void 0,this._sessionStartTimestamp=null,this._sessionActivityTimestamp=null,this.nr=t||iH,this.ar=i||iH;var s,r=this.R.persistence_name||this.R.token,n=this.R.session_idle_timeout_seconds||1800;if(this._sessionTimeoutMs=1e3*K(n,60,36e3,r2.createLogger("session_idle_timeout_seconds"),1800),e.register({$configured_session_timeout_ms:this._sessionTimeoutMs}),this.lr(),this.ur="ph_"+r+"_window_id",this.hr="ph_"+r+"_primary_window_exists",this.dr()){var o=iJ.W(this.ur),a=iJ.W(this.hr);o&&!a?this.rr=o:iJ.V(this.ur),iJ.G(this.hr,!0)}if(null!=(s=this.R.bootstrap)&&s.sessionID)try{var l=(e=>{var t=e.replace(/-/g,"");if(32!==t.length)throw Error("Not a valid UUID");if("7"!==t[12])throw Error("Not a UUIDv7");return parseInt(t.substring(0,12),16)})(this.R.bootstrap.sessionID);this.vr(this.R.bootstrap.sessionID,(new Date).getTime(),l)}catch(e){r2.error("Invalid sessionID in bootstrap",e)}this.cr()}get sessionTimeoutMs(){return this._sessionTimeoutMs}onSessionId(e){return A(this.tr)&&(this.tr=[]),this.tr.push(e),this.sr&&e(this.sr,this.rr),()=>{this.tr=this.tr.filter(t=>t!==e)}}dr(){return"memory"!==this.R.persistence&&!this.Xe.Si&&iJ.H()}pr(e){e!==this.rr&&(this.rr=e,this.dr()&&iJ.G(this.ur,e))}gr(){return this.rr?this.rr:this.dr()?iJ.W(this.ur):null}vr(e,t,i){e===this.sr&&t===this._sessionActivityTimestamp&&i===this._sessionStartTimestamp||(this._sessionStartTimestamp=i,this._sessionActivityTimestamp=t,this.sr=e,this.Xe.register({[tN]:[t,e,i]}))}_r(){var e=this.Xe.props[tN];return C(e)&&2===e.length&&e.push(e[0]),e||[0,null,0]}resetSessionId(){this.vr(null,null,null)}destroy(){clearTimeout(this.mr),this.mr=void 0,this.ir&&s&&(s.removeEventListener("beforeunload",this.ir,{capture:!1}),this.ir=void 0),this.tr=[]}cr(){this.ir=()=>{this.dr()&&iJ.V(this.hr)},tk(s,"beforeunload",this.ir,{capture:!1})}
1checkAndGetSessionAndWindowId(e,t){if(void 0===e&&(e=!1),void 0===t&&(t=null),"always"===this.R.cookieless_mode)throw Error('checkAndGetSessionAndWindowId should not be called with cookieless_mode="always"');var i=t||(new Date).getTime(),[s,r,n]=this._r(),o=this.gr(),a=q(n)&&Math.abs(i-n)>864e5,l=!1,c=!r,u=!c&&!e&&this.er(i,s);c||u||a?(r=this.nr(),o=this.ar(),r2.info("new session ID generated",{sessionId:r,windowId:o,changeReason:{noSessionId:c,activityTimeout:u,sessionPastMaximumLength:a}}),n=i,l=!0):o||(o=this.ar(),l=!0);var h=q(s)&&e&&!a?s:i,d=q(n)?n:(new Date).getTime();return this.pr(o),this.vr(r,h,d),e||this.lr(),l&&this.tr.forEach(e=>e(r,o,l?{noSessionId:c,activityTimeout:u,sessionPastMaximumLength:a}:void 0)),{sessionId:r,windowId:o,sessionStartTimestamp:d,changeReason:l?{noSessionId:c,activityTimeout:u,sessionPastMaximumLength:a}:void 0,lastActivityTimestamp:s}}lr(){clearTimeout(this.mr),this.mr=setTimeout(()=>{var[e]=this._r();if(this.er((new Date).getTime(),e)){var t=this.sr;this.resetSessionId(),this.Ze.emit("forcedIdleReset",{idleSessionId:t})}},1.1*this.sessionTimeoutMs)}}var r5=["$set_once","$set"],r8=tu("[SiteApps]");class r6{constructor(e){this._instance=e,this.yr=[],this.apps={}}get isEnabled(){return!!this._instance.config.opt_in_site_apps}br(e,t){if(t){var i=this.globalsForEvent(t);this.yr.push(i),this.yr.length>1e3&&(this.yr=this.yr.slice(10))}}get siteAppLoaders(){var e;return null==(e=_._POSTHOG_REMOTE_CONFIG)||null==(e=e[this._instance.config.token])?void 0:e.siteApps}init(){if(this.isEnabled){var e=this._instance.Hi(this.br.bind(this));this.wr=()=>{e(),this.yr=[],this.wr=void 0}}}globalsForEvent(e){if(!e)throw Error("Event payload is required");var t,i,s,r,n,o,a,l={},c=this._instance.get_property("$groups")||[];for(var[u,h]of Object.entries(this._instance.get_property("$stored_group_properties")||{}))l[u]={id:c[u],type:u,properties:h};var{$set_once:d,$set:p}=e;return{event:y({},b(e,r5),{properties:y({},e.properties,p?{$set:y({},null!=(t=null==(i=e.properties)?void 0:i.$set)?t:{},p)}:{},d?{$set_once:y({},null!=(s=null==(r=e.properties)?void 0:r.$set_once)?s:{},d)}:{}),elements_chain:null!=(n=null==(o=e.properties)?void 0:o.$elements_chain)?n:"",distinct_id:null==(a=e.properties)?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 i;!t.errored&&this.yr.length&&(r8.info("Processing "+this.yr.length+" events for site app with id "+e.id),this.yr.forEach(e=>null==t.processEvent?void 0:t.processEvent(e)),t.processedBuffer=!0),Object.values(this.apps).every(e=>e.processedBuffer||e.errored)&&(null==(i=this.wr)||i.call(this))},s=!1,r=r=>{t.errored=!r,t.loaded=!0,r8.info("Site app with id "+e.id+" "+(r?"loaded":"errored")),s&&i()};try{var{processEvent:n}=e.init({posthog:this._instance,callback:e=>{r(e)}});n&&(t.processEvent=n),s=!0}catch(t){r8.error("Error while initializing PostHog app with config id "+e.id,t),r(!1)}if(s&&t.loaded)try{i()}catch(i){r8.error("Error while processing buffered events PostHog app with config id "+e.id,i),t.errored=!0}}Er(){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)}$r(e){if(0!==Object.keys(this.apps).length){var t=this.globalsForEvent(e);for(var i of Object.values(this.apps))try{null==i.processEvent||i.processEvent(t)}catch(t){r8.error("Error while processing event "+e.event+" for site app "+i.id,t)}}}onRemoteConfig(e){var t,i,s,r=this;if(null!=(t=this.siteAppLoaders)&&t.length)return this.isEnabled?(this.Er(),void this._instance.on("eventCaptured",e=>this.$r(e))):void r8.error('PostHog site apps are disabled. Enable the "opt_in_site_apps" config to proceed.');if(null==(i=this.wr)||i.call(this),null!=(s=e.siteApps)&&s.length)if(this.isEnabled){var n=function(e){var t;_["__$$ph_site_app_"+e]=r._instance,null==(t=_.__PosthogExtensions__)||null==t.loadSiteApp||t.loadSiteApp(r._instance,a,t=>{if(t)return r8.error("Error while initializing PostHog app with config id "+e,t)})};for(var{id:o,url:a}of e.siteApps)n(o)}else r8.error('PostHog site apps are disabled. Enable the "opt_in_site_apps" config to proceed.')}}var r4=function(e,t){if(!e)return!1;var i=e.userAgent;if(i&&E(i,t))return!0;try{var s=null==e?void 0:e.userAgentData;if(null!=s&&s.brands&&s.brands.some(e=>E(null==e?void 0:e.brand,t)))return!0}catch(e){}return!!e.webdriver},r7=function(e){return e.US="us",e.EU="eu",e.CUSTOM="custom",e}({}),r9="i.posthog.com";class ne{constructor(e){this.Sr={},this.instance=e}get apiHost(){var e=this.instance.config.api_host.trim().replace(/\/$/,"");return"https://app.posthog.com"===e?"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=null==(e=this.instance.config.ui_host)?void 0:e.replace(/\/$/,"");return t||(t=this.apiHost.replace("."+r9,".posthog.com")),"https://app.posthog.com"===t?"https://us.posthog.com":t}get region(){return this.Sr[this.apiHost]||(/https:\/\/(app|us|us-assets)(\.i)?\.posthog\.com/i.test(this.apiHost)?this.Sr[this.apiHost]=r7.US:/https:\/\/(eu|eu-assets)(\.i)?\.posthog\.com/i.test(this.apiHost)?this.Sr[this.apiHost]=r7.EU:this.Sr[this.apiHost]=r7.CUSTOM),this.Sr[this.apiHost]}endpointFor(e,t){if(void 0===t&&(t=""),t&&(t="/"===t[0]?t:"/"+t),"ui"===e)return this.uiHost+t;if("flags"===e)return this.flagsApiHost+t;if(this.region===r7.CUSTOM)return this.apiHost+t;var i=r9+t;switch(e){case"assets":return"https://"+this.region+"-assets."+i;case"api":return"https://"+this.region+"."+i}}}var nt={icontains:(e,t)=>!!s&&t.href.toLowerCase().indexOf(e.toLowerCase())>-1,not_icontains:(e,t)=>!!s&&-1===t.href.toLowerCase().indexOf(e.toLowerCase()),regex:(e,t)=>!!s&&rr(t.href,e),not_regex:(e,t)=>!!s&&!rr(t.href,e),exact:(e,t)=>
1t.href===e,is_not:(e,t)=>t.href!==e};class ni{constructor(e){var t=this;this.getWebExperimentsAndEvaluateDisplayLogic=function(e){void 0===e&&(e=!1),t.getWebExperiments(e=>{ni.kr("retrieved web experiments from the server"),t.Pr=new Map,e.forEach(e=>{if(e.feature_flag_key){t.Pr&&(ni.kr("setting flag key ",e.feature_flag_key," to web experiment ",e),null==(i=t.Pr)||i.set(e.feature_flag_key,e));var i,s=t._instance.getFeatureFlag(e.feature_flag_key);L(s)&&e.variants[s]&&t.Tr(e.name,s,e.variants[s].transforms)}else if(e.variants)for(var r in e.variants){var n=e.variants[r];ni.Ir(n)&&t.Tr(e.name,r,n.transforms)}})},e)},this._instance=e,this._instance.onFeatureFlags(e=>{this.onFeatureFlags(e)})}onFeatureFlags(e){if(this._is_bot())ni.kr("Refusing to render web experiment since the viewer is a likely bot");else if(!this._instance.config.disable_web_experiments){if(j(this.Pr))return this.Pr=new Map,this.loadIfEnabled(),void this.previewWebExperiment();ni.kr("applying feature flags",e),e.forEach(e=>{var t;if(this.Pr&&null!=(t=this.Pr)&&t.has(e)){var i,s=this._instance.getFeatureFlag(e),r=null==(i=this.Pr)?void 0:i.get(e);s&&null!=r&&r.variants[s]&&this.Tr(r.name,s,r.variants[s].transforms)}})}}previewWebExperiment(){var e=ni.getWindowLocation();if(null!=e&&e.search){var t=i$(null==e?void 0:e.search,"__experiment_id"),i=i$(null==e?void 0:e.search,"__experiment_variant");t&&i&&(ni.kr("previewing web experiments "+t+" && "+i),this.getWebExperiments(e=>{this.Cr(parseInt(t),i,e)},!1,!0))}}loadIfEnabled(){this._instance.config.disable_web_experiments||this.getWebExperimentsAndEvaluateDisplayLogic()}getWebExperiments(e,t,i){if(this._instance.config.disable_web_experiments&&!i)return e([]);var s=this._instance.get_property("$web_experiments");if(s&&!t)return e(s);this._instance._send_request({url:this._instance.requestRouter.endpointFor("api","/api/web_experiments/?token="+this._instance.config.token),method:"GET",callback:t=>200===t.statusCode&&t.json?e(t.json.experiments||[]):e([])})}Cr(e,t,i){var s=i.filter(t=>t.id===e);s&&s.length>0&&(ni.kr("Previewing web experiment ["+s[0].name+"] with variant ["+t+"]"),this.Tr(s[0].name,t,s[0].variants[t].transforms))}static Ir(e){return!j(e.conditions)&&ni.Rr(e)&&ni.Fr(e)}static Rr(e){if(j(e.conditions)||j(null==(t=e.conditions)?void 0:t.url))return!0;var t,i,s,r,n=ni.getWindowLocation();return!!n&&(null==(i=e.conditions)||!i.url||nt[null!=(s=null==(r=e.conditions)?void 0:r.urlMatchType)?s:"icontains"](e.conditions.url,n))}
1static getWindowLocation(){return null==s?void 0:s.location}static Fr(e){if(j(e.conditions)||j(null==(i=e.conditions)?void 0:i.utm))return!0;var t=sg();if(t.utm_source){var i,s,r,n,o,a,l,c,u,h=null==(s=e.conditions)||null==(s=s.utm)||!s.utm_campaign||(null==(r=e.conditions)||null==(r=r.utm)?void 0:r.utm_campaign)==t.utm_campaign,d=null==(n=e.conditions)||null==(n=n.utm)||!n.utm_source||(null==(o=e.conditions)||null==(o=o.utm)?void 0:o.utm_source)==t.utm_source,p=null==(a=e.conditions)||null==(a=a.utm)||!a.utm_medium||(null==(l=e.conditions)||null==(l=l.utm)?void 0:l.utm_medium)==t.utm_medium,g=null==(c=e.conditions)||null==(c=c.utm)||!c.utm_term||(null==(u=e.conditions)||null==(u=u.utm)?void 0:u.utm_term)==t.utm_term;return h&&p&&g&&d}return!1}static kr(e){for(var t=arguments.length,i=Array(t>1?t-1:0),s=1;s<t;s++)i[s-1]=arguments[s];tc.info("[WebExperiments] "+e,i)}Tr(e,t,i){this._is_bot()?ni.kr("Refusing to render web experiment since the viewer is a likely bot"):"control"!==t?i.forEach(i=>{if(i.selector){ni.kr("applying transform of variant "+t+" for experiment "+e+" ",i);var s,r=null==(s=document)?void 0:s.querySelectorAll(i.selector);null==r||r.forEach(e=>{i.html&&(e.innerHTML=i.html),i.css&&e.setAttribute("style",i.css)})}}):ni.kr("Control variants leave the page unmodified.")}_is_bot(){return l&&this._instance?r4(l,this._instance.config.custom_blocked_useragents):void 0}}var ns=tu("[PostHog ExternalIntegrations]"),nr={intercom:"intercom-integration",crispChat:"crisp-chat-integration"};class nn{constructor(e){this._instance=e}it(e,t){var i;null==(i=_.__PosthogExtensions__)||null==i.loadExternalDependency||i.loadExternalDependency(this._instance,e,e=>{if(e)return ns.error("failed to load script",e);t()})}startIfEnabledOrStop(){var e,t=this,i=function(e){var i,s,n;!r||null!=(i=_.__PosthogExtensions__)&&null!=(i=i.integrations)&&i[e]||t.it(nr[e],()=>{var i;null==(i=_.__PosthogExtensions__)||null==(i=i.integrations)||null==(i=i[e])||i.start(t._instance)}),!r&&null!=(s=_.__PosthogExtensions__)&&null!=(s=s.integrations)&&s[e]&&(null==(n=_.__PosthogExtensions__)||null==(n=n.integrations)||null==(n=n[e])||n.stop())};for(var[s,r]of Object.entries(null!=(e=this._instance.config.integrations)?e:{}))i(s)}}var no="[SessionRecording]",na=tu(no);class nl{get started(){var e;return!(null==(e=this.Mr)||!e.isStarted)}get status(){return this.Mr?this.Mr.status:this.Or&&!this.Ar?"disabled":"lazy_loading"}constructor(e){if(this._forceAllowLocalhostNetworkCapture=!1,this.Or=!1,this.Dr=void 0,this._instance=e,!this._instance.sessionManager)throw na.error("started without valid sessionManager"),Error(no+" started without valid sessionManager. This is a bug.");if("always"===this._instance.config.cookieless_mode)throw Error(no+' cannot be used with cookieless_mode="always"')}get Ar(){var e,t=!(null==(e=this._instance.get_property(tD))||!e.enabled),i=!this._instance.config.disable_session_recording,r=this._instance.config.disable_session_recording||this._instance.consent.isOptedOut();return s&&t&&i&&!r}startIfEnabledOrStop(e){var t;if(!this.Ar||null==(t=this.Mr)||!t.isStarted){var i=!A(Object.assign)&&!A(Array.from);this.Ar&&i?(this.jr(e),na.info("starting")):this.stopRecording()}}jr(e){var t,i,s;this.Ar&&(null!=_&&null!=(t=_.__PosthogExtensions__)&&null!=(t=t.rrweb)&&t.record&&null!=(i=_.__PosthogExtensions__)&&i.initSessionRecording?this.Lr(e):null==(s=_.__PosthogExtensions__)||null==s.loadExternalDependency||s.loadExternalDependency(this._instance,this.Nr,t=>{if(t)return na.error("could not load recorder",t);this.Lr(e)}))}stopRecording(){var e,t;null==(e=this.Dr)||e.call(this),this.Dr=void 0,null==(t=this.Mr)||t.stop()}Ur(){var e;null==(e=this._instance.persistence)||e.unregister(tj)}zr(e){if(this._instance.persistence){var t,i,s=this._instance.persistence,r=()=>{var t=!1===e.sessionRecording?void 0:e.sessionRecording,i=null==t?void 0:t.sampleRate,r=j(i)?null:parseFloat(i);j(r)&&this.Ur();var n=null==t?void 0:t.minimumDurationMilliseconds;s.register({[tD]:y({enabled:!!t},t,{networkPayloadCapture:y({capturePerformance:e.capturePerformance},null==t?void 0:t.networkPayloadCapture),canvasRecording:{enabled:null==t?void 0:t.recordCanvas,fps:null==t?void 0:t.canvasFps,quality:null==t?void 0:t.canvasQuality},sampleRate:r,minimumDurationMilliseconds:A(n)?null:n,endpoint:null==t?void 0:t.endpoint,triggerMatchType:null==t?void 0:t.triggerMatchType,masking:null==t?void 0:t.masking,urlTriggers:null==t?void 0:t.urlTriggers})})};r(),null==(t=this.Dr)||t.call(this),this.Dr=null==(i=this._instance.sessionManager)?void 0:i.onSessionId(r)}}onRemoteConfig(e){"sessionRecording"in e?!1!==e.sessionRecording?(this.zr(e),this.Or=!0,this.startIfEnabledOrStop()):this.Or=!0:na.info("skipping remote config with no sessionRecording",e)}log(e,t){var i;void 0===t&&(t="log"),null!=(i=this.Mr)&&i.log?this.Mr.log(e,t):na.warn("log called before recorder was ready")}get Nr(){var e,t,i=null==(e=this._instance)||null==(e=e.persistence)?void 0:e.get_property(tD);return(null==i||null==(t=i.scriptConfig)?void 0:t.script)||"lazy-recorder"}Lr(e){var t,i;if(null==(t=_.__PosthogExtensions__)||!t.initSessionRecording)throw Error("Called on script loaded before session recording is available");this.Mr||(this.Mr=null==(i=_.__PosthogExtensions__)?void 0:i.initSessionRecording(this._instance),this.Mr._forceAllowLocalhostNetworkCapture=this._forceAllowLocalhostNetworkCapture),this.Mr.start(e)}onRRwebEmit(e){var t;null==(t=this.Mr)||null==t.onRRwebEmit||t.onRRwebEmit(e)}overrideLinkedFlag(){var e,t;this.Mr||null==(t=this._instance.persistence)||t.register({$replay_override_linked_flag:!0}),null==(e=this.Mr)||e.overrideLinkedFlag()}overrideSampling(){var e,t;this.Mr||null==(t=this._instance.persistence)||t.register({$replay_override_sampling:!0}),null==(e=this.Mr)||e.overrideSampling()}overrideTrigger(e){var t,i;this.Mr||null==(i=this._instance.persistence)||i.register({["url"===e?"$replay_override_url_trigger":"$replay_override_event_trigger"]:!0}
1),null==(t=this.Mr)||t.overrideTrigger(e)}get sdkDebugProperties(){var e;return(null==(e=this.Mr)?void 0:e.sdkDebugProperties)||{$recording_status:this.status}}tryAddCustomEvent(e,t){var i;return!(null==(i=this.Mr)||!i.tryAddCustomEvent(e,t))}}var nc={},nu=()=>{},nh="posthog",nd=!s7&&-1===(null==g?void 0:g.indexOf("MSIE"))&&-1===(null==g?void 0:g.indexOf("Mozilla")),np=e=>{var t;return y({api_host:"https://us.i.posthog.com",flags_api_host:null,ui_host:null,token:"",autocapture:!0,cross_subdomain_cookie:function(e){var t=null==e?void 0:e.hostname;if(!L(t))return!1;var i=t.split(".").slice(-2).join(".");for(var s of tE)if(i===s)return!1;return!0}(null==c?void 0:c.location),persistence:"localStorage+cookie",persistence_name:"",cookie_persisted_properties:[],loaded:nu,save_campaign_params:!0,custom_campaign_params:[],custom_blocked_useragents:[],save_referrer:!0,capture_pageleave:"if_capture_pageview",defaults:null!=e?e:"unset",__preview_deferred_init_extensions:!1,debug:u&&L(null==u?void 0:u.search)&&-1!==u.search.indexOf("__posthog_debug=true")||!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:!0,disable_external_dependency_loading:!1,enable_recording_console_log:void 0,secure_cookie:"https:"===(null==s||null==(t=s.location)?void 0:t.protocol),ip:!1,opt_out_capturing_by_default:!1,opt_out_persistence_by_default:!1,opt_out_useragent_filter:!1,opt_out_capturing_persistence_type:"localStorage",consent_persistence_name:null,opt_out_capturing_cookie_prefix:null,opt_in_site_apps:!1,property_denylist:[],respect_dnt:!1,sanitize_properties:null,request_headers:{},request_batching:!0,properties_string_max_length:65535,mask_all_element_attributes:!1,mask_all_text:!1,mask_personal_data_properties:!1,custom_personal_data_properties:[],advanced_disable_flags:!1,advanced_disable_decide:!1,advanced_disable_feature_flags:!1,advanced_disable_feature_flags_on_first_load:!1,advanced_only_evaluate_survey_feature_flags:!1,advanced_enable_surveys:!1,advanced_disable_toolbar_metrics:!1,feature_flag_request_timeout_ms:3e3,surveys_request_timeout_ms:1e4,on_request_error:e=>{var t="Bad HTTP status: "+e.statusCode+" "+e.text;tc.error(t)},get_device_id:e=>e,capture_performance:void 0,name:"posthog",bootstrap:{},disable_compression:!1,session_idle_timeout_seconds:1800,person_profiles:"identified_only",before_send:void 0,request_queue_config:{flush_interval_ms:3e3},error_tracking:{},_onCapture:nu,__preview_eager_load_replay:!1},(e=>({rageclick:!(e&&e>="2025-11-30")||{content_ignorelist:!0},capture_pageview:!(e&&e>="2025-05-24")||"history_change",session_recording:e&&e>="2025-11-30"?{strictMinimumDuration:!0}:{}}))(e))},ng=e=>{var t={};A(e.process_person)||(t.person_profiles=e.process_person),A(e.xhr_headers)||(t.request_headers=e.xhr_headers),A(e.cookie_name)||(t.persistence_name=e.cookie_name),A(e.disable_cookie)||(t.disable_persistence=e.disable_cookie),A(e.store_google)||(t.save_campaign_params=e.store_google),A(e.verbose)||(t.debug=e.verbose);var i=tv({},t,e);return C(e.property_blacklist)&&(A(e.property_denylist)?i.property_denylist=e.property_blacklist:C(e.property_denylist)?i.property_denylist=[...e.property_blacklist,...e.property_denylist]:tc.error("Invalid value for property_denylist config: "+e.property_denylist)),i};class n_{constructor(){this.__forceAllowLocalhost=!1}get Hr(){return this.__forceAllowLocalhost}set Hr(e){tc.error("WebPerformanceObserver is deprecated and has no impact on network capture. Use `_forceAllowLocalhostNetworkCapture` on `posthog.sessionRecording`"),this.__forceAllowLocalhost=e}}class nv{get decideEndpointWasHit(){var e,t;return null!=(e=null==(t=this.featureFlags)?void 0:t.hasLoadedFlags)&&e}get flagsEndpointWasHit(){var e,t;return null!=(e=null==(t=this.featureFlags)?void 0:t.hasLoadedFlags)&&e}constructor(){this.webPerformance=new n_,this.Br=!1,this.version=v.LIB_VERSION,this.qr=new rD,this._calculate_event_properties=this.calculateEventProperties.bind(this),this.config=np(),this.SentryIntegration=st,this.sentryIntegration=e=>(function(e,t){var i=se(e,t);return{name:i9,processEvent:e=>i(e)}})(this,e),this.__request_queue=[],this.__loaded=!1,this.analyticsDefaultEndpoint="/e/",this.Wr=!1,this.Gr=null,this.Vr=null,this.Jr=null,this.featureFlags=new rw(this),this.toolbar=ne
1w so(this),this.scrollManager=new rQ(this),this.pageViewManager=new s$(this),this.surveys=new rU(this),this.conversations=new rB(this),this.logs=new rG(this),this.experiments=new ni(this),this.exceptions=new ru(this),this.rateLimiter=new rz(this),this.requestRouter=new ne(this),this.consent=new iQ(this),this.externalIntegrations=new nn(this),this.people={set:(e,t,i)=>{var s=L(e)?{[e]:t}:e;this.setPersonProperties(s),null==i||i({})},set_once:(e,t,i)=>{var s=L(e)?{[e]:t}:e;this.setPersonProperties(void 0,s),null==i||i({})}},this.on("eventCaptured",e=>tc.info('send "'+(null==e?void 0:e.event)+'"',e))}init(e,t,i){if(i&&i!==nh){var s,r=null!=(s=nc[i])?s:new nv;return r._init(e,t,i),nc[i]=r,nc[nh][i]=r,r}return this._init(e,t,i)}_init(e,t,i){if(void 0===t&&(t={}),A(e)||D(e))return tc.critical("PostHog was initialized without a token. This likely indicates a misconfiguration. Please check the first argument passed to posthog.init()"),this;if(this.__loaded)return console.warn("[PostHog.js]","You have already initialized PostHog! Re-initializing is a no-op"),this;this.__loaded=!0,this.config={},t.debug=this.Kr(t.debug),this.Yr=t,this.Xr=[],t.person_profiles&&(this.Vr=t.person_profiles),this.set_config(tv({},np(t.defaults),ng(t),{name:i,token:e})),this.config.on_xhr_error&&tc.error("on_xhr_error is deprecated. Use on_request_error instead"),this.compression=t.disable_compression?void 0:sR.GZipJS;var r=this.Qr();this.persistence=new rx(this.config,r),this.sessionPersistence="sessionStorage"===this.config.persistence||"memory"===this.config.persistence?this.persistence:new rx(y({},this.config,{persistence:"sessionStorage"}),r);var n=y({},this.persistence.props),o=y({},this.sessionPersistence.props);this.register({$initialization_time:(new Date).toISOString()}),this.Zr=new rK(e=>this.ts(e),this.config.request_queue_config),this.es=new rZ(this),this.__request_queue=[];var a="always"===this.config.cookieless_mode||"on_reject"===this.config.cookieless_mode&&this.consent.isExplicitlyOptedOut();if(a||(this.sessionManager=new r3(this),this.sessionPropsManager=new r1(this,this.sessionManager,this.persistence)),this.config.__preview_deferred_init_extensions?(tc.info("Deferring extension initialization to improve startup performance"),setTimeout(()=>{this.rs(a)},0)):(tc.info("Initializing extensions synchronously"),this.rs(a)),v.DEBUG=v.DEBUG||this.config.debug,v.DEBUG&&tc.info("Starting in debug mode",{this:this,config:t,thisC:y({},this.config),p:n,s:o}),void 0!==(null==(l=t.bootstrap)?void 0:l.distinctID)){var l,c,u,h=this.config.get_device_id(iH()),d=null!=(c=t.bootstrap)&&c.isIdentifiedID?h:t.bootstrap.distinctID;this.persistence.set_property(tz,null!=(u=t.bootstrap)&&u.isIdentifiedID?"identified":"anonymous"),this.register({distinct_id:t.bootstrap.distinctID,$device_id:d})}if(this.ss()){var p,g,_=Object.keys((null==(p=t.bootstrap)?void 0:p.featureFlags)||{}).filter(e=>{var i;return!(null==(i=t.bootstrap)||null==(i=i.featureFlags)||!i[e])}).reduce((e,i)=>{var s;return e[i]=(null==(s=t.bootstrap)||null==(s=s.featureFlags)?void 0:s[i])||!1,e},{}),f=Object.keys((null==(g=t.bootstrap)?void 0:g.featureFlagPayloads)||{}).filter(e=>_[e]).reduce((e,i)=>{var s,r;return null!=(s=t.bootstrap)&&null!=(s=s.featureFlagPayloads)&&s[i]&&(e[i]=null==(r=t.bootstrap)||null==(r=r.featureFlagPayloads)?void 0:r[i]),e},{});this.featureFlags.receivedFeatureFlags({featureFlags:_,featureFlagPayloads:f})}if(a)this.register_once({distinct_id:t1,$device_id:null},"");else if(!this.get_distinct_id()){var m=this.config.get_device_id(iH());this.register_once({distinct_id:m,$device_id:m},""),this.persistence.set_property(tz,"anonymous")}return tk(s,"onpagehide"in self?"pagehide":"unload",this._handle_unload.bind(this),{passive:!1}),this.toolbar.maybeLoadToolbar(),t.segment?function(e,t){var i=e.config.segment;if(!i)return t();!function(e,t){var i=e.config.segment;if(!i)return t();var s=i=>{var s=()=>i.anonymousId()||iH();e.config.get_device_id=s,i.id()&&(e.register({distinct_id:i.id(),$device_id:s()}),e.persistence.set_property(tz,"identified")),t()},r=i.user();"then"in r&&T(r.then)?r.then(s):s(r)}(e,()=>{var s;i.register((Promise&&Promise.resolve||i7.warn("This browser does not have Promise support, and can not use the segment integration"),s=(t,i)=>{if(!i)return t;t.event.userId||t.event.anonymousId===e.get_distinct_id()||(i7.info("No userId set, resetting PostHog"),e.reset()),t.event.userId&&t.event.userId!==e.get_distinct_id()&&(i7.info("UserId set, identifying with PostHog"),e.identify(t.event.userId)
1);var s=e.calculateEventProperties(i,t.event.properties);return t.event.properties=Object.assign({},s,t.event.properties),t},{name:"PostHog JS",type:"enrichment",version:"1.0.0",isLoaded:()=>!0,load:()=>Promise.resolve(),track:e=>s(e,e.event.event),page:e=>s(e,"$pageview"),identify:e=>s(e,"$identify"),screen:e=>s(e,"$screen")})).then(()=>{t()})})}(this,()=>this.ns()):this.ns(),T(this.config._onCapture)&&this.config._onCapture!==nu&&(tc.warn("onCapture is deprecated. Please use `before_send` instead"),this.on("eventCaptured",e=>this.config._onCapture(e.event,e))),this.config.ip&&tc.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}rs(e){var t=performance.now();this.historyAutocapture=new i4(this),this.historyAutocapture.startIfEnabled();var i=[];i.push(()=>{new sl(this).startIfEnabledOrStop()}),i.push(()=>{var e;this.siteApps=new r6(this),null==(e=this.siteApps)||e.init()}),e||i.push(()=>{this.sessionRecording=new nl(this),this.sessionRecording.startIfEnabledOrStop()}),this.config.disable_scroll_properties||i.push(()=>{this.scrollManager.startMeasuringScrollPosition()}),i.push(()=>{this.autocapture=new iO(this),this.autocapture.startIfEnabled()}),i.push(()=>{this.surveys.loadIfEnabled()}),i.push(()=>{this.logs.loadIfEnabled()}),i.push(()=>{this.conversations.loadIfEnabled()}),i.push(()=>{this.productTours=new rP(this),this.productTours.loadIfEnabled()}),i.push(()=>{this.heatmaps=new sP(this),this.heatmaps.startIfEnabled()}),i.push(()=>{this.webVitalsAutocapture=new sx(this)}),i.push(()=>{this.exceptionObserver=new i8(this),this.exceptionObserver.startIfEnabledOrStop()}),i.push(()=>{this.deadClicksAutocapture=new i3(this,i2),this.deadClicksAutocapture.startIfEnabled()}),i.push(()=>{if(this.os){var e=this.os;this.os=void 0,this.yi(e)}}),this.ls(i,t)}ls(e,t){for(;e.length>0;){if(this.config.__preview_deferred_init_extensions&&performance.now()-t>=30&&e.length>0)return void setTimeout(()=>{this.ls(e,t)},0);var i=e.shift();if(i)try{i()}catch(e){tc.error("Error initializing extension:",e)}}var s=Math.round(performance.now()-t);this.register_for_session({$sdk_debug_extensions_init_method:this.config.__preview_deferred_init_extensions?"deferred":"synchronous",$sdk_debug_extensions_init_time_ms:s}),this.config.__preview_deferred_init_extensions&&tc.info("PostHog extensions initialized ("+s+"ms)")}yi(e){var t,i,s,r,n,o,a,l,u;if(!c||!c.body)return tc.info("document not ready yet, trying again in 500 milliseconds..."),void setTimeout(()=>{this.yi(e)},500);this.config.__preview_deferred_init_extensions&&(this.os=e),this.compression=void 0,e.supportedCompression&&!this.config.disable_compression&&(this.compression=k(e.supportedCompression,sR.GZipJS)?sR.GZipJS:k(e.supportedCompression,sR.Base64)?sR.Base64:void 0),null!=(t=e.analytics)&&t.endpoint&&(this.analyticsDefaultEndpoint=e.analytics.endpoint),this.set_config({person_profiles:this.Vr?this.Vr:"identified_only"}),null==(i=this.siteApps)||i.onRemoteConfig(e),null==(s=this.sessionRecording)||s.onRemoteConfig(e),null==(r=this.autocapture)||r.onRemoteConfig(e),null==(n=this.heatmaps)||n.onRemoteConfig(e),this.surveys.onRemoteConfig(e),this.logs.onRemoteConfig(e),this.conversations.onRemoteConfig(e),null==(o=this.productTours)||o.onRemoteConfig(e),null==(a=this.webVitalsAutocapture)||a.onRemoteConfig(e),null==(l=this.exceptionObserver)||l.onRemoteConfig(e),this.exceptions.onRemoteConfig(e),null==(u=this.deadClicksAutocapture)||u.onRemoteConfig(e)}ns(){try{this.config.loaded(this)}catch(e){tc.critical("`loaded` function failed",e)}this.us(),this.config.capture_pageview&&setTimeout(()=>{(this.consent.isOptedIn()||"always"===this.config.cookieless_mode)&&this.hs()},1),new rX(this).load(),this.featureFlags.flags()}us(){var e;this.is_capturing()&&this.config.request_batching&&(null==(e=this.Zr)||e.enable())}_dom_loaded(){this.is_capturing()&&tg(this.__request_queue,e=>this.ts(e)),this.__request_queue=[],this.us()}_handle_unload(){var e,t;this.surveys.handlePageUnload(),this.config.request_batching?(this.ds()&&this.capture("$pageleave"),null==(e=this.Zr)||e.unload(),null==(t=this.es)||t.unload()):this.ds()&&this.capture("$pageleave",null,{transport:"sendBeacon"})}_send_request(e){this.__loaded&&(nd?this.__request_queue.push(e):this.rateLimiter.isServerRateLimited(e.batchKey)||(e.transport=e.transport||this.config.api_transport,e.url=re(e.url,{ip:+!!this.config.ip}),e.headers=y({},this.config.request_headers,e.headers),e.compression="best-available"===e.compression?this.compression:e.compression,e.disableXHRCredentials=this.config.__preview_disable_xhr_credentials,this.config.__preview_disable_beacon&&(e.disableTransport=["sendBeacon"]),e.fetchOptions=e.fetchOptions||this.config.fetch_options,
1(e=>{var t,i,s,r=y({},e);r.timeout=r.timeout||6e4,r.url=re(r.url,{_:(new Date).getTime().toString(),ver:v.LIB_VERSION,compression:r.compression});var n=null!=(t=r.transport)?t:"fetch",o=rs.filter(e=>!r.disableTransport||!e.transport||!r.disableTransport.includes(e.transport)),a=null!=(i=null==(s=tx(o,e=>e.transport===n))?void 0:s.method)?i:o[0].method;if(!a)throw Error("No available transport method");a(r)})(y({},e,{callback:t=>{var i,s;this.rateLimiter.checkForLimiting(t),t.statusCode>=400&&(null==(i=(s=this.config).on_request_error)||i.call(s,t)),null==e.callback||e.callback(t)}}))))}ts(e){this.es?this.es.retriableRequest(e):this._send_request(e)}_execute_array(e){var t,i=[],s=[],r=[];tg(e,e=>{e&&(C(t=e[0])?r.push(e):T(e)?e.call(this):C(e)&&"alias"===t?i.push(e):C(e)&&-1!==t.indexOf("capture")&&T(this[t])?r.push(e):s.push(e))});var n=function(e,t){tg(e,function(e){if(C(e[0])){var i=t;t_(e,function(e){i=i[e[0]].apply(i,e.slice(1))})}else this[e[0]].apply(this,e.slice(1))},t)};n(i,this),n(s,this),n(r,this)}ss(){var e,t;return(null==(e=this.config.bootstrap)?void 0:e.featureFlags)&&Object.keys(null==(t=this.config.bootstrap)?void 0:t.featureFlags).length>0||!1}push(e){this._execute_array([e])}capture(e,t,i){var s;if(this.__loaded&&this.persistence&&this.sessionPersistence&&this.Zr){if(this.is_capturing())if(!A(e)&&L(e)){var r=!this.config.opt_out_useragent_filter&&this._is_bot();if(!(r&&!this.config.__preview_capture_bot_pageviews)){var n=null!=i&&i.skip_client_rate_limiting?void 0:this.rateLimiter.clientRateLimitContext();if(null==n||!n.isRateLimited){null!=t&&t.$current_url&&!L(null==t?void 0:t.$current_url)&&(tc.error("Invalid `$current_url` property provided to `posthog.capture`. Input must be a string. Ignoring provided value."),null==t||delete t.$current_url),this.sessionPersistence.update_search_keyword(),this.config.save_campaign_params&&this.sessionPersistence.update_campaign_params(),this.config.save_referrer&&this.sessionPersistence.update_referrer_info(),(this.config.save_campaign_params||this.config.save_referrer)&&this.persistence.set_initial_person_info();var o=new Date,a=(null==i?void 0:i.timestamp)||o,l=iH(),c={uuid:l,event:e,properties:this.calculateEventProperties(e,t||{},a,l)};"$pageview"===e&&this.config.__preview_capture_bot_pageviews&&r&&(c.event="$bot_pageview",c.properties.$browser_type="bot"),n&&(c.properties.$lib_rate_limit_remaining_tokens=n.remainingTokens),(null==i?void 0:i.$set)&&(c.$set=null==i?void 0:i.$set);var u,h="$groupidentify"!==e,d=this.vs(null==i?void 0:i.$set_once,h);if(d&&(c.$set_once=d),(p=c,g=null!=i&&i._noTruncate?null:this.config.properties_string_max_length,_=e=>L(e)&&!N(g)?e.slice(0,g):e,v=new Set,c=function e(t,i){var s;return t!==Object(t)?_?_(t,i):t:v.has(t)?void 0:(v.add(t),C(t)?(s=[],tg(t,t=>{s.push(e(t))})):(s={},t_(t,(t,i)=>{v.has(t)||(s[i]=e(t,i))})),s)}(p)).timestamp=a,A(null==i?void 0:i.timestamp)||(c.properties.$event_time_override_provided=!0,c.properties.$event_time_override_system_time=o),e===rI.DISMISSED||e===rI.SENT){var p,g,_,v,f,m,b,w=null==t?void 0:t[rF.SURVEY_ID],E=null==t?void 0:t[rF.SURVEY_ITERATION];u={id:w,current_iteration:E},localStorage.getItem(rM(u))||localStorage.setItem(rM(u),"true"),c.$set=y({},c.$set,{[(f={id:w,current_iteration:E},b="$survey_"+(m=e===rI.SENT?"responded":"dismissed")+"/"+f.id,f.current_iteration&&f.current_iteration>0&&(b="$survey_"+m+"/"+f.id+"/"+f.current_iteration),b)]:!0})}else e===rI.SHOWN&&(c.$set=y({},c.$set,{[rF.SURVEY_LAST_SEEN_DATE]:(new Date).toISOString()}));var x=y({},c.properties.$set,c.$set);if(M(x)||this.setPersonPropertiesForFlags(x),!j(this.config.before_send)){var k=this.cs(c);if(!k)return;c=k}this.qr.emit("eventCaptured",c);var S={method:"POST",url:null!=(s=null==i?void 0:i._url)?s:this.requestRouter.endpointFor("api",this.analyticsDefaultEndpoint),data:c,compression:"best-available",batchKey:null==i?void 0:i._batchKey};return!this.config.request_batching||i&&(null==i||!i._batchKey)||null!=i&&i.send_instantly?this.ts(S):this.Zr.enqueue(S),c}tc.critical("This capture call is ignored due to client rate limiting.")}}else tc.error("No event name provided to posthog.capture")}else tc.uninitializedWarning("posthog.capture")}Hi(e){return this.on("eventCaptured",t=>e(t.event,t))}calculateEventProperties(e,t,i,r,n){if(i=i||new Date,!this.persistence||!this.sessionPersistence)return t;var o,a=n?void 0:this.persistence.remove_event_timer(e),l=y({},t);if(l.token=this.config.token,l.$config_defaults=this.config.defaults,("always"==this.config.cookieless_mode||"on_reject"==this.config.cookieless_mode&&this.consent.isExplicitlyOptedOut())&&(l.$cookieless_mode=!0),"$snapshot"===e){var h=y({},this.persistence.properties(),this.sessionPersistence.properties());return l.distinct_id=h.distinct_id,(!L(l.distinct_id)&&!H(l.distinct_id)||D(l.distinct_id))&&tc.error("Invalid distinct_id for replay event. This indicates a bug in your implementation"),l}var d,p=function(e,t){if(!g)return{};var i,r,n=e?tf([],su,t||[]):[],[o,a]=function(e){for(var t=0;t<ez.length;t++){var[i,s]=ez[t],r=i.exec(e),n=r&&(T(s)?s(r,e):s);if(n)return n}return["",""]}(g);return tv(tw({$os:o,$os_version:a,$browser:eB(g,navigator.vendor),$device:eY(g),$device_type:(r=eY(g))===en||r===er||"Kobo"===r||"Kindle Fire"===r||r===eA?es:r===ek||r===eP||r===eS||r===eT?"Console":r===ea?"Wearable":r?et:"Desktop",$timezone:sw(),$timezone_offset:function(){try{return(new Date).getTimezoneOffset()}catch(e){return}}()}),{$current_url:iR(null==u?void 0:u.href,n,sd),$host:null==u?void 0:u.host,$pathname:null==u?void 0:u.pathname,$raw_user_agent:g.length>1e3?g.substring(0,997)+"...":g,$browser_version:eW(g,navigator.vendor),$browser_language:sf(),$browser_language_prefix:"string"==typeof(i=sf())?i.split("-")[0]:void 0,$screen_height:null==s?void 0:s.screen.height,$screen_width:null==s?void 0:s.screen.width,$viewport_height:null==s?void 0:s.innerHeight,$viewport_width:null==s?void 0:s.innerWidth,$lib:"web",$lib_version:v.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:_,windowId:f}=this.sessionManager.checkAndGetSessionAndWindowId(n,i.getTime());l.$session_id=_,l.$window_id=f}this.sessionPropsManager&&tv(l,this.sessionPropsManager.getSessionProps());try{this.sessionRecording&&tv(l,this.sessionRecording.sdkDebugProperties),l.$sdk_debug_retry_queue_size=null==(o=this.es)?void 0:o.length}catch(e){l.$sdk_debug_error_capturing_properties=String(e)}if(this.requestRouter.region===r7.CUSTOM&&(l.$lib_custom_api_host=this.config.api_host),d="$pageview"!==e||n?"$pageleave"!==e||n?this.pageViewM
1anager.doEvent():this.pageViewManager.doPageLeave(i):this.pageViewManager.doPageView(i,r),l=tv(l,d),"$pageview"===e&&c&&(l.title=c.title),!A(a)){var m=i.getTime()-a;l.$duration=parseFloat((m/1e3).toFixed(3))}g&&this.config.opt_out_useragent_filter&&(l.$browser_type=this._is_bot()?"bot":"browser"),(l=tv({},p,this.persistence.properties(),this.sessionPersistence.properties(),l)).$is_identified=this._isIdentified(),C(this.config.property_denylist)?t_(this.config.property_denylist,function(e){delete l[e]}):tc.error("Invalid value for property_denylist config: "+this.config.property_denylist+" or property_blacklist config: "+this.config.property_blacklist);var b=this.config.sanitize_properties;b&&(tc.error("sanitize_properties is deprecated. Use before_send instead"),l=b(l,e));var w=this.fs();return l.$process_person_profile=w,w&&!n&&this.ps("_calculate_event_properties"),l}vs(e,t){if(void 0===t&&(t=!0),!this.persistence||!this.fs()||this.Br)return e;var i,s=tv({},this.persistence.get_initial_props(),(null==(i=this.sessionPropsManager)?void 0:i.getSetOnceProps())||{},e||{}),r=this.config.sanitize_properties;return r&&(tc.error("sanitize_properties is deprecated. Use before_send instead"),s=r(s,"$set_once")),t&&(this.Br=!0),M(s)?void 0:s}register(e,t){var i;null==(i=this.persistence)||i.register(e,t)}register_once(e,t,i){var s;null==(s=this.persistence)||s.register_once(e,t,i)}register_for_session(e){var t;null==(t=this.sessionPersistence)||t.register(e)}unregister(e){var t;null==(t=this.persistence)||t.unregister(e)}unregister_for_session(e){var t;null==(t=this.sessionPersistence)||t.unregister(e)}gs(e,t){this.register({[e]:t})}getFeatureFlag(e,t){return this.featureFlags.getFeatureFlag(e,t)}getFeatureFlagPayload(e){var t=this.featureFlags.getFeatureFlagPayload(e);try{return JSON.parse(t)}catch(e){return t}}isFeatureEnabled(e,t){return this.featureFlags.isFeatureEnabled(e,t)}reloadFeatureFlags(){this.featureFlags.reloadFeatureFlags()}updateFlags(e,t,i){var s=null!=i&&i.merge?this.featureFlags.getFlagVariants():{},r=null!=i&&i.merge?this.featureFlags.getFlagPayloads():{},n=y({},s,e),o=y({},r,t),a={};for(var[l,c]of Object.entries(n)){var u="string"==typeof c;
1a[l]={key:l,enabled:!!u||!!c,variant:u?c:void 0,reason:void 0,metadata:A(null==o?void 0:o[l])?void 0:{id:0,version:void 0,description:void 0,payload:o[l]}}}this.featureFlags.receivedFeatureFlags({flags:a})}updateEarlyAccessFeatureEnrollment(e,t,i){this.featureFlags.updateEarlyAccessFeatureEnrollment(e,t,i)}getEarlyAccessFeatures(e,t,i){return void 0===t&&(t=!1),this.featureFlags.getEarlyAccessFeatures(e,t,i)}on(e,t){return this.qr.on(e,t)}onFeatureFlags(e){return this.featureFlags.onFeatureFlags(e)}onSurveysLoaded(e){return this.surveys.onSurveysLoaded(e)}onSessionId(e){var t,i;return null!=(t=null==(i=this.sessionManager)?void 0:i.onSessionId(e))?t:()=>{}}getSurveys(e,t){void 0===t&&(t=!1),this.surveys.getSurveys(e,t)}getActiveMatchingSurveys(e,t){void 0===t&&(t=!1),this.surveys.getActiveMatchingSurveys(e,t)}renderSurvey(e,t){this.surveys.renderSurvey(e,t)}displaySurvey(e,t){void 0===t&&(t=rL),this.surveys.displaySurvey(e,t)}cancelPendingSurvey(e){this.surveys.cancelPendingSurvey(e)}canRenderSurvey(e){return this.surveys.canRenderSurvey(e)}canRenderSurveyAsync(e,t){return void 0===t&&(t=!1),this.surveys.canRenderSurveyAsync(e,t)}identify(e,t,i){if(!this.__loaded||!this.persistence)return tc.uninitializedWarning("posthog.identify");if(H(e)&&(e=e.toString(),tc.warn("The first argument to posthog.identify was a number, but it should be a string. It has been converted to a string.")),e)if(["distinct_id","distinctid"].includes(e.toLowerCase()))tc.critical('The string "'+e+'" was set in posthog.identify which indicates an error. This ID should be unique to the user and not a hardcoded string.');else if(e!==t1){if(this.ps("posthog.identify")){var s=this.get_distinct_id();this.register({$user_id:e}),this.get_property("$device_id")||this.register_once({$had_persisted_distinct_id:!0,$device_id:s},""),e!==s&&e!==this.get_property(tP)&&(this.unregister(tP),this.register({distinct_id:e}));var r="anonymous"===(this.persistence.get_property(tz)||"anonymous");e!==s&&r?(this.persistence.set_property(tz,"identified"),this.setPersonPropertiesForFlags(y({},i||{},t||{}),!1),this.capture("$identify",{distinct_id:e,$anon_distinct_id:s},{$set:t||{},$set_once:i||{}}),this.Jr=rn(e,t,i),this.featureFlags.setAnonymousDistinctId(s)):(t||i)&&this.setPersonProperties(t,i),e!==s&&(this.reloadFeatureFlags(),this.unregister(tW))}}else tc.critical('The string "'+t1+'" was set in posthog.identify which indicates an error. This ID is only used as a sentinel value.');else tc.error("Unique user id has not been set in posthog.identify")}setPersonProperties(e,t){if((e||t)&&this.ps("posthog.setPersonProperties")){var i=rn(this.get_distinct_id(),e,t);this.Jr!==i?(this.setPersonPropertiesForFlags(y({},t||{},e||{})),this.capture("$set",{$set:e||{},$set_once:t||{}}),this.Jr=i):tc.info("A duplicate setPersonProperties call was made with the same properties. It has been ignored.")}}group(e,t,i){if(e&&t){var s=this.getGroups();s[e]!==t&&this.resetGroupPropertiesForFlags(e),this.register({$groups:y({},s,{[e]:t})}),i&&(this.capture("$groupidentify",{$group_type:e,$group_key:t,$group_set:i}),this.setGroupPropertiesForFlags({[e]:i})),s[e]===t||i||this.reloadFeatureFlags()}else tc.error("posthog.group requires a group type and group key")}resetGroups(){this.register({$groups:{}}),this.resetGroupPropertiesForFlags(),this.reloadFeatureFlags()}setPersonPropertiesForFlags(e,t){void 0===t&&(t=!0),this.featureFlags.setPersonPropertiesForFlags(e,t)}resetPersonPropertiesForFlags(){this.featureFlags.resetPersonPropertiesForFlags()}setGroupPropertiesForFlags(e,t){void 0===t&&(t=!0),this.ps("posthog.setGroupPropertiesForFlags")&&this.featureFlags.setGroupPropertiesForFlags(e,t)}resetGroupPropertiesForFlags(e){this.featureFlags.resetGroupPropertiesForFlags(e)}reset(e){if(tc.info("reset"),!this.__loaded)return tc.uninitializedWarning("posthog.reset");var t,i,s,r,n=this.get_property("$device_id");if(this.consent.reset(),null==(t=this.persistence)||t.clear(),null==(i=this.sessionPersistence)||i.clear(),this.surveys.reset(),this.featureFlags.reset(),null==(s=this.persistence)||s.set_property(tz,"anonymous"),null==(r=this.sessionManager)||r.resetSessionId(),this.Jr=null,"always"===this.config.cookieless_mode)this.register_once({distinct_id:t1,$device_id:null},"");else{var o=this.config.get_device_id(iH());this.register_once({distinct_id:o,$device_id:e?o:n},"")}this.register({$last_posthog_reset:(new Date).toISOString()},1)}get_distinct_id(){return this.get_property("distinct_id")}getGroups(){return this.get_property("$groups")||{}}get_session_id(){var e,t;return null!=(e=null==(t=this.sessionManager)?void 0:t.checkAndGetSessionAndWindowId(!0).sessionId)?e:""}get_session_replay_url(e){if(!this.sessionManager)return"";var{sessionId:t,sessionStartTimestamp:i}=this.sessionManager.checkAndGetSessionAndWindowId(!0),s=this.requestRouter.endpointFor("ui","/project/"+this.config.token+"/replay/"+t);if(null!=e&&e.withTimestamp&&i){var r,n=null!=(r=e.timestampLookBack)?r:10;if(!i)return s;s+="?t="+Math.max(Math.floor(((new Date).getTime()-i)/1e3)-n,0)}return s}alias(e,t){return e===this.get_property(tS)?(tc.critical("Attempting to create alias for existing People user - aborting."),-2):this.ps("posthog.alias")?(A(t)&&(t=this.get_distinct_id()),e!==t?(this.gs(tP,e),this.capture("$create_alias",{alias:e,distinct_id:t})):(tc.warn("alias matches current distinct_id - skipping api call."),this.identify(e),-1)):void 0}set_config(e){var t=y({},this.config);if(O(e)){tv(this.config,ng(e));var i,s,r,n,o,a,l,c=this.Qr();null==(i=this.persistence)||i.update_config(this.config,t,c),this.sessionPersistence="sessionStorage"===this.config.persistence||"memory"===this.config.persistence?this.persistence:new rx(y({},this.config,{persistence:"sessionStorage"}
1),c);var u=this.Kr(this.config.debug);U(u)&&(this.config.debug=u),U(this.config.debug)&&(this.config.debug?(v.DEBUG=!0,iW.H()&&iW.G("ph_debug","true"),tc.info("set_config",{config:e,oldConfig:t,newConfig:y({},this.config)})):(v.DEBUG=!1,iW.H()&&iW.V("ph_debug"))),null==(s=this.exceptionObserver)||s.onConfigChange(),null==(r=this.sessionRecording)||r.startIfEnabledOrStop(),null==(n=this.autocapture)||n.startIfEnabled(),null==(o=this.heatmaps)||o.startIfEnabled(),null==(a=this.exceptionObserver)||a.startIfEnabledOrStop(),this.surveys.loadIfEnabled(),this._s(),null==(l=this.externalIntegrations)||l.startIfEnabledOrStop()}}startSessionRecording(e){var t,i,s,r,n,o=!0===e,a={sampling:o||!(null==e||!e.sampling),linked_flag:o||!(null==e||!e.linked_flag),url_trigger:o||!(null==e||!e.url_trigger),event_trigger:o||!(null==e||!e.event_trigger)};Object.values(a).some(Boolean)&&(null==(t=this.sessionManager)||t.checkAndGetSessionAndWindowId(),a.sampling&&(null==(i=this.sessionRecording)||i.overrideSampling()),a.linked_flag&&(null==(s=this.sessionRecording)||s.overrideLinkedFlag()),a.url_trigger&&(null==(r=this.sessionRecording)||r.overrideTrigger("url")),a.event_trigger&&(null==(n=this.sessionRecording)||n.overrideTrigger("event"))),this.set_config({disable_session_recording:!1})}stopSessionRecording(){this.set_config({disable_session_recording:!0})}sessionRecordingStarted(){var e;return!(null==(e=this.sessionRecording)||!e.started)}captureException(e,t){var i=Error("PostHog syntheticException"),s=this.exceptions.buildProperties(e,{handled:!0,syntheticException:i});return this.exceptions.sendExceptionEvent(y({},s,t))}startExceptionAutocapture(e){this.set_config({capture_exceptions:null==e||e})}stopExceptionAutocapture(){this.set_config({capture_exceptions:!1})}loadToolbar(e){return this.toolbar.loadToolbar(e)}get_property(e){var t;return null==(t=this.persistence)?void 0:t.props[e]}getSessionProperty(e){var t;return null==(t=this.sessionPersistence)?void 0:t.props[e]}toString(){var e,t=null!=(e=this.config.name)?e:nh;return t!==nh&&(t=nh+"."+t),t}_isIdentified(){var e,t;return"identified"===(null==(e=this.persistence)?void 0:e.get_property(tz))||"identified"===(null==(t=this.sessionPersistence)?void 0:t.get_property(tz))}fs(){var e,t;return!("never"===this.config.person_profiles||"identified_only"===this.config.person_profiles&&!this._isIdentified()&&M(this.getGroups())&&(null==(e=this.persistence)||null==(e=e.props)||!e[tP])&&(null==(t=this.persistence)||null==(t=t.props)||!t[tQ]))}ds(){return!0===this.config.capture_pageleave||"if_capture_pageview"===this.config.capture_pageleave&&(!0===this.config.capture_pageview||"history_change"===this.config.capture_pageview)}createPersonProfile(){this.fs()||this.ps("posthog.createPersonProfile")&&this.setPersonProperties({},{})}ps(e){return"never"===this.config.person_profiles?(tc.error(e+' was called, but process_person is set to "never". This call will be ignored.'),!1):(this.gs(tQ,!0),!0)}Qr(){if("always"===this.config.cookieless_mode)return!0;var e=this.consent.isOptedOut(),t=this.config.opt_out_persistence_by_default||"on_reject"===this.config.cookieless_mode;return this.config.disable_persistence||e&&!!t}_s(){var e,t,i,s,r=this.Qr();return(null==(e=this.persistence)?void 0:e.Si)!==r&&(null==(i=this.persistence)||i.set_disabled(r)),(null==(t=this.sessionPersistence)?void 0:t.Si)!==r&&(null==(s=this.sessionPersistence)||s.set_disabled(r)),r}opt_in_capturing(e){var t,i,s,r;"always"!==this.config.cookieless_mode?("on_reject"===this.config.cookieless_mode&&this.consent.isExplicitlyOptedOut()&&(this.reset(!0),null==(i=this.sessionManager)||i.destroy(),null==(s=this.pageViewManager)||s.destroy(),this.sessionManager=new r3(this),this.pageViewManager=new s$(this),this.persistence&&(this.sessionPropsManager=new r1(this,this.sessionManager,this.persistence)),this.sessionRecording=new nl(this),this.sessionRecording.startIfEnabledOrStop()),this.consent.optInOut(!0),this._s(),this.us(),null==(t=this.sessionRecording)||t.startIfEnabledOrStop(),"on_reject"==this.config.cookieless_mode&&this.surveys.loadIfEnabled(),(A(null==e?void 0:e.captureEventName)||null!=e&&e.captureEventName)&&this.capture(null!=(r=null==e?void 0:e.captureEventName)?r:"$opt_in",null==e?void 0:e.captureProperties,{send_instantly:!0}),this.config.capture_pageview&&this.hs()):tc.warn('Consent opt in/out is not val
1id with cookieless_mode="always" and will be ignored')}opt_out_capturing(){var e,t,i;"always"!==this.config.cookieless_mode?("on_reject"===this.config.cookieless_mode&&this.consent.isOptedIn()&&this.reset(!0),this.consent.optInOut(!1),this._s(),"on_reject"===this.config.cookieless_mode&&(this.register({distinct_id:t1,$device_id:null}),null==(e=this.sessionManager)||e.destroy(),null==(t=this.pageViewManager)||t.destroy(),this.sessionManager=void 0,this.sessionPropsManager=void 0,null==(i=this.sessionRecording)||i.stopRecording(),this.sessionRecording=void 0,this.hs())):tc.warn('Consent opt in/out is not valid with cookieless_mode="always" and will be ignored')}has_opted_in_capturing(){return this.consent.isOptedIn()}has_opted_out_capturing(){return this.consent.isOptedOut()}get_explicit_consent_status(){var e=this.consent.consent;return e===iZ.GRANTED?"granted":e===iZ.DENIED?"denied":"pending"}is_capturing(){return"always"===this.config.cookieless_mode||("on_reject"===this.config.cookieless_mode?this.consent.isExplicitlyOptedOut()||this.consent.isOptedIn():!this.has_opted_out_capturing())}clear_opt_in_out_capturing(){this.consent.reset(),this._s()}_is_bot(){return l?r4(l,this.config.custom_blocked_useragents):void 0}hs(){c&&("visible"===c.visibilityState?this.Wr||(this.Wr=!0,this.capture("$pageview",{title:c.title},{send_instantly:!0}),this.Gr&&(c.removeEventListener("visibilitychange",this.Gr),this.Gr=null)):this.Gr||(this.Gr=this.hs.bind(this),tk(c,"visibilitychange",this.Gr)))}debug(e){!1===e?(null==s||s.console.log("You've disabled debug mode."),this.set_config({debug:!1})):(null==s||s.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}))}O(){var e,t,i,s,r=this.Yr||{};return"advanced_disable_flags"in r?!!r.advanced_disable_flags:!1!==this.config.advanced_disable_flags?!!this.config.advanced_disable_flags:!0===this.config.advanced_disable_decide?(tc.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):(t="advanced_disable_decide",i=(e="advanced_disable_flags")in r&&!A(r[e]),s=t in r&&!A(r[t]),i?r[e]:!!s&&(tc&&tc.warn("Config field '"+t+"' is deprecated. Please use '"+e+"' instead. The old field will be removed in a future major version."),r[t]))}cs(e){if(j(this.config.before_send))return e;var t=C(this.config.before_send)?this.config.before_send:[this.config.before_send],i=e;for(var s of t){if(j(i=s(i))){var r="Event '"+e.event+"' was rejected in beforeSend function";return V(e.event)?tc.warn(r+". This can cause unexpected behavior."):tc.info(r),null}i.properties&&!M(i.properties)||tc.warn("Event '"+e.event+"' has no properties after beforeSend function, this is likely an error.")}return i}getPageViewId(){var e;return null==(e=this.pageViewManager.Kt)?void 0:e.pageViewId}captureTraceFeedback(e,t){this.capture("$ai_feedback",{$ai_trace_id:String(e),$ai_feedback_text:t})}captureTraceMetric(e,t,i){this.capture("$ai_metric",{$ai_trace_id:String(e),$ai_metric_name:t,$ai_metric_value:String(i)})}Kr(e){var t=U(e)&&!e,i=iW.H()&&"true"===iW.q("ph_debug");return!t&&(!!i||e)}}!function(e,t){for(var i=0;i<t.length;i++)e.prototype[t[i]]=tb(e.prototype[t[i]])}(nv,["identify"]);var nf,nm=(nf=nc[nh]=new nv,function(){function e(){e.done||(e.done=!0,nd=!1,t_(nc,function(e){e._dom_loaded()}))}null!=c&&c.addEventListener?"complete"===c.readyState?e():tk(c,"DOMContentLoaded",e,{capture:!1}):s&&tc.error("Browser doesn't support `document.addEventListener` so PostHog couldn't be initialized")}(),nf)}}]);
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.