1!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._posthogChunkIds=e._posthogChunkIds||{},e._posthogChunkIds[n]="01a0ce64-5b2c-7463-85fd-efd535c36722")}catch(e){}}();"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[8229],{32535:(e,t,i)=>{i.d(t,{Ay:()=>oI});var s,r="u">typeof window?window:void 0,n="u">typeof globalThis?globalThis:r;"u"<typeof self&&(n.self=n),"u"<typeof File&&(n.File=function(){});var o=null==n?void 0:n.navigator,a=null==n?void 0:n.document,l=null==n?void 0:n.location,u=null==n?void 0:n.fetch,h=null!=n&&n.XMLHttpRequest&&"withCredentials"in new n.XMLHttpRequest?n.XMLHttpRequest:void 0,c=null==n?void 0:n.AbortController,d=null==n?void 0:n.CompressionStream,p=null==o?void 0:o.userAgent,v=null!=r?r:{},g="1.390.2",_={DEBUG:!1,LIB_VERSION:g,LIB_NAME:"web",JS_SDK_VERSION:g};function f(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){f(n,s,r,o,a,"next",e)}function a(e){f(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 x,w,E,k,S=((x={}).AnonymousId="anonymous_id",x.DistinctId="distinct_id",x.Props="props",x.EnablePersonProcessing="enable_person_processing",x.PersonMode="person_mode",x.FeatureFlagDetails="feature_flag_details",x.FeatureFlags="feature_flags",x.FeatureFlagPayloads="feature_flag_payloads",x.BootstrapFeatureFlagDetails="bootstrap_feature_flag_details",x.BootstrapFeatureFlags="bootstrap_feature_flags",x.BootstrapFeatureFlagPayloads="bootstrap_feature_flag_payloads",x.OverrideFeatureFlags="override_feature_flags",x.Queue="queue",x.LogsQueue="logs_queue",x.OptedOut="opted_out",x.SessionId="session_id",x.SessionStartTimestamp="session_start_timestamp",x.SessionLastTimestamp="session_timestamp",x.PersonProperties="person_properties",x.GroupProperties="group_properties",x.InstalledAppBuild="installed_app_build",x.InstalledAppVersion="installed_app_version",x.SessionReplay="session_replay",x.SurveyLastSeenDate="survey_last_seen_date",x.SurveysSeen="surveys_seen",x.Surveys="surveys",x.RemoteConfig="remote_config",x.FlagsEndpointWasHit="flags_endpoint_was_hit",x.DeviceId="device_id",x),P=((w={}).GZipJS="gzip-js",w.Base64="base64",w),F=["$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"],$=["token"],I="NativeGzipValidationError",C=e=>e.length>=2&&31===e[0]&&139===e[1],R=e=>!(!e||"object"!=typeof e)&&"NotReadableError"===("name"in e?String(e.name):""),M=e=>{var t=Error("Native gzip produced invalid output: "+e);throw t.name=I,t},O=(E=m(function*(e,t){18>e.size&&M("too-short");var i=new Uint8Array((yield e.slice(0,10).arrayBuffer()));C(i)&&8===i[2]||M("invalid-header");var s=new DataView((yield e.slice(e.size-8).arrayBuffer()));s.getUint32(0,!0)!==(e=>{for(var t=(()=>{if(k)return k;k=[];for(var e=0;256>e;e++){for(var t=e,i=0;8>i;i++)t=1&t?0xedb88320^t>>>1:t>>>1;k[e]=t>>>0}return k})(),i=0xffffffff,s=0;e.length>s;s++)i=t[255&(i^e[s])]^i>>>8;return(0xffffffff^i)>>>0})(t)&&M("invalid-crc");var r=t.length>>>0;s.getUint32(4,!0)!==r&&M("invalid-size")}),function(e,t){return E.apply(this,arguments)});function T(){return(T=m(function*(e,t,i){void 0===t&&(t=!0);try{var s,r=(new TextEncoder).encode(e),n=new 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]);return yield O(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 A=["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","pinterest","prerender","rogerbot","screaming frog","sebot-wa","sitebulb","slackbot","slurp","trendictionbot","turnitin","twitterbot","vercel-screenshot","vercelbot","yahoo! slurp","yandexbot","zoombot","bot.htm","bot.php","(bot;","bot/","crawler","ahrefsbot","ahrefssiteaudit","semrushbot","siteauditbot","splitsignalbot","gptbot","oai-searchbot","chatgpt-user","perplexitybot","better uptime bot","sentryuptimebot","uptimerobot","headlesschrome","cypress","google-hoteladsverifier","adsbot-google","apis-google","duplexweb-google","feedfetcher-google","google favicon","google web preview","google-read-aloud","googlebot","googleother","google-cloudvertexbot","googleweblight","mediapartners-google","storebot-google","google-inspectiontool","bytespider"],L=function(e,t){if(void 0===t&&(t=[]),!e)return!1;var i=e.toLowerCase();return A.concat(t).some(e=>{var t=e.toLowerCase();return -1!==i.indexOf(t)})};function q(e,t){return -1!==e.indexOf(t)}var D=function(e){return e.trim()},N=function(e){return e.replace(/^\$/,"")},j=Object.prototype,z=j.hasOwnProperty,H=j.toString,B=Array.isArray||function(e){return"[object Array]"===H.call(e)},U=e=>"function"==typeof e,G=e=>e===Object(e)&&!B(e),V=e=>{if(G(e)){for(var t in e)if(z.call(e,t))return!1;return!0}return!1},J=e=>void 0===e,W=e=>"[object String]"==H.call(e),Y=e=>W(e)&&0===e.trim().length,K=e=>null===e,Z=e=>J(e)||K(e),Q=e=>"[object Number]"==H.call(e)&&e==e,X=e=>Q(e)&&e>0,ee=e=>"[object Boolean]"===H.call(e),et=e=>q(F,e),ei=e=>q($,e);function es(e){return null===e||"object"!=typeof e}function er(e,t){return({}).toString.call(e)==="[object "+t+"]"}function en(e){return"u">typeof Event&&function(e,t){try{return e instanceof t}catch(e){return!1}}(e,Event)}var eo=[!0,"true",1,"1","yes"],ea=[!1,"false",0,"0","no"];function el(e,t,i,s,r){return t>i&&(s.warn("min cannot be greater than max."),t=i),Q(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),el(r||i,t,i,s))}class eu{constructor(e){this.$t={},this.zt=e.zt,this.Gt=el(e.bucketSize,0,100,e.Zt),this.Qt=el(e.refillRate,0,this.Gt,e.Zt),this.Jt=el(e.refillInterval,0,864e5,e.Zt)}Kt(e,t){var i=Math.floor((t-e.lastAccess)/this.Jt);i>0&&(e.tokens=Math.min(e.tokens+i*this.Qt,this.Gt),e.lastAccess=e.lastAccess+i*this.Jt)}consumeRateLimit(e){var t,i=Date.now(),s=String(e),r=this.$t[s];return r?this.Kt(r,i):this.$t[s]=r={tokens:this.Gt,lastAccess:i},0===r.tokens||(r.tokens--,0===r.tokens&&(null==(t=this.zt)||t.call(this,e)),0===r.tokens)}stop(){this.$t={}}}var eh="Mobile",ec="Android",ed="Tablet",ep=ec+" "+ed,ev="iPad",eg="Apple",e_=eg+" Watch",ef="Safari",em="BlackBerry",ey="Samsung",eb=ey+"Browser",ex=ey+" Internet",ew="Chrome",eE=ew+" OS",ek=ew+" iOS",eS="Internet Explorer",eP=eS+" "+eh,eF="Opera",e$=eF+" Mini",eI="Edge",eC="Microsoft "+eI,eR="Firefox",eM=eR+" iOS",eO="Nintendo",eT="PlayStation",eA="Xbox",eL=ec+" "+eh,eq=eh+" "+ef,eD="Windows",eN=eD+" Phone",ej="Nokia",ez="Ouya",eH="Generic",eB=eH+" "+eh.toLowerCase(),eU=eH+" "+ed.toLowerCase(),eG="Konqueror",eV="Oculus Browser",eJ="Vivaldi",eW="Yandex",eY="Whale",eK="DuckDuckGo",eZ="Pale Moon",eQ="Waterfox",eX="Brave",e0="Google Search App",e1="(\\d+(\\.\\d+)?)",e2=RegExp("Version/"+e1),e3=RegExp(eA,"i"),e5=RegExp(eT+" \\w+","i"),e8=RegExp(eO+" \\w+","i"),e6=RegExp(em+"|PlayBook|BB10","i"),e4={"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"},e7=function(e,t,i,s){var r;return t=t||"",(null!=i&&i.brave?eX:null)||(null!=s&&s.detectGoogleSearchApp&&q(e,"GSA/")?e0:q(e," OPR/")&&q(e,"Mini")?e$:q(e," OPR/")?eF:e6.test(e)?em:q(e,"IE"+eh)||q(e,"WPDesktop")?eP:q(e,"OculusBrowser")?eV:q(e,eb)?ex:q(e,eI)||q(e,"Edg/")?eC:q(e,eJ+"/")?eJ:q(e,"YaBrowser/")?eW:q(e,eY+"/")?eY:q(e,eK+"/")||q(e,"Ddg/")?eK:q(e,"FBIOS")?"Facebook "+eh:q(e,"UCWEB")||q(e,"UCBrowser")?"UC Browser":q(e,"CriOS")?ek:q(e,"CrMo")||q(e,ew)?ew:q(e,ec)&&q(e,ef)?eL:q(e,"FxiOS")?eM:q(e.toLowerCase(),eG.toLowerCase())?eG:q(e,eX+"/")?eX:(r=t)&&q(r,eg)||q(e,ef)&&!q(e,ew)&&!q(e,ec)?q(e,eh)?eq:ef:q(e,"PaleMoon/")?eZ:q(e,eQ+"/")?eQ:q(e,eR)?eR:q(e,"MSIE")||q(e,"Trident/")?eS:q(e,"Gecko")?eR:"")},e9={[eP]:[RegExp("rv:"+e1)],[eC]:[RegExp(eI+"?\\/"+e1)],[ew]:[RegExp("("+ew+"|CrMo)\\/"+e1)],[ek]:[RegExp("CriOS\\/"+e1)],"UC Browser":[RegExp("(UCBrowser|UCWEB)\\/"+e1)],[ef]:[e2],[eq]:[e2],[eF]:[RegExp("(Opera|OPR)\\/"+e1)],[eR]:[RegExp(eR+"\\/"+e1)],[eM]:[RegExp("FxiOS\\/"+e1)],[eG]:[RegExp("Konqueror[:/]?"+e1,"i")],[em]:[RegExp(em+" "+e1),e2],[eL]:[RegExp("android\\s"+e1,"i")],[ex]:[RegExp(eb+"\\/"+e1)],[eV]:[RegExp("OculusBrowser\\/"+e1)],[eJ]:[RegExp(eJ+"\\/"+e1)],[eW]:[RegExp("YaBrowser\\/"+e1)],[eY]:[RegExp(eY+"\\/"+e1)],[eX]:[RegExp(eX+"\\/"+e1)],[eK]:[RegExp("(DuckDuckGo|Ddg)\\/"+e1)],[eZ]:[RegExp("PaleMoon\\/"+e1)],[eQ]:[RegExp(eQ+"\\/"+e1)],[e0]:[RegExp("GSA\\/"+e1)],[eS]:[RegExp("(rv:|MSIE )"+e1)],Mozilla:[RegExp("rv:"+e1)]},te=function(e,t,i,s){var r=e9[e7(e,t,i,s)];if(J(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},tt=[[RegExp(eA+"; "+eA+" (.*?)[);]","i"),e=>[eA,e&&e[1]||""]],[RegExp(eO,"i"),[eO,""]],[RegExp(eT,"i"),[eT,""]],[e6,[em,""]],[RegExp(eD,"i"),(e,t)=>{if(/Phone/.test(t)||/WPDesktop/.test(t))return[eN,""];if(new RegExp(eh).test(t)&&!/IEMobile\b/.test(t))return[eD+" "+eh,""];var i=/Windows NT ([0-9.]+)/i.exec(t);if(i&&i[1]){var s=e4[i[1]]||"";return/arm/i.test(t)&&(s="RT"),[eD,s]}return[eD,""]}],[/((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=J(e[2])?e[3]:e[2]),["watchOS",t]}],[RegExp("("+ec+" (\\d+)\\.(\\d+)\\.?(\\d+)?|"+ec+")","i"),e=>e&&e[2]?[ec,[e[2],e[3],e[4]||"0"].join(".")]:[ec,""]],[/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/,[eE,""]],[/Linux|debian/i,["Linux",""]]],ti=function(e){return e8.test(e)?eO:e5.test(e)?eT:e3.test(e)?eA:RegExp(ez,"i").test(e)?ez:RegExp("("+eN+"|WPDesktop)","i").test(e)?eN:/iPad/.test(e)?ev:/iPod/.test(e)?"iPod Touch":/iPhone/.test(e)?"iPhone":/(watch)(?: ?os[,/]|\d,\d\/)[\d.]+/i.test(e)?e_:e6.test(e)?em:/(kobo)\s(ereader|touch)/i.test(e)?"Kobo":RegExp(ej,"i").test(e)?ej:/(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(eh).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)?ec:ep:RegExp("(pda|"+eh+")","i").test(e)?eB:RegExp(ed,"i").test(e)&&!RegExp(ed+" pc","i").test(e)?eU:""};function ts(e,t){var i=setTimeout(e,t);return(null==i?void 0:i.unref)&&(null==i||i.unref()),i}var tr=e=>e instanceof Error,tn={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}},to=tn.info;function ta(e){var t=[];for(var i in e){var s=e[i];K(s)||J(s)||t.push({key:i,value:function e(t){if(ee(t))return{boolValue:t};if("number"==typeof t)return Number.isFinite(t)?Number.isInteger(t)?{intValue:t}:{doubleValue:t}:{stringValue:String(t)};if("string"==typeof t)return{stringValue:t};if(B(t))return{arrayValue:{values:t.map(t=>e(t))}};try{return{stringValue:JSON.stringify(t)}}catch(e){return{stringValue:String(t)}}}(s)})}return t}function tl(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 tu(e,t,i,s){return{resourceLogs:[{resource:{attributes:ta(t)},scopeLogs:[{scope:{name:i,version:s},logRecords:e}]}]}}let th=class{constructor(e,t,i,s,r,n){var o;void 0===n&&(n=()=>Promise.resolve()),this._instance=e,this.qt=t,this.Zt=i,this.Yt=s,this.Xt=r,this.er=n,this.tr=null,this.rr=0,this.ir=0,this.nr=0,this.sr=0,this.ar=!1,this.lr=t.maxBufferSize,this.it=Math.max(null!=(o=t.maxQueueSize)?o:t.maxBufferSize,t.maxBufferSize),this.ur=t.flushIntervalMs,this.hr=t.maxBatchRecordsPerPost,this.cr=t.rateCapWindowMs,this.dr=t.maxLogsPerInterval}reset(){this.vr(),this.tr=null,this.nr=0,this.sr=0,this.ar=!1,this.rr=0,this.ir=0,this.hr=this.qt.max
1BatchRecordsPerPost}onReconnect(){this.ir=0,this.pr()}captureLog(e){if(!this._instance.isDisabled&&!this._instance.optedOut&&null!=e&&e.body){var t=this.gr(e);if(null!==t)if(t.body){if(this.mr()){var i={record:function(e,t){var{text:i,number:s}=tn[e.level||"info"]||to,r=String(Date.now())+"000000",n={};t.distinctId&&(n.posthogDistinctId=t.distinctId),t.sessionId&&(n.sessionId=t.sessionId),t.currentUrl&&(n["url.full"]=t.currentUrl),t.screenName&&(n["screen.name"]=t.screenName),t.appState&&(n["app.state"]=t.appState),t.activeFeatureFlags&&t.activeFeatureFlags.length>0&&(n.feature_flags=t.activeFeatureFlags);var o=y({},n,e.attributes||{}),a={timeUnixNano:r,observedTimeUnixNano:r,severityNumber:s,severityText:i,body:{stringValue:e.body},attributes:ta(o)};return e.trace_id&&(a.traceId=e.trace_id),e.span_id&&(a.spanId=e.span_id),J(e.trace_flags)||(a.flags=e.trace_flags),a}(t,this.Yt())};this.Xt(()=>this.yr(i))}}else this.Zt.info("Log was rejected in beforeSend function")}}gr(e){var t=this.qt.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.Zt.info("Log was rejected in beforeSend function"),null;s=n}catch(e){return this.Zt.error("Error in beforeSend function for log:",e),null}return s}mr(){if(void 0===this.dr)return!0;var e=Date.now(),t=e-this.nr;return this.cr>t&&t>=0||(this.nr=e,this.sr=0,this.ar=!1),this.dr>this.sr?(this.sr++,!0):(this.ar||(this.Zt.warn("captureLog dropping logs: exceeded "+this.dr+" logs per "+this.cr+"ms"),this.ar=!0),!1)}flush(){var e=this;return m(function*(){if(!e._instance.isDisabled)return e.tr||(e.tr=e.br().finally(()=>{e.tr=null})),e.tr})()}br(){var e=this;return m(function*(){e.vr();var t=null!=(r=e._instance.getPersistedProperty(S.LogsQueue))?r:[];if(0!==t.length)for(var i=t.length,s=0;t.length>0&&i>s;){e.rr=0;var r,n,o=Math.min(t.length,e.hr),a=t.slice(0,o),l=tu(a.map(e=>e.record),e._r(),e._instance.getLibraryId(),e._instance.getLibraryVersion()),u=yield e._instance.wr(l);if("too-large"===u.kind&&a.length>1)e.hr=Math.max(1,Math.floor(a.length/2)),e.Zt.warn("Received 413 when sending logs batch of size "+a.length+", reducing batch size to "+e.hr);else if("retry-later"===u.kind||("too-large"===u.kind?e.Zt.warn("Dropping a single log record after 413 with batch size 1 â the record is larger than the server cap and cannot be split further."):"ok"===u.kind&&e.qt.maxBatchRecordsPerPost>e.hr&&(e.hr=Math.min(e.qt.maxBatchRecordsPerPost,e.hr+1)),yield e.kr(a.length),t=null!=(n=e._instance.getPersistedProperty(S.LogsQueue))?n:[],s+=a.length,"fatal"===u.kind))throw u.error}})()}kr(e){var t=this;return m(function*(){var i,s=Math.max(0,e-t.rr),r=null!=(i=t._instance.getPersistedProperty(S.LogsQueue))?i:[];t._instance.setPersistedProperty(S.LogsQueue,r.slice(s)),yield t.er()})()}_r(){return tl(this.qt,this._instance.getLibraryId(),this._instance.getLibraryVersion())}yr(e){var t;if(!this._instance.optedOut){var i=null!=(t=this._instance.getPersistedProperty(S.LogsQueue))?t:[];this.it>i.length||(i.shift(),this.rr++,this.Zt.info("Logs queue is full, dropping oldest record.")),i.push(e),this._instance.setPersistedProperty(S.LogsQueue,i),this.lr>i.length?this.Sr():this.pr()}}Sr(e){void 0===e&&(e=this.ur),this.Cr||(this.Cr=ts(()=>{this.Cr=void 0,this.pr()},e))}Ir(){var e=Math.min(Math.max(0,this.ir-1),6);return this.ur*Math.pow(2,e)}Tr(){var e=this._instance.getPersistedProperty(S.LogsQueue);return!!e&&e.length>0}shutdown(e){var t=this;return m(function*(){t.vr();var i=t.flush().catch(()=>{});void 0!==e?yield Promise.race([i,new Promise(t=>ts(t,e))]):yield i})()}flushWithTimeout(e){var t=this;return m(function*(){var i=!1,s=t.flush(),r=new Promise(t=>ts(()=>{i=!0,t()},e));try{yield Promise.race([s,r])}finally{i&&s.catch(()=>{})}})()}pr(){this.flush().then(()=>{this.ir=0},e=>{this.ir++,this.Zt.error("PostHog logs flush failed:",e)}).finally(()=>{!this._instance.isDisabled&&this.Tr()&&this.Sr(this.Ir())})}vr(){this.Cr&&(clearTimeout(this.Cr),this.Cr=void 0)}};class tc{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)?i:"generic",handled:null==(s=t.handled)||s,synthetic:null!=(r=e.synthetic)&&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 i8&&i.length===i5||(i5=i.length,i8=i.reduce((i,s)=>{i3||(i3={});var r=i3[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,i3[s]=[l,u];break}}return i},{})),i8}}(this.stackParser),skipFirstLines:null!=(t=e.skipFirstLines)?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 td(e,t,i,s,r){var n={platform:e,filename:t,function:"<anonymous>"===i?"?":i,in_app:!0};return J(s)||(n.lineno=s),J(r)||(n.colno=r),n}var tp=(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]},tv=/^\s*at (\S+?)(?::(\d+))(?::(\d+))\s*$/i,tg=/^\s*at (?:(.+?\)(?: \[.+\])?|.*?) ?\((?:address at )?)?(?:async )?((?:<anonymous>|[-a-z]+:|.*bundle|\/)?.*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i,t_=/\((\S*)(?::(\d+))(?::(\d+))\)/,tf=(e,t)=>{var i=tv.exec(e);if(i){var[,s,r,n]=i;return td(t,s,"?",+r,+n)}var o=tg.exec(e);if(o){if(o[2]&&0===o[2].indexOf("eval")){var a=t_.exec(o[2]);a&&(o[2]=a[1],o[3]=a[2],o[4]=a[3])}var[l,u]=tp(o[1]||"?",o[2]);return td(t,u,l,o[3]?+o[3]:void 0,o[4]?+o[4]:void 0)}},tm=/^\s*(.*?)(?:\((.*?)\))?(?:^|@)?((?:[-a-z]+)?:\/.*?|\[native code\]|[^@]*(?:bundle|\d+\.js)|\/[\w\-. /=]+)(?::(\d+))?(?::(\d+))?\s*$/i,ty=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i,tb=(e,t)=>{var i=tm.exec(e);if(i){if(i[3]&&i[3].indexOf(" > eval")>-1){var s=ty.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]||"?";return[n,r]=tp(n,r),td(t,r,n,i[4]?+i[4]:void 0,i[5]?+i[5]:void 0)}},tx=/\(error: (.*)\)/;class tw{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 er(e,"DOMException")}isDOMError(e){return er(e,"DOMError")}}class tE{match(e){return e instanceof Error}coerce(e,t){return{type:this.getType(e),value:this.getMessage(e,t),stack:this.getStack(e),cause:e.cause?t.next(e.cause):void 0,synthetic:!1}}getType(e){return e.name||e.constructor.name}getMessage(e,t){var i=e.message;return String(i.error&&"string"==typeof i.error.message?i.error.message:i)}getStack(e){return e.stacktrace||e.stack||void 0}}class tk{match(e){return er(e,"ErrorEvent")&&null!=e.error}coerce(e,t){var i;return t.apply(e.error)||{type:"ErrorEvent",value:e.message,stack:null==(i=t.syntheticException)?void 0:i.stack,synthetic:!0}}}var tS=/^(?:[Uu]ncaught (?:exception: )?)?(?:((?:Eval|Internal|Range|Reference|Syntax|Type|URI|)Error): )?(.*)$/i;class tP{match(e){return"string"==typeof e}coerce(e,t){var i,[s,r]=this.getInfos(e);return{type:null!=s?s:"Error",value:null!=r?r:e,stack:null==(i=t.syntheticException)?void 0:i.stack,synthetic:!0}}getInfos(e){var t="Error",i=e,s=e.match(tS);return s&&(t=s[1],i=s[2]),[t,i]}}var tF=["fatal","error","warning","log","info","debug"];function t$(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 tI{match(e){return"object"==typeof e&&null!==e}coerce(e,t){var i,s=this.getErrorPropertyFromObject(e);return s?t.apply(s):{type:this.getType(e),value:this.getValue(e),stack:null==(i=t.syntheticException)?void 0:i.stack,level:this.isSeverityLevel(e.level)?e.level:"error",synthetic:!0}}getType(e){return en(e)?e.constructor.name:"Error"}getValue(e){if("name"in e&&"string"==typeof e.name){var t="'"+e.name+"' captured as exception";return"message"in e&&"string"==typeof e.message&&(t+=" with message: '"+e.message+"'"),t}if("message"in e&&"string"==typeof e.message)return e.message;var i=this.getObjectClassName(e);return(i&&"Object"!==i?"'"+i+"'":"Object")+" captured as exception with keys: "+t$(e)}isSeverityLevel(e){return W(e)&&!Y(e)&&tF.indexOf(e)>=0}getErrorPropertyFromObject(e){for(var t in e)if(({}).hasOwnProperty.call(e,t)){var i=e[t];if(tr(i))return i}}getObjectClassName(e){try{var t=Object.getPrototypeOf(e);return t?t.constructor.name:void 0}catch(e){return}}}class tC{match(e){return en(e)}coerce(e,t){var i,s=e.constructor.name;return{type:s,value:s+" captured as exception with keys: "+t$(e),stack:null==(i=t.syntheticException)?void 0:i.stack,synthetic:!0}}}class tR{match(e){return es(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 tM{match(e){return er(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 es(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 tO="$message",tT="$timestamp",tA=new Set([tO,tT]),tL={enabled:!0,max_bytes:32768};function tq(e){var t;return e?{enabled:null!=(t=e.enabled)?t:tL.enabled,max_bytes:function(e,t){if(!Q(e)||e===1/0||e===-1/0)return t;var i=Math.floor(e);return 0>i?t:i}(e.max_bytes,tL.max_bytes)}:y({},tL)}class tD{constructor(e){this.Er=[],this.Mr=0,this.qt=tq(e)}setConfig(e){this.qt=tq(e),this.Pr()}add(e){var t=function(e){var t=function(e){var t=new WeakSet;try{return JSON.stringify(e,(e,i)=>{if("bigint"==typeof i)return i.toString();if("function"!=typeof i&&"symbol"!=typeof i){if(i instanceof Date)return i.toISOString();if(i instanceof Error)return{name:i.name,message:i.message,stack:i.stack};if(i&&"object"==typeof i){if(t.has(i))return"[Circular]";t.add(i)}return i}})}catch(e){return}}(e);if(t)try{var i=JSON.parse(t);if(!G(i))return;var s=i[tO],r=i[tT];if(!W(s)||0===s.trim().length||!W(r)&&!Q(r))return;return{step:i,json:t}}catch(e){return}}(e);if(t){var i=function(e){if("u">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.qt.max_bytes||(this.Er.push({step:t.step,bytes:i}),this.Mr+=i,this.Pr())}}getAttachable(){return this.Er.map(e=>e.step)}clear(){this.Er=[],this.Mr=0}size(){return this.Er.length}Pr(){for(;this.Mr>this.qt.max_bytes&&this.Er.length>0;){var e=this.Er.shift();e&&(this.Mr-=e.bytes)}}}var tN=function(e,t){var{debugEnabled:i}=void 0===t?{}:t,s={k(t){if(r&&(_.DEBUG||v.POSTHOG_DEBUG||i)&&!J(r.console)&&r.console){for(var s=("__rrweb_original__"in r.console[t])?r.console[t].__rrweb_original__:r.console[t],n=arguments.length,o=Array(n>1?n-1:0),a=1;n>a;a++)o[a-1]=arguments[a];s(e,...o)}},debug(){for(var e=arguments.length,t=Array(e),i=0;e>i;i++)t[i]=arguments[i];s.k("debug",...t)},info(){for(var e=arguments.length,t=Array(e),i=0;e>i;i++)t[i]=arguments[i];s.k("log",...t)},warn(){for(var e=arguments.length,t=Array(e),i=0;e>i;i++)t[i]=arguments[i];s.k("warn",...t)},error(){for(var e=arguments.length,t=Array(e),i=0;e>i;i++)t[i]=arguments[i];s.k("error",...t)},critical(){for(var t=arguments.length,i=Array(t),s=0;t>s;s++)i[s]=arguments[s];console.error(e,...i)},uninitializedWarning(e){s.error("You must initialize PostHog before calling "+e)},createLogger:(t,i)=>tN(e+" "+t,i)};return s},tj=tN("[PostHog.js]"),tz=tj.createLogger,tH=tz("[ExternalScriptsLoader]"),tB=(e,t,i)=>{if(e.config.disable_external_dependency_loading)return tH.warn(t+" was requested but loading of external scripts is disabled."),i("Loading of external scripts is disabled");var s=null==a?void 0:a.querySelectorAll("script");
1if(s){for(var r,n=0;s.length>n;n++)if(r=function(){if(s[n].src===t){var e=s[n];return e.__posthog_loading_callback_fired?{v:i()}:(e.addEventListener("load",t=>{e.__posthog_loading_callback_fired=!0,i(void 0,t)}),e.onerror=e=>i(e),{v:void 0})}}())return r.v}var o=()=>{if(!a)return i("document not found");var s=a.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=>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)a.head.appendChild(s);else{var r,n=a.querySelectorAll("body > script");n.length>0?null==(r=n[0].parentNode)||r.insertBefore(s,n[0]):a.body.appendChild(s)}};null!=a&&a.body?o():null==a||a.addEventListener("DOMContentLoaded",o)};v.__PosthogExtensions__=v.__PosthogExtensions__||{},v.__PosthogExtensions__.loadExternalDependency=(e,t,i)=>{if("remote-config"!==t){var s;if(e.config.strict_script_versioning)s=e.requestRouter.endpointFor("assets","/static/"+e.version+"/"+t+".js");else{var r="/static/"+t+".js?v="+e.version;"toolbar"===t&&(r=r+"&t="+3e5*Math.floor(Date.now()/3e5)),s=e.requestRouter.endpointFor("assets",r)}tB(e,s,i)}else{var n=e.requestRouter.endpointFor("assets","/array/"+e.config.token+"/config.js");tB(e,n,i)}},v.__PosthogExtensions__.loadSiteApp=(e,t,i)=>{var s=e.requestRouter.endpointFor("api",t);tB(e,s,i)};var tU="$people_distinct_id",tG="$device_id",tV="__alias",tJ="__timers",tW="$autocapture_disabled_server_side",tY="$heatmaps_enabled_server_side",tK="$exception_capture_enabled_server_side",tZ="$error_tracking_suppression_rules",tQ="$error_tracking_capture_extension_exceptions",tX="$web_vitals_enabled_server_side",t0="$dead_clicks_enabled_server_side",t1="$product_tours_enabled_server_side",t2="$web_vitals_allowed_metrics",t3="$session_recording_remote_config",t5="$replay_sample_rate",t8="$replay_override_sampling",t6="$replay_override_linked_flag",t4="$replay_override_url_trigger",t7="$replay_override_event_trigger",t9="$sesid",ie="$session_is_sampled",it="$enabled_feature_flags",ii="$active_feature_flags",is="$early_access_features",ir="$feature_flag_details",io="$feature_flag_payloads",ia="$feature_flag_request_id",il="$override_feature_flags",iu="$override_feature_flag_payloads",ih="$stored_person_properties",ic="$stored_group_properties",id="$surveys",ip="$surveys_loaded_at",iv="$surveys_activated",ig="ph_product_tours",i_="$flag_call_reported",im="$flag_call_reported_session_id",iy="$feature_flag_errors",ib="$feature_flag_evaluated_at",ix="$user_state",iw="$client_session_props",iE="$capture_rate_limit",ik="$initial_campaign_params",iS="$initial_referrer_info",iP="$initial_person_info",iF="$epp",i$="__POSTHOG_TOOLBAR__",iI="$posthog_cookieless",iC="$sdk_debug_extensions_init_method",iR="$sdk_debug_extensions_init_time_ms",iM="$sdk_debug_recording_script_not_loaded",iO="PostHog loadExternalDependency extension not found.",iT="on_reject",iA="always",iL="anonymous",iq="identified",iD="identified_only",iN="visibilitychange",ij="beforeunload",iz="$pageview",iH="$pageleave",iB="$identify",iU="$groupidentify";function iG(e,t){B(e)&&e.forEach(t)}function iV(e,t){if(!Z(e))if(B(e))e.forEach(t);else if(e instanceof FormData)e.forEach((e,i)=>t(e,i));else for(var i in e)z.call(e,i)&&t(e[i],i)}var iJ=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 iW(e){for(var t=Object.keys(e),i=t.length,s=Array(i);i--;)s[i]=[t[i],e[t[i]]];return s}var iY=function(e){try{return e()}catch(e){return}},iK=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){tj.critical("Implementation error. Please turn on debug mode and open a ticket on https://app.posthog.com/home#panel=support%3Asupport%3A."),tj.critical(e)}}},iZ=function(e){var t={};return iV(e,function(e,i){(W(e)&&e.length>0||Q(e))&&(t[i]=e)}),t},iQ=["herokuapp.com","vercel.app","netlify.app"];function iX(e,t,i,s){var{capture:r=!1,passive:n=!0}=null!=s?s:{};null==e||e.addEventListener(t,i,{capture:r,passive:n})}function i0(e){return"ph_toolbar_internal"===e.name}Math.trunc||(Math.trunc=function(e){return 0>e?Math.ceil(e):Math.floor(e)}),Number.isInteger||(Number.isInteger=function(e){return Q(e)&&isFinite(e)&&Math.floor(e)===e});class i1{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");
1var 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 i1(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 i1(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 i2{constructor(){this.S=0,this.C=0,this.I=new i7}generate(){var e=this.generateOrAbort();if(J(e)){this.S=0;var t=this.generateOrAbort();if(J(t))throw Error("Could not generate UUID after timestamp reset");return t}return e}generateOrAbort(){var e=Date.now();if(e>this.S)this.S=e,this.T();else{if(this.S>=e+1e4)return;this.C++,this.C>0x3ffffffffff&&(this.S++,this.T())}return i1.fromFieldsV7(this.S,Math.trunc(this.C/0x40000000),0x3fffffff&this.C,this.I.nextUint32())}T(){this.C=1024*this.I.nextUint32()+(1023&this.I.nextUint32())}}var i3,i5,i8,i6,i4=e=>{if("u">typeof UUIDV7_DENY_WEAK_RNG&&UUIDV7_DENY_WEAK_RNG)throw Error("no cryptographically strong RNG available");for(var t=0;e.length>t;t++)e[t]=65536*Math.trunc(65536*Math.random())+Math.trunc(65536*Math.random());return e};r&&!J(r.crypto)&&crypto.getRandomValues&&(i4=e=>crypto.getRandomValues(e));class i7{constructor(){this.M=new Uint32Array(8),this.R=1/0}nextUint32(){return this.M.length>this.R||(i4(this.M),this.R=0),this.M[this.R++]}}var i9=()=>se().toString(),se=()=>(i6||(i6=new i2)).generate(),st="",si=/[a-z0-9][a-z0-9-]+\.[a-z]{2,}$/i,ss={O:()=>!!a,D(e){tj.error("cookieStore error: "+e)},A(e){if(a){try{for(var t=e+"=",i=a.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}},F(e){var t;try{t=JSON.parse(ss.A(e))||{}}catch(e){}return t},N(e,t,i,s,r){if(!a)return!1;try{var n="",o="",l=function(e,t){if(t){var i=function(e,t){if(void 0===t&&(t=a),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_"+i9();!st&&s--;){var n=i.slice(s).join("."),o=r+"=1;domain=."+n+";path=/";t.cookie=o+";max-age=3",t.cookie.includes(r)&&(t.cookie=o+";max-age=0",st=n)}return st}(e);if(!i){var s,r=(s=e.match(si))?s[0]:"";r!==i&&tj.info("Warning: cookie subdomain discovery mismatch",r,i),i=r}return i?"; domain=."+i:""}return""}(a.location.hostname,s);if(i){var u=new Date;u.setTime(u.getTime()+864e5*i),n="; expires="+u.toUTCString()}r&&(o="; secure");var h=e+"="+encodeURIComponent(JSON.stringify(t))+n+"; SameSite=Lax; path=/"+l+o;return h.length>3686.4&&tj.warn("cookieStore warning: large cookie, len="+h.length),a.cookie=h,!0}catch(e){return!1}},q(e,t){if(null!=a&&a.cookie)try{ss.N(e,"",-1,t)}catch(e){return}}},sr=null,sn={O(){if(!K(sr))return sr;var e=!0;if(J(r))e=!1;else try{var t="__mplssupport__";sn.N(t,"xyz"),'"xyz"'!==sn.A(t)&&(e=!1),sn.q(t)}catch(t){e=!1}return e||tj.error("localStorage unsupported; falling back to cookie store"),sr=e,e},D(e){tj.error("localStorage error: "+e)},A(e){try{return null==r?void 0:r.localStorage.getItem(e)}catch(e){sn.D(e)}return null},F(e){try{return JSON.parse(sn.A(e))||{}}catch(e){}return null},N(e,t){try{return null==r||r.localStorage.setItem(e,JSON.stringify(t)),!0}catch(e){sn.D(e)}return!1},q(e){try{null==r||r.localStorage.removeItem(e)}catch(e){sn.D(e)}}},so=[tG,"distinct_id",t9,ie,iF,iP,ix],sa={},sl={O:()=>!0,D(e){tj.error("memoryStorage error: "+e)},A:e=>sa[e]||null,F:e=>sa[e]||null,N:(e,t)=>(sa[e]=t,!0),q(e){delete sa[e]}},su=null,sh={O(){if(!K(su))return su;if(su=!0,J(r))su=!1;else try{var e="__support__";sh.N(e,"xyz"),'"xyz"'!==sh.A(e)&&(su=!1),sh.q(e)}catch(e){su=!1}return su},D(e){tj.error("sessionStorage error: ",e)},A(e){try{return null==r?void 0:r.sessionStorage.getItem(e)}catch(e){sh.D(e)}return null},F(e){try{return JSON.parse(sh.A(e))||null}catch(e){}return null},N(e,t){try{return null==r||r.sessionStorage.setItem(e,JSON.stringify(t)),!0}catch(e){sh.D(e)}return!1},q(e){try{null==r||r.sessionStorage.removeItem(e)}catch(e){sh.D(e)}}};class sc{constructor(e){this._instance=e}get qt(){return this._instance.config}get consent(){return this.Or()?0:this.Lr}isOptedOut(){return this.qt.cookieless_mode===iA||this.isRejected()||-1===this.consent&&this.qt.cookieless_mode===iT}isOptedIn(){return!this.isOptedOut()}isExplicitlyOptedOut(){return 0===this.consent}isRejected(){return 0===this.consent||-1===this.consent&&this.qt.opt_out_capturing_by_default}optInOut(e){this.Ar.N(this.Fr,+!!e,this.qt.cookie_expiration,this.qt.cross_subdomain_cookie,this.qt.secure_cookie)}reset(){this.Ar.q(this.Fr,this.qt.cross_subdomain_cookie)}get Fr(){var{token:e,opt_out_capturing_cookie_prefix:t,consent_persistence_name:i}=this._instance.config;
1return i||(t?t+e:"__ph_opt_in_out_"+e)}get Lr(){var e=this.Ar.A(this.Fr);return q(eo,e)?1:q(ea,e)?0:-1}get Ar(){var e=this.qt.opt_out_capturing_persistence_type,t="localStorage"===e?sn:ss;if(!this.Nr||this.Nr!==t){this.Nr=t;var i="localStorage"===e?ss:sn;i.A(this.Fr)&&(this.Nr.A(this.Fr)||this.optInOut(q(eo,i.A(this.Fr))),i.q(this.Fr,this.qt.cross_subdomain_cookie))}return this.Nr}Or(){return!!this.qt.respect_dnt&&[null==o?void 0:o.doNotTrack,null==o?void 0:o.msDoNotTrack,v.doNotTrack].some(e=>q(eo,e))}}function sd(e){return e instanceof Element&&(e.id===i$||!(null==e.closest||!e.closest(".toolbar-global-fade-container")))}function sp(e){return!!e&&1===e.nodeType}function sv(e,t){return!!e&&!!e.tagName&&e.tagName.toLowerCase()===t.toLowerCase()}function sg(e){return!!e&&3===e.nodeType}function s_(e){return!!e&&11===e.nodeType&&sp(e.host)}function sf(e){return e?D(e).split(/\s+/):[]}function sm(e){var t=null==r?void 0:r.location.href;return!!(t&&e&&e.some(e=>t.match(e)))}function sy(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 sf(t)}function sb(e){return Z(e)?null:D(e).split(/(\s+)/).filter(e=>sB(e)).join("").replace(/[\r\n]/g," ").replace(/[ ]+/g," ").substring(0,255)}function sx(e){var t="";return sA(e)&&!sL(e)&&e.childNodes&&e.childNodes.length&&iV(e.childNodes,function(e){var i;sg(e)&&e.textContent&&(t+=null!=(i=sb(e.textContent))?i:"")}),D(t)}function sw(e){var t;return J(e.target)?e.srcElement||null:null!=(t=e.target)&&t.shadowRoot?e.composedPath()[0]||null:e.target||null}var sE=["a","button","form","input","select","textarea","label"];function sk(e,t){if(J(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 sS(e){var t=e.parentNode;return!(!t||!sp(t))&&t}var sP=[".ph-no-autocapture","[data-ph-no-autocapture]"],sF=["next","previous","prev",">","<"],s$=[...sF,"+","-","â","â"],sI=(e,t)=>/[a-z0-9]/i.test(t)?e.includes(t):e===t,sC=[".ph-no-rageclick",".ph-no-capture"],sR=["","text","search","email","password","url","tel","number"];function sM(e,t){if(!r||sO(e)||(ee(t)?(s=!!t&&sC,n=void 0,o=!1):(s=null!=(a=null==t?void 0:t.css_selector_ignorelist)?a:sC,n=null==t?void 0:t.content_ignorelist,o=null!=(l=null==t?void 0:t.ignore_text_selection)&&l),!1===s)||o&&!(!(i=e)||!sp(i))&&(sv(i,"textarea")||(sv(i,"input")?q(sR,(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,s,n,o,a,l,{targetElementList:u}=sT(e,!1);return!function(e,t){var i;if(!1===e||J(e))return!1;if(!0===e)i=sF;else{if(!B(e))return!1;if(e.length>10)return tj.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{safeText:t,ariaLabel:s}=e;return i.some(e=>sI(t,e)||sI(s,e))})}(n,u.map(e=>{var t;return{safeText:sx(e).toLowerCase(),ariaLabel:(null==(t=e.getAttribute("aria-label"))?void 0:t.toLowerCase().trim())||""}}))&&!sk(u,s)}var sO=e=>!e||sv(e,"html")||!sp(e),sT=(e,t)=>{if(!r||sO(e))return{parentIsUsefulElement:!1,targetElementList:[]};for(var i=!1,s=[e],n=e;n.parentNode&&!sv(n,"body");)if(s_(n.parentNode))s.push(n.parentNode.host),n=n.parentNode.host;else{var o=sS(n);if(!o)break;if(t||sE.indexOf(o.tagName.toLowerCase())>-1)i=!0;else{var a=r.getComputedStyle(o);a&&"pointer"===a.getPropertyValue("cursor")&&(i=!0)}s.push(o),n=o}return{parentIsUsefulElement:i,targetElementList:s}};function sA(e){for(var t=e;t.parentNode&&!sv(t,"body");t=t.parentNode){var i=sy(t);if(q(i,"ph-sensitive")||q(i,"ph-no-capture"))return!1}if(q(sy(e),"ph-include"))return!0;var s=e.type||"";if(W(s))switch(s.toLowerCase()){case"hidden":case"password":return!1}
1var r=e.name||e.id||"";return!W(r)||!/^cc|cardnum|ccnum|creditcard|csc|cvc|cvv|exp|pass|pwd|routing|seccode|securitycode|securitynum|socialsec|socsec|ssn/i.test(r.replace(/[^a-zA-Z0-9]/g,""))}function sL(e){return!!(sv(e,"input")&&!["button","checkbox","submit","reset"].includes(e.type)||sv(e,"select")||sv(e,"textarea")||"true"===e.getAttribute("contenteditable"))}var sq="(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})",sD=RegExp("^(?:"+sq+")$"),sN=new RegExp(sq),sj="\\d{3}-?\\d{2}-?\\d{4}",sz=RegExp("^("+sj+")$"),sH=RegExp("("+sj+")");function sB(e,t){return void 0===t&&(t=!0),!(Z(e)||W(e)&&(e=D(e),(t?sD:sN).test((e||"").replace(/[- ]/g,""))||(t?sz:sH).test(e)))&&!0}function sU(e){var t=sx(e);return sB(t=(t+" "+function e(t){var i="";return t&&t.childNodes&&t.childNodes.length&&iV(t.childNodes,function(t){var s;if(t&&"span"===(null==(s=t.tagName)?void 0:s.toLowerCase()))try{var r=sx(t);i=(i+" "+r).trim(),t.childNodes&&t.childNodes.length&&(i=(i+" "+e(t)).trim())}catch(e){tj.error("[AutoCapture]",e)}}),i}(e)).trim())?t:""}function sG(e){return e.replace(/"|\\"/g,'\\"')}var sV=tz("[Dead Clicks]"),sJ=()=>!0,sW=e=>{var t,i=!(null==(t=e.instance.persistence)||!t.get_property(t0)),s=e.instance.config.capture_dead_clicks;return ee(s)?s:!!G(s)||i};class sY{get lazyLoadedDeadClicksAutocapture(){return this.Dr}constructor(e,t,i){this.instance=e,this.isEnabled=t,this.onCapture=i,this.startIfEnabledOrStop()}onRemoteConfig(e){"captureDeadClicks"in e&&(this.instance.persistence&&this.instance.persistence.register({[t0]:e.captureDeadClicks}),this.startIfEnabledOrStop())}startIfEnabledOrStop(){this.isEnabled(this)?this.$r(()=>{this.qr()}):this.stop()}$r(e){var t,i;null!=(t=v.__PosthogExtensions__)&&t.initDeadClicksAutocapture?e():null==(i=v.__PosthogExtensions__)||null==i.loadExternalDependency||i.loadExternalDependency(this.instance,"dead-clicks-autocapture",t=>{t?sV.error("failed to load script",t):e()})}qr(){var e;if(a){if(!this.Dr&&null!=(e=v.__PosthogExtensions__)&&e.initDeadClicksAutocapture){var t=G(this.instance.config.capture_dead_clicks)?this.instance.config.capture_dead_clicks:{};t.__onCapture=this.onCapture,this.Dr=v.__PosthogExtensions__.initDeadClicksAutocapture(this.instance,t),this.Dr.start(a),sV.info("starting...")}}else sV.error("`document` not found. Cannot start.")}stop(){this.Dr&&(this.Dr.stop(),this.Dr=void 0,sV.info("stopping..."))}}var sK=tz("[SegmentIntegration]"),sZ="posthog-js";function sQ(e,t){var{organization:i,projectId:s,prefix:r,severityAllowList:n=["error"],sendExceptionsToPostHog:o=!0}=void 0===t?{}:t;return t=>{if("*"!==n&&!n.includes(t.level)||!e.__loaded)return t;t.tags||(t.tags={});var a=e.requestRouter.endpointFor("ui","/project/"+e.config.token+"/person/"+e.get_distinct_id());t.tags["PostHog Person URL"]=a,e.sessionRecordingStarted()&&(t.tags["PostHog Recording URL"]=e.get_session_replay_url({withTimestamp:!0}));var l,u,h,c,d,p,v=(null==(l=t.exception)?void 0:l.values)||[],g=v.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})),_={$exception_message:(null==(u=v[0])?void 0:u.value)||t.message,$exception_type:null==(h=v[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=v[0])?void 0:c.value)||t.message,$sentry_exception_type:null==(d=v[0])?void 0:d.type,$sentry_tags:t.tags};return i&&s&&(_.$sentry_url=(r||"https://sentry.io/organizations/")+i+"/issues/?project="+s+"&query="+t.event_id),o&&(null==(p=e.exceptions)||p.sendExceptionEvent(_)),t}}class sX{constructor(e,t,i,s,r,n){this.name=sZ,this.setupOnce=function(o){o(sQ(e,{organization:t,projectId:i,prefix:s,severityAllowList:r,sendExceptionsToPostHog:null==n||n}))}}}class s0{constructor(e){this.jr=(e,t,i)=>{i&&(i.noSessionId||i.activityTimeout||i.sessionPastMaximumLength||i.crossTabAdoption)&&(tj.info("[PageViewManager] Session rotated, clearing pageview state",{sessionId:e,changeReason:i}),this.Br=void 0,this._instance.scrollManager.resetContext())},this._instance=e,this.Hr()}Hr(){var e;this.Ur=null==(e=this._instance.sessionManager)?void 0:e.onSessionId(this.jr)}destroy(){var e;null==(e=this.Ur)||e.call(this),this.Ur=void 0}doPageView(e,t){var i,s=this.zr(e,t);return this.Br={pathname:null!=(i=null==r?void 0:r.location.pathname)?i:"",pageViewId:t,timestamp:e},this._instance.scrollManager.resetContext(),s}doPageLeave(e){var t;return this.zr(e,null==(t=this.Br)?void 0:t.pageViewId)}doEvent(){var e;return{$pageview_id:null==(e=this.Br)?void 0:e.pageViewId}}zr(e,t){var i=this.Br;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{maxScrollHeight:n,lastScrollY:o,maxScrollY:a,maxContentHeight:l,lastContentY:u,maxContentY:h}=r;if(!(J(n)||J(o)||J(a)||J(l)||J(u)||J(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?el(o/n,0,1,tj):1,d=n>1?el(a/n,0,1,tj):1,p=l>1?el(u/l,0,1,tj):1,v=l>1?el(h/l,0,1,tj):1;s=iJ(s,{$prev_pageview_last_scroll:o,$prev_pageview_last_scroll_percentage:c,$prev_pageview_max_scroll:a,$prev_pageview_max_scroll_percentage:d,$prev_pageview_last_content:u,$prev_pageview_last_content_percentage:p,$prev_pageview_max_content:h,$prev_pageview_max_content_percentage:v})}}return i.pathname&&(s.$prev_pageview_pathname=i.pathname),i.timestamp&&(s.$prev_pageview_duration=(e.getTime()-i.timestamp.getTime())/1e3),s}}var s1=["flags","surveys"],s2={[tU]:{exposure:"hidden"}
1,[tV]:{exposure:"hidden"},__cmpns:{exposure:"hidden"},[tJ]:{exposure:"hidden"},[tW]:{exposure:"event"},[tY]:{exposure:"hidden"},[tK]:{exposure:"event"},[tZ]:{exposure:"hidden"},[tQ]:{exposure:"event"},[tX]:{exposure:"event"},[t0]:{exposure:"event"},[t1]:{exposure:"hidden"},[t2]:{exposure:"event"},[t3]:{exposure:"hidden"},$session_recording_enabled_server_side:{exposure:"hidden"},[t9]:{exposure:"hidden"},[ie]:{exposure:"event"},[t5]:{exposure:"event",shouldSkipFromEventProperties:e=>K(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"},[it]:{exposure:"derived",storageGroup:"flags",shouldSkipFromEventProperties:(e,t)=>t(),transformToEventProperties(e){if(!G(e))return{};for(var t={},i=Object.keys(e),s=0;i.length>s;s++)t["$feature/"+i[s]]=e[i[s]];return t}},[ii]:{exposure:"event",storageGroup:"flags"},[is]:{exposure:"hidden"},[ir]:{exposure:"hidden",storageGroup:"flags"},[io]:{exposure:"event",storageGroup:"flags"},[ia]:{exposure:"event",storageGroup:"flags",volatile:!0},[il]:{exposure:"event"},[iu]:{exposure:"hidden"},[ih]:{exposure:"hidden"},[ic]:{exposure:"hidden"},[id]:{exposure:"hidden",storageGroup:"surveys"},[ip]:{exposure:"hidden",storageGroup:"surveys",volatile:!0},[iv]:{exposure:"event"},[ig]:{exposure:"hidden"},$product_tours_activated:{exposure:"hidden"},$conversations_widget_session_id:{exposure:"event"},$conversations_ticket_id:{exposure:"event"},$conversations_widget_state:{exposure:"event"},$conversations_user_traits:{exposure:"event"},[i_]:{exposure:"hidden"},[im]:{exposure:"hidden"},[iy]:{exposure:"hidden"},[ib]:{exposure:"hidden",storageGroup:"flags",volatile:!0},[ix]:{exposure:"hidden"},[iw]:{exposure:"hidden"},[iE]:{exposure:"hidden"},[ik]:{exposure:"hidden"},[iS]:{exposure:"hidden"},[iP]:{exposure:"hidden"}
1,[iF]:{exposure:"hidden"},[t8]:{exposure:"event"},[t6]:{exposure:"event"},[t4]:{exposure:"event"},[t7]:{exposure:"event"},[iC]:{exposure:"event"},[iR]:{exposure:"event"},[iM]:{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"},$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"}},s3=[["$posthog_sr_group_event_trigger_",{exposure:"hidden"}],["$posthog_sr_group_url_trigger_",{exposure:"hidden"}],["$posthog_sr_group_sampling_",{exposure:"hidden"}]],s5=e=>{var t=s2[e];if(t)return t;for(var[i,s]of s3)if(0===e.indexOf(i))return s},s8=e=>{var t=null==a?void 0:a.createElement("a");return J(t)?null:(t.href=e,t)},s6=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){tj.error("Skipping decoding for malformed query param: "+o)}return o.replace(/\+/g," ")},s4=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},s7=function(e,t){var i=e.match(RegExp(t+"=([^&]*)"));return i?i[1]:null},s9="https?://(.*)",re=["gclid","gclsrc","dclid","gbraid","wbraid","fbclid","msclkid","twclid","li_fat_id","igshid","ttclid","rdt_cid","epik","qclid","sccid","irclid","_kx"],rt=["utm_source","utm_medium","utm_campaign","utm_content","utm_term","gad_source","mc_cid",...re],r
1i="<masked>",rs=["li_fat_id"];function rr(e,t,i){if(!a)return{};var s,r=t?[...re,...i||[]]:[],n=rn(s4(a.URL,r,ri),e);return iJ((s={},iV(rs,function(e){var t=ss.A(e);s[e]=t||null}),s),n)}function rn(e,t){var i=rt.concat(t||[]),s={};return iV(i,function(t){var i=s6(e,t);s[t]=i||null}),s}function ro(e){var t=e?0===e.search(s9+"google.([^/?]*)")?"google":0===e.search(s9+"bing.com")?"bing":0===e.search(s9+"yahoo.com")?"yahoo":0===e.search(s9+"duckduckgo.com")?"duckduckgo":null:null,i={};if(!K(t)){i.$search_engine=t;var s=a?s6(a.referrer,"yahoo"!=t?"q":"p"):"";s.length&&(i.ph_keyword=s)}return i}function ra(){return navigator.language||navigator.userLanguage}var rl="$direct";function ru(){return(null==a?void 0:a.referrer)||rl}function rh(e,t){var i=e?[...re,...t||[]]:[],s=null==l?void 0:l.href.substring(0,1e3);return{r:ru().substring(0,1e3),u:s?s4(s,i,ri):void 0}}function rc(e){var t,{r:i,u:s}=e,r={$referrer:i,$referring_domain:null==i?void 0:i==rl?rl:null==(t=s8(i))?void 0:t.host};if(s){r.$current_url=s;var n=s8(s);r.$host=null==n?void 0:n.host,r.$pathname=null==n?void 0:n.pathname,iJ(r,rn(s))}return i&&iJ(r,ro(i)),r}function rd(){try{return Intl.DateTimeFormat().resolvedOptions().timeZone}catch(e){return}}var rp={flags:ib,surveys:ip},rv=["cookie","localstorage","localstorage+cookie","sessionstorage","memory"],rg="main";class r_{constructor(e,t,i){if(void 0===i&&(i=!0),this.Vr={},this.Wr=!1,this.Gr=!1,this.qt=e,this.Zr=i,this.props={},this.Qr=!1,this.Jr=(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.Ar=this.Kr(e),this.Gr=this.Yr(e),this.load(),e.debug&&tj.info("Persistence loaded",e.persistence,y({},this.props)),this.update_config(e,e,t),this.save(),r){var s=()=>this.flush();iX(r,"beforeunload",s,{capture:!1}),iX(r,"pagehide",s,{capture:!1})}}Xr(){var e,t=null==(e=this.qt)?void 0:e.persistence_save_debounce_ms;return Q(t)&&t>0?t:0}isDisabled(){return!!this.ei}Kr(e){-1===rv.indexOf(e.persistence.toLowerCase())&&(tj.critical("Unknown persistence type "+e.persistence+"; falling back to localStorage+cookie"),e.persistence="localStorage+cookie");var t,i,s,n,o=(t=e.cookie_persisted_properties||[],i=e.__preview_cookie_wins_on_conflict||!1,void 0===t&&(t=[]),void 0===i&&(i=!1),s=[...so,...t],y({},sn,{F(e){try{var t={};try{t=ss.F(e)||{}}catch(e){}var s,r=JSON.parse(sn.A(e)||"{}");if(i){var n={};for(var o in t){var a=t[o];K(a)||""===a||(n[o]=a)}s=iJ(r,n)}else s=iJ(t,r);return sn.N(e,s),s}catch(e){}return null},N(e,t,i,r,n,o){var a=sn.N(e,t,void 0,void 0,o);try{var l={};s.forEach(e=>{t[e]&&(l[e]=t[e])}),Object.keys(l).length&&ss.N(e,l,i,r,n,o)}catch(e){sn.D(e)}return a},q(e,t){try{null==r||r.localStorage.removeItem(e),ss.q(e,t)}catch(e){sn.D(e)}}})),a=!1,l=e.persistence.toLowerCase();return"localstorage"===l&&sn.O()?(n=sn,a=!0):"localstorage+cookie"===l&&o.O()?(n=o,a=!0):"sessionstorage"===l&&sh.O()?n=sh:"memory"===l?n=sl:"cookie"===l?n=ss:o.O()?(n=o,a=!0):n=ss,this.Wr=a,n}ti(e){return this.Jr+"__"+e}Yr(e){return this.Wr&&!!e.split_storage}ri(e){var t=null!=e?e:this.qt.feature_flag_cache_ttl_ms;if(!t||0>=t)return!1;var i=this.props[ib];return!i||"number"!=typeof i||Date.now()-i>t}properties(){var e={};return iV(this.props,(t,i)=>{var s=s5(i);if("derived"===(null==s?void 0:s.exposure)){if(null!=s.shouldSkipFromEventProperties&&s.shouldSkipFromEventProperties(t,i===it?()=>this.ri():()=>!1))return;s.transformToEventProperties&&iJ(e,s.transformToEventProperties(t))}else if(!s||"event"===s.exposure){if(null!=s&&null!=s.shouldSkipFromEventProperties&&s.shouldSkipFromEventProperties(t,()=>!1))return;e[i]=t}}),e}load(){if(!this.ei){var e=this.Ar.F(this.Jr);e&&(this.props=iJ({},e)),this.Gr&&this.ii()}}ii(){for(var e of s1){var t=sn.F(this.ti(e));if(t&&!V(t)){var i=this.ni(e);i.persisted=!0,this.si(e)||(i.fingerprint=this.oi(t,e)),this.ai(e,t)||iJ(this.props,t)}}}si(e){return Object.keys(this.props).some(t=>{var i;return(null==(i=s5(t))?void 0:i.storageGroup)===e})}ai(e,t){var i=rp[e];if(!i)return!1;var s=t[i],r=this.props[i];return Q(s)&&Q(r)&&r>s}refreshKey(e){var t;if(!this.ei){var i=this.Gr?null==(t=s5(e))?void 0:t.storageGroup:void 0,s=i?sn.F(this.ti(i)):this.Ar.F(this.Jr);if(s&&e in s)this.li(e,s[e]);else{if(i){var r=this.Ar.F(this.Jr);if(r&&e in r)return void this.li(e,r[e])}this.ui(e)}}}save(){if(!this.ei){var e=this.Xr();e>0?J(this.hi)&&(this.hi=setTimeout(()=>{this.hi=void 0,this.ci()},e)):this.ci()}}flush(){J(this.hi)||(clearTimeout(this.hi),this.hi=void 0,this.ci())}ci(){this.ei||(this.Gr?this.di():this.vi(this.Ar,this.Jr,this.props,rg))}di(){var{main:e,groups:t}=this.fi();for(var i of(this.vi(this.Ar,this.Jr,e,rg),s1)){var s,r=t[i];(!V(r)||null!=(s=this.Vr[i])&&s.persisted)&&this.vi(sn,this.ti(i),r,i)}}fi(){var e={},t={};for(var i of s1)t[i]={};return iV(this.props,(i,s)=>{var r,n=null==(r=s5(s))?void 0:r.storageGroup;n?t[n][s]=i:e[s]=i}),{main:e,groups:t}}oi(e,t){if(t===rg)return JSON.stringify(e)+"|"+this.pi+"|"+this.gi+"|"+this.mi;var i={};return iV(e,(e,t)=>{var s;i[t]=null!=(s=s5(t))&&s.volatile?"__volatile__":e}),JSON.stringify(i)}vi(e,t,i,s){var r,n=this.ni(s);if(s===rg||n.dirty||J(n.fingerprint)){try{if((r=this.oi(i,s))===n.fingerprint)return void(n.dirty=!1)}catch(e){r=void 0}e.N(t,i,this.pi,this.gi,this.mi,this.qt.debug)?(n.dirty=!1,s!==rg&&(n.persisted=!0),J(r)||(n.fingerprint=r)):this.qt.debug&&tj.warn('failed to persist storage entry "'+t+'"; will retry on next save')}}remove(e){var{keepGroupEntries:t=!1}=void 0===e?{}:e;if(J(this.hi)||(clearTimeout(this.hi),this.hi=void 0),this.Ar.q(this.Jr,!1),this.Ar.q(this.Jr,!0),!t&&this.Zr)for(var i of s1)sn.q(this.ti(i));t?delete this.Vr[rg]:this.Vr={}}clear(){this.remove(),this.props={}}register_once(e,t,i){if(G(e)){J(t)&&(t="None"),this.pi=J(i)?this.yi:i;var s=!1;if(iV(e,(e,i)=>{this.props.hasOwnProperty(i)&&this.props[i]!==t||(this.li(i,e),s=!0)}),s)return this.save(),!0}return!1}register(e,t){if(G(e)){this.pi=J(t)?this.yi:t;var i=!1;if(iV(e,(t,s)=>{e.hasOwnProperty(s)&&this.props[s]!==t&&(this.li(s,t),i=!0)}),i)return this.save(),!0}return!1}unregister(e){e in this.props&&(this.ui(e),this.save())}update_campaign_params(){if(!this.Qr){var e=rr(this.qt.custom_campaign_params,this.qt.mask_personal_data_properties,this.qt.custom_personal_data_properties);V(iZ(e))||this.register(e),this.Qr=!0}}update_search_keyword(){var e;this.register((e=null==a?void 0:a.referrer)?ro(e):{})}update_referrer_info(){var e;this.register_once({$referrer:ru(),$referring_domain:null!=a&&a.referrer&&(null==(e=s8(a.referrer))?void 0:e.host)||rl},void 0)}set_initial_person_info(){this.props[ik]||this.props[iS]||this.register_once({[iP]:rh(this.qt.mask_personal_data_properties,this.qt.custom_personal_data_properties)},void 0)}get_initial_props(){var e={};iV([iS,ik],t=>{var i=this.props[t];i&&iV(i,function(t,i){e["$initial_"+N(i)]=t})});var t,i,s=this.props[iP];return s&&iJ(e,(t=rc(s),i={},iV(t,function(e,t){i["$initial_"+N(t)]=e}),i)),e}safe_merge(e){return iV(this.props,function(t,i){i in e||(e[i]=t)}),e}update_config(e,t,i){this.yi=this.pi=e.cookie_expiration,this.set_disabled(e.disable_persistence||!!i),this.set_cross_subdomain(e.cross_subdomain_cookie),this.set_secure(e.secure_cookie);var s=e.persistence!==t.persistence||!((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||[]),r=s?this.Kr(e):this.Ar,n=this.Yr(e);if(s||n!==this.Gr){var o=this.props;this.clear(),this.Ar=r,this.Gr=n,this.props=o,this.save()}}set_disabled(e){this.ei=e,this.ei?this.remove():this.save()}set_cross_subdomain(e){e!==this.gi&&(this.gi=e,this.remove({keepGroupEntries:!0}),this.save())}set_secure(e){e!==this.mi&&(this.mi=e,this.remove({keepGroupEntries:!0}),this.save())}set_event_timer(e,t){var i=this.props[tJ]||{};i[e]=t,this.li(tJ,i),this.save()}remove_event_timer(e){var t=this.props[tJ]||{},i=t[e];return J(i)||(delete t[e],this.li(tJ,t),this.save()),i}get_property(e){return this.props[e]}set_property(e,t){this.li(e,t),this.save()}li(e,t){var i;this.props[e]=t,null!=(i=s5(e))&&i.volatile||this.bi(e)}ui(e){delete this.props[e],this.bi(e)}bi(e){var t,i=null==(t=s5(e))?void 0:t.storageGroup;i&&(this.ni(i).dirty=!0)}ni(e){return this.Vr[e]||(this.Vr[e]={})}}var rf="events",rm="cancelEvents",ry="survey shown",rb="survey dismissed",rx="survey sent",rw="popover",rE=tz("[RateLimiter]");class rk{constructor(e){this.serverLimits={},this.lastEventRateLimited=!1,this.checkForLimiting=e=>{var t=e.text;
1if(t&&t.length)try{(JSON.parse(t).quota_limited||[]).forEach(e=>{rE.info((e||"events")+" is quota limited."),this.serverLimits[e]=(new Date).getTime()+6e4})}catch(e){return void rE.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,{captureEventsBurstLimit:r,captureEventsPerSecond:n}=this,o=(new Date).getTime(),a=null!=(t=null==(i=this.instance.persistence)?void 0:i.get_property(iE))?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;return l||e||(a.tokens=Math.max(0,a.tokens-1)),!l||this.lastEventRateLimited||e||this.instance.capture("$$client_ingestion_warning",{$$client_ingestion_warning_message:"posthog-js client rate limited. Config is set to "+n+" events per second and "+r+" events burst limit."},{skip_client_rate_limiting:!0}),this.lastEventRateLimited=l,null==(s=this.instance.persistence)||s.set_property(iE,a),{isRateLimited:l,remainingTokens:a.tokens}}isServerRateLimited(e){var t=this.serverLimits[e||"events"]||!1;return!1!==t&&(new Date).getTime()<t}}var rS=tz("[RemoteConfig]");class rP{constructor(e){this._instance=e}get remoteConfig(){var e;return null==(e=v._POSTHOG_REMOTE_CONFIG)||null==(e=e[this._instance.config.token])?void 0:e.config}wi(e){var t,i;null!=(t=v.__PosthogExtensions__)&&t.loadExternalDependency?null==(i=v.__PosthogExtensions__)||null==i.loadExternalDependency||i.loadExternalDependency(this._instance,"remote-config",()=>e(this.remoteConfig)):e()}xi(e){this._instance._send_request({method:"GET",url:this._instance.requestRouter.endpointFor("assets","/array/"+this._instance.config.token+"/config"),callback(t){e(t.json)}})}load(){try{if(this.remoteConfig)return rS.info("Using preloaded remote config",this.remoteConfig),this.ki(this.remoteConfig),void this.Si();if(this._instance.Ci())return void rS.warn("Remote config is disabled. Falling back to local config.");this.wi(e=>{e?(this.ki(e),this.Si()):(rS.info("No config found after loading remote JS config. Falling back to JSON."),this.xi(e=>{this.ki(e),this.Si()}))})}catch(e){rS.error("Error loading remote config",e)}}stop(){this.Ii&&(clearInterval(this.Ii),this.Ii=void 0)}refresh(){!this._instance.Ci()&&a&&"hidden"!==a.visibilityState&&this._instance.reloadFeatureFlags()}Si(){var e;if(!this.Ii){var t=null!=(e=this._instance.config.remote_config_refresh_interval_ms)?e:3e5;0!==t&&(this.Ii=setInterval(()=>{this.refresh()},t))}}ki(e){var t;e||rS.error("Failed to fetch remote config from PostHog."),this._instance.ki(null!=e?e:{}),!1!==(null==e?void 0:e.hasFeatureFlags)&&(this._instance.config.advanced_disable_feature_flags_on_first_load||null==(t=this._instance.featureFlags)||t.ensureFlagsLoaded())}}var rF="gzip-js",r$="base64",rI=Uint8Array,rC=Uint16Array,rR=Uint32Array,rM=new rI([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]),rO=new rI([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]),rT=new rI([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),rA=function(e,t){for(var i=new rC(31),s=0;31>s;++s)i[s]=t+=1<<e[s-1];var r=new rR(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]},rL=rA(rM,2),rq=rL[1];rL[0][28]=258,rq[258]=28;for(var rD=rA(rO,0)[1],rN=new rC(32768),rj=0;32768>rj;++rj){var rz=(43690&rj)>>>1|(21845&rj)<<1;rN[rj]=((65280&(rz=(61680&(rz=(52428&rz)>>>2|(13107&rz)<<2))>>>4|(3855&rz)<<4))>>>8|(255&rz)<<8)>>>1}var rH=function(e,t,i){for(var s=e.length,r=0,n=new rC(t);s>r;++r)++n[e[r]-1];var o,a=new rC(t);for(r=0;t>r;++r)a[r]=a[r-1]+n[r-1]<<1;if(i){o=new rC(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[rN[c]>>>l]=u}else for(o=new rC(s),r=0;s>r;++r)o[r]=rN[a[e[r]-1]++]>>>15-e[r];return o},rB=new rI(288);for(rj=0;144>rj;++rj)rB[rj]=8;for(rj=144;256>rj;++rj)rB[rj]=9;for(rj=256;280>rj;++rj)rB[rj]=7;for(rj=280;288>rj;++rj)rB[rj]=8;var rU=new rI(32);for(rj=0;32>rj;++rj)rU[rj]=5;var rG=rH(rB,9,0),rV=rH(rU,5,0),rJ=function(e){return(e/8|0)+(7&e&&1)},rW=function(e,t,i){(null==i||i>e.length)&&(i=e.length);var s=new(e instanceof rC?rC:e instanceof rR?rR:rI)(i-t);return s.set(e.subarray(t,i)),s},rY=function(e,t,i){var s=t/8|0;e[s]|=i<<=7&t,e[s+1]|=i>>>8},rK=function(e,t,i){var s=t/8|0;e[s]|=i<<=7&t,e[s+1]|=i>>>8,e[s+2]|=i>>>16},rZ=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 rI(0),0];if(1==r){var o=new rI(i[0].s+1);return o[i[0].s]=1,[o,1]}i.sort(function(e,t){return e.f-t.f}),i.push({s:-1,f:25001});var a=i[0],l=i[1],u=0,h=1,c=2;for(i[0]={s:-1,f:a.f+l.f,l:a,r:l};h!=r-1;)a=i[i[c].f>i[u].f?u++:c++],l=i[u!=h&&i[c].f>i[u].f?u++:c++],i[h++]={s:-1,f:a.f+l.f,l:a,r:l};var d=n[0].s;for(s=1;r>s;++s)n[s].s>d&&(d=n[s].s);var p=new rC(d+1),v=rQ(i[h-1],p,0);if(v>t){s=0;var g=0,_=v-t,f=1<<_;for(n.sort(function(e,t){return p[t.s]-p[e.s]||e.f-t.f});r>s;++s){var m=n[s].s;if(t>=p[m])break;g+=f-(1<<v-p[m]),p[m]=t}for(g>>>=_;g>0;){var y=n[s].s;t>p[y]?g-=1<<t-p[y]++-1:++s}for(;s>=0&&g;--s){var b=n[s].s;p[b]==t&&(--p[b],++g)}v=t}return[new rI(p),v]},rQ=function(e,t,i){return -1==e.s?Math.max(rQ(e.l,t,i+1),rQ(e.r,t,i+1)):t[e.s]=i},rX=function(e){for(var t=e.length;t&&!e[--t];);for(var i=new rC(++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]},r0=function(e,t){for(var i=0,s=0;t.length>s;++s)i+=e[s]*t[s];return i},r1=function(e,t,i){var s=i.length,r=rJ(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)},r2=function(e,t,i,s,r,n,o,a,l,u,h){rY(t,h++,i),++r[256];for(var c=rZ(r,15),d=c[0],p=c[1],v=rZ(n,15),g=v[0],_=v[1],f=rX(d),m=f[0],y=f[1],b=rX(g),x=b[0],w=b[1],E=new rC(19),k=0;m.length>k;++k)E[31&m[k]]++;for(k=0;x.length>k;++k)E[31&x[k]]++;for(var S=rZ(E,7),P=S[0],F=S[1],$=19;$>4&&!P[rT[$-1]];--$);var I,C,R,M,O=u+5<<3,T=r0(r,rB)+r0(n,rU)+o,A=r0(r,d)+r0(n,g)+o+14+3*$+r0(E,P)+(2*E[16]+3*E[17]+7*E[18]);if(T>=O&&A>=O)return r1(t,h,e.subarray(l,l+u));if(rY(t,h,1+(T>A)),h+=2,T>A){I=rH(d,p,0),C=d,R=rH(g,_,0),M=g;var L=rH(P,F,0);for(rY(t,h,y-257),rY(t,h+5,w-1),rY(t,h+10,$-4),h+=14,k=0;$>k;++k)rY(t,h+3*k,P[rT[k]]);h+=3*$;for(var q=[m,x],D=0;2>D;++D){var N=q[D];for(k=0;N.length>k;++k)rY(t,h,L[j=31&N[k]]),h+=P[j],j>15&&(rY(t,h,N[k]>>>5&127),h+=N[k]>>>12)}}else I=rG,C=rB,R=rV,M=rU;for(k=0;a>k;++k)if(s[k]>255){rK(t,h,I[257+(j=s[k]>>>18&31)]),h+=C[j+257],j>7&&(rY(t,h,s[k]>>>23&31),h+=rM[j]);var j,z=31&s[k];rK(t,h,R[z]),h+=M[z],z>3&&(rK(t,h,s[k]>>>5&8191),h+=rO[z])}else rK(t,h,I[s[k]]),h+=C[s[k]];return rK(t,h,I[256]),h+C[256]},r3=new rR([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),r5=function(){for(var e=new rR(256),t=0;256>t;++t){for(var i=t,s=9;--s;)i=(1&i&&0xedb88320)^i>>>1;e[t]=i}return e}(),r8=function(e,t,i){for(;i;++t)e[t]=i,i>>>=8},r6=!!h||!!u,r4="text/plain",r7=!1,r9=function(e,t,i){void 0===i&&(i=!0);var s,r,n,o,a,[l,u]=e.split("?"),h=y({},t),c=null!=(a=null==u?void 0:u.split("&").map(e=>{var t,[s,r]=e.split("="),n=i&&null!=(t=h[s])?t:r;return delete h[s],s+"="+n}))?a:[],d=(void 0===s&&(s="&"),o=[],iV(h,function(e,t){J(e)||J(t)||"undefined"===t||(r=encodeURIComponent(e instanceof File?e.name:e.toString()),n=encodeURIComponent(t),o[o.length]=n+"="+r)}),o.join(s));return d&&c.push(d),l+"?"+c.join("&")},ne=(e,t)=>JSON.stringify(e,(e,t)=>"bigint"==typeof t?t.toString():t,t),nt=e=>{if(e.Rr)return e.Rr;var{data:t,compression:i}=e;if(t){if(i===rF){var s,r,n,o,a,l,u,h,c=(s=function(e){var t=e.length;if("u">typeof TextEncoder)return(new TextEncoder).encode(e);for(var i=new rI(e.length+(e.length>>>1)),s=0,r=function(e){i[s++]=e},n=0;t>n;++n){if(s+5>i.length){var o=new rI(s+8+(t-n<<1));o.set(i),i=o}var a=e.charCodeAt(n);128>a?r(a):(2048>a?r(192|a>>>6):(a>55295&&57344>a?(r(240|(a=65536+(1047552&a)|1023&e.charCodeAt(++n))>>>18),r(128|a>>>12&63)):r(224|a>>>12),r(128|a>>>6&63)),r(128|63&a))}return rW(i,0,s)}(ne(t)),r={mtime:0},n=0xffffffff,o={p(e){for(var t=n,i=0;e.length>i;++i)t=r5[255&t^e[i]]^t>>>8;n=t},d:()=>0xffffffff^n},a=s.length,o.p(s),h=(l=10+(r.filename&&r.filename.length+1||0),u=function(e,t,i,s){var r=e.length,n=new rI(s+r+5*(1+Math.floor(r/7e3))+8),o=n.subarray(s,n.length-8),a=0;if(!t||8>r)for(var l=0;r>=l;l+=65535){var u=l+65535;r>u?a=r1(o,a,e.subarray(l,u)):(o[l]=!0,a=r1(o,a,e.subarray(l,r)))}else{for(var h=r3[t-1],c=h>>>13,d=8191&h,p=(1<<i)-1,v=new rC(32768),g=new rC(p+1),_=Math.ceil(i/3),f=2*_,m=function(t){return(e[t]^e[t+1]<<_^e[t+2]<<f)&p},y=new rR(25e3),b=new rC(288),x=new rC(32),w=0,E=0,k=(l=0,0),S=0,P=0;r>l;++l){var F=m(l),$=32767&l,I=g[F];if(v[$]=I,g[F]=$,l>=S){var C=r-l;if((w>7e3||k>24576)&&C>423){a=r2(e,o,0,y,b,x,E,k,P,l-P,a),k=w=E=0,P=l;for(var R=0;286>R;++R)b[R]=0;for(R=0;30>R;++R)x[R]=0}var M=2,O=0,T=d,A=$-I&32767;if(C>2&&F==m(l-A))for(var L=Math.min(c,C)-1,q=Math.min(32767,l),D=Math.min(258,C);q>=A&&--T&&$!=I;){if(e[l+M]==e[l+M-A]){for(var N=0;D>N&&e[l+N]==e[l+N-A];++N);if(N>M){if(M=N,O=A,N>L)break;var j=Math.min(A,N-2),z=0;for(R=0;j>R;
1++R){var H=l-A+R+32768&32767,B=H-v[H]+32768&32767;B>z&&(z=B,I=H)}}}A+=($=I)-(I=v[$])+32768&32767}if(O){y[k++]=0x10000000|rq[M]<<18|rD[O];var U=31&rq[M],G=31&rD[O];E+=rM[U]+rO[G],++b[257+U],++x[G],S=l+M,++w}else y[k++]=e[l],++b[e[l]]}}a=r2(e,o,!0,y,b,x,E,k,P,l-P,a)}return rW(n,0,s+rJ(a)+8)}(s,null==r.level?6:r.level,null==r.mem?Math.ceil(1.5*Math.max(8,Math.min(13,Math.log(s.length)))):12+r.mem,l)).length,function(e,t){var i=t.filename;if(e[0]=31,e[1]=139,e[2]=8,e[8]=2>t.level?4:2*(9==t.level),e[9]=3,0!=t.mtime&&r8(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)}}(u,r),r8(u,h-8,o.d()),r8(u,h-4,a),u);return{contentType:r4,body:c.buffer.slice(c.byteOffset,c.byteOffset+c.byteLength),estimatedSize:c.byteLength}}if(i===r$){let e;var d,p="data="+encodeURIComponent("string"==typeof(e=(d=ne(t))?btoa(encodeURIComponent(d).replace(/%([0-9A-F]{2})/g,(e,t)=>String.fromCharCode(parseInt(t,16)))):d)?e:ne(e));return{contentType:"application/x-www-form-urlencoded",body:p,estimatedSize:new Blob([p]).size}}var v=ne(t);return{contentType:"application/json",body:v,estimatedSize:new Blob([v]).size}}},ni=e=>{var t,i,s,r=nt(e);return!r||(i=e.compression,s=s6(e.url,"compression"),i!==P.GZipJS&&s!==P.GZipJS&&"gzip"!==s)||((t=r.body)instanceof ArrayBuffer?C(new Uint8Array(t)):ArrayBuffer.isView(t)&&C(new Uint8Array(t.buffer,t.byteOffset,t.byteLength)))?{url:e.url,encodedBody:r}:(r7=!0,{url:((e,t)=>{var[i,s]=e.split("#"),[r,n]=i.split("?");if(!n)return e;var o=n.split("&").filter(e=>e.split("=")[0]!==t).join("&");return r+(o?"?"+o:"")+(s?"#"+s:"")})(e.url,"compression"),encodedBody:nt(y({},e,{compression:void 0,Rr:void 0}))})},ns=(nM=m(function*(e){var t=ne(e.data),i=yield function(e,t,i){return T.apply(this,arguments)}(t,_.DEBUG,{rethrow:!0});if(!i)return e;var s=yield i.arrayBuffer();return y({},e,{Rr:{contentType:r4,body:s,estimatedSize:s.byteLength}})}),function(e){return nM.apply(this,arguments)}),nr=(e,t)=>
1r9(e,{_:(new Date).getTime().toString(),ver:_.JS_SDK_VERSION,compression:t}),nn=[];u&&nn.push({transport:"fetch",method(e){var t,{url:i,encodedBody:s}=ni(e),{contentType:r,body:n,estimatedSize:o}=null!=s?s:{},a=new Headers;iV(e.headers,function(e,t){a.append(t,e)}),r&&a.append("Content-Type",r);var l=null;if(c){var h=new c;l={signal:h.signal,timeout:setTimeout(()=>h.abort(),e.timeout)}}u(i,y({method:(null==e?void 0:e.method)||"GET",headers:a,keepalive:"POST"===e.method&&52428.8>(o||0),body:n,signal:null==(t=l)?void 0:t.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){tj.error(e)}null==e.callback||e.callback(s)})).catch(t=>{tj.error(t),null==e.callback||e.callback({statusCode:0,error:t})}).finally(()=>l?clearTimeout(l.timeout):null)}}),h&&nn.push({transport:"XHR",method(e){var t=new h,{url:i,encodedBody:s}=ni(e);t.open(e.method||"GET",i,!0);var{contentType:r,body:n}=null!=s?s:{};iV(e.headers,function(e,i){t.setRequestHeader(i,e)}),r&&t.setRequestHeader("Content-Type",r),e.timeout&&(t.timeout=e.timeout),t.onreadystatechange=()=>{if(4===t.readyState){var i={statusCode:t.status,text:t.responseText};if(200===t.status)try{i.json=JSON.parse(t.responseText)}catch(e){}null==e.callback||e.callback(i)}},t.send(n)}}),null!=o&&o.sendBeacon&&nn.push({transport:"sendBeacon",method(e){try{var{url:t,encodedBody:i}=ni(e),s=r9(t,{beacon:"1"}),{contentType:r,body:n}=null!=i?i:{};if(!n)return;var a=n instanceof Blob?n:new Blob([n],{type:r});o.sendBeacon(s,a)}catch(e){}}});
1class no{constructor(e,t){this.Ti=!0,this.Ei=[],this.Mi=el((null==t?void 0:t.flush_interval_ms)||3e3,250,5e3,tj.createLogger("flush interval"),3e3),this.Pi=e}enqueue(e){this.Ei.push(e),this.Ri||this.Oi()}unload(){this.Li();var e=Object.values(this.Ei.length>0?this.Ai():{});[...e.filter(e=>0===e.url.indexOf("/e")),...e.filter(e=>0!==e.url.indexOf("/e"))].map(e=>{this.Pi(y({},e,{transport:"sendBeacon"}))})}enable(){this.Ti=!1,this.Oi()}Oi(){var e=this;this.Ti||(this.Ri=setTimeout(()=>{if(this.Li(),this.Ei.length>0){var t=this.Ai();for(var i in t)!function(){var s=t[i],r=(new Date).getTime();s.data&&B(s.data)&&iV(s.data,e=>{e.offset=Math.abs(e.timestamp-r),delete e.timestamp}),e.Pi(s)}()}},this.Mi))}Li(){clearTimeout(this.Ri),this.Ri=void 0}Ai(){var e={};return iV(this.Ei,t=>{var i,s=(t?t.batchKey:null)||t.url;J(e[s])&&(e[s]=y({},t,{data:[]})),null==(i=e[s].data)||i.push(t.data)}),this.Ei=[],e}}var na=["retriesPerformedSoFar"];class nl{constructor(e){this.Fi=!1,this.Ni=3e3,this.Ei=[],this._instance=e,this.Ei=[],this.Di=!0,!J(r)&&"onLine"in r.navigator&&(this.Di=r.navigator.onLine,this.$i=()=>{this.Di=!0,this.qi()},this.ji=()=>{this.Di=!1},iX(r,"online",this.$i),iX(r,"offline",this.ji))}get length(){return this.Ei.length}retriableRequest(e){var{retriesPerformedSoFar:t}=e,i=b(e,na);X(t)&&(i.url=r9(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.yr(y({retriesPerformedSoFar:t},i));0===e.statusCode&&tj.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)}}))}yr(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.Ei.push({retryAt:n,requestOptions:e});var o="Enqueued failed request for retry in "+r;navigator.onLine||(o+=" (Browser is offline)"),tj.warn(o),this.Fi||(this.Fi=!0,this.Bi())}Bi(){(this.Hi&&clearTimeout(this.Hi),0===this.Ei.length)?(this.Fi=!1,this.Hi=void 0):this.Hi=setTimeout(()=>{this.Di&&this.Ei.length>0&&this.qi(),this.Bi()},this.Ni)}qi(){var e=Date.now(),t=[],i=this.Ei.filter(i=>e>i.retryAt||(t.push(i),!1));if(this.Ei=t,i.length>0)for(var{requestOptions:s}of i)this.retriableRequest(s)}unload(){for(var{requestOptions:e}of(this.Hi&&(clearTimeout(this.Hi),this.Hi=void 0),this.Fi=!1,J(r)||(this.$i&&(r.removeEventListener("online",this.$i),this.$i=void 0),this.ji&&(r.removeEventListener("offline",this.ji),this.ji=void 0)),this.Ei))try{this._instance._send_request(y({},e,{transport:"sendBeacon"}))}catch(e){tj.error(e)}this.Ei=[]}}class nu{constructor(e){this.Ui=()=>{this.zi||(this.zi={});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.zi.lastScrollY=Math.ceil(n),this.zi.maxScrollY=Math.max(n,null!=(e=this.zi.maxScrollY)?e:0),this.zi.maxScrollHeight=Math.max(o,null!=(t=this.zi.maxScrollHeight)?t:0),this.zi.lastContentY=a,this.zi.maxContentY=Math.max(a,null!=(i=this.zi.maxContentY)?i:0),this.zi.maxContentHeight=Math.max(l,null!=(s=this.zi.maxContentHeight)?s:0)},this._instance=e}get Vi(){return this._instance.config.scroll_root_selector}getContext(){return this.zi}resetContext(){var e=this.zi;return setTimeout(this.Ui,0),e}startMeasuringScrollPosition(){iX(r,"scroll",this.Ui,{capture:!0}),iX(r,"scrollend",this.Ui,{capture:!0}),iX(r,"resize",this.Ui)}scrollElement(){if(!this.Vi)return null==r?void 0:r.document.documentElement;for(var e of B(this.Vi)?this.Vi:[this.Vi]){var t=null==r?void 0:r.document.querySelector(e);if(t)return t}}Wi(e){if(this.Vi){var t=this.scrollElement();return t&&t["y"===e?"scrollTop":"scrollLeft"]||0}return r?"y"===e?r.scrollY||r.pageYOffset||r.document.documentElement.scrollTop||0:r.scrollX||r.pageXOffset||r.document.documentElement.scrollLeft||0:0}scrollY(){return this.Wi("y")}scrollX(){return this.Wi("x")}}var nh=e=>rh(null==e?void 0:e.config.mask_personal_data_properties,null==e?void 0:e.config.custom_personal_data_properties);
1class nc{constructor(e,t,i,s){this.Gi=e=>{var t=this.Zi();if(!t||t.sessionId!==e){var i={sessionId:e,props:this.Qi(this._instance)};this.Ji.register({[iw]:i})}},this._instance=e,this.Ki=t,this.Ji=i,this.Qi=s||nh,this.Ki.onSessionId(this.Gi)}Zi(){return this.Ji.props[iw]}getSetOnceProps(){var e,t=null==(e=this.Zi())?void 0:e.props;return t?"r"in t?rc(t):{$referring_domain:t.referringDomain,$pathname:t.initialPathName,utm_source:t.utm_source,utm_campaign:t.utm_campaign,utm_medium:t.utm_medium,utm_content:t.utm_content,utm_term:t.utm_term}:{}}getSessionProps(){var e={};return iV(iZ(this.getSetOnceProps()),(t,i)=>{"$current_url"===i&&(i="url"),e["$session_entry_"+N(i)]=t}),e}}class nd{constructor(){this.Yi={}}on(e,t){return this.Yi[e]||(this.Yi[e]=[]),this.Yi[e].push(t),()=>{this.Yi[e]=this.Yi[e].filter(e=>e!==t)}}emit(e,t){for(var i of this.Yi[e]||[])i(t);for(var s of this.Yi["*"]||[])s(e,t)}}var np=tz("[SessionId]");class nv{on(e,t){return this.Xi.on(e,t)}constructor(e,t,i){if(this.en=null,this.tn=[],this.rn=void 0,this.nn=!1,this.Xi=new nd,this.sn=(e,t)=>!(!X(e)||!X(t))&&Math.abs(e-t)>this.sessionTimeoutMs,!e.persistence)throw Error("SessionIdManager requires a PostHogPersistence instance");if(e.config.cookieless_mode===iA)throw Error('SessionIdManager cannot be used with cookieless_mode="always"');this.qt=e.config,this.Ji=e.persistence,this.an=void 0,this.ln=void 0,this._sessionStartTimestamp=null,this._sessionActivityTimestamp=null,this.un=t||i9,this.hn=i||i9;var s,r=this.qt.persistence_name||this.qt.token;if(this._sessionTimeoutMs=1e3*el(this.qt.session_idle_timeout_seconds||1800,60,36e3,np.createLogger("session_idle_timeout_seconds"),1800),e.register({$configured_session_timeout_ms:this._sessionTimeoutMs}),this.cn(),this.dn="ph_"+r+"_window_id",this.vn="ph_"+r+"_primary_window_exists",this.fn()){var n=sh.F(this.dn),o=sh.F(this.vn);n&&!o?this.an=n:sh.q(this.dn),sh.N(this.vn,!0)}if(null!=(s=this.qt.bootstrap)&&s.sessionID)try{var a=(e=>{var t=this.qt.bootstrap.sessionID.replace(/-/g,"");if(32!==t.length)throw Error("Not a valid UUID");if("7"!==t[12])throw Error("Not a UUIDv7");return parseInt(t.substring(0,12),16)})();this.pn(this.qt.bootstrap.sessionID,(new Date).getTime(),a)}catch(e){np.error("Invalid sessionID in bootstrap",e)}this.gn()}get sessionTimeoutMs(){return this._sessionTimeoutMs}onSessionId(e){return J(this.tn)&&(this.tn=[]),this.tn.push(e),this.ln&&e(this.ln,this.an),()=>{this.tn=this.tn.filter(t=>t!==e)}}fn(){return"memory"!==this.qt.persistence&&!this.Ji.ei&&sh.O()}mn(e){e!==this.an&&(this.an=e,this.fn()&&sh.N(this.dn,e))}yn(){return this.an?this.an:this.fn()?sh.F(this.dn):null}bn(e){var t=this.en;return!K(t)&&!K(e)&&5e3>Math.abs(e-t)}pn(e,t,i){var s=t!==this._sessionActivityTimestamp,r=e===this.ln&&i===this._sessionStartTimestamp;this._sessionStartTimestamp=i,this._sessionActivityTimestamp=t,this.ln=e,r&&!s||r&&this.bn(t)||(this.en=t,this.Ji.register({[t9]:[t,e,i]}))}_n(){var e,t=null==(e=this.qt)?void 0:e.persistence_save_debounce_ms;return X(t)&&t>0}wn(){this._n()?this.Ji.refreshKey(t9):(this.Ji.flush(),this.Ji.load())}xn(){var e;if(!K(this._sessionActivityTimestamp)&&this._sessionActivityTimestamp!==this.en){this.wn();var[,t,i]=this.kn();t===this.ln&&i===this._sessionStartTimestamp&&(this.en=this._sessionActivityTimestamp,this.Ji.register({[t9]:[this._sessionActivityTimestamp,null!=(e=this.ln)?e:null,this._sessionStartTimestamp]}),this.Ji.flush())}}Sn(){var[e]=this.kn();return Math.max(X(e)?e:0,X(this._sessionActivityTimestamp)?this._sessionActivityTimestamp:0)}Cn(e){return this.wn(),this.sn(e,this.Sn())}kn(){var e=this.Ji.props[t9];return B(e)&&2===e.length&&e.push(e[0]),e||[0,null,0]}resetSessionId(){this.en=null,clearTimeout(this.In),this.In=void 0,this.pn(null,null,null)}destroy(){this.nn=!0,this.xn(),clearTimeout(this.In),this.In=void 0,this.rn&&r&&(r.removeEventListener(ij,this.rn,{capture:!1}),this.rn=void 0),this.tn=[]}gn(){this.rn=()=>{this.xn(),this.fn()&&sh.q(this.vn)},iX(r,ij,this.rn,{capture:!1})}checkAndGetSessionAndWindowId(e,t){if(void 0===e&&(e=!1),void 0===t&&(t=null),this.qt.cookieless_mode===iA)throw Error('checkAndGetSessionAndWindowId should not be called with cookieless_mode="always"');var i=t||(new Date).getTime(),[,s,r]=this.kn(),n=this.Sn(),o=this.yn(),a=X(r)&&Math.abs(i-r)>864e5,l=!1,u=!1,h=!s,c=s,d=!h&&!e&&this.sn(i,n);d&&((d=this.Cn(i))||np.info("cross-tab refresh kept the session alive",{sessionId:s}),[,s,r]=this.kn()),h||d||a?(s=this.un(),o=this.hn(),np.info("new session ID generated",{sessionId:s,windowId:o,changeReason:{noSessionId:h,activityTimeout:d,sessionPastMaximumLength:a}}),r=i,l=!0):(o||(o=this.hn(),l=!0),(u=s!==c)&&(np.info("adopted cross-tab session id",{sessionId:s,windowId:o}),l=!0));var p=X(n)&&e&&!a?n:i,v=X(r)?r:(new Date).getTime();this.mn(o),this.pn(s,p,v),e||this.cn();var g={noSessionId:h,activityTimeout:d,sessionPastMaximumLength:a,crossTabAdoption:u};
1return l&&this.tn.forEach(e=>e(s,o,g)),{sessionId:s,windowId:o,sessionStartTimestamp:v,changeReason:l?g:void 0,lastActivityTimestamp:n}}cn(){this.nn||(clearTimeout(this.In),this.In=setTimeout(()=>{if(!this.nn)if(this.Cn((new Date).getTime())){var e=this.ln;this.resetSessionId(),this.Xi.emit("forcedIdleReset",{idleSessionId:e})}else this.cn()},1.1*this.sessionTimeoutMs))}}var ng=function(e,t){if(!e)return!1;var i=e.userAgent;if(i&&L(i,t))return!0;try{var s=null==e?void 0:e.userAgentData;if(null!=s&&s.brands&&s.brands.some(e=>L(null==e?void 0:e.brand,t)))return!0}catch(e){}return!!e.webdriver},n_=function(e,t){if(!function(e){try{new RegExp(e)}catch(e){return!1}return!0}(t))return!1;try{return new RegExp(t).test(e)}catch(e){return!1}};function nf(e,t,i){return ne({distinct_id:e,userPropertiesToSet:t,userPropertiesToSetOnce:i})}var nm={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=>n_(t,e))),not_regex:(e,t)=>t.every(t=>e.every(e=>!n_(t,e))),icontains:(e,t)=>t.map(ny).some(t=>e.map(ny).some(e=>t.includes(e))),not_icontains:(e,t)=>t.map(ny).every(t=>e.map(ny).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))})},ny=e=>e.toLowerCase();function nb(e,t){return!e||Object.entries(e).every(e=>{var[i,s]=e,r=null==t?void 0:t[i];if(J(r)||K(r))return!1;var n=[String(r)],o=nm[s.operator];return!!o&&o(s.values,n)})}var nx="custom",nw="i.posthog.com",nE=/^\/static\//;class nk{constructor(e){this.Tn={},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("."+nw,".posthog.com")),"https://app.posthog.com"===t?"https://us.posthog.com":t}get region(){return this.Tn[this.apiHost]||(this.Tn[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":nx),this.Tn[this.apiHost]}En(e){if(nE.test(e)){var t=this.instance.config.asset_host;if("string"==typeof t)return t.trim().replace(/\/$/,"")||void 0}}endpointFor(e,t){if(void 0===t&&(t=""),t&&(t="/"===t[0]?t:"/"+t),"ui"===e)return this.uiHost+t;if("flags"===e)return this.flagsApiHost+t;if("assets"===e){var i=this.En(t);if(i)return""+i+t}if(this.region===nx)return this.apiHost+t;var s=nw+t;switch(e){case"assets":return"https://"+this.region+"-assets."+s;case"api":return"https://"+this.region+"."+s}}}var nS=tz("[Surveys]"),nP="seenSurvey_",nF=["popover","widget","api"],n$={ignoreConditions:!1,ignoreDelay:!1,displayType:rw},nI=tz("[PostHog ExternalIntegrations]"),nC={intercom:"intercom-integration",crispChat:"crisp-chat-integration"};class nR{constructor(e){this._instance=e}$r(e,t){var i;null==(i=v.__PosthogExtensions__)||null==i.loadExternalDependency||i.loadExternalDependency(this._instance,e,e=>{if(e)return nI.error("failed to load script",e);t()})}startIfEnabledOrStop(){var e,t=this,i=function(e){var i,s,n;!r||null!=(i=v.__PosthogExtensions__)&&null!=(i=i.integrations)&&i[e]||t.$r(nC[e],()=>{var i;null==(i=v.__PosthogExtensions__)||null==(i=i.integrations)||null==(i=i[e])||i.start(t._instance)}),!r&&null!=(s=v.__PosthogExtensions__)&&null!=(s=s.integrations)&&s[e]&&(null==(n=v.__PosthogExtensions__)||null==(n=n.integrations)||null==(n=n[e])||n.stop())};for(var[s,r]of Object.entries(null!=(e=this._instance.config.integrations)?e:{}))i(s)}}var nM,nO,nT={},nA=0,nL=()=>{},nq='Consent opt in/out is not valid with cookieless_mode="always" and will be ignored',nD="Surveys module not available",nN="sanitize_properties is deprecated. Use before_send instead",nj="Invalid value for property_denylist config: ",nz="posthog",nH=!r6&&-1===(null==p?void 0:p.indexOf("MSIE"))&&-1===(null==p?void 0:p.indexOf("Mozilla")),nB=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 iQ)if(i===s)return!1;return!0}(null==a?void 0:a.location),persistence:"localStorage+cookie",persistence_name:"",cookie_persisted_properties:[],loaded:nL,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:l&&W(null==l?void 0:l.search)&&-1!==l.search.indexOf("__posthog_debug=true")||!1,cookie_expiration:365,upgrade:!1,disable_session_recording:!1,disable_persistence:!1,disable_web_experiments:!0,disable_surveys:!1,disable_surveys_automatic_display:!1,disable_conversations:!1,disable_product_tours:!1,disable_external_dependency_loading:!1,strict_script_versioning:!1,enable_recording_console_log:void 0,secure_cookie:"https:"===(null==r||null==(t=r.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){tj.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:iD,before_send:void 0,request_queue_config:{flush_interval_ms:3e3},error_tracking:{},_onCapture:nL},{rageclick:e&&e>="2026-05-30"?{content_ignorelist:s$,ignore_text_selection:!0}
1:!e||"2025-11-30">e||{content_ignorelist:!0},capture_pageview:!e||"2025-05-24">e||"history_change",session_recording:e&&e>="2025-11-30"?{strictMinimumDuration:!0}:{},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)})},nU=[["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"]],nG=e=>{var t={};for(var[i,s]of nU)J(e[i])||(t[s]=e[i]);var r=iJ({},t,e),n=e.__preview_external_dependency_versioned_paths;return J(n)||(J(e.strict_script_versioning)&&(r.strict_script_versioning=!!n),W(n)&&J(e.asset_host)&&(r.asset_host=n)),B(e.property_blacklist)&&(J(e.property_denylist)?r.property_denylist=e.property_blacklist:B(e.property_denylist)?r.property_denylist=[...e.property_blacklist,...e.property_denylist]:tj.error(nj+e.property_denylist)),r};class nV{constructor(){this.__forceAllowLocalhost=!1}get Mn(){return this.__forceAllowLocalhost}set Mn(e){tj.error("WebPerformanceObserver is deprecated and has no impact on network capture. Use `_forceAllowLocalhostNetworkCapture` on `posthog.sessionRecording`"),this.__forceAllowLocalhost=e}}class nJ{Pn(e,t){if(e){var i=this.Rn.indexOf(e);-1!==i&&this.Rn.splice(i,1)}return this.Rn.push(t),null==t.initialize||t.initialize(),t}On(){return this.config.cookieless_mode===iA||this.config.cookieless_mode===iT&&this.consent.isRejected()}get decideEndpointWasHit(){var e,t;return null!=(e=null==(t=this.featureFlags)?void 0:t.hasLoadedFlags)&&e}get flagsEndpointWasHit(){var e,t;return null!=(e=null==(t=this.featureFlags)?void 0:t.hasLoadedFlags)&&e}constructor(){this.webPerformance=new nV,this.Ln=!1,this.version=_.LIB_VERSION,this.An=new nd,this.Rn=[],this._calculate_event_properties=this.calculateEventProperties.bind(this),this.config=nB(),this.SentryIntegration=sX,this.sentryIntegration=e=>{var t;return t=sQ(this,e),{name:sZ,processEvent:e=>t(e)}},this.__request_queue=[],this.__loaded=!1,this.analyticsDefaultEndpoint="/e/",this.Fn=!1,this.Nn=null,this.Dn=null,this.$n=null,this.scrollManager=new nu(this),this.pageViewManager=new s0(this),this.rateLimiter=new rk(this),this.requestRouter=new nk(this),this.consent=new sc(this),this.externalIntegrations=new nR(this);var e,t=null!=(e=nJ.__defaultExtensionClasses)?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.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=>tj.info('send "'+(null==e?void 0:e.event)+'"',e))}init(e,t,i){if(i&&i!==nz){var s,r=null!=(s=nT[i])?s:new nJ;return r._init(e,t,i),nT[i]=r,nT[nz][i]=r,r}return this._init(e,t,i)}_init(e,t,i){void 0===t&&(t={});var s,n,o=W(e)?e.trim():"";if(!o)return tj.critical("PostHog was initialized without a token. This likely indicates a misconfiguration. Please check the first argument passed to posthog.init()"),this;if(this.__loaded)return console.warn("[PostHog.js]","You have already initialized PostHog! Re-initializing is a no-op"),this;this.__loaded=!0,this.config={},t.debug=this.qn(t.debug),this.jn=t,this.Bn=[],t.person_profiles?this.Dn=t.person_profiles:t.process_person&&(this.Dn=t.process_person);var a=nB(t.defaults),l=nG(t),u=iJ({},a,l,{name:i,token:o});G(a.rageclick)&&G(l.rageclick)&&(u.rageclick=iJ({},a.rageclick,l.rageclick)),this.set_config(u),this.config.on_xhr_error&&tj.error("on_xhr_error is deprecated. Use on_request_error instead"),this.compression=t.disable_compression?void 0:rF;var h=this.Hn();this.persistence=new r_(this.config,h),this.sessionPersistence="sessionStorage"===this.config.persistence||"memory"===this.config.persistence?this.persistence:new r_(y({},this.config,{persistence:"sessionStorage"}),h,!1);var c=y({},this.persistence.props),d=y({},this.sessionPersistence.props);this.register({$initialization_time:(new Date).toISOString()}),this.Un=new no(e=>this.zn(e),this.config.request_queue_config),this.Vn=new nl(this),this.__request_queue=[];var p=this.On();if(p||(this.sessionManager=new nv(this),this.sessionPropsManager=new nc(this,this.sessionManager,this.persistence)),this.config.__preview_deferred_init_extensions?(tj.info("Deferring extension initialization to improve startup performance"),setTimeout(()=>{this.Wn(p)},0)):(tj.info("Initializing extensions synchronously"),this.Wn(p)),_.DEBUG=_.DEBUG||this.config.debug,_.DEBUG&&tj.info("Starting in debug mode",{this:this,config:t,thisC:y({},this.config),p:c,s:d}),!this.config.identity_distinct_id||null!=(s=t.bootstrap)&&s.distinctID||(t.bootstrap=y({},t.bootstrap,{distinctID:this.config.identity_distinct_id,isIdentifiedID:!0}
1)),void 0!==(null==(n=t.bootstrap)?void 0:n.distinctID)){var v=t.bootstrap.distinctID,g=this.get_distinct_id(),f=this.persistence.get_property(ix);if(t.bootstrap.isIdentifiedID&&null!=g&&g!==v&&f===iL)this.identify(v);else if(t.bootstrap.isIdentifiedID&&null!=g&&g!==v&&f===iq)tj.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 m=this.config.get_device_id(i9()),b=t.bootstrap.isIdentifiedID?m:v;this.persistence.set_property(ix,t.bootstrap.isIdentifiedID?iq:iL),this.register({distinct_id:v,$device_id:b})}}if(p)this.register_once({distinct_id:iI,$device_id:null},"");else if(!this.get_distinct_id()){var x=this.config.get_device_id(i9());this.register_once({distinct_id:x,$device_id:x},""),this.persistence.set_property(ix,iL)}return iX(r,"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()||i9();e.config.get_device_id=s,i.id()&&(e.register({distinct_id:i.id(),$device_id:s()}),e.persistence.set_property(ix,iq)),t()},r=i.user();"then"in r&&U(r.then)?r.then(s):s(r)}(e,()=>{var s;i.register((Promise&&Promise.resolve||sK.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()||(sK.info("No userId set, resetting PostHog"),e.reset()),t.event.userId&&t.event.userId!==e.get_distinct_id()&&(sK.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,iz),identify:e=>s(e,iB),screen:e=>s(e,"$screen")})).then(()=>{t()})})}(this,()=>this.Gn()):this.Gn(),U(this.config._onCapture)&&this.config._onCapture!==nL&&(tj.warn("onCapture is deprecated. Please use `before_send` instead"),this.on("eventCaptured",e=>this.config._onCapture(e.event,e))),this.config.ip&&tj.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}Wn(e){var t,i,s,r,n,o,a,l=performance.now(),u=y({},nJ.__defaultExtensionClasses,this.config.__extensionClasses),h=[];u.featureFlags&&this.Rn.push(this.featureFlags=null!=(t=this.featureFlags)?t:new u.featureFlags(this)),u.exceptions&&this.Rn.push(this.exceptions=null!=(i=this.exceptions)?i:new u.exceptions(this)),u.historyAutocapture&&this.Rn.push(this.historyAutocapture=new u.historyAutocapture(this)),u.tracingHeaders&&this.Rn.push(this.tracingHeaders=new u.tracingHeaders(this)),u.siteApps&&this.Rn.push(this.siteApps=new u.siteApps(this)),u.sessionRecording&&!e&&this.Rn.push(this.sessionRecording=new u.sessionRecording(this)),this.config.disable_scroll_properties||h.push(()=>{this.scrollManager.startMeasuringScrollPosition()}),u.autocapture&&this.Rn.push(this.autocapture=new u.autocapture(this)),u.surveys&&this.Rn.push(this.surveys=null!=(s=this.surveys)?s:new u.surveys(this)),u.logs&&this.Rn.push(this.logs=null!=(r=this.logs)?r:new u.logs(this)),u.conversations&&this.Rn.push(this.conversations=null!=(n=this.conversations)?n:new u.conversations(this)),u.productTours&&this.Rn.push(this.productTours=new u.productTours(this)),u.heatmaps&&this.Rn.push(this.heatmaps=new u.heatmaps(this)),u.webVitalsAutocapture&&this.Rn.push(this.webVitalsAutocapture=new u.webVitalsAutocapture(this)),u.exceptionObserver&&this.Rn.push(this.exceptionObserver=new u.exceptionObserver(this)),u.deadClicksAutocapture&&this.Rn.push(this.deadClicksAutocapture=new u.deadClicksAutocapture(this,sW)),u.toolbar&&this.Rn.push(this.toolbar=null!=(o=this.toolbar)?o:new u.toolbar(this)),u.experiments&&this.Rn.push(this.experiments=null!=(a=this.experiments)?a:new u.experiments(this)),this.Rn.forEach(e
1=>{e.initialize&&h.push(()=>{null==e.initialize||e.initialize()})}),h.push(()=>{if(this.Zn){var e=this.Zn;this.Zn=void 0,this.ki(e)}}),this.Qn(h,l)}Qn(e,t){for(;e.length>0;){if(this.config.__preview_deferred_init_extensions&&performance.now()-t>=30&&e.length>0)return void setTimeout(()=>{this.Qn(e,t)},0);var i=e.shift();if(i)try{i()}catch(e){tj.error("Error initializing extension:",e)}}var s=Math.round(performance.now()-t);this.register_for_session({[iC]:this.config.__preview_deferred_init_extensions?"deferred":"synchronous",[iR]:s}),this.config.__preview_deferred_init_extensions&&tj.info("PostHog extensions initialized ("+s+"ms)")}ki(e){var t;a&&a.body?(this.config.__preview_deferred_init_extensions&&(this.Zn=e),this.Jn=e,this.compression=void 0,e.supportedCompression&&!this.config.disable_compression&&(this.compression=q(e.supportedCompression,rF)?rF:q(e.supportedCompression,r$)?r$:void 0),null!=(t=e.analytics)&&t.endpoint&&(this.analyticsDefaultEndpoint=e.analytics.endpoint),this.set_config({person_profiles:this.Dn?this.Dn:iD}),this.Rn.forEach(t=>null==t.onRemoteConfig?void 0:t.onRemoteConfig(e))):(tj.info("document not ready yet, trying again in 500 milliseconds..."),setTimeout(()=>{this.ki(e)},500))}Gn(){try{this.config.loaded(this)}catch(e){tj.critical("`loaded` function failed",e)}if(this.Kn(),this.config.internal_or_test_user_hostname&&null!=l&&l.hostname){var e=l.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.On())&&this.Yn()},1),this.Xn=new rP(this),this.Xn.load()}Kn(){var e;this.is_capturing()&&this.config.request_batching&&(null==(e=this.Un)||e.enable())}_dom_loaded(){this.is_capturing()&&iG(this.__request_queue,e=>this.zn(e)),this.__request_queue=[],this.Kn()}_handle_unload(){var e,t,i,s;null==(e=this.surveys)||e.handlePageUnload(),this.config.request_batching?(this.es()&&this.capture(iH),null==(t=this.logs)||t.flushLogs("sendBeacon"),null==(i=this.Un)||i.unload(),null==(s=this.Vn)||s.unload()):this.es()&&this.capture(iH,null,{transport:"sendBeacon"})}_send_request(e){this.__loaded?nH?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.skipIPParam||(e.url=r9(e.url,{ip:+!!this.config.ip})),e.headers=y({},this.config.request_headers,e.headers),e.compression="best-available"===e.compression?this.compression:e.compression,(J(this.config.disable_beacon)?this.config.__preview_disable_beacon:this.config.disable_beacon)&&(e.disableTransport=["sendBeacon"]),e.fetchOptions=e.fetchOptions||this.config.fetch_options,(e=>{var t,i,s,r=y({},e);r.timeout=r.timeout||6e4,r.url=nr(r.url,r.compression);var n=null!=(t=r.transport)?t:"fetch",o=nn.filter(e=>!r.disableTransport||!e.transport||!r.disableTransport.includes(e.transport)),a=null!=(i=null==(s=function(e){for(var t=0;e.length>t;t++)if(e[t].transport===n)return e[t]}(o))?void 0:s.method)?i:o[0].method;if(!a)throw Error("No available transport method");"sendBeacon"!==n&&r.data&&r.compression===rF&&d&&!r7?ns(r).then(e=>{a(e)}).catch(t=>{R(t)?(r7=!0,a(y({},r,{compression:void 0,url:nr(e.url,void 0)}))):((e=>{if(!e||"object"!=typeof e)return!1;var t="name"in e?String(e.name):"";return R(e)||t===I})(t)&&(r7=!0),a(r))}):a(r)})(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}))}zn(e){this.Vn?this.Vn.retriableRequest(e):this._send_request(e)}_execute_array(e){nA++;try{var t,i=[],s=[],r=[];iG(e,e=>{if(e)if(B(t=e[0]))r.push(e);else if(U(e))try{e.call(this)}catch(t){tj.error("Error executing queued PostHog call",e,t)}else B(e)&&"alias"===t?i.push(e):B(e)&&-1!==t.indexOf("capture")&&U(this[t])?r.push(e):s.push(e)});var n=function(e,t){iG(e,function(e){try{if(B(e[0])){var i=t;iV(e,function(e){i=i[e[0]].apply(i,e.slice(1))})}else t[e[0]].apply(t,e.slice(1))}catch(t){tj.error("Error executing queued PostHog call",e,t)}})};n(i,this),n(s,this),n(r,this)}finally{nA--}}push(e){if(nA>0&&B(e)&&W(e[0])){var t=nJ.prototype[e[0]];U(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.Un){if(this.is_capturing())if(!J(e)&&W(e)){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)&&(tj.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.ts||tj.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=new Date,c=(null==i?void 0:i.timestamp)||h,d=(null==i?void 0:i.uuid)||i9(),p={uuid:d,event:e,properties:this.calculateEventProperties(e,t||{},c,d)};e===iz&&this.config.__preview_capture_bot_pageviews&&l&&(p.event="$bot_pageview",p.properties.$browser_type="bot"),u&&(p.properties.$lib_rate_limit_remaining_tokens=u.remainingTokens),(null==i?void 0:i.$set)&&(p.$set=null==i?void 0:i.$set);var v=null==i?void 0:i.$unset;v&&(p.$unset=v);var g,_,f,m=this.rs(null==i?void 0:i.$set_once,e!==iU,e===iB);if(m&&(p.$set_once=m),null!=i&&i._noTruncate||(r=this.config.properties_string_max_length,n=p,o=e=>W(e)?e.slice(0,r):e,a=new Set,p=function e(t,i){var s;return t!==Object(t)?o?o(t):t:a.has(t)?void 0:(a.add(t),B(t)?(s=[],iG(t,t=>{s.push(e(t))})):(s={},iV(t,(t,i)=>{a.has(t)||(s[i]=e(t,i))}
1)),s)}(n)),p.timestamp=c,J(null==i?void 0:i.timestamp)||(p.properties.$event_time_override_provided=!0,p.properties.$event_time_override_system_time=h),e===rb||e===rx){var b=null==t?void 0:t.$survey_id,x=null==t?void 0:t.$survey_iteration;(e=>{try{var t,i=(t=""+nP+e.id,e.current_iteration&&e.current_iteration>0&&(t=""+nP+e.id+"_"+e.current_iteration),t);if(localStorage.getItem(i))return;localStorage.setItem(i,"true")}catch(e){nS.error("Failed to persist survey seen state",e)}})({id:b,current_iteration:x}),p.$set=y({},p.$set,{[(g={id:b,current_iteration:x},f="$survey_"+(_=e===rx?"responded":"dismissed")+"/"+g.id,g.current_iteration&&g.current_iteration>0&&(f="$survey_"+_+"/"+g.id+"/"+g.current_iteration),f)]:!0})}else e===ry&&(p.$set=y({},p.$set,{$survey_last_seen_date:(new Date).toISOString()}));if("product tour shown"===e){var w=null==t?void 0:t.$product_tour_type;w&&(p.$set=y({},p.$set,{["$product_tour_last_seen_date/"+w]:(new Date).toISOString()}))}var E=y({},p.properties.$set,p.$set);if(V(E)||this.setPersonPropertiesForFlags(E),!Z(this.config.before_send)){var k=this.gr(p);if(!k)return;p=k}this.An.emit("eventCaptured",p);var S={method:"POST",url:null!=(s=null==i?void 0:i._url)?s:this.requestRouter.endpointFor("api",this.analyticsDefaultEndpoint),data:p,compression:"best-available",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.zn(S):this.Un.enqueue(S),p}tj.critical("This capture call is ignored due to client rate limiting.")}}else tj.error("No event name provided to posthog.capture")}else tj.uninitializedWarning("posthog.capture")}_addCaptureHook(e){return this.on("eventCaptured",t=>e(t.event,t))}calculateEventProperties(e,t,i,s,n){if(i=i||new Date,!this.persistence||!this.sessionPersistence)return t;var o,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.On()&&(h.$cookieless_mode=!0),"$snapshot"===e){var c=y({},this.persistence.properties(),this.sessionPersistence.properties());return h.distinct_id=c.distinct_id,(!W(h.distinct_id)&&!Q(h.distinct_id)||Y(h.distinct_id))&&tj.error("Invalid distinct_id for replay event. This indicates a bug in your implementation"),h}var d,v=function(e,t,i){if(!p)return{};var s,n,o,a,u,h,c,d,v,g,f,m,y=e?[...re,...t||[]]:[],[b,x]=function(e){for(var t=0;tt.length>t;t++){var[i,s]=tt[t],r=i.exec(e),n=r&&(U(s)?s(r,e):s);if(n)return n}return["",""]}(p),w=null!=(u="u">typeof navigator?navigator:void 0)&&u.brave?{brave:!0}:{},E={detectGoogleSearchApp:i},k=iJ(iZ({$os:b,$os_version:x,$browser:e7(p,navigator.vendor,w,E),$device:ti(p),$device_type:(c={userAgentDataPlatform:null==(s=navigator)||null==(s=s.userAgentData)?void 0:s.platform,maxTouchPoints:null==(n=navigator)?void 0:n.maxTouchPoints,screenWidth:null==r||null==(o=r.screen)?void 0:o.width,screenHeight:null==r||null==(a=r.screen)?void 0:a.height,devicePixelRatio:null==r?void 0:r.devicePixelRatio},(m=ti(p))===ev||m===ep||"Kobo"===m||"Kindle Fire"===m||m===eU?ed:m===eO||m===eA||m===eT||m===ez?"Console":m===e_?"Wearable":m?eh:"Android"===(null==c?void 0:c.userAgentDataPlatform)&&(null!=(d=null==c?void 0:c.maxTouchPoints)?d:0)>0?600>Math.min(null!=(v=null==c?void 0:c.screenWidth)?v:0,null!=(g=null==c?void 0:c.screenHeight)?g:0)/(null!=(f=null==c?void 0:c.devicePixelRatio)?f:1)?eh:ed:"Desktop"),$timezone:rd(),$timezone_offset:function(){try{return(new Date).getTimezoneOffset()}catch(e){return}}()}),{$current_url:s4(null==l?void 0:l.href,y,ri),$host:null==l?void 0:l.host,$pathname:null==l?void 0:l.pathname,$raw_user_agent:p.length>1e3?p.substring(0,997)+"...":p,$browser_version:te(p,navigator.vendor,w,E),$browser_language:ra(),$browser_language_prefix:"string"==typeof(h=ra())?h.split("-")[0]:void 0,$screen_height:null==r?void 0:r.screen.height,$screen_width:null==r?void 0:r.screen.width,$viewport_height:null==r?void 0:r.innerHeight,$viewport_width:null==r?void 0:r.innerWidth,$lib:_.LIB_NAME,$lib_version:_.LIB_VERSION,$insert_id:Math.random().toString(36).substring(2,10)+Math.random().toString(36).substring(2,10),$time:Date.now()/1e3});return _.SDK_DIST_CHANNEL&&(k.$sdk_dist_channel=_.SDK_DIST_CHANNEL),k}(this.config.mask_personal_data_properties,this.config.custom_personal_data_properties,this.config.detect_google_search_app);if(this.sessionManager){var{sessionId:g,windowId:f}=this.sessionManager.checkAndGetSessionAndWindowId(n,i.getTime());h.$session_id=g,h.$window_id=f}this.sessionPropsManager&&iJ(h,this.sessionPropsManager.getSessionProps());try{this.sessionRecording&&iJ(h,this.sessionRecording.sdkDebugProperties),h.$sdk_debug_retry_queue_size=null==(o=this.Vn)?void 0:o.length}catch(e){h.$sdk_debug_error_capturing_properties=String(e)}if(this.requestRouter.region===nx&&(h.$lib_custom_api_host=this.config.api_host),d=e!==iz||n?e!==iH||n?this.pageViewM
1anager.doEvent():this.pageViewManager.doPageLeave(i):this.pageViewManager.doPageView(i,s),h=iJ(h,d),e===iz&&a&&(h.title=a.title),!J(u)){var m=i.getTime()-u;h.$duration=parseFloat((m/1e3).toFixed(3))}p&&this.config.opt_out_useragent_filter&&(h.$browser_type=this._is_bot()?"bot":"browser"),(h=iJ({},v,this.persistence.properties(),this.sessionPersistence.properties(),h)).$is_identified=this._isIdentified(),B(this.config.property_denylist)?iV(this.config.property_denylist,function(e){delete h[e]}):tj.error(nj+this.config.property_denylist+" or property_blacklist config: "+this.config.property_blacklist);var b=this.config.sanitize_properties;b&&(tj.error(nN),h=b(h,e));var x=this.ns();return h.$process_person_profile=x,x&&!n&&this.ss("_calculate_event_properties"),h}rs(e,t,i){if(void 0===t&&(t=!0),void 0===i&&(i=!1),!this.persistence||!this.ns()||this.Ln&&!i)return e;var s,r=iJ({},this.persistence.get_initial_props(),(null==(s=this.sessionPropsManager)?void 0:s.getSetOnceProps())||{},e||{}),n=this.config.sanitize_properties;return n&&(tj.error(nN),r=n(r,"$set_once")),t&&(this.Ln=!0),V(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;null==(t=this.sessionPersistence)||t.register(e)}unregister(e){var t;null==(t=this.persistence)||t.unregister(e)}unregister_for_session(e){var t;null==(t=this.sessionPersistence)||t.unregister(e)}os(e,t){this.register({[e]:t})}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)}isFeatureEnabled(e,t){var i;return null==(i=this.featureFlags)?void 0:i.isFeatureEnabled(e,t)}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.An.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:nD}),()=>{})}onSessionId(e){var t,i;return null!=(t=null==(i=this.sessionManager)?void 0:i.onSessionId(e))?t:()=>{}}getSurveys(e,t){void 0===t&&(t=!1),this.surveys?this.surveys.getSurveys(e,t):e([],{isLoaded:!1,error:nD})}getActiveMatchingSurveys(e,t){void 0===t&&(t=!1),this.surveys?this.surveys.getActiveMatchingSurveys(e,t):e([],{isLoaded:!1,error:nD})}renderSurvey(e,t){var i;null==(i=this.surveys)||i.renderSurvey(e,t)}displaySurvey(e,t){var i;void 0===t&&(t=n$),null==(i=this.surveys)||i.displaySurvey(e,t)}cancelPendingSurvey(e){var t;null==(t=this.surveys)||t.cancelPendingSurvey(e)}canRenderSurvey(e){var t,i;return null!=(t=null==(i=this.surveys)?void 0:i.canRenderSurvey(e))?t:{visible:!1,disabledReason:nD}}canRenderSurveyAsync(e,t){var i,s;return void 0===t&&(t=!1),null!=(i=null==(s=this.surveys)?void 0:s.canRenderSurveyAsync(e,t))?i:Promise.resolve({visible:!1,disabledReason:nD})}ls(e){return!e||Y(e)?(tj.critical("Unique user id has not been set in posthog.identify"),!1):e===iI?(tj.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())||(tj.critical('The string "'+e+'" was set in posthog.identify which indicates an error. This ID should be unique to the user and not a hardcoded string.'),!1)}identify(e,t,i){if(!this.__loaded||!this.persistence)return tj.uninitializedWarning("posthog.identify");if(Q(e)&&(e=e.toString(),tj.warn("The first argument to posthog.identify was a number, but it should be a string. It has been converted to a string.")),this.ls(e)&&this.ss("posthog.identify")){var s=this.get_distinct_id();this.register({$user_id:e}),this.get_property(tG)||this.register_once({$had_persisted_distinct_id:!0,$device_id:s},""),e!==s&&e!==this.get_property(tV)&&(this.unregister(tV),this.register({distinct_id:e}));var r,n=(this.persistence.get_property(ix)||iL)===iL;e!==s&&n?(this.persistence.set_property(ix,iq),this.setPersonPropertiesForFlags({$set:t||{},$set_once:i||{}},!1),this.capture(iB,{distinct_id:e,$anon_distinct_id:s},{$set:t||{},$set_once:i||{}}),this.$n=nf(e,t,i),null==(r=this.featureFlags)||r.setAnonymousDistinctId(s)):(t||i)&&this.setPersonProperties(t,i),e!==s&&(this.reloadFeatureFlags(),this.unregister(i_))}}setPersonProperties(e,t){if((e||t)&&this.ss("posthog.setPersonProperties")){var i=nf(this.get_distinct_id(),e,t);this.$n!==i?(this.setPersonPropertiesForFlags({$set:e||{},$set_once:t||{}},!0),this.capture("$set",{$set:e||{},$set_once:t||{}}),this.$n=i):tj.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.ss("posthog.unsetPersonProperties")&&(null==(t=this.featureFlags)||t.unsetPersonPropertiesForFlags(i,!0),this.capture("$set",{$unset:i}),this.$n=null)}group(e,t,i){if(e&&t){var s=this.getGroups(),r=s[e]!==t;if(r&&this.resetGroupPropertiesForFlags(e),this.register({$groups:y({},s,{[e]:t})}),r||i){var n={$group_type:e,$group_key:t};
1i&&(n.$group_set=i),this.capture(iU,n)}i&&this.setGroupPropertiesForFlags({[e]:i}),r&&!i&&this.reloadFeatureFlags()}else tj.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.ss("posthog.setGroupPropertiesForFlags")&&(null==(i=this.featureFlags)||i.setGroupPropertiesForFlags(e,t))}resetGroupPropertiesForFlags(e){var t;null==(t=this.featureFlags)||t.resetGroupPropertiesForFlags(e)}reset(e){if(tj.info("reset"),!this.__loaded)return tj.uninitializedWarning("posthog.reset");var t,i,s,r,n,o,a,l,u,h,c=this.get_property(tG),d=this.get_property(t3);if(this.consent.reset(),null==(t=this.persistence)||t.clear(),null==(i=this.sessionPersistence)||i.clear(),J(d)||null==(h=this.persistence)||h.register({[t3]:d}),null==(s=this.surveys)||s.reset(),null==(r=this.Xn)||r.stop(),null==(n=this.featureFlags)||n.reset(),null==(o=this.conversations)||o.reset(),null==(a=this.logs)||a.reset(),null==(l=this.persistence)||l.set_property(ix,iL),null==(u=this.sessionManager)||u.resetSessionId(),this.$n=null,this.config.cookieless_mode===iA)this.register_once({distinct_id:iI,$device_id:null},"");else{var p=this.config.get_device_id(i9());this.register_once({distinct_id:p,$device_id:e?p:c},"")}this.register({$last_posthog_reset:(new Date).toISOString()},1),delete this.config.identity_distinct_id,delete this.config.identity_hash,this.reloadFeatureFlags()}setIdentity(e,t){var i;this.config.identity_distinct_id=e,this.config.identity_hash=t,this.alias(e),null==(i=this.conversations)||i.us()}clearIdentity(){var e;delete this.config.identity_distinct_id,delete this.config.identity_hash,null==(e=this.conversations)||e.hs()}get_distinct_id(){return this.get_property("distinct_id")}getGroups(){return this.get_property("$groups")||{}}get_session_id(){var e,t;return null!=(e=null==(t=this.sessionManager)?void 0:t.checkAndGetSessionAndWindowId(!0).sessionId)?e:""}get_session_replay_url(e){if(!this.sessionManager)return"";var{sessionId:t,sessionStartTimestamp:i}=this.sessionManager.checkAndGetSessionAndWindowId(!0),s=this.requestRouter.endpointFor("ui","/project/"+this.config.token+"/replay/"+t);if(null!=e&&e.withTimestamp&&i){var r,n=null!=(r=e.timestampLookBack)?r:10;if(!i)return s;s+="?t="+Math.max(Math.floor(((new Date).getTime()-i)/1e3)-n,0)}return s}alias(e,t){return e===this.get_property(tU)?(tj.critical("Attempting to create alias for existing People user - aborting."),-2):this.ss("posthog.alias")?(J(t)&&(t=this.get_distinct_id()),e!==t?(this.os(tV,e),this.capture("$create_alias",{alias:e,distinct_id:t})):(tj.warn("alias matches current distinct_id - skipping api call."),this.identify(e),-1)):void 0}set_config(e){var t=y({},this.config);if(G(e)){iJ(this.config,nG(e));var i,s,r,n,o,a,l,u,h,c,d,p=this.Hn();null==(i=this.persistence)||i.update_config(this.config,t,p),this.sessionPersistence="sessionStorage"===this.config.persistence||"memory"===this.config.persistence?this.persistence:new r_(y({},this.config,{persistence:"sessionStorage"}),p,!1);var v=this.qn(this.config.debug);ee(v)&&(this.config.debug=v),ee(this.config.debug)&&(this.config.debug?(_.DEBUG=!0,sn.O()&&sn.N("ph_debug",!0),tj.info("set_config",{config:e,oldConfig:t,newConfig:y({},this.config)})):(_.DEBUG=!1,sn.O()&&sn.q("ph_debug"))),null==(s=this.exceptionObserver)||s.onConfigChange(),null==(r=this.exceptions)||r.onConfigChange(),null==(n=this.sessionRecording)||n.startIfEnabledOrStop(),null==(o=this.tracingHeaders)||o.startIfEnabledOrStop(),null==(a=this.autocapture)||a.startIfEnabled(),null==(l=this.heatmaps)||l.startIfEnabled(),null==(u=this.exceptionObserver)||u.startIfEnabledOrStop(),null==(h=this.deadClicksAutocapture)||h.startIfEnabledOrStop(),null==(c=this.surveys)||c.loadIfEnabled(),this.cs(),null==(d=this.externalIntegrations)||d.startIfEnabledOrStop()}}_overrideSDKInfo(e,t){_.LIB_NAME=e,_.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)?e:nJ.ds}startExceptionAutocapture(e){this.set_config({capture_exceptions:null==e||e})}stopExceptionAutocapture(){this.set_config({capture_exceptions:!1})}loadToolbar(e){var t,i;return null!=(t=null==(i=this.toolbar)?void 0:i.loadToolbar(e))&&t}get_property(e){var t;return null==(t=this.persistence)?void 0:t.props[e]}getSessionProperty(e){var t;return null==(t=this.sessionPersistence)?void 0:t.props[e]}toString(){var e,t=null!=(e=this.config.name)?e:nz;return t!==nz&&(t=nz+"."+t),t}_isIdentified(){var e,t;return(null==(e=this.persistence)?void 0:e.get_property(ix))===iq||(null==(t=this.sessionPersistence)?void 0:t.get_property(ix))===iq}ns(){var e,t;return!("never"===this.config.person_profiles||this.config.person_profiles===iD&&!this._isIdentified()&&V(this.getGroups())&&(null==(e=this.persistence)||null==(e=e.props)||!e[tV])&&(null==(t=this.persistence)||null==(t=t.props)||!t[iF]))}es(){return!0===this.config.capture_pageleave||"if_capture_pageview"===this.config.capture_pageleave&&(!0===this.config.capture_pageview||"history_change"===this.config.capture_pageview)}createPersonProfile(){this.ns()||this.ss("posthog.createPersonProfile")&&this.setPersonProperties({},{})}setInternalOrTestUser(){this.ss("posthog.setInternalOrTestUser")&&this.setPersonProperties({$internal_or_test_user:!0})}ss(e){return"never"===this.config.person_profiles?(tj.error(e+' was called, but process_person is set to "never". This call will be ignored.'),!1):(this.os(iF,!0),!0)}Hn(){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!==iT)}cs(){var e,t,i,s,r=this.Hn();return(null==(e=this.persistence)?void 0:e.ei)!==r&&(null==(i=this.persistence)||i.set_disabled(r)),(null==(t=this.sessionPersistence)?void 0:t.ei)!==r&&(null==(s=this.sessionPersistence)||s.set_disabled(r)),r}opt_in_capturing(e){var t;if(this.config.cookieless_mode!==iA){if(this.On()){this.reset(!0),null==(r=this.sessionManager)||r.destroy(),null==(n=this.pageViewM
1anager)||n.destroy(),this.sessionManager=new nv(this),this.pageViewManager=new s0(this),this.persistence&&(this.sessionPropsManager=new nc(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)?o:null==(l=nJ.__defaultExtensionClasses)?void 0:l.sessionRecording;h&&(this.sessionRecording=this.Pn(this.sessionRecording,new h(this)),this.Jn&&(null==(u=this.sessionRecording)||null==u.onRemoteConfig||u.onRemoteConfig(this.Jn)))}this.consent.optInOut(!0),this.cs(),this.Kn(),null==(t=this.sessionRecording)||t.startIfEnabledOrStop(),this.config.cookieless_mode==iT&&(null==(i=this.surveys)||i.loadIfEnabled()),(J(null==e?void 0:e.captureEventName)||null!=e&&e.captureEventName)&&this.capture(null!=(s=null==e?void 0:e.captureEventName)?s:"$opt_in",null==e?void 0:e.captureProperties,{send_instantly:!0}),this.config.capture_pageview&&this.Yn()}else tj.warn(nq)}opt_out_capturing(){var e,t,i;this.config.cookieless_mode!==iA?(this.config.cookieless_mode===iT&&this.consent.isOptedIn()&&this.reset(!0),this.consent.optInOut(!1),this.cs(),this.config.cookieless_mode===iT&&(this.register({distinct_id:iI,$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.Yn(),this.Kn())):tj.warn(nq)}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===iA||(this.config.cookieless_mode===iT?this.consent.isRejected()||this.consent.isOptedIn():!this.has_opted_out_capturing())}clear_opt_in_out_capturing(){this.consent.reset(),this.cs()}_is_bot(){return o?ng(o,this.config.custom_blocked_useragents):void 0}Yn(){a&&("visible"===a.visibilityState?this.Fn||(this.Fn=!0,this.capture(iz,{title:a.title},{send_instantly:!0}),this.Nn&&(a.removeEventListener(iN,this.Nn),this.Nn=null)):this.Nn||(this.Nn=this.Yn.bind(this),iX(a,iN,this.Nn)))}debug(e){!1===e?(null==r||r.console.log("You've disabled debug mode."),this.set_config({debug:!1})):(null==r||r.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}))}Ci(){var e,t,i,s,r=this.jn||{};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?(tj.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&&!Z(r[e]),s=t in r&&!Z(r[t]),i?r[e]:!!s&&(tj&&tj.warn("Config field '"+t+"' is deprecated. Please use '"+e+"' instead. The old field will be removed in a future major version."),r[t]))}gr(e){if(Z(this.config.before_send))return e;var t,i=Object.keys(null!=(t=e.properties)?t:{}).filter(ei),s=B(this.config.before_send)?this.config.before_send:[this.config.before_send],r=e;for(var n of s){if(Z(r=n(r))){var o="Event '"+e.event+"' was rejected in beforeSend function";return et(e.event)?tj.warn(o+". This can cause unexpected behavior."):tj.info(o),null}r.properties&&!V(r.properties)||tj.warn("Event '"+e.event+"' has no properties after beforeSend function, this is likely an error.")}for(var a of i)if(r.properties&&Z(r.properties[a]))return tj.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.Br)?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)})}qn(e){var t=ee(e)&&!e,i=sn.O()&&"true"===sn.A("ph_debug");return!t&&(!!i||e)}}nJ.__defaultExtensionClasses={},nJ.ds={trace:nO=()=>{},debug:nO,info:nO,warn:nO,error:nO,fatal:nO},function(e,t){for(var i=0;t.length>i;i++)e.prototype[t[i]]=iK(e.prototype[t[i]])}(nJ,["identify"]);
1class nW{constructor(e){this.disabled=!1===e;var t=G(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 nY="$copy_autocapture",nK=tz("[AutoCapture]");function nZ(e,t){return t.length>e?t.slice(0,e)+"...":t}var nQ=tz("[ExceptionAutocapture]"),nX=tz("[TracingHeaders]"),n0=tz("[Web Vitals]"),n1="disabled",n2="lazy_loading",n3="awaiting_config",n5="missing_config";tz("[SessionRecording]"),tz("[SessionRecording]");var n8="[SessionRecording]",n6=tz(n8),n4=tz("[Heatmaps]");function n7(e){return G(e)&&"clientX"in e&&"clientY"in e&&Q(e.clientX)&&Q(e.clientY)}var n9=tz("[Product Tours]"),oe=e=>{var t;return!e.config.disable_product_tours&&!(null==(t=e.persistence)||!t.get_property(t1))},ot=["$set_once","$set"],oi=tz("[SiteApps]"),os="Error while initializing PostHog app with config id ";function or(e,t,i){if(Z(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 on{constructor(e){this.vs=new nd,this.fs=(e,t)=>this.ps(e,t)&&this.gs(e,t)&&this.ys(e,t)&&this.bs(e,t),this.ps=(e,t)=>null==t||!t.event||(null==e?void 0:e.event)===(null==t?void 0:t.event),this._instance=e,this._s=new Set,this.ws=new Set}init(){var e,t;J(null==(e=this._instance)?void 0:e._addCaptureHook)||null==(t=this._instance)||t._addCaptureHook((e,t)=>{this.on(e,t)})}register(e){var t,i;if(!J(null==(t=this._instance)?void 0:t._addCaptureHook)&&(e.forEach(e=>{var t,i;null==(t=this.ws)||t.add(e),null==(i=e.steps)||i.forEach(e=>{var t;null==(t=this._s)||t.add((null==e?void 0:e.event)||"")})}),null!=(i=this._instance)&&i.autocapture)){var s,r=new Set;e.forEach(e=>{var t;null==(t=e.steps)||t.forEach(e=>{null!=e&&e.selector&&r.add(null==e?void 0:e.selector)})}),null==(s=this._instance)||s.autocapture.setElementSelectors(r)}}on(e,t){var i;null!=t&&0!=e.length&&(this._s.has(e)||this._s.has(null==t?void 0:t.event))&&this.ws&&(null==(i=this.ws)?void 0:i.size)>0&&this.ws.forEach(e=>{this.xs(t,e)&&this.vs.emit("actionCaptured",e.name)})}ks(e){this.onAction("actionCaptured",t=>e(t))}xs(e,t){if(null==(null==t?void 0:t.steps))return!1;for(var i of t.steps)if(this.fs(e,i))return!0;return!1}onAction(e,t){return this.vs.on(e,t)}gs(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||!or(s,t.url,t.url_matching||"contains"))return!1}return!0}ys(e,t){return!!this.Ss(e,t)&&!!this.Cs(e,t)&&!!this.Is(e,t)}Ss(e,t){if(null==t||!t.href)return!0;var i=this.Ts(e);if(i.length>0)return i.some(e=>or(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&&or((r=n.match(/(?::|")href="(.*?)"/))?r[1]:"",t.href,t.href_matching||"exact")}Cs(e,t){if(null==t||!t.text)return!0;var i=this.Ts(e);if(i.length>0)return i.some(e=>or(e.text,t.text,t.text_matching||"exact")||or(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;!Z(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=>or(e,n,o)))}Is(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}Ts(e){var t;return null==(null==e||null==(t=e.properties)?void 0:t.$elements)?[]:null==e?void 0:e.properties.$elements}bs(e,t){return null==t||!t.properties||0===t.properties.length||nb(t.properties.reduce((e,t)=>
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 oo{constructor(e){this.Es=[],this._instance=e,this.Ms=new Map,this.Ps=new Map,this.Rs=new Map}Os(e,t){return!!e&&nb(e.propertyFilters,null==t?void 0:t.properties)}Ls(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}As(e,t,i){var s=(i===rf?this.Ms:this.Ps).get(e),r=[];return this.Fs(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.Os(n,t)})}register(e){var t;J(null==(t=this._instance)?void 0:t._addCaptureHook)||(this.Ns(e),this.Ds(e))}Ds(e){var t=e.filter(e=>{var t,i;return(null==(t=e.conditions)?void 0:t.actions)&&(null==(i=e.conditions)||null==(i=i.actions)||null==(i=i.values)?void 0:i.length)>0});0!==t.length&&(null==this.$s&&(this.$s=new on(this._instance),this.$s.init(),this.$s.ks(e=>{this.onAction(e)})),t.forEach(e=>{var t,i,s,r,n;e.conditions&&null!=(t=e.conditions)&&t.actions&&null!=(i=e.conditions)&&null!=(i=i.actions)&&i.values&&(null==(s=e.conditions)||null==(s=s.actions)||null==(s=s.values)?void 0:s.length)>0&&(null==(r=this.$s)||r.register(e.conditions.actions.values),null==(n=e.conditions)||null==(n=n.actions)||null==(n=n.values)||n.forEach(t=>{if(t&&t.name){var i=this.Rs.get(t.name);i&&i.push(e.id),this.Rs.set(t.name,i||[e.id])}}))}))}Ns(e){var t,i=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}),s=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});0===i.length&&0===s.length||(null==(t=this._instance)||t._addCaptureHook((e,t)=>{this.onEvent(e,t)}),this.Ms=this.Ls(e,rf),this.Ps=this.Ls(e,rm))}onEvent(e,t){var i,s,r=this.le(),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.qs(e,n);if("consume"===o)return r.info("event consumed activated item, removing it",{event:e,itemId:n}),void this.js([n]);if("persist"===o)return r.info("shown item promoted to persisted activation",{event:e,itemId:n}),void this.Bs(n)}if(this.Ps.has(e)){var a=this.As(e,t,rm);a.length>0&&(r.info("cancel event matched, cancelling items",{event:e,itemsToCancel:a.map(e=>e.id)}),this.js(a.map(e=>e.id)),a.forEach(e=>this.Hs(e.id)))}if(this.Ms.has(e)){r.info("event name matched",{event:e,eventPayload:t,items:this.Ms.get(e)});var l=this.As(e,t,rf);this.Us(l.map(e=>e.id))}}onAction(e){this.Rs.has(e)&&this.Us(this.Rs.get(e)||[])}Us(e){0!==e.length&&(this.Es=[...new Set([...this.Es,...e])],this.le().info("updating activated items",{activatedItems:this.getActivatedIds()}))}Bs(e){this.Es=this.Es.filter(t=>t!==e);var t=this.zs();t.includes(e)||this.Vs([...t,e])}js(e){var t=new Set(e);this.Es=this.Es.filter(e=>!t.has(e));var i=this.zs(),s=i.filter(e=>!t.has(e));s.length!==i.length&&this.Vs(s)}zs(){var e,t=this.Ws();return(null==(e=this._instance)||null==(e=e.persistence)?void 0:e.props[t])||[]}getActivatedIds(){return[...new Set([...this.zs(),...this.Es])].filter(e=>!this.Gs(e))}reset(){this.Es=[],this.zs().length>0&&this.Vs([])}getEventToItemsMap(){return this.Ms}Zs(){return this.$s}}class oa extends oo{constructor(e){super(e)}Ws(){return iv}Qs(){return ry}Fs(e){var t;null==(t=this._instance)||t.getSurveys(e)}Hs(e){var t;null==(t=this._instance)||t.cancelPendingSurvey(e)}le(){return nS}Vs(e){var t;null==(t=this._instance)||null==(t=t.persistence)||t.register({[iv]:e})}Gs(){return!1}qs(e,t){var i,s,r,n,o,a;return this.Fs(e=>{a=e.find(e=>e.id===t)}),!a||(o=(null!=(s=null==(r=(i=a).conditions)||null==(r=r.events)||null==(r=r.values)?void 0:r.length)?s:0)>0,"always"===i.schedule||null!=(n=i.conditions)&&null!=(n=n.events)&&n.repeatedActivation&&o)?e===ry?"consume":"ignore":e===ry?"persist":e===rb||e===rx?"consume":"ignore"}getSurveys(){return this.getActivatedIds()}
1getEventToSurveys(){return this.getEventToItemsMap()}}var ol="SDK is not enabled or survey functionality is not yet loaded",ou="Disabled. Not loading surveys.",oh=null!=r&&r.location?s7(r.location.hash,"__posthog")||s7(location.hash,"state"):null,oc="_postHogToolbarParams",od=tz("[Toolbar]"),op=tz("[FeatureFlags]"),ov=tz("[FeatureFlags]",{debugEnabled:!0}),og="\" failed. Feature flags didn't load in time.",o_=e=>{for(var t={},i=0;e.length>i;i++)t[e[i]]=!0;return t},of=e=>{var t={};for(var[i,s]of iW(e||{}))s&&(t[i]=s);return t},om=tz("[Error tracking]"),oy="Refusing to render web experiment since the viewer is a likely bot",ob={icontains:(e,t)=>!!r&&t.href.toLowerCase().indexOf(e.toLowerCase())>-1,not_icontains:(e,t)=>!!r&&-1===t.href.toLowerCase().indexOf(e.toLowerCase()),regex:(e,t)=>!!r&&n_(t.href,e),not_regex:(e,t)=>!!r&&!n_(t.href,e),exact:(e,t)=>t.href===e,is_not:(e,t)=>t.href!==e};class ox{get qt(){return this._instance.config}constructor(e){var t=this;this.getWebExperimentsAndEvaluateDisplayLogic=function(e){void 0===e&&(e=!1),t.getWebExperiments(e=>{ox.Js("retrieved web experiments from the server"),t.Ks=new Map,e.forEach(e=>{if(e.feature_flag_key){t.Ks&&(ox.Js("setting flag key ",e.feature_flag_key," to web experiment ",e),null==(i=t.Ks)||i.set(e.feature_flag_key,e));var i,s=t._instance.getFeatureFlag(e.feature_flag_key);W(s)&&e.variants[s]&&t.Ys(e.name,s,e.variants[s].transforms)}else if(e.variants)for(var r in e.variants){var n=e.variants[r];ox.Xs(n)&&t.Ys(e.name,r,n.transforms)}})},e)},this._instance=e,this._instance.onFeatureFlags(e=>{this.onFeatureFlags(e)})}initialize(){}onFeatureFlags(e){if(this._is_bot())ox.Js(oy);else if(!this.qt.disable_web_experiments){if(Z(this.Ks))return this.Ks=new Map,this.loadIfEnabled(),void this.previewWebExperiment();ox.Js("applying feature flags",e),e.forEach(e=>{var t;if(this.Ks&&null!=(t=this.Ks)&&t.has(e)){var i,s=this._instance.getFeatureFlag(e),r=null==(i=this.Ks)?void 0:i.get(e);s&&null!=r&&r.variants[s]&&this.Ys(r.name,s,r.variants[s].transforms)}})}}previewWebExperiment(){var e=ox.getWindowLocation();if(null!=e&&e.search){var t=s6(null==e?void 0:e.search,"__experiment_id"),i=s6(null==e?void 0:e.search,"__experiment_variant");t&&i&&(ox.Js("previewing web experiments "+t+" && "+i),this.getWebExperiments(e=>{this.eo(parseInt(t),i,e)},!1,!0))}}loadIfEnabled(){this.qt.disable_web_experiments||this.getWebExperimentsAndEvaluateDisplayLogic()}getWebExperiments(e,t,i){if(this.qt.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.qt.token),method:"GET",callback:t=>e(200===t.statusCode&&t.json&&t.json.experiments||[])})}eo(e,t,i){var s=i.filter(t=>t.id===e);s&&s.length>0&&(ox.Js("Previewing web experiment ["+s[0].name+"] with variant ["+t+"]"),this.Ys(s[0].name,t,s[0].variants[t].transforms))}static Xs(e){return!Z(e.conditions)&&ox.ro(e)&&ox.io(e)}static ro(e){if(Z(e.conditions)||Z(null==(t=e.conditions)?void 0:t.url))return!0;var t,i,s,r,n=ox.getWindowLocation();return!!n&&(null==(i=e.conditions)||!i.url||ob[null!=(s=null==(r=e.conditions)?void 0:r.urlMatchType)?s:"icontains"](e.conditions.url,n))}
1static getWindowLocation(){return null==r?void 0:r.location}static io(e){if(Z(e.conditions)||Z(null==(i=e.conditions)?void 0:i.utm))return!0;var t=rr();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,p=null==(a=e.conditions)||null==(a=a.utm)||!a.utm_medium||(null==(l=e.conditions)||null==(l=l.utm)?void 0:l.utm_medium)==t.utm_medium,v=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&&p&&v&&d}return!1}static Js(e){for(var t=arguments.length,i=Array(t>1?t-1:0),s=1;t>s;s++)i[s-1]=arguments[s];tj.info("[WebExperiments] "+e,i)}Ys(e,t,i){this._is_bot()?ox.Js(oy):"control"!==t?i.forEach(i=>{if(i.selector){ox.Js("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)})}}):ox.Js("Control variants leave the page unmodified.")}_is_bot(){return o&&this._instance?ng(o,this.qt.custom_blocked_useragents):void 0}}var ow=tz("[Conversations]"),oE="Conversations not available yet.",ok={featureFlags:class{constructor(e){this.no=!1,this.so=!1,this.oo=!1,this.ao=!1,this.lo=!1,this.uo=!1,this.ho=!1,this.co=!1,this._instance=e,this.featureFlagEventHandlers=[]}get qt(){return this._instance.config}get Ji(){return this._instance.persistence}do(e){return this._instance.get_property(e)}vo(){var e,t;return null!=(e=null==(t=this.Ji)?void 0:t.ri(this.qt.feature_flag_cache_ttl_ms))&&e}fo(){return!!this.vo()&&(this.co||this.oo||(this.co=!0,op.warn("Feature flag cache is stale, triggering refresh..."),this.reloadFeatureFlags()),!0)}po(){var e,t=null!=(e=this.qt.evaluation_contexts)?e:this.qt.evaluation_environments;return!this.qt.evaluation_environments||this.qt.evaluation_contexts||this.ho||(op.warn("evaluation_environments is deprecated. Use evaluation_contexts instead. evaluation_environments will be removed in a future version."),this.ho=!0),null!=t&&t.length?t.filter(e=>{var t=e&&"string"==typeof e&&e.trim().length>0;return t||op.error("Invalid evaluation context found:",e,"Expected non-empty string"),t}):[]}mo(){return this.po().length>0}yo(){var e=this.qt.flag_keys;if(!J(e)){if(B(e))return e.filter(e=>{var t=e&&"string"==typeof e&&e.trim().length>0;return t||op.error("Invalid flag key found:",e,"Expected non-empty string"),t});op.error("Invalid flag_keys found:",e,"Expected array of non-empty strings")}}initialize(){var e,t,{config:i}=this._instance,s=null!=(e=null==(t=i.bootstrap)?void 0:t.featureFlags)?e:{};if(Object.keys(s).length){var r,n,o=null!=(r=null==(n=i.bootstrap)?void 0:n.featureFlagPayloads)?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)=>(o[t]&&(e[t]=o[t]),e),{});this.receivedFeatureFlags({featureFlags:a,featureFlagPayloads:l})}}updateFlags(e,t,i){var s,r,n=null!=i&&i.merge&&null!=(s=this.do(it))?s:{},o=null!=i&&i.merge&&null!=(r=this.do(io))?r:{},a=y({},n,e),l=y({},o,t),u={};for(var[h,c]of Object.entries(a))u[h]={key:h,enabled:"string"==typeof c||c,variant:"string"==typeof c?c:void 0,reason:void 0,metadata:J(null==l?void 0:l[h])?void 0:{id:0,version:void 0,description:void 0,payload:l[h]}};this.receivedFeatureFlags({flags:u})}get hasLoadedFlags(){return this.so}getFlags(){return Object.keys(this.getFlagVariants())}getFlagsWithDetails(){var e=this.do(ir),t=this.do(il),i=this.do(iu);if(!i&&!t)return e||{};var s=iJ({},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=J(l)?null!=(n=null==a?void 0:a.enabled)&&n:!!l,h=J(l)?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)&&(
1d.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.no||(op.warn(" Overriding feature flag details!",{flagDetails:e,overriddenPayloads:i,finalDetails:s}),this.no=!0),s}getFlagVariants(){var e=this.do(it),t=this.do(il);if(!t)return e||{};for(var i=iJ({},e),s=Object.keys(t),r=0;s.length>r;r++)i[s[r]]=t[s[r]];return this.no||(op.warn(" Overriding feature flags!",{enabledFlags:e,overriddenFlags:t,finalFlags:i}),this.no=!0),i}getFlagPayloads(){var e=this.do(io),t=this.do(iu);if(!t)return e||{};for(var i=iJ({},e||{}),s=Object.keys(t),r=0;s.length>r;r++)i[s[r]]=t[s[r]];return this.no||(op.warn(" Overriding feature flag payloads!",{flagPayloads:e,overriddenPayloads:t,finalPayloads:i}),this.no=!0),i}reloadFeatureFlags(){this.ao||this.qt.advanced_disable_feature_flags||this.bo||(this._instance.An.emit("featureFlagsReloading",!0),this.bo=setTimeout(()=>{this._o()},5))}wo(){clearTimeout(this.bo),this.bo=void 0}ensureFlagsLoaded(){this.so||this.oo||this.bo||this.reloadFeatureFlags()}setAnonymousDistinctId(e){this.$anon_distinct_id=e}setReloadingPaused(e){this.ao=e}_o(e){var t;if(this.wo(),!this._instance.Ci())if(this.oo)this.lo=!0;else{var i=this.qt.token,s=this.do(tG),r={token:i,distinct_id:this._instance.get_distinct_id(),groups:this._instance.getGroups(),$anon_distinct_id:this.$anon_distinct_id,person_properties:y({},(null==(t=this.Ji)?void 0:t.get_initial_props())||{},this.do(ih)||{}),group_properties:this.do(ic),timezone:rd()};K(s)||J(s)||(r.$device_id=s),(null!=e&&e.disableFlags||this.qt.advanced_disable_feature_flags)&&(r.disable_flags=!0),this.mo()&&(r.evaluation_contexts=this.po());var n=this.yo();J(n)||(r.flag_keys=n);var o=!!this.qt.advanced_only_evaluate_survey_feature_flags,a=this._instance.requestRouter.endpointFor("flags","/flags/?v=2"+(this.qt.advanced_only_evaluate_survey_feature_flags?"&only_evaluate_survey_feature_flags=true":""));this.oo=!0,this._instance._send_request({method:"POST",url:a,data:r,skipIPParam:!0,compression:this.qt.disable_compression?void 0:r$,timeout:this.qt.feature_flag_request_timeout_ms,callback:e=>{var t,i,s,n=!0;if(200===e.statusCode&&(this.lo||(this.$anon_distinct_id=void 0),n=!1),this.oo=!1,!r.disable_flags||this.lo){this.uo=!n;var a=[];e.error?e.error instanceof Error?a.push("AbortError"===e.error.name?"timeout":"connection_error"):a.push("unknown_error"):200!==e.statusCode&&a.push("api_error_"+e.statusCode),null!=(t=e.json)&&t.errorsWhileComputingFlags&&a.push("errors_while_computing_flags");var l,u=!(null==(i=e.json)||null==(i=i.quotaLimited)||!i.includes("feature_flags"));(u&&a.push("quota_limited"),null==(s=this.Ji)||s.register({[iy]:a}),u)?op.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."):(r.disable_flags||this.receivedFeatureFlags(null!=(l=e.json)?l:{},n,{partialResponse:o}),this.lo&&(this.lo=!1,this._o()))}}})}}getFeatureFlag(e,t){var i;if(void 0===t&&(t={}),!t.fresh||this.uo)if(this.so||this.getFlags()&&this.getFlags().length>0){if(!this.fo()){var s=this.getFeatureFlagResult(e,t);return null!=(i=null==s?void 0:s.variant)?i:null==s?void 0:s.enabled}}else op.warn('getFeatureFlag for key "'+e+og)}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.uo)if(this.so||this.getFlags()&&this.getFlags().length>0){if(!this.fo()){var i=this.getFlagVariants(),s=e in i,r=i[e],n=this.getFlagPayloads()[e],o=String(r),a=this.do(ia)||void 0,l=this.do(ib)||void 0,u=this.do(i_)||{};if(this.qt.advanced_feature_flags_dedup_per_session){var h,c=this._instance.get_session_id(),d=this.do(im);c&&c!==d&&(u={},null==(h=this.Ji)||h.register({[i_]:u,[im]:c}))}if((t.send_event||!("send_event"in t))&&(!(e in u)||!u[e].includes(o))){B(u[e])?u[e].push(o):u[e]=[o],null==(_=this.Ji)||_.register({[i_]:u});var p=this.getFeatureFlagDetails(e),v=[...null!=(f=this.do(iy))?f:[]];J(r)&&v.push("flag_missing");var g={$feature_flag:e,$feature_flag_response:r,$feature_flag_payload:n||null,$feature_flag_request_id:a,$feature_flag_evaluated_at:l,$feature_flag_bootstrapped_response:(null==(m=this.qt.bootstrap)||null==(m
1=m.featureFlags)?void 0:m[e])||null,$feature_flag_bootstrapped_payload:(null==(y=this.qt.bootstrap)||null==(y=y.featureFlagPayloads)?void 0:y[e])||null,$used_bootstrap_value:!this.uo};J(null==p||null==(b=p.metadata)?void 0:b.version)||(g.$feature_flag_version=p.metadata.version);var _,f,m,y,b,x,w,E,k,S,P,F=null!=(x=null==p||null==(w=p.reason)?void 0:w.description)?x:null==p||null==(E=p.reason)?void 0:E.code;F&&(g.$feature_flag_reason=F),null!=p&&null!=(k=p.metadata)&&k.id&&(g.$feature_flag_id=p.metadata.id),J(null==p?void 0:p.original_variant)&&J(null==p?void 0:p.original_enabled)||(g.$feature_flag_original_response=J(p.original_variant)?p.original_enabled:p.original_variant),null!=p&&null!=(S=p.metadata)&&S.original_payload&&(g.$feature_flag_original_payload=null==p||null==(P=p.metadata)?void 0:P.original_payload),v.length&&(g.$feature_flag_error=v.join(",")),this._instance.capture("$feature_flag_called",g)}if(s)return{key:e,enabled:!!r,variant:"string"==typeof r?r:void 0,payload:(e=>{if("string"!=typeof e)return e;try{return JSON.parse(e)}catch(t){return e}})(n)}}}else op.warn('getFeatureFlagResult for key "'+e+og)}getRemoteConfigPayload(e,t){var i=this.qt.token,s={distinct_id:this._instance.get_distinct_id(),token:i};this.mo()&&(s.evaluation_contexts=this.po());var r=this.yo();J(r)||(s.flag_keys=r),this._instance._send_request({method:"POST",url:this._instance.requestRouter.endpointFor("flags","/flags/?v=2"),data:s,skipIPParam:!0,compression:this.qt.disable_compression?void 0:r$,timeout:this.qt.feature_flag_request_timeout_ms,callback(i){var s,r=null==(s=i.json)?void 0:s.featureFlagPayloads;t((null==r?void 0:r[e])||void 0)}})}isFeatureEnabled(e,t){if(void 0===t&&(t={}),!t.fresh||this.uo){if(this.so||this.getFlags()&&this.getFlags().length>0){var i=this.getFeatureFlag(e,t);return J(i)?void 0:!!i}op.warn('isFeatureEnabled for key "'+e+og)}}addFeatureFlagsHandler(e){this.featureFlagEventHandlers.push(e)}removeFeatureFlagsHandler(e){this.featureFlagEventHandlers=this.featureFlagEventHandlers.filter(t=>t!==e)}receivedFeatureFlags(e,t,i){if(this.Ji){this.so=!0;var s=this.getFlagVariants(),r=this.getFlagPayloads(),n=this.getFlagsWithDetails();!function(e,t,i,s,r,n){void 0===i&&(i={}),void 0===s&&(s={}),void 0===r&&(r={});var o,a=((o=e.flags)?(e.featureFlags=Object.fromEntries(Object.keys(o).map(e=>{var t;return[e,null!=(t=o[e].variant)?t:o[e].enabled]})),e.featureFlagPayloads=Object.fromEntries(Object.keys(o).filter(e=>o[e].enabled).filter(e=>{var t;return null==(t=o[e].metadata)?void 0:t.payload}).map(e=>{var t;return[e,null==(t=o[e].metadata)?void 0:t.payload]}))):op.warn("Using an older version of the feature flags endpoint. Please upgrade your PostHog server to the latest version"),e),l=a.flags,u=a.featureFlags,h=a.featureFlagPayloads;if(u){var c=e.requestId,d=e.evaluatedAt;if(B(u)){op.warn("v1 of the feature flags endpoint is deprecated. Please use the latest version.");var p={};if(u)for(var v=0;u.length>v;v++)p[u[v]]=!0;t&&t.register({[ii]:u,[it]:p})}else{var g=u,_=h,f=l;if(null!=n&&n.partialResponse)g=y({},i,g),_=y({},s,_),f=y({},r,f);else if(e.errorsWhileComputingFlags)if(l){var m=new Set(Object.keys(l).filter(e=>{var t;return!(null!=(t=l[e])&&t.failed)}));g=y({},i,Object.fromEntries(Object.entries(g).filter(e=>{var[t]=e;return m.has(t)}))),_=y({},s,Object.fromEntries(Object.entries(_||{}).filter(e=>{var[t]=e;return m.has(t)}))),f=y({},r,Object.fromEntries(Object.entries(f||{}).filter(e=>{var[t]=e;return m.has(t)})))}else g=y({},i,g),_=y({},s,_),f=y({},r,f);t&&t.register(y({[ii]:Object.keys(of(g)),[it]:g||{},[io]:_||{},[ir]:f||{}},c?{[ia]:c}:{},d?{[ib]:d}:{}))}}}(e,this.Ji,s,r,n,i),t||(this.co=!1),this.xo(t)}}override(e,t){void 0===t&&(t=!1),op.warn("override is deprecated. Please use overrideFeatureFlags instead."),this.overrideFeatureFlags({flags:e,suppressWarning:t})}overrideFeatureFlags(e){if(!this._instance.__loaded||!this.Ji)return op.uninitializedWarning("posthog.featureFlags.overrideFeatureFlags");if(!1===e)return this.Ji.unregister(il),this.Ji.unregister(iu),this.xo(),ov.info("All overrides cleared");if(B(e)){var t,i=o_(e);return this.Ji.register({[il]:i}),this.xo(),ov.info("Flag overrides set",{flags:e})}if(e&&"object"==typeof e&&("flags"in e||"payloads"in e)){if(this.no=!!(null!=(t=e.suppressWarning)&&t),"flags"in e){if(!1===e.flags)this.Ji.unregister(il),ov.info("Flag overrides cleared");else if(e.flags){if(B(e.flags)){var s=o_(e.flags);this.Ji.register({[il]:s})}else this.Ji.register({[il]:e.flags});ov.info("Flag overrides set",{flags:e.flags})}}return"payloads"in e&&(!1===e.payloads?(this.Ji.unregister(iu),ov.info("Payload overrides cleared")):e.payloads&&(this.Ji.register({[iu]:e.payloads}),ov.info("Payload overrides set",{payloads:e.payloads}))),void this.xo()}if(e&&"object"==typeof e)return this.Ji.register({[il]:e}),this.xo(),ov.info("Flag overrides set",{flags:e});op.warn("Invalid overrideOptions provided to overrideFeatureFlags",{overrideOptions:e})}onFeatureFlags(e){if(this.addFeatureFlagsHandler(e),this.so){var{flags:t,flagVariants:i}=this.ko();e(t,i)}return()=>this.removeFeatureFlagsHandler(e)}updateEarlyAccessFeatureEnrollment(e,t,i){var s,r=(this.do(is)||[]).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),this._instance.capture("$feature_enrollment_update",o),this.setPersonPropertiesForFlags(n,!1);var a=y({},this.getFlagVariants(),{[e]:t});null==(s=this.Ji)||s.register({[ii]:Object.keys(of(a)),[it]:a}),this.xo()}getEarlyAccessFeatures(e,t,i){void 0===t&&(t=!1);var s=this.do(is),r=i?"&"+i.map(e=>"stage="+e).join("&"):"";if(s&&!t)return e(s);this._instance._send_request({url:this._instance.requestRouter.endpointFor("api","/api/early_access_features/?token="+this.qt.token+r),method:"GET",callback:t=>{var i,s;if(t.json){var r=t.json.earlyAccessFeatures;return null==(i=this.Ji)||i.unregister(is),null==(s=this.Ji)||s.register({[is]:r}),e(r)}}})}ko(){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),{})}}xo(e){var{flags:t,flagVariants:i}=this.ko();
1this.featureFlagEventHandlers.forEach(s=>s(t,i,{errorsLoading:e}))}setPersonPropertiesForFlags(e,t){void 0===t&&(t=!0);var i=this.do(ih)||{},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._instance.register({[ih]:y({},i,n,s)}),t&&this._instance.reloadFeatureFlags()}unsetPersonPropertiesForFlags(e,t){void 0===t&&(t=!0);var i=y({},this.do(ih)||{});e.forEach(e=>{delete i[e]}),this._instance.register({[ih]:i}),t&&this._instance.reloadFeatureFlags()}resetPersonPropertiesForFlags(e){void 0===e&&(e=!0),this._instance.unregister(ih),e&&this._instance.reloadFeatureFlags()}setGroupPropertiesForFlags(e,t){void 0===t&&(t=!0);var i=this.do(ic)||{};0!==Object.keys(i).length&&Object.keys(i).forEach(t=>{i[t]=y({},i[t],e[t]),delete e[t]}),this._instance.register({[ic]:y({},i,e)}),t&&this._instance.reloadFeatureFlags()}resetGroupPropertiesForFlags(e){if(e){var t=this.do(ic)||{};this._instance.register({[ic]:y({},t,{[e]:{}})})}else this._instance.unregister(ic)}reset(){this.so=!1,this.oo=!1,this.ao=!1,this.lo=!1,this.uo=!1,this.$anon_distinct_id=void 0,this.wo(),this.no=!1}}},oS=y({productTours:class{get Ji(){return this._instance.persistence}constructor(e){this.La=null,this.Aa=null,this._instance=e}initialize(){this.loadIfEnabled()}onRemoteConfig(e){if("productTours"in e){var t,i;if(this.Ji&&this.Ji.register({[t1]:!!e.productTours}),!oe(this._instance))return!this.La&&Z(null==(t=this.Ji)?void 0:t.props[ig])||n9.info("product tours disabled; stopping and clearing cached tours"),null==(i=this.La)||i.stop(),this.La=null,void this.clearCache();this.loadIfEnabled()}}loadIfEnabled(){!this.La&&oe(this._instance)&&this.$r(()=>this.Fa())}$r(e){var t,i;null!=(t=v.__PosthogExtensions__)&&t.generateProductTours?e():null==(i=v.__PosthogExtensions__)||null==i.loadExternalDependency||i.loadExternalDependency(this._instance,"product-tours",t=>{t?n9.error("Could not load product tours script",t):e()})}Fa(){var e;!this.La&&null!=(e=v.__PosthogExtensions__)&&e.generateProductTours&&(this.La=v.__PosthogExtensions__.generateProductTours(this._instance,!0))}getProductTours(e,t){if(void 0===t&&(t=!1),!B(this.Aa)||t){var i=this.Ji;if(i){var s=i.props[ig];if(B(s)&&!t)return this.Aa=s,void e(s,{isLoaded:!0})}this._instance._send_request({url:this._instance.requestRouter.endpointFor("api","/api/product_tours/?token="+this._instance.config.token),method:"GET",callback:t=>{if(oe(this._instance)){var s=t.statusCode;if(200!==s||!t.json){var r="Product Tours API could not be loaded, status: "+s;return n9.error(r),void e([],{isLoaded:!1,error:r})}var n=B(t.json.product_tours)?t.json.product_tours:[];this.Aa=n,i&&i.register({[ig]:n}),e(n,{isLoaded:!0})}else e([],{isLoaded:!0})}})}else e(this.Aa,{isLoaded:!0})}getActiveProductTours(e){Z(this.La)?e([],{isLoaded:!1,error:"Product tours not loaded"}):this.La.getActiveProductTours(e)}showProductTour(e){var t;null==(t=this.La)||t.showTourById(e)}previewTour(e){this.La?this.La.previewTour(e):this.$r(()=>{var t;this.Fa(),null==(t=this.La)||t.previewTour(e)})}dismissProductTour(){var e;null==(e=this.La)||e.dismissTour("user_clicked_skip")}nextStep(){var e;null==(e=this.La)||e.nextStep()}previousStep(){var e;null==(e=this.La)||e.previousStep()}clearCache(){var e;this.Aa=null,null==(e=this.Ji)||e.unregister(ig)}resetTour(e){var t;null==(t=this.La)||t.resetTour(e)}resetAllTours(){var e;null==(e=this.La)||e.resetAllTours()}cancelPendingTour(e){var t;null==(t=this.La)||t.cancelPendingTour(e)}}},ok),oP=y({surveys:class{get qt(){return this._instance.config}constructor(e){this.Ya=void 0,this._surveyManager=null,this.Xa=!1,this.el=[],this.tl=null,this._instance=e,this._surveyEventReceiver=null}initialize(){this.loadIfEnabled()}onRemoteConfig(e){if(!this.qt.disable_surveys){var t=e.surveys;if(Z(t))return nS.warn("Flags not loaded yet. Not loading surveys.");var i=B(t);this.Ya=i?t.length>0:t,nS.info("flags response received, isSurveysEnabled: "+this.Ya),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(nP)||null!=s&&s.startsWith("inProgressSurvey_"))&&t.push(s)}
1t.forEach(e=>localStorage.removeItem(e))}catch(e){}}loadIfEnabled(){if(!this._surveyManager)if(this.Xa)nS.info("Already initializing surveys, skipping...");else if(this.qt.disable_surveys)nS.info(ou);else if(this.qt.cookieless_mode&&this._instance.consent.isOptedOut())nS.info("Not loading surveys in cookieless mode without consent.");else{var e=null==v?void 0:v.__PosthogExtensions__;if(e){if(!J(this.Ya)||this.qt.advanced_enable_surveys){var t=this.Ya||this.qt.advanced_enable_surveys;this.Xa=!0;try{var i=e.generateSurveys;if(i)return void this.rl(i,t);var s=e.loadExternalDependency;if(!s)return void this.il(iO);s(this._instance,"surveys",i=>{i||!e.generateSurveys?this.il("Could not load surveys script",i):this.rl(e.generateSurveys,t)})}catch(e){throw this.il("Error initializing surveys",e),e}finally{this.Xa=!1}}}else nS.error("PostHog Extensions not found.")}}rl(e,t){this._surveyManager=e(this._instance,t),this._surveyEventReceiver=new oa(this._instance),nS.info("Surveys loaded successfully"),this.nl({isLoaded:!0})}il(e,t){nS.error(e,t),this.nl({isLoaded:!1,error:e})}onSurveysLoaded(e){return this.el.push(e),this._surveyManager&&this.nl({isLoaded:!0}),()=>{this.el=this.el.filter(t=>t!==e)}}getSurveys(e,t){if(void 0===t&&(t=!1),this.qt.disable_surveys)return nS.info(ou),e([]);var i,s=this._instance.get_property(id);if(s&&!t)return e(s,{isLoaded:!0});"u">typeof Promise&&this.tl?this.tl.then(t=>{var{surveys:i,context:s}=t;return e(i,s)}):("u">typeof Promise&&(this.tl=new Promise(e=>{i=e})),this._instance._send_request({url:this._instance.requestRouter.endpointFor("api","/api/surveys/?token="+this.qt.token),method:"GET",timeout:this.qt.surveys_request_timeout_ms,callback:t=>{this.tl=null;var s=t.statusCode;if(200!==s||!t.json){var r="Surveys API could not be loaded, status: "+s;nS.error(r);var n={isLoaded:!1,error:r};return e([],n),void(null==i||i({surveys:[],context:n}))}var o,a,l=t.json.surveys||[],u=l.filter(e=>{var t,i;return!(!e.start_date||e.end_date)&&(!(null==(t=e.conditions)||null==(t=t.events)||null==(t=t.values)||!t.length)||!(null==(i=e.conditions)||null==(i=i.actions)||null==(i=i.values)||!i.length))});u.length>0&&(null==(a=this._surveyEventReceiver)||a.register(u)),null==(o=this._instance.persistence)||o.register({[id]:l,[ip]:Date.now()});var h={isLoaded:!0};e(l,h),null==i||i({surveys:l,context:h})}}))}nl(e){for(var t of this.el)try{if(!e.isLoaded)return t([],e);this.getSurveys(t)}catch(e){nS.error("Error in survey callback",e)}}getActiveMatchingSurveys(e,t){if(void 0===t&&(t=!1),!Z(this._surveyManager))return this._surveyManager.getActiveMatchingSurveys(e,t);nS.warn("init was not called")}sl(e){var t=null;return this.getSurveys(i=>{var s;t=null!=(s=i.find(t=>t.id===e))?s:null}),t}ol(e){if(Z(this._surveyManager))return{eligible:!1,reason:ol};var t="string"==typeof e?this.sl(e):e;return t?this._surveyManager.checkSurveyEligibility(t):{eligible:!1,reason:"Survey not found"}}canRenderSurvey(e){if(Z(this._surveyManager))return nS.warn("init was not called"),{visible:!1,disabledReason:ol};var t=this.ol(e);return{visible:t.eligible,disabledReason:t.reason}}canRenderSurveyAsync(e,t){return Z(this._surveyManager)?(nS.warn("init was not called"),Promise.resolve({visible:!1,disabledReason:ol})):new Promise(i=>{this.getSurveys(t=>{var s,r=null!=(s=t.find(t=>t.id===e))?s:null;if(r){var n=this.ol(r);i({visible:n.eligible,disabledReason:n.reason})}else i({visible:!1,disabledReason:"Survey not found"})},t)})}renderSurvey(e,t,i){var s;if(Z(this._surveyManager))nS.warn("init was not called");else{var r="string"==typeof e?this.sl(e):e;if(null!=r&&r.id)if(nF.includes(r.type)){var n=null==a?void 0:a.querySelector(t);if(n)return null!=(s=r.appearance)&&s.surveyPopupDelaySeconds?(nS.info("Rendering survey "+r.id+" with delay of "+r.appearance.surveyPopupDelaySeconds+" seconds"),void setTimeout(()=>{var e,t;nS.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),nS.info("Survey "+r.id+" rendered")},1e3*r.appearance.surveyPopupDelaySeconds)):void this._surveyManager.renderSurvey(r,n,i);nS.warn("Survey element not found")}else nS.warn("Surveys of type "+r.type+" cannot be rendered in the app");else nS.warn("Survey not found")}}displaySurvey(e,t){var i;if(Z(this._surveyManager))nS.warn("init was not called");else{var s=this.sl(e);if(s){var r=s;if(null!=(i=s.appearance)&&i.surveyPopupDelaySeconds&&t.ignoreDelay&&(r=y({},s,{appearance:y({},s.appearance,{surveyPopupDelaySeconds:0})}
1)),t.displayType!==rw&&t.initialResponses&&nS.warn("initialResponses is only supported for popover surveys. prefill will not be applied."),!1===t.ignoreConditions){var n=this.canRenderSurvey(s);if(!n.visible)return void nS.warn("Survey is not eligible to be displayed: ",n.disabledReason)}"inline"!==t.displayType?this._surveyManager.handlePopoverSurvey(r,t):this.renderSurvey(r,t.selector,t.properties)}else nS.warn("Survey not found")}}cancelPendingSurvey(e){Z(this._surveyManager)?nS.warn("init was not called"):this._surveyManager.cancelSurvey(e)}handlePageUnload(){var e;null==(e=this._surveyManager)||e.handlePageUnload()}}},ok),oF=y({experiments:ox},ok),o$=y({},ok,{sessionRecording:class{get qt(){return this._instance.config}get Ji(){return this._instance.persistence}get started(){var e;return!(null==(e=this.So)||!e.isStarted)}get status(){var e,t;return this.Co===n3||this.Co===n5?this.Co:null!=(e=null==(t=this.So)?void 0:t.status)?e:this.Co}constructor(e){if(this._forceAllowLocalhostNetworkCapture=!1,this.Co=n1,this.Io=void 0,this._instance=e,!this._instance.sessionManager)throw n6.error("started without valid sessionManager"),Error(n8+" started without valid sessionManager. This is a bug.");if(this.qt.cookieless_mode===iA)throw Error(n8+' cannot be used with cookieless_mode="always"')}initialize(){this.startIfEnabledOrStop()}get To(){var e,t=!(null==(e=this._instance.get_property(t3))||!e.enabled),i=!this.qt.disable_session_recording,s=this.qt.disable_session_recording||this._instance.consent.isOptedOut();return r&&t&&i&&!s}startIfEnabledOrStop(e){var t;if(!this.To||null==(t=this.So)||!t.isStarted){var i=!J(Object.assign)&&!J(Array.from);this.To&&i?(this.Eo(e),n6.info("starting")):(this.Co=n1,this.stopRecording())}}Eo(e){var t,i,s;this.To&&(this.Co!==n3&&this.Co!==n5&&(this.Co=n2),null!=v&&null!=(t=v.__PosthogExtensions__)&&null!=(t=t.rrweb)&&t.record&&null!=(i=v.__PosthogExtensions__)&&i.initSessionRecording?this.Mo(e):null==(s=v.__PosthogExtensions__)||null==s.loadExternalDependency||s.loadExternalDependency(this._instance,this.Po,t=>{if(t)return n6.error("could not load recorder",t);this.Mo(e)}))}stopRecording(){var e,t;null==(e=this.Io)||e.call(this),this.Io=void 0,null==(t=this.So)||t.stop()}Ro(){var e,t;null==(e=this.Io)||e.call(this),this.Io=void 0,null==(t=this.So)||t.discard()}Oo(){var e,t;null==(e=this.Ji)||e.unregister(ie),null==(t=this.Ji)||t.unregister(t5)}Lo(e,t){if(Z(e))return null;var i=Q(e)?e:parseFloat(e);return"number"!=typeof i||!Number.isFinite(i)||0>i||i>1?(n6.warn(t+" must be between 0 and 1. Ignoring invalid value:",e),null):i}Ao(e){if(this.Ji){var t,i,s=this.Ji,r=()=>{var t,i=!1===e.sessionRecording?void 0:e.sessionRecording,r=this.Lo(null==(t=this.qt.session_recording)?void 0:t.sampleRate,"session_recording.sampleRate"),n=this.Lo(null==i?void 0:i.sampleRate,"remote config sampleRate"),o=null!=r?r:n;Z(o)&&this.Oo();var a=null==i?void 0:i.minimumDurationMilliseconds;s.register({[t3]: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:J(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.Io)||t.call(this),this.Io=null==(i=this._instance.sessionManager)?void 0:i.onSessionId(r)}}onRemoteConfig(e){return"sessionRecording"in e?!1===e.sessionRecording?(this.Ao(e),void this.Ro()):(this.Ao(e),void this.startIfEnabledOrStop()):(this.Co===n3&&(this.Co=n5,n6.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.So)&&i.log?this.So.log(e,t):n6.warn("log called before recorder was ready")}get Po(){var e,t,i=null==(e=this._instance)||null==(e=e.persistence)?void 0:e.get_property(t3);return(null==i||null==(t=i.scriptConfig)?void 0:t.script)||"lazy-recorder"}Fo(){var e,t,i=this._instance.get_property(t3);
1if(!i)return!1;try{t="object"==typeof i?i:JSON.parse(i)}catch(e){return n6.warn("persisted remote config for session recording is invalid and will be ignored",e),!1}var s=null!=(e=t.cache_timestamp)?e:Date.now();return 36e5>=Date.now()-s}Mo(e){var t,i;if(null==(t=v.__PosthogExtensions__)||!t.initSessionRecording)return n6.warn("Called on script loaded before session recording is available. This can be caused by adblockers."),void this._instance.register_for_session({[iM]:!0});if(this.So||(this.So=null==(i=v.__PosthogExtensions__)?void 0:i.initSessionRecording(this._instance),this.So._forceAllowLocalhostNetworkCapture=this._forceAllowLocalhostNetworkCapture),!this.Fo()){if(this.Co===n5||this.Co===n3)return;return this.Co=n3,n6.info("persisted remote config is stale, requesting fresh config before starting"),void new rP(this._instance).load()}this.Co=n2,this.So.start(e)}onRRwebEmit(e){var t;null==(t=this.So)||null==t.onRRwebEmit||t.onRRwebEmit(e)}overrideLinkedFlag(){var e,t;this.So||null==(t=this.Ji)||t.register({[t6]:!0}),null==(e=this.So)||e.overrideLinkedFlag()}overrideSampling(){var e,t;this.So||null==(t=this.Ji)||t.register({[t8]:!0}),null==(e=this.So)||e.overrideSampling()}overrideTrigger(e){var t,i;this.So||null==(i=this.Ji)||i.register({["url"===e?t4:t7]:!0}),null==(t=this.So)||t.overrideTrigger(e)}get sdkDebugProperties(){var e;return(null==(e=this.So)?void 0:e.sdkDebugProperties)||{$recording_status:this.status}}tryAddCustomEvent(e,t){var i;return!(null==(i=this.So)||!i.tryAddCustomEvent(e,t))}}},{autocapture:class{constructor(e){this.No=!1,this.Do=null,this.$o=!1,this.instance=e,this.rageclicks=new nW(e.config.rageclick),this.qo=null}initialize(){this.startIfEnabled()}get qt(){var e,t,i=G(this.instance.config.autocapture)?this.instance.config.autocapture:{};return i.url_allowlist=null==(e=i.url_allowlist)?void 0:e.map(e=>new RegExp(e)),i.url_ignorelist=null==(t=i.url_ignorelist)?void 0:t.map(e=>new RegExp(e)),i}jo(){if(this.isBrowserSupported()){if(r&&a){var e=e=>{e=e||(null==r?void 0:r.event);try{this.Bo(e)}catch(e){nK.error("Failed to capture event",e)}};if(iX(a,"submit",e,{capture:!0}),iX(a,"change",e,{capture:!0}),iX(a,"click",e,{capture:!0}),this.qt.capture_copied_text){var t=e=>{e=e||(null==r?void 0:r.event);try{this.Bo(e,nY)}catch(e){nK.error("Failed to capture copy/cut event",e)}};iX(a,"copy",t,{capture:!0}),iX(a,"cut",t,{capture:!0})}}}else nK.info("Disabling Automatic Event Collection because this browser is not supported")}startIfEnabled(){this.isEnabled&&!this.No&&(this.jo(),this.No=!0)}onRemoteConfig(e){e.elementsChainAsString&&(this.$o=e.elementsChainAsString),this.instance.persistence&&this.instance.persistence.register({[tW]:!!e.autocapture_opt_out}),this.Do=!!e.autocapture_opt_out,this.startIfEnabled()}setElementSelectors(e){this.qo=e}getElementSelectors(e){var t,i=[];return null==(t=this.qo)||t.forEach(t=>{var s=null==a?void 0:a.querySelectorAll(t);null==s||s.forEach(s=>{e===s&&i.push(t)})}),i}get isEnabled(){var e,t,i=null==(e=this.instance.persistence)?void 0:e.props[tW];if(K(this.Do)&&!ee(i)&&!this.instance.Ci())return!1;var s=null!=(t=this.Do)?t:!!i;return!!this.instance.config.autocapture&&!s}Bo(e,t){if(void 0===t&&(t="$autocapture"),this.isEnabled){var i,s=sw(e);sg(s)&&(s=s.parentNode||null),"$autocapture"===t&&"click"===e.type&&e instanceof MouseEvent&&this.instance.config.rageclick&&null!=(i=this.rageclicks)&&i.isRageClick(e.clientX,e.clientY,e.timeStamp||(new Date).getTime())&&sM(s,this.instance.config.rageclick)&&this.Bo(e,"$rageclick");var n=t===nY;if(s&&function(e,t,i,s,n){if(void 0===i&&(i=void 0),!r||sO(e)||null!=(o=i)&&o.url_allowlist&&!sm(i.url_allowlist)||null!=(a=i)&&a.url_ignorelist&&sm(i.url_ignorelist))return!1;if(null!=(l=i)&&l.dom_event_allowlist){var o,a,l,u,h,c,d=i.dom_event_allowlist;if(d&&!d.some(e=>t.type===e))return!1}var{parentIsUsefulElement:p,targetElementList:v}=sT(e,s);if(!function(e,t){var i=null==t?void 0:t.element_allowlist;if(J(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}(v,i)||!sk(v,null==(u=i)?void 0:u.css_selector_allowlist)||sk(v,null!=(h=null==(c=i)?void 0:c.css_selector_ignorelist)?h:sP))return!1;var g=r.getComputedStyle(e);
1if(g&&"pointer"===g.getPropertyValue("cursor")&&"click"===t.type)return!0;var _=e.tagName.toLowerCase();switch(_){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 p?(n||["click"]).indexOf(t.type)>=0:(n||["click"]).indexOf(t.type)>=0&&(sE.indexOf(_)>-1||"true"===e.getAttribute("contenteditable"))}}(s,e,this.qt,n,n?["copy","cut"]:void 0)){var{props:o,explicitNoCapture:a}=function(e,t){var i,s,{e:n,maskAllElementAttributes:o,maskAllText:a,elementAttributeIgnoreList:l,elementsChainAsString:u}=t;if(!sp(e))return{props:{}};for(var h=[e],c=e;c.parentNode&&!sv(c,"body");)if(s_(c.parentNode))h.push(c.parentNode.host),c=c.parentNode.host;else{if(!sp(c.parentNode))break;h.push(c.parentNode),c=c.parentNode}var d,p=[],v={},g=!1,_=!1;if(iV(h,e=>{var t=sA(e);if(sv(e,"a")){var i=e.getAttribute("href");g=t&&!!i&&sB(i)&&i}q(sy(e),"ph-no-capture")&&(_=!0),p.push(function(e,t,i,s){var r=e.tagName.toLowerCase(),n={tag_name:r};sE.indexOf(r)>-1&&!i&&(n.$el_text="a"===r.toLowerCase()||"button"===r.toLowerCase()?nZ(1024,sU(e)):nZ(1024,sx(e)));var o=sy(e);o.length>0&&(n.classes=o.filter(function(e){return""!==e})),iV(e.attributes,function(i){var r;if((!sL(e)||-1!==["name","id","class","aria-label"].indexOf(i.name))&&(null==s||!s.includes(i.name))&&!t&&sB(i.value)&&(!W(r=i.name)||"_ngcontent"!==r.substring(0,10)&&"_nghost"!==r.substring(0,7))){var o=i.value;"class"===i.name&&(o=sf(o).join(" ")),n["attr__"+i.name]=nZ(1024,o)}});for(var a=1,l=1,u=e;u=function(e){if(e.previousElementSibling)return e.previousElementSibling;var t=e;do t=t.previousSibling;while(t&&!sp(t));return t}(u);)a++,u.tagName===e.tagName&&l++;return n.nth_child=a,n.nth_of_type=l,n}(e,o,a,l)),iJ(v,function(e){if(!sA(e))return{};var t={};return iV(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&&sB(s)&&(t[i]=s)}}),t}(e))}),_)return{props:{},explicitNoCapture:_};if(a||(p[0].$el_text=sv(e,"a")||sv(e,"button")?sU(e):sx(e)),g){p[0].attr__href=g;var f,m,b=null==(f=s8(g))?void 0:f.host,x=null==r||null==(m=r.location)?void 0:m.host;b&&x&&b!==x&&(d=g)}return{props:iJ({$event_type:n.type,$ce_version:1},u?{}:{$elements:p},{$elements_chain:p.map(e=>{var t,i,s,r={text:null==(i=e.$el_text)?void 0:i.slice(0,400),tag_name:e.tag_name,href:null==(s=e.attr__href)?void 0:s.slice(0,2048),attr_class:(t=e.attr__class)?B(t)?t:sf(t):void 0,attr_id:e.attr__id,nth_child:e.nth_child,nth_of_type:e.nth_of_type,attributes:{}};return iW(e).filter(e=>{var[t]=e;return 0===t.indexOf("attr__")}).forEach(e=>{var[t,i]=e;return r.attributes[t]=i}),r}).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)?t:0,"nth-of-type":null!=(i=e.nth_of_type)?i:0},e.href?{href:e.href}:{},e.attr_id?{attr_id:e.attr_id}:{},e.attributes),o={};return iW(n).sort((e,t)=>{var[i]=e,[s]=t;return i.localeCompare(s)}).forEach(e=>{var[t,i]=e;return o[sG(t.toString())]=sG(i.toString())}),(s+=":")+iW(o).map(e=>{var[t,i]=e;return t+'="'+i+'"'}).join("")}).join(";")},null!=(i=p[0])&&i.$el_text?{$el_text:null==(s=p[0])?void 0:s.$el_text}:{},d&&"click"===n.type?{$external_click_url:d}:{},v)}}(s,{e:e,maskAllElementAttributes:this.instance.config.mask_all_element_attributes,maskAllText:this.instance.config.mask_all_text,elementAttributeIgnoreList:this.qt.element_attribute_ignorelist,elementsChainAsString:this.$o});if(a)return!1;var l=this.getElementSelectors(s);if(l&&l.length>0&&(o.$element_selectors=l),t===nY){var u,h=sb(null==r||null==(u=r.getSelection())?void 0:u.toString()),c=e.type||"clipboard";if(!h)return!1;o.$selected_content=h,o.$copy_type=c}return this.instance.capture(t,o),!0}}}isBrowserSupported(){return U(null==a?void 0:a.querySelectorAll)}},historyAutocapture:class{constructor(e){var t;this._instance=e,this.Ho=(null==r||null==(t=r.location)?void 0:t.pathname)||""}initialize(){this.startIfEnabled()}get isEnabled(){return"history_change"===this._instance.config.capture_pageview}startIfEnabled(){this.isEnabled&&(tj.info("History API monitoring enabled, starting..."),this.monitorHistoryChanges())}stop(){this.Uo&&this.Uo(),this.Uo=void 0,tj.info("History API monitoring stopped")}monitorHistoryChanges(){r&&r.history&&(this.zo("pushState"),this.zo("replaceState"),this.Vo())}zo(e){var t;if(r&&(null==(t=r.history[e])||!t.__posthog_wrapped__)){var i=this;!function(e,t,i){try{if(!(t in e))return()=>{};var s=e[t],r=i(s);U(r)&&(r.prototype=r.prototype||{},Object.defineProperties(r,{__posthog_wrapped__:{enumerable:!1,value:!0}})),e[t]=r}catch(e){return()=>{}}}(r.history,e,t=>
1function(s,r,n){t.call(this,s,r,n),i.Wo(e)})}}Wo(e){try{var t,i=null==r||null==(t=r.location)?void 0:t.pathname;if(!i)return;i!==this.Ho&&this.isEnabled&&this._instance.capture(iz,{navigation_type:e}),this.Ho=i}catch(t){tj.error("Error capturing "+e+" pageview",t)}}Vo(){if(!this.Uo){var e=()=>{this.Wo("popstate")};iX(r,"popstate",e),this.Uo=()=>{r&&r.removeEventListener("popstate",e)}}}},heatmaps:class{get qt(){return this.instance.config}constructor(e){var t;this.Go=!1,this.No=!1,this.Zo=null,this.instance=e,this.Go=!(null==(t=this.instance.persistence)||!t.props[tY]),this.rageclicks=new nW(e.config.rageclick)}initialize(){this.startIfEnabled()}get flushIntervalMilliseconds(){var e=5e3;return G(this.qt.capture_heatmaps)&&this.qt.capture_heatmaps.flush_interval_milliseconds&&(e=this.qt.capture_heatmaps.flush_interval_milliseconds),e}get isEnabled(){return Z(this.qt.capture_heatmaps)?Z(this.qt.enable_heatmaps)?this.Go:this.qt.enable_heatmaps:!1!==this.qt.capture_heatmaps}startIfEnabled(){if(this.isEnabled)this.No||(n4.info("starting..."),this.Qo(),this.At());else{var e;clearInterval(null!=(e=this.Zo)?e:void 0),this.Jo(),this.getAndClearBuffer()}}onRemoteConfig(e){if("heatmaps"in e){var t=!!e.heatmaps;this.instance.persistence&&this.instance.persistence.register({[tY]:t}),this.Go=t,this.startIfEnabled()}}getAndClearBuffer(){var e=this.M;return this.M=void 0,e}Ko(e){this.Mt(e.originalEvent,"deadclick")}At(){this.Zo&&clearInterval(this.Zo),this.Zo="visible"===(null==a?void 0:a.visibilityState)?setInterval(this.qi.bind(this),this.flushIntervalMilliseconds):null}Qo(){r&&a&&(this.Yo=this.qi.bind(this),iX(r,ij,this.Yo),this.Xo=e=>this.Mt(e||(null==r?void 0:r.event)),iX(a,"click",this.Xo,{capture:!0}),this.ea=e=>this.ta(e||(null==r?void 0:r.event)),iX(a,"mousemove",this.ea,{capture:!0}),this.ra=new sY(this.instance,sJ,this.Ko.bind(this)),this.ra.startIfEnabledOrStop(),this.ia=this.At.bind(this),iX(a,iN,this.ia),this.No=!0)}Jo(){var e;r&&a&&(this.Yo&&r.removeEventListener(ij,this.Yo),this.Xo&&a.removeEventListener("click",this.Xo,{capture:!0}),this.ea&&a.removeEventListener("mousemove",this.ea,{capture:!0}),this.ia&&a.removeEventListener(iN,this.ia),clearTimeout(this.na),null==(e=this.ra)||e.stop(),this.No=!1)}sa(e,t){var i=this.instance.scrollManager.scrollY(),s=this.instance.scrollManager.scrollX(),n=this.instance.scrollManager.scrollElement(),o=function(e,t,i){for(var s=e;s&&sp(s)&&!sv(s,"body")&&s!==i;){if(q(t,null==r?void 0:r.getComputedStyle(s).position))return!0;s=sS(s)}return!1}(sw(e),["fixed","sticky"],n);return{x:e.clientX+(o?0:s),y:e.clientY+(o?0:i),target_fixed:o,type:t}}Mt(e,t){var i;if(void 0===t&&(t="click"),!sd(e.target)&&n7(e)){var s=this.sa(e,t);null!=(i=this.rageclicks)&&i.isRageClick(e.clientX,e.clientY,(new Date).getTime())&&sM(sw(e),this.instance.config.rageclick)&&this.oa(y({},s,{type:"rageclick"})),this.oa(s)}}ta(e){!sd(e.target)&&n7(e)&&(clearTimeout(this.na),this.na=setTimeout(()=>{this.oa(this.sa(e,"mousemove"))},500))}oa(e){if(r){var t=r.location.href,i=this.qt.custom_personal_data_properties,s=s4(t,this.qt.mask_personal_data_properties?[...re,...i||[]]:[],ri);this.M=this.M||{},this.M[s]||(this.M[s]=[]),this.M[s].push(e)}}qi(){this.M&&!V(this.M)&&this.instance.capture("$$heatmap",{$heatmap_data:this.getAndClearBuffer()})}},deadClicksAutocapture:sY,webVitalsAutocapture:class{constructor(e){var t;this.Go=!1,this.No=!1,this.M={url:void 0,metrics:[],firstMetricTimestamp:void 0},this.aa=()=>{clearTimeout(this.la),0!==this.M.metrics.length&&(this._instance.capture("$web_vitals",this.M.metrics.reduce((e,t)=>y({},e,{["$web_vitals_"+t.name+"_event"]:y({},t),["$web_vitals_"+t.name+"_value"]:t.value}),{})),this.M={url:void 0,metrics:[],firstMetricTimestamp:void 0})},this.ht=e=>{this.M=this.M||{url:void 0,metrics:[],firstMetricTimestamp:void 0};var t,i=this.ua();if(!J(i))if(Z(null==e?void 0:e.name)||Z(null==e?void 0:e.value))n0.error("Invalid metric received",e);else if(!this.ha||this.ha>e.value){this.M.url!==i&&(this.aa(),this.la=setTimeout(this.aa,this.flushToCaptureTimeoutMs)),J(this.M.url)&&(this.M.url=i),this.M.firstMetricTimestamp=J(this.M.firstMetricTimestamp)?Date.now():this.M.firstMetricTimestamp,e.attribution&&e.attribution.interactionTargetElement&&(e.attribution.interactionTargetElement=void 0);var s=null==(t=this._instance.sessionManager)?void 0:t.checkAndGetSessionAndWindowId(!0),r=y({},e,{$current_url:i,timestamp:Date.now()});J(s)||(r.$session_id=s.sessionId,r.$window_id=s.windowId),this.M.metrics.push(r),this.M.metrics.length===this.allowedMetrics.length&&this.aa()}else n0.error("Ignoring metric with value >= "+this.ha,e)},this.ca=()=>
1{if(!this.No){var e,t,i,s,r=v.__PosthogExtensions__;J(r)||J(r.postHogWebVitalsCallbacks)||({onLCP:e,onCLS:t,onFCP:i,onINP:s}=r.postHogWebVitalsCallbacks),e&&t&&i&&s?(this.allowedMetrics.indexOf("LCP")>-1&&e(this.ht.bind(this)),this.allowedMetrics.indexOf("CLS")>-1&&t(this.ht.bind(this)),this.allowedMetrics.indexOf("FCP")>-1&&i(this.ht.bind(this)),this.allowedMetrics.indexOf("INP")>-1&&s(this.ht.bind(this)),this.No=!0):n0.error("web vitals callbacks not loaded - not starting")}},this._instance=e,this.Go=!(null==(t=this._instance.persistence)||!t.props[tX]),this.startIfEnabled()}get da(){return this._instance.config.capture_performance}get allowedMetrics(){var e,t,i=G(this.da)?null==(e=this.da)?void 0:e.web_vitals_allowed_metrics:void 0;return Z(i)?(null==(t=this._instance.persistence)?void 0:t.props[t2])||["CLS","FCP","INP","LCP"]:i}get flushToCaptureTimeoutMs(){return(G(this.da)?this.da.web_vitals_delayed_flush_ms:void 0)||5e3}get useAttribution(){var e=G(this.da)?this.da.web_vitals_attribution:void 0;return null!=e&&e}
1get ha(){var e=G(this.da)&&Q(this.da.__web_vitals_max_value)?this.da.__web_vitals_max_value:9e5;return e>0&&6e4>=e?9e5:e}get isEnabled(){var e=null==l?void 0:l.protocol;if("http:"!==e&&"https:"!==e)return n0.info("Web Vitals are disabled on non-http/https protocols"),!1;var t=G(this.da)?this.da.web_vitals:ee(this.da)?this.da:void 0;return ee(t)?t:this.Go}startIfEnabled(){this.isEnabled&&!this.No&&(n0.info("enabled, starting..."),this.$r(this.ca))}onRemoteConfig(e){if("capturePerformance"in e){var t=G(e.capturePerformance)&&!!e.capturePerformance.web_vitals,i=G(e.capturePerformance)?e.capturePerformance.web_vitals_allowed_metrics:void 0;this._instance.persistence&&(this._instance.persistence.register({[tX]:t}),this._instance.persistence.register({[t2]:i})),this.Go=t,this.startIfEnabled()}}$r(e){var t,i;null!=(t=v.__PosthogExtensions__)&&t.postHogWebVitalsCallbacks?e():null==(i=v.__PosthogExtensions__)||null==i.loadExternalDependency||i.loadExternalDependency(this._instance,this.useAttribution?"web-vitals-with-attribution":"web-vitals",t=>{t?n0.error("failed to load script",t):e()})}ua(){var e=r?r.location.href:void 0;if(e){var t=this._instance.config.custom_personal_data_properties;return s4(e,this._instance.config.mask_personal_data_properties?[...re,...t||[]]:[],ri)}n0.error("Could not determine current URL")}}},{exceptionObserver:class{constructor(e){var t,i,s;this.ca=()=>{var e;if(r&&this.isEnabled&&null!=(e=v.__PosthogExtensions__)&&e.errorWrappingFunctions){var t=v.__PosthogExtensions__.errorWrappingFunctions.wrapOnError,i=v.__PosthogExtensions__.errorWrappingFunctions.wrapUnhandledRejection,s=v.__PosthogExtensions__.errorWrappingFunctions.wrapConsoleError;try{!this.va&&this.qt.capture_unhandled_errors&&(this.va=t(this.captureException.bind(this))),!this.fa&&this.qt.capture_unhandled_rejections&&(this.fa=i(this.captureException.bind(this))),!this.pa&&this.qt.capture_console_errors&&(this.pa=s(this.captureException.bind(this)))}catch(e){nQ.error("failed to start",e),this.ga()}}},this._instance=e,this.ma=!(null==(t=this._instance.persistence)||!t.props[tK]),this.ya=new eu({refillRate:null!=(i=this._instance.config.error_tracking.__exceptionRateLimiterRefillRate)?i:1,bucketSize:null!=(s=this._instance.config.error_tracking.__exceptionRateLimiterBucketSize)?s:10,refillInterval:1e4,Zt:nQ}),this.qt=this.ba(),this.startIfEnabledOrStop()}ba(){var e=this._instance.config.capture_exceptions,t={capture_unhandled_errors:!1,capture_unhandled_rejections:!1,capture_console_errors:!1};return G(e)?t=y({},t,e):(J(e)?this.ma:e)&&(t=y({},t,{capture_unhandled_errors:!0,capture_unhandled_rejections:!0})),t}get isEnabled(){return this.qt.capture_console_errors||this.qt.capture_unhandled_errors||this.qt.capture_unhandled_rejections}startIfEnabledOrStop(){this.isEnabled?(nQ.info("enabled"),this.ga(),this.$r(this.ca)):this.ga()}$r(e){var t,i;null!=(t=v.__PosthogExtensions__)&&t.errorWrappingFunctions?e():null==(i=v.__PosthogExtensions__)||null==i.loadExternalDependency||i.loadExternalDependency(this._instance,"exception-autocapture",t=>{if(t)return nQ.error("failed to load script",t);e()})}ga(){var e,t,i;null==(e=this.va)||e.call(this),this.va=void 0,null==(t=this.fa)||t.call(this),this.fa=void 0,null==(i=this.pa)||i.call(this),this.pa=void 0}onRemoteConfig(e){"autocaptureExceptions"in e&&(this.ma=!!e.autocaptureExceptions,this._instance.persistence&&this._instance.persistence.register({[tK]:this.ma}),this.qt=this.ba(),this.startIfEnabledOrStop())}onConfigChange(){this.qt=this.ba()}captureException(e){var t,i,s,r=null!=(t=null==e||null==(i=e.$exception_list)||null==(i=i[0])?void 0:i.type)?t:"Exception";this.ya.consumeRateLimit(r)?nQ.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._a=[],this.wa=new tc([new tw,new tM,new tk,new tE,new tC,new tI,new tP,new tR],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=tx.test(a)?a.replace(tx,"$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}}}if(!r.length)return[];var c=Array.from(r);return c.reverse(),c.slice(0,50).map(e=>y({},e,{filename:e.filename||(c[c.length-1]||{}).filename,function:e.function||"?"}))}}("web:javascript",tf,tb)),this._instance=e,this._a=null!=(t=null==(i=this._instance.persistence)?void 0:i.get_property(tZ))?t:[],this.xa=tq(this.ka()),this.Sa=new tD(this.xa)}onConfigChange(){this.xa=tq(this.ka()),this.Sa.setConfig(this.xa)}onRemoteConfig(e){var t,i,s;if("errorTracking"in e){var r=null!=(t=null==(i=e.errorTracking)?void 0:i.suppressionRules)?t:[],n=null==(s=e.errorTracking)?void 0:s.captureExtensionExceptions;this._a=r,this._instance.persistence&&this._instance.persistence.register({[tZ]:this._a,[tQ]:n})}}get Ca(){var e,t=!!this._instance.get_property(tQ),i=this._instance.config.error_tracking.captureExtensionExceptions;return null!=(e=null!=i?i:t)&&e}buildProperties(e,t){return this.wa.buildFromUnknown(e,{syntheticException:null==t?void 0:t.syntheticException,mechanism:{handled:null==t?void 0:t.handled}})}addExceptionStep(e,t){if(this.xa.enabled)try{if(!W(e)||0===e.trim().length)return void om.warn("Ignoring exception step because message must be a non-empty string");var i=this.Ia(t),{sanitizedProperties:s,droppedKeys:r}=function(e){if(!e)return{sanitizedProperties:{},droppedKeys:[]};var t=[];return{sanitizedProperties:Object.keys(e).reduce((i,s)=>(tA.has(s)?t.push(s):i[s]=e[s],i),{}),droppedKeys:t}}(i);r.length>0&&om.warn("Ignoring reserved exception step fields",{droppedKeys:r}),this.Sa.add(y({[tO]:e,[tT]:(new Date).toISOString()}
1,s))}catch(e){om.error("Failed to add exception step. Ignoring breadcrumb.",e)}}sendExceptionEvent(e){try{var t=e.$exception_list;if(this.Ta(t)){if(this.Ea(t))return this.Ma("Exception dropped: matched a suppression rule"),void om.info("Skipping exception capture because a suppression rule matched");if(!this.Ca&&this.Pa(t))return this.Ma("Exception dropped: thrown by a browser extension"),void om.info("Skipping exception capture because it was thrown by an extension");if(!this._instance.config.error_tracking.__capturePostHogExceptions&&this.Ra(t))return this.Ma("Exception dropped: thrown by the PostHog SDK"),void om.info("Skipping exception capture because it was thrown by the PostHog SDK")}var i=this.xa.enabled&&Z(e.$exception_steps)?this.Oa(e):e;try{var s=this._instance.capture("$exception",i,{_noTruncate:!0,_batchKey:"exceptionEvent",ts:!0});return s&&this.Sa.clear(),s}catch(e){return om.error("Failed to capture exception event. Dropping this exception.",e),void this.Sa.clear()}}catch(e){return void om.error("Failed to process exception event. Ignoring this exception.",e)}}Oa(e){try{var t=this.Sa.getAttachable();return 0===t.length?e:y({},e,{$exception_steps:t})}catch(t){return om.error("Failed to read buffered exception steps. Capturing exception without steps.",t),e}}Ma(e){this.xa.enabled&&this.Sa.add({[tO]:e,[tT]:(new Date).toISOString()})}Ia(e){return G(e)?y({},e):{}}ka(){var e,t;return null!=(e=null==(t=this._instance.config.error_tracking)?void 0:t.exception_steps)?e:{}}Ea(e){if(0===e.length)return!1;var t=e.reduce((e,t)=>{var{type:i,value:s}=t;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._a.some(e=>{var i=e.values.map(e=>{var i,s=nm[e.operator],r=B(e.value)?e.value:[e.value],n=null!=(i=t[e.key])?i:[];return r.length>0&&s(r,n)});return"OR"===e.type?i.some(Boolean):i.every(Boolean)})}Pa(e){return e.flatMap(e=>{var t,i;return null!=(t=null==(i=e.stacktrace)?void 0:i.frames)?t:[]}).some(e=>e.filename&&e.filename.startsWith("chrome-extension://"))}Ra(e){if(e.length>0){var t,i,s,r,n=null!=(t=null==(i=e[0].stacktrace)?void 0:i.frames)?t:[],o=n[n.length-1];return null!=(s=null==o||null==(r=o.filename)?void 0:r.includes("posthog.com/static"))&&s}return!1}Ta(e){return!Z(e)&&B(e)}}},oS,{siteApps:class{constructor(e){this.Na=0,this._instance=e,this.Da=[],this.apps={}}get isEnabled(){return!!this._instance.config.opt_in_site_apps}$a(e,t){if(t){var i=this.globalsForEvent(t);this.Da.push(i),this.Da.length>1e3&&(this.Da=this.Da.slice(10))}}get siteAppLoaders(){var e;return null==(e=v._POSTHOG_REMOTE_CONFIG)||null==(e=e[this._instance.config.token])?void 0:e.siteApps}initialize(){if(this.isEnabled){var e=this._instance._addCaptureHook(this.$a.bind(this));this.qa=()=>{e(),this.Da=[],this.qa=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,c]of Object.entries(this._instance.get_property("$stored_group_properties")||{}))l[h]={id:u[h],type:h,properties:c};var{$set_once:d,$set:p}=e;return{event:y({},b(e,ot),{properties:y({},e.properties,p?{$set:y({},null!=(t=null==(i=e.properties)?void 0:i.$set)?t:{},p)}:{},d?{$set_once:y({},null!=(s=null==(r=e.properties)?void 0:r.$set_once)?s:{},d)}:{}),elements_chain:null!=(n=null==(o=e.properties)?void 0:o.$elements_chain)?n:"",distinct_id:null==(a=e.properties)?void 0:a.distinct_id}),person:{properties:this._instance.get_property("$stored_person_properties")},groups:l}}ja(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)||(oi.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)||(oi.error("prepare_external_dependency_script returned null"),null):e}Ba(){if(!this._instance.config.prepare_external_dependency_stylesheet&&!this._instance.config.prepare_external_dependency_script)return()=>{};var e,t,i,s,r,n,o,l,u=null==a?void 0:a.defaultView,h=null==u||null==(e=u.Node)?void 0:e.prototype;if(!u||!h)return()=>{};if(this.Na++,this.Ha)return this.Ua();var c=[],d=this,p=new WeakSet,v=(e,t,i)=>{if(null!=e&&e[t]){var s=e[t];e[t]=i(s),c.push(()=>{e[t]=s})}},g=e=>{if(p.has(e))return e;var t=d.ja(e);return t&&p.add(t),t},_=e=>e.map(e=>"string"==typeof e?e:g(e)).filter(e=>!K(e));return v(h,"appendChild",e=>function(t){var i=g(t);return i?e.call(this,i):t}),v(h,"insertBefore",e=>function(t,i){var s=g(t);return s?e.call(this,s,i):t}),v(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
1=>{v(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,_(i))}),v(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,_(i))})}),[null==(r=u.Element)?void 0:r.prototype,null==(n=u.CharacterData)?void 0:n.prototype,null==(o=u.DocumentType)?void 0:o.prototype].forEach(e=>{v(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,_(i))}),v(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,_(i))}),v(e,"replaceWith",e=>function(){for(var t=arguments.length,i=Array(t),s=0;t>s;s++)i[s]=arguments[s];var r=_(i);return i.length&&!r.length?void 0:e.apply(this,r)})}),v(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.Ha=()=>{c.forEach(e=>e()),this.Ha=void 0},this.Ua()}Ua(){var e=!1;return()=>{var t;e||(e=!0,this.Na--,0===this.Na&&(null==(t=this.Ha)||t.call(this)))}}za(e,t){void 0===t&&(t=!0);var i=this.Ba();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.Da.length&&(oi.info("Processing "+this.Da.length+" events for site app with id "+e.id),this.Da.forEach(e=>this.za(()=>null==t.processEvent?void 0:t.processEvent(e))),t.processedBuffer=!0),Object.values(this.apps).every(e=>e.processedBuffer||e.errored)&&(null==(i=this.qa)||i.call(this))},s=!1,r=r=>{t.errored=!r,t.loaded=!0,oi.info("Site app with id "+e.id+" "+(r?"loaded":"errored")),s&&i()};try{var{processEvent:n}=this.za(t=>e.init({posthog:this._instance,callback(e){t(),r(e)}}),!1);n&&(t.processEvent=n),s=!0}catch(t){oi.error(os+e.id,t),r(!1)}if(s&&t.loaded)try{i()}catch(i){oi.error("Error while processing buffered events PostHog app with config id "+e.id,i),t.errored=!0}}Va(){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)}Wa(e){var t=this;if(0!==Object.keys(this.apps).length){var i=this.globalsForEvent(e),s=function(s){try{t.za(()=>null==s.processEvent?void 0:s.processEvent(i))}catch(t){oi.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.Va(),void this._instance.on("eventCaptured",e=>this.Wa(e))):void oi.error('PostHog site apps are disabled. Enable the "opt_in_site_apps" config to proceed.');if(null==(i=this.qa)||i.call(this),null!=(s=e.siteApps)&&s.length)if(this.isEnabled){var n=function(e){var t;v["__$$ph_site_app_"+e]=r._instance,null==(t=v.__PosthogExtensions__)||null==t.loadSiteApp||t.loadSiteApp(r._instance,a,t=>{if(t)return oi.error(os+e,t)})};for(var{id:o,url:a}of e.siteApps)n(o)}else oi.error('PostHog site apps are disabled. Enable the "opt_in_site_apps" config to proceed.')}}},oP,{tracingHeaders:class{constructor(e){this.Ga=void 0,this.Za=void 0,this.Qa=void 0,this.ca=()=>{var e,t,i=this.Ja();i?(J(this.Ga)&&(this.Ga=null==(e=v.__PosthogExtensions__)||null==(e=e.tracingHeadersPatchFns)?void 0:e._patchXHR(i,()=>this._instance.get_distinct_id(),this._instance.sessionManager)),J(this.Za)&&(this.Za=null==(t=v.__PosthogExtensions__)||null==(t=t.tracingHeadersPatchFns)?void 0:t._patchFetch(i,()=>this._instance.get_distinct_id(),this._instance.sessionManager))):this.ga()},this._instance=e}initialize(){this.startIfEnabledOrStop()}$r(e){var t,i;null!=(t=v.__PosthogExtensions__)&&t.tracingHeadersPatchFns?e():null==(i=v.__PosthogExtensions__)||null==i.loadExternalDependency||i.loadExternalDependency(this._instance,"tracing-headers",t=>{if(t)return nX.error("failed to load script",t);e()})}Ka(){var e,t;return null!=(e=null!=(t=this._instance.config.tracing_headers)?t:this._instance.config.addTracingHeaders)?e:this._instance.config.__add_tracing_headers}Ja(){var e=this.Ka();return B(e)?(B(this.Qa)?this.Qa.splice(0,this.Qa.length,...e):this.Qa=[...e],e.length>0?this.Qa:void 0):(B(this.Qa)&&this.Qa.splice(0),this.Qa=e||void 0,this.Qa)}ga(){var e,t;null==(e=this.Ga)||e.call(this),null==(t=this.Za)||t.call(this),this.Ga=void 0,this.Za=void 0}startIfEnabledOrStop(){this.Ja()?this.$r(this.ca):this.ga()}}},{toolbar:class{constructor(e){this.instance=e}al(e){v.ph_toolbar_state=e}ll(){var e;return null!=(e=v.ph_toolbar_state)?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),i0(this.instance.config)||!r||!a)return!1;e=null!=e?e:r.location,i=null!=i?i:r.history;try{if(!t){try{r.localStorage.setItem("test","test"),r.localStorage.removeItem("test")}catch(e){return!1}t=null==r?void 0:r.localStorage}var s,n=oh||s7(e.hash,"__posthog")||s7(e.hash,"state"),o=n?iY(()=>JSON.parse(atob(decodeURIComponent(n))))||iY(()=>JSON.parse(decodeURIComponent(n))):null;return o&&"ph_authorize"===o.action?((s=o).source="url",s&&Object.keys(s).length>0&&(o.desiredHash?e.hash=o.desiredHash:i?i.replaceState(i.state,"",e.pathname+e.search):e.hash="")):((s=JSON.parse(t.getItem(oc)||"{}")).source="localstorage",delete s.userIntent),!(!s.token||this.instance.config.token!==s.token||(this.loadToolbar(s),0))}catch(e){return!1}}ul(e){var t=v.ph_load_toolbar||v.ph_load_editor;!Z(t)&&U(t)?t(e,this.instance):od.warn("No toolbar load function found")}loadToolbar(e){var t,i=!(null==a||!a.getElementById(i$));if(!r||i)return!1;var s="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")},s?{instrument:!1}:{});return(r.localStorage.setItem(oc,JSON.stringify(y({},n,{source:void 0}))),2===this.ll())?this.ul(n):0===this.ll()&&(this.al(1),null==(t=v.__PosthogExtensions__)||null==t.loadExternalDependency||t.loadExternalDependency(this.instance,"toolbar",e=>{e?(od.error("[Toolbar] Failed to load",e),this.al(0)):(this.al(2),this.ul(n))}),iX(r,"turbolinks:load",()=>{this.al(0),this.loadToolbar(n)})),!0}hl(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)}}},oF,{conversations:class{constructor(e){this.cl=void 0,this._conversationsManager=null,this.dl=!1,this.vl=null,this._instance=e}initialize(){this.loadIfEnabled()}onRemoteConfig(e){if(!this._instance.config.disable_conversations){var t=e.conversations;Z(t)||(ee(t)?this.cl=t:(this.cl=t.enabled,this.vl=t),this.loadIfEnabled())}}reset(){var e;null==(e=this._conversationsManager)||e.reset(),this._conversationsManager=null,this.cl=void 0,this.vl=null}loadIfEnabled(){if(!(this._conversationsManager||this.dl||this._instance.config.disable_conversations||i0(this._instance.config)||this._instance.config.cookieless_mode&&this._instance.consent.isOptedOut())){var e=null==v?void 0:v.__PosthogExtensions__;if(e&&!J(this.cl)&&this.cl)if(this.vl&&this.vl.token){this.dl=!0;try{var t=e.initConversations;if(t)return this.fl(t),void(this.dl=!1);var i=e.loadExternalDependency;if(!i)return void this.pl(iO);i(this._instance,"conversations",t=>{t||!e.initConversations?this.pl("Could not load conversations script",t):this.fl(e.initConversations),this.dl=!1})}catch(e){this.pl("Error initializing conversations",e),this.dl=!1}}else ow.error("Conversations enabled but missing token in remote config.")}}fl(e){if(this.vl)try{this._conversationsManager=e(this.vl,this._instance),ow.info("Conversations loaded successfully")}catch(e){this.pl("Error completing conversations initialization",e)}else ow.error("Cannot complete initialization: remote config is null")}pl(e,t){ow.error(e,t),this._conversationsManager=null,this.dl=!1}show(){this._conversationsManager?this._conversationsManager.show():ow.warn("Conversations not loaded yet.")}hide(){this._conversationsManager&&this._conversationsManager.hide()}isAvailable(){return!0===this.cl&&!K(this._conversationsManager)}isVisible(){var e,t;return null!=(e=null==(t=this._conversationsManager)?void 0:t.isVisible())&&e}sendMessage(e,t,i){var s=this;return m(function*(){return s._conversationsManager?s._conversationsManager.sendMessage(e,t,i):(ow.warn(oE),null)})()}getMessages(e,t){var i=this;return m(function*(){return i._conversationsManager?i._conversationsManager.getMessages(e,t):(ow.warn(oE),null)})()}markAsRead(e){var t=this;return m(function*(){return t._conversationsManager?t._conversationsManager.markAsRead(e):(ow.warn(oE),null)})()}getTickets(e){var t=this;return m(function*(){return t._conversationsManager?t._conversationsManager.getTickets(e):(ow.warn(oE),null)})()}requestRestoreLink(e){var t=this;return m(function*(){return t._conversationsManager?t._conversationsManager.requestRestoreLink(e):(ow.warn(oE),null)})()}restoreFromToken(e){var t=this;return m(function*(){return t._conversationsManager?t._conversationsManager.restoreFromToken(e):(ow.warn(oE),null)})()}restoreFromUrlToken(){var e=this;return m(function*(){return e._conversationsManager?e._conversationsManager.restoreFromUrlToken():(ow.warn(oE),null)})()}getCurrentTicketId(){var e,t;return null!=(e=null==(t=this._conversationsManager)?void 0:t.getCurrentTicketId())?e:null}getWidgetSessionId(){var e,t;return null!=(e=null==(t=this._conversationsManager)?void 0:t.getWidgetSessionId())?e:null}us(){var e;null==(e=this._conversationsManager)||e.setIdentity()}hs(){var e;null==(e=this._conversationsManager)||e.clearIdentity()}}},{logs:class{constructor(e){var t;this.gl=!1,this.ml=!1,this.Zt=tz("[logs]"),this.Ei=[],this.yl=()=>{var e;null==(e=this.bl)||e.onReconnect()},this._instance=e,this._instance&&null!=(t=this._instance.config.logs)&&t.captureConsoleLogs&&(this.gl=!0),r&&iX(r,"online",this.yl)}_l(){var e,t,i,s,r,n,o,a,l,u,h,c,d,p=null==(e=this._instance)||null==(e=e.config)?void 0:e.logs;return this.bl&&this.wl===p||(null==(t=this.bl)||t.reset(),this.wl=p,this.xl=(l=null!=(i=null==p?void 0:p.flushIntervalMs)?i:3e3,c=Math.max(u=null!=(s=null==p?void 0:p.maxBufferSize)?s:100,h=null!=(r=null==p?void 0:p.maxLogsPerInterval)?r:1e3),{serviceName:null!=(n=null==(d=null==p?void 0:p.resourceAttributes)?void 0:d["service.name"])?n:null==p?void 0:p.serviceName,serviceVersion:null!=(o=null==d?void 0:d["service.version"])?o:null==p?void 0:p.serviceVersion,environment:null!=(a=null==d?void 0:d["deployment.environment"])?a:null==p?void 0:p.environment,resourceAttributes:d,beforeSend:null==p?void 0:p.beforeSend,flushIntervalMs:l,max
1BufferSize:u,maxQueueSize:c,maxBatchRecordsPerPost:100,rateCapWindowMs:l,maxLogsPerInterval:h,backgroundFlushBudgetMs:0,terminationFlushBudgetMs:0}),this.bl=new th(this.kl(),this.xl,this.Zt,()=>this.Sl(),e=>e())),this.bl}Cl(){return this._l(),this.xl}initialize(){this.loadIfEnabled()}onRemoteConfig(e){var t,i=null==(t=e.logs)?void 0:t.captureConsoleLogs;!Z(i)&&i&&(this.gl=!0,this.loadIfEnabled())}reset(){var e;this.Ei=[],null==(e=this.bl)||e.reset()}captureLog(e){this._l().captureLog(e)}get logger(){return this.Il||(this.Il={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.Il}flushLogs(e){e?this.Tl(e):this._l().flush().catch(e=>this.Zt.error("PostHog logs flush failed:",e))}loadIfEnabled(){if(this.gl&&!this.ml){var e=null==v?void 0:v.__PosthogExtensions__;if(e){var t=e.loadExternalDependency;t?t(this._instance,"logs",t=>{var i;t||null==(i=e.logs)||!i.initializeLogs?this.Zt.error("Could not load logs script",t):(e.logs.initializeLogs(this._instance),this.ml=!0)}):this.Zt.error(iO)}else this.Zt.error("PostHog Extensions not found.")}}kl(){var e=this._instance;return{get isDisabled(){return!1},get optedOut(){return!e.is_capturing()},getPersistedProperty:e=>e===S.LogsQueue?this.Ei:void 0,setPersistedProperty:(e,t)=>{e===S.LogsQueue&&(this.Ei=null!=t?t:[])},wr:e=>this.wr(e),getLibraryId:()=>_.LIB_NAME,getLibraryVersion:()=>_.LIB_VERSION}}wr(e){return new Promise(t=>{var i=!1,s=e=>{i||(i=!0,clearTimeout(r),t(e))},r=setTimeout(()=>s({kind:"retry-later",error:Error("logs request timed out")}),9e4);this._instance._send_request({method:"POST",url:this.El(),data:e,compression:"best-available",batchKey:"logs",fireCallbackOnDrop:!0,callback(e){var t,i=e.statusCode;i>=200&&300>i?s({kind:"ok"}):413===i?s({kind:"too-large"}):0!==i&&429!==i&&500>i?s({kind:"fatal",error:Error("logs request failed with status "+i)}):s({kind:"retry-later",error:null!=(t=e.error)?t:Error("logs request failed with status "+i)})}})})}Tl(e){var t=this.Cl();if(0!==this.Ei.length){var i=this.Ei.map(e=>e.record);this.Ei=[];var s=tu(i,tl(t,_.LIB_NAME,_.LIB_VERSION),_.LIB_NAME,_.LIB_VERSION);this._instance._send_request({method:"POST",url:this.El(),data:s,compression:"best-available",batchKey:"logs",transport:e})}}El(){return this._instance.requestRouter.endpointFor("api","/i/v1/logs")+"?token="+encodeURIComponent(this._instance.config.token)}Sl(){var e,t={};if(t.distinctId=this._instance.get_distinct_id(),this._instance.sessionManager){var{sessionId:i}=this._instance.sessionManager.checkAndGetSessionAndWindowId(!0);t.sessionId=i}if(null!=v&&null!=(e=v.location)&&e.href&&(t.currentUrl=v.location.href),this._instance.featureFlags){var s=this._instance.featureFlags.getFlags();s&&s.length>0&&(t.activeFeatureFlags=s)}return t}}});nJ.__defaultExtensionClasses=y({},o$);var oI=(_.SDK_DIST_CHANNEL="npm",s=nT[nz]=new nJ,function(){function e(){e.done||(e.done=!0,nH=!1,iV(nT,function(e){e._dom_loaded()}))}null!=a&&a.addEventListener?"complete"===a.readyState?e():iX(a,"DOMContentLoaded",e,{capture:!1}):r&&tj.error("Browser doesn't support `document.addEventListener` so PostHog couldn't be initialized")}(),s)}}]); 2//# chunkId=01a0ce64-5b2c-7463-85fd-efd535c36722
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.