1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[8229],{13402:(e,t,i)=>{i.d(t,{Ay:()=>oc});var s=window,r="undefined"!=typeof globalThis?globalThis:s,n=null==r?void 0:r.navigator,a=null==r?void 0:r.document,o=null==r?void 0:r.location,l=null==r?void 0:r.fetch,u=null!=r&&r.XMLHttpRequest&&"withCredentials"in new r.XMLHttpRequest?r.XMLHttpRequest:void 0,h=null==r?void 0:r.AbortController,c=null==r?void 0:r.CompressionStream,d=null==n?void 0:n.userAgent;function p(){return!(!s||!1===s.navigator.onLine)}var v="undefined"!=typeof globalThis?globalThis:s;v&&"undefined"==typeof self&&(v.self=v),v&&"undefined"==typeof File&&(v.File=function(){});var g=null!=s?s:{},f={DEBUG:!1,LIB_VERSION:"0.5.0",LIB_NAME:"browser-common"};function _(e,t,i,s,r,n,a){try{var o=e[n](a),l=o.value}catch(e){return void i(e)}o.done?t(l):Promise.resolve(l).then(s,r)}function m(e){return function(){var t=this,i=arguments;return new Promise(function(s,r){var n=e.apply(t,i);function a(e){_(n,s,r,a,o,"next",e)}function o(e){_(n,s,r,a,o,"throw",e)}a(void 0)})}}function y(){return(y=Object.assign?Object.assign.bind():function(e){for(var t=1;arguments.length>t;t++){var i=arguments[t];for(var s in i)({}).hasOwnProperty.call(i,s)&&(e[s]=i[s])}return e}).apply(null,arguments)}function b(e,t){if(null==e)return{};var i={};for(var s in e)if(({}).hasOwnProperty.call(e,s)){if(-1!==t.indexOf(s))continue;i[s]=e[s]}return i}var w=e=>{if("string"!=typeof e)return e;try{return JSON.parse(e)}catch(t){return e}};function x(e){return"string"==typeof e||e}function E(e){return"string"==typeof e?e:void 0}var k,S=["$feature_flag","$feature_flag_response","$feature_flag_has_experiment","$feature_flag_id","$feature_flag_version","$feature_flag_reason","$feature_flag_request_id","$feature_flag_evaluated_at","$feature_flag_error","locally_evaluated","$groups","$process_person_profile","$geoip_disable","$current_url","$pathname","$referring_domain","utm_source","utm_medium","utm_campaign","utm_content","utm_term","gad_source","mc_cid","gclid","gclsrc","dclid","gbraid","wbraid","fbclid","msclkid","twclid","li_fat_id","igshid","ttclid","rdt_cid","epik","qclid","sccid","irclid","_kx","$session_id","$window_id","$lib","$lib_version","$device_id","$is_server"],P=function(e){return e.AnonymousId="anonymous_id",e.DistinctId="distinct_id",e.Props="props",e.EnablePersonProcessing="enable_person_processing",e.PersonMode="person_mode",e.FeatureFlagDetails="feature_flag_details",e.FeatureFlags="feature_flags",e.FeatureFlagPayloads="feature_flag_payloads",e.BootstrapFeatureFlagDetails="bootstrap_feature_flag_details",e.BootstrapFeatureFlags="bootstrap_feature_flags",e.BootstrapFeatureFlagPayloads="bootstrap_feature_flag_payloads",e.OverrideFeatureFlags="override_feature_flags",e.Queue="queue",e.AiQueue="ai_queue",e.AiCaptureQueue="ai_capture_queue",e.LogsQueue="logs_queue",e.OptedOut="opted_out",e.SessionId="session_id",e.SessionStartTimestamp="session_start_timestamp",e.SessionLastTimestamp="session_timestamp",e.PersonProperties="person_properties",e.GroupProperties="group_properties",e.InstalledAppBuild="installed_app_build",e.InstalledAppVersion="installed_app_version",e.SessionReplay="session_replay",e.PushRegistered="push_registered",e.SessionReplayEventTriggerActivatedSession="session_replay_event_trigger_activated_session",e.SurveyLastSeenDate="survey_last_seen_date",e.SurveysSeen="surveys_seen",e.Surveys="surveys",e.RemoteConfig="remote_config",e.FlagsEndpointWasHit="flags_endpoint_was_hit",e.DeviceId="device_id",e}({}),F=function(e){return e.GZipJS="gzip-js",e.Base64="base64",e}({}),I=["$snapshot","$pageview","$pageleave","$set","survey dismissed","survey sent","survey shown","$identify","$groupidentify","$create_alias","$$client_ingestion_warning","$web_experiment_applied","$feature_enrollment_update","$feature_flag_called"],$=["token"],R="NativeGzipValidationError",M=e=>e.length>=2&&31===e[0]&&139===e[1],C=(e,t)=>e===F.GZipJS||t===F.GZipJS||"gzip"===t,T=e=>!(!e||"object"!=typeof e)&&"NotReadableError"===("name"in e?String(e.name):""),O=e=>
1{var t=Error("Native gzip produced invalid output: "+e);throw t.name=R,t},A=function(){var e=m(function*(e,t){18>e.size&&O("too-short");var i=new Uint8Array((yield e.slice(0,10).arrayBuffer()));M(i)&&8===i[2]||O("invalid-header");var s=new DataView((yield e.slice(e.size-8).arrayBuffer()));s.getUint32(0,!0)!==(e=>{for(var t=(()=>{if(k)return k;k=[];for(var e=0;256>e;e++){for(var t=e,i=0;8>i;i++)t=1&t?0xedb88320^t>>>1:t>>>1;k[e]=t>>>0}return k})(),i=0xffffffff,s=0;e.length>s;s++)i=t[255&(i^e[s])]^i>>>8;return(0xffffffff^i)>>>0})(t)&&O("invalid-crc");var r=t.length>>>0;s.getUint32(4,!0)!==r&&O("invalid-size")});return function(t,i){return e.apply(this,arguments)}}();function N(){return(N=m(function*(e,t,i){void 0===t&&(t=!0);try{var s,r=new TextEncoder().encode(e),n=new globalThis.CompressionStream("gzip"),a=n.writable.getWriter(),o=a.write(r).then(()=>a.close()).catch((s=m(function*(e){try{yield a.abort(e)}catch(e){}throw e}),function(e){return s.apply(this,arguments)})),l=new Response(n.readable).blob(),u=(yield Promise.all([l,o]))[0];return yield A(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 L=["amazonbot","amazonproductbot","app.hypefactors.com","applebot","archive.org_bot","awariobot","backlinksextendedbot","baiduspider","bingbot","bingpreview","chrome-lighthouse","dataforseobot","deepscan","duckduckbot","facebookexternal","facebookcatalog","http://yandex.com/bots","hubspot","ia_archiver","leikibot","linkedinbot","meta-externalagent","mj12bot","msnbot","nessus","petalbot","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"],D=function(e,t){if(void 0===t&&(t=[]),!e)return!1;var i=e.toLowerCase();return L.concat(t).some(e=>{var t=e.toLowerCase();return -1!==i.indexOf(t)})};function q(e,t){return -1!==e.indexOf(t)}var j=function(e){return e.trim()},H=function(e){return e.replace(/^\$/,"")};function B(e){var t,i=[];return null!==(t=JSON.stringify(e,function(e,t){if("bigint"==typeof t)return t.toString();if("function"!=typeof t&&"symbol"!=typeof t){if(t instanceof Error)return{name:t.name,message:t.message,stack:t.stack};if(t&&"object"==typeof t){for(;i.length>0&&i[i.length-1]!==this;)i.pop();if(i.includes(t))return"[Circular]";i.push(t)}return t}}))&&void 0!==t?t:"null"}var z=Object.prototype,U=z.hasOwnProperty,V=z.toString,G=Array.isArray||function(e){return"[object Array]"===V.call(e)},W=e=>"function"==typeof e,K=e=>e===Object(e)&&!G(e),J=e=>{if(K(e)){for(var t in e)if(U.call(e,t))return!1;return!0}return!1},Y=e=>void 0===e,Q=e=>"[object String]"==V.call(e),X=e=>Q(e)&&0===e.trim().length,Z=e=>null===e,ee=e=>Y(e)||Z(e),et=e=>"[object Number]"==V.call(e)&&e==e,ei=e=>et(e)&&e>0,es=e=>"[object Boolean]"===V.call(e),er=e=>e instanceof FormData,en=e=>q(I,e),ea=e=>q($,e);function eo(e){return null===e||"object"!=typeof e}function el(e,t){return({}).toString.call(e)==="[object "+t+"]"}function eu(e){return"undefined"!=typeof Event&&eh(e,Event)}function eh(e,t){try{return e instanceof t}catch(e){return!1}}var ec=[!0,"true",1,"1","yes"],ed=e=>q(ec,e),ep=[!1,"false",0,"0","no"];function ev(e,t,i,s,r){return t>i&&(s.warn("min cannot be greater than max."),t=i),et(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),ev(r||i,t,i,s))}class eg{constructor(e){this.tt={},this.et=e.et,this.it=ev(e.bucketSize,0,100,e.rt),this.nt=ev(e.refillRate,0,this.it,e.rt),this.st=ev(e.refillInterval,0,864e5,e.rt)}ot(e,t){var i=Math.floor((t-e.lastAccess)/this.st);i>0&&(e.tokens=Math.min(e.tokens+i*this.nt,this.it),e.lastAccess=e.lastAccess+i*this.st)}consumeRateLimit(e){var t,i=Date.now(),s=String(e),r=this.tt[s];return r?this.ot(r,i):this.tt[s]=r={tokens:this.it,lastAccess:i},0===r.tokens||(r.tokens--,0===r.tokens&&(null==(t=this.et)||t.call(this,e)),0===r.tokens)}stop(){this.tt={}}}var ef="Mobile",e_="Android",em="Tablet",ey=e_+" "+em,eb="iPad",ew="Apple",ex=ew+" Watch",eE="Safari",ek="BlackBerry",eS="Samsung",eP=eS+"Browser",eF=eS+" Internet",eI="Chrome",e$=eI+" OS",eR=eI+" iOS",eM="Internet Explorer",eC=eM+" "+ef,eT="Opera",eO=eT+" Mini",eA="Edge",eN="Microsoft "+eA,eL="Firefox",eD=eL+" iOS",eq="Nintendo",ej="PlayStation",eH="Xbox",eB=e_+" "+ef,ez=ef+" "+eE,eU="Windows",eV=eU+" Phone",eG="Nokia",eW="Ouya",eK="Generic",eJ=eK+" "+ef.toLowerCase(),eY=eK+" "+em.toLowerCase(),eQ="Konqueror",eX="Oculus Browser",eZ="Vivaldi",e0="Yandex",e1="Whale",e2="DuckDuckGo",e3="Pale Moon",e5="Waterfox",e6="Brave",e4="Google Search App",e8="(\\d+(\\.\\d+)?)",e9=RegExp("Version/"+e8),e7=RegExp(eH,"i"),te=RegExp(ej+" \\w+","i"),tt=RegExp(eq+" \\w+","i"),ti=RegExp(ek+"|PlayBook|BB10","i"),ts={"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"},tr=function(e,t,i,s){var r;return t=t||"",(null!=i&&i.brave?e6:null)||(null!=s&&s.detectGoogleSearchApp&&q(e,"GSA/")?e4:q(e," OPR/")&&q(e,"Mini")?eO:q(e," OPR/")?eT:ti.test(e)?ek:q(e,"IE"+ef)||q(e,"WPDesktop")?eC:q(e,"OculusBrowser")?eX:q(e,eP)?eF:q(e,eA)||q(e,"Edg/")?eN:q(e,eZ+"/")?eZ:q(e,"YaBrowser/")?e0:q(e,e1+"/")?e1:q(e,e2+"/")||q(e,"Ddg/")?e2:q(e,"FBIOS")?"Facebook "+ef:q(e,"UCWEB")||q(e,"UCBrowser")?"UC Browser":q(e,"CriOS")?eR:q(e,"CrMo")||q(e,eI)?eI:q(e,e_)&&q(e,eE)?eB:q(e,"FxiOS")?eD:q(e.toLowerCase(),eQ.toLowerCase())?eQ:q(e,e6+"/")?e6:(r=t)&&q(r,ew)||q(e,eE)&&!q(e,eI)&&!q(e,e_)?q(e,ef)?ez:eE:q(e,"PaleMoon/")?e3:q(e,e5+"/")?e5:q(e,eL)?eL:q(e,"MSIE")||q(e,"Trident/")?eM:q(e,"Gecko")?eL:"")},tn={[eC]:[RegExp("rv:"+e8)],[eN]:[RegExp(eA+"?\\/"+e8)],[eI]:[RegExp("("+eI+"|CrMo)\\/"+e8)],[eR]:[RegExp("CriOS\\/"+e8)],"UC Browser":[RegExp("(UCBrowser|UCWEB)\\/"+e8)],[eE]:[e9],[ez]:[e9],[eT]:[RegExp("(Opera|OPR)\\/"+e8)],[eL]:[RegExp(eL+"\\/"+e8)],[eD]:[RegExp("FxiOS\\/"+e8)],[eQ]:[RegExp("Konqueror[:/]?"+e8,"i")],[ek]:[RegExp(ek+" "+e8),e9],[eB]:[RegExp("android\\s"+e8,"i")],[eF]:[RegExp(eP+"\\/"+e8)],[eX]:[RegExp("OculusBrowser\\/"+e8)],[eZ]:[RegExp(eZ+"\\/"+e8)],[e0]:[RegExp("YaBrowser\\/"+e8)],[e1]:[RegExp(e1+"\\/"+e8)],[e6]:[RegExp(e6+"\\/"+e8)],[e2]:[RegExp("(DuckDuckGo|Ddg)\\/"+e8)],[e3]:[RegExp("PaleMoon\\/"+e8)],[e5]:[RegExp(e5+"\\/"+e8)],[e4]:[RegExp("GSA\\/"+e8)],[eM]:[RegExp("(rv:|MSIE )"+e8)],Mozilla:[RegExp("rv:"+e8)]},ta=function(e,t,i,s){var r=tn[tr(e,t,i,s)];if(Y(r))return null;for(var n=0;r.length>n;n++){var a=e.match(r[n]);if(a)return parseFloat(a[a.length-2])}return null},to=[[RegExp(eH+"; "+eH+" (.*?)[);]","i"),e=>[eH,e&&e[1]||""]],[RegExp(eq,"i"),[eq,""]],[RegExp(ej,"i"),[ej,""]],[ti,[ek,""]],[RegExp(eU,"i"),(e,t)=>{if(/Phone/.test(t)||/WPDesktop/.test(t))return[eV,""];if(new RegExp(ef).test(t)&&!/IEMobile\b/.test(t))return[eU+" "+ef,""];var i=/Windows NT ([0-9.]+)/i.exec(t);if(i&&i[1]){var s=ts[i[1]]||"";return/arm/i.test(t)&&(s="RT"),[eU,s]}return[eU,""]}],[/((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=Y(e[2])?e[3]:e[2]),["watchOS",t]}],[RegExp("("+e_+" (\\d+)\\.(\\d+)\\.?(\\d+)?|"+e_+")","i"),e=>e&&e[2]?[e_,[e[2],e[3],e[4]||"0"].join(".")]:[e_,""]],[/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/,[e$,""]],[/Linux|debian/i,["Linux",""]]],tl=function(e){return tt.test(e)?eq:te.test(e)?ej:e7.test(e)?eH:RegExp(eW,"i").test(e)?eW:RegExp("("+eV+"|WPDesktop)","i").test(e)?eV:/iPad/.test(e)?eb:/iPod/.test(e)?"iPod Touch":/iPhone/.test(e)?"iPhone":/(watch)(?: ?os[,/]|\d,\d\/)[\d.]+/i.test(e)?ex:ti.test(e)?ek:/(kobo)\s(ereader|touch)/i.test(e)?"Kobo":RegExp(eG,"i").test(e)?eG:/(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(ef).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)?e_:ey:RegExp("(pda|"+ef+")","i").test(e)?eJ:RegExp(em,"i").test(e)&&!RegExp(em+" pc","i").test(e)?eY:""},tu=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;function th(e,t){return"string"==typeof e&&tu.test(e)?e:t()}function tc(e){return e?e.split("#")[0]:e}function td(e,t){var i=setTimeout(e,t);return(null==i?void 0:i.unref)&&(null==i||i.unref()),i}function tp(e,t,i){return tv.apply(this,arguments)}function tv(){return(tv=m(function*(e,t,i){var s;try{return yield Promise.race([e,new Promise((e,r)=>{s=td(()=>{try{null==i||i(),e()}catch(e){r(e)}},t)})])}finally{clearTimeout(s)}})).apply(this,arguments)}var tg=e=>e instanceof Error,tf={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}},t_=tf.info;function tm(e){var t=[];for(var i in e){var s=e[i];Z(s)||Y(s)||t.push({key:i,value:function e(t){if(es(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(G(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 ty(e,t,i){return y({},e.resourceAttributes,{"service.name":e.serviceName||"unknown_service"},e.environment&&{"deployment.environment":e.environment},e.serviceVersion&&{"service.version":e.serviceVersion},{"telemetry.sdk.name":t,"telemetry.sdk.version":i})}function tb(e,t,i,s){return{resourceLogs:[{resource:{attributes:tm(t)},scopeLogs:[{scope:{name:i,version:s},logRecords:e}]}]}}let tw=class{constructor(e,t,i,s,r,n,a){var o;void 0===n&&(n=()=>Promise.resolve()),this._instance=e,this.Ne=t,this.rt=i,this.ut=s,this.ht=r,this.dt=n,this.vt=a,this.ct=null,this.ft=0,this.yt=0,this.bt=0,this._t=0,this.wt=!1,this.kt=t.maxBufferSize,this.xt=Math.max(null!==(o=t.maxQueueSize)&&void 0!==o?o:t.maxBufferSize,t.maxBufferSize),this.St=t.flushIntervalMs,this.Ct=t.maxBatchRecordsPerPost,this.Mt=t.rateCapWindowMs,this.Tt=t.maxLogsPerInterval}reset(){this.Et(),this.ct=null,this.bt=0,this._t=0,this.wt=!1,this.ft=0,this.yt=0,this.Ct=this.Ne.maxBatchRecordsPerPost}onReconnect(){this.yt=0,this.It()}captureLog(e){if(!this._instance.isDisabled&&!this._instance.optedOut&&null!=e&&e.body){var t=this.Pt(e);if(null!==t){if(t.body){if(this.Rt()){var i,s,r,n,a,o,l,u,h={record:(i=this.ut(),r=(s=tf[t.level||"info"]||t_).text,n=s.number,a=String(Date.now())+"000000",o={},i.distinctId&&(o.posthogDistinctId=i.distinctId),i.sessionId&&(o.sessionId=i.sessionId),i.windowId&&(o["window.id"]=i.windowId),ee(i.sessionStartTimestamp)||(o.sessionStartTimestamp=String(i.sessionStartTimestamp)),ee(i.lastActivityTimestamp)||(o.lastActivityTimestamp=String(i.lastActivityTimestamp)),i.currentUrl&&(o["url.full"]=i.currentUrl),i.screenName&&(o["screen.name"]=i.screenName),i.appState&&(o["app.state"]=i.appState),i.activeFeatureFlags&&i.activeFeatureFlags.length>0&&(o.feature_flags=i.activeFeatureFlags),l=y({},o,t.attributes||{}),u={timeUnixNano:a,observedTimeUnixNano:a,severityNumber:n,severityText:r,body:{stringValue:t.body},attributes:tm(l)},t.trace_id&&(u.traceId=t.trace_id),t.span_id&&(u.spanId=t.span_id),Y(t.trace_flags)||(u.flags=t.trace_flags),u)};this.ht(()=>this.At(h))}}else this.rt.info("Log was rejected in beforeSend function")}}}Pt(e){var t=this.Ne.beforeSend;if(!t)return e;var i=G(t)?t:[t],s=e;for(var r of i)try{var n=r(s);if(!n)return this.rt.info("Log was rejected in beforeSend function"),null;s=n}catch(e){return this.rt.error("Error in beforeSend function for log:",e),null}return s}Rt(){if(void 0===this.Tt)return!0;var e=Date.now(),t=e-this.bt;return this.Mt>t&&t>=0||(this.bt=e,this._t=0,this.wt=!1),this.Tt>this._t?(this._t++,!0):(this.wt||(this.rt.warn("captureLog dropping logs: exceeded "+this.Tt+" logs per "+this.Mt+"ms"),this.wt=!0),!1)}flush(){var e=this;return m(function*(){if(!e._instance.isDisabled)return e.ct||(e.ct=e.Ft().finally(()=>{e.ct=null})),e.ct})()}Ft(){var e=this;return m(function*(){e.Et();var t=null!==(r=e._instance.getPersistedProperty(P.LogsQueue))&&void 0!==r?r:[];if(0!==t.length)for(var i=t.length,s=0;t.length>0&&i>s;){e.ft=0;var r,n,a,o=Math.min(t.length,e.Ct),l=t.slice(0,o),u=tb(l.map(e=>e.record),e.Lt(),null!==(n=e.vt)&&void 0!==n?n:e._instance.getLibraryId(),e._instance.getLibraryVersion()),h=yield e._instance.Ot(u);
1if("too-large"===h.kind&&l.length>1)e.Ct=Math.max(1,Math.floor(l.length/2)),e.rt.warn("Received 413 when sending logs batch of size "+l.length+", reducing batch size to "+e.Ct);else if("retry-later"===h.kind||("too-large"===h.kind?e.rt.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.Ne.maxBatchRecordsPerPost>e.Ct&&(e.Ct=Math.min(e.Ne.maxBatchRecordsPerPost,e.Ct+1)),yield e.Dt(l.length),t=null!==(a=e._instance.getPersistedProperty(P.LogsQueue))&&void 0!==a?a:[],s+=l.length,"fatal"===h.kind))throw h.error}})()}Dt(e){var t=this;return m(function*(){var i,s=Math.max(0,e-t.ft),r=null!==(i=t._instance.getPersistedProperty(P.LogsQueue))&&void 0!==i?i:[];t._instance.setPersistedProperty(P.LogsQueue,r.slice(s)),yield t.dt()})()}Lt(){return ty(this.Ne,this._instance.getLibraryId(),this._instance.getLibraryVersion())}At(e){var t;if(!this._instance.optedOut){var i=null!==(t=this._instance.getPersistedProperty(P.LogsQueue))&&void 0!==t?t:[];this.xt>i.length||(i.shift(),this.ft++,this.rt.info("Logs queue is full, dropping oldest record.")),i.push(e),this._instance.setPersistedProperty(P.LogsQueue,i),this.kt>i.length?this.$t():this.It()}}$t(e){void 0===e&&(e=this.St),this.Nt||(this.Nt=td(()=>{this.Nt=void 0,this.It()},e))}qt(){var e=Math.min(Math.max(0,this.yt-1),6);return this.St*Math.pow(2,e)}jt(){var e=this._instance.getPersistedProperty(P.LogsQueue);return!!e&&e.length>0}shutdown(e){var t=this;return m(function*(){t.Et();var i=t.flush().catch(()=>{});void 0!==e?yield tp(i,e):yield i})()}flushWithTimeout(e){var t=this;return m(function*(){var i=t.flush();yield tp(i,e,()=>{i.catch(()=>{})})})()}It(){this.flush().then(()=>{this.yt=0},e=>{this.yt++,this.rt.error("PostHog logs flush failed:",e)}).finally(()=>{!this._instance.isDisabled&&this.jt()&&this.$t(this.qt())})}Et(){this.Nt&&(clearTimeout(this.Nt),this.Nt=void 0)}};var tx=[0,5,10,25,50,75,100,250,500,750,1e3,2500,5e3,7500,1e4];function tE(e){return String(e)+"000000"}function tk(e,t,i,s){var r="";return s&&(r=Object.keys(s).sort().map(e=>JSON.stringify(e)+":"+JSON.stringify(s[e])).join(",")),e+"\0"+t+"\0"+(null!=i?i:"")+"\0"+r}let tS=class{constructor(e,t,i){this._instance=e,this.Ne=t,this.rt=i,this.Bt=new Map,this.ct=null,this.Ht=!1,this.Ut=new Map,this.zt=new Set,this.Wt=0}count(e,t,i){void 0===t&&(t=1),this.Vt({name:e,type:"count",value:t,unit:null==i?void 0:i.unit,attributes:null==i?void 0:i.attributes})}gauge(e,t,i){this.Vt({name:e,type:"gauge",value:t,unit:null==i?void 0:i.unit,attributes:null==i?void 0:i.attributes})}histogram(e,t,i){this.Vt({name:e,type:"histogram",value:t,unit:null==i?void 0:i.unit,attributes:null==i?void 0:i.attributes})}flush(){var e,t=this,i=this.ct,s=(e=m(function*(){i&&(yield i.catch(()=>{})),yield t.Zt()}),function(){return e.apply(this,arguments)})().finally(()=>{this.ct===s&&(this.ct=null)});return this.ct=s,s}drainWindow(){if(0===this.Bt.size)return null;var e=this.Bt;return this.Bt=new Map,this.Ht=!1,this.Ut=new Map,this.zt=new Set,this.Gt(e)}reset(){this.Wt++,this.Et(),this.Bt=new Map,this.ct=null,this.Ht=!1,this.Ut=new Map,this.zt=new Set}Vt(e){if(!this._instance.isDisabled&&!this._instance.optedOut){var t=this.Pt(e);if(null!==t){if(t.name&&"string"==typeof t.name){if("number"==typeof t.value&&Number.isFinite(t.value)){if("count"===t.type&&0>t.value)this.rt.warn("Dropping count '"+t.name+"': counters are monotonic, value must be >= 0");else{try{i=t.attributes?y({},t.attributes):void 0,s=tk(t.type,t.name,t.unit,i)}catch(e){return void this.rt.warn("Dropping metric '"+t.name+"': attributes could not be serialized",e)}var i,s,r=this.Bt.get(s);if(!r){if(!this.Qt())return;r={name:t.name,type:t.type,unit:t.unit,attributes:i,windowStartMs:Date.now()},this.Bt.set(s,r)}var n=this.Ut.get(t.name);void 0===n?this.Ut.set(t.name,t.type):n===t.type||this.zt.has(t.name)||(this.zt.add(t.name),this.rt.warn("Metric name '"+t.name+"' is already used as a "+n+"; recording it as a "+t.type+" too will blend both series in charts. Use a distinct name.")),this.Kt(r,t.value),this.$t()}}else this.rt.warn("Dropping metric '"+t.name+"': value must be a finite number")}else this.rt.warn("Dropping metric with empty name")}}}Qt(){return this.Ne.maxSeriesPerFlush>this.Bt.size||(this.Ht||(this.Ht=!0,this.rt.warn("Metric series cap reached ("+this.Ne.maxSeriesPerFlush+" per flush window); dropping new series until the next flush. Reduce attribute cardinality.")),!1)}Kt(e,t){var i;switch(e.type){case"count":e.total=(null!==(i=e.total)&&void 0!==i?i:0)+t;break;case"gauge":e.last=t;break;case"histogram":e.hist||(e.hist={count:0,sum:0,min:t,max:t,bucketCounts:Array(tx.length+1).fill(0)});var s=e.hist;s.count+=1,s.sum+=t,s.min=Math.min(s.min,t),s.max=Math.max(s.max,t),s.bucketCounts[function(e,t){for(var i=0;t.length>i;i++)if(t[i]>=e)return i;return t.length}(t,tx)]+=1}}Pt(e){var t=this.Ne.beforeSend;if(!t)return e;var i=G(t)?t:[t],s=e;for(var r of i)try{var n=r(s);if(!n)return this.rt.info("Metric was rejected in beforeSend function"),null;s=n}catch(e){return this.rt.error("Error in beforeSend function for metric:",e),null}return s}$t(){this.Nt||(this.Nt=td(()=>{this.Nt=void 0,this.flush().catch(e=>{this.rt.error("Metrics flush failed:",e)})},this.Ne.flushIntervalMs))}Et(){this.Nt&&(clearTimeout(this.Nt),this.Nt=void 0)}
1Zt(){var e=this;return m(function*(){if(0!==e.Bt.size){var t=e.Bt;e.Bt=new Map,e.Ht=!1,e.Ut=new Map,e.zt=new Set;var i=e.Wt,s=yield e._instance.Jt(e.Gt(t));if(i===e.Wt)switch(s.kind){case"ok":return;case"retry-later":return e.Yt(t),void e.$t();case"too-large":return void e.rt.warn("Metrics batch exceeded the server size limit and was dropped");case"fatal":return void e.rt.error("Failed to send metrics batch:",s.error)}}})()}Gt(e){var t,i,s,r,n,a,o;return t=this.Xt(e),n=this.Ne,a=this._instance.getLibraryId(),o=this._instance.getLibraryVersion(),i=y({},n.resourceAttributes,{"service.name":n.serviceName||"unknown_service"},n.environment&&{"deployment.environment":n.environment},n.serviceVersion&&{"service.version":n.serviceVersion},{"telemetry.sdk.name":a,"telemetry.sdk.version":o}),s=this._instance.getLibraryId(),r=this._instance.getLibraryVersion(),{resourceMetrics:[{resource:{attributes:tm(i)},scopeMetrics:[{scope:{name:s,version:r},metrics:t}]}]}}Xt(e){var t=tE(Date.now()),i=new Map;for(var s of e.values()){var r,n=tk(s.type,s.name,s.unit,void 0),a=i.get(n);a||(a=y({name:s.name},s.unit&&{unit:s.unit}),"count"===s.type?a.sum={aggregationTemporality:1,isMonotonic:!0,dataPoints:[]}:"gauge"===s.type?a.gauge={dataPoints:[]}:a.histogram={aggregationTemporality:1,dataPoints:[]},i.set(n,a));var o=tm(null!==(r=s.attributes)&&void 0!==r?r:{}),l=tE(s.windowStartMs);if("count"===s.type){var u,h={attributes:o,startTimeUnixNano:l,timeUnixNano:t,asDouble:null!==(u=s.total)&&void 0!==u?u:0};a.sum.dataPoints.push(h)}else if("gauge"===s.type){var c,d={attributes:o,timeUnixNano:t,asDouble:null!==(c=s.last)&&void 0!==c?c:0};a.gauge.dataPoints.push(d)}else s.hist&&a.histogram.dataPoints.push({attributes:o,startTimeUnixNano:l,timeUnixNano:t,count:s.hist.count,sum:s.hist.sum,min:s.hist.min,max:s.hist.max,bucketCounts:s.hist.bucketCounts,explicitBounds:tx})}return Array.from(i.values())}Yt(e){var t,i;for(var s of e){var r=s[0],n=s[1],a=this.Bt.get(r);if(a)switch(a.windowStartMs=Math.min(a.windowStartMs,n.windowStartMs),a.type){case"count":a.total=(null!==(t=a.total)&&void 0!==t?t:0)+(null!==(i=n.total)&&void 0!==i?i:0);break;case"gauge":break;case"histogram":if(n.hist){if(a.hist){a.hist.count+=n.hist.count,a.hist.sum+=n.hist.sum,a.hist.min=Math.min(a.hist.min,n.hist.min),a.hist.max=Math.max(a.hist.max,n.hist.max);for(var o=0;a.hist.bucketCounts.length>o;o++)a.hist.bucketCounts[o]+=n.hist.bucketCounts[o]}else a.hist=n.hist}}else this.Qt()&&this.Bt.set(r,n)}}};class tP{constructor(e,t,i){void 0===i&&(i=[]),this.coercers=e,this.stackParser=t,this.modifiers=i}buildFromUnknown(e,t){void 0===t&&(t={});var i=t&&t.mechanism||{handled:!0,type:"generic"},s=this.buildCoercingContext(i,t,0).apply(e),r=this.buildParsingContext(t),n=this.parseStacktrace(s,r);return{$exception_list:this.convertToExceptionList(n,i),$exception_level:"error"}}modifyFrames(e){var t=this;return m(function*(){for(var i of e)i.stacktrace&&i.stacktrace.frames&&G(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.skipFirstLines:0),t.chunkIdMap)),y({},e,{cause:i,stack:s})}applyChunkIds(e,t){return e.map(e=>(e.filename&&t&&(e.chunk_id=t[e.filename]),e))}applyCoercers(e,t){for(var i of this.coercers)if(i.match(e))return i.coerce(e,t);return this.coerceFallback(t)}applyModifiers(e){var t=this;return m(function*(){var i=e;for(var s of t.modifiers)i=yield s(i);return i})()}convertToExceptionList(e,t){var i,s,r,n={type:e.type,value:e.value,mechanism:{type:null!==(i=t.type)&&void 0!==i?i:"generic",handled:null===(s=t.handled)||void 0===s||s,synthetic:null!==(r=e.synthetic)&&void 0!==r&&r}};e.stack&&(n.stacktrace={type:"raw",frames:e.stack});var a=[n];return null!=e.cause&&a.push(...this.convertToExceptionList(e.cause,y({},t,{handled:!0}))),a}buildParsingContext(e){var t;return{chunkIdMap:function(e){var t=globalThis._posthogChunkIds;if(t){var i=Object.keys(t);return sg&&i.length===sv||(sv=i.length,sg=i.reduce((i,s)=>{sp||(sp={});var r=sp[s];if(r)i[r[0]]=r[1];else for(var n=e(s),a=n.length-1;a>=0;a--){var o=n[a],l=null==o?void 0:o.filename,u=t[s];if(l&&u){i[l]=u,sp[s]=[l,u];break}}return i},{})),sg}}(this.stackParser),skipFirstLines:null!==(t=e.skipFirstLines)&&void 0!==t?t:1}}buildCoercingContext(e,t,i){void 0===i&&(i=0);var s=(i,s)=>{if(4>
1=s){var r=this.buildCoercingContext(e,t,s);return this.applyCoercers(i,r)}};return y({},t,{syntheticException:0==i?t.syntheticException:void 0,mechanism:e,apply:e=>s(e,i),next:e=>s(e,i+1)})}}function tF(e,t,i,s,r){var n={platform:e,filename:t,function:"<anonymous>"===i?"?":i,in_app:!0};return Y(s)||(n.lineno=s),Y(r)||(n.colno=r),n}var tI=(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]},t$=/^\s*at (\S+?)(?::(\d+))(?::(\d+))\s*$/i,tR=/^\s*at (?:(.+?\)(?: \[.+\])?|.*?) ?\((?:address at )?)?(?:async )?((?:<anonymous>|[-a-z]+:|.*bundle|\/)?.*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i,tM=/\((\S*)(?::(\d+))(?::(\d+))\)/,tC=(e,t)=>{var i=t$.exec(e);if(i)return tF(t,i[1],"?",+i[2],+i[3]);var s=tR.exec(e);if(s){if(s[2]&&0===s[2].indexOf("eval")){var r=tM.exec(s[2]);r&&(s[2]=r[1],s[3]=r[2],s[4]=r[3])}var n=tI(s[1]||"?",s[2]);return tF(t,n[1],n[0],s[3]?+s[3]:void 0,s[4]?+s[4]:void 0)}},tT=/^\s*(.*?)(?:\((.*?)\))?(?:^|@)?((?:[-a-z]+)?:\/.*?|\[native code\]|[^@]*(?:bundle|\d+\.js)|\/[\w\-. /=]+)(?::(\d+))?(?::(\d+))?\s*$/i,tO=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i,tA=(e,t)=>{var i=tT.exec(e);if(i){if(i[3]&&i[3].indexOf(" > eval")>-1){var s=tO.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]||"?",a=tI(n,r);return tF(t,r=a[1],n=a[0],i[4]?+i[4]:void 0,i[5]?+i[5]:void 0)}},tN=/\(error: (.*)\)/;class tL{match(e){return this.isDOMException(e)||this.isDOMError(e)}coerce(e,t){var i=Q(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 el(e,"DOMException")}isDOMError(e){return el(e,"DOMError")}}class tD{match(e){return function(e){switch(({}).toString.call(e)){case"[object Error]":case"[object Exception]":case"[object DOMException]":case"[object DOMError]":case"[object WebAssembly.Exception]":return!0;default:return eh(e,Error)}}(e)}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 tq{constructor(){}match(e){return!!el(e,"ErrorEvent")&&(null!=e.error||this.fe(e))}coerce(e,t){if(null!=e.error)return t.apply(e.error);var i,s=t.apply(e.message);return y({},s,{stack:null!==(i=this.pe(e))&&void 0!==i?i:s.stack,synthetic:!0})}fe(e){return Q(e.message)&&e.message.length>0}pe(e){if(Q(e.filename)&&e.filename.length>0){var t,i,s=null!==(t=e.lineno)&&void 0!==t?t:0,r=null!==(i=e.colno)&&void 0!==i?i:0;return"Error\n at "+e.filename+":"+s+":"+r}}}var tj=/^(?:[Uu]ncaught (?:exception: )?)?(?:((?:Eval|Internal|Range|Reference|Syntax|Type|URI|)Error): )?(.*)$/i;class tH{match(e){return"string"==typeof e}coerce(e,t){var i,s=this.getInfos(e),r=s[0],n=s[1];return{type:null!=r?r:"Error",value:null!=n?n:e,stack:null==(i=t.syntheticException)?void 0:i.stack,synthetic:!0}}getInfos(e){var t="Error",i=e,s=e.match(tj);return s&&(t=s[1],i=s[2]),[t,i]}}var tB=["fatal","error","warning","log","info","debug"];function tz(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(", ");if(t>=r.length)return s===i.length?r:r.length>t?r.slice(0,t)+"...":r}return""}class tU{match(e){return"object"==typeof e&&null!==e}coerce(e,t){var i,s,r=this.getErrorPropertyFromObject(e);return r?t.apply(r):{type:this.getType(e),value:this.getValue(e),stack:null!==(i=this.getStack(e))&&void 0!==i?i:null==(s=t.syntheticException)?void 0:s.stack,level:this.isSeverityLevel(e.level)?e.level:"error",synthetic:!0}}getType(e){return eu(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: "+tz(e)}isSeverityLevel(e){return Q(e)&&!X(e)&&tB.indexOf(e)>=0}getStack(e){try{return Q(e.stacktrace)&&e.stacktrace.length>0?e.stacktrace:Q(e.stack)&&e.stack.length>0?e.stack:void 0}catch(e){return}}getErrorPropertyFromObject(e){for(var t in e)if(({}).hasOwnProperty.call(e,t)){var i=e[t];if(tg(i))return i}}getObjectClassName(e){try{var t=Object.getPrototypeOf(e);return t?t.constructor.name:void 0}catch(e){return}}}class tV{match(e){return eu(e)}coerce(e,t){var i,s=e.constructor.name;return{type:s,value:s+" captured as exception with keys: "+tz(e),stack:null==(i=t.syntheticException)?void 0:i.stack,synthetic:!0}}}class tG{match(e){return eo(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 tW{match(e){return el(e,"PromiseRejectionEvent")||this.isCu
1stomEventWrappingRejection(e)}isCustomEventWrappingRejection(e){if(!eu(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 eo(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 tK="$message",tJ="$timestamp",tY=new Set([tK,tJ]),tQ={enabled:!0,max_bytes:32768};function tX(e){var t;return e?{enabled:null!==(t=e.enabled)&&void 0!==t?t:tQ.enabled,max_bytes:function(e,t){if(!et(e)||e===1/0||e===-1/0)return t;var i=Math.floor(e);return 0>i?t:i}(e.max_bytes,tQ.max_bytes)}:y({},tQ)}class tZ{constructor(e){this.Ke=[],this.Je=0,this.Ne=tX(e)}setConfig(e){this.Ne=tX(e),this.Xe()}add(e){var t=function(e){var t;try{t=B(e)}catch(e){return}try{var i=JSON.parse(t);if(!K(i))return;var s=i[tK],r=i[tJ];if(!Q(s)||0===s.trim().length||!Q(r)&&!et(r))return;return{step:i,json:t}}catch(e){return}}(e);if(t){var i=function(e){if("undefined"!=typeof TextEncoder)return new TextEncoder().encode(e).length;for(var t=encodeURIComponent(e),i=0,s=0;t.length>s;s++)"%"===t[s]?(i+=1,s+=2):i+=1;return i}(t.json);i>this.Ne.max_bytes||(this.Ke.push({step:t.step,bytes:i}),this.Je+=i,this.Xe())}}getAttachable(){return this.Ke.map(e=>e.step)}clear(){this.Ke=[],this.Je=0}size(){return this.Ke.length}Xe(){for(;this.Je>this.Ne.max_bytes&&this.Ke.length>0;){var e=this.Ke.shift();e&&(this.Je-=e.bytes)}}}var t0=function(e,t){var i=(void 0===t?{}:t).debugEnabled,r={k(t){if(s&&(f.DEBUG||s.POSTHOG_DEBUG||i)&&!Y(s.console)&&s.console){for(var r=("__rrweb_original__"in s.console[t])?s.console[t].__rrweb_original__:s.console[t],n=arguments.length,a=Array(n>1?n-1:0),o=1;n>o;o++)a[o-1]=arguments[o];r(e,...a)}},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)=>t0(e+" "+t,i)};return r},t1=t0("[PostHog.js]"),t2=t1.createLogger,t3=t2("[ExternalScriptsLoader]"),t5=(e,t,i)=>{if(e.config.disable_external_dependency_loading)return t3.warn(t+" was requested but loading of external scripts is disabled."),i("Loading of external scripts is disabled");var s=null==a?void 0:a.querySelectorAll("script");if(s){for(var r,n=0;s.length>n;n++)if(r=function(){if(s[n].src===t){var e=s[n];return e.__posthog_loading_callback_fired?{v:i()}:(e.addEventListener("load",t=>{e.__posthog_loading_callback_fired=!0,i(void 0,t)}),e.onerror=e=>i(e),{v:void 0})}}())return r.v}var o=()=>{if(!a)return i("document not found");var s=a.createElement("script");if(s.type="text/javascript",s.crossOrigin="anonymous",s.src=t,s.onload=e=>{s.__posthog_loading_callback_fired=!0,i(void 0,e)},s.onerror=e=>i(e),e.config.prepare_external_dependency_script&&(s=e.config.prepare_external_dependency_script(s)),!s)return i("prepare_external_dependency_script returned null");if("head"===e.config.external_scripts_inject_target)a.head.appendChild(s);else{var r,n=a.querySelectorAll("body > script");n.length>0?null==(r=n[0].parentNode)||r.insertBefore(s,n[0]):a.body.appendChild(s)}};null!=a&&a.body?o():null==a||a.addEventListener("DOMContentLoaded",o)};g.__PosthogExtensions__=g.__PosthogExtensions__||{},g.__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)}t5(e,s,i)}else{var n=e.requestRouter.endpointFor("assets","/array/"+e.config.token+"/config.js");t5(e,n,i)}},g.__PosthogExtensions__.loadSiteApp=(e,t,i)=>{var s=e.requestRouter.endpointFor("api",t);t5(e,s,i)},f.DEBUG=!1,f.LIB_VERSION="1.416.1",f.LIB_NAME="web";var t6="$people_distinct_id",t4="$device_id",t8="$device_model",t9="__alias",t7="__timers",ie="$autocapture_disabled_server_side",it="$heatmaps_enabled_server_side",ii="$exception_capture_enabled_server_side",is="$error_tracking_suppression_rules",ir="$error_tracking_capture_extension_exceptions",ia="$web_vitals_enabled_server_side",io="$dead_clicks_enabled_server_side",il="$product_tours_enabled_server_side",iu="$web_vitals_allowed_metrics",ih="$session_recording_remote_config",ic="$replay_sample_rate",id="$replay_override_sampling",ip="$replay_override_linked_flag",iv="$replay_override_url_trigger",ig="$replay_override_event_trigger",i_="$sesid",im="$session_is_sampled",iy="$enabled_feature_flags",ib="$active_feature_flags",iw="$early_access_features",ix="$feature_flag_details",iE="$feature_flag_payloads",ik="$feature_flag_request_id",iS="$minimal_flag_called_events",iP="$override_feature_flags",iF="$override_feature_flag_payloads",iI="$stored_person_properties",i$="$stored_group_properties",iR="$surveys",iM="$surveys_loaded_at",iC="$surveys_activated",iT="$surveys_activated_session",iO="$surveys_activated_timestamps",iA="ph_product_tours",iN="$flag_call_reported",iL="$flag_call_reported_session_id",iD="$feature_flag_errors",iq="$feature_flag_evaluated_at",ij="$user_state",iH="$client_session_props",iB="$capture_rate_limit",iz="$initial_campaign_params",iU="$initial_referrer_info",iV="$initial_person_info",iG="$epp",iW="$posthog_cookieless",iK="$cookieless_mode",iJ="$sdk_debug_extensions_init_method",iY="$sdk_debug_extensions_init_time_ms",iQ="$sdk_debug_recording_script_not_loaded",iX="PostHog loadExternalDependency extension not found.",iZ="on_reject",i0="always",i1="anonymous",i2="identified",i3="identified_only",i5="visibilitychange",i6="beforeunload",i4="$pageview",i8="$pageleave",i9="$identify",i7="$groupidentify";function se(e,t){G(e)&&e.forEach(t)}function st(e,t){if(!ee(e)){if(G(e))e.forEach(t);else if(er(e))e.forEach((e,i)=>t(e,i));else for(var i in e)U.call(e,i)&&t(e[i],i)}}var si=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 ss(e){for(var t=Object.keys(e),i=t.length,s=Array(i);i--;)s[i]=[t[i],e[t[i]]];return s}var sr=function(e){try{return e()}catch(e){return}},sn=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){t1.critical("Implementation error. Please turn on debug mode and open a ticket on https://app.posthog.com/home#panel=support%3Asupport%3A."),t1.critical(e)}}},sa=function(e){var t={};return st(e,function(e,i){(Q(e)&&e.length>0||et(e))&&(t[i]=e)}),t},so=["herokuapp.com","vercel.app","netlify.app"];function sl(e,t,i,s){var r=null!=s?s:{},n=r.capture,a=r.passive;null==e||e.addEventListener(t,i,{capture:void 0!==n&&n,passive:void 0===a||a})}function su(e){return"ph_toolbar_internal"===e.name}var sh=e=>{if(a){try{for(var t=e+"=",i=a.cookie.split(";").filter(e=>e.length),s=0;i.length>s;s++){for(var r=i[s];" "==r.charAt(0);)r=r.substring(1,r.length);if(0===r.indexOf(t))return decodeURIComponent(r.substring(t.length,r.length))}}catch(e){}return null}};Math.trunc||(Math.trunc=function(e){return 0>e?Math.ceil(e):Math.floor(e)}),Number.isInteger||(Number.isInteger=function(e){return et(e)&&isFinite(e)&&Math.floor(e)===e});class sc{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 sc(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 sc(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 sd{generate(){var e=this.generateOrAbort();if(!Y(e))return e;this.S=0;var t=this.generateOrAbort();if(Y(t))throw Error("Could not generate UUID after timestamp reset");return t}generateOrAbort(){var e=Date.now();if(e>this.S)this.S=e,this.C();else{if(this.S>=e+1e4)return;this.I++,this.I>0x3ffffffffff&&(this.S++,this.C())}return sc.fromFieldsV7(this.S,Math.trunc(this.I/0x40000000),0x3fffffff&this.I,this.A.nextUint32())}C(){this.I=1024*this.A.nextUint32()+(1023&this.A.nextUint32())}constructor(){this.S=0,this.I=0,this.A=new sm}}var sp,sv,sg,sf,s_=e=>{if("undefined"!=typeof UUIDV7_DENY_WEAK_RNG&&UUIDV7_DENY_WEAK_RNG)throw Error("no cryptographically strong RNG available");for(var t=0;e.length>t;t++)e[t]=65536*Math.trunc(65536*Math.random())+Math.trunc(65536*Math.random());return e};s&&!Y(s.crypto)&&crypto.getRandomValues&&(s_=e=>crypto.getRandomValues(e));class sm{nextUint32(){return this.R.length>this.O||(s_(this.R),this.O=0),this.R[this.O++]}constructor(){this.R=new Uint32Array(8),this.O=1/0}}var sy=()=>sb().toString(),sb=()=>(sf||(sf=new sd)).generate(),sw="",sx=/[a-z0-9][a-z0-9-]+\.[a-z]{2,}$/i,sE={N:()=>!!a,j(e){t1.error("cookieStore error: "+e)},P:sh,H(e){var t;try{t=JSON.parse(sE.P(e))||{}}catch(e){}return t},F(e,t,i,s,r){if(!a)return!1;try{var n="",o="",l=function(e,t){if(t){var i=function(e,t){if(void 0===t&&(t=a),sw)return sw;if(!t||["localhost","127.0.0.1"].includes(e))return"";for(var i=e.split("."),s=Math.min(i.length,8),r="dmn_chk_"+sy();!sw&&s--;){var n=i.slice(s).join("."),o=r+"=1;domain=."+n+";path=/";t.cookie=o+";max-age=3",t.cookie.includes(r)&&(t.cookie=o+";max-age=0",sw=n)}return sw}(e);if(!i){var s,r=(s=e.match(sx))?s[0]:"";r!==i&&t1.info("Warning: cookie subdomain discovery mismatch",r,i),i=r}return i?"; domain=."+i:""}return""}(a.location.hostname,s);if(i){var u=new Date;u.setTime(u.getTime()+864e5*i),n="; expires="+u.toUTCString()}r&&(o="; secure");var h=e+"="+encodeURIComponent(JSON.stringify(t))+n+"; SameSite=Lax; path=/"+l+o;return h.length>3686.4&&t1.warn("cookieStore warning: large cookie, len="+h.length),a.cookie=h,!0}catch(e){return!1}},q(e,t){if(null!=a&&a.cookie)try{sE.F(e,"",-1,t)}catch(e){return}}},sk=null,sS={N(){if(!Z(sk))return sk;var e=!0;if(Y(s))e=!1;else try{var t="__mplssupport__";sS.F(t,"xyz"),'"xyz"'!==sS.P(t)&&(e=!1),sS.q(t)}catch(t){e=!1}return e||t1.error("localStorage unsupported; falling back to cookie store"),sk=e,e},j(e){t1.error("localStorage error: "+e)},P(e){try{return null==s?void 0:s.localStorage.getItem(e)}catch(e){sS.j(e)}return null},H(e){try{return JSON.parse(sS.P(e))||{}}catch(e){}return null},F(e,t){try{return null==s||s.localStorage.setItem(e,JSON.stringify(t)),!0}catch(e){sS.j(e)}return!1},q(e){try{null==s||s.localStorage.removeItem(e)}catch(e){sS.j(e)}}},sP=[t4,"distinct_id",i_,im,iG,iV,ij],sF={},sI={N:()=>!0,j(e){t1.error("memoryStorage error: "+e)},P:e=>sF[e]||null,H:e=>sF[e]||null,F:(e,t)=>(sF[e]=t,!0),q(e){delete sF[e]}},s$=null,sR={N(){if(!Z(s$))return s$;if(s$=!0,Y(s))s$=!1;else try{var e="__support__";sR.F(e,"xyz"),'"xyz"'!==sR.P(e)&&(s$=!1),sR.q(e)}catch(e){s$=!1}return s$},j(e){t1.error("sessionStorage error: ",e)},P(e){try{return null==s?void 0:s.sessionStorage.getItem(e)}catch(e){sR.j(e)}return null},H(e){try{return JSON.parse(sR.P(e))||null}catch(e){}return null},F(e,t){try{return null==s||s.sessionStorage.setItem(e,JSON.stringify(t)),!0}catch(e){sR.j(e)}return!1},q(e){try{null==s||s.sessionStorage.removeItem(e)}catch(e){sR.j(e)}}};class sM{constructor(e){this._instance=e}get Ne(){return this._instance.config}get consent(){return this.ti()?0:this.ei}isOptedOut(){return this.Ne.cookieless_mode===i0||this.isRejected()||-1===this.consent&&this.Ne.cookieless_mode===iZ}isOptedIn(){return!this.isOptedOut()}isExplicitlyOptedOut(){return 0===this.consent}isRejected(){return 0===this.consent||-1===this.consent&&this.Ne.opt_out_capturing_by_default}optInOut(e){this.ii.F(this.ri,e?1:0,this.Ne.cookie_expiration,this.Ne.cross_subdomain_cookie,this.Ne.secure_cookie)}reset(){this.ii.q(this.ri,this.Ne.cross_subdomain_cookie)}get ri(){var e=this._instance.config,t=e.token,i=e.opt_out_capturing_cookie_prefix;
1return e.consent_persistence_name||(i?i+t:"__ph_opt_in_out_"+t)}get ei(){var e=this.ii.P(this.ri);return ed(e)?1:q(ep,e)?0:-1}get ii(){var e=this.Ne.opt_out_capturing_persistence_type,t="localStorage"===e?sS:sE;if(!this.ni||this.ni!==t){this.ni=t;var i="localStorage"===e?sE:sS;i.P(this.ri)&&(this.ni.P(this.ri)||this.optInOut(ed(i.P(this.ri))),i.q(this.ri,this.Ne.cross_subdomain_cookie))}return this.ni}ti(){return!!this.Ne.respect_dnt&&[null==n?void 0:n.doNotTrack,null==n?void 0:n.msDoNotTrack,g.doNotTrack].some(e=>ed(e))}}function sC(e,t){var i,s=null==e||null==(i=e.config)?void 0:i.get_current_url;if(!W(s))return t;try{var r=s(t);return Q(r)&&r?r:t}catch(e){return t1.error("Error in get_current_url, falling back to window.location.href",e),t}}var sT="__POSTHOG_TOOLBAR__";function sO(e){return e instanceof Element&&(e.id===sT||!(null==e.closest||!e.closest(".toolbar-global-fade-container")))}function sA(e){return!!e&&1===e.nodeType}function sN(e,t){return!!e&&!!e.tagName&&e.tagName.toLowerCase()===t.toLowerCase()}function sL(e){return!!e&&3===e.nodeType}function sD(e){return!!e&&11===e.nodeType&&sA(e.host)}function sq(e){return e?j(e).split(/\s+/):[]}function sj(e,t){var i,r,n=Y(r=null==s||null==(i=s.location)?void 0:i.href)?void 0:sC(t,r);return!!(n&&e&&e.some(e=>n.match(e)))}function sH(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 sq(t)}function sB(e){return ee(e)?null:j(e).split(/(\s+)/).filter(e=>rt(e)).join("").replace(/[\r\n]/g," ").replace(/[ ]+/g," ").substring(0,255)}function sz(e){var t="";return s3(e)&&!s5(e)&&e.childNodes&&e.childNodes.length&&st(e.childNodes,function(e){var i;sL(e)&&e.textContent&&(t+=null!==(i=sB(e.textContent))&&void 0!==i?i:"")}),j(t)}function sU(e){var t;return Y(e.target)?e.srcElement||null:null!=(t=e.target)&&t.shadowRoot?e.composedPath()[0]||null:e.target||null}var sV=["a","button","form","input","select","textarea","label"];function sG(e,t){if(Y(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 sW(e){var t=e.parentNode;return!(!t||!sA(t))&&t}var sK=[".ph-no-autocapture","[data-ph-no-autocapture]"],sJ=["next","previous","prev",">","<"],sY=[...sJ,"+","-","â","â"],sQ=(e,t)=>/[a-z0-9]/i.test(t)?e.includes(t):e===t,sX=[".ph-no-rageclick",".ph-no-capture"],sZ=["","text","search","email","password","url","tel","number"];function s0(e,t){if(!s||s1(e)||(es(t)?(r=!!t&&sX,n=void 0,a=!1):(r=null!==(o=null==t?void 0:t.css_selector_ignorelist)&&void 0!==o?o:sX,n=null==t?void 0:t.content_ignorelist,a=null!==(l=null==t?void 0:t.ignore_text_selection)&&void 0!==l&&l),!1===r)||a&&!(!(i=e)||!sA(i))&&(sN(i,"textarea")||(sN(i,"input")?q(sZ,(i.getAttribute("type")||"").toLowerCase()):function(e){if(e.isContentEditable)return!0;var t=null==e.getAttribute?void 0:e.getAttribute("contenteditable");return"true"===t||""===t}(i))))return!1;var i,r,n,a,o,l,u=s2(e,!1).targetElementList;return!function(e,t){var i;if(!1===e||Y(e))return!1;if(!0===e)i=sJ;else{if(!G(e))return!1;if(e.length>10)return t1.error("[PostHog] content_ignorelist array cannot exceed 10 items. Use css_selector_ignorelist for more complex matching."),!1;i=e.map(e=>e.toLowerCase())}return t.some(e=>{var t=e.safeText,s=e.ariaLabel;return i.some(e=>sQ(t,e)||sQ(s,e))})}(n,u.map(e=>{var t;return{safeText:sz(e).toLowerCase(),ariaLabel:(null==(t=e.getAttribute("aria-label"))?void 0:t.toLowerCase().trim())||""}}))&&!sG(u,r)}var s1=e=>!e||sN(e,"html")||!sA(e),s2=(e,t)=>{if(!s||s1(e))return{parentIsUsefulElement:!1,targetElementList:[]};for(var i=!1,r=[e],n=e;n.parentNode&&!sN(n,"body");)if(sD(n.parentNode))r.push(n.parentNode.host),n=n.parentNode.host;else{var a=sW(n);if(!a)break;if(t||sV.indexOf(a.tagName.toLowerCase())>-1)i=!0;else try{var o=s.getComputedStyle(a);o&&"pointer"===o.getPropertyValue("cursor")&&(i=!0)}catch(e){}r.push(a),n=a}return{parentIsUsefulElement:i,targetElementList:r}};function s3(e){for(var t=new Set,i=0,s=e;s.parentNode&&!sN(s,"body");s=s.parentNode){if(i++>=1e3||t.has(s))return!1;t.add(s);var r=sH(s);if(q(r,"ph-sensitive")||q(r,"ph-no-capture"))return!1}if(q(sH(e),"ph-include"))return!0;var n=e.type||"";if(Q(n))switch(n.toLowerCase()){case"hidden":case"password":return!1}
1var a=e.name||e.id||"";return!Q(a)||!/^cc|cardnum|ccnum|creditcard|csc|cvc|cvv|exp|pass|pwd|routing|seccode|securitycode|securitynum|socialsec|socsec|ssn/i.test(a.replace(/[^a-zA-Z0-9]/g,""))}function s5(e){return!!(sN(e,"input")&&!["button","checkbox","submit","reset"].includes(e.type)||sN(e,"select")||sN(e,"textarea")||"true"===e.getAttribute("contenteditable"))}var s6=RegExp("^(?:(4[0-9]{12}(?:[0-9]{3})?)|(5[1-5][0-9]{14})|(6(?:011|5[0-9]{2})[0-9]{12})|(3[47][0-9]{13})|(3(?:0[0-5]|[68][0-9])[0-9]{11})|((?:2131|1800|35[0-9]{3})[0-9]{11}))$"),s4=/(^|[^0-9A-Za-z_])([0-9][0-9 -]*[0-9])(?=$|[^0-9A-Za-z_])/g,s8=[16,15,14,13],s9=RegExp("^(\\d{3}-?\\d{2}-?\\d{4})$"),s7=RegExp("(^|[^0-9])((?!000|666)[0-9]{3}-?(?!00)[0-9]{2}-?(?!0000)[0-9]{4})(?=$|([^0-9]))","g"),re=/[0-9A-Za-z_]/;function rt(e,t){return void 0===t&&(t=!0),!(ee(e)||Q(e)&&(e=j(e),(t?s6.test((e||"").replace(/[- ]/g,"")):function(e){var t;for(s4.lastIndex=0;t=s4.exec(e);){var i=t[2];if(i)for(var s=i.replace(/[- ]/g,""),r=0;s.length>r;r++)for(var n of s8){var a=r+n;if(s.length>=a){var o=s.slice(r,a);if(s6.test(o)&&function(e){for(var t=0,i=!1,s=e.length-1;s>=0;s--){var r=e.charCodeAt(s)-48;i&&(r*=2)>9&&(r-=9),t+=r,i=!i}return t%10==0}(o))return!0}}}return!1}(e))||(t?s9.test(e):function(e){var t;for(s7.lastIndex=0;t=s7.exec(e);){var i=t[1],s=t[3];if(!(i&&s&&re.test(i)&&re.test(s)))return!0}return!1}(e))))}function ri(e){var t=sz(e);return rt(t=(t+" "+function e(t){var i="";return t&&t.childNodes&&t.childNodes.length&&st(t.childNodes,function(t){var s;if(t&&"span"===(null==(s=t.tagName)?void 0:s.toLowerCase()))try{var r=sz(t);i=(i+" "+r).trim(),t.childNodes&&t.childNodes.length&&(i=(i+" "+e(t)).trim())}catch(e){t1.error("[AutoCapture]",e)}}),i}(e)).trim())?t:""}function rs(e){return e.replace(/"|\\"/g,'\\"')}var rr=t2("[Dead Clicks]"),rn=()=>!0,ra=e=>{var t,i=!(null==(t=e.instance.persistence)||!t.get_property(io)),s=e.instance.config.capture_dead_clicks;return es(s)?s:!!K(s)||i};class ro{get lazyLoadedDeadClicksAutocapture(){return this.si}constructor(e,t,i){this.instance=e,this.isEnabled=t,this.onCapture=i,this.startIfEnabledOrStop()}onRemoteConfig(e){if(e.ok){var t=e.config;"captureDeadClicks"in t&&(this.instance.persistence&&this.instance.persistence.register({[io]:t.captureDeadClicks}),this.startIfEnabledOrStop())}}startIfEnabledOrStop(){this.isEnabled(this)?this.ai(()=>{this.oi()}):this.stop()}ai(e){var t,i;null!=(t=g.__PosthogExtensions__)&&t.initDeadClicksAutocapture?e():null==(i=g.__PosthogExtensions__)||null==i.loadExternalDependency||i.loadExternalDependency(this.instance,"dead-clicks-autocapture",t=>{t?rr.error("failed to load script",t):e()})}oi(){var e;if(a){if(!this.si&&null!=(e=g.__PosthogExtensions__)&&e.initDeadClicksAutocapture){var t=K(this.instance.config.capture_dead_clicks)?y({},this.instance.config.capture_dead_clicks):{};t.__onCapture=this.onCapture,this.onCapture&&(t.capture_dead_swipes=!1),this.si=g.__PosthogExtensions__.initDeadClicksAutocapture(this.instance,t),this.si.start(a),rr.info("starting...")}}else rr.error("`document` not found. Cannot start.")}stop(){this.si&&(this.si.stop(),this.si=void 0,rr.info("stopping..."))}}var rl=t2("[SegmentIntegration]"),ru="posthog-js";function rh(e,t){var i=void 0===t?{}:t,s=i.organization,r=i.projectId,n=i.prefix,a=i.severityAllowList,o=void 0===a?["error"]:a,l=i.sendExceptionsToPostHog,u=void 0===l||l;return t=>{if("*"!==o&&!o.includes(t.level)||!e.__loaded)return t;t.tags||(t.tags={});var i=e.requestRouter.endpointFor("ui","/project/"+e.config.token+"/person/"+e.get_distinct_id());t.tags["PostHog Person URL"]=i,e.sessionRecordingStarted()&&(t.tags["PostHog Recording URL"]=e.get_session_replay_url({withTimestamp:!0}));var a,l,h,c,d,p,v=(null==(a=t.exception)?void 0:a.values)||[],g=v.map(e=>y({},e,{stacktrace:e.stacktrace?y({},e.stacktrace,{type:"raw",frames:(e.stacktrace.frames||[]).map(e=>y({},e,{platform:"web:javascript"}))}):void 0})),f={$exception_message:(null==(l=v[0])?void 0:l.value)||t.message,$exception_type:null==(h=v[0])?void 0:h.type,$exception_level:t.level,$exception_list:g,$sentry_event_id:t.event_id,$sentry_exception:t.exception,$sentry_exception_message:(null==(c=v[0])?void 0:c.value)||t.message,$sentry_exception_type:null==(d=v[0])?void 0:d.type,$sentry_tags:t.tags};return s&&r&&(f.$sentry_url=(n||"https://sentry.io/organizations/")+s+"/issues/?project="+r+"&query="+t.event_id),u&&(null==(p=e.exceptions)||p.sendExceptionEvent(f)),t}}class rc{constructor(e,t,i,s,r,n){this.name=ru,this.setupOnce=function(a){a(rh(e,{organization:t,projectId:i,prefix:s,severityAllowList:r,sendExceptionsToPostHog:null==n||n}))}}}class rd{constructor(e){this.li=(e,t,i)=>{i&&(i.noSessionId||i.activityTimeout||i.sessionPastMaximumLength||i.crossTabAdoption)&&(t1.info("[PageViewManager] Session rotated, clearing pageview state",{sessionId:e,changeReason:i}),this.ui=void 0,this._instance.scrollManager.resetContext())},this._instance=e,this.hi()}hi(){var e;this.di=null==(e=this._instance.sessionManager)?void 0:e.onSessionId(this.li)}destroy(){var e;null==(e=this.di)||e.call(this),this.di=void 0}doPageView(e,t){var i,r=this.vi(e,t);return this.ui={pathname:null!==(i=null==s?void 0:s.location.pathname)&&void 0!==i?i:"",pageViewId:t,timestamp:e},this._instance.scrollManager.resetContext(),r}doPageLeave(e){var t;return this.vi(e,null==(t=this.ui)?void 0:t.pageViewId)}doEvent(){var e;return{$pageview_id:null==(e=this.ui)?void 0:e.pageViewId}}vi(e,t){var i=this.ui;if(!i)return{$pageview_id:t};var s={$pageview_id:t,$prev_pageview_id:i.pageViewId},r=this._instance.scrollManager.getContext();if(r&&!this._instance.config.disable_scroll_properties){var n=r.maxScrollHeight,a=r.lastScrollY,o=r.maxScrollY,l=r.maxContentHeight,u=r.lastContentY,h=r.maxContentY;if(!(Y(n)||Y(a)||Y(o)||Y(l)||Y(u)||Y(h))){n=Math.ceil(n),a=Math.ceil(a),o=Math.ceil(o),l=Math.ceil(l),u=Math.ceil(u),h=Math.ceil(h);var c=n>1?ev(a/n,0,1,t1):1,d=n>1?ev(o/n,0,1,t1):1,p=l>1?ev(u/l,0,1,t1):1,v=l>1?ev(h/l,0,1,t1):1;s=si(s,{$prev_pageview_last_scroll:a,$prev_pageview_last_scroll_percentage:c,$prev_pageview_max_scroll:o,$prev_pageview_max_scroll_percentage:d,$prev_pageview_last_content:u,$prev_pageview_last_content_percentage:p,$prev_pageview_max_content:h,$prev_pageview_max_content_percentage:v})}}return i.pathname&&(s.$prev_pageview_pathname=i.pathname),i.timestamp&&(s.$prev_pageview_duration=(e.getTime()-i.timestamp.getTime())/1e3),s}}
1var rp=["flags","surveys"],rv={[t6]:{exposure:"hidden"},[t9]:{exposure:"hidden"},__cmpns:{exposure:"hidden"},[t7]:{exposure:"hidden"},[ie]:{exposure:"event"},[it]:{exposure:"hidden"},[ii]:{exposure:"event"},[is]:{exposure:"hidden"},[ir]:{exposure:"event"},[ia]:{exposure:"event"},[io]:{exposure:"event"},[il]:{exposure:"hidden"},[iu]:{exposure:"event"},[ih]:{exposure:"hidden"},$session_recording_enabled_server_side:{exposure:"hidden"},[i_]:{exposure:"hidden"},[im]:{exposure:"event"},[ic]:{exposure:"event",shouldSkipFromEventProperties:e=>Z(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"},[iy]:{exposure:"hidden",storageGroup:"flags"},[ib]:{exposure:"hidden",storageGroup:"flags"},[iw]:{exposure:"hidden"},[ix]:{exposure:"hidden",storageGroup:"flags"},[iE]:{exposure:"hidden",storageGroup:"flags"},[ik]:{exposure:"hidden",storageGroup:"flags",volatile:!0},[iS]:{exposure:"hidden",storageGroup:"flags"},[iP]:{exposure:"hidden"}
1,[iF]:{exposure:"hidden"},[iI]:{exposure:"hidden"},[i$]:{exposure:"hidden"},[iR]:{exposure:"hidden",storageGroup:"surveys"},[iM]:{exposure:"hidden",storageGroup:"surveys",volatile:!0},[iC]:{exposure:"event"},[iT]:{exposure:"hidden"},[iO]:{exposure:"hidden"},[iA]:{exposure:"hidden"},$product_tours_activated:{exposure:"hidden"},$product_tours_activated_session:{exposure:"hidden"},$conversations_widget_session_id:{exposure:"event"},$conversations_ticket_id:{exposure:"event"},$conversations_widget_state:{exposure:"event"},$conversations_user_traits:{exposure:"event"},[iN]:{exposure:"hidden"},[iL]:{exposure:"hidden"},[iD]:{exposure:"hidden"},[iq]:{exposure:"hidden",storageGroup:"flags",volatile:!0},[ij]:{exposure:"hidden"},[iH]:{exposure:"hidden"},[iB]:{exposure:"hidden"},[iz]:{exposure:"hidden"},[iU]:{exposure:"hidden"},[iV]:{exposure:"hidden"},[iG]:{exposure:"hidden"},[id]:{exposure:"event"},[ip]:{exposure:"event"},[iv]:{exposure:"event"},[ig]:{exposure:"event"},[iJ]:{exposure:"event"},[iY]:{exposure:"event"},[iQ]:{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"}},rg=[["$posthog_sr_group_event_trigger_",{exposure:"hidden"}],["$posthog_sr_group_url_trigger_",{exposure:"hidden"}],["$posthog_sr_group_sampling_",{exposure:"hidden"}]],rf=e=>{var t=rv[e];if(t)return t;for(var i of rg){var s=i[1];if(0===e.indexOf(i[0]))return s}},r_=(e,t)=>{try{return JSON.stringify(e,(e,t)=>"bigint"==typeof t?t.toString():t,t)}catch(t){return B(e)}},rm=e=>{var t=null==a?void 0:a.createElement("a");return Y(t)?null:(t.href=e,t)},ry=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(!G(i)||2>i.length)return"";var a=i[1];try{a=decodeURIComponent(a)}catch(e){t1.error("Skipping decoding for malformed query param: "+a)}return a.replace(/\+/g," ")},rb=function(e,t,i){if(!e||!t||!t.length)return e;for(var s=e.split("#"),r=s[1],n=(s[0]||"").split("?"),a=n[1],o=n[0],l=(a||"").split("&"),u=[],h=0;l.length>h;h++){var c=l[h].split("=");G(c)&&(t.includes(c[0])?u.push(c[0]+"="+i):u.push(l[h]))}var d=o;return null!=a&&(d+="?"+u.join("&")),null!=r&&(d+="#"+r),d},rw=function(e,t){var i=e.match(RegExp(t+"=([^&]*)"));return i?i[1]:null},rx=(e,t)=>e>=t&&p(),rE=(e,t,i,s)=>{if(0===e){if(p()){var r=t+1;return r===i&&s(),r}return t}return 0},rk="https?://(.*)",rS=["gclid","gclsrc","dclid","gbraid","wbraid","fbclid","msclkid","twclid","li_fat_id","igshid","ttclid","rdt_cid","epik","qclid","sccid","irclid","_kx"],rP=["utm_source","utm_medium","utm_campaign","utm_content","utm_term","gad_source","mc_cid",...rS],rF="<masked>",rI=["li_fat_id"];function r$(e,t,i){if(!a)return{};var s,r=t?[...rS,...i||[]]:[],n=rR(rb(a.URL,r,rF),e);return si((s={},st(rI,function(e){var t=sh(e);s[e]=t||null}),s),n)}function rR(e,t){var i=rP.concat(t||[]),s={};return st(i,function(t){var i=ry(e,t);s[t]=i||null}),s}function rM(e){var t=e?0===e.search(rk+"google.([^/?]*)")?"google":0===e.search(rk+"bing.com")?"bing":0===e.search(rk+"yahoo.com")?"yahoo":0===e.search(rk+"duckduckgo.com")?"duckduckgo":null:null,i={};if(!Z(t)){i.$search_engine=t;var s=a?ry(a.referrer,"yahoo"!=t?"q":"p"):"";s.length&&(i.ph_keyword=s)}return i}function rC(){return navigator.language||navigator.userLanguage}var rT="$direct";function rO(){return(null==a?void 0:a.referrer)||rT}function rA(e,t,i){void 0===i&&(i=!1);var s=e?[...rS,...t||[]]:[],r=i?tc(null==o?void 0:o.href):null==o?void 0:o.href,n=null==r?void 0:r.substring(0,1e3);return{r:rO().substring(0,1e3),u:n?rb(n,s,rF):void 0}}function rN(e,t){void 0===t&&(t=!1);var i,s=e.r,r=e.u,n=t?tc(r):r,a={$referrer:s,$referring_domain:null==s?void 0:s==rT?rT:null==(i=rm(s))?void 0:i.host};
1if(n){a.$current_url=n;var o=rm(n);a.$host=null==o?void 0:o.host,a.$pathname=null==o?void 0:o.pathname,si(a,rR(n))}return s&&si(a,rM(s)),a}function rL(){try{return Intl.DateTimeFormat().resolvedOptions().timeZone}catch(e){return}}var rD={flags:iq,surveys:iM},rq=["cookie","localstorage","localstorage+cookie","sessionstorage","memory"],rj="main";class rH{constructor(e,t,i){if(void 0===i&&(i=!0),this.ci={},this.fi=!1,this.pi=!1,this.Ne=e,this.gi=i,this.props={},this.mi=void 0,this.yi=(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.ii=this.bi(e),this.pi=this.wi(e),this.load(),e.debug&&t1.info("Persistence loaded",e.persistence,y({},this.props)),this.update_config(e,e,t),this.save(),s){var r=()=>this.flush();sl(s,"beforeunload",r,{capture:!1}),sl(s,"pagehide",r,{capture:!1})}}ki(){var e,t=null==(e=this.Ne)?void 0:e.persistence_save_debounce_ms;return et(t)&&t>0?t:0}isDisabled(){return!!this.xi}bi(e){-1===rq.indexOf(e.persistence.toLowerCase())&&(t1.critical("Unknown persistence type "+e.persistence+"; falling back to localStorage+cookie"),e.persistence="localStorage+cookie");var t,i,r,n,a=(t=e.cookie_persisted_properties||[],i=e.__preview_cookie_wins_on_conflict||!1,void 0===t&&(t=[]),void 0===i&&(i=!1),r=[...sP,...t],y({},sS,{H(e){try{var t={};try{t=sE.H(e)||{}}catch(e){}var s,r=JSON.parse(sS.P(e)||"{}");if(i){var n={};for(var a in t){var o=t[a];Z(o)||""===o||(n[a]=o)}s=si(r,n)}else s=si(t,r);return sS.F(e,s),s}catch(e){}return null},F(e,t,i,s,n,a){var o=sS.F(e,t,void 0,void 0,a);try{var l={};r.forEach(e=>{t[e]&&(l[e]=t[e])}),Object.keys(l).length&&sE.F(e,l,i,s,n,a)}catch(e){sS.j(e)}return o},q(e,t){try{null==s||s.localStorage.removeItem(e),sE.q(e,t)}catch(e){sS.j(e)}}})),o=!1,l=e.persistence.toLowerCase();return"localstorage"===l&&sS.N()?(n=sS,o=!0):"localstorage+cookie"===l&&a.N()?(n=a,o=!0):"sessionstorage"===l&&sR.N()?n=sR:"memory"===l?n=sI:"cookie"===l?n=sE:a.N()?(n=a,o=!0):n=sE,this.fi=o,n}Si(e){return this.yi+"__"+e}wi(e){return this.fi&&!!e.split_storage}properties(){var e={};return st(this.props,(t,i)=>{var s=rf(i);if(!s||"event"===s.exposure){if(null!=s&&null!=s.shouldSkipFromEventProperties&&s.shouldSkipFromEventProperties(t))return;e[i]=t}}),e}load(){if(!this.xi){var e=this.ii.H(this.yi);e&&(this.props=si({},e)),this.pi&&this.Ci()}}Ci(){for(var e of rp){var t=sS.H(this.Si(e));if(t&&!J(t)){var i=this.Mi(e);i.persisted=!0,this.Ti(e)||(i.fingerprint=this.Ei(t,e)),this.Ii(e,t)||si(this.props,t)}}}Ti(e){return Object.keys(this.props).some(t=>{var i;return(null==(i=rf(t))?void 0:i.storageGroup)===e})}Ii(e,t){var i=rD[e];if(!i)return!1;var s=t[i],r=this.props[i];return et(s)&&et(r)&&r>s}refreshKey(e){var t;if(!this.xi){var i=this.pi?null==(t=rf(e))?void 0:t.storageGroup:void 0,s=i?sS.H(this.Si(i)):this.ii.H(this.yi);if(s&&e in s)this.Pi(e,s[e]);else{if(i){var r=this.ii.H(this.yi);if(r&&e in r)return void this.Pi(e,r[e])}this.Ri(e)}}}save(){if(!this.xi){var e=this.ki();e>0?Y(this.Ai)&&(this.Ai=setTimeout(()=>{this.Ai=void 0,this.Fi()},e)):this.Fi()}}flush(){Y(this.Ai)||(clearTimeout(this.Ai),this.Ai=void 0,this.Fi())}Fi(){this.xi||(this.pi?this.Li():this.Oi(this.ii,this.yi,this.props,rj))}Li(){var e=this.Di(),t=e.main,i=e.groups;for(var s of(this.Oi(this.ii,this.yi,t,rj),rp)){var r,n=i[s];(!J(n)||null!=(r=this.ci[s])&&r.persisted)&&this.Oi(sS,this.Si(s),n,s)}}Di(){var e={},t={flags:{},surveys:{}};return st(this.props,(i,s)=>{var r,n=null==(r=rf(s))?void 0:r.storageGroup;n?t[n][s]=i:e[s]=i}),{main:e,groups:t}}Ei(e,t){if(t===rj)return JSON.stringify(e)+"|"+this.$i+"|"+this.Ni+"|"+this.qi;var i={};return st(e,(e,t)=>{var s;i[t]=null!=(s=rf(t))&&s.volatile?"__volatile__":e}),JSON.stringify(i)}Oi(e,t,i,s){var r,n=this.Mi(s);if(s===rj||n.dirty||Y(n.fingerprint)){try{if((r=this.Ei(i,s))===n.fingerprint)return void(n.dirty=!1)}catch(e){r=void 0}e.F(t,i,this.$i,this.Ni,this.qi,this.Ne.debug)?(n.dirty=!1,s!==rj&&(n.persisted=!0),Y(r)||(n.fingerprint=r)):this.Ne.debug&&t1.warn('failed to persist storage entry "'+t+'"; will retry on next save')}}remove(e){var t=(void 0===e?{}:e).keepGroupEntries,i=void 0!==t&&t;if(Y(this.Ai)||(clearTimeout(this.Ai),this.Ai=void 0),this.ii.q(this.yi,!1),this.ii.q(this.yi,!0),!i&&this.gi)for(var s of rp)sS.q(this.Si(s));i?delete this.ci[rj]:this.ci={}}clear(){this.remove(),this.props={}}register_once(e,t,i){if(K(e)){Y(t)&&(t="None"),this.$i=Y(i)?this.ji:i;var s=!1;if(st(e,(e,i)=>{this.props.hasOwnProperty(i)&&this.props[i]!==t||(this.Pi(i,e),s=!0)}),s)return this.save(),!0}return!1}register(e,t){if(K(e)){this.$i=Y(t)?this.ji:t;var i=!1;if(st(e,(t,s)=>{e.hasOwnProperty(s)&&(this.props[s]!==t||K(t)||G(t))&&(this.Pi(s,t),i=!0)}),i)return this.save(),!0}return!1}unregister(e){var t=!1;for(var i of"string"==typeof e?[e]:e)i in this.props&&(this.Ri(i),t=!0);t&&this.save()}update_campaign_params(){var e=null==a?void 0:a.URL;if(e!==this.mi){var t=r$(this.Ne.custom_campaign_params,this.Ne.mask_personal_data_properties,this.Ne.custom_personal_data_properties);J(sa(t))||this.register(t),this.mi=e}}update_search_keyword(){var e;this.register((e=null==a?void 0:a.referrer)?rM(e):{})}update_referrer_info(){var e;this.register_once({$referrer:rO(),$referring_domain:null!=a&&a.referrer&&(null==(e=rm(a.referrer))?void 0:e.host)||rT},void 0)}set_initial_person_info(){this.props[iz]||this.props[iU]||this.register_once({[iV]:rA(this.Ne.mask_personal_data_properties,this.Ne.custom_personal_data_properties,this.Ne.disable_capture_url_hashes
1)},void 0)}get_initial_props(){var e,t,i,s={};st([iU,iz],e=>{var t=this.props[e];t&&st(t,function(e,t){s["$initial_"+H(t)]=e})});var r=this.props[iV];return r&&si(s,(void 0===(e=this.Ne.disable_capture_url_hashes)&&(e=!1),t=rN(r,e),i={},st(t,function(e,t){i["$initial_"+H(t)]=e}),i)),s}safe_merge(e){return st(this.props,function(t,i){i in e||(e[i]=t)}),e}update_config(e,t,i){this.ji=this.$i=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.bi(e):this.ii,n=this.wi(e);if(s||n!==this.pi){var a=this.props;this.clear(),this.ii=r,this.pi=n,this.props=a,this.save()}}set_disabled(e){this.xi=e,this.xi?this.remove():this.save()}set_cross_subdomain(e){e!==this.Ni&&(this.Ni=e,this.remove({keepGroupEntries:!0}),this.save())}set_secure(e){e!==this.qi&&(this.qi=e,this.remove({keepGroupEntries:!0}),this.save())}set_event_timer(e,t){var i=this.props[t7]||{};i[e]=t,this.Pi(t7,i),this.save()}remove_event_timer(e){var t=this.props[t7]||{},i=t[e];return Y(i)||(delete t[e],this.Pi(t7,t),this.save()),i}get_property(e){return this.props[e]}set_property(e,t){this.Pi(e,t),this.save()}Pi(e,t){var i;this.props[e]=t,null!=(i=rf(e))&&i.volatile||this.Bi(e)}Ri(e){delete this.props[e],this.Bi(e)}Bi(e){var t,i=null==(t=rf(e))?void 0:t.storageGroup;i&&(this.Mi(i).dirty=!0)}Mi(e){return this.ci[e]||(this.ci[e]={})}}function rB(e){var t=!0;return{dispose(){if(t){t=!1;var i=e();i&&W(i.then)&&i.then(void 0,()=>{})}}}}var rz={GZipJS:"gzip-js",Base64:"base64"},rU={Activation:"events",Cancellation:"cancelEvents"},rV={Popover:"popover",API:"api",Widget:"widget"},rG={SHOWN:"survey shown",DISMISSED:"survey dismissed",SENT:"survey sent"},rW={SURVEY_ID:"$survey_id",SURVEY_ITERATION:"$survey_iteration",SURVEY_LAST_SEEN_DATE:"$survey_last_seen_date"},rK={Popover:"popover",Inline:"inline"},rJ={SHOWN:"product tour shown"},rY={TOUR_LAST_SEEN_DATE:"$product_tour_last_seen_date",TOUR_TYPE:"$product_tour_type"},rQ=t2("[RateLimiter]");class rX{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=>{rQ.info((e||"events")+" is quota limited."),this.serverLimits[e]=new Date().getTime()+6e4})}catch(e){return void rQ.warn('could not rate limit - continuing. Error: "'+(null==e?void 0:e.message)+'"',{text:t})}},this.instance=e,this.lastEventRateLimited=this.clientRateLimitContext(!0).isRateLimited}get captureEventsPerSecond(){var e;return(null==(e=this.instance.config.rate_limiting)?void 0:e.events_per_second)||10}get captureEventsBurstLimit(){var e;return Math.max((null==(e=this.instance.config.rate_limiting)?void 0:e.events_burst_limit)||10*this.captureEventsPerSecond,this.captureEventsPerSecond)}clientRateLimitContext(e){void 0===e&&(e=!1);var t,i,s,r=this.captureEventsBurstLimit,n=this.captureEventsPerSecond,a=new Date().getTime(),o=null!==(t=null==(i=this.instance.persistence)?void 0:i.get_property(iB))&&void 0!==t?t:{tokens:r,last:a};o.tokens+=(a-o.last)/1e3*n,o.last=a,o.tokens>r&&(o.tokens=r);var l=1>o.tokens;if(l||e||(o.tokens=Math.max(0,o.tokens-1)),l&&!e){var u=(et(o.dropped)?o.dropped:0)+1;o.dropped=u,!this.lastEventRateLimited&&this.Hi(u)&&(o.dropped=0)}return this.lastEventRateLimited=l,null==(s=this.instance.persistence)||s.set_property(iB,o),{isRateLimited:l,remainingTokens:o.tokens}}Ui(e){var t=this.instance.config.property_denylist;return!G(t)||!t.includes(e)}zi(){var e;if(this.Ui("$current_url")&&this.Ui("$pathname")&&null!=o&&o.pathname)return""+(null!==(e=o.origin)&&void 0!==e?e:"")+o.pathname}Hi(e){var t,i,s=this.captureEventsBurstLimit,r=this.captureEventsPerSecond,n=this.zi(),a=this.Ui("$session_id")?null==(t=(i=this.instance).get_session_id)?void 0:t.call(i):void 0,o=[e+" event(s) dropped since the last warning",n?"triggered on "+n:void 0,a?"session "+a:void 0].filter(
vendor: 9,874 bytes, line 1
1Boolean).join(", ");return!!this.instance.capture("$$client_ingestion_warning",{$$client_ingestion_warning_message:"posthog-js client rate limited: "+o+". Config is set to "+r+" events per second and "+s+" events burst limit."},{skip_client_rate_limiting:!0})}isServerRateLimited(e){var t=this.serverLimits[e||"events"]||!1;return!1!==t&&new Date().getTime()<t}}var rZ=t2("[RemoteConfig]");class r0{constructor(e){this._instance=e}get remoteConfig(){var e;return null==(e=g._POSTHOG_REMOTE_CONFIG)||null==(e=e[this._instance.config.token])?void 0:e.config}Wi(e){var t,i;null!=(t=g.__PosthogExtensions__)&&t.loadExternalDependency?null==(i=g.__PosthogExtensions__)||null==i.loadExternalDependency||i.loadExternalDependency(this._instance,"remote-config",()=>e(this.remoteConfig)):e()}Vi(e){this._instance._send_request({method:"GET",url:this._instance.requestRouter.endpointFor("assets","/array/"+this._instance.config.token+"/config"),callback:e})}load(){try{if(this.remoteConfig)return rZ.info("Using preloaded remote config",this.remoteConfig),this.Zi(this.remoteConfig),void this.Gi();if(this._instance.Qi())return void rZ.warn("Remote config is disabled. Falling back to local config.");this.Wi(e=>{if(!e)return rZ.info("No config found after loading remote JS config. Falling back to JSON."),void this.Vi(e=>{this.Zi(e.json,e),this.Gi()});this.Zi(e),this.Gi()})}catch(e){rZ.error("Error loading remote config",e),this.Zi()}}stop(){this.Ki&&(clearInterval(this.Ki),this.Ki=void 0)}refresh(){!this._instance.Qi()&&a&&"hidden"!==a.visibilityState&&this._instance.reloadFeatureFlags()}Gi(){var e;if(!this.Ki){var t=null!==(e=this._instance.config.remote_config_refresh_interval_ms)&&void 0!==e?e:3e5;0!==t&&(this.Ki=setInterval(()=>{this.refresh()},t))}}Zi(e,t){!e&&t&&(0===t.statusCode?t.error||rZ.warn("Failed to fetch remote config from PostHog."):rZ.error("Failed to fetch remote config from PostHog."));try{this._instance.Zi(e?{ok:!0,config:e}:{ok:!1})}catch(e){rZ.error("Error applying remote config",e)}if(!1!==(null==e?void 0:e.hasFeatureFlags)&&!this._instance.config.advanced_disable_feature_flags_on_first_load)try{var i;null==(i=this._instance.featureFlags)||i.ensureFlagsLoaded()}catch(e){rZ.error("Error loading feature flags",e)}}}var r1=Uint8Array,r2=Uint16Array,r3=Uint32Array,r5=new r1([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]),r6=new r1([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]),r4=new r1([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),r8=function(e,t){for(var i=new r2(31),s=0;31>s;++s)i[s]=t+=1<<e[s-1];var r=new r3(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]},r9=r8(r5,2),r7=r9[1];r9[0][28]=258,r7[258]=28;for(var ne=r8(r6,0)[1],nt=new r2(32768),ni=0;32768>ni;++ni){var ns=(43690&ni)>>>1|(21845&ni)<<1;nt[ni]=((65280&(ns=(61680&(ns=(52428&ns)>>>2|(13107&ns)<<2))>>>4|(3855&ns)<<4))>>>8|(255&ns)<<8)>>>1}var nr=function(e,t,i){for(var s=e.length,r=0,n=new r2(t);s>r;++r)++n[e[r]-1];var a,o=new r2(t);for(r=0;t>r;++r)o[r]=o[r-1]+n[r-1]<<1;if(i){a=new r2(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=o[e[r]-1]++<<h,d=c|(1<<h)-1;d>=c;++c)a[nt[c]>>>l]=u}else for(a=new r2(s),r=0;s>r;++r)a[r]=nt[o[e[r]-1]++]>>>15-e[r];return a},nn=new r1(288);for(ni=0;144>ni;++ni)nn[ni]=8;for(ni=144;256>ni;++ni)nn[ni]=9;for(ni=256;280>ni;++ni)nn[ni]=7;for(ni=280;288>ni;++ni)nn[ni]=8;var na=new r1(32);for(ni=0;32>ni;++ni)na[ni]=5;var no=nr(nn,9,0),nl=nr(na,5,0),nu=function(e){return(e/8>>0)+(7&e&&1)},nh=function(e,t,i){(null==i||i>e.length)&&(i=e.length);var s=new(e instanceof r2?r2:e instanceof r3?r3:r1)(i-t);return s.set(e.subarray(t,i)),s},nc=function(e,t,i){var s=t/8>>0;e[s]|=i<<=7&t,e[s+1]|=i>>>8},nd=function(e,t,i){var s=t/8>>0;e[s]|=i<<=7&t,e[s+1]|=i>>>8,e[s+2]|=i>>>16},np=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 r1(0),0];if(1==r){var a=new r1(i[0].s+1);return a[i[0].s]=1,[a,1]}i.sort(function(e,t){return e.f-t.f}),i.push({s:-1,f:25001});var o=i[0],l=i[1],u=0,h=1,c=2;for(i[0]={s:-1,f:o.f+l.f,l:o,r:l};h!=r-1;)o=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:o.f+l.f,l:o,r:l};var d=n[0].s;for(s=1;r>s;++s)n[s].s>d&&(d=n[s].s);var p=new r2(d+1),v=nv(i[h-1],p,0);if(v>t){s=0;var g=0,f=v-t,_=1<<f;for(n.sort(function(e,t){return p[t.s]-p[e.s]||e.f-t.f});r>s;++s){var m=n[s].s;if(t>=p[m])break;g+=_-(1<<v-p[m]),p[m]=t}for(g>>>=f;g>0;){var y=n[s].s;t>p[y]?g-=1<<t-p[y]++-1:++s}for(;s>=0&&g;--s){var b=n[s].s;p[b]==t&&(--p[b],++g)}v=t}return[new r1(p),v]},nv=function(e,t,i){return -1==e.s?Math.max(nv(e.l,t,i+1),nv(e.r,t,i+1)):t[e.s]=i},ng=function(e){for(var t=e.length;t&&!e[--t];);for(var i=new r2(++t),s=0,r=e[0],n=1,a=function(e){i[s++]=e},o=1;t>=o;++o)if(e[o]==r&&o!=t)++n;else{if(!r&&n>2){for(;n>138;n-=138)a(32754);n>2&&(a(n>10?n-11<<5|28690:n-3<<5|12305),n=0)}else if(n>3){for(a(r),--n;n>6;n-=6)a(8304);n>2&&(a(n-3<<5|8208),n=0)}for(;n--;)a(r);n=1,r=e[o]}return[i.subarray(0,s),t]},nf=function(e,t){for(var i=0,s=0;t.length>s;++s)i+=e[s]*t[s];return i},n_=function(e,t,i){var s=i.length,r=nu(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)},nm=function(e,t,i,s,r,n,a,o,l,u,h){nc(t,h++,i),++r[256];for(var c=np(r,15),d=c[0],p=c[1],v=np(n,15),g=v[0],f=v[1],_=ng(d),m=_[0],y=_[1],b=ng(g),w=b[0],x=b[1],E=new r2(19),k=0;m.length>k;++k)E[31&m[k]]++;for(k=0;w.length>k;++k)E[31&w[k]]++;for(var S=np(E,7),P=S[0],F=S[1],I=19;I>4&&!P[r4[I-1]];--I);var $,R,M,C,T=u+5<<3,O=nf(r,nn)+nf(n,na)+a,A=nf(r,d)+nf(n,g)+a+14+3*I+nf(E,P)+(2*E[16]+3*E[17]+7*E[18]);if(O>=T&&A>=T)return n_(t,h,e.subarray(l,l+u));if(nc(t,h,1+(O>A)),h+=2,O>A){$=nr(d,p,0),R=d,M=nr(g,f,0),C=g;var N=nr(P,F,0);for(nc(t,h,y-257),nc(t,h+5,x-1),nc(t,h+10,I-4),h+=14,k=0;I>k;++k)nc(t,h+3*k,P[r4[k]]);h+=3*I;for(var L=[m,w],D=0;2>D;++D){var q=L[D];for(k=0;q.length>k;++k)nc(t,h,N[j=31&q[k]]),h+=P[j],j>15&&(nc(t,h,q[k]>>>5&127),h+=q[k]>>>12)}}else $=no,R=nn,M=nl,C=na;for(k=0;o>k;++k)if(s[k]>255){nd(t,h,$[257+(j=s[k]>>>18&31)]),h+=R[j+257],j>7&&(nc(t,h,s[k]>>>23&31),h+=r5[j]);var j,H=31&s[k];nd(t,h,M[H]),h+=C[H],H>3&&(nd(t,h,s[k]>>>5&8191),h+=r6[H])}else nd(t,h,$[s[k]]),h+=R[s[k]];return nd(t,h,$[256]),h+R[256]},ny=new r3([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),nb=function(){for(var e=new r3(256),t=0;256>t;++t){for(var i=t,s=9;--s;)i=(1&i&&0xedb88320)^i>>>1;e[t]=i}return e}(),nw=function(e,t,i){for(;i;++t)e[t]=i,i>>>=8},nx=!!u||!!l,nE="text/plain",nk=!1,nS=(e,t)=>{var i=e.split("#"),s=i[1],r=i[0].split("?"),n=r[0],a=r[1];if(!a)return e;var o=a.split("&").filter(e=>e.split("=")[0]!==t).join("&");return n+(o?"?"+o:"")+(s?"#"+s:"")},nP=function(e,t,i){void 0===i&&(i=!0);var s,r,n,a,o,l=e.split("?"),u=l[0],h=l[1],c=y({},t),d=null!==(o=null==h?void 0:h.split("&").map(e=>{var t,s=e.split("="),r=s[0],n=i&&null!==(t=c[r])&&void 0!==t?t:s[1];return delete c[r],r+"="+n}))&&void 0!==o?o:[],p=(void 0===s&&(s="&"),a=[],st(c,function(e,t){Y(e)||Y(t)||"undefined"===t||(r=encodeURIComponent(e instanceof File?e.name:e.toString()),n=encodeURIComponent(t),a[a.length]=n+"="+r)}),a.join(s));return p&&d.push(p),d.length>0?u+"?"+d.join("&"):u},nF=e=>{if(e.Ji)return e.Ji;var t=e.data,i=e.compression;if(t){if(i===rz.GZipJS){var s=function(e,t){void 0===t&&(t={});var i=(r=0xffffffff,{p(e){for(var t=r,i=0;e.length>i;++i)t=nb[255&t^e[i]]^t>>>8;r=t},d:()=>0xffffffff^r}),s=e.length;i.p(e);var r,n,a,o,l=(o=10+((n=t).filename&&n.filename.length+1||0),function(e,t,i,s,r,n){var a=e.length,o=new r1(s+a+5*(1+Math.floor(a/7e3))+8),l=o.subarray(s,o.length-8),u=0;if(!t||8>a)for(var h=0;a>=h;h+=65535){var c=h+65535;a>c?u=n_(l,u,e.subarray(h,c)):(l[h]=!0,u=n_(l,u,e.subarray(h,a)))}else{for(var d=ny[t-1],p=d>>>13,v=8191&d,g=(1<<i)-1,f=new r2(32768),_=new r2(g+1),m=Math.ceil(i/3),y=2*m,b=function(t){return(e[t]^e[t+1]<<m^e[t+2]<<y)&g},w=new r3(25e3),x=new r2(288),E=new r2(32),k=0,S=0,P=(h=0,0),F=0,I=0;a>h;++h){var $=b(h),R=32767&h,M=_[$];if(f[R]=M,_[$]=R,h>=F){var C=a-h;if((k>7e3||P>24576)&&C>423){u=nm(e,l,0,w,x,E,S,P,I,h-I,u),P=k=S=0,I=h;for(var T=0;286>T;++T)x[T]=0;for(T=0;30>T;++T)E[T]=0}var O=2,A=0,N=v,L=R-M&32767;if(C>2&&$==b(h-L))for(var D=Math.min(p,C)-1,q=Math.min(32767,h),j=Math.min(258,C);q>=L&&--N&&R!=M;){if(e[h+O]==e[h+O-L]){for(var H=0;j>H&&e[h+H]==e[h+H-L];++H);if(H>O){if(O=H,A=L,H>D)break;var B=Math.min(L,H-2),z=0;for(T=0;B>T;++T){var U=h-L+T+32768&32767,V=U-f[U]+32768&32767;V>z&&(z=V,M=U)}}}L+=(R=M)-(M=f[R])+32768&32767}if(A){w[P++]=0x10000000|r7[O]<<18|ne[A];var G=31&r7[O],W=31&ne[A];S+=r5[G]+r6[W],++x[257+G],++E[W],F=h+O,++k}else w[P++]=e[h],++x[e[h]]}}u=nm(e,l,!0,w,x,E,S,P,I,h-I,u)}return nh(o,0,s+nu(u)+8)}(e,null==(a=t).level?6:a.level,null==a.mem?Math.ceil(1.5*Math.max(8,Math.min(13,Math.log(e.length)))):12+a.mem,o,8)),u=l.length;return function(e,t){var i=t.filename;if(e[0]=31,e[1]=139,e[2]=8,e[8]=2>t.level?4:9==t.level?2:0,e[9]=3,0!=t.mtime&&nw(e,4,Math.floor(new Date(t.mtime||Date.now())/1e3)),i){e[3]=8;for(var s=0;i.length>=s;++s)e[s+10]=i.charCodeAt(s)}}(l,t),nw(l,u-8,i.d()),nw(l,u-4,s),l}(function(e,t){var i=e.length;if("undefined"!=typeof TextEncoder)return new TextEncoder().encode(e);for(var s=new r1(e.length+(e.length>>>1)),r=0,n=function(e){s[r++]=e},a=0;i>a;++a){if(r+5>s.length){var o=new r1(r+8+(i-a<<1));o.set(s),s=o}var l=e.charCodeAt(a);128>l?n(l):(2048>l?n(192|l>>>6):(l>55295&&57344>l?(n(240|(l=65536+(1047552&l)|1023&e.charCodeAt(++a))>>>18),n(128|l>>>12&63)):n(224|l>>>12),n(128|l>>>6&63)),n(128|63&l))}return nh(s,0,r)}(r_(t)),{mtime:0});return{contentType:nE,body:s.buffer.slice(s.byteOffset,s.byteOffset+s.byteLength),estimatedSize:s.byteLength}}if(i===rz.Base64){var r=(e=>"data="+encodeURIComponent("string"==typeof e?e:r_(e)))(function(e){return e?btoa(encodeURIComponent(e).replace(/%([0-9A-F]{2})/g,(e,t)=>
1String.fromCharCode(parseInt(t,16)))):e}(r_(t)));return{contentType:"application/x-www-form-urlencoded",body:r,estimatedSize:new Blob([r]).size}}var n=r_(t);return{contentType:"application/json",body:n,estimatedSize:new Blob([n]).size}}},nI=e=>{var t,i,s=()=>"sendBeacon"===e.transport?{url:nP(e.url,{compression:rz.Base64}),encodedBody:nF(y({},e,{compression:rz.Base64,Ji:void 0}))}:{url:nS(e.url,"compression"),encodedBody:nF(y({},e,{compression:void 0,Ji:void 0}))};try{t=nF(e)}catch(t){if(C(e.compression,ry(e.url,"compression")))return t1.error("Failed to gzip request body, sending uncompressed payload",t),s();throw t}return!(t&&C(e.compression,ry(e.url,"compression")))||((i=t.body)instanceof ArrayBuffer?M(new Uint8Array(i)):ArrayBuffer.isView(i)&&M(new Uint8Array(i.buffer,i.byteOffset,i.byteLength)))?{url:e.url,encodedBody:t}:(nk=!0,s())},n$=e=>{try{return nI(e)}catch(t){return t1.error(t),void(null==e.callback||e.callback({statusCode:0,error:t}))}},nR=function(){var e=m(function*(e){var t=r_(e.data),i=yield function(e,t,i){return N.apply(this,arguments)}(t,f.DEBUG,{rethrow:!0});if(!i)return e;var s=yield i.arrayBuffer();return y({},e,{Ji:{contentType:nE,body:s,estimatedSize:s.byteLength}})});return function(t){return e.apply(this,arguments)}}(),nM=/Failed to fetch|NetworkError|Load failed/i,nC=e=>"TypeError"===(null==e?void 0:e.name)&&nM.test((null==e?void 0:e.message)||""),nT=e=>{var t=n$(e);if(t){var i,s=t.url,r=t.encodedBody,n=null!=r?r:{},a=n.contentType,o=n.body,u=n.estimatedSize,c=new Headers;st(e.headers,function(e,t){c.append(t,e)}),a&&c.append("Content-Type",a);var d=null,p=!1;if(h){var v=new h;d={signal:v.signal,timeout:setTimeout(()=>{var t,i;p=!0,v.abort(((i=Error("PostHog request timed out"+((t=e.timeout)?" after "+t+"ms":""))).name="AbortError",i))},e.timeout)}}var g=t=>{p&&"AbortError"===(null==t?void 0:t.name)||nC(t)?t1.warn(t):t1.error(t),null==e.callback||e.callback({statusCode:0,error:t})};try{l(s,y({method:(null==e?void 0:e.method)||"GET",headers:c,keepalive:"POST"===e.method&&!e.Yi&&52428.8>(u||0),body:o,signal:null==(i=d)?void 0:i.signal},e.fetchOptions)).then(t=>t.text().then(i=>{var s={statusCode:t.status,text:i};if(200===t.status)try{s.json=JSON.parse(i)}catch(e){t1.error(e)}null==e.callback||e.callback(s)})).catch(g).finally(()=>d?clearTimeout(d.timeout):null)}catch(e){d&&clearTimeout(d.timeout),g(e)}}},nO=e=>{try{var t,i=nI(e),s=i.url,r=i.encodedBody,a=null!=r?r:{},o=a.body,l=a.estimatedSize;if(!o)return;var u=o instanceof Blob?o:new Blob([o],{type:a.contentType});if(n.sendBeacon(s,u))return;var h=G(e.data)?e.data:null==(t=e.data)?void 0:t.batch;if(G(h)&&h.length>1&&(null!=l?l:0)>16384){var c=Math.ceil(h.length/2),d=t=>G(e.data)?t:y({},e.data,{batch:t});return nO(y({},e,{data:d(h.slice(0,c))})),void nO(y({},e,{data:d(h.slice(c))}))}t1.warn("Beacon of ~"+(null!=l?l:0)+" bytes was rejected by the browser, falling back to fetch"),nT(y({},e,{Yi:!0}))}catch(e){t1.warn("Beacon send failed",e)}},nA=(e,t,i,s)=>{var r="query"===s?"POST"===t?"sent_at":"_":void 0;return nP(i===rz.GZipJS?nS(e,"compression"):e,y({},r?{[r]:Date.now().toString()}:{},i===rz.GZipJS?{}:{compression:i}))},nN=[];l&&nN.push({transport:"fetch",method:nT}),u&&nN.push({transport:"XHR",method(e){var t=n$(e);if(t){var i=new u,s=t.encodedBody;i.open(e.method||"GET",t.url,!0);var r=null!=s?s:{},n=r.contentType,a=r.body;st(e.headers,function(e,t){i.setRequestHeader(t,e)}),n&&i.setRequestHeader("Content-Type",n),e.timeout&&(i.timeout=e.timeout),i.onreadystatechange=()=>{if(4===i.readyState){var t={statusCode:i.status,text:i.responseText};if(200===i.status)try{t.json=JSON.parse(i.responseText)}catch(e){}null==e.callback||e.callback(t)}},i.send(a)}}}),null!=n&&n.sendBeacon&&nN.push({transport:"sendBeacon",method:nO});class nL{constructor(e,t){this.Xi=!0,this.tr=[],this.er=ev((null==t?void 0:t.flush_interval_ms)||3e3,250,5e3,t1.createLogger("flush interval"),3e3),this.ir=e}enqueue(e){this.tr.push(e),this.rr||this.nr()}unload(){this.sr();var e=Object.values(this.tr.length>0?this.ar():{});[...e.filter(e=>0===e.url.indexOf("/e")),...e.filter(e=>0!==e.url.indexOf("/e"))].map(e=>{this.lr(y({},e,{transport:"sendBeacon"}))})}enable(){this.Xi=!1,this.nr()}nr(){var e=this;this.Xi||(this.rr=setTimeout(()=>{if(this.sr(),this.tr.length>0){var t=this.ar();for(var i in t)!function(){var s=t[i],r=new Date().getTime();s.data&&G(s.data)&&st(s.data,e=>{e.offset=Math.abs(e.timestamp-r),delete e.timestamp}),e.lr(s)}()}},this.er))}lr(e){try{this.ir(e)}catch(e){t1.error(e)}}sr(){clearTimeout(this.rr),this.rr=void 0}ar(){var e={};return st(this.tr,t=>{var i,s=(t?t.batchKey:null)||t.url;Y(e[s])&&(e[s]=y({},t,{data:[]})),null==(i=e[s].data)||i.push(t.data)}),this.tr=[],e}}var nD=["retriesPerformedSoFar"];class nq{constructor(e){this.ur=!1,this.hr=3e3,this.tr=[],this._instance=e,this.tr=[],this.dr=!0,!Y(s)&&"onLine"in s.navigator&&(this.dr=s.navigator.onLine,this.vr=()=>{this.dr=!0,this.cr()},this.pr=()=>{this.dr=!1},sl(s,"online",this.vr),sl(s,"offline",this.pr))}get length(){return this.tr.length}retriableRequest(e){var t=e.retriesPerformedSoFar,i=b(e,nD);ei(t)&&(i.url=nP(i.url,{retry_count:t})),this._instance._send_request(y({},i,{callback:e=>{if(200!==e.statusCode&&(400>e.statusCode||e.statusCode>=500)){if((0===e.statusCode?3:10)>(null!=t?t:0))return void this.At(y({retriesPerformedSoFar:t},i));0===e.statusCode&&t1.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)}}))}At(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.tr.push({retryAt:n,requestOptions:e});var a="Enqueued failed request for retry in "+r;navigator.onLine||(a+=" (Browser is offline)"),t1.warn(a),this.ur||(this.ur=!0,this.gr())}gr(){if(this.mr&&clearTimeout(this.mr),0===this.tr.length)return this.ur=!1,void(this.mr=void 0);this.mr=setTimeout(()=>{this.dr&&this.tr.length>0&&this.cr(),this.gr()},this.hr)}cr(){var e=Date.now(),t=[],i=this.tr.filter(i=>e>i.retryAt||(t.push(i),!1));if(this.tr=t,i.length>0)for(var s of i)this.retriableRequest(s.requestOptions)}unload(){for(var e of(this.mr&&(clearTimeout(this.mr),this.mr=void 0),this.ur=!1,Y(s)||(this.vr&&(s.removeEventListener("online",this.vr),this.vr=void 0),this.pr&&(s.removeEventListener("offline",this.pr),this.pr=void 0)),this.tr)){var t=e.requestOptions;try{this._instance._send_request(y({},t,{transport:"sendBeacon"}))}catch(e){t1.error(e)}}this.tr=[]}}class nj{constructor(e){this.yr=()=>{this.br||(this.br={});var e,t,i,s,r=this.scrollElement(),n=this.scrollY(),a=r?Math.max(0,r.scrollHeight-r.clientHeight):0,o=n+((null==r?void 0:r.clientHeight)||0),l=(null==r?void 0:r.scrollHeight)||0;this.br.lastScrollY=Math.ceil(n),this.br.maxScrollY=Math.max(n,null!==(e=this.br.maxScrollY)&&void 0!==e?e:0),this.br.maxScrollHeight=Math.max(a,null!==(t=this.br.maxScrollHeight)&&void 0!==t?t:0),this.br.lastContentY=o,this.br.maxContentY=Math.max(o,null!==(i=this.br.maxContentY)&&void 0!==i?i:0),this.br.maxContentHeight=Math.max(l,null!==(s=this.br.maxContentHeight)&&void 0!==s?s:0)},this._instance=e}get _r(){return this._instance.config.scroll_root_selector}getContext(){return this.br}resetContext(){var e=this.br;return setTimeout(this.yr,0),e}startMeasuringScrollPosition(){sl(s,"scroll",this.yr,{capture:!0}),sl(s,"scrollend",this.yr,{capture:!0}),sl(s,"resize",this.yr)}scrollElement(){if(!this._r)return null==s?void 0:s.document.documentElement;for(var e of G(this._r)?this._r:[this._r]){var t=null==s?void 0:s.document.querySelector(e);
1if(t)return t}}wr(e){if(this._r){var t=this.scrollElement();return t&&t["y"===e?"scrollTop":"scrollLeft"]||0}return s?"y"===e?s.scrollY||s.pageYOffset||s.document.documentElement.scrollTop||0:s.scrollX||s.pageXOffset||s.document.documentElement.scrollLeft||0:0}scrollY(){return this.wr("y")}scrollX(){return this.wr("x")}}var nH=e=>rA(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 nB{constructor(e,t,i,s){this.kr=e=>{var t=this.Sr();if(!t||t.sessionId!==e){var i={sessionId:e,props:this.Cr(this._instance)};this.Mr.register({[iH]:i})}},this._instance=e,this.Tr=t,this.Mr=i,this.Cr=s||nH,this.Tr.onSessionId(this.kr)}Sr(){return this.Mr.props[iH]}getSetOnceProps(){var e,t=null==(e=this.Sr())?void 0:e.props;return t?"r"in t?rN(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 st(sa(this.getSetOnceProps()),(t,i)=>{"$current_url"===i&&(i="url"),e["$session_entry_"+H(i)]=t}),e}}class nz{on(e,t){return this.Er[e]||(this.Er[e]=[]),this.Er[e].push(t),()=>{this.Er[e]=this.Er[e].filter(e=>e!==t)}}emit(e,t){for(var i of this.Er[e]||[])i(t);for(var s of this.Er["*"]||[])s(e,t)}constructor(){this.Er={}}}var nU=t2("[SessionId]");class nV{on(e,t){return this.Ir.on(e,t)}constructor(e,t,i){if(this.Pr=null,this.Rr=[],this.Ar=void 0,this.Fr=!1,this.Ir=new nz,this.Lr=(e,t)=>!(!ei(e)||!ei(t))&&Math.abs(e-t)>this.sessionTimeoutMs,!e.persistence)throw Error("SessionIdManager requires a PostHogPersistence instance");if(e.config.cookieless_mode===i0)throw Error('SessionIdManager cannot be used with cookieless_mode="always"');this.Ne=e.config,this.Mr=e.persistence,this.Or=void 0,this.Dr=void 0,this._sessionStartTimestamp=null,this.$r=void 0,this._sessionActivityTimestamp=null,this.Nr=t||sy,this.qr=i||sy;var s,r=this.Ne.persistence_name||this.Ne.token;if(this._sessionTimeoutMs=1e3*ev(this.Ne.session_idle_timeout_seconds||1800,60,36e3,nU.createLogger("session_idle_timeout_seconds"),1800),e.register({$configured_session_timeout_ms:this._sessionTimeoutMs}),this.jr(),this.Br="ph_"+r+"_window_id",this.Hr="ph_"+r+"_primary_window_exists",this.Ur()){var n=sR.H(this.Br),a=sR.H(this.Hr);n&&!a?this.Or=n:sR.q(this.Br),sR.F(this.Hr,!0)}null!=(s=this.Ne.bootstrap)&&s.sessionID&&this.setBootstrapSessionId(this.Ne.bootstrap.sessionID),this.zr()}get sessionTimeoutMs(){return this._sessionTimeoutMs}onSessionId(e){return Y(this.Rr)&&(this.Rr=[]),this.Rr.push(e),this.Dr&&e(this.Dr,this.Or),()=>{this.Rr=this.Rr.filter(t=>t!==e)}}Ur(){return"memory"!==this.Ne.persistence&&!this.Mr.xi&&sR.N()}Wr(e){e!==this.Or&&(this.Or=e,this.Ur()&&sR.F(this.Br,e))}Vr(){return this.Or?this.Or:this.Ur()?sR.H(this.Br):null}Zr(e){var t=this.Pr;return!Z(t)&&!Z(e)&&5e3>Math.abs(e-t)}Gr(e,t,i){var s=t!==this._sessionActivityTimestamp,r=!(e!==this.Dr||i!==this._sessionStartTimestamp);this._sessionStartTimestamp=i,this._sessionActivityTimestamp=t,this.Dr=e,r&&!s||r&&this.Zr(t)||(this.Pr=t,this.Mr.register({[i_]:[t,e,i]}))}Qr(){var e,t=null==(e=this.Ne)?void 0:e.persistence_save_debounce_ms;return ei(t)&&t>0}Kr(){this.Qr()?this.Mr.refreshKey(i_):(this.Mr.flush(),this.Mr.load())}Jr(){var e;if(!Z(this._sessionActivityTimestamp)&&this._sessionActivityTimestamp!==this.Pr){this.Kr();var t=this.Yr();t[1]===this.Dr&&t[2]===this._sessionStartTimestamp&&(this.Pr=this._sessionActivityTimestamp,this.Mr.register({[i_]:[this._sessionActivityTimestamp,null!==(e=this.Dr)&&void 0!==e?e:null,this._sessionStartTimestamp]}),this.Mr.flush())}}Xr(){var e=this.Yr()[0];return Math.max(ei(e)?e:0,ei(this._sessionActivityTimestamp)?this._sessionActivityTimestamp:0)}tn(e){return this.Kr(),this.Lr(e,this.Xr())}Yr(){var e=this.Mr.props[i_];return G(e)&&2===e.length&&e.push(e[0]),e||[0,null,0]}resetSessionId(){this.Pr=null,this.$r=void 0,clearTimeout(this.en),this.en=void 0,this.Gr(null,null,null)}setBootstrapSessionId(e,t){void 0===t&&(t=!1);var i=function(e,t){void 0===t&&(t=new Date().getTime());try{var i=(e=>{var t=e.replace(/-/g,"");if(32!==t.length)throw Error("Not a valid UUID");if("7"!==t[12])throw Error("Not a UUIDv7");return parseInt(t.substring(0,12),16)})(e);return i>t+6e4?void nU.error("Bootstrap sessionID cannot be in the future"):i}catch(e){return void nU.error("Invalid sessionID in bootstrap",e)}}(e);return!Y(i)&&(t?this.$r={sessionId:e,sessionStartTimestamp:i}:this.Gr(e,new Date().getTime(),i),!0)}destroy(){this.Fr=!0,this.Jr(),clearTimeout(this.en),this.en=void 0,this.Ar&&s&&(s.removeEventListener(i6,this.Ar,{capture:!1}),this.Ar=void 0),this.Rr=[]}zr(){this.Ar=()=>{this.Jr(),this.Ur()&&sR.q(this.Hr)},sl(s,i6,this.Ar,{capture:!1})}
1checkAndGetSessionAndWindowId(e,t){if(void 0===e&&(e=!1),void 0===t&&(t=null),this.Ne.cookieless_mode===i0)throw Error('checkAndGetSessionAndWindowId should not be called with cookieless_mode="always"');var i=t||new Date().getTime(),s=this.Yr(),r=s[1],n=s[2],a=this.Xr(),o=this.Vr(),l=this.$r,u=!!l&&(l.sessionStartTimestamp>i+6e4||i-l.sessionStartTimestamp>864e5),h=l?u:ei(n)&&Math.abs(i-n)>864e5,c=!1,d=!1,p=!r||!!l,v=r,g=!p&&!e&&this.Lr(i,a);if(g){(g=this.tn(i))||nU.info("cross-tab refresh kept the session alive",{sessionId:r});var f=this.Yr();r=f[1],n=f[2]}if(p||g||h){var _=l&&!u;r=_?l.sessionId:this.Nr(),o=this.qr(),nU.info("new session ID assigned",{sessionId:r,windowId:o,bootstrapped:!!_,changeReason:{noSessionId:p,activityTimeout:g,sessionPastMaximumLength:h}}),n=_?l.sessionStartTimestamp:i,this.$r=void 0,c=!0}else o||(o=this.qr(),c=!0),(d=r!==v)&&(nU.info("adopted cross-tab session id",{sessionId:r,windowId:o}),c=!0);var m=ei(a)&&e&&!h?a:i,y=ei(n)?n:new Date().getTime();this.Wr(o),this.Gr(r,m,y),e||this.jr();var b={noSessionId:p,activityTimeout:g,sessionPastMaximumLength:h,crossTabAdoption:d};return c&&this.Rr.forEach(e=>e(r,o,b)),{sessionId:r,windowId:o,sessionStartTimestamp:y,changeReason:c?b:void 0,lastActivityTimestamp:a}}jr(){this.Fr||(clearTimeout(this.en),this.en=setTimeout(()=>{if(!this.Fr){if(this.tn(new Date().getTime())){var e=this.Dr;this.resetSessionId(),this.Ir.emit("forcedIdleReset",{idleSessionId:e})}else this.jr()}},1.1*this.sessionTimeoutMs))}}var nG=function(e,t){if(!e)return!1;var i=e.userAgent;if(i&&D(i,t))return!0;try{var s=null==e?void 0:e.userAgentData;if(null!=s&&s.brands&&s.brands.some(e=>D(null==e?void 0:e.brand,t)))return!0}catch(e){}return!!e.webdriver};function nW(){return(nW=m(function*(){var e=null==n?void 0:n.userAgentData;if(null!=e&&e.getHighEntropyValues)try{var t=yield e.getHighEntropyValues(["model"]),i=null==t?void 0:t.model;return Q(i)&&i.length>0?i:void 0}catch(e){return void t1.info("Unable to resolve $device_model from userAgentData.getHighEntropyValues",e)}})).apply(this,arguments)}var nK=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 nJ(e,t,i){return r_({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=>nK(t,e))),not_regex:(e,t)=>t.every(t=>e.every(e=>!nK(t,e))),icontains:(e,t)=>t.map(nQ).some(t=>e.map(nQ).some(e=>t.includes(e))),not_icontains:(e,t)=>t.map(nQ).every(t=>e.map(nQ).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))})},nQ=e=>e.toLowerCase();function nX(e,t){return!e||Object.entries(e).every(e=>{var i=e[1],s=null==t?void 0:t[e[0]];if(Y(s)||Z(s))return!1;var r=[String(s)],n=nY[i.operator];return!!n&&n(i.values,r)})}var nZ="custom",n0="i.posthog.com",n1=/^\/static\//,n2=["/s/","/e/","/i/"];class n3{constructor(e){this.rn={},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("."+n0,".posthog.com")),"https://app.posthog.com"===t?"https://us.posthog.com":t}get region(){return this.rn[this.apiHost]||(this.rn[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":nZ),this.rn[this.apiHost]}nn(e){if(n1.test(e)){var t=this.instance.config.asset_host;if("string"==typeof t)return t.trim().replace(/\/$/,"")||void 0}}sn(e){var t=rm(e);return t?t.protocol+"//"+t.host+t.pathname:void 0}an(e,t,i){if("ui"===e)return i;var s=i,r=this.instance.config.rewriteRequestPath;
1if(r&&(s=r(new URL((null==(a=rm(i))?void 0:a.href)||i)).toString()),r&&"api"===e&&n2.some(e=>0===t.indexOf(e))){var n=this.sn(s);if(n){var a,o,l=this.apiHost,u=this.ln;(null==(o=u)?void 0:o.apiHost)===l&&u.rewriteRequestPath===r||(u={apiHost:l,rewriteRequestPath:r,urls:new Set},this.ln=u),u.urls.add(n)}}return s}isIngestionEndpoint(e){var t=this.ln,i=this.sn(e);return(null==t?void 0:t.apiHost)===this.apiHost&&t.rewriteRequestPath===this.instance.config.rewriteRequestPath&&!!i&&t.urls.has(i)}endpointFor(e,t){if(void 0===t&&(t=""),t&&(t="/"===t[0]?t:"/"+t),"ui"===e)return this.an(e,t,this.uiHost+t);if("flags"===e)return this.an(e,t,this.flagsApiHost+t);if("assets"===e){var i=this.nn(t);if(i)return this.an(e,t,""+i+t)}if(this.region===nZ)return this.an(e,t,this.apiHost+t);var s=n0+t;switch(e){case"assets":return this.an(e,t,"https://"+this.region+"-assets."+s);case"api":return this.an(e,t,"https://"+this.region+"."+s)}}}function n5(e){var t;return!(null==(t=e.conditions)||null==(t=t.events)||null==(t=t.values)||!t.length)}var n6=t2("[Surveys]"),n4="seenSurvey_",n8=e=>{try{let i;var t=(i=e,""+n4+function(e){return e.current_iteration&&e.current_iteration>0?e.id+"_"+e.current_iteration:e.id}(i));if(localStorage.getItem(t))return;localStorage.setItem(t,"true")}catch(e){n6.error("Failed to persist survey seen state",e)}},n9=[rV.Popover,rV.Widget,rV.API],n7={ignoreConditions:!1,ignoreDelay:!1,displayType:rK.Popover},ae=t2("[PostHog ExternalIntegrations]"),at={intercom:"intercom-integration",crispChat:"crisp-chat-integration"};class ai{constructor(e){this._instance=e}ai(e,t){var i;null==(i=g.__PosthogExtensions__)||null==i.loadExternalDependency||i.loadExternalDependency(this._instance,e,e=>{if(e)return ae.error("failed to load script",e);t()})}startIfEnabledOrStop(){var e,t=this;for(var i of Object.entries(null!==(e=this._instance.config.integrations)&&void 0!==e?e:{}))!function(){var e,s,r,n=i[0],a=i[1];!a||null!=(e=g.__PosthogExtensions__)&&null!=(e=e.integrations)&&e[n]||t.ai(at[n],()=>{var e;null==(e=g.__PosthogExtensions__)||null==(e=e.integrations)||null==(e=e[n])||e.start(t._instance)}),!a&&null!=(s=g.__PosthogExtensions__)&&null!=(s=s.integrations)&&s[n]&&(null==(r=g.__PosthogExtensions__)||null==(r=r.integrations)||null==(r=r[n])||r.stop())}()}}class as{constructor(e,t){this.rt=e,this.un=t,this.hn=new Map,this.dn=!1}add(e){var t=this;return m(function*(){if(t.dn)throw Error("Cannot add an extension to a disposed ExtensionRuntime");if(t.hn.has(e.name))throw Error('Browser extension "'+e.name+'" is already registered');t.hn.set(e.name,e);try{var i=e.setup(t.un);i&&(yield i)}catch(i){var s=t.hn.get(e.name)===e;s&&t.hn.delete(e.name),t.rt.error('Failed to set up browser extension "'+e.name+'"',i),s&&t.vn(e)}})()}dispose(){if(!this.dn){this.dn=!0;var e=Array.from(this.hn.values()).reverse();for(var t of(this.hn.clear(),e))this.vn(t)}}vn(e){try{var t=null==e.dispose?void 0:e.dispose();t&&W(t.then)&&t.then(void 0,t=>{this.rt.error('Failed to dispose browser extension "'+e.name+'"',t)})}catch(t){this.rt.error('Failed to dispose browser extension "'+e.name+'"',t)}}}class ar{constructor(e){this._instance=e}initialize(){}get(e){var t=this._instance.persistence;if("string"==typeof e)return null==t?void 0:t.get_property(e);var i={};for(var s of e){var r=null==t?void 0:t.get_property(s);Y(r)||(i[s]=r)}return i}set(e,t){var i;null==(i=this._instance.persistence)||i.register("string"==typeof e?{[e]:t}:e)}remove(e){var t;null==(t=this._instance.persistence)||t.unregister(e)}}var an="extensionsRemoteConfig";class aa{constructor(e){this.dn=!1,this.instance=e,this.rt=t1,this.cn=e.fn,this.kv=new ar(e),this.onEvent=e=>rB(this.instance.on("eventCaptured",t=>{try{e({event:t.event,properties:t.properties})}catch(e){this.rt.error("Browser extension event listener failed",e)}})),this.onRemoteConfig=e=>{if(this.dn)return rB(()=>{});var t=t=>{try{e(t)}catch(e){this.rt.error("Browser extension remote config listener failed",e)}},i=this.instance.pn.on(an,t);return this.cn&&t(this.cn),rB(i)},this.gn=new as(t1.createLogger("[BrowserExtensions]"),this)}get logger(){return this.rt}get distinctId(){return this.instance.get_distinct_id()}get anonymousId(){var e;return null!==(e=this.instance.get_property(t4))&&void 0!==e?e:this.distinctId}get deviceId(){var e=this.instance.get_property(t4);return"string"==typeof e?e:void 0}get library(){return{name:f.LIB_NAME,version:f.LIB_VERSION}}get initialPersonProperties(){var e,t;return null!==(e=null==(t=this.instance.persistence)?void 0:t.get_initial_props())&&void 0!==e?e:{}}get groups(){return this.instance.getGroups()}get session(){try{var e,t,i,s,r=null==(e=this.instance.sessionManager)?void 0:e.checkAndGetSessionAndWindowId(!0);return{sessionId:null!==(t=null==r?void 0:r.sessionId)&&void 0!==t?t:"",windowId:null!==(i=null==r?void 0:r.windowId)&&void 0!==i?i:"",sessionStartTimestamp:null!==(s=null==r?void 0:r.sessionStartTimestamp)&&void 0!==s?s:0}}catch(e){return{sessionId:"",windowId:"",sessionStartTimestamp:0}}}get projectToken(){return this.instance.config.token}add(e){return this.gn.add(e)}capture(e,t,i){var s=this;return m(function*(){i?s.instance.capture(e,t,{timestamp:i.timestamp,uuid:i.uuid,$set:i.set,$set_once:i.setOnce}):s.instance.capture(e,t)})()}registerDynamicEventProperties(e){return rB(this.instance.mn(e))}handleRemoteConfig(e){this.dn||(this.cn=e,this.instance.pn.emit(an,e))}sendRequest(e,t){var i=this;return m(function*(){void 0===t&&(t={});var s,r=i.instance.requestRouter.endpointFor(null!==(s=t.target)&&void 0!==s?s:"api",e),n={method:t.method,url:t.query?nP(r,t.query):r,data:t.body,headers:t.headers,timeout:t.timeoutMs,fireCallbackOnDrop:!0,transport:t.transport,compression:t.compression,timestampMode:t.sentAt};return"sendBeacon"===t.transport?(i.instance._send_request(n),{statusCode:202}):new Promise(e=>{n.callback=e,i.instance._send_request(n)})})()}dispose(){this.dn||(this.dn=!0,this.gn.dispose())}}var ao={},al=0,au=()=>{}
1,ah='Consent opt in/out is not valid with cookieless_mode="always" and will be ignored',ac="Surveys module not available",ad="sanitize_properties is deprecated. Use before_send instead",ap="Invalid value for property_denylist config: ",av=["token","distinct_id",iK],ag="posthog",af=!nx&&-1===(null==d?void 0:d.indexOf("MSIE"))&&-1===(null==d?void 0:d.indexOf("Mozilla")),a_=e=>{var t;return y({api_host:"https://us.i.posthog.com",flags_api_host:null,ui_host:null,asset_host:null,token:"",autocapture:!0,cross_subdomain_cookie:function(e){var t=null==e?void 0:e.hostname;if(!Q(t))return!1;var i=t.split(".").slice(-2).join(".");for(var s of so)if(i===s)return!1;return!0}(null==a?void 0:a.location),persistence:"localStorage+cookie",persistence_name:"",cookie_persisted_properties:[],loaded:au,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&&Q(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,disableDeviceModel:!1,disable_external_dependency_loading:!1,strict_script_versioning:!1,enable_recording_console_log:void 0,secure_cookie:"https:"===(null==s||null==(t=s.location)?void 0:t.protocol),ip:!1,opt_out_capturing_by_default:!1,opt_out_persistence_by_default:!1,opt_out_useragent_filter:!1,opt_out_capturing_persistence_type:"localStorage",consent_persistence_name:null,opt_out_capturing_cookie_prefix:null,opt_in_site_apps:!1,property_denylist:[],respect_dnt:!1,sanitize_properties:null,request_headers:{},request_batching:!0,properties_string_max_length:65535,mask_all_element_attributes:!1,mask_all_text:!1,mask_personal_data_properties:!1,custom_personal_data_properties:[],advanced_disable_flags:!1,advanced_disable_decide:!1,advanced_disable_feature_flags:!1,advanced_disable_feature_flags_on_first_load:!1,advanced_only_evaluate_survey_feature_flags:!1,advanced_feature_flags_dedup_per_session:!1,advanced_enable_surveys:!1,advanced_disable_toolbar_metrics:!1,feature_flag_request_timeout_ms:3e3,surveys_request_timeout_ms:1e4,on_request_error(e){t1.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:i3,before_send:void 0,get_current_url:void 0,request_queue_config:{flush_interval_ms:3e3},error_tracking:{},_onCapture:au},(e=>({rageclick:e&&e>="2026-05-30"?{content_ignorelist:sY,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)}))(e))},am=[["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"]],ay=e=>{var t={};for(var i of am){var s=i[0],r=i[1];Y(e[s])||(t[r]=e[s])}var n=si({},t,e),a=e.__preview_external_dependency_versioned_paths;return Y(a)||(Y(e.strict_script_versioning)&&(n.strict_script_versioning=!!a),Q(a)&&Y(e.asset_host)&&(n.asset_host=a)),G(e.property_blacklist)&&(Y(e.property_denylist)?n.property_denylist=e.property_blacklist:G(e.property_denylist)?n.property_denylist=[...e.property_blacklist,...e.property_denylist]:t1.error(ap+e.property_denylist)),n};class ab{constructor(){this.__forceAllowLocalhost=!1}get yn(){return this.__forceAllowLocalhost}set yn(e){t1.error("WebPerformanceObserver is deprecated and has no impact on network capture. Use `_forceAllowLocalhostNetworkCapture` on `posthog.sessionRecording`"),this.__forceAllowLocalhost=e}}class aw{bn(e,t){if(e){var i=this.hn.indexOf(e);-1!==i&&this.hn.splice(i,1)}return this.hn.push(t),null==t.initialize||t.initialize(),t}_n(){return this.config.cookieless_mode===i0||this.config.cookieless_mode===iZ&&this.consent.isRejected()}get decideEndpointWasHit(){var e,t;return null!==(e=null==(t=this.featureFlags)?void 0:t.hasLoadedFlags)&&void 0!==e&&e}get flagsEndpointWasHit(){var e,t;return null!==(e=null==(t=this.featureFlags)?void 0:t.hasLoadedFlags)&&void 0!==e&&e}constructor(){this.webPerformance=new ab,this.wn=!1,this.version=f.LIB_VERSION,this.kn=new Set,this.xn="",this.pn=new nz,this.hn=[],this.Sn=[],this._calculate_event_properties=this.calculateEventProperties.bind(this),this.config=a_(),this.SentryIntegration=rc,this.sentryIntegration=e=>(function(e,t){var i=rh(e,t);return{name:ru,processEvent:e=>i(e)}})(this,e),this.__request_queue=[],this.__loaded=!1,this.analyticsDefaultEndpoint="/e/",this.Cn=!1,this.Mn=null,this.Tn=null,this.En=null,this.scrollManager=new nj(this),this.pageViewManager=new rd(this),this.rateLimiter=new rX(this),this.requestRouter=new n3(this),this.consent=new sM(this),this.externalIntegrations=new ai(this);var e,t=null!==(e=aw.__defaultExtensionClasses)&&void 0!==e?e:{};this.featureFlags=t.featureFlags&&new t.featureFlags(this),this.toolbar=t.toolbar&&new t.toolbar(this),this.surveys=t.surveys&&new t.surveys(this),this.conversations=t.conversations&&new t.conversations(this),this.logs=t.logs&&new t.logs(this),this.metrics=t.metrics&&new t.metrics(this),this.experiments=t.experiments&&new t.experiments(this),this.exceptions=t.exceptions&&new t.exceptions(this),this.people={set:(e,t,i)=>{var s=Q(e)?{[e]:t}:e;this.setPersonProperties(s),null==i||i({})},set_once:(e,t,i)=>{var s=Q(e)?{[e]:t}:e;this.setPersonProperties(void 0,s),null==i||i({})}},this.on("eventCaptured",e=>t1.info('send "'+(null==e?void 0:e.event)+'"',e))}init(e,t,i){if(i&&i!==ag){var s,r=null!==(s=ao[i])&&void 0!==s?s:new aw;return r._init(e,t,i),ao[i]=r,ao[ag][i]=r,r}return this._init(e,t,i)}_init(e,t,i){void 0===t&&(t={});var r,n,a,o=Q(e)?e.trim():"";if(!o)return t1.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 o!==(null==(a=this.config)?void 0:a.token)?console.warn("[PostHog.js]","You have already initialized PostHog with a different project token! Re-initializing is a no-op, so events will keep going to the project this instance was initialized with. To capture into a second project, load PostHog once, then initialize a named instance after the SDK has loaded, e.g. posthog.init('"+o+"', { ... }, 'project2')"):console.warn("[PostHog.js]","You have already initialized PostHog! Re-initializing is a no-op"),this;this.__loaded=!0,this.config=a_(t.defaults),t.debug=this.In(t.debug),this.Pn=t,this.Rn=[],t.person_profiles?this.Tn=t.person_profiles:t.process_person&&(this.Tn=t.process_person);var l=a_(t.defaults),u=ay(t),h=si({},l,u,{name:i,token:o});K(l.rageclick)&&K(u.rageclick)&&(h.rageclick=si({},l.rageclick,u.rageclick)),K(l.session_recording)&&K(u.session_recording)&&(h.session_recording=si({},l.session_recording,u.session_recording)),this.set_config(h),this.config.on_xhr_error&&t1.error("on_xhr_error is deprecated. Use on_request_error instead"),this.compression=t.disable_compression?void 0:rz.GZipJS;var c=this.An();if(this.persistence=new rH(this.config,c),this.sessionPersistence="sessionStorage"===this.config.persistence||"memory"===this.config.persistence?this.persistence:new rH(y({},this.config,{persistence:"sessionStorage"}),c,!1),this.xn="ph_"+(this.config.persistence_name||this.config.token)+"_session_registered_properties","memory"!==this.config.persistence&&!c&&sR.N()){var d=sR.H(this.xn);
1G(d)&&d.forEach(e=>{Q(e)&&this.kn.add(e)})}else sR.q(this.xn);var p=y({},this.persistence.props),v=y({},this.sessionPersistence.props);this.register({$initialization_time:new Date().toISOString()}),this.Fn=new nL(e=>this.Ln(e),this.config.request_queue_config),this.On=new nq(this),this.__request_queue=[];var g=this._n();if(g||(this.sessionManager=new nV(this),this.sessionPropsManager=new nB(this,this.sessionManager,this.persistence),this.sessionManager.onSessionId((e,t,i)=>{(null!=i&&i.activityTimeout||null!=i&&i.sessionPastMaximumLength||null!=i&&i.crossTabAdoption)&&this.Dn()})),this.$n(),this.config.__preview_deferred_init_extensions?(t1.info("Deferring extension initialization to improve startup performance"),setTimeout(()=>{this.Nn(g)},0)):(t1.info("Initializing extensions synchronously"),this.Nn(g)),f.DEBUG=f.DEBUG||this.config.debug,f.DEBUG&&t1.info("Starting in debug mode",{this:this,config:t,thisC:y({},this.config),p:p,s:v}),!this.config.identity_distinct_id||null!=(r=t.bootstrap)&&r.distinctID||(t.bootstrap=y({},t.bootstrap,{distinctID:this.config.identity_distinct_id,isIdentifiedID:!0})),void 0!==(null==(n=t.bootstrap)?void 0:n.distinctID)){var _=t.bootstrap.distinctID,m=this.get_distinct_id(),b=this.persistence.get_property(ij);if(t.bootstrap.isIdentifiedID&&null!=m&&m!==_&&b===i1)this.identify(_);else if(t.bootstrap.isIdentifiedID&&null!=m&&m!==_&&b===i2)t1.warn("Bootstrap distinctID differs from an already-identified user. The existing identity is preserved. Call reset() before reinitializing if you intend to switch users.");else{var w=this.config.get_device_id(sy()),x=t.bootstrap.isIdentifiedID?w:_;this.persistence.set_property(ij,t.bootstrap.isIdentifiedID?i2:i1),this.register({distinct_id:_,$device_id:x})}}if(g)this.register_once({distinct_id:iW,$device_id:null},"");else if(!this.get_distinct_id()){var E=this.config.get_device_id(sy());this.register_once({distinct_id:E,$device_id:E},""),this.persistence.set_property(ij,i1)}return sl(s,"onpagehide"in self?"pagehide":"unload",this._handle_unload.bind(this),{passive:!1}),t.segment?function(e,t){var i=e.config.segment;if(!i)return t();!function(e,t){var i=e.config.segment;if(!i)return t();var s=i=>{var s=()=>i.anonymousId()||sy();e.config.get_device_id=s,i.id()&&(e.register({distinct_id:i.id(),$device_id:s()}),e.persistence.set_property(ij,i2)),t()},r=i.user();"then"in r&&W(r.then)?r.then(s):s(r)}(e,()=>{var s;i.register(("undefined"!=typeof Promise&&Promise.resolve||rl.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()||(rl.info("No userId set, resetting PostHog"),e.reset()),t.event.userId&&t.event.userId!==e.get_distinct_id()&&(rl.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,i4),identify:e=>s(e,i9),screen:e=>s(e,"$screen")})).then(()=>{t()})})}(this,()=>this.qn()):this.qn(),W(this.config._onCapture)&&this.config._onCapture!==au&&(t1.warn("onCapture is deprecated. Please use `before_send` instead"),this.on("eventCaptured",e=>this.config._onCapture(e.event,e))),this.config.ip&&t1.warn('The `ip` config option has NO EFFECT AT ALL and has been deprecated. Use a custom transformation or "Discard IP data" project setting instead. See https://posthog.com/tutorials/web-redact-properties#hiding-customer-ip-address for more information.'),this.config.disableDeviceModel||(function(){return nW.apply(this,arguments)})().then(e=>{e&&this.register({[t8]:e})}).catch(au),this}$n(){var e,t,i,s,r,n,a=null!==(e=null==(t=this.config.__extensionClasses)?void 0:t.featureFlags)&&void 0!==e?e:null==(i=aw.__defaultExtensionClasses)?void 0:i.featureFlags;a&&(this.featureFlags&&this.featureFlags instanceof a||(null==(s=this.jn)||s.call(this),this.jn=void 0,this.featureFlags=new a(this)),W(this.featureFlags.onReloading)&&W(this.featureFlags.setup)?this.jn||(this.jn=this.featureFlags.onReloading(()=>
vendor: 4,845 bytes, line 1
1{this.pn.emit("featureFlagsReloading",!0)}),this.Bn().add(this.featureFlags)):null==(r=(n=this.featureFlags).initialize)||r.call(n))}Nn(e){var t,i,s,r,n,a,o,l=performance.now(),u=y({},aw.__defaultExtensionClasses,this.config.__extensionClasses),h=[];u.exceptions&&this.hn.push(this.exceptions=null!==(t=this.exceptions)&&void 0!==t?t:new u.exceptions(this)),u.historyAutocapture&&this.hn.push(this.historyAutocapture=new u.historyAutocapture(this)),u.tracingHeaders&&this.hn.push(this.tracingHeaders=new u.tracingHeaders(this)),u.siteApps&&this.hn.push(this.siteApps=new u.siteApps(this)),u.sessionRecording&&!e&&this.hn.push(this.sessionRecording=new u.sessionRecording(this)),this.config.disable_scroll_properties||h.push(()=>{this.scrollManager.startMeasuringScrollPosition()}),u.autocapture&&this.hn.push(this.autocapture=new u.autocapture(this)),u.surveys&&this.hn.push(this.surveys=null!==(i=this.surveys)&&void 0!==i?i:new u.surveys(this)),u.logs&&this.hn.push(this.logs=null!==(s=this.logs)&&void 0!==s?s:new u.logs(this)),u.metrics&&this.hn.push(this.metrics=null!==(r=this.metrics)&&void 0!==r?r:new u.metrics(this)),u.conversations&&this.hn.push(this.conversations=null!==(n=this.conversations)&&void 0!==n?n:new u.conversations(this)),u.productTours&&this.hn.push(this.productTours=new u.productTours(this)),u.heatmaps&&this.hn.push(this.heatmaps=new u.heatmaps(this)),u.webVitalsAutocapture&&this.hn.push(this.webVitalsAutocapture=new u.webVitalsAutocapture(this)),u.exceptionObserver&&this.hn.push(this.exceptionObserver=new u.exceptionObserver(this)),u.deadClicksAutocapture&&this.hn.push(this.deadClicksAutocapture=new u.deadClicksAutocapture(this,ra)),u.toolbar&&this.hn.push(this.toolbar=null!==(a=this.toolbar)&&void 0!==a?a:new u.toolbar(this)),u.experiments&&this.hn.push(this.experiments=null!==(o=this.experiments)&&void 0!==o?o:new u.experiments(this)),this.hn.forEach(e=>{e.initialize&&h.push(()=>{null==e.initialize||e.initialize()})}),h.push(()=>{if(this.Hn){var e=this.Hn;this.Hn=void 0,this.hn.forEach(t=>null==t.onRemoteConfig?void 0:t.onRemoteConfig(e))}}),this.Un(h,l)}Un(e,t){for(;e.length>0;){if(this.config.__preview_deferred_init_extensions&&performance.now()-t>=30&&e.length>0)return void setTimeout(()=>{this.Un(e,t)},0);var i=e.shift();if(i)try{i()}catch(e){t1.error("Error initializing extension:",e)}}var s=Math.round(performance.now()-t);this.register_for_session({[iJ]:this.config.__preview_deferred_init_extensions?"deferred":"synchronous",[iY]:s}),this.config.__preview_deferred_init_extensions&&t1.info("PostHog extensions initialized ("+s+"ms)")}Zi(e){var t;if(!a||!a.body)return t1.info("document not ready yet, trying again in 500 milliseconds..."),void setTimeout(()=>{this.Zi(e)},500);if(this.config.__preview_deferred_init_extensions&&(this.Hn=e),this.fn=e,this.compression=void 0,e.ok){var i,s=e.config;s.supportedCompression&&!this.config.disable_compression&&(this.compression=q(s.supportedCompression,rz.GZipJS)?rz.GZipJS:q(s.supportedCompression,rz.Base64)?rz.Base64:void 0),null!=(i=s.analytics)&&i.endpoint&&(this.analyticsDefaultEndpoint=s.analytics.endpoint)}this.set_config({person_profiles:this.Tn?this.Tn:i3}),null==(t=this.zn)||t.handleRemoteConfig(e),this.hn.forEach(t=>null==t.onRemoteConfig?void 0:t.onRemoteConfig(e))}qn(){try{this.config.loaded(this)}catch(e){t1.critical("`loaded` function failed",e)}if(this.Wn(),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._n())&&this.Vn()},1),this.Zn=new r0(this),this.Zn.load()}Wn(){var e;this.is_capturing()&&this.config.request_batching&&(null==(e=this.Fn)||e.enable())}_dom_loaded(){this.is_capturing()&&se(this.__request_queue,e=>this.Ln(e)),this.__request_queue=[],this.Wn()}_handle_unload(){var e,t,i,s,r;null==(e=this.surveys)||null==e.handlePageUnload||e.handlePageUnload(),null==(t=this.metrics)||t.flush("sendBeacon"),this.config.request_batching?(this.Gn()&&this.capture(i8),null==(i=this.logs)||i.flushLogs("sendBeacon"),null==(s=this.Fn)||s.unload(),null==(r=this.On)||r.unload()):this.Gn()&&this.capture(i8,null,{transport:"sendBeacon"})}_send_request(e){this.__loaded?af?this.__request_queue.push(e):this.rateLimiter.isServerRateLimited(e.batchKey)?e.fireCallbackOnDrop&&(null==e.callback||e.callback({statusCode:429})):(e.transport=e.transport||this.config.api_transport,e.headers=y({},this.config.request_headers,e.headers),e.compression="best-available"===e.compression?this.compression:e.compression,(Y(this.config.disable_beacon)?this.config.__preview_disable_beacon:this.config.disable_beacon)&&(e.disableTransport=["sendBeacon"]),e.fetchOptions=e.fetchOptions||this.config.fetch_options,
1(e=>{var t,i,s,r,n,a=y({},e);a.timeout=a.timeout||6e4;var o,l,u,h,d,p=null!==(s=a.transport)&&void 0!==s?s:"fetch";"sendBeacon"===p&&Y(a.compression)&&a.data&&(a.compression=rz.Base64),"POST"===a.method&&a.data&&("capture-body"===a.timestampMode?a.data={api_key:null!==(l=null==(d=(h=G(o=a.data)?o:[o])[0])||null==(u=d.properties)?void 0:u.token)&&void 0!==l?l:null==d?void 0:d.token,batch:h,sent_at:new Date().toISOString()}:"body"===a.timestampMode&&(a.data=(t=a.data,void 0===i&&(i=new Date().toISOString()),G(t)?t.map(e=>y({},e,{sent_at:i})):y({},t,{sent_at:i})))),a.url=nA(a.url,a.method,a.compression,a.timestampMode);var v=nN.filter(e=>!a.disableTransport||!e.transport||!a.disableTransport.includes(e.transport)),g=null!==(r=null==(n=function(e,t){for(var i=0;e.length>i;i++)if(e[i].transport===p)return e[i]}(v))?void 0:n.method)&&void 0!==r?r:v[0].method;if(!g)throw Error("No available transport method");var f=e=>{try{g(e)}catch(e){nC(e)?t1.warn(e):t1.error(e),null==a.callback||a.callback({statusCode:0,error:e})}};"sendBeacon"!==p&&a.data&&a.compression===rz.GZipJS&&c&&"undefined"!=typeof Promise&&!nk?nR(a).then(e=>{f(e)}).catch(t=>{if(T(t))return nk=!0,void f(y({},a,{compression:void 0,url:nA(e.url,e.method,void 0,e.timestampMode)}));(e=>{if(!e||"object"!=typeof e)return!1;var t="name"in e?String(e.name):"";return T(e)||t===R})(t)&&(nk=!0),f(a)}):g(a)})(y({},e,{callback:t=>{var i,s;this.rateLimiter.checkForLimiting(t),400>t.statusCode||null==(i=(s=this.config).on_request_error)||i.call(s,t),null==e.callback||e.callback(t)}}))):e.fireCallbackOnDrop&&(null==e.callback||e.callback({statusCode:0}))}Ln(e){this.On?this.On.retriableRequest(e):this._send_request(e)}_execute_array(e){al++;try{var t,i=[],s=[],r=[];se(e,e=>{if(e){if(G(t=e[0]))r.push(e);else if(W(e))try{e.call(this)}catch(t){t1.error("Error executing queued PostHog call",e,t)}else G(e)&&"alias"===t?i.push(e):G(e)&&-1!==t.indexOf("capture")&&W(this[t])?r.push(e):s.push(e)}});var n=function(e,t){se(e,function(e){try{if(G(e[0])){var i=t;st(e,function(e){i=i[e[0]].apply(i,e.slice(1))})}else t[e[0]].apply(t,e.slice(1))}catch(t){t1.error("Error executing queued PostHog call",e,t)}})};n(i,this),n(s,this),n(r,this)}finally{al--}}push(e){if(al>0&&G(e)&&Q(e[0])){var t=aw.prototype[e[0]];W(t)&&t.apply(this,e.slice(1))}else this._execute_array([e])}capture(e,t,i){var s,r,n,a,o;if(this.__loaded&&this.persistence&&this.sessionPersistence&&this.Fn){if(this.is_capturing()){if(!Y(e)&&Q(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&&!Q(null==t?void 0:t.$current_url)&&(t1.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.Qn||t1.warn("Using `posthog.capture('$exception')` is unreliable because it does not attach required metadata. Use `posthog.captureException(error)` instead, which attaches required metadata automatically."),this.sessionPersistence.update_search_keyword(),this.config.save_campaign_params&&this.sessionPersistence.update_campaign_params(),this.config.save_referrer&&this.sessionPersistence.update_referrer_info(),(this.config.save_campaign_params||this.config.save_referrer)&&this.persistence.set_initial_person_info();var h,c,d,p,v=new Date,g=(null==i?void 0:i.timestamp)||v,f=th(null==i?void 0:i.uuid,sy),_={uuid:f,event:e,properties:this.calculateEventProperties(e,t||{},g,f)};e===i4&&this.config.__preview_capture_bot_pageviews&&l&&(_.event="$bot_pageview",_.properties.$browser_type="bot"),u&&(_.properties.$lib_rate_limit_remaining_tokens=u.remainingTokens);var m="$feature_flag_called"===e&&!1===_.properties.$feature_flag_has_experiment&&!0===this.get_property(iS);(null==i?void 0:i.$set)&&!m&&(_.$set=null==i?void 0:i.$set);var b=null==i?void 0:i.$unset;b&&(_.$unset=b);var w,x,E,k=m?void 0:this.Kn(null==i?void 0:i.$set_once,e!==i7,e===i9);
1if(k&&(_.$set_once=k),null!=i&&i._noTruncate||(r=this.config.properties_string_max_length,n=_,a=e=>Q(e)?e.slice(0,r):e,o=new Set,_=function e(t,i){if(t!==Object(t))return a?a(t):t;if(!o.has(t)){var s;if(o.add(t),G(t))s=[],se(t,t=>{s.push(e(t))});else{var r={};st(t,(t,i)=>{o.has(t)||(r[i]=e(t,i))}),s=r}return s}}(n)),_.timestamp=g,Y(null==i?void 0:i.timestamp)||(_.properties.$event_time_override_provided=!0,_.properties.$event_time_override_system_time=v),m&&(_.properties=(h=_.properties,void 0===(c=av)&&(c=[]),d={},p=e=>{void 0!==h[e]&&(d[e]=h[e])},S.forEach(p),c.forEach(p),d)),e===rG.DISMISSED||e===rG.SENT){var P=null==t?void 0:t[rW.SURVEY_ID],F=null==t?void 0:t[rW.SURVEY_ITERATION];n8({id:P,current_iteration:F}),_.$set=y({},_.$set,{[(w={id:P,current_iteration:F},E="$survey_"+(x=e===rG.SENT?"responded":"dismissed")+"/"+w.id,w.current_iteration&&w.current_iteration>0&&(E="$survey_"+x+"/"+w.id+"/"+w.current_iteration),E)]:!0})}else e===rG.SHOWN&&(_.$set=y({},_.$set,{[rW.SURVEY_LAST_SEEN_DATE]:new Date().toISOString()}));if(e===rJ.SHOWN){var I=null==t?void 0:t[rY.TOUR_TYPE];I&&(_.$set=y({},_.$set,{[rY.TOUR_LAST_SEEN_DATE+"/"+I]:new Date().toISOString()}))}var $=y({},_.properties.$set,_.$set);if(J($)||this.setPersonPropertiesForFlags($),!ee(this.config.before_send)){var R=this.Pt(_);if(!R)return;(_=R).uuid=th(_.uuid,sy)}this.pn.emit("eventCaptured",_);var M=null!==(s=null==i?void 0:i._url)&&void 0!==s?s:this.requestRouter.endpointFor("api",this.analyticsDefaultEndpoint),C={method:"POST",url:M,data:_,compression:"best-available",timestampMode:"recordings"===(null==i?void 0:i._batchKey)||/\/s\/(?:\?|$)/.test(M)?"body":"capture-body",batchKey:null==i?void 0:i._batchKey,transport:null==i?void 0:i.transport};return!this.config.request_batching||i&&(null==i||!i._batchKey)||null!=i&&i.send_instantly?this.Ln(C):this.Fn.enqueue(C),_}t1.critical("This capture call is ignored due to client rate limiting.")}}else t1.error("No event name provided to posthog.capture")}}else t1.uninitializedWarning("posthog.capture")}_addCaptureHook(e){return this.on("eventCaptured",t=>e(t.event,t))}Bn(){var e;return null!==(e=this.zn)&&void 0!==e?e:this.zn=new aa(this)}mn(e){this.Sn.push(e);var t=!0;return()=>{if(t){t=!1;var i=this.Sn.indexOf(e);-1!==i&&this.Sn.splice(i,1)}}}calculateEventProperties(e,t,i,r,n){if(i=i||new Date,!this.persistence||!this.sessionPersistence)return t;var l,u=n?void 0:this.persistence.remove_event_timer(e),h=y({},t);if(h.token=this.config.token,h.$config_defaults=this.config.defaults,this._n()&&(h[iK]=!0),"$snapshot"===e){var c=y({},this.persistence.properties(),this.sessionPersistence.properties());return h.distinct_id=c.distinct_id,(!Q(h.distinct_id)&&!et(h.distinct_id)||X(h.distinct_id))&&t1.error("Invalid distinct_id for replay event. This indicates a bug in your implementation"),h}var p,v=function(e,t,i,r){if(void 0===r&&(r=!1),!d)return{};var n,a,l,u,h,c=e?[...rS,...t||[]]:[],p=function(e){for(var t=0;to.length>t;t++){var i=to[t],s=i[1],r=i[0].exec(e),n=r&&(W(s)?s(r,e):s);if(n)return n}return["",""]}(d),v=p[0],g=p[1],_=null!=(h="undefined"!=typeof navigator?navigator:void 0)&&h.brave?{brave:!0}:{},m={};Y(i)||(m.detectGoogleSearchApp=i);var y={},b=null==(n=navigator)||null==(n=n.userAgentData)?void 0:n.platform,w=null==(a=navigator)?void 0:a.maxTouchPoints,x=null==s||null==(l=s.screen)?void 0:l.width,E=null==s||null==(u=s.screen)?void 0:u.height,k=null==s?void 0:s.devicePixelRatio;Y(b)||(y.userAgentDataPlatform=b),Y(w)||(y.maxTouchPoints=w),Y(x)||(y.screenWidth=x),Y(E)||(y.screenHeight=E),Y(k)||(y.devicePixelRatio=k);var S,P,F,I,$,R,M=si(sa({$os:v,$os_version:g,$browser:tr(d,navigator.vendor,_,m),$device:tl(d),$device_type:(R=tl(d))===eb||R===ey||"Kobo"===R||"Kindle Fire"===R||R===eY?em:R===eq||R===eH||R===ej||R===eW?"Console":R===ex?"Wearable":R?ef:"Android"===(null==y?void 0:y.userAgentDataPlatform)&&(null!==(P=null==y?void 0:y.maxTouchPoints)&&void 0!==P?P:0)>0?600>Math.min(null!==(F=null==y?void 0:y.screenWidth)&&void 0!==F?F:0,null!==(I=null==y?void 0:y.screenHeight)&&void 0!==I?I:0)/(null!==($=null==y?void 0:y.devicePixelRatio)&&void 0!==$?$:1)?ef:em:"Desktop",$timezone:rL(),$timezone_offset:function(){try{return new Date().getTimezoneOffset()}catch(e){return}}()}),{$current_url:rb(r?tc(null==o?void 0:o.href):null==o?void 0:o.href,c,rF),$host:null==o?void 0:o.host,$pathname:null==o?void 0:o.pathname,$raw_user_agent:d.length>1e3?d.substring(0,997)+"...":d,$browser_version:ta(d,navigator.vendor,_,m),$browser_language:rC(),$browser_language_prefix:"string"==typeof(S=rC())?S.split("-")[0]:void 0,$screen_height:null==s?void 0:s.screen.height,$screen_width:null==s?void 0:s.screen.width,$viewport_height:null==s?void 0:s.innerHeight,$viewport_width:null==s?void 0:s.innerWidth,$lib:f.LIB_NAME,$lib_version:f.LIB_VERSION,$insert_id:Math.random().toString(36).substring(2,10)+Math.random().toString(36).substring(2,10),$time:Date.now()/1e3});return f.SDK_DIST_CHANNEL&&(M.$sdk_dist_channel=f.SDK_DIST_CHANNEL),M}(this.config.mask_personal_data_properties,this.config.custom_personal_data_properties,this.config.detect_google_search_app,this.config.disable_capture_url_hashes
vendor: 5,298 bytes, line 1
1);if(this.sessionManager){var g=this.sessionManager.checkAndGetSessionAndWindowId(n,i.getTime()),_=g.windowId;h.$session_id=g.sessionId,h.$window_id=_}this.sessionPropsManager&&si(h,this.sessionPropsManager.getSessionProps());try{this.sessionRecording&&si(h,this.sessionRecording.sdkDebugProperties),h.$sdk_debug_retry_queue_size=null==(l=this.On)?void 0:l.length}catch(e){h.$sdk_debug_error_capturing_properties=String(e)}if(this.requestRouter.region===nZ&&(h.$lib_custom_api_host=this.config.api_host),p=e!==i4||n?e!==i8||n?this.pageViewManager.doEvent():this.pageViewManager.doPageLeave(i):this.pageViewManager.doPageView(i,r),h=si(h,p),e===i4&&a&&(h.title=a.title),!Y(u)){var m=i.getTime()-u;h.$duration=parseFloat((m/1e3).toFixed(3))}d&&this.config.opt_out_useragent_filter&&(h.$browser_type=this._is_bot()?"bot":"browser");var b=this.persistence.properties(),w=this.sessionPersistence.properties();st(["$referrer","$referring_domain"],e=>{e in b&&delete w[e]});var x={};if(this.Sn.length>0)for(var E of this.Sn.slice())try{si(x,E())}catch(e){t1.error("Failed to produce browser extension event properties",e)}(h=si({},v,b,w,y({},x,h))).$is_identified=this._isIdentified(),G(this.config.property_denylist)?st(this.config.property_denylist,function(e){delete h[e]}):t1.error(ap+this.config.property_denylist+" or property_blacklist config: "+this.config.property_blacklist);var k=this.config.sanitize_properties;k&&(t1.error(ad),h=k(h,e));var S=this.Jn();return h.$process_person_profile=S,S&&!n&&this.Yn("_calculate_event_properties"),h}Kn(e,t,i){if(void 0===t&&(t=!0),void 0===i&&(i=!1),!this.persistence||!this.Jn()||this.wn&&!i)return e;var s,r=si({},this.persistence.get_initial_props(),(null==(s=this.sessionPropsManager)?void 0:s.getSetOnceProps())||{},e||{}),n=this.config.sanitize_properties;return n&&(t1.error(ad),r=n(r,"$set_once")),t&&(this.wn=!0),J(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),Object.keys(e).forEach(e=>this.kn.add(e)),this.Xn()}unregister(e){var t;null==(t=this.persistence)||t.unregister(e)}unregister_for_session(e){var t;null==(t=this.sessionPersistence)||t.unregister(e),this.kn.delete(e),this.Xn()}ts(e,t){this.register({[e]:t})}Dn(){this.kn.forEach(e=>{var t;null==(t=this.sessionPersistence)||t.unregister(e)}),this.kn.clear(),this.Xn()}Xn(){var e;if(this.xn){if("memory"===this.config.persistence||null!=(e=this.sessionPersistence)&&e.xi||!sR.N())sR.q(this.xn);else{var t=[];this.kn.forEach(e=>t.push(e)),t.length>0?sR.F(this.xn,t):sR.q(this.xn)}}}getFeatureFlag(e,t){var i;return null==(i=this.featureFlags)?void 0:i.getFeatureFlag(e,t)}getFeatureFlagPayload(e){var t;return null==(t=this.featureFlags)?void 0:t.getFeatureFlagPayload(e)}getFeatureFlagResult(e,t){var i;return null==(i=this.featureFlags)?void 0:i.getFeatureFlagResult(e,t)}getAllFeatureFlags(){var e,t;return null!==(e=null==(t=this.featureFlags)?void 0:t.getAllFeatureFlags())&&void 0!==e?e:[]}isFeatureEnabled(e,t){var i,s;return null!==(i=null==(s=this.featureFlags)?void 0:s.isFeatureEnabled(e,t))&&void 0!==i?i:null==t?void 0:t.defaultValue}reloadFeatureFlags(){var e;null==(e=this.featureFlags)||e.reloadFeatureFlags()}updateFlags(e,t,i){var s;null==(s=this.featureFlags)||s.updateFlags(e,t,i)}updateEarlyAccessFeatureEnrollment(e,t,i){var s;null==(s=this.featureFlags)||s.updateEarlyAccessFeatureEnrollment(e,t,i)}getEarlyAccessFeatures(e,t,i){var s;return void 0===t&&(t=!1),null==(s=this.featureFlags)?void 0:s.getEarlyAccessFeatures(e,t,i)}on(e,t){return this.pn.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:ac}),()=>{})}onSessionId(e){var t,i;return null!==(t=null==(i=this.sessionManager)?void 0:i.onSessionId(e))&&void 0!==t?t:()=>{}}getSurveys(e,t){void 0===t&&(t=!1),this.surveys?this.surveys.getSurveys(e,t):e([],{isLoaded:!1,error:ac})}getActiveMatchingSurveys(e,t){void 0===t&&(t=!1),this.surveys?this.surveys.getActiveMatchingSurveys(e,t):e([],{isLoaded:!1,error:ac})}renderSurvey(e,t){var i;null==(i=this.surveys)||i.renderSurvey(e,t)}displaySurvey(e,t){var i;void 0===t&&(t=n7),null==(i=this.surveys)||i.displaySurvey(e,t)}cancelPendingSurvey(e){var t;null==(t=this.surveys)||t.cancelPendingSurvey(e)}canRenderSurvey(e){var t,i;return null!==(t=null==(i=this.surveys)?void 0:i.canRenderSurvey(e))&&void 0!==t?t:{visible:!1,disabledReason:ac}}canRenderSurveyAsync(e,t){var i,s;return void 0===t&&(t=!1),null!==(i=null==(s=this.surveys)?void 0:s.canRenderSurveyAsync(e,t))&&void 0!==i?i:Promise.resolve({visible:!1,disabledReason:ac})}es(e){return!e||X(e)?(t1.critical("Unique user id has not been set in posthog.identify"),!1):e===iW?(t1.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())||(t1.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 t1.uninitializedWarning("posthog.identify");if(et(e)&&(e=e.toString(),t1.warn("The first argument to posthog.identify was a number, but it should be a string. It has been converted to a string.")),this.es(e)&&this.Yn("posthog.identify")){var s=this.get_distinct_id();this.register({$user_id:e}),this.get_property(t4)||this.register_once({$had_persisted_distinct_id:!0,$device_id:s},""),e!==s&&e!==this.get_property(t9)&&(this.unregister(t9),this.register({distinct_id:e}));var r,n=(this.persistence.get_property(ij)||i1)===i1,a=e!==s,o=!a&&n;if(a&&n)this.persistence.set_property(ij,i2),this.setPersonPropertiesForFlags({$set:t||{},$set_once:i||{}},!1),this.capture(i9,{distinct_id:e,$anon_distinct_id:s},{$set:t||{},$set_once:i||{}}),this.En=nJ(e,t,i),null==(r=this.featureFlags)||r.setAnonymousDistinctId(s);else if(o){this.persistence.set_property(ij,i2);var l=t||{},u=i||{};this.setPersonPropertiesForFlags({$set:l,$set_once:u},!1),this.capture("$set",{$set:l,$set_once:u}),this.En=nJ(e,t,i)}else(t||i)&&this.setPersonProperties(t,i);a?(this.reloadFeatureFlags(),this.featureFlags?this.featureFlags.resetFlagCallReported():this.unregister(iN)):o&&(t||i)&&this.reloadFeatureFlags()}}setPersonProperties(e,t){if((e||t)&&this.Yn("posthog.setPersonProperties")){var i=nJ(this.get_distinct_id(),e,t);this.En!==i?(this.setPersonPropertiesForFlags({$set:e||{},$set_once:t||{}},!0),this.capture("$set",{$set:e||{},$set_once:t||{}}),this.En=i):t1.info("A duplicate setPersonProperties call was made with the same properties. It has been ignored.")}}unsetPersonProperties(e){var t,i=(G(e)?e:[e]).filter(e=>Q(e)&&e.length>0);0!==i.length&&this.Yn("posthog.unsetPersonProperties")&&(null==(t=this.featureFlags)||t.unsetPersonPropertiesForFlags(i,!0),this.capture("$set",{$unset:i}),this.En=null)}group(e,t,i){if(e&&t){var s=this.getGroups(),r=s[e]!==t;if(r&&this.resetGroupPropertiesForFlags(e),this.register({$groups:y({},s,{[e]:t})}),r||i){var n={$group_type:e,$group_key:t};i&&(n.$group_set=i),this.capture(i7,n)}i&&this.setGroupPropertiesForFlags({[e]:i}),r&&!i&&this.reloadFeatureFlags()}else t1.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.Yn("posthog.setGroupPropertiesForFlags")&&(null==(i=this.featureFlags)||i.setGroupPropertiesForFlags(e,t))}resetGroupPropertiesForFlags(e){var t;null==(t=this.featureFlags)||t.resetGroupPropertiesForFlags(e)}reset(e){var t=es(e)?e:null==e?void 0:e.resetDeviceID,i=es(e)||null==e?void 0:e.bootstrap;this.rs(t,!1,i)}rs(e,t,i){if(void 0===t&&(t=!1),t1.info("reset"),!this.__loaded)return t1.uninitializedWarning("posthog.reset");var s=null==i?void 0:i.sessionID;this.config.bootstrap=i||(null==(r=this.Pn)?void 0:r.bootstrap)||{},null==(n=this.featureFlags)||null==n.updateConfig||n.updateConfig(this.config,this.Qi());var r,n,a,o,l,u,h,c,d,p,v,g,f,_,m,b,w=this.get_property(t4),x=this.get_property(t8),E=this.get_property(ih),k=this.is_capturing();if(this.consent.reset(),t||!k||this.is_capturing()||console.warn("[PostHog.js]","reset() cleared the stored consent, and capturing is now off because of `opt_out_capturing_by_default`. Call opt_in_capturing() again, and prefer calling reset() before opting in rather than after."),null==(a=this.persistence)||a.clear(),null==(o=this.sessionPersistence)||o.clear(),this.kn.clear(),this.Xn(),Y(E)||null==(f=this.persistence)||f.register({[ih]:E}),null==(l=this.surveys)||l.reset(),null==(u=this.Zn)||u.stop(),null==(h=this.featureFlags)||h.reset(),null==(c=this.conversations)||c.reset(),null==(d=this.logs)||d.reset(),null==(p=this.metrics)||p.reset(),null==(v=this.persistence)||v.set_property(ij,i1),null==(g=this.sessionManager)||g.resetSessionId(),this.En=null,this.config.cookieless_mode===i0)this.register_once({distinct_id:iW,$device_id:null},"");else{var S=this.config.get_device_id(sy());this.register_once({distinct_id:S,$device_id:e?S:w},""),e||Y(x)||this.register({[t8]:x})}if(this.register({$last_posthog_reset:new Date().toISOString()},1),i&&(void 0===i.distinctID||this._n()||(null==(b=this.persistence)||b.set_property(ij,i.isIdentifiedID?i2:i1),this.register({distinct_id:i.distinctID})),null==(_=this.featureFlags)||_.initialize(),!(Y(s)||null!=(m=this.sessionManager)&&m.setBootstrapSessionId(s,!0)))){var P=y({},i);delete P.sessionID,this.config.bootstrap=P}delete this.config.identity_distinct_id,delete this.config.identity_hash,this.reloadFeatureFlags()}shutdown(e){var t=this;return m(function*(){var e,i,s,r,n,a,o,l;if(t.__loaded){null==(e=t.Zn)||e.stop(),null==(i=t.zn)||i.dispose(),null==(s=t.sessionRecording)||s.dispose(),null==(r=t.logs)||r.flushLogs("sendBeacon"),null==(n=t.metrics)||n.flush("sendBeacon"),null==(a=t.Fn)||a.unload(),null==(o=t.On)||o.unload();try{null==(l=t.featureFlags)||l.destroy()}catch(e){t1.error("Error while destroying feature flags",e)}}else t1.uninitializedWarning("posthog.shutdown")})()}setIdentity(e,t){var i;this.config.identity_distinct_id=e,this.config.identity_hash=t,this.alias(e),null==(i=this.conversations)||i.ns()}clearIdentity(){var e;delete this.config.identity_distinct_id,delete this.config.identity_hash,null==(e=this.conversations)||e.ss()}get_distinct_id(){return this.get_property("distinct_id")}getGroups(){return this.get_property("$groups")||{}}get_session_id(){var e,t;return null!==(e=null==(t=this.sessionManager)?void 0:t.checkAndGetSessionAndWindowId(!0).sessionId)&&void 0!==e?e:""}get_session_replay_url(e){if(!this.sessionManager)return"";var t=this.sessionManager.checkAndGetSessionAndWindowId(!0),i=t.sessionStartTimestamp,s=this.requestRouter.endpointFor("ui","/project/"+this.config.token+"/replay/"+t.sessionId);if(null!=e&&e.withTimestamp&&i){var r,n=null!==(r=e.timestampLookBack)&&void 0!==r?r:10;if(!i)return s;s+="?t="+Math.max(Math.floor((new Date().getTime()-i)/1e3)-n,0)}return s}alias(e,t){return e===this.get_property(t6)?(t1.critical("Attempting to create alias for existing People user - aborting."),-2):this.Yn("posthog.alias")?(Y(t)&&(t=this.get_distinct_id()),e!==t?(this.ts(t9,e),this.capture("$create_alias",{alias:e,distinct_id:t})):(t1.warn("alias matches current distinct_id - skipping api call."),this.identify(e),-1)):void 0}set_config(e){var t=y({},this.config);if(K(e)){si(this.config,ay(e));var i,s,r,n,a,o,l,u,h,c,d,p,v=this.An();null==(i=this.persistence)||i.update_config(this.config,t,v),this.sessionPersistence="sessionStorage"===this.config.persistence||"memory"===this.config.persistence?this.persistence:new rH(y({},this.config,{persistence:"sessionStorage"}),v,!1);var g=this.In(this.config.debug);es(g)&&(this.config.debug=g),es(this.config.debug)&&(this.config.debug?(f.DEBUG=!0,sS.N()&&sS.F("ph_debug",!0),t1.info("set_config",{config:e,oldConfig:t,newConfig:y({},this.config)})):(f.DEBUG=!1,sS.N()&&sS.q("ph_debug"))),null==(s=this.featureFlags)||null==s.updateConfig||s.updateConfig(this.config,this.Qi()),null==(r=this.exceptionObserver)||r.onConfigChange(),null==(n=this.exceptions)||n.onConfigChange(),null==(a=this.sessionRecording)||a.startIfEnabledOrStop(),null==(o=this.tracingHeaders)||o.startIfEnabledOrStop(),null==(l=this.autocapture)||l.startIfEnabled(),null==(u=this.heatmaps)||u.startIfEnabled(),null==(h=this.exceptionObserver)||h.startIfEnabledOrStop(),null==(c=this.deadClicksAutocapture)||
1c.startIfEnabledOrStop(),null==(d=this.surveys)||d.loadIfEnabled(),this.os(),null==(p=this.externalIntegrations)||p.startIfEnabledOrStop()}}_overrideSDKInfo(e,t){f.LIB_NAME=e,f.LIB_VERSION=t}startSessionRecording(e){var t,i,s,r,n,a=!0===e,o={sampling:a||!(null==e||!e.sampling),linked_flag:a||!(null==e||!e.linked_flag),url_trigger:a||!(null==e||!e.url_trigger),event_trigger:a||!(null==e||!e.event_trigger)};Object.values(o).some(Boolean)&&(null==(t=this.sessionManager)||t.checkAndGetSessionAndWindowId(),o.sampling&&(null==(i=this.sessionRecording)||i.overrideSampling()),o.linked_flag&&(null==(s=this.sessionRecording)||s.overrideLinkedFlag()),o.url_trigger&&(null==(r=this.sessionRecording)||r.overrideTrigger("url")),o.event_trigger&&(null==(n=this.sessionRecording)||n.overrideTrigger("event"))),this.set_config({disable_session_recording:!1})}stopSessionRecording(){this.set_config({disable_session_recording:!0})}sessionRecordingStarted(){var e;return!(null==(e=this.sessionRecording)||!e.started)}captureException(e,t){if(this.exceptions){var i=Error("PostHog syntheticException"),s=this.exceptions.buildProperties(e,{handled:!0,syntheticException:i});return this.exceptions.sendExceptionEvent(y({},s,t))}}addExceptionStep(e,t){var i;null==(i=this.exceptions)||i.addExceptionStep(e,t)}captureLog(e){var t;null==(t=this.logs)||t.captureLog(e)}get logger(){var e,t;return null!==(e=null==(t=this.logs)?void 0:t.logger)&&void 0!==e?e:aw.ls}startExceptionAutocapture(e){this.set_config({capture_exceptions:null==e||e})}stopExceptionAutocapture(){this.set_config({capture_exceptions:!1})}loadToolbar(e){var t,i;return null!==(t=null==(i=this.toolbar)?void 0:i.loadToolbar(e))&&void 0!==t&&t}get_property(e){var t;return null==(t=this.persistence)?void 0:t.props[e]}getSessionProperty(e){var t;return null==(t=this.sessionPersistence)?void 0:t.props[e]}toString(){var e,t=null!==(e=this.config.name)&&void 0!==e?e:ag;return t!==ag&&(t=ag+"."+t),t}_isIdentified(){var e,t;return(null==(e=this.persistence)?void 0:e.get_property(ij))===i2||(null==(t=this.sessionPersistence)?void 0:t.get_property(ij))===i2}Jn(){var e,t;return!("never"===this.config.person_profiles||this.config.person_profiles===i3&&!this._isIdentified()&&J(this.getGroups())&&(null==(e=this.persistence)||null==(e=e.props)||!e[t9])&&(null==(t=this.persistence)||null==(t=t.props)||!t[iG]))}Gn(){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.Jn()||this.Yn("posthog.createPersonProfile")&&this.setPersonProperties({},{})}setInternalOrTestUser(){this.Yn("posthog.setInternalOrTestUser")&&this.setPersonProperties({$internal_or_test_user:!0})}Yn(e){return"never"===this.config.person_profiles?(t1.error(e+' was called, but process_person is set to "never". This call will be ignored.'),!1):(this.ts(iG,!0),!0)}An(){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!==iZ)}os(){var e,t,i,s,r=this.An();return(null==(e=this.persistence)?void 0:e.xi)!==r&&(null==(i=this.persistence)||i.set_disabled(r)),(null==(t=this.sessionPersistence)?void 0:t.xi)!==r&&(null==(s=this.sessionPersistence)||s.set_disabled(r)),r&&(this.kn.clear(),this.Xn()),r}opt_in_capturing(e){var t;if(this.config.cookieless_mode!==i0){if(this._n()){this.rs(!0,!0),null==(r=this.sessionManager)||r.destroy(),null==(n=this.pageViewManager)||n.destroy(),this.sessionManager=new nV(this),this.pageViewManager=new rd(this),this.persistence&&(this.sessionPropsManager=new nB(this,this.sessionManager,this.persistence));var i,s,r,n,a,o,l,u,h=null!==(a=null==(o=this.config.__extensionClasses)?void 0:o.sessionRecording)&&void 0!==a?a:null==(l=aw.__defaultExtensionClasses)?void 0:l.sessionRecording;h&&(this.sessionRecording=this.bn(this.sessionRecording,new h(this)),this.fn&&(null==(u=this.sessionRecording)||null==u.onRemoteConfig||u.onRemoteConfig(this.fn)))}this.consent.optInOut(!0),this.os(),this.Wn(),null==(t=this.sessionRecording)||t.startIfEnabledOrStop(),this.config.cookieless_mode==iZ&&
1(null==(i=this.surveys)||i.loadIfEnabled()),(Y(null==e?void 0:e.captureEventName)||null!=e&&e.captureEventName)&&this.capture(null!==(s=null==e?void 0:e.captureEventName)&&void 0!==s?s:"$opt_in",null==e?void 0:e.captureProperties,{send_instantly:!0}),this.config.capture_pageview&&this.Vn()}else t1.warn(ah)}opt_out_capturing(){var e,t,i;this.config.cookieless_mode!==i0?(this.config.cookieless_mode===iZ&&this.consent.isOptedIn()&&this.rs(!0,!0),this.consent.optInOut(!1),this.os(),this.config.cookieless_mode===iZ&&(this.register({distinct_id:iW,$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.Vn(),this.Wn())):t1.warn(ah)}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===i0||(this.config.cookieless_mode===iZ?this.consent.isRejected()||this.consent.isOptedIn():!this.has_opted_out_capturing())}clear_opt_in_out_capturing(){this.consent.reset(),this.os()}_is_bot(){return n?nG(n,this.config.custom_blocked_useragents):void 0}Vn(){a&&("visible"===a.visibilityState?this.Cn||(this.Cn=!0,this.capture(i4,{title:a.title},{send_instantly:!0}),this.Mn&&(a.removeEventListener(i5,this.Mn),this.Mn=null)):this.Mn||(this.Mn=this.Vn.bind(this),sl(a,i5,this.Mn)))}debug(e){!1===e?(null==s||s.console.log("You've disabled debug mode."),this.set_config({debug:!1})):(null==s||s.console.log("You're now in debug mode. All calls to PostHog will be logged in your console.\nYou can disable this with `posthog.debug(false)`."),this.set_config({debug:!0}))}Qi(){var e,t,i,s,r=this.Pn||{};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?(t1.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&&!ee(r[e]),s=t in r&&!ee(r[t]),i?r[e]:!!s&&(t1&&t1.warn("Config field '"+t+"' is deprecated. Please use '"+e+"' instead. The old field will be removed in a future major version."),r[t]))}Pt(e){if(ee(this.config.before_send))return e;var t,i=Object.keys(null!==(t=e.properties)&&void 0!==t?t:{}).filter(ea),s=G(this.config.before_send)?this.config.before_send:[this.config.before_send],r=e;for(var n of s){if(ee(r=n(r))){var a="Event '"+e.event+"' was rejected in beforeSend function";return en(e.event)?t1.warn(a+". This can cause unexpected behavior."):t1.info(a),null}r.properties&&!J(r.properties)||t1.warn("Event '"+e.event+"' has no properties after beforeSend function, this is likely an error.")}for(var o of i)if(r.properties&&ee(r.properties[o]))return t1.warn("Event '"+e.event+"' had its '"+o+"' property removed in a beforeSend function. This property is required for ingestion, so the event will be dropped."),null;return r}getPageViewId(){var e;return null==(e=this.pageViewManager.ui)?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)})}In(e){var t=es(e)&&!e,i=sS.N()&&"true"===sS.P("ph_debug");return!t&&(!!i||e)}}aw.__defaultExtensionClasses={},aw.ls=(()=>{var e=()=>{};return{trace:e,debug:e,info:e,warn:e,error:e,fatal:e}})(),function(e,t){for(var i=0;t.length>i;i++)e.prototype[t[i]]=sn(e.prototype[t[i]])}(aw,["identify"]);class ax{constructor(e){this.disabled=!1===e;var t=K(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 aE="$copy_autocapture",ak=t2("[AutoCapture]");function aS(e,t){return t.length>e?t.slice(0,e)+"...":t}var aP=t2("[ExceptionAutocapture]"),aF=()=>{},aI=t2("[TracingHeaders]"),a$=t2("[Web Vitals]"),aR="disabled",aM="lazy_loading",aC="awaiting_config",aT="missing_config";t2("[SessionRecording]"),t2("[SessionRecording]");var aO="[SessionRecording]",aA=t2(aO),aN=t2("[Heatmaps]");function aL(e){return K(e)&&"clientX"in e&&"clientY"in e&&et(e.clientX)&&et(e.clientY)}var aD=t2("[Product Tours]"),aq=e=>{var t;return!e.config.disable_product_tours&&!(null==(t=e.persistence)||!t.get_property(il))},aj=["$set_once","$set"],aH=t2("[SiteApps]"),aB="Error while initializing PostHog app with config id ";function az(e,t,i){if(ee(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 aU{constructor(e){this.us=new nz,this.hs=(e,t)=>this.ds(e,t)&&this.vs(e,t)&&this.cs(e,t)&&this.fs(e,t),this.ds=(e,t)=>null==t||!t.event||(null==e?void 0:e.event)===(null==t?void 0:t.event),this._instance=e,this.ps=new Set,this.gs=new Set}init(){var e,t;Y(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(!Y(null==(t=this._instance)?void 0:t._addCaptureHook)&&(e.forEach(e
1=>{var t,i;null==(t=this.gs)||t.add(e),null==(i=e.steps)||i.forEach(e=>{var t;null==(t=this.ps)||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.ps.has(e)||this.ps.has(t.event))&&this.gs&&(null==(i=this.gs)?void 0:i.size)>0&&this.gs.forEach(e=>{this.ys(t,e)&&this.us.emit("actionCaptured",e.name)})}bs(e){this.onAction("actionCaptured",t=>e(t))}ys(e,t){if(null==(null==t?void 0:t.steps))return!1;for(var i of t.steps)if(this.hs(e,i))return!0;return!1}onAction(e,t){return this.us.on(e,t)}vs(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||!az(s,t.url,t.url_matching||"contains"))return!1}return!0}cs(e,t){return!!this._s(e,t)&&!!this.ws(e,t)&&!!this.ks(e,t)}_s(e,t){if(null==t||!t.href)return!0;var i=this.xs(e);if(i.length>0)return i.some(e=>az(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&&az((r=n.match(/(?::|")href="(.*?)"/))?r[1]:"",t.href,t.href_matching||"exact")}ws(e,t){if(null==t||!t.text)return!0;var i=this.xs(e);if(i.length>0)return i.some(e=>az(e.text,t.text,t.text_matching||"exact")||az(e.$el_text,t.text,t.text_matching||"exact"));var s,r,n,a,o=(null==e||null==(s=e.properties)?void 0:s.$elements_chain)||"";return!!o&&(r=function(e){for(var t,i=[],s=/(?::|")text="(.*?)"/g;!ee(t=s.exec(e));)i.includes(t[1])||i.push(t[1]);return i}(o),n=t.text,a=t.text_matching||"exact",r.some(e=>az(e,n,a)))}ks(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}xs(e){var t;return null==(null==e||null==(t=e.properties)?void 0:t.$elements)?[]:null==e?void 0:e.properties.$elements}fs(e,t){return null==t||!t.properties||0===t.properties.length||nX(t.properties.reduce((e,t)=>{var i=G(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 aV{constructor(e){var t;this.Ss=[],this._instance=e,this.Cs=new Map,this.Ms=new Map,this.Ts=new Map,null==(t=this._instance)||null==t.onSessionId||t.onSessionId(e=>this.Es(e))}Is(e){return!1}Ps(){return null}Rs(e){}As(){}Fs(e,t){return!!e&&nX(e.propertyFilters,null==t?void 0:t.properties)}Ls(e,t){var i=new Map;return e.forEach(e=>{var s;null==(s=e.conditions)||null==(s=s[t])||null==(s=s.values)||s.forEach(t=>{if(null!=t&&t.name){var s=i.get(t.name)||[];s.push(e.id),i.set(t.name,s)}})}),i}Os(e,t,i){var s=(i===rU.Activation?this.Cs:this.Ms).get(e),r=[];return this.Ds(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.Fs(n,t)})}register(e){var t;Y(null==(t=this._instance)?void 0:t._addCaptureHook)||(this.$s(e),this.Ns(e))}Ns(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.qs&&(this.qs=new aU(this._instance),this.qs.init(),this.qs.bs(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.qs)||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.Ts.get(t.name);i&&i.push(e.id),this.Ts.set(t.name,i||[e.id])}}))}))}$s(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.Cs=this.Ls(e,rU.Activation),this.Ms=this.Ls(e,rU.Cancellation))}onEvent(e,t){var i,s,r=this.js(),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 a=this.Bs(e,n);if("consume"===a)return r.info("event consumed activated item, remov
1ing it",{event:e,itemId:n}),void this.Hs([n]);if("persist"===a)return r.info("shown item promoted to persisted activation",{event:e,itemId:n}),this.Us(n),void this.zs([n])}if(this.Ms.has(e)){var o=this.Os(e,t,rU.Cancellation);o.length>0&&(r.info("cancel event matched, cancelling items",{event:e,itemsToCancel:o.map(e=>e.id)}),this.Hs(o.map(e=>e.id)),o.forEach(e=>this.Ws(e.id)))}if(this.Cs.has(e)){r.info("event name matched",{event:e,eventPayload:t,items:this.Cs.get(e)});var l=this.Os(e,t,rU.Activation);this.Vs(l.map(e=>e.id))}}onAction(e){this.Ts.has(e)&&this.Vs(this.Ts.get(e)||[])}Vs(e){var t;if(0!==e.length){var i=!(null==(t=this._instance)||null==t.get_session_id||!t.get_session_id()),s=[];for(var r of e)i&&this.Is(r)?this.Us(r)&&this.Zs(r):s.push(r);s.length>0&&(this.Ss=[...new Set([...this.Ss,...s])]),this.js().info("updating activated items",{activatedItems:this.getActivatedIds()})}}Us(e){this.Ss=this.Ss.filter(t=>t!==e);var t=this.Gs();return!t.includes(e)&&(this.Qs([...t,e]),this.Ks(),!0)}Hs(e){var t=new Set(e);this.Ss=this.Ss.filter(e=>!t.has(e));var i=this.Js(),s=i.filter(e=>!t.has(e));s.length!==i.length&&(this.Qs(s),0===s.length&&this.Ys()),this.zs(e)}Xs(){var e,t=this.Ps();if(!t)return{};var i=null==(e=this._instance)||null==(e=e.persistence)?void 0:e.props[t];return i&&"object"==typeof i?i:{}}Zs(e){if(this.Ps()){var t=this.Xs();this.Rs(y({},t,{[e]:Date.now()}))}}zs(e){if(this.Ps()){var t=this.Xs(),i={},s=!1;for(var r of Object.entries(t)){var n=r[0],a=r[1];e.includes(n)?s=!0:i[n]=a}s&&(J(i)?this.As():this.Rs(i))}}ta(){this.Ps()&&this.As()}getActivationTimestamp(e){if(this.Gs().includes(e)){var t=this.Xs()[e];return et(t)?t:void 0}}Js(){var e,t=this.ea();return(null==(e=this._instance)||null==(e=e.persistence)?void 0:e.props[t])||[]}Gs(){var e,t,i=this.Js();if(0===i.length)return[];var s=null==(e=this._instance)||null==(e=e.persistence)?void 0:e.props[this.ia()],r=null==(t=this._instance)||null==t.get_session_id?void 0:t.get_session_id();return r&&s===r?i:[]}Ks(){var e,t=null==(e=this._instance)||null==e.get_session_id?void 0:e.get_session_id();t&&this.ra(t)}Ys(){this.na()}Es(e){var t,i=null==(t=this._instance)||null==(t=t.persistence)?void 0:t.props[this.ia()];if(i&&i!==e){var s=this.Js(),r=this.Xs();s.length>0&&(this.Qs([]),s.filter(e=>et(r[e])).forEach(e=>this.Ws(e))),this.Ys(),this.ta()}}getActivatedIds(){return[...new Set([...this.Gs(),...this.Ss])].filter(e=>!this.sa(e))}reset(){this.Ss=[],this.Js().length>0&&this.Qs([]),this.Ys(),this.ta()}getEventToItemsMap(){return this.Cs}aa(){return this.qs}}class aG extends aV{constructor(e){super(e)}ea(){return iC}ia(){return iT}Ps(){return iO}Rs(e){var t;null==(t=this._instance)||null==(t=t.persistence)||t.register({[iO]:e})}As(){var e;null==(e=this._instance)||null==(e=e.persistence)||e.unregister(iO)}Is(e){this.Ds(t=>{i=t.find(t=>t.id===e)});var t,i,s=null==(t=i)||null==(t=t.appearance)?void 0:t.surveyPopupDelaySeconds;return et(s)&&s>0}oa(){return rG.SHOWN}Ds(e){var t;null==(t=this._instance)||t.getSurveys(e)}Ws(e){var t;null==(t=this._instance)||t.cancelPendingSurvey(e)}js(){return n6}Qs(e){var t;null==(t=this._instance)||null==(t=t.persistence)||t.register({[iC]:e})}ra(e){var t;null==(t=this._instance)||null==(t=t.persistence)||t.register({[iT]:e})}na(){var e;null==(e=this._instance)||null==(e=e.persistence)||e.unregister(iT)}sa(){return!1}Bs(e,t){var i,s,r;return this.Ds(e=>{r=e.find(e=>e.id===t)}),!r||n5(i=r)&&!(null==(s=i.conditions)||null==(s=s.events)||!s.repeatedActivation)||"always"===i.schedule?e===rG.SHOWN?"consume":"ignore":e===rG.SHOWN?"persist":e===rG.DISMISSED||e===rG.SENT?"consume":"ignore"}getSurveys(){return this.getActivatedIds()}getEventToSurveys(){return this.getEventToItemsMap()}}var aW="SDK is not enabled or survey functionality is not yet loaded",aK="Disabled. Not loading surveys.",aJ=null!=s&&s.location?rw(s.location.hash,"__posthog")||rw(location.hash,"state"):null,aY="_postHogToolbarParams",aQ=t2("[Toolbar]"),aX=t2("[FeatureFlags]");class aZ{constructor(e,t){void 0===t&&(t=!1),this.la=!1,this.update(e,t)}update(e,t){var i,s,r,n;this.ua={bootstrap:{featureFlags:null==(i=e.bootstrap)?void 0:i.featureFlags,featureFlagPayloads:null==(s=e.bootstrap)?void 0:s.featureFlagPayloads},remoteRequestsDisabled:t,featureFlagsDisabled:!!e.advanced_disable_feature_flags,onlyEvaluateSurveyFeatureFlags:!!e.advanced_only_evaluate_survey_feature_flags,deduplicateCallsPerSession:!!e.advanced_feature_flags_dedup_per_session,cacheTtlMs:e.feature_flag_cache_ttl_ms,requestTimeoutMs:e.feature_flag_request_timeout_ms,compression:e.disable_compression?"none":"base64",evaluationContexts:null!==(r=null!==(n=e.evaluation_contexts)&&void 0!==n?n:e.evaluation_environments)&&void 0!==r?r:[],flagKeys:G(e.flag_keys)?e.flag_keys:void 0},!e.evaluation_environments||e.evaluation_contexts||this.la||(aX.warn("evaluation_environments is deprecated. Use evaluation_contexts instead. evaluation_environments will be removed in a future version."),this.la=!0),Y(e.flag_keys)||G(e.flag_keys)||aX.error("Invalid flag_keys found:",e.flag_keys,"Expected array of non-empty strings")}get(){return this.ua}}var a0=t2("[FeatureFlags]"),a1=t2("[FeatureFlags]",{debugEnabled:!0}),a2="\" failed. Feature flags didn't load in time.",a3="connection_error",a5=e=>{for(var t={},i=0;e.length>i;i++)t[e[i]]=!0;return t},a6=e=>{var t={};for(var i of ss(e||{})){var s=i[1];s&&(t[i[0]]=s)}return t},a4=t2("[Error tracking]"),a8="Refusing to render web experiment since the viewer is a likely bot",a9={icontains:(e,t)=>t.toLowerCase().indexOf(e.toLowerCase())>-1,not_icontains:(e,t)=>-1===t.toLowerCase().indexOf(e.toLowerCase()),regex:(e,t)=>nK(t,e),not_regex:(e,t)=>!nK(t,e),exact:(e,t)=>
1t===e,is_not:(e,t)=>t!==e};class a7{get Ne(){return this._instance.config}constructor(e){var t=this;this.getWebExperimentsAndEvaluateDisplayLogic=function(e){void 0===e&&(e=!1),t.getWebExperiments(e=>{a7.ha("retrieved web experiments from the server"),t.da=new Map,e.forEach(e=>{if(e.feature_flag_key){t.da&&(a7.ha("setting flag key ",e.feature_flag_key," to web experiment ",e),null==(i=t.da)||i.set(e.feature_flag_key,e));var i,s=t._instance.getFeatureFlag(e.feature_flag_key);Q(s)&&e.variants[s]&&t.va(e.name,s,e.variants[s].transforms)}else if(e.variants)for(var r in e.variants){var n=e.variants[r];a7.ca(n,t._instance)&&t.va(e.name,r,n.transforms)}})},e)},this._instance=e,this._instance.onFeatureFlags(e=>{this.onFeatureFlags(e)})}initialize(){}onFeatureFlags(e){if(this._is_bot())a7.ha(a8);else if(!this.Ne.disable_web_experiments){if(ee(this.da))return this.da=new Map,this.loadIfEnabled(),void this.previewWebExperiment();a7.ha("applying feature flags",e),e.forEach(e=>{var t;if(this.da&&null!=(t=this.da)&&t.has(e)){var i,s=this._instance.getFeatureFlag(e),r=null==(i=this.da)?void 0:i.get(e);s&&null!=r&&r.variants[s]&&this.va(r.name,s,r.variants[s].transforms)}})}}previewWebExperiment(){var e=a7.getWindowLocation();if(null!=e&&e.search){var t=ry(null==e?void 0:e.search,"__experiment_id"),i=ry(null==e?void 0:e.search,"__experiment_variant");t&&i&&(a7.ha("previewing web experiments "+t+" && "+i),this.getWebExperiments(e=>{this.fa(parseInt(t),i,e)},!1,!0))}}loadIfEnabled(){this.Ne.disable_web_experiments||this.getWebExperimentsAndEvaluateDisplayLogic()}getWebExperiments(e,t,i){if(this.Ne.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.Ne.token),method:"GET",timestampMode:"query",callback:t=>e(200===t.statusCode&&t.json&&t.json.experiments||[])})}fa(e,t,i){var s=i.filter(t=>t.id===e);s&&s.length>0&&(a7.ha("Previewing web experiment ["+s[0].name+"] with variant ["+t+"]"),this.va(s[0].name,t,s[0].variants[t].transforms))}static ca(e,t){return!ee(e.conditions)&&a7.pa(e,t)&&a7.ga(e)}static pa(e,t){if(ee(e.conditions)||ee(null==(s=e.conditions)?void 0:s.url))return!0;var i=a7.getWindowLocation();if(i){var s,r,n,a,o=sC(t,i.href);return null==(r=e.conditions)||!r.url||a9[null!==(n=null==(a=e.conditions)?void 0:a.urlMatchType)&&void 0!==n?n:"icontains"](e.conditions.url,o)}return!1}
1static getWindowLocation(){return null==s?void 0:s.location}static ga(e){if(ee(e.conditions)||ee(null==(i=e.conditions)?void 0:i.utm))return!0;var t=r$();if(t.utm_source){var i,s,r,n,a,o,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==(a=e.conditions)||null==(a=a.utm)?void 0:a.utm_source)==t.utm_source,p=null==(o=e.conditions)||null==(o=o.utm)||!o.utm_medium||(null==(l=e.conditions)||null==(l=l.utm)?void 0:l.utm_medium)==t.utm_medium,v=null==(u=e.conditions)||null==(u=u.utm)||!u.utm_term||(null==(h=e.conditions)||null==(h=h.utm)?void 0:h.utm_term)==t.utm_term;return c&&p&&v&&d}return!1}static ha(e){for(var t=arguments.length,i=Array(t>1?t-1:0),s=1;t>s;s++)i[s-1]=arguments[s];t1.info("[WebExperiments] "+e,i)}va(e,t,i){this._is_bot()?a7.ha(a8):"control"!==t?i.forEach(i=>{if(i.selector){a7.ha("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)})}}):a7.ha("Control variants leave the page unmodified.")}_is_bot(){return n&&this._instance?nG(n,this.Ne.custom_blocked_useragents):void 0}}var oe=t2("[Conversations]"),ot="Conversations not available yet.",oi="console",os="__posthogHandledLogsRequestError",or=(e,t)=>{var i=e instanceof Error?e:Error(t);return i[os]=!0,i},on=e=>!!e&&"object"==typeof e&&!0===e[os],oa={featureFlags:class{constructor(e){this.name="featureFlags",this.ma=!1,this.featureFlagEventHandlers=[],this.rt=a0,this.ya={},this.ba={},this._a=[],this.wa=!1,this.ka=!1,this.xa=0,this.Sa=!1,this.Ca=!1,this.Ma=!1,this.Ta=!1,this.Ea=0,this.Ia=()=>{var e=this.Pa();this.Ea=0,e&&this.reloadFeatureFlags()},"get"in e?this.Ra=e:(this.Aa=new aZ(e.config,e.Qi()),this.Ra=this.Aa)}updateConfig(e,t){var i;null==(i=this.Aa)||i.update(e,t)}setup(e){var t,i;return this.Fa=e,this.rt=e.logger.createLogger("[FeatureFlags]"),i=()=>{this.Fa===e&&(this.Fa=void 0,this.un=e,this.La(e))},null!=(t=e.kv.initialize())&&t.then?t.then(i):i()}La(e){if(this.un===e)return s&&sl(s,"online",this.Ia),this.Oa=e.registerDynamicEventProperties(()=>this.Da()?this.ya:this.ba),this.$a(),this.initialize()}destroy(){null==s||s.removeEventListener("online",this.Ia)}dispose(){var e;this.xa++,this.Ca=!1,this.Fa=void 0,this.un&&(this.Na(),null==(e=this.Oa)||e.dispose(),this.Oa=void 0,this._a=[],null==s||s.removeEventListener("online",this.Ia),this.un=void 0)}get Ne(){return this.Ra.get()}qa(e){var t;return null==(t=this.un)?void 0:t.kv.get(e)}F(e){this.ja(()=>{var t;return null==(t=this.un)?void 0:t.kv.set(e)})}q(e){this.ja(()=>{var t;return null==(t=this.un)?void 0:t.kv.remove(e)})}ja(e){try{e()}catch(e){this.rt.error("Failed to update feature flag persistence",e)}}$a(){var e={};for(var t of[ib,iE,ik,iP]){var i=this.qa(t);Y(i)||(e[t]=i)}this.ya=e;var s=y({},e),r=this.qa(iy);if(r)for(var n of Object.entries(r))s["$feature/"+n[0]]=n[1];this.ba=s}Da(){var e=this.Ne.cacheTtlMs;if(!e||0>=e)return!1;var t=this.qa(iq);return"number"!=typeof t||Date.now()-t>e}Ba(){return!!this.Da()&&(this.Ta||this.ka||(this.Ta=!0,this.rt.warn("Feature flag cache is stale, triggering refresh..."),this.reloadFeatureFlags()),!0)}Ha(){var e=this.Ne.evaluationContexts;return null!=e&&e.length?e.filter(e=>{var t=e&&"string"==typeof e&&e.trim().length>0;return t||this.rt.error("Invalid evaluation context found:",e,"Expected non-empty string"),t}):[]}Ua(){var e=this.Ne.flagKeys;if(!Y(e))return e.filter(e=>{var t=e&&"string"==typeof e&&e.trim().length>0;return t||this.rt.error("Invalid flag key found:",e,"Expected non-empty string"),t})}initialize(){var e,t,i=this.Ne,s=null!==(e=null==(t=i.bootstrap)?void 0:t.featureFlags)&&void 0!==e?e:{};if(Object.keys(s).length){var r,n,a=null!==(r=null==(n=i.bootstrap)?void 0:n.featureFlagPayloads)&&void 0!==r?r:{},o=Object.keys(s).filter(e=>!!s[e]).reduce((e,t)=>(e[t]=s[t]||!1,e),{}),l=Object.keys(a).filter(e=>o[e]).reduce((e,t)=>(e[t]=a[t],e),{});return this.za({featureFlags:o,featureFlagPayloads:l})}}updateFlags(e,t,i){var s,r,n=null!=i&&i.merge&&null!==(s=this.qa(iy))&&void 0!==s?s:{},a=null!=i&&i.merge&&null!==(r=this.qa(iE))&&void 0!==r?r:{},o=y({},n,e),l=y({},a,t),u={};for(var h of Object.entries(o)){var c=h[0],d=h[1];u[c]={key:c,enabled:x(d),variant:E(d),reason:void 0,metadata:Y(null==l?void 0:l[c])?void 0:{id:0,version:void 0,description:void 0,payload:l[c]}}}this.za({flags:u})}get hasLoadedFlags(){return this.wa}getFlags(){return Object.keys(this.getFlagVariants())}getFlagsWithDetails(){var e=this.qa(ix),t=this.qa(iP),i=this.qa(iF);if(!i&&!t)return e||{};var s=si({},e||{});for(var r of[...new Set([...Object.keys(i||{}),...Object.keys(t||{})])]){var n,a,o=s[r],l=null==t?void 0:t[r],u=Y(l)?null!==(n=null==o?void 0:o.enabled)&&void 0!==n&&n:!!l,h=Y(l)?null==o?void 0:o.variant:"string"==typeof l?l:void 0,c=null==i?void 0:i[r],d=y({},o,{enabled:u,variant:u?null!=h?h:null==o?void 0:o.variant:void 0});u!==(null==o?void 0:o.enabled)&&(d.original_enabled=null==o?void 0:o.enabled),h!==(null==o?void 0:o.variant)&&(
1d.original_variant=null==o?void 0:o.variant),c&&(d.metadata=y({},null==o?void 0:o.metadata,{payload:c,original_payload:null==o||null==(a=o.metadata)?void 0:a.payload})),s[r]=d}return this.ma||(this.rt.warn(" Overriding feature flag details!",{flagDetails:e,overriddenPayloads:i,finalDetails:s}),this.ma=!0),s}getAllFeatureFlags(){var e=this.getFlagVariants(),t=this.getFlagPayloads();return Object.keys(e).map(i=>{var s=e[i];return{key:i,enabled:x(s),variant:E(s),payload:w(t[i])}})}getFlagVariants(){var e=this.qa(iy),t=this.qa(iP);if(!t)return e||{};for(var i=si({},e||{}),s=Object.keys(t),r=0;s.length>r;r++)i[s[r]]=t[s[r]];return this.ma||(this.rt.warn(" Overriding feature flags!",{enabledFlags:e,overriddenFlags:t,finalFlags:i}),this.ma=!0),i}getFlagPayloads(){var e=this.qa(iE),t=this.qa(iF);if(!t)return e||{};for(var i=si({},e||{}),s=Object.keys(t),r=0;s.length>r;r++)i[s[r]]=t[s[r]];return this.ma||(this.rt.warn(" Overriding feature flag payloads!",{flagPayloads:e,overriddenPayloads:t,finalPayloads:i}),this.ma=!0),i}reloadFeatureFlags(){this.Sa||this.Ne.featureFlagsDisabled||this.Pa()||this.Wa||(this._a.slice().forEach(e=>{try{e()}catch(e){this.rt.error("Error while running feature flags reloading callback",e)}}),this.Wa=setTimeout(()=>{this.Va()},5))}Na(){clearTimeout(this.Wa),this.Wa=void 0}onReloading(e){return this._a.push(e),()=>{this._a=this._a.filter(t=>t!==e)}}ensureFlagsLoaded(){this.wa||this.ka||this.Wa||this.reloadFeatureFlags()}setAnonymousDistinctId(e){this.$anon_distinct_id=e}setReloadingPaused(e){this.Sa=e}resetFlagCallReported(){this.q(iN)}Va(e){this.Na();var t=this.un;if(t&&!this.Ne.remoteRequestsDisabled&&!this.Pa()){if(this.ka)this.Ca=!0;else{var i={token:t.projectToken,distinct_id:t.distinctId,groups:t.groups,$anon_distinct_id:this.$anon_distinct_id,person_properties:y({},t.initialPersonProperties,this.qa(iI)||{},{$lib:t.library.name,$lib_version:t.library.version}),group_properties:this.qa(i$),timezone:rL()};Y(t.deviceId)||(i.$device_id=t.deviceId),(null!=e&&e.disableFlags||this.Ne.featureFlagsDisabled)&&(i.disable_flags=!0);var s=this.Ha();s.length&&(i.evaluation_contexts=s);var r=this.Ua();Y(r)||(i.flag_keys=r);var n=this.Ne.onlyEvaluateSurveyFeatureFlags,a=this.xa;this.ka=!0;var o=()=>{this.Ca&&(this.Ca=!1,this.Va())},l=e=>{this.ka=!1,a===this.xa&&(this.F({[iD]:[a3]}),this.rt.error("Feature flag request failed",e)),o()};try{t.sendRequest("/flags/?v=2"+(n?"&only_evaluate_survey_feature_flags=true":""),{target:"flags",method:"POST",body:i,compression:"base64"===this.Ne.compression?rz.Base64:void 0,sentAt:"body",timeoutMs:this.Ne.requestTimeoutMs}).then(e=>{var t,s,r=null!==(t=e.json)&&void 0!==t?t:{},l=200!==e.statusCode;if(this.ka=!1,a===this.xa){if(this.Za(e.statusCode),l||this.Ca||(this.$anon_distinct_id=void 0),!i.disable_flags||this.Ca){this.Ma=!l;var u=[];e.error?u.push(e.error instanceof Error&&"AbortError"===e.error.name?"timeout":e.error instanceof Error?a3:"unknown_error"):200!==e.statusCode&&u.push("api_error_"+e.statusCode),r.errorsWhileComputingFlags&&u.push("errors_while_computing_flags");var h=!(null==(s=r.quotaLimited)||!s.includes("feature_flags"));h&&u.push("quota_limited"),this.F({[iD]:u}),h?this.rt.warn("You have hit your feature flags quota limit, and will not be able to load feature flags until the quota is reset. Please visit https://posthog.com/docs/billing/limits-alerts to learn more."):i.disable_flags||this.za(r,l,{partialResponse:n}),o()}}else o()}).catch(l)}catch(e){l(e)}}}}Pa(){return rx(this.Ea,3)}Za(e){this.Ea=rE(e,this.Ea,3,()=>this.rt.warn("Feature flag requests are failing before receiving an HTTP response; this can happen due to network issues, CORS, browser blocking, or ad blockers. Stopped refreshing feature flags; will try again when connectivity changes."))}getFeatureFlag(e,t){var i;if(void 0===t&&(t={}),!t.fresh||this.Ma){if(this.wa||this.getFlags()&&this.getFlags().length>0){if(!this.Ba()){var s=this.getFeatureFlagResult(e,t);return null!==(i=null==s?void 0:s.variant)&&void 0!==i?i:null==s?void 0:s.enabled}}else this.rt.warn('getFeatureFlag for key "'+e+a2)}}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.Ma){if(this.wa||this.getFlags()&&this.getFlags().length>0){if(!this.Ba()){var i,s=this.getFlagVariants(),r=e in s,n=s[e],a=this.getFlagPayloads()[e],o=String(n),l=this.qa(ik)||void 0,u=this.qa(iq)||void 0,h=this.qa(iN)||{};if(this.Ne.deduplicateCallsPerSession){var c,d=null==(c=this.un)?void 0:c.session.sessionId,p=this.qa(iL);d&&d!==p&&(h={},i=d)}if(!t.send_event&&"send_event"in t)i&&this.F({[iN]:h,[iL]:i});else if(e in h&&h[e].includes(o))i&&this.F({[iN]:h,[iL]:i});else{G(h[e])?h[e].push(o):h[e]=[o],this.F(y({[iN]:h},i?{[iL]:i}:{}));var v=this.getFeatureFlagDetails(e),g=[...null!==(_=this.qa(iD))&&void 0!==_?_:[]];Y(n)&&g.push("flag_missing");var f={$feature_flag:e,$feature_flag_response:n,$feature_flag_payload:null!=a?a:null,$feature_flag_request_id:l,$feature_flag_evaluated_at:u,$feature_flag_bootstrapped_response:null!==(m=null==(b=this.Ne.bootstrap)||null==(b=b.featureFlags)?void 0:b[e])&&void 0!==m?m:null,$feature_flag_bootstrapped_payload:null!==(x=null==(E=this.Ne.bootstrap)||null==(E=E.featureFlagPayloads)?void 0:E[e])&&void 0!==x?x:null,$used_bootstrap_value:!this.Ma};Y(null==v||null==(k=v.metadata)?void 0:k.has_experiment)||(f.$feature_flag_has_experiment=v.metadata.has_experiment),Y(null==v||null==(S=v.metadata)?void 0:S.version)||(f.$feature_flag_version=v.metadata.version);var _,m,b,x,E,k,S,P,F,I,$,R,M,C=null!==(P=null==v||null==(F=v.reason)?void 0:F.description)&&void 0!==P?P:null==v||null==(I=v.reason)?void 0:I.code;C&&(f.$feature_flag_reason=C),null!=v&&null!=($=v.metadata)&&$.id&&(f.$feature_flag_id=v.metadata.id),Y(null==v?void 0:v.original_variant)&&Y(null==v?void 0:v.original_enabled)||(f.$feature_flag_original_response=Y(v.original_variant)?v.original_enabled:v.original_variant),null!=v&&null!=(R=v.metadata)&&R.original_payload&&(f.$feature_flag_original_payload=null==v||null==(M=v.metadata)?void 0:M.original_payload),g.length&&(f.$feature_flag_error=g.join(",")),this.Ga(f)}if(r)return{key:e,enabled:!!n,variant:"string"==typeof n?n:void 0,payload:w(a)}}}else this.rt.warn('getFeatureFlagResult for key "'+e+a2)}}Ga(e){try{var t;null==(t=this.un)||t.capture("$feature_flag_called",e).catch(e=>{this.rt.error("Failed to capture feature flag call",e)}
1)}catch(e){this.rt.error("Failed to capture feature flag call",e)}}getRemoteConfigPayload(e,t){this.Qa(e,t)}Qa(e,t){var i=this;return m(function*(){var s=i.un;if(s){var r={distinct_id:s.distinctId,token:s.projectToken,person_properties:{$lib:s.library.name,$lib_version:s.library.version}},n=i.Ha();n.length&&(r.evaluation_contexts=n);var a,o=i.Ua();Y(o)||(r.flag_keys=o);try{var l,u=null==(l=(yield s.sendRequest("/flags/?v=2",{target:"flags",method:"POST",body:r,compression:"base64"===i.Ne.compression?rz.Base64:void 0,sentAt:"body",timeoutMs:i.Ne.requestTimeoutMs})).json)?void 0:l.featureFlagPayloads;a=(null==u?void 0:u[e])||void 0}catch(e){return void i.rt.error("Remote config feature flag request failed",e)}try{t(a)}catch(e){i.rt.error("Remote config feature flag callback failed",e)}}})()}isFeatureEnabled(e,t){if(void 0===t&&(t={}),t.fresh&&!this.Ma)return t.defaultValue;if(!(this.wa||this.getFlags()&&this.getFlags().length>0))return this.rt.warn('isFeatureEnabled for key "'+e+a2),t.defaultValue;var i=this.getFeatureFlag(e,t);return Y(i)?t.defaultValue:!!i}addFeatureFlagsHandler(e){this.featureFlagEventHandlers.push(e)}removeFeatureFlagsHandler(e){this.featureFlagEventHandlers=this.featureFlagEventHandlers.filter(t=>t!==e)}receivedFeatureFlags(e,t,i){this.za(e,t,i)}za(e,t,i){if(this.un){this.wa=!0;var s=function(e,t,i,s,r,n){void 0===t&&(t={}),void 0===i&&(i={}),void 0===s&&(s={}),void 0===n&&(n=a0);var a,o,l=(a=n,(o=e.flags)?y({},e,{featureFlags:Object.fromEntries(Object.keys(o).map(e=>{var t;return[e,null!==(t=o[e].variant)&&void 0!==t?t:o[e].enabled]})),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&&a.warn("Using an older version of the feature flags endpoint. Please upgrade your PostHog server to the latest version"),e)),u=l.flags,h=l.featureFlags,c=l.featureFlagPayloads;if(h){var d=e.requestId,p=e.evaluatedAt;if(G(h)){n.warn("v1 of the feature flags endpoint is deprecated. Please use the latest version.");var v={};if(h)for(var g=0;h.length>g;g++)v[h[g]]=!0;return{[ib]:h,[iy]:v,[iS]:!1}}var f=h,_=c,m=u;if(null!=r&&r.partialResponse)f=y({},t,f),_=y({},i,_),m=y({},s,m);else if(e.errorsWhileComputingFlags){if(u){var b=new Set(Object.keys(u).filter(e=>{var t;return!(null!=(t=u[e])&&t.failed)}));f=y({},t,Object.fromEntries(Object.entries(f).filter(e=>b.has(e[0])))),_=y({},i,Object.fromEntries(Object.entries(_||{}).filter(e=>b.has(e[0])))),m=y({},s,Object.fromEntries(Object.entries(m||{}).filter(e=>b.has(e[0]))))}else f=y({},t,f),_=y({},i,_),m=y({},s,m)}return y({[ib]:Object.keys(a6(f)),[iy]:f||{},[iE]:_||{},[ix]:m||{},[iS]:!0===e.minimalFlagCalledEvents},d?{[ik]:d}:{},p?{[iq]:p}:{})}}(e,this.getFlagVariants(),this.getFlagPayloads(),this.getFlagsWithDetails(),i,this.rt);s&&this.F(s),t||(this.Ta=!1),this.Ka(t)}}override(e,t){void 0===t&&(t=!1),this.rt.warn("override is deprecated. Please use overrideFeatureFlags instead."),this.overrideFeatureFlags({flags:e,suppressWarning:t})}overrideFeatureFlags(e){this.Ja(e)}Ja(e){if(this.un){if(!1===e)return this.q([iP,iF]),this.Ka(),void a1.info("All overrides cleared");if(G(e))return this.F({[iP]:a5(e)}),this.Ka(),void a1.info("Flag overrides set",{flags:e});if(e&&"object"==typeof e&&("flags"in e||"payloads"in e)){this.ma=!!(null!==(t=e.suppressWarning)&&void 0!==t&&t);var t,i={},s=e.flags,r=e.payloads;return s&&(i[iP]=G(s)?a5(s):s),r&&(i[iF]=r),Object.keys(i).length&&this.F(i),!1===s&&!1===r?this.q([iP,iF]):!1===s?this.q(iP):!1===r&&this.q(iF),this.Ka(),!1===s?a1.info("Flag overrides cleared"):s&&a1.info("Flag overrides set",{flags:s}),void(!1===r?a1.info("Payload overrides cleared"):r&&a1.info("Payload overrides set",{payloads:r}))}if(e&&"object"==typeof e)return this.F({[iP]:e}),this.Ka(),void a1.info("Flag overrides set",{flags:e});this.rt.warn("Invalid overrideOptions provided to overrideFeatureFlags",{overrideOptions:e})}else this.rt.warn("posthog.featureFlags.overrideFeatureFlags called before feature flags were ready")}onFeatureFlags(e){if(this.addFeatureFlagsHandler(e),this.wa){var t=this.Ya(),i=t.flags,s=t.flagVariants;try{e(i,s)}catch(e){this.rt.error("Error while running feature flags callback",e)}}return()=>this.removeFeatureFlagsHandler(e)}updateEarlyAccessFeatureEnrollment(e,t,i){var s,r=(this.qa(iw)||[]).find(t=>t.flagKey===e),n={["$feature_enrollment/"+e]:t},a={$feature_flag:e,$feature_enrollment:t,$set:n};r&&(a.$early_access_feature_name=r.name),i&&(a.$feature_enrollment_stage=i);var o=y({},this.getFlagVariants(),{[e]:t});this.F({[ib]:Object.keys(a6(o)),[iy]:o,[iI]:y({},this.qa(iI)||{},n)}),this.Ka();try{null==(s=this.un)||s.capture("$feature_enrollment_update",a).catch(e=>{this.rt.error("Failed to capture early access feature enrollment",e)})}catch(e){this.rt.error("Failed to capture early access feature enrollment",e)}}getEarlyAccessFeatures(e,t,i){void 0===t&&(t=!1);var s=this.qa(iw);!s||t?this.Xa(e,i):e(s)}Xa(e,t){var i=this;return m(function*(){var s=i.un;if(s){var r,n=t?"&"+t.map(e=>"stage="+e).join("&"):"";try{var a=yield s.sendRequest("/api/early_access_features/?token="+s.projectToken+n,{target:"api",method:"GET",sentAt:"query"});if(!a.json)return;i.F({[iw]:r=a.json.earlyAccessFeatures})}catch(e){return void i.rt.error("Early access feature request failed",e)}try{e(r)}catch(e){i.rt.error("Early access feature callback failed",e)}}})()}Ya(){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),{})}}Ka(e){this.$a();var t=this.Ya(),i=t.flags,s=t.flagVariants;
1this.featureFlagEventHandlers.forEach(t=>{try{t(i,s,{errorsLoading:e})}catch(e){this.rt.error("Error while running feature flags callback",e)}})}setPersonPropertiesForFlags(e,t){void 0===t&&(t=!0),this.eo(e,t)}eo(e,t){void 0===t&&(t=!0);var i=this.qa(iI)||{},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 a in r)({}).hasOwnProperty.call(r,a)&&(a in i||(n[a]=r[a]));this.F({[iI]:y({},i,n,s)}),t&&this.reloadFeatureFlags()}unsetPersonPropertiesForFlags(e,t){void 0===t&&(t=!0);var i=y({},this.qa(iI)||{});e.forEach(e=>{delete i[e]}),this.F({[iI]:i}),t&&this.reloadFeatureFlags()}resetPersonPropertiesForFlags(e){void 0===e&&(e=!0),this.q(iI),e&&this.reloadFeatureFlags()}setGroupPropertiesForFlags(e,t){void 0===t&&(t=!0);var i=this.qa(i$)||{},s=y({},i);for(var r of Object.keys(e))s[r]=y({},i[r],e[r]);this.F({[i$]:s}),t&&this.reloadFeatureFlags()}resetGroupPropertiesForFlags(e){if(e){var t=this.qa(i$)||{};this.F({[i$]:y({},t,{[e]:{}})})}else this.q(i$)}reset(){this.xa++,this.Ca=!1,this.$a(),this.wa=!1,this.Sa=!1,this.Ma=!1,this.$anon_distinct_id=void 0,this.Na(),this.ma=!1,this.Ea=0}}},oo=y({productTours:class{get Mr(){return this._instance.persistence}constructor(e){this.gl=null,this.ml=null,this._instance=e}initialize(){this.loadIfEnabled()}onRemoteConfig(e){if(e.ok){var t,i,s=e.config;if("productTours"in s){if(this.Mr&&this.Mr.register({[il]:!!s.productTours}),!aq(this._instance))return!this.gl&&ee(null==(t=this.Mr)?void 0:t.props[iA])||aD.info("product tours disabled; stopping and clearing cached tours"),null==(i=this.gl)||i.stop(),this.gl=null,void this.clearCache();this.loadIfEnabled()}}}loadIfEnabled(){!this.gl&&aq(this._instance)&&this.ai(()=>this.yl())}ai(e){var t,i;null!=(t=g.__PosthogExtensions__)&&t.generateProductTours?e():null==(i=g.__PosthogExtensions__)||null==i.loadExternalDependency||i.loadExternalDependency(this._instance,"product-tours",t=>{t?aD.error("Could not load product tours script",t):e()})}yl(){var e;!this.gl&&null!=(e=g.__PosthogExtensions__)&&e.generateProductTours&&(this.gl=g.__PosthogExtensions__.generateProductTours(this._instance,!0))}getProductTours(e,t){if(void 0===t&&(t=!1),!G(this.ml)||t){var i=this.Mr;if(i){var s=i.props[iA];if(G(s)&&!t)return this.ml=s,void e(s,{isLoaded:!0})}this._instance._send_request({url:this._instance.requestRouter.endpointFor("api","/api/product_tours/?token="+this._instance.config.token),method:"GET",timestampMode:"query",callback:t=>{if(aq(this._instance)){var s=t.statusCode;if(200!==s||!t.json){var r="Product Tours API could not be loaded, status: "+s;return 0===s?t.error||aD.warn(r):aD.error(r),void e([],{isLoaded:!1,error:r})}var n=G(t.json.product_tours)?t.json.product_tours:[];this.ml=n,i&&i.register({[iA]:n}),e(n,{isLoaded:!0})}else e([],{isLoaded:!0})}})}else e(this.ml,{isLoaded:!0})}getActiveProductTours(e){ee(this.gl)?e([],{isLoaded:!1,error:"Product tours not loaded"}):this.gl.getActiveProductTours(e)}showProductTour(e){var t;null==(t=this.gl)||t.showTourById(e)}previewTour(e){this.gl?this.gl.previewTour(e):this.ai(()=>{var t;this.yl(),null==(t=this.gl)||t.previewTour(e)})}dismissProductTour(){var e;null==(e=this.gl)||e.dismissTour("user_clicked_skip")}nextStep(){var e;null==(e=this.gl)||e.nextStep()}previousStep(){var e;null==(e=this.gl)||e.previousStep()}clearCache(){var e;this.ml=null,null==(e=this.Mr)||e.unregister(iA)}resetTour(e){var t;null==(t=this.gl)||t.resetTour(e)}resetAllTours(){var e;null==(e=this.gl)||e.resetAllTours()}cancelPendingTour(e){var t;null==(t=this.gl)||t.cancelPendingTour(e)}}},oa),ol=y({surveys:class{get Ne(){return this._instance.config}constructor(e){this.Ol=void 0,this._surveyManager=null,this.Dl=!1,this.$l=[],this.Nl=null,this.ql=null,this._instance=e,this._surveyEventReceiver=null}initialize(){this.loadIfEnabled()}onRemoteConfig(e){if(!this.Ne.disable_surveys){if(!e.ok)return n6.warn("Remote config unavailable. Not loading surveys.");var t=e.config.surveys;if(ee(t))return n6.warn("Flags not loaded yet. Not loading surveys.");var i=G(t);this.Ol=i?t.length>0:t,n6.info("flags response received, isSurveysEnabled: "+this.Ol),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(n4)||null!=s&&s.startsWith("inProgressSurvey_"))&&t.push(s)}
1t.forEach(e=>localStorage.removeItem(e))}catch(e){}}loadIfEnabled(){if(!this._surveyManager){if(this.Dl)n6.info("Already initializing surveys, skipping...");else if(this.Ne.disable_surveys)n6.info(aK);else if(this.Ne.cookieless_mode&&this._instance.consent.isOptedOut())n6.info("Not loading surveys in cookieless mode without consent.");else{var e=null==g?void 0:g.__PosthogExtensions__;if(e){if(!Y(this.Ol)||this.Ne.advanced_enable_surveys){var t=this.Ol||this.Ne.advanced_enable_surveys;this.Dl=!0;try{var i=e.generateSurveys;if(i)return void this.jl(i,t);var s=e.loadExternalDependency;if(!s)return void this.Bl(iX);s(this._instance,"surveys",i=>{i||!e.generateSurveys?this.Bl("Could not load surveys script",i):this.jl(e.generateSurveys,t)})}catch(e){throw this.Bl("Error initializing surveys",e),e}finally{this.Dl=!1}}}else n6.error("PostHog Extensions not found.")}}}jl(e,t){this._surveyManager=e(this._instance,t),this._surveyEventReceiver=new aG(this._instance),n6.info("Surveys loaded successfully"),this.Hl({isLoaded:!0})}Bl(e,t){n6.error(e,t),this.Hl({isLoaded:!1,error:e})}onSurveysLoaded(e){return this.$l.push(e),this._surveyManager&&this.Hl({isLoaded:!0}),()=>{this.$l=this.$l.filter(t=>t!==e)}}getSurveys(e,t){if(void 0===t&&(t=!1),this.Ne.disable_surveys)return n6.info(aK),e([]);var i,s=this._instance.get_property(iR);if(s&&!t)return e(s,{isLoaded:!0}),void(this.Ul()&&this.getSurveys(()=>{},!0));"undefined"!=typeof Promise&&this.Nl?this.Nl.then(t=>e(t.surveys,t.context)):("undefined"!=typeof Promise&&(this.Nl=new Promise(e=>{i=e})),this._instance._send_request({url:this._instance.requestRouter.endpointFor("api","/api/surveys/?token="+this.Ne.token),method:"GET",timestampMode:"query",timeout:this.Ne.surveys_request_timeout_ms,callback:t=>{this.Nl=null;var s=t.statusCode;if(200!==s||!t.json){var r="Surveys API could not be loaded, status: "+s;0!==s?n6.error(r):t.error||n6.warn(r),this.ql=Date.now();var n={isLoaded:!1,error:r};return e([],n),void(null==i||i({surveys:[],context:n}))}this.ql=null;var a,o,l=t.json.surveys||[],u=l.filter(e=>{var t;return!(!e.start_date||e.end_date)&&(n5(e)||!(null==(t=e.conditions)||null==(t=t.actions)||null==(t=t.values)||!t.length))});u.length>0&&(null==(o=this._surveyEventReceiver)||o.register(u)),null==(a=this._instance.persistence)||a.register({[iR]:l,[iM]:Date.now()});var h={isLoaded:!0};e(l,h),null==i||i({surveys:l,context:h})}}))}Ul(){return this.zl()&&!this.Nl&&!this.Wl()}zl(){var e=this._instance.get_property(iM);return et(e)&&Date.now()-e>3e5}Wl(){return et(this.ql)&&3e5>Date.now()-this.ql}markSurveyAsSeen(e,t){var i;n8({id:e,current_iteration:null!==(i=null==t?void 0:t.iteration)&&void 0!==i?i:null});try{localStorage.setItem("lastSeenSurveyDate",new Date().toISOString())}catch(e){}}Hl(e){for(var t of this.$l)try{if(!e.isLoaded)return t([],e);this.getSurveys(t)}catch(e){n6.error("Error in survey callback",e)}}getActiveMatchingSurveys(e,t){if(void 0===t&&(t=!1),!ee(this._surveyManager))return this._surveyManager.getActiveMatchingSurveys(e,t);n6.warn("init was not called")}Vl(e){var t=null;return this.getSurveys(i=>{var s;t=null!==(s=i.find(t=>t.id===e))&&void 0!==s?s:null}),t}Zl(e){if(ee(this._surveyManager))return{eligible:!1,reason:aW};var t="string"==typeof e?this.Vl(e):e;return t?this._surveyManager.checkSurveyEligibility(t):{eligible:!1,reason:"Survey not found"}}Gl(e){if(ee(this._surveyManager))return{eligible:!1,reason:aW};var t="string"==typeof e?this.Vl(e):e;return t?this._surveyManager.checkSurveyRenderability(t):{eligible:!1,reason:"Survey not found"}}canRenderSurvey(e){if(ee(this._surveyManager))return n6.warn("init was not called"),{visible:!1,disabledReason:aW};var t=this.Gl(e);return{visible:t.eligible,disabledReason:t.reason}}canRenderSurveyAsync(e,t){return ee(this._surveyManager)?(n6.warn("init was not called"),Promise.resolve({visible:!1,disabledReason:aW})):new Promise(i=>{this.getSurveys(t=>{var s,r=null!==(s=t.find(t=>t.id===e))&&void 0!==s?s:null;if(r){var n=this.Gl(r);i({visible:n.eligible,disabledReason:n.reason})}else i({visible:!1,disabledReason:"Survey not found"})},t)})}renderSurvey(e,t,i){var s;if(ee(this._surveyManager))n6.warn("init was not called");else{var r="string"==typeof e?this.Vl(e):e;if(null!=r&&r.id){if(n9.includes(r.type)){var n=null==a?void 0:a.querySelector(t);if(n)return null!=(s=r.appearance)&&s.surveyPopupDelaySeconds?(n6.info("Rendering survey "+r.id+" with delay of "+r.appearance.surveyPopupDelaySeconds+" seconds"),void setTimeout(()=>{var e,t;n6.info("Rendering survey "+r.id+" with delay of "+(null==(e=r.appearance)?void 0:e.surveyPopupDelaySeconds)+" seconds"),null==(t=this._surveyManager)||t.renderSurvey(r,n,i),n6.info("Survey "+r.id+" rendered")},1e3*r.appearance.surveyPopupDelaySeconds)):void this._surveyManager.renderSurvey(r,n,i);n6.warn("Survey element not found")}else n6.warn("Surveys of type "+r.type+" cannot be rendered in the app")}else n6.warn("Survey not found")}}displaySurvey(e,t){var i;if(ee(this._surveyManager))n6.warn("init was not called");else{var s=this.Vl(e);if(s){var r=s;if(null!=(i=s.appearance)&&i.surveyPopupDelaySeconds&&t.ignoreDelay&&(r=y({},s,{appearance:y({},s.appearance,{surveyPopupDelaySeconds:0})}
1)),t.displayType!==rK.Popover&&t.initialResponses&&n6.warn("initialResponses is only supported for popover surveys. prefill will not be applied."),!1===t.ignoreConditions){var n=this.Zl(s);if(!n.eligible)return void n6.warn("Survey is not eligible to be displayed: ",n.reason)}t.displayType!==rK.Inline?this._surveyManager.handlePopoverSurvey(r,t):this.renderSurvey(r,t.selector,t.properties)}else n6.warn("Survey not found")}}cancelPendingSurvey(e){ee(this._surveyManager)?n6.warn("init was not called"):this._surveyManager.cancelSurvey(e)}handlePageUnload(){var e;null==(e=this._surveyManager)||null==e.handlePageUnload||e.handlePageUnload()}}},oa),ou=y({experiments:a7},oa),oh=y({},oa,{sessionRecording:class{get Ne(){return this._instance.config}get Mr(){return this._instance.persistence}get started(){var e;return!(null==(e=this.io)||!e.isStarted)}get status(){var e,t;return this.ro===aC||this.ro===aT?this.ro:null!==(e=null==(t=this.io)?void 0:t.status)&&void 0!==e?e:this.ro}constructor(e){if(this._forceAllowLocalhostNetworkCapture=!1,this.ro=aR,this.no=void 0,this.so=!1,this.ao=(()=>{if(null==a||!a.visibilityState||"visible"===a.visibilityState)return!0;var e,t=null==s||null==(e=s.performance)||null==e.getEntriesByType?void 0:e.getEntriesByType("visibility-state");return!(null!=t&&t.length)||t.some(e=>"visible"===e.name)})(),this.Ie=()=>{var e;"visible"===(null==a?void 0:a.visibilityState)&&(this.ao=!0,null==(e=this.io)||null==e.setDocumentWasEverVisible||e.setDocumentWasEverVisible(!0))},this._instance=e,!this._instance.sessionManager)throw aA.error("started without valid sessionManager"),Error(aO+" started without valid sessionManager. This is a bug.");if(this.Ne.cookieless_mode===i0)throw Error(aO+' cannot be used with cookieless_mode="always"');null!=a&&a.addEventListener&&sl(a,"visibilitychange",this.Ie)}initialize(){this.startIfEnabledOrStop()}dispose(){this.so=!0,null==a||null==a.removeEventListener||a.removeEventListener("visibilitychange",this.Ie),this.stopRecording()}get oo(){var e,t=!(null==(e=this._instance.get_property(ih))||!e.enabled),i=!this.Ne.disable_session_recording,r=this.Ne.disable_session_recording||this._instance.consent.isOptedOut();return s&&t&&i&&!r}startIfEnabledOrStop(e){var t;if(!(this.so||this.oo&&null!=(t=this.io)&&t.isStarted)){var i=!Y(Object.assign)&&!Y(Array.from);this.oo&&i?(this.lo(e),aA.info("starting")):(this.ro=aR,this.stopRecording())}}lo(e){var t,i,s;this.oo&&(this.ro!==aC&&this.ro!==aT&&(this.ro=aM),null!=g&&null!=(t=g.__PosthogExtensions__)&&null!=(t=t.rrweb)&&t.record&&null!=(i=g.__PosthogExtensions__)&&i.initSessionRecording?this.uo(e):null==(s=g.__PosthogExtensions__)||null==s.loadExternalDependency||s.loadExternalDependency(this._instance,this.ho,t=>{if(t)return aA.error("could not load recorder",t);this.uo(e)}))}stopRecording(){var e,t;null==(e=this.no)||e.call(this),this.no=void 0,null==(t=this.io)||t.stop()}do(){var e,t;null==(e=this.no)||e.call(this),this.no=void 0,null==(t=this.io)||t.discard()}vo(){var e,t;null==(e=this.Mr)||e.unregister(im),null==(t=this.Mr)||t.unregister(ic)}co(e,t){if(ee(e))return null;var i=et(e)?e:parseFloat(e);return"number"!=typeof i||!Number.isFinite(i)||0>i||i>1?(aA.warn(t+" must be between 0 and 1. Ignoring invalid value:",e),null):i}fo(e){if(this.Mr){var t,i,s=this.Mr,r=()=>{var t,i=!1===e.sessionRecording?void 0:e.sessionRecording,r=this.co(null==(t=this.Ne.session_recording)?void 0:t.sampleRate,"session_recording.sampleRate"),n=this.co(null==i?void 0:i.sampleRate,"remote config sampleRate"),a=null!=r?r:n;ee(a)&&this.vo();var o=null==i?void 0:i.minimumDurationMilliseconds;s.register({[ih]:y({cache_timestamp:Date.now(),enabled:!!i},i,{networkPayloadCapture:y({capturePerformance:e.capturePerformance},null==i?void 0:i.networkPayloadCapture),canvasRecording:{enabled:null==i?void 0:i.recordCanvas,fps:null==i?void 0:i.canvasFps,quality:null==i?void 0:i.canvasQuality},sampleRate:a,minimumDurationMilliseconds:Y(o)?null:o,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.no)||t.call(this),this.no=null==(i=this._instance.sessionManager)?void 0:i.onSessionId(r)}}onRemoteConfig(e){var t=e.ok?e.config:void 0;return t&&"sessionRecording"in t?!1===t.sessionRecording?(this.fo(t),void this.do()):(this.fo(t),void this.startIfEnabledOrStop()):(this.ro===aC&&(this.ro=aT,aA.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.io)&&i.log?this.io.log(e,t):aA.warn("log called before recorder was ready")}get ho(){var e,t,i=null==(e=this._instance)||null==(e=e.persistence)?void 0:e.get_property(ih);return(null==i||null==(t=i.scriptConfig)?void 0:t.script)||"lazy-recorder"}po(){var e,t=this._instance.get_property(ih);if(!t)return!1;try{e="object"==typeof t?t:JSON.parse(t)}catch(e){return aA.warn("persisted remote config for session recording is invali
1d and will be ignored",e),!1}return!ee(e.cache_timestamp)&&36e5>=Date.now()-e.cache_timestamp}uo(e){var t,i,s,r;if(!this.so){if(null==(t=g.__PosthogExtensions__)||!t.initSessionRecording)return aA.warn("Called on script loaded before session recording is available. This can be caused by adblockers."),void this._instance.register_for_session({[iQ]:!0});if(this.io||(this.io=null==(r=g.__PosthogExtensions__)?void 0:r.initSessionRecording(this._instance,this.ao),this.io._forceAllowLocalhostNetworkCapture=this._forceAllowLocalhostNetworkCapture),!this.po()){if(this.ro===aT||this.ro===aC)return;return this.ro=aC,aA.info("persisted remote config is stale, requesting fresh config before starting"),void new r0(this._instance).load()}this.ro=aM,null==(i=(s=this.io).setDocumentWasEverVisible)||i.call(s,this.ao),this.io.start(e)}}onRRwebEmit(e){var t;null==(t=this.io)||null==t.onRRwebEmit||t.onRRwebEmit(e)}overrideLinkedFlag(){var e,t;this.io||null==(t=this.Mr)||t.register({[ip]:!0}),null==(e=this.io)||e.overrideLinkedFlag()}overrideSampling(){var e,t;this.io||null==(t=this.Mr)||t.register({[id]:!0}),null==(e=this.io)||e.overrideSampling()}overrideTrigger(e){var t,i;this.io||null==(i=this.Mr)||i.register({["url"===e?iv:ig]:!0}),null==(t=this.io)||t.overrideTrigger(e)}get sdkDebugProperties(){var e;return(null==(e=this.io)?void 0:e.sdkDebugProperties)||{$recording_status:this.status}}tryAddCustomEvent(e,t){var i;return!(null==(i=this.io)||!i.tryAddCustomEvent(e,t))}}},{autocapture:class{constructor(e){this.mo=!1,this.yo=null,this.bo=!1,this._o=!1,this.instance=e,this.rageclicks=new ax(e.config.rageclick),this.wo=null}initialize(){this.startIfEnabled()}get Ne(){var e,t,i=K(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}ko(){if(this.isBrowserSupported()){if(s&&a){var e=e=>{e=e||(null==s?void 0:s.event);try{this.xo(e)}catch(e){ak.error("Failed to capture event",e)}};if(sl(a,"submit",e,{capture:!0}),sl(a,"change",e,{capture:!0}),sl(a,"click",e,{capture:!0}),this.Ne.capture_copied_text){var t=e=>{e=e||(null==s?void 0:s.event);try{this.xo(e,aE)}catch(e){ak.error("Failed to capture copy/cut event",e)}};sl(a,"copy",t,{capture:!0}),sl(a,"cut",t,{capture:!0})}}}else ak.info("Disabling Automatic Event Collection because this browser is not supported")}startIfEnabled(){this.isEnabled&&!this.mo&&(this.ko(),this.mo=!0)}onRemoteConfig(e){if(this.bo=!0,e.ok){var t=e.config;t.elementsChainAsString&&(this._o=t.elementsChainAsString);var i=t.autocapture_opt_out;es(i)&&(this.instance.persistence&&this.instance.persistence.register({[ie]:i}),this.yo=i),this.startIfEnabled()}else this.startIfEnabled()}setElementSelectors(e){this.wo=e}getElementSelectors(e){var t,i=[];return null==(t=this.wo)||t.forEach(t=>{var s=null==a?void 0:a.querySelectorAll(t);null==s||s.forEach(s=>{e===s&&i.push(t)})}),i}get isEnabled(){var e,t,i=null==(e=this.instance.persistence)?void 0:e.props[ie],s=this.yo,r=this.instance.Qi()&&!this.bo;if(Z(s)&&!es(i)&&!r)return!1;var n=null!==(t=this.yo)&&void 0!==t?t:!!i;return!!this.instance.config.autocapture&&!n}xo(e,t){if(void 0===t&&(t="$autocapture"),this.isEnabled){var i,r=sU(e);sL(r)&&(r=r.parentNode||null),"$autocapture"===t&&"click"===e.type&&e instanceof MouseEvent&&this.instance.config.rageclick&&null!=(i=this.rageclicks)&&i.isRageClick(e.clientX,e.clientY,e.timeStamp||new Date().getTime())&&s0(r,this.instance.config.rageclick)&&this.xo(e,"$rageclick");var n=t===aE;if(r&&function(e,t,i,r,n,a){if(!s||s1(e)||null!=i&&i.url_allowlist&&!sj(i.url_allowlist,a)||null!=i&&i.url_ignorelist&&sj(i.url_ignorelist,a))return!1;if(null!=i&&i.dom_event_allowlist){var o,l=i.dom_event_allowlist;if(l&&!l.some(e=>t.type===e))return!1}var u=s2(e,r),h=u.parentIsUsefulElement,c=u.targetElementList;if(!function(e,t){var i=null==t?void 0:t.element_allowlist;if(Y(i))return!0;var s,r=function(e){if(i.some(t=>e.tagName.toLowerCase()===t))return{v:!0}};for(var n of e)if(s=r(n))return s.v;return!1}(c,i)||!sG(c,null==i?void 0:i.css_selector_allowlist)||sG(c,null!==(o=null==i?void 0:i.css_selector_ignorelist)&&void 0!==o?o:sK))return!1;try{var d=s.getComputedStyle(e);
1if(d&&"pointer"===d.getPropertyValue("cursor")&&"click"===t.type)return!0}catch(e){}var p=e.tagName.toLowerCase();switch(p){case"html":return!1;case"form":return(n||["submit"]).indexOf(t.type)>=0;case"input":case"select":case"textarea":return(n||["change","click"]).indexOf(t.type)>=0;default:return h?(n||["click"]).indexOf(t.type)>=0:(n||["click"]).indexOf(t.type)>=0&&(sV.indexOf(p)>-1||"true"===e.getAttribute("contenteditable"))}}(r,e,this.Ne,n,n?["copy","cut"]:void 0,this.instance)){var a=function(e,t){var i,r,n=t.e,a=t.maskAllElementAttributes,o=t.maskAllText,l=t.elementAttributeIgnoreList,u=t.elementsChainAsString,h=t.disableCaptureUrlHashes;if(!sA(e))return{props:{}};for(var c=[e],d=new Set([e]),p=e;p.parentNode&&!sN(p,"body")&&1e3>c.length;)if(sD(p.parentNode)){var v=p.parentNode.host;if(d.has(v))break;d.add(v),c.push(v),p=v}else{if(!sA(p.parentNode)||d.has(p.parentNode))break;d.add(p.parentNode),c.push(p.parentNode),p=p.parentNode}var g,f=[],_={},m=!1,b=!1;if(st(c,e=>{var t=s3(e);if(sN(e,"a")){var i=e.getAttribute("href");m=!!(t&&i&&rt(i))&&(h?tc(i):i)}q(sH(e),"ph-no-capture")&&(b=!0),f.push(function(e,t,i,s,r){void 0===r&&(r=!1);var n=e.tagName.toLowerCase(),a={tag_name:n};sV.indexOf(n)>-1&&!i&&(a.$el_text="a"===n.toLowerCase()||"button"===n.toLowerCase()?aS(1024,ri(e)):aS(1024,sz(e)));var o=sH(e);o.length>0&&(a.classes=o.filter(function(e){return""!==e})),st(e.attributes,function(i){var n;if((!s5(e)||-1!==["name","id","class","aria-label"].indexOf(i.name))&&(null==s||!s.includes(i.name))&&!t&&rt(i.value)&&(!Q(n=i.name)||"_ngcontent"!==n.substring(0,10)&&"_nghost"!==n.substring(0,7))){var o=i.value;"class"===i.name&&(o=sq(o).join(" ")),a["attr__"+i.name]=aS(1024,"href"===i.name&&r?tc(o):o)}});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&&!sA(t));return t}(h);)l++,h.tagName===e.tagName&&u++;return a.nth_child=l,a.nth_of_type=u,a}(e,a,o,l,h)),si(_,function(e){if(!s3(e))return{};var t={};return st(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&&rt(s)&&(t[i]=s)}}),t}(e))}),b)return{props:{},explicitNoCapture:b};if(o||(f[0].$el_text=sN(e,"a")||sN(e,"button")?ri(e):sz(e)),m){f[0].attr__href=m;var w,x,E=null==(w=rm(m))?void 0:w.host,k=null==s||null==(x=s.location)?void 0:x.host;E&&k&&E!==k&&(g=m)}return{props:si({$event_type:n.type,$ce_version:1},u?{}:{$elements:f},{$elements_chain:f.map(e=>{var t,i,s={text:null==(t=e.$el_text)?void 0:t.slice(0,400),tag_name:e.tag_name,href:null==(i=e.attr__href)?void 0:i.slice(0,2048),attr_class:function(e){var t=e.attr__class;if(t)return G(t)?t:sq(t)}(e),attr_id:e.attr__id,nth_child:e.nth_child,nth_of_type:e.nth_of_type,attributes:{}};return ss(e).filter(e=>0===e[0].indexOf("attr__")).forEach(e=>s.attributes[e[0]]=e[1]),s}).map(e=>{var t,i,s="";if(e.tag_name&&(s+=e.tag_name),e.attr_class)for(var r of(e.attr_class.sort(),e.attr_class))s+="."+r.replace(/"/g,"");var n=y({},e.text?{text:e.text}:{},{"nth-child":null!==(t=e.nth_child)&&void 0!==t?t:0,"nth-of-type":null!==(i=e.nth_of_type)&&void 0!==i?i:0},e.href?{href:e.href}:{},e.attr_id?{attr_id:e.attr_id}:{},e.attributes),a={};return ss(n).sort((e,t)=>e[0].localeCompare(t[0])).forEach(e=>{var t=e[1];return a[rs(e[0].toString())]=rs(t.toString())}),(s+=":")+ss(a).map(e=>e[0]+'="'+e[1]+'"').join("")}).join(";")},null!=(i=f[0])&&i.$el_text?{$el_text:null==(r=f[0])?void 0:r.$el_text}:{},g&&"click"===n.type?{$external_click_url:g}:{},_)}}(r,{e:e,maskAllElementAttributes:this.instance.config.mask_all_element_attributes,maskAllText:this.instance.config.mask_all_text,elementAttributeIgnoreList:this.Ne.element_attribute_ignorelist,elementsChainAsString:this._o,disableCaptureUrlHashes:this.instance.config.disable_capture_url_hashes}),o=a.props;if(a.explicitNoCapture)return!1;var l=this.getElementSelectors(r);if(l&&l.length>0&&(o.$element_selectors=l),t===aE){var u,h=sB(null==s||null==(u=s.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 W(null==a?void 0:a.querySelectorAll)}},historyAutocapture:class{constructor(e){var t;this._instance=e,this.So=(null==s||null==(t=s.location)?void 0:t.pathname)||""}initialize(){this.startIfEnabled()}get isEnabled(){return"history_change"===this._instance.config.capture_pageview}startIfEnabled(){this.isEnabled&&(t1.info("History API monitoring enabled, starting..."),this.monitorHistoryChanges())}stop(){this.Co&&this.Co(),this.Co=void 0,t1.info("History API monitoring stopped")}monitorHistoryChanges(){s&&s.history&&(this.Mo("pushState"),this.Mo("replaceState"),this.To())}Mo(e){var t;if(s&&(null==(t=s.history[e])||!t.__posthog_wrapped__)){var i=this;!function(e,t,i){try{if(!(t in e))return aF;var s={next:e[t]},r=i(function(){for(var e=arguments.length,t=Array(e),i=0;e>i;i++)t[i]=arguments[i];return s.next.apply(this,t)});W(r)&&(r.prototype=r.prototype||{},Object.defineProperties(r,{__posthog_wrapped__:{enumerable:!1,value:!0},__posthog_layer__:{enumerable:!1,value:s}})),e[t]=r,()=>{if(e[t]!==r)for(var i=e[t];W(i)&&i.__posthog_layer__;){var n=i.__posthog_layer__;if(n.next===r)return void(n.next=s.next);i=n.next}else e[t]=s.next}}catch(e){return aF}}(s.history,e,t=>
vendor: 5,214 bytes, line 1
1function(s,r,n){t.call(this,s,r,n),i.Eo(e)})}}Eo(e){try{var t,i=null==s||null==(t=s.location)?void 0:t.pathname;if(!i)return;i!==this.So&&this.isEnabled&&this._instance.capture(i4,{navigation_type:e}),this.So=i}catch(t){t1.error("Error capturing "+e+" pageview",t)}}To(){if(!this.Co){var e=()=>{this.Eo("popstate")};sl(s,"popstate",e),this.Co=()=>{s&&s.removeEventListener("popstate",e)}}}},heatmaps:class{get Ne(){return this.instance.config}constructor(e){var t;this.Io=!1,this.mo=!1,this.Po=null,this.instance=e,this.Io=!(null==(t=this.instance.persistence)||!t.props[it]),this.rageclicks=new ax(e.config.rageclick)}initialize(){this.startIfEnabled()}get flushIntervalMilliseconds(){var e=5e3;return K(this.Ne.capture_heatmaps)&&this.Ne.capture_heatmaps.flush_interval_milliseconds&&(e=this.Ne.capture_heatmaps.flush_interval_milliseconds),e}get isEnabled(){return ee(this.Ne.capture_heatmaps)?ee(this.Ne.enable_heatmaps)?this.Io:this.Ne.enable_heatmaps:!1!==this.Ne.capture_heatmaps}startIfEnabled(){if(this.isEnabled)this.mo||(aN.info("starting..."),this.Ro(),this.Ie());else{var e;clearInterval(null!==(e=this.Po)&&void 0!==e?e:void 0),this.Ao(),this.getAndClearBuffer()}}onRemoteConfig(e){if(e.ok){var t=e.config;if("heatmaps"in t){var i=!!t.heatmaps;this.instance.persistence&&this.instance.persistence.register({[it]:i}),this.Io=i,this.startIfEnabled()}}}getAndClearBuffer(){var e=this.R;return this.R=void 0,e}Fo(e){aL(e.originalEvent)&&this.ke(e.originalEvent,"deadclick")}Ie(){this.Po&&clearInterval(this.Po),this.Po="visible"===(null==a?void 0:a.visibilityState)?setInterval(this.cr.bind(this),this.flushIntervalMilliseconds):null}Ro(){s&&a&&(this.Lo=this.cr.bind(this),sl(s,i6,this.Lo),this.Oo=e=>this.ke(e||(null==s?void 0:s.event)),sl(a,"click",this.Oo,{capture:!0}),this.Do=e=>this.$o(e||(null==s?void 0:s.event)),sl(a,"mousemove",this.Do,{capture:!0}),this.No=new ro(this.instance,rn,this.Fo.bind(this)),this.No.startIfEnabledOrStop(),this.qo=this.Ie.bind(this),sl(a,i5,this.qo),this.mo=!0)}Ao(){var e;s&&a&&(this.Lo&&s.removeEventListener(i6,this.Lo),this.Oo&&a.removeEventListener("click",this.Oo,{capture:!0}),this.Do&&a.removeEventListener("mousemove",this.Do,{capture:!0}),this.qo&&a.removeEventListener(i5,this.qo),clearTimeout(this.jo),null==(e=this.No)||e.stop(),this.mo=!1)}Bo(e,t){var i=this.instance.scrollManager.scrollY(),r=this.instance.scrollManager.scrollX(),n=this.instance.scrollManager.scrollElement(),a=function(e,t,i){for(var r=e;r&&sA(r)&&!sN(r,"body")&&r!==i;){var n,a,o,l=void 0;try{l=null==(n=null!==(a=null==(o=r.ownerDocument)?void 0:o.defaultView)&&void 0!==a?a:s)?void 0:n.getComputedStyle(r).position}catch(e){break}if(q(t,l))return!0;r=sW(r)}return!1}(sU(e),["fixed","sticky"],n);return{x:e.clientX+(a?0:r),y:e.clientY+(a?0:i),target_fixed:a,type:t}}ke(e,t){var i;if(void 0===t&&(t="click"),!sO(e.target)&&aL(e)){var s=this.Bo(e,t);null!=(i=this.rageclicks)&&i.isRageClick(e.clientX,e.clientY,new Date().getTime())&&s0(sU(e),this.instance.config.rageclick)&&this.Vt(y({},s,{type:"rageclick"})),this.Vt(s)}}$o(e){!sO(e.target)&&aL(e)&&(clearTimeout(this.jo),this.jo=setTimeout(()=>{this.Vt(this.Bo(e,"mousemove"))},500))}Vt(e){if(s){var t=this.Ne.disable_capture_url_hashes?tc(s.location.href):s.location.href,i=this.Ne.custom_personal_data_properties,r=rb(t,this.Ne.mask_personal_data_properties?[...rS,...i||[]]:[],rF);this.R=this.R||{},this.R[r]||(this.R[r]=[]),this.R[r].push(e)}}cr(){this.R&&!J(this.R)&&this.instance.capture("$$heatmap",{$heatmap_data:this.getAndClearBuffer()})}},deadClicksAutocapture:ro,webVitalsAutocapture:class{constructor(e){var t;this.Io=!1,this.mo=!1,this.R={navigationKey:void 0,url:void 0,metrics:[],firstMetricTimestamp:void 0},this.Ho=()=>{clearTimeout(this.Uo),this.Uo=void 0,0!==this.R.metrics.length&&(this._instance.capture("$web_vitals",y({$current_url:this.R.url},this.R.metrics.reduce((e,t)=>y({},e,{["$web_vitals_"+t.name+"_event"]:y({},t),["$web_vitals_"+t.name+"_value"]:t.value}),{}))),this.R={navigationKey:void 0,url:void 0,metrics:[],firstMetricTimestamp:void 0})},this.zo=e=>{var t;if(this.R=this.R||{navigationKey:void 0,url:void 0,metrics:[],firstMetricTimestamp:void 0},ee(null==e?void 0:e.name)||ee(null==e?void 0:e.value))a$.error("Invalid metric received",e);else{var i="string"==typeof e.navigationURL?e.navigationURL:void 0,s=this.Wo(i);if(!Y(s)){var r=et(e.navigationId)||"string"==typeof e.navigationId?"navigation:"+e.navigationId:"url:"+s;if(!this.Vo||this.Vo>e.value){this.R.navigationKey!==r&&(this.Ho(),this.Uo=setTimeout(this.Ho,this.flushToCaptureTimeoutMs)),Y(this.R.navigationKey)&&(this.R.navigationKey=r,this.R.url=s),this.R.firstMetricTimestamp=Y(this.R.firstMetricTimestamp)?Date.now():this.R.firstMetricTimestamp,e.attribution&&e.attribution.interactionTargetElement&&(e.attribution.interactionTargetElement=void 0);var n=null==(t=this._instance.sessionManager)?void 0:t.checkAndGetSessionAndWindowId(!0),a=y({},e,i?{navigationURL:s}:{},{$current_url:s,timestamp:Date.now()});Y(n)||(a.$session_id=n.sessionId,a.$window_id=n.windowId),this.R.metrics.push(a),this.R.metrics.length===this.allowedMetrics.length&&this.Ho()}else a$.error("Ignoring metric with value >= "+this.Vo,e)}}},this.Zo=()=>
1{if(!this.mo){var e,t,i,s,r=g.__PosthogExtensions__,n=null==r?void 0:r.postHogWebVitalsCallbacksByFlavor,a=(null==n?void 0:n[this.Go])||("web-vitals"===this.Go&&Y(n)?null==r?void 0:r.postHogWebVitalsCallbacks:void 0);if(Y(a)||(e=a.onLCP,t=a.onCLS,i=a.onFCP,s=a.onINP),e&&t&&i&&s){var o={reportSoftNavs:this.useSoftNavs};this.allowedMetrics.indexOf("LCP")>-1&&e(this.zo.bind(this),o),this.allowedMetrics.indexOf("CLS")>-1&&t(this.zo.bind(this),o),this.allowedMetrics.indexOf("FCP")>-1&&i(this.zo.bind(this),o),this.allowedMetrics.indexOf("INP")>-1&&s(this.zo.bind(this),o),this.mo=!0}else a$.error("web vitals callbacks not loaded - not starting")}},this._instance=e,this.Io=!(null==(t=this._instance.persistence)||!t.props[ia]),this.startIfEnabled()}get Qo(){return this._instance.config.capture_performance}get allowedMetrics(){var e,t,i=K(this.Qo)?null==(e=this.Qo)?void 0:e.web_vitals_allowed_metrics:void 0;return ee(i)?(null==(t=this._instance.persistence)?void 0:t.props[iu])||["CLS","FCP","INP","LCP"]:i}get flushToCaptureTimeoutMs(){return(K(this.Qo)?this.Qo.web_vitals_delayed_flush_ms:void 0)||5e3}get useAttribution(){var e=K(this.Qo)?this.Qo.web_vitals_attribution:void 0;return null!=e&&e}get useSoftNavs(){var e=K(this.Qo)?this.Qo.__preview_web_vitals_soft_navs:void 0;return null!=e&&e}get Vo(){var e=K(this.Qo)&&et(this.Qo.__web_vitals_max_value)?this.Qo.__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 a$.info("Web Vitals are disabled on non-http/https protocols"),!1;var t=K(this.Qo)?this.Qo.web_vitals:es(this.Qo)?this.Qo:void 0;return es(t)?t:this.Io}startIfEnabled(){this.isEnabled&&!this.mo&&(a$.info("enabled, starting..."),this.ai(this.Zo))}onRemoteConfig(e){if(e.ok){var t=e.config;if("capturePerformance"in t){var i=K(t.capturePerformance)&&!!t.capturePerformance.web_vitals,s=K(t.capturePerformance)?t.capturePerformance.web_vitals_allowed_metrics:void 0;this._instance.persistence&&(this._instance.persistence.register({[ia]:i}),this._instance.persistence.register({[iu]:s})),this.Io=i,this.startIfEnabled()}}}get Go(){return this.useSoftNavs?this.useAttribution?"web-vitals-with-attribution-soft-navs":"web-vitals-soft-navs":this.useAttribution?"web-vitals-with-attribution":"web-vitals"}ai(e){var t=g.__PosthogExtensions__,i=this.Go,s=null==t?void 0:t.postHogWebVitalsCallbacksByFlavor;null!=s&&s[i]||"web-vitals"===i&&Y(s)&&null!=t&&t.postHogWebVitalsCallbacks?e():null==t||null==t.loadExternalDependency||t.loadExternalDependency(this._instance,i,t=>{t?a$.error("failed to load script",t):e()})}Wo(e){var t=e||(null==s?void 0:s.location.href);if(t){var i=this._instance.config.disable_capture_url_hashes?tc(t):t,r=this._instance.config.custom_personal_data_properties;return rb(i,this._instance.config.mask_personal_data_properties?[...rS,...r||[]]:[],rF)}a$.error("Could not determine current URL")}}},{exceptionObserver:class{constructor(e){var t;this.Zo=()=>{var e;if(s&&this.isEnabled&&null!=(e=g.__PosthogExtensions__)&&e.errorWrappingFunctions){var t=g.__PosthogExtensions__.errorWrappingFunctions.wrapOnError,i=g.__PosthogExtensions__.errorWrappingFunctions.wrapUnhandledRejection,r=g.__PosthogExtensions__.errorWrappingFunctions.wrapConsoleError;try{!this.Ko&&this.Ne.capture_unhandled_errors&&(this.Ko=t(this.captureException.bind(this))),!this.Jo&&this.Ne.capture_unhandled_rejections&&(this.Jo=i(this.captureException.bind(this))),!this.Yo&&this.Ne.capture_console_errors&&(this.Yo=r(this.captureException.bind(this)))}catch(e){aP.error("failed to start",e),this.Xo()}}},this._instance=e,this.tl=!(null==(t=this._instance.persistence)||!t.props[ii]),this.el=new eg(y({},function(e){var t,i,s,r;return void 0===e&&(e={}),{refillRate:null!==(t=null!==(i=e.exceptionRateLimiterRefillRate)&&void 0!==i?i:e.__exceptionRateLimiterRefillRate)&&void 0!==t?t:1,bucketSize:null!==(s=null!==(r=e.exceptionRateLimiterBucketSize)&&void 0!==r?r:e.__exceptionRateLimiterBucketSize)&&void 0!==s?s:10}}(this._instance.config.error_tracking),{refillInterval:1e4,rt:aP})),this.Ne=this.il(),this.startIfEnabledOrStop()}il(){var e=this._instance.config.capture_exceptions,t={capture_unhandled_errors:!1,capture_unhandled_rejections:!1,capture_console_errors:!1};return K(e)?t=y({},t,e):(Y(e)?this.tl:e)&&(t=y({},t,{capture_unhandled_errors:!0,capture_unhandled_rejections:!0})),t}get isEnabled(){return this.Ne.capture_console_errors||this.Ne.capture_unhandled_errors||this.Ne.capture_unhandled_rejections}startIfEnabledOrStop(){this.isEnabled?(aP.info("enabled"),this.Xo(),this.ai(this.Zo)):this.Xo()}ai(e){var t,i;null!=(t=g.__PosthogExtensions__)&&t.errorWrappingFunctions?e():null==(i=g.__PosthogExtensions__)||null==i.loadExternalDependency||i.loadExternalDependency(this._instance,"exception-autocapture",t=>{if(t)return aP.error("failed to load script",t);e()})}Xo(){var e,t,i;null==(e=this.Ko)||e.call(this),this.Ko=void 0,null==(t=this.Jo)||t.call(this),this.Jo=void 0,null==(i=this.Yo)||i.call(this),this.Yo=void 0}onRemoteConfig(e){if(e.ok){var t=e.config;"autocaptureExceptions"in t&&(this.tl=!!t.autocaptureExceptions,this._instance.persistence&&this._instance.persistence.register({[ii]:this.tl}),this.Ne=this.il(),this.startIfEnabledOrStop())}}onConfigChange(){this.Ne=this.il()}captureException(e){var t,i,s,r=null!==(t=null==e||null==(i=e.$exception_list)||null==(i=i[0])?void 0:i.type)&&void 0!==t?t:"Exception";this.el.consumeRateLimit(r)?aP.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.rl=[],this.nl=new tP([new tL,new tW,new tq,new tD,new tV,new tU,new tH,new tG],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"),a=s;n.length>a;a++){var o=n[a];if(1024>=o.length){var l=tN.test(o)?o.replace(tN,"$1"):o;if(!l.match(/\S*Error: /)){for(var u of i){var h=u(l,e);if(h){r.push(h);break}}if(r.length>=50)break}}}return function(e){if(!e.length)return[];var t=Array.from(e);return t.reverse(),t.slice(0,50).map(e=>y({},e,{filename:e.filename||(t[t.length-1]||{}).filename,function:e.function||"?"}))}(r)}}("web:javascript",tC,tA)),this._instance=e,this.rl=null!==(t=null==(i=this._instance.persistence)?void 0:i.get_property(is))&&void 0!==t?t:[],this.sl=tX(this.al()),this.ol=new tZ(this.sl)}onConfigChange(){this.sl=tX(this.al()),this.ol.setConfig(this.sl)}onRemoteConfig(e){var t,i,s;if(e.ok){var r=e.config;if("errorTracking"in r){var n=null!==(t=null==(i=r.errorTracking)?void 0:i.suppressionRules)&&void 0!==t?t:[],a=null==(s=r.errorTracking)?void 0:s.captureExtensionExceptions;this.rl=n,this._instance.persistence&&this._instance.persistence.register({[is]:this.rl,[ir]:a})}}}get ll(){var e,t=!!this._instance.get_property(ir),i=this._instance.config.error_tracking.captureExtensionExceptions;return null!==(e=null!=i?i:t)&&void 0!==e&&e}buildProperties(e,t){return this.nl.buildFromUnknown(e,{syntheticException:null==t?void 0:t.syntheticException,mechanism:{handled:null==t?void 0:t.handled}})}addExceptionStep(e,t){if(this.sl.enabled)try{if(!Q(e)||0===e.trim().length)return void a4.warn("Ignoring exception step because message must be a non-empty string");var i=function(e){if(!e)return{sanitizedProperties:{},droppedKeys:[]};var t=[];return{sanitizedProperties:Object.keys(e).reduce((i,s)=>(tY.has(s)?t.push(s):i[s]=e[s],i),{}),droppedKeys:t}}(this.ul(t)),s=i.sanitizedProperties,r=i.droppedKeys;r.length>0&&a4.warn("Ignoring reserved exception step fields",{droppedKeys:r}),this.ol.add(y({[tK]:e,[tJ]:new Date().toISOString()}
1,s))}catch(e){a4.error("Failed to add exception step. Ignoring breadcrumb.",e)}}sendExceptionEvent(e){try{var t,i=e.$exception_list;if(this.hl(i)){if(this.dl(i))return this.vl("Exception dropped: matched a suppression rule"),void a4.info("Skipping exception capture because a suppression rule matched");if(!this.ll&&this.cl(i))return this.vl("Exception dropped: thrown by a browser extension"),void a4.info("Skipping exception capture because it was thrown by an extension");if(!this._instance.config.error_tracking.__capturePostHogExceptions&&this.fl(i))return this.vl("Exception dropped: thrown by the PostHog SDK"),void a4.info("Skipping exception capture because it was thrown by the PostHog SDK")}var s=this.sl.enabled&&ee(e.$exception_steps)?this.pl(e):e,r="string"==typeof(t=globalThis._posthogReleaseId)&&t.length>0?t:void 0;r&&(s.$release_id=r);try{var n=this._instance.capture("$exception",s,{_noTruncate:!0,_batchKey:"exceptionEvent",Qn:!0});return n&&this.ol.clear(),n}catch(e){return a4.error("Failed to capture exception event. Dropping this exception.",e),void this.ol.clear()}}catch(e){return void a4.error("Failed to process exception event. Ignoring this exception.",e)}}pl(e){try{var t=this.ol.getAttachable();return 0===t.length?e:y({},e,{$exception_steps:t})}catch(t){return a4.error("Failed to read buffered exception steps. Capturing exception without steps.",t),e}}vl(e){this.sl.enabled&&this.ol.add({[tK]:e,[tJ]:new Date().toISOString()})}ul(e){return K(e)?y({},e):{}}al(){var e,t;return null!==(e=null==(t=this._instance.config.error_tracking)?void 0:t.exception_steps)&&void 0!==e?e:{}}dl(e){if(0===e.length)return!1;try{var t=e.reduce((e,t)=>{var i=t.type,s=t.value;return Q(i)&&i.length>0&&e.$exception_types.push(i),Q(s)&&s.length>0&&e.$exception_values.push(s),e},{$exception_types:[],$exception_values:[]});return this.rl.some(e=>{var i=e.values.map(e=>{var i=nY[e.operator],s=t[e.key];if(!i||!s)return!1;var r=G(e.value)?e.value:[e.value];return r.length>0&&i(r,s)});return"OR"===e.type?i.some(Boolean):i.every(Boolean)})}catch(e){return a4.warn("Failed to evaluate suppression rules. Capturing the exception.",e),!1}}cl(e){return e.flatMap(e=>{var t,i;return null!==(t=null==(i=e.stacktrace)?void 0:i.frames)&&void 0!==t?t:[]}).some(e=>e.filename&&e.filename.startsWith("chrome-extension://"))}fl(e){if(e.length>0){var t,i,s,r,n=null!==(t=null==(i=e[0].stacktrace)?void 0:i.frames)&&void 0!==t?t:[],a=n[n.length-1];return null!==(s=null==a||null==(r=a.filename)?void 0:r.includes("posthog.com/static"))&&void 0!==s&&s}return!1}hl(e){return!ee(e)&&G(e)}}},oo,{siteApps:class{constructor(e){this.bl=0,this._instance=e,this._l=[],this.apps={}}get isEnabled(){return!!this._instance.config.opt_in_site_apps}wl(e,t){if(t){var i=this.globalsForEvent(t);this._l.push(i),this._l.length>1e3&&(this._l=this._l.slice(10))}}get siteAppLoaders(){var e;return null==(e=g._POSTHOG_REMOTE_CONFIG)||null==(e=e[this._instance.config.token])?void 0:e.siteApps}initialize(){if(this.isEnabled){var e=this._instance._addCaptureHook(this.wl.bind(this));this.kl=()=>{e(),this._l=[],this.kl=void 0}}}globalsForEvent(e){if(!e)throw Error("Event payload is required");var t,i,s,r,n,a,o,l={},u=this._instance.get_property("$groups")||[];for(var h of Object.entries(this._instance.get_property("$stored_group_properties")||{})){var c=h[0];l[c]={id:u[c],type:c,properties:h[1]}}var d=e.$set_once,p=e.$set;return{event:y({},b(e,aj),{properties:y({},e.properties,p?{$set:y({},null!==(t=null==(i=e.properties)?void 0:i.$set)&&void 0!==t?t:{},p)}:{},d?{$set_once:y({},null!==(s=null==(r=e.properties)?void 0:r.$set_once)&&void 0!==s?s:{},d)}:{}),elements_chain:null!==(n=null==(a=e.properties)?void 0:a.$elements_chain)&&void 0!==n?n:"",distinct_id:null==(o=e.properties)?void 0:o.distinct_id}),person:{properties:this._instance.get_property("$stored_person_properties")},groups:l}}xl(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)||(aH.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)||(aH.error("prepare_external_dependency_script returned null"),null):e}Sl(){if(!this._instance.config.prepare_external_dependency_stylesheet&&!this._instance.config.prepare_external_dependency_script)return()=>{};var e,t,i,s,r,n,o,l,u=null==a?void 0:a.defaultView,h=null==u||null==(e=u.Node)?void 0:e.prototype;if(!u||!h)return()=>{};if(this.bl++,this.Cl)return this.Ml();var c=[],d=this,p=new WeakSet,v=(e,t,i)=>{if(null!=e&&e[t]){var s=e[t];e[t]=i(s),c.push(()=>{e[t]=s})}},g=e=>{if(p.has(e))return e;var t=d.xl(e);return t&&p.add(t),t},f=e=>e.map(e=>"string"==typeof e?e:g(e)).filter(e=>!Z(e));return v(h,"appendChild",e=>function(t){var i=g(t);return i?e.call(this,i):t}),v(h,"insertBefore",e=>function(t,i){var s=g(t);return s?e.call(this,s,i):t}),v(h,"replaceChild",e=>function(t,i){var s=g(t);return s?e.call(this,s,i):i}),[null==(t=u.Element)?void 0:t.prototype,null==(i=u.Document)?void 0:i.prototype,null==(s=u.DocumentFragment)?void 0:s.prototype].forEach(e
vendor: 6,421 bytes, line 1
1=>{v(e,"append",e=>function(){for(var t=arguments.length,i=Array(t),s=0;t>s;s++)i[s]=arguments[s];return e.apply(this,f(i))}),v(e,"prepend",e=>function(){for(var t=arguments.length,i=Array(t),s=0;t>s;s++)i[s]=arguments[s];return e.apply(this,f(i))})}),[null==(r=u.Element)?void 0:r.prototype,null==(n=u.CharacterData)?void 0:n.prototype,null==(o=u.DocumentType)?void 0:o.prototype].forEach(e=>{v(e,"before",e=>function(){for(var t=arguments.length,i=Array(t),s=0;t>s;s++)i[s]=arguments[s];return e.apply(this,f(i))}),v(e,"after",e=>function(){for(var t=arguments.length,i=Array(t),s=0;t>s;s++)i[s]=arguments[s];return e.apply(this,f(i))}),v(e,"replaceWith",e=>function(){for(var t=arguments.length,i=Array(t),s=0;t>s;s++)i[s]=arguments[s];var r=f(i);return i.length&&!r.length?void 0:e.apply(this,r)})}),v(null==(l=u.Element)?void 0:l.prototype,"insertAdjacentElement",e=>function(t,i){var s=g(i);return s?e.call(this,t,s):null}),this.Cl=()=>{c.forEach(e=>e()),this.Cl=void 0},this.Ml()}Ml(){var e=!1;return()=>{var t;e||(e=!0,this.bl--,0===this.bl&&(null==(t=this.Cl)||t.call(this)))}}Tl(e,t){void 0===t&&(t=!0);var i=this.Sl();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._l.length&&(aH.info("Processing "+this._l.length+" events for site app with id "+e.id),this._l.forEach(e=>this.Tl(()=>null==t.processEvent?void 0:t.processEvent(e))),t.processedBuffer=!0),Object.values(this.apps).every(e=>e.processedBuffer||e.errored)&&(null==(i=this.kl)||i.call(this))},s=!1,r=r=>{t.errored=!r,t.loaded=!0,aH.info("Site app with id "+e.id+" "+(r?"loaded":"errored")),s&&i()};try{var n=this.Tl(t=>e.init({posthog:this._instance,callback(e){t(),r(e)}}),!1).processEvent;n&&(t.processEvent=n),s=!0}catch(t){aH.error(aB+e.id,t),r(!1)}if(s&&t.loaded)try{i()}catch(i){aH.error("Error while processing buffered events PostHog app with config id "+e.id,i),t.errored=!0}}El(){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)}Il(e){var t=this;if(0!==Object.keys(this.apps).length){var i=this.globalsForEvent(e),s=function(s){try{t.Tl(()=>null==s.processEvent?void 0:s.processEvent(i))}catch(t){aH.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.El(),void this._instance.on("eventCaptured",e=>this.Il(e))):void aH.error('PostHog site apps are disabled. Enable the "opt_in_site_apps" config to proceed.');if(null==(i=this.kl)||i.call(this),e.ok){var n=e.config;if(null!=(s=n.siteApps)&&s.length){if(this.isEnabled)for(var a of n.siteApps)!function(){var e,t=a.id,i=a.url;g["__$$ph_site_app_"+t]=r._instance,null==(e=g.__PosthogExtensions__)||null==e.loadSiteApp||e.loadSiteApp(r._instance,i,e=>{if(e)return aH.error(aB+t,e)})}();else aH.error('PostHog site apps are disabled. Enable the "opt_in_site_apps" config to proceed.')}}}}},ol,{tracingHeaders:class{constructor(e){this.Pl=void 0,this.Rl=void 0,this.Al=void 0,this.Zo=()=>{var e,t,i=this.Fl();i?(Y(this.Pl)&&(this.Pl=null==(e=g.__PosthogExtensions__)||null==(e=e.tracingHeadersPatchFns)?void 0:e._patchXHR(i,()=>this._instance.get_distinct_id(),this._instance.sessionManager)),Y(this.Rl)&&(this.Rl=null==(t=g.__PosthogExtensions__)||null==(t=t.tracingHeadersPatchFns)?void 0:t._patchFetch(i,()=>this._instance.get_distinct_id(),this._instance.sessionManager))):this.Xo()},this._instance=e}initialize(){this.startIfEnabledOrStop()}ai(e){var t,i;null!=(t=g.__PosthogExtensions__)&&t.tracingHeadersPatchFns?e():null==(i=g.__PosthogExtensions__)||null==i.loadExternalDependency||i.loadExternalDependency(this._instance,"tracing-headers",t=>{if(t)return aI.error("failed to load script",t);e()})}Ll(){var e,t;return null!==(e=null!==(t=this._instance.config.tracing_headers)&&void 0!==t?t:this._instance.config.addTracingHeaders)&&void 0!==e?e:this._instance.config.__add_tracing_headers}Fl(){var e=this.Ll();return G(e)?(G(this.Al)?this.Al.splice(0,this.Al.length,...e):this.Al=[...e],e.length>0?this.Al:void 0):(G(this.Al)&&this.Al.splice(0),this.Al=e||void 0,this.Al)}Xo(){var e,t;null==(e=this.Pl)||e.call(this),null==(t=this.Rl)||t.call(this),this.Pl=void 0,this.Rl=void 0}startIfEnabledOrStop(){this.Fl()?this.ai(this.Zo):this.Xo()}}},{toolbar:class{constructor(e){this.instance=e}Ql(e){g.ph_toolbar_state=e}Kl(){var e;return null!==(e=g.ph_toolbar_state)&&void 0!==e?e:0}initialize(){return this.maybeLoadToolbar()}maybeLoadToolbar(e,t,i){if(void 0===e&&(e=void 0),void 0===t&&(t=void 0),void 0===i&&(i=void 0),su(this.instance.config)||!s||!a)return!1;e=null!=e?e:s.location,i=null!=i?i:s.history;try{if(!t){try{s.localStorage.setItem("test","test"),s.localStorage.removeItem("test")}catch(e){return!1}t=null==s?void 0:s.localStorage}var r,n=aJ||rw(e.hash,"__posthog")||rw(e.hash,"state"),o=n?sr(()=>JSON.parse(atob(decodeURIComponent(n))))||sr(()=>JSON.parse(decodeURIComponent(n))):null;return o&&"ph_authorize"===o.action?((r=o).source="url",r&&Object.keys(r).length>0&&(o.desiredHash?e.hash=o.desiredHash:i?i.replaceState(i.state,"",e.pathname+e.search):e.hash="")):((r=JSON.parse(t.getItem(aY)||"{}")).source="localstorage",delete r.userIntent),!(!r.token||this.instance.config.token!==r.token||(this.loadToolbar(r),0))}catch(e){return!1}}Jl(e){var t=g.ph_load_toolbar||g.ph_load_editor;!ee(t)&&W(t)?t(e,this.instance):aQ.warn("No toolbar load function found")}loadToolbar(e){var t,i=!(null==a||!a.getElementById(sT));if(!s||i)return!1;var r="custom"===this.instance.requestRouter.region&&this.instance.config.advanced_disable_toolbar_metrics,n=y({token:this.instance.config.token},e,{apiURL:this.instance.requestRouter.endpointFor("ui")},r?{instrument:!1}:{});return(s.localStorage.setItem(aY,JSON.stringify(y({},n,{source:void 0}))),2===this.Kl())?this.Jl(n):0===this.Kl()&&(this.Ql(1),null==(t=g.__PosthogExtensions__)||null==t.loadExternalDependency||t.loadExternalDependency(this.instance,"toolbar",e=>{if(e)return aQ.error("[Toolbar] Failed to load",e),void this.Ql(0);this.Ql(2),this.Jl(n)}),sl(s,"turbolinks:load",()=>{this.Ql(0),this.loadToolbar(n)})),!0}Yl(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)}}}
1,ou,{conversations:class{constructor(e){this.Xl=void 0,this._conversationsManager=null,this.tu=!1,this.eu=null,this.iu=!1,this._instance=e}initialize(){this.loadIfEnabled()}onRemoteConfig(e){if(!this._instance.config.disable_conversations&&(this.ru=e.ok,e.ok)){var t=e.config.conversations;ee(t)||(es(t)?this.Xl=t:(this.Xl=t.enabled,this.eu=t),this.loadIfEnabled())}}reset(){var e;null==(e=this._conversationsManager)||e.reset(),this._conversationsManager=null,this.Xl=void 0,this.eu=null,this.ru=void 0,this.iu=!1}loadIfEnabled(){if(!(this._conversationsManager||this.tu||this._instance.config.disable_conversations||su(this._instance.config)||this._instance.config.cookieless_mode&&this._instance.consent.isOptedOut())){var e=null==g?void 0:g.__PosthogExtensions__;if(e&&!Y(this.Xl)&&this.Xl){if(this.eu&&this.eu.token){this.tu=!0;try{var t=e.initConversations;if(t)return this.nu(t),void(this.tu=!1);var i=e.loadExternalDependency;if(!i)return void this.su(iX);i(this._instance,"conversations",t=>{t||!e.initConversations?this.su("Could not load conversations script",t):this.nu(e.initConversations),this.tu=!1})}catch(e){this.su("Error initializing conversations",e),this.tu=!1}}else oe.error("Conversations enabled but missing token in remote config.")}}}nu(e){if(this.eu)try{this._conversationsManager=e(this.eu,this._instance),this.iu=!1,oe.info("Conversations loaded successfully")}catch(e){this.su("Error completing conversations initialization",e)}else oe.error("Cannot complete initialization: remote config is null")}su(e,t){oe.error(e,t),this._conversationsManager=null,this.tu=!1,this.iu=!0}show(){this._conversationsManager?this._conversationsManager.show():oe.warn("Conversations not loaded yet.")}hide(){this._conversationsManager&&this._conversationsManager.hide()}isAvailable(){return!0===this.Xl&&!Z(this._conversationsManager)}getUnavailableReason(){return this.isAvailable()?null:this._instance.config.disable_conversations?"disabled_by_config":su(this._instance.config)?"disabled_for_toolbar":this._instance.config.cookieless_mode&&this._instance.consent.isOptedOut()?"consent_opted_out":!1===this.ru?"remote_config_failed":Y(this.Xl)?this.ru?"disabled_in_project":"remote_config_pending":this.Xl?ee(this.eu)||!this.eu.token?"missing_token":null!=g&&g.__PosthogExtensions__?this.tu?"initializing":this.iu?"load_failed":"not_loaded":"extensions_unavailable":"disabled_in_project"}isVisible(){var e,t;return null!==(e=null==(t=this._conversationsManager)?void 0:t.isVisible())&&void 0!==e&&e}sendMessage(e,t,i){var s=this;return m(function*(){return s._conversationsManager?s._conversationsManager.sendMessage(e,t,i):(oe.warn(ot),null)})()}getMessages(e,t){var i=this;return m(function*(){return i._conversationsManager?i._conversationsManager.getMessages(e,t):(oe.warn(ot),null)})()}markAsRead(e){var t=this;return m(function*(){return t._conversationsManager?t._conversationsManager.markAsRead(e):(oe.warn(ot),null)})()}getTickets(e){var t=this;return m(function*(){return t._conversationsManager?t._conversationsManager.getTickets(e):(oe.warn(ot),null)})()}requestRestoreLink(e){var t=this;return m(function*(){return t._conversationsManager?t._conversationsManager.requestRestoreLink(e):(oe.warn(ot),null)})()}restoreFromToken(e){var t=this;return m(function*(){return t._conversationsManager?t._conversationsManager.restoreFromToken(e):(oe.warn(ot),null)})()}restoreFromUrlToken(){var e=this;return m(function*(){return e._conversationsManager?e._conversationsManager.restoreFromUrlToken():(oe.warn(ot),null)})()}getCurrentTicketId(){var e,t;return null!==(e=null==(t=this._conversationsManager)?void 0:t.getCurrentTicketId())&&void 0!==e?e:null}getWidgetSessionId(){var e,t;return null!==(e=null==(t=this._conversationsManager)?void 0:t.getWidgetSessionId())&&void 0!==e?e:null}ns(){var e;null==(e=this._conversationsManager)||e.setIdentity()}ss(){var e;null==(e=this._conversationsManager)||e.clearIdentity()}}},{logs:class{constructor(e){var t,i=this;this.au=!1,this.ou=!1,this.rt=t2("[logs]"),this.lu=y({},this.rt,{error(){for(var e=arguments.length,t=Array(e),s=0;e>s;s++)t[s]=arguments[s];t.some(on)||i.rt.error(...t)}}),this.tr=[],this.uu=[],this.Ea=0,this.hu=()=>{var e,t;this.Ea=0,null==(e=this.du)||e.onReconnect(),null==(t=this.vu)||t.onReconnect()},this._instance=e,this._instance&&null!=(t=this._instance.config.logs)&&t.captureConsoleLogs&&(this.au=!0),s&&sl(s,"online",this.hu)}cu(e,t,i,s){var r,n,a,o,l,u,h,c,d,p,v,g,f,_,m=(d=null!==(n=null==(r=null==(_=this._instance)||null==(_=_.config)?void 0:_.logs)?void 0:r.flushIntervalMs)&&void 0!==n?n:3e3,p=null!==(a=null==r?void 0:r.maxBufferSize)&&void 0!==a?a:100,g=Y(v=null!=i&&i.consoleCapture?void 0:null!==(o=null==r?void 0:r.maxLogsPerInterval)&&void 0!==o?o:1e3)?Math.max(p,2048):Math.max(p,v),{serviceName:null!==(l=null!==(u=null==(f=null==r?void 0:r.resourceAttributes)?void 0:f["service.name"])&&void 0!==u?u:null==r?void 0:r.serviceName)&&void 0!==l?l:null==i?void 0:i.serviceNameDefault,serviceVersion:null!==(h=null==f?void 0:f["service.version"])&&void 0!==h?h:null==r?void 0:r.serviceVersion,environment:null!==(c=null==f?void 0:f["deployment.environment"])&&void 0!==c?c:null==r?void 0:r.environment,resourceAttributes:f,beforeSend:null==r?void 0:r.beforeSend,flushIntervalMs:d,maxBufferSize:p,maxQueueSize:g,maxBatchRecordsPerPost:100,rateCapWindowMs:d,maxLogsPerInterval:v,backgroundFlushBudgetMs:0,terminationFlushBudgetMs:0});return[new tw(this.fu(e,t),m,this.lu,()=>this.pu(),e=>e(),void 0,s),m]}gu(){var e,t=null==(e=this._instance)||null==(e=e.config)?void 0:e.logs;if(!this.du||this.mu!==t){null==(i=this.du)||i.reset(),this.mu=t;var i,s=this.cu(()=>this.tr,e=>{this.tr=e});this.du=s[0],this.yu=s[1]}return this.du}bu(){var e,t=null==(e=this._instance)||null==(e=e.config)?void 0:e.logs;if(!this.vu||this._u!==t){null==(i=this.vu)||i.reset(),this._u=t;var i,s=this.cu(()=>this.uu,e=>{this.uu=e},{serviceNameDefault:"posthog-browser-logs",consoleCapture:!0},oi);this.vu=s[0],this.wu=s[1]}return this.vu}initialize(){this.loadIfEnabled()}onRemoteConfig(e){var t;if(e.ok){var i=null==(t=e.config.logs)?void 0:t.captureConsoleLogs;!ee(i)&&i&&(this.au=!0,this.loadIfEnabled())}}reset(){var e,t;this.tr=[],null==(e=this.du)||e.reset(),this.uu=[],null==(t=this.vu)||t.reset(),this.Ea=0}captureLog(e){this.gu().captureLog(e)}he(e){this.bu().captureLog(e)}get logger(){return this.ku||(this.ku={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)=>
1this.captureLog({body:e,level:"error",attributes:t}),fatal:(e,t)=>this.captureLog({body:e,level:"fatal",attributes:t})}),this.ku}flushLogs(e){e?this.xu(e):(this.du&&this.du.flush().catch(e=>this.Su(e)),this.vu&&this.vu.flush().catch(e=>this.Su(e)))}Su(e){on(e)||this.rt.error("PostHog logs flush failed:",e)}loadIfEnabled(){if(this.au&&!this.ou){var e=null==g?void 0:g.__PosthogExtensions__;if(e){var t=e.loadExternalDependency;t?t(this._instance,"logs",t=>{var i;t||null==(i=e.logs)||!i.initializeLogs?this.rt.error("Could not load logs script",t):(e.logs.initializeLogs(this._instance),this.ou=!0)}):this.rt.error(iX)}else this.rt.error("PostHog Extensions not found.")}}fu(e,t){var i=this._instance;return{get isDisabled(){return!1},get optedOut(){return!i.is_capturing()},getPersistedProperty:t=>t===P.LogsQueue?e():void 0,setPersistedProperty(e,i){e===P.LogsQueue&&t(null!=i?i:[])},Ot:e=>this.Ot(e),getLibraryId:()=>f.LIB_NAME,getLibraryVersion:()=>f.LIB_VERSION}}Ot(e){return new Promise(t=>{if(rx(this.Ea,3))t({kind:"fatal",error:or(void 0,"logs endpoint is unreachable, dropping batch")});else{var i=!1,s=e=>{i||(i=!0,clearTimeout(r),t(e))},r=setTimeout(()=>{this.rt.warn("Logs request timed out before receiving a response"),s({kind:"retry-later",error:or(void 0,"logs request timed out")})},9e4);this._instance._send_request({method:"POST",url:this.Cu(),data:e,compression:"best-available",batchKey:"logs",fireCallbackOnDrop:!0,callback:e=>{var t,i=e.statusCode;(this.Mu(i),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)}):0===i?(e.error||this.rt.warn("Logs request failed before receiving an HTTP response"),s({kind:"retry-later",error:or(e.error,"logs request failed before receiving an HTTP response")})):s({kind:"retry-later",error:null!==(t=e.error)&&void 0!==t?t:Error("logs request failed with status "+i)})}})}})}Mu(e){(0!==e||this._instance.__loaded)&&(this.Ea=rE(e,this.Ea,3,()=>this.rt.warn("Log requests are failing before receiving an HTTP response; this can happen due to network issues, CORS, browser blocking, or ad blockers. Stopped sending logs; will try again when connectivity changes.")))}xu(e){this.tr.length>0&&this.Tu(e,this.tr,this.yu,f.LIB_NAME,e=>{this.tr=e}),this.uu.length>0&&this.Tu(e,this.uu,this.wu,oi,e=>{this.uu=e})}Tu(e,t,i,s,r){if(0!==t.length){var n=t.map(e=>e.record);r([]);var a=tb(n,ty(i,f.LIB_NAME,f.LIB_VERSION),s,f.LIB_VERSION);this._instance._send_request({method:"POST",url:this.Cu(),data:a,compression:"best-available",batchKey:"logs",transport:e})}}Cu(){return this._instance.requestRouter.endpointFor("api","/i/v1/logs")+"?token="+encodeURIComponent(this._instance.config.token)}pu(){var e,t={};if(t.distinctId=this._instance.get_distinct_id(),this._instance.sessionManager){var i=this._instance.sessionManager.checkAndGetSessionAndWindowId(!0),s=i.windowId,r=i.sessionStartTimestamp,n=i.lastActivityTimestamp;t.sessionId=i.sessionId,t.windowId=s,ee(r)||(t.sessionStartTimestamp=r),ee(n)||(t.lastActivityTimestamp=n)}if(null!=g&&null!=(e=g.location)&&e.href&&(t.currentUrl=this._instance.config.disable_capture_url_hashes?tc(g.location.href):g.location.href),this._instance.featureFlags){var a=this._instance.featureFlags.getFlags();a&&a.length>0&&(t.activeFeatureFlags=a)}return t}}},{metrics:class{constructor(e){this.rt=t2("[metrics]"),this._instance=e}initialize(){}gu(){var e,t,i,s,r,n,a,o,l=null==(a=this._instance)||null==(a=a.config)?void 0:a.metrics;return this.du&&this.mu===l||(null==(o=this.du)||o.reset(),this.mu=l,this.du=new tS(this.fu(),{serviceName:null!==(e=null==(n=null==l?void 0:l.resourceAttributes)?void 0:n["service.name"])&&void 0!==e?e:null==l?void 0:l.serviceName,serviceVersion:null!==(t=null==n?void 0:n["service.version"])&&void 0!==t?t:null==l?void 0:l.serviceVersion,environment:null!==(i=null==n?void 0:n["deployment.environment"])&&void 0!==i?i:null==l?void 0:l.environment,resourceAttributes:n,beforeSend:null==l?void 0:l.beforeSend,flushIntervalMs:null!==(s=null==l?void 0:l.flushIntervalMs)&&void 0!==s?s:1e4,maxSeriesPerFlush:null!==(r=null==l?void 0:l.maxSeriesPerFlush)&&void 0!==r?r:1e3},this.rt)),this.du}count(e,t,i){void 0===t&&(t=1),this.gu().count(e,t,i)}
1gauge(e,t,i){this.gu().gauge(e,t,i)}histogram(e,t,i){this.gu().histogram(e,t,i)}flush(e){if(!this.du)return Promise.resolve();if(e){var t=this.du.drainWindow();return t&&this.Jt(t,e),Promise.resolve()}return this.du.flush().catch(e=>this.rt.error("PostHog metrics flush failed:",e))}reset(){var e;null==(e=this.du)||e.reset()}fu(){var e=this._instance,t=this;return{get isDisabled(){return!1},get optedOut(){return!e.is_capturing()},Jt:e=>t.Jt(e),getLibraryId:()=>f.LIB_NAME,getLibraryVersion:()=>f.LIB_VERSION}}Jt(e,t){return new Promise(i=>{var s=!1,r=e=>{s||(s=!0,clearTimeout(n),i(e))},n=setTimeout(()=>r({kind:"retry-later",error:Error("metrics request timed out")}),9e4);this._instance._send_request(y({method:"POST",url:this.Eu(),data:e,compression:"best-available",batchKey:"metrics"},t&&{transport:t},{fireCallbackOnDrop:!0,callback(e){var t,i=e.statusCode;i>=200&&300>i?r({kind:"ok"}):413===i?r({kind:"too-large"}):0!==i&&429!==i&&500>i?r({kind:"fatal",error:Error("metrics request failed with status "+i)}):r({kind:"retry-later",error:null!==(t=e.error)&&void 0!==t?t:Error("metrics request failed with status "+i)})}}))})}Eu(){return this._instance.requestRouter.endpointFor("api","/i/v1/metrics")+"?token="+encodeURIComponent(this._instance.config.token)}}});aw.__defaultExtensionClasses=y({},oh);var oc=function(){f.SDK_DIST_CHANNEL="npm";var e=ao[ag]=new aw;return function(){function e(){e.done||(e.done=!0,af=!1,st(ao,function(e){e._dom_loaded()}))}null!=a&&a.addEventListener?"complete"===a.readyState?e():sl(a,"DOMContentLoaded",e,{capture:!1}):s&&t1.error("Browser doesn't support `document.addEventListener` so PostHog couldn't be initialized")}(),e}()}}]);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.