(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,790294,e=>{"use strict";var t,i,s=["retriesPerformedSoFar"];function r(){return(r=Object.assign.bind()).apply(null,arguments)}function n(e,t,i,s,r,n,o){try{var a=e[n](o),l=a.value}catch(e){return void i(e)}a.done?t(l):Promise.resolve(l).then(s,r)}function o(e){return function(){var t=this,i=arguments;return new Promise(function(s,r){var o=e.apply(t,i);function a(e){n(o,s,r,a,l,"next",e)}function l(e){n(o,s,r,a,l,"throw",e)}a(void 0)})}}var a="u">typeof window?window:void 0,l="u">typeof globalThis?globalThis:a,u=null==l?void 0:l.navigator,h=null==l?void 0:l.document,c=null==l?void 0:l.location,d=null==l?void 0:l.fetch,p=null!=l&&l.XMLHttpRequest&&"withCredentials"in new l.XMLHttpRequest?l.XMLHttpRequest:void 0,g=null==l?void 0:l.AbortController,_=null==l?void 0:l.CompressionStream,f=null==u?void 0:u.userAgent,v="u">typeof globalThis?globalThis:a;v&&"u""function"==typeof e,C=e=>e===Object(e)&&!I(e),A=e=>{if(C(e)){for(var t in e)if(P.call(e,t))return!1;return!0}return!1},F=e=>void 0===e,T=e=>"[object String]"==O.call(e),R=e=>T(e)&&0===e.trim().length,D=e=>F(e)||null===e,L=e=>"[object Number]"==O.call(e)&&e==e,B=e=>L(e)&&e>0,q=e=>"[object Boolean]"===O.call(e),N=e=>k(x,e),j=e=>k($,e);function G(e){switch(({}).toString.call(e)){case"[object Error]":case"[object Exception]":case"[object DOMException]":case"[object DOMError]":case"[object WebAssembly.Exception]":return!0;default:var t=Error;try{return e instanceof t}catch(e){return!1}}}var H=[!0,"true",1,"1","yes"],z=[!1,"false",0,"0","no"],U=["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","pinterestbot","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"],V=new Map,W=function(e,t){if(void 0===t&&(t=[]),!e)return!1;var i=function(e,t){for(var i="",s=0;t.length>s;s++){var r=t[s];i+=r.length+":"+r}return e.length+":"+e+"|"+t.length+":"+i}(e,t),s=V.get(i);if(void 0!==s)return s;var r=e.toLowerCase(),n=U.concat(t).some(e=>-1!==r.indexOf(e.toLowerCase()));return 256>V.size||V.clear(),V.set(i,n),n};function J(e,t,i,s,r){return t>i&&(s.warn("min cannot be greater than max."),t=i),L(e)?e>i?(s.warn(" cannot be greater than max: "+i+". Using max value instead."),i):t>e?(s.warn(" cannot be less than min: "+t+". Using min value instead."),t):e:(s.warn(" must be a number. using max or fallback. max: "+i+", fallback: "+r),J(null!=r?r:i,t,i,s))}var K="Mobile",Y="Android",X="Tablet",Z="Android Tablet",Q="iPad",ee="Apple Watch",et="Safari",ei="BlackBerry",es="Samsung Internet",er="Chrome",en="Chrome iOS",eo="Internet Explorer",ea="Internet Explorer Mobile",el="Opera",eu="Microsoft Edge",eh="Firefox",ec="Firefox iOS",ed="Nintendo",ep="PlayStation",eg="Xbox",e_="Android Mobile",ef="Mobile Safari",ev="Windows",em="Windows Phone",ey="Nokia",eb="Ouya",ew="Generic "+K.toLowerCase(),ex="Generic "+X.toLowerCase(),e$="Konqueror",ek="Oculus Browser",eS="Vivaldi",eE="Yandex",eP="Whale",eO="DuckDuckGo",eI="Pale Moon",eM="Waterfox",eC="Brave",eA="Claude",eF="Codex",eT="ChatGPT",eR="Google Search App",eD=RegExp("Version/(\\d+(\\.\\d+)?)"),eL=RegExp("(Claude|Codex|ChatGPT)\\/(\\d+(\\.\\d+)?)"),eB=RegExp(eg,"i"),eq=RegExp("PlayStation \\w+","i"),eN=RegExp("Nintendo \\w+","i"),ej=RegExp("BlackBerry|PlayBook|BB10","i"),eG={"NT3.51":"NT 3.11","NT4.0":"NT 4.0","5.0":"2000",5.1:"XP",5.2:"XP","6.0":"Vista",6.1:"7",6.2:"8",6.3:"8.1",6.4:"10","10.0":"10"},eH=function(e,t,i,s){var r;return t=t||"",(null!=i&&i.brave?eC:null)||(null!=s&&s.detectGoogleSearchApp&&k(e,"GSA/")?eR:k(e," OPR/")&&k(e,"Mini")?"Opera Mini":k(e," OPR/")?el:ej.test(e)?ei:k(e,"IEMobile")||k(e,"WPDesktop")?ea:k(e,"OculusBrowser")?ek:k(e,"SamsungBrowser")?es:k(e,"Edge")||k(e,"Edg/")?eu:k(e,"Vivaldi/")?eS:k(e,"YaBrowser/")?eE:k(e,"Whale/")?eP:k(e,"DuckDuckGo/")||k(e,"Ddg/")?eO:k(e,"Claude/")?eA:k(e,"Codex/")?eF:k(e,"ChatGPT/")?eT:k(e,"FBIOS")?"Facebook Mobile":k(e,"UCWEB")||k(e,"UCBrowser")?"UC Browser":k(e,"CriOS")?en:k(e,"CrMo")||k(e,er)?er:k(e,Y)&&k(e,et)?e_:k(e,"FxiOS")?ec:k(e.toLowerCase(),e$.toLowerCase())?e$:k(e,"Brave/")?eC:(r=t)&&k(r,"Apple")||k(e,et)&&!k(e,er)&&!k(e,Y)?k(e,K)?ef:et:k(e,"PaleMoon/")?eI:k(e,"Waterfox/")?eM:k(e,eh)?eh:k(e,"MSIE")||k(e,"Trident/")?eo:k(e,"Gecko")?eh:"")},ez={[ea]:[RegExp("rv:(\\d+(\\.\\d+)?)")],[eu]:[RegExp("Edge?\\/(\\d+(\\.\\d+)?)")],[er]:[RegExp("(Chrome|CrMo)\\/(\\d+(\\.\\d+)?)")],[en]:[RegExp("CriOS\\/(\\d+(\\.\\d+)?)")],"UC Browser":[RegExp("(UCBrowser|UCWEB)\\/(\\d+(\\.\\d+)?)")],[et]:[eD],[ef]:[eD],[el]:[RegExp("(Opera|OPR)\\/(\\d+(\\.\\d+)?)")],[eh]:[RegExp("Firefox\\/(\\d+(\\.\\d+)?)")],[ec]:[RegExp("FxiOS\\/(\\d+(\\.\\d+)?)")],[e$]:[RegExp("Konqueror[:/]?(\\d+(\\.\\d+)?)","i")],[ei]:[RegExp("BlackBerry (\\d+(\\.\\d+)?)"),eD],[e_]:[RegExp("android\\s(\\d+(\\.\\d+)?)","i")],[es]:[RegExp("SamsungBrowser\\/(\\d+(\\.\\d+)?)")],[ek]:[RegExp("OculusBrowser\\/(\\d+(\\.\\d+)?)")],[eS]:[RegExp("Vivaldi\\/(\\d+(\\.\\d+)?)")],[eE]:[RegExp("YaBrowser\\/(\\d+(\\.\\d+)?)")],[eP]:[RegExp("Whale\\/(\\d+(\\.\\d+)?)")],[eC]:[RegExp("Brave\\/(\\d+(\\.\\d+)?)")],[eA]:[eL],[eF]:[eL],[eT]:[eL],[eO]:[RegExp("(DuckDuckGo|Ddg)\\/(\\d+(\\.\\d+)?)")],[eI]:[RegExp("PaleMoon\\/(\\d+(\\.\\d+)?)")],[eM]:[RegExp("Waterfox\\/(\\d+(\\.\\d+)?)")],[eR]:[RegExp("GSA\\/(\\d+(\\.\\d+)?)")],[eo]:[RegExp("(rv:|MSIE )(\\d+(\\.\\d+)?)")],Mozilla:[RegExp("rv:(\\d+(\\.\\d+)?)")]},eU=function(e,t,i,s){var r=ez[eH(e,t,i,s)];if(F(r))return null;for(var n=0;r.length>n;n++){var o=e.match(r[n]);if(o)return parseFloat(o[o.length-2])}return null},eV=[[RegExp("Xbox; Xbox (.*?)[);]","i"),e=>[eg,e&&e[1]||""]],[RegExp(ed,"i"),[ed,""]],[RegExp(ep,"i"),[ep,""]],[ej,[ei,""]],[RegExp(ev,"i"),(e,t)=>{if(/Phone/.test(t)||/WPDesktop/.test(t))return[em,""];if(new RegExp(K).test(t)&&!/IEMobile\b/.test(t))return["Windows Mobile",""];var i=/Windows NT ([0-9.]+)/i.exec(t);if(i&&i[1]){var s=eG[i[1]]||"";return/arm/i.test(t)&&(s="RT"),[ev,s]}return[ev,""]}],[/((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=F(e[2])?e[3]:e[2]),["watchOS",t]}],[RegExp("(Android (\\d+)\\.(\\d+)\\.?(\\d+)?|Android)","i"),e=>e&&e[2]?[Y,[e[2],e[3],e[4]||"0"].join(".")]:[Y,""]],[/Mac OS X (\d+)[_.](\d+)[_.]?(\d+)?/i,e=>{var t=["Mac OS X",""];return e&&e[1]&&(t[1]=[e[1],e[2],e[3]||"0"].join(".")),t}],[/Mac/i,["Mac OS X",""]],[/CrOS/,["Chrome OS",""]],[/Linux|debian/i,["Linux",""]]],eW=function(e){return eN.test(e)?ed:eq.test(e)?ep:eB.test(e)?eg:RegExp(eb,"i").test(e)?eb:RegExp("(Windows Phone|WPDesktop)","i").test(e)?em:/iPad/.test(e)?Q:/iPod/.test(e)?"iPod Touch":/iPhone/.test(e)?"iPhone":/(watch)(?: ?os[,/]|\d,\d\/)[\d.]+/i.test(e)?ee:ej.test(e)?ei:/(kobo)\s(ereader|touch)/i.test(e)?"Kobo":RegExp(ey,"i").test(e)?ey:/(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(K).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)?Y:Z:RegExp("(pda|Mobile)","i").test(e)?ew:RegExp(X,"i").test(e)&&!RegExp("Tablet pc","i").test(e)?ex:""},eJ=/\bFBAV\/(\d+(?:\.\d+)*)/i,eK=[[/\bInstagram(?:[ /](\d+(?:\.\d+)*))?\b/i,"Instagram"],[/\bBarcelona[ /](\d+(?:\.\d+)*)?/i,"Threads"],[/\b(?:MessengerForiOS|(?:FBAN|FB_IAB)\/Orca-Android)\b/i,"Messenger",eJ],[/\bFBAN\/EMA\b/i,"Facebook Lite",eJ],[/\b(?:FBIOS|(?:FBAN|FB_IAB)\/(?:FB4A|FBIOS))\b/i,"Facebook",eJ],[/\bLinkedInApp(?:\]?\/(\d+(?:\.\d+)*))?\b/i,"LinkedIn"],[/\bTwitter(?:Android| for (?:iPhone|iPad|Android))(?:\/(\d+(?:\.\d+)*))?\b/i,"Twitter"],[/\b(?:musical_ly|trill)(?:[_/](\d+\.\d+(?:\.\d+)*))?(?=\b|_)/i,"TikTok",/\bapp_version\/(\d+(?:\.\d+)*)/i],[/\b(?:MicroMessenger|WeChat)\/(\d+(?:\.\d+)*)?/i,"WeChat"],[/\bLine\/(\d+(?:\.\d+)*)?/i,"Line"],[/\bGSA\/(\d+(?:\.\d+)*)?/i,"Google"],[/\[Pinterest\/(?:iOS|Android)\b|\bPinterest(?: for (?:Android(?: Tablet)?|iOS))?\/(\d+(?:\.\d+)*)/i,"Pinterest"],[/\b(?:WA4A|WAiOS)\/(\d+(?:\.\d+)*)?/i,"WhatsApp"],[/\bSnapchat[ /](\d+(?:\.\d+)*)?/i,"Snapchat"],[/\bBing(?:Web|Sapphire)\/(\d+(?:\.\d+)*)?/i,"Bing"],[/\bNAVER\(inapp; search;/i,"Naver",/\bNAVER\(inapp; search;[^;)]*; (\d+(?:\.\d+)*)/i],[/\bKAKAOTALK[ /](\d+\.\d+(?:\.\d+)*)?/i,"KakaoTalk"]],eY=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;function eX(e,t){return"string"==typeof e&&eY.test(e)?e:t()}function eZ(e,t){var i=Error(t);try{Object.defineProperty(i,"name",{value:e,writable:!0,enumerable:!0,configurable:!0})}catch(e){}return i}function eQ(e){return e?e.split("#")[0]:e}var e0,e1,e2,e3=["$feature_flag","$feature_flag_response","$feature_flag_has_experiment","$feature_flag_id","$feature_flag_version","$feature_flag_reason","$feature_flag_request_id","$feature_flag_evaluated_at","$feature_flag_error","locally_evaluated","$groups","$process_person_profile","$geoip_disable","$current_url","$pathname","$referring_domain","utm_source","utm_medium","utm_campaign","utm_content","utm_term","gad_source","mc_cid","gclid","gclsrc","dclid","gbraid","wbraid","fbclid","msclkid","twclid","li_fat_id","igshid","ttclid","rdt_cid","epik","qclid","sccid","oppref","bfcid","irclid","_kx","$session_id","$window_id","$lib","$lib_version","$device_id","$is_server"],e5="NativeGzipValidationError",e8=e=>e.length>=2&&31===e[0]&&139===e[1],e6=(e,t)=>e===w.GZipJS||t===w.GZipJS||"gzip"===t,e4=e=>!(!e||"object"!=typeof e)&&"NotReadableError"===("name"in e?String(e.name):""),e7=e=>{throw eZ(e5,"Native gzip produced invalid output: "+e)},e9=(e1=o(function*(e,t){18>e.size&&e7("too-short");var i=new Uint8Array((yield e.slice(0,10).arrayBuffer()));e8(i)&&8===i[2]||e7("invalid-header");var s=new DataView((yield e.slice(e.size-8).arrayBuffer()));s.getUint32(0,!0)!==(e=>{for(var t=(()=>{if(e2)return e2;e2=[];for(var e=0;256>e;e++){for(var t=e,i=0;8>i;i++)t=1&t?0xedb88320^t>>>1:t>>>1;e2[e]=t>>>0}return e2})(),i=0xffffffff,s=0;e.length>s;s++)i=t[255&(i^e[s])]^i>>>8;return(0xffffffff^i)>>>0})(t)&&e7("invalid-crc");var r=t.length>>>0;s.getUint32(4,!0)!==r&&e7("invalid-size")}),function(e,t){return e1.apply(this,arguments)});function te(){return(te=o(function*(e,t,i){void 0===t&&(t=!0);try{var s,r=(new TextEncoder).encode(e),n=new globalThis.CompressionStream("gzip"),a=n.writable.getWriter(),l=a.write(r).then(()=>a.close()).catch((s=o(function*(e){try{yield a.abort(e)}catch(e){}throw e}),function(e){return s.apply(this,arguments)})),u=new Response(n.readable).blob(),h=(yield Promise.all([u,l]))[0];return yield e9(h,r),h}catch(e){if(null!=i&&i.rethrow)throw e;return t&&console.error("Failed to gzip compress data",e),null}})).apply(this,arguments)}var tt=function(e,t){var i=(void 0===t?{}:t).debugEnabled,s={N(t){var s;try{s=typeof window>"u"?void 0:window}catch(e){return}for(var r=arguments.length,n=Array(r>1?r-1:0),o=1;r>o;o++)n[o-1]=arguments[o];s&&(b.DEBUG||s.POSTHOG_DEBUG||i)&&!F(s.console)&&s.console&&("__rrweb_original__"in s.console[t]?s.console[t].__rrweb_original__:s.console[t])(e,...n)},debug(){for(var e=arguments.length,t=Array(e),i=0;e>i;i++)t[i]=arguments[i];s.N("debug",...t)},info(){for(var e=arguments.length,t=Array(e),i=0;e>i;i++)t[i]=arguments[i];s.N("log",...t)},warn(){for(var e=arguments.length,t=Array(e),i=0;e>i;i++)t[i]=arguments[i];s.N("warn",...t)},error(){for(var e=arguments.length,t=Array(e),i=0;e>i;i++)t[i]=arguments[i];s.N("error",...t)},critical(){for(var t=arguments.length,i=Array(t),s=0;t>s;s++)i[s]=arguments[s];console.error(e,...i)},uninitializedWarning(e){s.error("You must initialize PostHog before calling "+e)},createLogger:(t,i)=>tt(e+" "+t,i)};return s},ti=tt("[PostHog.js]"),ts=ti.createLogger,tr=ts("[ExternalScriptsLoader]"),tn=e=>{var t=null==h?void 0:h.querySelectorAll("script");if(t){for(var i=0;t.length>i;i++)if(t[i].src===e||t[i].getAttribute("src")===e)return t[i]}},to=(e,t,i)=>{if(e.config.disable_external_dependency_loading)return tr.warn(t+" was requested but loading of external scripts is disabled."),i("Loading of external scripts is disabled");var s=tn(t);if(s){if(s.__posthog_loading_callback_fired)return i();var r=s.__posthog_loading_error;return r?i(r):(s.addEventListener("load",e=>{s.__posthog_loading_callback_fired=!0,i(void 0,e)}),void s.addEventListener("error",e=>{s.__posthog_loading_error=e,i(e)}))}var n=()=>{if(!h)return i("document not found");if(tn(t))return to(e,t,i);var s=h.createElement("script");if(s.type="text/javascript",s.crossOrigin="anonymous",s.src=t,s.onload=e=>{s.__posthog_loading_callback_fired=!0,i(void 0,e)},s.onerror=e=>{s.__posthog_loading_error=e,i(e)},e.config.prepare_external_dependency_script&&(s=e.config.prepare_external_dependency_script(s)),!s)return i("prepare_external_dependency_script returned null");if("head"===e.config.external_scripts_inject_target)h.head.appendChild(s);else{var r,n=h.querySelectorAll("body > script");n.length>0?null==(r=n[0].parentNode)||r.insertBefore(s,n[0]):h.body.appendChild(s)}};null!=h&&h.body?n():null==h||h.addEventListener("DOMContentLoaded",n)},ta={},tl=(e,t)=>{var i="/static/"+t+".js?v="+e.version;return"toolbar"===t&&(i=i+"&t="+3e5*Math.floor(Date.now()/3e5)),e.requestRouter.endpointFor("assets",i)};m.__PosthogExtensions__=m.__PosthogExtensions__||{},m.__PosthogExtensions__.loadExternalDependency=(e,t,i)=>{if("remote-config"!==t){var s=e.config.strict_script_versioning;if(s){var r=e.requestRouter.endpointFor("assets","/static/"+e.version+"/"+t+".js"),n=ta[r];if("fallback"===s&&n){if(tn(n))return void to(e,n,i);delete ta[r]}to(e,r,"fallback"===s?(s,n)=>{if(s)if("string"==typeof s)i(s);else{var o,a=tl(e,t);ta[r]=a;var l=tn(r);null==l||null==(o=l.parentNode)||o.removeChild(l),to(e,a,i)}else i(void 0,n)}:i)}else to(e,tl(e,t),i)}else to(e,e.requestRouter.endpointFor("assets","/array/"+e.config.token+"/config.js"),i)},m.__PosthogExtensions__.loadSiteApp=(e,t,i)=>{to(e,e.requestRouter.endpointFor("api",t),i)},b.DEBUG=!1,b.LIB_VERSION="1.438.12",b.LIB_NAME="web";var tu="$active_feature_flags",th="$feature_flag_details",tc="$feature_flag_errors",td="$feature_flag_evaluated_at",tp="$feature_flag_request_id",tg="$minimal_flag_called_events",t_="$enabled_feature_flags",tf="$stored_group_properties",tv="$stored_person_properties",tm="$flag_call_reported",ty="$feature_flag_payloads",tb="visibilitychange",tw="distinct_id",tx="$device_id",t$="$device_model",tk="__alias",tS="$fbc",tE="$fbc_persistence",tP="$fbp",tO="$fbp_persistence",tI="__timers",tM="$dead_clicks_enabled_server_side",tC="$session_recording_remote_config",tA="$sesid",tF="$session_is_sampled",tT="$groups",tR="$surveys_loaded_at",tD="$user_state",tL="$client_session_props",tB="$capture_rate_limit",tq="$initial_campaign_params",tN="$initial_referrer_info",tj="$initial_person_info",tG="$epp",tH="$posthog_cookieless",tz="$cookieless_mode",tU="$sdk_debug_extensions_init_method",tV="$sdk_debug_extensions_init_time_ms",tW="anonymous",tJ="identified",tK="identified_only",tY="beforeunload",tX="$pageview",tZ="$pageleave",tQ="$identify",t0="$groupidentify";function t1(e,t){I(e)&&e.forEach(t)}function t2(e,t){if(!D(e))if(I(e))e.forEach(t);else if(e instanceof FormData)e.forEach((e,i)=>t(e,i));else for(var i in e)P.call(e,i)&&t(e[i],i)}var t3=function(e){for(var t=arguments.length,i=Array(t>1?t-1:0),s=1;t>s;s++)i[s-1]=arguments[s];for(var r of i)for(var n in r)void 0!==r[n]&&(e[n]=r[n]);return e},t5=function(e){return function(){try{for(var t=arguments.length,i=Array(t),s=0;t>s;s++)i[s]=arguments[s];return e.apply(this,i)}catch(e){ti.critical("Implementation error. Please turn on debug mode and open a ticket on https://app.posthog.com/home#panel=support%3Asupport%3A."),ti.critical(e)}}},t8=function(e){var t={};return t2(e,function(e,i){(T(e)&&e.length>0||L(e))&&(t[i]=e)}),t};function t6(e){var t=r({},e);for(var i of["name","message","stack","cause","errors"])try{i in e&&(t[i]=e[i])}catch(e){}return t}var t4=["herokuapp.com","vercel.app","netlify.app"];function t7(e,t,i,s){var r=null!=s?s:{},n=r.capture,o=r.passive;null==e||e.addEventListener(t,i,{capture:void 0!==n&&n,passive:void 0===o||o})}var t9=e=>{if(h){try{for(var t=e+"=",i=h.cookie.split(";").filter(e=>e.length),s=0;i.length>s;s++){for(var r=i[s];" "==r.charAt(0);)r=r.substring(1,r.length);if(0===r.indexOf(t))return decodeURIComponent(r.substring(t.length,r.length))}}catch(e){}return null}};Math.trunc||(Math.trunc=function(e){return 0>e?Math.ceil(e):Math.floor(e)}),Number.isInteger||(Number.isInteger=function(e){return L(e)&&isFinite(e)&&Math.floor(e)===e});var ie=class e{constructor(e){if(this.bytes=e,16!==e.length)throw TypeError("not 128-bit length")}static fromFieldsV7(t,i,s,r){if(!Number.isInteger(t)||!Number.isInteger(i)||!Number.isInteger(s)||!Number.isInteger(r)||0>t||0>i||0>s||0>r||t>0xffffffffffff||i>4095||s>0x3fffffff||r>0xffffffff)throw RangeError("invalid field value");var n=new Uint8Array(16);return n[0]=t/0x10000000000,n[1]=t/0x100000000,n[2]=t/0x1000000,n[3]=t/65536,n[4]=t/256,n[5]=t,n[6]=112|i>>>8,n[7]=i,n[8]=128|s>>>24,n[9]=s>>>16,n[10]=s>>>8,n[11]=s,n[12]=r>>>24,n[13]=r>>>16,n[14]=r>>>8,n[15]=r,new e(n)}toString(){for(var e="",t=0;this.bytes.length>t;t++)e=e+(this.bytes[t]>>>4).toString(16)+(15&this.bytes[t]).toString(16),3!==t&&5!==t&&7!==t&&9!==t||(e+="-");if(36!==e.length)throw Error("Invalid UUIDv7 was generated");return e}clone(){return new e(this.bytes.slice(0))}equals(e){return 0===this.compareTo(e)}compareTo(e){for(var t=0;16>t;t++){var i=this.bytes[t]-e.bytes[t];if(0!==i)return Math.sign(i)}return 0}},it=class{generate(){var e=this.generateOrAbort();if(!F(e))return e;this.Ct=0;var t=this.generateOrAbort();if(F(t))throw Error("Could not generate UUID after timestamp reset");return t}generateOrAbort(){var e,t=L(e=Date.now())&&isFinite(e)?Math.min(Math.max(Math.floor(e),0),0xffffffffffff):0;if(t>this.Ct)this.Ct=t,this.It();else{if(this.Ct>=t+1e4)return;this.Mt++,this.Mt>0x3ffffffffff&&(this.Ct++,this.It())}return ie.fromFieldsV7(this.Ct,Math.trunc(this.Mt/0x40000000),0x3fffffff&this.Mt,this.Tt.nextUint32())}It(){this.Mt=1024*this.Tt.nextUint32()+(1023&this.Tt.nextUint32())}constructor(){this.Ct=0,this.Mt=0,this.Tt=new ir}},ii=e=>{if("u">typeof UUIDV7_DENY_WEAK_RNG&&UUIDV7_DENY_WEAK_RNG)throw Error("no cryptographically strong RNG available");for(var t=0;e.length>t;t++)e[t]=65536*Math.trunc(65536*Math.random())+Math.trunc(65536*Math.random());return e};a&&!F(a.crypto)&&crypto.getRandomValues&&(ii=e=>crypto.getRandomValues(e));var is,ir=class{nextUint32(){return this.Rt.length>this.Et||(ii(this.Rt),this.Et=0),this.Rt[this.Et++]}constructor(){this.Rt=new Uint32Array(8),this.Et=1/0}},io=()=>ia().toString(),ia=()=>(is||(is=new it)).generate(),il="",iu=/[a-z0-9][a-z0-9-]+\.[a-z]{2,}$/i,ih=null,ic={At(){if(null!==ih)return ih;if(ih=!1,h)try{var e="__ph_cookie_support_"+io();ic.$t(e,"xyz"),ih='"xyz"'===t9(e),ic.Pt(e)}catch(e){ih=!1}return ih},Lt(e){ti.error("cookieStore error: "+e)},Ot:t9,Dt(e){var t;try{t=JSON.parse(ic.Ot(e))||{}}catch(e){}return t},$t(e,t,i,s,r){if(!h)return!1;try{var n="",o="",a=function(e,t){if(t){var i=function(e,t){if(void 0===t&&(t=h),il)return il;if(!t||["localhost","127.0.0.1"].includes(e))return"";for(var i=e.split("."),s=Math.min(i.length,8),r="dmn_chk_"+io();!il&&s--;){var n=i.slice(s).join("."),o=r+"=1;domain=."+n+";path=/";t.cookie=o+";max-age=3",t.cookie.includes(r)&&(t.cookie=o+";max-age=0",il=n)}return il}(e);if(!i){var s,r=(s=e.match(iu))?s[0]:"";r!==i&&ti.info("Warning: cookie subdomain discovery mismatch",r,i),i=r}return i?"; domain=."+i:""}return""}(h.location.hostname,s);if(i){var l=new Date;l.setTime(l.getTime()+864e5*i),n="; expires="+l.toUTCString()}r&&(o="; secure");var u=e+"="+encodeURIComponent(JSON.stringify(t))+n+"; SameSite=Lax; path=/"+a+o;return u.length>3686.4&&ti.warn("cookieStore warning: large cookie, len="+u.length),h.cookie=u,!0}catch(e){return!1}},Pt(e,t){if(null!=h&&h.cookie&&(!t||null!==t9(e)))try{ic.$t(e,"",-1,t)}catch(e){return}}},id=null,ip={At(){if(null!==id)return id;var e=!0;if(F(a))e=!1;else try{var t="__mplssupport__";ip.$t(t,"xyz"),'"xyz"'!==ip.Ot(t)&&(e=!1),ip.Pt(t)}catch(t){e=!1}return e||ti.error("localStorage unsupported; falling back to cookie store"),id=e,e},Lt(e){ti.error("localStorage error: "+e)},Ot(e){try{return null==a?void 0:a.localStorage.getItem(e)}catch(e){ip.Lt(e)}return null},Dt(e){try{return JSON.parse(ip.Ot(e))||{}}catch(e){}return null},$t(e,t){try{return null==a||a.localStorage.setItem(e,JSON.stringify(t)),!0}catch(e){ip.Lt(e)}return!1},Pt(e){try{null==a||a.localStorage.removeItem(e)}catch(e){ip.Lt(e)}}},ig=[tv,tu,t_,th,ty,tp,td,tc,tm],i_=[tx,tw,tA,tF,tG,tj,tE,tD],iv=["__proto__","constructor","prototype"],im=e=>{if(!C(e))return{};var t={};return Object.keys(e).forEach(i=>{-1===iv.indexOf(i)&&(t[i]=e[i])}),t},iy=function(e,t){void 0===t&&(t=[]);var i={};return[...i_,...t].forEach(t=>{var s=e[t];F(s)||null===s||""===s||(i[t]=s)}),i},ib=e=>{for(var t=5381,i=0x811c9dc5,s=0;e.length>s;s++){var r=e.charCodeAt(s);t=33*t^r,i=Math.imul(i^r,0x1000193)}return e.length.toString(36)+"."+(t>>>0).toString(36)+"."+(i>>>0).toString(36)},iw=(e,t)=>({p:t,f:ib(JSON.stringify(e))}),ix=(e,t)=>{if(!t)return{properties:[],isValid:!1};try{var i=ic.Dt(e+"_cpm"),s=(null==i?void 0:i.f)===ib(t)&&I(i.p);return{properties:s?i.p:[],isValid:s}}catch(e){return{properties:[],isValid:!1}}},i$=(e,t)=>t+"|"+(ic.Ot(e+"_cpm")||""),ik={},iS={At:()=>!0,Lt(e){ti.error("memoryStorage error: "+e)},Ot:e=>e in ik?ik[e]:null,Dt:e=>e in ik?ik[e]:null,$t:(e,t)=>(ik[e]=t,!0),Pt(e){delete ik[e]}},iE=null,iP={At(){if(null!==iE)return iE;if(iE=!0,F(a))iE=!1;else try{var e="__support__";iP.$t(e,"xyz"),'"xyz"'!==iP.Ot(e)&&(iE=!1),iP.Pt(e)}catch(e){iE=!1}return iE},Lt(e){ti.error("sessionStorage error: ",e)},Ot(e){try{return null==a?void 0:a.sessionStorage.getItem(e)}catch(e){iP.Lt(e)}return null},Dt(e){try{return JSON.parse(iP.Ot(e))||null}catch(e){}return null},$t(e,t){try{return null==a||a.sessionStorage.setItem(e,JSON.stringify(t)),!0}catch(e){iP.Lt(e)}return!1},Pt(e){try{null==a||a.sessionStorage.removeItem(e)}catch(e){iP.Lt(e)}}},iO=class{constructor(e){this._instance=e}get Mr(){return this._instance.config}get consent(){return this.Lo()?0:this.No}isOptedOut(){return"always"===this.Mr.cookieless_mode||this.isRejected()||-1===this.consent&&"on_reject"===this.Mr.cookieless_mode}isOptedIn(){return!this.isOptedOut()}isExplicitlyOptedOut(){return 0===this.consent}isRejected(){return 0===this.consent||-1===this.consent&&this.Mr.opt_out_capturing_by_default}optInOut(e){this.qo.$t(this.jo,+!!e,this.Mr.cookie_expiration,this.Mr.cross_subdomain_cookie,this.Mr.secure_cookie)}reset(){this.qo.Pt(this.jo,this.Mr.cross_subdomain_cookie)}get jo(){var e=this._instance.config,t=e.token,i=e.opt_out_capturing_cookie_prefix;return e.consent_persistence_name||(i?i+t:"__ph_opt_in_out_"+t)}get No(){var e=this.qo.Ot(this.jo);return k(H,e)?1:k(z,e)?0:-1}get qo(){var e=this.Mr.opt_out_capturing_persistence_type,t="localStorage"===e?ip:ic,i=t.At()?t:iS;if(!this.Bo||this.Bo!==i){this.Bo=i;var s="localStorage"===e?ic:ip;s.Ot(this.jo)&&(this.Bo.Ot(this.jo)||this.optInOut(k(H,s.Ot(this.jo))),s.Pt(this.jo,this.Mr.cross_subdomain_cookie))}return this.Bo}Lo(){return!!this.Mr.respect_dnt&&[null==u?void 0:u.doNotTrack,null==u?void 0:u.msDoNotTrack,m.doNotTrack,null==u?void 0:u.globalPrivacyControl].some(e=>k(H,e))}},iI=["next","previous","prev",">","<","→","←","›","‹","»","«","▶","◀","❯","❮","+","-","−","–"];ts("[Dead Clicks]");var iM=e=>{var t,i=!(null==(t=e.instance.persistence)||!t.get_property(tM)),s=e.instance.config.capture_dead_clicks;return q(s)?s:!!C(s)||i},iC=ts("[SegmentIntegration]");function iA(e,t,i){void 0===i&&(i=!0);var s,n,o,a=e.config.segment;if(!a)return t();var l=M(a.register)?{analytics:a}:a,u=l.analytics,h=l.filterProperties;s=i,n=i=>{var n=()=>i.anonymousId()||io();e.config.get_device_id=n,s&&i.id()&&(e.register({distinct_id:i.id(),$device_id:n()}),e.persistence.set_property(tD,tJ)),(i=>{var s,n;u.register((s=i,"u">typeof Promise&&Promise.resolve||iC.warn("This browser does not have Promise support, and can not use the segment integration"),n=(t,i)=>{if(!i)return t;var n=!!s&&t.event.anonymousId===s&&!t.event.userId;n||t.event.userId||t.event.anonymousId===e.get_distinct_id()||(iC.info("No userId set, resetting PostHog"),e.reset()),n||(s=void 0),t.event.userId&&t.event.userId!==e.get_distinct_id()&&(iC.info("UserId set, identifying with PostHog"),e.identify(t.event.userId));var o=e.calculateEventProperties(i,t.event.properties);if(!D(h)){var a=t.event.properties||{},l={};for(var u of Object.keys(o))P.call(a,u)||(l[u]=o[u]);var c=((e,t)=>{var i=I(e)?e:[e],s=r({},t);for(var n of i)try{if(s=n(s),D(s))return null}catch(e){return iC.error("Error in Segment filterProperties:",e),null}return s})(h,l);if(D(c))return t;o=c}return t.event.properties=Object.assign({},o,t.event.properties),t},{name:"PostHog JS",type:"enrichment",version:"1.0.0",isLoaded:()=>!0,load:()=>Promise.resolve(),track:e=>n(e,e.event.event),page:e=>n(e,tX),identify:e=>n(e,tQ),screen:e=>n(e,"$screen")})).then(()=>{t()},e=>{iC.error("Failed to register the Segment integration",e),t()})})(s?void 0:i.anonymousId()||void 0)},"then"in(o=u.user())&&M(o.then)?o.then(n):n(o)}var iF="posthog-js";function iT(e,t){var i=void 0===t?{}:t,s=i.organization,n=i.projectId,o=i.prefix,a=i.severityAllowList,l=void 0===a?["error"]:a,u=i.sendExceptionsToPostHog,h=void 0===u||u;return t=>{if("*"!==l&&!l.includes(t.level)||!e.__loaded)return t;t.tags||(t.tags={});var i,a,u,c,d,p,g=e.requestRouter.endpointFor("ui","/project/"+e.config.token+"/person/"+e.get_distinct_id());t.tags["PostHog Person URL"]=g,e.sessionRecordingStarted()&&(t.tags["PostHog Recording URL"]=e.get_session_replay_url({withTimestamp:!0}));var _=(null==(i=t.exception)?void 0:i.values)||[],f=_.map(e=>r({},e,{stacktrace:e.stacktrace?r({},e.stacktrace,{type:"raw",frames:(e.stacktrace.frames||[]).map(e=>r({},e,{platform:"web:javascript"}))}):void 0})),v={$exception_message:(null==(a=_[0])?void 0:a.value)||t.message,$exception_type:null==(u=_[0])?void 0:u.type,$exception_level:t.level,$exception_list:f,$sentry_event_id:t.event_id,$sentry_exception:t.exception,$sentry_exception_message:(null==(c=_[0])?void 0:c.value)||t.message,$sentry_exception_type:null==(d=_[0])?void 0:d.type,$sentry_tags:t.tags};return s&&n&&(v.$sentry_url=(o||"https://sentry.io/organizations/")+s+"/issues/?project="+n+"&query="+t.event_id),h&&(null==(p=e.exceptions)||p.sendExceptionEvent(v)),t}}var iR=class{constructor(e,t,i,s,r,n){this.name=iF,this.setupOnce=function(o){o(iT(e,{organization:t,projectId:i,prefix:s,severityAllowList:r,sendExceptionsToPostHog:null==n||n}))}}},iD=class{constructor(e){this.Wo=(e,t,i)=>{i&&(i.noSessionId||i.activityTimeout||i.sessionPastMaximumLength||i.crossTabAdoption)&&(ti.info("[PageViewManager] Session rotated, clearing pageview state",{sessionId:e,changeReason:i}),this.Vo=void 0,this._instance.scrollManager.resetContext())},this._instance=e,this.Go()}Go(){var e;this.Qo=null==(e=this._instance.sessionManager)?void 0:e.onSessionId(this.Wo)}destroy(){var e;null==(e=this.Qo)||e.call(this),this.Qo=void 0}doPageView(e,t){var i,s=this.Zo(e,t);return this.Vo={pathname:null!=(i=null==a?void 0:a.location.pathname)?i:"",pageViewId:t,timestamp:e},this._instance.scrollManager.resetContext(),s}doPageLeave(e){var t;return this.Zo(e,null==(t=this.Vo)?void 0:t.pageViewId)}doEvent(){var e;return{$pageview_id:null==(e=this.Vo)?void 0:e.pageViewId}}Zo(e,t){var i=this.Vo;if(!i)return{$pageview_id:t};var s={$pageview_id:t,$prev_pageview_id:i.pageViewId},r=this._instance.scrollManager.getContext();if(r&&!this._instance.config.disable_scroll_properties){var n=r.maxScrollHeight,o=r.lastScrollY,a=r.maxScrollY,l=r.maxContentHeight,u=r.lastContentY,h=r.maxContentY;if(!(F(n)||F(o)||F(a)||F(l)||F(u)||F(h))){n=Math.ceil(n),o=Math.ceil(o),a=Math.ceil(a),l=Math.ceil(l),u=Math.ceil(u),h=Math.ceil(h);var c=n>1?J(o/n,0,1,ti):1,d=n>1?J(a/n,0,1,ti):1,p=l>1?J(u/l,0,1,ti):1,g=l>1?J(h/l,0,1,ti):1;s=t3(s,{$prev_pageview_last_scroll:o,$prev_pageview_last_scroll_percentage:c,$prev_pageview_max_scroll:a,$prev_pageview_max_scroll_percentage:d,$prev_pageview_last_content:u,$prev_pageview_last_content_percentage:p,$prev_pageview_max_content:h,$prev_pageview_max_content_percentage:g})}}return i.pathname&&(s.$prev_pageview_pathname=i.pathname),i.timestamp&&(s.$prev_pageview_duration=(e.getTime()-i.timestamp.getTime())/1e3),s}},iL=["flags","surveys"],iB={$people_distinct_id:{exposure:"hidden"},[tk]:{exposure:"hidden"},__cmpns:{exposure:"hidden"},[tI]:{exposure:"hidden"},[tE]:{exposure:"hidden"},[tO]:{exposure:"hidden"},$autocapture_disabled_server_side:{exposure:"event"},$heatmaps_enabled_server_side:{exposure:"hidden"},$logs_capture_enabled_server_side:{exposure:"hidden"},$exception_capture_enabled_server_side:{exposure:"event"},$error_tracking_suppression_rules:{exposure:"hidden"},$error_tracking_capture_extension_exceptions:{exposure:"event"},$web_vitals_enabled_server_side:{exposure:"event"},[tM]:{exposure:"event"},$product_tours_enabled_server_side:{exposure:"hidden"},$web_vitals_allowed_metrics:{exposure:"event"},[tC]:{exposure:"hidden"},$session_recording_enabled_server_side:{exposure:"hidden"},[tA]:{exposure:"hidden"},[tF]:{exposure:"event"},$replay_sample_rate:{exposure:"event",shouldSkipFromEventProperties:e=>null===e},$session_past_minimum_duration:{exposure:"event"},$session_recording_url_trigger_activated_session:{exposure:"event"},$session_recording_event_trigger_activated_session:{exposure:"event"},$debug_first_full_snapshot_timestamp:{exposure:"event"},$sess_rec_flush_size:{exposure:"hidden"},[t_]:{exposure:"hidden",storageGroup:"flags"},[tu]:{exposure:"hidden",storageGroup:"flags"},$early_access_features:{exposure:"hidden"},[th]:{exposure:"hidden",storageGroup:"flags"},[ty]:{exposure:"hidden",storageGroup:"flags"},[tp]:{exposure:"hidden",storageGroup:"flags",volatile:!0},[tg]:{exposure:"hidden",storageGroup:"flags"},$override_feature_flags:{exposure:"hidden"},$override_feature_flag_payloads:{exposure:"hidden"},[tv]:{exposure:"hidden"},[tf]:{exposure:"hidden"},$surveys:{exposure:"hidden",storageGroup:"surveys"},[tR]:{exposure:"hidden",storageGroup:"surveys",volatile:!0},$surveys_activated:{exposure:"event"},$surveys_activated_session:{exposure:"hidden"},$surveys_activated_timestamps:{exposure:"hidden"},ph_product_tours:{exposure:"hidden"},$product_tours_activated:{exposure:"hidden"},$product_tours_activated_session:{exposure:"hidden"},$conversations_widget_session_id:{exposure:"event"},$conversations_ticket_id:{exposure:"event"},$conversations_widget_state:{exposure:"event"},$conversations_user_traits:{exposure:"event"},[tm]:{exposure:"hidden"},$flag_call_reported_session_id:{exposure:"hidden"},[tT]:{exposure:"event"},[tc]:{exposure:"hidden"},[td]:{exposure:"hidden",storageGroup:"flags",volatile:!0},[tD]:{exposure:"hidden"},[tL]:{exposure:"hidden"},[tB]:{exposure:"hidden"},[tq]:{exposure:"hidden"},[tN]:{exposure:"hidden"},[tj]:{exposure:"hidden"},[tG]:{exposure:"hidden"},$replay_override_sampling:{exposure:"event"},$replay_override_linked_flag:{exposure:"event"},$replay_override_url_trigger:{exposure:"event"},$replay_override_event_trigger:{exposure:"event"},[tU]:{exposure:"event"},[tV]:{exposure:"event"},$sdk_debug_recording_script_not_loaded:{exposure:"hidden"},$sdk_debug_replay_stale_config:{exposure:"hidden"},$sdk_debug_replay_event_trigger_status:{exposure:"hidden"},$sdk_debug_replay_linked_flag_trigger_status:{exposure:"hidden"},$sdk_debug_replay_matched_recording_trigger_groups:{exposure:"hidden"},$sdk_debug_replay_pending_trigger_conditions:{exposure:"hidden"},$sdk_debug_replay_remote_trigger_matching_config:{exposure:"hidden"},$sdk_debug_replay_trigger_groups_count:{exposure:"hidden"},$sdk_debug_replay_url_trigger_status:{exposure:"hidden"},$session_recording_start_reason:{exposure:"event"}},iq=[["$posthog_sr_group_event_trigger_",{exposure:"hidden"}],["$posthog_sr_group_url_trigger_",{exposure:"hidden"}],["$posthog_sr_group_sampling_",{exposure:"hidden"}]],iN=e=>{var t=iB[e];if(t)return t;for(var i of iq){var s=i[1];if(0===e.indexOf(i[0]))return s}},ij=(e,t)=>{var i,s,r;try{return JSON.stringify(e,(e,t)=>G(t)?(null!=r||(r=new WeakMap),r.has(t)||r.set(t,t6(t)),r.get(t)):"bigint"==typeof t?t.toString():t,t)}catch(t){return s=[],null!=(i=JSON.stringify(e,function(e,t){if("bigint"==typeof t)return t.toString();if("function"!=typeof t&&"symbol"!=typeof t){if(t instanceof Error)return{name:t.name,message:t.message,stack:t.stack};if(t&&"object"==typeof t){for(;s.length>0&&s[s.length-1]!==this;)s.pop();if(s.includes(t))return"[Circular]";s.push(t)}return t}}))?i:"null"}},iG=e=>{var t=null==h?void 0:h.createElement("a");return F(t)?null:(t.href=e,t)},iH=function(e,t){for(var i,s=((e.split("#")[0]||"").split(/\?(.*)/)[1]||"").replace(/^\?+/g,"").split("&"),r=0;s.length>r;r++){var n=s[r].split("=");if(n[0]===t){i=n;break}}if(!I(i)||2>i.length)return"";var o=i[1];try{o=decodeURIComponent(o)}catch(e){ti.error("Skipping decoding for malformed query param: "+o)}return o.replace(/\+/g," ")},iz=function(e,t,i){if(!e||!t||!t.length)return e;for(var s=e.split("#"),r=s[1],n=(s[0]||"").split("?"),o=n[1],a=n[0],l=(o||"").split("&"),u=[],h=0;l.length>h;h++){var c=l[h].split("=");I(c)&&(t.includes(c[0])?u.push(c[0]+"="+i):u.push(l[h]))}var d=a;return null!=o&&(d+="?"+u.join("&")),null!=r&&(d+="#"+r),d},iU=["gclid","gclsrc","dclid","gbraid","wbraid","fbclid","msclkid","twclid","li_fat_id","igshid","ttclid","rdt_cid","epik","qclid","sccid","oppref","bfcid","irclid","_kx"],iV=["utm_source","utm_medium","utm_campaign","utm_content","utm_term","gad_source","mc_cid",...iU],iW="",iJ=["li_fat_id"];function iK(e,t){var i=iV.concat(t||[]),s={};return t2(i,function(t){var i=iH(e,t);s[t]=i||null}),s}function iY(e){var t=e?0===e.search("https?://(.*)google.([^/?]*)")?"google":0===e.search("https?://(.*)bing.com")?"bing":0===e.search("https?://(.*)yahoo.com")?"yahoo":0===e.search("https?://(.*)duckduckgo.com")?"duckduckgo":null:null,i={};if(null!==t){i.$search_engine=t;var s=h?iH(h.referrer,"yahoo"!=t?"q":"p"):"";s.length&&(i.ph_keyword=s)}return i}function iX(){return navigator.language||navigator.userLanguage}var iZ="$direct";function iQ(){return(null==h?void 0:h.referrer)||iZ}function i0(e,t,i){void 0===i&&(i=!1);var s,r=e?[...iU,...t||[]]:[],n=null==(s=i?eQ(null==c?void 0:c.href):null==c?void 0:c.href)?void 0:s.substring(0,1e3);return{r:iQ().substring(0,1e3),u:n?iz(n,r,iW):void 0}}function i1(e,t){void 0===t&&(t=!1);var i,s=e.r,r=e.u,n=t?eQ(r):r,o={$referrer:s,$referring_domain:null==s?void 0:s==iZ?iZ:null==(i=iG(s))?void 0:i.host};if(n){o.$current_url=n;var a=iG(n);o.$host=null==a?void 0:a.host,o.$pathname=null==a?void 0:a.pathname,t3(o,iK(n))}return s&&t3(o,iY(s)),o}var i2={flags:td,surveys:tR},i3=["cookie","localstorage","localstorage+cookie","sessionstorage","memory"],i5=e=>{var t="",i=0;for(var s of e){var r=encodeURIComponent(JSON.stringify(s).slice(1,-1)).length;if(i+r>1e3)break;t+=s,i+=r}return t},i8="main",i6=[t_,tu,th,ty,tp,td,tg,tv],i4=e=>-1!==i6.indexOf(e),i7=[tE,tO],i9=e=>-1!==i7.indexOf(e),se=(e,t)=>{try{return JSON.stringify(e)===JSON.stringify(t)}catch(i){return e===t}},st=e=>{if(!e)return{};var t=JSON.parse(e);return C(t)?t:{}},si=(e,t)=>{t2(e,(i,s)=>{var r=iN(s);r&&"event"!==r.exposure||({}).hasOwnProperty.call(t,s)||delete e[s]})},ss=class{constructor(e,t,i,s){if(void 0===i&&(i=!0),void 0===s&&(s=!e.cookieless_mode),this.Jo={},this.Ko=!1,this.Xo=!1,this.Yo=!1,this.ta=!1,this.ea=!1,this.ia=new Map,this.na=!1,this.sa=!1,this.ra=!1,this.oa=new Set,this.aa=new Set,this.Mr=e,this.la=i,this.props={},this.ua=void 0,this.ca=(n="",e.token&&(n=e.token.replace(/\+/g,"PL").replace(/\//g,"SL").replace(/=/g,"EQ")),e.persistence_name?"ph_"+e.persistence_name:"ph_"+n+"_posthog"),this.hi=e.disable_persistence||!!t,this.qo=this.ha(e),this.Yo=this.da(e),this.load(s),this.va(),e.debug&&ti.info("Persistence loaded",e.persistence,r({},this.props)),this.update_config(e,e,t),this.save(),a){var n,o=()=>this.flush();t7(a,"beforeunload",o,{capture:!1}),t7(a,"pagehide",o,{capture:!1}),this.fa=e=>{if(this.Ko&&(!e.storageArea||e.storageArea===(null==a?void 0:a.localStorage))&&e.key)if(e.key!==this.ca){if(this.Yo){var t=iL.find(t=>e.key===this.pa(t));t&&this.ga(e.key,t)}}else this.ga(e.key,i8)},t7(a,"storage",this.fa)}}markCrossTabFeatureFlagChanges(e){Object.entries(e).forEach(e=>{var t=e[0],i=e[1],s=this.ia.get(t);if(i4(t)&&!0!==s)if(!0!==i){var r=new Set(s||[]);i.forEach(e=>r.add(e)),r.size&&this.ma(t,r)}else this.ma(t,!0)})}onCrossTabFeatureFlagChange(e){return this.aa.add(e),()=>this.aa.delete(e)}destroy(){this.fa&&a&&(a.removeEventListener("storage",this.fa),this.fa=void 0),this.aa.clear()}ga(e,t,i){if(void 0===i&&(i=!0),this.hi)return!1;try{let i;if(i=r=ip.Ot(e),null===i){var s,r,n=this.ya(t);return n.storageValue=null,t!==i8&&(n.persisted=!1),!1}s=st(r)}catch(e){return!1}var o=t===i8?s:ip.Dt(this.ca);if(o&&this.ba(o))return!1;var a=this._a(s,t,i);return t===i8&&this.Yo&&!se(this.wa().main,s)||this.ka(s,t,!0,r),a}ba(e){var t=this.props[tw],i=e[tw];return!F(t)&&!F(i)&&t!==i}ka(e,t,i,s){var r=this.ya(t);r.storageValue=s,t!==i8&&(r.persisted=i);try{r.fingerprint=this.Sa(e,t)}catch(e){r.fingerprint=void 0}}_a(e,t,i){var s=!1;return i6.forEach(i=>{var r,n=null==(r=iN(i))?void 0:r.storageGroup;if(!(t===i8&&this.Yo&&n||t!==i8&&n!==t)){var o=i in e,a=this.xa(i,o?e[i]:void 0),l=this.ia.has(i)?i in this.props:o;l===i in this.props&&se(a,this.props[i])||(l?this.$a(i,a,!1):this.Ca(i,!1),s=!0)}}),s&&i&&this.aa.forEach(e=>e()),s}Ta(){if(!this.Ko)return!1;try{this.ra=!1;var e,t=ip.Ot(this.ca),i=this.ya(i8),s=!1,r=!1;if(t!==i.storageValue)if(null===t)i.storageValue=null;else{if(e=st(t),this.ra=!this.sa&&this.ba(e),this.ra)return!1;r=this._a(e,i8,!1),!this.Yo||se(this.wa().main,e)?this.ka(e,i8,!0,t):i.storageValue=t,s=!0}return this.Yo&&iL.forEach(t=>{var i=ip.Ot(this.pa(t)),n=this.ya(t),o=e||{},a=s&&i6.some(e=>{var i;return(null==(i=iN(e))?void 0:i.storageGroup)===t&&e in o});if(i!==n.storageValue||a){if(null===i)return n.storageValue=null,n.persisted=!1,void(a&&(r=this._a(o,t,!1)||r));var l=st(i);r=this._a(l,t,!1)||r,this.ka(l,t,!0,i)}}),r}catch(e){return!1}}ma(e,t){this.ia.set(e,t);var i=iN(e);null!=i&&i.volatile||(this.ya((this.Yo?null==i?void 0:i.storageGroup:void 0)||i8).fingerprint=void 0,this.Ia(e))}Ma(){i6.forEach(e=>this.ia.set(e,!0))}va(){if(this.Ko)try{var e=ip.Ot(this.ca),t=st(e);this.ya(i8).storageValue=e,i6.forEach(e=>{var i,s=this.Yo?null==(i=iN(e))?void 0:i.storageGroup:void 0,r=s?ip.Ot(this.pa(s)):null;if(s){var n=this.ya(s);n.storageValue=r,n.persisted=null!==r}var o=s&&null!==r?st(r):t;e in this.props?this.Ea(e,o[e],this.props[e]):e in o&&this.ma(e,!0)})}catch(e){}}xa(e,t){var i=this.ia.get(e);if(!i)return t;if(!0===i)return this.props[e];if("$active_feature_flags"===e){var s=new Set(I(t)?t:[]),n=new Set(I(this.props[e])?this.props[e]:[]);return i.forEach(e=>n.has(e)?s.add(e):s.delete(e)),Array.from(s)}var o=C(t)?r({},t):{},a=C(this.props[e])?this.props[e]:{};return i.forEach(e=>{e in a?o[e]=a[e]:delete o[e]}),o}Ea(e,t,i){if(i4(e)){var s=this.ia.get(e);if(!0!==s){var r=t;if(this.Ko)try{var n,o=this.Yo?null==(n=iN(e))?void 0:n.storageGroup:void 0,a=o?this.pa(o):this.ca;r=st(ip.Ot(a))[e]}catch(e){}var l=new Set(s||[]);if("$active_feature_flags"===e){if(!F(t)&&!I(t)||!F(r)&&!I(r)||!I(i))return void this.ma(e,!0);var u=new Set(t||[]),h=new Set(r||[]),c=new Set(i);new Set([...u,...c]).forEach(e=>{u.has(e)!==c.has(e)&&l.add(e)}),l.forEach(e=>{h.has(e)===c.has(e)&&l.delete(e)})}else{if(!C(i))return void(se(r,i)?this.ia.delete(e):this.ma(e,!0));if(!F(t)&&!C(t)||F(t)&&A(i)&&F(r))return void this.ma(e,!0);var d=C(t)?t:{},p=C(r)?r:{};new Set([...Object.keys(d),...Object.keys(i)]).forEach(e=>{e in d==e in i&&se(d[e],i[e])||l.add(e)}),l.forEach(e=>{e in p==e in i&&se(p[e],i[e])&&l.delete(e)})}l.size?this.ma(e,l):this.ia.delete(e)}}}Pa(){var e,t=null==(e=this.Mr)?void 0:e.persistence_save_debounce_ms;return L(t)&&t>0?t:0}Ra(e){if(this.Mr.cookieWinsOnConflict&&"localstorage+cookie"===this.Mr.persistence.toLowerCase())if(e)try{var t=iy(e,this.Mr.cookie_persisted_properties||[]),i=iw(t,this.Mr.cookie_persisted_properties||[]),s=JSON.stringify(t)+"|"+JSON.stringify(i),r=ic.Ot(this.ca)||void 0;r&&i$(this.ca,r)===s&&(this.Aa=s,this.Fa=r)}catch(e){}else try{var n=ic.Ot(this.ca)||void 0;this.Aa=n?i$(this.ca,n):void 0,this.Fa=n}catch(e){}}syncCookieProperties(){return this.Oa(this.Mr)}Oa(e,t){if(void 0===t&&(t=!1),this.hi&&!t||this.ea||!e.cookieWinsOnConflict||"localstorage+cookie"!==e.persistence.toLowerCase())return!1;try{i=ic.Ot(this.ca)||void 0}catch(e){}if(!i||i===this.Fa)return!1;var i,s,r=i$(this.ca,i);try{s=im(JSON.parse(i))}catch(e){return!1}if((ic.Ot(this.ca)||void 0)!==i)return!1;this.Aa=r,this.Fa=i;var n=ix(this.ca,i),o=[...i_,...n.properties],a={};if(Object.keys(s).forEach(e=>{var t=s[e];(F(t)||null===t||""===t||"$user_state"===e&&"anonymous"!==t&&"identified"!==t)&&(a[e]=!0,delete s[e])}),A(s))return!1;var l="distinct_id"in s||"anonymous"===s.$user_state||"identified"===s.$user_state,u=this.props,h=u[tw],c=u[tD],d=t3({},u);[...i_,...e.cookie_persisted_properties||[]].forEach(e=>{if(-1!==o.indexOf(e)&&!(e in s)&&!a[e]&&(l||"distinct_id"!==e&&"$user_state"!==e)){var t=d[e];(n.isValid||-1===i_.indexOf(e)||!1!==t&&0!==t)&&delete d[e]}}),this.props=t3(d,s),i6.forEach(e=>{var t=e in this.props;e in u===t&&se(u[e],this.props[e])||(t?this.Ea(e,u[e],this.props[e]):this.ma(e,!0))}),!l||"$user_state"in s||"$user_state"in this.props||this.$a(tD,tW);var p=this.props[tw],g=this.props[tD];return l&&(p!==h||g!==c)&&(this.sa=!0,this.ta=!0,iP.$t(this.ca+"_cookie_identity_change_pending",!0),this.Ca(tv),this.Ca(tu),this.Ca(t_),this.Ca(th),this.Ca(ty),this.Ca(tp),this.Ca(td),this.Ca(tc),this.Ca(tm),"anonymous"!==g||"identified"!==c&&"anonymous"!==s.$user_state&&(F(h)||p===h)||(si(this.props,s),this.Ca(tf)),"identified"===g?this.props.$user_id=p:delete this.props.$user_id,this.Ca(tk)),!0}consumeCookieIdentityChange(){var e=this.ca+"_cookie_identity_change_pending",t=this.ta||!!iP.Ot(e);return this.ta=!1,t&&iP.Pt(e),t}Da(e){return void 0===e&&(e=!1),!(this.ea||this.hi&&!e||!this.Mr.cookieWinsOnConflict||"localstorage+cookie"!==this.Mr.persistence.toLowerCase()||(this.ea=!0,0))}La(){this.ea&&(F(this.Na)||(clearTimeout(this.Na),this.Na=void 0),delete this.Jo[i8],this.qa(!0))}ja(e){if(void 0===e&&(e=!0),this.ea)try{e?this.La():F(this.Na)||(clearTimeout(this.Na),this.Na=void 0)}finally{this.ea=!1}}isDisabled(){return!!this.hi}ha(e){-1===i3.indexOf(e.persistence.toLowerCase())&&(ti.critical("Unknown persistence type "+e.persistence+"; falling back to localStorage+cookie"),e.persistence="localStorage+cookie");var t,i,s,n,o,l=(t=e.cookie_persisted_properties||[],i=e.cookieWinsOnConflict,void 0===t&&(t=[]),void 0===i&&(i=!1),void 0===(s=()=>!!this.hi)&&(s=()=>!1),n=[...i_,...t],r({},ip,{Dt(e){try{var t,r={};try{r=(t=ic.Ot(e)||void 0)?im(JSON.parse(t)):{}}catch(e){}var o,a=JSON.parse(ip.Ot(e)||"{}");if(i){var l=ix(e,t),u=[...i_,...l.properties],h={};Object.keys(r).forEach(e=>{var t=r[e];null===t||""===t||"$user_state"===e&&"anonymous"!==t&&"identified"!==t||(h[e]=t)});var c="distinct_id"in h||"anonymous"===h.$user_state||"identified"===h.$user_state;if(Object.keys(h).length>0){var d,p=a[tw],g=null!=(d=a.$user_state)?d:"anonymous";n.forEach(e=>{if(-1!==u.indexOf(e)&&!(e in r)&&(c||"distinct_id"!==e&&"$user_state"!==e)){var t=a[e];(l.isValid||-1===i_.indexOf(e)||!1!==t&&0!==t)&&delete a[e]}}),!c||"$user_state"in r||"$user_state"in a||(a[tD]=tW),c&&(("distinct_id"in h?h[tw]:a[tw])!==p||("$user_state"in h?h[tD]:a[tD])!==g)&&(ig.forEach(e=>delete a[e]),"identified"===h.$user_state&&"distinct_id"in h?a.$user_id=h[tw]:delete a.$user_id,"identified"!==h.$user_state&&(delete a[tT],delete a[tf]),delete a.__alias)}o=t3(a,h)}else o=t3(r,a);return s()||ip.$t(e,o),o}catch(e){}return null},$t(e,s,r,n,o,a){var l=ip.$t(e,s,void 0,void 0,a);try{var u=iy(s,t);if(Object.keys(u).length){if(i){var h=e+"_cpm",c=iw(u,t);if(ic.$t(h,c,r,n,o,a),ic.Ot(h)!==JSON.stringify(c)){ic.Pt(h,n);var d=iy(s);return ic.$t(e,d,r,n,o,a),l}}ic.$t(e,u,r,n,o,a)}}catch(e){ip.Lt(e)}return l},Pt(e,t){try{null==a||a.localStorage.removeItem(e),ic.Pt(e,t),ic.Pt(e+"_cpm",t)}catch(e){ip.Lt(e)}}})),u=!1,h=!1,c=e.persistence.toLowerCase();return"localstorage"===c&&ip.At()?(o=ip,h=!0):"localstorage+cookie"===c&&l.At()?(o=l,h=!0,u=!0):"sessionstorage"===c&&iP.At()?o=iP:"memory"===c?o=iS:"cookie"===c&&ic.At()?(o=ic,u=!0):l.At()?(o=l,h=!0,u=!0):ic.At()?(o=ic,u=!0):o=iS,this.Ko=h,this.Xo=u,o}pa(e){return this.ca+"__"+e}da(e){return this.Ko&&!!e.split_storage}properties(){var e={};return t2(this.props,(t,i)=>{var s=iN(i);if(!s||"event"===s.exposure){if(null!=s&&null!=s.shouldSkipFromEventProperties&&s.shouldSkipFromEventProperties(t))return;e[i]=t}}),e}load(e){if(void 0===e&&(e=!1),!this.hi||e){var t=this.Mr.cookieWinsOnConflict&&"localstorage+cookie"===this.Mr.persistence.toLowerCase(),i=t?ip.Dt(this.ca):null,s={};if(t)try{t2(s=im(ic.Dt(this.ca)),(e,t)=>{(F(e)||null===e||""===e)&&delete s[t]})}catch(e){}var r=this.qo.Dt(this.ca);if(r&&(this.props=t3({},r)),this.Yo&&this.Ba(),t&&r){var n,o,a=null==i?void 0:i[tw],l=null!=(n=null==i?void 0:i.$user_state)?n:"anonymous",u=r[tw],h=null!=(o=r.$user_state)?o:"anonymous";if(u!==a||h!==l){this.ta=!0,this.hi||iP.$t(this.ca+"_cookie_identity_change_pending",!0);var c=t3({},this.props);ig.forEach(e=>delete c[e]),"anonymous"!==h||"identified"!==l&&"anonymous"!==s.$user_state&&(F(a)||u===a)||(si(c,s),delete c[tf]),this.props=c;var d=new Set;ig.forEach(e=>{var t,i=null==(t=iN(e))?void 0:t.storageGroup;i&&d.add(i)}),d.forEach(e=>{if(!this.hi){var t={};t2(this.props,(i,s)=>{var r;(null==(r=iN(s))?void 0:r.storageGroup)===e&&(t[s]=i)}),A(t)?(ip.Pt(this.pa(e)),this.Jo[e]={}):ip.$t(this.pa(e),t)&&(this.Jo[e]={persisted:!0,fingerprint:this.Sa(t,e)})}})}}iP.Ot(this.ca+"_cookie_identity_change_pending")&&(this.ta=!0)}}Ba(){for(var e of iL){var t=ip.Dt(this.pa(e));if(t&&!A(t)){var i=this.ya(e);i.persisted=!0,this.za(e)||(i.fingerprint=this.Sa(t,e)),this.Ha(e,t)||t3(this.props,t)}}}za(e){return Object.keys(this.props).some(t=>{var i;return(null==(i=iN(t))?void 0:i.storageGroup)===e})}Ha(e,t){var i=i2[e];if(!i)return!1;var s=t[i],r=this.props[i];return L(s)&&L(r)&&r>s}refreshKey(e){var t;if(!this.hi&&!this.oa.has(e)){var i=this.Yo?null==(t=iN(e))?void 0:t.storageGroup:void 0,s=i?ip.Dt(this.pa(i)):this.qo.Dt(this.ca);if(s&&e in s)this.$a(e,s[e],!1);else{if(i){var r=this.qo.Dt(this.ca);if(r&&e in r)return void this.$a(e,r[e],!1)}this.Ca(e,!1)}}}save(){if(!this.hi){var e=this.Pa();e>0?F(this.Na)&&(this.Na=setTimeout(()=>{this.Na=void 0,this.qa()},e)):this.qa()}}flush(){F(this.Na)||(clearTimeout(this.Na),this.Na=void 0,this.qa())}qa(e){if(void 0===e&&(e=!1),!(this.hi||this.ea&&!e)){e||(this.syncCookieProperties(),this.Mr.cookieWinsOnConflict&&"localstorage+cookie"===this.Mr.persistence.toLowerCase()||i7.forEach(e=>this.refreshKey(e)));var t=!e&&!this.na;t||(this.ra=!1);var i=!!t&&this.Ta();if(this.ra)this.Mr.debug&&ti.warn("skipping persistence write because storage belongs to a different distinct ID");else{if(this.Yo)return this.Ua(),void(i&&this.aa.forEach(e=>e()));var s=this.Wa(this.qo,this.ca,this.props,i8);"written"===s&&this.Ra(this.props),"failed"!==s&&(this.ia.clear(),this.sa=!1,this.oa.clear()),i&&this.aa.forEach(e=>e())}}}Ua(){var e=this,t=this.wa(),i=t.main,s=t.groups,r=this.Wa(this.qo,this.ca,i,i8);"written"===r&&this.Ra(i),"failed"!==r&&(this.sa=!1,this.oa.clear(),i6.forEach(e=>{var t;null!=(t=iN(e))&&t.storageGroup||this.ia.delete(e)}));var n=function(t){var i,r=s[t];if(A(r)&&(null==(i=e.Jo[t])||!i.persisted))return i6.forEach(i=>{var s;(null==(s=iN(i))?void 0:s.storageGroup)===t&&e.ia.delete(i)}),1;var n=e.Wa(ip,e.pa(t),r,t);"failed"!==n&&i6.forEach(i=>{var s=iN(i);(null==s?void 0:s.storageGroup)!==t||"written"!==n&&s.volatile||e.ia.delete(i)})};for(var o of iL)if(n(o))continue}wa(){var e={},t={flags:{},surveys:{}};return t2(this.props,(i,s)=>{var r,n=null==(r=iN(s))?void 0:r.storageGroup;n?t[n][s]=i:e[s]=i}),{main:e,groups:t}}Sa(e,t){if(t===i8)return JSON.stringify(e)+"|"+this.Va+"|"+this.Ga+"|"+this.Qa;var i={};return t2(e,(e,t)=>{var s;i[t]=null!=(s=iN(t))&&s.volatile?"__volatile__":e}),JSON.stringify(i)}Wa(e,t,i,s){var r,n=this.ya(s);if(s!==i8&&!n.dirty&&!F(n.fingerprint))return"skipped";try{if((r=this.Sa(i,s))===n.fingerprint)return n.dirty=!1,"skipped"}catch(e){r=void 0}return e.$t(t,i,this.Va,this.Ga,this.Qa,this.Mr.debug)?(n.dirty=!1,s!==i8&&(n.persisted=!0),F(r)||(n.fingerprint=r),this.Ko&&(n.storageValue=ip.Ot(t)),"written"):(this.Mr.debug&&ti.warn('failed to persist storage entry "'+t+'"; will retry on next save'),"failed")}remove(e){var t=(void 0===e?{}:e).keepGroupEntries,i=void 0!==t&&t;if(this.Ma(),F(this.Na)||(clearTimeout(this.Na),this.Na=void 0),this.qo.Pt(this.ca,!1),this.qo.Pt(this.ca,!0),!i&&this.la)for(var s of iL)ip.Pt(this.pa(s));i?delete this.Jo[i8]:this.Jo={},this.Aa=void 0,this.Fa=void 0}clear(){this.remove(),this.props={}}register_once(e,t,i){if(C(e)){this.syncCookieProperties(),F(t)&&(t="None"),this.Va=F(i)?this.Za:i;var s=!1;if(t2(e,(e,i)=>{this.props.hasOwnProperty(i)&&this.props[i]!==t||(this.$a(i,e),s=!0)}),s)return this.save(),!0}return!1}register(e,t){if(C(e)){this.syncCookieProperties(),this.Va=F(t)?this.Za:t;var i=!1;if(t2(e,(t,s)=>{e.hasOwnProperty(s)&&(this.props[s]!==t||C(t)||I(t))&&(this.$a(s,t),i=!0)}),i)return this.save(),!0}return!1}unregister(e){this.syncCookieProperties();var t=!1;for(var i of"string"==typeof e?[e]:e)i in this.props&&(this.Ca(i),t=!0);t&&this.save()}update_campaign_params(){var e=null==h?void 0:h.URL;if(e!==this.ua){var t=function(e,t,i){if(!h)return{};var s,r=t?[...iU,...i||[]]:[],n=iK(iz(h.URL,r,iW),e);return t3((s={},t2(iJ,function(e){var t=t9(e);s[e]=t||null}),s),n)}(this.Mr.custom_campaign_params,this.Mr.mask_personal_data_properties,this.Mr.custom_personal_data_properties),i=!A(t8(t));return i&&this.register(t),this.ua=e,i?t:void 0}}update_search_keyword(){var e;this.register((e=null==h?void 0:h.referrer)?iY(e):{})}update_referrer_info(){var e;this.register_once({$referrer:iQ(),$referring_domain:null!=h&&h.referrer&&(null==(e=iG(h.referrer))?void 0:e.host)||iZ},void 0)}set_initial_person_info(){if(!this.props.$initial_campaign_params&&!this.props.$initial_referrer_info){var e=i0(this.Mr.mask_personal_data_properties,this.Mr.custom_personal_data_properties,this.Mr.disable_capture_url_hashes);this.register_once({[tj]:this.Xo?{r:i5(e.r),u:e.u?i5(e.u):void 0}:e},void 0)}}get_initial_props(){var e,t,i,s={};t2([tN,tq],e=>{var t=this.props[e];t&&t2(t,function(e,t){s["$initial_"+S(t)]=e})});var r=this.props[tj];return r&&t3(s,(void 0===(e=this.Mr.disable_capture_url_hashes)&&(e=!1),t=i1(r,e),i={},t2(t,function(e,t){i["$initial_"+S(t)]=e}),i)),s}safe_merge(e){return t2(this.props,function(t,i){i in e||(e[i]=t)}),e}update_config(e,t,i){var s=e.persistence!==t.persistence,n=!((e,t)=>{if(e.length!==t.length)return!1;var i=[...e].sort(),s=[...t].sort();return i.every((e,t)=>e===s[t])})(e.cookie_persisted_properties||[],t.cookie_persisted_properties||[]),o=s||n,a=e.cookieWinsOnConflict!==t.cookieWinsOnConflict,l=e.disable_persistence||!!i,u=!!this.hi&&!l;l||this.Oa(t,u),this.Mr=e,!l&&(s||n||a)&&(this.Aa=void 0,this.Fa=void 0,this.Oa(r({},e,{cookie_persisted_properties:t.cookie_persisted_properties}),u));var h=o||a?this.ha(e):this.qo;this.Ja();var c=this.da(e),d=o||c!==this.Yo,p=!l&&(d||e.cross_subdomain_cookie!==this.Ga||e.secure_cookie!==this.Qa)&&this.Da(u);this.na=d;try{if(this.Za=this.Va=e.cookie_expiration,this.set_disabled(l),this.set_cross_subdomain(e.cross_subdomain_cookie),this.set_secure(e.secure_cookie),d){var g=this.props;this.clear(),this.qo=h,this.Yo=c,this.props=g,this.save()}else a&&(this.qo=h,l||(delete this.Jo[i8],this.qa()))}finally{this.na=!1,p&&this.ja()}}Ja(){var e=this.props[tj];if(this.Xo&&C(e)&&"string"==typeof e.r){var t=i5(e.r),i="string"==typeof e.u?i5(e.u):e.u;t===e.r&&i===e.u||this.$a(tj,r({},e,{r:t,u:i}))}}set_disabled(e){this.hi=e,this.hi?this.remove():this.save()}set_cross_subdomain(e){e!==this.Ga&&(this.Ga=e,this.remove({keepGroupEntries:!0}),this.save())}set_secure(e){e!==this.Qa&&(this.Qa=e,this.remove({keepGroupEntries:!0}),this.save())}set_event_timer(e,t){var i=this.props.__timers||{};i[e]=t,this.$a(tI,i),this.save()}remove_event_timer(e){var t=this.props.__timers||{},i=t[e];return F(i)||(delete t[e],this.$a(tI,t),this.save()),i}get_property(e){return this.props[e]}set_property(e,t){this.$a(e,t),this.save()}$a(e,t,i){void 0===i&&(i=!0);var s,r=this.props[e];this.props[e]=t,i&&("distinct_id"!==e&&"$user_state"!==e||r===t||(this.sa=!0),i9(e)&&!se(r,t)&&this.oa.add(e),this.Ea(e,r,t),null!=(s=iN(e))&&s.volatile||this.Ia(e))}Ca(e,t){void 0===t&&(t=!0),delete this.props[e],t&&(i4(e)&&this.ma(e,!0),i9(e)&&this.oa.add(e),this.Ia(e))}Ia(e){var t,i=null==(t=iN(e))?void 0:t.storageGroup;i&&(this.ya(i).dirty=!0)}ya(e){return this.Jo[e]||(this.Jo[e]={})}},sr="gzip-js",sn="base64",so="survey sent";function sa(e){var t=!0;return{dispose(){if(t){t=!1;var i=e();i&&M(i.then)&&i.then(void 0,()=>{})}}}}var sl=ts("[RateLimiter]"),su=class{constructor(e){this.serverLimits={},this.lastEventRateLimited=!1,this.checkForLimiting=e=>{var t=e.text;if(t&&t.length)try{(JSON.parse(t).quota_limited||[]).forEach(e=>{sl.info((e||"events")+" is quota limited."),this.serverLimits[e]=(new Date).getTime()+6e4})}catch(e){return void sl.warn('could not rate limit - continuing. Error: "'+(null==e?void 0:e.message)+'"',{text:t})}},this.instance=e,this.lastEventRateLimited=this.clientRateLimitContext(!0).isRateLimited}get captureEventsPerSecond(){var e;return(null==(e=this.instance.config.rate_limiting)?void 0:e.events_per_second)||10}get captureEventsBurstLimit(){var e;return Math.max((null==(e=this.instance.config.rate_limiting)?void 0:e.events_burst_limit)||10*this.captureEventsPerSecond,this.captureEventsPerSecond)}clientRateLimitContext(e){void 0===e&&(e=!1);var t,i,s,r=this.captureEventsBurstLimit,n=this.captureEventsPerSecond,o=(new Date).getTime(),a=null!=(t=null==(i=this.instance.persistence)?void 0:i.get_property("$capture_rate_limit"))?t:{tokens:r,last:o};a.tokens+=Math.max(0,o-a.last)/1e3*n,a.last=Math.max(a.last,o),a.tokens>r&&(a.tokens=r);var l=1>a.tokens;if(l||e||(a.tokens=Math.max(0,a.tokens-1)),l&&!e){var u=(L(a.dropped)?a.dropped:0)+1;a.dropped=u,!this.lastEventRateLimited&&this.Ka(u)&&(a.dropped=0)}return this.lastEventRateLimited=l,null==(s=this.instance.persistence)||s.set_property(tB,a),{isRateLimited:l,remainingTokens:a.tokens}}Xa(e){var t=this.instance.config.property_denylist;return!I(t)||!t.includes(e)}Ya(){var e;if(this.Xa("$current_url")&&this.Xa("$pathname")&&null!=c&&c.pathname)return""+(null!=(e=c.origin)?e:"")+c.pathname}Ka(e){var t,i,s=this.captureEventsBurstLimit,r=this.captureEventsPerSecond,n=this.Ya(),o=this.Xa("$session_id")?null==(t=(i=this.instance).get_session_id)?void 0:t.call(i):void 0,a=[e+" event(s) dropped since the last warning",n?"triggered on "+n:void 0,o?"session "+o:void 0].filter(Boolean).join(", ");return!!this.instance.capture("$$client_ingestion_warning",{$$client_ingestion_warning_message:"posthog-js client rate limited: "+a+". Config is set to "+r+" events per second and "+s+" events burst limit."},{skip_client_rate_limiting:!0})}isServerRateLimited(e){var t=this.serverLimits[e||"events"]||!1;return!1!==t&&(new Date).getTime()e(this.remoteConfig)):e()}el(e){this._instance._send_request({method:"GET",url:this._instance.requestRouter.endpointFor("assets","/array/"+this._instance.config.token+"/config"),callback:e})}load(){try{if(this.remoteConfig)return sh.info("Using preloaded remote config",this.remoteConfig),void this.il(this.remoteConfig);if(this._instance._shouldDisableFlags())return void sh.warn("Remote config is disabled. Falling back to local config.");this.tl(e=>{e?this.il(e):(sh.info("No config found after loading remote JS config. Falling back to JSON."),this.el(e=>{this.il(e.json,e)}))})}catch(e){sh.error("Error loading remote config",e),this.il()}}il(e,t){!e&&t&&(0===t.statusCode?t.error||sh.warn("Failed to fetch remote config from PostHog."):sh.error("Failed to fetch remote config from PostHog."));try{this._instance.il(e?{ok:!0,config:e}:{ok:!1})}catch(e){sh.error("Error applying remote config",e)}if(!1!==(null==e?void 0:e.hasFeatureFlags)&&!this._instance.config.advanced_disable_feature_flags_on_first_load)try{var i;null==(i=this._instance.featureFlags)||i.ensureFlagsLoaded()}catch(e){sh.error("Error loading feature flags",e)}}},sd=Uint8Array,sp=Uint16Array,sg=Uint32Array,s_=new sd([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]),sf=new sd([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]),sv=new sd([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),sm=function(e,t){for(var i=new sp(31),s=0;31>s;++s)i[s]=t+=1<s;++s)for(var n=i[s];i[s+1]>n;++n)r[n]=n-i[s]<<5|s;return[i,r]},sy=sm(s_,2),sb=sy[1];sy[0][28]=258,sb[258]=28;for(var sw=sm(sf,0)[1],sx=new sp(32768),s$=0;32768>s$;++s$){var sk=(43690&s$)>>>1|(21845&s$)<<1;sx[s$]=((65280&(sk=(61680&(sk=(52428&sk)>>>2|(13107&sk)<<2))>>>4|(3855&sk)<<4))>>>8|(255&sk)<<8)>>>1}var sS=function(e,t,i){for(var s=e.length,r=0,n=new sp(t);s>r;++r)++n[e[r]-1];var o,a=new sp(t);for(r=0;t>r;++r)a[r]=a[r-1]+n[r-1]<<1;if(i){o=new sp(1<r;++r)if(e[r])for(var u=r<<4|e[r],h=t-e[r],c=a[e[r]-1]++<=c;++c)o[sx[c]>>>l]=u}else for(o=new sp(s),r=0;s>r;++r)o[r]=sx[a[e[r]-1]++]>>>15-e[r];return o},sE=new sd(288);for(s$=0;144>s$;++s$)sE[s$]=8;for(s$=144;256>s$;++s$)sE[s$]=9;for(s$=256;280>s$;++s$)sE[s$]=7;for(s$=280;288>s$;++s$)sE[s$]=8;var sP=new sd(32);for(s$=0;32>s$;++s$)sP[s$]=5;var sO=sS(sE,9,0),sI=sS(sP,5,0),sM=function(e){return(e/8|0)+(7&e&&1)},sC=function(e,t,i){(null==t||0>t)&&(t=0),(null==i||i>e.length)&&(i=e.length);var s=new(e instanceof sp?sp:e instanceof sg?sg:sd)(i-t);return s.set(e.subarray(t,i)),s},sA=function(e,t,i){var s=t/8|0;e[s]|=i<<=7&t,e[s+1]|=i>>>8},sF=function(e,t,i){var s=t/8|0;e[s]|=i<<=7&t,e[s+1]|=i>>>8,e[s+2]|=i>>>16},sT=function(e,t){for(var i=[],s=0;e.length>s;++s)e[s]&&i.push({s:s,f:e[s]});var r=i.length,n=i.slice();if(!r)return[new sd(0),0];if(1==r){var o=new sd(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],u=0,h=1,c=2;for(i[0]={s:-1,f:a.f+l.f,l:a,r:l};h!=r-1;)a=i[i[c].f>i[u].f?u++:c++],l=i[u!=h&&i[c].f>i[u].f?u++:c++],i[h++]={s:-1,f:a.f+l.f,l:a,r:l};var d=n[0].s;for(s=1;r>s;++s)n[s].s>d&&(d=n[s].s);var p=new sp(d+1),g=sR(i[h-1],p,0);if(g>t){s=0;var _=0,f=g-t,v=1<s;++s){var m=n[s].s;if(t>=p[m])break;_+=v-(1<>>=f;_>0;){var y=n[s].s;t>p[y]?_-=1<=0&&_;--s){var b=n[s].s;p[b]==t&&(--p[b],++_)}g=t}return[new sd(p),g]},sR=function(e,t,i){return -1==e.s?Math.max(sR(e.l,t,i+1),sR(e.r,t,i+1)):t[e.s]=i},sD=function(e){for(var t=e.length;t&&!e[--t];);for(var i=new sp(++t),s=0,r=e[0],n=1,o=function(e){i[s++]=e},a=1;t>=a;++a)if(e[a]==r&&a!=t)++n;else{if(!r&&n>2){for(;n>138;n-=138)o(32754);n>2&&(o(n>10?n-11<<5|28690:n-3<<5|12305),n=0)}else if(n>3){for(o(r),--n;n>6;n-=6)o(8304);n>2&&(o(n-3<<5|8208),n=0)}for(;n--;)o(r);n=1,r=e[a]}return[i.subarray(0,s),t]},sL=function(e,t){for(var i=0,s=0;t.length>s;++s)i+=e[s]*t[s];return i},sB=function(e,t,i){var s=i.length,r=sM(t+2);e[r]=255&s,e[r+1]=s>>>8,e[r+2]=255^e[r],e[r+3]=255^e[r+1];for(var n=0;s>n;++n)e[r+n+4]=i[n];return 8*(r+4+s)},sq=function(e,t,i,s,r,n,o,a,l,u,h){sA(t,h++,i),++r[256];for(var c=sT(r,15),d=c[0],p=c[1],g=sT(n,15),_=g[0],f=g[1],v=sD(d),m=v[0],y=v[1],b=sD(_),w=b[0],x=b[1],$=new sp(19),k=0;m.length>k;++k)$[31&m[k]]++;for(k=0;w.length>k;++k)$[31&w[k]]++;for(var S=sT($,7),E=S[0],P=S[1],O=19;O>4&&!E[sv[O-1]];--O);var I,M,C,A,F=u+5<<3,T=sL(r,sE)+sL(n,sP)+o,R=sL(r,d)+sL(n,_)+o+14+3*O+sL($,E)+(2*$[16]+3*$[17]+7*$[18]);if(T>=F&&R>=F)return sB(t,h,e.subarray(l,l+u));if(sA(t,h,1+(T>R)),h+=2,T>R){I=sS(d,p,0),M=d,C=sS(_,f,0),A=_;var D=sS(E,P,0);for(sA(t,h,y-257),sA(t,h+5,x-1),sA(t,h+10,O-4),h+=14,k=0;O>k;++k)sA(t,h+3*k,E[sv[k]]);h+=3*O;for(var L=[m,w],B=0;2>B;++B){var q=L[B];for(k=0;q.length>k;++k)sA(t,h,D[N=31&q[k]]),h+=E[N],N>15&&(sA(t,h,q[k]>>>5&127),h+=q[k]>>>12)}}else I=sO,M=sE,C=sI,A=sP;for(k=0;a>k;++k)if(s[k]>255){sF(t,h,I[257+(N=s[k]>>>18&31)]),h+=M[N+257],N>7&&(sA(t,h,s[k]>>>23&31),h+=s_[N]);var N,j=31&s[k];sF(t,h,C[j]),h+=A[j],j>3&&(sF(t,h,s[k]>>>5&8191),h+=sf[j])}else sF(t,h,I[s[k]]),h+=M[s[k]];return sF(t,h,I[256]),h+M[256]},sN=new sg([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),sj=new sd(0),sG=function(){for(var e=new sg(256),t=0;256>t;++t){for(var i=t,s=9;--s;)i=(1&i&&0xedb88320)^i>>>1;e[t]=i}return e}(),sH=function(e,t,i){for(;i;++t)e[t]=i,i>>>=8},sz=!!p||!!d,sU=new WeakMap,sV="text/plain",sW=0,sJ=!1,sK=(e,t)=>{var i=e.split("#"),s=i[1],r=i[0].split("?"),n=r[0],o=r[1];if(!o)return e;var a=o.split("&").filter(e=>e.split("=")[0]!==t).join("&");return n+(a?"?"+a:"")+(s?"#"+s:"")},sY=function(e,t,i){void 0===i&&(i=!0);var s,n,o,a,l,u=e.split("?"),h=u[0],c=u[1],d=r({},t),p=null!=(l=null==c?void 0:c.split("&").map(e=>{var t,s=e.split("="),r=s[0],n=i&&null!=(t=d[r])?t:s[1];return delete d[r],r+"="+n}))?l:[],g=(void 0===s&&(s="&"),a=[],t2(d,function(e,t){F(e)||F(t)||"undefined"===t||(n=encodeURIComponent(e instanceof File?e.name:e.toString()),o=encodeURIComponent(t),a[a.length]=o+"="+n)}),a.join(s));return g&&p.push(g),p.length>0?h+"?"+p.join("&"):h},sX=e=>{if(e.sl)return e.sl;var t=e.data,i=e.compression;if(t){if(i===sr){var s,r,n,o,a,l,u,h,c,d=(s=function(e){var t=e.length;if("u">typeof TextEncoder)return(new TextEncoder).encode(e);for(var i=new sd(e.length+(e.length>>>1)),s=0,r=function(e){i[s++]=e},n=0;t>n;++n){if(s+5>i.length){var o=new sd(s+8+(t-n<<1));o.set(i),i=o}var a=e.charCodeAt(n);128>a?r(a):(2048>a?r(192|a>>>6):(a>55295&&57344>a?(r(240|(a=65536+(1047552&a)|1023&e.charCodeAt(++n))>>>18),r(128|a>>>12&63)):r(224|a>>>12),r(128|a>>>6&63)),r(128|63&a))}return sC(i,0,s)}(ij(t)),r={mtime:0},n=0xffffffff,o={p(e){for(var t=n,i=0;e.length>i;++i)t=sG[255&t^e[i]]^t>>>8;n=t},d:()=>0xffffffff^n},a=s.length,o.p(s),c=(l=10+(r.filename&&r.filename.length+1||0),h=function(e,t,i,s,r){var n=e.length,o=new sd(s+n+5*(1+Math.floor(n/7e3))+8),a=o.subarray(s,o.length-8),l=0;if(!t||8>n)for(var u=0;n>=u;u+=65535){var h=u+65535;n>h?l=sB(a,l,e.subarray(u,h)):(a[u]=r,l=sB(a,l,e.subarray(u,n)))}else{for(var c=sN[t-1],d=c>>>13,p=8191&c,g=(1<u;++u){var O=y(u),I=32767&u,M=f[O];if(_[I]=M,f[O]=I,u>=E){var C=n-u;if(($>7e3||S>24576)&&C>423){l=sq(e,a,0,b,w,x,k,S,P,u-P,l),S=$=k=0,P=u;for(var A=0;286>A;++A)w[A]=0;for(A=0;30>A;++A)x[A]=0}var F=2,T=0,R=p,D=I-M&32767;if(C>2&&O==y(u-D))for(var L=Math.min(d,C)-1,B=Math.min(32767,u),q=Math.min(258,C);B>=D&&--R&&I!=M;){if(e[u+F]==e[u+F-D]){for(var N=0;q>N&&e[u+N]==e[u+N-D];++N);if(N>F){if(F=N,T=D,N>L)break;var j=Math.min(D,N-2),G=0;for(A=0;j>A;++A){var H=u-D+A+32768&32767,z=H-_[H]+32768&32767;z>G&&(G=z,M=H)}}}D+=(I=M)-(M=_[I])+32768&32767}if(T){b[S++]=0x10000000|sb[F]<<18|sw[T];var U=31&sb[F],V=31&sw[T];k+=s_[U]+sf[V],++w[257+U],++x[V],E=u+F,++$}else b[S++]=e[u],++w[e[u]]}}l=sq(e,a,r,b,w,x,k,S,P,u-P,l),r||(l=sB(a,l,sj))}return sC(o,0,s+sM(l)+8)}(s,null==r.level?6:r.level,null==r.mem?Math.ceil(1.5*Math.max(8,Math.min(13,Math.log(s.length)))):12+r.mem,l,!u)).length,function(e,t){var i=t.filename;if(e[0]=31,e[1]=139,e[2]=8,e[8]=2>t.level?4:2*(9==t.level),e[9]=3,0!=t.mtime&&sH(e,4,Math.floor(new Date(t.mtime||Date.now())/1e3)),i){e[3]=8;for(var s=0;i.length>=s;++s)e[s+10]=i.charCodeAt(s)}}(h,r),sH(h,c-8,o.d()),sH(h,c-4,a),h);return{contentType:sV,body:d.buffer.slice(d.byteOffset,d.byteOffset+d.byteLength),estimatedSize:d.byteLength}}if(i===sn){let e;var p,g="data="+encodeURIComponent("string"==typeof(e=(p=ij(t))?btoa(encodeURIComponent(p).replace(/%([0-9A-F]{2})/g,(e,t)=>String.fromCharCode(parseInt(t,16)))):p)?e:ij(e));return{contentType:"application/x-www-form-urlencoded",body:g,estimatedSize:new Blob([g]).size}}var _=ij(t);return{contentType:"application/json",body:_,estimatedSize:new Blob([_]).size}}},sZ=e=>{var t,i,s=()=>"sendBeacon"===e.transport?{url:sY(e.url,{compression:sn}),encodedBody:sX(r({},e,{compression:sn,sl:void 0}))}:{url:sK(e.url,"compression"),encodedBody:sX(r({},e,{compression:void 0,sl:void 0}))};try{t=sX(e)}catch(t){if(e6(e.compression,iH(e.url,"compression")))return ti.error("Failed to gzip request body, sending uncompressed payload",t),s();throw t}return!(t&&e6(e.compression,iH(e.url,"compression")))||((i=t.body)instanceof ArrayBuffer?e8(new Uint8Array(i)):ArrayBuffer.isView(i)&&e8(new Uint8Array(i.buffer,i.byteOffset,i.byteLength)))?{url:e.url,encodedBody:t}:(sJ=!0,s())},sQ=e=>{try{return sZ(e)}catch(t){return ti.error(t),void(null==e.callback||e.callback({statusCode:0,error:t}))}},s0=(rc=o(function*(e){var t=yield function(e,t,i){return te.apply(this,arguments)}(ij(e.data),b.DEBUG,{rethrow:!0});if(!t)return e;var i=yield t.arrayBuffer();return r({},e,{sl:{contentType:sV,body:i,estimatedSize:i.byteLength}})}),function(e){return rc.apply(this,arguments)}),s1=/Failed to fetch|NetworkError|Load failed/i,s2=e=>"TypeError"===(null==e?void 0:e.name)&&s1.test((null==e?void 0:e.message)||""),s3=e=>{try{var t=function(e,t){if(void 0===t&&(t=Date.now()),"string"==typeof e&&e){var i=e.trim(),s=/^\d+\s*,/.test(i)?i.slice(0,i.indexOf(",")).trim():i;if(/^\d+$/.test(s)){var r=1e3*Math.min(Number(s),300);return r>0?r:void 0}if(/^(Mon|Tue|Wed|Thu|Fri|Sat|Sun)[a-z]*[ ,]/.test(s)){var n=Date.parse(/^\w{3} \w{3} /.test(s)?s+" GMT":s)-t;if(Number.isFinite(n)&&n>0)return Math.min(n,3e5)}}}(e());return F(t)?void 0:Math.min(t,3e4)}catch(e){return}},s5=e=>{var t=sQ(e);if(t){var i=new p;sU.set(i,!0);var s=t.encodedBody;i.open(e.method||"GET",t.url,!0);var r=null!=s?s:{},n=r.contentType,o=r.body;t2(e.headers,function(e,t){i.setRequestHeader(t,e)}),n&&i.setRequestHeader("Content-Type",n),e.timeout&&(i.timeout=e.timeout),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,s3(()=>i.getResponseHeader("Retry-After")))}},i.send(o)}},s8=e=>{var t=sQ(e);if(t){var i=t.url,s=t.encodedBody,n=null!=s?s:{},o=n.contentType,a=n.body,l=n.estimatedSize,u=new Headers;t2(e.headers,function(e,t){u.append(t,e)}),o&&u.append("Content-Type",o);var h=null,c=!1;if(g){var p=new g;h={signal:p.signal,timeout:setTimeout(()=>{var t;c=!0;try{p.abort(eZ("AbortError","PostHog request timed out"+((t=e.timeout)?" after "+t+"ms":"")))}catch(e){f(e)}},e.timeout)}}var _=!1,f=t=>{_||(_=!0,c&&"AbortError"===(null==t?void 0:t.name)||s2(t)?ti.warn(t):ti.error(t),null==e.callback||e.callback({statusCode:0,error:t}))},v=0,m=()=>{sW-=v,v=0,h&&clearTimeout(h.timeout)};try{var y,b=r({method:(null==e?void 0:e.method)||"GET",headers:u,referrerPolicy:"strict-origin",body:a,signal:null==(y=h)?void 0:y.signal},e.fetchOptions),w=null!=l?l:F(a)?0:void 0;b.keepalive="POST"===b.method&&!e.rl&&!1!==b.keepalive&&b.body===a&&!F(w)&&w>=0&&52428.8>sW+w,b.keepalive&&(sW+=v=w),d(i,b).then(t=>t.text().then(i=>{if(!_){var s={statusCode:t.status,text:i};if(200===t.status)try{s.json=JSON.parse(i)}catch(e){ti.error(e)}_=!0,m(),null==e.callback||e.callback(s,s3(()=>t.headers.get("Retry-After")))}})).catch(e=>{m(),f(e)}).finally(m)}catch(e){m(),f(e)}}},s6=e=>{try{var t,i=sZ(e),s=i.url,n=i.encodedBody,o=null!=n?n:{},a=o.body,l=o.estimatedSize;if(!a)return;var h=a instanceof Blob?a:new Blob([a],{type:o.contentType});if(u.sendBeacon(s,h))return;var c=I(e.data)?e.data:null==(t=e.data)?void 0:t.batch;if(I(c)&&c.length>1&&(null!=l?l:0)>16384){var p=Math.ceil(c.length/2),g=t=>I(e.data)?t:r({},e.data,{batch:t});return s6(r({},e,{data:g(c.slice(0,p))})),void s6(r({},e,{data:g(c.slice(p))}))}ti.warn("Beacon of ~"+(null!=l?l:0)+" bytes was rejected by the browser, falling back to "+(d?"fetch":"XHR")),d?s8(r({},e,{rl:!0})):s5(e)}catch(e){ti.warn("Beacon send failed",e)}},s4=(e,t,i,s)=>{var n="query"===s?"POST"===t?"sent_at":"_":void 0;return sY(i===sr?sK(e,"compression"):e,r({},n?{[n]:Date.now().toString()}:{},i===sr?{}:{compression:i}))},s7=(rd=[],d&&rd.push({transport:"fetch",method:s8}),p&&rd.push({transport:"XHR",method:s5}),null!=u&&u.sendBeacon&&rd.push({transport:"sendBeacon",method:s6}),rd),s9=!sz&&-1===(null==f?void 0:f.indexOf("MSIE"))&&-1===(null==f?void 0:f.indexOf("Mozilla"));function re(e,t,i){var s;i&&(t=r({},t,{callback:e=>i(e)})),e.__loaded?s9?e.__request_queue.push(t):e.rateLimiter.isServerRateLimited(t.batchKey)?t.fireCallbackOnDrop&&(null==t.callback||t.callback({statusCode:429})):(t.transport=t.transport||e.config.api_transport,t.headers=r({},e.config.request_headers,t.headers),t.compression="best-available"===t.compression?null!=(s=e.compression)?s:t.compressionFallback:t.compression,(F(e.config.disable_beacon)?e.config.__preview_disable_beacon:e.config.disable_beacon)&&(t.disableTransport=["sendBeacon"]),t.fetchOptions=t.fetchOptions||e.config.fetch_options,((e,t)=>{var i,s,n,o,a,l=r({},e,{callback:null!=t?t:t=>null==e.callback?void 0:e.callback(t)});l.timeout=l.timeout||6e4;var u,h,c,d,p,g=null!=(n=l.transport)?n:"fetch";"sendBeacon"===g&&F(l.compression)&&l.data&&(l.compression=sn),"POST"===l.method&&l.data&&("capture-body"===l.timestampMode?l.data={api_key:null!=(h=null==(p=(d=(I(u=l.data)?u:[u]).map(e=>r({},e,e.timestamp instanceof Date&&!isNaN(e.timestamp.getTime())?{timestamp:e.timestamp.toISOString()}:{})))[0])||null==(c=p.properties)?void 0:c.token)?h:null==p?void 0:p.token,batch:d,sent_at:(new Date).toISOString()}:"body"===l.timestampMode&&(i=l.data,void 0===s&&(s=(new Date).toISOString()),l.data=I(i)?i.map(e=>r({},e,{sent_at:s})):r({},i,{sent_at:s}))),l.url=s4(l.url,l.method,l.compression,l.timestampMode);var f=s7.filter(e=>!l.disableTransport||!e.transport||!l.disableTransport.includes(e.transport)),v=null!=(o=null==(a=function(e,t){for(var i=0;e.length>i;i++)if(t(e[i]))return e[i]}(f,e=>e.transport===g))?void 0:a.method)?o:f[0].method;if(!v)throw Error("No available transport method");var m=e=>{try{v(e)}catch(e){s2(e)?ti.warn(e):ti.error(e),null==l.callback||l.callback({statusCode:0,error:e})}};"sendBeacon"!==g&&!l.preferSyncCompression&&l.data&&l.compression===sr&&_&&"u">typeof Promise&&!sJ?s0(l).then(e=>{m(e)}).catch(t=>{e4(t)?(sJ=!0,m(r({},l,{compression:void 0,url:s4(e.url,e.method,void 0,e.timestampMode)}))):((e=>{if(!e||"object"!=typeof e)return!1;var t="name"in e?String(e.name):"";return e4(e)||t===e5})(t)&&(sJ=!0),m(l))}):m(l)})(t,(s,r)=>{e.rateLimiter.checkForLimiting(s),400>s.statusCode||null==e.config.on_request_error||e.config.on_request_error(s),i?i(s,r):null==t.callback||t.callback(s)})):t.fireCallbackOnDrop&&(null==t.callback||t.callback({statusCode:0}))}var rt=class{constructor(e,t){this.ol=!0,this.al=[],this.ll=J((null==t?void 0:t.flush_interval_ms)||3e3,250,5e3,ti.createLogger("flush interval"),3e3),this.ul=e}enqueue(e){this.al.push(e),this.cl||this.hl()}unload(){this.dl();var e=Object.values(this.al.length>0?this.vl():{});[...e.filter(e=>0===e.url.indexOf("/e")),...e.filter(e=>0!==e.url.indexOf("/e"))].map(e=>{this.fl(r({},e,{callback:void 0}),"sendBeacon")})}enable(){this.ol=!1,this.hl()}hl(){this.ol||(this.cl=setTimeout(()=>{this.dl(),this.pl()},this.ll))}pl(){if(this.al.length>0){var e=this.vl();for(var t in e)this.fl(e[t])}}fl(e,t){try{this.ul(e,t)}catch(e){ti.error(e)}}dl(){clearTimeout(this.cl),this.cl=void 0}vl(){var e={},t={};for(var i in t2(this.al,i=>{var s,n=((i?i.batchKey:null)||i.url)+(i.batchGroup?":"+i.batchGroup:"");F(e[n])&&(e[n]=r({},i,{data:[],callback:void 0,fireCallbackOnDrop:void 0}),t[n]=[]),null==(s=e[n].data)||s.push(i.data),i.callback&&t[n].push(i.callback)}),t)!function(){var s=t[i];s.length&&(e[i].callback=e=>{for(var t of s)t(e)})}();return this.al=[],e}},ri=class{constructor(e){this._instance=e,this.gl=!1,this.ml=3e3,this.al=[],this.al=[],this.yl=!0,this.resume()}resume(){!F(a)&&"onLine"in a.navigator&&(this.yl=a.navigator.onLine,this.bl||(this.bl=()=>{this.yl=!0,this.pl()},this._l=()=>{this.yl=!1},t7(a,"online",this.bl),t7(a,"offline",this._l)))}get length(){return this.al.length}retriableRequest(e,t){var i=e.retriesPerformedSoFar,n=function(e,t){if(null==e)return{};var i={};for(var s in e)if(({}).hasOwnProperty.call(e,s)){if(-1!==t.indexOf(s))continue;i[s]=e[s]}return i}(e,s);B(i)&&(n.url=sY(n.url,{retry_count:i})),re(this._instance,t?r({},n,{transport:t}):n,(e,t)=>{if(200!==e.statusCode&&(400>e.statusCode||e.statusCode>=500)){if((0===e.statusCode?3:10)>(null!=i?i:0))return void this.Ls(r({retriesPerformedSoFar:i},n),t);0===e.statusCode&&ti.warn("Request failed before receiving an HTTP response; this can happen due to network issues, CORS, browser blocking, or ad blockers. Stopped retrying after "+(null!=i?i:0)+" retries.")}null==n.callback||n.callback(e)})}Ls(e,t){var i,s,r,n=e.retriesPerformedSoFar||0;e.retriesPerformedSoFar=n+1;var o=Math.max((r=(Math.random()-.5)*((s=Math.min(18e5,i=3e3*Math.pow(2,n)))-i/2),Math.ceil(s+r)),null!=t?t:0),a=Date.now()+o;this.al.push({retryAt:a,requestOptions:e});var l="Enqueued failed request for retry in "+o;navigator.onLine||(l+=" (Browser is offline)"),ti.warn(l),this.gl||(this.gl=!0,this.wl())}wl(){(this.kl&&clearTimeout(this.kl),0===this.al.length)?(this.gl=!1,this.kl=void 0):this.kl=setTimeout(()=>{this.yl&&this.al.length>0&&this.pl(),this.wl()},this.ml)}pl(){var e=Date.now(),t=[],i=this.al.filter(i=>e>i.retryAt||(t.push(i),!1));if(this.al=t,i.length>0)for(var s of i)this.retriableRequest(s.requestOptions)}unload(){for(var e of(this.kl&&(clearTimeout(this.kl),this.kl=void 0),this.gl=!1,F(a)||(this.bl&&(a.removeEventListener("online",this.bl),this.bl=void 0),this._l&&(a.removeEventListener("offline",this._l),this._l=void 0)),this.al)){var t=e.requestOptions;try{this._instance._send_request(r({},t,{callback:I(t.data)?void 0:t.callback,transport:"sendBeacon"}))}catch(e){ti.error(e)}}this.al=[]}},rs=class{constructor(e){this._instance=e,this.Sl=()=>{this.xl||(this.xl={});var e,t,i,s,r=this.scrollElement(),n=this.scrollY(),o=r?Math.max(0,r.scrollHeight-r.clientHeight):0,a=n+((null==r?void 0:r.clientHeight)||0),l=(null==r?void 0:r.scrollHeight)||0;this.xl.lastScrollY=Math.ceil(n),this.xl.maxScrollY=Math.max(n,null!=(e=this.xl.maxScrollY)?e:0),this.xl.maxScrollHeight=Math.max(o,null!=(t=this.xl.maxScrollHeight)?t:0),this.xl.lastContentY=a,this.xl.maxContentY=Math.max(a,null!=(i=this.xl.maxContentY)?i:0),this.xl.maxContentHeight=Math.max(l,null!=(s=this.xl.maxContentHeight)?s:0)}}get $l(){return this._instance.config.scroll_root_selector}getContext(){return this.xl}resetContext(){var e=this.xl;return this.xl=void 0,setTimeout(this.Sl,0),e}startMeasuringScrollPosition(){t7(a,"scroll",this.Sl,{capture:!0}),t7(a,"scrollend",this.Sl,{capture:!0}),t7(a,"resize",this.Sl)}scrollElement(){var e;if(!this.$l)return null==a||null==(e=a.document)?void 0:e.documentElement;for(var t of I(this.$l)?this.$l:[this.$l]){var i,s=null==a||null==(i=a.document)?void 0:i.querySelector(t);if(s)return s}}Cl(e){var t,i;if(this.$l){var s=this.scrollElement();return s&&s["y"===e?"scrollTop":"scrollLeft"]||0}return a?"y"===e?a.scrollY||a.pageYOffset||(null==(t=a.document)||null==(t=t.documentElement)?void 0:t.scrollTop)||0:a.scrollX||a.pageXOffset||(null==(i=a.document)||null==(i=i.documentElement)?void 0:i.scrollLeft)||0:0}scrollY(){return this.Cl("y")}scrollX(){return this.Cl("x")}},rr=e=>i0(null==e?void 0:e.config.mask_personal_data_properties,null==e?void 0:e.config.custom_personal_data_properties,null==e?void 0:e.config.disable_capture_url_hashes),rn=class{constructor(e,t,i,s){this.qe=e=>{var t=this.Tl();if(!t||t.sessionId!==e){var i={sessionId:e,props:this.Il(this._instance)};this.Ml.register({[tL]:i})}},this._instance=e,this.El=t,this.Ml=i,this.Il=s||rr,this.El.onSessionId(this.qe)}Tl(){return this.Ml.props[tL]}getSetOnceProps(){var e,t=null==(e=this.Tl())?void 0:e.props;return t?"r"in t?i1(t,this._instance.config.disable_capture_url_hashes):{$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 t2(t8(this.getSetOnceProps()),(t,i)=>{"$current_url"===i&&(i="url"),e["$session_entry_"+S(i)]=t}),e}},ro=class{on(e,t){return this.Pl[e]||(this.Pl[e]=[]),this.Pl[e].push(t),()=>{this.Pl[e]=this.Pl[e].filter(e=>e!==t)}}emit(e,t){for(var i of this.Pl[e]||[])i(t);for(var s of this.Pl["*"]||[])s(e,t)}constructor(){this.Pl={}}},ra=ts("[SessionId]"),rl=class{on(e,t){return this.Rl.on(e,t)}constructor(e,t,i){if(this.Al=null,this.Fl=null,this.Ol=[],this.Dl=void 0,this.Ll=!1,this.Rl=new ro,this.Nl=(e,t)=>!(!B(e)||!B(t))&&Math.abs(e-t)>this.sessionTimeoutMs,!e.persistence)throw Error("SessionIdManager requires a PostHogPersistence instance");if("always"===e.config.cookieless_mode)throw Error('SessionIdManager cannot be used with cookieless_mode="always"');this.Mr=e.config,this.Ml=e.persistence,this.je=void 0,this.Xt=void 0,this._sessionStartTimestamp=null,this.ql=void 0,this._sessionActivityTimestamp=null,this.jl=t||io,this.Bl=i||io;var s,r=this.Mr.persistence_name||this.Mr.token;if(this._sessionTimeoutMs=1e3*J(this.Mr.session_idle_timeout_seconds||1800,60,36e3,ra.createLogger("session_idle_timeout_seconds"),1800),e.register({$configured_session_timeout_ms:this._sessionTimeoutMs}),this.zl(),this.Hl="ph_"+r+"_window_id",this.Ul="ph_"+r+"_primary_window_exists",this.Wl()){var n=iP.Dt(this.Hl),o=iP.Dt(this.Ul);n&&!o?this.je=n:iP.Pt(this.Hl),iP.$t(this.Ul,!0)}null!=(s=this.Mr.bootstrap)&&s.sessionID&&this.setBootstrapSessionId(this.Mr.bootstrap.sessionID),this.Vl()}get sessionTimeoutMs(){return this._sessionTimeoutMs}onSessionId(e){return F(this.Ol)&&(this.Ol=[]),this.Ol.push(e),this.Xt&&e(this.Xt,this.je),()=>{this.Ol=this.Ol.filter(t=>t!==e)}}Wl(){return"memory"!==this.Mr.persistence&&!this.Ml.hi&&iP.At()}Gl(e){e!==this.je&&(this.je=e,this.Wl()&&iP.$t(this.Hl,e))}Ql(){return this.je?this.je:this.Wl()?iP.Dt(this.Hl):null}Zl(e){var t=this.Al;return null!==t&&null!==e&&5e3>Math.abs(e-t)}Jl(e,t,i){var s=t!==this._sessionActivityTimestamp,r=e===this.Xt&&i===this._sessionStartTimestamp;this._sessionStartTimestamp=i,this._sessionActivityTimestamp=t,this.Xt=e,r&&!s||r&&this.Zl(t)||(this.Al=t,this.Ml.register({[tA]:[t,e,i]}))}Kl(){var e,t=null==(e=this.Mr)?void 0:e.persistence_save_debounce_ms;return B(t)&&t>0}Xl(){this.Kl()?this.Ml.refreshKey(tA):(this.Ml.flush(),this.Ml.load())}Yl(){var e;if(null!==this._sessionActivityTimestamp&&this._sessionActivityTimestamp!==this.Al){this.Xl();var t=this.tu();t[1]===this.Xt&&t[2]===this._sessionStartTimestamp&&(this.Al=this._sessionActivityTimestamp,this.Ml.register({[tA]:[this._sessionActivityTimestamp,null!=(e=this.Xt)?e:null,this._sessionStartTimestamp]}),this.Ml.flush())}}eu(){var e=this.tu()[0];return Math.max(B(e)?e:0,B(this._sessionActivityTimestamp)?this._sessionActivityTimestamp:0)}iu(e){return this.Xl(),this.Nl(e,this.eu())}tu(){var e=this.Ml.props[tA];return I(e)&&2===e.length&&e.push(e[0]),e||[0,null,0]}resetSessionId(){this.Al=null,this.ql=void 0,clearTimeout(this.nu),this.nu=void 0,this.Jl(null,null,null)}setBootstrapSessionId(e,t){void 0===t&&(t=!1);var i=function(e,t){void 0===t&&(t=(new Date).getTime());try{var i=(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)})(e);return i>t+6e4?void ra.error("Bootstrap sessionID cannot be in the future"):i}catch(e){return void ra.error("Invalid sessionID in bootstrap",e)}}(e);return!F(i)&&(t?this.ql={sessionId:e,sessionStartTimestamp:i}:this.Jl(e,(new Date).getTime(),i),!0)}destroy(){this.Ll=!0,this.Yl(),clearTimeout(this.nu),this.nu=void 0,this.Dl&&a&&(a.removeEventListener(tY,this.Dl,{capture:!1}),this.Dl=void 0),this.Ol=[]}Vl(){this.Dl=()=>{this.Yl(),this.Wl()&&iP.Pt(this.Ul)},t7(a,tY,this.Dl,{capture:!1})}checkAndGetSessionAndWindowId(e,t,i){if(void 0===e&&(e=!1),void 0===t&&(t=null),void 0===i&&(i=!1),"always"===this.Mr.cookieless_mode)throw Error('checkAndGetSessionAndWindowId should not be called with cookieless_mode="always"');var s,r,n=t||(new Date).getTime(),o=this.Xt;i?this.Fl=n:(null===this.Fl||this.Fl>n||n-this.Fl>=1e3)&&(null==(s=(r=this.Ml).syncCookieProperties)||s.call(r),this.Fl=n);var a=this.tu(),l=a[1],u=a[2],h=!F(o)&&l!==o,c=this.eu(),d=this.Ql(),p=this.ql,g=!!p&&(p.sessionStartTimestamp>n+6e4||n-p.sessionStartTimestamp>864e5),_=p?g:B(u)&&Math.abs(n-u)>864e5,f=!1,v=h,m=!l||!!p,y=l,b=!m&&!e&&this.Nl(n,c);if(b){(b=this.iu(n))||ra.info("cross-tab refresh kept the session alive",{sessionId:l});var w=this.tu();l=w[1],u=w[2],b||(m=!l||!!p)}if(m||b||_){v=!1;var x=p&&!g;l=x?p.sessionId:this.jl(),d=this.Bl(),ra.info("new session ID assigned",{sessionId:l,windowId:d,bootstrapped:!!x,changeReason:{noSessionId:m,activityTimeout:b,sessionPastMaximumLength:_}}),u=x?p.sessionStartTimestamp:n,this.ql=void 0,f=!0}else d||(d=this.Bl(),f=!0),(v=v||l!==y)&&(ra.info("adopted cross-tab session id",{sessionId:l,windowId:d}),f=!0);var $=B(c)&&e&&!_?c:n,k=B(u)?u:(new Date).getTime();this.Gl(d),this.Jl(l,$,k),e||this.zl();var S={noSessionId:m,activityTimeout:b,sessionPastMaximumLength:_,crossTabAdoption:v};return f&&this.Ol.forEach(e=>e(l,d,S)),{sessionId:l,windowId:d,sessionStartTimestamp:k,changeReason:f?S:void 0,lastActivityTimestamp:c}}zl(){this.Ll||(clearTimeout(this.nu),this.nu=setTimeout(()=>{if(!this.Ll)if(this.iu((new Date).getTime())){var e=this.Xt;this.resetSessionId(),this.Rl.emit("forcedIdleReset",{idleSessionId:e})}else this.zl()},1.1*this.sessionTimeoutMs))}};function ru(){return(ru=o(function*(){var e=null==u?void 0:u.userAgentData;if(null!=e&&e.getHighEntropyValues)try{var t,i=null==(t=yield e.getHighEntropyValues(["model"]))?void 0:t.model;return T(i)&&i.length>0?i:void 0}catch(e){return void ti.info("Unable to resolve $device_model from userAgentData.getHighEntropyValues",e)}})).apply(this,arguments)}function rh(e,t,i){return ij({distinct_id:e,userPropertiesToSet:t,userPropertiesToSetOnce:i})}for(var rc,rd,rp,rg="custom",r_="i.posthog.com",rf=/^\/static\//,rv=["/s/","/e/","/i/"],rm=class{constructor(e){this.su={},this.instance=e}get apiHost(){var e=this.instance.config.api_host.trim().replace(/\/$/,"");return"https://app.posthog.com"===e?"https://us.i.posthog.com":e}get flagsApiHost(){var e=this.instance.config.flags_api_host;return e?e.trim().replace(/\/$/,""):this.apiHost}get uiHost(){var e,t=null==(e=this.instance.config.ui_host)?void 0:e.replace(/\/$/,"");return t||(t=this.apiHost.replace("."+r_,".posthog.com")),"https://app.posthog.com"===t?"https://us.posthog.com":t}get region(){return this.su[this.apiHost]||(this.su[this.apiHost]=/https:\/\/(app|us|us-assets)(\.i)?\.posthog\.com/i.test(this.apiHost)?"us":/https:\/\/(eu|eu-assets)(\.i)?\.posthog\.com/i.test(this.apiHost)?"eu":rg),this.su[this.apiHost]}ru(e){if(rf.test(e)){var t=this.instance.config.asset_host;if("string"==typeof t)return t.trim().replace(/\/$/,"")||void 0}}ou(e){var t=iG(e);return t?t.protocol+"//"+t.host+t.pathname:void 0}au(e,t,i){if("ui"===e)return i;var s=i,r=this.instance.config.rewriteRequestPath;if(r&&(s=r(new URL((null==(o=iG(i))?void 0:o.href)||i)).toString()),r&&"api"===e&&rv.some(e=>0===t.indexOf(e))){var n=this.ou(s);if(n){var o,a,l=this.apiHost,u=this.lu;(null==(a=u)?void 0:a.apiHost)===l&&u.rewriteRequestPath===r||(this.lu=u={apiHost:l,rewriteRequestPath:r,urls:new Set}),u.urls.add(n)}}return s}isIngestionEndpoint(e){var t=this.lu,i=this.ou(e);return(null==t?void 0:t.apiHost)===this.apiHost&&t.rewriteRequestPath===this.instance.config.rewriteRequestPath&&!!i&&t.urls.has(i)}endpointFor(e,t){if(void 0===t&&(t=""),t&&(t="/"===t[0]?t:"/"+t),"ui"===e)return this.au(e,t,this.uiHost+t);if("flags"===e)return this.au(e,t,this.flagsApiHost+t);if("assets"===e){var i=this.ru(t);if(i)return this.au(e,t,""+i+t)}if(this.region===rg)return this.au(e,t,this.apiHost+t);var s=r_+t;switch(e){case"assets":return this.au(e,t,"https://"+this.region+"-assets."+s);case"api":return this.au(e,t,"https://"+this.region+"."+s)}}},ry=ts("[Surveys]"),rb={ignoreConditions:!1,ignoreDelay:!1,displayType:"popover"},rw=ts("[PostHog ExternalIntegrations]"),rx={intercom:"intercom-integration",crispChat:"crisp-chat-integration"},r$=class{constructor(e){this._instance=e}Ho(e,t){var i;null==(i=m.__PosthogExtensions__)||null==i.loadExternalDependency||i.loadExternalDependency(this._instance,e,e=>{if(e)return rw.error("failed to load script",e);t()})}startIfEnabledOrStop(){var e,t=this;for(var i of Object.entries(null!=(e=this._instance.config.integrations)?e:{}))!function(){var e,s,r,n=i[0],o=i[1];!o||null!=(e=m.__PosthogExtensions__)&&null!=(e=e.integrations)&&e[n]||t.Ho(rx[n],()=>{var e;null==(e=m.__PosthogExtensions__)||null==(e=e.integrations)||null==(e=e[n])||e.start(t._instance)}),!o&&null!=(s=m.__PosthogExtensions__)&&null!=(s=s.integrations)&&s[n]&&(null==(r=m.__PosthogExtensions__)||null==(r=r.integrations)||null==(r=r[n])||r.stop())}()}},rk=class{constructor(e){this._instance=e}initialize(){}get(e){var t=this._instance.persistence;if("string"==typeof e)return null==t?void 0:t.get_property(e);var i={};for(var s of e){var r=null==t?void 0:t.get_property(s);F(r)||(i[s]=r)}return i}set(e,t){var i;null==(i=this._instance.persistence)||i.register("string"==typeof e?{[e]:t}:e)}remove(e){var t;null==(t=this._instance.persistence)||t.unregister(e)}},rS=class{constructor(e){this.instance=e,this.A=ti,this.kv=new rk(e),this.onEvent=e=>sa(this.instance._addCaptureHook((t,i)=>{if(i)try{e({event:t,properties:i.properties})}catch(e){this.A.error("Browser extension event listener failed",e)}})),this.onRemoteConfig=e=>{var t=t=>{try{e(t)}catch(e){this.A.error("Browser extension remote config listener failed",e)}},i=this.instance.uu.on("extensionsRemoteConfig",t);return this.instance.cu&&t(this.instance.cu),sa(i)}}get logger(){return this.A}get distinctId(){return this.instance.get_distinct_id()}get anonymousId(){var e;return null!=(e=this.instance.get_property("$device_id"))?e:this.distinctId}get deviceId(){var e=this.instance.get_property(tx);return"string"==typeof e?e:void 0}get library(){return{name:b.LIB_NAME,version:b.LIB_VERSION}}get initialPersonProperties(){var e,t;return null!=(e=null==(t=this.instance.persistence)?void 0:t.get_initial_props())?e:{}}get groups(){return this.instance.getGroups()}get session(){try{var e,t,i,s,r,n=null==(e=this.instance.sessionManager)?void 0:e.checkAndGetSessionAndWindowId(!0);return{sessionId:null!=(t=null==n?void 0:n.sessionId)?t:"",windowId:null!=(i=null==n?void 0:n.windowId)?i:"",sessionStartTimestamp:null!=(s=null==n?void 0:n.sessionStartTimestamp)?s:0,lastActivityTimestamp:null!=(r=null==n?void 0:n.lastActivityTimestamp)?r:0}}catch(e){return{sessionId:"",windowId:"",sessionStartTimestamp:0,lastActivityTimestamp:0}}}get isOptedOut(){return this.instance.has_opted_out_capturing()}get canCapture(){return M(this.instance.is_capturing)?this.instance.is_capturing():!this.isOptedOut}get projectToken(){return this.instance.config.token}getExtension(e){var t;switch(e){case"featureFlags":case"featureFlagsCommon":t=this.instance.featureFlags;break;case"logs":t=this.instance.logs;break;case"surveys":t=this.instance.surveys;break;case"autocapture":t=this.instance.autocapture}return t}capture(e,t,i){i?this.instance.capture(e,t,{timestamp:i.timestamp,uuid:i.uuid,$set:i.set,$set_once:i.setOnce}):this.instance.capture(e,t)}registerDynamicEventProperties(e){return sa(this.instance.hu(e))}sendRequest(e,t){var i=this;return o(function*(){void 0===t&&(t={});var s,r=null!=(s=t.target)?s:"api",n=i.instance.requestRouter.endpointFor(r,e),o="api"===r&&"/i/v1/logs"===e,a={method:t.method,url:t.query?sY(n,t.query):n,data:t.body,headers:t.headers,timeout:t.timeoutMs,fireCallbackOnDrop:!0,transport:t.transport,compression:t.compression,compressionFallback:"flags"===t.target&&"best-available"===t.compression?w.Base64:void 0,timestampMode:t.sentAt};return o&&(a.batchKey="logs"),"sendBeacon"===t.transport?(i.instance._send_request(a),{statusCode:202}):new Promise(e=>{a.callback=e,i.instance._send_request(a)})})()}},rE={},rP=0,rO=()=>{},rI='Consent opt in/out is not valid with cookieless_mode="always" and will be ignored',rM="Surveys module not available",rC="sanitize_properties is deprecated. Use before_send instead",rA="Invalid value for property_denylist config: ",rF=["$recording_status","$sdk_debug_recording_script_not_loaded","$sdk_debug_replay_url_trigger_status","$sdk_debug_replay_event_trigger_status","$sdk_debug_replay_linked_flag_trigger_status","$sdk_debug_replay_rrweb_error","$sdk_debug_replay_internal_buffer_length","$sdk_debug_replay_flushed_size"],rT=["$feature_flag_called","$$heatmap","$snapshot"],rR=e=>"$"===e.charAt(0)&&!k(rT,e),rD=/^[A-Za-z0-9_-]{1,400}$/,rL=/^fb\.[0-9]+\.[0-9]+\.[A-Za-z0-9_-]+(?:\.[A-Za-z0-9_-]+)?$/,rB=/^fb\.[0-9]+\.[0-9]+\.[0-9]+$/,rq=["token","distinct_id",tz],rN="posthog",rj=e=>{var t,i;return r({api_host:"https://us.i.posthog.com",flags_api_host:null,ui_host:null,asset_host:null,token:"",autocapture:!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 s of t4)if(i===s)return!1;return!0}(null==h?void 0:h.location),persistence:"localStorage+cookie",persistence_name:"",cookie_persisted_properties:[],loaded:rO,save_campaign_params:!0,custom_campaign_params:[],custom_blocked_useragents:[],save_referrer:!0,capture_pageleave:"if_capture_pageview",defaults:null!=e?e:"unset",__preview_deferred_init_extensions:!1,__preview_replay_sync_fetch:!1,__preview_external_dependency_versioned_paths:!1,__preview_cookie_wins_on_conflict:!1,debug:c&&T(null==c?void 0:c.search)&&-1!==c.search.indexOf("__posthog_debug=true")||!1,cookie_expiration:365,upgrade:!1,disable_session_recording:!1,disable_persistence:!1,disable_web_experiments:!0,disable_surveys:!1,disable_surveys_automatic_display:!1,disable_conversations:!1,disable_product_tours:!1,disableDeviceModel:!1,reuseAnonymousId:!1,disable_external_dependency_loading:!1,strict_script_versioning:"fallback",enable_recording_console_log:void 0,secure_cookie:"https:"===(null==a||null==(t=a.location)?void 0:t.protocol),ip:!1,opt_out_capturing_by_default:!1,opt_out_persistence_by_default:!1,opt_out_useragent_filter:!1,opt_out_capturing_persistence_type:"localStorage",consent_persistence_name:null,opt_out_capturing_cookie_prefix:null,opt_in_site_apps:!1,property_denylist:[],respect_dnt:!1,sanitize_properties:null,request_headers:{},request_batching:!0,properties_string_max_length:65535,mask_all_element_attributes:!1,mask_all_text:!1,mask_personal_data_properties:!1,custom_personal_data_properties:[],advanced_disable_flags:!1,advanced_disable_decide:!1,advanced_disable_feature_flags:!1,advanced_disable_feature_flags_on_first_load:!1,advanced_only_evaluate_survey_feature_flags:!1,advanced_feature_flags_dedup_per_session:!1,advanced_enable_surveys:!1,advanced_disable_toolbar_metrics:!1,feature_flag_request_timeout_ms:3e3,feature_flag_request_max_retries:1,surveys_request_timeout_ms:1e4,on_request_error(e){ti.error("Bad HTTP status: "+e.statusCode+" "+e.text)},get_device_id:e=>e,capture_performance:void 0,name:"posthog",bootstrap:{},disable_compression:!1,session_idle_timeout_seconds:1800,person_profiles:tK,before_send:void 0,get_current_url:void 0,request_queue_config:{flush_interval_ms:3e3},error_tracking:{},_onCapture:rO},{rageclick:e&&e>="2026-05-30"?{content_ignorelist:iI,ignore_text_selection:!0}:!e||"2025-11-30">e||{content_ignorelist:!0},capture_pageview:!e||"2025-05-24">e||"history_change",session_recording:(i={},e&&"unset"!==e&&("2025-11-30">e||(i.strictMinimumDuration=!0),"2026-05-30">e||(i.canvasCapture={resolutionScale:.6}),"2026-06-25">e||(i.streamNetworkBody=!0),"2026-08-30">e||(i.captureJsonLd=!0)),i),external_scripts_inject_target:e&&e>="2026-01-30"?"head":"body",internal_or_test_user_hostname:e&&e>="2026-01-30"?/^(localhost|127\.0\.0\.1)$/:void 0,persistence_save_debounce_ms:e&&e>="2026-05-30"?250:0,split_storage:!(!e||"2026-05-30">e),detect_google_search_app:!(!e||"2026-05-30">e),disable_capture_url_hashes:!(!e||"2026-06-25">e),cookieWinsOnConflict:!(!e||"unset"===e||"2026-08-29">e)})},rG=[["process_person","person_profiles"],["xhr_headers","request_headers"],["cookie_name","persistence_name"],["disable_cookie","disable_persistence"],["__preview_disable_beacon","disable_beacon"],["store_google","save_campaign_params"],["verbose","debug"],["__preview_cookie_wins_on_conflict","cookieWinsOnConflict"]],rH=e=>{var t={};for(var i of rG){var s=i[0],r=i[1];F(e[s])||(t[r]=e[s])}var n=t3({},t,e),o=e.__preview_external_dependency_versioned_paths;return F(o)||(F(e.strict_script_versioning)&&(n.strict_script_versioning=!!o),T(o)&&F(e.asset_host)&&(n.asset_host=o)),I(e.property_blacklist)&&(F(e.property_denylist)?n.property_denylist=e.property_blacklist:I(e.property_denylist)?n.property_denylist=[...e.property_blacklist,...e.property_denylist]:ti.error(rA+e.property_denylist)),n},rz=class{constructor(){this.__forceAllowLocalhost=!1}get du(){return this.__forceAllowLocalhost}set du(e){ti.error("WebPerformanceObserver is deprecated and has no impact on network capture. Use `_forceAllowLocalhostNetworkCapture` on `posthog.sessionRecording`"),this.__forceAllowLocalhost=e}},rU=((i=class e{vu(e){if(e){var t=this.fu.indexOf(e);-1!==t&&this.fu.splice(t,1)}}pu(e,t){return this.vu(e),this.fu.push(t),null==t.initialize||t.initialize(),t}gu(){return"always"===this.config.cookieless_mode||"on_reject"===this.config.cookieless_mode&&this.consent.isRejected()}mu(){if(!(this.yu||this.config.reuseAnonymousId||this.config.segment||this.gu())){var e,t,i,s="memory"===this.config.persistence||"sessionStorage"===this.config.persistence;(s||this.config.disable_persistence)&&(this.bu||(s?(e="persistence is set to '"+this.config.persistence+"'",t="memory"===this.config.persistence?"on every page load":"for every new browser tab or window",i="Either set persistence to 'localStorage+cookie', keep this persistence and pass a stable ID through bootstrap.distinctID, or enable reuseAnonymousId."):(e="persistence is disabled (disable_persistence is true)",t="on every page load",i="Either set disable_persistence to false, keep persistence disabled and pass a stable ID through bootstrap.distinctID, or enable reuseAnonymousId."),this.yu=!0,console.warn("[PostHog.js]",e+" but no bootstrap.distinctID was provided. PostHog will mint a new distinct ID "+t+", so calling identify() merges a new ID onto the person each time. A person can then pass the distinct-ID limit and its events stop appearing on person pages and the session tab. "+i)))}}_u(){var e=this.persistence;if(e&&!this.wu){if(this.gu())"on_reject"===this.config.cookieless_mode&&"$posthog_cookieless"!==this.get_distinct_id()&&(this.ku(),this.Su());else if("$posthog_cookieless"===this.get_distinct_id()){this.xu()||e.load(!0);var t=this.get_distinct_id();if(!t||"$posthog_cookieless"===t){var i=this.config.get_device_id(io());this.register({distinct_id:i,$device_id:i}),e.set_property(tD,tW)}this.ku()}}}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.$u=!1,this.Cu=!1,this.webPerformance=new rz,this.Tu=!1,this.version=b.LIB_VERSION,this.Iu=new Set,this.Mu="",this.uu=new ro,this.fu=[],this.Eu=[],this.Pu=!1,this.bu=!1,this.yu=!1,this.wu=!1,this._calculate_event_properties=this.calculateEventProperties.bind(this),this.config=rj(),this.SentryIntegration=iR,this.sentryIntegration=e=>{var t;return t=iT(this,e),{name:iF,processEvent:e=>t(e)}},this.__request_queue=[],this.__loaded=!1,this.analyticsDefaultEndpoint="/e/",this.Ru=!1,this.Au=null,this.Fu=null,this.Ou=null,this.scrollManager=new rs(this),this.pageViewManager=new iD(this),this.rateLimiter=new su(this),this.requestRouter=new rm(this),this.consent=new iO(this),this.externalIntegrations=new r$(this);var t,i=null!=(t=e.__defaultExtensionClasses)?t:{};this.featureFlags=i.featureFlags&&new i.featureFlags(this),this.toolbar=i.toolbar&&new i.toolbar(this),this.surveys=i.surveys&&new i.surveys(this),this.conversations=i.conversations&&new i.conversations(this),this.logs=i.logs&&new i.logs(this),this.metrics=i.metrics&&new i.metrics(this),this.experiments=i.experiments&&new i.experiments(this),this.exceptions=i.exceptions&&new i.exceptions(this),this.people={set:(e,t,i)=>{var s=T(e)?{[e]:t}:e;this.setPersonProperties(s),null==i||i({})},set_once:(e,t,i)=>{var s=T(e)?{[e]:t}:e;this.setPersonProperties(void 0,s),null==i||i({})}},this.on("eventCaptured",e=>ti.info('send "'+(null==e?void 0:e.event)+'"',e))}init(t,i,s){if(s&&s!==rN){var r,n=null!=(r=rE[s])?r:new e;return n._init(t,i,s),rE[s]=n,rE[rN][s]=n,n}return this._init(t,i,s)}_init(e,t,i){void 0===t&&(t={});var s,n,o,l,u=T(e)?e.trim():"";if(!u)return ti.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 u!==(null==(l=this.config)?void 0:l.token)?console.warn("[PostHog.js]","You have already initialized PostHog with a different project token! Re-initializing is a no-op, so events will keep going to the project this instance was initialized with. To capture into a second project, load PostHog once, then initialize a named instance after the SDK has loaded, e.g. posthog.init('"+u+"', { ... }, 'project2')"):console.warn("[PostHog.js]","You have already initialized PostHog! Re-initializing is a no-op"),this;this.__loaded=!0,this.config=rj(t.defaults),t.debug=this.Du(t.debug),this.Lu=t,this.Nu=[],t.person_profiles?this.Fu=t.person_profiles:t.process_person&&(this.Fu=t.process_person);var h=rj(t.defaults),c=rH(t),d=t3({},h,c,{name:i,token:u});C(h.rageclick)&&C(c.rageclick)&&(d.rageclick=t3({},h.rageclick,c.rageclick)),C(h.session_recording)&&C(c.session_recording)&&(d.session_recording=t3({},h.session_recording,c.session_recording)),this.set_config(d),this.config.on_xhr_error&&ti.error("on_xhr_error is deprecated. Use on_request_error instead"),this.compression=t.disable_compression?void 0:sr;var p=this.xu(),g=!this.gu();if(this.persistence=new ss(this.config,p,!0,g),this.sessionPersistence="sessionStorage"===this.config.persistence||"memory"===this.config.persistence?this.persistence:new ss(r({},this.config,{persistence:"sessionStorage"}),p,!1,g),this.Mu="ph_"+(this.config.persistence_name||this.config.token)+"_session_registered_properties","memory"!==this.config.persistence&&!p&&iP.At()){var _=iP.Dt(this.Mu);I(_)&&_.forEach(e=>{T(e)&&this.Iu.add(e)})}else iP.Pt(this.Mu);var f=r({},this.persistence.props),v=r({},this.sessionPersistence.props);this.register({$initialization_time:(new Date).toISOString()}),this.qu=new rt((e,t)=>this.ju(e,t),this.config.request_queue_config),this.Bu=new ri(this),this.__request_queue=[];var m=this.gu();m||(this.sessionManager=new rl(this),this.sessionPropsManager=new rn(this,this.sessionManager,this.persistence),this.sessionManager.onSessionId((e,t,i)=>{(null!=i&&i.activityTimeout||null!=i&&i.sessionPastMaximumLength||null!=i&&i.crossTabAdoption)&&this.zu()})),this.Hu(),this.config.__preview_deferred_init_extensions?(ti.info("Deferring extension initialization to improve startup performance"),this.Uu=setTimeout(()=>{this.Uu=void 0,this.Wu(m)},0)):(ti.info("Initializing extensions synchronously"),this.Wu(m)),b.DEBUG=b.DEBUG||this.config.debug,b.DEBUG&&ti.info("Starting in debug mode",{this:this,config:t,thisC:r({},this.config),p:f,s:v}),!this.config.identity_distinct_id||null!=(s=t.bootstrap)&&s.distinctID||(t.bootstrap=r({},t.bootstrap,{distinctID:this.config.identity_distinct_id,isIdentifiedID:!0}));var y=null==(n=t.bootstrap)?void 0:n.distinctID;if(this.bu=!!y&&!R(y),null!=(o=t.bootstrap)&&o.distinctID){var w=t.bootstrap.distinctID,x=this.get_distinct_id(),$=this.persistence.get_property(tD);if(t.bootstrap.isIdentifiedID&&null!=x&&x!==w&&"anonymous"===$)this.identify(w);else if(t.bootstrap.isIdentifiedID&&null!=x&&x!==w&&"identified"===$)ti.warn("Bootstrap distinctID differs from an already-identified user. The existing identity is preserved. Call reset() before reinitializing if you intend to switch users.");else{var k=this.config.get_device_id(io()),S=t.bootstrap.isIdentifiedID?k:w;this.persistence.set_property(tD,t.bootstrap.isIdentifiedID?tJ:tW),this.register({distinct_id:w,$device_id:S})}}if(m)this.register_once({distinct_id:tH,$device_id:null},"");else if(!this.get_distinct_id()){var E=this.config.get_device_id(io());this.register_once({distinct_id:E,$device_id:E},""),this.persistence.set_property(tD,tW)}return t7(a,"onpagehide"in self?"pagehide":"unload",this._handle_unload.bind(this),{passive:!1}),t7(a,"pageshow",()=>{var e;this.$u=!1,this.Cu||null==(e=this.Bu)||e.resume()}),t.segment?iA(this,()=>this.Vu()):this.Vu(),M(this.config._onCapture)&&this.config._onCapture!==rO&&(ti.warn("onCapture is deprecated. Please use `before_send` instead"),this.on("eventCaptured",e=>this.config._onCapture(e.event,e))),this.config.ip&&ti.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.config.disableDeviceModel||(function(){return ru.apply(this,arguments)})().then(e=>{e&&this.register({[t$]:e})}).catch(rO),this}Gu(e){return T(e.name)&&M(e.setup)}Qu(e,t){var i=this;this.Gu(e)?t.push(o(function*(){try{yield e.setup(i.Zu())}catch(t){ti.error('Failed to set up extension "'+e.name+'"',t);try{yield null==e.dispose?void 0:e.dispose()}catch(t){ti.error('Failed to dispose extension "'+e.name+'"',t)}}})):this.fu.push(e)}Hu(){var t,i,s,r,n,a,l=this,u=null!=(t=null==(i=this.config.__extensionClasses)?void 0:i.featureFlags)?t:null==(s=e.__defaultExtensionClasses)?void 0:s.featureFlags;if(u)if(this.featureFlags&&this.featureFlags instanceof u||(null==(a=this.Ju)||a.call(this),this.Ju=void 0,this.featureFlags=new u(this)),M(this.featureFlags.onReloading)&&M(this.featureFlags.setup)){if(!this.Ju){this.Ju=this.featureFlags.onReloading(()=>{this.uu.emit("featureFlagsReloading",!0)});var h=this.featureFlags;o(function*(){try{yield h.setup(l.Zu())}catch(t){ti.error("Failed to set up feature flags",t);var e=l.Ju;l.Ju=void 0;try{null==e||e()}catch(e){ti.error("Failed to unsubscribe feature flag reloading",e)}try{yield h.dispose()}catch(e){ti.error("Failed to dispose feature flags",e)}}})()}}else null==(r=(n=this.featureFlags).initialize)||r.call(n)}Wu(t){var i,s,n,o,a,l,u,h,c=performance.now(),d=r({},e.__defaultExtensionClasses,this.config.__extensionClasses),p=[];d.exceptions&&this.fu.push(this.exceptions=null!=(i=this.exceptions)?i:new d.exceptions(this)),d.historyAutocapture&&this.fu.push(this.historyAutocapture=new d.historyAutocapture(this)),d.tracingHeaders&&this.fu.push(this.tracingHeaders=new d.tracingHeaders(this)),d.siteApps&&this.fu.push(this.siteApps=new d.siteApps(this)),d.sessionRecording&&!t&&this.fu.push(this.sessionRecording=new d.sessionRecording(this)),this.config.disable_scroll_properties||p.push(()=>{this.scrollManager.startMeasuringScrollPosition()}),d.autocapture&&this.Qu(this.autocapture=new d.autocapture(this),p),d.surveys&&this.Qu(this.surveys=null!=(s=this.surveys)?s:new d.surveys(this),p),d.logs&&this.Qu(this.logs=null!=(n=this.logs)?n:new d.logs(this),p),d.metrics&&this.fu.push(this.metrics=null!=(o=this.metrics)?o:new d.metrics(this)),d.conversations&&this.fu.push(this.conversations=null!=(a=this.conversations)?a:new d.conversations(this)),d.productTours&&this.fu.push(this.productTours=new d.productTours(this)),d.heatmaps&&this.fu.push(this.heatmaps=new d.heatmaps(this)),d.webVitalsAutocapture&&this.fu.push(this.webVitalsAutocapture=new d.webVitalsAutocapture(this)),d.exceptionObserver&&this.fu.push(this.exceptionObserver=new d.exceptionObserver(this)),d.deadClicksAutocapture&&this.fu.push(this.deadClicksAutocapture=new d.deadClicksAutocapture(this,iM)),d.toolbar&&this.fu.push(this.toolbar=null!=(l=this.toolbar)?l:new d.toolbar(this)),d.experiments&&this.fu.push(this.experiments=null!=(u=this.experiments)?u:new d.experiments(this)),d.webMCP&&this.fu.push(this.webMCP=null!=(h=this.webMCP)?h:new d.webMCP(this)),this.fu.forEach(e=>{e.initialize&&p.push(()=>{null==e.initialize||e.initialize()})}),p.push(()=>{if(this.Ku){var e=this.Ku;this.Ku=void 0,this.fu.forEach(t=>null==t.onRemoteConfig?void 0:t.onRemoteConfig(e))}}),this.Xu(p,c)}Xu(e,t){for(;e.length>0;){if(this.config.__preview_deferred_init_extensions&&performance.now()-t>=30&&e.length>0)return void(this.Uu=setTimeout(()=>{this.Uu=void 0,this.Xu(e,t)},0));var i=e.shift();if(i)try{i()}catch(e){ti.error("Error initializing extension:",e)}}var s=Math.round(performance.now()-t);this.register_for_session({[tU]:this.config.__preview_deferred_init_extensions?"deferred":"synchronous",[tV]:s}),this.config.__preview_deferred_init_extensions&&ti.info("PostHog extensions initialized ("+s+"ms)")}il(e){if(!h||!h.body)return ti.info("document not ready yet, trying again in 500 milliseconds..."),void setTimeout(()=>{this.il(e)},500);if(this.config.__preview_deferred_init_extensions&&(this.Ku=e),this.cu=e,this.compression=void 0,e.ok){var t,i=e.config;i.supportedCompression&&!this.config.disable_compression&&(this.compression=k(i.supportedCompression,sr)?sr:k(i.supportedCompression,sn)?sn:void 0),null!=(t=i.analytics)&&t.endpoint&&(this.analyticsDefaultEndpoint=i.analytics.endpoint)}this.set_config({person_profiles:this.Fu?this.Fu:tK}),this.uu.emit("extensionsRemoteConfig",e),this.fu.forEach(t=>null==t.onRemoteConfig?void 0:t.onRemoteConfig(e))}Vu(){try{this.config.loaded(this)}catch(e){ti.critical("`loaded` function failed",e)}if(this.Yu(),this.config.internal_or_test_user_hostname&&null!=c&&c.hostname){var e=c.hostname,t=this.config.internal_or_test_user_hostname;("string"==typeof t?e===t:t.test(e))&&this.setInternalOrTestUser()}this.config.capture_pageview&&setTimeout(()=>{(this.consent.isOptedIn()||this.gu())&&this.tc()},1),this.ec=new sc(this),this.ec.load()}Yu(){var e;this.is_capturing()&&this.config.request_batching&&(null==(e=this.qu)||e.enable())}_dom_loaded(){this.is_capturing()&&t1(this.__request_queue,e=>this.ju(e)),this.__request_queue=[],this.Yu()}_handle_unload(){var e,t,i,s,r;this.$u=!0,null==(e=this.surveys)||null==e.handlePageUnload||e.handlePageUnload(),null==(t=this.metrics)||t.flush("sendBeacon"),this.config.request_batching?(this.nc()&&this.capture(tZ),null==(i=this.logs)||i.flushLogs("sendBeacon"),null==(s=this.qu)||s.unload(),null==(r=this.Bu)||r.unload()):this.nc()&&this.capture(tZ,null,{transport:"sendBeacon"})}_send_request(e){re(this,e)}ju(e,t){this.Bu?this.Bu.retriableRequest(e,t):this._send_request(t?r({},e,{transport:t}):e)}_execute_array(e){rP++;try{var t,i=[],s=[],r=[];t1(e,e=>{if(e)if(I(t=e[0]))r.push(e);else if(M(e))try{e.call(this)}catch(t){ti.error("Error executing queued PostHog call",e,t)}else I(e)&&"alias"===t?i.push(e):I(e)&&-1!==t.indexOf("capture")&&M(this[t])?r.push(e):s.push(e)});var n=function(e,t){t1(e,function(e){try{if(I(e[0])){var i=t;t2(e,function(e){i=i[e[0]].apply(i,e.slice(1))})}else t[e[0]].apply(t,e.slice(1))}catch(t){ti.error("Error executing queued PostHog call",e,t)}})};n(i,this),n(s,this),n(r,this)}finally{rP--}}push(t){if(rP>0&&I(t)&&T(t[0])){var i=e.prototype[t[0]];M(i)&&i.apply(this,t.slice(1))}else this._execute_array([t])}get sc(){return{property:tS,persistenceKey:tE,cookieName:"_fbc",pattern:rL,register:(e,t)=>{var i;return null==(i=this.persistence)?void 0:i.register({[tE]:{value:e,delivered:t}})},unregister:()=>{var e;return null==(e=this.persistence)?void 0:e.unregister(tE)}}}get rc(){return{property:tP,persistenceKey:tO,cookieName:"_fbp",pattern:rB,register:(e,t)=>{var i;return null==(i=this.persistence)?void 0:i.register({[tO]:{value:e,delivered:t}})},unregister:()=>{var e;return null==(e=this.persistence)?void 0:e.unregister(tO)}}}oc(e){var t,i=null==(t=this.persistence)?void 0:t.get_property(e.persistenceKey);return T(i)&&e.pattern.test(i)?{value:i,delivered:!1}:C(i)&&T(i.value)&&e.pattern.test(i.value)?{value:i.value,delivered:!0===i.delivered}:void 0}ac(e,t,i){return t===(null==i?void 0:i.value)?{value:t,pending:!i.delivered}:(e.register(t,!1),{value:t,pending:!0})}lc(e){if(this.config.save_campaign_params&&!this.gu()){var t=t9(e.cookieName);return T(t)&&e.pattern.test(t)?t:void 0}}uc(e,t,i,s){if(this.persistence){var r=this.sc;this.persistence.refreshKey(r.persistenceKey);var n=this.oc(r);if(!s){if(i)return T(t)&&rL.test(t)?this.ac(r,t,n):void r.unregister();var o=T(e)&&rD.test(e)?e:void 0,a=this.lc(r);return a&&((e,t,i)=>{var s=e.split(".");if(t)return s[3]===t;if(!i)return!0;var r=i.value.split(".");return s[3]===r[3]||Number(s[2])>Number(r[2])})(a,o,n)?this.ac(r,a,n):o?(null==n?void 0:n.value.split(".")[3])===o?{value:n.value,pending:!n.delivered}:this.ac(r,"fb.1."+Date.now()+"."+o,n):n?{value:n.value,pending:!n.delivered}:void 0}r.unregister()}}cc(e,t,i){if(this.persistence){var s=this.rc;this.persistence.refreshKey(s.persistenceKey);var r=this.oc(s);if(!i){if(t)return T(e)&&rB.test(e)?this.ac(s,e,r):void s.unregister();var n=this.lc(s);return n?this.ac(s,n,r):r?{value:r.value,pending:!r.delivered}:void 0}s.unregister()}}hc(e,t){if(this.persistence){this.persistence.refreshKey(e.persistenceKey);var i=this.oc(e);(null==i?void 0:i.value)!==t||i.delivered||e.register(t,!0)}}capture(e,t,i){var s,n,o,a,l,u,h;if(this.__loaded&&this.persistence&&this.sessionPersistence&&this.qu){if(this.is_capturing())if(!F(e)&&T(e)){if(this._u(),"$snapshot"!==e||!this.gu()){var c=!this.config.opt_out_useragent_filter&&this._is_bot();if(!c||this.config.__preview_capture_bot_pageviews){var d=null!=i&&i.skip_client_rate_limiting?void 0:this.rateLimiter.clientRateLimitContext();if(null==d||!d.isRateLimited){null!=t&&t.$current_url&&!T(null==t?void 0:t.$current_url)&&(ti.error("Invalid `$current_url` property provided to `posthog.capture`. Input must be a string. Ignoring provided value."),null==t||delete t.$current_url),"$exception"!==e||null!=i&&i._originatedFromCaptureException||ti.warn("Using `posthog.capture('$exception')` is unreliable because it does not attach required metadata. Use `posthog.captureException(error)` instead, which attaches required metadata automatically."),this.sessionPersistence.update_search_keyword(),this.config.save_campaign_params&&(Y=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 p=new Date,g=(null==i?void 0:i.timestamp)||p,_=eX(null==i?void 0:i.uuid,io),f={uuid:_,event:e,properties:this.calculateEventProperties(e,t||{},g,_)};"$pageview"===e&&this.config.__preview_capture_bot_pageviews&&c&&(f.event="$bot_pageview",f.properties.$browser_type="bot"),d&&(f.properties.$lib_rate_limit_remaining_tokens=d.remainingTokens);var v="$feature_flag_called"===e&&!1===f.properties.$feature_flag_has_experiment&&!0===this.get_property("$minimal_flag_called_events");null!=i&&i.$set&&!v&&(f.$set=null==i?void 0:i.$set);var m=C(null==t?void 0:t.$set)?t.$set:void 0,y=I(null==t?void 0:t.$unset)?t.$unset:[],b=(null==i?void 0:i.$unset)||[],w=e=>{var t,s=!(null==i||!i.$set)&&e in i.$set;return{hasProvided:s||!!m&&e in m,provided:s?null==i||null==(t=i.$set)?void 0:t[e]:null==m?void 0:m[e],unset:-1!==y.indexOf(e)||-1!==b.indexOf(e)}},x=w(tS),$=w(tP),k=[{channel:this.sc,hasProvided:x.hasProvided,update:this.uc(null==(s=Y)?void 0:s.fbclid,x.provided,x.hasProvided,x.unset)},{channel:this.rc,hasProvided:$.hasProvided,update:this.cc($.provided,$.hasProvided,$.unset)}];for(var S of k){var E=S.channel,P=S.update;P&&!0===f.properties.$process_person_profile&&P.pending&&!S.hasProvided&&!v&&(f.$set=r({[E.property]:P.value},f.$set))}var O=null==i?void 0:i.$unset;O&&(f.$unset=O);var M=v?void 0:this.vc(null==i?void 0:i.$set_once,e!==t0,e===tQ);if(M&&(f.$set_once=M),null!=i&&i._noTruncate||(a=this.config.properties_string_max_length,l=f,u=e=>T(e)?e.slice(0,a):e,h=new Set,f=function e(t,i){if(t!==Object(t))return u?u(t):t;if(!h.has(t)){var s;if(h.add(t),I(t))s=[],t1(t,t=>{s.push(e(t))});else{var r={};t2(G(t)?t6(t):t,(t,i)=>{h.has(t)||(r[i]=e(t,i))}),s=r}return s}}(l)),f.timestamp=g,F(null==i?void 0:i.timestamp)||(f.properties.$event_time_override_provided=!0,f.properties.$event_time_override_system_time=p),v&&(f.properties=(R=f.properties,void 0===(L=rq)&&(L=[]),B={},q=e=>{void 0!==R[e]&&(B[e]=R[e])},e3.forEach(q),L.forEach(q),B)),"survey dismissed"===e||e===so){var R,L,B,q,N,j,H,z=null==t?void 0:t.$survey_id,U=null==t?void 0:t.$survey_iteration;(e=>{try{var t="seenSurvey_"+(e.current_iteration&&e.current_iteration>0?e.id+"_"+e.current_iteration:e.id);if(localStorage.getItem(t))return;localStorage.setItem(t,"true")}catch(e){ry.error("Failed to persist survey seen state",e)}})({id:z,current_iteration:U}),f.$set=r({},f.$set,{[(N={id:z,current_iteration:U},H="$survey_"+(j=e===so?"responded":"dismissed")+"/"+N.id,N.current_iteration&&N.current_iteration>0&&(H="$survey_"+j+"/"+N.id+"/"+N.current_iteration),H)]:!0})}else"survey shown"===e&&(f.$set=r({},f.$set,{$survey_last_seen_date:(new Date).toISOString()}));if("product tour shown"===e){var V=null==t?void 0:t.$product_tour_type;V&&(f.$set=r({},f.$set,{["$product_tour_last_seen_date/"+V]:(new Date).toISOString()}))}var W=r({},f.properties.$set,f.$set);if(A(W)||this.setPersonPropertiesForFlags(W),!D(this.config.before_send)){var J=this.Os(f);if(!J)return;(f=J).uuid=eX(f.uuid,io)}this.sessionRecording&&!this.Pu&&rR(e)&&(this.Pu=!0,setTimeout(()=>this.Pu=!1,3e4));var K=k.filter(e=>{var t,i,s,r=e.channel,n=e.update,o=null!=(t=null==(i=f.$set)?void 0:i[r.property])?t:C(null==(s=f.properties)?void 0:s.$set)?f.properties.$set[r.property]:void 0;return(null==n?void 0:n.pending)&&o===n.value});this.uu.emit("eventCaptured",f);var Y,X,Z,Q=null!=(n=null==i?void 0:i._url)?n:this.requestRouter.endpointFor("api",this.analyticsDefaultEndpoint),ee="recordings"===(null==i?void 0:i._batchKey)||/\/s\/(?:\?|$)/.test(Q),et=r({method:"POST",url:Q,data:f,compression:"best-available",preferSyncCompression:null==i?void 0:i.send_instantly,timestampMode:ee?"body":"capture-body",batchKey:null==i?void 0:i._batchKey},ee&&null!=(o=f.properties)&&o.$session_id?{batchGroup:f.properties.$session_id+(f.properties.$window_id?"-"+f.properties.$window_id:"")}:{},null!=i&&i.transport?{transport:i.transport}:{},K.length?{fireCallbackOnDrop:!0,callback:e=>{if(e.statusCode>=200&&300>e.statusCode)for(var t of K)this.hc(t.channel,t.update.value)}}:{});return!this.config.request_batching||i&&(null==i||!i._batchKey)||null!=i&&i.send_instantly?(!et.transport&&!et.callback&&A(null!=(X=this.config.request_headers)?X:{})&&this.$u&&(Z="sendBeacon"),this.ju(et,Z)):this.qu.enqueue(et),f}ti.critical("This capture call is ignored due to client rate limiting.")}}}else ti.error("No event name provided to posthog.capture")}else ti.uninitializedWarning("posthog.capture")}_addCaptureHook(e){return this.on("eventCaptured",t=>e(t.event,t))}getExtension(e){var t;return null==(t=this.fc)?void 0:t.getExtension(e)}Zu(){var e;return null!=(e=this.fc)?e:this.fc=new rS(this)}hu(e){this.Eu.push(e);var t=!0;return()=>{if(t){t=!1;var i=this.Eu.indexOf(e);-1!==i&&this.Eu.splice(i,1)}}}gc(e){var t,i,s;return void 0===e&&(e=!0),!(null==(t=this.persistence)||!t.consumeCookieIdentityChange())&&(this.Ou=null,"anonymous"===this.persistence.get_property("$user_state")&&(null==(s=this.sessionPersistence)||s.clear(),this.Iu.clear(),this.mc()),null==(i=this.featureFlags)||i.reset(),e&&this.reloadFeatureFlags(),!0)}calculateEventProperties(e,t,i,s,n){if(i=i||new Date,!this.persistence||!this.sessionPersistence)return t;this._u(),this.persistence.syncCookieProperties(),this.gc();var o,l=n?void 0:this.persistence.remove_event_timer(e),u=r({},t);if(u.token=this.config.token,u.$config_defaults=this.config.defaults,this.gu()&&(u[tz]=!0),"$snapshot"===e){var d=r({},this.persistence.properties(),this.sessionPersistence.properties());return u.distinct_id=d.distinct_id,(!T(u.distinct_id)&&!L(u.distinct_id)||R(u.distinct_id))&&ti.error("Invalid distinct_id for replay event. This indicates a bug in your implementation"),u}var p,g=function(e,t,i,s){if(void 0===s&&(s=!1),!f)return{};var r,n,o,l,u,h=e?[...iU,...t||[]]:[],d=function(e){for(var t=0;eV.length>t;t++){var i=eV[t],s=i[1],r=i[0].exec(e),n=r&&(M(s)?s(r,e):s);if(n)return n}return["",""]}(f),p=d[0],g=d[1],_=function(e){for(var t=0;eK.length>t;t++){var i,s=eK[t],r=s[1],n=s[2],o=e.match(s[0]);if(o)return[r,(null==(i=n&&e.match(n)||o)?void 0:i[1])||""]}return["",""]}(f),v=_[0],m=_[1],y=null!=(u="u">typeof navigator?navigator:void 0)&&u.brave?{brave:!0}:{},w={};F(i)||(w.detectGoogleSearchApp=i);var x={},$=null==(r=navigator)||null==(r=r.userAgentData)?void 0:r.platform,k=null==(n=navigator)?void 0:n.maxTouchPoints,S=null==a||null==(o=a.screen)?void 0:o.width,E=null==a||null==(l=a.screen)?void 0:l.height,P=null==a?void 0:a.devicePixelRatio;F($)||(x.userAgentDataPlatform=$),F(k)||(x.maxTouchPoints=k),F(S)||(x.screenWidth=S),F(E)||(x.screenHeight=E),F(P)||(x.devicePixelRatio=P);var O,I,C,A,T,R,D=t3(t8({$os:p,$os_version:g,$browser:eH(f,navigator.vendor,y,w),$webview_app:v,$webview_app_version:m,$device:eW(f),$device_type:(R=eW(f))===Q||R===Z||"Kobo"===R||"Kindle Fire"===R||R===ex?X:R===ed||R===eg||R===ep||R===eb?"Console":R===ee?"Wearable":R?K:"Android"===(null==x?void 0:x.userAgentDataPlatform)&&(null!=(I=null==x?void 0:x.maxTouchPoints)?I:0)>0?600>Math.min(null!=(C=null==x?void 0:x.screenWidth)?C:0,null!=(A=null==x?void 0:x.screenHeight)?A:0)/(null!=(T=null==x?void 0:x.devicePixelRatio)?T:1)?K:X:"Desktop",$timezone:function(){try{return Intl.DateTimeFormat().resolvedOptions().timeZone}catch(e){return}}(),$timezone_offset:function(){try{return(new Date).getTimezoneOffset()}catch(e){return}}()}),{$current_url:iz(s?eQ(null==c?void 0:c.href):null==c?void 0:c.href,h,iW),$host:null==c?void 0:c.host,$pathname:null==c?void 0:c.pathname,$raw_user_agent:f.length>1e3?f.substring(0,997)+"...":f,$browser_version:eU(f,navigator.vendor,y,w),$browser_language:iX(),$browser_language_prefix:"string"==typeof(O=iX())?O.split("-")[0]:void 0,$screen_height:null==a?void 0:a.screen.height,$screen_width:null==a?void 0:a.screen.width,$viewport_height:null==a?void 0:a.innerHeight,$viewport_width:null==a?void 0:a.innerWidth,$lib:b.LIB_NAME,$lib_version:b.LIB_VERSION,$insert_id:Math.random().toString(36).substring(2,10)+Math.random().toString(36).substring(2,10),$time:Date.now()/1e3});return b.SDK_DIST_CHANNEL&&(D.$sdk_dist_channel=b.SDK_DIST_CHANNEL),D}(this.config.mask_personal_data_properties,this.config.custom_personal_data_properties,this.config.detect_google_search_app,this.config.disable_capture_url_hashes);if(this.sessionManager){var _=this.sessionManager.checkAndGetSessionAndWindowId(n,i.getTime(),!0),v=_.windowId;u.$session_id=_.sessionId,u.$window_id=v}this.sessionPropsManager&&t3(u,this.sessionPropsManager.getSessionProps());try{if(this.sessionRecording){var m=this.sessionRecording.sdkDebugProperties,y=!this.Pu&&rR(e);for(var w in m)(y||k(rF,w))&&(u[w]=m[w])}u.$sdk_debug_retry_queue_size=null==(o=this.Bu)?void 0:o.length}catch(e){u.$sdk_debug_error_capturing_properties=String(e)}if(this.requestRouter.region===rg&&(u.$lib_custom_api_host=this.config.api_host),p="$pageview"!==e||n?"$pageleave"!==e||n?this.pageViewManager.doEvent():this.pageViewManager.doPageLeave(i):this.pageViewManager.doPageView(i,s),u=t3(u,p),"$pageview"===e&&h&&(u.title=h.title),!F(l)){var x=i.getTime()-l;u.$duration=parseFloat((x/1e3).toFixed(3))}f&&this.config.opt_out_useragent_filter&&(u.$browser_type=this._is_bot()?"bot":"browser");var $=this.persistence.properties(),S=this.sessionPersistence.properties(),E=u.$groups,P=$.$groups;C(E)&&!A(E)&&(u.$groups=r({},C(P)?P:{},E)),t2(["$referrer","$referring_domain"],e=>{e in $&&delete S[e]});var O={};if(this.Eu.length>0)for(var D of this.Eu.slice())try{t3(O,D())}catch(e){ti.error("Failed to produce browser extension event properties",e)}(u=t3({},g,$,S,r({},O,u))).$is_identified=this._isIdentified(),I(this.config.property_denylist)?t2(this.config.property_denylist,function(e){delete u[e]}):ti.error(rA+this.config.property_denylist+" or property_blacklist config: "+this.config.property_blacklist);var B=this.config.sanitize_properties;B&&(ti.error(rC),u=B(u,e));var q=this.yc();return u.$process_person_profile=q,q&&!n&&this.bc("_calculate_event_properties"),u}vc(e,t,i){if(void 0===t&&(t=!0),void 0===i&&(i=!1),!this.persistence||!this.yc()||this.Tu&&!i)return e;var s,r=t3({},this.persistence.get_initial_props(),(null==(s=this.sessionPropsManager)?void 0:s.getSetOnceProps())||{},e||{}),n=this.config.sanitize_properties;return n&&(ti.error(rC),r=n(r,"$set_once")),t&&(this.Tu=!0),A(r)?void 0:r}register(e,t){var i;null==(i=this.persistence)||i.register(e,t)}register_once(e,t,i){var s;null==(s=this.persistence)||s.register_once(e,t,i)}register_for_session(e){var t,i;null==(t=this.persistence)||t.syncCookieProperties(),this.gc(),null==(i=this.sessionPersistence)||i.register(e),Object.keys(e).forEach(e=>this.Iu.add(e)),this.mc()}unregister(e){var t;null==(t=this.persistence)||t.unregister(e)}unregister_for_session(e){var t;null==(t=this.sessionPersistence)||t.unregister(e),this.Iu.delete(e),this.mc()}_c(e,t){this.register({[e]:t})}zu(){this.Iu.forEach(e=>{var t;null==(t=this.sessionPersistence)||t.unregister(e)}),this.Iu.clear(),this.mc()}mc(){var e;if(this.Mu)if("memory"===this.config.persistence||null!=(e=this.sessionPersistence)&&e.hi||!iP.At())iP.Pt(this.Mu);else{var t=[];this.Iu.forEach(e=>t.push(e)),t.length>0?iP.$t(this.Mu,t):iP.Pt(this.Mu)}}getFeatureFlag(e,t){var i;return null==(i=this.featureFlags)?void 0:i.getFeatureFlag(e,t)}getFeatureFlagPayload(e){var t;return null==(t=this.featureFlags)?void 0:t.getFeatureFlagPayload(e)}getFeatureFlagResult(e,t){var i;return null==(i=this.featureFlags)?void 0:i.getFeatureFlagResult(e,t)}getAllFeatureFlags(){var e,t;return null!=(e=null==(t=this.featureFlags)?void 0:t.getAllFeatureFlags())?e:[]}isFeatureEnabled(e,t){var i,s;return null!=(i=null==(s=this.featureFlags)?void 0:s.isFeatureEnabled(e,t))?i:null==t?void 0:t.defaultValue}reloadFeatureFlags(){var e;null==(e=this.featureFlags)||e.reloadFeatureFlags()}updateFlags(e,t,i){var s;null==(s=this.featureFlags)||s.updateFlags(e,t,i)}updateEarlyAccessFeatureEnrollment(e,t,i){var s;null==(s=this.featureFlags)||s.updateEarlyAccessFeatureEnrollment(e,t,i)}getEarlyAccessFeatures(e,t,i){var s;return void 0===t&&(t=!1),null==(s=this.featureFlags)?void 0:s.getEarlyAccessFeatures(e,t,i)}on(e,t){return this.uu.on(e,t)}onFeatureFlags(e){return this.featureFlags?this.featureFlags.onFeatureFlags(e):(e([],{},{errorsLoading:!0}),()=>{})}onSurveysLoaded(e){return this.surveys?this.surveys.onSurveysLoaded(e):(e([],{isLoaded:!1,error:rM}),()=>{})}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?this.surveys.getSurveys(e,t):e([],{isLoaded:!1,error:rM})}getActiveMatchingSurveys(e,t){void 0===t&&(t=!1),this.surveys?this.surveys.getActiveMatchingSurveys(e,t):e([],{isLoaded:!1,error:rM})}onActiveMatchingSurveysChanged(e){return this.surveys?this.surveys.onActiveMatchingSurveysChanged(e):(e([],{isLoaded:!1,error:rM}),()=>{})}renderSurvey(e,t){var i;null==(i=this.surveys)||i.renderSurvey(e,t)}displaySurvey(e,t){var i;void 0===t&&(t=rb),null==(i=this.surveys)||i.displaySurvey(e,t)}cancelPendingSurvey(e){var t;null==(t=this.surveys)||t.cancelPendingSurvey(e)}canRenderSurvey(e){var t,i;return null!=(t=null==(i=this.surveys)?void 0:i.canRenderSurvey(e))?t:{visible:!1,disabledReason:rM}}canRenderSurveyAsync(e,t){var i,s;return void 0===t&&(t=!1),null!=(i=null==(s=this.surveys)?void 0:s.canRenderSurveyAsync(e,t))?i:Promise.resolve({visible:!1,disabledReason:rM})}wc(e){return!e||R(e)?(ti.critical("Unique user id has not been set in posthog.identify"),!1):"$posthog_cookieless"===e?(ti.critical('The string "'+e+'" was set in posthog.identify which indicates an error. This ID is only used as a sentinel value.'),!1):!["distinct_id","distinctid"].includes(e.toLowerCase())&&!["undefined","null"].includes(e.toLowerCase())||(ti.critical('The string "'+e+'" was set in posthog.identify which indicates an error. This ID should be unique to the user and not a hardcoded string.'),!1)}identify(e,t,i){if(!this.__loaded||!this.persistence)return ti.uninitializedWarning("posthog.identify");if(L(e)&&(e=e.toString(),ti.warn("The first argument to posthog.identify was a number, but it should be a string. It has been converted to a string.")),this.wc(e)&&this.bc("posthog.identify")){this._u();var s=this.get_distinct_id(),r=this.persistence.syncCookieProperties()&&this.get_distinct_id()!==s,n=this.gc(!1),o=this.persistence.Da(),a=!1;try{var l=this.get_distinct_id();this.register({$user_id:e}),this.get_property("$device_id")||this.register_once({$had_persisted_distinct_id:!0,$device_id:l},""),e!==l&&e!==this.get_property("__alias")&&(this.unregister(tk),this.register({distinct_id:e}));var u=(this.persistence.get_property("$user_state")||"anonymous")===tW,h=e!==l,c=!h&&u;if(h&&u){var d,p=this.config.reuseAnonymousId?{distinct_id:e}:{distinct_id:e,$anon_distinct_id:l};this.persistence.set_property(tD,tJ),this.setPersonPropertiesForFlags({$set:t||{},$set_once:i||{}},!1),this.config.cookieWinsOnConflict&&this.persistence.La(),this.capture("$identify",p,{$set:t||{},$set_once:i||{}})&&(this.Ou=rh(e,t,i)),null==(d=this.featureFlags)||d.setAnonymousDistinctId(this.config.reuseAnonymousId?void 0:l)}else if(c){this.persistence.set_property(tD,tJ);var g=t||{},_=i||{};this.setPersonPropertiesForFlags({$set:g,$set_once:_},!1),this.config.cookieWinsOnConflict&&this.persistence.La(),this.capture("$set",{$set:g,$set_once:_})&&(this.Ou=rh(e,t,i))}else(t||i)&&this.setPersonProperties(t,i);h||r||n?(this.reloadFeatureFlags(),this.featureFlags?this.featureFlags.resetFlagCallReported():this.unregister(tm)):c&&(t||i)&&this.reloadFeatureFlags(),a=!0}finally{o&&this.persistence.ja(a)}}}setPersonProperties(e,t){if((e||t)&&this.bc("posthog.setPersonProperties")){var i=rh(this.get_distinct_id(),e,t);this.Ou!==i?(this.setPersonPropertiesForFlags({$set:e||{},$set_once:t||{}},!0),this.capture("$set",{$set:e||{},$set_once:t||{}})&&(this.Ou=i)):ti.info("A duplicate setPersonProperties call was made with the same properties. It has been ignored.")}}unsetPersonProperties(e){var t,i=(I(e)?e:[e]).filter(e=>T(e)&&e.length>0);0!==i.length&&this.bc("posthog.unsetPersonProperties")&&(null==(t=this.featureFlags)||t.unsetPersonPropertiesForFlags(i,!0),this.capture("$set",{$unset:i}),this.Ou=null)}group(e,t,i){var s;if(e&&t){null==(s=this.persistence)||s.syncCookieProperties(),this.gc();var n=this.getGroups(),o=n[e]!==t;if(o&&this.resetGroupPropertiesForFlags(e),this.register({$groups:r({},n,{[e]:t})}),(o||i)&&this.yc()){var a={$group_type:e,$group_key:t};i&&(a.$group_set=i),this.capture(t0,a)}i&&this.setGroupPropertiesForFlags({[e]:i}),o&&!i&&this.reloadFeatureFlags()}else ti.error("posthog.group requires a group type and group key")}resetGroups(){this.register({$groups:{}}),this.resetGroupPropertiesForFlags(),this.reloadFeatureFlags()}setPersonPropertiesForFlags(e,t){var i;void 0===t&&(t=!0),null==(i=this.featureFlags)||i.setPersonPropertiesForFlags(e,t)}resetPersonPropertiesForFlags(e){var t;void 0===e&&(e=!0),null==(t=this.featureFlags)||t.resetPersonPropertiesForFlags(e)}setGroupPropertiesForFlags(e,t){var i;void 0===t&&(t=!0),this.bc("posthog.setGroupPropertiesForFlags")&&(null==(i=this.featureFlags)||i.setGroupPropertiesForFlags(e,t))}resetGroupPropertiesForFlags(e){var t;null==(t=this.featureFlags)||t.resetGroupPropertiesForFlags(e)}reset(e){var t=q(e)?e:null==e?void 0:e.resetDeviceID,i=q(e)||null==e?void 0:e.bootstrap;this.kc(t,!1,i)}kc(e,t,i){if(void 0===t&&(t=!1),ti.info("reset"),!this.__loaded)return ti.uninitializedWarning("posthog.reset");var s,n,o,a,l,u,h,c,d,p,g,_,f,v,m,y,b,w,x=null==i?void 0:i.sessionID;this.config.bootstrap=i||(null==(s=this.Lu)?void 0:s.bootstrap)||{},null==(n=this.featureFlags)||null==n.updateConfig||n.updateConfig(this.config,this._shouldDisableFlags());var $=this.get_property(tx),k=this.get_property(t$),S=this.get_property(tC);null==(o=this.sessionRecording)||o.flushBeforeIdentityReset();var E=this.is_capturing();t||this.consent.reset(),t||!E||this.is_capturing()||console.warn("[PostHog.js]","reset() cleared the stored consent, and capturing is now off because of `opt_out_capturing_by_default`. Call opt_in_capturing() again, and prefer calling reset() before opting in rather than after.");var P=null==(a=this.persistence)||null==a.Da?void 0:a.Da(),O=this.wu;this.wu=O||t;var I=!1;try{if(null==(l=this.persistence)||l.clear(),null==(u=this.sessionPersistence)||u.clear(),this.Iu.clear(),this.mc(),F(S)||null==(h=this.persistence)||h.register({[tC]:S}),null==(c=this.surveys)||c.reset(),null==(d=this.featureFlags)||d.reset(),null==(p=this.conversations)||p.reset(),null==(g=this.logs)||g.reset(),null==(_=this.metrics)||_.reset(),null==(f=this.persistence)||f.set_property(tD,tW),null==(v=this.sessionManager)||v.resetSessionId(),this.Ou=null,"always"===this.config.cookieless_mode)this.register_once({distinct_id:tH,$device_id:null},"");else{var M=this.config.get_device_id(io());this.register_once({distinct_id:M,$device_id:e?M:$},""),e||F(k)||this.register({[t$]:k})}if(this.register({$last_posthog_reset:(new Date).toISOString()},1),i&&(i.distinctID&&!this.gu()&&(null==(b=this.persistence)||b.set_property(tD,i.isIdentifiedID?tJ:tW),this.register({distinct_id:i.distinctID})),null==(m=this.featureFlags)||m.initialize(),!(D(x)||null!=(y=this.sessionManager)&&y.setBootstrapSessionId(x,!0)))){var C=r({},i);delete C.sessionID,this.config.bootstrap=C}delete this.config.identity_distinct_id,delete this.config.identity_hash,delete this.config.identity_claims,I=!0}finally{this.wu=O,P&&(null==(w=this.persistence)||null==w.ja||w.ja(I))}this.reloadFeatureFlags()}shutdown(e){var t=this;return o(function*(){if(t.__loaded){t.Cu=!0,clearTimeout(t.Uu),t.Uu=void 0;var e=t.Ju;for(var i of(t.Ju=void 0,[()=>{var e;return null==(e=t.sessionRecording)?void 0:e.dispose()},()=>{var e;return null==(e=t.logs)?void 0:e.flushLogs("sendBeacon")},()=>{var e;return null==(e=t.metrics)?void 0:e.flush("sendBeacon")},()=>{var e;return null==(e=t.metrics)?void 0:e.dispose()},()=>{var e;return null==(e=t.logs)?void 0:e.dispose()},()=>{var e;return null==(e=t.surveys)?void 0:e.dispose()},()=>{var e;return null==(e=t.autocapture)?void 0:e.dispose()},()=>null==e?void 0:e(),()=>{var e;return null==(e=t.qu)?void 0:e.unload()},()=>{var e;return null==(e=t.Bu)?void 0:e.unload()},()=>{var e;return null==(e=t.featureFlags)?void 0:e.destroy()},()=>{var e;return null==(e=t.persistence)?void 0:e.destroy()},()=>{var e;return null==(e=t.sessionPersistence)?void 0:e.destroy()}]))try{var s=i();s&&M(s.then)&&s.then(void 0,e=>{ti.error("Error during shutdown",e)})}catch(e){ti.error("Error during shutdown",e)}}else ti.uninitializedWarning("posthog.shutdown")})()}setIdentity(e,t){var i;delete this.config.identity_claims,this.config.identity_distinct_id=e,this.config.identity_hash=t,this.alias(e),null==(i=this.conversations)||i._onIdentityChanged()}clearIdentity(){var e;delete this.config.identity_distinct_id,delete this.config.identity_hash,delete this.config.identity_claims,null==(e=this.conversations)||e._onIdentityCleared()}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 t=this.sessionManager.checkAndGetSessionAndWindowId(!0),i=t.sessionStartTimestamp,s=this.requestRouter.endpointFor("ui","/project/"+this.config.token+"/replay/"+t.sessionId);if(null!=e&&e.withTimestamp&&i){var r,n=null!=(r=e.timestampLookBack)?r:10;if(!i)return s;s+="?t="+Math.max(Math.floor(((new Date).getTime()-i)/1e3)-n,0)}return s}alias(e,t){return e===this.get_property("$people_distinct_id")?(ti.critical("Attempting to create alias for existing People user - aborting."),-2):this.bc("posthog.alias")?(F(t)&&(t=this.get_distinct_id()),e!==t?(this._c(tk,e),this.capture("$create_alias",{alias:e,distinct_id:t})):(ti.warn("alias matches current distinct_id - skipping api call."),this.identify(e),-1)):void 0}set_config(e){var t=r({},this.config);if(C(e)){t3(this.config,rH(e));var i=this.xu();if(this.persistence){var s,n,o,a,l,u,h,c,d,p,g,_,f,v,m,y,w,x="sessionStorage"===this.config.persistence||"memory"===this.config.persistence;x&&this.sessionPersistence!==this.persistence&&(null==(y=this.sessionPersistence)||y.remove(),null==(w=this.sessionPersistence)||w.destroy()),this.persistence.update_config(this.config,t,i),x?this.sessionPersistence=this.persistence:this.sessionPersistence===this.persistence?this.sessionPersistence=new ss(r({},this.config,{persistence:"sessionStorage"}),i,!1):null==(m=this.sessionPersistence)||m.update_config(r({},this.config,{persistence:"sessionStorage"}),r({},t,{persistence:"sessionStorage"}),i)}var $=this.Du(this.config.debug);q($)&&(this.config.debug=$),q(this.config.debug)&&(this.config.debug?(b.DEBUG=!0,ip.At()&&ip.$t("ph_debug",!0),ti.info("set_config",{config:e,oldConfig:t,newConfig:r({},this.config)})):(b.DEBUG=!1,ip.At()&&ip.Pt("ph_debug"))),null==(s=this.featureFlags)||null==s.updateConfig||s.updateConfig(this.config,this._shouldDisableFlags()),null==(n=this.exceptionObserver)||n.onConfigChange(),null==(o=this.exceptions)||o.onConfigChange(),null==(a=this.metrics)||a.onConfigChange(),null==(l=this.webMCP)||l.startIfEnabled(),null==(u=this.sessionRecording)||u.startIfEnabledOrStop(),null==(h=this.tracingHeaders)||h.startIfEnabledOrStop(),null==(c=this.autocapture)||c.startIfEnabled(),null==(d=this.heatmaps)||d.startIfEnabled(),("capture_pageview"in e||"disable_capture_url_hashes"in e)&&(null==(p=this.historyAutocapture)||p.startIfEnabledOrStop()),null==(g=this.exceptionObserver)||g.startIfEnabledOrStop(),null==(_=this.deadClicksAutocapture)||_.startIfEnabledOrStop(),null==(f=this.surveys)||f.loadIfEnabled(),this.ku(),null==(v=this.externalIntegrations)||v.startIfEnabledOrStop(),!t.segment&&this.config.segment&&this.persistence&&iA(this,rO,!1)}}_overrideSDKInfo(e,t){b.LIB_NAME=e,b.LIB_VERSION=t}startSessionRecording(e){var t,i,s,r,n,o=!0===e,a={sampling:o||!(null==e||!e.sampling),linked_flag:o||!(null==e||!e.linked_flag),url_trigger:o||!(null==e||!e.url_trigger),event_trigger:o||!(null==e||!e.event_trigger)};Object.values(a).some(Boolean)&&(null==(t=this.sessionManager)||t.checkAndGetSessionAndWindowId(),a.sampling&&(null==(i=this.sessionRecording)||i.overrideSampling()),a.linked_flag&&(null==(s=this.sessionRecording)||s.overrideLinkedFlag()),a.url_trigger&&(null==(r=this.sessionRecording)||r.overrideTrigger("url")),a.event_trigger&&(null==(n=this.sessionRecording)||n.overrideTrigger("event"))),this.set_config({disable_session_recording:!1})}stopSessionRecording(){this.set_config({disable_session_recording:!0})}sessionRecordingStarted(){var e;return!(null==(e=this.sessionRecording)||!e.started)}captureException(e,t){try{if(!this.exceptions)return;var i=this.exceptions.buildProperties(e,{handled:!0,syntheticException:Error("PostHog syntheticException")});return this.exceptions.sendExceptionEvent(r({},i,t))}catch(e){return}}addExceptionStep(e,t){var i;null==(i=this.exceptions)||i.addExceptionStep(e,t)}captureLog(e){var t;null==(t=this.logs)||t.captureLog(e)}get logger(){var t,i;return null!=(t=null==(i=this.logs)?void 0:i.logger)?t:e.$c}startExceptionAutocapture(e){this.set_config({capture_exceptions:null==e||e})}stopExceptionAutocapture(){this.set_config({capture_exceptions:!1})}loadToolbar(e){var t,i;return null!=(t=null==(i=this.toolbar)?void 0:i.loadToolbar(e))&&t}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:rN;return t!==rN&&(t="posthog."+t),t}_isIdentified(){var e,t;return"identified"===(null==(e=this.persistence)?void 0:e.get_property("$user_state"))||"identified"===(null==(t=this.sessionPersistence)?void 0:t.get_property("$user_state"))}yc(){var e,t;return!("never"===this.config.person_profiles||"identified_only"===this.config.person_profiles&&!this._isIdentified()&&A(this.getGroups())&&(null==(e=this.persistence)||null==(e=e.props)||!e.__alias)&&(null==(t=this.persistence)||null==(t=t.props)||!t.$epp))}nc(){return!0===this.config.capture_pageleave||"if_capture_pageview"===this.config.capture_pageleave&&!!this.config.capture_pageview}createPersonProfile(){this.yc()||this.bc("posthog.createPersonProfile")&&this.setPersonProperties({},{})}setInternalOrTestUser(){this.bc("posthog.setInternalOrTestUser")&&this.setPersonProperties({$internal_or_test_user:!0})}bc(e){return"never"===this.config.person_profiles?(ti.error(e+' was called, but process_person is set to "never". This call will be ignored.'),!1):(this.mu(),this._c(tG,!0),!0)}xu(){if("always"===this.config.cookieless_mode)return!0;var e=this.consent.isOptedOut();return this.config.disable_persistence||e&&!(!this.config.opt_out_persistence_by_default&&"on_reject"!==this.config.cookieless_mode)}ku(){var e,t,i,s,r,n=this.xu();return this.is_capturing()||null==(e=this.logs)||e._onOptOut(),(null==(t=this.persistence)?void 0:t.hi)!==n&&(null==(i=this.persistence)||i.set_disabled(n)),(null==(s=this.sessionPersistence)?void 0:s.hi)!==n&&(null==(r=this.sessionPersistence)||r.set_disabled(n)),this.mc(),n}opt_in_capturing(t){var i,s,r;if("always"!==this.config.cookieless_mode){if(this.gu()){null==(n=this.sessionRecording)||n.dispose({discardBufferedEvents:!0}),this.kc(!0,!0),null==(o=this.sessionManager)||o.destroy(),null==(a=this.pageViewManager)||a.destroy(),this.sessionManager=new rl(this),this.pageViewManager=new iD(this),this.persistence&&(this.sessionPropsManager=new rn(this,this.sessionManager,this.persistence));var n,o,a,l,u,h,c,d=null!=(l=null==(u=this.config.__extensionClasses)?void 0:u.sessionRecording)?l:null==(h=e.__defaultExtensionClasses)?void 0:h.sessionRecording;d&&(this.sessionRecording=this.pu(this.sessionRecording,new d(this)),this.cu&&(null==(c=this.sessionRecording)||null==c.onRemoteConfig||c.onRemoteConfig(this.cu)))}this.consent.optInOut(!0),this.ku(),this.Yu(),null==(i=this.sessionRecording)||i.startIfEnabledOrStop(),"on_reject"==this.config.cookieless_mode&&(null==(s=this.surveys)||s.loadIfEnabled()),(F(null==t?void 0:t.captureEventName)||null!=t&&t.captureEventName)&&this.capture(null!=(r=null==t?void 0:t.captureEventName)?r:"$opt_in",null==t?void 0:t.captureProperties,{send_instantly:!0}),this.config.capture_pageview&&this.tc()}else ti.warn(rI)}opt_out_capturing(){"always"!==this.config.cookieless_mode?(this.consent.optInOut(!1),this.ku(),"on_reject"===this.config.cookieless_mode&&this.Su()):ti.warn(rI)}Su(){var e,t,i=this.sessionRecording;null==i||i.dispose({discardBufferedEvents:!0}),"$posthog_cookieless"!==this.get_distinct_id()&&this.kc(!0,!0),this.register({distinct_id:tH,$device_id:null}),this.vu(i),this.sessionRecording=void 0,null==(e=this.sessionManager)||e.destroy(),null==(t=this.pageViewManager)||t.destroy(),this.sessionManager=void 0,this.sessionPropsManager=void 0,this.config.capture_pageview&&this.tc(),this.Yu()}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 1===e?"granted":0===e?"denied":"pending"}is_capturing(){return!this.wu&&("always"===this.config.cookieless_mode||("on_reject"===this.config.cookieless_mode?this.consent.isRejected()||this.consent.isOptedIn():!this.has_opted_out_capturing()))}clear_opt_in_out_capturing(){this.consent.reset(),this.ku()}_is_bot(){return u?function(e,t){if(!e)return!1;var i=e.userAgent;if(i&&W(i,t))return!0;try{var s=null==e?void 0:e.userAgentData;if(null!=s&&s.brands&&s.brands.some(e=>W(null==e?void 0:e.brand,t)))return!0}catch(e){}return!!e.webdriver}(u,this.config.custom_blocked_useragents):void 0}tc(){h&&("visible"===h.visibilityState?this.Ru||(this.Ru=!0,this.capture(tX,{title:h.title},{send_instantly:!0}),this.Au&&(h.removeEventListener(tb,this.Au),this.Au=null)):this.Au||(this.Au=this.tc.bind(this),t7(h,tb,this.Au)))}debug(e){!1===e?(null==a||a.console.log("You've disabled debug mode."),this.set_config({debug:!1})):(null==a||a.console.log("You're now in debug mode. All calls to PostHog will be logged in your console.\nYou can disable this with `posthog.debug(false)`."),this.set_config({debug:!0}))}_shouldDisableFlags(){var e,t,i,s,r=this.Lu||{};return"advanced_disable_flags"in r?!!r.advanced_disable_flags:!1!==this.config.advanced_disable_flags?!!this.config.advanced_disable_flags:!0===this.config.advanced_disable_decide?(ti.warn("Config field 'advanced_disable_decide' is deprecated. Please use 'advanced_disable_flags' instead. The old field will be removed in a future major version."),!0):(t="advanced_disable_decide",i=(e="advanced_disable_flags")in r&&!D(r[e]),s=t in r&&!D(r[t]),i?r[e]:!!s&&(ti&&ti.warn("Config field '"+t+"' is deprecated. Please use '"+e+"' instead. The old field will be removed in a future major version."),r[t]))}Os(e){if(D(this.config.before_send))return e;var t,i=Object.keys(null!=(t=e.properties)?t:{}).filter(j),s=I(this.config.before_send)?this.config.before_send:[this.config.before_send],r=e;for(var n of s)try{if(r=n(r),D(r)){var o="Event '"+e.event+"' was rejected in beforeSend function";return N(e.event)?ti.warn(o+". This can cause unexpected behavior."):ti.info(o),null}r.properties&&!A(r.properties)||ti.warn("Event '"+e.event+"' has no properties after beforeSend function, this is likely an error.")}catch(t){return ti.error("Error in beforeSend function for event '"+e.event+"':",t),null}for(var a of i)if(r.properties&&D(r.properties[a]))return ti.warn("Event '"+e.event+"' had its '"+a+"' property removed in a beforeSend function. This property is required for ingestion, so the event will be dropped."),null;return r}getPageViewId(){var e;return null==(e=this.pageViewManager.Vo)?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)})}Du(e){var t=q(e)&&!e,i=ip.At()&&"true"===ip.Ot("ph_debug");return!t&&(!!i||e)}}).__defaultExtensionClasses={},i.$c={trace:rp=()=>{},debug:rp,info:rp,warn:rp,error:rp,fatal:rp},i),rV=["identify"],rW=0;rV.length>rW;rW++)rU.prototype[rV[rW]]=t5(rU.prototype[rV[rW]]);var rJ=(b.SDK_DIST_CHANNEL="npm",t=rE[rN]=new rU,function(){function e(){e.done||(e.done=!0,s9=!1,t2(rE,function(e){e._dom_loaded()}))}null!=h&&h.addEventListener?"complete"===h.readyState?e():t7(h,"DOMContentLoaded",e,{capture:!1}):a&&ti.error("Browser doesn't support `document.addEventListener` so PostHog couldn't be initialized")}(),t);e.s(["f",0,rJ])}]); //# sourceMappingURL=2vvtgd4ol9fma.js.map