1"use strict";(self.webpackChunkfilmustage_landing=self.webpackChunkfilmustage_landing||[]).push([[758],{22971:function(e,t,i){i.d(t,{Ay:function(){return Tu}});var s="undefined"!=typeof window?window:void 0,r="undefined"!=typeof globalThis?globalThis:s,n=null==r?void 0:r.navigator,o=null==r?void 0:r.document,a=null==r?void 0:r.location,l=null==r?void 0:r.fetch,u=null!=r&&r.XMLHttpRequest&&"withCredentials"in new r.XMLHttpRequest?r.XMLHttpRequest:void 0,h=null==r?void 0:r.AbortController,c=null==r?void 0:r.CompressionStream,d=null==n?void 0:n.userAgent;function v(){return!(!s||!1===s.navigator.onLine)}var p="undefined"!=typeof globalThis?globalThis:s;p&&"undefined"==typeof self&&(p.self=p),p&&"undefined"==typeof File&&(p.File=function(){});var g=null!=s?s:{},f={DEBUG:!1,LIB_VERSION:"0.5.0",LIB_NAME:"browser-common"};function _(e,t,i,s,r,n,o){try{var a=e[n](o),l=a.value}catch(e){return void i(e)}a.done?t(l):Promise.resolve(l).then(s,r)}function m(e){return function(){var t=this,i=arguments;return new Promise(function(s,r){var n=e.apply(t,i);function o(e){_(n,s,r,o,a,"next",e)}function a(e){_(n,s,r,o,a,"throw",e)}o(void 0)})}}function y(){return y=Object.assign?Object.assign.bind():function(e){for(var t=1;arguments.length>t;t++){var i=arguments[t];for(var s in i)({}).hasOwnProperty.call(i,s)&&(e[s]=i[s])}return e},y.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(r){return e}};function x(e){return"string"==typeof e||e}function k(e){return"string"==typeof e?e:void 0}var E,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}({}),I=function(e){return e.GZipJS="gzip-js",e.Base64="base64",e}({}),F=["$snapshot","$pageview","$pageleave","$set","survey dismissed","survey sent","survey shown","$identify","$groupidentify","$create_alias","$$client_ingestion_warning","$web_experiment_applied","$feature_enrollment_update","$feature_flag_called"],$=["token"],C="NativeGzipValidationError",T=e=>e.length>=2&&31===e[0]&&139===e[1],D=(e,t)=>e===I.GZipJS||t===I.GZipJS||"gzip"===t,M=e=>!(!e||"object"!=typeof e)&&"NotReadableError"===("name"in e?String(e.name):""),R=e=>
1{var t=new Error("Native gzip produced invalid output: "+e);throw t.name=C,t},O=function(){var e=m(function*(e,t){18>e.size&&R("too-short");var i=new Uint8Array(yield e.slice(0,10).arrayBuffer());T(i)&&8===i[2]||R("invalid-header");var s=new DataView(yield e.slice(e.size-8).arrayBuffer());s.getUint32(0,!0)!==(e=>{for(var t=(()=>{if(E)return E;E=[];for(var e=0;256>e;e++){for(var t=e,i=0;8>i;i++)t=1&t?3988292384^t>>>1:t>>>1;E[e]=t>>>0}return E})(),i=4294967295,s=0;e.length>s;s++)i=t[255&(i^e[s])]^i>>>8;return(4294967295^i)>>>0})(t)&&R("invalid-crc");var r=t.length>>>0;s.getUint32(4,!0)!==r&&R("invalid-size")});return function(t,i){return e.apply(this,arguments)}}();function A(){return A=m(function*(e,t,i){void 0===t&&(t=!0);try{var s=(new TextEncoder).encode(e),r=new globalThis.CompressionStream("gzip"),n=r.writable.getWriter(),o=n.write(s).then(()=>n.close()).catch(function(){var e=m(function*(e){try{yield n.abort(e)}catch(e){}throw e});return function(t){return e.apply(this,arguments)}}()),a=new Response(r.readable).blob(),l=(yield Promise.all([a,o]))[0];return yield O(l,s),l}catch(e){if(null!=i&&i.rethrow)throw e;return t&&console.error("Failed to gzip compress data",e),null}}),A.apply(this,arguments)}var L="[Truncated]",N="[Unserializable]";function j(e){for(var t="",i=0;e.length>i;i++){var s=e.charCodeAt(i);if(55296>s||s>56319)t+=56320>s||s>57343?e[i]:"�";else{var r=e.charCodeAt(i+1);56320>r||r>57343?t+="�":(t+=e[i]+e[i+1],i++)}}return t}var q=["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"],B=function(e,t){if(void 0===t&&(t=[]),!e)return!1;var i=e.toLowerCase();return q.concat(t).some(e=>{var t=e.toLowerCase();return-1!==i.indexOf(t)})};function H(e,t){return-1!==e.indexOf(t)}var z=function(e){return e.trim()},U=function(e){return e.replace(/^\$/,"")};function V(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 W=Object.prototype,G=W.hasOwnProperty,Y=W.toString,K=Array.isArray||function(e){return"[object Array]"===Y.call(e)},X=e=>"function"==typeof e,J=e=>e===Object(e)&&!K(e),Q=e=>{if(J(e)){for(var t in e)if(G.call(e,t))return!1;return!0}return!1},Z=e=>void 0===e,ee=e=>"[object String]"==Y.call(e),te=e=>ee(e)&&0===e.trim().length,ie=e=>null===e,se=e=>Z(e)||ie(e),re=e=>"[object Number]"==Y.call(e)&&e==e,ne=e=>re(e)&&e>0,oe=e=>"[object Boolean]"===Y.call(e),ae=e=>H(F,e),le=e=>H($,e);function ue(e){return null===e||"object"!=typeof e}function he(e,t){return{}.toString.call(e)==="[object "+t+"]"}function ce(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 ve(e,Error)}}function de(e){return"undefined"!=typeof Event&&ve(e,Event)}function ve(e,t){try{return e instanceof t}catch(e){return!1}}var pe=[!0,"true",1,"1","yes"],ge=e=>H(pe,e),fe=[!1,"false",0,"0","no"];function _e(e,t,i,s,r){return t>i&&(s.warn("min cannot be greater than max."),t=i),re(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),_e(r||i,t,i,s))}class me{constructor(e){this.k={},this.S=e.S,this.C=_e(e.bucketSize,0,100,e.I),this.R=_e(e.refillRate,0,this.C,e.I),this.A=_e(e.refillInterval,0,864e5,e.I)}O(e,t){var i=Math.floor((t-e.lastAccess)/this.A);i>0&&(e.tokens=Math.min(e.tokens+i*this.R,this.C),e.lastAccess=e.lastAccess+i*this.A)}consumeRateLimit(e){var t,i=Date.now(),s=String(e),r=this.k[s];return r?this.O(r,i):this.k[s]=r={tokens:this.C,lastAccess:i},0===r.tokens||(r.tokens--,0===r.tokens&&(null==(t=this.S)||t.call(this,e)),0===r.tokens)}stop(){this.k={}}}var ye="Mobile",be="iOS",we="Android",xe="Tablet",ke=we+" "+xe,Ee="iPad",Se="Apple",Pe=Se+" Watch",Ie="Safari",Fe="BlackBerry",$e="Samsung",Ce=$e+"Browser",Te=$e+" Internet",De="Chrome",Me=De+" OS",Re=De+" "+be,Oe="Internet Explorer",Ae=Oe+" "+ye,Le="Opera",Ne=Le+" Mini",je="Edge",qe="Microsoft "+je,Be="Firefox",He=Be+" "+be,ze="Nintendo",Ue="PlayStation",Ve="Xbox",We=we+" "+ye,Ge=ye+" "+Ie,Ye="Windows",Ke=Ye+" Phone",Xe="Nokia",Je="Ouya",Qe="Generic",Ze=Qe+" "+ye.toLowerCase(),et=Qe+" "+xe.toLowerCase(),tt="Konqueror",it="Oculus Browser",st="Vivaldi",rt="Yandex",nt="Whale",ot="DuckDuckGo",at="Pale Moon",lt="Waterfox",ut="Brave",ht="Google Search App",ct="(\\d+(\\.\\d+)?)",dt=new RegExp("Version/"+ct),vt=new RegExp(Ve,"i"),pt=new RegExp(Ue+" \\w+","i"),gt=new RegExp(ze+" \\w+","i"),ft=new RegExp(Fe+"|PlayBook|BB10","i"),_t={"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"},mt=function(e,t,i,s){t=t||"";var r=function(e){return null!=e&&e.brave?ut:null}(i);return r||(null!=s&&s.detectGoogleSearchApp&&H(e,"GSA/")?ht:H(e," OPR/")&&H(e,"Mini")?Ne:H(e," OPR/")?Le:ft.test(e)?Fe:H(e,"IE"+ye)||H(e,"WPDesktop")?Ae:H(e,"OculusBrowser")?it:H(e,Ce)?Te:H(e,je)||H(e,"Edg/")?qe:H(e,st+"/")?st:H(e,"YaBrowser/")?rt:H(e,nt+"/")?nt:H(e,ot+"/")||H(e,"Ddg/")?ot:H(e,"FBIOS")?"Facebook "+ye:H(e,"UCWEB")||H(e,"UCBrowser")?"UC Browser":H(e,"CriOS")?Re:H(e,"CrMo")||H(e,De)?De:H(e,we)&&H(e,Ie)?We:H(e,"FxiOS")?He:H(e.toLowerCase(),tt.toLowerCase())?tt:H(e,ut+"/")?ut:((e,t)=>t&&H(t,Se)||function(e){return H(e,Ie)&&!H(e,De)&&!H(e,we)}(e))(e,t)?H(e,ye)?Ge:Ie:H(e,"PaleMoon/")?at:H(e,lt+"/")?lt:H(e,Be)?Be:H(e,"MSIE")||H(e,"Trident/")?Oe:H(e,"Gecko")?Be:"")},yt={[Ae]:[new RegExp("rv:"+ct)],[qe]:[new RegExp(je+"?\\/"+ct)],[De]:[new RegExp("("+De+"|CrMo)\\/"+ct)],[Re]:[new RegExp("CriOS\\/"+ct)],"UC Browser":[new RegExp("(UCBrowser|UCWEB)\\/"+ct)],[Ie]:[dt],[Ge]:[dt],[Le]:[new RegExp("(Opera|OPR)\\/"+ct)],[Be]:[new RegExp(Be+"\\/"+ct)],[He]:[new RegExp("FxiOS\\/"+ct)],[tt]:[new RegExp("Konqueror[:/]?"+ct,"i")],[Fe]:[new RegExp(Fe+" "+ct),dt],[We]:[new RegExp("android\\s"+ct,"i")],[Te]:[new RegExp(Ce+"\\/"+ct)],[it]:[new RegExp("OculusBrowser\\/"+ct)],[st]:[new RegExp(st+"\\/"+ct)],[rt]:[new RegExp("YaBrowser\\/"+ct)],[nt]:[new RegExp(nt+"\\/"+ct)],[ut]:[new RegExp(ut+"\\/"+ct)],[ot]:[new RegExp("(DuckDuckGo|Ddg)\\/"+ct)],[at]:[new RegExp("PaleMoon\\/"+ct)],[lt]:[new RegExp(lt+"\\/"+ct)],[ht]:[new RegExp("GSA\\/"+ct)],[Oe]:[new RegExp("(rv:|MSIE )"+ct)],Mozilla:[new RegExp("rv:"+ct)]},bt=function(e,t,i,s){var r=mt(e,t,i,s),n=yt[r];if(Z(n))return null;for(var o=0;n.length>o;o++){var a=e.match(n[o]);if(a)return parseFloat(a[a.length-2])}return null},wt=[[new RegExp(Ve+"; "+Ve+" (.*?)[);]","i"),e=>[Ve,e&&e[1]||""]],[new RegExp(ze,"i"),[ze,""]],[new RegExp(Ue,"i"),[Ue,""]],[ft,[Fe,""]],[new RegExp(Ye,"i"),(e,t)=>{if(/Phone/.test(t)||/WPDesktop/.test(t))return[Ke,""];if(new RegExp(ye).test(t)&&!/IEMobile\b/.test(t))return[Ye+" "+ye,""];var i=/Windows NT ([0-9.]+)/i.exec(t);if(i&&i[1]){var s=_t[i[1]]||"";return/arm/i.test(t)&&(s="RT"),[Ye,s]}return[Ye,""]}],[/((iPhone|iPad|iPod).*?OS (\d+)_(\d+)_?(\d+)?|iPhone)/,e=>e&&e[3]?[be,[e[3],e[4],e[5]||"0"].join(".")]:[be,""]],[/(watch.*\/(\d+\.\d+\.\d+)|watch os,(\d+\.\d+),)/i,e=>{var t="";return e&&e.length>=3&&(t=Z(e[2])?e[3]:e[2]),["watchOS",t]}],[new RegExp("("+we+" (\\d+)\\.(\\d+)\\.?(\\d+)?|"+we+")","i"),e=>e&&e[2]?[we,[e[2],e[3],e[4]||"0"].join(".")]:[we,""]],[/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/,[Me,""]],[/Linux|debian/i,["Linux",""]]],xt=function(e){return gt.test(e)?ze:pt.test(e)?Ue:vt.test(e)?Ve:new RegExp(Je,"i").test(e)?Je:new RegExp("("+Ke+"|WPDesktop)","i").test(e)?Ke:/iPad/.test(e)?Ee:/iPod/.test(e)?"iPod Touch":/iPhone/.test(e)?"iPhone":/(watch)(?: ?os[,/]|\d,\d\/)[\d.]+/i.test(e)?Pe:ft.test(e)?Fe:/(kobo)\s(ereader|touch)/i.test(e)?"Kobo":new RegExp(Xe,"i").test(e)?Xe:/(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(ye).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)?we:ke:new RegExp("(pda|"+ye+")","i").test(e)?Ze:new RegExp(xe,"i").test(e)&&!new RegExp(xe+" pc","i").test(e)?et:""},kt=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;function Et(e,t){return"string"==typeof(i=e)&&kt.test(i)?e:t();var i}function St(e){return e?e.split("#")[0]:e}function Pt(e,t){var i=setTimeout(e,t);return(null==i?void 0:i.unref)&&(null==i||i.unref()),i}function It(e,t,i){return Ft.apply(this,arguments)}function Ft(){return(Ft=m(function*(e,t,i){var s;try{return yield Promise.race([e,new Promise((e,r)=>{s=Pt(()=>{try{null==i||i(),e()}catch(e){r(e)}},t)})])}finally{clearTimeout(s)}})).apply(this,arguments)}var $t={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}},Ct=$t.info,Tt=0x8000000000000000,Dt={}.propertyIsEnumerable;function Mt(e,t){try{return At(e,t,{ancestors:new WeakSet,remainingNodes:1e4}
vendor: 5,550 bytes, line 1
1,0)}catch(e){return[]}}function Rt(e,t,i,s){if(0>=i.remainingNodes)return{stringValue:L};if(i.remainingNodes--,oe(e))return{boolValue:e};if("number"==typeof e){if(!Number.isFinite(e))return{stringValue:String(e)};if(Number.isInteger(e)){if(Number.isSafeInteger(e))return{intValue:String(e)};if("undefined"==typeof BigInt)return{stringValue:String(e)};var r=BigInt(e).toString();return e>=Tt||-Tt>e?(null==t||t.debug("Attribute "+r+" is outside the int64 range; encoding it as a string"),{stringValue:r}):{intValue:r}}return{doubleValue:e}}if("string"==typeof e)return{stringValue:j(e)};if("function"==typeof e)return{stringValue:"[Function]"};if("symbol"==typeof e)return{stringValue:String(e)};if("object"==typeof e&&null!==e){if(i.ancestors.has(e))return{stringValue:"[Circular]"};if(s>=20)return{stringValue:L};if(e instanceof Date){var n=e.getTime(),o=Number.isFinite(n)?e.toISOString():String(e);return{stringValue:"string"==typeof o?j(o):String(o)}}i.ancestors.add(e);try{try{var a=e.toJSON;if("function"==typeof a)return Rt(a.call(e),t,i,s+1)}catch(e){}return K(e)?{arrayValue:{values:Ot(e,t,i,s+1)}}:{kvlistValue:{values:At(e,t,i,s+1)}}}finally{i.ancestors.delete(e)}}return{stringValue:j(String(e))}}function Ot(e,t,i,s){for(var r=[],n=Math.min(e.length,1e3),o=0;n>o&&i.remainingNodes>0;o++)try{var a=o in e?e[o]:void 0;if(se(a))continue;r.push(Rt(a,t,i,s))}catch(e){r.push({stringValue:N})}return e.length>o&&r.push({stringValue:L}),r}function At(e,t,i,s){var r=[];for(var n in e)if(Dt.call(e,n)){if(r.length>=1e3||0>=i.remainingNodes){null==t||t.debug("Attributes truncated: the value exceeds the OTLP encoder budget");break}try{var o=e[n];if(ie(o)||Z(o))continue;r.push({key:j(n),value:Rt(o,t,i,s)})}catch(e){r.push({key:j(n),value:{stringValue:N}})}}return r}function Lt(e){try{return j(String(e))}catch(e){return N}}function Nt(e,t,i){var s=$t[e.level||"info"]||Ct,r=s.text,n=s.number,o=String(Date.now())+"000000",a={};t.distinctId&&(a.posthogDistinctId=t.distinctId),t.sessionId&&(a.sessionId=t.sessionId),t.windowId&&(a["window.id"]=t.windowId),se(t.sessionStartTimestamp)||(a.sessionStartTimestamp=String(t.sessionStartTimestamp)),se(t.lastActivityTimestamp)||(a.lastActivityTimestamp=String(t.lastActivityTimestamp)),t.currentUrl&&(a["url.full"]=t.currentUrl),t.screenName&&(a["screen.name"]=t.screenName),t.appState&&(a["app.state"]=t.appState),t.activeFeatureFlags&&t.activeFeatureFlags.length>0&&(a.feature_flags=t.activeFeatureFlags);var l=y({},a),u=e.attributes;if(u){var h=[];try{h=Object.keys(u)}catch(e){h=[]}for(var c of h){var d=void 0;try{d=u[c]}catch(e){d=N}Object.defineProperty(l,c,{value:d,enumerable:!0,writable:!0,configurable:!0})}}var v={timeUnixNano:o,observedTimeUnixNano:o,severityNumber:n,severityText:r,body:{stringValue:Lt(e.body)},attributes:Mt(l,i)};return e.trace_id&&(v.traceId=e.trace_id),e.span_id&&(v.spanId=e.span_id),Z(e.trace_flags)||(v.flags=e.trace_flags),v}function jt(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 qt(e,t,i,s){return{resourceLogs:[{resource:{attributes:Mt(t)},scopeLogs:[{scope:{name:i,version:s},logRecords:e}]}]}}let Bt=class{constructor(e,t,i,s,r,n,o){var a;void 0===n&&(n=()=>Promise.resolve()),this._instance=e,this.Di=t,this.I=i,this.tn=s,this.en=r,this.rn=n,this.nn=o,this.sn=null,this.an=0,this.ln=0,this.un=0,this.hn=0,this.dn=!1,this.vn=t.maxBufferSize,this.cn=Math.max(null!==(a=t.maxQueueSize)&&void 0!==a?a:t.maxBufferSize,t.maxBufferSize),this.fn=t.flushIntervalMs,this.pn=t.maxBatchRecordsPerPost,this.gn=t.rateCapWindowMs,this.mn=t.maxLogsPerInterval}reset(){this.yn(),this.sn=null,this.un=0,this.hn=0,this.dn=!1,this.an=0,this.ln=0,this.pn=this.Di.maxBatchRecordsPerPost}onReconnect(){this.ln=0,this.bn()}captureLog(e){if(!this._instance.isDisabled&&!this._instance.optedOut&&null!=e&&e.body){var t=this._n(e);if(null!==t)if(t.body){if(this.wn()){var i={record:Nt(t,this.tn(),this.I)};this.en(()=>this.kn(i))}}else this.I.info("Log was rejected in beforeSend function")}}_n(e){var t=this.Di.beforeSend;if(!t)return e;var i=K(t)?t:[t],s=e;for(var r of i)try{var n=r(s);if(!n)return this.I.info("Log was rejected in beforeSend function"),null;s=n}catch(e){return this.I.error("Error in beforeSend function for log:",e),null}return s}wn(){if(void 0===this.mn)return!0;var e=Date.now(),t=e-this.un;return this.gn>t&&t>=0||(this.un=e,this.hn=0,this.dn=!1),this.mn>this.hn?(this.hn++,!0):(this.dn||(this.I.warn("captureLog dropping logs: exceeded "+this.mn+" logs per "+this.gn+"ms"),this.dn=!0),!1)}flush(){var e=this;return m(function*(){if(!e._instance.isDisabled)return e.sn||(e.sn=e.Sn().finally(()=>{e.sn=null})),e.sn})()}Sn(){var e=this;return m(function*(){var t;e.yn();var i=null!==(t=e._instance.getPersistedProperty(P.LogsQueue))&&void 0!==t?t:[];if(0!==i.length)for(var s=i.length,r=0;i.length>0&&s>r;){var n,o;e.an=0;var a=Math.min(i.length,e.pn),l=i.slice(0,a),u=qt(l.map(e=>e.record),e.xn(),null!==(n=e.nn)&&void 0!==n?n:e._instance.getLibraryId(),e._instance.getLibraryVersion()),h=yield e._instance.Cn(u);if("too-large"===h.kind&&l.length>1)e.pn=Math.max(1,Math.floor(l.length/2)),e.I.warn("Received 413 when sending logs batch of size "+l.length+", reducing batch size to "+e.pn);else{if("retry-later"===h.kind)throw h.error;if("too-large"===h.kind?e.I.warn("Dropping a single log record after 413 with batch size 1 â the record
1is larger than the server cap and cannot be split further."):"ok"===h.kind&&e.Di.maxBatchRecordsPerPost>e.pn&&(e.pn=Math.min(e.Di.maxBatchRecordsPerPost,e.pn+1)),yield e.Tn(l.length),i=null!==(o=e._instance.getPersistedProperty(P.LogsQueue))&&void 0!==o?o:[],r+=l.length,"fatal"===h.kind)throw h.error}}})()}Tn(e){var t=this;return m(function*(){var i,s=Math.max(0,e-t.an),r=null!==(i=t._instance.getPersistedProperty(P.LogsQueue))&&void 0!==i?i:[];t._instance.setPersistedProperty(P.LogsQueue,r.slice(s)),yield t.rn()})()}xn(){return jt(this.Di,this._instance.getLibraryId(),this._instance.getLibraryVersion())}kn(e){var t;if(!this._instance.optedOut){var i=null!==(t=this._instance.getPersistedProperty(P.LogsQueue))&&void 0!==t?t:[];this.cn>i.length||(i.shift(),this.an++,this.I.info("Logs queue is full, dropping oldest record.")),i.push(e),this._instance.setPersistedProperty(P.LogsQueue,i),this.vn>i.length?this.Mn():this.bn()}}Mn(e){void 0===e&&(e=this.fn),this.En||(this.En=Pt(()=>{this.En=void 0,this.bn()},e))}In(){var e=Math.min(Math.max(0,this.ln-1),6);return this.fn*Math.pow(2,e)}Rn(){var e=this._instance.getPersistedProperty(P.LogsQueue);return!!e&&e.length>0}shutdown(e){var t=this;return m(function*(){t.yn();var i=t.flush().catch(()=>{});void 0!==e?yield It(i,e):yield i})()}flushWithTimeout(e){var t=this;return m(function*(){var i=t.flush();yield It(i,e,()=>{i.catch(()=>{})})})()}bn(){this.flush().then(()=>{this.ln=0},e=>{this.ln++,this.I.error("PostHog logs flush failed:",e)}).finally(()=>{!this._instance.isDisabled&&this.Rn()&&this.Mn(this.In())})}yn(){this.En&&(clearTimeout(this.En),this.En=void 0)}};var Ht=[0,5,10,25,50,75,100,250,500,750,1e3,2500,5e3,7500,1e4];function zt(e){return String(e)+"000000"}function Ut(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 Vt=class{constructor(e,t,i){this._instance=e,this.Di=t,this.I=i,this.Pn=new Map,this.sn=null,this.An=!1,this.Fn=new Map,this.On=new Set,this.Ln=0}count(e,t,i){void 0===t&&(t=1),this.$n({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.$n({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.$n({name:e,type:"histogram",value:t,unit:null==i?void 0:i.unit,attributes:null==i?void 0:i.attributes})}flush(){var e=this,t=this.sn,i=function(){var i=m(function*(){t&&(yield t.catch(()=>{})),yield e.Dn()});return function(){return i.apply(this,arguments)}}(),s=i().finally(()=>{this.sn===s&&(this.sn=null)});return this.sn=s,s}drainWindow(){if(0===this.Pn.size)return null;var e=this.Pn;return this.Pn=new Map,this.An=!1,this.Fn=new Map,this.On=new Set,this.Nn(e)}reset(){this.Ln++,this.yn(),this.Pn=new Map,this.sn=null,this.An=!1,this.Fn=new Map,this.On=new Set}$n(e){if(!this._instance.isDisabled&&!this._instance.optedOut){var t=this._n(e);if(null!==t)if(t.name&&"string"==typeof t.name)if("number"==typeof t.value&&Number.isFinite(t.value))if("count"===t.type&&0>t.value)this.I.warn("Dropping count '"+t.name+"': counters are monotonic, value must be >= 0");else{var i,s;try{i=t.attributes?y({},t.attributes):void 0,s=Ut(t.type,t.name,t.unit,i)}catch(e){return void this.I.warn("Dropping metric '"+t.name+"': attributes could not be serialized",e)}var r=this.Pn.get(s);if(!r){if(!this.qn())return;r={name:t.name,type:t.type,unit:t.unit,attributes:i,windowStartMs:Date.now()},this.Pn.set(s,r)}var n=this.Fn.get(t.name);void 0===n?this.Fn.set(t.name,t.type):n===t.type||this.On.has(t.name)||(this.On.add(t.name),this.I.warn("Metric name '"+t.name+"' is already used as a "+n+"; recording it as a "+t.type+" too will blend both series in charts. Use a distinct name.")),this.jn(r,t.value),this.Mn()}else this.I.warn("Dropping metric '"+t.name+"': value must be a finite number");else this.I.warn("Dropping metric with empty name")}}qn(){return this.Di.maxSeriesPerFlush>this.Pn.size||(this.An||(this.An=!0,this.I.warn("Metric series cap reached ("+this.Di.maxSeriesPerFlush+" per flush window); dropping new series until the next flush. Reduce attribute cardinality.")),!1)}jn(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:new Array(Ht.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,Ht)]+=1}}_n(e){var t=this.Di.beforeSend;if(!t)return e;var i=K(t)?t:[t],s=e;for(var r of i)try{var n=r(s);if(!n)return this.I.info("Metric was rejected in beforeSend function"),null;s=n}catch(e){return this.I.error("Error in beforeSend function for metric:",e),null}return s}Mn(){this.En||(this.En=Pt(()=>{this.En=void 0,this.flush().catch(e=>{this.I.error("Metrics flush failed:",e)})},this.Di.flushIntervalMs))}yn(){this.En&&(clearTimeout(this.En),this.En=void 0)}Dn(){var e=this;return m(function*(){if(0!==e.Pn.size){var t=e.Pn;e.Pn=new Map,e.An=!1,e.Fn=new Map,e.On=new Set;var i=e.Ln,s=yield e._instance.Bn(e.Nn(t));if(i===e.Ln)switch(s.kind){case"ok":return;case"retry-later":return e.Hn(t),void e.Mn();case"too-large":return void e.I.warn("Metrics batch exceeded the server size limit and was dropped");case"fatal":return void e.I.error("Failed to send metrics batch:",s.error)}}})()}Nn(e){return t=this.Un(e),i=function(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})}(this.Di,this._instance.getLibraryId(),this._instance.getLibraryVersion()),s=this._instance.getLibraryId(),r=this._instance.getLibraryVersion(),{resourceMetrics:[{resource:{attributes:Mt(i)},scopeMetrics:[{scope:{name:s,version:r},metrics:t}]}]};var t,i,s,r}Un(e){var t=zt(Date.now()),i=new Map;for(var s of e.values()){var r,n=Ut(s.type,s.name,s.unit,void 0),o=i.get(n);o||(o=y({name:s.name},s.unit&&{unit:s.unit}),"count"===s.type?o.sum={aggregationTemporality:1,isMonotonic:!0,dataPoints:[]}:"gauge"===s.type?o.gauge={dataPoints:[]}:o.histogram={aggregationTemporality:1,dataPoints:[]},i.set(n,o));var a=Mt(null!==(r=s.attributes)&&void 0!==r?r:{},this.I),l=zt(s.windowStartMs);if("count"===s.type){var u,h={attributes:a,startTimeUnixNano:l,timeUnixNano:t,asDouble:null!==(u=s.total)&&void 0!==u?u:0};o.sum.dataPoints.push(h)}else if("gauge"===s.type){var c,d={attributes:a,timeUnixNano:t,asDouble:null!==(c=s.last)&&void 0!==c?c:0};o.gauge.dataPoints.push(d)}else s.hist&&o.histogram.dataPoints.push({attributes:a,startTimeUnixNano:l,timeUnixNano:t,count:s.hist.count,sum:s.hist.sum,min:s.hist.min,max:s.hist.max,bucketCounts:s.hist.bucketCounts,explicitBounds:Ht})}return Array.from(i.values())}Hn(e){var t,i;for(var s of e){var r=s[0],n=s[1],o=this.Pn.get(r);if(o)switch(o.windowStartMs=Math.min(o.windowStartMs,n.windowStartMs),o.type){case"count":o.total=(null!==(t=o.total)&&void 0!==t?t:0)+(null!==(i=n.total)&&void 0!==i?i:0);break;case"gauge":break;case"histogram":if(n.hist)if(o.hist){o.hist.count+=n.hist.count,o.hist.sum+=n.hist.sum,o.hist.min=Math.min(o.hist.min,n.hist.min),o.hist.max=Math.max(o.hist.max,n.hist.max);for(var a=0;o.hist.bucketCounts.length>a;a++)o.hist.bucketCounts[a]+=n.hist.bucketCounts[a]}else o.hist=n.hist}else this.qn()&&this.Pn.set(r,n)}}};var Wt,Gt,Yt;function Kt(e){var t=globalThis._posthogChunkIds;if(t){var i=Object.keys(t);return Yt&&i.length===Gt||(Gt=i.length,Yt=i.reduce((i,s)=>{Wt||(Wt={});var r=Wt[s];if(r)i[r[0]]=r[1];else for(var n=e(s),o=n.length-1;o>=0;o--){var a=n[o],l=null==a?void 0:a.filename,u=t[s];if(l&&u){i[l]=u,Wt[s]=[l,u];break}}return i},{})),Yt}}class Xt{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&&K(i.stacktrace.frames)&&(i.stacktrace.frames=yield t.applyModifiers(i.stacktrace.frames));return e})()}coerceFallback(e){var t;return{type:"Error",value:"Unknown error",stack:null==(t=e.syntheticException)?void 0:t.stack,synthetic:!0}}parseStacktrace(e,t){var i,s;return null!=e.cause&&(i=this.parseStacktrace(e.cause,t)),""!=e.stack&&null!=e.stack&&(s=this.applyChunkIds(this.stackParser(e.stack,e.synthetic?t.ski
1pFirstLines:0),t.chunkIdMap)),y({},e,{cause:i,stack:s})}applyChunkIds(e,t){return e.map(e=>(e.filename&&t&&(e.chunk_id=t[e.filename]),e))}applyCoercers(e,t){for(var i of this.coercers)if(i.match(e))return i.coerce(e,t);return this.coerceFallback(t)}applyModifiers(e){var t=this;return m(function*(){var i=e;for(var s of t.modifiers)i=yield s(i);return i})()}convertToExceptionList(e,t){var i,s,r,n={type:e.type,value:e.value,mechanism:{type:null!==(i=t.type)&&void 0!==i?i:"generic",handled:null===(s=t.handled)||void 0===s||s,synthetic:null!==(r=e.synthetic)&&void 0!==r&&r}};e.stack&&(n.stacktrace={type:"raw",frames:e.stack});var o=[n];return null!=e.cause&&o.push(...this.convertToExceptionList(e.cause,y({},t,{handled:!0}))),o}buildParsingContext(e){var t;return{chunkIdMap:Kt(this.stackParser),skipFirstLines:null!==(t=e.skipFirstLines)&&void 0!==t?t:1}}buildCoercingContext(e,t,i){void 0===i&&(i=0);var s=(i,s)=>{if(4>=s){var r=this.buildCoercingContext(e,t,s);return this.applyCoercers(i,r)}};return y({},t,{syntheticException:0==i?t.syntheticException:void 0,mechanism:e,apply:e=>s(e,i),next:e=>s(e,i+1)})}}var Jt="?";function Qt(e,t,i,s,r){var n={platform:e,filename:t,function:"<anonymous>"===i?Jt:i,in_app:!(null!=t&&t.startsWith("webkit-masked-url://"))&&"<anonymous>"!==t};return Z(s)||(n.lineno=s),Z(r)||(n.colno=r),n}var Zt=(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]:Jt,i?"safari-extension:"+t:"safari-web-extension:"+t]:[e,t]},ei=/^\s*at (\S+?)(?::(\d+))(?::(\d+))\s*$/i,ti=/^\s*at (?:(.+?\)(?: \[.+\])?|.*?) ?\((?:address at )?)?(?:async )?((?:<anonymous>|[-a-z]+:|.*bundle|\/)?.*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i,ii=/\((\S*)(?::(\d+))(?::(\d+))\)/,si=(e,t)=>{var i=ei.exec(e);if(i)return Qt(t,i[1],Jt,+i[2],+i[3]);var s=ti.exec(e);if(s){if(s[2]&&0===s[2].indexOf("eval")){var r=ii.exec(s[2]);r&&(s[2]=r[1],s[3]=r[2],s[4]=r[3])}var n=Zt(s[1]||Jt,s[2]);return Qt(t,n[1],n[0],s[3]?+s[3]:void 0,s[4]?+s[4]:void 0)}},ri=/^\s*(.*?)(?:\((.*?)\))?(?:^|@)?((?:[-a-z]+)?:\/.*?|\[native code\]|[^@]*(?:bundle|\d+\.js)|\/[\w\-. /=]+)(?::(\d+))?(?::(\d+))?\s*$/i,ni=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i,oi=(e,t)=>{var i=ri.exec(e);if(i){if(i[3]&&i[3].indexOf(" > eval")>-1){var s=ni.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]||Jt,o=Zt(n,r);return Qt(t,r=o[1],n=o[0],i[4]?+i[4]:void 0,i[5]?+i[5]:void 0)}},ai=/\(error: (.*)\)/;class li{match(e){return this.isDOMException(e)||this.isDOMError(e)}coerce(e,t){var i=ee(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 he(e,"DOMException")}isDOMError(e){return he(e,"DOMError")}}class ui{match(e){return ce(e)}coerce(e,t){var i,s=this.getStack(e),r=void 0===s;return{type:this.getType(e),value:this.getMessage(e,t),stack:null!=s?s:null==(i=t.syntheticException)?void 0:i.stack,cause:e.cause?t.next(e.cause):void 0,synthetic:r}}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 hi{constructor(){}match(e){return!!he(e,"ErrorEvent")&&(null!=e.error||this.di(e))}coerce(e,t){var i;if(null!=e.error)return t.apply(e.error);var s=t.apply(e.message);return y({},s,{stack:null!==(i=this.vi(e))&&void 0!==i?i:s.stack,synthetic:!0})}di(e){return ee(e.message)&&e.message.length>0}vi(e){var t,i,s=e,r=null!==(t=s.lineno)&&void 0!==t?t:0,n=null!==(i=s.colno)&&void 0!==i?i:0;if(ee(s.filename)&&0!==s.filename.length&&0!==r)return"Error\n at "+s.filename+":"+r+":"+n}}var ci=/^(?:[Uu]ncaught (?:exception: )?)?(?:((?:Eval|Internal|Range|Reference|Syntax|Type|URI|)Error): )?(.*)$/i;class di{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(ci);return s&&(t=s[1],i=s[2]),[t,i]}}var vi=["fatal","error","warning","log","info","debug"];function pi(e,t){void 0===t&&(t=40);var i=Object.keys(e);if(i.sort(),!i.length)return"[object has no keys]";for(var s=i.length;s>0;s--){var r=i.slice(0,s).join(", ");
1if(t>=r.length)return s===i.length?r:r.length>t?r.slice(0,t)+"...":r}return""}class gi{match(e){return"object"==typeof e&&null!==e}coerce(e,t){var i,s,r=this.getErrorPropertyFromObject(e);return r?t.apply(r):{type:this.getType(e),value:this.getValue(e),stack:null!==(i=this.getStack(e))&&void 0!==i?i:null==(s=t.syntheticException)?void 0:s.stack,level:this.isSeverityLevel(e.level)?e.level:"error",synthetic:!0}}getType(e){if(de(e))return e.constructor.name;var t="name"in e?e.name:void 0;return ee(t)&&!te(t)?t:"Error"}getValue(e){if("name"in e&&"string"==typeof e.name){var t="'"+e.name+"' captured as exception";return"message"in e&&"string"==typeof e.message&&(t+=" with message: '"+e.message+"'"),t}if("message"in e&&"string"==typeof e.message)return e.message;var i=this.getObjectClassName(e);return(i&&"Object"!==i?"'"+i+"'":"Object")+" captured as exception with keys: "+pi(e)}isSeverityLevel(e){return ee(e)&&!te(e)&&vi.indexOf(e)>=0}getStack(e){try{return ee(e.stacktrace)&&e.stacktrace.length>0?e.stacktrace:ee(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(ce(i))return i}}getObjectClassName(e){try{var t=Object.getPrototypeOf(e);return t?t.constructor.name:void 0}catch(e){return}}}class fi{match(e){return de(e)}coerce(e,t){var i,s=e.constructor.name;return{type:s,value:s+" captured as exception with keys: "+pi(e),stack:null==(i=t.syntheticException)?void 0:i.stack,synthetic:!0}}}class _i{match(e){return ue(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 mi{match(e){return he(e,"PromiseRejectionEvent")||this.isCustomEventWrappingRejection(e)}isCustomEventWrappingRejection(e){if(!de(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 ue(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 yi="$message",bi="$timestamp",wi=new Set([yi,bi]),xi={enabled:!0,max_bytes:32768};function ki(e){var t;return e?{enabled:null!==(t=e.enabled)&&void 0!==t?t:xi.enabled,max_bytes:Si(e.max_bytes,xi.max_bytes)}:y({},xi)}class Ei{constructor(e){this.zn=[],this.Wn=0,this.Di=ki(e)}setConfig(e){this.Di=ki(e),this.Vn()}add(e){var t=function(e){var t;try{t=V(e)}catch(e){return}try{var i=JSON.parse(t);if(!J(i))return;var s=i,r=s[yi],n=s[bi];if(!ee(r)||0===r.trim().length)return;if(!ee(n)&&!re(n))return;return{step:s,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.Di.max_bytes||(this.zn.push({step:t.step,bytes:i}),this.Wn+=i,this.Vn())}}getAttachable(){return this.zn.map(e=>e.step)}clear(){this.zn=[],this.Wn=0}size(){return this.zn.length}Vn(){for(;this.Wn>this.Di.max_bytes&&this.zn.length>0;){var e=this.zn.shift();e&&(this.Wn-=e.bytes)}}}function Si(e,t){if(!re(e)||e===1/0||e===-1/0)return t;var i=Math.floor(e);return 0>i?t:i}var Pi=function(e,t){var i=(void 0===t?{}:t).debugEnabled,r={F(t){if(s&&(f.DEBUG||s.POSTHOG_DEBUG||i)&&!Z(s.console)&&s.console){for(var r=("__rrweb_original__"in s.console[t]?s.console[t].__rrweb_original__:s.console[t]),n=arguments.length,o=new Array(n>1?n-1:0),a=1;n>a;a++)o[a-1]=arguments[a];r(e,...o)}},debug(){for(var e=arguments.length,t=new Array(e),i=0;e>i;i++)t[i]=arguments[i];r.F("debug",...t)},info(){for(var e=arguments.length,t=new Array(e),i=0;e>i;i++)t[i]=arguments[i];r.F("log",...t)},warn(){for(var e=arguments.length,t=new Array(e),i=0;e>i;i++)t[i]=arguments[i];r.F("warn",...t)},error(){for(var e=arguments.length,t=new Array(e),i=0;e>i;i++)t[i]=arguments[i];r.F("error",...t)},critical(){for(var t=arguments.length,i=new 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)=>Pi(e+" "+t,i)};return r},Ii=Pi("[PostHog.js]"),Fi=Ii.createLogger,$i=Fi("[ExternalScriptsLoader]"),Ci=e=>{var t=null==o?void 0:o.querySelectorAll("script");
1if(t)for(var i=0;t.length>i;i++)if(t[i].src===e||t[i].getAttribute("src")===e)return t[i]},Ti=(e,t,i)=>{if(e.config.disable_external_dependency_loading)return $i.warn(t+" was requested but loading of external scripts is disabled."),i("Loading of external scripts is disabled");var s=Ci(t);if(s){if(s.__posthog_loading_callback_fired)return i();var r=s.__posthog_loading_error;return r?i(r):(s.addEventListener("load",e=>{s.__posthog_loading_callback_fired=!0,i(void 0,e)}),void s.addEventListener("error",e=>{s.__posthog_loading_error=e,i(e)}))}var n=()=>{if(!o)return i("document not found");if(Ci(t))return Ti(e,t,i);var s=o.createElement("script");if(s.type="text/javascript",s.crossOrigin="anonymous",s.src=t,s.onload=e=>{s.__posthog_loading_callback_fired=!0,i(void 0,e)},s.onerror=e=>{s.__posthog_loading_error=e,i(e)},e.config.prepare_external_dependency_script&&(s=e.config.prepare_external_dependency_script(s)),!s)return i("prepare_external_dependency_script returned null");if("head"===e.config.external_scripts_inject_target)o.head.appendChild(s);else{var r,n=o.querySelectorAll("body > script");n.length>0?null==(r=n[0].parentNode)||r.insertBefore(s,n[0]):o.body.appendChild(s)}};null!=o&&o.body?n():null==o||o.addEventListener("DOMContentLoaded",n)},Di={},Mi=(e,t)=>{var i="/static/"+t+".js?v="+e.version;if("toolbar"===t){var s=3e5;i=i+"&t="+Math.floor(Date.now()/s)*s}return e.requestRouter.endpointFor("assets",i)};g.__PosthogExtensions__=g.__PosthogExtensions__||{},g.__PosthogExtensions__.loadExternalDependency=(e,t,i)=>{if("remote-config"!==t){var s=e.config.strict_script_versioning;if(s){var r=e.requestRouter.endpointFor("assets","/static/"+e.version+"/"+t+".js"),n=Di[r];if("fallback"===s&&n){if(Ci(n))return void Ti(e,n,i);delete Di[r]}Ti(e,r,"fallback"===s?(s,n)=>{if(s)if("string"==typeof s)i(s);else{var o,a=Mi(e,t);Di[r]=a;var l=Ci(r);null==l||null==(o=l.parentNode)||o.removeChild(l),Ti(e,a,i)}else i(void 0,n)}:i)}else Ti(e,Mi(e,t),i)}else{var o=e.requestRouter.endpointFor("assets","/array/"+e.config.token+"/config.js");Ti(e,o,i)}},g.__PosthogExtensions__.loadSiteApp=(e,t,i)=>{var s=e.requestRouter.endpointFor("api",t);Ti(e,s,i)},f.DEBUG=!1,f.LIB_VERSION="1.418.11",f.LIB_NAME="web";var Ri="$people_distinct_id",Oi="distinct_id",Ai="$device_id",Li="$device_model",Ni="__alias",ji="__timers",qi="$autocapture_disabled_server_side",Bi="$heatmaps_enabled_server_side",Hi="$exception_capture_enabled_server_side",zi="$error_tracking_suppression_rules",Ui="$error_tracking_capture_extension_exceptions",Vi="$web_vitals_enabled_server_side",Wi="$dead_clicks_enabled_server_side",Gi="$product_tours_enabled_server_side",Yi="$web_vitals_allowed_metrics",Ki="$session_recording_remote_config",Xi="$replay_sample_rate",Ji="$replay_override_sampling",Qi="$replay_override_linked_flag",Zi="$replay_override_url_trigger",es="$replay_override_event_trigger",ts="$sesid",is="$session_is_sampled",ss="$enabled_feature_flags",rs="$active_feature_flags",ns="$early_access_features",os="$feature_flag_details",as="$feature_flag_payloads",ls="$feature_flag_request_id",us="$minimal_flag_called_events",hs="$override_feature_flags",cs="$override_feature_flag_payloads",ds="$stored_person_properties",vs="$stored_group_properties",ps="$groups",gs="$surveys",fs="$surveys_loaded_at",_s="$surveys_activated",ms="$surveys_activated_session",ys="$surveys_activated_timestamps",bs="ph_product_tours",ws="$flag_call_reported",xs="$flag_call_reported_session_id",ks="$feature_flag_errors",Es="$feature_flag_evaluated_at",Ss="$user_state",Ps="$client_session_props",Is="$capture_rate_limit",Fs="$initial_campaign_params",$s="$initial_referrer_info",Cs="$initial_person_info",Ts="$epp",Ds="$posthog_cookieless",Ms="$cookieless_mode",Rs="$sdk_debug_extensions_init_method",Os="$sdk_debug_extensions_init_time_ms",As="$sdk_debug_recording_script_not_loaded",Ls="PostHog loadExternalDependency extension not found.",Ns="on_reject",js="always",qs="anonymous",Bs="identified",Hs="identified_only",zs="visibilitychange",Us="beforeunload",Vs="$pageview",Ws="$pageleave",Gs="$identify",Ys="$groupidentify";function Ks(e,t){K(e)&&e.forEach(t)}function Xs(e,t){if(!se(e))if(K(e))e.forEach(t);else if((e=>e instanceof FormData)(e))e.forEach((e,i)=>t(e,i));else for(var i in e)G.call(e,i)&&t(e[i],i)}var Js=function(e){for(var t=arguments.length,i=new 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 Qs(e){for(var t=Object.keys(e),i=t.length,s=new Array(i);i--;)s[i]=[t[i],e[t[i]]];return s}var Zs=function(e){try{return e()}catch(e){return}},er=function(e){return function(){try{for(var t=arguments.length,i=new Array(t),s=0;t>s;s++)i[s]=arguments[s];return e.apply(this,i)}catch(e){Ii.critical("Implementation error. Please turn on debug mode and open a ticket on https://app.posthog.com/home#panel=support%3Asupport%3A."),Ii.critical(e)}}},tr=function(e){var t={};return Xs(e,function(e,i){(ee(e)&&e.length>0||re(e))&&(t[i]=e)}),t},ir=["herokuapp.com","vercel.app","netlify.app"];function sr(e){var t=null==e?void 0:e.hostname;if(!ee(t))return!1;var i=t.split(".").slice(-2).join(".");for(var s of ir)if(i===s)return!1;return!0}function rr(e,t,i,s){var r=null!=s?s:{},n=r.capture,o=r.passive;null==e||e.addEventListener(t,i,{capture:void 0!==n&&n,passive:void 0===o||o})}function nr(e){return"ph_toolbar_internal"===e.name}var or=e=>{if(o){try{for(var t=e+"=",i=o.cookie.split(";").filter(e=>e.length),s=0;i.length>s;s++){for(var r=i[s];" "==r.charAt(0);)r=r.substring(1,r.length);if(0===r.indexOf(t))return decodeURIComponent(r.substring(t.length,r.length))}}catch(e){}return null}};Math.trunc||(Math.trunc=function(e){return 0>e?Math.ceil(e):Math.floor(e)}),Number.isInteger||(Number.isInteger=function(e){return re(e)&&isFinite(e)&&Math.floor(e)===e});class ar{constructor(e){if(this.bytes=e,16!==e.length)throw new 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>1073741823||s>4294967295)throw new RangeError("invalid field value");
vendor: 4,130 bytes, line 1
1var r=new Uint8Array(16);return r[0]=e/Math.pow(2,40),r[1]=e/Math.pow(2,32),r[2]=e/Math.pow(2,24),r[3]=e/Math.pow(2,16),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 ar(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 new Error("Invalid UUIDv7 was generated");return e}clone(){return new ar(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 lr{generate(){var e=this.generateOrAbort();if(!Z(e))return e;this.Rr=0;var t=this.generateOrAbort();if(Z(t))throw new Error("Could not generate UUID after timestamp reset");return t}generateOrAbort(){var e=Date.now();if(e>this.Rr)this.Rr=e,this.Ar();else{if(this.Rr>=e+1e4)return;this.Lr++,this.Lr>4398046511103&&(this.Rr++,this.Ar())}return ar.fromFieldsV7(this.Rr,Math.trunc(this.Lr/Math.pow(2,30)),this.Lr&Math.pow(2,30)-1,this.Or.nextUint32())}Ar(){this.Lr=1024*this.Or.nextUint32()+(1023&this.Or.nextUint32())}constructor(){this.Rr=0,this.Lr=0,this.Or=new cr}}var ur,hr=e=>{if("undefined"!=typeof UUIDV7_DENY_WEAK_RNG&&UUIDV7_DENY_WEAK_RNG)throw new 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&&!Z(s.crypto)&&crypto.getRandomValues&&(hr=e=>crypto.getRandomValues(e));class cr{nextUint32(){return this.ft.length>this.Fr||(hr(this.ft),this.Fr=0),this.ft[this.Fr++]}constructor(){this.ft=new Uint32Array(8),this.Fr=1/0}}var dr=()=>vr().toString(),vr=()=>(ur||(ur=new lr)).generate(),pr="",gr=/[a-z0-9][a-z0-9-]+\.[a-z]{2,}$/i,fr={Nr:()=>!!o,jr(e){Ii.error("cookieStore error: "+e)},Pr:or,Br(e){var t;try{t=JSON.parse(fr.Pr(e))||{}}catch(e){}return t},Dr(e,t,i,s,r){if(!o)return!1;try{var n="",a="",l=function(e,t){if(t){var i=function(e,t){if(void 0===t&&(t=o),pr)return pr;if(!t)return"";if(["localhost","127.0.0.1"].includes(e))return"";for(var i=e.split("."),s=Math.min(i.length,8),r="dmn_chk_"+dr();!pr&&s--;){var n=i.slice(s).join("."),a=r+"=1;domain=."+n+";path=/";t.cookie=a+";max-age=3",t.cookie.includes(r)&&(t.cookie=a+";max-age=0",pr=n)}return pr}(e);if(!i){var s=(e=>{var t=e.match(gr);return t?t[0]:""})(e);s!==i&&Ii.info("Warning: cookie subdomain discovery mismatch",s,i),i=s}return i?"; domain=."+i:""}return""}(o.location.hostname,s);if(i){var u=new Date;u.setTime(u.getTime()+864e5*i),n="; expires="+u.toUTCString()}r&&(a="; secure");var h=e+"="+encodeURIComponent(JSON.stringify(t))+n+"; SameSite=Lax; path=/"+l+a;return h.length>3686.4&&Ii.warn("cookieStore warning: large cookie, len="+h.length),o.cookie=h,!0}catch(e){return!1}},qr(e,t){if(null!=o&&o.cookie)try{fr.Dr(e,"",-1,t)}catch(e){return}}},_r=null,mr={Nr(){if(!ie(_r))return _r;var e=!0;if(Z(s))e=!1;else try{var t="__mplssupport__";mr.Dr(t,"xyz"),'"xyz"'!==mr.Pr(t)&&(e=!1),mr.qr(t)}catch(s){e=!1}return e||Ii.error("localStorage unsupported; falling back to cookie store"),_r=e,e},jr(e){Ii.error("localStorage error: "+e)},Pr(e){try{return null==s?void 0:s.localStorage.getItem(e)}catch(s){mr.jr(s)}return null},Br(e){try{return JSON.parse(mr.Pr(e))||{}}catch(e){}return null},Dr(e,t){try{return null==s||s.localStorage.setItem(e,JSON.stringify(t)),!0}catch(s){mr.jr(s)}return!1},qr(e){try{null==s||s.localStorage.removeItem(e)}catch(s){mr.jr(s)}}},yr=[ds,rs,ss,os,as,ls,Es,ks,ws],br=[Ai,Oi,ts,is,Ts,Cs,Ss],wr=e=>e+"_cpm",xr=["__proto__","constructor","prototype"],kr=e=>{if(!J(e))return{};var t={};return Object.keys(e).forEach(i=>{-1===xr.indexOf(i)&&(t[i]=e[i])}),t},Er=function(e,t){void 0===t&&(t=[]);var i={};return[...br,...t].forEach(t=>{var s=e[t];Z(s)||ie(s)||""===s||(i[t]=s)}),i},Sr=e=>{for(var t=5381,i=2166136261,s=0;e.length>s;s++){var r=e.charCodeAt(s);t=33*t^r,i=Math.imul(i^r,16777619)}return e.length.toString(36)+"."+(t>>>0).toString(36)+"."+(i>>>0).toString(36)},Pr=(e,t)=>({p:t,f:Sr(JSON.stringify(e))}),Ir=(e,t)=>
1{if(!t)return{properties:[],isValid:!1};try{var i=fr.Br(wr(e)),s=(null==i?void 0:i.f)===Sr(t)&&K(i.p);return{properties:s?i.p:[],isValid:s}}catch(e){return{properties:[],isValid:!1}}},Fr=(e,t)=>t+"|"+(fr.Pr(wr(e))||""),$r={},Cr={Nr:()=>!0,jr(e){Ii.error("memoryStorage error: "+e)},Pr:e=>$r[e]||null,Br:e=>$r[e]||null,Dr:(e,t)=>($r[e]=t,!0),qr(e){delete $r[e]}},Tr=null,Dr={Nr(){if(!ie(Tr))return Tr;if(Tr=!0,Z(s))Tr=!1;else try{var e="__support__";Dr.Dr(e,"xyz"),'"xyz"'!==Dr.Pr(e)&&(Tr=!1),Dr.qr(e)}catch(s){Tr=!1}return Tr},jr(e){Ii.error("sessionStorage error: ",e)},Pr(e){try{return null==s?void 0:s.sessionStorage.getItem(e)}catch(s){Dr.jr(s)}return null},Br(e){try{return JSON.parse(Dr.Pr(e))||null}catch(e){}return null},Dr(e,t){try{return null==s||s.sessionStorage.setItem(e,JSON.stringify(t)),!0}catch(s){Dr.jr(s)}return!1},qr(e){try{null==s||s.sessionStorage.removeItem(e)}catch(s){Dr.jr(s)}}};class Mr{constructor(e){this._instance=e}get Di(){return this._instance.config}get consent(){return this.Gn()?0:this.Zn}isOptedOut(){return this.Di.cookieless_mode===js||this.isRejected()||-1===this.consent&&this.Di.cookieless_mode===Ns}isOptedIn(){return!this.isOptedOut()}isExplicitlyOptedOut(){return 0===this.consent}isRejected(){return 0===this.consent||-1===this.consent&&this.Di.opt_out_capturing_by_default}optInOut(e){this.Qn.Dr(this.Jn,e?1:0,this.Di.cookie_expiration,this.Di.cross_subdomain_cookie,this.Di.secure_cookie)}reset(){this.Qn.qr(this.Jn,this.Di.cross_subdomain_cookie)}get Jn(){var e=this._instance.config,t=e.token,i=e.opt_out_capturing_cookie_prefix;return e.consent_persistence_name||(i?i+t:"__ph_opt_in_out_"+t)}get Zn(){var e=this.Qn.Pr(this.Jn);return ge(e)?1:H(fe,e)?0:-1}get Qn(){var e=this.Di.opt_out_capturing_persistence_type,t="localStorage"===e?mr:fr;if(!this.Kn||this.Kn!==t){this.Kn=t;var i="localStorage"===e?fr:mr;i.Pr(this.Jn)&&(this.Kn.Pr(this.Jn)||this.optInOut(ge(i.Pr(this.Jn))),i.qr(this.Jn,this.Di.cross_subdomain_cookie))}return this.Kn}Gn(){return!!this.Di.respect_dnt&&[null==n?void 0:n.doNotTrack,null==n?void 0:n.msDoNotTrack,g.doNotTrack].some(e=>ge(e))}}function Rr(e,t){var i,s=null==e||null==(i=e.config)?void 0:i.get_current_url;if(!X(s))return t;try{var r=s(t);return ee(r)&&r?r:t}catch(e){return Ii.error("Error in get_current_url, falling back to window.location.href",e),t}}var Or="__POSTHOG_TOOLBAR__";function Ar(e){return e instanceof Element&&(e.id===Or||!(null==e.closest||!e.closest(".toolbar-global-fade-container")))}function Lr(e){return!!e&&1===e.nodeType}function Nr(e,t){return!!e&&!!e.tagName&&e.tagName.toLowerCase()===t.toLowerCase()}function jr(e){return!!e&&3===e.nodeType}function qr(e){return!!e&&11===e.nodeType&&Lr(e.host)}function Br(e){return e?z(e).split(/\s+/):[]}function Hr(e,t){var i=function(e){var t,i=null==s||null==(t=s.location)?void 0:t.href;return Z(i)?void 0:Rr(e,i)}(t);return!!(i&&e&&e.some(e=>i.match(e)))}function zr(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 Br(t)}function Ur(e){return se(e)?null:z(e).split(/(\s+)/).filter(e=>gn(e)).join("").replace(/[\r\n]/g," ").replace(/[ ]+/g," ").substring(0,255)}function Vr(e){var t="";return on(e)&&!an(e)&&e.childNodes&&e.childNodes.length&&Xs(e.childNodes,function(e){var i;jr(e)&&e.textContent&&(t+=null!==(i=Ur(e.textContent))&&void 0!==i?i:"")}),z(t)}function Wr(e){var t;return Z(e.target)?e.srcElement||null:null!=(t=e.target)&&t.shadowRoot?e.composedPath()[0]||null:e.target||null}var Gr=["a","button","form","input","select","textarea","label"];function Yr(e,t){if(Z(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 Kr(e){var t=e.parentNode;return!(!t||!Lr(t))&&t}var Xr=[".ph-no-autocapture","[data-ph-no-autocapture]"],Jr=["next","previous","prev",">","<"],Qr=[...Jr,"+","-","â","â"],Zr=(e,t)=>
vendor: 5,724 bytes, line 1
1/[a-z0-9]/i.test(t)?e.includes(t):e===t,en=[".ph-no-rageclick",".ph-no-capture"],tn=["","text","search","email","password","url","tel","number"];function sn(e,t){if(!s||rn(e))return!1;var i,r,n,o,a;if(oe(t)?(i=!!t&&en,r=void 0,n=!1):(i=null!==(o=null==t?void 0:t.css_selector_ignorelist)&&void 0!==o?o:en,r=null==t?void 0:t.content_ignorelist,n=null!==(a=null==t?void 0:t.ignore_text_selection)&&void 0!==a&&a),!1===i)return!1;if(n&&function(e){return!(!e||!Lr(e))&&(!!Nr(e,"textarea")||(Nr(e,"input")?H(tn,(e.getAttribute("type")||"").toLowerCase()):function(e){if(e.isContentEditable)return!0;var t=null==e.getAttribute?void 0:e.getAttribute("contenteditable");return"true"===t||""===t}(e)))}(e))return!1;var l=nn(e,!1).targetElementList;return!function(e,t){if(!1===e||Z(e))return!1;var i;if(!0===e)i=Jr;else{if(!K(e))return!1;if(e.length>10)return Ii.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=>Zr(t,e)||Zr(s,e))})}(r,l.map(e=>{var t;return{safeText:Vr(e).toLowerCase(),ariaLabel:(null==(t=e.getAttribute("aria-label"))?void 0:t.toLowerCase().trim())||""}}))&&!Yr(l,i)}var rn=e=>!e||Nr(e,"html")||!Lr(e),nn=(e,t)=>{if(!s||rn(e))return{parentIsUsefulElement:!1,targetElementList:[]};for(var i=!1,r=[e],n=e;n.parentNode&&!Nr(n,"body");)if(qr(n.parentNode))r.push(n.parentNode.host),n=n.parentNode.host;else{var o=Kr(n);if(!o)break;if(t||Gr.indexOf(o.tagName.toLowerCase())>-1)i=!0;else try{var a=s.getComputedStyle(o);a&&"pointer"===a.getPropertyValue("cursor")&&(i=!0)}catch(s){}r.push(o),n=o}return{parentIsUsefulElement:i,targetElementList:r}};function on(e){for(var t=new Set,i=0,s=e;s.parentNode&&!Nr(s,"body");s=s.parentNode){if(i++>=1e3||t.has(s))return!1;t.add(s);var r=zr(s);if(H(r,"ph-sensitive")||H(r,"ph-no-capture"))return!1}if(H(zr(e),"ph-include"))return!0;var n=e.type||"";if(ee(n))switch(n.toLowerCase()){case"hidden":case"password":return!1}var o=e.name||e.id||"";return!ee(o)||!/^cc|cardnum|ccnum|creditcard|csc|cvc|cvv|exp|pass|pwd|routing|seccode|securitycode|securitynum|socialsec|socsec|ssn/i.test(o.replace(/[^a-zA-Z0-9]/g,""))}function an(e){return!!(Nr(e,"input")&&!["button","checkbox","submit","reset"].includes(e.type)||Nr(e,"select")||Nr(e,"textarea")||"true"===e.getAttribute("contenteditable"))}var ln=new RegExp("^(?:(4[0-9]{12}(?:[0-9]{3})?)|(5[1-5][0-9]{14})|(6(?:011|5[0-9]{2})[0-9]{12})|(3[47][0-9]{13})|(3(?:0[0-5]|[68][0-9])[0-9]{11})|((?:2131|1800|35[0-9]{3})[0-9]{11}))$"),un=/(^|[^0-9A-Za-z_])([0-9][0-9 -]*[0-9])(?=$|[^0-9A-Za-z_])/g,hn=[16,15,14,13],cn=new RegExp("^(\\d{3}-?\\d{2}-?\\d{4})$"),dn=new RegExp("(^|[^0-9])((?!000|666)[0-9]{3}-?(?!00)[0-9]{2}-?(?!0000)[0-9]{4})(?=$|([^0-9]))","g"),vn=/[0-9A-Za-z_]/;function pn(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}function gn(e,t){if(void 0===t&&(t=!0),se(e))return!1;if(ee(e)){e=z(e);var i=t?ln.test((e||"").replace(/[- ]/g,"")):function(e){var t;for(un.lastIndex=0;t=un.exec(e);){var i=t[2];if(i)for(var s=i.replace(/[- ]/g,""),r=0;s.length>r;r++)for(var n of hn){var o=r+n;if(s.length>=o){var a=s.slice(r,o);if(ln.test(a)&&pn(a))return!0}}}return!1}(e);if(i)return!1;var s=t?cn.test(e):function(e){var t;for(dn.lastIndex=0;t=dn.exec(e);){var i=t[1],s=t[3];if(!(i&&s&&vn.test(i)&&vn.test(s)))return!0}return!1}(e);if(s)return!1}return!0}function fn(e){var t=Vr(e);return gn(t=(t+" "+_n(e)).trim())?t:""}function _n(e){var t="";return e&&e.childNodes&&e.childNodes.length&&Xs(e.childNodes,function(e){var i;if(e&&"span"===(null==(i=e.tagName)?void 0:i.toLowerCase()))try{var s=Vr(e);t=(t+" "+s).trim(),e.childNodes&&e.childNodes.length&&(t=(t+" "+_n(e)).trim())}catch(e){Ii.error("[AutoCapture]",e)}}),t}function mn(e){return e.replace(/"|\\"/g,'\\"')}function yn(e){var t=e.attr__class;if(t)return K(t)?t:Br(t)}var bn=Fi("[Dead Clicks]"),wn=()=>!0,xn=e=>{var t,i=!(null==(t=e.instance.persistence)||!t.get_property(Wi)),s=e.instance.config.capture_dead_clicks;return oe(s)?s:!!J(s)||i};class kn{get lazyLoadedDeadClicksAutocapture(){return this.Yn}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({[Wi]:t.captureDeadClicks}),this.startIfEnabledOrStop())}}startIfEnabledOrStop(){this.isEnabled(this)?this.Xn(()=>{this.ts()}):this.stop()}Xn(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?bn.error("failed to load script",t):e()})}ts(){var e;if(o){if(!this.Yn&&null!=(e=g.__PosthogExtensions__)&&e.initDeadClicksAutocapture){var t=J(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.Yn=g.__PosthogExtensions__.initDeadClicksAutocapture(this.instance,t),this.Yn.start(o),bn.info("starting...")}}else bn.error("`document` not found. Cannot start.")}stop(){this.Yn&&(this.Yn.stop(),this.Yn=void 0,bn.info("stopping..."))}}var En=Fi("[SegmentIntegration]"),Sn="posthog-js";function Pn(e,t){var i=void 0===t?{}:t,s=i.organization,r=i.projectId,n=i.prefix,o=i.severityAllowList,a=void 0===o?["error"]:o,l=i.sendExceptionsToPostHog,u=void 0===l||l;return t=>{var i,o,l,h,c;if("*"!==a&&!a.includes(t.level)||!e.__loaded)return t;t.tags||(t.tags={});var d=e.requestRouter.endpointFor("ui","/project/"+e.config.token+"/pers
1on/"+e.get_distinct_id());t.tags["PostHog Person URL"]=d,e.sessionRecordingStarted()&&(t.tags["PostHog Recording URL"]=e.get_session_replay_url({withTimestamp:!0}));var v,p=(null==(i=t.exception)?void 0:i.values)||[],g=p.map(e=>y({},e,{stacktrace:e.stacktrace?y({},e.stacktrace,{type:"raw",frames:(e.stacktrace.frames||[]).map(e=>y({},e,{platform:"web:javascript"}))}):void 0})),f={$exception_message:(null==(o=p[0])?void 0:o.value)||t.message,$exception_type:null==(l=p[0])?void 0:l.type,$exception_level:t.level,$exception_list:g,$sentry_event_id:t.event_id,$sentry_exception:t.exception,$sentry_exception_message:(null==(h=p[0])?void 0:h.value)||t.message,$sentry_exception_type:null==(c=p[0])?void 0:c.type,$sentry_tags:t.tags};return s&&r&&(f.$sentry_url=(n||"https://sentry.io/organizations/")+s+"/issues/?project="+r+"&query="+t.event_id),u&&(null==(v=e.exceptions)||v.sendExceptionEvent(f)),t}}class In{constructor(e,t,i,s,r,n){this.name=Sn,this.setupOnce=function(o){o(Pn(e,{organization:t,projectId:i,prefix:s,severityAllowList:r,sendExceptionsToPostHog:null==n||n}))}}}class Fn{constructor(e){this.es=(e,t,i)=>{i&&(i.noSessionId||i.activityTimeout||i.sessionPastMaximumLength||i.crossTabAdoption)&&(Ii.info("[PageViewManager] Session rotated, clearing pageview state",{sessionId:e,changeReason:i}),this.rs=void 0,this._instance.scrollManager.resetContext())},this._instance=e,this.ns()}ns(){var e;this.ss=null==(e=this._instance.sessionManager)?void 0:e.onSessionId(this.es)}destroy(){var e;null==(e=this.ss)||e.call(this),this.ss=void 0}doPageView(e,t){var i,r=this.os(e,t);return this.rs={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.os(e,null==(t=this.rs)?void 0:t.pageViewId)}doEvent(){var e;return{$pageview_id:null==(e=this.rs)?void 0:e.pageViewId}}os(e,t){var i=this.rs;if(!i)return{$pageview_id:t};var s={$pageview_id:t,$prev_pageview_id:i.pageViewId},r=this._instance.scrollManager.getContext();if(r&&!this._instance.config.disable_scroll_properties){var n=r.maxScrollHeight,o=r.lastScrollY,a=r.maxScrollY,l=r.maxContentHeight,u=r.lastContentY,h=r.maxContentY;if(!(Z(n)||Z(o)||Z(a)||Z(l)||Z(u)||Z(h))){n=Math.ceil(n),o=Math.ceil(o),a=Math.ceil(a),l=Math.ceil(l),u=Math.ceil(u),h=Math.ceil(h);var c=n>1?_e(o/n,0,1,Ii):1,d=n>1?_e(a/n,0,1,Ii):1,v=l>1?_e(u/l,0,1,Ii):1,p=l>1?_e(h/l,0,1,Ii):1;s=Js(s,{$prev_pageview_last_scroll:o,$prev_pageview_last_scroll_percentage:c,$prev_pageview_max_scroll:a,$prev_pageview_max_scroll_percentage:d,$prev_pageview_last_content:u,$prev_pageview_last_content_percentage:v,$prev_pageview_max_content:h,$prev_pageview_max_content_percentage:p})}}return i.pathname&&(s.$prev_pageview_pathname=i.pathname),i.timestamp&&(s.$prev_pageview_duration=(e.getTime()-i.timestamp.getTime())/1e3),s}}var $n=["flags","surveys"],Cn={[Ri]:{exposure:"hidden"},[Ni]:{exposure:"hidden"},__cmpns:{exposure:"hidden"},[ji]:{exposure:"hidden"},[qi]:{exposure:"event"},[Bi]:{exposure:"hidden"},[Hi]:{exposure:"event"},[zi]:{exposure:"hidden"},[Ui]:{exposure:"event"},[Vi]:{exposure:"event"},[Wi]:{exposure:"event"},[Gi]:{exposure:"hidden"},[Yi]:{exposure:"event"},[Ki]:{exposure:"hidden"},$session_recording_enabled_server_side:{exposure:"hidden"},[ts]:{exposure:"hidden"},[is]:{exposure:"event"},[Xi]:{exposure:"event",shouldSkipFromEventProperties:e=>ie(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"},[ss]:{exposure:"hidden",storageGroup:"flags"},[rs]:{exposure:"hidden",storageGroup:"flags"},[ns]:{exposure:"hidden"},[os]:{exposure:"hidden",storageGroup:"flags"},[as]:{exposure:"hidden",storageGroup:"flags"},[ls]:{exposure:"hidden",storageGroup:"flags",volatile:!0},[us]:{exposure:"hidden",storageGroup:"flags"},[hs]:{exposure:"hidden"},[cs]:{exposure:"hidden"},[ds]:{exposure:"hidden"}
1,[vs]:{exposure:"hidden"},[gs]:{exposure:"hidden",storageGroup:"surveys"},[fs]:{exposure:"hidden",storageGroup:"surveys",volatile:!0},[_s]:{exposure:"event"},[ms]:{exposure:"hidden"},[ys]:{exposure:"hidden"},[bs]:{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"},[ws]:{exposure:"hidden"},[xs]:{exposure:"hidden"},[ps]:{exposure:"event"},[ks]:{exposure:"hidden"},[Es]:{exposure:"hidden",storageGroup:"flags",volatile:!0},[Ss]:{exposure:"hidden"},[Ps]:{exposure:"hidden"},[Is]:{exposure:"hidden"},[Fs]:{exposure:"hidden"},[$s]:{exposure:"hidden"},[Cs]:{exposure:"hidden"},[Ts]:{exposure:"hidden"},[Ji]:{exposure:"event"},[Qi]:{exposure:"event"},[Zi]:{exposure:"event"},[es]:{exposure:"event"},[Rs]:{exposure:"event"},[Os]:{exposure:"event"},[As]:{exposure:"event"},$sdk_debug_replay_event_trigger_status:{exposure:"event"},$sdk_debug_replay_linked_flag_trigger_status:{exposure:"event"},$sdk_debug_replay_matched_recording_trigger_groups:{exposure:"event"}
1,$sdk_debug_replay_pending_trigger_conditions:{exposure:"event"},$sdk_debug_replay_remote_trigger_matching_config:{exposure:"event"},$sdk_debug_replay_trigger_groups_count:{exposure:"event"},$sdk_debug_replay_url_trigger_status:{exposure:"event"},$session_recording_start_reason:{exposure:"event"}},Tn=[["$posthog_sr_group_event_trigger_",{exposure:"hidden"}],["$posthog_sr_group_url_trigger_",{exposure:"hidden"}],["$posthog_sr_group_sampling_",{exposure:"hidden"}]],Dn=e=>{var t=Cn[e];if(t)return t;for(var i of Tn){var s=i[1];if(0===e.indexOf(i[0]))return s}},Mn=(e,t)=>{try{return JSON.stringify(e,(e,t)=>"bigint"==typeof t?t.toString():t,t)}catch(t){return V(e)}},Rn=e=>{var t=null==o?void 0:o.createElement("a");return Z(t)?null:(t.href=e,t)},On=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(!K(i)||2>i.length)return"";var o=i[1];try{o=decodeURIComponent(o)}catch(e){Ii.error("Skipping decoding for malformed query param: "+o)}return o.replace(/\+/g," ")},An=function(e,t,i){if(!e||!t||!t.length)return e;for(var s=e.split("#"),r=s[1],n=(s[0]||"").split("?"),o=n[1],a=n[0],l=(o||"").split("&"),u=[],h=0;l.length>h;h++){var c=l[h].split("=");K(c)&&(t.includes(c[0])?u.push(c[0]+"="+i):u.push(l[h]))}var d=a;return null!=o&&(d+="?"+u.join("&")),null!=r&&(d+="#"+r),d},Ln=function(e,t){var i=e.match(new RegExp(t+"=([^&]*)"));return i?i[1]:null},Nn=(e,t)=>e>=t&&v(),jn=(e,t,i,s)=>{if(0===e){if(v()){var r=t+1;return r===i&&s(),r}return t}return 0},qn="https?://(.*)",Bn=["gclid","gclsrc","dclid","gbraid","wbraid","fbclid","msclkid","twclid","li_fat_id","igshid","ttclid","rdt_cid","epik","qclid","sccid","irclid","_kx"],Hn=["utm_source","utm_medium","utm_campaign","utm_content","utm_term","gad_source","mc_cid",...Bn],zn="<masked>",Un=["li_fat_id"];function Vn(e,t,i){if(!o)return{};var s,r=t?[...Bn,...i||[]]:[],n=Wn(An(o.URL,r,zn),e),a=(s={},Xs(Un,function(e){var t=or(e);s[e]=t||null}),s);return Js(a,n)}function Wn(e,t){var i=Hn.concat(t||[]),s={};return Xs(i,function(t){var i=On(e,t);s[t]=i||null}),s}function Gn(e){var t=function(e){return e?0===e.search(qn+"google.([^/?]*)")?"google":0===e.search(qn+"bing.com")?"bing":0===e.search(qn+"yahoo.com")?"yahoo":0===e.search(qn+"duckduckgo.com")?"duckduckgo":null:null}(e),i="yahoo"!=t?"q":"p",s={};if(!ie(t)){s.$search_engine=t;var r=o?On(o.referrer,i):"";r.length&&(s.ph_keyword=r)}return s}function Yn(){return navigator.language||navigator.userLanguage}var Kn="$direct";function Xn(){return(null==o?void 0:o.referrer)||Kn}function Jn(e,t,i){void 0===i&&(i=!1);var s=e?[...Bn,...t||[]]:[],r=i?St(null==a?void 0:a.href):null==a?void 0:a.href,n=null==r?void 0:r.substring(0,1e3);return{r:Xn().substring(0,1e3),u:n?An(n,s,zn):void 0}}function Qn(e,t){var i;void 0===t&&(t=!1);var s=e.r,r=e.u,n=t?St(r):r,o={$referrer:s,$referring_domain:null==s?void 0:s==Kn?Kn:null==(i=Rn(s))?void 0:i.host};
1if(n){o.$current_url=n;var a=Rn(n);o.$host=null==a?void 0:a.host,o.$pathname=null==a?void 0:a.pathname;var l=Wn(n);Js(o,l)}if(s){var u=Gn(s);Js(o,u)}return o}function Zn(){try{return Intl.DateTimeFormat().resolvedOptions().timeZone}catch(s){return}}function eo(){try{return(new Date).getTimezoneOffset()}catch(s){return}}var to={flags:Es,surveys:fs},io=["cookie","localstorage","localstorage+cookie","sessionstorage","memory"],so=e=>e+"_cookie_identity_change_pending",ro="main",no=(e,t)=>{Xs(e,(i,s)=>{var r=Dn(s);r&&"event"!==r.exposure||{}.hasOwnProperty.call(t,s)||delete e[s]})};class oo{constructor(e,t,i){if(void 0===i&&(i=!0),this.ls={},this.us=!1,this.hs=!1,this.ds=!1,this.vs=!1,this.Di=e,this.cs=i,this.props={},this.fs=void 0,this.ps=(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.Qn=this.gs(e),this.hs=this.ys(e),this.load(),e.debug&&Ii.info("Persistence loaded",e.persistence,y({},this.props)),this.update_config(e,e,t),this.save(),s){var r=()=>this.flush();rr(s,"beforeunload",r,{capture:!1}),rr(s,"pagehide",r,{capture:!1})}}bs(){var e,t=null==(e=this.Di)?void 0:e.persistence_save_debounce_ms;return re(t)&&t>0?t:0}_s(e){if(this.Di.cookieWinsOnConflict&&"localstorage+cookie"===this.Di.persistence.toLowerCase())if(e)try{var t=Er(e,this.Di.cookie_persisted_properties||[]),i=Pr(t,this.Di.cookie_persisted_properties||[]),s=JSON.stringify(t)+"|"+JSON.stringify(i),r=fr.Pr(this.ps)||void 0;r&&Fr(this.ps,r)===s&&(this.ws=s,this.ks=r)}catch(e){}else try{var n=fr.Pr(this.ps)||void 0;this.ws=n?Fr(this.ps,n):void 0,this.ks=n}catch(e){}}syncCookieProperties(){return this.Ss(this.Di)}Ss(e,t){if(void 0===t&&(t=!1),this.xs&&!t||this.vs||!e.cookieWinsOnConflict||"localstorage+cookie"!==e.persistence.toLowerCase())return!1;var i;try{i=fr.Pr(this.ps)||void 0}catch(e){}if(!i||i===this.ks)return!1;var s,r=Fr(this.ps,i);try{s=kr(JSON.parse(i))}catch(e){return!1}if((fr.Pr(this.ps)||void 0)!==i)return!1;this.ws=r,this.ks=i;var n=Ir(this.ps,i),o=[...br,...n.properties],a={};if(Object.keys(s).forEach(e=>{var t=s[e];(Z(t)||ie(t)||""===t||e===Ss&&t!==qs&&t!==Bs)&&(a[e]=!0,delete s[e])}),Q(s))return!1;var l=Oi in s||s[Ss]===qs||s[Ss]===Bs,u=this.props[Oi],h=this.props[Ss],c=Js({},this.props);[...br,...e.cookie_persisted_properties||[]].forEach(e=>{if(-1!==o.indexOf(e)&&!(e in s)&&!a[e]&&(l||e!==Oi&&e!==Ss)){var t=c[e];!n.isValid&&-1!==br.indexOf(e)&&(!1===t||0===t)||delete c[e]}}),this.props=Js(c,s),!l||Ss in s||Ss in this.props||this.Cs(Ss,qs);var d=this.props[Oi],v=this.props[Ss];return!l||d===u&&v===h||(this.ds=!0,Dr.Dr(so(this.ps),!0),this.Ts(ds),this.Ts(rs),this.Ts(ss),this.Ts(os),this.Ts(as),this.Ts(ls),this.Ts(Es),this.Ts(ks),this.Ts(ws),v===qs&&(h===Bs||s[Ss]===qs||!Z(u)&&d!==u)&&(no(this.props,s),this.Ts(vs)),v===Bs?this.props.$user_id=d:delete this.props.$user_id,this.Ts(Ni)),!0}
1consumeCookieIdentityChange(){var e=so(this.ps),t=this.ds||!!Dr.Pr(e);return this.ds=!1,t&&Dr.qr(e),t}Ms(e){return void 0===e&&(e=!1),!(this.vs||this.xs&&!e||!this.Di.cookieWinsOnConflict||"localstorage+cookie"!==this.Di.persistence.toLowerCase()||(this.vs=!0,0))}Es(){this.vs&&(Z(this.Is)||(clearTimeout(this.Is),this.Is=void 0),delete this.ls[ro],this.Rs(!0))}Ps(e){if(void 0===e&&(e=!0),this.vs)try{e?this.Es():Z(this.Is)||(clearTimeout(this.Is),this.Is=void 0)}finally{this.vs=!1}}isDisabled(){return!!this.xs}gs(e){-1===io.indexOf(e.persistence.toLowerCase())&&(Ii.critical("Unknown persistence type "+e.persistence+"; falling back to localStorage+cookie"),e.persistence="localStorage+cookie");var t,i=function(e,t){void 0===e&&(e=[]),void 0===t&&(t=!1);var i=[...br,...e];return y({},mr,{Br(e){try{var s,r={};try{s=fr.Pr(e)||void 0,r=s?kr(JSON.parse(s)):{}}catch(e){}var n,o=JSON.parse(mr.Pr(e)||"{}");if(t){var a=Ir(e,s),l=[...br,...a.properties],u={};Object.keys(r).forEach(e=>{var t=r[e];ie(t)||""===t||e===Ss&&t!==qs&&t!==Bs||(u[e]=t)});var h=Oi in u||u[Ss]===qs||u[Ss]===Bs;if(Object.keys(u).length>0){var c,d=o[Oi],v=null!==(c=o[Ss])&&void 0!==c?c:qs;i.forEach(e=>{if(-1!==l.indexOf(e)&&!(e in r)&&(h||e!==Oi&&e!==Ss)){var t=o[e];!a.isValid&&-1!==br.indexOf(e)&&(!1===t||0===t)||delete o[e]}}),!h||Ss in r||Ss in o||(o[Ss]=qs),!h||(Oi in u?u[Oi]:o[Oi])===d&&(Ss in u?u[Ss]:o[Ss])===v||(yr.forEach(e=>delete o[e]),u[Ss]===Bs&&Oi in u?o.$user_id=u[Oi]:delete o.$user_id,u[Ss]!==Bs&&(delete o[ps],delete o[vs]),delete o.__al
vendor: 1,952 bytes, line 1
1ias)}n=Js(o,u)}else n=Js(r,o);return mr.Dr(e,n),n}catch(e){}return null},Dr(i,s,r,n,o,a){var l=mr.Dr(i,s,void 0,void 0,a);try{var u=Er(s,e);if(Object.keys(u).length){if(t){var h=wr(i),c=Pr(u,e);if(fr.Dr(h,c,r,n,o,a),fr.Pr(h)!==JSON.stringify(c)){fr.qr(h,n);var d=Er(s);return fr.Dr(i,d,r,n,o,a),l}}fr.Dr(i,u,r,n,o,a)}}catch(i){mr.jr(i)}return l},qr(e,t){try{null==s||s.localStorage.removeItem(e),fr.qr(e,t),fr.qr(wr(e),t)}catch(s){mr.jr(s)}}})}(e.cookie_persisted_properties||[],e.cookieWinsOnConflict),r=!1,n=e.persistence.toLowerCase();return"localstorage"===n&&mr.Nr()?(t=mr,r=!0):"localstorage+cookie"===n&&i.Nr()?(t=i,r=!0):"sessionstorage"===n&&Dr.Nr()?t=Dr:"memory"===n?t=Cr:"cookie"===n?t=fr:i.Nr()?(t=i,r=!0):t=fr,this.us=r,t}As(e){return this.ps+"__"+e}ys(e){return this.us&&!!e.split_storage}properties(){var e={};return Xs(this.props,(t,i)=>{var s=Dn(i);if(!s||"event"===s.exposure){if(null!=s&&null!=s.shouldSkipFromEventProperties&&s.shouldSkipFromEventProperties(t))return;e[i]=t}}),e}load(e){if(void 0===e&&(e=!1),!this.xs||e){var t=this.Di.cookieWinsOnConflict&&"localstorage+cookie"===this.Di.persistence.toLowerCase(),i=t?mr.Br(this.ps):null,s={};if(t)try{Xs(s=kr(fr.Br(this.ps)),(e,t)=>{(Z(e)||ie(e)||""===e)&&delete s[t]})}catch(e){}var r=this.Qn.Br(this.ps);if(r&&(this.props=Js({},r)),this.hs&&this.Fs(),t&&r){var n,o,a=null==i?void 0:i[Oi],l=null!==(n=null==i?void 0:i[Ss])&&void 0!==n?n:qs,u=r[Oi],h=null!==(o=r[Ss])&&void 0!==o?o:qs;if(u!==a||h!==l){this.ds=!0,Dr.Dr(so(this.ps),!0);var c=Js({},this.props);yr.forEach(e=>delete c[e]),h===qs&&(l===Bs||s[Ss]===qs||!Z(a)&&u!==a)&&(no(c,s),delete c[vs]),this.props=c;var d=new Set;yr.forEach(e=>{var t,i=null==(t=Dn(e))?void 0:t.storageGroup;i&&d.add(i)}),d.forEach(e=>{var t={};Xs(this.props,(i,s)=>{var r;(null==(r=Dn(s))?void 0:r.storageGroup)===e&&(t[s]=i)}),Q(t)?(mr.qr(this.As(e)),this.ls[e]={}):mr.Dr(this.As(e),t)&&(this.ls[e]={persisted:!0,fingerprint:this.Os(t,e)})})}}
1Dr.Pr(so(this.ps))&&(this.ds=!0)}}Fs(){for(var e of $n){var t=mr.Br(this.As(e));if(t&&!Q(t)){var i=this.Ls(e);i.persisted=!0,this.$s(e)||(i.fingerprint=this.Os(t,e)),this.Ds(e,t)||Js(this.props,t)}}}$s(e){return Object.keys(this.props).some(t=>{var i;return(null==(i=Dn(t))?void 0:i.storageGroup)===e})}Ds(e,t){var i=to[e];if(!i)return!1;var s=t[i],r=this.props[i];return re(s)&&re(r)&&r>s}refreshKey(e){var t;if(!this.xs){var i=this.hs?null==(t=Dn(e))?void 0:t.storageGroup:void 0,s=i?mr.Br(this.As(i)):this.Qn.Br(this.ps);if(s&&e in s)this.Cs(e,s[e]);else{if(i){var r=this.Qn.Br(this.ps);if(r&&e in r)return void this.Cs(e,r[e])}this.Ts(e)}}}save(){if(!this.xs){var e=this.bs();e>0?Z(this.Is)&&(this.Is=setTimeout(()=>{this.Is=void 0,this.Rs()},e)):this.Rs()}}flush(){Z(this.Is)||(clearTimeout(this.Is),this.Is=void 0,this.Rs())}Rs(e){void 0===e&&(e=!1),this.xs||this.vs&&!e||(e||this.syncCookieProperties(),this.hs?this.Ns():this.qs(this.Qn,this.ps,this.props,ro)&&this._s(this.props))}Ns(){var e=this.js(),t=e.main,i=e.groups;for(var s of(this.qs(this.Qn,this.ps,t,ro)&&this._s(t),$n)){var r,n=i[s];(!Q(n)||null!=(r=this.ls[s])&&r.persisted)&&this.qs(mr,this.As(s),n,s)}}js(){var e={},t={flags:{},surveys:{}};return Xs(this.props,(i,s)=>{var r,n=null==(r=Dn(s))?void 0:r.storageGroup;n?t[n][s]=i:e[s]=i}),{main:e,groups:t}}Os(e,t){if(t===ro)return JSON.stringify(e)+"|"+this.Bs+"|"+this.Hs+"|"+this.Us;var i={};return Xs(e,(e,t)=>{var s;i[t]=null!=(s=Dn(t))&&s.volatile?"__volatile__":e}),JSON.stringify(i)}qs(e,t,i,s){var r,n=this.Ls(s);if(s!==ro&&!n.dirty&&!Z(n.fingerprint))return!1;try{if((r=this.Os(i,s))===n.fingerprint)return n.dirty=!1,!1}catch(e){r=void 0}return e.Dr(t,i,this.Bs,this.Hs,this.Us,this.Di.debug)?(n.dirty=!1,s!==ro&&(n.persisted=!0),Z(r)||(n.fingerprint=r),!0):(this.Di.debug&&Ii.warn('failed to persist storage entry "'+t+'"; will retry on next save'),!1)}remove(e){var t=(void 0===e?{}:e).keepGroupEntries,i=void 0!==t&&t;if(Z(this.Is)||(clearTimeout(this.Is),this.Is=void 0),this.Qn.qr(this.ps,!1),this.Qn.qr(this.ps,!0),!i&&this.cs)for(var s of $n)mr.qr(this.As(s));i?delete this.ls[ro]:this.ls={},this.ws=void 0,this.ks=void 0}clear(){this.remove(),this.props={}}register_once(e,t,i){if(J(e)){this.syncCookieProperties(),Z(t)&&(t="None"),this.Bs=Z(i)?this.zs:i;var s=!1;if(Xs(e,(e,i)=>{this.props.hasOwnProperty(i)&&this.props[i]!==t||(this.Cs(i,e),s=!0)}),s)return this.save(),!0}return!1}register(e,t){if(J(e)){this.syncCookieProperties(),this.Bs=Z(t)?this.zs:t;var i=!1;if(Xs(e,(t,s)=>{e.hasOwnProperty(s)&&(this.props[s]!==t||J(t)||K(t))&&(this.Cs(s,t),i=!0)}),i)return this.save(),!0}return!1}unregister(e){this.syncCookieProperties();var t="string"==typeof e?[e]:e,i=!1;for(var s of t)s in this.props&&(this.Ts(s),i=!0);i&&this.save()}update_campaign_params(){var e=null==o?void 0:o.URL;if(e!==this.fs){var t=Vn(this.Di.custom_campaign_params,this.Di.mask_personal_data_properties,this.Di.custom_personal_data_properties);Q(tr(t))||this.register(t),this.fs=e}}update_search_keyword(){var e;this.register((e=null==o?void 0:o.referrer)?Gn(e):{})}update_referrer_info(){var e;this.register_once({$referrer:Xn(),$referring_domain:null!=o&&o.referrer&&(null==(e=Rn(o.referrer))?void 0:e.host)||Kn},void 0)}set_initial_person_info(){this.props[Fs]||this.props[$s]||this.register_once({[Cs]:Jn(this.Di.mask_personal_data_properties,this.Di.custom_personal_data_properties,this.Di.disable_capture_url_hashes)},void 0)}get_initial_props(){var e={};Xs([$s,Fs],t=>{var i=this.props[t];i&&Xs(i,function(t,i){e["$initial_"+U(i)]=t})});var t=this.props[Cs];if(t){var i=function(e,t){void 0===t&&(t=!1);var i=Qn(e,t),s={};return Xs(i,function(e,t){s["$initial_"+U(t)]=e}),s}(t,this.Di.disable_capture_url_hashes);Js(e,i)}return e}safe_merge(e){return Xs(this.props,function(t,i){i in e||(e[i]=t)}),e}update_config(e,t,i){var s=e.persistence!==t.persistence,r=!((e,t)=>{if(e.length!==t.length)return!1;var i=[...e].sort(),s=[...t].sort();return i.every((e,t)=>e===s[t])})(e.cookie_persisted_properties||[],t.cookie_persisted_properties||[]),n=s||r,o=e.cookieWinsOnConflict!==t.cookieWinsOnConflict,a=e.disable_persistence||!!i,l=!!this.xs&&!a;a||this.Ss(t,l),this.Di=e,!a&&(s||r||o)&&(this.ws=void 0,this.ks=void 0,this.Ss(y({},e,{cookie_persisted_properties:t.cookie_persisted_properties}),l));var u=n||o?this.gs(e):this.Qn,h=this.ys(e),c=n||h!==this.hs,d=!a&&(c||e.cross_subdomain_cookie!==this.Hs||e.secure_cookie!==this.Us)&&this.Ms(l);try{if(this.zs=this.Bs=e.cookie_expiration,this.set_disabled(a),this.set_cross_subdomain(e.cross_subdomain_cookie),this.set_secure(e.secure_cookie),c){var v=this.props;this.clear(),this.Qn=u,this.hs=h,this.props=v,this.save()}else o&&(this.Qn=u,a||(delete this.ls[ro],this.Rs()))}finally{d&&this.Ps()}}set_disabled(e){this.xs=e,this.xs?this.remove():this.save()}set_cross_subdomain(e){e!==this.Hs&&(this.Hs=e,this.remove({keepGroupEntries:!0}),this.save())}set_secure(e){e!==this.Us&&(this.Us=e,this.remove({keepGroupEntries:!0}),this.save())}set_event_timer(e,t){var i=this.props[ji]||{};i[e]=t,this.Cs(ji,i),this.save()}remove_event_timer(e){var t=this.props[ji]||{},i=t[e];return Z(i)||(delete t[e],this.Cs(ji,t),this.save()),i}get_property(e){return this.props[e]}set_property(e,t){this.Cs(e,t),this.save()}Cs(e,t){var i;this.props[e]=t,null!=(i=Dn(e))&&i.volatile||this.Ws(e)}Ts(e){delete this.props[e],this.Ws(e)}Ws(e){var t,i=null==(t=Dn(e))?void 0:t.storageGroup;i&&(this.Ls(i).dirty=!0)}Ls(e){return this.ls[e]||(this.ls[e]={})}}function ao(e){var t=!0;return{dispose(){if(t){t=!1;var i=e();i&&X(i.then)&&i.then(void 0,()=>{})}}}}var lo="gzip-js",uo="base64",ho="events",co="cancelEvents",vo="popover",po="api",go="widget",fo="survey shown",_o="survey dismissed",mo="survey sent",yo="$survey_id",bo="$survey_iteration",wo="$survey_last_seen_date",xo="popover",ko="inline",Eo="product tour shown",So="$product_tour_last_seen_date",Po="$product_tour_type",Io=Fi("[RateLimiter]");class Fo{constructor(e){this.serverLimits={},this.lastEventRateLimited=!1,this.checkForLimiting=e=>{var t=e.text;
1if(t&&t.length)try{(JSON.parse(t).quota_limited||[]).forEach(e=>{Io.info((e||"events")+" is quota limited."),this.serverLimits[e]=(new Date).getTime()+6e4})}catch(e){return void Io.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){var t,i,s;void 0===e&&(e=!1);var r=this.captureEventsBurstLimit,n=this.captureEventsPerSecond,o=(new Date).getTime(),a=null!==(t=null==(i=this.instance.persistence)?void 0:i.get_property(Is))&&void 0!==t?t:{tokens:r,last:o};a.tokens+=(o-a.last)/1e3*n,a.last=o,a.tokens>r&&(a.tokens=r);var l=1>a.tokens;if(l||e||(a.tokens=Math.max(0,a.tokens-1)),l&&!e){var u=(re(a.dropped)?a.dropped:0)+1;a.dropped=u,!this.lastEventRateLimited&&this.Vs(u)&&(a.dropped=0)}return this.lastEventRateLimited=l,null==(s=this.instance.persistence)||s.set_property(Is,a),{isRateLimited:l,remainingTokens:a.tokens}}Gs(e){var t=this.instance.config.property_denylist;return!K(t)||!t.includes(e)}Zs(){var e;if(this.Gs("$current_url")&&this.Gs("$pathname")&&null!=a&&a.pathname)return""+(null!==(e=a.origin)&&void 0!==e?e:"")+a.pathname}Vs(e){var t,i,s=this.captureEventsBurstLimit,r=this.captureEventsPerSecond,n=this.Zs(),o=this.Gs("$session_id")?null==(t=(i=this.instance).get_session_id)?void 0:t.call(i):void 0,a=[e+" event(s) dropped since the last warning",n?"triggered on "+n:void 0,o?"session "+o:void 0].filter(Boolean).join(", ");return!!this.instance.capture("$$client_ingestion_warning",{$$client_ingestion_warning_message:"posthog-js client rate limited: "+a+". Config is set to "+r+" events per second and "+s+" events burst limit."},{skip_client_rate_limiting:!0})}isServerRateLimited(e){var t=this.serverLimits[e||"events"]||!1;return!1!==t&&(new Date).getTime()<t}}var $o=Fi("[RemoteConfig]");class Co{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}Qs(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()}Js(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 $o.info("Using preloaded remote config",this.remoteConfig),this.Ks(this.remoteConfig),void this.Ys();if(this._instance.Xs())return void $o.warn("Remote config is disabled. Falling back to local config.");this.Qs(e=>{if(!e)return $o.info("No config found after loading remote JS config. Falling back to JSON."),void this.Js(e=>{this.Ks(e.json,e),this.Ys()});this.Ks(e),this.Ys()})}catch(s){$o.error("Error loading remote config",s),this.Ks()}}stop(){this.ta&&(clearInterval(this.ta),this.ta=void 0)}refresh(){!this._instance.Xs()&&o&&"hidden"!==o.visibilityState&&this._instance.reloadFeatureFlags()}Ys(){var e;if(!this.ta){var t=null!==(e=this._instance.config.remote_config_refresh_interval_ms)&&void 0!==e?e:3e5;0!==t&&(this.ta=setInterval(()=>{this.refresh()},t))}}Ks(e,t){!e&&t&&(0===t.statusCode?t.error||$o.warn("Failed to fetch remote config from PostHog."):$o.error("Failed to fetch remote config from PostHog."));try{this._instance.Ks(e?{ok:!0,config:e}:{ok:!1})}catch(e){$o.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){$o.error("Error loading feature flags",e)}}}var To=Uint8Array,Do=Uint16Array,Mo=Uint32Array,Ro=new To([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]),Oo=new To([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]),Ao=new To([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),Lo=function(e,t){for(var i=new Do(31),s=0;31>s;++s)i[s]=t+=1<<e[s-1];var r=new Mo(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]},No=Lo(Ro,2),jo=No[1];No[0][28]=258,jo[258]=28;for(var qo=Lo(Oo,0)[1],Bo=new Do(32768),Ho=0;32768>
vendor: 5,664 bytes, line 1
1Ho;++Ho){var zo=(43690&Ho)>>>1|(21845&Ho)<<1;Bo[Ho]=((65280&(zo=(61680&(zo=(52428&zo)>>>2|(13107&zo)<<2))>>>4|(3855&zo)<<4))>>>8|(255&zo)<<8)>>>1}var Uo=function(e,t,i){for(var s=e.length,r=0,n=new Do(t);s>r;++r)++n[e[r]-1];var o,a=new Do(t);for(r=0;t>r;++r)a[r]=a[r-1]+n[r-1]<<1;if(i){o=new Do(1<<t);var l=15-t;for(r=0;s>r;++r)if(e[r])for(var u=r<<4|e[r],h=t-e[r],c=a[e[r]-1]++<<h,d=c|(1<<h)-1;d>=c;++c)o[Bo[c]>>>l]=u}else for(o=new Do(s),r=0;s>r;++r)o[r]=Bo[a[e[r]-1]++]>>>15-e[r];return o},Vo=new To(288);for(Ho=0;144>Ho;++Ho)Vo[Ho]=8;for(Ho=144;256>Ho;++Ho)Vo[Ho]=9;for(Ho=256;280>Ho;++Ho)Vo[Ho]=7;for(Ho=280;288>Ho;++Ho)Vo[Ho]=8;var Wo=new To(32);for(Ho=0;32>Ho;++Ho)Wo[Ho]=5;var Go=Uo(Vo,9,0),Yo=Uo(Wo,5,0),Ko=function(e){return(e/8|0)+(7&e&&1)},Xo=function(e,t,i){(null==i||i>e.length)&&(i=e.length);var s=new(e instanceof Do?Do:e instanceof Mo?Mo:To)(i-t);return s.set(e.subarray(t,i)),s},Jo=function(e,t,i){var s=t/8|0;e[s]|=i<<=7&t,e[s+1]|=i>>>8},Qo=function(e,t,i){var s=t/8|0;e[s]|=i<<=7&t,e[s+1]|=i>>>8,e[s+2]|=i>>>16},Zo=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 To(0),0];if(1==r){var o=new To(i[0].s+1);return o[i[0].s]=1,[o,1]}i.sort(function(e,t){return e.f-t.f}),i.push({s:-1,f:25001});var a=i[0],l=i[1],u=0,h=1,c=2;for(i[0]={s:-1,f:a.f+l.f,l:a,r:l};h!=r-1;)a=i[i[c].f>i[u].f?u++:c++],l=i[u!=h&&i[c].f>i[u].f?u++:c++],i[h++]={s:-1,f:a.f+l.f,l:a,r:l};var d=n[0].s;for(s=1;r>s;++s)n[s].s>d&&(d=n[s].s);var v=new Do(d+1),p=ea(i[h-1],v,0);if(p>t){s=0;var g=0,f=p-t,_=1<<f;for(n.sort(function(e,t){return v[t.s]-v[e.s]||e.f-t.f});r>s;++s){var m=n[s].s;if(t>=v[m])break;g+=_-(1<<p-v[m]),v[m]=t}for(g>>>=f;g>0;){var y=n[s].s;t>v[y]?g-=1<<t-v[y]++-1:++s}for(;s>=0&&g;--s){var b=n[s].s;v[b]==t&&(--v[b],++g)}p=t}return[new To(v),p]},ea=function(e,t,i){return-1==e.s?Math.max(ea(e.l,t,i+1),ea(e.r,t,i+1)):t[e.s]=i},ta=function(e){for(var t=e.length;t&&!e[--t];);for(var i=new Do(++t),s=0,r=e[0],n=1,o=function(e){i[s++]=e},a=1;t>=a;++a)if(e[a]==r&&a!=t)++n;else{if(!r&&n>2){for(;n>138;n-=138)o(32754);n>2&&(o(n>10?n-11<<5|28690:n-3<<5|12305),n=0)}else if(n>3){for(o(r),--n;n>6;n-=6)o(8304);n>2&&(o(n-3<<5|8208),n=0)}for(;n--;)o(r);n=1,r=e[a]}return[i.subarray(0,s),t]},ia=function(e,t){for(var i=0,s=0;t.length>s;++s)i+=e[s]*t[s];return i},sa=function(e,t,i){var s=i.length,r=Ko(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)},ra=function(e,t,i,s,r,n,o,a,l,u,h){Jo(t,h++,i),++r[256];for(var c=Zo(r,15),d=c[0],v=c[1],p=Zo(n,15),g=p[0],f=p[1],_=ta(d),m=_[0],y=_[1],b=ta(g),w=b[0],x=b[1],k=new Do(19),E=0;m.length>E;++E)k[31&m[E]]++;for(E=0;w.length>E;++E)k[31&w[E]]++;for(var S=Zo(k,7),P=S[0],I=S[1],F=19;F>4&&!P[Ao[F-1]];--F);var $,C,T,D,M=u+5<<3,R=ia(r,Vo)+ia(n,Wo)+o,O=ia(r,d)+ia(n,g)+o+14+3*F+ia(k,P)+(2*k[16]+3*k[17]+7*k[18]);if(R>=M&&O>=M)return sa(t,h,e.subarray(l,l+u));if(Jo(t,h,1+(R>O)),h+=2,R>O){$=Uo(d,v,0),C=d,T=Uo(g,f,0),D=g;var A=Uo(P,I,0);for(Jo(t,h,y-257),Jo(t,h+5,x-1),Jo(t,h+10,F-4),h+=14,E=0;F>E;++E)Jo(t,h+3*E,P[Ao[E]]);h+=3*F;for(var L=[m,w],N=0;2>N;++N){var j=L[N];for(E=0;j.length>E;++E)Jo(t,h,A[q=31&j[E]]),h+=P[q],q>15&&(Jo(t,h,j[E]>>>5&127),h+=j[E]>>>12)}}else $=Go,C=Vo,T=Yo,D=Wo;for(E=0;a>E;++E)if(s[E]>255){var q;Qo(t,h,$[257+(q=s[E]>>>18&31)]),h+=C[q+257],q>7&&(Jo(t,h,s[E]>>>23&31),h+=Ro[q]);var B=31&s[E];Qo(t,h,T[B]),h+=D[B],B>3&&(Qo(t,h,s[E]>>>5&8191),h+=Oo[B])}else Qo(t,h,$[s[E]]),h+=C[s[E]];return Qo(t,h,$[256]),h+C[256]},na=new Mo([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),oa=function(){for(var e=new Mo(256),t=0;256>t;++t){for(var i=t,s=9;--s;)i=(1&i&&3988292384)^i>>>1;e[t]=i}return e}(),aa=function(e,t,i){for(;i;++t)e[t]=i,i>>>=8};var la=!!u||!!l,ua="text/plain",ha=!1,ca=(e,t)=>{var i=e.split("#"),s=i[1],r=i[0].split("?"),n=r[0],o=r[1];if(!o)return e;var a=o.split("&").filter(e=>e.split("=")[0]!==t).join("&");return n+(a?"?"+a:"")+(s?"#"+s:"")},da=function(e,t,i){var s;void 0===i&&(i=!0);var r=e.split("?"),n=r[0],o=r[1],a=y({},t),l=null!==(s=null==o?void 0:o.split("&").map(e=>{var t,s=e.split("="),r=s[0],n=i&&null!==(t=a[r])&&void 0!==t?t:s[1];return delete a[r],r+"="+n}))&&void 0!==s?s:[],u=function(e,t){var i,s;void 0===t&&(t="&");var r=[];return Xs(e,function(e,t){Z(e)||Z(t)||"undefined"===t||(i=encodeURIComponent((e=>e instanceof File)(e)?e.name:e.toString()),s=encodeURIComponent(t),r[r.length]=s+"="+i)}),r.join(t)}(a);return u&&l.push(u),l.length>0?n+"?"+l.join("&"):n},va=e=>{if(e.ea)return e.ea;var t=e.data,i=e.compression;if(t){if(i===lo){var s=function(e,t){void 0===t&&(t={});var i=function(){var e=4294967295;return{p(t){for(var i=e,s=0;t.length>s;++s)i=oa[255&i^t[s]]^i>>>8;e=i},d(){return 4294967295^e}}}(),s=e.length;i.p(e);var r,n,o,a,l=(a=10+((r=t).filename&&r.filename.length+1||0),function(e,t,i,s){var r=e.length,n=new To(s+r+5*(1+Math.floor(r/7e3))+8),o=n.subarray(s,n.length-8),a=0;if(!t||8>r)for(var l=0;r>=l;l+=65535){var u=l+65535;r>u?a=sa(o,a,e.subarray(l,u)):(o[l]=!0,a=sa(o,a,e.subarray(l,r)))}else{for(var h=na[t-1],c=h>>>13,d=8191&h,v=(1<<i)-1,p=new Do(32768),g=new Do(v+1),f=Math.ceil(i/3),_=2*f,m=function(t){return(e[t]^e[t+1]<<f^e[t+2]<<_)&v},y=new Mo(25e3),b=new Do(288),w=new Do(32),x=0,k=0,E=(l=0,0),S=0,P=0;r>l;++l){var I=m(l),F=32767&l,$=g[I];if(p[F]=$,g[I]=F,l>=S){var C=r-l;if((x>7e3||E>24576)&&C>423){a=ra(e,o,0,y,b,w,k,E,P,l-P,a),E=x=k=0,P=l;for(var T=0;286>T;++T)b[T]=0;for(T=0;30>T;++T)w[T]=0}var D=2,M=0,R=d,O=F-$&32767;if(C>2&&I==m(l-O))for(var A=Math.min(c,C)-1,L=Math.min(32767,l),N=Math.min(258,C);L>=O&&--R&&F!=$;){if(e[l+D]==e[l+D-O]){for(var j=0;N>j&&e[l+j]==e[l+j-O];++j);if(j>
1D){if(D=j,M=O,j>A)break;var q=Math.min(O,j-2),B=0;for(T=0;q>T;++T){var H=l-O+T+32768&32767,z=H-p[H]+32768&32767;z>B&&(B=z,$=H)}}}O+=(F=$)-($=p[F])+32768&32767}if(M){y[E++]=268435456|jo[D]<<18|qo[M];var U=31&jo[D],V=31&qo[M];k+=Ro[U]+Oo[V],++b[257+U],++w[V],S=l+D,++x}else y[E++]=e[l],++b[e[l]]}}a=ra(e,o,!0,y,b,w,k,E,P,l-P,a)}return Xo(n,0,s+Ko(a)+8)}(n=e,null==(o=t).level?6:o.level,null==o.mem?Math.ceil(1.5*Math.max(8,Math.min(13,Math.log(n.length)))):12+o.mem,a)),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&&aa(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),aa(l,u-8,i.d()),aa(l,u-4,s),l}(function(e){var t=e.length;if("undefined"!=typeof TextEncoder)return(new TextEncoder).encode(e);for(var i=new To(e.length+(e.length>>>1)),s=0,r=function(e){i[s++]=e},n=0;t>n;++n){if(s+5>i.length){var o=new To(s+8+(t-n<<1));o.set(i),i=o}var a=e.charCodeAt(n);128>a?r(a):2048>a?(r(192|a>>>6),r(128|63&a)):a>55295&&57344>a?(r(240|(a=65536+(1047552&a)|1023&e.charCodeAt(++n))>>>18),r(128|a>>>12&63),r(128|a>>>6&63),r(128|63&a)):(r(224|a>>>12),r(128|a>>>6&63),r(128|63&a))}return Xo(i,0,s)}(Mn(t)),{mtime:0});return{contentType:ua,body:s.buffer.slice(s.byteOffset,s.byteOffset+s.byteLength),estimatedSize:s.byteLength}}if(i===uo){var r=function(e){return e?btoa(encodeURIComponent(e).replace(/%([0-9A-F]{2})/g,(e,t)=>String.fromCharCode(parseInt(t,16)))):e}(Mn(t)),n=(e=>"data="+encodeURIComponent("string"==typeof e?e:Mn(e)))(r);return{contentType:"application/x-www-form-urlencoded",body:n,estimatedSize:new Blob([n]).size}}var o=Mn(t);return{contentType:"application/json",body:o,estimatedSize:new Blob([o]).size}}},pa=e=>{var t,i,s=()=>"sendBeacon"===e.transport?{url:da(e.url,{compression:uo}),encodedBody:va(y({},e,{compression:uo,ea:void 0}))}:{url:ca(e.url,"compression"),encodedBody:va(y({},e,{compression:void 0,ea:void 0}))};try{t=va(e)}catch(t){if(D(e.compression,On(e.url,"compression")))return Ii.error("Failed to gzip request body, sending uncompressed payload",t),s();throw t}return t&&D(e.compression,On(e.url,"compression"))&&!((i=t.body)instanceof ArrayBuffer?T(new Uint8Array(i)):ArrayBuffer.isView(i)&&T(new Uint8Array(i.buffer,i.byteOffset,i.byteLength)))?(ha=!0,s()):{url:e.url,encodedBody:t}},ga=e=>{try{return pa(e)}catch(r){return Ii.error(r),void(null==e.callback||e.callback({statusCode:0,error:r}))}},fa=function(){var e=m(function*(e){var t=Mn(e.data),i=yield function(e,t,i){return A.apply(this,arguments)}(t,f.DEBUG,{rethrow:!0});if(!i)return e;var s=yield i.arrayBuffer();return y({},e,{ea:{contentType:ua,body:s,estimatedSize:s.byteLength}})});return function(t){return e.apply(this,arguments)}}(),_a=/Failed to fetch|NetworkError|Load failed/i,ma=e=>"TypeError"===(null==e?void 0:e.name)&&_a.test((null==e?void 0:e.message)||""),ya=e=>{var t=ga(e);if(t){var i=t.url,s=t.encodedBody,r=null!=s?s:{},n=r.contentType,o=r.body,a=r.estimatedSize,u=new Headers;Xs(e.headers,function(e,t){u.append(t,e)}),n&&u.append("Content-Type",n);var c=null,d=!1;if(h){var v=new h;c={signal:v.signal,timeout:setTimeout(()=>{var t,i;d=!0,v.abort((t=e.timeout,(i=new Error("PostHog request timed out"+(t?" after "+t+"ms":""))).name="AbortError",i))},e.timeout)}}var p=t=>{d&&"AbortError"===(null==t?void 0:t.name)||ma(t)?Ii.warn(t):Ii.error(t),null==e.callback||e.callback({statusCode:0,error:t})};try{var g;l(i,y({method:(null==e?void 0:e.method)||"GET",headers:u,keepalive:"POST"===e.method&&!e.ia&&52428.8>(a||0),body:o,signal:null==(g=c)?void 0:g.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){Ii.error(e)}null==e.callback||e.callback(s)})).catch(p).finally(()=>c?clearTimeout(c.timeout):null)}catch(e){c&&clearTimeout(c.timeout),p(e)}}},ba=e=>{try{var t,i=pa(e),s=i.url,r=i.encodedBody,o=null!=r?r:{},a=o.body,l=o.estimatedSize;if(!a)return;var u=a instanceof Blob?a:new Blob([a],{type:o.contentType});if(n.sendBeacon(s,u))return;var h=K(e.data)?e.data:null==(t=e.data)?void 0:t.batch;if(K(h)&&h.length>1&&(null!=l?l:0)>16384){var c=Math.ceil(h.length/2),d=t=>K(e.data)?t:y({},e.data,{batch:t});return ba(y({},e,{data:d(h.slice(0,c))})),void ba(y({},e,{data:d(h.slice(c))}))}Ii.warn("Beacon of ~"+(null!=l?l:0)+" bytes was rejected by the browser, falling back to fetch"),ya(y({},e,{ia:!0}))}catch(e){Ii.warn("Beacon send failed",e)}},wa=(e,t,i,s)=>{var r="query"===s?"POST"===t?"sent_at":"_":void 0;return da(i===lo?ca(e,"compression"):e,y({},r?{[r]:Date.now().toString()}:{},i===lo?{}:{compression:i}))},xa=[];l&&xa.push({transport:"fetch",method:ya}),u&&xa.push({transport:"XHR",method(e){var t=ga(e);if(t){var i=new u,s=t.encodedBody;i.open(e.method||"GET",t.url,!0);var r=null!=s?s:{},n=r.contentType,o=r.body;Xs(e.headers,function(e,t){i.setRequestHeader(t,e)}),n&&i.setRequestHeader("Content-Type",n),e.timeout&&(i.timeout=e.timeout),i.onreadystatechange=()=>{if(4===i.readyState){var t={statusCode:i.status,text:i.responseText};
1if(200===i.status)try{t.json=JSON.parse(i.responseText)}catch(e){}null==e.callback||e.callback(t)}},i.send(o)}}}),null!=n&&n.sendBeacon&&xa.push({transport:"sendBeacon",method:ba});var ka=3e3;class Ea{constructor(e,t){this.ra=!0,this.na=[],this.sa=_e((null==t?void 0:t.flush_interval_ms)||ka,250,5e3,Ii.createLogger("flush interval"),ka),this.aa=e}enqueue(e){this.na.push(e),this.oa||this.la()}unload(){this.ua();var e=this.na.length>0?this.ha():{},t=Object.values(e);[...t.filter(e=>0===e.url.indexOf("/e")),...t.filter(e=>0!==e.url.indexOf("/e"))].map(e=>{this.da(y({},e,{transport:"sendBeacon"}))})}enable(){this.ra=!1,this.la()}la(){var e=this;this.ra||(this.oa=setTimeout(()=>{if(this.ua(),this.na.length>0){var t=this.ha(),i=function(){var i=t[s],r=(new Date).getTime();i.data&&K(i.data)&&Xs(i.data,e=>{e.offset=Math.abs(e.timestamp-r),delete e.timestamp}),e.da(i)};for(var s in t)i()}},this.sa))}da(e){try{this.aa(e)}catch(e){Ii.error(e)}}ua(){clearTimeout(this.oa),this.oa=void 0}ha(){var e={};return Xs(this.na,t=>{var i,s=t,r=(s?s.batchKey:null)||s.url;Z(e[r])&&(e[r]=y({},s,{data:[]})),null==(i=e[r].data)||i.push(s.data)}),this.na=[],e}}var Sa=["retriesPerformedSoFar"];class Pa{constructor(e){this.va=!1,this.ca=3e3,this.na=[],this._instance=e,this.na=[],this.fa=!0,!Z(s)&&"onLine"in s.navigator&&(this.fa=s.navigator.onLine,this.pa=()=>{this.fa=!0,this.ga()},this.ma=()=>{this.fa=!1},rr(s,"online",this.pa),rr(s,"offline",this.ma))}get length(){return this.na.length}retriableRequest(e){var t=e.retriesPerformedSoFar,i=b(e,Sa);ne(t)&&(i.url=da(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.kn(y({retriesPerformedSoFar:t},i));0===e.statusCode&&Ii.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)}}))}kn(e){var t=e.retriesPerformedSoFar||0;e.retriesPerformedSoFar=t+1;var i=function(e){var t=3e3*Math.pow(2,e),i=t/2,s=Math.min(18e5,t),r=Math.random()-.5;return Math.ceil(s+r*(s-i))}(t),s=Date.now()+i;this.na.push({retryAt:s,requestOptions:e});var r="Enqueued failed request for retry in "+i;navigator.onLine||(r+=" (Browser is offline)"),Ii.warn(r),this.va||(this.va=!0,this.ya())}ya(){if(this.ba&&clearTimeout(this.ba),0===this.na.length)return this.va=!1,void(this.ba=void 0);this.ba=setTimeout(()=>{this.fa&&this.na.length>0&&this.ga(),this.ya()},this.ca)}ga(){var e=Date.now(),t=[],i=this.na.filter(i=>e>i.retryAt||(t.push(i),!1));if(this.na=t,i.length>0)for(var s of i)this.retriableRequest(s.requestOptions)}unload(){for(var e of(this.ba&&(clearTimeout(this.ba),this.ba=void 0),this.va=!1,Z(s)||(this.pa&&(s.removeEventListener("online",this.pa),this.pa=void 0),this.ma&&(s.removeEventListener("offline",this.ma),this.ma=void 0)),this.na)){var t=e.requestOptions;try{this._instance._send_request(y({},t,{transport:"sendBeacon"}))}catch(s){Ii.error(s)}}this.na=[]}}class Ia{constructor(e){this._a=()=>{var e,t,i,s;this.wa||(this.wa={});var r=this.scrollElement(),n=this.scrollY(),o=r?Math.max(0,r.scrollHeight-r.clientHeight):0,a=n+((null==r?void 0:r.clientHeight)||0),l=(null==r?void 0:r.scrollHeight)||0;this.wa.lastScrollY=Math.ceil(n),this.wa.maxScrollY=Math.max(n,null!==(e=this.wa.maxScrollY)&&void 0!==e?e:0),this.wa.maxScrollHeight=Math.max(o,null!==(t=this.wa.maxScrollHeight)&&void 0!==t?t:0),this.wa.lastContentY=a,this.wa.maxContentY=Math.max(a,null!==(i=this.wa.maxContentY)&&void 0!==i?i:0),this.wa.maxContentHeight=Math.max(l,null!==(s=this.wa.maxContentHeight)&&void 0!==s?s:0)},this._instance=e}get ka(){return this._instance.config.scroll_root_selector}getContext(){return this.wa}resetContext(){var e=this.wa;return setTimeout(this._a,0),e}startMeasuringScrollPosition(){rr(s,"scroll",this._a,{capture:!0}),rr(s,"scrollend",this._a,{capture:!0}),rr(s,"resize",this._a)}scrollElement(){if(!this.ka)return null==s?void 0:s.document.documentElement;var e=K(this.ka)?this.ka:[this.ka];for(var t of e){var i=null==s?void 0:s.document.querySelector(t);if(i)return i}}Sa(e){var t="y"===e?"scrollTop":"scrollLeft";if(this.ka){var i=this.scrollElement();return i&&i[t]||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.Sa("y")}scrollX(){return this.Sa("x")}}var Fa=e=>Jn(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
vendor: 4,438 bytes, line 1
1);class $a{constructor(e,t,i,s){this.ot=e=>{var t=this.xa();if(!t||t.sessionId!==e){var i={sessionId:e,props:this.Ca(this._instance)};this.Ta.register({[Ps]:i})}},this._instance=e,this.Ma=t,this.Ta=i,this.Ca=s||Fa,this.Ma.onSessionId(this.ot)}xa(){return this.Ta.props[Ps]}getSetOnceProps(){var e,t=null==(e=this.xa())?void 0:e.props;return t?"r"in t?Qn(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 Xs(tr(this.getSetOnceProps()),(t,i)=>{"$current_url"===i&&(i="url"),e["$session_entry_"+U(i)]=t}),e}}class Ca{on(e,t){return this.Ea[e]||(this.Ea[e]=[]),this.Ea[e].push(t),()=>{this.Ea[e]=this.Ea[e].filter(e=>e!==t)}}emit(e,t){for(var i of this.Ea[e]||[])i(t);for(var s of this.Ea["*"]||[])s(e,t)}constructor(){this.Ea={}}}var Ta=Fi("[SessionId]"),Da=864e5;class Ma{on(e,t){return this.Ia.on(e,t)}constructor(e,t,i){var s;if(this.Ra=null,this.Pa=null,this.Aa=[],this.Fa=void 0,this.Oa=!1,this.Ia=new Ca,this.La=(e,t)=>!(!ne(e)||!ne(t))&&Math.abs(e-t)>this.sessionTimeoutMs,!e.persistence)throw new Error("SessionIdManager requires a PostHogPersistence instance");if(e.config.cookieless_mode===js)throw new Error('SessionIdManager cannot be used with cookieless_mode="always"');this.Di=e.config,this.Ta=e.persistence,this.st=void 0,this._e=void 0,this._sessionStartTimestamp=null,this.$a=void 0,this._sessionActivityTimestamp=null,this.Da=t||dr,this.Na=i||dr;var r=this.Di.persistence_name||this.Di.token;if(this._sessionTimeoutMs=1e3*_e(this.Di.session_idle_timeout_seconds||1800,60,36e3,Ta.createLogger("session_idle_timeout_seconds"),1800),e.register({$configured_session_timeout_ms:this._sessionTimeoutMs}),this.qa(),this.ja="ph_"+r+"_window_id",this.Ba="ph_"+r+"_primary_window_exists",this.Ha()){var n=Dr.Br(this.ja),o=Dr.Br(this.Ba);n&&!o?this.st=n:Dr.qr(this.ja),Dr.Dr(this.Ba,!0)}null!=(s=this.Di.bootstrap)&&s.sessionID&&this.setBootstrapSessionId(this.Di.bootstrap.sessionID),this.Ua()}get sessionTimeoutMs(){return this._sessionTimeoutMs}onSessionId(e){return Z(this.Aa)&&(this.Aa=[]),this.Aa.push(e),this._e&&e(this._e,this.st),()=>{this.Aa=this.Aa.filter(t=>t!==e)}}Ha(){return"memory"!==this.Di.persistence&&!this.Ta.xs&&Dr.Nr()}za(e){e!==this.st&&(this.st=e,this.Ha()&&Dr.Dr(this.ja,e))}Wa(){return this.st?this.st:this.Ha()?Dr.Br(this.ja):null}Va(e){var t=this.Ra;return!ie(t)&&!ie(e)&&5e3>Math.abs(e-t)}Ga(e,t,i){var s=t!==this._sessionActivityTimestamp,r=!(e!==this._e||i!==this._sessionStartTimestamp);this._sessionStartTimestamp=i,this._sessionActivityTimestamp=t,this._e=e,r&&!s||r&&this.Va(t)||(this.Ra=t,this.Ta.register({[ts]:[t,e,i]}))}Za(){var e,t=null==(e=this.Di)?void 0:e.persistence_save_debounce_ms;return ne(t)&&t>0}Qa(){this.Za()?this.Ta.refreshKey(ts):(this.Ta.flush(),this.Ta.load())}Ja(){var e;if(!ie(this._sessionActivityTimestamp)&&this._sessionActivityTimestamp!==this.Ra){this.Qa();var t=this.Ka();t[1]===this._e&&t[2]===this._sessionStartTimestamp&&(this.Ra=this._sessionActivityTimestamp,this.Ta.register({[ts]:[this._sessionActivityTimestamp,null!==(e=this._e)&&void 0!==e?e:null,this._sessionStartTimestamp]}),this.Ta.flush())}}Ya(){var e=this.Ka()[0],t=ne(e)?e:0,i=ne(this._sessionActivityTimestamp)?this._sessionActivityTimestamp:0;return Math.max(t,i)}Xa(e){return this.Qa(),this.La(e,this.Ya())}Ka(){var e=this.Ta.props[ts];return K(e)&&2===e.length&&e.push(e[0]),e||[0,null,0]}resetSessionId(){this.Ra=null,this.$a=void 0,clearTimeout(this.eo),this.eo=void 0,this.Ga(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 new Error("Not a valid UUID");if("7"!==t[12])throw new Error("Not a UUIDv7");return parseInt(t.substring(0,12),16)})(e);return i>t+6e4?void Ta.error("Bootstrap sessionID cannot be in the future"):i}catch(e){return void Ta.error("Invalid sessionID in bootstrap",e)}}(e);return!Z(i)&&(t?this.$a={sessionId:e,sessionStartTimestamp:i}:this.Ga(e,(new Date).getTime(),i),!0)}destroy(){this.Oa=!0,this.Ja(),clearTimeout(this.eo),this.eo=void 0,this.Fa&&s&&(s.removeEventListener(Us,this.Fa,{capture:!1}),this.Fa=void 0),this.Aa=[]}Ua(){this.Fa=()=>{this.Ja(),this.Ha()&&Dr.qr(this.Ba)},rr(s,Us,this.Fa,{capture:!1})}
1checkAndGetSessionAndWindowId(e,t,i){if(void 0===e&&(e=!1),void 0===t&&(t=null),void 0===i&&(i=!1),this.Di.cookieless_mode===js)throw new Error('checkAndGetSessionAndWindowId should not be called with cookieless_mode="always"');var s=t||(new Date).getTime(),r=this._e;if(i)this.Pa=s;else if(ie(this.Pa)||this.Pa>s||s-this.Pa>=1e3){var n,o;null==(n=(o=this.Ta).syncCookieProperties)||n.call(o),this.Pa=s}var a=this.Ka(),l=a[1],u=a[2],h=!Z(r)&&l!==r,c=this.Ya(),d=this.Wa(),v=this.$a,p=!!v&&(v.sessionStartTimestamp>s+6e4||s-v.sessionStartTimestamp>Da),g=v?p:ne(u)&&Math.abs(s-u)>Da,f=!1,_=h,m=!l||!!v,y=l,b=!m&&!e&&this.La(s,c);if(b){(b=this.Xa(s))||Ta.info("cross-tab refresh kept the session alive",{sessionId:l});var w=this.Ka();l=w[1],u=w[2]}if(m||b||g){_=!1;var x=v&&!p;l=x?v.sessionId:this.Da(),d=this.Na(),Ta.info("new session ID assigned",{sessionId:l,windowId:d,bootstrapped:!!x,changeReason:{noSessionId:m,activityTimeout:b,sessionPastMaximumLength:g}}),u=x?v.sessionStartTimestamp:s,this.$a=void 0,f=!0}else d||(d=this.Na(),f=!0),(_=_||l!==y)&&(Ta.info("adopted cross-tab session id",{sessionId:l,windowId:d}),f=!0);var k=ne(c)&&e&&!g?c:s,E=ne(u)?u:(new Date).getTime();this.za(d),this.Ga(l,k,E),e||this.qa();var S={noSessionId:m,activityTimeout:b,sessionPastMaximumLength:g,crossTabAdoption:_};return f&&this.Aa.forEach(e=>e(l,d,S)),{sessionId:l,windowId:d,sessionStartTimestamp:E,changeReason:f?S:void 0,lastActivityTimestamp:c}}qa(){this.Oa||(clearTimeout(this.eo),this.eo=setTimeout(()=>{if(!this.Oa)if(this.Xa((new Date).getTime())){var e=this._e;this.resetSessionId(),this.Ia.emit("forcedIdleReset",{idleSessionId:e})}else this.qa()},1.1*this.sessionTimeoutMs))}}var Ra=function(e,t){if(!e)return!1;var i=e.userAgent;if(i&&B(i,t))return!0;try{var s=null==e?void 0:e.userAgentData;if(null!=s&&s.brands&&s.brands.some(e=>B(null==e?void 0:e.brand,t)))return!0}catch(e){}return!!e.webdriver};function Oa(){return(Oa=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 ee(i)&&i.length>0?i:void 0}catch(e){return void Ii.info("Unable to resolve $device_model from userAgentData.getHighEntropyValues",e)}})).apply(this,arguments)}var Aa=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 La(e,t,i){return Mn({distinct_id:e,userPropertiesToSet:t,userPropertiesToSetOnce:i})}var Na={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=>Aa(t,e))),not_regex:(e,t)=>t.every(t=>e.every(e=>!Aa(t,e))),icontains:(e,t)=>t.map(ja).some(t=>e.map(ja).some(e=>t.includes(e))),not_icontains:(e,t)=>t.map(ja).every(t=>e.map(ja).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))})},ja=e=>e.toLowerCase();function qa(e,t){return!e||Object.entries(e).every(e=>{var i=e[1],s=null==t?void 0:t[e[0]];if(Z(s)||ie(s))return!1;var r=[String(s)],n=Na[i.operator];return!!n&&n(i.values,r)})}var Ba="custom",Ha="i.posthog.com",za=/^\/static\//,Ua=["/s/","/e/","/i/"];class Va{constructor(e){this.io={},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("."+Ha,".posthog.com")),"https://app.posthog.com"===t?"https://us.posthog.com":t}get region(){return this.io[this.apiHost]||(this.io[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":Ba),this.io[this.apiHost]}ro(e){if(za.test(e)){var t=this.instance.config.asset_host;if("string"==typeof t)return t.trim().replace(/\/$/,"")||void 0}}no(e){var t=Rn(e);return t?t.protocol+"//"+t.host+t.pathname:void 0}so(e,t,i){if("ui"===e)return i;var s=i,r=this.instance.config.rewriteRequestPath;if(r){var n,o=(null==(n=Rn(i))?void 0:n.href)||i;s=r(new URL(o)).toString()}if(r&&"api"===e&&Ua.some(e=>0===t.indexOf(e))){var a=this.no(s);if(a){var l,u=this.apiHost,h=this.ao;(null==(l=h)?void 0:l.apiHost)===u&&h.rewriteRequestPath===r||(h={apiHost:u,rewriteRequestPath:r,urls:new Set},this.ao=h),h.urls.add(a)}}return s}isIngestionEndpoint(e){var t=this.ao,i=this.no(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.so(e,t,this.uiHost+t);if("flags"===e)return this.so(e,t,this.flagsApiHost+t);if("assets"===e){var i=this.ro(t);if(i)return this.so(e,t,""+i+t)}if(this.region===Ba)return this.so(e,t,this.apiHost+t);var s=Ha+t;switch(e){case"assets":return this.so(e,t,"https://"+this.region+"-assets."+s);case"api":return this.so(e,t,"https://"+this.region+"."+s)}}}function Wa(e){var t;return!(null==(t=e.conditions)||null==(t=t.events)||null==(t=t.values)||!t.length)}var Ga=Fi("[Surveys]"),Ya="seenSurvey_",Ka=e=>{try{var t=(e=>((e,t)=>""+Ya+function(e){return e.current_iteration&&e.current_iteration>0?e.id+"_"+e.current_iteration:e.id}(t))(0,e))(e);if(localStorage.getItem(t))return;localStorage.setItem(t,"true")}catch(e){Ga.error("Failed to persist survey seen state",e)}},Xa=[vo,go,po],Ja={ignoreConditions:!1,ignoreDelay:!1,displayType:xo}
1,Qa=Fi("[PostHog ExternalIntegrations]"),Za={intercom:"intercom-integration",crispChat:"crisp-chat-integration"};class el{constructor(e){this._instance=e}Xn(e,t){var i;null==(i=g.__PosthogExtensions__)||null==i.loadExternalDependency||i.loadExternalDependency(this._instance,e,e=>{if(e)return Qa.error("failed to load script",e);t()})}startIfEnabledOrStop(){var e=this,t=function(){var t,s,r,n=i[0],o=i[1];!o||null!=(t=g.__PosthogExtensions__)&&null!=(t=t.integrations)&&t[n]||e.Xn(Za[n],()=>{var t;null==(t=g.__PosthogExtensions__)||null==(t=t.integrations)||null==(t=t[n])||t.start(e._instance)}),!o&&null!=(s=g.__PosthogExtensions__)&&null!=(s=s.integrations)&&s[n]&&(null==(r=g.__PosthogExtensions__)||null==(r=r.integrations)||null==(r=r[n])||r.stop())};for(var i of Object.entries(null!==(s=this._instance.config.integrations)&&void 0!==s?s:{})){var s;t()}}}class tl{constructor(e,t){this.I=e,this.oo=t,this.lo=new Map,this.uo=!1}add(e){var t=this;return m(function*(){if(t.uo)throw new Error("Cannot add an extension to a disposed ExtensionRuntime");if(t.lo.has(e.name))throw new Error('Browser extension "'+e.name+'" is already registered');t.lo.set(e.name,e);try{var i=e.setup(t.oo);i&&(yield i)}catch(i){var s=t.lo.get(e.name)===e;s&&t.lo.delete(e.name),t.I.error('Failed to set up browser extension "'+e.name+'"',i),s&&t.ho(e)}})()}dispose(){if(!this.uo){this.uo=!0;var e=Array.from(this.lo.values()).reverse();for(var t of(this.lo.clear(),e))this.ho(t)}}ho(e){try{var t=null==e.dispose?void 0:e.dispose();t&&X(t.then)&&t.then(void 0,t=>{this.I.error('Failed to dispose browser extension "'+e.name+'"',t)})}catch(t){this.I.error('Failed to dispose browser extension "'+e.name+'"',t)}}}class il{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);Z(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 sl="extensionsRemoteConfig";class rl{constructor(e){this.uo=!1,this.instance=e,this.I=Ii,this.do=e.vo,this.kv=new il(e),this.onEvent=e=>ao(this.instance.on("eventCaptured",t=>{try{e({event:t.event,properties:t.properties})}catch(e){this.I.error("Browser extension event listener failed",e)}})),this.onRemoteConfig=e=>{if(this.uo)return ao(()=>{});var t=t=>{try{e(t)}catch(e){this.I.error("Browser extension remote config listener failed",e)}},i=this.instance.co.on(sl,t);return this.do&&t(this.do),ao(i)},this.fo=new tl(Ii.createLogger("[BrowserExtensions]"),this)}get logger(){return this.I}get distinctId(){return this.instance.get_distinct_id()}get anonymousId(){var e;return null!==(e=this.instance.get_property(Ai))&&void 0!==e?e:this.distinctId}get deviceId(){var e=this.instance.get_property(Ai);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.fo.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 ao(this.instance.po(e))}handleRemoteConfig(e){this.uo||(this.do=e,this.instance.co.emit(sl,e))}sendRequest(e,t){var i=this;return m(function*(){var s;void 0===t&&(t={});var r=i.instance.requestRouter.endpointFor(null!==(s=t.target)&&void 0!==s?s:"api",e),n={method:t.method,url:t.query?da(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.uo||(this.uo=!0,this.fo.dispose())}}var nl={},ol=0,al=()=>{}
1,ll='Consent opt in/out is not valid with cookieless_mode="always" and will be ignored',ul="Surveys module not available",hl="sanitize_properties is deprecated. Use before_send instead",cl="Invalid value for property_denylist config: ",dl=["token","distinct_id",Ms],vl="posthog",pl=!la&&-1===(null==d?void 0:d.indexOf("MSIE"))&&-1===(null==d?void 0:d.indexOf("Mozilla")),gl=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:sr(null==o?void 0:o.location),persistence:"localStorage+cookie",persistence_name:"",cookie_persisted_properties:[],loaded:al,save_campaign_params:!0,custom_campaign_params:[],custom_blocked_useragents:[],save_referrer:!0,capture_pageleave:"if_capture_pageview",defaults:null!=e?e:"unset",__preview_deferred_init_extensions:!1,__preview_external_dependency_versioned_paths:!1,__preview_cookie_wins_on_conflict:!1,debug:a&&ee(null==a?void 0:a.search)&&-1!==a.search.indexOf("__posthog_debug=true")||!1,cookie_expiration:365,upgrade:!1,disable_session_recording:!1,disable_persistence:!1,disable_web_experiments:!0,disable_surveys:!1,disable_surveys_automatic_display:!1,disable_conversations:!1,disable_product_tours:!1,disableDeviceModel:!1,disable_external_dependency_loading:!1,strict_script_versioning:"fallback",enable_recording_console_log:void 0,secure_cookie:"https:"===(null==s||null==(t=s.location)?void 0:t.protocol),ip:!1,opt_out_capturing_by_default:!1,opt_out_persistence_by_default:!1,opt_out_useragent_filter:!1,opt_out_capturing_persistence_type:"localStorage",consent_persistence_name:null,opt_out_capturing_cookie_prefix:null,opt_in_site_apps:!1,property_denylist:[],respect_dnt:!1,sanitize_properties:null,request_headers:{},request_batching:!0,properties_string_max_length:65535,mask_all_element_attributes:!1,mask_all_text:!1,mask_personal_data_properties:!1,custom_personal_data_properties:[],advanced_disable_flags:!1,advanced_disable_decide:!1,advanced_disable_feature_flags:!1,advanced_disable_feature_flags_on_first_load:!1,advanced_only_evaluate_survey_feature_flags:!1,advanced_feature_flags_dedup_per_session:!1,advanced_enable_surveys:!1,advanced_disable_toolbar_metrics:!1,feature_flag_request_timeout_ms:3e3,surveys_request_timeout_ms:1e4,on_request_error(e){Ii.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:Hs,before_send:void 0,get_current_url:void 0,request_queue_config:{flush_interval_ms:ka},error_tracking:{},_onCapture:al},(e=>({rageclick:e&&e>="2026-05-30"?{content_ignorelist:Qr,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),cookieWinsOnConflict:!(!e||"unset"===e||"2026-08-29">e)}))(e))},fl=[["process_person","person_profiles"],["xhr_headers","request_headers"],["cookie_name","persistence_name"],["disable_cookie","disable_persistence"],["__preview_disable_beacon","disable_beacon"],["store_google","save_campaign_params"],["verbose","debug"],["__preview_cookie_wins_on_conflict","cookieWinsOnConflict"]],_l=e=>{var t={};for(var i of fl){var s=i[0],r=i[1];Z(e[s])||(t[r]=e[s])}var n=Js({},t,e),o=e.__preview_external_dependency_versioned_paths;return Z(o)||(Z(e.strict_script_versioning)&&(n.strict_script_versioning=!!o),ee(o)&&Z(e.asset_host)&&(n.asset_host=o)),K(e.property_blacklist)&&(Z(e.property_denylist)?n.property_denylist=e.property_blacklist:K(e.property_denylist)?n.property_denylist=[...e.property_blacklist,...e.property_denylist]:Ii.error(cl+e.property_denylist)),n};class ml{constructor(){this.__forceAllowLocalhost=!1}get mo(){return this.__forceAllowLocalhost}set mo(e){Ii.error("WebPerformanceObserver is deprecated and has no impact on network capture. Use `_forceAllowLocalhostNetworkCapture` on `posthog.sessionRecording`"),this.__forceAllowLocalhost=e}}class yl{yo(e,t){if(e){var i=this.lo.indexOf(e);-1!==i&&this.lo.splice(i,1)}return this.lo.push(t),null==t.initialize||t.initialize(),t}bo(){return this.config.cookieless_mode===js||this.config.cookieless_mode===Ns&&this.consent.isRejected()}_o(){if(!this.bo()&&this.get_distinct_id()===Ds){var e=this.persistence;if(e){this.wo()||e.load(!0);var t=this.get_distinct_id();if(!t||t===Ds){var i=this.config.get_device_id(dr());this.register({distinct_id:i,$device_id:i}),e.set_property(Ss,qs)}this.ko()}}}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(){var e;this.webPerformance=new ml,this.So=!1,this.version=f.LIB_VERSION,this.xo=new Set,this.Co="",this.co=new Ca,this.lo=[],this.To=[],this._calculate_event_properties=this.calculateEventProperties.bind(this),this.config=gl(),this.SentryIntegration=In,this.sentryIntegration=e=>function(e,t){var i=Pn(e,t);return{name:Sn,processEvent:e=>i(e)}}(this,e),this.__request_queue=[],this.__loaded=!1,this.analyticsDefaultEndpoint="/e/",this.Mo=!1,this.Eo=null,this.Io=null,this.Ro=null,this.scrollManager=new Ia(this),this.pageViewManager=new Fn(this),this.rateLimiter=new Fo(this),this.requestRouter=new Va(this),this.consent=new Mr(this),this.externalIntegrations=new el(this);var t=null!==(e=yl.__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=ee(e)?{[e]:t}:e;this.setPersonProperties(s),null==i||i({})},set_once:(e,t,i)=>{var s=ee(e)?{[e]:t}:e;this.setPersonProperties(void 0,s),null==i||i({})}},this.on("eventCaptured",e=>Ii.info('send "'+(null==e?void 0:e.event)+'"',e))}init(e,t,i){if(i&&i!==vl){var s,r=null!==(s=nl[i])&&void 0!==s?s:new yl;return r._init(e,t,i),nl[i]=r,nl[vl][i]=r,r}return this._init(e,t,i)}_init(e,t,i){var r,n;void 0===t&&(t={});var o,a=ee(e)?e.trim():"";if(!a)return Ii.critical("PostHog was initialized without a token. This likely indicates a misconfiguration. Please check the first argument passed to posthog.init()"),this;if(this.__loaded)return a!==(null==(o=this.config)?void 0:o.token)?console.warn("[PostHog.js]","You have already initialized PostHog with a different project token! Re-initializing is a no-op, so events will keep going to the project this instance was initialized with. To capture into a second project, load PostHog once, then initialize a named instance after the SDK has loaded, e.g. posthog.init('"+a+"', { ... }, 'project2')"):console.warn("[PostHog.js]","You have already initialized PostHog! Re-initializing is a no-op"),this;this.__loaded=!0,this.config=gl(t.defaults),t.debug=this.Po(t.debug),this.Ao=t,this.Fo=[],t.person_profiles?this.Io=t.person_profiles:t.process_person&&(this.Io=t.process_person);var l=gl(t.defaults),u=_l(t),h=Js({},l,u,{name:i,token:a});J(l.rageclick)&&J(u.rageclick)&&(h.rageclick=Js({},l.rageclick,u.rageclick)),J(l.session_recording)&&J(u.session_recording)&&(h.session_recording=Js({},l.session_recording,u.session_recording)),this.set_config(h),this.config.on_xhr_error&&Ii.error("on_xhr_error is deprecated. Use on_request_error instead"),this.compression=t.disable_compression?void 0:lo;var c=this.wo();if(this.persistence=new oo(this.config,c),this.sessionPersistence="sessionStorage"===this.config.persistence||"memory"===this.config.persistence?this.persistence:new oo(y({},this.config,{persistence:"sessionStorage"}),c,!1),this.Co="ph_"+(this.config.persistence_name||this.config.token)+"_session_registered_properties","memory"!==this.config.persistence&&!c&&Dr.Nr()){var d=Dr.Br(this.Co);
1K(d)&&d.forEach(e=>{ee(e)&&this.xo.add(e)})}else Dr.qr(this.Co);var v=y({},this.persistence.props),p=y({},this.sessionPersistence.props);this.register({$initialization_time:(new Date).toISOString()}),this.Oo=new Ea(e=>this.Lo(e),this.config.request_queue_config),this.$o=new Pa(this),this.__request_queue=[];var g=this.bo();if(g||(this.sessionManager=new Ma(this),this.sessionPropsManager=new $a(this,this.sessionManager,this.persistence),this.sessionManager.onSessionId((e,t,i)=>{(null!=i&&i.activityTimeout||null!=i&&i.sessionPastMaximumLength||null!=i&&i.crossTabAdoption)&&this.Do()})),this.No(),this.config.__preview_deferred_init_extensions?(Ii.info("Deferring extension initialization to improve startup performance"),setTimeout(()=>{this.qo(g)},0)):(Ii.info("Initializing extensions synchronously"),this.qo(g)),f.DEBUG=f.DEBUG||this.config.debug,f.DEBUG&&Ii.info("Starting in debug mode",{this:this,config:t,thisC:y({},this.config),p:v,s:p}),!this.config.identity_distinct_id||null!=(r=t.bootstrap)&&r.distinctID||(t.bootstrap=y({},t.bootstrap,{distinctID:this.config.identity_distinct_id,isIdentifiedID:!0})),void 0!==(null==(n=t.bootstrap)?void 0:n.distinctID)){var _=t.bootstrap.distinctID,m=this.get_distinct_id(),b=this.persistence.get_property(Ss);if(t.bootstrap.isIdentifiedID&&null!=m&&m!==_&&b===qs)this.identify(_);else if(t.bootstrap.isIdentifiedID&&null!=m&&m!==_&&b===Bs)Ii.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(dr()),x=t.bootstrap.isIdentifiedID?w:_;this.persistence.set_property(Ss,t.bootstrap.isIdentifiedID?Bs:qs),this.register({distinct_id:_,$device_id:x})}}if(g)this.register_once({distinct_id:Ds,$device_id:null},"");else if(!this.get_distinct_id()){var k=this.config.get_device_id(dr());this.register_once({distinct_id:k,$device_id:k},""),this.persistence.set_property(Ss,qs)}return rr(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()||dr();e.config.get_device_id=s,i.id()&&(e.register({distinct_id:i.id(),$device_id:s()}),e.persistence.set_property(Ss,Bs)),t()},r=i.user();"then"in r&&X(r.then)?r.then(s):s(r)}(e,()=>{i.register((e=>{"undefined"!=typeof Promise&&Promise.resolve||En.warn("This browser does not have Promise support, and can not use the segment integration");var t=(t,i)=>{if(!i)return t;t.event.userId||t.event.anonymousId===e.get_distinct_id()||(En.info("No userId set, resetting PostHog"),e.reset()),t.event.userId&&t.event.userId!==e.get_distinct_id()&&(En.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};return{name:"PostHog JS",type:"enrichment",version:"1.0.0",isLoaded:()=>!0,load:()=>Promise.resolve(),track:e=>t(e,e.event.event),page:e=>t(e,Vs),identify:e=>t(e,Gs),screen:e=>t(e,"$screen")}})(e)).then(()=>{t()})})}(this,()=>this.jo()):this.jo(),X(this.config._onCapture)&&this.config._onCapture!==al&&(Ii.warn("onCapture is deprecated. Please use `before_send` instead"),this.on("eventCaptured",e=>this.config._onCapture(e.event,e))),this.config.ip&&Ii.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 Oa.apply(this,arguments)}().then(e=>{e&&this.register({[Li]:e})}).catch(al),this}No(){var e,t,i,s,r,n,o=null!==(e=null==(t=this.config.__extensionClasses)?void 0:t.featureFlags)&&void 0!==e?e:null==(i=yl.__defaultExtensionClasses)?void 0:i.featureFlags;o&&(this.featureFlags&&this.featureFlags instanceof o||(null==(s=this.Bo)||s.call(this),this.Bo=void 0,this.featureFlags=new o(this)),X(this.featureFlags.onReloading)&&X(this.featureFlags.setup)?this.Bo||(this.Bo=this.featureFlags.onReloading(()=>{this.co.emit("featureFlagsReloading",!0)}),this.Ho().add(this.featureFlags)):null==(r=(n=this.featureFlags).initialize)||r.call(n))}qo(e){var t,i,s,r,n,o,a,l=performance.now(),u=y({},yl.__defaultExtensionClasses,this.config.__extensionClasses),h=[];u.exceptions&&this.lo.push(this.exceptions=null!==(t=this.exceptions)&&void 0!==t?t:new u.exceptions(this)),u.historyAutocapture&&this.lo.push(this.historyAutocapture=new u.historyAutocapture(this)),u.tracingHeaders&&this.lo.push(this.tracingHeaders=new u.tracingHeaders(this)),u.siteApps&&this.lo.push(this.siteApps=new u.
1siteApps(this)),u.sessionRecording&&!e&&this.lo.push(this.sessionRecording=new u.sessionRecording(this)),this.config.disable_scroll_properties||h.push(()=>{this.scrollManager.startMeasuringScrollPosition()}),u.autocapture&&this.lo.push(this.autocapture=new u.autocapture(this)),u.surveys&&this.lo.push(this.surveys=null!==(i=this.surveys)&&void 0!==i?i:new u.surveys(this)),u.logs&&this.lo.push(this.logs=null!==(s=this.logs)&&void 0!==s?s:new u.logs(this)),u.metrics&&this.lo.push(this.metrics=null!==(r=this.metrics)&&void 0!==r?r:new u.metrics(this)),u.conversations&&this.lo.push(this.conversations=null!==(n=this.conversations)&&void 0!==n?n:new u.conversations(this)),u.productTours&&this.lo.push(this.productTours=new u.productTours(this)),u.heatmaps&&this.lo.push(this.heatmaps=new u.heatmaps(this)),u.webVitalsAutocapture&&this.lo.push(this.webVitalsAutocapture=new u.webVitalsAutocapture(this)),u.exceptionObserver&&this.lo.push(this.exceptionObserver=new u.exceptionObserver(this)),u.deadClicksAutocapture&&this.lo.push(this.deadClicksAutocapture=new u.deadClicksAutocapture(this,xn)),u.toolbar&&this.lo.push(this.toolbar=null!==(o=this.toolbar)&&void 0!==o?o:new u.toolbar(this)),u.experiments&&this.lo.push(this.experiments=null!==(a=this.experiments)&&void 0!==a?a:new u.experiments(this)),this.lo.forEach(e=>{e.initialize&&h.push(()=>{null==e.initialize||e.initialize()})}),h.push(()=>{if(this.Uo){var e=this.Uo;this.Uo=void 0,this.lo.forEach(t=>null==t.onRemoteConfig?void 0:t.onRemoteConfig(e))}}),this.zo(h,l)}zo(e,t){for(;e.length>0;){if(this.config.__preview_deferred_init_extensions&&performance.now()-t>=30&&e.length>0)return void setTimeout(()=>{this.zo(e,t)},0);var i=e.shift();if(i)try{i()}catch(e){Ii.error("Error initializing extension:",e)}}var s=Math.round(performance.now()-t);this.register_for_session({[Rs]:this.config.__preview_deferred_init_extensions?"deferred":"synchronous",[Os]:s}),this.config.__preview_deferred_init_extensions&&Ii.info("PostHog extensions initialized ("+s+"ms)")}Ks(e){var t;if(!o||!o.body)return Ii.info("document not ready yet, trying again in 500 milliseconds..."),void setTimeout(()=>{this.Ks(e)},500);if(this.config.__preview_deferred_init_extensions&&(this.Uo=e),this.vo=e,this.compression=void 0,e.ok){var i,s=e.config;s.supportedCompression&&!this.config.disable_compression&&(this.compression=H(s.supportedCompression,lo)?lo:H(s.supportedCompression,uo)?uo:void 0),null!=(i=s.analytics)&&i.endpoint&&(this.analyticsDefaultEndpoint=s.analytics.endpoint)}this.set_config({person_profiles:this.Io?this.Io:Hs}),null==(t=this.Wo)||t.handleRemoteConfig(e),this.lo.forEach(t=>null==t.onRemoteConfig?void 0:t.onRemoteConfig(e))}jo(){try{this.config.loaded(this)}catch(e){Ii.critical("`loaded` function failed",e)}if(this.Vo(),this.config.internal_or_test_user_hostname&&null!=a&&a.hostname){var e=a.hostname,t=this.config.internal_or_test_user_hostname;("string"==typeof t?e===t:t.test(e))&&this.setInternalOrTestUser()}this.config.capture_pageview&&setTimeout(()=>{(this.consent.isOptedIn()||this.bo())&&this.Go()},1),this.Zo=new Co(this),this.Zo.load()}Vo(){var e;this.is_capturing()&&this.config.request_batching&&(null==(e=this.Oo)||e.enable())}_dom_loaded(){this.is_capturing()&&Ks(this.__request_queue,e=>this.Lo(e)),this.__request_queue=[],this.Vo()}_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.Qo()&&this.capture(Ws),null==(i=this.logs)||i.flushLogs("sendBeacon"),null==(s=this.Oo)||s.unload(),null==(r=this.$o)||r.unload()):this.Qo()&&this.capture(Ws,null,{transport:"sendBeacon"})}_send_request(e){this.__loaded?pl?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,(Z(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=y({},e);r.timeout=r.timeout||6e4;var n,o,a,l,u,h=null!==(t=r.transport)&&void 0!==t?t:"fetch";"sendBeacon"===h&&Z(r.compression)&&r.data&&(r.compression=uo),"POST"===r.method&&r.data&&("capture-body"===r.timestampMode?r.data={api_key:null!==(o=null==(u=(l=(K(n=r.data)?n:[n]).map(e=>y({},e,e.timestamp instanceof Date&&!isNaN(e.timestamp.getTime())?{timestamp:e.timestamp.toISOString()}:{})))[0])||null==(a=u.properties)?void 0:a.token)&&void 0!==o?o:null==u?void 0:u.token,batch:l,sent_at:(new Date).toISOString()}:"body"===r.timestampMode&&(r.data=function(e,t){return void 0===t&&(t=(new Date).toISOString()),K(e)?e.map(e=>y({},e,{sent_at:t})):y({},e,{sent_at:t})}(r.data))),r.url=wa(r.url,r.method,r.compression,r.timestampMode);var d=xa.filter(e=>!r.disableTransport||!e.transport||!r.disableTransport.includes(e.transport)),v=null!==(i=null==(s=function(e){for(var t=0;e.length>t;t++)if(e[t].transport===h)return e[t]}(d))?void 0:s.method)&&void 0!==i?i:d[0].method;if(!v)throw new Error("No available transport method");var p=e=>{try{v(e)}catch(e){ma(e)?Ii.warn(e):Ii.error(e),null==r.callback||r.callback({statusCode:0,error:e})}};"sendBeacon"!==h&&r.data&&r.compression===lo&&c&&"undefined"!=typeof Promise&&!ha?fa(r).then(e=>{p(e)}).catch(t=>{if(M(t))return ha=!0,void p(y({},r,{compression:void 0,url:wa(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 M(e)||t===C})(t)&&(ha=!0),p(r)}):v(r)})(y({},e,{callback:t=>{var i,s;this.rateLimiter.checkForLimiting(t),400>t.statusCode||null==(i=(s=this.config).on_request_error)||i.call(s,t),null==e.callback||e.callback(t)}}))):e.fireCallbackOnDrop&&(null==e.callback||e.callback({statusCode:0}))}Lo(e){this.$o?this.$o.retriableRequest(e):this._send_request(e)}_execute_array(e){ol++;try{var t,i=[],s=[],r=[];Ks(e,e=>{if(e)if(K(t=e[0]))r.push(e);else if(X(e))try{e.call(this)}catch(t){Ii.error("Error executing queued PostHog call",e,t)}else K(e)&&"alias"===t?i.push(e):K(e)&&-1!==t.indexOf("capture")&&X(this[t])?r.push(e):s.push(e)});var n=function(e,t){Ks(e,function(e){try{if(K(e[0])){var i=t;Xs(e,function(e){i=i[e[0]].apply(i,e.slice(1))})}else t[e[0]].apply(t,e.slice(1))}catch(t){Ii.error("Error executing queued PostHog call",e,t)}})};n(i,this),n(s,this),n(r,this)}finally{ol--}}push(e){if(ol>0&&K(e)&&ee(e[0])){var t=yl.prototype[e[0]];X(t)&&t.apply(this,e.slice(1))}else this._execute_array([e])}capture(e,t,i){var s,r,n,o,a;if(this.__loaded&&this.persistence&&this.sessionPersistence&&this.Oo){if(this.is_capturing())if(!Z(e)&&ee(e)){this._o();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&&!ee(null==t?void 0:t.$current_url)&&(Ii.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.Jo||Ii.warn("Using `posthog.capture('$exception')` is unreliable because it does not attach required metadata. Use `posthog.captureException(error)` instead, which attaches required metadata automatically."),this.sessionPersistence.update_search_keyword(),this.config.save_campaign_params&&this.sessionPersistence.update_campaign_params(),this.config.save_referrer&&this.sessionPersistence.update_referrer_info(),(this.config.save_campaign_params||this.config.save_referrer)&&this.persistence.set_initial_person_info();var h=new Date,c=(null==i?void 0:i.timestamp)||h,d=Et(null==i?void 0:i.uuid,dr),v={uuid:d,event:e,properties:this.calculateEventProperties(e,t||{},c,d)};e===Vs&&this.config.__preview_capture_bot_pageviews&&l&&(v.event="$bot_pageview",v.properties.$browser_type="bot"),u&&(v.properties.$lib_rate_limit_remaining_tokens=u.remainingTokens);var p="$feature_flag_called"===e&&!1===v.properties.$feature_flag_has_experiment&&!0===this.get_property(us);(null==i?void 0:i.$set)&&!p&&(v.$set=null==i?void 0:i.$set);var g=null==i?void 0:i.$unset;g&&(v.$unset=g);var f,_,m,b=p?void 0:this.Ko(null==i?void 0:i.$set_once,e!==Ys,e===Gs);if(b&&(v.$set_once=b),null!=i&&i._noTruncate||(r=this.config.properties_string_max_length,n=v,o=e=>ee(e)?e.slice(0,r):e,a=new Set,v=function e(t,i){if(t!==Object(t))return o?o(t):t;if(!a.has(t)){var s;if(a.add(t),K(t))s=[],Ks(t,t=>{s.push(e(t))});else{var r={};Xs(t,(t,i)=>{a.has(t)||(r[i]=e(t,i))}),s=r}return s}}(n)),v.timestamp=c,Z(null==i?void 0:i.timestamp)||(v.properties.$event_time_override_provided=!0,v.properties.$event_time_override_system_time=h),p&&(v.properties=function(e,t){void 0===t&&(t=[]);var i={},s=t=>{void 0!==e[t]&&(i[t]=e[t])};
1return S.forEach(s),t.forEach(s),i}(v.properties,dl)),e===_o||e===mo){var w=null==t?void 0:t[yo],x=null==t?void 0:t[bo];Ka({id:w,current_iteration:x}),v.$set=y({},v.$set,{[(f={id:w,current_iteration:x},_=e===mo?"responded":"dismissed",m="$survey_"+_+"/"+f.id,f.current_iteration&&f.current_iteration>0&&(m="$survey_"+_+"/"+f.id+"/"+f.current_iteration),m)]:!0})}else e===fo&&(v.$set=y({},v.$set,{[wo]:(new Date).toISOString()}));if(e===Eo){var k=null==t?void 0:t[Po];k&&(v.$set=y({},v.$set,{[So+"/"+k]:(new Date).toISOString()}))}var E=y({},v.properties.$set,v.$set);if(Q(E)||this.setPersonPropertiesForFlags(E),!se(this.config.before_send)){var P=this._n(v);if(!P)return;(v=P).uuid=Et(v.uuid,dr)}this.co.emit("eventCaptured",v);var I=null!==(s=null==i?void 0:i._url)&&void 0!==s?s:this.requestRouter.endpointFor("api",this.analyticsDefaultEndpoint),F={method:"POST",url:I,data:v,compression:"best-available",timestampMode:"recordings"===(null==i?void 0:i._batchKey)||/\/s\/(?:\?|$)/.test(I)?"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.Lo(F):this.Oo.enqueue(F),v}Ii.critical("This capture call is ignored due to client rate limiting.")}}else Ii.error("No event name provided to posthog.capture")}else Ii.uninitializedWarning("posthog.capture")}_addCaptureHook(e){return this.on("eventCaptured",t=>e(t.event,t))}Ho(){var e;return null!==(e=this.Wo)&&void 0!==e?e:this.Wo=new rl(this)}po(e){this.To.push(e);var t=!0;return()=>{if(t){t=!1;var i=this.To.indexOf(e);-1!==i&&this.To.splice(i,1)}}}Yo(e){var t,i,s;return void 0===e&&(e=!0),!(null==(t=this.persistence)||!t.consumeCookieIdentityChange()||(this.Ro=null,this.persistence.get_property(Ss)===qs&&(null==(s=this.sessionPersistence)||s.clear(),this.xo.clear(),this.Xo()),null==(i=this.featureFlags)||i.reset(),e&&this.reloadFeatureFlags(),0))}calculateEventProperties(e,t,i,r,n){if(i=i||new Date,!this.persistence||!this.sessionPersistence)return t;this.persistence.syncCookieProperties(),this.Yo();var l=n?void 0:this.persistence.remove_event_timer(e),u=y({},t);if(u.token=this.config.token,u.$config_defaults=this.config.defaults,this.bo()&&(u[Ms]=!0),"$snapshot"===e){var h=y({},this.persistence.properties(),this.sessionPersistence.properties());return u.distinct_id=h.distinct_id,(!ee(u.distinct_id)&&!re(u.distinct_id)||te(u.distinct_id))&&Ii.error("Invalid distinct_id for replay event. This indicates a bug in your implementation"),u}var c,v=function(e,t,i,r){var n,o,l,u;if(void 0===r&&(r=!1),!d)return{};var h,c=e?[...Bn,...t||[]]:[],v=function(e){for(var t=0;wt.length>t;t++){var i=wt[t],s=i[1],r=i[0].exec(e),n=r&&(X(s)?s(r,e):s);if(n)return n}return["",""]}(d),p=v[0],g=v[1],_=null!=(h="undefined"!=typeof navigator?navigator:void 0)&&h.brave?{brave:!0}:{},m={};Z(i)||(m.detectGoogleSearchApp=i);var y={},b=null==(n=navigator)||null==(n=n.userAgentData)?void 0:n.platform,w=null==(o=navigator)?void 0:o.maxTouchPoints,x=null==s||null==(l=s.screen)?void 0:l.width,k=null==s||null==(u=s.screen)?void 0:u.height,E=null==s?void 0:s.devicePixelRatio;Z(b)||(y.userAgentDataPlatform=b),Z(w)||(y.maxTouchPoints=w),Z(x)||(y.screenWidth=x),Z(k)||(y.screenHeight=k),Z(E)||(y.devicePixelRatio=E);var S,P,I,F,$,C,T,D,M=Js(tr({$os:p,$os_version:g,$browser:mt(d,navigator.vendor,_,m),$device:xt(d),$device_type:(P=d,I=y,D=xt(P),D===Ee||D===ke||"Kobo"===D||"Kindle Fire"===D||D===et?xe:D===ze||D===Ve||D===Ue||D===Je?"Console":D===Pe?"Wearable":D?ye:"Android"===(null==I?void 0:I.userAgentDataPlatform)&&(null!==(F=null==I?void 0:I.maxTouchPoints)&&void 0!==F?F:0)>0?600>Math.min(null!==($=null==I?void 0:I.screenWidth)&&void 0!==$?$:0,null!==(C=null==I?void 0:I.screenHeight)&&void 0!==C?C:0)/(null!==(T=null==I?void 0:I.devicePixelRatio)&&void 0!==T?T:1)?ye:xe:"Desktop"),$timezone:Zn(),$timezone_offset:eo()}),{$current_url:An(r?St(null==a?void 0:a.href):null==a?void 0:a.href,c,zn),$host:null==a?void 0:a.host,$pathname:null==a?void 0:a.pathname,$raw_user_agent:d.length>1e3?d.substring(0,997)+"...":d,$browser_version:bt(d,navigator.vendor,_,m),$browser_language:Yn(),$browser_language_prefix:(S=Yn(),"string"==typeof S?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,396 bytes, line 1
1);if(this.sessionManager){var p=this.sessionManager.checkAndGetSessionAndWindowId(n,i.getTime(),!0),g=p.windowId;u.$session_id=p.sessionId,u.$window_id=g}this.sessionPropsManager&&Js(u,this.sessionPropsManager.getSessionProps());try{var _;this.sessionRecording&&Js(u,this.sessionRecording.sdkDebugProperties),u.$sdk_debug_retry_queue_size=null==(_=this.$o)?void 0:_.length}catch(s){u.$sdk_debug_error_capturing_properties=String(s)}if(this.requestRouter.region===Ba&&(u.$lib_custom_api_host=this.config.api_host),c=e!==Vs||n?e!==Ws||n?this.pageViewManager.doEvent():this.pageViewManager.doPageLeave(i):this.pageViewManager.doPageView(i,r),u=Js(u,c),e===Vs&&o&&(u.title=o.title),!Z(l)){var m=i.getTime()-l;u.$duration=parseFloat((m/1e3).toFixed(3))}d&&this.config.opt_out_useragent_filter&&(u.$browser_type=this._is_bot()?"bot":"browser");var b=this.persistence.properties(),w=this.sessionPersistence.properties();Xs(["$referrer","$referring_domain"],e=>{e in b&&delete w[e]});var x={};if(this.To.length>0)for(var k of this.To.slice())try{Js(x,k())}catch(s){Ii.error("Failed to produce browser extension event properties",s)}(u=Js({},v,b,w,y({},x,u))).$is_identified=this._isIdentified(),K(this.config.property_denylist)?Xs(this.config.property_denylist,function(e){delete u[e]}):Ii.error(cl+this.config.property_denylist+" or property_blacklist config: "+this.config.property_blacklist);var E=this.config.sanitize_properties;E&&(Ii.error(hl),u=E(u,e));var S=this.tl();return u.$process_person_profile=S,S&&!n&&this.el("_calculate_event_properties"),u}Ko(e,t,i){var s;if(void 0===t&&(t=!0),void 0===i&&(i=!1),!this.persistence||!this.tl())return e;if(this.So&&!i)return e;var r=this.persistence.get_initial_props(),n=null==(s=this.sessionPropsManager)?void 0:s.getSetOnceProps(),o=Js({},r,n||{},e||{}),a=this.config.sanitize_properties;return a&&(Ii.error(hl),o=a(o,"$set_once")),t&&(this.So=!0),Q(o)?void 0:o}register(e,t){var i;null==(i=this.persistence)||i.register(e,t)}register_once(e,t,i){var s;null==(s=this.persistence)||s.register_once(e,t,i)}register_for_session(e){var t,i;null==(t=this.persistence)||t.syncCookieProperties(),this.Yo(),null==(i=this.sessionPersistence)||i.register(e),Object.keys(e).forEach(e=>this.xo.add(e)),this.Xo()}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.xo.delete(e),this.Xo()}il(e,t){this.register({[e]:t})}Do(){this.xo.forEach(e=>{var t;null==(t=this.sessionPersistence)||t.unregister(e)}),this.xo.clear(),this.Xo()}Xo(){var e;if(this.Co)if("memory"===this.config.persistence||null!=(e=this.sessionPersistence)&&e.xs||!Dr.Nr())Dr.qr(this.Co);else{var t=[];this.xo.forEach(e=>t.push(e)),t.length>0?Dr.Dr(this.Co,t):Dr.qr(this.Co)}}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.co.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:ul}),()=>{})}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:ul})}getActiveMatchingSurveys(e,t){void 0===t&&(t=!1),this.surveys?this.surveys.getActiveMatchingSurveys(e,t):e([],{isLoaded:!1,error:ul})}renderSurvey(e,t){var i;null==(i=this.surveys)||i.renderSurvey(e,t)}displaySurvey(e,t){var i;void 0===t&&(t=Ja),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:ul}}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:ul})}rl(e){return!e||te(e)?(Ii.critical("Unique user id has not been set in posthog.identify"),!1):e===Ds?(Ii.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())||(Ii.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 Ii.uninitializedWarning("posthog.identify");if(re(e)&&(e=e.toString(),Ii.warn("The first argument to posthog.identify was a number, but it should be a string. It has been converted to a string.")),this.rl(e)&&this.el("posthog.identify")){this._o();var s=this.get_distinct_id(),r=this.persistence.syncCookieProperties()&&this.get_distinct_id()!==s,n=this.Yo(!1),o=this.persistence.Ms(),a=!1;try{var l=this.get_distinct_id();this.register({$user_id:e}),this.get_property(Ai)||this.register_once({$had_persisted_distinct_id:!0,$device_id:l},""),e!==l&&e!==this.get_property(Ni)&&(this.unregister(Ni),this.register({distinct_id:e}));var u,h=(this.persistence.get_property(Ss)||qs)===qs,c=e!==l,d=!c&&h;if(c&&h)this.persistence.set_property(Ss,Bs),this.setPersonPropertiesForFlags({$set:t||{},$set_once:i||{}},!1),this.config.cookieWinsOnConflict&&this.persistence.Es(),this.capture(Gs,{distinct_id:e,$anon_distinct_id:l},{$set:t||{},$set_once:i||{}}),this.Ro=La(e,t,i),null==(u=this.featureFlags)||u.setAnonymousDistinctId(l);else if(d){this.persistence.set_property(Ss,Bs);var v=t||{},p=i||{};this.setPersonPropertiesForFlags({$set:v,$set_once:p},!1),this.config.cookieWinsOnConflict&&this.persistence.Es(),this.capture("$set",{$set:v,$set_once:p}),this.Ro=La(e,t,i)}else(t||i)&&this.setPersonProperties(t,i);c||r||n?(this.reloadFeatureFlags(),this.featureFlags?this.featureFlags.resetFlagCallReported():this.unregister(ws)):d&&(t||i)&&this.reloadFeatureFlags(),a=!0}finally{o&&this.persistence.Ps(a)}}}setPersonProperties(e,t){if((e||t)&&this.el("posthog.setPersonProperties")){var i=La(this.get_distinct_id(),e,t);this.Ro!==i?(this.setPersonPropertiesForFlags({$set:e||{},$set_once:t||{}},!0),this.capture("$set",{$set:e||{},$set_once:t||{}}),this.Ro=i):Ii.info("A duplicate setPersonProperties call was made with the same properties. It has been ignored.")}}unsetPersonProperties(e){var t,i=(K(e)?e:[e]).filter(e=>ee(e)&&e.length>0);0!==i.length&&this.el("posthog.unsetPersonProperties")&&(null==(t=this.featureFlags)||t.unsetPersonPropertiesForFlags(i,!0),this.capture("$set",{$unset:i}),this.Ro=null)}group(e,t,i){var s;if(e&&t){null==(s=this.persistence)||s.syncCookieProperties(),this.Yo();var r=this.getGroups(),n=r[e]!==t;if(n&&this.resetGroupPropertiesForFlags(e),this.register({$groups:y({},r,{[e]:t})}),n||i){var o={$group_type:e,$group_key:t};i&&(o.$group_set=i),this.capture(Ys,o)}i&&this.setGroupPropertiesForFlags({[e]:i}),n&&!i&&this.reloadFeatureFlags()}else Ii.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.el("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=oe(e)?e:null==e?void 0:e.resetDeviceID,i=oe(e)||null==e?void 0:e.bootstrap;this.nl(t,!1,i)}nl(e,t,i){var s,r,n;if(void 0===t&&(t=!1),Ii.info("reset"),!this.__loaded)return Ii.uninitializedWarning("posthog.reset");var o=null==i?void 0:i.sessionID;this.config.bootstrap=i||(null==(s=this.Ao)?void 0:s.bootstrap)||{},null==(r=this.featureFlags)||null==r.updateConfig||r.updateConfig(this.config,this.Xs());var a=this.get_property(Ai),l=this.get_property(Li),u=this.get_property(Ki),h=this.is_capturing();this.consent.reset(),t||!h||this.is_capturing()||console.warn("[PostHog.js]","reset() cleared the stored consent, and capturing is now off because of `opt_out_capturing_by_default`. Call opt_in_capturing() again, and prefer calling reset() before opting in rather than after.");var c=null==(n=this.persistence)||null==n.Ms?void 0:n.Ms(),d=!1;try{var v,p,g,f,_,m,b,w,x,k,E,S,P,I;if(null==(v=this.persistence)||v.clear(),null==(p=this.sessionPersistence)||p.clear(),this.xo.clear(),this.Xo(),Z(u)||null==(E=this.persistence)||E.register({[Ki]:u}),null==(g=this.surveys)||g.reset(),null==(f=this.Zo)||f.stop(),null==(_=this.featureFlags)||_.reset(),null==(m
1=this.conversations)||m.reset(),null==(b=this.logs)||b.reset(),null==(w=this.metrics)||w.reset(),null==(x=this.persistence)||x.set_property(Ss,qs),null==(k=this.sessionManager)||k.resetSessionId(),this.Ro=null,this.config.cookieless_mode===js)this.register_once({distinct_id:Ds,$device_id:null},"");else{var F=this.config.get_device_id(dr());this.register_once({distinct_id:F,$device_id:e?F:a},""),e||Z(l)||this.register({[Li]:l})}if(this.register({$last_posthog_reset:(new Date).toISOString()},1),i&&(void 0===i.distinctID||this.bo()||(null==(I=this.persistence)||I.set_property(Ss,i.isIdentifiedID?Bs:qs),this.register({distinct_id:i.distinctID})),null==(S=this.featureFlags)||S.initialize(),!(Z(o)||null!=(P=this.sessionManager)&&P.setBootstrapSessionId(o,!0)))){var $=y({},i);delete $.sessionID,this.config.bootstrap=$}delete this.config.identity_distinct_id,delete this.config.identity_hash,d=!0}finally{var C;c&&(null==(C=this.persistence)||null==C.Ps||C.Ps(d))}this.reloadFeatureFlags()}shutdown(e){var t=this;return m(function*(){var e,i,s,r,n,o,a;if(t.__loaded){null==(e=t.Zo)||e.stop(),null==(i=t.Wo)||i.dispose(),null==(s=t.sessionRecording)||s.dispose(),null==(r=t.logs)||r.flushLogs("sendBeacon"),null==(n=t.metrics)||n.flush("sendBeacon"),null==(o=t.Oo)||o.unload(),null==(a=t.$o)||a.unload();try{var l;null==(l=t.featureFlags)||l.destroy()}catch(e){Ii.error("Error while destroying feature flags",e)}}else Ii.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.sl()}clearIdentity(){var e;delete this.config.identity_distinct_id,delete this.config.identity_hash,null==(e=this.conversations)||e.al()}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(Ri)?(Ii.critical("Attempting to create alias for existing People user - aborting."),-2):this.el("posthog.alias")?(Z(t)&&(t=this.get_distinct_id()),e!==t?(this.il(Ni,e),this.capture("$create_alias",{alias:e,distinct_id:t})):(Ii.warn("alias matches current distinct_id - skipping api call."),this.identify(e),-1)):void 0}set_config(e){var t=y({},this.config);if(J(e)){var i,s,r,n,o,a,l,u,h,c,d,v;Js(this.config,_l(e));var p=this.wo();null==(i=this.persistence)||i.update_config(this.config,t,p),this.sessionPersistence="sessionStorage"===this.config.persistence||"memory"===this.config.persistence?this.persistence:new oo(y({},this.config,{persistence:"sessionStorage"}),p,!1);var g=this.Po(this.config.debug);oe(g)&&(this.config.debug=g),oe(this.config.debug)&&(this.config.debug?(f.DEBUG=!0,mr.Nr()&&mr.Dr("ph_debug",!0),Ii.info("set_config",{config:e,oldConfig:t,newConfig:y({},this.config)})):(f.DEBUG=!1,mr.Nr()&&mr.qr("ph_debug"))),null==(s=this.featureFlags)||null==s.updateConfig||s.updateConfig(this.config,this.Xs()),null==(r=this.exceptionObserver)||r.onConfigChange(),null==(n=this.exceptions)||n.onConfigChange(),null==(o=this.sessionRecording)||o.startIfEnabledOrStop(),null==(a=this.tracingHeaders)||a.startIfEnabledOrStop(),null==(l=this.autocapture)||l.startIfEnabled(),null==(u=this.heatmaps)||u.startIfEnabled(),null==(h=this.exceptionObserver)||h.startIfEnabledOrStop(),null==(c=this.deadClicksAutocapture)||c.startIfEnabledOrStop(),null==(d=this.surveys)||d.loadIfEnabled(),this.ko(),null==(v=this.externalIntegrations)||v.startIfEnabledOrStop()}}_overrideSDKInfo(e,t){f.LIB_NAME=e,f.LIB_VERSION=t}startSessionRecording(e){var t,i,s,r,n,o=!0===e,a={sampling:o||!(null==e||!e.sampling),linked_flag:o||!(null==e||!e.linked_flag),url_trigger:o||!(null==e||!e.url_trigger),event_trigger:o||!(null==e||!e.event_trigger)};Object.values(a).some(Boolean)&&(null==(t=this.sessionManager)||t.checkAndGetSessionAndWindowId(),a.sampling&&(null==(i=this.sessionRecording)||i.overrideSampling()),a.linked_flag&&(null==(s=this.sessionRecording)||s.overrideLinkedFlag()),a.url_trigger&&(null==(r=this.sessionRecording)||r.overrideTrigger("url")),a.event_trigger&&(null==(n=this.sessionRecording)||n.overrideTrigger("event"))),this.set_config({disable_session_recording:!1})}stopSessionRecording(){this.set_config({disable_session_recording:!0})}sessionRecordingStarted(){var e;return!(null==(e=this.sessionRecording)||!e.started)}captureException(e,t){if(this.exceptions){var i=new 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:yl.ol}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:vl;return t!==vl&&(t=vl+"."+t),t}_isIdentified(){var e,t;return(null==(e=this.persistence)?void 0:e.get_property(Ss))===Bs||(null==(t=this.sessionPersistence)?void 0:t.get_property(Ss))===Bs}tl(){var e,t;return!("never"===this.config.person_profiles||this.config.person_profiles===Hs&&!this._isIdentified()&&Q(this.getGroups())&&(null==(e=this.persistence)||null==(e=e.props)||!e[Ni])&&(null==(t=this.persistence)||null==(t=t.props)||!t[Ts]))}Qo(){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.tl()||this.el("posthog.createPersonProfile")&&this.setPersonProperties({},{})}setInternalOrTestUser(){this.el("posthog.setInternalOrTestUser")&&this.setPersonProperties({$internal_or_test_user:!0})}el(e){return"never"===this.config.person_profiles?(Ii.error(e+' was called, but process_person is set to "never". This call will be ignored.'),!1):(this.il(Ts,!0),!0)}wo(){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!==Ns)}ko(){var e,t,i,s,r=this.wo();return(null==(e=this.persistence)?void 0:e.xs)!==r&&(null==(i=this.persistence)||i.set_disabled(r)),(null==(t=this.sessionPersistence)?void 0:t.xs)!==r&&(null==(s=this.sessionPersistence)||s.set_disabled(r)),r&&(this.xo.clear(),this.Xo()),r}opt_in_capturing(e){var t;if(this.config.cookieless_mode!==js){if(this.bo()){var i,s,r,n,o;this.nl(!0,!0),null==(i=this.sessionManager)||i.destroy(),null==(s=this.pageViewM
1anager)||s.destroy(),this.sessionManager=new Ma(this),this.pageViewManager=new Fn(this),this.persistence&&(this.sessionPropsManager=new $a(this,this.sessionManager,this.persistence));var a,l=null!==(r=null==(n=this.config.__extensionClasses)?void 0:n.sessionRecording)&&void 0!==r?r:null==(o=yl.__defaultExtensionClasses)?void 0:o.sessionRecording;l&&(this.sessionRecording=this.yo(this.sessionRecording,new l(this)),this.vo&&(null==(a=this.sessionRecording)||null==a.onRemoteConfig||a.onRemoteConfig(this.vo)))}var u,h;this.consent.optInOut(!0),this.ko(),this.Vo(),null==(t=this.sessionRecording)||t.startIfEnabledOrStop(),this.config.cookieless_mode==Ns&&(null==(u=this.surveys)||u.loadIfEnabled()),(Z(null==e?void 0:e.captureEventName)||null!=e&&e.captureEventName)&&this.capture(null!==(h=null==e?void 0:e.captureEventName)&&void 0!==h?h:"$opt_in",null==e?void 0:e.captureProperties,{send_instantly:!0}),this.config.capture_pageview&&this.Go()}else Ii.warn(ll)}opt_out_capturing(){var e,t,i;this.config.cookieless_mode!==js?(this.config.cookieless_mode===Ns&&this.consent.isOptedIn()&&this.nl(!0,!0),this.consent.optInOut(!1),this.ko(),this.config.cookieless_mode===Ns&&(this.register({distinct_id:Ds,$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.Go(),this.Vo())):Ii.warn(ll)}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===js||(this.config.cookieless_mode===Ns?this.consent.isRejected()||this.consent.isOptedIn():!this.has_opted_out_capturing())}clear_opt_in_out_capturing(){this.consent.reset(),this.ko()}_is_bot(){return n?Ra(n,this.config.custom_blocked_useragents):void 0}Go(){o&&("visible"===o.visibilityState?this.Mo||(this.Mo=!0,this.capture(Vs,{title:o.title},{send_instantly:!0}),this.Eo&&(o.removeEventListener(zs,this.Eo),this.Eo=null)):this.Eo||(this.Eo=this.Go.bind(this),rr(o,zs,this.Eo)))}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}))}Xs(){var e=this.Ao||{};return"advanced_disable_flags"in e?!!e.advanced_disable_flags:!1!==this.config.advanced_disable_flags?!!this.config.advanced_disable_flags:!0===this.config.advanced_disable_decide?(Ii.warn("Config field 'advanced_disable_decide' is deprecated. Please use 'advanced_disable_flags' instead. The old field will be removed in a future major version."),!0):function(e,t,i,s,r){var n=t in e&&!se(e[t]),o=i in e&&!se(e[i]);return n?e[t]:!!o&&(r&&r.warn("Config field '"+i+"' is deprecated. Please use '"+t+"' instead. The old field will be removed in a future major version."),e[i])}(e,"advanced_disable_flags","advanced_disable_decide",0,Ii)}_n(e){var t;if(se(this.config.before_send))return e;var i=Object.keys(null!==(t=e.properties)&&void 0!==t?t:{}).filter(le),s=K(this.config.before_send)?this.config.before_send:[this.config.before_send],r=e;for(var n of s)try{if(r=n(r),se(r)){var o="Event '"+e.event+"' was rejected in beforeSend function";return ae(e.event)?Ii.warn(o+". This can cause unexpected behavior."):Ii.info(o),null}r.properties&&!Q(r.properties)||Ii.warn("Event '"+e.event+"' has no properties after beforeSend function, this is likely an error.")}catch(t){return Ii.error("Error in beforeSend function for event '"+e.event+"':",t),null}for(var a of i)if(r.properties&&se(r.properties[a]))return Ii.warn("Event '"+e.event+"' had its '"+a+"' property removed in a beforeSend function. This property is required for ingestion, so the event will be dropped."),null;return r}getPageViewId(){var e;
1return null==(e=this.pageViewManager.rs)?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)})}Po(e){var t=oe(e)&&!e,i=mr.Nr()&&"true"===mr.Pr("ph_debug");return!t&&(!!i||e)}}yl.__defaultExtensionClasses={},yl.ol=(()=>{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]]=er(e.prototype[t[i]])}(yl,["identify"]);class bl{constructor(e){this.disabled=!1===e;var t=J(e)?e:{};this.thresholdPx=t.threshold_px||30,this.timeoutMs=t.timeout_ms||1e3,this.clickCount=t.click_count||3,this.clicks=[]}isRageClick(e,t,i){if(this.disabled)return!1;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 wl="$copy_autocapture",xl=Fi("[AutoCapture]");function kl(e,t){return t.length>e?t.slice(0,e)+"...":t}function El(e){if(e.previousElementSibling)return e.previousElementSibling;var t=e;do{t=t.previousSibling}while(t&&!Lr(t));return t}var Sl=Fi("[ExceptionAutocapture]"),Pl=()=>{},Il=Fi("[TracingHeaders]"),Fl=Fi("[Web Vitals]"),$l=9e5,Cl="disabled",Tl="lazy_loading",Dl="awaiting_config",Ml="missing_config";Fi("[SessionRecording]"),Fi("[SessionRecording]");var Rl="[SessionRecording]",Ol=Fi(Rl),Al=Fi("[Heatmaps]");function Ll(e){return J(e)&&"clientX"in e&&"clientY"in e&&re(e.clientX)&&re(e.clientY)}var Nl=Fi("[Product Tours]"),jl=e=>{var t;return!e.config.disable_product_tours&&!(null==(t=e.persistence)||!t.get_property(Gi))},ql=["$set_once","$set"],Bl=Fi("[SiteApps]"),Hl="Error while initializing PostHog app with config id ";function zl(e,t,i){if(se(e))return!1;switch(i){case"exact":return e===t;case"contains":var s=t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&").replace(/_/g,".").replace(/%/g,".*");return new RegExp(s,"i").test(e);case"regex":try{return new RegExp(t).test(e)}catch(e){return!1}default:return!1}}class Ul{constructor(e){this.ll=new Ca,this.ul=(e,t)=>this.hl(e,t)&&this.dl(e,t)&&this.vl(e,t)&&this.cl(e,t),this.hl=(e,t)=>null==t||!t.event||(null==e?void 0:e.event)===(null==t?void 0:t.event),this._instance=e,this.fl=new Set,this.pl=new Set}init(){var e,t;Z(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(!Z(null==(t=this._instance)?void 0:t._addCaptureHook)&&(e.forEach(e=>{var t,i;null==(t=this.pl)||t.add(e),null==(i=e.steps)||i.forEach(e=>{var t;null==(t=this.fl)||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.fl.has(e)||this.fl.has(t.event))&&this.pl&&(null==(i=this.pl)?void 0:i.size)>0&&this.pl.forEach(e=>{this.gl(t,e)&&this.ll.emit("actionCaptured",e.name)})}ml(e){this.onAction("actionCaptured",t=>e(t))}gl(e,t){if(null==(null==t?void 0:t.steps))return!1;for(var i of t.steps)if(this.ul(e,i))return!0;return!1}onAction(e,t){return this.ll.on(e,t)}dl(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)return!1;if(!zl(s,t.url,t.url_matching||"contains"))return!1}return!0}vl(e,t){return!!this.yl(e,t)&&!!this.bl(e,t)&&!!this._l(e,t)}yl(e,t){var i;if(null==t||!t.href)return!0;var s=this.wl(e);if(s.length>0)return s.some(e=>zl(e.href,t.href,t.href_matching||"exact"));var r,n=(null==e||null==(i=e.properties)?void 0:i.$elements_chain)||"";return!!n&&zl((r=n.match(/(?::|")href="(.*?)"/))?r[1]:"",t.href,t.href_matching||"exact")}bl(e,t){var i;if(null==t||!t.text)return!0;var s=this.wl(e);if(s.length>0)return s.some(e=>zl(e.text,t.text,t.text_matching||"exact")||zl(e.$el_text,t.text,t.text_matching||"exact"));var r,n,o,a=(null==e||null==(i=e.properties)?void 0:i.$elements_chain)||"";return!!a&&(r=function(e){for(var t,i=[],s=/(?::|")text="(.*?)"/g;!se(t=s.exec(e));)i.includes(t[1])||i.push(t[1]);return i}(a),n=t.text,o=t.text_matching||"exact",r.some(e=>zl(e,n,o)))}_l(e,t){var i,s;if(null==t||!t.selector)return!0;var 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}return!1}wl(e){var t;return null==(null==e||null==(t=e.properties)?void 0:t.$elements)?[]:null==e?void 0:e.properties.$elements}cl(e,t){return null==t||!t.properties||0===t.properties.length||qa(t.properties.reduce((e,t)=>
1{var i=K(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 Vl{constructor(e){var t;this.kl=[],this._instance=e,this.Sl=new Map,this.xl=new Map,this.Cl=new Map,null==(t=this._instance)||null==t.onSessionId||t.onSessionId(e=>this.Tl(e))}Ml(e){return!1}El(){return null}Il(e){}Rl(){}Pl(e,t){return!!e&&qa(e.propertyFilters,null==t?void 0:t.properties)}Al(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}Fl(e,t,i){var s=(i===ho?this.Sl:this.xl).get(e),r=[];return this.Ol(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.Pl(n,t)})}register(e){var t;Z(null==(t=this._instance)?void 0:t._addCaptureHook)||(this.Ll(e),this.$l(e))}$l(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.Dl&&(this.Dl=new Ul(this._instance),this.Dl.init(),this.Dl.ml(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.Dl)||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.Cl.get(t.name);i&&i.push(e.id),this.Cl.set(t.name,i||[e.id])}}))}))}Ll(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.Sl=this.Al(e,ho),this.xl=this.Al(e,co))}onEvent(e,t){var i,s,r=this.Nl(),n=(null==t||null==(i=t.properties)?void 0:i.$survey_id)||(null==t||null==(s=t.properties)?void 0:s.$product_tour_id);if(n&&this.getActivatedIds().includes(n)){var o=this.ql(e,n);if("consume"===o)return r.info("event consumed activated item, removing it",{event:e,itemId:n}),void this.jl([n]);if("persist"===o)return r.info("shown item promoted to persisted activation",{event:e,itemId:n}),this.Bl(n),void this.Hl([n])}if(this.xl.has(e)){var a=this.Fl(e,t,co);a.length>0&&(r.info("cancel event matched, cancelling items",{event:e,itemsToCancel:a.map(e=>e.id)}),this.jl(a.map(e=>e.id)),a.forEach(e=>this.Ul(e.id)))}if(this.Sl.has(e)){r.info("event name matched",{event:e,eventPayload:t,items:this.Sl.get(e)});var l=this.Fl(e,t,ho);this.zl(l.map(e=>e.id))}}onAction(e){this.Cl.has(e)&&this.zl(this.Cl.get(e)||[])}zl(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.Ml(r)?this.Bl(r)&&this.Wl(r):s.push(r);s.length>0&&(this.kl=[...new Set([...this.kl,...s])]),this.Nl().info("updating activated items",{activatedItems:this.getActivatedIds()})}}Bl(e){this.kl=this.kl.filter(t=>t!==e);var t=this.Vl();return!t.includes(e)&&(this.Gl([...t,e]),this.Zl(),!0)}jl(e){var t=new Set(e);this.kl=this.kl.filter(e=>!t.has(e));var i=this.Ql(),s=i.filter(e=>!t.has(e));s.length!==i.length&&(this.Gl(s),0===s.length&&this.Jl()),this.Hl(e)}Kl(){var e,t=this.El();if(!t)return{};var i=null==(e=this._instance)||null==(e=e.persistence)?void 0:e.props[t];return i&&"object"==typeof i?i:{}}Wl(e){if(this.El()){var t=this.Kl();this.Il(y({},t,{[e]:Date.now()}))}}Hl(e){if(this.El()){var t=this.Kl(),i={},s=!1;for(var r of Object.entries(t)){var n=r[0],o=r[1];e.includes(n)?s=!0:i[n]=o}s&&(Q(i)?this.Rl():this.Il(i))}}Yl(){this.El()&&this.Rl()}getActivationTimestamp(e){if(this.Vl().includes(e)){var t=this.Kl()[e];return re(t)?t:void 0}}Ql(){var e,t=this.Xl();return(null==(e=this._instance)||null==(e=e.persistence)?void 0:e.props[t])||[]}Vl(){var e,t,i=this.Ql();if(0===i.length)return[];var s=null==(e=this._instance)||null==(e=e.persistence)?void 0:e.props[this.tu()],r=null==(t=this._instance)||null==t.get_session_id?void 0:t.get_session_id();return r&&s===r?i:[]}Zl(){var e,t=null==(e=this._instance)||null==e.get_session_id?void 0:e.get_session_id();t&&this.eu(t)}Jl(){this.iu()}Tl(e){var t,i=null==(t=this._instance)||null==(t=t.persistence)?void 0:t.props[this.tu()];if(i&&i!==e){var s=this.Ql(),r=this.Kl();s.length>0&&(this.Gl([]),s.filter(e=>
1re(r[e])).forEach(e=>this.Ul(e))),this.Jl(),this.Yl()}}getActivatedIds(){return[...new Set([...this.Vl(),...this.kl])].filter(e=>!this.ru(e))}reset(){this.kl=[],this.Ql().length>0&&this.Gl([]),this.Jl(),this.Yl()}getEventToItemsMap(){return this.Sl}nu(){return this.Dl}}class Wl extends Vl{constructor(e){super(e)}Xl(){return _s}tu(){return ms}El(){return ys}Il(e){var t;null==(t=this._instance)||null==(t=t.persistence)||t.register({[ys]:e})}Rl(){var e;null==(e=this._instance)||null==(e=e.persistence)||e.unregister(ys)}Ml(e){var t,i;this.Ol(t=>{i=t.find(t=>t.id===e)});var s=null==(t=i)||null==(t=t.appearance)?void 0:t.surveyPopupDelaySeconds;return re(s)&&s>0}su(){return fo}Ol(e){var t;null==(t=this._instance)||t.getSurveys(e)}Ul(e){var t;null==(t=this._instance)||t.cancelPendingSurvey(e)}Nl(){return Ga}Gl(e){var t;null==(t=this._instance)||null==(t=t.persistence)||t.register({[_s]:e})}eu(e){var t;null==(t=this._instance)||null==(t=t.persistence)||t.register({[ms]:e})}iu(){var e;null==(e=this._instance)||null==(e=e.persistence)||e.unregister(ms)}ru(){return!1}ql(e,t){var i;this.Ol(e=>{i=e.find(e=>e.id===t)});var s=!i||function(e){var t;return Wa(e)&&!(null==(t=e.conditions)||null==(t=t.events)||!t.repeatedActivation)||"always"===e.schedule}(i);return s?e===fo?"consume":"ignore":e===fo?"persist":e===_o||e===mo?"consume":"ignore"}getSurveys(){return this.getActivatedIds()}getEventToSurveys(){return this.getEventToItemsMap()}}var Gl="SDK is not enabled or survey functionality is not yet loaded",Yl="Disabled. Not loading surveys.",Kl=null!=s&&s.location?Ln(s.location.hash,"__posthog")||Ln(location.hash,"state"):null,Xl="_postHogToolbarParams",Jl=Fi("[Toolbar]"),Ql=Fi("[FeatureFlags]");class Zl{constructor(e,t){void 0===t&&(t=!1),this.au=!1,this.update(e,t)}update(e,t){this.ou=((e,t)=>{var i,s,r,n;return{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:K(e.flag_keys)?e.flag_keys:void 0}})(e,t),!e.evaluation_environments||e.evaluation_contexts||this.au||(Ql.warn("evaluation_environments is deprecated. Use evaluation_contexts instead. evaluation_environments will be removed in a future version."),this.au=!0),Z(e.flag_keys)||K(e.flag_keys)||Ql.error("Invalid flag_keys found:",e.flag_keys,"Expected array of non-empty strings")}get(){return this.ou}}var eu=Fi("[FeatureFlags]"),tu=Fi("[FeatureFlags]",{debugEnabled:!0}),iu="\" failed. Feature flags didn't load in time.",su="connection_error",ru=e=>{for(var t={},i=0;e.length>i;i++)t[e[i]]=!0;return t},nu=e=>{var t={};for(var i of Qs(e||{})){var s=i[1];s&&(t[i[0]]=s)}return t},ou=Fi("[Error tracking]"),au=["chrome-extension://","moz-extension://","safari-extension:","safari-web-extension:"],lu="Refusing to render web experiment since the viewer is a likely bot",uu={icontains:(e,t)=>t.toLowerCase().indexOf(e.toLowerCase())>-1,not_icontains:(e,t)=>-1===t.toLowerCase().indexOf(e.toLowerCase()),regex:(e,t)=>Aa(t,e),not_regex:(e,t)=>!Aa(t,e),exact:(e,t)=>t===e,is_not:(e,t)=>t!==e};class hu{get Di(){return this._instance.config}constructor(e){var t=this;this.getWebExperimentsAndEvaluateDisplayLogic=function(e){void 0===e&&(e=!1),t.getWebExperiments(e=>{hu.lu("retrieved web experiments from the server"),t.uu=new Map,e.forEach(e=>{if(e.feature_flag_key){var i;t.uu&&(hu.lu("setting flag key ",e.feature_flag_key," to web experiment ",e),null==(i=t.uu)||i.set(e.feature_flag_key,e));var s=t._instance.getFeatureFlag(e.feature_flag_key);ee(s)&&e.variants[s]&&t.hu(e.name,s,e.variants[s].transforms)}else if(e.variants)for(var r in e.variants){var n=e.variants[r];hu.du(n,t._instance)&&t.hu(e.name,r,n.transforms)}})},e)},this._instance=e,this._instance.onFeatureFlags(e=>{this.onFeatureFlags(e)})}initialize(){}onFeatureFlags(e){if(this._is_bot())hu.lu(lu);else if(!this.Di.disable_web_experiments){if(se(this.uu))return this.uu=new Map,this.loadIfEnabled(),void this.previewWebExperiment();
vendor: 1,563 bytes, line 1
1hu.lu("applying feature flags",e),e.forEach(e=>{var t;if(this.uu&&null!=(t=this.uu)&&t.has(e)){var i,s=this._instance.getFeatureFlag(e),r=null==(i=this.uu)?void 0:i.get(e);s&&null!=r&&r.variants[s]&&this.hu(r.name,s,r.variants[s].transforms)}})}}previewWebExperiment(){var e=hu.getWindowLocation();if(null!=e&&e.search){var t=On(null==e?void 0:e.search,"__experiment_id"),i=On(null==e?void 0:e.search,"__experiment_variant");t&&i&&(hu.lu("previewing web experiments "+t+" && "+i),this.getWebExperiments(e=>{this.vu(parseInt(t),i,e)},!1,!0))}}loadIfEnabled(){this.Di.disable_web_experiments||this.getWebExperimentsAndEvaluateDisplayLogic()}getWebExperiments(e,t,i){if(this.Di.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.Di.token),method:"GET",timestampMode:"query",callback:t=>e(200===t.statusCode&&t.json&&t.json.experiments||[])})}vu(e,t,i){var s=i.filter(t=>t.id===e);s&&s.length>0&&(hu.lu("Previewing web experiment ["+s[0].name+"] with variant ["+t+"]"),this.hu(s[0].name,t,s[0].variants[t].transforms))}static du(e,t){return!se(e.conditions)&&hu.cu(e,t)&&hu.fu(e)}static cu(e,t){var i;if(se(e.conditions)||se(null==(i=e.conditions)?void 0:i.url))return!0;var s=hu.getWindowLocation();if(s){var r,n,o,a=Rr(t,s.href);return null==(r=e.conditions)||!r.url||uu[null!==(n=null==(o=e.conditions)?void 0:o.urlMatchType)&&void 0!==n?n:"icontains"](e.conditions.url,a)}return!1}
1static getWindowLocation(){return null==s?void 0:s.location}static fu(e){var t;if(se(e.conditions)||se(null==(t=e.conditions)?void 0:t.utm))return!0;var i=Vn();if(i.utm_source){var s,r,n,o,a,l,u,h,c=null==(s=e.conditions)||null==(s=s.utm)||!s.utm_campaign||(null==(r=e.conditions)||null==(r=r.utm)?void 0:r.utm_campaign)==i.utm_campaign,d=null==(n=e.conditions)||null==(n=n.utm)||!n.utm_source||(null==(o=e.conditions)||null==(o=o.utm)?void 0:o.utm_source)==i.utm_source,v=null==(a=e.conditions)||null==(a=a.utm)||!a.utm_medium||(null==(l=e.conditions)||null==(l=l.utm)?void 0:l.utm_medium)==i.utm_medium,p=null==(u=e.conditions)||null==(u=u.utm)||!u.utm_term||(null==(h=e.conditions)||null==(h=h.utm)?void 0:h.utm_term)==i.utm_term;return c&&v&&p&&d}return!1}static lu(e){for(var t=arguments.length,i=new Array(t>1?t-1:0),s=1;t>s;s++)i[s-1]=arguments[s];Ii.info("[WebExperiments] "+e,i)}hu(e,t,i){this._is_bot()?hu.lu(lu):"control"!==t?i.forEach(i=>{if(i.selector){var s;hu.lu("applying transform of variant "+t+" for experiment "+e+" ",i);var r=null==(s=document)?void 0:s.querySelectorAll(i.selector);null==r||r.forEach(e=>{var t=e;i.html&&(t.innerHTML=i.html),i.css&&t.setAttribute("style",i.css)})}}):hu.lu("Control variants leave the page unmodified.")}_is_bot(){return n&&this._instance?Ra(n,this.Di.custom_blocked_useragents):void 0}}var cu=Fi("[Conversations]"),du="Conversations not available yet.",vu="console",pu="__posthogHandledLogsRequestError",gu=(e,t)=>{var i=e instanceof Error?e:new Error(t);return i[pu]=!0,i},fu=e=>!!e&&"object"==typeof e&&!0===e[pu],_u={featureFlags:class{constructor(e){this.name="featureFlags",this.pu=!1,this.featureFlagEventHandlers=[],this.I=eu,this.gu={},this.mu={},this.yu=[],this.bu=!1,this._u=!1,this.wu=0,this.ku=!1,this.Su=!1,this.xu=!1,this.Cu=!1,this.Tu=0,this.Tt=()=>{var e=this.Mu();this.Tu=0,e&&this.reloadFeatureFlags()},"get"in e?this.Eu=e:(this.Iu=new Zl(e.config,e.Xs()),this.Eu=this.Iu)}updateConfig(e,t){var i;null==(i=this.Iu)||i.update(e,t)}setup(e){return this.Ru=e,this.I=e.logger.createLogger("[FeatureFlags]"),i=()=>{this.Ru===e&&(this.Ru=void 0,this.oo=e,this.Pu(e))},null!=(t=e.kv.initialize())&&t.then?t.then(i):i();var t,i}Pu(e){if(this.oo===e)return s&&rr(s,"online",this.Tt),this.Au=e.registerDynamicEventProperties(()=>this.Fu()?this.gu:this.mu),this.Ou(),this.initialize()}destroy(){null==s||s.removeEventListener("online",this.Tt)}dispose(){var e;this.wu++,this.Su=!1,this.Ru=void 0,this.oo&&(this.Lu(),null==(e=this.Au)||e.dispose(),this.Au=void 0,this.yu=[],null==s||s.removeEventListener("online",this.Tt),this.oo=void 0)}get Di(){return this.Eu.get()}$u(e){var t;return null==(t=this.oo)?void 0:t.kv.get(e)}Dr(e){this.Du(()=>{var t;return null==(t=this.oo)?void 0:t.kv.set(e)})}qr(e){this.Du(()=>{var t;return null==(t=this.oo)?void 0:t.kv.remove(e)})}Du(e){try{e()}catch(e){this.I.error("Failed to update feature flag persistence",e)}}Ou(){var e={};for(var t of[rs,as,ls,hs]){var i=this.$u(t);Z(i)||(e[t]=i)}this.gu=e;var s=y({},e),r=this.$u(ss);if(r)for(var n of Object.entries(r))s["$feature/"+n[0]]=n[1];this.mu=s}Fu(){var e=this.Di.cacheTtlMs;if(!e||0>=e)return!1;var t=this.$u(Es);return"number"!=typeof t||Date.now()-t>e}Nu(){return!!this.Fu()&&(this.Cu||this._u||(this.Cu=!0,this.I.warn("Feature flag cache is stale, triggering refresh..."),this.reloadFeatureFlags()),!0)}qu(){var e=this.Di.evaluationContexts;return null!=e&&e.length?e.filter(e=>{var t=e&&"string"==typeof e&&e.trim().length>0;return t||this.I.error("Invalid evaluation context found:",e,"Expected non-empty string"),t}):[]}ju(){var e=this.Di.flagKeys;if(!Z(e))return e.filter(e=>{var t=e&&"string"==typeof e&&e.trim().length>0;return t||this.I.error("Invalid flag key found:",e,"Expected non-empty string"),t})}initialize(){var e,t,i=this.Di,s=null!==(e=null==(t=i.bootstrap)?void 0:t.featureFlags)&&void 0!==e?e:{};if(Object.keys(s).length){var r,n,o=null!==(r=null==(n=i.bootstrap)?void 0:n.featureFlagPayloads)&&void 0!==r?r:{},a=Object.keys(s).filter(e=>!!s[e]).reduce((e,t)=>(e[t]=s[t]||!1,e),{}),l=Object.keys(o).filter(e=>a[e]).reduce((e,t)=>
vendor: 6,434 bytes, line 1
1(e[t]=o[t],e),{});return this.Bu({featureFlags:a,featureFlagPayloads:l})}}updateFlags(e,t,i){var s,r,n=null!=i&&i.merge&&null!==(s=this.$u(ss))&&void 0!==s?s:{},o=null!=i&&i.merge&&null!==(r=this.$u(as))&&void 0!==r?r:{},a=y({},n,e),l=y({},o,t),u={};for(var h of Object.entries(a)){var c=h[0],d=h[1];u[c]={key:c,enabled:x(d),variant:k(d),reason:void 0,metadata:Z(null==l?void 0:l[c])?void 0:{id:0,version:void 0,description:void 0,payload:l[c]}}}this.Bu({flags:u})}get hasLoadedFlags(){return this.bu}getFlags(){return Object.keys(this.getFlagVariants())}getFlagsWithDetails(){var e=this.$u(os),t=this.$u(hs),i=this.$u(cs);if(!i&&!t)return e||{};var s=Js({},e||{}),r=[...new Set([...Object.keys(i||{}),...Object.keys(t||{})])];for(var n of r){var o,a,l=s[n],u=null==t?void 0:t[n],h=Z(u)?null!==(o=null==l?void 0:l.enabled)&&void 0!==o&&o:!!u,c=Z(u)?null==l?void 0:l.variant:"string"==typeof u?u:void 0,d=null==i?void 0:i[n],v=y({},l,{enabled:h,variant:h?null!=c?c:null==l?void 0:l.variant:void 0});h!==(null==l?void 0:l.enabled)&&(v.original_enabled=null==l?void 0:l.enabled),c!==(null==l?void 0:l.variant)&&(v.original_variant=null==l?void 0:l.variant),d&&(v.metadata=y({},null==l?void 0:l.metadata,{payload:d,original_payload:null==l||null==(a=l.metadata)?void 0:a.payload})),s[n]=v}return this.pu||(this.I.warn(" Overriding feature flag details!",{flagDetails:e,overriddenPayloads:i,finalDetails:s}),this.pu=!0),s}getAllFeatureFlags(){var e=this.getFlagVariants(),t=this.getFlagPayloads();return Object.keys(e).map(i=>{var s=e[i];return{key:i,enabled:x(s),variant:k(s),payload:w(t[i])}})}getFlagVariants(){var e=this.$u(ss),t=this.$u(hs);if(!t)return e||{};for(var i=Js({},e||{}),s=Object.keys(t),r=0;s.length>r;r++)i[s[r]]=t[s[r]];return this.pu||(this.I.warn(" Overriding feature flags!",{enabledFlags:e,overriddenFlags:t,finalFlags:i}),this.pu=!0),i}getFlagPayloads(){var e=this.$u(as),t=this.$u(cs);if(!t)return e||{};for(var i=Js({},e||{}),s=Object.keys(t),r=0;s.length>r;r++)i[s[r]]=t[s[r]];return this.pu||(this.I.warn(" Overriding feature flag payloads!",{flagPayloads:e,overriddenPayloads:t,finalPayloads:i}),this.pu=!0),i}reloadFeatureFlags(){this.ku||this.Di.featureFlagsDisabled||this.Mu()||this.Hu||(this.yu.slice().forEach(e=>{try{e()}catch(e){this.I.error("Error while running feature flags reloading callback",e)}}),this.Hu=setTimeout(()=>{this.Uu()},5))}Lu(){clearTimeout(this.Hu),this.Hu=void 0}onReloading(e){return this.yu.push(e),()=>{this.yu=this.yu.filter(t=>t!==e)}}ensureFlagsLoaded(){this.bu||this._u||this.Hu||this.reloadFeatureFlags()}setAnonymousDistinctId(e){this.$anon_distinct_id=e}setReloadingPaused(e){this.ku=e}resetFlagCallReported(){this.qr(ws)}Uu(e){this.Lu();var t=this.oo;if(t&&!this.Di.remoteRequestsDisabled&&!this.Mu())if(this._u)this.Su=!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.$u(ds)||{},{$lib:t.library.name,$lib_version:t.library.version}),group_properties:this.$u(vs),timezone:Zn()};Z(t.deviceId)||(i.$device_id=t.deviceId),(null!=e&&e.disableFlags||this.Di.featureFlagsDisabled)&&(i.disable_flags=!0);var s=this.qu();s.length&&(i.evaluation_contexts=s);var r=this.ju();Z(r)||(i.flag_keys=r);var n=this.Di.onlyEvaluateSurveyFeatureFlags,o="/flags/?v=2"+(n?"&only_evaluate_survey_feature_flags=true":""),a=this.wu;this._u=!0;var l=()=>{this.Su&&(this.Su=!1,this.Uu())},u=e=>{this._u=!1,a===this.wu?(this.Dr({[ks]:[su]}),this.I.error("Feature flag request failed",e),l()):l()};try{t.sendRequest(o,{target:"flags",method:"POST",body:i,compression:"base64"===this.Di.compression?uo:void 0,sentAt:"body",timeoutMs:this.Di.requestTimeoutMs}).then(e=>{var t,s,r=null!==(t=e.json)&&void 0!==t?t:{},o=200!==e.statusCode;if(this._u=!1,a===this.wu){if(this.zu(e.statusCode),o||this.Su||(this.$anon_distinct_id=void 0),!i.disable_flags||this.Su){this.xu=!o;var u=[];e.error?u.push(e.error instanceof Error&&"AbortError"===e.error.name?"timeout":e.error instanceof Error?su:"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.Dr({[ks]:u}),h?this.I.warn("You have hit your feature flags quota limit, and will not be able to load feature flags until the quota is reset. Please visit https://posthog.com/docs/billing/limits-alerts to learn more."):i.disable_flags||this.Bu(r,o,{partialResponse:n}),l()}}else l()}).catch(u)}catch(e){u(e)}}}Mu(){return Nn(this.Tu,3)}zu(e){this.Tu=jn(e,this.Tu,3,()=>this.I.warn("Feature flag requests are failing before receiving an HTTP response; this can happen due to network issues, CORS, browser blocking, or ad blockers. Stopped refreshing feature flags; will try again when connectivity changes."))}getFeatureFlag(e,t){var i;if(void 0===t&&(t={}),!t.fresh||this.xu)if(this.bu||this.getFlags()&&this.getFlags().length>0){if(!this.Nu()){var s=this.getFeatureFlagResult(e,t);return null!==(i=null==s?void 0:s.variant)&&void 0!==i?i:null==s?void 0:s.enabled}}else this.I.warn('getFeatureFlag for key "'+e+iu)}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.xu)if(this.bu||this.getFlags()&&this.getFlags().length>0){if(!this.Nu()){var i,s=this.getFlagVariants(),r=e in s,n=s[e],o=this.getFlagPayloads()[e],a=String(n),l=this.$u(ls)||void 0,u=this.$u(Es)||void 0,h=this.$u(ws)||{};if(this.Di.deduplicateCallsPerSession){var c,d=null==(c=this.oo)?void 0:c.session.sessionId,v=this.$u(xs);d&&d!==v&&(h={},i=d)}if(t.send_event||!("send_event"in t))if(e in h&&h[e].includes(a))i&&this.Dr({[ws]:h,[xs]:i});else{var p,g,f,_,m,b,x,k,E,S,P,I;K(h[e])?h[e].push(a):h[e]=[a],this.Dr(y({[ws]:h},i?{[xs]:i}:{}));var F=this.getFeatureFlagDetails(e),$=[...null!==(p=this.$u(ks))&&void 0!==p?p:[]];Z(n)&&$.push("flag_missing");var C={$feature_flag:e,$feature_flag_response:n,$feature_flag_payload:null!=o?o:null,$feature_flag_request_id:l,$feature_flag_evaluated_at:u,$feature_flag_bootstrapped_response:null!==(g=null==(f=this.Di.bootstrap)||null==(f=f.featureFlags)?void 0:f[e])&&void 0!==g?g:null,$feature_flag_bootstrapped_payload:null!==(_=null==(m=this.Di.bootstrap)||null==(m
1=m.featureFlagPayloads)?void 0:m[e])&&void 0!==_?_:null,$used_bootstrap_value:!this.xu};Z(null==F||null==(b=F.metadata)?void 0:b.has_experiment)||(C.$feature_flag_has_experiment=F.metadata.has_experiment),Z(null==F||null==(x=F.metadata)?void 0:x.version)||(C.$feature_flag_version=F.metadata.version);var T,D=null!==(k=null==F||null==(E=F.reason)?void 0:E.description)&&void 0!==k?k:null==F||null==(S=F.reason)?void 0:S.code;D&&(C.$feature_flag_reason=D),null!=F&&null!=(P=F.metadata)&&P.id&&(C.$feature_flag_id=F.metadata.id),Z(null==F?void 0:F.original_variant)&&Z(null==F?void 0:F.original_enabled)||(C.$feature_flag_original_response=Z(F.original_variant)?F.original_enabled:F.original_variant),null!=F&&null!=(I=F.metadata)&&I.original_payload&&(C.$feature_flag_original_payload=null==F||null==(T=F.metadata)?void 0:T.original_payload),$.length&&(C.$feature_flag_error=$.join(",")),this.Wu(C)}else i&&this.Dr({[ws]:h,[xs]:i});if(r)return{key:e,enabled:!!n,variant:"string"==typeof n?n:void 0,payload:w(o)}}}else this.I.warn('getFeatureFlagResult for key "'+e+iu)}Wu(e){try{var t;null==(t=this.oo)||t.capture("$feature_flag_called",e).catch(e=>{this.I.error("Failed to capture feature flag call",e)})}catch(e){this.I.error("Failed to capture feature flag call",e)}}getRemoteConfigPayload(e,t){this.Vu(e,t)}Vu(e,t){var i=this;return m(function*(){var s=i.oo;if(s){var r={distinct_id:s.distinctId,token:s.projectToken,person_properties:{$lib:s.library.name,$lib_version:s.library.version}},n=i.qu();n.length&&(r.evaluation_contexts=n);var o,a=i.ju();Z(a)||(r.flag_keys=a);try{var l,u=null==(l=(yield s.sendRequest("/flags/?v=2",{target:"flags",method:"POST",body:r,compression:"base64"===i.Di.compression?uo:void 0,sentAt:"body",timeoutMs:i.Di.requestTimeoutMs})).json)?void 0:l.featureFlagPayloads;o=(null==u?void 0:u[e])||void 0}catch(e){return void i.I.error("Remote config feature flag request failed",e)}try{t(o)}catch(e){i.I.error("Remote config feature flag callback failed",e)}}})()}isFeatureEnabled(e,t){if(void 0===t&&(t={}),t.fresh&&!this.xu)return t.defaultValue;if(!(this.bu||this.getFlags()&&this.getFlags().length>0))return this.I.warn('isFeatureEnabled for key "'+e+iu),t.defaultValue;var i=this.getFeatureFlag(e,t);return Z(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.Bu(e,t,i)}Bu(e,t,i){if(this.oo){this.bu=!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=eu);var o=((e,t)=>{var i=e.flags;return i?y({},e,{featureFlags:Object.fromEntries(Object.keys(i).map(e=>{var t;return[e,null!==(t=i[e].variant)&&void 0!==t?t:i[e].enabled]})),featureFlagPayloads:Object.fromEntries(Object.keys(i).filter(e=>i[e].enabled).filter(e=>{var t;return null==(t=i[e].metadata)?void 0:t.payload}).map(e=>{var t;return[e,null==(t=i[e].metadata)?void 0:t.payload]}))}):(e.featureFlags&&t.warn("Using an older version of the feature flags endpoint. Please upgrade your PostHog server to the latest version"),e)})(e,n),a=o.flags,l=o.featureFlags,u=o.featureFlagPayloads;if(l){var h=e.requestId,c=e.evaluatedAt;if(K(l)){n.warn("v1 of the feature flags endpoint is deprecated. Please use the latest version.");var d={};if(l)for(var v=0;l.length>v;v++)d[l[v]]=!0;return{[rs]:l,[ss]:d,[us]:!1}}var p=l,g=u,f=a;if(null!=r&&r.partialResponse)p=y({},t,p),g=y({},i,g),f=y({},s,f);else if(e.errorsWhileComputingFlags)if(a){var _=new Set(Object.keys(a).filter(e=>{var t;return!(null!=(t=a[e])&&t.failed)}));p=y({},t,Object.fromEntries(Object.entries(p).filter(e=>_.has(e[0])))),g=y({},i,Object.fromEntries(Object.entries(g||{}).filter(e=>_.has(e[0])))),f=y({},s,Object.fromEntries(Object.entries(f||{}).filter(e=>_.has(e[0]))))}else p=y({},t,p),g=y({},i,g),f=y({},s,f);return y({[rs]:Object.keys(nu(p)),[ss]:p||{},[as]:g||{},[os]:f||{},[us]:!0===e.minimalFlagCalledEvents},h?{[ls]:h}:{},c?{[Es]:c}:{})}}(e,this.getFlagVariants(),this.getFlagPayloads(),this.getFlagsWithDetails(),i,this.I);s&&this.Dr(s),t||(this.Cu=!1),this.Gu(t)}}override(e,t){void 0===t&&(t=!1),this.I.warn("override is deprecated. Please use overrideFeatureFlags instead."),this.overrideFeatureFlags({flags:e,suppressWarning:t})}overrideFeatureFlags(e){this.Zu(e)}
1Zu(e){if(this.oo){if(!1===e)return this.qr([hs,cs]),this.Gu(),void tu.info("All overrides cleared");if(K(e))return this.Dr({[hs]:ru(e)}),this.Gu(),void tu.info("Flag overrides set",{flags:e});if(e&&"object"==typeof e&&("flags"in e||"payloads"in e)){var t,i=e;this.pu=Boolean(null!==(t=i.suppressWarning)&&void 0!==t&&t);var s={},r=i.flags,n=i.payloads;return r&&(s[hs]=K(r)?ru(r):r),n&&(s[cs]=n),Object.keys(s).length&&this.Dr(s),!1===r&&!1===n?this.qr([hs,cs]):!1===r?this.qr(hs):!1===n&&this.qr(cs),this.Gu(),!1===r?tu.info("Flag overrides cleared"):r&&tu.info("Flag overrides set",{flags:r}),void(!1===n?tu.info("Payload overrides cleared"):n&&tu.info("Payload overrides set",{payloads:n}))}if(e&&"object"==typeof e)return this.Dr({[hs]:e}),this.Gu(),void tu.info("Flag overrides set",{flags:e});this.I.warn("Invalid overrideOptions provided to overrideFeatureFlags",{overrideOptions:e})}else this.I.warn("posthog.featureFlags.overrideFeatureFlags called before feature flags were ready")}onFeatureFlags(e){if(this.addFeatureFlagsHandler(e),this.bu){var t=this.Qu(),i=t.flags,s=t.flagVariants;try{e(i,s)}catch(e){this.I.error("Error while running feature flags callback",e)}}return()=>this.removeFeatureFlagsHandler(e)}updateEarlyAccessFeatureEnrollment(e,t,i){var s=(this.$u(ns)||[]).find(t=>t.flagKey===e),r={["$feature_enrollment/"+e]:t},n={$feature_flag:e,$feature_enrollment:t,$set:r};s&&(n.$early_access_feature_name=s.name),i&&(n.$feature_enrollment_stage=i);var o=y({},this.getFlagVariants(),{[e]:t});this.Dr({[rs]:Object.keys(nu(o)),[ss]:o,[ds]:y({},this.$u(ds)||{},r)}),this.Gu();try{var a;null==(a=this.oo)||a.capture("$feature_enrollment_update",n).catch(e=>{this.I.error("Failed to capture early access feature enrollment",e)})}catch(e){this.I.error("Failed to capture early access feature enrollment",e)}}getEarlyAccessFeatures(e,t,i){void 0===t&&(t=!1);var s=this.$u(ns);!s||t?this.Ju(e,i):e(s)}Ju(e,t){var i=this;return m(function*(){var s=i.oo;if(s){var r,n=t?"&"+t.map(e=>"stage="+e).join("&"):"";try{var o=yield s.sendRequest("/api/early_access_features/?token="+s.projectToken+n,{target:"api",method:"GET",sentAt:"query"});if(!o.json)return;i.Dr({[ns]:r=o.json.earlyAccessFeatures})}catch(e){return void i.I.error("Early access feature request failed",e)}try{e(r)}catch(e){i.I.error("Early access feature callback failed",e)}}})()}Qu(){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),{})}}Gu(e){this.Ou();var t=this.Qu(),i=t.flags,s=t.flagVariants;this.featureFlagEventHandlers.forEach(t=>{try{t(i,s,{errorsLoading:e})}catch(e){this.I.error("Error while running feature flags callback",e)}})}setPersonPropertiesForFlags(e,t){void 0===t&&(t=!0),this.Ku(e,t)}Ku(e,t){void 0===t&&(t=!0);var i=this.$u(ds)||{},s=(null==e?void 0:e.$set)||(null!=e&&e.$set_once?{}:e),r=null==e?void 0:e.$set_once,n={};if(r)for(var o in r)({}).hasOwnProperty.call(r,o)&&(o in i||(n[o]=r[o]));this.Dr({[ds]:y({},i,n,s)}),t&&this.reloadFeatureFlags()}unsetPersonPropertiesForFlags(e,t){void 0===t&&(t=!0);var i=y({},this.$u(ds)||{});e.forEach(e=>{delete i[e]}),this.Dr({[ds]:i}),t&&this.reloadFeatureFlags()}resetPersonPropertiesForFlags(e){void 0===e&&(e=!0),this.qr(ds),e&&this.reloadFeatureFlags()}setGroupPropertiesForFlags(e,t){void 0===t&&(t=!0);var i=this.$u(vs)||{},s=y({},i);for(var r of Object.keys(e))s[r]=y({},i[r],e[r]);this.Dr({[vs]:s}),t&&this.reloadFeatureFlags()}resetGroupPropertiesForFlags(e){if(e){var t=this.$u(vs)||{};this.Dr({[vs]:y({},t,{[e]:{}})})}else this.qr(vs)}reset(){this.wu++,this.Su=!1,this.gu={},this.mu={},this.bu=!1,this.ku=!1,this.xu=!1,this.$anon_distinct_id=void 0,this.Lu(),this.pu=!1,this.Tu=0}}},mu={sessionRecording:class{get Di(){return this._instance.config}get Ta(){return this._instance.persistence}get started(){var e;return!(null==(e=this.Yu)||!e.isStarted)}get status(){var e,t;return this.Xu===Dl||this.Xu===Ml?this.Xu:null!==(e=null==(t=this.Yu)?void 0:t.status)&&void 0!==e?e:this.Xu}constructor(e){if(this._forceAllowLocalhostNetworkCapture=!1,this.Xu=Cl,this.th=void 0,this.eh=!1,this.kt=(()=>{var e;if(null==o||!o.visibilityState||"visible"===o.visibilityState)return!0;var 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.It=()=>{var e;"visible"===(null==o?void 0:o.visibilityState)&&(this.kt=!0,null==(e=this.Yu)||null==e.setDocumentWasEverVisible||e.setDocumentWasEverVisible(!0))},this._instance=e,!this._instance.sessionManager)throw Ol.error("started without valid sessionManager"),new Error(Rl+" started without valid sessionManager. This is a bug.");if(this.Di.cookieless_mode===js)throw new Error(Rl+' cannot be used with cookieless_mode="always"');null!=o&&o.addEventListener&&rr(o,"visibilitychange",this.It)}initialize(){this.startIfEnabledOrStop()}dispose(){this.eh=!0,null==o||null==o.removeEventListener||o.removeEventListener("visibilitychange",this.It),this.stopRecording()}get ih(){var e,t=!(null==(e=this._instance.get_property(Ki))||!e.enabled),i=!this.Di.disable_session_recording,r=this.Di.disable_session_recording||this._instance.consent.isOptedOut();return s&&t&&i&&!r}startIfEnabledOrStop(e){var t;if(!(this.eh||this.ih&&null!=(t=this.Yu)&&t.isStarted)){var i=!Z(Object.assign)&&!Z(Array.from);this.ih&&i?(this.rh(e),Ol.info("starting")):(this.Xu=Cl,this.stopRecording())}}rh(e){var t,i,s;this.ih&&(this.Xu!==Dl&&this.Xu!==Ml&&(this.Xu=Tl),null!=g&&null!=(t=g.__PosthogExtensions__)&&null!=(t=t.rrweb)&&t.record&&null!=(i=g.__PosthogExtensions__)&&i.initSessionRecording?this.nh(e):null==(s=g.__PosthogExtensions__)||null==s.loadExternalDependency||s.loadExternalDependency(this._instance,this.sh,t=>{if(t)return this._instance.register_for_session({[As]:!0}),Ol.error("could not load recorder",t);this.nh(e)}))}stopRecording(){var e,t;null==(e=this.th)||e.call(this),this.th=void 0,null==(t=this.Yu)||t.stop()}ah(){var e,t;null==(e=this.th)||e.call(this),this.th=void 0,null==(t=this.Yu)||t.discard()}oh(){var e,t;null==(e=this.Ta)||e.unregister(is),null==(t=this.Ta)||t.unregister(Xi)}lh(e,t){if(se(e))return null;var i,s=re(e)?e:parseFloat(e);return"number"!=typeof(i=s)||!Number.isFinite(i)||0>i||i>1?(Ol.warn(t+" must be between 0 and 1. Ignoring invalid value:",e),null):s}uh(e){if(this.Ta){var t,i,s=this.Ta,r=()=>{var t,i=!1===e.sessionRecording?void 0:e.sessionRecording,r=this.lh(null==(t=this.Di.session_recording)?void 0:t.sampleRate,"session_recording.sampleRate"),n=this.lh(null==i?void 0:i.sampleRate,"remote config sampleRate"),o=null!=r?r:n;se(o)&&this.oh();var a=null==i?void 0:i.minimumDurationMilliseconds;s.register({[Ki]:y({cache_timestamp:Date.now(),enabled:!!i},i,{networkPayloadCapture:y({capturePerformance:e.capturePerformance},null==i?void 0:i.networkPayloadCapture),canvasRecording:{enabled:null==i?void 0:i.recordCanvas,fps:null==i?void 0:i.canvasFps,quality:null==i?void 0:i.canvasQuality},sampleRate:o,minimumDurationMilliseconds:Z(a)?null:a,endpoint:null==i?void 0:i.endpoint,triggerMatchType:null==i?void 0:i.triggerMatchType,masking:null==i?void 0:i.masking,urlTriggers:null==i?void 0:i.urlTriggers,version:null==i?void 0:i.version,triggerGroups:null==i?void 0:i.triggerGroups})})};r(),null==(t=this.th)||t.call(this),this.th=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.uh(t),void this.ah()):(this.uh(t),void this.startIfEnabledOrStop()):(this.Xu===Dl&&(this.Xu=Ml,Ol.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.Yu)&&i.log?this.Yu.log(e,t):Ol.warn("log called before recorder was ready")}get sh(){var e,t,i=null==(e=this._instance)||null==(e=e.persistence)?void 0:e.get_property(Ki);return(null==i||null==(t=i.scriptConfig)?void 0:t.script)||"lazy-recorder"}hh(){var e,t=this._instance.get_property(Ki);if(!t)return!1;try{e="object"==typeof t?t:JSON.parse(t)}catch(e){return Ol.warn("persisted remote config for session recording is invali
1d and will be ignored",e),!1}return!se(e.cache_timestamp)&&36e5>=Date.now()-e.cache_timestamp}nh(e){var t,i,s;if(!this.eh){if(null==(t=g.__PosthogExtensions__)||!t.initSessionRecording)return Ol.warn("Called on script loaded before session recording is available. This can be caused by adblockers."),void this._instance.register_for_session({[As]:!0});var r;if(this.Yu||(this.Yu=null==(r=g.__PosthogExtensions__)?void 0:r.initSessionRecording(this._instance,this.kt),this.Yu._forceAllowLocalhostNetworkCapture=this._forceAllowLocalhostNetworkCapture),!this.hh()){if(this.Xu===Ml||this.Xu===Dl)return;return this.Xu=Dl,Ol.info("persisted remote config is stale, requesting fresh config before starting"),void new Co(this._instance).load()}this.Xu=Tl,null==(i=(s=this.Yu).setDocumentWasEverVisible)||i.call(s,this.kt),this.Yu.start(e)}}onRRwebEmit(e){var t;null==(t=this.Yu)||null==t.onRRwebEmit||t.onRRwebEmit(e)}overrideLinkedFlag(){var e,t;this.Yu||null==(t=this.Ta)||t.register({[Qi]:!0}),null==(e=this.Yu)||e.overrideLinkedFlag()}overrideSampling(){var e,t;this.Yu||null==(t=this.Ta)||t.register({[Ji]:!0}),null==(e=this.Yu)||e.overrideSampling()}overrideTrigger(e){var t,i;this.Yu||null==(i=this.Ta)||i.register({["url"===e?Zi:es]:!0}),null==(t=this.Yu)||t.overrideTrigger(e)}get sdkDebugProperties(){var e;return(null==(e=this.Yu)?void 0:e.sdkDebugProperties)||{$recording_status:this.status}}tryAddCustomEvent(e,t){var i;return!(null==(i=this.Yu)||!i.tryAddCustomEvent(e,t))}}},yu={autocapture:class{constructor(e){this.dh=!1,this.fh=null,this.ph=!1,this.gh=!1,this.instance=e,this.rageclicks=new bl(e.config.rageclick),this.mh=null}initialize(){this.startIfEnabled()}get Di(){var e,t,i=J(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}yh(){if(this.isBrowserSupported()){if(s&&o){var e=e=>{e=e||(null==s?void 0:s.event);try{this.bh(e)}catch(s){xl.error("Failed to capture event",s)}};if(rr(o,"submit",e,{capture:!0}),rr(o,"change",e,{capture:!0}),rr(o,"click",e,{capture:!0}),this.Di.capture_copied_text){var t=e=>{e=e||(null==s?void 0:s.event);try{this.bh(e,wl)}catch(s){xl.error("Failed to capture copy/cut event",s)}};rr(o,"copy",t,{capture:!0}),rr(o,"cut",t,{capture:!0})}}}else xl.info("Disabling Automatic Event Collection because this browser is not supported")}startIfEnabled(){this.isEnabled&&!this.dh&&(this.yh(),this.dh=!0)}onRemoteConfig(e){if(this.ph=!0,e.ok){var t=e.config;t.elementsChainAsString&&(this.gh=t.elementsChainAsString);var i=t.autocapture_opt_out;oe(i)&&(this.instance.persistence&&this.instance.persistence.register({[qi]:i}),this.fh=i),this.startIfEnabled()}else this.startIfEnabled()}setElementSelectors(e){this.mh=e}getElementSelectors(e){var t,i=[];return null==(t=this.mh)||t.forEach(t=>{var s=null==o?void 0:o.querySelectorAll(t);null==s||s.forEach(s=>{e===s&&i.push(t)})}),i}get isEnabled(){var e,t,i=null==(e=this.instance.persistence)?void 0:e.props[qi],s=this.fh,r=this.instance.Xs()&&!this.ph;if(ie(s)&&!oe(i)&&!r)return!1;var n=null!==(t=this.fh)&&void 0!==t?t:!!i;return!!this.instance.config.autocapture&&!n}bh(e,t){if(void 0===t&&(t="$autocapture"),this.isEnabled){var i,r=Wr(e);jr(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())&&sn(r,this.instance.config.rageclick)&&this.bh(e,"$rageclick");var n=t===wl;if(r&&function(e,t,i,r,n,o){var a;if(!s||rn(e))return!1;if(null!=i&&i.url_allowlist&&!Hr(i.url_allowlist,o))return!1;if(null!=i&&i.url_ignorelist&&Hr(i.url_ignorelist,o))return!1;if(null!=i&&i.dom_event_allowlist){var l=i.dom_event_allowlist;if(l&&!l.some(e=>t.type===e))return!1}var u=nn(e,r),h=u.parentIsUsefulElement,c=u.targetElementList;if(!function(e,t){var i=null==t?void 0:t.element_allowlist;if(Z(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))return!1;if(!Yr(c,null==i?void 0:i.css_selector_allowlist))return!1;if(Yr(c,null!==(a=null==i?void 0:i.css_selector_ignorelist)&&void 0!==a?a:Xr))return!1;try{var d=s.getComputedStyle(e);
1if(d&&"pointer"===d.getPropertyValue("cursor")&&"click"===t.type)return!0}catch(s){}var v=e.tagName.toLowerCase();switch(v){case"html":return!1;case"form":return(n||["submit"]).indexOf(t.type)>=0;case"input":case"select":case"textarea":return(n||["change","click"]).indexOf(t.type)>=0;default:return h?(n||["click"]).indexOf(t.type)>=0:(n||["click"]).indexOf(t.type)>=0&&(Gr.indexOf(v)>-1||"true"===e.getAttribute("contenteditable"))}}(r,e,this.Di,n,n?["copy","cut"]:void 0,this.instance)){var o=function(e,t){var i,r,n=t.e,o=t.maskAllElementAttributes,a=t.maskAllText,l=t.elementAttributeIgnoreList,u=t.elementsChainAsString,h=t.disableCaptureUrlHashes;if(!Lr(e))return{props:{}};for(var c=[e],d=new Set([e]),v=e;v.parentNode&&!Nr(v,"body")&&1e3>c.length;)if(qr(v.parentNode)){var p=v.parentNode.host;if(d.has(p))break;d.add(p),c.push(p),v=p}else{if(!Lr(v.parentNode))break;if(d.has(v.parentNode))break;d.add(v.parentNode),c.push(v.parentNode),v=v.parentNode}var g,f,_=[],m={},b=!1,w=!1;if(Xs(c,e=>{var t=on(e);if(Nr(e,"a")){var i=e.getAttribute("href");b=!!(t&&i&&gn(i))&&(h?St(i):i)}H(zr(e),"ph-no-capture")&&(w=!0),_.push(function(e,t,i,s,r){void 0===r&&(r=!1);var n=e.tagName.toLowerCase(),o={tag_name:n};Gr.indexOf(n)>-1&&!i&&(o.$el_text="a"===n.toLowerCase()||"button"===n.toLowerCase()?kl(1024,fn(e)):kl(1024,Vr(e)));var a=zr(e);a.length>0&&(o.classes=a.filter(function(e){return""!==e})),Xs(e.attributes,function(i){var n;if((!an(e)||-1!==["name","id","class","aria-label"].indexOf(i.name))&&(null==s||!s.includes(i.name))&&!t&&gn(i.value)&&(!ee(n=i.name)||"_ngcontent"!==n.substring(0,10)&&"_nghost"!==n.substring(0,7))){var a=i.value;"class"===i.name&&(a=Br(a).join(" ")),o["attr__"+i.name]=kl(1024,"href"===i.name&&r?St(a):a)}});for(var l=1,u=1,h=e;h=El(h);)l++,h.tagName===e.tagName&&u++;return o.nth_child=l,o.nth_of_type=u,o}(e,o,a,l,h));var s=function(e){if(!on(e))return{};var t={};return Xs(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&&gn(s)&&(t[i]=s)}}),t}(e);Js(m,s)}),w)return{props:{},explicitNoCapture:w};if(a||(_[0].$el_text=Nr(e,"a")||Nr(e,"button")?fn(e):Vr(e)),b){var x,k;_[0].attr__href=b;var E=null==(x=Rn(b))?void 0:x.host,S=null==s||null==(k=s.location)?void 0:k.host;E&&S&&E!==S&&(g=b)}return{props:Js({$event_type:n.type,$ce_version:1},u?{}:{$elements:_},{$elements_chain:(f=_,function(e){return e.map(e=>{var t,i,s="";if(e.tag_name&&(s+=e.tag_name),e.attr_class)for(var r of(e.attr_class.sort(),e.attr_class))s+="."+r.replace(/"/g,"");var n=y({},e.text?{text:e.text}:{},{"nth-child":null!==(t=e.nth_child)&&void 0!==t?t:0,"nth-of-type":null!==(i=e.nth_of_type)&&void 0!==i?i:0},e.href?{href:e.href}:{},e.attr_id?{attr_id:e.attr_id}:{},e.attributes),o={};return Qs(n).sort((e,t)=>e[0].localeCompare(t[0])).forEach(e=>{var t=e[1];return o[mn(e[0].toString())]=mn(t.toString())}),(s+=":")+Qs(o).map(e=>e[0]+'="'+e[1]+'"').join("")}).join(";")}(function(e){return e.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:yn(e),attr_id:e.attr__id,nth_child:e.nth_child,nth_of_type:e.nth_of_type,attributes:{}};return Qs(e).filter(e=>0===e[0].indexOf("attr__")).forEach(e=>s.attributes[e[0]]=e[1]),s})}(f)))},null!=(i=_[0])&&i.$el_text?{$el_text:null==(r=_[0])?void 0:r.$el_text}:{},g&&"click"===n.type?{$external_click_url:g}:{},m)}}(r,{e:e,maskAllElementAttributes:this.instance.config.mask_all_element_attributes,maskAllText:this.instance.config.mask_all_text,elementAttributeIgnoreList:this.Di.element_attribute_ignorelist,elementsChainAsString:this.gh,disableCaptureUrlHashes:this.instance.config.disable_capture_url_hashes}),a=o.props;if(o.explicitNoCapture)return!1;var l=this.getElementSelectors(r);if(l&&l.length>0&&(a.$element_selectors=l),t===wl){var u,h=Ur(null==s||null==(u=s.getSelection())?void 0:u.toString()),c=e.type||"clipboard";if(!h)return!1;a.$selected_content=h,a.$copy_type=c}return this.instance.capture(t,a),!0}}}isBrowserSupported(){return X(null==o?void 0:o.querySelectorAll)}},historyAutocapture:class{constructor(e){var t;this._instance=e,this._h=(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&&(Ii.info("History API monitoring enabled, starting..."),this.monitorHistoryChanges())}stop(){this.wh&&this.wh(),this.wh=void 0,Ii.info("History API monitoring stopped")}monitorHistoryChanges(){s&&s.history&&(this.kh("pushState"),this.kh("replaceState"),this.Sh())}kh(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 Pl;var s={next:e[t]},r=i(function(){for(var e=arguments.length,t=new Array(e),i=0;e>i;i++)t[i]=arguments[i];return s.next.apply(this,t)});return X(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];X(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 Pl}}(s.history,e,t=>
vendor: 26,036 bytes, line 1
1function(s,r,n){t.call(this,s,r,n),i.xh(e)})}}xh(e){try{var t,i=null==s||null==(t=s.location)?void 0:t.pathname;if(!i)return;i!==this._h&&this.isEnabled&&this._instance.capture(Vs,{navigation_type:e}),this._h=i}catch(s){Ii.error("Error capturing "+e+" pageview",s)}}Sh(){if(!this.wh){var e=()=>{this.xh("popstate")};rr(s,"popstate",e),this.wh=()=>{s&&s.removeEventListener("popstate",e)}}}},heatmaps:class{get Di(){return this.instance.config}constructor(e){var t;this.Ch=!1,this.dh=!1,this.Th=null,this.instance=e,this.Ch=!(null==(t=this.instance.persistence)||!t.props[Bi]),this.rageclicks=new bl(e.config.rageclick)}initialize(){this.startIfEnabled()}get flushIntervalMilliseconds(){var e=5e3;return J(this.Di.capture_heatmaps)&&this.Di.capture_heatmaps.flush_interval_milliseconds&&(e=this.Di.capture_heatmaps.flush_interval_milliseconds),e}get isEnabled(){return se(this.Di.capture_heatmaps)?se(this.Di.enable_heatmaps)?this.Ch:this.Di.enable_heatmaps:!1!==this.Di.capture_heatmaps}startIfEnabled(){if(this.isEnabled){if(this.dh)return;Al.info("starting..."),this.Mh(),this.It()}else{var e;clearInterval(null!==(e=this.Th)&&void 0!==e?e:void 0),this.Eh(),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({[Bi]:i}),this.Ch=i,this.startIfEnabled()}}}getAndClearBuffer(){var e=this.ft;return this.ft=void 0,e}Ih(e){Ll(e.originalEvent)&&this.bi(e.originalEvent,"deadclick")}It(){this.Th&&clearInterval(this.Th),this.Th="visible"===(null==o?void 0:o.visibilityState)?setInterval(this.ga.bind(this),this.flushIntervalMilliseconds):null}Mh(){s&&o&&(this.Rh=this.ga.bind(this),rr(s,Us,this.Rh),this.Ph=e=>this.bi(e||(null==s?void 0:s.event)),rr(o,"click",this.Ph,{capture:!0}),this.Ah=e=>this.Fh(e||(null==s?void 0:s.event)),rr(o,"mousemove",this.Ah,{capture:!0}),this.Oh=new kn(this.instance,wn,this.Ih.bind(this)),this.Oh.startIfEnabledOrStop(),this.Lh=this.It.bind(this),rr(o,zs,this.Lh),this.dh=!0)}Eh(){var e;s&&o&&(this.Rh&&s.removeEventListener(Us,this.Rh),this.Ph&&o.removeEventListener("click",this.Ph,{capture:!0}),this.Ah&&o.removeEventListener("mousemove",this.Ah,{capture:!0}),this.Lh&&o.removeEventListener(zs,this.Lh),clearTimeout(this.$h),null==(e=this.Oh)||e.stop(),this.dh=!1)}Dh(e,t){var i=this.instance.scrollManager.scrollY(),r=this.instance.scrollManager.scrollX(),n=this.instance.scrollManager.scrollElement(),o=function(e,t,i){for(var r=e;r&&Lr(r)&&!Nr(r,"body");){if(r===i)return!1;var n=void 0;try{var o,a,l;n=null==(o=null!==(a=null==(l=r.ownerDocument)?void 0:l.defaultView)&&void 0!==a?a:s)?void 0:o.getComputedStyle(r).position}catch(s){return!1}if(H(t,n))return!0;r=Kr(r)}return!1}(Wr(e),["fixed","sticky"],n);return{x:e.clientX+(o?0:r),y:e.clientY+(o?0:i),target_fixed:o,type:t}}bi(e,t){var i;if(void 0===t&&(t="click"),!Ar(e.target)&&Ll(e)){var s=this.Dh(e,t);null!=(i=this.rageclicks)&&i.isRageClick(e.clientX,e.clientY,(new Date).getTime())&&sn(Wr(e),this.instance.config.rageclick)&&this.$n(y({},s,{type:"rageclick"})),this.$n(s)}}Fh(e){!Ar(e.target)&&Ll(e)&&(clearTimeout(this.$h),this.$h=setTimeout(()=>{this.$n(this.Dh(e,"mousemove"))},500))}$n(e){if(s){var t=this.Di.disable_capture_url_hashes?St(s.location.href):s.location.href,i=this.Di.custom_personal_data_properties,r=this.Di.mask_personal_data_properties?[...Bn,...i||[]]:[],n=An(t,r,zn);this.ft=this.ft||{},this.ft[n]||(this.ft[n]=[]),this.ft[n].push(e)}}ga(){this.ft&&!Q(this.ft)&&this.instance.capture("$$heatmap",{$heatmap_data:this.getAndClearBuffer()})}},deadClicksAutocapture:kn,webVitalsAutocapture:class{constructor(e){var t;this.Ch=!1,this.dh=!1,this.ft={navigationKey:void 0,url:void 0,metrics:[],firstMetricTimestamp:void 0},this.Nh=()=>{clearTimeout(this.qh),this.qh=void 0,0!==this.ft.metrics.length&&(this._instance.capture("$web_vitals",y({$current_url:this.ft.url},this.ft.metrics.reduce((e,t)=>y({},e,{["$web_vitals_"+t.name+"_event"]:y({},t),["$web_vitals_"+t.name+"_value"]:t.value}),{}))),this.ft={navigationKey:void 0,url:void 0,metrics:[],firstMetricTimestamp:void 0})},this.jh=e=>{var t;if(this.ft=this.ft||{navigationKey:void 0,url:void 0,metrics:[],firstMetricTimestamp:void 0},se(null==e?void 0:e.name)||se(null==e?void 0:e.value))Fl.error("Invalid metric received",e);else{var i="string"==typeof e.navigationURL?e.navigationURL:void 0,s=this.Bh(i);if(!Z(s)){var r=re(e.navigationId)||"string"==typeof e.navigationId?"navigation:"+e.navigationId:"url:"+s;if(!this.Hh||this.Hh>e.value){this.ft.navigationKey!==r&&(this.Nh(),this.qh=setTimeout(this.Nh,this.flushToCaptureTimeoutMs)),Z(this.ft.navigationKey)&&(this.ft.navigationKey=r,this.ft.url=s),this.ft.firstMetricTimestamp=Z(this.ft.firstMetricTimestamp)?Date.now():this.ft.firstMetricTimestamp,e.attribution&&e.attribution.interactionTargetElement&&(e.attribution.interactionTargetElement=void 0);var n=null==(t=this._instance.sessionManager)?void 0:t.checkAndGetSessionAndWindowId(!0),o=y({},e,i?{navigationURL:s}:{},{$current_url:s,timestamp:Date.now()});Z(n)||(o.$session_id=n.sessionId,o.$window_id=n.windowId),this.ft.metrics.push(o),this.ft.metrics.length===this.allowedMetrics.length&&this.Nh()}else Fl.error("Ignoring metric with value >= "+this.Hh,e)}}},this.Uh=()=>{if(!this.dh){var e,t,i,s,r=g.__PosthogExtensions__,n=null==r?void 0:r.postHogWebVitalsCallbacksByFlavor,o=(null==n?void 0:n[this.zh])||("web-vitals"===this.zh&&Z(n)?null==r?void 0:r.postHogWebVitalsCallbacks:void 0);if(Z(o)||(e=o.onLCP,t=o.onCLS,i=o.onFCP,s=o.onINP),e&&t&&i&&s){var a={reportSoftNavs:this.useSoftNavs};this.allowedMetrics.indexOf("LCP")>-1&&e(this.jh.bind(this),a),this.allowedMetrics.indexOf("CLS")>-1&&t(this.jh.bind(this),a),this.allowedMetrics.indexOf("FCP")>-1&&i(this.jh.bind(this),a),this.allowedMetrics.indexOf("INP")>-1&&s(this.jh.bind(this),a),this.dh=!0}else Fl.error("web vitals callbacks not loaded - not starting")}},this._instance=e,this.Ch=!(null==(t=this._instance.persistence)||!t.props[Vi]),this.startIfEnabled()}get Wh(){return this._instance.config.capture_performance}get allowedMetrics(){var e,t,i=J(this.Wh)?null==(e=this.Wh)?void 0:e.web_vitals_allowed_metrics:void 0;return se(i)?(null==(t=this._instance.persistence)?void 0:t.props[Yi])||["CLS","FCP","INP","LCP"]:i}get flushToCaptureTimeoutMs(){return(J(this.Wh)?this.Wh.web_vitals_delayed_flush_ms:void 0)||5e3}get useAttribution(){var e=J(this.Wh)?this.Wh.web_vitals_attribution:void 0;return null!=e&&e}get useSoftNavs(){var e=J(this.Wh)?this.Wh.__preview_web_vitals_soft_navs:void 0;return null!=e&&e}get Hh(){var e=J(this.Wh)&&re(this.Wh.__web_vitals_max_value)?this.Wh.__web_vitals_max_value:$l;return e>0&&6e4>=e?$l:e}get isEnabled(){var e=null==a?void 0:a.protocol;if("http:"!==e&&"https:"!==e)return Fl.info("Web Vitals are disabled on non-http/https protocols"),!1;var t=J(this.Wh)?this.Wh.web_vitals:oe(this.Wh)?this.Wh:void 0;return oe(t)?t:this.Ch}startIfEnabled(){this.isEnabled&&!this.dh&&(Fl.info("enabled, starting..."),this.Xn(this.Uh))}onRemoteConfig(e){if(e.ok){var t=e.config;if("capturePerformance"in t){var i=J(t.capturePerformance)&&!!t.capturePerformance.web_vitals,s=J(t.capturePerformance)?t.capturePerformance.web_vitals_allowed_metrics:void 0;this._instance.persistence&&(this._instance.persistence.register({[Vi]:i}),this._instance.persistence.register({[Yi]:s})),this.Ch=i,this.startIfEnabled()}}}get zh(){return this.useSoftNavs?this.useAttribution?"web-vitals-with-attribution-soft-navs":"web-vitals-soft-navs":this.useAttribution?"web-vitals-with-attribution":"web-vitals"}Xn(e){var t=g.__PosthogExtensions__,i=this.zh,s=null==t?void 0:t.postHogWebVitalsCallbacksByFlavor;null!=s&&s[i]||"web-vitals"===i&&Z(s)&&null!=t&&t.postHogWebVitalsCallbacks?e():null==t||null==t.loadExternalDependency||t.loadExternalDependency(this._instance,i,t=>{t?Fl.error("failed to load script",t):e()})}Bh(e){var t=e||(null==s?void 0:s.location.href);if(t){var i=this._instance.config.disable_capture_url_hashes?St(t):t,r=this._instance.config.custom_personal_data_properties,n=this._instance.config.mask_personal_data_properties?[...Bn,...r||[]]:[];return An(i,n,zn)}Fl.error("Could not determine current URL")}}},bu={exceptionObserver:class{constructor(e){var t;this.Uh=()=>{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.Vh&&this.Di.capture_unhandled_errors&&(this.Vh=t(this.captureException.bind(this))),!this.Gh&&this.Di.capture_unhandled_rejections&&(this.Gh=i(this.captureException.bind(this))),!this.Zh&&this.Di.capture_console_errors&&(this.Zh=r(this.captureException.bind(this)))}catch(s){Sl.error("failed to start",s),this.Qh()}}},this._instance=e,this.Jh=!(null==(t=this._instance.persistence)||!t.props[Hi]),this.oe=new me(y({},function(e){var t,i,s,r;return void 0===e&&(e={}),{refillRate:null!==(t=null!==(i=e.exceptionRateLimiterRefillRate)&&void 0!==i?i:e.__exceptionRateLimiterRefillRate)&&void 0!==t?t:1,bucketSize:null!==(s=null!==(r=e.exceptionRateLimiterBucketSize)&&void 0!==r?r:e.__exceptionRateLimiterBucketSize)&&void 0!==s?s:10}}(this._instance.config.error_tracking),{refillInterval:1e4,I:Sl})),this.Di=this.Kh(),this.startIfEnabledOrStop()}Kh(){var e=this._instance.config.capture_exceptions,t={capture_unhandled_errors:!1,capture_unhandled_rejections:!1,capture_console_errors:!1};return J(e)?t=y({},t,e):(Z(e)?this.Jh:e)&&(t=y({},t,{capture_unhandled_errors:!0,capture_unhandled_rejections:!0})),t}get isEnabled(){return this.Di.capture_console_errors||this.Di.capture_unhandled_errors||this.Di.capture_unhandled_rejections}startIfEnabledOrStop(){this.isEnabled?(Sl.info("enabled"),this.Qh(),this.Xn(this.Uh)):this.Qh()}Xn(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 Sl.error("failed to load script",t);e()})}Qh(){var e,t,i;null==(e=this.Vh)||e.call(this),this.Vh=void 0,null==(t=this.Gh)||t.call(this),this.Gh=void 0,null==(i=this.Zh)||i.call(this),this.Zh=void 0}onRemoteConfig(e){if(e.ok){var t=e.config;"autocaptureExceptions"in t&&(this.Jh=!!t.autocaptureExceptions||!1,this._instance.persistence&&this._instance.persistence.register({[Hi]:this.Jh}),this.Di=this.Kh(),this.startIfEnabledOrStop())}}onConfigChange(){this.Di=this.Kh()}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.oe.consumeRateLimit(r)?Sl.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.Yh=[],this.Xh=new Xt([new li,new mi,new hi,new ui,new fi,new gi,new di,new _i],function(e){for(var t=arguments.length,i=new Array(t>1?t-1:0),s=1;t>s;s++)i[s-1]=arguments[s];return function(t,s){void 0===s&&(s=0);for(var r=[],n=t.split("\n"),o=s;n.length>o;o++){var a=n[o];if(1024>=a.length){var l=ai.test(a)?a.replace(ai,"$1"):a;if(!l.match(/\S*Error: /)){for(var u of i){var h=u(l,e);if(h){r.push(h);break}}if(r.length>=50)break}}}return function(e){if(!e.length)return[];var t=Array.from(e);return t.reverse(),t.slice(0,50).map(e=>{return y({},e,{filename:e.filename||(i=t,i[i.length-1]||{}).filename,function:e.function||Jt});var i})}(r)}}("web:javascript",si,oi)),this._instance=e,this.Yh=null!==(t=null==(i=this._instance.persistence)?void 0:i.get_property(zi))&&void 0!==t?t:[],this.td=ki(this.ed()),this.rd=new Ei(this.td)}onConfigChange(){this.td=ki(this.ed()),this.rd.setConfig(this.td)}onRemoteConfig(e){var t,i,s;if(e.ok){var r=e.config;if("errorTracking"in r){var n=null!==(t=null==(i=r.errorTracking)?void 0:i.suppressionRules)&&void 0!==t?t:[],o=null==(s=r.errorTracking)?void 0:s.captureExtensionExceptions;this.Yh=n,this._instance.persistence&&this._instance.persistence.register({[zi]:this.Yh,[Ui]:o})}}}get nd(){var e,t=!!this._instance.get_property(Ui),i=this._instance.config.error_tracking.captureExtensionExceptions;return null!==(e=null!=i?i:t)&&void 0!==e&&e}buildProperties(e,t){return this.Xh.buildFromUnknown(e,{syntheticException:null==t?void 0:t.syntheticException,mechanism:{handled:null==t?void 0:t.handled}})}addExceptionStep(e,t){if(this.td.enabled)try{if(!ee(e)||0===e.trim().length)return void ou.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)=>wi.has(s)?(t.push(s),i):(i[s]=e[s],i),{}),droppedKeys:t}}(this.sd(t)),s=i.sanitizedProperties,r=i.droppedKeys;r.length>0&&ou.warn("Ignoring reserved exception step fields",{droppedKeys:r}),this.rd.add(y({[yi]:e,[bi]:(new Date).toISOString()},s))}catch(e){ou.error("Failed to add exception step. Ignoring breadcrumb.",e)}}sendExceptionEvent(e){try{var t=e.$exception_list;if(this.ad(t)){if(this.od(t))return this.ld("Exception dropped: matched a suppression rule"),void ou.info("Skipping exception capture because a suppression rule matched");if(!this.nd&&this.ud(t))return this.ld("Exception dropped: thrown by a browser extension"),void ou.info("Skipping exception capture because it was thrown by an extension");if(!this._instance.config.error_tracking.__capturePostHogExceptions&&this.hd(t))return this.ld("Exception dropped: thrown by the PostHog SDK"),void ou.info("Skipping exception capture because it was thrown by the PostHog SDK")}var i=this.td.enabled&&se(e.$exception_steps)?this.dd(e):e,s="string"==typeof(n=globalThis._posthogReleaseId)&&n.length>0?n:void 0;s&&(i.$release_id=s);try{var r=this._instance.capture("$exception",i,{_noTruncate:!0,_batchKey:"exceptionEvent",Jo:!0});return r&&this.rd.clear(),r}catch(e){return ou.error("Failed to capture exception event. Dropping this exception.",e),void this.rd.clear()}}catch(e){return void ou.error("Failed to process exception event. Ignoring this exception.",e)}var n}dd(e){try{var t=this.rd.getAttachable();return 0===t.length?e:y({},e,{$exception_steps:t})}catch(t){return ou.error("Failed to read buffered exception steps. Capturing exception without steps.",t),e}}ld(e){this.td.enabled&&this.rd.add({[yi]:e,[bi]:(new Date).toISOString()})}sd(e){return J(e)?y({},e):{}}ed(){var e,t;return null!==(e=null==(t=this._instance.config.error_tracking)?void 0:t.exception_steps)&&void 0!==e?e:{}}od(e){if(0===e.length)return!1;try{var t=e.reduce((e,t)=>{var i=t.type,s=t.value;return ee(i)&&i.length>0&&e.$exception_types.push(i),ee(s)&&s.length>0&&e.$exception_values.push(s),e},{$exception_types:[],$exception_values:[]});return this.Yh.some(e=>{var i=e.values.map(e=>{var i=Na[e.operator],s=t[e.key];if(!i||!s)return!1;var r=K(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 ou.warn("Failed to evaluate suppression rules. Capturing the exception.",e),!1}}ud(e){return e.flatMap(e=>{var t,i;return null!==(t=null==(i=e.stacktrace)?void 0:i.frames)&&void 0!==t?t:[]}).some(e=>{var t=e.filename;return!!t&&au.some(e=>t.startsWith(e))})}hd(e){if(e.length>0){var t,i,s,r,n=null!==(t=null==(i=e[0].stacktrace)?void 0:i.frames)&&void 0!==t?t:[],o=n[n.length-1];return null!==(s=null==o||null==(r=o.filename)?void 0:r.includes("posthog.com/static"))&&void 0!==s&&s}return!1}ad(e){return!se(e)&&K(e)}}},wu=y({productTours:class{get Ta(){return this._instance.persistence}constructor(e){this.vd=null,this.fd=null,this._instance=e}initialize(){this.loadIfEnabled()}onRemoteConfig(e){if(e.ok){var t=e.config;if("productTours"in t){var i,s;if(this.Ta&&this.Ta.register({[Gi]:!!t.productTours}),!jl(this._instance))return!this.vd&&se(null==(i=this.Ta)?void 0:i.props[bs])||Nl.info("product tours disabled; stopping and clearing cached tours"),null==(s=this.vd)||s.stop(),this.vd=null,void this.clearCache();this.loadIfEnabled()}}}loadIfEnabled(){!this.vd&&jl(this._instance)&&this.Xn(()=>this.pd())}Xn(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?Nl.error("Could not load product tours script",t):e()})}pd(){var e;!this.vd&&null!=(e=g.__PosthogExtensions__)&&e.generateProductTours&&(this.vd=g.__PosthogExtensions__.generateProductTours(this._instance,!0))}getProductTours(e,t){if(void 0===t&&(t=!1),!K(this.fd)||t){var i=this.Ta;if(i){var s=i.props[bs];if(K(s)&&!t)return this.fd=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(jl(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||Nl.warn(r):Nl.error(r),void e([],{isLoaded:!1,error:r})}var n=K(t.json.product_tours)?t.json.product_tours:[];this.fd=n,i&&i.register({[bs]:n}),e(n,{isLoaded:!0})}else e([],{isLoaded:!0})}})}else e(this.fd,{isLoaded:!0})}getActiveProductTours(e){se(this.vd)?e([],{isLoaded:!1,error:"Product tours not loaded"}):this.vd.getActiveProductTours(e)}showProductTour(e){var t;null==(t=this.vd)||t.showTourById(e)}previewTour(e){this.vd?this.vd.previewTour(e):this.Xn(()=>{var t;this.pd(),null==(t=this.vd)||t.previewTour(e)})}dismissProductTour(){var e;null==(e=this.vd)||e.dismissTour("user_clicked_skip")}nextStep(){var e;null==(e=this.vd)||e.nextStep()}previousStep(){var e;null==(e=this.vd)||e.previousStep()}clearCache(){var e;this.fd=null,null==(e=this.Ta)||e.unregister(bs)}resetTour(e){var t;null==(t=this.vd)||t.resetTour(e)}resetAllTours(){var e;null==(e=this.vd)||e.resetAllTours()}cancelPendingTour(e){var t;null==(t=this.vd)||t.cancelPendingTour(e)}}},_u),xu={siteApps:class{constructor(e){this.gd=0,this._instance=e,this.md=[],this.apps={}}get isEnabled(){return!!this._instance.config.opt_in_site_apps}yd(e,t){if(t){var i=this.globalsForEvent(t);this.md.push(i),this.md.length>1e3&&(this.md=this.md.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.yd.bind(this));this.bd=()=>{e(),this.md=[],this.bd=void 0}}}globalsForEvent(e){var t,i,s,r,n,o,a;if(!e)throw new Error("Event payload is required");var l={},u=this._instance.get_property("$groups")||[],h=this._instance.get_property("$stored_group_properties")||{};for(var c of Object.entries(h)){var d=c[0];l[d]={id:u[d],type:d,properties:c[1]}}var v=e.$set_once,p=e.$set;return{event:y({},b(e,ql),{properties:y({},e.properties,p?{$set:y({},null!==(t=null==(i=e.properties)?void 0:i.$set)&&void 0!==t?t:{},p)}:{},v?{$set_once:y({},null!==(s=null==(r=e.properties)?void 0:r.$set_once)&&void 0!==s?s:{},v)}:{}),elements_chain:null!==(n=null==(o=e.properties)?void 0:o.$elements_chain)&&void 0!==n?n:"",distinct_id:null==(a=e.properties)?void 0:a.distinct_id}),person:{properties:this._instance.get_property("$stored_person_properties")},groups:l}}_d(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)||(Bl.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)||(Bl.error("prepare_external_dependency_script returned null"),null):e}wd(){var e,t,i,s,r,n,a,l;if(!this._instance.config.prepare_external_dependency_stylesheet&&!this._instance.config.prepare_external_dependency_script)return()=>{};var u=null==o?void 0:o.defaultView,h=null==u||null==(e=u.Node)?void 0:e.prototype;if(!u||!h)return()=>{};if(this.gd++,this.kd)return this.Sd();var c=[],d=this,v=new WeakSet,p=(e,t,i)=>{if(null!=e&&e[t]){var s=e[t];e[t]=i(s),c.push(()=>{e[t]=s})}},g=e=>{if(v.has(e))return e;var t=d._d(e);return t&&v.add(t),t},f=e=>e.map(e=>"string"==typeof e?e:g(e)).filter(e=>!ie(e));return p(h,"appendChild",e=>function(t){var i=g(t);return i?e.call(this,i):t}),p(h,"insertBefore",e=>function(t,i){var s=g(t);return s?e.call(this,s,i):t}),p(h,"replaceChild",e=>function(t,i){var s=g(t);return s?e.call(this,s,i):i}),[null==(t=u.Element)?void 0:t.prototype,null==(i=u.Document)?void 0:i.prototype,null==(s=u.DocumentFragment)?void 0:s.prototype].forEach(e=>{p(e,"append",e=>function(){for(var t=arguments.length,i=new Array(t),s=0;t>s;s++)i[s]=arguments[s];return e.apply(this,f(i))}),p(e,"prepend",e=>function(){for(var t=arguments.length,i=new Array(t),s=0;t>s;s++)i[s]=arguments[s];return e.apply(this,f(i))})}),[null==(r=u.Element)?void 0:r.prototype,null==(n=u.CharacterData)?void 0:n.prototype,null==(a=u.DocumentType)?void 0:a.prototype].forEach(e=>{p(e,"before",e=>function(){for(var t=arguments.length,i=new Array(t),s=0;t>s;s++)i[s]=arguments[s];return e.apply(this,f(i))}),p(e,"after",e=>function(){for(var t=arguments.length,i=new Array(t),s=0;t>s;s++)i[s]=arguments[s];return e.apply(this,f(i))}),p(e,"replaceWith",e=>function(){for(var t=arguments.length,i=new Array(t),s=0;t>s;s++)i[s]=arguments[s];var r=f(i);return i.length&&!r.length?void 0:e.apply(this,r)})}),p(null==(l=u.Element)?void 0:l.prototype,"insertAdjacentElement",e=>function(t,i){var s=g(i);return s?e.call(this,t,s):null}),this.kd=()=>{c.forEach(e=>e()),this.kd=void 0},this.Sd()}Sd(){var e=!1;return()=>{var t;e||(e=!0,this.gd--,0===this.gd&&(null==(t=this.kd)||t.call(this)))}}xd(e,t){void 0===t&&(t=!0);var i=this.wd();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.md.length&&(Bl.info("Processing "+this.md.length+" events for site app with id "+e.id),this.md.forEach(e=>this.xd(()=>null==t.processEvent?void 0:t.processEvent(e))),t.processedBuffer=!0),Object.values(this.apps).every(e=>e.processedBuffer||e.errored)&&(null==(i=this.bd)||i.call(this))},s=!1,r=r=>{t.errored=!r,t.loaded=!0,Bl.info("Site app with id "+e.id+" "+(r?"loaded":"errored")),s&&i()};try{var n=this.xd(t=>e.init({posthog:this._instance,callback(e){t(),r(e)}}),!1).processEvent;n&&(t.processEvent=n),s=!0}catch(t){Bl.error(Hl+e.id,t),r(!1)}if(s&&t.loaded)try{i()}catch(i){Bl.error("Error while processing buffered events PostHog app with config id "+e.id,i),t.errored=!0}}Cd(){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)}Td(e){var t=this;if(0!==Object.keys(this.apps).length){var i=this.globalsForEvent(e),s=function(s){try{t.xd(()=>null==s.processEvent?void 0:s.processEvent(i))}catch(t){Bl.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.Cd(),void this._instance.on("eventCaptured",e=>this.Td(e))):void Bl.error('PostHog site apps are disabled. Enable the "opt_in_site_apps" config to proceed.');if(null==(i=this.bd)||i.call(this),e.ok){var n=e.config;if(null!=(s=n.siteApps)&&s.length)if(this.isEnabled){var o=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 Bl.error(Hl+t,e)})};for(var a of n.siteApps)o()}else Bl.error('PostHog site apps are disabled. Enable the "opt_in_site_apps" config to proceed.')}}}},ku={tracingHeaders:class{constructor(e){this.Md=void 0,this.Ed=void 0,this.Id=void 0,this.Uh=()=>{var e,t,i=this.Rd();i?(Z(this.Md)&&(this.Md=null==(e=g.__PosthogExtensions__)||null==(e=e.tracingHeadersPatchFns)?void 0:e._patchXHR(i,()=>this._instance.get_distinct_id(),this._instance.sessionManager)),Z(this.Ed)&&(this.Ed=null==(t=g.__PosthogExtensions__)||null==(t=t.tracingHeadersPatchFns)?void 0:t._patchFetch(i,()=>this._instance.get_distinct_id(),this._instance.sessionManager))):this.Qh()},this._instance=e}initialize(){this.startIfEnabledOrStop()}Xn(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 Il.error("failed to load script",t);e()})}Pd(){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}Rd(){var e=this.Pd();return K(e)?(K(this.Id)?this.Id.splice(0,this.Id.length,...e):this.Id=[...e],e.length>0?this.Id:void 0):(K(this.Id)&&this.Id.splice(0),this.Id=e||void 0,this.Id)}Qh(){var e,t;null==(e=this.Md)||e.call(this),null==(t=this.Ed)||t.call(this),this.Md=void 0,this.Ed=void 0}startIfEnabledOrStop(){this.Rd()?this.Xn(this.Uh):this.Qh()}}},Eu=y({surveys:class{get Di(){return this._instance.config}constructor(e){this.Ad=void 0,this._surveyManager=null,this.Fd=!1,this.Od=[],this.Ld=null,this.$d=null,this._instance=e,this._surveyEventReceiver=null}initialize(){this.loadIfEnabled()}onRemoteConfig(e){if(!this.Di.disable_surveys){if(!e.ok)return Ga.warn("Remote config unavailable. Not loading surveys.");var t=e.config.surveys;if(se(t))return Ga.warn("Flags not loaded yet. Not loading surveys.");var i=K(t);this.Ad=i?t.length>0:t,Ga.info("flags response received, isSurveysEnabled: "+this.Ad),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(Ya)||null!=s&&s.startsWith("inProgressSurvey_"))&&t.push(s)}
1t.forEach(e=>localStorage.removeItem(e))}catch(e){}}loadIfEnabled(){if(!this._surveyManager)if(this.Fd)Ga.info("Already initializing surveys, skipping...");else if(this.Di.disable_surveys)Ga.info(Yl);else if(this.Di.cookieless_mode&&this._instance.consent.isOptedOut())Ga.info("Not loading surveys in cookieless mode without consent.");else{var e=null==g?void 0:g.__PosthogExtensions__;if(e){if(!Z(this.Ad)||this.Di.advanced_enable_surveys){var t=this.Ad||this.Di.advanced_enable_surveys;this.Fd=!0;try{var i=e.generateSurveys;if(i)return void this.Dd(i,t);var s=e.loadExternalDependency;if(!s)return void this.Nd(Ls);s(this._instance,"surveys",i=>{i||!e.generateSurveys?this.Nd("Could not load surveys script",i):this.Dd(e.generateSurveys,t)})}catch(e){throw this.Nd("Error initializing surveys",e),e}finally{this.Fd=!1}}}else Ga.error("PostHog Extensions not found.")}}Dd(e,t){this._surveyManager=e(this._instance,t),this._surveyEventReceiver=new Wl(this._instance),Ga.info("Surveys loaded successfully"),this.qd({isLoaded:!0})}Nd(e,t){Ga.error(e,t),this.qd({isLoaded:!1,error:e})}onSurveysLoaded(e){return this.Od.push(e),this._surveyManager&&this.qd({isLoaded:!0}),()=>{this.Od=this.Od.filter(t=>t!==e)}}getSurveys(e,t){if(void 0===t&&(t=!1),this.Di.disable_surveys)return Ga.info(Yl),e([]);var i,s=this._instance.get_property(gs);if(s&&!t)return e(s,{isLoaded:!0}),void(this.jd()&&this.getSurveys(()=>{},!0));"undefined"!=typeof Promise&&this.Ld?this.Ld.then(t=>e(t.surveys,t.context)):("undefined"!=typeof Promise&&(this.Ld=new Promise(e=>{i=e})),this._instance._send_request({url:this._instance.requestRouter.endpointFor("api","/api/surveys/?token="+this.Di.token),method:"GET",timestampMode:"query",timeout:this.Di.surveys_request_timeout_ms,callback:t=>{var s;this.Ld=null;var r=t.statusCode;if(200!==r||!t.json){var n="Surveys API could not be loaded, status: "+r;0!==r?Ga.error(n):t.error||Ga.warn(n),this.$d=Date.now();var o={isLoaded:!1,error:n};return e([],o),void(null==i||i({surveys:[],context:o}))}this.$d=null;var a,l=t.json.surveys||[],u=l.filter(e=>function(e){return!(!e.start_date||e.end_date)}(e)&&(Wa(e)||function(e){var t;return!(null==(t=e.conditions)||null==(t=t.actions)||null==(t=t.values)||!t.length)}(e)));u.length>0&&(null==(a=this._surveyEventReceiver)||a.register(u)),null==(s=this._instance.persistence)||s.register({[gs]:l,[fs]:Date.now()});var h={isLoaded:!0};e(l,h),null==i||i({surveys:l,context:h})}}))}jd(){return this.Bd()&&!this.Ld&&!this.Hd()}Bd(){var e=this._instance.get_property(fs);return re(e)&&Date.now()-e>3e5}Hd(){return re(this.$d)&&3e5>Date.now()-this.$d}markSurveyAsSeen(e,t){var i,s={id:e,current_iteration:null!==(i=null==t?void 0:t.iteration)&&void 0!==i?i:null};Ka(s);try{localStorage.setItem("lastSeenSurveyDate",(new Date).toISOString())}catch(e){}}qd(e){for(var t of this.Od)try{if(!e.isLoaded)return t([],e);this.getSurveys(t)}catch(e){Ga.error("Error in survey callback",e)}}getActiveMatchingSurveys(e,t){if(void 0===t&&(t=!1),!se(this._surveyManager))return this._surveyManager.getActiveMatchingSurveys(e,t);Ga.warn("init was not called")}Ud(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}zd(e){if(se(this._surveyManager))return{eligible:!1,reason:Gl};var t="string"==typeof e?this.Ud(e):e;return t?this._surveyManager.checkSurveyEligibility(t):{eligible:!1,reason:"Survey not found"}}Wd(e){if(se(this._surveyManager))return{eligible:!1,reason:Gl};var t="string"==typeof e?this.Ud(e):e;return t?this._surveyManager.checkSurveyRenderability(t):{eligible:!1,reason:"Survey not found"}}canRenderSurvey(e){if(se(this._surveyManager))return Ga.warn("init was not called"),{visible:!1,disabledReason:Gl};var t=this.Wd(e);return{visible:t.eligible,disabledReason:t.reason}}canRenderSurveyAsync(e,t){return se(this._surveyManager)?(Ga.warn("init was not called"),Promise.resolve({visible:!1,disabledReason:Gl})):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.Wd(r);i({visible:n.eligible,disabledReason:n.reason})}else i({visible:!1,disabledReason:"Survey not found"})},t)})}renderSurvey(e,t,i){var s;if(se(this._surveyManager))Ga.warn("init was not called");else{var r="string"==typeof e?this.Ud(e):e;if(null!=r&&r.id)if(Xa.includes(r.type)){var n=null==o?void 0:o.querySelector(t);if(n)return null!=(s=r.appearance)&&s.surveyPopupDelaySeconds?(Ga.info("Rendering survey "+r.id+" with delay of "+r.appearance.surveyPopupDelaySeconds+" seconds"),void setTimeout(()=>{var e,t;Ga.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),Ga.info("Survey "+r.id+" rendered")},1e3*r.appearance.surveyPopupDelaySeconds)):void this._surveyManager.renderSurvey(r,n,i);Ga.warn("Survey element not found")}else Ga.warn("Surveys of type "+r.type+" cannot be rendered in the app");else Ga.warn("Survey not found")}}displaySurvey(e,t){var i;if(se(this._surveyManager))Ga.warn("init was not called");else{var s=this.Ud(e);if(s){var r=s;if(null!=(i=s.appearance)&&i.surveyPopupDelaySeconds&&t.ignoreDelay&&(r=y({},s,{appearance:y({},s.appearance,{surveyPopupDelaySeconds:0})}
vendor: 4,289 bytes, line 1
1)),t.displayType!==xo&&t.initialResponses&&Ga.warn("initialResponses is only supported for popover surveys. prefill will not be applied."),!1===t.ignoreConditions){var n=this.zd(s);if(!n.eligible)return void Ga.warn("Survey is not eligible to be displayed: ",n.reason)}t.displayType!==ko?this._surveyManager.handlePopoverSurvey(r,t):this.renderSurvey(r,t.selector,t.properties)}else Ga.warn("Survey not found")}}cancelPendingSurvey(e){se(this._surveyManager)?Ga.warn("init was not called"):this._surveyManager.cancelSurvey(e)}handlePageUnload(){var e;null==(e=this._surveyManager)||null==e.handlePageUnload||e.handlePageUnload()}}},_u),Su={toolbar:class{constructor(e){this.instance=e}Vd(e){g.ph_toolbar_state=e}Gd(){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),nr(this.instance.config))return!1;if(!s||!o)return!1;e=null!=e?e:s.location,i=null!=i?i:s.history;try{if(!t){try{s.localStorage.setItem("test","test"),s.localStorage.removeItem("test")}catch(s){return!1}t=null==s?void 0:s.localStorage}var r,n=Kl||Ln(e.hash,"__posthog")||Ln(e.hash,"state"),a=n?Zs(()=>JSON.parse(atob(decodeURIComponent(n))))||Zs(()=>JSON.parse(decodeURIComponent(n))):null;return a&&"ph_authorize"===a.action?((r=a).source="url",r&&Object.keys(r).length>0&&(a.desiredHash?e.hash=a.desiredHash:i?i.replaceState(i.state,"",e.pathname+e.search):e.hash="")):((r=JSON.parse(t.getItem(Xl)||"{}")).source="localstorage",delete r.userIntent),!(!r.token||this.instance.config.token!==r.token||(this.loadToolbar(r),0))}catch(s){return!1}}Zd(e){var t=g.ph_load_toolbar||g.ph_load_editor;!se(t)&&X(t)?t(e,this.instance):Jl.warn("No toolbar load function found")}loadToolbar(e){var t=!(null==o||!o.getElementById(Or));if(!s||t)return!1;var i="custom"===this.instance.requestRouter.region&&this.instance.config.advanced_disable_toolbar_metrics,r=y({token:this.instance.config.token},e,{apiURL:this.instance.requestRouter.endpointFor("ui")},i?{instrument:!1}:{});if(s.localStorage.setItem(Xl,JSON.stringify(y({},r,{source:void 0}))),2===this.Gd())this.Zd(r);else if(0===this.Gd()){var n;this.Vd(1),null==(n=g.__PosthogExtensions__)||null==n.loadExternalDependency||n.loadExternalDependency(this.instance,"toolbar",e=>{if(e)return Jl.error("[Toolbar] Failed to load",e),void this.Vd(0);this.Vd(2),this.Zd(r)}),rr(s,"turbolinks:load",()=>{this.Vd(0),this.loadToolbar(r)})}return!0}Qd(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)}}},Pu=y({experiments:hu},_u),Iu={conversations:class{constructor(e){this.Jd=void 0,this._conversationsManager=null,this.Kd=!1,this.Me=null,this.Yd=!1,this._instance=e}initialize(){this.loadIfEnabled()}onRemoteConfig(e){if(!this._instance.config.disable_conversations&&(this.Xd=e.ok,e.ok)){var t=e.config.conversations;se(t)||(oe(t)?this.Jd=t:(this.Jd=t.enabled,this.Me=t),this.loadIfEnabled())}}reset(){var e;null==(e=this._conversationsManager)||e.reset(),this._conversationsManager=null,this.Jd=void 0,this.Me=null,this.Xd=void 0,this.Yd=!1}loadIfEnabled(){if(!(this._conversationsManager||this.Kd||this._instance.config.disable_conversations||nr(this._instance.config)||this._instance.config.cookieless_mode&&this._instance.consent.isOptedOut())){var e=null==g?void 0:g.__PosthogExtensions__;if(e&&!Z(this.Jd)&&this.Jd)if(this.Me&&this.Me.token){this.Kd=!0;try{var t=e.initConversations;if(t)return this.tv(t),void(this.Kd=!1);var i=e.loadExternalDependency;if(!i)return void this.ev(Ls);i(this._instance,"conversations",t=>{t||!e.initConversations?this.ev("Could not load conversations script",t):this.tv(e.initConversations),this.Kd=!1})}catch(e){this.ev("Error initializing conversations",e),this.Kd=!1}}else cu.error("Conversations enabled but missing token in remote config.")}}tv(e){if(this.Me)try{this._conversationsManager=e(this.Me,this._instance),this.Yd=!1,cu.info("Conversations loaded successfully")}catch(e){this.ev("Error completing conversations initialization",e)}else cu.error("Cannot complete initialization: remote config is null")}ev(e,t){cu.error(e,t),this._conversationsManager=null,this.Kd=!1,this.Yd=!0}
1show(){this._conversationsManager?this._conversationsManager.show():cu.warn("Conversations not loaded yet.")}hide(){this._conversationsManager&&this._conversationsManager.hide()}isAvailable(){return!0===this.Jd&&!ie(this._conversationsManager)}getUnavailableReason(){return this.isAvailable()?null:this._instance.config.disable_conversations?"disabled_by_config":nr(this._instance.config)?"disabled_for_toolbar":this._instance.config.cookieless_mode&&this._instance.consent.isOptedOut()?"consent_opted_out":!1===this.Xd?"remote_config_failed":Z(this.Jd)?this.Xd?"disabled_in_project":"remote_config_pending":this.Jd?se(this.Me)||!this.Me.token?"missing_token":null!=g&&g.__PosthogExtensions__?this.Kd?"initializing":this.Yd?"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):(cu.warn(du),null)})()}getMessages(e,t){var i=this;return m(function*(){return i._conversationsManager?i._conversationsManager.getMessages(e,t):(cu.warn(du),null)})()}markAsRead(e){var t=this;return m(function*(){return t._conversationsManager?t._conversationsManager.markAsRead(e):(cu.warn(du),null)})()}getTickets(e){var t=this;return m(function*(){return t._conversationsManager?t._conversationsManager.getTickets(e):(cu.warn(du),null)})()}requestRestoreLink(e){var t=this;return m(function*(){return t._conversationsManager?t._conversationsManager.requestRestoreLink(e):(cu.warn(du),null)})()}restoreFromToken(e){var t=this;return m(function*(){return t._conversationsManager?t._conversationsManager.restoreFromToken(e):(cu.warn(du),null)})()}restoreFromUrlToken(){var e=this;return m(function*(){return e._conversationsManager?e._conversationsManager.restoreFromUrlToken():(cu.warn(du),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}sl(){var e;null==(e=this._conversationsManager)||e.setIdentity()}al(){var e;null==(e=this._conversationsManager)||e.clearIdentity()}}},Fu={logs:class{constructor(e){var t,i=this;this.iv=!1,this.rv=!1,this.I=Fi("[logs]"),this.nv=y({},this.I,{error(){for(var e=arguments.length,t=new Array(e),s=0;e>s;s++)t[s]=arguments[s];t.some(fu)||i.I.error(...t)}}),this.na=[],this.sv=[],this.Tu=0,this.av=()=>{var e,t;this.Tu=0,null==(e=this.ov)||e.onReconnect(),null==(t=this.lv)||t.onReconnect()},this._instance=e,this._instance&&null!=(t=this._instance.config.logs)&&t.captureConsoleLogs&&(this.iv=!0),s&&rr(s,"online",this.av)}uv(e,t,i,s){var r,n=function(e,t){var i,s,r,n,o,a,l,u=null!==(i=null==e?void 0:e.flushIntervalMs)&&void 0!==i?i:3e3,h=null!==(s=null==e?void 0:e.maxBufferSize)&&void 0!==s?s:100,c=null!=t&&t.consoleCapture?void 0:null!==(r=null==e?void 0:e.maxLogsPerInterval)&&void 0!==r?r:1e3,d=Z(c)?Math.max(h,2048):Math.max(h,c),v=null==e?void 0:e.resourceAttributes;return{serviceName:null!==(n=null!==(o=null==v?void 0:v["service.name"])&&void 0!==o?o:null==e?void 0:e.serviceName)&&void 0!==n?n:null==t?void 0:t.serviceNameDefault,serviceVersion:null!==(a=null==v?void 0:v["service.version"])&&void 0!==a?a:null==e?void 0:e.serviceVersion,environment:null!==(l=null==v?void 0:v["deployment.environment"])&&void 0!==l?l:null==e?void 0:e.environment,resourceAttributes:v,beforeSend:null==e?void 0:e.beforeSend,flushIntervalMs:u,maxBufferSize:h,maxQueueSize:d,maxBatchRecordsPerPost:100,rateCapWindowMs:u,maxLogsPerInterval:c,backgroundFlushBudgetMs:0,terminationFlushBudgetMs:0}}(null==(r=this._instance)||null==(r=r.config)?void 0:r.logs,i);return[new Bt(this.hv(e,t),n,this.nv,()=>this.dv(),e=>e(),void 0,s),n]}vv(){var e,t=null==(e=this._instance)||null==(e=e.config)?void 0:e.logs;if(!this.ov||this.fv!==t){var i;null==(i=this.ov)||i.reset(),this.fv=t;var s=this.uv(()=>this.na,e=>{this.na=e});this.ov=s[0],this.pv=s[1]}return this.ov}gv(){var e,t=null==(e=this._instance)||null==(e=e.config)?void 0:e.logs;if(!this.lv||this.mv!==t){var i;null==(i=this.lv)||i.reset(),this.mv=t;var s=this.uv(()=>this.sv,e=>{this.sv=e},{serviceNameDefault:"posthog-browser-logs",consoleCapture:!0},vu);this.lv=s[0],this.yv=s[1]}return this.lv}initialize(){this.loadIfEnabled()}onRemoteConfig(e){var t;if(e.ok){var i=null==(t=e.config.logs)?void 0:t.captureConsoleLogs;!se(i)&&i&&(this.iv=!0,this.loadIfEnabled())}}reset(){var e,t;this.na=[],null==(e=this.ov)||e.reset(),this.sv=[],null==(t=this.lv)||t.reset(),this.Tu=0}captureLog(e){this.vv().captureLog(e)}ci(e){this.gv().captureLog(e)}get logger(){return this.bv||(this.bv={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.bv}flushLogs(e){e?this._v(e):(this.ov&&this.ov.flush().catch(e=>this.wv(e)),this.lv&&this.lv.flush().catch(e=>this.wv(e)))}wv(e){fu(e)||this.I.error("PostHog logs flush failed:",e)}loadIfEnabled(){if(this.iv&&!this.rv){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.I.error("Could not load logs script",t):(e.logs.initializeLogs(this._instance),this.rv=!0)}):this.I.error(Ls)}else this.I.error("PostHog Extensions not found.")}}hv(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){var s;e===P.LogsQueue&&t(null!==(s=i)&&void 0!==s?s:[])},Cn:e=>this.Cn(e),getLibraryId:()=>f.LIB_NAME,getLibraryVersion:()=>f.LIB_VERSION}}Cn(e){return new Promise(t=>{if(Nn(this.Tu,3))t({kind:"fatal",error:gu(void 0,"logs endpoint is unreachable, dropping batch")});else{var i=!1,s=e=>{i||(i=!0,clearTimeout(r),t(e))},r=setTimeout(()=>{this.I.warn("Logs request timed out before receiving a response"),s({kind:"retry-later",error:gu(void 0,"logs request timed out")})},9e4);this._instance._send_request({method:"POST",url:this.Sv(),data:e,compression:"best-available",batchKey:"logs",fireCallbackOnDrop:!0,callback:e=>{var t=e.statusCode;if(this.xv(t),t>=200&&300>t)s({kind:"ok"});else if(413===t)s({kind:"too-large"});else if(0!==t&&429!==t&&500>t)s({kind:"fatal",error:new Error("logs request failed with status "+t)});else{var i;0===t?(e.error||this.I.warn("Logs request failed before receiving an HTTP response"),s({kind:"retry-later",error:gu(e.error,"logs request failed before receiving an HTTP response")})):s({kind:"retry-later",error:null!==(i=e.error)&&void 0!==i?i:new Error("logs request failed with status "+t)})}}})}})}xv(e){(0!==e||this._instance.__loaded)&&(this.Tu=jn(e,this.Tu,3,()=>this.I.warn("Log requests are failing before receiving an HTTP response; this can happen due to network issues, CORS, browser blocking, or ad blockers. Stopped sending logs; will try again when connectivity changes.")))}_v(e){this.na.length>0&&this.Cv(e,this.na,this.pv,f.LIB_NAME,e=>{this.na=e}),this.sv.length>0&&this.Cv(e,this.sv,this.yv,vu,e=>{this.sv=e})}Cv(e,t,i,s,r){if(0!==t.length){var n=t.map(e=>e.record);r([]);var o=qt(n,jt(i,f.LIB_NAME,f.LIB_VERSION),s,f.LIB_VERSION);this._instance._send_request({method:"POST",url:this.Sv(),data:o,compression:"best-available",batchKey:"logs",transport:e})}}Sv(){return this._instance.requestRouter.endpointFor("api","/i/v1/logs")+"?token="+encodeURIComponent(this._instance.config.token)}dv(){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,se(r)||(t.sessionStartTimestamp=r),se(n)||(t.lastActivityTimestamp=n)}if(null!=g&&null!=(e=g.location)&&e.href&&(t.currentUrl=this._instance.config.disable_capture_url_hashes?St(g.location.href):g.location.href),this._instance.featureFlags){var o=this._instance.featureFlags.getFlags();o&&o.length>0&&(t.activeFeatureFlags=o)}return t}}},$u={metrics:class{constructor(e){this.I=Fi("[metrics]"),this._instance=e}initialize(){}vv(){var e,t,i=null==(e=this._instance)||null==(e=e.config)?void 0:e.metrics;return this.ov&&this.fv===i||(null==(t=this.ov)||t.reset(),this.fv=i,this.ov=new Vt(this.hv(),function(e){var t,i,s,r,n,o=null==e?void 0:e.resourceAttributes;return{serviceName:null!==(t=null==o?void 0:o["service.name"])&&void 0!==t?t:null==e?void 0:e.serviceName,serviceVersion:null!==(i=null==o?void 0:o["service.version"])&&void 0!==i?i:null==e?void 0:e.serviceVersion,environment:null!==(s=null==o?void 0:o["deployment.environment"])&&void 0!==s?s:null==e?void 0:e.environment,resourceAttributes:o,beforeSend:null==e?void 0:e.beforeSend,flushIntervalMs:null!==(r=null==e?void 0:e.flushIntervalMs)&&void 0!==r?r:1e4,maxSeriesPerFlush:null!==(n=null==e?void 0:e.maxSeriesPerFlush)&&void 0!==n?n:1e3}}(i),this.I)),this.ov}count(e,t,i){void 0===t&&(t=1),this.vv().count(e,t,i)}
1gauge(e,t,i){this.vv().gauge(e,t,i)}histogram(e,t,i){this.vv().histogram(e,t,i)}flush(e){if(!this.ov)return Promise.resolve();if(e){var t=this.ov.drainWindow();return t&&this.Bn(t,e),Promise.resolve()}return this.ov.flush().catch(e=>this.I.error("PostHog metrics flush failed:",e))}reset(){var e;null==(e=this.ov)||e.reset()}hv(){var e=this._instance,t=this;return{get isDisabled(){return!1},get optedOut(){return!e.is_capturing()},Bn:e=>t.Bn(e),getLibraryId:()=>f.LIB_NAME,getLibraryVersion:()=>f.LIB_VERSION}}Bn(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:new Error("metrics request timed out")}),9e4);this._instance._send_request(y({method:"POST",url:this.Tv(),data:e,compression:"best-available",batchKey:"metrics"},t&&{transport:t},{fireCallbackOnDrop:!0,callback(e){var t=e.statusCode;if(t>=200&&300>t)r({kind:"ok"});else if(413===t)r({kind:"too-large"});else if(0!==t&&429!==t&&500>t)r({kind:"fatal",error:new Error("metrics request failed with status "+t)});else{var i;r({kind:"retry-later",error:null!==(i=e.error)&&void 0!==i?i:new Error("metrics request failed with status "+t)})}}}))})}Tv(){return this._instance.requestRouter.endpointFor("api","/i/v1/metrics")+"?token="+encodeURIComponent(this._instance.config.token)}}},Cu=y({},_u,mu,yu,bu,wu,xu,Eu,ku,Su,Pu,Iu,Fu,$u);yl.__defaultExtensionClasses=y({},Cu);var Tu=function(){f.SDK_DIST_CHANNEL="npm";var e=nl[vl]=new yl;return function(){function e(){e.done||(e.done=!0,pl=!1,Xs(nl,function(e){e._dom_loaded()}))}null!=o&&o.addEventListener?"complete"===o.readyState?e():rr(o,"DOMContentLoaded",e,{capture:!1}):s&&Ii.error("Browser doesn't support `document.addEventListener` so PostHog couldn't be initialized")}(),e}()}}]); 2//# sourceMappingURL=086d643d-5da339abfb9a20629ecf.js.map
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.