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