1!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},t=(new e.Error).stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="02d3c22c-12fa-410f-967c-4c6f2ee764be",e._sentryDebugIdIdentifier="sentry-dbid-02d3c22c-12fa-410f-967c-4c6f2ee764be")}catch(e){}}();"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[32633],{26631:(e,t,i)=>{i.d(t,{Ay:()=>aJ});var s="undefined"!=typeof window?window:void 0,r="undefined"!=typeof globalThis?globalThis:s,n=null==r?void 0:r.navigator,o=null==r?void 0:r.document,a=null==r?void 0:r.location,l=null==r?void 0:r.fetch,u=null!=r&&r.XMLHttpRequest&&"withCredentials"in new r.XMLHttpRequest?r.XMLHttpRequest:void 0,h=null==r?void 0:r.AbortController,c=null==r?void 0:r.CompressionStream,d=null==n?void 0:n.userAgent;function v(){return!(!s||!1===s.navigator.onLine)}var p="undefined"!=typeof globalThis?globalThis:s;p&&"undefined"==typeof self&&(p.self=p),p&&"undefined"==typeof File&&(p.File=function(){});var g=null!=s?s:{},f={DEBUG:!1,LIB_VERSION:"0.7.0",LIB_NAME:"browser-common"};function _(e,t,i,s,r,n,o){try{var a=e[n](o),l=a.value}catch(e){return void i(e)}a.done?t(l):Promise.resolve(l).then(s,r)}function m(e){return function(){var t=this,i=arguments;return new Promise(function(s,r){var n=e.apply(t,i);function o(e){_(n,s,r,o,a,"next",e)}function a(e){_(n,s,r,o,a,"throw",e)}o(void 0)})}}function y(){return(y=Object.assign?Object.assign.bind():function(e){for(var t=1;arguments.length>t;t++){var i=arguments[t];for(var s in i)({}).hasOwnProperty.call(i,s)&&(e[s]=i[s])}return e}).apply(null,arguments)}function b(e,t){if(null==e)return{};var i={};for(var s in e)if(({}).hasOwnProperty.call(e,s)){if(-1!==t.indexOf(s))continue;i[s]=e[s]}return i}var w=e=>{if("string"!=typeof e)return e;try{return JSON.parse(e)}catch(t){return e}};function x(e){return"string"==typeof e||e}function k(e){return"string"==typeof e?e:void 0}var E=["$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","irclid","_kx","$session_id","$window_id","$lib","$lib_version","$device_id","$is_server"],S=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.SurveysSeen="surveys_seen",e.Surveys="surveys",e.RemoteConfig="remote_config",e.FlagsEndpointWasHit="flags_endpoint_was_hit",e.DeviceId="device_id",e}({}),P=function(e){return e.GZipJS="gzip-js",e.Base64="base64",e}({}),I=["$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"],F=["token"],C="[Truncated]",$="[Unserializable]";function O(e){for(var t="",i=0;e.length>i;i++){var s=e.charCodeAt(i);if(55296>s||s>56319)t+=56320>s||s>57343?e[i]:"�";else{var r=e.charCodeAt(i+1);56320>r||r>57343?t+="�":(t+=e[i]+e[i+1],i++)}}return t}var T=["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","hub
1spot","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"],R=function(e,t){if(void 0===t&&(t=[]),!e)return!1;var i=e.toLowerCase();return T.concat(t).some(e=>{var t=e.toLowerCase();return -1!==i.indexOf(t)})};function L(e,t){return -1!==e.indexOf(t)}var M=function(e){return e.trim()},A=function(e){return e.replace(/^\$/,"")};function D(e){var t,i=[];return null!==(t=JSON.stringify(e,function(e,t){if("bigint"==typeof t)return t.toString();if("function"!=typeof t&&"symbol"!=typeof t){if(t instanceof Error)return{name:t.name,message:t.message,stack:t.stack};if(t&&"object"==typeof t){for(;i.length>0&&i[i.length-1]!==this;)i.pop();if(i.includes(t))return"[Circular]";i.push(t)}return t}}))&&void 0!==t?t:"null"}var N=Object.prototype,j=N.hasOwnProperty,q=N.toString,B=Array.isArray||function(e){return"[object Array]"===q.call(e)},H=e=>"function"==typeof e,U=e=>e===Object(e)&&!B(e),z=e=>{if(U(e)){for(var t in e)if(j.call(e,t))return!1;return!0}return!1},V=e=>void 0===e,W=e=>"[object String]"==q.call(e),G=e=>W(e)&&0===e.trim().length,Y=e=>null===e,J=e=>V(e)||Y(e),K=e=>"[object Number]"==q.call(e)&&e==e,Z=e=>K(e)&&e>0,X=e=>"[object Boolean]"===q.call(e),Q=e=>e instanceof FormData,ee=e=>L(I,e),et=e=>L(F,e);function ei(e){return null===e||"object"!=typeof e}function es(e,t){return({}).toString.call(e)==="[object "+t+"]"}function er(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 eo(e,Error)}}function en(e){return"undefined"!=typeof Event&&eo(e,Event)}function eo(e,t){try{return e instanceof t}catch(e){return!1}}var ea=[!0,"true",1,"1","yes"],el=e=>L(ea,e),eu=[!1,"false",0,"0","no"];function eh(e,t,i,s,r){return t>i&&(s.warn("min cannot be greater than max."),t=i),K(e)?e>i?(s.warn(" cannot be greater than max: "+i+". Using max value instead."),i):t>e?(s.warn(" cannot be less than min: "+t+". Using min value instead."),t):e:(s.warn(" must be a number. using max or fallback. max: "+i+", fallback: "+r),eh(r||i,t,i,s))}class ec{constructor(e){this.k={},this.S=e.S,this.C=eh(e.bucketSize,0,100,e.I),this.R=eh(e.refillRate,0,this.C,e.I),this.A=eh(e.refillInterval,0,864e5,e.I)}O(e,t){var i=Math.floor((t-e.lastAccess)/this.A);i>0&&(e.tokens=Math.min(e.tokens+i*this.R,this.C),e.lastAccess=e.lastAccess+i*this.A)}consumeRateLimit(e){var t,i=Date.now(),s=String(e),r=this.k[s];return r?this.O(r,i):this.k[s]=r={tokens:this.C,lastAccess:i},0===r.tokens||(r.tokens--,0===r.tokens&&(null==(t=this.S)||t.call(this,e)),0===r.tokens)}stop(){this.k={}}}var ed="Mobile",ev="Android",ep="Tablet",eg=ev+" "+ep,ef="iPad",e_="Apple",em=e_+" Watch",ey="Safari",eb="BlackBerry",ew="Samsung",ex=ew+"Browser",ek=ew+" Internet",eE="Chrome",eS=eE+" OS",eP=eE+" iOS",eI="Internet Explorer",eF=eI+" "+ed,eC="Opera",e$=eC+" Mini",eO="Edge",eT="Microsoft "+eO,eR="Firefox",eL=eR+" iOS",eM="Nintendo",eA="PlayStation",eD="Xbox",eN=ev+" "+ed,ej=ed+" "+ey,eq="Windows",eB=eq+" Phone",eH="Nokia",eU="Ouya",ez="Generic",eV=ez+" "+ed.toLowerCase(),eW=ez+" "+ep.toLowerCase(),eG="Konqueror",eY="Oculus Browser",eJ="Vivaldi",eK="Yandex",eZ="Whale",eX="DuckDuckGo",eQ="Pale Moon",e0="Waterfox",e1="Brave",e2="Google Search App",e3="(\\d+(\\.\\d+)?)",e5=RegExp("Version/"+e3),e6=RegExp(eD,"i"),e4=RegExp(eA+" \\w+","i"),e8=RegExp(eM+" \\w+","i"),e9=RegExp(eb+"|PlayBook|BB10","i"),e7={"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"},te=function(e,t,i,s){var r;return t=t||"",(null!=i&&i.brave?e1:null)||(null!=s&&s.detectGoogleSearchApp&&L(e,"GSA/")?e2:L(e," OPR/")&&L(e,"Mini")?e$:L(e," OPR/")?eC:e9.test(e)?eb:L(e,"IE"+ed)||L(e,"WPDesktop")?eF:L(e,"OculusBrowser")?eY:L(e,ex)?ek:L(e,eO)||L(e,"Edg/")?eT:L(e,eJ+"/")?eJ:L(e,"YaBrowser/")?eK:L(e,eZ+"/")?eZ:L(e,eX+"/")||L(e,"Ddg/")?eX:L(e,"FBIOS")?"Facebook "+ed:L(e,"UCWEB")||L(e,"UCBrowser")?"UC Browser":L(e,"CriOS")?eP:L(e,"CrMo")||L(e,eE)?eE:L(e,ev)&&L(e,ey)?eN:L(e,"FxiOS")?eL:L(e.toLowerCase(),eG.toLowerCase())?eG:L(e,e1+"/")?e1:(r=t)&&L(r,e_)||L(e,ey)&&!L(e,eE)&&!L(e,ev)?L(e,ed)?ej:ey:L(e,"PaleMoon/")?eQ:L(e,e0+"/")?e0:L(e,eR)?eR:L(e,"MSIE")||L(e,"Trident/")?eI:L(e,"Gecko")?eR:"")},tt={[eF]:[RegExp("rv:"+e3)],[eT]:[RegExp(eO+"?\\/"+e3)],[eE]:[RegExp("("+eE+"|CrMo)\\/"+e3)],[eP]:[RegExp("CriOS\\/"+e3)],"UC Browser":[RegExp("(UCBrowser|UCWEB)\\/"+e3)],[ey]:[e5],[ej]:[e5],[eC]:[RegExp("(Opera|OPR)\\/"+e3)],[eR]:[RegExp(eR+"\\/"+e3)],[eL]:[RegExp("FxiOS\\/"+e3)],[eG]:[RegExp("Konqueror[:/]?"+e3,"i")],[eb]:[RegExp(eb+" "+e3),e5],[eN]:[RegExp("android\\s"+e3,"i")],[ek]:[RegExp(ex+"\\/"+e3)],[eY]:[RegExp("OculusBrowser\\/"+e3)],[eJ]:[RegExp(eJ+"\\/"+e3)],[eK]:[RegExp("YaBrowser\\/"+e3)],[eZ]:[RegExp(eZ+"\\/"+e3)],[e1]:[RegExp(e1+"\\/"+e3)],[eX]:[RegExp("(DuckDuckGo|Ddg)\\/"+e3)],[eQ]:[RegExp("PaleMoon\\/"+e3)],[e0]:[RegExp(e0+"\\/"+e3)],[e2]:[RegExp("GSA\\/"+e3)],[eI]:[RegExp("(rv:|MSIE )"+e3)],Mozilla:[RegExp("rv:"+e3)]},ti=function(e,t,i,s){var r=tt[te(e,t,i,s)];if(V(r))return null;for(var n=0;r.length>n;n++){var o=e.match(r[n]);if(o)return parseFloat(o[o.length-2])}return null},ts=[[RegExp(eD+"; "+eD+" (.*?)[);]","i"),e=>[eD,e&&e[1]||""]],[RegExp(eM,"i"),[eM,""]],[RegExp(eA,"i"),[eA,""]],[e9,[eb,""]],[RegExp(eq,"i"),(e,t)=>{if(/Phone/.test(t)||/WPDesktop/.test(t))return[eB,""];if(new RegExp(ed).test(t)&&!/IEMobile\b/.test(t))return[eq+" "+ed,""];var i=/Windows NT ([0-9.]+)/i.exec(t);if(i&&i[1]){var s=e7[i[1]]||"";return/arm/i.test(t)&&(s="RT"),[eq,s]}return[eq,""]}],[/((iPhone|iPad|iPod).*?OS (\d+)_(\d+)_?(\d+)?|iPhone)/,e=>e&&e[3]?["iOS",[e[3],e[4],e[5]||"0"].join(".")]:["iOS",""]],[/(watch.*\/(\d+\.\d+\.\d+)|watch os,(\d+\.\d+),)/i,e=>{var t="";return e&&e.length>=3&&(t=V(e[2])?e[3]:e[2]),["watchOS",t]}],[RegExp("("+ev+" (\\d+)\\.(\\d+)\\.?(\\d+)?|"+ev+")","i"),e=>e&&e[2]?[ev,[e[2],e[3],e[4]||"0"].join(".")]:[ev,""]],[/Mac OS X (\d+)[_.](\d+)[_.]?(\d+)?/i,e=>{var t=["Mac OS X",""];return e&&e[1]&&(t[1]=[e[1],e[2],e[3]||"0"].join(".")),t}],[/Mac/i,["Mac OS X",""]],[/CrOS/,[eS,""]],[/Linux|debian/i,["Linux",""]]],tr=function(e){return e8.test(e)?eM:e4.test(e)?eA:e6.test(e)?eD:RegExp(eU,"i").test(e)?eU:RegExp("("+eB+"|WPDesktop)","i").test(e)?eB:/iPad/.test(e)?ef:/iPod/.test(e)?"iPod Touch":/iPhone/.test(e)?"iPhone":/(watch)(?: ?os[,/]|\d,\d\/)[\d.]+/i.test(e)?em:e9.test(e)?eb:/(kobo)\s(ereader|touch)/i.test(e)?"Kobo":RegExp(eH,"i").test(e)?eH:/(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(ed).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)?ev:eg:RegExp("(pda|"+ed+")","i").test(e)?eV:RegExp(ep,"i").test(e)&&!RegExp(ep+" pc","i").test(e)?eW:""},tn=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;function to(e,t){return"string"==typeof e&&tn.test(e)?e:t()}function ta(e,t){var i=Error(t);try{Object.defineProperty(i,"name",{value:e,writable:!0,enumerable:!0,configurable:!0})}catch(e){}return i}function tl(e){return e?e.split("#")[0]:e}function tu(e,t){var i=setTimeout(e,t);return(null==i?void 0:i.unref)&&(null==i||i.unref()),i}function th(e,t,i){return tc.apply(this,arguments)}function tc(){return(tc=m(function*(e,t,i){var s;try{return yield Promise.race([e,new Promise((e,r)=>{s=tu(()=>{try{null==i||i(),e()}catch(e){r(e)}},t)})])}finally{clearTimeout(s)}})).apply(this,arguments)}var td,tv="NativeGzipValidationError",tp=e=>e.length>=2&&31===e[0]&&139===e[1],tg=(e,t)=>e===P.GZipJS||t===P.GZipJS||"gzip"===t,tf=e=>!(!e||"object"!=typeof e)&&"NotReadableError"===("name"in e?String(e.name):""),t_=e=>
1{throw ta(tv,"Native gzip produced invalid output: "+e)},tm=function(){var e=m(function*(e,t){18>e.size&&t_("too-short");var i=new Uint8Array((yield e.slice(0,10).arrayBuffer()));tp(i)&&8===i[2]||t_("invalid-header");var s=new DataView((yield e.slice(e.size-8).arrayBuffer()));s.getUint32(0,!0)!==(e=>{for(var t=(()=>{if(td)return td;td=[];for(var e=0;256>e;e++){for(var t=e,i=0;8>i;i++)t=1&t?0xedb88320^t>>>1:t>>>1;td[e]=t>>>0}return td})(),i=0xffffffff,s=0;e.length>s;s++)i=t[255&(i^e[s])]^i>>>8;return(0xffffffff^i)>>>0})(t)&&t_("invalid-crc");var r=t.length>>>0;s.getUint32(4,!0)!==r&&t_("invalid-size")});return function(t,i){return e.apply(this,arguments)}}();function ty(){return(ty=m(function*(e,t,i){void 0===t&&(t=!0);try{var s,r=(new TextEncoder).encode(e),n=new globalThis.CompressionStream("gzip"),o=n.writable.getWriter(),a=o.write(r).then(()=>o.close()).catch((s=m(function*(e){try{yield o.abort(e)}catch(e){}throw e}),function(e){return s.apply(this,arguments)})),l=new Response(n.readable).blob(),u=(yield Promise.all([l,a]))[0];return yield tm(u,r),u}catch(e){if(null!=i&&i.rethrow)throw e;return t&&console.error("Failed to gzip compress data",e),null}})).apply(this,arguments)}var tb={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}},tw=tb.info,tx={}.propertyIsEnumerable;function tk(e,t){try{return function e(t,i,s,r){var n=[];for(var o in t)if(tx.call(t,o)){if(n.length>=1e3||0>=s.remainingNodes){null==i||i.debug("Attributes truncated: the value exceeds the OTLP encoder budget");break}try{var a=t[o];if(Y(a)||V(a))continue;n.push({key:O(o),value:function t(i,s,r,n){if(0>=r.remainingNodes)return{stringValue:C};if(r.remainingNodes--,X(i))return{boolValue:i};if("number"==typeof i){if(!Number.isFinite(i))return{stringValue:String(i)};if(Number.isInteger(i)){if(Number.isSafeInteger(i))return{intValue:String(i)};if("undefined"==typeof BigInt)return{stringValue:String(i)};var o=BigInt(i).toString();return i>=0x8000000000000000||-0x8000000000000000>i?(null==s||s.debug("Attribute "+o+" is outside the int64 range; encoding it as a string"),{stringValue:o}):{intValue:o}}return{doubleValue:i}}if("string"==typeof i)return{stringValue:O(i)};if("function"==typeof i)return{stringValue:"[Function]"};if("symbol"==typeof i)return{stringValue:String(i)};if("object"==typeof i&&null!==i){if(r.ancestors.has(i))return{stringValue:"[Circular]"};if(n>=20)return{stringValue:C};if(i instanceof Date){var a=Number.isFinite(i.getTime())?i.toISOString():String(i);return{stringValue:"string"==typeof a?O(a):String(a)}}r.ancestors.add(i);try{try{var l=i.toJSON;if("function"==typeof l)return t(l.call(i),s,r,n+1)}catch(e){}return B(i)?{arrayValue:{values:function(e,i,s,r){for(var n=[],o=Math.min(e.length,1e3),a=0;o>a&&s.remainingNodes>0;a++)try{var l=a in e?e[a]:void 0;if(J(l))continue;n.push(t(l,i,s,r))}catch(e){n.push({stringValue:$})}return e.length>a&&n.push({stringValue:C}),n}(i,s,r,n+1)}}:{kvlistValue:{values:e(i,s,r,n+1)}}}finally{r.ancestors.delete(i)}}return{stringValue:O(String(i))}}(a,i,s,r)})}catch(e){n.push({key:O(o),value:{stringValue:$}})}}return n}(e,t,{ancestors:new WeakSet,remainingNodes:1e4},0)}catch(e){return[]}}function tE(e,t,i){return y({},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})}function tS(e,t,i,s){return{resourceLogs:[{resource:{attributes:tk(t)},scopeLogs:[{scope:{name:i,version:s},logRecords:e}]}]}}let tP=class{constructor(e,t,i,s,r,n,o){var a;void 0===n&&(n=()=>Promise.resolve()),this._instance=e,this.vn=t,this.I=i,this.Pn=s,this.An=r,this.Fn=n,this.On=o,this.Ln=null,this.Dn=0,this.$n=0,this.Nn=0,this.qn=0,this.jn=0,this.Bn=!1,this.Hn=t.maxBufferSize,this.zn=Math.max(null!==(a=t.maxQueueSize)&&void 0!==a?a:t.maxBufferSize,t.maxBufferSize),this.Un=t.flushIntervalMs,this.Wn=t.maxBatchRecordsPerPost,this.Vn=t.rateCapWindowMs,this.Gn=t.maxLogsPerInterval}clearQueue(){this.$n++,this._instance.setPersistedProperty(S.LogsQueue,[])}reset(){this.Zn(),this.qn=0,this.jn=0,this.Bn=!1,this.Nn=0,this.Wn=this.vn.maxBatchRecordsPerPost}onReconnect(){this.Nn=0,this.Qn()}captureLog(e,t){var i;if(!this._instance.isDisabled&&!this._instance.optedOut&&null!=e&&e.body){var s=this.Jn(e);if(null!==s){if(s.body){if(this.Kn()){var r={record:function(e,t,i,s){var r,n=tb[e.level||"info"]||tw,o=n.text,a=n.number,l=(void 0===(r=K(s)?s:void 0)&&(r=Date.now()),String(r)+"000000"),u={};t.distinctId&&(u.posthogDistinctId=t.distinctId),t.sessionId&&(u.sessionId=t.sessionId),t.windowId&&(u["window.id"]=t.windowId),J(t.sessionStartTimestamp)||(u.sessionStartTimestamp=String(t.sessionStartTimestamp)),J(t.lastActivityTimestamp)||(u.lastActivityTimestamp=String(t.lastActivityTimestamp)),t.currentUrl&&(u["url.full"]=t.currentUrl),t.screenName&&(u["screen.name"]=t.screenName),t.appState&&(u["app.state"]=t.appState),t.activeFeatureFlags&&t.activeFeatureFlags.length>0&&(u.feature_flags=t.activeFeatureFlags);var h=y({},u),c=e.attributes;if(c){var d=[];try{d=Object.keys(c)}catch(e){d=[]}for(var v of d){var p=void 0;try{p=c[v]}catch(e){p=$}Object.defineProperty(h,v,{value:p,enumerable:!0,writable:!0,configurable:!0})}}var g={timeUnixNano:l,observedTimeUnixNano:l,severityNumber:a,severityText:o,body:{stringValue:function(e){try{return O(String(e))}catch(e){return $}}(e.body)},attributes:tk(h,i)};return e.trace_id&&(g.traceId=e.trace_id),e.span_id&&(g.spanId=e.span_id),V(e.trace_flags)||(g.flags=e.trace_flags),g}(s,null!==(i=null==t?void 0:t.context)&&void 0!==i?i:this.Pn(),this.I,null==t?void 0:t.occurredAtMs)};this.An(()=>this.Yn(r))}}else this.I.info("Log was rejected in beforeSend function")}}}Jn(e){var t=this.vn.beforeSend;if(!t)return e;var i=B(t)?t:[t],s=e;for(var r of i)try{var n=r(s);if(!n)return this.I.info("Log was rejected in beforeSend function"),null;s=n}catch(e){return this.I.error("Error in beforeSend function for log:",e),null}return s}Kn(){if(void 0===this.Gn)return!0;var e=Date.now(),t=e-this.qn;return this.Vn>t&&t>=0||(this.qn=e,this.jn=0,this.Bn=!1),this.Gn>this.jn?(this.jn++,!0):(this.Bn||(this.I.warn("captureLog dropping logs: exceeded "+this.Gn+" logs per "+this.Vn+"ms"),this.Bn=!0),!1)}flush(){var e=this;return m(function*(){if(!e._instance.isDisabled)return e.Ln||(e.Ln=e.Xn().finally(()=>{e.Ln=null})),e.Ln})()}Xn(){var e=this;return m(function*(){e.Zn();var t=null!==(r=e._instance.getPersistedProperty(S.LogsQueue))&&void 0!==r?r:[];if(0!==t.length)for(var i=t.length,s=0;t.length>0&&i>s;){var r,n,o,a=e.$n;e.Dn=0;var l=Math.min(t.length,e.Wn),u=t.slice(0,l),h=tS(u.map(e=>e.record),e.ts(),null!==(n=e.On)&&void 0!==n?n:e._instance.getLibraryId(),e._instance.getLibraryVersion()),c=yield e._instance.es(h);if(e.$n!==a)return;if("too-large"===c.kind&&u.length>1)e.Wn=Math.max(1,Math.floor(u.length/2)),e.I.warn("Received 413 when sending logs batch of size "+u.length+", reducing batch size to "+e.Wn);else if("retry-later"===c.kind||("too-large"===c.kind?e.I.warn("Dropping a single log record after 413 with batch size 1 â the record
1is larger than the server cap and cannot be split further."):"ok"===c.kind&&e.vn.maxBatchRecordsPerPost>e.Wn&&(e.Wn=Math.min(e.vn.maxBatchRecordsPerPost,e.Wn+1)),yield e.rs(u.length),t=null!==(o=e._instance.getPersistedProperty(S.LogsQueue))&&void 0!==o?o:[],s+=u.length,"fatal"===c.kind))throw c.error}})()}rs(e){var t=this;return m(function*(){var i,s=Math.max(0,e-t.Dn),r=null!==(i=t._instance.getPersistedProperty(S.LogsQueue))&&void 0!==i?i:[];t._instance.setPersistedProperty(S.LogsQueue,r.slice(s)),yield t.Fn()})()}ts(){return tE(this.vn,this._instance.getLibraryId(),this._instance.getLibraryVersion())}Yn(e){var t;if(!this._instance.optedOut){var i=null!==(t=this._instance.getPersistedProperty(S.LogsQueue))&&void 0!==t?t:[];this.zn>i.length||(i.shift(),this.Dn++,this.I.info("Logs queue is full, dropping oldest record.")),i.push(e),this._instance.setPersistedProperty(S.LogsQueue,i),this.Hn>i.length?this.ns():this.Qn()}}ns(e){void 0===e&&(e=this.Un),this.ss||(this.ss=tu(()=>{this.ss=void 0,this.Qn()},e))}os(){var e=Math.min(Math.max(0,this.Nn-1),6);return this.Un*Math.pow(2,e)}ls(){var e=this._instance.getPersistedProperty(S.LogsQueue);return!!e&&e.length>0}shutdown(e){var t=this;return m(function*(){t.Zn();var i=t.flush().catch(()=>{});void 0!==e?yield th(i,e):yield i})()}flushWithTimeout(e){var t=this;return m(function*(){var i=t.flush();yield th(i,e,()=>{i.catch(()=>{})})})()}Qn(){this.flush().then(()=>{this.Nn=0},e=>{this.Nn++,this.I.error("PostHog logs flush failed:",e)}).finally(()=>{!this._instance.isDisabled&&this.ls()&&this.ns(this.os())})}Zn(){this.ss&&(clearTimeout(this.ss),this.ss=void 0)}};var tI=[0,5,10,25,50,75,100,250,500,750,1e3,2500,5e3,7500,1e4];function tF(e){return String(e)+"000000"}function tC(e,t,i,s){var r="";return s&&(r=Object.keys(s).sort().map(e=>JSON.stringify(e)+":"+JSON.stringify(s[e])).join(",")),e+"\0"+t+"\0"+(null!=i?i:"")+"\0"+r}let t$=class{constructor(e,t,i){this._instance=e,this.vn=t,this.I=i,this.us=new Map,this.Ln=null,this.hs=!1,this.ds=new Map,this.vs=new Set,this.cs=0}count(e,t,i){void 0===t&&(t=1),this.fs({name:e,type:"count",value:t,unit:null==i?void 0:i.unit,attributes:null==i?void 0:i.attributes})}gauge(e,t,i){this.fs({name:e,type:"gauge",value:t,unit:null==i?void 0:i.unit,attributes:null==i?void 0:i.attributes})}histogram(e,t,i){this.fs({name:e,type:"histogram",value:t,unit:null==i?void 0:i.unit,attributes:null==i?void 0:i.attributes})}flush(){var e,t=this,i=this.Ln,s=(e=m(function*(){i&&(yield i.catch(()=>{})),yield t.ps()}),function(){return e.apply(this,arguments)})().finally(()=>{this.Ln===s&&(this.Ln=null)});return this.Ln=s,s}drainWindow(){if(0===this.us.size)return null;var e=this.us;return this.us=new Map,this.hs=!1,this.ds=new Map,this.vs=new Set,this.gs(e)}reset(){this.cs++,this.Zn(),this.us=new Map,this.Ln=null,this.hs=!1,this.ds=new Map,this.vs=new Set}fs(e){if(!this._instance.isDisabled&&!this._instance.optedOut){var t=this.Jn(e);if(null!==t){if(t.name&&"string"==typeof t.name){if("number"==typeof t.value&&Number.isFinite(t.value)){if("count"===t.type&&0>t.value)this.I.warn("Dropping count '"+t.name+"': counters are monotonic, value must be >= 0");else{try{i=t.attributes?y({},t.attributes):void 0,s=tC(t.type,t.name,t.unit,i)}catch(e){return void this.I.warn("Dropping metric '"+t.name+"': attributes could not be serialized",e)}var i,s,r=this.us.get(s);if(!r){if(!this.ys())return;r={name:t.name,type:t.type,unit:t.unit,attributes:i,windowStartMs:Date.now()},this.us.set(s,r)}var n=this.ds.get(t.name);void 0===n?this.ds.set(t.name,t.type):n===t.type||this.vs.has(t.name)||(this.vs.add(t.name),this.I.warn("Metric name '"+t.name+"' is already used as a "+n+"; recording it as a "+t.type+" too will blend both series in charts. Use a distinct name.")),this.bs(r,t.value),this.ns()}}else this.I.warn("Dropping metric '"+t.name+"': value must be a finite number")}else this.I.warn("Dropping metric with empty name")}}}ys(){return this.vn.maxSeriesPerFlush>this.us.size||(this.hs||(this.hs=!0,this.I.warn("Metric series cap reached ("+this.vn.maxSeriesPerFlush+" per flush window); dropping new series until the next flush. Reduce attribute cardinality.")),!1)}bs(e,t){var i;switch(e.type){case"count":e.total=(null!==(i=e.total)&&void 0!==i?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:Array(tI.length+1).fill(0)});var 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(e,t){for(var i=0;t.length>i;i++)if(t[i]>=e)return i;return t.length}(t,tI)]+=1}}Jn(e){var t=this.vn.beforeSend;if(!t)return e;var i=B(t)?t:[t],s=e;for(var r of i)try{var n=r(s);if(!n)return this.I.info("Metric was rejected in beforeSend function"),null;s=n}catch(e){return this.I.error("Error in beforeSend function for metric:",e),null}return s}ns(){this.ss||(this.ss=tu(()=>{this.ss=void 0,this.flush().catch(e=>{this.I.error("Metrics flush failed:",e)})},this.vn.flushIntervalMs))}Zn(){this.ss&&(clearTimeout(this.ss),this.ss=void 0)}ps(){var e=this;return m(function*(){if(0!==e.us.size){var t=e.us;e.us=new Map,e.hs=!1,e.ds=new Map,e.vs=new Set;var i=e.cs,s=yield e._instance._s(e.gs(t));if(i===e.cs)switch(s.kind){case"ok":return;case"retry-later":return e.ws(t),void e.ns();case"too-large":return void e.I.warn("Metrics batch exceeded the server size limit and was dropped");case"fatal":return void e.I.error("Failed to send metrics batch:",s.error)}}})()}gs(e){var t,i,s,r,n,o,a;return t=this.ks(e),n=this.vn,o=this._instance.getLibraryId(),a=this._instance.getLibraryVersion(),i=y({},n.resourceAttributes,{"service.name":n.serviceName||"unknown_service"},n.environment&&{"deployment.environment":n.environment},n.serviceVersion&&{"service.version":n.serviceVersion},{"telemetry.sdk.name":o,"telemetry.sdk.version":a}),s=this._instance.getLibraryId(),r=this._instance.getLibraryVersion(),{resourceMetrics:[{resource:{attributes:tk(i)},scopeMetrics:[{scope:{name:s,version:r},metrics:t}]}]}}ks(e){var t=tF(Date.now()),i=new Map;for(var s of e.values()){var r,n=tC(s.type,s.name,s.unit,void 0),o=i.get(n);o||(o=y({name:s.name},s.unit&&{unit:s.unit}),"count"===s.type?o.sum={aggregationTemporality:1,isMonotonic:!0,dataPoints:[]}:"gauge"===s.type?o.gauge={dataPoints:[]}:o.histogram={aggregationTemporality:1,dataPoints:[]},i.set(n,o));var a=tk(null!==(r=s.attributes)&&void 0!==r?r:{},this.I),l=tF(s.windowStartMs);if("count"===s.type){var u,h={attributes:a,startTimeUnixNano:l,timeUnixNano:t,asDouble:null!==(u=s.total)&&void 0!==u?u:0};o.sum.dataPoints.push(h)}else if("gauge"===s.type){var c,d={attributes:a,timeUnixNano:t,asDouble:null!==(c=s.last)&&void 0!==c?c:0};o.gauge.dataPoints.push(d)}else s.hist&&o.histogram.dataPoints.push({attributes:a,startTimeUnixNano:l,timeUnixNano:t,count:s.hist.count,sum:s.hist.sum,min:s.hist.min,max:s.hist.max,bucketCounts:s.hist.bucketCounts,explicitBounds:tI})}return Array.from(i.values())}ws(e){var t,i;for(var s of e){var r=s[0],n=s[1],o=this.us.get(r);if(o)switch(o.windowStartMs=Math.min(o.windowStartMs,n.windowStartMs),o.type){case"count":o.total=(null!==(t=o.total)&&void 0!==t?t:0)+(null!==(i=n.total)&&void 0!==i?i:0);break;case"gauge":break;case"histogram":if(n.hist){if(o.hist){o.hist.count+=n.hist.count,o.hist.sum+=n.hist.sum,o.hist.min=Math.min(o.hist.min,n.hist.min),o.hist.max=Math.max(o.hist.max,n.hist.max);for(var a=0;o.hist.bucketCounts.length>a;a++)o.hist.bucketCounts[a]+=n.hist.bucketCounts[a]}else o.hist=n.hist}}else this.ys()&&this.us.set(r,n)}}};class tO{constructor(e,t,i){void 0===i&&(i=[]),this.coercers=e,this.stackParser=t,this.modifiers=i}buildFromUnknown(e,t){void 0===t&&(t={});var i=t&&t.mechanism||{handled:!0,type:"generic"},s=this.buildCoercingContext(i,t,0).apply(e),r=this.buildParsingContext(t),n=this.parseStacktrace(s,r);return{$exception_list:this.convertToExceptionList(n,i),$exception_level:"error"}}modifyFrames(e){var t=this;return m(function*(){for(var i of e)i.stacktrace&&i.stacktrace.frames&&B(i.stacktrace.frames)&&(i.stacktrace.frames=yield t.applyModifiers(i.stacktrace.frames));return e})()}coerceFallback(e){var t;return{type:"Error",value:"Unknown error",stack:null==(t=e.syntheticException)?void 0:t.stack,synthetic:!0}}parseStacktrace(e,t){var i,s;return null!=e.cause&&(i=this.parseStacktrace(e.cause,t)),""!=e.stack&&null!=e.stack&&(s=this.applyChunkIds(this.stackParser(e.stack,e.synthetic?t.ski
1pFirstLines:0),t.chunkIdMap)),y({},e,{cause:i,stack:s})}applyChunkIds(e,t){return e.map(e=>(e.filename&&t&&(e.chunk_id=t[e.filename]),e))}applyCoercers(e,t){for(var i of this.coercers)if(i.match(e))return i.coerce(e,t);return this.coerceFallback(t)}applyModifiers(e){var t=this;return m(function*(){var i=e;for(var s of t.modifiers)i=yield s(i);return i})()}convertToExceptionList(e,t){var i,s,r,n={type:e.type,value:e.value,mechanism:{type:null!==(i=t.type)&&void 0!==i?i:"generic",handled:null===(s=t.handled)||void 0===s||s,synthetic:null!==(r=e.synthetic)&&void 0!==r&&r}};e.stack&&(n.stacktrace={type:"raw",frames:e.stack});var o=[n];return null!=e.cause&&o.push(...this.convertToExceptionList(e.cause,y({},t,{handled:!0}))),o}buildParsingContext(e){var t;return{chunkIdMap:function(e){var t=globalThis._posthogChunkIds;if(t){var i=Object.keys(t);return sP&&i.length===sS||(sS=i.length,sP=i.reduce((i,s)=>{sE||(sE={});var r=sE[s];if(r)i[r[0]]=r[1];else for(var n=e(s),o=n.length-1;o>=0;o--){var a=n[o],l=null==a?void 0:a.filename,u=t[s];if(l&&u){i[l]=u,sE[s]=[l,u];break}}return i},{})),sP}}(this.stackParser),skipFirstLines:null!==(t=e.skipFirstLines)&&void 0!==t?t:1}}buildCoercingContext(e,t,i){void 0===i&&(i=0);var s=(i,s)=>{if(4>=s){var r=this.buildCoercingContext(e,t,s);return this.applyCoercers(i,r)}};return y({},t,{syntheticException:0==i?t.syntheticException:void 0,mechanism:e,apply:e=>s(e,i),next:e=>s(e,i+1)})}}function tT(e,t,i,s,r){var n={platform:e,filename:t,function:"<anonymous>"===i?"?":i,in_app:!(null!=t&&t.startsWith("webkit-masked-url://"))&&"<anonymous>"!==t};return V(s)||(n.lineno=s),V(r)||(n.colno=r),n}var tR=(e,t)=>{var i=-1!==e.indexOf("safari-extension"),s=-1!==e.indexOf("safari-web-extension");return i||s?[-1!==e.indexOf("@")?e.split("@")[0]:"?",i?"safari-extension:"+t:"safari-web-extension:"+t]:[e,t]},tL=/^\s*at (\S+?)(?::(\d+))(?::(\d+))\s*$/i,tM=/^\s*at (?:(.+?\)(?: \[.+\])?|.*?) ?\((?:address at )?)?(?:async )?((?:<anonymous>|[-a-z]+:|.*bundle|\/)?.*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i,tA=/\((\S*)(?::(\d+))(?::(\d+))\)/,tD=(e,t)=>{var i=tL.exec(e);if(i)return tT(t,i[1],"?",+i[2],+i[3]);var s=tM.exec(e);if(s){if(s[2]&&0===s[2].indexOf("eval")){var r=tA.exec(s[2]);r&&(s[2]=r[1],s[3]=r[2],s[4]=r[3])}var n=tR(s[1]||"?",s[2]);return tT(t,n[1],n[0],s[3]?+s[3]:void 0,s[4]?+s[4]:void 0)}},tN=/^\s*(.*?)(?:\((.*?)\))?(?:^|@)?((?:[-a-z]+)?:\/.*?|\[native code\]|[^@]*(?:bundle|\d+\.js)|\/[\w\-. /=]+)(?::(\d+))?(?::(\d+))?\s*$/i,tj=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i,tq=(e,t)=>{var i=tN.exec(e);if(i){if(i[3]&&i[3].indexOf(" > eval")>-1){var s=tj.exec(i[3]);s&&(i[1]=i[1]||"eval",i[3]=s[1],i[4]=s[2],i[5]="")}var r=i[3],n=i[1]||"?",o=tR(n,r);return tT(t,r=o[1],n=o[0],i[4]?+i[4]:void 0,i[5]?+i[5]:void 0)}},tB=/\(error: (.*)\)/;class tH{match(e){return this.isDOMException(e)||this.isDOMError(e)}coerce(e,t){var i=W(e.stack);return{type:this.getType(e),value:this.getValue(e),stack:i?e.stack:void 0,cause:e.cause?t.next(e.cause):void 0,synthetic:!1}}getType(e){return this.isDOMError(e)?"DOMError":"DOMException"}getValue(e){var t=e.name||(this.isDOMError(e)?"DOMError":"DOMException");return e.message?t+": "+e.message:t}isDOMException(e){return es(e,"DOMException")}isDOMError(e){return es(e,"DOMError")}}class tU{match(e){return er(e)}coerce(e,t){var i,s=this.getStack(e);return{type:this.getType(e),value:this.getMessage(e,t),stack:null!=s?s:null==(i=t.syntheticException)?void 0:i.stack,cause:e.cause?t.next(e.cause):void 0,synthetic:void 0===s}}getType(e){return e.name||e.constructor.name}getMessage(e,t){var i=e.message;return String(i.error&&"string"==typeof i.error.message?i.error.message:i)}getStack(e){return e.stacktrace||e.stack||void 0}}class tz{constructor(){}match(e){return!!es(e,"ErrorEvent")&&(null!=e.error||this.$i(e))}coerce(e,t){if(null!=e.error)return t.apply(e.error);var i,s=t.apply(e.message);return y({},s,{stack:null!==(i=this.Ui(e))&&void 0!==i?i:s.stack,synthetic:!0})}$i(e){return W(e.message)&&e.message.length>0}Ui(e){var t,i,s=null!==(t=e.lineno)&&void 0!==t?t:0,r=null!==(i=e.colno)&&void 0!==i?i:0;if(W(e.filename)&&0!==e.filename.length&&0!==s)return"Error\n at "+e.filename+":"+s+":"+r}}var tV=/^(?:[Uu]ncaught (?:exception: )?)?(?:((?:Eval|Internal|Range|Reference|Syntax|Type|URI|)Error): )?(.*)$/i;class tW{match(e){return"string"==typeof e}coerce(e,t){var i,s=this.getInfos(e),r=s[0],n=s[1];return{type:null!=r?r:"Error",value:null!=n?n:e,stack:null==(i=t.syntheticException)?void 0:i.stack,synthetic:!0}}getInfos(e){var t="Error",i=e,s=e.match(tV);return s&&(t=s[1],i=s[2]),[t,i]}}var tG=["fatal","error","warning","log","info","debug"];function tY(e,t){void 0===t&&(t=40);var i=Object.keys(e);if(i.sort(),!i.length)return"[object has no keys]";for(var s=i.length;s>0;s--){var r=i.slice(0,s).join(", ");
1if(t>=r.length)return s===i.length?r:r.length>t?r.slice(0,t)+"...":r}return""}class tJ{match(e){return"object"==typeof e&&null!==e}coerce(e,t){var i,s,r=this.getErrorPropertyFromObject(e);return r?t.apply(r):{type:this.getType(e),value:this.getValue(e),stack:null!==(i=this.getStack(e))&&void 0!==i?i:null==(s=t.syntheticException)?void 0:s.stack,level:this.isSeverityLevel(e.level)?e.level:"error",synthetic:!0}}getType(e){if(en(e))return e.constructor.name;var t="name"in e?e.name:void 0;return W(t)&&!G(t)?t:"Error"}getValue(e){if("name"in e&&"string"==typeof e.name){var t="'"+e.name+"' captured as exception";return"message"in e&&"string"==typeof e.message&&(t+=" with message: '"+e.message+"'"),t}if("message"in e&&"string"==typeof e.message)return e.message;var i=this.getObjectClassName(e);return(i&&"Object"!==i?"'"+i+"'":"Object")+" captured as exception with keys: "+tY(e)}isSeverityLevel(e){return W(e)&&!G(e)&&tG.indexOf(e)>=0}getStack(e){try{return W(e.stacktrace)&&e.stacktrace.length>0?e.stacktrace:W(e.stack)&&e.stack.length>0?e.stack:void 0}catch(e){return}}getErrorPropertyFromObject(e){for(var t in e)if(({}).hasOwnProperty.call(e,t)){var i=e[t];if(er(i))return i}}getObjectClassName(e){try{var t=Object.getPrototypeOf(e);return t?t.constructor.name:void 0}catch(e){return}}}class tK{match(e){return en(e)}coerce(e,t){var i,s=e.constructor.name;return{type:s,value:s+" captured as exception with keys: "+tY(e),stack:null==(i=t.syntheticException)?void 0:i.stack,synthetic:!0}}}class tZ{match(e){return ei(e)}coerce(e,t){var i;return{type:"Error",value:"Primitive value captured as exception: "+String(e),stack:null==(i=t.syntheticException)?void 0:i.stack,synthetic:!0}}}class tX{match(e){return es(e,"PromiseRejectionEvent")||this.isCustomEventWrappingRejection(e)}isCustomEventWrappingRejection(e){if(!en(e))return!1;try{var t=e.detail;return null!=t&&"object"==typeof t&&"reason"in t}catch(e){return!1}}coerce(e,t){var i,s=this.getUnhandledRejectionReason(e);return ei(s)?{type:"UnhandledRejection",value:"Non-Error promise rejection captured with value: "+String(s),stack:null==(i=t.syntheticException)?void 0:i.stack,synthetic:!0}:t.apply(s)}getUnhandledRejectionReason(e){try{if("reason"in e)return e.reason;if("detail"in e&&null!=e.detail&&"object"==typeof e.detail&&"reason"in e.detail)return e.detail.reason}catch(e){}return e}}var tQ="$message",t0="$timestamp",t1=new Set([tQ,t0]),t2={enabled:!0,max_bytes:32768};function t3(e){var t;return e?{enabled:null!==(t=e.enabled)&&void 0!==t?t:t2.enabled,max_bytes:function(e,t){if(!K(e)||e===1/0||e===-1/0)return t;var i=Math.floor(e);return 0>i?t:i}(e.max_bytes,t2.max_bytes)}:y({},t2)}class t5{constructor(e){this.Ss=[],this.xs=0,this.vn=t3(e)}setConfig(e){this.vn=t3(e),this.Cs()}add(e){var t=function(e){var t;try{t=D(e)}catch(e){return}try{var i=JSON.parse(t);if(!U(i))return;var s=i[tQ],r=i[t0];if(!W(s)||0===s.trim().length||!W(r)&&!K(r))return;return{step:i,json:t}}catch(e){return}}(e);if(t){var i=function(e){if("undefined"!=typeof TextEncoder)return(new TextEncoder).encode(e).length;for(var t=encodeURIComponent(e),i=0,s=0;t.length>s;s++)"%"===t[s]?(i+=1,s+=2):i+=1;return i}(t.json);i>this.vn.max_bytes||(this.Ss.push({step:t.step,bytes:i}),this.xs+=i,this.Cs())}}getAttachable(){return this.Ss.map(e=>e.step)}clear(){this.Ss=[],this.xs=0}size(){return this.Ss.length}Cs(){for(;this.xs>this.vn.max_bytes&&this.Ss.length>0;){var e=this.Ss.shift();e&&(this.xs-=e.bytes)}}}var t6=function(e,t){var i=(void 0===t?{}:t).debugEnabled,r={P(t){if(s&&(f.DEBUG||s.POSTHOG_DEBUG||i)&&!V(s.console)&&s.console){for(var r=("__rrweb_original__"in s.console[t])?s.console[t].__rrweb_original__:s.console[t],n=arguments.length,o=Array(n>1?n-1:0),a=1;n>a;a++)o[a-1]=arguments[a];r(e,...o)}},debug(){for(var e=arguments.length,t=Array(e),i=0;e>i;i++)t[i]=arguments[i];r.P("debug",...t)},info(){for(var e=arguments.length,t=Array(e),i=0;e>i;i++)t[i]=arguments[i];r.P("log",...t)},warn(){for(var e=arguments.length,t=Array(e),i=0;e>i;i++)t[i]=arguments[i];r.P("warn",...t)},error(){for(var e=arguments.length,t=Array(e),i=0;e>i;i++)t[i]=arguments[i];r.P("error",...t)},critical(){for(var t=arguments.length,i=Array(t),s=0;t>s;s++)i[s]=arguments[s];console.error(e,...i)},uninitializedWarning(e){r.error("You must initialize PostHog before calling "+e)},createLogger:(t,i)=>t6(e+" "+t,i)};return r},t4=t6("[PostHog.js]"),t8=t4.createLogger,t9=t8("[ExternalScriptsLoader]"),t7=e=>{var t=null==o?void 0:o.querySelectorAll("script");
1if(t){for(var i=0;t.length>i;i++)if(t[i].src===e||t[i].getAttribute("src")===e)return t[i]}},ie=(e,t,i)=>{if(e.config.disable_external_dependency_loading)return t9.warn(t+" was requested but loading of external scripts is disabled."),i("Loading of external scripts is disabled");var s=t7(t);if(s){if(s.__posthog_loading_callback_fired)return i();var r=s.__posthog_loading_error;return r?i(r):(s.addEventListener("load",e=>{s.__posthog_loading_callback_fired=!0,i(void 0,e)}),void s.addEventListener("error",e=>{s.__posthog_loading_error=e,i(e)}))}var n=()=>{if(!o)return i("document not found");if(t7(t))return ie(e,t,i);var s=o.createElement("script");if(s.type="text/javascript",s.crossOrigin="anonymous",s.src=t,s.onload=e=>{s.__posthog_loading_callback_fired=!0,i(void 0,e)},s.onerror=e=>{s.__posthog_loading_error=e,i(e)},e.config.prepare_external_dependency_script&&(s=e.config.prepare_external_dependency_script(s)),!s)return i("prepare_external_dependency_script returned null");if("head"===e.config.external_scripts_inject_target)o.head.appendChild(s);else{var r,n=o.querySelectorAll("body > script");n.length>0?null==(r=n[0].parentNode)||r.insertBefore(s,n[0]):o.body.appendChild(s)}};null!=o&&o.body?n():null==o||o.addEventListener("DOMContentLoaded",n)},it={},ii=(e,t)=>{var i="/static/"+t+".js?v="+e.version;return"toolbar"===t&&(i=i+"&t="+3e5*Math.floor(Date.now()/3e5)),e.requestRouter.endpointFor("assets",i)};g.__PosthogExtensions__=g.__PosthogExtensions__||{},g.__PosthogExtensions__.loadExternalDependency=(e,t,i)=>{if("remote-config"!==t){var s=e.config.strict_script_versioning;if(s){var r=e.requestRouter.endpointFor("assets","/static/"+e.version+"/"+t+".js"),n=it[r];if("fallback"===s&&n){if(t7(n))return void ie(e,n,i);delete it[r]}ie(e,r,"fallback"===s?(s,n)=>{if(s){if("string"==typeof s)i(s);else{var o,a=ii(e,t);it[r]=a;var l=t7(r);null==l||null==(o=l.parentNode)||o.removeChild(l),ie(e,a,i)}}else i(void 0,n)}:i)}else ie(e,ii(e,t),i)}else{var o=e.requestRouter.endpointFor("assets","/array/"+e.config.token+"/config.js");ie(e,o,i)}},g.__PosthogExtensions__.loadSiteApp=(e,t,i)=>{var s=e.requestRouter.endpointFor("api",t);ie(e,s,i)},f.DEBUG=!1,f.LIB_VERSION="1.422.5",f.LIB_NAME="web";var is="$people_distinct_id",ir="distinct_id",io="$device_id",ia="$device_model",il="__alias",iu="__timers",ih="$autocapture_disabled_server_side",ic="$heatmaps_enabled_server_side",id="$exception_capture_enabled_server_side",iv="$error_tracking_suppression_rules",ip="$error_tracking_capture_extension_exceptions",ig="$web_vitals_enabled_server_side",i_="$dead_clicks_enabled_server_side",im="$product_tours_enabled_server_side",iy="$logs_capture_enabled_server_side",ib="$web_vitals_allowed_metrics",iw="$session_recording_remote_config",ix="$replay_sample_rate",ik="$replay_override_sampling",iE="$replay_override_linked_flag",iS="$replay_override_url_trigger",iP="$replay_override_event_trigger",iI="$sesid",iF="$session_is_sampled",iC="$enabled_feature_flags",i$="$active_feature_flags",iO="$early_access_features",iT="$feature_flag_details",iR="$feature_flag_payloads",iL="$feature_flag_request_id",iM="$minimal_flag_called_events",iA="$override_feature_flags",iD="$override_feature_flag_payloads",iN="$stored_person_properties",ij="$stored_group_properties",iq="$groups",iB="$surveys",iH="$surveys_loaded_at",iU="$surveys_activated",iz="$surveys_activated_session",iV="$surveys_activated_timestamps",iW="ph_product_tours",iG="$flag_call_reported",iY="$flag_call_reported_session_id",iJ="$feature_flag_errors",iK="$feature_flag_evaluated_at",iZ="$user_state",iX="$client_session_props",iQ="$capture_rate_limit",i0="$initial_campaign_params",i1="$initial_referrer_info",i2="$initial_person_info",i3="$epp",i5="$posthog_cookieless",i6="$cookieless_mode",i4="$sdk_debug_extensions_init_method",i8="$sdk_debug_extensions_init_time_ms",i9="$sdk_debug_recording_script_not_loaded",i7="PostHog loadExternalDependency extension not found.",se="on_reject",st="always",si="anonymous",ss="identified",sr="identified_only",sn="visibilitychange",so="beforeunload",sa="$pageview",sl="$pageleave",su="$identify",sh="$groupidentify";function sc(e,t){B(e)&&e.forEach(t)}function sd(e,t){if(!J(e)){if(B(e))e.forEach(t);else if(Q(e))e.forEach((e,i)=>t(e,i));else for(var i in e)j.call(e,i)&&t(e[i],i)}}var sv=function(e){for(var t=arguments.length,i=Array(t>1?t-1:0),s=1;t>s;s++)i[s-1]=arguments[s];for(var r of i)for(var n in r)void 0!==r[n]&&(e[n]=r[n]);return e};function sp(e){for(var t=Object.keys(e),i=t.length,s=Array(i);i--;)s[i]=[t[i],e[t[i]]];return s}var sg=function(e){try{return e()}catch(e){return}},sf=function(e){return function(){try{for(var t=arguments.length,i=Array(t),s=0;t>s;s++)i[s]=arguments[s];return e.apply(this,i)}catch(e){t4.critical("Implementation error. Please turn on debug mode and open a ticket on https://app.posthog.com/home#panel=support%3Asupport%3A."),t4.critical(e)}}},s_=function(e){var t={};return sd(e,function(e,i){(W(e)&&e.length>0||K(e))&&(t[i]=e)}),t},sm=["herokuapp.com","vercel.app","netlify.app"];function sy(e,t,i,s){var r=null!=s?s:{},n=r.capture,o=r.passive;null==e||e.addEventListener(t,i,{capture:void 0!==n&&n,passive:void 0===o||o})}
1function sb(e){return"ph_toolbar_internal"===e.name}var sw=e=>{if(o){try{for(var t=e+"=",i=o.cookie.split(";").filter(e=>e.length),s=0;i.length>s;s++){for(var r=i[s];" "==r.charAt(0);)r=r.substring(1,r.length);if(0===r.indexOf(t))return decodeURIComponent(r.substring(t.length,r.length))}}catch(e){}return null}};Math.trunc||(Math.trunc=function(e){return 0>e?Math.ceil(e):Math.floor(e)}),Number.isInteger||(Number.isInteger=function(e){return K(e)&&isFinite(e)&&Math.floor(e)===e});class sx{constructor(e){if(this.bytes=e,16!==e.length)throw TypeError("not 128-bit length")}static fromFieldsV7(e,t,i,s){if(!Number.isInteger(e)||!Number.isInteger(t)||!Number.isInteger(i)||!Number.isInteger(s)||0>e||0>t||0>i||0>s||e>0xffffffffffff||t>4095||i>0x3fffffff||s>0xffffffff)throw RangeError("invalid field value");var r=new Uint8Array(16);return r[0]=e/0x10000000000,r[1]=e/0x100000000,r[2]=e/0x1000000,r[3]=e/65536,r[4]=e/256,r[5]=e,r[6]=112|t>>>8,r[7]=t,r[8]=128|i>>>24,r[9]=i>>>16,r[10]=i>>>8,r[11]=i,r[12]=s>>>24,r[13]=s>>>16,r[14]=s>>>8,r[15]=s,new sx(r)}toString(){for(var e="",t=0;this.bytes.length>t;t++)e=e+(this.bytes[t]>>>4).toString(16)+(15&this.bytes[t]).toString(16),3!==t&&5!==t&&7!==t&&9!==t||(e+="-");if(36!==e.length)throw Error("Invalid UUIDv7 was generated");return e}clone(){return new sx(this.bytes.slice(0))}equals(e){return 0===this.compareTo(e)}compareTo(e){for(var t=0;16>t;t++){var i=this.bytes[t]-e.bytes[t];if(0!==i)return Math.sign(i)}return 0}}class sk{generate(){var e=this.generateOrAbort();if(!V(e))return e;this.Gr=0;var t=this.generateOrAbort();if(V(t))throw Error("Could not generate UUID after timestamp reset");return t}generateOrAbort(){var e=Date.now();if(e>this.Gr)this.Gr=e,this.Qr();else{if(this.Gr>=e+1e4)return;this.Jr++,this.Jr>0x3ffffffffff&&(this.Gr++,this.Qr())}return sx.fromFieldsV7(this.Gr,Math.trunc(this.Jr/0x40000000),0x3fffffff&this.Jr,this.Yr.nextUint32())}Qr(){this.Jr=1024*this.Yr.nextUint32()+(1023&this.Yr.nextUint32())}constructor(){this.Gr=0,this.Jr=0,this.Yr=new sC}}var sE,sS,sP,sI,sF=e=>{if("undefined"!=typeof UUIDV7_DENY_WEAK_RNG&&UUIDV7_DENY_WEAK_RNG)throw Error("no cryptographically strong RNG available");for(var t=0;e.length>t;t++)e[t]=65536*Math.trunc(65536*Math.random())+Math.trunc(65536*Math.random());return e};s&&!V(s.crypto)&&crypto.getRandomValues&&(sF=e=>crypto.getRandomValues(e));class sC{nextUint32(){return this.At.length>this.Kr||(sF(this.At),this.Kr=0),this.At[this.Kr++]}constructor(){this.At=new Uint32Array(8),this.Kr=1/0}}var s$=()=>sO().toString(),sO=()=>(sI||(sI=new sk)).generate(),sT="",sR=/[a-z0-9][a-z0-9-]+\.[a-z]{2,}$/i,sL={Xr:()=>!!o,ii(e){t4.error("cookieStore error: "+e)},ti:sw,ni(e){var t;try{t=JSON.parse(sL.ti(e))||{}}catch(e){}return t},ei(e,t,i,s,r){if(!o)return!1;try{var n="",a="",l=function(e,t){if(t){var i=function(e,t){if(void 0===t&&(t=o),sT)return sT;if(!t||["localhost","127.0.0.1"].includes(e))return"";for(var i=e.split("."),s=Math.min(i.length,8),r="dmn_chk_"+s$();!sT&&s--;){var n=i.slice(s).join("."),a=r+"=1;domain=."+n+";path=/";t.cookie=a+";max-age=3",t.cookie.includes(r)&&(t.cookie=a+";max-age=0",sT=n)}return sT}(e);if(!i){var s,r=(s=e.match(sR))?s[0]:"";r!==i&&t4.info("Warning: cookie subdomain discovery mismatch",r,i),i=r}return i?"; domain=."+i:""}return""}(o.location.hostname,s);if(i){var u=new Date;u.setTime(u.getTime()+864e5*i),n="; expires="+u.toUTCString()}r&&(a="; secure");var h=e+"="+encodeURIComponent(JSON.stringify(t))+n+"; SameSite=Lax; path=/"+l+a;return h.length>3686.4&&t4.warn("cookieStore warning: large cookie, len="+h.length),o.cookie=h,!0}catch(e){return!1}},ri(e,t){if(null!=o&&o.cookie)try{sL.ei(e,"",-1,t)}catch(e){return}}},sM=null,sA={Xr(){if(!Y(sM))return sM;var e=!0;if(V(s))e=!1;else try{var t="__mplssupport__";sA.ei(t,"xyz"),'"xyz"'!==sA.ti(t)&&(e=!1),sA.ri(t)}catch(t){e=!1}return e||t4.error("localStorage unsupported; falling back to cookie store"),sM=e,e},ii(e){t4.error("localStorage error: "+e)},ti(e){try{return null==s?void 0:s.localStorage.getItem(e)}catch(e){sA.ii(e)}return null},ni(e){try{return JSON.parse(sA.ti(e))||{}}catch(e){}return null},ei(e,t){try{return null==s||s.localStorage.setItem(e,JSON.stringify(t)),!0}catch(e){sA.ii(e)}return!1},ri(e){try{null==s||s.localStorage.removeItem(e)}catch(e){sA.ii(e)}}},sD=[iN,i$,iC,iT,iR,iL,iK,iJ,iG],sN=[io,ir,iI,iF,i3,i2,iZ],sj=e=>e+"_cpm",sq=["__proto__","constructor","prototype"],sB=e=>{if(!U(e))return{};var t={};return Object.keys(e).forEach(i=>
1{-1===sq.indexOf(i)&&(t[i]=e[i])}),t},sH=function(e,t){void 0===t&&(t=[]);var i={};return[...sN,...t].forEach(t=>{var s=e[t];V(s)||Y(s)||""===s||(i[t]=s)}),i},sU=e=>{for(var t=5381,i=0x811c9dc5,s=0;e.length>s;s++){var r=e.charCodeAt(s);t=33*t^r,i=Math.imul(i^r,0x1000193)}return e.length.toString(36)+"."+(t>>>0).toString(36)+"."+(i>>>0).toString(36)},sz=(e,t)=>({p:t,f:sU(JSON.stringify(e))}),sV=(e,t)=>{if(!t)return{properties:[],isValid:!1};try{var i=sL.ni(sj(e)),s=(null==i?void 0:i.f)===sU(t)&&B(i.p);return{properties:s?i.p:[],isValid:s}}catch(e){return{properties:[],isValid:!1}}},sW=(e,t)=>t+"|"+(sL.ti(sj(e))||""),sG={},sY={Xr:()=>!0,ii(e){t4.error("memoryStorage error: "+e)},ti:e=>sG[e]||null,ni:e=>sG[e]||null,ei:(e,t)=>(sG[e]=t,!0),ri(e){delete sG[e]}},sJ=null,sK={Xr(){if(!Y(sJ))return sJ;if(sJ=!0,V(s))sJ=!1;else try{var e="__support__";sK.ei(e,"xyz"),'"xyz"'!==sK.ti(e)&&(sJ=!1),sK.ri(e)}catch(e){sJ=!1}return sJ},ii(e){t4.error("sessionStorage error: ",e)},ti(e){try{return null==s?void 0:s.sessionStorage.getItem(e)}catch(e){sK.ii(e)}return null},ni(e){try{return JSON.parse(sK.ti(e))||null}catch(e){}return null},ei(e,t){try{return null==s||s.sessionStorage.setItem(e,JSON.stringify(t)),!0}catch(e){sK.ii(e)}return!1},ri(e){try{null==s||s.sessionStorage.removeItem(e)}catch(e){sK.ii(e)}}};class sZ{constructor(e){this._instance=e}get vn(){return this._instance.config}get consent(){return this.Hs()?0:this.zs}isOptedOut(){return this.vn.cookieless_mode===st||this.isRejected()||-1===this.consent&&this.vn.cookieless_mode===se}isOptedIn(){return!this.isOptedOut()}isExplicitlyOptedOut(){return 0===this.consent}isRejected(){return 0===this.consent||-1===this.consent&&this.vn.opt_out_capturing_by_default}optInOut(e){this.Us.ei(this.Ws,e?1:0,this.vn.cookie_expiration,this.vn.cross_subdomain_cookie,this.vn.secure_cookie)}reset(){this.Us.ri(this.Ws,this.vn.cross_subdomain_cookie)}get Ws(){var e=this._instance.config,t=e.token,i=e.opt_out_capturing_cookie_prefix;return e.consent_persistence_name||(i?i+t:"__ph_opt_in_out_"+t)}get zs(){var e=this.Us.ti(this.Ws);return el(e)?1:L(eu,e)?0:-1}get Us(){var e=this.vn.opt_out_capturing_persistence_type,t="localStorage"===e?sA:sL;if(!this.Vs||this.Vs!==t){this.Vs=t;var i="localStorage"===e?sL:sA;i.ti(this.Ws)&&(this.Vs.ti(this.Ws)||this.optInOut(el(i.ti(this.Ws))),i.ri(this.Ws,this.vn.cross_subdomain_cookie))}return this.Vs}Hs(){return!!this.vn.respect_dnt&&[null==n?void 0:n.doNotTrack,null==n?void 0:n.msDoNotTrack,g.doNotTrack].some(e=>el(e))}}function sX(e,t){var i,s=null==e||null==(i=e.config)?void 0:i.get_current_url;if(!H(s))return t;try{var r=s(t);return W(r)&&r?r:t}catch(e){return t4.error("Error in get_current_url, falling back to window.location.href",e),t}}var sQ="__POSTHOG_TOOLBAR__";function s0(e){return e instanceof Element&&(e.id===sQ||!(null==e.closest||!e.closest(".toolbar-global-fade-container")))}function s1(e){return!!e&&1===e.nodeType}function s2(e,t){return!!e&&!!e.tagName&&e.tagName.toLowerCase()===t.toLowerCase()}function s3(e){return!!e&&3===e.nodeType}function s5(e){return!!e&&11===e.nodeType&&s1(e.host)}function s6(e){return e?M(e).split(/\s+/):[]}function s4(e,t){var i,r,n=V(r=null==s||null==(i=s.location)?void 0:i.href)?void 0:sX(t,r);return!!(n&&e&&e.some(e=>n.match(e)))}function s8(e){var t="";switch(typeof e.className){case"string":t=e.className;break;case"object":t=(e.className&&"baseVal"in e.className?e.className.baseVal:null)||e.getAttribute("class")||"";break;default:t=""}return s6(t)}function s9(e){return J(e)?null:M(e).split(/(\s+)/).filter(e=>rw(e)).join("").replace(/[\r\n]/g," ").replace(/[ ]+/g," ").substring(0,255)}function s7(e){var t="";return rv(e)&&!rp(e)&&e.childNodes&&e.childNodes.length&&sd(e.childNodes,function(e){var i;s3(e)&&e.textContent&&(t+=null!==(i=s9(e.textContent))&&void 0!==i?i:"")}),M(t)}function re(e){var t;return V(e.target)?e.srcElement||null:null!=(t=e.target)&&t.shadowRoot?e.composedPath()[0]||null:e.target||null}var rt=["a","button","form","input","select","textarea","label"];function ri(e,t){if(V(t))return!0;var i,s=function(e){if(t.some(t=>(function(e,t){var i=e.matches||e.matchesSelector||e.msMatchesSelector||e.mozMatchesSelector||e.webkitMatchesSelector||e.oMatchesSelector;try{return!!i&&i.call(e,t)}catch(e){return!1}})(e,t)))return{v:!0}};for(var r of e)if(i=s(r))return i.v;return!1}function rs(e){var t=e.parentNode;return!(!t||!s1(t))&&t}var rr=[".ph-no-autocapture","[data-ph-no-autocapture]"],rn=["next","previous","prev",">","<"],ro=[...rn,"+","-","â","â"],ra=(e,t)=>/[a-z0-9]/i.test(t)?e.includes(t):e===t,rl=[".ph-no-rageclick",".ph-no-capture"],ru=["","text","search","email","password","url","tel","number"];function rh(e,t){if(!s||rc(e)||(X(t)?(r=!!t&&rl,n=void 0,o=!1):(r=null!==(a=null==t?void 0:t.css_selector_ignorelist)&&void 0!==a?a:rl,n=null==t?void 0:t.content_ignorelist,o=null!==(l=null==t?void 0:t.ignore_text_selection)&&void 0!==l&&l),!1===r)||o&&!(!(i=e)||!s1(i))&&(s2(i,"textarea")||(s2(i,"input")?L(ru,(i.getAttribute("type")||"").toLowerCase()):function(e){if(e.isContentEditable)return!0;var t=null==e.getAttribute?void 0:e.getAttribute("contenteditable");return"true"===t||""===t}(i))))return!1;var i,r,n,o,a,l,u=rd(e,!1).targetElementList;return!function(e,t){var i;if(!1===e||V(e))return!1;if(!0===e)i=rn;else{if(!B(e))return!1;if(e.length>10)return t4.error("[PostHog] content_ignorelist array cannot exceed 10 items. Use css_selector_ignorelist for more complex matching."),!1;i=e.map(e=>e.toLowerCase())}return t.some(e=>{var t=e.safeText,s=e.ariaLabel;return i.some(e=>ra(t,e)||ra(s,e))})}(n,u.map(e=>{var t;return{safeText:s7(e).toLowerCase(),ariaLabel:(null==(t=e.getAttribute("aria-label"))?void 0:t.toLowerCase().trim())||""}}))&&!ri(u,r)}var rc=e=>!e||s2(e,"html")||!s1(e),rd=(e,t)=>{if(!s||rc(e))return{parentIsUsefulElement:!1,targetElementList:[]};for(var i=!1,r=[e],n=e;n.parentNode&&!s2(n,"body");)if(s5(n.parentNode))r.push(n.parentNode.host),n=n.parentNode.host;else{var o=rs(n);if(!o)break;if(t||rt.indexOf(o.tagName.toLowerCase())>-1)i=!0;else try{var a=s.getComputedStyle(o);a&&"pointer"===a.getPropertyValue("cursor")&&(i=!0)}catch(e){}r.push(o),n=o}return{parentIsUsefulElement:i,targetElementList:r}};function rv(e){for(var t=new Set,i=0,s=e;s.parentNode&&!s2(s,"body");s=s.parentNode){if(i++>=1e3||t.has(s))return!1;t.add(s);var r=s8(s);if(L(r,"ph-sensitive")||L(r,"ph-no-capture"))return!1}if(L(s8(e),"ph-include"))return!0;var n=e.type||"";if(W(n))switch(n.toLowerCase()){case"hidden":case"password":return!1}
1var o=e.name||e.id||"";return!W(o)||!/^cc|cardnum|ccnum|creditcard|csc|cvc|cvv|exp|pass|pwd|routing|seccode|securitycode|securitynum|socialsec|socsec|ssn/i.test(o.replace(/[^a-zA-Z0-9]/g,""))}function rp(e){return!!(s2(e,"input")&&!["button","checkbox","submit","reset"].includes(e.type)||s2(e,"select")||s2(e,"textarea")||"true"===e.getAttribute("contenteditable"))}var rg=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}))$"),rf=/(^|[^0-9A-Za-z_])([0-9][0-9 -]*[0-9])(?=$|[^0-9A-Za-z_])/g,r_=[16,15,14,13],rm=RegExp("^(\\d{3}-?\\d{2}-?\\d{4})$"),ry=RegExp("(^|[^0-9])((?!000|666)[0-9]{3}-?(?!00)[0-9]{2}-?(?!0000)[0-9]{4})(?=$|([^0-9]))","g"),rb=/[0-9A-Za-z_]/;function rw(e,t){return void 0===t&&(t=!0),!(J(e)||W(e)&&(e=M(e),(t?rg.test((e||"").replace(/[- ]/g,"")):function(e){var t;for(rf.lastIndex=0;t=rf.exec(e);){var i=t[2];if(i)for(var s=i.replace(/[- ]/g,""),r=0;s.length>r;r++)for(var n of r_){var o=r+n;if(s.length>=o){var a=s.slice(r,o);if(rg.test(a)&&function(e){for(var t=0,i=!1,s=e.length-1;s>=0;s--){var r=e.charCodeAt(s)-48;i&&(r*=2)>9&&(r-=9),t+=r,i=!i}return t%10==0}(a))return!0}}}return!1}(e))||(t?rm.test(e):function(e){var t;for(ry.lastIndex=0;t=ry.exec(e);){var i=t[1],s=t[3];if(!(i&&s&&rb.test(i)&&rb.test(s)))return!0}return!1}(e))))}function rx(e){var t=s7(e);return rw(t=(t+" "+function e(t){var i="";return t&&t.childNodes&&t.childNodes.length&&sd(t.childNodes,function(t){var s;if(t&&"span"===(null==(s=t.tagName)?void 0:s.toLowerCase()))try{var r=s7(t);i=(i+" "+r).trim(),t.childNodes&&t.childNodes.length&&(i=(i+" "+e(t)).trim())}catch(e){t4.error("[AutoCapture]",e)}}),i}(e)).trim())?t:""}function rk(e){return e.replace(/"|\\"/g,'\\"')}var rE=t8("[Dead Clicks]"),rS=()=>!0,rP=e=>{var t,i=!(null==(t=e.instance.persistence)||!t.get_property(i_)),s=e.instance.config.capture_dead_clicks;return X(s)?s:!!U(s)||i};class rI{get lazyLoadedDeadClicksAutocapture(){return this.Gs}constructor(e,t,i){this.instance=e,this.isEnabled=t,this.onCapture=i,this.startIfEnabledOrStop()}onRemoteConfig(e){if(e.ok){var t=e.config;"captureDeadClicks"in t&&(this.instance.persistence&&this.instance.persistence.register({[i_]:t.captureDeadClicks}),this.startIfEnabledOrStop())}}startIfEnabledOrStop(){this.isEnabled(this)?this.Zs(()=>{this.Qs()}):this.stop()}Zs(e){var t,i;null!=(t=g.__PosthogExtensions__)&&t.initDeadClicksAutocapture?e():null==(i=g.__PosthogExtensions__)||null==i.loadExternalDependency||i.loadExternalDependency(this.instance,"dead-clicks-autocapture",t=>{t?rE.error("failed to load script",t):e()})}Qs(){var e;if(o){if(!this.Gs&&null!=(e=g.__PosthogExtensions__)&&e.initDeadClicksAutocapture){var t=U(this.instance.config.capture_dead_clicks)?y({},this.instance.config.capture_dead_clicks):{};t.__onCapture=this.onCapture,this.onCapture&&(t.capture_dead_swipes=!1),this.Gs=g.__PosthogExtensions__.initDeadClicksAutocapture(this.instance,t),this.Gs.start(o),rE.info("starting...")}}else rE.error("`document` not found. Cannot start.")}stop(){this.Gs&&(this.Gs.stop(),this.Gs=void 0,rE.info("stopping..."))}}var rF=t8("[SegmentIntegration]"),rC="posthog-js";function r$(e,t){var i=void 0===t?{}:t,s=i.organization,r=i.projectId,n=i.prefix,o=i.severityAllowList,a=void 0===o?["error"]:o,l=i.sendExceptionsToPostHog,u=void 0===l||l;return t=>{if("*"!==a&&!a.includes(t.level)||!e.__loaded)return t;t.tags||(t.tags={});var i=e.requestRouter.endpointFor("ui","/project/"+e.config.token+"/person/"+e.get_distinct_id());t.tags["PostHog Person URL"]=i,e.sessionRecordingStarted()&&(t.tags["PostHog Recording URL"]=e.get_session_replay_url({withTimestamp:!0}));var o,l,h,c,d,v,p=(null==(o=t.exception)?void 0:o.values)||[],g=p.map(e=>y({},e,{stacktrace:e.stacktrace?y({},e.stacktrace,{type:"raw",frames:(e.stacktrace.frames||[]).map(e=>y({},e,{platform:"web:javascript"}))}):void 0})),f={$exception_message:(null==(l=p[0])?void 0:l.value)||t.message,$exception_type:null==(h=p[0])?void 0:h.type,$exception_level:t.level,$exception_list:g,$sentry_event_id:t.event_id,$sentry_exception:t.exception,$sentry_exception_message:(null==(c=p[0])?void 0:c.value)||t.message,$sentry_exception_type:null==(d=p[0])?void 0:d.type,$sentry_tags:t.tags};return s&&r&&(f.$sentry_url=(n||"https://sentry.io/organizations/")+s+"/issues/?project="+r+"&query="+t.event_id),u&&(null==(v=e.exceptions)||v.sendExceptionEvent(f)),t}}class rO{constructor(e,t,i,s,r,n){this.name=rC,this.setupOnce=function(o){o(r$(e,{organization:t,projectId:i,prefix:s,severityAllowList:r,sendExceptionsToPostHog:null==n||n}))}}}class rT{constructor(e){this.Js=(e,t,i)=>{i&&(i.noSessionId||i.activityTimeout||i.sessionPastMaximumLength||i.crossTabAdoption)&&(t4.info("[PageViewManager] Session rotated, clearing pageview state",{sessionId:e,changeReason:i}),this.Ks=void 0,this._instance.scrollManager.resetContext())},this._instance=e,this.Ys()}Ys(){var e;this.Xs=null==(e=this._instance.sessionManager)?void 0:e.onSessionId(this.Js)}destroy(){var e;null==(e=this.Xs)||e.call(this),this.Xs=void 0}doPageView(e,t){var i,r=this.ta(e,t);return this.Ks={pathname:null!==(i=null==s?void 0:s.location.pathname)&&void 0!==i?i:"",pageViewId:t,timestamp:e},this._instance.scrollManager.resetContext(),r}doPageLeave(e){var t;return this.ta(e,null==(t=this.Ks)?void 0:t.pageViewId)}doEvent(){var e;return{$pageview_id:null==(e=this.Ks)?void 0:e.pageViewId}}ta(e,t){var i=this.Ks;if(!i)return{$pageview_id:t};var s={$pageview_id:t,$prev_pageview_id:i.pageViewId},r=this._instance.scrollManager.getContext();if(r&&!this._instance.config.disable_scroll_properties){var n=r.maxScrollHeight,o=r.lastScrollY,a=r.maxScrollY,l=r.maxContentHeight,u=r.lastContentY,h=r.maxContentY;if(!(V(n)||V(o)||V(a)||V(l)||V(u)||V(h))){n=Math.ceil(n),o=Math.ceil(o),a=Math.ceil(a),l=Math.ceil(l),u=Math.ceil(u),h=Math.ceil(h);var c=n>1?eh(o/n,0,1,t4):1,d=n>1?eh(a/n,0,1,t4):1,v=l>1?eh(u/l,0,1,t4):1,p=l>1?eh(h/l,0,1,t4):1;s=sv(s,{$prev_pageview_last_scroll:o,$prev_pageview_last_scroll_percentage:c,$prev_pageview_max_scroll:a,$prev_pageview_max_scroll_percentage:d,$prev_pageview_last_content:u,$prev_pageview_last_content_percentage:v,$prev_pageview_max_content:h,$prev_pageview_max_content_percentage:p})}}return i.pathname&&(s.$prev_pageview_pathname=i.pathname),i.timestamp&&(s.$prev_pageview_duration=(e.getTime()-i.timestamp.getTime())/1e3),s}}var rR=["flags","surveys"],rL={[is]:{exposure:"hidden"},[il]:{exposure:"hidden"},__cmpns:{exposure:"hidden"},[iu]:{exposure:"hidden"}
1,[ih]:{exposure:"event"},[ic]:{exposure:"hidden"},[iy]:{exposure:"hidden"},[id]:{exposure:"event"},[iv]:{exposure:"hidden"},[ip]:{exposure:"event"},[ig]:{exposure:"event"},[i_]:{exposure:"event"},[im]:{exposure:"hidden"},[ib]:{exposure:"event"},[iw]:{exposure:"hidden"},$session_recording_enabled_server_side:{exposure:"hidden"},[iI]:{exposure:"hidden"},[iF]:{exposure:"event"},[ix]:{exposure:"event",shouldSkipFromEventProperties:e=>Y(e)},$session_past_minimum_duration:{exposure:"event"},$session_recording_url_trigger_activated_session:{exposure:"event"},$session_recording_event_trigger_activated_session:{exposure:"event"},$debug_first_full_snapshot_timestamp:{exposure:"event"},$sess_rec_flush_size:{exposure:"hidden"},[iC]:{exposure:"hidden",storageGroup:"flags"},[i$]:{exposure:"hidden",storageGroup:"flags"},[iO]:{exposure:"hidden"},[iT]:{exposure:"hidden",storageGroup:"flags"},[iR]:{exposure:"hidden",storageGroup:"flags"},[iL]:{exposure:"hidden",storageGroup:"flags",volatile:!0},[iM]:{exposure:"hidden",storageGroup:"flags"},[iA]:{exposure:"hidden"},[iD]:{exposure:"hidden"},[iN]:{exposure:"hidden"},[ij]:{exposure:"hidden"},[iB]:{exposure:"hidden",storageGroup:"surveys"},[iH]:{exposure:"hidden",storageGroup:"surveys",volatile:!0},[iU]:{exposure:"event"},[iz]:{exposure:"hidden"},[iV]:{exposure:"hidden"},[iW]:{exposure:"hidden"},$product_tours_activated:{exposure:"hidden"},$product_tours_activated_session:{exposure:"hidden"},$conversations_widget_session_id:{exposure:"event"},$conversations_ticket_id:{exposure:"event"},$conversations_widget_state:{exposure:"event"},$conversations_user_traits:{exposure:"event"},[iG]:{exposure:"hidden"},[iY]:{exposure:"hidden"},[iq]:{exposure:"event"},[iJ]:{exposure:"hidden"},[iK]:{exposure:"hidden",storageGroup:"flags",volatile:!0},[iZ]:{exposure:"hidden"},[iX]:{exposure:"hidden"},[iQ]:{exposure:"hidden"},[i0]:{exposure:"hidden"},[i1]:{exposure:"hidden"},[i2]:{exposure:"hidden"},[i3]:{exposure:"hidden"},[ik]:{exposure:"event"},[iE]:{exposure:"event"},[iS]:{exposure:"event"},[iP]:{exposure:"event"},[i4]:{exposure:"event"},[i8]:{exposure:"event"},[i9]:{exposure:"event"},$sdk_debug_replay_event_trigger_status:{exposure:"event"},$sdk_debug_replay_linked_flag_trigger_status:{exposure:"event"},$sdk_debug_replay_matched_recording_trigger_groups:{exposure:"event"}
1,$sdk_debug_replay_pending_trigger_conditions:{exposure:"event"},$sdk_debug_replay_remote_trigger_matching_config:{exposure:"event"},$sdk_debug_replay_trigger_groups_count:{exposure:"event"},$sdk_debug_replay_url_trigger_status:{exposure:"event"},$session_recording_start_reason:{exposure:"event"}},rM=[["$posthog_sr_group_event_trigger_",{exposure:"hidden"}],["$posthog_sr_group_url_trigger_",{exposure:"hidden"}],["$posthog_sr_group_sampling_",{exposure:"hidden"}]],rA=e=>{var t=rL[e];if(t)return t;for(var i of rM){var s=i[1];if(0===e.indexOf(i[0]))return s}},rD=(e,t)=>{try{return JSON.stringify(e,(e,t)=>"bigint"==typeof t?t.toString():t,t)}catch(t){return D(e)}},rN=e=>{var t=null==o?void 0:o.createElement("a");return V(t)?null:(t.href=e,t)},rj=function(e,t){for(var i,s=((e.split("#")[0]||"").split(/\?(.*)/)[1]||"").replace(/^\?+/g,"").split("&"),r=0;s.length>r;r++){var n=s[r].split("=");if(n[0]===t){i=n;break}}if(!B(i)||2>i.length)return"";var o=i[1];try{o=decodeURIComponent(o)}catch(e){t4.error("Skipping decoding for malformed query param: "+o)}return o.replace(/\+/g," ")},rq=function(e,t,i){if(!e||!t||!t.length)return e;for(var s=e.split("#"),r=s[1],n=(s[0]||"").split("?"),o=n[1],a=n[0],l=(o||"").split("&"),u=[],h=0;l.length>h;h++){var c=l[h].split("=");B(c)&&(t.includes(c[0])?u.push(c[0]+"="+i):u.push(l[h]))}var d=a;return null!=o&&(d+="?"+u.join("&")),null!=r&&(d+="#"+r),d},rB=function(e,t){var i=e.match(RegExp(t+"=([^&]*)"));return i?i[1]:null},rH=(e,t)=>e>=t&&v(),rU=(e,t,i,s)=>{if(0===e){if(v()){var r=t+1;return r===i&&s(),r}return t}return 0},rz="https?://(.*)",rV=["gclid","gclsrc","dclid","gbraid","wbraid","fbclid","msclkid","twclid","li_fat_id","igshid","ttclid","rdt_cid","epik","qclid","sccid","irclid","_kx"],rW=["utm_source","utm_medium","utm_campaign","utm_content","utm_term","gad_source","mc_cid",...rV],rG="<masked>",rY=["li_fat_id"];function rJ(e,t,i){if(!o)return{};var s,r=t?[...rV,...i||[]]:[],n=rK(rq(o.URL,r,rG),e);return sv((s={},sd(rY,function(e){var t=sw(e);s[e]=t||null}),s),n)}function rK(e,t){var i=rW.concat(t||[]),s={};return sd(i,function(t){var i=rj(e,t);s[t]=i||null}),s}function rZ(e){var t=e?0===e.search(rz+"google.([^/?]*)")?"google":0===e.search(rz+"bing.com")?"bing":0===e.search(rz+"yahoo.com")?"yahoo":0===e.search(rz+"duckduckgo.com")?"duckduckgo":null:null,i={};if(!Y(t)){i.$search_engine=t;var s=o?rj(o.referrer,"yahoo"!=t?"q":"p"):"";s.length&&(i.ph_keyword=s)}return i}function rX(){return navigator.language||navigator.userLanguage}var rQ="$direct";function r0(){return(null==o?void 0:o.referrer)||rQ}function r1(e,t,i){void 0===i&&(i=!1);var s=e?[...rV,...t||[]]:[],r=i?tl(null==a?void 0:a.href):null==a?void 0:a.href,n=null==r?void 0:r.substring(0,1e3);return{r:r0().substring(0,1e3),u:n?rq(n,s,rG):void 0}}function r2(e,t){void 0===t&&(t=!1);var i,s=e.r,r=e.u,n=t?tl(r):r,o={$referrer:s,$referring_domain:null==s?void 0:s==rQ?rQ:null==(i=rN(s))?void 0:i.host};
1if(n){o.$current_url=n;var a=rN(n);o.$host=null==a?void 0:a.host,o.$pathname=null==a?void 0:a.pathname,sv(o,rK(n))}return s&&sv(o,rZ(s)),o}function r3(){try{return Intl.DateTimeFormat().resolvedOptions().timeZone}catch(e){return}}var r5={flags:iK,surveys:iH},r6=["cookie","localstorage","localstorage+cookie","sessionstorage","memory"],r4=e=>e+"_cookie_identity_change_pending",r8="main",r9=(e,t)=>{sd(e,(i,s)=>{var r=rA(s);r&&"event"!==r.exposure||({}).hasOwnProperty.call(t,s)||delete e[s]})};class r7{constructor(e,t,i){if(void 0===i&&(i=!0),this.ea={},this.ia=!1,this.ra=!1,this.na=!1,this.sa=!1,this.vn=e,this.aa=i,this.props={},this.oa=void 0,this.la=(e=>{var t="";return e.token&&(t=e.token.replace(/\+/g,"PL").replace(/\//g,"SL").replace(/=/g,"EQ")),e.persistence_name?"ph_"+e.persistence_name:"ph_"+t+"_posthog"})(e),this.Us=this.ua(e),this.ra=this.ha(e),this.load(),e.debug&&t4.info("Persistence loaded",e.persistence,y({},this.props)),this.update_config(e,e,t),this.save(),s){var r=()=>this.flush();sy(s,"beforeunload",r,{capture:!1}),sy(s,"pagehide",r,{capture:!1})}}da(){var e,t=null==(e=this.vn)?void 0:e.persistence_save_debounce_ms;return K(t)&&t>0?t:0}va(e){if(this.vn.cookieWinsOnConflict&&"localstorage+cookie"===this.vn.persistence.toLowerCase()){if(e)try{var t=sH(e,this.vn.cookie_persisted_properties||[]),i=sz(t,this.vn.cookie_persisted_properties||[]),s=JSON.stringify(t)+"|"+JSON.stringify(i),r=sL.ti(this.la)||void 0;r&&sW(this.la,r)===s&&(this.ca=s,this.fa=r)}catch(e){}else try{var n=sL.ti(this.la)||void 0;this.ca=n?sW(this.la,n):void 0,this.fa=n}catch(e){}}}syncCookieProperties(){return this.pa(this.vn)}pa(e,t){if(void 0===t&&(t=!1),this.ga&&!t||this.sa||!e.cookieWinsOnConflict||"localstorage+cookie"!==e.persistence.toLowerCase())return!1;try{i=sL.ti(this.la)||void 0}catch(e){}if(!i||i===this.fa)return!1;var i,s,r=sW(this.la,i);try{s=sB(JSON.parse(i))}catch(e){return!1}if((sL.ti(this.la)||void 0)!==i)return!1;this.ca=r,this.fa=i;var n=sV(this.la,i),o=[...sN,...n.properties],a={};if(Object.keys(s).forEach(e=>{var t=s[e];(V(t)||Y(t)||""===t||e===iZ&&t!==si&&t!==ss)&&(a[e]=!0,delete s[e])}),z(s))return!1;var l=ir in s||s[iZ]===si||s[iZ]===ss,u=this.props[ir],h=this.props[iZ],c=sv({},this.props);[...sN,...e.cookie_persisted_properties||[]].forEach(e=>{if(-1!==o.indexOf(e)&&!(e in s)&&!a[e]&&(l||e!==ir&&e!==iZ)){var t=c[e];(n.isValid||-1===sN.indexOf(e)||!1!==t&&0!==t)&&delete c[e]}}),this.props=sv(c,s),!l||iZ in s||iZ in this.props||this.ma(iZ,si);var d=this.props[ir],v=this.props[iZ];return l&&(d!==u||v!==h)&&(this.na=!0,sK.ei(r4(this.la),!0),this.ya(iN),this.ya(i$),this.ya(iC),this.ya(iT),this.ya(iR),this.ya(iL),this.ya(iK),this.ya(iJ),this.ya(iG),v!==si||h!==ss&&s[iZ]!==si&&(V(u)||d===u)||(r9(this.props,s),this.ya(ij)),v===ss?this.props.$user_id=d:delete this.props.$user_id,this.ya(il)),!0}
1consumeCookieIdentityChange(){var e=r4(this.la),t=this.na||!!sK.ti(e);return this.na=!1,t&&sK.ri(e),t}ba(e){return void 0===e&&(e=!1),!(this.sa||this.ga&&!e||!this.vn.cookieWinsOnConflict||"localstorage+cookie"!==this.vn.persistence.toLowerCase()||(this.sa=!0,0))}_a(){this.sa&&(V(this.wa)||(clearTimeout(this.wa),this.wa=void 0),delete this.ea[r8],this.ka(!0))}Sa(e){if(void 0===e&&(e=!0),this.sa)try{e?this._a():V(this.wa)||(clearTimeout(this.wa),this.wa=void 0)}finally{this.sa=!1}}isDisabled(){return!!this.ga}ua(e){-1===r6.indexOf(e.persistence.toLowerCase())&&(t4.critical("Unknown persistence type "+e.persistence+"; falling back to localStorage+cookie"),e.persistence="localStorage+cookie");var t,i,r,n,o=(t=e.cookie_persisted_properties||[],i=e.cookieWinsOnConflict,void 0===t&&(t=[]),void 0===i&&(i=!1),r=[...sN,...t],y({},sA,{ni(e){try{var t,s={};try{s=(t=sL.ti(e)||void 0)?sB(JSON.parse(t)):{}}catch(e){}var n,o=JSON.parse(sA.ti(e)||"{}");if(i){var a=sV(e,t),l=[...sN,...a.properties],u={};Object.keys(s).forEach(e=>{var t=s[e];Y(t)||""===t||e===iZ&&t!==si&&t!==ss||(u[e]=t)});var h=ir in u||u[iZ]===si||u[iZ]===ss;if(Object.keys(u).length>0){var c,d=o[ir],v=null!==(c=o[iZ])&&void 0!==c?c:si;r.forEach(e=>{if(-1!==l.indexOf(e)&&!(e in s)&&(h||e!==ir&&e!==iZ)){var t=o[e];(a.isValid||-1===sN.indexOf(e)||!1!==t&&0!==t)&&delete o[e]}}),!h||iZ in s||iZ in o||(o[iZ]=si),h&&((ir in u?u[ir]:o[ir])!==d||(iZ in u?u[iZ]:o[iZ])!==v)&&(sD.forEac
1h(e=>delete o[e]),u[iZ]===ss&&ir in u?o.$user_id=u[ir]:delete o.$user_id,u[iZ]!==ss&&(delete o[iq],delete o[ij]),delete o.__alias)}n=sv(o,u)}else n=sv(s,o);return sA.ei(e,n),n}catch(e){}return null},ei(e,s,r,n,o,a){var l=sA.ei(e,s,void 0,void 0,a);try{var u=sH(s,t);if(Object.keys(u).length){if(i){var h=sj(e),c=sz(u,t);if(sL.ei(h,c,r,n,o,a),sL.ti(h)!==JSON.stringify(c)){sL.ri(h,n);var d=sH(s);return sL.ei(e,d,r,n,o,a),l}}sL.ei(e,u,r,n,o,a)}}catch(e){sA.ii(e)}return l},ri(e,t){try{null==s||s.localStorage.removeItem(e),sL.ri(e,t),sL.ri(sj(e),t)}catch(e){sA.ii(e)}}})),a=!1,l=e.persistence.toLowerCase();return"localstorage"===l&&sA.Xr()?(n=sA,a=!0):"localstorage+cookie"===l&&o.Xr()?(n=o,a=!0):"sessionstorage"===l&&sK.Xr()?n=sK:"memory"===l?n=sY:"cookie"===l?n=sL:o.Xr()?(n=o,a=!0):n=sL,this.ia=a,n}xa(e){return this.la+"__"+e}ha(e){return this.ia&&!!e.split_storage}properties(){var e={};return sd(this.props,(t,i)=>{var s=rA(i);if(!s||"event"===s.exposure){if(null!=s&&null!=s.shouldSkipFromEventProperties&&s.shouldSkipFromEventProperties(t))return;e[i]=t}}),e}load(e){if(void 0===e&&(e=!1),!this.ga||e){var t=this.vn.cookieWinsOnConflict&&"localstorage+cookie"===this.vn.persistence.toLowerCase(),i=t?sA.ni(this.la):null,s={};if(t)try{sd(s=sB(sL.ni(this.la)),(e,t)=>{(V(e)||Y(e)||""===e)&&delete s[t]})}catch(e){}var r=this.Us.ni(this.la);if(r&&(this.props=sv({},r)),this.ra&&this.Ca(),t&&r){var n,o,a=null==i?void 0:i[ir],l=null!==(n=null==i?void 0:i[iZ])&&void 0!==n?n:si,u=r[ir],h=null!==(o=r[iZ])&&void 0!==o?o:si;if(u!==a||h!==l){this.na=!0,sK.ei(r4(this.la),!0);var c=sv({},this.props);sD.forEach(e=>delete c[e]),h!==si||l!==ss&&s[iZ]!==si&&(V(a)||u===a)||(r9(c,s),delete c[ij]),this.props=c;var d=new Set;sD.forEach(e=>{var t,i=null==(t=rA(e))?void 0:t.storageGroup;i&&d.add(i)}),d.forEach(e=>{var t={};sd(this.props,(i,s)=>{var r;(null==(r=rA(s))?void 0:r.storageGroup)===e&&(t[s]=i)}),z(t)?(sA.ri(this.xa(e)),this.ea[e]={}):sA.ei(this.xa(e),t)&&(this.ea[e]={persisted:!0,fingerprint:this.Ta(t,e)})})}}sK.ti(r4(this.la))&&(this.na=!0)}}Ca(){for(var e of rR){var t=sA.ni(this.xa(e));if(t&&!z(t)){var i=this.Ma(e);i.persisted=!0,this.Ea(e)||(i.fingerprint=this.Ta(t,e)),this.Ia(e,t)||sv(this.props,t)}}}Ea(e){return Object.keys(this.props).some(t=>{var i;return(null==(i=rA(t))?void 0:i.storageGroup)===e})}Ia(e,t){var i=r5[e];if(!i)return!1;var s=t[i],r=this.props[i];return K(s)&&K(r)&&r>s}refreshKey(e){var t;if(!this.ga){var i=this.ra?null==(t=rA(e))?void 0:t.storageGroup:void 0,s=i?sA.ni(this.xa(i)):this.Us.ni(this.la);if(s&&e in s)this.ma(e,s[e]);else{if(i){var r=this.Us.ni(this.la);if(r&&e in r)return void this.ma(e,r[e])}this.ya(e)}}}save(){if(!this.ga){var e=this.da();e>0?V(this.wa)&&(this.wa=setTimeout(()=>{this.wa=void 0,this.ka()},e)):this.ka()}}flush(){V(this.wa)||(clearTimeout(this.wa),this.wa=void 0,this.ka())}ka(e){void 0===e&&(e=!1),this.ga||this.sa&&!e||(e||this.syncCookieProperties(),this.ra?this.Ra():this.Pa(this.Us,this.la,this.props,r8)&&this.va(this.props))}Ra(){var e=this.Aa(),t=e.main,i=e.groups;for(var s of(this.Pa(this.Us,this.la,t,r8)&&this.va(t),rR)){var r,n=i[s];(!z(n)||null!=(r=this.ea[s])&&r.persisted)&&this.Pa(sA,this.xa(s),n,s)}}Aa(){var e={},t={flags:{},surveys:{}};return sd(this.props,(i,s)=>{var r,n=null==(r=rA(s))?void 0:r.storageGroup;n?t[n][s]=i:e[s]=i}),{main:e,groups:t}}Ta(e,t){if(t===r8)return JSON.stringify(e)+"|"+this.Fa+"|"+this.Oa+"|"+this.La;var i={};return sd(e,(e,t)=>{var s;i[t]=null!=(s=rA(t))&&s.volatile?"__volatile__":e}),JSON.stringify(i)}Pa(e,t,i,s){var r,n=this.Ma(s);if(s!==r8&&!n.dirty&&!V(n.fingerprint))return!1;try{if((r=this.Ta(i,s))===n.fingerprint)return n.dirty=!1,!1}catch(e){r=void 0}return e.ei(t,i,this.Fa,this.Oa,this.La,this.vn.debug)?(n.dirty=!1,s!==r8&&(n.persisted=!0),V(r)||(n.fingerprint=r),!0):(this.vn.debug&&t4.warn('failed to persist storage entry "'+t+'"; will retry on next save'),!1)}remove(e){var t=(void 0===e?{}:e).keepGroupEntries,i=void 0!==t&&t;if(V(this.wa)||(clearTimeout(this.wa),this.wa=void 0),this.Us.ri(this.la,!1),this.Us.ri(this.la,!0),!i&&this.aa)for(var s of rR)sA.ri(this.xa(s));i?delete this.ea[r8]:this.ea={},this.ca=void 0,this.fa=void 0}clear(){this.remove(),this.props={}}register_once(e,t,i){if(U(e)){this.syncCookieProperties(),V(t)&&(t="None"),this.Fa=V(i)?this.Da:i;var s=!1;if(sd(e,(e,i)=>{this.props.hasOwnProperty(i)&&this.props[i]!==t||(this.ma(i,e),s=!0)}),s)return this.save(),!0}return!1}register(e,t){if(U(e)){this.syncCookieProperties(),this.Fa=V(t)?this.Da:t;var i=!1;if(sd(e,(t,s)=>{e.hasOwnProperty(s)&&(this.props[s]!==t||U(t)||B(t))&&(this.ma(s,t),i=!0)}),i)return this.save(),!0}return!1}unregister(e){this.syncCookieProperties();var t=!1;for(var i of"string"==typeof e?[e]:e)i in this.props&&(this.ya(i),t=!0);t&&this.save()}update_campaign_params(){var e=null==o?void 0:o.URL;if(e!==this.oa){var t=rJ(this.vn.custom_campaign_params,this.vn.mask_personal_data_properties,this.vn.custom_personal_data_properties);z(s_(t))||this.register(t),this.oa=e}}update_search_keyword(){var e;this.register((e=null==o?void 0:o.referrer)?rZ(e):{})}update_referrer_info(){var e;this.register_once({$referrer:r0(),$referring_domain:null!=o&&o.referrer&&(null==(e=rN(o.referrer))?void 0:e.host)||rQ},void 0)}set_initial_person_info(){this.props[i0]||this.props[i1]||this.register_once({[i2]:r1(this.vn.mask_personal_data_properties,this.vn.custom_personal_data_properties,this.vn.disable_capture_url_hashes
1)},void 0)}get_initial_props(){var e,t,i,s={};sd([i1,i0],e=>{var t=this.props[e];t&&sd(t,function(e,t){s["$initial_"+A(t)]=e})});var r=this.props[i2];return r&&sv(s,(void 0===(e=this.vn.disable_capture_url_hashes)&&(e=!1),t=r2(r,e),i={},sd(t,function(e,t){i["$initial_"+A(t)]=e}),i)),s}safe_merge(e){return sd(this.props,function(t,i){i in e||(e[i]=t)}),e}update_config(e,t,i){var s=e.persistence!==t.persistence,r=!((e,t)=>{if(e.length!==t.length)return!1;var i=[...e].sort(),s=[...t].sort();return i.every((e,t)=>e===s[t])})(e.cookie_persisted_properties||[],t.cookie_persisted_properties||[]),n=s||r,o=e.cookieWinsOnConflict!==t.cookieWinsOnConflict,a=e.disable_persistence||!!i,l=!!this.ga&&!a;a||this.pa(t,l),this.vn=e,!a&&(s||r||o)&&(this.ca=void 0,this.fa=void 0,this.pa(y({},e,{cookie_persisted_properties:t.cookie_persisted_properties}),l));var u=n||o?this.ua(e):this.Us,h=this.ha(e),c=n||h!==this.ra,d=!a&&(c||e.cross_subdomain_cookie!==this.Oa||e.secure_cookie!==this.La)&&this.ba(l);try{if(this.Da=this.Fa=e.cookie_expiration,this.set_disabled(a),this.set_cross_subdomain(e.cross_subdomain_cookie),this.set_secure(e.secure_cookie),c){var v=this.props;this.clear(),this.Us=u,this.ra=h,this.props=v,this.save()}else o&&(this.Us=u,a||(delete this.ea[r8],this.ka()))}finally{d&&this.Sa()}}set_disabled(e){this.ga=e,this.ga?this.remove():this.save()}set_cross_subdomain(e){e!==this.Oa&&(this.Oa=e,this.remove({keepGroupEntries:!0}),this.save())}set_secure(e){e!==this.La&&(this.La=e,this.remove({keepGroupEntries:!0}),this.save())}set_event_timer(e,t){var i=this.props[iu]||{};i[e]=t,this.ma(iu,i),this.save()}remove_event_timer(e){var t=this.props[iu]||{},i=t[e];return V(i)||(delete t[e],this.ma(iu,t),this.save()),i}get_property(e){return this.props[e]}set_property(e,t){this.ma(e,t),this.save()}ma(e,t){var i;this.props[e]=t,null!=(i=rA(e))&&i.volatile||this.$a(e)}ya(e){delete this.props[e],this.$a(e)}$a(e){var t,i=null==(t=rA(e))?void 0:t.storageGroup;i&&(this.Ma(i).dirty=!0)}Ma(e){return this.ea[e]||(this.ea[e]={})}}function ne(e){var t=!0;return{dispose(){if(t){t=!1;var i=e();i&&H(i.then)&&i.then(void 0,()=>{})}}}}var nt={GZipJS:"gzip-js",Base64:"base64"},ni={Activation:"events",Cancellation:"cancelEvents"},ns={Popover:"popover",API:"api",Widget:"widget"},nr={SHOWN:"survey shown",DISMISSED:"survey dismissed",SENT:"survey sent"},nn={SURVEY_ID:"$survey_id",SURVEY_ITERATION:"$survey_iteration",SURVEY_LAST_SEEN_DATE:"$survey_last_seen_date"},no={Popover:"popover",Inline:"inline"},na={SHOWN:"product tour shown"},nl={TOUR_LAST_SEEN_DATE:"$product_tour_last_seen_date",TOUR_TYPE:"$product_tour_type"},nu=t8("[RateLimiter]");class nh{constructor(e){this.serverLimits={},this.lastEventRateLimited=!1,this.checkForLimiting=e=>{var t=e.text;if(t&&t.length)try{(JSON.parse(t).quota_limited||[]).forEach(e=>{nu.info((e||"events")+" is quota limited."),this.serverLimits[e]=(new Date).getTime()+6e4})}catch(e){return void nu.warn('could not rate limit - continuing. Error: "'+(null==e?void 0:e.message)+'"',{text:t})}},this.instance=e,this.lastEventRateLimited=this.clientRateLimitContext(!0).isRateLimited}get captureEventsPerSecond(){var e;return(null==(e=this.instance.config.rate_limiting)?void 0:e.events_per_second)||10}get captureEventsBurstLimit(){var e;return Math.max((null==(e=this.instance.config.rate_limiting)?void 0:e.events_burst_limit)||10*this.captureEventsPerSecond,this.captureEventsPerSecond)}clientRateLimitContext(e){void 0===e&&(e=!1);var t,i,s,r=this.captureEventsBurstLimit,n=this.captureEventsPerSecond,o=(new Date).getTime(),a=null!==(t=null==(i=this.instance.persistence)?void 0:i.get_property(iQ))&&void 0!==t?t:{tokens:r,last:o};a.tokens+=(o-a.last)/1e3*n,a.last=o,a.tokens>r&&(a.tokens=r);var l=1>a.tokens;if(l||e||(a.tokens=Math.max(0,a.tokens-1)),l&&!e){var u=(K(a.dropped)?a.dropped:0)+1;a.dropped=u,!this.lastEventRateLimited&&this.Na(u)&&(a.dropped=0)}return this.lastEventRateLimited=l,null==(s=this.instance.persistence)||s.set_property(iQ,a),{isRateLimited:l,remainingTokens:a.tokens}}qa(e){var t=this.instance.config.property_denylist;return!B(t)||!t.includes(e)}ja(){var e;if(this.qa("$current_url")&&this.qa("$pathname")&&null!=a&&a.pathname)return""+(null!==(e=a.origin)&&void 0!==e?e:"")+a.pathname}Na(e){var t,i,s=this.captureEventsBurstLimit,r=this.captureEventsPerSecond,n=this.ja(),o=this.qa("$session_id")?null==(t=(i=this.instance).get_session_id)?void 0:t.call(i):void 0,a=[e+" event(s) dropped since the last warning",n?"triggered on "+n:void 0,o?"session "+o:void 0].filter(
vendor: 5,616 bytes, line 1
1Boolean).join(", ");return!!this.instance.capture("$$client_ingestion_warning",{$$client_ingestion_warning_message:"posthog-js client rate limited: "+a+". Config is set to "+r+" events per second and "+s+" events burst limit."},{skip_client_rate_limiting:!0})}isServerRateLimited(e){var t=this.serverLimits[e||"events"]||!1;return!1!==t&&(new Date).getTime()<t}}var nc=t8("[RemoteConfig]");class nd{constructor(e){this._instance=e}get remoteConfig(){var e;return null==(e=g._POSTHOG_REMOTE_CONFIG)||null==(e=e[this._instance.config.token])?void 0:e.config}Ba(e){var t,i;null!=(t=g.__PosthogExtensions__)&&t.loadExternalDependency?null==(i=g.__PosthogExtensions__)||null==i.loadExternalDependency||i.loadExternalDependency(this._instance,"remote-config",()=>e(this.remoteConfig)):e()}Ha(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 nc.info("Using preloaded remote config",this.remoteConfig),void this.za(this.remoteConfig);if(this._instance.Ua())return void nc.warn("Remote config is disabled. Falling back to local config.");this.Ba(e=>{if(!e)return nc.info("No config found after loading remote JS config. Falling back to JSON."),void this.Ha(e=>{this.za(e.json,e)});this.za(e)})}catch(e){nc.error("Error loading remote config",e),this.za()}}za(e,t){!e&&t&&(0===t.statusCode?t.error||nc.warn("Failed to fetch remote config from PostHog."):nc.error("Failed to fetch remote config from PostHog."));try{this._instance.za(e?{ok:!0,config:e}:{ok:!1})}catch(e){nc.error("Error applying remote config",e)}if(!1!==(null==e?void 0:e.hasFeatureFlags)&&!this._instance.config.advanced_disable_feature_flags_on_first_load)try{var i;null==(i=this._instance.featureFlags)||i.ensureFlagsLoaded()}catch(e){nc.error("Error loading feature flags",e)}}}var nv=Uint8Array,np=Uint16Array,ng=Uint32Array,nf=new nv([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]),n_=new nv([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]),nm=new nv([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),ny=function(e,t){for(var i=new np(31),s=0;31>s;++s)i[s]=t+=1<<e[s-1];var r=new ng(i[30]);for(s=1;30>s;++s)for(var n=i[s];i[s+1]>n;++n)r[n]=n-i[s]<<5|s;return[i,r]},nb=ny(nf,2),nw=nb[1];nb[0][28]=258,nw[258]=28;for(var nx=ny(n_,0)[1],nk=new np(32768),nE=0;32768>nE;++nE){var nS=(43690&nE)>>>1|(21845&nE)<<1;nk[nE]=((65280&(nS=(61680&(nS=(52428&nS)>>>2|(13107&nS)<<2))>>>4|(3855&nS)<<4))>>>8|(255&nS)<<8)>>>1}var nP=function(e,t,i){for(var s=e.length,r=0,n=new np(t);s>r;++r)++n[e[r]-1];var o,a=new np(t);for(r=0;t>r;++r)a[r]=a[r-1]+n[r-1]<<1;if(i){o=new np(1<<t);var l=15-t;for(r=0;s>r;++r)if(e[r])for(var u=r<<4|e[r],h=t-e[r],c=a[e[r]-1]++<<h,d=c|(1<<h)-1;d>=c;++c)o[nk[c]>>>l]=u}else for(o=new np(s),r=0;s>r;++r)o[r]=nk[a[e[r]-1]++]>>>15-e[r];return o},nI=new nv(288);for(nE=0;144>nE;++nE)nI[nE]=8;for(nE=144;256>nE;++nE)nI[nE]=9;for(nE=256;280>nE;++nE)nI[nE]=7;for(nE=280;288>nE;++nE)nI[nE]=8;var nF=new nv(32);for(nE=0;32>nE;++nE)nF[nE]=5;var nC=nP(nI,9,0),n$=nP(nF,5,0),nO=function(e){return(e/8>>0)+(7&e&&1)},nT=function(e,t,i){(null==i||i>e.length)&&(i=e.length);var s=new(e instanceof np?np:e instanceof ng?ng:nv)(i-t);return s.set(e.subarray(t,i)),s},nR=function(e,t,i){var s=t/8>>0;e[s]|=i<<=7&t,e[s+1]|=i>>>8},nL=function(e,t,i){var s=t/8>>0;e[s]|=i<<=7&t,e[s+1]|=i>>>8,e[s+2]|=i>>>16},nM=function(e,t){for(var i=[],s=0;e.length>s;++s)e[s]&&i.push({s:s,f:e[s]});var r=i.length,n=i.slice();if(!r)return[new nv(0),0];if(1==r){var o=new nv(i[0].s+1);return o[i[0].s]=1,[o,1]}i.sort(function(e,t){return e.f-t.f}),i.push({s:-1,f:25001});var a=i[0],l=i[1],u=0,h=1,c=2;for(i[0]={s:-1,f:a.f+l.f,l:a,r:l};h!=r-1;)a=i[i[c].f>i[u].f?u++:c++],l=i[u!=h&&i[c].f>i[u].f?u++:c++],i[h++]={s:-1,f:a.f+l.f,l:a,r:l};var d=n[0].s;for(s=1;r>s;++s)n[s].s>d&&(d=n[s].s);var v=new np(d+1),p=nA(i[h-1],v,0);if(p>t){s=0;var g=0,f=p-t,_=1<<f;for(n.sort(function(e,t){return v[t.s]-v[e.s]||e.f-t.f});r>s;++s){var m=n[s].s;if(t>=v[m])break;g+=_-(1<<p-v[m]),v[m]=t}for(g>>>=f;g>0;){var y=n[s].s;t>v[y]?g-=1<<t-v[y]++-1:++s}for(;s>=0&&g;--s){var b=n[s].s;v[b]==t&&(--v[b],++g)}p=t}return[new nv(v),p]},nA=function(e,t,i){return -1==e.s?Math.max(nA(e.l,t,i+1),nA(e.r,t,i+1)):t[e.s]=i},nD=function(e){for(var t=e.length;t&&!e[--t];);for(var i=new np(++t),s=0,r=e[0],n=1,o=function(e){i[s++]=e},a=1;t>=a;++a)if(e[a]==r&&a!=t)++n;else{if(!r&&n>2){for(;n>138;n-=138)o(32754);n>2&&(o(n>10?n-11<<5|28690:n-3<<5|12305),n=0)}else if(n>3){for(o(r),--n;n>6;n-=6)o(8304);n>2&&(o(n-3<<5|8208),n=0)}for(;n--;)o(r);n=1,r=e[a]}return[i.subarray(0,s),t]},nN=function(e,t){for(var i=0,s=0;t.length>s;++s)i+=e[s]*t[s];return i},nj=function(e,t,i){var s=i.length,r=nO(t+2);e[r]=255&s,e[r+1]=s>>>8,e[r+2]=255^e[r],e[r+3]=255^e[r+1];for(var n=0;s>n;++n)e[r+n+4]=i[n];return 8*(r+4+s)},nq=function(e,t,i,s,r,n,o,a,l,u,h){nR(t,h++,i),++r[256];for(var c=nM(r,15),d=c[0],v=c[1],p=nM(n,15),g=p[0],f=p[1],_=nD(d),m=_[0],y=_[1],b=nD(g),w=b[0],x=b[1],k=new np(19),E=0;m.length>E;++E)k[31&m[E]]++;for(E=0;w.length>E;++E)k[31&w[E]]++;for(var S=nM(k,7),P=S[0],I=S[1],F=19;F>4&&!P[nm[F-1]];--F);var C,$,O,T,R=u+5<<3,L=nN(r,nI)+nN(n,nF)+o,M=nN(r,d)+nN(n,g)+o+14+3*F+nN(k,P)+(2*k[16]+3*k[17]+7*k[18]);if(L>=R&&M>=R)return nj(t,h,e.subarray(l,l+u));if(nR(t,h,1+(L>M)),h+=2,L>M){C=nP(d,v,0),$=d,O=nP(g,f,0),T=g;var A=nP(P,I,0);for(nR(t,h,y-257),nR(t,h+5,x-1),nR(t,h+10,F-4),h+=14,E=0;F>E;++E)nR(t,h+3*E,P[nm[E]]);h+=3*F;for(var D=[m,w],N=0;2>N;++N){var j=D[N];for(E=0;j.length>E;++E)nR(t,h,A[q=31&j[E]]),h+=P[q],q>
115&&(nR(t,h,j[E]>>>5&127),h+=j[E]>>>12)}}else C=nC,$=nI,O=n$,T=nF;for(E=0;a>E;++E)if(s[E]>255){nL(t,h,C[257+(q=s[E]>>>18&31)]),h+=$[q+257],q>7&&(nR(t,h,s[E]>>>23&31),h+=nf[q]);var q,B=31&s[E];nL(t,h,O[B]),h+=T[B],B>3&&(nL(t,h,s[E]>>>5&8191),h+=n_[B])}else nL(t,h,C[s[E]]),h+=$[s[E]];return nL(t,h,C[256]),h+$[256]},nB=new ng([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),nH=function(){for(var e=new ng(256),t=0;256>t;++t){for(var i=t,s=9;--s;)i=(1&i&&0xedb88320)^i>>>1;e[t]=i}return e}(),nU=function(e,t,i){for(;i;++t)e[t]=i,i>>>=8},nz=!!u||!!l,nV="text/plain",nW=!1,nG=(e,t)=>{var i=e.split("#"),s=i[1],r=i[0].split("?"),n=r[0],o=r[1];if(!o)return e;var a=o.split("&").filter(e=>e.split("=")[0]!==t).join("&");return n+(a?"?"+a:"")+(s?"#"+s:"")},nY=function(e,t,i){void 0===i&&(i=!0);var s,r,n,o,a,l=e.split("?"),u=l[0],h=l[1],c=y({},t),d=null!==(a=null==h?void 0:h.split("&").map(e=>{var t,s=e.split("="),r=s[0],n=i&&null!==(t=c[r])&&void 0!==t?t:s[1];return delete c[r],r+"="+n}))&&void 0!==a?a:[],v=(void 0===s&&(s="&"),o=[],sd(c,function(e,t){V(e)||V(t)||"undefined"===t||(r=encodeURIComponent(e instanceof File?e.name:e.toString()),n=encodeURIComponent(t),o[o.length]=n+"="+r)}),o.join(s));return v&&d.push(v),d.length>0?u+"?"+d.join("&"):u},nJ=e=>{if(e.Wa)return e.Wa;var t=e.data,i=e.compression;if(t){if(i===nt.GZipJS){var s=function(e,t){void 0===t&&(t={});var i=(r=0xffffffff,{p(e){for(var t=r,i=0;e.length>i;++i)t=nH[255&t^e[i]]^t>>>8;r=t},d:()=>0xffffffff^r}),s=e.length;i.p(e);var r,n,o,a,l=(a=10+((n=t).filename&&n.filename.length+1||0),function(e,t,i,s,r,n){var o=e.length,a=new nv(s+o+5*(1+Math.floor(o/7e3))+8),l=a.subarray(s,a.length-8),u=0;if(!t||8>o)for(var h=0;o>=h;h+=65535){var c=h+65535;o>
1c?u=nj(l,u,e.subarray(h,c)):(l[h]=!0,u=nj(l,u,e.subarray(h,o)))}else{for(var d=nB[t-1],v=d>>>13,p=8191&d,g=(1<<i)-1,f=new np(32768),_=new np(g+1),m=Math.ceil(i/3),y=2*m,b=function(t){return(e[t]^e[t+1]<<m^e[t+2]<<y)&g},w=new ng(25e3),x=new np(288),k=new np(32),E=0,S=0,P=(h=0,0),I=0,F=0;o>h;++h){var C=b(h),$=32767&h,O=_[C];if(f[$]=O,_[C]=$,h>=I){var T=o-h;if((E>7e3||P>24576)&&T>423){u=nq(e,l,0,w,x,k,S,P,F,h-F,u),P=E=S=0,F=h;for(var R=0;286>R;++R)x[R]=0;for(R=0;30>R;++R)k[R]=0}var L=2,M=0,A=p,D=$-O&32767;if(T>2&&C==b(h-D))for(var N=Math.min(v,T)-1,j=Math.min(32767,h),q=Math.min(258,T);j>=D&&--A&&$!=O;){if(e[h+L]==e[h+L-D]){for(var B=0;q>B&&e[h+B]==e[h+B-D];++B);if(B>L){if(L=B,M=D,B>N)break;var H=Math.min(D,B-2),U=0;for(R=0;H>R;++R){var z=h-D+R+32768&32767,V=z-f[z]+32768&32767;V>U&&(U=V,O=z)}}}D+=($=O)-(O=f[$])+32768&32767}if(M){w[P++]=0x10000000|nw[L]<<18|nx[M];var W=31&nw[L],G=31&nx[M];S+=nf[W]+n_[G],++x[257+W],++k[G],I=h+L,++E}else w[P++]=e[h],++x[e[h]]}}u=nq(e,l,!0,w,x,k,S,P,F,h-F,u)}return nT(a,0,s+nO(u)+8)}(e,null==(o=t).level?6:o.level,null==o.mem?Math.ceil(1.5*Math.max(8,Math.min(13,Math.log(e.length)))):12+o.mem,a,8)),u=l.length;return function(e,t){var i=t.filename;if(e[0]=31,e[1]=139,e[2]=8,e[8]=2>t.level?4:9==t.level?2:0,e[9]=3,0!=t.mtime&&nU(e,4,Math.floor(new Date(t.mtime||Date.now())/1e3)),i){e[3]=8;for(var s=0;i.length>=s;++s)e[s+10]=i.charCodeAt(s)}}(l,t),nU(l,u-8,i.d()),nU(l,u-4,s),l}(function(e,t){var i=e.length;if("undefined"!=typeof TextEncoder)return(new TextEncoder).encode(e);for(var s=new nv(e.length+(e.length>>>1)),r=0,n=function(e){s[r++]=e},o=0;i>o;++o){if(r+5>s.length){var a=new nv(r+8+(i-o<<1));a.set(s),s=a}var l=e.charCodeAt(o);128>l?n(l):(2048>l?n(192|l>>>6):(l>55295&&57344>l?(n(240|(l=65536+(1047552&l)|1023&e.charCodeAt(++o))>>>18),n(128|l>>>12&63)):n(224|l>>>12),n(128|l>>>6&63)),n(128|63&l))}return nT(s,0,r)}(rD(t)),{mtime:0});return{contentType:nV,body:s.buffer.slice(s.byteOffset,s.byteOffset+s.byteLength),estimatedSize:s.byteLength}}if(i===nt.Base64){var r=(e=>"data="+encodeURIComponent("string"==typeof e?e:rD(e)))(function(e){return e?btoa(encodeURIComponent(e).replace(/%([0-9A-F]{2})/g,(e,t)=>String.fromCharCode(parseInt(t,16)))):e}(rD(t)));return{contentType:"application/x-www-form-urlencoded",body:r,estimatedSize:new Blob([r]).size}}var n=rD(t);return{contentType:"application/json",body:n,estimatedSize:new Blob([n]).size}}},nK=e=>{var t,i,s=()=>"sendBeacon"===e.transport?{url:nY(e.url,{compression:nt.Base64}),encodedBody:nJ(y({},e,{compression:nt.Base64,Wa:void 0}))}:{url:nG(e.url,"compression"),encodedBody:nJ(y({},e,{compression:void 0,Wa:void 0}))};try{t=nJ(e)}catch(t){if(tg(e.compression,rj(e.url,"compression")))return t4.error("Failed to gzip request body, sending uncompressed payload",t),s();throw t}return!(t&&tg(e.compression,rj(e.url,"compression")))||((i=t.body)instanceof ArrayBuffer?tp(new Uint8Array(i)):ArrayBuffer.isView(i)&&tp(new Uint8Array(i.buffer,i.byteOffset,i.byteLength)))?{url:e.url,encodedBody:t}:(nW=!0,s())},nZ=e=>{try{return nK(e)}catch(t){return t4.error(t),void(null==e.callback||e.callback({statusCode:0,error:t}))}},nX=function(){var e=m(function*(e){var t=rD(e.data),i=yield function(e,t,i){return ty.apply(this,arguments)}(t,f.DEBUG,{rethrow:!0});if(!i)return e;var s=yield i.arrayBuffer();return y({},e,{Wa:{contentType:nV,body:s,estimatedSize:s.byteLength}})});return function(t){return e.apply(this,arguments)}}(),nQ=/Failed to fetch|NetworkError|Load failed/i,n0=e=>"TypeError"===(null==e?void 0:e.name)&&nQ.test((null==e?void 0:e.message)||""),n1=e=>{var t=nZ(e);if(t){var i,s=t.url,r=t.encodedBody,n=null!=r?r:{},o=n.contentType,a=n.body,u=n.estimatedSize,c=new Headers;sd(e.headers,function(e,t){c.append(t,e)}),o&&c.append("Content-Type",o);var d=null,v=!1;if(h){var p=new h;d={signal:p.signal,timeout:setTimeout(()=>{var t;v=!0,p.abort(ta("AbortError","PostHog request timed out"+((t=e.timeout)?" after "+t+"ms":"")))},e.timeout)}}var g=t=>{v&&"AbortError"===(null==t?void 0:t.name)||n0(t)?t4.warn(t):t4.error(t),null==e.callback||e.callback({statusCode:0,error:t})};try{l(s,y({method:(null==e?void 0:e.method)||"GET",headers:c,keepalive:"POST"===e.method&&!e.Va&&52428.8>(u||0),body:a,signal:null==(i=d)?void 0:i.signal},e.fetchOptions)).then(t=>t.text().then(i=>{var s={statusCode:t.status,text:i};if(200===t.status)try{s.json=JSON.parse(i)}catch(e){t4.error(e)}null==e.callback||e.callback(s)})).catch(g).finally(()=>d?clearTimeout(d.timeout):null)}catch(e){d&&clearTimeout(d.timeout),g(e)}}},n2=e=>{try{var t,i=nK(e),s=i.url,r=i.encodedBody,o=null!=r?r:{},a=o.body,l=o.estimatedSize;if(!a)return;var u=a instanceof Blob?a:new Blob([a],{type:o.contentType});if(n.sendBeacon(s,u))return;var h=B(e.data)?e.data:null==(t=e.data)?void 0:t.batch;if(B(h)&&h.length>1&&(null!=l?l:0)>16384){var c=Math.ceil(h.length/2),d=t=>B(e.data)?t:y({},e.data,{batch:t});return n2(y({},e,{data:d(h.slice(0,c))})),void n2(y({},e,{data:d(h.slice(c))}))}t4.warn("Beacon of ~"+(null!=l?l:0)+" bytes was rejected by the browser, falling back to fetch"),n1(y({},e,{Va:!0}))}catch(e){t4.warn("Beacon send failed",e)}},n3=(e,t,i,s)=>{var r="query"===s?"POST"===t?"sent_at":"_":void 0;return nY(i===nt.GZipJS?nG(e,"compression"):e,y({},r?{[r]:Date.now().toString()}:{},i===nt.GZipJS?{}:{compression:i}))},n5=[];l&&n5.push({transport:"fetch",method:n1}),u&&n5.push({transport:"XHR",method(e){var t=nZ(e);if(t){var i=new u,s=t.encodedBody;i.open(e.method||"GET",t.url,!0);var r=null!=s?s:{},n=r.contentType,o=r.body;sd(e.headers,function(e,t){i.setRequestHeader(t,e)}),n&&i.setRequestHeader("Content-Type",n),e.timeout&&(i.timeout=e.timeout),i.onreadystatechange=()=>{if(4===i.readyState){var t={statusCode:i.status,text:i.responseText};
1if(200===i.status)try{t.json=JSON.parse(i.responseText)}catch(e){}null==e.callback||e.callback(t)}},i.send(o)}}}),null!=n&&n.sendBeacon&&n5.push({transport:"sendBeacon",method:n2});class n6{constructor(e,t){this.Ga=!0,this.Za=[],this.Qa=eh((null==t?void 0:t.flush_interval_ms)||3e3,250,5e3,t4.createLogger("flush interval"),3e3),this.Ja=e}enqueue(e){this.Za.push(e),this.Ka||this.Ya()}unload(){this.Xa();var e=Object.values(this.Za.length>0?this.eo():{});[...e.filter(e=>0===e.url.indexOf("/e")),...e.filter(e=>0!==e.url.indexOf("/e"))].map(e=>{this.io(y({},e,{transport:"sendBeacon"}))})}enable(){this.Ga=!1,this.Ya()}Ya(){var e=this;this.Ga||(this.Ka=setTimeout(()=>{if(this.Xa(),this.Za.length>0){var t=this.eo();for(var i in t)!function(){var s=t[i],r=(new Date).getTime();s.data&&B(s.data)&&sd(s.data,e=>{e.offset=Math.abs(e.timestamp-r),delete e.timestamp}),e.io(s)}()}},this.Qa))}io(e){try{this.Ja(e)}catch(e){t4.error(e)}}Xa(){clearTimeout(this.Ka),this.Ka=void 0}eo(){var e={};return sd(this.Za,t=>{var i,s=(t?t.batchKey:null)||t.url;V(e[s])&&(e[s]=y({},t,{data:[]})),null==(i=e[s].data)||i.push(t.data)}),this.Za=[],e}}var n4=["retriesPerformedSoFar"];class n8{constructor(e){this.ro=!1,this.no=3e3,this.Za=[],this._instance=e,this.Za=[],this.so=!0,!V(s)&&"onLine"in s.navigator&&(this.so=s.navigator.onLine,this.ao=()=>{this.so=!0,this.oo()},this.lo=()=>{this.so=!1},sy(s,"online",this.ao),sy(s,"offline",this.lo))}get length(){return this.Za.length}retriableRequest(e){var t=e.retriesPerformedSoFar,i=b(e,n4);Z(t)&&(i.url=nY(i.url,{retry_count:t})),this._instance._send_request(y({},i,{callback:e=>{if(200!==e.statusCode&&(400>e.statusCode||e.statusCode>=500)){if((0===e.statusCode?3:10)>(null!=t?t:0))return void this.Yn(y({retriesPerformedSoFar:t},i));0===e.statusCode&&t4.warn("Request failed before receiving an HTTP response; this can happen due to network issues, CORS, browser blocking, or ad blockers. Stopped retrying after "+(null!=t?t:0)+" retries.")}null==i.callback||i.callback(e)}}))}Yn(e){var t,i,s=e.retriesPerformedSoFar||0;e.retriesPerformedSoFar=s+1;var r=Math.ceil((i=Math.min(18e5,t=3e3*Math.pow(2,s)))+(Math.random()-.5)*(i-t/2)),n=Date.now()+r;this.Za.push({retryAt:n,requestOptions:e});var o="Enqueued failed request for retry in "+r;navigator.onLine||(o+=" (Browser is offline)"),t4.warn(o),this.ro||(this.ro=!0,this.uo())}uo(){if(this.ho&&clearTimeout(this.ho),0===this.Za.length)return this.ro=!1,void(this.ho=void 0);this.ho=setTimeout(()=>{this.so&&this.Za.length>0&&this.oo(),this.uo()},this.no)}oo(){var e=Date.now(),t=[],i=this.Za.filter(i=>e>i.retryAt||(t.push(i),!1));if(this.Za=t,i.length>0)for(var s of i)this.retriableRequest(s.requestOptions)}unload(){for(var e of(this.ho&&(clearTimeout(this.ho),this.ho=void 0),this.ro=!1,V(s)||(this.ao&&(s.removeEventListener("online",this.ao),this.ao=void 0),this.lo&&(s.removeEventListener("offline",this.lo),this.lo=void 0)),this.Za)){var t=e.requestOptions;try{this._instance._send_request(y({},t,{transport:"sendBeacon"}))}catch(e){t4.error(e)}}this.Za=[]}}class n9{constructor(e){this.do=()=>{this.vo||(this.vo={});var e,t,i,s,r=this.scrollElement(),n=this.scrollY(),o=r?Math.max(0,r.scrollHeight-r.clientHeight):0,a=n+((null==r?void 0:r.clientHeight)||0),l=(null==r?void 0:r.scrollHeight)||0;this.vo.lastScrollY=Math.ceil(n),this.vo.maxScrollY=Math.max(n,null!==(e=this.vo.maxScrollY)&&void 0!==e?e:0),this.vo.maxScrollHeight=Math.max(o,null!==(t=this.vo.maxScrollHeight)&&void 0!==t?t:0),this.vo.lastContentY=a,this.vo.maxContentY=Math.max(a,null!==(i=this.vo.maxContentY)&&void 0!==i?i:0),this.vo.maxContentHeight=Math.max(l,null!==(s=this.vo.maxContentHeight)&&void 0!==s?s:0)},this._instance=e}get co(){return this._instance.config.scroll_root_selector}getContext(){return this.vo}resetContext(){var e=this.vo;return setTimeout(this.do,0),e}startMeasuringScrollPosition(){sy(s,"scroll",this.do,{capture:!0}),sy(s,"scrollend",this.do,{capture:!0}),sy(s,"resize",this.do)}scrollElement(){if(!this.co)return null==s?void 0:s.document.documentElement;for(var e of B(this.co)?this.co:[this.co]){var t=null==s?void 0:s.document.querySelector(e);
1if(t)return t}}fo(e){if(this.co){var t=this.scrollElement();return t&&t["y"===e?"scrollTop":"scrollLeft"]||0}return s?"y"===e?s.scrollY||s.pageYOffset||s.document.documentElement.scrollTop||0:s.scrollX||s.pageXOffset||s.document.documentElement.scrollLeft||0:0}scrollY(){return this.fo("y")}scrollX(){return this.fo("x")}}var n7=e=>r1(null==e?void 0:e.config.mask_personal_data_properties,null==e?void 0:e.config.custom_personal_data_properties,null==e?void 0:e.config.disable_capture_url_hashes);class oe{constructor(e,t,i,s){this.xt=e=>{var t=this.po();if(!t||t.sessionId!==e){var i={sessionId:e,props:this.mo(this._instance)};this.yo.register({[iX]:i})}},this._instance=e,this.bo=t,this.yo=i,this.mo=s||n7,this.bo.onSessionId(this.xt)}po(){return this.yo.props[iX]}getSetOnceProps(){var e,t=null==(e=this.po())?void 0:e.props;return t?"r"in t?r2(t,this._instance.config.disable_capture_url_hashes):{$referring_domain:t.referringDomain,$pathname:t.initialPathName,utm_source:t.utm_source,utm_campaign:t.utm_campaign,utm_medium:t.utm_medium,utm_content:t.utm_content,utm_term:t.utm_term}:{}}getSessionProps(){var e={};return sd(s_(this.getSetOnceProps()),(t,i)=>{"$current_url"===i&&(i="url"),e["$session_entry_"+A(i)]=t}),e}}class ot{on(e,t){return this._o[e]||(this._o[e]=[]),this._o[e].push(t),()=>{this._o[e]=this._o[e].filter(e=>e!==t)}}emit(e,t){for(var i of this._o[e]||[])i(t);for(var s of this._o["*"]||[])s(e,t)}constructor(){this._o={}}}var oi=t8("[SessionId]");class os{on(e,t){return this.wo.on(e,t)}constructor(e,t,i){if(this.ko=null,this.So=null,this.xo=[],this.Co=void 0,this.To=!1,this.wo=new ot,this.Mo=(e,t)=>!(!Z(e)||!Z(t))&&Math.abs(e-t)>this.sessionTimeoutMs,!e.persistence)throw Error("SessionIdManager requires a PostHogPersistence instance");if(e.config.cookieless_mode===st)throw Error('SessionIdManager cannot be used with cookieless_mode="always"');this.vn=e.config,this.yo=e.persistence,this.Ct=void 0,this.Le=void 0,this._sessionStartTimestamp=null,this.Eo=void 0,this._sessionActivityTimestamp=null,this.Io=t||s$,this.Ro=i||s$;var s,r=this.vn.persistence_name||this.vn.token;if(this._sessionTimeoutMs=1e3*eh(this.vn.session_idle_timeout_seconds||1800,60,36e3,oi.createLogger("session_idle_timeout_seconds"),1800),e.register({$configured_session_timeout_ms:this._sessionTimeoutMs}),this.Po(),this.Ao="ph_"+r+"_window_id",this.Fo="ph_"+r+"_primary_window_exists",this.Oo()){var n=sK.ni(this.Ao),o=sK.ni(this.Fo);n&&!o?this.Ct=n:sK.ri(this.Ao),sK.ei(this.Fo,!0)}null!=(s=this.vn.bootstrap)&&s.sessionID&&this.setBootstrapSessionId(this.vn.bootstrap.sessionID),this.Lo()}get sessionTimeoutMs(){return this._sessionTimeoutMs}onSessionId(e){return V(this.xo)&&(this.xo=[]),this.xo.push(e),this.Le&&e(this.Le,this.Ct),()=>{this.xo=this.xo.filter(t=>t!==e)}}Oo(){return"memory"!==this.vn.persistence&&!this.yo.ga&&sK.Xr()}Do(e){e!==this.Ct&&(this.Ct=e,this.Oo()&&sK.ei(this.Ao,e))}$o(){return this.Ct?this.Ct:this.Oo()?sK.ni(this.Ao):null}No(e){var t=this.ko;return!Y(t)&&!Y(e)&&5e3>Math.abs(e-t)}qo(e,t,i){var s=t!==this._sessionActivityTimestamp,r=!(e!==this.Le||i!==this._sessionStartTimestamp);this._sessionStartTimestamp=i,this._sessionActivityTimestamp=t,this.Le=e,r&&!s||r&&this.No(t)||(this.ko=t,this.yo.register({[iI]:[t,e,i]}))}jo(){var e,t=null==(e=this.vn)?void 0:e.persistence_save_debounce_ms;return Z(t)&&t>0}Bo(){this.jo()?this.yo.refreshKey(iI):(this.yo.flush(),this.yo.load())}Ho(){var e;if(!Y(this._sessionActivityTimestamp)&&this._sessionActivityTimestamp!==this.ko){this.Bo();var t=this.zo();t[1]===this.Le&&t[2]===this._sessionStartTimestamp&&(this.ko=this._sessionActivityTimestamp,this.yo.register({[iI]:[this._sessionActivityTimestamp,null!==(e=this.Le)&&void 0!==e?e:null,this._sessionStartTimestamp]}),this.yo.flush())}}Uo(){var e=this.zo()[0];return Math.max(Z(e)?e:0,Z(this._sessionActivityTimestamp)?this._sessionActivityTimestamp:0)}Wo(e){return this.Bo(),this.Mo(e,this.Uo())}zo(){var e=this.yo.props[iI];return B(e)&&2===e.length&&e.push(e[0]),e||[0,null,0]}resetSessionId(){this.ko=null,this.Eo=void 0,clearTimeout(this.Vo),this.Vo=void 0,this.qo(null,null,null)}setBootstrapSessionId(e,t){void 0===t&&(t=!1);var i=function(e,t){void 0===t&&(t=(new Date).getTime());try{var i=(e=>{var t=e.replace(/-/g,"");if(32!==t.length)throw Error("Not a valid UUID");if("7"!==t[12])throw Error("Not a UUIDv7");return parseInt(t.substring(0,12),16)})(e);return i>t+6e4?void oi.error("Bootstrap sessionID cannot be in the future"):i}catch(e){return void oi.error("Invalid sessionID in bootstrap",e)}}(e);return!V(i)&&(t?this.Eo={sessionId:e,sessionStartTimestamp:i}:this.qo(e,(new Date).getTime(),i),!0)}destroy(){this.To=!0,this.Ho(),clearTimeout(this.Vo),this.Vo=void 0,this.Co&&s&&(s.removeEventListener(so,this.Co,{capture:!1}),this.Co=void 0),this.xo=[]}Lo(){this.Co=()=>{this.Ho(),this.Oo()&&sK.ri(this.Fo)},sy(s,so,this.Co,{capture:!1})}
1checkAndGetSessionAndWindowId(e,t,i){if(void 0===e&&(e=!1),void 0===t&&(t=null),void 0===i&&(i=!1),this.vn.cookieless_mode===st)throw Error('checkAndGetSessionAndWindowId should not be called with cookieless_mode="always"');var s,r,n=t||(new Date).getTime(),o=this.Le;i?this.So=n:(Y(this.So)||this.So>n||n-this.So>=1e3)&&(null==(s=(r=this.yo).syncCookieProperties)||s.call(r),this.So=n);var a=this.zo(),l=a[1],u=a[2],h=!V(o)&&l!==o,c=this.Uo(),d=this.$o(),v=this.Eo,p=!!v&&(v.sessionStartTimestamp>n+6e4||n-v.sessionStartTimestamp>864e5),g=v?p:Z(u)&&Math.abs(n-u)>864e5,f=!1,_=h,m=!l||!!v,y=l,b=!m&&!e&&this.Mo(n,c);if(b){(b=this.Wo(n))||oi.info("cross-tab refresh kept the session alive",{sessionId:l});var w=this.zo();l=w[1],u=w[2]}if(m||b||g){_=!1;var x=v&&!p;l=x?v.sessionId:this.Io(),d=this.Ro(),oi.info("new session ID assigned",{sessionId:l,windowId:d,bootstrapped:!!x,changeReason:{noSessionId:m,activityTimeout:b,sessionPastMaximumLength:g}}),u=x?v.sessionStartTimestamp:n,this.Eo=void 0,f=!0}else d||(d=this.Ro(),f=!0),(_=_||l!==y)&&(oi.info("adopted cross-tab session id",{sessionId:l,windowId:d}),f=!0);var k=Z(c)&&e&&!g?c:n,E=Z(u)?u:(new Date).getTime();this.Do(d),this.qo(l,k,E),e||this.Po();var S={noSessionId:m,activityTimeout:b,sessionPastMaximumLength:g,crossTabAdoption:_};return f&&this.xo.forEach(e=>e(l,d,S)),{sessionId:l,windowId:d,sessionStartTimestamp:E,changeReason:f?S:void 0,lastActivityTimestamp:c}}Po(){this.To||(clearTimeout(this.Vo),this.Vo=setTimeout(()=>{if(!this.To){if(this.Wo((new Date).getTime())){var e=this.Le;this.resetSessionId(),this.wo.emit("forcedIdleReset",{idleSessionId:e})}else this.Po()}},1.1*this.sessionTimeoutMs))}}var or=function(e,t){if(!e)return!1;var i=e.userAgent;if(i&&R(i,t))return!0;try{var s=null==e?void 0:e.userAgentData;if(null!=s&&s.brands&&s.brands.some(e=>R(null==e?void 0:e.brand,t)))return!0}catch(e){}return!!e.webdriver};function on(){return(on=m(function*(){var e=null==n?void 0:n.userAgentData;if(null!=e&&e.getHighEntropyValues)try{var t=yield e.getHighEntropyValues(["model"]),i=null==t?void 0:t.model;return W(i)&&i.length>0?i:void 0}catch(e){return void t4.info("Unable to resolve $device_model from userAgentData.getHighEntropyValues",e)}})).apply(this,arguments)}function oo(e){var t;return!(null==(t=e.conditions)||null==(t=t.events)||null==(t=t.values)||!t.length)}var oa=(e,t)=>{if(!(e=>{try{new RegExp(e)}catch(e){return!1}return!0})(t))return!1;try{return new RegExp(t).test(e)}catch(e){return!1}},ol=e=>e.toLowerCase(),ou={exact:(e,t)=>t.some(t=>e.some(e=>t===e)),is_not:(e,t)=>t.every(t=>e.every(e=>t!==e)),regex:(e,t)=>t.some(t=>e.some(e=>oa(t,e))),not_regex:(e,t)=>t.every(t=>e.every(e=>!oa(t,e))),icontains:(e,t)=>t.map(ol).some(t=>e.map(ol).some(e=>t.includes(e))),not_icontains:(e,t)=>t.map(ol).every(t=>e.map(ol).every(e=>!t.includes(e))),gt:(e,t)=>t.some(t=>{var i=parseFloat(t);return!isNaN(i)&&e.some(e=>i>parseFloat(e))}),lt:(e,t)=>t.some(t=>{var i=parseFloat(t);return!isNaN(i)&&e.some(e=>i<parseFloat(e))})};function oh(e,t){return!e||Object.entries(e).every(e=>{var i=e[1],s=null==t?void 0:t[e[0]];if(null==s)return!1;var r=ou[i.operator];return!!r&&r(i.values,[String(s)])})}function oc(e,t,i){return rD({distinct_id:e,userPropertiesToSet:t,userPropertiesToSetOnce:i})}var od="custom",ov="i.posthog.com",op=/^\/static\//,og=["/s/","/e/","/i/"];class of{constructor(e){this.Go={},this.instance=e}get apiHost(){var e=this.instance.config.api_host.trim().replace(/\/$/,"");return"https://app.posthog.com"===e?"https://us.i.posthog.com":e}get flagsApiHost(){var e=this.instance.config.flags_api_host;return e?e.trim().replace(/\/$/,""):this.apiHost}get uiHost(){var e,t=null==(e=this.instance.config.ui_host)?void 0:e.replace(/\/$/,"");return t||(t=this.apiHost.replace("."+ov,".posthog.com")),"https://app.posthog.com"===t?"https://us.posthog.com":t}get region(){return this.Go[this.apiHost]||(this.Go[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":od),this.Go[this.apiHost]}Zo(e){if(op.test(e)){var t=this.instance.config.asset_host;if("string"==typeof t)return t.trim().replace(/\/$/,"")||void 0}}Qo(e){var t=rN(e);return t?t.protocol+"//"+t.host+t.pathname:void 0}Jo(e,t,i){if("ui"===e)return i;var s=i,r=this.instance.config.rewriteRequestPath;
1if(r&&(s=r(new URL((null==(o=rN(i))?void 0:o.href)||i)).toString()),r&&"api"===e&&og.some(e=>0===t.indexOf(e))){var n=this.Qo(s);if(n){var o,a,l=this.apiHost,u=this.Ko;(null==(a=u)?void 0:a.apiHost)===l&&u.rewriteRequestPath===r||(u={apiHost:l,rewriteRequestPath:r,urls:new Set},this.Ko=u),u.urls.add(n)}}return s}isIngestionEndpoint(e){var t=this.Ko,i=this.Qo(e);return(null==t?void 0:t.apiHost)===this.apiHost&&t.rewriteRequestPath===this.instance.config.rewriteRequestPath&&!!i&&t.urls.has(i)}endpointFor(e,t){if(void 0===t&&(t=""),t&&(t="/"===t[0]?t:"/"+t),"ui"===e)return this.Jo(e,t,this.uiHost+t);if("flags"===e)return this.Jo(e,t,this.flagsApiHost+t);if("assets"===e){var i=this.Zo(t);if(i)return this.Jo(e,t,""+i+t)}if(this.region===od)return this.Jo(e,t,this.apiHost+t);var s=ov+t;switch(e){case"assets":return this.Jo(e,t,"https://"+this.region+"-assets."+s);case"api":return this.Jo(e,t,"https://"+this.region+"."+s)}}}var o_=t8("[Surveys]"),om="seenSurvey_",oy=e=>{try{let i;var t=(i=e,""+om+function(e){return e.current_iteration&&e.current_iteration>0?e.id+"_"+e.current_iteration:e.id}(i));if(localStorage.getItem(t))return;localStorage.setItem(t,"true")}catch(e){o_.error("Failed to persist survey seen state",e)}},ob=[ns.Popover,ns.Widget,ns.API],ow={ignoreConditions:!1,ignoreDelay:!1,displayType:no.Popover},ox=t8("[PostHog ExternalIntegrations]"),ok={intercom:"intercom-integration",crispChat:"crisp-chat-integration"};class oE{constructor(e){this._instance=e}Zs(e,t){var i;null==(i=g.__PosthogExtensions__)||null==i.loadExternalDependency||i.loadExternalDependency(this._instance,e,e=>{if(e)return ox.error("failed to load script",e);t()})}startIfEnabledOrStop(){var e,t=this;for(var i of Object.entries(null!==(e=this._instance.config.integrations)&&void 0!==e?e:{}))!function(){var e,s,r,n=i[0],o=i[1];!o||null!=(e=g.__PosthogExtensions__)&&null!=(e=e.integrations)&&e[n]||t.Zs(ok[n],()=>{var e;null==(e=g.__PosthogExtensions__)||null==(e=e.integrations)||null==(e=e[n])||e.start(t._instance)}),!o&&null!=(s=g.__PosthogExtensions__)&&null!=(s=s.integrations)&&s[n]&&(null==(r=g.__PosthogExtensions__)||null==(r=r.integrations)||null==(r=r[n])||r.stop())}()}}class oS{constructor(e,t){this.I=e,this.Os=t,this.Yo=new Map,this.Rs=!1}add(e){var t=this;return m(function*(){if(t.Rs)throw Error("Cannot add an extension to a disposed ExtensionRuntime");if(t.Yo.has(e.name))throw Error('Browser extension "'+e.name+'" is already registered');t.Yo.set(e.name,e);try{var i=e.setup(t.Os);i&&(yield i)}catch(i){var s=t.Yo.get(e.name)===e;s&&t.Yo.delete(e.name),t.I.error('Failed to set up browser extension "'+e.name+'"',i),s&&t.Xo(e)}})()}getExtension(e){return this.Yo.get(e)}dispose(){if(!this.Rs){this.Rs=!0;var e=Array.from(this.Yo.values()).reverse();for(var t of(this.Yo.clear(),e))this.Xo(t)}}Xo(e){try{var t=null==e.dispose?void 0:e.dispose();t&&H(t.then)&&t.then(void 0,t=>{this.I.error('Failed to dispose browser extension "'+e.name+'"',t)})}catch(t){this.I.error('Failed to dispose browser extension "'+e.name+'"',t)}}}class oP{constructor(e){this._instance=e}initialize(){}get(e){var t=this._instance.persistence;if("string"==typeof e)return null==t?void 0:t.get_property(e);var i={};for(var s of e){var r=null==t?void 0:t.get_property(s);V(r)||(i[s]=r)}return i}set(e,t){var i;null==(i=this._instance.persistence)||i.register("string"==typeof e?{[e]:t}:e)}remove(e){var t;null==(t=this._instance.persistence)||t.unregister(e)}}var oI="extensionsRemoteConfig";class oF{constructor(e){this.Rs=!1,this.instance=e,this.I=t4,this.tl=e.el,this.kv=new oP(e),this.onEvent=e=>ne(this.instance.on("eventCaptured",t=>{try{e({event:t.event,properties:t.properties})}catch(e){this.I.error("Browser extension event listener failed",e)}})),this.onRemoteConfig=e=>{if(this.Rs)return ne(()=>{});var t=t=>{try{e(t)}catch(e){this.I.error("Browser extension remote config listener failed",e)}},i=this.instance.il.on(oI,t);return this.tl&&t(this.tl),ne(i)}
1,this.rl=new oS(t4.createLogger("[BrowserExtensions]"),this)}get logger(){return this.I}get distinctId(){return this.instance.get_distinct_id()}get anonymousId(){var e;return null!==(e=this.instance.get_property(io))&&void 0!==e?e:this.distinctId}get deviceId(){var e=this.instance.get_property(io);return"string"==typeof e?e:void 0}get library(){return{name:f.LIB_NAME,version:f.LIB_VERSION}}get initialPersonProperties(){var e,t;return null!==(e=null==(t=this.instance.persistence)?void 0:t.get_initial_props())&&void 0!==e?e:{}}get groups(){return this.instance.getGroups()}get session(){try{var e,t,i,s,r=null==(e=this.instance.sessionManager)?void 0:e.checkAndGetSessionAndWindowId(!0);return{sessionId:null!==(t=null==r?void 0:r.sessionId)&&void 0!==t?t:"",windowId:null!==(i=null==r?void 0:r.windowId)&&void 0!==i?i:"",sessionStartTimestamp:null!==(s=null==r?void 0:r.sessionStartTimestamp)&&void 0!==s?s:0}}catch(e){return{sessionId:"",windowId:"",sessionStartTimestamp:0}}}get canCapture(){return this.instance.is_capturing()}get projectToken(){return this.instance.config.token}add(e){return this.rl.add(e)}getExtension(e){return this.rl.getExtension(e)}capture(e,t,i){var s=this;return m(function*(){i?s.instance.capture(e,t,{timestamp:i.timestamp,uuid:i.uuid,$set:i.set,$set_once:i.setOnce}):s.instance.capture(e,t)})()}registerDynamicEventProperties(e){return ne(this.instance.nl(e))}handleRemoteConfig(e){this.Rs||(this.tl=e,this.instance.il.emit(oI,e))}sendRequest(e,t){var i=this;return m(function*(){void 0===t&&(t={});var s,r=i.instance.requestRouter.endpointFor(null!==(s=t.target)&&void 0!==s?s:"api",e),n={method:t.method,url:t.query?nY(r,t.query):r,data:t.body,headers:t.headers,timeout:t.timeoutMs,fireCallbackOnDrop:!0,transport:t.transport,compression:t.compression,compressionFallback:"flags"===t.target&&"best-available"===t.compression?P.Base64:void 0,timestampMode:t.sentAt};return"sendBeacon"===t.transport?(i.instance._send_request(n),{statusCode:202}):new Promise(e=>{n.callback=e,i.instance._send_request(n)})})()}dispose(){this.Rs||(this.Rs=!0,this.rl.dispose())}}var oC={},o$=0,oO=()=>{},oT='Consent opt in/out is not valid with cookieless_mode="always" and will be ignored',oR="Surveys module not available",oL="sanitize_properties is deprecated. Use before_send instead",oM="Invalid value for property_denylist config: ",oA=["token","distinct_id",i6],oD="posthog",oN=!nz&&-1===(null==d?void 0:d.indexOf("MSIE"))&&-1===(null==d?void 0:d.indexOf("Mozilla")),oj=e=>{var t={};return e&&"unset"!==e&&("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},oq=e=>{var t;return y({api_host:"https://us.i.posthog.com",flags_api_host:null,ui_host:null,asset_host:null,token:"",autocapture:!0,cross_subdomain_cookie:function(e){var t=null==e?void 0:e.hostname;if(!W(t))return!1;var i=t.split(".").slice(-2).join(".");for(var s of sm)if(i===s)return!1;return!0}(null==o?void 0:o.location),persistence:"localStorage+cookie",persistence_name:"",cookie_persisted_properties:[],loaded:oO,save_campaign_params:!0,custom_campaign_params:[],custom_blocked_useragents:[],save_referrer:!0,capture_pageleave:"if_capture_pageview",defaults:null!=e?e:"unset",__preview_deferred_init_extensions:!1,__preview_external_dependency_versioned_paths:!1,__preview_cookie_wins_on_conflict:!1,debug:a&&W(null==a?void 0:a.search)&&-1!==a.search.indexOf("__posthog_debug=true")||!1,cookie_expiration:365,upgrade:!1,disable_session_recording:!1,disable_persistence:!1,disable_web_experiments:!0,disable_surveys:!1,disable_surveys_automatic_display:!1,disable_conversations:!1,disable_product_tours:!1,disableDeviceModel:!1,disable_external_dependency_loading:!1,strict_script_versioning:"fallback",enable_recording_console_log:void 0,secure_cookie:"https:"===(null==s||null==(t=s.location)?void 0:t.protocol),ip:!1,opt_out_capturing_by_default:!1,opt_out_persistence_by_default:!1,opt_out_useragent_filter:!1,opt_out_capturing_persistence_type:"localStorage",consent_persistence_name:null,opt_out_capturing_cookie_prefix:null,opt_in_site_apps:!1,property_denylist:[],respect_dnt:!1,sanitize_properties:null,request_headers:{},request_batching:!0,properties_string_max_length:65535,mask_all_element_attributes:!1,mask_all_text:!1,mask_personal_data_properties:!1,custom_personal_data_properties:[],advanced_disable_flags:!1,advanced_disable_decide:!1,advanced_disable_feature_flags:!1,advanced_disable_feature_flags_on_first_load:!1,advanced_only_evaluate_survey_feature_flags:!1,advanced_feature_flags_dedup_per_session:!1,advanced_enable_surveys:!1,advanced_disable_toolbar_metrics:!1,feature_flag_request_timeout_ms:3e3,surveys_request_timeout_ms:1e4,on_request_error(e){t4.error("Bad HTTP status: "+e.statusCode+" "+e.text)},get_device_id:e=>e,capture_performance:void 0,name:"posthog",bootstrap:{},disable_compression:!1,session_idle_timeout_seconds:1800,person_profiles:sr,before_send:void 0,get_current_url:void 0,request_queue_config:{flush_interval_ms:3e3},error_tracking:{},_onCapture:oO},(e=>({rageclick:e&&e>="2026-05-30"?{content_ignorelist:ro,ignore_text_selection:!0}
1:!e||"2025-11-30">e||{content_ignorelist:!0},capture_pageview:!e||"2025-05-24">e||"history_change",session_recording:oj(e),external_scripts_inject_target:e&&e>="2026-01-30"?"head":"body",internal_or_test_user_hostname:e&&e>="2026-01-30"?/^(localhost|127\.0\.0\.1)$/:void 0,persistence_save_debounce_ms:e&&e>="2026-05-30"?250:0,split_storage:!(!e||"2026-05-30">e),detect_google_search_app:!(!e||"2026-05-30">e),disable_capture_url_hashes:!(!e||"2026-06-25">e),cookieWinsOnConflict:!(!e||"unset"===e||"2026-08-29">e)}))(e))},oB=[["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"]],oH=e=>{var t={};for(var i of oB){var s=i[0],r=i[1];V(e[s])||(t[r]=e[s])}var n=sv({},t,e),o=e.__preview_external_dependency_versioned_paths;return V(o)||(V(e.strict_script_versioning)&&(n.strict_script_versioning=!!o),W(o)&&V(e.asset_host)&&(n.asset_host=o)),B(e.property_blacklist)&&(V(e.property_denylist)?n.property_denylist=e.property_blacklist:B(e.property_denylist)?n.property_denylist=[...e.property_blacklist,...e.property_denylist]:t4.error(oM+e.property_denylist)),n};class oU{constructor(){this.__forceAllowLocalhost=!1}get sl(){return this.__forceAllowLocalhost}set sl(e){t4.error("WebPerformanceObserver is deprecated and has no impact on network capture. Use `_forceAllowLocalhostNetworkCapture` on `posthog.sessionRecording`"),this.__forceAllowLocalhost=e}}class oz{al(e,t){if(e){var i=this.Yo.indexOf(e);-1!==i&&this.Yo.splice(i,1)}return this.Yo.push(t),null==t.initialize||t.initialize(),t}ol(){return this.config.cookieless_mode===st||this.config.cookieless_mode===se&&this.consent.isRejected()}ll(){if(!this.ol()&&this.get_distinct_id()===i5){var e=this.persistence;if(e){this.ul()||e.load(!0);var t=this.get_distinct_id();if(!t||t===i5){var i=this.config.get_device_id(s$());this.register({distinct_id:i,$device_id:i}),e.set_property(iZ,si)}this.hl()}}}get decideEndpointWasHit(){var e,t;return null!==(e=null==(t=this.featureFlags)?void 0:t.hasLoadedFlags)&&void 0!==e&&e}get flagsEndpointWasHit(){var e,t;return null!==(e=null==(t=this.featureFlags)?void 0:t.hasLoadedFlags)&&void 0!==e&&e}constructor(){this.webPerformance=new oU,this.dl=!1,this.version=f.LIB_VERSION,this.vl=new Set,this.cl="",this.il=new ot,this.Yo=[],this.fl=[],this._calculate_event_properties=this.calculateEventProperties.bind(this),this.config=oq(),this.SentryIntegration=rO,this.sentryIntegration=e=>(function(e,t){var i=r$(e,t);return{name:rC,processEvent:e=>i(e)}})(this,e),this.__request_queue=[],this.__loaded=!1,this.analyticsDefaultEndpoint="/e/",this.pl=!1,this.gl=null,this.ml=null,this.yl=null,this.scrollManager=new n9(this),this.pageViewManager=new rT(this),this.rateLimiter=new nh(this),this.requestRouter=new of(this),this.consent=new sZ(this),this.externalIntegrations=new oE(this);var e,t=null!==(e=oz.__defaultExtensionClasses)&&void 0!==e?e:{};this.featureFlags=t.featureFlags&&new t.featureFlags(this),this.toolbar=t.toolbar&&new t.toolbar(this),this.surveys=t.surveys&&new t.surveys(this),this.conversations=t.conversations&&new t.conversations(this),this.logs=t.logs&&new t.logs(this),this.metrics=t.metrics&&new t.metrics(this),this.experiments=t.experiments&&new t.experiments(this),this.exceptions=t.exceptions&&new t.exceptions(this),this.people={set:(e,t,i)=>{var s=W(e)?{[e]:t}:e;this.setPersonProperties(s),null==i||i({})},set_once:(e,t,i)=>{var s=W(e)?{[e]:t}:e;this.setPersonProperties(void 0,s),null==i||i({})}},this.on("eventCaptured",e=>t4.info('send "'+(null==e?void 0:e.event)+'"',e))}init(e,t,i){if(i&&i!==oD){var s,r=null!==(s=oC[i])&&void 0!==s?s:new oz;return r._init(e,t,i),oC[i]=r,oC[oD][i]=r,r}return this._init(e,t,i)}_init(e,t,i){void 0===t&&(t={});var r,n,o,a=W(e)?e.trim():"";if(!a)return t4.critical("PostHog was initialized without a token. This likely indicates a misconfiguration. Please check the first argument passed to posthog.init()"),this;if(this.__loaded)return a!==(null==(o=this.config)?void 0:o.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=oq(t.defaults),t.debug=this.bl(t.debug),this._l=t,this.wl=[],t.person_profiles?this.ml=t.person_profiles:t.process_person&&(this.ml=t.process_person);var l=oq(t.defaults),u=oH(t),h=sv({},l,u,{name:i,token:a});U(l.rageclick)&&U(u.rageclick)&&(h.rageclick=sv({},l.rageclick,u.rageclick)),U(l.session_recording)&&U(u.session_recording)&&(h.session_recording=sv({},l.session_recording,u.session_recording)),this.set_config(h),this.config.on_xhr_error&&t4.error("on_xhr_error is deprecated. Use on_request_error instead"),this.compression=t.disable_compression?void 0:nt.GZipJS;var c=this.ul();if(this.persistence=new r7(this.config,c),this.sessionPersistence="sessionStorage"===this.config.persistence||"memory"===this.config.persistence?this.persistence:new r7(y({},this.config,{persistence:"sessionStorage"}),c,!1),this.cl="ph_"+(this.config.persistence_name||this.config.token)+"_session_registered_properties","memory"!==this.config.persistence&&!c&&sK.Xr()){var d=sK.ni(this.cl);
1B(d)&&d.forEach(e=>{W(e)&&this.vl.add(e)})}else sK.ri(this.cl);var v=y({},this.persistence.props),p=y({},this.sessionPersistence.props);this.register({$initialization_time:(new Date).toISOString()}),this.kl=new n6(e=>this.Sl(e),this.config.request_queue_config),this.xl=new n8(this),this.__request_queue=[];var g=this.ol();if(g||(this.sessionManager=new os(this),this.sessionPropsManager=new oe(this,this.sessionManager,this.persistence),this.sessionManager.onSessionId((e,t,i)=>{(null!=i&&i.activityTimeout||null!=i&&i.sessionPastMaximumLength||null!=i&&i.crossTabAdoption)&&this.Cl()})),this.Tl(),this.config.__preview_deferred_init_extensions?(t4.info("Deferring extension initialization to improve startup performance"),setTimeout(()=>{this.Ml(g)},0)):(t4.info("Initializing extensions synchronously"),this.Ml(g)),f.DEBUG=f.DEBUG||this.config.debug,f.DEBUG&&t4.info("Starting in debug mode",{this:this,config:t,thisC:y({},this.config),p:v,s:p}),!this.config.identity_distinct_id||null!=(r=t.bootstrap)&&r.distinctID||(t.bootstrap=y({},t.bootstrap,{distinctID:this.config.identity_distinct_id,isIdentifiedID:!0})),void 0!==(null==(n=t.bootstrap)?void 0:n.distinctID)){var _=t.bootstrap.distinctID,m=this.get_distinct_id(),b=this.persistence.get_property(iZ);if(t.bootstrap.isIdentifiedID&&null!=m&&m!==_&&b===si)this.identify(_);else if(t.bootstrap.isIdentifiedID&&null!=m&&m!==_&&b===ss)t4.warn("Bootstrap distinctID differs from an already-identified user. The existing identity is preserved. Call reset() before reinitializing if you intend to switch users.");else{var w=this.config.get_device_id(s$()),x=t.bootstrap.isIdentifiedID?w:_;this.persistence.set_property(iZ,t.bootstrap.isIdentifiedID?ss:si),this.register({distinct_id:_,$device_id:x})}}if(g)this.register_once({distinct_id:i5,$device_id:null},"");else if(!this.get_distinct_id()){var k=this.config.get_device_id(s$());this.register_once({distinct_id:k,$device_id:k},""),this.persistence.set_property(iZ,si)}return sy(s,"onpagehide"in self?"pagehide":"unload",this._handle_unload.bind(this),{passive:!1}),t.segment?function(e,t){var i=e.config.segment;if(!i)return t();!function(e,t){var i=e.config.segment;if(!i)return t();var s=i=>{var s=()=>i.anonymousId()||s$();e.config.get_device_id=s,i.id()&&(e.register({distinct_id:i.id(),$device_id:s()}),e.persistence.set_property(iZ,ss)),t()},r=i.user();"then"in r&&H(r.then)?r.then(s):s(r)}(e,()=>{var s;i.register(("undefined"!=typeof Promise&&Promise.resolve||rF.warn("This browser does not have Promise support, and can not use the segment integration"),s=(t,i)=>{if(!i)return t;t.event.userId||t.event.anonymousId===e.get_distinct_id()||(rF.info("No userId set, resetting PostHog"),e.reset()),t.event.userId&&t.event.userId!==e.get_distinct_id()&&(rF.info("UserId set, identifying with PostHog"),e.identify(t.event.userId));var s=e.calculateEventProperties(i,t.event.properties);return t.event.properties=Object.assign({},s,t.event.properties),t},{name:"PostHog JS",type:"enrichment",version:"1.0.0",isLoaded:()=>!0,load:()=>Promise.resolve(),track:e=>s(e,e.event.event),page:e=>s(e,sa),identify:e=>s(e,su),screen:e=>s(e,"$screen")})).then(()=>{t()})})}(this,()=>this.El()):this.El(),H(this.config._onCapture)&&this.config._onCapture!==oO&&(t4.warn("onCapture is deprecated. Please use `before_send` instead"),this.on("eventCaptured",e=>this.config._onCapture(e.event,e))),this.config.ip&&t4.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 on.apply(this,arguments)})().then(e=>{e&&this.register({[ia]:e})}).catch(oO),this}Il(e){return W(e.name)&&H(e.setup)}Rl(e,t){this.Il(e)?t.push(()=>{this.Pl().add(e).catch(()=>null==e.dispose?void 0:e.dispose()).catch(t=>{t4.error('Failed to dispose browser extension "'+e.name+'"',t)})}):this.Yo.push(e)}Tl(){var e,t,i,s,r,n,o=null!==(e=null==(t=this.config.__extensionClasses)?void 0:t.featureFlags)&&void 0!==e?e:null==(i=oz.__defaultExtensionClasses)?void 0:i.featureFlags;o&&(this.featureFlags&&this.featureFlags instanceof o||(null==(s=this.Al)||s.call(this),this.Al=void 0,this.featureFlags=new o(this)),H(this.featureFlags.onReloading)&&H(this.featureFlags.setup)?this.Al||(this.Al=this.featureFlags.onReloading(()=>{this.il.emit("featureFlagsReloading",!0)}),this.Pl().add(this.featureFlags)):null==(r=(n=this.featureFlags).initialize)||r.call(n))}Ml(e){var t,i,s,r,n,o,a,l=performance.now(),u=y({},oz.__defaultExtensionClasses,this.config.__extensionClasses),h=[];u.exceptions&&this.Yo.push(this.exceptions=null!==(t=this.exceptions)&&void 0!==t?t:new u.exceptions(this)),u.historyAutocapture&&this.Yo.push(this.historyAutocapture=new u.historyAutocapture(this)),u.tracingHeaders&&this.Yo.push(this.tracingHeaders=new u.tracingHeaders(this)),u.siteApps&&this.Yo.push(this.siteApps=new u.
vendor: 4,316 bytes, line 1
1siteApps(this)),u.sessionRecording&&!e&&this.Yo.push(this.sessionRecording=new u.sessionRecording(this)),this.config.disable_scroll_properties||h.push(()=>{this.scrollManager.startMeasuringScrollPosition()}),u.autocapture&&this.Rl(this.autocapture=new u.autocapture(this),h),u.surveys&&this.Rl(this.surveys=null!==(i=this.surveys)&&void 0!==i?i:new u.surveys(this),h),u.logs&&this.Rl(this.logs=null!==(s=this.logs)&&void 0!==s?s:new u.logs(this),h),u.metrics&&this.Yo.push(this.metrics=null!==(r=this.metrics)&&void 0!==r?r:new u.metrics(this)),u.conversations&&this.Yo.push(this.conversations=null!==(n=this.conversations)&&void 0!==n?n:new u.conversations(this)),u.productTours&&this.Yo.push(this.productTours=new u.productTours(this)),u.heatmaps&&this.Yo.push(this.heatmaps=new u.heatmaps(this)),u.webVitalsAutocapture&&this.Yo.push(this.webVitalsAutocapture=new u.webVitalsAutocapture(this)),u.exceptionObserver&&this.Yo.push(this.exceptionObserver=new u.exceptionObserver(this)),u.deadClicksAutocapture&&this.Yo.push(this.deadClicksAutocapture=new u.deadClicksAutocapture(this,rP)),u.toolbar&&this.Yo.push(this.toolbar=null!==(o=this.toolbar)&&void 0!==o?o:new u.toolbar(this)),u.experiments&&this.Yo.push(this.experiments=null!==(a=this.experiments)&&void 0!==a?a:new u.experiments(this)),this.Yo.forEach(e=>{e.initialize&&h.push(()=>{null==e.initialize||e.initialize()})}),h.push(()=>{if(this.Fl){var e=this.Fl;this.Fl=void 0,this.Yo.forEach(t=>null==t.onRemoteConfig?void 0:t.onRemoteConfig(e))}}),this.Ol(h,l)}Ol(e,t){for(;e.length>0;){if(this.config.__preview_deferred_init_extensions&&performance.now()-t>=30&&e.length>0)return void setTimeout(()=>{this.Ol(e,t)},0);var i=e.shift();if(i)try{i()}catch(e){t4.error("Error initializing extension:",e)}}var s=Math.round(performance.now()-t);this.register_for_session({[i4]:this.config.__preview_deferred_init_extensions?"deferred":"synchronous",[i8]:s}),this.config.__preview_deferred_init_extensions&&t4.info("PostHog extensions initialized ("+s+"ms)")}za(e){var t;if(!o||!o.body)return t4.info("document not ready yet, trying again in 500 milliseconds..."),void setTimeout(()=>{this.za(e)},500);if(this.config.__preview_deferred_init_extensions&&(this.Fl=e),this.el=e,this.compression=void 0,e.ok){var i,s=e.config;s.supportedCompression&&!this.config.disable_compression&&(this.compression=L(s.supportedCompression,nt.GZipJS)?nt.GZipJS:L(s.supportedCompression,nt.Base64)?nt.Base64:void 0),null!=(i=s.analytics)&&i.endpoint&&(this.analyticsDefaultEndpoint=s.analytics.endpoint)}this.set_config({person_profiles:this.ml?this.ml:sr}),null==(t=this.Ll)||t.handleRemoteConfig(e),this.Yo.forEach(t=>null==t.onRemoteConfig?void 0:t.onRemoteConfig(e))}El(){try{this.config.loaded(this)}catch(e){t4.critical("`loaded` function failed",e)}if(this.Dl(),this.config.internal_or_test_user_hostname&&null!=a&&a.hostname){var e=a.hostname,t=this.config.internal_or_test_user_hostname;("string"==typeof t?e===t:t.test(e))&&this.setInternalOrTestUser()}this.config.capture_pageview&&setTimeout(()=>{(this.consent.isOptedIn()||this.ol())&&this.$l()},1),this.Nl=new nd(this),this.Nl.load()}Dl(){var e;this.is_capturing()&&this.config.request_batching&&(null==(e=this.kl)||e.enable())}_dom_loaded(){this.is_capturing()&&sc(this.__request_queue,e=>this.Sl(e)),this.__request_queue=[],this.Dl()}_handle_unload(){var e,t,i,s,r;null==(e=this.surveys)||null==e.handlePageUnload||e.handlePageUnload(),null==(t=this.metrics)||t.flush("sendBeacon"),this.config.request_batching?(this.ql()&&this.capture(sl),null==(i=this.logs)||i.flushLogs("sendBeacon"),null==(s=this.kl)||s.unload(),null==(r=this.xl)||r.unload()):this.ql()&&this.capture(sl,null,{transport:"sendBeacon"})}_send_request(e){var t;this.__loaded?oN?this.__request_queue.push(e):this.rateLimiter.isServerRateLimited(e.batchKey)?e.fireCallbackOnDrop&&(null==e.callback||e.callback({statusCode:429})):(e.transport=e.transport||this.config.api_transport,e.headers=y({},this.config.request_headers,e.headers),e.compression="best-available"===e.compression?null!==(t=this.compression)&&void 0!==t?t:e.compressionFallback:e.compression,(V(this.config.disable_beacon)?this.config.__preview_disable_beacon:this.config.disable_beacon)&&(e.disableTransport=["sendBeacon"]),e.fetchOptions=e.fetchOptions||this.config.fetch_options,
1(e=>{var t,i,s,r,n,o=y({},e);o.timeout=o.timeout||6e4;var a,l,u,h,d,v=null!==(s=o.transport)&&void 0!==s?s:"fetch";"sendBeacon"===v&&V(o.compression)&&o.data&&(o.compression=nt.Base64),"POST"===o.method&&o.data&&("capture-body"===o.timestampMode?o.data={api_key:null!==(l=null==(d=(h=(B(a=o.data)?a:[a]).map(e=>y({},e,e.timestamp instanceof Date&&!isNaN(e.timestamp.getTime())?{timestamp:e.timestamp.toISOString()}:{})))[0])||null==(u=d.properties)?void 0:u.token)&&void 0!==l?l:null==d?void 0:d.token,batch:h,sent_at:(new Date).toISOString()}:"body"===o.timestampMode&&(o.data=(t=o.data,void 0===i&&(i=(new Date).toISOString()),B(t)?t.map(e=>y({},e,{sent_at:i})):y({},t,{sent_at:i})))),o.url=n3(o.url,o.method,o.compression,o.timestampMode);var p=n5.filter(e=>!o.disableTransport||!e.transport||!o.disableTransport.includes(e.transport)),g=null!==(r=null==(n=function(e,t){for(var i=0;e.length>i;i++)if(e[i].transport===v)return e[i]}(p))?void 0:n.method)&&void 0!==r?r:p[0].method;if(!g)throw Error("No available transport method");var f=e=>{try{g(e)}catch(e){n0(e)?t4.warn(e):t4.error(e),null==o.callback||o.callback({statusCode:0,error:e})}};"sendBeacon"!==v&&o.data&&o.compression===nt.GZipJS&&c&&"undefined"!=typeof Promise&&!nW?nX(o).then(e=>{f(e)}).catch(t=>{if(tf(t))return nW=!0,void f(y({},o,{compression:void 0,url:n3(e.url,e.method,void 0,e.timestampMode)}));(e=>{if(!e||"object"!=typeof e)return!1;var t="name"in e?String(e.name):"";return tf(e)||t===tv})(t)&&(nW=!0),f(o)}):g(o)})(y({},e,{callback:t=>{var i,s;this.rateLimiter.checkForLimiting(t),400>t.statusCode||null==(i=(s=this.config).on_request_error)||i.call(s,t),null==e.callback||e.callback(t)}}))):e.fireCallbackOnDrop&&(null==e.callback||e.callback({statusCode:0}))}Sl(e){this.xl?this.xl.retriableRequest(e):this._send_request(e)}_execute_array(e){o$++;try{var t,i=[],s=[],r=[];sc(e,e=>{if(e){if(B(t=e[0]))r.push(e);else if(H(e))try{e.call(this)}catch(t){t4.error("Error executing queued PostHog call",e,t)}else B(e)&&"alias"===t?i.push(e):B(e)&&-1!==t.indexOf("capture")&&H(this[t])?r.push(e):s.push(e)}});var n=function(e,t){sc(e,function(e){try{if(B(e[0])){var i=t;sd(e,function(e){i=i[e[0]].apply(i,e.slice(1))})}else t[e[0]].apply(t,e.slice(1))}catch(t){t4.error("Error executing queued PostHog call",e,t)}})};n(i,this),n(s,this),n(r,this)}finally{o$--}}push(e){if(o$>0&&B(e)&&W(e[0])){var t=oz.prototype[e[0]];H(t)&&t.apply(this,e.slice(1))}else this._execute_array([e])}capture(e,t,i){var s,r,n,o,a;if(this.__loaded&&this.persistence&&this.sessionPersistence&&this.kl){if(this.is_capturing()){if(!V(e)&&W(e)){this.ll();var l=!this.config.opt_out_useragent_filter&&this._is_bot();if(!l||this.config.__preview_capture_bot_pageviews){var u=null!=i&&i.skip_client_rate_limiting?void 0:this.rateLimiter.clientRateLimitContext();if(null==u||!u.isRateLimited){null!=t&&t.$current_url&&!W(null==t?void 0:t.$current_url)&&(t4.error("Invalid `$current_url` property provided to `posthog.capture`. Input must be a string. Ignoring provided value."),null==t||delete t.$current_url),"$exception"!==e||null!=i&&i.jl||t4.warn("Using `posthog.capture('$exception')` is unreliable because it does not attach required metadata. Use `posthog.captureException(error)` instead, which attaches required metadata automatically."),this.sessionPersistence.update_search_keyword(),this.config.save_campaign_params&&this.sessionPersistence.update_campaign_params(),this.config.save_referrer&&this.sessionPersistence.update_referrer_info(),(this.config.save_campaign_params||this.config.save_referrer)&&this.persistence.set_initial_person_info();var h,c,d,v,p=new Date,g=(null==i?void 0:i.timestamp)||p,f=to(null==i?void 0:i.uuid,s$),_={uuid:f,event:e,properties:this.calculateEventProperties(e,t||{},g,f)};e===sa&&this.config.__preview_capture_bot_pageviews&&l&&(_.event="$bot_pageview",_.properties.$browser_type="bot"),u&&(_.properties.$lib_rate_limit_remaining_tokens=u.remainingTokens);var m="$feature_flag_called"===e&&!1===_.properties.$feature_flag_has_experiment&&!0===this.get_property(iM);(null==i?void 0:i.$set)&&!m&&(_.$set=null==i?void 0:i.$set);var b=null==i?void 0:i.$unset;b&&(_.$unset=b);var w,x,k,S=m?void 0:this.Bl(null==i?void 0:i.$set_once,e!==sh,e===su);if(S&&(_.$set_once=S),null!=i&&i._noTruncate||(r=this.config.properties_string_max_length,n=_,o=e=>W(e)?e.slice(0,r):e,a=new Set,_=function e(t,i){if(t!==Object(t))return o?o(t):t;if(!a.has(t)){var s;if(a.add(t),B(t))s=[],sc(t,t=>{s.push(e(t))});else{var r={};sd(t,(t,i)=>{a.has(t)||(r[i]=e(t,i))}),s=r}return s}}(n)),_.timestamp=g,V(null==i?void 0:i.timestamp)||(_.properties.$event_time_override_provided=!0,_.properties.$event_time_override_system_time=p),m&&(_.properties=(h=_.properties,void 0===(c=oA)&&(c=[]),d={},v=e=>{void 0!==h[e]&&(d[e]=h[e])}
1,E.forEach(v),c.forEach(v),d)),e===nr.DISMISSED||e===nr.SENT){var P=null==t?void 0:t[nn.SURVEY_ID],I=null==t?void 0:t[nn.SURVEY_ITERATION];oy({id:P,current_iteration:I}),_.$set=y({},_.$set,{[(w={id:P,current_iteration:I},k="$survey_"+(x=e===nr.SENT?"responded":"dismissed")+"/"+w.id,w.current_iteration&&w.current_iteration>0&&(k="$survey_"+x+"/"+w.id+"/"+w.current_iteration),k)]:!0})}else e===nr.SHOWN&&(_.$set=y({},_.$set,{[nn.SURVEY_LAST_SEEN_DATE]:(new Date).toISOString()}));if(e===na.SHOWN){var F=null==t?void 0:t[nl.TOUR_TYPE];F&&(_.$set=y({},_.$set,{[nl.TOUR_LAST_SEEN_DATE+"/"+F]:(new Date).toISOString()}))}var C=y({},_.properties.$set,_.$set);if(z(C)||this.setPersonPropertiesForFlags(C),!J(this.config.before_send)){var $=this.Jn(_);if(!$)return;(_=$).uuid=to(_.uuid,s$)}this.il.emit("eventCaptured",_);var O=null!==(s=null==i?void 0:i._url)&&void 0!==s?s:this.requestRouter.endpointFor("api",this.analyticsDefaultEndpoint),T={method:"POST",url:O,data:_,compression:"best-available",timestampMode:"recordings"===(null==i?void 0:i._batchKey)||/\/s\/(?:\?|$)/.test(O)?"body":"capture-body",batchKey:null==i?void 0:i._batchKey,transport:null==i?void 0:i.transport};return!this.config.request_batching||i&&(null==i||!i._batchKey)||null!=i&&i.send_instantly?this.Sl(T):this.kl.enqueue(T),_}t4.critical("This capture call is ignored due to client rate limiting.")}}else t4.error("No event name provided to posthog.capture")}}else t4.uninitializedWarning("posthog.capture")}_addCaptureHook(e){return this.on("eventCaptured",t=>e(t.event,t))}getExtension(e){var t;return null==(t=this.Ll)?void 0:t.getExtension(e)}Pl(){var e;return null!==(e=this.Ll)&&void 0!==e?e:this.Ll=new oF(this)}nl(e){this.fl.push(e);var t=!0;return()=>{if(t){t=!1;var i=this.fl.indexOf(e);-1!==i&&this.fl.splice(i,1)}}}Hl(e){var t,i,s;return void 0===e&&(e=!0),!(null==(t=this.persistence)||!t.consumeCookieIdentityChange())&&(this.yl=null,this.persistence.get_property(iZ)===si&&(null==(s=this.sessionPersistence)||s.clear(),this.vl.clear(),this.zl()),null==(i=this.featureFlags)||i.reset(),e&&this.reloadFeatureFlags(),!0)}calculateEventProperties(e,t,i,r,n){if(i=i||new Date,!this.persistence||!this.sessionPersistence)return t;this.persistence.syncCookieProperties(),this.Hl();var l,u=n?void 0:this.persistence.remove_event_timer(e),h=y({},t);if(h.token=this.config.token,h.$config_defaults=this.config.defaults,this.ol()&&(h[i6]=!0),"$snapshot"===e){var c=y({},this.persistence.properties(),this.sessionPersistence.properties());return h.distinct_id=c.distinct_id,(!W(h.distinct_id)&&!K(h.distinct_id)||G(h.distinct_id))&&t4.error("Invalid distinct_id for replay event. This indicates a bug in your implementation"),h}var v,p=function(e,t,i,r){if(void 0===r&&(r=!1),!d)return{};var n,o,l,u,h,c=e?[...rV,...t||[]]:[],v=function(e){for(var t=0;ts.length>t;t++){var i=ts[t],s=i[1],r=i[0].exec(e),n=r&&(H(s)?s(r,e):s);if(n)return n}return["",""]}(d),p=v[0],g=v[1],_=null!=(h="undefined"!=typeof navigator?navigator:void 0)&&h.brave?{brave:!0}:{},m={};V(i)||(m.detectGoogleSearchApp=i);var y={},b=null==(n=navigator)||null==(n=n.userAgentData)?void 0:n.platform,w=null==(o=navigator)?void 0:o.maxTouchPoints,x=null==s||null==(l=s.screen)?void 0:l.width,k=null==s||null==(u=s.screen)?void 0:u.height,E=null==s?void 0:s.devicePixelRatio;V(b)||(y.userAgentDataPlatform=b),V(w)||(y.maxTouchPoints=w),V(x)||(y.screenWidth=x),V(k)||(y.screenHeight=k),V(E)||(y.devicePixelRatio=E);var S,P,I,F,C,$,O=sv(s_({$os:p,$os_version:g,$browser:te(d,navigator.vendor,_,m),$device:tr(d),$device_type:($=tr(d))===ef||$===eg||"Kobo"===$||"Kindle Fire"===$||$===eW?ep:$===eM||$===eD||$===eA||$===eU?"Console":$===em?"Wearable":$?ed:"Android"===(null==y?void 0:y.userAgentDataPlatform)&&(null!==(P=null==y?void 0:y.maxTouchPoints)&&void 0!==P?P:0)>0?600>Math.min(null!==(I=null==y?void 0:y.screenWidth)&&void 0!==I?I:0,null!==(F=null==y?void 0:y.screenHeight)&&void 0!==F?F:0)/(null!==(C=null==y?void 0:y.devicePixelRatio)&&void 0!==C?C:1)?ed:ep:"Desktop",$timezone:r3(),$timezone_offset:function(){try{return(new Date).getTimezoneOffset()}catch(e){return}}()}),{$current_url:rq(r?tl(null==a?void 0:a.href):null==a?void 0:a.href,c,rG),$host:null==a?void 0:a.host,$pathname:null==a?void 0:a.pathname,$raw_user_agent:d.length>1e3?d.substring(0,997)+"...":d,$browser_version:ti(d,navigator.vendor,_,m),$browser_language:rX(),$browser_language_prefix:"string"==typeof(S=rX())?S.split("-")[0]:void 0,$screen_height:null==s?void 0:s.screen.height,$screen_width:null==s?void 0:s.screen.width,$viewport_height:null==s?void 0:s.innerHeight,$viewport_width:null==s?void 0:s.innerWidth,$lib:f.LIB_NAME,$lib_version:f.LIB_VERSION,$insert_id:Math.random().toString(36).substring(2,10)+Math.random().toString(36).substring(2,10),$time:Date.now()/1e3});return f.SDK_DIST_CHANNEL&&(O.$sdk_dist_channel=f.SDK_DIST_CHANNEL),O}(this.config.mask_personal_data_properties,this.config.custom_personal_data_properties,this.config.detect_google_search_app,this.config.disable_capture_url_hashes
vendor: 5,370 bytes, line 1
1);if(this.sessionManager){var g=this.sessionManager.checkAndGetSessionAndWindowId(n,i.getTime(),!0),_=g.windowId;h.$session_id=g.sessionId,h.$window_id=_}this.sessionPropsManager&&sv(h,this.sessionPropsManager.getSessionProps());try{this.sessionRecording&&sv(h,this.sessionRecording.sdkDebugProperties),h.$sdk_debug_retry_queue_size=null==(l=this.xl)?void 0:l.length}catch(e){h.$sdk_debug_error_capturing_properties=String(e)}if(this.requestRouter.region===od&&(h.$lib_custom_api_host=this.config.api_host),v=e!==sa||n?e!==sl||n?this.pageViewManager.doEvent():this.pageViewManager.doPageLeave(i):this.pageViewManager.doPageView(i,r),h=sv(h,v),e===sa&&o&&(h.title=o.title),!V(u)){var m=i.getTime()-u;h.$duration=parseFloat((m/1e3).toFixed(3))}d&&this.config.opt_out_useragent_filter&&(h.$browser_type=this._is_bot()?"bot":"browser");var b=this.persistence.properties(),w=this.sessionPersistence.properties();sd(["$referrer","$referring_domain"],e=>{e in b&&delete w[e]});var x={};if(this.fl.length>0)for(var k of this.fl.slice())try{sv(x,k())}catch(e){t4.error("Failed to produce browser extension event properties",e)}(h=sv({},p,b,w,y({},x,h))).$is_identified=this._isIdentified(),B(this.config.property_denylist)?sd(this.config.property_denylist,function(e){delete h[e]}):t4.error(oM+this.config.property_denylist+" or property_blacklist config: "+this.config.property_blacklist);var E=this.config.sanitize_properties;E&&(t4.error(oL),h=E(h,e));var S=this.Ul();return h.$process_person_profile=S,S&&!n&&this.Wl("_calculate_event_properties"),h}Bl(e,t,i){if(void 0===t&&(t=!0),void 0===i&&(i=!1),!this.persistence||!this.Ul()||this.dl&&!i)return e;var s,r=sv({},this.persistence.get_initial_props(),(null==(s=this.sessionPropsManager)?void 0:s.getSetOnceProps())||{},e||{}),n=this.config.sanitize_properties;return n&&(t4.error(oL),r=n(r,"$set_once")),t&&(this.dl=!0),z(r)?void 0:r}register(e,t){var i;null==(i=this.persistence)||i.register(e,t)}register_once(e,t,i){var s;null==(s=this.persistence)||s.register_once(e,t,i)}register_for_session(e){var t,i;null==(t=this.persistence)||t.syncCookieProperties(),this.Hl(),null==(i=this.sessionPersistence)||i.register(e),Object.keys(e).forEach(e=>this.vl.add(e)),this.zl()}unregister(e){var t;null==(t=this.persistence)||t.unregister(e)}unregister_for_session(e){var t;null==(t=this.sessionPersistence)||t.unregister(e),this.vl.delete(e),this.zl()}Vl(e,t){this.register({[e]:t})}Cl(){this.vl.forEach(e=>{var t;null==(t=this.sessionPersistence)||t.unregister(e)}),this.vl.clear(),this.zl()}zl(){var e;if(this.cl){if("memory"===this.config.persistence||null!=(e=this.sessionPersistence)&&e.ga||!sK.Xr())sK.ri(this.cl);else{var t=[];this.vl.forEach(e=>t.push(e)),t.length>0?sK.ei(this.cl,t):sK.ri(this.cl)}}}getFeatureFlag(e,t){var i;return null==(i=this.featureFlags)?void 0:i.getFeatureFlag(e,t)}getFeatureFlagPayload(e){var t;return null==(t=this.featureFlags)?void 0:t.getFeatureFlagPayload(e)}getFeatureFlagResult(e,t){var i;return null==(i=this.featureFlags)?void 0:i.getFeatureFlagResult(e,t)}getAllFeatureFlags(){var e,t;return null!==(e=null==(t=this.featureFlags)?void 0:t.getAllFeatureFlags())&&void 0!==e?e:[]}isFeatureEnabled(e,t){var i,s;return null!==(i=null==(s=this.featureFlags)?void 0:s.isFeatureEnabled(e,t))&&void 0!==i?i:null==t?void 0:t.defaultValue}reloadFeatureFlags(){var e;null==(e=this.featureFlags)||e.reloadFeatureFlags()}updateFlags(e,t,i){var s;null==(s=this.featureFlags)||s.updateFlags(e,t,i)}updateEarlyAccessFeatureEnrollment(e,t,i){var s;null==(s=this.featureFlags)||s.updateEarlyAccessFeatureEnrollment(e,t,i)}getEarlyAccessFeatures(e,t,i){var s;return void 0===t&&(t=!1),null==(s=this.featureFlags)?void 0:s.getEarlyAccessFeatures(e,t,i)}on(e,t){return this.il.on(e,t)}onFeatureFlags(e){return this.featureFlags?this.featureFlags.onFeatureFlags(e):(e([],{},{errorsLoading:!0}),()=>{})}onSurveysLoaded(e){return this.surveys?this.surveys.onSurveysLoaded(e):(e([],{isLoaded:!1,error:oR}),()=>{})}onSessionId(e){var t,i;return null!==(t=null==(i=this.sessionManager)?void 0:i.onSessionId(e))&&void 0!==t?t:()=>{}}getSurveys(e,t){void 0===t&&(t=!1),this.surveys?this.surveys.getSurveys(e,t):e([],{isLoaded:!1,error:oR})}getActiveMatchingSurveys(e,t){void 0===t&&(t=!1),this.surveys?this.surveys.getActiveMatchingSurveys(e,t):e([],{isLoaded:!1,error:oR})}renderSurvey(e,t){var i;null==(i=this.surveys)||i.renderSurvey(e,t)}displaySurvey(e,t){var i;void 0===t&&(t=ow),null==(i=this.surveys)||i.displaySurvey(e,t)}cancelPendingSurvey(e){var t;null==(t=this.surveys)||t.cancelPendingSurvey(e)}canRenderSurvey(e){var t,i;return null!==(t=null==(i=this.surveys)?void 0:i.canRenderSurvey(e))&&void 0!==t?t:{visible:!1,disabledReason:oR}}canRenderSurveyAsync(e,t){var i,s;return void 0===t&&(t=!1),null!==(i=null==(s=this.surveys)?void 0:s.canRenderSurveyAsync(e,t))&&void 0!==i?i:Promise.resolve({visible:!1,disabledReason:oR})}Gl(e){return!e||G(e)?(t4.critical("Unique user id has not been set in posthog.identify"),!1):e===i5?(t4.critical('The string "'+e+'" was set in posthog.identify which indicates an error. This ID is only used as a sentinel value.'),!1):!["distinct_id","distinctid"].includes(e.toLowerCase())&&!["undefined","null"].includes(e.toLowerCase())||(t4.critical('The string "'+e+'" was set in posthog.identify which indicates an error. This ID should be unique to the user and n
1ot a hardcoded string.'),!1)}identify(e,t,i){if(!this.__loaded||!this.persistence)return t4.uninitializedWarning("posthog.identify");if(K(e)&&(e=e.toString(),t4.warn("The first argument to posthog.identify was a number, but it should be a string. It has been converted to a string.")),this.Gl(e)&&this.Wl("posthog.identify")){this.ll();var s=this.get_distinct_id(),r=this.persistence.syncCookieProperties()&&this.get_distinct_id()!==s,n=this.Hl(!1),o=this.persistence.ba(),a=!1;try{var l=this.get_distinct_id();this.register({$user_id:e}),this.get_property(io)||this.register_once({$had_persisted_distinct_id:!0,$device_id:l},""),e!==l&&e!==this.get_property(il)&&(this.unregister(il),this.register({distinct_id:e}));var u,h=(this.persistence.get_property(iZ)||si)===si,c=e!==l,d=!c&&h;if(c&&h)this.persistence.set_property(iZ,ss),this.setPersonPropertiesForFlags({$set:t||{},$set_once:i||{}},!1),this.config.cookieWinsOnConflict&&this.persistence._a(),this.capture(su,{distinct_id:e,$anon_distinct_id:l},{$set:t||{},$set_once:i||{}}),this.yl=oc(e,t,i),null==(u=this.featureFlags)||u.setAnonymousDistinctId(l);else if(d){this.persistence.set_property(iZ,ss);var v=t||{},p=i||{};this.setPersonPropertiesForFlags({$set:v,$set_once:p},!1),this.config.cookieWinsOnConflict&&this.persistence._a(),this.capture("$set",{$set:v,$set_once:p}),this.yl=oc(e,t,i)}else(t||i)&&this.setPersonProperties(t,i);c||r||n?(this.reloadFeatureFlags(),this.featureFlags?this.featureFlags.resetFlagCallReported():this.unregister(iG)):d&&(t||i)&&this.reloadFeatureFlags(),a=!0}finally{o&&this.persistence.Sa(a)}}}setPersonProperties(e,t){if((e||t)&&this.Wl("posthog.setPersonProperties")){var i=oc(this.get_distinct_id(),e,t);this.yl!==i?(this.setPersonPropertiesForFlags({$set:e||{},$set_once:t||{}},!0),this.capture("$set",{$set:e||{},$set_once:t||{}}),this.yl=i):t4.info("A duplicate setPersonProperties call was made with the same properties. It has been ignored.")}}unsetPersonProperties(e){var t,i=(B(e)?e:[e]).filter(e=>W(e)&&e.length>0);0!==i.length&&this.Wl("posthog.unsetPersonProperties")&&(null==(t=this.featureFlags)||t.unsetPersonPropertiesForFlags(i,!0),this.capture("$set",{$unset:i}),this.yl=null)}group(e,t,i){var s;if(e&&t){null==(s=this.persistence)||s.syncCookieProperties(),this.Hl();var r=this.getGroups(),n=r[e]!==t;if(n&&this.resetGroupPropertiesForFlags(e),this.register({$groups:y({},r,{[e]:t})}),n||i){var o={$group_type:e,$group_key:t};i&&(o.$group_set=i),this.capture(sh,o)}i&&this.setGroupPropertiesForFlags({[e]:i}),n&&!i&&this.reloadFeatureFlags()}else t4.error("posthog.group requires a group type and group key")}resetGroups(){this.register({$groups:{}}),this.resetGroupPropertiesForFlags(),this.reloadFeatureFlags()}setPersonPropertiesForFlags(e,t){var i;void 0===t&&(t=!0),null==(i=this.featureFlags)||i.setPersonPropertiesForFlags(e,t)}resetPersonPropertiesForFlags(e){var t;void 0===e&&(e=!0),null==(t=this.featureFlags)||t.resetPersonPropertiesForFlags(e)}setGroupPropertiesForFlags(e,t){var i;void 0===t&&(t=!0),this.Wl("posthog.setGroupPropertiesForFlags")&&(null==(i=this.featureFlags)||i.setGroupPropertiesForFlags(e,t))}resetGroupPropertiesForFlags(e){var t;null==(t=this.featureFlags)||t.resetGroupPropertiesForFlags(e)}reset(e){var t=X(e)?e:null==e?void 0:e.resetDeviceID,i=X(e)||null==e?void 0:e.bootstrap;this.Zl(t,!1,i)}Zl(e,t,i){if(void 0===t&&(t=!1),t4.info("reset"),!this.__loaded)return t4.uninitializedWarning("posthog.reset");var s,r,n,o,a,l,u,h,c,d,v,p,g,f,_,m,b,w=null==i?void 0:i.sessionID;this.config.bootstrap=i||(null==(s=this._l)?void 0:s.bootstrap)||{},null==(r=this.featureFlags)||null==r.updateConfig||r.updateConfig(this.config,this.Ua());var x=this.get_property(io),k=this.get_property(ia),E=this.get_property(iw),S=this.is_capturing();this.consent.reset(),t||!S||this.is_capturing()||console.warn("[PostHog.js]","reset() cleared the stored consent, and capturing is now off because of `opt_out_capturing_by_default`. Call opt_in_capturing() again, and prefer calling reset() before opting in rather than after.");var P=null==(n=this.persistence)||null==n.ba?void 0:n.ba(),I=!1;try{if(null==(o=this.persistence)||o.clear(),null==(a=this.sessionPersistence)||a.clear(),this.vl.clear(),this.zl(),V(E)||null==(g=this.persistence)||g.register({[iw]:E}),null==(l=this.surveys)||l.reset(),null==(u=this.featureFlags)||u.reset(),null==(h=this.conversations)||h.reset(),null==(c=this.logs)||c.reset(),null==(d=this.metrics)||d.reset(),null==(v=this.persistence)||v.set_property(iZ,si),null==(p=this.sessionManager)||p.resetSessionId(),this.yl=null,this.config.cookieless_mode===st)this.register_once({distinct_id:i5,$device_id:null},"");else{var F=this.config.get_device_id(s$());this.register_once({distinct_id:F,$device_id:e?F:x},""),e||V(k)||this.register({[ia]:k})}if(this.register({$last_posthog_reset:(new Date).toISOString()},1),i&&(void 0===i.distinctID||this.ol()||(null==(m=this.persistence)||m.set_property(iZ,i.isIdentifiedID?ss:si),this.register({distinct_id:i.distinctID})),null==(f=this.featureFlags)||f.initialize(),!(V(w)||null!=(_=this.sessionManager)&&_.setBootstrapSessionId(w,!0)))){var C=y({},i);delete C.sessionID,this.config.bootstrap=C}delete this.config.identity_distinct_id,delete this.config.identity_hash,I=!0}
1finally{P&&(null==(b=this.persistence)||null==b.Sa||b.Sa(I))}this.reloadFeatureFlags()}shutdown(e){var t=this;return m(function*(){var e,i,s,r,n,o;if(t.__loaded){t.Pl().dispose(),null==(e=t.sessionRecording)||e.dispose(),null==(i=t.logs)||i.flushLogs("sendBeacon"),null==(s=t.metrics)||s.flush("sendBeacon"),null==(r=t.kl)||r.unload(),null==(n=t.xl)||n.unload();try{null==(o=t.featureFlags)||o.destroy()}catch(e){t4.error("Error while destroying feature flags",e)}}else t4.uninitializedWarning("posthog.shutdown")})()}setIdentity(e,t){var i;this.config.identity_distinct_id=e,this.config.identity_hash=t,this.alias(e),null==(i=this.conversations)||i.Ql()}clearIdentity(){var e;delete this.config.identity_distinct_id,delete this.config.identity_hash,null==(e=this.conversations)||e.Jl()}get_distinct_id(){return this.get_property("distinct_id")}getGroups(){return this.get_property("$groups")||{}}get_session_id(){var e,t;return null!==(e=null==(t=this.sessionManager)?void 0:t.checkAndGetSessionAndWindowId(!0).sessionId)&&void 0!==e?e:""}get_session_replay_url(e){if(!this.sessionManager)return"";var t=this.sessionManager.checkAndGetSessionAndWindowId(!0),i=t.sessionStartTimestamp,s=this.requestRouter.endpointFor("ui","/project/"+this.config.token+"/replay/"+t.sessionId);if(null!=e&&e.withTimestamp&&i){var r,n=null!==(r=e.timestampLookBack)&&void 0!==r?r:10;if(!i)return s;s+="?t="+Math.max(Math.floor(((new Date).getTime()-i)/1e3)-n,0)}return s}alias(e,t){return e===this.get_property(is)?(t4.critical("Attempting to create alias for existing People user - aborting."),-2):this.Wl("posthog.alias")?(V(t)&&(t=this.get_distinct_id()),e!==t?(this.Vl(il,e),this.capture("$create_alias",{alias:e,distinct_id:t})):(t4.warn("alias matches current distinct_id - skipping api call."),this.identify(e),-1)):void 0}set_config(e){var t=y({},this.config);if(U(e)){sv(this.config,oH(e));var i=this.ul();null==(s=this.persistence)||s.update_config(this.config,t,i),this.sessionPersistence="sessionStorage"===this.config.persistence||"memory"===this.config.persistence?this.persistence:new r7(y({},this.config,{persistence:"sessionStorage"}),i,!1);var s,r,n,o,a,l,u,h,c,d,v,p,g,_=this.bl(this.config.debug);X(_)&&(this.config.debug=_),X(this.config.debug)&&(this.config.debug?(f.DEBUG=!0,sA.Xr()&&sA.ei("ph_debug",!0),t4.info("set_config",{config:e,oldConfig:t,newConfig:y({},this.config)})):(f.DEBUG=!1,sA.Xr()&&sA.ri("ph_debug"))),null==(r=this.featureFlags)||null==r.updateConfig||r.updateConfig(this.config,this.Ua()),null==(n=this.exceptionObserver)||n.onConfigChange(),null==(o=this.exceptions)||o.onConfigChange(),null==(a=this.sessionRecording)||a.startIfEnabledOrStop(),null==(l=this.tracingHeaders)||l.startIfEnabledOrStop(),null==(u=this.autocapture)||u.startIfEnabled(),null==(h=this.heatmaps)||h.startIfEnabled(),("capture_pageview"in e||"disable_capture_url_hashes"in e)&&(null==(g=this.historyAutocapture)||g.startIfEnabledOrStop()),null==(c=this.exceptionObserver)||c.startIfEnabledOrStop(),null==(d=this.deadClicksAutocapture)||d.startIfEnabledOrStop(),null==(v=this.surveys)||v.loadIfEnabled(),this.hl(),null==(p=this.externalIntegrations)||p.startIfEnabledOrStop()}}_overrideSDKInfo(e,t){f.LIB_NAME=e,f.LIB_VERSION=t}startSessionRecording(e){var t,i,s,r,n,o=!0===e,a={sampling:o||!(null==e||!e.sampling),linked_flag:o||!(null==e||!e.linked_flag),url_trigger:o||!(null==e||!e.url_trigger),event_trigger:o||!(null==e||!e.event_trigger)};Object.values(a).some(Boolean)&&(null==(t=this.sessionManager)||t.checkAndGetSessionAndWindowId(),a.sampling&&(null==(i=this.sessionRecording)||i.overrideSampling()),a.linked_flag&&(null==(s=this.sessionRecording)||s.overrideLinkedFlag()),a.url_trigger&&(null==(r=this.sessionRecording)||r.overrideTrigger("url")),a.event_trigger&&(null==(n=this.sessionRecording)||n.overrideTrigger("event"))),this.set_config({disable_session_recording:!1})}stopSessionRecording(){this.set_config({disable_session_recording:!0})}sessionRecordingStarted(){var e;return!(null==(e=this.sessionRecording)||!e.started)}captureException(e,t){if(this.exceptions){var i=Error("PostHog syntheticException"),s=this.exceptions.buildProperties(e,{handled:!0,syntheticException:i});return this.exceptions.sendExceptionEvent(y({},s,t))}}addExceptionStep(e,t){var i;null==(i=this.exceptions)||i.addExceptionStep(e,t)}captureLog(e){var t;null==(t=this.logs)||t.captureLog(e)}get logger(){var e,t;return null!==(e=null==(t=this.logs)?void 0:t.logger)&&void 0!==e?e:oz.Kl}startExceptionAutocapture(e){this.set_config({capture_exceptions:null==e||e})}stopExceptionAutocapture(){this.set_config({capture_exceptions:!1})}loadToolbar(e){var t,i;return null!==(t=null==(i=this.toolbar)?void 0:i.loadToolbar(e))&&void 0!==t&&t}get_property(e){var t;return null==(t=this.persistence)?void 0:t.props[e]}getSessionProperty(e){var t;return null==(t=this.sessionPersistence)?void 0:t.props[e]}toString(){var e,t=null!==(e=this.config.name)&&void 0!==e?e:oD;return t!==oD&&(t=oD+"."+t),t}_isIdentified(){var e,t;return(null==(e=this.persistence)?void 0:e.get_property(iZ))===ss||(null==(t=this.sessionPersistence)?void 0:t.get_property(iZ))===ss}Ul(){var e,t;return!("never"===this.config.person_profiles||this.config.person_profiles===sr&&!this._isIdentified()&&z(this.getGroups())&&(null==(e=this.persistence)||null==(e=e.props)||!e[il])&&(null==(t=this.persistence)||null==(t=t.props)||!t[i3]))}ql(){return!0===this.config.capture_pageleave||"if_capture_pageview"===this.config.capture_pageleave&&!!this.config.capture_pageview}createPersonProfile(){this.Ul()||this.Wl("posthog.createPersonProfile")&&this.setPersonProperties({},{})}setInternalOrTestUser(){this.Wl("posthog.setInternalOrTestUser")&&this.setPersonProperties({$internal_or_test_user:!0})}Wl(e){return"never"===this.config.person_profiles?(t4.error(e+' was called, but process_person is set to "never". This call will be ignored.'),!1):(this.Vl(i3,!0),!0)}ul(){if("always"===this.config.cookieless_mode)return!0;var e=this.consent.isOptedOut();return this.config.disable_persistence||e&&!(!this.config.opt_out_persistence_by_default&&this.config.cookieless_mode!==se)}hl(){var e,t,i,s,r,n=this.ul();return this.is_capturing()||null==(i=this.logs)||i.Yl(),(null==(e=this.persistence)?void 0:e.ga)!==n&&(null==(s=this.persistence)||s.set_disabled(n)),(null==(t=this.sessionPersistence)?void 0:t.ga)!==n&&(null==(r=this.sessionPersistence)||r.set_disabled(n)),n&&(this.vl.clear(),this.zl()),n}opt_in_capturing(e){var t;if(this.config.cookieless_mode!==st){if(this.ol()){this.Zl(!0,!0),null==(r=this.sessionManager)||r.destroy(),null==(n=this.pageViewM
1anager)||n.destroy(),this.sessionManager=new os(this),this.pageViewManager=new rT(this),this.persistence&&(this.sessionPropsManager=new oe(this,this.sessionManager,this.persistence));var i,s,r,n,o,a,l,u,h=null!==(o=null==(a=this.config.__extensionClasses)?void 0:a.sessionRecording)&&void 0!==o?o:null==(l=oz.__defaultExtensionClasses)?void 0:l.sessionRecording;h&&(this.sessionRecording=this.al(this.sessionRecording,new h(this)),this.el&&(null==(u=this.sessionRecording)||null==u.onRemoteConfig||u.onRemoteConfig(this.el)))}this.consent.optInOut(!0),this.hl(),this.Dl(),null==(t=this.sessionRecording)||t.startIfEnabledOrStop(),this.config.cookieless_mode==se&&(null==(i=this.surveys)||i.loadIfEnabled()),(V(null==e?void 0:e.captureEventName)||null!=e&&e.captureEventName)&&this.capture(null!==(s=null==e?void 0:e.captureEventName)&&void 0!==s?s:"$opt_in",null==e?void 0:e.captureProperties,{send_instantly:!0}),this.config.capture_pageview&&this.$l()}else t4.warn(oT)}opt_out_capturing(){var e,t,i;this.config.cookieless_mode!==st?(this.config.cookieless_mode===se&&this.consent.isOptedIn()&&this.Zl(!0,!0),this.consent.optInOut(!1),this.hl(),this.config.cookieless_mode===se&&(this.register({distinct_id:i5,$device_id:null}),null==(e=this.sessionRecording)||e.stopRecording(),this.sessionRecording=void 0,null==(t=this.sessionManager)||t.destroy(),null==(i=this.pageViewManager)||i.destroy(),this.sessionManager=void 0,this.sessionPropsManager=void 0,this.config.capture_pageview&&this.$l(),this.Dl())):t4.warn(oT)}has_opted_in_capturing(){return this.consent.isOptedIn()}has_opted_out_capturing(){return this.consent.isOptedOut()}get_explicit_consent_status(){var e=this.consent.consent;return 1===e?"granted":0===e?"denied":"pending"}is_capturing(){return this.config.cookieless_mode===st||(this.config.cookieless_mode===se?this.consent.isRejected()||this.consent.isOptedIn():!this.has_opted_out_capturing())}clear_opt_in_out_capturing(){this.consent.reset(),this.hl()}_is_bot(){return n?or(n,this.config.custom_blocked_useragents):void 0}$l(){o&&("visible"===o.visibilityState?this.pl||(this.pl=!0,this.capture(sa,{title:o.title},{send_instantly:!0}),this.gl&&(o.removeEventListener(sn,this.gl),this.gl=null)):this.gl||(this.gl=this.$l.bind(this),sy(o,sn,this.gl)))}debug(e){!1===e?(null==s||s.console.log("You've disabled debug mode."),this.set_config({debug:!1})):(null==s||s.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}))}Ua(){var e,t,i,s,r=this._l||{};return"advanced_disable_flags"in r?!!r.advanced_disable_flags:!1!==this.config.advanced_disable_flags?!!this.config.advanced_disable_flags:!0===this.config.advanced_disable_decide?(t4.warn("Config field 'advanced_disable_decide' is deprecated. Please use 'advanced_disable_flags' instead. The old field will be removed in a future major version."),!0):(t="advanced_disable_decide",i=(e="advanced_disable_flags")in r&&!J(r[e]),s=t in r&&!J(r[t]),i?r[e]:!!s&&(t4&&t4.warn("Config field '"+t+"' is deprecated. Please use '"+e+"' instead. The old field will be removed in a future major version."),r[t]))}Jn(e){if(J(this.config.before_send))return e;var t,i=Object.keys(null!==(t=e.properties)&&void 0!==t?t:{}).filter(et),s=B(this.config.before_send)?this.config.before_send:[this.config.before_send],r=e;for(var n of s)try{if(r=n(r),J(r)){var o="Event '"+e.event+"' was rejected in beforeSend function";return ee(e.event)?t4.warn(o+". This can cause unexpected behavior."):t4.info(o),null}r.properties&&!z(r.properties)||t4.warn("Event '"+e.event+"' has no properties after beforeSend function, this is likely an error.")}catch(t){return t4.error("Error in beforeSend function for event '"+e.event+"':",t),null}for(var a of i)if(r.properties&&J(r.properties[a]))return t4.warn("Event '"+e.event+"' had its '"+a+"' property removed in a beforeSend function. This property is required for ingestion, so the event will be dropped."),null;return r}getPageViewId(){var e;return null==(e=this.pageViewManager.Ks)?void 0:e.pageViewId}captureTraceFeedback(e,t){this.capture("$ai_feedback",{$ai_trace_id:String(e),$ai_feedback_text:t})}captureTraceMetric(e,t,i){this.capture("$ai_metric",{$ai_trace_id:String(e),$ai_metric_name:t,$ai_metric_value:String(i)})}bl(e){var t=X(e)&&!e,i=sA.Xr()&&"true"===sA.ti("ph_debug");return!t&&(!!i||e)}}oz.__defaultExtensionClasses={},oz.Kl=(()=>{var e=()=>{};return{trace:e,debug:e,info:e,warn:e,error:e,fatal:e}})(),function(e,t){for(var i=0;t.length>i;i++)e.prototype[t[i]]=sf(e.prototype[t[i]])}(oz,["identify"]);class oV{constructor(e){this.disabled=!1===e;var t=U(e)?e:{};this.thresholdPx=t.threshold_px||30,this.timeoutMs=t.timeout_ms||1e3,this.clickCount=t.click_count||3,this.clicks=[]}isRageClick(e,t,i){if(this.disabled)return!1;var s=this.clicks[this.clicks.length-1];if(s&&Math.abs(e-s.x)+Math.abs(t-s.y)<this.thresholdPx&&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}}var oW="$copy_autocapture",oG=t8("[AutoCapture]");function oY(e,t){return t.length>e?t.slice(0,e)+"...":t}class oJ{constructor(e){this.name="autocapture",this.Ts=!1,this.Ms=null,this.Es=!1,this.Is=!1,this.vn={enabled:!1,rageclick:!1,maskAllElementAttributes:!1,maskAllText:!1,disableCaptureUrlHashes:!1,remoteRequestsDisabled:!1},this.Rs=!1,this.Ps=e,this.Ps.refresh(this.vn),this.rageclicks=new oV(this.vn.rageclick),this.As=null}setup(e){this.Fs(),this.Os=e;var t=e.onRemoteConfig(this.onRemoteConfig.bind(this));this.Rs?t.dispose():(this.Ls=t,this.startIfEnabled())}dispose(){var e;this.Rs||(this.Rs=!0,this.Os=void 0,null==(e=this.Ls)||e.dispose(),this.Ls=void 0,this.Ds())}$s(){return this.Ps.refresh(this.vn),this.vn}Fs(){var e,t;return this.$s(),this.vn.url_allowlist=null==(e=this.vn.url_allowlist)?void 0:e.map(e=>new RegExp(e)),this.vn.url_ignorelist=null==(t=this.vn.url_ignorelist)?void 0:t.map(e=>new RegExp(e)),this.vn}
1Ns(){if(this.isBrowserSupported()){if(s&&o){var e=this.qs=e=>{e=e||(null==s?void 0:s.event);try{this.js(e)}catch(e){oG.error("Failed to capture event",e)}};if(sy(o,"submit",e,{capture:!0}),sy(o,"change",e,{capture:!0}),sy(o,"click",e,{capture:!0}),this.$s().capture_copied_text){var t=this.Bs=e=>{e=e||(null==s?void 0:s.event);try{this.js(e,oW)}catch(e){oG.error("Failed to capture clipboard event",e)}};sy(o,"copy",t,{capture:!0}),sy(o,"cut",t,{capture:!0}),sy(o,"paste",t,{capture:!0})}}}else oG.info("Disabling Automatic Event Collection because this browser is not supported")}Ds(){this.qs&&(null==o||o.removeEventListener("submit",this.qs,!0),null==o||o.removeEventListener("change",this.qs,!0),null==o||o.removeEventListener("click",this.qs,!0),this.qs=void 0),this.Bs&&(null==o||o.removeEventListener("copy",this.Bs,!0),null==o||o.removeEventListener("cut",this.Bs,!0),null==o||o.removeEventListener("paste",this.Bs,!0),this.Bs=void 0),this.Ts=!1}startIfEnabled(){!this.Rs&&this.Os&&this.isEnabled&&!this.Ts&&(this.Ns(),this.Ts=!0)}onRemoteConfig(e){if(!this.Rs){if(this.Es=!0,e.ok){var t=e.config;t.elementsChainAsString&&(this.Is=t.elementsChainAsString);var i,s=t.autocapture_opt_out;X(s)&&(null==(i=this.Os)||i.kv.set(ih,s),this.Ms=s),this.startIfEnabled()}else this.startIfEnabled()}}setElementSelectors(e){this.As=e}getElementSelectors(e){var t,i=[];return null==(t=this.As)||t.forEach(t=>{var s=null==o?void 0:o.querySelectorAll(t);null==s||s.forEach(s=>{e===s&&i.push(t)})}),i}get isEnabled(){if(this.Rs)return!1;var e,t,i=null==(e=this.Os)?void 0:e.kv.get(ih),s=this.Ms,r=this.$s(),n=r.remoteRequestsDisabled&&!this.Es;if(Y(s)&&!X(i)&&!n)return!1;var o=null!==(t=this.Ms)&&void 0!==t?t:!!i;return!!r.enabled&&!o}js(e,t){if(void 0===t&&(t="$autocapture"),this.isEnabled){var i=re(e);s3(i)&&(i=i.parentNode||null);var r,n=this.Fs();"$autocapture"===t&&"click"===e.type&&e instanceof MouseEvent&&n.rageclick&&null!=(r=this.rageclicks)&&r.isRageClick(e.clientX,e.clientY,e.timeStamp||(new Date).getTime())&&rh(i,n.rageclick)&&this.js(e,"$rageclick");var o=t===oW,a=o?y({},n,{dom_event_allowlist:void 0}):n;if(i&&function(e,t,i,r,n,o){if(!s||rc(e)||null!=i&&i.url_allowlist&&!s4(i.url_allowlist,o)||null!=i&&i.url_ignorelist&&s4(i.url_ignorelist,o))return!1;if(null!=i&&i.dom_event_allowlist){var a,l=i.dom_event_allowlist;if(l&&!l.some(e=>t.type===e))return!1}var u=rd(e,r),h=u.parentIsUsefulElement,c=u.targetElementList;if(!function(e,t){var i=null==t?void 0:t.element_allowlist;if(V(i))return!0;var s,r=function(e){if(i.some(t=>e.tagName.toLowerCase()===t))return{v:!0}};for(var n of e)if(s=r(n))return s.v;return!1}(c,i)||!ri(c,null==i?void 0:i.css_selector_allowlist)||ri(c,null!==(a=null==i?void 0:i.css_selector_ignorelist)&&void 0!==a?a:rr))return!1;try{var d=s.getComputedStyle(e);if(d&&"pointer"===d.getPropertyValue("cursor")&&"click"===t.type)return!0}catch(e){}var v=e.tagName.toLowerCase();switch(v){case"html":return!1;case"form":return(n||["submit"]).indexOf(t.type)>=0;case"input":case"select":case"textarea":return(n||["change","click"]).indexOf(t.type)>=0;default:return h?(n||["click"]).indexOf(t.type)>=0:(n||["click"]).indexOf(t.type)>=0&&(rt.indexOf(v)>-1||"true"===e.getAttribute("contenteditable"))}}(i,e,a,o,o?["copy","cut","paste"]:void 0,{config:{get_current_url:n.getCurrentUrl}})){var l,u=function(e,t){var i,r,n=t.e,o=t.maskAllElementAttributes,a=t.maskAllText,l=t.elementAttributeIgnoreList,u=t.elementsChainAsString,h=t.disableCaptureUrlHashes;if(!s1(e))return{props:{}};for(var c=[e],d=new Set([e]),v=e;v.parentNode&&!s2(v,"body")&&1e3>c.length;)if(s5(v.parentNode)){var p=v.parentNode.host;if(d.has(p))break;d.add(p),c.push(p),v=p}else{if(!s1(v.parentNode)||d.has(v.parentNode))break;d.add(v.parentNode),c.push(v.parentNode),v=v.parentNode}var g,f=[],_={},m=!1,b=!1;if(sd(c,e=>{var t=rv(e);if(s2(e,"a")){var i=e.getAttribute("href");m=!!(t&&i&&rw(i))&&(h?tl(i):i)}L(s8(e),"ph-no-capture")&&(b=!0),f.push(function(e,t,i,s,r){void 0===r&&(r=!1);var n=e.tagName.toLowerCase(),o={tag_name:n};rt.indexOf(n)>-1&&!i&&(o.$el_text="a"===n.toLowerCase()||"button"===n.toLowerCase()?oY(1024,rx(e)):oY(1024,s7(e)));var a=s8(e);a.length>0&&(o.classes=a.filter(function(e){return""!==e})),sd(e.attributes,function(i){var n;if((!rp(e)||-1!==["name","id","class","aria-label"].indexOf(i.name))&&(null==s||!s.includes(i.name))&&
1!t&&rw(i.value)&&(!W(n=i.name)||"_ngcontent"!==n.substring(0,10)&&"_nghost"!==n.substring(0,7))){var a=i.value;"class"===i.name&&(a=s6(a).join(" ")),o["attr__"+i.name]=oY(1024,"href"===i.name&&r?tl(a):a)}});for(var l=1,u=1,h=e;h=function(e){if(e.previousElementSibling)return e.previousElementSibling;var t=e;do t=t.previousSibling;while(t&&!s1(t));return t}(h);)l++,h.tagName===e.tagName&&u++;return o.nth_child=l,o.nth_of_type=u,o}(e,o,a,l,h)),sv(_,function(e){if(!rv(e))return{};var t={};return sd(e.attributes,function(e){if(e.name&&0===e.name.indexOf("data-ph-capture-attribute")){var i=e.name.replace("data-ph-capture-attribute-",""),s=e.value;i&&s&&rw(s)&&(t[i]=s)}}),t}(e))}),b)return{props:{},explicitNoCapture:b};if(a||(f[0].$el_text=s2(e,"a")||s2(e,"button")?rx(e):s7(e)),m){f[0].attr__href=m;var w,x,k=null==(w=rN(m))?void 0:w.host,E=null==s||null==(x=s.location)?void 0:x.host;k&&E&&k!==E&&(g=m)}return{props:sv({$event_type:n.type,$ce_version:1},u?{}:{$elements:f},{$elements_chain:f.map(e=>{var t,i,s={text:null==(t=e.$el_text)?void 0:t.slice(0,400),tag_name:e.tag_name,href:null==(i=e.attr__href)?void 0:i.slice(0,2048),attr_class:function(e){var t=e.attr__class;if(t)return B(t)?t:s6(t)}(e),attr_id:e.attr__id,nth_child:e.nth_child,nth_of_type:e.nth_of_type,attributes:{}};return sp(e).filter(e=>0===e[0].indexOf("attr__")).forEach(e=>s.attributes[e[0]]=e[1]),s}).map(e=>{var t,i,s="";if(e.tag_name&&(s+=e.tag_name),e.attr_class)for(var r of(e.attr_class.sort(),e.attr_class))s+="."+r.replace(/"/g,"");var n=y({},e.text?{text:e.text}:{},{"nth-child":null!==(t=e.nth_child)&&void 0!==t?t:0,"nth-of-type":null!==(i=e.nth_of_type)&&void 0!==i?i:0},e.href?{href:e.href}:{},e.attr_id?{attr_id:e.attr_id}:{},e.attributes),o={};return sp(n).sort((e,t)=>{var i,s;return(s=t[0])>(i=e[0])?-1:i>s?1:0}).forEach(e=>{var t=e[1];return o[rk(e[0].toString())]=rk(t.toString())}),(s+=":")+sp(o).map(e=>e[0]+'="'+e[1]+'"').join("")}).join(";")},null!=(i=f[0])&&i.$el_text?{$el_text:null==(r=f[0])?void 0:r.$el_text}:{},g&&"click"===n.type?{$external_click_url:g}:{},_)}}(i,{e:e,maskAllElementAttributes:n.maskAllElementAttributes,maskAllText:n.maskAllText,elementAttributeIgnoreList:n.element_attribute_ignorelist,elementsChainAsString:this.Is,disableCaptureUrlHashes:n.disableCaptureUrlHashes}),h=u.props;if(u.explicitNoCapture)return!1;var c=this.getElementSelectors(i);if(c&&c.length>0&&(h.$element_selectors=c),t===oW){var d=e.type||"clipboard";if("paste"!==d){var v,p,g=null==s||null==(v=s.getSelection())?void 0:v.toString(),f=s9(g);if(!f)return!1;h.$selected_content=f,h.$clipboard_text_length=null!==(p=null==g?void 0:g.length)&&void 0!==p?p:0}h.$copy_type=d}return null==(l=this.Os)||l.capture(t,h).catch(e=>oG.error("Failed to capture event",e)),!0}}}isBrowserSupported(){return H(null==o?void 0:o.querySelectorAll)}}class oK{constructor(e){this._instance=e}refresh(e){var t=this._instance.config,i=U(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.Ua(),e.url_allowlist=null==i?void 0:i.url_allowlist,e.url_ignorelist=null==i?void 0:i.url_ignorelist,e.dom_event_allowlist=null==i?void 0:i.dom_event_allowlist,e.element_allowlist=null==i?void 0:i.element_allowlist,e.css_selector_allowlist=null==i?void 0:i.css_selector_allowlist,e.css_selector_ignorelist=null==i?void 0:i.css_selector_ignorelist,e.element_attribute_ignorelist=null==i?void 0:i.element_attribute_ignorelist,e.capture_copied_text=null==i?void 0:i.capture_copied_text}}var oZ=t8("[ExceptionAutocapture]"),oX=()=>{},oQ=e=>{var t;if(H(e))return null!==(t=e.__posthog_layer__)&&void 0!==t?t:e.__rrweb_layer__};function o0(e,t,i){try{if(!(t in e))return oX;var s={next:e[t]},r=i(function(){for(var e=arguments.length,t=Array(e),i=0;e>i;i++)t[i]=arguments[i];return s.next.apply(this,t)});return H(r)&&(r.prototype=r.prototype||{},Object.defineProperties(r,{__posthog_wrapped__:{enumerable:!1,value:!0},__posthog_layer__:{enumerable:!1,value:s}})),e[t]=r,()=>{if(e[t]!==r)for(var i=e[t],n=oQ(i);n;){if(n.next===r)return void(n.next=s.next);n=oQ(i=n.next)}else e[t]=s.next}}catch(e){return oX}}var o1=t8("[TracingHeaders]"),o2=t8("[Web Vitals]"),o3=["CLS","FCP","INP","LCP"],o5=["INP","LCP"],o6=["interactionTarget","interactionType","inputDelay","processingDuration","presentationDelay","loadState","target","url","timeToFirstByte","resourceLoadDelay","resourceLoadDuration","elementRenderDelay","largestShiftTarget","largestShiftTime","largestShiftValue","firstByteToFCP"],o4="disabled",o8="lazy_loading",o9="awaiting_config",o7="missing_config";t8("[SessionRecording]"),t8("[SessionRecording]");var ae="[SessionRecording]",at=t8(ae),ai=t8("[Heatmaps]");function as(e){return U(e)&&"clientX"in e&&"clientY"in e&&K(e.clientX)&&K(e.clientY)}var ar=t8("[Product Tours]"),an=e=>{var t;return!e.config.disable_product_tours&&!(null==(t=e.persistence)||!t.get_property(im))},ao=["$set_once","$set"],aa=t8("[SiteApps]"),al="Error while initializing PostHog app with config id ",au=(e,t)=>null!=e&&e.then?e.then(t):t(e),ah="SDK is not enabled or survey functionality is not yet loaded",ac="Disabled. Not loading surveys.";class ad{constructor(e,t){this.name="surveys",this._surveyEventReceiver=null,this._surveyManager=null,this.Xl=!1,this.tu=[],this.eu=null,this.iu=null,this.Rs=!1,this.ru=new Set,this.onRemoteConfig=e=>{if(!this.Rs&&!this.vn.disableSurveys){if(!e.ok)return o_.warn("Remote config unavailable. Not loading surveys.");var t=e.config.surveys;if(J(t))return o_.warn("Flags not loaded yet. Not loading surveys.");this.nu=X(t)?t:t.length>0,o_.info("flags response received, isSurveysEnabled: "+this.nu),this.loadIfEnabled()}},this.Ps=e,this.su=t}setup(e){if(!this.Rs)return this.au=e,au(e.kv.initialize(),()=>{if(this.au===e&&!this.Rs){this.au=void 0,this.Os=e;var t=e.onRemoteConfig(this.onRemoteConfig);this.Rs?t.dispose():(this.Ls=t,this.loadIfEnabled())}})}dispose(){var e,t,i;this.Rs||(this.Rs=!0,this.au=void 0,this.Os=void 0,null==(e=this.Ls)||e.dispose(),this.Ls=void 0,null==(t=this._surveyEventReceiver)||t.dispose(),this._surveyEventReceiver=null,null==(i=this._surveyManager)||null==i.dispose||i.dispose(),this._surveyManager=null,this.tu=[],this.eu=null,this.ru.forEach(e
vendor: 4,663 bytes, line 1
1=>clearTimeout(e)),this.ru.clear())}get vn(){return this.Ps.get()}initialize(){this.loadIfEnabled()}reset(){try{var e;null==(e=this._surveyEventReceiver)||e.reset(),localStorage.removeItem("lastSeenSurveyDate");for(var t=[],i=0;i<localStorage.length;i++){var s=localStorage.key(i);(null!=s&&s.startsWith(om)||null!=s&&s.startsWith("inProgressSurvey_"))&&t.push(s)}t.forEach(e=>localStorage.removeItem(e))}catch(e){}}loadIfEnabled(){if(!this.Rs&&this.Os){var e=this.vn;if(!this._surveyManager){if(this.Xl)o_.info("Already initializing surveys, skipping...");else if(e.disableSurveys)o_.info(ac);else if(e.cookielessMode&&this.Ps.isOptedOut())o_.info("Not loading surveys in cookieless mode without consent.");else{var t=this.Ps.getExtensions();if(t){if(!V(this.nu)||e.advancedEnableSurveys){var i=this.nu||e.advancedEnableSurveys;this.Xl=!0;try{var s=t.generateSurveys;if(s)return this.ou(s,i),void(this.Xl=!1);var r=t.loadExternalDependency;if(!r)return this.lu(i7),void(this.Xl=!1);r(e=>{try{if(this.Rs)return;var t=this.Ps.getExtensions();e||null==t||!t.generateSurveys?this.lu("Could not load surveys script",e):this.ou(t.generateSurveys,i)}finally{this.Xl=!1}})}catch(e){throw this.Xl=!1,this.lu("Error initializing surveys",e),e}}}else o_.error("PostHog Extensions not found.")}}}}ou(e,t){this.Rs||(this._surveyManager=e(t),this._surveyEventReceiver=this.Ps.createEventReceiver(),o_.info("Surveys loaded successfully"),this.uu({isLoaded:!0}))}lu(e,t){o_.error(e,t),this.uu({isLoaded:!1,error:e})}onSurveysLoaded(e){return this.tu.push(e),this._surveyManager&&this.uu({isLoaded:!0}),()=>{this.tu=this.tu.filter(t=>t!==e)}}getSurveys(e,t){void 0===t&&(t=!1);var i,s=null!==(i=this.Os)&&void 0!==i?i:this.su;if(s&&!this.Rs){if(this.vn.disableSurveys)return o_.info(ac),e([]);var r=s.kv.get(iB);if(r&&!t)return e(r,{isLoaded:!0}),void(this.hu()&&this.getSurveys(()=>{},!0));if(this.eu)this.eu.then(t=>{this.Rs||e(t.surveys,t.context)}).catch(e=>o_.error("Error in survey callback",e));else{var n=this.du("/api/surveys/",{method:"GET",query:{token:s.projectToken},sentAt:"query",timeoutMs:this.vn.requestTimeoutMs}).then(e=>{try{return this.vu(s,e)}catch(e){return o_.error("Error processing surveys response",e),this.vu(s,{statusCode:0,error:e})}},e=>this.vu(s,{statusCode:0,error:e}));this.eu=n;var o=()=>{this.eu===n&&(this.eu=null)};n.then(t=>{o(),this.Rs||e(t.surveys,t.context)},o).catch(e=>o_.error("Error in survey callback",e))}}}du(e,t){var i=this.Os;return i?i.sendRequest(e,t):new Promise(e=>e({statusCode:0,error:Error(ah)}))}vu(e,t){if(this.Rs)return{surveys:[],context:{isLoaded:!1,error:ah}};var i=t.statusCode;if(200!==i||!t.json){var s="Surveys API could not be loaded, status: "+i;return 0!==i?o_.error(s):t.error||o_.warn(s),this.iu=Date.now(),{surveys:[],context:{isLoaded:!1,error:s}}}this.iu=null;var r,n=t.json.surveys||[],o=n.filter(e=>{var t;return!(!e.start_date||e.end_date)&&(oo(e)||!(null==(t=e.conditions)||null==(t=t.actions)||null==(t=t.values)||!t.length))});return o.length>0&&(null==(r=this._surveyEventReceiver)||r.register(o)),e.kv.set({[iB]:n,[iH]:Date.now()}),{surveys:n,context:{isLoaded:!0}}}hu(){return this.cu()&&!this.eu&&!this.fu()}cu(){var e,t,i=null==(e=null!==(t=this.Os)&&void 0!==t?t:this.su)?void 0:e.kv.get(iH);return K(i)&&Date.now()-i>3e5}fu(){return K(this.iu)&&3e5>Date.now()-this.iu}markSurveyAsSeen(e,t){var i;oy({id:e,current_iteration:null!==(i=null==t?void 0:t.iteration)&&void 0!==i?i:null});try{localStorage.setItem("lastSeenSurveyDate",(new Date).toISOString())}catch(e){}}uu(e){for(var t of this.tu)try{if(!e.isLoaded)return t([],e);this.getSurveys(t)}catch(e){o_.error("Error in survey callback",e)}}getActiveMatchingSurveys(e,t){if(void 0===t&&(t=!1),!J(this._surveyManager))return this._surveyManager.getActiveMatchingSurveys(e,t);o_.warn("init was not called")}pu(e){var t=null;return this.getSurveys(i=>{var s;t=null!==(s=i.find(t=>t.id===e))&&void 0!==s?s:null}),t}gu(e){if(J(this._surveyManager))return{eligible:!1,reason:ah};var t="string"==typeof e?this.pu(e):e;return t?this._surveyManager.checkSurveyEligibility(t):{eligible:!1,reason:"Survey not found"}}mu(e){if(J(this._surveyManager))return{eligible:!1,reason:ah};var t="string"==typeof e?this.pu(e):e;return t?this._surveyManager.checkSurveyRenderability(t):{eligible:!1,reason:"Survey not found"}}canRenderSurvey(e){if(J(this._surveyManager))return o_.warn("init was not called"),{visible:!1,disabledReason:ah};var t=this.mu(e);return{visible:t.eligible,disabledReason:t.reason}}canRenderSurveyAsync(e,t){return J(this._surveyManager)?(o_.warn("init was not called"),Promise.resolve({visible:!1,disabledReason:ah})):new Promise(i=>
1{this.getSurveys(t=>{var s,r=null!==(s=t.find(t=>t.id===e))&&void 0!==s?s:null;if(r){var n=this.mu(r);i({visible:n.eligible,disabledReason:n.reason})}else i({visible:!1,disabledReason:"Survey not found"})},t)})}renderSurvey(e,t,i){var s;if(J(this._surveyManager))o_.warn("init was not called");else{var r="string"==typeof e?this.pu(e):e;if(null!=r&&r.id){if(ob.includes(r.type)){var n=null==o?void 0:o.querySelector(t);if(n){if(null!=(s=r.appearance)&&s.surveyPopupDelaySeconds){o_.info("Rendering survey "+r.id+" with delay of "+r.appearance.surveyPopupDelaySeconds+" seconds");var a=setTimeout(()=>{var e,t;this.ru.delete(a),this.Rs||(o_.info("Rendering survey "+r.id+" with delay of "+(null==(e=r.appearance)?void 0:e.surveyPopupDelaySeconds)+" seconds"),null==(t=this._surveyManager)||t.renderSurvey(r,n,i),o_.info("Survey "+r.id+" rendered"))},1e3*r.appearance.surveyPopupDelaySeconds);this.ru.add(a)}else this._surveyManager.renderSurvey(r,n,i)}else o_.warn("Survey element not found")}else o_.warn("Surveys of type "+r.type+" cannot be rendered in the app")}else o_.warn("Survey not found")}}displaySurvey(e,t){var i;if(J(this._surveyManager))o_.warn("init was not called");else{var s=this.pu(e);if(s){var r=s;if(null!=(i=s.appearance)&&i.surveyPopupDelaySeconds&&t.ignoreDelay&&(r=y({},s,{appearance:y({},s.appearance,{surveyPopupDelaySeconds:0})})),t.displayType!==no.Popover&&t.initialResponses&&o_.warn("initialResponses is only supported for popover surveys. prefill will not be applied."),!1===t.ignoreConditions){var n=this.gu(s);if(!n.eligible)return void o_.warn("Survey is not eligible to be displayed: ",n.reason)}t.displayType!==no.Inline?this._surveyManager.handlePopoverSurvey(r,t):this.renderSurvey(r,t.selector,t.properties)}else o_.warn("Survey not found")}}cancelPendingSurvey(e){J(this._surveyManager)?o_.warn("init was not called"):this._surveyManager.cancelSurvey(e)}handlePageUnload(){var e;null==(e=this._surveyManager)||null==e.handlePageUnload||e.handlePageUnload()}}function av(e,t,i){if(J(e))return!1;switch(i){case"exact":return e===t;case"contains":return RegExp(t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&").replace(/_/g,".").replace(/%/g,".*"),"i").test(e);case"regex":try{return new RegExp(t).test(e)}catch(e){return!1}default:return!1}}class ap{constructor(e){this.yu=new Set,this.bu=new Set,this._u=new ot,this.wu=(e,t)=>this.ku(e,t)&&this.Su(e,t)&&this.xu(e,t)&&this.Cu(e,t),this.ku=(e,t)=>null==t||!t.event||(null==e?void 0:e.event)===(null==t?void 0:t.event),this._instance=e}init(){var e,t;V(null==(e=this._instance)?void 0:e._addCaptureHook)||(this.Tu=null==(t=this._instance)?void 0:t._addCaptureHook((e,t)=>{this.on(e,t)}))}dispose(){var e;null==(e=this.Tu)||e.call(this),this.Tu=void 0,this._u=new ot}register(e){var t,i;if(!V(null==(t=this._instance)?void 0:t._addCaptureHook)&&(e.forEach(e=>{var t;this.yu.add(e),null==(t=e.steps)||t.forEach(e=>{this.bu.add((null==e?void 0:e.event)||"")})}),null!=(i=this._instance)&&i.autocapture)){var s=new Set;this.yu.forEach(e=>{var t;null==(t=e.steps)||t.forEach(e=>{null!=e&&e.selector&&s.add(e.selector)})}),this._instance.autocapture.setElementSelectors(s)}}replace(e){this.yu.clear(),this.bu.clear(),this.register(e)}on(e,t){null!=t&&0!=e.length&&(this.bu.has(e)||this.bu.has(t.event))&&this.yu.forEach(e=>{this.Mu(t,e)&&this._u.emit("actionCaptured",e.name)})}Eu(e){this.onAction("actionCaptured",t=>e(t))}Mu(e,t){if(null==(null==t?void 0:t.steps))return!1;for(var i of t.steps)if(this.wu(e,i))return!0;return!1}onAction(e,t){return this._u.on(e,t)}Su(e,t){if(null!=t&&t.url){var i,s=null==e||null==(i=e.properties)?void 0:i.$current_url;if(!s||"string"!=typeof s||!av(s,t.url,t.url_matching||"contains"))return!1}return!0}xu(e,t){return!!this.Iu(e,t)&&!!this.Ru(e,t)&&!!this.Pu(e,t)}Iu(e,t){if(null==t||!t.href)return!0;var i=this.Au(e);if(i.length>0)return i.some(e=>av(e.href,t.href,t.href_matching||"exact"));var s,r,n=(null==e||null==(s=e.properties)?void 0:s.$elements_chain)||"";return!!n&&av((r=n.match(/(?::|")href="(.*?)"/))?r[1]:"",t.href,t.href_matching||"exact")}Ru(e,t){if(null==t||!t.text)return!0;var i=this.Au(e);if(i.length>0)return i.some(e=>av(e.text,t.text,t.text_matching||"exact")||av(e.$el_text,t.text,t.text_matching||"exact"));var s,r,n,o,a=(null==e||null==(s=e.properties)?void 0:s.$elements_chain)||"";return!!a&&(r=function(e){for(var t,i=[],s=/(?::|")text="(.*?)"/g;!J(t=s.exec(e));)i.includes(t[1])||i.push(t[1]);return i}(a),n=t.text,o=t.text_matching||"exact",r.some(e=>av(e,n,o)))}Pu(e,t){if(null==t||!t.selector)return!0;var i,s,r=null==e||null==(i=e.properties)?void 0:i.$element_selectors;if(null!=r&&r.includes(t.selector))return!0;var n=(null==e||null==(s=e.properties)?void 0:s.$elements_chain)||"";if(t.selector_regex&&n)try{return new RegExp(t.selector_regex).test(n)}catch(e){}return!1}Au(e){var t;return null==(null==e||null==(t=e.properties)?void 0:t.$elements)?[]:null==e?void 0:e.properties.$elements}Cu(e,t){return null==t||!t.properties||0===t.properties.length||oh(t.properties.reduce((e,t)=>
vendor: 4,957 bytes, line 1
1{var i=B(t.value)?t.value.map(String):null!=t.value?[String(t.value)]:[];return e[t.key]={values:i,operator:t.operator||"exact"},e},{}),null==e?void 0:e.properties)}}class ag{constructor(e){var t;this.Fu=[],this._instance=e,this.Ou=new Map,this.Lu=new Map,this.Du=new Map,this.$u=null==(t=this._instance)||null==t.onSessionId?void 0:t.onSessionId(e=>this.Nu(e))}qu(e){return!1}ju(){return null}Bu(e){}Hu(){}zu(e,t){return!!e&&oh(e.propertyFilters,null==t?void 0:t.properties)}Uu(e,t){var i=new Map;return e.forEach(e=>{var s;null==(s=e.conditions)||null==(s=s[t])||null==(s=s.values)||s.forEach(t=>{if(null!=t&&t.name){var s=i.get(t.name)||[];s.push(e.id),i.set(t.name,s)}})}),i}Wu(e,t,i){var s=(i===ni.Activation?this.Ou:this.Lu).get(e),r=[];return this.Vu(e=>{r=e.filter(e=>null==s?void 0:s.includes(e.id))}),r.filter(s=>{var r,n=null==(r=s.conditions)||null==(r=r[i])||null==(r=r.values)?void 0:r.find(t=>t.name===e);return this.zu(n,t)})}register(e){this.Gu(e,!1)}replace(e){this.Gu(e,!0)}Gu(e,t){var i;V(null==(i=this._instance)?void 0:i._addCaptureHook)||(this.Zu(e,t),this.Qu(e,t))}Qu(e,t){var i,s=e.filter(e=>{var t;return null==(t=e.conditions)||null==(t=t.actions)||null==(t=t.values)?void 0:t.length});if(t&&this.Du.clear(),0!==s.length){this.Ju||(this.Ju=new ap(this._instance),this.Ju.init(),this.Ju.Eu(e=>this.onAction(e)));var r=[];s.forEach(e=>{var t;null==(t=e.conditions)||null==(t=t.actions)||t.values.forEach(t=>{if(r.push(t),t.name){var i,s=null!==(i=this.Du.get(t.name))&&void 0!==i?i:[];s.includes(e.id)||s.push(e.id),this.Du.set(t.name,s)}})}),t?this.Ju.replace(r):this.Ju.register(r)}else t&&(null==(i=this.Ju)||i.replace([]))}Ku(e,t){t.forEach((t,i)=>{var s,r=null!==(s=e.get(i))&&void 0!==s?s:[];t.forEach(e=>{r.includes(e)||r.push(e)}),e.set(i,r)})}Zu(e,t){var i,s,r=e.filter(e=>{var t,i;return(null==(t=e.conditions)?void 0:t.events)&&(null==(i=e.conditions)||null==(i=i.events)||null==(i=i.values)?void 0:i.length)>0}),n=e.filter(e=>{var t,i;return(null==(t=e.conditions)?void 0:t.cancelEvents)&&(null==(i=e.conditions)||null==(i=i.cancelEvents)||null==(i=i.values)?void 0:i.length)>0}),o=this.Uu(e,ni.Activation),a=this.Uu(e,ni.Cancellation);t?(this.Ou=o,this.Lu=a):(this.Ku(this.Ou,o),this.Ku(this.Lu,a)),(0!==r.length||0!==n.length)&&(null!==(i=this.Tu)&&void 0!==i||(this.Tu=null==(s=this._instance)?void 0:s._addCaptureHook((e,t)=>{this.onEvent(e,t)})))}onEvent(e,t){var i,s,r=this.Yu(),n=(null==t||null==(i=t.properties)?void 0:i.$survey_id)||(null==t||null==(s=t.properties)?void 0:s.$product_tour_id);if(n&&this.getActivatedIds().includes(n)){var o=this.Xu(e,n);if("consume"===o)return r.info("event consumed activated item, removing it",{event:e,itemId:n}),void this.th([n]);if("persist"===o)return r.info("shown item promoted to persisted activation",{event:e,itemId:n}),this.eh(n),void this.ih([n])}if(this.Lu.has(e)){var a=this.Wu(e,t,ni.Cancellation);a.length>0&&(r.info("cancel event matched, cancelling items",{event:e,itemsToCancel:a.map(e=>e.id)}),this.th(a.map(e=>e.id)),a.forEach(e=>this.rh(e.id)))}if(this.Ou.has(e)){r.info("event name matched",{event:e,eventPayload:t,items:this.Ou.get(e)});var l=this.Wu(e,t,ni.Activation);this.nh(l.map(e=>e.id))}}onAction(e){this.Du.has(e)&&this.nh(this.Du.get(e)||[])}nh(e){var t;if(0!==e.length){var i=!(null==(t=this._instance)||null==t.get_session_id||!t.get_session_id()),s=[];for(var r of e)i&&this.qu(r)?this.eh(r)&&this.sh(r):s.push(r);s.length>0&&(this.Fu=[...new Set([...this.Fu,...s])]),this.Yu().info("updating activated items",{activatedItems:this.getActivatedIds()})}}eh(e){this.Fu=this.Fu.filter(t=>t!==e);var t=this.ah();return!t.includes(e)&&(this.oh([...t,e]),this.lh(),!0)}th(e){var t=new Set(e);this.Fu=this.Fu.filter(e=>!t.has(e));var i=this.uh(),s=i.filter(e=>!t.has(e));s.length!==i.length&&(this.oh(s),0===s.length&&this.hh()),this.ih(e)}dh(){var e,t=this.ju();if(!t)return{};var i=null==(e=this._instance)||null==(e=e.persistence)?void 0:e.props[t];return i&&"object"==typeof i?i:{}}sh(e){if(this.ju()){var t=this.dh();this.Bu(y({},t,{[e]:Date.now()}))}}ih(e){if(this.ju()){var t=this.dh(),i={},s=!1;for(var r of Object.entries(t)){var n=r[0],o=r[1];e.includes(n)?s=!0:i[n]=o}s&&(z(i)?this.Hu():this.Bu(i))}}fh(){this.ju()&&this.Hu()}getActivationTimestamp(e){if(this.ah().includes(e)){var t=this.dh()[e];return K(t)?t:void 0}}uh(){var e,t=this.ph();return(null==(e=this._instance)||null==(e=e.persistence)?void 0:e.props[t])||[]}ah(){var e,t,i=this.uh();if(0===i.length)return[];var s=null==(e=this._instance)||null==(e=e.persistence)?void 0:e.props[this.gh()],r=null==(t=this._instance)||null==t.get_session_id?void 0:t.get_session_id();return r&&s===r?i:[]}lh(){var e,t=null==(e=this._instance)||null==e.get_session_id?void 0:e.get_session_id();t&&this.mh(t)}hh(){this.yh()}Nu(e){var t,i=null==(t=this._instance)||null==(t=t.persistence)?void 0:t.props[this.gh()];if(i&&i!==e){var s=this.uh(),r=this.dh();s.length>0&&(this.oh([]),s.filter(e=>
1K(r[e])).forEach(e=>this.rh(e))),this.hh(),this.fh()}}getActivatedIds(){return[...new Set([...this.ah(),...this.Fu])].filter(e=>!this.bh(e))}dispose(){var e,t,i;null==(e=this.$u)||e.call(this),this.$u=void 0,null==(t=this.Tu)||t.call(this),this.Tu=void 0,null==(i=this.Ju)||i.dispose(),this.Ju=void 0}reset(){this.Fu=[],this.uh().length>0&&this.oh([]),this.hh(),this.fh()}getEventToItemsMap(){return this.Ou}_h(){return this.Ju}}class af extends ag{constructor(e){super(e)}ph(){return iU}gh(){return iz}ju(){return iV}Bu(e){var t;null==(t=this._instance)||null==(t=t.persistence)||t.register({[iV]:e})}Hu(){var e;null==(e=this._instance)||null==(e=e.persistence)||e.unregister(iV)}qu(e){this.Vu(t=>{i=t.find(t=>t.id===e)});var t,i,s=null==(t=i)||null==(t=t.appearance)?void 0:t.surveyPopupDelaySeconds;return K(s)&&s>0}wh(){return nr.SHOWN}Vu(e){var t;null==(t=this._instance)||t.getSurveys(e)}rh(e){var t;null==(t=this._instance)||t.cancelPendingSurvey(e)}Yu(){return o_}oh(e){var t;null==(t=this._instance)||null==(t=t.persistence)||t.register({[iU]:e})}mh(e){var t;null==(t=this._instance)||null==(t=t.persistence)||t.register({[iz]:e})}yh(){var e;null==(e=this._instance)||null==(e=e.persistence)||e.unregister(iz)}bh(){return!1}Xu(e,t){var i,s,r;return this.Vu(e=>{r=e.find(e=>e.id===t)}),!r||oo(i=r)&&!(null==(s=i.conditions)||null==(s=s.events)||!s.repeatedActivation)||"always"===i.schedule?e===nr.SHOWN?"consume":"ignore":e===nr.SHOWN?"persist":e===nr.DISMISSED||e===nr.SENT?"consume":"ignore"}getSurveys(){return this.getActivatedIds()}getEventToSurveys(){return this.getEventToItemsMap()}}class a_{constructor(e){this._instance=e}initialize(){}get(e){if("string"==typeof e)return this._instance.get_property(e);var t={};for(var i of e){var s=this._instance.get_property(i);V(s)||(t[i]=s)}return t}set(e,t){this._instance.register("string"==typeof e?{[e]:t}:e)}remove(e){"string"!=typeof e?e.forEach(e=>this._instance.unregister(e)):this._instance.unregister(e)}}class am{constructor(e){this._instance=e}get(){var 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()}getExtensions(){var e=null==g?void 0:g.__PosthogExtensions__;if(e){var t=e.generateSurveys,i=e.loadExternalDependency;return{generateSurveys:t?e=>t(this._instance,e):void 0,loadExternalDependency:i?e=>i(this._instance,"surveys",e):void 0}}}createEventReceiver(){return new af(this._instance)}}var ay=null!=s&&s.location?rB(s.location.hash,"__posthog")||rB(location.hash,"state"):null,ab="_postHogToolbarParams",aw=t8("[Toolbar]"),ax=t8("[FeatureFlags]");class ak{constructor(e,t){void 0===t&&(t=!1),this.kh=!1,this.update(e,t)}update(e,t){var i,s,r,n,o;this.Sh={bootstrap:{featureFlags:null==(i=e.bootstrap)?void 0:i.featureFlags,featureFlagPayloads:null==(s=e.bootstrap)?void 0:s.featureFlagPayloads},remoteRequestsDisabled:t,featureFlagsDisabled:!!e.advanced_disable_feature_flags,onlyEvaluateSurveyFeatureFlags:!!e.advanced_only_evaluate_survey_feature_flags,deduplicateCallsPerSession:!!e.advanced_feature_flags_dedup_per_session,cacheTtlMs:e.feature_flag_cache_ttl_ms,refreshIntervalMs:null!==(r=e.remote_config_refresh_interval_ms)&&void 0!==r?r:3e5,requestTimeoutMs:e.feature_flag_request_timeout_ms,compression:e.disable_compression?void 0:"best-available",evaluationContexts:null!==(n=null!==(o=e.evaluation_contexts)&&void 0!==o?o:e.evaluation_environments)&&void 0!==n?n:[],flagKeys:B(e.flag_keys)?e.flag_keys:void 0},!e.evaluation_environments||e.evaluation_contexts||this.kh||(ax.warn("evaluation_environments is deprecated. Use evaluation_contexts instead. evaluation_environments will be removed in a future version."),this.kh=!0),V(e.flag_keys)||B(e.flag_keys)||ax.error("Invalid flag_keys found:",e.flag_keys,"Expected array of non-empty strings")}get(){return this.Sh}}var aE=t8("[FeatureFlags]"),aS=t8("[FeatureFlags]",{debugEnabled:!0}),aP="\" failed. Feature flags didn't load in time.",aI="connection_error",aF=e=>{for(var t={},i=0;e.length>i;i++)t[e[i]]=!0;return t},aC=e=>{var t={};for(var i of sp(e||{})){var s=i[1];s&&(t[i[0]]=s)}return t},a$=t8("[Error tracking]"),aO=["chrome-extension://","moz-extension://","safari-extension:","safari-web-extension:"],aT=["__firefox__","__gCrWeb"],aR="Refusing to render web experiment since the viewer is a likely bot",aL={icontains:(e,t)=>t.toLowerCase().indexOf(e.toLowerCase())>-1,not_icontains:(e,t)=>-1===t.toLowerCase().indexOf(e.toLowerCase()),regex:(e,t)=>oa(t,e),not_regex:(e,t)=>!oa(t,e),exact:(e,t)=>
1t===e,is_not:(e,t)=>t!==e};class aM{get vn(){return this._instance.config}constructor(e){var t=this;this.getWebExperimentsAndEvaluateDisplayLogic=function(e){void 0===e&&(e=!1),t.getWebExperiments(e=>{aM.xh("retrieved web experiments from the server"),t.Ch=new Map,e.forEach(e=>{if(e.feature_flag_key){t.Ch&&(aM.xh("setting flag key ",e.feature_flag_key," to web experiment ",e),null==(i=t.Ch)||i.set(e.feature_flag_key,e));var i,s=t._instance.getFeatureFlag(e.feature_flag_key);W(s)&&e.variants[s]&&t.Th(e.name,s,e.variants[s].transforms)}else if(e.variants)for(var r in e.variants){var n=e.variants[r];aM.Mh(n,t._instance)&&t.Th(e.name,r,n.transforms)}})},e)},this._instance=e,this._instance.onFeatureFlags(e=>{this.onFeatureFlags(e)})}initialize(){}onFeatureFlags(e){if(this._is_bot())aM.xh(aR);else if(!this.vn.disable_web_experiments){if(J(this.Ch))return this.Ch=new Map,this.loadIfEnabled(),void this.previewWebExperiment();aM.xh("applying feature flags",e),e.forEach(e=>{var t;if(this.Ch&&null!=(t=this.Ch)&&t.has(e)){var i,s=this._instance.getFeatureFlag(e),r=null==(i=this.Ch)?void 0:i.get(e);s&&null!=r&&r.variants[s]&&this.Th(r.name,s,r.variants[s].transforms)}})}}previewWebExperiment(){var e=aM.getWindowLocation();if(null!=e&&e.search){var t=rj(null==e?void 0:e.search,"__experiment_id"),i=rj(null==e?void 0:e.search,"__experiment_variant");t&&i&&(aM.xh("previewing web experiments "+t+" && "+i),this.getWebExperiments(e=>{this.Eh(parseInt(t),i,e)},!1,!0))}}loadIfEnabled(){this.vn.disable_web_experiments||this.getWebExperimentsAndEvaluateDisplayLogic()}getWebExperiments(e,t,i){if(this.vn.disable_web_experiments&&!i)return e([]);var s=this._instance.get_property("$web_experiments");if(s&&!t)return e(s);this._instance._send_request({url:this._instance.requestRouter.endpointFor("api","/api/web_experiments/?token="+this.vn.token),method:"GET",timestampMode:"query",callback:t=>e(200===t.statusCode&&t.json&&t.json.experiments||[])})}Eh(e,t,i){var s=i.filter(t=>t.id===e);s&&s.length>0&&(aM.xh("Previewing web experiment ["+s[0].name+"] with variant ["+t+"]"),this.Th(s[0].name,t,s[0].variants[t].transforms))}static Mh(e,t){return!J(e.conditions)&&aM.Ih(e,t)&&aM.Rh(e)}static Ih(e,t){if(J(e.conditions)||J(null==(s=e.conditions)?void 0:s.url))return!0;var i=aM.getWindowLocation();if(i){var s,r,n,o,a=sX(t,i.href);return null==(r=e.conditions)||!r.url||aL[null!==(n=null==(o=e.conditions)?void 0:o.urlMatchType)&&void 0!==n?n:"icontains"](e.conditions.url,a)}return!1}
1static getWindowLocation(){return null==s?void 0:s.location}static Rh(e){if(J(e.conditions)||J(null==(i=e.conditions)?void 0:i.utm))return!0;var t=rJ();if(t.utm_source){var i,s,r,n,o,a,l,u,h,c=null==(s=e.conditions)||null==(s=s.utm)||!s.utm_campaign||(null==(r=e.conditions)||null==(r=r.utm)?void 0:r.utm_campaign)==t.utm_campaign,d=null==(n=e.conditions)||null==(n=n.utm)||!n.utm_source||(null==(o=e.conditions)||null==(o=o.utm)?void 0:o.utm_source)==t.utm_source,v=null==(a=e.conditions)||null==(a=a.utm)||!a.utm_medium||(null==(l=e.conditions)||null==(l=l.utm)?void 0:l.utm_medium)==t.utm_medium,p=null==(u=e.conditions)||null==(u=u.utm)||!u.utm_term||(null==(h=e.conditions)||null==(h=h.utm)?void 0:h.utm_term)==t.utm_term;return c&&v&&p&&d}return!1}static xh(e){for(var t=arguments.length,i=Array(t>1?t-1:0),s=1;t>s;s++)i[s-1]=arguments[s];t4.info("[WebExperiments] "+e,i)}Th(e,t,i){this._is_bot()?aM.xh(aR):"control"!==t?i.forEach(i=>{if(i.selector){aM.xh("applying transform of variant "+t+" for experiment "+e+" ",i);var s,r=null==(s=document)?void 0:s.querySelectorAll(i.selector);null==r||r.forEach(e=>{i.html&&(e.innerHTML=i.html),i.css&&e.setAttribute("style",i.css)})}}):aM.xh("Control variants leave the page unmodified.")}_is_bot(){return n&&this._instance?or(n,this.vn.custom_blocked_useragents):void 0}}var aA=t8("[Conversations]"),aD="Conversations not available yet.";function aN(e,t){var i,s,r,n,o,a,l,u=null!==(i=null==e?void 0:e.flushIntervalMs)&&void 0!==i?i:3e3,h=null!==(s=null==e?void 0:e.maxBufferSize)&&void 0!==s?s:100,c=null!=t&&t.consoleCapture?void 0:null!==(r=null==e?void 0:e.maxLogsPerInterval)&&void 0!==r?r:1e3,d=V(c)?Math.max(h,2048):Math.max(h,c),v=null==e?void 0:e.resourceAttributes;return{serviceName:null!==(n=null!==(o=null==v?void 0:v["service.name"])&&void 0!==o?o:null==e?void 0:e.serviceName)&&void 0!==n?n:null==t?void 0:t.serviceNameDefault,serviceVersion:null!==(a=null==v?void 0:v["service.version"])&&void 0!==a?a:null==e?void 0:e.serviceVersion,environment:null!==(l=null==v?void 0:v["deployment.environment"])&&void 0!==l?l:null==e?void 0:e.environment,resourceAttributes:v,beforeSend:null==e?void 0:e.beforeSend,flushIntervalMs:u,maxBufferSize:h,maxQueueSize:d,maxBatchRecordsPerPost:100,rateCapWindowMs:u,maxLogsPerInterval:c,backgroundFlushBudgetMs:0,terminationFlushBudgetMs:0}}var aj=["debug","log","warn","error","info"],aq="console",aB="__posthogHandledLogsRequestError",aH=(e,t)=>{var i=e instanceof Error?e:Error(t);return i[aB]=!0,i},aU=e=>!!e&&"object"==typeof e&&!0===e[aB],az={featureFlags:class{constructor(e){this.name="featureFlags",this.Ph=!1,this.featureFlagEventHandlers=[],this.I=aE,this.Ah={},this.Fh={},this.Oh=[],this.Lh=!1,this.Dh=!1,this.$h=0,this.Nh=!1,this.qh=!1,this.jh=!1,this.Bh=!1,this.Hh=0,this.Ht=()=>{var e=this.zh();this.Hh=0,e&&this.reloadFeatureFlags()},this.Uh=()=>{var e,t=this.Wh;V(t)||this.vn.remoteRequestsDisabled||!o||"hidden"===o.visibilityState||Date.now()-(null!==(e=this.Vh)&&void 0!==e?e:0)<t||(this.reloadFeatureFlags(),this.Gh())},this.$t=()=>{"visible"===(null==o?void 0:o.visibilityState)&&this.Uh()},"get"in e?this.Ps=e:(this.Zh=new ak(e.config,e.Ua()),this.Ps=this.Zh)}updateConfig(e,t){var i;null==(i=this.Zh)||i.update(e,t),this.Os&&this.Qh()}setup(e){return this.au=e,this.I=e.logger.createLogger("[FeatureFlags]"),au(e.kv.initialize(),()=>{this.au===e&&(this.au=void 0,this.Os=e,this.Jh(e))})}Jh(e){if(this.Os===e)return s&&sy(s,"online",this.Ht),this.Qh(),this.Kh=e.registerDynamicEventProperties(()=>this.Yh()?this.Ah:this.Fh),this.Xh(),this.initialize()}Qh(){var e=this.vn.refreshIntervalMs,t=!this.vn.remoteRequestsDisabled&&o&&!V(e)&&e>0?e:void 0;t!==this.Wh&&(this.td(),V(t)||(this.Wh=t,this.Gh(),null!=o&&o.addEventListener&&sy(o,sn,this.$t)))}Gh(){V(this.Wh)||(V(this.ed)||clearInterval(this.ed),this.Vh=Date.now(),this.ed=setInterval(this.Uh,this.Wh))}td(){V(this.ed)||(clearInterval(this.ed),this.ed=void 0,null==o||null==o.removeEventListener||o.removeEventListener(sn,this.$t)),this.Wh=void 0,this.Vh=void 0}destroy(){this.rd()}dispose(){this.rd()}rd(){var e;this.td(),this.$h++,this.qh=!1,this.au=void 0,this.Os&&(this.nd(),null==(e=this.Kh)||e.dispose(),this.Kh=void 0,this.Oh=[],null==s||s.removeEventListener("online",this.Ht),this.Os=void 0)}get vn(){return this.Ps.get()}sd(e){var t;return null==(t=this.Os)?void 0:t.kv.get(e)}ei(e){this.ad(()=>{var t;return null==(t=this.Os)?void 0:t.kv.set(e)})}ri(e){this.ad(()=>{var t;return null==(t=this.Os)?void 0:t.kv.remove(e)})}ad(e){try{e()}catch(e){this.I.error("Failed to update feature flag persistence",e)}}Xh(){var e={};for(var t of[i$,iR,iL,iA]){var i=this.sd(t);V(i)||(e[t]=i)}this.Ah=e;var s=y({},e),r=this.sd(iC);if(r)for(var n of Object.entries(r))s["$feature/"+n[0]]=n[1];this.Fh=s}Yh(){var e=this.vn.cacheTtlMs;
vendor: 8,582 bytes, line 1
1if(!e||0>=e)return!1;var t=this.sd(iK);return"number"!=typeof t||Date.now()-t>e}od(){return!!this.Yh()&&(this.Bh||this.Dh||(this.Bh=!0,this.I.warn("Feature flag cache is stale, triggering refresh..."),this.reloadFeatureFlags()),!0)}ld(){var e=this.vn.evaluationContexts;return null!=e&&e.length?e.filter(e=>{var t=e&&"string"==typeof e&&e.trim().length>0;return t||this.I.error("Invalid evaluation context found:",e,"Expected non-empty string"),t}):[]}ud(){var e=this.vn.flagKeys;if(!V(e))return e.filter(e=>{var t=e&&"string"==typeof e&&e.trim().length>0;return t||this.I.error("Invalid flag key found:",e,"Expected non-empty string"),t})}initialize(){var e,t,i=this.vn,s=null!==(e=null==(t=i.bootstrap)?void 0:t.featureFlags)&&void 0!==e?e:{};if(Object.keys(s).length){var r,n,o=null!==(r=null==(n=i.bootstrap)?void 0:n.featureFlagPayloads)&&void 0!==r?r:{},a=Object.keys(s).filter(e=>!!s[e]).reduce((e,t)=>(e[t]=s[t]||!1,e),{}),l=Object.keys(o).filter(e=>a[e]).reduce((e,t)=>(e[t]=o[t],e),{});return this.hd({featureFlags:a,featureFlagPayloads:l})}}updateFlags(e,t,i){var s,r,n=null!=i&&i.merge&&null!==(s=this.sd(iC))&&void 0!==s?s:{},o=null!=i&&i.merge&&null!==(r=this.sd(iR))&&void 0!==r?r:{},a=y({},n,e),l=y({},o,t),u={};for(var h of Object.entries(a)){var c=h[0],d=h[1];u[c]={key:c,enabled:x(d),variant:k(d),reason:void 0,metadata:V(null==l?void 0:l[c])?void 0:{id:0,version:void 0,description:void 0,payload:l[c]}}}this.hd({flags:u})}get hasLoadedFlags(){return this.Lh}getFlags(){return Object.keys(this.getFlagVariants())}getFlagsWithDetails(){var e=this.sd(iT),t=this.sd(iA),i=this.sd(iD);if(!i&&!t)return e||{};var s=sv({},e||{});for(var r of[...new Set([...Object.keys(i||{}),...Object.keys(t||{})])]){var n,o,a=s[r],l=null==t?void 0:t[r],u=V(l)?null!==(n=null==a?void 0:a.enabled)&&void 0!==n&&n:!!l,h=V(l)?null==a?void 0:a.variant:"string"==typeof l?l:void 0,c=null==i?void 0:i[r],d=y({},a,{enabled:u,variant:u?null!=h?h:null==a?void 0:a.variant:void 0});u!==(null==a?void 0:a.enabled)&&(d.original_enabled=null==a?void 0:a.enabled),h!==(null==a?void 0:a.variant)&&(d.original_variant=null==a?void 0:a.variant),c&&(d.metadata=y({},null==a?void 0:a.metadata,{payload:c,original_payload:null==a||null==(o=a.metadata)?void 0:o.payload})),s[r]=d}return this.Ph||(this.I.warn(" Overriding feature flag details!",{flagDetails:e,overriddenPayloads:i,finalDetails:s}),this.Ph=!0),s}getAllFeatureFlags(){var e=this.getFlagVariants(),t=this.getFlagPayloads();return Object.keys(e).map(i=>{var s=e[i];return{key:i,enabled:x(s),variant:k(s),payload:w(t[i])}})}getFlagVariants(){var e=this.sd(iC),t=this.sd(iA);if(!t)return e||{};for(var i=sv({},e||{}),s=Object.keys(t),r=0;s.length>r;r++)i[s[r]]=t[s[r]];return this.Ph||(this.I.warn(" Overriding feature flags!",{enabledFlags:e,overriddenFlags:t,finalFlags:i}),this.Ph=!0),i}getFlagPayloads(){var e=this.sd(iR),t=this.sd(iD);if(!t)return e||{};for(var i=sv({},e||{}),s=Object.keys(t),r=0;s.length>r;r++)i[s[r]]=t[s[r]];return this.Ph||(this.I.warn(" Overriding feature flag payloads!",{flagPayloads:e,overriddenPayloads:t,finalPayloads:i}),this.Ph=!0),i}reloadFeatureFlags(){this.Nh||this.vn.featureFlagsDisabled||this.zh()||this.dd||(this.Oh.slice().forEach(e=>{try{e()}catch(e){this.I.error("Error while running feature flags reloading callback",e)}}),this.dd=setTimeout(()=>{this.vd()},5))}nd(){clearTimeout(this.dd),this.dd=void 0}onReloading(e){return this.Oh.push(e),()=>{this.Oh=this.Oh.filter(t=>t!==e)}}ensureFlagsLoaded(){this.Lh||this.Dh||this.dd||this.reloadFeatureFlags()}setAnonymousDistinctId(e){this.$anon_distinct_id=e}setReloadingPaused(e){this.Nh=e}resetFlagCallReported(){this.ri(iG)}vd(e){this.nd();var t=this.Os;if(t&&!this.vn.remoteRequestsDisabled&&!this.zh()){if(this.Dh)this.qh=!0;else{var i={token:t.projectToken,distinct_id:t.distinctId,groups:t.groups,$anon_distinct_id:this.$anon_distinct_id,person_properties:y({},t.initialPersonProperties,this.sd(iN)||{},{$lib:t.library.name,$lib_version:t.library.version}),group_properties:this.sd(ij),timezone:r3()};V(t.deviceId)||(i.$device_id=t.deviceId),(null!=e&&e.disableFlags||this.vn.featureFlagsDisabled)&&(i.disable_flags=!0);var s=this.ld();s.length&&(i.evaluation_contexts=s);var r=this.ud();V(r)||(i.flag_keys=r);var n=this.vn.onlyEvaluateSurveyFeatureFlags,o=this.$h;this.Dh=!0;var a=()=>{this.qh&&(this.qh=!1,this.vd())},l=e=>{this.Dh=!1,o===this.$h&&(this.ei({[iJ]:[aI]}),this.I.error("Feature flag request failed",e)),a()};try{t.sendRequest("/flags/?v=2"+(n?"&only_evaluate_survey_feature_flags=true":""),{target:"flags",method:"POST",body:i,compression:this.vn.compression,sentAt:"body",timeoutMs:this.vn.requestTimeoutMs}).then(e=>{var t,s,r=null!==(t=e.json)&&void 0!==t?t:{},l=200!==e.statusCode;if(this.Dh=!1,o===this.$h){if(this.fd(e.statusCode),l||this.qh||(this.$anon_distinct_id=void 0),!i.disable_flags||this.qh){this.jh=!l;var u=[];e.error?u.push(e.error instanceof Error&&"AbortError"===e.error.name?"timeout":e.error instanceof Error?aI:"unknown_error"):200!==e.statusCode&&u.push("api_error_"+e.statusCode),r.errorsWhileComputingFlags&&u.push("errors_while_computing_flags");var h=!(null==(s=r.quotaLimited)||!s.includes("feature_flags"));h&&u.push("quota_limited"),this.ei({[iJ]:u}),h?this.I.warn("You have hit your feature flags quota limit, and will not be able to load feature flags until the quota is reset. Please visit https://posthog.com/docs/billing/limits-alerts to learn more."):i.disable_flags||this.hd(r,l,{partialResponse:n}),a()}}else a()}).catch(l)}catch(e){l(e)}}}}zh(){return rH(this.Hh,3)}fd(e){this.Hh=rU(e,this.Hh,3,()=>this.I.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(void 0===t&&(t={}),!t.fresh||this.jh){if(this.Lh||this.getFlags()&&this.getFlags().length>0){if(!this.od()){var s=this.getFeatureFlagResult(e,t);return null!==(i=null==s?void 0:s.variant)&&void 0!==i?i:null==s?void 0:s.enabled}}else this.I.warn('getFeatureFlag for key "'+e+aP)}}getFeatureFlagDetails(e){return this.getFlagsWithDetails()[e]}getFeatureFlagPayload(e){var t=this.getFeatureFlagResult(e,{send_event:!1});return null==t?void 0:t.payload}getFeatureFlagResult(e,t){if(void 0===t&&(t={}),!t.fresh||this.jh){if(this.Lh||this.getFlags()&&this.getFlags().length>0){if(!this.od()){var i,s=this.getFlagVariants(),r=e in s,n=s[e],o=this.getFlagPayloads()[e],a=String(n),l=this.sd(iL)||void 0,u=this.sd(iK)||void 0,h=this.sd(iG)||{};if(this.vn.deduplicateCallsPerSession){var c,d=null==(c=this.Os)?void 0:c.session.sessionId,v=this.sd(iY);d&&d!==v&&(h={},i=d)}if(!t.send_event&&"send_event"in t)i&&this.ei({[iG]:h,[iY]:i});else if(e in h&&h[e].includes(a))i&&this.ei({[iG]:h,[iY]:i});else{B(h[e])?h[e].push(a):h[e]=[a],this.ei(y({[iG]:h},i?{[iY]:i}:{}));var p=this.getFeatureFlagDetails(e),g=[...null!==(_=this.sd(iJ))&&void 0!==_?_:[]];V(n)&&g.push("flag_missing");var f={$feature_flag:e,$feature_flag_response:n,$feature_flag_payload:null!=o?o:null,$feature_flag_request_id:l,$feature_flag_evaluated_at:u,$feature_flag_bootstrapped_response:null!==(m=null==(b=this.vn.bootstrap)||null==(b=b.featureFlags)?void 0:b[e])&&void 0!==m?m:null,$feature_flag_bootstrapped_payload:null!==(x=null==(k=this.vn.bootstrap)||null==(k=k.featureFlagPayloads)?void 0:k[e])&&void 0!==x?x:null,$used_bootstrap_value:!this.jh};V(null==p||null==(E=p.metadata)?void 0:E.has_experiment)||(f.$feature_flag_has_experiment=p.metadata.has_experiment),V(null==p||null==(S=p.metadata)?void 0:S.version)||(f.$feature_flag_version=p.metadata.version);var _,m,b,x,k,E,S,P,I,F,C,$,O,T=null!==(P=null==p||null==(I=p.reason)?void 0:I.description)&&void 0!==P?P:null==p||null==(F=p.reason)?void 0:F.code;T&&(f.$feature_flag_reason=T),null!=p&&null!=(C=p.metadata)&&C.id&&(f.$feature_flag_id=p.metadata.id),V(null==p?void 0:p.original_variant)&&V(null==p?void 0:p.original_enabled)||(f.$feature_flag_original_response=V(p.original_variant)?p.original_enabled:p.original_variant),null!=p&&null!=($=p.metadata)&&$.original_payload&&(f.$feature_flag_original_payload=null==p||null==(O=p.metadata)?void 0:O.original_payload),g.length&&(f.$feature_flag_error=g.join(",")),this.pd(f)}if(r)return{key:e,enabled:!!n,variant:"string"==typeof n?n:void 0,payload:w(o)}}}else this.I.warn('getFeatureFlagResult for key "'+e+aP)}}pd(e){try{var t;null==(t=this.Os)||t.capture("$feature_flag_called",e).catch(e=>{this.I.error("Failed to capture feature flag call",e)}
1)}catch(e){this.I.error("Failed to capture feature flag call",e)}}getRemoteConfigPayload(e,t){this.gd(e,t)}gd(e,t){var i=this;return m(function*(){var s=i.Os;if(s){var r={distinct_id:s.distinctId,token:s.projectToken,person_properties:{$lib:s.library.name,$lib_version:s.library.version}},n=i.ld();n.length&&(r.evaluation_contexts=n);var o,a=i.ud();V(a)||(r.flag_keys=a);try{var l,u=null==(l=(yield s.sendRequest("/flags/?v=2",{target:"flags",method:"POST",body:r,compression:i.vn.compression,sentAt:"body",timeoutMs:i.vn.requestTimeoutMs})).json)?void 0:l.featureFlagPayloads;o=(null==u?void 0:u[e])||void 0}catch(e){return void i.I.error("Remote config feature flag request failed",e)}try{t(o)}catch(e){i.I.error("Remote config feature flag callback failed",e)}}})()}isFeatureEnabled(e,t){if(void 0===t&&(t={}),t.fresh&&!this.jh)return t.defaultValue;if(!(this.Lh||this.getFlags()&&this.getFlags().length>0))return this.I.warn('isFeatureEnabled for key "'+e+aP),t.defaultValue;var i=this.getFeatureFlag(e,t);return V(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.hd(e,t,i)}hd(e,t,i){if(this.Os){this.Lh=!0;var s=function(e,t,i,s,r,n){void 0===t&&(t={}),void 0===i&&(i={}),void 0===s&&(s={}),void 0===n&&(n=aE);var o,a,l=(o=n,(a=e.flags)?y({},e,{featureFlags:Object.fromEntries(Object.keys(a).map(e=>{var t;return[e,null!==(t=a[e].variant)&&void 0!==t?t:a[e].enabled]})),featureFlagPayloads:Object.fromEntries(Object.keys(a).filter(e=>a[e].enabled).filter(e=>{var t;return null==(t=a[e].metadata)?void 0:t.payload}).map(e=>{var t;return[e,null==(t=a[e].metadata)?void 0:t.payload]}))}):(e.featureFlags&&o.warn("Using an older version of the feature flags endpoint. Please upgrade your PostHog server to the latest version"),e)),u=l.flags,h=l.featureFlags,c=l.featureFlagPayloads;if(h){var d=e.requestId,v=e.evaluatedAt;if(B(h)){n.warn("v1 of the feature flags endpoint is deprecated. Please use the latest version.");var p={};if(h)for(var g=0;h.length>g;g++)p[h[g]]=!0;return{[i$]:h,[iC]:p,[iM]:!1}}var f=h,_=c,m=u;if(null!=r&&r.partialResponse)f=y({},t,f),_=y({},i,_),m=y({},s,m);else if(e.errorsWhileComputingFlags){if(u){var b=new Set(Object.keys(u).filter(e=>{var t;return!(null!=(t=u[e])&&t.failed)}));f=y({},t,Object.fromEntries(Object.entries(f).filter(e=>b.has(e[0])))),_=y({},i,Object.fromEntries(Object.entries(_||{}).filter(e=>b.has(e[0])))),m=y({},s,Object.fromEntries(Object.entries(m||{}).filter(e=>b.has(e[0]))))}else f=y({},t,f),_=y({},i,_),m=y({},s,m)}return y({[i$]:Object.keys(aC(f)),[iC]:f||{},[iR]:_||{},[iT]:m||{},[iM]:!0===e.minimalFlagCalledEvents},d?{[iL]:d}:{},v?{[iK]:v}:{})}}(e,this.getFlagVariants(),this.getFlagPayloads(),this.getFlagsWithDetails(),i,this.I);s&&this.ei(s),t||(this.Bh=!1),this.md(t)}}override(e,t){void 0===t&&(t=!1),this.I.warn("override is deprecated. Please use overrideFeatureFlags instead."),this.overrideFeatureFlags({flags:e,suppressWarning:t})}overrideFeatureFlags(e){this.yd(e)}yd(e){if(this.Os){if(!1===e)return this.ri([iA,iD]),this.md(),void aS.info("All overrides cleared");if(B(e))return this.ei({[iA]:aF(e)}),this.md(),void aS.info("Flag overrides set",{flags:e});if(e&&"object"==typeof e&&("flags"in e||"payloads"in e)){this.Ph=!!(null!==(t=e.suppressWarning)&&void 0!==t&&t);var t,i={},s=e.flags,r=e.payloads;return s&&(i[iA]=B(s)?aF(s):s),r&&(i[iD]=r),Object.keys(i).length&&this.ei(i),!1===s&&!1===r?this.ri([iA,iD]):!1===s?this.ri(iA):!1===r&&this.ri(iD),this.md(),!1===s?aS.info("Flag overrides cleared"):s&&aS.info("Flag overrides set",{flags:s}),void(!1===r?aS.info("Payload overrides cleared"):r&&aS.info("Payload overrides set",{payloads:r}))}if(e&&"object"==typeof e)return this.ei({[iA]:e}),this.md(),void aS.info("Flag overrides set",{flags:e});this.I.warn("Invalid overrideOptions provided to overrideFeatureFlags",{overrideOptions:e})}else this.I.warn("posthog.featureFlags.overrideFeatureFlags called before feature flags were ready")}onFeatureFlags(e){if(this.addFeatureFlagsHandler(e),this.Lh){var t=this.bd(),i=t.flags,s=t.flagVariants;try{e(i,s)}catch(e){this.I.error("Error while running feature flags callback",e)}}return()=>this.removeFeatureFlagsHandler(e)}updateEarlyAccessFeatureEnrollment(e,t,i){var s,r=(this.sd(iO)||[]).find(t=>t.flagKey===e),n={["$feature_enrollment/"+e]:t},o={$feature_flag:e,$feature_enrollment:t,$set:n};r&&(o.$early_access_feature_name=r.name),i&&(o.$feature_enrollment_stage=i);var a=y({},this.getFlagVariants(),{[e]:t});this.ei({[i$]:Object.keys(aC(a)),[iC]:a,[iN]:y({},this.sd(iN)||{},n)}),this.md();try{null==(s=this.Os)||s.capture("$feature_enrollment_update",o).catch(e=>{this.I.error("Failed to capture early access feature enrollment",e)})}catch(e){this.I.error("Failed to capture early access feature enrollment",e)}}getEarlyAccessFeatures(e,t,i){void 0===t&&(t=!1);var s=this.sd(iO);!s||t?this._d(e,i):e(s)}_d(e,t){var i=this;return m(function*(){var s=i.Os;if(s){var r,n=t?"&"+t.map(e=>"stage="+e).join("&"):"";try{var o=yield s.sendRequest("/api/early_access_features/?token="+s.projectToken+n,{target:"api",method:"GET",sentAt:"query"});if(!o.json)return;i.ei({[iO]:r=o.json.earlyAccessFeatures})}catch(e){return void i.I.error("Early access feature request failed",e)}try{e(r)}catch(e){i.I.error("Early access feature callback failed",e)}}})()}bd(){var e=this.getFlags(),t=this.getFlagVariants();return{flags:e.filter(e=>t[e]),flagVariants:Object.keys(t).filter(e=>t[e]).reduce((e,i)=>(e[i]=t[i],e),{})}}md(e){this.Xh();var t=this.bd(),i=t.flags,s=t.flagVariants;
1this.featureFlagEventHandlers.forEach(t=>{try{t(i,s,{errorsLoading:e})}catch(e){this.I.error("Error while running feature flags callback",e)}})}setPersonPropertiesForFlags(e,t){void 0===t&&(t=!0),this.wd(e,t)}wd(e,t){void 0===t&&(t=!0);var i=this.sd(iN)||{},s=(null==e?void 0:e.$set)||(null!=e&&e.$set_once?{}:e),r=null==e?void 0:e.$set_once,n={};if(r)for(var o in r)({}).hasOwnProperty.call(r,o)&&(o in i||(n[o]=r[o]));this.ei({[iN]:y({},i,n,s)}),t&&this.reloadFeatureFlags()}unsetPersonPropertiesForFlags(e,t){void 0===t&&(t=!0);var i=y({},this.sd(iN)||{});e.forEach(e=>{delete i[e]}),this.ei({[iN]:i}),t&&this.reloadFeatureFlags()}resetPersonPropertiesForFlags(e){void 0===e&&(e=!0),this.ri(iN),e&&this.reloadFeatureFlags()}setGroupPropertiesForFlags(e,t){void 0===t&&(t=!0);var i=this.sd(ij)||{},s=y({},i);for(var r of Object.keys(e))s[r]=y({},i[r],e[r]);this.ei({[ij]:s}),t&&this.reloadFeatureFlags()}resetGroupPropertiesForFlags(e){if(e){var t=this.sd(ij)||{};this.ei({[ij]:y({},t,{[e]:{}})})}else this.ri(ij)}reset(){this.$h++,this.qh=!1,this.Ah={},this.Fh={},this.Lh=!1,this.Nh=!1,this.jh=!1,this.$anon_distinct_id=void 0,this.nd(),this.Ph=!1,this.Hh=0}}},aV=y({productTours:class{get yo(){return this._instance.persistence}constructor(e){this.Lv=null,this.Dv=null,this._instance=e}initialize(){this.loadIfEnabled()}onRemoteConfig(e){if(e.ok){var t,i,s=e.config;if("productTours"in s){if(this.yo&&this.yo.register({[im]:!!s.productTours}),!an(this._instance))return!this.Lv&&J(null==(t=this.yo)?void 0:t.props[iW])||ar.info("product tours disabled; stopping and clearing cached tours"),null==(i=this.Lv)||i.stop(),this.Lv=null,void this.clearCache();this.loadIfEnabled()}}}loadIfEnabled(){!this.Lv&&an(this._instance)&&this.Zs(()=>this.$v())}Zs(e){var t,i;null!=(t=g.__PosthogExtensions__)&&t.generateProductTours?e():null==(i=g.__PosthogExtensions__)||null==i.loadExternalDependency||i.loadExternalDependency(this._instance,"product-tours",t=>{t?ar.error("Could not load product tours script",t):e()})}$v(){var e;!this.Lv&&null!=(e=g.__PosthogExtensions__)&&e.generateProductTours&&(this.Lv=g.__PosthogExtensions__.generateProductTours(this._instance,!0))}getProductTours(e,t){if(void 0===t&&(t=!1),!B(this.Dv)||t){var i=this.yo;if(i){var s=i.props[iW];if(B(s)&&!t)return this.Dv=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:t=>{if(an(this._instance)){var s=t.statusCode;if(200!==s||!t.json){var r="Product Tours API could not be loaded, status: "+s;return 0===s?t.error||ar.warn(r):ar.error(r),void e([],{isLoaded:!1,error:r})}var n=B(t.json.product_tours)?t.json.product_tours:[];this.Dv=n,i&&i.register({[iW]:n}),e(n,{isLoaded:!0})}else e([],{isLoaded:!0})}})}else e(this.Dv,{isLoaded:!0})}getActiveProductTours(e){J(this.Lv)?e([],{isLoaded:!1,error:"Product tours not loaded"}):this.Lv.getActiveProductTours(e)}showProductTour(e){var t;null==(t=this.Lv)||t.showTourById(e)}previewTour(e){this.Lv?this.Lv.previewTour(e):this.Zs(()=>{var t;this.$v(),null==(t=this.Lv)||t.previewTour(e)})}dismissProductTour(){var e;null==(e=this.Lv)||e.dismissTour("user_clicked_skip")}nextStep(){var e;null==(e=this.Lv)||e.nextStep()}previousStep(){var e;null==(e=this.Lv)||e.previousStep()}clearCache(){var e;this.Dv=null,null==(e=this.yo)||e.unregister(iW)}resetTour(e){var t;null==(t=this.Lv)||t.resetTour(e)}resetAllTours(){var e;null==(e=this.Lv)||e.resetAllTours()}cancelPendingTour(e){var t;null==(t=this.Lv)||t.cancelPendingTour(e)}}},az),aW=y({surveys:class extends ad{constructor(e){var t;super(new am(e),{get projectToken(){return t.config.token},kv:new a_(t=e)}),this._instance=e}du(e,t){var i=t.query?nY(e,t.query):e;return new Promise(e=>{var s;this._instance._send_request({method:t.method,url:this._instance.requestRouter.endpointFor(null!==(s=t.target)&&void 0!==s?s:"api",i),data:t.body,headers:t.headers,timeout:t.timeoutMs,fireCallbackOnDrop:!0,transport:t.transport,compression:t.compression,timestampMode:t.sentAt,callback:e})})}}},az),aG=y({experiments:aM},az),aY=y({},az,{sessionRecording:class{get vn(){return this._instance.config}get yo(){return this._instance.persistence}get started(){var e;return!(null==(e=this.kd)||!e.isStarted)}get status(){var e,t;return this.Sd===o9||this.Sd===o7?this.Sd:null!==(e=null==(t=this.kd)?void 0:t.status)&&void 0!==e?e:this.Sd}constructor(e){if(this._forceAllowLocalhostNetworkCapture=!1,this.Sd=o4,this.xd=void 0,this.Cd=!1,this.Dt=(()=>
1{if(null==o||!o.visibilityState||"visible"===o.visibilityState)return!0;var e,t=null==s||null==(e=s.performance)||null==e.getEntriesByType?void 0:e.getEntriesByType("visibility-state");return!(null!=t&&t.length)||t.some(e=>"visible"===e.name)})(),this.$t=()=>{var e;"visible"===(null==o?void 0:o.visibilityState)&&(this.Dt=!0,null==(e=this.kd)||null==e.setDocumentWasEverVisible||e.setDocumentWasEverVisible(!0))},this._instance=e,!this._instance.sessionManager)throw at.error("started without valid sessionManager"),Error(ae+" started without valid sessionManager. This is a bug.");if(this.vn.cookieless_mode===st)throw Error(ae+' cannot be used with cookieless_mode="always"');null!=o&&o.addEventListener&&sy(o,"visibilitychange",this.$t)}initialize(){this.startIfEnabledOrStop()}dispose(){this.Cd=!0,null==o||null==o.removeEventListener||o.removeEventListener("visibilitychange",this.$t),this.stopRecording()}get Td(){var e,t=!(null==(e=this._instance.get_property(iw))||!e.enabled),i=!this.vn.disable_session_recording,r=this.vn.disable_session_recording||this._instance.consent.isOptedOut();return s&&t&&i&&!r}startIfEnabledOrStop(e){var t;if(!(this.Cd||this.Td&&null!=(t=this.kd)&&t.isStarted)){var i=!V(Object.assign)&&!V(Array.from);this.Td&&i?(this.Md(e),at.info("starting")):(this.Sd=o4,this.stopRecording())}}Md(e){var t,i,s;this.Td&&(this.Sd!==o9&&this.Sd!==o7&&(this.Sd=o8),null!=g&&null!=(t=g.__PosthogExtensions__)&&null!=(t=t.rrweb)&&t.record&&null!=(i=g.__PosthogExtensions__)&&i.initSessionRecording?this.Ed(e):null==(s=g.__PosthogExtensions__)||null==s.loadExternalDependency||s.loadExternalDependency(this._instance,this.Id,t=>{if(t)return this._instance.register_for_session({[i9]:!0}),at.error("could not load recorder",t);this.Ed(e)}))}stopRecording(){var e,t;null==(e=this.xd)||e.call(this),this.xd=void 0,null==(t=this.kd)||t.stop()}Rd(){var e,t;null==(e=this.xd)||e.call(this),this.xd=void 0,null==(t=this.kd)||t.discard()}Pd(){var e,t;null==(e=this.yo)||e.unregister(iF),null==(t=this.yo)||t.unregister(ix)}Ad(e,t){if(J(e))return null;var i=K(e)?e:parseFloat(e);return"number"!=typeof i||!Number.isFinite(i)||0>i||i>1?(at.warn(t+" must be between 0 and 1. Ignoring invalid value:",e),null):i}Fd(e){if(this.yo){var t,i,s=this.yo,r=()=>{var t,i=!1===e.sessionRecording?void 0:e.sessionRecording,r=this.Ad(null==(t=this.vn.session_recording)?void 0:t.sampleRate,"session_recording.sampleRate"),n=this.Ad(null==i?void 0:i.sampleRate,"remote config sampleRate"),o=null!=r?r:n;J(o)&&this.Pd();var a=null==i?void 0:i.minimumDurationMilliseconds;s.register({[iw]:y({cache_timestamp:Date.now(),enabled:!!i},i,{networkPayloadCapture:y({capturePerformance:e.capturePerformance},null==i?void 0:i.networkPayloadCapture),canvasRecording:{enabled:null==i?void 0:i.recordCanvas,fps:null==i?void 0:i.canvasFps,quality:null==i?void 0:i.canvasQuality},sampleRate:o,minimumDurationMilliseconds:V(a)?null:a,endpoint:null==i?void 0:i.endpoint,triggerMatchType:null==i?void 0:i.triggerMatchType,masking:null==i?void 0:i.masking,urlTriggers:null==i?void 0:i.urlTriggers,version:null==i?void 0:i.version,triggerGroups:null==i?void 0:i.triggerGroups})})};r(),null==(t=this.xd)||t.call(this),this.xd=null==(i=this._instance.sessionManager)?void 0:i.onSessionId(r)}}onRemoteConfig(e){var t=e.ok?e.config:void 0;return t&&"sessionRecording"in t?!1===t.sessionRecording?(this.Fd(t),void this.Rd()):(this.Fd(t),void this.startIfEnabledOrStop()):(this.Sd===o9&&(this.Sd=o7,at.warn("config refresh failed, recording will not start until page reload")),void this.startIfEnabledOrStop())}log(e,t){var i;void 0===t&&(t="log"),null!=(i=this.kd)&&i.log?this.kd.log(e,t):at.warn("log called before recorder was ready")}get Id(){var e,t,i=null==(e=this._instance)||null==(e=e.persistence)?void 0:e.get_property(iw);return(null==i||null==(t=i.scriptConfig)?void 0:t.script)||"lazy-recorder"}Od(){var e,t=this._instance.get_property(iw);if(!t)return!1;try{e="object"==typeof t?t:JSON.parse(t)}catch(e){return at.warn("persisted remote config for session recording is invalid and will be ignored",e),!1}return!J(e.cache_timestamp)&&36e5>=Date.now()-e.cache_timestamp}Ed(e){var t,i,s,r;if(!this.Cd){if(null==(t=g.__PosthogExtensions__)||!t.initSessionRecording)return at.warn("Called on script loaded before session recording is available. This can be caused by adblockers."),void this._instance.register_for_session({[i9]:!0});if(this.kd||(this.kd=null==(r=g.__PosthogExtensions__)?void 0:r.initSessionRecording(this._instance,this.Dt),this.kd._forceAllowLocalhostNetworkCapture=this._forceAllowLocalhostNetworkCapture),!this.Od()){if(this.Sd===o7||this.Sd===o9)return;return this.Sd=o9,at.info("persisted remote config is stale, requesting fresh config before starting"),void new nd(this._instance).load()}this.Sd=o8,null==(i=(s=this.kd).setDocumentWasEverVisible)||i.call(s,this.Dt),this.kd.start(e)}}onRRwebEmit(e){var t;null==(t=this.kd)||null==t.onRRwebEmit||t.onRRwebEmit(e)}overrideLinkedFlag(){var e,t;this.kd||null==(t=this.yo)||t.register({[iE]:!0}),null==(e=this.kd)||e.overrideLinkedFlag()}overrideSampling(){var e,t;this.kd||null==(t=this.yo)||t.register({[ik]:!0}),null==(e=this.kd)||e.overrideSampling()}overrideTrigger(e){var t,i;this.kd||null==(i=this.yo)||i.register({["url"===e?iS:iP]:!0}),null==(t=this.kd)||t.overrideTrigger(e)}get sdkDebugProperties(){var e;return(null==(e=this.kd)?void 0:e.sdkDebugProperties)||{$recording_status:this.status}}tryAddCustomEvent(e,t){var i;return!(null==(i=this.kd)||!i.tryAddCustomEvent(e,t))}}},{autocapture:class extends oJ{constructor(e){super(new oK(e)),this.instance=e}},historyAutocapture:class{constructor(e){this._instance=e,this.Ld=this.Dd()}initialize(){this.startIfEnabled()}get isEnabled(){var e=this.$d();return!!(e.path||e.search||this.Nd(e))}startIfEnabled(){this.isEnabled&&(t4.info("History API monitoring enabled, starting..."),this.monitorHistoryChanges())}startIfEnabledOrStop(){this.stop(),this.Ld=this.Dd(),this.startIfEnabled()}stop(){this.qd&&this.qd(),this.qd=void 0,this.jd&&this.jd(),this.jd=void 0,t4.info("History API monitoring stopped")}monitorHistoryChanges(){s&&s.history&&(this.Bd("pushState"),this.Bd("replaceState"),this.Hd(),this.Nd()&&this.zd())}Bd(e){var t;if(s&&(null==(t=s.history[e])||!t.__posthog_wrapped__)){var i=this;o0(s.history,e,t=>
vendor: 8,644 bytes, line 1
1function(s,r,n){t.call(this,s,r,n),i.Ud(e)})}}Dd(){var e=null==s?void 0:s.location;if(null!=e&&e.pathname)return{pathname:e.pathname,search:e.search,hash:e.hash}}$d(){var e=this._instance.config.capture_pageview;return"history_change"===e?{path:!0}:U(e)?e:{}}Nd(e){return void 0===e&&(e=this.$d()),!!e.hash&&!this._instance.config.disable_capture_url_hashes}Wd(e){var t=this.$d(),i=this.Ld;return!(!i||!(t.path&&e.pathname!==i.pathname||t.search&&e.search!==i.search||this.Nd(t)&&e.hash!==i.hash))}Ud(e){try{var t=this.Dd();if(!t)return;this.Wd(t)&&this._instance.capture(sa,{navigation_type:e}),this.Ld=t}catch(t){t4.error("Error capturing "+e+" pageview",t)}}Hd(){if(!this.qd){var e=()=>{this.Ud("popstate")};sy(s,"popstate",e),this.qd=()=>{s&&s.removeEventListener("popstate",e)}}}zd(){if(!this.jd){var e=()=>{this.Ud("hashchange")};sy(s,"hashchange",e),this.jd=()=>{s&&s.removeEventListener("hashchange",e)}}}},heatmaps:class{get vn(){return this.instance.config}constructor(e){var t;this.Vd=!1,this.Ts=!1,this.Gd=null,this.instance=e,this.Vd=!(null==(t=this.instance.persistence)||!t.props[ic]),this.rageclicks=new oV(e.config.rageclick)}initialize(){this.startIfEnabled()}get flushIntervalMilliseconds(){var e=5e3;return U(this.vn.capture_heatmaps)&&this.vn.capture_heatmaps.flush_interval_milliseconds&&(e=this.vn.capture_heatmaps.flush_interval_milliseconds),e}get isEnabled(){return J(this.vn.capture_heatmaps)?J(this.vn.enable_heatmaps)?this.Vd:this.vn.enable_heatmaps:!1!==this.vn.capture_heatmaps}startIfEnabled(){if(this.isEnabled)this.Ts||(ai.info("starting..."),this.Zd(),this.$t());else{var e;clearInterval(null!==(e=this.Gd)&&void 0!==e?e:void 0),this.Qd(),this.getAndClearBuffer()}}onRemoteConfig(e){if(e.ok){var t=e.config;if("heatmaps"in t){var i=!!t.heatmaps;this.instance.persistence&&this.instance.persistence.register({[ic]:i}),this.Vd=i,this.startIfEnabled()}}}getAndClearBuffer(){var e=this.At;return this.At=void 0,e}Jd(e){as(e.originalEvent)&&this.Qi(e.originalEvent,"deadclick")}$t(){this.Gd&&clearInterval(this.Gd),this.Gd="visible"===(null==o?void 0:o.visibilityState)?setInterval(this.oo.bind(this),this.flushIntervalMilliseconds):null}Zd(){s&&o&&(this.Kd=this.oo.bind(this),sy(s,so,this.Kd),this.Yd=e=>this.Qi(e||(null==s?void 0:s.event)),sy(o,"click",this.Yd,{capture:!0}),this.Xd=e=>this.tv(e||(null==s?void 0:s.event)),sy(o,"mousemove",this.Xd,{capture:!0}),this.ev=new rI(this.instance,rS,this.Jd.bind(this)),this.ev.startIfEnabledOrStop(),this.iv=this.$t.bind(this),sy(o,sn,this.iv),this.Ts=!0)}Qd(){var e;s&&o&&(this.Kd&&s.removeEventListener(so,this.Kd),this.Yd&&o.removeEventListener("click",this.Yd,{capture:!0}),this.Xd&&o.removeEventListener("mousemove",this.Xd,{capture:!0}),this.iv&&o.removeEventListener(sn,this.iv),clearTimeout(this.rv),null==(e=this.ev)||e.stop(),this.Ts=!1)}nv(e,t){var i=this.instance.scrollManager.scrollY(),r=this.instance.scrollManager.scrollX(),n=this.instance.scrollManager.scrollElement(),o=function(e,t,i){for(var r=e;r&&s1(r)&&!s2(r,"body")&&r!==i;){var n,o,a,l=void 0;try{l=null==(n=null!==(o=null==(a=r.ownerDocument)?void 0:a.defaultView)&&void 0!==o?o:s)?void 0:n.getComputedStyle(r).position}catch(e){break}if(L(t,l))return!0;r=rs(r)}return!1}(re(e),["fixed","sticky"],n);return{x:e.clientX+(o?0:r),y:e.clientY+(o?0:i),target_fixed:o,type:t}}Qi(e,t){var i;if(void 0===t&&(t="click"),!s0(e.target)&&as(e)){var s=this.nv(e,t);null!=(i=this.rageclicks)&&i.isRageClick(e.clientX,e.clientY,(new Date).getTime())&&rh(re(e),this.instance.config.rageclick)&&this.fs(y({},s,{type:"rageclick"})),this.fs(s)}}tv(e){!s0(e.target)&&as(e)&&(clearTimeout(this.rv),this.rv=setTimeout(()=>{this.fs(this.nv(e,"mousemove"))},500))}fs(e){if(s){var t=this.vn.disable_capture_url_hashes?tl(s.location.href):s.location.href,i=this.vn.custom_personal_data_properties,r=rq(t,this.vn.mask_personal_data_properties?[...rV,...i||[]]:[],rG);this.At=this.At||{},this.At[r]||(this.At[r]=[]),this.At[r].push(e)}}oo(){this.At&&!z(this.At)&&this.instance.capture("$$heatmap",{$heatmap_data:this.getAndClearBuffer()})}},deadClicksAutocapture:rI,webVitalsAutocapture:class{constructor(e){var t;this.Vd=!1,this.Ts=!1,this.At={navigationKey:void 0,url:void 0,metrics:[],firstMetricTimestamp:void 0},this.sv=()=>{clearTimeout(this.av),this.av=void 0,0!==this.At.metrics.length&&(this._instance.capture("$web_vitals",y({$current_url:this.At.url},this.At.metrics.reduce((e,t)=>y({},e,{["$web_vitals_"+t.name+"_event"]:y({},t),["$web_vitals_"+t.name+"_value"]:t.value}),{}))),this.At={navigationKey:void 0,url:void 0,metrics:[],firstMetricTimestamp:void 0})},this.ov=e=>{var t;if(this.At=this.At||{navigationKey:void 0,url:void 0,metrics:[],firstMetricTimestamp:void 0},J(null==e?void 0:e.name)||J(null==e?void 0:e.value))o2.error("Invalid metric received",e);else{var i="string"==typeof e.navigationURL?e.navigationURL:void 0,s=this.lv(i);if(!V(s)){var r=K(e.navigationId)||"string"==typeof e.navigationId?"navigation:"+e.navigationId:"url:"+s;if(!this.uv||this.uv>e.value){this.At.navigationKey!==r&&(this.sv(),this.av=setTimeout(this.sv,this.flushToCaptureTimeoutMs)),V(this.At.navigationKey)&&(this.At.navigationKey=r,this.At.url=s),this.At.firstMetricTimestamp=V(this.At.firstMetricTimestamp)?Date.now():this.At.firstMetricTimestamp;var n=null==(t=this._instance.sessionManager)?void 0:t.checkAndGetSessionAndWindowId(!0),o=y({},e,i?{navigationURL:s}:{},{$current_url:s,timestamp:Date.now()});if(delete o.entries,U(e.attribution)&&this.attributionMetrics.indexOf(e.name)>-1){var a={};for(var l of o6){var u="url"===l&&"string"==typeof e.attribution[l]?this.lv(e.attribution[l]):e.attribution[l];V(u)||(a[l]=u)}o.attribution=a}else delete o.attribution;V(n)||(o.$session_id=n.sessionId,o.$window_id=n.windowId),this.At.metrics.push(o),this.At.metrics.length===this.allowedMetrics.length&&this.sv()}else o2.error("Ignoring metric with value >= "+this.uv,e)}}},this.hv=()=>{if(!this.Ts){var e,t,i,s,r=!1,n=g.__PosthogExtensions__,o=null==n?void 0:n.postHogWebVitalsCallbacksByFlavor,a=(null==o?void 0:o[this.dv])||("web-vitals"===this.dv&&V(o)?null==n?void 0:n.postHogWebVitalsCallbacks:void 0);if(!V(a)){var l=a.withoutAttribution,u=this.attributionMetrics;r=!V(l),e=u.indexOf("LCP")>-1?a.onLCP:(null==l?void 0:l.onLCP)||a.onLCP,t=u.indexOf("CLS")>-1?a.onCLS:(null==l?void 0:l.onCLS)||a.onCLS,i=u.indexOf("FCP")>-1?a.onFCP:(null==l?void 0:l.onFCP)||a.onFCP,s=u.indexOf("INP")>-1?a.onINP:(null==l?void 0:l.onINP)||a.onINP}if(e&&t&&i&&s){var h={reportSoftNavs:this.useSoftNavs},c=r&&this.attributionMetrics.indexOf("INP")>-1?y({},h,{includeProcessedEventEntries:!1}):h;this.allowedMetrics.indexOf("LCP")>-1&&e(this.ov.bind(this),h),this.allowedMetrics.indexOf("CLS")>-1&&t(this.ov.bind(this),h),this.allowedMetrics.indexOf("FCP")>-1&&i(this.ov.bind(this),h),this.allowedMetrics.indexOf("INP")>-1&&s(this.ov.bind(this),c),this.Ts=!0}else o2.error("web vitals callbacks not loaded - not starting")}},this._instance=e,this.Vd=!(null==(t=this._instance.persistence)||!t.props[ig]),this.startIfEnabled()}get vv(){return this._instance.config.capture_performance}get allowedMetrics(){var e,t,i=U(this.vv)?null==(e=this.vv)?void 0:e.web_vitals_allowed_metrics:void 0;return J(i)?(null==(t=this._instance.persistence)?void 0:t.props[ib])||o3:i}get flushToCaptureTimeoutMs(){return(U(this.vv)?this.vv.web_vitals_delayed_flush_ms:void 0)||5e3}get attributionMetrics(){var e=U(this.vv)?this.vv.web_vitals_attribution:void 0;return X(e)?e?o3:[]:B(e)?e:o5}get useAttribution(){return this.attributionMetrics.length>0}get useSoftNavs(){var e=U(this.vv)?this.vv.__preview_web_vitals_soft_navs:void 0;return null!=e&&e}get uv(){var e=U(this.vv)&&K(this.vv.__web_vitals_max_value)?this.vv.__web_vitals_max_value:9e5;return e>0&&6e4>=e?9e5:e}get isEnabled(){var e=null==a?void 0:a.protocol;if("http:"!==e&&"https:"!==e)return o2.info("Web Vitals are disabled on non-http/https protocols"),!1;var t=U(this.vv)?this.vv.web_vitals:X(this.vv)?this.vv:void 0;return X(t)?t:this.Vd}startIfEnabled(){this.isEnabled&&!this.Ts&&(o2.info("enabled, starting..."),this.Zs(this.hv))}onRemoteConfig(e){if(e.ok){var t=e.config;if("capturePerformance"in t){var i=U(t.capturePerformance)&&!!t.capturePerformance.web_vitals,s=U(t.capturePerformance)?t.capturePerformance.web_vitals_allowed_metrics:void 0;this._instance.persistence&&(this._instance.persistence.register({[ig]:i}),this._instance.persistence.register({[ib]:s})),this.Vd=i,this.startIfEnabled()}}}get dv(){return this.useSoftNavs?this.useAttribution?"web-vitals-with-attribution-soft-navs":"web-vitals-soft-navs":this.useAttribution?"web-vitals-with-attribution":"web-vitals"}
1Zs(e){var t=g.__PosthogExtensions__,i=this.dv,s=null==t?void 0:t.postHogWebVitalsCallbacksByFlavor;null!=s&&s[i]||"web-vitals"===i&&V(s)&&null!=t&&t.postHogWebVitalsCallbacks?e():null==t||null==t.loadExternalDependency||t.loadExternalDependency(this._instance,i,t=>{t?o2.error("failed to load script",t):e()})}lv(e){var t=e||(null==s?void 0:s.location.href);if(t){var i=this._instance.config.disable_capture_url_hashes?tl(t):t,r=this._instance.config.custom_personal_data_properties;return rq(i,this._instance.config.mask_personal_data_properties?[...rV,...r||[]]:[],rG)}o2.error("Could not determine current URL")}}},{exceptionObserver:class{constructor(e){var t;this.hv=()=>{var e;if(s&&this.isEnabled&&null!=(e=g.__PosthogExtensions__)&&e.errorWrappingFunctions){var t=g.__PosthogExtensions__.errorWrappingFunctions.wrapOnError,i=g.__PosthogExtensions__.errorWrappingFunctions.wrapUnhandledRejection,r=g.__PosthogExtensions__.errorWrappingFunctions.wrapConsoleError;try{!this.fv&&this.vn.capture_unhandled_errors&&(this.fv=t(this.captureException.bind(this))),!this.pv&&this.vn.capture_unhandled_rejections&&(this.pv=i(this.captureException.bind(this))),!this.gv&&this.vn.capture_console_errors&&(this.gv=r(this.captureException.bind(this)))}catch(e){oZ.error("failed to start",e),this.mv()}}},this._instance=e,this.yv=!(null==(t=this._instance.persistence)||!t.props[id]),this.de=new ec(y({},function(e){var t,i,s,r;return void 0===e&&(e={}),{refillRate:null!==(t=null!==(i=e.exceptionRateLimiterRefillRate)&&void 0!==i?i:e.__exceptionRateLimiterRefillRate)&&void 0!==t?t:1,bucketSize:null!==(s=null!==(r=e.exceptionRateLimiterBucketSize)&&void 0!==r?r:e.__exceptionRateLimiterBucketSize)&&void 0!==s?s:10}}(this._instance.config.error_tracking),{refillInterval:1e4,I:oZ})),this.vn=this.bv(),this.startIfEnabledOrStop()}bv(){var e=this._instance.config.capture_exceptions,t={capture_unhandled_errors:!1,capture_unhandled_rejections:!1,capture_console_errors:!1};return U(e)?t=y({},t,e):(V(e)?this.yv:e)&&(t=y({},t,{capture_unhandled_errors:!0,capture_unhandled_rejections:!0})),t}get isEnabled(){return this.vn.capture_console_errors||this.vn.capture_unhandled_errors||this.vn.capture_unhandled_rejections}startIfEnabledOrStop(){this.isEnabled?(oZ.info("enabled"),this.mv(),this.Zs(this.hv)):this.mv()}Zs(e){var t,i;null!=(t=g.__PosthogExtensions__)&&t.errorWrappingFunctions?e():null==(i=g.__PosthogExtensions__)||null==i.loadExternalDependency||i.loadExternalDependency(this._instance,"exception-autocapture",t=>{if(t)return oZ.error("failed to load script",t);e()})}mv(){var e,t,i;null==(e=this.fv)||e.call(this),this.fv=void 0,null==(t=this.pv)||t.call(this),this.pv=void 0,null==(i=this.gv)||i.call(this),this.gv=void 0}onRemoteConfig(e){if(e.ok){var t=e.config;"autocaptureExceptions"in t&&(this.yv=!!t.autocaptureExceptions,this._instance.persistence&&this._instance.persistence.register({[id]:this.yv}),this.vn=this.bv(),this.startIfEnabledOrStop())}}onConfigChange(){this.vn=this.bv()}captureException(e){var t,i,s,r=null!==(t=null==e||null==(i=e.$exception_list)||null==(i=i[0])?void 0:i.type)&&void 0!==t?t:"Exception";this.de.consumeRateLimit(r)?oZ.info("Skipping exception capture because of client rate limiting.",{exception:r}):null==(s=this._instance.exceptions)||s.sendExceptionEvent(e)}},exceptions:class{constructor(e){var t,i;this._v=[],this.wv=new tO([new tH,new tX,new tz,new tU,new tK,new tJ,new tW,new tZ],function(e){for(var t=arguments.length,i=Array(t>1?t-1:0),s=1;t>s;s++)i[s-1]=arguments[s];return function(t,s){void 0===s&&(s=0);for(var r=[],n=t.split("\n"),o=s;n.length>o;o++){var a=n[o];if(1024>=a.length){var l=tB.test(a)?a.replace(tB,"$1"):a;if(!l.match(/\S*Error: /)){for(var u of i){var h=u(l,e);if(h){r.push(h);break}}if(r.length>=50)break}}}return function(e){if(!e.length)return[];var t=Array.from(e);return t.reverse(),t.slice(0,50).map(e=>y({},e,{filename:e.filename||(t[t.length-1]||{}).filename,function:e.function||"?"}))}(r)}}("web:javascript",tD,tq)),this._instance=e,this._v=null!==(t=null==(i=this._instance.persistence)?void 0:i.get_property(iv))&&void 0!==t?t:[],this.Sv=t3(this.xv()),this.Cv=new t5(this.Sv)}onConfigChange(){this.Sv=t3(this.xv()),this.Cv.setConfig(this.Sv)}onRemoteConfig(e){var t,i,s;if(e.ok){var r=e.config;if("errorTracking"in r){var n=null!==(t=null==(i=r.errorTracking)?void 0:i.suppressionRules)&&void 0!==t?t:[],o=null==(s=r.errorTracking)?void 0:s.captureExtensionExceptions;this._v=n,this._instance.persistence&&this._instance.persistence.register({[iv]:this._v,[ip]:o})}}}get Tv(){var e,t=!!this._instance.get_property(ip),i=this._instance.config.error_tracking.captureExtensionExceptions;return null!==(e=null!=i?i:t)&&void 0!==e&&e}buildProperties(e,t){return this.wv.buildFromUnknown(e,{syntheticException:null==t?void 0:t.syntheticException,mechanism:{handled:null==t?void 0:t.handled}})}addExceptionStep(e,t){if(this.Sv.enabled)try{if(!W(e)||0===e.trim().length)return void a$.warn("Ignoring exception step because message must be a non-empty string");var i=function(e){if(!e)return{sanitizedProperties:{},droppedKeys:[]};var t=[];return{sanitizedProperties:Object.keys(e).reduce((i,s)=>(t1.has(s)?t.push(s):i[s]=e[s],i),{}),droppedKeys:t}}(this.Mv(t)),s=i.sanitizedProperties,r=i.droppedKeys;r.length>0&&a$.warn("Ignoring reserved exception step fields",{droppedKeys:r}),this.Cv.add(y({[tQ]:e,[t0]:(new Date).toISOString()}
1,s))}catch(e){a$.error("Failed to add exception step. Ignoring breadcrumb.",e)}}sendExceptionEvent(e){try{var t,i=e.$exception_list;if(this.Ev(i)){if(this.Iv(i))return this.Rv("Exception dropped: matched a suppression rule"),void a$.info("Skipping exception capture because a suppression rule matched");if(!this.Tv&&this.Pv(i))return this.Rv("Exception dropped: thrown by a browser extension"),void a$.info("Skipping exception capture because it was thrown by an extension");if(!this.Tv&&this.Av(i))return this.Rv("Exception dropped: thrown by an injected browser script"),void a$.info("Skipping exception capture because it was thrown by an injected browser script");if(!this._instance.config.error_tracking.__capturePostHogExceptions&&this.Fv(i))return this.Rv("Exception dropped: thrown by the PostHog SDK"),void a$.info("Skipping exception capture because it was thrown by the PostHog SDK")}var s=this.Sv.enabled&&J(e.$exception_steps)?this.Ov(e):e,r="string"==typeof(t=globalThis._posthogReleaseId)&&t.length>0?t:void 0;r&&(s.$release_id=r);try{var n=this._instance.capture("$exception",s,{_noTruncate:!0,_batchKey:"exceptionEvent",jl:!0});return n&&this.Cv.clear(),n}catch(e){return a$.error("Failed to capture exception event. Dropping this exception.",e),void this.Cv.clear()}}catch(e){return void a$.error("Failed to process exception event. Ignoring this exception.",e)}}Ov(e){try{var t=this.Cv.getAttachable();return 0===t.length?e:y({},e,{$exception_steps:t})}catch(t){return a$.error("Failed to read buffered exception steps. Capturing exception without steps.",t),e}}Rv(e){this.Sv.enabled&&this.Cv.add({[tQ]:e,[t0]:(new Date).toISOString()})}Mv(e){return U(e)?y({},e):{}}xv(){var e,t;return null!==(e=null==(t=this._instance.config.error_tracking)?void 0:t.exception_steps)&&void 0!==e?e:{}}Iv(e){if(0===e.length)return!1;try{var t=e.reduce((e,t)=>{var i=t.type,s=t.value;return W(i)&&i.length>0&&e.$exception_types.push(i),W(s)&&s.length>0&&e.$exception_values.push(s),e},{$exception_types:[],$exception_values:[]});return this._v.some(e=>{var i=e.values.map(e=>{var i=ou[e.operator],s=t[e.key];if(!i||!s)return!1;var r=B(e.value)?e.value:[e.value];return r.length>0&&i(r,s)});return"OR"===e.type?i.some(Boolean):i.every(Boolean)})}catch(e){return a$.warn("Failed to evaluate suppression rules. Capturing the exception.",e),!1}}Pv(e){return e.flatMap(e=>{var t,i;return null!==(t=null==(i=e.stacktrace)?void 0:i.frames)&&void 0!==t?t:[]}).some(e=>{var t=e.filename;return!!t&&aO.some(e=>t.startsWith(e))})}Av(e){return e.some(e=>{var t=e.value;return W(t)&&aT.some(e=>t.includes(e))})}Fv(e){if(e.length>0){var t,i,s,r,n=null!==(t=null==(i=e[0].stacktrace)?void 0:i.frames)&&void 0!==t?t:[],o=n[n.length-1];return null!==(s=null==o||null==(r=o.filename)?void 0:r.includes("posthog.com/static"))&&void 0!==s&&s}return!1}Ev(e){return!J(e)&&B(e)}}},aV,{siteApps:class{constructor(e){this.Nv=0,this._instance=e,this.qv=[],this.apps={}}get isEnabled(){return!!this._instance.config.opt_in_site_apps}jv(e,t){if(t){var i=this.globalsForEvent(t);this.qv.push(i),this.qv.length>1e3&&(this.qv=this.qv.slice(10))}}get siteAppLoaders(){var e;return null==(e=g._POSTHOG_REMOTE_CONFIG)||null==(e=e[this._instance.config.token])?void 0:e.siteApps}initialize(){if(this.isEnabled){var e=this._instance._addCaptureHook(this.jv.bind(this));this.Bv=()=>{e(),this.qv=[],this.Bv=void 0}}}globalsForEvent(e){if(!e)throw Error("Event payload is required");var t,i,s,r,n,o,a,l={},u=this._instance.get_property("$groups")||[];for(var h of Object.entries(this._instance.get_property("$stored_group_properties")||{})){var c=h[0];l[c]={id:u[c],type:c,properties:h[1]}}var d=e.$set_once,v=e.$set;return{event:y({},b(e,ao),{properties:y({},e.properties,v?{$set:y({},null!==(t=null==(i=e.properties)?void 0:i.$set)&&void 0!==t?t:{},v)}:{},d?{$set_once:y({},null!==(s=null==(r=e.properties)?void 0:r.$set_once)&&void 0!==s?s:{},d)}:{}),elements_chain:null!==(n=null==(o=e.properties)?void 0:o.$elements_chain)&&void 0!==n?n:"",distinct_id:null==(a=e.properties)?void 0:a.distinct_id}),person:{properties:this._instance.get_property("$stored_person_properties")},groups:l}}Hv(e){var t,i=null==(t=e.tagName)?void 0:t.toLowerCase();return"style"===i&&this._instance.config.prepare_external_dependency_stylesheet?this._instance.config.prepare_external_dependency_stylesheet(e)||(aa.error("prepare_external_dependency_stylesheet returned null"),null):"script"===i&&this._instance.config.prepare_external_dependency_script?this._instance.config.prepare_external_dependency_script(e)||(aa.error("prepare_external_dependency_script returned null"),null):e}zv(){if(!this._instance.config.prepare_external_dependency_stylesheet&&!this._instance.config.prepare_external_dependency_script)return()=>{};var e,t,i,s,r,n,a,l,u=null==o?void 0:o.defaultView,h=null==u||null==(e=u.Node)?void 0:e.prototype;if(!u||!h)return()=>{};if(this.Nv++,this.Uv)return this.Wv();var c=[],d=this,v=new WeakSet,p=(e,t,i)=>{if(null!=e&&e[t]){var s=e[t];e[t]=i(s),c.push(()=>{e[t]=s})}},g=e=>{if(v.has(e))return e;var t=d.Hv(e);return t&&v.add(t),t},f=e=>e.map(e=>"string"==typeof e?e:g(e)).filter(e=>!Y(e));return p(h,"appendChild",e=>function(t){var i=g(t);return i?e.call(this,i):t}),p(h,"insertBefore",e=>function(t,i){var s=g(t);return s?e.call(this,s,i):t}),p(h,"replaceChild",e=>function(t,i){var s=g(t);return s?e.call(this,s,i):i}),[null==(t=u.Element)?void 0:t.prototype,null==(i=u.Document)?void 0:i.prototype,null==(s=u.DocumentFragment)?void 0:s.prototype].forEach(e
vendor: 19,109 bytes, line 1
1=>{p(e,"append",e=>function(){for(var t=arguments.length,i=Array(t),s=0;t>s;s++)i[s]=arguments[s];return e.apply(this,f(i))}),p(e,"prepend",e=>function(){for(var t=arguments.length,i=Array(t),s=0;t>s;s++)i[s]=arguments[s];return e.apply(this,f(i))})}),[null==(r=u.Element)?void 0:r.prototype,null==(n=u.CharacterData)?void 0:n.prototype,null==(a=u.DocumentType)?void 0:a.prototype].forEach(e=>{p(e,"before",e=>function(){for(var t=arguments.length,i=Array(t),s=0;t>s;s++)i[s]=arguments[s];return e.apply(this,f(i))}),p(e,"after",e=>function(){for(var t=arguments.length,i=Array(t),s=0;t>s;s++)i[s]=arguments[s];return e.apply(this,f(i))}),p(e,"replaceWith",e=>function(){for(var t=arguments.length,i=Array(t),s=0;t>s;s++)i[s]=arguments[s];var r=f(i);return i.length&&!r.length?void 0:e.apply(this,r)})}),p(null==(l=u.Element)?void 0:l.prototype,"insertAdjacentElement",e=>function(t,i){var s=g(i);return s?e.call(this,t,s):null}),this.Uv=()=>{c.forEach(e=>e()),this.Uv=void 0},this.Wv()}Wv(){var e=!1;return()=>{var t;e||(e=!0,this.Nv--,0===this.Nv&&(null==(t=this.Uv)||t.call(this)))}}Vv(e,t){void 0===t&&(t=!0);var i=this.zv();try{var s=e(i);return t&&i(),s}catch(e){throw i(),e}}setupSiteApp(e){var t=this.apps[e.id],i=()=>{var i;!t.errored&&this.qv.length&&(aa.info("Processing "+this.qv.length+" events for site app with id "+e.id),this.qv.forEach(e=>this.Vv(()=>null==t.processEvent?void 0:t.processEvent(e))),t.processedBuffer=!0),Object.values(this.apps).every(e=>e.processedBuffer||e.errored)&&(null==(i=this.Bv)||i.call(this))},s=!1,r=r=>{t.errored=!r,t.loaded=!0,aa.info("Site app with id "+e.id+" "+(r?"loaded":"errored")),s&&i()};try{var n=this.Vv(t=>e.init({posthog:this._instance,callback(e){t(),r(e)}}),!1).processEvent;n&&(t.processEvent=n),s=!0}catch(t){aa.error(al+e.id,t),r(!1)}if(s&&t.loaded)try{i()}catch(i){aa.error("Error while processing buffered events PostHog app with config id "+e.id,i),t.errored=!0}}Gv(){var e=this.siteAppLoaders||[];for(var t of e)this.apps[t.id]={id:t.id,loaded:!1,errored:!1,processedBuffer:!1};for(var i of e)this.setupSiteApp(i)}Zv(e){var t=this;if(0!==Object.keys(this.apps).length){var i=this.globalsForEvent(e),s=function(s){try{t.Vv(()=>null==s.processEvent?void 0:s.processEvent(i))}catch(t){aa.error("Error while processing event "+e.event+" for site app "+s.id,t)}};for(var r of Object.values(this.apps))s(r)}}onRemoteConfig(e){var t,i,s,r=this;if(null!=(t=this.siteAppLoaders)&&t.length)return this.isEnabled?(this.Gv(),void this._instance.on("eventCaptured",e=>this.Zv(e))):void aa.error('PostHog site apps are disabled. Enable the "opt_in_site_apps" config to proceed.');if(null==(i=this.Bv)||i.call(this),e.ok){var n=e.config;if(null!=(s=n.siteApps)&&s.length){if(this.isEnabled)for(var o of n.siteApps)!function(){var e,t=o.id,i=o.url;g["__$$ph_site_app_"+t]=r._instance,null==(e=g.__PosthogExtensions__)||null==e.loadSiteApp||e.loadSiteApp(r._instance,i,e=>{if(e)return aa.error(al+t,e)})}();else aa.error('PostHog site apps are disabled. Enable the "opt_in_site_apps" config to proceed.')}}}}},aW,{tracingHeaders:class{constructor(e){this.Qv=void 0,this.Jv=void 0,this.Kv=void 0,this.hv=()=>{var e,t,i=this.Yv();i?(V(this.Qv)&&(this.Qv=null==(e=g.__PosthogExtensions__)||null==(e=e.tracingHeadersPatchFns)?void 0:e._patchXHR(i,()=>this._instance.get_distinct_id(),this._instance.sessionManager)),V(this.Jv)&&(this.Jv=null==(t=g.__PosthogExtensions__)||null==(t=t.tracingHeadersPatchFns)?void 0:t._patchFetch(i,()=>this._instance.get_distinct_id(),this._instance.sessionManager))):this.mv()},this._instance=e}initialize(){this.startIfEnabledOrStop()}Zs(e){var t,i;null!=(t=g.__PosthogExtensions__)&&t.tracingHeadersPatchFns?e():null==(i=g.__PosthogExtensions__)||null==i.loadExternalDependency||i.loadExternalDependency(this._instance,"tracing-headers",t=>{if(t)return o1.error("failed to load script",t);e()})}Xv(){var e,t;return null!==(e=null!==(t=this._instance.config.tracing_headers)&&void 0!==t?t:this._instance.config.addTracingHeaders)&&void 0!==e?e:this._instance.config.__add_tracing_headers}Yv(){var e=this.Xv();return B(e)?(B(this.Kv)?this.Kv.splice(0,this.Kv.length,...e):this.Kv=[...e],e.length>0?this.Kv:void 0):(B(this.Kv)&&this.Kv.splice(0),this.Kv=e||void 0,this.Kv)}mv(){var e,t;null==(e=this.Qv)||e.call(this),null==(t=this.Jv)||t.call(this),this.Qv=void 0,this.Jv=void 0}startIfEnabledOrStop(){this.Yv()?this.Zs(this.hv):this.mv()}}},{toolbar:class{constructor(e){this.instance=e}tc(e){g.ph_toolbar_state=e}ec(){var e;return null!==(e=g.ph_toolbar_state)&&void 0!==e?e:0}initialize(){return this.maybeLoadToolbar()}maybeLoadToolbar(e,t,i){if(void 0===e&&(e=void 0),void 0===t&&(t=void 0),void 0===i&&(i=void 0),sb(this.instance.config)||!s||!o)return!1;e=null!=e?e:s.location,i=null!=i?i:s.history;try{if(!t){try{s.localStorage.setItem("test","test"),s.localStorage.removeItem("test")}catch(e){return!1}t=null==s?void 0:s.localStorage}var r,n=ay||rB(e.hash,"__posthog")||rB(e.hash,"state"),a=n?sg(()=>JSON.parse(atob(decodeURIComponent(n))))||sg(()=>JSON.parse(decodeURIComponent(n))):null;return a&&"ph_authorize"===a.action?((r=a).source="url",r&&Object.keys(r).length>0&&(a.desiredHash?e.hash=a.desiredHash:i?i.replaceState(i.state,"",e.pathname+e.search):e.hash="")):((r=JSON.parse(t.getItem(ab)||"{}")).source="localstorage",delete r.userIntent),!(!r.token||this.instance.config.token!==r.token||(this.loadToolbar(r),0))}catch(e){return!1}}ic(e){var t=g.ph_load_toolbar||g.ph_load_editor;!J(t)&&H(t)?t(e,this.instance):aw.warn("No toolbar load function found")}loadToolbar(e){var t,i=!(null==o||!o.getElementById(sQ));if(!s||i)return!1;var r="custom"===this.instance.requestRouter.region&&this.instance.config.advanced_disable_toolbar_metrics,n=y({token:this.instance.config.token},e,{apiURL:this.instance.requestRouter.endpointFor("ui")},r?{instrument:!1}:{});return(s.localStorage.setItem(ab,JSON.stringify(y({},n,{source:void 0}))),2===this.ec())?this.ic(n):0===this.ec()&&(this.tc(1),null==(t=g.__PosthogExtensions__)||null==t.loadExternalDependency||t.loadExternalDependency(this.instance,"toolbar",e=>{if(e)return aw.error("[Toolbar] Failed to load",e),void this.tc(0);this.tc(2),this.ic(n)}),sy(s,"turbolinks:load",()=>{this.tc(0),this.loadToolbar(n)})),!0}rc(e){return this.loadToolbar(e)}maybeLoadEditor(e,t,i){return void 0===e&&(e=void 0),void 0===t&&(t=void 0),void 0===i&&(i=void 0),this.maybeLoadToolbar(e,t,i)}}},aG,{conversations:class{constructor(e){this.nc=void 0,this._conversationsManager=null,this.sc=!1,this.Fe=null,this.ac=!1,this._instance=e}initialize(){this.loadIfEnabled()}onRemoteConfig(e){if(!this._instance.config.disable_conversations&&(this.oc=e.ok,e.ok)){var t=e.config.conversations;J(t)||(X(t)?this.nc=t:(this.nc=t.enabled,this.Fe=t),this.loadIfEnabled())}}reset(){var e;null==(e=this._conversationsManager)||e.reset(),this._conversationsManager=null,this.nc=void 0,this.Fe=null,this.oc=void 0,this.ac=!1}loadIfEnabled(){if(!(this._conversationsManager||this.sc||this._instance.config.disable_conversations||sb(this._instance.config)||this._instance.config.cookieless_mode&&this._instance.consent.isOptedOut())){var e=null==g?void 0:g.__PosthogExtensions__;if(e&&!V(this.nc)&&this.nc){if(this.Fe&&this.Fe.token){this.sc=!0;try{var t=e.initConversations;if(t)return this.lc(t),void(this.sc=!1);var i=e.loadExternalDependency;if(!i)return void this.uc(i7);i(this._instance,"conversations",t=>{t||!e.initConversations?this.uc("Could not load conversations script",t):this.lc(e.initConversations),this.sc=!1})}catch(e){this.uc("Error initializing conversations",e),this.sc=!1}}else aA.error("Conversations enabled but missing token in remote config.")}}}lc(e){if(this.Fe)try{this._conversationsManager=e(this.Fe,this._instance),this.ac=!1,aA.info("Conversations loaded successfully")}catch(e){this.uc("Error completing conversations initialization",e)}else aA.error("Cannot complete initialization: remote config is null")}uc(e,t){aA.error(e,t),this._conversationsManager=null,this.sc=!1,this.ac=!0}show(){this._conversationsManager?this._conversationsManager.show():aA.warn("Conversations not loaded yet.")}hide(){this._conversationsManager&&this._conversationsManager.hide()}isAvailable(){return!0===this.nc&&!Y(this._conversationsManager)}getUnavailableReason(){return this.isAvailable()?null:this._instance.config.disable_conversations?"disabled_by_config":sb(this._instance.config)?"disabled_for_toolbar":this._instance.config.cookieless_mode&&this._instance.consent.isOptedOut()?"consent_opted_out":!1===this.oc?"remote_config_failed":V(this.nc)?this.oc?"disabled_in_project":"remote_config_pending":this.nc?J(this.Fe)||!this.Fe.token?"missing_token":null!=g&&g.__PosthogExtensions__?this.sc?"initializing":this.ac?"load_failed":"not_loaded":"extensions_unavailable":"disabled_in_project"}isVisible(){var e,t;return null!==(e=null==(t=this._conversationsManager)?void 0:t.isVisible())&&void 0!==e&&e}sendMessage(e,t,i){var s=this;return m(function*(){return s._conversationsManager?s._conversationsManager.sendMessage(e,t,i):(aA.warn(aD),null)})()}getMessages(e,t){var i=this;return m(function*(){return i._conversationsManager?i._conversationsManager.getMessages(e,t):(aA.warn(aD),null)})()}markAsRead(e){var t=this;return m(function*(){return t._conversationsManager?t._conversationsManager.markAsRead(e):(aA.warn(aD),null)})()}getTickets(e){var t=this;return m(function*(){return t._conversationsManager?t._conversationsManager.getTickets(e):(aA.warn(aD),null)})()}requestRestoreLink(e){var t=this;return m(function*(){return t._conversationsManager?t._conversationsManager.requestRestoreLink(e):(aA.warn(aD),null)})()}restoreFromToken(e){var t=this;return m(function*(){return t._conversationsManager?t._conversationsManager.restoreFromToken(e):(aA.warn(aD),null)})()}restoreFromUrlToken(){var e=this;return m(function*(){return e._conversationsManager?e._conversationsManager.restoreFromUrlToken():(aA.warn(aD),null)})()}getCurrentTicketId(){var e,t;return null!==(e=null==(t=this._conversationsManager)?void 0:t.getCurrentTicketId())&&void 0!==e?e:null}getWidgetSessionId(){var e,t;return null!==(e=null==(t=this._conversationsManager)?void 0:t.getWidgetSessionId())&&void 0!==e?e:null}Ql(){var e;null==(e=this._conversationsManager)||e.setIdentity()}Jl(){var e;null==(e=this._conversationsManager)||e.clearIdentity()}}},{logs:class{constructor(e){var t,i=this;this.name="logs",this.hc=!1,this.dc=!1,this.vc=!1,this.I=t8("[logs]"),this.cc=y({},this.I,{error(){for(var e=arguments.length,t=Array(e),s=0;e>s;s++)t[s]=arguments[s];t.some(aU)||i.I.error(...t)}}),this.Za=[],this.fc=[],this.Hh=0,this.Rs=!1,this.gc=[],this.mc=[],this.yc=!1,this.bc=!1,this._c=()=>{var e,t;this.Rs||(this.Hh=0,null==(e=this.wc)||e.onReconnect(),null==(t=this.kc)||t.onReconnect())},this._instance=e,this._instance&&null!=(t=this._instance.config.logs)&&t.captureConsoleLogs&&(this.hc=!0),s&&sy(s,"online",this._c)}Sc(e,t,i,s){var r,n=aN(null==(r=this._instance)||null==(r=r.config)?void 0:r.logs,i);return[new tP(this.xc(e,t),n,this.cc,()=>this.Cc(),e=>e(),void 0,s),n]}Tc(){var e,t=null==(e=this._instance)||null==(e=e.config)?void 0:e.logs;if(!this.wc||this.Mc!==t){null==(i=this.wc)||i.reset(),this.Mc=t;var i,s=this.Sc(()=>this.Za,e=>{this.Za=e});this.wc=s[0],this.Ec=s[1]}return this.wc}Ic(){var e,t=null==(e=this._instance)||null==(e=e.config)?void 0:e.logs;if(!this.kc||this.Rc!==t){null==(i=this.kc)||i.reset(),this.Rc=t;var i,s=this.Sc(()=>this.fc,e=>{this.fc=e},{serviceNameDefault:"posthog-browser-logs",consoleCapture:!0},aq);this.kc=s[0],this.Pc=s[1]}return this.kc}setup(e){var t;if(!this.Rs){this.Os=e,null!=(t=this._instance)&&null!=(t=t.config)&&null!=(t=t.logs)&&t.captureConsoleLogs&&(this.hc=!0),(this.hc||this.Ac()&&this.Fc())&&this.Oc();var i=!1,s=e.onRemoteConfig(e=>{var t;i=e.ok&&!0===(null==(t=e.config.logs)?void 0:t.captureConsoleLogs),this.onRemoteConfig(e)});this.Rs?s.dispose():(this.Ls=s,i||this.loadIfEnabled())}}dispose(){var e,t,i,r;this.Rs||(this.Rs=!0,this.Lc(),null==(e=this.Ls)||e.dispose(),this.Ls=void 0,this.Os=void 0,this.vc=!1,null==s||s.removeEventListener("online",this._c),null==(t=this.Dc)||t.call(this),this.Dc=void 0,null==(i=this.wc)||i.reset(),null==(r=this.kc)||r.reset())}onRemoteConfig(e){var t,i;if(!this.Rs){var s=e.ok?null==(t=e.config.logs)?void 0:t.captureConsoleLogs:void 0;J(s)?this.$c():(null==(i=this._instance)||null==(i=i.persistence)||i.register({[iy]:!!s}),s?(this.hc=!0,this.dc||this.Oc(),this.loadIfEnabled()):this.$c())}}reset(){var e,t,i,s;this.Lc(),null==(e=this.wc)||e.clearQueue(),this.Za=[],null==(t=this.wc)||t.reset(),null==(i=this.kc)||i.clearQueue(),this.fc=[],null==(s=this.kc)||s.reset(),this.Hh=0}captureLog(e){this.Rs||this.Tc().captureLog(e)}captureConsoleLog(e){this.Rs||this.Ic().captureLog(e)}captureBufferedConsoleLog(e,t,i){this.Rs||this.Ic().captureLog(e,{context:t,occurredAtMs:i})}Fc(){var e;return!(null==(e=this._instance)||null==(e=e.persistence)||null==(e=e.props)||!e[iy])}Ac(){var e,t;return null==(e=this._instance)||null==e.Ua||!e.Ua()||!(null==(t=g._POSTHOG_REMOTE_CONFIG)||null==(t=t[this._instance.config.token])||!t.config)}Yl(){var e;this.Lc(),null==(e=this.kc)||e.clearQueue(),this.fc=[]}$c(){this.hc||this.Lc()}Oc(){var e,t=this;if(!this.yc&&null!=g&&g.console){var i=aN(null==(e=this._instance)||null==(e=e.config)?void 0:e.logs).maxBufferSize,s=function(e){var s;try{s=(e=>{for(;null!=(t=e)&&t.__rrweb_original__;){var t;e=e.__rrweb_original__}return e})(g.console[e])}catch(e){return 0}if(!s)return 0;t.mc.push(o0(g.console,e,r=>{var n=function(){for(var s=arguments.length,n=Array(s),o=0;s>o;o++)n[o]=arguments[o];try{t.Nc(e,n,i)}catch(e){}return r.apply(g.console,n)};return n.__rrweb_original__=s,n}))};for(var r of aj)s(r);this.yc=!0,this.qc=setTimeout(()=>{this.Lc()},3e4)}}Nc(e,t,i){var s;if(this.yc&&!this.bc&&0!==t.length){if(null!=(s=this._instance)&&s.is_capturing()){if(i>this.gc.length){this.bc=!0;try{this.gc.push({level:e,args:t,occurredAtMs:Date.now(),context:this.Cc()})}finally{this.bc=!1}}}else this.Lc()}}Lc(){if(this.gc=[],this.yc){for(var e of(this.yc=!1,this.qc&&(clearTimeout(this.qc),this.qc=void 0),this.mc))e();this.mc=[]}}jc(){var e=this.gc;return this.Lc(),e}get logger(){return this.Bc||(this.Bc={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.Bc}flushLogs(e){e?this.Hc(e):(this.wc&&this.wc.flush().catch(e=>this.zc(e)),this.kc&&this.kc.flush().catch(e=>this.zc(e)))}zc(e){aU(e)||this.I.error("PostHog logs flush failed:",e)}loadIfEnabled(){if(!this.Rs&&this.hc&&!this.dc&&!this.vc){var e=null==g?void 0:g.__PosthogExtensions__;if(!e)return this.I.error("PostHog Extensions not found."),void this.Lc();var t=e.loadExternalDependency;if(!t)return this.I.error(i7),void this.Lc();this.vc=!0;try{t(this._instance,"logs",t=>{if(this.vc=!1,!this.Rs&&this.hc){var i=e.logs;if(t||null==i||!i.initializeLogs)this.I.error("Could not load logs script",t),this.Lc();else{var s,r,n=this.jc();this.Dc=i.initializeLogs(null!==(s=this.Os)&&void 0!==s?s:this._instance),this.dc=!0,n.length>0&&(null==i.replayConsoleBuffer||i.replayConsoleBuffer(null!==(r=this.Os)&&void 0!==r?r:this._instance,n))}}})}catch(e){throw this.vc=!1,e}}}xc(e,t){var i=this._instance;return{get isDisabled(){return!1},get optedOut(){return!i.is_capturing()},getPersistedProperty:t=>t===S.LogsQueue?e():void 0,setPersistedProperty(e,i){e===S.LogsQueue&&t(null!=i?i:[])},es:e=>this.es(e),getLibraryId:()=>f.LIB_NAME,getLibraryVersion:()=>f.LIB_VERSION}}es(e){return new Promise(t=>{if(rH(this.Hh,3))t({kind:"fatal",error:aH(void 0,"logs endpoint is unreachable, dropping batch")});else{var i=!1,s=e=>{i||(i=!0,clearTimeout(r),t(e))},r=setTimeout(()=>{this.I.warn("Logs request timed out before receiving a response"),s({kind:"retry-later",error:aH(void 0,"logs request timed out")})},9e4);this._instance._send_request({method:"POST",url:this.Uc(),data:e,compression:"best-available",batchKey:"logs",fireCallbackOnDrop:!0,callback:e=>{var t,i=e.statusCode;(this.Wc(i),i>=200&&300>i)?s({kind:"ok"}):413===i?s({kind:"too-large"}):0!==i&&408!==i&&429!==i&&500>i?s({kind:"fatal",error:Error("logs request failed with status "+i)}):0===i?(e.error||this.I.warn("Logs request failed before receiving an HTTP response"),s({kind:"retry-later",error:aH(e.error,"logs request failed before receiving an HTTP response")})):s({kind:"retry-later",error:null!==(t=e.error)&&void 0!==t?t:Error("logs request failed with status "+i)})}})}})}Wc(e){(0!==e||this._instance.__loaded)&&(this.Hh=rU(e,this.Hh,3,()=>this.I.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.")))}Hc(e){this.Za.length>0&&this.Vc(e,this.Za,this.Ec,f.LIB_NAME,e=>{this.Za=e}),this.fc.length>0&&this.Vc(e,this.fc,this.Pc,aq,e=>{this.fc=e})}Vc(e,t,i,s,r){if(0!==t.length){var n=t.map(e=>e.record);r([]);var o=tS(n,tE(i,f.LIB_NAME,f.LIB_VERSION),s,f.LIB_VERSION);this._instance._send_request({method:"POST",url:this.Uc(),data:o,compression:"best-available",batchKey:"logs",transport:e})}}Uc(){return this._instance.requestRouter.endpointFor("api","/i/v1/logs")+"?token="+encodeURIComponent(this._instance.config.token)}Cc(){var e,t={};if(t.distinctId=this._instance.get_distinct_id(),this._instance.sessionManager){var i=this._instance.sessionManager.checkAndGetSessionAndWindowId(!0),s=i.windowId,r=i.sessionStartTimestamp,n=i.lastActivityTimestamp;t.sessionId=i.sessionId,t.windowId=s,J(r)||(t.sessionStartTimestamp=r),J(n)||(t.lastActivityTimestamp=n)}if(null!=g&&null!=(e=g.location)&&e.href&&(t.currentUrl=this._instance.config.disable_capture_url_hashes?tl(g.location.href):g.location.href),this._instance.featureFlags){var o=this._instance.featureFlags.getFlags();o&&o.length>0&&(t.activeFeatureFlags=o)}return t}}},{metrics:class{constructor(e){this.I=t8("[metrics]"),this._instance=e}initialize(){}Tc(){var e,t,i,s,r,n,o,a,l=null==(o=this._instance)||null==(o=o.config)?void 0:o.metrics;return this.wc&&this.Mc===l||(null==(a=this.wc)||a.reset(),this.Mc=l,this.wc=new t$(this.xc(),{serviceName:null!==(e=null==(n=null==l?void 0:l.resourceAttributes)?void 0:n["service.name"])&&void 0!==e?e:null==l?void 0:l.serviceName,serviceVersion:null!==(t=null==n?void 0:n["service.version"])&&void 0!==t?t:null==l?void 0:l.serviceVersion,environment:null!==(i=null==n?void 0:n["deployment.environment"])&&void 0!==i?i:null==l?void 0:l.environment,resourceAttributes:n,beforeSend:null==l?void 0:l.beforeSend,flushIntervalMs:null!==(s=null==l?void 0:l.flushIntervalMs)&&void 0!==s?s:1e4,maxSeriesPerFlush:null!==(r=null==l?void 0:l.maxSeriesPerFlush)&&void 0!==r?r:1e3},this.I)),this.wc}count(e,t,i){void 0===t&&(t=1),this.Tc().count(e,t,i)}
1gauge(e,t,i){this.Tc().gauge(e,t,i)}histogram(e,t,i){this.Tc().histogram(e,t,i)}flush(e){if(!this.wc)return Promise.resolve();if(e){var t=this.wc.drainWindow();return t&&this._s(t,e),Promise.resolve()}return this.wc.flush().catch(e=>this.I.error("PostHog metrics flush failed:",e))}reset(){var e;null==(e=this.wc)||e.reset()}xc(){var e=this._instance,t=this;return{get isDisabled(){return!1},get optedOut(){return!e.is_capturing()},_s:e=>t._s(e),getLibraryId:()=>f.LIB_NAME,getLibraryVersion:()=>f.LIB_VERSION}}_s(e,t){return new Promise(i=>{var s=!1,r=e=>{s||(s=!0,clearTimeout(n),i(e))},n=setTimeout(()=>r({kind:"retry-later",error:Error("metrics request timed out")}),9e4);this._instance._send_request(y({method:"POST",url:this.Gc(),data:e,compression:"best-available",batchKey:"metrics"},t&&{transport:t},{fireCallbackOnDrop:!0,callback(e){var t,i=e.statusCode;i>=200&&300>i?r({kind:"ok"}):413===i?r({kind:"too-large"}):0!==i&&408!==i&&429!==i&&500>i?r({kind:"fatal",error:Error("metrics request failed with status "+i)}):r({kind:"retry-later",error:null!==(t=e.error)&&void 0!==t?t:Error("metrics request failed with status "+i)})}}))})}Gc(){return this._instance.requestRouter.endpointFor("api","/i/v1/metrics")+"?token="+encodeURIComponent(this._instance.config.token)}}});oz.__defaultExtensionClasses=y({},aY);var aJ=function(){f.SDK_DIST_CHANNEL="npm";var e=oC[oD]=new oz;return function(){function e(){e.done||(e.done=!0,oN=!1,sd(oC,function(e){e._dom_loaded()}))}null!=o&&o.addEventListener?"complete"===o.readyState?e():sy(o,"DOMContentLoaded",e,{capture:!1}):s&&t4.error("Browser doesn't support `document.addEventListener` so PostHog couldn't be initialized")}(),e}()}}]);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.