PageSourceSearch

https://dlthub.com/_next/static/chunks/14v8.-3-~h~d7.js

js dlthub.com collected 2026-10-03 20:51:47 UTC 178,671 bytes, 1 lines download raw bytes

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

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.