PageSourceSearch

https://iconited.com/assets/module-DCWKsDGT.js

js iconited.com collected 2026-10-10 02:33:57 UTC 167,458 bytes, 5 lines download raw bytes

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

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.