PageSourceSearch

https://app.cal.com/_next/static/chunks/2t5g3au46_twu.js

js cal.com collected 2026-09-24 07:15:49 UTC 159,212 bytes, 1 lines download raw bytes

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

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.