@funnel10x/tracking 1.4.0 → 2.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -1,15 +1,13 @@
1
- var b="u">typeof window?window:void 0,be="u">typeof globalThis?globalThis:b,pe=be==null?void 0:be.navigator,E=be==null?void 0:be.document,K=be==null?void 0:be.location,Ii=be==null?void 0:be.fetch,sr=be!=null&&be.XMLHttpRequest&&"withCredentials"in new be.XMLHttpRequest?be.XMLHttpRequest:void 0,so=be==null?void 0:be.AbortController,ld=be==null?void 0:be.CompressionStream,xe=pe==null?void 0:pe.userAgent,ai=typeof globalThis!="undefined"?globalThis:b;ai&&typeof self=="undefined"&&(ai.self=ai),ai&&typeof File=="undefined"&&(ai.File=function(){});var F=b!=null?b:{},no="0.9.2",st={DEBUG:!1,LIB_VERSION:no,LIB_NAME:"browser-common",JS_SDK_VERSION:no},Ye=(function(e){return e.AnonymousId="anonymous_id",e.DistinctId="distinct_id",e.Props="props",e.EnablePersonProcessing="enable_person_processing",e.PersonMode="person_mode",e.FeatureFlagDetails="feature_flag_details",e.FeatureFlags="feature_flags",e.FeatureFlagPayloads="feature_flag_payloads",e.BootstrapFeatureFlagDetails="bootstrap_feature_flag_details",e.BootstrapFeatureFlags="bootstrap_feature_flags",e.BootstrapFeatureFlagPayloads="bootstrap_feature_flag_payloads",e.OverrideFeatureFlags="override_feature_flags",e.Queue="queue",e.AiQueue="ai_queue",e.AiCaptureQueue="ai_capture_queue",e.LogsQueue="logs_queue",e.OptedOut="opted_out",e.SessionId="session_id",e.SessionStartTimestamp="session_start_timestamp",e.SessionLastTimestamp="session_timestamp",e.PersonProperties="person_properties",e.GroupProperties="group_properties",e.InstalledAppBuild="installed_app_build",e.InstalledAppVersion="installed_app_version",e.SessionReplay="session_replay",e.PushRegistered="push_registered",e.SessionReplayEventTriggerActivatedSession="session_replay_event_trigger_activated_session",e.SurveyLastSeenDate="survey_last_seen_date",e.SurveysInProgress="surveys_in_progress",e.SurveysSeen="surveys_seen",e.Surveys="surveys",e.RemoteConfig="remote_config",e.FlagsEndpointWasHit="flags_endpoint_was_hit",e.DeviceId="device_id",e})({}),$n=(function(e){return e.GZipJS="gzip-js",e.Base64="base64",e})({}),cd=["$snapshot","$pageview","$pageleave","$set","survey dismissed","survey sent","survey shown","$identify","$groupidentify","$create_alias","$$client_ingestion_warning","$web_experiment_applied","$feature_enrollment_update","$feature_flag_called"],ud=["token"];function O(e,t){return e.indexOf(t)!==-1}var Zt=function(e){return e.trim()},Pn=function(e){return e.replace(/^\$/,"")};function ja(e){var t;let i=[];return(t=JSON.stringify(e,function(s,n){if(typeof n=="bigint")return n.toString();if(typeof n!="function"&&typeof n!="symbol"){if(n instanceof Error)return{name:n.name,message:n.message,stack:n.stack};if(n&&typeof n=="object"){for(;i.length>0&&i[i.length-1]!==this;)i.pop();if(i.includes(n))return"[Circular]";i.push(n)}return n}}))!==null&&t!==void 0?t:"null"}var Va=Object.prototype,nr=Va.hasOwnProperty,Ms=Va.toString,R=Array.isArray||function(e){return Ms.call(e)==="[object Array]"},le=e=>typeof e=="function",j=e=>e===Object(e)&&!R(e),Me=e=>{if(j(e)){for(let t in e)if(nr.call(e,t))return!1;return!0}return!1},x=e=>e===void 0,H=e=>Ms.call(e)=="[object String]",yi=e=>H(e)&&e.trim().length===0,ne=e=>e===null,D=e=>x(e)||ne(e),oe=e=>Ms.call(e)=="[object Number]"&&e==e,Qe=e=>oe(e)&&e>0,Se=e=>Ms.call(e)==="[object Boolean]",dd=e=>O(cd,e),hd=e=>O(ud,e);function Ha(e){return e===null||typeof e!="object"}function ls(e,t){return{}.toString.call(e)===`[object ${t}]`}function ii(e){switch({}.toString.call(e)){case"[object Error]":case"[object Exception]":case"[object DOMException]":case"[object DOMError]":case"[object WebAssembly.Exception]":return!0;default:return Ba(e,Error)}}function rr(e){return"u">typeof Event&&Ba(e,Event)}function Ba(e,t){try{return e instanceof t}catch{return!1}}var pd=[!0,"true",1,"1","yes"],js=e=>O(pd,e),fd=[!1,"false",0,"0","no"];function ro(e,t,i,s,n,r,o){try{var a=e[r](o),l=a.value}catch(c){return void i(c)}a.done?t(l):Promise.resolve(l).then(s,n)}function ee(e){return function(){var t=this,i=arguments;return new Promise(function(s,n){var r=e.apply(t,i);function o(l){ro(r,s,n,o,a,"next",l)}function a(l){ro(r,s,n,o,a,"throw",l)}o(void 0)})}}var vd=["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"],zi=new Map,oo=function(e,t=[]){if(!e)return!1;let i=(function(o,a){let l="";for(let c=0;a.length>c;c++){let u=a[c];l+=u.length+":"+u}return o.length+":"+o+"|"+a.length+":"+l})(e,t),s=zi.get(i);if(s!==void 0)return s;let n=e.toLowerCase(),r=vd.concat(t).some(o=>n.indexOf(o.toLowerCase())!==-1);return 256>zi.size||zi.clear(),zi.set(i,r),r};function Xe(e,t,i,s,n){return t>i&&(s.warn("min cannot be greater than max."),t=i),oe(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: "+n),Xe(n!=null?n:i,t,i,s))}var gd=class{constructor(e){this.C={},this.I=e.I,this.R=Xe(e.bucketSize,0,100,e.A),this.$=Xe(e.refillRate,0,this.R,e.A),this.O=Xe(e.refillInterval,0,864e5,e.A)}F(e,t){let i=Math.floor((t-e.lastAccess)/this.O);i>0&&(e.tokens=Math.min(e.tokens+i*this.$,this.R),e.lastAccess=e.lastAccess+i*this.O)}consumeRateLimit(e){var t;let i=Date.now(),s=String(e),n=this.C[s];return n?this.F(n,i):(n={tokens:this.R,lastAccess:i},this.C[s]=n),n.tokens===0||(n.tokens--,n.tokens===0&&((t=this.I)===null||t===void 0||t.call(this,e)),n.tokens===0)}stop(){this.C={}}},Yt="Mobile",Ai="Android",cs="Tablet",Wa="Android Tablet",Ua="iPad",za="Apple Watch",es="Safari",Ts="BlackBerry",Ga="Samsung Internet",ts="Chrome",qa="Chrome iOS",Za="Internet Explorer",Ya="Internet Explorer Mobile",Xa="Opera",Ja="Microsoft Edge",is="Firefox",Ka="Firefox iOS",us="Nintendo",ds="PlayStation",Is="Xbox",Qa="Android Mobile",el="Mobile Safari",Vs="Windows",tl="Windows Phone",ao="Nokia",Mn="Ouya",_d="Generic "+Yt.toLowerCase(),il="Generic "+cs.toLowerCase(),Tn="Konqueror",sl="Oculus Browser",nl="Vivaldi",rl="Yandex",ol="Whale",al="DuckDuckGo",ll="Pale Moon",cl="Waterfox",In="Brave",ul="Claude",dl="Codex",hl="ChatGPT",pl="Google Search App",Hs=new RegExp("Version/(\\d+(\\.\\d+)?)"),Bs=new RegExp("(Claude|Codex|ChatGPT)\\/(\\d+(\\.\\d+)?)"),md=new RegExp(Is,"i"),yd=new RegExp("PlayStation \\w+","i"),bd=new RegExp("Nintendo \\w+","i"),or=new RegExp("BlackBerry|PlayBook|BB10","i"),wd={"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"},fl=function(e,t,i,s){return t=t||"",(function(r){return r!=null&&r.brave?In:null})(i)||(s!=null&&s.detectGoogleSearchApp&&O(e,"GSA/")?pl:O(e," OPR/")&&O(e,"Mini")?"Opera Mini":O(e," OPR/")?Xa:or.test(e)?Ts:O(e,"IEMobile")||O(e,"WPDesktop")?Ya:O(e,"OculusBrowser")?sl:O(e,"SamsungBrowser")?Ga:O(e,"Edge")||O(e,"Edg/")?Ja:O(e,"Vivaldi/")?nl:O(e,"YaBrowser/")?rl:O(e,"Whale/")?ol:O(e,"DuckDuckGo/")||O(e,"Ddg/")?al:O(e,"Claude/")?ul:O(e,"Codex/")?dl:O(e,"ChatGPT/")?hl:O(e,"FBIOS")?"Facebook Mobile":O(e,"UCWEB")||O(e,"UCBrowser")?"UC Browser":O(e,"CriOS")?qa:O(e,"CrMo")||O(e,ts)?ts:O(e,Ai)&&O(e,es)?Qa:O(e,"FxiOS")?Ka:O(e.toLowerCase(),Tn.toLowerCase())?Tn:O(e,"Brave/")?In:((r,o)=>o&&O(o,"Apple")||(function(a){return O(a,es)&&!O(a,ts)&&!O(a,Ai)})(r))(e,t)?O(e,Yt)?el:es:O(e,"PaleMoon/")?ll:O(e,"Waterfox/")?cl:O(e,is)?is:O(e,"MSIE")||O(e,"Trident/")?Za:O(e,"Gecko")?is:"")},xd={[Ya]:[new RegExp("rv:(\\d+(\\.\\d+)?)")],[Ja]:[new RegExp("Edge?\\/(\\d+(\\.\\d+)?)")],[ts]:[new RegExp("(Chrome|CrMo)\\/(\\d+(\\.\\d+)?)")],[qa]:[new RegExp("CriOS\\/(\\d+(\\.\\d+)?)")],"UC Browser":[new RegExp("(UCBrowser|UCWEB)\\/(\\d+(\\.\\d+)?)")],[es]:[Hs],[el]:[Hs],[Xa]:[new RegExp("(Opera|OPR)\\/(\\d+(\\.\\d+)?)")],[is]:[new RegExp("Firefox\\/(\\d+(\\.\\d+)?)")],[Ka]:[new RegExp("FxiOS\\/(\\d+(\\.\\d+)?)")],[Tn]:[new RegExp("Konqueror[:/]?(\\d+(\\.\\d+)?)","i")],[Ts]:[new RegExp("BlackBerry (\\d+(\\.\\d+)?)"),Hs],[Qa]:[new RegExp("android\\s(\\d+(\\.\\d+)?)","i")],[Ga]:[new RegExp("SamsungBrowser\\/(\\d+(\\.\\d+)?)")],[sl]:[new RegExp("OculusBrowser\\/(\\d+(\\.\\d+)?)")],[nl]:[new RegExp("Vivaldi\\/(\\d+(\\.\\d+)?)")],[rl]:[new RegExp("YaBrowser\\/(\\d+(\\.\\d+)?)")],[ol]:[new RegExp("Whale\\/(\\d+(\\.\\d+)?)")],[In]:[new RegExp("Brave\\/(\\d+(\\.\\d+)?)")],[ul]:[Bs],[dl]:[Bs],[hl]:[Bs],[al]:[new RegExp("(DuckDuckGo|Ddg)\\/(\\d+(\\.\\d+)?)")],[ll]:[new RegExp("PaleMoon\\/(\\d+(\\.\\d+)?)")],[cl]:[new RegExp("Waterfox\\/(\\d+(\\.\\d+)?)")],[pl]:[new RegExp("GSA\\/(\\d+(\\.\\d+)?)")],[Za]:[new RegExp("(rv:|MSIE )(\\d+(\\.\\d+)?)")],Mozilla:[new RegExp("rv:(\\d+(\\.\\d+)?)")]},kd=function(e,t,i,s){let n=fl(e,t,i,s),r=xd[n];if(x(r))return null;for(let o=0;r.length>o;o++){let a=e.match(r[o]);if(a)return parseFloat(a[a.length-2])}return null},lo=[[new RegExp("Xbox; Xbox (.*?)[);]","i"),e=>[Is,e&&e[1]||""]],[new RegExp(us,"i"),[us,""]],[new RegExp(ds,"i"),[ds,""]],[or,[Ts,""]],[new RegExp(Vs,"i"),(e,t)=>{if(/Phone/.test(t)||/WPDesktop/.test(t))return[tl,""];if(new RegExp(Yt).test(t)&&!/IEMobile\b/.test(t))return["Windows Mobile",""];let i=/Windows NT ([0-9.]+)/i.exec(t);if(i&&i[1]){let s=wd[i[1]]||"";return/arm/i.test(t)&&(s="RT"),[Vs,s]}return[Vs,""]}],[/((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=>{let t="";return e&&e.length>=3&&(t=x(e[2])?e[3]:e[2]),["watchOS",t]}],[new RegExp("(Android (\\d+)\\.(\\d+)\\.?(\\d+)?|Android)","i"),e=>e&&e[2]?[Ai,[e[2],e[3],e[4]||"0"].join(".")]:[Ai,""]],[/Mac OS X (\d+)[_.](\d+)[_.]?(\d+)?/i,e=>{let 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",""]]],vl=function(e){for(let t=0;lo.length>t;t++){let[i,s]=lo[t],n=i.exec(e),r=n&&(le(s)?s(n,e):s);if(r)return r}return["",""]},gl=function(e){return bd.test(e)?us:yd.test(e)?ds:md.test(e)?Is:new RegExp(Mn,"i").test(e)?Mn:new RegExp("(Windows Phone|WPDesktop)","i").test(e)?tl:/iPad/.test(e)?Ua:/iPod/.test(e)?"iPod Touch":/iPhone/.test(e)?"iPhone":/(watch)(?: ?os[,/]|\d,\d\/)[\d.]+/i.test(e)?za:or.test(e)?Ts:/(kobo)\s(ereader|touch)/i.test(e)?"Kobo":new RegExp(ao,"i").test(e)?ao:/(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(Yt).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)?Ai:Wa:new RegExp("(pda|Mobile)","i").test(e)?_d:new RegExp(cs,"i").test(e)&&!new RegExp("Tablet pc","i").test(e)?il:""},Sd=function(e,t){var i;let s=gl(e);return s===Ua||s===Wa||s==="Kobo"||s==="Kindle Fire"||s===il?cs:s===us||s===Is||s===ds||s===Mn?"Console":s===za?"Wearable":s?Yt:(t==null?void 0:t.userAgentDataPlatform)==="Android"&&((i=t==null?void 0:t.maxTouchPoints)!==null&&i!==void 0?i:0)>0?600>Math.min((n=t==null?void 0:t.screenWidth)!==null&&n!==void 0?n:0,(r=t==null?void 0:t.screenHeight)!==null&&r!==void 0?r:0)/((o=t==null?void 0:t.devicePixelRatio)!==null&&o!==void 0?o:1)?Yt:cs:"Desktop";var n,r,o},Ws=/\bFBAV\/(\d+(?:\.\d+)*)/i,co=[[/\bInstagram(?:[ /](\d+(?:\.\d+)*))?\b/i,"Instagram"],[/\bBarcelona[ /](\d+(?:\.\d+)*)?/i,"Threads"],[/\b(?:MessengerForiOS|(?:FBAN|FB_IAB)\/Orca-Android)\b/i,"Messenger",Ws],[/\bFBAN\/EMA\b/i,"Facebook Lite",Ws],[/\b(?:FBIOS|(?:FBAN|FB_IAB)\/(?:FB4A|FBIOS))\b/i,"Facebook",Ws],[/\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"]],An="[Truncated]",Di="[Unserializable]";function zt(e){let t="";for(let i=0;e.length>i;i++){let s=e.charCodeAt(i);if(55296>s||s>56319)t+=56320>s||s>57343?e[i]:"\uFFFD";else{let n=e.charCodeAt(i+1);56320>n||n>57343?t+="\uFFFD":(t+=e[i]+e[i+1],i++)}}return t}function _l(e,t){if(!t)return e;let i=[];try{i=Object.keys(t)}catch{i=[]}for(let s of i){let n;try{n=t[s]}catch{n=Di}Object.defineProperty(e,s,{value:n,enumerable:!0,writable:!0,configurable:!0})}return e}var ss=3e5,ml=class{record(e){if(e.kind==="too-large")return;if(e.kind!=="retry-later")return void this.reset();if(!e.retryAfterMs)return;let t=this.isOpen(),i=Date.now(),s=Math.min(e.retryAfterMs,ss);if(!t)return this.ts=i,void(this.es=i+s);this.es=Math.max(this.es,Math.min(i+s,this.ts+ss))}remainingMs(){let e=Date.now();if(this.ts-5e3>e)return this.reset(),0;let t=Math.min(ss,Math.max(0,this.es-e));return t===0&&this.reset(),t}isOpen(){return this.remainingMs()>0}reset(){this.es=0,this.ts=0}constructor(){this.es=0,this.ts=0}},Ed=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;function uo(e,t){return typeof(i=e)=="string"&&Ed.test(i)?e:t();var i}function yl(e,t){let i=new Error(t);try{Object.defineProperty(i,"name",{value:e,writable:!0,enumerable:!0,configurable:!0})}catch{}return i}function yt(e){return e&&e.split("#")[0]}function ho(e){try{return e()}catch{return}}function bl(e,t){let i=setTimeout(e,t);return i!=null&&i.unref&&(i==null||i.unref()),i}function po(e,t,i){return wl.apply(this,arguments)}function wl(){return(wl=ee(function*(e,t,i){let s;try{return yield Promise.race([e,new Promise((n,r)=>{s=bl(()=>{try{i==null||i(),n()}catch(o){r(o)}},t)})])}finally{clearTimeout(s)}})).apply(this,arguments)}var Gi,fo,Us;function $d(e){let t=globalThis._posthogChunkIds;if(!t)return;let i=Object.keys(t);return Us&&i.length===fo||(fo=i.length,Us=i.reduce((s,n)=>{Gi||(Gi={});let r=Gi[n];if(r)s[r[0]]=r[1];else{let o=e(n);for(let a=o.length-1;a>=0;a--){let l=o[a],c=l==null?void 0:l.filename,u=t[n];if(c&&u){s[c]=u,Gi[n]=[c,u];break}}}return s},{})),Us}function bi(e){return bi=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},bi(e)}function Pd(e,t,i){return(t=(function(s){var n=(function(r){if(bi(r)!="object"||!r)return r;var o=r[Symbol.toPrimitive];if(o!==void 0){var a=o.call(r,"string");if(bi(a)!="object")return a;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(r)})(s);return bi(n)=="symbol"?n:n+""})(t))in e?Object.defineProperty(e,t,{value:i,enumerable:!0,configurable:!0,writable:!0}):e[t]=i,e}function vo(e,t){var i=Object.keys(e);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);t&&(s=s.filter(function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable})),i.push.apply(i,s)}return i}function f(e){for(var t=1;arguments.length>t;t++){var i=arguments[t]!=null?arguments[t]:{};t%2?vo(Object(i),!0).forEach(function(s){Pd(e,s,i[s])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):vo(Object(i)).forEach(function(s){Object.defineProperty(e,s,Object.getOwnPropertyDescriptor(i,s))})}return e}var Md=class{constructor(e,t,i=[]){this.coercers=e,this.stackParser=t,this.modifiers=i}buildFromUnknown(e,t={}){let i=t&&t.mechanism||{handled:!0,type:"generic"},s=this.buildCoercingContext(i,t,0).apply(e),n=this.buildParsingContext(t),r=this.parseStacktrace(s,n);return{$exception_list:this.convertToExceptionList(r,i),$exception_level:"error"}}modifyFrames(e){var t=this;return ee(function*(){for(let i of e)i.stacktrace&&i.stacktrace.frames&&R(i.stacktrace.frames)&&(i.stacktrace.frames=yield t.applyModifiers(i.stacktrace.frames));return e})()}coerceFallback(e){var t;return{type:"Error",value:"Unknown error",stack:(t=e.syntheticException)===null||t===void 0?void 0:t.stack,synthetic:!0}}parseStacktrace(e,t){var i;let s,n;if(e.cause!=null&&(s=this.parseStacktrace(e.cause,t)),e.stack!=""&&e.stack!=null)try{n=this.applyChunkIds(this.stackParser(e.stack,e.synthetic?t.skipFirstLines:0),t.chunkIdMap)}catch{}return f(f({},e),{},{cause:s,stack:n,errors:(i=e.errors)===null||i===void 0?void 0:i.map(r=>this.parseStacktrace(r,t))})}applyChunkIds(e,t){return e.map(i=>(i.filename&&t&&(i.chunk_id=t[i.filename]),i))}applyCoercers(e,t){for(let i of this.coercers)if(i.match(e))return i.coerce(e,t);return this.coerceFallback(t)}applyModifiers(e){var t=this;return ee(function*(){let i=e;for(let s of t.modifiers)i=yield s(i);return i})()}convertToExceptionList(e,t){let i=[],s=(n,r,o)=>{var a;let l=i.length,c=r===void 0?f(f({type:typeof t.type=="string"&&t.type.length>0?t.type:"generic"},typeof t.handled=="boolean"?{handled:t.handled}:t.handled===void 0?{handled:!0}:{}),{},{synthetic:typeof t.synthetic=="boolean"?t.synthetic:n.synthetic,exception_id:l}):{type:"chained",source:o,synthetic:n.synthetic,exception_id:l,parent_id:r},u={type:n.type,value:n.value,mechanism:c};n.stack&&(u.stacktrace={type:"raw",frames:n.stack}),i.push(u),n.cause&&s(n.cause,l,"cause");for(let d of(a=n.errors)!==null&&a!==void 0?a:[])s(d,l,"member")};return s(e),i}buildParsingContext(e){var t;return{chunkIdMap:$d(this.stackParser),skipFirstLines:(t=e.skipFirstLines)!==null&&t!==void 0?t:1}}getAggregateErrors(e){try{if(ii(e)){let i=Object.getPrototypeOf(e);for(let s=0;i&&100>s;s++){var t;let n=(t=Object.getOwnPropertyDescriptor(i,"constructor"))===null||t===void 0?void 0:t.value;if(typeof n=="function"&&n.name==="AggregateError"){let r=e.errors;return R(r)?r:void 0}i=Object.getPrototypeOf(i)}}}catch{}}buildCoercingContext(e,t,i=0){let s=0,n=0,r=!1,o=new Set,a=[],l={},c=(h,p,v=0)=>{let _=u(p,v),g=_.apply;if(_.apply=k=>{a.push(h);try{return g(k)}finally{a.pop()}},v>4||v>0&&a.indexOf(h)!==-1)return this.coerceFallback(_);let y=typeof h=="object"&&h!==null||typeof h=="function";if(v===0&&s>=50||y&&o.has(h))return;y&&o.add(h),v===0&&s++;let m=this.getAggregateErrors(h),w,P;r||(r=!!m);try{if(w=this.applyCoercers(h,_),!w)throw l}catch(k){if(k===l)return void(v===0&&s--);if(!r)throw k;w=this.coerceFallback(_)}if(!m||s>=50)return w;try{P=m.length}catch{return w}if(!Number.isInteger(P)||0>P||P>4294967295)return w;let $=[];for(let k=0;50>s&&1e3>n&&P>k;k++){let T;n++;try{T=_.next(m[k])}catch{s++,T=this.coerceFallback(u(p+1))}T&&$.push(T)}return f(f({},w),{},{errors:$})},u=(h,p=0)=>f(f({},t),{},{syntheticException:h==0?t.syntheticException:void 0,mechanism:h==0?e:{},apply(v){let _=c(v,h,p+1);if(!_)throw l;return _},next:v=>c(v,h+1)}),d=u(i);return f(f({},d),{},{apply:h=>{var p;return(p=c(h,i))!==null&&p!==void 0?p:this.coerceFallback(d)}})}},Td=/^([a-z][a-z0-9.+-]+):/i,Id=["http","https","file","blob","app","capacitor","ionic","webpack","webpack-internal","ng"];function Ad(e){if(!e||e==="<anonymous>")return!1;let t=Td.exec(e);return!t||Id.includes(t[1].toLowerCase())}function Cn(e,t,i,s,n){let r={platform:e,filename:t,function:i==="<anonymous>"?"?":i,in_app:Ad(t)};return x(s)||(r.lineno=s),x(n)||(r.colno=n),r}var xl=(e,t)=>{let i=e.indexOf("safari-extension")!==-1,s=e.indexOf("safari-web-extension")!==-1;return i||s?[e.indexOf("@")!==-1?e.split("@")[0]:"?",i?`safari-extension:${t}`:`safari-web-extension:${t}`]:[e,t]},Cd=/^\s*at (\S+?)(?::(\d+))(?::(\d+))\s*$/i,Fd=/^\s*at (?:(.+?\)(?: \[.+\])?|.*?) ?\((?:address at )?)?(?:async )?((?:<anonymous>|[-a-z]+:|.*bundle|\/)?.*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i,Od=/\((\S*)(?::(\d+))(?::(\d+))\)/,Rd=(e,t)=>{let i=Cd.exec(e);if(i){let[,n,r,o]=i;return Cn(t,n,"?",+r,+o)}let s=Fd.exec(e);if(s){if(s[2]&&s[2].indexOf("eval")===0){let o=Od.exec(s[2]);o&&(s[2]=o[1],s[3]=o[2],s[4]=o[3])}let[n,r]=xl(s[1]||"?",s[2]);return Cn(t,r,n,s[3]?+s[3]:void 0,s[4]?+s[4]:void 0)}},Ld=/^\s*(.*?)(?:\((.*?)\))?(?:^|@)?((?:[-a-z]+)?:\/.*?|\[native code\]|[^@]*(?:bundle|\d+\.js)|\/[\w\-. /=]+)(?::(\d+))?(?::(\d+))?\s*$/i,Dd=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i,Nd=(e,t)=>{let i=Ld.exec(e);if(i){if(i[3]&&i[3].indexOf(" > eval")>-1){let r=Dd.exec(i[3]);r&&(i[1]=i[1]||"eval",i[3]=r[1],i[4]=r[2],i[5]="")}let s=i[3],n=i[1]||"?";return[n,s]=xl(n,s),Cn(t,s,n,i[4]?+i[4]:void 0,i[5]?+i[5]:void 0)}},go=/\(error: (.*)\)/;function ar(e,t){return e.filename===t.filename&&e.function===t.function&&e.module===t.module&&e.lineno===t.lineno&&e.colno===t.colno}function jd(e){for(let t=1;10>=t;t++){let i=e.length-2*t;if(0>i)break;let s=!0;for(let n=0;t>n;n++)if(!ar(e[i+n],e[i+t+n])){s=!1;break}if(s){for(let n=0;t>n;n++)e[i+n]=e[i+t+n];return e.length=i+t,{start:i,length:t}}}}function Vd(e,t){let i=t.start+t.length,s=Sl(e,t);s&&e.splice(i+s===e.length?i:t.start,s)}function kl(e,t){let i=t.start;for(;i>0&&ar(e[i-1],e[i-1+t.length]);)i--;return t.start-i}function Sl(e,t){let i=t.start+t.length,s=i;for(;e.length>s&&ar(e[s],e[s-t.length]);)s++;return s-i}function Hd(e,t){let i=t[0],s=e.length-(i?kl(e,i):0);for(let n of t)s-=Sl(e,n);return s}function Bd(e,t,i){for(let s=0;e.length>s;s++){let n=e[(t+s)%e.length],r=e[(i+s)%e.length];if(n!==r)return r>n}return!1}var Wd=class{match(e){return this.isDOMException(e)||this.isDOMError(e)}coerce(e,t){let i=H(e.stack);return{type:this.getType(e),value:this.getValue(e),stack:i?e.stack:void 0,cause:e.cause?t.next(e.cause):void 0,synthetic:!1}}getType(e){return this.isDOMError(e)?"DOMError":"DOMException"}getValue(e){let t=e.name||(this.isDOMError(e)?"DOMError":"DOMException");return e.message?`${t}: ${e.message}`:t}isDOMException(e){return ls(e,"DOMException")}isDOMError(e){return ls(e,"DOMError")}},Ud=class{match(e){return ii(e)}coerce(e,t){var i;let s=this.getStack(e),n=s===void 0?(i=t.syntheticException)===null||i===void 0?void 0:i.stack:void 0,r=!!n;return{type:this.getType(e),value:this.getMessage(e,t),stack:s!=null?s:n,cause:e.cause?t.next(e.cause):void 0,synthetic:r}}getType(e){return e.name||e.constructor.name}getMessage(e,t){let i=e.message;return String(i.error&&typeof i.error.message=="string"?i.error.message:i)}getStack(e){try{let t=e.stacktrace;if(typeof t=="string"&&t.length>0)return t;let i=e.stack;return typeof i=="string"&&i.length>0?i:void 0}catch{return}}},zd=class{match(e){return!!ls(e,"ErrorEvent")&&(e.error!=null||this.ar(e))}coerce(e,t){var i;if(e.error!=null)return t.apply(e.error);let s=t.apply(e.message);return f(f({},s),{},{stack:(i=this.lr(e))!==null&&i!==void 0?i:s.stack,synthetic:!0})}ar(e){return H(e.message)&&e.message.length>0}lr(e){var t,i;let s=e,n=(t=s.lineno)!==null&&t!==void 0?t:0,r=(i=s.colno)!==null&&i!==void 0?i:0;if(H(s.filename)&&s.filename.length!==0&&n!==0)return`Error
2
- at ${s.filename}:${n}:${r}`}},Gd=/^(?:[Uu]ncaught (?:exception: )?)?(?:((?:Eval|Internal|Range|Reference|Syntax|Type|URI|)Error): )?(.*)$/i,qd=class{match(e){return typeof e=="string"}coerce(e,t){var i;let[s,n]=this.getInfos(e);return{type:s!=null?s:"Error",value:n!=null?n:e,stack:(i=t.syntheticException)===null||i===void 0?void 0:i.stack,synthetic:!0}}getInfos(e){let t="Error",i=e,s=e.match(Gd);return s&&(t=s[1],i=s[2]),[t,i]}},Zd=["fatal","error","warning","log","info","debug"];function El(e,t=40){let i=Object.keys(e);if(i.sort(),!i.length)return"[object has no keys]";for(let s=i.length;s>0;s--){let n=i.slice(0,s).join(", ");if(t>=n.length)return s===i.length?n:n.length>t?`${n.slice(0,t)}...`:n}return""}var Yd=class{match(e){return typeof e=="object"&&e!==null}coerce(e,t){var i,s;let n=this.getErrorPropertyFromObject(e);return n?t.apply(n):{type:this.getType(e),value:this.getValue(e),stack:(i=this.getStack(e))!==null&&i!==void 0?i:(s=t.syntheticException)===null||s===void 0?void 0:s.stack,level:this.isSeverityLevel(e.level)?e.level:"error",synthetic:!0}}getType(e){if(rr(e))return e.constructor.name;let t="name"in e?e.name:void 0;return H(t)&&!yi(t)?t:"Error"}getValue(e){if("name"in e&&typeof e.name=="string"){let i=`'${e.name}' captured as exception`;return"message"in e&&typeof e.message=="string"&&(i+=` with message: '${e.message}'`),i}if("message"in e&&typeof e.message=="string")return e.message;let t=this.getObjectClassName(e);return`${t&&t!=="Object"?`'${t}'`:"Object"} captured as exception with keys: ${El(e)}`}isSeverityLevel(e){return H(e)&&!yi(e)&&Zd.indexOf(e)>=0}getStack(e){try{return H(e.stacktrace)&&e.stacktrace.length>0?e.stacktrace:H(e.stack)&&e.stack.length>0?e.stack:void 0}catch{return}}getErrorPropertyFromObject(e){for(let t in e)if({}.hasOwnProperty.call(e,t)){let i=e[t];if(ii(i))return i}}getObjectClassName(e){try{let t=Object.getPrototypeOf(e);return t?t.constructor.name:void 0}catch{return}}},Xd=class{match(e){return rr(e)}coerce(e,t){var i;let s=e.constructor.name;return{type:s,value:`${s} captured as exception with keys: ${El(e)}`,stack:(i=t.syntheticException)===null||i===void 0?void 0:i.stack,synthetic:!0}}},Jd=class{match(e){return Ha(e)}coerce(e,t){var i;return{type:"Error",value:`Primitive value captured as exception: ${String(e)}`,stack:(i=t.syntheticException)===null||i===void 0?void 0:i.stack,synthetic:!0}}},Kd=class{match(e){return ls(e,"PromiseRejectionEvent")||this.isCustomEventWrappingRejection(e)}isCustomEventWrappingRejection(e){if(!rr(e))return!1;try{let t=e.detail;return t!=null&&typeof t=="object"&&"reason"in t}catch{return!1}}coerce(e,t){var i;let s=this.getUnhandledRejectionReason(e);return Ha(s)?{type:"UnhandledRejection",value:`Non-Error promise rejection captured with value: ${String(s)}`,stack:(i=t.syntheticException)===null||i===void 0?void 0:i.stack,synthetic:!0}:t.apply(s)}getUnhandledRejectionReason(e){try{if("reason"in e)return e.reason;if("detail"in e&&e.detail!=null&&typeof e.detail=="object"&&"reason"in e.detail)return e.detail.reason}catch{}return e}},hs="$message",ps="$timestamp",Qd=new Set([hs,ps]),zs={enabled:!0,max_bytes:32768};function fs(e){var t;return e?{enabled:(t=e.enabled)!==null&&t!==void 0?t:zs.enabled,max_bytes:th(e.max_bytes,zs.max_bytes)}:f({},zs)}var eh=class{constructor(e){this.ns=[],this.ss=0,this.Mr=fs(e)}setConfig(e){this.Mr=fs(e),this.rs()}add(e){let t=(function(s){let n;try{n=ja(s)}catch{return}try{let r=JSON.parse(n);if(!j(r))return;let o=r,a=o[hs],l=o[ps];return!H(a)||a.trim().length===0||!H(l)&&!oe(l)?void 0:{step:o,json:n}}catch{return}})(e);if(!t)return;let i=(function(s){if("u">typeof TextEncoder)return new TextEncoder().encode(s).length;let n=encodeURIComponent(s),r=0;for(let o=0;n.length>o;o++)n[o]==="%"?(r+=1,o+=2):r+=1;return r})(t.json);i>this.Mr.max_bytes||(this.ns.push({step:t.step,bytes:i}),this.ss+=i,this.rs())}getAttachable(){return this.ns.map(e=>e.step)}clear(){this.ns=[],this.ss=0}size(){return this.ns.length}rs(){for(;this.ss>this.Mr.max_bytes&&this.ns.length>0;){let e=this.ns.shift();e&&(this.ss-=e.bytes)}}};function th(e,t){if(!oe(e)||e===1/0||e===-1/0)return t;let i=Math.floor(e);return 0>i?t:i}var _o=e=>{if(typeof e!="string")return e;try{return JSON.parse(e)}catch{return e}};function mo(e){return typeof e=="string"||e}function yo(e){return typeof e=="string"?e:void 0}var ih=["$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","irclid","_kx","$session_id","$window_id","$lib","$lib_version","$device_id","$is_server","$react_native_version"],$l="NativeGzipValidationError",Fn=e=>e.length>=2&&e[0]===31&&e[1]===139,bo=(e,t)=>e===$n.GZipJS||t===$n.GZipJS||t==="gzip",wo=e=>!(!e||typeof e!="object")&&("name"in e?String(e.name):"")==="NotReadableError",li,qi=e=>{throw yl($l,`Native gzip produced invalid output: ${e}`)},sh=(xo=ee(function*(e,t){18>e.size&&qi("too-short");let i=new Uint8Array(yield e.slice(0,10).arrayBuffer());Fn(i)&&i[2]===8||qi("invalid-header");let s=new DataView(yield e.slice(e.size-8).arrayBuffer());s.getUint32(0,!0)!==(r=>{let o=(()=>{if(li)return li;li=[];for(let l=0;256>l;l++){let c=l;for(let u=0;8>u;u++)c=1&c?3988292384^c>>>1:c>>>1;li[l]=c>>>0}return li})(),a=4294967295;for(let l=0;r.length>l;l++)a=o[255&(a^r[l])]^a>>>8;return(4294967295^a)>>>0})(t)&&qi("invalid-crc");let n=t.length>>>0;s.getUint32(4,!0)!==n&&qi("invalid-size")}),function(e,t){return xo.apply(this,arguments)}),xo;function On(){return On=ee(function*(e,t=!0,i){try{let n=new TextEncoder().encode(e),r=new globalThis.CompressionStream("gzip"),o=r.writable.getWriter(),a=o.write(n).then(()=>o.close()).catch((s=ee(function*(u){try{yield o.abort(u)}catch{}throw u}),function(u){return s.apply(this,arguments)})),l=new Response(r.readable).blob(),[c]=yield Promise.all([l,a]);return yield sh(c,n),c}catch(n){if(i!=null&&i.rethrow)throw n;return t&&console.error("Failed to gzip compress data",n),null}var s}),On.apply(this,arguments)}function Pl(e,t){if(e==null)return{};var i,s,n=(function(o,a){if(o==null)return{};var l={};for(var c in o)if({}.hasOwnProperty.call(o,c)){if(a.includes(c))continue;l[c]=o[c]}return l})(e,t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);for(s=0;r.length>s;s++)t.includes(i=r[s])||{}.propertyIsEnumerable.call(e,i)&&(n[i]=e[i])}return n}var ye="[redacted]",nh=/^[A-Za-z0-9+/\n\r]+=*$/,rh=/^[A-Za-z0-9_-]+={0,2}$/,oh=/[-_]/,ah=/^data:[^,\s]*;base64,/i,lh=/^[A-Za-z0-9+/_-]+={0,2}$/,ch=/\bph[a-z]_[A-Za-z0-9_-]{20,}\b/g,uh=/^(authorization|cookie|set-cookie|x-api-key|api[-_]?key|api[-_]?token|access[-_]?token|refresh[-_]?token|token|password|secret|client[-_]?secret|private[-_]?key)$/i,Ml=/[a-z][a-z0-9+.-]{0,63}:[^\s<>"]+/gi,dh=/[\s<>"]/,Tl=new RegExp(Ml.source,"i"),Il=/[a-z][a-z0-9+.-]{0,63}:\/\//i,hh=new RegExp(`^${Il.source}`,"i"),ph=new RegExp(Il.source,"gi"),fh=/(^|[-_./;])(auth|token|secret|password|passwd|pwd|credential|signature|sig|key|hmac|sas|bearer|jwt|session|sessionid)([-_./;]|$)/i,vh=/^(code|AWSAccessKeyId|GoogleAccessId|Policy)$/i,gh=/[\u00A0\u1680\u2000-\u200A\u202F\u205F\u3000]/g,_h=/[A-Za-z0-9._%+-]{1,64}@[A-Za-z0-9.-]{1,255}\.[A-Za-z]{2,24}/g,mh=/\b(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)\b/g,yh=/(^|[^\w:])((?:(?:[0-9A-Fa-f]{1,4}:){7}[0-9A-Fa-f]{1,4}|(?:[0-9A-Fa-f]{1,4}:){1,7}:|(?:[0-9A-Fa-f]{1,4}:){1,6}:[0-9A-Fa-f]{1,4}(?::[0-9A-Fa-f]{1,4}){0,5}|::(?:[0-9A-Fa-f]{1,4}(?::[0-9A-Fa-f]{1,4}){0,6})))(?=$|[^\w:])/g,bh=/\b\d{3}[ .-]\d{2}[ .-]\d{4}\b/g,wh=/\b\d(?:[ ./-]?\d){12,}\b/g,ko=/\d+/g,xh=/(^|[^\w+])((?:\+?1[ ./-]?)?(?:\(\d{3}\)[ ./-]?|\d{3}[ ./-])\d{3}[ ./-]\d{4})(?![\w])/g,kh=/(^|[^\w])(\+\d{1,3}(?:[ ./()-]{0,2}\d){7,13})(?![\w])/g;function Rn(e){return(function(t){return uh.test(t)})(e)||fh.test(e)||vh.test(e)}function Gs(e){return e.split("&",129).length>128}function Sh(e,t,i){return Rn(e)||t.includes(";")&&(function(s){return s.split(";").some(n=>Rn(n.split("=",1)[0]))})(t)?ye:Tl.test(t)?i?lr(t,{allowNestedUrls:!1,stripPunctuation:!0}):ye:t}function Al(e,t){let i=new URLSearchParams,s=!1,n=!1;for(let[r,o]of new URLSearchParams(e)){let a=Sh(r,o,t);s||(s=a!==o),n=Rn(r)||a!==o,i.append(r,a)}return{changed:s,lastFieldSensitive:n,serialized:i.toString()}}function So(e,t){if(!e.includes("="))return{value:Eh(e,t),lastFieldSensitive:!1};let i=Al(e,t);return{value:i.changed?i.serialized:e,lastFieldSensitive:i.lastFieldSensitive}}function Eh(e,t){return t?lr(e,{allowNestedUrls:!1,stripPunctuation:!0}):Tl.test(e)?ye:e}function $h(e,t,i){return e==="#"?!t.fragment&&(t.fragment=!0):e==="?"&&(t.fragment?i!=="="&&!t.fragmentQuery&&(t.fragmentQuery=!0):!t.query&&(t.query=!0))}function qs(e,t){var i;if(e.length>8192&&hh.test(e))return ye;let{address:s,suffix:n}=t.stripPunctuation?(function(g){let y=g.length;for(;y>0&&".,;:!?)]}'".includes(g[y-1]);)y--;return{address:g.slice(0,y),suffix:g.slice(y)}})(e):{address:e,suffix:""},r;try{r=new URL(s)}catch{return ye+n}let o=r.search.slice(1),a=r.hash!=="",l=(function(g){let y=g.slice(1),m=y.indexOf("?");return 0>m?{head:y,tail:null}:{head:y.slice(0,m),tail:y.slice(m+1)}})(r.hash);if(Gs(o)||Gs(l.head)||Gs((i=l.tail)!==null&&i!==void 0?i:""))return ye+n;let c=!1;(r.username||r.password)&&(r.username=ye,r.password="",c=!0);let u=Al(o,t.allowNestedUrls);u.changed&&(r.search=u.serialized,c=!0);let d=So(l.head,t.allowNestedUrls),h=l.tail===null?null:(p=l.tail,d.lastFieldSensitive?{value:p===""?"":ye,lastFieldSensitive:!0}:So(p,t.allowNestedUrls));var p;let v=h===null?d.value:`${d.value}?${h.value}`;v!==r.hash.slice(1)&&(r.hash=v,c=!0);let _=a?h!=null?h:d:u;return(c?r.toString():s)+(_.lastFieldSensitive?"":n)}function lr(e,t){return e.replace(Ml,i=>(function(s,n){let r=(function(l){if(!l.includes("://"))return[];let c=[...l.matchAll(ph)].map(_=>_.index),u=[],d={query:!1,fragment:!1,fragmentQuery:!1},h=0,p=!1,v="";for(let _=0;l.length>_&&c.length>h;_++){c[h]===_&&(_>0&&v!=="="&&u.push(_),h++);let g=l[_];$h(g,d,v)?(v=g,p=!0):p&&"=&".includes(g)&&(v=g)}return u})(s);if(r.length===0)return qs(s,n);let o="",a=0;for(let l of r)o+=qs(s.slice(a,l),f(f({},n),{},{stripPunctuation:!1})),a=l;return o+qs(s.slice(a),n)})(i,f(f({},t),{},{stripPunctuation:t.stripPunctuation&&i.length!==e.length})))}function Ph(e,t){return(function(i){return i.length>=10240&&(nh.test(i)||(function(s){let n=ah.exec(s);if(!n)return!1;let r;try{r=decodeURIComponent(s.slice(n[0].length))}catch{return!1}return lh.test(r.replace(/[\r\n]/g,""))})(i)||oh.test(i)&&rh.test(i))})(e)?"[binary data redacted - not supported by PostHog MCP analytics]":(function(i,s,n){let r=4*n.maxStringLength;if(i.length>r){let o=s(i.slice(0,(function(a,l){let c=l;for(;c>0&&!dh.test(a[c-1]);)c--;return c})(i,r)));if(o.length>=2*n.maxStringLength)return o+n.truncationSuffix}return s(i)})(e,i=>(function(s){return lr(s,{allowNestedUrls:!0,stripPunctuation:!0})})((function(s){let n=s.replace(gh," ");return n=n.replace(_h,ye),n=n.replace(mh,ye),n=n.replace(yh,`$1${ye}`),n=n.replace(wh,Th),n=n.replace(bh,ye),n=n.replace(xh,`$1${ye}`),n=n.replace(kh,`$1${ye}`),n})((function(s){return s.replace(ch,ye)})(i))),t)}function Mh(e){let t=0,i=!1;for(let s=e.length-1;s>=0;s--){let n=e.charCodeAt(s)-48;if(0>n||n>9)return!1;i&&(n*=2,n>9&&(n-=9)),t+=n,i=!i}return t%10==0}function Th(e){let t=[];for(let r=ko.exec(e);r!==null;r=ko.exec(e))t.push({digits:r[0],start:r.index,end:r.index+r[0].length});let i="",s=0,n=0;for(;t.length>n;){let r="",o=-1;for(let a=n;t.length>a&&(r+=t[a].digits,19>=r.length);a++)r.length>=13&&Mh(r)&&(o=a);0>o?n++:(i+=e.slice(s,t[n].start)+ye,s=t[o].end,n=o+1)}return i+e.slice(s)}var Ih={}.propertyIsEnumerable;function vs(e,t){try{return Cl(e,t,{ancestors:new WeakSet,remainingNodes:1e4},0)}catch{return[]}}function cr(e,t,i,s){if(0>=i.remainingNodes)return{stringValue:An};if(i.remainingNodes--,Se(e))return{boolValue:e};if(typeof e=="bigint")return(function(n,r){let o=n.toString(),a=BigInt("9223372036854775808");return n>=a||-a>n?(r==null||r.debug(`Attribute ${o} is outside the int64 range; encoding it as a string`),{stringValue:o}):{intValue:o}})(e,t);if(typeof e=="number"){if(!Number.isFinite(e))return{stringValue:String(e)};if(Number.isInteger(e)){if(Number.isSafeInteger(e))return{intValue:String(e)};if(typeof BigInt>"u")return{stringValue:String(e)};let n=BigInt(e).toString();return e>=9223372036854776e3||-9223372036854776e3>e?(t==null||t.debug(`Attribute ${n} is outside the int64 range; encoding it as a string`),{stringValue:n}):{intValue:n}}return{doubleValue:e}}if(typeof e=="string")return{stringValue:zt(e)};if(typeof e=="function")return{stringValue:"[Function]"};if(typeof e=="symbol")return{stringValue:String(e)};if(typeof e=="object"&&e!==null){if(i.ancestors.has(e))return{stringValue:"[Circular]"};if(s>=20)return{stringValue:An};if(e instanceof Date){let n=e.getTime(),r=Number.isFinite(n)?e.toISOString():String(e);return{stringValue:typeof r=="string"?zt(r):String(r)}}i.ancestors.add(e);try{try{let n=e.toJSON;if(typeof n=="function")return cr(n.call(e),t,i,s+1)}catch{}return R(e)?{arrayValue:{values:Ah(e,t,i,s+1)}}:{kvlistValue:{values:Cl(e,t,i,s+1)}}}finally{i.ancestors.delete(e)}}return{stringValue:zt(String(e))}}function Ah(e,t,i,s){let n=[],r=Math.min(e.length,1e3),o=0;for(;r>o&&i.remainingNodes>0;o++)try{let a=o in e?e[o]:void 0;if(D(a))continue;n.push(cr(a,t,i,s))}catch{n.push({stringValue:Di})}return e.length>o&&n.push({stringValue:An}),n}function Cl(e,t,i,s){let n=[];for(let r in e)if(Ih.call(e,r)){if(!r){t==null||t.debug("Dropping an attribute with an empty key");continue}if(n.length>=1e3||0>=i.remainingNodes){t==null||t.debug("Attributes truncated: the value exceeds the OTLP encoder budget");break}try{let o=e[r];if(ne(o)||x(o))continue;n.push({key:zt(r),value:cr(o,t,i,s)})}catch{n.push({key:zt(r),value:{stringValue:Di}})}}return n}function Fl(e,t,i){return f(f(f(f({},_l({},e.resourceAttributes)),{},{"service.name":e.serviceName||"unknown_service"},e.environment&&{"deployment.environment":e.environment}),e.serviceVersion&&{"service.version":e.serviceVersion}),{},{"telemetry.sdk.name":t,"telemetry.sdk.version":i})}var Ch=["service.name","deployment.environment","service.version","telemetry.sdk.name","telemetry.sdk.version"];function Ol(e,t){let i=_l({},e),s={};for(let n of Ch)({}).hasOwnProperty.call(i,n)&&(s[n]=i[n],delete i[n]);return[...vs(i,t),...vs(s,t)]}var Eo={darwin:"macOS",win32:"Windows",cygwin:"Windows",linux:"Linux",android:"Android",freebsd:"FreeBSD",openbsd:"OpenBSD",netbsd:"NetBSD",sunos:"SunOS",aix:"AIX",haiku:"Haiku","Mac OS X":"macOS"},Rl={trace:{text:"TRACE",number:1},debug:{text:"DEBUG",number:5},info:{text:"INFO",number:9},warn:{text:"WARN",number:13},error:{text:"ERROR",number:17},fatal:{text:"FATAL",number:21}},Fh=Rl.info;function Oh(e){try{return zt(String(e))}catch{return Di}}function Rh(e,t,i,s){let n=e.level||"info",{text:r,number:o}=Rl[n]||Fh,a=(function(h=Date.now()){return String(h)+"000000"})(oe(s)?s:void 0),l={};t.distinctId&&(l.posthogDistinctId=t.distinctId),t.sessionId&&(l.sessionId=t.sessionId),t.windowId&&(l["window.id"]=t.windowId),D(t.sessionStartTimestamp)||(l.sessionStartTimestamp=String(t.sessionStartTimestamp)),D(t.lastActivityTimestamp)||(l.lastActivityTimestamp=String(t.lastActivityTimestamp)),t.currentUrl&&(l["url.full"]=t.currentUrl),t.screenName&&(l["screen.name"]=t.screenName),t.appState&&(l["app.state"]=t.appState),t.activeFeatureFlags&&t.activeFeatureFlags.length>0&&(l.feature_flags=t.activeFeatureFlags);let c=f({},l),u=e.attributes;if(u){let h=[];try{h=Object.keys(u)}catch{h=[]}for(let p of h){let v;try{v=u[p]}catch{v=Di}Object.defineProperty(c,p,{value:v,enumerable:!0,writable:!0,configurable:!0})}}let d={timeUnixNano:a,observedTimeUnixNano:a,severityNumber:o,severityText:r,body:{stringValue:Oh(e.body)},attributes:vs(c,i)};return e.trace_id&&(d.traceId=e.trace_id),e.span_id&&(d.spanId=e.span_id),x(e.trace_flags)||(d.flags=e.trace_flags),d}function Ll(e,t,i){return Fl(e,t,i)}function Dl(e,t,i,s){return{resourceLogs:[{resource:{attributes:Ol(t)},scopeLogs:[{scope:{name:i,version:s},logRecords:e}]}]}}var Nl=class{constructor(e){this.ls=e,this.us=0}get pending(){return!!this.cs}arm(e){this.clear(),this.us=Date.now()+e,this.cs=bl(()=>{this.cs=void 0,this.ls()},e)}armNoEarlierThan(e){this.cs&&Date.now()+e<=this.us||this.arm(e)}clear(){this.cs&&(clearTimeout(this.cs),this.cs=void 0)}};function jl(){return .75+.5*Math.random()}function Vl(e,t,i,s){let n=Math.min(Math.max(0,t-1),6),r=e*Math.pow(2,n);return Math.round((s===void 0?r:Math.min(r,Math.max(s,e)))*i)}var Lh=class{constructor(e,t,i,s,n,r=()=>Promise.resolve(),o){var a;this._instance=e,this.Mr=t,this.A=i,this.hs=s,this.ds=n,this.vs=r,this.fs=o,this.ps=new Nl(()=>this.gs()),this.ys=null,this.bs=0,this._s=0,this.ws=new ml,this.ks=0,this.Ss=1,this.xs=0,this.$s=0,this.Cs=!1,this.Ts=t.maxBufferSize,this.Is=Math.max((a=t.maxQueueSize)!==null&&a!==void 0?a:t.maxBufferSize,t.maxBufferSize),this.Ms=t.flushIntervalMs,this.Es=t.maxBatchRecordsPerPost,this.Ps=t.rateCapWindowMs,this.Rs=t.maxLogsPerInterval}clearQueue(){this._s++,this._instance.setPersistedProperty(Ye.LogsQueue,[])}reset(){this.ps.clear(),this.xs=0,this.$s=0,this.Cs=!1,this.ks=0,this.Ss=1,this.ws.reset(),this.Es=this.Mr.maxBatchRecordsPerPost}onReconnect(){this.ks=0,this.Ss=1,this.ws.isOpen()?this.As()&&this.Fs():this.gs()}captureLog(e,t){var i;if(this._instance.isDisabled||this._instance.optedOut||!(e!=null&&e.body))return;let s=this.Os(e);if(s===null)return;if(!s.body)return void this.A.info("Log was rejected in beforeSend function");if(!this.Ds())return;let n={record:Rh(s,(i=t==null?void 0:t.context)!==null&&i!==void 0?i:this.hs(),this.A,t==null?void 0:t.occurredAtMs)};this.ds(()=>this.Ls(n))}Os(e){let t=this.Mr.beforeSend;if(!t)return e;let i=R(t)?t:[t],s=e;for(let n of i)try{let r=n(s);if(!r)return this.A.info("Log was rejected in beforeSend function"),null;s=r}catch(r){return this.A.error("Error in beforeSend function for log:",r),null}return s}Ds(){if(this.Rs===void 0)return!0;let e=Date.now(),t=e-this.xs;return this.Ps>t&&t>=0||(this.xs=e,this.$s=0,this.Cs=!1),this.Rs>this.$s?(this.$s++,!0):(this.Cs||(this.A.warn(`captureLog dropping logs: exceeded ${this.Rs} logs per ${this.Ps}ms`),this.Cs=!0),!1)}flush(){var e=this;return ee(function*(){if(!e._instance.isDisabled)return e.ys||(e.ys=e.Ns().finally(()=>{e.ys=null})),e.ys})()}Ns(){var e=this;return ee(function*(){var t;e.ps.clear();let i=(t=e._instance.getPersistedProperty(Ye.LogsQueue))!==null&&t!==void 0?t:[];if(i.length===0)return;let s=i.length,n=0;for(;i.length>0&&s>n;){var r,o;let a=e._s;e.bs=0;let l=Math.min(i.length,e.Es),c=i.slice(0,l),u=Dl(c.map(h=>h.record),e.qs(),(r=e.fs)!==null&&r!==void 0?r:e._instance.getLibraryId(),e._instance.getLibraryVersion()),d=yield e._instance.js(u);if(e._s!==a)return;if(d.kind==="too-large"&&c.length>1)e.Es=Math.max(1,Math.floor(c.length/2)),e.A.warn(`Logs batch of size ${c.length} was too large for the ingestion endpoint, reducing batch size to ${e.Es}`);else if(e.ws.record(d),e.ps.pending&&e.ps.arm(Math.max(e.Ms,e.ws.remainingMs())),d.kind==="retry-later"||(d.kind==="too-large"?e.A.warn("Dropping a single log record with batch size 1 \u2014 the record is larger than the server cap and cannot be split further."):d.kind==="ok"&&e.Mr.maxBatchRecordsPerPost>e.Es&&(e.Es=Math.min(e.Mr.maxBatchRecordsPerPost,e.Es+1)),yield e.Bs(c.length),i=(o=e._instance.getPersistedProperty(Ye.LogsQueue))!==null&&o!==void 0?o:[],n+=c.length,d.kind==="fatal"))throw d.error}})()}Bs(e){var t=this;return ee(function*(){var i;let s=Math.max(0,e-t.bs),n=(i=t._instance.getPersistedProperty(Ye.LogsQueue))!==null&&i!==void 0?i:[];t._instance.setPersistedProperty(Ye.LogsQueue,n.slice(s)),yield t.vs()})()}qs(){return Ll(this.Mr,this._instance.getLibraryId(),this._instance.getLibraryVersion())}Ls(e){var t;if(this._instance.optedOut)return;let i=(t=this._instance.getPersistedProperty(Ye.LogsQueue))!==null&&t!==void 0?t:[];this.Is>i.length||(i.shift(),this.bs++,this.A.info("Logs queue is full, dropping oldest record.")),i.push(e),this._instance.setPersistedProperty(Ye.LogsQueue,i),this.Ts>i.length||this.ws.isOpen()?this.Fs():this.gs()}Fs(){this.ps.pending||this.ps.arm(Math.max(this.Ms,this.ws.remainingMs()))}zs(){return Math.max(Vl(this.Ms,this.ks,this.Ss,3e4),this.ws.remainingMs())}As(){let e=this._instance.getPersistedProperty(Ye.LogsQueue);return!!e&&e.length>0}shutdown(e){var t=this;return ee(function*(){t.ps.clear();let i=t.flush().catch(()=>{});e!==void 0?yield po(i,e):yield i})()}flushWithTimeout(e){var t=this;return ee(function*(){let i=t.flush();yield po(i,e,()=>{i.catch(()=>{})})})()}gs(){this.flush().then(()=>{this.ks=0,this.Ss=1},e=>{this.ks++,this.Ss=jl(),this.A.error("PostHog logs flush failed:",e)}).finally(()=>{!this._instance.isDisabled&&this.As()&&this.ps.armNoEarlierThan(this.zs())})}},Zs=[0,5,10,25,50,75,100,250,500,750,1e3,2500,5e3,7500,1e4];function $o(e){return String(e)+"000000"}function Po(e,t,i,s){let n="";return s&&(n=Object.keys(s).sort().map(r=>`${JSON.stringify(r)}:${JSON.stringify(s[r])}`).join(",")),`${e}\0${t}\0${i!=null?i:""}\0${n}`}var Dh=class{constructor(e,t,i){this._instance=e,this.Mr=t,this.A=i,this.Hs=new Map,this.ps=new Nl(()=>this.flush().catch(s=>{this.A.error("Metrics flush failed:",s)})),this.ys=null,this.Us=!1,this.Ws=new Map,this.Vs=new Set,this.ws=new ml,this.ks=0,this.Ss=1,this.Gs=0}count(e,t=1,i){this.Qs({name:e,type:"count",value:t,unit:i==null?void 0:i.unit,attributes:i==null?void 0:i.attributes})}gauge(e,t,i){this.Qs({name:e,type:"gauge",value:t,unit:i==null?void 0:i.unit,attributes:i==null?void 0:i.attributes})}histogram(e,t,i){this.Qs({name:e,type:"histogram",value:t,unit:i==null?void 0:i.unit,attributes:i==null?void 0:i.attributes})}flush(){var e=this;let t=this.ys,i=(function(){var s=ee(function*(){t&&(yield t.catch(()=>{})),yield e.Zs()});return function(){return s.apply(this,arguments)}})()().finally(()=>{this.ys===i&&(this.ys=null)});return this.ys=i,i}drainWindow(){if(this.Hs.size===0)return null;let e=this.Hs;return this.Hs=new Map,this.Us=!1,this.Ws=new Map,this.Vs=new Set,this.Js(e)}reset(){this.Gs++,this.ws.reset(),this.ks=0,this.Ss=1,this.ps.clear(),this.Hs=new Map,this.ys=null,this.Us=!1,this.Ws=new Map,this.Vs=new Set}Qs(e){if(this._instance.isDisabled||this._instance.optedOut)return;let t=this.Os(e);if(t===null)return;if(!t.name||typeof t.name!="string")return void this.A.warn("Dropping metric with empty name");if(typeof t.value!="number"||!Number.isFinite(t.value))return void this.A.warn(`Dropping metric '${t.name}': value must be a finite number`);if(t.type==="count"&&0>t.value)return void this.A.warn(`Dropping count '${t.name}': counters are monotonic, value must be >= 0`);let i,s;try{i=t.attributes?f({},t.attributes):void 0,s=Po(t.type,t.name,t.unit,i)}catch(o){return void this.A.warn(`Dropping metric '${t.name}': attributes could not be serialized`,o)}let n=this.Hs.get(s);if(!n){if(!this.Ks())return;n={name:t.name,type:t.type,unit:t.unit,attributes:i,windowStartMs:Date.now()},this.Hs.set(s,n)}let r=this.Ws.get(t.name);r===void 0?this.Ws.set(t.name,t.type):r===t.type||this.Vs.has(t.name)||(this.Vs.add(t.name),this.A.warn(`Metric name '${t.name}' is already used as a ${r}; recording it as a ${t.type} too will blend both series in charts. Use a distinct name.`)),this.Xs(n,t.value),this.Fs()}Ks(){return this.Mr.maxSeriesPerFlush>this.Hs.size||(this.Us||(this.Us=!0,this.A.warn(`Metric series cap reached (${this.Mr.maxSeriesPerFlush} per flush window); dropping new series until the next flush. Reduce attribute cardinality.`)),!1)}Xs(e,t){switch(e.type){case"count":var i;e.total=((i=e.total)!==null&&i!==void 0?i:0)+t;break;case"gauge":e.last=t;break;case"histogram":{e.hist||(e.hist={count:0,sum:0,min:t,max:t,bucketCounts:new Array(Zs.length+1).fill(0)});let s=e.hist;s.count+=1,s.sum+=t,s.min=Math.min(s.min,t),s.max=Math.max(s.max,t),s.bucketCounts[(function(n,r){for(let o=0;r.length>o;o++)if(r[o]>=n)return o;return r.length})(t,Zs)]+=1;break}}}Os(e){let t=this.Mr.beforeSend;if(!t)return e;let i=R(t)?t:[t],s=e;for(let n of i)try{let r=n(s);if(!r)return this.A.info("Metric was rejected in beforeSend function"),null;s=r}catch(r){return this.A.error("Error in beforeSend function for metric:",r),null}return s}Fs(){this.ps.pending||this.ps.arm(this.zs())}zs(){return Math.max(Vl(this.Mr.flushIntervalMs,this.ks,this.Ss,3e4),this.ws.remainingMs())}Zs(){var e=this;return ee(function*(){if(e.ps.clear(),e.Hs.size===0)return;let t=e.Hs;e.Hs=new Map,e.Us=!1,e.Ws=new Map,e.Vs=new Set;let i=e.Gs,s=yield e._instance.Ys(e.Js(t));if(i===e.Gs)switch(e.ws.record(s),s.kind==="retry-later"?(e.ks++,e.Ss=jl()):(e.ks=0,e.Ss=1),e.ps.pending&&e.ps.arm(e.zs()),s.kind){case"ok":return;case"retry-later":return e.co(t),void e.ps.armNoEarlierThan(e.zs());case"too-large":return void e.A.warn("Metrics batch exceeded the server size limit and was dropped");case"fatal":return void e.A.error("Failed to send metrics batch:",s.error)}})()}Js(e){return t=this.ho(e),i=(function(r,o,a){return Fl(r,o,a)})(this.Mr,this._instance.getLibraryId(),this._instance.getLibraryVersion()),s=this._instance.getLibraryId(),n=this._instance.getLibraryVersion(),{resourceMetrics:[{resource:{attributes:Ol(i)},scopeMetrics:[{scope:{name:s,version:n},metrics:t}]}]};var t,i,s,n}ho(e){let t=$o(Date.now()),i=new Map;for(let o of e.values()){var s;let a=Po(o.type,o.name,o.unit,void 0),l=i.get(a);l||(l=f({name:o.name},o.unit&&{unit:o.unit}),o.type==="count"?l.sum={aggregationTemporality:1,isMonotonic:!0,dataPoints:[]}:o.type==="gauge"?l.gauge={dataPoints:[]}:l.histogram={aggregationTemporality:1,dataPoints:[]},i.set(a,l));let c=vs((s=o.attributes)!==null&&s!==void 0?s:{},this.A),u=$o(o.windowStartMs);if(o.type==="count"){var n;let d={attributes:c,startTimeUnixNano:u,timeUnixNano:t,asDouble:(n=o.total)!==null&&n!==void 0?n:0};l.sum.dataPoints.push(d)}else if(o.type==="gauge"){var r;let d={attributes:c,timeUnixNano:t,asDouble:(r=o.last)!==null&&r!==void 0?r:0};l.gauge.dataPoints.push(d)}else o.hist&&l.histogram.dataPoints.push({attributes:c,startTimeUnixNano:u,timeUnixNano:t,count:o.hist.count,sum:o.hist.sum,min:o.hist.min,max:o.hist.max,bucketCounts:o.hist.bucketCounts,explicitBounds:Zs})}return Array.from(i.values())}co(e){for(let[s,n]of e){let r=this.Hs.get(s);if(r)switch(r.windowStartMs=Math.min(r.windowStartMs,n.windowStartMs),r.type){case"count":var t,i;r.total=((t=r.total)!==null&&t!==void 0?t:0)+((i=n.total)!==null&&i!==void 0?i:0);break;case"gauge":break;case"histogram":if(n.hist)if(r.hist){r.hist.count+=n.hist.count,r.hist.sum+=n.hist.sum,r.hist.min=Math.min(r.hist.min,n.hist.min),r.hist.max=Math.max(r.hist.max,n.hist.max);for(let o=0;r.hist.bucketCounts.length>o;o++)r.hist.bucketCounts[o]+=n.hist.bucketCounts[o]}else r.hist=n.hist}else this.Ks()&&this.Hs.set(s,n)}}},Hl=(e,{debugEnabled:t}={})=>{let i={N(s,...n){let r;try{r=typeof window>"u"?void 0:window}catch{return}r&&(st.DEBUG||r.POSTHOG_DEBUG||t)&&!x(r.console)&&r.console&&("__rrweb_original__"in r.console[s]?r.console[s].__rrweb_original__:r.console[s])(e,...n)},debug(...s){i.N("debug",...s)},info(...s){i.N("log",...s)},warn(...s){i.N("warn",...s)},error(...s){i.N("error",...s)},critical(...s){console.error(e,...s)},uninitializedWarning(s){i.error(`You must initialize PostHog before calling ${s}`)},createLogger:(s,n)=>Hl(`${e} ${s}`,n)};return i},M=Hl("[PostHog.js]"),re=M.createLogger,Nh=re("[ExternalScriptsLoader]"),gs=e=>{let t=E==null?void 0:E.querySelectorAll("script");if(t){for(let i=0;t.length>i;i++)if(t[i].src===e||t[i].getAttribute("src")===e)return t[i]}},Pt=(e,t,i)=>{if(e.config.disable_external_dependency_loading)return Nh.warn(`${t} was requested but loading of external scripts is disabled.`),i("Loading of external scripts is disabled");let s=gs(t);if(s){if(s.__posthog_loading_callback_fired)return i();let r=s.__posthog_loading_error;return r?i(r):(s.addEventListener("load",o=>{s.__posthog_loading_callback_fired=!0,i(void 0,o)}),void s.addEventListener("error",o=>{s.__posthog_loading_error=o,i(o)}))}let n=()=>{if(!E)return i("document not found");if(gs(t))return Pt(e,t,i);let r=E.createElement("script");if(r.type="text/javascript",r.crossOrigin="anonymous",r.src=t,r.onload=a=>{r.__posthog_loading_callback_fired=!0,i(void 0,a)},r.onerror=a=>{r.__posthog_loading_error=a,i(a)},e.config.prepare_external_dependency_script&&(r=e.config.prepare_external_dependency_script(r)),!r)return i("prepare_external_dependency_script returned null");if(e.config.external_scripts_inject_target==="head")E.head.appendChild(r);else{let a=E.querySelectorAll("body > script");var o;a.length>0?(o=a[0].parentNode)===null||o===void 0||o.insertBefore(r,a[0]):E.body.appendChild(r)}};E!=null&&E.body?n():E==null||E.addEventListener("DOMContentLoaded",n)},Ys={},Mo=(e,t)=>{let i=`/static/${t}.js?v=${e.version}`;return t==="toolbar"&&(i=`${i}&t=${Math.floor(Date.now()/3e5)*3e5}`),e.requestRouter.endpointFor("assets",i)};F.__PosthogExtensions__=F.__PosthogExtensions__||{},F.__PosthogExtensions__.loadExternalDependency=(e,t,i)=>{if(t==="remote-config"){let n=e.requestRouter.endpointFor("assets",`/array/${e.config.token}/config.js`);return void Pt(e,n,i)}let s=e.config.strict_script_versioning;if(s){let n=e.requestRouter.endpointFor("assets",`/static/${e.version}/${t}.js`),r=Ys[n];if(s==="fallback"&&r){if(gs(r))return void Pt(e,r,i);delete Ys[n]}return void Pt(e,n,s==="fallback"?(o,a)=>{if(o)if(typeof o=="string")i(o);else{var l;let c=Mo(e,t);Ys[n]=c;let u=gs(n);u==null||(l=u.parentNode)===null||l===void 0||l.removeChild(u),Pt(e,c,i)}else i(void 0,a)}:i)}Pt(e,Mo(e,t),i)},F.__PosthogExtensions__.loadSiteApp=(e,t,i)=>{let s=e.requestRouter.endpointFor("api",t);Pt(e,s,i)},st.DEBUG=!1,st.LIB_VERSION="1.438.2",st.LIB_NAME="web";var ue=st,Ln="$early_access_features",tt="$active_feature_flags",It="$feature_flag_details",Ci="$feature_flag_errors",mt="$feature_flag_evaluated_at",At="$feature_flag_request_id",wi="$minimal_flag_called_events",He="$enabled_feature_flags",ft="$stored_group_properties",vt="$stored_person_properties",gt="$flag_call_reported",gi="$flag_call_reported_session_id",_t="$feature_flag_payloads",Ze="$override_feature_flags",Mt="$override_feature_flag_payloads",Fi="visibilitychange",jh="$people_distinct_id",Ve="distinct_id",ur="$device_id",Xs="$device_model",_s="__alias",Vh="__cmpns",To="$fbc",Gt="$fbc_persistence",Io="$fbp",xi="$fbp_persistence",Dn="__timers",Bl="$autocapture_disabled_server_side",Nn="$heatmaps_enabled_server_side",jn="$exception_capture_enabled_server_side",Wl="$error_tracking_suppression_rules",Vn="$error_tracking_capture_extension_exceptions",Hn="$web_vitals_enabled_server_side",dr="$dead_clicks_enabled_server_side",hr="$product_tours_enabled_server_side",Ul="$logs_capture_enabled_server_side",zl="$web_vitals_allowed_metrics",ki="$session_recording_remote_config",Hh="$session_recording_enabled_server_side",Bh="$replay_sample_rate",Wh="$replay_override_sampling",Uh="$replay_override_linked_flag",zh="$replay_override_url_trigger",Gh="$replay_override_event_trigger",Ht="$sesid",Gl="$session_is_sampled",qh="$session_past_minimum_duration",Zh="$session_recording_url_trigger_activated_session",Yh="$session_recording_event_trigger_activated_session",Xh="$debug_first_full_snapshot_timestamp",Jh="$sess_rec_flush_size",ql="$groups",_i="$surveys",ms="$surveys_loaded_at",Zl="$surveys_activated",Yl="$surveys_activated_session",Xl="$surveys_activated_timestamps",Bn="ph_product_tours",Kh="$product_tours_activated",Qh="$product_tours_activated_session",ep="$conversations_widget_session_id",tp="$conversations_ticket_id",ip="$conversations_widget_state",sp="$conversations_user_traits",ke="$user_state",Wn="$client_session_props",np="$capture_rate_limit",Jl="$initial_campaign_params",Kl="$initial_referrer_info",Bt="$initial_person_info",pr="$epp",Js="$posthog_cookieless",Ql="$cookieless_mode",ec="$sdk_debug_extensions_init_method",tc="$sdk_debug_extensions_init_time_ms",fr="$sdk_debug_recording_script_not_loaded",vr="$sdk_debug_replay_stale_config",ic="$sdk_debug_replay_event_trigger_status",sc="$sdk_debug_replay_linked_flag_trigger_status",nc="$sdk_debug_replay_matched_recording_trigger_groups",rc="$sdk_debug_replay_pending_trigger_conditions",oc="$sdk_debug_replay_remote_trigger_matching_config",ac="$sdk_debug_replay_trigger_groups_count",lc="$sdk_debug_replay_url_trigger_status",rp="$session_recording_start_reason",gr="PostHog loadExternalDependency extension not found.",it="anonymous",ns="identified",cc="identified_only",ys="beforeunload",_r="$pageview",Ao="$pageleave",uc="$identify",Co="$groupidentify";function Wt(e,t){R(e)&&e.forEach(t)}function Z(e,t){if(!D(e))if(R(e))e.forEach(t);else if((i=>i instanceof FormData)(e))e.forEach((i,s)=>t(i,s));else for(let i in e)nr.call(e,i)&&t(e[i],i)}var Q=function(e,...t){for(let i of t)for(let s in i)i[s]!==void 0&&(e[s]=i[s]);return e};function rs(e){let t=Object.keys(e),i=t.length,s=new Array(i);for(;i--;)s[i]=[t[i],e[t[i]]];return s}var op=function(e){return function(...t){try{return e.apply(this,t)}catch(i){M.critical("Implementation error. Please turn on debug mode and open a ticket on https://app.posthog.com/home#panel=support%3Asupport%3A."),M.critical(i)}}},mr=function(e){let t={};return Z(e,function(i,s){(H(i)&&i.length>0||oe(i))&&(t[s]=i)}),t};function dc(e){let t=f({},e);for(let i of["name","message","stack","cause","errors"])try{i in e&&(t[i]=e[i])}catch{}return t}var ap=["herokuapp.com","vercel.app","netlify.app"];function lp(e){let t=e==null?void 0:e.hostname;if(!H(t))return!1;let i=t.split(".").slice(-2).join(".");for(let s of ap)if(i===s)return!1;return!0}function G(e,t,i,s){let{capture:n=!1,passive:r=!0}=s!=null?s:{};e==null||e.addEventListener(t,i,{capture:n,passive:r})}function Un(e){return e.name==="ph_toolbar_internal"}var Si=e=>{if(E){try{let t=e+"=",i=E.cookie.split(";").filter(s=>s.length);for(let s=0;i.length>s;s++){let n=i[s];for(;n.charAt(0)==" ";)n=n.substring(1,n.length);if(n.indexOf(t)===0)return decodeURIComponent(n.substring(t.length,n.length))}}catch{}return null}};Math.trunc||(Math.trunc=function(e){return 0>e?Math.ceil(e):Math.floor(e)}),Number.isInteger||(Number.isInteger=function(e){return oe(e)&&isFinite(e)&&Math.floor(e)===e});var cp=class zn{constructor(t){if(this.bytes=t,t.length!==16)throw new TypeError("not 128-bit length")}static fromFieldsV7(t,i,s,n){if(!Number.isInteger(t)||!Number.isInteger(i)||!Number.isInteger(s)||!Number.isInteger(n)||0>t||0>i||0>s||0>n||t>0xffffffffffff||i>4095||s>1073741823||n>4294967295)throw new RangeError("invalid field value");let r=new Uint8Array(16);return r[0]=t/Math.pow(2,40),r[1]=t/Math.pow(2,32),r[2]=t/Math.pow(2,24),r[3]=t/Math.pow(2,16),r[4]=t/256,r[5]=t,r[6]=112|i>>>8,r[7]=i,r[8]=128|s>>>24,r[9]=s>>>16,r[10]=s>>>8,r[11]=s,r[12]=n>>>24,r[13]=n>>>16,r[14]=n>>>8,r[15]=n,new zn(r)}toString(){let t="";for(let i=0;this.bytes.length>i;i++)t=t+(this.bytes[i]>>>4).toString(16)+(15&this.bytes[i]).toString(16),i!==3&&i!==5&&i!==7&&i!==9||(t+="-");if(t.length!==36)throw new Error("Invalid UUIDv7 was generated");return t}clone(){return new zn(this.bytes.slice(0))}equals(t){return this.compareTo(t)===0}compareTo(t){for(let i=0;16>i;i++){let s=this.bytes[i]-t.bytes[i];if(s!==0)return Math.sign(s)}return 0}},up=class{generate(){let e=this.generateOrAbort();if(!x(e))return e;{this.Ct=0;let t=this.generateOrAbort();if(x(t))throw new Error("Could not generate UUID after timestamp reset");return t}}generateOrAbort(){let e=(()=>{let t=Date.now();return oe(t)&&isFinite(t)?Math.min(Math.max(Math.floor(t),0),0xffffffffffff):0})();if(e>this.Ct)this.Ct=e,this.It();else{if(this.Ct>=e+1e4)return;this.Mt++,this.Mt>4398046511103&&(this.Ct++,this.It())}return cp.fromFieldsV7(this.Ct,Math.trunc(this.Mt/Math.pow(2,30)),this.Mt&Math.pow(2,30)-1,this.Tt.nextUint32())}It(){this.Mt=1024*this.Tt.nextUint32()+(1023&this.Tt.nextUint32())}constructor(){this.Ct=0,this.Mt=0,this.Tt=new dp}},hc=e=>{if("u">typeof UUIDV7_DENY_WEAK_RNG&&UUIDV7_DENY_WEAK_RNG)throw new Error("no cryptographically strong RNG available");for(let t=0;e.length>t;t++)e[t]=65536*Math.trunc(65536*Math.random())+Math.trunc(65536*Math.random());return e};b&&!x(b.crypto)&&crypto.getRandomValues&&(hc=e=>crypto.getRandomValues(e));var dp=class{nextUint32(){return this.Rt.length>this.Et||(hc(this.Rt),this.Et=0),this.Rt[this.Et++]}constructor(){this.Rt=new Uint32Array(8),this.Et=1/0}},Fo,Be=()=>hp().toString(),hp=()=>(Fo||(Fo=new up)).generate(),ci="",pp=/[a-z0-9][a-z0-9-]+\.[a-z]{2,}$/i,Ot=null,se={At(){if(!ne(Ot))return Ot;if(Ot=!1,E)try{let e=`__ph_cookie_support_${Be()}`;se.$t(e,"xyz"),Ot=Si(e)==='"xyz"',se.Pt(e)}catch{Ot=!1}return Ot},Dt(e){M.error("cookieStore error: "+e)},Ot:Si,Lt(e){let t;try{t=JSON.parse(se.Ot(e))||{}}catch{}return t},$t(e,t,i,s,n){if(!E)return!1;try{let r="",o="",a=(function(c,u){if(u){let d=(function(h,p=E){if(ci)return ci;if(!p||["localhost","127.0.0.1"].includes(h))return"";let v=h.split("."),_=Math.min(v.length,8),g="dmn_chk_"+Be();for(;!ci&&_--;){let y=v.slice(_).join("."),m=g+"=1;domain=."+y+";path=/";p.cookie=m+";max-age=3",p.cookie.includes(g)&&(p.cookie=m+";max-age=0",ci=y)}return ci})(c);if(!d){let h=(p=>{let v=p.match(pp);return v?v[0]:""})(c);h!==d&&M.info("Warning: cookie subdomain discovery mismatch",h,d),d=h}return d?"; domain=."+d:""}return""})(E.location.hostname,s);if(i){let c=new Date;c.setTime(c.getTime()+864e5*i),r="; expires="+c.toUTCString()}n&&(o="; secure");let l=e+"="+encodeURIComponent(JSON.stringify(t))+r+"; SameSite=Lax; path=/"+a+o;return l.length>3686.4&&M.warn("cookieStore warning: large cookie, len="+l.length),E.cookie=l,!0}catch{return!1}},Pt(e,t){if(E!=null&&E.cookie&&(!t||!ne(Si(e))))try{se.$t(e,"",-1,t)}catch{return}}},Ks=null,U={At(){if(!ne(Ks))return Ks;let e=!0;if(x(b))e=!1;else try{let t="__mplssupport__";U.$t(t,"xyz"),U.Ot(t)!=='"xyz"'&&(e=!1),U.Pt(t)}catch{e=!1}return e||M.error("localStorage unsupported; falling back to cookie store"),Ks=e,e},Dt(e){M.error("localStorage error: "+e)},Ot(e){try{return b==null?void 0:b.localStorage.getItem(e)}catch(t){U.Dt(t)}return null},Lt(e){try{return JSON.parse(U.Ot(e))||{}}catch{}return null},$t(e,t){try{return b==null||b.localStorage.setItem(e,JSON.stringify(t)),!0}catch(i){U.Dt(i)}return!1},Pt(e){try{b==null||b.localStorage.removeItem(e)}catch(t){U.Dt(t)}}},Qs=[vt,tt,He,It,_t,At,mt,Ci,gt],Tt=[ur,Ve,Ht,Gl,pr,Bt,Gt,ke],bs=e=>e+"_cpm",fp=["__proto__","constructor","prototype"],en=e=>{if(!j(e))return{};let t={};return Object.keys(e).forEach(i=>{fp.indexOf(i)===-1&&(t[i]=e[i])}),t},tn=(e,t=[])=>{let i={};return[...Tt,...t].forEach(s=>{let n=e[s];x(n)||ne(n)||n===""||(i[s]=n)}),i},pc=e=>{let t=5381,i=2166136261;for(let s=0;e.length>s;s++){let n=e.charCodeAt(s);t=33*t^n,i=Math.imul(i^n,16777619)}return e.length.toString(36)+"."+(t>>>0).toString(36)+"."+(i>>>0).toString(36)},Oo=(e,t)=>({p:t,f:pc(JSON.stringify(e))}),Ro=(e,t)=>{if(!t)return{properties:[],isValid:!1};try{let i=se.Lt(bs(e)),s=(i==null?void 0:i.f)===pc(t)&&R(i.p);return{properties:s?i.p:[],isValid:s}}catch{return{properties:[],isValid:!1}}},sn=(e,t)=>t+"|"+(se.Ot(bs(e))||""),Rt={},Gn={At:()=>!0,Dt(e){M.error("memoryStorage error: "+e)},Ot:e=>e in Rt?Rt[e]:null,Lt:e=>e in Rt?Rt[e]:null,$t:(e,t)=>(Rt[e]=t,!0),Pt(e){delete Rt[e]}},xt=null,J={At(){if(!ne(xt))return xt;if(xt=!0,x(b))xt=!1;else try{let e="__support__";J.$t(e,"xyz"),J.Ot(e)!=='"xyz"'&&(xt=!1),J.Pt(e)}catch{xt=!1}return xt},Dt(e){M.error("sessionStorage error: ",e)},Ot(e){try{return b==null?void 0:b.sessionStorage.getItem(e)}catch(t){J.Dt(t)}return null},Lt(e){try{return JSON.parse(J.Ot(e))||null}catch{}return null},$t(e,t){try{return b==null||b.sessionStorage.setItem(e,JSON.stringify(t)),!0}catch(i){J.Dt(i)}return!1},Pt(e){try{b==null||b.sessionStorage.removeItem(e)}catch(t){J.Dt(t)}}},vp=class{constructor(e){this._instance=e}get Mr(){return this._instance.config}get consent(){return this.Do()?0:this.Lo}isOptedOut(){return this.Mr.cookieless_mode==="always"||this.isRejected()||this.consent===-1&&this.Mr.cookieless_mode==="on_reject"}isOptedIn(){return!this.isOptedOut()}isExplicitlyOptedOut(){return this.consent===0}isRejected(){return this.consent===0||this.consent===-1&&this.Mr.opt_out_capturing_by_default}optInOut(e){this.No.$t(this.qo,e?1:0,this.Mr.cookie_expiration,this.Mr.cross_subdomain_cookie,this.Mr.secure_cookie)}reset(){this.No.Pt(this.qo,this.Mr.cross_subdomain_cookie)}get qo(){let{token:e,opt_out_capturing_cookie_prefix:t,consent_persistence_name:i}=this._instance.config;return i||(t?t+e:"__ph_opt_in_out_"+e)}get Lo(){let e=this.No.Ot(this.qo);return js(e)?1:O(fd,e)?0:-1}get No(){let e=this.Mr.opt_out_capturing_persistence_type,t=e==="localStorage"?U:se,i=t.At()?t:Gn;if(!this.jo||this.jo!==i){this.jo=i;let s=e==="localStorage"?se:U;s.Ot(this.qo)&&(this.jo.Ot(this.qo)||this.optInOut(js(s.Ot(this.qo))),s.Pt(this.qo,this.Mr.cross_subdomain_cookie))}return this.jo}Do(){return!!this.Mr.respect_dnt&&[pe==null?void 0:pe.doNotTrack,pe==null?void 0:pe.msDoNotTrack,F.doNotTrack,pe==null?void 0:pe.globalPrivacyControl].some(e=>js(e))}};function fc(e,t){var i;let s=e==null||(i=e.config)===null||i===void 0?void 0:i.get_current_url;if(!le(s))return t;try{let n=s(t);return H(n)&&n?n:t}catch(n){return M.error("Error in get_current_url, falling back to window.location.href",n),t}}function Lo(e){var t;return e instanceof Element&&(e.id==="__POSTHOG_TOOLBAR__"||!!(!((t=e.closest)===null||t===void 0)&&t.call(e,".toolbar-global-fade-container")))}function We(e){return!!e&&e.nodeType===1}function _e(e,t){return!!e&&!!e.tagName&&e.tagName.toLowerCase()===t.toLowerCase()}function vc(e){return!!e&&e.nodeType===3}function yr(e){return!!e&&e.nodeType===11&&We(e.host)}function br(e){return e?Zt(e).split(/\s+/):[]}function Do(e,t){let i=(function(s){var n;let r=b==null||(n=b.location)===null||n===void 0?void 0:n.href;return x(r)?void 0:fc(s,r)})(t);return!!(i&&e&&e.some(s=>i.match(s)))}function Xt(e){let t="";switch(typeof e.className){case"string":t=e.className;break;case"object":t=(e.className&&"baseVal"in e.className?e.className.baseVal:null)||e.getAttribute("class")||"";break;default:t=""}return br(t)}function gc(e){return D(e)?null:Zt(e).split(/(\s+)/).filter(t=>qt(t)).join("").replace(/[\r\n]/g," ").replace(/[ ]+/g," ").substring(0,255)}function Oi(e){let t="";return Ct(e)&&!Jt(e)&&e.childNodes&&e.childNodes.length&&Z(e.childNodes,function(i){var s;vc(i)&&i.textContent&&(t+=(s=gc(i.textContent))!==null&&s!==void 0?s:"")}),Zt(t)}function Ei(e){var t;return x(e.target)?e.srcElement||null:!((t=e.target)===null||t===void 0)&&t.shadowRoot?e.composedPath()[0]||null:e.target||null}var wr=["a","button","form","input","select","textarea","label"];function qn(e,t){let i=e.matches||e.matchesSelector||e.msMatchesSelector||e.mozMatchesSelector||e.webkitMatchesSelector||e.oMatchesSelector;try{return!!i&&i.call(e,t)}catch{return!1}}function Zn(e,t){if(x(t))return!0;for(let i of e)if(t.some(s=>qn(i,s)))return!0;return!1}function _c(e){let t=e.parentNode;return!(!t||!We(t))&&t}var nn=[".ph-no-autocapture","[data-ph-no-autocapture]"],mc=["next","previous","prev",">","<","\u2192","\u2190","\u203A","\u2039","\xBB","\xAB","\u25B6","\u25C0","\u276F","\u276E"],xr=[...mc,"+","-","\u2212","\u2013"],No=xr.length+10,gp=["button","a","input","select","textarea","label"],_p=["button","link","tab","menuitem","option"],jo=(e,t)=>/[a-z0-9]/i.test(t)?O(xr,t)?new RegExp(`\\b${t}\\b`).test(e):e.includes(t):e===t,mp=e=>O(gp,e.tagName.toLowerCase())||O(_p,(e.getAttribute("role")||"").toLowerCase());function rn(e){let t="",i="",s=o=>{We(o)&&Ct(o)&&!Jt(o)&&(t+=` ${Oi(o)}`,i=i||o.getAttribute("aria-label")||"",Z(o.childNodes,s))};s(e),t=Zt(t.replace(/\s+/g," "));let n=(qt(t)?t:"").toLowerCase(),r=e.getAttribute("aria-label")||(n?"":i);return{safeText:n,ariaLabel:Zt(r).toLowerCase()}}var Vo=[".ph-no-rageclick",".ph-no-capture"],yp=["","text","search","email","password","url","tel","number"];function yc(e,t){if(!b||kr(e))return!1;let i,s,n;var r,o;if(Se(t)?(i=!!t&&Vo,s=void 0,n=!1):(i=(r=t==null?void 0:t.css_selector_ignorelist)!==null&&r!==void 0?r:Vo,s=t==null?void 0:t.content_ignorelist,n=(o=t==null?void 0:t.ignore_text_selection)!==null&&o!==void 0&&o),i===!1||n&&(function(l){return!(!l||!We(l))&&(!!_e(l,"textarea")||(_e(l,"input")?O(yp,(l.getAttribute("type")||"").toLowerCase()):(function(c){var u;if(c.isContentEditable)return!0;let d=(u=c.getAttribute)===null||u===void 0?void 0:u.call(c,"contenteditable");return d==="true"||d===""})(l)))})(e))return!1;let{targetElementList:a}=bc(e,!1);return!(s&&(function(l,{safeText:c,ariaLabel:u}){let d;if(l===!0)d=mc;else{if(!R(l))return!1;if(l.length>No)return M.error(`[PostHog] content_ignorelist array cannot exceed ${No} items. Use css_selector_ignorelist for more complex matching.`),!1;d=l.map(h=>h.toLowerCase())}return d.some(h=>jo(c,h)||jo(u,h))})(s,(function(l,c){for(let u of c)if(mp(u))return rn(u);for(let u of c){try{if((b==null?void 0:b.getComputedStyle(u).getPropertyValue("cursor"))!=="pointer")break}catch{break}let d=rn(u);if(d.safeText||d.ariaLabel)return d}return rn(l)})(e,a))||Zn(a,i))}var kr=e=>!e||_e(e,"html")||!We(e),bc=(e,t)=>{if(!b||kr(e))return{parentIsUsefulElement:!1,targetElementList:[]};let i=!1,s=[e],n=e;for(;n.parentNode&&!_e(n,"body");){if(yr(n.parentNode)){s.push(n.parentNode.host),n=n.parentNode.host;continue}let r=_c(n);if(!r)break;if(t||wr.indexOf(r.tagName.toLowerCase())>-1)i=!0;else try{let o=b.getComputedStyle(r);o&&o.getPropertyValue("cursor")==="pointer"&&(i=!0)}catch{}s.push(r),n=r}return{parentIsUsefulElement:i,targetElementList:s}};function Ct(e){let t=new Set,i=0;for(let r=e;r.parentNode&&!_e(r,"body");r=r.parentNode){if(i++>=1e3||t.has(r))return!1;t.add(r);let o=Xt(r);if(O(o,"ph-sensitive")||O(o,"ph-no-capture"))return!1}if(O(Xt(e),"ph-include"))return!0;let s=e.type||"";if(H(s))switch(s.toLowerCase()){case"hidden":case"password":return!1}let n=e.name||e.id||"";return!H(n)||!/^cc|cardnum|ccnum|creditcard|csc|cvc|cvv|exp|pass|pwd|routing|seccode|securitycode|securitynum|socialsec|socsec|ssn/i.test(n.replace(/[^a-zA-Z0-9]/g,""))}function Jt(e){return!!(_e(e,"input")&&!["button","checkbox","submit","reset"].includes(e.type)||_e(e,"select")||_e(e,"textarea")||e.getAttribute("contenteditable")==="true")}var Ho=new RegExp("^(?:(4[0-9]{12}(?:[0-9]{3})?)|(5[1-5][0-9]{14})|(6(?:011|5[0-9]{2})[0-9]{12})|(3[47][0-9]{13})|(3(?:0[0-5]|[68][0-9])[0-9]{11})|((?:2131|1800|35[0-9]{3})[0-9]{11}))$"),Bo=/(^|[^0-9A-Za-z_])([0-9][0-9 -]*[0-9])(?=$|[^0-9A-Za-z_])/g,bp=[16,15,14,13],wp=new RegExp("^(\\d{3}-?\\d{2}-?\\d{4})$"),Wo=new RegExp("(^|[^0-9])((?!000|666)[0-9]{3}-?(?!00)[0-9]{2}-?(?!0000)[0-9]{4})(?=$|([^0-9]))","g"),Uo=/[0-9A-Za-z_]/;function xp(e){let t=0,i=!1;for(let s=e.length-1;s>=0;s--){let n=e.charCodeAt(s)-48;i&&(n*=2,n>9&&(n-=9)),t+=n,i=!i}return t%10==0}function qt(e,t=!0){return!(D(e)||H(e)&&(e=Zt(e),(t?Ho.test((e||"").replace(/[- ]/g,"")):(function(i){let s;for(Bo.lastIndex=0;s=Bo.exec(i);){let n=s[2];if(!n)continue;let r=n.replace(/[- ]/g,"");for(let o=0;r.length>o;o++)for(let a of bp){let l=o+a;if(r.length>=l){let c=r.slice(o,l);if(Ho.test(c)&&xp(c))return!0}}}return!1})(e))||(t?wp.test(e):(function(i){let s;for(Wo.lastIndex=0;s=Wo.exec(i);){let n=s[1],r=s[3];if(!(n&&r&&Uo.test(n)&&Uo.test(r)))return!0}return!1})(e))))}function zo(e){let t=Oi(e);return t=`${t} ${wc(e)}`.trim(),qt(t)?t:""}function wc(e){let t="";return e&&e.childNodes&&e.childNodes.length&&Z(e.childNodes,function(i){var s;if(i&&((s=i.tagName)===null||s===void 0?void 0:s.toLowerCase())==="span")try{let n=Oi(i);t=`${t} ${n}`.trim(),i.childNodes&&i.childNodes.length&&(t=`${t} ${wc(i)}`.trim())}catch(n){M.error("[AutoCapture]",n)}}),t}function Go(e){return e.replace(/"|\\"/g,'\\"')}function kp(e){let t=e.attr__class;if(t)return R(t)?t:br(t)}var Zi=re("[Dead Clicks]"),Sp=()=>!0,Ep=e=>{var t;let i=!!(!((t=e.instance.persistence)===null||t===void 0)&&t.get_property(dr)),s=e.instance.config.capture_dead_clicks;return Se(s)?s:!!j(s)||i},qo=class{get lazyLoadedDeadClicksAutocapture(){return this.Bo}constructor(e,t,i){this.instance=e,this.isEnabled=t,this.onCapture=i,this.startIfEnabledOrStop()}onRemoteConfig(e){if(!e.ok)return;let t=e.config;"captureDeadClicks"in t&&(this.instance.persistence&&this.instance.persistence.register({[dr]:t.captureDeadClicks}),this.startIfEnabledOrStop())}startIfEnabledOrStop(){this.isEnabled(this)?this.zo(()=>{this.Ho()}):this.stop()}zo(e){var t,i,s;!((t=F.__PosthogExtensions__)===null||t===void 0)&&t.initDeadClicksAutocapture?e():(i=F.__PosthogExtensions__)===null||i===void 0||(s=i.loadExternalDependency)===null||s===void 0||s.call(i,this.instance,"dead-clicks-autocapture",n=>{n?Zi.error("failed to load script",n):e()})}Ho(){var e;if(E){if(!this.Bo&&(!((e=F.__PosthogExtensions__)===null||e===void 0)&&e.initDeadClicksAutocapture)){let t=j(this.instance.config.capture_dead_clicks)?f({},this.instance.config.capture_dead_clicks):{};t.__onCapture=this.onCapture,this.onCapture&&(t.capture_dead_swipes=!1),this.Bo=F.__PosthogExtensions__.initDeadClicksAutocapture(this.instance,t),this.Bo.start(E),Zi.info("starting...")}}else Zi.error("`document` not found. Cannot start.")}stop(){this.Bo&&(this.Bo.stop(),this.Bo=void 0,Zi.info("stopping..."))}},ui=re("[SegmentIntegration]");function Zo(e,t,i=!0){let s=e.config.segment;if(!s)return t();let{analytics:n,filterProperties:r}=(a=>le(a.register))(o=s)?{analytics:o}:o;var o;(function(a,l,c,u){let d=p=>{let v=()=>p.anonymousId()||Be();a.config.get_device_id=v,u&&p.id()&&(a.register({distinct_id:p.id(),$device_id:v()}),a.persistence.set_property(ke,ns)),c(u?void 0:p.anonymousId()||void 0)},h=l.user();"then"in h&&le(h.then)?h.then(d):d(h)})(e,n,a=>{n.register(((l,c,{filterProperties:u}={})=>{typeof Promise!="undefined"&&Promise.resolve||ui.warn("This browser does not have Promise support, and can not use the segment integration");let d=(h,p)=>{if(!p)return h;let v=!!c&&h.event.anonymousId===c&&!h.event.userId;v||h.event.userId||h.event.anonymousId===l.get_distinct_id()||(ui.info("No userId set, resetting PostHog"),l.reset()),v||(c=void 0),h.event.userId&&h.event.userId!==l.get_distinct_id()&&(ui.info("UserId set, identifying with PostHog"),l.identify(h.event.userId));let _=l.calculateEventProperties(p,h.event.properties);if(!D(u)){let g=h.event.properties||{},y={};for(let w of Object.keys(_))nr.call(g,w)||(y[w]=_[w]);let m=((w,P)=>{let $=R(w)?w:[w],k=f({},P);for(let T of $)try{if(k=T(k),D(k))return null}catch(S){return ui.error("Error in Segment filterProperties:",S),null}return k})(u,y);if(D(m))return h;_=m}return h.event.properties=Object.assign({},_,h.event.properties),h};return{name:"PostHog JS",type:"enrichment",version:"1.0.0",isLoaded(){return!0},load(){return Promise.resolve()},track(h){return d(h,h.event.event)},page(h){return d(h,_r)},identify(h){return d(h,uc)},screen(h){return d(h,"$screen")}}})(e,a,{filterProperties:r})).then(()=>{t()},l=>{ui.error("Failed to register the Segment integration",l),t()})},i)}var xc="posthog-js";function kc(e,{organization:t,projectId:i,prefix:s,severityAllowList:n=["error"],sendExceptionsToPostHog:r=!0}={}){return o=>{var a,l,c,u,d;if(n!=="*"&&!n.includes(o.level)||!e.__loaded)return o;o.tags||(o.tags={});let h=e.requestRouter.endpointFor("ui",`/project/${e.config.token}/person/${e.get_distinct_id()}`);o.tags["PostHog Person URL"]=h,e.sessionRecordingStarted()&&(o.tags["PostHog Recording URL"]=e.get_session_replay_url({withTimestamp:!0}));let p=((a=o.exception)===null||a===void 0?void 0:a.values)||[],v=p.map(y=>f(f({},y),{},{stacktrace:y.stacktrace?f(f({},y.stacktrace),{},{type:"raw",frames:(y.stacktrace.frames||[]).map(m=>f(f({},m),{},{platform:"web:javascript"}))}):void 0})),_={$exception_message:((l=p[0])===null||l===void 0?void 0:l.value)||o.message,$exception_type:(c=p[0])===null||c===void 0?void 0:c.type,$exception_level:o.level,$exception_list:v,$sentry_event_id:o.event_id,$sentry_exception:o.exception,$sentry_exception_message:((u=p[0])===null||u===void 0?void 0:u.value)||o.message,$sentry_exception_type:(d=p[0])===null||d===void 0?void 0:d.type,$sentry_tags:o.tags};var g;return t&&i&&(_.$sentry_url=(s||"https://sentry.io/organizations/")+t+"/issues/?project="+i+"&query="+o.event_id),r&&((g=e.exceptions)===null||g===void 0||g.sendExceptionEvent(_)),o}}var $p=class{constructor(e,t,i,s,n,r){this.name=xc,this.setupOnce=function(o){o(kc(e,{organization:t,projectId:i,prefix:s,severityAllowList:n,sendExceptionsToPostHog:r==null||r}))}}},Yo=class{constructor(e){this.Uo=(t,i,s)=>{s&&(s.noSessionId||s.activityTimeout||s.sessionPastMaximumLength||s.crossTabAdoption)&&(M.info("[PageViewManager] Session rotated, clearing pageview state",{sessionId:t,changeReason:s}),this.Wo=void 0,this._instance.scrollManager.resetContext())},this._instance=e,this.Vo()}Vo(){var e;this.Go=(e=this._instance.sessionManager)===null||e===void 0?void 0:e.onSessionId(this.Uo)}destroy(){var e;(e=this.Go)===null||e===void 0||e.call(this),this.Go=void 0}doPageView(e,t){var i;let s=this.Qo(e,t);return this.Wo={pathname:(i=b==null?void 0:b.location.pathname)!==null&&i!==void 0?i:"",pageViewId:t,timestamp:e},this._instance.scrollManager.resetContext(),s}doPageLeave(e){var t;return this.Qo(e,(t=this.Wo)===null||t===void 0?void 0:t.pageViewId)}doEvent(){var e;return{$pageview_id:(e=this.Wo)===null||e===void 0?void 0:e.pageViewId}}Qo(e,t){let i=this.Wo;if(!i)return{$pageview_id:t};let s={$pageview_id:t,$prev_pageview_id:i.pageViewId},n=this._instance.scrollManager.getContext();if(n&&!this._instance.config.disable_scroll_properties){let{maxScrollHeight:r,lastScrollY:o,maxScrollY:a,maxContentHeight:l,lastContentY:c,maxContentY:u}=n;if(!(x(r)||x(o)||x(a)||x(l)||x(c)||x(u))){r=Math.ceil(r),o=Math.ceil(o),a=Math.ceil(a),l=Math.ceil(l),c=Math.ceil(c),u=Math.ceil(u);let d=r>1?Xe(o/r,0,1,M):1,h=r>1?Xe(a/r,0,1,M):1,p=l>1?Xe(c/l,0,1,M):1,v=l>1?Xe(u/l,0,1,M):1;s=Q(s,{$prev_pageview_last_scroll:o,$prev_pageview_last_scroll_percentage:d,$prev_pageview_max_scroll:a,$prev_pageview_max_scroll_percentage:h,$prev_pageview_last_content:c,$prev_pageview_last_content_percentage:p,$prev_pageview_max_content:u,$prev_pageview_max_content_percentage:v})}}return i.pathname&&(s.$prev_pageview_pathname=i.pathname),i.timestamp&&(s.$prev_pageview_duration=(e.getTime()-i.timestamp.getTime())/1e3),s}},di=["flags","surveys"],Pp={[jh]:{exposure:"hidden"},[_s]:{exposure:"hidden"},[Vh]:{exposure:"hidden"},[Dn]:{exposure:"hidden"},[Gt]:{exposure:"hidden"},[xi]:{exposure:"hidden"},[Bl]:{exposure:"event"},[Nn]:{exposure:"hidden"},[Ul]:{exposure:"hidden"},[jn]:{exposure:"event"},[Wl]:{exposure:"hidden"},[Vn]:{exposure:"event"},[Hn]:{exposure:"event"},[dr]:{exposure:"event"},[hr]:{exposure:"hidden"},[zl]:{exposure:"event"},[ki]:{exposure:"hidden"},[Hh]:{exposure:"hidden"},[Ht]:{exposure:"hidden"},[Gl]:{exposure:"event"},[Bh]:{exposure:"event",shouldSkipFromEventProperties:e=>ne(e)},[qh]:{exposure:"event"},[Zh]:{exposure:"event"},[Yh]:{exposure:"event"},[Xh]:{exposure:"event"},[Jh]:{exposure:"hidden"},[He]:{exposure:"hidden",storageGroup:"flags"},[tt]:{exposure:"hidden",storageGroup:"flags"},[Ln]:{exposure:"hidden"},[It]:{exposure:"hidden",storageGroup:"flags"},[_t]:{exposure:"hidden",storageGroup:"flags"},[At]:{exposure:"hidden",storageGroup:"flags",volatile:!0},[wi]:{exposure:"hidden",storageGroup:"flags"},[Ze]:{exposure:"hidden"},[Mt]:{exposure:"hidden"},[vt]:{exposure:"hidden"},[ft]:{exposure:"hidden"},[_i]:{exposure:"hidden",storageGroup:"surveys"},[ms]:{exposure:"hidden",storageGroup:"surveys",volatile:!0},[Zl]:{exposure:"event"},[Yl]:{exposure:"hidden"},[Xl]:{exposure:"hidden"},[Bn]:{exposure:"hidden"},[Kh]:{exposure:"hidden"},[Qh]:{exposure:"hidden"},[ep]:{exposure:"event"},[tp]:{exposure:"event"},[ip]:{exposure:"event"},[sp]:{exposure:"event"},[gt]:{exposure:"hidden"},[gi]:{exposure:"hidden"},[ql]:{exposure:"event"},[Ci]:{exposure:"hidden"},[mt]:{exposure:"hidden",storageGroup:"flags",volatile:!0},[ke]:{exposure:"hidden"},[Wn]:{exposure:"hidden"},[np]:{exposure:"hidden"},[Jl]:{exposure:"hidden"},[Kl]:{exposure:"hidden"},[Bt]:{exposure:"hidden"},[pr]:{exposure:"hidden"},[Wh]:{exposure:"event"},[Uh]:{exposure:"event"},[zh]:{exposure:"event"},[Gh]:{exposure:"event"},[ec]:{exposure:"event"},[tc]:{exposure:"event"},[fr]:{exposure:"hidden"},[vr]:{exposure:"hidden"},[ic]:{exposure:"hidden"},[sc]:{exposure:"hidden"},[nc]:{exposure:"hidden"},[rc]:{exposure:"hidden"},[oc]:{exposure:"hidden"},[ac]:{exposure:"hidden"},[lc]:{exposure:"hidden"},[rp]:{exposure:"event"}},Mp=[["$posthog_sr_group_event_trigger_",{exposure:"hidden"}],["$posthog_sr_group_url_trigger_",{exposure:"hidden"}],["$posthog_sr_group_sampling_",{exposure:"hidden"}]],fe=e=>{let t=Pp[e];if(t)return t;for(let[i,s]of Mp)if(e.indexOf(i)===0)return s};function Sc(){try{return Intl.DateTimeFormat().resolvedOptions().timeZone}catch{return}}var Ec=()=>{try{return"u">typeof window&&window.navigator.onLine!==!1}catch{return!1}},$c=(e,t)=>e>=t&&Ec(),Pc=(e,t,i,s)=>{if(e===0){if(Ec()){let n=t+1;return n===i&&s(),n}return t}return 0},Ut=(e,t)=>{try{let i;return JSON.stringify(e,(s,n)=>{var r;return ii(n)?((r=i)!==null&&r!==void 0||(i=new WeakMap),i.has(n)||i.set(n,dc(n)),i.get(n)):typeof n=="bigint"?n.toString():n},t)}catch{return ja(e)}},nt=e=>{let t=E==null?void 0:E.createElement("a");return x(t)?null:(t.href=e,t)},Kt=function(e,t){let i=((e.split("#")[0]||"").split(/\?(.*)/)[1]||"").replace(/^\?+/g,"").split("&"),s;for(let n=0;i.length>n;n++){let r=i[n].split("=");if(r[0]===t){s=r;break}}if(!R(s)||2>s.length)return"";{let n=s[1];try{n=decodeURIComponent(n)}catch{M.error("Skipping decoding for malformed query param: "+n)}return n.replace(/\+/g," ")}},Ri=function(e,t,i){if(!e||!t||!t.length)return e;let s=e.split("#"),n=s[1],r=(s[0]||"").split("?"),o=r[1],a=r[0],l=(o||"").split("&"),c=[];for(let d=0;l.length>d;d++){let h=l[d].split("=");R(h)&&(t.includes(h[0])?c.push(h[0]+"="+i):c.push(l[d]))}let u=a;return o!=null&&(u+="?"+c.join("&")),n!=null&&(u+="#"+n),u},ws=function(e,t){let i=e.match(new RegExp(t+"=([^&]*)"));return i?i[1]:null},Qt=["gclid","gclsrc","dclid","gbraid","wbraid","fbclid","msclkid","twclid","li_fat_id","igshid","ttclid","rdt_cid","epik","qclid","sccid","oppref","irclid","_kx"],Tp=["utm_source","utm_medium","utm_campaign","utm_content","utm_term","gad_source","mc_cid",...Qt],Li="<masked>",Ip=["li_fat_id"];function Mc(e,t,i){if(!E)return{};let s=t?[...Qt,...i||[]]:[],n=Tc(Ri(E.URL,s,Li),e),r=(function(){let o={};return Z(Ip,function(a){let l=Si(a);o[a]=l||null}),o})();return Q(r,n)}function Tc(e,t){let i=Tp.concat(t||[]),s={};return Z(i,function(n){let r=Kt(e,n);s[n]=r||null}),s}function Ic(e){let t=(function(n){return n?n.search("https?://(.*)google.([^/?]*)")===0?"google":n.search("https?://(.*)bing.com")===0?"bing":n.search("https?://(.*)yahoo.com")===0?"yahoo":n.search("https?://(.*)duckduckgo.com")===0?"duckduckgo":null:null})(e),i=t!="yahoo"?"q":"p",s={};if(!ne(t)){s.$search_engine=t;let n=E?Kt(E.referrer,i):"";n.length&&(s.ph_keyword=n)}return s}function Ac(){return navigator.language||navigator.userLanguage}function Ap(){let e=Ac();return typeof e=="string"?e.split("-")[0]:void 0}var xs="$direct";function Cc(){return(E==null?void 0:E.referrer)||xs}function Fc(e,t,i=!1){let s=e?[...Qt,...t||[]]:[],n=i?yt(K==null?void 0:K.href):K==null?void 0:K.href,r=n==null?void 0:n.substring(0,1e3);return{r:Cc().substring(0,1e3),u:r?Ri(r,s,Li):void 0}}function Oc(e,t=!1){var i;let{r:s,u:n}=e,r=t?yt(n):n,o={$referrer:s,$referring_domain:s==null?void 0:s==xs?xs:(i=nt(s))===null||i===void 0?void 0:i.host};if(r){o.$current_url=r;let a=nt(r);o.$host=a==null?void 0:a.host,o.$pathname=a==null?void 0:a.pathname;let l=Tc(r);Q(o,l)}if(s){let a=Ic(s);Q(o,a)}return o}function Cp(){try{return new Date().getTimezoneOffset()}catch{return}}var Fp={flags:mt,surveys:ms},Op=["cookie","localstorage","localstorage+cookie","sessionstorage","memory"],Yi=e=>`${e}_cookie_identity_change_pending`,Xi=e=>{let t="",i=0;for(let s of e){let n=encodeURIComponent(JSON.stringify(s).slice(1,-1)).length;if(i+n>1e3)break;t+=s,i+=n}return t},ce="main",et=[He,tt,It,_t,At,mt,wi,vt],on=e=>et.indexOf(e)!==-1,Rc=[Gt,xi],Xo=e=>Rc.indexOf(e)!==-1,ut=(e,t)=>{try{return JSON.stringify(e)===JSON.stringify(t)}catch{return e===t}},Lt=e=>{if(!e)return{};let t=JSON.parse(e);return j(t)?t:{}},Jo=(e,t)=>{Z(e,(i,s)=>{let n=fe(s);n&&n.exposure!=="event"||{}.hasOwnProperty.call(t,s)||delete e[s]})},an=class{constructor(e,t,i=!0,s=!e.cookieless_mode){if(this.Zo={},this.Jo=!1,this.Ko=!1,this.Xo=!1,this.Yo=!1,this.ta=!1,this.ea=new Map,this.ia=!1,this.na=!1,this.sa=!1,this.ra=new Set,this.oa=new Set,this.Mr=e,this.aa=i,this.props={},this.la=void 0,this.ua=(n=>{let r="";return n.token&&(r=n.token.replace(/\+/g,"PL").replace(/\//g,"SL").replace(/=/g,"EQ")),n.persistence_name?"ph_"+n.persistence_name:"ph_"+r+"_posthog"})(e),this.hi=e.disable_persistence||!!t,this.No=this.ca(e),this.Xo=this.ha(e),this.load(s),this.da(),e.debug&&M.info("Persistence loaded",e.persistence,f({},this.props)),this.update_config(e,e,t),this.save(),b){let n=()=>this.flush();G(b,"beforeunload",n,{capture:!1}),G(b,"pagehide",n,{capture:!1}),this.va=r=>{if(this.Jo&&(!r.storageArea||r.storageArea===(b==null?void 0:b.localStorage))&&r.key)if(r.key!==this.ua){if(this.Xo){let o=di.find(a=>r.key===this.fa(a));o&&this.pa(r.key,o)}}else this.pa(r.key,ce)},G(b,"storage",this.va)}}markCrossTabFeatureFlagChanges(e){Object.entries(e).forEach(([t,i])=>{let s=this.ea.get(t);if(!on(t)||s===!0)return;if(i===!0)return void this.ga(t,!0);let n=new Set(s||[]);i.forEach(r=>n.add(r)),n.size&&this.ga(t,n)})}onCrossTabFeatureFlagChange(e){return this.oa.add(e),()=>this.oa.delete(e)}destroy(){this.va&&b&&(b.removeEventListener("storage",this.va),this.va=void 0),this.oa.clear()}pa(e,t,i=!0){if(this.hi)return!1;let s,n;try{if(n=U.Ot(e),ne(n)){let a=this.ma(t);return a.storageValue=null,t!==ce&&(a.persisted=!1),!1}s=Lt(n)}catch{return!1}let r=t===ce?s:U.Lt(this.ua);if(r&&this.ya(r))return!1;let o=this.ba(s,t,i);return t===ce&&this.Xo&&!ut(this._a().main,s)||this.wa(s,t,!0,n),o}ya(e){let t=this.props[Ve],i=e[Ve];return!x(t)&&!x(i)&&t!==i}wa(e,t,i,s){let n=this.ma(t);n.storageValue=s,t!==ce&&(n.persisted=i);try{n.fingerprint=this.ka(e,t)}catch{n.fingerprint=void 0}}ba(e,t,i){let s=!1;return et.forEach(n=>{var r;let o=(r=fe(n))===null||r===void 0?void 0:r.storageGroup;if(t===ce&&this.Xo&&o||t!==ce&&o!==t)return;let a=n in e,l=this.Sa(n,a?e[n]:void 0),c=this.ea.has(n)?n in this.props:a;c===n in this.props&&ut(l,this.props[n])||(c?this.xa(n,l,!1):this.$a(n,!1),s=!0)}),s&&i&&this.oa.forEach(n=>n()),s}Ca(){if(!this.Jo)return!1;try{this.sa=!1;let e=U.Ot(this.ua),t=this.ma(ce),i,s=!1,n=!1;if(e!==t.storageValue)if(ne(e))t.storageValue=null;else{if(i=Lt(e),this.sa=!this.na&&this.ya(i),this.sa)return!1;n=this.ba(i,ce,!1),!this.Xo||ut(this._a().main,i)?this.wa(i,ce,!0,e):t.storageValue=e,s=!0}return this.Xo&&di.forEach(r=>{let o=U.Ot(this.fa(r)),a=this.ma(r),l=i||{},c=s&&et.some(d=>{var h;return((h=fe(d))===null||h===void 0?void 0:h.storageGroup)===r&&d in l});if(o===a.storageValue&&!c)return;if(ne(o))return a.storageValue=null,a.persisted=!1,void(c&&(n=this.ba(l,r,!1)||n));let u=Lt(o);n=this.ba(u,r,!1)||n,this.wa(u,r,!0,o)}),n}catch{return!1}}ga(e,t){this.ea.set(e,t);let i=fe(e);i!=null&&i.volatile||(this.ma((this.Xo?i==null?void 0:i.storageGroup:void 0)||ce).fingerprint=void 0,this.Ta(e))}Ia(){et.forEach(e=>this.ea.set(e,!0))}da(){if(this.Jo)try{let e=U.Ot(this.ua),t=Lt(e);this.ma(ce).storageValue=e,et.forEach(i=>{var s;let n=this.Xo?(s=fe(i))===null||s===void 0?void 0:s.storageGroup:void 0,r=n?U.Ot(this.fa(n)):null;if(n){let a=this.ma(n);a.storageValue=r,a.persisted=!ne(r)}let o=n&&!ne(r)?Lt(r):t;i in this.props?this.Ma(i,o[i],this.props[i]):i in o&&this.ga(i,!0)})}catch{}}Sa(e,t){let i=this.ea.get(e);if(!i)return t;if(i===!0)return this.props[e];if(e==="$active_feature_flags"){let r=new Set(R(t)?t:[]),o=new Set(R(this.props[e])?this.props[e]:[]);return i.forEach(a=>o.has(a)?r.add(a):r.delete(a)),Array.from(r)}let s=j(t)?f({},t):{},n=j(this.props[e])?this.props[e]:{};return i.forEach(r=>{r in n?s[r]=n[r]:delete s[r]}),s}Ma(e,t,i){if(!on(e))return;let s=this.ea.get(e);if(s===!0)return;let n=t;if(this.Jo)try{var r;let a=this.Xo?(r=fe(e))===null||r===void 0?void 0:r.storageGroup:void 0,l=a?this.fa(a):this.ua;n=Lt(U.Ot(l))[e]}catch{}let o=new Set(s||[]);if(e==="$active_feature_flags"){if(!x(t)&&!R(t)||!x(n)&&!R(n)||!R(i))return void this.ga(e,!0);let a=new Set(t||[]),l=new Set(n||[]),c=new Set(i);new Set([...a,...c]).forEach(u=>{a.has(u)!==c.has(u)&&o.add(u)}),o.forEach(u=>{l.has(u)===c.has(u)&&o.delete(u)})}else{if(!j(i))return void(ut(n,i)?this.ea.delete(e):this.ga(e,!0));{if(!x(t)&&!j(t)||x(t)&&Me(i)&&x(n))return void this.ga(e,!0);let a=j(t)?t:{},l=j(n)?n:{};new Set([...Object.keys(a),...Object.keys(i)]).forEach(c=>{c in a==c in i&&ut(a[c],i[c])||o.add(c)}),o.forEach(c=>{c in l==c in i&&ut(l[c],i[c])&&o.delete(c)})}}o.size?this.ga(e,o):this.ea.delete(e)}Ea(){var e;let t=(e=this.Mr)===null||e===void 0?void 0:e.persistence_save_debounce_ms;return oe(t)&&t>0?t:0}Pa(e){if(this.Mr.cookieWinsOnConflict&&this.Mr.persistence.toLowerCase()==="localstorage+cookie")if(e)try{let t=tn(e,this.Mr.cookie_persisted_properties||[]),i=Oo(t,this.Mr.cookie_persisted_properties||[]),s=JSON.stringify(t)+"|"+JSON.stringify(i),n=se.Ot(this.ua)||void 0;n&&sn(this.ua,n)===s&&(this.Ra=s,this.Aa=n)}catch{}else try{let t=se.Ot(this.ua)||void 0;this.Ra=t?sn(this.ua,t):void 0,this.Aa=t}catch{}}syncCookieProperties(){return this.Fa(this.Mr)}Fa(e,t=!1){if(this.hi&&!t||this.ta||!e.cookieWinsOnConflict||e.persistence.toLowerCase()!=="localstorage+cookie")return!1;let i;try{i=se.Ot(this.ua)||void 0}catch{}if(!i||i===this.Aa)return!1;let s=sn(this.ua,i),n;try{n=en(JSON.parse(i))}catch{return!1}if((se.Ot(this.ua)||void 0)!==i)return!1;this.Ra=s,this.Aa=i;let r=Ro(this.ua,i),o=[...Tt,...r.properties],a={};if(Object.keys(n).forEach(_=>{let g=n[_];(x(g)||ne(g)||g===""||_==="$user_state"&&g!=="anonymous"&&g!=="identified")&&(a[_]=!0,delete n[_])}),Me(n))return!1;let l="distinct_id"in n||n.$user_state==="anonymous"||n.$user_state==="identified",c=this.props,u=c[Ve],d=c[ke],h=Q({},c);[...Tt,...e.cookie_persisted_properties||[]].forEach(_=>{if(o.indexOf(_)!==-1&&!(_ in n)&&!a[_]&&(l||_!=="distinct_id"&&_!=="$user_state")){let g=h[_];(r.isValid||Tt.indexOf(_)===-1||g!==!1&&g!==0)&&delete h[_]}}),this.props=Q(h,n),et.forEach(_=>{let g=_ in this.props;_ in c===g&&ut(c[_],this.props[_])||(g?this.Ma(_,c[_],this.props[_]):this.ga(_,!0))}),!l||"$user_state"in n||"$user_state"in this.props||this.xa(ke,it);let p=this.props[Ve],v=this.props[ke];return!l||p===u&&v===d||(this.na=!0,this.Yo=!0,J.$t(Yi(this.ua),!0),this.$a(vt),this.$a(tt),this.$a(He),this.$a(It),this.$a(_t),this.$a(At),this.$a(mt),this.$a(Ci),this.$a(gt),v!=="anonymous"||d!=="identified"&&n.$user_state!=="anonymous"&&(x(u)||p===u)||(Jo(this.props,n),this.$a(ft)),v==="identified"?this.props.$user_id=p:delete this.props.$user_id,this.$a(_s)),!0}consumeCookieIdentityChange(){let e=Yi(this.ua),t=this.Yo||!!J.Ot(e);return this.Yo=!1,t&&J.Pt(e),t}Oa(e=!1){return!(this.ta||this.hi&&!e||!this.Mr.cookieWinsOnConflict||this.Mr.persistence.toLowerCase()!=="localstorage+cookie"||(this.ta=!0,0))}Da(){this.ta&&(x(this.La)||(clearTimeout(this.La),this.La=void 0),delete this.Zo[ce],this.Na(!0))}qa(e=!0){if(this.ta)try{e?this.Da():x(this.La)||(clearTimeout(this.La),this.La=void 0)}finally{this.ta=!1}}isDisabled(){return!!this.hi}ca(e){Op.indexOf(e.persistence.toLowerCase())===-1&&(M.critical("Unknown persistence type "+e.persistence+"; falling back to localStorage+cookie"),e.persistence="localStorage+cookie");let t=((o=[],a=!1,l=()=>!1)=>{let c=[...Tt,...o];return f(f({},U),{},{Lt(u){try{let h,p={};try{h=se.Ot(u)||void 0,p=h?en(JSON.parse(h)):{}}catch{}let v=JSON.parse(U.Ot(u)||"{}"),_;if(a){let g=Ro(u,h),y=[...Tt,...g.properties],m={};Object.keys(p).forEach(P=>{let $=p[P];ne($)||$===""||P==="$user_state"&&$!=="anonymous"&&$!=="identified"||(m[P]=$)});let w="distinct_id"in m||m.$user_state==="anonymous"||m.$user_state==="identified";if(Object.keys(m).length>0){var d;let P=v[Ve],$=(d=v.$user_state)!==null&&d!==void 0?d:it;c.forEach(k=>{if(y.indexOf(k)!==-1&&!(k in p)&&(w||k!=="distinct_id"&&k!=="$user_state")){let T=v[k];(g.isValid||Tt.indexOf(k)===-1||T!==!1&&T!==0)&&delete v[k]}}),!w||"$user_state"in p||"$user_state"in v||(v[ke]=it),!w||("distinct_id"in m?m[Ve]:v[Ve])===P&&("$user_state"in m?m[ke]:v[ke])===$||(Qs.forEach(k=>delete v[k]),m.$user_state==="identified"&&"distinct_id"in m?v.$user_id=m[Ve]:delete v.$user_id,m.$user_state!=="identified"&&(delete v[ql],delete v[ft]),delete v.__alias)}_=Q(v,m)}else _=Q(p,v);return l()||U.$t(u,_),_}catch{}return null},$t(u,d,h,p,v,_){let g=U.$t(u,d,void 0,void 0,_);try{let y=tn(d,o);if(Object.keys(y).length){if(a){let m=bs(u),w=Oo(y,o);if(se.$t(m,w,h,p,v,_),se.Ot(m)!==JSON.stringify(w)){se.Pt(m,p);let P=tn(d);return se.$t(u,P,h,p,v,_),g}}se.$t(u,y,h,p,v,_)}}catch(y){U.Dt(y)}return g},Pt(u,d){try{b==null||b.localStorage.removeItem(u),se.Pt(u,d),se.Pt(bs(u),d)}catch(h){U.Dt(h)}}})})(e.cookie_persisted_properties||[],e.cookieWinsOnConflict,()=>!!this.hi),i,s=!1,n=!1,r=e.persistence.toLowerCase();return r==="localstorage"&&U.At()?(i=U,n=!0):r==="localstorage+cookie"&&t.At()?(i=t,n=!0,s=!0):r==="sessionstorage"&&J.At()?i=J:r==="memory"?i=Gn:r==="cookie"&&se.At()?(i=se,s=!0):t.At()?(i=t,n=!0,s=!0):se.At()?(i=se,s=!0):i=Gn,this.Jo=n,this.Ko=s,i}fa(e){return`${this.ua}__${e}`}ha(e){return this.Jo&&!!e.split_storage}properties(){let e={};return Z(this.props,(t,i)=>{let s=fe(i);if(!s||s.exposure==="event"){var n;if(!(s==null||(n=s.shouldSkipFromEventProperties)===null||n===void 0)&&n.call(s,t))return;e[i]=t}}),e}load(e=!1){if(this.hi&&!e)return;let t=this.Mr.cookieWinsOnConflict&&this.Mr.persistence.toLowerCase()==="localstorage+cookie",i=t?U.Lt(this.ua):null,s={};if(t)try{s=en(se.Lt(this.ua)),Z(s,(a,l)=>{(x(a)||ne(a)||a==="")&&delete s[l]})}catch{}let n=this.No.Lt(this.ua);if(n&&(this.props=Q({},n)),this.Xo&&this.ja(),t&&n){var r,o;let a=i==null?void 0:i[Ve],l=(r=i==null?void 0:i.$user_state)!==null&&r!==void 0?r:it,c=n[Ve],u=(o=n.$user_state)!==null&&o!==void 0?o:it;if(c!==a||u!==l){this.Yo=!0,this.hi||J.$t(Yi(this.ua),!0);let d=Q({},this.props);Qs.forEach(p=>delete d[p]),u!=="anonymous"||l!=="identified"&&s.$user_state!=="anonymous"&&(x(a)||c===a)||(Jo(d,s),delete d[ft]),this.props=d;let h=new Set;Qs.forEach(p=>{var v;let _=(v=fe(p))===null||v===void 0?void 0:v.storageGroup;_&&h.add(_)}),h.forEach(p=>{if(this.hi)return;let v={};Z(this.props,(_,g)=>{var y;((y=fe(g))===null||y===void 0?void 0:y.storageGroup)===p&&(v[g]=_)}),Me(v)?(U.Pt(this.fa(p)),this.Zo[p]={}):U.$t(this.fa(p),v)&&(this.Zo[p]={persisted:!0,fingerprint:this.ka(v,p)})})}}J.Ot(Yi(this.ua))&&(this.Yo=!0)}ja(){for(let e of di){let t=U.Lt(this.fa(e));if(t&&!Me(t)){let i=this.ma(e);i.persisted=!0,this.Ba(e)||(i.fingerprint=this.ka(t,e)),this.za(e,t)||Q(this.props,t)}}}Ba(e){return Object.keys(this.props).some(t=>{var i;return((i=fe(t))===null||i===void 0?void 0:i.storageGroup)===e})}za(e,t){let i=Fp[e];if(!i)return!1;let s=t[i],n=this.props[i];return oe(s)&&oe(n)&&n>s}refreshKey(e){var t;if(this.hi||this.ra.has(e))return;let i=this.Xo?(t=fe(e))===null||t===void 0?void 0:t.storageGroup:void 0,s=i?U.Lt(this.fa(i)):this.No.Lt(this.ua);if(s&&e in s)this.xa(e,s[e],!1);else{if(i){let n=this.No.Lt(this.ua);if(n&&e in n)return void this.xa(e,n[e],!1)}this.$a(e,!1)}}save(){if(this.hi)return;let e=this.Ea();e>0?x(this.La)&&(this.La=setTimeout(()=>{this.La=void 0,this.Na()},e)):this.Na()}flush(){x(this.La)||(clearTimeout(this.La),this.La=void 0,this.Na())}Na(e=!1){if(this.hi||this.ta&&!e)return;e||(this.syncCookieProperties(),this.Mr.cookieWinsOnConflict&&this.Mr.persistence.toLowerCase()==="localstorage+cookie"||Rc.forEach(n=>this.refreshKey(n)));let t=!e&&!this.ia;t||(this.sa=!1);let i=!!t&&this.Ca();if(this.sa)return void(this.Mr.debug&&M.warn("skipping persistence write because storage belongs to a different distinct ID"));if(this.Xo)return this.Ha(),void(i&&this.oa.forEach(n=>n()));let s=this.Ua(this.No,this.ua,this.props,ce);s==="written"&&this.Pa(this.props),s!=="failed"&&(this.ea.clear(),this.na=!1,this.ra.clear()),i&&this.oa.forEach(n=>n())}Ha(){let{main:e,groups:t}=this._a(),i=this.Ua(this.No,this.ua,e,ce);i==="written"&&this.Pa(e),i!=="failed"&&(this.na=!1,this.ra.clear(),et.forEach(n=>{var r;!((r=fe(n))===null||r===void 0)&&r.storageGroup||this.ea.delete(n)}));for(let n of di){var s;let r=t[n];if(Me(r)&&!(!((s=this.Zo[n])===null||s===void 0)&&s.persisted)){et.forEach(a=>{var l;((l=fe(a))===null||l===void 0?void 0:l.storageGroup)===n&&this.ea.delete(a)});continue}let o=this.Ua(U,this.fa(n),r,n);o!=="failed"&&et.forEach(a=>{let l=fe(a);(l==null?void 0:l.storageGroup)!==n||o!=="written"&&l.volatile||this.ea.delete(a)})}}_a(){let e={},t={flags:{},surveys:{}};return Z(this.props,(i,s)=>{var n;let r=(n=fe(s))===null||n===void 0?void 0:n.storageGroup;r?t[r][s]=i:e[s]=i}),{main:e,groups:t}}ka(e,t){if(t===ce)return JSON.stringify(e)+"|"+this.Wa+"|"+this.Va+"|"+this.Ga;let i={};return Z(e,(s,n)=>{var r;i[n]=!((r=fe(n))===null||r===void 0)&&r.volatile?"__volatile__":s}),JSON.stringify(i)}Ua(e,t,i,s){let n=this.ma(s);if(s!==ce&&!n.dirty&&!x(n.fingerprint))return"skipped";let r;try{if(r=this.ka(i,s),r===n.fingerprint)return n.dirty=!1,"skipped"}catch{r=void 0}return e.$t(t,i,this.Wa,this.Va,this.Ga,this.Mr.debug)?(n.dirty=!1,s!==ce&&(n.persisted=!0),x(r)||(n.fingerprint=r),this.Jo&&(n.storageValue=U.Ot(t)),"written"):(this.Mr.debug&&M.warn(`failed to persist storage entry "${t}"; will retry on next save`),"failed")}remove({keepGroupEntries:e=!1}={}){if(this.Ia(),x(this.La)||(clearTimeout(this.La),this.La=void 0),this.No.Pt(this.ua,!1),this.No.Pt(this.ua,!0),!e&&this.aa)for(let t of di)U.Pt(this.fa(t));e?delete this.Zo[ce]:this.Zo={},this.Ra=void 0,this.Aa=void 0}clear(){this.remove(),this.props={}}register_once(e,t,i){if(j(e)){this.syncCookieProperties(),x(t)&&(t="None"),this.Wa=x(i)?this.Qa:i;let s=!1;if(Z(e,(n,r)=>{this.props.hasOwnProperty(r)&&this.props[r]!==t||(this.xa(r,n),s=!0)}),s)return this.save(),!0}return!1}register(e,t){if(j(e)){this.syncCookieProperties(),this.Wa=x(t)?this.Qa:t;let i=!1;if(Z(e,(s,n)=>{e.hasOwnProperty(n)&&(this.props[n]!==s||j(s)||R(s))&&(this.xa(n,s),i=!0)}),i)return this.save(),!0}return!1}unregister(e){this.syncCookieProperties();let t=typeof e=="string"?[e]:e,i=!1;for(let s of t)s in this.props&&(this.$a(s),i=!0);i&&this.save()}update_campaign_params(){let e=E==null?void 0:E.URL;if(e===this.la)return;let t=Mc(this.Mr.custom_campaign_params,this.Mr.mask_personal_data_properties,this.Mr.custom_personal_data_properties),i=!Me(mr(t));return i&&this.register(t),this.la=e,i?t:void 0}update_search_keyword(){this.register((function(){let e=E==null?void 0:E.referrer;return e?Ic(e):{}})())}update_referrer_info(){var e;this.register_once({$referrer:Cc(),$referring_domain:(E==null?void 0:E.referrer)&&((e=nt(E.referrer))===null||e===void 0?void 0:e.host)||xs},void 0)}set_initial_person_info(){if(this.props.$initial_campaign_params||this.props.$initial_referrer_info)return;let e=Fc(this.Mr.mask_personal_data_properties,this.Mr.custom_personal_data_properties,this.Mr.disable_capture_url_hashes);this.register_once({[Bt]:this.Ko?{r:Xi(e.r),u:e.u?Xi(e.u):void 0}:e},void 0)}get_initial_props(){let e={};Z([Kl,Jl],i=>{let s=this.props[i];s&&Z(s,function(n,r){e["$initial_"+Pn(r)]=n})});let t=this.props[Bt];if(t){let i=(function(s,n=!1){let r=Oc(s,n),o={};return Z(r,function(a,l){o[`$initial_${Pn(l)}`]=a}),o})(t,this.Mr.disable_capture_url_hashes);Q(e,i)}return e}safe_merge(e){return Z(this.props,function(t,i){i in e||(e[i]=t)}),e}update_config(e,t,i){let s=e.persistence!==t.persistence,n=!((p,v)=>{if(p.length!==v.length)return!1;let _=[...p].sort(),g=[...v].sort();return _.every((y,m)=>y===g[m])})(e.cookie_persisted_properties||[],t.cookie_persisted_properties||[]),r=s||n,o=e.cookieWinsOnConflict!==t.cookieWinsOnConflict,a=e.disable_persistence||!!i,l=!!this.hi&&!a;a||this.Fa(t,l),this.Mr=e,!a&&(s||n||o)&&(this.Ra=void 0,this.Aa=void 0,this.Fa(f(f({},e),{},{cookie_persisted_properties:t.cookie_persisted_properties}),l));let c=r||o?this.ca(e):this.No;this.Za();let u=this.ha(e),d=r||u!==this.Xo,h=!a&&(d||e.cross_subdomain_cookie!==this.Va||e.secure_cookie!==this.Ga)&&this.Oa(l);this.ia=d;try{if(this.Qa=this.Wa=e.cookie_expiration,this.set_disabled(a),this.set_cross_subdomain(e.cross_subdomain_cookie),this.set_secure(e.secure_cookie),d){let p=this.props;this.clear(),this.No=c,this.Xo=u,this.props=p,this.save()}else o&&(this.No=c,a||(delete this.Zo[ce],this.Na()))}finally{this.ia=!1,h&&this.qa()}}Za(){let e=this.props[Bt];if(!this.Ko||!j(e)||typeof e.r!="string")return;let t=Xi(e.r),i=typeof e.u=="string"?Xi(e.u):e.u;t===e.r&&i===e.u||this.xa(Bt,f(f({},e),{},{r:t,u:i}))}set_disabled(e){this.hi=e,this.hi?this.remove():this.save()}set_cross_subdomain(e){e!==this.Va&&(this.Va=e,this.remove({keepGroupEntries:!0}),this.save())}set_secure(e){e!==this.Ga&&(this.Ga=e,this.remove({keepGroupEntries:!0}),this.save())}set_event_timer(e,t){let i=this.props.__timers||{};i[e]=t,this.xa(Dn,i),this.save()}remove_event_timer(e){let t=this.props.__timers||{},i=t[e];return x(i)||(delete t[e],this.xa(Dn,t),this.save()),i}get_property(e){return this.props[e]}set_property(e,t){this.xa(e,t),this.save()}xa(e,t,i=!0){var s;let n=this.props[e];this.props[e]=t,i&&(e!=="distinct_id"&&e!=="$user_state"||n===t||(this.na=!0),Xo(e)&&!ut(n,t)&&this.ra.add(e),this.Ma(e,n,t),!((s=fe(e))===null||s===void 0)&&s.volatile||this.Ta(e))}$a(e,t=!0){delete this.props[e],t&&(on(e)&&this.ga(e,!0),Xo(e)&&this.ra.add(e),this.Ta(e))}Ta(e){var t;let i=(t=fe(e))===null||t===void 0?void 0:t.storageGroup;i&&(this.ma(i).dirty=!0)}ma(e){return this.Zo[e]||(this.Zo[e]={})}},Ce={GZipJS:"gzip-js",Base64:"base64"},hi={Activation:"events",Cancellation:"cancelEvents"};var ln={Popover:"popover",API:"api",Widget:"widget",ExternalSurvey:"external_survey"};var Ae={SHOWN:"survey shown",DISMISSED:"survey dismissed",SENT:"survey sent",ABANDONED:"survey abandoned"},cn={SURVEY_ID:"$survey_id",SURVEY_NAME:"$survey_name",SURVEY_RESPONSE:"$survey_response",SURVEY_ITERATION:"$survey_iteration",SURVEY_ITERATION_START_DATE:"$survey_iteration_start_date",SURVEY_PARTIALLY_COMPLETED:"$survey_partially_completed",SURVEY_SUBMISSION_ID:"$survey_submission_id",SURVEY_QUESTIONS:"$survey_questions",SURVEY_COMPLETED:"$survey_completed",PRODUCT_TOUR_ID:"$product_tour_id",SURVEY_LAST_SEEN_DATE:"$survey_last_seen_date",SURVEY_LANGUAGE:"$survey_language"},Yn={Popover:"popover",Inline:"inline"};function Ji(e){let t=!0;return{dispose(){if(t){t=!1;let i=e();i&&le(i.then)&&i.then(void 0,()=>{})}}}}var Rp={SHOWN:"product tour shown",DISMISSED:"product tour dismissed",COMPLETED:"product tour completed",STEP_SHOWN:"product tour step shown",STEP_COMPLETED:"product tour step completed",BUTTON_CLICKED:"product tour button clicked",STEP_SELECTOR_FAILED:"product tour step selector failed",BANNER_CONTAINER_SELECTOR_FAILED:"product tour banner container selector failed",BANNER_ACTION_CLICKED:"product tour banner action clicked"},Ko={TOUR_ID:"$product_tour_id",TOUR_NAME:"$product_tour_name",TOUR_ITERATION:"$product_tour_iteration",TOUR_RENDER_REASON:"$product_tour_render_reason",TOUR_STEP_ID:"$product_tour_step_id",TOUR_STEP_ORDER:"$product_tour_step_order",TOUR_STEP_TYPE:"$product_tour_step_type",TOUR_DISMISS_REASON:"$product_tour_dismiss_reason",TOUR_BUTTON_TEXT:"$product_tour_button_text",TOUR_BUTTON_ACTION:"$product_tour_button_action",TOUR_BUTTON_LINK:"$product_tour_button_link",TOUR_BUTTON_TOUR_ID:"$product_tour_button_tour_id",TOUR_STEPS_COUNT:"$product_tour_steps_count",TOUR_STEP_SELECTOR:"$product_tour_step_selector",TOUR_STEP_SELECTOR_FOUND:"$product_tour_step_selector_found",TOUR_STEP_ELEMENT_TAG:"$product_tour_step_element_tag",TOUR_STEP_ELEMENT_ID:"$product_tour_step_element_id",TOUR_STEP_ELEMENT_CLASSES:"$product_tour_step_element_classes",TOUR_STEP_ELEMENT_TEXT:"$product_tour_step_element_text",TOUR_ERROR:"$product_tour_error",TOUR_MATCHES_COUNT:"$product_tour_matches_count",TOUR_FAILURE_PHASE:"$product_tour_failure_phase",TOUR_WAITED_FOR_ELEMENT:"$product_tour_waited_for_element",TOUR_WAIT_DURATION_MS:"$product_tour_wait_duration_ms",TOUR_BANNER_SELECTOR:"$product_tour_banner_selector",TOUR_LINKED_SURVEY_ID:"$product_tour_linked_survey_id",USE_MANUAL_SELECTOR:"$use_manual_selector",INFERENCE_DATA_PRESENT:"$inference_data_present",TOUR_LAST_SEEN_DATE:"$product_tour_last_seen_date",TOUR_TYPE:"$product_tour_type"},Qo=re("[RateLimiter]"),Lp=class{constructor(e){this.serverLimits={},this.lastEventRateLimited=!1,this.checkForLimiting=t=>{let i=t.text;if(i&&i.length)try{(JSON.parse(i).quota_limited||[]).forEach(s=>{Qo.info(`${s||"events"} is quota limited.`),this.serverLimits[s]=new Date().getTime()+6e4})}catch(s){return void Qo.warn(`could not rate limit - continuing. Error: "${s==null?void 0:s.message}"`,{text:i})}},this.instance=e,this.lastEventRateLimited=this.clientRateLimitContext(!0).isRateLimited}get captureEventsPerSecond(){var e;return((e=this.instance.config.rate_limiting)===null||e===void 0?void 0:e.events_per_second)||10}get captureEventsBurstLimit(){var e;return Math.max(((e=this.instance.config.rate_limiting)===null||e===void 0?void 0:e.events_burst_limit)||10*this.captureEventsPerSecond,this.captureEventsPerSecond)}clientRateLimitContext(e=!1){var t,i,s;let{captureEventsBurstLimit:n,captureEventsPerSecond:r}=this,o=new Date().getTime(),a=(t=(i=this.instance.persistence)===null||i===void 0?void 0:i.get_property("$capture_rate_limit"))!==null&&t!==void 0?t:{tokens:n,last:o};a.tokens+=(o-a.last)/1e3*r,a.last=o,a.tokens>n&&(a.tokens=n);let l=1>a.tokens;if(l||e||(a.tokens=Math.max(0,a.tokens-1)),l&&!e){let c=(oe(a.dropped)?a.dropped:0)+1;a.dropped=c,!this.lastEventRateLimited&&this.Ja(c)&&(a.dropped=0)}return this.lastEventRateLimited=l,(s=this.instance.persistence)===null||s===void 0||s.set_property("$capture_rate_limit",a),{isRateLimited:l,remainingTokens:a.tokens}}Ka(e){let t=this.instance.config.property_denylist;return!R(t)||!t.includes(e)}Xa(){var e;if(this.Ka("$current_url")&&this.Ka("$pathname")&&(K!=null&&K.pathname))return`${(e=K.origin)!==null&&e!==void 0?e:""}${K.pathname}`}Ja(e){var t,i;let{captureEventsBurstLimit:s,captureEventsPerSecond:n}=this,r=this.Xa(),o=this.Ka("$session_id")?(t=(i=this.instance).get_session_id)===null||t===void 0?void 0:t.call(i):void 0,a=[`${e} event(s) dropped since the last warning`,r?`triggered on ${r}`: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 ${n} events per second and ${s} events burst limit.`},{skip_client_rate_limiting:!0})}isServerRateLimited(e){let t=this.serverLimits[e||"events"]||!1;return t!==!1&&new Date().getTime()<t}},dt=re("[RemoteConfig]"),Lc=class{constructor(e){this._instance=e}get remoteConfig(){var e;return(e=F._POSTHOG_REMOTE_CONFIG)===null||e===void 0||(e=e[this._instance.config.token])===null||e===void 0?void 0:e.config}Ya(e){var t,i,s;!((t=F.__PosthogExtensions__)===null||t===void 0)&&t.loadExternalDependency?(i=F.__PosthogExtensions__)===null||i===void 0||(s=i.loadExternalDependency)===null||s===void 0||s.call(i,this._instance,"remote-config",()=>e(this.remoteConfig)):e()}tl(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 dt.info("Using preloaded remote config",this.remoteConfig),void this.el(this.remoteConfig);if(this._instance.il())return void dt.warn("Remote config is disabled. Falling back to local config.");this.Ya(e=>{if(!e)return dt.info("No config found after loading remote JS config. Falling back to JSON."),void this.tl(t=>{this.el(t.json,t)});this.el(e)})}catch(e){dt.error("Error loading remote config",e),this.el()}}el(e,t){!e&&t&&(t.statusCode===0?t.error||dt.warn("Failed to fetch remote config from PostHog."):dt.error("Failed to fetch remote config from PostHog."));try{this._instance.el(e?{ok:!0,config:e}:{ok:!1})}catch(s){dt.error("Error applying remote config",s)}if((e==null?void 0:e.hasFeatureFlags)!==!1&&!this._instance.config.advanced_disable_feature_flags_on_first_load)try{var i;(i=this._instance.featureFlags)===null||i===void 0||i.ensureFlagsLoaded()}catch(s){dt.error("Error loading feature flags",s)}}};var Fe=Uint8Array,Ee=Uint16Array,ei=Uint32Array,Sr=new Fe([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]),Er=new Fe([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]),ea=new Fe([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),Dc=function(e,t){for(var i=new Ee(31),s=0;31>s;++s)i[s]=t+=1<<e[s-1];var n=new ei(i[30]);for(s=1;30>s;++s)for(var r=i[s];i[s+1]>r;++r)n[r]=r-i[s]<<5|s;return[i,n]},Nc=Dc(Sr,2),Xn=Nc[1];Nc[0][28]=258,Xn[258]=28;for(Jn=Dc(Er,0)[1],ks=new Ee(32768),te=0;32768>te;++te)kt=(43690&te)>>>1|(21845&te)<<1,ks[te]=((65280&(kt=(61680&(kt=(52428&kt)>>>2|(13107&kt)<<2))>>>4|(3855&kt)<<4))>>>8|(255&kt)<<8)>>>1;var kt,Jn,ks,te,$i=function(e,t,i){for(var s=e.length,n=0,r=new Ee(t);s>n;++n)++r[e[n]-1];var o,a=new Ee(t);for(n=0;t>n;++n)a[n]=a[n-1]+r[n-1]<<1;if(i){o=new Ee(1<<t);var l=15-t;for(n=0;s>n;++n)if(e[n])for(var c=n<<4|e[n],u=t-e[n],d=a[e[n]-1]++<<u,h=d|(1<<u)-1;h>=d;++d)o[ks[d]>>>l]=c}else for(o=new Ee(s),n=0;s>n;++n)o[n]=ks[a[e[n]-1]++]>>>15-e[n];return o},Ft=new Fe(288);for(te=0;144>te;++te)Ft[te]=8;for(te=144;256>te;++te)Ft[te]=9;for(te=256;280>te;++te)Ft[te]=7;for(te=280;288>te;++te)Ft[te]=8;var Ss=new Fe(32);for(te=0;32>te;++te)Ss[te]=5;var Dp=$i(Ft,9,0),Np=$i(Ss,5,0),jc=function(e){return(e/8|0)+(7&e&&1)},Vc=function(e,t,i){(t==null||0>t)&&(t=0),(i==null||i>e.length)&&(i=e.length);var s=new(e instanceof Ee?Ee:e instanceof ei?ei:Fe)(i-t);return s.set(e.subarray(t,i)),s},Je=function(e,t,i){var s=t/8|0;e[s]|=i<<=7&t,e[s+1]|=i>>>8},pi=function(e,t,i){var s=t/8|0;e[s]|=i<<=7&t,e[s+1]|=i>>>8,e[s+2]|=i>>>16},un=function(e,t){for(var i=[],s=0;e.length>s;++s)e[s]&&i.push({s,f:e[s]});var n=i.length,r=i.slice();if(!n)return[new Fe(0),0];if(n==1){var o=new Fe(i[0].s+1);return o[i[0].s]=1,[o,1]}i.sort(function($,k){return $.f-k.f}),i.push({s:-1,f:25001});var a=i[0],l=i[1],c=0,u=1,d=2;for(i[0]={s:-1,f:a.f+l.f,l:a,r:l};u!=n-1;)a=i[i[d].f>i[c].f?c++:d++],l=i[c!=u&&i[d].f>i[c].f?c++:d++],i[u++]={s:-1,f:a.f+l.f,l:a,r:l};var h=r[0].s;for(s=1;n>s;++s)r[s].s>h&&(h=r[s].s);var p=new Ee(h+1),v=Kn(i[u-1],p,0);if(v>t){s=0;var _=0,g=v-t,y=1<<g;for(r.sort(function($,k){return p[k.s]-p[$.s]||$.f-k.f});n>s;++s){var m=r[s].s;if(t>=p[m])break;_+=y-(1<<v-p[m]),p[m]=t}for(_>>>=g;_>0;){var w=r[s].s;t>p[w]?_-=1<<t-p[w]++-1:++s}for(;s>=0&&_;--s){var P=r[s].s;p[P]==t&&(--p[P],++_)}v=t}return[new Fe(p),v]},Kn=function(e,t,i){return e.s==-1?Math.max(Kn(e.l,t,i+1),Kn(e.r,t,i+1)):t[e.s]=i},ta=function(e){for(var t=e.length;t&&!e[--t];);for(var i=new Ee(++t),s=0,n=e[0],r=1,o=function(l){i[s++]=l},a=1;t>=a;++a)if(e[a]==n&&a!=t)++r;else{if(!n&&r>2){for(;r>138;r-=138)o(32754);r>2&&(o(r>10?r-11<<5|28690:r-3<<5|12305),r=0)}else if(r>3){for(o(n),--r;r>6;r-=6)o(8304);r>2&&(o(r-3<<5|8208),r=0)}for(;r--;)o(n);r=1,n=e[a]}return[i.subarray(0,s),t]},fi=function(e,t){for(var i=0,s=0;t.length>s;++s)i+=e[s]*t[s];return i},os=function(e,t,i){var s=i.length,n=jc(t+2);e[n]=255&s,e[n+1]=s>>>8,e[n+2]=255^e[n],e[n+3]=255^e[n+1];for(var r=0;s>r;++r)e[n+r+4]=i[r];return 8*(n+4+s)},ia=function(e,t,i,s,n,r,o,a,l,c,u){Je(t,u++,i),++n[256];for(var d=un(n,15),h=d[0],p=d[1],v=un(r,15),_=v[0],g=v[1],y=ta(h),m=y[0],w=y[1],P=ta(_),$=P[0],k=P[1],T=new Ee(19),S=0;m.length>S;++S)T[31&m[S]]++;for(S=0;$.length>S;++S)T[31&$[S]]++;for(var I=un(T,7),A=I[0],N=I[1],L=19;L>4&&!A[ea[L-1]];--L);var V,C,B,W,Y=c+5<<3,z=fi(n,Ft)+fi(r,Ss)+o,ie=fi(n,h)+fi(r,_)+o+14+3*L+fi(T,A)+(2*T[16]+3*T[17]+7*T[18]);if(z>=Y&&ie>=Y)return os(t,u,e.subarray(l,l+c));if(Je(t,u,1+(z>ie)),u+=2,z>ie){V=$i(h,p,0),C=h,B=$i(_,g,0),W=_;var ge=$i(A,N,0);for(Je(t,u,w-257),Je(t,u+5,k-1),Je(t,u+10,L-4),u+=14,S=0;L>S;++S)Je(t,u+3*S,A[ea[S]]);u+=3*L;for(var de=[m,$],me=0;2>me;++me){var Ie=de[me];for(S=0;Ie.length>S;++S)Je(t,u,ge[he=31&Ie[S]]),u+=A[he],he>15&&(Je(t,u,Ie[S]>>>5&127),u+=Ie[S]>>>12)}}else V=Dp,C=Ft,B=Np,W=Ss;for(S=0;a>S;++S)if(s[S]>255){var he;pi(t,u,V[257+(he=s[S]>>>18&31)]),u+=C[he+257],he>7&&(Je(t,u,s[S]>>>23&31),u+=Sr[he]);var Re=31&s[S];pi(t,u,B[Re]),u+=W[Re],Re>3&&(pi(t,u,s[S]>>>5&8191),u+=Er[Re])}else pi(t,u,V[s[S]]),u+=C[s[S]];return pi(t,u,V[256]),u+C[256]},jp=new ei([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),Vp=new Fe(0),Hp=(function(){for(var e=new ei(256),t=0;256>t;++t){for(var i=t,s=9;--s;)i=(1&i&&3988292384)^i>>>1;e[t]=i}return e})(),dn=function(e,t,i){for(;i;++t)e[t]=i,i>>>=8};function Bp(e,t){t===void 0&&(t={});var i=(function(){var h=4294967295;return{p(p){for(var v=h,_=0;p.length>_;++_)v=Hp[255&v^p[_]]^v>>>8;h=v},d(){return 4294967295^h}}})(),s=e.length;i.p(e);var n,r,o,a,l,c,u=(a=10+((n=t).filename&&n.filename.length+1||0),l=8,(function(h,p,v,_,g,y){var m=h.length,w=new Fe(_+m+5*(1+Math.floor(m/7e3))+g),P=w.subarray(_,w.length-g),$=0;if(!p||8>m)for(var k=0;m>=k;k+=65535){var T=k+65535;m>T?$=os(P,$,h.subarray(k,T)):(P[k]=y,$=os(P,$,h.subarray(k,m)))}else{for(var S=jp[p-1],I=S>>>13,A=8191&S,N=(1<<v)-1,L=new Ee(32768),V=new Ee(N+1),C=Math.ceil(v/3),B=2*C,W=function(Ns){return(h[Ns]^h[Ns+1]<<C^h[Ns+2]<<B)&N},Y=new ei(25e3),z=new Ee(288),ie=new Ee(32),ge=0,de=0,me=(k=0,0),Ie=0,he=0;m>k;++k){var Re=W(k),ot=32767&k,at=V[Re];if(L[ot]=at,V[Re]=ot,k>=Ie){var wt=m-k;if((ge>7e3||me>24576)&&wt>423){$=ia(h,P,0,Y,z,ie,de,me,he,k-he,$),me=ge=de=0,he=k;for(var Pe=0;286>Pe;++Pe)z[Pe]=0;for(Pe=0;30>Pe;++Pe)ie[Pe]=0}var Ge=2,Ui=0,sd=A,lt=ot-at&32767;if(wt>2&&Re==W(k-lt))for(var nd=Math.min(I,wt)-1,rd=Math.min(32767,k),od=Math.min(258,wt);rd>=lt&&--sd&&ot!=at;){if(h[k+Ge]==h[k+Ge-lt]){for(var ct=0;od>ct&&h[k+ct]==h[k+ct-lt];++ct);if(ct>Ge){if(Ge=ct,Ui=lt,ct>nd)break;var ad=Math.min(lt,ct-2),Qr=0;for(Pe=0;ad>Pe;++Pe){var Ds=k-lt+Pe+32768&32767,eo=Ds-L[Ds]+32768&32767;eo>Qr&&(Qr=eo,at=Ds)}}}lt+=(ot=at)-(at=L[ot])+32768&32767}if(Ui){Y[me++]=268435456|Xn[Ge]<<18|Jn[Ui];var to=31&Xn[Ge],io=31&Jn[Ui];de+=Sr[to]+Er[io],++z[257+to],++ie[io],Ie=k+Ge,++ge}else Y[me++]=h[k],++z[h[k]]}}$=ia(h,P,y,Y,z,ie,de,me,he,k-he,$),y||($=os(P,$,Vp))}return Vc(w,0,_+jc($)+g)})(r=e,(o=t).level==null?6:o.level,o.mem==null?Math.ceil(1.5*Math.max(8,Math.min(13,Math.log(r.length)))):12+o.mem,a,l,!c)),d=u.length;return(function(h,p){var v=p.filename;if(h[0]=31,h[1]=139,h[2]=8,h[8]=2>p.level?4:p.level==9?2:0,h[9]=3,p.mtime!=0&&dn(h,4,Math.floor(new Date(p.mtime||Date.now())/1e3)),v){h[3]=8;for(var _=0;v.length>=_;++_)h[_+10]=v.charCodeAt(_)}})(u,t),dn(u,d-8,i.d()),dn(u,d-4,s),u}var Wp=!!sr||!!Ii,Hc=new WeakMap,Bc="text/plain",hn=0,as=!1,Wc=(e,t)=>{let[i,s]=e.split("#"),[n,r]=i.split("?");if(!r)return e;let o=r.split("&").filter(a=>a.split("=")[0]!==t).join("&");return`${n}${o?`?${o}`:""}${s?`#${s}`:""}`},Ni=(e,t,i=!0)=>{var s;let[n,r]=e.split("?"),o=f({},t),a=(s=r==null?void 0:r.split("&").map(c=>{var u;let[d,h]=c.split("="),p=i&&(u=o[d])!==null&&u!==void 0?u:h;return delete o[d],`${d}=${p}`}))!==null&&s!==void 0?s:[],l=(function(c,u="&"){let d,h,p=[];return Z(c,function(v,_){x(v)||x(_)||_==="undefined"||(d=encodeURIComponent((g=>g instanceof File)(v)?v.name:v.toString()),h=encodeURIComponent(_),p[p.length]=h+"="+d)}),p.join(u)})(o);return l&&a.push(l),a.length>0?`${n}?${a.join("&")}`:n},pn=e=>{if(e.nl)return e.nl;let{data:t,compression:i}=e;if(!t)return;if(i===Ce.GZipJS){let n=Bp((function(r){var o=r.length;if(typeof TextEncoder!="undefined")return new TextEncoder().encode(r);for(var a=new Fe(r.length+(r.length>>>1)),l=0,c=function(p){a[l++]=p},u=0;o>u;++u){if(l+5>a.length){var d=new Fe(l+8+(o-u<<1));d.set(a),a=d}var h=r.charCodeAt(u);128>h?c(h):2048>h?(c(192|h>>>6),c(128|63&h)):h>55295&&57344>h?(c(240|(h=65536+(1047552&h)|1023&r.charCodeAt(++u))>>>18),c(128|h>>>12&63),c(128|h>>>6&63),c(128|63&h)):(c(224|h>>>12),c(128|h>>>6&63),c(128|63&h))}return Vc(a,0,l)})(Ut(t)),{mtime:0});return{contentType:Bc,body:n.buffer.slice(n.byteOffset,n.byteOffset+n.byteLength),estimatedSize:n.byteLength}}if(i===Ce.Base64){let n=(function(o){return o&&btoa(encodeURIComponent(o).replace(/%([0-9A-F]{2})/g,(a,l)=>String.fromCharCode(parseInt(l,16))))})(Ut(t)),r=(o=>"data="+encodeURIComponent(typeof o=="string"?o:Ut(o)))(n);return{contentType:"application/x-www-form-urlencoded",body:r,estimatedSize:new Blob([r]).size}}let s=Ut(t);return{contentType:"application/json",body:s,estimatedSize:new Blob([s]).size}},Uc=e=>{let t=()=>e.transport==="sendBeacon"?{url:Ni(e.url,{compression:Ce.Base64}),encodedBody:pn(f(f({},e),{},{compression:Ce.Base64,nl:void 0}))}:{url:Wc(e.url,"compression"),encodedBody:pn(f(f({},e),{},{compression:void 0,nl:void 0}))},i;try{i=pn(e)}catch(n){if(bo(e.compression,Kt(e.url,"compression")))return M.error("Failed to gzip request body, sending uncompressed payload",n),t();throw n}return i&&bo(e.compression,Kt(e.url,"compression"))&&!((s=i.body)instanceof ArrayBuffer?Fn(new Uint8Array(s)):ArrayBuffer.isView(s)&&Fn(new Uint8Array(s.buffer,s.byteOffset,s.byteLength)))?(as=!0,t()):{url:e.url,encodedBody:i};var s},zc=e=>{try{return Uc(e)}catch(i){var t;return M.error(i),void((t=e.callback)===null||t===void 0||t.call(e,{statusCode:0,error:i}))}},Up=(function(){var e=ee(function*(t){let i=yield(function(n){return On.apply(this,arguments)})(Ut(t.data),ue.DEBUG,{rethrow:!0});if(!i)return t;let s=yield i.arrayBuffer();return f(f({},t),{},{nl:{contentType:Bc,body:s,estimatedSize:s.byteLength}})});return function(t){return e.apply(this,arguments)}})(),zp=/Failed to fetch|NetworkError|Load failed/i,Gc=e=>(e==null?void 0:e.name)==="TypeError"&&zp.test((e==null?void 0:e.message)||""),qc=e=>{try{let t=(function(i,s=Date.now()){if(typeof i!="string"||!i)return;let n=i.trim(),r=/^\d+\s*,/.test(n)?n.slice(0,n.indexOf(",")).trim():n;if(/^\d+$/.test(r)){let l=1e3*Math.min(Number(r),300);return l>0?l:void 0}if(!/^(Mon|Tue|Wed|Thu|Fri|Sat|Sun)[a-z]*[ ,]/.test(r))return;let o=/^\w{3} \w{3} /.test(r)?r+" GMT":r,a=Date.parse(o)-s;return Number.isFinite(a)&&a>0?Math.min(a,ss):void 0})(e());return x(t)?void 0:Math.min(t,3e4)}catch{return}},Zc=e=>{let t=zc(e);if(!t)return;let i=new sr;Hc.set(i,!0);let{url:s,encodedBody:n}=t;i.open(e.method||"GET",s,!0);let{contentType:r,body:o}=n!=null?n:{};Z(e.headers,function(a,l){i.setRequestHeader(l,a)}),r&&i.setRequestHeader("Content-Type",r),e.timeout&&(i.timeout=e.timeout),i.onreadystatechange=()=>{if(i.readyState===4){var a;let l={statusCode:i.status,text:i.responseText};if(i.status===200)try{l.json=JSON.parse(i.responseText)}catch{}(a=e.callback)===null||a===void 0||a.call(e,l,qc(()=>i.getResponseHeader("Retry-After")))}},i.send(o)},Yc=e=>{let t=zc(e);if(!t)return;let{url:i,encodedBody:s}=t,{contentType:n,body:r,estimatedSize:o}=s!=null?s:{},a=new Headers;Z(e.headers,function(v,_){a.append(_,v)}),n&&a.append("Content-Type",n);let l=null,c=!1;if(so){let v=new so;l={signal:v.signal,timeout:setTimeout(()=>{c=!0;try{v.abort(yl("AbortError","PostHog request timed out"+((_=e.timeout)?` after ${_}ms`:"")))}catch(g){d(g)}var _},e.timeout)}}let u=!1,d=v=>{var _;u||(u=!0,c&&(v==null?void 0:v.name)==="AbortError"||Gc(v)?M.warn(v):M.error(v),(_=e.callback)===null||_===void 0||_.call(e,{statusCode:0,error:v}))},h=0,p=()=>{hn-=h,h=0,l&&clearTimeout(l.timeout)};try{let v=f({method:(e==null?void 0:e.method)||"GET",headers:a,referrerPolicy:"strict-origin",body:r,signal:l==null?void 0:l.signal},e.fetchOptions),_=o!=null?o:x(r)?0:void 0;v.keepalive=v.method==="POST"&&!e.sl&&v.keepalive!==!1&&v.body===r&&!x(_)&&_>=0&&52428.8>hn+_,v.keepalive&&(h=_,hn+=h),Ii(i,v).then(g=>g.text().then(y=>{var m;if(u)return;let w={statusCode:g.status,text:y};if(g.status===200)try{w.json=JSON.parse(y)}catch(P){M.error(P)}u=!0,p(),(m=e.callback)===null||m===void 0||m.call(e,w,qc(()=>g.headers.get("Retry-After")))})).catch(g=>{p(),d(g)}).finally(p)}catch(v){p(),d(v)}},Qn=e=>{try{var t;let{url:i,encodedBody:s}=Uc(e),{contentType:n,body:r,estimatedSize:o}=s!=null?s:{};if(!r)return;let a=r instanceof Blob?r:new Blob([r],{type:n});if(pe.sendBeacon(i,a))return;let l=R(e.data)?e.data:(t=e.data)===null||t===void 0?void 0:t.batch;if(R(l)&&l.length>1&&(o!=null?o:0)>16384){let c=Math.ceil(l.length/2),u=d=>R(e.data)?d:f(f({},e.data),{},{batch:d});return Qn(f(f({},e),{},{data:u(l.slice(0,c))})),void Qn(f(f({},e),{},{data:u(l.slice(c))}))}M.warn(`Beacon of ~${o!=null?o:0} bytes was rejected by the browser, falling back to ${Ii?"fetch":"XHR"}`),Ii?Yc(f(f({},e),{},{sl:!0})):Zc(e)}catch(i){M.warn("Beacon send failed",i)}},sa=(e,t,i,s)=>{let n=s==="query"?t==="POST"?"sent_at":"_":void 0;return Ni(i===Ce.GZipJS?Wc(e,"compression"):e,f(f({},n?{[n]:Date.now().toString()}:{}),i===Ce.GZipJS?{}:{compression:i}))},Gp=(()=>{let e=[];return Ii&&e.push({transport:"fetch",method:Yc}),sr&&e.push({transport:"XHR",method:Zc}),pe!=null&&pe.sendBeacon&&e.push({transport:"sendBeacon",method:Qn}),e})(),Xc=!Wp&&(xe==null?void 0:xe.indexOf("MSIE"))===-1&&(xe==null?void 0:xe.indexOf("Mozilla"))===-1;function Jc(e,t,i){var s,n,r;i&&(t=f(f({},t),{},{callback:o=>i(o)})),e.__loaded?Xc?e.__request_queue.push(t):e.rateLimiter.isServerRateLimited(t.batchKey)?t.fireCallbackOnDrop&&((n=t.callback)===null||n===void 0||n.call(t,{statusCode:429})):(t.transport=t.transport||e.config.api_transport,t.headers=f(f({},e.config.request_headers),t.headers),t.compression=t.compression==="best-available"?(s=e.compression)!==null&&s!==void 0?s:t.compressionFallback:t.compression,(x(e.config.disable_beacon)?e.config.__preview_disable_beacon:e.config.disable_beacon)&&(t.disableTransport=["sendBeacon"]),t.fetchOptions=t.fetchOptions||e.config.fetch_options,((o,a)=>{var l,c,u;let d=f(f({},o),{},{callback:a!=null?a:g=>{var y;return(y=o.callback)===null||y===void 0?void 0:y.call(o,g)}});d.timeout=d.timeout||6e4;let h=(l=d.transport)!==null&&l!==void 0?l:"fetch";h==="sendBeacon"&&x(d.compression)&&d.data&&(d.compression=Ce.Base64),d.method==="POST"&&d.data&&(d.timestampMode==="capture-body"?d.data=(g=>{var y,m;let w=(R(g)?g:[g]).map($=>f(f({},$),$.timestamp instanceof Date&&!isNaN($.timestamp.getTime())?{timestamp:$.timestamp.toISOString()}:{})),P=w[0];return{api_key:(y=P==null||(m=P.properties)===null||m===void 0?void 0:m.token)!==null&&y!==void 0?y:P==null?void 0:P.token,batch:w,sent_at:new Date().toISOString()}})(d.data):d.timestampMode==="body"&&(d.data=((g,y=new Date().toISOString())=>R(g)?g.map(m=>f(f({},m),{},{sent_at:y})):f(f({},g),{},{sent_at:y}))(d.data))),d.url=sa(d.url,d.method,d.compression,d.timestampMode);let p=Gp.filter(g=>!d.disableTransport||!g.transport||!d.disableTransport.includes(g.transport)),v=(c=(u=(function(g,y){for(let m=0;g.length>m;m++)if(y(g[m]))return g[m]})(p,g=>g.transport===h))===null||u===void 0?void 0:u.method)!==null&&c!==void 0?c:p[0].method;if(!v)throw new Error("No available transport method");let _=g=>{try{v(g)}catch(m){var y;Gc(m)?M.warn(m):M.error(m),(y=d.callback)===null||y===void 0||y.call(d,{statusCode:0,error:m})}};h!=="sendBeacon"&&!d.preferSyncCompression&&d.data&&d.compression===Ce.GZipJS&&ld&&typeof Promise!="undefined"&&!as?Up(d).then(g=>{_(g)}).catch(g=>{if(wo(g))return as=!0,void _(f(f({},d),{},{compression:void 0,url:sa(o.url,o.method,void 0,o.timestampMode)}));(y=>{if(!y||typeof y!="object")return!1;let m="name"in y?String(y.name):"";return wo(y)||m===$l})(g)&&(as=!0),_(d)}):_(d)})(t,(o,a)=>{var l,c,u;e.rateLimiter.checkForLimiting(o),400>o.statusCode||(l=(c=e.config).on_request_error)===null||l===void 0||l.call(c,o),i?i(o,a):(u=t.callback)===null||u===void 0||u.call(t,o)})):t.fireCallbackOnDrop&&((r=t.callback)===null||r===void 0||r.call(t,{statusCode:0}))}var qp=class{constructor(e,t){this.rl=!0,this.ol=[],this.al=Xe((t==null?void 0:t.flush_interval_ms)||3e3,250,5e3,M.createLogger("flush interval"),3e3),this.ll=e}enqueue(e){this.ol.push(e),this.ul||this.cl()}unload(){this.hl();let e=this.ol.length>0?this.dl():{},t=Object.values(e);[...t.filter(i=>i.url.indexOf("/e")===0),...t.filter(i=>i.url.indexOf("/e")!==0)].map(i=>{this.vl(f(f({},i),{},{callback:void 0}),"sendBeacon")})}enable(){this.rl=!1,this.cl()}cl(){this.rl||(this.ul=setTimeout(()=>{this.hl(),this.fl()},this.al))}fl(){if(this.ol.length>0){let e=this.dl();for(let t in e)this.vl(e[t])}}vl(e,t){try{this.ll(e,t)}catch(i){M.error(i)}}hl(){clearTimeout(this.ul),this.ul=void 0}dl(){let e={},t={};Z(this.ol,i=>{var s;let n=i,r=((n?n.batchKey:null)||n.url)+(n.batchGroup?`:${n.batchGroup}`:"");x(e[r])&&(e[r]=f(f({},n),{},{data:[],callback:void 0,fireCallbackOnDrop:void 0}),t[r]=[]),(s=e[r].data)===null||s===void 0||s.push(n.data),n.callback&&t[r].push(n.callback)});for(let i in t){let s=t[i];s.length&&(e[i].callback=n=>{for(let r of s)r(n)})}return this.ol=[],e}},Zp=["retriesPerformedSoFar"],Yp=class{constructor(e){this._instance=e,this.pl=!1,this.gl=3e3,this.ol=[],this.ol=[],this.ml=!0,this.resume()}resume(){if(!x(b)&&"onLine"in b.navigator){if(this.ml=b.navigator.onLine,this.yl)return;this.yl=()=>{this.ml=!0,this.fl()},this.bl=()=>{this.ml=!1},G(b,"online",this.yl),G(b,"offline",this.bl)}}get length(){return this.ol.length}retriableRequest(e,t){let{retriesPerformedSoFar:i}=e,s=Pl(e,Zp);Qe(i)&&(s.url=Ni(s.url,{retry_count:i})),Jc(this._instance,t?f(f({},s),{},{transport:t}):s,(n,r)=>{var o;if(n.statusCode!==200&&(400>n.statusCode||n.statusCode>=500)){if((n.statusCode===0?3:10)>(i!=null?i:0))return void this.Ls(f({retriesPerformedSoFar:i},s),r);n.statusCode===0&&M.warn(`Request failed before receiving an HTTP response; this can happen due to network issues, CORS, browser blocking, or ad blockers. Stopped retrying after ${i!=null?i:0} retries.`)}(o=s.callback)===null||o===void 0||o.call(s,n)})}Ls(e,t){let i=e.retriesPerformedSoFar||0;e.retriesPerformedSoFar=i+1;let s=Math.max((function(o){let a=3e3*Math.pow(2,o),l=a/2,c=Math.min(18e5,a),u=(Math.random()-.5)*(c-l);return Math.ceil(c+u)})(i),t!=null?t:0),n=Date.now()+s;this.ol.push({retryAt:n,requestOptions:e});let r=`Enqueued failed request for retry in ${s}`;navigator.onLine||(r+=" (Browser is offline)"),M.warn(r),this.pl||(this.pl=!0,this._l())}_l(){if(this.wl&&clearTimeout(this.wl),this.ol.length===0)return this.pl=!1,void(this.wl=void 0);this.wl=setTimeout(()=>{this.ml&&this.ol.length>0&&this.fl(),this._l()},this.gl)}fl(){let e=Date.now(),t=[],i=this.ol.filter(s=>e>s.retryAt||(t.push(s),!1));if(this.ol=t,i.length>0)for(let{requestOptions:s}of i)this.retriableRequest(s)}unload(){this.wl&&(clearTimeout(this.wl),this.wl=void 0),this.pl=!1,x(b)||(this.yl&&(b.removeEventListener("online",this.yl),this.yl=void 0),this.bl&&(b.removeEventListener("offline",this.bl),this.bl=void 0));for(let{requestOptions:e}of this.ol)try{this._instance._send_request(f(f({},e),{},{callback:R(e.data)?void 0:e.callback,transport:"sendBeacon"}))}catch(t){M.error(t)}this.ol=[]}},Xp=class{constructor(e){this._instance=e,this.kl=()=>{var t,i,s,n;this.Sl||(this.Sl={});let r=this.scrollElement(),o=this.scrollY(),a=r?Math.max(0,r.scrollHeight-r.clientHeight):0,l=o+((r==null?void 0:r.clientHeight)||0),c=(r==null?void 0:r.scrollHeight)||0;this.Sl.lastScrollY=Math.ceil(o),this.Sl.maxScrollY=Math.max(o,(t=this.Sl.maxScrollY)!==null&&t!==void 0?t:0),this.Sl.maxScrollHeight=Math.max(a,(i=this.Sl.maxScrollHeight)!==null&&i!==void 0?i:0),this.Sl.lastContentY=l,this.Sl.maxContentY=Math.max(l,(s=this.Sl.maxContentY)!==null&&s!==void 0?s:0),this.Sl.maxContentHeight=Math.max(c,(n=this.Sl.maxContentHeight)!==null&&n!==void 0?n:0)}}get xl(){return this._instance.config.scroll_root_selector}getContext(){return this.Sl}resetContext(){let e=this.Sl;return this.Sl=void 0,setTimeout(this.kl,0),e}startMeasuringScrollPosition(){G(b,"scroll",this.kl,{capture:!0}),G(b,"scrollend",this.kl,{capture:!0}),G(b,"resize",this.kl)}scrollElement(){if(this.xl){let i=R(this.xl)?this.xl:[this.xl];for(let s of i){var e;let n=b==null||(e=b.document)===null||e===void 0?void 0:e.querySelector(s);if(n)return n}return}var t;return b==null||(t=b.document)===null||t===void 0?void 0:t.documentElement}$l(e){var t,i;let s=e==="y"?"scrollTop":"scrollLeft";if(this.xl){let n=this.scrollElement();return n&&n[s]||0}return b?e==="y"?b.scrollY||b.pageYOffset||((t=b.document)===null||t===void 0||(t=t.documentElement)===null||t===void 0?void 0:t.scrollTop)||0:b.scrollX||b.pageXOffset||((i=b.document)===null||i===void 0||(i=i.documentElement)===null||i===void 0?void 0:i.scrollLeft)||0:0}scrollY(){return this.$l("y")}scrollX(){return this.$l("x")}},Jp=e=>Fc(e==null?void 0:e.config.mask_personal_data_properties,e==null?void 0:e.config.custom_personal_data_properties,e==null?void 0:e.config.disable_capture_url_hashes),na=class{constructor(e,t,i,s){this.qe=n=>{let r=this.Cl();if(r&&r.sessionId===n)return;let o={sessionId:n,props:this.Tl(this._instance)};this.Il.register({[Wn]:o})},this._instance=e,this.Ml=t,this.Il=i,this.Tl=s||Jp,this.Ml.onSessionId(this.qe)}Cl(){return this.Il.props[Wn]}getSetOnceProps(){var e;let t=(e=this.Cl())===null||e===void 0?void 0:e.props;return t?"r"in t?Oc(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(){let e={};return Z(mr(this.getSetOnceProps()),(t,i)=>{i==="$current_url"&&(i="url"),e[`$session_entry_${Pn(i)}`]=t}),e}},Es=class{on(e,t){return this.El[e]||(this.El[e]=[]),this.El[e].push(t),()=>{this.El[e]=this.El[e].filter(i=>i!==t)}}emit(e,t){for(let i of this.El[e]||[])i(t);for(let i of this.El["*"]||[])i(e,t)}constructor(){this.El={}}},Dt=re("[SessionId]"),ra=864e5,oa=class{on(e,t){return this.Pl.on(e,t)}constructor(e,t,i){var s;if(this.Rl=null,this.Al=null,this.Fl=[],this.Ol=void 0,this.Dl=!1,this.Pl=new Es,this.Ll=(r,o)=>!(!Qe(r)||!Qe(o))&&Math.abs(r-o)>this.sessionTimeoutMs,!e.persistence)throw new Error("SessionIdManager requires a PostHogPersistence instance");if(e.config.cookieless_mode==="always")throw new Error('SessionIdManager cannot be used with cookieless_mode="always"');this.Mr=e.config,this.Il=e.persistence,this.je=void 0,this.Xt=void 0,this._sessionStartTimestamp=null,this.Nl=void 0,this._sessionActivityTimestamp=null,this.ql=t||Be,this.jl=i||Be;let n=this.Mr.persistence_name||this.Mr.token;if(this._sessionTimeoutMs=1e3*Xe(this.Mr.session_idle_timeout_seconds||1800,60,36e3,Dt.createLogger("session_idle_timeout_seconds"),1800),e.register({$configured_session_timeout_ms:this._sessionTimeoutMs}),this.Bl(),this.zl="ph_"+n+"_window_id",this.Hl="ph_"+n+"_primary_window_exists",this.Ul()){let r=J.Lt(this.zl),o=J.Lt(this.Hl);r&&!o?this.je=r:J.Pt(this.zl),J.$t(this.Hl,!0)}!((s=this.Mr.bootstrap)===null||s===void 0)&&s.sessionID&&this.setBootstrapSessionId(this.Mr.bootstrap.sessionID),this.Wl()}get sessionTimeoutMs(){return this._sessionTimeoutMs}onSessionId(e){return x(this.Fl)&&(this.Fl=[]),this.Fl.push(e),this.Xt&&e(this.Xt,this.je),()=>{this.Fl=this.Fl.filter(t=>t!==e)}}Ul(){return this.Mr.persistence!=="memory"&&!this.Il.hi&&J.At()}Vl(e){e!==this.je&&(this.je=e,this.Ul()&&J.$t(this.zl,e))}Gl(){return this.je?this.je:this.Ul()?J.Lt(this.zl):null}Ql(e){let t=this.Rl;return!ne(t)&&!ne(e)&&5e3>Math.abs(e-t)}Zl(e,t,i){let s=t!==this._sessionActivityTimestamp,n=!(e!==this.Xt||i!==this._sessionStartTimestamp);this._sessionStartTimestamp=i,this._sessionActivityTimestamp=t,this.Xt=e,n&&!s||n&&this.Ql(t)||(this.Rl=t,this.Il.register({[Ht]:[t,e,i]}))}Jl(){var e;let t=(e=this.Mr)===null||e===void 0?void 0:e.persistence_save_debounce_ms;return Qe(t)&&t>0}Kl(){this.Jl()?this.Il.refreshKey(Ht):(this.Il.flush(),this.Il.load())}Xl(){var e;if(ne(this._sessionActivityTimestamp)||this._sessionActivityTimestamp===this.Rl)return;this.Kl();let[,t,i]=this.Yl();t===this.Xt&&i===this._sessionStartTimestamp&&(this.Rl=this._sessionActivityTimestamp,this.Il.register({[Ht]:[this._sessionActivityTimestamp,(e=this.Xt)!==null&&e!==void 0?e:null,this._sessionStartTimestamp]}),this.Il.flush())}tu(){let[e]=this.Yl(),t=Qe(e)?e:0,i=Qe(this._sessionActivityTimestamp)?this._sessionActivityTimestamp:0;return Math.max(t,i)}eu(e){return this.Kl(),this.Ll(e,this.tu())}Yl(){let e=this.Il.props[Ht];return R(e)&&e.length===2&&e.push(e[0]),e||[0,null,0]}resetSessionId(){this.Rl=null,this.Nl=void 0,clearTimeout(this.iu),this.iu=void 0,this.Zl(null,null,null)}setBootstrapSessionId(e,t=!1){let i=((s,n=new Date().getTime())=>{try{let r=(o=>{let a=o.replace(/-/g,"");if(a.length!==32)throw new Error("Not a valid UUID");if(a[12]!=="7")throw new Error("Not a UUIDv7");return parseInt(a.substring(0,12),16)})(s);return r>n+6e4?void Dt.error("Bootstrap sessionID cannot be in the future"):r}catch(r){return void Dt.error("Invalid sessionID in bootstrap",r)}})(e);return!x(i)&&(t?this.Nl={sessionId:e,sessionStartTimestamp:i}:this.Zl(e,new Date().getTime(),i),!0)}destroy(){this.Dl=!0,this.Xl(),clearTimeout(this.iu),this.iu=void 0,this.Ol&&b&&(b.removeEventListener(ys,this.Ol,{capture:!1}),this.Ol=void 0),this.Fl=[]}Wl(){this.Ol=()=>{this.Xl(),this.Ul()&&J.Pt(this.Hl)},G(b,ys,this.Ol,{capture:!1})}checkAndGetSessionAndWindowId(e=!1,t=null,i=!1){if(this.Mr.cookieless_mode==="always")throw new Error('checkAndGetSessionAndWindowId should not be called with cookieless_mode="always"');let s=t||new Date().getTime(),n=this.Xt;if(i)this.Al=s;else if(ne(this.Al)||this.Al>s||s-this.Al>=1e3){var r,o;(r=(o=this.Il).syncCookieProperties)===null||r===void 0||r.call(o),this.Al=s}let[,a,l]=this.Yl(),c=!x(n)&&a!==n,u=this.tu(),d=this.Gl(),h=this.Nl,p=!!h&&(h.sessionStartTimestamp>s+6e4||s-h.sessionStartTimestamp>ra),v=h?p:Qe(l)&&Math.abs(s-l)>ra,_=!1,g=c,y=!a||!!h,m=a,w=!y&&!e&&this.Ll(s,u);if(w&&(w=this.eu(s),w||Dt.info("cross-tab refresh kept the session alive",{sessionId:a}),[,a,l]=this.Yl(),w||(y=!a||!!h)),y||w||v){g=!1;let T=h&&!p;a=T?h.sessionId:this.ql(),d=this.jl(),Dt.info("new session ID assigned",{sessionId:a,windowId:d,bootstrapped:!!T,changeReason:{noSessionId:y,activityTimeout:w,sessionPastMaximumLength:v}}),l=T?h.sessionStartTimestamp:s,this.Nl=void 0,_=!0}else d||(d=this.jl(),_=!0),g=g||a!==m,g&&(Dt.info("adopted cross-tab session id",{sessionId:a,windowId:d}),_=!0);let P=Qe(u)&&e&&!v?u:s,$=Qe(l)?l:new Date().getTime();this.Vl(d),this.Zl(a,P,$),e||this.Bl();let k={noSessionId:y,activityTimeout:w,sessionPastMaximumLength:v,crossTabAdoption:g};return _&&this.Fl.forEach(T=>T(a,d,k)),{sessionId:a,windowId:d,sessionStartTimestamp:$,changeReason:_?k:void 0,lastActivityTimestamp:u}}Bl(){this.Dl||(clearTimeout(this.iu),this.iu=setTimeout(()=>{if(!this.Dl)if(this.eu(new Date().getTime())){let e=this.Xt;this.resetSessionId(),this.Pl.emit("forcedIdleReset",{idleSessionId:e})}else this.Bl()},1.1*this.sessionTimeoutMs))}},Kc=function(e,t){if(!e)return!1;let i=e.userAgent;if(i&&oo(i,t))return!0;try{let s=e==null?void 0:e.userAgentData;if(s!=null&&s.brands&&s.brands.some(n=>oo(n==null?void 0:n.brand,t)))return!0}catch{}return!!e.webdriver};function Qc(){return(Qc=ee(function*(){let e=pe==null?void 0:pe.userAgentData;if(e!=null&&e.getHighEntropyValues)try{let t=yield e.getHighEntropyValues(["model"]),i=t==null?void 0:t.model;return H(i)&&i.length>0?i:void 0}catch(t){return void M.info("Unable to resolve $device_model from userAgentData.getHighEntropyValues",t)}})).apply(this,arguments)}function Kp(e,t){let i=`$survey_${t}/${e.id}`;return e.current_iteration&&e.current_iteration>0&&(i=`$survey_${t}/${e.id}/${e.current_iteration}`),i}function eu(e){var t;return!!(!((t=e.conditions)===null||t===void 0||(t=t.events)===null||t===void 0||(t=t.values)===null||t===void 0)&&t.length)}var $s=(e,t)=>{if(!(i=>{try{new RegExp(i)}catch{return!1}return!0})(t))return!1;try{return new RegExp(t).test(e)}catch{return!1}},Ki=e=>e.toLowerCase(),tu={exact:(e,t)=>t.some(i=>e.some(s=>i===s)),is_not:(e,t)=>t.every(i=>e.every(s=>i!==s)),regex:(e,t)=>t.some(i=>e.some(s=>$s(i,s))),not_regex:(e,t)=>t.every(i=>e.every(s=>!$s(i,s))),icontains:(e,t)=>t.map(Ki).some(i=>e.map(Ki).some(s=>i.includes(s))),not_icontains:(e,t)=>t.map(Ki).every(i=>e.map(Ki).every(s=>!i.includes(s))),gt:(e,t)=>t.some(i=>{let s=parseFloat(i);return!isNaN(s)&&e.some(n=>s>parseFloat(n))}),lt:(e,t)=>t.some(i=>{let s=parseFloat(i);return!isNaN(s)&&e.some(n=>s<parseFloat(n))})};function iu(e,t){return!e||Object.entries(e).every(([i,s])=>{let n=t==null?void 0:t[i];if(n==null)return!1;let r=tu[s.operator];return!!r&&r(s.values.map(String),[String(n)])})}function fn(e,t,i){return Ut({distinct_id:e,userPropertiesToSet:t,userPropertiesToSetOnce:i})}var er="custom",aa="i.posthog.com",Qp=/^\/static\//,ef=["/s/","/e/","/i/"],tf=class{constructor(e){this.nu={},this.instance=e}get apiHost(){let e=this.instance.config.api_host.trim().replace(/\/$/,"");return e==="https://app.posthog.com"?"https://us.i.posthog.com":e}get flagsApiHost(){let e=this.instance.config.flags_api_host;return e?e.trim().replace(/\/$/,""):this.apiHost}get uiHost(){var e;let t=(e=this.instance.config.ui_host)===null||e===void 0?void 0:e.replace(/\/$/,"");return t||(t=this.apiHost.replace(`.${aa}`,".posthog.com")),t==="https://app.posthog.com"?"https://us.posthog.com":t}get region(){return this.nu[this.apiHost]||(this.nu[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":er),this.nu[this.apiHost]}su(e){if(!Qp.test(e))return;let t=this.instance.config.asset_host;return typeof t=="string"&&t.trim().replace(/\/$/,"")||void 0}ru(e){let t=nt(e);return t?t.protocol+"//"+t.host+t.pathname:void 0}ou(e,t,i){if(e==="ui")return i;let s=i,n=this.instance.config.rewriteRequestPath;if(n){var r;let o=((r=nt(i))===null||r===void 0?void 0:r.href)||i;s=n(new URL(o)).toString()}if(n&&e==="api"&&ef.some(o=>t.indexOf(o)===0)){let o=this.ru(s);if(o){let a=this.apiHost,l=this.au;(l==null?void 0:l.apiHost)===a&&l.rewriteRequestPath===n||(l={apiHost:a,rewriteRequestPath:n,urls:new Set},this.au=l),l.urls.add(o)}}return s}isIngestionEndpoint(e){let t=this.au,i=this.ru(e);return(t==null?void 0:t.apiHost)===this.apiHost&&t.rewriteRequestPath===this.instance.config.rewriteRequestPath&&!!i&&t.urls.has(i)}endpointFor(e,t=""){if(t&&(t=t[0]==="/"?t:`/${t}`),e==="ui")return this.ou(e,t,this.uiHost+t);if(e==="flags")return this.ou(e,t,this.flagsApiHost+t);if(e==="assets"){let s=this.su(t);if(s)return this.ou(e,t,`${s}${t}`)}if(this.region===er)return this.ou(e,t,this.apiHost+t);let i=aa+t;switch(e){case"assets":return this.ou(e,t,`https://${this.region}-assets.${i}`);case"api":return this.ou(e,t,`https://${this.region}.${i}`)}}},q=re("[Surveys]"),su=e=>{try{let t=(i=>((s,n)=>`seenSurvey_${(function(r){return r.current_iteration&&r.current_iteration>0?`${r.id}_${r.current_iteration}`:r.id})(n)}`)(0,i))(e);if(localStorage.getItem(t))return;localStorage.setItem(t,"true")}catch(t){q.error("Failed to persist survey seen state",t)}},sf=[ln.Popover,ln.Widget,ln.API],nf={ignoreConditions:!1,ignoreDelay:!1,displayType:Yn.Popover},rf=re("[PostHog ExternalIntegrations]"),of={intercom:"intercom-integration",crispChat:"crisp-chat-integration"},af=class{constructor(e){this._instance=e}zo(e,t){var i,s;(i=F.__PosthogExtensions__)===null||i===void 0||(s=i.loadExternalDependency)===null||s===void 0||s.call(i,this._instance,e,n=>{if(n)return rf.error("failed to load script",n);t()})}startIfEnabledOrStop(){var e;for(let[n,r]of Object.entries((e=this._instance.config.integrations)!==null&&e!==void 0?e:{})){var t,i,s;r&&!(!((t=F.__PosthogExtensions__)===null||t===void 0||(t=t.integrations)===null||t===void 0)&&t[n])&&this.zo(of[n],()=>{var o;(o=F.__PosthogExtensions__)===null||o===void 0||(o=o.integrations)===null||o===void 0||(o=o[n])===null||o===void 0||o.start(this._instance)}),!r&&(!((i=F.__PosthogExtensions__)===null||i===void 0||(i=i.integrations)===null||i===void 0)&&i[n])&&((s=F.__PosthogExtensions__)===null||s===void 0||(s=s.integrations)===null||s===void 0||(s=s[n])===null||s===void 0||s.stop())}}},lf=class{constructor(e,t){this.A=e,this.bo=t,this.lu=new Map,this.To=!1}add(e){var t=this;return ee(function*(){if(t.To)throw new Error("Cannot add an extension to a disposed ExtensionRuntime");if(t.lu.has(e.name))throw new Error(`Browser extension "${e.name}" is already registered`);t.lu.set(e.name,e);try{let i=e.setup(t.bo);i&&(yield i)}catch(i){let s=t.lu.get(e.name)===e;s&&t.lu.delete(e.name),t.A.error(`Failed to set up browser extension "${e.name}"`,i),s&&t.uu(e)}})()}getExtension(e){return this.lu.get(e)}dispose(){if(this.To)return;this.To=!0;let e=Array.from(this.lu.values()).reverse();this.lu.clear();for(let t of e)this.uu(t)}uu(e){try{var t;let i=(t=e.dispose)===null||t===void 0?void 0:t.call(e);i&&le(i.then)&&i.then(void 0,s=>{this.A.error(`Failed to dispose browser extension "${e.name}"`,s)})}catch(i){this.A.error(`Failed to dispose browser extension "${e.name}"`,i)}}},cf=class{constructor(e){this._instance=e}initialize(){}get(e){let t=this._instance.persistence;if(typeof e=="string")return t==null?void 0:t.get_property(e);let i={};for(let s of e){let n=t==null?void 0:t.get_property(s);x(n)||(i[s]=n)}return i}set(e,t){var i;(i=this._instance.persistence)===null||i===void 0||i.register(typeof e=="string"?{[e]:t}:e)}remove(e){var t;(t=this._instance.persistence)===null||t===void 0||t.unregister(e)}},la="extensionsRemoteConfig",uf=class{constructor(e){this.instance=e,this.To=!1,this.A=M,this.cu=e.hu,this.kv=new cf(e),this.onEvent=t=>Ji(this.instance.on("eventCaptured",i=>{try{t({event:i.event,properties:i.properties})}catch(s){this.A.error("Browser extension event listener failed",s)}})),this.onRemoteConfig=t=>{if(this.To)return Ji(()=>{});let i=n=>{try{t(n)}catch(r){this.A.error("Browser extension remote config listener failed",r)}},s=this.instance.du.on(la,i);return this.cu&&i(this.cu),Ji(s)},this.vu=new lf(M.createLogger("[BrowserExtensions]"),this)}get logger(){return this.A}get distinctId(){return this.instance.get_distinct_id()}get anonymousId(){var e;return(e=this.instance.get_property("$device_id"))!==null&&e!==void 0?e:this.distinctId}get deviceId(){let e=this.instance.get_property(ur);return typeof e=="string"?e:void 0}get library(){return{name:ue.LIB_NAME,version:ue.LIB_VERSION}}get initialPersonProperties(){var e,t;return(e=(t=this.instance.persistence)===null||t===void 0?void 0:t.get_initial_props())!==null&&e!==void 0?e:{}}get groups(){return this.instance.getGroups()}get session(){try{var e,t,i,s;let n=(e=this.instance.sessionManager)===null||e===void 0?void 0:e.checkAndGetSessionAndWindowId(!0);return{sessionId:(t=n==null?void 0:n.sessionId)!==null&&t!==void 0?t:"",windowId:(i=n==null?void 0:n.windowId)!==null&&i!==void 0?i:"",sessionStartTimestamp:(s=n==null?void 0:n.sessionStartTimestamp)!==null&&s!==void 0?s:0}}catch{return{sessionId:"",windowId:"",sessionStartTimestamp:0}}}get canCapture(){return this.instance.is_capturing()}get projectToken(){return this.instance.config.token}add(e){return this.vu.add(e)}getExtension(e){return this.vu.getExtension(e)}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 Ji(this.instance.fu(e))}handleRemoteConfig(e){this.To||(this.cu=e,this.instance.du.emit(la,e))}sendRequest(e){var t=this;return ee(function*(i,s={}){var n;let r=t.instance.requestRouter.endpointFor((n=s.target)!==null&&n!==void 0?n:"api",i),o={method:s.method,url:s.query?Ni(r,s.query):r,data:s.body,headers:s.headers,timeout:s.timeoutMs,fireCallbackOnDrop:!0,transport:s.transport,compression:s.compression,compressionFallback:s.target==="flags"&&s.compression==="best-available"?$n.Base64:void 0,timestampMode:s.sentAt};return s.transport==="sendBeacon"?(t.instance._send_request(o),{statusCode:202}):new Promise(a=>{o.callback=a,t.instance._send_request(o)})}).apply(this,arguments)}dispose(){this.To||(this.To=!0,this.vu.dispose())}},Pi={},vn=0,Mi=()=>{},ca='Consent opt in/out is not valid with cookieless_mode="always" and will be ignored',Nt="Surveys module not available",ua="sanitize_properties is deprecated. Use before_send instead",nu="Invalid value for property_denylist config: ",df=["$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"],hf=["$feature_flag_called","$$heatmap","$snapshot"],da=e=>e.charAt(0)==="$"&&!O(hf,e),pf=/^[A-Za-z0-9_-]{1,400}$/,ha=/^fb\.[0-9]+\.[0-9]+\.[A-Za-z0-9_-]+(?:\.[A-Za-z0-9_-]+)?$/,pa=/^fb\.[0-9]+\.[0-9]+\.[0-9]+$/,ff=["token","distinct_id",Ql],mi="posthog",vf=e=>{let t={};return e&&e!=="unset"&&("2025-11-30">e||(t.strictMinimumDuration=!0),"2026-05-30">e||(t.canvasCapture={resolutionScale:.6}),"2026-06-25">e||(t.streamNetworkBody=!0),"2026-08-30">e||(t.captureJsonLd=!0)),t},gn=e=>{var t;return f({api_host:"https://us.i.posthog.com",flags_api_host:null,ui_host:null,asset_host:null,token:"",autocapture:!0,cross_subdomain_cookie:lp(E==null?void 0:E.location),persistence:"localStorage+cookie",persistence_name:"",cookie_persisted_properties:[],loaded:Mi,save_campaign_params:!0,custom_campaign_params:[],custom_blocked_useragents:[],save_referrer:!0,capture_pageleave:"if_capture_pageview",defaults:e!=null?e:"unset",__preview_deferred_init_extensions:!1,__preview_external_dependency_versioned_paths:!1,__preview_cookie_wins_on_conflict:!1,debug:K&&H(K==null?void 0:K.search)&&K.search.indexOf("__posthog_debug=true")!==-1||!1,cookie_expiration:365,upgrade:!1,disable_session_recording:!1,disable_persistence:!1,disable_web_experiments:!0,disable_surveys:!1,disable_surveys_automatic_display:!1,disable_conversations:!1,disable_product_tours:!1,disableDeviceModel:!1,reuseAnonymousId:!1,disable_external_dependency_loading:!1,strict_script_versioning:"fallback",enable_recording_console_log:void 0,secure_cookie:(b==null||(t=b.location)===null||t===void 0?void 0:t.protocol)==="https:",ip:!1,opt_out_capturing_by_default:!1,opt_out_persistence_by_default:!1,opt_out_useragent_filter:!1,opt_out_capturing_persistence_type:"localStorage",consent_persistence_name:null,opt_out_capturing_cookie_prefix:null,opt_in_site_apps:!1,property_denylist:[],respect_dnt:!1,sanitize_properties:null,request_headers:{},request_batching:!0,properties_string_max_length:65535,mask_all_element_attributes:!1,mask_all_text:!1,mask_personal_data_properties:!1,custom_personal_data_properties:[],advanced_disable_flags:!1,advanced_disable_decide:!1,advanced_disable_feature_flags:!1,advanced_disable_feature_flags_on_first_load:!1,advanced_only_evaluate_survey_feature_flags:!1,advanced_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(i){M.error("Bad HTTP status: "+i.statusCode+" "+i.text)},get_device_id:i=>i,capture_performance:void 0,name:"posthog",bootstrap:{},disable_compression:!1,session_idle_timeout_seconds:1800,person_profiles:cc,before_send:void 0,get_current_url:void 0,request_queue_config:{flush_interval_ms:3e3},error_tracking:{},_onCapture:Mi},(i=>({rageclick:i&&i>="2026-05-30"?{content_ignorelist:xr,ignore_text_selection:!0}:!i||"2025-11-30">i||{content_ignorelist:!0},capture_pageview:!i||"2025-05-24">i||"history_change",session_recording:vf(i),external_scripts_inject_target:i&&i>="2026-01-30"?"head":"body",internal_or_test_user_hostname:i&&i>="2026-01-30"?/^(localhost|127\.0\.0\.1)$/:void 0,persistence_save_debounce_ms:i&&i>="2026-05-30"?250:0,split_storage:!(!i||"2026-05-30">i),detect_google_search_app:!(!i||"2026-05-30">i),disable_capture_url_hashes:!(!i||"2026-06-25">i),cookieWinsOnConflict:!(!i||i==="unset"||"2026-08-29">i)}))(e))},gf=[["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"]],fa=e=>{let t={};for(let[n,r]of gf)x(e[n])||(t[r]=e[n]);let i=Q({},t,e),s=e.__preview_external_dependency_versioned_paths;return x(s)||(x(e.strict_script_versioning)&&(i.strict_script_versioning=!!s),H(s)&&x(e.asset_host)&&(i.asset_host=s)),R(e.property_blacklist)&&(x(e.property_denylist)?i.property_denylist=e.property_blacklist:R(e.property_denylist)?i.property_denylist=[...e.property_blacklist,...e.property_denylist]:M.error(nu+e.property_denylist)),i},_f=class{constructor(){this.__forceAllowLocalhost=!1}get pu(){return this.__forceAllowLocalhost}set pu(e){M.error("WebPerformanceObserver is deprecated and has no impact on network capture. Use `_forceAllowLocalhostNetworkCapture` on `posthog.sessionRecording`"),this.__forceAllowLocalhost=e}},Ti=class pt{gu(t){if(!t)return;let i=this.lu.indexOf(t);i!==-1&&this.lu.splice(i,1)}mu(t,i){var s;return this.gu(t),this.lu.push(i),(s=i.initialize)===null||s===void 0||s.call(i),i}yu(){return this.config.cookieless_mode==="always"||this.config.cookieless_mode==="on_reject"&&this.consent.isRejected()}bu(){if(this._u||this.config.reuseAnonymousId||this.config.segment||this.yu())return;let t=this.config.persistence==="memory"||this.config.persistence==="sessionStorage";if(!t&&!this.config.disable_persistence||this.wu)return;let i,s,n;t?(i=`persistence is set to '${this.config.persistence}'`,s=this.config.persistence==="memory"?"on every page load":"for every new browser tab or window",n="Either set persistence to 'localStorage+cookie', keep this persistence and pass a stable ID through bootstrap.distinctID, or enable reuseAnonymousId."):(i="persistence is disabled (disable_persistence is true)",s="on every page load",n="Either set disable_persistence to false, keep persistence disabled and pass a stable ID through bootstrap.distinctID, or enable reuseAnonymousId."),this._u=!0,console.warn("[PostHog.js]",`${i} but no bootstrap.distinctID was provided. PostHog will mint a new distinct ID ${s}, 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. ${n}`)}ku(){let t=this.persistence;if(!t||this.Su)return;if(this.yu())return void(this.config.cookieless_mode==="on_reject"&&this.get_distinct_id()!=="$posthog_cookieless"&&(this.xu(),this.$u()));if(this.get_distinct_id()!=="$posthog_cookieless")return;this.Cu()||t.load(!0);let i=this.get_distinct_id();if(!i||i==="$posthog_cookieless"){let s=this.config.get_device_id(Be());this.register({distinct_id:s,$device_id:s}),t.set_property(ke,it)}this.xu()}get decideEndpointWasHit(){var t,i;return(t=(i=this.featureFlags)===null||i===void 0?void 0:i.hasLoadedFlags)!==null&&t!==void 0&&t}get flagsEndpointWasHit(){var t,i;return(t=(i=this.featureFlags)===null||i===void 0?void 0:i.hasLoadedFlags)!==null&&t!==void 0&&t}constructor(){var t;this.Tu=!1,this.Iu=!1,this.webPerformance=new _f,this.Mu=!1,this.version=ue.LIB_VERSION,this.Eu=new Set,this.Pu="",this.du=new Es,this.lu=[],this.Ru=[],this.Au=!1,this.wu=!1,this._u=!1,this.Su=!1,this._calculate_event_properties=this.calculateEventProperties.bind(this),this.config=gn(),this.SentryIntegration=$p,this.sentryIntegration=s=>(function(n,r){let o=kc(n,r);return{name:xc,processEvent:a=>o(a)}})(this,s),this.__request_queue=[],this.__loaded=!1,this.analyticsDefaultEndpoint="/e/",this.Fu=!1,this.Ou=null,this.Du=null,this.Lu=null,this.scrollManager=new Xp(this),this.pageViewManager=new Yo(this),this.rateLimiter=new Lp(this),this.requestRouter=new tf(this),this.consent=new vp(this),this.externalIntegrations=new af(this);let i=(t=pt.__defaultExtensionClasses)!==null&&t!==void 0?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:(s,n,r)=>{let o=H(s)?{[s]:n}:s;this.setPersonProperties(o),r==null||r({})},set_once:(s,n,r)=>{let o=H(s)?{[s]:n}:s;this.setPersonProperties(void 0,o),r==null||r({})}},this.on("eventCaptured",s=>M.info(`send "${s==null?void 0:s.event}"`,s))}init(t,i,s){if(s&&s!==mi){var n;let r=(n=Pi[s])!==null&&n!==void 0?n:new pt;return r._init(t,i,s),Pi[s]=r,Pi[mi][s]=r,r}return this._init(t,i,s)}_init(t,i={},s){var n,r,o;let a=H(t)?t.trim():"";if(!a)return M.critical("PostHog was initialized without a token. This likely indicates a misconfiguration. Please check the first argument passed to posthog.init()"),this;var l;if(this.__loaded)return a!==((l=this.config)===null||l===void 0?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('${a}', { ... }, 'project2')`):console.warn("[PostHog.js]","You have already initialized PostHog! Re-initializing is a no-op"),this;this.__loaded=!0,this.config=gn(i.defaults),i.debug=this.Nu(i.debug),this.qu=i,this.ju=[],i.person_profiles?this.Du=i.person_profiles:i.process_person&&(this.Du=i.process_person);let c=gn(i.defaults),u=fa(i),d=Q({},c,u,{name:s,token:a});j(c.rageclick)&&j(u.rageclick)&&(d.rageclick=Q({},c.rageclick,u.rageclick)),j(c.session_recording)&&j(u.session_recording)&&(d.session_recording=Q({},c.session_recording,u.session_recording)),this.set_config(d),this.config.on_xhr_error&&M.error("on_xhr_error is deprecated. Use on_request_error instead"),this.compression=i.disable_compression?void 0:Ce.GZipJS;let h=this.Cu(),p=!this.yu();if(this.persistence=new an(this.config,h,!0,p),this.sessionPersistence=this.config.persistence==="sessionStorage"||this.config.persistence==="memory"?this.persistence:new an(f(f({},this.config),{},{persistence:"sessionStorage"}),h,!1,p),this.Pu="ph_"+(this.config.persistence_name||this.config.token)+"_session_registered_properties",this.config.persistence!=="memory"&&!h&&J.At()){let m=J.Lt(this.Pu);R(m)&&m.forEach(w=>{H(w)&&this.Eu.add(w)})}else J.Pt(this.Pu);let v=f({},this.persistence.props),_=f({},this.sessionPersistence.props);this.register({$initialization_time:new Date().toISOString()}),this.Bu=new qp((m,w)=>this.zu(m,w),this.config.request_queue_config),this.Hu=new Yp(this),this.__request_queue=[];let g=this.yu();g||(this.sessionManager=new oa(this),this.sessionPropsManager=new na(this,this.sessionManager,this.persistence),this.sessionManager.onSessionId((m,w,P)=>{(P!=null&&P.activityTimeout||P!=null&&P.sessionPastMaximumLength||P!=null&&P.crossTabAdoption)&&this.Uu()})),this.Wu(),this.config.__preview_deferred_init_extensions?(M.info("Deferring extension initialization to improve startup performance"),setTimeout(()=>{this.Vu(g)},0)):(M.info("Initializing extensions synchronously"),this.Vu(g)),ue.DEBUG=ue.DEBUG||this.config.debug,ue.DEBUG&&M.info("Starting in debug mode",{this:this,config:i,thisC:f({},this.config),p:v,s:_}),this.config.identity_distinct_id&&!(!((n=i.bootstrap)===null||n===void 0)&&n.distinctID)&&(i.bootstrap=f(f({},i.bootstrap),{},{distinctID:this.config.identity_distinct_id,isIdentifiedID:!0}));let y=(r=i.bootstrap)===null||r===void 0?void 0:r.distinctID;if(this.wu=!!y&&!yi(y),(o=i.bootstrap)===null||o===void 0?void 0:o.distinctID){let m=i.bootstrap.distinctID,w=this.get_distinct_id(),P=this.persistence.get_property(ke);if(i.bootstrap.isIdentifiedID&&w!=null&&w!==m&&P==="anonymous")this.identify(m);else if(i.bootstrap.isIdentifiedID&&w!=null&&w!==m&&P==="identified")M.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{let $=this.config.get_device_id(Be()),k=i.bootstrap.isIdentifiedID?$:m;this.persistence.set_property(ke,i.bootstrap.isIdentifiedID?ns:it),this.register({distinct_id:m,$device_id:k})}}if(g)this.register_once({distinct_id:Js,$device_id:null},"");else if(!this.get_distinct_id()){let m=this.config.get_device_id(Be());this.register_once({distinct_id:m,$device_id:m},""),this.persistence.set_property(ke,it)}return G(b,"onpagehide"in self?"pagehide":"unload",this._handle_unload.bind(this),{passive:!1}),G(b,"pageshow",()=>{var m;this.Tu=!1,this.Iu||(m=this.Hu)===null||m===void 0||m.resume()}),i.segment?Zo(this,()=>this.Gu()):this.Gu(),le(this.config._onCapture)&&this.config._onCapture!==Mi&&(M.warn("onCapture is deprecated. Please use `before_send` instead"),this.on("eventCaptured",m=>this.config._onCapture(m.event,m))),this.config.ip&&M.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 Qc.apply(this,arguments)})().then(m=>{m&&this.register({[Xs]:m})}).catch(Mi),this}Qu(t){let i=t;return H(i.name)&&le(i.setup)}Zu(t,i){this.Qu(t)?i.push(()=>{this.Ju().add(t).catch(()=>{var s;return(s=t.dispose)===null||s===void 0?void 0:s.call(t)}).catch(s=>{M.error(`Failed to dispose browser extension "${t.name}"`,s)})}):this.lu.push(t)}Wu(){var t,i,s;let n=(t=(i=this.config.__extensionClasses)===null||i===void 0?void 0:i.featureFlags)!==null&&t!==void 0?t:(s=pt.__defaultExtensionClasses)===null||s===void 0?void 0:s.featureFlags;var r,o,a;n&&(this.featureFlags&&this.featureFlags instanceof n||((r=this.Ku)===null||r===void 0||r.call(this),this.Ku=void 0,this.featureFlags=new n(this)),le(this.featureFlags.onReloading)&&le(this.featureFlags.setup)?this.Ku||(this.Ku=this.featureFlags.onReloading(()=>{this.du.emit("featureFlagsReloading",!0)}),this.Ju().add(this.featureFlags)):(o=(a=this.featureFlags).initialize)===null||o===void 0||o.call(a))}Vu(t){let i=performance.now(),s=f(f({},pt.__defaultExtensionClasses),this.config.__extensionClasses),n=[];var r,o,a,l,c,u,d,h;s.exceptions&&this.lu.push(this.exceptions=(r=this.exceptions)!==null&&r!==void 0?r:new s.exceptions(this)),s.historyAutocapture&&this.lu.push(this.historyAutocapture=new s.historyAutocapture(this)),s.tracingHeaders&&this.lu.push(this.tracingHeaders=new s.tracingHeaders(this)),s.siteApps&&this.lu.push(this.siteApps=new s.siteApps(this)),s.sessionRecording&&!t&&this.lu.push(this.sessionRecording=new s.sessionRecording(this)),this.config.disable_scroll_properties||n.push(()=>{this.scrollManager.startMeasuringScrollPosition()}),s.autocapture&&this.Zu(this.autocapture=new s.autocapture(this),n),s.surveys&&this.Zu(this.surveys=(o=this.surveys)!==null&&o!==void 0?o:new s.surveys(this),n),s.logs&&this.Zu(this.logs=(a=this.logs)!==null&&a!==void 0?a:new s.logs(this),n),s.metrics&&this.lu.push(this.metrics=(l=this.metrics)!==null&&l!==void 0?l:new s.metrics(this)),s.conversations&&this.lu.push(this.conversations=(c=this.conversations)!==null&&c!==void 0?c:new s.conversations(this)),s.productTours&&this.lu.push(this.productTours=new s.productTours(this)),s.heatmaps&&this.lu.push(this.heatmaps=new s.heatmaps(this)),s.webVitalsAutocapture&&this.lu.push(this.webVitalsAutocapture=new s.webVitalsAutocapture(this)),s.exceptionObserver&&this.lu.push(this.exceptionObserver=new s.exceptionObserver(this)),s.deadClicksAutocapture&&this.lu.push(this.deadClicksAutocapture=new s.deadClicksAutocapture(this,Ep)),s.toolbar&&this.lu.push(this.toolbar=(u=this.toolbar)!==null&&u!==void 0?u:new s.toolbar(this)),s.experiments&&this.lu.push(this.experiments=(d=this.experiments)!==null&&d!==void 0?d:new s.experiments(this)),s.webMCP&&this.lu.push(this.webMCP=(h=this.webMCP)!==null&&h!==void 0?h:new s.webMCP(this)),this.lu.forEach(p=>{p.initialize&&n.push(()=>{var v;(v=p.initialize)===null||v===void 0||v.call(p)})}),n.push(()=>{if(this.Xu){let p=this.Xu;this.Xu=void 0,this.lu.forEach(v=>{var _;return(_=v.onRemoteConfig)===null||_===void 0?void 0:_.call(v,p)})}}),this.Yu(n,i)}Yu(t,i){for(;t.length>0;){if(this.config.__preview_deferred_init_extensions&&performance.now()-i>=30&&t.length>0)return void setTimeout(()=>{this.Yu(t,i)},0);let n=t.shift();if(n)try{n()}catch(r){M.error("Error initializing extension:",r)}}let s=Math.round(performance.now()-i);this.register_for_session({[ec]:this.config.__preview_deferred_init_extensions?"deferred":"synchronous",[tc]:s}),this.config.__preview_deferred_init_extensions&&M.info(`PostHog extensions initialized (${s}ms)`)}el(t){var i;if(!E||!E.body)return M.info("document not ready yet, trying again in 500 milliseconds..."),void setTimeout(()=>{this.el(t)},500);if(this.config.__preview_deferred_init_extensions&&(this.Xu=t),this.hu=t,this.compression=void 0,t.ok){var s;let n=t.config;n.supportedCompression&&!this.config.disable_compression&&(this.compression=O(n.supportedCompression,Ce.GZipJS)?Ce.GZipJS:O(n.supportedCompression,Ce.Base64)?Ce.Base64:void 0),!((s=n.analytics)===null||s===void 0)&&s.endpoint&&(this.analyticsDefaultEndpoint=n.analytics.endpoint)}this.set_config({person_profiles:this.Du?this.Du:cc}),(i=this.tc)===null||i===void 0||i.handleRemoteConfig(t),this.lu.forEach(n=>{var r;return(r=n.onRemoteConfig)===null||r===void 0?void 0:r.call(n,t)})}Gu(){try{this.config.loaded(this)}catch(t){M.critical("`loaded` function failed",t)}if(this.ec(),this.config.internal_or_test_user_hostname&&(K==null?void 0:K.hostname)){let t=K.hostname,i=this.config.internal_or_test_user_hostname;(typeof i=="string"?t===i:i.test(t))&&this.setInternalOrTestUser()}this.config.capture_pageview&&setTimeout(()=>{(this.consent.isOptedIn()||this.yu())&&this.nc()},1),this.sc=new Lc(this),this.sc.load()}ec(){var t;this.is_capturing()&&this.config.request_batching&&((t=this.Bu)===null||t===void 0||t.enable())}_dom_loaded(){this.is_capturing()&&Wt(this.__request_queue,t=>this.zu(t)),this.__request_queue=[],this.ec()}_handle_unload(){var t,i,s,n,r,o;this.Tu=!0,(t=this.surveys)===null||t===void 0||(i=t.handlePageUnload)===null||i===void 0||i.call(t),(s=this.metrics)===null||s===void 0||s.flush("sendBeacon"),this.config.request_batching?(this.rc()&&this.capture(Ao),(n=this.logs)===null||n===void 0||n.flushLogs("sendBeacon"),(r=this.Bu)===null||r===void 0||r.unload(),(o=this.Hu)===null||o===void 0||o.unload()):this.rc()&&this.capture(Ao,null,{transport:"sendBeacon"})}_send_request(t){Jc(this,t)}zu(t,i){this.Hu?this.Hu.retriableRequest(t,i):this._send_request(i?f(f({},t),{},{transport:i}):t)}_execute_array(t){vn++;try{let i,s=[],n=[],r=[];Wt(t,a=>{if(a)if(i=a[0],R(i))r.push(a);else if(le(a))try{a.call(this)}catch(l){M.error("Error executing queued PostHog call",a,l)}else R(a)&&i==="alias"?s.push(a):R(a)&&i.indexOf("capture")!==-1&&le(this[i])?r.push(a):n.push(a)});let o=function(a,l){Wt(a,function(c){try{if(R(c[0])){let u=l;Z(c,function(d){u=u[d[0]].apply(u,d.slice(1))})}else l[c[0]].apply(l,c.slice(1))}catch(u){M.error("Error executing queued PostHog call",c,u)}})};o(s,this),o(n,this),o(r,this)}finally{vn--}}push(t){if(vn>0&&R(t)&&H(t[0])){let i=pt.prototype[t[0]];return void(le(i)&&i.apply(this,t.slice(1)))}this._execute_array([t])}get oc(){return{property:To,persistenceKey:Gt,cookieName:"_fbc",pattern:ha,register:(t,i)=>{var s;return(s=this.persistence)===null||s===void 0?void 0:s.register({[Gt]:{value:t,delivered:i}})},unregister:()=>{var t;return(t=this.persistence)===null||t===void 0?void 0:t.unregister(Gt)}}}get ac(){return{property:Io,persistenceKey:xi,cookieName:"_fbp",pattern:pa,register:(t,i)=>{var s;return(s=this.persistence)===null||s===void 0?void 0:s.register({[xi]:{value:t,delivered:i}})},unregister:()=>{var t;return(t=this.persistence)===null||t===void 0?void 0:t.unregister(xi)}}}lc(t){var i;let s=(i=this.persistence)===null||i===void 0?void 0:i.get_property(t.persistenceKey);return H(s)&&t.pattern.test(s)?{value:s,delivered:!1}:j(s)&&H(s.value)&&t.pattern.test(s.value)?{value:s.value,delivered:s.delivered===!0}:void 0}uc(t,i,s){return i===(s==null?void 0:s.value)?{value:i,pending:!s.delivered}:(t.register(i,!1),{value:i,pending:!0})}cc(t){if(!this.config.save_campaign_params||this.yu())return;let i=Si(t.cookieName);return H(i)&&t.pattern.test(i)?i:void 0}hc(t,i,s,n){if(!this.persistence)return;let r=this.oc;this.persistence.refreshKey(r.persistenceKey);let o=this.lc(r);if(n)return void r.unregister();if(s)return H(i)&&ha.test(i)?this.uc(r,i,o):void r.unregister();let a=H(t)&&pf.test(t)?t:void 0,l=this.cc(r);return l&&((c,u,d)=>{let h=c.split(".");if(u)return h[3]===u;if(!d)return!0;let p=d.value.split(".");return h[3]===p[3]||Number(h[2])>Number(p[2])})(l,a,o)?this.uc(r,l,o):a?(o==null?void 0:o.value.split(".")[3])===a?{value:o.value,pending:!o.delivered}:this.uc(r,`fb.1.${Date.now()}.${a}`,o):o?{value:o.value,pending:!o.delivered}:void 0}dc(t,i,s){if(!this.persistence)return;let n=this.ac;this.persistence.refreshKey(n.persistenceKey);let r=this.lc(n);if(s)return void n.unregister();if(i)return H(t)&&pa.test(t)?this.uc(n,t,r):void n.unregister();let o=this.cc(n);return o?this.uc(n,o,r):r?{value:r.value,pending:!r.delivered}:void 0}vc(t,i){if(!this.persistence)return;this.persistence.refreshKey(t.persistenceKey);let s=this.lc(t);(s==null?void 0:s.value)!==i||s.delivered||t.register(i,!0)}capture(t,i,s){var n,r;if(!(this.__loaded&&this.persistence&&this.sessionPersistence&&this.Bu))return void M.uninitializedWarning("posthog.capture");if(!this.is_capturing())return;if(x(t)||!H(t))return void M.error("No event name provided to posthog.capture");if(this.ku(),t==="$snapshot"&&this.yu())return;let o=!this.config.opt_out_useragent_filter&&this._is_bot();if(o&&!this.config.__preview_capture_bot_pageviews)return;let a=s!=null&&s.skip_client_rate_limiting?void 0:this.rateLimiter.clientRateLimitContext();if(a!=null&&a.isRateLimited)return void M.critical("This capture call is ignored due to client rate limiting.");let l;i!=null&&i.$current_url&&!H(i==null?void 0:i.$current_url)&&(M.error("Invalid `$current_url` property provided to `posthog.capture`. Input must be a string. Ignoring provided value."),i==null||delete i.$current_url),t!=="$exception"||s!=null&&s.fc||M.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&&(l=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();let c=new Date,u=(s==null?void 0:s.timestamp)||c,d=uo(s==null?void 0:s.uuid,Be),h={uuid:d,event:t,properties:this.calculateEventProperties(t,i||{},u,d)};t==="$pageview"&&this.config.__preview_capture_bot_pageviews&&o&&(h.event="$bot_pageview",h.properties.$browser_type="bot"),a&&(h.properties.$lib_rate_limit_remaining_tokens=a.remainingTokens);let p=t==="$feature_flag_called"&&h.properties.$feature_flag_has_experiment===!1&&this.get_property("$minimal_flag_called_events")===!0;s!=null&&s.$set&&!p&&(h.$set=s==null?void 0:s.$set);let v=j(i==null?void 0:i.$set)?i.$set:void 0,_=R(i==null?void 0:i.$unset)?i.$unset:[],g=(s==null?void 0:s.$unset)||[],y=C=>{var B;let W=!!(s!=null&&s.$set)&&C in s.$set;return{hasProvided:W||!!v&&C in v,provided:W?s==null||(B=s.$set)===null||B===void 0?void 0:B[C]:v==null?void 0:v[C],unset:_.indexOf(C)!==-1||g.indexOf(C)!==-1}},m=y(To),w=y(Io),P=[{channel:this.oc,hasProvided:m.hasProvided,update:this.hc(l==null?void 0:l.fbclid,m.provided,m.hasProvided,m.unset)},{channel:this.ac,hasProvided:w.hasProvided,update:this.dc(w.provided,w.hasProvided,w.unset)}];for(let{channel:C,hasProvided:B,update:W}of P)W&&h.properties.$process_person_profile===!0&&W.pending&&!B&&!p&&(h.$set=f({[C.property]:W.value},h.$set));let $=s==null?void 0:s.$unset;$&&(h.$unset=$);let k=p?void 0:this.gc(s==null?void 0:s.$set_once,t!==Co,t===uc);if(k&&(h.$set_once=k),s!=null&&s._noTruncate||(T=this.config.properties_string_max_length,h=(function(C,B){let W=new Set;return(function Y(z,ie){if(z!==Object(z))return B?B(z):z;if(W.has(z))return;let ge;if(W.add(z),R(z))ge=[],Wt(z,de=>{ge.push(Y(de))});else{let de={};Z(ii(z)?dc(z):z,(me,Ie)=>{W.has(me)||(de[Ie]=Y(me,Ie))}),ge=de}return ge})(C)})(h,C=>H(C)?C.slice(0,T):C)),h.timestamp=u,x(s==null?void 0:s.timestamp)||(h.properties.$event_time_override_provided=!0,h.properties.$event_time_override_system_time=c),p&&(h.properties=((C,B=[])=>{let W={},Y=z=>{C[z]!==void 0&&(W[z]=C[z])};return ih.forEach(Y),B.forEach(Y),W})(h.properties,ff)),t===Ae.DISMISSED||t===Ae.SENT){let C=i==null?void 0:i[cn.SURVEY_ID],B=i==null?void 0:i[cn.SURVEY_ITERATION];su({id:C,current_iteration:B}),h.$set=f(f({},h.$set),{},{[Kp({id:C,current_iteration:B},t===Ae.SENT?"responded":"dismissed")]:!0})}else t===Ae.SHOWN&&(h.$set=f(f({},h.$set),{},{[cn.SURVEY_LAST_SEEN_DATE]:new Date().toISOString()}));var T;if(t===Rp.SHOWN){let C=i==null?void 0:i[Ko.TOUR_TYPE];C&&(h.$set=f(f({},h.$set),{},{[`${Ko.TOUR_LAST_SEEN_DATE}/${C}`]:new Date().toISOString()}))}let S=f(f({},h.properties.$set),h.$set);if(Me(S)||this.setPersonPropertiesForFlags(S),!D(this.config.before_send)){let C=this.Os(h);if(!C)return;h=C,h.uuid=uo(h.uuid,Be)}this.sessionRecording&&!this.Au&&da(t)&&(this.Au=!0,setTimeout(()=>this.Au=!1,3e4));let I=P.filter(({channel:C,update:B})=>{var W,Y,z;let ie=(W=(Y=h.$set)===null||Y===void 0?void 0:Y[C.property])!==null&&W!==void 0?W:j((z=h.properties)===null||z===void 0?void 0:z.$set)?h.properties.$set[C.property]:void 0;return(B==null?void 0:B.pending)&&ie===B.value});this.du.emit("eventCaptured",h);let A=(n=s==null?void 0:s._url)!==null&&n!==void 0?n:this.requestRouter.endpointFor("api",this.analyticsDefaultEndpoint),N=(s==null?void 0:s._batchKey)==="recordings"||/\/s\/(?:\?|$)/.test(A),L=f(f(f({method:"POST",url:A,data:h,compression:"best-available",preferSyncCompression:s==null?void 0:s.send_instantly,timestampMode:N?"body":"capture-body",batchKey:s==null?void 0:s._batchKey},N&&(!((r=h.properties)===null||r===void 0)&&r.$session_id)?{batchGroup:h.properties.$session_id+(h.properties.$window_id?`-${h.properties.$window_id}`:"")}:{}),s!=null&&s.transport?{transport:s.transport}:{}),I.length?{fireCallbackOnDrop:!0,callback:C=>{if(C.statusCode>=200&&300>C.statusCode)for(let{channel:B,update:W}of I)this.vc(B,W.value)}}:{});if(!this.config.request_batching||s&&!(s!=null&&s._batchKey)||s!=null&&s.send_instantly){var V;let C;!L.transport&&!L.callback&&Me((V=this.config.request_headers)!==null&&V!==void 0?V:{})&&this.Tu&&(C="sendBeacon"),this.zu(L,C)}else this.Bu.enqueue(L);return h}_addCaptureHook(t){return this.on("eventCaptured",i=>t(i.event,i))}getExtension(t){var i;return(i=this.tc)===null||i===void 0?void 0:i.getExtension(t)}Ju(){var t;return(t=this.tc)!==null&&t!==void 0?t:this.tc=new uf(this)}fu(t){this.Ru.push(t);let i=!0;return()=>{if(!i)return;i=!1;let s=this.Ru.indexOf(t);s!==-1&&this.Ru.splice(s,1)}}mc(t=!0){var i,s,n;return!!(!((i=this.persistence)===null||i===void 0)&&i.consumeCookieIdentityChange())&&(this.Lu=null,this.persistence.get_property("$user_state")==="anonymous"&&((n=this.sessionPersistence)===null||n===void 0||n.clear(),this.Eu.clear(),this.yc()),(s=this.featureFlags)===null||s===void 0||s.reset(),t&&this.reloadFeatureFlags(),!0)}calculateEventProperties(t,i,s,n,r){if(s=s||new Date,!this.persistence||!this.sessionPersistence)return i;this.ku(),this.persistence.syncCookieProperties(),this.mc();let o=r?void 0:this.persistence.remove_event_timer(t),a=f({},i);if(a.token=this.config.token,a.$config_defaults=this.config.defaults,this.yu()&&(a[Ql]=!0),t==="$snapshot"){let m=f(f({},this.persistence.properties()),this.sessionPersistence.properties());return a.distinct_id=m.distinct_id,(!H(a.distinct_id)&&!oe(a.distinct_id)||yi(a.distinct_id))&&M.error("Invalid distinct_id for replay event. This indicates a bug in your implementation"),a}let l=(function(m,w,P,$=!1){var k,T,S,I;if(!xe)return{};let A=m?[...Qt,...w||[]]:[],[N,L]=vl(xe),[V,C]=(function(he){for(let Re=0;co.length>Re;Re++){let[ot,at,wt]=co[Re],Pe=he.match(ot);if(Pe){let Ge=wt&&he.match(wt)||Pe;return[at,(Ge==null?void 0:Ge[1])||""]}}return["",""]})(xe),B=(function(){let he="u">typeof navigator?navigator:void 0;return he!=null&&he.brave?{brave:!0}:{}})(),W={};x(P)||(W.detectGoogleSearchApp=P);let Y={},z=(k=navigator)===null||k===void 0||(k=k.userAgentData)===null||k===void 0?void 0:k.platform,ie=(T=navigator)===null||T===void 0?void 0:T.maxTouchPoints,ge=b==null||(S=b.screen)===null||S===void 0?void 0:S.width,de=b==null||(I=b.screen)===null||I===void 0?void 0:I.height,me=b==null?void 0:b.devicePixelRatio;x(z)||(Y.userAgentDataPlatform=z),x(ie)||(Y.maxTouchPoints=ie),x(ge)||(Y.screenWidth=ge),x(de)||(Y.screenHeight=de),x(me)||(Y.devicePixelRatio=me);let Ie=Q(mr({$os:N,$os_version:L,$browser:fl(xe,navigator.vendor,B,W),$webview_app:V,$webview_app_version:C,$device:gl(xe),$device_type:Sd(xe,Y),$timezone:Sc(),$timezone_offset:Cp()}),{$current_url:Ri($?yt(K==null?void 0:K.href):K==null?void 0:K.href,A,Li),$host:K==null?void 0:K.host,$pathname:K==null?void 0:K.pathname,$raw_user_agent:xe.length>1e3?xe.substring(0,997)+"...":xe,$browser_version:kd(xe,navigator.vendor,B,W),$browser_language:Ac(),$browser_language_prefix:Ap(),$screen_height:b==null?void 0:b.screen.height,$screen_width:b==null?void 0:b.screen.width,$viewport_height:b==null?void 0:b.innerHeight,$viewport_width:b==null?void 0:b.innerWidth,$lib:st.LIB_NAME,$lib_version:st.LIB_VERSION,$insert_id:Math.random().toString(36).substring(2,10)+Math.random().toString(36).substring(2,10),$time:Date.now()/1e3});return st.SDK_DIST_CHANNEL&&(Ie.$sdk_dist_channel=st.SDK_DIST_CHANNEL),Ie})(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){let{sessionId:m,windowId:w}=this.sessionManager.checkAndGetSessionAndWindowId(r,s.getTime(),!0);a.$session_id=m,a.$window_id=w}this.sessionPropsManager&&Q(a,this.sessionPropsManager.getSessionProps());try{var c;if(this.sessionRecording){let m=this.sessionRecording.sdkDebugProperties,w=!this.Au&&da(t);for(let P in m)(w||O(df,P))&&(a[P]=m[P])}a.$sdk_debug_retry_queue_size=(c=this.Hu)===null||c===void 0?void 0:c.length}catch(m){a.$sdk_debug_error_capturing_properties=String(m)}let u;if(this.requestRouter.region===er&&(a.$lib_custom_api_host=this.config.api_host),u=t!=="$pageview"||r?t!=="$pageleave"||r?this.pageViewManager.doEvent():this.pageViewManager.doPageLeave(s):this.pageViewManager.doPageView(s,n),a=Q(a,u),t==="$pageview"&&E&&(a.title=E.title),!x(o)){let m=s.getTime()-o;a.$duration=parseFloat((m/1e3).toFixed(3))}xe&&this.config.opt_out_useragent_filter&&(a.$browser_type=this._is_bot()?"bot":"browser");let d=this.persistence.properties(),h=this.sessionPersistence.properties(),p=a.$groups,v=d.$groups;j(p)&&!Me(p)&&(a.$groups=f(f({},j(v)?v:{}),p)),Z(["$referrer","$referring_domain"],m=>{m in d&&delete h[m]});let _={};if(this.Ru.length>0)for(let m of this.Ru.slice())try{Q(_,m())}catch(w){M.error("Failed to produce browser extension event properties",w)}a=Q({},l,d,h,f(f({},_),a)),a.$is_identified=this._isIdentified(),R(this.config.property_denylist)?Z(this.config.property_denylist,function(m){delete a[m]}):M.error(nu+this.config.property_denylist+" or property_blacklist config: "+this.config.property_blacklist);let g=this.config.sanitize_properties;g&&(M.error(ua),a=g(a,t));let y=this.bc();return a.$process_person_profile=y,y&&!r&&this._c("_calculate_event_properties"),a}gc(t,i=!0,s=!1){var n;if(!this.persistence||!this.bc()||this.Mu&&!s)return t;let r=this.persistence.get_initial_props(),o=(n=this.sessionPropsManager)===null||n===void 0?void 0:n.getSetOnceProps(),a=Q({},r,o||{},t||{}),l=this.config.sanitize_properties;return l&&(M.error(ua),a=l(a,"$set_once")),i&&(this.Mu=!0),Me(a)?void 0:a}register(t,i){var s;(s=this.persistence)===null||s===void 0||s.register(t,i)}register_once(t,i,s){var n;(n=this.persistence)===null||n===void 0||n.register_once(t,i,s)}register_for_session(t){var i,s;(i=this.persistence)===null||i===void 0||i.syncCookieProperties(),this.mc(),(s=this.sessionPersistence)===null||s===void 0||s.register(t),Object.keys(t).forEach(n=>this.Eu.add(n)),this.yc()}unregister(t){var i;(i=this.persistence)===null||i===void 0||i.unregister(t)}unregister_for_session(t){var i;(i=this.sessionPersistence)===null||i===void 0||i.unregister(t),this.Eu.delete(t),this.yc()}wc(t,i){this.register({[t]:i})}Uu(){this.Eu.forEach(t=>{var i;(i=this.sessionPersistence)===null||i===void 0||i.unregister(t)}),this.Eu.clear(),this.yc()}yc(){var t;if(!this.Pu)return;if(this.config.persistence==="memory"||!((t=this.sessionPersistence)===null||t===void 0)&&t.hi||!J.At())return void J.Pt(this.Pu);let i=[];this.Eu.forEach(s=>i.push(s)),i.length>0?J.$t(this.Pu,i):J.Pt(this.Pu)}getFeatureFlag(t,i){var s;return(s=this.featureFlags)===null||s===void 0?void 0:s.getFeatureFlag(t,i)}getFeatureFlagPayload(t){var i;return(i=this.featureFlags)===null||i===void 0?void 0:i.getFeatureFlagPayload(t)}getFeatureFlagResult(t,i){var s;return(s=this.featureFlags)===null||s===void 0?void 0:s.getFeatureFlagResult(t,i)}getAllFeatureFlags(){var t,i;return(t=(i=this.featureFlags)===null||i===void 0?void 0:i.getAllFeatureFlags())!==null&&t!==void 0?t:[]}isFeatureEnabled(t,i){var s,n;return(s=(n=this.featureFlags)===null||n===void 0?void 0:n.isFeatureEnabled(t,i))!==null&&s!==void 0?s:i==null?void 0:i.defaultValue}reloadFeatureFlags(){var t;(t=this.featureFlags)===null||t===void 0||t.reloadFeatureFlags()}updateFlags(t,i,s){var n;(n=this.featureFlags)===null||n===void 0||n.updateFlags(t,i,s)}updateEarlyAccessFeatureEnrollment(t,i,s){var n;(n=this.featureFlags)===null||n===void 0||n.updateEarlyAccessFeatureEnrollment(t,i,s)}getEarlyAccessFeatures(t,i=!1,s){var n;return(n=this.featureFlags)===null||n===void 0?void 0:n.getEarlyAccessFeatures(t,i,s)}on(t,i){return this.du.on(t,i)}onFeatureFlags(t){return this.featureFlags?this.featureFlags.onFeatureFlags(t):(t([],{},{errorsLoading:!0}),()=>{})}onSurveysLoaded(t){return this.surveys?this.surveys.onSurveysLoaded(t):(t([],{isLoaded:!1,error:Nt}),()=>{})}onSessionId(t){var i,s;return(i=(s=this.sessionManager)===null||s===void 0?void 0:s.onSessionId(t))!==null&&i!==void 0?i:()=>{}}getSurveys(t,i=!1){this.surveys?this.surveys.getSurveys(t,i):t([],{isLoaded:!1,error:Nt})}getActiveMatchingSurveys(t,i=!1){this.surveys?this.surveys.getActiveMatchingSurveys(t,i):t([],{isLoaded:!1,error:Nt})}onActiveMatchingSurveysChanged(t){return this.surveys?this.surveys.onActiveMatchingSurveysChanged(t):(t([],{isLoaded:!1,error:Nt}),()=>{})}renderSurvey(t,i){var s;(s=this.surveys)===null||s===void 0||s.renderSurvey(t,i)}displaySurvey(t,i=nf){var s;(s=this.surveys)===null||s===void 0||s.displaySurvey(t,i)}cancelPendingSurvey(t){var i;(i=this.surveys)===null||i===void 0||i.cancelPendingSurvey(t)}canRenderSurvey(t){var i,s;return(i=(s=this.surveys)===null||s===void 0?void 0:s.canRenderSurvey(t))!==null&&i!==void 0?i:{visible:!1,disabledReason:Nt}}canRenderSurveyAsync(t,i=!1){var s,n;return(s=(n=this.surveys)===null||n===void 0?void 0:n.canRenderSurveyAsync(t,i))!==null&&s!==void 0?s:Promise.resolve({visible:!1,disabledReason:Nt})}kc(t){return!t||yi(t)?(M.critical("Unique user id has not been set in posthog.identify"),!1):t==="$posthog_cookieless"?(M.critical(`The string "${t}" was set in posthog.identify which indicates an error. This ID is only used as a sentinel value.`),!1):!["distinct_id","distinctid"].includes(t.toLowerCase())&&!["undefined","null"].includes(t.toLowerCase())||(M.critical(`The string "${t}" was set in posthog.identify which indicates an error. This ID should be unique to the user and not a hardcoded string.`),!1)}identify(t,i,s){if(!this.__loaded||!this.persistence)return M.uninitializedWarning("posthog.identify");if(oe(t)&&(t=t.toString(),M.warn("The first argument to posthog.identify was a number, but it should be a string. It has been converted to a string.")),!this.kc(t)||!this._c("posthog.identify"))return;this.ku();let n=this.get_distinct_id(),r=this.persistence.syncCookieProperties()&&this.get_distinct_id()!==n,o=this.mc(!1),a=this.persistence.Oa(),l=!1;try{let u=this.get_distinct_id();this.register({$user_id:t}),this.get_property("$device_id")||this.register_once({$had_persisted_distinct_id:!0,$device_id:u},""),t!==u&&t!==this.get_property("__alias")&&(this.unregister(_s),this.register({distinct_id:t}));let d=(this.persistence.get_property("$user_state")||"anonymous")===it,h=t!==u,p=!h&&d;if(h&&d){var c;let v=this.config.reuseAnonymousId?{distinct_id:t}:{distinct_id:t,$anon_distinct_id:u};this.persistence.set_property(ke,ns),this.setPersonPropertiesForFlags({$set:i||{},$set_once:s||{}},!1),this.config.cookieWinsOnConflict&&this.persistence.Da(),this.capture("$identify",v,{$set:i||{},$set_once:s||{}})&&(this.Lu=fn(t,i,s)),(c=this.featureFlags)===null||c===void 0||c.setAnonymousDistinctId(this.config.reuseAnonymousId?void 0:u)}else if(p){this.persistence.set_property(ke,ns);let v=i||{},_=s||{};this.setPersonPropertiesForFlags({$set:v,$set_once:_},!1),this.config.cookieWinsOnConflict&&this.persistence.Da(),this.capture("$set",{$set:v,$set_once:_})&&(this.Lu=fn(t,i,s))}else(i||s)&&this.setPersonProperties(i,s);h||r||o?(this.reloadFeatureFlags(),this.featureFlags?this.featureFlags.resetFlagCallReported():this.unregister(gt)):p&&(i||s)&&this.reloadFeatureFlags(),l=!0}finally{a&&this.persistence.qa(l)}}setPersonProperties(t,i){if(!t&&!i||!this._c("posthog.setPersonProperties"))return;let s=fn(this.get_distinct_id(),t,i);this.Lu!==s?(this.setPersonPropertiesForFlags({$set:t||{},$set_once:i||{}},!0),this.capture("$set",{$set:t||{},$set_once:i||{}})&&(this.Lu=s)):M.info("A duplicate setPersonProperties call was made with the same properties. It has been ignored.")}unsetPersonProperties(t){var i;let s=(R(t)?t:[t]).filter(n=>H(n)&&n.length>0);s.length!==0&&this._c("posthog.unsetPersonProperties")&&((i=this.featureFlags)===null||i===void 0||i.unsetPersonPropertiesForFlags(s,!0),this.capture("$set",{$unset:s}),this.Lu=null)}group(t,i,s){var n;if(!t||!i)return void M.error("posthog.group requires a group type and group key");(n=this.persistence)===null||n===void 0||n.syncCookieProperties(),this.mc();let r=this.getGroups(),o=r[t]!==i;if(o&&this.resetGroupPropertiesForFlags(t),this.register({$groups:f(f({},r),{},{[t]:i})}),(o||s)&&this.bc()){let a={$group_type:t,$group_key:i};s&&(a.$group_set=s),this.capture(Co,a)}s&&this.setGroupPropertiesForFlags({[t]:s}),o&&!s&&this.reloadFeatureFlags()}resetGroups(){this.register({$groups:{}}),this.resetGroupPropertiesForFlags(),this.reloadFeatureFlags()}setPersonPropertiesForFlags(t,i=!0){var s;(s=this.featureFlags)===null||s===void 0||s.setPersonPropertiesForFlags(t,i)}resetPersonPropertiesForFlags(t=!0){var i;(i=this.featureFlags)===null||i===void 0||i.resetPersonPropertiesForFlags(t)}setGroupPropertiesForFlags(t,i=!0){var s;this._c("posthog.setGroupPropertiesForFlags")&&((s=this.featureFlags)===null||s===void 0||s.setGroupPropertiesForFlags(t,i))}resetGroupPropertiesForFlags(t){var i;(i=this.featureFlags)===null||i===void 0||i.resetGroupPropertiesForFlags(t)}reset(t){let i=Se(t)?t:t==null?void 0:t.resetDeviceID,s=Se(t)||t==null?void 0:t.bootstrap;this.Sc(i,!1,s)}Sc(t,i=!1,s){var n,r,o,a,l,c;if(M.info("reset"),!this.__loaded)return M.uninitializedWarning("posthog.reset");let u=s==null?void 0:s.sessionID;this.config.bootstrap=s||((n=this.qu)===null||n===void 0?void 0:n.bootstrap)||{},(r=this.featureFlags)===null||r===void 0||(o=r.updateConfig)===null||o===void 0||o.call(r,this.config,this.il());let d=this.get_property(ur),h=this.get_property(Xs),p=this.get_property(ki);(a=this.sessionRecording)===null||a===void 0||a.flushBeforeIdentityReset();let v=this.is_capturing();i||this.consent.reset(),i||!v||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.");let _=(l=this.persistence)===null||l===void 0||(c=l.Oa)===null||c===void 0?void 0:c.call(l),g=this.Su;this.Su=g||i;let y=!1;try{var m,w,P,$,k,T,S,I,A,N,L,V,C;if((m=this.persistence)===null||m===void 0||m.clear(),(w=this.sessionPersistence)===null||w===void 0||w.clear(),this.Eu.clear(),this.yc(),x(p)||(N=this.persistence)===null||N===void 0||N.register({$session_recording_remote_config:p}),(P=this.surveys)===null||P===void 0||P.reset(),($=this.featureFlags)===null||$===void 0||$.reset(),(k=this.conversations)===null||k===void 0||k.reset(),(T=this.logs)===null||T===void 0||T.reset(),(S=this.metrics)===null||S===void 0||S.reset(),(I=this.persistence)===null||I===void 0||I.set_property("$user_state","anonymous"),(A=this.sessionManager)===null||A===void 0||A.resetSessionId(),this.Lu=null,this.config.cookieless_mode==="always")this.register_once({distinct_id:Js,$device_id:null},"");else{let Y=this.config.get_device_id(Be());this.register_once({distinct_id:Y,$device_id:t?Y:d},""),t||x(h)||this.register({[Xs]:h})}if(this.register({$last_posthog_reset:new Date().toISOString()},1),s&&(s.distinctID&&!this.yu()&&((C=this.persistence)===null||C===void 0||C.set_property("$user_state",s.isIdentifiedID?"identified":"anonymous"),this.register({distinct_id:s.distinctID})),(L=this.featureFlags)===null||L===void 0||L.initialize(),!D(u)&&!(!((V=this.sessionManager)===null||V===void 0)&&V.setBootstrapSessionId(u,!0)))){let Y=f({},s);delete Y.sessionID,this.config.bootstrap=Y}delete this.config.identity_distinct_id,delete this.config.identity_hash,delete this.config.identity_claims,y=!0}finally{var B,W;this.Su=g,_&&((B=this.persistence)===null||B===void 0||(W=B.qa)===null||W===void 0||W.call(B,y))}this.reloadFeatureFlags()}shutdown(t){var i=this;return ee(function*(){var s,n,r,o,a,l,c,u;if(i.__loaded){i.Iu=!0,i.Ju().dispose(),(s=i.sessionRecording)===null||s===void 0||s.dispose(),(n=i.logs)===null||n===void 0||n.flushLogs("sendBeacon"),(r=i.metrics)===null||r===void 0||r.flush("sendBeacon"),(o=i.metrics)===null||o===void 0||o.dispose(),(a=i.Bu)===null||a===void 0||a.unload(),(l=i.Hu)===null||l===void 0||l.unload();try{var d;(d=i.featureFlags)===null||d===void 0||d.destroy()}catch(h){M.error("Error while destroying feature flags",h)}(c=i.persistence)===null||c===void 0||c.destroy(),(u=i.sessionPersistence)===null||u===void 0||u.destroy()}else M.uninitializedWarning("posthog.shutdown")})()}setIdentity(t,i){var s;delete this.config.identity_claims,this.config.identity_distinct_id=t,this.config.identity_hash=i,this.alias(t),(s=this.conversations)===null||s===void 0||s.xc()}clearIdentity(){var t;delete this.config.identity_distinct_id,delete this.config.identity_hash,delete this.config.identity_claims,(t=this.conversations)===null||t===void 0||t.$c()}get_distinct_id(){return this.get_property("distinct_id")}getGroups(){return this.get_property("$groups")||{}}get_session_id(){var t,i;return(t=(i=this.sessionManager)===null||i===void 0?void 0:i.checkAndGetSessionAndWindowId(!0).sessionId)!==null&&t!==void 0?t:""}get_session_replay_url(t){if(!this.sessionManager)return"";let{sessionId:i,sessionStartTimestamp:s}=this.sessionManager.checkAndGetSessionAndWindowId(!0),n=this.requestRouter.endpointFor("ui",`/project/${this.config.token}/replay/${i}`);if(t!=null&&t.withTimestamp&&s){var r;let o=(r=t.timestampLookBack)!==null&&r!==void 0?r:10;if(!s)return n;n+=`?t=${Math.max(Math.floor((new Date().getTime()-s)/1e3)-o,0)}`}return n}alias(t,i){return t===this.get_property("$people_distinct_id")?(M.critical("Attempting to create alias for existing People user - aborting."),-2):this._c("posthog.alias")?(x(i)&&(i=this.get_distinct_id()),t!==i?(this.wc(_s,t),this.capture("$create_alias",{alias:t,distinct_id:i})):(M.warn("alias matches current distinct_id - skipping api call."),this.identify(t),-1)):void 0}set_config(t){let i=f({},this.config);if(j(t)){var s,n,r,o,a,l,c,u,d,h,p,v,_,g;Q(this.config,fa(t));let $=this.Cu();if(this.persistence){let T=this.config.persistence==="sessionStorage"||this.config.persistence==="memory";var y,m;if(T&&this.sessionPersistence!==this.persistence&&((y=this.sessionPersistence)===null||y===void 0||y.remove(),(m=this.sessionPersistence)===null||m===void 0||m.destroy()),this.persistence.update_config(this.config,i,$),T)this.sessionPersistence=this.persistence;else if(this.sessionPersistence===this.persistence)this.sessionPersistence=new an(f(f({},this.config),{},{persistence:"sessionStorage"}),$,!1);else{var w;(w=this.sessionPersistence)===null||w===void 0||w.update_config(f(f({},this.config),{},{persistence:"sessionStorage"}),f(f({},i),{},{persistence:"sessionStorage"}),$)}}let k=this.Nu(this.config.debug);var P;Se(k)&&(this.config.debug=k),Se(this.config.debug)&&(this.config.debug?(ue.DEBUG=!0,U.At()&&U.$t("ph_debug",!0),M.info("set_config",{config:t,oldConfig:i,newConfig:f({},this.config)})):(ue.DEBUG=!1,U.At()&&U.Pt("ph_debug"))),(s=this.featureFlags)===null||s===void 0||(n=s.updateConfig)===null||n===void 0||n.call(s,this.config,this.il()),(r=this.exceptionObserver)===null||r===void 0||r.onConfigChange(),(o=this.exceptions)===null||o===void 0||o.onConfigChange(),(a=this.metrics)===null||a===void 0||a.onConfigChange(),(l=this.webMCP)===null||l===void 0||l.startIfEnabled(),(c=this.sessionRecording)===null||c===void 0||c.startIfEnabledOrStop(),(u=this.tracingHeaders)===null||u===void 0||u.startIfEnabledOrStop(),(d=this.autocapture)===null||d===void 0||d.startIfEnabled(),(h=this.heatmaps)===null||h===void 0||h.startIfEnabled(),("capture_pageview"in t||"disable_capture_url_hashes"in t)&&((P=this.historyAutocapture)===null||P===void 0||P.startIfEnabledOrStop()),(p=this.exceptionObserver)===null||p===void 0||p.startIfEnabledOrStop(),(v=this.deadClicksAutocapture)===null||v===void 0||v.startIfEnabledOrStop(),(_=this.surveys)===null||_===void 0||_.loadIfEnabled(),this.xu(),(g=this.externalIntegrations)===null||g===void 0||g.startIfEnabledOrStop(),!i.segment&&this.config.segment&&this.persistence&&Zo(this,Mi,!1)}}_overrideSDKInfo(t,i){ue.LIB_NAME=t,ue.LIB_VERSION=i}startSessionRecording(t){let i=t===!0,s={sampling:i||!!(t!=null&&t.sampling),linked_flag:i||!!(t!=null&&t.linked_flag),url_trigger:i||!!(t!=null&&t.url_trigger),event_trigger:i||!!(t!=null&&t.event_trigger)};var n,r,o,a,l;Object.values(s).some(Boolean)&&((n=this.sessionManager)===null||n===void 0||n.checkAndGetSessionAndWindowId(),s.sampling&&((r=this.sessionRecording)===null||r===void 0||r.overrideSampling()),s.linked_flag&&((o=this.sessionRecording)===null||o===void 0||o.overrideLinkedFlag()),s.url_trigger&&((a=this.sessionRecording)===null||a===void 0||a.overrideTrigger("url")),s.event_trigger&&((l=this.sessionRecording)===null||l===void 0||l.overrideTrigger("event"))),this.set_config({disable_session_recording:!1})}stopSessionRecording(){this.set_config({disable_session_recording:!0})}sessionRecordingStarted(){var t;return!!(!((t=this.sessionRecording)===null||t===void 0)&&t.started)}captureException(t,i){try{if(!this.exceptions)return;let s=this.exceptions.buildProperties(t,{handled:!0,syntheticException:new Error("PostHog syntheticException")});return this.exceptions.sendExceptionEvent(f(f({},s),i))}catch{return}}addExceptionStep(t,i){var s;(s=this.exceptions)===null||s===void 0||s.addExceptionStep(t,i)}captureLog(t){var i;(i=this.logs)===null||i===void 0||i.captureLog(t)}get logger(){var t,i;return(t=(i=this.logs)===null||i===void 0?void 0:i.logger)!==null&&t!==void 0?t:pt.Cc}startExceptionAutocapture(t){this.set_config({capture_exceptions:t==null||t})}stopExceptionAutocapture(){this.set_config({capture_exceptions:!1})}loadToolbar(t){var i,s;return(i=(s=this.toolbar)===null||s===void 0?void 0:s.loadToolbar(t))!==null&&i!==void 0&&i}get_property(t){var i;return(i=this.persistence)===null||i===void 0?void 0:i.props[t]}getSessionProperty(t){var i;return(i=this.sessionPersistence)===null||i===void 0?void 0:i.props[t]}toString(){var t;let i=(t=this.config.name)!==null&&t!==void 0?t:mi;return i!==mi&&(i="posthog."+i),i}_isIdentified(){var t,i;return((t=this.persistence)===null||t===void 0?void 0:t.get_property("$user_state"))==="identified"||((i=this.sessionPersistence)===null||i===void 0?void 0:i.get_property("$user_state"))==="identified"}bc(){var t,i;return!(this.config.person_profiles==="never"||this.config.person_profiles==="identified_only"&&!this._isIdentified()&&Me(this.getGroups())&&!(!((t=this.persistence)===null||t===void 0||(t=t.props)===null||t===void 0)&&t.__alias)&&!(!((i=this.persistence)===null||i===void 0||(i=i.props)===null||i===void 0)&&i.$epp))}rc(){return this.config.capture_pageleave===!0||this.config.capture_pageleave==="if_capture_pageview"&&!!this.config.capture_pageview}createPersonProfile(){this.bc()||this._c("posthog.createPersonProfile")&&this.setPersonProperties({},{})}setInternalOrTestUser(){this._c("posthog.setInternalOrTestUser")&&this.setPersonProperties({$internal_or_test_user:!0})}_c(t){return this.config.person_profiles==="never"?(M.error(t+' was called, but process_person is set to "never". This call will be ignored.'),!1):(this.bu(),this.wc(pr,!0),!0)}Cu(){if(this.config.cookieless_mode==="always")return!0;let t=this.consent.isOptedOut();return this.config.disable_persistence||t&&!(!this.config.opt_out_persistence_by_default&&this.config.cookieless_mode!=="on_reject")}xu(){var t,i;let s=this.Cu();var n,r,o;return this.is_capturing()||(n=this.logs)===null||n===void 0||n.Tc(),((t=this.persistence)===null||t===void 0?void 0:t.hi)!==s&&((r=this.persistence)===null||r===void 0||r.set_disabled(s)),((i=this.sessionPersistence)===null||i===void 0?void 0:i.hi)!==s&&((o=this.sessionPersistence)===null||o===void 0||o.set_disabled(s)),this.yc(),s}opt_in_capturing(t){var i;if(this.config.cookieless_mode!=="always"){if(this.yu()){var s,n,r,o,a,l;(s=this.sessionRecording)===null||s===void 0||s.dispose({discardBufferedEvents:!0}),this.Sc(!0,!0),(n=this.sessionManager)===null||n===void 0||n.destroy(),(r=this.pageViewManager)===null||r===void 0||r.destroy(),this.sessionManager=new oa(this),this.pageViewManager=new Yo(this),this.persistence&&(this.sessionPropsManager=new na(this,this.sessionManager,this.persistence));let p=(o=(a=this.config.__extensionClasses)===null||a===void 0?void 0:a.sessionRecording)!==null&&o!==void 0?o:(l=pt.__defaultExtensionClasses)===null||l===void 0?void 0:l.sessionRecording;var c,u;p&&(this.sessionRecording=this.mu(this.sessionRecording,new p(this)),this.hu&&((c=this.sessionRecording)===null||c===void 0||(u=c.onRemoteConfig)===null||u===void 0||u.call(c,this.hu)))}var d,h;this.consent.optInOut(!0),this.xu(),this.ec(),(i=this.sessionRecording)===null||i===void 0||i.startIfEnabledOrStop(),this.config.cookieless_mode=="on_reject"&&((d=this.surveys)===null||d===void 0||d.loadIfEnabled()),(x(t==null?void 0:t.captureEventName)||t!=null&&t.captureEventName)&&this.capture((h=t==null?void 0:t.captureEventName)!==null&&h!==void 0?h:"$opt_in",t==null?void 0:t.captureProperties,{send_instantly:!0}),this.config.capture_pageview&&this.nc()}else M.warn(ca)}opt_out_capturing(){this.config.cookieless_mode!=="always"?(this.consent.optInOut(!1),this.xu(),this.config.cookieless_mode==="on_reject"&&this.$u()):M.warn(ca)}$u(){var t,i;let s=this.sessionRecording;s==null||s.dispose({discardBufferedEvents:!0}),this.get_distinct_id()!=="$posthog_cookieless"&&this.Sc(!0,!0),this.register({distinct_id:Js,$device_id:null}),this.gu(s),this.sessionRecording=void 0,(t=this.sessionManager)===null||t===void 0||t.destroy(),(i=this.pageViewManager)===null||i===void 0||i.destroy(),this.sessionManager=void 0,this.sessionPropsManager=void 0,this.config.capture_pageview&&this.nc(),this.ec()}has_opted_in_capturing(){return this.consent.isOptedIn()}has_opted_out_capturing(){return this.consent.isOptedOut()}get_explicit_consent_status(){let t=this.consent.consent;return t===1?"granted":t===0?"denied":"pending"}is_capturing(){return!this.Su&&(this.config.cookieless_mode==="always"||(this.config.cookieless_mode==="on_reject"?this.consent.isRejected()||this.consent.isOptedIn():!this.has_opted_out_capturing()))}clear_opt_in_out_capturing(){this.consent.reset(),this.xu()}_is_bot(){return pe?Kc(pe,this.config.custom_blocked_useragents):void 0}nc(){E&&(E.visibilityState==="visible"?this.Fu||(this.Fu=!0,this.capture(_r,{title:E.title},{send_instantly:!0}),this.Ou&&(E.removeEventListener(Fi,this.Ou),this.Ou=null)):this.Ou||(this.Ou=this.nc.bind(this),G(E,Fi,this.Ou)))}debug(t){t===!1?(b==null||b.console.log("You've disabled debug mode."),this.set_config({debug:!1})):(b==null||b.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}))}il(){let t=this.qu||{};return"advanced_disable_flags"in t?!!t.advanced_disable_flags:this.config.advanced_disable_flags!==!1?!!this.config.advanced_disable_flags:this.config.advanced_disable_decide===!0?(M.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):(function(i,s,n,r,o){let a=s in i&&!D(i[s]),l=n in i&&!D(i[n]);return a?i[s]:!!l&&(o&&o.warn(`Config field '${n}' is deprecated. Please use '${s}' instead. The old field will be removed in a future major version.`),i[n])})(t,"advanced_disable_flags","advanced_disable_decide",0,M)}Os(t){var i;if(D(this.config.before_send))return t;let s=Object.keys((i=t.properties)!==null&&i!==void 0?i:{}).filter(hd),n=R(this.config.before_send)?this.config.before_send:[this.config.before_send],r=t;for(let o of n)try{if(r=o(r),D(r)){let a=`Event '${t.event}' was rejected in beforeSend function`;return dd(t.event)?M.warn(`${a}. This can cause unexpected behavior.`):M.info(a),null}r.properties&&!Me(r.properties)||M.warn(`Event '${t.event}' has no properties after beforeSend function, this is likely an error.`)}catch(a){return M.error(`Error in beforeSend function for event '${t.event}':`,a),null}for(let o of s)if(r.properties&&D(r.properties[o]))return M.warn(`Event '${t.event}' had its '${o}' property removed in a beforeSend function. This property is required for ingestion, so the event will be dropped.`),null;return r}getPageViewId(){var t;return(t=this.pageViewManager.Wo)===null||t===void 0?void 0:t.pageViewId}captureTraceFeedback(t,i){this.capture("$ai_feedback",{$ai_trace_id:String(t),$ai_feedback_text:i})}captureTraceMetric(t,i,s){this.capture("$ai_metric",{$ai_trace_id:String(t),$ai_metric_name:i,$ai_metric_value:String(s)})}Nu(t){let i=Se(t)&&!t,s=U.At()&&U.Ot("ph_debug")==="true";return!i&&(!!s||t)}};Ti.__defaultExtensionClasses={},Ti.Cc=(()=>{let e=()=>{};return{trace:e,debug:e,info:e,warn:e,error:e,fatal:e}})(),(function(e,t){for(let i=0;t.length>i;i++)e.prototype[t[i]]=op(e.prototype[t[i]])})(Ti,["identify"]);var ru=class{constructor(e){this.disabled=e===!1;let t=j(e)?e:{};this.thresholdPx=t.threshold_px||30,this.timeoutMs=t.timeout_ms||1e3,this.clickCount=t.click_count||3,this.clicks=[]}isRageClick(e,t,i){if(this.disabled)return!1;let s=this.clicks[this.clicks.length-1];if(s&&Math.abs(e-s.x)+Math.abs(t-s.y)<this.thresholdPx&&this.timeoutMs>i-s.timestamp){if(this.clicks.push({x:e,y:t,timestamp:i}),this.clicks.length===this.clickCount)return!0}else this.clicks=[{x:e,y:t,timestamp:i}];return!1}},_n="$copy_autocapture",mn=re("[AutoCapture]");function yn(e,t){return t.length>e?t.slice(0,e)+"...":t}function mf(e){if(e.previousElementSibling)return e.previousElementSibling;let t=e;do t=t.previousSibling;while(t&&!We(t));return t}function yf(e,{e:t,maskAllElementAttributes:i,maskAllText:s,elementAttributeIgnoreList:n,elementsChainAsString:r,disableCaptureUrlHashes:o}){var a,l;if(!We(e))return{props:{}};let c=[e],u=new Set([e]),d=e;for(;d.parentNode&&!_e(d,"body")&&1e3>c.length;){if(yr(d.parentNode)){let k=d.parentNode.host;if(u.has(k))break;u.add(k),c.push(k),d=k;continue}if(!We(d.parentNode)||u.has(d.parentNode))break;u.add(d.parentNode),c.push(d.parentNode),d=d.parentNode}let h=t.type==="click"&&e.namespaceURI==="http://www.w3.org/2000/svg"?c.findIndex(k=>_e(k,"button")||_e(k,"a")):-1;h>0&&(s=s||c.slice(0,h+1).some(k=>!Ct(k)||Jt(k)));let p=[],v={},_,g=!1,y=!1;if(Z(c,k=>{let T=Ct(k);if(_e(k,"a")&&!i&&!(n!=null&&n.includes("href"))){let S=k.getAttribute("href");g=!!(T&&S&&qt(S))&&(o?yt(S):S)}O(Xt(k),"ph-no-capture")&&(y=!0),p.push((function(S,I,A,N,L=!1){let V=S.tagName.toLowerCase(),C={tag_name:V};wr.indexOf(V)>-1&&!A&&(C.$el_text=V.toLowerCase()==="a"||V.toLowerCase()==="button"?yn(1024,zo(S)):yn(1024,Oi(S)));let B=Xt(S);I||N!=null&&N.includes("class")||0>=B.length||(C.classes=B.filter(function(ie){return ie!==""})),Z(S.attributes,function(ie){var ge;if((!Jt(S)||["name","id","class","aria-label"].indexOf(ie.name)!==-1)&&!(N!=null&&N.includes(ie.name))&&!I&&qt(ie.value)&&(!H(ge=ie.name)||ge.substring(0,10)!=="_ngcontent"&&ge.substring(0,7)!=="_nghost")){let de=ie.value;ie.name==="class"&&(de=br(de).join(" ")),C["attr__"+ie.name]=yn(1024,ie.name==="href"&&L?yt(de):de)}});let W=1,Y=1,z=S;for(;z=mf(z);)W++,z.tagName===S.tagName&&Y++;return C.nth_child=W,C.nth_of_type=Y,C})(k,i,s,n,o)),Z((function(S){if(!Ct(S))return{};let I={};return Z(S.attributes,function(A){if(A.name&&A.name.indexOf("data-ph-capture-attribute")===0){let N=A.name.replace("data-ph-capture-attribute-",""),L=A.value;N&&L&&qt(L)&&(I[N]=L)}}),I})(k),(S,I)=>{({}).hasOwnProperty.call(v,I)||(v[I]=S)})}),y)return{props:{},explicitNoCapture:y};if(h>0&&(e=c[h],p.splice(0,h)),s||(p[0].$el_text=_e(e,"a")||_e(e,"button")?zo(e):Oi(e)),g){var m,w;p[0].attr__href=g;let k=(m=nt(g))===null||m===void 0?void 0:m.host,T=b==null||(w=b.location)===null||w===void 0?void 0:w.host;k&&T&&k!==T&&(_=g)}return{props:Q(($=t.type,{$event_type:$,$ce_version:1}),r?{}:{$elements:p},{$elements_chain:(P=p,R(P)?(function(k){return k.map(T=>{var S,I;let A="";if(T.tag_name&&(A+=T.tag_name),T.attr_class){T.attr_class.sort();for(let V of T.attr_class)A+=`.${V.replace(/"/g,"")}`}let N=f(f(f(f({},T.text?{text:T.text}:{}),{},{"nth-child":(S=T.nth_child)!==null&&S!==void 0?S:0,"nth-of-type":(I=T.nth_of_type)!==null&&I!==void 0?I:0},T.href?{href:T.href}:{}),T.attr_id?{attr_id:T.attr_id}:{}),T.attributes),L={};return rs(N).sort(([V],[C])=>(function(B,W){return W>B?-1:B>W?1:0})(V,C)).forEach(([V,C])=>L[Go(V.toString())]=Go(C.toString())),A+=":",A+=rs(L).map(([V,C])=>`${V}="${C}"`).join(""),A}).join(";")})((function(k){return k.map(T=>{var S,I;let A={text:(S=T.$el_text)===null||S===void 0?void 0:S.slice(0,400),tag_name:T.tag_name,href:(I=T.attr__href)===null||I===void 0?void 0:I.slice(0,2048),attr_class:kp(T),attr_id:T.attr__id,nth_child:T.nth_child,nth_of_type:T.nth_of_type,attributes:{}};return rs(T).filter(([N])=>N.indexOf("attr__")===0).forEach(([N,L])=>A.attributes[N]=L),A})})(P)):"")},!((a=p[0])===null||a===void 0)&&a.$el_text?{$el_text:(l=p[0])===null||l===void 0?void 0:l.$el_text}:{},_&&t.type==="click"?{$external_click_url:_}:{},v),target:e};var P,$}var bf=class{do(){this.vo=void 0,clearTimeout(this.fo),this.fo=void 0}po(e){var t;if(!Ct(e))return!0;let i=(t=this.mo().css_selector_ignorelist)!==null&&t!==void 0?t:nn,s=new Set,n=e;for(;n;){if(s.size>=1e3||s.has(n))return!0;s.add(n);let r=n,o=Xt(r);if(O(o,"ph-no-capture")||O(o,"ph-sensitive")||Jt(r)||i.some(l=>qn(r,l)))return!0;let a=n.parentNode;n=yr(a)?a.host:a&&We(a)?a:null}return!1}yo(e){if(!this.isEnabled||e.type==="pointercancel")return void this.do();if(e.type==="pointerdown"){this.do();let s=Ei(e);var t;return void(e.isPrimary&&e.button===0&&!e.ctrlKey&&s&&We(s)&&(this.vo={target:s,excluded:this.po(s),id:e.pointerId,x:e.clientX,y:e.clientY,released:!1,distinctId:(t=this.bo)===null||t===void 0?void 0:t.distinctId}))}let i=this.vo;i&&(e.pointerId!==i.id||Math.abs(e.clientX-i.x)>5||Math.abs(e.clientY-i.y)>5?this.do():e.type==="pointerup"&&(i.released=!0,this.fo=setTimeout(()=>this.do(),0)))}_o(e){var t;let i=this.vo;this.do();let s=Ei(e);if(i!=null&&i.released&&i.target.isConnected&&i.distinctId===((t=this.bo)===null||t===void 0?void 0:t.distinctId)&&e.pointerId===i.id&&(e.detail>0||e.pointerType==="touch"||e.pointerType==="pen")&&e.button===0&&5>=Math.abs(e.clientX-i.x)&&5>=Math.abs(e.clientY-i.y)&&s&&(_e(s,"html")||_e(s,"body"))){var n;if(i.excluded)return null;let r=(n=this.mo().css_selector_ignorelist)!==null&&n!==void 0?n:nn;return[s,E==null?void 0:E.documentElement,E==null?void 0:E.body].some(o=>{if(!o)return!1;let a=Xt(o);return O(a,"ph-no-capture")||O(a,"ph-sensitive")||!Ct(o)||Jt(o)||r.some(l=>qn(o,l))})?null:i.target}}constructor(e){this.wo=e,this.name="autocapture",this.ko=!1,this.So=null,this.xo=!1,this.$o=new Map,this.Co=!1,this.Mr={enabled:!1,rageclick:!1,maskAllElementAttributes:!1,maskAllText:!1,disableCaptureUrlHashes:!1,remoteRequestsDisabled:!1},this.To=!1,this.wo.refresh(this.Mr),this.rageclicks=new ru(this.Mr.rageclick),this.Io=null}setup(e){this.Mo(),this.bo=e;let t=e.onRemoteConfig(this.onRemoteConfig.bind(this));this.To?t.dispose():(this.Eo=t,this.startIfEnabled())}dispose(){var e;this.To||(this.To=!0,this.bo=void 0,(e=this.Eo)===null||e===void 0||e.dispose(),this.Eo=void 0,this.$o.clear(),this.Io=null,this.Po())}mo(){return this.wo.refresh(this.Mr),this.Mr}Mo(){var e,t;return this.mo(),this.Mr.url_allowlist=(e=this.Mr.url_allowlist)===null||e===void 0?void 0:e.map(i=>new RegExp(i)),this.Mr.url_ignorelist=(t=this.Mr.url_ignorelist)===null||t===void 0?void 0:t.map(i=>new RegExp(i)),this.Mr}Ro(){if(!this.isBrowserSupported())return void mn.info("Disabling Automatic Event Collection because this browser is not supported");if(!b||!E)return;let e=this.Ao=t=>{t=t||(b==null?void 0:b.event);try{if(t.type==="blur")return void this.do();if(t.type.indexOf("pointer")===0)return void this.yo(t);let i=t.type==="click"?this._o(t):void 0;if(ne(i))return;this.Fo(t,"$autocapture",i)}catch(i){mn.error("Failed to capture event",i)}};if(G(b,"blur",e),G(E,"submit",e,{capture:!0}),G(E,"change",e,{capture:!0}),G(E,"click",e,{capture:!0}),Z(["pointerdown","pointermove","pointerup","pointercancel"],t=>{G(E,t,e,{capture:!0})}),this.mo().capture_copied_text){let t=this.Oo=i=>{i=i||(b==null?void 0:b.event);try{this.Fo(i,_n)}catch(s){mn.error("Failed to capture clipboard event",s)}};G(E,"copy",t,{capture:!0}),G(E,"cut",t,{capture:!0}),G(E,"paste",t,{capture:!0})}}Po(){this.do(),this.Ao&&(b==null||b.removeEventListener("blur",this.Ao),Z(["pointerdown","pointermove","pointerup","pointercancel"],e=>{E==null||E.removeEventListener(e,this.Ao,!0)}),E==null||E.removeEventListener("submit",this.Ao,!0),E==null||E.removeEventListener("change",this.Ao,!0),E==null||E.removeEventListener("click",this.Ao,!0),this.Ao=void 0),this.Oo&&(E==null||E.removeEventListener("copy",this.Oo,!0),E==null||E.removeEventListener("cut",this.Oo,!0),E==null||E.removeEventListener("paste",this.Oo,!0),this.Oo=void 0),this.ko=!1}startIfEnabled(){this.isEnabled||this.do(),!this.To&&this.bo&&this.isEnabled&&!this.ko&&(this.Ro(),this.ko=!0)}onRemoteConfig(e){if(this.To)return;if(this.xo=!0,!e.ok)return void this.startIfEnabled();let t=e.config;t.elementsChainAsString&&(this.Co=t.elementsChainAsString);let i=t.autocapture_opt_out;var s;Se(i)&&((s=this.bo)===null||s===void 0||s.kv.set("$autocapture_disabled_server_side",i),this.So=i),this.startIfEnabled()}setElementSelectors(e,t=this){if(this.To)return;e.size?this.$o.set(t,new Set(e)):this.$o.delete(t);let i=new Set;this.$o.forEach(s=>{s.forEach(n=>i.add(n))}),this.Io=i}getElementSelectors(e,t){var i;let s=[];return(i=this.Io)===null||i===void 0||i.forEach(n=>{let r=E==null?void 0:E.querySelectorAll(n);r==null||r.forEach(o=>{e!==o&&t!==o||O(s,n)||s.push(n)})}),s}get isEnabled(){var e,t;if(this.To)return!1;let i=(e=this.bo)===null||e===void 0?void 0:e.kv.get(Bl),s=this.So,n=this.mo();if(!n.remoteRequestsDisabled&&!this.xo)return!1;let r=n.remoteRequestsDisabled&&!this.xo;if(ne(s)&&!Se(i)&&!r)return!1;let o=(t=this.So)!==null&&t!==void 0?t:!!i;return!!n.enabled&&!o}Fo(e,t="$autocapture",i){if(!this.isEnabled)return void this.do();let s=i||Ei(e);vc(s)&&(s=s.parentNode||null);let n=this.Mo();var r;t==="$autocapture"&&e.type==="click"&&e instanceof MouseEvent&&n.rageclick&&(!((r=this.rageclicks)===null||r===void 0)&&r.isRageClick(e.clientX,e.clientY,e.timeStamp||new Date().getTime()))&&yc(s,n.rageclick)&&this.Fo(e,"$rageclick",i);let o=t===_n,a=o?f(f({},n),{},{dom_event_allowlist:void 0}):n;if(s&&(function(d,h,p,v,_,g){var y;if(!b||kr(d)||p!=null&&p.url_allowlist&&!Do(p.url_allowlist,g)||p!=null&&p.url_ignorelist&&Do(p.url_ignorelist,g))return!1;if(p!=null&&p.dom_event_allowlist){let $=p.dom_event_allowlist;if($&&!$.some(k=>h.type===k))return!1}let{parentIsUsefulElement:m,targetElementList:w}=bc(d,v);if(!(function($,k){let T=k==null?void 0:k.element_allowlist;if(x(T))return!0;for(let S of $)if(T.some(I=>S.tagName.toLowerCase()===I))return!0;return!1})(w,p)||!Zn(w,p==null?void 0:p.css_selector_allowlist)||Zn(w,(y=p==null?void 0:p.css_selector_ignorelist)!==null&&y!==void 0?y:nn))return!1;try{let $=b.getComputedStyle(d);if($&&$.getPropertyValue("cursor")==="pointer"&&h.type==="click")return!0}catch{}let P=d.tagName.toLowerCase();switch(P){case"html":return!1;case"form":return(_||["submit"]).indexOf(h.type)>=0;case"input":case"select":case"textarea":return(_||["change","click"]).indexOf(h.type)>=0;default:return m?(_||["click"]).indexOf(h.type)>=0:(_||["click"]).indexOf(h.type)>=0&&(wr.indexOf(P)>-1||d.getAttribute("contenteditable")==="true")}})(s,e,a,o,o?["copy","cut","paste"]:void 0,{config:{get_current_url:n.getCurrentUrl}})){var l;let{props:d,explicitNoCapture:h,target:p}=yf(s,{e,maskAllElementAttributes:n.maskAllElementAttributes,maskAllText:n.maskAllText,elementAttributeIgnoreList:n.element_attribute_ignorelist,elementsChainAsString:this.Co,disableCaptureUrlHashes:n.disableCaptureUrlHashes});if(h)return!1;let v=this.getElementSelectors(s,p);if(v&&v.length>0&&(d.$element_selectors=v),t===_n){let _=e.type||"clipboard";if(_!=="paste"){var c,u;let g=b==null||(c=b.getSelection())===null||c===void 0?void 0:c.toString(),y=gc(g);if(!y)return!1;d.$selected_content=y,d.$clipboard_text_length=(u=g==null?void 0:g.length)!==null&&u!==void 0?u:0}d.$copy_type=_}return(l=this.bo)===null||l===void 0||l.capture(t,d),!0}}isBrowserSupported(){return le(E==null?void 0:E.querySelectorAll)}},wf=class{constructor(e){this._instance=e}refresh(e){let t=this._instance.config,i=j(t.autocapture)?t.autocapture:void 0;e.enabled=!!t.autocapture,e.rageclick=t.rageclick,e.maskAllElementAttributes=t.mask_all_element_attributes,e.maskAllText=t.mask_all_text,e.disableCaptureUrlHashes=t.disable_capture_url_hashes,e.getCurrentUrl=t.get_current_url,e.remoteRequestsDisabled=this._instance.il(),e.url_allowlist=i==null?void 0:i.url_allowlist,e.url_ignorelist=i==null?void 0:i.url_ignorelist,e.dom_event_allowlist=i==null?void 0:i.dom_event_allowlist,e.element_allowlist=i==null?void 0:i.element_allowlist,e.css_selector_allowlist=i==null?void 0:i.css_selector_allowlist,e.css_selector_ignorelist=i==null?void 0:i.css_selector_ignorelist,e.element_attribute_ignorelist=i==null?void 0:i.element_attribute_ignorelist,e.capture_copied_text=i==null?void 0:i.capture_copied_text}},vi=re("[ExceptionAutocapture]"),va=()=>{},ga=e=>{var t;if(le(e))return(t=e.__posthog_layer__)!==null&&t!==void 0?t:e.__rrweb_layer__};function ti(e,t,i){try{if(!(t in e))return va;let s={next:e[t]},n=i(function(...r){return s.next.apply(this,r)});return le(n)&&(n.prototype=n.prototype||{},Object.defineProperties(n,{__posthog_wrapped__:{enumerable:!1,value:!0},__posthog_layer__:{enumerable:!1,value:s}})),e[t]=n,()=>{if(e[t]===n)return void(e[t]=s.next);let r=e[t],o=ga(r);for(;o;){if(o.next===n)return void(o.next=s.next);r=o.next,o=ga(r)}}}catch{return va}}var xf=re("[TracingHeaders]"),St=re("[Web Vitals]"),_a=9e5,ma=["CLS","FCP","INP","LCP"],kf=["INP","LCP"],Sf=["interactionTarget","interactionType","inputDelay","processingDuration","presentationDelay","loadState","target","url","timeToFirstByte","resourceLoadDelay","resourceLoadDuration","elementRenderDelay","largestShiftTarget","largestShiftTime","largestShiftValue","firstByteToFCP"],bn="disabled",ya="lazy_loading",Ke=re("[SessionRecording]"),Ef=[fr,vr,ic,sc,nc,rc,oc,ac,lc],$f=re("[Heatmaps]");function wn(e){return j(e)&&"clientX"in e&&"clientY"in e&&oe(e.clientX)&&oe(e.clientY)}var Qi=re("[Product Tours]"),xn=e=>{var t;return!e.config.disable_product_tours&&!!(!((t=e.persistence)===null||t===void 0)&&t.get_property(hr))},Pf=["$set_once","$set"],qe=re("[SiteApps]"),ba="Error while initializing PostHog app with config id ",ou=(e,t)=>e!=null&&e.then?e.then(t):t(e),jt="SDK is not enabled or survey functionality is not yet loaded",wa="Disabled. Not loading surveys.",Mf=class{constructor(e,t){this.wo=e,this.Ic=t,this.name="surveys",this._surveyEventReceiver=null,this._surveyManager=null,this.Mc=!1,this.Ec=!1,this.Pc=[],this.Rc=[],this.Ac=null,this.Fc=null,this.To=!1,this.Oc=new Set,this.onRemoteConfig=i=>{if(this.To||this.Mr.disableSurveys)return;if(!i.ok)return this.Ec=!0,this.Dc({isLoaded:!1,error:"Remote config unavailable. Not loading surveys."}),q.warn("Remote config unavailable. Not loading surveys.");let s=i.config.surveys;if(D(s))return q.warn("Flags not loaded yet. Not loading surveys.");this.Lc=Se(s)?s:s.length>0,q.info(`flags response received, isSurveysEnabled: ${this.Lc}`),this.loadIfEnabled()},this.Dc=i=>{this.Rc.slice().forEach(s=>this.Nc(s,i))}}setup(e){if(!this.To)return this.qc=e,ou(e.kv.initialize(),()=>{if(this.qc!==e||this.To)return;this.qc=void 0,this.bo=e;let t=e.onRemoteConfig(this.onRemoteConfig);this.To?t.dispose():(this.Eo=t,this.loadIfEnabled())})}dispose(){var e,t,i,s,n;this.To||(this.To=!0,this.qc=void 0,this.bo=void 0,(e=this.Eo)===null||e===void 0||e.dispose(),this.Eo=void 0,(t=this._surveyEventReceiver)===null||t===void 0||t.dispose(),this._surveyEventReceiver=null,(i=this._surveyManager)===null||i===void 0||(s=i.dispose)===null||s===void 0||s.call(i),this._surveyManager=null,this.Pc=[],this.Rc.forEach(r=>{r.active=!1}),this.Rc=[],(n=this.jc)===null||n===void 0||n.call(this),this.jc=void 0,this.Ac=null,this.Oc.forEach(r=>clearTimeout(r)),this.Oc.clear())}get Mr(){return this.wo.get()}initialize(){this.loadIfEnabled()}reset(){var e,t;(e=this._surveyManager)===null||e===void 0||(t=e.clearInMemoryInProgressSurveyState)===null||t===void 0||t.call(e);try{var i;(i=this._surveyEventReceiver)===null||i===void 0||i.reset(),localStorage.removeItem("lastSeenSurveyDate");let s=[];for(let n=0;n<localStorage.length;n++){let r=localStorage.key(n);(r!=null&&r.startsWith("seenSurvey_")||r!=null&&r.startsWith("inProgressSurvey_"))&&s.push(r)}s.forEach(n=>localStorage.removeItem(n))}catch{}this.Dc()}loadIfEnabled(){if(this.To||!this.bo)return;let e=this.Mr;if(this._surveyManager)return;if(this.Mc)return void q.info("Already initializing surveys, skipping...");if(e.disableSurveys)return void q.info(wa);if(e.cookielessMode&&this.wo.isOptedOut())return void q.info("Not loading surveys in cookieless mode without consent.");let t=this.wo.getExtensions();if(!t)return void this.Bc("PostHog Extensions not found.");if(x(this.Lc)&&!e.advancedEnableSurveys)return;let i=this.Lc||e.advancedEnableSurveys;this.Mc=!0,this.Ec=!1;try{let s=t.generateSurveys;if(s)return this.zc(s,i),void(this.Mc=!1);let n=t.loadExternalDependency;if(!n)return this.Bc(gr),void(this.Mc=!1);n(r=>{try{if(this.To)return;let o=this.wo.getExtensions();r||!(o!=null&&o.generateSurveys)?this.Bc("Could not load surveys script",r):this.zc(o.generateSurveys,i)}finally{this.Mc=!1}})}catch(s){throw this.Mc=!1,this.Bc("Error initializing surveys",s),s}}zc(e,t){var i,s;if(this.To)return;this._surveyManager=e(t),this._surveyEventReceiver=this.wo.createEventReceiver(this.Dc);let n=(i=(s=this.bo)!==null&&s!==void 0?s:this.Ic)===null||i===void 0?void 0:i.kv.get(_i);n&&this.Hc(n),q.info("Surveys loaded successfully"),this.Uc(),this.Dc(),this.Wc({isLoaded:!0})}Bc(e,t){this.Ec=!0,q.error(e,t),this.Dc({isLoaded:!1,error:e}),this.Wc({isLoaded:!1,error:e})}onSurveysLoaded(e){return this.Pc.push(e),this._surveyManager&&this.Wc({isLoaded:!0}),()=>{this.Pc=this.Pc.filter(t=>t!==e)}}getSurveys(e,t=!1){var i;let s=(i=this.bo)!==null&&i!==void 0?i:this.Ic;if(!s||this.To)return;if(this.Mr.disableSurveys)return q.info(wa),e([]);let n=s.kv.get(_i);if(n&&!t)return e(n,{isLoaded:!0}),void(this.Vc()&&this.getSurveys(()=>{},!0));if(this.Ac)return void this.Ac.then(({surveys:a,context:l})=>{this.To||e(a,l)}).catch(a=>q.error("Error in survey callback",a));let r=this.Gc("/api/surveys/",{method:"GET",query:{token:s.projectToken},sentAt:"query",timeoutMs:this.Mr.requestTimeoutMs}).then(a=>{try{return this.Qc(s,a)}catch(l){return q.error("Error processing surveys response",l),this.Qc(s,{statusCode:0,error:l})}},a=>this.Qc(s,{statusCode:0,error:a}));this.Ac=r;let o=()=>{this.Ac===r&&(this.Ac=null)};r.then(a=>{o(),this.To||(this.Dc(a.context),e(a.surveys,a.context))},o).catch(a=>q.error("Error in survey callback",a))}Gc(e,t){let i=this.bo;return i?i.sendRequest(e,t):new Promise(s=>s({statusCode:0,error:new Error(jt)}))}Qc(e,t){if(this.To)return{surveys:[],context:{isLoaded:!1,error:jt}};let i=t.statusCode;if(i!==200||!t.json){let n=`Surveys API could not be loaded, status: ${i}`;return i!==0?q.error(n):t.error||q.warn(n),this.Fc=Date.now(),{surveys:[],context:{isLoaded:!1,error:n}}}this.Fc=null;let s=t.json.surveys||[];return e.kv.set({[_i]:s,[ms]:Date.now()}),this.Hc(s),{surveys:s,context:{isLoaded:!0}}}Hc(e){var t;let i=e.filter(s=>(function(n){return!(!n.start_date||n.end_date)})(s)&&(eu(s)||(function(n){var r;return!!(!((r=n.conditions)===null||r===void 0||(r=r.actions)===null||r===void 0||(r=r.values)===null||r===void 0)&&r.length)})(s)));(t=this._surveyEventReceiver)===null||t===void 0||t.replace(i)}Vc(){return this.Zc()&&!this.Ac&&!this.Jc()}Zc(){var e,t;let i=(e=(t=this.bo)!==null&&t!==void 0?t:this.Ic)===null||e===void 0?void 0:e.kv.get(ms);return oe(i)&&Date.now()-i>3e5}Jc(){return oe(this.Fc)&&3e5>Date.now()-this.Fc}markSurveyAsSeen(e,t){var i;let s={id:e,current_iteration:(i=t==null?void 0:t.iteration)!==null&&i!==void 0?i:null};su(s);try{localStorage.setItem("lastSeenSurveyDate",new Date().toISOString())}catch{}this.Dc()}Wc(e){for(let t of this.Pc)try{if(!e.isLoaded)return t([],e);this.getSurveys(t)}catch(i){q.error("Error in survey callback",i)}}getActiveMatchingSurveys(e,t=!1){if(!D(this._surveyManager))return this._surveyManager.getActiveMatchingSurveys(e,t);q.warn("init was not called")}onActiveMatchingSurveysChanged(e){var t,i;if(this.To)return()=>{};let s={callback:e,active:!0,revision:0};this.Rc.push(s),this.Uc();let n=(t=(i=this.bo)!==null&&i!==void 0?i:this.Ic)===null||t===void 0?void 0:t.kv.get(_i);return this.Mr.disableSurveys||!this._surveyManager&&this.Ec&&!this.Mc||!n&&!D(this.Fc)&&!this.Ac?this.Nc(s,{isLoaded:!1}):this._surveyManager&&this.Nc(s),()=>{var r;s.active=!1,this.Rc=this.Rc.filter(o=>o!==s),this.Rc.length===0&&((r=this.jc)===null||r===void 0||r.call(this),this.jc=void 0)}}Uc(){var e,t,i;this._surveyManager&&this.Rc.length>0&&((e=this.jc)!==null&&e!==void 0||(this.jc=(t=(i=this.wo).onMatchingConditionsChanged)===null||t===void 0?void 0:t.call(i,this.Dc)))}Nc(e,t){if(this.To||!e.active)return;let i=++e.revision,s=n=>{if(!this.To&&e.active&&i===e.revision)try{let r=t!=null?t:{isLoaded:!0},o=JSON.stringify([n,r]);if(o===e.lastResult)return;e.lastResult=o,e.callback(n,r)}catch(r){q.error("Error in active matching surveys callback",r)}};try{t&&!t.isLoaded?s([]):this.getActiveMatchingSurveys(s)}catch(n){q.error("Error in active matching surveys callback",n)}}Kc(e){let t=null;return this.getSurveys(i=>{var s;t=(s=i.find(n=>n.id===e))!==null&&s!==void 0?s:null}),t}Xc(e){if(D(this._surveyManager))return{eligible:!1,reason:jt};let t=typeof e=="string"?this.Kc(e):e;return t?this._surveyManager.checkSurveyEligibility(t):{eligible:!1,reason:"Survey not found"}}Yc(e){if(!this.wo.isCapturing())return{eligible:!1,reason:"PostHog is not capturing, so a survey response cannot be recorded"};if(D(this._surveyManager))return{eligible:!1,reason:jt};let t=typeof e=="string"?this.Kc(e):e;return t?this._surveyManager.checkSurveyRenderability(t):{eligible:!1,reason:"Survey not found"}}canRenderSurvey(e){if(D(this._surveyManager))return q.warn("init was not called"),{visible:!1,disabledReason:jt};let t=this.Yc(e);return{visible:t.eligible,disabledReason:t.reason}}canRenderSurveyAsync(e,t){return D(this._surveyManager)?(q.warn("init was not called"),Promise.resolve({visible:!1,disabledReason:jt})):new Promise(i=>{this.getSurveys(s=>{var n;let r=(n=s.find(o=>o.id===e))!==null&&n!==void 0?n:null;if(r){let o=this.Yc(r);i({visible:o.eligible,disabledReason:o.reason})}else i({visible:!1,disabledReason:"Survey not found"})},t)})}renderSurvey(e,t,i){var s;if(!this.wo.isCapturing())return;if(D(this._surveyManager))return void q.warn("init was not called");let n=typeof e=="string"?this.Kc(e):e;if(!(n!=null&&n.id))return void q.warn("Survey not found");if(!sf.includes(n.type))return void q.warn(`Surveys of type ${n.type} cannot be rendered in the app`);let r=E==null?void 0:E.querySelector(t);if(r){if(!((s=n.appearance)===null||s===void 0)&&s.surveyPopupDelaySeconds){q.info(`Rendering survey ${n.id} with delay of ${n.appearance.surveyPopupDelaySeconds} seconds`);let o=setTimeout(()=>{var a,l;this.Oc.delete(o),!this.To&&this.wo.isCapturing()&&(q.info(`Rendering survey ${n.id} with delay of ${(a=n.appearance)===null||a===void 0?void 0:a.surveyPopupDelaySeconds} seconds`),(l=this._surveyManager)===null||l===void 0||l.renderSurvey(n,r,i),q.info(`Survey ${n.id} rendered`))},1e3*n.appearance.surveyPopupDelaySeconds);return void this.Oc.add(o)}this._surveyManager.renderSurvey(n,r,i)}else q.warn("Survey element not found")}displaySurvey(e,t){var i;if(!this.wo.isCapturing())return;if(D(this._surveyManager))return void q.warn("init was not called");let s=this.Kc(e);if(!s)return void q.warn("Survey not found");let n=s;if(!((i=s.appearance)===null||i===void 0)&&i.surveyPopupDelaySeconds&&t.ignoreDelay&&(n=f(f({},s),{},{appearance:f(f({},s.appearance),{},{surveyPopupDelaySeconds:0})})),t.displayType!==Yn.Popover&&t.initialResponses&&q.warn("initialResponses is only supported for popover surveys. prefill will not be applied."),t.ignoreConditions===!1){let r=this.Xc(s);if(!r.eligible)return void q.warn("Survey is not eligible to be displayed: ",r.reason)}t.displayType!==Yn.Inline?this._surveyManager.handlePopoverSurvey(n,t):this.renderSurvey(n,t.selector,t.properties)}cancelPendingSurvey(e){D(this._surveyManager)?q.warn("init was not called"):this._surveyManager.cancelSurvey(e)}handlePageUnload(){var e,t;(e=this._surveyManager)===null||e===void 0||(t=e.handlePageUnload)===null||t===void 0||t.call(e)}};function Vt(e,t,i){if(D(e))return!1;switch(i){case"exact":return e===t;case"contains":{let s=t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&").replace(/_/g,".").replace(/%/g,".*");return new RegExp(s,"i").test(e)}case"regex":try{return new RegExp(t).test(e)}catch{return!1}default:return!1}}var Tf=class{constructor(e){this._instance=e,this.th=new Set,this.eh=new Set,this.ih=new Es,this.nh=(t,i)=>this.sh(t,i)&&this.rh(t,i)&&this.oh(t,i)&&this.ah(t,i),this.sh=(t,i)=>!(i!=null&&i.event)||(t==null?void 0:t.event)===(i==null?void 0:i.event)}init(){var e,t;x((e=this._instance)===null||e===void 0?void 0:e._addCaptureHook)||(this.uh=(t=this._instance)===null||t===void 0?void 0:t._addCaptureHook((i,s)=>{this.on(i,s)}))}dispose(){var e,t;(e=this.uh)===null||e===void 0||e.call(this),this.uh=void 0,(t=this._instance)===null||t===void 0||(t=t.autocapture)===null||t===void 0||t.setElementSelectors(new Set,this),this.ih=new Es}register(e){var t,i;if(!x((t=this._instance)===null||t===void 0?void 0:t._addCaptureHook)&&(e.forEach(s=>{var n;this.th.add(s),(n=s.steps)===null||n===void 0||n.forEach(r=>{this.eh.add((r==null?void 0:r.event)||"")})}),(i=this._instance)===null||i===void 0?void 0:i.autocapture)){let s=new Set;this.th.forEach(n=>{var r;(r=n.steps)===null||r===void 0||r.forEach(o=>{o!=null&&o.selector&&s.add(o.selector)})}),this._instance.autocapture.setElementSelectors(s,this)}}replace(e){this.th.clear(),this.eh.clear(),this.register(e)}on(e,t){t!=null&&e.length!=0&&(this.eh.has(e)||this.eh.has(t.event))&&this.th.forEach(i=>{this.hh(t,i)&&this.ih.emit("actionCaptured",i.name)})}dh(e){this.onAction("actionCaptured",t=>e(t))}hh(e,t){if((t==null?void 0:t.steps)==null)return!1;for(let i of t.steps)if(this.nh(e,i))return!0;return!1}onAction(e,t){return this.ih.on(e,t)}rh(e,t){if(t!=null&&t.url){var i;let s=e==null||(i=e.properties)===null||i===void 0?void 0:i.$current_url;if(!s||typeof s!="string"||!Vt(s,t.url,t.url_matching||"contains"))return!1}return!0}oh(e,t){return!!this.fh(e,t)&&!!this.ph(e,t)&&!!this.gh(e,t)}fh(e,t){var i;if(!(t!=null&&t.href))return!0;let s=this.mh(e);if(s.length>0)return s.some(r=>Vt(r.href,t.href,t.href_matching||"exact"));let n=(e==null||(i=e.properties)===null||i===void 0?void 0:i.$elements_chain)||"";return!!n&&Vt((function(r){let o=r.match(/(?::|")href="(.*?)"/);return o?o[1]:""})(n),t.href,t.href_matching||"exact")}ph(e,t){var i;if(!(t!=null&&t.text))return!0;let s=this.mh(e);if(s.length>0)return s.some(l=>Vt(l.text,t.text,t.text_matching||"exact")||Vt(l.$el_text,t.text,t.text_matching||"exact"));let n=(e==null||(i=e.properties)===null||i===void 0?void 0:i.$elements_chain)||"";return!!n&&(r=(function(l){let c=[],u=/(?::|")text="(.*?)"/g,d;for(;!D(d=u.exec(l));)c.includes(d[1])||c.push(d[1]);return c})(n),o=t.text,a=t.text_matching||"exact",r.some(l=>Vt(l,o,a)));var r,o,a}gh(e,t){var i,s;if(!(t!=null&&t.selector))return!0;let n=e==null||(i=e.properties)===null||i===void 0?void 0:i.$element_selectors;if(n!=null&&n.includes(t.selector))return!0;let r=(e==null||(s=e.properties)===null||s===void 0?void 0:s.$elements_chain)||"";if(t.selector_regex&&r)try{return new RegExp(t.selector_regex).test(r)}catch{return!1}return!1}mh(e){var t;return(e==null||(t=e.properties)===null||t===void 0?void 0:t.$elements)==null?[]:e==null?void 0:e.properties.$elements}ah(e,t){return!(t!=null&&t.properties)||t.properties.length===0||iu(t.properties.reduce((i,s)=>{let n=R(s.value)?s.value.map(String):s.value!=null?[String(s.value)]:[];return i[s.key]={values:n,operator:s.operator||"exact"},i},{}),e==null?void 0:e.properties)}},If=class{constructor(e,t){var i,s;this.yh=[],this._instance=e,this.bh=t,this._h=new Map,this.wh=new Map,this.kh=new Map,this.Sh=(i=this._instance)===null||i===void 0||(s=i.onSessionId)===null||s===void 0?void 0:s.call(i,n=>this.xh(n))}$h(e){return!1}Ch(){return null}Th(e){}Ih(){}Mh(e,t){return!!e&&iu(e.propertyFilters,t==null?void 0:t.properties)}Eh(e,t){let i=new Map;return e.forEach(s=>{var n;(n=s.conditions)===null||n===void 0||(n=n[t])===null||n===void 0||(n=n.values)===null||n===void 0||n.forEach(r=>{if(r!=null&&r.name){let o=i.get(r.name)||[];o.push(s.id),i.set(r.name,o)}})}),i}Ph(e,t,i){let s=(i===hi.Activation?this._h:this.wh).get(e),n=[];return this.Rh(r=>{n=r.filter(o=>s==null?void 0:s.includes(o.id))}),n.filter(r=>{var o;let a=(o=r.conditions)===null||o===void 0||(o=o[i])===null||o===void 0||(o=o.values)===null||o===void 0?void 0:o.find(l=>l.name===e);return this.Mh(a,t)})}register(e){this.Ah(e,!1)}replace(e){this.Ah(e,!0)}Ah(e,t){var i;x((i=this._instance)===null||i===void 0?void 0:i._addCaptureHook)||(this.Fh(e,t),this.Oh(e,t))}Oh(e,t){let i=e.filter(r=>{var o;return(o=r.conditions)===null||o===void 0||(o=o.actions)===null||o===void 0||(o=o.values)===null||o===void 0?void 0:o.length});var s;if(t&&this.kh.clear(),i.length===0)return void(t&&((s=this.Dh)===null||s===void 0||s.replace([])));this.Dh||(this.Dh=new Tf(this._instance),this.Dh.init(),this.Dh.dh(r=>this.onAction(r)));let n=[];i.forEach(r=>{var o;(o=r.conditions)===null||o===void 0||(o=o.actions)===null||o===void 0||o.values.forEach(a=>{if(n.push(a),a.name){var l;let c=(l=this.kh.get(a.name))!==null&&l!==void 0?l:[];c.includes(r.id)||c.push(r.id),this.kh.set(a.name,c)}})}),t?this.Dh.replace(n):this.Dh.register(n)}Lh(e,t){t.forEach((i,s)=>{var n;let r=(n=e.get(s))!==null&&n!==void 0?n:[];i.forEach(o=>{r.includes(o)||r.push(o)}),e.set(s,r)})}Fh(e,t){var i,s;let n=e.filter(l=>{var c,u;return((c=l.conditions)===null||c===void 0?void 0:c.events)&&((u=l.conditions)===null||u===void 0||(u=u.events)===null||u===void 0||(u=u.values)===null||u===void 0?void 0:u.length)>0}),r=e.filter(l=>{var c,u;return((c=l.conditions)===null||c===void 0?void 0:c.cancelEvents)&&((u=l.conditions)===null||u===void 0||(u=u.cancelEvents)===null||u===void 0||(u=u.values)===null||u===void 0?void 0:u.length)>0}),o=this.Eh(e,hi.Activation),a=this.Eh(e,hi.Cancellation);t?(this._h=o,this.wh=a):(this.Lh(this._h,o),this.Lh(this.wh,a)),(n.length!==0||r.length!==0||e.some(l=>{var c;return(c=l.conditions)===null||c===void 0||(c=c.actions)===null||c===void 0||(c=c.values)===null||c===void 0?void 0:c.length}))&&((i=this.uh)!==null&&i!==void 0||(this.uh=(s=this._instance)===null||s===void 0?void 0:s._addCaptureHook((l,c)=>{this.onEvent(l,c)})))}onEvent(e,t){var i,s;let n=this.Nh(),r=(t==null||(i=t.properties)===null||i===void 0?void 0:i.$survey_id)||(t==null||(s=t.properties)===null||s===void 0?void 0:s.$product_tour_id);if(r&&this.getActivatedIds().includes(r)){let a=this.qh(e,r,t);if(a==="consume")return n.info("event consumed activated item, removing it",{event:e,itemId:r}),void this.jh([r]);if(a==="persist")return n.info("shown item promoted to persisted activation",{event:e,itemId:r}),this.Bh(r),void this.zh([r])}if(this.wh.has(e)){let a=this.Ph(e,t,hi.Cancellation);a.length>0&&(n.info("cancel event matched, cancelling items",{event:e,itemsToCancel:a.map(l=>l.id)}),this.jh(a.map(l=>l.id)),a.forEach(l=>this.Hh(l.id)))}if(!this._h.has(e))return;n.info("event name matched",{event:e,eventPayload:t,items:this._h.get(e)});let o=this.Ph(e,t,hi.Activation);this.Uh(o.map(a=>a.id))}onAction(e){this.kh.has(e)&&this.Uh(this.kh.get(e)||[])}Uh(e){var t,i;if(e.length===0)return;let s=!!(!((t=this._instance)===null||t===void 0||(i=t.get_session_id)===null||i===void 0)&&i.call(t)),n=[];for(let r of e)s&&this.$h(r)?this.Bh(r)&&this.Wh(r):n.push(r);n.length>0&&(this.yh=[...new Set([...this.yh,...n])]),this.Nh().info("updating activated items",{activatedItems:this.getActivatedIds()}),this.Vh()}Bh(e){this.yh=this.yh.filter(i=>i!==e);let t=this.Gh();return!t.includes(e)&&(this.Qh([...t,e]),this.Zh(),!0)}jh(e){let t=new Set(e);this.yh=this.yh.filter(n=>!t.has(n));let i=this.Jh(),s=i.filter(n=>!t.has(n));s.length!==i.length&&(this.Qh(s),s.length===0&&this.Kh()),this.zh(e),this.Vh()}Vh(){try{var e;(e=this.bh)===null||e===void 0||e.call(this)}catch(t){this.Nh().error("Error while handling activated items change",t)}}Xh(){var e;let t=this.Ch();if(!t)return{};let i=(e=this._instance)===null||e===void 0||(e=e.persistence)===null||e===void 0?void 0:e.props[t];return i&&typeof i=="object"?i:{}}Wh(e){if(!this.Ch())return;let t=this.Xh();this.Th(f(f({},t),{},{[e]:Date.now()}))}zh(e){if(!this.Ch())return;let t=this.Xh(),i={},s=!1;for(let[n,r]of Object.entries(t))e.includes(n)?s=!0:i[n]=r;s&&(Me(i)?this.Ih():this.Th(i))}Yh(){this.Ch()&&this.Ih()}getActivationTimestamp(e){if(!this.Gh().includes(e))return;let t=this.Xh()[e];return oe(t)?t:void 0}Jh(){var e;let t=this.td();return((e=this._instance)===null||e===void 0||(e=e.persistence)===null||e===void 0?void 0:e.props[t])||[]}Gh(){var e,t,i;let s=this.Jh();if(s.length===0)return[];let n=(e=this._instance)===null||e===void 0||(e=e.persistence)===null||e===void 0?void 0:e.props[this.ed()],r=(t=this._instance)===null||t===void 0||(i=t.get_session_id)===null||i===void 0?void 0:i.call(t);return r&&n===r?s:[]}Zh(){var e,t;let i=(e=this._instance)===null||e===void 0||(t=e.get_session_id)===null||t===void 0?void 0:t.call(e);i&&this.nd(i)}Kh(){this.sd()}xh(e){var t;let i=(t=this._instance)===null||t===void 0||(t=t.persistence)===null||t===void 0?void 0:t.props[this.ed()];if(i&&i!==e){let s=this.Jh(),n=this.Xh();s.length>0&&(this.Qh([]),s.filter(r=>oe(n[r])).forEach(r=>this.Hh(r))),this.Kh(),this.Yh(),s.length>0&&this.Vh()}}getActivatedIds(){return[...new Set([...this.Gh(),...this.yh])].filter(e=>!this.rd(e))}dispose(){var e,t,i;(e=this.Sh)===null||e===void 0||e.call(this),this.Sh=void 0,(t=this.uh)===null||t===void 0||t.call(this),this.uh=void 0,(i=this.Dh)===null||i===void 0||i.dispose(),this.Dh=void 0}reset(){this.yh=[],this.Jh().length>0&&this.Qh([]),this.Kh(),this.Yh(),this.Vh()}getEventToItemsMap(){return this._h}od(){return this.Dh}},Af=class extends If{constructor(e,t){super(e,t)}td(){return Zl}ed(){return Yl}Ch(){return Xl}Th(e){var t;(t=this._instance)===null||t===void 0||(t=t.persistence)===null||t===void 0||t.register({$surveys_activated_timestamps:e})}Ih(){var e;(e=this._instance)===null||e===void 0||(e=e.persistence)===null||e===void 0||e.unregister("$surveys_activated_timestamps")}$h(e){var t;let i;this.Rh(n=>{i=n.find(r=>r.id===e)});let s=i==null||(t=i.appearance)===null||t===void 0?void 0:t.surveyPopupDelaySeconds;return oe(s)&&s>0}ad(){return Ae.SHOWN}Rh(e){var t;(t=this._instance)===null||t===void 0||t.getSurveys(e)}Hh(e){var t;(t=this._instance)===null||t===void 0||t.cancelPendingSurvey(e)}Nh(){return q}Qh(e){var t;(t=this._instance)===null||t===void 0||(t=t.persistence)===null||t===void 0||t.register({$surveys_activated:e})}nd(e){var t;(t=this._instance)===null||t===void 0||(t=t.persistence)===null||t===void 0||t.register({$surveys_activated_session:e})}sd(){var e;(e=this._instance)===null||e===void 0||(e=e.persistence)===null||e===void 0||e.unregister("$surveys_activated_session")}rd(){return!1}qh(e,t,i){var s;if(e===Ae.SENT&&(i==null||(s=i.properties)===null||s===void 0?void 0:s.$survey_completed)===!1)return"ignore";let n;return this.Rh(r=>{n=r.find(o=>o.id===t)}),!n||(function(r){var o;return eu(r)&&!!(!((o=r.conditions)===null||o===void 0||(o=o.events)===null||o===void 0)&&o.repeatedActivation)||r.schedule==="always"})(n)?e===Ae.SHOWN?"consume":"ignore":e===Ae.SHOWN?"persist":e===Ae.DISMISSED||e===Ae.SENT?"consume":"ignore"}getSurveys(){return this.getActivatedIds()}getEventToSurveys(){return this.getEventToItemsMap()}},Cf=class{constructor(e){this._instance=e}initialize(){}get(e){if(typeof e=="string")return this._instance.get_property(e);let t={};for(let i of e){let s=this._instance.get_property(i);x(s)||(t[i]=s)}return t}set(e,t){this._instance.register(typeof e=="string"?{[e]:t}:e)}remove(e){typeof e!="string"?e.forEach(t=>this._instance.unregister(t)):this._instance.unregister(e)}},Ff=class{constructor(e){this._instance=e}get(){let e=this._instance.config;return{disableSurveys:e.disable_surveys,cookielessMode:!!e.cookieless_mode,advancedEnableSurveys:e.advanced_enable_surveys,requestTimeoutMs:e.surveys_request_timeout_ms}}isOptedOut(){return this._instance.consent.isOptedOut()}isCapturing(){return this._instance.is_capturing()}getExtensions(){let e=F==null?void 0:F.__PosthogExtensions__;if(!e)return;let{generateSurveys:t,loadExternalDependency:i}=e;return{generateSurveys:t?s=>t(this._instance,s):void 0,loadExternalDependency:i?s=>i(this._instance,"surveys",s):void 0}}createEventReceiver(e){return new Af(this._instance,e)}onMatchingConditionsChanged(e){let t=this._instance._addCaptureHook(r=>{r!=="$pageview"&&r!==Ae.SHOWN&&r!==Ae.DISMISSED&&r!==Ae.SENT||e()}),i=()=>e();G(b,"PHSurveyShown",i);let s=!1,n=this._instance.onFeatureFlags(()=>{s&&e()});return s=!0,()=>{s=!1,t(),n(),b==null||b.removeEventListener("PHSurveyShown",i)}}},Of=b!=null&&b.location?ws(b.location.hash,"__posthog")||ws(location.hash,"state"):null,xa="_postHogToolbarParams",ka=re("[Toolbar]"),Sa=re("[FeatureFlags]"),Et=re("[FeatureFlags]",{debugEnabled:!0}),kn=`" failed. Feature flags didn't load in time.`,Rf=[502,504],Ea=["click","keydown","wheel","touchstart","pointerdown"],$a="connection_error",Pa=e=>{let t={};for(let i=0;e.length>i;i++)t[e[i]]=!0;return t},Ma=e=>{let t={};for(let[i,s]of rs(e||{}))s&&(t[i]=s);return t},Lf=class{constructor(e){this.name="featureFlags",this.ld=!1,this.featureFlagEventHandlers=[],this.A=Sa,this.ud={},this.hd={},this.dd=[],this.vd=new Set,this.fd=new Set,this.pd=!1,this.gd=!1,this.md=0,this.yd=!1,this.bd=!1,this._d=!1,this.wd=!1,this.kd=0,this.Sd=!1,this.rn=()=>{let t=this.xd();this.kd=0,t&&this.reloadFeatureFlags()},this.$d=()=>{var t,i;let s=this.Cd,n=(t=this.Td)!==null&&t!==void 0?t:s;x(s)||x(n)||this.Mr.remoteRequestsDisabled||!this.Id||this.Id.visibilityState==="hidden"||Date.now()-((i=this.Md)!==null&&i!==void 0?i:0)<n||(this.Td=this.Sd||!this.Mr.idleRefreshBackoff?s:Math.min(2*n,36e5),this.Sd=!1,this.reloadFeatureFlags(),this.Ed())},this.Pd=()=>{this.Sd&&this.Td===this.Cd||this.Rd()},this.sn=()=>{var t;((t=this.Id)===null||t===void 0?void 0:t.visibilityState)==="visible"&&this.Rd()},this.wo=e}get Ad(){}Fd(){this.bo&&this.Od()}setup(e){try{this.Dd=typeof window>"u"?void 0:window,this.Id=typeof document>"u"?void 0:document}catch{this.Dd=void 0,this.Id=void 0}return this.qc=e,this.A=e.logger.createLogger("[FeatureFlags]"),ou(e.kv.initialize(),()=>{this.qc===e&&(this.qc=void 0,this.bo=e,this.Ld(e))})}Ld(e){var t;if(this.bo===e)return this.Dd&&G(this.Dd,"online",this.rn),this.Od(),this.Nd=e.registerDynamicEventProperties(()=>this.qd()?this.ud:this.hd),this.jd=(t=this.Ad)===null||t===void 0?void 0:t.onCrossTabFeatureFlagChange(()=>{this.Bd(),this.zd(),this.Hd()}),this.zd(),this.initialize()}Rd(){this.Sd=!0,this.Td=this.Cd,this.$d()}Od(){var e;let t=this.Mr.refreshIntervalMs,i=!this.Mr.remoteRequestsDisabled&&this.Id&&!x(t)&&t>0?t:void 0;this.Mr.idleRefreshBackoff||(this.Td=i),i!==this.Cd&&(this.Ud(),x(i)||(this.Cd=i,this.Td=i,this.Ed(),!((e=this.Id)===null||e===void 0)&&e.addEventListener&&(G(this.Id,Fi,this.sn),Wt(Ea,s=>{G(this.Id,s,this.Pd,{capture:!0})}))))}Ed(){x(this.Cd)||(x(this.Wd)||clearInterval(this.Wd),this.Md=Date.now(),this.Wd=setInterval(this.$d,this.Cd))}Ud(){var e,t;x(this.Wd)||(clearInterval(this.Wd),this.Wd=void 0,(e=this.Id)===null||e===void 0||(t=e.removeEventListener)===null||t===void 0||t.call(e,"visibilitychange",this.sn),Wt(Ea,i=>{var s,n;(s=this.Id)===null||s===void 0||(n=s.removeEventListener)===null||n===void 0||n.call(s,i,this.Pd,{capture:!0})})),this.Cd=void 0,this.Td=void 0,this.Sd=!1,this.Md=void 0}destroy(){this.Vd()}dispose(){this.Vd()}Vd(){var e,t,i;this.Ud(),this.md++,this.bd=!1,this.qc=void 0,this.Gd(this.vd,"cancelled"),this.Gd(this.fd,"cancelled"),this.bo&&(this.Qd(),(e=this.Nd)===null||e===void 0||e.dispose(),this.Nd=void 0,(t=this.jd)===null||t===void 0||t.call(this),this.jd=void 0,this.dd=[],(i=this.Dd)===null||i===void 0||i.removeEventListener("online",this.rn),this.bo=void 0)}get Mr(){return this.wo.get()}Zd(e){var t;return this.Jd&&e in this.Jd?this.Jd[e]:(t=this.bo)===null||t===void 0?void 0:t.kv.get(e)}Bd(){return!!this.Jd&&(this.Jd=void 0,!0)}Kd(){var e;return!x((e=this.bo)===null||e===void 0?void 0:e.kv.get("$enabled_feature_flags"))&&this.Bd()}$t(e){this.Xd(()=>{var t;return(t=this.bo)===null||t===void 0?void 0:t.kv.set(e)})}Yd(e,t,i){if(!this.Ad||!e.$enabled_feature_flags)return;let s=this.Zd("$enabled_feature_flags")||{},n=e.$enabled_feature_flags||{},r=t.flags||t.featureFlags,o=t.flags?Object.entries(t.flags).filter(([,g])=>!(g!=null&&g.failed)).map(([g])=>g):[],a=!!t.errorsWhileComputingFlags&&!!t.flags,l=a?o:i&&!R(r)?Object.keys(r||{}):Array.from(new Set([...Object.keys(s),...Object.keys(n)])),c=this.Zd("$feature_flag_payloads")||{},u=e.$feature_flag_payloads||{},d=a||i?l:Array.from(new Set([...Object.keys(c),...Object.keys(u)])),h=!a&&!i,p=!!h||l,v=!!h||d,_={[tt]:p,[He]:p,[_t]:v};e.$feature_flag_details&&(_[It]=p);for(let g of[At,mt,wi])x(e[g])||(_[g]=!0);this.Ad.markCrossTabFeatureFlagChanges(_)}Pt(e){this.Xd(()=>{var t;return(t=this.bo)===null||t===void 0?void 0:t.kv.remove(e)})}Xd(e){try{e()}catch(t){this.A.error("Failed to update feature flag persistence",t)}}zd(){let e={};for(let s of[tt,_t,At,Ze]){let n=this.Zd(s);x(n)||(e[s]=n)}this.ud=e;let t=f({},e),i=this.Zd(He);if(i)for(let[s,n]of Object.entries(i))t[`$feature/${s}`]=n;this.hd=t}qd(){let e=this.Mr.cacheTtlMs;if(!e||0>=e)return!1;let t=this.Zd(mt);return typeof t!="number"||Date.now()-t>e}tv(){return!!this.qd()&&(this.wd||this.gd||(this.wd=!0,this.A.warn("Feature flag cache is stale, triggering refresh..."),this.reloadFeatureFlags()),!0)}ev(){let e=this.Mr.evaluationContexts;return e!=null&&e.length?e.filter(t=>{let i=t&&typeof t=="string"&&t.trim().length>0;return i||this.A.error("Invalid evaluation context found:",t,"Expected non-empty string"),i}):[]}iv(){let e=this.Mr.flagKeys;if(!x(e))return e.filter(t=>{let i=t&&typeof t=="string"&&t.trim().length>0;return i||this.A.error("Invalid flag key found:",t,"Expected non-empty string"),i})}initialize(){var e,t;let i=this.Mr,s=(e=(t=i.bootstrap)===null||t===void 0?void 0:t.featureFlags)!==null&&e!==void 0?e:{};if(Object.keys(s).length){var n,r;let o=(n=(r=i.bootstrap)===null||r===void 0?void 0:r.featureFlagPayloads)!==null&&n!==void 0?n:{},a=Object.keys(s).filter(c=>!x(s[c])).reduce((c,u)=>(c[u]=s[u],c),{}),l=Object.keys(o).filter(c=>a[c]).reduce((c,u)=>(c[u]=o[u],c),{});return this.nv({featureFlags:a,featureFlagPayloads:l},void 0,{persist:!1})}}updateFlags(e,t,i){var s,n;let r=i!=null&&i.merge&&(s=this.Zd("$enabled_feature_flags"))!==null&&s!==void 0?s:{},o=i!=null&&i.merge&&(n=this.Zd("$feature_flag_payloads"))!==null&&n!==void 0?n:{},a=f(f({},r),e),l=f(f({},o),t),c={};for(let[u,d]of Object.entries(a))c[u]={key:u,enabled:mo(d),variant:yo(d),reason:void 0,metadata:x(l==null?void 0:l[u])?void 0:{id:0,version:void 0,description:void 0,payload:l[u]}};this.nv({flags:c})}get hasLoadedFlags(){return this.pd}getFlags(){return Object.keys(this.getFlagVariants())}getFlagsWithDetails(){let e=this.Zd(It),t=this.Zd(Ze),i=this.Zd(Mt);if(!i&&!t)return e||{};let s=Q({},e||{}),n=[...new Set([...Object.keys(i||{}),...Object.keys(t||{})])];for(let a of n){var r,o;let l=s[a],c=t==null?void 0:t[a],u=x(c)?(r=l==null?void 0:l.enabled)!==null&&r!==void 0&&r:!!c,d=x(c)?l==null?void 0:l.variant:typeof c=="string"?c:void 0,h=i==null?void 0:i[a],p=f(f({},l),{},{enabled:u,variant:u?d!=null?d:l==null?void 0:l.variant:void 0});u!==(l==null?void 0:l.enabled)&&(p.original_enabled=l==null?void 0:l.enabled),d!==(l==null?void 0:l.variant)&&(p.original_variant=l==null?void 0:l.variant),h&&(p.metadata=f(f({},l==null?void 0:l.metadata),{},{payload:h,original_payload:l==null||(o=l.metadata)===null||o===void 0?void 0:o.payload})),s[a]=p}return this.ld||(this.A.warn(" Overriding feature flag details!",{flagDetails:e,overriddenPayloads:i,finalDetails:s}),this.ld=!0),s}getAllFeatureFlags(){let e=this.getFlagVariants(),t=this.getFlagPayloads();return Object.keys(e).map(i=>{let s=e[i];return{key:i,enabled:mo(s),variant:yo(s),payload:_o(t[i])}})}getFlagVariants(){let e=this.Zd(He),t=this.Zd(Ze);if(!t)return e||{};let i=Q({},e||{}),s=Object.keys(t);for(let n=0;s.length>n;n++)i[s[n]]=t[s[n]];return this.ld||(this.A.warn(" Overriding feature flags!",{enabledFlags:e,overriddenFlags:t,finalFlags:i}),this.ld=!0),i}getFlagPayloads(){let e=this.Zd(_t),t=this.Zd(Mt);if(!t)return e||{};let i=Q({},e||{}),s=Object.keys(t);for(let n=0;s.length>n;n++)i[s[n]]=t[s[n]];return this.ld||(this.A.warn(" Overriding feature flag payloads!",{flagPayloads:e,overriddenPayloads:t,finalPayloads:i}),this.ld=!0),i}reloadFeatureFlags(){this.yd||this.Mr.featureFlagsDisabled||this.xd()||(this.gd&&(this.bd=!0),this.sv||(this.dd.slice().forEach(e=>{try{e()}catch(t){this.A.error("Error while running feature flags reloading callback",t)}}),this.sv=setTimeout(()=>{this.rv()},5)))}reloadFeatureFlagsAsync(){return!this.bo||this.yd||this.Mr.featureFlagsDisabled||this.Mr.remoteRequestsDisabled||this.xd()?Promise.resolve({status:"skipped"}):new Promise(e=>{this.vd.add(e),this.reloadFeatureFlags()})}Gd(e,t){e.forEach(i=>i({status:t})),e.clear()}Qd(){clearTimeout(this.sv),this.sv=void 0}onReloading(e){return this.dd.push(e),()=>{this.dd=this.dd.filter(t=>t!==e)}}ensureFlagsLoaded(){this.pd||this.gd||this.sv||this.reloadFeatureFlags()}setAnonymousDistinctId(e){this.$anon_distinct_id=e}setReloadingPaused(e){this.yd=e}resetFlagCallReported(){this.Pt(gt)}rv(e){var t;this.Qd();let i=this.bo;if(!i||this.Mr.remoteRequestsDisabled||this.xd())return void this.Gd(this.vd,"skipped");if(this.gd)return void(this.bd=!0);let s={token:i.projectToken,distinct_id:i.distinctId,groups:i.groups,$anon_distinct_id:this.$anon_distinct_id,person_properties:f(f(f({},i.initialPersonProperties),this.Zd("$stored_person_properties")||{}),{},{$lib:i.library.name,$lib_version:i.library.version}),group_properties:this.Zd(ft),timezone:Sc()};x(i.deviceId)||(s.$device_id=i.deviceId),(e!=null&&e.disableFlags||this.Mr.featureFlagsDisabled)&&(s.disable_flags=!0);let n=this.ev();n.length&&(s.evaluation_contexts=n);let r=this.iv();x(r)||(s.flag_keys=r);let o=this.Mr.onlyEvaluateSurveyFeatureFlags,a="/flags/?v=2"+(o?"&only_evaluate_survey_feature_flags=true":""),l=this.md,c=this.vd;this.vd=new Set,this.fd=c,this.gd=!0;let u=()=>{this.bd&&(this.bd=!1,this.rv())},d=g=>{var y,m;let w=(y=g.json)!==null&&y!==void 0?y:{},P=g.statusCode!==200;if(this.gd=!1,l!==this.md)return void u();if(this.ov(g.statusCode),P||this.bd||(this.$anon_distinct_id=void 0),s.disable_flags&&!this.bd)return void this.Gd(c,"skipped");this._d=!P;let $=[];g.error?$.push(g.error instanceof Error&&g.error.name==="AbortError"?"timeout":g.error instanceof Error?$a:"unknown_error"):g.statusCode!==200&&$.push(`api_error_${g.statusCode}`),w.errorsWhileComputingFlags&&$.push("errors_while_computing_flags");let k=!!(!((m=w.quotaLimited)===null||m===void 0)&&m.includes("feature_flags"));k&&$.push("quota_limited"),this.$t({[Ci]:$}),k?this.A.warn("You have hit your feature flags quota limit, and will not be able to load feature flags until the quota is reset. Please visit https://posthog.com/docs/billing/limits-alerts to learn more."):s.disable_flags||this.nv(w,P,{partialResponse:o}),this.Gd(c,s.disable_flags?"skipped":$.length||!w.flags&&!w.featureFlags?"error":"loaded"),u()},h=g=>{this.gd=!1,l===this.md&&(this.$t({[Ci]:[$a]}),this.A.error("Feature flag request failed",g),this.Kd()&&this.Hd(!0),this.Gd(c,"error")),u()},p=(t=this.Mr.requestMaxRetries)!==null&&t!==void 0?t:1,v=()=>p>0&&l===this.md,_=()=>{if(l!==this.md||!this.bo||this.Mr.remoteRequestsDisabled)return this.gd=!1,this.Gd(c,"skipped"),void u();try{i.sendRequest(a,{target:"flags",method:"POST",body:s,compression:this.Mr.compression,sentAt:"body",timeoutMs:this.Mr.requestTimeoutMs}).then(g=>{if((y=>Rf.includes(y.statusCode)||(m=>m.statusCode===0&&m.error instanceof Error&&m.error.name==="AbortError")(y))(g)&&v())return p--,void setTimeout(_,500);d(g)}).catch(h)}catch(g){h(g)}};_()}xd(){return $c(this.kd,3)}ov(e){this.kd=Pc(e,this.kd,3,()=>this.A.warn("Feature flag requests are failing before receiving an HTTP response; this can happen due to network issues, CORS, browser blocking, or ad blockers. Stopped refreshing feature flags; will try again when connectivity changes."))}getFeatureFlag(e,t={}){var i;if(t.fresh&&!this._d)return;if(!(this.pd||this.getFlags()&&this.getFlags().length>0))return void this.A.warn('getFeatureFlag for key "'+e+kn);if(this.tv())return;let s=this.getFeatureFlagResult(e,t);return(i=s==null?void 0:s.variant)!==null&&i!==void 0?i:s==null?void 0:s.enabled}getFeatureFlagDetails(e){return this.getFlagsWithDetails()[e]}getFeatureFlagPayload(e){let t=this.getFeatureFlagResult(e,{send_event:!1});return t==null?void 0:t.payload}getFeatureFlagResult(e,t={}){if(t.fresh&&!this._d)return;if(!(this.pd||this.getFlags()&&this.getFlags().length>0))return void this.A.warn('getFeatureFlagResult for key "'+e+kn);if(this.tv())return;let i=this.getFlagVariants(),s=e in i,n=i[e],r=this.getFlagPayloads()[e],o=String(n),a=this.Zd("$feature_flag_request_id")||void 0,l=this.Zd("$feature_flag_evaluated_at")||void 0,c,u=this.Zd("$flag_call_reported")||{};if(this.Mr.deduplicateCallsPerSession){var d;let I=(d=this.bo)===null||d===void 0?void 0:d.session.sessionId,A=this.Zd(gi);I&&I!==A&&(u={},c=I)}if(!t.send_event&&"send_event"in t)c&&this.$t({[gt]:u,[gi]:c});else if(e in u&&u[e].includes(o))c&&this.$t({[gt]:u,[gi]:c});else{var h,p,v,_,g,y,m,w,P,$,k,T,S;R(u[e])?u[e].push(o):u[e]=[o],this.$t(f({[gt]:u},c?{[gi]:c}:{}));let I=this.getFeatureFlagDetails(e),A=[...(h=this.Zd("$feature_flag_errors"))!==null&&h!==void 0?h:[]];x(n)&&A.push("flag_missing");let N={$feature_flag:e,$feature_flag_response:n,$feature_flag_payload:r!=null?r:null,$feature_flag_request_id:a,$feature_flag_evaluated_at:l,$feature_flag_bootstrapped_response:(p=(v=this.Mr.bootstrap)===null||v===void 0||(v=v.featureFlags)===null||v===void 0?void 0:v[e])!==null&&p!==void 0?p:null,$feature_flag_bootstrapped_payload:(_=(g=this.Mr.bootstrap)===null||g===void 0||(g=g.featureFlagPayloads)===null||g===void 0?void 0:g[e])!==null&&_!==void 0?_:null,$used_bootstrap_value:!this._d};x(I==null||(y=I.metadata)===null||y===void 0?void 0:y.has_experiment)||(N.$feature_flag_has_experiment=I.metadata.has_experiment),x(I==null||(m=I.metadata)===null||m===void 0?void 0:m.version)||(N.$feature_flag_version=I.metadata.version);let L=(w=I==null||(P=I.reason)===null||P===void 0?void 0:P.description)!==null&&w!==void 0?w:I==null||($=I.reason)===null||$===void 0?void 0:$.code;L&&(N.$feature_flag_reason=L),!(I==null||(k=I.metadata)===null||k===void 0)&&k.id&&(N.$feature_flag_id=I.metadata.id),x(I==null?void 0:I.original_variant)&&x(I==null?void 0:I.original_enabled)||(N.$feature_flag_original_response=x(I.original_variant)?I.original_enabled:I.original_variant),!(I==null||(T=I.metadata)===null||T===void 0)&&T.original_payload&&(N.$feature_flag_original_payload=I==null||(S=I.metadata)===null||S===void 0?void 0:S.original_payload),A.length&&(N.$feature_flag_error=A.join(",")),this.av(N)}return s?{key:e,enabled:!!n,variant:typeof n=="string"?n:void 0,payload:_o(r)}:void 0}av(e){try{var t;(t=this.bo)===null||t===void 0||t.capture("$feature_flag_called",e)}catch(i){this.A.error("Failed to capture feature flag call",i)}}getRemoteConfigPayload(e,t){this.lv(e,t)}lv(e,t){var i=this;return ee(function*(){let s=i.bo;if(!s)return;let n={distinct_id:s.distinctId,token:s.projectToken,person_properties:{$lib:s.library.name,$lib_version:s.library.version}},r=i.ev();r.length&&(n.evaluation_contexts=r);let o=i.iv(),a;x(o)||(n.flag_keys=o);try{var l;let c=(l=(yield s.sendRequest("/flags/?v=2",{target:"flags",method:"POST",body:n,compression:i.Mr.compression,sentAt:"body",timeoutMs:i.Mr.requestTimeoutMs})).json)===null||l===void 0?void 0:l.featureFlagPayloads;a=(c==null?void 0:c[e])||void 0}catch(c){return void i.A.error("Remote config feature flag request failed",c)}try{t(a)}catch(c){i.A.error("Remote config feature flag callback failed",c)}})()}isFeatureEnabled(e,t={}){if(t.fresh&&!this._d)return t.defaultValue;if(!(this.pd||this.getFlags()&&this.getFlags().length>0))return this.A.warn('isFeatureEnabled for key "'+e+kn),t.defaultValue;let i=this.getFeatureFlag(e,t);return x(i)?t.defaultValue:!!i}addFeatureFlagsHandler(e){this.featureFlagEventHandlers.push(e)}removeFeatureFlagsHandler(e){this.featureFlagEventHandlers=this.featureFlagEventHandlers.filter(t=>t!==e)}receivedFeatureFlags(e,t,i){this.nv(e,t,i)}nv(e,t,i){if(!this.bo)return;this.pd=!0;let s=((n,r={},o={},a={},l,c=Sa)=>{let u=((w,P)=>{let $=w.flags;if($){let k=Object.fromEntries(Object.keys($).map(S=>{var I;return[S,(I=$[S].variant)!==null&&I!==void 0?I:$[S].enabled]})),T=Object.fromEntries(Object.keys($).filter(S=>$[S].enabled).filter(S=>{var I;return!x((I=$[S].metadata)===null||I===void 0?void 0:I.payload)}).map(S=>{var I;return[S,(I=$[S].metadata)===null||I===void 0?void 0:I.payload]}));return f(f({},w),{},{featureFlags:k,featureFlagPayloads:T})}return w.featureFlags&&P.warn("Using an older version of the feature flags endpoint. Please upgrade your PostHog server to the latest version"),w})(n,c),d=u.flags,h=u.featureFlags,p=u.featureFlagPayloads;if(!h)return;let v=n.requestId,_=n.evaluatedAt;if(R(h)){c.warn("v1 of the feature flags endpoint is deprecated. Please use the latest version.");let w={};if(h)for(let P=0;h.length>P;P++)w[h[P]]=!0;return{[tt]:h,[He]:w,[wi]:!1}}let g=h,y=p,m=d;if(l!=null&&l.partialResponse){let w=Object.keys(g),P=y||{};g=f(f({},r),g),y=f(f({},o),P),w.forEach($=>{$ in P||y==null||delete y[$]}),m=f(f({},a),m)}else if(n.errorsWhileComputingFlags)if(d){let w=new Set(Object.keys(d).filter($=>{var k;return!(!((k=d[$])===null||k===void 0)&&k.failed)}));g=f(f({},r),Object.fromEntries(Object.entries(g).filter(([$])=>w.has($))));let P=Object.fromEntries(Object.entries(y||{}).filter(([$])=>w.has($)));y=f(f({},o),P),w.forEach($=>{$ in P||y==null||delete y[$]}),m=f(f({},a),Object.fromEntries(Object.entries(m||{}).filter(([$])=>w.has($))))}else g=f(f({},r),g),y=f(f({},o),y),m=f(f({},a),m);return f(f({[tt]:Object.keys(Ma(g)),[He]:g||{},[_t]:y||{},[It]:m||{},[wi]:n.minimalFlagCalledEvents===!0},v?{[At]:v}:{}),_?{[mt]:_}:{})})(e,this.getFlagVariants(),this.getFlagPayloads(),this.getFlagsWithDetails(),i,this.A);if(s)if((i==null?void 0:i.persist)===!1){let n=!x(this.bo.kv.get(He));this.Jd=s,n||this.$t(s)}else this.Bd(),this.Yd(s,e,!!(i!=null&&i.partialResponse)),this.$t(s);else t&&this.Kd();t||(this.wd=!1),this.Hd(t)}override(e,t=!1){this.A.warn("override is deprecated. Please use overrideFeatureFlags instead."),this.overrideFeatureFlags({flags:e,suppressWarning:t})}overrideFeatureFlags(e){this.uv(e)}uv(e){if(this.bo){if(e===!1)return this.Pt([Ze,Mt]),this.Hd(),void Et.info("All overrides cleared");if(R(e))return this.$t({[Ze]:Pa(e)}),this.Hd(),void Et.info("Flag overrides set",{flags:e});if(e&&typeof e=="object"&&("flags"in e||"payloads"in e)){var t;let i=e;this.ld=!!((t=i.suppressWarning)!==null&&t!==void 0&&t);let s={},n=i.flags,r=i.payloads;return n&&(s[Ze]=R(n)?Pa(n):n),r&&(s[Mt]=r),Object.keys(s).length&&this.$t(s),n===!1&&r===!1?this.Pt([Ze,Mt]):n===!1?this.Pt(Ze):r===!1&&this.Pt(Mt),this.Hd(),n===!1?Et.info("Flag overrides cleared"):n&&Et.info("Flag overrides set",{flags:n}),void(r===!1?Et.info("Payload overrides cleared"):r&&Et.info("Payload overrides set",{payloads:r}))}if(e&&typeof e=="object")return this.$t({[Ze]:e}),this.Hd(),void Et.info("Flag overrides set",{flags:e});this.A.warn("Invalid overrideOptions provided to overrideFeatureFlags",{overrideOptions:e})}else this.A.warn("posthog.featureFlags.overrideFeatureFlags called before feature flags were ready")}onFeatureFlags(e){if(this.addFeatureFlagsHandler(e),this.pd){let{flags:t,flagVariants:i}=this.hv();try{e(t,i)}catch(s){this.A.error("Error while running feature flags callback",s)}}return()=>this.removeFeatureFlagsHandler(e)}updateEarlyAccessFeatureEnrollment(e,t,i){var s;let n=(this.Zd("$early_access_features")||[]).find(c=>c.flagKey===e),r={[`$feature_enrollment/${e}`]:t},o={$feature_flag:e,$feature_enrollment:t,$set:r};n&&(o.$early_access_feature_name=n.name),i&&(o.$feature_enrollment_stage=i);let a=f(f({},this.getFlagVariants()),{},{[e]:t});(s=this.Ad)===null||s===void 0||s.markCrossTabFeatureFlagChanges({$active_feature_flags:[e],$enabled_feature_flags:[e],$stored_person_properties:Object.keys(r)}),this.$t({[tt]:Object.keys(Ma(a)),[He]:a,[vt]:f(f({},this.Zd("$stored_person_properties")||{}),r)}),this.Hd();try{var l;(l=this.bo)===null||l===void 0||l.capture("$feature_enrollment_update",o)}catch(c){this.A.error("Failed to capture early access feature enrollment",c)}}getEarlyAccessFeatures(e,t=!1,i){let s=this.Zd(Ln);!s||t?this.dv(e,i):e(s)}dv(e,t){var i=this;return ee(function*(){let s=i.bo;if(!s)return;let n=t?`&${t.map(o=>`stage=${o}`).join("&")}`:"",r;try{let o=yield s.sendRequest(`/api/early_access_features/?token=${s.projectToken}${n}`,{target:"api",method:"GET",sentAt:"query"});if(!o.json)return;r=o.json.earlyAccessFeatures,i.$t({[Ln]:r})}catch(o){return void i.A.error("Early access feature request failed",o)}try{e(r)}catch(o){i.A.error("Early access feature callback failed",o)}})()}hv(){let e=this.getFlags(),t=this.getFlagVariants();return{flags:e.filter(i=>t[i]),flagVariants:Object.keys(t).filter(i=>t[i]).reduce((i,s)=>(i[s]=t[s],i),{})}}Hd(e){this.zd();let{flags:t,flagVariants:i}=this.hv();this.featureFlagEventHandlers.forEach(s=>{try{s(t,i,{errorsLoading:e})}catch(n){this.A.error("Error while running feature flags callback",n)}})}setPersonPropertiesForFlags(e,t=!0){this.vv(e,t)}vv(e,t=!0){let i=this.Zd("$stored_person_properties")||{},s=(e==null?void 0:e.$set)||(e!=null&&e.$set_once?{}:e),n=e==null?void 0:e.$set_once,r={};if(n)for(let o in n)({}).hasOwnProperty.call(n,o)&&(o in i||(r[o]=n[o]));this.$t({[vt]:f(f(f({},i),r),s)}),t&&this.reloadFeatureFlags()}unsetPersonPropertiesForFlags(e,t=!0){let i=f({},this.Zd("$stored_person_properties")||{});e.forEach(s=>{delete i[s]}),this.$t({[vt]:i}),t&&this.reloadFeatureFlags()}resetPersonPropertiesForFlags(e=!0){this.Pt(vt),e&&this.reloadFeatureFlags()}setGroupPropertiesForFlags(e,t=!0){let i=this.Zd("$stored_group_properties")||{},s=f({},i);for(let n of Object.keys(e))s[n]=f(f({},i[n]),e[n]);this.$t({[ft]:s}),t&&this.reloadFeatureFlags()}resetGroupPropertiesForFlags(e){if(e){let t=this.Zd("$stored_group_properties")||{};this.$t({[ft]:f(f({},t),{},{[e]:{}})})}else this.Pt(ft)}reset(){this.md++,this.Gd(this.vd,"cancelled"),this.Gd(this.fd,"cancelled"),this.bd=!1,this.ud={},this.hd={},this.Jd=void 0,this.pd=!1,this.yd=!1,this._d=!1,this.$anon_distinct_id=void 0,this.Qd(),this.ld=!1,this.kd=0}},Ta=re("[FeatureFlags]"),Df=class{constructor(e,t=!1){this.fv=!1,this.update(e,t)}update(e,t){this.pv=((i,s)=>{var n,r,o,a,l,c,u,d;return{bootstrap:{featureFlags:(n=(r=i.bootstrap)===null||r===void 0?void 0:r.featureFlags)!==null&&n!==void 0?n:void 0,featureFlagPayloads:(o=(a=i.bootstrap)===null||a===void 0?void 0:a.featureFlagPayloads)!==null&&o!==void 0?o:void 0},remoteRequestsDisabled:s,featureFlagsDisabled:!!i.advanced_disable_feature_flags,onlyEvaluateSurveyFeatureFlags:!!i.advanced_only_evaluate_survey_feature_flags,deduplicateCallsPerSession:!!i.advanced_feature_flags_dedup_per_session,cacheTtlMs:i.feature_flag_cache_ttl_ms,refreshIntervalMs:(l=i.remote_config_refresh_interval_ms)!==null&&l!==void 0?l:3e5,idleRefreshBackoff:x(i.remote_config_refresh_interval_ms),requestTimeoutMs:i.feature_flag_request_timeout_ms,requestMaxRetries:Math.max(0,(c=i.feature_flag_request_max_retries)!==null&&c!==void 0?c:1),compression:i.disable_compression?void 0:"best-available",evaluationContexts:(u=(d=i.evaluation_contexts)!==null&&d!==void 0?d:i.evaluation_environments)!==null&&u!==void 0?u:[],flagKeys:R(i.flag_keys)?i.flag_keys:void 0}})(e,t),!e.evaluation_environments||e.evaluation_contexts||this.fv||(Ta.warn("evaluation_environments is deprecated. Use evaluation_contexts instead. evaluation_environments will be removed in a future version."),this.fv=!0),x(e.flag_keys)||R(e.flag_keys)||Ta.error("Invalid flag_keys found:",e.flag_keys,"Expected array of non-empty strings")}get(){return this.pv}},Ia=e=>ii(e)&&(e.name==="RangeError"&&e.message.indexOf("Maximum call stack size exceeded")===0||e.name==="InternalError"&&e.message==="too much recursion"),je=re("[Error tracking]"),tr="webkit-masked-url:",Nf=[{value:"isolatedAPI.contexts.topHostname",exact:!1},{value:"No response from target",exact:!0}],jf=["chrome-extension://","moz-extension://","safari-extension:","safari-web-extension:",tr],Vf=["__firefox__","__gCrWeb"],Aa="Refusing to render web experiment since the viewer is a likely bot",Hf={icontains:(e,t)=>t.toLowerCase().indexOf(e.toLowerCase())>-1,not_icontains:(e,t)=>t.toLowerCase().indexOf(e.toLowerCase())===-1,regex:(e,t)=>$s(t,e),not_regex:(e,t)=>!$s(t,e),exact:(e,t)=>t===e,is_not:(e,t)=>t!==e},Le=re("[Conversations]"),$t="Conversations not available yet.";function Ca(e,t){var i,s,n,r,o,a,l;let c=(i=e==null?void 0:e.flushIntervalMs)!==null&&i!==void 0?i:3e3,u=(s=e==null?void 0:e.maxBufferSize)!==null&&s!==void 0?s:100,d=t!=null&&t.consoleCapture?void 0:(n=e==null?void 0:e.maxLogsPerInterval)!==null&&n!==void 0?n:1e3,h=x(d)?Math.max(u,2048):Math.max(u,d),p=f(f({},(function(){let v="",_="";try{let g=pe==null?void 0:pe.userAgent;g&&([v,_]=vl(g))}catch{}return(function(g,y){let m=(function(w){if(w)return{}.hasOwnProperty.call(Eo,w)?Eo[w]:w})(g);return f(f({},m?{"os.name":m}:{}),y?{"os.version":y}:{})})(v,_)})()),e==null?void 0:e.resourceAttributes);return{serviceName:(r=(o=p==null?void 0:p["service.name"])!==null&&o!==void 0?o:e==null?void 0:e.serviceName)!==null&&r!==void 0?r:t==null?void 0:t.serviceNameDefault,serviceVersion:(a=p==null?void 0:p["service.version"])!==null&&a!==void 0?a:e==null?void 0:e.serviceVersion,environment:(l=p==null?void 0:p["deployment.environment"])!==null&&l!==void 0?l:e==null?void 0:e.environment,resourceAttributes:p,beforeSend:e==null?void 0:e.beforeSend,flushIntervalMs:c,maxBufferSize:u,maxQueueSize:h,maxBatchRecordsPerPost:100,rateCapWindowMs:c,maxLogsPerInterval:d,backgroundFlushBudgetMs:0,terminationFlushBudgetMs:0}}var Bf=["debug","log","warn","error","info"],Wf=e=>{for(;e!=null&&e.__rrweb_original__;)e=e.__rrweb_original__;return e},Fa="console",au="__posthogHandledLogsRequestError",Sn=(e,t)=>{let i=e instanceof Error?e:new Error(t);return i[au]=!0,i},Oa=e=>!!e&&typeof e=="object"&&e[au]===!0,Ps=re("[NetworkMetrics]"),$r=()=>{var e;return!(b==null||(e=b.performance)===null||e===void 0)&&e.now?b.performance.now():Date.now()},Uf={"http:":80,"https:":443},zf=new Set(["CONNECT","DELETE","GET","HEAD","OPTIONS","PATCH","POST","PUT","TRACE"]),lu=(e,t)=>{var i;let s=String(t);return{method:String(e).toUpperCase(),url:((i=nt(s))===null||i===void 0?void 0:i.href)||s}},ir=(e,t,i,s,n,r,o=!1)=>{try{var a,l;let c=n();if(!c)return;let u=i||void 0,d=$r()-s,h=nt(t.url);if(h&&h.protocol!=="http:"&&h.protocol!=="https:")return;let p={url:(h==null?void 0:h.href)||t.url,method:t.method},v=le(c.name)?c.name(p):H(c.name)?c.name:"http.client.request.duration";if(!v)return;let _=o&&!u?void 0:((y,m)=>y?400>y?void 0:String(y):(m==null?void 0:m.name)||"_OTHER")(u,r),g=f(f(f(f(f({},(y=>{let m=zf.has(y)?y:"_OTHER";return f({"http.request.method":m},m==="_OTHER"&&y!==m?{"http.request.method_original":y}:{})})(p.method)),h?(y=>{return{"server.address":y.hostname.startsWith("[")&&y.hostname.endsWith("]")?y.hostname.slice(1,-1):y.hostname,"server.port":Number(y.port)||Uf[y.protocol],"url.scheme":y.protocol.slice(0,-1),"url.template":(m=y.pathname,m.split("/").map(w=>(P=>/^\d+$/.test(P)||P.length>=8&&/^[0-9a-f-]*\d[0-9a-f-]*$/i.test(P))(w)?":id":w).join("/"))};var m})(h):{}),u?{"http.response.status_code":u}:{}),_?{"error.type":_}:{}),(a=c.attributes)===null||a===void 0?void 0:a.call(c,p,{status:u,durationMs:d}));(l=e.metrics)===null||l===void 0||l.histogram(v,d,{unit:"ms",attributes:g})}catch(c){Ps.error("Failed to record network metric",c)}},cu=()=>{},Gf=(e,t)=>le(b==null?void 0:b.fetch)?ti(b,"fetch",i=>function(...s){let n=$r(),r=i.apply(this,s);if(!t())return r;try{var o,a,l;let[c,u]=s,d=lu((o=(a=u==null?void 0:u.method)!==null&&a!==void 0?a:c==null?void 0:c.method)!==null&&o!==void 0?o:"GET",(l=c==null?void 0:c.url)!==null&&l!==void 0?l:c);return r.then(h=>(ir(e,d,h==null?void 0:h.status,n,t,void 0,!0),h),h=>{throw ir(e,d,void 0,n,t,h),h})}catch(c){return Ps.error("Failed to observe fetch",c),r}}):cu,qf=(e,t)=>{var i;let s=b==null||(i=b.XMLHttpRequest)===null||i===void 0?void 0:i.prototype;if(!s)return cu;let n=new WeakMap,r=ti(s,"open",a=>function(...l){try{Hc.has(this)||n.set(this,lu(l[0],l[1]))}catch(c){Ps.error("Failed to observe XHR open",c)}return a.apply(this,l)}),o=ti(s,"send",a=>function(...l){let c;try{let u=n.get(this);if(u&&t()){let d=$r();c=()=>{this.removeEventListener("loadend",c),ir(e,u,this.status,d,t)},G(this,"loadend",c)}}catch(u){Ps.error("Failed to observe XHR send",u)}try{return a.apply(this,l)}catch(u){throw c&&this.removeEventListener("loadend",c),u}});return()=>{r(),o()}},Ra=new WeakMap,Zf={maxStringLength:2048,truncationSuffix:"..."};function La(e){if(e)return e===!0?{intent:!0,model:!0}:{intent:e.intent!==!1,model:e.model!==!1}}function ht(e,t){return{}.hasOwnProperty.call(e,t)}function En(e,t){let i=Object.create(e);return t&&Object.defineProperty(i,"inputSchema",{configurable:!0,enumerable:!0,writable:!0,value:t}),i}function Da(e,t,i=!1){if(!H(e))return;let s=e.trim();return s?(i?Ph(s,Zf):s).slice(0,t):void 0}function Na(e){try{return j(e)&&e.isError===!0}catch{return!1}}var As={featureFlags:class extends Lf{constructor(e){let t=new Df(e.config,e.il());super(t),this.name="featureFlags",this._instance=e,this.gv=t}get Ad(){return this._instance.persistence}updateConfig(e,t){this.gv.update(e,t),this.Fd()}}},Yf={sessionRecording:class{get Mr(){return this._instance.config}get Il(){return this._instance.persistence}get started(){var e;return!!(!((e=this.mv)===null||e===void 0)&&e.isStarted)}get status(){var e,t;return this.yv==="awaiting_config"||this.yv==="missing_config"?this.yv:(e=(t=this.mv)===null||t===void 0?void 0:t.status)!==null&&e!==void 0?e:this.yv}constructor(e){if(this._instance=e,this._forceAllowLocalhostNetworkCapture=!1,this.yv=bn,this.bv=void 0,this._v=!1,this.Je=(()=>{var t,i;if(!(E!=null&&E.visibilityState)||E.visibilityState==="visible")return!0;let s=b==null||(t=b.performance)===null||t===void 0||(i=t.getEntriesByType)===null||i===void 0?void 0:i.call(t,"visibility-state");return!(s!=null&&s.length)||s.some(n=>n.name==="visible")})(),this.sn=()=>{var t,i;(E==null?void 0:E.visibilityState)==="visible"&&(this.Je=!0,(t=this.mv)===null||t===void 0||(i=t.setDocumentWasEverVisible)===null||i===void 0||i.call(t,!0))},!this._instance.sessionManager)throw Ke.error("started without valid sessionManager"),new Error("[SessionRecording] started without valid sessionManager. This is a bug.");if(this.Mr.cookieless_mode==="always")throw new Error('[SessionRecording] cannot be used with cookieless_mode="always"');E!=null&&E.addEventListener&&G(E,"visibilitychange",this.sn)}initialize(){this.startIfEnabledOrStop()}dispose({discardBufferedEvents:e=!1}={}){var t;this._v=!0,E==null||(t=E.removeEventListener)===null||t===void 0||t.call(E,"visibilitychange",this.sn),e?this.wv(!0):this.stopRecording()}get Sv(){var e;let t=!!(!((e=this._instance.get_property("$session_recording_remote_config"))===null||e===void 0)&&e.enabled),i=!this.Mr.disable_session_recording,s=this.Mr.disable_session_recording||this._instance.consent.isOptedOut();return b&&t&&i&&!s}startIfEnabledOrStop(e){var t;if(this._v||this.Sv&&(!((t=this.mv)===null||t===void 0)&&t.isStarted))return;let i=!x(Object.assign)&&!x(Array.from);this.Sv&&i?(this.xv(e),Ke.info("starting")):(this.yv=bn,this.stopRecording())}xv(e){var t,i;if(this.Sv)if(this.yv!=="awaiting_config"&&this.yv!=="missing_config"&&(this.yv=ya),(F==null||(t=F.__PosthogExtensions__)===null||t===void 0||(t=t.rrweb)===null||t===void 0?void 0:t.record)&&((i=F.__PosthogExtensions__)===null||i===void 0?void 0:i.initSessionRecording))this.$v(e);else{var s,n;let r=this._instance.sessionManager;(s=F.__PosthogExtensions__)===null||s===void 0||(n=s.loadExternalDependency)===null||n===void 0||n.call(s,this._instance,this.Cv,o=>{if(!this._v&&this.Sv&&this._instance.sessionManager===r)return o?(this._instance.register_for_session({$sdk_debug_recording_script_not_loaded:!0}),Ke.error("could not load recorder",o)):void this.$v(e);this.yv="disabled"})}}stopRecording(){var e,t;(e=this.bv)===null||e===void 0||e.call(this),this.bv=void 0,(t=this.mv)===null||t===void 0||t.stop()}wv(e=!1){var t,i;(t=this.bv)===null||t===void 0||t.call(this),this.bv=void 0,(i=this.mv)===null||i===void 0||i.discard({discardProducerEvents:e})}Tv(){var e,t;(e=this.Il)===null||e===void 0||e.unregister("$session_is_sampled"),(t=this.Il)===null||t===void 0||t.unregister("$replay_sample_rate")}Iv(e,t){if(D(e))return null;let i=oe(e)?e:parseFloat(e);return typeof(s=i)!="number"||!Number.isFinite(s)||0>s||s>1?(Ke.warn(`${t} must be between 0 and 1. Ignoring invalid value:`,e),null):i;var s}Mv(e){if(this.Il){var t,i;let s=this.Il,n=()=>{var r;let o=e.sessionRecording===!1?void 0:e.sessionRecording,a=this.Iv((r=this.Mr.session_recording)===null||r===void 0?void 0:r.sampleRate,"session_recording.sampleRate"),l=this.Iv(o==null?void 0:o.sampleRate,"remote config sampleRate"),c=a!=null?a:l;D(c)&&this.Tv();let u=o==null?void 0:o.minimumDurationMilliseconds;s.register({[ki]:f(f({cache_timestamp:Date.now(),enabled:!!o},o),{},{networkPayloadCapture:f({capturePerformance:e.capturePerformance},o==null?void 0:o.networkPayloadCapture),canvasRecording:{enabled:o==null?void 0:o.recordCanvas,fps:o==null?void 0:o.canvasFps,quality:o==null?void 0:o.canvasQuality},sampleRate:c,minimumDurationMilliseconds:x(u)?null:u,endpoint:o==null?void 0:o.endpoint,triggerMatchType:o==null?void 0:o.triggerMatchType,masking:o==null?void 0:o.masking,urlTriggers:o==null?void 0:o.urlTriggers,version:o==null?void 0:o.version,triggerGroups:o==null?void 0:o.triggerGroups})})};n(),(t=this.bv)===null||t===void 0||t.call(this),this.bv=(i=this._instance.sessionManager)===null||i===void 0?void 0:i.onSessionId(n)}}onRemoteConfig(e){let t=e.ok?e.config:void 0;return t&&"sessionRecording"in t?t.sessionRecording===!1?(this.Mv(t),void this.wv()):(this.Mv(t),void this.startIfEnabledOrStop()):(this.yv==="awaiting_config"&&(this.yv="missing_config",this._instance.register_for_session({[vr]:!0}),Ke.warn("config refresh failed, recording will not start until page reload")),void this.startIfEnabledOrStop())}log(e,t="log"){var i;!((i=this.mv)===null||i===void 0)&&i.log?this.mv.log(e,t):Ke.warn("log called before recorder was ready")}get Cv(){var e,t;let i=(e=this._instance)===null||e===void 0||(e=e.persistence)===null||e===void 0?void 0:e.get_property(ki);return(i==null||(t=i.scriptConfig)===null||t===void 0?void 0:t.script)||"lazy-recorder"}Ev(){let e=this._instance.get_property(ki);if(!e)return!1;let t;try{t=typeof e=="object"?e:JSON.parse(e)}catch(i){return Ke.warn("persisted remote config for session recording is invalid and will be ignored",i),!1}return!D(t.cache_timestamp)&&36e5>=Date.now()-t.cache_timestamp}$v(e){var t,i,s;if(!this._v&&this.Sv&&this._instance.sessionManager){if(!(!((t=F.__PosthogExtensions__)===null||t===void 0)&&t.initSessionRecording))return Ke.warn("Called on script loaded before session recording is available. This can be caused by adblockers."),void this._instance.register_for_session({[fr]:!0});var n;if(this.mv||(this.mv=(n=F.__PosthogExtensions__)===null||n===void 0?void 0:n.initSessionRecording(this._instance,this.Je),this.mv._forceAllowLocalhostNetworkCapture=this._forceAllowLocalhostNetworkCapture),!this.Ev())return this.yv==="missing_config"||this.yv==="awaiting_config"?void 0:(this.yv="awaiting_config",Ke.info("persisted remote config is stale, requesting fresh config before starting"),void new Lc(this._instance).load());this.yv=ya,(i=(s=this.mv).setDocumentWasEverVisible)===null||i===void 0||i.call(s,this.Je),this.mv.start(e)}else this.yv=bn}onRRwebEmit(e){var t,i;(t=this.mv)===null||t===void 0||(i=t.onRRwebEmit)===null||i===void 0||i.call(t,e)}overrideLinkedFlag(){var e,t;this.mv||(t=this.Il)===null||t===void 0||t.register({$replay_override_linked_flag:!0}),(e=this.mv)===null||e===void 0||e.overrideLinkedFlag()}overrideSampling(){var e,t;this.mv||(t=this.Il)===null||t===void 0||t.register({$replay_override_sampling:!0}),(e=this.mv)===null||e===void 0||e.overrideSampling()}overrideTrigger(e){var t,i;this.mv||(i=this.Il)===null||i===void 0||i.register({[e==="url"?"$replay_override_url_trigger":"$replay_override_event_trigger"]:!0}),(t=this.mv)===null||t===void 0||t.overrideTrigger(e)}get sdkDebugProperties(){var e;let t={};for(let s of Ef){var i;let n=(i=this._instance.sessionPersistence)===null||i===void 0?void 0:i.get_property(s);x(n)||(t[s]=n)}return f(f({},t),((e=this.mv)===null||e===void 0?void 0:e.sdkDebugProperties)||{$recording_status:this.status})}tryAddCustomEvent(e,t){var i;return!!(!((i=this.mv)===null||i===void 0)&&i.tryAddCustomEvent(e,t))}flushBeforeIdentityReset(){var e,t;(e=this.mv)===null||e===void 0||(t=e.flushBeforeIdentityReset)===null||t===void 0||t.call(e)}}},Xf={autocapture:class extends bf{constructor(e){super(new wf(e)),this.instance=e}},historyAutocapture:class{constructor(e){this.Pv=!1,this._instance=e,this.Rv=this.Av()}initialize(){this.startIfEnabled()}get isEnabled(){let e=this.Fv();return!!(e.path||e.search||this.Ov(e))}startIfEnabled(){this.isEnabled&&(M.info("History API monitoring enabled, starting..."),this.monitorHistoryChanges())}startIfEnabledOrStop(){this.stop(),this.Rv=this.Av(),this.startIfEnabled()}stop(){this.Dv&&this.Dv(),this.Dv=void 0,this.Lv&&this.Lv(),this.Lv=void 0,M.info("History API monitoring stopped")}monitorHistoryChanges(){b&&b.history&&(this.Nv("pushState"),this.Nv("replaceState"),this.qv(),this.Ov()&&this.jv())}Nv(e){var t;if(!b||!((t=b.history[e])===null||t===void 0)&&t.__posthog_wrapped__)return;let i=this;ti(b.history,e,s=>function(n,r,o){var a;i.Bv(o)&&i.zv(),s.call(this,n,r,o),i.Hv(e,!i.Pv&&(b==null||(a=b.event)===null||a===void 0?void 0:a.type)!=="popstate")})}Av(){let e=b==null?void 0:b.location;if(e!=null&&e.pathname)return{pathname:e.pathname,search:e.search,hash:e.hash}}Fv(){let e=this._instance.config.capture_pageview;return e==="history_change"?{path:!0}:j(e)?e:{}}Ov(e=this.Fv()){return!!e.hash&&!this._instance.config.disable_capture_url_hashes}Uv(e){let t=this.Fv(),i=this.Rv;return!(!i||!(t.path&&e.pathname!==i.pathname||t.search&&e.search!==i.search||this.Ov(t)&&e.hash!==i.hash))}Hv(e,t=!1){try{t||this.zv();let i=this.Av();if(!i)return;if(this.Uv(i)){let s=()=>this._instance.capture(_r,{navigation_type:e});t?(this.Wv=s,Promise.resolve().then(()=>this.zv())):s()}this.Rv=i}catch(i){M.error(`Error capturing ${e} pageview`,i)}}Bv(e){var t,i;return!(D(e)||!b)&&((t=nt(String(e)))===null||t===void 0?void 0:t.href)!==((i=b.location)===null||i===void 0?void 0:i.href)}zv(){let e=this.Wv;if(e){this.Wv=void 0,this.Pv=!0;try{e()}catch(t){M.error("Error capturing deferred pageview",t)}finally{this.Pv=!1}this.Rv=this.Av()}}qv(){if(this.Dv)return;let e=()=>{this.Hv("popstate")};G(b,"popstate",e),this.Dv=()=>{b&&b.removeEventListener("popstate",e)}}jv(){if(this.Lv)return;let e=()=>{this.Hv("hashchange")};G(b,"hashchange",e),this.Lv=()=>{b&&b.removeEventListener("hashchange",e)}}},heatmaps:class{get Mr(){return this.instance.config}constructor(e){var t;this.Vv=!1,this.ko=!1,this.Gv=null,this.instance=e,this.Vv=!!(!((t=this.instance.persistence)===null||t===void 0)&&t.props[Nn]),this.rageclicks=new ru(e.config.rageclick)}initialize(){this.startIfEnabled()}get flushIntervalMilliseconds(){let e=5e3;return j(this.Mr.capture_heatmaps)&&this.Mr.capture_heatmaps.flush_interval_milliseconds&&(e=this.Mr.capture_heatmaps.flush_interval_milliseconds),e}get isEnabled(){return D(this.Mr.capture_heatmaps)?D(this.Mr.enable_heatmaps)?this.Vv:this.Mr.enable_heatmaps:this.Mr.capture_heatmaps!==!1}startIfEnabled(){if(this.isEnabled){if(this.ko)return;$f.info("starting..."),this.Qv(),this.sn()}else{var e;clearInterval((e=this.Gv)!==null&&e!==void 0?e:void 0),this.Zv(),this.getAndClearBuffer()}}onRemoteConfig(e){if(!e.ok)return;let t=e.config;if(!("heatmaps"in t))return;let i=!!t.heatmaps;this.instance.persistence&&this.instance.persistence.register({[Nn]:i}),this.Vv=i,this.startIfEnabled()}getAndClearBuffer(){let e=this.Rt;return this.Rt=void 0,e}Jv(e){wn(e.originalEvent)&&this.Ir(e.originalEvent,"deadclick")}sn(){this.Gv&&clearInterval(this.Gv),this.Gv=(E==null?void 0:E.visibilityState)==="visible"?setInterval(this.fl.bind(this),this.flushIntervalMilliseconds):null}Qv(){b&&E&&(this.Kv=this.fl.bind(this),G(b,ys,this.Kv),this.Xv=e=>this.Ir(e||(b==null?void 0:b.event)),G(E,"click",this.Xv,{capture:!0}),this.Yv=e=>this.tf(e||(b==null?void 0:b.event)),G(E,"mousemove",this.Yv,{capture:!0}),this.ef=new qo(this.instance,Sp,this.Jv.bind(this)),this.ef.startIfEnabledOrStop(),this.if=this.sn.bind(this),G(E,Fi,this.if),this.ko=!0)}Zv(){var e;b&&E&&(this.Kv&&b.removeEventListener(ys,this.Kv),this.Xv&&E.removeEventListener("click",this.Xv,{capture:!0}),this.Yv&&E.removeEventListener("mousemove",this.Yv,{capture:!0}),this.if&&E.removeEventListener(Fi,this.if),clearTimeout(this.nf),(e=this.ef)===null||e===void 0||e.stop(),this.ko=!1)}sf(e,t){let i=this.instance.scrollManager.scrollY(),s=this.instance.scrollManager.scrollX(),n=this.instance.scrollManager.scrollElement(),r=(function(o,a,l){let c=o;for(;c&&We(c)&&!_e(c,"body");){if(c===l)return!1;let p;try{var u,d,h;p=(u=(d=(h=c.ownerDocument)===null||h===void 0?void 0:h.defaultView)!==null&&d!==void 0?d:b)===null||u===void 0?void 0:u.getComputedStyle(c).position}catch{return!1}if(O(a,p))return!0;c=_c(c)}return!1})(Ei(e),["fixed","sticky"],n);return{x:e.clientX+(r?0:s),y:e.clientY+(r?0:i),target_fixed:r,type:t}}Ir(e,t="click"){var i;if(Lo(e.target)||!wn(e))return;let s=this.sf(e,t);!((i=this.rageclicks)===null||i===void 0)&&i.isRageClick(e.clientX,e.clientY,new Date().getTime())&&yc(Ei(e),this.instance.config.rageclick)&&this.Qs(f(f({},s),{},{type:"rageclick"})),this.Qs(s)}tf(e){!Lo(e.target)&&wn(e)&&(clearTimeout(this.nf),this.nf=setTimeout(()=>{this.Qs(this.sf(e,"mousemove"))},500))}Qs(e){if(!b)return;let t=this.Mr.disable_capture_url_hashes?yt(b.location.href):b.location.href,i=this.Mr.custom_personal_data_properties,s=this.Mr.mask_personal_data_properties?[...Qt,...i||[]]:[],n=Ri(t,s,Li);this.Rt=this.Rt||{},this.Rt[n]||(this.Rt[n]=[]),this.Rt[n].push(e)}fl(){this.Rt&&!Me(this.Rt)&&this.instance.capture("$$heatmap",{$heatmap_data:this.getAndClearBuffer()})}},deadClicksAutocapture:qo,webVitalsAutocapture:class{constructor(e){var t;this._instance=e,this.Vv=!1,this.ko=!1,this.Rt={navigationKey:void 0,url:void 0,metrics:[],firstMetricTimestamp:void 0},this.rf=()=>{clearTimeout(this.af),this.af=void 0,this.Rt.metrics.length!==0&&(this._instance.capture("$web_vitals",f({$current_url:this.Rt.url},this.Rt.metrics.reduce((i,s)=>f(f({},i),{},{[`$web_vitals_${s.name}_event`]:f({},s),[`$web_vitals_${s.name}_value`]:s.value}),{}))),this.Rt={navigationKey:void 0,url:void 0,metrics:[],firstMetricTimestamp:void 0})},this.lf=i=>{var s;if(this.Rt=this.Rt||{navigationKey:void 0,url:void 0,metrics:[],firstMetricTimestamp:void 0},D(i==null?void 0:i.name)||D(i==null?void 0:i.value))return void St.error("Invalid metric received",i);let n=typeof i.navigationURL=="string"?i.navigationURL:void 0,r=this.uf(n);if(x(r))return;let o=oe(i.navigationId)||typeof i.navigationId=="string"?`navigation:${i.navigationId}`:`url:${r}`;if(this.cf&&i.value>=this.cf)return void St.error("Ignoring metric with value >= "+this.cf,i);this.Rt.navigationKey!==o&&(this.rf(),this.af=setTimeout(this.rf,this.flushToCaptureTimeoutMs)),x(this.Rt.navigationKey)&&(this.Rt.navigationKey=o,this.Rt.url=r),this.Rt.firstMetricTimestamp=x(this.Rt.firstMetricTimestamp)?Date.now():this.Rt.firstMetricTimestamp;let a=(s=this._instance.sessionManager)===null||s===void 0?void 0:s.checkAndGetSessionAndWindowId(!0),l=f(f(f({},i),n?{navigationURL:r}:{}),{},{$current_url:r,timestamp:Date.now()});if(delete l.entries,j(i.attribution)&&this.attributionMetrics.indexOf(i.name)>-1){let c={};for(let u of Sf){let d=u==="url"&&typeof i.attribution[u]=="string"?this.uf(i.attribution[u]):i.attribution[u];x(d)||(c[u]=d)}l.attribution=c}else delete l.attribution;x(a)||(l.$session_id=a.sessionId,l.$window_id=a.windowId),this.Rt.metrics.push(l),this.Rt.metrics.length===this.allowedMetrics.length&&this.rf()},this.hf=()=>{if(this.ko)return;let i,s,n,r,o=!1,a=F.__PosthogExtensions__,l=a==null?void 0:a.postHogWebVitalsCallbacksByFlavor,c=(l==null?void 0:l[this.df])||(this.df==="web-vitals"&&x(l)?a==null?void 0:a.postHogWebVitalsCallbacks:void 0);if(!x(c)){let h=c.withoutAttribution,p=this.attributionMetrics;o=!x(h),i=p.indexOf("LCP")>-1?c.onLCP:(h==null?void 0:h.onLCP)||c.onLCP,s=p.indexOf("CLS")>-1?c.onCLS:(h==null?void 0:h.onCLS)||c.onCLS,n=p.indexOf("FCP")>-1?c.onFCP:(h==null?void 0:h.onFCP)||c.onFCP,r=p.indexOf("INP")>-1?c.onINP:(h==null?void 0:h.onINP)||c.onINP}if(!(i&&s&&n&&r))return void St.error("web vitals callbacks not loaded - not starting");let u={reportSoftNavs:this.useSoftNavs},d=o&&this.attributionMetrics.indexOf("INP")>-1?f(f({},u),{},{includeProcessedEventEntries:!1}):u;this.allowedMetrics.indexOf("LCP")>-1&&i(this.lf.bind(this),u),this.allowedMetrics.indexOf("CLS")>-1&&s(this.lf.bind(this),u),this.allowedMetrics.indexOf("FCP")>-1&&n(this.lf.bind(this),u),this.allowedMetrics.indexOf("INP")>-1&&r(this.lf.bind(this),d),this.ko=!0},this.Vv=!!(!((t=this._instance.persistence)===null||t===void 0)&&t.props[Hn]),this.startIfEnabled()}get vf(){return this._instance.config.capture_performance}get allowedMetrics(){var e,t;let i=j(this.vf)?(e=this.vf)===null||e===void 0?void 0:e.web_vitals_allowed_metrics:void 0;return D(i)?((t=this._instance.persistence)===null||t===void 0?void 0:t.props.$web_vitals_allowed_metrics)||ma:i}get flushToCaptureTimeoutMs(){return(j(this.vf)?this.vf.web_vitals_delayed_flush_ms:void 0)||5e3}get attributionMetrics(){let e=j(this.vf)?this.vf.web_vitals_attribution:void 0;return Se(e)?e?ma:[]:R(e)?e:kf}get useAttribution(){return this.attributionMetrics.length>0}get useSoftNavs(){let e=j(this.vf)?this.vf.__preview_web_vitals_soft_navs:void 0;return e!=null&&e}get cf(){let e=j(this.vf)&&oe(this.vf.__web_vitals_max_value)?this.vf.__web_vitals_max_value:_a;return e>0&&6e4>=e?_a:e}get isEnabled(){let e=K==null?void 0:K.protocol;if(e!=="http:"&&e!=="https:")return St.info("Web Vitals are disabled on non-http/https protocols"),!1;let t=j(this.vf)?this.vf.web_vitals:Se(this.vf)?this.vf:void 0;return Se(t)?t:this.Vv}startIfEnabled(){this.isEnabled&&!this.ko&&(St.info("enabled, starting..."),this.zo(this.hf))}onRemoteConfig(e){if(!e.ok)return;let t=e.config;if(!("capturePerformance"in t))return;let i=j(t.capturePerformance)&&!!t.capturePerformance.web_vitals,s=j(t.capturePerformance)?t.capturePerformance.web_vitals_allowed_metrics:void 0;this._instance.persistence&&(this._instance.persistence.register({[Hn]:i}),this._instance.persistence.register({[zl]:s})),this.Vv=i,this.startIfEnabled()}get df(){return this.useSoftNavs?this.useAttribution?"web-vitals-with-attribution-soft-navs":"web-vitals-soft-navs":this.useAttribution?"web-vitals-with-attribution":"web-vitals"}zo(e){var t;let i=F.__PosthogExtensions__,s=this.df,n=i==null?void 0:i.postHogWebVitalsCallbacksByFlavor;n!=null&&n[s]||s==="web-vitals"&&x(n)&&(i!=null&&i.postHogWebVitalsCallbacks)?e():i==null||(t=i.loadExternalDependency)===null||t===void 0||t.call(i,this._instance,s,r=>{r?St.error("failed to load script",r):e()})}uf(e){let t=e||(b==null?void 0:b.location.href);if(!t)return void St.error("Could not determine current URL");let i=this._instance.config.disable_capture_url_hashes?yt(t):t,s=this._instance.config.custom_personal_data_properties,n=this._instance.config.mask_personal_data_properties?[...Qt,...s||[]]:[];return Ri(i,n,Li)}}},Jf={exceptionObserver:class{constructor(e){var t;this.hf=()=>{var i;if(!b||!this.isEnabled||!(!((i=F.__PosthogExtensions__)===null||i===void 0)&&i.errorWrappingFunctions))return;let s=F.__PosthogExtensions__.errorWrappingFunctions.wrapOnError,n=F.__PosthogExtensions__.errorWrappingFunctions.wrapUnhandledRejection,r=F.__PosthogExtensions__.errorWrappingFunctions.wrapConsoleError;try{!this.ff&&this.Mr.capture_unhandled_errors&&(this.ff=s(this.captureException.bind(this))),!this.pf&&this.Mr.capture_unhandled_rejections&&(this.pf=n(this.captureException.bind(this))),!this.gf&&this.Mr.capture_console_errors&&(this.gf=r(this.captureException.bind(this)))}catch(o){vi.error("failed to start",o),this.mf()}},this._instance=e,this.yf=!!(!((t=this._instance.persistence)===null||t===void 0)&&t.props[jn]),this.wt=new gd(f(f({},(function(i={}){var s,n,r,o;return{refillRate:(s=(n=i.exceptionRateLimiterRefillRate)!==null&&n!==void 0?n:i.__exceptionRateLimiterRefillRate)!==null&&s!==void 0?s:1,bucketSize:(r=(o=i.exceptionRateLimiterBucketSize)!==null&&o!==void 0?o:i.__exceptionRateLimiterBucketSize)!==null&&r!==void 0?r:10}})(this._instance.config.error_tracking)),{},{refillInterval:1e4,A:vi})),this.Mr=this.bf(),this.startIfEnabledOrStop()}bf(){let e=this._instance.config.capture_exceptions,t={capture_unhandled_errors:!1,capture_unhandled_rejections:!1,capture_console_errors:!1};return j(e)?t=f(f({},t),e):(x(e)?this.yf:e)&&(t=f(f({},t),{},{capture_unhandled_errors:!0,capture_unhandled_rejections:!0})),t}get isEnabled(){return this.Mr.capture_console_errors||this.Mr.capture_unhandled_errors||this.Mr.capture_unhandled_rejections}startIfEnabledOrStop(){this.isEnabled?(vi.info("enabled"),this.mf(),this.zo(this.hf)):this.mf()}zo(e){var t,i,s;!((t=F.__PosthogExtensions__)===null||t===void 0)&&t.errorWrappingFunctions?e():(i=F.__PosthogExtensions__)===null||i===void 0||(s=i.loadExternalDependency)===null||s===void 0||s.call(i,this._instance,"exception-autocapture",n=>{if(n)return vi.error("failed to load script",n);e()})}mf(){var e,t,i;(e=this.ff)===null||e===void 0||e.call(this),this.ff=void 0,(t=this.pf)===null||t===void 0||t.call(this),this.pf=void 0,(i=this.gf)===null||i===void 0||i.call(this),this.gf=void 0}onRemoteConfig(e){if(!e.ok)return;let t=e.config;"autocaptureExceptions"in t&&(this.yf=!!t.autocaptureExceptions||!1,this._instance.persistence&&this._instance.persistence.register({[jn]:this.yf}),this.Mr=this.bf(),this.startIfEnabledOrStop())}onConfigChange(){this.Mr=this.bf()}captureException(e){try{var t,i,s;let n=(t=e==null||(i=e.$exception_list)===null||i===void 0||(i=i[0])===null||i===void 0?void 0:i.type)!==null&&t!==void 0?t:"Exception";if(this.wt.consumeRateLimit(n))return void vi.info("Skipping exception capture because of client rate limiting.",{exception:n});(s=this._instance.exceptions)===null||s===void 0||s.sendExceptionEvent(e)}catch{}}},exceptions:class{constructor(e){var t,i;this._f=[],this.wf=new Md([new Wd,new Kd,new zd,new Ud,new Xd,new Yd,new qd,new Jd],(function(s,...n){return(r,o=0)=>{let a=[],l=r.split(`
3
- `),c=Math.min(l.length,o+1e3),u=[];for(let p=o;c>p;p++){let v=l[p];if(v.length>1024)continue;let _=go.test(v)?v.replace(go,"$1"):v;if(!_.match(/\S*Error: /)){for(let g of n){let y=g(_,s);if(y){a.push(y);let m=jd(a);if(m){for(let w=u.length-1;w>=0;w--){let P=u[w];if(m.start>=P.start+P.length)break;u.pop()}u.push(m)}break}}if(Hd(a,u)>=50)break}}let d=[...u].sort((p,v)=>v.start-p.start),h=d[d.length-1];if(h){let p=kl(a,h);a.splice(h.start-p,p);for(let v of d)v.start-=p}for(let p of d)Vd(a,p);return u.some(p=>p.start===0&&a.length===p.length)&&(function(p){let v=p.map(g=>`${g.function}|${g.filename}|${g.lineno}|${g.colno}|${g.module}`),_=0;for(let g=1;v.length>g;g++)Bd(v,g,_)&&(_=g);p.push(...p.splice(0,_))})(a),(function(p){if(!p.length)return[];let v=Array.from(p);return v.reverse(),v.slice(0,50).map(_=>{return f(f({},_),{},{filename:_.filename||(g=v,g[g.length-1]||{}).filename,function:_.function||"?"});var g})})(a)}})("web:javascript",Rd,Nd)),this._instance=e,this._f=(t=(i=this._instance.persistence)===null||i===void 0?void 0:i.get_property("$error_tracking_suppression_rules"))!==null&&t!==void 0?t:[],this.kf=fs(this.Sf()),this.xf=new eh(this.kf)}onConfigChange(){this.kf=fs(this.Sf()),this.xf.setConfig(this.kf)}onRemoteConfig(e){var t,i,s;if(!e.ok)return;let n=e.config;if(!("errorTracking"in n))return;let r=(t=(i=n.errorTracking)===null||i===void 0?void 0:i.suppressionRules)!==null&&t!==void 0?t:[],o=(s=n.errorTracking)===null||s===void 0?void 0:s.captureExtensionExceptions;this._f=r,this._instance.persistence&&this._instance.persistence.register({[Wl]:this._f,[Vn]:o})}get $f(){var e;let t=!!this._instance.get_property(Vn),i=this._instance.config.error_tracking.captureExtensionExceptions;return(e=i!=null?i:t)!==null&&e!==void 0&&e}buildProperties(e,t){return this.wf.buildFromUnknown(e,{syntheticException:t==null?void 0:t.syntheticException,mechanism:{handled:t==null?void 0:t.handled}})}addExceptionStep(e,t){if(this.kf.enabled)try{if(!H(e)||e.trim().length===0)return void je.warn("Ignoring exception step because message must be a non-empty string");let{sanitizedProperties:i,droppedKeys:s}=(function(n){if(!n)return{sanitizedProperties:{},droppedKeys:[]};let r=[];return{sanitizedProperties:Object.keys(n).reduce((o,a)=>Qd.has(a)?(r.push(a),o):(o[a]=n[a],o),{}),droppedKeys:r}})(this.Cf(t));s.length>0&&je.warn("Ignoring reserved exception step fields",{droppedKeys:s}),this.xf.add(f({[hs]:e,[ps]:new Date().toISOString()},i))}catch(i){je.error("Failed to add exception step. Ignoring breadcrumb.",i)}}sendExceptionEvent(e){try{let t=e.$exception_list;if(this.Tf(t)){if(this.If(t))return this.Mf("Exception dropped: matched a suppression rule"),void je.info("Skipping exception capture because a suppression rule matched");if(!this.$f&&this.Ef(t))return this.Mf("Exception dropped: thrown by a browser extension"),void je.info("Skipping exception capture because it was thrown by an extension");if(!this.$f&&this.Pf(t))return this.Mf("Exception dropped: thrown by an injected browser script"),void je.info("Skipping exception capture because it was thrown by an injected browser script");if(!this._instance.config.error_tracking.__capturePostHogExceptions&&this.Rf(t))return this.Mf("Exception dropped: thrown by the PostHog SDK"),void je.info("Skipping exception capture because it was thrown by the PostHog SDK")}let i=this.kf.enabled&&D(e.$exception_steps)?this.Af(e):e,s=(function(){let n=globalThis._posthogReleaseId;return typeof n=="string"&&n.length>0?n:void 0})();s&&(i.$release_id=s);try{let n=this._instance.capture("$exception",i,{_noTruncate:!0,_batchKey:"exceptionEvent",fc:!0});return n&&this.xf.clear(),n}catch(n){return Ia(n)||je.error("Failed to capture exception event. Dropping this exception.",n),void this.xf.clear()}}catch(t){return void(Ia(t)||je.error("Failed to process exception event. Ignoring this exception.",t))}}Af(e){try{let t=this.xf.getAttachable();return t.length===0?e:f(f({},e),{},{$exception_steps:t})}catch(t){return je.error("Failed to read buffered exception steps. Capturing exception without steps.",t),e}}Mf(e){this.kf.enabled&&this.xf.add({[hs]:e,[ps]:new Date().toISOString()})}Cf(e){return j(e)?f({},e):{}}Sf(){var e,t;return(e=(t=this._instance.config.error_tracking)===null||t===void 0?void 0:t.exception_steps)!==null&&e!==void 0?e:{}}If(e){if(e.length===0)return!1;try{let t=e.reduce((i,{type:s,value:n})=>(H(s)&&s.length>0&&i.$exception_types.push(s),H(n)&&n.length>0&&i.$exception_values.push(n),i),{$exception_types:[],$exception_values:[]});return this._f.some(i=>{let s=i.values.map(n=>{let r=tu[n.operator],o=t[n.key];if(!r||!o)return!1;let a=R(n.value)?n.value:[n.value];return a.length>0&&r(a,o)});return i.type==="OR"?s.some(Boolean):s.every(Boolean)})}catch(t){return je.warn("Failed to evaluate suppression rules. Capturing the exception.",t),!1}}Ef(e){let t=e.flatMap(s=>{var n,r;return(n=(r=s.stacktrace)===null||r===void 0?void 0:r.frames)!==null&&n!==void 0?n:[]}),i=t.filter(({filename:s})=>!!s&&jf.some(n=>s.startsWith(n)));return i.length!==0&&(!i.every(({filename:s})=>!!s&&s.startsWith(tr))||e.some(({type:s,value:n})=>s==="NoResponse"||H(n)&&Nf.some(({value:r,exact:o})=>o?n===r:n.includes(r)))&&!t.some(({in_app:s,filename:n})=>s&&!(n!=null&&n.startsWith(tr))))}Pf(e){return e.some(({value:t})=>H(t)&&Vf.some(i=>t.includes(i)))}Rf(e){if(e.length>0){var t,i,s,n;let r=(t=(i=e[0].stacktrace)===null||i===void 0?void 0:i.frames)!==null&&t!==void 0?t:[],o=r[r.length-1];return(s=o==null||(n=o.filename)===null||n===void 0?void 0:n.includes("posthog.com/static"))!==null&&s!==void 0&&s}return!1}Tf(e){return!D(e)&&R(e)}}},Kf=f({productTours:class{get Il(){return this._instance.persistence}constructor(e){this.Ff=null,this.Of=null,this._instance=e}initialize(){this.loadIfEnabled()}onRemoteConfig(e){if(!e.ok)return;let t=e.config;if("productTours"in t){var i,s;if(this.Il&&this.Il.register({[hr]:!!t.productTours}),!xn(this._instance))return!this.Ff&&D((i=this.Il)===null||i===void 0?void 0:i.props.ph_product_tours)||Qi.info("product tours disabled; stopping and clearing cached tours"),(s=this.Ff)===null||s===void 0||s.stop(),this.Ff=null,void this.clearCache();this.loadIfEnabled()}}loadIfEnabled(){!this.Ff&&xn(this._instance)&&this.zo(()=>this.Df())}zo(e){var t,i,s;!((t=F.__PosthogExtensions__)===null||t===void 0)&&t.generateProductTours?e():(i=F.__PosthogExtensions__)===null||i===void 0||(s=i.loadExternalDependency)===null||s===void 0||s.call(i,this._instance,"product-tours",n=>{n?Qi.error("Could not load product tours script",n):e()})}Df(){var e;!this.Ff&&(!((e=F.__PosthogExtensions__)===null||e===void 0)&&e.generateProductTours)&&(this.Ff=F.__PosthogExtensions__.generateProductTours(this._instance,!0))}getProductTours(e,t=!1){if(R(this.Of)&&!t)return void e(this.Of,{isLoaded:!0});let i=this.Il;if(i){let s=i.props[Bn];if(R(s)&&!t)return this.Of=s,void e(s,{isLoaded:!0})}this._instance._send_request({url:this._instance.requestRouter.endpointFor("api",`/api/product_tours/?token=${this._instance.config.token}`),method:"GET",timestampMode:"query",callback:s=>{if(!xn(this._instance))return void e([],{isLoaded:!0});let n=s.statusCode;if(n!==200||!s.json){let o=`Product Tours API could not be loaded, status: ${n}`;return n===0?s.error||Qi.warn(o):Qi.error(o),void e([],{isLoaded:!1,error:o})}let r=R(s.json.product_tours)?s.json.product_tours:[];this.Of=r,i&&i.register({[Bn]:r}),e(r,{isLoaded:!0})}})}getActiveProductTours(e){D(this.Ff)?e([],{isLoaded:!1,error:"Product tours not loaded"}):this.Ff.getActiveProductTours(e)}showProductTour(e){var t;(t=this.Ff)===null||t===void 0||t.showTourById(e)}previewTour(e){this.Ff?this.Ff.previewTour(e):this.zo(()=>{var t;this.Df(),(t=this.Ff)===null||t===void 0||t.previewTour(e)})}dismissProductTour(){var e;(e=this.Ff)===null||e===void 0||e.dismissTour("user_clicked_skip")}nextStep(){var e;(e=this.Ff)===null||e===void 0||e.nextStep()}previousStep(){var e;(e=this.Ff)===null||e===void 0||e.previousStep()}clearCache(){var e;this.Of=null,(e=this.Il)===null||e===void 0||e.unregister("ph_product_tours")}resetTour(e){var t;(t=this.Ff)===null||t===void 0||t.resetTour(e)}resetAllTours(){var e;(e=this.Ff)===null||e===void 0||e.resetAllTours()}cancelPendingTour(e){var t;(t=this.Ff)===null||t===void 0||t.cancelPendingTour(e)}}},As),Qf={siteApps:class{constructor(e){this._instance=e,this.Lf=0,this.Nf=[],this.apps={}}get isEnabled(){return!!this._instance.config.opt_in_site_apps}qf(e,t){if(!t)return;let i=this.globalsForEvent(t);this.Nf.push(i),this.Nf.length>1e3&&(this.Nf=this.Nf.slice(10))}get siteAppLoaders(){var e;return(e=F._POSTHOG_REMOTE_CONFIG)===null||e===void 0||(e=e[this._instance.config.token])===null||e===void 0?void 0:e.siteApps}initialize(){if(this.isEnabled){let e=this._instance._addCaptureHook(this.qf.bind(this));this.jf=()=>{e(),this.Nf=[],this.jf=void 0}}}globalsForEvent(e){var t,i,s,n,r,o,a;if(!e)throw new Error("Event payload is required");let l={},c=this._instance.get_property("$groups")||[],u=this._instance.get_property("$stored_group_properties")||{};for(let[p,v]of Object.entries(u))l[p]={id:c[p],type:p,properties:v};let{$set_once:d,$set:h}=e;return{event:f(f({},Pl(e,Pf)),{},{properties:f(f(f({},e.properties),h?{$set:f(f({},(t=(i=e.properties)===null||i===void 0?void 0:i.$set)!==null&&t!==void 0?t:{}),h)}:{}),d?{$set_once:f(f({},(s=(n=e.properties)===null||n===void 0?void 0:n.$set_once)!==null&&s!==void 0?s:{}),d)}:{}),elements_chain:(r=(o=e.properties)===null||o===void 0?void 0:o.$elements_chain)!==null&&r!==void 0?r:"",distinct_id:(a=e.properties)===null||a===void 0?void 0:a.distinct_id}),person:{properties:this._instance.get_property("$stored_person_properties")},groups:l}}Bf(e){var t;let i=(t=e.tagName)===null||t===void 0?void 0:t.toLowerCase();return i==="style"&&this._instance.config.prepare_external_dependency_stylesheet?this._instance.config.prepare_external_dependency_stylesheet(e)||(qe.error("prepare_external_dependency_stylesheet returned null"),null):i==="script"&&this._instance.config.prepare_external_dependency_script?this._instance.config.prepare_external_dependency_script(e)||(qe.error("prepare_external_dependency_script returned null"),null):e}zf(){var e,t,i,s,n,r,o,a;if(!this._instance.config.prepare_external_dependency_stylesheet&&!this._instance.config.prepare_external_dependency_script)return()=>{};let l=E==null?void 0:E.defaultView,c=l==null||(e=l.Node)===null||e===void 0?void 0:e.prototype;if(!l||!c)return()=>{};if(this.Lf++,this.Hf)return this.Uf();let u=[],d=this,h=new WeakSet,p=(g,y,m)=>{if(!(g!=null&&g[y]))return;let w=g[y];g[y]=m(w),u.push(()=>{g[y]=w})},v=g=>{if(h.has(g))return g;let y=d.Bf(g);return y&&h.add(y),y},_=g=>g.map(y=>typeof y=="string"?y:v(y)).filter(y=>!ne(y));return p(c,"appendChild",g=>function(y){let m=v(y);return m?g.call(this,m):y}),p(c,"insertBefore",g=>function(y,m){let w=v(y);return w?g.call(this,w,m):y}),p(c,"replaceChild",g=>function(y,m){let w=v(y);return w?g.call(this,w,m):m}),[(t=l.Element)===null||t===void 0?void 0:t.prototype,(i=l.Document)===null||i===void 0?void 0:i.prototype,(s=l.DocumentFragment)===null||s===void 0?void 0:s.prototype].forEach(g=>{p(g,"append",y=>function(...m){return y.apply(this,_(m))}),p(g,"prepend",y=>function(...m){return y.apply(this,_(m))})}),[(n=l.Element)===null||n===void 0?void 0:n.prototype,(r=l.CharacterData)===null||r===void 0?void 0:r.prototype,(o=l.DocumentType)===null||o===void 0?void 0:o.prototype].forEach(g=>{p(g,"before",y=>function(...m){return y.apply(this,_(m))}),p(g,"after",y=>function(...m){return y.apply(this,_(m))}),p(g,"replaceWith",y=>function(...m){let w=_(m);return m.length&&!w.length?void 0:y.apply(this,w)})}),p((a=l.Element)===null||a===void 0?void 0:a.prototype,"insertAdjacentElement",g=>function(y,m){let w=v(m);return w?g.call(this,y,w):null}),this.Hf=()=>{u.forEach(g=>g()),this.Hf=void 0},this.Uf()}Uf(){let e=!1;return()=>{var t;e||(e=!0,this.Lf--,this.Lf===0&&((t=this.Hf)===null||t===void 0||t.call(this)))}}Wf(e,t=!0){let i=this.zf();try{let s=e(i);return t&&i(),s}catch(s){throw i(),s}}setupSiteApp(e){let t=this.apps[e.id],i=()=>{var r;!t.errored&&this.Nf.length&&(qe.info(`Processing ${this.Nf.length} events for site app with id ${e.id}`),this.Nf.forEach(o=>this.Wf(()=>{var a;return(a=t.processEvent)===null||a===void 0?void 0:a.call(t,o)})),t.processedBuffer=!0),Object.values(this.apps).every(o=>o.processedBuffer||o.errored)&&((r=this.jf)===null||r===void 0||r.call(this))},s=!1,n=r=>{t.errored=!r,t.loaded=!0,qe.info(`Site app with id ${e.id} ${r?"loaded":"errored"}`),s&&i()};try{let{processEvent:r}=this.Wf(o=>e.init({posthog:this._instance,callback(a){o(),n(a)}}),!1);r&&(t.processEvent=r),s=!0}catch(r){qe.error(ba+e.id,r),n(!1)}if(s&&t.loaded)try{i()}catch(r){qe.error(`Error while processing buffered events PostHog app with config id ${e.id}`,r),t.errored=!0}}Vf(){let e=this.siteAppLoaders||[];for(let t of e)this.apps[t.id]={id:t.id,loaded:!1,errored:!1,processedBuffer:!1};for(let t of e)this.setupSiteApp(t)}Gf(e){if(Object.keys(this.apps).length===0)return;let t=this.globalsForEvent(e);for(let i of Object.values(this.apps))try{this.Wf(()=>{var s;return(s=i.processEvent)===null||s===void 0?void 0:s.call(i,t)})}catch(s){qe.error(`Error while processing event ${e.event} for site app ${i.id}`,s)}}onRemoteConfig(e){var t,i,s;if(!((t=this.siteAppLoaders)===null||t===void 0)&&t.length)return this.isEnabled?(this.Vf(),void this._instance.on("eventCaptured",a=>this.Gf(a))):void qe.error('PostHog site apps are disabled. Enable the "opt_in_site_apps" config to proceed.');if((i=this.jf)===null||i===void 0||i.call(this),!e.ok)return;let n=e.config;if(!((s=n.siteApps)===null||s===void 0)&&s.length)if(this.isEnabled)for(let{id:a,url:l}of n.siteApps){var r,o;F[`__$$ph_site_app_${a}`]=this._instance,(r=F.__PosthogExtensions__)===null||r===void 0||(o=r.loadSiteApp)===null||o===void 0||o.call(r,this._instance,l,c=>{if(c)return qe.error(ba+a,c)})}else qe.error('PostHog site apps are disabled. Enable the "opt_in_site_apps" config to proceed.')}}},ev={tracingHeaders:class{constructor(e){this._instance=e,this.Qf=void 0,this.Zf=void 0,this.Jf=void 0,this.hf=()=>{let t=this.Kf();var i,s;t?(x(this.Qf)&&(this.Qf=(i=F.__PosthogExtensions__)===null||i===void 0||(i=i.tracingHeadersPatchFns)===null||i===void 0?void 0:i._patchXHR(t,()=>this._instance.get_distinct_id(),this._instance.sessionManager)),x(this.Zf)&&(this.Zf=(s=F.__PosthogExtensions__)===null||s===void 0||(s=s.tracingHeadersPatchFns)===null||s===void 0?void 0:s._patchFetch(t,()=>this._instance.get_distinct_id(),this._instance.sessionManager))):this.mf()}}initialize(){this.startIfEnabledOrStop()}zo(e){var t,i,s;!((t=F.__PosthogExtensions__)===null||t===void 0)&&t.tracingHeadersPatchFns?e():(i=F.__PosthogExtensions__)===null||i===void 0||(s=i.loadExternalDependency)===null||s===void 0||s.call(i,this._instance,"tracing-headers",n=>{if(n)return xf.error("failed to load script",n);e()})}Xf(){var e,t;return(e=(t=this._instance.config.tracing_headers)!==null&&t!==void 0?t:this._instance.config.addTracingHeaders)!==null&&e!==void 0?e:this._instance.config.__add_tracing_headers}Kf(){let e=this.Xf();return R(e)?(R(this.Jf)?this.Jf.splice(0,this.Jf.length,...e):this.Jf=[...e],e.length>0?this.Jf:void 0):(R(this.Jf)&&this.Jf.splice(0),this.Jf=e||void 0,this.Jf)}mf(){var e,t;(e=this.Qf)===null||e===void 0||e.call(this),(t=this.Zf)===null||t===void 0||t.call(this),this.Qf=void 0,this.Zf=void 0}startIfEnabledOrStop(){this.Kf()?this.zo(this.hf):this.mf()}}},tv=f({surveys:class extends Mf{constructor(e){var t;super(new Ff(e),(t=e,{get projectToken(){return t.config.token},kv:new Cf(t)})),this._instance=e}Gc(e,t){let i=t.query?Ni(e,t.query):e;return new Promise(s=>{var n;this._instance._send_request({method:t.method,url:this._instance.requestRouter.endpointFor((n=t.target)!==null&&n!==void 0?n:"api",i),data:t.body,headers:t.headers,timeout:t.timeoutMs,fireCallbackOnDrop:!0,transport:t.transport,compression:t.compression,timestampMode:t.sentAt,callback:s})})}}},As),iv={toolbar:class{constructor(e){this.instance=e}Yf(e){F.ph_toolbar_state=e}tp(){var e;return(e=F.ph_toolbar_state)!==null&&e!==void 0?e:0}initialize(){return this.maybeLoadToolbar()}maybeLoadToolbar(e=void 0,t=void 0,i=void 0){var s,n;if(Un(this.instance.config)||!b||!E)return!1;e=(s=e)!==null&&s!==void 0?s:b.location,i=(n=i)!==null&&n!==void 0?n:b.history;try{if(!t){try{b.localStorage.setItem("test","test"),b.localStorage.removeItem("test")}catch{return!1}t=b==null?void 0:b.localStorage}let r=Of||ws(e.hash,"__posthog")||ws(e.hash,"state"),o,a=r?ho(()=>JSON.parse(atob(decodeURIComponent(r))))||ho(()=>JSON.parse(decodeURIComponent(r))):null;return a&&a.action==="ph_authorize"?(o=a,o.source="url",o&&Object.keys(o).length>0&&(a.desiredHash?e.hash=a.desiredHash:i?i.replaceState(i.state,"",e.pathname+e.search):e.hash="")):(o=JSON.parse(t.getItem(xa)||"{}"),o.source="localstorage",delete o.userIntent),!(!o.token||this.instance.config.token!==o.token||(this.loadToolbar(o),0))}catch{return!1}}ep(e){let t=F.ph_load_toolbar||F.ph_load_editor;!D(t)&&le(t)?t(e,this.instance):ka.warn("No toolbar load function found")}loadToolbar(e){let t=!!(E!=null&&E.getElementById("__POSTHOG_TOOLBAR__"));if(!b||t)return!1;let i=this.instance.requestRouter.region==="custom"&&this.instance.config.advanced_disable_toolbar_metrics,s=f(f({token:this.instance.config.token},e),{},{apiURL:this.instance.requestRouter.endpointFor("ui")},i?{instrument:!1}:{});if(b.localStorage.setItem(xa,JSON.stringify(f(f({},s),{},{source:void 0}))),this.tp()===2)this.ep(s);else if(this.tp()===0){var n,r;this.Yf(1),(n=F.__PosthogExtensions__)===null||n===void 0||(r=n.loadExternalDependency)===null||r===void 0||r.call(n,this.instance,"toolbar",o=>{if(o)return ka.error("[Toolbar] Failed to load",o),void this.Yf(0);this.Yf(2),this.ep(s)}),G(b,"turbolinks:load",()=>{this.Yf(0),this.loadToolbar(s)})}return!0}np(e){return this.loadToolbar(e)}maybeLoadEditor(e=void 0,t=void 0,i=void 0){return this.maybeLoadToolbar(e,t,i)}}},sv=f({experiments:class we{get Mr(){return this._instance.config}constructor(t){this._instance=t,this.getWebExperimentsAndEvaluateDisplayLogic=(i=!1)=>{this.getWebExperiments(s=>{we.sp("retrieved web experiments from the server"),this.rp=new Map,s.forEach(n=>{if(n.feature_flag_key){var r;this.rp&&(we.sp("setting flag key ",n.feature_flag_key," to web experiment ",n),(r=this.rp)===null||r===void 0||r.set(n.feature_flag_key,n));let o=this._instance.getFeatureFlag(n.feature_flag_key);H(o)&&n.variants[o]&&this.op(n.name,o,n.variants[o].transforms)}else if(n.variants)for(let o in n.variants){let a=n.variants[o];we.ap(a,this._instance)&&this.op(n.name,o,a.transforms)}})},i)},this._instance.onFeatureFlags(i=>{this.onFeatureFlags(i)})}initialize(){}onFeatureFlags(t){if(this._is_bot())we.sp(Aa);else if(!this.Mr.disable_web_experiments){if(D(this.rp))return this.rp=new Map,this.loadIfEnabled(),void this.previewWebExperiment();we.sp("applying feature flags",t),t.forEach(i=>{var s;if(this.rp&&(!((s=this.rp)===null||s===void 0)&&s.has(i))){var n;let r=this._instance.getFeatureFlag(i),o=(n=this.rp)===null||n===void 0?void 0:n.get(i);r&&(o!=null&&o.variants[r])&&this.op(o.name,r,o.variants[r].transforms)}})}}previewWebExperiment(){let t=we.getWindowLocation();if(t!=null&&t.search){let i=Kt(t==null?void 0:t.search,"__experiment_id"),s=Kt(t==null?void 0:t.search,"__experiment_variant");i&&s&&(we.sp(`previewing web experiments ${i} && ${s}`),this.getWebExperiments(n=>{this.lp(parseInt(i),s,n)},!1,!0))}}loadIfEnabled(){this.Mr.disable_web_experiments||this.getWebExperimentsAndEvaluateDisplayLogic()}getWebExperiments(t,i,s){if(this.Mr.disable_web_experiments&&!s)return t([]);let n=this._instance.get_property("$web_experiments");if(n&&!i)return t(n);this._instance._send_request({url:this._instance.requestRouter.endpointFor("api",`/api/web_experiments/?token=${this.Mr.token}`),method:"GET",timestampMode:"query",callback:r=>t(r.statusCode===200&&r.json&&r.json.experiments||[])})}lp(t,i,s){let n=s.filter(r=>r.id===t);n&&n.length>0&&(we.sp(`Previewing web experiment [${n[0].name}] with variant [${i}]`),this.op(n[0].name,i,n[0].variants[i].transforms))}static ap(t,i){return!D(t.conditions)&&we.up(t,i)&&we.cp(t)}static up(t,i){var s;if(D(t.conditions)||D((s=t.conditions)===null||s===void 0?void 0:s.url))return!0;let n=we.getWindowLocation();if(n){var r,o,a;let l=fc(i,n.href);return!(!((r=t.conditions)===null||r===void 0)&&r.url)||Hf[(o=(a=t.conditions)===null||a===void 0?void 0:a.urlMatchType)!==null&&o!==void 0?o:"icontains"](t.conditions.url,l)}return!1}static getWindowLocation(){return b==null?void 0:b.location}static cp(t){var i;if(D(t.conditions)||D((i=t.conditions)===null||i===void 0?void 0:i.utm))return!0;let s=Mc();if(s.utm_source){var n,r,o,a,l,c,u,d;let h=!(!((n=t.conditions)===null||n===void 0||(n=n.utm)===null||n===void 0)&&n.utm_campaign)||((r=t.conditions)===null||r===void 0||(r=r.utm)===null||r===void 0?void 0:r.utm_campaign)==s.utm_campaign,p=!(!((o=t.conditions)===null||o===void 0||(o=o.utm)===null||o===void 0)&&o.utm_source)||((a=t.conditions)===null||a===void 0||(a=a.utm)===null||a===void 0?void 0:a.utm_source)==s.utm_source,v=!(!((l=t.conditions)===null||l===void 0||(l=l.utm)===null||l===void 0)&&l.utm_medium)||((c=t.conditions)===null||c===void 0||(c=c.utm)===null||c===void 0?void 0:c.utm_medium)==s.utm_medium,_=!(!((u=t.conditions)===null||u===void 0||(u=u.utm)===null||u===void 0)&&u.utm_term)||((d=t.conditions)===null||d===void 0||(d=d.utm)===null||d===void 0?void 0:d.utm_term)==s.utm_term;return h&&v&&_&&p}return!1}static sp(t,...i){M.info(`[WebExperiments] ${t}`,i)}op(t,i,s){this._is_bot()?we.sp(Aa):i!=="control"?s.forEach(n=>{if(n.selector){var r;we.sp(`applying transform of variant ${i} for experiment ${t} `,n);let o=(r=document)===null||r===void 0?void 0:r.querySelectorAll(n.selector);o==null||o.forEach(a=>{let l=a;n.html&&(l.innerHTML=n.html),n.css&&l.setAttribute("style",n.css)})}}):we.sp("Control variants leave the page unmodified.")}_is_bot(){return pe&&this._instance?Kc(pe,this.Mr.custom_blocked_useragents):void 0}}},As),nv={conversations:class{constructor(e){this._instance=e,this.hp=void 0,this._conversationsManager=null,this.dp=!1,this.ne=null,this.vp=!1}initialize(){this.loadIfEnabled()}onRemoteConfig(e){if(this._instance.config.disable_conversations||(this.fp=e.ok,!e.ok))return;let t=e.config.conversations;D(t)||(Se(t)?this.hp=t:(this.hp=t.enabled,this.ne=t),this.loadIfEnabled())}reset(){var e;(e=this._conversationsManager)===null||e===void 0||e.reset(),this._conversationsManager=null,this.hp=void 0,this.ne=null,this.fp=void 0,this.vp=!1}loadIfEnabled(){if(this._conversationsManager||this.dp||this._instance.config.disable_conversations||Un(this._instance.config)||this._instance.config.cookieless_mode&&this._instance.consent.isOptedOut())return;let e=F==null?void 0:F.__PosthogExtensions__;if(e&&!x(this.hp)&&this.hp)if(this.ne&&this.ne.token){this.dp=!0;try{let t=e.initConversations;if(t)return this.pp(t),void(this.dp=!1);let i=e.loadExternalDependency;if(!i)return void this.gp(gr);i(this._instance,"conversations",s=>{s||!e.initConversations?this.gp("Could not load conversations script",s):this.pp(e.initConversations),this.dp=!1})}catch(t){this.gp("Error initializing conversations",t),this.dp=!1}}else Le.error("Conversations enabled but missing token in remote config.")}pp(e){if(this.ne)try{this._conversationsManager=e(this.ne,this._instance),this.vp=!1,Le.info("Conversations loaded successfully")}catch(t){this.gp("Error completing conversations initialization",t)}else Le.error("Cannot complete initialization: remote config is null")}gp(e,t){Le.error(e,t),this._conversationsManager=null,this.dp=!1,this.vp=!0}show(){this._conversationsManager?this._conversationsManager.show():Le.warn("Conversations not loaded yet.")}hide(){this._conversationsManager&&this._conversationsManager.hide()}isAvailable(){return this.hp===!0&&!ne(this._conversationsManager)}getUnavailableReason(){return this.isAvailable()?null:this._instance.config.disable_conversations?"disabled_by_config":Un(this._instance.config)?"disabled_for_toolbar":this._instance.config.cookieless_mode&&this._instance.consent.isOptedOut()?"consent_opted_out":this.fp===!1?"remote_config_failed":x(this.hp)?this.fp?"disabled_in_project":"remote_config_pending":this.hp?D(this.ne)||!this.ne.token?"missing_token":F!=null&&F.__PosthogExtensions__?this.dp?"initializing":this.vp?"load_failed":"not_loaded":"extensions_unavailable":"disabled_in_project"}isVisible(){var e,t;return(e=(t=this._conversationsManager)===null||t===void 0?void 0:t.isVisible())!==null&&e!==void 0&&e}sendMessage(e,t,i){var s=this;return ee(function*(){return s._conversationsManager?s._conversationsManager.sendMessage(e,t,i):(Le.warn($t),null)})()}getMessages(e,t){var i=this;return ee(function*(){return i._conversationsManager?i._conversationsManager.getMessages(e,t):(Le.warn($t),null)})()}markAsRead(e){var t=this;return ee(function*(){return t._conversationsManager?t._conversationsManager.markAsRead(e):(Le.warn($t),null)})()}getTickets(e){var t=this;return ee(function*(){return t._conversationsManager?t._conversationsManager.getTickets(e):(Le.warn($t),null)})()}requestRestoreLink(e){var t=this;return ee(function*(){return t._conversationsManager?t._conversationsManager.requestRestoreLink(e):(Le.warn($t),null)})()}restoreFromToken(e){var t=this;return ee(function*(){return t._conversationsManager?t._conversationsManager.restoreFromToken(e):(Le.warn($t),null)})()}restoreFromUrlToken(){var e=this;return ee(function*(){return e._conversationsManager?e._conversationsManager.restoreFromUrlToken():(Le.warn($t),null)})()}getCurrentTicketId(){var e,t;return(e=(t=this._conversationsManager)===null||t===void 0?void 0:t.getCurrentTicketId())!==null&&e!==void 0?e:null}getWidgetSessionId(){var e,t;return(e=(t=this._conversationsManager)===null||t===void 0?void 0:t.getWidgetSessionId())!==null&&e!==void 0?e:null}xc(){var e;(e=this._conversationsManager)===null||e===void 0||e.setIdentity()}$c(){var e;(e=this._conversationsManager)===null||e===void 0||e.clearIdentity()}}},rv={logs:class{constructor(e){var t;this._instance=e,this.name="logs",this.mp=!1,this.yp=!1,this.bp=!1,this.A=re("[logs]"),this._p=f(f({},this.A),{},{error:(...i)=>{i.some(Oa)||this.A.error(...i)}}),this.ol=[],this.wp=[],this.kd=0,this.To=!1,this.kp=[],this.Sp=[],this.xp=!1,this.$p=!1,this.Cp=()=>{var i,s;this.To||(this.kd=0,(i=this.Tp)===null||i===void 0||i.onReconnect(),(s=this.Ip)===null||s===void 0||s.onReconnect())},this._instance&&(!((t=this._instance.config.logs)===null||t===void 0)&&t.captureConsoleLogs)&&(this.mp=!0),b&&G(b,"online",this.Cp)}Mp(e,t,i,s){var n;let r=Ca((n=this._instance)===null||n===void 0||(n=n.config)===null||n===void 0?void 0:n.logs,i);return[new Lh(this.Ep(e,t),r,this._p,()=>this.Pp(),o=>o(),void 0,s),r]}Rp(){var e;let t=(e=this._instance)===null||e===void 0||(e=e.config)===null||e===void 0?void 0:e.logs;var i;return this.Tp&&this.Ap===t||((i=this.Tp)===null||i===void 0||i.reset(),this.Ap=t,[this.Tp,this.Fp]=this.Mp(()=>this.ol,s=>{this.ol=s})),this.Tp}Op(){var e;let t=(e=this._instance)===null||e===void 0||(e=e.config)===null||e===void 0?void 0:e.logs;var i;return this.Ip&&this.Dp===t||((i=this.Ip)===null||i===void 0||i.reset(),this.Dp=t,[this.Ip,this.Lp]=this.Mp(()=>this.wp,s=>{this.wp=s},{serviceNameDefault:"posthog-browser-logs",consoleCapture:!0},Fa)),this.Ip}setup(e){var t;if(this.To)return;this.bo=e,!((t=this._instance)===null||t===void 0||(t=t.config)===null||t===void 0||(t=t.logs)===null||t===void 0)&&t.captureConsoleLogs&&(this.mp=!0),(this.mp||this.Np()&&this.qp())&&this.jp();let i=!1,s=e.onRemoteConfig(n=>{var r;i=n.ok&&((r=n.config.logs)===null||r===void 0?void 0:r.captureConsoleLogs)===!0,this.onRemoteConfig(n)});this.To?s.dispose():(this.Eo=s,i||this.loadIfEnabled())}dispose(){var e,t,i,s;this.To||(this.To=!0,this.Bp(),(e=this.Eo)===null||e===void 0||e.dispose(),this.Eo=void 0,this.bo=void 0,this.bp=!1,b==null||b.removeEventListener("online",this.Cp),(t=this.zp)===null||t===void 0||t.call(this),this.zp=void 0,(i=this.Tp)===null||i===void 0||i.reset(),(s=this.Ip)===null||s===void 0||s.reset())}onRemoteConfig(e){var t,i;if(this.To)return;let s=e.ok?(t=e.config.logs)===null||t===void 0?void 0:t.captureConsoleLogs:void 0;D(s)?this.Hp():((i=this._instance)===null||i===void 0||(i=i.persistence)===null||i===void 0||i.register({$logs_capture_enabled_server_side:!!s}),s?(this.mp=!0,this.yp||this.jp(),this.loadIfEnabled()):this.Hp())}reset(){var e,t,i,s;this.Bp(),(e=this.Tp)===null||e===void 0||e.clearQueue(),this.ol=[],(t=this.Tp)===null||t===void 0||t.reset(),(i=this.Ip)===null||i===void 0||i.clearQueue(),this.wp=[],(s=this.Ip)===null||s===void 0||s.reset(),this.kd=0}captureLog(e){this.To||this.Rp().captureLog(e)}captureConsoleLog(e){this.To||this.Op().captureLog(e)}captureBufferedConsoleLog(e,t,i){this.To||this.Op().captureLog(e,{context:t,occurredAtMs:i})}qp(){var e;return!!(!((e=this._instance)===null||e===void 0||(e=e.persistence)===null||e===void 0||(e=e.props)===null||e===void 0)&&e[Ul])}Np(){var e,t,i;return!(!((e=this._instance)===null||e===void 0||(t=e.il)===null||t===void 0)&&t.call(e))||!!(!((i=F._POSTHOG_REMOTE_CONFIG)===null||i===void 0||(i=i[this._instance.config.token])===null||i===void 0)&&i.config)}Tc(){var e;this.Bp(),(e=this.Ip)===null||e===void 0||e.clearQueue(),this.wp=[]}Hp(){this.mp||this.Bp()}jp(){var e;if(this.xp||!(F!=null&&F.console))return;let t=Ca((e=this._instance)===null||e===void 0||(e=e.config)===null||e===void 0?void 0:e.logs).maxBufferSize,i=!0;this.Sp.push(()=>{i=!1});for(let s of Bf){let n;try{n=Wf(F.console[s])}catch{continue}n&&this.Sp.push(ti(F.console,s,r=>{let o=(...a)=>{try{i&&this.Up(s,a,t)}catch{}return r.apply(F.console,a)};return o.__rrweb_original__=n,o}))}this.xp=!0,this.Wp=setTimeout(()=>{this.Bp()},3e4)}Up(e,t,i){var s;if(this.xp&&!this.$p&&t.length!==0)if(!((s=this._instance)===null||s===void 0)&&s.is_capturing()){if(i>this.kp.length){this.$p=!0;try{this.kp.push({level:e,args:t,occurredAtMs:Date.now(),context:this.Pp()})}finally{this.$p=!1}}}else this.Bp()}Bp(){if(this.kp=[],this.xp){this.xp=!1,this.Wp&&(clearTimeout(this.Wp),this.Wp=void 0);for(let e of this.Sp)e();this.Sp=[]}}Vp(){let e=this.kp;return this.Bp(),e}get logger(){return this.Gp||(this.Gp={trace:(e,t)=>this.captureLog({body:e,level:"trace",attributes:t}),debug:(e,t)=>this.captureLog({body:e,level:"debug",attributes:t}),info:(e,t)=>this.captureLog({body:e,level:"info",attributes:t}),warn:(e,t)=>this.captureLog({body:e,level:"warn",attributes:t}),error:(e,t)=>this.captureLog({body:e,level:"error",attributes:t}),fatal:(e,t)=>this.captureLog({body:e,level:"fatal",attributes:t})}),this.Gp}flushLogs(e){e?this.Qp(e):(this.Tp&&this.Tp.flush().catch(t=>this.Zp(t)),this.Ip&&this.Ip.flush().catch(t=>this.Zp(t)))}Zp(e){Oa(e)||this.A.error("PostHog logs flush failed:",e)}loadIfEnabled(){if(this.To||!this.mp||this.yp||this.bp)return;let e=F==null?void 0:F.__PosthogExtensions__;if(!e)return this.A.error("PostHog Extensions not found."),void this.Bp();let t=e.loadExternalDependency;if(!t)return this.A.error(gr),void this.Bp();this.bp=!0;try{t(this._instance,"logs",i=>{if(this.bp=!1,this.To||!this.mp)return;let s=e.logs;if(i||!(s!=null&&s.initializeLogs))this.A.error("Could not load logs script",i),this.Bp();else{var n;let a=this.Vp();var r,o;this.zp=s.initializeLogs((n=this.bo)!==null&&n!==void 0?n:this._instance),this.yp=!0,a.length>0&&((r=s.replayConsoleBuffer)===null||r===void 0||r.call(s,(o=this.bo)!==null&&o!==void 0?o:this._instance,a))}})}catch(i){throw this.bp=!1,i}}Ep(e,t){let i=this._instance;return{get isDisabled(){return!1},get optedOut(){return!i.is_capturing()},getPersistedProperty:s=>s===Ye.LogsQueue?e():void 0,setPersistedProperty(s,n){var r;s===Ye.LogsQueue&&t((r=n)!==null&&r!==void 0?r:[])},js:s=>this.js(s),getLibraryId:()=>ue.LIB_NAME,getLibraryVersion:()=>ue.LIB_VERSION}}js(e){return new Promise(t=>{if($c(this.kd,3))return void t({kind:"fatal",error:Sn(void 0,"logs endpoint is unreachable, dropping batch")});let i=!1,s=r=>{i||(i=!0,clearTimeout(n),t(r))},n=setTimeout(()=>{this.A.warn("Logs request timed out before receiving a response"),s({kind:"retry-later",error:Sn(void 0,"logs request timed out")})},9e4);this._instance._send_request({method:"POST",url:this.Jp(),data:e,compression:"best-available",batchKey:"logs",fireCallbackOnDrop:!0,callback:r=>{let o=r.statusCode;if(this.Kp(o),o>=200&&300>o)s({kind:"ok"});else if(o===413)s({kind:"too-large"});else if(o!==0&&o!==408&&o!==429&&500>o)s({kind:"fatal",error:new Error(`logs request failed with status ${o}`)});else{var a;o===0?(r.error||this.A.warn("Logs request failed before receiving an HTTP response"),s({kind:"retry-later",error:Sn(r.error,"logs request failed before receiving an HTTP response")})):s({kind:"retry-later",error:(a=r.error)!==null&&a!==void 0?a:new Error(`logs request failed with status ${o}`)})}}})})}Kp(e){(e!==0||this._instance.__loaded)&&(this.kd=Pc(e,this.kd,3,()=>this.A.warn("Log requests are failing before receiving an HTTP response; this can happen due to network issues, CORS, browser blocking, or ad blockers. Stopped sending logs; will try again when connectivity changes.")))}Qp(e){this.ol.length>0&&this.Xp(e,this.ol,this.Fp,ue.LIB_NAME,t=>{this.ol=t}),this.wp.length>0&&this.Xp(e,this.wp,this.Lp,Fa,t=>{this.wp=t})}Xp(e,t,i,s,n){if(t.length===0)return;let r=t.map(a=>a.record);n([]);let o=Dl(r,Ll(i,ue.LIB_NAME,ue.LIB_VERSION),s,ue.LIB_VERSION);this._instance._send_request({method:"POST",url:this.Jp(),data:o,compression:"best-available",batchKey:"logs",transport:e})}Jp(){return this._instance.requestRouter.endpointFor("api","/i/v1/logs")+"?token="+encodeURIComponent(this._instance.config.token)}Pp(){var e;let t={};if(t.distinctId=this._instance.get_distinct_id(),this._instance.sessionManager){let{sessionId:i,windowId:s,sessionStartTimestamp:n,lastActivityTimestamp:r}=this._instance.sessionManager.checkAndGetSessionAndWindowId(!0);t.sessionId=i,t.windowId=s,D(n)||(t.sessionStartTimestamp=n),D(r)||(t.lastActivityTimestamp=r)}if(!(F==null||(e=F.location)===null||e===void 0)&&e.href&&(t.currentUrl=this._instance.config.disable_capture_url_hashes?yt(F.location.href):F.location.href),this._instance.featureFlags){let i=this._instance.featureFlags.getFlags();i&&i.length>0&&(t.activeFeatureFlags=i)}return t}}},ov={metrics:class{constructor(e){this._instance=e,this.A=re("[metrics]"),this.To=!1}initialize(){this.onConfigChange()}onConfigChange(){var e;if(this.To)return;let t=!!(!((e=this._instance.config.metrics)===null||e===void 0)&&e.network);t&&!this.Yp?this.Yp=(i=>{let s=!0,n=()=>s?(a=>{var l;let c=(l=a.config.metrics)===null||l===void 0?void 0:l.network;return c===!0?{}:c||void 0})(i):void 0,r=Gf(i,n),o=qf(i,n);return()=>{s=!1,r(),o()}})(this._instance):!t&&this.Yp&&(this.Yp(),this.Yp=void 0)}Rp(){var e;let t=(e=this._instance)===null||e===void 0||(e=e.config)===null||e===void 0?void 0:e.metrics;var i;return this.Tp&&this.Ap===t||((i=this.Tp)===null||i===void 0||i.reset(),this.Ap=t,this.Tp=new Dh(this.Ep(),(function(s){var n,r,o,a,l;let c=s==null?void 0:s.resourceAttributes;return{serviceName:(n=c==null?void 0:c["service.name"])!==null&&n!==void 0?n:s==null?void 0:s.serviceName,serviceVersion:(r=c==null?void 0:c["service.version"])!==null&&r!==void 0?r:s==null?void 0:s.serviceVersion,environment:(o=c==null?void 0:c["deployment.environment"])!==null&&o!==void 0?o:s==null?void 0:s.environment,resourceAttributes:c,beforeSend:s==null?void 0:s.beforeSend,flushIntervalMs:(a=s==null?void 0:s.flushIntervalMs)!==null&&a!==void 0?a:1e4,maxSeriesPerFlush:(l=s==null?void 0:s.maxSeriesPerFlush)!==null&&l!==void 0?l:1e3}})(t),this.A)),this.Tp}count(e,t=1,i){this.Rp().count(e,t,i)}gauge(e,t,i){this.Rp().gauge(e,t,i)}histogram(e,t,i){this.Rp().histogram(e,t,i)}flush(e){if(!this.Tp)return Promise.resolve();if(e){let t=this.Tp.drainWindow();return t&&this.Ys(t,e),Promise.resolve()}return this.Tp.flush().catch(t=>this.A.error("PostHog metrics flush failed:",t))}reset(){var e;(e=this.Tp)===null||e===void 0||e.reset()}dispose(){var e,t;this.To=!0,(e=this.Yp)===null||e===void 0||e.call(this),this.Yp=void 0,(t=this.Tp)===null||t===void 0||t.reset()}Ep(){let e=this._instance,t=this;return{get isDisabled(){return!1},get optedOut(){return!e.is_capturing()},Ys:i=>t.Ys(i),getLibraryId:()=>ue.LIB_NAME,getLibraryVersion:()=>ue.LIB_VERSION}}Ys(e,t){return new Promise(i=>{let s=!1,n=o=>{s||(s=!0,clearTimeout(r),i(o))},r=setTimeout(()=>n({kind:"retry-later",error:new Error("metrics request timed out")}),9e4);this._instance._send_request(f(f({method:"POST",url:this.tg(),data:e,compression:"best-available",batchKey:"metrics"},t&&{transport:t}),{},{fireCallbackOnDrop:!0,callback(o){let a=o.statusCode;if(a>=200&&300>a)n({kind:"ok"});else if(a===413)n({kind:"too-large"});else if(a!==0&&a!==408&&a!==429&&500>a)n({kind:"fatal",error:new Error(`metrics request failed with status ${a}`)});else{var l;n({kind:"retry-later",error:(l=o.error)!==null&&l!==void 0?l:new Error(`metrics request failed with status ${a}`)})}}}))})}tg(){return this._instance.requestRouter.endpointFor("api","/i/v1/metrics")+"?token="+encodeURIComponent(this._instance.config.token)}}},av={webMCP:class{constructor(e){this._instance=e,this.eg=!1}initialize(){this.startIfEnabled()}startIfEnabled(){if(!this._instance.config.capture_webmcp||this.eg)return;let e=E==null?void 0:E.modelContext;if(!e||!le(e.registerTool))return;let t=Ra.get(e);if(t)return t.instances.add(this._instance),void(this.eg=!0);let i={instances:new Set([this._instance])},s=e.registerTool,n=this;ti(e,"registerTool",r=>{let o=r;return function(a,...l){let c=a;try{c=n.ig(a,i)}catch{return o.call(this,a,...l)}return o.call(this,c,...l)}}),e.registerTool!==s&&(Ra.set(e,i),this.eg=!0)}ig(e,t){if(!e||!le(e.execute))return e;let i=e.execute,s=this,{tool:n,injected:r}=(function(o,a){let l={intent:!1,model:!1},c=o.inputSchema;if(c&&(ht(c,"$ref")||ht(c,"oneOf")||ht(c,"anyOf")||ht(c,"allOf")||c.additionalProperties===!0||j(c.additionalProperties)||c.type&&c.type!=="object"||c.properties&&!j(c.properties)||c.required&&!R(c.required))||!x(c)&&!j(c))return{tool:En(o),injected:l};let u=(c==null?void 0:c.properties)||{};if(l.intent=a.intent&&!ht(u,"context"),l.model=a.model&&!ht(u,"llm_model"),!l.intent&&!l.model)return{tool:En(o),injected:l};let d=f({},u),h=R(c==null?void 0:c.required)?[...c.required]:[];return l.intent&&(d.context={type:"string",description:`Explain why this tool is called and how it supports the user's goal. Describe the abstract purpose only. Do not include personal or identifying information. Generalize specific entities as roles such as "a customer".`},h.includes("context")||h.push("context")),l.model&&(d.llm_model={type:"string",description:'The exact model identifier you are running as, taken from your system prompt or environment. Pass "unknown" if you do not know it. Never guess.'},h.includes("llm_model")||h.push("llm_model")),{tool:En(o,f(f({},c),{},{type:(c==null?void 0:c.type)||"object",properties:d,required:h})),injected:l}})(e,(function(o){let a={intent:!1,model:!1};for(let l of o.instances){let c=La(l.config.capture_webmcp);a.intent||(a.intent=(c==null?void 0:c.intent)===!0),a.model||(a.model=(c==null?void 0:c.model)===!0)}return a})(t));return Object.defineProperty(n,"execute",{configurable:!0,enumerable:!0,writable:!0,value(...o){let a=new Date,l=(function(h,p){if(!j(h))return{};try{let v=p.intent?Da(h.context,2048,!0):void 0,_=p.model?Da(h.llm_model,256):void 0;return f(f({},v&&v!=="{}"?{intent:v}:{}),_&&_.toLowerCase()!=="unknown"?{model:_}:{})}catch{return{}}})(o[0],r),c=(function(h,p){let v=h[0];if(!j(v))return h;try{let _=p.intent&&ht(v,"context"),g=p.model&&ht(v,"llm_model");if(!_&&!g)return h;let y=f({},v);return _&&delete y.context,g&&delete y.llm_model,[y,...h.slice(1)]}catch{return h}})(o,r),u;try{u=i.apply(this===n?e:this,c)}catch(h){throw s.ng(t,n,a,!0,l),h}return(d=u)&&typeof d.then=="function"?Promise.resolve(u).then(h=>(s.ng(t,n,a,Na(h),l),h),h=>{throw s.ng(t,n,a,!0,l),h}):(s.ng(t,n,a,Na(u),l),u);var d}}),n}ng(e,t,i,s,n){let r=Date.now()-i.getTime();for(let o of e.instances){let a=La(o.config.capture_webmcp);if(a)try{o.capture("$mcp_tool_call",f(f({$mcp_source:"posthog_mcp_analytics",$mcp_interface:"webmcp",$mcp_tool_name:t.name,$mcp_resource_name:t.name,$mcp_tool_description:t.description,$mcp_server_name:K==null?void 0:K.hostname,$mcp_duration_ms:r,$mcp_is_error:s},a.intent&&n.intent?{$mcp_intent:n.intent,$mcp_intent_source:"context_parameter"}:{}),a.model&&n.model?{$mcp_llm_model:n.model,$mcp_llm_model_source:"self_reported"}:{}),{timestamp:i})}catch{continue}}}}};Ti.__defaultExtensionClasses=f({},f(f(f(f(f(f(f(f(f(f(f(f(f(f({},As),Yf),Xf),Jf),Kf),Qf),tv),ev),iv),sv),nv),rv),ov),av));var lv=(function(){ue.SDK_DIST_CHANNEL="npm";let e=Pi[mi]=new Ti;return(function(){function t(){t.done||(t.done=!0,Xc=!1,Z(Pi,function(i){i._dom_loaded()}))}E!=null&&E.addEventListener?E.readyState==="complete"?t():G(E,"DOMContentLoaded",t,{capture:!1}):b&&M.error("Browser doesn't support `document.addEventListener` so PostHog couldn't be initialized")})(),e})(),Te=lv;var ku="5.3.0";function cv(e,t){for(let i=0,s=e.length;i<s;++i)if(e[i]===t)return!0;return!1}function uv(e,t){return!cv(e,t)}function Cr(e){return parseInt(e)}function Ue(e){return parseFloat(e)}function rt(e,t){return typeof e=="number"&&isNaN(e)?t:e}function ve(e){return e.reduce((t,i)=>t+(i?1:0),0)}function Su(e,t=1){if(Math.abs(t)>=1)return Math.round(e/t)*t;{let i=1/t;return Math.round(e*i)/i}}function dv(e){var t,i;let s=`Unexpected syntax '${e}'`,n=/^\s*([a-z-]*)(.*)$/i.exec(e),r=n[1]||void 0,o={},a=/([.:#][\w-]+|\[.+?\])/gi,l=(c,u)=>{o[c]=o[c]||[],o[c].push(u)};for(;;){let c=a.exec(n[2]);if(!c)break;let u=c[0];switch(u[0]){case".":l("class",u.slice(1));break;case"#":l("id",u.slice(1));break;case"[":{let d=/^\[([\w-]+)([~|^$*]?=("(.*?)"|([\w-]+)))?(\s+[is])?\]$/.exec(u);if(d)l(d[1],(i=(t=d[4])!==null&&t!==void 0?t:d[5])!==null&&i!==void 0?i:"");else throw new Error(s);break}default:throw new Error(s)}}return[r,o]}function hv(e){let t=new Uint8Array(e.length);for(let i=0;i<e.length;i++){let s=e.charCodeAt(i);if(s>127)return new TextEncoder().encode(e);t[i]=s}return t}function pv(e){var t;return{name:e.name,message:e.message,stack:(t=e.stack)===null||t===void 0?void 0:t.split(`
4
- `),...e}}function fv(e){return/^function\s.*?\{\s*\[native code]\s*}$/.test(String(e))}function Eu(){let e=window,t=navigator;return ve(["MSCSSMatrix"in e,"msSetImmediate"in e,"msIndexedDB"in e,"msMaxTouchPoints"in t,"msPointerEnabled"in t])>=4}function vv(){let e=window,t=navigator;return ve(["msWriteProfilerMark"in e,"MSStream"in e,"msLaunchUri"in t,"msSaveBlob"in t])>=3&&!Eu()}function oi(){let e=window,t=navigator;return ve(["webkitPersistentStorage"in t,"webkitTemporaryStorage"in t,(t.vendor||"").indexOf("Google")===0,"webkitResolveLocalFileSystemURL"in e,"BatteryManager"in e,"webkitMediaStream"in e,"webkitSpeechGrammar"in e])>=5}function ze(){let e=window,t=navigator;return ve(["ApplePayError"in e,"CSSPrimitiveValue"in e,"Counter"in e,t.vendor.indexOf("Apple")===0,"RGBColor"in e,"WebKitMediaKeys"in e])>=4}function Fr(){let e=window,{HTMLElement:t,Document:i}=e;return ve(["safari"in e,!("ongestureend"in e),!("TouchEvent"in e),!("orientation"in e),t&&!("autocapitalize"in t.prototype),i&&"pointerLockElement"in i.prototype])>=4}function Vi(){let e=window;return fv(e.print)&&String(e.browser)==="[object WebPageNamespace]"}function Hi(){var e,t;let i=window;return ve(["buildID"in navigator,"MozAppearance"in((t=(e=document.documentElement)===null||e===void 0?void 0:e.style)!==null&&t!==void 0?t:{}),"onmozfullscreenchange"in i,"mozInnerScreenX"in i,"CSSMozDocumentRule"in i,"CanvasCaptureMediaStream"in i])>=4}function gv(){let e=window,t=navigator,{CSS:i}=e;return ve(["userActivation"in t,i.supports("color","light-dark(#000, #fff)"),i.supports("height","1lh"),"globalPrivacyControl"in t])>=3}function $u(){let{CSS:e}=window;return ve([e.supports("selector(::details-content)"),e.supports("selector(::before::marker)"),e.supports("selector(::after::marker)"),!("locale"in CompositionEvent.prototype)])>=3}function _v(){let e=window;return ve([!("MediaSettingsRange"in e),"RTCEncodedAudioFrame"in e,`${e.Intl}`=="[object Intl]",`${e.Reflect}`=="[object Reflect]"])>=3}function mv(){let e=window,{URLPattern:t}=e;return ve(["union"in Set.prototype,"Iterator"in e,t&&"hasRegExpGroups"in t.prototype,"RGB8"in WebGLRenderingContext.prototype])>=3}function yv(){let e=window,t=document,{CSS:i,Promise:s,AudioContext:n}=e;return ve([s&&"try"in s,"caretPositionFromPoint"in t,n&&"onerror"in n.prototype,i.supports("ruby-align","space-around")])>=3}function bv(){let e=window;return ve(["DOMRectList"in e,"RTCPeerConnectionIceEvent"in e,"SVGGeometryElement"in e,"ontransitioncancel"in e])>=3}function Bi(){let e=window,t=navigator,{CSS:i,HTMLButtonElement:s}=e;return ve([!("getStorageUpdates"in t),s&&"popover"in s.prototype,"CSSCounterStyleRule"in e,i.supports("font-size-adjust: ex-height 0.5"),i.supports("text-transform: full-width")])>=4}function wv(){if(navigator.platform==="iPad")return!0;let e=screen,t=e.width/e.height;return ve(["MediaSource"in window,!!Element.prototype.webkitRequestFullscreen,t>.65&&t<1.53])>=2}function xv(){let e=document;return e.fullscreenElement||e.msFullscreenElement||e.mozFullScreenElement||e.webkitFullscreenElement||null}function kv(){let e=document;return(e.exitFullscreen||e.msExitFullscreen||e.mozCancelFullScreen||e.webkitExitFullscreen).call(e)}function Ls(){var e,t;let i=oi(),s=Hi(),n=window,r=navigator;return i?ve([Ev(),"HTMLInputElement"in n&&"capture"in HTMLInputElement.prototype,"NetworkInformation"in n&&"ontypechange"in((t=(e=n.NetworkInformation)===null||e===void 0?void 0:e.prototype)!==null&&t!==void 0?t:{}),!("sinkId"in new Audio)])>=2:s?ve(["onorientationchange"in n,"orientation"in n,/android/i.test(r.appVersion)])>=2:!1}function Sv(){let e=navigator,t=window,i=Audio.prototype,{visualViewport:s}=t;return ve(["srLatency"in i,"srChannelCount"in i,"devicePosture"in e,s&&"segments"in s,"getTextInformation"in Image.prototype])>=3}function Ev(){var e,t;try{return!!(!((t=(e=window.Intl)===null||e===void 0?void 0:e.supportedValuesOf)===null||t===void 0)&&t.call(e,"collation").includes("dict"))}catch{return!1}}var $v="$ if upgrade to Pro: https://fingerprint.com/github/?utm_source=oss&utm_medium=referral&utm_campaign=confidence_score";function Pv(e){let t=Mv(e),i=Tv(t);return{score:t,comment:$v.replace(/\$/g,`${i}`)}}function Mv(e){if(Ls())return .4;if(ze())return Fr()&&!(Bi()&&Vi())?.5:.3;let t="value"in e.platform?e.platform.value:"";return/^Win/.test(t)?.6:/^Mac/.test(t)?.5:.7}function Tv(e){return Su(.99+.01*e,1e-4)}function Rs(e,t){return new Promise(i=>setTimeout(i,e,t))}function Iv(){return new Promise(e=>{let t=new MessageChannel;t.port1.onmessage=()=>e(),t.port2.postMessage(null)})}function Av(e,t=1/0){let{requestIdleCallback:i}=window;return i?new Promise(s=>i.call(window,()=>s(),{timeout:t})):Rs(Math.min(e,t))}function Pu(e){return!!e&&typeof e.then=="function"}function uu(e,t){try{let i=e();Pu(i)?i.then(s=>t(!0,s),s=>t(!1,s)):t(!0,i)}catch(i){t(!1,i)}}async function du(e,t,i=16){let s=Array(e.length),n=Date.now();for(let r=0;r<e.length;++r){s[r]=t(e[r],r);let o=Date.now();o>=n+i&&(n=o,await Iv())}return s}function ji(e){return e.then(void 0,()=>{}),e}function Cv(e){return typeof e!="function"}function Fv(e,t){let i=ji(new Promise(s=>{let n=Date.now();uu(e.bind(null,t),(...r)=>{let o=Date.now()-n;if(!r[0])return s(()=>({error:r[1],duration:o}));let a=r[1];if(Cv(a))return s(()=>({value:a,duration:o}));s(()=>new Promise(l=>{let c=Date.now();uu(a,(...u)=>{let d=o+Date.now()-c;if(!u[0])return l({error:u[1],duration:d});l({value:u[1],duration:d})})}))})}));return function(){return i.then(n=>n())}}function Ov(e,t,i,s){let n=Object.keys(e).filter(o=>uv(i,o)),r=ji(du(n,o=>Fv(e[o],t),s));return async function(){let a=await r,l=await du(a,d=>ji(d()),s),c=await Promise.all(l),u={};for(let d=0;d<n.length;++d)u[n[d]]=c[d];return u}}async function Mu(e,t,i=50){var s,n,r;let o=document;for(;!o.body;)await Rs(i);let a=o.createElement("iframe");try{for(await new Promise((l,c)=>{let u=!1,d=()=>{u=!0,l()},h=_=>{u=!0,c(_)};a.onload=d,a.onerror=h;let{style:p}=a;p.setProperty("display","block","important"),p.position="absolute",p.top="0",p.left="0",p.visibility="hidden",t&&"srcdoc"in a?a.srcdoc=t:a.src="about:blank",o.body.appendChild(a);let v=()=>{var _,g;u||(((g=(_=a.contentWindow)===null||_===void 0?void 0:_.document)===null||g===void 0?void 0:g.readyState)==="complete"?d():setTimeout(v,10))};v()});!(!((n=(s=a.contentWindow)===null||s===void 0?void 0:s.document)===null||n===void 0)&&n.body);)await Rs(i);return await e(a,a.contentWindow)}finally{(r=a.parentNode)===null||r===void 0||r.removeChild(a)}}function Rv(e){let[t,i]=dv(e),s=document.createElement(t!=null?t:"div");for(let n of Object.keys(i)){let r=i[n].join(" ");n==="style"?Lv(s.style,r):s.setAttribute(n,r)}return s}function Lv(e,t){for(let i of t.split(";")){let s=/^\s*([\w-]+)\s*:\s*(.+?)(\s*!([\w-]+))?\s*$/.exec(i);if(s){let[,n,r,,o]=s;e.setProperty(n,r,o||"")}}}function Dv(){let e=window;for(;;){let t=e.parent;if(!t||t===e)return!1;try{if(t.location.origin!==e.location.origin)return!0}catch(i){if(i instanceof Error&&i.name==="SecurityError")return!0;throw i}e=t}}function Nv(){let{ApplePaySession:e}=window;if(typeof(e==null?void 0:e.canMakePayments)!="function")return-1;if(jv())return-3;try{return e.canMakePayments()?1:0}catch(t){return Vv(t)}}var jv=Dv;function Vv(e){if(e instanceof Error&&e.name==="InvalidAccessError"&&/\bfrom\b.*\binsecure\b/i.test(e.message))return-2;throw e}function Hv(){let e=new Float32Array(1),t=new Uint8Array(e.buffer);return e[0]=1/0,e[0]=e[0]-e[0],t[3]}function Bv(){return zv()?-4:Wv()}function Wv(){let e=window,t=e.OfflineAudioContext||e.webkitOfflineAudioContext;if(!t)return-2;if(Uv())return-1;let i=4500,s=5e3,n=new t(1,s,44100),r=n.createOscillator();r.type="triangle",r.frequency.value=1e4;let o=n.createDynamicsCompressor();o.threshold.value=-50,o.knee.value=40,o.ratio.value=12,o.attack.value=0,o.release.value=.25,r.connect(o),o.connect(n.destination),r.start(0);let[a,l]=Gv(n),c=ji(a.then(u=>qv(u.getChannelData(0).subarray(i)),u=>{if(u.name==="timeout"||u.name==="suspended")return-3;throw u}));return()=>(l(),c)}function Uv(){return ze()&&!Fr()&&!bv()}function zv(){return ze()&&Bi()&&Vi()||oi()&&Sv()&&mv()}function Gv(e){let r=()=>{};return[new Promise((a,l)=>{let c=!1,u=0,d=0;e.oncomplete=v=>a(v.renderedBuffer);let h=()=>{setTimeout(()=>l(hu("timeout")),Math.min(500,d+5e3-Date.now()))},p=()=>{try{let v=e.startRendering();switch(Pu(v)&&ji(v),e.state){case"running":d=Date.now(),c&&h();break;case"suspended":document.hidden||u++,c&&u>=3?l(hu("suspended")):setTimeout(p,500);break}}catch(v){l(v)}};p(),r=()=>{c||(c=!0,d>0&&h())}}),r]}function qv(e){let t=0;for(let i=0;i<e.length;++i)t+=Math.abs(e[i]);return t}function hu(e){let t=new Error(e);return t.name=e,t}function Zv(){if(!(Ls()||ze()))return-2;if(!window.AudioContext)return-1;let t=new AudioContext().baseLatency;return t==null?-1:isFinite(t)?t:-3}function Yv(){return Xv(sg())}function Xv(e){let t=!1,i,s,[n,r]=Jv();return Kv(n,r)?(t=Qv(r),e?i=s="skipped":[i,s]=eg(n,r)):i=s="unsupported",{winding:t,geometry:i,text:s}}function Jv(){let e=document.createElement("canvas");return e.width=1,e.height=1,[e,e.getContext("2d")]}function Kv(e,t){return!!(t&&e.toDataURL)}function Qv(e){return e.rect(0,0,10,10),e.rect(2,2,6,6),!e.isPointInPath(5,5,"evenodd")}function eg(e,t){tg(e,t);let i=Pr(e),s=Pr(e);return i!==s?["unstable","unstable"]:(ig(e,t),[Pr(e),i])}function tg(e,t){e.width=240,e.height=60,t.textBaseline="alphabetic",t.fillStyle="#f60",t.fillRect(100,1,62,20),t.fillStyle="#069",t.font='11pt "Times New Roman"';let i="Cwm fjordbank gly \u{1F603}";t.fillText(i,2,15),t.fillStyle="rgba(102, 204, 0, 0.2)",t.font="18pt Arial",t.fillText(i,4,45)}function ig(e,t){e.width=122,e.height=110,t.globalCompositeOperation="multiply";for(let[i,s,n]of[["#f2f",40,40],["#2ff",80,40],["#ff2",60,80]])t.fillStyle=i,t.beginPath(),t.arc(s,n,40,0,Math.PI*2,!0),t.closePath(),t.fill();t.fillStyle="#f9c",t.arc(60,60,60,0,Math.PI*2,!0),t.arc(60,60,20,0,Math.PI*2,!0),t.fill("evenodd")}function Pr(e){return e.toDataURL()}function sg(){let e=ze()&&Bi()&&Vi(),t=Hi()&&gv();return e||t}function ng(){return window.screen.colorDepth}function rg(){for(let e of["rec2020","p3","srgb"])if(matchMedia(`(color-gamut: ${e})`).matches)return e}function og(){if(si("no-preference"))return 0;if(si("high")||si("more"))return 1;if(si("low")||si("less"))return-1;if(si("forced"))return 10}function si(e){return matchMedia(`(prefers-contrast: ${e})`).matches}function ag(){let e=document;try{e.cookie="cookietest=1; SameSite=Strict;";let t=e.cookie.indexOf("cookietest=")!==-1;return e.cookie="cookietest=1; SameSite=Strict; expires=Thu, 01-Jan-1970 00:00:01 GMT",t}catch{return!1}}function lg(){return navigator.cpuClass}function cg(){if(!window.Intl)return-1;let e=window.Intl.DateTimeFormat;if(!e)return-2;let t=e().resolvedOptions().locale;return!t&&t!==""?-3:t}function ug(){return rt(Ue(navigator.deviceMemory),void 0)}function dg(){let e=atob;return{abpIndo:["#Iklan-Melayang","#Kolom-Iklan-728","#SidebarIklan-wrapper",'[title="ALIENBOLA" i]',e("I0JveC1CYW5uZXItYWRz")],abpvn:[".quangcao","#mobileCatfish",e("LmNsb3NlLWFkcw=="),'[id^="bn_bottom_fixed_"]',"#pmadv"],adBlockFinland:[".mainostila",e("LnNwb25zb3JpdA=="),".ylamainos",e("YVtocmVmKj0iL2NsaWNrdGhyZ2guYXNwPyJd"),e("YVtocmVmXj0iaHR0cHM6Ly9hcHAucmVhZHBlYWsuY29tL2FkcyJd")],adBlockPersian:["#navbar_notice_50",".kadr",'TABLE[width="140px"]',"#divAgahi",e("YVtocmVmXj0iaHR0cDovL2cxLnYuZndtcm0ubmV0L2FkLyJd")],adBlockWarningRemoval:["#adblock-honeypot",".adblocker-root",".wp_adblock_detect",e("LmhlYWRlci1ibG9ja2VkLWFk"),e("I2FkX2Jsb2NrZXI=")],adGuardAnnoyances:[".hs-sosyal","#cookieconsentdiv",'div[class^="app_gdpr"]',".as-oil",'[data-cypress="soft-push-notification-modal"]'],adGuardBase:[".BetterJsPopOverlay",e("I2FkXzMwMFgyNTA="),e("I2Jhbm5lcmZsb2F0MjI="),e("I2NhbXBhaWduLWJhbm5lcg=="),e("I0FkLUNvbnRlbnQ=")],adGuardChinese:[e("LlppX2FkX2FfSA=="),e("YVtocmVmKj0iLmh0aGJldDM0LmNvbSJd"),"#widget-quan",e("YVtocmVmKj0iLzg0OTkyMDIwLnh5eiJd"),e("YVtocmVmKj0iLjE5NTZobC5jb20vIl0=")],adGuardFrench:["#pavePub",e("LmFkLWRlc2t0b3AtcmVjdGFuZ2xl"),".mobile_adhesion",".widgetadv",e("LmFkc19iYW4=")],adGuardGerman:['aside[data-portal-id="leaderboard"]'],adGuardJapanese:["#kauli_yad_1",e("YVtocmVmXj0iaHR0cDovL2FkMi50cmFmZmljZ2F0ZS5uZXQvIl0="),e("Ll9wb3BJbl9pbmZpbml0ZV9hZA=="),e("LmFkZ29vZ2xl"),e("Ll9faXNib29zdFJldHVybkFk")],adGuardMobile:[e("YW1wLWF1dG8tYWRz"),e("LmFtcF9hZA=="),'amp-embed[type="24smi"]',"#mgid_iframe1",e("I2FkX2ludmlld19hcmVh")],adGuardRussian:[e("YVtocmVmXj0iaHR0cHM6Ly9hZC5sZXRtZWFkcy5jb20vIl0="),e("LnJlY2xhbWE="),'div[id^="smi2adblock"]',e("ZGl2W2lkXj0iQWRGb3hfYmFubmVyXyJd"),"#psyduckpockeball"],adGuardSocial:[e("YVtocmVmXj0iLy93d3cuc3R1bWJsZXVwb24uY29tL3N1Ym1pdD91cmw9Il0="),e("YVtocmVmXj0iLy90ZWxlZ3JhbS5tZS9zaGFyZS91cmw/Il0="),".etsy-tweet","#inlineShare",".popup-social"],adGuardSpanishPortuguese:["#barraPublicidade","#Publicidade","#publiEspecial","#queTooltip",".cnt-publi"],adGuardTrackingProtection:["#qoo-counter",e("YVtocmVmXj0iaHR0cDovL2NsaWNrLmhvdGxvZy5ydS8iXQ=="),e("YVtocmVmXj0iaHR0cDovL2hpdGNvdW50ZXIucnUvdG9wL3N0YXQucGhwIl0="),e("YVtocmVmXj0iaHR0cDovL3RvcC5tYWlsLnJ1L2p1bXAiXQ=="),"#top100counter"],adGuardTurkish:["#backkapat",e("I3Jla2xhbWk="),e("YVtocmVmXj0iaHR0cDovL2Fkc2Vydi5vbnRlay5jb20udHIvIl0="),e("YVtocmVmXj0iaHR0cDovL2l6bGVuemkuY29tL2NhbXBhaWduLyJd"),e("YVtocmVmXj0iaHR0cDovL3d3dy5pbnN0YWxsYWRzLm5ldC8iXQ==")],bulgarian:[e("dGQjZnJlZW5ldF90YWJsZV9hZHM="),"#ea_intext_div",".lapni-pop-over","#xenium_hot_offers"],easyList:[".yb-floorad",e("LndpZGdldF9wb19hZHNfd2lkZ2V0"),e("LnRyYWZmaWNqdW5reS1hZA=="),".textad_headline",e("LnNwb25zb3JlZC10ZXh0LWxpbmtz")],easyListChina:[e("LmFwcGd1aWRlLXdyYXBbb25jbGljayo9ImJjZWJvcy5jb20iXQ=="),e("LmZyb250cGFnZUFkdk0="),"#taotaole","#aafoot.top_box",".cfa_popup"],easyListCookie:[".ezmob-footer",".cc-CookieWarning","[data-cookie-number]",e("LmF3LWNvb2tpZS1iYW5uZXI="),".sygnal24-gdpr-modal-wrap"],easyListCzechSlovak:["#onlajny-stickers",e("I3Jla2xhbW5pLWJveA=="),e("LnJla2xhbWEtbWVnYWJvYXJk"),".sklik",e("W2lkXj0ic2tsaWtSZWtsYW1hIl0=")],easyListDutch:[e("I2FkdmVydGVudGll"),e("I3ZpcEFkbWFya3RCYW5uZXJCbG9jaw=="),".adstekst",e("YVtocmVmXj0iaHR0cHM6Ly94bHR1YmUubmwvY2xpY2svIl0="),"#semilo-lrectangle"],easyListGermany:["#SSpotIMPopSlider",e("LnNwb25zb3JsaW5rZ3J1ZW4="),e("I3dlcmJ1bmdza3k="),e("I3Jla2xhbWUtcmVjaHRzLW1pdHRl"),e("YVtocmVmXj0iaHR0cHM6Ly9iZDc0Mi5jb20vIl0=")],easyListItaly:[e("LmJveF9hZHZfYW5udW5jaQ=="),".sb-box-pubbliredazionale",e("YVtocmVmXj0iaHR0cDovL2FmZmlsaWF6aW9uaWFkcy5zbmFpLml0LyJd"),e("YVtocmVmXj0iaHR0cHM6Ly9hZHNlcnZlci5odG1sLml0LyJd"),e("YVtocmVmXj0iaHR0cHM6Ly9hZmZpbGlhemlvbmlhZHMuc25haS5pdC8iXQ==")],easyListLithuania:[e("LnJla2xhbW9zX3RhcnBhcw=="),e("LnJla2xhbW9zX251b3JvZG9z"),e("aW1nW2FsdD0iUmVrbGFtaW5pcyBza3lkZWxpcyJd"),e("aW1nW2FsdD0iRGVkaWt1b3RpLmx0IHNlcnZlcmlhaSJd"),e("aW1nW2FsdD0iSG9zdGluZ2FzIFNlcnZlcmlhaS5sdCJd")],estonian:[e("QVtocmVmKj0iaHR0cDovL3BheTRyZXN1bHRzMjQuZXUiXQ==")],fanboyAnnoyances:["#ac-lre-player",".navigate-to-top","#subscribe_popup",".newsletter_holder","#back-top"],fanboyAntiFacebook:[".util-bar-module-firefly-visible"],fanboyEnhancedTrackers:[".open.pushModal","#issuem-leaky-paywall-articles-zero-remaining-nag","#sovrn_container",'div[class$="-hide"][zoompage-fontsize][style="display: block;"]',".BlockNag__Card"],fanboySocial:["#FollowUs","#meteored_share","#social_follow",".article-sharer",".community__social-desc"],frellwitSwedish:[e("YVtocmVmKj0iY2FzaW5vcHJvLnNlIl1bdGFyZ2V0PSJfYmxhbmsiXQ=="),e("YVtocmVmKj0iZG9rdG9yLXNlLm9uZWxpbmsubWUiXQ=="),"article.category-samarbete",e("ZGl2LmhvbGlkQWRz"),"ul.adsmodern"],greekAdBlock:[e("QVtocmVmKj0iYWRtYW4ub3RlbmV0LmdyL2NsaWNrPyJd"),e("QVtocmVmKj0iaHR0cDovL2F4aWFiYW5uZXJzLmV4b2R1cy5nci8iXQ=="),e("QVtocmVmKj0iaHR0cDovL2ludGVyYWN0aXZlLmZvcnRobmV0LmdyL2NsaWNrPyJd"),"DIV.agores300","TABLE.advright"],hungarian:["#cemp_doboz",".optimonk-iframe-container",e("LmFkX19tYWlu"),e("W2NsYXNzKj0iR29vZ2xlQWRzIl0="),"#hirdetesek_box"],iDontCareAboutCookies:['.alert-info[data-block-track*="CookieNotice"]',".ModuleTemplateCookieIndicator",".o--cookies--container","#cookies-policy-sticky","#stickyCookieBar"],icelandicAbp:[e("QVtocmVmXj0iL2ZyYW1ld29yay9yZXNvdXJjZXMvZm9ybXMvYWRzLmFzcHgiXQ==")],latvian:[e("YVtocmVmPSJodHRwOi8vd3d3LnNhbGlkemluaS5sdi8iXVtzdHlsZT0iZGlzcGxheTogYmxvY2s7IHdpZHRoOiAxMjBweDsgaGVpZ2h0OiA0MHB4OyBvdmVyZmxvdzogaGlkZGVuOyBwb3NpdGlvbjogcmVsYXRpdmU7Il0="),e("YVtocmVmPSJodHRwOi8vd3d3LnNhbGlkemluaS5sdi8iXVtzdHlsZT0iZGlzcGxheTogYmxvY2s7IHdpZHRoOiA4OHB4OyBoZWlnaHQ6IDMxcHg7IG92ZXJmbG93OiBoaWRkZW47IHBvc2l0aW9uOiByZWxhdGl2ZTsiXQ==")],listKr:[e("YVtocmVmKj0iLy9hZC5wbGFuYnBsdXMuY28ua3IvIl0="),e("I2xpdmVyZUFkV3JhcHBlcg=="),e("YVtocmVmKj0iLy9hZHYuaW1hZHJlcC5jby5rci8iXQ=="),e("aW5zLmZhc3R2aWV3LWFk"),".revenue_unit_item.dable"],listeAr:[e("LmdlbWluaUxCMUFk"),".right-and-left-sponsers",e("YVtocmVmKj0iLmFmbGFtLmluZm8iXQ=="),e("YVtocmVmKj0iYm9vcmFxLm9yZyJd"),e("YVtocmVmKj0iZHViaXp6bGUuY29tL2FyLz91dG1fc291cmNlPSJd")],listeFr:[e("YVtocmVmXj0iaHR0cDovL3Byb21vLnZhZG9yLmNvbS8iXQ=="),e("I2FkY29udGFpbmVyX3JlY2hlcmNoZQ=="),e("YVtocmVmKj0id2Vib3JhbWEuZnIvZmNnaS1iaW4vIl0="),".site-pub-interstitiel",'div[id^="crt-"][data-criteo-id]'],officialPolish:["#ceneo-placeholder-ceneo-12",e("W2hyZWZePSJodHRwczovL2FmZi5zZW5kaHViLnBsLyJd"),e("YVtocmVmXj0iaHR0cDovL2Fkdm1hbmFnZXIudGVjaGZ1bi5wbC9yZWRpcmVjdC8iXQ=="),e("YVtocmVmXj0iaHR0cDovL3d3dy50cml6ZXIucGwvP3V0bV9zb3VyY2UiXQ=="),e("ZGl2I3NrYXBpZWNfYWQ=")],ro:[e("YVtocmVmXj0iLy9hZmZ0cmsuYWx0ZXgucm8vQ291bnRlci9DbGljayJd"),e("YVtocmVmXj0iaHR0cHM6Ly9ibGFja2ZyaWRheXNhbGVzLnJvL3Ryay9zaG9wLyJd"),e("YVtocmVmXj0iaHR0cHM6Ly9ldmVudC4ycGVyZm9ybWFudC5jb20vZXZlbnRzL2NsaWNrIl0="),e("YVtocmVmXj0iaHR0cHM6Ly9sLnByb2ZpdHNoYXJlLnJvLyJd"),'a[href^="/url/"]'],ruAd:[e("YVtocmVmKj0iLy9mZWJyYXJlLnJ1LyJd"),e("YVtocmVmKj0iLy91dGltZy5ydS8iXQ=="),e("YVtocmVmKj0iOi8vY2hpa2lkaWtpLnJ1Il0="),"#pgeldiz",".yandex-rtb-block"],thaiAds:["a[href*=macau-uta-popup]",e("I2Fkcy1nb29nbGUtbWlkZGxlX3JlY3RhbmdsZS1ncm91cA=="),e("LmFkczMwMHM="),".bumq",".img-kosana"],webAnnoyancesUltralist:["#mod-social-share-2","#social-tools",e("LmN0cGwtZnVsbGJhbm5lcg=="),".zergnet-recommend",".yt.btn-link.btn-md.btn"]}}async function hg({debug:e}={}){if(!pg())return;let t=dg(),i=Object.keys(t),s=[].concat(...i.map(o=>t[o])),n=await fg(s);e&&vg(t,n);let r=i.filter(o=>{let a=t[o];return ve(a.map(c=>n[c]))>a.length*.6});return r.sort(),r}function pg(){return ze()||Ls()}async function fg(e){var t;let i=document,s=i.createElement("div"),n=new Array(e.length),r={};pu(s);for(let o=0;o<e.length;++o){let a=Rv(e[o]);a.tagName==="DIALOG"&&a.show();let l=i.createElement("div");pu(l),l.appendChild(a),s.appendChild(l),n[o]=a}for(;!i.body;)await Rs(50);i.body.appendChild(s);try{for(let o=0;o<e.length;++o)n[o].offsetParent||(r[e[o]]=!0)}finally{(t=s.parentNode)===null||t===void 0||t.removeChild(s)}return r}function pu(e){e.style.setProperty("visibility","hidden","important"),e.style.setProperty("display","block","important")}function vg(e,t){let i="DOM blockers debug:\n```";for(let s of Object.keys(e)){i+=`
5
- ${s}:`;for(let n of e[s])i+=`
6
- ${t[n]?"\u{1F6AB}":"\u27A1\uFE0F"} ${n}`}console.log(`${i}
7
- \`\`\``)}var gg="mmMwWLliI0fiflO&1",Mr={default:[],apple:[{font:"-apple-system-body"}],serif:[{fontFamily:"serif"}],sans:[{fontFamily:"sans-serif"}],mono:[{fontFamily:"monospace"}],min:[{fontSize:"1px"}],system:[{fontFamily:"system-ui"}]};function _g(){return yg((e,t,i)=>{let s={},n={};for(let o of Object.keys(Mr)){let[a={},l=gg]=Mr[o],c=e.createElement("span");c.textContent=l,c.style.whiteSpace="nowrap";for(let u of Object.keys(a)){let d=a[u];d!==void 0&&(c.style[u]=d)}s[o]=c,t.append(e.createElement("br"),c)}let r=oi()&&yv();for(let o of Object.keys(Mr)){let a=s[o].getBoundingClientRect().width;n[o]=r?mg(a*i.devicePixelRatio):a}return n})}function mg(e){let t=Ls()?0:3,i=Math.pow(10,t);return Math.floor(e*i)/i}function yg(e,t=4e3){return Mu((i,s)=>{let n=s.document,r=n.body,o=r.style;o.width=`${t}px`,o.webkitTextSizeAdjust=o.textSizeAdjust="none",oi()?r.style.zoom=`${1/s.devicePixelRatio}`:ze()&&(r.style.zoom="reset");let a=n.createElement("div");return a.textContent=[...Array(t/20<<0)].map(()=>"word").join(" "),r.appendChild(a),e(n,r,s)},'<!doctype html><html><head><meta name="viewport" content="width=device-width, initial-scale=1">')}var bg="mmMwWLliI0O&1",wg="48px",ni=["monospace","sans-serif","serif"],fu=["sans-serif-thin","ARNO PRO","Agency FB","Arabic Typesetting","Arial Unicode MS","AvantGarde Bk BT","BankGothic Md BT","Batang","Bitstream Vera Sans Mono","Calibri","Century","Century Gothic","Clarendon","EUROSTILE","Franklin Gothic","Futura Bk BT","Futura Md BT","GOTHAM","Gill Sans","HELV","Haettenschweiler","Helvetica Neue","Humanst521 BT","Leelawadee","Letter Gothic","Levenim MT","Lucida Bright","Lucida Sans","Menlo","MS Mincho","MS Outlook","MS Reference Specialty","MS UI Gothic","MT Extra","MYRIAD PRO","Marlett","Meiryo UI","Microsoft Uighur","Minion Pro","Monotype Corsiva","PMingLiU","Pristina","SCRIPTINA","Segoe UI Light","Serifa","SimHei","Small Fonts","Staccato222 BT","TRAJAN PRO","Univers CE 55 Medium","Vrinda","ZWAdobeF"];function xg(){return Mu((e,{document:t})=>{let i=t.body;i.style.fontSize=wg;let s=t.createElement("div");s.style.setProperty("visibility","hidden","important");let n={},r={},o=p=>{let v=t.createElement("span"),{style:_}=v;return _.position="absolute",_.top="0",_.left="0",_.fontFamily=p,v.textContent=bg,s.appendChild(v),v},a=(p,v)=>o(`'${p}',${v}`),l=()=>ni.map(o),c=()=>{let p={};for(let v of fu)p[v]=ni.map(_=>a(v,_));return p},u=p=>ni.some((v,_)=>p[_].offsetWidth!==n[v]||p[_].offsetHeight!==r[v]),d=l(),h=c();i.appendChild(s);for(let p=0;p<ni.length;p++)n[ni[p]]=d[p].offsetWidth,r[ni[p]]=d[p].offsetHeight;return fu.filter(p=>u(h[p]))})}function kg(){if(vu("active"))return!0;if(vu("none"))return!1}function vu(e){return matchMedia(`(forced-colors: ${e})`).matches}function Sg(){let e=Eg();return e!==void 0&&Hi()&&$u()?e>=8?8:4:e}function Eg(){return rt(Cr(navigator.hardwareConcurrency),void 0)}function $g(){if(gu("high"))return!0;if(gu("standard"))return!1}function gu(e){return matchMedia(`(dynamic-range: ${e})`).matches}function Pg(){if(!(Eu()||vv()))try{return!!window.indexedDB}catch{return!0}}function Mg(){if(_u("inverted"))return!0;if(_u("none"))return!1}function _u(e){return matchMedia(`(inverted-colors: ${e})`).matches}function Tg(){let e=navigator,t=[],i=e.language||e.userLanguage||e.browserLanguage||e.systemLanguage;if(i!==void 0&&t.push([i]),Array.isArray(e.languages))oi()&&_v()||t.push(e.languages);else if(typeof e.languages=="string"){let s=e.languages;s&&t.push(s.split(","))}return t}function Ig(){try{return!!window.localStorage}catch{return!0}}var X=Math,$e=()=>0;function Ag(){let e=X.acos||$e,t=X.acosh||$e,i=X.asin||$e,s=X.asinh||$e,n=X.atanh||$e,r=X.atan||$e,o=X.sin||$e,a=X.sinh||$e,l=X.cos||$e,c=X.cosh||$e,u=X.tan||$e,d=X.tanh||$e,h=X.exp||$e,p=X.expm1||$e,v=X.log1p||$e,_=S=>X.pow(X.PI,S),g=S=>X.log(S+X.sqrt(S*S-1)),y=S=>X.log(S+X.sqrt(S*S+1)),m=S=>X.log((1+S)/(1-S))/2,w=S=>X.exp(S)-1/X.exp(S)/2,P=S=>(X.exp(S)+1/X.exp(S))/2,$=S=>X.exp(S)-1,k=S=>(X.exp(2*S)-1)/(X.exp(2*S)+1),T=S=>X.log(1+S);return{acos:e(.12312423423423424),acosh:t(1e308),acoshPf:g(1e154),asin:i(.12312423423423424),asinh:s(1),asinhPf:y(1),atanh:n(.5),atanhPf:m(.5),atan:r(.5),sin:o(-1e300),sinh:a(1),sinhPf:w(1),cos:l(10.000000000123),cosh:c(1),coshPf:P(1),tan:u(-1e300),tanh:d(1),tanhPf:k(1),exp:h(1),expm1:p(1),expm1Pf:$(1),log1p:v(10),log1pPf:T(10),powPI:_(-100)}}var Cg=100;function Fg(){if(matchMedia("(min-monochrome: 0)").matches){for(let e=0;e<=Cg;++e)if(matchMedia(`(max-monochrome: ${e})`).matches)return e;throw new Error("Too high value")}}function Og(){return!!window.openDatabase}function Rg(){return navigator.oscpu}function Lg(){return navigator.pdfViewerEnabled}function Dg(){let{platform:e}=navigator;return e==="MacIntel"&&ze()&&!Fr()?wv()?"iPad":"iPhone":e}function Ng(){let e=navigator.plugins;if(!e)return;let t=[];for(let i=0;i<e.length;++i){let s=e[i];if(!s)continue;let n=[];for(let r=0;r<s.length;++r){let o=s[r];n.push({type:o.type,suffixes:o.suffixes})}t.push({name:s.name,description:s.description,mimeTypes:n})}return t}function jg(){var e;let t=document.createElement("a"),i=(e=t.attributionSourceId)!==null&&e!==void 0?e:t.attributionsourceid;return i===void 0?void 0:String(i)}function Vg(){if(mu("reduce"))return!0;if(mu("no-preference"))return!1}function mu(e){return matchMedia(`(prefers-reduced-motion: ${e})`).matches}function Hg(){if(yu("reduce"))return!0;if(yu("no-preference"))return!1}function yu(e){return matchMedia(`(prefers-reduced-transparency: ${e})`).matches}var Bg=2500,Wg=10,Os,Tr;function Ug(){if(Tr!==void 0)return;let e=()=>{let t=Ir();Ar(t)?Tr=setTimeout(e,Bg):(Os=t,Tr=void 0)};e()}function zg(){return Ug(),async()=>{let e=Ir();if(Ar(e)){if(Os)return[...Os];xv()&&(await kv(),e=Ir())}return Ar(e)||(Os=e),e}}function Gg(){let e=ze()&&Bi()&&Vi(),t=Hi()&&$u();if(e||t)return()=>Promise.resolve(void 0);let i=zg();return async()=>{let s=await i(),n=r=>r===null?null:Su(r,Wg);return[n(s[0]),n(s[1]),n(s[2]),n(s[3])]}}function Ir(){let e=screen;return[rt(Ue(e.availTop),null),rt(Ue(e.width)-Ue(e.availWidth)-rt(Ue(e.availLeft),0),null),rt(Ue(e.height)-Ue(e.availHeight)-rt(Ue(e.availTop),0),null),rt(Ue(e.availLeft),null)]}function Ar(e){for(let t=0;t<4;++t)if(e[t])return!1;return!0}function qg(){if(!(ze()&&Bi()&&Vi()))return Zg()}function Zg(){let e=screen,t=s=>rt(Cr(s),null),i=[t(e.width),t(e.height)];return i.sort().reverse(),i}function Yg(){try{return!!window.sessionStorage}catch{return!0}}function Xg(){var e;let t=(e=window.Intl)===null||e===void 0?void 0:e.DateTimeFormat;if(t){let s=new t().resolvedOptions().timeZone;if(s)return s}let i=-Jg();return`UTC${i>=0?"+":""}${i}`}function Jg(){let e=new Date().getFullYear();return Math.max(Ue(new Date(e,0,1).getTimezoneOffset()),Ue(new Date(e,6,1).getTimezoneOffset()))}function Kg(){let e=navigator,t=0,i;e.maxTouchPoints!==void 0?t=Cr(e.maxTouchPoints):e.msMaxTouchPoints!==void 0&&(t=e.msMaxTouchPoints);try{document.createEvent("TouchEvent"),i=!0}catch{i=!1}let s="ontouchstart"in window;return{maxTouchPoints:t,touchEvent:i,touchStart:s}}function Qg(e){return/not/i.test(e)}async function e_(){let e=navigator.userAgentData;if(!e)return;let t=e.brands.filter(({brand:n})=>!Qg(n)).map(({brand:n})=>n),s={brands:t.length>1?t.filter(n=>n!=="Chromium"):t,mobile:e.mobile,platform:e.platform};if(e.getHighEntropyValues)try{let n=await e.getHighEntropyValues(["architecture","bitness","model","platformVersion"]);s.architecture=n.architecture,s.bitness=n.bitness,s.model=n.model,s.platformVersion=n.platformVersion}catch(n){if(n instanceof DOMException&&n.name==="NotAllowedError")s.highEntropyStatus="not_allowed";else throw n}return s}function t_(){return navigator.vendor||""}function i_(){let e=[];for(let t of["chrome","safari","__crWeb","__gCrWeb","yandex","__yb","__ybro","__firefox__","__edgeTrackingPreventionStatistics","webkit","oprt","samsungAr","ucweb","UCShellJava","puffinDevice"]){let i=window[t];i&&typeof i=="object"&&e.push(t)}return e.sort()}var Tu=-1,Iu=-2,s_=new Set([10752,2849,2884,2885,2886,2928,2929,2930,2931,2932,2960,2961,2962,2963,2964,2965,2966,2967,2968,2978,3024,3042,3088,3089,3106,3107,32773,32777,32777,32823,32824,32936,32937,32938,32939,32968,32969,32970,32971,3317,33170,3333,3379,3386,33901,33902,34016,34024,34076,3408,3410,3411,3412,3413,3414,3415,34467,34816,34817,34818,34819,34877,34921,34930,35660,35661,35724,35738,35739,36003,36004,36005,36347,36348,36349,37440,37441,37443,7936,7937,7938]),n_=new Set([34047,35723,36063,34852,34853,34854,34229,36392,36795,38449]),r_=["FRAGMENT_SHADER","VERTEX_SHADER"],o_=["LOW_FLOAT","MEDIUM_FLOAT","HIGH_FLOAT","LOW_INT","MEDIUM_INT","HIGH_INT"],Au="WEBGL_debug_renderer_info",a_="WEBGL_polygon_mode";function l_({cache:e}){var t,i,s,n,r,o;let a=Cu(e);if(!a)return Tu;if(!Ou(a))return Iu;let l=Fu()?null:a.getExtension(Au);return{version:((t=a.getParameter(a.VERSION))===null||t===void 0?void 0:t.toString())||"",vendor:((i=a.getParameter(a.VENDOR))===null||i===void 0?void 0:i.toString())||"",vendorUnmasked:l?(s=a.getParameter(l.UNMASKED_VENDOR_WEBGL))===null||s===void 0?void 0:s.toString():"",renderer:((n=a.getParameter(a.RENDERER))===null||n===void 0?void 0:n.toString())||"",rendererUnmasked:l?(r=a.getParameter(l.UNMASKED_RENDERER_WEBGL))===null||r===void 0?void 0:r.toString():"",shadingLanguageVersion:((o=a.getParameter(a.SHADING_LANGUAGE_VERSION))===null||o===void 0?void 0:o.toString())||""}}function c_({cache:e}){let t=Cu(e);if(!t)return Tu;if(!Ou(t))return Iu;let i=t.getSupportedExtensions(),s=t.getContextAttributes(),n=[],r=[],o=[],a=[],l=[];if(s)for(let u of Object.keys(s))r.push(`${u}=${s[u]}`);let c=bu(t);for(let u of c){let d=t[u];o.push(`${u}=${d}${s_.has(d)?`=${t.getParameter(d)}`:""}`)}if(i)for(let u of i){if(u===Au&&Fu()||u===a_&&h_())continue;let d=t.getExtension(u);if(!d){n.push(u);continue}for(let h of bu(d)){let p=d[h];a.push(`${h}=${p}${n_.has(p)?`=${t.getParameter(p)}`:""}`)}}for(let u of r_)for(let d of o_){let h=u_(t,u,d);l.push(`${u}.${d}=${h.join(",")}`)}return a.sort(),o.sort(),{contextAttributes:r,parameters:o,shaderPrecisions:l,extensions:i,extensionParameters:a,unsupportedExtensions:n}}function Cu(e){if(e.webgl)return e.webgl.context;let t=document.createElement("canvas"),i;t.addEventListener("webglCreateContextError",()=>i=void 0);for(let s of["webgl","experimental-webgl"]){try{i=t.getContext(s)}catch{}if(i)break}return e.webgl={context:i},i}function u_(e,t,i){let s=e.getShaderPrecisionFormat(e[t],e[i]);return s?[s.rangeMin,s.rangeMax,s.precision]:[]}function bu(e){return Object.keys(e.__proto__).filter(d_)}function d_(e){return typeof e=="string"&&!e.match(/[^A-Z0-9_x]/)}function Fu(){return Hi()}function h_(){return oi()||ze()}function Ou(e){return typeof e.getParameter=="function"}var p_={userAgentData:e_,fonts:xg,domBlockers:hg,fontPreferences:_g,audio:Bv,screenFrame:Gg,canvas:Yv,osCpu:Rg,languages:Tg,colorDepth:ng,deviceMemory:ug,screenResolution:qg,hardwareConcurrency:Sg,timezone:Xg,sessionStorage:Yg,localStorage:Ig,indexedDB:Pg,openDatabase:Og,cpuClass:lg,platform:Dg,plugins:Ng,touchSupport:Kg,vendor:t_,vendorFlavors:i_,cookiesEnabled:ag,colorGamut:rg,invertedColors:Mg,forcedColors:kg,monochrome:Fg,contrast:og,reducedMotion:Vg,reducedTransparency:Hg,hdr:$g,math:Ag,pdfViewerEnabled:Lg,architecture:Hv,applePay:Nv,privateClickMeasurement:jg,audioBaseLatency:Zv,dateTimeLocale:cg,webGlBasics:l_,webGlExtensions:c_};function f_(e){return Ov(p_,e,[])}function bt(e,t){let i=e[0]>>>16,s=e[0]&65535,n=e[1]>>>16,r=e[1]&65535,o=t[0]>>>16,a=t[0]&65535,l=t[1]>>>16,c=t[1]&65535,u=0,d=0,h=0,p=0;p+=r+c,h+=p>>>16,p&=65535,h+=n+l,d+=h>>>16,h&=65535,d+=s+a,u+=d>>>16,d&=65535,u+=i+o,u&=65535,e[0]=u<<16|d,e[1]=h<<16|p}function De(e,t){let i=e[0]>>>16,s=e[0]&65535,n=e[1]>>>16,r=e[1]&65535,o=t[0]>>>16,a=t[0]&65535,l=t[1]>>>16,c=t[1]&65535,u=0,d=0,h=0,p=0;p+=r*c,h+=p>>>16,p&=65535,h+=n*c,d+=h>>>16,h&=65535,h+=r*l,d+=h>>>16,h&=65535,d+=s*c,u+=d>>>16,d&=65535,d+=n*l,u+=d>>>16,d&=65535,d+=r*a,u+=d>>>16,d&=65535,u+=i*c+s*l+n*a+r*o,u&=65535,e[0]=u<<16|d,e[1]=h<<16|p}function ri(e,t){let i=e[0];t%=64,t===32?(e[0]=e[1],e[1]=i):t<32?(e[0]=i<<t|e[1]>>>32-t,e[1]=e[1]<<t|i>>>32-t):(t-=32,e[0]=e[1]<<t|i>>>32-t,e[1]=i<<t|e[1]>>>32-t)}function Oe(e,t){t%=64,t!==0&&(t<32?(e[0]=e[1]>>>32-t,e[1]=e[1]<<t):(e[0]=e[1]<<t-32,e[1]=0))}function ae(e,t){e[0]^=t[0],e[1]^=t[1]}var v_=[4283543511,3981806797],g_=[3301882366,444984403];function wu(e){let t=[0,e[0]>>>1];ae(e,t),De(e,v_),t[1]=e[0]>>>1,ae(e,t),De(e,g_),t[1]=e[0]>>>1,ae(e,t)}var Cs=[2277735313,289559509],Fs=[1291169091,658871167],xu=[0,5],__=[0,1390208809],m_=[0,944331445];function y_(e,t){let i=hv(e);t=t||0;let s=[0,i.length],n=s[1]%16,r=s[1]-n,o=[0,t],a=[0,t],l=[0,0],c=[0,0],u;for(u=0;u<r;u=u+16)l[0]=i[u+4]|i[u+5]<<8|i[u+6]<<16|i[u+7]<<24,l[1]=i[u]|i[u+1]<<8|i[u+2]<<16|i[u+3]<<24,c[0]=i[u+12]|i[u+13]<<8|i[u+14]<<16|i[u+15]<<24,c[1]=i[u+8]|i[u+9]<<8|i[u+10]<<16|i[u+11]<<24,De(l,Cs),ri(l,31),De(l,Fs),ae(o,l),ri(o,27),bt(o,a),De(o,xu),bt(o,__),De(c,Fs),ri(c,33),De(c,Cs),ae(a,c),ri(a,31),bt(a,o),De(a,xu),bt(a,m_);l[0]=0,l[1]=0,c[0]=0,c[1]=0;let d=[0,0];switch(n){case 15:d[1]=i[u+14],Oe(d,48),ae(c,d);case 14:d[1]=i[u+13],Oe(d,40),ae(c,d);case 13:d[1]=i[u+12],Oe(d,32),ae(c,d);case 12:d[1]=i[u+11],Oe(d,24),ae(c,d);case 11:d[1]=i[u+10],Oe(d,16),ae(c,d);case 10:d[1]=i[u+9],Oe(d,8),ae(c,d);case 9:d[1]=i[u+8],ae(c,d),De(c,Fs),ri(c,33),De(c,Cs),ae(a,c);case 8:d[1]=i[u+7],Oe(d,56),ae(l,d);case 7:d[1]=i[u+6],Oe(d,48),ae(l,d);case 6:d[1]=i[u+5],Oe(d,40),ae(l,d);case 5:d[1]=i[u+4],Oe(d,32),ae(l,d);case 4:d[1]=i[u+3],Oe(d,24),ae(l,d);case 3:d[1]=i[u+2],Oe(d,16),ae(l,d);case 2:d[1]=i[u+1],Oe(d,8),ae(l,d);case 1:d[1]=i[u],ae(l,d),De(l,Cs),ri(l,31),De(l,Fs),ae(o,l)}return ae(o,s),ae(a,s),bt(o,a),bt(a,o),wu(o),wu(a),bt(o,a),bt(a,o),`00000000${(o[0]>>>0).toString(16)}`.slice(-8)+`00000000${(o[1]>>>0).toString(16)}`.slice(-8)+`00000000${(a[0]>>>0).toString(16)}`.slice(-8)+`00000000${(a[1]>>>0).toString(16)}`.slice(-8)}function b_(e){let t="";for(let i of Object.keys(e).sort()){let s=e[i],n="error"in s?"error":JSON.stringify(s.value);t+=`${t?"|":""}${i.replace(/([:|\\])/g,"\\$1")}:${n}`}return t}function Ru(e){return JSON.stringify(e,(t,i)=>i instanceof Error?pv(i):i,2)}function Lu(e){return y_(b_(e))}function w_(e){let t,i=Pv(e);return{get visitorId(){return t===void 0&&(t=Lu(this.components)),t},set visitorId(s){t=s},confidence:i,components:e,version:ku}}function x_(e=50){return Av(e,e*2)}function k_(e,t){let i=Date.now();return{async get(s){let n=Date.now(),r=await e(),o=w_(r);return(t||s!=null&&s.debug)&&console.log(`Copy the text below to get the debug data:
1
+ var R=["addExceptionStep","alias","calculateEventProperties","canRenderSurvey","canRenderSurveyAsync","cancelPendingSurvey","capture","captureException","captureLog","captureTraceFeedback","captureTraceMetric","clearIdentity","clear_opt_in_out_capturing","createPersonProfile","debug","displaySurvey","getActiveMatchingSurveys","getAllFeatureFlags","getEarlyAccessFeatures","getExtension","getFeatureFlag","getFeatureFlagPayload","getFeatureFlagResult","getGroups","getPageViewId","getSessionProperty","getSurveys","get_distinct_id","get_explicit_consent_status","get_property","get_session_id","get_session_replay_url","group","has_opted_in_capturing","has_opted_out_capturing","identify","init","isFeatureEnabled","is_capturing","loadToolbar","on","onActiveMatchingSurveysChanged","onFeatureFlags","onSessionId","onSurveysLoaded","opt_in_capturing","opt_out_capturing","register","register_for_session","register_once","reloadFeatureFlags","renderSurvey","reset","resetGroupPropertiesForFlags","resetGroups","resetPersonPropertiesForFlags","sessionRecordingStarted","setGroupPropertiesForFlags","setIdentity","setInternalOrTestUser","setPersonProperties","setPersonPropertiesForFlags","set_config","shutdown","startExceptionAutocapture","startSessionRecording","stopExceptionAutocapture","stopSessionRecording","unregister","unregister_for_session","unsetPersonProperties","updateEarlyAccessFeatureEnrollment","updateFlags"];var je="5.3.0";function Et(e,t){for(let n=0,o=e.length;n<o;++n)if(e[n]===t)return!0;return!1}function It(e,t){return!Et(e,t)}function le(e){return parseInt(e)}function A(e){return parseFloat(e)}function E(e,t){return typeof e=="number"&&isNaN(e)?t:e}function _(e){return e.reduce((t,n)=>t+(n?1:0),0)}function Ye(e,t=1){if(Math.abs(t)>=1)return Math.round(e/t)*t;{let n=1/t;return Math.round(e*n)/n}}function Mt(e){var t,n;let o=`Unexpected syntax '${e}'`,r=/^\s*([a-z-]*)(.*)$/i.exec(e),s=r[1]||void 0,c={},u=/([.:#][\w-]+|\[.+?\])/gi,d=(l,a)=>{c[l]=c[l]||[],c[l].push(a)};for(;;){let l=u.exec(r[2]);if(!l)break;let a=l[0];switch(a[0]){case".":d("class",a.slice(1));break;case"#":d("id",a.slice(1));break;case"[":{let i=/^\[([\w-]+)([~|^$*]?=("(.*?)"|([\w-]+)))?(\s+[is])?\]$/.exec(a);if(i)d(i[1],(n=(t=i[4])!==null&&t!==void 0?t:i[5])!==null&&n!==void 0?n:"");else throw new Error(o);break}default:throw new Error(o)}}return[s,c]}function Rt(e){let t=new Uint8Array(e.length);for(let n=0;n<e.length;n++){let o=e.charCodeAt(n);if(o>127)return new TextEncoder().encode(e);t[n]=o}return t}function Vt(e){var t;return{name:e.name,message:e.message,stack:(t=e.stack)===null||t===void 0?void 0:t.split(`
2
+ `),...e}}function Tt(e){return/^function\s.*?\{\s*\[native code]\s*}$/.test(String(e))}function Xe(){let e=window,t=navigator;return _(["MSCSSMatrix"in e,"msSetImmediate"in e,"msIndexedDB"in e,"msMaxTouchPoints"in t,"msPointerEnabled"in t])>=4}function Wt(){let e=window,t=navigator;return _(["msWriteProfilerMark"in e,"MSStream"in e,"msLaunchUri"in t,"msSaveBlob"in t])>=3&&!Xe()}function Z(){let e=window,t=navigator;return _(["webkitPersistentStorage"in t,"webkitTemporaryStorage"in t,(t.vendor||"").indexOf("Google")===0,"webkitResolveLocalFileSystemURL"in e,"BatteryManager"in e,"webkitMediaStream"in e,"webkitSpeechGrammar"in e])>=5}function P(){let e=window,t=navigator;return _(["ApplePayError"in e,"CSSPrimitiveValue"in e,"Counter"in e,t.vendor.indexOf("Apple")===0,"RGBColor"in e,"WebKitMediaKeys"in e])>=4}function de(){let e=window,{HTMLElement:t,Document:n}=e;return _(["safari"in e,!("ongestureend"in e),!("TouchEvent"in e),!("orientation"in e),t&&!("autocapitalize"in t.prototype),n&&"pointerLockElement"in n.prototype])>=4}function j(){let e=window;return Tt(e.print)&&String(e.browser)==="[object WebPageNamespace]"}function Y(){var e,t;let n=window;return _(["buildID"in navigator,"MozAppearance"in((t=(e=document.documentElement)===null||e===void 0?void 0:e.style)!==null&&t!==void 0?t:{}),"onmozfullscreenchange"in n,"mozInnerScreenX"in n,"CSSMozDocumentRule"in n,"CanvasCaptureMediaStream"in n])>=4}function Gt(){let e=window,t=navigator,{CSS:n}=e;return _(["userActivation"in t,n.supports("color","light-dark(#000, #fff)"),n.supports("height","1lh"),"globalPrivacyControl"in t])>=3}function ze(){let{CSS:e}=window;return _([e.supports("selector(::details-content)"),e.supports("selector(::before::marker)"),e.supports("selector(::after::marker)"),!("locale"in CompositionEvent.prototype)])>=3}function Nt(){let e=window;return _([!("MediaSettingsRange"in e),"RTCEncodedAudioFrame"in e,`${e.Intl}`=="[object Intl]",`${e.Reflect}`=="[object Reflect]"])>=3}function Zt(){let e=window,{URLPattern:t}=e;return _(["union"in Set.prototype,"Iterator"in e,t&&"hasRegExpGroups"in t.prototype,"RGB8"in WebGLRenderingContext.prototype])>=3}function Dt(){let e=window,t=document,{CSS:n,Promise:o,AudioContext:r}=e;return _([o&&"try"in o,"caretPositionFromPoint"in t,r&&"onerror"in r.prototype,n.supports("ruby-align","space-around")])>=3}function Ht(){let e=window;return _(["DOMRectList"in e,"RTCPeerConnectionIceEvent"in e,"SVGGeometryElement"in e,"ontransitioncancel"in e])>=3}function X(){let e=window,t=navigator,{CSS:n,HTMLButtonElement:o}=e;return _([!("getStorageUpdates"in t),o&&"popover"in o.prototype,"CSSCounterStyleRule"in e,n.supports("font-size-adjust: ex-height 0.5"),n.supports("text-transform: full-width")])>=4}function Ot(){if(navigator.platform==="iPad")return!0;let e=screen,t=e.width/e.height;return _(["MediaSource"in window,!!Element.prototype.webkitRequestFullscreen,t>.65&&t<1.53])>=2}function jt(){let e=document;return e.fullscreenElement||e.msFullscreenElement||e.mozFullScreenElement||e.webkitFullscreenElement||null}function Yt(){let e=document;return(e.exitFullscreen||e.msExitFullscreen||e.mozCancelFullScreen||e.webkitExitFullscreen).call(e)}function ne(){var e,t;let n=Z(),o=Y(),r=window,s=navigator;return n?_([zt(),"HTMLInputElement"in r&&"capture"in HTMLInputElement.prototype,"NetworkInformation"in r&&"ontypechange"in((t=(e=r.NetworkInformation)===null||e===void 0?void 0:e.prototype)!==null&&t!==void 0?t:{}),!("sinkId"in new Audio)])>=2:o?_(["onorientationchange"in r,"orientation"in r,/android/i.test(s.appVersion)])>=2:!1}function Xt(){let e=navigator,t=window,n=Audio.prototype,{visualViewport:o}=t;return _(["srLatency"in n,"srChannelCount"in n,"devicePosture"in e,o&&"segments"in o,"getTextInformation"in Image.prototype])>=3}function zt(){var e,t;try{return!!(!((t=(e=window.Intl)===null||e===void 0?void 0:e.supportedValuesOf)===null||t===void 0)&&t.call(e,"collation").includes("dict"))}catch{return!1}}var Bt="$ if upgrade to Pro: https://fingerprint.com/github/?utm_source=oss&utm_medium=referral&utm_campaign=confidence_score";function $t(e){let t=Jt(e),n=Ut(t);return{score:t,comment:Bt.replace(/\$/g,`${n}`)}}function Jt(e){if(ne())return .4;if(P())return de()&&!(X()&&j())?.5:.3;let t="value"in e.platform?e.platform.value:"";return/^Win/.test(t)?.6:/^Mac/.test(t)?.5:.7}function Ut(e){return Ye(.99+.01*e,1e-4)}function te(e,t){return new Promise(n=>setTimeout(n,e,t))}function Kt(){return new Promise(e=>{let t=new MessageChannel;t.port1.onmessage=()=>e(),t.port2.postMessage(null)})}function Qt(e,t=1/0){let{requestIdleCallback:n}=window;return n?new Promise(o=>n.call(window,()=>o(),{timeout:t})):te(Math.min(e,t))}function Be(e){return!!e&&typeof e.then=="function"}function Ee(e,t){try{let n=e();Be(n)?n.then(o=>t(!0,o),o=>t(!1,o)):t(!0,n)}catch(n){t(!1,n)}}async function Ie(e,t,n=16){let o=Array(e.length),r=Date.now();for(let s=0;s<e.length;++s){o[s]=t(e[s],s);let c=Date.now();c>=r+n&&(r=c,await Kt())}return o}function O(e){return e.then(void 0,()=>{}),e}function qt(e){return typeof e!="function"}function en(e,t){let n=O(new Promise(o=>{let r=Date.now();Ee(e.bind(null,t),(...s)=>{let c=Date.now()-r;if(!s[0])return o(()=>({error:s[1],duration:c}));let u=s[1];if(qt(u))return o(()=>({value:u,duration:c}));o(()=>new Promise(d=>{let l=Date.now();Ee(u,(...a)=>{let i=c+Date.now()-l;if(!a[0])return d({error:a[1],duration:i});d({value:a[1],duration:i})})}))})}));return function(){return n.then(r=>r())}}function tn(e,t,n,o){let r=Object.keys(e).filter(c=>It(n,c)),s=O(Ie(r,c=>en(e[c],t),o));return async function(){let u=await s,d=await Ie(u,i=>O(i()),o),l=await Promise.all(d),a={};for(let i=0;i<r.length;++i)a[r[i]]=l[i];return a}}async function $e(e,t,n=50){var o,r,s;let c=document;for(;!c.body;)await te(n);let u=c.createElement("iframe");try{for(await new Promise((d,l)=>{let a=!1,i=()=>{a=!0,d()},p=w=>{a=!0,l(w)};u.onload=i,u.onerror=p;let{style:m}=u;m.setProperty("display","block","important"),m.position="absolute",m.top="0",m.left="0",m.visibility="hidden",t&&"srcdoc"in u?u.srcdoc=t:u.src="about:blank",c.body.appendChild(u);let y=()=>{var w,I;a||(((I=(w=u.contentWindow)===null||w===void 0?void 0:w.document)===null||I===void 0?void 0:I.readyState)==="complete"?i():setTimeout(y,10))};y()});!(!((r=(o=u.contentWindow)===null||o===void 0?void 0:o.document)===null||r===void 0)&&r.body);)await te(n);return await e(u,u.contentWindow)}finally{(s=u.parentNode)===null||s===void 0||s.removeChild(u)}}function nn(e){let[t,n]=Mt(e),o=document.createElement(t!=null?t:"div");for(let r of Object.keys(n)){let s=n[r].join(" ");r==="style"?on(o.style,s):o.setAttribute(r,s)}return o}function on(e,t){for(let n of t.split(";")){let o=/^\s*([\w-]+)\s*:\s*(.+?)(\s*!([\w-]+))?\s*$/.exec(n);if(o){let[,r,s,,c]=o;e.setProperty(r,s,c||"")}}}function rn(){let e=window;for(;;){let t=e.parent;if(!t||t===e)return!1;try{if(t.location.origin!==e.location.origin)return!0}catch(n){if(n instanceof Error&&n.name==="SecurityError")return!0;throw n}e=t}}function sn(){let{ApplePaySession:e}=window;if(typeof(e==null?void 0:e.canMakePayments)!="function")return-1;if(an())return-3;try{return e.canMakePayments()?1:0}catch(t){return cn(t)}}var an=rn;function cn(e){if(e instanceof Error&&e.name==="InvalidAccessError"&&/\bfrom\b.*\binsecure\b/i.test(e.message))return-2;throw e}function un(){let e=new Float32Array(1),t=new Uint8Array(e.buffer);return e[0]=1/0,e[0]=e[0]-e[0],t[3]}function ln(){return mn()?-4:dn()}function dn(){let e=window,t=e.OfflineAudioContext||e.webkitOfflineAudioContext;if(!t)return-2;if(fn())return-1;let n=4500,o=5e3,r=new t(1,o,44100),s=r.createOscillator();s.type="triangle",s.frequency.value=1e4;let c=r.createDynamicsCompressor();c.threshold.value=-50,c.knee.value=40,c.ratio.value=12,c.attack.value=0,c.release.value=.25,s.connect(c),c.connect(r.destination),s.start(0);let[u,d]=pn(r),l=O(u.then(a=>hn(a.getChannelData(0).subarray(n)),a=>{if(a.name==="timeout"||a.name==="suspended")return-3;throw a}));return()=>(d(),l)}function fn(){return P()&&!de()&&!Ht()}function mn(){return P()&&X()&&j()||Z()&&Xt()&&Zt()}function pn(e){let s=()=>{};return[new Promise((u,d)=>{let l=!1,a=0,i=0;e.oncomplete=y=>u(y.renderedBuffer);let p=()=>{setTimeout(()=>d(Me("timeout")),Math.min(500,i+5e3-Date.now()))},m=()=>{try{let y=e.startRendering();switch(Be(y)&&O(y),e.state){case"running":i=Date.now(),l&&p();break;case"suspended":document.hidden||a++,l&&a>=3?d(Me("suspended")):setTimeout(m,500);break}}catch(y){d(y)}};m(),s=()=>{l||(l=!0,i>0&&p())}}),s]}function hn(e){let t=0;for(let n=0;n<e.length;++n)t+=Math.abs(e[n]);return t}function Me(e){let t=new Error(e);return t.name=e,t}function gn(){if(!(ne()||P()))return-2;if(!window.AudioContext)return-1;let t=new AudioContext().baseLatency;return t==null?-1:isFinite(t)?t:-3}function yn(){return bn(Ln())}function bn(e){let t=!1,n,o,[r,s]=wn();return _n(r,s)?(t=vn(s),e?n=o="skipped":[n,o]=Sn(r,s)):n=o="unsupported",{winding:t,geometry:n,text:o}}function wn(){let e=document.createElement("canvas");return e.width=1,e.height=1,[e,e.getContext("2d")]}function _n(e,t){return!!(t&&e.toDataURL)}function vn(e){return e.rect(0,0,10,10),e.rect(2,2,6,6),!e.isPointInPath(5,5,"evenodd")}function Sn(e,t){xn(e,t);let n=ie(e),o=ie(e);return n!==o?["unstable","unstable"]:(kn(e,t),[ie(e),n])}function xn(e,t){e.width=240,e.height=60,t.textBaseline="alphabetic",t.fillStyle="#f60",t.fillRect(100,1,62,20),t.fillStyle="#069",t.font='11pt "Times New Roman"';let n="Cwm fjordbank gly \u{1F603}";t.fillText(n,2,15),t.fillStyle="rgba(102, 204, 0, 0.2)",t.font="18pt Arial",t.fillText(n,4,45)}function kn(e,t){e.width=122,e.height=110,t.globalCompositeOperation="multiply";for(let[n,o,r]of[["#f2f",40,40],["#2ff",80,40],["#ff2",60,80]])t.fillStyle=n,t.beginPath(),t.arc(o,r,40,0,Math.PI*2,!0),t.closePath(),t.fill();t.fillStyle="#f9c",t.arc(60,60,60,0,Math.PI*2,!0),t.arc(60,60,20,0,Math.PI*2,!0),t.fill("evenodd")}function ie(e){return e.toDataURL()}function Ln(){let e=P()&&X()&&j(),t=Y()&&Gt();return e||t}function An(){return window.screen.colorDepth}function Pn(){for(let e of["rec2020","p3","srgb"])if(matchMedia(`(color-gamut: ${e})`).matches)return e}function Fn(){if(W("no-preference"))return 0;if(W("high")||W("more"))return 1;if(W("low")||W("less"))return-1;if(W("forced"))return 10}function W(e){return matchMedia(`(prefers-contrast: ${e})`).matches}function Cn(){let e=document;try{e.cookie="cookietest=1; SameSite=Strict;";let t=e.cookie.indexOf("cookietest=")!==-1;return e.cookie="cookietest=1; SameSite=Strict; expires=Thu, 01-Jan-1970 00:00:01 GMT",t}catch{return!1}}function En(){return navigator.cpuClass}function In(){if(!window.Intl)return-1;let e=window.Intl.DateTimeFormat;if(!e)return-2;let t=e().resolvedOptions().locale;return!t&&t!==""?-3:t}function Mn(){return E(A(navigator.deviceMemory),void 0)}function Rn(){let e=atob;return{abpIndo:["#Iklan-Melayang","#Kolom-Iklan-728","#SidebarIklan-wrapper",'[title="ALIENBOLA" i]',e("I0JveC1CYW5uZXItYWRz")],abpvn:[".quangcao","#mobileCatfish",e("LmNsb3NlLWFkcw=="),'[id^="bn_bottom_fixed_"]',"#pmadv"],adBlockFinland:[".mainostila",e("LnNwb25zb3JpdA=="),".ylamainos",e("YVtocmVmKj0iL2NsaWNrdGhyZ2guYXNwPyJd"),e("YVtocmVmXj0iaHR0cHM6Ly9hcHAucmVhZHBlYWsuY29tL2FkcyJd")],adBlockPersian:["#navbar_notice_50",".kadr",'TABLE[width="140px"]',"#divAgahi",e("YVtocmVmXj0iaHR0cDovL2cxLnYuZndtcm0ubmV0L2FkLyJd")],adBlockWarningRemoval:["#adblock-honeypot",".adblocker-root",".wp_adblock_detect",e("LmhlYWRlci1ibG9ja2VkLWFk"),e("I2FkX2Jsb2NrZXI=")],adGuardAnnoyances:[".hs-sosyal","#cookieconsentdiv",'div[class^="app_gdpr"]',".as-oil",'[data-cypress="soft-push-notification-modal"]'],adGuardBase:[".BetterJsPopOverlay",e("I2FkXzMwMFgyNTA="),e("I2Jhbm5lcmZsb2F0MjI="),e("I2NhbXBhaWduLWJhbm5lcg=="),e("I0FkLUNvbnRlbnQ=")],adGuardChinese:[e("LlppX2FkX2FfSA=="),e("YVtocmVmKj0iLmh0aGJldDM0LmNvbSJd"),"#widget-quan",e("YVtocmVmKj0iLzg0OTkyMDIwLnh5eiJd"),e("YVtocmVmKj0iLjE5NTZobC5jb20vIl0=")],adGuardFrench:["#pavePub",e("LmFkLWRlc2t0b3AtcmVjdGFuZ2xl"),".mobile_adhesion",".widgetadv",e("LmFkc19iYW4=")],adGuardGerman:['aside[data-portal-id="leaderboard"]'],adGuardJapanese:["#kauli_yad_1",e("YVtocmVmXj0iaHR0cDovL2FkMi50cmFmZmljZ2F0ZS5uZXQvIl0="),e("Ll9wb3BJbl9pbmZpbml0ZV9hZA=="),e("LmFkZ29vZ2xl"),e("Ll9faXNib29zdFJldHVybkFk")],adGuardMobile:[e("YW1wLWF1dG8tYWRz"),e("LmFtcF9hZA=="),'amp-embed[type="24smi"]',"#mgid_iframe1",e("I2FkX2ludmlld19hcmVh")],adGuardRussian:[e("YVtocmVmXj0iaHR0cHM6Ly9hZC5sZXRtZWFkcy5jb20vIl0="),e("LnJlY2xhbWE="),'div[id^="smi2adblock"]',e("ZGl2W2lkXj0iQWRGb3hfYmFubmVyXyJd"),"#psyduckpockeball"],adGuardSocial:[e("YVtocmVmXj0iLy93d3cuc3R1bWJsZXVwb24uY29tL3N1Ym1pdD91cmw9Il0="),e("YVtocmVmXj0iLy90ZWxlZ3JhbS5tZS9zaGFyZS91cmw/Il0="),".etsy-tweet","#inlineShare",".popup-social"],adGuardSpanishPortuguese:["#barraPublicidade","#Publicidade","#publiEspecial","#queTooltip",".cnt-publi"],adGuardTrackingProtection:["#qoo-counter",e("YVtocmVmXj0iaHR0cDovL2NsaWNrLmhvdGxvZy5ydS8iXQ=="),e("YVtocmVmXj0iaHR0cDovL2hpdGNvdW50ZXIucnUvdG9wL3N0YXQucGhwIl0="),e("YVtocmVmXj0iaHR0cDovL3RvcC5tYWlsLnJ1L2p1bXAiXQ=="),"#top100counter"],adGuardTurkish:["#backkapat",e("I3Jla2xhbWk="),e("YVtocmVmXj0iaHR0cDovL2Fkc2Vydi5vbnRlay5jb20udHIvIl0="),e("YVtocmVmXj0iaHR0cDovL2l6bGVuemkuY29tL2NhbXBhaWduLyJd"),e("YVtocmVmXj0iaHR0cDovL3d3dy5pbnN0YWxsYWRzLm5ldC8iXQ==")],bulgarian:[e("dGQjZnJlZW5ldF90YWJsZV9hZHM="),"#ea_intext_div",".lapni-pop-over","#xenium_hot_offers"],easyList:[".yb-floorad",e("LndpZGdldF9wb19hZHNfd2lkZ2V0"),e("LnRyYWZmaWNqdW5reS1hZA=="),".textad_headline",e("LnNwb25zb3JlZC10ZXh0LWxpbmtz")],easyListChina:[e("LmFwcGd1aWRlLXdyYXBbb25jbGljayo9ImJjZWJvcy5jb20iXQ=="),e("LmZyb250cGFnZUFkdk0="),"#taotaole","#aafoot.top_box",".cfa_popup"],easyListCookie:[".ezmob-footer",".cc-CookieWarning","[data-cookie-number]",e("LmF3LWNvb2tpZS1iYW5uZXI="),".sygnal24-gdpr-modal-wrap"],easyListCzechSlovak:["#onlajny-stickers",e("I3Jla2xhbW5pLWJveA=="),e("LnJla2xhbWEtbWVnYWJvYXJk"),".sklik",e("W2lkXj0ic2tsaWtSZWtsYW1hIl0=")],easyListDutch:[e("I2FkdmVydGVudGll"),e("I3ZpcEFkbWFya3RCYW5uZXJCbG9jaw=="),".adstekst",e("YVtocmVmXj0iaHR0cHM6Ly94bHR1YmUubmwvY2xpY2svIl0="),"#semilo-lrectangle"],easyListGermany:["#SSpotIMPopSlider",e("LnNwb25zb3JsaW5rZ3J1ZW4="),e("I3dlcmJ1bmdza3k="),e("I3Jla2xhbWUtcmVjaHRzLW1pdHRl"),e("YVtocmVmXj0iaHR0cHM6Ly9iZDc0Mi5jb20vIl0=")],easyListItaly:[e("LmJveF9hZHZfYW5udW5jaQ=="),".sb-box-pubbliredazionale",e("YVtocmVmXj0iaHR0cDovL2FmZmlsaWF6aW9uaWFkcy5zbmFpLml0LyJd"),e("YVtocmVmXj0iaHR0cHM6Ly9hZHNlcnZlci5odG1sLml0LyJd"),e("YVtocmVmXj0iaHR0cHM6Ly9hZmZpbGlhemlvbmlhZHMuc25haS5pdC8iXQ==")],easyListLithuania:[e("LnJla2xhbW9zX3RhcnBhcw=="),e("LnJla2xhbW9zX251b3JvZG9z"),e("aW1nW2FsdD0iUmVrbGFtaW5pcyBza3lkZWxpcyJd"),e("aW1nW2FsdD0iRGVkaWt1b3RpLmx0IHNlcnZlcmlhaSJd"),e("aW1nW2FsdD0iSG9zdGluZ2FzIFNlcnZlcmlhaS5sdCJd")],estonian:[e("QVtocmVmKj0iaHR0cDovL3BheTRyZXN1bHRzMjQuZXUiXQ==")],fanboyAnnoyances:["#ac-lre-player",".navigate-to-top","#subscribe_popup",".newsletter_holder","#back-top"],fanboyAntiFacebook:[".util-bar-module-firefly-visible"],fanboyEnhancedTrackers:[".open.pushModal","#issuem-leaky-paywall-articles-zero-remaining-nag","#sovrn_container",'div[class$="-hide"][zoompage-fontsize][style="display: block;"]',".BlockNag__Card"],fanboySocial:["#FollowUs","#meteored_share","#social_follow",".article-sharer",".community__social-desc"],frellwitSwedish:[e("YVtocmVmKj0iY2FzaW5vcHJvLnNlIl1bdGFyZ2V0PSJfYmxhbmsiXQ=="),e("YVtocmVmKj0iZG9rdG9yLXNlLm9uZWxpbmsubWUiXQ=="),"article.category-samarbete",e("ZGl2LmhvbGlkQWRz"),"ul.adsmodern"],greekAdBlock:[e("QVtocmVmKj0iYWRtYW4ub3RlbmV0LmdyL2NsaWNrPyJd"),e("QVtocmVmKj0iaHR0cDovL2F4aWFiYW5uZXJzLmV4b2R1cy5nci8iXQ=="),e("QVtocmVmKj0iaHR0cDovL2ludGVyYWN0aXZlLmZvcnRobmV0LmdyL2NsaWNrPyJd"),"DIV.agores300","TABLE.advright"],hungarian:["#cemp_doboz",".optimonk-iframe-container",e("LmFkX19tYWlu"),e("W2NsYXNzKj0iR29vZ2xlQWRzIl0="),"#hirdetesek_box"],iDontCareAboutCookies:['.alert-info[data-block-track*="CookieNotice"]',".ModuleTemplateCookieIndicator",".o--cookies--container","#cookies-policy-sticky","#stickyCookieBar"],icelandicAbp:[e("QVtocmVmXj0iL2ZyYW1ld29yay9yZXNvdXJjZXMvZm9ybXMvYWRzLmFzcHgiXQ==")],latvian:[e("YVtocmVmPSJodHRwOi8vd3d3LnNhbGlkemluaS5sdi8iXVtzdHlsZT0iZGlzcGxheTogYmxvY2s7IHdpZHRoOiAxMjBweDsgaGVpZ2h0OiA0MHB4OyBvdmVyZmxvdzogaGlkZGVuOyBwb3NpdGlvbjogcmVsYXRpdmU7Il0="),e("YVtocmVmPSJodHRwOi8vd3d3LnNhbGlkemluaS5sdi8iXVtzdHlsZT0iZGlzcGxheTogYmxvY2s7IHdpZHRoOiA4OHB4OyBoZWlnaHQ6IDMxcHg7IG92ZXJmbG93OiBoaWRkZW47IHBvc2l0aW9uOiByZWxhdGl2ZTsiXQ==")],listKr:[e("YVtocmVmKj0iLy9hZC5wbGFuYnBsdXMuY28ua3IvIl0="),e("I2xpdmVyZUFkV3JhcHBlcg=="),e("YVtocmVmKj0iLy9hZHYuaW1hZHJlcC5jby5rci8iXQ=="),e("aW5zLmZhc3R2aWV3LWFk"),".revenue_unit_item.dable"],listeAr:[e("LmdlbWluaUxCMUFk"),".right-and-left-sponsers",e("YVtocmVmKj0iLmFmbGFtLmluZm8iXQ=="),e("YVtocmVmKj0iYm9vcmFxLm9yZyJd"),e("YVtocmVmKj0iZHViaXp6bGUuY29tL2FyLz91dG1fc291cmNlPSJd")],listeFr:[e("YVtocmVmXj0iaHR0cDovL3Byb21vLnZhZG9yLmNvbS8iXQ=="),e("I2FkY29udGFpbmVyX3JlY2hlcmNoZQ=="),e("YVtocmVmKj0id2Vib3JhbWEuZnIvZmNnaS1iaW4vIl0="),".site-pub-interstitiel",'div[id^="crt-"][data-criteo-id]'],officialPolish:["#ceneo-placeholder-ceneo-12",e("W2hyZWZePSJodHRwczovL2FmZi5zZW5kaHViLnBsLyJd"),e("YVtocmVmXj0iaHR0cDovL2Fkdm1hbmFnZXIudGVjaGZ1bi5wbC9yZWRpcmVjdC8iXQ=="),e("YVtocmVmXj0iaHR0cDovL3d3dy50cml6ZXIucGwvP3V0bV9zb3VyY2UiXQ=="),e("ZGl2I3NrYXBpZWNfYWQ=")],ro:[e("YVtocmVmXj0iLy9hZmZ0cmsuYWx0ZXgucm8vQ291bnRlci9DbGljayJd"),e("YVtocmVmXj0iaHR0cHM6Ly9ibGFja2ZyaWRheXNhbGVzLnJvL3Ryay9zaG9wLyJd"),e("YVtocmVmXj0iaHR0cHM6Ly9ldmVudC4ycGVyZm9ybWFudC5jb20vZXZlbnRzL2NsaWNrIl0="),e("YVtocmVmXj0iaHR0cHM6Ly9sLnByb2ZpdHNoYXJlLnJvLyJd"),'a[href^="/url/"]'],ruAd:[e("YVtocmVmKj0iLy9mZWJyYXJlLnJ1LyJd"),e("YVtocmVmKj0iLy91dGltZy5ydS8iXQ=="),e("YVtocmVmKj0iOi8vY2hpa2lkaWtpLnJ1Il0="),"#pgeldiz",".yandex-rtb-block"],thaiAds:["a[href*=macau-uta-popup]",e("I2Fkcy1nb29nbGUtbWlkZGxlX3JlY3RhbmdsZS1ncm91cA=="),e("LmFkczMwMHM="),".bumq",".img-kosana"],webAnnoyancesUltralist:["#mod-social-share-2","#social-tools",e("LmN0cGwtZnVsbGJhbm5lcg=="),".zergnet-recommend",".yt.btn-link.btn-md.btn"]}}async function Vn({debug:e}={}){if(!Tn())return;let t=Rn(),n=Object.keys(t),o=[].concat(...n.map(c=>t[c])),r=await Wn(o);e&&Gn(t,r);let s=n.filter(c=>{let u=t[c];return _(u.map(l=>r[l]))>u.length*.6});return s.sort(),s}function Tn(){return P()||ne()}async function Wn(e){var t;let n=document,o=n.createElement("div"),r=new Array(e.length),s={};Re(o);for(let c=0;c<e.length;++c){let u=nn(e[c]);u.tagName==="DIALOG"&&u.show();let d=n.createElement("div");Re(d),d.appendChild(u),o.appendChild(d),r[c]=u}for(;!n.body;)await te(50);n.body.appendChild(o);try{for(let c=0;c<e.length;++c)r[c].offsetParent||(s[e[c]]=!0)}finally{(t=o.parentNode)===null||t===void 0||t.removeChild(o)}return s}function Re(e){e.style.setProperty("visibility","hidden","important"),e.style.setProperty("display","block","important")}function Gn(e,t){let n="DOM blockers debug:\n```";for(let o of Object.keys(e)){n+=`
3
+ ${o}:`;for(let r of e[o])n+=`
4
+ ${t[r]?"\u{1F6AB}":"\u27A1\uFE0F"} ${r}`}console.log(`${n}
5
+ \`\`\``)}var Nn="mmMwWLliI0fiflO&1",se={default:[],apple:[{font:"-apple-system-body"}],serif:[{fontFamily:"serif"}],sans:[{fontFamily:"sans-serif"}],mono:[{fontFamily:"monospace"}],min:[{fontSize:"1px"}],system:[{fontFamily:"system-ui"}]};function Zn(){return Hn((e,t,n)=>{let o={},r={};for(let c of Object.keys(se)){let[u={},d=Nn]=se[c],l=e.createElement("span");l.textContent=d,l.style.whiteSpace="nowrap";for(let a of Object.keys(u)){let i=u[a];i!==void 0&&(l.style[a]=i)}o[c]=l,t.append(e.createElement("br"),l)}let s=Z()&&Dt();for(let c of Object.keys(se)){let u=o[c].getBoundingClientRect().width;r[c]=s?Dn(u*n.devicePixelRatio):u}return r})}function Dn(e){let t=ne()?0:3,n=Math.pow(10,t);return Math.floor(e*n)/n}function Hn(e,t=4e3){return $e((n,o)=>{let r=o.document,s=r.body,c=s.style;c.width=`${t}px`,c.webkitTextSizeAdjust=c.textSizeAdjust="none",Z()?s.style.zoom=`${1/o.devicePixelRatio}`:P()&&(s.style.zoom="reset");let u=r.createElement("div");return u.textContent=[...Array(t/20<<0)].map(()=>"word").join(" "),s.appendChild(u),e(r,s,o)},'<!doctype html><html><head><meta name="viewport" content="width=device-width, initial-scale=1">')}var On="mmMwWLliI0O&1",jn="48px",G=["monospace","sans-serif","serif"],Ve=["sans-serif-thin","ARNO PRO","Agency FB","Arabic Typesetting","Arial Unicode MS","AvantGarde Bk BT","BankGothic Md BT","Batang","Bitstream Vera Sans Mono","Calibri","Century","Century Gothic","Clarendon","EUROSTILE","Franklin Gothic","Futura Bk BT","Futura Md BT","GOTHAM","Gill Sans","HELV","Haettenschweiler","Helvetica Neue","Humanst521 BT","Leelawadee","Letter Gothic","Levenim MT","Lucida Bright","Lucida Sans","Menlo","MS Mincho","MS Outlook","MS Reference Specialty","MS UI Gothic","MT Extra","MYRIAD PRO","Marlett","Meiryo UI","Microsoft Uighur","Minion Pro","Monotype Corsiva","PMingLiU","Pristina","SCRIPTINA","Segoe UI Light","Serifa","SimHei","Small Fonts","Staccato222 BT","TRAJAN PRO","Univers CE 55 Medium","Vrinda","ZWAdobeF"];function Yn(){return $e((e,{document:t})=>{let n=t.body;n.style.fontSize=jn;let o=t.createElement("div");o.style.setProperty("visibility","hidden","important");let r={},s={},c=m=>{let y=t.createElement("span"),{style:w}=y;return w.position="absolute",w.top="0",w.left="0",w.fontFamily=m,y.textContent=On,o.appendChild(y),y},u=(m,y)=>c(`'${m}',${y}`),d=()=>G.map(c),l=()=>{let m={};for(let y of Ve)m[y]=G.map(w=>u(y,w));return m},a=m=>G.some((y,w)=>m[w].offsetWidth!==r[y]||m[w].offsetHeight!==s[y]),i=d(),p=l();n.appendChild(o);for(let m=0;m<G.length;m++)r[G[m]]=i[m].offsetWidth,s[G[m]]=i[m].offsetHeight;return Ve.filter(m=>a(p[m]))})}function Xn(){if(Te("active"))return!0;if(Te("none"))return!1}function Te(e){return matchMedia(`(forced-colors: ${e})`).matches}function zn(){let e=Bn();return e!==void 0&&Y()&&ze()?e>=8?8:4:e}function Bn(){return E(le(navigator.hardwareConcurrency),void 0)}function $n(){if(We("high"))return!0;if(We("standard"))return!1}function We(e){return matchMedia(`(dynamic-range: ${e})`).matches}function Jn(){if(!(Xe()||Wt()))try{return!!window.indexedDB}catch{return!0}}function Un(){if(Ge("inverted"))return!0;if(Ge("none"))return!1}function Ge(e){return matchMedia(`(inverted-colors: ${e})`).matches}function Kn(){let e=navigator,t=[],n=e.language||e.userLanguage||e.browserLanguage||e.systemLanguage;if(n!==void 0&&t.push([n]),Array.isArray(e.languages))Z()&&Nt()||t.push(e.languages);else if(typeof e.languages=="string"){let o=e.languages;o&&t.push(o.split(","))}return t}function Qn(){try{return!!window.localStorage}catch{return!0}}var h=Math,v=()=>0;function qn(){let e=h.acos||v,t=h.acosh||v,n=h.asin||v,o=h.asinh||v,r=h.atanh||v,s=h.atan||v,c=h.sin||v,u=h.sinh||v,d=h.cos||v,l=h.cosh||v,a=h.tan||v,i=h.tanh||v,p=h.exp||v,m=h.expm1||v,y=h.log1p||v,w=g=>h.pow(h.PI,g),I=g=>h.log(g+h.sqrt(g*g-1)),D=g=>h.log(g+h.sqrt(g*g+1)),B=g=>h.log((1+g)/(1-g))/2,$=g=>h.exp(g)-1/h.exp(g)/2,C=g=>(h.exp(g)+1/h.exp(g))/2,J=g=>h.exp(g)-1,V=g=>(h.exp(2*g)-1)/(h.exp(2*g)+1),U=g=>h.log(1+g);return{acos:e(.12312423423423424),acosh:t(1e308),acoshPf:I(1e154),asin:n(.12312423423423424),asinh:o(1),asinhPf:D(1),atanh:r(.5),atanhPf:B(.5),atan:s(.5),sin:c(-1e300),sinh:u(1),sinhPf:$(1),cos:d(10.000000000123),cosh:l(1),coshPf:C(1),tan:a(-1e300),tanh:i(1),tanhPf:V(1),exp:p(1),expm1:m(1),expm1Pf:J(1),log1p:y(10),log1pPf:U(10),powPI:w(-100)}}var eo=100;function to(){if(matchMedia("(min-monochrome: 0)").matches){for(let e=0;e<=eo;++e)if(matchMedia(`(max-monochrome: ${e})`).matches)return e;throw new Error("Too high value")}}function no(){return!!window.openDatabase}function oo(){return navigator.oscpu}function ro(){return navigator.pdfViewerEnabled}function io(){let{platform:e}=navigator;return e==="MacIntel"&&P()&&!de()?Ot()?"iPad":"iPhone":e}function so(){let e=navigator.plugins;if(!e)return;let t=[];for(let n=0;n<e.length;++n){let o=e[n];if(!o)continue;let r=[];for(let s=0;s<o.length;++s){let c=o[s];r.push({type:c.type,suffixes:c.suffixes})}t.push({name:o.name,description:o.description,mimeTypes:r})}return t}function ao(){var e;let t=document.createElement("a"),n=(e=t.attributionSourceId)!==null&&e!==void 0?e:t.attributionsourceid;return n===void 0?void 0:String(n)}function co(){if(Ne("reduce"))return!0;if(Ne("no-preference"))return!1}function Ne(e){return matchMedia(`(prefers-reduced-motion: ${e})`).matches}function uo(){if(Ze("reduce"))return!0;if(Ze("no-preference"))return!1}function Ze(e){return matchMedia(`(prefers-reduced-transparency: ${e})`).matches}var lo=2500,fo=10,ee,ae;function mo(){if(ae!==void 0)return;let e=()=>{let t=ce();ue(t)?ae=setTimeout(e,lo):(ee=t,ae=void 0)};e()}function po(){return mo(),async()=>{let e=ce();if(ue(e)){if(ee)return[...ee];jt()&&(await Yt(),e=ce())}return ue(e)||(ee=e),e}}function ho(){let e=P()&&X()&&j(),t=Y()&&ze();if(e||t)return()=>Promise.resolve(void 0);let n=po();return async()=>{let o=await n(),r=s=>s===null?null:Ye(s,fo);return[r(o[0]),r(o[1]),r(o[2]),r(o[3])]}}function ce(){let e=screen;return[E(A(e.availTop),null),E(A(e.width)-A(e.availWidth)-E(A(e.availLeft),0),null),E(A(e.height)-A(e.availHeight)-E(A(e.availTop),0),null),E(A(e.availLeft),null)]}function ue(e){for(let t=0;t<4;++t)if(e[t])return!1;return!0}function go(){if(!(P()&&X()&&j()))return yo()}function yo(){let e=screen,t=o=>E(le(o),null),n=[t(e.width),t(e.height)];return n.sort().reverse(),n}function bo(){try{return!!window.sessionStorage}catch{return!0}}function wo(){var e;let t=(e=window.Intl)===null||e===void 0?void 0:e.DateTimeFormat;if(t){let o=new t().resolvedOptions().timeZone;if(o)return o}let n=-_o();return`UTC${n>=0?"+":""}${n}`}function _o(){let e=new Date().getFullYear();return Math.max(A(new Date(e,0,1).getTimezoneOffset()),A(new Date(e,6,1).getTimezoneOffset()))}function vo(){let e=navigator,t=0,n;e.maxTouchPoints!==void 0?t=le(e.maxTouchPoints):e.msMaxTouchPoints!==void 0&&(t=e.msMaxTouchPoints);try{document.createEvent("TouchEvent"),n=!0}catch{n=!1}let o="ontouchstart"in window;return{maxTouchPoints:t,touchEvent:n,touchStart:o}}function So(e){return/not/i.test(e)}async function xo(){let e=navigator.userAgentData;if(!e)return;let t=e.brands.filter(({brand:r})=>!So(r)).map(({brand:r})=>r),o={brands:t.length>1?t.filter(r=>r!=="Chromium"):t,mobile:e.mobile,platform:e.platform};if(e.getHighEntropyValues)try{let r=await e.getHighEntropyValues(["architecture","bitness","model","platformVersion"]);o.architecture=r.architecture,o.bitness=r.bitness,o.model=r.model,o.platformVersion=r.platformVersion}catch(r){if(r instanceof DOMException&&r.name==="NotAllowedError")o.highEntropyStatus="not_allowed";else throw r}return o}function ko(){return navigator.vendor||""}function Lo(){let e=[];for(let t of["chrome","safari","__crWeb","__gCrWeb","yandex","__yb","__ybro","__firefox__","__edgeTrackingPreventionStatistics","webkit","oprt","samsungAr","ucweb","UCShellJava","puffinDevice"]){let n=window[t];n&&typeof n=="object"&&e.push(t)}return e.sort()}var Je=-1,Ue=-2,Ao=new Set([10752,2849,2884,2885,2886,2928,2929,2930,2931,2932,2960,2961,2962,2963,2964,2965,2966,2967,2968,2978,3024,3042,3088,3089,3106,3107,32773,32777,32777,32823,32824,32936,32937,32938,32939,32968,32969,32970,32971,3317,33170,3333,3379,3386,33901,33902,34016,34024,34076,3408,3410,3411,3412,3413,3414,3415,34467,34816,34817,34818,34819,34877,34921,34930,35660,35661,35724,35738,35739,36003,36004,36005,36347,36348,36349,37440,37441,37443,7936,7937,7938]),Po=new Set([34047,35723,36063,34852,34853,34854,34229,36392,36795,38449]),Fo=["FRAGMENT_SHADER","VERTEX_SHADER"],Co=["LOW_FLOAT","MEDIUM_FLOAT","HIGH_FLOAT","LOW_INT","MEDIUM_INT","HIGH_INT"],Ke="WEBGL_debug_renderer_info",Eo="WEBGL_polygon_mode";function Io({cache:e}){var t,n,o,r,s,c;let u=Qe(e);if(!u)return Je;if(!et(u))return Ue;let d=qe()?null:u.getExtension(Ke);return{version:((t=u.getParameter(u.VERSION))===null||t===void 0?void 0:t.toString())||"",vendor:((n=u.getParameter(u.VENDOR))===null||n===void 0?void 0:n.toString())||"",vendorUnmasked:d?(o=u.getParameter(d.UNMASKED_VENDOR_WEBGL))===null||o===void 0?void 0:o.toString():"",renderer:((r=u.getParameter(u.RENDERER))===null||r===void 0?void 0:r.toString())||"",rendererUnmasked:d?(s=u.getParameter(d.UNMASKED_RENDERER_WEBGL))===null||s===void 0?void 0:s.toString():"",shadingLanguageVersion:((c=u.getParameter(u.SHADING_LANGUAGE_VERSION))===null||c===void 0?void 0:c.toString())||""}}function Mo({cache:e}){let t=Qe(e);if(!t)return Je;if(!et(t))return Ue;let n=t.getSupportedExtensions(),o=t.getContextAttributes(),r=[],s=[],c=[],u=[],d=[];if(o)for(let a of Object.keys(o))s.push(`${a}=${o[a]}`);let l=De(t);for(let a of l){let i=t[a];c.push(`${a}=${i}${Ao.has(i)?`=${t.getParameter(i)}`:""}`)}if(n)for(let a of n){if(a===Ke&&qe()||a===Eo&&To())continue;let i=t.getExtension(a);if(!i){r.push(a);continue}for(let p of De(i)){let m=i[p];u.push(`${p}=${m}${Po.has(m)?`=${t.getParameter(m)}`:""}`)}}for(let a of Fo)for(let i of Co){let p=Ro(t,a,i);d.push(`${a}.${i}=${p.join(",")}`)}return u.sort(),c.sort(),{contextAttributes:s,parameters:c,shaderPrecisions:d,extensions:n,extensionParameters:u,unsupportedExtensions:r}}function Qe(e){if(e.webgl)return e.webgl.context;let t=document.createElement("canvas"),n;t.addEventListener("webglCreateContextError",()=>n=void 0);for(let o of["webgl","experimental-webgl"]){try{n=t.getContext(o)}catch{}if(n)break}return e.webgl={context:n},n}function Ro(e,t,n){let o=e.getShaderPrecisionFormat(e[t],e[n]);return o?[o.rangeMin,o.rangeMax,o.precision]:[]}function De(e){return Object.keys(e.__proto__).filter(Vo)}function Vo(e){return typeof e=="string"&&!e.match(/[^A-Z0-9_x]/)}function qe(){return Y()}function To(){return Z()||P()}function et(e){return typeof e.getParameter=="function"}var Wo={userAgentData:xo,fonts:Yn,domBlockers:Vn,fontPreferences:Zn,audio:ln,screenFrame:ho,canvas:yn,osCpu:oo,languages:Kn,colorDepth:An,deviceMemory:Mn,screenResolution:go,hardwareConcurrency:zn,timezone:wo,sessionStorage:bo,localStorage:Qn,indexedDB:Jn,openDatabase:no,cpuClass:En,platform:io,plugins:so,touchSupport:vo,vendor:ko,vendorFlavors:Lo,cookiesEnabled:Cn,colorGamut:Pn,invertedColors:Un,forcedColors:Xn,monochrome:to,contrast:Fn,reducedMotion:co,reducedTransparency:uo,hdr:$n,math:qn,pdfViewerEnabled:ro,architecture:un,applePay:sn,privateClickMeasurement:ao,audioBaseLatency:gn,dateTimeLocale:In,webGlBasics:Io,webGlExtensions:Mo};function Go(e){return tn(Wo,e,[])}function M(e,t){let n=e[0]>>>16,o=e[0]&65535,r=e[1]>>>16,s=e[1]&65535,c=t[0]>>>16,u=t[0]&65535,d=t[1]>>>16,l=t[1]&65535,a=0,i=0,p=0,m=0;m+=s+l,p+=m>>>16,m&=65535,p+=r+d,i+=p>>>16,p&=65535,i+=o+u,a+=i>>>16,i&=65535,a+=n+c,a&=65535,e[0]=a<<16|i,e[1]=p<<16|m}function k(e,t){let n=e[0]>>>16,o=e[0]&65535,r=e[1]>>>16,s=e[1]&65535,c=t[0]>>>16,u=t[0]&65535,d=t[1]>>>16,l=t[1]&65535,a=0,i=0,p=0,m=0;m+=s*l,p+=m>>>16,m&=65535,p+=r*l,i+=p>>>16,p&=65535,p+=s*d,i+=p>>>16,p&=65535,i+=o*l,a+=i>>>16,i&=65535,i+=r*d,a+=i>>>16,i&=65535,i+=s*u,a+=i>>>16,i&=65535,a+=n*l+o*d+r*u+s*c,a&=65535,e[0]=a<<16|i,e[1]=p<<16|m}function N(e,t){let n=e[0];t%=64,t===32?(e[0]=e[1],e[1]=n):t<32?(e[0]=n<<t|e[1]>>>32-t,e[1]=e[1]<<t|n>>>32-t):(t-=32,e[0]=e[1]<<t|n>>>32-t,e[1]=n<<t|e[1]>>>32-t)}function x(e,t){t%=64,t!==0&&(t<32?(e[0]=e[1]>>>32-t,e[1]=e[1]<<t):(e[0]=e[1]<<t-32,e[1]=0))}function b(e,t){e[0]^=t[0],e[1]^=t[1]}var No=[4283543511,3981806797],Zo=[3301882366,444984403];function He(e){let t=[0,e[0]>>>1];b(e,t),k(e,No),t[1]=e[0]>>>1,b(e,t),k(e,Zo),t[1]=e[0]>>>1,b(e,t)}var Q=[2277735313,289559509],q=[1291169091,658871167],Oe=[0,5],Do=[0,1390208809],Ho=[0,944331445];function Oo(e,t){let n=Rt(e);t=t||0;let o=[0,n.length],r=o[1]%16,s=o[1]-r,c=[0,t],u=[0,t],d=[0,0],l=[0,0],a;for(a=0;a<s;a=a+16)d[0]=n[a+4]|n[a+5]<<8|n[a+6]<<16|n[a+7]<<24,d[1]=n[a]|n[a+1]<<8|n[a+2]<<16|n[a+3]<<24,l[0]=n[a+12]|n[a+13]<<8|n[a+14]<<16|n[a+15]<<24,l[1]=n[a+8]|n[a+9]<<8|n[a+10]<<16|n[a+11]<<24,k(d,Q),N(d,31),k(d,q),b(c,d),N(c,27),M(c,u),k(c,Oe),M(c,Do),k(l,q),N(l,33),k(l,Q),b(u,l),N(u,31),M(u,c),k(u,Oe),M(u,Ho);d[0]=0,d[1]=0,l[0]=0,l[1]=0;let i=[0,0];switch(r){case 15:i[1]=n[a+14],x(i,48),b(l,i);case 14:i[1]=n[a+13],x(i,40),b(l,i);case 13:i[1]=n[a+12],x(i,32),b(l,i);case 12:i[1]=n[a+11],x(i,24),b(l,i);case 11:i[1]=n[a+10],x(i,16),b(l,i);case 10:i[1]=n[a+9],x(i,8),b(l,i);case 9:i[1]=n[a+8],b(l,i),k(l,q),N(l,33),k(l,Q),b(u,l);case 8:i[1]=n[a+7],x(i,56),b(d,i);case 7:i[1]=n[a+6],x(i,48),b(d,i);case 6:i[1]=n[a+5],x(i,40),b(d,i);case 5:i[1]=n[a+4],x(i,32),b(d,i);case 4:i[1]=n[a+3],x(i,24),b(d,i);case 3:i[1]=n[a+2],x(i,16),b(d,i);case 2:i[1]=n[a+1],x(i,8),b(d,i);case 1:i[1]=n[a],b(d,i),k(d,Q),N(d,31),k(d,q),b(c,d)}return b(c,o),b(u,o),M(c,u),M(u,c),He(c),He(u),M(c,u),M(u,c),`00000000${(c[0]>>>0).toString(16)}`.slice(-8)+`00000000${(c[1]>>>0).toString(16)}`.slice(-8)+`00000000${(u[0]>>>0).toString(16)}`.slice(-8)+`00000000${(u[1]>>>0).toString(16)}`.slice(-8)}function jo(e){let t="";for(let n of Object.keys(e).sort()){let o=e[n],r="error"in o?"error":JSON.stringify(o.value);t+=`${t?"|":""}${n.replace(/([:|\\])/g,"\\$1")}:${r}`}return t}function tt(e){return JSON.stringify(e,(t,n)=>n instanceof Error?Vt(n):n,2)}function nt(e){return Oo(jo(e))}function Yo(e){let t,n=$t(e);return{get visitorId(){return t===void 0&&(t=nt(this.components)),t},set visitorId(o){t=o},confidence:n,components:e,version:je}}function Xo(e=50){return Qt(e,e*2)}function zo(e,t){let n=Date.now();return{async get(o){let r=Date.now(),s=await e(),c=Yo(s);return(t||o!=null&&o.debug)&&console.log(`Copy the text below to get the debug data:
8
6
 
9
7
  \`\`\`
10
- version: ${o.version}
8
+ version: ${c.version}
11
9
  userAgent: ${navigator.userAgent}
12
- timeBetweenLoadAndGet: ${n-i}
13
- visitorId: ${o.visitorId}
14
- components: ${Ru(r)}
15
- \`\`\``),o}}}function S_(){if(!(window.__fpjs_d_m||Math.random()>=.001))try{let e=new XMLHttpRequest;e.open("get",`https://m1.openfpcdn.io/fingerprintjs/v${ku}/npm-monitoring`,!0),e.send()}catch(e){console.error(e)}}async function E_(e={}){let{delayFallback:t,debug:i,monitoring:s=!0}=e;s&&S_(),await x_(t);let n=f_({cache:{},debug:i});return k_(n,i)}var Du={load:E_,hashComponents:Lu,componentsToDebugString:Ru};var $_=["utm_source","utm_medium","utm_campaign","utm_content","utm_term","utm_id","utm_placement"],P_=["fbclid","gclid","gbraid","wbraid","gad_source","gad_campaignid","msclkid","ctwa_clid"],Lr=["a_campaign_id","a_adset_id","a_ad_id","h_ad_id","fbc_id"],Dr=["lp","narrative"],ju=[...$_,...P_,...Lr,...Dr],Vu=new Set(ju),M_=e=>Vu.has(String(e).toLowerCase()),Or=e=>e.split(/[?#]/)[0],T_=/^[a-z][a-z0-9+.-]*:/i;function Ne(e,t){if(typeof e!="string"||e==="")return e;let i=T_.test(e),s;try{s=new URL(e,t||void 0)}catch{return Or(e)}if(s.protocol!=="http:"&&s.protocol!=="https:")return i?e:Or(e);let n=new URLSearchParams;for(let[r,o]of s.searchParams)M_(r)&&n.append(r,o);return s.search=n.toString(),s.hash="",i||e.startsWith("//")?s.href:e.startsWith("/")?s.pathname+s.search:Or(e)+s.search}function Nr(e){let t={},i;try{i=new URL(e)}catch{return t}for(let[s,n]of i.searchParams){let r=s.toLowerCase();Vu.has(r)&&n!==""&&!(r in t)&&(t[r]=n)}return t}var I_=new Set(["href","attr__href","action","attr__action"]),A_=/((?:attr__)?(?:href|action))="((?:[^"\\]|\\.)*)"/g,Nu={event:8,snapshot:400},C_=/\.(png|jpe?g|gif|webp|avif|svg|ico|bmp|mp4|webm|mov|m4v|mp3|wav|ogg|js|mjs|css|woff2?|ttf|otf|json)$/i;function F_(e,t){try{return C_.test(new URL(e,t).pathname)}catch{return!1}}function O_(e,t,i,s){return t==="$elements_chain"?e.replace(A_,(n,r,o)=>`${r}="${Ne(o,i)}"`):I_.has(t)?Ne(e,i):s&&(t==="src"||t==="rr_src")?e.startsWith("data:")||F_(e,i)?e:Ne(e,i):!s&&/^https?:\/\//i.test(e)?Ne(e):e}var R_=/^https?:\/\//i;function Rr(e,t,i,s,n){if(typeof e=="string")return O_(e,t,i,s);if(!e||typeof e!="object"||n>(s?Nu.snapshot:Nu.event))return e;if(Array.isArray(e)){for(let r=0;r<e.length;r++)e[r]=Rr(e[r],t,i,s,n+1);return e}for(let r of Object.keys(e)){let o=Rr(e[r],r,i,s,n+1),a=R_.test(r)?Ne(r):r;if(a===r){e[r]=o;continue}delete e[r];let l=e[a];Array.isArray(l)&&Array.isArray(o)?e[a]=l.concat(o):l&&o&&typeof l=="object"&&typeof o=="object"?e[a]={...l,...o}:e[a]=o}return e}function jr(e,t){if(!e||typeof e!="object")return e;let i=e.event==="$snapshot";for(let s of["properties","$set","$set_once"])e[s]&&typeof e[s]=="object"&&(e[s]=Rr(e[s],s,t,i,0));return e}var L_=/^[^\s@<>()]+@[^\s@<>()]+\.[^\s@<>()]{2,}$/,D_=["email"],N_=["phone","phonenumber","phone_number","tel","telefone"];function Vr(e){if(typeof e!="string")return null;let t=e.trim().toLowerCase();return L_.test(t)&&t.length<=254?t:null}function Hr(e,t){if(typeof e!="string")return null;let i=e.trim().replace(/\s*(ext\.?|x|#)\s*\d+$/i,""),s=i.replace(/\D/g,"");i.startsWith("00")&&(s=s.slice(2));let n=i.startsWith("+")||i.startsWith("00");if(!n&&t){let r=String(t).replace(/\D/g,""),o=["39","378","379"].includes(r);r&&!s.startsWith(r)&&(s=r+(o?s:s.replace(/^0/,"")))}return s.length<7||s.length>15?null:n||t?`+${s}`:s}function Hu(e){let t={},i;try{i=new URL(e)}catch{return t}for(let[s,n]of i.searchParams){let r=s.toLowerCase();!t.email&&D_.includes(r)&&(t.email=Vr(n)||void 0),!t.phone&&N_.includes(r)&&(t.phone=Hr(n)||void 0)}return Object.fromEntries(Object.entries(t).filter(([,s])=>s))}var Ur=["ph_anon_id","ph_distinct_id","ph_session_id","contact_id"],j_=/\/widget\/(form|survey|booking)\//,Gu=["buy.stripe.com","checkout.stripe.com"],V_="input[type=email], input[type=tel], input[name*=email i], input[name*=phone i]",Wr="data-f10x-field";function Bu(e,t,i){if(!e||e.hasAttribute("data-f10x-skip"))return;let s=i&&e.querySelector(V_);for(let[n,r]of Object.entries(t)){let o=e.querySelector(`[name="${CSS.escape(n)}"]`);if(o)o.tagName==="INPUT"&&(o.type==="hidden"||o.value===""||o.hasAttribute(Wr))&&(o.value=r);else if(s){let a=document.createElement("input");a.type="hidden",a.name=n,a.value=r,a.setAttribute(Wr,""),e.appendChild(a)}}}var Wu=new WeakMap;function H_(e){for(let t of document.querySelectorAll("input[data-q]")){let i=e[t.getAttribute("data-q")];if(i==null)continue;let s=Wu.get(t);s!==i&&(s===void 0&&t.value!==""||(t.value=i,Wu.set(t,i),t.setAttribute(Wr,""),t.dispatchEvent(new Event("input",{bubbles:!0})),t.dispatchEvent(new Event("change",{bubbles:!0}))))}}function Br(e,t,i){let s;try{s=new URL(e,i)}catch{return null}if(s.protocol!=="http:"&&s.protocol!=="https:")return null;let n=s.href;for(let[r,o]of Object.entries(t))Ur.includes(r)?s.searchParams.set(r,o):s.searchParams.has(r)||s.searchParams.set(r,o);return Gu.includes(s.hostname)&&t.ph_distinct_id&&!s.searchParams.has("client_reference_id")&&s.searchParams.set("client_reference_id",t.ph_distinct_id),s.href===n?null:s.href}var Uu=e=>{try{return new URL(e,location.href).hostname}catch{return""}};function zr({values:e,checkoutHosts:t,addFields:i}){let s=new Set([...Gu,...t||[]].map(u=>u.toLowerCase())),n=!1,r=0,o=u=>{for(let d of document.querySelectorAll("a[href]")){if(!s.has(Uu(d.getAttribute("href"))))continue;let h=Br(d.getAttribute("href"),u,location.href);h&&d.setAttribute("href",h)}},a=u=>{for(let d of document.querySelectorAll("iframe[src]")){let h=d.getAttribute("src");if(!j_.test(h))continue;let p=Br(h,u,location.href);p&&d.setAttribute("src",p)}},l=(u={})=>{u.iframes&&(n=!0);let d=e();for(let h of document.forms)Bu(h,d,i);H_(d),o(d),n&&a(d)},c=()=>{r||(r=setTimeout(()=>{r=0,l()},50))};return new MutationObserver(c).observe(document.documentElement,{childList:!0,subtree:!0}),document.addEventListener("submit",u=>Bu(u.target,e(),i),!0),document.addEventListener("click",u=>{let d=u.target instanceof Element?u.target.closest("a[href]"):null;if(!d||!s.has(Uu(d.getAttribute("href"))))return;let h=Br(d.getAttribute("href"),e(),location.href);h&&d.setAttribute("href",h)},!0),l(),{refresh:l}}var B_=/e-?mail/i,W_=/phone|telefone|telem[oó]vel|celular|whatsapp|(^|[\s_.-])(tel|mobile)($|[\s_.-])/i,qu=new Set(["hidden","password","checkbox","radio","search","submit","button","file","reset","image"]),Zu=e=>[e.name,e.id,e.getAttribute("data-q"),e.getAttribute("autocomplete")].filter(Boolean).join(" "),Yu=e=>e.type==="email"||B_.test(Zu(e)),Xu=e=>e.type==="tel"||e.type!=="email"&&W_.test(Zu(e));function U_(e){let t=e.closest(".iti")||e.closest('.form-builder--item, [class*="phone"]')||e.parentElement,i=t&&t.querySelector('.iti__selected-dial-code, [class*="dial-code"], [class*="dialCode"]'),s=i&&i.textContent;if(s&&/\+?\d{1,4}/.test(s))return s.match(/\d{1,4}/)[0];let n=t&&t.querySelector(".iti__selected-flag, .iti__selected-country"),r=n&&(n.getAttribute("title")||n.getAttribute("aria-label")||"").match(/\+(\d{1,4})/);return r?r[1]:null}function z_(e){if(!(e instanceof HTMLInputElement)||qu.has(e.type))return{};if(Yu(e)){let t=Vr(e.value);return t?{email:t}:{}}if(Xu(e)){let t=Hr(e.value,U_(e));return t?{phone:t}:{}}return{}}function zu(e){let t={};for(let i of e){let s=z_(i);s.email&&!t.email&&(t.email=s.email),s.phone&&!t.phone&&(t.phone=s.phone)}return t}function G_(e){let t=e.parentElement;for(let i=0;t&&t!==document.body&&t!==document.documentElement&&i<12;i++,t=t.parentElement)if([...t.querySelectorAll("input")].some(n=>!qu.has(n.type)&&(Yu(n)||Xu(n))))return t.querySelectorAll("button[type=submit], input[type=submit]").length===1?t:null;return null}var q_=e=>[...e.querySelectorAll("input, select, textarea")].some(t=>t.willValidate&&!t.checkValidity());function Ju(e){document.addEventListener("submit",t=>{if(!(t.target instanceof HTMLFormElement))return;let i=zu(t.target.querySelectorAll("input"));(i.email||i.phone)&&e(i,"form")},!0),document.addEventListener("click",t=>{let i=t.target instanceof Element?t.target.closest("button[type=submit], input[type=submit]"):null;if(!i||i.closest("form")||i.getAttribute("type")!=="submit")return;let s=G_(i);if(!s||q_(s))return;let n=zu(s.querySelectorAll("input"));(n.email||n.phone)&&e(n,"form")},!0)}var Xr="1.4.0",Gr="f10x_consent",Jr="f10x_contact_id",Z_="contact_id",Y_=/^[A-Za-z0-9_-]{6,128}$/,X_=1e3,Ku="[@funnel10x/tracking] another PostHog is already on this page (a PostHog tag or snippet): nothing is tracked. Remove it: this snippet is PostHog.";function Qu(){let e=window.posthog;return!!(e&&e!==Te&&(e.__SV||e.__loaded))}var J_={defaults:"2026-08-30",person_profiles:"identified_only",advanced_disable_feature_flags:!0,disable_surveys:!0,disable_conversations:!0,disable_product_tours:!0,disable_web_experiments:!0},Kr=e=>{try{return e==="session"?window.sessionStorage:window.localStorage}catch{return null}},ed=(e,t)=>{var i,s;try{return(s=(i=Kr(e))==null?void 0:i.getItem(t))!=null?s:null}catch{return null}},qr=(e,t,i)=>{var s;try{(s=Kr(e))==null||s.setItem(t,i)}catch{}};function td(e){let t={};try{let i=new URL(e).searchParams;for(let s of Ur){let n=i.get(s);n&&Y_.test(n)&&(t[s]=n)}}catch{}return t}var Zr=e=>Object.fromEntries(Object.entries(e).filter(([,t])=>t!=null&&t!==""));function id(){for(let i of["local","session"]){let s=Kr(i);if(s)try{for(let n of Object.keys(s))(n.startsWith("ph_")||n===Jr)&&s.removeItem(n)}catch{}}let e=location.hostname.split("."),t=e.map((i,s)=>e.slice(s).join(".")).filter(i=>i.includes("."));for(let i of document.cookie.split(";")){let s=i.split("=")[0].trim();if(s.startsWith("ph_")){document.cookie=`${s}=; Max-Age=0; path=/`;for(let n of t)document.cookie=`${s}=; Max-Age=0; path=/; domain=.${n}`}}}function bm(e={}){if(window.__f10xTracking)return Wi(window.__f10xTracking);let t,i=typeof e.consent=="boolean",s=location.href;if(i&&/_\d+\/?$/.test(location.pathname))return t=Yr("preview"),Wi(t);let n=!1;try{n=window.top!==window.self}catch{n=!0}if(n){let A=Zr({...Nr(s),...td(s)});return zr({values:()=>A,checkoutHosts:e.checkoutHosts,addFields:e.addFields!==!1}),t=Yr("frame",()=>A),Wi(t)}if(Qu())return console.warn(Ku),t=Yr("conflict"),Wi(t);let r=Nr(s),o=td(s)[Z_]||null,a=[],l=!1,c=null,u=null,d=()=>{let A={...r};return l&&(A.ph_anon_id=Te.get_property("$device_id"),A.ph_distinct_id=Te.get_distinct_id(),A.ph_session_id=Te.get_session_id(),u&&(A.contact_id=u)),Zr(A)},h=zr({values:d,checkoutHosts:e.checkoutHosts,addFields:e.addFields!==!1}),p=new Set,v=[],_=(A,N)=>{if(!l){i&&w()==="denied"||v.push([A,N]);return}let L=Object.fromEntries(Object.entries(A).filter(([V,C])=>C&&!p.has(`${V}:${C}`)));if(Object.keys(L).length){for(let[V,C]of Object.entries(L))p.add(`${V}:${C}`);Te.capture("contact_captured",{...L,contact_source:N})}},g=Hu(s);Ju(_);let y=Zr({tracking_version:Xr,page_version:i?e.pageVersion||1:void 0,ab_test:i&&e.test||void 0}),m=A=>A&&(A.event!=="$snapshot"&&(A.properties={...A.properties,...y,...c?{fingerprint:c}:{}}),jr(A,location.href)),w=()=>{let A=ed("local",Gr);return A==="granted"||A==="denied"?A:null},P=!i||e.consent===!1||w()==="granted",$=i?"direct":"tag",k=!1,T=!1,S=A=>{var N;return{...A,compress_events:!1,...((N=e.posthog)==null?void 0:N.session_recording)||{},maskCapturedNetworkRequestFn:L=>({...L,name:Ne(L.name,location.href),requestBody:void 0,responseBody:void 0})}};async function I(){if(k||T)return;k=!0;try{let L=await Du.load({monitoring:!1}),V=await Promise.race([L.get(),new Promise(C=>setTimeout(C,X_))]);c=(V==null?void 0:V.visitorId)||null}catch{c=null}if(k=!1,!P)return;if(Qu()){console.warn(Ku),$="conflict";return}T=!0;let{session_recording:A,...N}=e.posthog||{};Te.init(e.key,{api_host:e.apiHost||"https://us.i.posthog.com",ui_host:"https://us.posthog.com",...J_,custom_campaign_params:[...Lr,"utm_id","utm_placement",...Dr],...N,before_send:m,loaded:L=>{L.set_config({session_recording:S(L.config.session_recording)}),L.has_opted_out_capturing()&&L.opt_in_capturing({captureEventName:!1});let V=L.get_property("$initial_person_info"),C=document.referrer?Ne(document.referrer):"$direct";L.register({$initial_person_info:V&&typeof V=="object"?{...V,r:Ne(V.r),u:Ne(V.u)}:{r:C,u:Ne(location.href)}}),u=o||ed("session",Jr),o&&(qr("session",Jr,o),L.get_distinct_id()!==o&&L.identify(o)),l=!0,h.refresh({iframes:!0}),_(g,"url");for(let[B,W]of v.splice(0))_(B,W);for(let B of a.splice(0))B(!0)}})}return P?I():(w()==="denied"&&id(),h.refresh({iframes:!0})),t={version:Xr,get mode(){return $},consent:()=>i&&e.consent?w():null,grant(){qr("local",Gr,"granted"),P=!0,T?l||(Te.set_config({disable_persistence:!1}),Te.opt_in_capturing({captureEventName:!1}),l=!0,h.refresh({iframes:!0})):I()},deny(){var A,N;qr("local",Gr,"denied"),P=!1,v=[],T&&(Te.opt_out_capturing(),(N=(A=Te).stopSessionRecording)==null||N.call(A),Te.set_config({disable_persistence:!0}),id(),l=!1,u=null,h.refresh())},onReady(A){l?A(!0):a.push(A)},fields:d,capture(A,N){l&&Te.capture(A,N)},posthog:Te},Wi(t)}function Wi(e){return window.__f10xTracking=e,window.f10xTracking=e,e}function Yr(e,t=()=>({})){return{version:Xr,mode:e,consent:()=>null,grant(){},deny(){},onReady(){},fields:t,capture(){},posthog:null}}export{ju as ALLOWED_PARAMS,Gr as CONSENT_KEY,Xr as VERSION,jr as cleanEvent,Ne as cleanUrl,bm as init};
10
+ timeBetweenLoadAndGet: ${r-n}
11
+ visitorId: ${c.visitorId}
12
+ components: ${tt(s)}
13
+ \`\`\``),c}}}function Bo(){if(!(window.__fpjs_d_m||Math.random()>=.001))try{let e=new XMLHttpRequest;e.open("get",`https://m1.openfpcdn.io/fingerprintjs/v${je}/npm-monitoring`,!0),e.send()}catch(e){console.error(e)}}async function $o(e={}){let{delayFallback:t,debug:n,monitoring:o=!0}=e;o&&Bo(),await Xo(t);let r=Go({cache:{},debug:n});return zo(r,n)}var ot={load:$o,hashComponents:nt,componentsToDebugString:tt};var Jo=["utm_source","utm_medium","utm_campaign","utm_content","utm_term","utm_id","utm_placement"],Uo=["fbclid","gclid","gbraid","wbraid","gad_source","gad_campaignid","msclkid","ctwa_clid"],fe=["a_campaign_id","a_adset_id","a_ad_id","h_ad_id","fbc_id"],me=["lp","narrative"],rt=[...Jo,...Uo,...fe,...me],Ko=new Set(rt);function pe(e){let t={},n;try{n=new URL(e)}catch{return t}for(let[o,r]of n.searchParams){let s=o.toLowerCase();Ko.has(s)&&r!==""&&!(s in t)&&(t[s]=r)}return t}var Qo=/^[^\s@<>()]+@[^\s@<>()]+\.[^\s@<>()]{2,}$/,qo=["email"],er=["phone","phonenumber","phone_number","tel","telefone"];function he(e){if(typeof e!="string")return null;let t=e.trim().toLowerCase();return Qo.test(t)&&t.length<=254?t:null}function ge(e,t){if(typeof e!="string")return null;let n=e.trim().replace(/\s*(ext\.?|x|#)\s*\d+$/i,""),o=n.replace(/\D/g,"");n.startsWith("00")&&(o=o.slice(2));let r=n.startsWith("+")||n.startsWith("00");if(!r&&t){let s=String(t).replace(/\D/g,""),c=["39","378","379"].includes(s);s&&!o.startsWith(s)&&(o=s+(c?o:o.replace(/^0/,"")))}return o.length<7||o.length>15?null:r||t?`+${o}`:o}function it(e){let t={},n;try{n=new URL(e)}catch{return t}for(let[o,r]of n.searchParams){let s=o.toLowerCase();!t.email&&qo.includes(s)&&(t.email=he(r)||void 0),!t.phone&&er.includes(s)&&(t.phone=ge(r)||void 0)}return Object.fromEntries(Object.entries(t).filter(([,o])=>o))}var we=["ph_anon_id","ph_distinct_id","ph_session_id","contact_id"],tr=/\/widget\/(form|survey|booking)\//,lt=["buy.stripe.com","checkout.stripe.com"],nr="input[type=email], input[type=tel], input[name*=email i], input[name*=phone i]",be="data-f10x-field";function st(e,t,n){if(!e||e.hasAttribute("data-f10x-skip"))return;let o=n&&e.querySelector(nr);for(let[r,s]of Object.entries(t)){let c=e.querySelector(`[name="${CSS.escape(r)}"]`);if(c)c.tagName==="INPUT"&&(c.type==="hidden"||c.value===""||c.hasAttribute(be))&&(c.value=s);else if(o){let u=document.createElement("input");u.type="hidden",u.name=r,u.value=s,u.setAttribute(be,""),e.appendChild(u)}}}var at=new WeakMap;function or(e){for(let t of document.querySelectorAll("input[data-q]")){let n=e[t.getAttribute("data-q")];if(n==null)continue;let o=at.get(t);o!==n&&(o===void 0&&t.value!==""||(t.value=n,at.set(t,n),t.setAttribute(be,""),t.dispatchEvent(new Event("input",{bubbles:!0})),t.dispatchEvent(new Event("change",{bubbles:!0}))))}}function ye(e,t,n){let o;try{o=new URL(e,n)}catch{return null}if(o.protocol!=="http:"&&o.protocol!=="https:")return null;let r=o.href;for(let[s,c]of Object.entries(t))we.includes(s)?o.searchParams.set(s,c):o.searchParams.has(s)||o.searchParams.set(s,c);return lt.includes(o.hostname)&&t.ph_distinct_id&&!o.searchParams.has("client_reference_id")&&o.searchParams.set("client_reference_id",t.ph_distinct_id),o.href===r?null:o.href}var ct=e=>{try{return new URL(e,location.href).hostname}catch{return""}};function _e({values:e,checkoutHosts:t,addFields:n}){let o=new Set([...lt,...t||[]].map(a=>a.toLowerCase())),r=!1,s=0,c=a=>{for(let i of document.querySelectorAll("a[href]")){if(!o.has(ct(i.getAttribute("href"))))continue;let p=ye(i.getAttribute("href"),a,location.href);p&&i.setAttribute("href",p)}},u=a=>{for(let i of document.querySelectorAll("iframe[src]")){let p=i.getAttribute("src");if(!tr.test(p))continue;let m=ye(p,a,location.href);m&&i.setAttribute("src",m)}},d=(a={})=>{a.iframes&&(r=!0);let i=e();for(let p of document.forms)st(p,i,n);or(i),c(i),r&&u(i)},l=()=>{s||(s=setTimeout(()=>{s=0,d()},50))};return new MutationObserver(l).observe(document.documentElement,{childList:!0,subtree:!0}),document.addEventListener("submit",a=>st(a.target,e(),n),!0),document.addEventListener("click",a=>{let i=a.target instanceof Element?a.target.closest("a[href]"):null;if(!i||!o.has(ct(i.getAttribute("href"))))return;let p=ye(i.getAttribute("href"),e(),location.href);p&&i.setAttribute("href",p)},!0),d(),{refresh:d}}var rr=/e-?mail/i,ir=/phone|telefone|telem[oó]vel|celular|whatsapp|(^|[\s_.-])(tel|mobile)($|[\s_.-])/i,dt=new Set(["hidden","password","checkbox","radio","search","submit","button","file","reset","image"]),ft=e=>[e.name,e.id,e.getAttribute("data-q"),e.getAttribute("autocomplete")].filter(Boolean).join(" "),mt=e=>e.type==="email"||rr.test(ft(e)),pt=e=>e.type==="tel"||e.type!=="email"&&ir.test(ft(e));function sr(e){let t=e.closest(".iti")||e.closest('.form-builder--item, [class*="phone"]')||e.parentElement,n=t&&t.querySelector('.iti__selected-dial-code, [class*="dial-code"], [class*="dialCode"]'),o=n&&n.textContent;if(o&&/\+?\d{1,4}/.test(o))return o.match(/\d{1,4}/)[0];let r=t&&t.querySelector(".iti__selected-flag, .iti__selected-country"),s=r&&(r.getAttribute("title")||r.getAttribute("aria-label")||"").match(/\+(\d{1,4})/);return s?s[1]:null}function ar(e){if(!(e instanceof HTMLInputElement)||dt.has(e.type))return{};if(mt(e)){let t=he(e.value);return t?{email:t}:{}}if(pt(e)){let t=ge(e.value,sr(e));return t?{phone:t}:{}}return{}}function ut(e){let t={};for(let n of e){let o=ar(n);o.email&&!t.email&&(t.email=o.email),o.phone&&!t.phone&&(t.phone=o.phone)}return t}function cr(e){let t=e.parentElement;for(let n=0;t&&t!==document.body&&t!==document.documentElement&&n<12;n++,t=t.parentElement)if([...t.querySelectorAll("input")].some(r=>!dt.has(r.type)&&(mt(r)||pt(r))))return t.querySelectorAll("button[type=submit], input[type=submit]").length===1?t:null;return null}var ur=e=>[...e.querySelectorAll("input, select, textarea")].some(t=>t.willValidate&&!t.checkValidity());function ht(e){document.addEventListener("submit",t=>{if(!(t.target instanceof HTMLFormElement))return;let n=ut(t.target.querySelectorAll("input"));(n.email||n.phone)&&e(n,"form")},!0),document.addEventListener("click",t=>{let n=t.target instanceof Element?t.target.closest("button[type=submit], input[type=submit]"):null;if(!n||n.closest("form")||n.getAttribute("type")!=="submit")return;let o=cr(n);if(!o||ur(o))return;let r=ut(o.querySelectorAll("input"));(r.email||r.phone)&&e(r,"form")},!0)}var Le="2.0.0",ve="f10x_consent",lr=typeof R=="object"?R:[],dr="1",fr=/^\d+\.\d+\.\d+$/,Ae="f10x_contact_id",mr="contact_id",pr=/^[A-Za-z0-9_-]{6,128}$/,gt=1e3,yt="[@funnel10x/tracking] another PostHog is already on this page (a PostHog tag or snippet): nothing is tracked. Remove it: this snippet is PostHog.",hr="[@funnel10x/tracking] another PostHog init reached this page after the snippet (a PostHog tag or snippet): it is ignored, and every event carries tracking_conflict. Remove it: this snippet is PostHog.",gr={defaults:"2026-08-30",person_profiles:"identified_only",strict_script_versioning:!0},Pe=e=>{try{return e==="session"?window.sessionStorage:window.localStorage}catch{return null}},bt=(e,t)=>{var n,o;try{return(o=(n=Pe(e))==null?void 0:n.getItem(t))!=null?o:null}catch{return null}},Se=(e,t,n)=>{var o;try{(o=Pe(e))==null||o.setItem(t,n)}catch{}};function wt(e){let t={};try{let n=new URL(e).searchParams;for(let o of we){let r=n.get(o);r&&pr.test(r)&&(t[o]=r)}}catch{}return t}var xe=e=>Object.fromEntries(Object.entries(e).filter(([,t])=>t!=null&&t!==""));function _t(){for(let n of["local","session"]){let o=Pe(n);if(o)try{for(let r of Object.keys(o))(r.startsWith("ph_")||r===Ae)&&o.removeItem(r)}catch{}}let e=location.hostname.split("."),t=e.map((n,o)=>e.slice(o).join(".")).filter(n=>n.includes("."));for(let n of document.cookie.split(";")){let o=n.split("=")[0].trim();if(o.startsWith("ph_")){document.cookie=`${o}=; Max-Age=0; path=/`;for(let r of t)document.cookie=`${o}=; Max-Age=0; path=/; domain=.${r}`}}}function yr(){let e=window.posthog;return!e||e.__f10x?!1:!!(e.__SV||e.__loaded||Array.isArray(e._i)||Array.isArray(e)&&e.length)}var vt=e=>e==null||e==="posthog";function br(e){let t=[],n=o=>{for(let r of lr)o[r]=(...s)=>{o.push([r,...s])}};return n(t),t._i=[],t.__SV=1,t.__f10x=!0,t.people=[],t.toString=o=>`posthog${o?"":" (stub)"}`,t.people.toString=()=>`${t.toString(1)}.people (stub)`,t.init=(o,r,s)=>{vt(s)?e():t[s]||(t[s]=[],n(t[s])),t._i.push([o,r,s])},t}function wr(e,t){let n=(e||"https://us.i.posthog.com").trim().replace(/\/$/,"").replace(".i.posthog.com","-assets.i.posthog.com"),o=dr;return t&&(fr.test(t)?o=t:console.warn(`[@funnel10x/tracking] sdkVersion "${t}" is not an exact version (1.2.3): the 1.x channel is loaded.`)),`${n}/static/${o}/array.js`}function Tr(e={}){if(window.__f10xTracking)return z(window.__f10xTracking);let t,n=typeof e.consent=="boolean",o=location.href;if(n&&/_\d+\/?$/.test(location.pathname))return t=ke("preview"),z(t);let r=!1;try{r=window.top!==window.self}catch{r=!0}if(r){let f=xe({...pe(o),...wt(o)});return _e({values:()=>f,checkoutHosts:e.checkoutHosts,addFields:e.addFields!==!1}),t=ke("frame",()=>f),z(t)}if(yr())return console.warn(yt),t=ke("conflict"),z(t);let s=pe(o),c=wt(o)[mr]||null,u=[],d="idle",l=null,a=!1,i=null,p=null,m=null,y=!1,w=null,I=!1,D=!1,B=wr(e.apiHost,e.sdkVersion),$=()=>{y||console.warn(hr),y=!0},C=br($);window.posthog=C;let J=()=>{let f={...s};return a&&(f.ph_anon_id=l.get_property("$device_id"),f.ph_distinct_id=l.get_distinct_id(),f.ph_session_id=l.get_session_id(),w&&(f.contact_id=w)),xe(f)},V=_e({values:J,checkoutHosts:e.checkoutHosts,addFields:e.addFields!==!1}),U=new Set,g=[],oe=(f,S)=>{if(!a){n&&K()==="denied"||g.push([f,S]);return}let L=Object.fromEntries(Object.entries(f).filter(([F,T])=>T&&!U.has(`${F}:${T}`)));if(Object.keys(L).length){for(let[F,T]of Object.entries(L))U.add(`${F}:${T}`);l.capture("contact_captured",{...L,contact_source:S})}},St=it(o);ht(oe);let xt=xe({tracking_version:Le,page_version:n?e.pageVersion||1:void 0,ab_test:n&&e.test||void 0}),kt=f=>(!f||f.event==="$snapshot"||(f.properties={...f.properties,...xt,...i?{fingerprint:i}:{},fingerprint_ms:p,...y?{tracking_conflict:!0}:{}}),f),K=()=>{let f=bt("local",ve);return f==="granted"||f==="denied"?f:null},H=!n||e.consent===!1||K()==="granted",re=n?"direct":"tag",Lt=()=>{if(m)return m;let f=Date.now(),S=(async()=>{let F=await(await ot.load({monitoring:!1})).get();i=(F==null?void 0:F.visitorId)||null,p=Date.now()-f})().catch(()=>{p===null&&(p=Date.now()-f)});return m=Promise.race([S,new Promise(L=>setTimeout(L,gt))]).then(()=>{p===null&&(p=gt)}),m},At=()=>{if(I)return;I=!0;let f=document.createElement("link");f.rel="preload",f.as="script",f.crossOrigin="anonymous",f.href=B,document.head.appendChild(f)},Fe=()=>{let f=e.posthog||{};return{api_host:e.apiHost||"https://us.i.posthog.com",ui_host:"https://us.posthog.com",...gr,custom_campaign_params:[...fe,"utm_id","utm_placement",...me],...f,before_send:kt,loaded:Ft}},Pt=()=>{let f=window.posthog;if(f===C){if(C._i.unshift([e.key,Fe()]),d="injected",D)return;D=!0;let S=document.createElement("script");S.async=!0,S.crossOrigin="anonymous",S.src=B,document.head.appendChild(S);return}if(D&&f&&!f.__loaded&&typeof f.init=="function"){d="injected",f.init(e.key,Fe()),l&&typeof l._execute_array=="function"&&l._execute_array(C);return}console.warn(yt),re="conflict",d="idle"},Ce=()=>{d!=="idle"||re==="conflict"||(d="waiting",Promise.resolve().then(async()=>{if(!H){d="idle";return}if(At(),await Lt(),!H){d="idle";return}Pt()}))};function Ft(f){l=f,d="loaded";let S=f.init;f.init=function(L,F,T){return vt(T)&&$(),S.apply(this,arguments)},f.has_opted_out_capturing()&&f.opt_in_capturing({captureEventName:!1}),w=c||bt("session",Ae),c&&(Se("session",Ae,c),f.get_distinct_id()!==c&&f.identify(c)),a=!0,V.refresh({iframes:!0}),oe(St,"url");for(let[L,F]of g.splice(0))oe(L,F);for(let L of u.splice(0))L(!0)}return H?Ce():(K()==="denied"&&_t(),V.refresh({iframes:!0})),t={version:Le,get mode(){return re},consent:()=>n&&e.consent?K():null,grant(){Se("local",ve,"granted"),H=!0,l?a||(l.set_config({disable_persistence:!1}),l.opt_in_capturing({captureEventName:!1}),a=!0,l.capture("$pageview"),V.refresh({iframes:!0})):Ce()},deny(){var f;if(Se("local",ve,"denied"),H=!1,g=[],!l){C._i.length=0,d==="injected"&&(d="idle");return}l.opt_out_capturing(),(f=l.stopSessionRecording)==null||f.call(l),l.set_config({disable_persistence:!0}),_t(),a=!1,w=null,V.refresh()},onReady(f){a?f(!0):u.push(f)},fields:J,capture(f,S){a&&l.capture(f,S)},get posthog(){return l||(window.posthog===C?C:null)}},z(t)}function z(e){return window.__f10xTracking=e,window.f10xTracking=e,e}function ke(e,t=()=>({})){return{version:Le,mode:e,consent:()=>null,grant(){},deny(){},onReady(){},fields:t,capture(){},posthog:null}}export{rt as ALLOWED_PARAMS,ve as CONSENT_KEY,Le as VERSION,Tr as init};