posthog-js 1.419.0 → 1.419.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,2 +1,2 @@
1
- var t="undefined"!=typeof window?window:void 0,e="undefined"!=typeof globalThis?globalThis:t,i=null==e?void 0:e.navigator,r=null==e?void 0:e.document,n=null==e?void 0:e.location,s=null==e?void 0:e.fetch,o=null!=e&&e.XMLHttpRequest&&"withCredentials"in new e.XMLHttpRequest?e.XMLHttpRequest:void 0,a=null==e?void 0:e.AbortController,l=null==e?void 0:e.CompressionStream,u=null==i?void 0:i.userAgent;function h(){return!(!t||!1===t.navigator.onLine)}var d="undefined"!=typeof globalThis?globalThis:t;d&&"undefined"==typeof self&&(d.self=d),d&&"undefined"==typeof File&&(d.File=function(){});var v=null!=t?t:{};function c(t,e,i,r,n,s,o){try{var a=t[s](o),l=a.value}catch(t){return void i(t)}a.done?e(l):Promise.resolve(l).then(r,n)}function f(t){return function(){var e=this,i=arguments;return new Promise((function(r,n){var s=t.apply(e,i);function o(t){c(s,r,n,o,a,"next",t)}function a(t){c(s,r,n,o,a,"throw",t)}o(void 0)}))}}function p(){return p=Object.assign?Object.assign.bind():function(t){for(var e=1;arguments.length>e;e++){var i=arguments[e];for(var r in i)({}).hasOwnProperty.call(i,r)&&(t[r]=i[r])}return t},p.apply(null,arguments)}function g(t,e){if(null==t)return{};var i={};for(var r in t)if({}.hasOwnProperty.call(t,r)){if(-1!==e.indexOf(r))continue;i[r]=t[r]}return i}var m={DomContentLoaded:0,Load:1,FullSnapshot:2,IncrementalSnapshot:3,Meta:4,Custom:5,Plugin:6},y={Mutation:0,MouseMove:1,MouseInteraction:2,Scroll:3,ViewportResize:4,Input:5,TouchMove:6,MediaInteraction:7,StyleSheetRule:8,CanvasMutation:9,Font:10,Log:11,Drag:12,StyleDeclaration:13,Selection:14,AdoptedStyleSheet:15,CustomElement:16},_=t=>{if("string"!=typeof t)return t;try{return JSON.parse(t)}catch(e){return t}};function b(t){return"string"==typeof t||t}function w(t){return"string"==typeof t?t:void 0}var k,S=["$feature_flag","$feature_flag_response","$feature_flag_has_experiment","$feature_flag_id","$feature_flag_version","$feature_flag_reason","$feature_flag_request_id","$feature_flag_evaluated_at","$feature_flag_error","locally_evaluated","$groups","$process_person_profile","$geoip_disable","$current_url","$pathname","$referring_domain","utm_source","utm_medium","utm_campaign","utm_content","utm_term","gad_source","mc_cid","gclid","gclsrc","dclid","gbraid","wbraid","fbclid","msclkid","twclid","li_fat_id","igshid","ttclid","rdt_cid","epik","qclid","sccid","irclid","_kx","$session_id","$window_id","$lib","$lib_version","$device_id","$is_server"],x=function(t){return t.AnonymousId="anonymous_id",t.DistinctId="distinct_id",t.Props="props",t.EnablePersonProcessing="enable_person_processing",t.PersonMode="person_mode",t.FeatureFlagDetails="feature_flag_details",t.FeatureFlags="feature_flags",t.FeatureFlagPayloads="feature_flag_payloads",t.BootstrapFeatureFlagDetails="bootstrap_feature_flag_details",t.BootstrapFeatureFlags="bootstrap_feature_flags",t.BootstrapFeatureFlagPayloads="bootstrap_feature_flag_payloads",t.OverrideFeatureFlags="override_feature_flags",t.Queue="queue",t.AiQueue="ai_queue",t.AiCaptureQueue="ai_capture_queue",t.LogsQueue="logs_queue",t.OptedOut="opted_out",t.SessionId="session_id",t.SessionStartTimestamp="session_start_timestamp",t.SessionLastTimestamp="session_timestamp",t.PersonProperties="person_properties",t.GroupProperties="group_properties",t.InstalledAppBuild="installed_app_build",t.InstalledAppVersion="installed_app_version",t.SessionReplay="session_replay",t.PushRegistered="push_registered",t.SessionReplayEventTriggerActivatedSession="session_replay_event_trigger_activated_session",t.SurveyLastSeenDate="survey_last_seen_date",t.SurveysSeen="surveys_seen",t.Surveys="surveys",t.RemoteConfig="remote_config",t.FlagsEndpointWasHit="flags_endpoint_was_hit",t.DeviceId="device_id",t}({}),C=function(t){return t.GZipJS="gzip-js",t.Base64="base64",t}({}),T="min_length",E="max_length",M=["$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"],I=["token"],R="NativeGzipValidationError",P=t=>t.length>=2&&31===t[0]&&139===t[1],A=(t,e)=>t===C.GZipJS||e===C.GZipJS||"gzip"===e,O=t=>!(!t||"object"!=typeof t)&&"NotReadableError"===("name"in t?String(t.name):""),F=t=>{if(!t||"object"!=typeof t)return!1;var e="name"in t?String(t.name):"";return O(t)||e===R},L=t=>{var e=new Error("Native gzip produced invalid output: "+t);throw e.name=R,e},D=function(){var t=f((function*(t,e){18>t.size&&L("too-short");var i=new Uint8Array(yield t.slice(0,10).arrayBuffer());P(i)&&8===i[2]||L("invalid-header");var r=new DataView(yield t.slice(t.size-8).arrayBuffer());r.getUint32(0,!0)!==(t=>{for(var e=(()=>{if(k)return k;k=[];for(var t=0;256>t;t++){for(var e=t,i=0;8>i;i++)e=1&e?3988292384^e>>>1:e>>>1;k[t]=e>>>0}return k})(),i=4294967295,r=0;t.length>r;r++)i=e[255&(i^t[r])]^i>>>8;return(4294967295^i)>>>0})(e)&&L("invalid-crc");var n=e.length>>>0;r.getUint32(4,!0)!==n&&L("invalid-size")}));return function(e,i){return t.apply(this,arguments)}}();function N(t,e,i){return q.apply(this,arguments)}function q(){return q=f((function*(t,e,i){void 0===e&&(e=!0);try{var r=(new TextEncoder).encode(t),n=new globalThis.CompressionStream("gzip"),s=n.writable.getWriter(),o=s.write(r).then((()=>s.close())).catch(function(){var t=f((function*(t){try{yield s.abort(t)}catch(t){}throw t}));return function(e){return t.apply(this,arguments)}}()),a=new Response(n.readable).blob(),l=(yield Promise.all([a,o]))[0];return yield D(l,r),l}catch(t){if(null!=i&&i.rethrow)throw t;return e&&console.error("Failed to gzip compress data",t),null}})),q.apply(this,arguments)}var j=20,B=1e3,U=1e4,H="[Circular]",z="[Truncated]",W="[Unserializable]",V="[Function]";function G(t){for(var e="",i=0;t.length>i;i++){var r=t.charCodeAt(i);if(55296>r||r>56319)e+=56320>r||r>57343?t[i]:"�";else{var n=t.charCodeAt(i+1);56320>n||n>57343?e+="�":(e+=t[i]+t[i+1],i++)}}return e}var Z=["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"],Q=function(t,e){if(void 0===e&&(e=[]),!t)return!1;var i=t.toLowerCase();return Z.concat(e).some((t=>{var e=t.toLowerCase();return-1!==i.indexOf(e)}))};function J(t,e){return-1!==t.indexOf(e)}var K=function(t){return t.trim()},Y=function(t){return t.replace(/^\$/,"")};function X(t){var e,i=[];return null!==(e=JSON.stringify(t,(function(t,e){if("bigint"==typeof e)return e.toString();if("function"!=typeof e&&"symbol"!=typeof e){if(e instanceof Error)return{name:e.name,message:e.message,stack:e.stack};if(e&&"object"==typeof e){for(;i.length>0&&i[i.length-1]!==this;)i.pop();if(i.includes(e))return"[Circular]";i.push(e)}return e}})))&&void 0!==e?e:"null"}var tt=Object.prototype,et=tt.hasOwnProperty,it=tt.toString,rt=Array.isArray||function(t){return"[object Array]"===it.call(t)},nt=t=>"function"==typeof t,st=t=>t===Object(t)&&!rt(t),ot=t=>{if(st(t)){for(var e in t)if(et.call(t,e))return!1;return!0}return!1},at=t=>void 0===t,lt=t=>"[object String]"==it.call(t),ut=t=>lt(t)&&0===t.trim().length,ht=t=>null===t,dt=t=>at(t)||ht(t),vt=t=>"[object Number]"==it.call(t)&&t==t,ct=t=>vt(t)&&t>0,ft=t=>"[object Boolean]"===it.call(t),pt=t=>t instanceof FormData,gt=t=>J(M,t),mt=t=>J(I,t);function yt(t){return null===t||"object"!=typeof t}function _t(t,e){return{}.toString.call(t)==="[object "+e+"]"}function bt(t){switch({}.toString.call(t)){case"[object Error]":case"[object Exception]":case"[object DOMException]":case"[object DOMError]":case"[object WebAssembly.Exception]":return!0;default:return kt(t,Error)}}function wt(t){return"undefined"!=typeof Event&&kt(t,Event)}function kt(t,e){try{return t instanceof e}catch(t){return!1}}var St=[!0,"true",1,"1","yes"],xt=t=>J(St,t),Ct=[!1,"false",0,"0","no"];function Tt(t,e,i,r,n){return e>i&&(r.warn("min cannot be greater than max."),e=i),vt(t)?t>i?(r.warn(" cannot be greater than max: "+i+". Using max value instead."),i):e>t?(r.warn(" cannot be less than min: "+e+". Using min value instead."),e):t:(r.warn(" must be a number. using max or fallback. max: "+i+", fallback: "+n),Tt(n||i,e,i,r))}class Et{constructor(t){this.k={},this.S=t.S,this.C=Tt(t.bucketSize,0,100,t.I),this.R=Tt(t.refillRate,0,this.C,t.I),this.A=Tt(t.refillInterval,0,864e5,t.I)}O(t,e){var i=Math.floor((e-t.lastAccess)/this.A);i>0&&(t.tokens=Math.min(t.tokens+i*this.R,this.C),t.lastAccess=t.lastAccess+i*this.A)}consumeRateLimit(t){var e,i=Date.now(),r=String(t),n=this.k[r];return n?this.O(n,i):this.k[r]=n={tokens:this.C,lastAccess:i},0===n.tokens||(n.tokens--,0===n.tokens&&(null==(e=this.S)||e.call(this,t)),0===n.tokens)}stop(){this.k={}}}var Mt="Mobile",It="iOS",Rt="Android",Pt="Tablet",At=Rt+" "+Pt,Ot="iPad",Ft="Apple",Lt=Ft+" Watch",$t="Safari",Dt="BlackBerry",Nt="Samsung",qt=Nt+"Browser",jt=Nt+" Internet",Bt="Chrome",Ut=Bt+" OS",Ht=Bt+" "+It,zt="Internet Explorer",Wt=zt+" "+Mt,Vt="Opera",Gt=Vt+" Mini",Zt="Edge",Qt="Microsoft "+Zt,Jt="Firefox",Kt=Jt+" "+It,Yt="Nintendo",Xt="PlayStation",te="Xbox",ee=Rt+" "+Mt,ie=Mt+" "+$t,re="Windows",ne=re+" Phone",se="Nokia",oe="Ouya",ae="Generic",le=ae+" "+Mt.toLowerCase(),ue=ae+" "+Pt.toLowerCase(),he="Konqueror",de="Oculus Browser",ve="Vivaldi",ce="Yandex",fe="Whale",pe="DuckDuckGo",ge="Pale Moon",me="Waterfox",ye="Brave",_e="Google Search App",be="(\\d+(\\.\\d+)?)",we=new RegExp("Version/"+be),ke=new RegExp(te,"i"),Se=new RegExp(Xt+" \\w+","i"),xe=new RegExp(Yt+" \\w+","i"),Ce=new RegExp(Dt+"|PlayBook|BB10","i"),Te={"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"},Ee=function(t,e,i,r){e=e||"";var n=function(t){return null!=t&&t.brave?ye:null}(i);return n||(null!=r&&r.detectGoogleSearchApp&&J(t,"GSA/")?_e:J(t," OPR/")&&J(t,"Mini")?Gt:J(t," OPR/")?Vt:Ce.test(t)?Dt:J(t,"IE"+Mt)||J(t,"WPDesktop")?Wt:J(t,"OculusBrowser")?de:J(t,qt)?jt:J(t,Zt)||J(t,"Edg/")?Qt:J(t,ve+"/")?ve:J(t,"YaBrowser/")?ce:J(t,fe+"/")?fe:J(t,pe+"/")||J(t,"Ddg/")?pe:J(t,"FBIOS")?"Facebook "+Mt:J(t,"UCWEB")||J(t,"UCBrowser")?"UC Browser":J(t,"CriOS")?Ht:J(t,"CrMo")||J(t,Bt)?Bt:J(t,Rt)&&J(t,$t)?ee:J(t,"FxiOS")?Kt:J(t.toLowerCase(),he.toLowerCase())?he:J(t,ye+"/")?ye:((t,e)=>e&&J(e,Ft)||function(t){return J(t,$t)&&!J(t,Bt)&&!J(t,Rt)}(t))(t,e)?J(t,Mt)?ie:$t:J(t,"PaleMoon/")?ge:J(t,me+"/")?me:J(t,Jt)?Jt:J(t,"MSIE")||J(t,"Trident/")?zt:J(t,"Gecko")?Jt:"")},Me={[Wt]:[new RegExp("rv:"+be)],[Qt]:[new RegExp(Zt+"?\\/"+be)],[Bt]:[new RegExp("("+Bt+"|CrMo)\\/"+be)],[Ht]:[new RegExp("CriOS\\/"+be)],"UC Browser":[new RegExp("(UCBrowser|UCWEB)\\/"+be)],[$t]:[we],[ie]:[we],[Vt]:[new RegExp("(Opera|OPR)\\/"+be)],[Jt]:[new RegExp(Jt+"\\/"+be)],[Kt]:[new RegExp("FxiOS\\/"+be)],[he]:[new RegExp("Konqueror[:/]?"+be,"i")],[Dt]:[new RegExp(Dt+" "+be),we],[ee]:[new RegExp("android\\s"+be,"i")],[jt]:[new RegExp(qt+"\\/"+be)],[de]:[new RegExp("OculusBrowser\\/"+be)],[ve]:[new RegExp(ve+"\\/"+be)],[ce]:[new RegExp("YaBrowser\\/"+be)],[fe]:[new RegExp(fe+"\\/"+be)],[ye]:[new RegExp(ye+"\\/"+be)],[pe]:[new RegExp("(DuckDuckGo|Ddg)\\/"+be)],[ge]:[new RegExp("PaleMoon\\/"+be)],[me]:[new RegExp(me+"\\/"+be)],[_e]:[new RegExp("GSA\\/"+be)],[zt]:[new RegExp("(rv:|MSIE )"+be)],Mozilla:[new RegExp("rv:"+be)]},Ie=function(t,e,i,r){var n=Ee(t,e,i,r),s=Me[n];if(at(s))return null;for(var o=0;s.length>o;o++){var a=t.match(s[o]);if(a)return parseFloat(a[a.length-2])}return null},Re=[[new RegExp(te+"; "+te+" (.*?)[);]","i"),t=>[te,t&&t[1]||""]],[new RegExp(Yt,"i"),[Yt,""]],[new RegExp(Xt,"i"),[Xt,""]],[Ce,[Dt,""]],[new RegExp(re,"i"),(t,e)=>{if(/Phone/.test(e)||/WPDesktop/.test(e))return[ne,""];if(new RegExp(Mt).test(e)&&!/IEMobile\b/.test(e))return[re+" "+Mt,""];var i=/Windows NT ([0-9.]+)/i.exec(e);if(i&&i[1]){var r=Te[i[1]]||"";return/arm/i.test(e)&&(r="RT"),[re,r]}return[re,""]}],[/((iPhone|iPad|iPod).*?OS (\d+)_(\d+)_?(\d+)?|iPhone)/,t=>t&&t[3]?[It,[t[3],t[4],t[5]||"0"].join(".")]:[It,""]],[/(watch.*\/(\d+\.\d+\.\d+)|watch os,(\d+\.\d+),)/i,t=>{var e="";return t&&t.length>=3&&(e=at(t[2])?t[3]:t[2]),["watchOS",e]}],[new RegExp("("+Rt+" (\\d+)\\.(\\d+)\\.?(\\d+)?|"+Rt+")","i"),t=>t&&t[2]?[Rt,[t[2],t[3],t[4]||"0"].join(".")]:[Rt,""]],[/Mac OS X (\d+)[_.](\d+)[_.]?(\d+)?/i,t=>{var e=["Mac OS X",""];return t&&t[1]&&(e[1]=[t[1],t[2],t[3]||"0"].join(".")),e}],[/Mac/i,["Mac OS X",""]],[/CrOS/,[Ut,""]],[/Linux|debian/i,["Linux",""]]],Pe=function(t){return xe.test(t)?Yt:Se.test(t)?Xt:ke.test(t)?te:new RegExp(oe,"i").test(t)?oe:new RegExp("("+ne+"|WPDesktop)","i").test(t)?ne:/iPad/.test(t)?Ot:/iPod/.test(t)?"iPod Touch":/iPhone/.test(t)?"iPhone":/(watch)(?: ?os[,/]|\d,\d\/)[\d.]+/i.test(t)?Lt:Ce.test(t)?Dt:/(kobo)\s(ereader|touch)/i.test(t)?"Kobo":new RegExp(se,"i").test(t)?se:/(kf[a-z]{2}wi|aeo[c-r]{2})( bui|\))/i.test(t)||/(kf[a-z]+)( bui|\)).+silk\//i.test(t)?"Kindle Fire":/(Android|ZTE)/i.test(t)?new RegExp(Mt).test(t)&&!/(9138B|TB782B|Nexus [97]|pixel c|HUAWEISHT|BTV|noble nook|smart ultra 6)/i.test(t)||/pixel[\daxl ]{1,6}/i.test(t)&&!/pixel c/i.test(t)||/(huaweimed-al00|tah-|APA|SM-G92|i980|zte|U304AA)/i.test(t)||/lmy47v/i.test(t)&&!/QTAQZ3/i.test(t)?Rt:At:new RegExp("(pda|"+Mt+")","i").test(t)?le:new RegExp(Pt,"i").test(t)&&!new RegExp(Pt+" pc","i").test(t)?ue:""},Ae=function(t,e){var i,r,n,s,o=Pe(t);return o===Ot||o===At||"Kobo"===o||"Kindle Fire"===o||o===ue?Pt:o===Yt||o===te||o===Xt||o===oe?"Console":o===Lt?"Wearable":o?Mt:"Android"===(null==e?void 0:e.userAgentDataPlatform)&&(null!==(i=null==e?void 0:e.maxTouchPoints)&&void 0!==i?i:0)>0?600>Math.min(null!==(r=null==e?void 0:e.screenWidth)&&void 0!==r?r:0,null!==(n=null==e?void 0:e.screenHeight)&&void 0!==n?n:0)/(null!==(s=null==e?void 0:e.devicePixelRatio)&&void 0!==s?s:1)?Mt:Pt:"Desktop"},Oe=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;function Fe(t,e){return"string"==typeof(i=t)&&Oe.test(i)?t:e();var i}function Le(t){return t?t.split("#")[0]:t}function $e(t,e){var i=setTimeout(t,e);return(null==i?void 0:i.unref)&&(null==i||i.unref()),i}function De(t,e,i){return Ne.apply(this,arguments)}function Ne(){return(Ne=f((function*(t,e,i){var r;try{return yield Promise.race([t,new Promise(((t,n)=>{r=$e((()=>{try{null==i||i(),t()}catch(t){n(t)}}),e)}))])}finally{clearTimeout(r)}}))).apply(this,arguments)}var qe={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}},je=qe.info,Be=0x8000000000000000,Ue={}.propertyIsEnumerable;function He(t,e){try{return Ve(t,e,{ancestors:new WeakSet,remainingNodes:U},0)}catch(t){return[]}}function ze(t,e,i,r){if(0>=i.remainingNodes)return{stringValue:z};if(i.remainingNodes--,ft(t))return{boolValue:t};if("number"==typeof t){if(!Number.isFinite(t))return{stringValue:String(t)};if(Number.isInteger(t)){if(Number.isSafeInteger(t))return{intValue:String(t)};if("undefined"==typeof BigInt)return{stringValue:String(t)};var n=BigInt(t).toString();return t>=Be||-Be>t?(null==e||e.debug("Attribute "+n+" is outside the int64 range; encoding it as a string"),{stringValue:n}):{intValue:n}}return{doubleValue:t}}if("string"==typeof t)return{stringValue:G(t)};if("function"==typeof t)return{stringValue:V};if("symbol"==typeof t)return{stringValue:String(t)};if("object"==typeof t&&null!==t){if(i.ancestors.has(t))return{stringValue:H};if(r>=j)return{stringValue:z};if(t instanceof Date){var s=t.getTime(),o=Number.isFinite(s)?t.toISOString():String(t);return{stringValue:"string"==typeof o?G(o):String(o)}}i.ancestors.add(t);try{try{var a=t.toJSON;if("function"==typeof a)return ze(a.call(t),e,i,r+1)}catch(t){}return rt(t)?{arrayValue:{values:We(t,e,i,r+1)}}:{kvlistValue:{values:Ve(t,e,i,r+1)}}}finally{i.ancestors.delete(t)}}return{stringValue:G(String(t))}}function We(t,e,i,r){for(var n=[],s=Math.min(t.length,B),o=0;s>o&&i.remainingNodes>0;o++)try{var a=o in t?t[o]:void 0;if(dt(a))continue;n.push(ze(a,e,i,r))}catch(t){n.push({stringValue:W})}return t.length>o&&n.push({stringValue:z}),n}function Ve(t,e,i,r){var n=[];for(var s in t)if(Ue.call(t,s)){if(n.length>=B||0>=i.remainingNodes){null==e||e.debug("Attributes truncated: the value exceeds the OTLP encoder budget");break}try{var o=t[s];if(ht(o)||at(o))continue;n.push({key:G(s),value:ze(o,e,i,r)})}catch(t){n.push({key:G(s),value:{stringValue:W}})}}return n}function Ge(t){try{return G(String(t))}catch(t){return W}}function Ze(t,e,i){var r=qe[t.level||"info"]||je,n=r.text,s=r.number,o=String(Date.now())+"000000",a={};e.distinctId&&(a.posthogDistinctId=e.distinctId),e.sessionId&&(a.sessionId=e.sessionId),e.windowId&&(a["window.id"]=e.windowId),dt(e.sessionStartTimestamp)||(a.sessionStartTimestamp=String(e.sessionStartTimestamp)),dt(e.lastActivityTimestamp)||(a.lastActivityTimestamp=String(e.lastActivityTimestamp)),e.currentUrl&&(a["url.full"]=e.currentUrl),e.screenName&&(a["screen.name"]=e.screenName),e.appState&&(a["app.state"]=e.appState),e.activeFeatureFlags&&e.activeFeatureFlags.length>0&&(a.feature_flags=e.activeFeatureFlags);var l=p({},a),u=t.attributes;if(u){var h=[];try{h=Object.keys(u)}catch(t){h=[]}for(var d of h){var v=void 0;try{v=u[d]}catch(t){v=W}Object.defineProperty(l,d,{value:v,enumerable:!0,writable:!0,configurable:!0})}}var c={timeUnixNano:o,observedTimeUnixNano:o,severityNumber:s,severityText:n,body:{stringValue:Ge(t.body)},attributes:He(l,i)};return t.trace_id&&(c.traceId=t.trace_id),t.span_id&&(c.spanId=t.span_id),at(t.trace_flags)||(c.flags=t.trace_flags),c}function Qe(t,e,i){return p({},t.resourceAttributes,{"service.name":t.serviceName||"unknown_service"},t.environment&&{"deployment.environment":t.environment},t.serviceVersion&&{"service.version":t.serviceVersion},{"telemetry.sdk.name":e,"telemetry.sdk.version":i})}function Je(t,e,i,r){return{resourceLogs:[{resource:{attributes:He(e)},scopeLogs:[{scope:{name:i,version:r},logRecords:t}]}]}}let Ke=class{constructor(t,e,i,r,n,s,o){var a;void 0===s&&(s=()=>Promise.resolve()),this._instance=t,this.qi=e,this.I=i,this.rn=r,this.nn=n,this.sn=s,this.an=o,this.ln=null,this.un=0,this.hn=0,this.dn=0,this.vn=0,this.cn=!1,this.fn=e.maxBufferSize,this.pn=Math.max(null!==(a=e.maxQueueSize)&&void 0!==a?a:e.maxBufferSize,e.maxBufferSize),this.gn=e.flushIntervalMs,this.mn=e.maxBatchRecordsPerPost,this.yn=e.rateCapWindowMs,this.bn=e.maxLogsPerInterval}reset(){this._n(),this.ln=null,this.dn=0,this.vn=0,this.cn=!1,this.un=0,this.hn=0,this.mn=this.qi.maxBatchRecordsPerPost}onReconnect(){this.hn=0,this.wn()}captureLog(t){if(!this._instance.isDisabled&&!this._instance.optedOut&&null!=t&&t.body){var e=this.kn(t);if(null!==e)if(e.body){if(this.Sn()){var i={record:Ze(e,this.rn(),this.I)};this.nn((()=>this.xn(i)))}}else this.I.info("Log was rejected in beforeSend function")}}kn(t){var e=this.qi.beforeSend;if(!e)return t;var i=rt(e)?e:[e],r=t;for(var n of i)try{var s=n(r);if(!s)return this.I.info("Log was rejected in beforeSend function"),null;r=s}catch(t){return this.I.error("Error in beforeSend function for log:",t),null}return r}Sn(){if(void 0===this.bn)return!0;var t=Date.now(),e=t-this.dn;return this.yn>e&&e>=0||(this.dn=t,this.vn=0,this.cn=!1),this.bn>this.vn?(this.vn++,!0):(this.cn||(this.I.warn("captureLog dropping logs: exceeded "+this.bn+" logs per "+this.yn+"ms"),this.cn=!0),!1)}flush(){var t=this;return f((function*(){if(!t._instance.isDisabled)return t.ln||(t.ln=t.Cn().finally((()=>{t.ln=null}))),t.ln}))()}Cn(){var t=this;return f((function*(){var e;t._n();var i=null!==(e=t._instance.getPersistedProperty(x.LogsQueue))&&void 0!==e?e:[];if(0!==i.length)for(var r=i.length,n=0;i.length>0&&r>n;){var s,o;t.un=0;var a=Math.min(i.length,t.mn),l=i.slice(0,a),u=l.map((t=>t.record)),h=Je(u,t.Tn(),null!==(s=t.an)&&void 0!==s?s:t._instance.getLibraryId(),t._instance.getLibraryVersion()),d=yield t._instance.Mn(h);if("too-large"===d.kind&&l.length>1)t.mn=Math.max(1,Math.floor(l.length/2)),t.I.warn("Received 413 when sending logs batch of size "+l.length+", reducing batch size to "+t.mn);else{if("retry-later"===d.kind)throw d.error;if("too-large"===d.kind?t.I.warn("Dropping a single log record after 413 with batch size 1 — the record is larger than the server cap and cannot be split further."):"ok"===d.kind&&t.qi.maxBatchRecordsPerPost>t.mn&&(t.mn=Math.min(t.qi.maxBatchRecordsPerPost,t.mn+1)),yield t.En(l.length),i=null!==(o=t._instance.getPersistedProperty(x.LogsQueue))&&void 0!==o?o:[],n+=l.length,"fatal"===d.kind)throw d.error}}}))()}En(t){var e=this;return f((function*(){var i,r=Math.max(0,t-e.un),n=null!==(i=e._instance.getPersistedProperty(x.LogsQueue))&&void 0!==i?i:[];e._instance.setPersistedProperty(x.LogsQueue,n.slice(r)),yield e.sn()}))()}Tn(){return Qe(this.qi,this._instance.getLibraryId(),this._instance.getLibraryVersion())}xn(t){var e;if(!this._instance.optedOut){var i=null!==(e=this._instance.getPersistedProperty(x.LogsQueue))&&void 0!==e?e:[];this.pn>i.length||(i.shift(),this.un++,this.I.info("Logs queue is full, dropping oldest record.")),i.push(t),this._instance.setPersistedProperty(x.LogsQueue,i),this.fn>i.length?this.In():this.wn()}}In(t){void 0===t&&(t=this.gn),this.Rn||(this.Rn=$e((()=>{this.Rn=void 0,this.wn()}),t))}Pn(){var t=Math.min(Math.max(0,this.hn-1),6);return this.gn*Math.pow(2,t)}An(){var t=this._instance.getPersistedProperty(x.LogsQueue);return!!t&&t.length>0}shutdown(t){var e=this;return f((function*(){e._n();var i=e.flush().catch((()=>{}));void 0!==t?yield De(i,t):yield i}))()}flushWithTimeout(t){var e=this;return f((function*(){var i=e.flush();yield De(i,t,(()=>{i.catch((()=>{}))}))}))()}wn(){this.flush().then((()=>{this.hn=0}),(t=>{this.hn++,this.I.error("PostHog logs flush failed:",t)})).finally((()=>{!this._instance.isDisabled&&this.An()&&this.In(this.Pn())}))}_n(){this.Rn&&(clearTimeout(this.Rn),this.Rn=void 0)}};var Ye=[0,5,10,25,50,75,100,250,500,750,1e3,2500,5e3,7500,1e4];function Xe(t){return String(t)+"000000"}function ti(t,e,i,r){var n="";return r&&(n=Object.keys(r).sort().map((t=>JSON.stringify(t)+":"+JSON.stringify(r[t]))).join(",")),t+"\0"+e+"\0"+(null!=i?i:"")+"\0"+n}let ei=class{constructor(t,e,i){this._instance=t,this.qi=e,this.I=i,this.Fn=new Map,this.ln=null,this.Ln=!1,this.On=new Map,this.Dn=new Set,this.$n=0}count(t,e,i){void 0===e&&(e=1),this.Nn({name:t,type:"count",value:e,unit:null==i?void 0:i.unit,attributes:null==i?void 0:i.attributes})}gauge(t,e,i){this.Nn({name:t,type:"gauge",value:e,unit:null==i?void 0:i.unit,attributes:null==i?void 0:i.attributes})}histogram(t,e,i){this.Nn({name:t,type:"histogram",value:e,unit:null==i?void 0:i.unit,attributes:null==i?void 0:i.attributes})}flush(){var t=this,e=this.ln,i=function(){var i=f((function*(){e&&(yield e.catch((()=>{}))),yield t.qn()}));return function(){return i.apply(this,arguments)}}(),r=i().finally((()=>{this.ln===r&&(this.ln=null)}));return this.ln=r,r}drainWindow(){if(0===this.Fn.size)return null;var t=this.Fn;return this.Fn=new Map,this.Ln=!1,this.On=new Map,this.Dn=new Set,this.jn(t)}reset(){this.$n++,this._n(),this.Fn=new Map,this.ln=null,this.Ln=!1,this.On=new Map,this.Dn=new Set}Nn(t){if(!this._instance.isDisabled&&!this._instance.optedOut){var e=this.kn(t);if(null!==e)if(e.name&&"string"==typeof e.name)if("number"==typeof e.value&&Number.isFinite(e.value))if("count"===e.type&&0>e.value)this.I.warn("Dropping count '"+e.name+"': counters are monotonic, value must be >= 0");else{var i,r;try{i=e.attributes?p({},e.attributes):void 0,r=ti(e.type,e.name,e.unit,i)}catch(t){return void this.I.warn("Dropping metric '"+e.name+"': attributes could not be serialized",t)}var n=this.Fn.get(r);if(!n){if(!this.Bn())return;n={name:e.name,type:e.type,unit:e.unit,attributes:i,windowStartMs:Date.now()},this.Fn.set(r,n)}var s=this.On.get(e.name);void 0===s?this.On.set(e.name,e.type):s===e.type||this.Dn.has(e.name)||(this.Dn.add(e.name),this.I.warn("Metric name '"+e.name+"' is already used as a "+s+"; recording it as a "+e.type+" too will blend both series in charts. Use a distinct name.")),this.Hn(n,e.value),this.In()}else this.I.warn("Dropping metric '"+e.name+"': value must be a finite number");else this.I.warn("Dropping metric with empty name")}}Bn(){return this.qi.maxSeriesPerFlush>this.Fn.size||(this.Ln||(this.Ln=!0,this.I.warn("Metric series cap reached ("+this.qi.maxSeriesPerFlush+" per flush window); dropping new series until the next flush. Reduce attribute cardinality.")),!1)}Hn(t,e){var i;switch(t.type){case"count":t.total=(null!==(i=t.total)&&void 0!==i?i:0)+e;break;case"gauge":t.last=e;break;case"histogram":t.hist||(t.hist={count:0,sum:0,min:e,max:e,bucketCounts:new Array(Ye.length+1).fill(0)});var r=t.hist;r.count+=1,r.sum+=e,r.min=Math.min(r.min,e),r.max=Math.max(r.max,e),r.bucketCounts[function(t,e){for(var i=0;e.length>i;i++)if(e[i]>=t)return i;return e.length}(e,Ye)]+=1}}kn(t){var e=this.qi.beforeSend;if(!e)return t;var i=rt(e)?e:[e],r=t;for(var n of i)try{var s=n(r);if(!s)return this.I.info("Metric was rejected in beforeSend function"),null;r=s}catch(t){return this.I.error("Error in beforeSend function for metric:",t),null}return r}In(){this.Rn||(this.Rn=$e((()=>{this.Rn=void 0,this.flush().catch((t=>{this.I.error("Metrics flush failed:",t)}))}),this.qi.flushIntervalMs))}_n(){this.Rn&&(clearTimeout(this.Rn),this.Rn=void 0)}qn(){var t=this;return f((function*(){if(0!==t.Fn.size){var e=t.Fn;t.Fn=new Map,t.Ln=!1,t.On=new Map,t.Dn=new Set;var i=t.$n,r=yield t._instance.Un(t.jn(e));if(i===t.$n)switch(r.kind){case"ok":return;case"retry-later":return t.zn(e),void t.In();case"too-large":return void t.I.warn("Metrics batch exceeded the server size limit and was dropped");case"fatal":return void t.I.error("Failed to send metrics batch:",r.error)}}}))()}jn(t){return e=this.Wn(t),i=function(t,e,i){return p({},t.resourceAttributes,{"service.name":t.serviceName||"unknown_service"},t.environment&&{"deployment.environment":t.environment},t.serviceVersion&&{"service.version":t.serviceVersion},{"telemetry.sdk.name":e,"telemetry.sdk.version":i})}(this.qi,this._instance.getLibraryId(),this._instance.getLibraryVersion()),r=this._instance.getLibraryId(),n=this._instance.getLibraryVersion(),{resourceMetrics:[{resource:{attributes:He(i)},scopeMetrics:[{scope:{name:r,version:n},metrics:e}]}]};var e,i,r,n}Wn(t){var e=Xe(Date.now()),i=new Map;for(var r of t.values()){var n,s=ti(r.type,r.name,r.unit,void 0),o=i.get(s);o||(o=p({name:r.name},r.unit&&{unit:r.unit}),"count"===r.type?o.sum={aggregationTemporality:1,isMonotonic:!0,dataPoints:[]}:"gauge"===r.type?o.gauge={dataPoints:[]}:o.histogram={aggregationTemporality:1,dataPoints:[]},i.set(s,o));var a=He(null!==(n=r.attributes)&&void 0!==n?n:{},this.I),l=Xe(r.windowStartMs);if("count"===r.type){var u,h={attributes:a,startTimeUnixNano:l,timeUnixNano:e,asDouble:null!==(u=r.total)&&void 0!==u?u:0};o.sum.dataPoints.push(h)}else if("gauge"===r.type){var d,v={attributes:a,timeUnixNano:e,asDouble:null!==(d=r.last)&&void 0!==d?d:0};o.gauge.dataPoints.push(v)}else r.hist&&o.histogram.dataPoints.push({attributes:a,startTimeUnixNano:l,timeUnixNano:e,count:r.hist.count,sum:r.hist.sum,min:r.hist.min,max:r.hist.max,bucketCounts:r.hist.bucketCounts,explicitBounds:Ye})}return Array.from(i.values())}zn(t){var e,i;for(var r of t){var n=r[0],s=r[1],o=this.Fn.get(n);if(o)switch(o.windowStartMs=Math.min(o.windowStartMs,s.windowStartMs),o.type){case"count":o.total=(null!==(e=o.total)&&void 0!==e?e:0)+(null!==(i=s.total)&&void 0!==i?i:0);break;case"gauge":break;case"histogram":if(s.hist)if(o.hist){o.hist.count+=s.hist.count,o.hist.sum+=s.hist.sum,o.hist.min=Math.min(o.hist.min,s.hist.min),o.hist.max=Math.max(o.hist.max,s.hist.max);for(var a=0;o.hist.bucketCounts.length>a;a++)o.hist.bucketCounts[a]+=s.hist.bucketCounts[a]}else o.hist=s.hist}else this.Bn()&&this.Fn.set(n,s)}}};function ii(t,e){if(t){var i=t.find((t=>t.type===e));return null==i?void 0:i.value}}var ri,ni,si;function oi(t){var e=globalThis._posthogChunkIds;if(e){var i=Object.keys(e);return si&&i.length===ni||(ni=i.length,si=i.reduce(((i,r)=>{ri||(ri={});var n=ri[r];if(n)i[n[0]]=n[1];else for(var s=t(r),o=s.length-1;o>=0;o--){var a=s[o],l=null==a?void 0:a.filename,u=e[r];if(l&&u){i[l]=u,ri[r]=[l,u];break}}return i}),{})),si}}class ai{constructor(t,e,i){void 0===i&&(i=[]),this.coercers=t,this.stackParser=e,this.modifiers=i}buildFromUnknown(t,e){void 0===e&&(e={});var i=e&&e.mechanism||{handled:!0,type:"generic"},r=this.buildCoercingContext(i,e,0).apply(t),n=this.buildParsingContext(e),s=this.parseStacktrace(r,n);return{$exception_list:this.convertToExceptionList(s,i),$exception_level:"error"}}modifyFrames(t){var e=this;return f((function*(){for(var i of t)i.stacktrace&&i.stacktrace.frames&&rt(i.stacktrace.frames)&&(i.stacktrace.frames=yield e.applyModifiers(i.stacktrace.frames));return t}))()}coerceFallback(t){var e;return{type:"Error",value:"Unknown error",stack:null==(e=t.syntheticException)?void 0:e.stack,synthetic:!0}}parseStacktrace(t,e){var i,r;return null!=t.cause&&(i=this.parseStacktrace(t.cause,e)),""!=t.stack&&null!=t.stack&&(r=this.applyChunkIds(this.stackParser(t.stack,t.synthetic?e.skipFirstLines:0),e.chunkIdMap)),p({},t,{cause:i,stack:r})}applyChunkIds(t,e){return t.map((t=>(t.filename&&e&&(t.chunk_id=e[t.filename]),t)))}applyCoercers(t,e){for(var i of this.coercers)if(i.match(t))return i.coerce(t,e);return this.coerceFallback(e)}applyModifiers(t){var e=this;return f((function*(){var i=t;for(var r of e.modifiers)i=yield r(i);return i}))()}convertToExceptionList(t,e){var i,r,n,s={type:t.type,value:t.value,mechanism:{type:null!==(i=e.type)&&void 0!==i?i:"generic",handled:null===(r=e.handled)||void 0===r||r,synthetic:null!==(n=t.synthetic)&&void 0!==n&&n}};t.stack&&(s.stacktrace={type:"raw",frames:t.stack});var o=[s];return null!=t.cause&&o.push(...this.convertToExceptionList(t.cause,p({},e,{handled:!0}))),o}buildParsingContext(t){var e;return{chunkIdMap:oi(this.stackParser),skipFirstLines:null!==(e=t.skipFirstLines)&&void 0!==e?e:1}}buildCoercingContext(t,e,i){void 0===i&&(i=0);var r=(i,r)=>{if(4>=r){var n=this.buildCoercingContext(t,e,r);return this.applyCoercers(i,n)}};return p({},e,{syntheticException:0==i?e.syntheticException:void 0,mechanism:t,apply:t=>r(t,i),next:t=>r(t,i+1)})}}var li="?";function ui(t,e,i,r,n){var s={platform:t,filename:e,function:"<anonymous>"===i?li:i,in_app:!(null!=e&&e.startsWith("webkit-masked-url://"))&&"<anonymous>"!==e};return at(r)||(s.lineno=r),at(n)||(s.colno=n),s}var hi=(t,e)=>{var i=-1!==t.indexOf("safari-extension"),r=-1!==t.indexOf("safari-web-extension");return i||r?[-1!==t.indexOf("@")?t.split("@")[0]:li,i?"safari-extension:"+e:"safari-web-extension:"+e]:[t,e]},di=/^\s*at (\S+?)(?::(\d+))(?::(\d+))\s*$/i,vi=/^\s*at (?:(.+?\)(?: \[.+\])?|.*?) ?\((?:address at )?)?(?:async )?((?:<anonymous>|[-a-z]+:|.*bundle|\/)?.*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i,ci=/\((\S*)(?::(\d+))(?::(\d+))\)/,fi=(t,e)=>{var i=di.exec(t);if(i)return ui(e,i[1],li,+i[2],+i[3]);var r=vi.exec(t);if(r){if(r[2]&&0===r[2].indexOf("eval")){var n=ci.exec(r[2]);n&&(r[2]=n[1],r[3]=n[2],r[4]=n[3])}var s=hi(r[1]||li,r[2]);return ui(e,s[1],s[0],r[3]?+r[3]:void 0,r[4]?+r[4]:void 0)}},pi=/^\s*(.*?)(?:\((.*?)\))?(?:^|@)?((?:[-a-z]+)?:\/.*?|\[native code\]|[^@]*(?:bundle|\d+\.js)|\/[\w\-. /=]+)(?::(\d+))?(?::(\d+))?\s*$/i,gi=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i,mi=(t,e)=>{var i=pi.exec(t);if(i){if(i[3]&&i[3].indexOf(" > eval")>-1){var r=gi.exec(i[3]);r&&(i[1]=i[1]||"eval",i[3]=r[1],i[4]=r[2],i[5]="")}var n=i[3],s=i[1]||li,o=hi(s,n);return ui(e,n=o[1],s=o[0],i[4]?+i[4]:void 0,i[5]?+i[5]:void 0)}},yi=/\(error: (.*)\)/,_i=50;class bi{match(t){return this.isDOMException(t)||this.isDOMError(t)}coerce(t,e){var i=lt(t.stack);return{type:this.getType(t),value:this.getValue(t),stack:i?t.stack:void 0,cause:t.cause?e.next(t.cause):void 0,synthetic:!1}}getType(t){return this.isDOMError(t)?"DOMError":"DOMException"}getValue(t){var e=t.name||(this.isDOMError(t)?"DOMError":"DOMException");return t.message?e+": "+t.message:e}isDOMException(t){return _t(t,"DOMException")}isDOMError(t){return _t(t,"DOMError")}}class wi{match(t){return bt(t)}coerce(t,e){var i,r=this.getStack(t),n=void 0===r;return{type:this.getType(t),value:this.getMessage(t,e),stack:null!=r?r:null==(i=e.syntheticException)?void 0:i.stack,cause:t.cause?e.next(t.cause):void 0,synthetic:n}}getType(t){return t.name||t.constructor.name}getMessage(t,e){var i=t.message;return String(i.error&&"string"==typeof i.error.message?i.error.message:i)}getStack(t){return t.stacktrace||t.stack||void 0}}class ki{constructor(){}match(t){return!!_t(t,"ErrorEvent")&&(null!=t.error||this.fi(t))}coerce(t,e){var i;if(null!=t.error)return e.apply(t.error);var r=e.apply(t.message);return p({},r,{stack:null!==(i=this.pi(t))&&void 0!==i?i:r.stack,synthetic:!0})}fi(t){return lt(t.message)&&t.message.length>0}pi(t){var e,i,r=t,n=null!==(e=r.lineno)&&void 0!==e?e:0,s=null!==(i=r.colno)&&void 0!==i?i:0;if(lt(r.filename)&&0!==r.filename.length&&0!==n)return"Error\n at "+r.filename+":"+n+":"+s}}var Si=/^(?:[Uu]ncaught (?:exception: )?)?(?:((?:Eval|Internal|Range|Reference|Syntax|Type|URI|)Error): )?(.*)$/i;class xi{match(t){return"string"==typeof t}coerce(t,e){var i,r=this.getInfos(t),n=r[0],s=r[1];return{type:null!=n?n:"Error",value:null!=s?s:t,stack:null==(i=e.syntheticException)?void 0:i.stack,synthetic:!0}}getInfos(t){var e="Error",i=t,r=t.match(Si);return r&&(e=r[1],i=r[2]),[e,i]}}var Ci=["fatal","error","warning","log","info","debug"];function Ti(t,e){void 0===e&&(e=40);var i=Object.keys(t);if(i.sort(),!i.length)return"[object has no keys]";for(var r=i.length;r>0;r--){var n=i.slice(0,r).join(", ");if(e>=n.length)return r===i.length?n:n.length>e?n.slice(0,e)+"...":n}return""}class Ei{match(t){return"object"==typeof t&&null!==t}coerce(t,e){var i,r,n=this.getErrorPropertyFromObject(t);return n?e.apply(n):{type:this.getType(t),value:this.getValue(t),stack:null!==(i=this.getStack(t))&&void 0!==i?i:null==(r=e.syntheticException)?void 0:r.stack,level:this.isSeverityLevel(t.level)?t.level:"error",synthetic:!0}}getType(t){if(wt(t))return t.constructor.name;var e="name"in t?t.name:void 0;return lt(e)&&!ut(e)?e:"Error"}getValue(t){if("name"in t&&"string"==typeof t.name){var e="'"+t.name+"' captured as exception";return"message"in t&&"string"==typeof t.message&&(e+=" with message: '"+t.message+"'"),e}if("message"in t&&"string"==typeof t.message)return t.message;var i=this.getObjectClassName(t);return(i&&"Object"!==i?"'"+i+"'":"Object")+" captured as exception with keys: "+Ti(t)}isSeverityLevel(t){return lt(t)&&!ut(t)&&Ci.indexOf(t)>=0}getStack(t){try{return lt(t.stacktrace)&&t.stacktrace.length>0?t.stacktrace:lt(t.stack)&&t.stack.length>0?t.stack:void 0}catch(t){return}}getErrorPropertyFromObject(t){for(var e in t)if({}.hasOwnProperty.call(t,e)){var i=t[e];if(bt(i))return i}}getObjectClassName(t){try{var e=Object.getPrototypeOf(t);return e?e.constructor.name:void 0}catch(t){return}}}class Mi{match(t){return wt(t)}coerce(t,e){var i,r=t.constructor.name;return{type:r,value:r+" captured as exception with keys: "+Ti(t),stack:null==(i=e.syntheticException)?void 0:i.stack,synthetic:!0}}}class Ii{match(t){return yt(t)}coerce(t,e){var i;return{type:"Error",value:"Primitive value captured as exception: "+String(t),stack:null==(i=e.syntheticException)?void 0:i.stack,synthetic:!0}}}class Ri{match(t){return _t(t,"PromiseRejectionEvent")||this.isCustomEventWrappingRejection(t)}isCustomEventWrappingRejection(t){if(!wt(t))return!1;try{var e=t.detail;return null!=e&&"object"==typeof e&&"reason"in e}catch(t){return!1}}coerce(t,e){var i,r=this.getUnhandledRejectionReason(t);return yt(r)?{type:"UnhandledRejection",value:"Non-Error promise rejection captured with value: "+String(r),stack:null==(i=e.syntheticException)?void 0:i.stack,synthetic:!0}:e.apply(r)}getUnhandledRejectionReason(t){try{if("reason"in t)return t.reason;if("detail"in t&&null!=t.detail&&"object"==typeof t.detail&&"reason"in t.detail)return t.detail.reason}catch(t){}return t}}var Pi="$message",Ai="$timestamp",Oi=new Set([Pi,Ai]),Fi={enabled:!0,max_bytes:32768};function Li(t){var e;return t?{enabled:null!==(e=t.enabled)&&void 0!==e?e:Fi.enabled,max_bytes:Di(t.max_bytes,Fi.max_bytes)}:p({},Fi)}class $i{constructor(t){this.Vn=[],this.Gn=0,this.qi=Li(t)}setConfig(t){this.qi=Li(t),this.Zn()}add(t){var e=function(t){var e;try{e=X(t)}catch(t){return}try{var i=JSON.parse(e);if(!st(i))return;var r=i,n=r[Pi],s=r[Ai];if(!lt(n)||0===n.trim().length)return;if(!lt(s)&&!vt(s))return;return{step:r,json:e}}catch(t){return}}(t);if(e){var i=function(t){if("undefined"!=typeof TextEncoder)return(new TextEncoder).encode(t).length;for(var e=encodeURIComponent(t),i=0,r=0;e.length>r;r++)"%"===e[r]?(i+=1,r+=2):i+=1;return i}(e.json);i>this.qi.max_bytes||(this.Vn.push({step:e.step,bytes:i}),this.Gn+=i,this.Zn())}}getAttachable(){return this.Vn.map((t=>t.step))}clear(){this.Vn=[],this.Gn=0}size(){return this.Vn.length}Zn(){for(;this.Gn>this.qi.max_bytes&&this.Vn.length>0;){var t=this.Vn.shift();t&&(this.Gn-=t.bytes)}}}function Di(t,e){if(!vt(t)||t===1/0||t===-1/0)return e;var i=Math.floor(t);return 0>i?e:i}var Ni={DEBUG:!1,LIB_VERSION:"0.5.2",LIB_NAME:"browser-common"},qi=function(e,i){var r=(void 0===i?{}:i).debugEnabled,n={F(i){if(t&&(Ni.DEBUG||t.POSTHOG_DEBUG||r)&&!at(t.console)&&t.console){for(var n=("__rrweb_original__"in t.console[i]?t.console[i].__rrweb_original__:t.console[i]),s=arguments.length,o=new Array(s>1?s-1:0),a=1;s>a;a++)o[a-1]=arguments[a];n(e,...o)}},debug(){for(var t=arguments.length,e=new Array(t),i=0;t>i;i++)e[i]=arguments[i];n.F("debug",...e)},info(){for(var t=arguments.length,e=new Array(t),i=0;t>i;i++)e[i]=arguments[i];n.F("log",...e)},warn(){for(var t=arguments.length,e=new Array(t),i=0;t>i;i++)e[i]=arguments[i];n.F("warn",...e)},error(){for(var t=arguments.length,e=new Array(t),i=0;t>i;i++)e[i]=arguments[i];n.F("error",...e)},critical(){for(var t=arguments.length,i=new Array(t),r=0;t>r;r++)i[r]=arguments[r];console.error(e,...i)},uninitializedWarning(t){n.error("You must initialize PostHog before calling "+t)},createLogger:(t,i)=>qi(e+" "+t,i)};return n},ji=qi("[PostHog.js]"),Bi=ji.createLogger;function Ui(t,e){rt(t)&&t.forEach(e)}function Hi(t,e){if(!dt(t))if(rt(t))t.forEach(e);else if(pt(t))t.forEach(((t,i)=>e(t,i)));else for(var i in t)et.call(t,i)&&e(t[i],i)}var zi=function(t){for(var e=arguments.length,i=new Array(e>1?e-1:0),r=1;e>r;r++)i[r-1]=arguments[r];for(var n of i)for(var s in n)void 0!==n[s]&&(t[s]=n[s]);return t};function Wi(t){for(var e=Object.keys(t),i=e.length,r=new Array(i);i--;)r[i]=[e[i],t[e[i]]];return r}var Vi=function(t){try{return t()}catch(t){return}},Gi=function(t){return function(){try{for(var e=arguments.length,i=new Array(e),r=0;e>r;r++)i[r]=arguments[r];return t.apply(this,i)}catch(t){ji.critical("Implementation error. Please turn on debug mode and open a ticket on https://app.posthog.com/home#panel=support%3Asupport%3A."),ji.critical(t)}}},Zi=function(t){var e={};return Hi(t,(function(t,i){(lt(t)&&t.length>0||vt(t))&&(e[i]=t)})),e};var Qi=["herokuapp.com","vercel.app","netlify.app"];function Ji(t){var e=null==t?void 0:t.hostname;if(!lt(e))return!1;var i=e.split(".").slice(-2).join(".");for(var r of Qi)if(i===r)return!1;return!0}function Ki(t,e,i,r){var n=null!=r?r:{},s=n.capture,o=n.passive;null==t||t.addEventListener(e,i,{capture:void 0!==s&&s,passive:void 0===o||o})}function Yi(t){return"ph_toolbar_internal"===t.name}var Xi=["localhost","127.0.0.1"],tr=(t,e)=>{try{return JSON.stringify(t,((t,e)=>"bigint"==typeof e?e.toString():e),e)}catch(e){return X(t)}},er=t=>{var e=null==r?void 0:r.createElement("a");return at(e)?null:(e.href=t,e)},ir=function(t,e){var i,r;void 0===e&&(e="&");var n=[];return Hi(t,(function(t,e){at(t)||at(e)||"undefined"===e||(i=encodeURIComponent((t=>t instanceof File)(t)?t.name:t.toString()),r=encodeURIComponent(e),n[n.length]=r+"="+i)})),n.join(e)},rr=function(t,e){for(var i,r=((t.split("#")[0]||"").split(/\?(.*)/)[1]||"").replace(/^\?+/g,"").split("&"),n=0;r.length>n;n++){var s=r[n].split("=");if(s[0]===e){i=s;break}}if(!rt(i)||2>i.length)return"";var o=i[1];try{o=decodeURIComponent(o)}catch(t){ji.error("Skipping decoding for malformed query param: "+o)}return o.replace(/\+/g," ")},nr=function(t,e,i){if(!t||!e||!e.length)return t;for(var r=t.split("#"),n=r[1],s=(r[0]||"").split("?"),o=s[1],a=s[0],l=(o||"").split("&"),u=[],h=0;l.length>h;h++){var d=l[h].split("=");rt(d)&&(e.includes(d[0])?u.push(d[0]+"="+i):u.push(l[h]))}var v=a;return null!=o&&(v+="?"+u.join("&")),null!=n&&(v+="#"+n),v},sr=function(t,e){var i=t.match(new RegExp(e+"=([^&]*)"));return i?i[1]:null},or=(t,e)=>t>=e&&h(),ar=(t,e,i,r)=>{if(0===t){if(h()){var n=e+1;return n===i&&r(),n}return e}return 0};function lr(t,e){var i,r=null==t||null==(i=t.config)?void 0:i.get_current_url;if(!nt(r))return e;try{var n=r(e);return lt(n)&&n?n:e}catch(t){return ji.error("Error in get_current_url, falling back to window.location.href",t),e}}function ur(e){var i,r=null==t||null==(i=t.location)?void 0:i.href;return at(r)?void 0:lr(e,r)}var hr="__POSTHOG_TOOLBAR__",dr=1,vr=3,cr=11;function fr(t){return t instanceof Element&&(t.id===hr||!(null==t.closest||!t.closest(".toolbar-global-fade-container")))}function pr(t){return!!t&&t.nodeType===dr}function gr(t,e){return!!t&&!!t.tagName&&t.tagName.toLowerCase()===e.toLowerCase()}function mr(t){return!!t&&t.nodeType===vr}function yr(t){return!!t&&t.nodeType===cr&&pr(t.host)}var _r=1e3;function br(t){return t?K(t).split(/\s+/):[]}function wr(t,e){var i=ur(e);return!!(i&&t&&t.some((t=>i.match(t))))}function kr(t){var e="";switch(typeof t.className){case"string":e=t.className;break;case"object":e=(t.className&&"baseVal"in t.className?t.className.baseVal:null)||t.getAttribute("class")||"";break;default:e=""}return br(e)}function Sr(t){return dt(t)?null:K(t).split(/(\s+)/).filter((t=>Zr(t))).join("").replace(/[\r\n]/g," ").replace(/[ ]+/g," ").substring(0,255)}function xr(t){var e="";return qr(t)&&!jr(t)&&t.childNodes&&t.childNodes.length&&Hi(t.childNodes,(function(t){var i;mr(t)&&t.textContent&&(e+=null!==(i=Sr(t.textContent))&&void 0!==i?i:"")})),K(e)}function Cr(t){var e;return at(t.target)?t.srcElement||null:null!=(e=t.target)&&e.shadowRoot?t.composedPath()[0]||null:t.target||null}var Tr=["a","button","form","input","select","textarea","label"];function Er(t,e){if(at(e))return!0;var i,r=function(t){if(e.some((e=>function(t,e){var i=t.matches||t.matchesSelector||t.msMatchesSelector||t.mozMatchesSelector||t.webkitMatchesSelector||t.oMatchesSelector;try{return!!i&&i.call(t,e)}catch(t){return!1}}(t,e))))return{v:!0}};for(var n of t)if(i=r(n))return i.v;return!1}function Mr(t){var e=t.parentNode;return!(!e||!pr(e))&&e}var Ir=[".ph-no-autocapture","[data-ph-no-autocapture]"],Rr=["next","previous","prev",">","<"],Pr=[...Rr,"+","-","−","–"],Ar=(t,e)=>/[a-z0-9]/i.test(e)?t.includes(e):t===e,Or=[".ph-no-deadclick",".ph-no-capture"],Fr=[".ph-no-rageclick",".ph-no-capture"],Lr=["","text","search","email","password","url","tel","number"];function $r(e,i){if(!t||Dr(e))return!1;var r,n,s,o,a;if(ft(i)?(r=!!i&&Fr,n=void 0,s=!1):(r=null!==(o=null==i?void 0:i.css_selector_ignorelist)&&void 0!==o?o:Fr,n=null==i?void 0:i.content_ignorelist,s=null!==(a=null==i?void 0:i.ignore_text_selection)&&void 0!==a&&a),!1===r)return!1;if(s&&function(t){return!(!t||!pr(t))&&(!!gr(t,"textarea")||(gr(t,"input")?J(Lr,(t.getAttribute("type")||"").toLowerCase()):function(t){if(t.isContentEditable)return!0;var e=null==t.getAttribute?void 0:t.getAttribute("contenteditable");return"true"===e||""===e}(t)))}(e))return!1;var l=Nr(e,!1).targetElementList;return!function(t,e){if(!1===t||at(t))return!1;var i;if(!0===t)i=Rr;else{if(!rt(t))return!1;if(t.length>10)return ji.error("[PostHog] content_ignorelist array cannot exceed 10 items. Use css_selector_ignorelist for more complex matching."),!1;i=t.map((t=>t.toLowerCase()))}return e.some((t=>{var e=t.safeText,r=t.ariaLabel;return i.some((t=>Ar(e,t)||Ar(r,t)))}))}(n,l.map((t=>{var e;return{safeText:xr(t).toLowerCase(),ariaLabel:(null==(e=t.getAttribute("aria-label"))?void 0:e.toLowerCase().trim())||""}})))&&!Er(l,r)}var Dr=t=>!t||gr(t,"html")||!pr(t),Nr=(e,i)=>{if(!t||Dr(e))return{parentIsUsefulElement:!1,targetElementList:[]};for(var r=!1,n=[e],s=e;s.parentNode&&!gr(s,"body");)if(yr(s.parentNode))n.push(s.parentNode.host),s=s.parentNode.host;else{var o=Mr(s);if(!o)break;if(i||Tr.indexOf(o.tagName.toLowerCase())>-1)r=!0;else try{var a=t.getComputedStyle(o);a&&"pointer"===a.getPropertyValue("cursor")&&(r=!0)}catch(t){}n.push(o),s=o}return{parentIsUsefulElement:r,targetElementList:n}};function qr(t){for(var e=new Set,i=0,r=t;r.parentNode&&!gr(r,"body");r=r.parentNode){if(i++>=_r||e.has(r))return!1;e.add(r);var n=kr(r);if(J(n,"ph-sensitive")||J(n,"ph-no-capture"))return!1}if(J(kr(t),"ph-include"))return!0;var s=t.type||"";if(lt(s))switch(s.toLowerCase()){case"hidden":case"password":return!1}var o=t.name||t.id||"";return!lt(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 jr(t){return!!(gr(t,"input")&&!["button","checkbox","submit","reset"].includes(t.type)||gr(t,"select")||gr(t,"textarea")||"true"===t.getAttribute("contenteditable"))}var Br=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}))$"),Ur=/(^|[^0-9A-Za-z_])([0-9][0-9 -]*[0-9])(?=$|[^0-9A-Za-z_])/g,Hr=[16,15,14,13],zr=new RegExp("^(\\d{3}-?\\d{2}-?\\d{4})$"),Wr=new RegExp("(^|[^0-9])((?!000|666)[0-9]{3}-?(?!00)[0-9]{2}-?(?!0000)[0-9]{4})(?=$|([^0-9]))","g"),Vr=/[0-9A-Za-z_]/;function Gr(t){for(var e=0,i=!1,r=t.length-1;r>=0;r--){var n=t.charCodeAt(r)-48;i&&(n*=2)>9&&(n-=9),e+=n,i=!i}return e%10==0}function Zr(t,e){if(void 0===e&&(e=!0),dt(t))return!1;if(lt(t)){t=K(t);var i=e?Br.test((t||"").replace(/[- ]/g,"")):function(t){var e;for(Ur.lastIndex=0;e=Ur.exec(t);){var i=e[2];if(i)for(var r=i.replace(/[- ]/g,""),n=0;r.length>n;n++)for(var s of Hr){var o=n+s;if(r.length>=o){var a=r.slice(n,o);if(Br.test(a)&&Gr(a))return!0}}}return!1}(t);if(i)return!1;var r=e?zr.test(t):function(t){var e;for(Wr.lastIndex=0;e=Wr.exec(t);){var i=e[1],r=e[3];if(!(i&&r&&Vr.test(i)&&Vr.test(r)))return!0}return!1}(t);if(r)return!1}return!0}function Qr(t){var e=xr(t);return Zr(e=(e+" "+Jr(t)).trim())?e:""}function Jr(t){var e="";return t&&t.childNodes&&t.childNodes.length&&Hi(t.childNodes,(function(t){var i;if(t&&"span"===(null==(i=t.tagName)?void 0:i.toLowerCase()))try{var r=xr(t);e=(e+" "+r).trim(),t.childNodes&&t.childNodes.length&&(e=(e+" "+Jr(t)).trim())}catch(t){ji.error("[AutoCapture]",t)}})),e}function Kr(t){return t.replace(/"|\\"/g,'\\"')}function Yr(t){var e=t.attr__class;if(e)return rt(e)?e:br(e)}var Xr="[SessionRecording]",tn="redacted",en=1e6;function rn(t){var e;return Math.min(en,null!==(e=t.payloadSizeLimitBytes)&&void 0!==e?e:en)}var nn={initiatorTypes:["audio","beacon","body","css","early-hint","embed","fetch","frame","iframe","icon","image","img","input","link","navigation","object","ping","script","track","video","xmlhttprequest"],maskRequestFn:t=>t,recordHeaders:!1,recordBody:!1,recordInitialRequests:!1,recordPerformance:!1,performanceEntryTypeToObserve:["first-input","navigation","paint","resource"],payloadSizeLimitBytes:en,payloadHostDenyList:[".lr-ingest.io",".ingest.sentry.io",".clarity.ms","google-analytics.com","analytics.google.com","nr-data.net","datadoghq.com","datadoghq.eu","ddog-gov.com","segment.io","rudderstack.com","amplitude.com","mixpanel.com","hotjar.com","hotjar.io","fullstory.com"],streamNetworkBody:!1},sn=["authorization","x-forwarded-for","authorization","cookie","set-cookie","x-api-key","x-real-ip","remote-addr","forwarded","proxy-authorization","x-csrf-token","x-csrftoken","x-xsrf-token"],on=["password","secret","passwd","api_key","apikey","auth","credentials","mysql_pwd","privatekey","private_key","token"],an=["auth","token","secret","session","api-key","apikey","api_key","credential","password","passwd","cookie","csrf","xsrf"],ln=t=>{dt(t)||Hi(Object.keys(t),(e=>{(t=>{var e=t.toLowerCase();return sn.includes(e)||an.some((t=>e.includes(t)))})(e)&&(t[e]=tn)}))},un=["/s/","/e/","/i/"];function hn(t,e,i,r){if(dt(t))return t;var n=(null==e?void 0:e["content-length"])||function(t){return new Blob([t]).size}(t);return lt(n)&&(n=parseInt(n)),n>i?Xr+" "+r+" body too large to record ("+n+" bytes)":t}function dn(t,e){if(dt(t))return t;var i=t;return Zr(i,!1)||(i=Xr+" "+e+" body "+tn),Hi(on,(t=>{var r,n;null!=(r=i)&&r.length&&-1!==(null==(n=i)?void 0:n.indexOf(t))&&(i=Xr+" "+e+" body "+tn+" as might contain: "+t)})),i}var vn=new WeakSet,cn="$people_distinct_id",fn="distinct_id",pn="$device_id",gn="$device_model",mn="__alias",yn="__timers",_n="$autocapture_disabled_server_side",bn="$heatmaps_enabled_server_side",wn="$exception_capture_enabled_server_side",kn="$error_tracking_suppression_rules",Sn="$error_tracking_capture_extension_exceptions",xn="$web_vitals_enabled_server_side",Cn="$dead_clicks_enabled_server_side",Tn="$product_tours_enabled_server_side",En="$web_vitals_allowed_metrics",Mn="$session_recording_remote_config",In="$replay_sample_rate",Rn="$replay_override_sampling",Pn="$replay_override_linked_flag",An="$replay_override_url_trigger",On="$replay_override_event_trigger",Fn="$sesid",Ln="$session_is_sampled",$n="$session_past_minimum_duration",Dn="$session_recording_url_trigger_activated_session",Nn="$session_recording_event_trigger_activated_session",qn="$posthog_sr_group_event_trigger_",jn="$posthog_sr_group_url_trigger_",Bn="$posthog_sr_group_sampling_",Un="$debug_first_full_snapshot_timestamp",Hn="$sess_rec_flush_size",zn="$enabled_feature_flags",Wn="$active_feature_flags",Vn="$early_access_features",Gn="$feature_flag_details",Zn="$feature_flag_payloads",Qn="$feature_flag_request_id",Jn="$minimal_flag_called_events",Kn="$override_feature_flags",Yn="$override_feature_flag_payloads",Xn="$stored_person_properties",ts="$stored_group_properties",es="$groups",is="$surveys",rs="$surveys_loaded_at",ns="$surveys_activated",ss="$surveys_activated_session",os="$surveys_activated_timestamps",as="ph_product_tours",ls="$flag_call_reported",us="$flag_call_reported_session_id",hs="$feature_flag_errors",ds="$feature_flag_evaluated_at",vs="$user_state",cs="$client_session_props",fs="$capture_rate_limit",ps="$initial_campaign_params",gs="$initial_referrer_info",ms="$initial_person_info",ys="$epp",_s="$posthog_cookieless",bs="$cookieless_mode",ws="$sdk_debug_extensions_init_method",ks="$sdk_debug_extensions_init_time_ms",Ss="$sdk_debug_recording_script_not_loaded",xs="$sdk_debug_replay_event_trigger_status",Cs="$sdk_debug_replay_linked_flag_trigger_status",Ts="$sdk_debug_replay_matched_recording_trigger_groups",Es="$sdk_debug_replay_pending_trigger_conditions",Ms="$sdk_debug_replay_remote_trigger_matching_config",Is="$sdk_debug_replay_trigger_groups_count",Rs="$sdk_debug_replay_url_trigger_status",Ps="$session_recording_start_reason",As="PostHog loadExternalDependency extension not found.",Os="on_reject",Fs="always",Ls="anonymous",$s="identified",Ds="identified_only",Ns="visibilitychange",qs="beforeunload",js="$pageview",Bs="$pageleave",Us="$identify",Hs="$groupidentify",zs="disabled",Ws="sampled",Vs="active",Gs="buffering",Zs="paused",Qs="lazy_loading",Js="awaiting_config",Ks="missing_config",Ys="rrweb_error",Xs="trigger",to=Xs+"_activated",eo=Xs+"_pending",io=Xs+"_"+zs;function ro(t,e,i,r,n,s){return 0===e?io:(null==t?void 0:t.get_property(i?r+i:n))===s?to:eo}function no(t,e,i){return e.some((e=>{var r;return"regex"===e.matching&&(null!==(r=null==i?void 0:i.get(e.url))&&void 0!==r?r:new RegExp(e.url)).test(t)}))}function so(t){return t.includes(to)?to:t.includes(eo)?eo:io}function oo(t){var e=new Set(t);switch(e.delete(io),e.size){case 0:return io;case 1:return Array.from(e)[0];default:return eo}}class ao{constructor(t){this.N=t}triggerStatus(t){return so(this.N.map((e=>e.triggerStatus(t))))}triggerStatusNoSideEffects(t){return so(this.N.map((e=>e.triggerStatusNoSideEffects(t))))}stop(){this.N.forEach((t=>t.stop()))}}class lo{constructor(t){this.N=t}triggerStatus(t){return oo(this.N.map((e=>e.triggerStatus(t))))}triggerStatusNoSideEffects(t){return oo(this.N.map((e=>e.triggerStatusNoSideEffects(t))))}stop(){this.N.forEach((t=>t.stop()))}}class uo{triggerStatus(){return this.triggerStatusNoSideEffects()}triggerStatusNoSideEffects(){return to}stop(){}}var ho=t=>"sessionRecording"in t;class vo{constructor(t,e){this.P=[],this.q=[],this.j=new Map,this.B=new Map,this.H="",this.urlBlocked=!1,this._instance=t,this.$=e}onConfig(t){var e,i;this.P=(ho(t)?st(t.sessionRecording)?null==(e=t.sessionRecording)?void 0:e.urlTriggers:[]:null==t?void 0:t.urlTriggers)||[],this.q=(ho(t)?st(t.sessionRecording)?null==(i=t.sessionRecording)?void 0:i.urlBlocklist:[]:null==t?void 0:t.urlBlocklist)||[],this.U()}U(){for(var t of(this.j.clear(),this.B.clear(),this.P))if("regex"===t.matching&&!this.j.has(t.url))try{this.j.set(t.url,new RegExp(t.url))}catch(e){ji.error("Invalid URL trigger regex pattern:",t.url,e)}for(var e of this.q)if("regex"===e.matching&&!this.B.has(e.url))try{this.B.set(e.url,new RegExp(e.url))}catch(t){ji.error("Invalid URL blocklist regex pattern:",e.url,t)}}onRemoteConfig(t){this.onConfig(t)}W(t){return ro(this._instance,this.P.length,this.$,jn,Dn,t)}triggerStatus(t){var e=this.triggerStatusNoSideEffects(t);return this._instance.register_for_session({[Rs]:e}),e}triggerStatusNoSideEffects(t){return this.W(t)}checkUrlBlocklist(t,e){var i=ur(this._instance);if(i&&i!==this.H){this.H=i;var r=this.urlBlocked,n=no(i,this.q,this.B);r&&n||(n&&!r?t():!n&&r&&e())}}checkUrlTriggerConditions(t,e,i,r){var n=ur(this._instance);if(n&&n!==this.H){this.H=n;var s=this.urlBlocked,o=no(n,this.q,this.B);o&&!s?t():!o&&s&&e();var a=this.W(r)===to,l=no(n,this.P,this.j);!a&&l&&i("url",n)}}stop(){this.H=""}}class co{constructor(t){this.linkedFlag=null,this.linkedFlagSeen=!1,this.V=()=>{},this._instance=t}triggerStatus(){var t=this.triggerStatusNoSideEffects();return this._instance.register_for_session({[Cs]:t}),t}triggerStatusNoSideEffects(){var t=eo;return dt(this.linkedFlag)&&(t=io),this.linkedFlagSeen&&(t=to),t}onConfig(t,e){var i;if(this.linkedFlag=(ho(t)?st(t.sessionRecording)?null==(i=t.sessionRecording)?void 0:i.linkedFlag:null:null==t?void 0:t.linkedFlag)||null,!dt(this.linkedFlag)&&!this.linkedFlagSeen){var r=lt(this.linkedFlag)?this.linkedFlag:this.linkedFlag.flag,n=lt(this.linkedFlag)?null:this.linkedFlag.variant;this.V=this._instance.onFeatureFlags(((t,i)=>{var s=!1;if(st(i)&&r in i){var o=i[r];s=ft(o)?!0===o:n?o===n:!!o}var a=s&&!this.linkedFlagSeen;this.linkedFlagSeen=s,a&&e(r,n)}))}}onRemoteConfig(t,e){this.onConfig(t,e)}stop(){this.V()}}class fo{constructor(t,e){this.Z=[],this._instance=t,this.$=e}onConfig(t){var e;this.Z=(ho(t)?st(t.sessionRecording)?null==(e=t.sessionRecording)?void 0:e.eventTriggers:[]:null==t?void 0:t.eventTriggers)||[]}onRemoteConfig(t){this.onConfig(t)}G(t){return ro(this._instance,this.Z.length,this.$,qn,Nn,t)}triggerStatus(t){var e=this.triggerStatusNoSideEffects(t);return this._instance.register_for_session({[xs]:e}),e}triggerStatusNoSideEffects(t){return this.G(t)}checkEventTriggerConditions(t,e,i){if(0!==this.Z.length){var r=this.G(i)===to,n=this.Z.includes(t);!r&&n&&e("event",t)}}stop(){}}class po{constructor(t,e,i){if(this._instance=t,this.group=e,this.Y=new vo(t,e.id),this.J=new fo(t,e.id),this.K=new co(t),e.conditions.events&&e.conditions.events.length>0||e.conditions.urls&&e.conditions.urls.length>0||e.conditions.flag){var r=(e.conditions.events||[]).map((t=>t.name)),n={urlTriggers:e.conditions.urls||[],eventTriggers:r,linkedFlag:e.conditions.flag||null,urlBlocklist:[]};this.Y.onConfig(n),this.J.onConfig(n),this.K.onConfig(n,i);var s=[this.J,this.Y,this.K];this.X="any"===e.conditions.matchType?new ao(s):new lo(s)}else this.X=new uo}triggerStatus(t){return this.X.triggerStatus(t)}triggerStatusNoSideEffects(t){return this.X.triggerStatusNoSideEffects(t)}getPendingTriggerConditions(t){return this.triggerStatusNoSideEffects(t)!==eo?[]:[{label:"URL condition not matched",status:this.Y.triggerStatusNoSideEffects(t)},{label:"event condition not matched",status:this.J.triggerStatusNoSideEffects(t)},{label:"linked flag condition not matched",status:this.K.triggerStatusNoSideEffects()}].filter((t=>t.status===eo)).map((t=>t.label))}checkEventTriggerConditions(t,e,i){this.J.checkEventTriggerConditions(t,e,i)}checkUrlTriggerConditions(t,e,i,r){this.Y.checkUrlTriggerConditions(t,e,i,r)}activateTrigger(t,e){var i;null==(i=this._instance.persistence)||i.register({["url"===t?jn+this.group.id:qn+this.group.id]:e})}stop(){this.Y.stop(),this.J.stop(),this.K.stop()}}function go(t){if(t.rrwebError)return Ys;if(!t.receivedFlags)return Gs;if(!t.isRecordingEnabled)return zs;if(t.urlTriggerMatching.urlBlocked)return Zs;var e=!0===t.isSampled,i=new ao([t.eventTriggerMatching,t.urlTriggerMatching,t.linkedFlagMatching]).triggerStatus(t.sessionId);return e?Ws:i===to?Vs:i===eo?Gs:!1===t.isSampled?zs:Vs}function mo(t){if(t.rrwebError)return Ys;if(!t.receivedFlags)return Gs;if(!t.isRecordingEnabled)return zs;if(t.urlTriggerMatching.urlBlocked)return Zs;var e=new lo([t.eventTriggerMatching,t.urlTriggerMatching,t.linkedFlagMatching]).triggerStatus(t.sessionId),i=e!==io,r=ft(t.isSampled);return i&&e===eo?Gs:i&&e===io||r&&!t.isSampled?zs:!0===t.isSampled?Ws:Vs}function yo(){var t=[];return function(e,i){if(st(i)||rt(i)){for(;t.length>0&&t[t.length-1]!==this;)t.pop();return t.includes(i)?"[Circular]":(t.push(i),i)}return i}}function _o(t){var e=JSON.stringify(t,yo());return e?new Blob([e]).size:0}function bo(t){if(ht(t))return 4;if(at(t))return 0;switch(typeof t){case"string":return t.length+2;case"number":return String(t).length;case"boolean":return t?4:5;case"object":if(rt(t)){for(var e=2,i=0;t.length>i;i++){i>0&&(e+=1);var r=t[i];e+=at(r)||ht(r)?4:bo(r)}return e}var n=t,s=2,o=!0;for(var a in n)if({}.hasOwnProperty.call(n,a)){var l=n[a];at(l)||(o||(s+=1),o=!1,s+=a.length+3+bo(l))}return s;default:return 0}}function wo(t,e){if(void 0===e&&(e=6606028.8),t.size>=e&&t.data.length>1){var i=Math.floor(t.data.length/2),r=t.sizes.slice(0,i),n=t.sizes.slice(i);return[wo({size:r.reduce(((t,e)=>t+e),0),data:t.data.slice(0,i),sizes:r,sessionId:t.sessionId,windowId:t.windowId}),wo({size:n.reduce(((t,e)=>t+e),0),data:t.data.slice(i),sizes:n,sessionId:t.sessionId,windowId:t.windowId})].flatMap((t=>t))}return[t]}var ko=Uint8Array,So=Uint16Array,xo=Uint32Array,Co=new ko([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]),To=new ko([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]),Eo=new ko([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),Mo=function(t,e){for(var i=new So(31),r=0;31>r;++r)i[r]=e+=1<<t[r-1];var n=new xo(i[30]);for(r=1;30>r;++r)for(var s=i[r];i[r+1]>s;++s)n[s]=s-i[r]<<5|r;return[i,n]},Io=Mo(Co,2),Ro=Io[1];Io[0][28]=258,Ro[258]=28;for(var Po=Mo(To,0)[1],Ao=new So(32768),Oo=0;32768>Oo;++Oo){var Fo=(43690&Oo)>>>1|(21845&Oo)<<1;Ao[Oo]=((65280&(Fo=(61680&(Fo=(52428&Fo)>>>2|(13107&Fo)<<2))>>>4|(3855&Fo)<<4))>>>8|(255&Fo)<<8)>>>1}var Lo=function(t,e,i){for(var r=t.length,n=0,s=new So(e);r>n;++n)++s[t[n]-1];var o,a=new So(e);for(n=0;e>n;++n)a[n]=a[n-1]+s[n-1]<<1;if(i){o=new So(1<<e);var l=15-e;for(n=0;r>n;++n)if(t[n])for(var u=n<<4|t[n],h=e-t[n],d=a[t[n]-1]++<<h,v=d|(1<<h)-1;v>=d;++d)o[Ao[d]>>>l]=u}else for(o=new So(r),n=0;r>n;++n)o[n]=Ao[a[t[n]-1]++]>>>15-t[n];return o},$o=new ko(288);for(Oo=0;144>Oo;++Oo)$o[Oo]=8;for(Oo=144;256>Oo;++Oo)$o[Oo]=9;for(Oo=256;280>Oo;++Oo)$o[Oo]=7;for(Oo=280;288>Oo;++Oo)$o[Oo]=8;var Do=new ko(32);for(Oo=0;32>Oo;++Oo)Do[Oo]=5;var No=Lo($o,9,0),qo=Lo(Do,5,0),jo=function(t){return(t/8>>0)+(7&t&&1)},Bo=function(t,e,i){(null==i||i>t.length)&&(i=t.length);var r=new(t instanceof So?So:t instanceof xo?xo:ko)(i-e);return r.set(t.subarray(e,i)),r},Uo=function(t,e,i){var r=e/8>>0;t[r]|=i<<=7&e,t[r+1]|=i>>>8},Ho=function(t,e,i){var r=e/8>>0;t[r]|=i<<=7&e,t[r+1]|=i>>>8,t[r+2]|=i>>>16},zo=function(t,e){for(var i=[],r=0;t.length>r;++r)t[r]&&i.push({s:r,f:t[r]});var n=i.length,s=i.slice();if(!n)return[new ko(0),0];if(1==n){var o=new ko(i[0].s+1);return o[i[0].s]=1,[o,1]}i.sort((function(t,e){return t.f-e.f})),i.push({s:-1,f:25001});var a=i[0],l=i[1],u=0,h=1,d=2;for(i[0]={s:-1,f:a.f+l.f,l:a,r:l};h!=n-1;)a=i[i[d].f>i[u].f?u++:d++],l=i[u!=h&&i[d].f>i[u].f?u++:d++],i[h++]={s:-1,f:a.f+l.f,l:a,r:l};var v=s[0].s;for(r=1;n>r;++r)s[r].s>v&&(v=s[r].s);var c=new So(v+1),f=Wo(i[h-1],c,0);if(f>e){r=0;var p=0,g=f-e,m=1<<g;for(s.sort((function(t,e){return c[e.s]-c[t.s]||t.f-e.f}));n>r;++r){var y=s[r].s;if(e>=c[y])break;p+=m-(1<<f-c[y]),c[y]=e}for(p>>>=g;p>0;){var _=s[r].s;e>c[_]?p-=1<<e-c[_]++-1:++r}for(;r>=0&&p;--r){var b=s[r].s;c[b]==e&&(--c[b],++p)}f=e}return[new ko(c),f]},Wo=function(t,e,i){return-1==t.s?Math.max(Wo(t.l,e,i+1),Wo(t.r,e,i+1)):e[t.s]=i},Vo=function(t){for(var e=t.length;e&&!t[--e];);for(var i=new So(++e),r=0,n=t[0],s=1,o=function(t){i[r++]=t},a=1;e>=a;++a)if(t[a]==n&&a!=e)++s;else{if(!n&&s>2){for(;s>138;s-=138)o(32754);s>2&&(o(s>10?s-11<<5|28690:s-3<<5|12305),s=0)}else if(s>3){for(o(n),--s;s>6;s-=6)o(8304);s>2&&(o(s-3<<5|8208),s=0)}for(;s--;)o(n);s=1,n=t[a]}return[i.subarray(0,r),e]},Go=function(t,e){for(var i=0,r=0;e.length>r;++r)i+=t[r]*e[r];return i},Zo=function(t,e,i){var r=i.length,n=jo(e+2);t[n]=255&r,t[n+1]=r>>>8,t[n+2]=255^t[n],t[n+3]=255^t[n+1];for(var s=0;r>s;++s)t[n+s+4]=i[s];return 8*(n+4+r)},Qo=function(t,e,i,r,n,s,o,a,l,u,h){Uo(e,h++,i),++n[256];for(var d=zo(n,15),v=d[0],c=d[1],f=zo(s,15),p=f[0],g=f[1],m=Vo(v),y=m[0],_=m[1],b=Vo(p),w=b[0],k=b[1],S=new So(19),x=0;y.length>x;++x)S[31&y[x]]++;for(x=0;w.length>x;++x)S[31&w[x]]++;for(var C=zo(S,7),T=C[0],E=C[1],M=19;M>4&&!T[Eo[M-1]];--M);var I,R,P,A,O=u+5<<3,F=Go(n,$o)+Go(s,Do)+o,L=Go(n,v)+Go(s,p)+o+14+3*M+Go(S,T)+(2*S[16]+3*S[17]+7*S[18]);if(F>=O&&L>=O)return Zo(e,h,t.subarray(l,l+u));if(Uo(e,h,1+(F>L)),h+=2,F>L){I=Lo(v,c,0),R=v,P=Lo(p,g,0),A=p;var D=Lo(T,E,0);for(Uo(e,h,_-257),Uo(e,h+5,k-1),Uo(e,h+10,M-4),h+=14,x=0;M>x;++x)Uo(e,h+3*x,T[Eo[x]]);h+=3*M;for(var N=[y,w],q=0;2>q;++q){var j=N[q];for(x=0;j.length>x;++x)Uo(e,h,D[B=31&j[x]]),h+=T[B],B>15&&(Uo(e,h,j[x]>>>5&127),h+=j[x]>>>12)}}else I=No,R=$o,P=qo,A=Do;for(x=0;a>x;++x)if(r[x]>255){var B;Ho(e,h,I[257+(B=r[x]>>>18&31)]),h+=R[B+257],B>7&&(Uo(e,h,r[x]>>>23&31),h+=Co[B]);var U=31&r[x];Ho(e,h,P[U]),h+=A[U],U>3&&(Ho(e,h,r[x]>>>5&8191),h+=To[U])}else Ho(e,h,I[r[x]]),h+=R[r[x]];return Ho(e,h,I[256]),h+R[256]},Jo=new xo([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),Ko=function(){for(var t=new xo(256),e=0;256>e;++e){for(var i=e,r=9;--r;)i=(1&i&&3988292384)^i>>>1;t[e]=i}return t}(),Yo=function(){var t=4294967295;return{p(e){for(var i=t,r=0;e.length>r;++r)i=Ko[255&i^e[r]]^i>>>8;t=i},d:()=>4294967295^t}},Xo=function(t,e,i,r,n){return function(t,e,i,r,n,s){var o=t.length,a=new ko(r+o+5*(1+Math.floor(o/7e3))+n),l=a.subarray(r,a.length-n),u=0;if(!e||8>o)for(var h=0;o>=h;h+=65535){var d=h+65535;o>d?u=Zo(l,u,t.subarray(h,d)):(l[h]=true,u=Zo(l,u,t.subarray(h,o)))}else{for(var v=Jo[e-1],c=v>>>13,f=8191&v,p=(1<<i)-1,g=new So(32768),m=new So(p+1),y=Math.ceil(i/3),_=2*y,b=function(e){return(t[e]^t[e+1]<<y^t[e+2]<<_)&p},w=new xo(25e3),k=new So(288),S=new So(32),x=0,C=0,T=(h=0,0),E=0,M=0;o>h;++h){var I=b(h),R=32767&h,P=m[I];if(g[R]=P,m[I]=R,h>=E){var A=o-h;if((x>7e3||T>24576)&&A>423){u=Qo(t,l,0,w,k,S,C,T,M,h-M,u),T=x=C=0,M=h;for(var O=0;286>O;++O)k[O]=0;for(O=0;30>O;++O)S[O]=0}var F=2,L=0,D=f,N=R-P&32767;if(A>2&&I==b(h-N))for(var q=Math.min(c,A)-1,j=Math.min(32767,h),B=Math.min(258,A);j>=N&&--D&&R!=P;){if(t[h+F]==t[h+F-N]){for(var U=0;B>U&&t[h+U]==t[h+U-N];++U);if(U>F){if(F=U,L=N,U>q)break;var H=Math.min(N,U-2),z=0;for(O=0;H>O;++O){var W=h-N+O+32768&32767,V=W-g[W]+32768&32767;V>z&&(z=V,P=W)}}}N+=(R=P)-(P=g[R])+32768&32767}if(L){w[T++]=268435456|Ro[F]<<18|Po[L];var G=31&Ro[F],Z=31&Po[L];C+=Co[G]+To[Z],++k[257+G],++S[Z],E=h+F,++x}else w[T++]=t[h],++k[t[h]]}}u=Qo(t,l,true,w,k,S,C,T,M,h-M,u)}return Bo(a,0,r+jo(u)+n)}(t,null==e.level?6:e.level,null==e.mem?Math.ceil(1.5*Math.max(8,Math.min(13,Math.log(t.length)))):12+e.mem,i,r)},ta=function(t,e,i){for(;i;++e)t[e]=i,i>>>=8},ea=function(t,e){var i=e.filename;if(t[0]=31,t[1]=139,t[2]=8,t[8]=2>e.level?4:9==e.level?2:0,t[9]=3,0!=e.mtime&&ta(t,4,Math.floor(new Date(e.mtime||Date.now())/1e3)),i){t[3]=8;for(var r=0;i.length>=r;++r)t[r+10]=i.charCodeAt(r)}},ia=function(t){return 10+(t.filename&&t.filename.length+1||0)};function ra(t,e){void 0===e&&(e={});var i=Yo(),r=t.length;i.p(t);var n=Xo(t,e,ia(e),8),s=n.length;return ea(n,e),ta(n,s-8,i.d()),ta(n,s-4,r),n}function na(t,e){var i=t.length;if("undefined"!=typeof TextEncoder)return(new TextEncoder).encode(t);for(var r=new ko(t.length+(t.length>>>1)),n=0,s=function(t){r[n++]=t},o=0;i>o;++o){if(n+5>r.length){var a=new ko(n+8+(i-o<<1));a.set(r),r=a}var l=t.charCodeAt(o);128>l||e?s(l):2048>l?(s(192|l>>>6),s(128|63&l)):l>55295&&57344>l?(s(240|(l=65536+(1047552&l)|1023&t.charCodeAt(++o))>>>18),s(128|l>>>12&63),s(128|l>>>6&63),s(128|63&l)):(s(224|l>>>12),s(128|l>>>6&63),s(128|63&l))}return Bo(r,0,n)}function sa(t,e){for(var i="",r=0;t.length>r;){var n=t[r++];i+=String.fromCharCode(n)}return i}class oa{constructor(t,e){var i,r;void 0===e&&(e={}),this.ee={},this.te=t=>{if(!this.ee[t]){var e,i;this.ee[t]=!0;var r=this.re(t);null==(e=(i=this.ie).onBlockedNode)||e.call(i,t,r)}},this.ne=t=>{var e=this.re(t);if("svg"!==(null==e?void 0:e.nodeName)&&e instanceof Element){var i=e.closest("svg");if(i)return[this._rrweb.mirror.getId(i),i]}return[t,e]},this.re=t=>this._rrweb.mirror.getNode(t),this.ae=t=>{var e,i,r,n,s,o,a,l;return(null!==(e=null==(i=t.removes)?void 0:i.length)&&void 0!==e?e:0)+(null!==(r=null==(n=t.attributes)?void 0:n.length)&&void 0!==r?r:0)+(null!==(s=null==(o=t.texts)?void 0:o.length)&&void 0!==s?s:0)+(null!==(a=null==(l=t.adds)?void 0:l.length)&&void 0!==a?a:0)},this.throttleMutations=t=>{if(3!==t.type||0!==t.data.source)return t;var e=t.data,i=this.ae(e);e.attributes&&(e.attributes=e.attributes.filter((t=>{var e=this.ne(t.id);return!this.oe.consumeRateLimit(e[0])&&t})));var r=this.ae(e);return 0!==r||i===r?t:void 0},this._rrweb=t,this.ie=e,this.oe=new Et({bucketSize:null!==(i=this.ie.bucketSize)&&void 0!==i?i:100,refillRate:null!==(r=this.ie.refillRate)&&void 0!==r?r:10,refillInterval:1e3,S:this.te,I:ji})}reset(){this.ee={}}stop(){this.oe.stop(),this.reset()}}Ni.DEBUG=!1,Ni.LIB_VERSION="1.419.0",Ni.LIB_NAME="web";class aa{constructor(t){if(!t.persistence)throw new Error("it is not valid to not have persistence and be this far into setting up the application");this.se=t.get_property.bind(t),this.ue=t.persistence.set_property.bind(t.persistence)}trackSize(t,e){this.ue(Hn,{sessionId:t,size:this.currentTrackedSize(t)+e})}currentTrackedSize(t){var e,i=this.se(Hn);return st(e=i)&&lt(e.sessionId)&&vt(e.size)&&i.sessionId===t?i.size:0}}function la(t,e){return function(t){for(var e=0,i=0;t.length>i;i++)e=(e<<5)-e+t.charCodeAt(i),e|=0;return Math.abs(e)}(t)%100<Tt(100*e,0,100,ji)}function ua(t){return"$survey_response_"+t}function ha(t,e){if(!e)return null;var i=t[ua(e)];return rt(i)?[...i]:i}function da(t,e){void 0===t&&(t={});var i={};return e.questions.forEach((e=>{if(!at(e.originalQuestionIndex)){var r,n=0===(r=e.originalQuestionIndex)?"$survey_response":"$survey_response_"+r,s=ha(t,e.id);at(s)||(i[n]=s)}})),p({$survey_questions:e.questions.map((e=>({id:e.id,question:e.question,response:ha(t,e.id)})))},t,i)}function va(t,e){var i="$survey_"+e+"/"+t.id;return t.current_iteration&&t.current_iteration>0&&(i="$survey_"+e+"/"+t.id+"/"+t.current_iteration),i}function ca(t){return"string"==typeof t&&t.trim()?t.trim():null}function fa(t){return t.toLowerCase()}function pa(t,e,i){if(!t||!e)return null;var r=fa(e),n=Object.keys(t).find((t=>fa(t)===r));if(n)return null==i||i.debug("Found exact translation match: "+n),n;if(r.includes("-")){var s=r.split("-")[0],o=Object.keys(t).find((t=>fa(t)===s));if(o)return null==i||i.debug("Found base language translation match: "+o+" (from "+e+")"),o}return null}var ga=["thankYouMessageHeader","thankYouMessageDescription","thankYouMessageCloseButtonText","introScreenHeader","introScreenDescription","introScreenButtonText","submitButtonText","backButtonText"];function ma(t,e,i){var r,n=pa(t.translations,e,i),s=p({},t),o=!1;if(n){var a,l=null==(a=t.translations)?void 0:a[n];if(l)if(null==i||i.info("Applying survey-level translation for language: "+n),at(l.name)||(s.name=l.name,o=!0),s.appearance){var u=p({},s.appearance);for(var h of ga){var d=l[h];at(d)||(u[h]=d,o=!0)}s.appearance=u}else(function(t){return ga.some((e=>!at(t[e])))})(l)&&(o=!0)}var v=t.questions.map((t=>function(t,e,i){var r,n=pa(t.translations,e,i);if(!n)return{question:t,matchedKey:null,hasChanges:!1};var s=null==(r=t.translations)?void 0:r[n];if(!s)return{question:t,matchedKey:null,hasChanges:!1};var o=p({},t),a=!1;return at(s.question)||(o.question=s.question,a=!0),at(s.description)||(o.description=s.description,a=!0),at(s.buttonText)||(o.buttonText=s.buttonText,a=!0),"link"in o&&!at(s.link)&&(o.link=s.link,a=!0),"lowerBoundLabel"in o&&!at(s.lowerBoundLabel)&&(o.lowerBoundLabel=s.lowerBoundLabel,a=!0),"upperBoundLabel"in o&&!at(s.upperBoundLabel)&&(o.upperBoundLabel=s.upperBoundLabel,a=!0),"choices"in o&&function(t){return rt(t.choices)}(s)&&(o.choices=s.choices,a=!0),{question:a?o:t,matchedKey:a?n:null,hasChanges:a}}(t,e,i))),c=v.map((t=>t.question)),f=v.some((t=>t.hasChanges)),g=null;return n||(g=(null==(r=v.find((t=>t.matchedKey)))?void 0:r.matchedKey)||null),f&&(s.questions=c,o=!0,null==i||i.info("Applied question-level translations for language: "+e)),{survey:s,matchedKey:o?n||g:null}}function ya(t){var e;return!(null==(e=t.conditions)||null==(e=e.events)||null==(e=e.values)||!e.length)}function _a(t){var e;return ya(t)&&!(null==(e=t.conditions)||null==(e=e.events)||!e.repeatedActivation)||"always"===t.schedule}var ba=(t,e)=>{if(!(t=>{try{new RegExp(t)}catch(t){return!1}return!0})(e))return!1;try{return new RegExp(e).test(t)}catch(t){return!1}},wa=t=>t.toLowerCase(),ka={exact:(t,e)=>e.some((e=>t.some((t=>e===t)))),is_not:(t,e)=>e.every((e=>t.every((t=>e!==t)))),regex:(t,e)=>e.some((e=>t.some((t=>ba(e,t))))),not_regex:(t,e)=>e.every((e=>t.every((t=>!ba(e,t))))),icontains:(t,e)=>e.map(wa).some((e=>t.map(wa).some((t=>e.includes(t))))),not_icontains:(t,e)=>e.map(wa).every((e=>t.map(wa).every((t=>!e.includes(t))))),gt:(t,e)=>e.some((e=>{var i=parseFloat(e);return!isNaN(i)&&t.some((t=>i>parseFloat(t)))})),lt:(t,e)=>e.some((e=>{var i=parseFloat(e);return!isNaN(i)&&t.some((t=>i<parseFloat(t)))}))};function Sa(t,e){return!t||Object.entries(t).every((t=>{var i=t[1],r=null==e?void 0:e[t[0]];if(null==r)return!1;var n=ka[i.operator];return!!n&&n(i.values,[String(r)])}))}function xa(t,e,i){return tr({distinct_id:t,userPropertiesToSet:e,userPropertiesToSetOnce:i})}var Ca=new Set(["is_not","not_icontains","not_regex"]);function Ta(t,e,i){return!t||0===t.length||t.every((t=>{var r="person"===t.type?i:e,n=null==r?void 0:r[t.key],s=t.operator||"exact";if(at(n)||ht(n))return Ca.has(s);var o=ka[s];return!!o&&!at(t.value)&&!ht(t.value)&&o(rt(t.value)?t.value.map(String):[String(t.value)],rt(n)?n.map(String):[String(n)])}))}var Ea=Bi("[SessionRecording]");function Ma(t,e){return e?t:"!"+t}function Ia(t,e){return t===e||t!=="!"+e&&null}class Ra{constructor(t,e,i,r,n,s,o){this.le=null,this.he=mo,this._instance=t,this.Y=e,this.J=i,this.K=r,this.ce=n,this.de=s,this.ve=o}onRemoteConfig(t){this.le=vt(t.sampleRate)?t.sampleRate:null,"any"===t.triggerMatchType?(this.fe=new ao([this.J,this.Y]),this.he=go):(this.fe=new lo([this.J,this.Y]),this.he=mo),this._instance.register_for_session({[Ms]:t.triggerMatchType}),this.Y.onConfig(t),this.J.onConfig(t),this.K.onConfig(t,((t,e)=>{this.ce("linked_flag_matched",{flag:t,variant:e}),this.ve()}))}getStatus(t){return this.he({receivedFlags:!0,isRecordingEnabled:!0,isSampled:t.isSampled,rrwebError:t.rrwebError,urlTriggerMatching:t.urlTriggerMatching,eventTriggerMatching:t.eventTriggerMatching,linkedFlagMatching:t.linkedFlagMatching,sessionId:t.sessionId})}getMinimumDuration(t){var e=this._instance.get_property("$session_recording_remote_config"),i=null==e?void 0:e.minimumDurationMilliseconds;return vt(i)?i:null}checkUrlTriggers(t,e,i,r){this.Y.checkUrlTriggerConditions(e,i,r,t)}setupEventTriggerListeners(t,e,i){if(0!==this.J.Z.length&&dt(this.pe))return this.pe=t((t=>{try{this.J.checkEventTriggerConditions(t.event,i,e)}catch(t){Ea.error("Could not activate event trigger",t)}})),this.pe}makeSamplingDecisions(t){var e,i,r,n=this.le;if(!vt(n))return null==(i=this._instance.persistence)||i.unregister(Ln),void(null==(r=this._instance.persistence)||r.unregister(In));var s=this._instance.get_property(Ln),o=this._instance.get_property(In),a=Ia(s,t),l=vt(o)&&o!==n,u=at(o)&&s===t,h=l||u||!ft(a),d=h?la(t,n):a;h&&(d?this.ce("sampled"):Ea.warn("Sample rate ("+n+") has determined that this sessionId ("+t+") will not be sent to the server.")),null==(e=this._instance.persistence)||e.register({[Ln]:Ma(t,d),[In]:ht(o)&&s===t?null:n})}ensureSamplingDecision(t){if(vt(this.le)){var e=this._instance.get_property(Ln);ft(Ia(e,t))||this.makeSamplingDecisions(t)}}onFlushComplete(){}clearConditionalRecordingPersistence(){var t,e,i,r,n;null==(t=this._instance.persistence)||t.unregister(Nn),null==(e=this._instance.persistence)||e.unregister(Dn),null==(i=this._instance.persistence)||i.unregister(Ln),null==(r=this._instance.persistence)||r.unregister(In),null==(n=this._instance.persistence)||n.unregister($n)}updateActiveTriggers(t){}hasPendingTriggers(t){var e;return(null==(e=this.fe)?void 0:e.triggerStatus(t))===eo}getPendingTriggerConditions(t){return[{label:"URL condition not matched",status:this.Y.triggerStatusNoSideEffects(t)},{label:"event condition not matched",status:this.J.triggerStatusNoSideEffects(t)},{label:"linked flag condition not matched",status:this.K.triggerStatusNoSideEffects()}].filter((t=>t.status===eo)).map((t=>t.label))}stop(){var t;null==(t=this.pe)||t.call(this),this.pe=void 0,this.J.stop(),this.Y.stop(),this.K.stop()}}class Pa{constructor(t,e,i,r,n){this.me=[],this.ge=new Map,this.ye=!1,this._instance=t,this.Y=e,this.ce=i,this.be=r,this.ve=n}onRemoteConfig(t){t.triggerGroups&&0!==t.triggerGroups.length?(this.we(t.triggerGroups),this._instance.register_for_session({[Ms]:"v2_trigger_groups",[Is]:t.triggerGroups.length}),this.Y.onConfig(t)):Ea.warn("[V2Strategy] No trigger groups configured")}getStatus(t){return function(t){if(t.rrwebError)return Ys;if(t.urlTriggerMatching.urlBlocked)return Zs;var e=t.triggerGroupMatchers,i=t.triggerGroupSamplingResults;if(0===e.length)return zs;var r=!1,n=!1;for(var s of e){var o=s.triggerStatus(t.sessionId);if(o===to){var a=s.group.id,l=i.get(a);at(l)?ji.warn("[V2 Triggers] Group activated but no sampling decision found",{groupId:a}):!0===l&&(n=!0)}else o===eo&&(r=!0)}return n?Ws:r?Gs:zs}({isSampled:t.isSampled,rrwebError:t.rrwebError,urlTriggerMatching:t.urlTriggerMatching,eventTriggerMatching:t.eventTriggerMatching,linkedFlagMatching:t.linkedFlagMatching,sessionId:t.sessionId,triggerGroupMatchers:this.me,triggerGroupSamplingResults:this.ge,minimumDuration:this.getMinimumDuration(t.sessionId)})}getMinimumDuration(t){var e=null;for(var i of this.me)if("trigger_activated"===i.triggerStatus(t)){var r=i.group.minDurationMs;vt(r)&&(ht(e)||e>r)&&(e=r)}return e}checkUrlTriggers(t,e,i,r){var n=this;this.Y.checkUrlBlocklist(e,i);var s=function(r){r.checkUrlTriggerConditions(e,i,(e=>{n.ke(r,void 0)&&(r.activateTrigger(e,t),n.updateActiveTriggers(t),n.ve(e))}),t)};for(var o of this.me)s(o)}setupEventTriggerListeners(t,e,i){var r=this;return this.pe=t((t=>{var i;if(this.ye)return Ea.info("[SessionRecorder] Stopping trigger checks - initial buffer flushed"),null==(i=this.pe)||i.call(this),void(this.pe=void 0);try{var n=function(i){i.checkEventTriggerConditions(t.event,(n=>{if(r.ke(i,t.properties)){var s=(i.group.conditions.events||[]).filter((e=>e.name===t.event)),o=r._instance.get_property(Xn),a=s.some((e=>!e.properties||0===e.properties.length||Ta(e.properties,t.properties,o)));a&&(i.activateTrigger(n,e),r.updateActiveTriggers(e),r.ve(n))}}),e)};for(var s of this.me)n(s)}catch(t){Ea.error("Could not activate event trigger for trigger groups",t)}})),this.pe}makeSamplingDecisions(t){for(var e of this.me){var i,r=e.group,n=r.id,s=r.sampleRate,o=Bn+n,a=this._instance.get_property(o),l=null,u=!1,h=!1,d=!1;if(st(a)){var v=a.sessionId,c=a.sampleRate,f=a.sampled;u="string"==typeof v&&v!==t,h=vt(c)&&c!==s,l=v===t&&vt(c)&&c===s&&ft(f)?f:null}else l=a===t||null,u="string"==typeof a&&a!==t,d=a===t;var p=u||h||d||!ft(l),g=p?la(t+n,s):l;p&&this.be("triggerGroupSamplingDecisionMade",{group_id:n,group_name:r.name,sampleRate:s,isSampled:g}),this.ge.set(n,g),null==(i=this._instance.persistence)||i.register({[o]:{sessionId:t,sampleRate:s,sampled:g}})}this.updateActiveTriggers(t)}ensureSamplingDecision(t){}onFlushComplete(){this.ye=!0}clearConditionalRecordingPersistence(){var t,e,i;for(var r of(null==(t=this._instance.persistence)||t.unregister(Ln),null==(e=this._instance.persistence)||e.unregister(In),null==(i=this._instance.persistence)||i.unregister($n),this.me)){var n,s,o,a=r.group.id;null==(n=this._instance.persistence)||n.unregister(qn+a),null==(s=this._instance.persistence)||s.unregister(jn+a),null==(o=this._instance.persistence)||o.unregister(Bn+a)}}updateActiveTriggers(t){var e=[];for(var i of this.me){var r=i.group,n=r.id,s="trigger_activated"===i.triggerStatus(t),o=!0===this.ge.get(n);s&&e.push({id:n,name:r.name,matched:!0,sampled:o})}this._instance.register_for_session({[Ts]:e})}hasPendingTriggers(t){for(var e of this.me)if(e.triggerStatus(t)===eo)return!0;return!1}getPendingTriggerConditions(t){return this.me.flatMap((e=>e.triggerStatusNoSideEffects(t)!==eo?[]:e.getPendingTriggerConditions(t).map((t=>'trigger group "'+e.group.name+'": '+t))))}stop(){var t;null==(t=this.pe)||t.call(this),this.pe=void 0,this.me.forEach((t=>t.stop())),this.me=[],this.ge.clear(),this.Y.stop()}ke(t,e){var i=t.group.conditions.properties;return!i||0===i.length||Ta(i,e,this._instance.get_property(Xn))}we(t){var e=this;this.me.forEach((t=>t.stop())),this.me=[],this.ge.clear();var i=function(t){var i=new po(e._instance,t,((i,r)=>{e.ce("linked_flag_matched",{flag:i,variant:r,group_id:t.id,group_name:t.name}),e.ve()}));e.me.push(i)};for(var r of t)i(r)}}var Aa=t=>{if(r){try{for(var e=t+"=",i=r.cookie.split(";").filter((t=>t.length)),n=0;i.length>n;n++){for(var s=i[n];" "==s.charAt(0);)s=s.substring(1,s.length);if(0===s.indexOf(e))return decodeURIComponent(s.substring(e.length,s.length))}}catch(t){}return null}},Oa="https?://(.*)",Fa=["gclid","gclsrc","dclid","gbraid","wbraid","fbclid","msclkid","twclid","li_fat_id","igshid","ttclid","rdt_cid","epik","qclid","sccid","irclid","_kx"],La=["utm_source","utm_medium","utm_campaign","utm_content","utm_term","gad_source","mc_cid",...Fa],$a="<masked>",Da=["li_fat_id"];function Na(t,e,i){if(!r)return{};var n,s=e?[...Fa,...i||[]]:[],o=qa(nr(r.URL,s,$a),t),a=(n={},Hi(Da,(function(t){var e=Aa(t);n[t]=e||null})),n);return zi(a,o)}function qa(t,e){var i=La.concat(e||[]),r={};return Hi(i,(function(e){var i=rr(t,e);r[e]=i||null})),r}function ja(t){var e=function(t){return t?0===t.search(Oa+"google.([^/?]*)")?"google":0===t.search(Oa+"bing.com")?"bing":0===t.search(Oa+"yahoo.com")?"yahoo":0===t.search(Oa+"duckduckgo.com")?"duckduckgo":null:null}(t),i="yahoo"!=e?"q":"p",n={};if(!ht(e)){n.$search_engine=e;var s=r?rr(r.referrer,i):"";s.length&&(n.ph_keyword=s)}return n}function Ba(){return navigator.language||navigator.userLanguage}var Ua="$direct";function Ha(){return(null==r?void 0:r.referrer)||Ua}function za(t,e,i){void 0===i&&(i=!1);var r=t?[...Fa,...e||[]]:[],s=i?Le(null==n?void 0:n.href):null==n?void 0:n.href,o=null==s?void 0:s.substring(0,1e3);return{r:Ha().substring(0,1e3),u:o?nr(o,r,$a):void 0}}function Wa(t,e){var i;void 0===e&&(e=!1);var r=t.r,n=t.u,s=e?Le(n):n,o={$referrer:r,$referring_domain:null==r?void 0:r==Ua?Ua:null==(i=er(r))?void 0:i.host};if(s){o.$current_url=s;var a=er(s);o.$host=null==a?void 0:a.host,o.$pathname=null==a?void 0:a.pathname;var l=qa(s);zi(o,l)}if(r){var u=ja(r);zi(o,u)}return o}function Va(){try{return Intl.DateTimeFormat().resolvedOptions().timeZone}catch(t){return}}function Ga(){try{return(new Date).getTimezoneOffset()}catch(t){return}}function Za(t){return at(t)?void 0:Math.round(t)}function Qa(t){return st(t)?t.network_timing:t}var Ja,Ka,Ya=36e5,Xa=943718.4,tl="[SessionRecording]",el=Bi(tl),il=[y.MouseMove,y.MouseInteraction,y.Scroll,y.ViewportResize,y.Input,y.TouchMove,y.MediaInteraction,y.Drag],rl=t=>({rrwebMethod:t,enqueuedAt:Date.now(),attempt:1});function nl(){var t;return null==v||null==(t=v.__PosthogExtensions__)?void 0:t.rrweb}function sl(){var t;return null==(t=nl())?void 0:t.record}function ol(t){try{return JSON.stringify(t)}catch(e){return JSON.stringify(t,yo())}}function al(t){return sa(ra(na(ol(t))))}function ll(t){return ul.apply(this,arguments)}function ul(){return(ul=f((function*(t){var e=ol(t),i=yield N(e,Ni.DEBUG,{rethrow:!0});return sa(new Uint8Array(yield i.arrayBuffer()))}))).apply(this,arguments)}var hl="undefined"!=typeof globalThis&&"CompressionStream"in globalThis&&"TextEncoder"in globalThis&&"Response"in globalThis&&"function"==typeof Response.prototype.blob,dl=!1;function vl(t){return rt(t)&&0===t.length?Ja=null!=Ja?Ja:al([]):al(t)}function cl(t){return fl.apply(this,arguments)}function fl(){return(fl=f((function*(t){return rt(t)&&0===t.length?Ja||(Ka=null!=Ka?Ka:ll([]).then((t=>(Ja=t,t))).catch((t=>{throw Ja=void 0,Ka=void 0,t}))):ll(t)}))).apply(this,arguments)}function pl(t){return hl&&!dl&&function(t){return t.type===m.FullSnapshot||t.type===m.IncrementalSnapshot&&(t.data.source===y.Mutation||t.data.source===y.StyleSheetRule)}(t)}function gl(t){return{event:t,size:bo(t)}}function ml(t,e){return p({},t,{data:e,cv:"2024-10"})}function yl(t,e){return p({},t,{cv:"2024-10",data:p({},t.data,e)})}function _l(t){try{if(t.type===m.FullSnapshot)return gl(ml(t,al(t.data)));if(t.type===m.IncrementalSnapshot&&t.data.source===y.Mutation)return gl(yl(t,{texts:vl(t.data.texts),attributes:vl(t.data.attributes),removes:vl(t.data.removes),adds:vl(t.data.adds)}));if(t.type===m.IncrementalSnapshot&&t.data.source===y.StyleSheetRule)return gl(yl(t,{adds:t.data.adds?al(t.data.adds):void 0,removes:t.data.removes?al(t.data.removes):void 0}))}catch(t){el.error("could not compress event - will use uncompressed event",t)}return{event:t,size:_o(t)}}function bl(){return bl=f((function*(t){try{if(t.type===m.FullSnapshot)return gl(ml(t,yield ll(t.data)));if(t.type===m.IncrementalSnapshot&&t.data.source===y.Mutation){var e=yield Promise.all([cl(t.data.texts),cl(t.data.attributes),cl(t.data.removes),cl(t.data.adds)]);return gl(yl(t,{texts:e[0],attributes:e[1],removes:e[2],adds:e[3]}))}if(t.type===m.IncrementalSnapshot&&t.data.source===y.StyleSheetRule){var i=yield Promise.all([t.data.adds?ll(t.data.adds):void 0,t.data.removes?ll(t.data.removes):void 0]);return gl(yl(t,{adds:i[0],removes:i[1]}))}}catch(e){return F(e)&&(dl=!0),el.error("could not compress event asynchronously - trying synchronous compression",e),_l(t)}return{event:t,size:_o(t)}})),bl.apply(this,arguments)}function wl(t,e){return t.type===m.Custom&&t.data.tag===e}function kl(t){return wl(t,"sessionIdle")}function Sl(t){return wl(t,"$session_ending")}function xl(t){return wl(t,"$session_starting")}class Cl{get sessionId(){return this._e}get Se(){if(!this._instance.sessionManager)throw new Error(tl+" must be started with a valid sessionManager.");return this._instance.sessionManager}get xe(){return this._instance.config.session_recording.session_idle_threshold_ms||3e5}get Ce(){return Ia(this._instance.get_property(Ln),this.sessionId)}get le(){var t,e=null==(t=this.Me)?void 0:t.sampleRate;return vt(e)?e:null}get Te(){var t,e;return null!==(t=null==(e=this.Ie)?void 0:e.getMinimumDuration(this.sessionId))&&void 0!==t?t:null}constructor(t,e){this.Ee="/s/",this._forceAllowLocalhostNetworkCapture=!1,this.Re=void 0,this.Ae=Date.now(),this.Le=!1,this.Oe=[],this.Fe="unknown",this.Ne=0,this.De=!1,this.Pe=!1,this.qe=!1,this.je=!1,this.Be=!1,this.He=!1,this.$e=!1,this.Ue=!1,this.We=!1,this.ze=!1,this.Ve=!1,this.Ze=!1,this.Qe=[],this.Ge=void 0,this.Ye=void 0,this.Je=[],this.Ke=0,this.Xe=0,this.et=!1,this.tt=void 0,this.pe=void 0,this.rt=void 0,this.it=void 0,this.nt=void 0,this.ot=(t,e,i)=>{var r,n,s;if(i&&(t!==this._e||e!==this.st)){var o,a=!i.noSessionId&&(i.activityTimeout||i.sessionPastMaximumLength),l=this._e,u=this.st;if(a&&this.be("$session_ending",{currentSessionId:l,currentWindowId:u,nextSessionId:t,nextWindowId:e,changeReason:i,lastActivityTimestamp:this.Ae,flushed_size:null==(o=this.ut)?void 0:o.currentTrackedSize(l)}),null==(r=this._instance.persistence)||r.unregister(Un),this.$e=!1,null==(n=nl())||null==n.resetMaxDepthState||n.resetMaxDepthState(),this.be("$session_id_change",{sessionId:t,windowId:e,changeReason:i}),this.ht(),!(!1===this.Fe&&this.isStarted||this._e===t&&this.st===e)){var h=this._e!==t&&!1!==this.Fe;this.Fe="unknown",this.ct(h)}a&&this.be("$session_starting",{previousSessionId:l,previousWindowId:u,nextSessionId:t,nextWindowId:e,changeReason:i,lastActivityTimestamp:this.Ae}),null==(s=this.Ie)||s.makeSamplingDecisions(t)}},this.dt=()=>{var t;return(null==(t=this._instance.persistence)?void 0:t.props[$n])===this._e},this.vt=()=>{var t,e;if(0===this.ft.data.length)return null;var i=null==(t=this.ft.data[0])?void 0:t.timestamp,r=null==(e=this.ft.data[this.ft.data.length-1])?void 0:e.timestamp;return vt(i)&&vt(r)?r-i:null},this.yt=()=>{var t,e,i=this.Te;if(!vt(i))return!1;if(null===(t=null==(e=this._instance.config.session_recording)?void 0:e.strictMinimumDuration)||void 0===t||!t){var r=this.bt;return vt(r)&&r>=0&&i>r}if(this.dt())return!1;var n,s=this.vt();return!!ht(s)||i>s||(null==(n=this._instance.persistence)||n.register({[$n]:this._e}),!1)},this.wt=()=>{this.status!==Gs?(this.De&&this.Pe&&this.kt&&!this.qe&&(this.De=!1),this._t(),this.St()):this.xt()},this.Ct=()=>{this.wt()},this.Mt=()=>{this.be("browser offline",{})},this.Tt=()=>{this.be("browser online",{})},this.It=()=>{null!=r&&r.visibilityState&&("visible"===r.visibilityState&&(this.kt=!0),this.be("window "+r.visibilityState,{}))},this._instance=t,this.kt=null==e||e;var i=this.Se.checkAndGetSessionAndWindowId(),n=i.windowId;this._e=i.sessionId,this.st=n,this.K=new co(this._instance),this.Y=new vo(this._instance),this.J=new fo(this._instance),this.ft=this.xt(),this.Se.sessionTimeoutMs>this.xe||el.warn("session_idle_threshold_ms ("+this.xe+") is greater than the session timeout ("+this.Se.sessionTimeoutMs+"). Session will never be detected as idle"),this.ut=new aa(this._instance)}setDocumentWasEverVisible(t){t&&(this.kt=!0)}get Et(){var t,e,i,r,n,s,o,a,l,u=null==(t=this.Me)?void 0:t.masking,h={maskAllInputs:null==(e=this._instance.config.session_recording)?void 0:e.maskAllInputs,maskTextSelector:null==(i=this._instance.config.session_recording)?void 0:i.maskTextSelector,blockSelector:null==(r=this._instance.config.session_recording)?void 0:r.blockSelector,maskAllElementAttributes:null==(n=this._instance.config.session_recording)?void 0:n.maskAllElementAttributes},d=null!==(s=null==h?void 0:h.maskAllInputs)&&void 0!==s?s:null==u?void 0:u.maskAllInputs,v=null!==(o=null==h?void 0:h.maskTextSelector)&&void 0!==o?o:null==u?void 0:u.maskTextSelector,c=null!==(a=null==h?void 0:h.blockSelector)&&void 0!==a?a:null==u?void 0:u.blockSelector,f=null!==(l=null==h?void 0:h.maskAllElementAttributes)&&void 0!==l?l:null==u?void 0:u.maskAllElementAttributes;return at(d)&&at(v)&&at(c)&&at(f)?void 0:{maskAllInputs:null==d||d,maskTextSelector:v,blockSelector:c,maskAllElementAttributes:f}}Rt(){var t;if(!this.We){var e=null==(t=this.Me)?void 0:t.masking;if(!dt(e)){var i=this._instance.config.session_recording,r=["maskAllInputs","maskTextSelector","blockSelector","maskAllElementAttributes"].filter((t=>{var r=null==i?void 0:i[t],n=e[t];return!at(r)&&r!==n}));0!==r.length&&(this.We=!0,el.warn('Session recording masking is configured both in `posthog.init` and in your project settings, and they differ. The `session_recording` options in `posthog.init` take precedence, so the project ("Privacy and masking") setting is ignored for: '+r.join(", ")+". Remove these masking options from `posthog.init` to use the project setting instead. See https://posthog.com/docs/session-replay/privacy",{client:{maskAllInputs:null==i?void 0:i.maskAllInputs,maskTextSelector:null==i?void 0:i.maskTextSelector,blockSelector:null==i?void 0:i.blockSelector,maskAllElementAttributes:null==i?void 0:i.maskAllElementAttributes},project:e}))}}}get At(){var t;return Tt(null==(t=this._instance.config.session_recording.canvasCapture)?void 0:t.resolutionScale,.1,1,Bi("canvas recording resolution scale"),1)}get Lt(){var t,e,i,r,n,s,o,a=this._instance.config.session_recording.captureCanvas,l=null==(t=this.Me)?void 0:t.canvasRecording,u=null!==(e=null!==(i=null==a?void 0:a.recordCanvas)&&void 0!==i?i:null==l?void 0:l.enabled)&&void 0!==e&&e,h=null!==(r=null!==(n=null==a?void 0:a.canvasFps)&&void 0!==n?n:null==l?void 0:l.fps)&&void 0!==r?r:4,d=null!==(s=null!==(o=null==a?void 0:a.canvasQuality)&&void 0!==o?o:null==l?void 0:l.quality)&&void 0!==s?s:.4;if("string"==typeof d){var v=parseFloat(d);d=isNaN(v)?.4:v}return{enabled:u,fps:Tt(h,0,12,Bi("canvas recording fps"),4),quality:Tt(d,0,1,Bi("canvas recording quality"),.4)}}get Ot(){var t,e=!(null==(t=this.Me)||!t.consoleLogRecordingEnabled),i=this._instance.config.enable_recording_console_log;return null!=i?i:e}get Ft(){var t,e,i,r=null==(t=this.Me)?void 0:t.networkPayloadCapture,n={recordHeaders:null==(e=this._instance.config.session_recording)?void 0:e.recordHeaders,recordBody:null==(i=this._instance.config.session_recording)?void 0:i.recordBody},s=(null==n?void 0:n.recordHeaders)||(null==r?void 0:r.recordHeaders),o=(null==n?void 0:n.recordBody)||(null==r?void 0:r.recordBody),a=Qa(this._instance.config.capture_performance),l=Qa(null==r?void 0:r.capturePerformance),u=!!(ft(a)?a:l);return s||o||u?{recordHeaders:s,recordBody:o,recordPerformance:u}:void 0}Nt(){var t,e,i=[],r=null==(t=v.__PosthogExtensions__)||null==(t=t.rrwebPlugins)?void 0:t.getRecordConsolePlugin;r&&this.Ot&&i.push(r());var s=null==(e=v.__PosthogExtensions__)||null==(e=e.rrwebPlugins)?void 0:e.getRecordNetworkPlugin;if(this.Ft&&nt(s))if(!Xi.includes(n.hostname)||this._forceAllowLocalhostNetworkCapture){var o=nt(this._instance.requestRouter.isIngestionEndpoint)?this._instance.requestRouter.isIngestionEndpoint.bind(this._instance.requestRouter):void 0;i.push(s(((t,e,i)=>{var r,n={payloadSizeLimitBytes:nn.payloadSizeLimitBytes,performanceEntryTypeToObserve:[...nn.performanceEntryTypeToObserve],payloadHostDenyList:[...e.payloadHostDenyList||[],...nn.payloadHostDenyList]},s=!1!==t.session_recording.recordHeaders&&e.recordHeaders,o=!1!==t.session_recording.recordBody&&e.recordBody,a=!1!==t.capture_performance&&e.recordPerformance,l=(r=rn(n),t=>(null!=t&&t.requestBody&&(t.requestBody=hn(t.requestBody,t.requestHeaders,r,"Request")),null!=t&&t.responseBody&&(t.responseBody=hn(t.responseBody,t.responseHeaders,r,"Response")),t)),u=e=>{return l(((t,e,i)=>{var r;if(null==i||!i(t.name)){var n=er(t.name),s=0===e.indexOf("http")?null==(r=er(e))?void 0:r.pathname:e;"/"===s&&(s="");var o=null==n?void 0:n.pathname.replace(s||"","");if(!(n&&o&&un.some((t=>0===o.indexOf(t)))))return t}})((ln((r=e).requestHeaders),ln(r.responseHeaders),r),t.api_host,i));var r},h=nt(t.session_recording.maskNetworkRequestFn);return h&&nt(t.session_recording.maskCapturedNetworkRequestFn)&&ji.warn("Both `maskNetworkRequestFn` and `maskCapturedNetworkRequestFn` are defined. `maskNetworkRequestFn` will be ignored."),h&&(t.session_recording.maskCapturedNetworkRequestFn=e=>{var i=t.session_recording.maskNetworkRequestFn({url:e.name});return!i&&e.isInitial?i:p({},e,{name:null==i?void 0:i.url})}),n.maskRequestFn=nt(t.session_recording.maskCapturedNetworkRequestFn)?e=>{var i=u(e);if(i){var r=i.isInitial?{name:"",entryType:i.entryType,startTime:i.startTime,duration:i.duration,endTime:i.endTime,timeOrigin:i.timeOrigin,timestamp:i.timestamp,isInitial:!0}:void 0,n=null==t.session_recording.maskCapturedNetworkRequestFn?void 0:t.session_recording.maskCapturedNetworkRequestFn(i);return dt(n)&&r?(vn.add(r),r):null!=n?n:void 0}}:t=>function(t){if(!at(t))return t.requestBody=dn(t.requestBody,"Request"),t.responseBody=dn(t.responseBody,"Response"),t}(u(t)),p({},nn,n,{recordHeaders:s,recordBody:o,recordPerformance:a,recordInitialRequests:a,streamNetworkBody:!0===t.session_recording.streamNetworkBody})})(this._instance.config,this.Ft,o)))}else el.info("NetworkCapture not started because we are on localhost.");return i}Dt(t){return this._instance.config.disable_capture_url_hashes?Le(t):t}Pt(t,e){void 0===e&&(e=!1);var i=e?Le(t):this.Dt(t),r=this._instance.config.mask_personal_data_properties?[...Fa,...this._instance.config.custom_personal_data_properties||[]]:[];return this.qt(nr(i,r,$a))}qt(t){var e=this._instance.config.session_recording;if(e.maskCapturedNetworkRequestFn){var i,r=e.maskCapturedNetworkRequestFn({name:t});return null!==(i=null==r?void 0:r.name)&&void 0!==i?i:null==r?void 0:r.url}if(e.maskNetworkRequestFn){var n=e.maskNetworkRequestFn({url:t});return null==n?void 0:n.url}return t}jt(t){try{return t.rrwebMethod(),!0}catch(e){return 10>this.Oe.length?this.Oe.push({enqueuedAt:t.enqueuedAt||Date.now(),attempt:t.attempt+1,rrwebMethod:t.rrwebMethod}):el.warn("could not emit queued rrweb event.",e,t),!1}}be(t,e){return this.jt(rl((()=>sl().addCustomEvent(t,e))))}Bt(){try{if(this._instance.config.capture_pageview||!t)return;var e=new URL(t.location.href),i=this.Pt(e.origin+e.pathname+e.search);this.Ht!==i&&(this.Ht=i,this.be("$url_changed",{href:i}))}catch(t){}}$t(){if(this.Oe.length){var t=[...this.Oe];this.Oe=[],t.forEach((t=>{Date.now()-t.enqueuedAt>2e3||this.jt(t)}))}}de(){return this.jt(rl((()=>sl().takeFullSnapshot())))}get Ut(){var t,e,i;if(null!=(t=this.Ie)&&t.hasPendingTriggers(this.sessionId)&&!["sampled","active"].includes(this.status)){var r,n=null==(r=this._instance.config.session_recording)?void 0:r.trigger_pending_buffer_interval_millis;return vt(n)&&Number.isFinite(n)&&n>=1e3&&36e5>=n?n:6e4}return null!==(e=null==(i=this._instance.config.session_recording)?void 0:i.full_snapshot_interval_millis)&&void 0!==e?e:3e5}Wt(){if(this.zt&&clearInterval(this.zt),!0!==this.Fe){var t=this.Ut;t&&(this.zt=setInterval((()=>{this.de()}),t))}}ve(t){"event"===t&&this.Vt(),!this.Y.urlBlocked&&["sampled","active"].includes(this.status)&&this.Wt()}Zt(){this.Y.urlBlocked||(this.Y.urlBlocked=!0,clearInterval(this.zt),el.info("recording paused due to URL blocker"),this.be("recording paused",{reason:"url blocker"}))}Qt(){this.Y.urlBlocked&&(this.Y.urlBlocked=!1,this.de(),this.Wt(),this.be("recording resumed",{reason:"left blocked url"}),el.info("recording resumed"))}Gt(t,e){var i;if("event"===t&&this.Vt(),!this.Le&&null!=(i=this.Ie)&&i.hasPendingTriggers(this.sessionId)){this.Le=!0;try{var r,n;null==(r=this._instance.persistence)||r.register({["url"===t?Dn:Nn]:this.sessionId}),null==(n=this.Ie)||n.updateActiveTriggers(this.sessionId),this.ve(),this.St(),this.ce(t+"_trigger_matched",{["url"===t?"matchedUrl":"matchedEvent"]:e})}finally{this.Le=!1}}}get isStarted(){return!!this.Re}get Me(){var t=this._instance.get_property(Mn);if(t){var e;try{e=st(t)?t:JSON.parse(t)}catch(t){return void el.warn("persisted remote config for session recording is invalid and will be ignored",t)}if(!this.isStarted){var i,r,n=null!==(i=e.cache_timestamp)&&void 0!==i?i:Date.now();if(Date.now()-n>Ya)return el.info("persisted remote config for session recording is stale and will be ignored",{cacheTimestamp:n,persistedConfig:t}),void(null==(r=this._instance.persistence)||r.unregister(Mn))}return e}}Yt(t,e,i){this._instance.get_property(t)&&(e(),i())}start(e){var i,n,s=this.Me;if(s){this.isStarted||(this.De=!1!==this.Fe&&!this.je,this.je=!1,this.Pe=this.De,this.qe=!1),this.et&&(this.Jt(),this.xt());var o=this.Se.checkAndGetSessionAndWindowId(),a=o.windowId;this._e=o.sessionId,this.st=a,null==(i=this._instance.persistence)||i.unregister(Un),null!=s&&s.endpoint&&(this.Ee=null==s?void 0:s.endpoint),this.Ie=2===(null==s?void 0:s.version)&&(null==s?void 0:s.triggerGroups)&&s.triggerGroups.length>0?new Pa(this._instance,this.Y,this.ce.bind(this),this.be.bind(this),this.ve.bind(this)):new Ra(this._instance,this.Y,this.J,this.K,this.ce.bind(this),this.de.bind(this),this.ve.bind(this)),this.Ie.onRemoteConfig(s),null==(n=this.pe)||n.call(this),this.pe=this.Ie.setupEventTriggerListeners(this._instance.on.bind(this._instance,"eventCaptured"),this.sessionId,((t,e)=>this.Gt(t,e))),this.Yt(Rn,(()=>{this.overrideSampling()}),(()=>{var t;return null==(t=this._instance.persistence)?void 0:t.unregister(Rn)})),this.Yt(Pn,(()=>{this.overrideLinkedFlag()}),(()=>{var t;return null==(t=this._instance.persistence)?void 0:t.unregister(Pn)})),this.Yt(On,(()=>{this.overrideTrigger("event")}),(()=>{var t;return null==(t=this._instance.persistence)?void 0:t.unregister(On)})),this.Yt(An,(()=>{this.overrideTrigger("url")}),(()=>{var t;return null==(t=this._instance.persistence)?void 0:t.unregister(An)})),this.Ie.makeSamplingDecisions(this.sessionId),this.Kt(),this.Be||(Ki(t,"beforeunload",this.wt),Ki(t,"pagehide",this.Ct),Ki(t,"offline",this.Mt),Ki(t,"online",this.Tt),Ki(r,"visibilitychange",this.It),!this.rt&&nt(this.Se.onSessionId)&&(this.rt=this.Se.onSessionId(this.ot)),!this.it&&nt(this.Se.on)?this.it=this.Se.on("forcedIdleReset",(()=>{this.ht(),this.Fe="unknown",this.stop(),this.nt=this.Se.onSessionId(((t,e,i)=>{var r;null==(r=this.nt)||r.call(this),this.nt=void 0,this.ot(t,e,i)}))})):nt(this.Se.on)||el.warn("bundled core has no SessionIdManager.on (requires posthog-js >= 1.268.6); recording will start but skip forced-idle-reset handling"),dt(this.tt)&&(this.tt=this._instance.on("eventCaptured",(t=>{try{if("$pageview"===t.event){var e=null!=t&&t.properties.$current_url?this.Pt(t.properties.$current_url):"";if(!e)return;this.be("$pageview",{href:e})}}catch(t){el.error("Could not add $pageview to rrweb session",t)}}))),this.status===Vs&&this.ce(e||"recording_initialized"))}else el.info("remote config must be stored in persistence before recording can start")}Xt(){var e,i,n,s,o,a;null==t||t.removeEventListener("beforeunload",this.wt),null==t||t.removeEventListener("pagehide",this.Ct),null==t||t.removeEventListener("offline",this.Mt),null==t||t.removeEventListener("online",this.Tt),null==r||r.removeEventListener("visibilitychange",this.It),clearInterval(this.zt),this.er(),null==(e=this.tt)||e.call(this),this.tt=void 0,null==(i=this.pe)||i.call(this),this.pe=void 0,null==(n=this.rt)||n.call(this),this.rt=void 0,null==(s=this.it)||s.call(this),this.it=void 0,null==(o=this.nt)||o.call(this),this.nt=void 0,null==(a=this.Ie)||a.stop(),this.tr(),this.Jt()}Jt(){this.Xe+=1,this.Je=[],this.Ke=0,this.rr=void 0,this.et=!1}tr(){var t,e;null==(t=this.ir)||t.stop(),this.Oe=[],null==(e=this.Re)||e.call(this),this.Re=void 0}nr(){if(!this.rr||0===this.Ke)return!1;if(this.et)return!0;this.et=!0;var t=this.Xe;return this.er(),this.tr(),this.rr.catch((()=>{})).then((()=>{t===this.Xe&&(this.et=!1,this.St(),this.xt(),this.Xt(),el.info("stopped"))})).catch((()=>{this.et=!1,this.Xt(),el.info("stopped")})),!0}stop(){this.tr(),this.nr()||(this.St(),this.xt(),this.Xt(),el.info("stopped"))}ct(t){var e;this.stop(),this.ar=void 0,this.sr=void 0,null==(e=nl())||null==e.resetSnapshotCostState||e.resetSnapshotCostState(),this.start("session_id_changed"),this.De=t,this.Pe=!1}Vt(){this.isStarted||(this.je=!0),this.De&&(this.De=!1,this.Pe=!1,this.qe&&(this.qe=!1,this.de()),this.ur())}discard(){this.xt(),this.Xt(),el.info("discarded")}lr(t,e,i,r,n){var s={$snapshot_bytes:i,$snapshot_data:e,$session_id:r,$window_id:n};this.status!==zs?(this.hr(t,r),this.cr(s)):this.xt()}dr(){try{this.vr()}catch(t){this.Ue||(this.Ue=!0,el.error("could not track full snapshot cost",t))}}vr(){var t,e=null==(t=nl())||null==t.getLastSnapshotCost?void 0:t.getLastSnapshotCost();e&&e!==this.sr&&(this.sr=e,this.ar&&this.ar.durationMs>=e.durationMs||(this.ar=e),500>e.durationMs||el.warn("full snapshot was slow, the page may have been unresponsive while it ran",{durationMs:Math.round(e.durationMs),stylesheetMs:Math.round(e.stylesheetMs),nodeCount:e.nodeCount,cssRuleCount:e.cssRuleCount,nonDeferrableCssRuleCount:e.nonDeferrableCssRuleCount,deferredStylesheetCount:e.deferredStylesheetCount}))}hr(t,e){t.type!==m.FullSnapshot?t.type===m.IncrementalSnapshot&&(at(this.Ge)||this.Ge===e||this.Ye===e||(this.Ye=e,el.info("incremental snapshot for a session with no full snapshot - requesting one",{sessionId:e}),this.de())):this.Ge=e}pr(t){t.counted&&t.generation===this.Xe&&(this.Ke=Math.max(0,this.Ke-1)),t.counted=!1,this.Je=this.Je.filter((e=>e!==t))}mr(t,e,i){t.processed||t.generation!==this.Xe||(t.processed=!0,this.lr(t.event,e,i,t.targetSessionId,t.targetWindowId))}gr(t){try{var e=t.compressionEnabled?_l(t.event):{event:t.event,size:_o(t.event)};this.mr(t,e.event,e.size)}finally{this.pr(t)}}_t(){[...this.Je].forEach((t=>{this.gr(t)}))}yr(t,e,i,r){var n=this,s={event:t,compressionEnabled:e,targetSessionId:i,targetWindowId:r,generation:this.Xe,processed:!1,counted:!0};this.Je.push(s),this.Ke+=1;var o=function(){var i=f((function*(){try{if(s.processed)return;var i,r;try{var o=e?pl(t)?yield function(t){return bl.apply(this,arguments)}(t):_l(t):{event:t,size:_o(t)};i=o.event,r=o.size}catch(e){el.error("could not process queued compression event - will use uncompressed event",e),i=t,r=_o(t)}n.mr(s,i,r)}finally{n.pr(s)}}));return function(){return i.apply(this,arguments)}}();this.rr=this.rr?this.rr.catch((()=>{})).then(o):o()}onRRwebEmit(t){var e,i,r,n,s,o,a,l,u;if(this._instance.sessionManager&&(this.$t(),t&&st(t))){if(t.type===m.Meta){var h=this.Pt(t.data.href);if(this.Ht=h,!h)return;t.data.href=h}else this.Bt();if(null==(e=this.Ie)||e.checkUrlTriggers(this.sessionId,(()=>this.Zt()),(()=>this.Qt()),((t,e)=>this.Gt(t,e))),!this.Y.urlBlocked||function(t){return t.type===m.Custom&&"recording paused"===t.data.tag}(t)){var d,v,c;t.type===m.FullSnapshot&&(null!=(d=nl())&&null!=d.wasMaxDepthReached&&d.wasMaxDepthReached()&&(this.$e=!0),this.dr(),Promise.resolve().then((()=>this.dr())),this.Wt(),null==(v=this.ir)||v.reset(),null==(c=this._instance.persistence)||c.register_once({[Un]:t.timestamp},void 0)),t.type===m.FullSnapshot&&null!=(i=this.Ie)&&i.hasPendingTriggers(this.sessionId)&&this.br();var f=this.ir?this.ir.throttleMutations(t):t;if(f){var p=function(t){var e=t;if(e&&st(e)&&6===e.type&&st(e.data)&&"rrweb/console@1"===e.data.plugin){e.data.payload.payload.length>10&&(e.data.payload.payload=e.data.payload.payload.slice(0,10),e.data.payload.payload.push("...[truncated]"));for(var i=[],r=0;e.data.payload.payload.length>r;r++)i.push(e.data.payload.payload[r]&&e.data.payload.payload[r].length>2e3?e.data.payload.payload[r].slice(0,2e3)+"...[truncated]":e.data.payload.payload[r]);return e.data.payload.payload=i,t}return t}(f),g=function(t){return Sl(t)?t.data.payload:null}(p),_=function(t){return xl(t)?t.data.payload:null}(p),b=function(t){return kl(t)?t.data.payload:null}(p);g||_?null!=g&&g.lastActivityTimestamp&&(p.timestamp=g.lastActivityTimestamp):null!=b&&b.sessionId||this.wr(p),t.type===m.FullSnapshot&&(this.Qe.push([this._e,t.timestamp]),this.Qe.length>6&&(this.Qe=this.Qe.slice(-6)));var w=null!==(r=null!==(n=null!==(s=null==g?void 0:g.currentSessionId)&&void 0!==s?s:null==_?void 0:_.nextSessionId)&&void 0!==n?n:null==b?void 0:b.sessionId)&&void 0!==r?r:this._e,k=null!==(o=null!==(a=null!==(l=null==g?void 0:g.currentWindowId)&&void 0!==l?l:null==_?void 0:_.nextWindowId)&&void 0!==a?a:null==b?void 0:b.windowId)&&void 0!==o?o:this.st;if(!0!==this.Fe||function(t){return kl(t)||Sl(t)||xl(t)}(p)){p.type===m.FullSnapshot&&(this.Ne=0),b&&(p.timestamp=b.lastActivityTimestamp+b.threshold);var S=null===(u=this._instance.config.session_recording.compress_events)||void 0===u||u;if(this.Ke>0||S&&pl(p))this.yr(p,S,w,k);else{var x=S?_l(p):{event:p,size:_o(p)};this.lr(p,x.event,x.size,w,k)}}else(function(t){return t.type===m.FullSnapshot||t.type===m.Meta||t.type===m.IncrementalSnapshot&&t.data.source!==y.CanvasMutation})(p)&&this.Ne++}else!0===this.Fe&&this.Ne++}}}get status(){return this.Ie?this.Ie.getStatus({instance:this._instance,sessionId:this.sessionId,isSampled:this.Ce,rrwebError:this.Be,urlTriggerMatching:this.Y,eventTriggerMatching:this.J,linkedFlagMatching:this.K,remoteConfig:this.Me}):zs}log(t,e){var i;void 0===e&&(e="log"),null==(i=this._instance.sessionRecording)||i.onRRwebEmit({type:6,data:{plugin:"rrweb/console@1",payload:{level:e,trace:[],payload:[JSON.stringify(t)]}},timestamp:Date.now()})}overrideLinkedFlag(){this.K.linkedFlagSeen=!0,this.de(),this.Vt(),this.ce("linked_flag_overridden")}overrideSampling(){var t;null==(t=this._instance.persistence)||t.register({[Ln]:this.sessionId,[In]:null}),this.de(),this.Vt(),this.ce("sampling_overridden")}overrideTrigger(t){this.Gt(t),this.Vt()}kr(){try{var e,i=null==t||null==(e=t.location)?void 0:e.href;if(!i)return;var r=this.Pt(i);if(!r)return;return new URL(r).hostname||void 0}catch(t){return}}er(){this._r&&(clearTimeout(this._r),this._r=void 0)}ur(){this._r||(this._r=setTimeout((()=>{this.St()}),2e3))}Sr(){return this.Ge!==this.ft.sessionId&&0!==this.ft.data.length&&this.ft.data.every((t=>(null==t?void 0:t.type)===m.Custom&&!Sl(t)&&!xl(t)))}Cr(){var t,e;return null!==(t=null==(e=this.Ie)?void 0:e.getPendingTriggerConditions(this.sessionId))&&void 0!==t?t:[]}Mr(t){if(t!==Gs)return at(this.Tr)||this._instance.register_for_session({[Es]:[]}),void(this.Tr=void 0);var e=this.Cr();if(0===e.length)return at(this.Tr)||this._instance.register_for_session({[Es]:[]}),void(this.Tr=void 0);var i=e.join(", "),r=this.sessionId+":"+i;r!==this.Tr&&(this.Tr=r,this._instance.register_for_session({[Es]:e}),el.info("buffering: "+i))}St(){var t;if(this.er(),this.De)return this.ft;if(this.Sr())return this.ft.size>Xa?this.xt():this.ft;var e=this.ft;null==(t=this.Ie)||t.ensureSamplingDecision(this.sessionId);var i=this.yt(),r=this.status;if(this.Mr(r),r===Gs||r===Zs||r===zs||i)return this.ur(),this.ft;if(this.ft!==e)return this.ft;if(e.data.length>0){var n,s=this.kr();wo(e).forEach((t=>{var e;null==(e=this.ut)||e.trackSize(t.sessionId,t.size),this.Ir({$snapshot_bytes:t.size,$snapshot_data:t.data,$session_id:t.sessionId,$window_id:t.windowId,$lib:Ni.LIB_NAME,$lib_version:Ni.LIB_VERSION,$snapshot_host:s})})),null==(n=this.Ie)||n.onFlushComplete()}return this.xt()}cr(t){var e,i=2+((null==(e=this.ft)?void 0:e.data.length)||0),r=t.$session_id,n=this.ft.sessionId!==r;if(n||!0!==this.Fe&&!this.De&&this.ft.size+t.$snapshot_bytes+i>Xa){var s=this._e;if(this.ft=this.St(),this._e!==s)return;n&&this.ft.data.length>0&&(this.ft=this.xt()),this.ft.sessionId=r,this.ft.windowId=t.$window_id}this.De&&(this.qe||this.ft.size+t.$snapshot_bytes+i>Xa)?this.qe||(this.qe=!0,this.ft=this.xt()):(this.ft.size+=t.$snapshot_bytes,this.ft.data.push(t.$snapshot_data),this.ft.sizes.push(t.$snapshot_bytes),!0===this.Fe||this.De||this.ur())}Ir(t){this._instance.capture("$snapshot",t,{_url:this._instance.requestRouter.endpointFor("api",this.Ee),_noTruncate:!0,_batchKey:"recordings",skip_client_rate_limiting:!0})}get bt(){var t,e,i=null==(t=this.ft)?void 0:t.data[(null==(e=this.ft)?void 0:e.data.length)-1],r=this.Se.checkAndGetSessionAndWindowId(!0);return i?i.timestamp-r.sessionStartTimestamp:null}br(){if(!this.ft||0===this.ft.data.length)return this.xt();for(var t=-1,e=this.ft.data.length-1;e>=0;e--)if(this.ft.data[e].type===m.Meta){t=e;break}return 0>t?this.xt():(this.ft.data=this.ft.data.slice(t),this.ft.sizes=this.ft.sizes.slice(t),this.ft.size=this.ft.sizes.reduce(((t,e)=>t+e),0),this.ft)}xt(){return this.ft={size:0,data:[],sizes:[],sessionId:this._e,windowId:this.st},this.ft}ce(t,e){this._instance.register_for_session({[Ps]:t}),el.info(t.replace("_"," "),e),"session_id_changed"!==t&&this.be("$recording_started",p({reason:t},e))}Er(t){var e;return 3===t.type&&-1!==il.indexOf(null==(e=t.data)?void 0:e.source)}wr(t){var e=this.Er(t);e||!0===this.Fe||t.timestamp-this.Ae>this.xe&&(this.Fe=!0,clearInterval(this.zt),this.be("sessionIdle",{eventTimestamp:t.timestamp,lastActivityTimestamp:this.Ae,threshold:this.xe,bufferLength:this.ft.data.length,bufferSize:this.ft.size,sessionId:this._e,windowId:this.st}),this.St());var i=!1;if(e&&(this.Ae=t.timestamp,this.Fe)){var r="unknown"===this.Fe;this.Fe=!1,r||(this.be("sessionNoLongerIdle",{reason:"user activity",type:t.type}),i=!0)}var n=this.Se.checkAndGetSessionAndWindowId(!e,t.timestamp),s=n.windowId,o=n.sessionId,a=this._e!==o,l=this.st!==s;if(this.st=s,this._e=o,a||l){var u=a&&!1!==this.Fe;u&&(this.Fe="unknown"),this.ct(u)}else if(e&&this.Vt(),i){var h,d=["sampled","active"].includes(this.status)||(null==(h=this.Ie)?void 0:h.hasPendingTriggers(this.sessionId));this.Ne>0&&d&&this.de(),this.Wt()}}ht(){var t;null==(t=this.Ie)||t.clearConditionalRecordingPersistence()}get sdkDebugProperties(){var t,e,i,r,n,s,o,a,l,u=this.Se.checkAndGetSessionAndWindowId(!0).sessionStartTimestamp,h=null==(t=nl())||null==t.getDeferredStylesheetStats?void 0:t.getDeferredStylesheetStats();return{$recording_status:this.status,$sdk_debug_replay_internal_buffer_length:this.ft.data.length,$sdk_debug_replay_internal_buffer_size:this.ft.size,$sdk_debug_current_session_duration:this.bt,$sdk_debug_session_start:u,$sdk_debug_replay_flushed_size:null==(e=this.ut)?void 0:e.currentTrackedSize(this.sessionId),$sdk_debug_replay_full_snapshots:this.Qe,$snapshot_max_depth_exceeded:this.$e,$sdk_debug_replay_slowest_full_snapshot_ms:Za(null==(i=this.ar)?void 0:i.durationMs),$sdk_debug_replay_slowest_full_snapshot_stylesheet_ms:Za(null==(r=this.ar)?void 0:r.stylesheetMs),$sdk_debug_replay_slowest_full_snapshot_nodes:null==(n=this.ar)?void 0:n.nodeCount,$sdk_debug_replay_slowest_full_snapshot_css_rules:null==(s=this.ar)?void 0:s.cssRuleCount,$sdk_debug_replay_slowest_full_snapshot_css_rules_non_deferrable:null==(o=this.ar)?void 0:o.nonDeferrableCssRuleCount,$sdk_debug_replay_deferred_stylesheets:null==h?void 0:h.deferredCount,$sdk_debug_replay_deferred_stylesheets_failed:null==h?void 0:h.failedCount,$sdk_debug_replay_deferred_stylesheets_abandoned:null==h?void 0:h.abandonedCount,$sdk_debug_replay_deferred_stylesheet_ms:Za(null==h?void 0:h.totalMs),$sdk_debug_replay_deferred_stylesheet_slowest_slice_ms:Za(null==h?void 0:h.slowestSliceMs),$sdk_debug_replay_slowest_mutation_batch_ms:Za(null==(a=nl())||null==a.getMutationCost||null==(a=a.getMutationCost())?void 0:a.slowestBatchMs),$sdk_debug_replay_discarded_duration_samples:null==(l=nl())||null==l.getDiscardedDurationSamples?void 0:l.getDiscardedDurationSamples(),$sdk_debug_replay_rrweb_error:this.Be,$sdk_debug_rrweb_attached:!!this.Re,$sdk_debug_rrweb_start_attempted:this.He}}Kt(){var t;if(!this.Re){this.He=!0;var e,i,r,n,s={blockClass:"ph-no-capture",blockSelector:void 0,ignoreClass:"ph-ignore-input",maskTextClass:"ph-mask",maskTextSelector:void 0,maskTextFn:void 0,maskAllInputs:!0,maskInputOptions:{password:!0},maskInputFn:void 0,maskAllElementAttributes:!1,maskAttributeFn:void 0,slimDOMOptions:{},collectFonts:!1,inlineStylesheet:!0,inlineStylesheetBudgetRules:1e4,recordCrossOriginIframes:!1,sampling:void 0,attributeFilter:void 0},o=this._instance.config.session_recording;for(var a of Object.entries(o||{})){var l=a[0],u=a[1];if(l in s)if("maskInputOptions"===l)s.maskInputOptions=p({password:!0},u);else if("sampling"===l){var h=null!=u?u:{},d={};at(h.mousemove)||(d.mousemove=h.mousemove),at(h.mouseInteraction)||(d.mouseInteraction=h.mouseInteraction),s.sampling=d}else s[l]=u}this.Lt&&this.Lt.enabled&&(s.recordCanvas=!0,s.sampling=p({},s.sampling,{canvas:this.Lt.fps}),s.dataURLOptions={type:"image/webp",quality:this.Lt.quality},s.canvasResolutionScale=this.At,s.canvasMasking={configured:()=>{var t;return nt(null==(t=this._instance.config.session_recording)||null==(t=t.canvasCapture)?void 0:t.maskRegionsFn)},regionsFn:t=>{var e,i=null==(e=this._instance.config.session_recording)||null==(e=e.canvasCapture)?void 0:e.maskRegionsFn;if(nt(i))try{var r;return null!==(r=i(t))&&void 0!==r?r:null}catch(t){return this.Ve||(this.Ve=!0,el.warn("canvasCapture.maskRegionsFn threw, canvas frames will be skipped",t)),null}}}),this.Et&&(s.maskAllInputs=null===(e=this.Et.maskAllInputs)||void 0===e||e,s.maskTextSelector=null!==(i=this.Et.maskTextSelector)&&void 0!==i?i:void 0,s.blockSelector=null!==(r=this.Et.blockSelector)&&void 0!==r?r:void 0,s.maskAllElementAttributes=null!==(n=this.Et.maskAllElementAttributes)&&void 0!==n&&n),s.maskAllElementAttributes&&s.maskAttributeFn&&(s.maskAttributeFn=void 0,this.ze||(this.ze=!0,el.warn('`maskAllElementAttributes` and `maskAttributeFn` are mutually exclusive, and `maskAttributeFn` is being ignored. Remove one of the two. Note that `maskAllElementAttributes` can also come from your project\'s "Privacy and masking" settings. See https://posthog.com/docs/session-replay/privacy'))),this.Rt();var v=sl();if(v){this.ir=null!==(t=this.ir)&&void 0!==t?t:new oa(v,{refillRate:this._instance.config.session_recording.__mutationThrottlerRefillRate,bucketSize:this._instance.config.session_recording.__mutationThrottlerBucketSize,onBlockedNode:(t,e)=>{var i="Too many mutations on node '"+t+"'. Rate limiting. This could be due to SVG animations or something similar";el.info(i,{node:e}),this.log(tl+" "+i,"warn")}});var c=this.Nt();if(this.Re=v(p({emit:t=>{this.onRRwebEmit(t)},plugins:c,errorHandler:(t,e)=>"rrweb"===e&&(this.Ze||(this.Ze=!0,el.error("rrweb internal error - recording will continue but may be incomplete",t)),!0)},s)),!this.Re)return this.Be=!0,void el.error("rrweb failed to start - Loss of recording data is possible. Check the browser console for rrweb errors.");this.Be=!1,this.Ae=Date.now(),this.Fe=ft(this.Fe)?this.Fe:"unknown",this.tryAddCustomEvent("$remote_config_received",this.Me),this.be("$session_options",{sessionRecordingOptions:s,activePlugins:c.map((t=>null==t?void 0:t.name))}),this.be("$posthog_config",{config:this._instance.config})}else el.error("_startRecorder was called but rrwebRecord is not available. This indicates something has gone wrong.")}}tryAddCustomEvent(t,e){return this.be(t,e)}}var Tl,El=["type"],Ml=Object.defineProperty,Il=(t,e,i)=>((t,e,i)=>e in t?Ml(t,e,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[e]=i)(t,"symbol"!=typeof e?e+"":e,i),Rl=(t=>(t[t.DomContentLoaded=0]="DomContentLoaded",t[t.Load=1]="Load",t[t.FullSnapshot=2]="FullSnapshot",t[t.IncrementalSnapshot=3]="IncrementalSnapshot",t[t.Meta=4]="Meta",t[t.Custom=5]="Custom",t[t.Plugin=6]="Plugin",t))(Rl||{}),Pl=(t=>(t[t.Mutation=0]="Mutation",t[t.MouseMove=1]="MouseMove",t[t.MouseInteraction=2]="MouseInteraction",t[t.Scroll=3]="Scroll",t[t.ViewportResize=4]="ViewportResize",t[t.Input=5]="Input",t[t.TouchMove=6]="TouchMove",t[t.MediaInteraction=7]="MediaInteraction",t[t.StyleSheetRule=8]="StyleSheetRule",t[t.CanvasMutation=9]="CanvasMutation",t[t.Font=10]="Font",t[t.Log=11]="Log",t[t.Drag=12]="Drag",t[t.StyleDeclaration=13]="StyleDeclaration",t[t.Selection=14]="Selection",t[t.AdoptedStyleSheet=15]="AdoptedStyleSheet",t[t.CustomElement=16]="CustomElement",t))(Pl||{}),Al=(t=>(t[t.MouseUp=0]="MouseUp",t[t.MouseDown=1]="MouseDown",t[t.Click=2]="Click",t[t.ContextMenu=3]="ContextMenu",t[t.DblClick=4]="DblClick",t[t.Focus=5]="Focus",t[t.Blur=6]="Blur",t[t.TouchStart=7]="TouchStart",t[t.TouchMove_Departed=8]="TouchMove_Departed",t[t.TouchEnd=9]="TouchEnd",t[t.TouchCancel=10]="TouchCancel",t))(Al||{}),Ol=(t=>(t[t.Mouse=0]="Mouse",t[t.Pen=1]="Pen",t[t.Touch=2]="Touch",t))(Ol||{}),Fl=(t=>(t[t["2D"]=0]="2D",t[t.WebGL=1]="WebGL",t[t.WebGL2=2]="WebGL2",t))(Fl||{}),Ll=(t=>(t[t.Play=0]="Play",t[t.Pause=1]="Pause",t[t.Seeked=2]="Seeked",t[t.VolumeChange=3]="VolumeChange",t[t.RateChange=4]="RateChange",t))(Ll||{}),$l=(t=>(t[t.Document=0]="Document",t[t.DocumentType=1]="DocumentType",t[t.Element=2]="Element",t[t.Text=3]="Text",t[t.CDATA=4]="CDATA",t[t.Comment=5]="Comment",t))($l||{});function Dl(t,e){return-1!==t.indexOf(e)}var Nl={Node:["childNodes","parentNode","parentElement","textContent"],ShadowRoot:["host","styleSheets"],Element:["shadowRoot"],MutationObserver:[]},ql={Node:["contains","getRootNode"],ShadowRoot:["getSelection"],Element:["querySelector","querySelectorAll"],MutationObserver:["constructor"]},jl={};function Bl(t){if(jl[t])return jl[t];var e=function(t){var e,i,r=null==(i=null==(e=null==globalThis?void 0:globalThis.Zone)?void 0:e.__symbol__)?void 0:i.call(e,t);return r&&globalThis[r]?globalThis[r]:void 0}(t)||globalThis[t],i=e.prototype,r=t in Nl?Nl[t]:void 0,n=Boolean(r&&r.every((t=>{var e,r;return Boolean(null==(r=null==(e=Object.getOwnPropertyDescriptor(i,t))?void 0:e.get)?void 0:r.toString().includes("[native code]"))}))),s=t in ql?ql[t]:void 0,o=Boolean(s&&s.every((t=>{var e;return"function"==typeof i[t]&&(null==(e=i[t])?void 0:e.toString().includes("[native code]"))})));if(n&&o)return jl[t]=e.prototype,e.prototype;var a=document.createElement("iframe");a.style.display="none";var l=!1;try{document.body.appendChild(a);var u=a.contentWindow;if(!u)return e.prototype;var h=u[t].prototype;return h?(function(t){return Dl(t,"AppleWebKit")&&!Dl(t,"Chrome")}(navigator.userAgent)&&(a.classList.add("rr-block","ph-no-capture"),a.setAttribute("__rrwebUntaintedPrototype",t),l=!0),jl[t]=h):i}catch(t){return i}finally{!l&&a.parentNode&&document.body.removeChild(a)}}var Ul={};function Hl(t,e,i){var r,n=t+"."+String(i);if(Ul[n])return Ul[n].call(e);var s=Bl(t),o=null==(r=Object.getOwnPropertyDescriptor(s,i))?void 0:r.get;return o?(Ul[n]=o,o.call(e)):e[i]}var zl={};function Wl(t,e,i){var r=t+"."+String(i);if(zl[r])return zl[r].bind(e);var n=Bl(t)[i];return"function"!=typeof n?e[i]:(zl[r]=n,n.bind(e))}function Vl(){return Bl("MutationObserver").constructor}function Gl(t,e,i){try{if(!(e in t))return()=>{};var r=t[e],n={next:r},s=i((function(){for(var t=arguments.length,e=new Array(t),i=0;t>i;i++)e[i]=arguments[i];return n.next.apply(this,e)}));return"function"==typeof s&&(s.prototype=s.prototype||{},Object.defineProperties(s,{__rrweb_original__:{enumerable:!1,value:r},__rrweb_layer__:{enumerable:!1,value:n}})),t[e]=s,()=>{if(t[e]!==s)for(var i=t[e];"function"==typeof i&&i.__rrweb_layer__;){var r=i.__rrweb_layer__;if(r.next===s)return void(r.next=n.next);i=r.next}else t[e]=n.next}}catch(t){return()=>{}}}var Zl={childNodes:t=>Hl("Node",t,"childNodes"),parentNode:t=>Hl("Node",t,"parentNode"),parentElement:t=>Hl("Node",t,"parentElement"),textContent:t=>Hl("Node",t,"textContent"),contains:(t,e)=>Wl("Node",t,"contains")(e),getRootNode:t=>Wl("Node",t,"getRootNode")(),host:t=>t&&"host"in t?Hl("ShadowRoot",t,"host"):null,styleSheets:t=>t.styleSheets,shadowRoot:t=>t&&"shadowRoot"in t?Hl("Element",t,"shadowRoot"):null,querySelector:(t,e)=>Wl("Element",t,"querySelector")(e),querySelectorAll:(t,e)=>Wl("Element",t,"querySelectorAll")(e),mutationObserver:Vl,patch:Gl},Ql=()=>({durationMs:0,stylesheetMs:0,nodeCount:0,cssRuleCount:0,nonDeferrableCssRuleCount:0,deferredStylesheetCount:0});function Jl(){try{if("undefined"!=typeof performance&&performance.now)return performance.now()}catch(t){}return Date.now()}var Kl=0,Yl=6e4;function Xl(){Kl+=1}function tu(){return Kl}function eu(t,e){return e!==Kl||t>Yl}var iu=0,ru=0,nu=0,su=Ql(),ou=null,au=null,lu=[],uu=0,hu=0,du={slowestBatchMs:0},vu={deferredCount:0,failedCount:0,abandonedCount:0,totalMs:0,slowestSliceMs:0},cu=t=>t&&t>0?t:null;function fu(t){(iu+=1)>1||(su=Ql(),lu=[],uu=0,au=cu(t),ru=Jl(),nu=Kl)}function pu(){return 0===iu?ou||Ql():(iu-=1)>0?su:(su.durationMs=Jl()-ru,su.deferredStylesheetCount=uu,vu.deferredCount+=uu,au=null,eu(su.durationMs,nu)?su:ou=su)}var gu=32;function mu(t,e,i){var r=t.length;if(i>=gu)return r;for(var n=0;t.length>n;n++){var s=t[n];try{var o=s.cssRules;if(o&&o.length)r+=mu(o,e,i+1);else if(e&&s.styleSheet){var a=s.styleSheet;if(!e.has(a)){e.add(a);var l=a.rules||a.cssRules;l&&(r+=mu(l,e,i+1))}}}catch(t){}}return r}function yu(t){if(0!==iu){var e=mu(t,null,0);su.cssRuleCount+=e,hu>0&&(su.nonDeferrableCssRuleCount+=e)}}function _u(t){hu+=1;try{return t()}finally{hu-=1}}function bu(t){iu>0&&(su.stylesheetMs+=t)}function wu(t){if(0===iu||null===au)return!1;var e=su.cssRuleCount-su.nonDeferrableCssRuleCount;return e>=au||e+function(t){try{var e=t&&(t.rules||t.cssRules);if(!e)return 0;var i=new WeakSet;return i.add(t),mu(e,i,0)}catch(t){return 0}}(t)>au}function ku(){vu.failedCount+=1}function Su(t){t>0&&(vu.abandonedCount+=t)}function xu(t){return t.nodeType===t.ELEMENT_NODE}function Cu(t){var e=t&&"host"in t&&"mode"in t&&Zl.host(t)||null;return Boolean(e&&"shadowRoot"in e&&Zl.shadowRoot(e)===t)}function Tu(t){return"[object ShadowRoot]"==={}.toString.call(t)}function Eu(t){return t.includes(" background-clip: text;")&&!t.includes(" -webkit-background-clip: text;")&&(t=t.replace(/\sbackground-clip:\s*text;/g," -webkit-background-clip: text; background-clip: text;")),t}function Mu(t){var e=t.cssText;if(3>e.split('"').length)return e;var i=["@import","url("+JSON.stringify(t.href)+")"];return""===t.layerName?i.push("layer"):t.layerName&&i.push("layer("+t.layerName+")"),t.supportsText&&i.push("supports("+t.supportsText+")"),t.media.length&&i.push(t.media.mediaText),i.join(" ")+";"}var Iu=0;function Ru(t){var e=0===Iu,i=e?Jl():0;Iu+=1;try{var r=t.rules||t.cssRules;if(!r)return null;yu(r);var n=t.href;return!n&&t.ownerNode&&(n=t.ownerNode.baseURI),Eu(Array.from(r,(t=>Pu(t,n))).join(""))}catch(t){return null}finally{Iu-=1,e&&bu(Jl()-i)}}function Pu(t,e){var i;if(Ou(t)){var r;try{r=Ru(t.styleSheet)||Mu(t)}catch(e){r=t.cssText}try{if(r&&(null==(i=t.styleSheet)?void 0:i.href))return Qu(r,t.styleSheet.href)}catch(t){}return r}var n=t.cssText;return Fu(t)&&t.selectorText.includes(":")&&(n=Au(n)),e?Qu(n,e):n}function Au(t){return t.replace(/(\[(?:[\w-]+)[^\\])(:(?:[\w-]+)\])/gm,"$1\\$2")}function Ou(t){return"styleSheet"in t}function Fu(t){return"selectorText"in t}var Lu=/^-?[A-Za-z_][\w-]*$/,$u=/^-?[A-Za-z_][\w-]*(\.-?[A-Za-z_][\w-]*)*$/;function Du(t){var e=[],i=!1,r=null,n=new Map;function s(t){var n=e.pop();if("group"===n.kind){if(null===t){for(;e.length>0&&"group"===e[e.length-1].kind;)e.pop();return void s(null)}var a=e[e.length-1];return a.parts.push(t),void(a.index+=1)}if(!n.importRule)return i=!0,void(r=t);o(e[e.length-1],n.importRule,t)}function o(t,e,i){var r;try{var n;try{n=i||Mu(e)}catch(t){n=e.cssText}try{n&&(null==(r=e.styleSheet)?void 0:r.href)&&(n=Qu(n,e.styleSheet.href))}catch(t){}n&&t.parts.push(n),t.index+=1}catch(t){s(null)}}function a(t){var i=t.rules[t.index];if("sheet"===t.kind&&Ou(i)){var r=n.get(i);return null===r?(t.parts.push(i.cssText),void(t.index+=1)):r?void e.push({kind:"sheet",sheet:r.sheet,rules:r.rules,sheetHref:r.sheetHref,index:0,parts:[],importRule:i}):void o(t,i,null)}if(!function(t,i){try{var r=function(t){var e,i=t;if(!i.cssRules||0===i.cssRules.length)return null;if(i.media&&"string"==typeof i.media.mediaText)return"@media "+i.media.mediaText+" {";if(Fu(t)){if("number"==typeof i.type&&1!==i.type)return null;var r=i.style?i.style.cssText:"";return t.selectorText+" {"+(r?" "+r:"")}if("containerName"in i)return"string"!=typeof i.containerQuery||i.containerName&&!Lu.test(i.containerName)?null:"@container "+(i.containerName?i.containerName+" ":"")+i.containerQuery+" {";if("string"==typeof i.conditionText){var n="";try{n=(null==(e=t.constructor)?void 0:e.name)||""}catch(t){return null}return""===n||"Object"===n||"CSSSupportsRule"===n?"@supports "+i.conditionText+" {":null}return"string"==typeof i.name?"keyText"in i.cssRules[0]?Lu.test(i.name)?"@keyframes "+i.name+" {":null:""===i.name?"@layer {":$u.test(i.name)?"@layer "+i.name+" {":null:null}(t);if(null===r)return!1;var n=i.sheetHref;return e.push({kind:"group",rules:Array.from(t.cssRules),sheetHref:n,index:0,parts:[],prelude:n?Qu(r,n):r,fixColons:"sheet"===i.kind&&Fu(t)&&t.selectorText.includes(":")}),!0}catch(t){return!1}}(i,t)){var s=i.cssText;"sheet"===t.kind&&Fu(i)&&i.selectorText.includes(":")&&(s=Au(s)),t.parts.push(t.sheetHref?Qu(s,t.sheetHref):s),t.index+=1}}return function(t){try{var i=t.rules||t.cssRules;if(!i)return!1;yu(i);var r=t.href;!r&&t.ownerNode&&(r=t.ownerNode.baseURI);var s=Array.from(i);return e.push({kind:"sheet",sheet:t,rules:s,sheetHref:r,index:0,parts:[],importRule:null}),function(t,e){for(var i=[{sheet:e,rules:t,index:0}],r=function(){var t=i[i.length-1];if(t.index>=t.rules.length)return i.pop(),0;var e=t.rules[t.index];if(t.index+=1,!Ou(e)||n.has(e))return 0;var r=null;try{r=e.styleSheet}catch(t){return n.set(e,null),0}if(!r||i.some((t=>t.sheet===r)))return 0;try{var s=r.rules||r.cssRules;if(!s)return 0;yu(s);var o=r.href;!o&&r.ownerNode&&(o=r.ownerNode.baseURI);var a=Array.from(s);n.set(e,{sheet:r,rules:a,sheetHref:o}),i.push({sheet:r,rules:a,index:0})}catch(t){}};i.length>0;)r()}(s,t),!0}catch(t){return!1}}(t)||(i=!0),{advance(t){if(i)return!0;var n=Jl(),o=t>0?t:1;try{for(;!i&&o>0;){var l=e[e.length-1];if(l.rules.length>l.index){o-=1;try{a(l)}catch(t){s(null)}}else{var u=null;try{if("group"===l.kind){var h=l.prelude+l.parts.join("")+"}";u=l.fixColons?Au(h):h}else u=Eu(l.parts.join(""))}catch(t){}s(u)}}}catch(t){i=!0,r=null}finally{bu(Jl()-n)}return i},text:()=>i?r:null,remainingRules(){if(i)return 0;var t=0;for(var r of e)t+=r.rules.length-r.index;return t}}}class Nu{constructor(){Il(this,"idNodeMap",new Map),Il(this,"nodeMetaMap",new WeakMap)}getId(t){var e;if(!t)return-1;var i=null==(e=this.getMeta(t))?void 0:e.id;return null!=i?i:-1}getNode(t){return this.idNodeMap.get(t)||null}getIds(){return Array.from(this.idNodeMap.keys())}getMeta(t){return this.nodeMetaMap.get(t)||null}removeNodeFromMap(t){var e=this.getId(t);if(this.idNodeMap.delete(e),t.childNodes&&t.childNodes.forEach((t=>this.removeNodeFromMap(t))),xu(t)){var i=Zl.shadowRoot(t);i&&this.removeNodeFromMap(i),"IFRAME"===t.nodeName&&t.contentDocument&&this.removeNodeFromMap(t.contentDocument)}}has(t){return this.idNodeMap.has(t)}hasNode(t){return this.nodeMetaMap.has(t)}add(t,e){this.idNodeMap.set(e.id,t),this.nodeMetaMap.set(t,e)}replace(t,e){var i=this.getNode(t);if(i){var r=this.nodeMetaMap.get(i);r&&this.nodeMetaMap.set(e,r)}this.idNodeMap.set(t,e)}reset(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap}}function qu(t){var e=t.element,i=t.maskInputOptions,r=t.tagName,n=t.type,s=t.maskInputFn,o=t.value||"",a=n&&ju(n);return(i[r.toLowerCase()]||a&&i[a])&&(o=s?s(o,e):"*".repeat(o.length)),o}function ju(t){return t.toLowerCase()}var Bu=new Set(["rr_width","rr_height","rr_left","rr_top","rr_position","rr_transform","rr_display","rr_scrollleft","rr_scrolltop","rr_mediastate","rr_open_mode"]);function Uu(t){var e=t.element,i=t.name,r=t.value,n=t.maskAttributeFn,s=t.isGenerated;return r?t.maskAllElementAttributes?void 0!==s&&s&&Bu.has(ju(i))?r:"*".repeat(r.length):n?n(i,r,e):r:r}var Hu="__rrweb_original__";function zu(t){try{var e=t.type;return t.hasAttribute("data-rr-is-password")?"password":e?ju(e):null}catch(t){return null}}var Wu=/url\((?:(')([^']*)'|(")(.*?)"|([^)]*))\)/gm,Vu=/^(?:[a-z+]+:)?\/\//i,Gu=/^www\..*/i,Zu=/^(data:)([^,]*),(.*)/i;function Qu(t,e){return(t||"").replace(Wu,((t,i,r,n,s,o)=>{var a,l=r||s||o,u=i||n||"";if(!l)return t;if(Vu.test(l)||Gu.test(l))return"url("+u+l+u+")";if(Zu.test(l))return"url("+u+l+u+")";if("/"===l[0])return"url("+u+(((a=e).indexOf("//")>-1?a.split("/").slice(0,3).join("/"):a.split("/")[0]).split("?")[0]+l)+u+")";var h=e.split("/"),d=l.split("/");for(var v of(h.pop(),d))"."!==v&&(".."===v?h.pop():h.push(v));return"url("+u+h.join("/")+u+")"}))}var Ju,Ku,Yu="data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTAwJSIgaGVpZ2h0PSIxMDAlIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPgogIDxkZWZzPgogICAgPHBhdHRlcm4gaWQ9InN0cmlwZXMiIHBhdHRlcm5Vbml0cz0idXNlclNwYWNlT25Vc2UiIHdpZHRoPSIxNiIgaGVpZ2h0PSIxNiI+CiAgICAgIDxyZWN0IHdpZHRoPSIxNiIgaGVpZ2h0PSIxNiIgZmlsbD0iYmxhY2siLz4KICAgICAgPHBhdGggZD0iTTggMEgxNkwwIDE2VjhMOCAwWiIgZmlsbD0iIzJEMkQyRCIvPgogICAgICA8cGF0aCBkPSJNMTYgOFYxNkg4TDE2IDhaIiBmaWxsPSIjMkQyRDJEIi8+CiAgICA8L3BhdHRlcm4+CiAgPC9kZWZzPgogIDxyZWN0IHdpZHRoPSIxMDAlIiBoZWlnaHQ9IjEwMCUiIGZpbGw9InVybCgjc3RyaXBlcykiLz4KPC9zdmc+Cg==",Xu=4096,th=1e5,eh=10,ih=new Map,rh=1,nh=new RegExp("[^a-z0-9-_:]"),sh=-2;function oh(){return rh++}var ah=/^[^ \t\n\r\u000c]+/,lh=/^[, \t\n\r\u000c]+/,uh=new WeakMap;function hh(t,e){return e&&""!==e.trim()?dh(t,e):e}function dh(t,e){var i=uh.get(t);if(i||(i=t.createElement("a"),uh.set(t,i)),e){if(e.startsWith("blob:")||e.startsWith("data:"))return e}else e="";return i.setAttribute("href",e),i.href}function vh(t,e){return(null==e?void 0:e.maxBase64ImageLength)?function(t,e){return e&&t.length>e?Yu:t}(t,e.maxBase64ImageLength):t}function ch(t,e,i,r,n,s){var o;if(!r)return r;if("src"===i||"href"===i&&("use"!==e||"#"!==r[0])){if("link"===e&&n){var a=null==(o=n.sheet)?void 0:o.href;if(a)return a}var l=hh(t,r);if(l.startsWith("data:")){if("img"===e&&n){var u=l;return((null==s?void 0:s.type)||void 0!==(null==s?void 0:s.quality))&&(u=function(t,e,i,r){if(th>e.length)return e;if(!t.complete||0===t.naturalWidth)return e;if(t.naturalWidth>Xu||t.naturalHeight>Xu)return e;var n=ih.get(e);if(n&&n.type===i&&n.quality===r)return n.result;try{var s=document.createElement("canvas");s.width=t.naturalWidth,s.height=t.naturalHeight;var o=s.getContext("2d");if(!o)return e;o.drawImage(t,0,0);var a=s.toDataURL(i||"image/webp",null!=r?r:.4),l=e.length>a.length?a:e;if(ih.size>=eh){var u=ih.keys().next().value;void 0!==u&&ih.delete(u)}return ih.set(e,{type:i,quality:r,result:l}),l}catch(t){return e}}(n,l,s.type,s.quality)),vh(u,s)}if("image"===e)return vh(l,s)}return l}if("xlink:href"===i&&"#"!==r[0]){var h=hh(t,r);return"image"===e&&h.startsWith("data:")?vh(h,s):h}return"background"!==i||"table"!==e&&"td"!==e&&"th"!==e?"srcset"===i?function(t,e){if(""===e.trim())return e;var i=0;function r(t){var r,n=t.exec(e.substring(i));return n?(i+=(r=n[0]).length,r):""}for(var n=[];r(lh),e.length>i;){var s=r(ah);if(","===s.slice(-1))s=hh(t,s.substring(0,s.length-1)),n.push(s);else{var o="";s=hh(t,s);for(var a=!1;;){var l=e.charAt(i);if(""===l){n.push((s+o).trim());break}if(a)")"===l&&(a=!1);else{if(","===l){i+=1,n.push((s+o).trim());break}"("===l&&(a=!0)}o+=l,i+=1}}}return n.join(", ")}(t,r):"style"===i?Qu(r,dh(t)):"object"===e&&"data"===i?hh(t,r):r:hh(t,r)}function fh(t,e,i){return("video"===t||"audio"===t)&&"autoplay"===e}function ph(t,e,i){if(!t)return!1;if(t.nodeType!==t.ELEMENT_NODE)return!!i&&ph(Zl.parentNode(t),e,i);for(var r=t.classList.length;r--;)if(e.test(t.classList[r]))return!0;return!!i&&ph(Zl.parentNode(t),e,i)}function gh(t,e,i,r){var n;if(xu(t)){if(!Zl.childNodes(n=t).length)return!1}else{if(null===Zl.parentElement(t))return!1;n=Zl.parentElement(t)}try{if("string"==typeof e){if(r){if(n.closest("."+e))return!0}else if(n.classList.contains(e))return!0}else if(ph(n,e,r))return!0;if(i)if(r){if(n.closest(i))return!0}else if(n.matches(i))return!0}catch(t){}return!1}function mh(t,e,i){var r=t.removeEventListener;"function"==typeof r&&r.call(t,e,i)}var yh=new Map;function _h(t,e){return Array.from(t.styleSheets).find((t=>t.href===e))}function bh(t){return null==t?"":t.toLowerCase()}var wh=50,kh=!1,Sh=!1;function xh(t,e){var i=e.doc,r=e.mirror,n=e.blockClass,s=e.blockSelector,o=e.maskTextClass,a=e.maskTextSelector,l=e.skipChild,u=void 0!==l&&l,h=e.inlineStylesheet,d=void 0===h||h,v=e.maskInputOptions,c=void 0===v?{}:v,f=e.maskTextFn,p=e.maskInputFn,g=e.maskAllElementAttributes,m=void 0!==g&&g,y=e.maskAttributeFn,_=e.slimDOMOptions,b=e.dataURLOptions,w=void 0===b?{}:b,k=e.inlineImages,S=void 0!==k&&k,x=e.recordCanvas,C=void 0!==x&&x,T=e.canvasMaskingConfigured,E=e.onSerialize,M=e.onIframeLoad,I=e.iframeLoadTimeout,R=void 0===I?5e3:I,P=e.onIframeListenerRegistered,A=e.onStylesheetLoad,O=e.stylesheetLoadTimeout,F=void 0===O?5e3:O,L=e.keepIframeSrcFn,D=void 0===L?()=>!1:L,N=e.newlyAddedElement,q=void 0!==N&&N,j=e.depth,B=void 0===j?0:j,U=e.maxDepth,H=void 0===U?wh:U,z=e.needsMask,W=e.preserveWhiteSpace,V=void 0===W||W;if(B>=H)return Sh=!0,kh||(kh=!0,console.warn("[rrweb-snapshot] DOM tree depth exceeded max depth of "+H+". Children beyond this depth will not be recorded. This may indicate deeply nested DOM structures.")),null;z||(z=gh(t,o,a,void 0===z)),iu>0&&(su.nodeCount+=1);var G,Z=function(t,e){var i=e.doc,r=e.blockClass,n=e.blockSelector,s=e.needsMask,o=e.inlineStylesheet,a=e.maskInputOptions,l=void 0===a?{}:a,u=e.maskTextFn,h=e.maskInputFn,d=e.maskAllElementAttributes,v=void 0!==d&&d,c=e.maskAttributeFn,f=e.dataURLOptions,p=void 0===f?{}:f,g=e.inlineImages,m=e.recordCanvas,y=e.canvasMaskingConfigured,_=e.keepIframeSrcFn,b=e.newlyAddedElement,w=void 0!==b&&b,k=function(t,e){if(e.hasNode(t)){var i=e.getId(t);return 1===i?void 0:i}}(i,e.mirror);switch(t.nodeType){case t.DOCUMENT_NODE:return"CSS1Compat"!==t.compatMode?{type:$l.Document,childNodes:[],compatMode:t.compatMode}:{type:$l.Document,childNodes:[]};case t.DOCUMENT_TYPE_NODE:return{type:$l.DocumentType,name:t.name,publicId:t.publicId,systemId:t.systemId,rootId:k};case t.ELEMENT_NODE:return function(t,e){for(var i,r,n,s=e.doc,o=e.inlineStylesheet,a=e.maskInputOptions,l=void 0===a?{}:a,u=e.maskInputFn,h=e.maskAllElementAttributes,d=void 0!==h&&h,v=e.maskAttributeFn,c=e.dataURLOptions,f=void 0===c?{}:c,p=e.inlineImages,g=e.recordCanvas,m=e.canvasMaskingConfigured,y=e.keepIframeSrcFn,_=e.newlyAddedElement,b=void 0!==_&&_,w=e.rootId,k=function(t,e,i){try{if("string"==typeof e){if(t.classList.contains(e))return!0}else for(var r=t.classList.length;r--;)if(e.test(t.classList[r]))return!0;if(i)return t.matches(i)}catch(t){}return!1}(t,e.blockClass,e.blockSelector),S=function(t){if(t instanceof HTMLFormElement)return"form";var e=ju(t.tagName);return nh.test(e)?"div":e}(t),x=new Set,C={},T=t.attributes.length,E=0;T>E;E++){var M=t.attributes[E];fh(S,M.name)||(C[M.name]=ch(s,S,ju(M.name),M.value,t,f))}if("link"===S&&o&&!k){var I=t.sheet;if(!I){var R=function(t){return t.href}(t);R&&!(I=_h(s,R))&&R.includes(".css")&&(I=_h(s,window.location.origin+"/"+R.replace(window.location.href,"")))}var P=null;I&&(wu(I)?iu>0&&(lu.push(t),uu+=1):P=Ru(I)),P&&(delete C.rel,delete C.href,C._cssText=P)}if("style"===S&&t.sheet&&!(t.innerText||Zl.textContent(t)||"").trim().length){var A=_u((()=>Ru(t.sheet)));A&&(C._cssText=A)}if("input"===S||"textarea"===S||"select"===S){var O=t.value,F=t.checked;"radio"!==C.type&&"checkbox"!==C.type&&"submit"!==C.type&&"button"!==C.type&&O?C.value=qu({element:t,type:zu(t),tagName:S,value:O,maskInputOptions:l,maskInputFn:u}):F&&(C.checked=F)}if("option"===S&&(t.selected&&!l.select?C.selected=!0:delete C.selected),"dialog"===S&&t.open){try{C.rr_open_mode=t.matches("dialog:modal")?"modal":"non-modal"}catch(t){C.rr_open_mode="modal",C.ph_rr_could_not_detect_modal=!0}x.add("rr_open_mode")}if("canvas"===S&&g&&!(null==m?void 0:m()))if("2d"===t.__context)(function(t){var e=t.getContext("2d");if(!e)return!0;for(var i=0;t.width>i;i+=50)for(var r=0;t.height>r;r+=50){var n=e.getImageData;if(new Uint32Array((Hu in n?n[Hu]:n).call(e,i,r,Math.min(50,t.width-i),Math.min(50,t.height-r)).data.buffer).some((t=>0!==t)))return!1}return!0})(t)||(C.rr_dataURL=t.toDataURL(f.type,f.quality));else if(!("__context"in t)){var L=t.toDataURL(f.type,f.quality),D=s.createElement("canvas");D.width=t.width,D.height=t.height,L!==D.toDataURL(f.type,f.quality)&&(C.rr_dataURL=L)}var N,q,j=!1;if("img"===S&&p){Ju||(Ju=s.createElement("canvas"),Ku=Ju.getContext("2d"));var B=t,U=B.currentSrc||B.getAttribute("src")||"<unknown-src>",H=B.crossOrigin,z=(e,i)=>j?Uu({element:t,name:e,value:i,maskAllElementAttributes:d,maskAttributeFn:v}):i,W=()=>{mh(B,"load",W);try{Ju.width=B.naturalWidth,Ju.height=B.naturalHeight,Ku.drawImage(B,0,0);var t=Ju.toDataURL(f.type,f.quality);C.rr_dataURL=z("rr_dataURL",t)}catch(t){if("anonymous"!==B.crossOrigin)return B.crossOrigin="anonymous",void(B.complete&&0!==B.naturalWidth?W():B.addEventListener("load",W));console.warn("Cannot inline img src="+U+"! Error: "+t)}"anonymous"===B.crossOrigin&&(H?C.crossOrigin=z("crossOrigin",H):B.removeAttribute("crossorigin"))};B.complete&&0!==B.naturalWidth?W():B.addEventListener("load",W)}if("audio"===S||"video"===S){var V=C;V.rr_mediaState=t.paused?"paused":"played",x.add("rr_mediaState"),V.rr_mediaCurrentTime=t.currentTime,V.rr_mediaPlaybackRate=t.playbackRate,V.rr_mediaMuted=t.muted,V.rr_mediaLoop=t.loop,V.rr_mediaVolume=t.volume}if(b||(t.scrollLeft&&(C.rr_scrollLeft=t.scrollLeft),t.scrollTop&&(C.rr_scrollTop=t.scrollTop)),k){var G=t.getBoundingClientRect(),Z=G.width,Q=G.height,J=G.left,K=G.top,Y=null==(i=s.defaultView)?void 0:i.getComputedStyle(t);C={class:C.class,rr_width:Z+"px",rr_height:Q+"px",rr_left:Math.floor(J+((null==(r=s.defaultView)?void 0:r.scrollX)||0))+"px",rr_top:Math.floor(K+((null==(n=s.defaultView)?void 0:n.scrollY)||0))+"px"},x.add("rr_width"),x.add("rr_height"),x.add("rr_left"),x.add("rr_top"),Y&&(C.rr_position=Y.position||"static",x.add("rr_position"),Y.transform&&"none"!==Y.transform&&(C.rr_transform=Y.transform,x.add("rr_transform")),Y.display&&Y.display.startsWith("inline")&&(C.rr_display=Y.display,x.add("rr_display")))}if("iframe"!==S||y(C.src)||(t.contentDocument||(C.rr_src=C.src),delete C.src),d||v)for(var X of Object.entries(C)){var tt=X[0],et=X[1];"string"!=typeof et&&null!==et||(C[tt]=Uu({element:t,name:tt,value:et,maskAllElementAttributes:d,maskAttributeFn:v,isGenerated:x.has(tt)}))}j=!0;try{customElements.get(S)&&(N=!0)}catch(t){}return{type:$l.Element,tagName:S,attributes:C,childNodes:[],isSVG:(q=t,Boolean("svg"===q.tagName||q.ownerSVGElement)||void 0),needBlock:k,rootId:w,isCustom:N}}(t,{doc:i,blockClass:r,blockSelector:n,inlineStylesheet:o,maskInputOptions:l,maskInputFn:h,maskAllElementAttributes:v,maskAttributeFn:c,dataURLOptions:p,inlineImages:g,recordCanvas:m,canvasMaskingConfigured:y,keepIframeSrcFn:_,newlyAddedElement:w,rootId:k});case t.TEXT_NODE:return function(t,e){var i,r=e.needsMask,n=e.maskTextFn,s=e.rootId,o=Zl.parentNode(t),a=o&&o.tagName,l=Zl.textContent(t),u="STYLE"===a||void 0,h="SCRIPT"===a||void 0;if(u&&l){try{if(t.nextSibling||t.previousSibling);else if(wu(o.sheet));else if(null==(i=o.sheet)?void 0:i.cssRules){var d=Ru(o.sheet);d&&!/(?:^|[\s;{}])-?[a-zA-Z][\w-]*\s*:\s*;/.test(d)&&(l=d)}}catch(e){console.warn("Cannot get CSS styles from text's parentNode. Error: "+e,t)}l=Qu(l,dh(e.doc))}return h&&(l="SCRIPT_PLACEHOLDER"),!u&&!h&&l&&r&&(l=n?n(l,Zl.parentElement(t)):l.replace(/[\S]/g,"*")),{type:$l.Text,textContent:l||"",isStyle:u,rootId:s}}(t,{doc:i,needsMask:s,maskTextFn:u,rootId:k});case t.CDATA_SECTION_NODE:return{type:$l.CDATA,textContent:"",rootId:k};case t.COMMENT_NODE:return{type:$l.Comment,textContent:Zl.textContent(t)||"",rootId:k};default:return!1}}(t,{doc:i,mirror:r,blockClass:n,blockSelector:s,needsMask:z,inlineStylesheet:d,maskInputOptions:c,maskTextFn:f,maskInputFn:p,maskAllElementAttributes:m,maskAttributeFn:y,dataURLOptions:w,inlineImages:S,recordCanvas:C,canvasMaskingConfigured:T,keepIframeSrcFn:D,newlyAddedElement:q});if(!Z)return console.warn(t,"not serialized"),null;G=r.hasNode(t)?r.getId(t):function(t,e){if(e.comment&&t.type===$l.Comment)return!0;if(t.type===$l.Element){if(e.script&&("script"===t.tagName||"link"===t.tagName&&("preload"===t.attributes.rel&&"script"===t.attributes.as||"modulepreload"===t.attributes.rel)||"link"===t.tagName&&"prefetch"===t.attributes.rel&&"string"==typeof t.attributes.href&&"js"===function(t,e){var i,r;try{r=new URL(t,window.location.href)}catch(t){return null}var n=r.pathname.match(/\.([0-9a-z]+)(?:$)/i);return null!==(i=null==n?void 0:n[1])&&void 0!==i?i:null}(t.attributes.href)))return!0;if(e.headFavicon&&("link"===t.tagName&&"shortcut icon"===t.attributes.rel||"meta"===t.tagName&&(bh(t.attributes.name).match(/^msapplication-tile(image|color)$/)||"application-name"===bh(t.attributes.name)||["icon","apple-touch-icon","shortcut icon"].includes(bh(t.attributes.rel)))))return!0;if("meta"===t.tagName){if(e.headMetaDescKeywords&&bh(t.attributes.name).match(/^description|keywords$/))return!0;if(e.headMetaSocial&&(bh(t.attributes.property).match(/^(og|twitter|fb):/)||bh(t.attributes.name).match(/^(og|twitter):/)||"pinterest"===bh(t.attributes.name)))return!0;if(e.headMetaRobots&&["robots","googlebot","bingbot"].includes(bh(t.attributes.name)))return!0;if(e.headMetaHttpEquiv&&void 0!==t.attributes["http-equiv"])return!0;if(e.headMetaAuthorship&&(["author","generator","framework","publisher","progid"].includes(bh(t.attributes.name))||bh(t.attributes.property).match(/^article:/)||bh(t.attributes.property).match(/^product:/)))return!0;if(e.headMetaVerification&&["google-site-verification","yandex-verification","csrf-token","p:domain_verify","verify-v1","verification","shopify-checkout-api-token"].includes(bh(t.attributes.name)))return!0}}return!1}(Z,_)||!V&&Z.type===$l.Text&&!Z.isStyle&&!Z.textContent.replace(/^\s+|\s+$/gm,"").length?sh:oh();var Q=Object.assign(Z,{id:G});if(r.add(t,Q),G===sh)return null;E&&E(t);var J=!u;if(Q.type===$l.Element){J=J&&!Q.needBlock,delete Q.needBlock;var K=Zl.shadowRoot(t);K&&Tu(K)&&(Q.isShadowHost=!0)}if((Q.type===$l.Document||Q.type===$l.Element)&&J){_.headWhitespace&&Q.type===$l.Element&&"head"===Q.tagName&&(V=!1);var Y={doc:i,mirror:r,blockClass:n,blockSelector:s,needsMask:z,maskTextClass:o,maskTextSelector:a,skipChild:u,inlineStylesheet:d,maskInputOptions:c,maskTextFn:f,maskInputFn:p,maskAllElementAttributes:m,maskAttributeFn:y,slimDOMOptions:_,dataURLOptions:w,inlineImages:S,recordCanvas:C,canvasMaskingConfigured:T,preserveWhiteSpace:V,onSerialize:E,onIframeLoad:M,iframeLoadTimeout:R,onIframeListenerRegistered:P,onStylesheetLoad:A,stylesheetLoadTimeout:F,keepIframeSrcFn:D,depth:B+1,maxDepth:H};if(Q.type===$l.Element&&"textarea"===Q.tagName&&void 0!==Q.attributes.value);else for(var X of Array.from(Zl.childNodes(t))){var tt=xh(X,Y);tt&&Q.childNodes.push(tt)}var et=null;if(xu(t)&&(et=Zl.shadowRoot(t)))for(var it of Array.from(Zl.childNodes(et))){var rt=xh(it,Y);rt&&(Tu(et)&&(rt.isShadow=!0),Q.childNodes.push(rt))}}var nt=Zl.parentNode(t);if(nt&&Cu(nt)&&Tu(nt)&&(Q.isShadow=!0),Q.type===$l.Element&&"iframe"===Q.tagName){var st=function(t,e,i){var r,n=()=>{},s=t.contentWindow;if(!s)return n;try{r=s.document.readyState}catch(t){return n}var o=()=>e();if("complete"!==r){var a=!1,l=null,u=()=>{a||(a=!0,null!==l&&(clearTimeout(l),l=null),mh(t,"load",h),t.addEventListener("load",o),e())},h=()=>u();return l=setTimeout(u,i),t.addEventListener("load",h),()=>{null!==l&&(clearTimeout(l),l=null),a?mh(t,"load",o):(a=!0,mh(t,"load",h))}}var d,v="about:blank";try{d=s.location.href}catch(t){return n}if(d!==v||t.src===v||""===t.src){var c=setTimeout(e,0);return t.addEventListener("load",o),()=>{clearTimeout(c),mh(t,"load",o)}}return t.addEventListener("load",o),()=>{mh(t,"load",o)}}(t,(()=>{var e=t.contentDocument;if(e&&M){var i=xh(e,{doc:e,mirror:r,blockClass:n,blockSelector:s,needsMask:z,maskTextClass:o,maskTextSelector:a,skipChild:!1,inlineStylesheet:d,maskInputOptions:c,maskTextFn:f,maskInputFn:p,maskAllElementAttributes:m,maskAttributeFn:y,slimDOMOptions:_,dataURLOptions:w,inlineImages:S,recordCanvas:C,canvasMaskingConfigured:T,preserveWhiteSpace:V,onSerialize:E,onIframeLoad:M,iframeLoadTimeout:R,onIframeListenerRegistered:P,onStylesheetLoad:A,stylesheetLoadTimeout:F,keepIframeSrcFn:D,depth:B+1,maxDepth:H});i&&M(t,i)}}),R);null==P||P(t,st)}return Q.type===$l.Element&&"link"===Q.tagName&&"stylesheet"===Q.attributes.rel&&function(e,l,u){if(!yh.has(e)){var h;try{h=e.sheet}catch(t){return}if(!h){var v=new AbortController,g=!1,b=()=>{if(!g){g=!0;try{(()=>{if(A){var e=xh(t,{doc:i,mirror:r,blockClass:n,blockSelector:s,needsMask:z,maskTextClass:o,maskTextSelector:a,skipChild:!1,inlineStylesheet:d,maskInputOptions:c,maskTextFn:f,maskInputFn:p,maskAllElementAttributes:m,maskAttributeFn:y,slimDOMOptions:_,dataURLOptions:w,inlineImages:S,recordCanvas:C,canvasMaskingConfigured:T,preserveWhiteSpace:V,onSerialize:E,onIframeLoad:M,iframeLoadTimeout:R,onStylesheetLoad:A,stylesheetLoadTimeout:F,keepIframeSrcFn:D,depth:B,maxDepth:H});e&&A(t,e)}})()}finally{yh.delete(e),v.abort()}}},k=setTimeout(b,u);v.signal.addEventListener("abort",(()=>clearTimeout(k)),{once:!0}),e.addEventListener("load",b,{signal:v.signal,once:!0}),yh.set(e,v)}}}(t,0,F),Q}function Ch(t){return!0===t||"all"===t?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaVerification:!0,headMetaAuthorship:"all"===t,headMetaDescKeywords:"all"===t,headTitleMutations:"all"===t}:!1===t?{}:t}class Th{constructor(){Il(this,"parentElement",null),Il(this,"parentNode",null),Il(this,"ownerDocument"),Il(this,"firstChild",null),Il(this,"lastChild",null),Il(this,"previousSibling",null),Il(this,"nextSibling",null),Il(this,"ELEMENT_NODE",1),Il(this,"TEXT_NODE",3),Il(this,"nodeType"),Il(this,"nodeName"),Il(this,"RRNodeType")}get childNodes(){for(var t=[],e=this.firstChild;e;)t.push(e),e=e.nextSibling;return t}contains(t){if(!(t instanceof Th))return!1;if(t.ownerDocument!==this.ownerDocument)return!1;if(t===this)return!0;for(;t.parentNode;){if(t.parentNode===this)return!0;t=t.parentNode}return!1}appendChild(t){throw new Error("RRDomException: Failed to execute 'appendChild' on 'RRNode': This RRNode type does not support this method.")}insertBefore(t,e){throw new Error("RRDomException: Failed to execute 'insertBefore' on 'RRNode': This RRNode type does not support this method.")}removeChild(t){throw new Error("RRDomException: Failed to execute 'removeChild' on 'RRNode': This RRNode type does not support this method.")}toString(){return"RRNode"}}function Eh(t,e,i){void 0===i&&(i=document);var r={capture:!0,passive:!0};return i.addEventListener(t,e,r),()=>Mh(i,t,e,r)}function Mh(t,e,i,r){Ih((()=>{var n=t.removeEventListener;"function"==typeof n&&(void 0!==r?n.call(t,e,i,r):n.call(t,e,i))}))}function Ih(t){try{t()}catch(t){if(!(t instanceof DOMException&&"SecurityError"===t.name))throw t}}var Rh="Please stop import mirror directly. Instead of that,\r\nnow you can use replayer.getMirror() to access the mirror instance of a replayer,\r\nor you can use record.mirror to access the mirror instance during recording.",Ph={map:{},getId(){return console.error(Rh),-1},getNode(){return console.error(Rh),null},removeNodeFromMap(){console.error(Rh)},has(){return console.error(Rh),!1},reset(){console.error(Rh)}};function Ah(t,e,i){void 0===i&&(i={});var r=null,n=0;return function(){for(var s=arguments.length,o=new Array(s),a=0;s>a;a++)o[a]=arguments[a];var l=Date.now();n||!1!==i.leading||(n=l);var u=e-(l-n),h=this;0>=u||u>e?(r&&(clearTimeout(r),r=null),n=l,t.apply(h,o)):r||!1===i.trailing||(r=setTimeout((()=>{n=!1===i.leading?0:Date.now(),r=null,t.apply(h,o)}),u))}}function Oh(t,e,i,r,n){void 0===n&&(n=window);var s=n.Object.getOwnPropertyDescriptor(t,e);return n.Object.defineProperty(t,e,r?i:{set(t){if(setTimeout((()=>{try{i.set.call(this,t)}catch(t){}}),0),s&&s.set){if(s.get)try{s.get.call(this)}catch(t){return}s.set.call(this,t)}}}),()=>Oh(t,e,s||{},!0)}"undefined"!=typeof window&&window.Proxy&&window.Reflect&&(Ph=new Proxy(Ph,{get(t,e,i){return"map"===e&&console.error(Rh),Reflect.get(t,e,i)}}));var Fh=Date.now;function Lh(t){var e,i,r,n,s=t.document;return{left:s.scrollingElement?s.scrollingElement.scrollLeft:void 0!==t.pageXOffset?t.pageXOffset:s.documentElement.scrollLeft||(null==s?void 0:s.body)&&(null==(e=Zl.parentElement(s.body))?void 0:e.scrollLeft)||(null==(i=null==s?void 0:s.body)?void 0:i.scrollLeft)||0,top:s.scrollingElement?s.scrollingElement.scrollTop:void 0!==t.pageYOffset?t.pageYOffset:(null==s?void 0:s.documentElement.scrollTop)||(null==s?void 0:s.body)&&(null==(r=Zl.parentElement(s.body))?void 0:r.scrollTop)||(null==(n=null==s?void 0:s.body)?void 0:n.scrollTop)||0}}function $h(){return window.innerHeight||document.documentElement&&document.documentElement.clientHeight||document.body&&document.body.clientHeight}function Dh(){return window.innerWidth||document.documentElement&&document.documentElement.clientWidth||document.body&&document.body.clientWidth}function Nh(t){return t?t.nodeType===t.ELEMENT_NODE?t:Zl.parentElement(t):null}function qh(t,e,i,r){if(!t)return!1;var n=Nh(t);if(!n)return!1;try{if("string"==typeof e){if(n.classList.contains(e))return!0;if(r&&null!==n.closest("."+e))return!0}else if(ph(n,e,r))return!0}catch(t){}if(i){if(n.matches(i))return!0;if(r&&null!==n.closest(i))return!0}return!1}function jh(t,e,i){return!("TITLE"!==t.tagName||!i.headTitleMutations)||e.getId(t)===sh}function Bh(t,e){if(Cu(t))return!1;var i=e.getId(t);if(!e.has(i))return!0;var r=Zl.parentNode(t);return(!r||r.nodeType!==t.DOCUMENT_NODE)&&(!r||Bh(r,e))}function Uh(t){return Boolean(t.changedTouches)}function Hh(t,e){return Boolean("IFRAME"===t.nodeName&&e.getMeta(t))}function zh(t,e){return Boolean("LINK"===t.nodeName&&t.nodeType===t.ELEMENT_NODE&&t.getAttribute&&"stylesheet"===t.getAttribute("rel")&&e.getMeta(t))}function Wh(t){return!!t&&(t instanceof Th&&"shadowRoot"in t?Boolean(t.shadowRoot):Boolean(Zl.shadowRoot(t)))}/[1-9][0-9]{12}/.test(Date.now().toString())||(Fh=()=>(new Date).getTime());class Vh{constructor(){Il(this,"id",1),Il(this,"styleIDMap",new WeakMap),Il(this,"idStyleMap",new Map)}getId(t){var e;return null!==(e=this.styleIDMap.get(t))&&void 0!==e?e:-1}has(t){return this.styleIDMap.has(t)}add(t,e){return this.has(t)?this.getId(t):(i=void 0===e?this.id++:e,this.styleIDMap.set(t,i),this.idStyleMap.set(i,t),i);var i}getStyle(t){return this.idStyleMap.get(t)||null}reset(){this.styleIDMap=new WeakMap,this.idStyleMap=new Map,this.id=1}generateId(){return this.id++}}function Gh(t){var e,i=null;return"getRootNode"in t&&(null==(e=Zl.getRootNode(t))?void 0:e.nodeType)===Node.DOCUMENT_FRAGMENT_NODE&&Zl.host(Zl.getRootNode(t))&&(i=Zl.host(Zl.getRootNode(t))),i}function Zh(t){var e=t.ownerDocument;return!!e&&(Zl.contains(e,t)||function(t){var e=t.ownerDocument;if(!e)return!1;var i=function(t){for(var e,i=t;e=Gh(i);)i=e;return i}(t);return Zl.contains(e,i)}(t))}function Qh(t){return"__ln"in t}class Jh{constructor(){Il(this,"length",0),Il(this,"head",null),Il(this,"tail",null)}get(t){if(t>=this.length)throw new Error("Position outside of list range");for(var e=this.head,i=0;t>i;i++)e=(null==e?void 0:e.next)||null;return e}addNode(t){var e={value:t,previous:null,next:null};if(t.__ln=e,t.previousSibling&&Qh(t.previousSibling)){var i=t.previousSibling.__ln.next;e.next=i,e.previous=t.previousSibling.__ln,t.previousSibling.__ln.next=e,i&&(i.previous=e)}else if(t.nextSibling&&Qh(t.nextSibling)&&t.nextSibling.__ln.previous){var r=t.nextSibling.__ln.previous;e.previous=r,e.next=t.nextSibling.__ln,t.nextSibling.__ln.previous=e,r&&(r.next=e)}else this.head&&(this.head.previous=e),e.next=this.head,this.head=e;null===e.next&&(this.tail=e),this.length++}removeNode(t){var e=t.__ln;this.head&&(e.previous?(e.previous.next=e.next,e.next?e.next.previous=e.previous:this.tail=e.previous):(this.head=e.next,this.head?this.head.previous=null:this.tail=null),t.__ln&&delete t.__ln,this.length--)}}var Kh,Yh=(t,e)=>t+"@"+e;class Xh{constructor(){Il(this,"frozen",!1),Il(this,"locked",!1),Il(this,"texts",[]),Il(this,"attributes",[]),Il(this,"attributeMap",new WeakMap),Il(this,"generatedAttributes",new WeakMap),Il(this,"removes",[]),Il(this,"mapRemoves",[]),Il(this,"movedMap",{}),Il(this,"addedSet",new Set),Il(this,"movedSet",new Set),Il(this,"droppedSet",new Set),Il(this,"removesSubTreeCache",new Set),Il(this,"mutationCb"),Il(this,"blockClass"),Il(this,"blockSelector"),Il(this,"maskTextClass"),Il(this,"maskTextSelector"),Il(this,"inlineStylesheet"),Il(this,"maskInputOptions"),Il(this,"maskTextFn"),Il(this,"maskInputFn"),Il(this,"maskAllElementAttributes"),Il(this,"maskAttributeFn"),Il(this,"keepIframeSrcFn"),Il(this,"recordCanvas"),Il(this,"canvasMaskingConfigured"),Il(this,"inlineImages"),Il(this,"slimDOMOptions"),Il(this,"dataURLOptions"),Il(this,"doc"),Il(this,"mirror"),Il(this,"iframeManager"),Il(this,"stylesheetManager"),Il(this,"shadowDomManager"),Il(this,"canvasManager"),Il(this,"processedNodeManager"),Il(this,"unattachedDoc"),Il(this,"canvasManagerReleased",!1),Il(this,"processMutations",(t=>{t.forEach(this.processMutation),this.emit()})),Il(this,"emit",(()=>{if(!this.frozen&&!this.locked){var t,e,i=Jl(),r=tu();try{this.processBufferedMutations()}finally{t=Jl()-i,e=r,iu>0||eu(t,null!=e?e:Kl)||t>du.slowestBatchMs&&(du.slowestBatchMs=t)}}})),Il(this,"processBufferedMutations",(()=>{for(var t=[],e=new Set,i=new Jh,r=t=>{for(var e=t,i=sh;i===sh;)i=(e=e&&e.nextSibling)&&this.mirror.getId(e);return i},n=n=>{var s=Zl.parentNode(n);if(s&&Zh(n)&&"TEXTAREA"!==s.tagName){var o=Cu(s)?this.mirror.getId(Gh(n)):this.mirror.getId(s),a=r(n);if(-1===o||-1===a)return i.addNode(n);var l=xh(n,{doc:this.doc,mirror:this.mirror,blockClass:this.blockClass,blockSelector:this.blockSelector,maskTextClass:this.maskTextClass,maskTextSelector:this.maskTextSelector,skipChild:!0,newlyAddedElement:!0,inlineStylesheet:this.inlineStylesheet,maskInputOptions:this.maskInputOptions,maskTextFn:this.maskTextFn,maskInputFn:this.maskInputFn,maskAllElementAttributes:this.maskAllElementAttributes,maskAttributeFn:this.maskAttributeFn,slimDOMOptions:this.slimDOMOptions,dataURLOptions:this.dataURLOptions,recordCanvas:this.recordCanvas,canvasMaskingConfigured:this.canvasMaskingConfigured,inlineImages:this.inlineImages,onSerialize:t=>{Hh(t,this.mirror)&&this.iframeManager.addIframe(t),zh(t,this.mirror)&&this.stylesheetManager.trackLinkElement(t),Wh(t)&&!qh(t,this.blockClass,this.blockSelector,!0)&&this.shadowDomManager.addShadowRoot(Zl.shadowRoot(t),this.doc)},onIframeLoad:(t,e)=>{this.iframeManager.attachIframe(t,e),this.shadowDomManager.observeAttachShadow(t)},onIframeListenerRegistered:(t,e)=>{this.iframeManager.registerLoadListenerDisposer(t,e)},onStylesheetLoad:(t,e)=>{this.stylesheetManager.attachLinkElement(t,e)}});l&&(t.push({parentId:o,nextId:a,node:l}),e.add(l.id))}};this.mapRemoves.length;)this.mirror.removeNodeFromMap(this.mapRemoves.shift());for(var s of this.movedSet)ed(this.removesSubTreeCache,s)&&!this.movedSet.has(Zl.parentNode(s))||n(s);for(var o of this.addedSet)id(this.droppedSet,o)||ed(this.removesSubTreeCache,o)?id(this.movedSet,o)?n(o):this.droppedSet.add(o):n(o);for(var a=null;i.length;){var l=null;if(a){var u=this.mirror.getId(Zl.parentNode(a.value)),h=r(a.value);-1!==u&&-1!==h&&(l=a)}if(!l)for(var d=i.tail;d;){var v=d;if(d=d.previous,v){var c=this.mirror.getId(Zl.parentNode(v.value));if(-1===r(v.value))continue;if(-1!==c){l=v;break}var f=Zl.parentNode(v.value);if(f&&f.nodeType===Node.DOCUMENT_FRAGMENT_NODE){var p=Zl.host(f);if(-1!==this.mirror.getId(p)){l=v;break}}}}if(!l){for(;i.head;)i.removeNode(i.head.value);break}a=l.previous,i.removeNode(l.value),n(l.value)}var g={texts:this.texts.map((t=>{var e=t.node,i=Zl.parentNode(e);return i&&"TEXTAREA"===i.tagName&&this.genTextAreaValueMutation(i),{id:this.mirror.getId(e),value:t.value}})).filter((t=>!e.has(t.id))).filter((t=>this.mirror.has(t.id))),attributes:this.attributes.map((t=>{var e,i=t.attributes;if(!this.maskAllElementAttributes&&!this.maskAttributeFn&&"string"==typeof i.style){var r=JSON.stringify(t.styleDiff),n=JSON.stringify(t._unchangedStyles);i.style.length>r.length&&(r+n).split("var(").length===i.style.split("var(").length&&(i.style=t.styleDiff)}if(this.maskAllElementAttributes||this.maskAttributeFn)for(var s of Object.entries(i)){var o=s[0],a=s[1];"string"!=typeof a&&null!==a||(i[o]=Uu({element:t.node,name:o,value:a,maskAllElementAttributes:this.maskAllElementAttributes,maskAttributeFn:this.maskAttributeFn,isGenerated:null==(e=this.generatedAttributes.get(t.node))?void 0:e.has(o)}))}return{id:this.mirror.getId(t.node),attributes:i}})).filter((t=>!e.has(t.id))).filter((t=>this.mirror.has(t.id))),removes:this.removes,adds:t};(g.texts.length||g.attributes.length||g.removes.length||g.adds.length)&&(this.texts=[],this.attributes=[],this.attributeMap=new WeakMap,this.generatedAttributes=new WeakMap,this.removes=[],this.addedSet=new Set,this.movedSet=new Set,this.droppedSet=new Set,this.removesSubTreeCache=new Set,this.movedMap={},this.mutationCb(g))})),Il(this,"bufferBelongsToIframe",(t=>this.doc===t.contentDocument)),Il(this,"genTextAreaValueMutation",(t=>{var e=this.attributeMap.get(t);e||(this.attributes.push(e={node:t,attributes:{},styleDiff:{},_unchangedStyles:{}}),this.attributeMap.set(t,e));var i=Array.from(Zl.childNodes(t),(t=>Zl.textContent(t)||"")).join("");e.attributes.value=qu({element:t,maskInputOptions:this.maskInputOptions,tagName:t.tagName,type:zu(t),value:i,maskInputFn:this.maskInputFn})})),Il(this,"processMutation",(t=>{var e;if(!jh(t.target,this.mirror,this.slimDOMOptions))switch(t.type){case"characterData":var i=Zl.textContent(t.target);qh(t.target,this.blockClass,this.blockSelector,!1)||i===t.oldValue||this.texts.push({value:gh(t.target,this.maskTextClass,this.maskTextSelector,!0)&&i?this.maskTextFn?this.maskTextFn(i,Nh(t.target)):i.replace(/[\S]/g,"*"):i,node:t.target});break;case"attributes":var r,n=t.target,s=t.attributeName,o=null!==(r=t.attributeNamespace)&&void 0!==r?r:null,a=function(t,e,i){if(!i)return e;var r=t.getAttributeNodeNS(i,e);if(r)return r.name;if("http://www.w3.org/1999/xlink"===i)return"xlink:"+e;if("http://www.w3.org/XML/1998/namespace"===i)return"xml:"+e;if("http://www.w3.org/2000/xmlns/"===i)return"xmlns"===e?e:"xmlns:"+e;var n=t.lookupPrefix(i);return n?n+":"+e:e}(n,s,o),l=o?n.getAttributeNS(o,s):t.target.getAttribute(s);if("value"===a){var u=n,h=zu(u);l=qu({element:u,maskInputOptions:this.maskInputOptions,tagName:n.tagName,type:h,value:l,maskInputFn:this.maskInputFn})}if(qh(t.target,this.blockClass,this.blockSelector,!1)||l===t.oldValue)return;var d=this.attributeMap.get(t.target),v="IFRAME"===n.tagName&&"src"===a;if(v&&!this.keepIframeSrcFn(l)&&n.contentDocument)return;if(d||(this.attributes.push(d={node:t.target,attributes:{},styleDiff:{},_unchangedStyles:{}}),this.attributeMap.set(t.target,d)),"type"===a&&"INPUT"===n.tagName&&"password"===(t.oldValue||"").toLowerCase()&&n.setAttribute("data-rr-is-password","true"),!fh(n.tagName,a)){var c=ch(this.doc,ju(n.tagName),ju(a),l,n,this.dataURLOptions);if(v&&!this.keepIframeSrcFn(l)&&(a="rr_src"),d.attributes[a]=c,null==(e=this.generatedAttributes.get(t.target))||e.delete(a),"style"===a){if(!this.unattachedDoc)try{this.unattachedDoc=document.implementation.createHTMLDocument()}catch(t){this.unattachedDoc=this.doc}var f=this.unattachedDoc.createElement("span"),p=n.style;for(var g of(t.oldValue&&(f.style.cssText=t.oldValue),Array.from(p))){var m=p.getPropertyValue(g),y=p.getPropertyPriority(g);m!==f.style.getPropertyValue(g)||y!==f.style.getPropertyPriority(g)?d.styleDiff[g]=""===y?m:[m,y]:d._unchangedStyles[g]=[m,y]}for(var _ of Array.from(f.style))""===p.getPropertyValue(_)&&(d.styleDiff[_]=!1)}else if("open"===a&&"DIALOG"===n.tagName){d.attributes.rr_open_mode=n.matches("dialog:modal")?"modal":"non-modal";var b=this.generatedAttributes.get(t.target);b||this.generatedAttributes.set(t.target,b=new Set),b.add("rr_open_mode")}}break;case"childList":if(qh(t.target,this.blockClass,this.blockSelector,!0))return;if("TEXTAREA"===t.target.tagName)return void this.genTextAreaValueMutation(t.target);t.addedNodes.forEach((e=>this.genAdds(e,t.target))),t.removedNodes.forEach((e=>{var i=this.mirror.getId(e),r=Cu(t.target)?this.mirror.getId(Zl.host(t.target)):this.mirror.getId(t.target);qh(t.target,this.blockClass,this.blockSelector,!1)||jh(e,this.mirror,this.slimDOMOptions)||!function(t,e){return-1!==e.getId(t)}(e,this.mirror)||(this.addedSet.has(e)?(td(this.addedSet,e),this.droppedSet.add(e)):this.addedSet.has(t.target)&&-1===i||Bh(t.target,this.mirror)||(this.movedSet.has(e)&&this.movedMap[Yh(i,r)]?td(this.movedSet,e):(this.removes.push({parentId:r,id:i,isShadow:!(!Cu(t.target)||!Tu(t.target))||void 0}),function(t,e){for(var i=[t];i.length;){var r=i.pop();e.has(r)||(e.add(r),Zl.childNodes(r).forEach((t=>i.push(t))))}}(e,this.removesSubTreeCache))),this.mapRemoves.push(e))}))}})),Il(this,"genAdds",((t,e)=>{if(!this.processedNodeManager.inOtherBuffer(t,this)){if(this.addedSet.has(t))return this.addedSet.delete(t),void this.addedSet.add(t);if(!this.movedSet.has(t)){if(this.mirror.hasNode(t)){if(jh(t,this.mirror,this.slimDOMOptions))return;this.movedSet.add(t);var i=null;e&&this.mirror.hasNode(e)&&(i=this.mirror.getId(e)),i&&-1!==i&&(this.movedMap[Yh(this.mirror.getId(t),i)]=!0)}else this.addedSet.add(t),this.droppedSet.delete(t);qh(t,this.blockClass,this.blockSelector,!1)||(Zl.childNodes(t).forEach((t=>this.genAdds(t))),Wh(t)&&Zl.childNodes(Zl.shadowRoot(t)).forEach((e=>{this.processedNodeManager.add(e,this),this.genAdds(e,t)})))}}}))}init(t){["mutationCb","blockClass","blockSelector","maskTextClass","maskTextSelector","inlineStylesheet","maskInputOptions","maskTextFn","maskInputFn","maskAllElementAttributes","maskAttributeFn","keepIframeSrcFn","recordCanvas","canvasMaskingConfigured","inlineImages","slimDOMOptions","dataURLOptions","doc","mirror","iframeManager","stylesheetManager","shadowDomManager","canvasManager","processedNodeManager"].forEach((e=>{this[e]=t[e]})),this.canvasManager.acquire()}freeze(){this.frozen=!0,this.canvasManager.freeze()}unfreeze(){this.frozen=!1,this.canvasManager.unfreeze(),this.emit()}isFrozen(){return this.frozen}lock(){this.locked=!0,this.canvasManager.lock()}unlock(){this.locked=!1,this.canvasManager.unlock(),this.emit()}reset(){this.releaseCanvasManager()}releaseCanvasManager(){this.canvasManagerReleased||(this.canvasManagerReleased=!0,this.canvasManager.reset())}bufferDoc(){return this.doc}destroy(){for(;this.mapRemoves.length;)this.mirror.removeNodeFromMap(this.mapRemoves.shift())}}function td(t,e){for(var i=[e];i.length;){var r=i.pop();t.delete(r),Zl.childNodes(r).forEach((t=>i.push(t)))}}function ed(t,e,i){return 0!==t.size&&function(t,e,i){var r=Zl.parentNode(e);return!!r&&t.has(r)}(t,e)}function id(t,e){if(0===t.size)return!1;for(var i=Zl.parentNode(e);i;){if(t.has(i))return!0;i=Zl.parentNode(i)}return!1}var rd=function(t,e){return void 0===e&&(e="rrweb"),Kh?function(){try{return t(...arguments)}catch(t){if(Kh&&!0===Kh(t,e))return;throw t}}:t},nd=[];function sd(t){try{if("composedPath"in t){var e=t.composedPath();if(e.length)return e[0]}else if("path"in t&&t.path.length)return t.path[0]}catch(t){}return t&&t.target}function od(t,e){var i,r=new Xh;r.init(t);try{i=new(Vl())(rd(r.processMutations.bind(r)));var n={attributes:!0,attributeOldValue:!0,characterData:!0,characterDataOldValue:!0,childList:!0,subtree:!0};return t.attributeFilter&&t.attributeFilter.length>0&&(n.attributeFilter=t.attributeFilter),i.observe(e,n),nd.push(r),{observer:i,buffer:r}}catch(t){try{null==i||i.disconnect(),r.destroy(),r.reset()}catch(t){}throw t}}function ad(t){var e=t.scrollCb,i=t.doc,r=t.mirror,n=t.blockClass,s=t.blockSelector,o=t.sampling,a=new Map,l=t=>{var o=sd(t);if(o&&!qh(o,n,s,!0)){var l,u,h=r.getId(o);if(o===i&&i.defaultView){var d=Lh(i.defaultView);l=d.left,u=d.top}else l=o.scrollLeft,u=o.scrollTop;var v=l+","+u;a.get(h)!==v&&(a.set(h,v),e({id:h,x:l,y:u}))}},u=[Eh("scroll",rd(Ah(rd((t=>l(t))),o.scroll||100)),i)];return"onscrollend"in i&&u.push(Eh("scrollend",rd(l),i)),()=>u.forEach((t=>t()))}function ld(t,e){for(var i=nd.length-1;i>=0;i--){var r=nd[i];if(r){var n=r.bufferBelongsToIframe(t);!n&&e&&e.has(r.bufferDoc())&&(n=!0),n&&(r.reset(),nd.splice(i,1))}}}var ud=["INPUT","TEXTAREA","SELECT"],hd=new WeakMap;function dd(t){return function t(e,i){if(gd("CSSGroupingRule")&&e.parentRule instanceof CSSGroupingRule||gd("CSSMediaRule")&&e.parentRule instanceof CSSMediaRule||gd("CSSSupportsRule")&&e.parentRule instanceof CSSSupportsRule||gd("CSSConditionRule")&&e.parentRule instanceof CSSConditionRule){var r=Array.from(e.parentRule.cssRules).indexOf(e);return i.unshift(r),t(e.parentRule,i)}if(e.parentStyleSheet){var n=Array.from(e.parentStyleSheet.cssRules).indexOf(e);i.unshift(n)}return i}(t,[])}function vd(t,e,i){var r,n;return t?(t.ownerNode?r=e.getId(t.ownerNode):n=i.getId(t),{styleId:n,id:r}):{}}var cd=5e3;function fd(t,e){var i,r,n,s,o=t.stylesheetManager;s=t.mirror.getId("#document"===e.nodeName?e:Zl.host(e));var a="#document"===e.nodeName?null==(i=e.defaultView)?void 0:i.Document:null==(n=null==(r=e.ownerDocument)?void 0:r.defaultView)?void 0:n.ShadowRoot,l=(null==a?void 0:a.prototype)?Object.getOwnPropertyDescriptor(null==a?void 0:a.prototype,"adoptedStyleSheets"):void 0;return null!==s&&-1!==s&&a&&l?(Object.defineProperty(e,"adoptedStyleSheets",{configurable:l.configurable,enumerable:l.enumerable,get(){var t;return null==(t=l.get)?void 0:t.call(this)},set(t){var e,i;try{i=null==(e=l.set)?void 0:e.call(this,t)}catch(t){if(t&&"object"==typeof t&&"NotAllowedError"===t.name)return;throw t}if(null!==s&&-1!==s)try{o.adoptStyleSheets(t,s)}catch(t){}return i}}),rd((()=>{Object.defineProperty(e,"adoptedStyleSheets",{configurable:l.configurable,enumerable:l.enumerable,get:l.get,set:l.set})}))):()=>{}}function pd(t,e){void 0===e&&(e={});var i,r,n=t.doc.defaultView;if(!n)return()=>{};!function(t,e){var i=t.mutationCb,r=t.mousemoveCb,n=t.mouseInteractionCb,s=t.scrollCb,o=t.viewportResizeCb,a=t.inputCb,l=t.mediaInteractionCb,u=t.styleSheetRuleCb,h=t.styleDeclarationCb,d=t.canvasMutationCb,v=t.fontCb,c=t.selectionCb,f=t.customElementCb;t.mutationCb=function(){e.mutation&&e.mutation(...arguments),i(...arguments)},t.mousemoveCb=function(){e.mousemove&&e.mousemove(...arguments),r(...arguments)},t.mouseInteractionCb=function(){e.mouseInteraction&&e.mouseInteraction(...arguments),n(...arguments)},t.scrollCb=function(){e.scroll&&e.scroll(...arguments),s(...arguments)},t.viewportResizeCb=function(){e.viewportResize&&e.viewportResize(...arguments),o(...arguments)},t.inputCb=function(){e.input&&e.input(...arguments),a(...arguments)},t.mediaInteractionCb=function(){e.mediaInteaction&&e.mediaInteaction(...arguments),l(...arguments)},t.styleSheetRuleCb=function(){e.styleSheetRule&&e.styleSheetRule(...arguments),u(...arguments)},t.styleDeclarationCb=function(){e.styleDeclaration&&e.styleDeclaration(...arguments),h(...arguments)},t.canvasMutationCb=function(){e.canvasMutation&&e.canvasMutation(...arguments),d(...arguments)},t.fontCb=function(){e.font&&e.font(...arguments),v(...arguments)},t.selectionCb=function(){e.selection&&e.selection(...arguments),c(...arguments)},t.customElementCb=function(){e.customElement&&e.customElement(...arguments),f(...arguments)}}(t,e);var s,o,a,l,u,h,d,v,c=[],f=rd((()=>{if(r){r.destroy(),r.reset();var e=nd.indexOf(r);-1!==e&&nd.splice(e,1)}t.shadowDomManager.resetForDoc(t.doc),null==i||i.disconnect(),c.forEach((t=>t()))}));try{if(t.recordDOM){var g=od(t,t.doc);i=g.observer,r=g.buffer}if(c.push(function(t){var e=t.mousemoveCb,i=t.sampling,r=t.doc,n=t.mirror;if(!1===i.mousemove)return()=>{};var s,o="number"==typeof i.mousemove?i.mousemove:50,a="number"==typeof i.mousemoveCallback?i.mousemoveCallback:500,l=[],u=Ah(rd((t=>{var i=Date.now()-s;e(l.map((t=>(t.timeOffset-=i,t))),t),l=[],s=null})),a),h=rd(Ah(rd((t=>{var e=sd(t),i=Uh(t)?t.changedTouches[0]:t,r=i.clientX,o=i.clientY;s||(s=Fh()),l.push({x:r,y:o,id:n.getId(e),timeOffset:Fh()-s}),u("undefined"!=typeof DragEvent&&t instanceof DragEvent?Pl.Drag:t instanceof MouseEvent?Pl.MouseMove:Pl.TouchMove)})),o,{trailing:!1})),d=[Eh("mousemove",h,r),Eh("touchmove",h,r),Eh("drag",h,r)];return rd((()=>{d.forEach((t=>t()))}))}(t)),c.push(function(t){var e=t.mouseInteractionCb,i=t.doc,r=t.mirror,n=t.blockClass,s=t.blockSelector,o=t.sampling;if(!1===o.mouseInteraction)return()=>{};var a=!0===o.mouseInteraction||void 0===o.mouseInteraction?{}:o.mouseInteraction,l=[],u=null;return Object.keys(Al).filter((t=>Number.isNaN(Number(t))&&!t.endsWith("_Departed")&&!1!==a[t])).forEach((t=>{var o=ju(t),a=(t=>i=>{var o=sd(i);if(!qh(o,n,s,!0)){var a=null,l=t;if("pointerType"in i){switch(i.pointerType){case"mouse":a=Ol.Mouse;break;case"touch":a=Ol.Touch;break;case"pen":a=Ol.Pen}a===Ol.Touch&&(Al[t]===Al.MouseDown?l="TouchStart":Al[t]===Al.MouseUp&&(l="TouchEnd"))}else Uh(i)&&(a=Ol.Touch);null!==a?(u=a,(l.startsWith("Touch")&&a===Ol.Touch||l.startsWith("Mouse")&&a===Ol.Mouse)&&(a=null)):Al[t]===Al.Click&&(a=u,u=null);var h=Uh(i)?i.changedTouches[0]:i;if(h){var d=r.getId(o),v=h.clientX,c=h.clientY;rd(e)(p({type:Al[l],id:d,x:v,y:c},null!==a&&{pointerType:a}))}}})(t);if(window.PointerEvent)switch(Al[t]){case Al.MouseDown:case Al.MouseUp:o=o.replace("mouse","pointer");break;case Al.TouchStart:case Al.TouchEnd:return}l.push(Eh(o,a,i))})),rd((()=>{l.forEach((t=>t()))}))}(t)),c.push(ad(t)),c.push(function(t,e){var i=t.viewportResizeCb,r=e.win,n=-1,s=-1;return Eh("resize",rd(Ah(rd((()=>{var t=$h(),e=Dh();n===t&&s===e||(i({width:Number(e),height:Number(t)}),n=t,s=e)})),200)),r)}(t,{win:n})),c.push(function(t){var e=t.inputCb,i=t.doc,r=t.mirror,n=t.blockClass,s=t.blockSelector,o=t.ignoreClass,a=t.ignoreSelector,l=t.maskInputOptions,u=t.maskInputFn,h=t.userTriggeredOnInput;function d(t){var e=sd(t),r=t.isTrusted,d=i.defaultView;if(!e||!d||e instanceof d.HTMLElement){var c=e&&e.tagName;if(e&&"OPTION"===c&&(e=Zl.parentElement(e)),e&&c&&ud.indexOf(c)>=0&&!qh(e,n,s,!0)&&!(e.classList.contains(o)||a&&e.matches(a))){var f=e.value,p=!1,g=zu(e)||"";"radio"===g||"checkbox"===g?p=e.checked:(l[c.toLowerCase()]||l[g])&&(f=qu({element:e,maskInputOptions:l,tagName:c,type:g,value:f,maskInputFn:u})),v(e,h?{text:f,isChecked:p,userTriggered:r}:{text:f,isChecked:p});var m=e.name;"radio"===g&&m&&p&&i.querySelectorAll('input[type="radio"][name="'+m+'"]').forEach((t=>{if(t!==e){var i=t.value;v(t,h?{text:i,isChecked:!p,userTriggered:!1}:{text:i,isChecked:!p})}}))}}}function v(t,i){var n=hd.get(t);if(!n||n.text!==i.text||n.isChecked!==i.isChecked){hd.set(t,i);var s=r.getId(t);rd(e)(p({},i,{id:s}))}}var c=("last"===t.sampling.input?["change"]:["input","change"]).map((t=>Eh(t,rd(d),i))),f=i.defaultView;if(!f)return()=>{c.forEach((t=>t()))};var g=f.Object.getOwnPropertyDescriptor(f.HTMLInputElement.prototype,"value");return g&&g.set&&c.push(...[[f.HTMLInputElement.prototype,"value"],[f.HTMLInputElement.prototype,"checked"],[f.HTMLSelectElement.prototype,"value"],[f.HTMLTextAreaElement.prototype,"value"],[f.HTMLSelectElement.prototype,"selectedIndex"],[f.HTMLOptionElement.prototype,"selected"]].map((t=>Oh(t[0],t[1],{set(){rd(d)({target:this,isTrusted:!1})}},!1,f)))),rd((()=>{c.forEach((t=>t()))}))}(t)),c.push(function(t){var e=t.mediaInteractionCb,i=t.blockClass,r=t.blockSelector,n=t.mirror,s=t.sampling,o=t.doc,a=rd((t=>Ah(rd((s=>{var o=sd(s);if(o&&!qh(o,i,r,!0)){var a=o.currentTime,l=o.volume,u=o.muted,h=o.playbackRate,d=o.loop;e({type:t,id:n.getId(o),currentTime:a,volume:l,muted:u,playbackRate:h,loop:d})}})),s.media||500))),l=[Eh("play",a(Ll.Play),o),Eh("pause",a(Ll.Pause),o),Eh("seeked",a(Ll.Seeked),o),Eh("volumechange",a(Ll.VolumeChange),o),Eh("ratechange",a(Ll.RateChange),o)];return rd((()=>{l.forEach((t=>t()))}))}(t)),t.recordDOM){var m=function(t){var e=new Map,i=new Set,r=!0,n=t=>{if(r)try{t()}catch(t){}},s=t=>{var i,r=e.get(t);if(r){for(;null==(i=r[0])?void 0:i.ready;){var s=r.shift();(null==s?void 0:s.emit)&&n(s.emit)}0===r.length&&e.delete(t)}};return{queueMutation(t,i){if(t){var r=e.get(t);r?(r.push({emit:i,ready:!0}),s(t)):n(i)}else n(i)},queuePendingMutation(o,a,l){if(!r)return()=>{};var u=e.get(o);u||e.set(o,u=[]);var h={emit:a,ready:!1};u.push(h);var d,v=!1,c=!1,f=()=>{v||c||(v=!0,void 0!==d&&i.delete(d),h.ready=!0,h.emit=void 0,s(o))};try{d=t.setTimeout(f,cd),v||c?t.clearTimeout(d):i.add(d)}catch(t){f()}return e=>{!c&&r&&(c=!0,void 0!==d&&(t.clearTimeout(d),i.delete(d)),v?e&&n(l):(h.ready=!0,e||(h.emit=void 0),s(o)))}},reset(){r=!1,i.forEach((e=>t.clearTimeout(e))),i.clear(),e.clear()}}}(n);c.push(m.reset),c.push(function(t,e){var i=t.styleSheetRuleCb,r=t.mirror,n=t.stylesheetManager,s=e.win,o=e.mutationQueue;if(!s.CSSStyleSheet||!s.CSSStyleSheet.prototype)return()=>{};var a=s.CSSStyleSheet.prototype.insertRule;s.CSSStyleSheet.prototype.insertRule=new Proxy(a,{apply:rd(((t,e,s)=>{var a=s[0],l=t.apply(e,s);n.onCssomSheetMutation(e);var u=vd(e,r,n.styleMirror),h=u.id,d=u.styleId;return(h&&-1!==h||d&&-1!==d)&&o.queueMutation(e,(()=>i({id:h,styleId:d,adds:[{rule:a,index:l}]}))),l}),"host")}),s.CSSStyleSheet.prototype.addRule=function(t,e,i){return void 0===i&&(i=this.cssRules.length),s.CSSStyleSheet.prototype.insertRule.apply(this,[t+" { "+e+" }",i])};var l,u,h=s.CSSStyleSheet.prototype.deleteRule;s.CSSStyleSheet.prototype.deleteRule=new Proxy(h,{apply:rd(((t,e,s)=>{var a=s[0],l=t.apply(e,s);n.onCssomSheetMutation(e);var u=vd(e,r,n.styleMirror),h=u.id,d=u.styleId;return(h&&-1!==h||d&&-1!==d)&&o.queueMutation(e,(()=>i({id:h,styleId:d,removes:[{index:a}]}))),l}),"host")}),s.CSSStyleSheet.prototype.removeRule=function(t){return s.CSSStyleSheet.prototype.deleteRule.apply(this,[t])},s.CSSStyleSheet.prototype.replace&&(l=s.CSSStyleSheet.prototype.replace,s.CSSStyleSheet.prototype.replace=new Proxy(l,{apply:rd(((t,e,s)=>{var a=s[0],l=t.apply(e,s);try{var u=null==l?void 0:l.then;if(e.ownerNode||!l||"function"!=typeof u)return l;n.onCssomSheetMutation(e);var h=vd(e,r,n.styleMirror),d=h.id,v=h.styleId;if(!(d&&-1!==d||v&&-1!==v))return l;var c=o.queuePendingMutation(e,(()=>i({id:d,styleId:v,replace:a})),(()=>{var t=Ru(e);null!==t&&i({id:d,styleId:v,replace:t})}));try{u.call(l,(()=>c(!0)),(()=>c(!1)))}catch(t){c(!1)}}catch(t){}return l}),"host")})),s.CSSStyleSheet.prototype.replaceSync&&(u=s.CSSStyleSheet.prototype.replaceSync,s.CSSStyleSheet.prototype.replaceSync=new Proxy(u,{apply:rd(((t,e,s)=>{var a=s[0],l=t.apply(e,s);n.onCssomSheetMutation(e);var u=vd(e,r,n.styleMirror),h=u.id,d=u.styleId;return(h&&-1!==h||d&&-1!==d)&&o.queueMutation(e,(()=>i({id:h,styleId:d,replaceSync:a}))),l}),"host")}));var d={};md("CSSGroupingRule")?d.CSSGroupingRule=s.CSSGroupingRule:(md("CSSMediaRule")&&(d.CSSMediaRule=s.CSSMediaRule),md("CSSConditionRule")&&(d.CSSConditionRule=s.CSSConditionRule),md("CSSSupportsRule")&&(d.CSSSupportsRule=s.CSSSupportsRule));var v={};return Object.entries(d).forEach((t=>{var e=t[0],s=t[1];v[e]={insertRule:s.prototype.insertRule,deleteRule:s.prototype.deleteRule},s.prototype.insertRule=new Proxy(v[e].insertRule,{apply:rd(((t,e,s)=>{var a=s[0],l=t.apply(e,s);n.onCssomSheetMutation(e.parentStyleSheet);var u=vd(e.parentStyleSheet,r,n.styleMirror),h=u.id,d=u.styleId;if(e.parentStyleSheet&&(h&&-1!==h||d&&-1!==d)){var v=[...dd(e),l];o.queueMutation(e.parentStyleSheet,(()=>i({id:h,styleId:d,adds:[{rule:a,index:v}]})))}return l}),"host")}),s.prototype.deleteRule=new Proxy(v[e].deleteRule,{apply:rd(((t,e,s)=>{var a=s[0],l=t.apply(e,s);n.onCssomSheetMutation(e.parentStyleSheet);var u=vd(e.parentStyleSheet,r,n.styleMirror),h=u.id,d=u.styleId;if(e.parentStyleSheet&&(h&&-1!==h||d&&-1!==d)){var v=[...dd(e),a];o.queueMutation(e.parentStyleSheet,(()=>i({id:h,styleId:d,removes:[{index:v}]})))}return l}),"host")})})),rd((()=>{s.CSSStyleSheet.prototype.insertRule=a,s.CSSStyleSheet.prototype.deleteRule=h,l&&(s.CSSStyleSheet.prototype.replace=l),u&&(s.CSSStyleSheet.prototype.replaceSync=u),Object.entries(d).forEach((t=>{var e=t[0],i=t[1];i.prototype.insertRule=v[e].insertRule,i.prototype.deleteRule=v[e].deleteRule}))}))}(t,{win:n,mutationQueue:m})),c.push(fd(t,t.doc)),c.push(function(t,e){var i=t.styleDeclarationCb,r=t.mirror,n=t.ignoreCSSAttributes,s=t.stylesheetManager,o=e.win,a=e.mutationQueue,l=o.CSSStyleDeclaration.prototype.setProperty;o.CSSStyleDeclaration.prototype.setProperty=new Proxy(l,{apply:rd(((t,e,o)=>{var l,u=o[0],h=o[1],d=o[2],v=t.apply(e,o);if(n.has(u))return v;var c=null==(l=e.parentRule)?void 0:l.parentStyleSheet;s.onCssomSheetMutation(c);var f=vd(c,r,s.styleMirror),p=f.id,g=f.styleId;if(p&&-1!==p||g&&-1!==g){var m=dd(e.parentRule);a.queueMutation(c,(()=>i({id:p,styleId:g,set:{property:u,value:h,priority:d},index:m})))}return v}),"host")});var u=o.CSSStyleDeclaration.prototype.removeProperty;return o.CSSStyleDeclaration.prototype.removeProperty=new Proxy(u,{apply:rd(((t,e,o)=>{var l,u=o[0],h=t.apply(e,o);if(n.has(u))return h;var d=null==(l=e.parentRule)?void 0:l.parentStyleSheet;s.onCssomSheetMutation(d);var v=vd(d,r,s.styleMirror),c=v.id,f=v.styleId;if(c&&-1!==c||f&&-1!==f){var p=dd(e.parentRule);a.queueMutation(d,(()=>i({id:c,styleId:f,remove:{property:u},index:p})))}return h}),"host")}),rd((()=>{o.CSSStyleDeclaration.prototype.setProperty=l,o.CSSStyleDeclaration.prototype.removeProperty=u}))}(t,{win:n,mutationQueue:m})),t.collectFonts&&c.push(function(t){var e=t.fontCb,i=t.doc,r=i.defaultView;if(!r)return()=>{};var n=[],s=new WeakMap,o=r.FontFace;r.FontFace=function(t,e,i){var r=new o(t,e,i);return s.set(r,{family:t,buffer:"string"!=typeof e,descriptors:i,fontSource:"string"==typeof e?e:JSON.stringify(Array.from(new Uint8Array(e)))}),r};var a=Gl(i.fonts,"add",(function(t){return function(i){return setTimeout(rd((()=>{var t=s.get(i);t&&(e(t),s.delete(i))})),0),t.apply(this,[i])}}));return n.push((()=>{r.FontFace=o})),n.push(a),rd((()=>{n.forEach((t=>t()))}))}(t))}for(var y of(c.push((o=(s=t).doc,a=s.mirror,l=s.blockClass,u=s.blockSelector,h=s.selectionCb,d=!0,(v=rd((()=>{var t=o.getSelection();if(!(!t||d&&(null==t?void 0:t.isCollapsed))){d=t.isCollapsed||!1;for(var e=[],i=t.rangeCount||0,r=0;i>r;r++){var n=t.getRangeAt(r),s=n.startContainer,v=n.startOffset,c=n.endContainer,f=n.endOffset;qh(s,l,u,!0)||qh(c,l,u,!0)||e.push({start:a.getId(s),startOffset:v,end:a.getId(c),endOffset:f})}h({ranges:e})}})))(),Eh("selectionchange",v))),c.push(function(t){var e=t.customElementCb,i=t.doc.defaultView;return i&&i.customElements?Gl(i.customElements,"define",(function(t){return function(i,r,n){try{e({define:{name:i}})}catch(t){console.warn("Custom element callback failed for "+i)}return t.apply(this,[i,r,n])}})):()=>{}}(t)),t.plugins))c.push(y.observer(y.callback,n,y.options))}catch(t){try{f()}catch(t){}throw t}return f}function gd(t){return void 0!==window[t]}function md(t){return Boolean(void 0!==window[t]&&window[t].prototype&&"insertRule"in window[t].prototype&&"deleteRule"in window[t].prototype)}class yd{constructor(t){Il(this,"iframeRemoteIdToLocalIdMap",new WeakMap),Il(this,"iframeLocalIdToRemoteIdMap",new WeakMap),this.generateIdFn=t}getId(t,e,i,r){if(0>e)return e;var n=i||this.getRemoteIdToLocalIdMap(t),s=r||this.getLocalIdToRemoteIdMap(t),o=n.get(e);return void 0===o&&(o=this.generateIdFn(),n.set(e,o),s.set(o,e)),o}getIds(t,e){var i=this.getRemoteIdToLocalIdMap(t),r=this.getLocalIdToRemoteIdMap(t);return e.map((e=>this.getId(t,e,i,r)))}getRemoteId(t,e,i){var r;return"number"!=typeof e||0>e?e:null!==(r=(i||this.getLocalIdToRemoteIdMap(t)).get(e))&&void 0!==r?r:-1}getRemoteIds(t,e){var i=this.getLocalIdToRemoteIdMap(t);return e.map((e=>this.getRemoteId(t,e,i)))}reset(t){if(!t)return this.iframeRemoteIdToLocalIdMap=new WeakMap,void(this.iframeLocalIdToRemoteIdMap=new WeakMap);this.iframeRemoteIdToLocalIdMap.delete(t),this.iframeLocalIdToRemoteIdMap.delete(t)}getRemoteIdToLocalIdMap(t){var e=this.iframeRemoteIdToLocalIdMap.get(t);return e||this.iframeRemoteIdToLocalIdMap.set(t,e=new Map),e}getLocalIdToRemoteIdMap(t){var e=this.iframeLocalIdToRemoteIdMap.get(t);return e||this.iframeLocalIdToRemoteIdMap.set(t,e=new Map),e}}class _d{constructor(t){Il(this,"iframes",new WeakMap),Il(this,"crossOriginIframeMap",new WeakMap),Il(this,"crossOriginIframeMirror",new yd(oh)),Il(this,"crossOriginIframeStyleMirror"),Il(this,"crossOriginIframeRootIdMap",new WeakMap),Il(this,"mirror"),Il(this,"mutationCb"),Il(this,"wrappedEmit"),Il(this,"loadListener"),Il(this,"pageHideListener"),Il(this,"stylesheetManager"),Il(this,"recordCrossOriginIframes"),Il(this,"messageHandler"),Il(this,"nestedIframeListeners",new Map),Il(this,"attachedWindows",new WeakMap),Il(this,"attachedDocuments",new WeakMap),Il(this,"attachedIframes",new Map),Il(this,"loadListenerDisposers",new WeakMap),Il(this,"iframeElementsById",new Map),Il(this,"pageHideHandlers",new WeakMap),this.mutationCb=t.mutationCb,this.wrappedEmit=t.wrappedEmit,this.stylesheetManager=t.stylesheetManager,this.recordCrossOriginIframes=t.recordCrossOriginIframes,this.crossOriginIframeStyleMirror=new yd(this.stylesheetManager.styleMirror.generateId.bind(this.stylesheetManager.styleMirror)),this.mirror=t.mirror,this.messageHandler=this.handleMessage.bind(this),this.recordCrossOriginIframes&&window.addEventListener("message",this.messageHandler)}addIframe(t){this.iframes.set(t,!0),t.contentWindow&&this.crossOriginIframeMap.set(t.contentWindow,t)}registerLoadListenerDisposer(t,e){var i=this.loadListenerDisposers.get(t);i||this.loadListenerDisposers.set(t,i=new Set),i.add(e);var r=this.mirror.getId(t);-1!==r&&this.iframeElementsById.set(r,t)}getIframeElementById(t){var e,i,r;return null!==(e=null!==(i=null==(r=this.attachedIframes.get(t))?void 0:r.element)&&void 0!==i?i:this.iframeElementsById.get(t))&&void 0!==e?e:null}forgetIframeId(t){this.attachedIframes.delete(t),this.iframeElementsById.delete(t)}disposeLoadListeners(t){var e=this.loadListenerDisposers.get(t);e&&(e.forEach((t=>Ih(t))),this.loadListenerDisposers.delete(t))}removePageHideListener(t){var e=this.pageHideHandlers.get(t);e&&(e.forEach((t=>{Mh(t.win,"pagehide",t.handler)})),this.pageHideHandlers.delete(t))}addLoadListener(t){this.loadListener=t}addPageHideListener(t){this.pageHideListener=t}removeLoadListener(){this.loadListener=void 0}trackIframeContent(t,e){var i=this.mirror.getId(t);return this.attachedIframes.set(i,{element:t,content:e}),i}attachIframe(t,e){var i,r=this.trackIframeContent(t,e);if(t.contentDocument){var n=this.attachedDocuments.get(t);n||this.attachedDocuments.set(t,n=new Set),n.add(t.contentDocument)}this.mutationCb({adds:[{parentId:r,nextId:null,node:e}],removes:[],texts:[],attributes:[],isAttachIframe:!0});var s=t.contentWindow;if(this.recordCrossOriginIframes&&s&&!this.nestedIframeListeners.has(s)){var o=this.handleMessage.bind(this);Ih((()=>{s.addEventListener("message",o),this.nestedIframeListeners.set(s,o);var e=this.attachedWindows.get(t);e||this.attachedWindows.set(t,e=new Set),e.add(s)}))}Ih((()=>{var e=t.contentWindow;if(e){var i=this.pageHideHandlers.get(t);if(i)for(var r of i)if(r.win===e)return;var n=()=>{var e;null==(e=this.pageHideListener)||e.call(this,t),t.contentDocument&&this.mirror.removeNodeFromMap(t.contentDocument),t.contentWindow&&this.crossOriginIframeMap.delete(t.contentWindow)};e.addEventListener("pagehide",n),i||this.pageHideHandlers.set(t,i=new Set),i.add({win:e,handler:n})}})),null==(i=this.loadListener)||i.call(this,t),t.contentDocument&&t.contentDocument.adoptedStyleSheets&&t.contentDocument.adoptedStyleSheets.length>0&&this.stylesheetManager.adoptStyleSheets(t.contentDocument.adoptedStyleSheets,this.mirror.getId(t.contentDocument))}handleMessage(t){var e=t;if("rrweb"===e.data.type&&e.origin===e.data.origin&&t.source){var i=this.crossOriginIframeMap.get(t.source);if(i){var r=this.transformCrossOriginEvent(i,e.data.event);r&&this.wrappedEmit(r,e.data.isCheckout)}}}transformCrossOriginEvent(t,e){var i;switch(e.type){case Rl.FullSnapshot:this.crossOriginIframeMirror.reset(t),this.crossOriginIframeStyleMirror.reset(t),this.replaceIdOnNode(e.data.node,t);var r=e.data.node.id;return this.crossOriginIframeRootIdMap.set(t,r),this.patchRootIdOnNode(e.data.node,r),this.trackIframeContent(t,e.data.node),{timestamp:e.timestamp,type:Rl.IncrementalSnapshot,data:{source:Pl.Mutation,adds:[{parentId:this.mirror.getId(t),nextId:null,node:e.data.node}],removes:[],texts:[],attributes:[],isAttachIframe:!0}};case Rl.Meta:case Rl.Load:case Rl.DomContentLoaded:return!1;case Rl.Plugin:return e;case Rl.Custom:return this.replaceIds(e.data.payload,t,["id","parentId","previousId","nextId"]),e;case Rl.IncrementalSnapshot:switch(e.data.source){case Pl.Mutation:return e.data.adds.forEach((e=>{this.replaceIds(e,t,["parentId","nextId","previousId"]),this.replaceIdOnNode(e.node,t);var i=this.crossOriginIframeRootIdMap.get(t);i&&this.patchRootIdOnNode(e.node,i)})),e.data.removes.forEach((e=>{this.replaceIds(e,t,["parentId","id"])})),e.data.attributes.forEach((e=>{this.replaceIds(e,t,["id"])})),e.data.texts.forEach((e=>{this.replaceIds(e,t,["id"])})),e;case Pl.Drag:case Pl.TouchMove:case Pl.MouseMove:return e.data.positions.forEach((e=>{this.replaceIds(e,t,["id"])})),e;case Pl.ViewportResize:return!1;case Pl.MediaInteraction:case Pl.MouseInteraction:case Pl.Scroll:case Pl.CanvasMutation:case Pl.Input:return this.replaceIds(e.data,t,["id"]),e;case Pl.StyleSheetRule:case Pl.StyleDeclaration:return this.replaceIds(e.data,t,["id"]),this.replaceStyleIds(e.data,t,["styleId"]),e;case Pl.Font:return e;case Pl.Selection:return e.data.ranges.forEach((e=>{this.replaceIds(e,t,["start","end"])})),e;case Pl.AdoptedStyleSheet:return this.replaceIds(e.data,t,["id"]),this.replaceStyleIds(e.data,t,["styleIds"]),null==(i=e.data.styles)||i.forEach((e=>{this.replaceStyleIds(e,t,["styleId"])})),e}}return!1}replace(t,e,i,r){for(var n of r)(Array.isArray(e[n])||"number"==typeof e[n])&&(e[n]=Array.isArray(e[n])?t.getIds(i,e[n]):t.getId(i,e[n]));return e}replaceIds(t,e,i){return this.replace(this.crossOriginIframeMirror,t,e,i)}replaceStyleIds(t,e,i){return this.replace(this.crossOriginIframeStyleMirror,t,e,i)}replaceIdOnNode(t,e){this.replaceIds(t,e,["id","rootId"]),"childNodes"in t&&t.childNodes.forEach((t=>{this.replaceIdOnNode(t,e)}))}patchRootIdOnNode(t,e){t.type===$l.Document||t.rootId||(t.rootId=e),"childNodes"in t&&t.childNodes.forEach((t=>{this.patchRootIdOnNode(t,e)}))}removeIframeById(t){var e=this.attachedIframes.get(t),i=(null==e?void 0:e.element)||this.iframeElementsById.get(t)||this.mirror.getNode(t);if(this.iframeElementsById.delete(t),i){var r=i.contentWindow,n=this.attachedWindows.get(i);n&&(n.forEach((t=>{var e=this.nestedIframeListeners.get(t);e&&(Mh(t,"message",e),this.nestedIframeListeners.delete(t)),this.crossOriginIframeMap.delete(t)})),this.attachedWindows.delete(i)),r&&this.nestedIframeListeners.has(r)&&(Mh(r,"message",this.nestedIframeListeners.get(r)),this.nestedIframeListeners.delete(r)),r&&this.crossOriginIframeMap.delete(r),this.iframes.delete(i),this.disposeLoadListeners(i),this.removePageHideListener(i);var s=this.attachedDocuments.get(i);s&&(s.forEach((t=>{Ih((()=>this.mirror.removeNodeFromMap(t)))})),Ih((()=>ld(i,s))),this.attachedDocuments.delete(i))}e&&this.attachedIframes.delete(t)}cleanupDetachedIframes(){if(0!==this.attachedIframes.size){var t=[];this.attachedIframes.forEach(((e,i)=>{this.mirror.has(i)||t.push(i)})),t.forEach((t=>this.removeIframeById(t)))}}reattachIframes(){this.attachedIframes.forEach(((t,e)=>{var i=t.content;this.mirror.has(e)?this.mutationCb({adds:[{parentId:e,nextId:null,node:i}],removes:[],texts:[],attributes:[],isAttachIframe:!0}):this.attachedIframes.delete(e)}))}destroy(){this.recordCrossOriginIframes&&Mh(window,"message",this.messageHandler),this.nestedIframeListeners.forEach(((t,e)=>{Mh(e,"message",t)})),this.nestedIframeListeners.clear();var t=new Set;this.iframeElementsById.forEach((e=>t.add(e))),this.attachedIframes.forEach((e=>t.add(e.element))),t.forEach((t=>{this.disposeLoadListeners(t),this.removePageHideListener(t)})),this.crossOriginIframeMirror.reset(),this.crossOriginIframeStyleMirror.reset(),this.attachedIframes.clear(),this.crossOriginIframeMap=new WeakMap,this.iframes=new WeakMap,this.crossOriginIframeRootIdMap=new WeakMap,this.loadListenerDisposers=new WeakMap,this.pageHideHandlers=new WeakMap,this.attachedDocuments=new WeakMap,this.attachedWindows=new WeakMap,this.iframeElementsById=new Map}}class bd{constructor(t){Il(this,"shadowDoms",new WeakSet),Il(this,"mutationCb"),Il(this,"scrollCb"),Il(this,"bypassOptions"),Il(this,"mirror"),Il(this,"restoreHandlers",[]),this.mutationCb=t.mutationCb,this.scrollCb=t.scrollCb,this.bypassOptions=t.bypassOptions,this.mirror=t.mirror,this.init()}init(){this.reset(),this.patchAttachShadow(Element,document)}addShadowRoot(t,e){var i,r;if(Tu(t)&&!this.shadowDoms.has(t)){this.shadowDoms.add(t);var n=null!==(i=null==(r=Zl.host(t))?void 0:r.ownerDocument)&&void 0!==i?i:e,s=od(p({},this.bypassOptions,{doc:n,mutationCb:this.mutationCb,mirror:this.mirror,shadowDomManager:this}),t),o=s.observer,a=s.buffer;this.restoreHandlers.push({doc:n,handler(){o.disconnect(),a.destroy(),a.releaseCanvasManager();var t=nd.indexOf(a);-1!==t&&nd.splice(t,1)}}),this.restoreHandlers.push({doc:n,handler:ad(p({},this.bypassOptions,{scrollCb:this.scrollCb,doc:t,mirror:this.mirror}))}),setTimeout((()=>{t.adoptedStyleSheets&&t.adoptedStyleSheets.length>0&&this.bypassOptions.stylesheetManager.adoptStyleSheets(t.adoptedStyleSheets,this.mirror.getId(Zl.host(t))),this.restoreHandlers.push({doc:n,handler:fd({mirror:this.mirror,stylesheetManager:this.bypassOptions.stylesheetManager},t)})}),0)}}observeAttachShadow(t){t.contentWindow&&t.contentDocument&&this.patchAttachShadow(t.contentWindow.Element,t.contentDocument)}patchAttachShadow(t,e){var i=this;this.restoreHandlers.push({doc:e,handler:Gl(t.prototype,"attachShadow",(function(t){return function(r){var n=t.call(this,r),s=Zl.shadowRoot(this);return s&&Zh(this)&&i.addShadowRoot(s,e),n}}))})}reset(){this.restoreHandlers.forEach((t=>{var e=t.handler;try{e()}catch(t){}})),this.restoreHandlers=[],this.shadowDoms=new WeakSet}resetForDoc(t){var e=[];for(var i of this.restoreHandlers)if(i.doc===t)try{i.handler()}catch(t){}else e.push(i);this.restoreHandlers=e}}var wd="skip-frame";function kd(t){if("object"!=typeof t||null===t)return!1;var e=t.y,i=t.width,r=t.height;return Number.isFinite(t.x)&&Number.isFinite(e)&&Number.isFinite(i)&&Number.isFinite(r)&&i>=0&&r>=0}for(var Sd="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",xd="undefined"==typeof Uint8Array?[]:new Uint8Array(256),Cd=0;64>Cd;Cd++)xd[Sd.charCodeAt(Cd)]=Cd;var Td=new Map,Ed=(t,e,i)=>{if(t&&(Rd(t,e)||"object"==typeof t)){var r=function(t,e){var i=Td.get(t);return i||Td.set(t,i=new Map),i.has(e)||i.set(e,[]),i.get(e)}(i,t.constructor.name),n=r.indexOf(t);return-1===n&&(n=r.length,r.push(t)),n}};function Md(t,e,i,r){if(t instanceof Array)return t.map((t=>Md(t,e,i,r)));if(null===t)return t;if(t instanceof Float32Array||t instanceof Float64Array||t instanceof Int32Array||t instanceof Uint32Array||t instanceof Uint8Array||t instanceof Uint16Array||t instanceof Int16Array||t instanceof Int8Array||t instanceof Uint8ClampedArray)return{rr_type:t.constructor.name,args:[Object.values(t)]};if(t instanceof ArrayBuffer){var n=t.constructor.name,s=function(t){var e,i=new Uint8Array(t),r=i.length,n="";for(e=0;r>e;e+=3)n+=Sd[i[e]>>2],n+=Sd[(3&i[e])<<4|i[e+1]>>4],n+=Sd[(15&i[e+1])<<2|i[e+2]>>6],n+=Sd[63&i[e+2]];return r%3==2?n=n.substring(0,n.length-1)+"=":r%3==1&&(n=n.substring(0,n.length-2)+"=="),n}(t);return{rr_type:n,base64:s}}return t instanceof DataView?{rr_type:t.constructor.name,args:[Md(t.buffer,e,i,r),t.byteOffset,t.byteLength]}:t instanceof HTMLImageElement?{rr_type:t.constructor.name,src:t.src}:t instanceof HTMLCanvasElement?{rr_type:"HTMLImageElement",src:t.toDataURL(r.type,r.quality)}:t instanceof ImageData?{rr_type:t.constructor.name,args:[Md(t.data,e,i,r),t.width,t.height]}:Rd(t,e)||"object"==typeof t?{rr_type:t.constructor.name,index:Ed(t,e,i)}:t}var Id=(t,e,i,r)=>t.map((t=>Md(t,e,i,r))),Rd=(t,e)=>{var i=["WebGLActiveInfo","WebGLBuffer","WebGLFramebuffer","WebGLProgram","WebGLRenderbuffer","WebGLShader","WebGLShaderPrecisionFormat","WebGLTexture","WebGLUniformLocation","WebGLVertexArrayObject","WebGLVertexArrayObjectOES"].filter((t=>"function"==typeof e[t]));return Boolean(i.find((i=>t instanceof e[i])))},Pd=["webgl","webgl2"];function Ad(t){return"nodeType"in t}function Od(t,e,i,r){var n=[];try{if(r){var s=function(t,e,i){var r=t.GPUCanvasContext;if((null==r?void 0:r.prototype)&&"function"==typeof r.prototype.configure)return Gl(r.prototype,"configure",(function(r){return function(n){var s=function(t){var e=t.canvas;return e&&"object"==typeof e?e:null}(this);if(!s||Ad(s)&&qh(s,e,i,!0))return r.call(this,n);Ad(s)&&!("__context"in s)&&(s.__context="webgpu");var o=function(t){var e=t.GPUTextureUsage;return e?e.COPY_SRC|e.RENDER_ATTACHMENT:null}(t);return r.call(this,null!==o&&n?p({},n,{usage:"number"==typeof n.usage?n.usage|o:o}):n)}}))}(t,e,i);s&&n.push(s)}var o=Gl(t.HTMLCanvasElement.prototype,"getContext",(function(t){return function(n){for(var s=function(t){return"experimental-webgl"===t?"webgl":t}(n),o=arguments.length,a=new Array(o>1?o-1:0),l=1;o>l;l++)a[l-1]=arguments[l];if(!qh(this,e,i,!0)&&("__context"in this||(this.__context=s),r&&Pd.includes(s)))if(a[0]&&"object"==typeof a[0]){var u=a[0];u.preserveDrawingBuffer||(u.preserveDrawingBuffer=!0)}else a.splice(0,1,{preserveDrawingBuffer:!0});return t.apply(this,[n,...a])}}));n.push(o)}catch(t){console.error("failed to patch HTMLCanvasElement.prototype.getContext")}return()=>{n.forEach((t=>t()))}}function Fd(t,e,i,r,n,s,o){var a=[],l=Object.getOwnPropertyNames(t),u=function(l){if(["isContextLost","canvas","drawingBufferWidth","drawingBufferHeight"].includes(l))return 0;try{if("function"!=typeof t[l])return 0;var u=Gl(t,l,(function(t){return function(){for(var a=arguments.length,u=new Array(a),h=0;a>h;h++)u[h]=arguments[h];var d=t.apply(this,u);if(Ed(d,s,this),this.canvas&&"tagName"in this.canvas&&!qh(this.canvas,r,n,!0)){var v=Id(u,s,this,o);i(this.canvas,{type:e,property:l,args:v})}return d}}));a.push(u)}catch(s){var h=Oh(t,l,{set(t){this.canvas&&"tagName"in this.canvas&&!qh(this.canvas,r,n,!0)&&i(this.canvas,{type:e,property:l,args:[t],setter:!0})}});a.push(h)}};for(var h of l)u(h);return a}var Ld,$d,Dd,Nd='(function() {\n "use strict";\n var chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";\n var lookup = typeof Uint8Array === "undefined" ? [] : new Uint8Array(256);\n for (var i = 0; i < chars.length; i++) {\n lookup[chars.charCodeAt(i)] = i;\n }\n var encode = function(arraybuffer) {\n var bytes = new Uint8Array(arraybuffer), i2, len = bytes.length, base64 = "";\n for (i2 = 0; i2 < len; i2 += 3) {\n base64 += chars[bytes[i2] >> 2];\n base64 += chars[(bytes[i2] & 3) << 4 | bytes[i2 + 1] >> 4];\n base64 += chars[(bytes[i2 + 1] & 15) << 2 | bytes[i2 + 2] >> 6];\n base64 += chars[bytes[i2 + 2] & 63];\n }\n if (len % 3 === 2) {\n base64 = base64.substring(0, base64.length - 1) + "=";\n } else if (len % 3 === 1) {\n base64 = base64.substring(0, base64.length - 2) + "==";\n }\n return base64;\n };\n const lastFingerprintMap = /* @__PURE__ */ new Map();\n const transparentFingerprintMap = /* @__PURE__ */ new Map();\n const lastSentAtMap = /* @__PURE__ */ new Map();\n const PROVIDER_KEYFRAME_INTERVAL_MS = 3e4;\n function hashPixels(data) {\n const view = new Uint32Array(\n data.buffer,\n data.byteOffset,\n data.byteLength >>> 2\n );\n let primaryHash = 2166136261;\n let secondaryHash = 2654435769;\n for (let i2 = 0; i2 < view.length; i2++) {\n primaryHash ^= view[i2];\n primaryHash = Math.imul(primaryHash, 16777619);\n secondaryHash ^= view[i2];\n secondaryHash = Math.imul(secondaryHash, 2246822507);\n }\n return `${(primaryHash >>> 0).toString(16)}:${(secondaryHash >>> 0).toString(16)}`;\n }\n function frameFingerprint(width, height, data) {\n return `${width}x${height}:${hashPixels(data)}`;\n }\n function transparentFingerprint(width, height) {\n const pixelCount = width * height;\n let hash = transparentFingerprintMap.get(pixelCount);\n if (hash === void 0) {\n hash = hashPixels(new Uint8ClampedArray(pixelCount * 4));\n transparentFingerprintMap.set(pixelCount, hash);\n }\n return `${width}x${height}:${hash}`;\n }\n const worker = self;\n let reusableCanvas = null;\n let reusableCtx = null;\n worker.onmessage = async function(e) {\n if ("resetFrameDedup" in e.data) {\n lastFingerprintMap.clear();\n return;\n }\n if ("OffscreenCanvas" in globalThis) {\n const {\n id,\n bitmap,\n width,\n height,\n displayWidth,\n displayHeight,\n dataURLOptions,\n maskRegions\n } = e.data;\n try {\n if (!reusableCanvas || reusableCanvas.width !== width || reusableCanvas.height !== height) {\n reusableCanvas = new OffscreenCanvas(width, height);\n reusableCtx = reusableCanvas.getContext("2d", {\n willReadFrequently: true\n });\n }\n const ctx = reusableCtx;\n ctx.clearRect(0, 0, width, height);\n ctx.drawImage(bitmap, 0, 0);\n bitmap.close();\n if (maskRegions) {\n ctx.fillStyle = "black";\n for (const region of maskRegions) {\n ctx.fillRect(region.x, region.y, region.width, region.height);\n }\n }\n const fingerprint = frameFingerprint(\n width,\n height,\n ctx.getImageData(0, 0, width, height).data\n );\n const lastFingerprint = lastFingerprintMap.get(id) ?? transparentFingerprint(width, height);\n if (fingerprint === lastFingerprint) {\n const lastSentAt = lastSentAtMap.get(id);\n const keyframeDue = maskRegions !== void 0 && lastSentAt !== void 0 && Date.now() - lastSentAt >= PROVIDER_KEYFRAME_INTERVAL_MS;\n if (!keyframeDue) {\n return worker.postMessage({ id });\n }\n }\n const blob = await reusableCanvas.convertToBlob(dataURLOptions);\n const arrayBuffer = await blob.arrayBuffer();\n worker.postMessage({\n id,\n type: blob.type,\n base64: encode(arrayBuffer),\n // cpu intensive\n displayWidth,\n displayHeight\n });\n lastFingerprintMap.set(id, fingerprint);\n lastSentAtMap.set(id, Date.now());\n } catch {\n worker.postMessage({ id });\n }\n } else {\n e.data.bitmap.close();\n return worker.postMessage({ id: e.data.id });\n }\n };\n})();\n',qd="undefined"!=typeof self&&self.Blob&&new Blob([Nd],{type:"text/javascript;charset=utf-8"});function jd(t){var e;try{if(!(e=qd&&(self.URL||self.webkitURL).createObjectURL(qd)))throw"";var i=new Worker(e,{name:null==t?void 0:t.name});return i.addEventListener("error",(()=>{(self.URL||self.webkitURL).revokeObjectURL(e)})),i}catch(e){return new Worker("data:text/javascript;charset=utf-8,"+encodeURIComponent(Nd),{name:null==t?void 0:t.name})}finally{e&&(self.URL||self.webkitURL).revokeObjectURL(e)}}class Bd{constructor(t){Il(this,"pendingCanvasMutations",new Map),Il(this,"rafStamps",{latestId:0,invokeId:null}),Il(this,"mirror"),Il(this,"mutationCb"),Il(this,"resetObservers"),Il(this,"frozen",!1),Il(this,"locked",!1),Il(this,"rafIdTimestamp",null),Il(this,"rafIdFlush",null),Il(this,"refCount",0),Il(this,"torndown",!1),Il(this,"resetFrameDedup",null),Il(this,"processMutation",((t,e)=>{!(this.rafStamps.invokeId&&this.rafStamps.latestId!==this.rafStamps.invokeId)&&this.rafStamps.invokeId||(this.rafStamps.invokeId=this.rafStamps.latestId),this.pendingCanvasMutations.has(t)||this.pendingCanvasMutations.set(t,[]),this.pendingCanvasMutations.get(t).push(e)}));var e=t.sampling,i=void 0===e?"all":e,r=t.win,n=t.blockClass,s=t.blockSelector,o=t.recordCanvas,a=t.dataURLOptions,l=t.resolutionScale,u=t.canvasMasking;this.mutationCb=t.mutationCb,this.mirror=t.mirror,o&&"all"===i&&this.initCanvasMutationObserver(r,n,s,a),o&&"number"==typeof i&&this.initCanvasFPSObserver(i,r,n,s,{dataURLOptions:a,resolutionScale:l,canvasMasking:u})}onFullSnapshot(){var t;null==(t=this.resetFrameDedup)||t.call(this)}acquire(){this.refCount+=1}reset(){this.refCount>0&&(this.refCount-=1),this.refCount>0||this.teardown()}teardown(){this.torndown||(this.torndown=!0,this.pendingCanvasMutations.clear(),this.resetObservers&&this.resetObservers(),null!==this.rafIdTimestamp&&(cancelAnimationFrame(this.rafIdTimestamp),this.rafIdTimestamp=null),null!==this.rafIdFlush&&(cancelAnimationFrame(this.rafIdFlush),this.rafIdFlush=null))}freeze(){this.frozen=!0}unfreeze(){this.frozen=!1}lock(){this.locked=!0}unlock(){this.locked=!1}initCanvasFPSObserver(t,e,i,r,n){var s=this;if("OffscreenCanvas"in e){var o,a="number"==typeof n.resolutionScale&&Number.isFinite(n.resolutionScale)?Math.min(1,Math.max(.1,n.resolutionScale)):1,l=Od(e,i,r,!0),u=new Map;try{o=new jd}catch(t){return}var h=!1;o.onerror=()=>{var t;h=!0,cancelAnimationFrame(d),null==(t=o.terminate)||t.call(o),this.resetFrameDedup=null},this.resetFrameDedup=()=>{o.postMessage({resetFrameDedup:!0})},o.onmessage=t=>{var e=t.data.id;if(u.set(e,!1),"base64"in t.data){var i=t.data,r=i.displayWidth,n=i.displayHeight;this.mutationCb({id:e,type:Fl["2D"],commands:[{property:"clearRect",args:[0,0,r,n]},{property:"drawImage",args:[{rr_type:"ImageBitmap",args:[{rr_type:"Blob",data:[{rr_type:"ArrayBuffer",base64:i.base64}],type:i.type}]},0,0,r,n]}],displayWidth:r,displayHeight:n})}};var d,v=1e3/t,c=0,p=t=>{var l,g;h||(c&&v>t-c||(c=t,(l=[],g=t=>{try{t.querySelectorAll("canvas").forEach((t=>{qh(t,i,r,!0)||l.push(t)})),t.querySelectorAll("*").forEach((t=>{t.shadowRoot&&g(t.shadowRoot)}))}catch(t){}},g(e.document),l).forEach(function(){var t=f((function*(t){var e,i,r=s.mirror.getId(t);if(!u.get(r)&&0!==t.width&&0!==t.height){u.set(r,!0);try{if(["webgl","webgl2"].includes(t.__context)){var l=t.getContext(t.__context);if(null==(e=null==l?void 0:l.isContextLost)?void 0:e.call(l))return void u.set(r,!1);!1===(null==(i=null==l?void 0:l.getContextAttributes())?void 0:i.preserveDrawingBuffer)&&l.clear(l.COLOR_BUFFER_BIT)}var h=t.clientWidth||t.width,d=t.clientHeight||t.height,v=Math.max(1,Math.round(h*a)),c=Math.max(1,Math.round(d*a)),f=function(t,e,i,r,n,s){if(t&&"function"==typeof t.regionsFn){var o;try{o=t.regionsFn(e)}catch(t){return wd}if(void 0!==o){if(!Array.isArray(o)||!o.every(kd))return wd;var a=i/n,l=r/s;return o.filter((t=>t.width>0&&t.height>0)).map((t=>{var e=Math.floor(t.x*a),i=Math.floor(t.y*l);return{x:e,y:i,width:Math.ceil((t.x+t.width)*a)-e,height:Math.ceil((t.y+t.height)*l)-i}}))}}}(n.canvasMasking,t,v,c,h,d);if(f===wd)return void u.set(r,!1);var p=yield createImageBitmap(t,1>a?{resizeWidth:v,resizeHeight:c,resizeQuality:"medium"}:{resizeWidth:v,resizeHeight:c});o.postMessage({id:r,bitmap:p,width:v,height:c,displayWidth:h,displayHeight:d,dataURLOptions:n.dataURLOptions,maskRegions:f},[p])}catch(t){u.set(r,!1)}}}));return function(e){return t.apply(this,arguments)}}())),d=requestAnimationFrame(p))};d=requestAnimationFrame(p),this.resetObservers=()=>{var t;l(),cancelAnimationFrame(d),null==(t=o.terminate)||t.call(o),this.resetFrameDedup=null}}}initCanvasMutationObserver(t,e,i,r){this.startRAFTimestamping(),this.startPendingCanvasMutationFlusher();var n=Od(t,e,i,!1),s=function(t,e,i,r,n){var s=[],o=Object.getOwnPropertyNames(e.CanvasRenderingContext2D.prototype),a=function(o){try{if("function"!=typeof e.CanvasRenderingContext2D.prototype[o])return 1;var a=Gl(e.CanvasRenderingContext2D.prototype,o,(function(s){return function(){for(var a=arguments.length,l=new Array(a),u=0;a>u;u++)l[u]=arguments[u];return qh(this.canvas,i,r,!0)||setTimeout((()=>{var i=Id(l,e,this,n);t(this.canvas,{type:Fl["2D"],property:o,args:i})}),0),s.apply(this,l)}}));s.push(a)}catch(n){var l=Oh(e.CanvasRenderingContext2D.prototype,o,{set(e){qh(this.canvas,i,r,!0)||t(this.canvas,{type:Fl["2D"],property:o,args:[e],setter:!0})}});s.push(l)}};for(var l of o)a(l);return()=>{s.forEach((t=>t()))}}(this.processMutation.bind(this),t,e,i,r),o=function(t,e,i,r,n){var s=[];return void 0!==e.WebGLRenderingContext&&s.push(...Fd(e.WebGLRenderingContext.prototype,Fl.WebGL,t,i,r,e,n)),void 0!==e.WebGL2RenderingContext&&s.push(...Fd(e.WebGL2RenderingContext.prototype,Fl.WebGL2,t,i,r,e,n)),()=>{s.forEach((t=>t()))}}(this.processMutation.bind(this),t,e,i,r);this.resetObservers=()=>{n(),s(),o()}}startPendingCanvasMutationFlusher(){this.rafIdFlush=requestAnimationFrame((()=>this.flushPendingCanvasMutations()))}startRAFTimestamping(){var t=e=>{this.rafStamps.latestId=e,this.rafIdTimestamp=requestAnimationFrame(t)};this.rafIdTimestamp=requestAnimationFrame(t)}flushPendingCanvasMutations(){this.pendingCanvasMutations.forEach(((t,e)=>{var i=this.mirror.getId(e);this.flushPendingCanvasMutationFor(e,i)})),this.rafIdFlush=requestAnimationFrame((()=>this.flushPendingCanvasMutations()))}flushPendingCanvasMutationFor(t,e){if(!this.frozen&&!this.locked){var i=this.pendingCanvasMutations.get(t);if(i&&-1!==e){var r=i.map((t=>g(t,El)));this.mutationCb({id:e,type:i[0].type,commands:r}),this.pendingCanvasMutations.delete(t)}}}}class Ud{constructor(t){var e;Il(this,"trackedLinkElements",new WeakSet),Il(this,"pendingDeferredSheets",new Set),Il(this,"mutationCb"),Il(this,"adoptedStyleSheetCb"),Il(this,"maskAllElementAttributes"),Il(this,"maskAttributeFn"),Il(this,"styleMirror",new Vh),this.mutationCb=t.mutationCb,this.adoptedStyleSheetCb=t.adoptedStyleSheetCb,this.maskAllElementAttributes=null!==(e=t.maskAllElementAttributes)&&void 0!==e&&e,this.maskAttributeFn=t.maskAttributeFn}attachLinkElement(t,e){"_cssText"in e.attributes&&this.mutationCb({adds:[],removes:[],texts:[],attributes:[{id:e.id,attributes:e.attributes}]}),this.trackLinkElement(t)}beginDeferredLinkInlining(t,e){if(-1===e||!t.isConnected)return null;var i=null,r=null;try{(r=t.sheet)&&(i=Du(r))}catch(t){}if(!i||!r)return ku(),null;var n=i,s=!1,o={sheet:r,invalidate(){s=!0}};this.pendingDeferredSheets.add(o);var a=!1;return{advance:i=>{if(a)return!0;var l,u,h=Jl(),d=tu(),v=!0;try{if(s)return a=!0,ku(),!0;if(!n.advance(i))return v=!1,!1;a=!0;var c=n.text();if(!t.isConnected)return!0;var f=null;try{f=t.sheet}catch(t){}return f!==r?(ku(),!0):c?(this.emitCssTextMutation(t,e,c),!0):(ku(),!0)}finally{v&&this.pendingDeferredSheets.delete(o),eu(l=Jl()-h,null!=(u=d)?u:Kl)||(vu.totalMs+=l,l>vu.slowestSliceMs&&(vu.slowestSliceMs=l))}},remainingRules:()=>n.remainingRules(),discard:()=>{this.pendingDeferredSheets.delete(o)}}}onCssomSheetMutation(t){if(t&&0!==this.pendingDeferredSheets.size)for(var e of this.pendingDeferredSheets)e.sheet===t&&(this.pendingDeferredSheets.delete(e),e.invalidate())}inlineDeferredLinkElement(t,e){var i;null==(i=this.beginDeferredLinkInlining(t,e))||i.advance(1/0)}emitCssTextMutation(t,e,i){this.mutationCb({adds:[],removes:[],texts:[],attributes:[{id:e,attributes:{_cssText:Uu({element:t,name:"_cssText",value:i,maskAllElementAttributes:this.maskAllElementAttributes,maskAttributeFn:this.maskAttributeFn})}}]})}trackLinkElement(t){this.trackedLinkElements.has(t)||(this.trackedLinkElements.add(t),this.trackStylesheetInLinkElement(t))}adoptStyleSheets(t,e){var i=this;if(0!==t.length){var r={id:e,styleIds:[]},n=[],s=function(t){var e;if(i.styleMirror.has(t))e=i.styleMirror.getId(t);else{var s=i.styleMirror.add(t);e=s;var o=Jl();try{_u((()=>{try{var e=t.rules||t.cssRules;e&&yu(e)}catch(t){}n.push({styleId:s,rules:Array.from(t.rules||CSSRule,((e,i)=>({rule:Pu(e,t.href),index:i})))})}))}finally{bu(Jl()-o)}}r.styleIds.push(e)};for(var o of t)s(o);n.length>0&&(r.styles=n),this.adoptedStyleSheetCb(r)}}reset(){this.styleMirror.reset(),this.trackedLinkElements=new WeakSet,this.pendingDeferredSheets.clear(),yh.forEach((t=>t.abort())),yh.clear()}trackStylesheetInLinkElement(t){}}class Hd{constructor(){Il(this,"nodeMap",new WeakMap),Il(this,"active",!1)}inOtherBuffer(t,e){var i=this.nodeMap.get(t);return i&&Array.from(i).some((t=>t!==e))}add(t,e){this.active||(this.active=!0,requestAnimationFrame((()=>{this.nodeMap=new WeakMap,this.active=!1}))),this.nodeMap.set(t,(this.nodeMap.get(t)||new Set).add(e))}destroy(){}}var zd=!1;try{if(2!==Array.from([1],(t=>2*t))[0]){var Wd=document.createElement("iframe");document.body.appendChild(Wd),Array.from=(null==(Tl=Wd.contentWindow)?void 0:Tl.Array.from)||Array.from,document.body.removeChild(Wd)}}catch(t){console.debug("Unable to override Array.from",t)}var Vd=new Nu,Gd=new Set([Pl.Mutation,Pl.MediaInteraction,Pl.StyleSheetRule,Pl.CanvasMutation,Pl.Font,Pl.Log,Pl.StyleDeclaration,Pl.AdoptedStyleSheet]);function Zd(t){var e=window;if("function"==typeof e.requestIdleCallback){var i=e.requestIdleCallback(t,{timeout:2e3});return{cancel(){var t;return null==(t=e.cancelIdleCallback)?void 0:t.call(e,i)}}}var r=setTimeout(t,250);return{cancel:()=>clearTimeout(r)}}function Qd(t){var e;void 0===t&&(t={});var i=t,r=i.emit,n=i.checkoutEveryNms,s=i.checkoutEveryNth,o=i.blockClass,a=void 0===o?"rr-block":o,l=i.blockSelector,u=void 0===l?null:l,h=i.ignoreClass,d=void 0===h?"rr-ignore":h,v=i.ignoreSelector,c=void 0===v?null:v,f=i.maskTextClass,g=void 0===f?"rr-mask":f,m=i.maskTextSelector,y=void 0===m?null:m,_=i.inlineStylesheet,b=void 0===_||_,w=i.inlineStylesheetBudgetRules,k=i.maskAllInputs,S=i.maskInputOptions,x=i.slimDOMOptions,C=i.maskInputFn,T=i.maskTextFn,E=i.maskAllElementAttributes,M=void 0!==E&&E,I=i.maskAttributeFn,R=i.hooks,P=i.packFn,A=i.sampling,O=void 0===A?{}:A,F=i.dataURLOptions,L=void 0===F?{}:F,D=i.canvasResolutionScale,N=i.canvasMasking,q=i.mousemoveWait,j=i.recordDOM,B=void 0===j||j,U=i.recordCanvas,H=void 0!==U&&U,z=i.recordCrossOriginIframes,W=void 0!==z&&z,V=i.recordAfter,G=void 0===V?"DOMContentLoaded"===t.recordAfter?t.recordAfter:"load":V,Z=i.userTriggeredOnInput,Q=void 0!==Z&&Z,J=i.collectFonts,K=void 0!==J&&J,Y=i.inlineImages,X=void 0!==Y&&Y,tt=i.plugins,et=i.keepIframeSrcFn,it=void 0===et?()=>!1:et,rt=i.ignoreCSSAttributes,nt=void 0===rt?new Set([]):rt,st=i.attributeFilter;Kh=i.errorHandler;var ot=p({type:"image/webp",quality:.4,maxBase64ImageLength:1048576},L),at=!W||window.parent===window,lt=!1;if(!at)try{window.parent.document&&(lt=!1)}catch(t){lt=!0}if(at&&!r)throw new Error("emit function is required");if(!at&&!lt)return()=>{};void 0!==q&&void 0===O.mousemove&&(O.mousemove=q),Vd.reset();var ut,ht=!0===k?{color:!0,date:!0,"datetime-local":!0,email:!0,month:!0,number:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0,textarea:!0,select:!0,password:!0}:void 0!==S?S:{password:!0},dt=Ch(void 0!==x&&x);!function(t){void 0===t&&(t=window),"NodeList"in t&&!t.NodeList.prototype.forEach&&(t.NodeList.prototype.forEach=[].forEach),"DOMTokenList"in t&&!t.DOMTokenList.prototype.forEach&&(t.DOMTokenList.prototype.forEach=[].forEach)}();var vt,ct,ft=0,pt=new Map,gt=t=>{for(var e of tt||[])e.eventProcessor&&(t=e.eventProcessor(t));return P&&!lt&&(t=P(t)),t};Ld=(t,e)=>{var i,o=t;if(o.timestamp=Fh(),!(null==(i=nd[0])?void 0:i.isFrozen())||o.type===Rl.FullSnapshot||o.type===Rl.IncrementalSnapshot&&Gd.has(o.data.source)||nd.forEach((t=>t.unfreeze())),at)null==r||r(gt(o),e);else if(lt){var a={type:"rrweb",event:gt(o),origin:window.location.origin,isCheckout:e};window.parent.postMessage(a,"*")}if(o.type===Rl.FullSnapshot)ut=o,ft=0;else if(o.type===Rl.IncrementalSnapshot){if(o.data.source===Pl.Mutation&&o.data.isAttachIframe)return;ft++,(s&&ft>=s||n&&o.timestamp-ut.timestamp>n)&&$d(!0)}};var mt=t=>{if(t.removes&&t.removes.length>0){var e=t.adds.length>0?new Set(t.adds.map((t=>t.node.id))):null,i=new Set;if(t.adds.length>0)for(var r of t.adds){var n=Vd.getNode(r.node.id);n&&"IFRAME"===n.nodeName&&i.add(n)}t.removes.forEach((t=>{var r=t.id;if(!e||!e.has(r)){var n=wt.getIframeElementById(r);n&&i.has(n)?wt.forgetIframeId(r):(null==vt||vt(r),wt.removeIframeById(r))}})),null==ct||ct(),wt.cleanupDetachedIframes()}Ld({type:Rl.IncrementalSnapshot,data:p({source:Pl.Mutation},t)})},yt=t=>Ld({type:Rl.IncrementalSnapshot,data:p({source:Pl.Scroll},t)}),_t=t=>Ld({type:Rl.IncrementalSnapshot,data:p({source:Pl.CanvasMutation},t)}),bt=new Ud({mutationCb:mt,adoptedStyleSheetCb:t=>Ld({type:Rl.IncrementalSnapshot,data:p({source:Pl.AdoptedStyleSheet},t)}),maskAllElementAttributes:M,maskAttributeFn:I}),wt=new _d({mirror:Vd,mutationCb:mt,stylesheetManager:bt,recordCrossOriginIframes:W,wrappedEmit:Ld});for(var kt of tt||[])kt.getMirror&&kt.getMirror({nodeMirror:Vd,crossOriginIframeMirror:wt.crossOriginIframeMirror,crossOriginIframeStyleMirror:wt.crossOriginIframeStyleMirror});var St=new Hd,xt=null==N?void 0:N.configured;Dd=new Bd({recordCanvas:H,mutationCb:_t,win:window,blockClass:a,blockSelector:u,mirror:Vd,sampling:O.canvas,dataURLOptions:ot,resolutionScale:D,canvasMasking:N});var Ct=new bd({mutationCb:mt,scrollCb:yt,bypassOptions:{blockClass:a,blockSelector:u,maskTextClass:g,maskTextSelector:y,inlineStylesheet:b,maskInputOptions:ht,dataURLOptions:ot,maskTextFn:T,maskInputFn:C,maskAllElementAttributes:M,maskAttributeFn:I,recordCanvas:H,canvasMaskingConfigured:xt,inlineImages:X,sampling:O,slimDOMOptions:dt,iframeManager:wt,stylesheetManager:bt,canvasManager:Dd,keepIframeSrcFn:it,processedNodeManager:St,attributeFilter:st},mirror:Vd});$d=function(t){if(void 0===t&&(t=!1),B){fu(w);try{Ld({type:Rl.Meta,data:{href:window.location.href,width:Dh(),height:$h()}},t),null==e||e.cancel(),e=void 0,bt.reset(),Ct.init(),nd.forEach((t=>t.lock()));var i,r=null;try{r=function(t,e){var i=e||{},r=i.mirror,n=void 0===r?new Nu:r,s=i.blockClass,o=void 0===s?"rr-block":s,a=i.blockSelector,l=void 0===a?null:a,u=i.maskTextClass,h=void 0===u?"rr-mask":u,d=i.maskTextSelector,v=void 0===d?null:d,c=i.inlineStylesheet,f=void 0===c||c,p=i.inlineImages,g=void 0!==p&&p,m=i.recordCanvas,y=void 0!==m&&m,_=i.canvasMaskingConfigured,b=i.maskAllInputs,w=void 0!==b&&b,k=i.maskTextFn,S=i.maskInputFn,x=i.maskAllElementAttributes,C=void 0!==x&&x,T=i.maskAttributeFn,E=i.slimDOM,M=i.dataURLOptions,I=i.preserveWhiteSpace,R=i.onSerialize,P=i.onIframeLoad,A=i.iframeLoadTimeout,O=i.onIframeListenerRegistered,F=i.onStylesheetLoad,L=i.stylesheetLoadTimeout,D=i.keepIframeSrcFn,N=void 0===D?()=>!1:D,q=i.maxDepth,j=i.inlineStylesheetBudgetRules,B=!0===w?{color:!0,date:!0,"datetime-local":!0,email:!0,month:!0,number:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0,textarea:!0,select:!0,password:!0}:!1===w?{password:!0}:w,U=Ch(void 0!==E&&E);fu(j);try{return xh(t,{doc:t,mirror:n,blockClass:o,blockSelector:l,maskTextClass:h,maskTextSelector:v,skipChild:!1,inlineStylesheet:f,maskInputOptions:B,maskTextFn:k,maskInputFn:S,maskAllElementAttributes:C,maskAttributeFn:T,slimDOMOptions:U,dataURLOptions:M,inlineImages:g,recordCanvas:y,canvasMaskingConfigured:_,preserveWhiteSpace:I,onSerialize:R,onIframeLoad:P,iframeLoadTimeout:A,onIframeListenerRegistered:O,onStylesheetLoad:F,stylesheetLoadTimeout:L,keepIframeSrcFn:N,newlyAddedElement:!1,maxDepth:q})}finally{pu()}}(document,{mirror:Vd,blockClass:a,blockSelector:u,maskTextClass:g,maskTextSelector:y,inlineStylesheet:b,maskAllInputs:ht,inlineStylesheetBudgetRules:w,maskTextFn:T,maskInputFn:C,maskAllElementAttributes:M,maskAttributeFn:I,slimDOM:dt,dataURLOptions:ot,recordCanvas:H,canvasMaskingConfigured:xt,inlineImages:X,onSerialize(t){Hh(t,Vd)&&wt.addIframe(t),zh(t,Vd)&&bt.trackLinkElement(t),Wh(t)&&Ct.addShadowRoot(Zl.shadowRoot(t),document)},onIframeLoad(t,e){wt.attachIframe(t,e),Ct.observeAttachShadow(t)},onIframeListenerRegistered(t,e){wt.registerLoadListenerDisposer(t,e)},onStylesheetLoad(t,e){bt.attachLinkElement(t,e)},keepIframeSrcFn:it})}finally{s=lu,lu=[],i=s}if(!r)return console.warn("Failed to snapshot the document");if(Ld({type:Rl.FullSnapshot,data:{node:r,initialOffset:Lh(window)}},t),nd.forEach((t=>t.unlock())),Dd.onFullSnapshot(),i.length){var n=function(t,e,i){var r=!1,n=null,s=0,o=null,a=()=>null!==o||t.length>s,l=()=>{var i=t[s];t[s]=null,s+=1,i&&Ih((()=>{o=e.beginDeferredLinkInlining(i,Vd.getId(i))}))},u=()=>{if(o){var t=o,e=!0;Ih((()=>{e=t.advance(200)})),e&&(o=null)}},h=t=>{if(n=null,!r){var e=0;do{try{o||l(),u()}catch(t){null==o||o.discard(),o=null,Su(1)}e+=1}while(!r&&a()&&(t?!t.didTimeout&&t.timeRemaining()>5:10>e));r||(a()?n=Zd(h):i())}};return n=Zd(h),{cancel(){r=!0,null==o||o.discard(),o=null,null==n||n.cancel(),n=null},flush(){if(!r){r=!0,null==n||n.cancel(),n=null;for(var e=0,h=0;a()&&50>e;){o||l();var d=o;if(d)if(Math.floor(d.remainingRules()/200)+1>50-e)d.discard(),o=null,h+=1;else{try{u()}catch(t){null==o||o.discard(),o=null,h+=1}e+=1}}if(a()||h>0){for(var v=h+(null!==o?1:0),c=s;t.length>c;c++)null!==t[c]&&(v+=1);Su(v),null==o||o.discard(),o=null}i()}}}}(i,bt,(()=>{e===n&&(e=void 0)}));e=n}W&&wt.reattachIframes(),document.adoptedStyleSheets&&document.adoptedStyleSheets.length>0&&bt.adoptStyleSheets(document.adoptedStyleSheets,Vd.getId(document))}finally{pu()}var s}};try{var Tt=[];for(var Et of(Tt.push(Eh("pagehide",(()=>{try{null==e||e.flush()}catch(t){}e=void 0}),window)),["visibilitychange","freeze","resume"]))Tt.push(Eh(Et,Xl,document));vt=t=>{var e=pt.get(t);e&&(e.forEach((t=>{Ih(t);var e=Tt.indexOf(t);-1!==e&&Tt.splice(e,1)})),pt.delete(t))},ct=()=>{for(var t of pt){var e=t[0],i=Vd.getNode(e);if(i)try{i.contentDocument&&i.contentDocument.defaultView||null==vt||vt(e)}catch(t){null==vt||vt(e)}else null==vt||vt(e)}};var Mt=t=>{var e;return rd(pd)({mutationCb:mt,mousemoveCb:(t,e)=>Ld({type:Rl.IncrementalSnapshot,data:{source:e,positions:t}}),mouseInteractionCb:t=>Ld({type:Rl.IncrementalSnapshot,data:p({source:Pl.MouseInteraction},t)}),scrollCb:yt,viewportResizeCb:t=>Ld({type:Rl.IncrementalSnapshot,data:p({source:Pl.ViewportResize},t)}),inputCb:t=>Ld({type:Rl.IncrementalSnapshot,data:p({source:Pl.Input},t)}),mediaInteractionCb:t=>Ld({type:Rl.IncrementalSnapshot,data:p({source:Pl.MediaInteraction},t)}),styleSheetRuleCb:t=>Ld({type:Rl.IncrementalSnapshot,data:p({source:Pl.StyleSheetRule},t)}),styleDeclarationCb:t=>Ld({type:Rl.IncrementalSnapshot,data:p({source:Pl.StyleDeclaration},t)}),canvasMutationCb:_t,fontCb:t=>Ld({type:Rl.IncrementalSnapshot,data:p({source:Pl.Font},t)}),selectionCb(t){Ld({type:Rl.IncrementalSnapshot,data:p({source:Pl.Selection},t)})},customElementCb(t){Ld({type:Rl.IncrementalSnapshot,data:p({source:Pl.CustomElement},t)})},blockClass:a,ignoreClass:d,ignoreSelector:c,maskTextClass:g,maskTextSelector:y,maskInputOptions:ht,inlineStylesheet:b,sampling:O,recordDOM:B,recordCanvas:H,canvasMaskingConfigured:xt,inlineImages:X,userTriggeredOnInput:Q,collectFonts:K,doc:t,maskInputFn:C,maskTextFn:T,maskAllElementAttributes:M,maskAttributeFn:I,keepIframeSrcFn:it,blockSelector:u,slimDOMOptions:dt,dataURLOptions:ot,mirror:Vd,iframeManager:wt,stylesheetManager:bt,shadowDomManager:Ct,processedNodeManager:St,canvasManager:Dd,ignoreCSSAttributes:nt,attributeFilter:st,plugins:(null==(e=null==tt?void 0:tt.filter((t=>t.observer)))?void 0:e.map((t=>({observer:t.observer,options:t.options,callback:e=>Ld({type:Rl.Plugin,data:{plugin:t.name,payload:e}})}))))||[]},R)};wt.addLoadListener((t=>{try{var e=Vd.getId(t),i=Mt(t.contentDocument);if("function"==typeof i&&(Tt.push(i),-1!==e)){var r=pt.get(e);r||pt.set(e,r=new Set),r.add(i)}}catch(t){console.warn(t)}})),wt.addPageHideListener((t=>{var e=Vd.getId(t);null==vt||vt(e),ld(t)}));var It=-1,Rt=t=>Ld({type:Rl.Custom,data:{tag:"rrweb/fullscreen",payload:t}}),Pt=()=>{var t,e,i,r,n=document,s=null!==(t=null!==(e=null!==(i=null!==(r=n.fullscreenElement)&&void 0!==r?r:n.webkitFullscreenElement)&&void 0!==i?i:n.mozFullScreenElement)&&void 0!==e?e:n.msFullscreenElement)&&void 0!==t?t:null,o=s?Vd.getId(s):-1;o!==It&&(-1!==It&&Rt({id:It,enter:!1}),It=o,-1!==o&&Rt({id:o,enter:!0}))},At=()=>{$d();var t=Mt(document);"function"==typeof t&&Tt.push(t),Tt.push(Eh("fullscreenchange",Pt)),Tt.push(Eh("webkitfullscreenchange",Pt)),Tt.push(Eh("mozfullscreenchange",Pt)),Tt.push(Eh("MSFullscreenChange",Pt)),zd=!0};return["interactive","complete"].includes(document.readyState)?At():(Tt.push(Eh("DOMContentLoaded",(()=>{Ld({type:Rl.DomContentLoaded,data:{}}),"DOMContentLoaded"===G&&At()}))),Tt.push(Eh("load",(()=>{Ld({type:Rl.Load,data:{}}),"load"===G&&At()}),window))),()=>{try{null==e||e.flush()}catch(t){}e=void 0,Tt.forEach((t=>Ih(t))),St.destroy(),wt.removeLoadListener(),wt.destroy(),pt.clear(),Ct.reset(),Vd.reset(),zd=!1,Kh=void 0}}catch(t){console.warn(t)}}Qd.addCustomEvent=(t,e)=>{if(!zd)throw new Error("please add custom event after start recording");Ld({type:Rl.Custom,data:{tag:t,payload:e}})},Qd.freezePage=()=>{nd.forEach((t=>t.freeze()))},Qd.takeFullSnapshot=t=>{if(!zd)throw new Error("please take full snapshot after start recording");$d(t)},Qd.mirror=Vd;var Jd=Object.defineProperty,Kd=(t,e,i)=>((t,e,i)=>e in t?Jd(t,e,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[e]=i)(t,"symbol"!=typeof e?e+"":e,i);class Yd{constructor(t){Kd(this,"fileName"),Kd(this,"functionName"),Kd(this,"lineNumber"),Kd(this,"columnNumber"),this.fileName=t.fileName||"",this.functionName=t.functionName||"",this.lineNumber=t.lineNumber,this.columnNumber=t.columnNumber}toString(){var t=this.lineNumber||"",e=this.columnNumber||"";return this.functionName?this.functionName+" ("+this.fileName+":"+t+":"+e+")":this.fileName+":"+t+":"+e}}var Xd=/(^|@)\S+:\d+/,tv=/^\s*at .*(\S+:\d+|\(native\))/m,ev=/^(eval@)?(\[native code])?$/,iv={parse(t){return t?void 0!==t.stacktrace||void 0!==t["opera#sourceloc"]?this.parseOpera(t):t.stack&&t.stack.match(tv)?this.parseV8OrIE(t):t.stack?this.parseFFOrSafari(t):[]:[]},extractLocation(t){if(-1===t.indexOf(":"))return[t];var e=/(.+?)(?::(\d+))?(?::(\d+))?$/.exec(t.replace(/[()]/g,""));if(!e)throw new Error("Cannot parse given url: "+t);return[e[1],e[2]||void 0,e[3]||void 0]},parseV8OrIE(t){return t.stack.split("\n").filter((function(t){return!!t.match(tv)}),this).map((function(t){t.indexOf("(eval ")>-1&&(t=t.replace(/eval code/g,"eval").replace(/(\(eval at [^()]*)|(\),.*$)/g,""));var e=t.replace(/^\s+/,"").replace(/\(eval code/g,"("),i=e.match(/ (\((.+):(\d+):(\d+)\)$)/),r=(e=i?e.replace(i[0],""):e).split(/\s+/).slice(1),n=this.extractLocation(i?i[1]:r.pop()),s=r.join(" ")||void 0,o=["eval","<anonymous>"].indexOf(n[0])>-1?void 0:n[0];return new Yd({functionName:s,fileName:o,lineNumber:n[1],columnNumber:n[2]})}),this)},parseFFOrSafari(t){return t.stack.split("\n").filter((function(t){return!t.match(ev)}),this).map((function(t){if(t.indexOf(" > eval")>-1&&(t=t.replace(/ line (\d+)(?: > eval line \d+)* > eval:\d+:\d+/g,":$1")),-1===t.indexOf("@")&&-1===t.indexOf(":"))return new Yd({functionName:t});var e=/((.*".+"[^@]*)?[^@]*)(?:@)/,i=t.match(e),r=i&&i[1]?i[1]:void 0,n=this.extractLocation(t.replace(e,""));return new Yd({functionName:r,fileName:n[0],lineNumber:n[1],columnNumber:n[2]})}),this)},parseOpera(t){return!t.stacktrace||t.message.indexOf("\n")>-1&&t.message.split("\n").length>t.stacktrace.split("\n").length?this.parseOpera9(t):t.stack?this.parseOpera11(t):this.parseOpera10(t)},parseOpera9(t){for(var e=/Line (\d+).*script (?:in )?(\S+)/i,i=t.message.split("\n"),r=[],n=2,s=i.length;s>n;n+=2){var o=e.exec(i[n]);o&&r.push(new Yd({fileName:o[2],lineNumber:parseFloat(o[1])}))}return r},parseOpera10(t){for(var e=/Line (\d+).*script (?:in )?(\S+)(?:: In function (\S+))?$/i,i=t.stacktrace.split("\n"),r=[],n=0,s=i.length;s>n;n+=2){var o=e.exec(i[n]);o&&r.push(new Yd({functionName:o[3]||void 0,fileName:o[2],lineNumber:parseFloat(o[1])}))}return r},parseOpera11(t){return t.stack.split("\n").filter((function(t){return!!t.match(Xd)&&!t.match(/^Error created at/)}),this).map((function(t){var e=t.split("@"),i=this.extractLocation(e.pop()),r=(e.shift()||"").replace(/<anonymous function(: (\w+))?>/,"$2").replace(/\([^)]*\)/g,"")||void 0;return new Yd({functionName:r,fileName:i[0],lineNumber:i[1],columnNumber:i[2]})}),this)}};function rv(t){if(!t||!t.outerHTML)return"";for(var e="";t.parentElement;){var i=t.localName;if(!i)break;i=i.toLowerCase();var r=t.parentElement,n=[];if(r.children&&r.children.length>0)for(var s=0;r.children.length>s;s++){var o=r.children[s];o.localName&&o.localName.toLowerCase&&o.localName.toLowerCase()===i&&n.push(o)}n.length>1&&(i+=":eq("+n.indexOf(t)+")"),e=i+(e?">"+e:""),t=r}return e}function nv(t){return Array.isArray(t)}function sv(t){return"object"==typeof t&&null!==t&&!nv(t)}function ov(t,e){if(0===e)return!0;var i=Object.keys(t);for(var r of i)if(sv(t[r])&&ov(t[r],e-1))return!0;return!1}function av(t,e){var i={numOfKeysLimit:50,depthOfLimit:4};Object.assign(i,e);var r=[],n=[];return JSON.stringify(t,(function(t,e){if(r.length>0){var s=r.indexOf(this);~s?r.splice(s+1):r.push(this),~s?n.splice(s,1/0,t):n.push(t),~r.indexOf(e)&&(e=r[0]===e?"[Circular ~]":"[Circular ~."+n.slice(0,r.indexOf(e)).join(".")+"]")}else r.push(e);if(null===e)return e;if(void 0===e)return"undefined";if(sv(o=e)&&Object.keys(o).length>i.numOfKeysLimit||"function"==typeof o||sv(o)&&ov(o,i.depthOfLimit))return function(t){var e=t.toString();return i.stringLengthLimit&&e.length>i.stringLengthLimit&&(e=e.slice(0,i.stringLengthLimit)+"..."),e}(e);var o;if("bigint"==typeof e)return e.toString()+"n";if(e instanceof Event){var a={};for(var l in e){var u=e[l];a[l]=nv(u)?rv(u.length?u[0]:null):u}return a}return e instanceof Node?e instanceof HTMLElement?e?e.outerHTML:"":e.nodeName:e instanceof Error?e.stack?e.stack+"\nEnd of stack for Error object":e.name+": "+e.message:e}))}var lv={level:["assert","clear","count","countReset","debug","dir","dirxml","error","group","groupCollapsed","groupEnd","info","log","table","time","timeEnd","timeLog","trace","warn"],lengthThreshold:1e3,logger:"console"};function uv(t,e,i){var r,n=i?Object.assign({},lv,i):lv,s=n.logger;if(!s)return()=>{};r="string"==typeof s?e[s]:s;var o=0,a=!1,l=[];if(n.level.includes("error")){var u=e=>{var i=e.message,r=iv.parse(e.error).map((t=>t.toString())),s=[av(i,n.stringifyOptions)];t({level:"error",trace:r,payload:s})};e.addEventListener("error",u),l.push((()=>{e.removeEventListener("error",u)}));var h=e=>{var i,r;e.reason instanceof Error?r=[av("Uncaught (in promise) "+(i=e.reason).name+": "+i.message,n.stringifyOptions)]:(i=new Error,r=[av("Uncaught (in promise)",n.stringifyOptions),av(e.reason,n.stringifyOptions)]);var s=iv.parse(i).map((t=>t.toString()));t({level:"error",trace:s,payload:r})};e.addEventListener("unhandledrejection",h),l.push((()=>{e.removeEventListener("unhandledrejection",h)}))}for(var d of n.level)l.push(v(r,d));return()=>{l.forEach((t=>t()))};function v(e,i){var r=this;return e[i]?function(e,s,l){try{if(!(s in e))return()=>{};var u=e[s],h={next:u},d=(e=>function(){for(var s=arguments.length,l=new Array(s),u=0;s>u;u++)l[u]=arguments[u];if(e.apply(r,l),!("assert"===i&&l[0]||a)){a=!0;try{var h=iv.parse(new Error).map((t=>t.toString())).splice(1),d=("assert"===i?l.slice(1):l).map((t=>av(t,n.stringifyOptions)));o++,n.lengthThreshold>o?t({level:i,trace:h,payload:d}):o===n.lengthThreshold&&t({level:"warn",trace:[],payload:[av("The number of log records reached the threshold.")]})}catch(t){e("rrweb logger error:",t,...l)}finally{a=!1}}})((function(){for(var t=arguments.length,e=new Array(t),i=0;t>i;i++)e[i]=arguments[i];return h.next.apply(this,e)}));return"function"==typeof d&&(d.prototype=d.prototype||{},Object.defineProperties(d,{__rrweb_original__:{enumerable:!1,value:u},__rrweb_layer__:{enumerable:!1,value:h}})),e[s]=d,()=>{if(e[s]!==d)for(var t=e[s];"function"==typeof t&&t.__rrweb_layer__;){var i=t.__rrweb_layer__;if(i.next===d)return void(i.next=h.next);t=i.next}else e[s]=h.next}}catch(t){return()=>{}}}(e,i):()=>{}}}var hv=t=>({name:"rrweb/console@1",observer:uv,options:t}),dv=t=>"undefined"!=typeof Document&&t instanceof Document,vv=()=>{};function cv(t,e,i){try{if(!(e in t))return vv;var r={next:t[e]},n=i((function(){for(var t=arguments.length,e=new Array(t),i=0;t>i;i++)e[i]=arguments[i];return r.next.apply(this,e)}));return nt(n)&&(n.prototype=n.prototype||{},Object.defineProperties(n,{__posthog_wrapped__:{enumerable:!1,value:!0},__posthog_layer__:{enumerable:!1,value:r}})),t[e]=n,()=>{if(t[e]!==n)for(var i=t[e];nt(i)&&i.__posthog_layer__;){var s=i.__posthog_layer__;if(s.next===n)return void(s.next=r.next);i=s.next}else t[e]=r.next}}catch(t){return vv}}function fv(t,e){var i,r=function(t){try{return"string"==typeof t?new URL(t).hostname:"url"in t?new URL(t.url).hostname:t.hostname}catch(t){return null}}(t),n={hostname:r,isHostDenied:!1};if(null==(i=e.payloadHostDenyList)||!i.length||null==r||!r.trim().length)return n;for(var s of e.payloadHostDenyList)if(r.endsWith(s))return{hostname:r,isHostDenied:!0};return n}var pv=Bi("[Recorder]"),gv=t=>"navigation"===t.entryType,mv=t=>"resource"===t.entryType;function yv(t,e){return!!e&&(ft(e)||e[t])}function _v(t){if("undefined"==typeof Request)return!1;if(t instanceof Request)return!0;try{return"[object Request]"==={}.toString.call(t)}catch(t){return!1}}var bv=["image/","video/","audio/","font/","application/octet-stream","application/pdf","application/zip","application/wasm"];function wv(t){var e=t.type,i=t.recordBody,r=t.headers;function n(t){var e=Object.keys(r).find((t=>"content-type"===t.toLowerCase())),i=e&&r[e];return t.some((t=>null==i?void 0:i.toLowerCase().includes(t)))}if(!i)return!1;if(function t(e){try{return"string"==typeof e?e.startsWith("blob:"):e instanceof URL?"blob:"===e.protocol:!!_v(e)&&t(e.url)}catch(t){return!1}}(t.url))return!1;if(n(bv))return!1;if(ft(i))return!0;if(rt(i))return n(i);var s=i[e];return ft(s)?s:n(s)}function kv(t,e,i,r,n,s){return Sv.apply(this,arguments)}function Sv(){return Sv=f((function*(t,e,i,r,n,s){if(void 0===s&&(s=0),s>10)return pv.warn("Failed to get performance entry for request",{url:i,initiatorType:e}),null;var o=function(t,i){for(var s=t.length-1;s>=0;s-=1)if(mv(o=t[s])&&o.initiatorType===e&&(at(r)||o.startTime>=r)&&(at(n)||n>=o.startTime))return t[s];var o}(t.performance.getEntriesByName(i));return o||(yield new Promise((t=>setTimeout(t,50*s))),kv(t,e,i,r,n,s+1))})),Sv.apply(this,arguments)}function xv(t){var e=t.body,i=t.options,r=t.url;if(dt(e))return null;var n=fv(r,i);if(n.isHostDenied)return n.hostname+" is in deny list";if(lt(e))return e;if(dv(e))return e.textContent;if(pt(e))return ir(e);if(st(e))try{return JSON.stringify(e)}catch(t){return"[SessionReplay] Failed to stringify response object"}return"[SessionReplay] Cannot read body of type "+toString.call(e)}var Cv=t=>!ht(t)&&("navigation"===t.entryType||"resource"===t.entryType);function Tv(t){var e=t.entry,i=t.method,r=t.status,n=t.networkRequest,s=t.isInitial,o=t.start,a=t.end,l=t.url,u=t.initiatorType;o=e?e.startTime:o,a=e?e.responseEnd:a;var h=Math.floor(Date.now()-performance.now()),d=Math.floor(h+(o||0)),v=[p({},e?e.toJSON():{name:l},{startTime:at(o)?void 0:Math.round(o),endTime:at(a)?void 0:Math.round(a),timeOrigin:h,timestamp:d,method:i,initiatorType:u||(e?e.initiatorType:void 0),status:r,requestHeaders:n.requestHeaders,requestBody:n.requestBody,responseHeaders:n.responseHeaders,responseBody:n.responseBody,isInitial:s})];if(Cv(e))for(var c of e.serverTiming||[])v.push({timeOrigin:h,timestamp:d,startTime:Math.round(e.startTime),name:c.name,duration:c.duration,entryType:"serverTiming"});return v}var Ev=["video/","audio/"];function Mv(t){return st(t)&&nt(t.getReader)&&nt(t.tee)}var Iv=500,Rv="[SessionReplay] Timeout while trying to read body",Pv="[SessionReplay] Failed to read body";function Av(t){return Pv+": "+t}function Ov(t){return"[SessionReplay] Body too large to record (> "+t+" bytes)"}function Fv(t,e){if(!e.streamNetworkBody)return function(t){return new Promise((e=>{var i=setTimeout((()=>e(Rv)),Iv);try{t.clone().text().then((t=>e(t)),(t=>e(Av(t)))).finally((()=>clearTimeout(i)))}catch(t){clearTimeout(i),e(Pv)}}))}(t);var i=rn(e);return function(t,e){try{var i,r=null==(i=t.headers)||null==i.get?void 0:i.get("content-length");if(!r)return!1;var n=parseInt(r,10);return Number.isFinite(n)&&n>e}catch(t){return!1}}(t,i)?Promise.resolve(Ov(i)):function(t,e){return new Promise((i=>{var r,n=!1;function s(){try{var t;null==(t=r)||t.cancel()}catch(t){}}function o(t){n||(n=!0,clearTimeout(l),s(),i(t))}var a,l=setTimeout((()=>o(Rv)),Iv);try{a=t.clone()}catch(t){return void o(Pv)}var u=a.body;if(Mv(u)&&"undefined"!=typeof TextDecoder){try{r=u.getReader()}catch(t){return void o(Pv)}var h=[],d=0;!function t(){r.read().then((i=>{var r=i.done,a=i.value;if(n)s();else if(r)o((new TextDecoder).decode(function(t,e){var i=new Uint8Array(e),r=0;for(var n of t)i.set(n,r),r+=n.byteLength;return i}(h,d)));else{if(a){if(d+a.byteLength>e)return void o(Ov(e));d+=a.byteLength,h.push(a)}t()}}),(t=>o(Av(t))))}()}else try{a.text().then((t=>o(t)),(t=>o(Av(t))))}catch(t){o(Pv)}}))}(t,i)}function Lv(){return Lv=f((function*(t){var e=t.r,i=t.options,r=fv(t.url,i);return r.isHostDenied?Promise.resolve(r.hostname+" is in deny list"):Fv(e,i)})),Lv.apply(this,arguments)}function $v(){return $v=f((function*(t){var e=t.r,i=t.options,r=function(t){var e,i=t.r,r=t.options,n=t.url;if("chunked"===i.headers.get("Transfer-Encoding"))return"Chunked Transfer-Encoding is not supported";var s=null==(e=i.headers.get("Content-Type"))?void 0:e.toLowerCase(),o=Ev.some((t=>null==s?void 0:s.startsWith(t)));if(s&&o)return"Content-Type "+s+" is not supported";var a=fv(n,r);return a.isHostDenied?a.hostname+" is in deny list":null}({r:e,options:i,url:t.url});return ht(r)?Fv(e,i):Promise.resolve(r)})),$v.apply(this,arguments)}var Dv=null;function Nv(t,e,i){if(!("performance"in e))return()=>{};if(Dv)return pv.warn("Network observer already initialised, doing nothing"),()=>{};var r=i?Object.assign({},nn,i):nn,n=e=>{var i=[],n=!1;e.requests.forEach((t=>{var e="serverTiming"===t.entryType;if(!e||!n){var s=r.maskRequestFn(t);e||(n=!s||(t=>!!t&&vn.has(t))(s)),s&&i.push(s)}})),i.length>0&&t(p({},e,{requests:i}))},s=function(t,e,i){if(i.recordInitialRequests){var r=e.performance.getEntries().filter((t=>gv(t)||mv(t)&&i.initiatorTypes.includes(t.initiatorType)));t({requests:r.flatMap((t=>Tv({entry:t,method:void 0,status:void 0,networkRequest:{},isInitial:!0}))),isInitial:!0})}var n=new e.PerformanceObserver((e=>{var r=e.getEntries().filter((t=>gv(t)||mv(t)&&i.initiatorTypes.includes(t.initiatorType)&&(t=>!i.recordBody&&!i.recordHeaders||"xmlhttprequest"!==t.initiatorType&&"fetch"!==t.initiatorType)(t)));t({requests:r.flatMap((t=>Tv({entry:t,method:void 0,status:void 0,networkRequest:{}})))})})),s=PerformanceObserver.supportedEntryTypes.filter((t=>i.performanceEntryTypeToObserve.includes(t)));return n.observe({entryTypes:s}),()=>{n.disconnect()}}(n,e,r),o=()=>{},a=()=>{};return(r.recordHeaders||r.recordBody)&&(o=function(t,e,i){if(!i.initiatorTypes.includes("xmlhttprequest"))return()=>{};var r=yv("request",i.recordHeaders),n=yv("response",i.recordHeaders),s=cv(e.XMLHttpRequest.prototype,"open",(s=>function(o,a,l,u,h){void 0===l&&(l=!0);var d=this;try{var v,c,f=new Request(a),p={},g={},m=d.setRequestHeader.bind(d);d.setRequestHeader=(t,e)=>(g[t]=e,m(t,e)),r&&(p.requestHeaders=g);var y=d.send.bind(d);d.send=t=>(wv({type:"request",headers:g,url:a,recordBody:i.recordBody})&&(p.requestBody=xv({body:t,options:i,url:a})),v=e.performance.now(),y(t));var _=()=>{d.removeEventListener("readystatechange",b),d.removeEventListener("error",_),d.removeEventListener("abort",_),d.removeEventListener("timeout",_)},b=()=>{if(d.readyState===d.DONE){_(),c=e.performance.now();var r={};d.getAllResponseHeaders().trim().split(/[\r\n]+/).forEach((t=>{var e=t.split(": "),i=e.shift(),n=e.join(": ");i&&(r[i]=n)})),n&&(p.responseHeaders=r),wv({type:"response",headers:r,url:a,recordBody:i.recordBody})&&(p.responseBody=xv({body:d.response,options:i,url:a})),kv(e,"xmlhttprequest",f.url,v,c).then((e=>{var i=Tv({entry:e,method:o,status:null==d?void 0:d.status,networkRequest:p,start:v,end:c,url:a.toString(),initiatorType:"xmlhttprequest"});t({requests:i})})).catch((()=>{}))}};d.addEventListener("readystatechange",b),d.addEventListener("error",_),d.addEventListener("abort",_),d.addEventListener("timeout",_)}catch(t){pv.error("Failed to instrument XHR for network capture",t)}s.call(d,o,a.toString(),l,u,h)}));return()=>{s()}}(n,e,r),a=function(t,e,i){if(!i.initiatorTypes.includes("fetch"))return()=>{};var r=yv("request",i.recordHeaders),n=yv("response",i.recordHeaders),s=cv(e,"fetch",(s=>function(){var o=f((function*(o,a){var l,u;try{l=new Request(o,a)}catch(t){return pv.error("Failed to instrument fetch for network capture",t),s(o,a)}var h,d,v={};try{try{var c={};l.headers.forEach(((t,e)=>{c[e]=t})),r&&(v.requestHeaders=c),!Mv(null==a?void 0:a.body)&&wv({type:"request",headers:c,url:o,recordBody:i.recordBody})&&(v.requestBody=yield function(t){return Lv.apply(this,arguments)}({r:l,options:i,url:o}))}catch(t){pv.error("Failed to record fetch request for network capture",t)}h=e.performance.now(),u=_v(o)?yield s(l):yield s(o,a),d=e.performance.now();var f={};return u.headers.forEach(((t,e)=>{f[e]=t})),n&&(v.responseHeaders=f),wv({type:"response",headers:f,url:o,recordBody:i.recordBody})&&(v.responseBody=yield function(t){return $v.apply(this,arguments)}({r:u,options:i,url:o})),u}finally{kv(e,"fetch",l.url,h,d).then((e=>{var i,r=Tv({entry:e,method:l.method,status:null==(i=u)?void 0:i.status,networkRequest:v,start:h,end:d,url:l.url,initiatorType:"fetch"});t({requests:r})})).catch((()=>{}))}}));return function(t,e){return o.apply(this,arguments)}}()));return()=>{s()}}(n,e,r)),Dv=()=>{s(),o(),a(),Dv=null}}var qv=t=>({name:"rrweb/network@1",observer:Nv,options:t});v.__PosthogExtensions__=v.__PosthogExtensions__||{},v.__PosthogExtensions__.rrwebPlugins={getRecordConsolePlugin:hv,getRecordNetworkPlugin:qv},v.__PosthogExtensions__.rrweb={record:Qd,version:"v2",wasMaxDepthReached:()=>Sh,resetMaxDepthState(){Sh=!1,kh=!1},getLastSnapshotCost:()=>ou,getMutationCost:()=>p({},du),resetSnapshotCostState(){iu=0,ru=0,nu=0,Kl=0,su=Ql(),ou=null,au=null,lu=[],uu=0,hu=0,du={slowestBatchMs:0},vu={deferredCount:0,failedCount:0,abandonedCount:0,totalMs:0,slowestSliceMs:0}}},v.rrweb={record:Qd,version:"v2"},v.rrwebConsoleRecord={getRecordConsolePlugin:hv},v.getRecordNetworkPlugin=qv,v.__PosthogExtensions__=v.__PosthogExtensions__||{},v.__PosthogExtensions__.initSessionRecording=(t,e)=>new Cl(t,e);var jv,Bv,Uv,Hv,zv,Wv,Vv,Gv,Zv,Qv,Jv,Kv,Yv,Xv,tc,ec={},ic=[],rc=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,nc=Array.isArray;function sc(t,e){for(var i in e)t[i]=e[i];return t}function oc(t){t&&t.parentNode&&t.parentNode.removeChild(t)}function ac(t,e,i){var r,n,s,o={};for(s in e)"key"==s?r=e[s]:"ref"==s?n=e[s]:o[s]=e[s];if(arguments.length>2&&(o.children=arguments.length>3?jv.call(arguments,2):i),"function"==typeof t&&null!=t.defaultProps)for(s in t.defaultProps)void 0===o[s]&&(o[s]=t.defaultProps[s]);return lc(t,o,r,n,null)}function lc(t,e,i,r,n){var s={type:t,props:e,key:i,ref:r,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:null==n?++Uv:n,__i:-1,__u:0};return null==n&&null!=Bv.vnode&&Bv.vnode(s),s}function uc(t){return t.children}function hc(t,e){this.props=t,this.context=e}function dc(t,e){if(null==e)return t.__?dc(t.__,t.__i+1):null;for(var i;t.__k.length>e;e++)if(null!=(i=t.__k[e])&&null!=i.__e)return i.__e;return"function"==typeof t.type?dc(t):null}function vc(t){if(t.__P&&t.__d){var e=t.__v,i=e.__e,r=[],n=[],s=sc({},e);s.__v=e.__v+1,Bv.vnode&&Bv.vnode(s),kc(t.__P,s,e,t.__n,t.__P.namespaceURI,32&e.__u?[i]:null,r,null==i?dc(e):i,!!(32&e.__u),n),s.__v=e.__v,s.__.__k[s.__i]=s,xc(r,s,n),e.__e=e.__=null,s.__e!=i&&cc(s)}}function cc(t){if(null!=(t=t.__)&&null!=t.__c)return t.__e=t.__c.base=null,t.__k.some((function(e){if(null!=e&&null!=e.__e)return t.__e=t.__c.base=e.__e})),cc(t)}function fc(t){(!t.__d&&(t.__d=!0)&&Hv.push(t)&&!pc.__r++||zv!=Bv.debounceRendering)&&((zv=Bv.debounceRendering)||Wv)(pc)}function pc(){try{for(var t,e=1;Hv.length;)Hv.length>e&&Hv.sort(Vv),t=Hv.shift(),e=Hv.length,vc(t)}finally{Hv.length=pc.__r=0}}function gc(t,e,i,r,n,s,o,a,l,u,h){var d,v,c,f,p,g,m,y=r&&r.__k||ic,_=e.length;for(l=function(t,e,i,r,n){var s,o,a,l,u,h=i.length,d=h,v=0;for(t.__k=new Array(n),s=0;n>s;s++)null!=(o=e[s])&&"boolean"!=typeof o&&"function"!=typeof o?("string"==typeof o||"number"==typeof o||"bigint"==typeof o||o.constructor==String?o=t.__k[s]=lc(null,o,null,null,null):nc(o)?o=t.__k[s]=lc(uc,{children:o},null,null,null):void 0===o.constructor&&o.__b>0?o=t.__k[s]=lc(o.type,o.props,o.key,o.ref?o.ref:null,o.__v):t.__k[s]=o,l=s+v,o.__=t,o.__b=t.__b+1,a=null,-1!=(u=o.__i=yc(o,i,l,d))&&(d--,(a=i[u])&&(a.__u|=2)),null==a||null==a.__v?(-1==u&&(n>h?v--:h>n&&v++),"function"!=typeof o.type&&(o.__u|=4)):u!=l&&(u==l-1?v--:u==l+1?v++:(u>l?v--:v++,o.__u|=4))):t.__k[s]=null;if(d)for(s=0;h>s;s++)null!=(a=i[s])&&0==(2&a.__u)&&(a.__e==r&&(r=dc(a)),Ec(a,a));return r}(i,e,y,l,_),d=0;_>d;d++)null!=(c=i.__k[d])&&(v=-1!=c.__i&&y[c.__i]||ec,c.__i=d,g=kc(t,c,v,n,s,o,a,l,u,h),f=c.__e,c.ref&&v.ref!=c.ref&&(v.ref&&Tc(v.ref,null,c),h.push(c.ref,c.__c||f,c)),null==p&&null!=f&&(p=f),(m=!!(4&c.__u))||v.__k===c.__k?(l=mc(c,l,t,m),m&&v.__e&&(v.__e=null)):"function"==typeof c.type&&void 0!==g?l=g:f&&(l=f.nextSibling),c.__u&=-7);return i.__e=p,l}function mc(t,e,i,r){var n,s;if("function"==typeof t.type){for(n=t.__k,s=0;n&&n.length>s;s++)n[s]&&(n[s].__=t,e=mc(n[s],e,i,r));return e}t.__e!=e&&(r&&(e&&t.type&&!e.parentNode&&(e=dc(t)),i.insertBefore(t.__e,e||null)),e=t.__e);do{e=e&&e.nextSibling}while(null!=e&&8==e.nodeType);return e}function yc(t,e,i,r){var n,s,o,a=t.key,l=t.type,u=e[i],h=null!=u&&0==(2&u.__u);if(null===u&&null==a||h&&a==u.key&&l==u.type)return i;if(r>(h?1:0))for(n=i-1,s=i+1;n>=0||e.length>s;)if(null!=(u=e[o=0>n?s++:n--])&&0==(2&u.__u)&&a==u.key&&l==u.type)return o;return-1}function _c(t,e,i){"-"==e[0]?t.setProperty(e,null==i?"":i):t[e]=null==i?"":"number"!=typeof i||rc.test(e)?i:i+"px"}function bc(t,e,i,r,n){var s,o;t:if("style"==e)if("string"==typeof i)t.style.cssText=i;else{if("string"==typeof r&&(t.style.cssText=r=""),r)for(e in r)i&&e in i||_c(t.style,e,"");if(i)for(e in i)r&&i[e]==r[e]||_c(t.style,e,i[e])}else if("o"==e[0]&&"n"==e[1])s=e!=(e=e.replace(Jv,"$1")),o=e.toLowerCase(),e=o in t||"onFocusOut"==e||"onFocusIn"==e?o.slice(2):e.slice(2),t.l||(t.l={}),t.l[e+s]=i,i?r?i[Qv]=r[Qv]:(i[Qv]=Kv,t.addEventListener(e,s?Xv:Yv,s)):t.removeEventListener(e,s?Xv:Yv,s);else{if("http://www.w3.org/2000/svg"==n)e=e.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if("width"!=e&&"height"!=e&&"href"!=e&&"list"!=e&&"form"!=e&&"tabIndex"!=e&&"download"!=e&&"rowSpan"!=e&&"colSpan"!=e&&"role"!=e&&"popover"!=e&&e in t)try{t[e]=null==i?"":i;break t}catch(t){}"function"==typeof i||(null==i||!1===i&&"-"!=e[4]?t.removeAttribute(e):t.setAttribute(e,"popover"==e&&1==i?"":i))}}function wc(t){return function(e){if(this.l){var i=this.l[e.type+t];if(null==e[Zv])e[Zv]=Kv++;else if(i[Qv]>e[Zv])return;return i(Bv.event?Bv.event(e):e)}}}function kc(t,e,i,r,n,s,o,a,l,u){var h,d,v,c,f,p,g,m,y,_,$,b,w,k,S,x,C=e.type;if(void 0!==e.constructor)return null;128&i.__u&&(l=!!(32&i.__u),s=[a=e.__e=i.__e]),(h=Bv.__b)&&h(e);t:if("function"==typeof C){d=o.length;try{if(y=e.props,_=C.prototype&&C.prototype.render,$=(h=C.contextType)&&r[h.__c],b=h?$?$.props.value:h.__:r,i.__c?m=(v=e.__c=i.__c).__=v.__E:(_?e.__c=v=new C(y,b):(e.__c=v=new hc(y,b),v.constructor=C,v.render=Mc),$&&$.sub(v),v.state||(v.state={}),v.__n=r,c=v.__d=!0,v.__h=[],v._sb=[]),_&&null==v.__s&&(v.__s=v.state),_&&null!=C.getDerivedStateFromProps&&(v.__s==v.state&&(v.__s=sc({},v.__s)),sc(v.__s,C.getDerivedStateFromProps(y,v.__s))),f=v.props,p=v.state,v.__v=e,c)_&&null==C.getDerivedStateFromProps&&null!=v.componentWillMount&&v.componentWillMount(),_&&null!=v.componentDidMount&&v.__h.push(v.componentDidMount);else{if(_&&null==C.getDerivedStateFromProps&&y!==f&&null!=v.componentWillReceiveProps&&v.componentWillReceiveProps(y,b),e.__v==i.__v||!v.__e&&null!=v.shouldComponentUpdate&&!1===v.shouldComponentUpdate(y,v.__s,b)){e.__v!=i.__v&&(v.props=y,v.state=v.__s,v.__d=!1),e.__e=i.__e,e.__k=i.__k,e.__k.some((function(t){t&&(t.__=e)})),ic.push.apply(v.__h,v._sb),v._sb=[],v.__h.length&&o.push(v);break t}null!=v.componentWillUpdate&&v.componentWillUpdate(y,v.__s,b),_&&null!=v.componentDidUpdate&&v.__h.push((function(){v.componentDidUpdate(f,p,g)}))}if(v.context=b,v.props=y,v.__P=t,v.__e=!1,w=Bv.__r,k=0,_)v.state=v.__s,v.__d=!1,w&&w(e),h=v.render(v.props,v.state,v.context),ic.push.apply(v.__h,v._sb),v._sb=[];else do{v.__d=!1,w&&w(e),h=v.render(v.props,v.state,v.context),v.state=v.__s}while(v.__d&&25>++k);v.state=v.__s,null!=v.getChildContext&&(r=sc(sc({},r),v.getChildContext())),_&&!c&&null!=v.getSnapshotBeforeUpdate&&(g=v.getSnapshotBeforeUpdate(f,p)),S=null!=h&&h.type===uc&&null==h.key?Cc(h.props.children):h,a=gc(t,nc(S)?S:[S],e,i,r,n,s,o,a,l,u),v.base=e.__e,e.__u&=-161,v.__h.length&&o.push(v),m&&(v.__E=v.__=null)}catch(t){if(o.length=d,e.__v=null,l||null!=s)if(t.then){for(e.__u|=l?160:128;a&&8==a.nodeType&&a.nextSibling;)a=a.nextSibling;null!=s&&(s[s.indexOf(a)]=null),e.__e=a}else{if(null!=s)for(x=s.length;x--;)oc(s[x]);Sc(e)}else e.__e=i.__e,!e.__k&&i.__k&&(e.__k=i.__k),t.then||Sc(e);Bv.__e(t,e,i)}}else null==s&&e.__v==i.__v?(e.__k=i.__k,e.__e=i.__e):a=e.__e=function(t,e,i,r,n,s,o,a,l){var u,h,d,v,c,f,p,g=i.props||ec,m=e.props,y=e.type;if("svg"==y?n="http://www.w3.org/2000/svg":"math"==y?n="http://www.w3.org/1998/Math/MathML":n||(n="http://www.w3.org/1999/xhtml"),null!=s)for(u=0;s.length>u;u++)if((c=s[u])&&"setAttribute"in c==!!y&&(y?c.localName==y:3==c.nodeType)){t=c,s[u]=null;break}if(null==t){if(null==y)return document.createTextNode(m);t=document.createElementNS(n,y,m.is&&m),a&&(Bv.__m&&Bv.__m(e,s),a=!1),s=null}if(null==y)g===m||a&&t.data==m||(t.data=m);else{if(s="textarea"==y&&null!=m.defaultValue?null:s&&jv.call(t.childNodes),!a&&null!=s)for(g={},u=0;t.attributes.length>u;u++)g[(c=t.attributes[u]).name]=c.value;for(u in g)c=g[u],"dangerouslySetInnerHTML"==u?d=c:"children"==u||u in m||"value"==u&&"defaultValue"in m||"checked"==u&&"defaultChecked"in m||bc(t,u,null,c,n);for(u in m)c=m[u],"children"==u?v=c:"dangerouslySetInnerHTML"==u?h=c:"value"==u?f=c:"checked"==u?p=c:a&&"function"!=typeof c||g[u]===c||bc(t,u,c,g[u],n);if(h)a||d&&(h.__html==d.__html||h.__html==t.innerHTML)||(t.innerHTML=h.__html),e.__k=[];else if(d&&(t.innerHTML=""),gc("template"==e.type?t.content:t,nc(v)?v:[v],e,i,r,"foreignObject"==y?"http://www.w3.org/1999/xhtml":n,s,o,s?s[0]:i.__k&&dc(i,0),a,l),null!=s)for(u=s.length;u--;)oc(s[u]);a&&"textarea"!=y||(u="value","progress"==y&&null==f?t.removeAttribute("value"):null!=f&&(f!==t[u]||"progress"==y&&!f||"option"==y&&f!=g[u])&&bc(t,u,f,g[u],n),u="checked",null!=p&&p!=t[u]&&bc(t,u,p,g[u],n))}return t}(i.__e,e,i,r,n,s,o,l,u);return(h=Bv.diffed)&&h(e),128&e.__u?void 0:a}function Sc(t){t&&(t.__c&&(t.__c.__e=!0),t.__k&&t.__k.some(Sc))}function xc(t,e,i){for(var r=0;i.length>r;r++)Tc(i[r],i[++r],i[++r]);Bv.__c&&Bv.__c(e,t),t.some((function(e){try{t=e.__h,e.__h=[],t.some((function(t){t.call(e)}))}catch(t){Bv.__e(t,e.__v)}}))}function Cc(t){return"object"!=typeof t||null==t||t.__b>0?t:nc(t)?t.map(Cc):void 0!==t.constructor?null:sc({},t)}function Tc(t,e,i){try{if("function"==typeof t){var r="function"==typeof t.__u;r&&t.__u(),r&&null==e||(t.__u=t(e))}else t.current=e}catch(t){Bv.__e(t,i)}}function Ec(t,e,i){var r,n;if(Bv.unmount&&Bv.unmount(t),(r=t.ref)&&(r.current&&r.current!=t.__e||Tc(r,null,e)),null!=(r=t.__c)){if(r.componentWillUnmount)try{r.componentWillUnmount()}catch(t){Bv.__e(t,e)}r.base=r.__P=r.__n=null}if(r=t.__k)for(n=0;r.length>n;n++)r[n]&&Ec(r[n],e,i||"function"!=typeof t.type);i||oc(t.__e),t.__c=t.__=t.__e=void 0}function Mc(t,e,i){return this.constructor(t,i)}function Ic(t,e,i){var r,n,s;e==document&&(e=document.documentElement),Bv.__&&Bv.__(t,e),r=e.__k,n=[],s=[],kc(e,t=e.__k=ac(uc,null,[t]),r||ec,ec,e.namespaceURI,r?null:e.firstChild?jv.call(e.childNodes):null,n,r?r.__e:e.firstChild,!1,s),xc(n,t,s),t.props.children=null}jv=ic.slice,Bv={__e(t,e,i,r){for(var n,s,o;e=e.__;)if((n=e.__c)&&!n.__)try{if((s=n.constructor)&&null!=s.getDerivedStateFromError&&(n.setState(s.getDerivedStateFromError(t)),o=n.__d),null!=n.componentDidCatch&&(n.componentDidCatch(t,r||{}),o=n.__d),o)return n.__E=n}catch(e){t=e}throw t}},Uv=0,hc.prototype.setState=function(t,e){var i;i=null!=this.__s&&this.__s!=this.state?this.__s:this.__s=sc({},this.state),"function"==typeof t&&(t=t(sc({},i),this.props)),t&&sc(i,t),null!=t&&this.__v&&(e&&this._sb.push(e),fc(this))},hc.prototype.forceUpdate=function(t){this.__v&&(this.__e=!0,t&&this.__h.push(t),fc(this))},hc.prototype.render=uc,Hv=[],Wv="function"==typeof Promise?Promise.prototype.then.bind(Promise.resolve()):setTimeout,Vv=function(t,e){return t.__v.__b-e.__v.__b},pc.__r=0,Gv=Math.random().toString(8),Zv="__d"+Gv,Qv="__a"+Gv,Jv=/(PointerCapture)$|Capture$/i,Kv=0,Yv=wc(!1),Xv=wc(!0),tc=0;var Rc,Pc,Ac,Oc,Fc=0,Lc=[],$c=Bv,Dc=$c.__b,Nc=$c.__r,qc=$c.diffed,jc=$c.__c,Bc=$c.unmount,Uc=$c.__;function Hc(t,e){$c.__h&&$c.__h(Pc,t,Fc||e),Fc=0;var i=Pc.__H||(Pc.__H={__:[],__h:[]});return t>=i.__.length&&i.__.push({}),i.__[t]}function zc(t){return Fc=1,function(t,e,i){var r=Hc(Rc++,2);if(r.t=t,!r.__c&&(r.__=[ef(void 0,e),function(t){var e=r.__N?r.__N[0]:r.__[0],i=r.t(e,t);e!==i&&(r.__N=[i,r.__[1]],r.__c.setState({}))}],r.__c=Pc,!Pc.__f)){var n=function(t,e,i){if(!r.__c.__H)return!0;var n=!1,o=r.__c.props!==t;if(r.__c.__H.__.some((function(t){if(t.__N){n=!0;var e=t.__[0];t.__=t.__N,t.__N=void 0,e!==t.__[0]&&(o=!0)}})),s){var a=s.call(this,t,e,i);return n?a||o:a}return!n||o};Pc.__f=!0;var s=Pc.shouldComponentUpdate,o=Pc.componentWillUpdate;Pc.componentWillUpdate=function(t,e,i){if(this.__e){var r=s;s=void 0,n(t,e,i),s=r}o&&o.call(this,t,e,i)},Pc.shouldComponentUpdate=n}return r.__N||r.__}(ef,t)}function Wc(t,e){var i=Hc(Rc++,3);!$c.__s&&tf(i.__H,e)&&(i.__=t,i.u=e,Pc.__H.__h.push(i))}function Vc(t){return Fc=5,Gc((function(){return{current:t}}),[])}function Gc(t,e){var i=Hc(Rc++,7);return tf(i.__H,e)&&(i.__=t(),i.__H=e,i.__h=t),i.__}function Zc(t){var e=Pc.context[t.__c],i=Hc(Rc++,9);return i.c=t,e?(null==i.__&&(i.__=!0,e.sub(Pc)),e.props.value):t.__}function Qc(){for(var t;t=Lc.shift();){var e=t.__H;if(t.__P&&e)try{e.__h.some(Yc),e.__h.some(Xc),e.__h=[]}catch(i){e.__h=[],$c.__e(i,t.__v)}}}$c.__b=function(t){Pc=null,Dc&&Dc(t)},$c.__=function(t,e){t&&e.__k&&e.__k.__m&&(t.__m=e.__k.__m),Uc&&Uc(t,e)},$c.__r=function(t){Nc&&Nc(t),Rc=0;var e=(Pc=t.__c).__H;e&&(Ac===Pc?(e.__h=[],Pc.__h=[],e.__.some((function(t){t.__N&&(t.__=t.__N),t.u=t.__N=void 0}))):(e.__h.length&&Qc(),Rc=0)),Ac=Pc},$c.diffed=function(t){qc&&qc(t);var e=t.__c;e&&e.__H&&(e.__H.__h.length&&(1!==Lc.push(e)&&Oc===$c.requestAnimationFrame||((Oc=$c.requestAnimationFrame)||Kc)(Qc)),e.__H.__.some((function(t){t.u&&(t.__H=t.u,t.u=void 0)}))),Ac=Pc=null},$c.__c=function(t,e){e.some((function(t){try{t.__h.some(Yc),t.__h=t.__h.filter((function(t){return!t.__||Xc(t)}))}catch(i){e.some((function(t){t.__h&&(t.__h=[])})),e=[],$c.__e(i,t.__v)}})),jc&&jc(t,e)},$c.unmount=function(t){Bc&&Bc(t);var e,i=t.__c;i&&i.__H&&(i.__H.__.some((function(t){try{Yc(t)}catch(t){e=t}})),i.__H=void 0,e&&$c.__e(e,i.__v))};var Jc="function"==typeof requestAnimationFrame;function Kc(t){var e,i=function(){clearTimeout(r),Jc&&cancelAnimationFrame(e),setTimeout(t)},r=setTimeout(i,35);Jc&&(e=requestAnimationFrame(i))}function Yc(t){var e=Pc,i=t.__c;"function"==typeof i&&(t.__c=void 0,i()),Pc=e}function Xc(t){var e=Pc;t.__c=t.__(),Pc=e}function tf(t,e){return!t||t.length!==e.length||e.some((function(e,i){return e!==t[i]}))}function ef(t,e){return"function"==typeof e?e(t):e}function rf(t){var e=!0;return{dispose(){if(e){e=!1;var i=t();i&&nt(i.then)&&i.then(void 0,(()=>{}))}}}}var nf={GZipJS:"gzip-js",Base64:"base64"},sf={Activation:"events",Cancellation:"cancelEvents"},of={Button:"button",Tab:"tab",Selector:"selector"},af={TopLeft:"top_left",TopRight:"top_right",TopCenter:"top_center",MiddleLeft:"middle_left",MiddleRight:"middle_right",MiddleCenter:"middle_center",Left:"left",Center:"center",Right:"right",NextToTrigger:"next_to_trigger"},lf={Top:"top",Left:"left",Right:"right",Bottom:"bottom"},uf={Popover:"popover",API:"api",Widget:"widget",ExternalSurvey:"external_survey"},hf={Open:"open",MultipleChoice:"multiple_choice",SingleChoice:"single_choice",Rating:"rating",Link:"link"},df={NextQuestion:"next_question",End:"end",ResponseBased:"response_based",SpecificQuestion:"specific_question"},vf={Once:"once",Recurring:"recurring",Always:"always"},cf={SHOWN:"survey shown",DISMISSED:"survey dismissed",SENT:"survey sent",ABANDONED:"survey abandoned"},ff={SURVEY_ID:"$survey_id",SURVEY_NAME:"$survey_name",SURVEY_RESPONSE:"$survey_response",SURVEY_ITERATION:"$survey_iteration",SURVEY_ITERATION_START_DATE:"$survey_iteration_start_date",SURVEY_PARTIALLY_COMPLETED:"$survey_partially_completed",SURVEY_SUBMISSION_ID:"$survey_submission_id",SURVEY_QUESTIONS:"$survey_questions",SURVEY_COMPLETED:"$survey_completed",PRODUCT_TOUR_ID:"$product_tour_id",SURVEY_LAST_SEEN_DATE:"$survey_last_seen_date",SURVEY_LANGUAGE:"$survey_language"},pf={Popover:"popover",Inline:"inline"},gf=Bi("[Surveys]");function mf(t){return!(!t.start_date||t.end_date)}function yf(t){var e;return!(null==(e=t.conditions)||null==(e=e.actions)||null==(e=e.values)||!e.length)}var _f="seenSurvey_",bf="inProgressSurvey_",wf=(t,e)=>""+t+function(t){return t.current_iteration&&t.current_iteration>0?t.id+"_"+t.current_iteration:t.id}(e),kf=t=>wf(_f,t),Sf=t=>{try{var e=kf(t);if(localStorage.getItem(e))return;localStorage.setItem(e,"true")}catch(t){gf.error("Failed to persist survey seen state",t)}},xf=[uf.Popover,uf.Widget,uf.API],Cf={ignoreConditions:!1,ignoreDelay:!1,displayType:pf.Popover};Math.trunc||(Math.trunc=function(t){return 0>t?Math.ceil(t):Math.floor(t)}),Number.isInteger||(Number.isInteger=function(t){return vt(t)&&isFinite(t)&&Math.floor(t)===t});class Tf{constructor(t){if(this.bytes=t,16!==t.length)throw new TypeError("not 128-bit length")}static fromFieldsV7(t,e,i,r){if(!Number.isInteger(t)||!Number.isInteger(e)||!Number.isInteger(i)||!Number.isInteger(r)||0>t||0>e||0>i||0>r||t>0xffffffffffff||e>4095||i>1073741823||r>4294967295)throw new RangeError("invalid field value");var n=new Uint8Array(16);return n[0]=t/Math.pow(2,40),n[1]=t/Math.pow(2,32),n[2]=t/Math.pow(2,24),n[3]=t/Math.pow(2,16),n[4]=t/256,n[5]=t,n[6]=112|e>>>8,n[7]=e,n[8]=128|i>>>24,n[9]=i>>>16,n[10]=i>>>8,n[11]=i,n[12]=r>>>24,n[13]=r>>>16,n[14]=r>>>8,n[15]=r,new Tf(n)}toString(){for(var t="",e=0;this.bytes.length>e;e++)t=t+(this.bytes[e]>>>4).toString(16)+(15&this.bytes[e]).toString(16),3!==e&&5!==e&&7!==e&&9!==e||(t+="-");if(36!==t.length)throw new Error("Invalid UUIDv7 was generated");return t}clone(){return new Tf(this.bytes.slice(0))}equals(t){return 0===this.compareTo(t)}compareTo(t){for(var e=0;16>e;e++){var i=this.bytes[e]-t.bytes[e];if(0!==i)return Math.sign(i)}return 0}}class Ef{generate(){var t=this.generateOrAbort();if(!at(t))return t;this.Rr=0;var e=this.generateOrAbort();if(at(e))throw new Error("Could not generate UUID after timestamp reset");return e}generateOrAbort(){var t=Date.now();if(t>this.Rr)this.Rr=t,this.Ar();else{if(this.Rr>=t+1e4)return;this.Lr++,this.Lr>4398046511103&&(this.Rr++,this.Ar())}return Tf.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 Rf}}var Mf,If=t=>{if("undefined"!=typeof UUIDV7_DENY_WEAK_RNG&&UUIDV7_DENY_WEAK_RNG)throw new Error("no cryptographically strong RNG available");for(var e=0;t.length>e;e++)t[e]=65536*Math.trunc(65536*Math.random())+Math.trunc(65536*Math.random());return t};t&&!at(t.crypto)&&crypto.getRandomValues&&(If=t=>crypto.getRandomValues(t));class Rf{nextUint32(){return this.ft.length>this.Fr||(If(this.ft),this.Fr=0),this.ft[this.Fr++]}constructor(){this.ft=new Uint32Array(8),this.Fr=1/0}}var Pf=()=>Af().toString(),Af=()=>(Mf||(Mf=new Ef)).generate(),Of="",Ff=/[a-z0-9][a-z0-9-]+\.[a-z]{2,}$/i;var Lf={Nr:()=>!!r,jr(t){ji.error("cookieStore error: "+t)},Pr:Aa,Br(t){var e;try{e=JSON.parse(Lf.Pr(t))||{}}catch(t){}return e},Dr(t,e,i,n,s){if(!r)return!1;try{var o="",a="",l=function(t,e){if(e){var i=function(t,e){if(void 0===e&&(e=r),Of)return Of;if(!e)return"";if(["localhost","127.0.0.1"].includes(t))return"";for(var i=t.split("."),n=Math.min(i.length,8),s="dmn_chk_"+Pf();!Of&&n--;){var o=i.slice(n).join("."),a=s+"=1;domain=."+o+";path=/";e.cookie=a+";max-age=3",e.cookie.includes(s)&&(e.cookie=a+";max-age=0",Of=o)}return Of}(t);if(!i){var n=(t=>{var e=t.match(Ff);return e?e[0]:""})(t);n!==i&&ji.info("Warning: cookie subdomain discovery mismatch",n,i),i=n}return i?"; domain=."+i:""}return""}(r.location.hostname,n);if(i){var u=new Date;u.setTime(u.getTime()+864e5*i),o="; expires="+u.toUTCString()}s&&(a="; secure");var h=t+"="+encodeURIComponent(JSON.stringify(e))+o+"; SameSite=Lax; path=/"+l+a;return h.length>3686.4&&ji.warn("cookieStore warning: large cookie, len="+h.length),r.cookie=h,!0}catch(t){return!1}},qr(t,e){if(null!=r&&r.cookie)try{Lf.Dr(t,"",-1,e)}catch(t){return}}},$f=null,Df={Nr(){if(!ht($f))return $f;var e=!0;if(at(t))e=!1;else try{var i="__mplssupport__";Df.Dr(i,"xyz"),'"xyz"'!==Df.Pr(i)&&(e=!1),Df.qr(i)}catch(t){e=!1}return e||ji.error("localStorage unsupported; falling back to cookie store"),$f=e,e},jr(t){ji.error("localStorage error: "+t)},Pr(e){try{return null==t?void 0:t.localStorage.getItem(e)}catch(t){Df.jr(t)}return null},Br(t){try{return JSON.parse(Df.Pr(t))||{}}catch(t){}return null},Dr(e,i){try{return null==t||t.localStorage.setItem(e,JSON.stringify(i)),!0}catch(t){Df.jr(t)}return!1},qr(e){try{null==t||t.localStorage.removeItem(e)}catch(t){Df.jr(t)}}},Nf=[Xn,Wn,zn,Gn,Zn,Qn,ds,hs,ls],qf=[pn,fn,Fn,Ln,ys,ms,vs],jf=t=>t+"_cpm",Bf=["__proto__","constructor","prototype"],Uf=t=>{if(!st(t))return{};var e={};return Object.keys(t).forEach((i=>{-1===Bf.indexOf(i)&&(e[i]=t[i])})),e},Hf=function(t,e){void 0===e&&(e=[]);var i={};return[...qf,...e].forEach((e=>{var r=t[e];at(r)||ht(r)||""===r||(i[e]=r)})),i},zf=t=>{for(var e=5381,i=2166136261,r=0;t.length>r;r++){var n=t.charCodeAt(r);e=33*e^n,i=Math.imul(i^n,16777619)}return t.length.toString(36)+"."+(e>>>0).toString(36)+"."+(i>>>0).toString(36)},Wf=(t,e)=>({p:e,f:zf(JSON.stringify(t))}),Vf=(t,e)=>{if(!e)return{properties:[],isValid:!1};try{var i=Lf.Br(jf(t)),r=(null==i?void 0:i.f)===zf(e)&&rt(i.p);return{properties:r?i.p:[],isValid:r}}catch(t){return{properties:[],isValid:!1}}},Gf=(t,e)=>e+"|"+(Lf.Pr(jf(t))||""),Zf={},Qf={Nr:()=>!0,jr(t){ji.error("memoryStorage error: "+t)},Pr:t=>Zf[t]||null,Br:t=>Zf[t]||null,Dr:(t,e)=>(Zf[t]=e,!0),qr(t){delete Zf[t]}},Jf=null,Kf={Nr(){if(!ht(Jf))return Jf;if(Jf=!0,at(t))Jf=!1;else try{var e="__support__";Kf.Dr(e,"xyz"),'"xyz"'!==Kf.Pr(e)&&(Jf=!1),Kf.qr(e)}catch(t){Jf=!1}return Jf},jr(t){ji.error("sessionStorage error: ",t)},Pr(e){try{return null==t?void 0:t.sessionStorage.getItem(e)}catch(t){Kf.jr(t)}return null},Br(t){try{return JSON.parse(Kf.Pr(t))||null}catch(t){}return null},Dr(e,i){try{return null==t||t.sessionStorage.setItem(e,JSON.stringify(i)),!0}catch(t){Kf.jr(t)}return!1},qr(e){try{null==t||t.sessionStorage.removeItem(e)}catch(t){Kf.jr(t)}}},Yf=Bi("[Stylesheet Loader]"),Xf=t,tp=r,ep="#020617",ip={fontFamily:"inherit",backgroundColor:"#eeeded",submitButtonColor:"black",submitButtonTextColor:"white",ratingButtonColor:"white",ratingButtonActiveColor:"black",borderColor:"#c9c6c6",placeholder:"Start typing...",whiteLabel:!1,displayThankYouMessage:!0,thankYouMessageHeader:"Thank you for your feedback!",position:af.Right,widgetType:of.Tab,widgetLabel:"Feedback",widgetColor:"black",zIndex:String(2147483645),disabledButtonOpacity:"0.6",maxWidth:"300px",textSubtleColor:"#939393",boxPadding:"20px 24px",boxShadow:"0 4px 12px rgba(0, 0, 0, 0.15)",borderRadius:"10px",shuffleQuestions:!1,surveyPopupDelaySeconds:void 0,outlineColor:"rgba(59, 130, 246, 0.8)",inputBackground:"white",inputTextColor:ep,scrollbarThumbColor:"var(--ph-survey-border-color)",scrollbarTrackColor:"var(--ph-survey-background-color)"},rp=[af.Center,af.Left,af.Right];function np(t){if(t.startsWith("#")){var e=t.replace(/^#/,"");return/^[0-9A-Fa-f]{3}$/.test(e)&&(e=e[0]+e[0]+e[1]+e[1]+e[2]+e[2]),/^[0-9A-Fa-f]{6}$/.test(e)?"rgb("+parseInt(e.slice(0,2),16)+","+parseInt(e.slice(2,4),16)+","+parseInt(e.slice(4,6),16)+")":"rgb(255, 255, 255)"}return"rgb(255, 255, 255)"}function sp(t){var e;void 0===t&&(t=ip.backgroundColor),"#"===t[0]&&(e=np(t)),t.startsWith("rgb")&&(e=t);var i={aliceblue:"#f0f8ff",antiquewhite:"#faebd7",aqua:"#00ffff",aquamarine:"#7fffd4",azure:"#f0ffff",beige:"#f5f5dc",bisque:"#ffe4c4",black:"#000000",blanchedalmond:"#ffebcd",blue:"#0000ff",blueviolet:"#8a2be2",brown:"#a52a2a",burlywood:"#deb887",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",cornflowerblue:"#6495ed",cornsilk:"#fff8dc",crimson:"#dc143c",cyan:"#00ffff",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkgray:"#a9a9a9",darkgreen:"#006400",darkkhaki:"#bdb76b",darkmagenta:"#8b008b",darkolivegreen:"#556b2f",darkorange:"#ff8c00",darkorchid:"#9932cc",darkred:"#8b0000",darksalmon:"#e9967a",darkseagreen:"#8fbc8f",darkslateblue:"#483d8b",darkslategray:"#2f4f4f",darkturquoise:"#00ced1",darkviolet:"#9400d3",deeppink:"#ff1493",deepskyblue:"#00bfff",dimgray:"#696969",dodgerblue:"#1e90ff",firebrick:"#b22222",floralwhite:"#fffaf0",forestgreen:"#228b22",fuchsia:"#ff00ff",gainsboro:"#dcdcdc",ghostwhite:"#f8f8ff",gold:"#ffd700",goldenrod:"#daa520",gray:"#808080",green:"#008000",greenyellow:"#adff2f",honeydew:"#f0fff0",hotpink:"#ff69b4","indianred ":"#cd5c5c",indigo:"#4b0082",ivory:"#fffff0",khaki:"#f0e68c",lavender:"#e6e6fa",lavenderblush:"#fff0f5",lawngreen:"#7cfc00",lemonchiffon:"#fffacd",lightblue:"#add8e6",lightcoral:"#f08080",lightcyan:"#e0ffff",lightgoldenrodyellow:"#fafad2",lightgrey:"#d3d3d3",lightgreen:"#90ee90",lightpink:"#ffb6c1",lightsalmon:"#ffa07a",lightseagreen:"#20b2aa",lightskyblue:"#87cefa",lightslategray:"#778899",lightsteelblue:"#b0c4de",lightyellow:"#ffffe0",lime:"#00ff00",limegreen:"#32cd32",linen:"#faf0e6",magenta:"#ff00ff",maroon:"#800000",mediumaquamarine:"#66cdaa",mediumblue:"#0000cd",mediumorchid:"#ba55d3",mediumpurple:"#9370d8",mediumseagreen:"#3cb371",mediumslateblue:"#7b68ee",mediumspringgreen:"#00fa9a",mediumturquoise:"#48d1cc",mediumvioletred:"#c71585",midnightblue:"#191970",mintcream:"#f5fffa",mistyrose:"#ffe4e1",moccasin:"#ffe4b5",navajowhite:"#ffdead",navy:"#000080",oldlace:"#fdf5e6",olive:"#808000",olivedrab:"#6b8e23",orange:"#ffa500",orangered:"#ff4500",orchid:"#da70d6",palegoldenrod:"#eee8aa",palegreen:"#98fb98",paleturquoise:"#afeeee",palevioletred:"#d87093",papayawhip:"#ffefd5",peachpuff:"#ffdab9",peru:"#cd853f",pink:"#ffc0cb",plum:"#dda0dd",powderblue:"#b0e0e6",purple:"#800080",red:"#ff0000",rosybrown:"#bc8f8f",royalblue:"#4169e1",saddlebrown:"#8b4513",salmon:"#fa8072",sandybrown:"#f4a460",seagreen:"#2e8b57",seashell:"#fff5ee",sienna:"#a0522d",silver:"#c0c0c0",skyblue:"#87ceeb",slateblue:"#6a5acd",slategray:"#708090",snow:"#fffafa",springgreen:"#00ff7f",steelblue:"#4682b4",tan:"#d2b48c",teal:"#008080",thistle:"#d8bfd8",tomato:"#ff6347",turquoise:"#40e0d0",violet:"#ee82ee",wheat:"#f5deb3",white:"#ffffff",whitesmoke:"#f5f5f5",yellow:"#ffff00",yellowgreen:"#9acd32"}[t.toLowerCase()];if(i&&(e=np(i)),!e)return ep;var r=e.match(/^rgba?\((\d+),\s*(\d+),\s*(\d+)(?:,\s*(\d+(?:\.\d+)?))?\)$/);if(r){var n=parseInt(r[1]),s=parseInt(r[2]),o=parseInt(r[3]);return Math.sqrt(n*n*.299+s*s*.587+o*o*.114)>127.5?ep:"white"}return ep}var op=(t,e,i)=>{var r=xp(t),n=tp.querySelector("."+r);if(n&&n.shadowRoot)return{shadow:n.shadowRoot,isNewlyCreated:!1};var s=tp.createElement("div");((t,e,i)=>{var r=p({},ip,i),n=t.style,s=!rp.includes(r.position)||e===uf.Widget&&(null==i?void 0:i.widgetType)===of.Tab;n.setProperty("--ph-survey-font-family",function(t){if("inherit"===t)return"inherit";var e='BlinkMacSystemFont, "Inter", "Segoe UI", "Roboto", Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol"';return t?t+", "+e:"-apple-system, "+e}(r.fontFamily)),n.setProperty("--ph-survey-box-padding",r.boxPadding),n.setProperty("--ph-survey-max-width",r.maxWidth),n.setProperty("--ph-survey-z-index",r.zIndex),n.setProperty("--ph-survey-border-color",r.borderColor),s?(n.setProperty("--ph-survey-border-radius",r.borderRadius),n.setProperty("--ph-survey-border-bottom","1.5px solid var(--ph-survey-border-color)")):(n.setProperty("--ph-survey-border-bottom","none"),n.setProperty("--ph-survey-border-radius",r.borderRadius+" "+r.borderRadius+" 0 0")),n.setProperty("--ph-survey-background-color",r.backgroundColor),n.setProperty("--ph-survey-box-shadow",r.boxShadow),n.setProperty("--ph-survey-disabled-button-opacity",r.disabledButtonOpacity),n.setProperty("--ph-survey-submit-button-color",r.submitButtonColor),n.setProperty("--ph-survey-submit-button-text-color",(null==i?void 0:i.submitButtonTextColor)||sp(r.submitButtonColor)),n.setProperty("--ph-survey-rating-bg-color",r.ratingButtonColor),n.setProperty("--ph-survey-rating-active-bg-color",r.ratingButtonActiveColor),n.setProperty("--ph-survey-rating-active-text-color",sp(r.ratingButtonActiveColor)),n.setProperty("--ph-survey-text-primary-color",(null==i?void 0:i.textColor)||sp(r.backgroundColor)),n.setProperty("--ph-survey-text-subtle-color",r.textSubtleColor),n.setProperty("--ph-widget-color",r.widgetColor),n.setProperty("--ph-widget-text-color",sp(r.widgetColor)),n.setProperty("--ph-widget-z-index",r.zIndex);var o=(null==i?void 0:i.inputBackground)||(null==i?void 0:i.inputBackgroundColor),a=o||r.inputBackground;o||"white"!==r.backgroundColor||(a="#f8f8f8"),n.setProperty("--ph-survey-input-background",a);var l=(null==i?void 0:i.inputTextColor)||sp(a);n.setProperty("--ph-survey-input-text-color",l),n.setProperty("--ph-survey-rating-text-color",l),n.setProperty("--ph-survey-scrollbar-thumb-color",r.scrollbarThumbColor),n.setProperty("--ph-survey-scrollbar-track-color",r.scrollbarTrackColor),n.setProperty("--ph-survey-outline-color",r.outlineColor)})(s,t.type,t.appearance),s.className=r;var o=s.attachShadow({mode:"open"}),a=function(t){var e=((t,e,i)=>{var r=t.createElement("style");r.innerText=e;var n=(t=>{var e;return nt(t)?t:null==t||null==(e=t.config)?void 0:e.prepare_external_dependency_stylesheet})(i);return n&&(r=n(r)),r||(Yf.error("prepare_external_dependency_stylesheet returned null"),null)})(tp,':host{--ph-survey-font-family:-apple-system,BlinkMacSystemFont,"Inter","Segoe UI","Roboto",Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol";--ph-survey-box-padding:20px 24px;--ph-survey-max-width:300px;--ph-survey-z-index:2147483645;--ph-survey-border-color:#dcdcdc;--ph-survey-border-bottom:1.5px solid var(--ph-survey-border-color);--ph-survey-border-radius:10px;--ph-survey-background-color:#eeeded;--ph-survey-box-shadow:0 4px 12px rgba(0,0,0,.15);--ph-survey-submit-button-color:#000;--ph-survey-submit-button-text-color:#fff;--ph-survey-rating-bg-color:#fff;--ph-survey-rating-text-color:#020617;--ph-survey-rating-active-bg-color:#000;--ph-survey-rating-active-text-color:#fff;--ph-survey-text-primary-color:#020617;--ph-survey-text-subtle-color:#939393;--ph-widget-color:#e0a045;--ph-widget-text-color:#fff;--ph-survey-scrollbar-thumb-color:var(--ph-survey-border-color);--ph-survey-scrollbar-track-color:var(--ph-survey-background-color);--ph-survey-outline-color:rgba(59,130,246,.8);--ph-survey-input-background:#fff;--ph-survey-input-text-color:#020617;--ph-survey-disabled-button-opacity:0.6}.ph-survey{bottom:0;height:fit-content;margin:0;max-width:85%;min-width:300px;position:fixed;width:var(--ph-survey-max-width);z-index:var(--ph-survey-z-index)}.ph-survey h3,.ph-survey p{margin:0}.ph-survey *{box-sizing:border-box;color:var(--ph-survey-text-primary-color);font-family:var(--ph-survey-font-family)}.ph-survey .multiple-choice-options label,.ph-survey input[type=text],.ph-survey textarea{background:var(--ph-survey-input-background);border:1.5px solid var(--ph-survey-border-color);border-radius:4px;color:var(--ph-survey-input-text-color);padding:10px;transition:border-color .2s ease-out,box-shadow .2s ease-out,transform .15s ease-out}.ph-survey input[type=text],.ph-survey textarea{transition:border-color .2s ease-out,box-shadow .2s ease-out,transform .15s ease-out}.ph-survey input{margin:0}.ph-survey .form-submit:focus,.ph-survey .form-submit:focus-visible,.ph-survey input[type=checkbox]:focus,.ph-survey input[type=checkbox]:focus-visible,.ph-survey input[type=radio]:focus,.ph-survey input[type=radio]:focus-visible,.ph-survey input[type=text]:focus,.ph-survey input[type=text]:focus-visible,.ph-survey textarea:focus,.ph-survey textarea:focus-visible{border-color:var(--ph-survey-rating-active-bg-color);outline:1.5px solid var(--ph-survey-outline-color);outline-offset:2px}.ph-survey button:focus:not(:focus-visible),.ph-survey input[type=checkbox]:focus:not(:focus-visible),.ph-survey input[type=radio]:focus:not(:focus-visible),.ph-survey input[type=text]:focus:not(:focus-visible),.ph-survey textarea:focus:not(:focus-visible){outline:none}.ph-survey input[type=text]:hover:not(:focus),.ph-survey textarea:hover:not(:focus){border-color:var(--ph-survey-rating-active-bg-color)}@media (max-width:768px){.ph-survey input[type=text],.ph-survey textarea{font-size:1rem}}.ph-survey .form-cancel,.ph-survey .multiple-choice-options label,.ph-survey .rating-options-number,.ph-survey input[type=checkbox],.ph-survey input[type=radio]{border:1.5px solid var(--ph-survey-border-color)}.ph-survey .footer-branding,.ph-survey .form-cancel,.ph-survey .form-submit,.ph-survey .ratings-emoji,.ph-survey .ratings-number,.ph-survey input[type=checkbox],.ph-survey input[type=radio],.ph-survey label{transition:all .2s ease-out}@media (prefers-reduced-motion:no-preference){.ph-survey button:active,.ph-survey input[type=checkbox]:active,.ph-survey input[type=radio]:active,.ph-survey label:active{transition-duration:.1s}}.ph-survey-widget-tab{background:var(--ph-widget-color);border:none;border-radius:3px 3px 0 0;color:var(--ph-widget-text-color);cursor:pointer;padding:10px 12px;position:fixed;text-align:center;transition:padding .2s ease-out;z-index:var(--ph-survey-z-index)}.ph-survey-widget-tab:hover:not(.widget-tab-top){padding-bottom:16px}.ph-survey-widget-tab.widget-tab-top{border-radius:0 0 3px 3px}.ph-survey-widget-tab.widget-tab-top:hover{padding-top:16px}@keyframes ph-survey-fade-in{0%{opacity:0}to{opacity:1}}.survey-box{gap:16px}.bottom-section,.survey-box{display:flex;flex-direction:column}.bottom-section{gap:8px}.intro-screen-header~.bottom-section,.thank-you-message-header~.bottom-section{padding-top:16px}.intro-screen,.question-container,.thank-you-message{display:flex;flex-direction:column;gap:8px}.survey-question{font-size:14px;font-weight:500}.survey-question-description{font-size:13px;opacity:.8;padding-top:4px}.intro-screen-body,.survey-question-description,.thank-you-message-body{word-wrap:break-word;overflow-wrap:break-word}:is(.survey-question-description,.thank-you-message-body,.intro-screen-body) embed,:is(.survey-question-description,.thank-you-message-body,.intro-screen-body) iframe,:is(.survey-question-description,.thank-you-message-body,.intro-screen-body) img,:is(.survey-question-description,.thank-you-message-body,.intro-screen-body) object,:is(.survey-question-description,.thank-you-message-body,.intro-screen-body) video{height:auto;max-width:100%}:is(.survey-question-description,.thank-you-message-body,.intro-screen-body) svg{height:auto;max-width:100%}.question-textarea-wrapper{display:flex;flex-direction:column}.survey-form{animation:ph-survey-fade-in .3s ease-out forwards}.intro-screen,.survey-form,.thank-you-message{background:var(--ph-survey-background-color);border:1.5px solid var(--ph-survey-border-color);border-bottom:var(--ph-survey-border-bottom);border-radius:var(--ph-survey-border-radius);box-shadow:var(--ph-survey-box-shadow);margin:0;padding:var(--ph-survey-box-padding);position:relative;text-align:left;width:100%;z-index:var(--ph-survey-z-index)}.survey-form input[type=text],.survey-form textarea{min-width:100%}:is(.survey-form textarea):focus,:is(.survey-form textarea):focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.08)}:is(.survey-form textarea):focus:not(:focus-visible){box-shadow:none}:is(.survey-box .question-header--empty)~.multiple-choice-options,:is(.survey-box .question-header--empty)~textarea{margin-top:0}.multiple-choice-options{border:none;display:flex;flex-direction:column;font-size:14px;gap:8px;margin:0;padding:1px 0}.multiple-choice-options .response-choice,.multiple-choice-options label{align-items:center;color:inherit;display:flex;gap:8px}.multiple-choice-options label{cursor:pointer;font-size:13px}:is(.multiple-choice-options label):hover:not(:has(input:checked)){border-color:var(--ph-survey-text-subtle-color);box-shadow:0 2px 8px rgba(0,0,0,.08)}:is(.multiple-choice-options label):has(input:checked){border-color:var(--ph-survey-rating-active-bg-color);box-shadow:0 1px 4px rgba(0,0,0,.05)}.choice-option-open:is(.multiple-choice-options label){flex-wrap:wrap}:is(.multiple-choice-options label) span{color:inherit}.multiple-choice-options input[type=checkbox],.multiple-choice-options input[type=radio]{appearance:none;-webkit-appearance:none;-moz-appearance:none;background:var(--ph-survey-input-background);border-radius:3px;cursor:pointer;flex-shrink:0;height:1rem;position:relative;transition:all .2s cubic-bezier(.4,0,.2,1),transform .15s ease-out;width:1rem;z-index:1}:is(.multiple-choice-options input[type=checkbox],.multiple-choice-options input[type=radio]):focus{transform:scale(1.05)}:is(.multiple-choice-options input[type=checkbox],.multiple-choice-options input[type=radio]):hover{border-color:var(--ph-survey-rating-active-bg-color);transform:scale(1.05)}:is(.multiple-choice-options input[type=checkbox],.multiple-choice-options input[type=radio]):active{transform:scale(.95)}:is(.multiple-choice-options input[type=checkbox],.multiple-choice-options input[type=radio]):checked{background:var(--ph-survey-rating-active-bg-color);border-color:var(--ph-survey-rating-active-bg-color);transform:scale(1)}:is(.multiple-choice-options input[type=checkbox],.multiple-choice-options input[type=radio]):checked:hover{transform:scale(1.05)}.multiple-choice-options input[type=checkbox]:checked:after{animation:ph-survey-checkmark-reveal .2s ease-out .1s forwards;border:solid var(--ph-survey-rating-active-text-color);border-width:0 2px 2px 0;height:8px;left:4px;transform:rotate(45deg) scale(0);width:4px}.multiple-choice-options input[type=radio]:checked:after{animation:ph-survey-radio-reveal .15s ease-out .05s forwards;background:var(--ph-survey-rating-active-text-color);border-radius:50%;height:6px;left:5px;top:5px;transform:scale(0);width:6px}.multiple-choice-options input[type=checkbox]:checked:after,.multiple-choice-options input[type=radio]:checked:after{box-sizing:content-box;content:"";position:absolute}.multiple-choice-options input[type=radio]{border-radius:50%}.multiple-choice-options input[type=radio]:checked{border:none}:is(.multiple-choice-options input[type=checkbox]:checked,.multiple-choice-options input[type=radio]:checked)~*{font-weight:700}:is(:is(.multiple-choice-options .choice-option-open) input[type=text])::placeholder{color:var(--ph-survey-text-subtle-color);font-weight:400}.rating-options-emoji{display:flex;justify-content:space-between}.rating-options-emoji-2{justify-content:space-around}.ratings-emoji{background-color:transparent;border:none;font-size:16px;opacity:.5;padding:0}.ratings-emoji:hover{cursor:pointer;opacity:1;transform:scale(1.15)}.ratings-emoji.rating-active{opacity:1}.ratings-emoji svg{fill:var(--ph-survey-text-primary-color);transition:fill .2s ease-out}.rating-options-number{border-radius:6px;display:grid;grid-auto-columns:1fr;grid-auto-flow:column;overflow:hidden}.rating-options-number .ratings-number{border:none;border-right:1px solid var(--ph-survey-border-color);color:var(--ph-survey-rating-text-color);cursor:pointer;font-weight:700;text-align:center}:is(.rating-options-number .ratings-number):last-of-type{border-right:0}.rating-active:is(.rating-options-number .ratings-number){background:var(--ph-survey-rating-active-bg-color);color:var(--ph-survey-rating-active-text-color)}.ratings-number{background-color:var(--ph-survey-rating-bg-color);border:none;padding:8px 0}.ratings-number .rating-active{background-color:var(--ph-survey-rating-active-bg-color)}.ratings-number{cursor:pointer}@media (hover:hover) and (pointer:fine){.ratings-number:hover:not(.rating-active){background-color:color-mix(in srgb,var(--ph-survey-rating-active-bg-color) 14%,var(--ph-survey-rating-bg-color))}}.rating-text{font-size:11px;justify-content:space-between;opacity:.7}.form-buttons,.rating-text{display:flex;flex-direction:row}.form-buttons{gap:8px;width:100%}.form-buttons-with-back>.form-submit{flex:1 1 auto;min-width:0}.form-submit{background:var(--ph-survey-submit-button-color);border:none;border-radius:6px;box-shadow:0 2px 0 rgba(0,0,0,.045);color:var(--ph-survey-submit-button-text-color);cursor:pointer;font-weight:700;min-width:100%;padding:12px;text-align:center;user-select:none}.form-submit:not([disabled]):hover{box-shadow:0 4px 8px rgba(0,0,0,.1);transform:scale(1.02)}.form-submit:not([disabled]):active{box-shadow:0 1px 2px rgba(0,0,0,.05);transform:scale(.98)}.form-submit[disabled]{cursor:not-allowed;opacity:var(--ph-survey-disabled-button-opacity)}.form-back{background:transparent;border:1.5px solid var(--ph-survey-border-color);border-radius:6px;color:var(--ph-survey-text-primary-color);cursor:pointer;flex:0 0 auto;font-weight:600;padding:12px 16px;text-align:center;user-select:none}.form-back:hover{transform:scale(1.02)}.form-back:active{transform:scale(.98)}.validation-hint{font-size:12px;margin-top:4px;opacity:.7}.form-cancel{background:#fff;border-radius:100%;cursor:pointer;line-height:0;padding:12px;position:absolute;right:0;top:0;transform:translate(50%,-50%)}.form-cancel:hover{opacity:.7;transform:translate(50%,-50%) scale(1.1)}.footer-branding{align-items:center;display:flex;font-size:11px;font-weight:500;gap:4px;justify-content:center;opacity:.6;text-decoration:none}.footer-branding:hover{opacity:1}.footer-branding a{text-decoration:none}.thank-you-message{text-align:center}.thank-you-message-header{margin:10px 0 0}.thank-you-message-body{font-size:14px;opacity:.8}.intro-screen{animation:ph-survey-fade-in .3s ease-out forwards;text-align:center}.intro-screen-header{margin:10px 0 0}.intro-screen-body{font-size:14px;opacity:.8}.limit-height{max-height:256px;overflow-x:hidden;overflow-y:auto;scrollbar-color:var(--ph-survey-scrollbar-thumb-color) var(--ph-survey-scrollbar-track-color);scrollbar-width:thin}.limit-height::-webkit-scrollbar{width:8px}.limit-height::-webkit-scrollbar-track{background:var(--ph-survey-scrollbar-track-color);border-radius:4px}.limit-height::-webkit-scrollbar-thumb{background-color:var(--ph-survey-scrollbar-thumb-color);border:2px solid var(--ph-survey-scrollbar-track-color);border-radius:4px}:is(.limit-height::-webkit-scrollbar-thumb):hover{background-color:var(--ph-survey-text-subtle-color)}.sr-only{clip:rect(0,0,0,0);border:0;height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;white-space:nowrap;width:1px}@media (prefers-reduced-motion:reduce){.ph-survey *{animation-duration:.01ms!important;animation-iteration-count:1!important;scroll-behavior:auto!important;transition-duration:.01ms!important}}@keyframes ph-survey-checkmark-reveal{0%{opacity:0;transform:rotate(45deg) scale(0)}50%{opacity:1;transform:rotate(45deg) scale(1.2)}to{opacity:1;transform:rotate(45deg) scale(1)}}@keyframes ph-survey-radio-reveal{0%{opacity:0;transform:scale(0)}50%{opacity:1;transform:scale(1.3)}to{opacity:1;transform:scale(1)}}',t);return null==e||e.setAttribute("data-ph-survey-style","true"),e}(e);if(a){var l=o.querySelector("style");l&&o.removeChild(l),o.appendChild(a)}return tp.body.appendChild(s),{shadow:o,isNewlyCreated:!0}},ap=t=>{var e=t.responses,i=t.survey,r=t.surveySubmissionId,n=t.posthog,s=t.isSurveyCompleted,o=t.properties,a=t.surveyLanguage;n?(Sf(i),n.capture(cf.SENT,p({[ff.SURVEY_NAME]:i.name,[ff.SURVEY_ID]:i.id,[ff.SURVEY_ITERATION]:i.current_iteration,[ff.SURVEY_ITERATION_START_DATE]:i.current_iteration_start_date,[ff.SURVEY_SUBMISSION_ID]:r,[ff.SURVEY_COMPLETED]:s},a&&{[ff.SURVEY_LANGUAGE]:a},{sessionRecordingUrl:null==n.get_session_replay_url?void 0:n.get_session_replay_url()},da(e,i),o,{$set:{[va(i,"responded")]:!0}})),s&&(Xf.dispatchEvent(new CustomEvent("PHSurveySent",{detail:{surveyId:i.id}})),Sp(i),n.reloadFeatureFlags())):gf.error("[survey sent] event not captured, PostHog instance not found.")},lp=(t,e,i)=>{return p({[ff.SURVEY_NAME]:t.name,[ff.SURVEY_ID]:t.id,[ff.SURVEY_ITERATION]:t.current_iteration,[ff.SURVEY_ITERATION_START_DATE]:t.current_iteration_start_date,[ff.SURVEY_PARTIALLY_COMPLETED]:(r=null==e?void 0:e.responses,void 0===r&&(r={}),Object.values(r).some((t=>!dt(t))))},(null==e?void 0:e.surveyLanguage)&&{[ff.SURVEY_LANGUAGE]:e.surveyLanguage},{sessionRecordingUrl:null==i.get_session_replay_url?void 0:i.get_session_replay_url(),[ff.SURVEY_SUBMISSION_ID]:null==e?void 0:e.surveySubmissionId},da(null==e?void 0:e.responses,t));var r},up=(t,e,i,r)=>{if(e){if(!i){var n=wp(t);e.capture(cf.DISMISSED,p({},lp(t,n,e),r&&{[ff.SURVEY_LANGUAGE]:r},{$set:{[va(t,"dismissed")]:!0}})),Sp(t),Sf(t),Xf.dispatchEvent(new CustomEvent("PHSurveyClosed",{detail:{surveyId:t.id}}))}}else gf.error("[survey dismissed] event not captured, PostHog instance not found.")},hp=(t,e)=>{if(e){var i=(t=>wf("abandonedSurvey_",t))(t);try{if("true"===localStorage.getItem(i))return}catch(t){return}var r=wp(t);if(r){try{localStorage.setItem(i,"true")}catch(t){}e.capture(cf.ABANDONED,lp(t,r,e),{transport:"sendBeacon"})}}else gf.error("[survey abandoned] event not captured, PostHog instance not found.")},dp=t=>t.map((t=>({sort:Math.floor(10*Math.random()),value:t}))).sort(((t,e)=>t.sort-e.sort)).map((t=>t.value)),vp=(t,e)=>t.length===e.length&&t.every(((t,i)=>t===e[i]))?e.reverse():e,cp=t=>t.appearance&&t.appearance.shuffleQuestions&&!t.enable_partial_responses?vp(t.questions,dp(t.questions)):t.questions,fp=t=>_a(t)||kp(t),pp=function(t){function e(t){var i,r;return this.getChildContext||(i=new Set,(r={})[e.__c]=this,this.getChildContext=function(){return r},this.componentWillUnmount=function(){i=null},this.shouldComponentUpdate=function(t){this.props.value!=t.value&&i.forEach((function(t){t.__e=!0,fc(t)}))},this.sub=function(t){i.add(t);var e=t.componentWillUnmount;t.componentWillUnmount=function(){i&&i.delete(t),e&&e.call(t)}}),t.children}return e.__c="__cC"+tc++,e.__=t,e.Provider=e.__l=(e.Consumer=function(t,e){return t.children(e)}).contextType=e,e}({isPreviewMode:!1,previewPageIndex:0,onPopupSurveyDismissed(){},isPopup:!0,onPreviewSubmit(){},onPreviewBack(){},surveySubmissionId:"",properties:void 0,surveyLanguage:null}),gp=()=>Zc(pp),mp=t=>{var e=t.children,i=t.style;return function(t,e,i){var r,n,s,o,a=sc({},t.props);for(s in t.type&&t.type.defaultProps&&(o=t.type.defaultProps),e)"key"==s?r=e[s]:"ref"==s?n=e[s]:a[s]=void 0===e[s]&&null!=o?o[s]:e[s];return arguments.length>2&&(a.children=arguments.length>3?jv.call(arguments,2):i),lc(t.type,a,r||t.key,n||t.ref,null)}(t.component,t.renderAsHtml?{dangerouslySetInnerHTML:{__html:e},style:i}:{children:e,style:i})};function yp(t,e){var i,r;if(null==(i=t.conditions)||!i.url)return!0;var n=ur(e);if(!n)return!1;var s=[t.conditions.url],o=function(t){return null!=t?t:"icontains"}(null==(r=t.conditions)?void 0:r.urlMatchType);return ka[o](s,[n])}var _p=t=>wf(bf,t),bp=(t,e)=>{try{localStorage.setItem(_p(t),JSON.stringify(e))}catch(t){gf.error("Error setting in-progress survey state in localStorage",t)}},wp=t=>{try{var e=localStorage.getItem(_p(t));if(e)return JSON.parse(e)}catch(t){gf.error("Error getting in-progress survey state from localStorage",t)}return null},kp=t=>{var e=wp(t);return!dt(null==e?void 0:e.surveySubmissionId)},Sp=t=>{try{localStorage.removeItem(_p(t))}catch(t){gf.error("Error clearing in-progress survey state from localStorage",t)}};function xp(t,e){void 0===e&&(e=!1);var i="PostHogSurvey-"+t.id;return e?"."+i:i}function Cp(t,e,i){if(void 0===e&&(e=af.Right),t===uf.ExternalSurvey)return{};switch(e){case af.TopLeft:return{top:"0",left:"0",transform:"translate(30px, 30px)"};case af.TopRight:return{top:"0",right:"0",transform:"translate(-30px, 30px)"};case af.TopCenter:return{top:"0",left:"50%",transform:"translate(-50%, 30px)"};case af.MiddleLeft:return{top:"50%",left:"0",transform:"translate(30px, -50%)"};case af.MiddleRight:return{top:"50%",right:"0",transform:"translate(-30px, -50%)"};case af.MiddleCenter:return{top:"50%",left:"50%",transform:"translate(-50%, -50%)"};case af.Left:return{left:"30px"};case af.Center:return{left:"50%",transform:"translateX(-50%)"};default:return{right:t===uf.Widget&&i===of.Tab?"60px":"30px"}}}var Tp=0;function Ep(t,e,i,r,n,s){e||(e={});var o,a,l=e;if("ref"in l)for(a in l={},e)"ref"==a?o=e[a]:l[a]=e[a];var u={type:t,props:l,key:i,ref:o,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:--Tp,__i:-1,__u:0,__source:n,__self:s};if("function"==typeof t&&(o=t.defaultProps))for(a in o)void 0===l[a]&&(l[a]=o[a]);return Bv.vnode&&Bv.vnode(u),u}var Mp=Ep("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 -960 960 960",width:"48",children:Ep("path",{d:"M626-533q22.5 0 38.25-15.75T680-587q0-22.5-15.75-38.25T626-641q-22.5 0-38.25 15.75T572-587q0 22.5 15.75 38.25T626-533Zm-292 0q22.5 0 38.25-15.75T388-587q0-22.5-15.75-38.25T334-641q-22.5 0-38.25 15.75T280-587q0 22.5 15.75 38.25T334-533Zm146 272q66 0 121.5-35.5T682-393h-52q-23 40-63 61.5T480.5-310q-46.5 0-87-21T331-393h-53q26 61 81 96.5T480-261Zm0 181q-83 0-156-31.5T197-197q-54-54-85.5-127T80-480q0-83 31.5-156T197-763q54-54 127-85.5T480-880q83 0 156 31.5T763-763q54 54 85.5 127T880-480q0 83-31.5 156T763-197q-54 54-127 85.5T480-80Zm0-400Zm0 340q142.375 0 241.188-98.812Q820-337.625 820-480t-98.812-241.188Q622.375-820 480-820t-241.188 98.812Q140-622.375 140-480t98.812 241.188Q337.625-140 480-140Z"})}),Ip=Ep("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 -960 960 960",width:"48",children:Ep("path",{d:"M626-533q22.5 0 38.25-15.75T680-587q0-22.5-15.75-38.25T626-641q-22.5 0-38.25 15.75T572-587q0 22.5 15.75 38.25T626-533Zm-292 0q22.5 0 38.25-15.75T388-587q0-22.5-15.75-38.25T334-641q-22.5 0-38.25 15.75T280-587q0 22.5 15.75 38.25T334-533Zm20 194h253v-49H354v49ZM480-80q-83 0-156-31.5T197-197q-54-54-85.5-127T80-480q0-83 31.5-156T197-763q54-54 127-85.5T480-880q83 0 156 31.5T763-763q54 54 85.5 127T880-480q0 83-31.5 156T763-197q-54 54-127 85.5T480-80Zm0-400Zm0 340q142.375 0 241.188-98.812Q820-337.625 820-480t-98.812-241.188Q622.375-820 480-820t-241.188 98.812Q140-622.375 140-480t98.812 241.188Q337.625-140 480-140Z"})}),Rp=Ep("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 -960 960 960",width:"48",children:Ep("path",{d:"M626-533q22.5 0 38.25-15.75T680-587q0-22.5-15.75-38.25T626-641q-22.5 0-38.25 15.75T572-587q0 22.5 15.75 38.25T626-533Zm-292 0q22.5 0 38.25-15.75T388-587q0-22.5-15.75-38.25T334-641q-22.5 0-38.25 15.75T280-587q0 22.5 15.75 38.25T334-533Zm146.174 116Q413-417 358.5-379.5T278-280h53q22-42 62.173-65t87.5-23Q528-368 567.5-344.5T630-280h52q-25-63-79.826-100-54.826-37-122-37ZM480-80q-83 0-156-31.5T197-197q-54-54-85.5-127T80-480q0-83 31.5-156T197-763q54-54 127-85.5T480-880q83 0 156 31.5T763-763q54 54 85.5 127T880-480q0 83-31.5 156T763-197q-54 54-127 85.5T480-80Zm0-400Zm0 340q142.375 0 241.188-98.812Q820-337.625 820-480t-98.812-241.188Q622.375-820 480-820t-241.188 98.812Q140-622.375 140-480t98.812 241.188Q337.625-140 480-140Z"})}),Pp=Ep("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 -960 960 960",width:"48",children:Ep("path",{d:"M480-417q-67 0-121.5 37.5T278-280h404q-25-63-80-100t-122-37Zm-183-72 50-45 45 45 31-36-45-45 45-45-31-36-45 45-50-45-31 36 45 45-45 45 31 36Zm272 0 44-45 51 45 31-36-45-45 45-45-31-36-51 45-44-45-31 36 44 45-44 45 31 36ZM480-80q-83 0-156-31.5T197-197q-54-54-85.5-127T80-480q0-83 31.5-156T197-763q54-54 127-85.5T480-880q83 0 156 31.5T763-763q54 54 85.5 127T880-480q0 83-31.5 156T763-197q-54 54-127 85.5T480-80Zm0-400Zm0 340q142 0 241-99t99-241q0-142-99-241t-241-99q-142 0-241 99t-99 241q0 142 99 241t241 99Z"})}),Ap=Ep("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 -960 960 960",width:"48",children:Ep("path",{d:"M479.504-261Q537-261 585.5-287q48.5-26 78.5-72.4 6-11.6-.75-22.6-6.75-11-20.25-11H316.918Q303-393 296.5-382t-.5 22.6q30 46.4 78.5 72.4 48.5 26 105.004 26ZM347-578l27 27q7.636 8 17.818 8Q402-543 410-551q8-8 8-18t-8-18l-42-42q-8.8-9-20.9-9-12.1 0-21.1 9l-42 42q-8 7.636-8 17.818Q276-559 284-551q8 8 18 8t18-8l27-27Zm267 0 27 27q7.714 8 18 8t18-8q8-7.636 8-17.818Q685-579 677-587l-42-42q-8.8-9-20.9-9-12.1 0-21.1 9l-42 42q-8 7.714-8 18t8 18q7.636 8 17.818 8Q579-543 587-551l27-27ZM480-80q-83 0-156-31.5T197-197q-54-54-85.5-127T80-480q0-83 31.5-156T197-763q54-54 127-85.5T480-880q83 0 156 31.5T763-763q54 54 85.5 127T880-480q0 83-31.5 156T763-197q-54 54-127 85.5T480-80Zm0-400Zm0 340q142.375 0 241.188-98.812Q820-337.625 820-480t-98.812-241.188Q622.375-820 480-820t-241.188 98.812Q140-622.375 140-480t98.812 241.188Q337.625-140 480-140Z"})}),Op=Ep("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 0 24 24",width:"48",children:Ep("path",{d:"M2 20h2c.55 0 1-.45 1-1v-9c0-.55-.45-1-1-1H2v11zm19.83-7.12c.11-.25.17-.52.17-.8V11c0-1.1-.9-2-2-2h-5.5l.92-4.65c.05-.22.02-.46-.08-.66-.23-.45-.52-.86-.88-1.22L14 2 7.59 8.41C7.21 8.79 7 9.3 7 9.83v7.84C7 18.95 8.05 20 9.34 20h8.11c.7 0 1.36-.37 1.72-.97l2.66-6.15z"})}),Fp=Ep("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 0 24 24",width:"48",children:Ep("path",{d:"M22 4h-2c-.55 0-1 .45-1 1v9c0 .55.45 1 1 1h2V4zM2.17 11.12c-.11.25-.17.52-.17.8V13c0 1.1.9 2 2 2h5.5l-.92 4.65c-.05.22-.02.46.08.66.23.45.52.86.88 1.22L10 22l6.41-6.41c.38-.38.59-.89.59-1.42V6.34C17 5.05 15.95 4 14.66 4H6.55c-.7 0-1.36.37-1.72.97l-2.66 6.15z"})}),Lp=function(t){var e=(void 0===t?{}:t).fill,i=void 0===e?"currentColor":e;return Ep("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:i,xmlns:"http://www.w3.org/2000/svg","aria-labelledby":"close-survey-title-adam",children:[Ep("title",{id:"close-survey-title",className:"adam-testing",children:"Close survey"}),Ep("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M0.164752 0.164752C0.384422 -0.0549175 0.740578 -0.0549175 0.960248 0.164752L6 5.20451L11.0398 0.164752C11.2594 -0.0549175 11.6156 -0.0549175 11.8352 0.164752C12.0549 0.384422 12.0549 0.740578 11.8352 0.960248L6.79549 6L11.8352 11.0398C12.0549 11.2594 12.0549 11.6156 11.8352 11.8352C11.6156 12.0549 11.2594 12.0549 11.0398 11.8352L6 6.79549L0.960248 11.8352C0.740578 12.0549 0.384422 12.0549 0.164752 11.8352C-0.0549175 11.6156 -0.0549175 11.2594 0.164752 11.0398L5.20451 6L0.164752 0.960248C-0.0549175 0.740578 -0.0549175 0.384422 0.164752 0.164752Z",fill:i})]})},$p=Ep("svg",{width:"77",height:"14",viewBox:"0 0 77 14",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[Ep("g",{"clip-path":"url(#clip0_2415_6911)",children:[Ep("mask",{id:"mask0_2415_6911",style:{maskType:"luminance"},maskUnits:"userSpaceOnUse",x:"0",y:"0",width:"77",height:"14",children:Ep("path",{d:"M0.5 0H76.5V14H0.5V0Z",fill:"white"})}),Ep("g",{mask:"url(#mask0_2415_6911)",children:[Ep("path",{d:"M5.77226 8.02931C5.59388 8.37329 5.08474 8.37329 4.90634 8.02931L4.4797 7.20672C4.41155 7.07535 4.41155 6.9207 4.4797 6.78933L4.90634 5.96669C5.08474 5.62276 5.59388 5.62276 5.77226 5.96669L6.19893 6.78933C6.26709 6.9207 6.26709 7.07535 6.19893 7.20672L5.77226 8.02931ZM5.77226 12.6946C5.59388 13.0386 5.08474 13.0386 4.90634 12.6946L4.4797 11.872C4.41155 11.7406 4.41155 11.586 4.4797 11.4546L4.90634 10.632C5.08474 10.288 5.59388 10.288 5.77226 10.632L6.19893 11.4546C6.26709 11.586 6.26709 11.7406 6.19893 11.872L5.77226 12.6946Z",fill:"#1D4AFF"}),Ep("path",{d:"M0.5 10.9238C0.5 10.508 1.02142 10.2998 1.32637 10.5938L3.54508 12.7327C3.85003 13.0267 3.63405 13.5294 3.20279 13.5294H0.984076C0.716728 13.5294 0.5 13.3205 0.5 13.0627V10.9238ZM0.5 8.67083C0.5 8.79459 0.551001 8.91331 0.641783 9.00081L5.19753 13.3927C5.28831 13.4802 5.41144 13.5294 5.53982 13.5294H8.0421C8.47337 13.5294 8.68936 13.0267 8.3844 12.7327L1.32637 5.92856C1.02142 5.63456 0.5 5.84278 0.5 6.25854V8.67083ZM0.5 4.00556C0.5 4.12932 0.551001 4.24802 0.641783 4.33554L10.0368 13.3927C10.1276 13.4802 10.2508 13.5294 10.3791 13.5294H12.8814C13.3127 13.5294 13.5287 13.0267 13.2237 12.7327L1.32637 1.26329C1.02142 0.969312 0.5 1.17752 0.5 1.59327V4.00556ZM5.33931 4.00556C5.33931 4.12932 5.39033 4.24802 5.4811 4.33554L14.1916 12.7327C14.4965 13.0267 15.0179 12.8185 15.0179 12.4028V9.99047C15.0179 9.86671 14.9669 9.74799 14.8762 9.66049L6.16568 1.26329C5.86071 0.969307 5.33931 1.17752 5.33931 1.59327V4.00556ZM11.005 1.26329C10.7 0.969307 10.1786 1.17752 10.1786 1.59327V4.00556C10.1786 4.12932 10.2296 4.24802 10.3204 4.33554L14.1916 8.06748C14.4965 8.36148 15.0179 8.15325 15.0179 7.7375V5.3252C15.0179 5.20144 14.9669 5.08272 14.8762 4.99522L11.005 1.26329Z",fill:"#F9BD2B"}),Ep("path",{d:"M21.0852 10.981L16.5288 6.58843C16.2238 6.29443 15.7024 6.50266 15.7024 6.91841V13.0627C15.7024 13.3205 15.9191 13.5294 16.1865 13.5294H23.2446C23.5119 13.5294 23.7287 13.3205 23.7287 13.0627V12.5032C23.7287 12.2455 23.511 12.0396 23.2459 12.0063C22.4323 11.9042 21.6713 11.546 21.0852 10.981ZM18.0252 12.0365C17.5978 12.0365 17.251 11.7021 17.251 11.2901C17.251 10.878 17.5978 10.5436 18.0252 10.5436C18.4527 10.5436 18.7996 10.878 18.7996 11.2901C18.7996 11.7021 18.4527 12.0365 18.0252 12.0365Z",fill:"currentColor"}),Ep("path",{d:"M0.5 13.0627C0.5 13.3205 0.716728 13.5294 0.984076 13.5294H3.20279C3.63405 13.5294 3.85003 13.0267 3.54508 12.7327L1.32637 10.5938C1.02142 10.2998 0.5 10.508 0.5 10.9238V13.0627ZM5.33931 5.13191L1.32637 1.26329C1.02142 0.969306 0.5 1.17752 0.5 1.59327V4.00556C0.5 4.12932 0.551001 4.24802 0.641783 4.33554L5.33931 8.86412V5.13191ZM1.32637 5.92855C1.02142 5.63455 0.5 5.84278 0.5 6.25853V8.67083C0.5 8.79459 0.551001 8.91331 0.641783 9.00081L5.33931 13.5294V9.79717L1.32637 5.92855Z",fill:"#1D4AFF"}),Ep("path",{d:"M10.1787 5.3252C10.1787 5.20144 10.1277 5.08272 10.0369 4.99522L6.16572 1.26329C5.8608 0.969306 5.33936 1.17752 5.33936 1.59327V4.00556C5.33936 4.12932 5.39037 4.24802 5.48114 4.33554L10.1787 8.86412V5.3252ZM5.33936 13.5294H8.04214C8.47341 13.5294 8.6894 13.0267 8.38443 12.7327L5.33936 9.79717V13.5294ZM5.33936 5.13191V8.67083C5.33936 8.79459 5.39037 8.91331 5.48114 9.00081L10.1787 13.5294V9.99047C10.1787 9.86671 10.1277 9.74803 10.0369 9.66049L5.33936 5.13191Z",fill:"#F54E00"}),Ep("path",{d:"M29.375 11.6667H31.3636V8.48772H33.0249C34.8499 8.48772 36.0204 7.4443 36.0204 5.83052C36.0204 4.21681 34.8499 3.17334 33.0249 3.17334H29.375V11.6667ZM31.3636 6.84972V4.81136H32.8236C33.5787 4.81136 34.0318 5.19958 34.0318 5.83052C34.0318 6.4615 33.5787 6.84972 32.8236 6.84972H31.3636ZM39.618 11.7637C41.5563 11.7637 42.9659 10.429 42.9659 8.60905C42.9659 6.78905 41.5563 5.45438 39.618 5.45438C37.6546 5.45438 36.2701 6.78905 36.2701 8.60905C36.2701 10.429 37.6546 11.7637 39.618 11.7637ZM38.1077 8.60905C38.1077 7.63838 38.7118 6.97105 39.618 6.97105C40.5116 6.97105 41.1157 7.63838 41.1157 8.60905C41.1157 9.57972 40.5116 10.2471 39.618 10.2471C38.7118 10.2471 38.1077 9.57972 38.1077 8.60905ZM46.1482 11.7637C47.6333 11.7637 48.6402 10.8658 48.6402 9.81025C48.6402 7.33505 45.2294 8.13585 45.2294 7.16518C45.2294 6.8983 45.5189 6.72843 45.9342 6.72843C46.3622 6.72843 46.8782 6.98318 47.0418 7.54132L48.527 6.94678C48.2375 6.06105 47.1677 5.45438 45.8713 5.45438C44.4743 5.45438 43.6058 6.25518 43.6058 7.21372C43.6058 9.53118 46.9663 8.88812 46.9663 9.84665C46.9663 10.1864 46.6391 10.417 46.1482 10.417C45.4434 10.417 44.9525 9.94376 44.8015 9.3735L43.3164 9.93158C43.6436 10.8537 44.6001 11.7637 46.1482 11.7637ZM53.4241 11.606L53.2982 10.0651C53.0843 10.1743 52.8074 10.2106 52.5808 10.2106C52.1278 10.2106 51.8257 9.89523 51.8257 9.34918V7.03172H53.3612V5.55145H51.8257V3.78001H49.9755V5.55145H48.9687V7.03172H49.9755V9.57972C49.9755 11.06 51.0202 11.7637 52.3921 11.7637C52.7696 11.7637 53.122 11.7031 53.4241 11.606ZM59.8749 3.17334V6.47358H56.376V3.17334H54.3874V11.6667H56.376V8.11158H59.8749V11.6667H61.8761V3.17334H59.8749ZM66.2899 11.7637C68.2281 11.7637 69.6378 10.429 69.6378 8.60905C69.6378 6.78905 68.2281 5.45438 66.2899 5.45438C64.3265 5.45438 62.942 6.78905 62.942 8.60905C62.942 10.429 64.3265 11.7637 66.2899 11.7637ZM64.7796 8.60905C64.7796 7.63838 65.3837 6.97105 66.2899 6.97105C67.1835 6.97105 67.7876 7.63838 67.7876 8.60905C67.7876 9.57972 67.1835 10.2471 66.2899 10.2471C65.3837 10.2471 64.7796 9.57972 64.7796 8.60905ZM73.2088 11.4725C73.901 11.4725 74.5177 11.242 74.845 10.8416V11.424C74.845 12.1034 74.2786 12.5767 73.4102 12.5767C72.7935 12.5767 72.2523 12.2854 72.1642 11.788L70.4776 12.0428C70.7042 13.1955 71.925 13.972 73.4102 13.972C75.361 13.972 76.6574 12.8679 76.6574 11.2298V5.55145H74.8324V6.07318C74.4926 5.69705 73.9136 5.45438 73.171 5.45438C71.409 5.45438 70.3014 6.61918 70.3014 8.46345C70.3014 10.3077 71.409 11.4725 73.2088 11.4725ZM72.1012 8.46345C72.1012 7.55345 72.655 6.97105 73.5109 6.97105C74.3793 6.97105 74.9331 7.55345 74.9331 8.46345C74.9331 9.37345 74.3793 9.95585 73.5109 9.95585C72.655 9.95585 72.1012 9.37345 72.1012 8.46345Z",fill:"currentColor"})]})]}),Ep("defs",{children:Ep("clipPath",{id:"clip0_2415_6911",children:Ep("rect",{width:"76",height:"14",fill:"white",transform:"translate(0.5)"})})})]});function Dp(t){var e=t.urlParams,i=e?Object.entries(e).map((t=>{var e=t[1];return encodeURIComponent(t[0])+"="+encodeURIComponent(e)})).join("&"):"";return Ep("a",{href:"https://posthog.com/surveys"+(i?"?"+i:""),target:"_blank",rel:"noopener",className:"footer-branding",children:["Survey by ",$p]})}function Np(e){var i=e.text,r=e.submitDisabled,n=e.appearance,s=e.onSubmit,o=e.link,a=e.onPreviewSubmit,l=e.skipSubmitButton,u=e.canGoBack,h=e.onBack,d=Zc(pp).isPreviewMode,v=!!u&&!!h,c=!l&&Ep("button",{className:"form-submit",disabled:r,"aria-label":"Submit survey",type:"button",onClick(){o&&(null==t||t.open(o)),d?null==a||a():s()},children:i});return Ep("div",{className:"bottom-section",children:[v?Ep("div",{className:"form-buttons form-buttons-with-back",children:[Ep("button",{className:"form-back",type:"button","aria-label":"Go to previous question",onClick:h,children:n.backButtonText||"Back"}),c]}):c,!n.whiteLabel&&Ep(Dp,{urlParams:{utm_source:"survey-footer"}})]})}function qp(t){var e=t.question,i=t.forceDisableHtml;return Ep("div",{class:e.question||e.description?"question-header":"question-header question-header--empty",children:[Ep(e.type===hf.Open?"label":"h3",{className:"survey-question",htmlFor:t.htmlFor,children:e.question}),e.description&&mp({component:ac("p",{className:"survey-question-description"}),children:e.description,renderAsHtml:!i&&"text"!==e.descriptionContentType})]})}function jp(t){return Ep("button",{className:"form-cancel",onClick:t.onClick,disabled:Zc(pp).isPreviewMode,"aria-label":"Close survey",type:"button",children:Lp({fill:"black"})})}Ep("svg",{width:"16",height:"12",viewBox:"0 0 16 12",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:Ep("path",{d:"M5.30769 10.6923L4.77736 11.2226C4.91801 11.3633 5.10878 11.4423 5.30769 11.4423C5.5066 11.4423 5.69737 11.3633 5.83802 11.2226L5.30769 10.6923ZM15.5303 1.53033C15.8232 1.23744 15.8232 0.762563 15.5303 0.46967C15.2374 0.176777 14.7626 0.176777 14.4697 0.46967L15.5303 1.53033ZM1.53033 5.85429C1.23744 5.56139 0.762563 5.56139 0.46967 5.85429C0.176777 6.14718 0.176777 6.62205 0.46967 6.91495L1.53033 5.85429ZM5.83802 11.2226L15.5303 1.53033L14.4697 0.46967L4.77736 10.162L5.83802 11.2226ZM0.46967 6.91495L4.77736 11.2226L5.83802 10.162L1.53033 5.85429L0.46967 6.91495Z",fill:"currentColor"})});var Bp=t;function Up(t){var e=t.header,i=t.description,r=t.contentType,n=t.forceDisableHtml,s=t.appearance,o=t.onClose,a=Zc(pp).isPopup;return Wc((()=>{var t=t=>{"Enter"!==t.key&&"Escape"!==t.key||(t.preventDefault(),o())};return Ki(Bp,"keydown",t),()=>{Bp.removeEventListener("keydown",t)}}),[o]),Ep("div",{className:"thank-you-message",role:"status",tabIndex:0,"aria-atomic":"true",children:[a&&!0!==s.hideCancelButton&&Ep(jp,{onClick:()=>o()}),Ep("h3",{className:"thank-you-message-header",children:e}),i&&mp({component:ac("p",{className:"thank-you-message-body"}),children:i,renderAsHtml:!n&&"text"!==r}),a&&Ep(Np,{text:s.thankYouMessageCloseButtonText||"Close",submitDisabled:!1,appearance:s,onSubmit:()=>o()})]})}function Hp(t){var e=t.header,i=t.description,r=t.contentType,n=t.forceDisableHtml,s=t.appearance,o=t.onStart,a=Zc(pp),l=a.onPreviewSubmit,u=a.onPopupSurveyDismissed;return Ep("div",{className:"intro-screen",role:"status",tabIndex:0,"aria-atomic":"true",children:[a.isPopup&&!0!==s.hideCancelButton&&Ep(jp,{onClick:()=>u()}),e&&Ep("h3",{className:"intro-screen-header",children:e}),i&&mp({component:ac("p",{className:"intro-screen-body"}),children:i,renderAsHtml:!n&&"text"!==r}),Ep(Np,{text:s.introScreenButtonText||"Get started",submitDisabled:!1,appearance:s,onSubmit:o,onPreviewSubmit:()=>l(null)})]})}var zp=t=>rt(t)&&t.every((t=>lt(t)));function Wp(t){var e=t.question,i=t.forceDisableHtml,r=t.appearance,n=t.onSubmit,s=t.onPreviewSubmit,o=t.displayQuestionIndex,a=t.initialValue,l=t.canGoBack,u=t.onBack,h=gp().isPreviewMode,d=Vc(null),v=zc((()=>lt(a)?a:"")),c=v[0],f=v[1],p=null==r?void 0:r.disableAutofocus;Wc((()=>{p||setTimeout((()=>{var t;h||null==(t=d.current)||t.focus()}),100)}),[h,p]);var g="surveyQuestion"+o,m=Gc((()=>function(t,e,i){var r,n,s=t.trim();if(!i&&""===s)return"This field is required";if(""===s)return!1;if(e&&e.length>0)for(var o of e)switch(o.type){case T:if(void 0!==o.value&&o.value>s.length)return null!==(r=o.errorMessage)&&void 0!==r?r:"Please enter at least "+o.value+" characters";break;case E:if(void 0!==o.value&&s.length>o.value)return null!==(n=o.errorMessage)&&void 0!==n?n:"Please enter no more than "+o.value+" characters"}return!1}(c,e.validation,e.optional)),[c,e.validation,e.optional]),y=ii(e.validation,T),_=ii(e.validation,E),b=Gc((()=>function(t,e){var i=1===t?void 0:t;return i&&e?"Enter "+i+"-"+e+" characters":i?"Enter at least "+i+" "+(1===i?"character":"characters"):e?"Maximum "+e+" "+(1===e?"character":"characters"):void 0}(y,_)),[y,_]),w=()=>{m||n(c.trim())},k=()=>{m||s(c.trim())};return Ep(uc,{children:[Ep("div",{className:"question-container",children:[Ep(qp,{question:e,forceDisableHtml:i,htmlFor:g}),Ep("textarea",{ref:d,id:g,rows:4,placeholder:null==r?void 0:r.placeholder,minLength:y,maxLength:_,onInput(t){f(t.currentTarget.value),t.stopPropagation()},onKeyDown(t){t.stopPropagation(),"Enter"!==t.key||!t.metaKey&&!t.ctrlKey||m||(t.preventDefault(),h?k():w())},value:c}),b&&Ep("div",{className:"validation-hint",children:b})]}),Ep(Np,{text:e.buttonText||"Submit",submitDisabled:!!m,appearance:r,onSubmit:w,onPreviewSubmit:k,canGoBack:l,onBack:u})]})}function Vp(t){var e=t.question,i=t.appearance,r=t.onSubmit,n=t.onPreviewSubmit,s=t.canGoBack,o=t.onBack;return Ep(uc,{children:[Ep("div",{className:"question-container",children:Ep(qp,{question:e,forceDisableHtml:t.forceDisableHtml})}),Ep(Np,{text:e.buttonText||"Submit",submitDisabled:!1,link:e.link,appearance:i,onSubmit:()=>r("link clicked"),onPreviewSubmit:()=>n("link clicked"),canGoBack:s,onBack:o})]})}function Gp(t){var e,i=t.question,r=t.forceDisableHtml,n=t.displayQuestionIndex,s=t.appearance,o=t.onSubmit,a=t.onPreviewSubmit,l=t.initialValue,u=t.canGoBack,h=t.onBack,d=i.scale,v=10===i.scale?0:1,c=zc((()=>vt(l)?l:rt(l)&&l.length>0&&vt(parseInt(l[0]))?parseInt(l[0]):lt(l)&&vt(parseInt(l))?parseInt(l):null)),f=c[0],p=c[1],g="emoji"===i.display&&2===i.scale,m=gp().isPreviewMode,y=t=>m?a(t):o(t);return Ep(uc,{children:[Ep("div",{className:"question-container",children:[Ep(qp,{question:i,forceDisableHtml:r}),Ep("div",{className:"rating-section",children:[Ep("div",{className:"rating-options",children:["emoji"===i.display&&Ep("div",{className:"rating-options-emoji"+(g?" rating-options-emoji-2":""),children:null==(e=Xp[i.scale])?void 0:e.map(((t,e)=>Ep("button",{"aria-label":"Rate "+(e+1),className:"ratings-emoji question-"+n+"-rating-"+e+" "+(e+1===f?"rating-active":""),value:e+1,type:"button",onClick(){var t=e+1;p(t),i.skipSubmitButton&&y(t)},children:t},e)))}),"number"===i.display&&Ep("div",{className:"rating-options-number",style:{gridTemplateColumns:"repeat("+(d-v+1)+", minmax(0, 1fr))"},children:tg(i.scale).map(((t,e)=>Ep(Zp,{displayQuestionIndex:n,active:f===t,appearance:s,num:t,setActiveNumber(t){p(t),i.skipSubmitButton&&y(t)}},e)))})]}),!g&&Ep("div",{className:"rating-text",children:[Ep("div",{children:i.lowerBoundLabel}),Ep("div",{children:i.upperBoundLabel})]})]})]}),Ep(Np,{text:i.buttonText||(null==s?void 0:s.submitButtonText)||"Submit",submitDisabled:ht(f)&&!i.optional,appearance:s,onSubmit:()=>o(f),onPreviewSubmit:()=>a(f),skipSubmitButton:i.skipSubmitButton,canGoBack:u,onBack:h})]})}function Zp(t){var e=t.num,i=t.setActiveNumber;return Ep("button",{"aria-label":"Rate "+e,className:"ratings-number question-"+t.displayQuestionIndex+"-rating-"+e+" "+(t.active?"rating-active":""),type:"button",onClick(){i(e)},children:e})}function Qp(t){var e=t.question,i=t.forceDisableHtml,r=t.displayQuestionIndex,n=t.appearance,s=t.onSubmit,o=t.onPreviewSubmit,a=t.initialValue,l=t.canGoBack,u=t.onBack,h=Vc(null),d=Gc((()=>(t=>{if(!t.shuffleOptions)return t.choices;var e=t.choices,i="";t.hasOpenChoice&&(i=e.pop());var r=vp(e,dp(e));return t.hasOpenChoice&&(t.choices.push(i),r.push(i)),r})(e)),[e]),v=zc((()=>((t,e)=>lt(t)||zp(t)?t:e===hf.SingleChoice?null:[])(a,e.type))),c=v[0],f=v[1],g=zc((()=>((t,e)=>{if(lt(t)&&!e.includes(t))return{isSelected:!0,inputValue:t};if(zp(t)){var i=t.find((t=>!e.includes(t)));if(i)return{isSelected:!0,inputValue:i}}return{isSelected:!1,inputValue:""}})(a,d))),m=g[0],y=g[1],_=gp().isPreviewMode,b=e.type===hf.SingleChoice,w=e.type===hf.MultipleChoice,k=e.skipSubmitButton&&b&&!e.hasOpenChoice,S=(t,e)=>{if(e){var i=!m.isSelected;return y((t=>p({},t,{isSelected:i,inputValue:i?t.inputValue:""}))),b&&f(""),void(i&&setTimeout((()=>{var t;return null==(t=h.current)?void 0:t.focus()}),75))}if(b)return f(t),y((t=>p({},t,{isSelected:!1,inputValue:""}))),void(k&&(s(t),_&&o(t)));w&&rt(c)&&(c.includes(t)?f(c.filter((e=>e!==t))):f([...c,t]))},x=t=>{t.stopPropagation();var e=t.currentTarget.value;y((t=>p({},t,{inputValue:e}))),b&&f(e)},C=t=>{t.stopPropagation(),"Enter"!==t.key||T()||(t.preventDefault(),E()),"Escape"===t.key&&(t.preventDefault(),y((t=>p({},t,{isSelected:!1,inputValue:""}))),b&&f(null))},T=()=>!(e.optional||!ht(c)&&(!rt(c)||m.isSelected||0!==c.length)&&(!m.isSelected||""!==m.inputValue.trim())),E=()=>{m.isSelected&&w?rt(c)&&(_?o([...c,m.inputValue]):s([...c,m.inputValue])):_?o(c):s(c)};return Ep(uc,{children:[Ep("div",{className:"question-container",children:[Ep(qp,{question:e,forceDisableHtml:i}),Ep("fieldset",{className:"multiple-choice-options limit-height",children:[Ep("legend",{className:"sr-only",children:w?" Select all that apply":" Select one"}),d.map(((t,i)=>{var n=!!e.hasOpenChoice&&i===e.choices.length-1,s="surveyQuestion"+r+"Choice"+i,o=s+"Open",a=n?m.isSelected:b?c===t:rt(c)&&c.includes(t);return Ep("label",{className:n?"choice-option-open":"",children:[Ep("div",{className:"response-choice",children:[Ep("input",{type:b?"radio":"checkbox",name:s,checked:a,onChange:()=>S(t,n),id:s,"aria-controls":o}),Ep("span",{children:n?t+":":t})]}),n&&Ep("input",{type:"text",ref:h,id:o,name:"question"+r+"Open",value:m.inputValue,onKeyDown:C,onInput:x,onClick(e){m.isSelected||S(t,!0),e.stopPropagation()},"aria-label":t+" - please specify"})]},i)}))]})]}),Ep(Np,{text:e.buttonText||"Submit",submitDisabled:T(),appearance:n,onSubmit:E,onPreviewSubmit:E,skipSubmitButton:k,canGoBack:l,onBack:u})]})}var Jp=[1,2,3,4,5],Kp=[1,2,3,4,5,6,7],Yp=[0,1,2,3,4,5,6,7,8,9,10],Xp={2:[Op,Fp],3:[Rp,Ip,Mp],5:[Pp,Rp,Ip,Mp,Ap]};function tg(t){switch(t){case 5:default:return Jp;case 7:return Kp;case 10:return Yp}}var eg=Bi("[Surveys]");function ig(t,e,i){var r,n=t.questions[e],s=e+1;if(null==(r=n.branching)||!r.type)return e===t.questions.length-1?df.End:s;if(n.branching.type===df.End)return df.End;if(n.branching.type===df.SpecificQuestion){if(Number.isInteger(n.branching.index))return n.branching.index}else if(n.branching.type===df.ResponseBased){if(n.type===hf.SingleChoice){var o,a=n.choices.indexOf(""+i);if(-1===a&&n.hasOpenChoice&&(a=n.choices.length-1),null!=(o=n.branching)&&null!=(o=o.responseValues)&&o.hasOwnProperty(a)){var l=n.branching.responseValues[a];return Number.isInteger(l)?l:l===df.End?df.End:s}}else if(n.type===hf.Rating){var u;if("number"!=typeof i||!Number.isInteger(i))throw new Error("The response type must be an integer");var h=function(t,e){if(2===e){if(1>t||t>2)throw new Error("The response must be in range 1-2");return 1===t?"positive":"negative"}if(3===e){if(1>t||t>3)throw new Error("The response must be in range 1-3");return 1===t?"negative":2===t?"neutral":"positive"}if(5===e){if(1>t||t>5)throw new Error("The response must be in range 1-5");return t>2?3===t?"neutral":"positive":"negative"}if(7===e){if(1>t||t>7)throw new Error("The response must be in range 1-7");return t>3?4===t?"neutral":"positive":"negative"}if(10===e){if(0>t||t>10)throw new Error("The response must be in range 0-10");return t>6?t>8?"promoters":"passives":"detractors"}throw new Error("The scale must be one of: 2, 3, 5, 7, 10")}(i,n.scale);if(null!=(u=n.branching)&&null!=(u=u.responseValues)&&u.hasOwnProperty(h)){var d=n.branching.responseValues[h];return Number.isInteger(d)?d:d===df.End?df.End:s}}return s}return eg.warn("Falling back to next question index due to unexpected branching type"),s}var rg=Bi("[SurveyTranslations]");function ng(t,e){var i=function(t){return function(t,e){var i=t.storedPersonProperties,r=t.locale,n=ca(t.overrideLanguage);if(n)return null==e||e.info("Using override display language: "+n),n;var s=function(t){return t&&"object"==typeof t&&"language"in t?ca(t.language):null}(i);if(s)return null==e||e.info("Using person property language: "+s),s;var o=ca(r);return o?(null==e||e.info("Using detected locale: "+o),o):(null==e||e.info("No user language detected"),null)}({overrideLanguage:t.config.override_display_language,storedPersonProperties:nt(t.get_property)?t.get_property(Xn):void 0,locale:Ba()},rg)}(e);if(!i)return rg.info("No user language detected"),{survey:t,language:null};var r=ma(t,i,rg);return{survey:r.survey,language:r.matchedKey}}var sg=-1,og=t,ag=r,lg="ph:show_survey_widget",ug="PHWidgetSurveyClickListener";function hg(t,e){try{var i=t.getBoundingClientRect(),r=og.innerHeight,n=og.innerWidth,s=i.left+i.width/2-e/2;s+e>n-20&&(s=n-e-20),20>s&&(s=20);var o=r-i.bottom,a=250>o&&i.top>o;return{position:"fixed",top:a?"auto":i.bottom+12+"px",left:s+"px",right:"auto",bottom:a?r-i.top+12+"px":"auto",zIndex:ip.zIndex}}catch(t){return gf.warn("Failed to calculate trigger position:",t),null}}class dg{constructor(t){var e=this;this.Hr=new Map,this.$r=new Map,this.Ur=new Map,this.Wr=new Set,this.handlePageUnload=()=>{var t=this._posthog.get_property(is);if(t)for(var e of t)kp(e)&&hp(e,this._posthog)},this.handlePopoverSurvey=function(t,i,r){var n,s,o,a,l,u=(void 0===r?{}:r).resumeDelayFromActivation,h=void 0!==u&&u,d=e.zr(t),v=d.survey,c=d.language,f=null!=i&&i.position||null!=i&&i.selector?p({},v,{appearance:p({},v.appearance,i.position&&{position:i.position},i.selector&&{widgetSelector:i.selector})}):v;e.Vr(f.id);var g=null!=i?i:{},m=g.properties,y=g.initialResponses,_=!(!y||0>=Object.keys(y).length)&&e.Zr(f,y,m,c);if(!_||null!=(n=f.appearance)&&n.displayThankYouMessage){e.Qr(f);var b={};if((null==(s=f.appearance)?void 0:s.position)===af.NextToTrigger&&null!=(o=f.appearance)&&o.widgetSelector){var w,k=ag.querySelector(f.appearance.widgetSelector);k&&(b=hg(k,parseInt((null==(w=f.appearance)?void 0:w.maxWidth)||ip.maxWidth))||{})}var S=(null==(a=f.appearance)?void 0:a.surveyPopupDelaySeconds)||0,x=op(f,e._posthog).shadow;e.Ur.set(x,x.host);var C={posthog:e._posthog,survey:f,removeSurveyFromFocus:e.Gr,properties:m,style:b,isSurveyCompleted:_,skipShownEvent:null==i?void 0:i.skipShownEvent,surveyLanguage:c};if(0>=S)return Ic(Ep(gg,p({},C)),x);var T=()=>{if(!e.Yr(f))return gf.info("Survey "+f.id+" no longer eligible when its display delay elapsed; not displaying"),e.Gr(f);Ic(Ep(gg,p({},C,{survey:p({},f,{appearance:p({},f.appearance,{surveyPopupDelaySeconds:0})})})),x)},E=h?null==(l=e._posthog.surveys)||null==(l=l._surveyEventReceiver)||null==l.getActivationTimestamp?void 0:l.getActivationTimestamp(f.id):void 0,M=vt(E)?Math.max(0,Date.now()-E):0,I=Math.max(0,1e3*S-M);if(0>=I)return T();var R=og.setTimeout((()=>{e.Hr.delete(f.id),T()}),I);e.Hr.set(f.id,R)}},this.Jr=t=>{var e=this.zr(t),i=e.survey,r=e.language,n=op(i,this._posthog),s=n.shadow,o=n.isNewlyCreated;this.Ur.set(s,s.host),o&&Ic(Ep(yg,{posthog:this._posthog,survey:i,surveyLanguage:r},t.id),s)},this.Kr=t=>{var e=this.$r.get(t);e&&(e.element.removeEventListener("click",e.listener),e.element.removeAttribute(ug),this.$r.delete(t),gf.info("Removed click listener for survey "+t))},this.Xr=t=>{this.ei(t)||(this.ti(t),this.Kr(t.id))},this.ei=t=>{try{var e,i=ag.querySelector(xp(t,!0));return!(null==i||null==(e=i.shadowRoot)||!e.querySelector(".ph-survey"))}catch(t){return!1}},this.ri=(t,e)=>{var i=ag.querySelector(e),r=this.$r.get(t.id);if(i){if(this.Jr(t),r){if(i===r.element)return;gf.info("Selector element changed for survey "+t.id+". Re-attaching listener."),this.Kr(t.id)}if(!i.hasAttribute(ug)){var n=e=>{var i,r;e.stopPropagation();var n=(null==(i=t.appearance)?void 0:i.position)===af.NextToTrigger?hg(e.currentTarget,parseInt((null==(r=t.appearance)?void 0:r.maxWidth)||ip.maxWidth)):{};og.dispatchEvent(new CustomEvent(lg,{detail:{surveyId:t.id,position:n}}))};Ki(i,"click",n),i.setAttribute(ug,"true"),this.$r.set(t.id,{element:i,listener:n,survey:t}),gf.info("Attached click listener for feedback button survey "+t.id)}}else r&&this.Xr(t)},this.renderPopover=t=>{var e=this.zr(t),i=e.survey,r=e.language,n=op(i,this._posthog).shadow;this.Ur.set(n,n.host),Ic(Ep(gg,{posthog:this._posthog,survey:i,removeSurveyFromFocus:this.Gr,surveyLanguage:r}),n)},this.renderSurvey=(t,e,i)=>{var r,n=this.zr(t),s=n.survey,o=n.language,a=!1;null!=(r=this._posthog.config)&&null!=(r=r.surveys)&&r.prefillFromUrl&&(a=this.ii(s,o,i)),Ic(Ep(gg,{posthog:this._posthog,survey:s,removeSurveyFromFocus:this.Gr,isPopup:!1,properties:i,isSurveyCompleted:a,surveyLanguage:o}),e)},this.getActiveMatchingSurveys=function(t,i){var r;void 0===i&&(i=!1),null==(r=e._posthog)||null==(r=r.surveys)||r.getSurveys((i=>{var r=i.filter((t=>e.Yr(t)));t(r)}),i)},this.callSurveysAndEvaluateDisplayLogic=function(t){void 0===t&&(t=!1),e.getActiveMatchingSurveys((t=>{var i=t.filter((t=>t.type===uf.Popover||t.type===uf.Widget)),r=new Set(i.map((t=>t.id)));for(var n of Array.from(e.Hr.keys()))r.has(n)||e.cancelSurvey(n);var s=e.ni(i),o=new Set;s.forEach((t=>{if(t.type===uf.Widget){var i,r,n,s;if((null==(i=t.appearance)?void 0:i.widgetType)===of.Tab)return void e.Jr(t);(null==(r=t.appearance)?void 0:r.widgetType)===of.Selector&&null!=(n=t.appearance)&&n.widgetSelector&&(o.add(t.id),e.ri(t,null==(s=t.appearance)?void 0:s.widgetSelector))}ht(e.ai)&&t.type===uf.Popover&&e.handlePopoverSurvey(t,void 0,{resumeDelayFromActivation:!0})})),e.$r.forEach((t=>{var i=t.survey;o.has(i.id)||e.Xr(i)}))}),t)},this.Qr=t=>{ht(this.ai)||gf.error("Survey "+this.ai+" already in focus. Cannot add survey "+t.id+"."),this.ai=t.id},this.Gr=t=>{this.ai!==t.id&&gf.error("Survey "+t.id+" is not in focus. Cannot remove survey "+t.id+"."),this.Vr(t.id),this.ai=null,this.ti(t)},this._posthog=t,this.ai=null}Vr(t){var e=this.Hr.get(t);e&&(clearTimeout(e),this.Hr.delete(t))}cancelSurvey(t){this.Hr.has(t)&&(gf.info("Cancelled pending survey "+t),this.Vr(t),this.ai===t&&(this.ai=null))}setAutomaticDisplayDispose(t){this.oi=t}dispose(){var t;null==(t=this.oi)||t.call(this),this.oi=void 0,this.Hr.forEach(((t,e)=>this.Vr(e))),this.$r.forEach(((t,e)=>this.Kr(e))),this.Ur.forEach(((t,e)=>{Ic(null,e),null==t||t.remove()})),this.Ur.clear(),this.ai=null}ni(t){return t.sort(((t,e)=>{var i,r,n=kp(t),s=kp(e);if(n&&!s)return-1;if(!n&&s)return 1;var o=t.schedule===vf.Always,a=e.schedule===vf.Always;return o&&!a?1:!o&&a?-1:((null==(i=t.appearance)?void 0:i.surveyPopupDelaySeconds)||0)-((null==(r=e.appearance)?void 0:r.surveyPopupDelaySeconds)||0)}))}zr(t){return ng(t,this._posthog)}ii(t,e,i){if(this.Wr.has(t.id))return!1;var r=function(t){var e={},i=!1,r=og.location.search.replace(/^\?/,"");if(!r)return{params:e,autoSubmit:i};var n=r.split("&");for(var s of n){var o=s.split("="),a=o[0],l=o[1];if(a&&!at(l)){var u=decodeURIComponent(a),h=decodeURIComponent(l);if("auto_submit"!==u||"true"!==h){var d=u.match(/^q(\d+)$/);if(d){var v=parseInt(d[1],10);e[v]||(e[v]=[]),e[v].push(h)}}else i=!0}}return{params:e,autoSubmit:i}}(),n=r.params;if(0===Object.keys(n).length)return!1;gf.info("[Survey Prefill] Detected URL prefill parameters");var s=this.si(t,n,e);if(!s)return!1;var o=s.responses,a=s.submissionId,l=s.isSurveyCompleted,u=s.skippedResponses;return(Object.keys(u).length>0&&t.enable_partial_responses||l)&&ap({responses:l?o:u,survey:t,surveySubmissionId:a,posthog:this._posthog,isSurveyCompleted:l,properties:i,surveyLanguage:e}),this.Wr.add(t.id),l}Zr(t,e,i,r){var n={};for(var s of Object.entries(e)){var o=s[1];n[parseInt(s[0])]=rt(o)?o.map(String):[String(o)]}gf.info("[Survey] Processing initial responses");var a=this.si(t,n,r);if(!a)return!1;var l=a.isSurveyCompleted;return ap({responses:a.responses,survey:t,surveySubmissionId:a.submissionId,posthog:this._posthog,isSurveyCompleted:l,properties:i,surveyLanguage:r}),l}si(t,e,i){try{var r=function(t,e){var i={};return t.questions.forEach(((t,r)=>{if(e[r]&&t.id){var n=e[r],s=ua(t.id);try{switch(t.type){case hf.SingleChoice:if(!t.choices||0===t.choices.length)return void ji.warn("[Survey Prefill] Question "+r+" has no choices");var o=parseInt(n[0],10);if(isNaN(o)||0>o||o>=t.choices.length)return void ji.warn("[Survey Prefill] Invalid choice index for q"+r+": "+n[0]);i[s]=t.choices[o];break;case hf.MultipleChoice:if(!t.choices||0===t.choices.length)return void ji.warn("[Survey Prefill] Question "+r+" has no choices");var a=n.map((t=>parseInt(t,10))).filter((e=>!isNaN(e)&&e>=0&&t.choices.length>e));if(0===a.length)return void ji.warn("[Survey Prefill] No valid choices for q"+r);var l=[...new Set(a.map((e=>t.choices[e])))];a.length>l.length&&ji.warn("[Survey Prefill] Removed duplicate choices for q"+r),i[s]=l;break;case hf.Rating:var u=parseInt(n[0],10),h=t.scale||10;if(isNaN(u)||0>u||u>h)return void ji.warn("[Survey Prefill] Invalid rating for q"+r+": "+n[0]+" (scale: 0-"+h+")");i[s]=u;break;default:ji.info("[Survey Prefill] Question type "+t.type+" does not support prefill")}}catch(t){ji.error("[Survey Prefill] Error converting q"+r+":",t)}}})),i}(t,e);if(0===Object.keys(r).length)return gf.warn("[Survey Prefill] No valid responses after conversion"),null;var n=Pf(),s=Object.keys(e).map((t=>parseInt(t,10))),o=function(t,e,i){for(var r=0,n={},s=[],o=t.questions.length+1,a=0;t.questions.length>r&&o>a&&(a++,e.includes(r));){var l=t.questions[r];if(!l||!("skipSubmitButton"in l)||!l.skipSubmitButton)break;if(l.id){var u=ua(l.id);at(i[u])||(n[u]=i[u])}s.push(r);var h=ig(t,r,l.id?i[ua(l.id)]:null);if(h===df.End)return{startQuestionIndex:t.questions.length,skippedResponses:n,skippedIndices:s};r=h}return{startQuestionIndex:r,skippedResponses:n,skippedIndices:s}}(t,s,r),a=o.startQuestionIndex,l=o.skippedResponses,u=a>=t.questions.length;return bp(t,{surveySubmissionId:n,responses:r,lastQuestionIndex:a,visitedIndices:o.skippedIndices,surveyLanguage:i}),gf.info("[Survey Prefill] Stored prefilled responses in localStorage"),{responses:r,submissionId:n,startQuestionIndex:a,isSurveyCompleted:u,skippedResponses:l}}catch(t){return gf.error("[Survey Prefill] Error handling prefill:",t),null}}ui(t,e){var i;if(void 0===e&&(e=void 0),!t)return!0;var r,n=!(null==(i=this._posthog.featureFlags)||!i.isFeatureEnabled(t,{send_event:!t.startsWith("survey-targeting-")})),s=!0;return e&&(s=(null==(r=this._posthog.featureFlags)?void 0:r.getFeatureFlag(t,{send_event:!1}))===e||"any"===e),n&&s}li(e){return!e.conditions||yp(e,this._posthog)&&function(e){var r,n;return function(e,r){var n,s,o;if(!e||0===e.length)return!0;if(!u)return!1;var a=Ae(u,{userAgentDataPlatform:null==i||null==(n=i.userAgentData)?void 0:n.platform,maxTouchPoints:null==i?void 0:i.maxTouchPoints,screenWidth:null==t||null==(s=t.screen)?void 0:s.width,screenHeight:null==t||null==(o=t.screen)?void 0:o.height,devicePixelRatio:null==t?void 0:t.devicePixelRatio});return ka[null!=r?r:"icontains"](e,[a])}(null==(r=e.conditions)?void 0:r.deviceTypes,null==(n=e.conditions)?void 0:n.deviceTypesMatchType)}(e)&&function(t){var e;return null==(e=t.conditions)||!e.selector||!(null==tp||!tp.querySelector(t.conditions.selector))}(e)}hi(t){var e;return fp(t)?{satisfied:!0}:!t.internal_targeting_flag_key||!function(t){var e;return"recurring"===t.schedule||(null!==(e=t.current_iteration)&&void 0!==e?e:0)>0}(t)||null!=(e=this._posthog.featureFlags)&&e.hasLoadedFlags?{satisfied:this.ui(t.internal_targeting_flag_key)}:{satisfied:!1,reason:"Feature flags have not loaded yet; deferring internal targeting flag check"}}checkSurveyEligibility(t){var e,i,r={eligible:!0,reason:void 0};if(!mf(t))return r.eligible=!1,r.reason="Survey is not running. It was completed on "+t.end_date,r;if(!xf.includes(t.type))return r.eligible=!1,r.reason="Surveys of type "+t.type+" are never eligible to be shown in the app",r;var n=null==(e=t.conditions)?void 0:e.linkedFlagVariant;if(!this.ui(t.linked_flag_key,n))return r.eligible=!1,r.reason=n?"Survey linked feature flag is not enabled for variant "+n:"Survey linked feature flag is not enabled",r;if(!this.ui(t.targeting_flag_key))return r.eligible=!1,r.reason="Survey targeting feature flag is not enabled",r;var s,o=this.hi(t);return o.satisfied?function(t,e){if(!t||!e)return!0;var i="string"==typeof e?new Date(e):e,r=new Date,n=Math.abs(r.getTime()-i.getTime());return Math.ceil(n/864e5)>t}(null==(i=t.conditions)?void 0:i.seenSurveyWaitPeriodInDays,Df.Pr("lastSeenSurveyDate"))?(t=>!!Df.Pr(kf(t))&&!fp(t))(t)?(r.eligible=!1,r.reason="Survey has already been seen and it can't be activated again",r):r:(r.eligible=!1,r.reason="Survey wait period has not passed",r):(r.eligible=!1,r.reason=null!==(s=o.reason)&&void 0!==s?s:"Survey internal targeting flag is not enabled and survey cannot activate repeatedly and survey is not in progress",r)}checkSurveyRenderability(t){var e=this.checkSurveyEligibility(t);return e.eligible&&!this.ci(t)?{eligible:!1,reason:"Survey event/action trigger has not been fired yet"}:e}ci(t){var e;if(!ya(t)&&!yf(t))return!0;var i=null==(e=this._posthog.surveys)||null==(e=e._surveyEventReceiver)?void 0:e.getSurveys();return!(null==i||!i.includes(t.id))}di(t){var e;return null==(e=t.feature_flag_keys)||!e.length||t.feature_flag_keys.every((t=>{var e=t.value;return!t.key||!e||this.ui(e)}))}Yr(t){return this.checkSurveyEligibility(t).eligible&&this.li(t)&&this.ci(t)&&this.di(t)}ti(t){try{var e=ag.querySelector(xp(t,!0));null!=e&&e.shadowRoot&&(Ic(null,e.shadowRoot),this.Ur.delete(e.shadowRoot)),null==e||e.remove()}catch(e){gf.warn("Failed to remove survey "+t.id+" from DOM:",e)}}getTestAPI(){return{addSurveyToFocus:this.Qr,removeSurveyFromFocus:this.Gr,surveyInFocus:this.ai,surveyTimeouts:this.Hr,handleWidget:this.Jr,handlePopoverSurvey:this.handlePopoverSurvey,manageWidgetSelectorListener:this.ri,sortSurveysByAppearanceDelay:this.ni,checkFlags:this.di.bind(this),isSurveyFeatureFlagEnabled:this.ui.bind(this)}}}function vg(t,e){if(ag&&og){var i,r=new dg(t);if(t.config.disable_surveys_automatic_display)return gf.info("Surveys automatic display is disabled. Skipping call surveys and evaluate display logic."),r;if(!1===e)return gf.info("There are no surveys to load or Surveys is disabled in the project settings."),r;r.callSurveysAndEvaluateDisplayLogic(!0);var n=()=>{at(i)&&(i=setInterval((()=>{r.callSurveysAndEvaluateDisplayLogic(!1)}),1e3))},s=()=>{at(i)||(clearInterval(i),i=void 0)};n();var o=()=>{ag.hidden?s():(r.callSurveysAndEvaluateDisplayLogic(!1),n())};return Ki(ag,"visibilitychange",o),r.setAutomaticDisplayDispose((()=>{s(),ag.removeEventListener("visibilitychange",o)})),r}}function cg(t){var e=t.survey,i=t.removeSurveyFromFocus,r=void 0===i?()=>{}:i,n=t.setSurveyVisible,s=t.isPreviewMode,o=void 0!==s&&s,a=t.posthog;Wc((()=>{var t;if(!o&&null!=(t=e.conditions)&&t.url){var i=()=>{var t,i=e.type===uf.Widget,s=yp(e,a),o=(null==(t=e.appearance)?void 0:t.widgetType)===of.Tab&&i;if(!s)return gf.info("Hiding survey "+e.id+" because URL does not match"),n(!1),r(e);o&&(gf.info("Showing survey "+e.id+" because it is a feedback button tab and URL matches"),n(!0))};Ki(og,"popstate",i),Ki(og,"hashchange",i);var s=og.history.pushState,l=og.history.replaceState;return og.history.pushState=function(){for(var t=arguments.length,e=new Array(t),r=0;t>r;r++)e[r]=arguments[r];s.apply(this,e),i()},og.history.replaceState=function(){for(var t=arguments.length,e=new Array(t),r=0;t>r;r++)e[r]=arguments[r];l.apply(this,e),i()},()=>{og.removeEventListener("popstate",i),og.removeEventListener("hashchange",i),og.history.pushState=s,og.history.replaceState=l}}}),[o,e,r,n,a])}var fg=200;function pg(t){switch(void 0===t&&(t=lf.Right),t){case lf.Top:return{top:"0",left:"50%",transform:"translateX(-50%)"};case lf.Left:return{top:"50%",left:"0",transform:"rotate(90deg) translateY(-100%)",transformOrigin:"left top"};case lf.Bottom:return{bottom:"0",left:"50%",transform:"translateX(-50%)"};default:return{top:"50%",right:"0",transform:"rotate(-90deg) translateY(-100%)",transformOrigin:"right top"}}}function gg(t){var e,i,r,n,s,o,a,l,u,h,d,v,c=t.survey,f=t.forceDisableHtml,g=t.posthog,m=t.style,y=void 0===m?{}:m,_=t.previewPageIndex,b=t.removeSurveyFromFocus,w=void 0===b?()=>{}:b,k=t.isPopup,S=void 0===k||k,x=t.onPreviewSubmit,C=void 0===x?()=>{}:x,T=t.onPreviewBack,E=void 0===T?()=>{}:T,M=t.onPopupSurveyDismissed,I=void 0===M?()=>{}:M,R=t.onCloseConfirmationMessage,P=void 0===R?()=>{}:R,A=t.properties,O=t.isSurveyCompleted,F=t.skipShownEvent,L=t.surveyLanguage,D=Vc(null),N=Number.isInteger(_),q=null!=(e=c.appearance)&&e.surveyPopupDelaySeconds?1e3*c.appearance.surveyPopupDelaySeconds:0,j=function(t,e,i,r,n,s,o,a,l){var u=zc(r||0===i||t.type===uf.ExternalSurvey),h=u[0],d=u[1],v=zc(!1),c=v[0],f=v[1],g=Vc(!1),m=()=>{var e=()=>{s&&n(t),d(!1)};if(!g.current){var i=null==o?void 0:o.current;i?(g.current=!0,i.style.transition="opacity "+fg+"ms ease-out",i.style.opacity="0",setTimeout((()=>{g.current=!1,e()}),fg+50)):e()}},y=e=>{e.detail.surveyId===t.id&&m()};return Wc((()=>{if(e){if(!r){var n,s=e=>{var i,r;if(e.detail.surveyId===t.id){if(null==(i=t.appearance)||!i.displayThankYouMessage)return m();f(!0),null!=(r=t.appearance)&&r.autoDisappear&&(n&&clearTimeout(n),n=setTimeout(m,5e3))}},o=()=>{if(yp(t,e)){d(!0),og.dispatchEvent(new Event("PHSurveyShown")),a||e.capture(cf.SHOWN,p({[ff.SURVEY_NAME]:t.name,[ff.SURVEY_ID]:t.id,[ff.SURVEY_ITERATION]:t.current_iteration,[ff.SURVEY_ITERATION_START_DATE]:t.current_iteration_start_date},l&&{[ff.SURVEY_LANGUAGE]:l},{sessionRecordingUrl:null==e.get_session_replay_url?void 0:e.get_session_replay_url()}));try{localStorage.setItem("lastSeenSurveyDate",(new Date).toISOString())}catch(t){}}};Ki(og,"PHSurveyClosed",y),Ki(og,"PHSurveySent",s);var u=i>0?setTimeout(o,i):void 0;return at(u)&&o(),()=>{at(u)||clearTimeout(u),at(n)||clearTimeout(n),og.removeEventListener("PHSurveyClosed",y),og.removeEventListener("PHSurveySent",s)}}}else gf.error("usePopupVisibility hook called without a PostHog instance.")}),[]),cg({survey:t,removeSurveyFromFocus:n,setSurveyVisible:d,isPreviewMode:r,posthog:e}),{isPopupVisible:h,isSurveySent:c,setIsPopupVisible:d,hidePopupWithAnimation:m}}(c,g,q,N,w,S,D,F,L),B=j.isPopupVisible,U=j.hidePopupWithAnimation,H=j.isSurveySent||_===c.questions.length||!0===O,z=zc(!1),W=z[0],V=z[1],G=Gc((()=>!!wp(c)),[c]),Z=!!(null!=(i=c.appearance)&&i.introScreenHeader||null!=(r=c.appearance)&&r.introScreenDescription),Q=N?_===sg:!(null==(n=c.appearance)||!n.displayIntroScreen)&&Z&&!W&&!G,J=Gc((()=>{var t=wp(c),e=(null==t?void 0:t.surveySubmissionId)||Pf();return{isPreviewMode:N,previewPageIndex:_,onPopupSurveyDismissed(){L?up(c,g,N,L):up(c,g,N),I()},isPopup:S||!1,surveySubmissionId:e,onPreviewSubmit:C,onPreviewBack:E,posthog:g,properties:A,surveyLanguage:L}}),[N,_,S,g,c,I,C,E,A,L]);return B?Ep(pp.Provider,{value:J,children:Ep("div",{className:"ph-survey",style:p({},Cp(c.type,null==(s=c.appearance)?void 0:s.position,null==(o=c.appearance)?void 0:o.widgetType),y),ref:D,children:H?Ep(Up,{header:(null==(a=c.appearance)?void 0:a.thankYouMessageHeader)||"Thank you!",description:(null==(l=c.appearance)?void 0:l.thankYouMessageDescription)||"",forceDisableHtml:!!f,contentType:null==(u=c.appearance)?void 0:u.thankYouMessageDescriptionContentType,appearance:c.appearance||ip,onClose(){U(),P()}}):Q?Ep(Hp,{header:(null==(h=c.appearance)?void 0:h.introScreenHeader)||"",description:(null==(d=c.appearance)?void 0:d.introScreenDescription)||"",forceDisableHtml:!!f,contentType:null==(v=c.appearance)?void 0:v.introScreenDescriptionContentType,appearance:c.appearance||ip,onStart:()=>V(!0)}):Ep(mg,{survey:c,forceDisableHtml:!!f,posthog:g})})}):null}function mg(t){var e,i,r=t.survey,n=t.forceDisableHtml,s=t.posthog,o=Gc((()=>{var t=wp(r);if(!t)return null;var e=vt(t.lastQuestionIndex);return!e||e&&t.lastQuestionIndex>=0&&r.questions.length>t.lastQuestionIndex?t:(Sp(r),null)}),[r]),a=zc((()=>(null!=o&&o.responses&&gf.info("Survey is already in progress, filling in initial responses"),(null==o?void 0:o.responses)||{}))),l=a[0],u=a[1],h=Zc(pp),d=h.previewPageIndex,v=h.onPopupSurveyDismissed,c=h.isPopup,f=h.onPreviewSubmit,g=h.onPreviewBack,m=h.surveySubmissionId,y=h.isPreviewMode,_=h.properties,b=h.surveyLanguage,w=zc((()=>{var t=null==o?void 0:o.lastQuestionIndex,e=vt(t)&&t>=0&&r.questions.length>t?t:0;return vt(d)&&d>=0?d:e})),k=w[0],S=w[1],x=zc((()=>{var t;return(null!==(t=null==o?void 0:o.visitedIndices)&&void 0!==t?t:[]).filter((t=>t>=0&&r.questions.length>t))})),C=x[0],T=x[1],E=Gc((()=>cp(r)),[r]);Wc((()=>{!y||at(d)||0>d||S(d)}),[d,y]);var M=!(null==(e=r.appearance)||!e.allowGoBack)&&(y?(null!=d?d:0)>0:C.length>0),I=E.at(k);return I?Ep("form",{className:"survey-form",name:"surveyForm",children:[c&&!0!==(null==(i=r.appearance)?void 0:i.hideCancelButton)&&Ep(jp,{onClick(){v()}}),Ep("div",{className:"survey-box","data-question-index":k,children:_g({question:I,forceDisableHtml:n,displayQuestionIndex:k,appearance:r.appearance||ip,onSubmit:t=>(t=>{var e=t.res,i=t.displayQuestionIndex,n=t.questionId;if(s)if(n){var o=ua(n),a=p({},l,{[o]:e});u(a);var h=ig(r,i,e),d=h===df.End,v=[...C,i];if(d||(T(v),S(h),bp(r,{surveySubmissionId:m,responses:a,lastQuestionIndex:h,visitedIndices:v,surveyLanguage:b})),r.enable_partial_responses||d){var c=new Set(v.map((t=>{var e;return null==(e=E[t])?void 0:e.id})).filter((t=>!!t)).map((t=>ua(t)))),f=Object.fromEntries(Object.entries(a).filter((t=>c.has(t[0]))));ap({responses:f,survey:r,surveySubmissionId:m,isSurveyCompleted:d,posthog:s,properties:_,surveyLanguage:b})}}else gf.error("onNextButtonClick called without a questionId.");else gf.error("onNextButtonClick called without a PostHog instance.")})({res:t,displayQuestionIndex:k,questionId:I.id}),onPreviewSubmit:f,initialValue:I.id?l[ua(I.id)]:void 0,canGoBack:M,onBack(){if(y)g();else if(0!==C.length){var t=C[C.length-1],e=C.slice(0,-1);T(e),S(t),bp(r,{surveySubmissionId:m,responses:l,lastQuestionIndex:t,visitedIndices:e,surveyLanguage:b})}}})})]}):null}function yg(t){var e,i,r,n,s,o,a,l=t.survey,u=t.forceDisableHtml,h=t.posthog,d=t.readOnly,v=t.surveyLanguage,c=zc(!0),f=c[0],p=c[1],g=zc(!1),m=g[0],y=g[1],_=zc({}),b=_[0],w=_[1],k=Vc(void 0),S=()=>{y(!m)};if(Wc((()=>{var t;if(h){if(!d){"tab"===(null==(t=l.appearance)?void 0:t.widgetType)&&w({top:"50%",bottom:"auto"});var e=t=>{var e,i=t;(null==(e=i.detail)?void 0:e.surveyId)===l.id&&(gf.info("Received show event for feedback button survey "+l.id),w(i.detail.position||{}),S())};return Ki(og,lg,e),()=>{at(k.current)||(clearTimeout(k.current),k.current=void 0),og.removeEventListener(lg,e)}}}else gf.error("FeedbackWidget called without a PostHog instance.")}),[h,d,l.id,null==(e=l.appearance)?void 0:e.widgetType,null==(i=l.appearance)?void 0:i.widgetSelector,null==(r=l.appearance)?void 0:r.borderColor]),cg({survey:l,setSurveyVisible:p,posthog:h}),!f)return null;var x=()=>{l.schedule!==vf.Always&&p(!1),at(k.current)||clearTimeout(k.current),k.current=setTimeout((()=>{k.current=void 0,y(!1)}),200)};return Ep(uc,{children:["tab"===(null==(n=l.appearance)?void 0:n.widgetType)&&Ep("button",{className:"ph-survey-widget-tab "+((null==(s=l.appearance)?void 0:s.tabPosition)===lf.Top?"widget-tab-top":""),onClick:S,disabled:d,style:pg(null==(o=l.appearance)?void 0:o.tabPosition),children:(null==(a=l.appearance)?void 0:a.widgetLabel)||""}),m&&Ep(gg,{posthog:h,survey:l,forceDisableHtml:u,style:b,onPopupSurveyDismissed:x,onCloseConfirmationMessage:x,surveyLanguage:v})]})}var _g=t=>{var e=t.question,i=t.onSubmit,r=t.onPreviewSubmit,n={forceDisableHtml:t.forceDisableHtml,appearance:t.appearance,onPreviewSubmit(t){r(t)},onSubmit(t){i(t)},initialValue:t.initialValue,displayQuestionIndex:t.displayQuestionIndex,canGoBack:t.canGoBack,onBack:t.onBack};switch(e.type){case hf.Open:return ac(Wp,p({},n,{question:e,key:e.id}));case hf.Link:return ac(Vp,p({},n,{question:e,key:e.id}));case hf.Rating:return ac(Gp,p({},n,{question:e,key:e.id}));case hf.SingleChoice:case hf.MultipleChoice:return ac(Qp,p({},n,{question:e,key:e.id}));default:return gf.error("Unsupported question type: "+e.type),null}};v.__PosthogExtensions__=v.__PosthogExtensions__||{},v.__PosthogExtensions__.generateSurveys=vg,v.extendPostHogWithSurveys=vg;var bg=(t,e,i)=>i.remaining>0?e.length>i.remaining?(t.push(e.slice(0,i.remaining)),i.remaining=0,i.truncated=!0,!1):(t.push(e),i.remaining-=e.length,!0):(i.truncated=!0,!1),wg=(t,e,i)=>{var r=JSON.stringify(t);if(i.remaining>=r.length)return bg(e,r,i);if(i.truncated=!0,2>i.remaining)return!1;for(var n=0,s=Math.min(t.length,i.remaining-2);s>n;){var o=Math.ceil((n+s)/2);JSON.stringify(t.slice(0,o)).length>i.remaining?s=o-1:n=o}return bg(e,JSON.stringify(t.slice(0,n)),i)},kg=t=>void 0!==t&&"function"!=typeof t&&"symbol"!=typeof t&&"bigint"!=typeof t,Sg=(t,e,i)=>{if(!i.truncated){if(i.keysRemaining-=1,i.sizeRemaining-=String(e).length+t.length,0>=i.keysRemaining||0>=i.sizeRemaining)return i.truncated=!0,void(i.result.attributes_truncated=!0);i.result[t]=e}},xg=(t,e,i)=>{if(!i.truncated)if(st(t)){if(i.seen.has(t))return void Sg(e||"circular","[Circular]",i);i.seen.add(t);try{for(var r in t)try{if(!{}.hasOwnProperty.call(t,r))continue;if(xg(t[r],e?e+"."+r:r,i),i.truncated)return}catch(t){continue}}catch(t){}}else Sg(e,t,i)},Cg=function(t,e,i,r,n,s){if(void 0===n&&(n=!1),!kg(t))return!n||bg(e,"null",i);if(ht(t)||(t=>{try{return vt(t)||ft(t)}catch(t){return!1}})(t))return bg(e,JSON.stringify(t),i);if("string"==typeof t)return wg(t,e,i);if(!st(t)&&!rt(t))return bg(e,JSON.stringify(t),i);if(r.has(t))return wg("[Circular]",e,i);r.add(t);try{var o=t.toJSON;if(nt(o))return Cg(o.call(t),e,i,r,n)}catch(t){}try{var a={}.toString.call(t);if("[object String]"===a)return wg(String(t.valueOf()),e,i);if("[object Number]"===a||"[object Boolean]"===a)return bg(e,JSON.stringify(t.valueOf()),i)}catch(t){}if(t instanceof Error){var l={};try{for(var u in t)({}).hasOwnProperty.call(t,u)&&(l[u]=t[u])}catch(t){}try{l.name=t.name}catch(t){}try{l.message=t.message}catch(t){}try{l.stack=t.stack}catch(t){}return Cg(l,e,i,r,n,s)}if(rt(t)){if(!bg(e,"[",i))return!1;for(var h=0;t.length>h;h++){if(h>0&&!bg(e,",",i))return!1;var d=void 0;try{d=t[h]}catch(t){d=void 0}if(!Cg(d,e,i,r,!0))return!1}return bg(e,"]",i)}if(!bg(e,"{",i))return!1;var v=!0;try{for(var c in t)if({}.hasOwnProperty.call(t,c)){if(0>=i.remaining)return i.truncated=!0,!1;var f=void 0;try{f=t[c]}catch(t){continue}if(s)try{xg(f,c,s)}catch(t){}if(kg(f)){var p=(v?"":",")+JSON.stringify(c)+":";if(p.length>=i.remaining)return i.truncated=!0,!1;var g=e.length,m=i.remaining,y=i.truncated;if(!bg(e,p,i))return!1;var _=e.length,b=Cg(f,e,i,r,!1),w=i.truncated;if(e.length!==_){if(v=!1,!b)return!1}else if(e.length=g,i.remaining=m,i.truncated=b?y:w,!b)return!1}}}catch(t){}return bg(e,"}",i)},Tg={debug:"debug",log:"info",warn:"warn",error:"error",info:"info"};v.__PosthogExtensions__=v.__PosthogExtensions__||{},v.__PosthogExtensions__.logs={initializeLogs(t){var e={host:v.location.host},i=!1,r=function(r){var n=v.console[r],s=(n=>function(){for(var s=!1,o=arguments.length,a=new Array(o),l=0;o>l;l++)a[l]=arguments[l];try{if(a.length>0&&!i&&t.is_capturing()){var u;i=!0,s=!0;var h=((t,e)=>{for(var i=[],r={remaining:1e4,truncated:!1},n=st(t[0])?{result:{},keysRemaining:50,sizeRemaining:1e4,truncated:!1,seen:new WeakSet([t[0]])}:void 0,s=0;t.length>s&&(0>=s||bg(i," ",r))&&Cg(t[s],i,r,new WeakSet,!1,0===s?n:void 0);s++);return{body:i.join("")+(r.truncated?"...":""),truncated:r.truncated,attributes:(null==n?void 0:n.result)||{}}})(a),d=h.body,c=h.attributes,f=p({},e,h.truncated?{body_truncated:"true"}:{});null==(u=t.logs)||u.vi({level:Tg[r],body:d,attributes:p({"log.source":"console."+r},f,c)})}}catch(t){}finally{s&&(i=!1),n.apply(v.console,a)}})(n);s.__rrweb_original__=(t=>{for(;null!=(e=t)&&e.__rrweb_original__;){var e;t=t.__rrweb_original__}return t})(n),v.console[r]=s};for(var n of Object.keys(Tg))r(n)}};var Eg=Bi("[Error tracking]"),Mg=["chrome-extension://","moz-extension://","safari-extension:","safari-web-extension:"],Ig=["__firefox__","__gCrWeb"];function Rg(){return new ai([new bi,new Ri,new ki,new wi,new Mi,new Ei,new xi,new Ii],function(t){for(var e=arguments.length,i=new Array(e>1?e-1:0),r=1;e>r;r++)i[r-1]=arguments[r];return function(e,r){void 0===r&&(r=0);for(var n=[],s=e.split("\n"),o=r;s.length>o;o++){var a=s[o];if(1024>=a.length){var l=yi.test(a)?a.replace(yi,"$1"):a;if(!l.match(/\S*Error: /)){for(var u of i){var h=u(l,t);if(h){n.push(h);break}}if(n.length>=_i)break}}}return function(t){if(!t.length)return[];var e=Array.from(t);return e.reverse(),e.slice(0,_i).map((t=>{return p({},t,{filename:t.filename||(i=e,i[i.length-1]||{}).filename,function:t.function||li});var i}))}(n)}}("web:javascript",fi,mi))}var Pg=Bi("[ExceptionAutocapture]"),Ag=Rg(),Og=e=>{var i=t;i||Pg.info("window not available, cannot wrap onerror");var r=i.onerror;return i.onerror=function(){for(var t,i=arguments.length,n=new Array(i),s=0;i>s;s++)n[s]=arguments[s];var o=Ag.buildFromUnknown((t=>{var e=t[0],i=t[1],r=t[2],n=t[3],s=t[4];if(null!=s)return s;if(lt(e)&&lt(i)&&i.length>0&&"undefined"!=typeof ErrorEvent)try{return new ErrorEvent("error",{message:e,filename:i,lineno:r,colno:n})}catch(t){return e}return e})(n),{mechanism:{handled:!1}});return e(o),!!nt(r)&&null!==(t=r(...n))&&void 0!==t&&t},i.onerror.__POSTHOG_INSTRUMENTED__=!0,()=>{var t;null==(t=i.onerror)||delete t.__POSTHOG_INSTRUMENTED__,i.onerror=r}},Fg=function(e,i){void 0===i&&(i=!1);var r=t;r||Pg.info("window not available, cannot wrap onUnhandledRejection");var n=r.onunhandledrejection;return r.onunhandledrejection=function(t){var r,s=Ag.buildFromUnknown(t,{mechanism:{handled:!1}});return e(s),nt(n)?null!==(r=n(t))&&void 0!==r&&r:i},r.onunhandledrejection.__POSTHOG_INSTRUMENTED__=!0,()=>{var t;null==(t=r.onunhandledrejection)||delete t.__POSTHOG_INSTRUMENTED__,r.onunhandledrejection=n}},Lg={wrapOnError:Og,wrapUnhandledRejection:Fg,wrapConsoleError(t){var e=console;e||Pg.info("console not available, cannot wrap console.error");var i=e.error;return e.error=function(){for(var e,r=arguments.length,n=new Array(r),s=0;r>s;s++)n[s]=arguments[s];e=1==n.length?n[0]:n.join(" ");var o=n.find((t=>t instanceof Error)),a=Ag.buildFromUnknown(o||e,{mechanism:{handled:!1},syntheticException:new Error("PostHog syntheticException"),skipFirstLines:2});t(a),nt(i)&&i(...n)},e.error.__POSTHOG_INSTRUMENTED__=!0,()=>{var t;null==(t=e.error)||delete t.__POSTHOG_INSTRUMENTED__,e.error=i}}};v.__PosthogExtensions__=v.__PosthogExtensions__||{},v.__PosthogExtensions__.errorWrappingFunctions=Lg,v.posthogErrorWrappingFunctions=Lg;var $g=(t,e)=>{if(nt(null==t?void 0:t.capture)){var i=null==e?void 0:e.autocaptureExceptions,r=!ht(i)&&"object"==typeof i&&rt(i.errors_to_ignore)?i.errors_to_ignore.reduce(((t,e)=>{try{t.push(new RegExp(e))}catch(t){Pg.error("Ignoring invalid legacy exception exclusion rule",e,t)}return t}),[]):[],n=e=>{try{null==t.capture||t.capture("$exception",e,{_noTruncate:!0,_batchKey:"exceptionEvent",_noHeatmaps:!0})}catch(t){Pg.error("Failed to capture exception for a legacy client",t)}};Og((t=>{r.some((e=>t.$exception_list.some((t=>e.test(t.value||"")))))||n(t)})),Fg(n,!0)}};v.extendPostHogWithExceptionAutoCapture=$g,v.extendPostHogWithExceptionAutocapture=$g;var Dg="X-POSTHOG-SESSION-ID",Ng="X-POSTHOG-WINDOW-ID",qg="X-POSTHOG-DISTINCT-ID",jg=[Dg,Ng,qg],Bg=["attributionReporting","body","browsingTopics","cache","credentials","dispatcher","duplex","integrity","keepalive","method","mode","priority","redirect","referrer","referrerPolicy","signal","window"],Ug=(t,e)=>({}.hasOwnProperty.call(t,e)),Hg=t=>"object"==typeof t&&!ht(t)||nt(t),zg=t=>"undefined"!=typeof Request&&(t instanceof Request||"[object Request]"==={}.toString.call(t)),Wg=e=>{try{var i;return zg(e)?e.url:new URL(e instanceof URL?e.toString():String(e),null==t||null==(i=t.location)?void 0:i.href).toString()}catch(t){return}},Vg=(t,e,i,r,n)=>{var s;try{s=new URL(r).hostname}catch(t){return!1}if(!t)return!1;if(rt(t)&&!t.includes(s))return!1;var o=!1;if(i){var a=i.checkAndGetSessionAndWindowId(!0),l=a.windowId;n.set(Dg,a.sessionId),n.set(Ng,l),o=!0}var u=(t=>nt(t)?t():t)(e);return u&&u!==_s&&(n.set(qg,u),o=!0),o};v.__PosthogExtensions__=v.__PosthogExtensions__||{};var Gg={_patchFetch:(e,i,r)=>cv(t,"fetch",(t=>function(n,s){var o=arguments.length>1?[n,s]:[n],a=o;try{var l=Wg(n);if(l)if(zg(n)){var u=new Request(n,s);Vg(e,i,r,u.url,u.headers),a=[u]}else{var h=new Headers(Hg(s)?s.headers:void 0);if(Vg(e,i,r,l,h)){var d=((t,e)=>{if(at(t)||ht(t))return{headers:e};if(Hg(t)){var i=t;if("undefined"==typeof Proxy||"undefined"==typeof Reflect){var r=Object.create(i);return Object.defineProperty(r,"headers",{configurable:!0,enumerable:!0,value:e,writable:!0}),r}return new Proxy({headers:e},{get:(t,e)=>Ug(t,e)?Reflect.get(t,e):Reflect.get(i,e,i),has:(t,e)=>Ug(t,e)||e in i,ownKeys(t){var e=new Set(Reflect.ownKeys(t));return Reflect.ownKeys(i).forEach((t=>e.add(t))),Bg.forEach((t=>{t in i&&e.add(t)})),Array.from(e)},getOwnPropertyDescriptor(t,e){var r=Reflect.getOwnPropertyDescriptor(t,e);if(r)return r;if("string"==typeof e&&Bg.includes(e)&&e in i)return{configurable:!0,enumerable:!0,get(){return Reflect.get(i,e,i)}};var n=Reflect.getOwnPropertyDescriptor(i,e);return n?p({},n,{configurable:!0}):void 0},getPrototypeOf:()=>Object.getPrototypeOf(i)})}})(s,h);d&&(a=[n,d])}}}catch(t){a=o}return t.apply(this,a)})),_patchXHR:(e,i,r)=>cv(t.XMLHttpRequest.prototype,"open",(t=>function(n,s,o,a,l){void 0===o&&(o=!0);var u=this,h=new Headers,d=Wg(s);d&&Vg(e,i,r,d,h);var v=t.call(u,n,s,o,a,l);return jg.forEach((t=>{var e=h.get(t);if(e)try{u.setRequestHeader(t,e)}catch(t){}})),v}))};v.__PosthogExtensions__.tracingHeadersPatchFns=Gg,v.postHogTracingHeadersPatchFns=Gg,"function"!=typeof[].at&&Object.defineProperty(Array.prototype,"at",{value(t){var e=this.length,i=Math.trunc(t)||0;return 0>i&&(i+=e),0>i||i>=e?void 0:this[i]},writable:!0,enumerable:!1,configurable:!0});let Zg=class{constructor(){this.t=void 0,this.o=0,this.i=[]}l(t){var e;if(!t.hadRecentInput){var i=this.i[0],r=this.i.at(-1);this.o&&i&&r&&1e3>t.startTime-r.startTime&&5e3>t.startTime-i.startTime?(this.o+=t.value,this.i.push(t)):(this.o=t.value,this.i=[t]),null==(e=this.t)||e.call(this,t)}}};var Qg=()=>{var t=performance.getEntriesByType("navigation")[0];if(t&&t.responseStart>0&&t.responseStart<performance.now())return t},Jg=t=>{if("loading"===document.readyState)return"loading";var e=Qg();if(e){if(e.domInteractive>t)return"loading";if(0===e.domContentLoadedEventStart||e.domContentLoadedEventStart>t)return"dom-interactive";if(0===e.domComplete||e.domComplete>t)return"dom-content-loaded"}return"complete"},Kg=t=>{var e=t.nodeName;return 1===t.nodeType?e.toLowerCase():e.toUpperCase().replace(/^#/,"")},Yg=t=>{var e="";try{for(;9!==(null==(i=t)?void 0:i.nodeType);){var i,r,n=t,s=n.id?"#"+n.id:[Kg(n),...Array.from(null!==(r=n.classList)&&void 0!==r?r:[]).sort()].join(".");if(e.length+s.length>99)return e||s;if(e=e?s+">"+e:s,n.id)break;t=n.parentNode}}catch(t){}return e},Xg=new WeakMap;function tm(t,e){var i=Xg.get(e);return i||(i=new WeakMap,Xg.set(e,i)),i.get(t)||i.set(t,new e),i.get(t)}var em=-1,im=()=>em,rm=t=>{addEventListener("pageshow",(e=>{e.persisted&&(em=e.timeStamp,t(e))}),!0)},nm=(t,e,i,r)=>{var n,s;return o=>{e.value>=0&&(o||r)&&((s=e.value-(null!=n?n:0))||void 0===n)&&(n=e.value,e.delta=s,e.rating=((t,e)=>t>e[1]?"poor":t>e[0]?"needs-improvement":"good")(e.value,i),t(e))}},sm=t=>{requestAnimationFrame((()=>requestAnimationFrame(t)))},om=()=>{var t,e;return null!==(t=null==(e=Qg())?void 0:e.activationStart)&&void 0!==t?t:0},am=-1,lm=new Set,um=()=>"hidden"!==document.visibilityState||document.prerendering?1/0:0,hm=t=>{if("hidden"===document.visibilityState){if("visibilitychange"===t.type)for(var e of lm)e();isFinite(am)||(am="visibilitychange"===t.type?t.timeStamp:0,removeEventListener("prerenderingchange",hm,!0))}},dm=function(t){if(void 0===t&&(t=!1),t&&(am=1/0),0>am){var e,i=om(),r=document.prerendering||null==(e=globalThis.performance.getEntriesByType("visibility-state").find((t=>"hidden"===t.name&&t.startTime>=i)))?void 0:e.startTime;am=null!=r?r:um(),addEventListener("visibilitychange",hm,!0),addEventListener("prerenderingchange",hm,!0),rm((()=>{setTimeout((()=>{am=um()}))}))}return{get firstHiddenTime(){return am},onHidden(t){lm.add(t)}}},vm=function(t,e,i,r,n,s,o){void 0===e&&(e=-1),void 0===r&&(r=0);var a=Qg(),l=(null==a?void 0:a.navigationId)||0,u="navigate";return i?u=i:0>im()?a&&(document.prerendering||om()>0?u="prerender":document.wasDiscarded?u="restore":a.type&&(u=a.type.replace(/_/g,"-"))):u="back-forward-cache",{name:t,value:e,rating:"good",delta:0,entries:[],id:"v6-"+Date.now()+"-"+(Math.floor(8999999999999*Math.random())+1e12),navigationType:u,navigationId:r||l,navigationInteractionId:n,navigationURL:s||(null==a?void 0:a.name),navigationStartTime:o||0}},cm=function(t,e,i){void 0===i&&(i={});try{var r=t.filter((t=>PerformanceObserver.supportedEntryTypes.includes(t)));if(r.length>0){var n=new PerformanceObserver((t=>{queueMicrotask((()=>{var i=t.getEntries();r.length>1&&i.sort(((t,e)=>t.startTime+t.duration-(e.startTime+e.duration))),e(i)}))}));for(var s of r)n.observe(p({type:s,buffered:!0},i));return n}}catch(t){}},fm=t=>{var e;return PerformanceObserver.supportedEntryTypes.includes("soft-navigation")&&"function"==typeof(null==(e=globalThis.PerformanceSoftNavigation)||null==(e=e.prototype)?void 0:e.getLargestInteractionContentfulPaint)&&t&&t.reportSoftNavs},pm=(t,e)=>{if(t.set(e.navigationId,e),t.size>2){var i=t.keys().next().value;void 0!==i&&t.delete(i)}},gm=t=>{var e=!1;return()=>{e||(t(),e=!0)}};let mm=class{constructor(){this.u=void 0}};var ym,_m=t=>{document.prerendering?addEventListener("prerenderingchange",t,!0):t()},bm=[1800,3e3],wm=function(t,e){void 0===e&&(e={});var i=fm(e);_m((()=>{var r,n=tm(e,mm),s=dm(),o=vm("FCP"),a=cm(["paint"],(t=>{for(var e of t)"first-contentful-paint"===e.name&&(a.disconnect(),s.firstHiddenTime>e.startTime&&(o.value=Math.max(e.startTime-om(),0),o.entries.push(e),o.navigationId=e.navigationId||o.navigationId,r(!0)))}));a&&(r=nm(t,o,bm,e.reportAllChanges),rm((i=>{o=vm("FCP",-1,"back-forward-cache",o.navigationId,o.navigationInteractionId,o.navigationURL,im()),r=nm(t,o,bm,e.reportAllChanges),sm((()=>{o.value=performance.now()-i.timeStamp,r(!0)}))}))),i&&cm(["soft-navigation"],(i=>{i.forEach((i=>{n.u&&i.navigationId&&pm(n.u,i);var s=Math.max((i.presentationTime||i.paintTime||0)-i.startTime,0);o=vm("FCP",s,"soft-navigation",i.navigationId,i.interactionId,i.name,i.startTime),(r=nm(t,o,bm,e.reportAllChanges))(!0)}))}),e)}))},km=[.1,.25],Sm=t=>t.find((t=>{var e;return 1===(null==(e=t.node)?void 0:e.nodeType)}))||t[0],xm=0,Cm=1/0,Tm=0,Em=t=>{for(var e of t)e.interactionId&&(Cm=Math.min(Cm,e.interactionId),Tm=Math.max(Tm,e.interactionId),xm=Tm?(Tm-Cm)/7+1:0)},Mm=()=>{var t;return ym?xm:null!==(t=performance.interactionCount)&&void 0!==t?t:0},Im=0;let Rm=class{constructor(){this.h=[],this.v=new Map,this.p=void 0,this.m=void 0}M(){Im=Mm(),this.h.length=0,this.v.clear()}T(t){var e=Mm()-Im,i=Math.min(this.h.length-1,Math.floor(e/50));return!e||-1!==i||"soft-navigation"!==t&&"back-forward-cache"!==t?this.h[i]:{D:8,id:-1,entries:[]}}l(t){var e;if(null!=(e=this.p)&&e.call(this,t),t.interactionId||"first-input"===t.entryType){var i=this.h.at(-1),r=this.v.get(t.interactionId);if(r||10>this.h.length||t.duration>i.D){var n;if(r?t.duration>r.D?(r.entries=[t],r.D=t.duration):t.duration===r.D&&t.startTime===r.entries[0].startTime&&r.entries.push(t):(this.v.set((r={id:t.interactionId,entries:[t],D:t.duration}).id,r),this.h.push(r)),this.h.sort(((t,e)=>e.D-t.D)),this.h.length>10){var s=this.h.splice(10);for(var o of s)this.v.delete(o.id)}null==(n=this.m)||n.call(this,r)}}}};var Pm=t=>{var e="requestIdleCallback"in globalThis?1e3:0,i=globalThis.requestIdleCallback||setTimeout,r=globalThis.cancelIdleCallback||clearTimeout;if("hidden"===document.visibilityState)t();else{var n=gm(t),s=-1,o=()=>{r(s),n()};addEventListener("visibilitychange",o,{once:!0,capture:!0}),s=i((()=>{removeEventListener("visibilitychange",o,{capture:!0}),n()}),{timeout:e})}},Am=[200,500];let Om=class{constructor(){this.p=void 0,this.u=void 0}l(t){var e;null==(e=this.p)||e.call(this,t)}};var Fm=[2500,4e3],Lm=-1,$m=()=>Lm,Dm=t=>{addEventListener("pageshow",(e=>{e.persisted&&(Lm=e.timeStamp,t(e))}),!0)},Nm=(t,e,i,r)=>{var n,s;return o=>{e.value>=0&&(o||r)&&((s=e.value-(null!=n?n:0))||void 0===n)&&(n=e.value,e.delta=s,e.rating=((t,e)=>t>e[1]?"poor":t>e[0]?"needs-improvement":"good")(e.value,i),t(e))}},qm=t=>{requestAnimationFrame((()=>requestAnimationFrame(t)))},jm=()=>{var t=performance.getEntriesByType("navigation")[0];if(t&&t.responseStart>0&&t.responseStart<performance.now())return t},Bm=()=>{var t,e;return null!==(t=null==(e=jm())?void 0:e.activationStart)&&void 0!==t?t:0},Um=-1,Hm=new Set,zm=()=>"hidden"!==document.visibilityState||document.prerendering?1/0:0,Wm=t=>{if("hidden"===document.visibilityState){if("visibilitychange"===t.type)for(var e of Hm)e();isFinite(Um)||(Um="visibilitychange"===t.type?t.timeStamp:0,removeEventListener("prerenderingchange",Wm,!0))}},Vm=function(t){if(void 0===t&&(t=!1),t&&(Um=1/0),0>Um){var e,i=Bm(),r=document.prerendering||null==(e=globalThis.performance.getEntriesByType("visibility-state").find((t=>"hidden"===t.name&&t.startTime>=i)))?void 0:e.startTime;Um=null!=r?r:zm(),addEventListener("visibilitychange",Wm,!0),addEventListener("prerenderingchange",Wm,!0),Dm((()=>{setTimeout((()=>{Um=zm()}))}))}return{get firstHiddenTime(){return Um},onHidden(t){Hm.add(t)}}},Gm=function(t,e,i,r,n,s,o){void 0===e&&(e=-1),void 0===r&&(r=0);var a=jm(),l=(null==a?void 0:a.navigationId)||0,u="navigate";return i?u=i:0>$m()?a&&(document.prerendering||Bm()>0?u="prerender":document.wasDiscarded?u="restore":a.type&&(u=a.type.replace(/_/g,"-"))):u="back-forward-cache",{name:t,value:e,rating:"good",delta:0,entries:[],id:"v6-"+Date.now()+"-"+(Math.floor(8999999999999*Math.random())+1e12),navigationType:u,navigationId:r||l,navigationInteractionId:n,navigationURL:s||(null==a?void 0:a.name),navigationStartTime:o||0}},Zm=new WeakMap;function Qm(t,e){var i=Zm.get(e);return i||(i=new WeakMap,Zm.set(e,i)),i.get(t)||i.set(t,new e),i.get(t)}let Jm=class{constructor(){this.t=void 0,this.i=0,this.o=[]}h(t){var e;if(!t.hadRecentInput){var i=this.o[0],r=this.o.at(-1);this.i&&i&&r&&1e3>t.startTime-r.startTime&&5e3>t.startTime-i.startTime?(this.i+=t.value,this.o.push(t)):(this.i=t.value,this.o=[t]),null==(e=this.t)||e.call(this,t)}}};var Km=function(t,e,i){void 0===i&&(i={});try{var r=t.filter((t=>PerformanceObserver.supportedEntryTypes.includes(t)));if(r.length>0){var n=new PerformanceObserver((t=>{queueMicrotask((()=>{var i=t.getEntries();r.length>1&&i.sort(((t,e)=>t.startTime+t.duration-(e.startTime+e.duration))),e(i)}))}));for(var s of r)n.observe(p({type:s,buffered:!0},i));return n}}catch(t){}},Ym=t=>{var e;return PerformanceObserver.supportedEntryTypes.includes("soft-navigation")&&"function"==typeof(null==(e=globalThis.PerformanceSoftNavigation)||null==(e=e.prototype)?void 0:e.getLargestInteractionContentfulPaint)&&t&&t.reportSoftNavs},Xm=(t,e)=>{if(t.set(e.navigationId,e),t.size>2){var i=t.keys().next().value;void 0!==i&&t.delete(i)}},ty=t=>{var e=!1;return()=>{e||(t(),e=!0)}};let ey=class{constructor(){this.l=void 0}};var iy,ry=t=>{document.prerendering?addEventListener("prerenderingchange",t,!0):t()},ny=[1800,3e3],sy=function(t,e){void 0===e&&(e={});var i=Ym(e);ry((()=>{var r,n=Qm(e,ey),s=Vm(),o=Gm("FCP"),a=Km(["paint"],(t=>{for(var e of t)"first-contentful-paint"===e.name&&(a.disconnect(),s.firstHiddenTime>e.startTime&&(o.value=Math.max(e.startTime-Bm(),0),o.entries.push(e),o.navigationId=e.navigationId||o.navigationId,r(!0)))}));a&&(r=Nm(t,o,ny,e.reportAllChanges),Dm((i=>{o=Gm("FCP",-1,"back-forward-cache",o.navigationId,o.navigationInteractionId,o.navigationURL,$m()),r=Nm(t,o,ny,e.reportAllChanges),qm((()=>{o.value=performance.now()-i.timeStamp,r(!0)}))}))),i&&Km(["soft-navigation"],(i=>{i.forEach((i=>{n.l&&i.navigationId&&Xm(n.l,i);var s=Math.max((i.presentationTime||i.paintTime||0)-i.startTime,0);o=Gm("FCP",s,"soft-navigation",i.navigationId,i.interactionId,i.name,i.startTime),(r=Nm(t,o,ny,e.reportAllChanges))(!0)}))}),e)}))},oy=[.1,.25],ay=function(t,e){void 0===e&&(e={});var i=Vm();sy(ty((()=>{var r,n=Gm("CLS",0),s=Qm(e,Jm),o=(i,o,a,l,u)=>{n=Gm("CLS",0,i,o,a,l,u),s.i=0,r=Nm(t,n,oy,e.reportAllChanges)},a=function(t){void 0===t&&(t=!1),s.i>n.value&&(n.value=s.i,n.entries=s.o),r(t)},l=t=>{a(!0),o("soft-navigation",t.navigationId,t.interactionId,t.name,t.startTime)},u=t=>{for(var e of t)"soft-navigation"!==e.entryType?s.h(e):l(e);a()},h=["layout-shift"];Ym(e)&&h.push("soft-navigation");var d=Km(h,u);d&&(r=Nm(t,n,oy,e.reportAllChanges),i.onHidden((()=>{u(d.takeRecords()),r(!0)})),Dm((()=>{o("back-forward-cache",n.navigationId,n.navigationInteractionId,n.navigationURL,$m()),qm(r)})),setTimeout(r))})))},ly=0,uy=1/0,hy=0,dy=t=>{for(var e of t)e.interactionId&&(uy=Math.min(uy,e.interactionId),hy=Math.max(hy,e.interactionId),ly=hy?(hy-uy)/7+1:0)},vy=()=>{var t;return iy?ly:null!==(t=performance.interactionCount)&&void 0!==t?t:0},cy=0;let fy=class{constructor(){this.u=[],this.v=new Map,this.m=void 0,this.p=void 0}T(){cy=vy(),this.u.length=0,this.v.clear()}M(t){var e=vy()-cy,i=Math.min(this.u.length-1,Math.floor(e/50));return!e||-1!==i||"soft-navigation"!==t&&"back-forward-cache"!==t?this.u[i]:{_:8,id:-1,entries:[]}}h(t){var e;if(null!=(e=this.m)&&e.call(this,t),t.interactionId||"first-input"===t.entryType){var i=this.u.at(-1),r=this.v.get(t.interactionId);if(r||10>this.u.length||t.duration>i._){var n;if(r?t.duration>r._?(r.entries=[t],r._=t.duration):t.duration===r._&&t.startTime===r.entries[0].startTime&&r.entries.push(t):(this.v.set((r={id:t.interactionId,entries:[t],_:t.duration}).id,r),this.u.push(r)),this.u.sort(((t,e)=>e._-t._)),this.u.length>10){var s=this.u.splice(10);for(var o of s)this.v.delete(o.id)}null==(n=this.p)||n.call(this,r)}}}};var py=t=>{var e="requestIdleCallback"in globalThis?1e3:0,i=globalThis.requestIdleCallback||setTimeout,r=globalThis.cancelIdleCallback||clearTimeout;if("hidden"===document.visibilityState)t();else{var n=ty(t),s=-1,o=()=>{r(s),n()};addEventListener("visibilitychange",o,{once:!0,capture:!0}),s=i((()=>{removeEventListener("visibilitychange",o,{capture:!0}),n()}),{timeout:e})}},gy=[200,500],my=function(t,e){if(void 0===e&&(e={}),globalThis.PerformanceEventTiming&&"interactionId"in PerformanceEventTiming.prototype){var i=Vm();ry((()=>{var r;"interactionCount"in performance||iy||(iy=Km(["event"],dy,{durationThreshold:0}));var n,s=Gm("INP"),o=Qm(e,fy),a=(i,r,a,l,u)=>{o.T(),s=Gm("INP",-1,i,r,a,l,u),n=Nm(t,s,gy,e.reportAllChanges)},l=()=>{var t=o.M(s.navigationType);t&&t._!==s.value&&(s.value=t._,s.entries=t.entries,n())},u=t=>{l(),n(!0),a("soft-navigation",t.navigationId,t.interactionId,t.name,t.startTime)},h=function(t,e){void 0===e&&(e=!1),py((()=>{for(var i of t)"soft-navigation"!==i.entryType?o.h(i):u(i);l(),e&&n(!0)}))},d=["event","first-input"];Ym(e)&&d.push("soft-navigation");var v=Km(d,h,p({},e,{durationThreshold:null!==(r=e.durationThreshold)&&void 0!==r?r:40}));n=Nm(t,s,gy,e.reportAllChanges),v&&(i.onHidden((()=>{h(v.takeRecords(),!0)})),Dm((()=>{a("back-forward-cache",s.navigationId,s.navigationInteractionId,s.navigationURL,$m())})))}))}};let yy=class{constructor(){this.m=void 0,this.l=void 0}h(t){var e;null==(e=this.m)||e.call(this,t)}};var _y=[2500,4e3],by=function(t,e){void 0===e&&(e={});var i=!1,r=Ym(e);ry((()=>{var n,s=Vm(),o=Gm("LCP"),a=Qm(e,yy),l=(r,a,l,u,h)=>{o=Gm("LCP",-1,r,a,l,u,h),n=Nm(t,o,_y,e.reportAllChanges),i=!1,"soft-navigation"===r&&(s=Vm(!0))},u=t=>{a.l&&t.navigationId&&Xm(a.l,t),i||n(!0),l("soft-navigation",t.navigationId,t.interactionId,t.name,t.startTime);var e=null==t.getLargestInteractionContentfulPaint?void 0:t.getLargestInteractionContentfulPaint();e&&h([e])},h=t=>{for(var i of(e.reportAllChanges||r||(t=t.slice(-1)),t))if(i)if("soft-navigation"!==i.entryType){var l=0,h=[],d=i.startTime;if("largest-contentful-paint"===i.entryType)l=Math.max(i.startTime-Bm(),0),a.h(i),h=[i];else if("interaction-contentful-paint"===i.entryType){var v,c=i;if(!o.navigationId)continue;if("interactionId"in c&&c.interactionId!=o.navigationInteractionId)continue;d=(null==(v=c.largestContentfulPaint)?void 0:v.renderTime)||0,l=Math.max(d-i.startTime,0),c.largestContentfulPaint&&(a.h(c.largestContentfulPaint),h=[c.largestContentfulPaint])}s.firstHiddenTime>d&&(o.value=l,o.entries=h,n())}else u(i)},d=["largest-contentful-paint"];r&&d.push("interaction-contentful-paint","soft-navigation");var v=Km(d,h);if(v){n=Nm(t,o,_y,e.reportAllChanges);var c=["keydown","click","visibilitychange"],f=t=>{if(t.isTrusted&&!i){var e=o.id;py((()=>{if(!i){if(!r)for(var t of(v.disconnect(),c))removeEventListener(t,f,{capture:!0});e===o.id&&(i=!0,n(!0))}}))}};for(var p of c)addEventListener(p,f,{capture:!0});Dm((r=>{l("back-forward-cache",o.navigationId,o.navigationInteractionId,o.navigationURL,$m()),n=Nm(t,o,_y,e.reportAllChanges),qm((()=>{o.value=performance.now()-r.timeStamp,i=!0,n(!0)}))}))}}))},wy={onLCP(t,e){void 0===e&&(e={});var i=tm(e=Object.assign({},e),Om),r=new WeakMap;fm(e)&&(i.u=new Map),i.p=t=>{var i=t.element;if(i){var n,s=null!==(n=null==e.generateTarget?void 0:e.generateTarget(i))&&void 0!==n?n:Yg(i);r.set(t,s)}else t.id&&r.set(t,"#"+t.id)},function(t,e){void 0===e&&(e={});var i=!1,r=fm(e);_m((()=>{var n,s=dm(),o=vm("LCP"),a=tm(e,Om),l=(r,a,l,u,h)=>{o=vm("LCP",-1,r,a,l,u,h),n=nm(t,o,Fm,e.reportAllChanges),i=!1,"soft-navigation"===r&&(s=dm(!0))},u=t=>{a.u&&t.navigationId&&pm(a.u,t),i||n(!0),l("soft-navigation",t.navigationId,t.interactionId,t.name,t.startTime);var e=null==t.getLargestInteractionContentfulPaint?void 0:t.getLargestInteractionContentfulPaint();e&&h([e])},h=t=>{for(var i of(e.reportAllChanges||r||(t=t.slice(-1)),t))if(i)if("soft-navigation"!==i.entryType){var l=0,h=[],d=i.startTime;if("largest-contentful-paint"===i.entryType)l=Math.max(i.startTime-om(),0),a.l(i),h=[i];else if("interaction-contentful-paint"===i.entryType){var v,c=i;if(!o.navigationId)continue;if("interactionId"in c&&c.interactionId!=o.navigationInteractionId)continue;d=(null==(v=c.largestContentfulPaint)?void 0:v.renderTime)||0,l=Math.max(d-i.startTime,0),c.largestContentfulPaint&&(a.l(c.largestContentfulPaint),h=[c.largestContentfulPaint])}s.firstHiddenTime>d&&(o.value=l,o.entries=h,n())}else u(i)},d=["largest-contentful-paint"];r&&d.push("interaction-contentful-paint","soft-navigation");var v=cm(d,h);if(v){n=nm(t,o,Fm,e.reportAllChanges);var c=["keydown","click","visibilitychange"],f=t=>{if(t.isTrusted&&!i){var e=o.id;Pm((()=>{if(!i){if(!r)for(var t of(v.disconnect(),c))removeEventListener(t,f,{capture:!0});e===o.id&&(i=!0,n(!0))}}))}};for(var p of c)addEventListener(p,f,{capture:!0});rm((r=>{l("back-forward-cache",o.navigationId,o.navigationInteractionId,o.navigationURL,im()),n=nm(t,o,Fm,e.reportAllChanges),sm((()=>{o.value=performance.now()-r.timeStamp,i=!0,n(!0)}))}))}}))}((e=>{t((t=>{var e={timeToFirstByte:0,resourceLoadDelay:0,resourceLoadDuration:0,elementRenderDelay:t.value};if(t.entries.length){var n,s,o,a,l,u,h=t.entries.at(-1),d=h.url&&performance.getEntriesByType("resource").find((t=>t.name===h.url));e.target=r.get(h),e.lcpEntry=h,h.url&&(e.url=h.url),d&&(e.lcpResourceEntry=d);var v=0,c=0;if("soft-navigation"!==t.navigationType?(v=null!==(n=null==(s=u=Qg())?void 0:s.activationStart)&&void 0!==n?n:0,c=null!==(o=null==(a=u)?void 0:a.responseStart)&&void 0!==o?o:0):(v=t.navigationStartTime||0,u=null==(l=i.u)?void 0:l.get(t.navigationId)),u){var f=Math.max(0,c-v),g=Math.max(f,d?(d.requestStart||d.startTime)-v:0),m=Math.min(t.value,Math.max(g,d?d.responseEnd-v:0));e=p({},e,{timeToFirstByte:f,resourceLoadDelay:g-f,resourceLoadDuration:m-g,elementRenderDelay:t.value-m,navigationEntry:u})}}return Object.assign(t,{attribution:e})})(e))}),e)},onCLS(t,e){void 0===e&&(e={});var i=tm(e=Object.assign({},e),Zg),r=new WeakMap;i.t=t=>{var i;if(null!=t&&null!=(i=t.sources)&&i.length){var n=Sm(t.sources),s=null==n?void 0:n.node;if(s){var o,a=null!==(o=null==e.generateTarget?void 0:e.generateTarget(s))&&void 0!==o?o:Yg(s);r.set(n,a)}}},function(t,e){void 0===e&&(e={});var i=dm();wm(gm((()=>{var r,n=vm("CLS",0),s=tm(e,Zg),o=(i,o,a,l,u)=>{n=vm("CLS",0,i,o,a,l,u),s.o=0,r=nm(t,n,km,e.reportAllChanges)},a=function(t){void 0===t&&(t=!1),s.o>n.value&&(n.value=s.o,n.entries=s.i),r(t)},l=t=>{a(!0),o("soft-navigation",t.navigationId,t.interactionId,t.name,t.startTime)},u=t=>{for(var e of t)"soft-navigation"!==e.entryType?s.l(e):l(e);a()},h=["layout-shift"];fm(e)&&h.push("soft-navigation");var d=cm(h,u);d&&(r=nm(t,n,km,e.reportAllChanges),i.onHidden((()=>{u(d.takeRecords()),r(!0)})),rm((()=>{o("back-forward-cache",n.navigationId,n.navigationInteractionId,n.navigationURL,im()),sm(r)})),setTimeout(r))})))}((e=>{t((t=>{var e={};if(t.entries.length){var i,n=t.entries.reduce(((t,e)=>t.value>e.value?t:e));if(null!=n&&null!=(i=n.sources)&&i.length){var s=Sm(n.sources);s&&(e={largestShiftTarget:r.get(s),largestShiftTime:n.startTime,largestShiftValue:n.value,largestShiftSource:s,largestShiftEntry:n,loadState:Jg(n.startTime)})}}return Object.assign(t,{attribution:e})})(e))}),e)},onFCP(t,e){void 0===e&&(e={});var i=tm(e=Object.assign({},e),mm);fm(e)&&(i.u=new Map),wm((e=>{t((t=>{var e={timeToFirstByte:0,firstByteToFCP:t.value,loadState:Jg(im())};if("soft-navigation"!==t.navigationType){if(t.entries.length){var r=Qg(),n=t.entries.at(-1);if(r){var s=Math.max(0,r.responseStart-(r.activationStart||0));e={timeToFirstByte:s,firstByteToFCP:t.value-s,loadState:Jg(t.entries[0].startTime),navigationEntry:r,fcpEntry:n}}}}else{var o,a=null==(o=i.u)?void 0:o.get(t.navigationId);a&&(e={timeToFirstByte:0,firstByteToFCP:t.value,loadState:"complete",navigationEntry:a})}return Object.assign(t,{attribution:e})})(e))}),e)},onINP(t,e){void 0===e&&(e={});var i=tm(e=Object.assign({},e),Rm),r=[],n=[],s=0,o=new WeakMap,a=new WeakMap,l=!1,u=()=>{l||(Pm(h),l=!0)},h=()=>{var t=new Set(i.h.map((t=>o.get(t.entries[0])))),e=n.length-10;n=n.filter(((i,r)=>r>=e||t.has(i)));var a=new Set;for(var u of n){var h=d(u.startTime,u.processingEnd);for(var v of h)a.add(v)}r=r.filter((t=>t.startTime>s||a.has(t))),l=!1};i.p=t=>{var i,r=t.startTime+t.duration;s=Math.max(s,t.processingEnd);for(var a=n.length-1;a>=0;a--){var l=n[a];if(8>=Math.abs(r-l.renderTime)){(i=l).startTime=Math.min(t.startTime,i.startTime),i.processingStart=Math.min(t.processingStart,i.processingStart),i.processingEnd=Math.max(t.processingEnd,i.processingEnd),e.includeProcessedEventEntries&&i.entries.push(t);break}}i||n.push(i={startTime:t.startTime,processingStart:t.processingStart,processingEnd:t.processingEnd,renderTime:r,entries:e.includeProcessedEventEntries?[t]:[]}),(t.interactionId||"first-input"===t.entryType)&&o.set(t,i),u()},i.m=t=>{if(!a.get(t)){var i,r=null==(i=t.entries.find((t=>t.target)))?void 0:i.target;if(r){var n,s=null!==(n=null==e.generateTarget?void 0:e.generateTarget(r))&&void 0!==n?n:Yg(r);a.set(t,s)}else{var o,l=null==(o=t.entries.find((t=>t.targetSelector)))?void 0:o.targetSelector;l&&a.set(t,l)}}};var d=(t,e)=>{var i=[];for(var n of r)if(n.startTime+n.duration>=t){if(n.startTime>e)break;i.push(n)}return i};cm(["long-animation-frame"],(t=>{r=r.concat(t),u()}),e),function(t,e){if(void 0===e&&(e={}),globalThis.PerformanceEventTiming&&"interactionId"in PerformanceEventTiming.prototype){var i=dm();_m((()=>{var r;"interactionCount"in performance||ym||(ym=cm(["event"],Em,{durationThreshold:0}));var n,s=vm("INP"),o=tm(e,Rm),a=(i,r,a,l,u)=>{o.M(),s=vm("INP",-1,i,r,a,l,u),n=nm(t,s,Am,e.reportAllChanges)},l=()=>{var t=o.T(s.navigationType);t&&t.D!==s.value&&(s.value=t.D,s.entries=t.entries,n())},u=t=>{l(),n(!0),a("soft-navigation",t.navigationId,t.interactionId,t.name,t.startTime)},h=function(t,e){void 0===e&&(e=!1),Pm((()=>{for(var i of t)"soft-navigation"!==i.entryType?o.l(i):u(i);l(),e&&n(!0)}))},d=["event","first-input"];fm(e)&&d.push("soft-navigation");var v=cm(d,h,p({},e,{durationThreshold:null!==(r=e.durationThreshold)&&void 0!==r?r:40}));n=nm(t,s,Am,e.reportAllChanges),v&&(i.onHidden((()=>{h(v.takeRecords(),!0)})),rm((()=>{a("back-forward-cache",s.navigationId,s.navigationInteractionId,s.navigationURL,im())})))}))}}((e=>{t((t=>{if(0===t.entries.length){var e={processedEventEntries:[],longAnimationFrameEntries:[],inputDelay:0,processingDuration:0,presentationDelay:t.value,loadState:Jg(t.navigationStartTime||0)};return Object.assign(t,{attribution:e})}var r=t.entries[0],n=o.get(r),s=n.processingStart,l=Math.max(r.startTime+r.duration,s),u=Math.min(n.processingEnd,l),h=n.entries.sort(((t,e)=>t.processingStart-e.processingStart)),v=d(r.startTime,u),c=i.v.get(r.interactionId),f={interactionTarget:a.get(c),interactionType:r.name.startsWith("key")?"keyboard":"pointer",interactionTime:r.startTime,nextPaintTime:l,processedEventEntries:h,longAnimationFrameEntries:v,inputDelay:s-r.startTime,processingDuration:u-s,presentationDelay:l-u,loadState:Jg(r.startTime),longestScript:void 0,totalScriptDuration:void 0,totalStyleAndLayoutDuration:void 0,totalPaintDuration:void 0,totalUnattributedDuration:void 0};return((t,e)=>{var i=t.interactionTime,r=t.nextPaintTime;if(null!=(e=t.longAnimationFrameEntries)&&e.length&&i&&r){var n,s,o=t.inputDelay,a=t.processingDuration,l=0,u=0,h=0,d=0;for(var v of t.longAnimationFrameEntries)for(var c of(u=u+v.startTime+v.duration-v.styleAndLayoutStart,v.scripts)){var f=c.startTime+c.duration;if(f>=i){var p=f-Math.max(i,c.startTime),g=c.duration?p/c.duration*c.forcedStyleAndLayoutDuration:0;l+=p-g,u+=g,p>d&&(s=i+o>c.startTime?"input-delay":i+o+a>c.startTime?"processing-duration":"presentation-delay",n=c,d=p)}}var m=t.longAnimationFrameEntries.at(-1),y=m?m.startTime+m.duration:0;y>=i+o+a&&(h=r-y),n&&s&&(t.longestScript={entry:n,subpart:s,intersectingDuration:d}),t.totalScriptDuration=l,t.totalStyleAndLayoutDuration=u,t.totalPaintDuration=h,t.totalUnattributedDuration=r-i-l-u-h}})(f),Object.assign(t,{attribution:f})})(e))}),e)},withoutAttribution:{onLCP:by,onCLS:ay,onFCP:sy,onINP:my}};v.__PosthogExtensions__=v.__PosthogExtensions__||{},v.__PosthogExtensions__.postHogWebVitalsCallbacksByFlavor=v.__PosthogExtensions__.postHogWebVitalsCallbacksByFlavor||{},v.__PosthogExtensions__.postHogWebVitalsCallbacksByFlavor["web-vitals-with-attribution-soft-navs"]=wy,v.__PosthogExtensions__.postHogWebVitalsCallbacks=wy,v.postHogWebVitalsCallbacks=wy;var ky={onLCP:by,onCLS:ay,onFCP:sy,onINP:my};v.__PosthogExtensions__=v.__PosthogExtensions__||{},v.__PosthogExtensions__.postHogWebVitalsCallbacksByFlavor=v.__PosthogExtensions__.postHogWebVitalsCallbacksByFlavor||{},v.__PosthogExtensions__.postHogWebVitalsCallbacksByFlavor["web-vitals-soft-navs"]=ky,v.__PosthogExtensions__.postHogWebVitalsCallbacks=ky,v.postHogWebVitalsCallbacks=ky,v.__PosthogExtensions__.loadWebVitalsCallbacks=()=>ky;let Sy=class{constructor(){this.t=void 0,this.o=0,this.i=[]}u(t){var e;if(!t.hadRecentInput){var i=this.i[0],r=this.i.at(-1);this.o&&i&&r&&1e3>t.startTime-r.startTime&&5e3>t.startTime-i.startTime?(this.o+=t.value,this.i.push(t)):(this.o=t.value,this.i=[t]),null==(e=this.t)||e.call(this,t)}}};var xy=()=>{var t=performance.getEntriesByType("navigation")[0];if(t&&t.responseStart>0&&t.responseStart<performance.now())return t},Cy=t=>{if("loading"===document.readyState)return"loading";var e=xy();if(e){if(e.domInteractive>t)return"loading";if(0===e.domContentLoadedEventStart||e.domContentLoadedEventStart>t)return"dom-interactive";if(0===e.domComplete||e.domComplete>t)return"dom-content-loaded"}return"complete"},Ty=t=>{var e=t.nodeName;return 1===t.nodeType?e.toLowerCase():e.toUpperCase().replace(/^#/,"")},Ey=t=>{var e="";try{for(;9!==(null==(i=t)?void 0:i.nodeType);){var i,r=t,n=r.id?"#"+r.id:[Ty(r),...Array.from(r.classList).sort()].join(".");if(e.length+n.length>99)return e||n;if(e=e?n+">"+e:n,r.id)break;t=r.parentNode}}catch(t){}return e},My=new WeakMap;function Iy(t,e){var i=My.get(e);return i||(i=new WeakMap,My.set(e,i)),i.get(t)||i.set(t,new e),i.get(t)}var Ry,Py=-1,Ay=()=>Py,Oy=t=>{addEventListener("pageshow",(e=>{e.persisted&&(Py=e.timeStamp,t(e))}),!0)},Fy=(t,e,i,r)=>{var n,s;return o=>{e.value>=0&&(o||r)&&((s=e.value-(null!=n?n:0))||void 0===n)&&(n=e.value,e.delta=s,e.rating=((t,e)=>t>e[1]?"poor":t>e[0]?"needs-improvement":"good")(e.value,i),t(e))}},Ly=t=>{requestAnimationFrame((()=>requestAnimationFrame(t)))},$y=()=>{var t,e;return null!==(t=null==(e=xy())?void 0:e.activationStart)&&void 0!==t?t:0},Dy=function(t,e){void 0===e&&(e=-1);var i=xy(),r="navigate";return 0>Ay()?i&&(document.prerendering||$y()>0?r="prerender":document.wasDiscarded?r="restore":i.type&&(r=i.type.replace(/_/g,"-"))):r="back-forward-cache",{name:t,value:e,rating:"good",delta:0,entries:[],id:"v5-"+Date.now()+"-"+(Math.floor(8999999999999*Math.random())+1e12),navigationType:r}},Ny=function(t,e,i){void 0===i&&(i={});try{if(PerformanceObserver.supportedEntryTypes.includes(t)){var r=new PerformanceObserver((t=>{queueMicrotask((()=>{e(t.getEntries())}))}));return r.observe(p({type:t,buffered:!0},i)),r}}catch(t){}},qy=t=>{var e=!1;return()=>{e||(t(),e=!0)}},jy=-1,By=new Set,Uy=()=>"hidden"!==document.visibilityState||document.prerendering?1/0:0,Hy=t=>{if("hidden"===document.visibilityState){if("visibilitychange"===t.type)for(var e of By)e();isFinite(jy)||(jy="visibilitychange"===t.type?t.timeStamp:0,removeEventListener("prerenderingchange",Hy,!0))}},zy=()=>{if(0>jy){var t,e=$y(),i=document.prerendering||null==(t=globalThis.performance.getEntriesByType("visibility-state").find((t=>"hidden"===t.name&&t.startTime>=e)))?void 0:t.startTime;jy=null!=i?i:Uy(),addEventListener("visibilitychange",Hy,!0),addEventListener("prerenderingchange",Hy,!0),Oy((()=>{setTimeout((()=>{jy=Uy()}))}))}return{get firstHiddenTime(){return jy},onHidden(t){By.add(t)}}},Wy=t=>{document.prerendering?addEventListener("prerenderingchange",t,!0):t()},Vy=[1800,3e3],Gy=function(t,e){void 0===e&&(e={}),Wy((()=>{var i,r=zy(),n=Dy("FCP"),s=Ny("paint",(t=>{for(var e of t)"first-contentful-paint"===e.name&&(s.disconnect(),r.firstHiddenTime>e.startTime&&(n.value=Math.max(e.startTime-$y(),0),n.entries.push(e),i(!0)))}));s&&(i=Fy(t,n,Vy,e.reportAllChanges),Oy((r=>{n=Dy("FCP"),i=Fy(t,n,Vy,e.reportAllChanges),Ly((()=>{n.value=performance.now()-r.timeStamp,i(!0)}))})))}))},Zy=[.1,.25],Qy=t=>t.find((t=>{var e;return 1===(null==(e=t.node)?void 0:e.nodeType)}))||t[0],Jy=0,Ky=1/0,Yy=0,Xy=t=>{for(var e of t)e.interactionId&&(Ky=Math.min(Ky,e.interactionId),Yy=Math.max(Yy,e.interactionId),Jy=Yy?(Yy-Ky)/7+1:0)},t_=()=>{var t;return Ry?Jy:null!==(t=performance.interactionCount)&&void 0!==t?t:0},e_=0;let i_=class{constructor(){this.l=[],this.h=new Map,this.m=void 0,this.p=void 0}v(){e_=t_(),this.l.length=0,this.h.clear()}M(){var t=Math.min(this.l.length-1,Math.floor((t_()-e_)/50));return this.l[t]}u(t){var e;if(null!=(e=this.m)&&e.call(this,t),t.interactionId||"first-input"===t.entryType){var i=this.l.at(-1),r=this.h.get(t.interactionId);if(r||10>this.l.length||t.duration>i.T){var n;if(r?t.duration>r.T?(r.entries=[t],r.T=t.duration):t.duration===r.T&&t.startTime===r.entries[0].startTime&&r.entries.push(t):(this.h.set((r={id:t.interactionId,entries:[t],T:t.duration}).id,r),this.l.push(r)),this.l.sort(((t,e)=>e.T-t.T)),this.l.length>10){var s=this.l.splice(10);for(var o of s)this.h.delete(o.id)}null==(n=this.p)||n.call(this,r)}}}};var r_=t=>{var e=globalThis.requestIdleCallback||setTimeout,i=globalThis.cancelIdleCallback||clearTimeout;if("hidden"===document.visibilityState)t();else{var r=qy(t),n=-1,s=()=>{i(n),r()};addEventListener("visibilitychange",s,{once:!0,capture:!0}),n=e((()=>{removeEventListener("visibilitychange",s,{capture:!0}),r()}))}},n_=[200,500];let s_=class{constructor(){this.m=void 0}u(t){var e;null==(e=this.m)||e.call(this,t)}};var $=[2500,4e3],o_=-1,a_=t=>{addEventListener("pageshow",(e=>{e.persisted&&(o_=e.timeStamp,t(e))}),!0)},l_=(t,e,i,r)=>{var n,s;return o=>{e.value>=0&&(o||r)&&((s=e.value-(null!=n?n:0))||void 0===n)&&(n=e.value,e.delta=s,e.rating=((t,e)=>t>e[1]?"poor":t>e[0]?"needs-improvement":"good")(e.value,i),t(e))}},u_=t=>{requestAnimationFrame((()=>requestAnimationFrame(t)))},h_=()=>{var t=performance.getEntriesByType("navigation")[0];if(t&&t.responseStart>0&&t.responseStart<performance.now())return t},d_=()=>{var t,e;return null!==(t=null==(e=h_())?void 0:e.activationStart)&&void 0!==t?t:0},v_=function(t,e){void 0===e&&(e=-1);var i=h_(),r="navigate";return 0>o_?i&&(document.prerendering||d_()>0?r="prerender":document.wasDiscarded?r="restore":i.type&&(r=i.type.replace(/_/g,"-"))):r="back-forward-cache",{name:t,value:e,rating:"good",delta:0,entries:[],id:"v5-"+Date.now()+"-"+(Math.floor(8999999999999*Math.random())+1e12),navigationType:r}},c_=new WeakMap;function f_(t,e){var i=c_.get(e);return i||(i=new WeakMap,c_.set(e,i)),i.get(t)||i.set(t,new e),i.get(t)}class p_{constructor(){this.t=void 0,this.i=0,this.o=[]}h(t){var e;if(!t.hadRecentInput){var i=this.o[0],r=this.o.at(-1);this.i&&i&&r&&1e3>t.startTime-r.startTime&&5e3>t.startTime-i.startTime?(this.i+=t.value,this.o.push(t)):(this.i=t.value,this.o=[t]),null==(e=this.t)||e.call(this,t)}}}var g_,m_=function(t,e,i){void 0===i&&(i={});try{if(PerformanceObserver.supportedEntryTypes.includes(t)){var r=new PerformanceObserver((t=>{queueMicrotask((()=>{e(t.getEntries())}))}));return r.observe(p({type:t,buffered:!0},i)),r}}catch(t){}},y_=t=>{var e=!1;return()=>{e||(t(),e=!0)}},__=-1,b_=new Set,w_=()=>"hidden"!==document.visibilityState||document.prerendering?1/0:0,k_=t=>{if("hidden"===document.visibilityState){if("visibilitychange"===t.type)for(var e of b_)e();isFinite(__)||(__="visibilitychange"===t.type?t.timeStamp:0,removeEventListener("prerenderingchange",k_,!0))}},S_=()=>{if(0>__){var t,e=d_(),i=document.prerendering||null==(t=globalThis.performance.getEntriesByType("visibility-state").find((t=>"hidden"===t.name&&t.startTime>=e)))?void 0:t.startTime;__=null!=i?i:w_(),addEventListener("visibilitychange",k_,!0),addEventListener("prerenderingchange",k_,!0),a_((()=>{setTimeout((()=>{__=w_()}))}))}return{get firstHiddenTime(){return __},onHidden(t){b_.add(t)}}},x_=t=>{document.prerendering?addEventListener("prerenderingchange",t,!0):t()},C_=[1800,3e3],T_=function(t,e){void 0===e&&(e={}),x_((()=>{var i,r=S_(),n=v_("FCP"),s=m_("paint",(t=>{for(var e of t)"first-contentful-paint"===e.name&&(s.disconnect(),r.firstHiddenTime>e.startTime&&(n.value=Math.max(e.startTime-d_(),0),n.entries.push(e),i(!0)))}));s&&(i=l_(t,n,C_,e.reportAllChanges),a_((r=>{n=v_("FCP"),i=l_(t,n,C_,e.reportAllChanges),u_((()=>{n.value=performance.now()-r.timeStamp,i(!0)}))})))}))},E_=[.1,.25],M_=function(t,e){void 0===e&&(e={});var i=S_();T_(y_((()=>{var r,n=v_("CLS",0),s=f_(e,p_),o=t=>{for(var e of t)s.h(e);s.i>n.value&&(n.value=s.i,n.entries=s.o,r())},a=m_("layout-shift",o);a&&(r=l_(t,n,E_,e.reportAllChanges),i.onHidden((()=>{o(a.takeRecords()),r(!0)})),a_((()=>{s.i=0,n=v_("CLS",0),r=l_(t,n,E_,e.reportAllChanges),u_(r)})),setTimeout(r))})))},I_=0,R_=1/0,P_=0,A_=t=>{for(var e of t)e.interactionId&&(R_=Math.min(R_,e.interactionId),P_=Math.max(P_,e.interactionId),I_=P_?(P_-R_)/7+1:0)},O_=()=>{var t;return g_?I_:null!==(t=performance.interactionCount)&&void 0!==t?t:0},F_=0;class L_{constructor(){this.l=[],this.u=new Map,this.m=void 0,this.p=void 0}v(){F_=O_(),this.l.length=0,this.u.clear()}T(){var t=Math.min(this.l.length-1,Math.floor((O_()-F_)/50));return this.l[t]}h(t){var e;if(null!=(e=this.m)&&e.call(this,t),t.interactionId||"first-input"===t.entryType){var i=this.l.at(-1),r=this.u.get(t.interactionId);if(r||10>this.l.length||t.duration>i.L){var n;if(r?t.duration>r.L?(r.entries=[t],r.L=t.duration):t.duration===r.L&&t.startTime===r.entries[0].startTime&&r.entries.push(t):(this.u.set((r={id:t.interactionId,entries:[t],L:t.duration}).id,r),this.l.push(r)),this.l.sort(((t,e)=>e.L-t.L)),this.l.length>10){var s=this.l.splice(10);for(var o of s)this.u.delete(o.id)}null==(n=this.p)||n.call(this,r)}}}}var $_=t=>{var e=globalThis.requestIdleCallback||setTimeout,i=globalThis.cancelIdleCallback||clearTimeout;if("hidden"===document.visibilityState)t();else{var r=y_(t),n=-1,s=()=>{i(n),r()};addEventListener("visibilitychange",s,{once:!0,capture:!0}),n=e((()=>{removeEventListener("visibilitychange",s,{capture:!0}),r()}))}},D_=[200,500],N_=function(t,e){if(void 0===e&&(e={}),globalThis.PerformanceEventTiming&&"interactionId"in PerformanceEventTiming.prototype){var i=S_();x_((()=>{var r;"interactionCount"in performance||g_||(g_=m_("event",A_,{durationThreshold:0}));var n,s=v_("INP"),o=f_(e,L_),a=t=>{$_((()=>{for(var e of t)o.h(e);var i=o.T();i&&i.L!==s.value&&(s.value=i.L,s.entries=i.entries,n())}))},l=m_("event",a,{durationThreshold:null!==(r=e.durationThreshold)&&void 0!==r?r:40});n=l_(t,s,D_,e.reportAllChanges),l&&(l.observe({type:"first-input",buffered:!0}),i.onHidden((()=>{a(l.takeRecords()),n(!0)})),a_((()=>{o.v(),s=v_("INP"),n=l_(t,s,D_,e.reportAllChanges)})))}))}};class q_{constructor(){this.m=void 0}h(t){var e;null==(e=this.m)||e.call(this,t)}}var j_=[2500,4e3],B_=function(t,e){void 0===e&&(e={}),x_((()=>{var i,r=S_(),n=v_("LCP"),s=f_(e,q_),o=t=>{for(var o of(e.reportAllChanges||(t=t.slice(-1)),t))s.h(o),r.firstHiddenTime>o.startTime&&(n.value=Math.max(o.startTime-d_(),0),n.entries=[o],i())},a=m_("largest-contentful-paint",o);if(a){i=l_(t,n,j_,e.reportAllChanges);var l=y_((()=>{o(a.takeRecords()),a.disconnect(),i(!0)})),u=t=>{t.isTrusted&&($_(l),removeEventListener(t.type,u,{capture:!0}))};for(var h of["keydown","click","visibilitychange"])addEventListener(h,u,{capture:!0});a_((r=>{n=v_("LCP"),i=l_(t,n,j_,e.reportAllChanges),u_((()=>{n.value=performance.now()-r.timeStamp,i(!0)}))}))}}))},U_={onLCP(t,e){void 0===e&&(e={});var i=Iy(e=Object.assign({},e),s_),r=new WeakMap;i.m=t=>{var i=t.element;if(i){var n,s=null!==(n=null==e.generateTarget?void 0:e.generateTarget(i))&&void 0!==n?n:Ey(i);r.set(t,s)}else t.id&&r.set(t,"#"+t.id)},function(t,e){void 0===e&&(e={}),Wy((()=>{var i,r=zy(),n=Dy("LCP"),s=Iy(e,s_),o=t=>{for(var o of(e.reportAllChanges||(t=t.slice(-1)),t))s.u(o),r.firstHiddenTime>o.startTime&&(n.value=Math.max(o.startTime-$y(),0),n.entries=[o],i())},a=Ny("largest-contentful-paint",o);if(a){i=Fy(t,n,$,e.reportAllChanges);var l=qy((()=>{o(a.takeRecords()),a.disconnect(),i(!0)})),u=t=>{t.isTrusted&&(r_(l),removeEventListener(t.type,u,{capture:!0}))};for(var h of["keydown","click","visibilitychange"])addEventListener(h,u,{capture:!0});Oy((r=>{n=Dy("LCP"),i=Fy(t,n,$,e.reportAllChanges),Ly((()=>{n.value=performance.now()-r.timeStamp,i(!0)}))}))}}))}((e=>{t((t=>{var e={timeToFirstByte:0,resourceLoadDelay:0,resourceLoadDuration:0,elementRenderDelay:t.value};if(t.entries.length){var i=t.entries.at(-1),n=i.url&&performance.getEntriesByType("resource").find((t=>t.name===i.url));e.target=r.get(i),e.lcpEntry=i,i.url&&(e.url=i.url),n&&(e.lcpResourceEntry=n);var s=xy();if(s){var o=s.activationStart||0,a=Math.max(0,s.responseStart-o),l=Math.max(a,n?(n.requestStart||n.startTime)-o:0),u=Math.min(t.value,Math.max(l,n?n.responseEnd-o:0));e=p({},e,{timeToFirstByte:a,resourceLoadDelay:l-a,resourceLoadDuration:u-l,elementRenderDelay:t.value-u,navigationEntry:s})}}return Object.assign(t,{attribution:e})})(e))}),e)},onCLS(t,e){void 0===e&&(e={});var i=Iy(e=Object.assign({},e),Sy),r=new WeakMap;i.t=t=>{var i;if(null!=t&&null!=(i=t.sources)&&i.length){var n=Qy(t.sources),s=null==n?void 0:n.node;if(s){var o,a=null!==(o=null==e.generateTarget?void 0:e.generateTarget(s))&&void 0!==o?o:Ey(s);r.set(n,a)}}},function(t,e){void 0===e&&(e={});var i=zy();Gy(qy((()=>{var r,n=Dy("CLS",0),s=Iy(e,Sy),o=t=>{for(var e of t)s.u(e);s.o>n.value&&(n.value=s.o,n.entries=s.i,r())},a=Ny("layout-shift",o);a&&(r=Fy(t,n,Zy,e.reportAllChanges),i.onHidden((()=>{o(a.takeRecords()),r(!0)})),Oy((()=>{s.o=0,n=Dy("CLS",0),r=Fy(t,n,Zy,e.reportAllChanges),Ly(r)})),setTimeout(r))})))}((e=>{t((t=>{var e={};if(t.entries.length){var i,n=t.entries.reduce(((t,e)=>t.value>e.value?t:e));if(null!=n&&null!=(i=n.sources)&&i.length){var s=Qy(n.sources);s&&(e={largestShiftTarget:r.get(s),largestShiftTime:n.startTime,largestShiftValue:n.value,largestShiftSource:s,largestShiftEntry:n,loadState:Cy(n.startTime)})}}return Object.assign(t,{attribution:e})})(e))}),e)},onFCP(t,e){void 0===e&&(e={}),Gy((e=>{t((t=>{var e={timeToFirstByte:0,firstByteToFCP:t.value,loadState:Cy(Ay())};if(t.entries.length){var i=xy(),r=t.entries.at(-1);if(i){var n=Math.max(0,i.responseStart-(i.activationStart||0));e={timeToFirstByte:n,firstByteToFCP:t.value-n,loadState:Cy(t.entries[0].startTime),navigationEntry:i,fcpEntry:r}}}return Object.assign(t,{attribution:e})})(e))}),e)},onINP(t,e){void 0===e&&(e={});var i=Iy(e=Object.assign({},e),i_),r=[],n=[],s=0,o=new WeakMap,a=new WeakMap,l=!1,u=()=>{l||(r_(h),l=!0)},h=()=>{var t=new Set(i.l.map((t=>o.get(t.entries[0])))),e=n.length-10;n=n.filter(((i,r)=>r>=e||t.has(i)));var a=new Set;for(var u of n){var h=d(u.startTime,u.processingEnd);for(var v of h)a.add(v)}r=r.filter((t=>t.startTime>s||a.has(t))),l=!1};i.m=t=>{var i,r=t.startTime+t.duration;s=Math.max(s,t.processingEnd);for(var a=n.length-1;a>=0;a--){var l=n[a];if(8>=Math.abs(r-l.renderTime)){(i=l).startTime=Math.min(t.startTime,i.startTime),i.processingStart=Math.min(t.processingStart,i.processingStart),i.processingEnd=Math.max(t.processingEnd,i.processingEnd),!1!==e.includeProcessedEventEntries&&i.entries.push(t);break}}i||n.push(i={startTime:t.startTime,processingStart:t.processingStart,processingEnd:t.processingEnd,renderTime:r,entries:!1!==e.includeProcessedEventEntries?[t]:[]}),(t.interactionId||"first-input"===t.entryType)&&o.set(t,i),u()},i.p=t=>{if(!a.get(t)){var i,r=null==(i=t.entries.find((t=>t.target)))?void 0:i.target;if(r){var n,s=null!==(n=null==e.generateTarget?void 0:e.generateTarget(r))&&void 0!==n?n:Ey(r);a.set(t,s)}else{var o,l=null==(o=t.entries.find((t=>t.targetSelector)))?void 0:o.targetSelector;l&&a.set(t,l)}}};var d=(t,e)=>{var i=[];for(var n of r)if(n.startTime+n.duration>=t){if(n.startTime>e)break;i.push(n)}return i};Ny("long-animation-frame",(t=>{r=r.concat(t),u()})),function(t,e){if(void 0===e&&(e={}),globalThis.PerformanceEventTiming&&"interactionId"in PerformanceEventTiming.prototype){var i=zy();Wy((()=>{var r;"interactionCount"in performance||Ry||(Ry=Ny("event",Xy,{durationThreshold:0}));var n,s=Dy("INP"),o=Iy(e,i_),a=t=>{r_((()=>{for(var e of t)o.u(e);var i=o.M();i&&i.T!==s.value&&(s.value=i.T,s.entries=i.entries,n())}))},l=Ny("event",a,{durationThreshold:null!==(r=e.durationThreshold)&&void 0!==r?r:40});n=Fy(t,s,n_,e.reportAllChanges),l&&(l.observe({type:"first-input",buffered:!0}),i.onHidden((()=>{a(l.takeRecords()),n(!0)})),Oy((()=>{o.v(),s=Dy("INP"),n=Fy(t,s,n_,e.reportAllChanges)})))}))}}((e=>{t((t=>{var e=t.entries[0],r=o.get(e),n=e.processingStart,s=Math.max(e.startTime+e.duration,n),l=Math.min(r.processingEnd,s),u=r.entries.sort(((t,e)=>t.processingStart-e.processingStart)),h=d(e.startTime,l),v=i.h.get(e.interactionId),c={interactionTarget:a.get(v),interactionType:e.name.startsWith("key")?"keyboard":"pointer",interactionTime:e.startTime,nextPaintTime:s,processedEventEntries:u,longAnimationFrameEntries:h,inputDelay:n-e.startTime,processingDuration:l-n,presentationDelay:s-l,loadState:Cy(e.startTime),longestScript:void 0,totalScriptDuration:void 0,totalStyleAndLayoutDuration:void 0,totalPaintDuration:void 0,totalUnattributedDuration:void 0};return((t,e)=>{if(null!=(e=t.longAnimationFrameEntries)&&e.length){var i,r,n=t.interactionTime,s=t.inputDelay,o=t.processingDuration,a=0,l=0,u=0,h=0;for(var d of t.longAnimationFrameEntries)for(var v of(l=l+d.startTime+d.duration-d.styleAndLayoutStart,d.scripts)){var c=v.startTime+v.duration;if(c>=n){var f=c-Math.max(n,v.startTime),p=v.duration?f/v.duration*v.forcedStyleAndLayoutDuration:0;a+=f-p,l+=p,f>h&&(r=n+s>v.startTime?"input-delay":n+s+o>v.startTime?"processing-duration":"presentation-delay",i=v,h=f)}}var g=t.longAnimationFrameEntries.at(-1),m=g?g.startTime+g.duration:0;m>=n+s+o&&(u=t.nextPaintTime-m),i&&r&&(t.longestScript={entry:i,subpart:r,intersectingDuration:h}),t.totalScriptDuration=a,t.totalStyleAndLayoutDuration=l,t.totalPaintDuration=u,t.totalUnattributedDuration=t.nextPaintTime-n-a-l-u}})(c),Object.assign(t,{attribution:c})})(e))}),e)},withoutAttribution:{onLCP:B_,onCLS:M_,onFCP:T_,onINP:N_}};v.__PosthogExtensions__=v.__PosthogExtensions__||{},v.__PosthogExtensions__.postHogWebVitalsCallbacksByFlavor=v.__PosthogExtensions__.postHogWebVitalsCallbacksByFlavor||{},v.__PosthogExtensions__.postHogWebVitalsCallbacksByFlavor["web-vitals-with-attribution"]=U_,v.__PosthogExtensions__.postHogWebVitalsCallbacks=U_,v.postHogWebVitalsCallbacks=U_;var H_={onLCP:B_,onCLS:M_,onFCP:T_,onINP:N_};v.__PosthogExtensions__=v.__PosthogExtensions__||{},v.__PosthogExtensions__.postHogWebVitalsCallbacksByFlavor=v.__PosthogExtensions__.postHogWebVitalsCallbacksByFlavor||{},v.__PosthogExtensions__.postHogWebVitalsCallbacksByFlavor["web-vitals"]=H_,v.__PosthogExtensions__.postHogWebVitalsCallbacks=H_,v.postHogWebVitalsCallbacks=H_,v.__PosthogExtensions__.loadWebVitalsCallbacks=()=>H_;class z_{constructor(t){this.disabled=!1===t;var e=st(t)?t:{};this.thresholdPx=e.threshold_px||30,this.timeoutMs=e.timeout_ms||1e3,this.clickCount=e.click_count||3,this.clicks=[]}isRageClick(t,e,i){if(this.disabled)return!1;var r=this.clicks[this.clicks.length-1];if(r&&Math.abs(t-r.x)+Math.abs(e-r.y)<this.thresholdPx&&this.timeoutMs>i-r.timestamp){if(this.clicks.push({x:t,y:e,timestamp:i}),this.clicks.length===this.clickCount)return!0}else this.clicks=[{x:t,y:e,timestamp:i}];return!1}}var W_="$copy_autocapture",V_=Bi("[AutoCapture]");function G_(t,e){return e.length>t?e.slice(0,t)+"...":e}function Z_(t){if(t.previousElementSibling)return t.previousElementSibling;var e=t;do{e=e.previousSibling}while(e&&!pr(e));return e}function Q_(e,i){var r,n,s=i.e,o=i.maskAllElementAttributes,a=i.maskAllText,l=i.elementAttributeIgnoreList,u=i.elementsChainAsString,h=i.disableCaptureUrlHashes;if(!pr(e))return{props:{}};for(var d=[e],v=new Set([e]),c=e;c.parentNode&&!gr(c,"body")&&_r>d.length;)if(yr(c.parentNode)){var f=c.parentNode.host;if(v.has(f))break;v.add(f),d.push(f),c=f}else{if(!pr(c.parentNode))break;if(v.has(c.parentNode))break;v.add(c.parentNode),d.push(c.parentNode),c=c.parentNode}var g,m,y=[],_={},b=!1,w=!1;if(Hi(d,(t=>{var e=qr(t);if(gr(t,"a")){var i=t.getAttribute("href");b=!!(e&&i&&Zr(i))&&(h?Le(i):i)}J(kr(t),"ph-no-capture")&&(w=!0),y.push(function(t,e,i,r,n){void 0===n&&(n=!1);var s=t.tagName.toLowerCase(),o={tag_name:s};Tr.indexOf(s)>-1&&!i&&(o.$el_text="a"===s.toLowerCase()||"button"===s.toLowerCase()?G_(1024,Qr(t)):G_(1024,xr(t)));var a=kr(t);a.length>0&&(o.classes=a.filter((function(t){return""!==t}))),Hi(t.attributes,(function(i){var s;if((!jr(t)||-1!==["name","id","class","aria-label"].indexOf(i.name))&&(null==r||!r.includes(i.name))&&!e&&Zr(i.value)&&(!lt(s=i.name)||"_ngcontent"!==s.substring(0,10)&&"_nghost"!==s.substring(0,7))){var a=i.value;"class"===i.name&&(a=br(a).join(" ")),o["attr__"+i.name]=G_(1024,"href"===i.name&&n?Le(a):a)}}));for(var l=1,u=1,h=t;h=Z_(h);)l++,h.tagName===t.tagName&&u++;return o.nth_child=l,o.nth_of_type=u,o}(t,o,a,l,h));var r=function(t){if(!qr(t))return{};var e={};return Hi(t.attributes,(function(t){if(t.name&&0===t.name.indexOf("data-ph-capture-attribute")){var i=t.name.replace("data-ph-capture-attribute-",""),r=t.value;i&&r&&Zr(r)&&(e[i]=r)}})),e}(t);zi(_,r)})),w)return{props:{},explicitNoCapture:w};if(a||(y[0].$el_text=gr(e,"a")||gr(e,"button")?Qr(e):xr(e)),b){var k,S;y[0].attr__href=b;var x=null==(k=er(b))?void 0:k.host,C=null==t||null==(S=t.location)?void 0:S.host;x&&C&&x!==C&&(g=b)}return{props:zi({$event_type:s.type,$ce_version:1},u?{}:{$elements:y},{$elements_chain:(m=y,function(t){return t.map((t=>{var e,i,r="";if(t.tag_name&&(r+=t.tag_name),t.attr_class)for(var n of(t.attr_class.sort(),t.attr_class))r+="."+n.replace(/"/g,"");var s=p({},t.text?{text:t.text}:{},{"nth-child":null!==(e=t.nth_child)&&void 0!==e?e:0,"nth-of-type":null!==(i=t.nth_of_type)&&void 0!==i?i:0},t.href?{href:t.href}:{},t.attr_id?{attr_id:t.attr_id}:{},t.attributes),o={};return Wi(s).sort(((t,e)=>t[0].localeCompare(e[0]))).forEach((t=>{var e=t[1];return o[Kr(t[0].toString())]=Kr(e.toString())})),(r+=":")+Wi(o).map((t=>t[0]+'="'+t[1]+'"')).join("")})).join(";")}(function(t){return t.map((t=>{var e,i,r={text:null==(e=t.$el_text)?void 0:e.slice(0,400),tag_name:t.tag_name,href:null==(i=t.attr__href)?void 0:i.slice(0,2048),attr_class:Yr(t),attr_id:t.attr__id,nth_child:t.nth_child,nth_of_type:t.nth_of_type,attributes:{}};return Wi(t).filter((t=>0===t[0].indexOf("attr__"))).forEach((t=>r.attributes[t[0]]=t[1])),r}))}(m)))},null!=(r=y[0])&&r.$el_text?{$el_text:null==(n=y[0])?void 0:n.$el_text}:{},g&&"click"===s.type?{$external_click_url:g}:{},_)}}class J_{constructor(t){this.name="autocapture",this.Qn=!1,this.Jn=null,this.Kn=!1,this.Yn=!1,this.qi={enabled:!1,rageclick:!1,maskAllElementAttributes:!1,maskAllText:!1,disableCaptureUrlHashes:!1,remoteRequestsDisabled:!1},this.Xn=!1,this.ts=t,this.ts.refresh(this.qi),this.rageclicks=new z_(this.qi.rageclick),this.es=null}setup(t){this.rs(),this.ns=t;var e=t.onRemoteConfig(this.onRemoteConfig.bind(this));this.Xn?e.dispose():(this.ss=e,this.startIfEnabled())}dispose(){var t;this.Xn||(this.Xn=!0,this.ns=void 0,null==(t=this.ss)||t.dispose(),this.ss=void 0,this.os())}ls(){return this.ts.refresh(this.qi),this.qi}rs(){var t,e;return this.ls(),this.qi.url_allowlist=null==(t=this.qi.url_allowlist)?void 0:t.map((t=>new RegExp(t))),this.qi.url_ignorelist=null==(e=this.qi.url_ignorelist)?void 0:e.map((t=>new RegExp(t))),this.qi}us(){if(this.isBrowserSupported()){if(t&&r){var e=this.hs=e=>{e=e||(null==t?void 0:t.event);try{this.ds(e)}catch(t){V_.error("Failed to capture event",t)}};if(Ki(r,"submit",e,{capture:!0}),Ki(r,"change",e,{capture:!0}),Ki(r,"click",e,{capture:!0}),this.ls().capture_copied_text){var i=this.vs=e=>{e=e||(null==t?void 0:t.event);try{this.ds(e,W_)}catch(t){V_.error("Failed to capture copy/cut event",t)}};Ki(r,"copy",i,{capture:!0}),Ki(r,"cut",i,{capture:!0})}}}else V_.info("Disabling Automatic Event Collection because this browser is not supported")}os(){this.hs&&(null==r||r.removeEventListener("submit",this.hs,!0),null==r||r.removeEventListener("change",this.hs,!0),null==r||r.removeEventListener("click",this.hs,!0),this.hs=void 0),this.vs&&(null==r||r.removeEventListener("copy",this.vs,!0),null==r||r.removeEventListener("cut",this.vs,!0),this.vs=void 0),this.Qn=!1}startIfEnabled(){!this.Xn&&this.ns&&this.isEnabled&&!this.Qn&&(this.us(),this.Qn=!0)}onRemoteConfig(t){if(!this.Xn)if(this.Kn=!0,t.ok){var e=t.config;e.elementsChainAsString&&(this.Yn=e.elementsChainAsString);var i,r=e.autocapture_opt_out;ft(r)&&(null==(i=this.ns)||i.kv.set(_n,r),this.Jn=r),this.startIfEnabled()}else this.startIfEnabled()}setElementSelectors(t){this.es=t}getElementSelectors(t){var e,i=[];return null==(e=this.es)||e.forEach((e=>{var n=null==r?void 0:r.querySelectorAll(e);null==n||n.forEach((r=>{t===r&&i.push(e)}))})),i}get isEnabled(){var t,e;if(this.Xn)return!1;var i=null==(t=this.ns)?void 0:t.kv.get(_n),r=this.Jn,n=this.ls(),s=n.remoteRequestsDisabled&&!this.Kn;if(ht(r)&&!ft(i)&&!s)return!1;var o=null!==(e=this.Jn)&&void 0!==e?e:!!i;return!!n.enabled&&!o}ds(e,i){if(void 0===i&&(i="$autocapture"),this.isEnabled){var r=Cr(e);mr(r)&&(r=r.parentNode||null);var n,s=this.rs();"$autocapture"===i&&"click"===e.type&&e instanceof MouseEvent&&s.rageclick&&null!=(n=this.rageclicks)&&n.isRageClick(e.clientX,e.clientY,e.timeStamp||(new Date).getTime())&&$r(r,s.rageclick)&&this.ds(e,"$rageclick");var o=i===W_;if(r&&function(e,i,r,n,s,o){var a;if(!t||Dr(e))return!1;if(null!=r&&r.url_allowlist&&!wr(r.url_allowlist,o))return!1;if(null!=r&&r.url_ignorelist&&wr(r.url_ignorelist,o))return!1;if(null!=r&&r.dom_event_allowlist){var l=r.dom_event_allowlist;if(l&&!l.some((t=>i.type===t)))return!1}var u=Nr(e,n),h=u.parentIsUsefulElement,d=u.targetElementList;if(!function(t,e){var i=null==e?void 0:e.element_allowlist;if(at(i))return!0;var r,n=function(t){if(i.some((e=>t.tagName.toLowerCase()===e)))return{v:!0}};for(var s of t)if(r=n(s))return r.v;return!1}(d,r))return!1;if(!Er(d,null==r?void 0:r.css_selector_allowlist))return!1;if(Er(d,null!==(a=null==r?void 0:r.css_selector_ignorelist)&&void 0!==a?a:Ir))return!1;try{var v=t.getComputedStyle(e);if(v&&"pointer"===v.getPropertyValue("cursor")&&"click"===i.type)return!0}catch(t){}var c=e.tagName.toLowerCase();switch(c){case"html":return!1;case"form":return(s||["submit"]).indexOf(i.type)>=0;case"input":case"select":case"textarea":return(s||["change","click"]).indexOf(i.type)>=0;default:return h?(s||["click"]).indexOf(i.type)>=0:(s||["click"]).indexOf(i.type)>=0&&(Tr.indexOf(c)>-1||"true"===e.getAttribute("contenteditable"))}}(r,e,s,o,o?["copy","cut"]:void 0,{config:{get_current_url:s.getCurrentUrl}})){var a,l=Q_(r,{e:e,maskAllElementAttributes:s.maskAllElementAttributes,maskAllText:s.maskAllText,elementAttributeIgnoreList:s.element_attribute_ignorelist,elementsChainAsString:this.Yn,disableCaptureUrlHashes:s.disableCaptureUrlHashes}),u=l.props;if(l.explicitNoCapture)return!1;var h=this.getElementSelectors(r);if(h&&h.length>0&&(u.$element_selectors=h),i===W_){var d,v=Sr(null==t||null==(d=t.getSelection())?void 0:d.toString()),c=e.type||"clipboard";if(!v)return!1;u.$selected_content=v,u.$copy_type=c}return null==(a=this.ns)||a.capture(i,u).catch((t=>V_.error("Failed to capture event",t))),!0}}}isBrowserSupported(){return nt(null==r?void 0:r.querySelectorAll)}}var K_={};function Y_(e,i){var r=K_[e];if(r)return r;var n=i[e];if((t=>nt(t)&&-1!==t.toString().indexOf("[native code]"))(n)&&(null==t||!t.Zone))return K_[e]=n.bind(i);var s=i.document;if(s&&nt(s.createElement)){var o,a=!1;try{(o=s.createElement("iframe")).hidden=!0,s.head.appendChild(o);var l,u,h=o.contentWindow;h&&h[e]&&(n=h[e],"MutationObserver"===e&&function(t){return J(t,"AppleWebKit")&&!J(t,"Chrome")}(null!==(l=null==(u=i.navigator)?void 0:u.userAgent)&&void 0!==l?l:"")&&(o.classList.add("rr-block","ph-no-capture"),a=!0))}catch(t){ji.warn("Could not create sandbox iframe for "+e+" check, bailing to assignableWindow."+e+": ",t)}finally{var d;!a&&null!=(d=o)&&d.parentNode&&o.parentNode.removeChild(o)}}return n&&nt(n)?K_[e]=n.bind(i):n}function X_(t,e){var i=Cr(t);return i?p({node:i,originalEvent:t,timestamp:Date.now()},e):null}function tb(t,e){return Math.abs(t)<Math.abs(e)?0>e?"up":"down":0>t?"left":"right"}function eb(t){return"swipe"===t.type?"$dead_swipe":"$dead_click"}var ib="canvas,video,audio,embed,object",rb=1e3;function nb(t,e){return vt(t)&&t>=e}function sb(t){return t>=0&&rb>t?t:void 0}function ob(t,e){return e?sb(t-e):void 0}class ab{mi(t){var e,i,r,n,s,o,a,l,u=this.gi((null==t?void 0:t.__onCapture)||this.yi.bind(this));return{element_attribute_ignorelist:null!==(e=null==t?void 0:t.element_attribute_ignorelist)&&void 0!==e?e:u.element_attribute_ignorelist,scroll_threshold_ms:null!==(i=null==t?void 0:t.scroll_threshold_ms)&&void 0!==i?i:u.scroll_threshold_ms,selection_change_threshold_ms:null!==(r=null==t?void 0:t.selection_change_threshold_ms)&&void 0!==r?r:u.selection_change_threshold_ms,mutation_threshold_ms:null!==(n=null==t?void 0:t.mutation_threshold_ms)&&void 0!==n?n:u.mutation_threshold_ms,capture_clicks_with_modifier_keys:null!==(s=null==t?void 0:t.capture_clicks_with_modifier_keys)&&void 0!==s?s:u.capture_clicks_with_modifier_keys,capture_dead_swipes:null!==(o=null==t?void 0:t.capture_dead_swipes)&&void 0!==o?o:u.capture_dead_swipes,swipe_threshold_px:null!==(a=null==t?void 0:t.swipe_threshold_px)&&void 0!==a?a:u.swipe_threshold_px,max_dead_swipes_per_page_load:null!==(l=null==t?void 0:t.max_dead_swipes_per_page_load)&&void 0!==l?l:u.max_dead_swipes_per_page_load,css_selector_ignorelist:null==t?void 0:t.css_selector_ignorelist,__onCapture:u.__onCapture}}constructor(t,e){this.bi=[],this.wi=0,this.gi=t=>({element_attribute_ignorelist:[],scroll_threshold_ms:100,selection_change_threshold_ms:100,mutation_threshold_ms:2500,capture_clicks_with_modifier_keys:!1,capture_dead_swipes:!0,swipe_threshold_px:30,max_dead_swipes_per_page_load:10,__onCapture:t}),this.ki=t=>{var e=X_(t,{type:"click"});ht(e)||this.Si(e)||this.xi(e),this.Ci()},this.Mi=()=>{var t=Date.now();this.Ti=t,t%50==0&&this.bi.forEach((e=>{at(e.scrollDelayMs)&&(e.scrollDelayMs=t-e.timestamp)}))},this.Ii=()=>{this.Ei=Date.now()},this.It=()=>{var t=Date.now();this.Ri=t,this.Ai("visibilityChangedDelayMs",t)},this.Li=()=>{var t=Date.now();this.Oi=t,this.Ai("focusChangedDelayMs",t)},this.Fi=t=>{var e=t.touches,i=1===(null==e?void 0:e.length)?e[0]:void 0;this.Ni=i?{x:i.clientX,y:i.clientY,timestamp:Date.now()}:void 0},this.Di=()=>{this.Ni=void 0},this.Pi=t=>{var e,i=this.Ni;if(this.Ni=void 0,!at(i)&&this.qi.max_dead_swipes_per_page_load>this.wi){var n=t,s=null==(e=n.changedTouches)?void 0:e[0];if(s){var o=s.clientX-i.x,a=s.clientY-i.y,l=o*o+a*a,u=this.qi.swipe_threshold_px;if(l>=u*u&&![this.Ti,this.ji,this.Ei].some((t=>vt(t)&&t>=i.timestamp))){var h;if(this.Bi()&&(null!==(h=null==r||null==r.elementsFromPoint?void 0:r.elementsFromPoint(i.x,i.y))&&void 0!==h?h:[]).some((t=>null==t.matches?void 0:t.matches(ib))))return;var d=X_(n,{type:"swipe",swipeDirection:tb(o,a),swipeDistancePx:Math.round(Math.sqrt(l))});ht(d)||this.Si(d)||this.xi(d),this.Ci()}}}},this.instance=t,this.qi=this.mi(e),this._onCapture=this.qi.__onCapture}start(t){this.Hi(),this.$i(),this.Ui(),this.Wi(),this.zi(),this.Vi(t),this.qi.capture_dead_swipes&&this.Zi()}Vi(t){if(!this.Qi){var e=function(t){return Y_("MutationObserver",t)}(v);this.Qi=new e((t=>{this.Gi(t)})),this.Qi.observe(t,{attributes:!0,characterData:!0,childList:!0,subtree:!0})}}stop(){var t;null==(t=this.Qi)||t.disconnect(),this.Qi=void 0,v.removeEventListener("click",this.ki),v.removeEventListener("scroll",this.Mi,{capture:!0}),v.removeEventListener("selectionchange",this.Ii),v.removeEventListener("touchstart",this.Fi,{capture:!0}),v.removeEventListener("touchend",this.Pi,{capture:!0}),v.removeEventListener("touchcancel",this.Di,{capture:!0}),null==r||r.removeEventListener("visibilitychange",this.It),v.removeEventListener("blur",this.Li),v.removeEventListener("focus",this.Li),this.Ni=void 0}Gi(t){this.ji=Date.now()}Hi(){Ki(v,"click",this.ki)}xi(t){t.visibilityChangedDelayMs=ob(t.timestamp,this.Ri),t.focusChangedDelayMs=ob(t.timestamp,this.Oi),this.bi.push(t)}Ci(){this.bi.length&&at(this.Yi)&&(this.Yi=v.setTimeout((()=>{this.Ji()}),1e3))}$i(){Ki(v,"scroll",this.Mi,{capture:!0})}Ui(){Ki(v,"selectionchange",this.Ii)}Wi(){Ki(r,"visibilitychange",this.It)}zi(){Ki(v,"blur",this.Li),Ki(v,"focus",this.Li)}Ai(t,e){this.bi.forEach((i=>{var r=sb(e-i.timestamp);vt(r)&&(at(i[t])||i[t]>r)&&(i[t]=r)}))}Zi(){Ki(v,"touchstart",this.Fi,{capture:!0,passive:!0}),Ki(v,"touchend",this.Pi,{capture:!0,passive:!0}),Ki(v,"touchcancel",this.Di,{capture:!0,passive:!0})}Bi(){var t=at(this.Ki)||vt(this.ji)&&this.ji>this.Ki;return(at(this.Xi)||t)&&(this.Ki=Date.now(),this.Xi=!(null==r||!r.querySelector(ib))),!!this.Xi}Si(t){return!t||("swipe"===t.type?this.en(t):this.tn(t))}en(e){if(fr(e.node))return!0;var i=this.bi.some((t=>t.type===e.type&&t.node===e.node&&1e3>Math.abs(t.timestamp-e.timestamp)));return!(!i&&!gr(e.node,"html")&&pr(e.node)&&function(e,i){var r;if(!t||Dr(e))return!1;var n=ft(i)?Or:null!==(r=null==i?void 0:i.css_selector_ignorelist)&&void 0!==r?r:Or;return!Er(Nr(e,!1).targetElementList,n)}(e.node,{css_selector_ignorelist:this.qi.css_selector_ignorelist}))}tn(e){return!(this.qi.capture_clicks_with_modifier_keys||(i=e.originalEvent,!(i.ctrlKey||i.metaKey||i.altKey||i.shiftKey)))||!!this.en(e)||(r=e.node,!(!t||Dr(r))&&Nr(r,!1).targetElementList.some((t=>gr(t,"a"))));var i,r}Ji(){if(this.bi.length){clearTimeout(this.Yi),this.Yi=void 0;var t=this.bi;for(var e of(this.bi=[],t)){var i;e.mutationDelayMs=null!==(i=e.mutationDelayMs)&&void 0!==i?i:this.ji&&this.ji>=e.timestamp?this.ji-e.timestamp:void 0,e.absoluteDelayMs=Date.now()-e.timestamp,e.selectionChangedDelayMs=this.Ei&&this.Ei>=e.timestamp?this.Ei-e.timestamp:void 0;var r=nb(e.scrollDelayMs,this.qi.scroll_threshold_ms),n=nb(e.selectionChangedDelayMs,this.qi.selection_change_threshold_ms),s=nb(e.mutationDelayMs,this.qi.mutation_threshold_ms),o=nb(e.absoluteDelayMs,1.1*this.qi.mutation_threshold_ms),a=vt(e.scrollDelayMs)&&this.qi.scroll_threshold_ms>e.scrollDelayMs,l=vt(e.mutationDelayMs)&&this.qi.mutation_threshold_ms>e.mutationDelayMs,u=vt(e.selectionChangedDelayMs)&&this.qi.selection_change_threshold_ms>e.selectionChangedDelayMs,h=vt(e.visibilityChangedDelayMs),d=vt(e.focusChangedDelayMs);if(!(a||l||u||h||d))if(r||s||o||n){var v=eb(e);if("$dead_swipe"===v){if(this.wi>=this.qi.max_dead_swipes_per_page_load)continue;this.wi++}this._onCapture(e,{[v+"_last_mutation_timestamp"]:this.ji,[v+"_event_timestamp"]:e.timestamp,[v+"_scroll_timeout"]:r,[v+"_mutation_timeout"]:s,[v+"_absolute_timeout"]:o,[v+"_selection_changed_timeout"]:n,[v+"_visibility_changed_timeout"]:!1})}else this.qi.mutation_threshold_ms>e.absoluteDelayMs&&this.bi.push(e)}this.Ci()}}yi(t,e){var i=eb(t);this.instance.capture(i,p({},e,Q_(t.node,{e:t.originalEvent,maskAllElementAttributes:this.instance.config.mask_all_element_attributes,maskAllText:this.instance.config.mask_all_text,elementAttributeIgnoreList:this.qi.element_attribute_ignorelist,elementsChainAsString:!1,disableCaptureUrlHashes:this.instance.config.disable_capture_url_hashes}).props,{[i+"_scroll_delay_ms"]:t.scrollDelayMs,[i+"_mutation_delay_ms"]:t.mutationDelayMs,[i+"_absolute_delay_ms"]:t.absoluteDelayMs,[i+"_selection_changed_delay_ms"]:t.selectionChangedDelayMs,[i+"_visibility_changed_delay_ms"]:t.visibilityChangedDelayMs,[i+"_focus_changed_delay_ms"]:t.focusChangedDelayMs,$dead_swipe_direction:t.swipeDirection,$dead_swipe_distance_px:t.swipeDistancePx}),{timestamp:new Date(t.timestamp)})}}v.__PosthogExtensions__=v.__PosthogExtensions__||{},v.__PosthogExtensions__.initDeadClicksAutocapture=(t,e)=>new ab(t,e);var lb=Bi("[ExternalScriptsLoader]"),ub=t=>{var e=null==r?void 0:r.querySelectorAll("script");if(e)for(var i=0;e.length>i;i++)if(e[i].src===t||e[i].getAttribute("src")===t)return e[i]},hb=(t,e,i)=>{if(t.config.disable_external_dependency_loading)return lb.warn(e+" was requested but loading of external scripts is disabled."),i("Loading of external scripts is disabled");var n=ub(e);if(n){if(n.__posthog_loading_callback_fired)return i();var s=n.__posthog_loading_error;return s?i(s):(n.addEventListener("load",(t=>{n.__posthog_loading_callback_fired=!0,i(void 0,t)})),void n.addEventListener("error",(t=>{n.__posthog_loading_error=t,i(t)})))}var o=()=>{if(!r)return i("document not found");if(ub(e))return hb(t,e,i);var n=r.createElement("script");if(n.type="text/javascript",n.crossOrigin="anonymous",n.src=e,n.onload=t=>{n.__posthog_loading_callback_fired=!0,i(void 0,t)},n.onerror=t=>{n.__posthog_loading_error=t,i(t)},t.config.prepare_external_dependency_script&&(n=t.config.prepare_external_dependency_script(n)),!n)return i("prepare_external_dependency_script returned null");if("head"===t.config.external_scripts_inject_target)r.head.appendChild(n);else{var s,o=r.querySelectorAll("body > script");o.length>0?null==(s=o[0].parentNode)||s.insertBefore(n,o[0]):r.body.appendChild(n)}};null!=r&&r.body?o():null==r||r.addEventListener("DOMContentLoaded",o)},db={},vb=(t,e)=>{var i="/static/"+e+".js?v="+t.version;if("toolbar"===e){var r=3e5;i=i+"&t="+Math.floor(Date.now()/r)*r}return t.requestRouter.endpointFor("assets",i)};v.__PosthogExtensions__=v.__PosthogExtensions__||{},v.__PosthogExtensions__.loadExternalDependency=(t,e,i)=>{if("remote-config"!==e){var r=t.config.strict_script_versioning;if(r){var n=t.requestRouter.endpointFor("assets","/static/"+t.version+"/"+e+".js"),s=db[n];if("fallback"===r&&s){if(ub(s))return void hb(t,s,i);delete db[n]}hb(t,n,"fallback"===r?(r,s)=>{if(r)if("string"==typeof r)i(r);else{var o,a=vb(t,e);db[n]=a;var l=ub(n);null==l||null==(o=l.parentNode)||o.removeChild(l),hb(t,a,i)}else i(void 0,s)}:i)}else hb(t,vb(t,e),i)}else{var o=t.requestRouter.endpointFor("assets","/array/"+t.config.token+"/config.js");hb(t,o,i)}},v.__PosthogExtensions__.loadSiteApp=(t,e,i)=>{var r=t.requestRouter.endpointFor("api",e);hb(t,r,i)};class cb{constructor(t){this._instance=t}get qi(){return this._instance.config}get consent(){return this.cs()?0:this.fs}isOptedOut(){return this.qi.cookieless_mode===Fs||this.isRejected()||-1===this.consent&&this.qi.cookieless_mode===Os}isOptedIn(){return!this.isOptedOut()}isExplicitlyOptedOut(){return 0===this.consent}isRejected(){return 0===this.consent||-1===this.consent&&this.qi.opt_out_capturing_by_default}optInOut(t){this.ps.Dr(this.gs,t?1:0,this.qi.cookie_expiration,this.qi.cross_subdomain_cookie,this.qi.secure_cookie)}reset(){this.ps.qr(this.gs,this.qi.cross_subdomain_cookie)}get gs(){var t=this._instance.config,e=t.token,i=t.opt_out_capturing_cookie_prefix;return t.consent_persistence_name||(i?i+e:"__ph_opt_in_out_"+e)}get fs(){var t=this.ps.Pr(this.gs);return xt(t)?1:J(Ct,t)?0:-1}get ps(){var t=this.qi.opt_out_capturing_persistence_type,e="localStorage"===t?Df:Lf;if(!this.ys||this.ys!==e){this.ys=e;var i="localStorage"===t?Lf:Df;i.Pr(this.gs)&&(this.ys.Pr(this.gs)||this.optInOut(xt(i.Pr(this.gs))),i.qr(this.gs,this.qi.cross_subdomain_cookie))}return this.ys}cs(){return!!this.qi.respect_dnt&&[null==i?void 0:i.doNotTrack,null==i?void 0:i.msDoNotTrack,v.doNotTrack].some((t=>xt(t)))}}var fb=Bi("[Dead Clicks]"),pb=()=>!0,gb=t=>{var e,i=!(null==(e=t.instance.persistence)||!e.get_property(Cn)),r=t.instance.config.capture_dead_clicks;return ft(r)?r:!!st(r)||i};class mb{get lazyLoadedDeadClicksAutocapture(){return this.bs}constructor(t,e,i){this.instance=t,this.isEnabled=e,this.onCapture=i,this.startIfEnabledOrStop()}onRemoteConfig(t){if(t.ok){var e=t.config;"captureDeadClicks"in e&&(this.instance.persistence&&this.instance.persistence.register({[Cn]:e.captureDeadClicks}),this.startIfEnabledOrStop())}}startIfEnabledOrStop(){this.isEnabled(this)?this._s((()=>{this.ws()})):this.stop()}_s(t){var e,i;null!=(e=v.__PosthogExtensions__)&&e.initDeadClicksAutocapture?t():null==(i=v.__PosthogExtensions__)||null==i.loadExternalDependency||i.loadExternalDependency(this.instance,"dead-clicks-autocapture",(e=>{e?fb.error("failed to load script",e):t()}))}ws(){var t;if(r){if(!this.bs&&null!=(t=v.__PosthogExtensions__)&&t.initDeadClicksAutocapture){var e=st(this.instance.config.capture_dead_clicks)?p({},this.instance.config.capture_dead_clicks):{};e.__onCapture=this.onCapture,this.onCapture&&(e.capture_dead_swipes=!1),this.bs=v.__PosthogExtensions__.initDeadClicksAutocapture(this.instance,e),this.bs.start(r),fb.info("starting...")}}else fb.error("`document` not found. Cannot start.")}stop(){this.bs&&(this.bs.stop(),this.bs=void 0,fb.info("stopping..."))}}var yb=Bi("[SegmentIntegration]");var _b="posthog-js";function bb(t,e){var i=void 0===e?{}:e,r=i.organization,n=i.projectId,s=i.prefix,o=i.severityAllowList,a=void 0===o?["error"]:o,l=i.sendExceptionsToPostHog,u=void 0===l||l;return e=>{var i,o,l,h,d;if("*"!==a&&!a.includes(e.level)||!t.__loaded)return e;e.tags||(e.tags={});var v=t.requestRouter.endpointFor("ui","/project/"+t.config.token+"/person/"+t.get_distinct_id());e.tags["PostHog Person URL"]=v,t.sessionRecordingStarted()&&(e.tags["PostHog Recording URL"]=t.get_session_replay_url({withTimestamp:!0}));var c,f=(null==(i=e.exception)?void 0:i.values)||[],g=f.map((t=>p({},t,{stacktrace:t.stacktrace?p({},t.stacktrace,{type:"raw",frames:(t.stacktrace.frames||[]).map((t=>p({},t,{platform:"web:javascript"})))}):void 0}))),m={$exception_message:(null==(o=f[0])?void 0:o.value)||e.message,$exception_type:null==(l=f[0])?void 0:l.type,$exception_level:e.level,$exception_list:g,$sentry_event_id:e.event_id,$sentry_exception:e.exception,$sentry_exception_message:(null==(h=f[0])?void 0:h.value)||e.message,$sentry_exception_type:null==(d=f[0])?void 0:d.type,$sentry_tags:e.tags};return r&&n&&(m.$sentry_url=(s||"https://sentry.io/organizations/")+r+"/issues/?project="+n+"&query="+e.event_id),u&&(null==(c=t.exceptions)||c.sendExceptionEvent(m)),e}}class wb{constructor(t,e,i,r,n,s){this.name=_b,this.setupOnce=function(o){o(bb(t,{organization:e,projectId:i,prefix:r,severityAllowList:n,sendExceptionsToPostHog:null==s||s}))}}}class kb{constructor(t){this.ks=(t,e,i)=>{i&&(i.noSessionId||i.activityTimeout||i.sessionPastMaximumLength||i.crossTabAdoption)&&(ji.info("[PageViewManager] Session rotated, clearing pageview state",{sessionId:t,changeReason:i}),this.Ss=void 0,this._instance.scrollManager.resetContext())},this._instance=t,this.xs()}xs(){var t;this.Cs=null==(t=this._instance.sessionManager)?void 0:t.onSessionId(this.ks)}destroy(){var t;null==(t=this.Cs)||t.call(this),this.Cs=void 0}doPageView(e,i){var r,n=this.Ts(e,i);return this.Ss={pathname:null!==(r=null==t?void 0:t.location.pathname)&&void 0!==r?r:"",pageViewId:i,timestamp:e},this._instance.scrollManager.resetContext(),n}doPageLeave(t){var e;return this.Ts(t,null==(e=this.Ss)?void 0:e.pageViewId)}doEvent(){var t;return{$pageview_id:null==(t=this.Ss)?void 0:t.pageViewId}}Ts(t,e){var i=this.Ss;if(!i)return{$pageview_id:e};var r={$pageview_id:e,$prev_pageview_id:i.pageViewId},n=this._instance.scrollManager.getContext();if(n&&!this._instance.config.disable_scroll_properties){var s=n.maxScrollHeight,o=n.lastScrollY,a=n.maxScrollY,l=n.maxContentHeight,u=n.lastContentY,h=n.maxContentY;if(!(at(s)||at(o)||at(a)||at(l)||at(u)||at(h))){s=Math.ceil(s),o=Math.ceil(o),a=Math.ceil(a),l=Math.ceil(l),u=Math.ceil(u),h=Math.ceil(h);var d=s>1?Tt(o/s,0,1,ji):1,v=s>1?Tt(a/s,0,1,ji):1,c=l>1?Tt(u/l,0,1,ji):1,f=l>1?Tt(h/l,0,1,ji):1;r=zi(r,{$prev_pageview_last_scroll:o,$prev_pageview_last_scroll_percentage:d,$prev_pageview_max_scroll:a,$prev_pageview_max_scroll_percentage:v,$prev_pageview_last_content:u,$prev_pageview_last_content_percentage:c,$prev_pageview_max_content:h,$prev_pageview_max_content_percentage:f})}}return i.pathname&&(r.$prev_pageview_pathname=i.pathname),i.timestamp&&(r.$prev_pageview_duration=(t.getTime()-i.timestamp.getTime())/1e3),r}}var Sb=["flags","surveys"],xb={[cn]:{exposure:"hidden"},[mn]:{exposure:"hidden"},__cmpns:{exposure:"hidden"},[yn]:{exposure:"hidden"},[_n]:{exposure:"event"},[bn]:{exposure:"hidden"},[wn]:{exposure:"event"},[kn]:{exposure:"hidden"},[Sn]:{exposure:"event"},[xn]:{exposure:"event"},[Cn]:{exposure:"event"},[Tn]:{exposure:"hidden"},[En]:{exposure:"event"},[Mn]:{exposure:"hidden"},$session_recording_enabled_server_side:{exposure:"hidden"},[Fn]:{exposure:"hidden"},[Ln]:{exposure:"event"},[In]:{exposure:"event",shouldSkipFromEventProperties:t=>ht(t)},[$n]:{exposure:"event"},[Dn]:{exposure:"event"},[Nn]:{exposure:"event"},[Un]:{exposure:"event"},[Hn]:{exposure:"hidden"},[zn]:{exposure:"hidden",storageGroup:"flags"},[Wn]:{exposure:"hidden",storageGroup:"flags"},[Vn]:{exposure:"hidden"},[Gn]:{exposure:"hidden",storageGroup:"flags"},[Zn]:{exposure:"hidden",storageGroup:"flags"},[Qn]:{exposure:"hidden",storageGroup:"flags",volatile:!0},[Jn]:{exposure:"hidden",storageGroup:"flags"},[Kn]:{exposure:"hidden"},[Yn]:{exposure:"hidden"},[Xn]:{exposure:"hidden"},[ts]:{exposure:"hidden"},[is]:{exposure:"hidden",storageGroup:"surveys"},[rs]:{exposure:"hidden",storageGroup:"surveys",volatile:!0},[ns]:{exposure:"event"},[ss]:{exposure:"hidden"},[os]:{exposure:"hidden"},[as]:{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"},[ls]:{exposure:"hidden"},[us]:{exposure:"hidden"},[es]:{exposure:"event"},[hs]:{exposure:"hidden"},[ds]:{exposure:"hidden",storageGroup:"flags",volatile:!0},[vs]:{exposure:"hidden"},[cs]:{exposure:"hidden"},[fs]:{exposure:"hidden"},[ps]:{exposure:"hidden"},[gs]:{exposure:"hidden"},[ms]:{exposure:"hidden"},[ys]:{exposure:"hidden"},[Rn]:{exposure:"event"},[Pn]:{exposure:"event"},[An]:{exposure:"event"},[On]:{exposure:"event"},[ws]:{exposure:"event"},[ks]:{exposure:"event"},[Ss]:{exposure:"event"},[xs]:{exposure:"event"},[Cs]:{exposure:"event"},[Ts]:{exposure:"event"},[Es]:{exposure:"event"},[Ms]:{exposure:"event"},[Is]:{exposure:"event"},[Rs]:{exposure:"event"},[Ps]:{exposure:"event"}},Cb=[[qn,{exposure:"hidden"}],[jn,{exposure:"hidden"}],[Bn,{exposure:"hidden"}]],Tb=t=>{var e=xb[t];if(e)return e;for(var i of Cb){var r=i[1];if(0===t.indexOf(i[0]))return r}},Eb={flags:ds,surveys:rs},Mb=["cookie","localstorage","localstorage+cookie","sessionstorage","memory"],Ib=t=>t+"_cookie_identity_change_pending",Rb="main",Pb=(t,e)=>{Hi(t,((i,r)=>{var n=Tb(r);n&&"event"!==n.exposure||{}.hasOwnProperty.call(e,r)||delete t[r]}))};class Ab{constructor(e,i,r){if(void 0===r&&(r=!0),this.Ms={},this.Es=!1,this.Is=!1,this.Rs=!1,this.Ps=!1,this.qi=e,this.As=r,this.props={},this.Fs=void 0,this.Ls=(t=>{var e="";return t.token&&(e=t.token.replace(/\+/g,"PL").replace(/\//g,"SL").replace(/=/g,"EQ")),t.persistence_name?"ph_"+t.persistence_name:"ph_"+e+"_posthog"})(e),this.ps=this.Os(e),this.Is=this.Ds(e),this.load(),e.debug&&ji.info("Persistence loaded",e.persistence,p({},this.props)),this.update_config(e,e,i),this.save(),t){var n=()=>this.flush();Ki(t,"beforeunload",n,{capture:!1}),Ki(t,"pagehide",n,{capture:!1})}}$s(){var t,e=null==(t=this.qi)?void 0:t.persistence_save_debounce_ms;return vt(e)&&e>0?e:0}Ns(t){if(this.qi.cookieWinsOnConflict&&"localstorage+cookie"===this.qi.persistence.toLowerCase())if(t)try{var e=Hf(t,this.qi.cookie_persisted_properties||[]),i=Wf(e,this.qi.cookie_persisted_properties||[]),r=JSON.stringify(e)+"|"+JSON.stringify(i),n=Lf.Pr(this.Ls)||void 0;n&&Gf(this.Ls,n)===r&&(this.qs=r,this.js=n)}catch(t){}else try{var s=Lf.Pr(this.Ls)||void 0;this.qs=s?Gf(this.Ls,s):void 0,this.js=s}catch(t){}}syncCookieProperties(){return this.Bs(this.qi)}Bs(t,e){if(void 0===e&&(e=!1),this.Hs&&!e||this.Ps||!t.cookieWinsOnConflict||"localstorage+cookie"!==t.persistence.toLowerCase())return!1;var i;try{i=Lf.Pr(this.Ls)||void 0}catch(t){}if(!i||i===this.js)return!1;var r,n=Gf(this.Ls,i);try{r=Uf(JSON.parse(i))}catch(t){return!1}if((Lf.Pr(this.Ls)||void 0)!==i)return!1;this.qs=n,this.js=i;var s=Vf(this.Ls,i),o=[...qf,...s.properties],a={};if(Object.keys(r).forEach((t=>{var e=r[t];(at(e)||ht(e)||""===e||t===vs&&e!==Ls&&e!==$s)&&(a[t]=!0,delete r[t])})),ot(r))return!1;var l=fn in r||r[vs]===Ls||r[vs]===$s,u=this.props[fn],h=this.props[vs],d=zi({},this.props);[...qf,...t.cookie_persisted_properties||[]].forEach((t=>{if(-1!==o.indexOf(t)&&!(t in r)&&!a[t]&&(l||t!==fn&&t!==vs)){var e=d[t];!s.isValid&&-1!==qf.indexOf(t)&&(!1===e||0===e)||delete d[t]}})),this.props=zi(d,r),!l||vs in r||vs in this.props||this.Us(vs,Ls);var v=this.props[fn],c=this.props[vs];return!l||v===u&&c===h||(this.Rs=!0,Kf.Dr(Ib(this.Ls),!0),this.zs(Xn),this.zs(Wn),this.zs(zn),this.zs(Gn),this.zs(Zn),this.zs(Qn),this.zs(ds),this.zs(hs),this.zs(ls),c===Ls&&(h===$s||r[vs]===Ls||!at(u)&&v!==u)&&(Pb(this.props,r),this.zs(ts)),c===$s?this.props.$user_id=v:delete this.props.$user_id,this.zs(mn)),!0}consumeCookieIdentityChange(){var t=Ib(this.Ls),e=this.Rs||!!Kf.Pr(t);return this.Rs=!1,e&&Kf.qr(t),e}Ws(t){return void 0===t&&(t=!1),!(this.Ps||this.Hs&&!t||!this.qi.cookieWinsOnConflict||"localstorage+cookie"!==this.qi.persistence.toLowerCase()||(this.Ps=!0,0))}Vs(){this.Ps&&(at(this.Gs)||(clearTimeout(this.Gs),this.Gs=void 0),delete this.Ms[Rb],this.Zs(!0))}Qs(t){if(void 0===t&&(t=!0),this.Ps)try{t?this.Vs():at(this.Gs)||(clearTimeout(this.Gs),this.Gs=void 0)}finally{this.Ps=!1}}isDisabled(){return!!this.Hs}Os(e){-1===Mb.indexOf(e.persistence.toLowerCase())&&(ji.critical("Unknown persistence type "+e.persistence+"; falling back to localStorage+cookie"),e.persistence="localStorage+cookie");var i,r=function(e,i){void 0===e&&(e=[]),void 0===i&&(i=!1);var r=[...qf,...e];return p({},Df,{Br(t){try{var e,n={};try{e=Lf.Pr(t)||void 0,n=e?Uf(JSON.parse(e)):{}}catch(t){}var s,o=JSON.parse(Df.Pr(t)||"{}");if(i){var a=Vf(t,e),l=[...qf,...a.properties],u={};Object.keys(n).forEach((t=>{var e=n[t];ht(e)||""===e||t===vs&&e!==Ls&&e!==$s||(u[t]=e)}));var h=fn in u||u[vs]===Ls||u[vs]===$s;if(Object.keys(u).length>0){var d,v=o[fn],c=null!==(d=o[vs])&&void 0!==d?d:Ls;r.forEach((t=>{if(-1!==l.indexOf(t)&&!(t in n)&&(h||t!==fn&&t!==vs)){var e=o[t];!a.isValid&&-1!==qf.indexOf(t)&&(!1===e||0===e)||delete o[t]}})),!h||vs in n||vs in o||(o[vs]=Ls),!h||(fn in u?u[fn]:o[fn])===v&&(vs in u?u[vs]:o[vs])===c||(Nf.forEach((t=>delete o[t])),u[vs]===$s&&fn in u?o.$user_id=u[fn]:delete o.$user_id,u[vs]!==$s&&(delete o[es],delete o[ts]),delete o.__alias)}s=zi(o,u)}else s=zi(n,o);return Df.Dr(t,s),s}catch(t){}return null},Dr(t,r,n,s,o,a){var l=Df.Dr(t,r,void 0,void 0,a);try{var u=Hf(r,e);if(Object.keys(u).length){if(i){var h=jf(t),d=Wf(u,e);if(Lf.Dr(h,d,n,s,o,a),Lf.Pr(h)!==JSON.stringify(d)){Lf.qr(h,s);var v=Hf(r);return Lf.Dr(t,v,n,s,o,a),l}}Lf.Dr(t,u,n,s,o,a)}}catch(t){Df.jr(t)}return l},qr(e,i){try{null==t||t.localStorage.removeItem(e),Lf.qr(e,i),Lf.qr(jf(e),i)}catch(t){Df.jr(t)}}})}(e.cookie_persisted_properties||[],e.cookieWinsOnConflict),n=!1,s=e.persistence.toLowerCase();return"localstorage"===s&&Df.Nr()?(i=Df,n=!0):"localstorage+cookie"===s&&r.Nr()?(i=r,n=!0):"sessionstorage"===s&&Kf.Nr()?i=Kf:"memory"===s?i=Qf:"cookie"===s?i=Lf:r.Nr()?(i=r,n=!0):i=Lf,this.Es=n,i}Js(t){return this.Ls+"__"+t}Ds(t){return this.Es&&!!t.split_storage}properties(){var t={};return Hi(this.props,((e,i)=>{var r=Tb(i);if(!r||"event"===r.exposure){if(null!=r&&null!=r.shouldSkipFromEventProperties&&r.shouldSkipFromEventProperties(e))return;t[i]=e}})),t}load(t){if(void 0===t&&(t=!1),!this.Hs||t){var e=this.qi.cookieWinsOnConflict&&"localstorage+cookie"===this.qi.persistence.toLowerCase(),i=e?Df.Br(this.Ls):null,r={};if(e)try{Hi(r=Uf(Lf.Br(this.Ls)),((t,e)=>{(at(t)||ht(t)||""===t)&&delete r[e]}))}catch(t){}var n=this.ps.Br(this.Ls);if(n&&(this.props=zi({},n)),this.Is&&this.Ks(),e&&n){var s,o,a=null==i?void 0:i[fn],l=null!==(s=null==i?void 0:i[vs])&&void 0!==s?s:Ls,u=n[fn],h=null!==(o=n[vs])&&void 0!==o?o:Ls;if(u!==a||h!==l){this.Rs=!0,Kf.Dr(Ib(this.Ls),!0);var d=zi({},this.props);Nf.forEach((t=>delete d[t])),h===Ls&&(l===$s||r[vs]===Ls||!at(a)&&u!==a)&&(Pb(d,r),delete d[ts]),this.props=d;var v=new Set;Nf.forEach((t=>{var e,i=null==(e=Tb(t))?void 0:e.storageGroup;i&&v.add(i)})),v.forEach((t=>{var e={};Hi(this.props,((i,r)=>{var n;(null==(n=Tb(r))?void 0:n.storageGroup)===t&&(e[r]=i)})),ot(e)?(Df.qr(this.Js(t)),this.Ms[t]={}):Df.Dr(this.Js(t),e)&&(this.Ms[t]={persisted:!0,fingerprint:this.Ys(e,t)})}))}}Kf.Pr(Ib(this.Ls))&&(this.Rs=!0)}}Ks(){for(var t of Sb){var e=Df.Br(this.Js(t));if(e&&!ot(e)){var i=this.Xs(t);i.persisted=!0,this.ta(t)||(i.fingerprint=this.Ys(e,t)),this.ea(t,e)||zi(this.props,e)}}}ta(t){return Object.keys(this.props).some((e=>{var i;return(null==(i=Tb(e))?void 0:i.storageGroup)===t}))}ea(t,e){var i=Eb[t];if(!i)return!1;var r=e[i],n=this.props[i];return vt(r)&&vt(n)&&n>r}refreshKey(t){var e;if(!this.Hs){var i=this.Is?null==(e=Tb(t))?void 0:e.storageGroup:void 0,r=i?Df.Br(this.Js(i)):this.ps.Br(this.Ls);if(r&&t in r)this.Us(t,r[t]);else{if(i){var n=this.ps.Br(this.Ls);if(n&&t in n)return void this.Us(t,n[t])}this.zs(t)}}}save(){if(!this.Hs){var t=this.$s();t>0?at(this.Gs)&&(this.Gs=setTimeout((()=>{this.Gs=void 0,this.Zs()}),t)):this.Zs()}}flush(){at(this.Gs)||(clearTimeout(this.Gs),this.Gs=void 0,this.Zs())}Zs(t){void 0===t&&(t=!1),this.Hs||this.Ps&&!t||(t||this.syncCookieProperties(),this.Is?this.ia():this.ra(this.ps,this.Ls,this.props,Rb)&&this.Ns(this.props))}ia(){var t=this.na(),e=t.main,i=t.groups;for(var r of(this.ra(this.ps,this.Ls,e,Rb)&&this.Ns(e),Sb)){var n,s=i[r];(!ot(s)||null!=(n=this.Ms[r])&&n.persisted)&&this.ra(Df,this.Js(r),s,r)}}na(){var t={},e={flags:{},surveys:{}};return Hi(this.props,((i,r)=>{var n,s=null==(n=Tb(r))?void 0:n.storageGroup;s?e[s][r]=i:t[r]=i})),{main:t,groups:e}}Ys(t,e){if(e===Rb)return JSON.stringify(t)+"|"+this.sa+"|"+this.aa+"|"+this.oa;var i={};return Hi(t,((t,e)=>{var r;i[e]=null!=(r=Tb(e))&&r.volatile?"__volatile__":t})),JSON.stringify(i)}ra(t,e,i,r){var n,s=this.Xs(r);if(r!==Rb&&!s.dirty&&!at(s.fingerprint))return!1;try{if((n=this.Ys(i,r))===s.fingerprint)return s.dirty=!1,!1}catch(t){n=void 0}return t.Dr(e,i,this.sa,this.aa,this.oa,this.qi.debug)?(s.dirty=!1,r!==Rb&&(s.persisted=!0),at(n)||(s.fingerprint=n),!0):(this.qi.debug&&ji.warn('failed to persist storage entry "'+e+'"; will retry on next save'),!1)}remove(t){var e=(void 0===t?{}:t).keepGroupEntries,i=void 0!==e&&e;if(at(this.Gs)||(clearTimeout(this.Gs),this.Gs=void 0),this.ps.qr(this.Ls,!1),this.ps.qr(this.Ls,!0),!i&&this.As)for(var r of Sb)Df.qr(this.Js(r));i?delete this.Ms[Rb]:this.Ms={},this.qs=void 0,this.js=void 0}clear(){this.remove(),this.props={}}register_once(t,e,i){if(st(t)){this.syncCookieProperties(),at(e)&&(e="None"),this.sa=at(i)?this.la:i;var r=!1;if(Hi(t,((t,i)=>{this.props.hasOwnProperty(i)&&this.props[i]!==e||(this.Us(i,t),r=!0)})),r)return this.save(),!0}return!1}register(t,e){if(st(t)){this.syncCookieProperties(),this.sa=at(e)?this.la:e;var i=!1;if(Hi(t,((e,r)=>{t.hasOwnProperty(r)&&(this.props[r]!==e||st(e)||rt(e))&&(this.Us(r,e),i=!0)})),i)return this.save(),!0}return!1}unregister(t){this.syncCookieProperties();var e="string"==typeof t?[t]:t,i=!1;for(var r of e)r in this.props&&(this.zs(r),i=!0);i&&this.save()}update_campaign_params(){var t=null==r?void 0:r.URL;if(t!==this.Fs){var e=Na(this.qi.custom_campaign_params,this.qi.mask_personal_data_properties,this.qi.custom_personal_data_properties);ot(Zi(e))||this.register(e),this.Fs=t}}update_search_keyword(){var t;this.register((t=null==r?void 0:r.referrer)?ja(t):{})}update_referrer_info(){var t;this.register_once({$referrer:Ha(),$referring_domain:null!=r&&r.referrer&&(null==(t=er(r.referrer))?void 0:t.host)||Ua},void 0)}set_initial_person_info(){this.props[ps]||this.props[gs]||this.register_once({[ms]:za(this.qi.mask_personal_data_properties,this.qi.custom_personal_data_properties,this.qi.disable_capture_url_hashes)},void 0)}get_initial_props(){var t={};Hi([gs,ps],(e=>{var i=this.props[e];i&&Hi(i,(function(e,i){t["$initial_"+Y(i)]=e}))}));var e=this.props[ms];if(e){var i=function(t,e){void 0===e&&(e=!1);var i=Wa(t,e),r={};return Hi(i,(function(t,e){r["$initial_"+Y(e)]=t})),r}(e,this.qi.disable_capture_url_hashes);zi(t,i)}return t}safe_merge(t){return Hi(this.props,(function(e,i){i in t||(t[i]=e)})),t}update_config(t,e,i){var r=t.persistence!==e.persistence,n=!((t,e)=>{if(t.length!==e.length)return!1;var i=[...t].sort(),r=[...e].sort();return i.every(((t,e)=>t===r[e]))})(t.cookie_persisted_properties||[],e.cookie_persisted_properties||[]),s=r||n,o=t.cookieWinsOnConflict!==e.cookieWinsOnConflict,a=t.disable_persistence||!!i,l=!!this.Hs&&!a;a||this.Bs(e,l),this.qi=t,!a&&(r||n||o)&&(this.qs=void 0,this.js=void 0,this.Bs(p({},t,{cookie_persisted_properties:e.cookie_persisted_properties}),l));var u=s||o?this.Os(t):this.ps,h=this.Ds(t),d=s||h!==this.Is,v=!a&&(d||t.cross_subdomain_cookie!==this.aa||t.secure_cookie!==this.oa)&&this.Ws(l);try{if(this.la=this.sa=t.cookie_expiration,this.set_disabled(a),this.set_cross_subdomain(t.cross_subdomain_cookie),this.set_secure(t.secure_cookie),d){var c=this.props;this.clear(),this.ps=u,this.Is=h,this.props=c,this.save()}else o&&(this.ps=u,a||(delete this.Ms[Rb],this.Zs()))}finally{v&&this.Qs()}}set_disabled(t){this.Hs=t,this.Hs?this.remove():this.save()}set_cross_subdomain(t){t!==this.aa&&(this.aa=t,this.remove({keepGroupEntries:!0}),this.save())}set_secure(t){t!==this.oa&&(this.oa=t,this.remove({keepGroupEntries:!0}),this.save())}set_event_timer(t,e){var i=this.props[yn]||{};i[t]=e,this.Us(yn,i),this.save()}remove_event_timer(t){var e=this.props[yn]||{},i=e[t];return at(i)||(delete e[t],this.Us(yn,e),this.save()),i}get_property(t){return this.props[t]}set_property(t,e){this.Us(t,e),this.save()}Us(t,e){var i;this.props[t]=e,null!=(i=Tb(t))&&i.volatile||this.ua(t)}zs(t){delete this.props[t],this.ua(t)}ua(t){var e,i=null==(e=Tb(t))?void 0:e.storageGroup;i&&(this.Xs(i).dirty=!0)}Xs(t){return this.Ms[t]||(this.Ms[t]={})}}var Ob={backgroundColor:"#ffffff",textColor:"#1d1f27",buttonColor:"#1d1f27",borderRadius:8,buttonBorderRadius:6,borderColor:"#e5e7eb",fontFamily:"system-ui",boxShadow:"0 4px 12px rgba(0, 0, 0, 0.15)",showOverlay:!0,whiteLabel:!1,dismissOnClickOutside:!0,zIndex:2147483646},Fb={SHOWN:"product tour shown",DISMISSED:"product tour dismissed",COMPLETED:"product tour completed",STEP_SHOWN:"product tour step shown",STEP_COMPLETED:"product tour step completed",BUTTON_CLICKED:"product tour button clicked",STEP_SELECTOR_FAILED:"product tour step selector failed",BANNER_CONTAINER_SELECTOR_FAILED:"product tour banner container selector failed",BANNER_ACTION_CLICKED:"product tour banner action clicked"},Lb={TOUR_ID:"$product_tour_id",TOUR_NAME:"$product_tour_name",TOUR_ITERATION:"$product_tour_iteration",TOUR_RENDER_REASON:"$product_tour_render_reason",TOUR_STEP_ID:"$product_tour_step_id",TOUR_STEP_ORDER:"$product_tour_step_order",TOUR_STEP_TYPE:"$product_tour_step_type",TOUR_DISMISS_REASON:"$product_tour_dismiss_reason",TOUR_BUTTON_TEXT:"$product_tour_button_text",TOUR_BUTTON_ACTION:"$product_tour_button_action",TOUR_BUTTON_LINK:"$product_tour_button_link",TOUR_BUTTON_TOUR_ID:"$product_tour_button_tour_id",TOUR_STEPS_COUNT:"$product_tour_steps_count",TOUR_STEP_SELECTOR:"$product_tour_step_selector",TOUR_STEP_SELECTOR_FOUND:"$product_tour_step_selector_found",TOUR_STEP_ELEMENT_TAG:"$product_tour_step_element_tag",TOUR_STEP_ELEMENT_ID:"$product_tour_step_element_id",TOUR_STEP_ELEMENT_CLASSES:"$product_tour_step_element_classes",TOUR_STEP_ELEMENT_TEXT:"$product_tour_step_element_text",TOUR_ERROR:"$product_tour_error",TOUR_MATCHES_COUNT:"$product_tour_matches_count",TOUR_FAILURE_PHASE:"$product_tour_failure_phase",TOUR_WAITED_FOR_ELEMENT:"$product_tour_waited_for_element",TOUR_WAIT_DURATION_MS:"$product_tour_wait_duration_ms",TOUR_BANNER_SELECTOR:"$product_tour_banner_selector",TOUR_LINKED_SURVEY_ID:"$product_tour_linked_survey_id",USE_MANUAL_SELECTOR:"$use_manual_selector",INFERENCE_DATA_PRESENT:"$inference_data_present",TOUR_LAST_SEEN_DATE:"$product_tour_last_seen_date",TOUR_TYPE:"$product_tour_type"},$b=Bi("[RateLimiter]");class Db{constructor(t){this.serverLimits={},this.lastEventRateLimited=!1,this.checkForLimiting=t=>{var e=t.text;if(e&&e.length)try{(JSON.parse(e).quota_limited||[]).forEach((t=>{$b.info((t||"events")+" is quota limited."),this.serverLimits[t]=(new Date).getTime()+6e4}))}catch(t){return void $b.warn('could not rate limit - continuing. Error: "'+(null==t?void 0:t.message)+'"',{text:e})}},this.instance=t,this.lastEventRateLimited=this.clientRateLimitContext(!0).isRateLimited}get captureEventsPerSecond(){var t;return(null==(t=this.instance.config.rate_limiting)?void 0:t.events_per_second)||10}get captureEventsBurstLimit(){var t;return Math.max((null==(t=this.instance.config.rate_limiting)?void 0:t.events_burst_limit)||10*this.captureEventsPerSecond,this.captureEventsPerSecond)}clientRateLimitContext(t){var e,i,r;void 0===t&&(t=!1);var n=this.captureEventsBurstLimit,s=this.captureEventsPerSecond,o=(new Date).getTime(),a=null!==(e=null==(i=this.instance.persistence)?void 0:i.get_property(fs))&&void 0!==e?e:{tokens:n,last:o};a.tokens+=(o-a.last)/1e3*s,a.last=o,a.tokens>n&&(a.tokens=n);var l=1>a.tokens;if(l||t||(a.tokens=Math.max(0,a.tokens-1)),l&&!t){var u=(vt(a.dropped)?a.dropped:0)+1;a.dropped=u,!this.lastEventRateLimited&&this.ha(u)&&(a.dropped=0)}return this.lastEventRateLimited=l,null==(r=this.instance.persistence)||r.set_property(fs,a),{isRateLimited:l,remainingTokens:a.tokens}}da(t){var e=this.instance.config.property_denylist;return!rt(e)||!e.includes(t)}va(){var t;if(this.da("$current_url")&&this.da("$pathname")&&null!=n&&n.pathname)return""+(null!==(t=n.origin)&&void 0!==t?t:"")+n.pathname}ha(t){var e,i,r=this.captureEventsBurstLimit,n=this.captureEventsPerSecond,s=this.va(),o=this.da("$session_id")?null==(e=(i=this.instance).get_session_id)?void 0:e.call(i):void 0,a=[t+" event(s) dropped since the last warning",s?"triggered on "+s: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 "+n+" events per second and "+r+" events burst limit."},{skip_client_rate_limiting:!0})}isServerRateLimited(t){var e=this.serverLimits[t||"events"]||!1;return!1!==e&&(new Date).getTime()<e}}var Nb=Bi("[RemoteConfig]");class qb{constructor(t){this._instance=t}get remoteConfig(){var t;return null==(t=v._POSTHOG_REMOTE_CONFIG)||null==(t=t[this._instance.config.token])?void 0:t.config}ca(t){var e,i;null!=(e=v.__PosthogExtensions__)&&e.loadExternalDependency?null==(i=v.__PosthogExtensions__)||null==i.loadExternalDependency||i.loadExternalDependency(this._instance,"remote-config",(()=>t(this.remoteConfig))):t()}fa(t){this._instance._send_request({method:"GET",url:this._instance.requestRouter.endpointFor("assets","/array/"+this._instance.config.token+"/config"),callback:t})}load(){try{if(this.remoteConfig)return Nb.info("Using preloaded remote config",this.remoteConfig),this.pa(this.remoteConfig),void this.ga();if(this._instance.ma())return void Nb.warn("Remote config is disabled. Falling back to local config.");this.ca((t=>{if(!t)return Nb.info("No config found after loading remote JS config. Falling back to JSON."),void this.fa((t=>{this.pa(t.json,t),this.ga()}));this.pa(t),this.ga()}))}catch(t){Nb.error("Error loading remote config",t),this.pa()}}stop(){this.ya&&(clearInterval(this.ya),this.ya=void 0)}refresh(){!this._instance.ma()&&r&&"hidden"!==r.visibilityState&&this._instance.reloadFeatureFlags()}ga(){var t;if(!this.ya){var e=null!==(t=this._instance.config.remote_config_refresh_interval_ms)&&void 0!==t?t:3e5;0!==e&&(this.ya=setInterval((()=>{this.refresh()}),e))}}pa(t,e){!t&&e&&(0===e.statusCode?e.error||Nb.warn("Failed to fetch remote config from PostHog."):Nb.error("Failed to fetch remote config from PostHog."));try{this._instance.pa(t?{ok:!0,config:t}:{ok:!1})}catch(t){Nb.error("Error applying remote config",t)}if(!1!==(null==t?void 0:t.hasFeatureFlags)&&!this._instance.config.advanced_disable_feature_flags_on_first_load)try{var i;null==(i=this._instance.featureFlags)||i.ensureFlagsLoaded()}catch(t){Nb.error("Error loading feature flags",t)}}}var jb=["fatal","error","warning","log","info","debug"],Bb=!!o||!!s,Ub="text/plain",Hb=!1,zb=(t,e)=>{var i=t.split("#"),r=i[1],n=i[0].split("?"),s=n[0],o=n[1];if(!o)return t;var a=o.split("&").filter((t=>t.split("=")[0]!==e)).join("&");return s+(a?"?"+a:"")+(r?"#"+r:"")},Wb=function(t,e,i){var r;void 0===i&&(i=!0);var n=t.split("?"),s=n[0],o=n[1],a=p({},e),l=null!==(r=null==o?void 0:o.split("&").map((t=>{var e,r=t.split("="),n=r[0],s=i&&null!==(e=a[n])&&void 0!==e?e:r[1];return delete a[n],n+"="+s})))&&void 0!==r?r:[],u=ir(a);return u&&l.push(u),l.length>0?s+"?"+l.join("&"):s},Vb=t=>{if(t.ba)return t.ba;var e=t.data,i=t.compression;if(e){if(i===nf.GZipJS){var r=ra(na(tr(e)),{mtime:0});return{contentType:Ub,body:r.buffer.slice(r.byteOffset,r.byteOffset+r.byteLength),estimatedSize:r.byteLength}}if(i===nf.Base64){var n=function(t){return t?btoa(encodeURIComponent(t).replace(/%([0-9A-F]{2})/g,((t,e)=>String.fromCharCode(parseInt(e,16))))):t}(tr(e)),s=(t=>"data="+encodeURIComponent("string"==typeof t?t:tr(t)))(n);return{contentType:"application/x-www-form-urlencoded",body:s,estimatedSize:new Blob([s]).size}}var o=tr(e);return{contentType:"application/json",body:o,estimatedSize:new Blob([o]).size}}},Gb=t=>{var e,i,r=()=>"sendBeacon"===t.transport?{url:Wb(t.url,{compression:nf.Base64}),encodedBody:Vb(p({},t,{compression:nf.Base64,ba:void 0}))}:{url:zb(t.url,"compression"),encodedBody:Vb(p({},t,{compression:void 0,ba:void 0}))};try{e=Vb(t)}catch(e){if(A(t.compression,rr(t.url,"compression")))return ji.error("Failed to gzip request body, sending uncompressed payload",e),r();throw e}return e&&A(t.compression,rr(t.url,"compression"))&&!((i=e.body)instanceof ArrayBuffer?P(new Uint8Array(i)):ArrayBuffer.isView(i)&&P(new Uint8Array(i.buffer,i.byteOffset,i.byteLength)))?(Hb=!0,r()):{url:t.url,encodedBody:e}},Zb=t=>{try{return Gb(t)}catch(e){return ji.error(e),void(null==t.callback||t.callback({statusCode:0,error:e}))}},Qb=function(){var t=f((function*(t){var e=tr(t.data),i=yield N(e,Ni.DEBUG,{rethrow:!0});if(!i)return t;var r=yield i.arrayBuffer();return p({},t,{ba:{contentType:Ub,body:r,estimatedSize:r.byteLength}})}));return function(e){return t.apply(this,arguments)}}(),Jb=/Failed to fetch|NetworkError|Load failed/i,Kb=t=>"TypeError"===(null==t?void 0:t.name)&&Jb.test((null==t?void 0:t.message)||""),Yb=t=>{var e=Zb(t);if(e){var i=e.url,r=e.encodedBody,n=null!=r?r:{},o=n.contentType,l=n.body,u=n.estimatedSize,h=new Headers;Hi(t.headers,(function(t,e){h.append(e,t)})),o&&h.append("Content-Type",o);var d=null,v=!1;if(a){var c=new a;d={signal:c.signal,timeout:setTimeout((()=>{var e,i;v=!0,c.abort((e=t.timeout,(i=new Error("PostHog request timed out"+(e?" after "+e+"ms":""))).name="AbortError",i))}),t.timeout)}}var f=e=>{v&&"AbortError"===(null==e?void 0:e.name)||Kb(e)?ji.warn(e):ji.error(e),null==t.callback||t.callback({statusCode:0,error:e})};try{var g;s(i,p({method:(null==t?void 0:t.method)||"GET",headers:h,keepalive:"POST"===t.method&&!t._a&&52428.8>(u||0),body:l,signal:null==(g=d)?void 0:g.signal},t.fetchOptions)).then((e=>e.text().then((i=>{var r={statusCode:e.status,text:i};if(200===e.status)try{r.json=JSON.parse(i)}catch(t){ji.error(t)}null==t.callback||t.callback(r)})))).catch(f).finally((()=>d?clearTimeout(d.timeout):null))}catch(t){d&&clearTimeout(d.timeout),f(t)}}},Xb=t=>{try{var e,r=Gb(t),n=r.url,s=r.encodedBody,o=null!=s?s:{},a=o.body,l=o.estimatedSize;if(!a)return;var u=a instanceof Blob?a:new Blob([a],{type:o.contentType});if(i.sendBeacon(n,u))return;var h=rt(t.data)?t.data:null==(e=t.data)?void 0:e.batch;if(rt(h)&&h.length>1&&(null!=l?l:0)>16384){var d=Math.ceil(h.length/2),v=e=>rt(t.data)?e:p({},t.data,{batch:e});return Xb(p({},t,{data:v(h.slice(0,d))})),void Xb(p({},t,{data:v(h.slice(d))}))}ji.warn("Beacon of ~"+(null!=l?l:0)+" bytes was rejected by the browser, falling back to fetch"),Yb(p({},t,{_a:!0}))}catch(t){ji.warn("Beacon send failed",t)}},tw=(t,e,i,r)=>{var n="query"===r?"POST"===e?"sent_at":"_":void 0;return Wb(i===nf.GZipJS?zb(t,"compression"):t,p({},n?{[n]:Date.now().toString()}:{},i===nf.GZipJS?{}:{compression:i}))},ew=[];s&&ew.push({transport:"fetch",method:Yb}),o&&ew.push({transport:"XHR",method(t){var e=Zb(t);if(e){var i=new o,r=e.encodedBody;i.open(t.method||"GET",e.url,!0);var n=null!=r?r:{},s=n.contentType,a=n.body;Hi(t.headers,(function(t,e){i.setRequestHeader(e,t)})),s&&i.setRequestHeader("Content-Type",s),t.timeout&&(i.timeout=t.timeout),i.onreadystatechange=()=>{if(4===i.readyState){var e={statusCode:i.status,text:i.responseText};if(200===i.status)try{e.json=JSON.parse(i.responseText)}catch(t){}null==t.callback||t.callback(e)}},i.send(a)}}}),null!=i&&i.sendBeacon&&ew.push({transport:"sendBeacon",method:Xb});var iw=3e3;class rw{constructor(t,e){this.wa=!0,this.ka=[],this.Sa=Tt((null==e?void 0:e.flush_interval_ms)||iw,250,5e3,ji.createLogger("flush interval"),iw),this.xa=t}enqueue(t){this.ka.push(t),this.Ca||this.Ta()}unload(){this.Ma();var t=this.ka.length>0?this.Ea():{},e=Object.values(t),i=[...e.filter((t=>0===t.url.indexOf("/e"))),...e.filter((t=>0!==t.url.indexOf("/e")))];i.map((t=>{this.Ia(p({},t,{transport:"sendBeacon"}))}))}enable(){this.wa=!1,this.Ta()}Ta(){var t=this;this.wa||(this.Ca=setTimeout((()=>{if(this.Ma(),this.ka.length>0){var e=this.Ea(),i=function(){var i=e[r],n=(new Date).getTime();i.data&&rt(i.data)&&Hi(i.data,(t=>{t.offset=Math.abs(t.timestamp-n),delete t.timestamp})),t.Ia(i)};for(var r in e)i()}}),this.Sa))}Ia(t){try{this.xa(t)}catch(t){ji.error(t)}}Ma(){clearTimeout(this.Ca),this.Ca=void 0}Ea(){var t={};return Hi(this.ka,(e=>{var i,r=e,n=(r?r.batchKey:null)||r.url;at(t[n])&&(t[n]=p({},r,{data:[]})),null==(i=t[n].data)||i.push(r.data)})),this.ka=[],t}}var nw=["retriesPerformedSoFar"];class sw{constructor(e){this.Ra=!1,this.Pa=3e3,this.ka=[],this._instance=e,this.ka=[],this.Aa=!0,!at(t)&&"onLine"in t.navigator&&(this.Aa=t.navigator.onLine,this.Fa=()=>{this.Aa=!0,this.La()},this.Oa=()=>{this.Aa=!1},Ki(t,"online",this.Fa),Ki(t,"offline",this.Oa))}get length(){return this.ka.length}retriableRequest(t){var e=t.retriesPerformedSoFar,i=g(t,nw);ct(e)&&(i.url=Wb(i.url,{retry_count:e})),this._instance._send_request(p({},i,{callback:t=>{if(200!==t.statusCode&&(400>t.statusCode||t.statusCode>=500)){if((0===t.statusCode?3:10)>(null!=e?e:0))return void this.xn(p({retriesPerformedSoFar:e},i));0===t.statusCode&&ji.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!=e?e:0)+" retries.")}null==i.callback||i.callback(t)}}))}xn(t){var e=t.retriesPerformedSoFar||0;t.retriesPerformedSoFar=e+1;var i=function(t){var e=3e3*Math.pow(2,t),i=e/2,r=Math.min(18e5,e),n=Math.random()-.5;return Math.ceil(r+n*(r-i))}(e),r=Date.now()+i;this.ka.push({retryAt:r,requestOptions:t});var n="Enqueued failed request for retry in "+i;navigator.onLine||(n+=" (Browser is offline)"),ji.warn(n),this.Ra||(this.Ra=!0,this.Da())}Da(){if(this.$a&&clearTimeout(this.$a),0===this.ka.length)return this.Ra=!1,void(this.$a=void 0);this.$a=setTimeout((()=>{this.Aa&&this.ka.length>0&&this.La(),this.Da()}),this.Pa)}La(){var t=Date.now(),e=[],i=this.ka.filter((i=>t>i.retryAt||(e.push(i),!1)));if(this.ka=e,i.length>0)for(var r of i)this.retriableRequest(r.requestOptions)}unload(){for(var e of(this.$a&&(clearTimeout(this.$a),this.$a=void 0),this.Ra=!1,at(t)||(this.Fa&&(t.removeEventListener("online",this.Fa),this.Fa=void 0),this.Oa&&(t.removeEventListener("offline",this.Oa),this.Oa=void 0)),this.ka)){var i=e.requestOptions;try{this._instance._send_request(p({},i,{transport:"sendBeacon"}))}catch(t){ji.error(t)}}this.ka=[]}}class ow{constructor(t){this.Na=()=>{var t,e,i,r;this.qa||(this.qa={});var n=this.scrollElement(),s=this.scrollY(),o=n?Math.max(0,n.scrollHeight-n.clientHeight):0,a=s+((null==n?void 0:n.clientHeight)||0),l=(null==n?void 0:n.scrollHeight)||0;this.qa.lastScrollY=Math.ceil(s),this.qa.maxScrollY=Math.max(s,null!==(t=this.qa.maxScrollY)&&void 0!==t?t:0),this.qa.maxScrollHeight=Math.max(o,null!==(e=this.qa.maxScrollHeight)&&void 0!==e?e:0),this.qa.lastContentY=a,this.qa.maxContentY=Math.max(a,null!==(i=this.qa.maxContentY)&&void 0!==i?i:0),this.qa.maxContentHeight=Math.max(l,null!==(r=this.qa.maxContentHeight)&&void 0!==r?r:0)},this._instance=t}get ja(){return this._instance.config.scroll_root_selector}getContext(){return this.qa}resetContext(){var t=this.qa;return setTimeout(this.Na,0),t}startMeasuringScrollPosition(){Ki(t,"scroll",this.Na,{capture:!0}),Ki(t,"scrollend",this.Na,{capture:!0}),Ki(t,"resize",this.Na)}scrollElement(){if(!this.ja)return null==t?void 0:t.document.documentElement;var e=rt(this.ja)?this.ja:[this.ja];for(var i of e){var r=null==t?void 0:t.document.querySelector(i);if(r)return r}}Ba(e){var i="y"===e?"scrollTop":"scrollLeft";if(this.ja){var r=this.scrollElement();return r&&r[i]||0}return t?"y"===e?t.scrollY||t.pageYOffset||t.document.documentElement.scrollTop||0:t.scrollX||t.pageXOffset||t.document.documentElement.scrollLeft||0:0}scrollY(){return this.Ba("y")}scrollX(){return this.Ba("x")}}var aw=t=>za(null==t?void 0:t.config.mask_personal_data_properties,null==t?void 0:t.config.custom_personal_data_properties,null==t?void 0:t.config.disable_capture_url_hashes);class lw{constructor(t,e,i,r){this.ot=t=>{var e=this.Ha();if(!e||e.sessionId!==t){var i={sessionId:t,props:this.Ua(this._instance)};this.za.register({[cs]:i})}},this._instance=t,this.Wa=e,this.za=i,this.Ua=r||aw,this.Wa.onSessionId(this.ot)}Ha(){return this.za.props[cs]}getSetOnceProps(){var t,e=null==(t=this.Ha())?void 0:t.props;return e?"r"in e?Wa(e,this._instance.config.disable_capture_url_hashes):{$referring_domain:e.referringDomain,$pathname:e.initialPathName,utm_source:e.utm_source,utm_campaign:e.utm_campaign,utm_medium:e.utm_medium,utm_content:e.utm_content,utm_term:e.utm_term}:{}}getSessionProps(){var t={};return Hi(Zi(this.getSetOnceProps()),((e,i)=>{"$current_url"===i&&(i="url"),t["$session_entry_"+Y(i)]=e})),t}}class uw{on(t,e){return this.Va[t]||(this.Va[t]=[]),this.Va[t].push(e),()=>{this.Va[t]=this.Va[t].filter((t=>t!==e))}}emit(t,e){for(var i of this.Va[t]||[])i(e);for(var r of this.Va["*"]||[])r(t,e)}constructor(){this.Va={}}}var hw=Bi("[SessionId]"),dw=864e5;class vw{on(t,e){return this.Ga.on(t,e)}constructor(t,e,i){var r;if(this.Za=null,this.Qa=null,this.Ja=[],this.Ka=void 0,this.Ya=!1,this.Ga=new uw,this.Xa=(t,e)=>!(!ct(t)||!ct(e))&&Math.abs(t-e)>this.sessionTimeoutMs,!t.persistence)throw new Error("SessionIdManager requires a PostHogPersistence instance");if(t.config.cookieless_mode===Fs)throw new Error('SessionIdManager cannot be used with cookieless_mode="always"');this.qi=t.config,this.za=t.persistence,this.st=void 0,this._e=void 0,this._sessionStartTimestamp=null,this.eo=void 0,this._sessionActivityTimestamp=null,this.io=e||Pf,this.ro=i||Pf;var n=this.qi.persistence_name||this.qi.token;if(this._sessionTimeoutMs=1e3*Tt(this.qi.session_idle_timeout_seconds||1800,60,36e3,hw.createLogger("session_idle_timeout_seconds"),1800),t.register({$configured_session_timeout_ms:this._sessionTimeoutMs}),this.no(),this.so="ph_"+n+"_window_id",this.ao="ph_"+n+"_primary_window_exists",this.oo()){var s=Kf.Br(this.so),o=Kf.Br(this.ao);s&&!o?this.st=s:Kf.qr(this.so),Kf.Dr(this.ao,!0)}null!=(r=this.qi.bootstrap)&&r.sessionID&&this.setBootstrapSessionId(this.qi.bootstrap.sessionID),this.lo()}get sessionTimeoutMs(){return this._sessionTimeoutMs}onSessionId(t){return at(this.Ja)&&(this.Ja=[]),this.Ja.push(t),this._e&&t(this._e,this.st),()=>{this.Ja=this.Ja.filter((e=>e!==t))}}oo(){return"memory"!==this.qi.persistence&&!this.za.Hs&&Kf.Nr()}uo(t){t!==this.st&&(this.st=t,this.oo()&&Kf.Dr(this.so,t))}ho(){return this.st?this.st:this.oo()?Kf.Br(this.so):null}do(t){var e=this.Za;return!ht(e)&&!ht(t)&&5e3>Math.abs(t-e)}vo(t,e,i){var r=e!==this._sessionActivityTimestamp,n=!(t!==this._e||i!==this._sessionStartTimestamp);this._sessionStartTimestamp=i,this._sessionActivityTimestamp=e,this._e=t,n&&!r||n&&this.do(e)||(this.Za=e,this.za.register({[Fn]:[e,t,i]}))}co(){var t,e=null==(t=this.qi)?void 0:t.persistence_save_debounce_ms;return ct(e)&&e>0}fo(){this.co()?this.za.refreshKey(Fn):(this.za.flush(),this.za.load())}po(){var t;if(!ht(this._sessionActivityTimestamp)&&this._sessionActivityTimestamp!==this.Za){this.fo();var e=this.mo();e[1]===this._e&&e[2]===this._sessionStartTimestamp&&(this.Za=this._sessionActivityTimestamp,this.za.register({[Fn]:[this._sessionActivityTimestamp,null!==(t=this._e)&&void 0!==t?t:null,this._sessionStartTimestamp]}),this.za.flush())}}yo(){var t=this.mo()[0],e=ct(t)?t:0,i=ct(this._sessionActivityTimestamp)?this._sessionActivityTimestamp:0;return Math.max(e,i)}bo(t){return this.fo(),this.Xa(t,this.yo())}mo(){var t=this.za.props[Fn];return rt(t)&&2===t.length&&t.push(t[0]),t||[0,null,0]}resetSessionId(){this.Za=null,this.eo=void 0,clearTimeout(this._o),this._o=void 0,this.vo(null,null,null)}setBootstrapSessionId(t,e){void 0===e&&(e=!1);var i=function(t,e){void 0===e&&(e=(new Date).getTime());try{var i=(t=>{var e=t.replace(/-/g,"");if(32!==e.length)throw new Error("Not a valid UUID");if("7"!==e[12])throw new Error("Not a UUIDv7");return parseInt(e.substring(0,12),16)})(t);return i>e+6e4?void hw.error("Bootstrap sessionID cannot be in the future"):i}catch(t){return void hw.error("Invalid sessionID in bootstrap",t)}}(t);return!at(i)&&(e?this.eo={sessionId:t,sessionStartTimestamp:i}:this.vo(t,(new Date).getTime(),i),!0)}destroy(){this.Ya=!0,this.po(),clearTimeout(this._o),this._o=void 0,this.Ka&&t&&(t.removeEventListener(qs,this.Ka,{capture:!1}),this.Ka=void 0),this.Ja=[]}lo(){this.Ka=()=>{this.po(),this.oo()&&Kf.qr(this.ao)},Ki(t,qs,this.Ka,{capture:!1})}checkAndGetSessionAndWindowId(t,e,i){if(void 0===t&&(t=!1),void 0===e&&(e=null),void 0===i&&(i=!1),this.qi.cookieless_mode===Fs)throw new Error('checkAndGetSessionAndWindowId should not be called with cookieless_mode="always"');var r=e||(new Date).getTime(),n=this._e;if(i)this.Qa=r;else if(ht(this.Qa)||this.Qa>r||r-this.Qa>=1e3){var s,o;null==(s=(o=this.za).syncCookieProperties)||s.call(o),this.Qa=r}var a=this.mo(),l=a[1],u=a[2],h=!at(n)&&l!==n,d=this.yo(),v=this.ho(),c=this.eo,f=!!c&&(c.sessionStartTimestamp>r+6e4||r-c.sessionStartTimestamp>dw),p=c?f:ct(u)&&Math.abs(r-u)>dw,g=!1,m=h,y=!l||!!c,_=l,b=!y&&!t&&this.Xa(r,d);if(b){(b=this.bo(r))||hw.info("cross-tab refresh kept the session alive",{sessionId:l});var w=this.mo();l=w[1],u=w[2]}if(y||b||p){m=!1;var k=c&&!f;l=k?c.sessionId:this.io(),v=this.ro(),hw.info("new session ID assigned",{sessionId:l,windowId:v,bootstrapped:!!k,changeReason:{noSessionId:y,activityTimeout:b,sessionPastMaximumLength:p}}),u=k?c.sessionStartTimestamp:r,this.eo=void 0,g=!0}else v||(v=this.ro(),g=!0),(m=m||l!==_)&&(hw.info("adopted cross-tab session id",{sessionId:l,windowId:v}),g=!0);var S=ct(d)&&t&&!p?d:r,x=ct(u)?u:(new Date).getTime();this.uo(v),this.vo(l,S,x),t||this.no();var C={noSessionId:y,activityTimeout:b,sessionPastMaximumLength:p,crossTabAdoption:m};return g&&this.Ja.forEach((t=>t(l,v,C))),{sessionId:l,windowId:v,sessionStartTimestamp:x,changeReason:g?C:void 0,lastActivityTimestamp:d}}no(){this.Ya||(clearTimeout(this._o),this._o=setTimeout((()=>{if(!this.Ya)if(this.bo((new Date).getTime())){var t=this._e;this.resetSessionId(),this.Ga.emit("forcedIdleReset",{idleSessionId:t})}else this.no()}),1.1*this.sessionTimeoutMs))}}var cw=function(t,e){if(!t)return!1;var i=t.userAgent;if(i&&Q(i,e))return!0;try{var r=null==t?void 0:t.userAgentData;if(null!=r&&r.brands&&r.brands.some((t=>Q(null==t?void 0:t.brand,e))))return!0}catch(t){}return!!t.webdriver};function fw(){return fw=f((function*(){var t=null==i?void 0:i.userAgentData;if(null!=t&&t.getHighEntropyValues)try{var e=yield t.getHighEntropyValues(["model"]),r=null==e?void 0:e.model;return lt(r)&&r.length>0?r:void 0}catch(t){return void ji.info("Unable to resolve $device_model from userAgentData.getHighEntropyValues",t)}})),fw.apply(this,arguments)}var pw="custom",gw="i.posthog.com",mw=/^\/static\//,yw=["/s/","/e/","/i/"];class _w{constructor(t){this.wo={},this.instance=t}get apiHost(){var t=this.instance.config.api_host.trim().replace(/\/$/,"");return"https://app.posthog.com"===t?"https://us.i.posthog.com":t}get flagsApiHost(){var t=this.instance.config.flags_api_host;return t?t.trim().replace(/\/$/,""):this.apiHost}get uiHost(){var t,e=null==(t=this.instance.config.ui_host)?void 0:t.replace(/\/$/,"");return e||(e=this.apiHost.replace("."+gw,".posthog.com")),"https://app.posthog.com"===e?"https://us.posthog.com":e}get region(){return this.wo[this.apiHost]||(this.wo[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":pw),this.wo[this.apiHost]}ko(t){if(mw.test(t)){var e=this.instance.config.asset_host;if("string"==typeof e)return e.trim().replace(/\/$/,"")||void 0}}So(t){var e=er(t);return e?e.protocol+"//"+e.host+e.pathname:void 0}xo(t,e,i){if("ui"===t)return i;var r=i,n=this.instance.config.rewriteRequestPath;if(n){var s,o=(null==(s=er(i))?void 0:s.href)||i;r=n(new URL(o)).toString()}if(n&&"api"===t&&yw.some((t=>0===e.indexOf(t)))){var a=this.So(r);if(a){var l,u=this.apiHost,h=this.Co;(null==(l=h)?void 0:l.apiHost)===u&&h.rewriteRequestPath===n||(h={apiHost:u,rewriteRequestPath:n,urls:new Set},this.Co=h),h.urls.add(a)}}return r}isIngestionEndpoint(t){var e=this.Co,i=this.So(t);return(null==e?void 0:e.apiHost)===this.apiHost&&e.rewriteRequestPath===this.instance.config.rewriteRequestPath&&!!i&&e.urls.has(i)}endpointFor(t,e){if(void 0===e&&(e=""),e&&(e="/"===e[0]?e:"/"+e),"ui"===t)return this.xo(t,e,this.uiHost+e);if("flags"===t)return this.xo(t,e,this.flagsApiHost+e);if("assets"===t){var i=this.ko(e);if(i)return this.xo(t,e,""+i+e)}if(this.region===pw)return this.xo(t,e,this.apiHost+e);var r=gw+e;switch(t){case"assets":return this.xo(t,e,"https://"+this.region+"-assets."+r);case"api":return this.xo(t,e,"https://"+this.region+"."+r)}}}var bw=Bi("[PostHog ExternalIntegrations]"),ww={intercom:"intercom-integration",crispChat:"crisp-chat-integration"};class kw{constructor(t){this._instance=t}_s(t,e){var i;null==(i=v.__PosthogExtensions__)||null==i.loadExternalDependency||i.loadExternalDependency(this._instance,t,(t=>{if(t)return bw.error("failed to load script",t);e()}))}startIfEnabledOrStop(){var t=this,e=function(){var e,r,n,s=i[0],o=i[1];!o||null!=(e=v.__PosthogExtensions__)&&null!=(e=e.integrations)&&e[s]||t._s(ww[s],(()=>{var e;null==(e=v.__PosthogExtensions__)||null==(e=e.integrations)||null==(e=e[s])||e.start(t._instance)})),!o&&null!=(r=v.__PosthogExtensions__)&&null!=(r=r.integrations)&&r[s]&&(null==(n=v.__PosthogExtensions__)||null==(n=n.integrations)||null==(n=n[s])||n.stop())};for(var i of Object.entries(null!==(r=this._instance.config.integrations)&&void 0!==r?r:{})){var r;e()}}}class Sw{constructor(t,e){this.I=t,this.ns=e,this.To=new Map,this.Xn=!1}add(t){var e=this;return f((function*(){if(e.Xn)throw new Error("Cannot add an extension to a disposed ExtensionRuntime");if(e.To.has(t.name))throw new Error('Browser extension "'+t.name+'" is already registered');e.To.set(t.name,t);try{var i=t.setup(e.ns);i&&(yield i)}catch(i){var r=e.To.get(t.name)===t;r&&e.To.delete(t.name),e.I.error('Failed to set up browser extension "'+t.name+'"',i),r&&e.Mo(t)}}))()}dispose(){if(!this.Xn){this.Xn=!0;var t=Array.from(this.To.values()).reverse();for(var e of(this.To.clear(),t))this.Mo(e)}}Mo(t){try{var e=null==t.dispose?void 0:t.dispose();e&&nt(e.then)&&e.then(void 0,(e=>{this.I.error('Failed to dispose browser extension "'+t.name+'"',e)}))}catch(e){this.I.error('Failed to dispose browser extension "'+t.name+'"',e)}}}class xw{constructor(t){this._instance=t}initialize(){}get(t){var e=this._instance.persistence;if("string"==typeof t)return null==e?void 0:e.get_property(t);var i={};for(var r of t){var n=null==e?void 0:e.get_property(r);at(n)||(i[r]=n)}return i}set(t,e){var i;null==(i=this._instance.persistence)||i.register("string"==typeof t?{[t]:e}:t)}remove(t){var e;null==(e=this._instance.persistence)||e.unregister(t)}}var Cw="extensionsRemoteConfig";class Tw{constructor(t){this.Xn=!1,this.instance=t,this.I=ji,this.Eo=t.Io,this.kv=new xw(t),this.onEvent=t=>rf(this.instance.on("eventCaptured",(e=>{try{t({event:e.event,properties:e.properties})}catch(t){this.I.error("Browser extension event listener failed",t)}}))),this.onRemoteConfig=t=>{if(this.Xn)return rf((()=>{}));var e=e=>{try{t(e)}catch(t){this.I.error("Browser extension remote config listener failed",t)}},i=this.instance.Ro.on(Cw,e);return this.Eo&&e(this.Eo),rf(i)},this.Po=new Sw(ji.createLogger("[BrowserExtensions]"),this)}get logger(){return this.I}get distinctId(){return this.instance.get_distinct_id()}get anonymousId(){var t;return null!==(t=this.instance.get_property(pn))&&void 0!==t?t:this.distinctId}get deviceId(){var t=this.instance.get_property(pn);return"string"==typeof t?t:void 0}get library(){return{name:Ni.LIB_NAME,version:Ni.LIB_VERSION}}get initialPersonProperties(){var t,e;return null!==(t=null==(e=this.instance.persistence)?void 0:e.get_initial_props())&&void 0!==t?t:{}}get groups(){return this.instance.getGroups()}get session(){try{var t,e,i,r,n=null==(t=this.instance.sessionManager)?void 0:t.checkAndGetSessionAndWindowId(!0);return{sessionId:null!==(e=null==n?void 0:n.sessionId)&&void 0!==e?e:"",windowId:null!==(i=null==n?void 0:n.windowId)&&void 0!==i?i:"",sessionStartTimestamp:null!==(r=null==n?void 0:n.sessionStartTimestamp)&&void 0!==r?r:0}}catch(t){return{sessionId:"",windowId:"",sessionStartTimestamp:0}}}get projectToken(){return this.instance.config.token}add(t){return this.Po.add(t)}capture(t,e,i){var r=this;return f((function*(){i?r.instance.capture(t,e,{timestamp:i.timestamp,uuid:i.uuid,$set:i.set,$set_once:i.setOnce}):r.instance.capture(t,e)}))()}registerDynamicEventProperties(t){return rf(this.instance.Ao(t))}handleRemoteConfig(t){this.Xn||(this.Eo=t,this.instance.Ro.emit(Cw,t))}sendRequest(t,e){var i=this;return f((function*(){var r;void 0===e&&(e={});var n=i.instance.requestRouter.endpointFor(null!==(r=e.target)&&void 0!==r?r:"api",t),s={method:e.method,url:e.query?Wb(n,e.query):n,data:e.body,headers:e.headers,timeout:e.timeoutMs,fireCallbackOnDrop:!0,transport:e.transport,compression:e.compression,timestampMode:e.sentAt};return"sendBeacon"===e.transport?(i.instance._send_request(s),{statusCode:202}):new Promise((t=>{s.callback=t,i.instance._send_request(s)}))}))()}dispose(){this.Xn||(this.Xn=!0,this.Po.dispose())}}var Ew={},Mw=0,Iw=()=>{},Rw='Consent opt in/out is not valid with cookieless_mode="always" and will be ignored',Pw="Surveys module not available",Aw="sanitize_properties is deprecated. Use before_send instead",Ow="Invalid value for property_denylist config: ",Fw=["token","distinct_id",bs],Lw="posthog",$w=!Bb&&-1===(null==u?void 0:u.indexOf("MSIE"))&&-1===(null==u?void 0:u.indexOf("Mozilla")),Dw=e=>{var i;return p({api_host:"https://us.i.posthog.com",flags_api_host:null,ui_host:null,asset_host:null,token:"",autocapture:!0,cross_subdomain_cookie:Ji(null==r?void 0:r.location),persistence:"localStorage+cookie",persistence_name:"",cookie_persisted_properties:[],loaded:Iw,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:n&&lt(null==n?void 0:n.search)&&-1!==n.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==t||null==(i=t.location)?void 0:i.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(t){ji.error("Bad HTTP status: "+t.statusCode+" "+t.text)},get_device_id:t=>t,capture_performance:void 0,name:"posthog",bootstrap:{},disable_compression:!1,session_idle_timeout_seconds:1800,person_profiles:Ds,before_send:void 0,get_current_url:void 0,request_queue_config:{flush_interval_ms:iw},error_tracking:{},_onCapture:Iw},(t=>({rageclick:t&&t>="2026-05-30"?{content_ignorelist:Pr,ignore_text_selection:!0}:!t||"2025-11-30">t||{content_ignorelist:!0},capture_pageview:!t||"2025-05-24">t||"history_change",session_recording:t&&t>="2026-06-25"?{strictMinimumDuration:!0,canvasCapture:{resolutionScale:.6},streamNetworkBody:!0}:t&&t>="2026-05-30"?{strictMinimumDuration:!0,canvasCapture:{resolutionScale:.6}}:t&&t>="2025-11-30"?{strictMinimumDuration:!0}:{},external_scripts_inject_target:t&&t>="2026-01-30"?"head":"body",internal_or_test_user_hostname:t&&t>="2026-01-30"?/^(localhost|127\.0\.0\.1)$/:void 0,persistence_save_debounce_ms:t&&t>="2026-05-30"?250:0,split_storage:!(!t||"2026-05-30">t),detect_google_search_app:!(!t||"2026-05-30">t),disable_capture_url_hashes:!(!t||"2026-06-25">t),cookieWinsOnConflict:!(!t||"unset"===t||"2026-08-29">t)}))(e))},Nw=[["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"]],qw=t=>{var e={};for(var i of Nw){var r=i[0],n=i[1];at(t[r])||(e[n]=t[r])}var s=zi({},e,t),o=t.__preview_external_dependency_versioned_paths;return at(o)||(at(t.strict_script_versioning)&&(s.strict_script_versioning=!!o),lt(o)&&at(t.asset_host)&&(s.asset_host=o)),rt(t.property_blacklist)&&(at(t.property_denylist)?s.property_denylist=t.property_blacklist:rt(t.property_denylist)?s.property_denylist=[...t.property_blacklist,...t.property_denylist]:ji.error(Ow+t.property_denylist)),s};class jw{constructor(){this.__forceAllowLocalhost=!1}get Fo(){return this.__forceAllowLocalhost}set Fo(t){ji.error("WebPerformanceObserver is deprecated and has no impact on network capture. Use `_forceAllowLocalhostNetworkCapture` on `posthog.sessionRecording`"),this.__forceAllowLocalhost=t}}class Bw{Lo(t,e){if(t){var i=this.To.indexOf(t);-1!==i&&this.To.splice(i,1)}return this.To.push(e),null==e.initialize||e.initialize(),e}Oo(){return this.config.cookieless_mode===Fs||this.config.cookieless_mode===Os&&this.consent.isRejected()}Do(){if(!this.Oo()&&this.get_distinct_id()===_s){var t=this.persistence;if(t){this.$o()||t.load(!0);var e=this.get_distinct_id();if(!e||e===_s){var i=this.config.get_device_id(Pf());this.register({distinct_id:i,$device_id:i}),t.set_property(vs,Ls)}this.No()}}}get decideEndpointWasHit(){var t,e;return null!==(t=null==(e=this.featureFlags)?void 0:e.hasLoadedFlags)&&void 0!==t&&t}get flagsEndpointWasHit(){var t,e;return null!==(t=null==(e=this.featureFlags)?void 0:e.hasLoadedFlags)&&void 0!==t&&t}constructor(){var t;this.webPerformance=new jw,this.qo=!1,this.version=Ni.LIB_VERSION,this.jo=new Set,this.Bo="",this.Ro=new uw,this.To=[],this.Ho=[],this._calculate_event_properties=this.calculateEventProperties.bind(this),this.config=Dw(),this.SentryIntegration=wb,this.sentryIntegration=t=>function(t,e){var i=bb(t,e);return{name:_b,processEvent:t=>i(t)}}(this,t),this.__request_queue=[],this.__loaded=!1,this.analyticsDefaultEndpoint="/e/",this.Uo=!1,this.zo=null,this.Wo=null,this.Vo=null,this.scrollManager=new ow(this),this.pageViewManager=new kb(this),this.rateLimiter=new Db(this),this.requestRouter=new _w(this),this.consent=new cb(this),this.externalIntegrations=new kw(this);var e=null!==(t=Bw.__defaultExtensionClasses)&&void 0!==t?t:{};this.featureFlags=e.featureFlags&&new e.featureFlags(this),this.toolbar=e.toolbar&&new e.toolbar(this),this.surveys=e.surveys&&new e.surveys(this),this.conversations=e.conversations&&new e.conversations(this),this.logs=e.logs&&new e.logs(this),this.metrics=e.metrics&&new e.metrics(this),this.experiments=e.experiments&&new e.experiments(this),this.exceptions=e.exceptions&&new e.exceptions(this),this.people={set:(t,e,i)=>{var r=lt(t)?{[t]:e}:t;this.setPersonProperties(r),null==i||i({})},set_once:(t,e,i)=>{var r=lt(t)?{[t]:e}:t;this.setPersonProperties(void 0,r),null==i||i({})}},this.on("eventCaptured",(t=>ji.info('send "'+(null==t?void 0:t.event)+'"',t)))}init(t,e,i){if(i&&i!==Lw){var r,n=null!==(r=Ew[i])&&void 0!==r?r:new Bw;return n._init(t,e,i),Ew[i]=n,Ew[Lw][i]=n,n}return this._init(t,e,i)}_init(e,i,r){var n,s;void 0===i&&(i={});var o,a=lt(e)?e.trim():"";if(!a)return ji.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=Dw(i.defaults),i.debug=this.Go(i.debug),this.Zo=i,this.Qo=[],i.person_profiles?this.Wo=i.person_profiles:i.process_person&&(this.Wo=i.process_person);var l=Dw(i.defaults),u=qw(i),h=zi({},l,u,{name:r,token:a});st(l.rageclick)&&st(u.rageclick)&&(h.rageclick=zi({},l.rageclick,u.rageclick)),st(l.session_recording)&&st(u.session_recording)&&(h.session_recording=zi({},l.session_recording,u.session_recording)),this.set_config(h),this.config.on_xhr_error&&ji.error("on_xhr_error is deprecated. Use on_request_error instead"),this.compression=i.disable_compression?void 0:nf.GZipJS;var d=this.$o();if(this.persistence=new Ab(this.config,d),this.sessionPersistence="sessionStorage"===this.config.persistence||"memory"===this.config.persistence?this.persistence:new Ab(p({},this.config,{persistence:"sessionStorage"}),d,!1),this.Bo="ph_"+(this.config.persistence_name||this.config.token)+"_session_registered_properties","memory"!==this.config.persistence&&!d&&Kf.Nr()){var v=Kf.Br(this.Bo);rt(v)&&v.forEach((t=>{lt(t)&&this.jo.add(t)}))}else Kf.qr(this.Bo);var c=p({},this.persistence.props),f=p({},this.sessionPersistence.props);this.register({$initialization_time:(new Date).toISOString()}),this.Jo=new rw((t=>this.Ko(t)),this.config.request_queue_config),this.Yo=new sw(this),this.__request_queue=[];var g=this.Oo();if(g||(this.sessionManager=new vw(this),this.sessionPropsManager=new lw(this,this.sessionManager,this.persistence),this.sessionManager.onSessionId(((t,e,i)=>{(null!=i&&i.activityTimeout||null!=i&&i.sessionPastMaximumLength||null!=i&&i.crossTabAdoption)&&this.Xo()}))),this.tl(),this.config.__preview_deferred_init_extensions?(ji.info("Deferring extension initialization to improve startup performance"),setTimeout((()=>{this.el(g)}),0)):(ji.info("Initializing extensions synchronously"),this.el(g)),Ni.DEBUG=Ni.DEBUG||this.config.debug,Ni.DEBUG&&ji.info("Starting in debug mode",{this:this,config:i,thisC:p({},this.config),p:c,s:f}),!this.config.identity_distinct_id||null!=(n=i.bootstrap)&&n.distinctID||(i.bootstrap=p({},i.bootstrap,{distinctID:this.config.identity_distinct_id,isIdentifiedID:!0})),void 0!==(null==(s=i.bootstrap)?void 0:s.distinctID)){var m=i.bootstrap.distinctID,y=this.get_distinct_id(),_=this.persistence.get_property(vs);if(i.bootstrap.isIdentifiedID&&null!=y&&y!==m&&_===Ls)this.identify(m);else if(i.bootstrap.isIdentifiedID&&null!=y&&y!==m&&_===$s)ji.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 b=this.config.get_device_id(Pf()),w=i.bootstrap.isIdentifiedID?b:m;this.persistence.set_property(vs,i.bootstrap.isIdentifiedID?$s:Ls),this.register({distinct_id:m,$device_id:w})}}if(g)this.register_once({distinct_id:_s,$device_id:null},"");else if(!this.get_distinct_id()){var k=this.config.get_device_id(Pf());this.register_once({distinct_id:k,$device_id:k},""),this.persistence.set_property(vs,Ls)}return Ki(t,"onpagehide"in self?"pagehide":"unload",this._handle_unload.bind(this),{passive:!1}),i.segment?function(t,e){var i=t.config.segment;if(!i)return e();!function(t,e){var i=t.config.segment;if(!i)return e();var r=i=>{var r=()=>i.anonymousId()||Pf();t.config.get_device_id=r,i.id()&&(t.register({distinct_id:i.id(),$device_id:r()}),t.persistence.set_property(vs,$s)),e()},n=i.user();"then"in n&&nt(n.then)?n.then(r):r(n)}(t,(()=>{i.register((t=>{"undefined"!=typeof Promise&&Promise.resolve||yb.warn("This browser does not have Promise support, and can not use the segment integration");var e=(e,i)=>{if(!i)return e;e.event.userId||e.event.anonymousId===t.get_distinct_id()||(yb.info("No userId set, resetting PostHog"),t.reset()),e.event.userId&&e.event.userId!==t.get_distinct_id()&&(yb.info("UserId set, identifying with PostHog"),t.identify(e.event.userId));var r=t.calculateEventProperties(i,e.event.properties);return e.event.properties=Object.assign({},r,e.event.properties),e};return{name:"PostHog JS",type:"enrichment",version:"1.0.0",isLoaded:()=>!0,load:()=>Promise.resolve(),track:t=>e(t,t.event.event),page:t=>e(t,js),identify:t=>e(t,Us),screen:t=>e(t,"$screen")}})(t)).then((()=>{e()}))}))}(this,(()=>this.il())):this.il(),nt(this.config._onCapture)&&this.config._onCapture!==Iw&&(ji.warn("onCapture is deprecated. Please use `before_send` instead"),this.on("eventCaptured",(t=>this.config._onCapture(t.event,t)))),this.config.ip&&ji.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 fw.apply(this,arguments)}().then((t=>{t&&this.register({[gn]:t})})).catch(Iw),this}rl(t){var e=t;return lt(e.name)&&nt(e.setup)}nl(t,e){this.rl(t)?e.push((()=>{this.sl().add(t).catch(Iw)})):this.To.push(t)}tl(){var t,e,i,r,n,s,o=null!==(t=null==(e=this.config.__extensionClasses)?void 0:e.featureFlags)&&void 0!==t?t:null==(i=Bw.__defaultExtensionClasses)?void 0:i.featureFlags;o&&(this.featureFlags&&this.featureFlags instanceof o||(null==(r=this.al)||r.call(this),this.al=void 0,this.featureFlags=new o(this)),nt(this.featureFlags.onReloading)&&nt(this.featureFlags.setup)?this.al||(this.al=this.featureFlags.onReloading((()=>{this.Ro.emit("featureFlagsReloading",!0)})),this.sl().add(this.featureFlags)):null==(n=(s=this.featureFlags).initialize)||n.call(s))}el(t){var e,i,r,n,s,o,a,l=performance.now(),u=p({},Bw.__defaultExtensionClasses,this.config.__extensionClasses),h=[];u.exceptions&&this.To.push(this.exceptions=null!==(e=this.exceptions)&&void 0!==e?e:new u.exceptions(this)),u.historyAutocapture&&this.To.push(this.historyAutocapture=new u.historyAutocapture(this)),u.tracingHeaders&&this.To.push(this.tracingHeaders=new u.tracingHeaders(this)),u.siteApps&&this.To.push(this.siteApps=new u.siteApps(this)),u.sessionRecording&&!t&&this.To.push(this.sessionRecording=new u.sessionRecording(this)),this.config.disable_scroll_properties||h.push((()=>{this.scrollManager.startMeasuringScrollPosition()})),u.autocapture&&this.nl(this.autocapture=new u.autocapture(this),h),u.surveys&&this.nl(this.surveys=null!==(i=this.surveys)&&void 0!==i?i:new u.surveys(this),h),u.logs&&this.To.push(this.logs=null!==(r=this.logs)&&void 0!==r?r:new u.logs(this)),u.metrics&&this.To.push(this.metrics=null!==(n=this.metrics)&&void 0!==n?n:new u.metrics(this)),u.conversations&&this.To.push(this.conversations=null!==(s=this.conversations)&&void 0!==s?s:new u.conversations(this)),u.productTours&&this.To.push(this.productTours=new u.productTours(this)),u.heatmaps&&this.To.push(this.heatmaps=new u.heatmaps(this)),u.webVitalsAutocapture&&this.To.push(this.webVitalsAutocapture=new u.webVitalsAutocapture(this)),u.exceptionObserver&&this.To.push(this.exceptionObserver=new u.exceptionObserver(this)),u.deadClicksAutocapture&&this.To.push(this.deadClicksAutocapture=new u.deadClicksAutocapture(this,gb)),u.toolbar&&this.To.push(this.toolbar=null!==(o=this.toolbar)&&void 0!==o?o:new u.toolbar(this)),u.experiments&&this.To.push(this.experiments=null!==(a=this.experiments)&&void 0!==a?a:new u.experiments(this)),this.To.forEach((t=>{t.initialize&&h.push((()=>{null==t.initialize||t.initialize()}))})),h.push((()=>{if(this.ol){var t=this.ol;this.ol=void 0,this.To.forEach((e=>null==e.onRemoteConfig?void 0:e.onRemoteConfig(t)))}})),this.ll(h,l)}ll(t,e){for(;t.length>0;){if(this.config.__preview_deferred_init_extensions&&performance.now()-e>=30&&t.length>0)return void setTimeout((()=>{this.ll(t,e)}),0);var i=t.shift();if(i)try{i()}catch(t){ji.error("Error initializing extension:",t)}}var r=Math.round(performance.now()-e);this.register_for_session({[ws]:this.config.__preview_deferred_init_extensions?"deferred":"synchronous",[ks]:r}),this.config.__preview_deferred_init_extensions&&ji.info("PostHog extensions initialized ("+r+"ms)")}pa(t){var e;if(!r||!r.body)return ji.info("document not ready yet, trying again in 500 milliseconds..."),void setTimeout((()=>{this.pa(t)}),500);if(this.config.__preview_deferred_init_extensions&&(this.ol=t),this.Io=t,this.compression=void 0,t.ok){var i,n=t.config;n.supportedCompression&&!this.config.disable_compression&&(this.compression=J(n.supportedCompression,nf.GZipJS)?nf.GZipJS:J(n.supportedCompression,nf.Base64)?nf.Base64:void 0),null!=(i=n.analytics)&&i.endpoint&&(this.analyticsDefaultEndpoint=n.analytics.endpoint)}this.set_config({person_profiles:this.Wo?this.Wo:Ds}),null==(e=this.ul)||e.handleRemoteConfig(t),this.To.forEach((e=>null==e.onRemoteConfig?void 0:e.onRemoteConfig(t)))}il(){try{this.config.loaded(this)}catch(t){ji.critical("`loaded` function failed",t)}if(this.hl(),this.config.internal_or_test_user_hostname&&null!=n&&n.hostname){var t=n.hostname,e=this.config.internal_or_test_user_hostname;("string"==typeof e?t===e:e.test(t))&&this.setInternalOrTestUser()}this.config.capture_pageview&&setTimeout((()=>{(this.consent.isOptedIn()||this.Oo())&&this.dl()}),1),this.vl=new qb(this),this.vl.load()}hl(){var t;this.is_capturing()&&this.config.request_batching&&(null==(t=this.Jo)||t.enable())}_dom_loaded(){this.is_capturing()&&Ui(this.__request_queue,(t=>this.Ko(t))),this.__request_queue=[],this.hl()}_handle_unload(){var t,e,i,r,n;null==(t=this.surveys)||null==t.handlePageUnload||t.handlePageUnload(),null==(e=this.metrics)||e.flush("sendBeacon"),this.config.request_batching?(this.cl()&&this.capture(Bs),null==(i=this.logs)||i.flushLogs("sendBeacon"),null==(r=this.Jo)||r.unload(),null==(n=this.Yo)||n.unload()):this.cl()&&this.capture(Bs,null,{transport:"sendBeacon"})}_send_request(t){this.__loaded?$w?this.__request_queue.push(t):this.rateLimiter.isServerRateLimited(t.batchKey)?t.fireCallbackOnDrop&&(null==t.callback||t.callback({statusCode:429})):(t.transport=t.transport||this.config.api_transport,t.headers=p({},this.config.request_headers,t.headers),t.compression="best-available"===t.compression?this.compression:t.compression,(at(this.config.disable_beacon)?this.config.__preview_disable_beacon:this.config.disable_beacon)&&(t.disableTransport=["sendBeacon"]),t.fetchOptions=t.fetchOptions||this.config.fetch_options,(t=>{var e,i,r,n=p({},t);n.timeout=n.timeout||6e4;var s,o,a,u,h,d=null!==(e=n.transport)&&void 0!==e?e:"fetch";"sendBeacon"===d&&at(n.compression)&&n.data&&(n.compression=nf.Base64),"POST"===n.method&&n.data&&("capture-body"===n.timestampMode?n.data={api_key:null!==(o=null==(h=(u=(rt(s=n.data)?s:[s]).map((t=>p({},t,t.timestamp instanceof Date&&!isNaN(t.timestamp.getTime())?{timestamp:t.timestamp.toISOString()}:{}))))[0])||null==(a=h.properties)?void 0:a.token)&&void 0!==o?o:null==h?void 0:h.token,batch:u,sent_at:(new Date).toISOString()}:"body"===n.timestampMode&&(n.data=function(t,e){return void 0===e&&(e=(new Date).toISOString()),rt(t)?t.map((t=>p({},t,{sent_at:e}))):p({},t,{sent_at:e})}(n.data))),n.url=tw(n.url,n.method,n.compression,n.timestampMode);var v=ew.filter((t=>!n.disableTransport||!t.transport||!n.disableTransport.includes(t.transport))),c=null!==(i=null==(r=function(t,e){for(var i=0;t.length>i;i++)if(e(t[i]))return t[i]}(v,(t=>t.transport===d)))?void 0:r.method)&&void 0!==i?i:v[0].method;if(!c)throw new Error("No available transport method");var f=t=>{try{c(t)}catch(t){Kb(t)?ji.warn(t):ji.error(t),null==n.callback||n.callback({statusCode:0,error:t})}};"sendBeacon"!==d&&n.data&&n.compression===nf.GZipJS&&l&&"undefined"!=typeof Promise&&!Hb?Qb(n).then((t=>{f(t)})).catch((e=>{if(O(e))return Hb=!0,void f(p({},n,{compression:void 0,url:tw(t.url,t.method,void 0,t.timestampMode)}));F(e)&&(Hb=!0),f(n)})):c(n)})(p({},t,{callback:e=>{var i,r;this.rateLimiter.checkForLimiting(e),400>e.statusCode||null==(i=(r=this.config).on_request_error)||i.call(r,e),null==t.callback||t.callback(e)}}))):t.fireCallbackOnDrop&&(null==t.callback||t.callback({statusCode:0}))}Ko(t){this.Yo?this.Yo.retriableRequest(t):this._send_request(t)}_execute_array(t){Mw++;try{var e,i=[],r=[],n=[];Ui(t,(t=>{if(t)if(rt(e=t[0]))n.push(t);else if(nt(t))try{t.call(this)}catch(e){ji.error("Error executing queued PostHog call",t,e)}else rt(t)&&"alias"===e?i.push(t):rt(t)&&-1!==e.indexOf("capture")&&nt(this[e])?n.push(t):r.push(t)}));var s=function(t,e){Ui(t,(function(t){try{if(rt(t[0])){var i=e;Hi(t,(function(t){i=i[t[0]].apply(i,t.slice(1))}))}else e[t[0]].apply(e,t.slice(1))}catch(e){ji.error("Error executing queued PostHog call",t,e)}}))};s(i,this),s(r,this),s(n,this)}finally{Mw--}}push(t){if(Mw>0&&rt(t)&&lt(t[0])){var e=Bw.prototype[t[0]];nt(e)&&e.apply(this,t.slice(1))}else this._execute_array([t])}capture(t,e,i){var r,n,s,o,a;if(this.__loaded&&this.persistence&&this.sessionPersistence&&this.Jo){if(this.is_capturing())if(!at(t)&&lt(t)){this.Do();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!=e&&e.$current_url&&!lt(null==e?void 0:e.$current_url)&&(ji.error("Invalid `$current_url` property provided to `posthog.capture`. Input must be a string. Ignoring provided value."),null==e||delete e.$current_url),"$exception"!==t||null!=i&&i.fl||ji.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,d=(null==i?void 0:i.timestamp)||h,v=Fe(null==i?void 0:i.uuid,Pf),c={uuid:v,event:t,properties:this.calculateEventProperties(t,e||{},d,v)};t===js&&this.config.__preview_capture_bot_pageviews&&l&&(c.event="$bot_pageview",c.properties.$browser_type="bot"),u&&(c.properties.$lib_rate_limit_remaining_tokens=u.remainingTokens);var f="$feature_flag_called"===t&&!1===c.properties.$feature_flag_has_experiment&&!0===this.get_property(Jn);(null==i?void 0:i.$set)&&!f&&(c.$set=null==i?void 0:i.$set);var g=null==i?void 0:i.$unset;g&&(c.$unset=g);var m=f?void 0:this.pl(null==i?void 0:i.$set_once,t!==Hs,t===Us);if(m&&(c.$set_once=m),null!=i&&i._noTruncate||(n=this.config.properties_string_max_length,s=c,o=t=>lt(t)?t.slice(0,n):t,a=new Set,c=function t(e,i){if(e!==Object(e))return o?o(e):e;if(!a.has(e)){var r;if(a.add(e),rt(e))r=[],Ui(e,(e=>{r.push(t(e))}));else{var n={};Hi(e,((e,i)=>{a.has(e)||(n[i]=t(e,i))})),r=n}return r}}(s)),c.timestamp=d,at(null==i?void 0:i.timestamp)||(c.properties.$event_time_override_provided=!0,c.properties.$event_time_override_system_time=h),f&&(c.properties=function(t,e){void 0===e&&(e=[]);var i={},r=e=>{void 0!==t[e]&&(i[e]=t[e])};return S.forEach(r),e.forEach(r),i}(c.properties,Fw)),t===cf.DISMISSED||t===cf.SENT){var y=null==e?void 0:e[ff.SURVEY_ID],_=null==e?void 0:e[ff.SURVEY_ITERATION];Sf({id:y,current_iteration:_}),c.$set=p({},c.$set,{[va({id:y,current_iteration:_},t===cf.SENT?"responded":"dismissed")]:!0})}else t===cf.SHOWN&&(c.$set=p({},c.$set,{[ff.SURVEY_LAST_SEEN_DATE]:(new Date).toISOString()}));if(t===Fb.SHOWN){var b=null==e?void 0:e[Lb.TOUR_TYPE];b&&(c.$set=p({},c.$set,{[Lb.TOUR_LAST_SEEN_DATE+"/"+b]:(new Date).toISOString()}))}var w=p({},c.properties.$set,c.$set);if(ot(w)||this.setPersonPropertiesForFlags(w),!dt(this.config.before_send)){var k=this.kn(c);if(!k)return;(c=k).uuid=Fe(c.uuid,Pf)}this.Ro.emit("eventCaptured",c);var x=null!==(r=null==i?void 0:i._url)&&void 0!==r?r:this.requestRouter.endpointFor("api",this.analyticsDefaultEndpoint),C={method:"POST",url:x,data:c,compression:"best-available",timestampMode:"recordings"===(null==i?void 0:i._batchKey)||/\/s\/(?:\?|$)/.test(x)?"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.Ko(C):this.Jo.enqueue(C),c}ji.critical("This capture call is ignored due to client rate limiting.")}}else ji.error("No event name provided to posthog.capture")}else ji.uninitializedWarning("posthog.capture")}_addCaptureHook(t){return this.on("eventCaptured",(e=>t(e.event,e)))}sl(){var t;return null!==(t=this.ul)&&void 0!==t?t:this.ul=new Tw(this)}Ao(t){this.Ho.push(t);var e=!0;return()=>{if(e){e=!1;var i=this.Ho.indexOf(t);-1!==i&&this.Ho.splice(i,1)}}}gl(t){var e,i,r;return void 0===t&&(t=!0),!(null==(e=this.persistence)||!e.consumeCookieIdentityChange())&&(this.Vo=null,this.persistence.get_property(vs)===Ls&&(null==(r=this.sessionPersistence)||r.clear(),this.jo.clear(),this.ml()),null==(i=this.featureFlags)||i.reset(),t&&this.reloadFeatureFlags(),!0)}calculateEventProperties(e,i,s,o,a){if(s=s||new Date,!this.persistence||!this.sessionPersistence)return i;this.persistence.syncCookieProperties(),this.gl();var l=a?void 0:this.persistence.remove_event_timer(e),h=p({},i);if(h.token=this.config.token,h.$config_defaults=this.config.defaults,this.Oo()&&(h[bs]=!0),"$snapshot"===e){var d=p({},this.persistence.properties(),this.sessionPersistence.properties());return h.distinct_id=d.distinct_id,(!lt(h.distinct_id)&&!vt(h.distinct_id)||ut(h.distinct_id))&&ji.error("Invalid distinct_id for replay event. This indicates a bug in your implementation"),h}var v,c=function(e,i,r,s){var o,a,l,h;if(void 0===s&&(s=!1),!u)return{};var d,v=e?[...Fa,...i||[]]:[],c=function(t){for(var e=0;Re.length>e;e++){var i=Re[e],r=i[1],n=i[0].exec(t),s=n&&(nt(r)?r(n,t):r);if(s)return s}return["",""]}(u),f=c[0],p=c[1],g=null!=(d="undefined"!=typeof navigator?navigator:void 0)&&d.brave?{brave:!0}:{},m={};at(r)||(m.detectGoogleSearchApp=r);var y={},_=null==(o=navigator)||null==(o=o.userAgentData)?void 0:o.platform,b=null==(a=navigator)?void 0:a.maxTouchPoints,w=null==t||null==(l=t.screen)?void 0:l.width,k=null==t||null==(h=t.screen)?void 0:h.height,S=null==t?void 0:t.devicePixelRatio;at(_)||(y.userAgentDataPlatform=_),at(b)||(y.maxTouchPoints=b),at(w)||(y.screenWidth=w),at(k)||(y.screenHeight=k),at(S)||(y.devicePixelRatio=S);var x,C=zi(Zi({$os:f,$os_version:p,$browser:Ee(u,navigator.vendor,g,m),$device:Pe(u),$device_type:Ae(u,y),$timezone:Va(),$timezone_offset:Ga()}),{$current_url:nr(s?Le(null==n?void 0:n.href):null==n?void 0:n.href,v,$a),$host:null==n?void 0:n.host,$pathname:null==n?void 0:n.pathname,$raw_user_agent:u.length>1e3?u.substring(0,997)+"...":u,$browser_version:Ie(u,navigator.vendor,g,m),$browser_language:Ba(),$browser_language_prefix:(x=Ba(),"string"==typeof x?x.split("-")[0]:void 0),$screen_height:null==t?void 0:t.screen.height,$screen_width:null==t?void 0:t.screen.width,$viewport_height:null==t?void 0:t.innerHeight,$viewport_width:null==t?void 0:t.innerWidth,$lib:Ni.LIB_NAME,$lib_version:Ni.LIB_VERSION,$insert_id:Math.random().toString(36).substring(2,10)+Math.random().toString(36).substring(2,10),$time:Date.now()/1e3});return Ni.SDK_DIST_CHANNEL&&(C.$sdk_dist_channel=Ni.SDK_DIST_CHANNEL),C}(this.config.mask_personal_data_properties,this.config.custom_personal_data_properties,this.config.detect_google_search_app,this.config.disable_capture_url_hashes);if(this.sessionManager){var f=this.sessionManager.checkAndGetSessionAndWindowId(a,s.getTime(),!0),g=f.windowId;h.$session_id=f.sessionId,h.$window_id=g}this.sessionPropsManager&&zi(h,this.sessionPropsManager.getSessionProps());try{var m;this.sessionRecording&&zi(h,this.sessionRecording.sdkDebugProperties),h.$sdk_debug_retry_queue_size=null==(m=this.Yo)?void 0:m.length}catch(t){h.$sdk_debug_error_capturing_properties=String(t)}if(this.requestRouter.region===pw&&(h.$lib_custom_api_host=this.config.api_host),v=e!==js||a?e!==Bs||a?this.pageViewManager.doEvent():this.pageViewManager.doPageLeave(s):this.pageViewManager.doPageView(s,o),h=zi(h,v),e===js&&r&&(h.title=r.title),!at(l)){var y=s.getTime()-l;h.$duration=parseFloat((y/1e3).toFixed(3))}u&&this.config.opt_out_useragent_filter&&(h.$browser_type=this._is_bot()?"bot":"browser");var _=this.persistence.properties(),b=this.sessionPersistence.properties();Hi(["$referrer","$referring_domain"],(t=>{t in _&&delete b[t]}));var w={};if(this.Ho.length>0)for(var k of this.Ho.slice())try{zi(w,k())}catch(t){ji.error("Failed to produce browser extension event properties",t)}(h=zi({},c,_,b,p({},w,h))).$is_identified=this._isIdentified(),rt(this.config.property_denylist)?Hi(this.config.property_denylist,(function(t){delete h[t]})):ji.error(Ow+this.config.property_denylist+" or property_blacklist config: "+this.config.property_blacklist);var S=this.config.sanitize_properties;S&&(ji.error(Aw),h=S(h,e));var x=this.yl();return h.$process_person_profile=x,x&&!a&&this.bl("_calculate_event_properties"),h}pl(t,e,i){var r;if(void 0===e&&(e=!0),void 0===i&&(i=!1),!this.persistence||!this.yl())return t;if(this.qo&&!i)return t;var n=this.persistence.get_initial_props(),s=null==(r=this.sessionPropsManager)?void 0:r.getSetOnceProps(),o=zi({},n,s||{},t||{}),a=this.config.sanitize_properties;return a&&(ji.error(Aw),o=a(o,"$set_once")),e&&(this.qo=!0),ot(o)?void 0:o}register(t,e){var i;null==(i=this.persistence)||i.register(t,e)}register_once(t,e,i){var r;null==(r=this.persistence)||r.register_once(t,e,i)}register_for_session(t){var e,i;null==(e=this.persistence)||e.syncCookieProperties(),this.gl(),null==(i=this.sessionPersistence)||i.register(t),Object.keys(t).forEach((t=>this.jo.add(t))),this.ml()}unregister(t){var e;null==(e=this.persistence)||e.unregister(t)}unregister_for_session(t){var e;null==(e=this.sessionPersistence)||e.unregister(t),this.jo.delete(t),this.ml()}_l(t,e){this.register({[t]:e})}Xo(){this.jo.forEach((t=>{var e;null==(e=this.sessionPersistence)||e.unregister(t)})),this.jo.clear(),this.ml()}ml(){var t;if(this.Bo)if("memory"===this.config.persistence||null!=(t=this.sessionPersistence)&&t.Hs||!Kf.Nr())Kf.qr(this.Bo);else{var e=[];this.jo.forEach((t=>e.push(t))),e.length>0?Kf.Dr(this.Bo,e):Kf.qr(this.Bo)}}getFeatureFlag(t,e){var i;return null==(i=this.featureFlags)?void 0:i.getFeatureFlag(t,e)}getFeatureFlagPayload(t){var e;return null==(e=this.featureFlags)?void 0:e.getFeatureFlagPayload(t)}getFeatureFlagResult(t,e){var i;return null==(i=this.featureFlags)?void 0:i.getFeatureFlagResult(t,e)}getAllFeatureFlags(){var t,e;return null!==(t=null==(e=this.featureFlags)?void 0:e.getAllFeatureFlags())&&void 0!==t?t:[]}isFeatureEnabled(t,e){var i,r;return null!==(i=null==(r=this.featureFlags)?void 0:r.isFeatureEnabled(t,e))&&void 0!==i?i:null==e?void 0:e.defaultValue}reloadFeatureFlags(){var t;null==(t=this.featureFlags)||t.reloadFeatureFlags()}updateFlags(t,e,i){var r;null==(r=this.featureFlags)||r.updateFlags(t,e,i)}updateEarlyAccessFeatureEnrollment(t,e,i){var r;null==(r=this.featureFlags)||r.updateEarlyAccessFeatureEnrollment(t,e,i)}getEarlyAccessFeatures(t,e,i){var r;return void 0===e&&(e=!1),null==(r=this.featureFlags)?void 0:r.getEarlyAccessFeatures(t,e,i)}on(t,e){return this.Ro.on(t,e)}onFeatureFlags(t){return this.featureFlags?this.featureFlags.onFeatureFlags(t):(t([],{},{errorsLoading:!0}),()=>{})}onSurveysLoaded(t){return this.surveys?this.surveys.onSurveysLoaded(t):(t([],{isLoaded:!1,error:Pw}),()=>{})}onSessionId(t){var e,i;return null!==(e=null==(i=this.sessionManager)?void 0:i.onSessionId(t))&&void 0!==e?e:()=>{}}getSurveys(t,e){void 0===e&&(e=!1),this.surveys?this.surveys.getSurveys(t,e):t([],{isLoaded:!1,error:Pw})}getActiveMatchingSurveys(t,e){void 0===e&&(e=!1),this.surveys?this.surveys.getActiveMatchingSurveys(t,e):t([],{isLoaded:!1,error:Pw})}renderSurvey(t,e){var i;null==(i=this.surveys)||i.renderSurvey(t,e)}displaySurvey(t,e){var i;void 0===e&&(e=Cf),null==(i=this.surveys)||i.displaySurvey(t,e)}cancelPendingSurvey(t){var e;null==(e=this.surveys)||e.cancelPendingSurvey(t)}canRenderSurvey(t){var e,i;return null!==(e=null==(i=this.surveys)?void 0:i.canRenderSurvey(t))&&void 0!==e?e:{visible:!1,disabledReason:Pw}}canRenderSurveyAsync(t,e){var i,r;return void 0===e&&(e=!1),null!==(i=null==(r=this.surveys)?void 0:r.canRenderSurveyAsync(t,e))&&void 0!==i?i:Promise.resolve({visible:!1,disabledReason:Pw})}wl(t){return!t||ut(t)?(ji.critical("Unique user id has not been set in posthog.identify"),!1):t===_s?(ji.critical('The string "'+t+'" was set in posthog.identify which indicates an error. This ID is only used as a sentinel value.'),!1):!["distinct_id","distinctid"].includes(t.toLowerCase())&&!["undefined","null"].includes(t.toLowerCase())||(ji.critical('The string "'+t+'" was set in posthog.identify which indicates an error. This ID should be unique to the user and not a hardcoded string.'),!1)}identify(t,e,i){if(!this.__loaded||!this.persistence)return ji.uninitializedWarning("posthog.identify");if(vt(t)&&(t=t.toString(),ji.warn("The first argument to posthog.identify was a number, but it should be a string. It has been converted to a string.")),this.wl(t)&&this.bl("posthog.identify")){this.Do();var r=this.get_distinct_id(),n=this.persistence.syncCookieProperties()&&this.get_distinct_id()!==r,s=this.gl(!1),o=this.persistence.Ws(),a=!1;try{var l=this.get_distinct_id();this.register({$user_id:t}),this.get_property(pn)||this.register_once({$had_persisted_distinct_id:!0,$device_id:l},""),t!==l&&t!==this.get_property(mn)&&(this.unregister(mn),this.register({distinct_id:t}));var u,h=(this.persistence.get_property(vs)||Ls)===Ls,d=t!==l,v=!d&&h;if(d&&h)this.persistence.set_property(vs,$s),this.setPersonPropertiesForFlags({$set:e||{},$set_once:i||{}},!1),this.config.cookieWinsOnConflict&&this.persistence.Vs(),this.capture(Us,{distinct_id:t,$anon_distinct_id:l},{$set:e||{},$set_once:i||{}}),this.Vo=xa(t,e,i),null==(u=this.featureFlags)||u.setAnonymousDistinctId(l);else if(v){this.persistence.set_property(vs,$s);var c=e||{},f=i||{};this.setPersonPropertiesForFlags({$set:c,$set_once:f},!1),this.config.cookieWinsOnConflict&&this.persistence.Vs(),this.capture("$set",{$set:c,$set_once:f}),this.Vo=xa(t,e,i)}else(e||i)&&this.setPersonProperties(e,i);d||n||s?(this.reloadFeatureFlags(),this.featureFlags?this.featureFlags.resetFlagCallReported():this.unregister(ls)):v&&(e||i)&&this.reloadFeatureFlags(),a=!0}finally{o&&this.persistence.Qs(a)}}}setPersonProperties(t,e){if((t||e)&&this.bl("posthog.setPersonProperties")){var i=xa(this.get_distinct_id(),t,e);this.Vo!==i?(this.setPersonPropertiesForFlags({$set:t||{},$set_once:e||{}},!0),this.capture("$set",{$set:t||{},$set_once:e||{}}),this.Vo=i):ji.info("A duplicate setPersonProperties call was made with the same properties. It has been ignored.")}}unsetPersonProperties(t){var e,i=(rt(t)?t:[t]).filter((t=>lt(t)&&t.length>0));0!==i.length&&this.bl("posthog.unsetPersonProperties")&&(null==(e=this.featureFlags)||e.unsetPersonPropertiesForFlags(i,!0),this.capture("$set",{$unset:i}),this.Vo=null)}group(t,e,i){var r;if(t&&e){null==(r=this.persistence)||r.syncCookieProperties(),this.gl();var n=this.getGroups(),s=n[t]!==e;if(s&&this.resetGroupPropertiesForFlags(t),this.register({$groups:p({},n,{[t]:e})}),s||i){var o={$group_type:t,$group_key:e};i&&(o.$group_set=i),this.capture(Hs,o)}i&&this.setGroupPropertiesForFlags({[t]:i}),s&&!i&&this.reloadFeatureFlags()}else ji.error("posthog.group requires a group type and group key")}resetGroups(){this.register({$groups:{}}),this.resetGroupPropertiesForFlags(),this.reloadFeatureFlags()}setPersonPropertiesForFlags(t,e){var i;void 0===e&&(e=!0),null==(i=this.featureFlags)||i.setPersonPropertiesForFlags(t,e)}resetPersonPropertiesForFlags(t){var e;void 0===t&&(t=!0),null==(e=this.featureFlags)||e.resetPersonPropertiesForFlags(t)}setGroupPropertiesForFlags(t,e){var i;void 0===e&&(e=!0),this.bl("posthog.setGroupPropertiesForFlags")&&(null==(i=this.featureFlags)||i.setGroupPropertiesForFlags(t,e))}resetGroupPropertiesForFlags(t){var e;null==(e=this.featureFlags)||e.resetGroupPropertiesForFlags(t)}reset(t){var e=ft(t)?t:null==t?void 0:t.resetDeviceID,i=ft(t)||null==t?void 0:t.bootstrap;this.kl(e,!1,i)}kl(t,e,i){var r,n,s;if(void 0===e&&(e=!1),ji.info("reset"),!this.__loaded)return ji.uninitializedWarning("posthog.reset");var o=null==i?void 0:i.sessionID;this.config.bootstrap=i||(null==(r=this.Zo)?void 0:r.bootstrap)||{},null==(n=this.featureFlags)||null==n.updateConfig||n.updateConfig(this.config,this.ma());var a=this.get_property(pn),l=this.get_property(gn),u=this.get_property(Mn),h=this.is_capturing();this.consent.reset(),e||!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 d=null==(s=this.persistence)||null==s.Ws?void 0:s.Ws(),v=!1;try{var c,f,g,m,y,_,b,w,k,S,x,C,T,E;if(null==(c=this.persistence)||c.clear(),null==(f=this.sessionPersistence)||f.clear(),this.jo.clear(),this.ml(),at(u)||null==(x=this.persistence)||x.register({[Mn]:u}),null==(g=this.surveys)||g.reset(),null==(m=this.vl)||m.stop(),null==(y=this.featureFlags)||y.reset(),null==(_=this.conversations)||_.reset(),null==(b=this.logs)||b.reset(),null==(w=this.metrics)||w.reset(),null==(k=this.persistence)||k.set_property(vs,Ls),null==(S=this.sessionManager)||S.resetSessionId(),this.Vo=null,this.config.cookieless_mode===Fs)this.register_once({distinct_id:_s,$device_id:null},"");else{var M=this.config.get_device_id(Pf());this.register_once({distinct_id:M,$device_id:t?M:a},""),t||at(l)||this.register({[gn]:l})}if(this.register({$last_posthog_reset:(new Date).toISOString()},1),i)if(void 0===i.distinctID||this.Oo()||(null==(E=this.persistence)||E.set_property(vs,i.isIdentifiedID?$s:Ls),this.register({distinct_id:i.distinctID})),null==(C=this.featureFlags)||C.initialize(),!(at(o)||null!=(T=this.sessionManager)&&T.setBootstrapSessionId(o,!0))){var I=p({},i);delete I.sessionID,this.config.bootstrap=I}delete this.config.identity_distinct_id,delete this.config.identity_hash,v=!0}finally{var R;d&&(null==(R=this.persistence)||null==R.Qs||R.Qs(v))}this.reloadFeatureFlags()}shutdown(t){var e=this;return f((function*(){var t,i,r,n,s,o;if(e.__loaded){null==(t=e.vl)||t.stop(),e.sl().dispose(),null==(i=e.sessionRecording)||i.dispose(),null==(r=e.logs)||r.flushLogs("sendBeacon"),null==(n=e.metrics)||n.flush("sendBeacon"),null==(s=e.Jo)||s.unload(),null==(o=e.Yo)||o.unload();try{var a;null==(a=e.featureFlags)||a.destroy()}catch(t){ji.error("Error while destroying feature flags",t)}}else ji.uninitializedWarning("posthog.shutdown")}))()}setIdentity(t,e){var i;this.config.identity_distinct_id=t,this.config.identity_hash=e,this.alias(t),null==(i=this.conversations)||i.Sl()}clearIdentity(){var t;delete this.config.identity_distinct_id,delete this.config.identity_hash,null==(t=this.conversations)||t.xl()}get_distinct_id(){return this.get_property("distinct_id")}getGroups(){return this.get_property("$groups")||{}}get_session_id(){var t,e;return null!==(t=null==(e=this.sessionManager)?void 0:e.checkAndGetSessionAndWindowId(!0).sessionId)&&void 0!==t?t:""}get_session_replay_url(t){if(!this.sessionManager)return"";var e=this.sessionManager.checkAndGetSessionAndWindowId(!0),i=e.sessionStartTimestamp,r=this.requestRouter.endpointFor("ui","/project/"+this.config.token+"/replay/"+e.sessionId);if(null!=t&&t.withTimestamp&&i){var n,s=null!==(n=t.timestampLookBack)&&void 0!==n?n:10;if(!i)return r;r+="?t="+Math.max(Math.floor(((new Date).getTime()-i)/1e3)-s,0)}return r}alias(t,e){return t===this.get_property(cn)?(ji.critical("Attempting to create alias for existing People user - aborting."),-2):this.bl("posthog.alias")?(at(e)&&(e=this.get_distinct_id()),t!==e?(this._l(mn,t),this.capture("$create_alias",{alias:t,distinct_id:e})):(ji.warn("alias matches current distinct_id - skipping api call."),this.identify(t),-1)):void 0}set_config(t){var e=p({},this.config);if(st(t)){var i,r,n,s,o,a,l,u,h,d,v,c;zi(this.config,qw(t));var f=this.$o();null==(i=this.persistence)||i.update_config(this.config,e,f),this.sessionPersistence="sessionStorage"===this.config.persistence||"memory"===this.config.persistence?this.persistence:new Ab(p({},this.config,{persistence:"sessionStorage"}),f,!1);var g,m=this.Go(this.config.debug);ft(m)&&(this.config.debug=m),ft(this.config.debug)&&(this.config.debug?(Ni.DEBUG=!0,Df.Nr()&&Df.Dr("ph_debug",!0),ji.info("set_config",{config:t,oldConfig:e,newConfig:p({},this.config)})):(Ni.DEBUG=!1,Df.Nr()&&Df.qr("ph_debug"))),null==(r=this.featureFlags)||null==r.updateConfig||r.updateConfig(this.config,this.ma()),null==(n=this.exceptionObserver)||n.onConfigChange(),null==(s=this.exceptions)||s.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(),("capture_pageview"in t||"disable_capture_url_hashes"in t)&&(null==(g=this.historyAutocapture)||g.startIfEnabledOrStop()),null==(h=this.exceptionObserver)||h.startIfEnabledOrStop(),null==(d=this.deadClicksAutocapture)||d.startIfEnabledOrStop(),null==(v=this.surveys)||v.loadIfEnabled(),this.No(),null==(c=this.externalIntegrations)||c.startIfEnabledOrStop()}}_overrideSDKInfo(t,e){Ni.LIB_NAME=t,Ni.LIB_VERSION=e}startSessionRecording(t){var e,i,r,n,s,o=!0===t,a={sampling:o||!(null==t||!t.sampling),linked_flag:o||!(null==t||!t.linked_flag),url_trigger:o||!(null==t||!t.url_trigger),event_trigger:o||!(null==t||!t.event_trigger)};Object.values(a).some(Boolean)&&(null==(e=this.sessionManager)||e.checkAndGetSessionAndWindowId(),a.sampling&&(null==(i=this.sessionRecording)||i.overrideSampling()),a.linked_flag&&(null==(r=this.sessionRecording)||r.overrideLinkedFlag()),a.url_trigger&&(null==(n=this.sessionRecording)||n.overrideTrigger("url")),a.event_trigger&&(null==(s=this.sessionRecording)||s.overrideTrigger("event")));this.set_config({disable_session_recording:!1})}stopSessionRecording(){this.set_config({disable_session_recording:!0})}sessionRecordingStarted(){var t;return!(null==(t=this.sessionRecording)||!t.started)}captureException(t,e){if(this.exceptions){var i=new Error("PostHog syntheticException"),r=this.exceptions.buildProperties(t,{handled:!0,syntheticException:i});return this.exceptions.sendExceptionEvent(p({},r,e))}}addExceptionStep(t,e){var i;null==(i=this.exceptions)||i.addExceptionStep(t,e)}captureLog(t){var e;null==(e=this.logs)||e.captureLog(t)}get logger(){var t,e;return null!==(t=null==(e=this.logs)?void 0:e.logger)&&void 0!==t?t:Bw.Cl}startExceptionAutocapture(t){this.set_config({capture_exceptions:null==t||t})}stopExceptionAutocapture(){this.set_config({capture_exceptions:!1})}loadToolbar(t){var e,i;return null!==(e=null==(i=this.toolbar)?void 0:i.loadToolbar(t))&&void 0!==e&&e}get_property(t){var e;return null==(e=this.persistence)?void 0:e.props[t]}getSessionProperty(t){var e;return null==(e=this.sessionPersistence)?void 0:e.props[t]}toString(){var t,e=null!==(t=this.config.name)&&void 0!==t?t:Lw;return e!==Lw&&(e=Lw+"."+e),e}_isIdentified(){var t,e;return(null==(t=this.persistence)?void 0:t.get_property(vs))===$s||(null==(e=this.sessionPersistence)?void 0:e.get_property(vs))===$s}yl(){var t,e;return!("never"===this.config.person_profiles||this.config.person_profiles===Ds&&!this._isIdentified()&&ot(this.getGroups())&&(null==(t=this.persistence)||null==(t=t.props)||!t[mn])&&(null==(e=this.persistence)||null==(e=e.props)||!e[ys]))}cl(){return!0===this.config.capture_pageleave||"if_capture_pageview"===this.config.capture_pageleave&&!!this.config.capture_pageview}createPersonProfile(){this.yl()||this.bl("posthog.createPersonProfile")&&this.setPersonProperties({},{})}setInternalOrTestUser(){this.bl("posthog.setInternalOrTestUser")&&this.setPersonProperties({$internal_or_test_user:!0})}bl(t){return"never"===this.config.person_profiles?(ji.error(t+' was called, but process_person is set to "never". This call will be ignored.'),!1):(this._l(ys,!0),!0)}$o(){if("always"===this.config.cookieless_mode)return!0;var t=this.consent.isOptedOut();return this.config.disable_persistence||t&&!(!this.config.opt_out_persistence_by_default&&this.config.cookieless_mode!==Os)}No(){var t,e,i,r,n=this.$o();return(null==(t=this.persistence)?void 0:t.Hs)!==n&&(null==(i=this.persistence)||i.set_disabled(n)),(null==(e=this.sessionPersistence)?void 0:e.Hs)!==n&&(null==(r=this.sessionPersistence)||r.set_disabled(n)),n&&(this.jo.clear(),this.ml()),n}opt_in_capturing(t){var e;if(this.config.cookieless_mode!==Fs){if(this.Oo()){var i,r,n,s,o;this.kl(!0,!0),null==(i=this.sessionManager)||i.destroy(),null==(r=this.pageViewManager)||r.destroy(),this.sessionManager=new vw(this),this.pageViewManager=new kb(this),this.persistence&&(this.sessionPropsManager=new lw(this,this.sessionManager,this.persistence));var a,l=null!==(n=null==(s=this.config.__extensionClasses)?void 0:s.sessionRecording)&&void 0!==n?n:null==(o=Bw.__defaultExtensionClasses)?void 0:o.sessionRecording;l&&(this.sessionRecording=this.Lo(this.sessionRecording,new l(this)),this.Io&&(null==(a=this.sessionRecording)||null==a.onRemoteConfig||a.onRemoteConfig(this.Io)))}var u,h;this.consent.optInOut(!0),this.No(),this.hl(),null==(e=this.sessionRecording)||e.startIfEnabledOrStop(),this.config.cookieless_mode==Os&&(null==(u=this.surveys)||u.loadIfEnabled()),(at(null==t?void 0:t.captureEventName)||null!=t&&t.captureEventName)&&this.capture(null!==(h=null==t?void 0:t.captureEventName)&&void 0!==h?h:"$opt_in",null==t?void 0:t.captureProperties,{send_instantly:!0}),this.config.capture_pageview&&this.dl()}else ji.warn(Rw)}opt_out_capturing(){var t,e,i;this.config.cookieless_mode!==Fs?(this.config.cookieless_mode===Os&&this.consent.isOptedIn()&&this.kl(!0,!0),this.consent.optInOut(!1),this.No(),this.config.cookieless_mode===Os&&(this.register({distinct_id:_s,$device_id:null}),null==(t=this.sessionRecording)||t.stopRecording(),this.sessionRecording=void 0,null==(e=this.sessionManager)||e.destroy(),null==(i=this.pageViewManager)||i.destroy(),this.sessionManager=void 0,this.sessionPropsManager=void 0,this.config.capture_pageview&&this.dl(),this.hl())):ji.warn(Rw)}has_opted_in_capturing(){return this.consent.isOptedIn()}has_opted_out_capturing(){return this.consent.isOptedOut()}get_explicit_consent_status(){var t=this.consent.consent;return 1===t?"granted":0===t?"denied":"pending"}is_capturing(){return this.config.cookieless_mode===Fs||(this.config.cookieless_mode===Os?this.consent.isRejected()||this.consent.isOptedIn():!this.has_opted_out_capturing())}clear_opt_in_out_capturing(){this.consent.reset(),this.No()}_is_bot(){return i?cw(i,this.config.custom_blocked_useragents):void 0}dl(){r&&("visible"===r.visibilityState?this.Uo||(this.Uo=!0,this.capture(js,{title:r.title},{send_instantly:!0}),this.zo&&(r.removeEventListener(Ns,this.zo),this.zo=null)):this.zo||(this.zo=this.dl.bind(this),Ki(r,Ns,this.zo)))}debug(e){!1===e?(null==t||t.console.log("You've disabled debug mode."),this.set_config({debug:!1})):(null==t||t.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}))}ma(){var t=this.Zo||{};return"advanced_disable_flags"in t?!!t.advanced_disable_flags:!1!==this.config.advanced_disable_flags?!!this.config.advanced_disable_flags:!0===this.config.advanced_disable_decide?(ji.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(t,e,i,r,n){var s=e in t&&!dt(t[e]),o=i in t&&!dt(t[i]);return s?t[e]:!!o&&(n&&n.warn("Config field '"+i+"' is deprecated. Please use '"+e+"' instead. The old field will be removed in a future major version."),t[i])}(t,"advanced_disable_flags","advanced_disable_decide",0,ji)}kn(t){var e;if(dt(this.config.before_send))return t;var i=Object.keys(null!==(e=t.properties)&&void 0!==e?e:{}).filter(mt),r=rt(this.config.before_send)?this.config.before_send:[this.config.before_send],n=t;for(var s of r)try{if(n=s(n),dt(n)){var o="Event '"+t.event+"' was rejected in beforeSend function";return gt(t.event)?ji.warn(o+". This can cause unexpected behavior."):ji.info(o),null}n.properties&&!ot(n.properties)||ji.warn("Event '"+t.event+"' has no properties after beforeSend function, this is likely an error.")}catch(e){return ji.error("Error in beforeSend function for event '"+t.event+"':",e),null}for(var a of i)if(n.properties&&dt(n.properties[a]))return ji.warn("Event '"+t.event+"' had its '"+a+"' property removed in a beforeSend function. This property is required for ingestion, so the event will be dropped."),null;return n}getPageViewId(){var t;return null==(t=this.pageViewManager.Ss)?void 0:t.pageViewId}captureTraceFeedback(t,e){this.capture("$ai_feedback",{$ai_trace_id:String(t),$ai_feedback_text:e})}captureTraceMetric(t,e,i){this.capture("$ai_metric",{$ai_trace_id:String(t),$ai_metric_name:e,$ai_metric_value:String(i)})}Go(t){var e=ft(t)&&!t,i=Df.Nr()&&"true"===Df.Pr("ph_debug");return!e&&(!!i||t)}}Bw.__defaultExtensionClasses={},Bw.Cl=(()=>{var t=()=>{};return{trace:t,debug:t,info:t,warn:t,error:t,fatal:t}})(),function(t,e){for(var i=0;e.length>i;i++)t.prototype[e[i]]=Gi(t.prototype[e[i]])}(Bw,["identify"]);class Uw{constructor(t){this._instance=t}refresh(t){var e=this._instance.config,i=st(e.autocapture)?e.autocapture:void 0;t.enabled=!!e.autocapture,t.rageclick=e.rageclick,t.maskAllElementAttributes=e.mask_all_element_attributes,t.maskAllText=e.mask_all_text,t.disableCaptureUrlHashes=e.disable_capture_url_hashes,t.getCurrentUrl=e.get_current_url,t.remoteRequestsDisabled=this._instance.ma(),t.url_allowlist=null==i?void 0:i.url_allowlist,t.url_ignorelist=null==i?void 0:i.url_ignorelist,t.dom_event_allowlist=null==i?void 0:i.dom_event_allowlist,t.element_allowlist=null==i?void 0:i.element_allowlist,t.css_selector_allowlist=null==i?void 0:i.css_selector_allowlist,t.css_selector_ignorelist=null==i?void 0:i.css_selector_ignorelist,t.element_attribute_ignorelist=null==i?void 0:i.element_attribute_ignorelist,t.capture_copied_text=null==i?void 0:i.capture_copied_text}}var Hw=Bi("[ExceptionAutocapture]"),zw=Bi("[TracingHeaders]"),Ww=Bi("[Web Vitals]"),Vw=9e5,Gw=["CLS","FCP","INP","LCP"],Zw=["INP","LCP"],Qw=["interactionTarget","interactionType","inputDelay","processingDuration","presentationDelay","loadState","target","url","timeToFirstByte","resourceLoadDelay","resourceLoadDuration","elementRenderDelay","largestShiftTarget","largestShiftTime","largestShiftValue","firstByteToFCP"],Jw="[SessionRecording]",Kw=Bi(Jw),Yw=Bi("[Heatmaps]");function Xw(t){return st(t)&&"clientX"in t&&"clientY"in t&&vt(t.clientX)&&vt(t.clientY)}var tk=Bi("[Product Tours]"),ek=t=>{var e;return!t.config.disable_product_tours&&!(null==(e=t.persistence)||!e.get_property(Tn))},ik=["$set_once","$set"],rk=Bi("[SiteApps]"),nk="Error while initializing PostHog app with config id ",sk=(t,e)=>null!=t&&t.then?t.then(e):e(t),ok="SDK is not enabled or survey functionality is not yet loaded",ak="Disabled. Not loading surveys.";class lk{constructor(t,e){this.name="surveys",this._surveyEventReceiver=null,this._surveyManager=null,this.Tl=!1,this.Ml=[],this.El=null,this.Il=null,this.Xn=!1,this.Rl=new Set,this.onRemoteConfig=t=>{if(!this.Xn&&!this.qi.disableSurveys){if(!t.ok)return gf.warn("Remote config unavailable. Not loading surveys.");var e=t.config.surveys;if(dt(e))return gf.warn("Flags not loaded yet. Not loading surveys.");this.Pl=ft(e)?e:e.length>0,gf.info("flags response received, isSurveysEnabled: "+this.Pl),this.loadIfEnabled()}},this.ts=t,this.Al=e}setup(t){if(!this.Xn)return this.Fl=t,sk(t.kv.initialize(),(()=>{if(this.Fl===t&&!this.Xn){this.Fl=void 0,this.ns=t;var e=t.onRemoteConfig(this.onRemoteConfig);this.Xn?e.dispose():(this.ss=e,this.loadIfEnabled())}}))}dispose(){var t,e,i;this.Xn||(this.Xn=!0,this.Fl=void 0,this.ns=void 0,null==(t=this.ss)||t.dispose(),this.ss=void 0,null==(e=this._surveyEventReceiver)||e.dispose(),this._surveyEventReceiver=null,null==(i=this._surveyManager)||null==i.dispose||i.dispose(),this._surveyManager=null,this.Ml=[],this.El=null,this.Rl.forEach((t=>clearTimeout(t))),this.Rl.clear())}get qi(){return this.ts.get()}initialize(){this.loadIfEnabled()}reset(){try{var t;null==(t=this._surveyEventReceiver)||t.reset(),localStorage.removeItem("lastSeenSurveyDate");for(var e=[],i=0;i<localStorage.length;i++){var r=localStorage.key(i);(null!=r&&r.startsWith(_f)||null!=r&&r.startsWith(bf))&&e.push(r)}e.forEach((t=>localStorage.removeItem(t)))}catch(t){}}loadIfEnabled(){if(!this.Xn&&this.ns){var t=this.qi;if(!this._surveyManager)if(this.Tl)gf.info("Already initializing surveys, skipping...");else if(t.disableSurveys)gf.info(ak);else if(t.cookielessMode&&this.ts.isOptedOut())gf.info("Not loading surveys in cookieless mode without consent.");else{var e=this.ts.getExtensions();if(e){if(!at(this.Pl)||t.advancedEnableSurveys){var i=this.Pl||t.advancedEnableSurveys;this.Tl=!0;try{var r=e.generateSurveys;if(r)return this.Ll(r,i),void(this.Tl=!1);var n=e.loadExternalDependency;if(!n)return this.Ol(As),void(this.Tl=!1);n((t=>{try{if(this.Xn)return;var e=this.ts.getExtensions();t||null==e||!e.generateSurveys?this.Ol("Could not load surveys script",t):this.Ll(e.generateSurveys,i)}finally{this.Tl=!1}}))}catch(t){throw this.Tl=!1,this.Ol("Error initializing surveys",t),t}}}else gf.error("PostHog Extensions not found.")}}}Ll(t,e){this.Xn||(this._surveyManager=t(e),this._surveyEventReceiver=this.ts.createEventReceiver(),gf.info("Surveys loaded successfully"),this.Dl({isLoaded:!0}))}Ol(t,e){gf.error(t,e),this.Dl({isLoaded:!1,error:t})}onSurveysLoaded(t){return this.Ml.push(t),this._surveyManager&&this.Dl({isLoaded:!0}),()=>{this.Ml=this.Ml.filter((e=>e!==t))}}getSurveys(t,e){var i;void 0===e&&(e=!1);var r=null!==(i=this.ns)&&void 0!==i?i:this.Al;if(r&&!this.Xn){if(this.qi.disableSurveys)return gf.info(ak),t([]);var n=r.kv.get(is);if(n&&!e)return t(n,{isLoaded:!0}),void(this.$l()&&this.getSurveys((()=>{}),!0));if(this.El)this.El.then((e=>{this.Xn||t(e.surveys,e.context)})).catch((t=>gf.error("Error in survey callback",t)));else{var s=this.Nl("/api/surveys/",{method:"GET",query:{token:r.projectToken},sentAt:"query",timeoutMs:this.qi.requestTimeoutMs}).then((t=>{try{return this.ql(r,t)}catch(t){return gf.error("Error processing surveys response",t),this.ql(r,{statusCode:0,error:t})}}),(t=>this.ql(r,{statusCode:0,error:t})));this.El=s;var o=()=>{this.El===s&&(this.El=null)};s.then((e=>{o(),this.Xn||t(e.surveys,e.context)}),o).catch((t=>gf.error("Error in survey callback",t)))}}}Nl(t,e){var i=this.ns;return i?i.sendRequest(t,e):new Promise((t=>t({statusCode:0,error:new Error(ok)})))}ql(t,e){if(this.Xn)return{surveys:[],context:{isLoaded:!1,error:ok}};var i=e.statusCode;if(200!==i||!e.json){var r="Surveys API could not be loaded, status: "+i;return 0!==i?gf.error(r):e.error||gf.warn(r),this.Il=Date.now(),{surveys:[],context:{isLoaded:!1,error:r}}}this.Il=null;var n,s=e.json.surveys||[],o=s.filter((t=>mf(t)&&(ya(t)||yf(t))));return o.length>0&&(null==(n=this._surveyEventReceiver)||n.register(o)),t.kv.set({[is]:s,[rs]:Date.now()}),{surveys:s,context:{isLoaded:!0}}}$l(){return this.jl()&&!this.El&&!this.Bl()}jl(){var t,e,i=null==(t=null!==(e=this.ns)&&void 0!==e?e:this.Al)?void 0:t.kv.get(rs);return vt(i)&&Date.now()-i>3e5}Bl(){return vt(this.Il)&&3e5>Date.now()-this.Il}markSurveyAsSeen(t,e){var i,r={id:t,current_iteration:null!==(i=null==e?void 0:e.iteration)&&void 0!==i?i:null};Sf(r);try{localStorage.setItem("lastSeenSurveyDate",(new Date).toISOString())}catch(t){}}Dl(t){for(var e of this.Ml)try{if(!t.isLoaded)return e([],t);this.getSurveys(e)}catch(t){gf.error("Error in survey callback",t)}}getActiveMatchingSurveys(t,e){if(void 0===e&&(e=!1),!dt(this._surveyManager))return this._surveyManager.getActiveMatchingSurveys(t,e);gf.warn("init was not called")}Hl(t){var e=null;return this.getSurveys((i=>{var r;e=null!==(r=i.find((e=>e.id===t)))&&void 0!==r?r:null})),e}Ul(t){if(dt(this._surveyManager))return{eligible:!1,reason:ok};var e="string"==typeof t?this.Hl(t):t;return e?this._surveyManager.checkSurveyEligibility(e):{eligible:!1,reason:"Survey not found"}}zl(t){if(dt(this._surveyManager))return{eligible:!1,reason:ok};var e="string"==typeof t?this.Hl(t):t;return e?this._surveyManager.checkSurveyRenderability(e):{eligible:!1,reason:"Survey not found"}}canRenderSurvey(t){if(dt(this._surveyManager))return gf.warn("init was not called"),{visible:!1,disabledReason:ok};var e=this.zl(t);return{visible:e.eligible,disabledReason:e.reason}}canRenderSurveyAsync(t,e){return dt(this._surveyManager)?(gf.warn("init was not called"),Promise.resolve({visible:!1,disabledReason:ok})):new Promise((i=>{this.getSurveys((e=>{var r,n=null!==(r=e.find((e=>e.id===t)))&&void 0!==r?r:null;if(n){var s=this.zl(n);i({visible:s.eligible,disabledReason:s.reason})}else i({visible:!1,disabledReason:"Survey not found"})}),e)}))}renderSurvey(t,e,i){var n;if(dt(this._surveyManager))gf.warn("init was not called");else{var s="string"==typeof t?this.Hl(t):t;if(null!=s&&s.id)if(xf.includes(s.type)){var o=null==r?void 0:r.querySelector(e);if(o)if(null!=(n=s.appearance)&&n.surveyPopupDelaySeconds){gf.info("Rendering survey "+s.id+" with delay of "+s.appearance.surveyPopupDelaySeconds+" seconds");var a=setTimeout((()=>{var t,e;this.Rl.delete(a),this.Xn||(gf.info("Rendering survey "+s.id+" with delay of "+(null==(t=s.appearance)?void 0:t.surveyPopupDelaySeconds)+" seconds"),null==(e=this._surveyManager)||e.renderSurvey(s,o,i),gf.info("Survey "+s.id+" rendered"))}),1e3*s.appearance.surveyPopupDelaySeconds);this.Rl.add(a)}else this._surveyManager.renderSurvey(s,o,i);else gf.warn("Survey element not found")}else gf.warn("Surveys of type "+s.type+" cannot be rendered in the app");else gf.warn("Survey not found")}}displaySurvey(t,e){var i;if(dt(this._surveyManager))gf.warn("init was not called");else{var r=this.Hl(t);if(r){var n=r;if(null!=(i=r.appearance)&&i.surveyPopupDelaySeconds&&e.ignoreDelay&&(n=p({},r,{appearance:p({},r.appearance,{surveyPopupDelaySeconds:0})})),e.displayType!==pf.Popover&&e.initialResponses&&gf.warn("initialResponses is only supported for popover surveys. prefill will not be applied."),!1===e.ignoreConditions){var s=this.Ul(r);if(!s.eligible)return void gf.warn("Survey is not eligible to be displayed: ",s.reason)}e.displayType!==pf.Inline?this._surveyManager.handlePopoverSurvey(n,e):this.renderSurvey(n,e.selector,e.properties)}else gf.warn("Survey not found")}}cancelPendingSurvey(t){dt(this._surveyManager)?gf.warn("init was not called"):this._surveyManager.cancelSurvey(t)}handlePageUnload(){var t;null==(t=this._surveyManager)||null==t.handlePageUnload||t.handlePageUnload()}}function uk(t,e,i){if(dt(t))return!1;switch(i){case"exact":return t===e;case"contains":var r=e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&").replace(/_/g,".").replace(/%/g,".*");return new RegExp(r,"i").test(t);case"regex":try{return new RegExp(e).test(t)}catch(t){return!1}default:return!1}}class hk{constructor(t){this.Wl=new Set,this.Vl=new Set,this.Gl=new uw,this.Zl=(t,e)=>this.Ql(t,e)&&this.Jl(t,e)&&this.Kl(t,e)&&this.Yl(t,e),this.Ql=(t,e)=>null==e||!e.event||(null==t?void 0:t.event)===(null==e?void 0:e.event),this._instance=t}init(){var t,e;at(null==(t=this._instance)?void 0:t._addCaptureHook)||(this.Xl=null==(e=this._instance)?void 0:e._addCaptureHook(((t,e)=>{this.on(t,e)})))}dispose(){var t;null==(t=this.Xl)||t.call(this),this.Xl=void 0,this.Gl=new uw}register(t){var e,i;if(!at(null==(e=this._instance)?void 0:e._addCaptureHook)&&(t.forEach((t=>{var e;this.Wl.add(t),null==(e=t.steps)||e.forEach((t=>{this.Vl.add((null==t?void 0:t.event)||"")}))})),null!=(i=this._instance)&&i.autocapture)){var r=new Set;this.Wl.forEach((t=>{var e;null==(e=t.steps)||e.forEach((t=>{null!=t&&t.selector&&r.add(t.selector)}))})),this._instance.autocapture.setElementSelectors(r)}}replace(t){this.Wl.clear(),this.Vl.clear(),this.register(t)}on(t,e){null!=e&&0!=t.length&&(this.Vl.has(t)||this.Vl.has(e.event))&&this.Wl.forEach((t=>{this.tu(e,t)&&this.Gl.emit("actionCaptured",t.name)}))}eu(t){this.onAction("actionCaptured",(e=>t(e)))}tu(t,e){if(null==(null==e?void 0:e.steps))return!1;for(var i of e.steps)if(this.Zl(t,i))return!0;return!1}onAction(t,e){return this.Gl.on(t,e)}Jl(t,e){if(null!=e&&e.url){var i,r=null==t||null==(i=t.properties)?void 0:i.$current_url;if(!r||"string"!=typeof r)return!1;if(!uk(r,e.url,e.url_matching||"contains"))return!1}return!0}Kl(t,e){return!!this.iu(t,e)&&!!this.ru(t,e)&&!!this.nu(t,e)}iu(t,e){var i;if(null==e||!e.href)return!0;var r=this.su(t);if(r.length>0)return r.some((t=>uk(t.href,e.href,e.href_matching||"exact")));var n,s=(null==t||null==(i=t.properties)?void 0:i.$elements_chain)||"";return!!s&&uk((n=s.match(/(?::|")href="(.*?)"/))?n[1]:"",e.href,e.href_matching||"exact")}ru(t,e){var i;if(null==e||!e.text)return!0;var r=this.su(t);if(r.length>0)return r.some((t=>uk(t.text,e.text,e.text_matching||"exact")||uk(t.$el_text,e.text,e.text_matching||"exact")));var n,s,o,a=(null==t||null==(i=t.properties)?void 0:i.$elements_chain)||"";return!!a&&(n=function(t){for(var e,i=[],r=/(?::|")text="(.*?)"/g;!dt(e=r.exec(t));)i.includes(e[1])||i.push(e[1]);return i}(a),s=e.text,o=e.text_matching||"exact",n.some((t=>uk(t,s,o))))}nu(t,e){var i,r;if(null==e||!e.selector)return!0;var n=null==t||null==(i=t.properties)?void 0:i.$element_selectors;if(null!=n&&n.includes(e.selector))return!0;var s=(null==t||null==(r=t.properties)?void 0:r.$elements_chain)||"";if(e.selector_regex&&s)try{return new RegExp(e.selector_regex).test(s)}catch(t){return!1}return!1}su(t){var e;return null==(null==t||null==(e=t.properties)?void 0:e.$elements)?[]:null==t?void 0:t.properties.$elements}Yl(t,e){return null==e||!e.properties||0===e.properties.length||Sa(e.properties.reduce(((t,e)=>{var i=rt(e.value)?e.value.map(String):null!=e.value?[String(e.value)]:[];return t[e.key]={values:i,operator:e.operator||"exact"},t}),{}),null==t?void 0:t.properties)}}class dk{constructor(t){var e;this.au=[],this._instance=t,this.ou=new Map,this.lu=new Map,this.uu=new Map,this.hu=null==(e=this._instance)||null==e.onSessionId?void 0:e.onSessionId((t=>this.du(t)))}vu(t){return!1}cu(){return null}fu(t){}pu(){}gu(t,e){return!!t&&Sa(t.propertyFilters,null==e?void 0:e.properties)}mu(t,e){var i=new Map;return t.forEach((t=>{var r;null==(r=t.conditions)||null==(r=r[e])||null==(r=r.values)||r.forEach((e=>{if(null!=e&&e.name){var r=i.get(e.name)||[];r.push(t.id),i.set(e.name,r)}}))})),i}yu(t,e,i){var r=(i===sf.Activation?this.ou:this.lu).get(t),n=[];return this.bu((t=>{n=t.filter((t=>null==r?void 0:r.includes(t.id)))})),n.filter((r=>{var n,s=null==(n=r.conditions)||null==(n=n[i])||null==(n=n.values)?void 0:n.find((e=>e.name===t));return this.gu(s,e)}))}register(t){this._u(t,!1)}replace(t){this._u(t,!0)}_u(t,e){var i;at(null==(i=this._instance)?void 0:i._addCaptureHook)||(this.wu(t,e),this.ku(t,e))}ku(t,e){var i=t.filter((t=>{var e;return null==(e=t.conditions)||null==(e=e.actions)||null==(e=e.values)?void 0:e.length}));if(e&&this.uu.clear(),0!==i.length){this.Su||(this.Su=new hk(this._instance),this.Su.init(),this.Su.eu((t=>this.onAction(t))));var r=[];i.forEach((t=>{var e;null==(e=t.conditions)||null==(e=e.actions)||e.values.forEach((e=>{if(r.push(e),e.name){var i,n=null!==(i=this.uu.get(e.name))&&void 0!==i?i:[];n.includes(t.id)||n.push(t.id),this.uu.set(e.name,n)}}))})),e?this.Su.replace(r):this.Su.register(r)}else{var n;e&&(null==(n=this.Su)||n.replace([]))}}xu(t,e){e.forEach(((e,i)=>{var r,n=null!==(r=t.get(i))&&void 0!==r?r:[];e.forEach((t=>{n.includes(t)||n.push(t)})),t.set(i,n)}))}wu(t,e){var i,r,n=t.filter((t=>{var e,i;return(null==(e=t.conditions)?void 0:e.events)&&(null==(i=t.conditions)||null==(i=i.events)||null==(i=i.values)?void 0:i.length)>0})),s=t.filter((t=>{var e,i;return(null==(e=t.conditions)?void 0:e.cancelEvents)&&(null==(i=t.conditions)||null==(i=i.cancelEvents)||null==(i=i.values)?void 0:i.length)>0})),o=this.mu(t,sf.Activation),a=this.mu(t,sf.Cancellation);e?(this.ou=o,this.lu=a):(this.xu(this.ou,o),this.xu(this.lu,a)),(0!==n.length||0!==s.length)&&(null!==(i=this.Xl)&&void 0!==i||(this.Xl=null==(r=this._instance)?void 0:r._addCaptureHook(((t,e)=>{this.onEvent(t,e)}))))}onEvent(t,e){var i,r,n=this.Cu(),s=(null==e||null==(i=e.properties)?void 0:i.$survey_id)||(null==e||null==(r=e.properties)?void 0:r.$product_tour_id);if(s&&this.getActivatedIds().includes(s)){var o=this.Tu(t,s);if("consume"===o)return n.info("event consumed activated item, removing it",{event:t,itemId:s}),void this.Mu([s]);if("persist"===o)return n.info("shown item promoted to persisted activation",{event:t,itemId:s}),this.Eu(s),void this.Iu([s])}if(this.lu.has(t)){var a=this.yu(t,e,sf.Cancellation);a.length>0&&(n.info("cancel event matched, cancelling items",{event:t,itemsToCancel:a.map((t=>t.id))}),this.Mu(a.map((t=>t.id))),a.forEach((t=>this.Ru(t.id))))}if(this.ou.has(t)){n.info("event name matched",{event:t,eventPayload:e,items:this.ou.get(t)});var l=this.yu(t,e,sf.Activation);this.Pu(l.map((t=>t.id)))}}onAction(t){this.uu.has(t)&&this.Pu(this.uu.get(t)||[])}Pu(t){var e;if(0!==t.length){var i=!(null==(e=this._instance)||null==e.get_session_id||!e.get_session_id()),r=[];for(var n of t)i&&this.vu(n)?this.Eu(n)&&this.Au(n):r.push(n);r.length>0&&(this.au=[...new Set([...this.au,...r])]),this.Cu().info("updating activated items",{activatedItems:this.getActivatedIds()})}}Eu(t){this.au=this.au.filter((e=>e!==t));var e=this.Fu();return!e.includes(t)&&(this.Lu([...e,t]),this.Ou(),!0)}Mu(t){var e=new Set(t);this.au=this.au.filter((t=>!e.has(t)));var i=this.Du(),r=i.filter((t=>!e.has(t)));r.length!==i.length&&(this.Lu(r),0===r.length&&this.$u()),this.Iu(t)}Nu(){var t,e=this.cu();if(!e)return{};var i=null==(t=this._instance)||null==(t=t.persistence)?void 0:t.props[e];return i&&"object"==typeof i?i:{}}Au(t){if(this.cu()){var e=this.Nu();this.fu(p({},e,{[t]:Date.now()}))}}Iu(t){if(this.cu()){var e=this.Nu(),i={},r=!1;for(var n of Object.entries(e)){var s=n[0],o=n[1];t.includes(s)?r=!0:i[s]=o}r&&(ot(i)?this.pu():this.fu(i))}}qu(){this.cu()&&this.pu()}getActivationTimestamp(t){if(this.Fu().includes(t)){var e=this.Nu()[t];return vt(e)?e:void 0}}Du(){var t,e=this.ju();return(null==(t=this._instance)||null==(t=t.persistence)?void 0:t.props[e])||[]}Fu(){var t,e,i=this.Du();if(0===i.length)return[];var r=null==(t=this._instance)||null==(t=t.persistence)?void 0:t.props[this.Bu()],n=null==(e=this._instance)||null==e.get_session_id?void 0:e.get_session_id();return n&&r===n?i:[]}Ou(){var t,e=null==(t=this._instance)||null==t.get_session_id?void 0:t.get_session_id();e&&this.Hu(e)}$u(){this.Uu()}du(t){var e,i=null==(e=this._instance)||null==(e=e.persistence)?void 0:e.props[this.Bu()];if(i&&i!==t){var r=this.Du(),n=this.Nu();r.length>0&&(this.Lu([]),r.filter((t=>vt(n[t]))).forEach((t=>this.Ru(t)))),this.$u(),this.qu()}}getActivatedIds(){return[...new Set([...this.Fu(),...this.au])].filter((t=>!this.zu(t)))}dispose(){var t,e,i;null==(t=this.hu)||t.call(this),this.hu=void 0,null==(e=this.Xl)||e.call(this),this.Xl=void 0,null==(i=this.Su)||i.dispose(),this.Su=void 0}reset(){this.au=[],this.Du().length>0&&this.Lu([]),this.$u(),this.qu()}getEventToItemsMap(){return this.ou}Wu(){return this.Su}}class vk extends dk{constructor(t){super(t)}ju(){return ns}Bu(){return ss}cu(){return os}fu(t){var e;null==(e=this._instance)||null==(e=e.persistence)||e.register({[os]:t})}pu(){var t;null==(t=this._instance)||null==(t=t.persistence)||t.unregister(os)}vu(t){var e,i;this.bu((e=>{i=e.find((e=>e.id===t))}));var r=null==(e=i)||null==(e=e.appearance)?void 0:e.surveyPopupDelaySeconds;return vt(r)&&r>0}Vu(){return cf.SHOWN}bu(t){var e;null==(e=this._instance)||e.getSurveys(t)}Ru(t){var e;null==(e=this._instance)||e.cancelPendingSurvey(t)}Cu(){return gf}Lu(t){var e;null==(e=this._instance)||null==(e=e.persistence)||e.register({[ns]:t})}Hu(t){var e;null==(e=this._instance)||null==(e=e.persistence)||e.register({[ss]:t})}Uu(){var t;null==(t=this._instance)||null==(t=t.persistence)||t.unregister(ss)}zu(){return!1}Tu(t,e){var i;return this.bu((t=>{i=t.find((t=>t.id===e))})),!i||_a(i)?t===cf.SHOWN?"consume":"ignore":t===cf.SHOWN?"persist":t===cf.DISMISSED||t===cf.SENT?"consume":"ignore"}getSurveys(){return this.getActivatedIds()}getEventToSurveys(){return this.getEventToItemsMap()}}class ck{constructor(t){this._instance=t}initialize(){}get(t){if("string"==typeof t)return this._instance.get_property(t);var e={};for(var i of t){var r=this._instance.get_property(i);at(r)||(e[i]=r)}return e}set(t,e){this._instance.register("string"==typeof t?{[t]:e}:t)}remove(t){"string"!=typeof t?t.forEach((t=>this._instance.unregister(t))):this._instance.unregister(t)}}class fk{constructor(t){this._instance=t}get(){var t=this._instance.config;return{disableSurveys:t.disable_surveys,cookielessMode:!!t.cookieless_mode,advancedEnableSurveys:t.advanced_enable_surveys,requestTimeoutMs:t.surveys_request_timeout_ms}}isOptedOut(){return this._instance.consent.isOptedOut()}getExtensions(){var t=null==v?void 0:v.__PosthogExtensions__;if(t){var e=t.generateSurveys,i=t.loadExternalDependency;return{generateSurveys:e?t=>e(this._instance,t):void 0,loadExternalDependency:i?t=>i(this._instance,"surveys",t):void 0}}}createEventReceiver(){return new vk(this._instance)}}var pk=null!=t&&t.location?sr(t.location.hash,"__posthog")||sr(location.hash,"state"):null,gk="_postHogToolbarParams",mk=Bi("[Toolbar]"),yk=Bi("[FeatureFlags]");class _k{constructor(t,e){void 0===e&&(e=!1),this.Gu=!1,this.update(t,e)}update(t,e){this.Zu=((t,e)=>{var i,r,n,s;return{bootstrap:{featureFlags:null==(i=t.bootstrap)?void 0:i.featureFlags,featureFlagPayloads:null==(r=t.bootstrap)?void 0:r.featureFlagPayloads},remoteRequestsDisabled:e,featureFlagsDisabled:!!t.advanced_disable_feature_flags,onlyEvaluateSurveyFeatureFlags:!!t.advanced_only_evaluate_survey_feature_flags,deduplicateCallsPerSession:!!t.advanced_feature_flags_dedup_per_session,cacheTtlMs:t.feature_flag_cache_ttl_ms,requestTimeoutMs:t.feature_flag_request_timeout_ms,compression:t.disable_compression?"none":"base64",evaluationContexts:null!==(n=null!==(s=t.evaluation_contexts)&&void 0!==s?s:t.evaluation_environments)&&void 0!==n?n:[],flagKeys:rt(t.flag_keys)?t.flag_keys:void 0}})(t,e),!t.evaluation_environments||t.evaluation_contexts||this.Gu||(yk.warn("evaluation_environments is deprecated. Use evaluation_contexts instead. evaluation_environments will be removed in a future version."),this.Gu=!0),at(t.flag_keys)||rt(t.flag_keys)||yk.error("Invalid flag_keys found:",t.flag_keys,"Expected array of non-empty strings")}get(){return this.Zu}}var bk=Bi("[FeatureFlags]"),wk=Bi("[FeatureFlags]",{debugEnabled:!0}),kk="\" failed. Feature flags didn't load in time.",Sk="connection_error",xk=t=>{for(var e={},i=0;t.length>i;i++)e[t[i]]=!0;return e},Ck=t=>{var e={};for(var i of Wi(t||{})){var r=i[1];r&&(e[i[0]]=r)}return e},Tk="Refusing to render web experiment since the viewer is a likely bot",Ek={icontains:(t,e)=>e.toLowerCase().indexOf(t.toLowerCase())>-1,not_icontains:(t,e)=>-1===e.toLowerCase().indexOf(t.toLowerCase()),regex:(t,e)=>ba(e,t),not_regex:(t,e)=>!ba(e,t),exact:(t,e)=>e===t,is_not:(t,e)=>e!==t};class Mk{get qi(){return this._instance.config}constructor(t){var e=this;this.getWebExperimentsAndEvaluateDisplayLogic=function(t){void 0===t&&(t=!1),e.getWebExperiments((t=>{Mk.Qu("retrieved web experiments from the server"),e.Ju=new Map,t.forEach((t=>{if(t.feature_flag_key){var i;e.Ju&&(Mk.Qu("setting flag key ",t.feature_flag_key," to web experiment ",t),null==(i=e.Ju)||i.set(t.feature_flag_key,t));var r=e._instance.getFeatureFlag(t.feature_flag_key);lt(r)&&t.variants[r]&&e.Ku(t.name,r,t.variants[r].transforms)}else if(t.variants)for(var n in t.variants){var s=t.variants[n];Mk.Yu(s,e._instance)&&e.Ku(t.name,n,s.transforms)}}))}),t)},this._instance=t,this._instance.onFeatureFlags((t=>{this.onFeatureFlags(t)}))}initialize(){}onFeatureFlags(t){if(this._is_bot())Mk.Qu(Tk);else if(!this.qi.disable_web_experiments){if(dt(this.Ju))return this.Ju=new Map,this.loadIfEnabled(),void this.previewWebExperiment();Mk.Qu("applying feature flags",t),t.forEach((t=>{var e;if(this.Ju&&null!=(e=this.Ju)&&e.has(t)){var i,r=this._instance.getFeatureFlag(t),n=null==(i=this.Ju)?void 0:i.get(t);r&&null!=n&&n.variants[r]&&this.Ku(n.name,r,n.variants[r].transforms)}}))}}previewWebExperiment(){var t=Mk.getWindowLocation();if(null!=t&&t.search){var e=rr(null==t?void 0:t.search,"__experiment_id"),i=rr(null==t?void 0:t.search,"__experiment_variant");e&&i&&(Mk.Qu("previewing web experiments "+e+" && "+i),this.getWebExperiments((t=>{this.Xu(parseInt(e),i,t)}),!1,!0))}}loadIfEnabled(){this.qi.disable_web_experiments||this.getWebExperimentsAndEvaluateDisplayLogic()}getWebExperiments(t,e,i){if(this.qi.disable_web_experiments&&!i)return t([]);var r=this._instance.get_property("$web_experiments");if(r&&!e)return t(r);this._instance._send_request({url:this._instance.requestRouter.endpointFor("api","/api/web_experiments/?token="+this.qi.token),method:"GET",timestampMode:"query",callback:e=>t(200===e.statusCode&&e.json&&e.json.experiments||[])})}Xu(t,e,i){var r=i.filter((e=>e.id===t));r&&r.length>0&&(Mk.Qu("Previewing web experiment ["+r[0].name+"] with variant ["+e+"]"),this.Ku(r[0].name,e,r[0].variants[e].transforms))}static Yu(t,e){return!dt(t.conditions)&&Mk.th(t,e)&&Mk.eh(t)}static th(t,e){var i;if(dt(t.conditions)||dt(null==(i=t.conditions)?void 0:i.url))return!0;var r=Mk.getWindowLocation();if(r){var n,s,o,a=lr(e,r.href);return null==(n=t.conditions)||!n.url||Ek[null!==(s=null==(o=t.conditions)?void 0:o.urlMatchType)&&void 0!==s?s:"icontains"](t.conditions.url,a)}return!1}static getWindowLocation(){return null==t?void 0:t.location}static eh(t){var e;if(dt(t.conditions)||dt(null==(e=t.conditions)?void 0:e.utm))return!0;var i=Na();if(i.utm_source){var r,n,s,o,a,l,u,h,d=null==(r=t.conditions)||null==(r=r.utm)||!r.utm_campaign||(null==(n=t.conditions)||null==(n=n.utm)?void 0:n.utm_campaign)==i.utm_campaign,v=null==(s=t.conditions)||null==(s=s.utm)||!s.utm_source||(null==(o=t.conditions)||null==(o=o.utm)?void 0:o.utm_source)==i.utm_source,c=null==(a=t.conditions)||null==(a=a.utm)||!a.utm_medium||(null==(l=t.conditions)||null==(l=l.utm)?void 0:l.utm_medium)==i.utm_medium,f=null==(u=t.conditions)||null==(u=u.utm)||!u.utm_term||(null==(h=t.conditions)||null==(h=h.utm)?void 0:h.utm_term)==i.utm_term;return d&&c&&f&&v}return!1}static Qu(t){for(var e=arguments.length,i=new Array(e>1?e-1:0),r=1;e>r;r++)i[r-1]=arguments[r];ji.info("[WebExperiments] "+t,i)}Ku(t,e,i){this._is_bot()?Mk.Qu(Tk):"control"!==e?i.forEach((i=>{if(i.selector){var r;Mk.Qu("applying transform of variant "+e+" for experiment "+t+" ",i);var n=null==(r=document)?void 0:r.querySelectorAll(i.selector);null==n||n.forEach((t=>{var e=t;i.html&&(e.innerHTML=i.html),i.css&&e.setAttribute("style",i.css)}))}})):Mk.Qu("Control variants leave the page unmodified.")}_is_bot(){return i&&this._instance?cw(i,this.qi.custom_blocked_useragents):void 0}}var Ik=Bi("[Conversations]"),Rk="Conversations not available yet.",Pk="console",Ak="__posthogHandledLogsRequestError",Ok=(t,e)=>{var i=t instanceof Error?t:new Error(e);return i[Ak]=!0,i},Fk=t=>!!t&&"object"==typeof t&&!0===t[Ak],Lk={featureFlags:class{constructor(t){this.name="featureFlags",this.ih=!1,this.featureFlagEventHandlers=[],this.I=bk,this.rh={},this.nh={},this.sh=[],this.ah=!1,this.oh=!1,this.lh=0,this.uh=!1,this.hh=!1,this.dh=!1,this.fh=!1,this.ph=0,this.Tt=()=>{var t=this.gh();this.ph=0,t&&this.reloadFeatureFlags()},"get"in t?this.ts=t:(this.mh=new _k(t.config,t.ma()),this.ts=this.mh)}updateConfig(t,e){var i;null==(i=this.mh)||i.update(t,e)}setup(t){return this.Fl=t,this.I=t.logger.createLogger("[FeatureFlags]"),sk(t.kv.initialize(),(()=>{this.Fl===t&&(this.Fl=void 0,this.ns=t,this.yh(t))}))}yh(e){if(this.ns===e)return t&&Ki(t,"online",this.Tt),this.bh=e.registerDynamicEventProperties((()=>this._h()?this.rh:this.nh)),this.wh(),this.initialize()}destroy(){null==t||t.removeEventListener("online",this.Tt)}dispose(){var e;this.lh++,this.hh=!1,this.Fl=void 0,this.ns&&(this.kh(),null==(e=this.bh)||e.dispose(),this.bh=void 0,this.sh=[],null==t||t.removeEventListener("online",this.Tt),this.ns=void 0)}get qi(){return this.ts.get()}Sh(t){var e;return null==(e=this.ns)?void 0:e.kv.get(t)}Dr(t){this.xh((()=>{var e;return null==(e=this.ns)?void 0:e.kv.set(t)}))}qr(t){this.xh((()=>{var e;return null==(e=this.ns)?void 0:e.kv.remove(t)}))}xh(t){try{t()}catch(t){this.I.error("Failed to update feature flag persistence",t)}}wh(){var t={};for(var e of[Wn,Zn,Qn,Kn]){var i=this.Sh(e);at(i)||(t[e]=i)}this.rh=t;var r=p({},t),n=this.Sh(zn);if(n)for(var s of Object.entries(n))r["$feature/"+s[0]]=s[1];this.nh=r}_h(){var t=this.qi.cacheTtlMs;if(!t||0>=t)return!1;var e=this.Sh(ds);return"number"!=typeof e||Date.now()-e>t}Ch(){return!!this._h()&&(this.fh||this.oh||(this.fh=!0,this.I.warn("Feature flag cache is stale, triggering refresh..."),this.reloadFeatureFlags()),!0)}Th(){var t=this.qi.evaluationContexts;return null!=t&&t.length?t.filter((t=>{var e=t&&"string"==typeof t&&t.trim().length>0;return e||this.I.error("Invalid evaluation context found:",t,"Expected non-empty string"),e})):[]}Mh(){var t=this.qi.flagKeys;if(!at(t))return t.filter((t=>{var e=t&&"string"==typeof t&&t.trim().length>0;return e||this.I.error("Invalid flag key found:",t,"Expected non-empty string"),e}))}initialize(){var t,e,i=this.qi,r=null!==(t=null==(e=i.bootstrap)?void 0:e.featureFlags)&&void 0!==t?t:{};if(Object.keys(r).length){var n,s,o=null!==(n=null==(s=i.bootstrap)?void 0:s.featureFlagPayloads)&&void 0!==n?n:{},a=Object.keys(r).filter((t=>!!r[t])).reduce(((t,e)=>(t[e]=r[e]||!1,t)),{}),l=Object.keys(o).filter((t=>a[t])).reduce(((t,e)=>(t[e]=o[e],t)),{});return this.Eh({featureFlags:a,featureFlagPayloads:l})}}updateFlags(t,e,i){var r,n,s=null!=i&&i.merge&&null!==(r=this.Sh(zn))&&void 0!==r?r:{},o=null!=i&&i.merge&&null!==(n=this.Sh(Zn))&&void 0!==n?n:{},a=p({},s,t),l=p({},o,e),u={};for(var h of Object.entries(a)){var d=h[0],v=h[1];u[d]={key:d,enabled:b(v),variant:w(v),reason:void 0,metadata:at(null==l?void 0:l[d])?void 0:{id:0,version:void 0,description:void 0,payload:l[d]}}}this.Eh({flags:u})}get hasLoadedFlags(){return this.ah}getFlags(){return Object.keys(this.getFlagVariants())}getFlagsWithDetails(){var t=this.Sh(Gn),e=this.Sh(Kn),i=this.Sh(Yn);if(!i&&!e)return t||{};var r=zi({},t||{}),n=[...new Set([...Object.keys(i||{}),...Object.keys(e||{})])];for(var s of n){var o,a,l=r[s],u=null==e?void 0:e[s],h=at(u)?null!==(o=null==l?void 0:l.enabled)&&void 0!==o&&o:!!u,d=at(u)?null==l?void 0:l.variant:"string"==typeof u?u:void 0,v=null==i?void 0:i[s],c=p({},l,{enabled:h,variant:h?null!=d?d:null==l?void 0:l.variant:void 0});h!==(null==l?void 0:l.enabled)&&(c.original_enabled=null==l?void 0:l.enabled),d!==(null==l?void 0:l.variant)&&(c.original_variant=null==l?void 0:l.variant),v&&(c.metadata=p({},null==l?void 0:l.metadata,{payload:v,original_payload:null==l||null==(a=l.metadata)?void 0:a.payload})),r[s]=c}return this.ih||(this.I.warn(" Overriding feature flag details!",{flagDetails:t,overriddenPayloads:i,finalDetails:r}),this.ih=!0),r}getAllFeatureFlags(){var t=this.getFlagVariants(),e=this.getFlagPayloads();return Object.keys(t).map((i=>{var r=t[i];return{key:i,enabled:b(r),variant:w(r),payload:_(e[i])}}))}getFlagVariants(){var t=this.Sh(zn),e=this.Sh(Kn);if(!e)return t||{};for(var i=zi({},t||{}),r=Object.keys(e),n=0;r.length>n;n++)i[r[n]]=e[r[n]];return this.ih||(this.I.warn(" Overriding feature flags!",{enabledFlags:t,overriddenFlags:e,finalFlags:i}),this.ih=!0),i}getFlagPayloads(){var t=this.Sh(Zn),e=this.Sh(Yn);if(!e)return t||{};for(var i=zi({},t||{}),r=Object.keys(e),n=0;r.length>n;n++)i[r[n]]=e[r[n]];return this.ih||(this.I.warn(" Overriding feature flag payloads!",{flagPayloads:t,overriddenPayloads:e,finalPayloads:i}),this.ih=!0),i}reloadFeatureFlags(){this.uh||this.qi.featureFlagsDisabled||this.gh()||this.Ih||(this.sh.slice().forEach((t=>{try{t()}catch(t){this.I.error("Error while running feature flags reloading callback",t)}})),this.Ih=setTimeout((()=>{this.Rh()}),5))}kh(){clearTimeout(this.Ih),this.Ih=void 0}onReloading(t){return this.sh.push(t),()=>{this.sh=this.sh.filter((e=>e!==t))}}ensureFlagsLoaded(){this.ah||this.oh||this.Ih||this.reloadFeatureFlags()}setAnonymousDistinctId(t){this.$anon_distinct_id=t}setReloadingPaused(t){this.uh=t}resetFlagCallReported(){this.qr(ls)}Rh(t){this.kh();var e=this.ns;if(e&&!this.qi.remoteRequestsDisabled&&!this.gh())if(this.oh)this.hh=!0;else{var i={token:e.projectToken,distinct_id:e.distinctId,groups:e.groups,$anon_distinct_id:this.$anon_distinct_id,person_properties:p({},e.initialPersonProperties,this.Sh(Xn)||{},{$lib:e.library.name,$lib_version:e.library.version}),group_properties:this.Sh(ts),timezone:Va()};at(e.deviceId)||(i.$device_id=e.deviceId),(null!=t&&t.disableFlags||this.qi.featureFlagsDisabled)&&(i.disable_flags=!0);var r=this.Th();r.length&&(i.evaluation_contexts=r);var n=this.Mh();at(n)||(i.flag_keys=n);var s=this.qi.onlyEvaluateSurveyFeatureFlags,o="/flags/?v=2"+(s?"&only_evaluate_survey_feature_flags=true":""),a=this.lh;this.oh=!0;var l=()=>{this.hh&&(this.hh=!1,this.Rh())},u=t=>{this.oh=!1,a===this.lh?(this.Dr({[hs]:[Sk]}),this.I.error("Feature flag request failed",t),l()):l()};try{e.sendRequest(o,{target:"flags",method:"POST",body:i,compression:"base64"===this.qi.compression?nf.Base64:void 0,sentAt:"body",timeoutMs:this.qi.requestTimeoutMs}).then((t=>{var e,r,n=null!==(e=t.json)&&void 0!==e?e:{},o=200!==t.statusCode;if(this.oh=!1,a===this.lh){if(this.Ph(t.statusCode),o||this.hh||(this.$anon_distinct_id=void 0),!i.disable_flags||this.hh){this.dh=!o;var u=[];t.error?u.push(t.error instanceof Error&&"AbortError"===t.error.name?"timeout":t.error instanceof Error?Sk:"unknown_error"):200!==t.statusCode&&u.push("api_error_"+t.statusCode),n.errorsWhileComputingFlags&&u.push("errors_while_computing_flags");var h=!(null==(r=n.quotaLimited)||!r.includes("feature_flags"));h&&u.push("quota_limited"),this.Dr({[hs]: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.Eh(n,o,{partialResponse:s}),l()}}else l()})).catch(u)}catch(t){u(t)}}}gh(){return or(this.ph,3)}Ph(t){this.ph=ar(t,this.ph,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(t,e){var i;if(void 0===e&&(e={}),!e.fresh||this.dh)if(this.ah||this.getFlags()&&this.getFlags().length>0){if(!this.Ch()){var r=this.getFeatureFlagResult(t,e);return null!==(i=null==r?void 0:r.variant)&&void 0!==i?i:null==r?void 0:r.enabled}}else this.I.warn('getFeatureFlag for key "'+t+kk)}getFeatureFlagDetails(t){return this.getFlagsWithDetails()[t]}getFeatureFlagPayload(t){var e=this.getFeatureFlagResult(t,{send_event:!1});return null==e?void 0:e.payload}getFeatureFlagResult(t,e){if(void 0===e&&(e={}),!e.fresh||this.dh)if(this.ah||this.getFlags()&&this.getFlags().length>0){if(!this.Ch()){var i,r=this.getFlagVariants(),n=t in r,s=r[t],o=this.getFlagPayloads()[t],a=String(s),l=this.Sh(Qn)||void 0,u=this.Sh(ds)||void 0,h=this.Sh(ls)||{};if(this.qi.deduplicateCallsPerSession){var d,v=null==(d=this.ns)?void 0:d.session.sessionId,c=this.Sh(us);v&&v!==c&&(h={},i=v)}if(e.send_event||!("send_event"in e))if(t in h&&h[t].includes(a))i&&this.Dr({[ls]:h,[us]:i});else{var f,g,m,y,b,w,k,S,x,C,T,E;rt(h[t])?h[t].push(a):h[t]=[a],this.Dr(p({[ls]:h},i?{[us]:i}:{}));var M=this.getFeatureFlagDetails(t),I=[...null!==(f=this.Sh(hs))&&void 0!==f?f:[]];at(s)&&I.push("flag_missing");var R={$feature_flag:t,$feature_flag_response:s,$feature_flag_payload:null!=o?o:null,$feature_flag_request_id:l,$feature_flag_evaluated_at:u,$feature_flag_bootstrapped_response:null!==(g=null==(m=this.qi.bootstrap)||null==(m=m.featureFlags)?void 0:m[t])&&void 0!==g?g:null,$feature_flag_bootstrapped_payload:null!==(y=null==(b=this.qi.bootstrap)||null==(b=b.featureFlagPayloads)?void 0:b[t])&&void 0!==y?y:null,$used_bootstrap_value:!this.dh};at(null==M||null==(w=M.metadata)?void 0:w.has_experiment)||(R.$feature_flag_has_experiment=M.metadata.has_experiment),at(null==M||null==(k=M.metadata)?void 0:k.version)||(R.$feature_flag_version=M.metadata.version);var P,A=null!==(S=null==M||null==(x=M.reason)?void 0:x.description)&&void 0!==S?S:null==M||null==(C=M.reason)?void 0:C.code;A&&(R.$feature_flag_reason=A),null!=M&&null!=(T=M.metadata)&&T.id&&(R.$feature_flag_id=M.metadata.id),at(null==M?void 0:M.original_variant)&&at(null==M?void 0:M.original_enabled)||(R.$feature_flag_original_response=at(M.original_variant)?M.original_enabled:M.original_variant),null!=M&&null!=(E=M.metadata)&&E.original_payload&&(R.$feature_flag_original_payload=null==M||null==(P=M.metadata)?void 0:P.original_payload),I.length&&(R.$feature_flag_error=I.join(",")),this.Ah(R)}else i&&this.Dr({[ls]:h,[us]:i});if(n)return{key:t,enabled:!!s,variant:"string"==typeof s?s:void 0,payload:_(o)}}}else this.I.warn('getFeatureFlagResult for key "'+t+kk)}Ah(t){try{var e;null==(e=this.ns)||e.capture("$feature_flag_called",t).catch((t=>{this.I.error("Failed to capture feature flag call",t)}))}catch(t){this.I.error("Failed to capture feature flag call",t)}}getRemoteConfigPayload(t,e){this.Fh(t,e)}Fh(t,e){var i=this;return f((function*(){var r=i.ns;if(r){var n={distinct_id:r.distinctId,token:r.projectToken,person_properties:{$lib:r.library.name,$lib_version:r.library.version}},s=i.Th();s.length&&(n.evaluation_contexts=s);var o,a=i.Mh();at(a)||(n.flag_keys=a);try{var l,u=null==(l=(yield r.sendRequest("/flags/?v=2",{target:"flags",method:"POST",body:n,compression:"base64"===i.qi.compression?nf.Base64:void 0,sentAt:"body",timeoutMs:i.qi.requestTimeoutMs})).json)?void 0:l.featureFlagPayloads;o=(null==u?void 0:u[t])||void 0}catch(t){return void i.I.error("Remote config feature flag request failed",t)}try{e(o)}catch(t){i.I.error("Remote config feature flag callback failed",t)}}}))()}isFeatureEnabled(t,e){if(void 0===e&&(e={}),e.fresh&&!this.dh)return e.defaultValue;if(!(this.ah||this.getFlags()&&this.getFlags().length>0))return this.I.warn('isFeatureEnabled for key "'+t+kk),e.defaultValue;var i=this.getFeatureFlag(t,e);return at(i)?e.defaultValue:!!i}addFeatureFlagsHandler(t){this.featureFlagEventHandlers.push(t)}removeFeatureFlagsHandler(t){this.featureFlagEventHandlers=this.featureFlagEventHandlers.filter((e=>e!==t))}receivedFeatureFlags(t,e,i){this.Eh(t,e,i)}Eh(t,e,i){if(this.ns){this.ah=!0;var r=function(t,e,i,r,n,s){void 0===e&&(e={}),void 0===i&&(i={}),void 0===r&&(r={}),void 0===s&&(s=bk);var o=((t,e)=>{var i=t.flags;return i?p({},t,{featureFlags:Object.fromEntries(Object.keys(i).map((t=>{var e;return[t,null!==(e=i[t].variant)&&void 0!==e?e:i[t].enabled]}))),featureFlagPayloads:Object.fromEntries(Object.keys(i).filter((t=>i[t].enabled)).filter((t=>{var e;return null==(e=i[t].metadata)?void 0:e.payload})).map((t=>{var e;return[t,null==(e=i[t].metadata)?void 0:e.payload]})))}):(t.featureFlags&&e.warn("Using an older version of the feature flags endpoint. Please upgrade your PostHog server to the latest version"),t)})(t,s),a=o.flags,l=o.featureFlags,u=o.featureFlagPayloads;if(l){var h=t.requestId,d=t.evaluatedAt;if(rt(l)){s.warn("v1 of the feature flags endpoint is deprecated. Please use the latest version.");var v={};if(l)for(var c=0;l.length>c;c++)v[l[c]]=!0;return{[Wn]:l,[zn]:v,[Jn]:!1}}var f=l,g=u,m=a;if(null!=n&&n.partialResponse)f=p({},e,f),g=p({},i,g),m=p({},r,m);else if(t.errorsWhileComputingFlags)if(a){var y=new Set(Object.keys(a).filter((t=>{var e;return!(null!=(e=a[t])&&e.failed)})));f=p({},e,Object.fromEntries(Object.entries(f).filter((t=>y.has(t[0]))))),g=p({},i,Object.fromEntries(Object.entries(g||{}).filter((t=>y.has(t[0]))))),m=p({},r,Object.fromEntries(Object.entries(m||{}).filter((t=>y.has(t[0])))))}else f=p({},e,f),g=p({},i,g),m=p({},r,m);return p({[Wn]:Object.keys(Ck(f)),[zn]:f||{},[Zn]:g||{},[Gn]:m||{},[Jn]:!0===t.minimalFlagCalledEvents},h?{[Qn]:h}:{},d?{[ds]:d}:{})}}(t,this.getFlagVariants(),this.getFlagPayloads(),this.getFlagsWithDetails(),i,this.I);r&&this.Dr(r),e||(this.fh=!1),this.Lh(e)}}override(t,e){void 0===e&&(e=!1),this.I.warn("override is deprecated. Please use overrideFeatureFlags instead."),this.overrideFeatureFlags({flags:t,suppressWarning:e})}overrideFeatureFlags(t){this.Oh(t)}Oh(t){if(this.ns){if(!1===t)return this.qr([Kn,Yn]),this.Lh(),void wk.info("All overrides cleared");if(rt(t))return this.Dr({[Kn]:xk(t)}),this.Lh(),void wk.info("Flag overrides set",{flags:t});if(t&&"object"==typeof t&&("flags"in t||"payloads"in t)){var e,i=t;this.ih=Boolean(null!==(e=i.suppressWarning)&&void 0!==e&&e);var r={},n=i.flags,s=i.payloads;return n&&(r[Kn]=rt(n)?xk(n):n),s&&(r[Yn]=s),Object.keys(r).length&&this.Dr(r),!1===n&&!1===s?this.qr([Kn,Yn]):!1===n?this.qr(Kn):!1===s&&this.qr(Yn),this.Lh(),!1===n?wk.info("Flag overrides cleared"):n&&wk.info("Flag overrides set",{flags:n}),void(!1===s?wk.info("Payload overrides cleared"):s&&wk.info("Payload overrides set",{payloads:s}))}if(t&&"object"==typeof t)return this.Dr({[Kn]:t}),this.Lh(),void wk.info("Flag overrides set",{flags:t});this.I.warn("Invalid overrideOptions provided to overrideFeatureFlags",{overrideOptions:t})}else this.I.warn("posthog.featureFlags.overrideFeatureFlags called before feature flags were ready")}onFeatureFlags(t){if(this.addFeatureFlagsHandler(t),this.ah){var e=this.Dh(),i=e.flags,r=e.flagVariants;try{t(i,r)}catch(t){this.I.error("Error while running feature flags callback",t)}}return()=>this.removeFeatureFlagsHandler(t)}updateEarlyAccessFeatureEnrollment(t,e,i){var r=(this.Sh(Vn)||[]).find((e=>e.flagKey===t)),n={["$feature_enrollment/"+t]:e},s={$feature_flag:t,$feature_enrollment:e,$set:n};r&&(s.$early_access_feature_name=r.name),i&&(s.$feature_enrollment_stage=i);var o=p({},this.getFlagVariants(),{[t]:e});this.Dr({[Wn]:Object.keys(Ck(o)),[zn]:o,[Xn]:p({},this.Sh(Xn)||{},n)}),this.Lh();try{var a;null==(a=this.ns)||a.capture("$feature_enrollment_update",s).catch((t=>{this.I.error("Failed to capture early access feature enrollment",t)}))}catch(t){this.I.error("Failed to capture early access feature enrollment",t)}}getEarlyAccessFeatures(t,e,i){void 0===e&&(e=!1);var r=this.Sh(Vn);!r||e?this.$h(t,i):t(r)}$h(t,e){var i=this;return f((function*(){var r=i.ns;if(r){var n,s=e?"&"+e.map((t=>"stage="+t)).join("&"):"";try{var o=yield r.sendRequest("/api/early_access_features/?token="+r.projectToken+s,{target:"api",method:"GET",sentAt:"query"});if(!o.json)return;i.Dr({[Vn]:n=o.json.earlyAccessFeatures})}catch(t){return void i.I.error("Early access feature request failed",t)}try{t(n)}catch(t){i.I.error("Early access feature callback failed",t)}}}))()}Dh(){var t=this.getFlags(),e=this.getFlagVariants();return{flags:t.filter((t=>e[t])),flagVariants:Object.keys(e).filter((t=>e[t])).reduce(((t,i)=>(t[i]=e[i],t)),{})}}Lh(t){this.wh();var e=this.Dh(),i=e.flags,r=e.flagVariants;this.featureFlagEventHandlers.forEach((e=>{try{e(i,r,{errorsLoading:t})}catch(t){this.I.error("Error while running feature flags callback",t)}}))}setPersonPropertiesForFlags(t,e){void 0===e&&(e=!0),this.Nh(t,e)}Nh(t,e){void 0===e&&(e=!0);var i=this.Sh(Xn)||{},r=(null==t?void 0:t.$set)||(null!=t&&t.$set_once?{}:t),n=null==t?void 0:t.$set_once,s={};if(n)for(var o in n)({}).hasOwnProperty.call(n,o)&&(o in i||(s[o]=n[o]));this.Dr({[Xn]:p({},i,s,r)}),e&&this.reloadFeatureFlags()}unsetPersonPropertiesForFlags(t,e){void 0===e&&(e=!0);var i=p({},this.Sh(Xn)||{});t.forEach((t=>{delete i[t]})),this.Dr({[Xn]:i}),e&&this.reloadFeatureFlags()}resetPersonPropertiesForFlags(t){void 0===t&&(t=!0),this.qr(Xn),t&&this.reloadFeatureFlags()}setGroupPropertiesForFlags(t,e){void 0===e&&(e=!0);var i=this.Sh(ts)||{},r=p({},i);for(var n of Object.keys(t))r[n]=p({},i[n],t[n]);this.Dr({[ts]:r}),e&&this.reloadFeatureFlags()}resetGroupPropertiesForFlags(t){if(t){var e=this.Sh(ts)||{};this.Dr({[ts]:p({},e,{[t]:{}})})}else this.qr(ts)}reset(){this.lh++,this.hh=!1,this.rh={},this.nh={},this.ah=!1,this.uh=!1,this.dh=!1,this.$anon_distinct_id=void 0,this.kh(),this.ih=!1,this.ph=0}}},$k={sessionRecording:class{get qi(){return this._instance.config}get za(){return this._instance.persistence}get started(){var t;return!(null==(t=this.qh)||!t.isStarted)}get status(){var t,e;return this.jh===Js||this.jh===Ks?this.jh:null!==(t=null==(e=this.qh)?void 0:e.status)&&void 0!==t?t:this.jh}constructor(e){if(this._forceAllowLocalhostNetworkCapture=!1,this.jh=zs,this.Bh=void 0,this.Hh=!1,this.kt=(()=>{var e;if(null==r||!r.visibilityState||"visible"===r.visibilityState)return!0;var i=null==t||null==(e=t.performance)||null==e.getEntriesByType?void 0:e.getEntriesByType("visibility-state");return!(null!=i&&i.length)||i.some((t=>"visible"===t.name))})(),this.It=()=>{var t;"visible"===(null==r?void 0:r.visibilityState)&&(this.kt=!0,null==(t=this.qh)||null==t.setDocumentWasEverVisible||t.setDocumentWasEverVisible(!0))},this._instance=e,!this._instance.sessionManager)throw Kw.error("started without valid sessionManager"),new Error(Jw+" started without valid sessionManager. This is a bug.");if(this.qi.cookieless_mode===Fs)throw new Error(Jw+' cannot be used with cookieless_mode="always"');null!=r&&r.addEventListener&&Ki(r,"visibilitychange",this.It)}initialize(){this.startIfEnabledOrStop()}dispose(){this.Hh=!0,null==r||null==r.removeEventListener||r.removeEventListener("visibilitychange",this.It),this.stopRecording()}get Uh(){var e,i=!(null==(e=this._instance.get_property(Mn))||!e.enabled),r=!this.qi.disable_session_recording,n=this.qi.disable_session_recording||this._instance.consent.isOptedOut();return t&&i&&r&&!n}startIfEnabledOrStop(t){var e;if(!(this.Hh||this.Uh&&null!=(e=this.qh)&&e.isStarted)){var i=!at(Object.assign)&&!at(Array.from);this.Uh&&i?(this.zh(t),Kw.info("starting")):(this.jh=zs,this.stopRecording())}}zh(t){var e,i,r;this.Uh&&(this.jh!==Js&&this.jh!==Ks&&(this.jh=Qs),null!=v&&null!=(e=v.__PosthogExtensions__)&&null!=(e=e.rrweb)&&e.record&&null!=(i=v.__PosthogExtensions__)&&i.initSessionRecording?this.Wh(t):null==(r=v.__PosthogExtensions__)||null==r.loadExternalDependency||r.loadExternalDependency(this._instance,this.Vh,(e=>{if(e)return this._instance.register_for_session({[Ss]:!0}),Kw.error("could not load recorder",e);this.Wh(t)})))}stopRecording(){var t,e;null==(t=this.Bh)||t.call(this),this.Bh=void 0,null==(e=this.qh)||e.stop()}Gh(){var t,e;null==(t=this.Bh)||t.call(this),this.Bh=void 0,null==(e=this.qh)||e.discard()}Zh(){var t,e;null==(t=this.za)||t.unregister(Ln),null==(e=this.za)||e.unregister(In)}Qh(t,e){if(dt(t))return null;var i,r=vt(t)?t:parseFloat(t);return"number"!=typeof(i=r)||!Number.isFinite(i)||0>i||i>1?(Kw.warn(e+" must be between 0 and 1. Ignoring invalid value:",t),null):r}Jh(t){if(this.za){var e,i,r=this.za,n=()=>{var e,i=!1===t.sessionRecording?void 0:t.sessionRecording,n=this.Qh(null==(e=this.qi.session_recording)?void 0:e.sampleRate,"session_recording.sampleRate"),s=this.Qh(null==i?void 0:i.sampleRate,"remote config sampleRate"),o=null!=n?n:s;dt(o)&&this.Zh();var a=null==i?void 0:i.minimumDurationMilliseconds;r.register({[Mn]:p({cache_timestamp:Date.now(),enabled:!!i},i,{networkPayloadCapture:p({capturePerformance:t.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:at(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})})};n(),null==(e=this.Bh)||e.call(this),this.Bh=null==(i=this._instance.sessionManager)?void 0:i.onSessionId(n)}}onRemoteConfig(t){var e=t.ok?t.config:void 0;return e&&"sessionRecording"in e?!1===e.sessionRecording?(this.Jh(e),void this.Gh()):(this.Jh(e),void this.startIfEnabledOrStop()):(this.jh===Js&&(this.jh=Ks,Kw.warn("config refresh failed, recording will not start until page reload")),void this.startIfEnabledOrStop())}log(t,e){var i;void 0===e&&(e="log"),null!=(i=this.qh)&&i.log?this.qh.log(t,e):Kw.warn("log called before recorder was ready")}get Vh(){var t,e,i=null==(t=this._instance)||null==(t=t.persistence)?void 0:t.get_property(Mn);return(null==i||null==(e=i.scriptConfig)?void 0:e.script)||"lazy-recorder"}Kh(){var t,e=this._instance.get_property(Mn);if(!e)return!1;try{t="object"==typeof e?e:JSON.parse(e)}catch(t){return Kw.warn("persisted remote config for session recording is invalid and will be ignored",t),!1}return!dt(t.cache_timestamp)&&Date.now()-t.cache_timestamp<=Ya}Wh(t){var e,i,r;if(!this.Hh){if(null==(e=v.__PosthogExtensions__)||!e.initSessionRecording)return Kw.warn("Called on script loaded before session recording is available. This can be caused by adblockers."),void this._instance.register_for_session({[Ss]:!0});var n;if(this.qh||(this.qh=null==(n=v.__PosthogExtensions__)?void 0:n.initSessionRecording(this._instance,this.kt),this.qh._forceAllowLocalhostNetworkCapture=this._forceAllowLocalhostNetworkCapture),!this.Kh()){if(this.jh===Ks||this.jh===Js)return;return this.jh=Js,Kw.info("persisted remote config is stale, requesting fresh config before starting"),void new qb(this._instance).load()}this.jh=Qs,null==(i=(r=this.qh).setDocumentWasEverVisible)||i.call(r,this.kt),this.qh.start(t)}}onRRwebEmit(t){var e;null==(e=this.qh)||null==e.onRRwebEmit||e.onRRwebEmit(t)}overrideLinkedFlag(){var t,e;this.qh||null==(e=this.za)||e.register({[Pn]:!0}),null==(t=this.qh)||t.overrideLinkedFlag()}overrideSampling(){var t,e;this.qh||null==(e=this.za)||e.register({[Rn]:!0}),null==(t=this.qh)||t.overrideSampling()}overrideTrigger(t){var e,i;this.qh||null==(i=this.za)||i.register({["url"===t?An:On]:!0}),null==(e=this.qh)||e.overrideTrigger(t)}get sdkDebugProperties(){var t;return(null==(t=this.qh)?void 0:t.sdkDebugProperties)||{$recording_status:this.status}}tryAddCustomEvent(t,e){var i;return!(null==(i=this.qh)||!i.tryAddCustomEvent(t,e))}}},Dk={autocapture:class extends J_{constructor(t){super(new Uw(t)),this.instance=t}},historyAutocapture:class{constructor(t){this._instance=t,this.Yh=this.Xh()}initialize(){this.startIfEnabled()}get isEnabled(){var t=this.td();return!!(t.path||t.search||this.ed(t))}startIfEnabled(){this.isEnabled&&(ji.info("History API monitoring enabled, starting..."),this.monitorHistoryChanges())}startIfEnabledOrStop(){this.stop(),this.Yh=this.Xh(),this.startIfEnabled()}stop(){this.rd&&this.rd(),this.rd=void 0,this.nd&&this.nd(),this.nd=void 0,ji.info("History API monitoring stopped")}monitorHistoryChanges(){t&&t.history&&(this.sd("pushState"),this.sd("replaceState"),this.ad(),this.ed()&&this.od())}sd(e){var i;if(t&&(null==(i=t.history[e])||!i.__posthog_wrapped__)){var r=this;cv(t.history,e,(t=>function(i,n,s){t.call(this,i,n,s),r.ld(e)}))}}Xh(){var e=null==t?void 0:t.location;if(null!=e&&e.pathname)return{pathname:e.pathname,search:e.search,hash:e.hash}}td(){var t=this._instance.config.capture_pageview;return"history_change"===t?{path:!0}:st(t)?t:{}}ed(t){return void 0===t&&(t=this.td()),!!t.hash&&!this._instance.config.disable_capture_url_hashes}ud(t){var e=this.td(),i=this.Yh;return!(!i||!(e.path&&t.pathname!==i.pathname||e.search&&t.search!==i.search||this.ed(e)&&t.hash!==i.hash))}ld(t){try{var e=this.Xh();if(!e)return;this.ud(e)&&this._instance.capture(js,{navigation_type:t}),this.Yh=e}catch(e){ji.error("Error capturing "+t+" pageview",e)}}ad(){if(!this.rd){var e=()=>{this.ld("popstate")};Ki(t,"popstate",e),this.rd=()=>{t&&t.removeEventListener("popstate",e)}}}od(){if(!this.nd){var e=()=>{this.ld("hashchange")};Ki(t,"hashchange",e),this.nd=()=>{t&&t.removeEventListener("hashchange",e)}}}},heatmaps:class{get qi(){return this.instance.config}constructor(t){var e;this.hd=!1,this.Qn=!1,this.dd=null,this.instance=t,this.hd=!(null==(e=this.instance.persistence)||!e.props[bn]),this.rageclicks=new z_(t.config.rageclick)}initialize(){this.startIfEnabled()}get flushIntervalMilliseconds(){var t=5e3;return st(this.qi.capture_heatmaps)&&this.qi.capture_heatmaps.flush_interval_milliseconds&&(t=this.qi.capture_heatmaps.flush_interval_milliseconds),t}get isEnabled(){return dt(this.qi.capture_heatmaps)?dt(this.qi.enable_heatmaps)?this.hd:this.qi.enable_heatmaps:!1!==this.qi.capture_heatmaps}startIfEnabled(){if(this.isEnabled){if(this.Qn)return;Yw.info("starting..."),this.vd(),this.It()}else{var t;clearInterval(null!==(t=this.dd)&&void 0!==t?t:void 0),this.fd(),this.getAndClearBuffer()}}onRemoteConfig(t){if(t.ok){var e=t.config;if("heatmaps"in e){var i=!!e.heatmaps;this.instance.persistence&&this.instance.persistence.register({[bn]:i}),this.hd=i,this.startIfEnabled()}}}getAndClearBuffer(){var t=this.ft;return this.ft=void 0,t}pd(t){Xw(t.originalEvent)&&this.ki(t.originalEvent,"deadclick")}It(){this.dd&&clearInterval(this.dd),this.dd="visible"===(null==r?void 0:r.visibilityState)?setInterval(this.La.bind(this),this.flushIntervalMilliseconds):null}vd(){t&&r&&(this.gd=this.La.bind(this),Ki(t,qs,this.gd),this.md=e=>this.ki(e||(null==t?void 0:t.event)),Ki(r,"click",this.md,{capture:!0}),this.yd=e=>this.bd(e||(null==t?void 0:t.event)),Ki(r,"mousemove",this.yd,{capture:!0}),this._d=new mb(this.instance,pb,this.pd.bind(this)),this._d.startIfEnabledOrStop(),this.wd=this.It.bind(this),Ki(r,Ns,this.wd),this.Qn=!0)}fd(){var e;t&&r&&(this.gd&&t.removeEventListener(qs,this.gd),this.md&&r.removeEventListener("click",this.md,{capture:!0}),this.yd&&r.removeEventListener("mousemove",this.yd,{capture:!0}),this.wd&&r.removeEventListener(Ns,this.wd),clearTimeout(this.kd),null==(e=this._d)||e.stop(),this.Qn=!1)}Sd(e,i){var r=this.instance.scrollManager.scrollY(),n=this.instance.scrollManager.scrollX(),s=this.instance.scrollManager.scrollElement(),o=function(e,i,r){for(var n=e;n&&pr(n)&&!gr(n,"body");){if(n===r)return!1;var s=void 0;try{var o,a,l;s=null==(o=null!==(a=null==(l=n.ownerDocument)?void 0:l.defaultView)&&void 0!==a?a:t)?void 0:o.getComputedStyle(n).position}catch(t){return!1}if(J(i,s))return!0;n=Mr(n)}return!1}(Cr(e),["fixed","sticky"],s);return{x:e.clientX+(o?0:n),y:e.clientY+(o?0:r),target_fixed:o,type:i}}ki(t,e){var i;if(void 0===e&&(e="click"),!fr(t.target)&&Xw(t)){var r=this.Sd(t,e);null!=(i=this.rageclicks)&&i.isRageClick(t.clientX,t.clientY,(new Date).getTime())&&$r(Cr(t),this.instance.config.rageclick)&&this.Nn(p({},r,{type:"rageclick"})),this.Nn(r)}}bd(t){!fr(t.target)&&Xw(t)&&(clearTimeout(this.kd),this.kd=setTimeout((()=>{this.Nn(this.Sd(t,"mousemove"))}),500))}Nn(e){if(t){var i=this.qi.disable_capture_url_hashes?Le(t.location.href):t.location.href,r=this.qi.custom_personal_data_properties,n=this.qi.mask_personal_data_properties?[...Fa,...r||[]]:[],s=nr(i,n,$a);this.ft=this.ft||{},this.ft[s]||(this.ft[s]=[]),this.ft[s].push(e)}}La(){this.ft&&!ot(this.ft)&&this.instance.capture("$$heatmap",{$heatmap_data:this.getAndClearBuffer()})}},deadClicksAutocapture:mb,webVitalsAutocapture:class{constructor(t){var e;this.hd=!1,this.Qn=!1,this.ft={navigationKey:void 0,url:void 0,metrics:[],firstMetricTimestamp:void 0},this.xd=()=>{clearTimeout(this.Cd),this.Cd=void 0,0!==this.ft.metrics.length&&(this._instance.capture("$web_vitals",p({$current_url:this.ft.url},this.ft.metrics.reduce(((t,e)=>p({},t,{["$web_vitals_"+e.name+"_event"]:p({},e),["$web_vitals_"+e.name+"_value"]:e.value})),{}))),this.ft={navigationKey:void 0,url:void 0,metrics:[],firstMetricTimestamp:void 0})},this.Td=t=>{var e;if(this.ft=this.ft||{navigationKey:void 0,url:void 0,metrics:[],firstMetricTimestamp:void 0},dt(null==t?void 0:t.name)||dt(null==t?void 0:t.value))Ww.error("Invalid metric received",t);else{var i="string"==typeof t.navigationURL?t.navigationURL:void 0,r=this.Md(i);if(!at(r)){var n=vt(t.navigationId)||"string"==typeof t.navigationId?"navigation:"+t.navigationId:"url:"+r;if(!this.Ed||this.Ed>t.value){this.ft.navigationKey!==n&&(this.xd(),this.Cd=setTimeout(this.xd,this.flushToCaptureTimeoutMs)),at(this.ft.navigationKey)&&(this.ft.navigationKey=n,this.ft.url=r),this.ft.firstMetricTimestamp=at(this.ft.firstMetricTimestamp)?Date.now():this.ft.firstMetricTimestamp;var s=null==(e=this._instance.sessionManager)?void 0:e.checkAndGetSessionAndWindowId(!0),o=p({},t,i?{navigationURL:r}:{},{$current_url:r,timestamp:Date.now()});if(delete o.entries,st(t.attribution)&&this.attributionMetrics.indexOf(t.name)>-1){var a={};for(var l of Qw){var u="url"===l&&"string"==typeof t.attribution[l]?this.Md(t.attribution[l]):t.attribution[l];at(u)||(a[l]=u)}o.attribution=a}else delete o.attribution;at(s)||(o.$session_id=s.sessionId,o.$window_id=s.windowId),this.ft.metrics.push(o),this.ft.metrics.length===this.allowedMetrics.length&&this.xd()}else Ww.error("Ignoring metric with value >= "+this.Ed,t)}}},this.Id=()=>{if(!this.Qn){var t,e,i,r,n=!1,s=v.__PosthogExtensions__,o=null==s?void 0:s.postHogWebVitalsCallbacksByFlavor,a=(null==o?void 0:o[this.Rd])||("web-vitals"===this.Rd&&at(o)?null==s?void 0:s.postHogWebVitalsCallbacks:void 0);if(!at(a)){var l=a.withoutAttribution,u=this.attributionMetrics;n=!at(l),t=u.indexOf("LCP")>-1?a.onLCP:(null==l?void 0:l.onLCP)||a.onLCP,e=u.indexOf("CLS")>-1?a.onCLS:(null==l?void 0:l.onCLS)||a.onCLS,i=u.indexOf("FCP")>-1?a.onFCP:(null==l?void 0:l.onFCP)||a.onFCP,r=u.indexOf("INP")>-1?a.onINP:(null==l?void 0:l.onINP)||a.onINP}if(t&&e&&i&&r){var h={reportSoftNavs:this.useSoftNavs},d=n&&this.attributionMetrics.indexOf("INP")>-1?p({},h,{includeProcessedEventEntries:!1}):h;this.allowedMetrics.indexOf("LCP")>-1&&t(this.Td.bind(this),h),this.allowedMetrics.indexOf("CLS")>-1&&e(this.Td.bind(this),h),this.allowedMetrics.indexOf("FCP")>-1&&i(this.Td.bind(this),h),this.allowedMetrics.indexOf("INP")>-1&&r(this.Td.bind(this),d),this.Qn=!0}else Ww.error("web vitals callbacks not loaded - not starting")}},this._instance=t,this.hd=!(null==(e=this._instance.persistence)||!e.props[xn]),this.startIfEnabled()}get Pd(){return this._instance.config.capture_performance}get allowedMetrics(){var t,e,i=st(this.Pd)?null==(t=this.Pd)?void 0:t.web_vitals_allowed_metrics:void 0;return dt(i)?(null==(e=this._instance.persistence)?void 0:e.props[En])||Gw:i}get flushToCaptureTimeoutMs(){return(st(this.Pd)?this.Pd.web_vitals_delayed_flush_ms:void 0)||5e3}get attributionMetrics(){var t=st(this.Pd)?this.Pd.web_vitals_attribution:void 0;return ft(t)?t?Gw:[]:rt(t)?t:Zw}get useAttribution(){return this.attributionMetrics.length>0}get useSoftNavs(){var t=st(this.Pd)?this.Pd.__preview_web_vitals_soft_navs:void 0;return null!=t&&t}get Ed(){var t=st(this.Pd)&&vt(this.Pd.__web_vitals_max_value)?this.Pd.__web_vitals_max_value:Vw;return t>0&&6e4>=t?Vw:t}get isEnabled(){var t=null==n?void 0:n.protocol;if("http:"!==t&&"https:"!==t)return Ww.info("Web Vitals are disabled on non-http/https protocols"),!1;var e=st(this.Pd)?this.Pd.web_vitals:ft(this.Pd)?this.Pd:void 0;return ft(e)?e:this.hd}startIfEnabled(){this.isEnabled&&!this.Qn&&(Ww.info("enabled, starting..."),this._s(this.Id))}onRemoteConfig(t){if(t.ok){var e=t.config;if("capturePerformance"in e){var i=st(e.capturePerformance)&&!!e.capturePerformance.web_vitals,r=st(e.capturePerformance)?e.capturePerformance.web_vitals_allowed_metrics:void 0;this._instance.persistence&&(this._instance.persistence.register({[xn]:i}),this._instance.persistence.register({[En]:r})),this.hd=i,this.startIfEnabled()}}}get Rd(){return this.useSoftNavs?this.useAttribution?"web-vitals-with-attribution-soft-navs":"web-vitals-soft-navs":this.useAttribution?"web-vitals-with-attribution":"web-vitals"}_s(t){var e=v.__PosthogExtensions__,i=this.Rd,r=null==e?void 0:e.postHogWebVitalsCallbacksByFlavor;null!=r&&r[i]||"web-vitals"===i&&at(r)&&null!=e&&e.postHogWebVitalsCallbacks?t():null==e||null==e.loadExternalDependency||e.loadExternalDependency(this._instance,i,(e=>{e?Ww.error("failed to load script",e):t()}))}Md(e){var i=e||(null==t?void 0:t.location.href);if(i){var r=this._instance.config.disable_capture_url_hashes?Le(i):i,n=this._instance.config.custom_personal_data_properties,s=this._instance.config.mask_personal_data_properties?[...Fa,...n||[]]:[];return nr(r,s,$a)}Ww.error("Could not determine current URL")}}},Nk={exceptionObserver:class{constructor(e){var i;this.Id=()=>{var e;if(t&&this.isEnabled&&null!=(e=v.__PosthogExtensions__)&&e.errorWrappingFunctions){var i=v.__PosthogExtensions__.errorWrappingFunctions.wrapOnError,r=v.__PosthogExtensions__.errorWrappingFunctions.wrapUnhandledRejection,n=v.__PosthogExtensions__.errorWrappingFunctions.wrapConsoleError;try{!this.Ad&&this.qi.capture_unhandled_errors&&(this.Ad=i(this.captureException.bind(this))),!this.Fd&&this.qi.capture_unhandled_rejections&&(this.Fd=r(this.captureException.bind(this))),!this.Ld&&this.qi.capture_console_errors&&(this.Ld=n(this.captureException.bind(this)))}catch(t){Hw.error("failed to start",t),this.Od()}}},this._instance=e,this.Dd=!(null==(i=this._instance.persistence)||!i.props[wn]),this.oe=new Et(p({},function(t){var e,i,r,n;return void 0===t&&(t={}),{refillRate:null!==(e=null!==(i=t.exceptionRateLimiterRefillRate)&&void 0!==i?i:t.__exceptionRateLimiterRefillRate)&&void 0!==e?e:1,bucketSize:null!==(r=null!==(n=t.exceptionRateLimiterBucketSize)&&void 0!==n?n:t.__exceptionRateLimiterBucketSize)&&void 0!==r?r:10}}(this._instance.config.error_tracking),{refillInterval:1e4,I:Hw})),this.qi=this.$d(),this.startIfEnabledOrStop()}$d(){var t=this._instance.config.capture_exceptions,e={capture_unhandled_errors:!1,capture_unhandled_rejections:!1,capture_console_errors:!1};return st(t)?e=p({},e,t):(at(t)?this.Dd:t)&&(e=p({},e,{capture_unhandled_errors:!0,capture_unhandled_rejections:!0})),e}get isEnabled(){return this.qi.capture_console_errors||this.qi.capture_unhandled_errors||this.qi.capture_unhandled_rejections}startIfEnabledOrStop(){this.isEnabled?(Hw.info("enabled"),this.Od(),this._s(this.Id)):this.Od()}_s(t){var e,i;null!=(e=v.__PosthogExtensions__)&&e.errorWrappingFunctions?t():null==(i=v.__PosthogExtensions__)||null==i.loadExternalDependency||i.loadExternalDependency(this._instance,"exception-autocapture",(e=>{if(e)return Hw.error("failed to load script",e);t()}))}Od(){var t,e,i;null==(t=this.Ad)||t.call(this),this.Ad=void 0,null==(e=this.Fd)||e.call(this),this.Fd=void 0,null==(i=this.Ld)||i.call(this),this.Ld=void 0}onRemoteConfig(t){if(t.ok){var e=t.config;"autocaptureExceptions"in e&&(this.Dd=!!e.autocaptureExceptions||!1,this._instance.persistence&&this._instance.persistence.register({[wn]:this.Dd}),this.qi=this.$d(),this.startIfEnabledOrStop())}}onConfigChange(){this.qi=this.$d()}captureException(t){var e,i,r,n=null!==(e=null==t||null==(i=t.$exception_list)||null==(i=i[0])?void 0:i.type)&&void 0!==e?e:"Exception";this.oe.consumeRateLimit(n)?Hw.info("Skipping exception capture because of client rate limiting.",{exception:n}):null==(r=this._instance.exceptions)||r.sendExceptionEvent(t)}},exceptions:class{constructor(t){var e,i;this.Nd=[],this.qd=Rg(),this._instance=t,this.Nd=null!==(e=null==(i=this._instance.persistence)?void 0:i.get_property(kn))&&void 0!==e?e:[],this.jd=Li(this.Bd()),this.Hd=new $i(this.jd)}onConfigChange(){this.jd=Li(this.Bd()),this.Hd.setConfig(this.jd)}onRemoteConfig(t){var e,i,r;if(t.ok){var n=t.config;if("errorTracking"in n){var s=null!==(e=null==(i=n.errorTracking)?void 0:i.suppressionRules)&&void 0!==e?e:[],o=null==(r=n.errorTracking)?void 0:r.captureExtensionExceptions;this.Nd=s,this._instance.persistence&&this._instance.persistence.register({[kn]:this.Nd,[Sn]:o})}}}get Ud(){var t,e=!!this._instance.get_property(Sn),i=this._instance.config.error_tracking.captureExtensionExceptions;return null!==(t=null!=i?i:e)&&void 0!==t&&t}buildProperties(t,e){return this.qd.buildFromUnknown(t,{syntheticException:null==e?void 0:e.syntheticException,mechanism:{handled:null==e?void 0:e.handled}})}addExceptionStep(t,e){if(this.jd.enabled)try{if(!lt(t)||0===t.trim().length)return void Eg.warn("Ignoring exception step because message must be a non-empty string");var i=function(t){if(!t)return{sanitizedProperties:{},droppedKeys:[]};var e=[];return{sanitizedProperties:Object.keys(t).reduce(((i,r)=>Oi.has(r)?(e.push(r),i):(i[r]=t[r],i)),{}),droppedKeys:e}}(this.zd(e)),r=i.sanitizedProperties,n=i.droppedKeys;n.length>0&&Eg.warn("Ignoring reserved exception step fields",{droppedKeys:n}),this.Hd.add(p({[Pi]:t,[Ai]:(new Date).toISOString()},r))}catch(t){Eg.error("Failed to add exception step. Ignoring breadcrumb.",t)}}sendExceptionEvent(t){try{var e=t.$exception_list;if(this.Wd(e)){if(this.Vd(e))return this.Gd("Exception dropped: matched a suppression rule"),void Eg.info("Skipping exception capture because a suppression rule matched");if(!this.Ud&&this.Zd(e))return this.Gd("Exception dropped: thrown by a browser extension"),void Eg.info("Skipping exception capture because it was thrown by an extension");if(!this.Ud&&this.Qd(e))return this.Gd("Exception dropped: thrown by an injected browser script"),void Eg.info("Skipping exception capture because it was thrown by an injected browser script");if(!this._instance.config.error_tracking.__capturePostHogExceptions&&this.Jd(e))return this.Gd("Exception dropped: thrown by the PostHog SDK"),void Eg.info("Skipping exception capture because it was thrown by the PostHog SDK")}var i=this.jd.enabled&&dt(t.$exception_steps)?this.Kd(t):t,r="string"==typeof(s=globalThis._posthogReleaseId)&&s.length>0?s:void 0;r&&(i.$release_id=r);try{var n=this._instance.capture("$exception",i,{_noTruncate:!0,_batchKey:"exceptionEvent",fl:!0});return n&&this.Hd.clear(),n}catch(t){return Eg.error("Failed to capture exception event. Dropping this exception.",t),void this.Hd.clear()}}catch(t){return void Eg.error("Failed to process exception event. Ignoring this exception.",t)}var s}Kd(t){try{var e=this.Hd.getAttachable();return 0===e.length?t:p({},t,{$exception_steps:e})}catch(e){return Eg.error("Failed to read buffered exception steps. Capturing exception without steps.",e),t}}Gd(t){this.jd.enabled&&this.Hd.add({[Pi]:t,[Ai]:(new Date).toISOString()})}zd(t){return st(t)?p({},t):{}}Bd(){var t,e;return null!==(t=null==(e=this._instance.config.error_tracking)?void 0:e.exception_steps)&&void 0!==t?t:{}}Vd(t){if(0===t.length)return!1;try{var e=t.reduce(((t,e)=>{var i=e.type,r=e.value;return lt(i)&&i.length>0&&t.$exception_types.push(i),lt(r)&&r.length>0&&t.$exception_values.push(r),t}),{$exception_types:[],$exception_values:[]});return this.Nd.some((t=>{var i=t.values.map((t=>{var i=ka[t.operator],r=e[t.key];if(!i||!r)return!1;var n=rt(t.value)?t.value:[t.value];return n.length>0&&i(n,r)}));return"OR"===t.type?i.some(Boolean):i.every(Boolean)}))}catch(t){return Eg.warn("Failed to evaluate suppression rules. Capturing the exception.",t),!1}}Zd(t){var e=t.flatMap((t=>{var e,i;return null!==(e=null==(i=t.stacktrace)?void 0:i.frames)&&void 0!==e?e:[]}));return e.some((t=>{var e=t.filename;return!!e&&Mg.some((t=>e.startsWith(t)))}))}Qd(t){return t.some((t=>{var e=t.value;return lt(e)&&Ig.some((t=>e.includes(t)))}))}Jd(t){if(t.length>0){var e,i,r,n,s=null!==(e=null==(i=t[0].stacktrace)?void 0:i.frames)&&void 0!==e?e:[],o=s[s.length-1];return null!==(r=null==o||null==(n=o.filename)?void 0:n.includes("posthog.com/static"))&&void 0!==r&&r}return!1}Wd(t){return!dt(t)&&rt(t)}}},qk=p({productTours:class{get za(){return this._instance.persistence}constructor(t){this.Yd=null,this.Xd=null,this._instance=t}initialize(){this.loadIfEnabled()}onRemoteConfig(t){if(t.ok){var e=t.config;if("productTours"in e){var i,r;if(this.za&&this.za.register({[Tn]:!!e.productTours}),!ek(this._instance))return!this.Yd&&dt(null==(i=this.za)?void 0:i.props[as])||tk.info("product tours disabled; stopping and clearing cached tours"),null==(r=this.Yd)||r.stop(),this.Yd=null,void this.clearCache();this.loadIfEnabled()}}}loadIfEnabled(){!this.Yd&&ek(this._instance)&&this._s((()=>this.tv()))}_s(t){var e,i;null!=(e=v.__PosthogExtensions__)&&e.generateProductTours?t():null==(i=v.__PosthogExtensions__)||null==i.loadExternalDependency||i.loadExternalDependency(this._instance,"product-tours",(e=>{e?tk.error("Could not load product tours script",e):t()}))}tv(){var t;!this.Yd&&null!=(t=v.__PosthogExtensions__)&&t.generateProductTours&&(this.Yd=v.__PosthogExtensions__.generateProductTours(this._instance,!0))}getProductTours(t,e){if(void 0===e&&(e=!1),!rt(this.Xd)||e){var i=this.za;if(i){var r=i.props[as];if(rt(r)&&!e)return this.Xd=r,void t(r,{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:e=>{if(ek(this._instance)){var r=e.statusCode;if(200!==r||!e.json){var n="Product Tours API could not be loaded, status: "+r;return 0===r?e.error||tk.warn(n):tk.error(n),void t([],{isLoaded:!1,error:n})}var s=rt(e.json.product_tours)?e.json.product_tours:[];this.Xd=s,i&&i.register({[as]:s}),t(s,{isLoaded:!0})}else t([],{isLoaded:!0})}})}else t(this.Xd,{isLoaded:!0})}getActiveProductTours(t){dt(this.Yd)?t([],{isLoaded:!1,error:"Product tours not loaded"}):this.Yd.getActiveProductTours(t)}showProductTour(t){var e;null==(e=this.Yd)||e.showTourById(t)}previewTour(t){this.Yd?this.Yd.previewTour(t):this._s((()=>{var e;this.tv(),null==(e=this.Yd)||e.previewTour(t)}))}dismissProductTour(){var t;null==(t=this.Yd)||t.dismissTour("user_clicked_skip")}nextStep(){var t;null==(t=this.Yd)||t.nextStep()}previousStep(){var t;null==(t=this.Yd)||t.previousStep()}clearCache(){var t;this.Xd=null,null==(t=this.za)||t.unregister(as)}resetTour(t){var e;null==(e=this.Yd)||e.resetTour(t)}resetAllTours(){var t;null==(t=this.Yd)||t.resetAllTours()}cancelPendingTour(t){var e;null==(e=this.Yd)||e.cancelPendingTour(t)}}},Lk),jk={siteApps:class{constructor(t){this.ev=0,this._instance=t,this.iv=[],this.apps={}}get isEnabled(){return!!this._instance.config.opt_in_site_apps}rv(t,e){if(e){var i=this.globalsForEvent(e);this.iv.push(i),this.iv.length>1e3&&(this.iv=this.iv.slice(10))}}get siteAppLoaders(){var t;return null==(t=v._POSTHOG_REMOTE_CONFIG)||null==(t=t[this._instance.config.token])?void 0:t.siteApps}initialize(){if(this.isEnabled){var t=this._instance._addCaptureHook(this.rv.bind(this));this.nv=()=>{t(),this.iv=[],this.nv=void 0}}}globalsForEvent(t){var e,i,r,n,s,o,a;if(!t)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 d of Object.entries(h)){var v=d[0];l[v]={id:u[v],type:v,properties:d[1]}}var c=t.$set_once,f=t.$set;return{event:p({},g(t,ik),{properties:p({},t.properties,f?{$set:p({},null!==(e=null==(i=t.properties)?void 0:i.$set)&&void 0!==e?e:{},f)}:{},c?{$set_once:p({},null!==(r=null==(n=t.properties)?void 0:n.$set_once)&&void 0!==r?r:{},c)}:{}),elements_chain:null!==(s=null==(o=t.properties)?void 0:o.$elements_chain)&&void 0!==s?s:"",distinct_id:null==(a=t.properties)?void 0:a.distinct_id}),person:{properties:this._instance.get_property("$stored_person_properties")},groups:l}}sv(t){var e,i=null==(e=t.tagName)?void 0:e.toLowerCase();return"style"===i&&this._instance.config.prepare_external_dependency_stylesheet?this._instance.config.prepare_external_dependency_stylesheet(t)||(rk.error("prepare_external_dependency_stylesheet returned null"),null):"script"===i&&this._instance.config.prepare_external_dependency_script?this._instance.config.prepare_external_dependency_script(t)||(rk.error("prepare_external_dependency_script returned null"),null):t}av(){var t,e,i,n,s,o,a,l;if(!this._instance.config.prepare_external_dependency_stylesheet&&!this._instance.config.prepare_external_dependency_script)return()=>{};var u=null==r?void 0:r.defaultView,h=null==u||null==(t=u.Node)?void 0:t.prototype;if(!u||!h)return()=>{};if(this.ev++,this.ov)return this.lv();var d=[],v=this,c=new WeakSet,f=(t,e,i)=>{if(null!=t&&t[e]){var r=t[e];t[e]=i(r),d.push((()=>{t[e]=r}))}},p=t=>{if(c.has(t))return t;var e=v.sv(t);return e&&c.add(e),e},g=t=>t.map((t=>"string"==typeof t?t:p(t))).filter((t=>!ht(t)));return f(h,"appendChild",(t=>function(e){var i=p(e);return i?t.call(this,i):e})),f(h,"insertBefore",(t=>function(e,i){var r=p(e);return r?t.call(this,r,i):e})),f(h,"replaceChild",(t=>function(e,i){var r=p(e);return r?t.call(this,r,i):i})),[null==(e=u.Element)?void 0:e.prototype,null==(i=u.Document)?void 0:i.prototype,null==(n=u.DocumentFragment)?void 0:n.prototype].forEach((t=>{f(t,"append",(t=>function(){for(var e=arguments.length,i=new Array(e),r=0;e>r;r++)i[r]=arguments[r];return t.apply(this,g(i))})),f(t,"prepend",(t=>function(){for(var e=arguments.length,i=new Array(e),r=0;e>r;r++)i[r]=arguments[r];return t.apply(this,g(i))}))})),[null==(s=u.Element)?void 0:s.prototype,null==(o=u.CharacterData)?void 0:o.prototype,null==(a=u.DocumentType)?void 0:a.prototype].forEach((t=>{f(t,"before",(t=>function(){for(var e=arguments.length,i=new Array(e),r=0;e>r;r++)i[r]=arguments[r];return t.apply(this,g(i))})),f(t,"after",(t=>function(){for(var e=arguments.length,i=new Array(e),r=0;e>r;r++)i[r]=arguments[r];return t.apply(this,g(i))})),f(t,"replaceWith",(t=>function(){for(var e=arguments.length,i=new Array(e),r=0;e>r;r++)i[r]=arguments[r];var n=g(i);return i.length&&!n.length?void 0:t.apply(this,n)}))})),f(null==(l=u.Element)?void 0:l.prototype,"insertAdjacentElement",(t=>function(e,i){var r=p(i);return r?t.call(this,e,r):null})),this.ov=()=>{d.forEach((t=>t())),this.ov=void 0},this.lv()}lv(){var t=!1;return()=>{var e;t||(t=!0,this.ev--,0===this.ev&&(null==(e=this.ov)||e.call(this)))}}uv(t,e){void 0===e&&(e=!0);var i=this.av();try{var r=t(i);return e&&i(),r}catch(t){throw i(),t}}setupSiteApp(t){var e=this.apps[t.id],i=()=>{var i;!e.errored&&this.iv.length&&(rk.info("Processing "+this.iv.length+" events for site app with id "+t.id),this.iv.forEach((t=>this.uv((()=>null==e.processEvent?void 0:e.processEvent(t))))),e.processedBuffer=!0),Object.values(this.apps).every((t=>t.processedBuffer||t.errored))&&(null==(i=this.nv)||i.call(this))},r=!1,n=n=>{e.errored=!n,e.loaded=!0,rk.info("Site app with id "+t.id+" "+(n?"loaded":"errored")),r&&i()};try{var s=this.uv((e=>t.init({posthog:this._instance,callback(t){e(),n(t)}})),!1).processEvent;s&&(e.processEvent=s),r=!0}catch(e){rk.error(nk+t.id,e),n(!1)}if(r&&e.loaded)try{i()}catch(i){rk.error("Error while processing buffered events PostHog app with config id "+t.id,i),e.errored=!0}}hv(){var t=this.siteAppLoaders||[];for(var e of t)this.apps[e.id]={id:e.id,loaded:!1,errored:!1,processedBuffer:!1};for(var i of t)this.setupSiteApp(i)}dv(t){var e=this;if(0!==Object.keys(this.apps).length){var i=this.globalsForEvent(t),r=function(r){try{e.uv((()=>null==r.processEvent?void 0:r.processEvent(i)))}catch(e){rk.error("Error while processing event "+t.event+" for site app "+r.id,e)}};for(var n of Object.values(this.apps))r(n)}}onRemoteConfig(t){var e,i,r,n=this;if(null!=(e=this.siteAppLoaders)&&e.length)return this.isEnabled?(this.hv(),void this._instance.on("eventCaptured",(t=>this.dv(t)))):void rk.error('PostHog site apps are disabled. Enable the "opt_in_site_apps" config to proceed.');if(null==(i=this.nv)||i.call(this),t.ok){var s=t.config;if(null!=(r=s.siteApps)&&r.length)if(this.isEnabled){var o=function(){var t,e=a.id,i=a.url;v["__$$ph_site_app_"+e]=n._instance,null==(t=v.__PosthogExtensions__)||null==t.loadSiteApp||t.loadSiteApp(n._instance,i,(t=>{if(t)return rk.error(nk+e,t)}))};for(var a of s.siteApps)o()}else rk.error('PostHog site apps are disabled. Enable the "opt_in_site_apps" config to proceed.')}}}},Bk={tracingHeaders:class{constructor(t){this.vv=void 0,this.fv=void 0,this.pv=void 0,this.Id=()=>{var t,e,i=this.gv();i?(at(this.vv)&&(this.vv=null==(t=v.__PosthogExtensions__)||null==(t=t.tracingHeadersPatchFns)?void 0:t._patchXHR(i,(()=>this._instance.get_distinct_id()),this._instance.sessionManager)),at(this.fv)&&(this.fv=null==(e=v.__PosthogExtensions__)||null==(e=e.tracingHeadersPatchFns)?void 0:e._patchFetch(i,(()=>this._instance.get_distinct_id()),this._instance.sessionManager))):this.Od()},this._instance=t}initialize(){this.startIfEnabledOrStop()}_s(t){var e,i;null!=(e=v.__PosthogExtensions__)&&e.tracingHeadersPatchFns?t():null==(i=v.__PosthogExtensions__)||null==i.loadExternalDependency||i.loadExternalDependency(this._instance,"tracing-headers",(e=>{if(e)return zw.error("failed to load script",e);t()}))}mv(){var t,e;return null!==(t=null!==(e=this._instance.config.tracing_headers)&&void 0!==e?e:this._instance.config.addTracingHeaders)&&void 0!==t?t:this._instance.config.__add_tracing_headers}gv(){var t=this.mv();return rt(t)?(rt(this.pv)?this.pv.splice(0,this.pv.length,...t):this.pv=[...t],t.length>0?this.pv:void 0):(rt(this.pv)&&this.pv.splice(0),this.pv=t||void 0,this.pv)}Od(){var t,e;null==(t=this.vv)||t.call(this),null==(e=this.fv)||e.call(this),this.vv=void 0,this.fv=void 0}startIfEnabledOrStop(){this.gv()?this._s(this.Id):this.Od()}}},Uk=p({surveys:class extends lk{constructor(t){var e;super(new fk(t),{get projectToken(){return e.config.token},kv:new ck(e=t)}),this._instance=t}Nl(t,e){var i=e.query?Wb(t,e.query):t;return new Promise((t=>{var r;this._instance._send_request({method:e.method,url:this._instance.requestRouter.endpointFor(null!==(r=e.target)&&void 0!==r?r:"api",i),data:e.body,headers:e.headers,timeout:e.timeoutMs,fireCallbackOnDrop:!0,transport:e.transport,compression:e.compression,timestampMode:e.sentAt,callback:t})}))}}},Lk),Hk={toolbar:class{constructor(t){this.instance=t}yv(t){v.ph_toolbar_state=t}bv(){var t;return null!==(t=v.ph_toolbar_state)&&void 0!==t?t:0}initialize(){return this.maybeLoadToolbar()}maybeLoadToolbar(e,i,n){if(void 0===e&&(e=void 0),void 0===i&&(i=void 0),void 0===n&&(n=void 0),Yi(this.instance.config))return!1;if(!t||!r)return!1;e=null!=e?e:t.location,n=null!=n?n:t.history;try{if(!i){try{t.localStorage.setItem("test","test"),t.localStorage.removeItem("test")}catch(t){return!1}i=null==t?void 0:t.localStorage}var s,o=pk||sr(e.hash,"__posthog")||sr(e.hash,"state"),a=o?Vi((()=>JSON.parse(atob(decodeURIComponent(o)))))||Vi((()=>JSON.parse(decodeURIComponent(o)))):null;return a&&"ph_authorize"===a.action?((s=a).source="url",s&&Object.keys(s).length>0&&(a.desiredHash?e.hash=a.desiredHash:n?n.replaceState(n.state,"",e.pathname+e.search):e.hash="")):((s=JSON.parse(i.getItem(gk)||"{}")).source="localstorage",delete s.userIntent),!(!s.token||this.instance.config.token!==s.token||(this.loadToolbar(s),0))}catch(t){return!1}}_v(t){var e=v.ph_load_toolbar||v.ph_load_editor;!dt(e)&&nt(e)?e(t,this.instance):mk.warn("No toolbar load function found")}loadToolbar(e){var i=!(null==r||!r.getElementById(hr));if(!t||i)return!1;var n="custom"===this.instance.requestRouter.region&&this.instance.config.advanced_disable_toolbar_metrics,s=p({token:this.instance.config.token},e,{apiURL:this.instance.requestRouter.endpointFor("ui")},n?{instrument:!1}:{});if(t.localStorage.setItem(gk,JSON.stringify(p({},s,{source:void 0}))),2===this.bv())this._v(s);else if(0===this.bv()){var o;this.yv(1),null==(o=v.__PosthogExtensions__)||null==o.loadExternalDependency||o.loadExternalDependency(this.instance,"toolbar",(t=>{if(t)return mk.error("[Toolbar] Failed to load",t),void this.yv(0);this.yv(2),this._v(s)})),Ki(t,"turbolinks:load",(()=>{this.yv(0),this.loadToolbar(s)}))}return!0}wv(t){return this.loadToolbar(t)}maybeLoadEditor(t,e,i){return void 0===t&&(t=void 0),void 0===e&&(e=void 0),void 0===i&&(i=void 0),this.maybeLoadToolbar(t,e,i)}}},zk=p({experiments:Mk},Lk),Wk={conversations:class{constructor(t){this.Sv=void 0,this._conversationsManager=null,this.xv=!1,this.Me=null,this.Cv=!1,this._instance=t}initialize(){this.loadIfEnabled()}onRemoteConfig(t){if(!this._instance.config.disable_conversations&&(this.Tv=t.ok,t.ok)){var e=t.config.conversations;dt(e)||(ft(e)?this.Sv=e:(this.Sv=e.enabled,this.Me=e),this.loadIfEnabled())}}reset(){var t;null==(t=this._conversationsManager)||t.reset(),this._conversationsManager=null,this.Sv=void 0,this.Me=null,this.Tv=void 0,this.Cv=!1}loadIfEnabled(){if(!(this._conversationsManager||this.xv||this._instance.config.disable_conversations||Yi(this._instance.config)||this._instance.config.cookieless_mode&&this._instance.consent.isOptedOut())){var t=null==v?void 0:v.__PosthogExtensions__;if(t&&!at(this.Sv)&&this.Sv)if(this.Me&&this.Me.token){this.xv=!0;try{var e=t.initConversations;if(e)return this.Mv(e),void(this.xv=!1);var i=t.loadExternalDependency;if(!i)return void this.Ev(As);i(this._instance,"conversations",(e=>{e||!t.initConversations?this.Ev("Could not load conversations script",e):this.Mv(t.initConversations),this.xv=!1}))}catch(t){this.Ev("Error initializing conversations",t),this.xv=!1}}else Ik.error("Conversations enabled but missing token in remote config.")}}Mv(t){if(this.Me)try{this._conversationsManager=t(this.Me,this._instance),this.Cv=!1,Ik.info("Conversations loaded successfully")}catch(t){this.Ev("Error completing conversations initialization",t)}else Ik.error("Cannot complete initialization: remote config is null")}Ev(t,e){Ik.error(t,e),this._conversationsManager=null,this.xv=!1,this.Cv=!0}show(){this._conversationsManager?this._conversationsManager.show():Ik.warn("Conversations not loaded yet.")}hide(){this._conversationsManager&&this._conversationsManager.hide()}isAvailable(){return!0===this.Sv&&!ht(this._conversationsManager)}getUnavailableReason(){return this.isAvailable()?null:this._instance.config.disable_conversations?"disabled_by_config":Yi(this._instance.config)?"disabled_for_toolbar":this._instance.config.cookieless_mode&&this._instance.consent.isOptedOut()?"consent_opted_out":!1===this.Tv?"remote_config_failed":at(this.Sv)?this.Tv?"disabled_in_project":"remote_config_pending":this.Sv?dt(this.Me)||!this.Me.token?"missing_token":null!=v&&v.__PosthogExtensions__?this.xv?"initializing":this.Cv?"load_failed":"not_loaded":"extensions_unavailable":"disabled_in_project"}isVisible(){var t,e;return null!==(t=null==(e=this._conversationsManager)?void 0:e.isVisible())&&void 0!==t&&t}sendMessage(t,e,i){var r=this;return f((function*(){return r._conversationsManager?r._conversationsManager.sendMessage(t,e,i):(Ik.warn(Rk),null)}))()}getMessages(t,e){var i=this;return f((function*(){return i._conversationsManager?i._conversationsManager.getMessages(t,e):(Ik.warn(Rk),null)}))()}markAsRead(t){var e=this;return f((function*(){return e._conversationsManager?e._conversationsManager.markAsRead(t):(Ik.warn(Rk),null)}))()}getTickets(t){var e=this;return f((function*(){return e._conversationsManager?e._conversationsManager.getTickets(t):(Ik.warn(Rk),null)}))()}requestRestoreLink(t){var e=this;return f((function*(){return e._conversationsManager?e._conversationsManager.requestRestoreLink(t):(Ik.warn(Rk),null)}))()}restoreFromToken(t){var e=this;return f((function*(){return e._conversationsManager?e._conversationsManager.restoreFromToken(t):(Ik.warn(Rk),null)}))()}restoreFromUrlToken(){var t=this;return f((function*(){return t._conversationsManager?t._conversationsManager.restoreFromUrlToken():(Ik.warn(Rk),null)}))()}getCurrentTicketId(){var t,e;return null!==(t=null==(e=this._conversationsManager)?void 0:e.getCurrentTicketId())&&void 0!==t?t:null}getWidgetSessionId(){var t,e;return null!==(t=null==(e=this._conversationsManager)?void 0:e.getWidgetSessionId())&&void 0!==t?t:null}Sl(){var t;null==(t=this._conversationsManager)||t.setIdentity()}xl(){var t;null==(t=this._conversationsManager)||t.clearIdentity()}}},Vk={logs:class{constructor(e){var i,r=this;this.Iv=!1,this.Rv=!1,this.I=Bi("[logs]"),this.Pv=p({},this.I,{error(){for(var t=arguments.length,e=new Array(t),i=0;t>i;i++)e[i]=arguments[i];e.some(Fk)||r.I.error(...e)}}),this.ka=[],this.Av=[],this.ph=0,this.Fv=()=>{var t,e;this.ph=0,null==(t=this.Lv)||t.onReconnect(),null==(e=this.Ov)||e.onReconnect()},this._instance=e,this._instance&&null!=(i=this._instance.config.logs)&&i.captureConsoleLogs&&(this.Iv=!0),t&&Ki(t,"online",this.Fv)}Dv(t,e,i,r){var n,s=function(t,e){var i,r,n,s,o,a,l,u=null!==(i=null==t?void 0:t.flushIntervalMs)&&void 0!==i?i:3e3,h=null!==(r=null==t?void 0:t.maxBufferSize)&&void 0!==r?r:100,d=null!=e&&e.consoleCapture?void 0:null!==(n=null==t?void 0:t.maxLogsPerInterval)&&void 0!==n?n:1e3,v=at(d)?Math.max(h,2048):Math.max(h,d),c=null==t?void 0:t.resourceAttributes;return{serviceName:null!==(s=null!==(o=null==c?void 0:c["service.name"])&&void 0!==o?o:null==t?void 0:t.serviceName)&&void 0!==s?s:null==e?void 0:e.serviceNameDefault,serviceVersion:null!==(a=null==c?void 0:c["service.version"])&&void 0!==a?a:null==t?void 0:t.serviceVersion,environment:null!==(l=null==c?void 0:c["deployment.environment"])&&void 0!==l?l:null==t?void 0:t.environment,resourceAttributes:c,beforeSend:null==t?void 0:t.beforeSend,flushIntervalMs:u,maxBufferSize:h,maxQueueSize:v,maxBatchRecordsPerPost:100,rateCapWindowMs:u,maxLogsPerInterval:d,backgroundFlushBudgetMs:0,terminationFlushBudgetMs:0}}(null==(n=this._instance)||null==(n=n.config)?void 0:n.logs,i);return[new Ke(this.$v(t,e),s,this.Pv,(()=>this.Nv()),(t=>t()),void 0,r),s]}qv(){var t,e=null==(t=this._instance)||null==(t=t.config)?void 0:t.logs;if(!this.Lv||this.jv!==e){var i;null==(i=this.Lv)||i.reset(),this.jv=e;var r=this.Dv((()=>this.ka),(t=>{this.ka=t}));this.Lv=r[0],this.Bv=r[1]}return this.Lv}Hv(){var t,e=null==(t=this._instance)||null==(t=t.config)?void 0:t.logs;if(!this.Ov||this.Uv!==e){var i;null==(i=this.Ov)||i.reset(),this.Uv=e;var r=this.Dv((()=>this.Av),(t=>{this.Av=t}),{serviceNameDefault:"posthog-browser-logs",consoleCapture:!0},Pk);this.Ov=r[0],this.zv=r[1]}return this.Ov}initialize(){this.loadIfEnabled()}onRemoteConfig(t){var e;if(t.ok){var i=null==(e=t.config.logs)?void 0:e.captureConsoleLogs;!dt(i)&&i&&(this.Iv=!0,this.loadIfEnabled())}}reset(){var t,e;this.ka=[],null==(t=this.Lv)||t.reset(),this.Av=[],null==(e=this.Ov)||e.reset(),this.ph=0}captureLog(t){this.qv().captureLog(t)}vi(t){this.Hv().captureLog(t)}get logger(){return this.Wv||(this.Wv={trace:(t,e)=>this.captureLog({body:t,level:"trace",attributes:e}),debug:(t,e)=>this.captureLog({body:t,level:"debug",attributes:e}),info:(t,e)=>this.captureLog({body:t,level:"info",attributes:e}),warn:(t,e)=>this.captureLog({body:t,level:"warn",attributes:e}),error:(t,e)=>this.captureLog({body:t,level:"error",attributes:e}),fatal:(t,e)=>this.captureLog({body:t,level:"fatal",attributes:e})}),this.Wv}flushLogs(t){t?this.Vv(t):(this.Lv&&this.Lv.flush().catch((t=>this.Gv(t))),this.Ov&&this.Ov.flush().catch((t=>this.Gv(t))))}Gv(t){Fk(t)||this.I.error("PostHog logs flush failed:",t)}loadIfEnabled(){if(this.Iv&&!this.Rv){var t=null==v?void 0:v.__PosthogExtensions__;if(t){var e=t.loadExternalDependency;e?e(this._instance,"logs",(e=>{var i;e||null==(i=t.logs)||!i.initializeLogs?this.I.error("Could not load logs script",e):(t.logs.initializeLogs(this._instance),this.Rv=!0)})):this.I.error(As)}else this.I.error("PostHog Extensions not found.")}}$v(t,e){var i=this._instance;return{get isDisabled(){return!1},get optedOut(){return!i.is_capturing()},getPersistedProperty:e=>e===x.LogsQueue?t():void 0,setPersistedProperty(t,i){var r;t===x.LogsQueue&&e(null!==(r=i)&&void 0!==r?r:[])},Mn:t=>this.Mn(t),getLibraryId:()=>Ni.LIB_NAME,getLibraryVersion:()=>Ni.LIB_VERSION}}Mn(t){return new Promise((e=>{if(or(this.ph,3))e({kind:"fatal",error:Ok(void 0,"logs endpoint is unreachable, dropping batch")});else{var i=!1,r=t=>{i||(i=!0,clearTimeout(n),e(t))},n=setTimeout((()=>{this.I.warn("Logs request timed out before receiving a response"),r({kind:"retry-later",error:Ok(void 0,"logs request timed out")})}),9e4);this._instance._send_request({method:"POST",url:this.Zv(),data:t,compression:"best-available",batchKey:"logs",fireCallbackOnDrop:!0,callback:t=>{var e=t.statusCode;if(this.Qv(e),e>=200&&300>e)r({kind:"ok"});else if(413===e)r({kind:"too-large"});else if(0!==e&&408!==e&&429!==e&&500>e)r({kind:"fatal",error:new Error("logs request failed with status "+e)});else{var i;0===e?(t.error||this.I.warn("Logs request failed before receiving an HTTP response"),r({kind:"retry-later",error:Ok(t.error,"logs request failed before receiving an HTTP response")})):r({kind:"retry-later",error:null!==(i=t.error)&&void 0!==i?i:new Error("logs request failed with status "+e)})}}})}}))}Qv(t){(0!==t||this._instance.__loaded)&&(this.ph=ar(t,this.ph,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."))))}Vv(t){this.ka.length>0&&this.Jv(t,this.ka,this.Bv,Ni.LIB_NAME,(t=>{this.ka=t})),this.Av.length>0&&this.Jv(t,this.Av,this.zv,Pk,(t=>{this.Av=t}))}Jv(t,e,i,r,n){if(0!==e.length){var s=e.map((t=>t.record));n([]);var o=Je(s,Qe(i,Ni.LIB_NAME,Ni.LIB_VERSION),r,Ni.LIB_VERSION);this._instance._send_request({method:"POST",url:this.Zv(),data:o,compression:"best-available",batchKey:"logs",transport:t})}}Zv(){return this._instance.requestRouter.endpointFor("api","/i/v1/logs")+"?token="+encodeURIComponent(this._instance.config.token)}Nv(){var t,e={};if(e.distinctId=this._instance.get_distinct_id(),this._instance.sessionManager){var i=this._instance.sessionManager.checkAndGetSessionAndWindowId(!0),r=i.windowId,n=i.sessionStartTimestamp,s=i.lastActivityTimestamp;e.sessionId=i.sessionId,e.windowId=r,dt(n)||(e.sessionStartTimestamp=n),dt(s)||(e.lastActivityTimestamp=s)}if(null!=v&&null!=(t=v.location)&&t.href&&(e.currentUrl=this._instance.config.disable_capture_url_hashes?Le(v.location.href):v.location.href),this._instance.featureFlags){var o=this._instance.featureFlags.getFlags();o&&o.length>0&&(e.activeFeatureFlags=o)}return e}}},Gk={metrics:class{constructor(t){this.I=Bi("[metrics]"),this._instance=t}initialize(){}qv(){var t,e,i=null==(t=this._instance)||null==(t=t.config)?void 0:t.metrics;return this.Lv&&this.jv===i||(null==(e=this.Lv)||e.reset(),this.jv=i,this.Lv=new ei(this.$v(),function(t){var e,i,r,n,s,o=null==t?void 0:t.resourceAttributes;return{serviceName:null!==(e=null==o?void 0:o["service.name"])&&void 0!==e?e:null==t?void 0:t.serviceName,serviceVersion:null!==(i=null==o?void 0:o["service.version"])&&void 0!==i?i:null==t?void 0:t.serviceVersion,environment:null!==(r=null==o?void 0:o["deployment.environment"])&&void 0!==r?r:null==t?void 0:t.environment,resourceAttributes:o,beforeSend:null==t?void 0:t.beforeSend,flushIntervalMs:null!==(n=null==t?void 0:t.flushIntervalMs)&&void 0!==n?n:1e4,maxSeriesPerFlush:null!==(s=null==t?void 0:t.maxSeriesPerFlush)&&void 0!==s?s:1e3}}(i),this.I)),this.Lv}count(t,e,i){void 0===e&&(e=1),this.qv().count(t,e,i)}gauge(t,e,i){this.qv().gauge(t,e,i)}histogram(t,e,i){this.qv().histogram(t,e,i)}flush(t){if(!this.Lv)return Promise.resolve();if(t){var e=this.Lv.drainWindow();return e&&this.Un(e,t),Promise.resolve()}return this.Lv.flush().catch((t=>this.I.error("PostHog metrics flush failed:",t)))}reset(){var t;null==(t=this.Lv)||t.reset()}$v(){var t=this._instance,e=this;return{get isDisabled(){return!1},get optedOut(){return!t.is_capturing()},Un:t=>e.Un(t),getLibraryId:()=>Ni.LIB_NAME,getLibraryVersion:()=>Ni.LIB_VERSION}}Un(t,e){return new Promise((i=>{var r=!1,n=t=>{r||(r=!0,clearTimeout(s),i(t))},s=setTimeout((()=>n({kind:"retry-later",error:new Error("metrics request timed out")})),9e4);this._instance._send_request(p({method:"POST",url:this.Kv(),data:t,compression:"best-available",batchKey:"metrics"},e&&{transport:e},{fireCallbackOnDrop:!0,callback(t){var e=t.statusCode;if(e>=200&&300>e)n({kind:"ok"});else if(413===e)n({kind:"too-large"});else if(0!==e&&408!==e&&429!==e&&500>e)n({kind:"fatal",error:new Error("metrics request failed with status "+e)});else{var i;n({kind:"retry-later",error:null!==(i=t.error)&&void 0!==i?i:new Error("metrics request failed with status "+e)})}}}))}))}Kv(){return this._instance.requestRouter.endpointFor("api","/i/v1/metrics")+"?token="+encodeURIComponent(this._instance.config.token)}}},Zk=p({},Lk,$k,Dk,Nk,qk,jk,Uk,Bk,Hk,zk,Wk,Vk,Gk);Bw.__defaultExtensionClasses=p({},Zk);var Qk=function(){Ni.SDK_DIST_CHANNEL="npm";var e=Ew[Lw]=new Bw;return function(){function e(){e.done||(e.done=!0,$w=!1,Hi(Ew,(function(t){t._dom_loaded()})))}null!=r&&r.addEventListener?"complete"===r.readyState?e():Ki(r,"DOMContentLoaded",e,{capture:!1}):t&&ji.error("Browser doesn't support `document.addEventListener` so PostHog couldn't be initialized")}(),e}();export{nf as Compression,Ob as DEFAULT_PRODUCT_TOUR_APPEARANCE,pf as DisplaySurveyType,Bw as PostHog,Fb as ProductTourEventName,Lb as ProductTourEventProperties,cf as SurveyEventName,ff as SurveyEventProperties,sf as SurveyEventType,af as SurveyPosition,df as SurveyQuestionBranchingType,hf as SurveyQuestionType,vf as SurveySchedule,lf as SurveyTabPosition,uf as SurveyType,of as SurveyWidgetType,Qk as default,Qk as posthog,jb as severityLevels};
1
+ var t="undefined"!=typeof window?window:void 0,e="undefined"!=typeof globalThis?globalThis:t,i=null==e?void 0:e.navigator,r=null==e?void 0:e.document,n=null==e?void 0:e.location,s=null==e?void 0:e.fetch,o=null!=e&&e.XMLHttpRequest&&"withCredentials"in new e.XMLHttpRequest?e.XMLHttpRequest:void 0,a=null==e?void 0:e.AbortController,l=null==e?void 0:e.CompressionStream,u=null==i?void 0:i.userAgent;function h(){return!(!t||!1===t.navigator.onLine)}var d="undefined"!=typeof globalThis?globalThis:t;d&&"undefined"==typeof self&&(d.self=d),d&&"undefined"==typeof File&&(d.File=function(){});var v=null!=t?t:{};function c(t,e,i,r,n,s,o){try{var a=t[s](o),l=a.value}catch(t){return void i(t)}a.done?e(l):Promise.resolve(l).then(r,n)}function f(t){return function(){var e=this,i=arguments;return new Promise((function(r,n){var s=t.apply(e,i);function o(t){c(s,r,n,o,a,"next",t)}function a(t){c(s,r,n,o,a,"throw",t)}o(void 0)}))}}function p(){return p=Object.assign?Object.assign.bind():function(t){for(var e=1;arguments.length>e;e++){var i=arguments[e];for(var r in i)({}).hasOwnProperty.call(i,r)&&(t[r]=i[r])}return t},p.apply(null,arguments)}function g(t,e){if(null==t)return{};var i={};for(var r in t)if({}.hasOwnProperty.call(t,r)){if(-1!==e.indexOf(r))continue;i[r]=t[r]}return i}var m={DomContentLoaded:0,Load:1,FullSnapshot:2,IncrementalSnapshot:3,Meta:4,Custom:5,Plugin:6},y={Mutation:0,MouseMove:1,MouseInteraction:2,Scroll:3,ViewportResize:4,Input:5,TouchMove:6,MediaInteraction:7,StyleSheetRule:8,CanvasMutation:9,Font:10,Log:11,Drag:12,StyleDeclaration:13,Selection:14,AdoptedStyleSheet:15,CustomElement:16},_=t=>{if("string"!=typeof t)return t;try{return JSON.parse(t)}catch(e){return t}};function b(t){return"string"==typeof t||t}function w(t){return"string"==typeof t?t:void 0}var k,S=["$feature_flag","$feature_flag_response","$feature_flag_has_experiment","$feature_flag_id","$feature_flag_version","$feature_flag_reason","$feature_flag_request_id","$feature_flag_evaluated_at","$feature_flag_error","locally_evaluated","$groups","$process_person_profile","$geoip_disable","$current_url","$pathname","$referring_domain","utm_source","utm_medium","utm_campaign","utm_content","utm_term","gad_source","mc_cid","gclid","gclsrc","dclid","gbraid","wbraid","fbclid","msclkid","twclid","li_fat_id","igshid","ttclid","rdt_cid","epik","qclid","sccid","irclid","_kx","$session_id","$window_id","$lib","$lib_version","$device_id","$is_server"],x=function(t){return t.AnonymousId="anonymous_id",t.DistinctId="distinct_id",t.Props="props",t.EnablePersonProcessing="enable_person_processing",t.PersonMode="person_mode",t.FeatureFlagDetails="feature_flag_details",t.FeatureFlags="feature_flags",t.FeatureFlagPayloads="feature_flag_payloads",t.BootstrapFeatureFlagDetails="bootstrap_feature_flag_details",t.BootstrapFeatureFlags="bootstrap_feature_flags",t.BootstrapFeatureFlagPayloads="bootstrap_feature_flag_payloads",t.OverrideFeatureFlags="override_feature_flags",t.Queue="queue",t.AiQueue="ai_queue",t.AiCaptureQueue="ai_capture_queue",t.LogsQueue="logs_queue",t.OptedOut="opted_out",t.SessionId="session_id",t.SessionStartTimestamp="session_start_timestamp",t.SessionLastTimestamp="session_timestamp",t.PersonProperties="person_properties",t.GroupProperties="group_properties",t.InstalledAppBuild="installed_app_build",t.InstalledAppVersion="installed_app_version",t.SessionReplay="session_replay",t.PushRegistered="push_registered",t.SessionReplayEventTriggerActivatedSession="session_replay_event_trigger_activated_session",t.SurveyLastSeenDate="survey_last_seen_date",t.SurveysSeen="surveys_seen",t.Surveys="surveys",t.RemoteConfig="remote_config",t.FlagsEndpointWasHit="flags_endpoint_was_hit",t.DeviceId="device_id",t}({}),C=function(t){return t.GZipJS="gzip-js",t.Base64="base64",t}({}),T="min_length",E="max_length",M=["$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"],I=["token"],R="NativeGzipValidationError",P=t=>t.length>=2&&31===t[0]&&139===t[1],A=(t,e)=>t===C.GZipJS||e===C.GZipJS||"gzip"===e,O=t=>!(!t||"object"!=typeof t)&&"NotReadableError"===("name"in t?String(t.name):""),F=t=>{if(!t||"object"!=typeof t)return!1;var e="name"in t?String(t.name):"";return O(t)||e===R},L=t=>{var e=new Error("Native gzip produced invalid output: "+t);throw e.name=R,e},D=function(){var t=f((function*(t,e){18>t.size&&L("too-short");var i=new Uint8Array(yield t.slice(0,10).arrayBuffer());P(i)&&8===i[2]||L("invalid-header");var r=new DataView(yield t.slice(t.size-8).arrayBuffer());r.getUint32(0,!0)!==(t=>{for(var e=(()=>{if(k)return k;k=[];for(var t=0;256>t;t++){for(var e=t,i=0;8>i;i++)e=1&e?3988292384^e>>>1:e>>>1;k[t]=e>>>0}return k})(),i=4294967295,r=0;t.length>r;r++)i=e[255&(i^t[r])]^i>>>8;return(4294967295^i)>>>0})(e)&&L("invalid-crc");var n=e.length>>>0;r.getUint32(4,!0)!==n&&L("invalid-size")}));return function(e,i){return t.apply(this,arguments)}}();function N(t,e,i){return q.apply(this,arguments)}function q(){return q=f((function*(t,e,i){void 0===e&&(e=!0);try{var r=(new TextEncoder).encode(t),n=new globalThis.CompressionStream("gzip"),s=n.writable.getWriter(),o=s.write(r).then((()=>s.close())).catch(function(){var t=f((function*(t){try{yield s.abort(t)}catch(t){}throw t}));return function(e){return t.apply(this,arguments)}}()),a=new Response(n.readable).blob(),l=(yield Promise.all([a,o]))[0];return yield D(l,r),l}catch(t){if(null!=i&&i.rethrow)throw t;return e&&console.error("Failed to gzip compress data",t),null}})),q.apply(this,arguments)}var j=20,B=1e3,U=1e4,H="[Circular]",z="[Truncated]",W="[Unserializable]",V="[Function]";function G(t){for(var e="",i=0;t.length>i;i++){var r=t.charCodeAt(i);if(55296>r||r>56319)e+=56320>r||r>57343?t[i]:"�";else{var n=t.charCodeAt(i+1);56320>n||n>57343?e+="�":(e+=t[i]+t[i+1],i++)}}return e}var Z=["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"],Q=function(t,e){if(void 0===e&&(e=[]),!t)return!1;var i=t.toLowerCase();return Z.concat(e).some((t=>{var e=t.toLowerCase();return-1!==i.indexOf(e)}))};function J(t,e){return-1!==t.indexOf(e)}var K=function(t){return t.trim()},Y=function(t){return t.replace(/^\$/,"")};function X(t){var e,i=[];return null!==(e=JSON.stringify(t,(function(t,e){if("bigint"==typeof e)return e.toString();if("function"!=typeof e&&"symbol"!=typeof e){if(e instanceof Error)return{name:e.name,message:e.message,stack:e.stack};if(e&&"object"==typeof e){for(;i.length>0&&i[i.length-1]!==this;)i.pop();if(i.includes(e))return"[Circular]";i.push(e)}return e}})))&&void 0!==e?e:"null"}var tt=Object.prototype,et=tt.hasOwnProperty,it=tt.toString,rt=Array.isArray||function(t){return"[object Array]"===it.call(t)},nt=t=>"function"==typeof t,st=t=>t===Object(t)&&!rt(t),ot=t=>{if(st(t)){for(var e in t)if(et.call(t,e))return!1;return!0}return!1},at=t=>void 0===t,lt=t=>"[object String]"==it.call(t),ut=t=>lt(t)&&0===t.trim().length,ht=t=>null===t,dt=t=>at(t)||ht(t),vt=t=>"[object Number]"==it.call(t)&&t==t,ct=t=>vt(t)&&t>0,ft=t=>"[object Boolean]"===it.call(t),pt=t=>t instanceof FormData,gt=t=>J(M,t),mt=t=>J(I,t);function yt(t){return null===t||"object"!=typeof t}function _t(t,e){return{}.toString.call(t)==="[object "+e+"]"}function bt(t){switch({}.toString.call(t)){case"[object Error]":case"[object Exception]":case"[object DOMException]":case"[object DOMError]":case"[object WebAssembly.Exception]":return!0;default:return kt(t,Error)}}function wt(t){return"undefined"!=typeof Event&&kt(t,Event)}function kt(t,e){try{return t instanceof e}catch(t){return!1}}var St=[!0,"true",1,"1","yes"],xt=t=>J(St,t),Ct=[!1,"false",0,"0","no"];function Tt(t,e,i,r,n){return e>i&&(r.warn("min cannot be greater than max."),e=i),vt(t)?t>i?(r.warn(" cannot be greater than max: "+i+". Using max value instead."),i):e>t?(r.warn(" cannot be less than min: "+e+". Using min value instead."),e):t:(r.warn(" must be a number. using max or fallback. max: "+i+", fallback: "+n),Tt(n||i,e,i,r))}class Et{constructor(t){this.k={},this.S=t.S,this.C=Tt(t.bucketSize,0,100,t.I),this.R=Tt(t.refillRate,0,this.C,t.I),this.A=Tt(t.refillInterval,0,864e5,t.I)}O(t,e){var i=Math.floor((e-t.lastAccess)/this.A);i>0&&(t.tokens=Math.min(t.tokens+i*this.R,this.C),t.lastAccess=t.lastAccess+i*this.A)}consumeRateLimit(t){var e,i=Date.now(),r=String(t),n=this.k[r];return n?this.O(n,i):this.k[r]=n={tokens:this.C,lastAccess:i},0===n.tokens||(n.tokens--,0===n.tokens&&(null==(e=this.S)||e.call(this,t)),0===n.tokens)}stop(){this.k={}}}var Mt="Mobile",It="iOS",Rt="Android",Pt="Tablet",At=Rt+" "+Pt,Ot="iPad",Ft="Apple",Lt=Ft+" Watch",$t="Safari",Dt="BlackBerry",Nt="Samsung",qt=Nt+"Browser",jt=Nt+" Internet",Bt="Chrome",Ut=Bt+" OS",Ht=Bt+" "+It,zt="Internet Explorer",Wt=zt+" "+Mt,Vt="Opera",Gt=Vt+" Mini",Zt="Edge",Qt="Microsoft "+Zt,Jt="Firefox",Kt=Jt+" "+It,Yt="Nintendo",Xt="PlayStation",te="Xbox",ee=Rt+" "+Mt,ie=Mt+" "+$t,re="Windows",ne=re+" Phone",se="Nokia",oe="Ouya",ae="Generic",le=ae+" "+Mt.toLowerCase(),ue=ae+" "+Pt.toLowerCase(),he="Konqueror",de="Oculus Browser",ve="Vivaldi",ce="Yandex",fe="Whale",pe="DuckDuckGo",ge="Pale Moon",me="Waterfox",ye="Brave",_e="Google Search App",be="(\\d+(\\.\\d+)?)",we=new RegExp("Version/"+be),ke=new RegExp(te,"i"),Se=new RegExp(Xt+" \\w+","i"),xe=new RegExp(Yt+" \\w+","i"),Ce=new RegExp(Dt+"|PlayBook|BB10","i"),Te={"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"},Ee=function(t,e,i,r){e=e||"";var n=function(t){return null!=t&&t.brave?ye:null}(i);return n||(null!=r&&r.detectGoogleSearchApp&&J(t,"GSA/")?_e:J(t," OPR/")&&J(t,"Mini")?Gt:J(t," OPR/")?Vt:Ce.test(t)?Dt:J(t,"IE"+Mt)||J(t,"WPDesktop")?Wt:J(t,"OculusBrowser")?de:J(t,qt)?jt:J(t,Zt)||J(t,"Edg/")?Qt:J(t,ve+"/")?ve:J(t,"YaBrowser/")?ce:J(t,fe+"/")?fe:J(t,pe+"/")||J(t,"Ddg/")?pe:J(t,"FBIOS")?"Facebook "+Mt:J(t,"UCWEB")||J(t,"UCBrowser")?"UC Browser":J(t,"CriOS")?Ht:J(t,"CrMo")||J(t,Bt)?Bt:J(t,Rt)&&J(t,$t)?ee:J(t,"FxiOS")?Kt:J(t.toLowerCase(),he.toLowerCase())?he:J(t,ye+"/")?ye:((t,e)=>e&&J(e,Ft)||function(t){return J(t,$t)&&!J(t,Bt)&&!J(t,Rt)}(t))(t,e)?J(t,Mt)?ie:$t:J(t,"PaleMoon/")?ge:J(t,me+"/")?me:J(t,Jt)?Jt:J(t,"MSIE")||J(t,"Trident/")?zt:J(t,"Gecko")?Jt:"")},Me={[Wt]:[new RegExp("rv:"+be)],[Qt]:[new RegExp(Zt+"?\\/"+be)],[Bt]:[new RegExp("("+Bt+"|CrMo)\\/"+be)],[Ht]:[new RegExp("CriOS\\/"+be)],"UC Browser":[new RegExp("(UCBrowser|UCWEB)\\/"+be)],[$t]:[we],[ie]:[we],[Vt]:[new RegExp("(Opera|OPR)\\/"+be)],[Jt]:[new RegExp(Jt+"\\/"+be)],[Kt]:[new RegExp("FxiOS\\/"+be)],[he]:[new RegExp("Konqueror[:/]?"+be,"i")],[Dt]:[new RegExp(Dt+" "+be),we],[ee]:[new RegExp("android\\s"+be,"i")],[jt]:[new RegExp(qt+"\\/"+be)],[de]:[new RegExp("OculusBrowser\\/"+be)],[ve]:[new RegExp(ve+"\\/"+be)],[ce]:[new RegExp("YaBrowser\\/"+be)],[fe]:[new RegExp(fe+"\\/"+be)],[ye]:[new RegExp(ye+"\\/"+be)],[pe]:[new RegExp("(DuckDuckGo|Ddg)\\/"+be)],[ge]:[new RegExp("PaleMoon\\/"+be)],[me]:[new RegExp(me+"\\/"+be)],[_e]:[new RegExp("GSA\\/"+be)],[zt]:[new RegExp("(rv:|MSIE )"+be)],Mozilla:[new RegExp("rv:"+be)]},Ie=function(t,e,i,r){var n=Ee(t,e,i,r),s=Me[n];if(at(s))return null;for(var o=0;s.length>o;o++){var a=t.match(s[o]);if(a)return parseFloat(a[a.length-2])}return null},Re=[[new RegExp(te+"; "+te+" (.*?)[);]","i"),t=>[te,t&&t[1]||""]],[new RegExp(Yt,"i"),[Yt,""]],[new RegExp(Xt,"i"),[Xt,""]],[Ce,[Dt,""]],[new RegExp(re,"i"),(t,e)=>{if(/Phone/.test(e)||/WPDesktop/.test(e))return[ne,""];if(new RegExp(Mt).test(e)&&!/IEMobile\b/.test(e))return[re+" "+Mt,""];var i=/Windows NT ([0-9.]+)/i.exec(e);if(i&&i[1]){var r=Te[i[1]]||"";return/arm/i.test(e)&&(r="RT"),[re,r]}return[re,""]}],[/((iPhone|iPad|iPod).*?OS (\d+)_(\d+)_?(\d+)?|iPhone)/,t=>t&&t[3]?[It,[t[3],t[4],t[5]||"0"].join(".")]:[It,""]],[/(watch.*\/(\d+\.\d+\.\d+)|watch os,(\d+\.\d+),)/i,t=>{var e="";return t&&t.length>=3&&(e=at(t[2])?t[3]:t[2]),["watchOS",e]}],[new RegExp("("+Rt+" (\\d+)\\.(\\d+)\\.?(\\d+)?|"+Rt+")","i"),t=>t&&t[2]?[Rt,[t[2],t[3],t[4]||"0"].join(".")]:[Rt,""]],[/Mac OS X (\d+)[_.](\d+)[_.]?(\d+)?/i,t=>{var e=["Mac OS X",""];return t&&t[1]&&(e[1]=[t[1],t[2],t[3]||"0"].join(".")),e}],[/Mac/i,["Mac OS X",""]],[/CrOS/,[Ut,""]],[/Linux|debian/i,["Linux",""]]],Pe=function(t){return xe.test(t)?Yt:Se.test(t)?Xt:ke.test(t)?te:new RegExp(oe,"i").test(t)?oe:new RegExp("("+ne+"|WPDesktop)","i").test(t)?ne:/iPad/.test(t)?Ot:/iPod/.test(t)?"iPod Touch":/iPhone/.test(t)?"iPhone":/(watch)(?: ?os[,/]|\d,\d\/)[\d.]+/i.test(t)?Lt:Ce.test(t)?Dt:/(kobo)\s(ereader|touch)/i.test(t)?"Kobo":new RegExp(se,"i").test(t)?se:/(kf[a-z]{2}wi|aeo[c-r]{2})( bui|\))/i.test(t)||/(kf[a-z]+)( bui|\)).+silk\//i.test(t)?"Kindle Fire":/(Android|ZTE)/i.test(t)?new RegExp(Mt).test(t)&&!/(9138B|TB782B|Nexus [97]|pixel c|HUAWEISHT|BTV|noble nook|smart ultra 6)/i.test(t)||/pixel[\daxl ]{1,6}/i.test(t)&&!/pixel c/i.test(t)||/(huaweimed-al00|tah-|APA|SM-G92|i980|zte|U304AA)/i.test(t)||/lmy47v/i.test(t)&&!/QTAQZ3/i.test(t)?Rt:At:new RegExp("(pda|"+Mt+")","i").test(t)?le:new RegExp(Pt,"i").test(t)&&!new RegExp(Pt+" pc","i").test(t)?ue:""},Ae=function(t,e){var i,r,n,s,o=Pe(t);return o===Ot||o===At||"Kobo"===o||"Kindle Fire"===o||o===ue?Pt:o===Yt||o===te||o===Xt||o===oe?"Console":o===Lt?"Wearable":o?Mt:"Android"===(null==e?void 0:e.userAgentDataPlatform)&&(null!==(i=null==e?void 0:e.maxTouchPoints)&&void 0!==i?i:0)>0?600>Math.min(null!==(r=null==e?void 0:e.screenWidth)&&void 0!==r?r:0,null!==(n=null==e?void 0:e.screenHeight)&&void 0!==n?n:0)/(null!==(s=null==e?void 0:e.devicePixelRatio)&&void 0!==s?s:1)?Mt:Pt:"Desktop"},Oe=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;function Fe(t,e){return"string"==typeof(i=t)&&Oe.test(i)?t:e();var i}function Le(t){return t?t.split("#")[0]:t}function $e(t,e){var i=setTimeout(t,e);return(null==i?void 0:i.unref)&&(null==i||i.unref()),i}function De(t,e,i){return Ne.apply(this,arguments)}function Ne(){return(Ne=f((function*(t,e,i){var r;try{return yield Promise.race([t,new Promise(((t,n)=>{r=$e((()=>{try{null==i||i(),t()}catch(t){n(t)}}),e)}))])}finally{clearTimeout(r)}}))).apply(this,arguments)}var qe={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}},je=qe.info,Be=0x8000000000000000,Ue={}.propertyIsEnumerable;function He(t,e){try{return Ve(t,e,{ancestors:new WeakSet,remainingNodes:U},0)}catch(t){return[]}}function ze(t,e,i,r){if(0>=i.remainingNodes)return{stringValue:z};if(i.remainingNodes--,ft(t))return{boolValue:t};if("number"==typeof t){if(!Number.isFinite(t))return{stringValue:String(t)};if(Number.isInteger(t)){if(Number.isSafeInteger(t))return{intValue:String(t)};if("undefined"==typeof BigInt)return{stringValue:String(t)};var n=BigInt(t).toString();return t>=Be||-Be>t?(null==e||e.debug("Attribute "+n+" is outside the int64 range; encoding it as a string"),{stringValue:n}):{intValue:n}}return{doubleValue:t}}if("string"==typeof t)return{stringValue:G(t)};if("function"==typeof t)return{stringValue:V};if("symbol"==typeof t)return{stringValue:String(t)};if("object"==typeof t&&null!==t){if(i.ancestors.has(t))return{stringValue:H};if(r>=j)return{stringValue:z};if(t instanceof Date){var s=t.getTime(),o=Number.isFinite(s)?t.toISOString():String(t);return{stringValue:"string"==typeof o?G(o):String(o)}}i.ancestors.add(t);try{try{var a=t.toJSON;if("function"==typeof a)return ze(a.call(t),e,i,r+1)}catch(t){}return rt(t)?{arrayValue:{values:We(t,e,i,r+1)}}:{kvlistValue:{values:Ve(t,e,i,r+1)}}}finally{i.ancestors.delete(t)}}return{stringValue:G(String(t))}}function We(t,e,i,r){for(var n=[],s=Math.min(t.length,B),o=0;s>o&&i.remainingNodes>0;o++)try{var a=o in t?t[o]:void 0;if(dt(a))continue;n.push(ze(a,e,i,r))}catch(t){n.push({stringValue:W})}return t.length>o&&n.push({stringValue:z}),n}function Ve(t,e,i,r){var n=[];for(var s in t)if(Ue.call(t,s)){if(n.length>=B||0>=i.remainingNodes){null==e||e.debug("Attributes truncated: the value exceeds the OTLP encoder budget");break}try{var o=t[s];if(ht(o)||at(o))continue;n.push({key:G(s),value:ze(o,e,i,r)})}catch(t){n.push({key:G(s),value:{stringValue:W}})}}return n}function Ge(t){try{return G(String(t))}catch(t){return W}}function Ze(t,e,i){var r=qe[t.level||"info"]||je,n=r.text,s=r.number,o=String(Date.now())+"000000",a={};e.distinctId&&(a.posthogDistinctId=e.distinctId),e.sessionId&&(a.sessionId=e.sessionId),e.windowId&&(a["window.id"]=e.windowId),dt(e.sessionStartTimestamp)||(a.sessionStartTimestamp=String(e.sessionStartTimestamp)),dt(e.lastActivityTimestamp)||(a.lastActivityTimestamp=String(e.lastActivityTimestamp)),e.currentUrl&&(a["url.full"]=e.currentUrl),e.screenName&&(a["screen.name"]=e.screenName),e.appState&&(a["app.state"]=e.appState),e.activeFeatureFlags&&e.activeFeatureFlags.length>0&&(a.feature_flags=e.activeFeatureFlags);var l=p({},a),u=t.attributes;if(u){var h=[];try{h=Object.keys(u)}catch(t){h=[]}for(var d of h){var v=void 0;try{v=u[d]}catch(t){v=W}Object.defineProperty(l,d,{value:v,enumerable:!0,writable:!0,configurable:!0})}}var c={timeUnixNano:o,observedTimeUnixNano:o,severityNumber:s,severityText:n,body:{stringValue:Ge(t.body)},attributes:He(l,i)};return t.trace_id&&(c.traceId=t.trace_id),t.span_id&&(c.spanId=t.span_id),at(t.trace_flags)||(c.flags=t.trace_flags),c}function Qe(t,e,i){return p({},t.resourceAttributes,{"service.name":t.serviceName||"unknown_service"},t.environment&&{"deployment.environment":t.environment},t.serviceVersion&&{"service.version":t.serviceVersion},{"telemetry.sdk.name":e,"telemetry.sdk.version":i})}function Je(t,e,i,r){return{resourceLogs:[{resource:{attributes:He(e)},scopeLogs:[{scope:{name:i,version:r},logRecords:t}]}]}}let Ke=class{constructor(t,e,i,r,n,s,o){var a;void 0===s&&(s=()=>Promise.resolve()),this._instance=t,this.qi=e,this.I=i,this.rn=r,this.nn=n,this.sn=s,this.an=o,this.ln=null,this.un=0,this.hn=0,this.dn=0,this.vn=0,this.cn=!1,this.fn=e.maxBufferSize,this.pn=Math.max(null!==(a=e.maxQueueSize)&&void 0!==a?a:e.maxBufferSize,e.maxBufferSize),this.gn=e.flushIntervalMs,this.mn=e.maxBatchRecordsPerPost,this.yn=e.rateCapWindowMs,this.bn=e.maxLogsPerInterval}reset(){this._n(),this.ln=null,this.dn=0,this.vn=0,this.cn=!1,this.un=0,this.hn=0,this.mn=this.qi.maxBatchRecordsPerPost}onReconnect(){this.hn=0,this.wn()}captureLog(t){if(!this._instance.isDisabled&&!this._instance.optedOut&&null!=t&&t.body){var e=this.kn(t);if(null!==e)if(e.body){if(this.Sn()){var i={record:Ze(e,this.rn(),this.I)};this.nn((()=>this.xn(i)))}}else this.I.info("Log was rejected in beforeSend function")}}kn(t){var e=this.qi.beforeSend;if(!e)return t;var i=rt(e)?e:[e],r=t;for(var n of i)try{var s=n(r);if(!s)return this.I.info("Log was rejected in beforeSend function"),null;r=s}catch(t){return this.I.error("Error in beforeSend function for log:",t),null}return r}Sn(){if(void 0===this.bn)return!0;var t=Date.now(),e=t-this.dn;return this.yn>e&&e>=0||(this.dn=t,this.vn=0,this.cn=!1),this.bn>this.vn?(this.vn++,!0):(this.cn||(this.I.warn("captureLog dropping logs: exceeded "+this.bn+" logs per "+this.yn+"ms"),this.cn=!0),!1)}flush(){var t=this;return f((function*(){if(!t._instance.isDisabled)return t.ln||(t.ln=t.Cn().finally((()=>{t.ln=null}))),t.ln}))()}Cn(){var t=this;return f((function*(){var e;t._n();var i=null!==(e=t._instance.getPersistedProperty(x.LogsQueue))&&void 0!==e?e:[];if(0!==i.length)for(var r=i.length,n=0;i.length>0&&r>n;){var s,o;t.un=0;var a=Math.min(i.length,t.mn),l=i.slice(0,a),u=l.map((t=>t.record)),h=Je(u,t.Tn(),null!==(s=t.an)&&void 0!==s?s:t._instance.getLibraryId(),t._instance.getLibraryVersion()),d=yield t._instance.Mn(h);if("too-large"===d.kind&&l.length>1)t.mn=Math.max(1,Math.floor(l.length/2)),t.I.warn("Received 413 when sending logs batch of size "+l.length+", reducing batch size to "+t.mn);else{if("retry-later"===d.kind)throw d.error;if("too-large"===d.kind?t.I.warn("Dropping a single log record after 413 with batch size 1 — the record is larger than the server cap and cannot be split further."):"ok"===d.kind&&t.qi.maxBatchRecordsPerPost>t.mn&&(t.mn=Math.min(t.qi.maxBatchRecordsPerPost,t.mn+1)),yield t.En(l.length),i=null!==(o=t._instance.getPersistedProperty(x.LogsQueue))&&void 0!==o?o:[],n+=l.length,"fatal"===d.kind)throw d.error}}}))()}En(t){var e=this;return f((function*(){var i,r=Math.max(0,t-e.un),n=null!==(i=e._instance.getPersistedProperty(x.LogsQueue))&&void 0!==i?i:[];e._instance.setPersistedProperty(x.LogsQueue,n.slice(r)),yield e.sn()}))()}Tn(){return Qe(this.qi,this._instance.getLibraryId(),this._instance.getLibraryVersion())}xn(t){var e;if(!this._instance.optedOut){var i=null!==(e=this._instance.getPersistedProperty(x.LogsQueue))&&void 0!==e?e:[];this.pn>i.length||(i.shift(),this.un++,this.I.info("Logs queue is full, dropping oldest record.")),i.push(t),this._instance.setPersistedProperty(x.LogsQueue,i),this.fn>i.length?this.In():this.wn()}}In(t){void 0===t&&(t=this.gn),this.Rn||(this.Rn=$e((()=>{this.Rn=void 0,this.wn()}),t))}Pn(){var t=Math.min(Math.max(0,this.hn-1),6);return this.gn*Math.pow(2,t)}An(){var t=this._instance.getPersistedProperty(x.LogsQueue);return!!t&&t.length>0}shutdown(t){var e=this;return f((function*(){e._n();var i=e.flush().catch((()=>{}));void 0!==t?yield De(i,t):yield i}))()}flushWithTimeout(t){var e=this;return f((function*(){var i=e.flush();yield De(i,t,(()=>{i.catch((()=>{}))}))}))()}wn(){this.flush().then((()=>{this.hn=0}),(t=>{this.hn++,this.I.error("PostHog logs flush failed:",t)})).finally((()=>{!this._instance.isDisabled&&this.An()&&this.In(this.Pn())}))}_n(){this.Rn&&(clearTimeout(this.Rn),this.Rn=void 0)}};var Ye=[0,5,10,25,50,75,100,250,500,750,1e3,2500,5e3,7500,1e4];function Xe(t){return String(t)+"000000"}function ti(t,e,i,r){var n="";return r&&(n=Object.keys(r).sort().map((t=>JSON.stringify(t)+":"+JSON.stringify(r[t]))).join(",")),t+"\0"+e+"\0"+(null!=i?i:"")+"\0"+n}let ei=class{constructor(t,e,i){this._instance=t,this.qi=e,this.I=i,this.Fn=new Map,this.ln=null,this.Ln=!1,this.On=new Map,this.Dn=new Set,this.$n=0}count(t,e,i){void 0===e&&(e=1),this.Nn({name:t,type:"count",value:e,unit:null==i?void 0:i.unit,attributes:null==i?void 0:i.attributes})}gauge(t,e,i){this.Nn({name:t,type:"gauge",value:e,unit:null==i?void 0:i.unit,attributes:null==i?void 0:i.attributes})}histogram(t,e,i){this.Nn({name:t,type:"histogram",value:e,unit:null==i?void 0:i.unit,attributes:null==i?void 0:i.attributes})}flush(){var t=this,e=this.ln,i=function(){var i=f((function*(){e&&(yield e.catch((()=>{}))),yield t.qn()}));return function(){return i.apply(this,arguments)}}(),r=i().finally((()=>{this.ln===r&&(this.ln=null)}));return this.ln=r,r}drainWindow(){if(0===this.Fn.size)return null;var t=this.Fn;return this.Fn=new Map,this.Ln=!1,this.On=new Map,this.Dn=new Set,this.jn(t)}reset(){this.$n++,this._n(),this.Fn=new Map,this.ln=null,this.Ln=!1,this.On=new Map,this.Dn=new Set}Nn(t){if(!this._instance.isDisabled&&!this._instance.optedOut){var e=this.kn(t);if(null!==e)if(e.name&&"string"==typeof e.name)if("number"==typeof e.value&&Number.isFinite(e.value))if("count"===e.type&&0>e.value)this.I.warn("Dropping count '"+e.name+"': counters are monotonic, value must be >= 0");else{var i,r;try{i=e.attributes?p({},e.attributes):void 0,r=ti(e.type,e.name,e.unit,i)}catch(t){return void this.I.warn("Dropping metric '"+e.name+"': attributes could not be serialized",t)}var n=this.Fn.get(r);if(!n){if(!this.Bn())return;n={name:e.name,type:e.type,unit:e.unit,attributes:i,windowStartMs:Date.now()},this.Fn.set(r,n)}var s=this.On.get(e.name);void 0===s?this.On.set(e.name,e.type):s===e.type||this.Dn.has(e.name)||(this.Dn.add(e.name),this.I.warn("Metric name '"+e.name+"' is already used as a "+s+"; recording it as a "+e.type+" too will blend both series in charts. Use a distinct name.")),this.Hn(n,e.value),this.In()}else this.I.warn("Dropping metric '"+e.name+"': value must be a finite number");else this.I.warn("Dropping metric with empty name")}}Bn(){return this.qi.maxSeriesPerFlush>this.Fn.size||(this.Ln||(this.Ln=!0,this.I.warn("Metric series cap reached ("+this.qi.maxSeriesPerFlush+" per flush window); dropping new series until the next flush. Reduce attribute cardinality.")),!1)}Hn(t,e){var i;switch(t.type){case"count":t.total=(null!==(i=t.total)&&void 0!==i?i:0)+e;break;case"gauge":t.last=e;break;case"histogram":t.hist||(t.hist={count:0,sum:0,min:e,max:e,bucketCounts:new Array(Ye.length+1).fill(0)});var r=t.hist;r.count+=1,r.sum+=e,r.min=Math.min(r.min,e),r.max=Math.max(r.max,e),r.bucketCounts[function(t,e){for(var i=0;e.length>i;i++)if(e[i]>=t)return i;return e.length}(e,Ye)]+=1}}kn(t){var e=this.qi.beforeSend;if(!e)return t;var i=rt(e)?e:[e],r=t;for(var n of i)try{var s=n(r);if(!s)return this.I.info("Metric was rejected in beforeSend function"),null;r=s}catch(t){return this.I.error("Error in beforeSend function for metric:",t),null}return r}In(){this.Rn||(this.Rn=$e((()=>{this.Rn=void 0,this.flush().catch((t=>{this.I.error("Metrics flush failed:",t)}))}),this.qi.flushIntervalMs))}_n(){this.Rn&&(clearTimeout(this.Rn),this.Rn=void 0)}qn(){var t=this;return f((function*(){if(0!==t.Fn.size){var e=t.Fn;t.Fn=new Map,t.Ln=!1,t.On=new Map,t.Dn=new Set;var i=t.$n,r=yield t._instance.Un(t.jn(e));if(i===t.$n)switch(r.kind){case"ok":return;case"retry-later":return t.zn(e),void t.In();case"too-large":return void t.I.warn("Metrics batch exceeded the server size limit and was dropped");case"fatal":return void t.I.error("Failed to send metrics batch:",r.error)}}}))()}jn(t){return e=this.Wn(t),i=function(t,e,i){return p({},t.resourceAttributes,{"service.name":t.serviceName||"unknown_service"},t.environment&&{"deployment.environment":t.environment},t.serviceVersion&&{"service.version":t.serviceVersion},{"telemetry.sdk.name":e,"telemetry.sdk.version":i})}(this.qi,this._instance.getLibraryId(),this._instance.getLibraryVersion()),r=this._instance.getLibraryId(),n=this._instance.getLibraryVersion(),{resourceMetrics:[{resource:{attributes:He(i)},scopeMetrics:[{scope:{name:r,version:n},metrics:e}]}]};var e,i,r,n}Wn(t){var e=Xe(Date.now()),i=new Map;for(var r of t.values()){var n,s=ti(r.type,r.name,r.unit,void 0),o=i.get(s);o||(o=p({name:r.name},r.unit&&{unit:r.unit}),"count"===r.type?o.sum={aggregationTemporality:1,isMonotonic:!0,dataPoints:[]}:"gauge"===r.type?o.gauge={dataPoints:[]}:o.histogram={aggregationTemporality:1,dataPoints:[]},i.set(s,o));var a=He(null!==(n=r.attributes)&&void 0!==n?n:{},this.I),l=Xe(r.windowStartMs);if("count"===r.type){var u,h={attributes:a,startTimeUnixNano:l,timeUnixNano:e,asDouble:null!==(u=r.total)&&void 0!==u?u:0};o.sum.dataPoints.push(h)}else if("gauge"===r.type){var d,v={attributes:a,timeUnixNano:e,asDouble:null!==(d=r.last)&&void 0!==d?d:0};o.gauge.dataPoints.push(v)}else r.hist&&o.histogram.dataPoints.push({attributes:a,startTimeUnixNano:l,timeUnixNano:e,count:r.hist.count,sum:r.hist.sum,min:r.hist.min,max:r.hist.max,bucketCounts:r.hist.bucketCounts,explicitBounds:Ye})}return Array.from(i.values())}zn(t){var e,i;for(var r of t){var n=r[0],s=r[1],o=this.Fn.get(n);if(o)switch(o.windowStartMs=Math.min(o.windowStartMs,s.windowStartMs),o.type){case"count":o.total=(null!==(e=o.total)&&void 0!==e?e:0)+(null!==(i=s.total)&&void 0!==i?i:0);break;case"gauge":break;case"histogram":if(s.hist)if(o.hist){o.hist.count+=s.hist.count,o.hist.sum+=s.hist.sum,o.hist.min=Math.min(o.hist.min,s.hist.min),o.hist.max=Math.max(o.hist.max,s.hist.max);for(var a=0;o.hist.bucketCounts.length>a;a++)o.hist.bucketCounts[a]+=s.hist.bucketCounts[a]}else o.hist=s.hist}else this.Bn()&&this.Fn.set(n,s)}}};function ii(t,e){if(t){var i=t.find((t=>t.type===e));return null==i?void 0:i.value}}var ri,ni,si;function oi(t){var e=globalThis._posthogChunkIds;if(e){var i=Object.keys(e);return si&&i.length===ni||(ni=i.length,si=i.reduce(((i,r)=>{ri||(ri={});var n=ri[r];if(n)i[n[0]]=n[1];else for(var s=t(r),o=s.length-1;o>=0;o--){var a=s[o],l=null==a?void 0:a.filename,u=e[r];if(l&&u){i[l]=u,ri[r]=[l,u];break}}return i}),{})),si}}class ai{constructor(t,e,i){void 0===i&&(i=[]),this.coercers=t,this.stackParser=e,this.modifiers=i}buildFromUnknown(t,e){void 0===e&&(e={});var i=e&&e.mechanism||{handled:!0,type:"generic"},r=this.buildCoercingContext(i,e,0).apply(t),n=this.buildParsingContext(e),s=this.parseStacktrace(r,n);return{$exception_list:this.convertToExceptionList(s,i),$exception_level:"error"}}modifyFrames(t){var e=this;return f((function*(){for(var i of t)i.stacktrace&&i.stacktrace.frames&&rt(i.stacktrace.frames)&&(i.stacktrace.frames=yield e.applyModifiers(i.stacktrace.frames));return t}))()}coerceFallback(t){var e;return{type:"Error",value:"Unknown error",stack:null==(e=t.syntheticException)?void 0:e.stack,synthetic:!0}}parseStacktrace(t,e){var i,r;return null!=t.cause&&(i=this.parseStacktrace(t.cause,e)),""!=t.stack&&null!=t.stack&&(r=this.applyChunkIds(this.stackParser(t.stack,t.synthetic?e.skipFirstLines:0),e.chunkIdMap)),p({},t,{cause:i,stack:r})}applyChunkIds(t,e){return t.map((t=>(t.filename&&e&&(t.chunk_id=e[t.filename]),t)))}applyCoercers(t,e){for(var i of this.coercers)if(i.match(t))return i.coerce(t,e);return this.coerceFallback(e)}applyModifiers(t){var e=this;return f((function*(){var i=t;for(var r of e.modifiers)i=yield r(i);return i}))()}convertToExceptionList(t,e){var i,r,n,s={type:t.type,value:t.value,mechanism:{type:null!==(i=e.type)&&void 0!==i?i:"generic",handled:null===(r=e.handled)||void 0===r||r,synthetic:null!==(n=t.synthetic)&&void 0!==n&&n}};t.stack&&(s.stacktrace={type:"raw",frames:t.stack});var o=[s];return null!=t.cause&&o.push(...this.convertToExceptionList(t.cause,p({},e,{handled:!0}))),o}buildParsingContext(t){var e;return{chunkIdMap:oi(this.stackParser),skipFirstLines:null!==(e=t.skipFirstLines)&&void 0!==e?e:1}}buildCoercingContext(t,e,i){void 0===i&&(i=0);var r=(i,r)=>{if(4>=r){var n=this.buildCoercingContext(t,e,r);return this.applyCoercers(i,n)}};return p({},e,{syntheticException:0==i?e.syntheticException:void 0,mechanism:t,apply:t=>r(t,i),next:t=>r(t,i+1)})}}var li="?";function ui(t,e,i,r,n){var s={platform:t,filename:e,function:"<anonymous>"===i?li:i,in_app:!(null!=e&&e.startsWith("webkit-masked-url://"))&&"<anonymous>"!==e};return at(r)||(s.lineno=r),at(n)||(s.colno=n),s}var hi=(t,e)=>{var i=-1!==t.indexOf("safari-extension"),r=-1!==t.indexOf("safari-web-extension");return i||r?[-1!==t.indexOf("@")?t.split("@")[0]:li,i?"safari-extension:"+e:"safari-web-extension:"+e]:[t,e]},di=/^\s*at (\S+?)(?::(\d+))(?::(\d+))\s*$/i,vi=/^\s*at (?:(.+?\)(?: \[.+\])?|.*?) ?\((?:address at )?)?(?:async )?((?:<anonymous>|[-a-z]+:|.*bundle|\/)?.*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i,ci=/\((\S*)(?::(\d+))(?::(\d+))\)/,fi=(t,e)=>{var i=di.exec(t);if(i)return ui(e,i[1],li,+i[2],+i[3]);var r=vi.exec(t);if(r){if(r[2]&&0===r[2].indexOf("eval")){var n=ci.exec(r[2]);n&&(r[2]=n[1],r[3]=n[2],r[4]=n[3])}var s=hi(r[1]||li,r[2]);return ui(e,s[1],s[0],r[3]?+r[3]:void 0,r[4]?+r[4]:void 0)}},pi=/^\s*(.*?)(?:\((.*?)\))?(?:^|@)?((?:[-a-z]+)?:\/.*?|\[native code\]|[^@]*(?:bundle|\d+\.js)|\/[\w\-. /=]+)(?::(\d+))?(?::(\d+))?\s*$/i,gi=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i,mi=(t,e)=>{var i=pi.exec(t);if(i){if(i[3]&&i[3].indexOf(" > eval")>-1){var r=gi.exec(i[3]);r&&(i[1]=i[1]||"eval",i[3]=r[1],i[4]=r[2],i[5]="")}var n=i[3],s=i[1]||li,o=hi(s,n);return ui(e,n=o[1],s=o[0],i[4]?+i[4]:void 0,i[5]?+i[5]:void 0)}},yi=/\(error: (.*)\)/,_i=50;class bi{match(t){return this.isDOMException(t)||this.isDOMError(t)}coerce(t,e){var i=lt(t.stack);return{type:this.getType(t),value:this.getValue(t),stack:i?t.stack:void 0,cause:t.cause?e.next(t.cause):void 0,synthetic:!1}}getType(t){return this.isDOMError(t)?"DOMError":"DOMException"}getValue(t){var e=t.name||(this.isDOMError(t)?"DOMError":"DOMException");return t.message?e+": "+t.message:e}isDOMException(t){return _t(t,"DOMException")}isDOMError(t){return _t(t,"DOMError")}}class wi{match(t){return bt(t)}coerce(t,e){var i,r=this.getStack(t),n=void 0===r;return{type:this.getType(t),value:this.getMessage(t,e),stack:null!=r?r:null==(i=e.syntheticException)?void 0:i.stack,cause:t.cause?e.next(t.cause):void 0,synthetic:n}}getType(t){return t.name||t.constructor.name}getMessage(t,e){var i=t.message;return String(i.error&&"string"==typeof i.error.message?i.error.message:i)}getStack(t){return t.stacktrace||t.stack||void 0}}class ki{constructor(){}match(t){return!!_t(t,"ErrorEvent")&&(null!=t.error||this.fi(t))}coerce(t,e){var i;if(null!=t.error)return e.apply(t.error);var r=e.apply(t.message);return p({},r,{stack:null!==(i=this.pi(t))&&void 0!==i?i:r.stack,synthetic:!0})}fi(t){return lt(t.message)&&t.message.length>0}pi(t){var e,i,r=t,n=null!==(e=r.lineno)&&void 0!==e?e:0,s=null!==(i=r.colno)&&void 0!==i?i:0;if(lt(r.filename)&&0!==r.filename.length&&0!==n)return"Error\n at "+r.filename+":"+n+":"+s}}var Si=/^(?:[Uu]ncaught (?:exception: )?)?(?:((?:Eval|Internal|Range|Reference|Syntax|Type|URI|)Error): )?(.*)$/i;class xi{match(t){return"string"==typeof t}coerce(t,e){var i,r=this.getInfos(t),n=r[0],s=r[1];return{type:null!=n?n:"Error",value:null!=s?s:t,stack:null==(i=e.syntheticException)?void 0:i.stack,synthetic:!0}}getInfos(t){var e="Error",i=t,r=t.match(Si);return r&&(e=r[1],i=r[2]),[e,i]}}var Ci=["fatal","error","warning","log","info","debug"];function Ti(t,e){void 0===e&&(e=40);var i=Object.keys(t);if(i.sort(),!i.length)return"[object has no keys]";for(var r=i.length;r>0;r--){var n=i.slice(0,r).join(", ");if(e>=n.length)return r===i.length?n:n.length>e?n.slice(0,e)+"...":n}return""}class Ei{match(t){return"object"==typeof t&&null!==t}coerce(t,e){var i,r,n=this.getErrorPropertyFromObject(t);return n?e.apply(n):{type:this.getType(t),value:this.getValue(t),stack:null!==(i=this.getStack(t))&&void 0!==i?i:null==(r=e.syntheticException)?void 0:r.stack,level:this.isSeverityLevel(t.level)?t.level:"error",synthetic:!0}}getType(t){if(wt(t))return t.constructor.name;var e="name"in t?t.name:void 0;return lt(e)&&!ut(e)?e:"Error"}getValue(t){if("name"in t&&"string"==typeof t.name){var e="'"+t.name+"' captured as exception";return"message"in t&&"string"==typeof t.message&&(e+=" with message: '"+t.message+"'"),e}if("message"in t&&"string"==typeof t.message)return t.message;var i=this.getObjectClassName(t);return(i&&"Object"!==i?"'"+i+"'":"Object")+" captured as exception with keys: "+Ti(t)}isSeverityLevel(t){return lt(t)&&!ut(t)&&Ci.indexOf(t)>=0}getStack(t){try{return lt(t.stacktrace)&&t.stacktrace.length>0?t.stacktrace:lt(t.stack)&&t.stack.length>0?t.stack:void 0}catch(t){return}}getErrorPropertyFromObject(t){for(var e in t)if({}.hasOwnProperty.call(t,e)){var i=t[e];if(bt(i))return i}}getObjectClassName(t){try{var e=Object.getPrototypeOf(t);return e?e.constructor.name:void 0}catch(t){return}}}class Mi{match(t){return wt(t)}coerce(t,e){var i,r=t.constructor.name;return{type:r,value:r+" captured as exception with keys: "+Ti(t),stack:null==(i=e.syntheticException)?void 0:i.stack,synthetic:!0}}}class Ii{match(t){return yt(t)}coerce(t,e){var i;return{type:"Error",value:"Primitive value captured as exception: "+String(t),stack:null==(i=e.syntheticException)?void 0:i.stack,synthetic:!0}}}class Ri{match(t){return _t(t,"PromiseRejectionEvent")||this.isCustomEventWrappingRejection(t)}isCustomEventWrappingRejection(t){if(!wt(t))return!1;try{var e=t.detail;return null!=e&&"object"==typeof e&&"reason"in e}catch(t){return!1}}coerce(t,e){var i,r=this.getUnhandledRejectionReason(t);return yt(r)?{type:"UnhandledRejection",value:"Non-Error promise rejection captured with value: "+String(r),stack:null==(i=e.syntheticException)?void 0:i.stack,synthetic:!0}:e.apply(r)}getUnhandledRejectionReason(t){try{if("reason"in t)return t.reason;if("detail"in t&&null!=t.detail&&"object"==typeof t.detail&&"reason"in t.detail)return t.detail.reason}catch(t){}return t}}var Pi="$message",Ai="$timestamp",Oi=new Set([Pi,Ai]),Fi={enabled:!0,max_bytes:32768};function Li(t){var e;return t?{enabled:null!==(e=t.enabled)&&void 0!==e?e:Fi.enabled,max_bytes:Di(t.max_bytes,Fi.max_bytes)}:p({},Fi)}class $i{constructor(t){this.Vn=[],this.Gn=0,this.qi=Li(t)}setConfig(t){this.qi=Li(t),this.Zn()}add(t){var e=function(t){var e;try{e=X(t)}catch(t){return}try{var i=JSON.parse(e);if(!st(i))return;var r=i,n=r[Pi],s=r[Ai];if(!lt(n)||0===n.trim().length)return;if(!lt(s)&&!vt(s))return;return{step:r,json:e}}catch(t){return}}(t);if(e){var i=function(t){if("undefined"!=typeof TextEncoder)return(new TextEncoder).encode(t).length;for(var e=encodeURIComponent(t),i=0,r=0;e.length>r;r++)"%"===e[r]?(i+=1,r+=2):i+=1;return i}(e.json);i>this.qi.max_bytes||(this.Vn.push({step:e.step,bytes:i}),this.Gn+=i,this.Zn())}}getAttachable(){return this.Vn.map((t=>t.step))}clear(){this.Vn=[],this.Gn=0}size(){return this.Vn.length}Zn(){for(;this.Gn>this.qi.max_bytes&&this.Vn.length>0;){var t=this.Vn.shift();t&&(this.Gn-=t.bytes)}}}function Di(t,e){if(!vt(t)||t===1/0||t===-1/0)return e;var i=Math.floor(t);return 0>i?e:i}var Ni={DEBUG:!1,LIB_VERSION:"0.5.2",LIB_NAME:"browser-common"},qi=function(e,i){var r=(void 0===i?{}:i).debugEnabled,n={F(i){if(t&&(Ni.DEBUG||t.POSTHOG_DEBUG||r)&&!at(t.console)&&t.console){for(var n=("__rrweb_original__"in t.console[i]?t.console[i].__rrweb_original__:t.console[i]),s=arguments.length,o=new Array(s>1?s-1:0),a=1;s>a;a++)o[a-1]=arguments[a];n(e,...o)}},debug(){for(var t=arguments.length,e=new Array(t),i=0;t>i;i++)e[i]=arguments[i];n.F("debug",...e)},info(){for(var t=arguments.length,e=new Array(t),i=0;t>i;i++)e[i]=arguments[i];n.F("log",...e)},warn(){for(var t=arguments.length,e=new Array(t),i=0;t>i;i++)e[i]=arguments[i];n.F("warn",...e)},error(){for(var t=arguments.length,e=new Array(t),i=0;t>i;i++)e[i]=arguments[i];n.F("error",...e)},critical(){for(var t=arguments.length,i=new Array(t),r=0;t>r;r++)i[r]=arguments[r];console.error(e,...i)},uninitializedWarning(t){n.error("You must initialize PostHog before calling "+t)},createLogger:(t,i)=>qi(e+" "+t,i)};return n},ji=qi("[PostHog.js]"),Bi=ji.createLogger;function Ui(t,e){rt(t)&&t.forEach(e)}function Hi(t,e){if(!dt(t))if(rt(t))t.forEach(e);else if(pt(t))t.forEach(((t,i)=>e(t,i)));else for(var i in t)et.call(t,i)&&e(t[i],i)}var zi=function(t){for(var e=arguments.length,i=new Array(e>1?e-1:0),r=1;e>r;r++)i[r-1]=arguments[r];for(var n of i)for(var s in n)void 0!==n[s]&&(t[s]=n[s]);return t};function Wi(t){for(var e=Object.keys(t),i=e.length,r=new Array(i);i--;)r[i]=[e[i],t[e[i]]];return r}var Vi=function(t){try{return t()}catch(t){return}},Gi=function(t){return function(){try{for(var e=arguments.length,i=new Array(e),r=0;e>r;r++)i[r]=arguments[r];return t.apply(this,i)}catch(t){ji.critical("Implementation error. Please turn on debug mode and open a ticket on https://app.posthog.com/home#panel=support%3Asupport%3A."),ji.critical(t)}}},Zi=function(t){var e={};return Hi(t,(function(t,i){(lt(t)&&t.length>0||vt(t))&&(e[i]=t)})),e};var Qi=["herokuapp.com","vercel.app","netlify.app"];function Ji(t){var e=null==t?void 0:t.hostname;if(!lt(e))return!1;var i=e.split(".").slice(-2).join(".");for(var r of Qi)if(i===r)return!1;return!0}function Ki(t,e,i,r){var n=null!=r?r:{},s=n.capture,o=n.passive;null==t||t.addEventListener(e,i,{capture:void 0!==s&&s,passive:void 0===o||o})}function Yi(t){return"ph_toolbar_internal"===t.name}var Xi=["localhost","127.0.0.1"],tr=(t,e)=>{try{return JSON.stringify(t,((t,e)=>"bigint"==typeof e?e.toString():e),e)}catch(e){return X(t)}},er=t=>{var e=null==r?void 0:r.createElement("a");return at(e)?null:(e.href=t,e)},ir=function(t,e){var i,r;void 0===e&&(e="&");var n=[];return Hi(t,(function(t,e){at(t)||at(e)||"undefined"===e||(i=encodeURIComponent((t=>t instanceof File)(t)?t.name:t.toString()),r=encodeURIComponent(e),n[n.length]=r+"="+i)})),n.join(e)},rr=function(t,e){for(var i,r=((t.split("#")[0]||"").split(/\?(.*)/)[1]||"").replace(/^\?+/g,"").split("&"),n=0;r.length>n;n++){var s=r[n].split("=");if(s[0]===e){i=s;break}}if(!rt(i)||2>i.length)return"";var o=i[1];try{o=decodeURIComponent(o)}catch(t){ji.error("Skipping decoding for malformed query param: "+o)}return o.replace(/\+/g," ")},nr=function(t,e,i){if(!t||!e||!e.length)return t;for(var r=t.split("#"),n=r[1],s=(r[0]||"").split("?"),o=s[1],a=s[0],l=(o||"").split("&"),u=[],h=0;l.length>h;h++){var d=l[h].split("=");rt(d)&&(e.includes(d[0])?u.push(d[0]+"="+i):u.push(l[h]))}var v=a;return null!=o&&(v+="?"+u.join("&")),null!=n&&(v+="#"+n),v},sr=function(t,e){var i=t.match(new RegExp(e+"=([^&]*)"));return i?i[1]:null},or=(t,e)=>t>=e&&h(),ar=(t,e,i,r)=>{if(0===t){if(h()){var n=e+1;return n===i&&r(),n}return e}return 0};function lr(t,e){var i,r=null==t||null==(i=t.config)?void 0:i.get_current_url;if(!nt(r))return e;try{var n=r(e);return lt(n)&&n?n:e}catch(t){return ji.error("Error in get_current_url, falling back to window.location.href",t),e}}function ur(e){var i,r=null==t||null==(i=t.location)?void 0:i.href;return at(r)?void 0:lr(e,r)}var hr="__POSTHOG_TOOLBAR__",dr=1,vr=3,cr=11;function fr(t){return t instanceof Element&&(t.id===hr||!(null==t.closest||!t.closest(".toolbar-global-fade-container")))}function pr(t){return!!t&&t.nodeType===dr}function gr(t,e){return!!t&&!!t.tagName&&t.tagName.toLowerCase()===e.toLowerCase()}function mr(t){return!!t&&t.nodeType===vr}function yr(t){return!!t&&t.nodeType===cr&&pr(t.host)}var _r=1e3;function br(t){return t?K(t).split(/\s+/):[]}function wr(t,e){var i=ur(e);return!!(i&&t&&t.some((t=>i.match(t))))}function kr(t){var e="";switch(typeof t.className){case"string":e=t.className;break;case"object":e=(t.className&&"baseVal"in t.className?t.className.baseVal:null)||t.getAttribute("class")||"";break;default:e=""}return br(e)}function Sr(t){return dt(t)?null:K(t).split(/(\s+)/).filter((t=>Zr(t))).join("").replace(/[\r\n]/g," ").replace(/[ ]+/g," ").substring(0,255)}function xr(t){var e="";return qr(t)&&!jr(t)&&t.childNodes&&t.childNodes.length&&Hi(t.childNodes,(function(t){var i;mr(t)&&t.textContent&&(e+=null!==(i=Sr(t.textContent))&&void 0!==i?i:"")})),K(e)}function Cr(t){var e;return at(t.target)?t.srcElement||null:null!=(e=t.target)&&e.shadowRoot?t.composedPath()[0]||null:t.target||null}var Tr=["a","button","form","input","select","textarea","label"];function Er(t,e){if(at(e))return!0;var i,r=function(t){if(e.some((e=>function(t,e){var i=t.matches||t.matchesSelector||t.msMatchesSelector||t.mozMatchesSelector||t.webkitMatchesSelector||t.oMatchesSelector;try{return!!i&&i.call(t,e)}catch(t){return!1}}(t,e))))return{v:!0}};for(var n of t)if(i=r(n))return i.v;return!1}function Mr(t){var e=t.parentNode;return!(!e||!pr(e))&&e}var Ir=[".ph-no-autocapture","[data-ph-no-autocapture]"],Rr=["next","previous","prev",">","<"],Pr=[...Rr,"+","-","−","–"],Ar=(t,e)=>/[a-z0-9]/i.test(e)?t.includes(e):t===e,Or=[".ph-no-deadclick",".ph-no-capture"],Fr=[".ph-no-rageclick",".ph-no-capture"],Lr=["","text","search","email","password","url","tel","number"];function $r(e,i){if(!t||Dr(e))return!1;var r,n,s,o,a;if(ft(i)?(r=!!i&&Fr,n=void 0,s=!1):(r=null!==(o=null==i?void 0:i.css_selector_ignorelist)&&void 0!==o?o:Fr,n=null==i?void 0:i.content_ignorelist,s=null!==(a=null==i?void 0:i.ignore_text_selection)&&void 0!==a&&a),!1===r)return!1;if(s&&function(t){return!(!t||!pr(t))&&(!!gr(t,"textarea")||(gr(t,"input")?J(Lr,(t.getAttribute("type")||"").toLowerCase()):function(t){if(t.isContentEditable)return!0;var e=null==t.getAttribute?void 0:t.getAttribute("contenteditable");return"true"===e||""===e}(t)))}(e))return!1;var l=Nr(e,!1).targetElementList;return!function(t,e){if(!1===t||at(t))return!1;var i;if(!0===t)i=Rr;else{if(!rt(t))return!1;if(t.length>10)return ji.error("[PostHog] content_ignorelist array cannot exceed 10 items. Use css_selector_ignorelist for more complex matching."),!1;i=t.map((t=>t.toLowerCase()))}return e.some((t=>{var e=t.safeText,r=t.ariaLabel;return i.some((t=>Ar(e,t)||Ar(r,t)))}))}(n,l.map((t=>{var e;return{safeText:xr(t).toLowerCase(),ariaLabel:(null==(e=t.getAttribute("aria-label"))?void 0:e.toLowerCase().trim())||""}})))&&!Er(l,r)}var Dr=t=>!t||gr(t,"html")||!pr(t),Nr=(e,i)=>{if(!t||Dr(e))return{parentIsUsefulElement:!1,targetElementList:[]};for(var r=!1,n=[e],s=e;s.parentNode&&!gr(s,"body");)if(yr(s.parentNode))n.push(s.parentNode.host),s=s.parentNode.host;else{var o=Mr(s);if(!o)break;if(i||Tr.indexOf(o.tagName.toLowerCase())>-1)r=!0;else try{var a=t.getComputedStyle(o);a&&"pointer"===a.getPropertyValue("cursor")&&(r=!0)}catch(t){}n.push(o),s=o}return{parentIsUsefulElement:r,targetElementList:n}};function qr(t){for(var e=new Set,i=0,r=t;r.parentNode&&!gr(r,"body");r=r.parentNode){if(i++>=_r||e.has(r))return!1;e.add(r);var n=kr(r);if(J(n,"ph-sensitive")||J(n,"ph-no-capture"))return!1}if(J(kr(t),"ph-include"))return!0;var s=t.type||"";if(lt(s))switch(s.toLowerCase()){case"hidden":case"password":return!1}var o=t.name||t.id||"";return!lt(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 jr(t){return!!(gr(t,"input")&&!["button","checkbox","submit","reset"].includes(t.type)||gr(t,"select")||gr(t,"textarea")||"true"===t.getAttribute("contenteditable"))}var Br=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}))$"),Ur=/(^|[^0-9A-Za-z_])([0-9][0-9 -]*[0-9])(?=$|[^0-9A-Za-z_])/g,Hr=[16,15,14,13],zr=new RegExp("^(\\d{3}-?\\d{2}-?\\d{4})$"),Wr=new RegExp("(^|[^0-9])((?!000|666)[0-9]{3}-?(?!00)[0-9]{2}-?(?!0000)[0-9]{4})(?=$|([^0-9]))","g"),Vr=/[0-9A-Za-z_]/;function Gr(t){for(var e=0,i=!1,r=t.length-1;r>=0;r--){var n=t.charCodeAt(r)-48;i&&(n*=2)>9&&(n-=9),e+=n,i=!i}return e%10==0}function Zr(t,e){if(void 0===e&&(e=!0),dt(t))return!1;if(lt(t)){t=K(t);var i=e?Br.test((t||"").replace(/[- ]/g,"")):function(t){var e;for(Ur.lastIndex=0;e=Ur.exec(t);){var i=e[2];if(i)for(var r=i.replace(/[- ]/g,""),n=0;r.length>n;n++)for(var s of Hr){var o=n+s;if(r.length>=o){var a=r.slice(n,o);if(Br.test(a)&&Gr(a))return!0}}}return!1}(t);if(i)return!1;var r=e?zr.test(t):function(t){var e;for(Wr.lastIndex=0;e=Wr.exec(t);){var i=e[1],r=e[3];if(!(i&&r&&Vr.test(i)&&Vr.test(r)))return!0}return!1}(t);if(r)return!1}return!0}function Qr(t){var e=xr(t);return Zr(e=(e+" "+Jr(t)).trim())?e:""}function Jr(t){var e="";return t&&t.childNodes&&t.childNodes.length&&Hi(t.childNodes,(function(t){var i;if(t&&"span"===(null==(i=t.tagName)?void 0:i.toLowerCase()))try{var r=xr(t);e=(e+" "+r).trim(),t.childNodes&&t.childNodes.length&&(e=(e+" "+Jr(t)).trim())}catch(t){ji.error("[AutoCapture]",t)}})),e}function Kr(t){return t.replace(/"|\\"/g,'\\"')}function Yr(t){var e=t.attr__class;if(e)return rt(e)?e:br(e)}var Xr="[SessionRecording]",tn="redacted",en=1e6;function rn(t){var e;return Math.min(en,null!==(e=t.payloadSizeLimitBytes)&&void 0!==e?e:en)}var nn={initiatorTypes:["audio","beacon","body","css","early-hint","embed","fetch","frame","iframe","icon","image","img","input","link","navigation","object","ping","script","track","video","xmlhttprequest"],maskRequestFn:t=>t,recordHeaders:!1,recordBody:!1,recordInitialRequests:!1,recordPerformance:!1,performanceEntryTypeToObserve:["first-input","navigation","paint","resource"],payloadSizeLimitBytes:en,payloadHostDenyList:[".lr-ingest.io",".ingest.sentry.io",".clarity.ms","google-analytics.com","analytics.google.com","nr-data.net","datadoghq.com","datadoghq.eu","ddog-gov.com","segment.io","rudderstack.com","amplitude.com","mixpanel.com","hotjar.com","hotjar.io","fullstory.com"],streamNetworkBody:!1},sn=["authorization","x-forwarded-for","authorization","cookie","set-cookie","x-api-key","x-real-ip","remote-addr","forwarded","proxy-authorization","x-csrf-token","x-csrftoken","x-xsrf-token"],on=["password","secret","passwd","api_key","apikey","auth","credentials","mysql_pwd","privatekey","private_key","token"],an=["auth","token","secret","session","api-key","apikey","api_key","credential","password","passwd","cookie","csrf","xsrf"],ln=t=>{dt(t)||Hi(Object.keys(t),(e=>{(t=>{var e=t.toLowerCase();return sn.includes(e)||an.some((t=>e.includes(t)))})(e)&&(t[e]=tn)}))},un=["/s/","/e/","/i/"];function hn(t,e,i,r){if(dt(t))return t;var n=(null==e?void 0:e["content-length"])||function(t){return new Blob([t]).size}(t);return lt(n)&&(n=parseInt(n)),n>i?Xr+" "+r+" body too large to record ("+n+" bytes)":t}function dn(t,e){if(dt(t))return t;var i=t;return Zr(i,!1)||(i=Xr+" "+e+" body "+tn),Hi(on,(t=>{var r,n;null!=(r=i)&&r.length&&-1!==(null==(n=i)?void 0:n.indexOf(t))&&(i=Xr+" "+e+" body "+tn+" as might contain: "+t)})),i}var vn=new WeakSet,cn="$people_distinct_id",fn="distinct_id",pn="$device_id",gn="$device_model",mn="__alias",yn="__timers",_n="$autocapture_disabled_server_side",bn="$heatmaps_enabled_server_side",wn="$exception_capture_enabled_server_side",kn="$error_tracking_suppression_rules",Sn="$error_tracking_capture_extension_exceptions",xn="$web_vitals_enabled_server_side",Cn="$dead_clicks_enabled_server_side",Tn="$product_tours_enabled_server_side",En="$web_vitals_allowed_metrics",Mn="$session_recording_remote_config",In="$replay_sample_rate",Rn="$replay_override_sampling",Pn="$replay_override_linked_flag",An="$replay_override_url_trigger",On="$replay_override_event_trigger",Fn="$sesid",Ln="$session_is_sampled",$n="$session_past_minimum_duration",Dn="$session_recording_url_trigger_activated_session",Nn="$session_recording_event_trigger_activated_session",qn="$posthog_sr_group_event_trigger_",jn="$posthog_sr_group_url_trigger_",Bn="$posthog_sr_group_sampling_",Un="$debug_first_full_snapshot_timestamp",Hn="$sess_rec_flush_size",zn="$enabled_feature_flags",Wn="$active_feature_flags",Vn="$early_access_features",Gn="$feature_flag_details",Zn="$feature_flag_payloads",Qn="$feature_flag_request_id",Jn="$minimal_flag_called_events",Kn="$override_feature_flags",Yn="$override_feature_flag_payloads",Xn="$stored_person_properties",ts="$stored_group_properties",es="$groups",is="$surveys",rs="$surveys_loaded_at",ns="$surveys_activated",ss="$surveys_activated_session",os="$surveys_activated_timestamps",as="ph_product_tours",ls="$flag_call_reported",us="$flag_call_reported_session_id",hs="$feature_flag_errors",ds="$feature_flag_evaluated_at",vs="$user_state",cs="$client_session_props",fs="$capture_rate_limit",ps="$initial_campaign_params",gs="$initial_referrer_info",ms="$initial_person_info",ys="$epp",_s="$posthog_cookieless",bs="$cookieless_mode",ws="$sdk_debug_extensions_init_method",ks="$sdk_debug_extensions_init_time_ms",Ss="$sdk_debug_recording_script_not_loaded",xs="$sdk_debug_replay_event_trigger_status",Cs="$sdk_debug_replay_linked_flag_trigger_status",Ts="$sdk_debug_replay_matched_recording_trigger_groups",Es="$sdk_debug_replay_pending_trigger_conditions",Ms="$sdk_debug_replay_remote_trigger_matching_config",Is="$sdk_debug_replay_trigger_groups_count",Rs="$sdk_debug_replay_url_trigger_status",Ps="$session_recording_start_reason",As="PostHog loadExternalDependency extension not found.",Os="on_reject",Fs="always",Ls="anonymous",$s="identified",Ds="identified_only",Ns="visibilitychange",qs="beforeunload",js="$pageview",Bs="$pageleave",Us="$identify",Hs="$groupidentify",zs="disabled",Ws="sampled",Vs="active",Gs="buffering",Zs="paused",Qs="lazy_loading",Js="awaiting_config",Ks="missing_config",Ys="rrweb_error",Xs="trigger",to=Xs+"_activated",eo=Xs+"_pending",io=Xs+"_"+zs;function ro(t,e,i,r,n,s){return 0===e?io:(null==t?void 0:t.get_property(i?r+i:n))===s?to:eo}function no(t,e,i){return e.some((e=>{var r;return"regex"===e.matching&&(null!==(r=null==i?void 0:i.get(e.url))&&void 0!==r?r:new RegExp(e.url)).test(t)}))}function so(t){return t.includes(to)?to:t.includes(eo)?eo:io}function oo(t){var e=new Set(t);switch(e.delete(io),e.size){case 0:return io;case 1:return Array.from(e)[0];default:return eo}}class ao{constructor(t){this.N=t}triggerStatus(t){return so(this.N.map((e=>e.triggerStatus(t))))}triggerStatusNoSideEffects(t){return so(this.N.map((e=>e.triggerStatusNoSideEffects(t))))}stop(){this.N.forEach((t=>t.stop()))}}class lo{constructor(t){this.N=t}triggerStatus(t){return oo(this.N.map((e=>e.triggerStatus(t))))}triggerStatusNoSideEffects(t){return oo(this.N.map((e=>e.triggerStatusNoSideEffects(t))))}stop(){this.N.forEach((t=>t.stop()))}}class uo{triggerStatus(){return this.triggerStatusNoSideEffects()}triggerStatusNoSideEffects(){return to}stop(){}}var ho=t=>"sessionRecording"in t;class vo{constructor(t,e){this.P=[],this.q=[],this.j=new Map,this.B=new Map,this.H="",this.urlBlocked=!1,this._instance=t,this.$=e}onConfig(t){var e,i;this.P=(ho(t)?st(t.sessionRecording)?null==(e=t.sessionRecording)?void 0:e.urlTriggers:[]:null==t?void 0:t.urlTriggers)||[],this.q=(ho(t)?st(t.sessionRecording)?null==(i=t.sessionRecording)?void 0:i.urlBlocklist:[]:null==t?void 0:t.urlBlocklist)||[],this.U()}U(){for(var t of(this.j.clear(),this.B.clear(),this.P))if("regex"===t.matching&&!this.j.has(t.url))try{this.j.set(t.url,new RegExp(t.url))}catch(e){ji.error("Invalid URL trigger regex pattern:",t.url,e)}for(var e of this.q)if("regex"===e.matching&&!this.B.has(e.url))try{this.B.set(e.url,new RegExp(e.url))}catch(t){ji.error("Invalid URL blocklist regex pattern:",e.url,t)}}onRemoteConfig(t){this.onConfig(t)}W(t){return ro(this._instance,this.P.length,this.$,jn,Dn,t)}triggerStatus(t){var e=this.triggerStatusNoSideEffects(t);return this._instance.register_for_session({[Rs]:e}),e}triggerStatusNoSideEffects(t){return this.W(t)}checkUrlBlocklist(t,e){var i=ur(this._instance);if(i&&i!==this.H){this.H=i;var r=this.urlBlocked,n=no(i,this.q,this.B);r&&n||(n&&!r?t():!n&&r&&e())}}checkUrlTriggerConditions(t,e,i,r){var n=ur(this._instance);if(n&&n!==this.H){this.H=n;var s=this.urlBlocked,o=no(n,this.q,this.B);o&&!s?t():!o&&s&&e();var a=this.W(r)===to,l=no(n,this.P,this.j);!a&&l&&i("url",n)}}stop(){this.H=""}}class co{constructor(t){this.linkedFlag=null,this.linkedFlagSeen=!1,this.V=()=>{},this._instance=t}triggerStatus(){var t=this.triggerStatusNoSideEffects();return this._instance.register_for_session({[Cs]:t}),t}triggerStatusNoSideEffects(){var t=eo;return dt(this.linkedFlag)&&(t=io),this.linkedFlagSeen&&(t=to),t}onConfig(t,e){var i;if(this.linkedFlag=(ho(t)?st(t.sessionRecording)?null==(i=t.sessionRecording)?void 0:i.linkedFlag:null:null==t?void 0:t.linkedFlag)||null,!dt(this.linkedFlag)&&!this.linkedFlagSeen){var r=lt(this.linkedFlag)?this.linkedFlag:this.linkedFlag.flag,n=lt(this.linkedFlag)?null:this.linkedFlag.variant;this.V=this._instance.onFeatureFlags(((t,i)=>{var s=!1;if(st(i)&&r in i){var o=i[r];s=ft(o)?!0===o:n?o===n:!!o}var a=s&&!this.linkedFlagSeen;this.linkedFlagSeen=s,a&&e(r,n)}))}}onRemoteConfig(t,e){this.onConfig(t,e)}stop(){this.V()}}class fo{constructor(t,e){this.Z=[],this._instance=t,this.$=e}onConfig(t){var e;this.Z=(ho(t)?st(t.sessionRecording)?null==(e=t.sessionRecording)?void 0:e.eventTriggers:[]:null==t?void 0:t.eventTriggers)||[]}onRemoteConfig(t){this.onConfig(t)}G(t){return ro(this._instance,this.Z.length,this.$,qn,Nn,t)}triggerStatus(t){var e=this.triggerStatusNoSideEffects(t);return this._instance.register_for_session({[xs]:e}),e}triggerStatusNoSideEffects(t){return this.G(t)}checkEventTriggerConditions(t,e,i){if(0!==this.Z.length){var r=this.G(i)===to,n=this.Z.includes(t);!r&&n&&e("event",t)}}stop(){}}class po{constructor(t,e,i){if(this._instance=t,this.group=e,this.Y=new vo(t,e.id),this.J=new fo(t,e.id),this.K=new co(t),e.conditions.events&&e.conditions.events.length>0||e.conditions.urls&&e.conditions.urls.length>0||e.conditions.flag){var r=(e.conditions.events||[]).map((t=>t.name)),n={urlTriggers:e.conditions.urls||[],eventTriggers:r,linkedFlag:e.conditions.flag||null,urlBlocklist:[]};this.Y.onConfig(n),this.J.onConfig(n),this.K.onConfig(n,i);var s=[this.J,this.Y,this.K];this.X="any"===e.conditions.matchType?new ao(s):new lo(s)}else this.X=new uo}triggerStatus(t){return this.X.triggerStatus(t)}triggerStatusNoSideEffects(t){return this.X.triggerStatusNoSideEffects(t)}getPendingTriggerConditions(t){return this.triggerStatusNoSideEffects(t)!==eo?[]:[{label:"URL condition not matched",status:this.Y.triggerStatusNoSideEffects(t)},{label:"event condition not matched",status:this.J.triggerStatusNoSideEffects(t)},{label:"linked flag condition not matched",status:this.K.triggerStatusNoSideEffects()}].filter((t=>t.status===eo)).map((t=>t.label))}checkEventTriggerConditions(t,e,i){this.J.checkEventTriggerConditions(t,e,i)}checkUrlTriggerConditions(t,e,i,r){this.Y.checkUrlTriggerConditions(t,e,i,r)}activateTrigger(t,e){var i;null==(i=this._instance.persistence)||i.register({["url"===t?jn+this.group.id:qn+this.group.id]:e})}stop(){this.Y.stop(),this.J.stop(),this.K.stop()}}function go(t){if(t.rrwebError)return Ys;if(!t.receivedFlags)return Gs;if(!t.isRecordingEnabled)return zs;if(t.urlTriggerMatching.urlBlocked)return Zs;var e=!0===t.isSampled,i=new ao([t.eventTriggerMatching,t.urlTriggerMatching,t.linkedFlagMatching]).triggerStatus(t.sessionId);return e?Ws:i===to?Vs:i===eo?Gs:!1===t.isSampled?zs:Vs}function mo(t){if(t.rrwebError)return Ys;if(!t.receivedFlags)return Gs;if(!t.isRecordingEnabled)return zs;if(t.urlTriggerMatching.urlBlocked)return Zs;var e=new lo([t.eventTriggerMatching,t.urlTriggerMatching,t.linkedFlagMatching]).triggerStatus(t.sessionId),i=e!==io,r=ft(t.isSampled);return i&&e===eo?Gs:i&&e===io||r&&!t.isSampled?zs:!0===t.isSampled?Ws:Vs}function yo(){var t=[];return function(e,i){if(st(i)||rt(i)){for(;t.length>0&&t[t.length-1]!==this;)t.pop();return t.includes(i)?"[Circular]":(t.push(i),i)}return i}}function _o(t){var e=JSON.stringify(t,yo());return e?new Blob([e]).size:0}function bo(t){if(ht(t))return 4;if(at(t))return 0;switch(typeof t){case"string":return t.length+2;case"number":return String(t).length;case"boolean":return t?4:5;case"object":if(rt(t)){for(var e=2,i=0;t.length>i;i++){i>0&&(e+=1);var r=t[i];e+=at(r)||ht(r)?4:bo(r)}return e}var n=t,s=2,o=!0;for(var a in n)if({}.hasOwnProperty.call(n,a)){var l=n[a];at(l)||(o||(s+=1),o=!1,s+=a.length+3+bo(l))}return s;default:return 0}}function wo(t,e){if(void 0===e&&(e=6606028.8),t.size>=e&&t.data.length>1){var i=Math.floor(t.data.length/2),r=t.sizes.slice(0,i),n=t.sizes.slice(i);return[wo({size:r.reduce(((t,e)=>t+e),0),data:t.data.slice(0,i),sizes:r,sessionId:t.sessionId,windowId:t.windowId}),wo({size:n.reduce(((t,e)=>t+e),0),data:t.data.slice(i),sizes:n,sessionId:t.sessionId,windowId:t.windowId})].flatMap((t=>t))}return[t]}var ko=Uint8Array,So=Uint16Array,xo=Uint32Array,Co=new ko([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]),To=new ko([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]),Eo=new ko([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),Mo=function(t,e){for(var i=new So(31),r=0;31>r;++r)i[r]=e+=1<<t[r-1];var n=new xo(i[30]);for(r=1;30>r;++r)for(var s=i[r];i[r+1]>s;++s)n[s]=s-i[r]<<5|r;return[i,n]},Io=Mo(Co,2),Ro=Io[1];Io[0][28]=258,Ro[258]=28;for(var Po=Mo(To,0)[1],Ao=new So(32768),Oo=0;32768>Oo;++Oo){var Fo=(43690&Oo)>>>1|(21845&Oo)<<1;Ao[Oo]=((65280&(Fo=(61680&(Fo=(52428&Fo)>>>2|(13107&Fo)<<2))>>>4|(3855&Fo)<<4))>>>8|(255&Fo)<<8)>>>1}var Lo=function(t,e,i){for(var r=t.length,n=0,s=new So(e);r>n;++n)++s[t[n]-1];var o,a=new So(e);for(n=0;e>n;++n)a[n]=a[n-1]+s[n-1]<<1;if(i){o=new So(1<<e);var l=15-e;for(n=0;r>n;++n)if(t[n])for(var u=n<<4|t[n],h=e-t[n],d=a[t[n]-1]++<<h,v=d|(1<<h)-1;v>=d;++d)o[Ao[d]>>>l]=u}else for(o=new So(r),n=0;r>n;++n)o[n]=Ao[a[t[n]-1]++]>>>15-t[n];return o},$o=new ko(288);for(Oo=0;144>Oo;++Oo)$o[Oo]=8;for(Oo=144;256>Oo;++Oo)$o[Oo]=9;for(Oo=256;280>Oo;++Oo)$o[Oo]=7;for(Oo=280;288>Oo;++Oo)$o[Oo]=8;var Do=new ko(32);for(Oo=0;32>Oo;++Oo)Do[Oo]=5;var No=Lo($o,9,0),qo=Lo(Do,5,0),jo=function(t){return(t/8>>0)+(7&t&&1)},Bo=function(t,e,i){(null==i||i>t.length)&&(i=t.length);var r=new(t instanceof So?So:t instanceof xo?xo:ko)(i-e);return r.set(t.subarray(e,i)),r},Uo=function(t,e,i){var r=e/8>>0;t[r]|=i<<=7&e,t[r+1]|=i>>>8},Ho=function(t,e,i){var r=e/8>>0;t[r]|=i<<=7&e,t[r+1]|=i>>>8,t[r+2]|=i>>>16},zo=function(t,e){for(var i=[],r=0;t.length>r;++r)t[r]&&i.push({s:r,f:t[r]});var n=i.length,s=i.slice();if(!n)return[new ko(0),0];if(1==n){var o=new ko(i[0].s+1);return o[i[0].s]=1,[o,1]}i.sort((function(t,e){return t.f-e.f})),i.push({s:-1,f:25001});var a=i[0],l=i[1],u=0,h=1,d=2;for(i[0]={s:-1,f:a.f+l.f,l:a,r:l};h!=n-1;)a=i[i[d].f>i[u].f?u++:d++],l=i[u!=h&&i[d].f>i[u].f?u++:d++],i[h++]={s:-1,f:a.f+l.f,l:a,r:l};var v=s[0].s;for(r=1;n>r;++r)s[r].s>v&&(v=s[r].s);var c=new So(v+1),f=Wo(i[h-1],c,0);if(f>e){r=0;var p=0,g=f-e,m=1<<g;for(s.sort((function(t,e){return c[e.s]-c[t.s]||t.f-e.f}));n>r;++r){var y=s[r].s;if(e>=c[y])break;p+=m-(1<<f-c[y]),c[y]=e}for(p>>>=g;p>0;){var _=s[r].s;e>c[_]?p-=1<<e-c[_]++-1:++r}for(;r>=0&&p;--r){var b=s[r].s;c[b]==e&&(--c[b],++p)}f=e}return[new ko(c),f]},Wo=function(t,e,i){return-1==t.s?Math.max(Wo(t.l,e,i+1),Wo(t.r,e,i+1)):e[t.s]=i},Vo=function(t){for(var e=t.length;e&&!t[--e];);for(var i=new So(++e),r=0,n=t[0],s=1,o=function(t){i[r++]=t},a=1;e>=a;++a)if(t[a]==n&&a!=e)++s;else{if(!n&&s>2){for(;s>138;s-=138)o(32754);s>2&&(o(s>10?s-11<<5|28690:s-3<<5|12305),s=0)}else if(s>3){for(o(n),--s;s>6;s-=6)o(8304);s>2&&(o(s-3<<5|8208),s=0)}for(;s--;)o(n);s=1,n=t[a]}return[i.subarray(0,r),e]},Go=function(t,e){for(var i=0,r=0;e.length>r;++r)i+=t[r]*e[r];return i},Zo=function(t,e,i){var r=i.length,n=jo(e+2);t[n]=255&r,t[n+1]=r>>>8,t[n+2]=255^t[n],t[n+3]=255^t[n+1];for(var s=0;r>s;++s)t[n+s+4]=i[s];return 8*(n+4+r)},Qo=function(t,e,i,r,n,s,o,a,l,u,h){Uo(e,h++,i),++n[256];for(var d=zo(n,15),v=d[0],c=d[1],f=zo(s,15),p=f[0],g=f[1],m=Vo(v),y=m[0],_=m[1],b=Vo(p),w=b[0],k=b[1],S=new So(19),x=0;y.length>x;++x)S[31&y[x]]++;for(x=0;w.length>x;++x)S[31&w[x]]++;for(var C=zo(S,7),T=C[0],E=C[1],M=19;M>4&&!T[Eo[M-1]];--M);var I,R,P,A,O=u+5<<3,F=Go(n,$o)+Go(s,Do)+o,L=Go(n,v)+Go(s,p)+o+14+3*M+Go(S,T)+(2*S[16]+3*S[17]+7*S[18]);if(F>=O&&L>=O)return Zo(e,h,t.subarray(l,l+u));if(Uo(e,h,1+(F>L)),h+=2,F>L){I=Lo(v,c,0),R=v,P=Lo(p,g,0),A=p;var D=Lo(T,E,0);for(Uo(e,h,_-257),Uo(e,h+5,k-1),Uo(e,h+10,M-4),h+=14,x=0;M>x;++x)Uo(e,h+3*x,T[Eo[x]]);h+=3*M;for(var N=[y,w],q=0;2>q;++q){var j=N[q];for(x=0;j.length>x;++x)Uo(e,h,D[B=31&j[x]]),h+=T[B],B>15&&(Uo(e,h,j[x]>>>5&127),h+=j[x]>>>12)}}else I=No,R=$o,P=qo,A=Do;for(x=0;a>x;++x)if(r[x]>255){var B;Ho(e,h,I[257+(B=r[x]>>>18&31)]),h+=R[B+257],B>7&&(Uo(e,h,r[x]>>>23&31),h+=Co[B]);var U=31&r[x];Ho(e,h,P[U]),h+=A[U],U>3&&(Ho(e,h,r[x]>>>5&8191),h+=To[U])}else Ho(e,h,I[r[x]]),h+=R[r[x]];return Ho(e,h,I[256]),h+R[256]},Jo=new xo([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),Ko=function(){for(var t=new xo(256),e=0;256>e;++e){for(var i=e,r=9;--r;)i=(1&i&&3988292384)^i>>>1;t[e]=i}return t}(),Yo=function(){var t=4294967295;return{p(e){for(var i=t,r=0;e.length>r;++r)i=Ko[255&i^e[r]]^i>>>8;t=i},d:()=>4294967295^t}},Xo=function(t,e,i,r,n){return function(t,e,i,r,n,s){var o=t.length,a=new ko(r+o+5*(1+Math.floor(o/7e3))+n),l=a.subarray(r,a.length-n),u=0;if(!e||8>o)for(var h=0;o>=h;h+=65535){var d=h+65535;o>d?u=Zo(l,u,t.subarray(h,d)):(l[h]=true,u=Zo(l,u,t.subarray(h,o)))}else{for(var v=Jo[e-1],c=v>>>13,f=8191&v,p=(1<<i)-1,g=new So(32768),m=new So(p+1),y=Math.ceil(i/3),_=2*y,b=function(e){return(t[e]^t[e+1]<<y^t[e+2]<<_)&p},w=new xo(25e3),k=new So(288),S=new So(32),x=0,C=0,T=(h=0,0),E=0,M=0;o>h;++h){var I=b(h),R=32767&h,P=m[I];if(g[R]=P,m[I]=R,h>=E){var A=o-h;if((x>7e3||T>24576)&&A>423){u=Qo(t,l,0,w,k,S,C,T,M,h-M,u),T=x=C=0,M=h;for(var O=0;286>O;++O)k[O]=0;for(O=0;30>O;++O)S[O]=0}var F=2,L=0,D=f,N=R-P&32767;if(A>2&&I==b(h-N))for(var q=Math.min(c,A)-1,j=Math.min(32767,h),B=Math.min(258,A);j>=N&&--D&&R!=P;){if(t[h+F]==t[h+F-N]){for(var U=0;B>U&&t[h+U]==t[h+U-N];++U);if(U>F){if(F=U,L=N,U>q)break;var H=Math.min(N,U-2),z=0;for(O=0;H>O;++O){var W=h-N+O+32768&32767,V=W-g[W]+32768&32767;V>z&&(z=V,P=W)}}}N+=(R=P)-(P=g[R])+32768&32767}if(L){w[T++]=268435456|Ro[F]<<18|Po[L];var G=31&Ro[F],Z=31&Po[L];C+=Co[G]+To[Z],++k[257+G],++S[Z],E=h+F,++x}else w[T++]=t[h],++k[t[h]]}}u=Qo(t,l,true,w,k,S,C,T,M,h-M,u)}return Bo(a,0,r+jo(u)+n)}(t,null==e.level?6:e.level,null==e.mem?Math.ceil(1.5*Math.max(8,Math.min(13,Math.log(t.length)))):12+e.mem,i,r)},ta=function(t,e,i){for(;i;++e)t[e]=i,i>>>=8},ea=function(t,e){var i=e.filename;if(t[0]=31,t[1]=139,t[2]=8,t[8]=2>e.level?4:9==e.level?2:0,t[9]=3,0!=e.mtime&&ta(t,4,Math.floor(new Date(e.mtime||Date.now())/1e3)),i){t[3]=8;for(var r=0;i.length>=r;++r)t[r+10]=i.charCodeAt(r)}},ia=function(t){return 10+(t.filename&&t.filename.length+1||0)};function ra(t,e){void 0===e&&(e={});var i=Yo(),r=t.length;i.p(t);var n=Xo(t,e,ia(e),8),s=n.length;return ea(n,e),ta(n,s-8,i.d()),ta(n,s-4,r),n}function na(t,e){var i=t.length;if("undefined"!=typeof TextEncoder)return(new TextEncoder).encode(t);for(var r=new ko(t.length+(t.length>>>1)),n=0,s=function(t){r[n++]=t},o=0;i>o;++o){if(n+5>r.length){var a=new ko(n+8+(i-o<<1));a.set(r),r=a}var l=t.charCodeAt(o);128>l||e?s(l):2048>l?(s(192|l>>>6),s(128|63&l)):l>55295&&57344>l?(s(240|(l=65536+(1047552&l)|1023&t.charCodeAt(++o))>>>18),s(128|l>>>12&63),s(128|l>>>6&63),s(128|63&l)):(s(224|l>>>12),s(128|l>>>6&63),s(128|63&l))}return Bo(r,0,n)}function sa(t,e){for(var i="",r=0;t.length>r;){var n=t[r++];i+=String.fromCharCode(n)}return i}class oa{constructor(t,e){var i,r;void 0===e&&(e={}),this.ee={},this.te=t=>{if(!this.ee[t]){var e,i;this.ee[t]=!0;var r=this.re(t);null==(e=(i=this.ie).onBlockedNode)||e.call(i,t,r)}},this.ne=t=>{var e=this.re(t);if("svg"!==(null==e?void 0:e.nodeName)&&e instanceof Element){var i=e.closest("svg");if(i)return[this._rrweb.mirror.getId(i),i]}return[t,e]},this.re=t=>this._rrweb.mirror.getNode(t),this.ae=t=>{var e,i,r,n,s,o,a,l;return(null!==(e=null==(i=t.removes)?void 0:i.length)&&void 0!==e?e:0)+(null!==(r=null==(n=t.attributes)?void 0:n.length)&&void 0!==r?r:0)+(null!==(s=null==(o=t.texts)?void 0:o.length)&&void 0!==s?s:0)+(null!==(a=null==(l=t.adds)?void 0:l.length)&&void 0!==a?a:0)},this.throttleMutations=t=>{if(3!==t.type||0!==t.data.source)return t;var e=t.data,i=this.ae(e);e.attributes&&(e.attributes=e.attributes.filter((t=>{var e=this.ne(t.id);return!this.oe.consumeRateLimit(e[0])&&t})));var r=this.ae(e);return 0!==r||i===r?t:void 0},this._rrweb=t,this.ie=e,this.oe=new Et({bucketSize:null!==(i=this.ie.bucketSize)&&void 0!==i?i:100,refillRate:null!==(r=this.ie.refillRate)&&void 0!==r?r:10,refillInterval:1e3,S:this.te,I:ji})}reset(){this.ee={}}stop(){this.oe.stop(),this.reset()}}Ni.DEBUG=!1,Ni.LIB_VERSION="1.419.2",Ni.LIB_NAME="web";class aa{constructor(t){if(!t.persistence)throw new Error("it is not valid to not have persistence and be this far into setting up the application");this.se=t.get_property.bind(t),this.ue=t.persistence.set_property.bind(t.persistence)}trackSize(t,e){this.ue(Hn,{sessionId:t,size:this.currentTrackedSize(t)+e})}currentTrackedSize(t){var e,i=this.se(Hn);return st(e=i)&&lt(e.sessionId)&&vt(e.size)&&i.sessionId===t?i.size:0}}function la(t,e){return function(t){for(var e=0,i=0;t.length>i;i++)e=(e<<5)-e+t.charCodeAt(i),e|=0;return Math.abs(e)}(t)%100<Tt(100*e,0,100,ji)}function ua(t){return"$survey_response_"+t}function ha(t,e){if(!e)return null;var i=t[ua(e)];return rt(i)?[...i]:i}function da(t,e){void 0===t&&(t={});var i={};return e.questions.forEach((e=>{if(!at(e.originalQuestionIndex)){var r,n=0===(r=e.originalQuestionIndex)?"$survey_response":"$survey_response_"+r,s=ha(t,e.id);at(s)||(i[n]=s)}})),p({$survey_questions:e.questions.map((e=>({id:e.id,question:e.question,response:ha(t,e.id)})))},t,i)}function va(t,e){var i="$survey_"+e+"/"+t.id;return t.current_iteration&&t.current_iteration>0&&(i="$survey_"+e+"/"+t.id+"/"+t.current_iteration),i}function ca(t){return"string"==typeof t&&t.trim()?t.trim():null}function fa(t){return t.toLowerCase()}function pa(t,e,i){if(!t||!e)return null;var r=fa(e),n=Object.keys(t).find((t=>fa(t)===r));if(n)return null==i||i.debug("Found exact translation match: "+n),n;if(r.includes("-")){var s=r.split("-")[0],o=Object.keys(t).find((t=>fa(t)===s));if(o)return null==i||i.debug("Found base language translation match: "+o+" (from "+e+")"),o}return null}var ga=["thankYouMessageHeader","thankYouMessageDescription","thankYouMessageCloseButtonText","introScreenHeader","introScreenDescription","introScreenButtonText","submitButtonText","backButtonText"];function ma(t,e,i){var r,n=pa(t.translations,e,i),s=p({},t),o=!1;if(n){var a,l=null==(a=t.translations)?void 0:a[n];if(l)if(null==i||i.info("Applying survey-level translation for language: "+n),at(l.name)||(s.name=l.name,o=!0),s.appearance){var u=p({},s.appearance);for(var h of ga){var d=l[h];at(d)||(u[h]=d,o=!0)}s.appearance=u}else(function(t){return ga.some((e=>!at(t[e])))})(l)&&(o=!0)}var v=t.questions.map((t=>function(t,e,i){var r,n=pa(t.translations,e,i);if(!n)return{question:t,matchedKey:null,hasChanges:!1};var s=null==(r=t.translations)?void 0:r[n];if(!s)return{question:t,matchedKey:null,hasChanges:!1};var o=p({},t),a=!1;return at(s.question)||(o.question=s.question,a=!0),at(s.description)||(o.description=s.description,a=!0),at(s.buttonText)||(o.buttonText=s.buttonText,a=!0),"link"in o&&!at(s.link)&&(o.link=s.link,a=!0),"lowerBoundLabel"in o&&!at(s.lowerBoundLabel)&&(o.lowerBoundLabel=s.lowerBoundLabel,a=!0),"upperBoundLabel"in o&&!at(s.upperBoundLabel)&&(o.upperBoundLabel=s.upperBoundLabel,a=!0),"choices"in o&&function(t){return rt(t.choices)}(s)&&(o.choices=s.choices,a=!0),{question:a?o:t,matchedKey:a?n:null,hasChanges:a}}(t,e,i))),c=v.map((t=>t.question)),f=v.some((t=>t.hasChanges)),g=null;return n||(g=(null==(r=v.find((t=>t.matchedKey)))?void 0:r.matchedKey)||null),f&&(s.questions=c,o=!0,null==i||i.info("Applied question-level translations for language: "+e)),{survey:s,matchedKey:o?n||g:null}}function ya(t){var e;return!(null==(e=t.conditions)||null==(e=e.events)||null==(e=e.values)||!e.length)}function _a(t){var e;return ya(t)&&!(null==(e=t.conditions)||null==(e=e.events)||!e.repeatedActivation)||"always"===t.schedule}var ba=(t,e)=>{if(!(t=>{try{new RegExp(t)}catch(t){return!1}return!0})(e))return!1;try{return new RegExp(e).test(t)}catch(t){return!1}},wa=t=>t.toLowerCase(),ka={exact:(t,e)=>e.some((e=>t.some((t=>e===t)))),is_not:(t,e)=>e.every((e=>t.every((t=>e!==t)))),regex:(t,e)=>e.some((e=>t.some((t=>ba(e,t))))),not_regex:(t,e)=>e.every((e=>t.every((t=>!ba(e,t))))),icontains:(t,e)=>e.map(wa).some((e=>t.map(wa).some((t=>e.includes(t))))),not_icontains:(t,e)=>e.map(wa).every((e=>t.map(wa).every((t=>!e.includes(t))))),gt:(t,e)=>e.some((e=>{var i=parseFloat(e);return!isNaN(i)&&t.some((t=>i>parseFloat(t)))})),lt:(t,e)=>e.some((e=>{var i=parseFloat(e);return!isNaN(i)&&t.some((t=>i<parseFloat(t)))}))};function Sa(t,e){return!t||Object.entries(t).every((t=>{var i=t[1],r=null==e?void 0:e[t[0]];if(null==r)return!1;var n=ka[i.operator];return!!n&&n(i.values,[String(r)])}))}function xa(t,e,i){return tr({distinct_id:t,userPropertiesToSet:e,userPropertiesToSetOnce:i})}var Ca=new Set(["is_not","not_icontains","not_regex"]);function Ta(t,e,i){return!t||0===t.length||t.every((t=>{var r="person"===t.type?i:e,n=null==r?void 0:r[t.key],s=t.operator||"exact";if(at(n)||ht(n))return Ca.has(s);var o=ka[s];return!!o&&!at(t.value)&&!ht(t.value)&&o(rt(t.value)?t.value.map(String):[String(t.value)],rt(n)?n.map(String):[String(n)])}))}var Ea=Bi("[SessionRecording]");function Ma(t,e){return e?t:"!"+t}function Ia(t,e){return t===e||t!=="!"+e&&null}class Ra{constructor(t,e,i,r,n,s,o){this.le=null,this.he=mo,this._instance=t,this.Y=e,this.J=i,this.K=r,this.ce=n,this.de=s,this.ve=o}onRemoteConfig(t){this.le=vt(t.sampleRate)?t.sampleRate:null,"any"===t.triggerMatchType?(this.fe=new ao([this.J,this.Y]),this.he=go):(this.fe=new lo([this.J,this.Y]),this.he=mo),this._instance.register_for_session({[Ms]:t.triggerMatchType}),this.Y.onConfig(t),this.J.onConfig(t),this.K.onConfig(t,((t,e)=>{this.ce("linked_flag_matched",{flag:t,variant:e}),this.ve()}))}getStatus(t){return this.he({receivedFlags:!0,isRecordingEnabled:!0,isSampled:t.isSampled,rrwebError:t.rrwebError,urlTriggerMatching:t.urlTriggerMatching,eventTriggerMatching:t.eventTriggerMatching,linkedFlagMatching:t.linkedFlagMatching,sessionId:t.sessionId})}getMinimumDuration(t){var e=this._instance.get_property("$session_recording_remote_config"),i=null==e?void 0:e.minimumDurationMilliseconds;return vt(i)?i:null}checkUrlTriggers(t,e,i,r){this.Y.checkUrlTriggerConditions(e,i,r,t)}setupEventTriggerListeners(t,e,i){if(0!==this.J.Z.length&&dt(this.pe))return this.pe=t((t=>{try{this.J.checkEventTriggerConditions(t.event,i,e)}catch(t){Ea.error("Could not activate event trigger",t)}})),this.pe}makeSamplingDecisions(t){var e,i,r,n=this.le;if(!vt(n))return null==(i=this._instance.persistence)||i.unregister(Ln),void(null==(r=this._instance.persistence)||r.unregister(In));var s=this._instance.get_property(Ln),o=this._instance.get_property(In),a=Ia(s,t),l=vt(o)&&o!==n,u=at(o)&&s===t,h=l||u||!ft(a),d=h?la(t,n):a;h&&(d?this.ce("sampled"):Ea.warn("Sample rate ("+n+") has determined that this sessionId ("+t+") will not be sent to the server.")),null==(e=this._instance.persistence)||e.register({[Ln]:Ma(t,d),[In]:ht(o)&&s===t?null:n})}ensureSamplingDecision(t){if(vt(this.le)){var e=this._instance.get_property(Ln);ft(Ia(e,t))||this.makeSamplingDecisions(t)}}onFlushComplete(){}clearConditionalRecordingPersistence(){var t,e,i,r,n;null==(t=this._instance.persistence)||t.unregister(Nn),null==(e=this._instance.persistence)||e.unregister(Dn),null==(i=this._instance.persistence)||i.unregister(Ln),null==(r=this._instance.persistence)||r.unregister(In),null==(n=this._instance.persistence)||n.unregister($n)}updateActiveTriggers(t){}hasPendingTriggers(t){var e;return(null==(e=this.fe)?void 0:e.triggerStatus(t))===eo}getPendingTriggerConditions(t){return[{label:"URL condition not matched",status:this.Y.triggerStatusNoSideEffects(t)},{label:"event condition not matched",status:this.J.triggerStatusNoSideEffects(t)},{label:"linked flag condition not matched",status:this.K.triggerStatusNoSideEffects()}].filter((t=>t.status===eo)).map((t=>t.label))}stop(){var t;null==(t=this.pe)||t.call(this),this.pe=void 0,this.J.stop(),this.Y.stop(),this.K.stop()}}class Pa{constructor(t,e,i,r,n){this.me=[],this.ge=new Map,this.ye=!1,this._instance=t,this.Y=e,this.ce=i,this.be=r,this.ve=n}onRemoteConfig(t){t.triggerGroups&&0!==t.triggerGroups.length?(this.we(t.triggerGroups),this._instance.register_for_session({[Ms]:"v2_trigger_groups",[Is]:t.triggerGroups.length}),this.Y.onConfig(t)):Ea.warn("[V2Strategy] No trigger groups configured")}getStatus(t){return function(t){if(t.rrwebError)return Ys;if(t.urlTriggerMatching.urlBlocked)return Zs;var e=t.triggerGroupMatchers,i=t.triggerGroupSamplingResults;if(0===e.length)return zs;var r=!1,n=!1;for(var s of e){var o=s.triggerStatus(t.sessionId);if(o===to){var a=s.group.id,l=i.get(a);at(l)?ji.warn("[V2 Triggers] Group activated but no sampling decision found",{groupId:a}):!0===l&&(n=!0)}else o===eo&&(r=!0)}return n?Ws:r?Gs:zs}({isSampled:t.isSampled,rrwebError:t.rrwebError,urlTriggerMatching:t.urlTriggerMatching,eventTriggerMatching:t.eventTriggerMatching,linkedFlagMatching:t.linkedFlagMatching,sessionId:t.sessionId,triggerGroupMatchers:this.me,triggerGroupSamplingResults:this.ge,minimumDuration:this.getMinimumDuration(t.sessionId)})}getMinimumDuration(t){var e=null;for(var i of this.me)if("trigger_activated"===i.triggerStatus(t)){var r=i.group.minDurationMs;vt(r)&&(ht(e)||e>r)&&(e=r)}return e}checkUrlTriggers(t,e,i,r){var n=this;this.Y.checkUrlBlocklist(e,i);var s=function(r){r.checkUrlTriggerConditions(e,i,(e=>{n.ke(r,void 0)&&(r.activateTrigger(e,t),n.updateActiveTriggers(t),n.ve(e))}),t)};for(var o of this.me)s(o)}setupEventTriggerListeners(t,e,i){var r=this;return this.pe=t((t=>{var i;if(this.ye)return Ea.info("[SessionRecorder] Stopping trigger checks - initial buffer flushed"),null==(i=this.pe)||i.call(this),void(this.pe=void 0);try{var n=function(i){i.checkEventTriggerConditions(t.event,(n=>{if(r.ke(i,t.properties)){var s=(i.group.conditions.events||[]).filter((e=>e.name===t.event)),o=r._instance.get_property(Xn),a=s.some((e=>!e.properties||0===e.properties.length||Ta(e.properties,t.properties,o)));a&&(i.activateTrigger(n,e),r.updateActiveTriggers(e),r.ve(n))}}),e)};for(var s of this.me)n(s)}catch(t){Ea.error("Could not activate event trigger for trigger groups",t)}})),this.pe}makeSamplingDecisions(t){for(var e of this.me){var i,r=e.group,n=r.id,s=r.sampleRate,o=Bn+n,a=this._instance.get_property(o),l=null,u=!1,h=!1,d=!1;if(st(a)){var v=a.sessionId,c=a.sampleRate,f=a.sampled;u="string"==typeof v&&v!==t,h=vt(c)&&c!==s,l=v===t&&vt(c)&&c===s&&ft(f)?f:null}else l=a===t||null,u="string"==typeof a&&a!==t,d=a===t;var p=u||h||d||!ft(l),g=p?la(t+n,s):l;p&&this.be("triggerGroupSamplingDecisionMade",{group_id:n,group_name:r.name,sampleRate:s,isSampled:g}),this.ge.set(n,g),null==(i=this._instance.persistence)||i.register({[o]:{sessionId:t,sampleRate:s,sampled:g}})}this.updateActiveTriggers(t)}ensureSamplingDecision(t){}onFlushComplete(){this.ye=!0}clearConditionalRecordingPersistence(){var t,e,i;for(var r of(null==(t=this._instance.persistence)||t.unregister(Ln),null==(e=this._instance.persistence)||e.unregister(In),null==(i=this._instance.persistence)||i.unregister($n),this.me)){var n,s,o,a=r.group.id;null==(n=this._instance.persistence)||n.unregister(qn+a),null==(s=this._instance.persistence)||s.unregister(jn+a),null==(o=this._instance.persistence)||o.unregister(Bn+a)}}updateActiveTriggers(t){var e=[];for(var i of this.me){var r=i.group,n=r.id,s="trigger_activated"===i.triggerStatus(t),o=!0===this.ge.get(n);s&&e.push({id:n,name:r.name,matched:!0,sampled:o})}this._instance.register_for_session({[Ts]:e})}hasPendingTriggers(t){for(var e of this.me)if(e.triggerStatus(t)===eo)return!0;return!1}getPendingTriggerConditions(t){return this.me.flatMap((e=>e.triggerStatusNoSideEffects(t)!==eo?[]:e.getPendingTriggerConditions(t).map((t=>'trigger group "'+e.group.name+'": '+t))))}stop(){var t;null==(t=this.pe)||t.call(this),this.pe=void 0,this.me.forEach((t=>t.stop())),this.me=[],this.ge.clear(),this.Y.stop()}ke(t,e){var i=t.group.conditions.properties;return!i||0===i.length||Ta(i,e,this._instance.get_property(Xn))}we(t){var e=this;this.me.forEach((t=>t.stop())),this.me=[],this.ge.clear();var i=function(t){var i=new po(e._instance,t,((i,r)=>{e.ce("linked_flag_matched",{flag:i,variant:r,group_id:t.id,group_name:t.name}),e.ve()}));e.me.push(i)};for(var r of t)i(r)}}var Aa=t=>{if(r){try{for(var e=t+"=",i=r.cookie.split(";").filter((t=>t.length)),n=0;i.length>n;n++){for(var s=i[n];" "==s.charAt(0);)s=s.substring(1,s.length);if(0===s.indexOf(e))return decodeURIComponent(s.substring(e.length,s.length))}}catch(t){}return null}},Oa="https?://(.*)",Fa=["gclid","gclsrc","dclid","gbraid","wbraid","fbclid","msclkid","twclid","li_fat_id","igshid","ttclid","rdt_cid","epik","qclid","sccid","irclid","_kx"],La=["utm_source","utm_medium","utm_campaign","utm_content","utm_term","gad_source","mc_cid",...Fa],$a="<masked>",Da=["li_fat_id"];function Na(t,e,i){if(!r)return{};var n,s=e?[...Fa,...i||[]]:[],o=qa(nr(r.URL,s,$a),t),a=(n={},Hi(Da,(function(t){var e=Aa(t);n[t]=e||null})),n);return zi(a,o)}function qa(t,e){var i=La.concat(e||[]),r={};return Hi(i,(function(e){var i=rr(t,e);r[e]=i||null})),r}function ja(t){var e=function(t){return t?0===t.search(Oa+"google.([^/?]*)")?"google":0===t.search(Oa+"bing.com")?"bing":0===t.search(Oa+"yahoo.com")?"yahoo":0===t.search(Oa+"duckduckgo.com")?"duckduckgo":null:null}(t),i="yahoo"!=e?"q":"p",n={};if(!ht(e)){n.$search_engine=e;var s=r?rr(r.referrer,i):"";s.length&&(n.ph_keyword=s)}return n}function Ba(){return navigator.language||navigator.userLanguage}var Ua="$direct";function Ha(){return(null==r?void 0:r.referrer)||Ua}function za(t,e,i){void 0===i&&(i=!1);var r=t?[...Fa,...e||[]]:[],s=i?Le(null==n?void 0:n.href):null==n?void 0:n.href,o=null==s?void 0:s.substring(0,1e3);return{r:Ha().substring(0,1e3),u:o?nr(o,r,$a):void 0}}function Wa(t,e){var i;void 0===e&&(e=!1);var r=t.r,n=t.u,s=e?Le(n):n,o={$referrer:r,$referring_domain:null==r?void 0:r==Ua?Ua:null==(i=er(r))?void 0:i.host};if(s){o.$current_url=s;var a=er(s);o.$host=null==a?void 0:a.host,o.$pathname=null==a?void 0:a.pathname;var l=qa(s);zi(o,l)}if(r){var u=ja(r);zi(o,u)}return o}function Va(){try{return Intl.DateTimeFormat().resolvedOptions().timeZone}catch(t){return}}function Ga(){try{return(new Date).getTimezoneOffset()}catch(t){return}}function Za(t){return at(t)?void 0:Math.round(t)}function Qa(t){return st(t)?t.network_timing:t}var Ja,Ka,Ya=36e5,Xa=943718.4,tl="[SessionRecording]",el=Bi(tl),il=[y.MouseMove,y.MouseInteraction,y.Scroll,y.ViewportResize,y.Input,y.TouchMove,y.MediaInteraction,y.Drag],rl=t=>({rrwebMethod:t,enqueuedAt:Date.now(),attempt:1});function nl(){var t;return null==v||null==(t=v.__PosthogExtensions__)?void 0:t.rrweb}function sl(){var t;return null==(t=nl())?void 0:t.record}function ol(t){try{return JSON.stringify(t)}catch(e){return JSON.stringify(t,yo())}}function al(t){return sa(ra(na(ol(t))))}function ll(t){return ul.apply(this,arguments)}function ul(){return(ul=f((function*(t){var e=ol(t),i=yield N(e,Ni.DEBUG,{rethrow:!0});return sa(new Uint8Array(yield i.arrayBuffer()))}))).apply(this,arguments)}var hl="undefined"!=typeof globalThis&&"CompressionStream"in globalThis&&"TextEncoder"in globalThis&&"Response"in globalThis&&"function"==typeof Response.prototype.blob,dl=!1;function vl(t){return rt(t)&&0===t.length?Ja=null!=Ja?Ja:al([]):al(t)}function cl(t){return fl.apply(this,arguments)}function fl(){return(fl=f((function*(t){return rt(t)&&0===t.length?Ja||(Ka=null!=Ka?Ka:ll([]).then((t=>(Ja=t,t))).catch((t=>{throw Ja=void 0,Ka=void 0,t}))):ll(t)}))).apply(this,arguments)}function pl(t){return hl&&!dl&&function(t){return t.type===m.FullSnapshot||t.type===m.IncrementalSnapshot&&(t.data.source===y.Mutation||t.data.source===y.StyleSheetRule)}(t)}function gl(t){return{event:t,size:bo(t)}}function ml(t,e){return p({},t,{data:e,cv:"2024-10"})}function yl(t,e){return p({},t,{cv:"2024-10",data:p({},t.data,e)})}function _l(t){try{if(t.type===m.FullSnapshot)return gl(ml(t,al(t.data)));if(t.type===m.IncrementalSnapshot&&t.data.source===y.Mutation)return gl(yl(t,{texts:vl(t.data.texts),attributes:vl(t.data.attributes),removes:vl(t.data.removes),adds:vl(t.data.adds)}));if(t.type===m.IncrementalSnapshot&&t.data.source===y.StyleSheetRule)return gl(yl(t,{adds:t.data.adds?al(t.data.adds):void 0,removes:t.data.removes?al(t.data.removes):void 0}))}catch(t){el.error("could not compress event - will use uncompressed event",t)}return{event:t,size:_o(t)}}function bl(){return bl=f((function*(t){try{if(t.type===m.FullSnapshot)return gl(ml(t,yield ll(t.data)));if(t.type===m.IncrementalSnapshot&&t.data.source===y.Mutation){var e=yield Promise.all([cl(t.data.texts),cl(t.data.attributes),cl(t.data.removes),cl(t.data.adds)]);return gl(yl(t,{texts:e[0],attributes:e[1],removes:e[2],adds:e[3]}))}if(t.type===m.IncrementalSnapshot&&t.data.source===y.StyleSheetRule){var i=yield Promise.all([t.data.adds?ll(t.data.adds):void 0,t.data.removes?ll(t.data.removes):void 0]);return gl(yl(t,{adds:i[0],removes:i[1]}))}}catch(e){return F(e)&&(dl=!0),el.error("could not compress event asynchronously - trying synchronous compression",e),_l(t)}return{event:t,size:_o(t)}})),bl.apply(this,arguments)}function wl(t,e){return t.type===m.Custom&&t.data.tag===e}function kl(t){return wl(t,"sessionIdle")}function Sl(t){return wl(t,"$session_ending")}function xl(t){return wl(t,"$session_starting")}class Cl{get sessionId(){return this._e}get Se(){if(!this._instance.sessionManager)throw new Error(tl+" must be started with a valid sessionManager.");return this._instance.sessionManager}get xe(){return this._instance.config.session_recording.session_idle_threshold_ms||3e5}get Ce(){return Ia(this._instance.get_property(Ln),this.sessionId)}get le(){var t,e=null==(t=this.Me)?void 0:t.sampleRate;return vt(e)?e:null}get Te(){var t,e;return null!==(t=null==(e=this.Ie)?void 0:e.getMinimumDuration(this.sessionId))&&void 0!==t?t:null}constructor(t,e){this.Ee="/s/",this._forceAllowLocalhostNetworkCapture=!1,this.Re=void 0,this.Ae=Date.now(),this.Le=!1,this.Oe=[],this.Fe="unknown",this.Ne=0,this.De=!1,this.Pe=!1,this.qe=!1,this.je=!1,this.Be=!1,this.He=!1,this.$e=!1,this.Ue=!1,this.We=!1,this.ze=!1,this.Ve=!1,this.Ze=!1,this.Qe=[],this.Ge=void 0,this.Ye=void 0,this.Je=[],this.Ke=0,this.Xe=0,this.et=!1,this.tt=void 0,this.pe=void 0,this.rt=void 0,this.it=void 0,this.nt=void 0,this.ot=(t,e,i)=>{var r,n,s;if(i&&(t!==this._e||e!==this.st)){var o,a=!i.noSessionId&&(i.activityTimeout||i.sessionPastMaximumLength),l=this._e,u=this.st;if(a&&this.be("$session_ending",{currentSessionId:l,currentWindowId:u,nextSessionId:t,nextWindowId:e,changeReason:i,lastActivityTimestamp:this.Ae,flushed_size:null==(o=this.ut)?void 0:o.currentTrackedSize(l)}),null==(r=this._instance.persistence)||r.unregister(Un),this.$e=!1,null==(n=nl())||null==n.resetMaxDepthState||n.resetMaxDepthState(),this.be("$session_id_change",{sessionId:t,windowId:e,changeReason:i}),this.ht(),!(!1===this.Fe&&this.isStarted||this._e===t&&this.st===e)){var h=this._e!==t&&!1!==this.Fe;this.Fe="unknown",this.ct(h)}a&&this.be("$session_starting",{previousSessionId:l,previousWindowId:u,nextSessionId:t,nextWindowId:e,changeReason:i,lastActivityTimestamp:this.Ae}),null==(s=this.Ie)||s.makeSamplingDecisions(t)}},this.dt=()=>{var t;return(null==(t=this._instance.persistence)?void 0:t.props[$n])===this._e},this.vt=()=>{var t,e;if(0===this.ft.data.length)return null;var i=null==(t=this.ft.data[0])?void 0:t.timestamp,r=null==(e=this.ft.data[this.ft.data.length-1])?void 0:e.timestamp;return vt(i)&&vt(r)?r-i:null},this.yt=()=>{var t,e,i=this.Te;if(!vt(i))return!1;if(null===(t=null==(e=this._instance.config.session_recording)?void 0:e.strictMinimumDuration)||void 0===t||!t){var r=this.bt;return vt(r)&&r>=0&&i>r}if(this.dt())return!1;var n,s=this.vt();return!!ht(s)||i>s||(null==(n=this._instance.persistence)||n.register({[$n]:this._e}),!1)},this.wt=()=>{this.status!==Gs?(this.De&&this.Pe&&this.kt&&!this.qe&&(this.De=!1),this._t(),this.St()):this.xt()},this.Ct=()=>{this.wt()},this.Mt=()=>{this.be("browser offline",{})},this.Tt=()=>{this.be("browser online",{})},this.It=()=>{null!=r&&r.visibilityState&&("visible"===r.visibilityState&&(this.kt=!0),this.be("window "+r.visibilityState,{}))},this._instance=t,this.kt=null==e||e;var i=this.Se.checkAndGetSessionAndWindowId(),n=i.windowId;this._e=i.sessionId,this.st=n,this.K=new co(this._instance),this.Y=new vo(this._instance),this.J=new fo(this._instance),this.ft=this.xt(),this.Se.sessionTimeoutMs>this.xe||el.warn("session_idle_threshold_ms ("+this.xe+") is greater than the session timeout ("+this.Se.sessionTimeoutMs+"). Session will never be detected as idle"),this.ut=new aa(this._instance)}setDocumentWasEverVisible(t){t&&(this.kt=!0)}get Et(){var t,e,i,r,n,s,o,a,l,u=null==(t=this.Me)?void 0:t.masking,h={maskAllInputs:null==(e=this._instance.config.session_recording)?void 0:e.maskAllInputs,maskTextSelector:null==(i=this._instance.config.session_recording)?void 0:i.maskTextSelector,blockSelector:null==(r=this._instance.config.session_recording)?void 0:r.blockSelector,maskAllElementAttributes:null==(n=this._instance.config.session_recording)?void 0:n.maskAllElementAttributes},d=null!==(s=null==h?void 0:h.maskAllInputs)&&void 0!==s?s:null==u?void 0:u.maskAllInputs,v=null!==(o=null==h?void 0:h.maskTextSelector)&&void 0!==o?o:null==u?void 0:u.maskTextSelector,c=null!==(a=null==h?void 0:h.blockSelector)&&void 0!==a?a:null==u?void 0:u.blockSelector,f=null!==(l=null==h?void 0:h.maskAllElementAttributes)&&void 0!==l?l:null==u?void 0:u.maskAllElementAttributes;return at(d)&&at(v)&&at(c)&&at(f)?void 0:{maskAllInputs:null==d||d,maskTextSelector:v,blockSelector:c,maskAllElementAttributes:f}}Rt(){var t;if(!this.We){var e=null==(t=this.Me)?void 0:t.masking;if(!dt(e)){var i=this._instance.config.session_recording,r=["maskAllInputs","maskTextSelector","blockSelector","maskAllElementAttributes"].filter((t=>{var r=null==i?void 0:i[t],n=e[t];return!at(r)&&r!==n}));0!==r.length&&(this.We=!0,el.warn('Session recording masking is configured both in `posthog.init` and in your project settings, and they differ. The `session_recording` options in `posthog.init` take precedence, so the project ("Privacy and masking") setting is ignored for: '+r.join(", ")+". Remove these masking options from `posthog.init` to use the project setting instead. See https://posthog.com/docs/session-replay/privacy",{client:{maskAllInputs:null==i?void 0:i.maskAllInputs,maskTextSelector:null==i?void 0:i.maskTextSelector,blockSelector:null==i?void 0:i.blockSelector,maskAllElementAttributes:null==i?void 0:i.maskAllElementAttributes},project:e}))}}}get At(){var t;return Tt(null==(t=this._instance.config.session_recording.canvasCapture)?void 0:t.resolutionScale,.1,1,Bi("canvas recording resolution scale"),1)}get Lt(){var t,e,i,r,n,s,o,a=this._instance.config.session_recording.captureCanvas,l=null==(t=this.Me)?void 0:t.canvasRecording,u=null!==(e=null!==(i=null==a?void 0:a.recordCanvas)&&void 0!==i?i:null==l?void 0:l.enabled)&&void 0!==e&&e,h=null!==(r=null!==(n=null==a?void 0:a.canvasFps)&&void 0!==n?n:null==l?void 0:l.fps)&&void 0!==r?r:4,d=null!==(s=null!==(o=null==a?void 0:a.canvasQuality)&&void 0!==o?o:null==l?void 0:l.quality)&&void 0!==s?s:.4;if("string"==typeof d){var v=parseFloat(d);d=isNaN(v)?.4:v}return{enabled:u,fps:Tt(h,0,12,Bi("canvas recording fps"),4),quality:Tt(d,0,1,Bi("canvas recording quality"),.4)}}get Ot(){var t,e=!(null==(t=this.Me)||!t.consoleLogRecordingEnabled),i=this._instance.config.enable_recording_console_log;return null!=i?i:e}get Ft(){var t,e,i,r=null==(t=this.Me)?void 0:t.networkPayloadCapture,n={recordHeaders:null==(e=this._instance.config.session_recording)?void 0:e.recordHeaders,recordBody:null==(i=this._instance.config.session_recording)?void 0:i.recordBody},s=(null==n?void 0:n.recordHeaders)||(null==r?void 0:r.recordHeaders),o=(null==n?void 0:n.recordBody)||(null==r?void 0:r.recordBody),a=Qa(this._instance.config.capture_performance),l=Qa(null==r?void 0:r.capturePerformance),u=!!(ft(a)?a:l);return s||o||u?{recordHeaders:s,recordBody:o,recordPerformance:u}:void 0}Nt(){var t,e,i=[],r=null==(t=v.__PosthogExtensions__)||null==(t=t.rrwebPlugins)?void 0:t.getRecordConsolePlugin;r&&this.Ot&&i.push(r());var s=null==(e=v.__PosthogExtensions__)||null==(e=e.rrwebPlugins)?void 0:e.getRecordNetworkPlugin;if(this.Ft&&nt(s))if(!Xi.includes(n.hostname)||this._forceAllowLocalhostNetworkCapture){var o=nt(this._instance.requestRouter.isIngestionEndpoint)?this._instance.requestRouter.isIngestionEndpoint.bind(this._instance.requestRouter):void 0;i.push(s(((t,e,i)=>{var r,n={payloadSizeLimitBytes:nn.payloadSizeLimitBytes,performanceEntryTypeToObserve:[...nn.performanceEntryTypeToObserve],payloadHostDenyList:[...e.payloadHostDenyList||[],...nn.payloadHostDenyList]},s=!1!==t.session_recording.recordHeaders&&e.recordHeaders,o=!1!==t.session_recording.recordBody&&e.recordBody,a=!1!==t.capture_performance&&e.recordPerformance,l=(r=rn(n),t=>(null!=t&&t.requestBody&&(t.requestBody=hn(t.requestBody,t.requestHeaders,r,"Request")),null!=t&&t.responseBody&&(t.responseBody=hn(t.responseBody,t.responseHeaders,r,"Response")),t)),u=e=>{return l(((t,e,i)=>{var r;if(null==i||!i(t.name)){var n=er(t.name),s=0===e.indexOf("http")?null==(r=er(e))?void 0:r.pathname:e;"/"===s&&(s="");var o=null==n?void 0:n.pathname.replace(s||"","");if(!(n&&o&&un.some((t=>0===o.indexOf(t)))))return t}})((ln((r=e).requestHeaders),ln(r.responseHeaders),r),t.api_host,i));var r},h=nt(t.session_recording.maskNetworkRequestFn);return h&&nt(t.session_recording.maskCapturedNetworkRequestFn)&&ji.warn("Both `maskNetworkRequestFn` and `maskCapturedNetworkRequestFn` are defined. `maskNetworkRequestFn` will be ignored."),h&&(t.session_recording.maskCapturedNetworkRequestFn=e=>{var i=t.session_recording.maskNetworkRequestFn({url:e.name});return!i&&e.isInitial?i:p({},e,{name:null==i?void 0:i.url})}),n.maskRequestFn=nt(t.session_recording.maskCapturedNetworkRequestFn)?e=>{var i=u(e);if(i){var r=i.isInitial?{name:"",entryType:i.entryType,startTime:i.startTime,duration:i.duration,endTime:i.endTime,timeOrigin:i.timeOrigin,timestamp:i.timestamp,isInitial:!0}:void 0,n=null==t.session_recording.maskCapturedNetworkRequestFn?void 0:t.session_recording.maskCapturedNetworkRequestFn(i);return dt(n)&&r?(vn.add(r),r):null!=n?n:void 0}}:t=>function(t){if(!at(t))return t.requestBody=dn(t.requestBody,"Request"),t.responseBody=dn(t.responseBody,"Response"),t}(u(t)),p({},nn,n,{recordHeaders:s,recordBody:o,recordPerformance:a,recordInitialRequests:a,streamNetworkBody:!0===t.session_recording.streamNetworkBody})})(this._instance.config,this.Ft,o)))}else el.info("NetworkCapture not started because we are on localhost.");return i}Dt(t){return this._instance.config.disable_capture_url_hashes?Le(t):t}Pt(t,e){void 0===e&&(e=!1);var i=e?Le(t):this.Dt(t),r=this._instance.config.mask_personal_data_properties?[...Fa,...this._instance.config.custom_personal_data_properties||[]]:[];return this.qt(nr(i,r,$a))}qt(t){var e=this._instance.config.session_recording;if(e.maskCapturedNetworkRequestFn){var i,r=e.maskCapturedNetworkRequestFn({name:t});return null!==(i=null==r?void 0:r.name)&&void 0!==i?i:null==r?void 0:r.url}if(e.maskNetworkRequestFn){var n=e.maskNetworkRequestFn({url:t});return null==n?void 0:n.url}return t}jt(t){try{return t.rrwebMethod(),!0}catch(e){return 10>this.Oe.length?this.Oe.push({enqueuedAt:t.enqueuedAt||Date.now(),attempt:t.attempt+1,rrwebMethod:t.rrwebMethod}):el.warn("could not emit queued rrweb event.",e,t),!1}}be(t,e){return this.jt(rl((()=>sl().addCustomEvent(t,e))))}Bt(){try{if(this._instance.config.capture_pageview||!t)return;var e=new URL(t.location.href),i=this.Pt(e.origin+e.pathname+e.search);this.Ht!==i&&(this.Ht=i,this.be("$url_changed",{href:i}))}catch(t){}}$t(){if(this.Oe.length){var t=[...this.Oe];this.Oe=[],t.forEach((t=>{Date.now()-t.enqueuedAt>2e3||this.jt(t)}))}}de(){return this.jt(rl((()=>sl().takeFullSnapshot())))}get Ut(){var t,e,i;if(null!=(t=this.Ie)&&t.hasPendingTriggers(this.sessionId)&&!["sampled","active"].includes(this.status)){var r,n=null==(r=this._instance.config.session_recording)?void 0:r.trigger_pending_buffer_interval_millis;return vt(n)&&Number.isFinite(n)&&n>=1e3&&36e5>=n?n:6e4}return null!==(e=null==(i=this._instance.config.session_recording)?void 0:i.full_snapshot_interval_millis)&&void 0!==e?e:3e5}Wt(){if(this.zt&&clearInterval(this.zt),!0!==this.Fe){var t=this.Ut;t&&(this.zt=setInterval((()=>{this.de()}),t))}}ve(t){"event"===t&&this.Vt(),!this.Y.urlBlocked&&["sampled","active"].includes(this.status)&&this.Wt()}Zt(){this.Y.urlBlocked||(this.Y.urlBlocked=!0,clearInterval(this.zt),el.info("recording paused due to URL blocker"),this.be("recording paused",{reason:"url blocker"}))}Qt(){this.Y.urlBlocked&&(this.Y.urlBlocked=!1,this.de(),this.Wt(),this.be("recording resumed",{reason:"left blocked url"}),el.info("recording resumed"))}Gt(t,e){var i;if("event"===t&&this.Vt(),!this.Le&&null!=(i=this.Ie)&&i.hasPendingTriggers(this.sessionId)){this.Le=!0;try{var r,n;null==(r=this._instance.persistence)||r.register({["url"===t?Dn:Nn]:this.sessionId}),null==(n=this.Ie)||n.updateActiveTriggers(this.sessionId),this.ve(),this.St(),this.ce(t+"_trigger_matched",{["url"===t?"matchedUrl":"matchedEvent"]:e})}finally{this.Le=!1}}}get isStarted(){return!!this.Re}get Me(){var t=this._instance.get_property(Mn);if(t){var e;try{e=st(t)?t:JSON.parse(t)}catch(t){return void el.warn("persisted remote config for session recording is invalid and will be ignored",t)}if(!this.isStarted){var i,r,n=null!==(i=e.cache_timestamp)&&void 0!==i?i:Date.now();if(Date.now()-n>Ya)return el.info("persisted remote config for session recording is stale and will be ignored",{cacheTimestamp:n,persistedConfig:t}),void(null==(r=this._instance.persistence)||r.unregister(Mn))}return e}}Yt(t,e,i){this._instance.get_property(t)&&(e(),i())}start(e){var i,n,s=this.Me;if(s){this.isStarted||(this.De=!1!==this.Fe&&!this.je,this.je=!1,this.Pe=this.De,this.qe=!1),this.et&&(this.Jt(),this.xt());var o=this.Se.checkAndGetSessionAndWindowId(),a=o.windowId;this._e=o.sessionId,this.st=a,null==(i=this._instance.persistence)||i.unregister(Un),null!=s&&s.endpoint&&(this.Ee=null==s?void 0:s.endpoint),this.Ie=2===(null==s?void 0:s.version)&&(null==s?void 0:s.triggerGroups)&&s.triggerGroups.length>0?new Pa(this._instance,this.Y,this.ce.bind(this),this.be.bind(this),this.ve.bind(this)):new Ra(this._instance,this.Y,this.J,this.K,this.ce.bind(this),this.de.bind(this),this.ve.bind(this)),this.Ie.onRemoteConfig(s),null==(n=this.pe)||n.call(this),this.pe=this.Ie.setupEventTriggerListeners(this._instance.on.bind(this._instance,"eventCaptured"),this.sessionId,((t,e)=>this.Gt(t,e))),this.Yt(Rn,(()=>{this.overrideSampling()}),(()=>{var t;return null==(t=this._instance.persistence)?void 0:t.unregister(Rn)})),this.Yt(Pn,(()=>{this.overrideLinkedFlag()}),(()=>{var t;return null==(t=this._instance.persistence)?void 0:t.unregister(Pn)})),this.Yt(On,(()=>{this.overrideTrigger("event")}),(()=>{var t;return null==(t=this._instance.persistence)?void 0:t.unregister(On)})),this.Yt(An,(()=>{this.overrideTrigger("url")}),(()=>{var t;return null==(t=this._instance.persistence)?void 0:t.unregister(An)})),this.Ie.makeSamplingDecisions(this.sessionId),this.Kt(),this.Be||(Ki(t,"beforeunload",this.wt),Ki(t,"pagehide",this.Ct),Ki(t,"offline",this.Mt),Ki(t,"online",this.Tt),Ki(r,"visibilitychange",this.It),!this.rt&&nt(this.Se.onSessionId)&&(this.rt=this.Se.onSessionId(this.ot)),!this.it&&nt(this.Se.on)?this.it=this.Se.on("forcedIdleReset",(()=>{this.ht(),this.Fe="unknown",this.stop(),this.nt=this.Se.onSessionId(((t,e,i)=>{var r;null==(r=this.nt)||r.call(this),this.nt=void 0,this.ot(t,e,i)}))})):nt(this.Se.on)||el.warn("bundled core has no SessionIdManager.on (requires posthog-js >= 1.268.6); recording will start but skip forced-idle-reset handling"),dt(this.tt)&&(this.tt=this._instance.on("eventCaptured",(t=>{try{if("$pageview"===t.event){var e=null!=t&&t.properties.$current_url?this.Pt(t.properties.$current_url):"";if(!e)return;this.be("$pageview",{href:e})}}catch(t){el.error("Could not add $pageview to rrweb session",t)}}))),this.status===Vs&&this.ce(e||"recording_initialized"))}else el.info("remote config must be stored in persistence before recording can start")}Xt(){var e,i,n,s,o,a;null==t||t.removeEventListener("beforeunload",this.wt),null==t||t.removeEventListener("pagehide",this.Ct),null==t||t.removeEventListener("offline",this.Mt),null==t||t.removeEventListener("online",this.Tt),null==r||r.removeEventListener("visibilitychange",this.It),clearInterval(this.zt),this.er(),null==(e=this.tt)||e.call(this),this.tt=void 0,null==(i=this.pe)||i.call(this),this.pe=void 0,null==(n=this.rt)||n.call(this),this.rt=void 0,null==(s=this.it)||s.call(this),this.it=void 0,null==(o=this.nt)||o.call(this),this.nt=void 0,null==(a=this.Ie)||a.stop(),this.tr(),this.Jt()}Jt(){this.Xe+=1,this.Je=[],this.Ke=0,this.rr=void 0,this.et=!1}tr(){var t,e;null==(t=this.ir)||t.stop(),this.Oe=[],null==(e=this.Re)||e.call(this),this.Re=void 0}nr(){if(!this.rr||0===this.Ke)return!1;if(this.et)return!0;this.et=!0;var t=this.Xe;return this.er(),this.tr(),this.rr.catch((()=>{})).then((()=>{t===this.Xe&&(this.et=!1,this.St(),this.xt(),this.Xt(),el.info("stopped"))})).catch((()=>{this.et=!1,this.Xt(),el.info("stopped")})),!0}stop(){this.tr(),this.nr()||(this.St(),this.xt(),this.Xt(),el.info("stopped"))}ct(t){var e;this.stop(),this.ar=void 0,this.sr=void 0,null==(e=nl())||null==e.resetSnapshotCostState||e.resetSnapshotCostState(),this.start("session_id_changed"),this.De=t,this.Pe=!1}Vt(){this.isStarted||(this.je=!0),this.De&&(this.De=!1,this.Pe=!1,this.qe&&(this.qe=!1,this.de()),this.ur())}discard(){this.xt(),this.Xt(),el.info("discarded")}lr(t,e,i,r,n){var s={$snapshot_bytes:i,$snapshot_data:e,$session_id:r,$window_id:n};this.status!==zs?(this.hr(t,r),this.cr(s)):this.xt()}dr(){try{this.vr()}catch(t){this.Ue||(this.Ue=!0,el.error("could not track full snapshot cost",t))}}vr(){var t,e=null==(t=nl())||null==t.getLastSnapshotCost?void 0:t.getLastSnapshotCost();e&&e!==this.sr&&(this.sr=e,this.ar&&this.ar.durationMs>=e.durationMs||(this.ar=e),500>e.durationMs||el.warn("full snapshot was slow, the page may have been unresponsive while it ran",{durationMs:Math.round(e.durationMs),stylesheetMs:Math.round(e.stylesheetMs),nodeCount:e.nodeCount,cssRuleCount:e.cssRuleCount,nonDeferrableCssRuleCount:e.nonDeferrableCssRuleCount,deferredStylesheetCount:e.deferredStylesheetCount}))}hr(t,e){t.type!==m.FullSnapshot?t.type===m.IncrementalSnapshot&&(at(this.Ge)||this.Ge===e||this.Ye===e||(this.Ye=e,el.info("incremental snapshot for a session with no full snapshot - requesting one",{sessionId:e}),this.de())):this.Ge=e}pr(t){t.counted&&t.generation===this.Xe&&(this.Ke=Math.max(0,this.Ke-1)),t.counted=!1,this.Je=this.Je.filter((e=>e!==t))}mr(t,e,i){t.processed||t.generation!==this.Xe||(t.processed=!0,this.lr(t.event,e,i,t.targetSessionId,t.targetWindowId))}gr(t){try{var e=t.compressionEnabled?_l(t.event):{event:t.event,size:_o(t.event)};this.mr(t,e.event,e.size)}finally{this.pr(t)}}_t(){[...this.Je].forEach((t=>{this.gr(t)}))}yr(t,e,i,r){var n=this,s={event:t,compressionEnabled:e,targetSessionId:i,targetWindowId:r,generation:this.Xe,processed:!1,counted:!0};this.Je.push(s),this.Ke+=1;var o=function(){var i=f((function*(){try{if(s.processed)return;var i,r;try{var o=e?pl(t)?yield function(t){return bl.apply(this,arguments)}(t):_l(t):{event:t,size:_o(t)};i=o.event,r=o.size}catch(e){el.error("could not process queued compression event - will use uncompressed event",e),i=t,r=_o(t)}n.mr(s,i,r)}finally{n.pr(s)}}));return function(){return i.apply(this,arguments)}}();this.rr=this.rr?this.rr.catch((()=>{})).then(o):o()}onRRwebEmit(t){var e,i,r,n,s,o,a,l,u;if(this._instance.sessionManager&&(this.$t(),t&&st(t))){if(t.type===m.Meta){var h=this.Pt(t.data.href);if(this.Ht=h,!h)return;t.data.href=h}else this.Bt();if(null==(e=this.Ie)||e.checkUrlTriggers(this.sessionId,(()=>this.Zt()),(()=>this.Qt()),((t,e)=>this.Gt(t,e))),!this.Y.urlBlocked||function(t){return t.type===m.Custom&&"recording paused"===t.data.tag}(t)){var d,v,c;t.type===m.FullSnapshot&&(null!=(d=nl())&&null!=d.wasMaxDepthReached&&d.wasMaxDepthReached()&&(this.$e=!0),this.dr(),Promise.resolve().then((()=>this.dr())),this.Wt(),null==(v=this.ir)||v.reset(),null==(c=this._instance.persistence)||c.register_once({[Un]:t.timestamp},void 0)),t.type===m.FullSnapshot&&null!=(i=this.Ie)&&i.hasPendingTriggers(this.sessionId)&&this.br();var f=this.ir?this.ir.throttleMutations(t):t;if(f){var p=function(t){var e=t;if(e&&st(e)&&6===e.type&&st(e.data)&&"rrweb/console@1"===e.data.plugin){e.data.payload.payload.length>10&&(e.data.payload.payload=e.data.payload.payload.slice(0,10),e.data.payload.payload.push("...[truncated]"));for(var i=[],r=0;e.data.payload.payload.length>r;r++)i.push(e.data.payload.payload[r]&&e.data.payload.payload[r].length>2e3?e.data.payload.payload[r].slice(0,2e3)+"...[truncated]":e.data.payload.payload[r]);return e.data.payload.payload=i,t}return t}(f),g=function(t){return Sl(t)?t.data.payload:null}(p),_=function(t){return xl(t)?t.data.payload:null}(p),b=function(t){return kl(t)?t.data.payload:null}(p);g||_?null!=g&&g.lastActivityTimestamp&&(p.timestamp=g.lastActivityTimestamp):null!=b&&b.sessionId||this.wr(p),t.type===m.FullSnapshot&&(this.Qe.push([this._e,t.timestamp]),this.Qe.length>6&&(this.Qe=this.Qe.slice(-6)));var w=null!==(r=null!==(n=null!==(s=null==g?void 0:g.currentSessionId)&&void 0!==s?s:null==_?void 0:_.nextSessionId)&&void 0!==n?n:null==b?void 0:b.sessionId)&&void 0!==r?r:this._e,k=null!==(o=null!==(a=null!==(l=null==g?void 0:g.currentWindowId)&&void 0!==l?l:null==_?void 0:_.nextWindowId)&&void 0!==a?a:null==b?void 0:b.windowId)&&void 0!==o?o:this.st;if(!0!==this.Fe||function(t){return kl(t)||Sl(t)||xl(t)}(p)){p.type===m.FullSnapshot&&(this.Ne=0),b&&(p.timestamp=b.lastActivityTimestamp+b.threshold);var S=null===(u=this._instance.config.session_recording.compress_events)||void 0===u||u;if(this.Ke>0||S&&pl(p))this.yr(p,S,w,k);else{var x=S?_l(p):{event:p,size:_o(p)};this.lr(p,x.event,x.size,w,k)}}else(function(t){return t.type===m.FullSnapshot||t.type===m.Meta||t.type===m.IncrementalSnapshot&&t.data.source!==y.CanvasMutation})(p)&&this.Ne++}else!0===this.Fe&&this.Ne++}}}get status(){return this.Ie?this.Ie.getStatus({instance:this._instance,sessionId:this.sessionId,isSampled:this.Ce,rrwebError:this.Be,urlTriggerMatching:this.Y,eventTriggerMatching:this.J,linkedFlagMatching:this.K,remoteConfig:this.Me}):zs}log(t,e){var i;void 0===e&&(e="log"),null==(i=this._instance.sessionRecording)||i.onRRwebEmit({type:6,data:{plugin:"rrweb/console@1",payload:{level:e,trace:[],payload:[JSON.stringify(t)]}},timestamp:Date.now()})}overrideLinkedFlag(){this.K.linkedFlagSeen=!0,this.de(),this.Vt(),this.ce("linked_flag_overridden")}overrideSampling(){var t;null==(t=this._instance.persistence)||t.register({[Ln]:this.sessionId,[In]:null}),this.de(),this.Vt(),this.ce("sampling_overridden")}overrideTrigger(t){this.Gt(t),this.Vt()}kr(){try{var e,i=null==t||null==(e=t.location)?void 0:e.href;if(!i)return;var r=this.Pt(i);if(!r)return;return new URL(r).hostname||void 0}catch(t){return}}er(){this._r&&(clearTimeout(this._r),this._r=void 0)}ur(){this._r||(this._r=setTimeout((()=>{this.St()}),2e3))}Sr(){return this.Ge!==this.ft.sessionId&&0!==this.ft.data.length&&this.ft.data.every((t=>(null==t?void 0:t.type)===m.Custom&&!Sl(t)&&!xl(t)))}Cr(){var t,e;return null!==(t=null==(e=this.Ie)?void 0:e.getPendingTriggerConditions(this.sessionId))&&void 0!==t?t:[]}Mr(t){if(t!==Gs)return at(this.Tr)||this._instance.register_for_session({[Es]:[]}),void(this.Tr=void 0);var e=this.Cr();if(0===e.length)return at(this.Tr)||this._instance.register_for_session({[Es]:[]}),void(this.Tr=void 0);var i=e.join(", "),r=this.sessionId+":"+i;r!==this.Tr&&(this.Tr=r,this._instance.register_for_session({[Es]:e}),el.info("buffering: "+i))}St(){var t;if(this.er(),this.De)return this.ft;if(this.Sr())return this.ft.size>Xa?this.xt():this.ft;var e=this.ft;null==(t=this.Ie)||t.ensureSamplingDecision(this.sessionId);var i=this.yt(),r=this.status;if(this.Mr(r),r===Gs||r===Zs||r===zs||i)return this.ur(),this.ft;if(this.ft!==e)return this.ft;if(e.data.length>0){var n,s=this.kr();wo(e).forEach((t=>{var e;null==(e=this.ut)||e.trackSize(t.sessionId,t.size),this.Ir({$snapshot_bytes:t.size,$snapshot_data:t.data,$session_id:t.sessionId,$window_id:t.windowId,$lib:Ni.LIB_NAME,$lib_version:Ni.LIB_VERSION,$snapshot_host:s})})),null==(n=this.Ie)||n.onFlushComplete()}return this.xt()}cr(t){var e,i=2+((null==(e=this.ft)?void 0:e.data.length)||0),r=t.$session_id,n=this.ft.sessionId!==r;if(n||!0!==this.Fe&&!this.De&&this.ft.size+t.$snapshot_bytes+i>Xa){var s=this._e;if(this.ft=this.St(),this._e!==s)return;n&&this.ft.data.length>0&&(this.ft=this.xt()),this.ft.sessionId=r,this.ft.windowId=t.$window_id}this.De&&(this.qe||this.ft.size+t.$snapshot_bytes+i>Xa)?this.qe||(this.qe=!0,this.ft=this.xt()):(this.ft.size+=t.$snapshot_bytes,this.ft.data.push(t.$snapshot_data),this.ft.sizes.push(t.$snapshot_bytes),!0===this.Fe||this.De||this.ur())}Ir(t){this._instance.capture("$snapshot",t,{_url:this._instance.requestRouter.endpointFor("api",this.Ee),_noTruncate:!0,_batchKey:"recordings",skip_client_rate_limiting:!0})}get bt(){var t,e,i=null==(t=this.ft)?void 0:t.data[(null==(e=this.ft)?void 0:e.data.length)-1],r=this.Se.checkAndGetSessionAndWindowId(!0);return i?i.timestamp-r.sessionStartTimestamp:null}br(){if(!this.ft||0===this.ft.data.length)return this.xt();for(var t=-1,e=this.ft.data.length-1;e>=0;e--)if(this.ft.data[e].type===m.Meta){t=e;break}return 0>t?this.xt():(this.ft.data=this.ft.data.slice(t),this.ft.sizes=this.ft.sizes.slice(t),this.ft.size=this.ft.sizes.reduce(((t,e)=>t+e),0),this.ft)}xt(){return this.ft={size:0,data:[],sizes:[],sessionId:this._e,windowId:this.st},this.ft}ce(t,e){this._instance.register_for_session({[Ps]:t}),el.info(t.replace("_"," "),e),"session_id_changed"!==t&&this.be("$recording_started",p({reason:t},e))}Er(t){var e;return 3===t.type&&-1!==il.indexOf(null==(e=t.data)?void 0:e.source)}wr(t){var e=this.Er(t);e||!0===this.Fe||t.timestamp-this.Ae>this.xe&&(this.Fe=!0,clearInterval(this.zt),this.be("sessionIdle",{eventTimestamp:t.timestamp,lastActivityTimestamp:this.Ae,threshold:this.xe,bufferLength:this.ft.data.length,bufferSize:this.ft.size,sessionId:this._e,windowId:this.st}),this.St());var i=!1;if(e&&(this.Ae=t.timestamp,this.Fe)){var r="unknown"===this.Fe;this.Fe=!1,r||(this.be("sessionNoLongerIdle",{reason:"user activity",type:t.type}),i=!0)}var n=this.Se.checkAndGetSessionAndWindowId(!e,t.timestamp),s=n.windowId,o=n.sessionId,a=this._e!==o,l=this.st!==s;if(this.st=s,this._e=o,a||l){var u=a&&!1!==this.Fe;u&&(this.Fe="unknown"),this.ct(u)}else if(e&&this.Vt(),i){var h,d=["sampled","active"].includes(this.status)||(null==(h=this.Ie)?void 0:h.hasPendingTriggers(this.sessionId));this.Ne>0&&d&&this.de(),this.Wt()}}ht(){var t;null==(t=this.Ie)||t.clearConditionalRecordingPersistence()}get sdkDebugProperties(){var t,e,i,r,n,s,o,a,l,u=this.Se.checkAndGetSessionAndWindowId(!0).sessionStartTimestamp,h=null==(t=nl())||null==t.getDeferredStylesheetStats?void 0:t.getDeferredStylesheetStats();return{$recording_status:this.status,$sdk_debug_replay_internal_buffer_length:this.ft.data.length,$sdk_debug_replay_internal_buffer_size:this.ft.size,$sdk_debug_current_session_duration:this.bt,$sdk_debug_session_start:u,$sdk_debug_replay_flushed_size:null==(e=this.ut)?void 0:e.currentTrackedSize(this.sessionId),$sdk_debug_replay_full_snapshots:this.Qe,$snapshot_max_depth_exceeded:this.$e,$sdk_debug_replay_slowest_full_snapshot_ms:Za(null==(i=this.ar)?void 0:i.durationMs),$sdk_debug_replay_slowest_full_snapshot_stylesheet_ms:Za(null==(r=this.ar)?void 0:r.stylesheetMs),$sdk_debug_replay_slowest_full_snapshot_nodes:null==(n=this.ar)?void 0:n.nodeCount,$sdk_debug_replay_slowest_full_snapshot_css_rules:null==(s=this.ar)?void 0:s.cssRuleCount,$sdk_debug_replay_slowest_full_snapshot_css_rules_non_deferrable:null==(o=this.ar)?void 0:o.nonDeferrableCssRuleCount,$sdk_debug_replay_deferred_stylesheets:null==h?void 0:h.deferredCount,$sdk_debug_replay_deferred_stylesheets_failed:null==h?void 0:h.failedCount,$sdk_debug_replay_deferred_stylesheets_abandoned:null==h?void 0:h.abandonedCount,$sdk_debug_replay_deferred_stylesheet_ms:Za(null==h?void 0:h.totalMs),$sdk_debug_replay_deferred_stylesheet_slowest_slice_ms:Za(null==h?void 0:h.slowestSliceMs),$sdk_debug_replay_slowest_mutation_batch_ms:Za(null==(a=nl())||null==a.getMutationCost||null==(a=a.getMutationCost())?void 0:a.slowestBatchMs),$sdk_debug_replay_discarded_duration_samples:null==(l=nl())||null==l.getDiscardedDurationSamples?void 0:l.getDiscardedDurationSamples(),$sdk_debug_replay_rrweb_error:this.Be,$sdk_debug_rrweb_attached:!!this.Re,$sdk_debug_rrweb_start_attempted:this.He}}Kt(){var t;if(!this.Re){this.He=!0;var e,i,r,n,s={blockClass:"ph-no-capture",blockSelector:void 0,ignoreClass:"ph-ignore-input",maskTextClass:"ph-mask",maskTextSelector:void 0,maskTextFn:void 0,maskAllInputs:!0,maskInputOptions:{password:!0},maskInputFn:void 0,maskAllElementAttributes:!1,maskAttributeFn:void 0,slimDOMOptions:{},collectFonts:!1,inlineStylesheet:!0,inlineStylesheetBudgetRules:1e4,recordCrossOriginIframes:!1,sampling:void 0,attributeFilter:void 0},o=this._instance.config.session_recording;for(var a of Object.entries(o||{})){var l=a[0],u=a[1];if(l in s)if("maskInputOptions"===l)s.maskInputOptions=p({password:!0},u);else if("sampling"===l){var h=null!=u?u:{},d={};at(h.mousemove)||(d.mousemove=h.mousemove),at(h.mouseInteraction)||(d.mouseInteraction=h.mouseInteraction),s.sampling=d}else s[l]=u}this.Lt&&this.Lt.enabled&&(s.recordCanvas=!0,s.sampling=p({},s.sampling,{canvas:this.Lt.fps}),s.dataURLOptions={type:"image/webp",quality:this.Lt.quality},s.canvasResolutionScale=this.At,s.canvasMasking={configured:()=>{var t;return nt(null==(t=this._instance.config.session_recording)||null==(t=t.canvasCapture)?void 0:t.maskRegionsFn)},regionsFn:t=>{var e,i=null==(e=this._instance.config.session_recording)||null==(e=e.canvasCapture)?void 0:e.maskRegionsFn;if(nt(i))try{var r;return null!==(r=i(t))&&void 0!==r?r:null}catch(t){return this.Ve||(this.Ve=!0,el.warn("canvasCapture.maskRegionsFn threw, canvas frames will be skipped",t)),null}}}),this.Et&&(s.maskAllInputs=null===(e=this.Et.maskAllInputs)||void 0===e||e,s.maskTextSelector=null!==(i=this.Et.maskTextSelector)&&void 0!==i?i:void 0,s.blockSelector=null!==(r=this.Et.blockSelector)&&void 0!==r?r:void 0,s.maskAllElementAttributes=null!==(n=this.Et.maskAllElementAttributes)&&void 0!==n&&n),s.maskAllElementAttributes&&s.maskAttributeFn&&(s.maskAttributeFn=void 0,this.ze||(this.ze=!0,el.warn('`maskAllElementAttributes` and `maskAttributeFn` are mutually exclusive, and `maskAttributeFn` is being ignored. Remove one of the two. Note that `maskAllElementAttributes` can also come from your project\'s "Privacy and masking" settings. See https://posthog.com/docs/session-replay/privacy'))),this.Rt();var v=sl();if(v){this.ir=null!==(t=this.ir)&&void 0!==t?t:new oa(v,{refillRate:this._instance.config.session_recording.__mutationThrottlerRefillRate,bucketSize:this._instance.config.session_recording.__mutationThrottlerBucketSize,onBlockedNode:(t,e)=>{var i="Too many mutations on node '"+t+"'. Rate limiting. This could be due to SVG animations or something similar";el.info(i,{node:e}),this.log(tl+" "+i,"warn")}});var c=this.Nt();if(this.Re=v(p({emit:t=>{this.onRRwebEmit(t)},plugins:c,errorHandler:(t,e)=>"rrweb"===e&&(this.Ze||(this.Ze=!0,el.error("rrweb internal error - recording will continue but may be incomplete",t)),!0)},s)),!this.Re)return this.Be=!0,void el.error("rrweb failed to start - Loss of recording data is possible. Check the browser console for rrweb errors.");this.Be=!1,this.Ae=Date.now(),this.Fe=ft(this.Fe)?this.Fe:"unknown",this.tryAddCustomEvent("$remote_config_received",this.Me),this.be("$session_options",{sessionRecordingOptions:s,activePlugins:c.map((t=>null==t?void 0:t.name))}),this.be("$posthog_config",{config:this._instance.config})}else el.error("_startRecorder was called but rrwebRecord is not available. This indicates something has gone wrong.")}}tryAddCustomEvent(t,e){return this.be(t,e)}}var Tl,El=["type"],Ml=Object.defineProperty,Il=(t,e,i)=>((t,e,i)=>e in t?Ml(t,e,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[e]=i)(t,"symbol"!=typeof e?e+"":e,i),Rl=(t=>(t[t.DomContentLoaded=0]="DomContentLoaded",t[t.Load=1]="Load",t[t.FullSnapshot=2]="FullSnapshot",t[t.IncrementalSnapshot=3]="IncrementalSnapshot",t[t.Meta=4]="Meta",t[t.Custom=5]="Custom",t[t.Plugin=6]="Plugin",t))(Rl||{}),Pl=(t=>(t[t.Mutation=0]="Mutation",t[t.MouseMove=1]="MouseMove",t[t.MouseInteraction=2]="MouseInteraction",t[t.Scroll=3]="Scroll",t[t.ViewportResize=4]="ViewportResize",t[t.Input=5]="Input",t[t.TouchMove=6]="TouchMove",t[t.MediaInteraction=7]="MediaInteraction",t[t.StyleSheetRule=8]="StyleSheetRule",t[t.CanvasMutation=9]="CanvasMutation",t[t.Font=10]="Font",t[t.Log=11]="Log",t[t.Drag=12]="Drag",t[t.StyleDeclaration=13]="StyleDeclaration",t[t.Selection=14]="Selection",t[t.AdoptedStyleSheet=15]="AdoptedStyleSheet",t[t.CustomElement=16]="CustomElement",t))(Pl||{}),Al=(t=>(t[t.MouseUp=0]="MouseUp",t[t.MouseDown=1]="MouseDown",t[t.Click=2]="Click",t[t.ContextMenu=3]="ContextMenu",t[t.DblClick=4]="DblClick",t[t.Focus=5]="Focus",t[t.Blur=6]="Blur",t[t.TouchStart=7]="TouchStart",t[t.TouchMove_Departed=8]="TouchMove_Departed",t[t.TouchEnd=9]="TouchEnd",t[t.TouchCancel=10]="TouchCancel",t))(Al||{}),Ol=(t=>(t[t.Mouse=0]="Mouse",t[t.Pen=1]="Pen",t[t.Touch=2]="Touch",t))(Ol||{}),Fl=(t=>(t[t["2D"]=0]="2D",t[t.WebGL=1]="WebGL",t[t.WebGL2=2]="WebGL2",t))(Fl||{}),Ll=(t=>(t[t.Play=0]="Play",t[t.Pause=1]="Pause",t[t.Seeked=2]="Seeked",t[t.VolumeChange=3]="VolumeChange",t[t.RateChange=4]="RateChange",t))(Ll||{}),$l=(t=>(t[t.Document=0]="Document",t[t.DocumentType=1]="DocumentType",t[t.Element=2]="Element",t[t.Text=3]="Text",t[t.CDATA=4]="CDATA",t[t.Comment=5]="Comment",t))($l||{});function Dl(t,e){return-1!==t.indexOf(e)}var Nl={Node:["childNodes","parentNode","parentElement","textContent"],ShadowRoot:["host","styleSheets"],Element:["shadowRoot"],MutationObserver:[]},ql={Node:["contains","getRootNode"],ShadowRoot:["getSelection"],Element:["querySelector","querySelectorAll"],MutationObserver:["constructor"]},jl={};function Bl(t){if(jl[t])return jl[t];var e=function(t){var e,i,r=null==(i=null==(e=null==globalThis?void 0:globalThis.Zone)?void 0:e.__symbol__)?void 0:i.call(e,t);return r&&globalThis[r]?globalThis[r]:void 0}(t)||globalThis[t],i=e.prototype,r=t in Nl?Nl[t]:void 0,n=Boolean(r&&r.every((t=>{var e,r;return Boolean(null==(r=null==(e=Object.getOwnPropertyDescriptor(i,t))?void 0:e.get)?void 0:r.toString().includes("[native code]"))}))),s=t in ql?ql[t]:void 0,o=Boolean(s&&s.every((t=>{var e;return"function"==typeof i[t]&&(null==(e=i[t])?void 0:e.toString().includes("[native code]"))})));if(n&&o)return jl[t]=e.prototype,e.prototype;var a=document.createElement("iframe");a.style.display="none";var l=!1;try{document.body.appendChild(a);var u=a.contentWindow;if(!u)return e.prototype;var h=u[t].prototype;return h?(function(t){return Dl(t,"AppleWebKit")&&!Dl(t,"Chrome")}(navigator.userAgent)&&(a.classList.add("rr-block","ph-no-capture"),a.setAttribute("__rrwebUntaintedPrototype",t),l=!0),jl[t]=h):i}catch(t){return i}finally{!l&&a.parentNode&&document.body.removeChild(a)}}var Ul={};function Hl(t,e,i){var r,n=t+"."+String(i);if(Ul[n])return Ul[n].call(e);var s=Bl(t),o=null==(r=Object.getOwnPropertyDescriptor(s,i))?void 0:r.get;return o?(Ul[n]=o,o.call(e)):e[i]}var zl={};function Wl(t,e,i){var r=t+"."+String(i);if(zl[r])return zl[r].bind(e);var n=Bl(t)[i];return"function"!=typeof n?e[i]:(zl[r]=n,n.bind(e))}function Vl(){return Bl("MutationObserver").constructor}function Gl(t,e,i){try{if(!(e in t))return()=>{};var r=t[e],n={next:r},s=i((function(){for(var t=arguments.length,e=new Array(t),i=0;t>i;i++)e[i]=arguments[i];return n.next.apply(this,e)}));return"function"==typeof s&&(s.prototype=s.prototype||{},Object.defineProperties(s,{__rrweb_original__:{enumerable:!1,value:r},__rrweb_layer__:{enumerable:!1,value:n}})),t[e]=s,()=>{if(t[e]!==s)for(var i=t[e];"function"==typeof i&&i.__rrweb_layer__;){var r=i.__rrweb_layer__;if(r.next===s)return void(r.next=n.next);i=r.next}else t[e]=n.next}}catch(t){return()=>{}}}var Zl={childNodes:t=>Hl("Node",t,"childNodes"),parentNode:t=>Hl("Node",t,"parentNode"),parentElement:t=>Hl("Node",t,"parentElement"),textContent:t=>Hl("Node",t,"textContent"),contains:(t,e)=>Wl("Node",t,"contains")(e),getRootNode:t=>Wl("Node",t,"getRootNode")(),host:t=>t&&"host"in t?Hl("ShadowRoot",t,"host"):null,styleSheets:t=>t.styleSheets,shadowRoot:t=>t&&"shadowRoot"in t?Hl("Element",t,"shadowRoot"):null,querySelector:(t,e)=>Wl("Element",t,"querySelector")(e),querySelectorAll:(t,e)=>Wl("Element",t,"querySelectorAll")(e),mutationObserver:Vl,patch:Gl},Ql=()=>({durationMs:0,stylesheetMs:0,nodeCount:0,cssRuleCount:0,nonDeferrableCssRuleCount:0,deferredStylesheetCount:0});function Jl(){try{if("undefined"!=typeof performance&&performance.now)return performance.now()}catch(t){}return Date.now()}var Kl=0,Yl=6e4;function Xl(){Kl+=1}function tu(){return Kl}function eu(t,e){return e!==Kl||t>Yl}var iu=0,ru=0,nu=0,su=Ql(),ou=null,au=null,lu=[],uu=0,hu=0,du={slowestBatchMs:0},vu={deferredCount:0,failedCount:0,abandonedCount:0,totalMs:0,slowestSliceMs:0},cu=t=>t&&t>0?t:null;function fu(t){(iu+=1)>1||(su=Ql(),lu=[],uu=0,au=cu(t),ru=Jl(),nu=Kl)}function pu(){return 0===iu?ou||Ql():(iu-=1)>0?su:(su.durationMs=Jl()-ru,su.deferredStylesheetCount=uu,vu.deferredCount+=uu,au=null,eu(su.durationMs,nu)?su:ou=su)}var gu=32;function mu(t,e,i){var r=t.length;if(i>=gu)return r;for(var n=0;t.length>n;n++){var s=t[n];try{var o=s.cssRules;if(o&&o.length)r+=mu(o,e,i+1);else if(e&&s.styleSheet){var a=s.styleSheet;if(!e.has(a)){e.add(a);var l=a.rules||a.cssRules;l&&(r+=mu(l,e,i+1))}}}catch(t){}}return r}function yu(t){if(0!==iu){var e=mu(t,null,0);su.cssRuleCount+=e,hu>0&&(su.nonDeferrableCssRuleCount+=e)}}function _u(t){hu+=1;try{return t()}finally{hu-=1}}function bu(t){iu>0&&(su.stylesheetMs+=t)}function wu(t){if(0===iu||null===au)return!1;var e=su.cssRuleCount-su.nonDeferrableCssRuleCount;return e>=au||e+function(t){try{var e=t&&(t.rules||t.cssRules);if(!e)return 0;var i=new WeakSet;return i.add(t),mu(e,i,0)}catch(t){return 0}}(t)>au}function ku(){vu.failedCount+=1}function Su(t){t>0&&(vu.abandonedCount+=t)}function xu(t){return t.nodeType===t.ELEMENT_NODE}function Cu(t){var e=t&&"host"in t&&"mode"in t&&Zl.host(t)||null;return Boolean(e&&"shadowRoot"in e&&Zl.shadowRoot(e)===t)}function Tu(t){return"[object ShadowRoot]"==={}.toString.call(t)}function Eu(t){return t.includes(" background-clip: text;")&&!t.includes(" -webkit-background-clip: text;")&&(t=t.replace(/\sbackground-clip:\s*text;/g," -webkit-background-clip: text; background-clip: text;")),t}function Mu(t){var e=t.cssText;if(3>e.split('"').length)return e;var i=["@import","url("+JSON.stringify(t.href)+")"];return""===t.layerName?i.push("layer"):t.layerName&&i.push("layer("+t.layerName+")"),t.supportsText&&i.push("supports("+t.supportsText+")"),t.media.length&&i.push(t.media.mediaText),i.join(" ")+";"}var Iu=0;function Ru(t){var e=0===Iu,i=e?Jl():0;Iu+=1;try{var r=t.rules||t.cssRules;if(!r)return null;yu(r);var n=t.href;return!n&&t.ownerNode&&(n=t.ownerNode.baseURI),Eu(Array.from(r,(t=>Pu(t,n))).join(""))}catch(t){return null}finally{Iu-=1,e&&bu(Jl()-i)}}function Pu(t,e){var i;if(Ou(t)){var r;try{r=Ru(t.styleSheet)||Mu(t)}catch(e){r=t.cssText}try{if(r&&(null==(i=t.styleSheet)?void 0:i.href))return Qu(r,t.styleSheet.href)}catch(t){}return r}var n=t.cssText;return Fu(t)&&t.selectorText.includes(":")&&(n=Au(n)),e?Qu(n,e):n}function Au(t){return t.replace(/(\[(?:[\w-]+)[^\\])(:(?:[\w-]+)\])/gm,"$1\\$2")}function Ou(t){return"styleSheet"in t}function Fu(t){return"selectorText"in t}var Lu=/^-?[A-Za-z_][\w-]*$/,$u=/^-?[A-Za-z_][\w-]*(\.-?[A-Za-z_][\w-]*)*$/;function Du(t){var e=[],i=!1,r=null,n=new Map;function s(t){var n=e.pop();if("group"===n.kind){if(null===t){for(;e.length>0&&"group"===e[e.length-1].kind;)e.pop();return void s(null)}var a=e[e.length-1];return a.parts.push(t),void(a.index+=1)}if(!n.importRule)return i=!0,void(r=t);o(e[e.length-1],n.importRule,t)}function o(t,e,i){var r;try{var n;try{n=i||Mu(e)}catch(t){n=e.cssText}try{n&&(null==(r=e.styleSheet)?void 0:r.href)&&(n=Qu(n,e.styleSheet.href))}catch(t){}n&&t.parts.push(n),t.index+=1}catch(t){s(null)}}function a(t){var i=t.rules[t.index];if("sheet"===t.kind&&Ou(i)){var r=n.get(i);return null===r?(t.parts.push(i.cssText),void(t.index+=1)):r?void e.push({kind:"sheet",sheet:r.sheet,rules:r.rules,sheetHref:r.sheetHref,index:0,parts:[],importRule:i}):void o(t,i,null)}if(!function(t,i){try{var r=function(t){var e,i=t;if(!i.cssRules||0===i.cssRules.length)return null;if(i.media&&"string"==typeof i.media.mediaText)return"@media "+i.media.mediaText+" {";if(Fu(t)){if("number"==typeof i.type&&1!==i.type)return null;var r=i.style?i.style.cssText:"";return t.selectorText+" {"+(r?" "+r:"")}if("containerName"in i)return"string"!=typeof i.containerQuery||i.containerName&&!Lu.test(i.containerName)?null:"@container "+(i.containerName?i.containerName+" ":"")+i.containerQuery+" {";if("string"==typeof i.conditionText){var n="";try{n=(null==(e=t.constructor)?void 0:e.name)||""}catch(t){return null}return""===n||"Object"===n||"CSSSupportsRule"===n?"@supports "+i.conditionText+" {":null}return"string"==typeof i.name?"keyText"in i.cssRules[0]?Lu.test(i.name)?"@keyframes "+i.name+" {":null:""===i.name?"@layer {":$u.test(i.name)?"@layer "+i.name+" {":null:null}(t);if(null===r)return!1;var n=i.sheetHref;return e.push({kind:"group",rules:Array.from(t.cssRules),sheetHref:n,index:0,parts:[],prelude:n?Qu(r,n):r,fixColons:"sheet"===i.kind&&Fu(t)&&t.selectorText.includes(":")}),!0}catch(t){return!1}}(i,t)){var s=i.cssText;"sheet"===t.kind&&Fu(i)&&i.selectorText.includes(":")&&(s=Au(s)),t.parts.push(t.sheetHref?Qu(s,t.sheetHref):s),t.index+=1}}return function(t){try{var i=t.rules||t.cssRules;if(!i)return!1;yu(i);var r=t.href;!r&&t.ownerNode&&(r=t.ownerNode.baseURI);var s=Array.from(i);return e.push({kind:"sheet",sheet:t,rules:s,sheetHref:r,index:0,parts:[],importRule:null}),function(t,e){for(var i=[{sheet:e,rules:t,index:0}],r=function(){var t=i[i.length-1];if(t.index>=t.rules.length)return i.pop(),0;var e=t.rules[t.index];if(t.index+=1,!Ou(e)||n.has(e))return 0;var r=null;try{r=e.styleSheet}catch(t){return n.set(e,null),0}if(!r||i.some((t=>t.sheet===r)))return 0;try{var s=r.rules||r.cssRules;if(!s)return 0;yu(s);var o=r.href;!o&&r.ownerNode&&(o=r.ownerNode.baseURI);var a=Array.from(s);n.set(e,{sheet:r,rules:a,sheetHref:o}),i.push({sheet:r,rules:a,index:0})}catch(t){}};i.length>0;)r()}(s,t),!0}catch(t){return!1}}(t)||(i=!0),{advance(t){if(i)return!0;var n=Jl(),o=t>0?t:1;try{for(;!i&&o>0;){var l=e[e.length-1];if(l.rules.length>l.index){o-=1;try{a(l)}catch(t){s(null)}}else{var u=null;try{if("group"===l.kind){var h=l.prelude+l.parts.join("")+"}";u=l.fixColons?Au(h):h}else u=Eu(l.parts.join(""))}catch(t){}s(u)}}}catch(t){i=!0,r=null}finally{bu(Jl()-n)}return i},text:()=>i?r:null,remainingRules(){if(i)return 0;var t=0;for(var r of e)t+=r.rules.length-r.index;return t}}}class Nu{constructor(){Il(this,"idNodeMap",new Map),Il(this,"nodeMetaMap",new WeakMap)}getId(t){var e;if(!t)return-1;var i=null==(e=this.getMeta(t))?void 0:e.id;return null!=i?i:-1}getNode(t){return this.idNodeMap.get(t)||null}getIds(){return Array.from(this.idNodeMap.keys())}getMeta(t){return this.nodeMetaMap.get(t)||null}removeNodeFromMap(t){var e=this.getId(t);if(this.idNodeMap.delete(e),t.childNodes&&t.childNodes.forEach((t=>this.removeNodeFromMap(t))),xu(t)){var i=Zl.shadowRoot(t);i&&this.removeNodeFromMap(i),"IFRAME"===t.nodeName&&t.contentDocument&&this.removeNodeFromMap(t.contentDocument)}}has(t){return this.idNodeMap.has(t)}hasNode(t){return this.nodeMetaMap.has(t)}add(t,e){this.idNodeMap.set(e.id,t),this.nodeMetaMap.set(t,e)}replace(t,e){var i=this.getNode(t);if(i){var r=this.nodeMetaMap.get(i);r&&this.nodeMetaMap.set(e,r)}this.idNodeMap.set(t,e)}reset(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap}}function qu(t){var e=t.element,i=t.maskInputOptions,r=t.tagName,n=t.type,s=t.maskInputFn,o=t.value||"",a=n&&ju(n);return(i[r.toLowerCase()]||a&&i[a])&&(o=s?s(o,e):"*".repeat(o.length)),o}function ju(t){return t.toLowerCase()}var Bu=new Set(["rr_width","rr_height","rr_left","rr_top","rr_position","rr_transform","rr_display","rr_scrollleft","rr_scrolltop","rr_mediastate","rr_open_mode"]);function Uu(t){var e=t.element,i=t.name,r=t.value,n=t.maskAttributeFn,s=t.isGenerated;return r?t.maskAllElementAttributes?void 0!==s&&s&&Bu.has(ju(i))?r:"*".repeat(r.length):n?n(i,r,e):r:r}var Hu="__rrweb_original__";function zu(t){try{var e=t.type;return t.hasAttribute("data-rr-is-password")?"password":e?ju(e):null}catch(t){return null}}var Wu=/url\((?:(')([^']*)'|(")(.*?)"|([^)]*))\)/gm,Vu=/^(?:[a-z+]+:)?\/\//i,Gu=/^www\..*/i,Zu=/^(data:)([^,]*),(.*)/i;function Qu(t,e){return(t||"").replace(Wu,((t,i,r,n,s,o)=>{var a,l=r||s||o,u=i||n||"";if(!l)return t;if(Vu.test(l)||Gu.test(l))return"url("+u+l+u+")";if(Zu.test(l))return"url("+u+l+u+")";if("/"===l[0])return"url("+u+(((a=e).indexOf("//")>-1?a.split("/").slice(0,3).join("/"):a.split("/")[0]).split("?")[0]+l)+u+")";var h=e.split("/"),d=l.split("/");for(var v of(h.pop(),d))"."!==v&&(".."===v?h.pop():h.push(v));return"url("+u+h.join("/")+u+")"}))}var Ju,Ku,Yu="data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTAwJSIgaGVpZ2h0PSIxMDAlIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPgogIDxkZWZzPgogICAgPHBhdHRlcm4gaWQ9InN0cmlwZXMiIHBhdHRlcm5Vbml0cz0idXNlclNwYWNlT25Vc2UiIHdpZHRoPSIxNiIgaGVpZ2h0PSIxNiI+CiAgICAgIDxyZWN0IHdpZHRoPSIxNiIgaGVpZ2h0PSIxNiIgZmlsbD0iYmxhY2siLz4KICAgICAgPHBhdGggZD0iTTggMEgxNkwwIDE2VjhMOCAwWiIgZmlsbD0iIzJEMkQyRCIvPgogICAgICA8cGF0aCBkPSJNMTYgOFYxNkg4TDE2IDhaIiBmaWxsPSIjMkQyRDJEIi8+CiAgICA8L3BhdHRlcm4+CiAgPC9kZWZzPgogIDxyZWN0IHdpZHRoPSIxMDAlIiBoZWlnaHQ9IjEwMCUiIGZpbGw9InVybCgjc3RyaXBlcykiLz4KPC9zdmc+Cg==",Xu=4096,th=1e5,eh=10,ih=new Map,rh=1,nh=new RegExp("[^a-z0-9-_:]"),sh=-2;function oh(){return rh++}var ah=/^[^ \t\n\r\u000c]+/,lh=/^[, \t\n\r\u000c]+/,uh=new WeakMap;function hh(t,e){return e&&""!==e.trim()?dh(t,e):e}function dh(t,e){var i=uh.get(t);if(i||(i=t.createElement("a"),uh.set(t,i)),e){if(e.startsWith("blob:")||e.startsWith("data:"))return e}else e="";return i.setAttribute("href",e),i.href}function vh(t,e){return(null==e?void 0:e.maxBase64ImageLength)?function(t,e){return e&&t.length>e?Yu:t}(t,e.maxBase64ImageLength):t}function ch(t,e,i,r,n,s){var o;if(!r)return r;if("src"===i||"href"===i&&("use"!==e||"#"!==r[0])){if("link"===e&&n){var a=null==(o=n.sheet)?void 0:o.href;if(a)return a}var l=hh(t,r);if(l.startsWith("data:")){if("img"===e&&n){var u=l;return((null==s?void 0:s.type)||void 0!==(null==s?void 0:s.quality))&&(u=function(t,e,i,r){if(th>e.length)return e;if(!t.complete||0===t.naturalWidth)return e;if(t.naturalWidth>Xu||t.naturalHeight>Xu)return e;var n=ih.get(e);if(n&&n.type===i&&n.quality===r)return n.result;try{var s=document.createElement("canvas");s.width=t.naturalWidth,s.height=t.naturalHeight;var o=s.getContext("2d");if(!o)return e;o.drawImage(t,0,0);var a=s.toDataURL(i||"image/webp",null!=r?r:.4),l=e.length>a.length?a:e;if(ih.size>=eh){var u=ih.keys().next().value;void 0!==u&&ih.delete(u)}return ih.set(e,{type:i,quality:r,result:l}),l}catch(t){return e}}(n,l,s.type,s.quality)),vh(u,s)}if("image"===e)return vh(l,s)}return l}if("xlink:href"===i&&"#"!==r[0]){var h=hh(t,r);return"image"===e&&h.startsWith("data:")?vh(h,s):h}return"background"!==i||"table"!==e&&"td"!==e&&"th"!==e?"srcset"===i?function(t,e){if(""===e.trim())return e;var i=0;function r(t){var r,n=t.exec(e.substring(i));return n?(i+=(r=n[0]).length,r):""}for(var n=[];r(lh),e.length>i;){var s=r(ah);if(","===s.slice(-1))s=hh(t,s.substring(0,s.length-1)),n.push(s);else{var o="";s=hh(t,s);for(var a=!1;;){var l=e.charAt(i);if(""===l){n.push((s+o).trim());break}if(a)")"===l&&(a=!1);else{if(","===l){i+=1,n.push((s+o).trim());break}"("===l&&(a=!0)}o+=l,i+=1}}}return n.join(", ")}(t,r):"style"===i?Qu(r,dh(t)):"object"===e&&"data"===i?hh(t,r):r:hh(t,r)}function fh(t,e,i){return("video"===t||"audio"===t)&&"autoplay"===e}function ph(t,e,i){if(!t)return!1;if(t.nodeType!==t.ELEMENT_NODE)return!!i&&ph(Zl.parentNode(t),e,i);for(var r=t.classList.length;r--;)if(e.test(t.classList[r]))return!0;return!!i&&ph(Zl.parentNode(t),e,i)}function gh(t,e,i,r){var n;if(xu(t)){if(!Zl.childNodes(n=t).length)return!1}else{if(null===Zl.parentElement(t))return!1;n=Zl.parentElement(t)}try{if("string"==typeof e){if(r){if(n.closest("."+e))return!0}else if(n.classList.contains(e))return!0}else if(ph(n,e,r))return!0;if(i)if(r){if(n.closest(i))return!0}else if(n.matches(i))return!0}catch(t){}return!1}function mh(t,e,i){var r=t.removeEventListener;"function"==typeof r&&r.call(t,e,i)}var yh=new Map;function _h(t,e){return Array.from(t.styleSheets).find((t=>t.href===e))}function bh(t){return null==t?"":t.toLowerCase()}var wh=50,kh=!1,Sh=!1;function xh(t,e){var i=e.doc,r=e.mirror,n=e.blockClass,s=e.blockSelector,o=e.maskTextClass,a=e.maskTextSelector,l=e.skipChild,u=void 0!==l&&l,h=e.inlineStylesheet,d=void 0===h||h,v=e.maskInputOptions,c=void 0===v?{}:v,f=e.maskTextFn,p=e.maskInputFn,g=e.maskAllElementAttributes,m=void 0!==g&&g,y=e.maskAttributeFn,_=e.slimDOMOptions,b=e.dataURLOptions,w=void 0===b?{}:b,k=e.inlineImages,S=void 0!==k&&k,x=e.recordCanvas,C=void 0!==x&&x,T=e.canvasMaskingConfigured,E=e.onSerialize,M=e.onIframeLoad,I=e.iframeLoadTimeout,R=void 0===I?5e3:I,P=e.onIframeListenerRegistered,A=e.onStylesheetLoad,O=e.stylesheetLoadTimeout,F=void 0===O?5e3:O,L=e.keepIframeSrcFn,D=void 0===L?()=>!1:L,N=e.newlyAddedElement,q=void 0!==N&&N,j=e.depth,B=void 0===j?0:j,U=e.maxDepth,H=void 0===U?wh:U,z=e.needsMask,W=e.preserveWhiteSpace,V=void 0===W||W;if(B>=H)return Sh=!0,kh||(kh=!0,console.warn("[rrweb-snapshot] DOM tree depth exceeded max depth of "+H+". Children beyond this depth will not be recorded. This may indicate deeply nested DOM structures.")),null;z||(z=gh(t,o,a,void 0===z)),iu>0&&(su.nodeCount+=1);var G,Z=function(t,e){var i=e.doc,r=e.blockClass,n=e.blockSelector,s=e.needsMask,o=e.inlineStylesheet,a=e.maskInputOptions,l=void 0===a?{}:a,u=e.maskTextFn,h=e.maskInputFn,d=e.maskAllElementAttributes,v=void 0!==d&&d,c=e.maskAttributeFn,f=e.dataURLOptions,p=void 0===f?{}:f,g=e.inlineImages,m=e.recordCanvas,y=e.canvasMaskingConfigured,_=e.keepIframeSrcFn,b=e.newlyAddedElement,w=void 0!==b&&b,k=function(t,e){if(e.hasNode(t)){var i=e.getId(t);return 1===i?void 0:i}}(i,e.mirror);switch(t.nodeType){case t.DOCUMENT_NODE:return"CSS1Compat"!==t.compatMode?{type:$l.Document,childNodes:[],compatMode:t.compatMode}:{type:$l.Document,childNodes:[]};case t.DOCUMENT_TYPE_NODE:return{type:$l.DocumentType,name:t.name,publicId:t.publicId,systemId:t.systemId,rootId:k};case t.ELEMENT_NODE:return function(t,e){for(var i,r,n,s=e.doc,o=e.inlineStylesheet,a=e.maskInputOptions,l=void 0===a?{}:a,u=e.maskInputFn,h=e.maskAllElementAttributes,d=void 0!==h&&h,v=e.maskAttributeFn,c=e.dataURLOptions,f=void 0===c?{}:c,p=e.inlineImages,g=e.recordCanvas,m=e.canvasMaskingConfigured,y=e.keepIframeSrcFn,_=e.newlyAddedElement,b=void 0!==_&&_,w=e.rootId,k=function(t,e,i){try{if("string"==typeof e){if(t.classList.contains(e))return!0}else for(var r=t.classList.length;r--;)if(e.test(t.classList[r]))return!0;if(i)return t.matches(i)}catch(t){}return!1}(t,e.blockClass,e.blockSelector),S=function(t){if(t instanceof HTMLFormElement)return"form";var e=ju(t.tagName);return nh.test(e)?"div":e}(t),x=new Set,C={},T=t.attributes.length,E=0;T>E;E++){var M=t.attributes[E];fh(S,M.name)||(C[M.name]=ch(s,S,ju(M.name),M.value,t,f))}if("link"===S&&o&&!k){var I=t.sheet;if(!I){var R=function(t){return t.href}(t);R&&!(I=_h(s,R))&&R.includes(".css")&&(I=_h(s,window.location.origin+"/"+R.replace(window.location.href,"")))}var P=null;I&&(wu(I)?iu>0&&(lu.push(t),uu+=1):P=Ru(I)),P&&(delete C.rel,delete C.href,C._cssText=P)}if("style"===S&&t.sheet&&!(t.innerText||Zl.textContent(t)||"").trim().length){var A=_u((()=>Ru(t.sheet)));A&&(C._cssText=A)}if("input"===S||"textarea"===S||"select"===S){var O=t.value,F=t.checked;"radio"!==C.type&&"checkbox"!==C.type&&"submit"!==C.type&&"button"!==C.type&&O?C.value=qu({element:t,type:zu(t),tagName:S,value:O,maskInputOptions:l,maskInputFn:u}):F&&(C.checked=F)}if("option"===S&&(t.selected&&!l.select?C.selected=!0:delete C.selected),"dialog"===S&&t.open){try{C.rr_open_mode=t.matches("dialog:modal")?"modal":"non-modal"}catch(t){C.rr_open_mode="modal",C.ph_rr_could_not_detect_modal=!0}x.add("rr_open_mode")}if("canvas"===S&&g&&!(null==m?void 0:m()))if("2d"===t.__context)(function(t){var e=t.getContext("2d");if(!e)return!0;for(var i=0;t.width>i;i+=50)for(var r=0;t.height>r;r+=50){var n=e.getImageData;if(new Uint32Array((Hu in n?n[Hu]:n).call(e,i,r,Math.min(50,t.width-i),Math.min(50,t.height-r)).data.buffer).some((t=>0!==t)))return!1}return!0})(t)||(C.rr_dataURL=t.toDataURL(f.type,f.quality));else if(!("__context"in t)){var L=t.toDataURL(f.type,f.quality),D=s.createElement("canvas");D.width=t.width,D.height=t.height,L!==D.toDataURL(f.type,f.quality)&&(C.rr_dataURL=L)}var N,q,j=!1;if("img"===S&&p){Ju||(Ju=s.createElement("canvas"),Ku=Ju.getContext("2d"));var B=t,U=B.currentSrc||B.getAttribute("src")||"<unknown-src>",H=B.crossOrigin,z=(e,i)=>j?Uu({element:t,name:e,value:i,maskAllElementAttributes:d,maskAttributeFn:v}):i,W=()=>{mh(B,"load",W);try{Ju.width=B.naturalWidth,Ju.height=B.naturalHeight,Ku.drawImage(B,0,0);var t=Ju.toDataURL(f.type,f.quality);C.rr_dataURL=z("rr_dataURL",t)}catch(t){if("anonymous"!==B.crossOrigin)return B.crossOrigin="anonymous",void(B.complete&&0!==B.naturalWidth?W():B.addEventListener("load",W));console.warn("Cannot inline img src="+U+"! Error: "+t)}"anonymous"===B.crossOrigin&&(H?C.crossOrigin=z("crossOrigin",H):B.removeAttribute("crossorigin"))};B.complete&&0!==B.naturalWidth?W():B.addEventListener("load",W)}if("audio"===S||"video"===S){var V=C;V.rr_mediaState=t.paused?"paused":"played",x.add("rr_mediaState"),V.rr_mediaCurrentTime=t.currentTime,V.rr_mediaPlaybackRate=t.playbackRate,V.rr_mediaMuted=t.muted,V.rr_mediaLoop=t.loop,V.rr_mediaVolume=t.volume}if(b||(t.scrollLeft&&(C.rr_scrollLeft=t.scrollLeft),t.scrollTop&&(C.rr_scrollTop=t.scrollTop)),k){var G=t.getBoundingClientRect(),Z=G.width,Q=G.height,J=G.left,K=G.top,Y=null==(i=s.defaultView)?void 0:i.getComputedStyle(t);C={class:C.class,rr_width:Z+"px",rr_height:Q+"px",rr_left:Math.floor(J+((null==(r=s.defaultView)?void 0:r.scrollX)||0))+"px",rr_top:Math.floor(K+((null==(n=s.defaultView)?void 0:n.scrollY)||0))+"px"},x.add("rr_width"),x.add("rr_height"),x.add("rr_left"),x.add("rr_top"),Y&&(C.rr_position=Y.position||"static",x.add("rr_position"),Y.transform&&"none"!==Y.transform&&(C.rr_transform=Y.transform,x.add("rr_transform")),Y.display&&Y.display.startsWith("inline")&&(C.rr_display=Y.display,x.add("rr_display")))}if("iframe"!==S||y(C.src)||(t.contentDocument||(C.rr_src=C.src),delete C.src),d||v)for(var X of Object.entries(C)){var tt=X[0],et=X[1];"string"!=typeof et&&null!==et||(C[tt]=Uu({element:t,name:tt,value:et,maskAllElementAttributes:d,maskAttributeFn:v,isGenerated:x.has(tt)}))}j=!0;try{customElements.get(S)&&(N=!0)}catch(t){}return{type:$l.Element,tagName:S,attributes:C,childNodes:[],isSVG:(q=t,Boolean("svg"===q.tagName||q.ownerSVGElement)||void 0),needBlock:k,rootId:w,isCustom:N}}(t,{doc:i,blockClass:r,blockSelector:n,inlineStylesheet:o,maskInputOptions:l,maskInputFn:h,maskAllElementAttributes:v,maskAttributeFn:c,dataURLOptions:p,inlineImages:g,recordCanvas:m,canvasMaskingConfigured:y,keepIframeSrcFn:_,newlyAddedElement:w,rootId:k});case t.TEXT_NODE:return function(t,e){var i,r=e.needsMask,n=e.maskTextFn,s=e.rootId,o=Zl.parentNode(t),a=o&&o.tagName,l=Zl.textContent(t),u="STYLE"===a||void 0,h="SCRIPT"===a||void 0;if(u&&l){try{if(t.nextSibling||t.previousSibling);else if(wu(o.sheet));else if(null==(i=o.sheet)?void 0:i.cssRules){var d=Ru(o.sheet);d&&!/(?:^|[\s;{}])-?[a-zA-Z][\w-]*\s*:\s*;/.test(d)&&(l=d)}}catch(e){console.warn("Cannot get CSS styles from text's parentNode. Error: "+e,t)}l=Qu(l,dh(e.doc))}return h&&(l="SCRIPT_PLACEHOLDER"),!u&&!h&&l&&r&&(l=n?n(l,Zl.parentElement(t)):l.replace(/[\S]/g,"*")),{type:$l.Text,textContent:l||"",isStyle:u,rootId:s}}(t,{doc:i,needsMask:s,maskTextFn:u,rootId:k});case t.CDATA_SECTION_NODE:return{type:$l.CDATA,textContent:"",rootId:k};case t.COMMENT_NODE:return{type:$l.Comment,textContent:Zl.textContent(t)||"",rootId:k};default:return!1}}(t,{doc:i,mirror:r,blockClass:n,blockSelector:s,needsMask:z,inlineStylesheet:d,maskInputOptions:c,maskTextFn:f,maskInputFn:p,maskAllElementAttributes:m,maskAttributeFn:y,dataURLOptions:w,inlineImages:S,recordCanvas:C,canvasMaskingConfigured:T,keepIframeSrcFn:D,newlyAddedElement:q});if(!Z)return console.warn(t,"not serialized"),null;G=r.hasNode(t)?r.getId(t):function(t,e){if(e.comment&&t.type===$l.Comment)return!0;if(t.type===$l.Element){if(e.script&&("script"===t.tagName||"link"===t.tagName&&("preload"===t.attributes.rel&&"script"===t.attributes.as||"modulepreload"===t.attributes.rel)||"link"===t.tagName&&"prefetch"===t.attributes.rel&&"string"==typeof t.attributes.href&&"js"===function(t,e){var i,r;try{r=new URL(t,window.location.href)}catch(t){return null}var n=r.pathname.match(/\.([0-9a-z]+)(?:$)/i);return null!==(i=null==n?void 0:n[1])&&void 0!==i?i:null}(t.attributes.href)))return!0;if(e.headFavicon&&("link"===t.tagName&&"shortcut icon"===t.attributes.rel||"meta"===t.tagName&&(bh(t.attributes.name).match(/^msapplication-tile(image|color)$/)||"application-name"===bh(t.attributes.name)||["icon","apple-touch-icon","shortcut icon"].includes(bh(t.attributes.rel)))))return!0;if("meta"===t.tagName){if(e.headMetaDescKeywords&&bh(t.attributes.name).match(/^description|keywords$/))return!0;if(e.headMetaSocial&&(bh(t.attributes.property).match(/^(og|twitter|fb):/)||bh(t.attributes.name).match(/^(og|twitter):/)||"pinterest"===bh(t.attributes.name)))return!0;if(e.headMetaRobots&&["robots","googlebot","bingbot"].includes(bh(t.attributes.name)))return!0;if(e.headMetaHttpEquiv&&void 0!==t.attributes["http-equiv"])return!0;if(e.headMetaAuthorship&&(["author","generator","framework","publisher","progid"].includes(bh(t.attributes.name))||bh(t.attributes.property).match(/^article:/)||bh(t.attributes.property).match(/^product:/)))return!0;if(e.headMetaVerification&&["google-site-verification","yandex-verification","csrf-token","p:domain_verify","verify-v1","verification","shopify-checkout-api-token"].includes(bh(t.attributes.name)))return!0}}return!1}(Z,_)||!V&&Z.type===$l.Text&&!Z.isStyle&&!Z.textContent.replace(/^\s+|\s+$/gm,"").length?sh:oh();var Q=Object.assign(Z,{id:G});if(r.add(t,Q),G===sh)return null;E&&E(t);var J=!u;if(Q.type===$l.Element){J=J&&!Q.needBlock,delete Q.needBlock;var K=Zl.shadowRoot(t);K&&Tu(K)&&(Q.isShadowHost=!0)}if((Q.type===$l.Document||Q.type===$l.Element)&&J){_.headWhitespace&&Q.type===$l.Element&&"head"===Q.tagName&&(V=!1);var Y={doc:i,mirror:r,blockClass:n,blockSelector:s,needsMask:z,maskTextClass:o,maskTextSelector:a,skipChild:u,inlineStylesheet:d,maskInputOptions:c,maskTextFn:f,maskInputFn:p,maskAllElementAttributes:m,maskAttributeFn:y,slimDOMOptions:_,dataURLOptions:w,inlineImages:S,recordCanvas:C,canvasMaskingConfigured:T,preserveWhiteSpace:V,onSerialize:E,onIframeLoad:M,iframeLoadTimeout:R,onIframeListenerRegistered:P,onStylesheetLoad:A,stylesheetLoadTimeout:F,keepIframeSrcFn:D,depth:B+1,maxDepth:H};if(Q.type===$l.Element&&"textarea"===Q.tagName&&void 0!==Q.attributes.value);else for(var X of Array.from(Zl.childNodes(t))){var tt=xh(X,Y);tt&&Q.childNodes.push(tt)}var et=null;if(xu(t)&&(et=Zl.shadowRoot(t)))for(var it of Array.from(Zl.childNodes(et))){var rt=xh(it,Y);rt&&(Tu(et)&&(rt.isShadow=!0),Q.childNodes.push(rt))}}var nt=Zl.parentNode(t);if(nt&&Cu(nt)&&Tu(nt)&&(Q.isShadow=!0),Q.type===$l.Element&&"iframe"===Q.tagName){var st=function(t,e,i){var r,n=()=>{},s=t.contentWindow;if(!s)return n;try{r=s.document.readyState}catch(t){return n}var o=()=>e();if("complete"!==r){var a=!1,l=null,u=()=>{a||(a=!0,null!==l&&(clearTimeout(l),l=null),mh(t,"load",h),t.addEventListener("load",o),e())},h=()=>u();return l=setTimeout(u,i),t.addEventListener("load",h),()=>{null!==l&&(clearTimeout(l),l=null),a?mh(t,"load",o):(a=!0,mh(t,"load",h))}}var d,v="about:blank";try{d=s.location.href}catch(t){return n}if(d!==v||t.src===v||""===t.src){var c=setTimeout(e,0);return t.addEventListener("load",o),()=>{clearTimeout(c),mh(t,"load",o)}}return t.addEventListener("load",o),()=>{mh(t,"load",o)}}(t,(()=>{var e=t.contentDocument;if(e&&M){var i=xh(e,{doc:e,mirror:r,blockClass:n,blockSelector:s,needsMask:z,maskTextClass:o,maskTextSelector:a,skipChild:!1,inlineStylesheet:d,maskInputOptions:c,maskTextFn:f,maskInputFn:p,maskAllElementAttributes:m,maskAttributeFn:y,slimDOMOptions:_,dataURLOptions:w,inlineImages:S,recordCanvas:C,canvasMaskingConfigured:T,preserveWhiteSpace:V,onSerialize:E,onIframeLoad:M,iframeLoadTimeout:R,onIframeListenerRegistered:P,onStylesheetLoad:A,stylesheetLoadTimeout:F,keepIframeSrcFn:D,depth:B+1,maxDepth:H});i&&M(t,i)}}),R);null==P||P(t,st)}return Q.type===$l.Element&&"link"===Q.tagName&&"stylesheet"===Q.attributes.rel&&function(e,l,u){if(!yh.has(e)){var h;try{h=e.sheet}catch(t){return}if(!h){var v=new AbortController,g=!1,b=()=>{if(!g){g=!0;try{(()=>{if(A){var e=xh(t,{doc:i,mirror:r,blockClass:n,blockSelector:s,needsMask:z,maskTextClass:o,maskTextSelector:a,skipChild:!1,inlineStylesheet:d,maskInputOptions:c,maskTextFn:f,maskInputFn:p,maskAllElementAttributes:m,maskAttributeFn:y,slimDOMOptions:_,dataURLOptions:w,inlineImages:S,recordCanvas:C,canvasMaskingConfigured:T,preserveWhiteSpace:V,onSerialize:E,onIframeLoad:M,iframeLoadTimeout:R,onStylesheetLoad:A,stylesheetLoadTimeout:F,keepIframeSrcFn:D,depth:B,maxDepth:H});e&&A(t,e)}})()}finally{yh.delete(e),v.abort()}}},k=setTimeout(b,u);v.signal.addEventListener("abort",(()=>clearTimeout(k)),{once:!0}),e.addEventListener("load",b,{signal:v.signal,once:!0}),yh.set(e,v)}}}(t,0,F),Q}function Ch(t){return!0===t||"all"===t?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaVerification:!0,headMetaAuthorship:"all"===t,headMetaDescKeywords:"all"===t,headTitleMutations:"all"===t}:!1===t?{}:t}class Th{constructor(){Il(this,"parentElement",null),Il(this,"parentNode",null),Il(this,"ownerDocument"),Il(this,"firstChild",null),Il(this,"lastChild",null),Il(this,"previousSibling",null),Il(this,"nextSibling",null),Il(this,"ELEMENT_NODE",1),Il(this,"TEXT_NODE",3),Il(this,"nodeType"),Il(this,"nodeName"),Il(this,"RRNodeType")}get childNodes(){for(var t=[],e=this.firstChild;e;)t.push(e),e=e.nextSibling;return t}contains(t){if(!(t instanceof Th))return!1;if(t.ownerDocument!==this.ownerDocument)return!1;if(t===this)return!0;for(;t.parentNode;){if(t.parentNode===this)return!0;t=t.parentNode}return!1}appendChild(t){throw new Error("RRDomException: Failed to execute 'appendChild' on 'RRNode': This RRNode type does not support this method.")}insertBefore(t,e){throw new Error("RRDomException: Failed to execute 'insertBefore' on 'RRNode': This RRNode type does not support this method.")}removeChild(t){throw new Error("RRDomException: Failed to execute 'removeChild' on 'RRNode': This RRNode type does not support this method.")}toString(){return"RRNode"}}function Eh(t,e,i){void 0===i&&(i=document);var r={capture:!0,passive:!0};return i.addEventListener(t,e,r),()=>Mh(i,t,e,r)}function Mh(t,e,i,r){Ih((()=>{var n=t.removeEventListener;"function"==typeof n&&(void 0!==r?n.call(t,e,i,r):n.call(t,e,i))}))}function Ih(t){try{t()}catch(t){if(!(t instanceof DOMException&&"SecurityError"===t.name))throw t}}var Rh="Please stop import mirror directly. Instead of that,\r\nnow you can use replayer.getMirror() to access the mirror instance of a replayer,\r\nor you can use record.mirror to access the mirror instance during recording.",Ph={map:{},getId(){return console.error(Rh),-1},getNode(){return console.error(Rh),null},removeNodeFromMap(){console.error(Rh)},has(){return console.error(Rh),!1},reset(){console.error(Rh)}};function Ah(t,e,i){void 0===i&&(i={});var r=null,n=0;return function(){for(var s=arguments.length,o=new Array(s),a=0;s>a;a++)o[a]=arguments[a];var l=Date.now();n||!1!==i.leading||(n=l);var u=e-(l-n),h=this;0>=u||u>e?(r&&(clearTimeout(r),r=null),n=l,t.apply(h,o)):r||!1===i.trailing||(r=setTimeout((()=>{n=!1===i.leading?0:Date.now(),r=null,t.apply(h,o)}),u))}}function Oh(t,e,i,r,n){void 0===n&&(n=window);var s=n.Object.getOwnPropertyDescriptor(t,e);return n.Object.defineProperty(t,e,r?i:{set(t){if(setTimeout((()=>{try{i.set.call(this,t)}catch(t){}}),0),s&&s.set){if(s.get)try{s.get.call(this)}catch(t){return}s.set.call(this,t)}}}),()=>Oh(t,e,s||{},!0)}"undefined"!=typeof window&&window.Proxy&&window.Reflect&&(Ph=new Proxy(Ph,{get(t,e,i){return"map"===e&&console.error(Rh),Reflect.get(t,e,i)}}));var Fh=Date.now;function Lh(t){var e,i,r,n,s=t.document;return{left:s.scrollingElement?s.scrollingElement.scrollLeft:void 0!==t.pageXOffset?t.pageXOffset:s.documentElement.scrollLeft||(null==s?void 0:s.body)&&(null==(e=Zl.parentElement(s.body))?void 0:e.scrollLeft)||(null==(i=null==s?void 0:s.body)?void 0:i.scrollLeft)||0,top:s.scrollingElement?s.scrollingElement.scrollTop:void 0!==t.pageYOffset?t.pageYOffset:(null==s?void 0:s.documentElement.scrollTop)||(null==s?void 0:s.body)&&(null==(r=Zl.parentElement(s.body))?void 0:r.scrollTop)||(null==(n=null==s?void 0:s.body)?void 0:n.scrollTop)||0}}function $h(){return window.innerHeight||document.documentElement&&document.documentElement.clientHeight||document.body&&document.body.clientHeight}function Dh(){return window.innerWidth||document.documentElement&&document.documentElement.clientWidth||document.body&&document.body.clientWidth}function Nh(t){return t?t.nodeType===t.ELEMENT_NODE?t:Zl.parentElement(t):null}function qh(t,e,i,r){if(!t)return!1;var n=Nh(t);if(!n)return!1;try{if("string"==typeof e){if(n.classList.contains(e))return!0;if(r&&null!==n.closest("."+e))return!0}else if(ph(n,e,r))return!0}catch(t){}if(i){if(n.matches(i))return!0;if(r&&null!==n.closest(i))return!0}return!1}function jh(t,e,i){return!("TITLE"!==t.tagName||!i.headTitleMutations)||e.getId(t)===sh}function Bh(t,e){if(Cu(t))return!1;var i=e.getId(t);if(!e.has(i))return!0;var r=Zl.parentNode(t);return(!r||r.nodeType!==t.DOCUMENT_NODE)&&(!r||Bh(r,e))}function Uh(t){return Boolean(t.changedTouches)}function Hh(t,e){return Boolean("IFRAME"===t.nodeName&&e.getMeta(t))}function zh(t,e){return Boolean("LINK"===t.nodeName&&t.nodeType===t.ELEMENT_NODE&&t.getAttribute&&"stylesheet"===t.getAttribute("rel")&&e.getMeta(t))}function Wh(t){return!!t&&(t instanceof Th&&"shadowRoot"in t?Boolean(t.shadowRoot):Boolean(Zl.shadowRoot(t)))}/[1-9][0-9]{12}/.test(Date.now().toString())||(Fh=()=>(new Date).getTime());class Vh{constructor(){Il(this,"id",1),Il(this,"styleIDMap",new WeakMap),Il(this,"idStyleMap",new Map)}getId(t){var e;return null!==(e=this.styleIDMap.get(t))&&void 0!==e?e:-1}has(t){return this.styleIDMap.has(t)}add(t,e){return this.has(t)?this.getId(t):(i=void 0===e?this.id++:e,this.styleIDMap.set(t,i),this.idStyleMap.set(i,t),i);var i}getStyle(t){return this.idStyleMap.get(t)||null}reset(){this.styleIDMap=new WeakMap,this.idStyleMap=new Map,this.id=1}generateId(){return this.id++}}function Gh(t){var e,i=null;return"getRootNode"in t&&(null==(e=Zl.getRootNode(t))?void 0:e.nodeType)===Node.DOCUMENT_FRAGMENT_NODE&&Zl.host(Zl.getRootNode(t))&&(i=Zl.host(Zl.getRootNode(t))),i}function Zh(t){var e=t.ownerDocument;return!!e&&(Zl.contains(e,t)||function(t){var e=t.ownerDocument;if(!e)return!1;var i=function(t){for(var e,i=t;e=Gh(i);)i=e;return i}(t);return Zl.contains(e,i)}(t))}function Qh(t){return"__ln"in t}class Jh{constructor(){Il(this,"length",0),Il(this,"head",null),Il(this,"tail",null)}get(t){if(t>=this.length)throw new Error("Position outside of list range");for(var e=this.head,i=0;t>i;i++)e=(null==e?void 0:e.next)||null;return e}addNode(t){var e={value:t,previous:null,next:null};if(t.__ln=e,t.previousSibling&&Qh(t.previousSibling)){var i=t.previousSibling.__ln.next;e.next=i,e.previous=t.previousSibling.__ln,t.previousSibling.__ln.next=e,i&&(i.previous=e)}else if(t.nextSibling&&Qh(t.nextSibling)&&t.nextSibling.__ln.previous){var r=t.nextSibling.__ln.previous;e.previous=r,e.next=t.nextSibling.__ln,t.nextSibling.__ln.previous=e,r&&(r.next=e)}else this.head&&(this.head.previous=e),e.next=this.head,this.head=e;null===e.next&&(this.tail=e),this.length++}removeNode(t){var e=t.__ln;this.head&&(e.previous?(e.previous.next=e.next,e.next?e.next.previous=e.previous:this.tail=e.previous):(this.head=e.next,this.head?this.head.previous=null:this.tail=null),t.__ln&&delete t.__ln,this.length--)}}var Kh,Yh=(t,e)=>t+"@"+e;class Xh{constructor(){Il(this,"frozen",!1),Il(this,"locked",!1),Il(this,"texts",[]),Il(this,"attributes",[]),Il(this,"attributeMap",new WeakMap),Il(this,"generatedAttributes",new WeakMap),Il(this,"removes",[]),Il(this,"mapRemoves",[]),Il(this,"movedMap",{}),Il(this,"addedSet",new Set),Il(this,"movedSet",new Set),Il(this,"droppedSet",new Set),Il(this,"removesSubTreeCache",new Set),Il(this,"mutationCb"),Il(this,"blockClass"),Il(this,"blockSelector"),Il(this,"maskTextClass"),Il(this,"maskTextSelector"),Il(this,"inlineStylesheet"),Il(this,"maskInputOptions"),Il(this,"maskTextFn"),Il(this,"maskInputFn"),Il(this,"maskAllElementAttributes"),Il(this,"maskAttributeFn"),Il(this,"keepIframeSrcFn"),Il(this,"recordCanvas"),Il(this,"canvasMaskingConfigured"),Il(this,"inlineImages"),Il(this,"slimDOMOptions"),Il(this,"dataURLOptions"),Il(this,"doc"),Il(this,"mirror"),Il(this,"iframeManager"),Il(this,"stylesheetManager"),Il(this,"shadowDomManager"),Il(this,"canvasManager"),Il(this,"processedNodeManager"),Il(this,"unattachedDoc"),Il(this,"canvasManagerReleased",!1),Il(this,"processMutations",(t=>{t.forEach(this.processMutation),this.emit()})),Il(this,"emit",(()=>{if(!this.frozen&&!this.locked){var t,e,i=Jl(),r=tu();try{this.processBufferedMutations()}finally{t=Jl()-i,e=r,iu>0||eu(t,null!=e?e:Kl)||t>du.slowestBatchMs&&(du.slowestBatchMs=t)}}})),Il(this,"processBufferedMutations",(()=>{for(var t=[],e=new Set,i=new Jh,r=t=>{for(var e=t,i=sh;i===sh;)i=(e=e&&e.nextSibling)&&this.mirror.getId(e);return i},n=n=>{var s=Zl.parentNode(n);if(s&&Zh(n)&&"TEXTAREA"!==s.tagName){var o=Cu(s)?this.mirror.getId(Gh(n)):this.mirror.getId(s),a=r(n);if(-1===o||-1===a)return i.addNode(n);var l=xh(n,{doc:this.doc,mirror:this.mirror,blockClass:this.blockClass,blockSelector:this.blockSelector,maskTextClass:this.maskTextClass,maskTextSelector:this.maskTextSelector,skipChild:!0,newlyAddedElement:!0,inlineStylesheet:this.inlineStylesheet,maskInputOptions:this.maskInputOptions,maskTextFn:this.maskTextFn,maskInputFn:this.maskInputFn,maskAllElementAttributes:this.maskAllElementAttributes,maskAttributeFn:this.maskAttributeFn,slimDOMOptions:this.slimDOMOptions,dataURLOptions:this.dataURLOptions,recordCanvas:this.recordCanvas,canvasMaskingConfigured:this.canvasMaskingConfigured,inlineImages:this.inlineImages,onSerialize:t=>{Hh(t,this.mirror)&&this.iframeManager.addIframe(t),zh(t,this.mirror)&&this.stylesheetManager.trackLinkElement(t),Wh(t)&&!qh(t,this.blockClass,this.blockSelector,!0)&&this.shadowDomManager.addShadowRoot(Zl.shadowRoot(t),this.doc)},onIframeLoad:(t,e)=>{this.iframeManager.attachIframe(t,e),this.shadowDomManager.observeAttachShadow(t)},onIframeListenerRegistered:(t,e)=>{this.iframeManager.registerLoadListenerDisposer(t,e)},onStylesheetLoad:(t,e)=>{this.stylesheetManager.attachLinkElement(t,e)}});l&&(t.push({parentId:o,nextId:a,node:l}),e.add(l.id))}};this.mapRemoves.length;)this.mirror.removeNodeFromMap(this.mapRemoves.shift());for(var s of this.movedSet)ed(this.removesSubTreeCache,s)&&!this.movedSet.has(Zl.parentNode(s))||n(s);for(var o of this.addedSet)id(this.droppedSet,o)||ed(this.removesSubTreeCache,o)?id(this.movedSet,o)?n(o):this.droppedSet.add(o):n(o);for(var a=null;i.length;){var l=null;if(a){var u=this.mirror.getId(Zl.parentNode(a.value)),h=r(a.value);-1!==u&&-1!==h&&(l=a)}if(!l)for(var d=i.tail;d;){var v=d;if(d=d.previous,v){var c=this.mirror.getId(Zl.parentNode(v.value));if(-1===r(v.value))continue;if(-1!==c){l=v;break}var f=Zl.parentNode(v.value);if(f&&f.nodeType===Node.DOCUMENT_FRAGMENT_NODE){var p=Zl.host(f);if(-1!==this.mirror.getId(p)){l=v;break}}}}if(!l){for(;i.head;)i.removeNode(i.head.value);break}a=l.previous,i.removeNode(l.value),n(l.value)}var g={texts:this.texts.map((t=>{var e=t.node,i=Zl.parentNode(e);return i&&"TEXTAREA"===i.tagName&&this.genTextAreaValueMutation(i),{id:this.mirror.getId(e),value:t.value}})).filter((t=>!e.has(t.id))).filter((t=>this.mirror.has(t.id))),attributes:this.attributes.map((t=>{var e,i=t.attributes;if(!this.maskAllElementAttributes&&!this.maskAttributeFn&&"string"==typeof i.style){var r=JSON.stringify(t.styleDiff),n=JSON.stringify(t._unchangedStyles);i.style.length>r.length&&(r+n).split("var(").length===i.style.split("var(").length&&(i.style=t.styleDiff)}if(this.maskAllElementAttributes||this.maskAttributeFn)for(var s of Object.entries(i)){var o=s[0],a=s[1];"string"!=typeof a&&null!==a||(i[o]=Uu({element:t.node,name:o,value:a,maskAllElementAttributes:this.maskAllElementAttributes,maskAttributeFn:this.maskAttributeFn,isGenerated:null==(e=this.generatedAttributes.get(t.node))?void 0:e.has(o)}))}return{id:this.mirror.getId(t.node),attributes:i}})).filter((t=>!e.has(t.id))).filter((t=>this.mirror.has(t.id))),removes:this.removes,adds:t};(g.texts.length||g.attributes.length||g.removes.length||g.adds.length)&&(this.texts=[],this.attributes=[],this.attributeMap=new WeakMap,this.generatedAttributes=new WeakMap,this.removes=[],this.addedSet=new Set,this.movedSet=new Set,this.droppedSet=new Set,this.removesSubTreeCache=new Set,this.movedMap={},this.mutationCb(g))})),Il(this,"bufferBelongsToIframe",(t=>this.doc===t.contentDocument)),Il(this,"genTextAreaValueMutation",(t=>{var e=this.attributeMap.get(t);e||(this.attributes.push(e={node:t,attributes:{},styleDiff:{},_unchangedStyles:{}}),this.attributeMap.set(t,e));var i=Array.from(Zl.childNodes(t),(t=>Zl.textContent(t)||"")).join("");e.attributes.value=qu({element:t,maskInputOptions:this.maskInputOptions,tagName:t.tagName,type:zu(t),value:i,maskInputFn:this.maskInputFn})})),Il(this,"processMutation",(t=>{var e;if(!jh(t.target,this.mirror,this.slimDOMOptions))switch(t.type){case"characterData":var i=Zl.textContent(t.target);qh(t.target,this.blockClass,this.blockSelector,!1)||i===t.oldValue||this.texts.push({value:gh(t.target,this.maskTextClass,this.maskTextSelector,!0)&&i?this.maskTextFn?this.maskTextFn(i,Nh(t.target)):i.replace(/[\S]/g,"*"):i,node:t.target});break;case"attributes":var r,n=t.target,s=t.attributeName,o=null!==(r=t.attributeNamespace)&&void 0!==r?r:null,a=function(t,e,i){if(!i)return e;var r=t.getAttributeNodeNS(i,e);if(r)return r.name;if("http://www.w3.org/1999/xlink"===i)return"xlink:"+e;if("http://www.w3.org/XML/1998/namespace"===i)return"xml:"+e;if("http://www.w3.org/2000/xmlns/"===i)return"xmlns"===e?e:"xmlns:"+e;var n=t.lookupPrefix(i);return n?n+":"+e:e}(n,s,o),l=o?n.getAttributeNS(o,s):t.target.getAttribute(s);if("value"===a){var u=n,h=zu(u);l=qu({element:u,maskInputOptions:this.maskInputOptions,tagName:n.tagName,type:h,value:l,maskInputFn:this.maskInputFn})}if(qh(t.target,this.blockClass,this.blockSelector,!1)||l===t.oldValue)return;var d=this.attributeMap.get(t.target),v="IFRAME"===n.tagName&&"src"===a;if(v&&!this.keepIframeSrcFn(l)&&n.contentDocument)return;if(d||(this.attributes.push(d={node:t.target,attributes:{},styleDiff:{},_unchangedStyles:{}}),this.attributeMap.set(t.target,d)),"type"===a&&"INPUT"===n.tagName&&"password"===(t.oldValue||"").toLowerCase()&&n.setAttribute("data-rr-is-password","true"),!fh(n.tagName,a)){var c=ch(this.doc,ju(n.tagName),ju(a),l,n,this.dataURLOptions);if(v&&!this.keepIframeSrcFn(l)&&(a="rr_src"),d.attributes[a]=c,null==(e=this.generatedAttributes.get(t.target))||e.delete(a),"style"===a){if(!this.unattachedDoc)try{this.unattachedDoc=document.implementation.createHTMLDocument()}catch(t){this.unattachedDoc=this.doc}var f=this.unattachedDoc.createElement("span"),p=n.style;for(var g of(t.oldValue&&(f.style.cssText=t.oldValue),Array.from(p))){var m=p.getPropertyValue(g),y=p.getPropertyPriority(g);m!==f.style.getPropertyValue(g)||y!==f.style.getPropertyPriority(g)?d.styleDiff[g]=""===y?m:[m,y]:d._unchangedStyles[g]=[m,y]}for(var _ of Array.from(f.style))""===p.getPropertyValue(_)&&(d.styleDiff[_]=!1)}else if("open"===a&&"DIALOG"===n.tagName){d.attributes.rr_open_mode=n.matches("dialog:modal")?"modal":"non-modal";var b=this.generatedAttributes.get(t.target);b||this.generatedAttributes.set(t.target,b=new Set),b.add("rr_open_mode")}}break;case"childList":if(qh(t.target,this.blockClass,this.blockSelector,!0))return;if("TEXTAREA"===t.target.tagName)return void this.genTextAreaValueMutation(t.target);t.addedNodes.forEach((e=>this.genAdds(e,t.target))),t.removedNodes.forEach((e=>{var i=this.mirror.getId(e),r=Cu(t.target)?this.mirror.getId(Zl.host(t.target)):this.mirror.getId(t.target);qh(t.target,this.blockClass,this.blockSelector,!1)||jh(e,this.mirror,this.slimDOMOptions)||!function(t,e){return-1!==e.getId(t)}(e,this.mirror)||(this.addedSet.has(e)?(td(this.addedSet,e),this.droppedSet.add(e)):this.addedSet.has(t.target)&&-1===i||Bh(t.target,this.mirror)||(this.movedSet.has(e)&&this.movedMap[Yh(i,r)]?td(this.movedSet,e):(this.removes.push({parentId:r,id:i,isShadow:!(!Cu(t.target)||!Tu(t.target))||void 0}),function(t,e){for(var i=[t];i.length;){var r=i.pop();e.has(r)||(e.add(r),Zl.childNodes(r).forEach((t=>i.push(t))))}}(e,this.removesSubTreeCache))),this.mapRemoves.push(e))}))}})),Il(this,"genAdds",((t,e)=>{if(!this.processedNodeManager.inOtherBuffer(t,this)){if(this.addedSet.has(t))return this.addedSet.delete(t),void this.addedSet.add(t);if(!this.movedSet.has(t)){if(this.mirror.hasNode(t)){if(jh(t,this.mirror,this.slimDOMOptions))return;this.movedSet.add(t);var i=null;e&&this.mirror.hasNode(e)&&(i=this.mirror.getId(e)),i&&-1!==i&&(this.movedMap[Yh(this.mirror.getId(t),i)]=!0)}else this.addedSet.add(t),this.droppedSet.delete(t);qh(t,this.blockClass,this.blockSelector,!1)||(Zl.childNodes(t).forEach((t=>this.genAdds(t))),Wh(t)&&Zl.childNodes(Zl.shadowRoot(t)).forEach((e=>{this.processedNodeManager.add(e,this),this.genAdds(e,t)})))}}}))}init(t){["mutationCb","blockClass","blockSelector","maskTextClass","maskTextSelector","inlineStylesheet","maskInputOptions","maskTextFn","maskInputFn","maskAllElementAttributes","maskAttributeFn","keepIframeSrcFn","recordCanvas","canvasMaskingConfigured","inlineImages","slimDOMOptions","dataURLOptions","doc","mirror","iframeManager","stylesheetManager","shadowDomManager","canvasManager","processedNodeManager"].forEach((e=>{this[e]=t[e]})),this.canvasManager.acquire()}freeze(){this.frozen=!0,this.canvasManager.freeze()}unfreeze(){this.frozen=!1,this.canvasManager.unfreeze(),this.emit()}isFrozen(){return this.frozen}lock(){this.locked=!0,this.canvasManager.lock()}unlock(){this.locked=!1,this.canvasManager.unlock(),this.emit()}reset(){this.releaseCanvasManager()}releaseCanvasManager(){this.canvasManagerReleased||(this.canvasManagerReleased=!0,this.canvasManager.reset())}bufferDoc(){return this.doc}destroy(){for(;this.mapRemoves.length;)this.mirror.removeNodeFromMap(this.mapRemoves.shift())}}function td(t,e){for(var i=[e];i.length;){var r=i.pop();t.delete(r),Zl.childNodes(r).forEach((t=>i.push(t)))}}function ed(t,e,i){return 0!==t.size&&function(t,e,i){var r=Zl.parentNode(e);return!!r&&t.has(r)}(t,e)}function id(t,e){if(0===t.size)return!1;for(var i=Zl.parentNode(e);i;){if(t.has(i))return!0;i=Zl.parentNode(i)}return!1}var rd=function(t,e){return void 0===e&&(e="rrweb"),Kh?function(){try{return t(...arguments)}catch(t){if(Kh&&!0===Kh(t,e))return;throw t}}:t},nd=[];function sd(t){try{if("composedPath"in t){var e=t.composedPath();if(e.length)return e[0]}else if("path"in t&&t.path.length)return t.path[0]}catch(t){}return t&&t.target}function od(t,e){var i,r=new Xh;r.init(t);try{i=new(Vl())(rd(r.processMutations.bind(r)));var n={attributes:!0,attributeOldValue:!0,characterData:!0,characterDataOldValue:!0,childList:!0,subtree:!0};return t.attributeFilter&&t.attributeFilter.length>0&&(n.attributeFilter=t.attributeFilter),i.observe(e,n),nd.push(r),{observer:i,buffer:r}}catch(t){try{null==i||i.disconnect(),r.destroy(),r.reset()}catch(t){}throw t}}function ad(t){var e=t.scrollCb,i=t.doc,r=t.mirror,n=t.blockClass,s=t.blockSelector,o=t.sampling,a=new Map,l=t=>{var o=sd(t);if(o&&!qh(o,n,s,!0)){var l,u,h=r.getId(o);if(o===i&&i.defaultView){var d=Lh(i.defaultView);l=d.left,u=d.top}else l=o.scrollLeft,u=o.scrollTop;var v=l+","+u;a.get(h)!==v&&(a.set(h,v),e({id:h,x:l,y:u}))}},u=[Eh("scroll",rd(Ah(rd((t=>l(t))),o.scroll||100)),i)];return"onscrollend"in i&&u.push(Eh("scrollend",rd(l),i)),()=>u.forEach((t=>t()))}function ld(t,e){for(var i=nd.length-1;i>=0;i--){var r=nd[i];if(r){var n=r.bufferBelongsToIframe(t);!n&&e&&e.has(r.bufferDoc())&&(n=!0),n&&(r.reset(),nd.splice(i,1))}}}var ud=["INPUT","TEXTAREA","SELECT"],hd=new WeakMap;function dd(t){return function t(e,i){if(gd("CSSGroupingRule")&&e.parentRule instanceof CSSGroupingRule||gd("CSSMediaRule")&&e.parentRule instanceof CSSMediaRule||gd("CSSSupportsRule")&&e.parentRule instanceof CSSSupportsRule||gd("CSSConditionRule")&&e.parentRule instanceof CSSConditionRule){var r=Array.from(e.parentRule.cssRules).indexOf(e);return i.unshift(r),t(e.parentRule,i)}if(e.parentStyleSheet){var n=Array.from(e.parentStyleSheet.cssRules).indexOf(e);i.unshift(n)}return i}(t,[])}function vd(t,e,i){var r,n;return t?(t.ownerNode?r=e.getId(t.ownerNode):n=i.getId(t),{styleId:n,id:r}):{}}var cd=5e3;function fd(t,e){var i,r,n,s,o=t.stylesheetManager;s=t.mirror.getId("#document"===e.nodeName?e:Zl.host(e));var a="#document"===e.nodeName?null==(i=e.defaultView)?void 0:i.Document:null==(n=null==(r=e.ownerDocument)?void 0:r.defaultView)?void 0:n.ShadowRoot,l=(null==a?void 0:a.prototype)?Object.getOwnPropertyDescriptor(null==a?void 0:a.prototype,"adoptedStyleSheets"):void 0;return null!==s&&-1!==s&&a&&l?(Object.defineProperty(e,"adoptedStyleSheets",{configurable:l.configurable,enumerable:l.enumerable,get(){var t;return null==(t=l.get)?void 0:t.call(this)},set(t){var e,i;try{i=null==(e=l.set)?void 0:e.call(this,t)}catch(t){if(t&&"object"==typeof t&&"NotAllowedError"===t.name)return;throw t}if(null!==s&&-1!==s)try{o.adoptStyleSheets(t,s)}catch(t){}return i}}),rd((()=>{Object.defineProperty(e,"adoptedStyleSheets",{configurable:l.configurable,enumerable:l.enumerable,get:l.get,set:l.set})}))):()=>{}}function pd(t,e){void 0===e&&(e={});var i,r,n=t.doc.defaultView;if(!n)return()=>{};!function(t,e){var i=t.mutationCb,r=t.mousemoveCb,n=t.mouseInteractionCb,s=t.scrollCb,o=t.viewportResizeCb,a=t.inputCb,l=t.mediaInteractionCb,u=t.styleSheetRuleCb,h=t.styleDeclarationCb,d=t.canvasMutationCb,v=t.fontCb,c=t.selectionCb,f=t.customElementCb;t.mutationCb=function(){e.mutation&&e.mutation(...arguments),i(...arguments)},t.mousemoveCb=function(){e.mousemove&&e.mousemove(...arguments),r(...arguments)},t.mouseInteractionCb=function(){e.mouseInteraction&&e.mouseInteraction(...arguments),n(...arguments)},t.scrollCb=function(){e.scroll&&e.scroll(...arguments),s(...arguments)},t.viewportResizeCb=function(){e.viewportResize&&e.viewportResize(...arguments),o(...arguments)},t.inputCb=function(){e.input&&e.input(...arguments),a(...arguments)},t.mediaInteractionCb=function(){e.mediaInteaction&&e.mediaInteaction(...arguments),l(...arguments)},t.styleSheetRuleCb=function(){e.styleSheetRule&&e.styleSheetRule(...arguments),u(...arguments)},t.styleDeclarationCb=function(){e.styleDeclaration&&e.styleDeclaration(...arguments),h(...arguments)},t.canvasMutationCb=function(){e.canvasMutation&&e.canvasMutation(...arguments),d(...arguments)},t.fontCb=function(){e.font&&e.font(...arguments),v(...arguments)},t.selectionCb=function(){e.selection&&e.selection(...arguments),c(...arguments)},t.customElementCb=function(){e.customElement&&e.customElement(...arguments),f(...arguments)}}(t,e);var s,o,a,l,u,h,d,v,c=[],f=rd((()=>{if(r){r.destroy(),r.reset();var e=nd.indexOf(r);-1!==e&&nd.splice(e,1)}t.shadowDomManager.resetForDoc(t.doc),null==i||i.disconnect(),c.forEach((t=>t()))}));try{if(t.recordDOM){var g=od(t,t.doc);i=g.observer,r=g.buffer}if(c.push(function(t){var e=t.mousemoveCb,i=t.sampling,r=t.doc,n=t.mirror;if(!1===i.mousemove)return()=>{};var s,o="number"==typeof i.mousemove?i.mousemove:50,a="number"==typeof i.mousemoveCallback?i.mousemoveCallback:500,l=[],u=Ah(rd((t=>{var i=Date.now()-s;e(l.map((t=>(t.timeOffset-=i,t))),t),l=[],s=null})),a),h=rd(Ah(rd((t=>{var e=sd(t),i=Uh(t)?t.changedTouches[0]:t,r=i.clientX,o=i.clientY;s||(s=Fh()),l.push({x:r,y:o,id:n.getId(e),timeOffset:Fh()-s}),u("undefined"!=typeof DragEvent&&t instanceof DragEvent?Pl.Drag:t instanceof MouseEvent?Pl.MouseMove:Pl.TouchMove)})),o,{trailing:!1})),d=[Eh("mousemove",h,r),Eh("touchmove",h,r),Eh("drag",h,r)];return rd((()=>{d.forEach((t=>t()))}))}(t)),c.push(function(t){var e=t.mouseInteractionCb,i=t.doc,r=t.mirror,n=t.blockClass,s=t.blockSelector,o=t.sampling;if(!1===o.mouseInteraction)return()=>{};var a=!0===o.mouseInteraction||void 0===o.mouseInteraction?{}:o.mouseInteraction,l=[],u=null;return Object.keys(Al).filter((t=>Number.isNaN(Number(t))&&!t.endsWith("_Departed")&&!1!==a[t])).forEach((t=>{var o=ju(t),a=(t=>i=>{var o=sd(i);if(!qh(o,n,s,!0)){var a=null,l=t;if("pointerType"in i){switch(i.pointerType){case"mouse":a=Ol.Mouse;break;case"touch":a=Ol.Touch;break;case"pen":a=Ol.Pen}a===Ol.Touch&&(Al[t]===Al.MouseDown?l="TouchStart":Al[t]===Al.MouseUp&&(l="TouchEnd"))}else Uh(i)&&(a=Ol.Touch);null!==a?(u=a,(l.startsWith("Touch")&&a===Ol.Touch||l.startsWith("Mouse")&&a===Ol.Mouse)&&(a=null)):Al[t]===Al.Click&&(a=u,u=null);var h=Uh(i)?i.changedTouches[0]:i;if(h){var d=r.getId(o),v=h.clientX,c=h.clientY;rd(e)(p({type:Al[l],id:d,x:v,y:c},null!==a&&{pointerType:a}))}}})(t);if(window.PointerEvent)switch(Al[t]){case Al.MouseDown:case Al.MouseUp:o=o.replace("mouse","pointer");break;case Al.TouchStart:case Al.TouchEnd:return}l.push(Eh(o,a,i))})),rd((()=>{l.forEach((t=>t()))}))}(t)),c.push(ad(t)),c.push(function(t,e){var i=t.viewportResizeCb,r=e.win,n=-1,s=-1;return Eh("resize",rd(Ah(rd((()=>{var t=$h(),e=Dh();n===t&&s===e||(i({width:Number(e),height:Number(t)}),n=t,s=e)})),200)),r)}(t,{win:n})),c.push(function(t){var e=t.inputCb,i=t.doc,r=t.mirror,n=t.blockClass,s=t.blockSelector,o=t.ignoreClass,a=t.ignoreSelector,l=t.maskInputOptions,u=t.maskInputFn,h=t.userTriggeredOnInput;function d(t){var e=sd(t),r=t.isTrusted,d=i.defaultView;if(!e||!d||e instanceof d.HTMLElement){var c=e&&e.tagName;if(e&&"OPTION"===c&&(e=Zl.parentElement(e)),e&&c&&ud.indexOf(c)>=0&&!qh(e,n,s,!0)&&!(e.classList.contains(o)||a&&e.matches(a))){var f=e.value,p=!1,g=zu(e)||"";"radio"===g||"checkbox"===g?p=e.checked:(l[c.toLowerCase()]||l[g])&&(f=qu({element:e,maskInputOptions:l,tagName:c,type:g,value:f,maskInputFn:u})),v(e,h?{text:f,isChecked:p,userTriggered:r}:{text:f,isChecked:p});var m=e.name;"radio"===g&&m&&p&&i.querySelectorAll('input[type="radio"][name="'+m+'"]').forEach((t=>{if(t!==e){var i=t.value;v(t,h?{text:i,isChecked:!p,userTriggered:!1}:{text:i,isChecked:!p})}}))}}}function v(t,i){var n=hd.get(t);if(!n||n.text!==i.text||n.isChecked!==i.isChecked){hd.set(t,i);var s=r.getId(t);rd(e)(p({},i,{id:s}))}}var c=("last"===t.sampling.input?["change"]:["input","change"]).map((t=>Eh(t,rd(d),i))),f=i.defaultView;if(!f)return()=>{c.forEach((t=>t()))};var g=f.Object.getOwnPropertyDescriptor(f.HTMLInputElement.prototype,"value");return g&&g.set&&c.push(...[[f.HTMLInputElement.prototype,"value"],[f.HTMLInputElement.prototype,"checked"],[f.HTMLSelectElement.prototype,"value"],[f.HTMLTextAreaElement.prototype,"value"],[f.HTMLSelectElement.prototype,"selectedIndex"],[f.HTMLOptionElement.prototype,"selected"]].map((t=>Oh(t[0],t[1],{set(){rd(d)({target:this,isTrusted:!1})}},!1,f)))),rd((()=>{c.forEach((t=>t()))}))}(t)),c.push(function(t){var e=t.mediaInteractionCb,i=t.blockClass,r=t.blockSelector,n=t.mirror,s=t.sampling,o=t.doc,a=rd((t=>Ah(rd((s=>{var o=sd(s);if(o&&!qh(o,i,r,!0)){var a=o.currentTime,l=o.volume,u=o.muted,h=o.playbackRate,d=o.loop;e({type:t,id:n.getId(o),currentTime:a,volume:l,muted:u,playbackRate:h,loop:d})}})),s.media||500))),l=[Eh("play",a(Ll.Play),o),Eh("pause",a(Ll.Pause),o),Eh("seeked",a(Ll.Seeked),o),Eh("volumechange",a(Ll.VolumeChange),o),Eh("ratechange",a(Ll.RateChange),o)];return rd((()=>{l.forEach((t=>t()))}))}(t)),t.recordDOM){var m=function(t){var e=new Map,i=new Set,r=!0,n=t=>{if(r)try{t()}catch(t){}},s=t=>{var i,r=e.get(t);if(r){for(;null==(i=r[0])?void 0:i.ready;){var s=r.shift();(null==s?void 0:s.emit)&&n(s.emit)}0===r.length&&e.delete(t)}};return{queueMutation(t,i){if(t){var r=e.get(t);r?(r.push({emit:i,ready:!0}),s(t)):n(i)}else n(i)},queuePendingMutation(o,a,l){if(!r)return()=>{};var u=e.get(o);u||e.set(o,u=[]);var h={emit:a,ready:!1};u.push(h);var d,v=!1,c=!1,f=()=>{v||c||(v=!0,void 0!==d&&i.delete(d),h.ready=!0,h.emit=void 0,s(o))};try{d=t.setTimeout(f,cd),v||c?t.clearTimeout(d):i.add(d)}catch(t){f()}return e=>{!c&&r&&(c=!0,void 0!==d&&(t.clearTimeout(d),i.delete(d)),v?e&&n(l):(h.ready=!0,e||(h.emit=void 0),s(o)))}},reset(){r=!1,i.forEach((e=>t.clearTimeout(e))),i.clear(),e.clear()}}}(n);c.push(m.reset),c.push(function(t,e){var i=t.styleSheetRuleCb,r=t.mirror,n=t.stylesheetManager,s=e.win,o=e.mutationQueue;if(!s.CSSStyleSheet||!s.CSSStyleSheet.prototype)return()=>{};var a=s.CSSStyleSheet.prototype.insertRule;s.CSSStyleSheet.prototype.insertRule=new Proxy(a,{apply:rd(((t,e,s)=>{var a=s[0],l=t.apply(e,s);n.onCssomSheetMutation(e);var u=vd(e,r,n.styleMirror),h=u.id,d=u.styleId;return(h&&-1!==h||d&&-1!==d)&&o.queueMutation(e,(()=>i({id:h,styleId:d,adds:[{rule:a,index:l}]}))),l}),"host")}),s.CSSStyleSheet.prototype.addRule=function(t,e,i){return void 0===i&&(i=this.cssRules.length),s.CSSStyleSheet.prototype.insertRule.apply(this,[t+" { "+e+" }",i])};var l,u,h=s.CSSStyleSheet.prototype.deleteRule;s.CSSStyleSheet.prototype.deleteRule=new Proxy(h,{apply:rd(((t,e,s)=>{var a=s[0],l=t.apply(e,s);n.onCssomSheetMutation(e);var u=vd(e,r,n.styleMirror),h=u.id,d=u.styleId;return(h&&-1!==h||d&&-1!==d)&&o.queueMutation(e,(()=>i({id:h,styleId:d,removes:[{index:a}]}))),l}),"host")}),s.CSSStyleSheet.prototype.removeRule=function(t){return s.CSSStyleSheet.prototype.deleteRule.apply(this,[t])},s.CSSStyleSheet.prototype.replace&&(l=s.CSSStyleSheet.prototype.replace,s.CSSStyleSheet.prototype.replace=new Proxy(l,{apply:rd(((t,e,s)=>{var a=s[0],l=t.apply(e,s);try{var u=null==l?void 0:l.then;if(e.ownerNode||!l||"function"!=typeof u)return l;n.onCssomSheetMutation(e);var h=vd(e,r,n.styleMirror),d=h.id,v=h.styleId;if(!(d&&-1!==d||v&&-1!==v))return l;var c=o.queuePendingMutation(e,(()=>i({id:d,styleId:v,replace:a})),(()=>{var t=Ru(e);null!==t&&i({id:d,styleId:v,replace:t})}));try{u.call(l,(()=>c(!0)),(()=>c(!1)))}catch(t){c(!1)}}catch(t){}return l}),"host")})),s.CSSStyleSheet.prototype.replaceSync&&(u=s.CSSStyleSheet.prototype.replaceSync,s.CSSStyleSheet.prototype.replaceSync=new Proxy(u,{apply:rd(((t,e,s)=>{var a=s[0],l=t.apply(e,s);n.onCssomSheetMutation(e);var u=vd(e,r,n.styleMirror),h=u.id,d=u.styleId;return(h&&-1!==h||d&&-1!==d)&&o.queueMutation(e,(()=>i({id:h,styleId:d,replaceSync:a}))),l}),"host")}));var d={};md("CSSGroupingRule")?d.CSSGroupingRule=s.CSSGroupingRule:(md("CSSMediaRule")&&(d.CSSMediaRule=s.CSSMediaRule),md("CSSConditionRule")&&(d.CSSConditionRule=s.CSSConditionRule),md("CSSSupportsRule")&&(d.CSSSupportsRule=s.CSSSupportsRule));var v={};return Object.entries(d).forEach((t=>{var e=t[0],s=t[1];v[e]={insertRule:s.prototype.insertRule,deleteRule:s.prototype.deleteRule},s.prototype.insertRule=new Proxy(v[e].insertRule,{apply:rd(((t,e,s)=>{var a=s[0],l=t.apply(e,s);n.onCssomSheetMutation(e.parentStyleSheet);var u=vd(e.parentStyleSheet,r,n.styleMirror),h=u.id,d=u.styleId;if(e.parentStyleSheet&&(h&&-1!==h||d&&-1!==d)){var v=[...dd(e),l];o.queueMutation(e.parentStyleSheet,(()=>i({id:h,styleId:d,adds:[{rule:a,index:v}]})))}return l}),"host")}),s.prototype.deleteRule=new Proxy(v[e].deleteRule,{apply:rd(((t,e,s)=>{var a=s[0],l=t.apply(e,s);n.onCssomSheetMutation(e.parentStyleSheet);var u=vd(e.parentStyleSheet,r,n.styleMirror),h=u.id,d=u.styleId;if(e.parentStyleSheet&&(h&&-1!==h||d&&-1!==d)){var v=[...dd(e),a];o.queueMutation(e.parentStyleSheet,(()=>i({id:h,styleId:d,removes:[{index:v}]})))}return l}),"host")})})),rd((()=>{s.CSSStyleSheet.prototype.insertRule=a,s.CSSStyleSheet.prototype.deleteRule=h,l&&(s.CSSStyleSheet.prototype.replace=l),u&&(s.CSSStyleSheet.prototype.replaceSync=u),Object.entries(d).forEach((t=>{var e=t[0],i=t[1];i.prototype.insertRule=v[e].insertRule,i.prototype.deleteRule=v[e].deleteRule}))}))}(t,{win:n,mutationQueue:m})),c.push(fd(t,t.doc)),c.push(function(t,e){var i=t.styleDeclarationCb,r=t.mirror,n=t.ignoreCSSAttributes,s=t.stylesheetManager,o=e.win,a=e.mutationQueue,l=o.CSSStyleDeclaration.prototype.setProperty;o.CSSStyleDeclaration.prototype.setProperty=new Proxy(l,{apply:rd(((t,e,o)=>{var l,u=o[0],h=o[1],d=o[2],v=t.apply(e,o);if(n.has(u))return v;var c=null==(l=e.parentRule)?void 0:l.parentStyleSheet;s.onCssomSheetMutation(c);var f=vd(c,r,s.styleMirror),p=f.id,g=f.styleId;if(p&&-1!==p||g&&-1!==g){var m=dd(e.parentRule);a.queueMutation(c,(()=>i({id:p,styleId:g,set:{property:u,value:h,priority:d},index:m})))}return v}),"host")});var u=o.CSSStyleDeclaration.prototype.removeProperty;return o.CSSStyleDeclaration.prototype.removeProperty=new Proxy(u,{apply:rd(((t,e,o)=>{var l,u=o[0],h=t.apply(e,o);if(n.has(u))return h;var d=null==(l=e.parentRule)?void 0:l.parentStyleSheet;s.onCssomSheetMutation(d);var v=vd(d,r,s.styleMirror),c=v.id,f=v.styleId;if(c&&-1!==c||f&&-1!==f){var p=dd(e.parentRule);a.queueMutation(d,(()=>i({id:c,styleId:f,remove:{property:u},index:p})))}return h}),"host")}),rd((()=>{o.CSSStyleDeclaration.prototype.setProperty=l,o.CSSStyleDeclaration.prototype.removeProperty=u}))}(t,{win:n,mutationQueue:m})),t.collectFonts&&c.push(function(t){var e=t.fontCb,i=t.doc,r=i.defaultView;if(!r)return()=>{};var n=[],s=new WeakMap,o=r.FontFace;r.FontFace=function(t,e,i){var r=new o(t,e,i);return s.set(r,{family:t,buffer:"string"!=typeof e,descriptors:i,fontSource:"string"==typeof e?e:JSON.stringify(Array.from(new Uint8Array(e)))}),r};var a=Gl(i.fonts,"add",(function(t){return function(i){return setTimeout(rd((()=>{var t=s.get(i);t&&(e(t),s.delete(i))})),0),t.apply(this,[i])}}));return n.push((()=>{r.FontFace=o})),n.push(a),rd((()=>{n.forEach((t=>t()))}))}(t))}for(var y of(c.push((o=(s=t).doc,a=s.mirror,l=s.blockClass,u=s.blockSelector,h=s.selectionCb,d=!0,(v=rd((()=>{var t=o.getSelection();if(!(!t||d&&(null==t?void 0:t.isCollapsed))){d=t.isCollapsed||!1;for(var e=[],i=t.rangeCount||0,r=0;i>r;r++){var n=t.getRangeAt(r),s=n.startContainer,v=n.startOffset,c=n.endContainer,f=n.endOffset;qh(s,l,u,!0)||qh(c,l,u,!0)||e.push({start:a.getId(s),startOffset:v,end:a.getId(c),endOffset:f})}h({ranges:e})}})))(),Eh("selectionchange",v))),c.push(function(t){var e=t.customElementCb,i=t.doc.defaultView;return i&&i.customElements?Gl(i.customElements,"define",(function(t){return function(i,r,n){try{e({define:{name:i}})}catch(t){console.warn("Custom element callback failed for "+i)}return t.apply(this,[i,r,n])}})):()=>{}}(t)),t.plugins))c.push(y.observer(y.callback,n,y.options))}catch(t){try{f()}catch(t){}throw t}return f}function gd(t){return void 0!==window[t]}function md(t){return Boolean(void 0!==window[t]&&window[t].prototype&&"insertRule"in window[t].prototype&&"deleteRule"in window[t].prototype)}class yd{constructor(t){Il(this,"iframeRemoteIdToLocalIdMap",new WeakMap),Il(this,"iframeLocalIdToRemoteIdMap",new WeakMap),this.generateIdFn=t}getId(t,e,i,r){if(0>e)return e;var n=i||this.getRemoteIdToLocalIdMap(t),s=r||this.getLocalIdToRemoteIdMap(t),o=n.get(e);return void 0===o&&(o=this.generateIdFn(),n.set(e,o),s.set(o,e)),o}getIds(t,e){var i=this.getRemoteIdToLocalIdMap(t),r=this.getLocalIdToRemoteIdMap(t);return e.map((e=>this.getId(t,e,i,r)))}getRemoteId(t,e,i){var r;return"number"!=typeof e||0>e?e:null!==(r=(i||this.getLocalIdToRemoteIdMap(t)).get(e))&&void 0!==r?r:-1}getRemoteIds(t,e){var i=this.getLocalIdToRemoteIdMap(t);return e.map((e=>this.getRemoteId(t,e,i)))}reset(t){if(!t)return this.iframeRemoteIdToLocalIdMap=new WeakMap,void(this.iframeLocalIdToRemoteIdMap=new WeakMap);this.iframeRemoteIdToLocalIdMap.delete(t),this.iframeLocalIdToRemoteIdMap.delete(t)}getRemoteIdToLocalIdMap(t){var e=this.iframeRemoteIdToLocalIdMap.get(t);return e||this.iframeRemoteIdToLocalIdMap.set(t,e=new Map),e}getLocalIdToRemoteIdMap(t){var e=this.iframeLocalIdToRemoteIdMap.get(t);return e||this.iframeLocalIdToRemoteIdMap.set(t,e=new Map),e}}class _d{constructor(t){Il(this,"iframes",new WeakMap),Il(this,"crossOriginIframeMap",new WeakMap),Il(this,"crossOriginIframeMirror",new yd(oh)),Il(this,"crossOriginIframeStyleMirror"),Il(this,"crossOriginIframeRootIdMap",new WeakMap),Il(this,"mirror"),Il(this,"mutationCb"),Il(this,"wrappedEmit"),Il(this,"loadListener"),Il(this,"pageHideListener"),Il(this,"stylesheetManager"),Il(this,"recordCrossOriginIframes"),Il(this,"messageHandler"),Il(this,"nestedIframeListeners",new Map),Il(this,"attachedWindows",new WeakMap),Il(this,"attachedDocuments",new WeakMap),Il(this,"attachedIframes",new Map),Il(this,"loadListenerDisposers",new WeakMap),Il(this,"iframeElementsById",new Map),Il(this,"pageHideHandlers",new WeakMap),this.mutationCb=t.mutationCb,this.wrappedEmit=t.wrappedEmit,this.stylesheetManager=t.stylesheetManager,this.recordCrossOriginIframes=t.recordCrossOriginIframes,this.crossOriginIframeStyleMirror=new yd(this.stylesheetManager.styleMirror.generateId.bind(this.stylesheetManager.styleMirror)),this.mirror=t.mirror,this.messageHandler=this.handleMessage.bind(this),this.recordCrossOriginIframes&&window.addEventListener("message",this.messageHandler)}addIframe(t){this.iframes.set(t,!0),t.contentWindow&&this.crossOriginIframeMap.set(t.contentWindow,t)}registerLoadListenerDisposer(t,e){var i=this.loadListenerDisposers.get(t);i||this.loadListenerDisposers.set(t,i=new Set),i.add(e);var r=this.mirror.getId(t);-1!==r&&this.iframeElementsById.set(r,t)}getIframeElementById(t){var e,i,r;return null!==(e=null!==(i=null==(r=this.attachedIframes.get(t))?void 0:r.element)&&void 0!==i?i:this.iframeElementsById.get(t))&&void 0!==e?e:null}forgetIframeId(t){this.attachedIframes.delete(t),this.iframeElementsById.delete(t)}disposeLoadListeners(t){var e=this.loadListenerDisposers.get(t);e&&(e.forEach((t=>Ih(t))),this.loadListenerDisposers.delete(t))}removePageHideListener(t){var e=this.pageHideHandlers.get(t);e&&(e.forEach((t=>{Mh(t.win,"pagehide",t.handler)})),this.pageHideHandlers.delete(t))}addLoadListener(t){this.loadListener=t}addPageHideListener(t){this.pageHideListener=t}removeLoadListener(){this.loadListener=void 0}trackIframeContent(t,e){var i=this.mirror.getId(t);return this.attachedIframes.set(i,{element:t,content:e}),i}attachIframe(t,e){var i,r=this.trackIframeContent(t,e);if(t.contentDocument){var n=this.attachedDocuments.get(t);n||this.attachedDocuments.set(t,n=new Set),n.add(t.contentDocument)}this.mutationCb({adds:[{parentId:r,nextId:null,node:e}],removes:[],texts:[],attributes:[],isAttachIframe:!0});var s=t.contentWindow;if(this.recordCrossOriginIframes&&s&&!this.nestedIframeListeners.has(s)){var o=this.handleMessage.bind(this);Ih((()=>{s.addEventListener("message",o),this.nestedIframeListeners.set(s,o);var e=this.attachedWindows.get(t);e||this.attachedWindows.set(t,e=new Set),e.add(s)}))}Ih((()=>{var e=t.contentWindow;if(e){var i=this.pageHideHandlers.get(t);if(i)for(var r of i)if(r.win===e)return;var n=()=>{var e;null==(e=this.pageHideListener)||e.call(this,t),t.contentDocument&&this.mirror.removeNodeFromMap(t.contentDocument),t.contentWindow&&this.crossOriginIframeMap.delete(t.contentWindow)};e.addEventListener("pagehide",n),i||this.pageHideHandlers.set(t,i=new Set),i.add({win:e,handler:n})}})),null==(i=this.loadListener)||i.call(this,t),t.contentDocument&&t.contentDocument.adoptedStyleSheets&&t.contentDocument.adoptedStyleSheets.length>0&&this.stylesheetManager.adoptStyleSheets(t.contentDocument.adoptedStyleSheets,this.mirror.getId(t.contentDocument))}handleMessage(t){var e=t;if("rrweb"===e.data.type&&e.origin===e.data.origin&&t.source){var i=this.crossOriginIframeMap.get(t.source);if(i){var r=this.transformCrossOriginEvent(i,e.data.event);r&&this.wrappedEmit(r,e.data.isCheckout)}}}transformCrossOriginEvent(t,e){var i;switch(e.type){case Rl.FullSnapshot:this.crossOriginIframeMirror.reset(t),this.crossOriginIframeStyleMirror.reset(t),this.replaceIdOnNode(e.data.node,t);var r=e.data.node.id;return this.crossOriginIframeRootIdMap.set(t,r),this.patchRootIdOnNode(e.data.node,r),this.trackIframeContent(t,e.data.node),{timestamp:e.timestamp,type:Rl.IncrementalSnapshot,data:{source:Pl.Mutation,adds:[{parentId:this.mirror.getId(t),nextId:null,node:e.data.node}],removes:[],texts:[],attributes:[],isAttachIframe:!0}};case Rl.Meta:case Rl.Load:case Rl.DomContentLoaded:return!1;case Rl.Plugin:return e;case Rl.Custom:return this.replaceIds(e.data.payload,t,["id","parentId","previousId","nextId"]),e;case Rl.IncrementalSnapshot:switch(e.data.source){case Pl.Mutation:return e.data.adds.forEach((e=>{this.replaceIds(e,t,["parentId","nextId","previousId"]),this.replaceIdOnNode(e.node,t);var i=this.crossOriginIframeRootIdMap.get(t);i&&this.patchRootIdOnNode(e.node,i)})),e.data.removes.forEach((e=>{this.replaceIds(e,t,["parentId","id"])})),e.data.attributes.forEach((e=>{this.replaceIds(e,t,["id"])})),e.data.texts.forEach((e=>{this.replaceIds(e,t,["id"])})),e;case Pl.Drag:case Pl.TouchMove:case Pl.MouseMove:return e.data.positions.forEach((e=>{this.replaceIds(e,t,["id"])})),e;case Pl.ViewportResize:return!1;case Pl.MediaInteraction:case Pl.MouseInteraction:case Pl.Scroll:case Pl.CanvasMutation:case Pl.Input:return this.replaceIds(e.data,t,["id"]),e;case Pl.StyleSheetRule:case Pl.StyleDeclaration:return this.replaceIds(e.data,t,["id"]),this.replaceStyleIds(e.data,t,["styleId"]),e;case Pl.Font:return e;case Pl.Selection:return e.data.ranges.forEach((e=>{this.replaceIds(e,t,["start","end"])})),e;case Pl.AdoptedStyleSheet:return this.replaceIds(e.data,t,["id"]),this.replaceStyleIds(e.data,t,["styleIds"]),null==(i=e.data.styles)||i.forEach((e=>{this.replaceStyleIds(e,t,["styleId"])})),e}}return!1}replace(t,e,i,r){for(var n of r)(Array.isArray(e[n])||"number"==typeof e[n])&&(e[n]=Array.isArray(e[n])?t.getIds(i,e[n]):t.getId(i,e[n]));return e}replaceIds(t,e,i){return this.replace(this.crossOriginIframeMirror,t,e,i)}replaceStyleIds(t,e,i){return this.replace(this.crossOriginIframeStyleMirror,t,e,i)}replaceIdOnNode(t,e){this.replaceIds(t,e,["id","rootId"]),"childNodes"in t&&t.childNodes.forEach((t=>{this.replaceIdOnNode(t,e)}))}patchRootIdOnNode(t,e){t.type===$l.Document||t.rootId||(t.rootId=e),"childNodes"in t&&t.childNodes.forEach((t=>{this.patchRootIdOnNode(t,e)}))}removeIframeById(t){var e=this.attachedIframes.get(t),i=(null==e?void 0:e.element)||this.iframeElementsById.get(t)||this.mirror.getNode(t);if(this.iframeElementsById.delete(t),i){var r=i.contentWindow,n=this.attachedWindows.get(i);n&&(n.forEach((t=>{var e=this.nestedIframeListeners.get(t);e&&(Mh(t,"message",e),this.nestedIframeListeners.delete(t)),this.crossOriginIframeMap.delete(t)})),this.attachedWindows.delete(i)),r&&this.nestedIframeListeners.has(r)&&(Mh(r,"message",this.nestedIframeListeners.get(r)),this.nestedIframeListeners.delete(r)),r&&this.crossOriginIframeMap.delete(r),this.iframes.delete(i),this.disposeLoadListeners(i),this.removePageHideListener(i);var s=this.attachedDocuments.get(i);s&&(s.forEach((t=>{Ih((()=>this.mirror.removeNodeFromMap(t)))})),Ih((()=>ld(i,s))),this.attachedDocuments.delete(i))}e&&this.attachedIframes.delete(t)}cleanupDetachedIframes(){if(0!==this.attachedIframes.size){var t=[];this.attachedIframes.forEach(((e,i)=>{this.mirror.has(i)||t.push(i)})),t.forEach((t=>this.removeIframeById(t)))}}reattachIframes(){this.attachedIframes.forEach(((t,e)=>{var i=t.content;this.mirror.has(e)?this.mutationCb({adds:[{parentId:e,nextId:null,node:i}],removes:[],texts:[],attributes:[],isAttachIframe:!0}):this.attachedIframes.delete(e)}))}destroy(){this.recordCrossOriginIframes&&Mh(window,"message",this.messageHandler),this.nestedIframeListeners.forEach(((t,e)=>{Mh(e,"message",t)})),this.nestedIframeListeners.clear();var t=new Set;this.iframeElementsById.forEach((e=>t.add(e))),this.attachedIframes.forEach((e=>t.add(e.element))),t.forEach((t=>{this.disposeLoadListeners(t),this.removePageHideListener(t)})),this.crossOriginIframeMirror.reset(),this.crossOriginIframeStyleMirror.reset(),this.attachedIframes.clear(),this.crossOriginIframeMap=new WeakMap,this.iframes=new WeakMap,this.crossOriginIframeRootIdMap=new WeakMap,this.loadListenerDisposers=new WeakMap,this.pageHideHandlers=new WeakMap,this.attachedDocuments=new WeakMap,this.attachedWindows=new WeakMap,this.iframeElementsById=new Map}}class bd{constructor(t){Il(this,"shadowDoms",new WeakSet),Il(this,"mutationCb"),Il(this,"scrollCb"),Il(this,"bypassOptions"),Il(this,"mirror"),Il(this,"restoreHandlers",[]),this.mutationCb=t.mutationCb,this.scrollCb=t.scrollCb,this.bypassOptions=t.bypassOptions,this.mirror=t.mirror,this.init()}init(){this.reset(),this.patchAttachShadow(Element,document)}addShadowRoot(t,e){var i,r;if(Tu(t)&&!this.shadowDoms.has(t)){this.shadowDoms.add(t);var n=null!==(i=null==(r=Zl.host(t))?void 0:r.ownerDocument)&&void 0!==i?i:e,s=od(p({},this.bypassOptions,{doc:n,mutationCb:this.mutationCb,mirror:this.mirror,shadowDomManager:this}),t),o=s.observer,a=s.buffer;this.restoreHandlers.push({doc:n,handler(){o.disconnect(),a.destroy(),a.releaseCanvasManager();var t=nd.indexOf(a);-1!==t&&nd.splice(t,1)}}),this.restoreHandlers.push({doc:n,handler:ad(p({},this.bypassOptions,{scrollCb:this.scrollCb,doc:t,mirror:this.mirror}))}),setTimeout((()=>{t.adoptedStyleSheets&&t.adoptedStyleSheets.length>0&&this.bypassOptions.stylesheetManager.adoptStyleSheets(t.adoptedStyleSheets,this.mirror.getId(Zl.host(t))),this.restoreHandlers.push({doc:n,handler:fd({mirror:this.mirror,stylesheetManager:this.bypassOptions.stylesheetManager},t)})}),0)}}observeAttachShadow(t){t.contentWindow&&t.contentDocument&&this.patchAttachShadow(t.contentWindow.Element,t.contentDocument)}patchAttachShadow(t,e){var i=this;this.restoreHandlers.push({doc:e,handler:Gl(t.prototype,"attachShadow",(function(t){return function(r){var n=t.call(this,r),s=Zl.shadowRoot(this);return s&&Zh(this)&&i.addShadowRoot(s,e),n}}))})}reset(){this.restoreHandlers.forEach((t=>{var e=t.handler;try{e()}catch(t){}})),this.restoreHandlers=[],this.shadowDoms=new WeakSet}resetForDoc(t){var e=[];for(var i of this.restoreHandlers)if(i.doc===t)try{i.handler()}catch(t){}else e.push(i);this.restoreHandlers=e}}var wd="skip-frame";function kd(t){if("object"!=typeof t||null===t)return!1;var e=t.y,i=t.width,r=t.height;return Number.isFinite(t.x)&&Number.isFinite(e)&&Number.isFinite(i)&&Number.isFinite(r)&&i>=0&&r>=0}for(var Sd="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",xd="undefined"==typeof Uint8Array?[]:new Uint8Array(256),Cd=0;64>Cd;Cd++)xd[Sd.charCodeAt(Cd)]=Cd;var Td=new Map,Ed=(t,e,i)=>{if(t&&(Rd(t,e)||"object"==typeof t)){var r=function(t,e){var i=Td.get(t);return i||Td.set(t,i=new Map),i.has(e)||i.set(e,[]),i.get(e)}(i,t.constructor.name),n=r.indexOf(t);return-1===n&&(n=r.length,r.push(t)),n}};function Md(t,e,i,r){if(t instanceof Array)return t.map((t=>Md(t,e,i,r)));if(null===t)return t;if(t instanceof Float32Array||t instanceof Float64Array||t instanceof Int32Array||t instanceof Uint32Array||t instanceof Uint8Array||t instanceof Uint16Array||t instanceof Int16Array||t instanceof Int8Array||t instanceof Uint8ClampedArray)return{rr_type:t.constructor.name,args:[Object.values(t)]};if(t instanceof ArrayBuffer){var n=t.constructor.name,s=function(t){var e,i=new Uint8Array(t),r=i.length,n="";for(e=0;r>e;e+=3)n+=Sd[i[e]>>2],n+=Sd[(3&i[e])<<4|i[e+1]>>4],n+=Sd[(15&i[e+1])<<2|i[e+2]>>6],n+=Sd[63&i[e+2]];return r%3==2?n=n.substring(0,n.length-1)+"=":r%3==1&&(n=n.substring(0,n.length-2)+"=="),n}(t);return{rr_type:n,base64:s}}return t instanceof DataView?{rr_type:t.constructor.name,args:[Md(t.buffer,e,i,r),t.byteOffset,t.byteLength]}:t instanceof HTMLImageElement?{rr_type:t.constructor.name,src:t.src}:t instanceof HTMLCanvasElement?{rr_type:"HTMLImageElement",src:t.toDataURL(r.type,r.quality)}:t instanceof ImageData?{rr_type:t.constructor.name,args:[Md(t.data,e,i,r),t.width,t.height]}:Rd(t,e)||"object"==typeof t?{rr_type:t.constructor.name,index:Ed(t,e,i)}:t}var Id=(t,e,i,r)=>t.map((t=>Md(t,e,i,r))),Rd=(t,e)=>{var i=["WebGLActiveInfo","WebGLBuffer","WebGLFramebuffer","WebGLProgram","WebGLRenderbuffer","WebGLShader","WebGLShaderPrecisionFormat","WebGLTexture","WebGLUniformLocation","WebGLVertexArrayObject","WebGLVertexArrayObjectOES"].filter((t=>"function"==typeof e[t]));return Boolean(i.find((i=>t instanceof e[i])))},Pd=["webgl","webgl2"];function Ad(t){return"nodeType"in t}function Od(t,e,i,r){var n=[];try{if(r){var s=function(t,e,i){var r=t.GPUCanvasContext;if((null==r?void 0:r.prototype)&&"function"==typeof r.prototype.configure)return Gl(r.prototype,"configure",(function(r){return function(n){var s=function(t){var e=t.canvas;return e&&"object"==typeof e?e:null}(this);if(!s||Ad(s)&&qh(s,e,i,!0))return r.call(this,n);Ad(s)&&!("__context"in s)&&(s.__context="webgpu");var o=function(t){var e=t.GPUTextureUsage;return e?e.COPY_SRC|e.RENDER_ATTACHMENT:null}(t);return r.call(this,null!==o&&n?p({},n,{usage:"number"==typeof n.usage?n.usage|o:o}):n)}}))}(t,e,i);s&&n.push(s)}var o=Gl(t.HTMLCanvasElement.prototype,"getContext",(function(t){return function(n){for(var s=function(t){return"experimental-webgl"===t?"webgl":t}(n),o=arguments.length,a=new Array(o>1?o-1:0),l=1;o>l;l++)a[l-1]=arguments[l];if(!qh(this,e,i,!0)&&("__context"in this||(this.__context=s),r&&Pd.includes(s)))if(a[0]&&"object"==typeof a[0]){var u=a[0];u.preserveDrawingBuffer||(u.preserveDrawingBuffer=!0)}else a.splice(0,1,{preserveDrawingBuffer:!0});return t.apply(this,[n,...a])}}));n.push(o)}catch(t){console.error("failed to patch HTMLCanvasElement.prototype.getContext")}return()=>{n.forEach((t=>t()))}}function Fd(t,e,i,r,n,s,o){var a=[],l=Object.getOwnPropertyNames(t),u=function(l){if(["isContextLost","canvas","drawingBufferWidth","drawingBufferHeight"].includes(l))return 0;try{if("function"!=typeof t[l])return 0;var u=Gl(t,l,(function(t){return function(){for(var a=arguments.length,u=new Array(a),h=0;a>h;h++)u[h]=arguments[h];var d=t.apply(this,u);if(Ed(d,s,this),this.canvas&&"tagName"in this.canvas&&!qh(this.canvas,r,n,!0)){var v=Id(u,s,this,o);i(this.canvas,{type:e,property:l,args:v})}return d}}));a.push(u)}catch(s){var h=Oh(t,l,{set(t){this.canvas&&"tagName"in this.canvas&&!qh(this.canvas,r,n,!0)&&i(this.canvas,{type:e,property:l,args:[t],setter:!0})}});a.push(h)}};for(var h of l)u(h);return a}var Ld,$d,Dd,Nd='(function() {\n "use strict";\n var chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";\n var lookup = typeof Uint8Array === "undefined" ? [] : new Uint8Array(256);\n for (var i = 0; i < chars.length; i++) {\n lookup[chars.charCodeAt(i)] = i;\n }\n var encode = function(arraybuffer) {\n var bytes = new Uint8Array(arraybuffer), i2, len = bytes.length, base64 = "";\n for (i2 = 0; i2 < len; i2 += 3) {\n base64 += chars[bytes[i2] >> 2];\n base64 += chars[(bytes[i2] & 3) << 4 | bytes[i2 + 1] >> 4];\n base64 += chars[(bytes[i2 + 1] & 15) << 2 | bytes[i2 + 2] >> 6];\n base64 += chars[bytes[i2 + 2] & 63];\n }\n if (len % 3 === 2) {\n base64 = base64.substring(0, base64.length - 1) + "=";\n } else if (len % 3 === 1) {\n base64 = base64.substring(0, base64.length - 2) + "==";\n }\n return base64;\n };\n const lastFingerprintMap = /* @__PURE__ */ new Map();\n const transparentFingerprintMap = /* @__PURE__ */ new Map();\n const lastSentAtMap = /* @__PURE__ */ new Map();\n const PROVIDER_KEYFRAME_INTERVAL_MS = 3e4;\n function hashPixels(data) {\n const view = new Uint32Array(\n data.buffer,\n data.byteOffset,\n data.byteLength >>> 2\n );\n let primaryHash = 2166136261;\n let secondaryHash = 2654435769;\n for (let i2 = 0; i2 < view.length; i2++) {\n primaryHash ^= view[i2];\n primaryHash = Math.imul(primaryHash, 16777619);\n secondaryHash ^= view[i2];\n secondaryHash = Math.imul(secondaryHash, 2246822507);\n }\n return `${(primaryHash >>> 0).toString(16)}:${(secondaryHash >>> 0).toString(16)}`;\n }\n function frameFingerprint(width, height, data) {\n return `${width}x${height}:${hashPixels(data)}`;\n }\n function transparentFingerprint(width, height) {\n const pixelCount = width * height;\n let hash = transparentFingerprintMap.get(pixelCount);\n if (hash === void 0) {\n hash = hashPixels(new Uint8ClampedArray(pixelCount * 4));\n transparentFingerprintMap.set(pixelCount, hash);\n }\n return `${width}x${height}:${hash}`;\n }\n const worker = self;\n let reusableCanvas = null;\n let reusableCtx = null;\n worker.onmessage = async function(e) {\n if ("resetFrameDedup" in e.data) {\n lastFingerprintMap.clear();\n return;\n }\n if ("OffscreenCanvas" in globalThis) {\n const {\n id,\n bitmap,\n width,\n height,\n displayWidth,\n displayHeight,\n dataURLOptions,\n maskRegions\n } = e.data;\n try {\n if (!reusableCanvas || reusableCanvas.width !== width || reusableCanvas.height !== height) {\n reusableCanvas = new OffscreenCanvas(width, height);\n reusableCtx = reusableCanvas.getContext("2d", {\n willReadFrequently: true\n });\n }\n const ctx = reusableCtx;\n ctx.clearRect(0, 0, width, height);\n ctx.drawImage(bitmap, 0, 0);\n bitmap.close();\n if (maskRegions) {\n ctx.fillStyle = "black";\n for (const region of maskRegions) {\n ctx.fillRect(region.x, region.y, region.width, region.height);\n }\n }\n const fingerprint = frameFingerprint(\n width,\n height,\n ctx.getImageData(0, 0, width, height).data\n );\n const lastFingerprint = lastFingerprintMap.get(id) ?? transparentFingerprint(width, height);\n if (fingerprint === lastFingerprint) {\n const lastSentAt = lastSentAtMap.get(id);\n const keyframeDue = maskRegions !== void 0 && lastSentAt !== void 0 && Date.now() - lastSentAt >= PROVIDER_KEYFRAME_INTERVAL_MS;\n if (!keyframeDue) {\n return worker.postMessage({ id });\n }\n }\n const blob = await reusableCanvas.convertToBlob(dataURLOptions);\n const arrayBuffer = await blob.arrayBuffer();\n worker.postMessage({\n id,\n type: blob.type,\n base64: encode(arrayBuffer),\n // cpu intensive\n displayWidth,\n displayHeight\n });\n lastFingerprintMap.set(id, fingerprint);\n lastSentAtMap.set(id, Date.now());\n } catch {\n worker.postMessage({ id });\n }\n } else {\n e.data.bitmap.close();\n return worker.postMessage({ id: e.data.id });\n }\n };\n})();\n',qd="undefined"!=typeof self&&self.Blob&&new Blob([Nd],{type:"text/javascript;charset=utf-8"});function jd(t){var e;try{if(!(e=qd&&(self.URL||self.webkitURL).createObjectURL(qd)))throw"";var i=new Worker(e,{name:null==t?void 0:t.name});return i.addEventListener("error",(()=>{(self.URL||self.webkitURL).revokeObjectURL(e)})),i}catch(e){return new Worker("data:text/javascript;charset=utf-8,"+encodeURIComponent(Nd),{name:null==t?void 0:t.name})}finally{e&&(self.URL||self.webkitURL).revokeObjectURL(e)}}class Bd{constructor(t){Il(this,"pendingCanvasMutations",new Map),Il(this,"rafStamps",{latestId:0,invokeId:null}),Il(this,"mirror"),Il(this,"mutationCb"),Il(this,"resetObservers"),Il(this,"frozen",!1),Il(this,"locked",!1),Il(this,"rafIdTimestamp",null),Il(this,"rafIdFlush",null),Il(this,"refCount",0),Il(this,"torndown",!1),Il(this,"resetFrameDedup",null),Il(this,"processMutation",((t,e)=>{!(this.rafStamps.invokeId&&this.rafStamps.latestId!==this.rafStamps.invokeId)&&this.rafStamps.invokeId||(this.rafStamps.invokeId=this.rafStamps.latestId),this.pendingCanvasMutations.has(t)||this.pendingCanvasMutations.set(t,[]),this.pendingCanvasMutations.get(t).push(e)}));var e=t.sampling,i=void 0===e?"all":e,r=t.win,n=t.blockClass,s=t.blockSelector,o=t.recordCanvas,a=t.dataURLOptions,l=t.resolutionScale,u=t.canvasMasking;this.mutationCb=t.mutationCb,this.mirror=t.mirror,o&&"all"===i&&this.initCanvasMutationObserver(r,n,s,a),o&&"number"==typeof i&&this.initCanvasFPSObserver(i,r,n,s,{dataURLOptions:a,resolutionScale:l,canvasMasking:u})}onFullSnapshot(){var t;null==(t=this.resetFrameDedup)||t.call(this)}acquire(){this.refCount+=1}reset(){this.refCount>0&&(this.refCount-=1),this.refCount>0||this.teardown()}teardown(){this.torndown||(this.torndown=!0,this.pendingCanvasMutations.clear(),this.resetObservers&&this.resetObservers(),null!==this.rafIdTimestamp&&(cancelAnimationFrame(this.rafIdTimestamp),this.rafIdTimestamp=null),null!==this.rafIdFlush&&(cancelAnimationFrame(this.rafIdFlush),this.rafIdFlush=null))}freeze(){this.frozen=!0}unfreeze(){this.frozen=!1}lock(){this.locked=!0}unlock(){this.locked=!1}initCanvasFPSObserver(t,e,i,r,n){var s=this;if("OffscreenCanvas"in e){var o,a="number"==typeof n.resolutionScale&&Number.isFinite(n.resolutionScale)?Math.min(1,Math.max(.1,n.resolutionScale)):1,l=Od(e,i,r,!0),u=new Map;try{o=new jd}catch(t){return}var h=!1;o.onerror=()=>{var t;h=!0,cancelAnimationFrame(d),null==(t=o.terminate)||t.call(o),this.resetFrameDedup=null},this.resetFrameDedup=()=>{o.postMessage({resetFrameDedup:!0})},o.onmessage=t=>{var e=t.data.id;if(u.set(e,!1),"base64"in t.data){var i=t.data,r=i.displayWidth,n=i.displayHeight;this.mutationCb({id:e,type:Fl["2D"],commands:[{property:"clearRect",args:[0,0,r,n]},{property:"drawImage",args:[{rr_type:"ImageBitmap",args:[{rr_type:"Blob",data:[{rr_type:"ArrayBuffer",base64:i.base64}],type:i.type}]},0,0,r,n]}],displayWidth:r,displayHeight:n})}};var d,v=1e3/t,c=0,p=t=>{var l,g;h||(c&&v>t-c||(c=t,(l=[],g=t=>{try{t.querySelectorAll("canvas").forEach((t=>{qh(t,i,r,!0)||l.push(t)})),t.querySelectorAll("*").forEach((t=>{t.shadowRoot&&g(t.shadowRoot)}))}catch(t){}},g(e.document),l).forEach(function(){var t=f((function*(t){var e,i,r=s.mirror.getId(t);if(!u.get(r)&&0!==t.width&&0!==t.height){u.set(r,!0);try{if(["webgl","webgl2"].includes(t.__context)){var l=t.getContext(t.__context);if(null==(e=null==l?void 0:l.isContextLost)?void 0:e.call(l))return void u.set(r,!1);!1===(null==(i=null==l?void 0:l.getContextAttributes())?void 0:i.preserveDrawingBuffer)&&l.clear(l.COLOR_BUFFER_BIT)}var h=t.clientWidth||t.width,d=t.clientHeight||t.height,v=Math.max(1,Math.round(h*a)),c=Math.max(1,Math.round(d*a)),f=function(t,e,i,r,n,s){if(t&&"function"==typeof t.regionsFn){var o;try{o=t.regionsFn(e)}catch(t){return wd}if(void 0!==o){if(!Array.isArray(o)||!o.every(kd))return wd;var a=i/n,l=r/s;return o.filter((t=>t.width>0&&t.height>0)).map((t=>{var e=Math.floor(t.x*a),i=Math.floor(t.y*l);return{x:e,y:i,width:Math.ceil((t.x+t.width)*a)-e,height:Math.ceil((t.y+t.height)*l)-i}}))}}}(n.canvasMasking,t,v,c,h,d);if(f===wd)return void u.set(r,!1);var p=yield createImageBitmap(t,1>a?{resizeWidth:v,resizeHeight:c,resizeQuality:"medium"}:{resizeWidth:v,resizeHeight:c});o.postMessage({id:r,bitmap:p,width:v,height:c,displayWidth:h,displayHeight:d,dataURLOptions:n.dataURLOptions,maskRegions:f},[p])}catch(t){u.set(r,!1)}}}));return function(e){return t.apply(this,arguments)}}())),d=requestAnimationFrame(p))};d=requestAnimationFrame(p),this.resetObservers=()=>{var t;l(),cancelAnimationFrame(d),null==(t=o.terminate)||t.call(o),this.resetFrameDedup=null}}}initCanvasMutationObserver(t,e,i,r){this.startRAFTimestamping(),this.startPendingCanvasMutationFlusher();var n=Od(t,e,i,!1),s=function(t,e,i,r,n){var s=[],o=Object.getOwnPropertyNames(e.CanvasRenderingContext2D.prototype),a=function(o){try{if("function"!=typeof e.CanvasRenderingContext2D.prototype[o])return 1;var a=Gl(e.CanvasRenderingContext2D.prototype,o,(function(s){return function(){for(var a=arguments.length,l=new Array(a),u=0;a>u;u++)l[u]=arguments[u];return qh(this.canvas,i,r,!0)||setTimeout((()=>{var i=Id(l,e,this,n);t(this.canvas,{type:Fl["2D"],property:o,args:i})}),0),s.apply(this,l)}}));s.push(a)}catch(n){var l=Oh(e.CanvasRenderingContext2D.prototype,o,{set(e){qh(this.canvas,i,r,!0)||t(this.canvas,{type:Fl["2D"],property:o,args:[e],setter:!0})}});s.push(l)}};for(var l of o)a(l);return()=>{s.forEach((t=>t()))}}(this.processMutation.bind(this),t,e,i,r),o=function(t,e,i,r,n){var s=[];return void 0!==e.WebGLRenderingContext&&s.push(...Fd(e.WebGLRenderingContext.prototype,Fl.WebGL,t,i,r,e,n)),void 0!==e.WebGL2RenderingContext&&s.push(...Fd(e.WebGL2RenderingContext.prototype,Fl.WebGL2,t,i,r,e,n)),()=>{s.forEach((t=>t()))}}(this.processMutation.bind(this),t,e,i,r);this.resetObservers=()=>{n(),s(),o()}}startPendingCanvasMutationFlusher(){this.rafIdFlush=requestAnimationFrame((()=>this.flushPendingCanvasMutations()))}startRAFTimestamping(){var t=e=>{this.rafStamps.latestId=e,this.rafIdTimestamp=requestAnimationFrame(t)};this.rafIdTimestamp=requestAnimationFrame(t)}flushPendingCanvasMutations(){this.pendingCanvasMutations.forEach(((t,e)=>{var i=this.mirror.getId(e);this.flushPendingCanvasMutationFor(e,i)})),this.rafIdFlush=requestAnimationFrame((()=>this.flushPendingCanvasMutations()))}flushPendingCanvasMutationFor(t,e){if(!this.frozen&&!this.locked){var i=this.pendingCanvasMutations.get(t);if(i&&-1!==e){var r=i.map((t=>g(t,El)));this.mutationCb({id:e,type:i[0].type,commands:r}),this.pendingCanvasMutations.delete(t)}}}}class Ud{constructor(t){var e;Il(this,"trackedLinkElements",new WeakSet),Il(this,"pendingDeferredSheets",new Set),Il(this,"mutationCb"),Il(this,"adoptedStyleSheetCb"),Il(this,"maskAllElementAttributes"),Il(this,"maskAttributeFn"),Il(this,"styleMirror",new Vh),this.mutationCb=t.mutationCb,this.adoptedStyleSheetCb=t.adoptedStyleSheetCb,this.maskAllElementAttributes=null!==(e=t.maskAllElementAttributes)&&void 0!==e&&e,this.maskAttributeFn=t.maskAttributeFn}attachLinkElement(t,e){"_cssText"in e.attributes&&this.mutationCb({adds:[],removes:[],texts:[],attributes:[{id:e.id,attributes:e.attributes}]}),this.trackLinkElement(t)}beginDeferredLinkInlining(t,e){if(-1===e||!t.isConnected)return null;var i=null,r=null;try{(r=t.sheet)&&(i=Du(r))}catch(t){}if(!i||!r)return ku(),null;var n=i,s=!1,o={sheet:r,invalidate(){s=!0}};this.pendingDeferredSheets.add(o);var a=!1;return{advance:i=>{if(a)return!0;var l,u,h=Jl(),d=tu(),v=!0;try{if(s)return a=!0,ku(),!0;if(!n.advance(i))return v=!1,!1;a=!0;var c=n.text();if(!t.isConnected)return!0;var f=null;try{f=t.sheet}catch(t){}return f!==r?(ku(),!0):c?(this.emitCssTextMutation(t,e,c),!0):(ku(),!0)}finally{v&&this.pendingDeferredSheets.delete(o),eu(l=Jl()-h,null!=(u=d)?u:Kl)||(vu.totalMs+=l,l>vu.slowestSliceMs&&(vu.slowestSliceMs=l))}},remainingRules:()=>n.remainingRules(),discard:()=>{this.pendingDeferredSheets.delete(o)}}}onCssomSheetMutation(t){if(t&&0!==this.pendingDeferredSheets.size)for(var e of this.pendingDeferredSheets)e.sheet===t&&(this.pendingDeferredSheets.delete(e),e.invalidate())}inlineDeferredLinkElement(t,e){var i;null==(i=this.beginDeferredLinkInlining(t,e))||i.advance(1/0)}emitCssTextMutation(t,e,i){this.mutationCb({adds:[],removes:[],texts:[],attributes:[{id:e,attributes:{_cssText:Uu({element:t,name:"_cssText",value:i,maskAllElementAttributes:this.maskAllElementAttributes,maskAttributeFn:this.maskAttributeFn})}}]})}trackLinkElement(t){this.trackedLinkElements.has(t)||(this.trackedLinkElements.add(t),this.trackStylesheetInLinkElement(t))}adoptStyleSheets(t,e){var i=this;if(0!==t.length){var r={id:e,styleIds:[]},n=[],s=function(t){var e;if(i.styleMirror.has(t))e=i.styleMirror.getId(t);else{var s=i.styleMirror.add(t);e=s;var o=Jl();try{_u((()=>{try{var e=t.rules||t.cssRules;e&&yu(e)}catch(t){}n.push({styleId:s,rules:Array.from(t.rules||CSSRule,((e,i)=>({rule:Pu(e,t.href),index:i})))})}))}finally{bu(Jl()-o)}}r.styleIds.push(e)};for(var o of t)s(o);n.length>0&&(r.styles=n),this.adoptedStyleSheetCb(r)}}reset(){this.styleMirror.reset(),this.trackedLinkElements=new WeakSet,this.pendingDeferredSheets.clear(),yh.forEach((t=>t.abort())),yh.clear()}trackStylesheetInLinkElement(t){}}class Hd{constructor(){Il(this,"nodeMap",new WeakMap),Il(this,"active",!1)}inOtherBuffer(t,e){var i=this.nodeMap.get(t);return i&&Array.from(i).some((t=>t!==e))}add(t,e){this.active||(this.active=!0,requestAnimationFrame((()=>{this.nodeMap=new WeakMap,this.active=!1}))),this.nodeMap.set(t,(this.nodeMap.get(t)||new Set).add(e))}destroy(){}}var zd=!1;try{if(2!==Array.from([1],(t=>2*t))[0]){var Wd=document.createElement("iframe");document.body.appendChild(Wd),Array.from=(null==(Tl=Wd.contentWindow)?void 0:Tl.Array.from)||Array.from,document.body.removeChild(Wd)}}catch(t){console.debug("Unable to override Array.from",t)}var Vd=new Nu,Gd=new Set([Pl.Mutation,Pl.MediaInteraction,Pl.StyleSheetRule,Pl.CanvasMutation,Pl.Font,Pl.Log,Pl.StyleDeclaration,Pl.AdoptedStyleSheet]);function Zd(t){var e=window;if("function"==typeof e.requestIdleCallback){var i=e.requestIdleCallback(t,{timeout:2e3});return{cancel(){var t;return null==(t=e.cancelIdleCallback)?void 0:t.call(e,i)}}}var r=setTimeout(t,250);return{cancel:()=>clearTimeout(r)}}function Qd(t){var e;void 0===t&&(t={});var i=t,r=i.emit,n=i.checkoutEveryNms,s=i.checkoutEveryNth,o=i.blockClass,a=void 0===o?"rr-block":o,l=i.blockSelector,u=void 0===l?null:l,h=i.ignoreClass,d=void 0===h?"rr-ignore":h,v=i.ignoreSelector,c=void 0===v?null:v,f=i.maskTextClass,g=void 0===f?"rr-mask":f,m=i.maskTextSelector,y=void 0===m?null:m,_=i.inlineStylesheet,b=void 0===_||_,w=i.inlineStylesheetBudgetRules,k=i.maskAllInputs,S=i.maskInputOptions,x=i.slimDOMOptions,C=i.maskInputFn,T=i.maskTextFn,E=i.maskAllElementAttributes,M=void 0!==E&&E,I=i.maskAttributeFn,R=i.hooks,P=i.packFn,A=i.sampling,O=void 0===A?{}:A,F=i.dataURLOptions,L=void 0===F?{}:F,D=i.canvasResolutionScale,N=i.canvasMasking,q=i.mousemoveWait,j=i.recordDOM,B=void 0===j||j,U=i.recordCanvas,H=void 0!==U&&U,z=i.recordCrossOriginIframes,W=void 0!==z&&z,V=i.recordAfter,G=void 0===V?"DOMContentLoaded"===t.recordAfter?t.recordAfter:"load":V,Z=i.userTriggeredOnInput,Q=void 0!==Z&&Z,J=i.collectFonts,K=void 0!==J&&J,Y=i.inlineImages,X=void 0!==Y&&Y,tt=i.plugins,et=i.keepIframeSrcFn,it=void 0===et?()=>!1:et,rt=i.ignoreCSSAttributes,nt=void 0===rt?new Set([]):rt,st=i.attributeFilter;Kh=i.errorHandler;var ot=p({type:"image/webp",quality:.4,maxBase64ImageLength:1048576},L),at=!W||window.parent===window,lt=!1;if(!at)try{window.parent.document&&(lt=!1)}catch(t){lt=!0}if(at&&!r)throw new Error("emit function is required");if(!at&&!lt)return()=>{};void 0!==q&&void 0===O.mousemove&&(O.mousemove=q),Vd.reset();var ut,ht=!0===k?{color:!0,date:!0,"datetime-local":!0,email:!0,month:!0,number:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0,textarea:!0,select:!0,password:!0}:void 0!==S?S:{password:!0},dt=Ch(void 0!==x&&x);!function(t){void 0===t&&(t=window),"NodeList"in t&&!t.NodeList.prototype.forEach&&(t.NodeList.prototype.forEach=[].forEach),"DOMTokenList"in t&&!t.DOMTokenList.prototype.forEach&&(t.DOMTokenList.prototype.forEach=[].forEach)}();var vt,ct,ft=0,pt=new Map,gt=t=>{for(var e of tt||[])e.eventProcessor&&(t=e.eventProcessor(t));return P&&!lt&&(t=P(t)),t};Ld=(t,e)=>{var i,o=t;if(o.timestamp=Fh(),!(null==(i=nd[0])?void 0:i.isFrozen())||o.type===Rl.FullSnapshot||o.type===Rl.IncrementalSnapshot&&Gd.has(o.data.source)||nd.forEach((t=>t.unfreeze())),at)null==r||r(gt(o),e);else if(lt){var a={type:"rrweb",event:gt(o),origin:window.location.origin,isCheckout:e};window.parent.postMessage(a,"*")}if(o.type===Rl.FullSnapshot)ut=o,ft=0;else if(o.type===Rl.IncrementalSnapshot){if(o.data.source===Pl.Mutation&&o.data.isAttachIframe)return;ft++,(s&&ft>=s||n&&o.timestamp-ut.timestamp>n)&&$d(!0)}};var mt=t=>{if(t.removes&&t.removes.length>0){var e=t.adds.length>0?new Set(t.adds.map((t=>t.node.id))):null,i=new Set;if(t.adds.length>0)for(var r of t.adds){var n=Vd.getNode(r.node.id);n&&"IFRAME"===n.nodeName&&i.add(n)}t.removes.forEach((t=>{var r=t.id;if(!e||!e.has(r)){var n=wt.getIframeElementById(r);n&&i.has(n)?wt.forgetIframeId(r):(null==vt||vt(r),wt.removeIframeById(r))}})),null==ct||ct(),wt.cleanupDetachedIframes()}Ld({type:Rl.IncrementalSnapshot,data:p({source:Pl.Mutation},t)})},yt=t=>Ld({type:Rl.IncrementalSnapshot,data:p({source:Pl.Scroll},t)}),_t=t=>Ld({type:Rl.IncrementalSnapshot,data:p({source:Pl.CanvasMutation},t)}),bt=new Ud({mutationCb:mt,adoptedStyleSheetCb:t=>Ld({type:Rl.IncrementalSnapshot,data:p({source:Pl.AdoptedStyleSheet},t)}),maskAllElementAttributes:M,maskAttributeFn:I}),wt=new _d({mirror:Vd,mutationCb:mt,stylesheetManager:bt,recordCrossOriginIframes:W,wrappedEmit:Ld});for(var kt of tt||[])kt.getMirror&&kt.getMirror({nodeMirror:Vd,crossOriginIframeMirror:wt.crossOriginIframeMirror,crossOriginIframeStyleMirror:wt.crossOriginIframeStyleMirror});var St=new Hd,xt=null==N?void 0:N.configured;Dd=new Bd({recordCanvas:H,mutationCb:_t,win:window,blockClass:a,blockSelector:u,mirror:Vd,sampling:O.canvas,dataURLOptions:ot,resolutionScale:D,canvasMasking:N});var Ct=new bd({mutationCb:mt,scrollCb:yt,bypassOptions:{blockClass:a,blockSelector:u,maskTextClass:g,maskTextSelector:y,inlineStylesheet:b,maskInputOptions:ht,dataURLOptions:ot,maskTextFn:T,maskInputFn:C,maskAllElementAttributes:M,maskAttributeFn:I,recordCanvas:H,canvasMaskingConfigured:xt,inlineImages:X,sampling:O,slimDOMOptions:dt,iframeManager:wt,stylesheetManager:bt,canvasManager:Dd,keepIframeSrcFn:it,processedNodeManager:St,attributeFilter:st},mirror:Vd});$d=function(t){if(void 0===t&&(t=!1),B){fu(w);try{Ld({type:Rl.Meta,data:{href:window.location.href,width:Dh(),height:$h()}},t),null==e||e.cancel(),e=void 0,bt.reset(),Ct.init(),nd.forEach((t=>t.lock()));var i,r=null;try{r=function(t,e){var i=e||{},r=i.mirror,n=void 0===r?new Nu:r,s=i.blockClass,o=void 0===s?"rr-block":s,a=i.blockSelector,l=void 0===a?null:a,u=i.maskTextClass,h=void 0===u?"rr-mask":u,d=i.maskTextSelector,v=void 0===d?null:d,c=i.inlineStylesheet,f=void 0===c||c,p=i.inlineImages,g=void 0!==p&&p,m=i.recordCanvas,y=void 0!==m&&m,_=i.canvasMaskingConfigured,b=i.maskAllInputs,w=void 0!==b&&b,k=i.maskTextFn,S=i.maskInputFn,x=i.maskAllElementAttributes,C=void 0!==x&&x,T=i.maskAttributeFn,E=i.slimDOM,M=i.dataURLOptions,I=i.preserveWhiteSpace,R=i.onSerialize,P=i.onIframeLoad,A=i.iframeLoadTimeout,O=i.onIframeListenerRegistered,F=i.onStylesheetLoad,L=i.stylesheetLoadTimeout,D=i.keepIframeSrcFn,N=void 0===D?()=>!1:D,q=i.maxDepth,j=i.inlineStylesheetBudgetRules,B=!0===w?{color:!0,date:!0,"datetime-local":!0,email:!0,month:!0,number:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0,textarea:!0,select:!0,password:!0}:!1===w?{password:!0}:w,U=Ch(void 0!==E&&E);fu(j);try{return xh(t,{doc:t,mirror:n,blockClass:o,blockSelector:l,maskTextClass:h,maskTextSelector:v,skipChild:!1,inlineStylesheet:f,maskInputOptions:B,maskTextFn:k,maskInputFn:S,maskAllElementAttributes:C,maskAttributeFn:T,slimDOMOptions:U,dataURLOptions:M,inlineImages:g,recordCanvas:y,canvasMaskingConfigured:_,preserveWhiteSpace:I,onSerialize:R,onIframeLoad:P,iframeLoadTimeout:A,onIframeListenerRegistered:O,onStylesheetLoad:F,stylesheetLoadTimeout:L,keepIframeSrcFn:N,newlyAddedElement:!1,maxDepth:q})}finally{pu()}}(document,{mirror:Vd,blockClass:a,blockSelector:u,maskTextClass:g,maskTextSelector:y,inlineStylesheet:b,maskAllInputs:ht,inlineStylesheetBudgetRules:w,maskTextFn:T,maskInputFn:C,maskAllElementAttributes:M,maskAttributeFn:I,slimDOM:dt,dataURLOptions:ot,recordCanvas:H,canvasMaskingConfigured:xt,inlineImages:X,onSerialize(t){Hh(t,Vd)&&wt.addIframe(t),zh(t,Vd)&&bt.trackLinkElement(t),Wh(t)&&Ct.addShadowRoot(Zl.shadowRoot(t),document)},onIframeLoad(t,e){wt.attachIframe(t,e),Ct.observeAttachShadow(t)},onIframeListenerRegistered(t,e){wt.registerLoadListenerDisposer(t,e)},onStylesheetLoad(t,e){bt.attachLinkElement(t,e)},keepIframeSrcFn:it})}finally{s=lu,lu=[],i=s}if(!r)return console.warn("Failed to snapshot the document");if(Ld({type:Rl.FullSnapshot,data:{node:r,initialOffset:Lh(window)}},t),nd.forEach((t=>t.unlock())),Dd.onFullSnapshot(),i.length){var n=function(t,e,i){var r=!1,n=null,s=0,o=null,a=()=>null!==o||t.length>s,l=()=>{var i=t[s];t[s]=null,s+=1,i&&Ih((()=>{o=e.beginDeferredLinkInlining(i,Vd.getId(i))}))},u=()=>{if(o){var t=o,e=!0;Ih((()=>{e=t.advance(200)})),e&&(o=null)}},h=t=>{if(n=null,!r){var e=0;do{try{o||l(),u()}catch(t){null==o||o.discard(),o=null,Su(1)}e+=1}while(!r&&a()&&(t?!t.didTimeout&&t.timeRemaining()>5:10>e));r||(a()?n=Zd(h):i())}};return n=Zd(h),{cancel(){r=!0,null==o||o.discard(),o=null,null==n||n.cancel(),n=null},flush(){if(!r){r=!0,null==n||n.cancel(),n=null;for(var e=0,h=0;a()&&50>e;){o||l();var d=o;if(d)if(Math.floor(d.remainingRules()/200)+1>50-e)d.discard(),o=null,h+=1;else{try{u()}catch(t){null==o||o.discard(),o=null,h+=1}e+=1}}if(a()||h>0){for(var v=h+(null!==o?1:0),c=s;t.length>c;c++)null!==t[c]&&(v+=1);Su(v),null==o||o.discard(),o=null}i()}}}}(i,bt,(()=>{e===n&&(e=void 0)}));e=n}W&&wt.reattachIframes(),document.adoptedStyleSheets&&document.adoptedStyleSheets.length>0&&bt.adoptStyleSheets(document.adoptedStyleSheets,Vd.getId(document))}finally{pu()}var s}};try{var Tt=[];for(var Et of(Tt.push(Eh("pagehide",(()=>{try{null==e||e.flush()}catch(t){}e=void 0}),window)),["visibilitychange","freeze","resume"]))Tt.push(Eh(Et,Xl,document));vt=t=>{var e=pt.get(t);e&&(e.forEach((t=>{Ih(t);var e=Tt.indexOf(t);-1!==e&&Tt.splice(e,1)})),pt.delete(t))},ct=()=>{for(var t of pt){var e=t[0],i=Vd.getNode(e);if(i)try{i.contentDocument&&i.contentDocument.defaultView||null==vt||vt(e)}catch(t){null==vt||vt(e)}else null==vt||vt(e)}};var Mt=t=>{var e;return rd(pd)({mutationCb:mt,mousemoveCb:(t,e)=>Ld({type:Rl.IncrementalSnapshot,data:{source:e,positions:t}}),mouseInteractionCb:t=>Ld({type:Rl.IncrementalSnapshot,data:p({source:Pl.MouseInteraction},t)}),scrollCb:yt,viewportResizeCb:t=>Ld({type:Rl.IncrementalSnapshot,data:p({source:Pl.ViewportResize},t)}),inputCb:t=>Ld({type:Rl.IncrementalSnapshot,data:p({source:Pl.Input},t)}),mediaInteractionCb:t=>Ld({type:Rl.IncrementalSnapshot,data:p({source:Pl.MediaInteraction},t)}),styleSheetRuleCb:t=>Ld({type:Rl.IncrementalSnapshot,data:p({source:Pl.StyleSheetRule},t)}),styleDeclarationCb:t=>Ld({type:Rl.IncrementalSnapshot,data:p({source:Pl.StyleDeclaration},t)}),canvasMutationCb:_t,fontCb:t=>Ld({type:Rl.IncrementalSnapshot,data:p({source:Pl.Font},t)}),selectionCb(t){Ld({type:Rl.IncrementalSnapshot,data:p({source:Pl.Selection},t)})},customElementCb(t){Ld({type:Rl.IncrementalSnapshot,data:p({source:Pl.CustomElement},t)})},blockClass:a,ignoreClass:d,ignoreSelector:c,maskTextClass:g,maskTextSelector:y,maskInputOptions:ht,inlineStylesheet:b,sampling:O,recordDOM:B,recordCanvas:H,canvasMaskingConfigured:xt,inlineImages:X,userTriggeredOnInput:Q,collectFonts:K,doc:t,maskInputFn:C,maskTextFn:T,maskAllElementAttributes:M,maskAttributeFn:I,keepIframeSrcFn:it,blockSelector:u,slimDOMOptions:dt,dataURLOptions:ot,mirror:Vd,iframeManager:wt,stylesheetManager:bt,shadowDomManager:Ct,processedNodeManager:St,canvasManager:Dd,ignoreCSSAttributes:nt,attributeFilter:st,plugins:(null==(e=null==tt?void 0:tt.filter((t=>t.observer)))?void 0:e.map((t=>({observer:t.observer,options:t.options,callback:e=>Ld({type:Rl.Plugin,data:{plugin:t.name,payload:e}})}))))||[]},R)};wt.addLoadListener((t=>{try{var e=Vd.getId(t),i=Mt(t.contentDocument);if("function"==typeof i&&(Tt.push(i),-1!==e)){var r=pt.get(e);r||pt.set(e,r=new Set),r.add(i)}}catch(t){console.warn(t)}})),wt.addPageHideListener((t=>{var e=Vd.getId(t);null==vt||vt(e),ld(t)}));var It=-1,Rt=t=>Ld({type:Rl.Custom,data:{tag:"rrweb/fullscreen",payload:t}}),Pt=()=>{var t,e,i,r,n=document,s=null!==(t=null!==(e=null!==(i=null!==(r=n.fullscreenElement)&&void 0!==r?r:n.webkitFullscreenElement)&&void 0!==i?i:n.mozFullScreenElement)&&void 0!==e?e:n.msFullscreenElement)&&void 0!==t?t:null,o=s?Vd.getId(s):-1;o!==It&&(-1!==It&&Rt({id:It,enter:!1}),It=o,-1!==o&&Rt({id:o,enter:!0}))},At=()=>{$d();var t=Mt(document);"function"==typeof t&&Tt.push(t),Tt.push(Eh("fullscreenchange",Pt)),Tt.push(Eh("webkitfullscreenchange",Pt)),Tt.push(Eh("mozfullscreenchange",Pt)),Tt.push(Eh("MSFullscreenChange",Pt)),zd=!0};return["interactive","complete"].includes(document.readyState)?At():(Tt.push(Eh("DOMContentLoaded",(()=>{Ld({type:Rl.DomContentLoaded,data:{}}),"DOMContentLoaded"===G&&At()}))),Tt.push(Eh("load",(()=>{Ld({type:Rl.Load,data:{}}),"load"===G&&At()}),window))),()=>{try{null==e||e.flush()}catch(t){}e=void 0,Tt.forEach((t=>Ih(t))),St.destroy(),wt.removeLoadListener(),wt.destroy(),pt.clear(),Ct.reset(),Vd.reset(),zd=!1,Kh=void 0}}catch(t){console.warn(t)}}Qd.addCustomEvent=(t,e)=>{if(!zd)throw new Error("please add custom event after start recording");Ld({type:Rl.Custom,data:{tag:t,payload:e}})},Qd.freezePage=()=>{nd.forEach((t=>t.freeze()))},Qd.takeFullSnapshot=t=>{if(!zd)throw new Error("please take full snapshot after start recording");$d(t)},Qd.mirror=Vd;var Jd=Object.defineProperty,Kd=(t,e,i)=>((t,e,i)=>e in t?Jd(t,e,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[e]=i)(t,"symbol"!=typeof e?e+"":e,i);class Yd{constructor(t){Kd(this,"fileName"),Kd(this,"functionName"),Kd(this,"lineNumber"),Kd(this,"columnNumber"),this.fileName=t.fileName||"",this.functionName=t.functionName||"",this.lineNumber=t.lineNumber,this.columnNumber=t.columnNumber}toString(){var t=this.lineNumber||"",e=this.columnNumber||"";return this.functionName?this.functionName+" ("+this.fileName+":"+t+":"+e+")":this.fileName+":"+t+":"+e}}var Xd=/(^|@)\S+:\d+/,tv=/^\s*at .*(\S+:\d+|\(native\))/m,ev=/^(eval@)?(\[native code])?$/,iv={parse(t){return t?void 0!==t.stacktrace||void 0!==t["opera#sourceloc"]?this.parseOpera(t):t.stack&&t.stack.match(tv)?this.parseV8OrIE(t):t.stack?this.parseFFOrSafari(t):[]:[]},extractLocation(t){if(-1===t.indexOf(":"))return[t];var e=/(.+?)(?::(\d+))?(?::(\d+))?$/.exec(t.replace(/[()]/g,""));if(!e)throw new Error("Cannot parse given url: "+t);return[e[1],e[2]||void 0,e[3]||void 0]},parseV8OrIE(t){return t.stack.split("\n").filter((function(t){return!!t.match(tv)}),this).map((function(t){t.indexOf("(eval ")>-1&&(t=t.replace(/eval code/g,"eval").replace(/(\(eval at [^()]*)|(\),.*$)/g,""));var e=t.replace(/^\s+/,"").replace(/\(eval code/g,"("),i=e.match(/ (\((.+):(\d+):(\d+)\)$)/),r=(e=i?e.replace(i[0],""):e).split(/\s+/).slice(1),n=this.extractLocation(i?i[1]:r.pop()),s=r.join(" ")||void 0,o=["eval","<anonymous>"].indexOf(n[0])>-1?void 0:n[0];return new Yd({functionName:s,fileName:o,lineNumber:n[1],columnNumber:n[2]})}),this)},parseFFOrSafari(t){return t.stack.split("\n").filter((function(t){return!t.match(ev)}),this).map((function(t){if(t.indexOf(" > eval")>-1&&(t=t.replace(/ line (\d+)(?: > eval line \d+)* > eval:\d+:\d+/g,":$1")),-1===t.indexOf("@")&&-1===t.indexOf(":"))return new Yd({functionName:t});var e=/((.*".+"[^@]*)?[^@]*)(?:@)/,i=t.match(e),r=i&&i[1]?i[1]:void 0,n=this.extractLocation(t.replace(e,""));return new Yd({functionName:r,fileName:n[0],lineNumber:n[1],columnNumber:n[2]})}),this)},parseOpera(t){return!t.stacktrace||t.message.indexOf("\n")>-1&&t.message.split("\n").length>t.stacktrace.split("\n").length?this.parseOpera9(t):t.stack?this.parseOpera11(t):this.parseOpera10(t)},parseOpera9(t){for(var e=/Line (\d+).*script (?:in )?(\S+)/i,i=t.message.split("\n"),r=[],n=2,s=i.length;s>n;n+=2){var o=e.exec(i[n]);o&&r.push(new Yd({fileName:o[2],lineNumber:parseFloat(o[1])}))}return r},parseOpera10(t){for(var e=/Line (\d+).*script (?:in )?(\S+)(?:: In function (\S+))?$/i,i=t.stacktrace.split("\n"),r=[],n=0,s=i.length;s>n;n+=2){var o=e.exec(i[n]);o&&r.push(new Yd({functionName:o[3]||void 0,fileName:o[2],lineNumber:parseFloat(o[1])}))}return r},parseOpera11(t){return t.stack.split("\n").filter((function(t){return!!t.match(Xd)&&!t.match(/^Error created at/)}),this).map((function(t){var e=t.split("@"),i=this.extractLocation(e.pop()),r=(e.shift()||"").replace(/<anonymous function(: (\w+))?>/,"$2").replace(/\([^)]*\)/g,"")||void 0;return new Yd({functionName:r,fileName:i[0],lineNumber:i[1],columnNumber:i[2]})}),this)}};function rv(t){if(!t||!t.outerHTML)return"";for(var e="";t.parentElement;){var i=t.localName;if(!i)break;i=i.toLowerCase();var r=t.parentElement,n=[];if(r.children&&r.children.length>0)for(var s=0;r.children.length>s;s++){var o=r.children[s];o.localName&&o.localName.toLowerCase&&o.localName.toLowerCase()===i&&n.push(o)}n.length>1&&(i+=":eq("+n.indexOf(t)+")"),e=i+(e?">"+e:""),t=r}return e}function nv(t){return Array.isArray(t)}function sv(t){return"object"==typeof t&&null!==t&&!nv(t)}function ov(t,e){if(0===e)return!0;var i=Object.keys(t);for(var r of i)if(sv(t[r])&&ov(t[r],e-1))return!0;return!1}function av(t,e){var i={numOfKeysLimit:50,depthOfLimit:4};Object.assign(i,e);var r=[],n=[];return JSON.stringify(t,(function(t,e){if(r.length>0){var s=r.indexOf(this);~s?r.splice(s+1):r.push(this),~s?n.splice(s,1/0,t):n.push(t),~r.indexOf(e)&&(e=r[0]===e?"[Circular ~]":"[Circular ~."+n.slice(0,r.indexOf(e)).join(".")+"]")}else r.push(e);if(null===e)return e;if(void 0===e)return"undefined";if(sv(o=e)&&Object.keys(o).length>i.numOfKeysLimit||"function"==typeof o||sv(o)&&ov(o,i.depthOfLimit))return function(t){var e=t.toString();return i.stringLengthLimit&&e.length>i.stringLengthLimit&&(e=e.slice(0,i.stringLengthLimit)+"..."),e}(e);var o;if("bigint"==typeof e)return e.toString()+"n";if(e instanceof Event){var a={};for(var l in e){var u=e[l];a[l]=nv(u)?rv(u.length?u[0]:null):u}return a}return e instanceof Node?e instanceof HTMLElement?e?e.outerHTML:"":e.nodeName:e instanceof Error?e.stack?e.stack+"\nEnd of stack for Error object":e.name+": "+e.message:e}))}var lv={level:["assert","clear","count","countReset","debug","dir","dirxml","error","group","groupCollapsed","groupEnd","info","log","table","time","timeEnd","timeLog","trace","warn"],lengthThreshold:1e3,logger:"console"};function uv(t,e,i){var r,n=i?Object.assign({},lv,i):lv,s=n.logger;if(!s)return()=>{};r="string"==typeof s?e[s]:s;var o=0,a=!1,l=[];if(n.level.includes("error")){var u=e=>{var i=e.message,r=iv.parse(e.error).map((t=>t.toString())),s=[av(i,n.stringifyOptions)];t({level:"error",trace:r,payload:s})};e.addEventListener("error",u),l.push((()=>{e.removeEventListener("error",u)}));var h=e=>{var i,r;e.reason instanceof Error?r=[av("Uncaught (in promise) "+(i=e.reason).name+": "+i.message,n.stringifyOptions)]:(i=new Error,r=[av("Uncaught (in promise)",n.stringifyOptions),av(e.reason,n.stringifyOptions)]);var s=iv.parse(i).map((t=>t.toString()));t({level:"error",trace:s,payload:r})};e.addEventListener("unhandledrejection",h),l.push((()=>{e.removeEventListener("unhandledrejection",h)}))}for(var d of n.level)l.push(v(r,d));return()=>{l.forEach((t=>t()))};function v(e,i){var r=this;return e[i]?function(e,s,l){try{if(!(s in e))return()=>{};var u=e[s],h={next:u},d=(e=>function(){for(var s=arguments.length,l=new Array(s),u=0;s>u;u++)l[u]=arguments[u];if(e.apply(r,l),!("assert"===i&&l[0]||a)){a=!0;try{var h=iv.parse(new Error).map((t=>t.toString())).splice(1),d=("assert"===i?l.slice(1):l).map((t=>av(t,n.stringifyOptions)));o++,n.lengthThreshold>o?t({level:i,trace:h,payload:d}):o===n.lengthThreshold&&t({level:"warn",trace:[],payload:[av("The number of log records reached the threshold.")]})}catch(t){e("rrweb logger error:",t,...l)}finally{a=!1}}})((function(){for(var t=arguments.length,e=new Array(t),i=0;t>i;i++)e[i]=arguments[i];return h.next.apply(this,e)}));return"function"==typeof d&&(d.prototype=d.prototype||{},Object.defineProperties(d,{__rrweb_original__:{enumerable:!1,value:u},__rrweb_layer__:{enumerable:!1,value:h}})),e[s]=d,()=>{if(e[s]!==d)for(var t=e[s];"function"==typeof t&&t.__rrweb_layer__;){var i=t.__rrweb_layer__;if(i.next===d)return void(i.next=h.next);t=i.next}else e[s]=h.next}}catch(t){return()=>{}}}(e,i):()=>{}}}var hv=t=>({name:"rrweb/console@1",observer:uv,options:t}),dv=t=>"undefined"!=typeof Document&&t instanceof Document,vv=()=>{};function cv(t,e,i){try{if(!(e in t))return vv;var r={next:t[e]},n=i((function(){for(var t=arguments.length,e=new Array(t),i=0;t>i;i++)e[i]=arguments[i];return r.next.apply(this,e)}));return nt(n)&&(n.prototype=n.prototype||{},Object.defineProperties(n,{__posthog_wrapped__:{enumerable:!1,value:!0},__posthog_layer__:{enumerable:!1,value:r}})),t[e]=n,()=>{if(t[e]!==n)for(var i=t[e];nt(i)&&i.__posthog_layer__;){var s=i.__posthog_layer__;if(s.next===n)return void(s.next=r.next);i=s.next}else t[e]=r.next}}catch(t){return vv}}function fv(t,e){var i,r=function(t){try{return"string"==typeof t?new URL(t).hostname:"url"in t?new URL(t.url).hostname:t.hostname}catch(t){return null}}(t),n={hostname:r,isHostDenied:!1};if(null==(i=e.payloadHostDenyList)||!i.length||null==r||!r.trim().length)return n;for(var s of e.payloadHostDenyList)if(r.endsWith(s))return{hostname:r,isHostDenied:!0};return n}var pv=Bi("[Recorder]"),gv=t=>"navigation"===t.entryType,mv=t=>"resource"===t.entryType;function yv(t,e){return!!e&&(ft(e)||e[t])}function _v(t){if("undefined"==typeof Request)return!1;if(t instanceof Request)return!0;try{return"[object Request]"==={}.toString.call(t)}catch(t){return!1}}var bv=["image/","video/","audio/","font/","application/octet-stream","application/pdf","application/zip","application/wasm"];function wv(t){var e=t.type,i=t.recordBody,r=t.headers;function n(t){var e=Object.keys(r).find((t=>"content-type"===t.toLowerCase())),i=e&&r[e];return t.some((t=>null==i?void 0:i.toLowerCase().includes(t)))}if(!i)return!1;if(function t(e){try{return"string"==typeof e?e.startsWith("blob:"):e instanceof URL?"blob:"===e.protocol:!!_v(e)&&t(e.url)}catch(t){return!1}}(t.url))return!1;if(n(bv))return!1;if(ft(i))return!0;if(rt(i))return n(i);var s=i[e];return ft(s)?s:n(s)}function kv(t,e,i,r,n,s){return Sv.apply(this,arguments)}function Sv(){return Sv=f((function*(t,e,i,r,n,s){if(void 0===s&&(s=0),s>10)return pv.warn("Failed to get performance entry for request",{url:i,initiatorType:e}),null;var o=function(t,i){for(var s=t.length-1;s>=0;s-=1)if(mv(o=t[s])&&o.initiatorType===e&&(at(r)||o.startTime>=r)&&(at(n)||n>=o.startTime))return t[s];var o}(t.performance.getEntriesByName(i));return o||(yield new Promise((t=>setTimeout(t,50*s))),kv(t,e,i,r,n,s+1))})),Sv.apply(this,arguments)}function xv(t){var e=t.body,i=t.options,r=t.url;if(dt(e))return null;var n=fv(r,i);if(n.isHostDenied)return n.hostname+" is in deny list";if(lt(e))return e;if(dv(e))return e.textContent;if(pt(e))return ir(e);if(st(e))try{return JSON.stringify(e)}catch(t){return"[SessionReplay] Failed to stringify response object"}return"[SessionReplay] Cannot read body of type "+toString.call(e)}var Cv=t=>!ht(t)&&("navigation"===t.entryType||"resource"===t.entryType);function Tv(t){var e=t.entry,i=t.method,r=t.status,n=t.networkRequest,s=t.isInitial,o=t.start,a=t.end,l=t.url,u=t.initiatorType;o=e?e.startTime:o,a=e?e.responseEnd:a;var h=Math.floor(Date.now()-performance.now()),d=Math.floor(h+(o||0)),v=[p({},e?e.toJSON():{name:l},{startTime:at(o)?void 0:Math.round(o),endTime:at(a)?void 0:Math.round(a),timeOrigin:h,timestamp:d,method:i,initiatorType:u||(e?e.initiatorType:void 0),status:r,requestHeaders:n.requestHeaders,requestBody:n.requestBody,responseHeaders:n.responseHeaders,responseBody:n.responseBody,isInitial:s})];if(Cv(e))for(var c of e.serverTiming||[])v.push({timeOrigin:h,timestamp:d,startTime:Math.round(e.startTime),name:c.name,duration:c.duration,entryType:"serverTiming"});return v}var Ev=["video/","audio/"];function Mv(t){return st(t)&&nt(t.getReader)&&nt(t.tee)}var Iv=500,Rv="[SessionReplay] Timeout while trying to read body",Pv="[SessionReplay] Failed to read body";function Av(t){return Pv+": "+t}function Ov(t){return"[SessionReplay] Body too large to record (> "+t+" bytes)"}function Fv(t,e){if(!e.streamNetworkBody)return function(t){return new Promise((e=>{var i=setTimeout((()=>e(Rv)),Iv);try{t.clone().text().then((t=>e(t)),(t=>e(Av(t)))).finally((()=>clearTimeout(i)))}catch(t){clearTimeout(i),e(Pv)}}))}(t);var i=rn(e);return function(t,e){try{var i,r=null==(i=t.headers)||null==i.get?void 0:i.get("content-length");if(!r)return!1;var n=parseInt(r,10);return Number.isFinite(n)&&n>e}catch(t){return!1}}(t,i)?Promise.resolve(Ov(i)):function(t,e){return new Promise((i=>{var r,n=!1;function s(){try{var t;null==(t=r)||t.cancel()}catch(t){}}function o(t){n||(n=!0,clearTimeout(l),s(),i(t))}var a,l=setTimeout((()=>o(Rv)),Iv);try{a=t.clone()}catch(t){return void o(Pv)}var u=a.body;if(Mv(u)&&"undefined"!=typeof TextDecoder){try{r=u.getReader()}catch(t){return void o(Pv)}var h=[],d=0;!function t(){r.read().then((i=>{var r=i.done,a=i.value;if(n)s();else if(r)o((new TextDecoder).decode(function(t,e){var i=new Uint8Array(e),r=0;for(var n of t)i.set(n,r),r+=n.byteLength;return i}(h,d)));else{if(a){if(d+a.byteLength>e)return void o(Ov(e));d+=a.byteLength,h.push(a)}t()}}),(t=>o(Av(t))))}()}else try{a.text().then((t=>o(t)),(t=>o(Av(t))))}catch(t){o(Pv)}}))}(t,i)}function Lv(){return Lv=f((function*(t){var e=t.r,i=t.options,r=fv(t.url,i);return r.isHostDenied?Promise.resolve(r.hostname+" is in deny list"):Fv(e,i)})),Lv.apply(this,arguments)}function $v(){return $v=f((function*(t){var e=t.r,i=t.options,r=function(t){var e,i=t.r,r=t.options,n=t.url;if("chunked"===i.headers.get("Transfer-Encoding"))return"Chunked Transfer-Encoding is not supported";var s=null==(e=i.headers.get("Content-Type"))?void 0:e.toLowerCase(),o=Ev.some((t=>null==s?void 0:s.startsWith(t)));if(s&&o)return"Content-Type "+s+" is not supported";var a=fv(n,r);return a.isHostDenied?a.hostname+" is in deny list":null}({r:e,options:i,url:t.url});return ht(r)?Fv(e,i):Promise.resolve(r)})),$v.apply(this,arguments)}var Dv=null;function Nv(t,e,i){if(!("performance"in e))return()=>{};if(Dv)return pv.warn("Network observer already initialised, doing nothing"),()=>{};var r=i?Object.assign({},nn,i):nn,n=e=>{var i=[],n=!1;e.requests.forEach((t=>{var e="serverTiming"===t.entryType;if(!e||!n){var s=r.maskRequestFn(t);e||(n=!s||(t=>!!t&&vn.has(t))(s)),s&&i.push(s)}})),i.length>0&&t(p({},e,{requests:i}))},s=function(t,e,i){if(i.recordInitialRequests){var r=e.performance.getEntries().filter((t=>gv(t)||mv(t)&&i.initiatorTypes.includes(t.initiatorType)));t({requests:r.flatMap((t=>Tv({entry:t,method:void 0,status:void 0,networkRequest:{},isInitial:!0}))),isInitial:!0})}var n=new e.PerformanceObserver((e=>{var r=e.getEntries().filter((t=>gv(t)||mv(t)&&i.initiatorTypes.includes(t.initiatorType)&&(t=>!i.recordBody&&!i.recordHeaders||"xmlhttprequest"!==t.initiatorType&&"fetch"!==t.initiatorType)(t)));t({requests:r.flatMap((t=>Tv({entry:t,method:void 0,status:void 0,networkRequest:{}})))})})),s=PerformanceObserver.supportedEntryTypes.filter((t=>i.performanceEntryTypeToObserve.includes(t)));return n.observe({entryTypes:s}),()=>{n.disconnect()}}(n,e,r),o=()=>{},a=()=>{};return(r.recordHeaders||r.recordBody)&&(o=function(t,e,i){if(!i.initiatorTypes.includes("xmlhttprequest"))return()=>{};var r=yv("request",i.recordHeaders),n=yv("response",i.recordHeaders),s=cv(e.XMLHttpRequest.prototype,"open",(s=>function(o,a,l,u,h){void 0===l&&(l=!0);var d=this;try{var v,c,f=new Request(a),p={},g={},m=d.setRequestHeader.bind(d);d.setRequestHeader=(t,e)=>(g[t]=e,m(t,e)),r&&(p.requestHeaders=g);var y=d.send.bind(d);d.send=t=>(wv({type:"request",headers:g,url:a,recordBody:i.recordBody})&&(p.requestBody=xv({body:t,options:i,url:a})),v=e.performance.now(),y(t));var _=()=>{d.removeEventListener("readystatechange",b),d.removeEventListener("error",_),d.removeEventListener("abort",_),d.removeEventListener("timeout",_)},b=()=>{if(d.readyState===d.DONE){_(),c=e.performance.now();var r={};d.getAllResponseHeaders().trim().split(/[\r\n]+/).forEach((t=>{var e=t.split(": "),i=e.shift(),n=e.join(": ");i&&(r[i]=n)})),n&&(p.responseHeaders=r),wv({type:"response",headers:r,url:a,recordBody:i.recordBody})&&(p.responseBody=xv({body:d.response,options:i,url:a})),kv(e,"xmlhttprequest",f.url,v,c).then((e=>{var i=Tv({entry:e,method:o,status:null==d?void 0:d.status,networkRequest:p,start:v,end:c,url:a.toString(),initiatorType:"xmlhttprequest"});t({requests:i})})).catch((()=>{}))}};d.addEventListener("readystatechange",b),d.addEventListener("error",_),d.addEventListener("abort",_),d.addEventListener("timeout",_)}catch(t){pv.error("Failed to instrument XHR for network capture",t)}s.call(d,o,a.toString(),l,u,h)}));return()=>{s()}}(n,e,r),a=function(t,e,i){if(!i.initiatorTypes.includes("fetch"))return()=>{};var r=yv("request",i.recordHeaders),n=yv("response",i.recordHeaders),s=cv(e,"fetch",(s=>function(){var o=f((function*(o,a){var l,u;try{l=new Request(o,a)}catch(t){return pv.error("Failed to instrument fetch for network capture",t),s(o,a)}var h,d,v={};try{try{var c={};l.headers.forEach(((t,e)=>{c[e]=t})),r&&(v.requestHeaders=c),!Mv(null==a?void 0:a.body)&&wv({type:"request",headers:c,url:o,recordBody:i.recordBody})&&(v.requestBody=yield function(t){return Lv.apply(this,arguments)}({r:l,options:i,url:o}))}catch(t){pv.error("Failed to record fetch request for network capture",t)}h=e.performance.now(),u=_v(o)?yield s(l):yield s(o,a),d=e.performance.now();var f={};return u.headers.forEach(((t,e)=>{f[e]=t})),n&&(v.responseHeaders=f),wv({type:"response",headers:f,url:o,recordBody:i.recordBody})&&(v.responseBody=yield function(t){return $v.apply(this,arguments)}({r:u,options:i,url:o})),u}finally{kv(e,"fetch",l.url,h,d).then((e=>{var i,r=Tv({entry:e,method:l.method,status:null==(i=u)?void 0:i.status,networkRequest:v,start:h,end:d,url:l.url,initiatorType:"fetch"});t({requests:r})})).catch((()=>{}))}}));return function(t,e){return o.apply(this,arguments)}}()));return()=>{s()}}(n,e,r)),Dv=()=>{s(),o(),a(),Dv=null}}var qv=t=>({name:"rrweb/network@1",observer:Nv,options:t});v.__PosthogExtensions__=v.__PosthogExtensions__||{},v.__PosthogExtensions__.rrwebPlugins={getRecordConsolePlugin:hv,getRecordNetworkPlugin:qv},v.__PosthogExtensions__.rrweb={record:Qd,version:"v2",wasMaxDepthReached:()=>Sh,resetMaxDepthState(){Sh=!1,kh=!1},getLastSnapshotCost:()=>ou,getMutationCost:()=>p({},du),resetSnapshotCostState(){iu=0,ru=0,nu=0,Kl=0,su=Ql(),ou=null,au=null,lu=[],uu=0,hu=0,du={slowestBatchMs:0},vu={deferredCount:0,failedCount:0,abandonedCount:0,totalMs:0,slowestSliceMs:0}}},v.rrweb={record:Qd,version:"v2"},v.rrwebConsoleRecord={getRecordConsolePlugin:hv},v.getRecordNetworkPlugin=qv,v.__PosthogExtensions__=v.__PosthogExtensions__||{},v.__PosthogExtensions__.initSessionRecording=(t,e)=>new Cl(t,e);var jv,Bv,Uv,Hv,zv,Wv,Vv,Gv,Zv,Qv,Jv,Kv,Yv,Xv,tc,ec={},ic=[],rc=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,nc=Array.isArray;function sc(t,e){for(var i in e)t[i]=e[i];return t}function oc(t){t&&t.parentNode&&t.parentNode.removeChild(t)}function ac(t,e,i){var r,n,s,o={};for(s in e)"key"==s?r=e[s]:"ref"==s?n=e[s]:o[s]=e[s];if(arguments.length>2&&(o.children=arguments.length>3?jv.call(arguments,2):i),"function"==typeof t&&null!=t.defaultProps)for(s in t.defaultProps)void 0===o[s]&&(o[s]=t.defaultProps[s]);return lc(t,o,r,n,null)}function lc(t,e,i,r,n){var s={type:t,props:e,key:i,ref:r,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:null==n?++Uv:n,__i:-1,__u:0};return null==n&&null!=Bv.vnode&&Bv.vnode(s),s}function uc(t){return t.children}function hc(t,e){this.props=t,this.context=e}function dc(t,e){if(null==e)return t.__?dc(t.__,t.__i+1):null;for(var i;t.__k.length>e;e++)if(null!=(i=t.__k[e])&&null!=i.__e)return i.__e;return"function"==typeof t.type?dc(t):null}function vc(t){if(t.__P&&t.__d){var e=t.__v,i=e.__e,r=[],n=[],s=sc({},e);s.__v=e.__v+1,Bv.vnode&&Bv.vnode(s),kc(t.__P,s,e,t.__n,t.__P.namespaceURI,32&e.__u?[i]:null,r,null==i?dc(e):i,!!(32&e.__u),n),s.__v=e.__v,s.__.__k[s.__i]=s,xc(r,s,n),e.__e=e.__=null,s.__e!=i&&cc(s)}}function cc(t){if(null!=(t=t.__)&&null!=t.__c)return t.__e=t.__c.base=null,t.__k.some((function(e){if(null!=e&&null!=e.__e)return t.__e=t.__c.base=e.__e})),cc(t)}function fc(t){(!t.__d&&(t.__d=!0)&&Hv.push(t)&&!pc.__r++||zv!=Bv.debounceRendering)&&((zv=Bv.debounceRendering)||Wv)(pc)}function pc(){try{for(var t,e=1;Hv.length;)Hv.length>e&&Hv.sort(Vv),t=Hv.shift(),e=Hv.length,vc(t)}finally{Hv.length=pc.__r=0}}function gc(t,e,i,r,n,s,o,a,l,u,h){var d,v,c,f,p,g,m,y=r&&r.__k||ic,_=e.length;for(l=function(t,e,i,r,n){var s,o,a,l,u,h=i.length,d=h,v=0;for(t.__k=new Array(n),s=0;n>s;s++)null!=(o=e[s])&&"boolean"!=typeof o&&"function"!=typeof o?("string"==typeof o||"number"==typeof o||"bigint"==typeof o||o.constructor==String?o=t.__k[s]=lc(null,o,null,null,null):nc(o)?o=t.__k[s]=lc(uc,{children:o},null,null,null):void 0===o.constructor&&o.__b>0?o=t.__k[s]=lc(o.type,o.props,o.key,o.ref?o.ref:null,o.__v):t.__k[s]=o,l=s+v,o.__=t,o.__b=t.__b+1,a=null,-1!=(u=o.__i=yc(o,i,l,d))&&(d--,(a=i[u])&&(a.__u|=2)),null==a||null==a.__v?(-1==u&&(n>h?v--:h>n&&v++),"function"!=typeof o.type&&(o.__u|=4)):u!=l&&(u==l-1?v--:u==l+1?v++:(u>l?v--:v++,o.__u|=4))):t.__k[s]=null;if(d)for(s=0;h>s;s++)null!=(a=i[s])&&0==(2&a.__u)&&(a.__e==r&&(r=dc(a)),Ec(a,a));return r}(i,e,y,l,_),d=0;_>d;d++)null!=(c=i.__k[d])&&(v=-1!=c.__i&&y[c.__i]||ec,c.__i=d,g=kc(t,c,v,n,s,o,a,l,u,h),f=c.__e,c.ref&&v.ref!=c.ref&&(v.ref&&Tc(v.ref,null,c),h.push(c.ref,c.__c||f,c)),null==p&&null!=f&&(p=f),(m=!!(4&c.__u))||v.__k===c.__k?(l=mc(c,l,t,m),m&&v.__e&&(v.__e=null)):"function"==typeof c.type&&void 0!==g?l=g:f&&(l=f.nextSibling),c.__u&=-7);return i.__e=p,l}function mc(t,e,i,r){var n,s;if("function"==typeof t.type){for(n=t.__k,s=0;n&&n.length>s;s++)n[s]&&(n[s].__=t,e=mc(n[s],e,i,r));return e}t.__e!=e&&(r&&(e&&t.type&&!e.parentNode&&(e=dc(t)),i.insertBefore(t.__e,e||null)),e=t.__e);do{e=e&&e.nextSibling}while(null!=e&&8==e.nodeType);return e}function yc(t,e,i,r){var n,s,o,a=t.key,l=t.type,u=e[i],h=null!=u&&0==(2&u.__u);if(null===u&&null==a||h&&a==u.key&&l==u.type)return i;if(r>(h?1:0))for(n=i-1,s=i+1;n>=0||e.length>s;)if(null!=(u=e[o=0>n?s++:n--])&&0==(2&u.__u)&&a==u.key&&l==u.type)return o;return-1}function _c(t,e,i){"-"==e[0]?t.setProperty(e,null==i?"":i):t[e]=null==i?"":"number"!=typeof i||rc.test(e)?i:i+"px"}function bc(t,e,i,r,n){var s,o;t:if("style"==e)if("string"==typeof i)t.style.cssText=i;else{if("string"==typeof r&&(t.style.cssText=r=""),r)for(e in r)i&&e in i||_c(t.style,e,"");if(i)for(e in i)r&&i[e]==r[e]||_c(t.style,e,i[e])}else if("o"==e[0]&&"n"==e[1])s=e!=(e=e.replace(Jv,"$1")),o=e.toLowerCase(),e=o in t||"onFocusOut"==e||"onFocusIn"==e?o.slice(2):e.slice(2),t.l||(t.l={}),t.l[e+s]=i,i?r?i[Qv]=r[Qv]:(i[Qv]=Kv,t.addEventListener(e,s?Xv:Yv,s)):t.removeEventListener(e,s?Xv:Yv,s);else{if("http://www.w3.org/2000/svg"==n)e=e.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if("width"!=e&&"height"!=e&&"href"!=e&&"list"!=e&&"form"!=e&&"tabIndex"!=e&&"download"!=e&&"rowSpan"!=e&&"colSpan"!=e&&"role"!=e&&"popover"!=e&&e in t)try{t[e]=null==i?"":i;break t}catch(t){}"function"==typeof i||(null==i||!1===i&&"-"!=e[4]?t.removeAttribute(e):t.setAttribute(e,"popover"==e&&1==i?"":i))}}function wc(t){return function(e){if(this.l){var i=this.l[e.type+t];if(null==e[Zv])e[Zv]=Kv++;else if(i[Qv]>e[Zv])return;return i(Bv.event?Bv.event(e):e)}}}function kc(t,e,i,r,n,s,o,a,l,u){var h,d,v,c,f,p,g,m,y,_,$,b,w,k,S,x,C=e.type;if(void 0!==e.constructor)return null;128&i.__u&&(l=!!(32&i.__u),s=[a=e.__e=i.__e]),(h=Bv.__b)&&h(e);t:if("function"==typeof C){d=o.length;try{if(y=e.props,_=C.prototype&&C.prototype.render,$=(h=C.contextType)&&r[h.__c],b=h?$?$.props.value:h.__:r,i.__c?m=(v=e.__c=i.__c).__=v.__E:(_?e.__c=v=new C(y,b):(e.__c=v=new hc(y,b),v.constructor=C,v.render=Mc),$&&$.sub(v),v.state||(v.state={}),v.__n=r,c=v.__d=!0,v.__h=[],v._sb=[]),_&&null==v.__s&&(v.__s=v.state),_&&null!=C.getDerivedStateFromProps&&(v.__s==v.state&&(v.__s=sc({},v.__s)),sc(v.__s,C.getDerivedStateFromProps(y,v.__s))),f=v.props,p=v.state,v.__v=e,c)_&&null==C.getDerivedStateFromProps&&null!=v.componentWillMount&&v.componentWillMount(),_&&null!=v.componentDidMount&&v.__h.push(v.componentDidMount);else{if(_&&null==C.getDerivedStateFromProps&&y!==f&&null!=v.componentWillReceiveProps&&v.componentWillReceiveProps(y,b),e.__v==i.__v||!v.__e&&null!=v.shouldComponentUpdate&&!1===v.shouldComponentUpdate(y,v.__s,b)){e.__v!=i.__v&&(v.props=y,v.state=v.__s,v.__d=!1),e.__e=i.__e,e.__k=i.__k,e.__k.some((function(t){t&&(t.__=e)})),ic.push.apply(v.__h,v._sb),v._sb=[],v.__h.length&&o.push(v);break t}null!=v.componentWillUpdate&&v.componentWillUpdate(y,v.__s,b),_&&null!=v.componentDidUpdate&&v.__h.push((function(){v.componentDidUpdate(f,p,g)}))}if(v.context=b,v.props=y,v.__P=t,v.__e=!1,w=Bv.__r,k=0,_)v.state=v.__s,v.__d=!1,w&&w(e),h=v.render(v.props,v.state,v.context),ic.push.apply(v.__h,v._sb),v._sb=[];else do{v.__d=!1,w&&w(e),h=v.render(v.props,v.state,v.context),v.state=v.__s}while(v.__d&&25>++k);v.state=v.__s,null!=v.getChildContext&&(r=sc(sc({},r),v.getChildContext())),_&&!c&&null!=v.getSnapshotBeforeUpdate&&(g=v.getSnapshotBeforeUpdate(f,p)),S=null!=h&&h.type===uc&&null==h.key?Cc(h.props.children):h,a=gc(t,nc(S)?S:[S],e,i,r,n,s,o,a,l,u),v.base=e.__e,e.__u&=-161,v.__h.length&&o.push(v),m&&(v.__E=v.__=null)}catch(t){if(o.length=d,e.__v=null,l||null!=s)if(t.then){for(e.__u|=l?160:128;a&&8==a.nodeType&&a.nextSibling;)a=a.nextSibling;null!=s&&(s[s.indexOf(a)]=null),e.__e=a}else{if(null!=s)for(x=s.length;x--;)oc(s[x]);Sc(e)}else e.__e=i.__e,!e.__k&&i.__k&&(e.__k=i.__k),t.then||Sc(e);Bv.__e(t,e,i)}}else null==s&&e.__v==i.__v?(e.__k=i.__k,e.__e=i.__e):a=e.__e=function(t,e,i,r,n,s,o,a,l){var u,h,d,v,c,f,p,g=i.props||ec,m=e.props,y=e.type;if("svg"==y?n="http://www.w3.org/2000/svg":"math"==y?n="http://www.w3.org/1998/Math/MathML":n||(n="http://www.w3.org/1999/xhtml"),null!=s)for(u=0;s.length>u;u++)if((c=s[u])&&"setAttribute"in c==!!y&&(y?c.localName==y:3==c.nodeType)){t=c,s[u]=null;break}if(null==t){if(null==y)return document.createTextNode(m);t=document.createElementNS(n,y,m.is&&m),a&&(Bv.__m&&Bv.__m(e,s),a=!1),s=null}if(null==y)g===m||a&&t.data==m||(t.data=m);else{if(s="textarea"==y&&null!=m.defaultValue?null:s&&jv.call(t.childNodes),!a&&null!=s)for(g={},u=0;t.attributes.length>u;u++)g[(c=t.attributes[u]).name]=c.value;for(u in g)c=g[u],"dangerouslySetInnerHTML"==u?d=c:"children"==u||u in m||"value"==u&&"defaultValue"in m||"checked"==u&&"defaultChecked"in m||bc(t,u,null,c,n);for(u in m)c=m[u],"children"==u?v=c:"dangerouslySetInnerHTML"==u?h=c:"value"==u?f=c:"checked"==u?p=c:a&&"function"!=typeof c||g[u]===c||bc(t,u,c,g[u],n);if(h)a||d&&(h.__html==d.__html||h.__html==t.innerHTML)||(t.innerHTML=h.__html),e.__k=[];else if(d&&(t.innerHTML=""),gc("template"==e.type?t.content:t,nc(v)?v:[v],e,i,r,"foreignObject"==y?"http://www.w3.org/1999/xhtml":n,s,o,s?s[0]:i.__k&&dc(i,0),a,l),null!=s)for(u=s.length;u--;)oc(s[u]);a&&"textarea"!=y||(u="value","progress"==y&&null==f?t.removeAttribute("value"):null!=f&&(f!==t[u]||"progress"==y&&!f||"option"==y&&f!=g[u])&&bc(t,u,f,g[u],n),u="checked",null!=p&&p!=t[u]&&bc(t,u,p,g[u],n))}return t}(i.__e,e,i,r,n,s,o,l,u);return(h=Bv.diffed)&&h(e),128&e.__u?void 0:a}function Sc(t){t&&(t.__c&&(t.__c.__e=!0),t.__k&&t.__k.some(Sc))}function xc(t,e,i){for(var r=0;i.length>r;r++)Tc(i[r],i[++r],i[++r]);Bv.__c&&Bv.__c(e,t),t.some((function(e){try{t=e.__h,e.__h=[],t.some((function(t){t.call(e)}))}catch(t){Bv.__e(t,e.__v)}}))}function Cc(t){return"object"!=typeof t||null==t||t.__b>0?t:nc(t)?t.map(Cc):void 0!==t.constructor?null:sc({},t)}function Tc(t,e,i){try{if("function"==typeof t){var r="function"==typeof t.__u;r&&t.__u(),r&&null==e||(t.__u=t(e))}else t.current=e}catch(t){Bv.__e(t,i)}}function Ec(t,e,i){var r,n;if(Bv.unmount&&Bv.unmount(t),(r=t.ref)&&(r.current&&r.current!=t.__e||Tc(r,null,e)),null!=(r=t.__c)){if(r.componentWillUnmount)try{r.componentWillUnmount()}catch(t){Bv.__e(t,e)}r.base=r.__P=r.__n=null}if(r=t.__k)for(n=0;r.length>n;n++)r[n]&&Ec(r[n],e,i||"function"!=typeof t.type);i||oc(t.__e),t.__c=t.__=t.__e=void 0}function Mc(t,e,i){return this.constructor(t,i)}function Ic(t,e,i){var r,n,s;e==document&&(e=document.documentElement),Bv.__&&Bv.__(t,e),r=e.__k,n=[],s=[],kc(e,t=e.__k=ac(uc,null,[t]),r||ec,ec,e.namespaceURI,r?null:e.firstChild?jv.call(e.childNodes):null,n,r?r.__e:e.firstChild,!1,s),xc(n,t,s),t.props.children=null}jv=ic.slice,Bv={__e(t,e,i,r){for(var n,s,o;e=e.__;)if((n=e.__c)&&!n.__)try{if((s=n.constructor)&&null!=s.getDerivedStateFromError&&(n.setState(s.getDerivedStateFromError(t)),o=n.__d),null!=n.componentDidCatch&&(n.componentDidCatch(t,r||{}),o=n.__d),o)return n.__E=n}catch(e){t=e}throw t}},Uv=0,hc.prototype.setState=function(t,e){var i;i=null!=this.__s&&this.__s!=this.state?this.__s:this.__s=sc({},this.state),"function"==typeof t&&(t=t(sc({},i),this.props)),t&&sc(i,t),null!=t&&this.__v&&(e&&this._sb.push(e),fc(this))},hc.prototype.forceUpdate=function(t){this.__v&&(this.__e=!0,t&&this.__h.push(t),fc(this))},hc.prototype.render=uc,Hv=[],Wv="function"==typeof Promise?Promise.prototype.then.bind(Promise.resolve()):setTimeout,Vv=function(t,e){return t.__v.__b-e.__v.__b},pc.__r=0,Gv=Math.random().toString(8),Zv="__d"+Gv,Qv="__a"+Gv,Jv=/(PointerCapture)$|Capture$/i,Kv=0,Yv=wc(!1),Xv=wc(!0),tc=0;var Rc,Pc,Ac,Oc,Fc=0,Lc=[],$c=Bv,Dc=$c.__b,Nc=$c.__r,qc=$c.diffed,jc=$c.__c,Bc=$c.unmount,Uc=$c.__;function Hc(t,e){$c.__h&&$c.__h(Pc,t,Fc||e),Fc=0;var i=Pc.__H||(Pc.__H={__:[],__h:[]});return t>=i.__.length&&i.__.push({}),i.__[t]}function zc(t){return Fc=1,function(t,e,i){var r=Hc(Rc++,2);if(r.t=t,!r.__c&&(r.__=[ef(void 0,e),function(t){var e=r.__N?r.__N[0]:r.__[0],i=r.t(e,t);e!==i&&(r.__N=[i,r.__[1]],r.__c.setState({}))}],r.__c=Pc,!Pc.__f)){var n=function(t,e,i){if(!r.__c.__H)return!0;var n=!1,o=r.__c.props!==t;if(r.__c.__H.__.some((function(t){if(t.__N){n=!0;var e=t.__[0];t.__=t.__N,t.__N=void 0,e!==t.__[0]&&(o=!0)}})),s){var a=s.call(this,t,e,i);return n?a||o:a}return!n||o};Pc.__f=!0;var s=Pc.shouldComponentUpdate,o=Pc.componentWillUpdate;Pc.componentWillUpdate=function(t,e,i){if(this.__e){var r=s;s=void 0,n(t,e,i),s=r}o&&o.call(this,t,e,i)},Pc.shouldComponentUpdate=n}return r.__N||r.__}(ef,t)}function Wc(t,e){var i=Hc(Rc++,3);!$c.__s&&tf(i.__H,e)&&(i.__=t,i.u=e,Pc.__H.__h.push(i))}function Vc(t){return Fc=5,Gc((function(){return{current:t}}),[])}function Gc(t,e){var i=Hc(Rc++,7);return tf(i.__H,e)&&(i.__=t(),i.__H=e,i.__h=t),i.__}function Zc(t){var e=Pc.context[t.__c],i=Hc(Rc++,9);return i.c=t,e?(null==i.__&&(i.__=!0,e.sub(Pc)),e.props.value):t.__}function Qc(){for(var t;t=Lc.shift();){var e=t.__H;if(t.__P&&e)try{e.__h.some(Yc),e.__h.some(Xc),e.__h=[]}catch(i){e.__h=[],$c.__e(i,t.__v)}}}$c.__b=function(t){Pc=null,Dc&&Dc(t)},$c.__=function(t,e){t&&e.__k&&e.__k.__m&&(t.__m=e.__k.__m),Uc&&Uc(t,e)},$c.__r=function(t){Nc&&Nc(t),Rc=0;var e=(Pc=t.__c).__H;e&&(Ac===Pc?(e.__h=[],Pc.__h=[],e.__.some((function(t){t.__N&&(t.__=t.__N),t.u=t.__N=void 0}))):(e.__h.length&&Qc(),Rc=0)),Ac=Pc},$c.diffed=function(t){qc&&qc(t);var e=t.__c;e&&e.__H&&(e.__H.__h.length&&(1!==Lc.push(e)&&Oc===$c.requestAnimationFrame||((Oc=$c.requestAnimationFrame)||Kc)(Qc)),e.__H.__.some((function(t){t.u&&(t.__H=t.u,t.u=void 0)}))),Ac=Pc=null},$c.__c=function(t,e){e.some((function(t){try{t.__h.some(Yc),t.__h=t.__h.filter((function(t){return!t.__||Xc(t)}))}catch(i){e.some((function(t){t.__h&&(t.__h=[])})),e=[],$c.__e(i,t.__v)}})),jc&&jc(t,e)},$c.unmount=function(t){Bc&&Bc(t);var e,i=t.__c;i&&i.__H&&(i.__H.__.some((function(t){try{Yc(t)}catch(t){e=t}})),i.__H=void 0,e&&$c.__e(e,i.__v))};var Jc="function"==typeof requestAnimationFrame;function Kc(t){var e,i=function(){clearTimeout(r),Jc&&cancelAnimationFrame(e),setTimeout(t)},r=setTimeout(i,35);Jc&&(e=requestAnimationFrame(i))}function Yc(t){var e=Pc,i=t.__c;"function"==typeof i&&(t.__c=void 0,i()),Pc=e}function Xc(t){var e=Pc;t.__c=t.__(),Pc=e}function tf(t,e){return!t||t.length!==e.length||e.some((function(e,i){return e!==t[i]}))}function ef(t,e){return"function"==typeof e?e(t):e}function rf(t){var e=!0;return{dispose(){if(e){e=!1;var i=t();i&&nt(i.then)&&i.then(void 0,(()=>{}))}}}}var nf={GZipJS:"gzip-js",Base64:"base64"},sf={Activation:"events",Cancellation:"cancelEvents"},of={Button:"button",Tab:"tab",Selector:"selector"},af={TopLeft:"top_left",TopRight:"top_right",TopCenter:"top_center",MiddleLeft:"middle_left",MiddleRight:"middle_right",MiddleCenter:"middle_center",Left:"left",Center:"center",Right:"right",NextToTrigger:"next_to_trigger"},lf={Top:"top",Left:"left",Right:"right",Bottom:"bottom"},uf={Popover:"popover",API:"api",Widget:"widget",ExternalSurvey:"external_survey"},hf={Open:"open",MultipleChoice:"multiple_choice",SingleChoice:"single_choice",Rating:"rating",Link:"link"},df={NextQuestion:"next_question",End:"end",ResponseBased:"response_based",SpecificQuestion:"specific_question"},vf={Once:"once",Recurring:"recurring",Always:"always"},cf={SHOWN:"survey shown",DISMISSED:"survey dismissed",SENT:"survey sent",ABANDONED:"survey abandoned"},ff={SURVEY_ID:"$survey_id",SURVEY_NAME:"$survey_name",SURVEY_RESPONSE:"$survey_response",SURVEY_ITERATION:"$survey_iteration",SURVEY_ITERATION_START_DATE:"$survey_iteration_start_date",SURVEY_PARTIALLY_COMPLETED:"$survey_partially_completed",SURVEY_SUBMISSION_ID:"$survey_submission_id",SURVEY_QUESTIONS:"$survey_questions",SURVEY_COMPLETED:"$survey_completed",PRODUCT_TOUR_ID:"$product_tour_id",SURVEY_LAST_SEEN_DATE:"$survey_last_seen_date",SURVEY_LANGUAGE:"$survey_language"},pf={Popover:"popover",Inline:"inline"},gf=Bi("[Surveys]");function mf(t){return!(!t.start_date||t.end_date)}function yf(t){var e;return!(null==(e=t.conditions)||null==(e=e.actions)||null==(e=e.values)||!e.length)}var _f="seenSurvey_",bf="inProgressSurvey_",wf=(t,e)=>""+t+function(t){return t.current_iteration&&t.current_iteration>0?t.id+"_"+t.current_iteration:t.id}(e),kf=t=>wf(_f,t),Sf=t=>{try{var e=kf(t);if(localStorage.getItem(e))return;localStorage.setItem(e,"true")}catch(t){gf.error("Failed to persist survey seen state",t)}},xf=[uf.Popover,uf.Widget,uf.API],Cf={ignoreConditions:!1,ignoreDelay:!1,displayType:pf.Popover};Math.trunc||(Math.trunc=function(t){return 0>t?Math.ceil(t):Math.floor(t)}),Number.isInteger||(Number.isInteger=function(t){return vt(t)&&isFinite(t)&&Math.floor(t)===t});class Tf{constructor(t){if(this.bytes=t,16!==t.length)throw new TypeError("not 128-bit length")}static fromFieldsV7(t,e,i,r){if(!Number.isInteger(t)||!Number.isInteger(e)||!Number.isInteger(i)||!Number.isInteger(r)||0>t||0>e||0>i||0>r||t>0xffffffffffff||e>4095||i>1073741823||r>4294967295)throw new RangeError("invalid field value");var n=new Uint8Array(16);return n[0]=t/Math.pow(2,40),n[1]=t/Math.pow(2,32),n[2]=t/Math.pow(2,24),n[3]=t/Math.pow(2,16),n[4]=t/256,n[5]=t,n[6]=112|e>>>8,n[7]=e,n[8]=128|i>>>24,n[9]=i>>>16,n[10]=i>>>8,n[11]=i,n[12]=r>>>24,n[13]=r>>>16,n[14]=r>>>8,n[15]=r,new Tf(n)}toString(){for(var t="",e=0;this.bytes.length>e;e++)t=t+(this.bytes[e]>>>4).toString(16)+(15&this.bytes[e]).toString(16),3!==e&&5!==e&&7!==e&&9!==e||(t+="-");if(36!==t.length)throw new Error("Invalid UUIDv7 was generated");return t}clone(){return new Tf(this.bytes.slice(0))}equals(t){return 0===this.compareTo(t)}compareTo(t){for(var e=0;16>e;e++){var i=this.bytes[e]-t.bytes[e];if(0!==i)return Math.sign(i)}return 0}}class Ef{generate(){var t=this.generateOrAbort();if(!at(t))return t;this.Rr=0;var e=this.generateOrAbort();if(at(e))throw new Error("Could not generate UUID after timestamp reset");return e}generateOrAbort(){var t=Date.now();if(t>this.Rr)this.Rr=t,this.Ar();else{if(this.Rr>=t+1e4)return;this.Lr++,this.Lr>4398046511103&&(this.Rr++,this.Ar())}return Tf.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 Rf}}var Mf,If=t=>{if("undefined"!=typeof UUIDV7_DENY_WEAK_RNG&&UUIDV7_DENY_WEAK_RNG)throw new Error("no cryptographically strong RNG available");for(var e=0;t.length>e;e++)t[e]=65536*Math.trunc(65536*Math.random())+Math.trunc(65536*Math.random());return t};t&&!at(t.crypto)&&crypto.getRandomValues&&(If=t=>crypto.getRandomValues(t));class Rf{nextUint32(){return this.ft.length>this.Fr||(If(this.ft),this.Fr=0),this.ft[this.Fr++]}constructor(){this.ft=new Uint32Array(8),this.Fr=1/0}}var Pf=()=>Af().toString(),Af=()=>(Mf||(Mf=new Ef)).generate(),Of="",Ff=/[a-z0-9][a-z0-9-]+\.[a-z]{2,}$/i;var Lf={Nr:()=>!!r,jr(t){ji.error("cookieStore error: "+t)},Pr:Aa,Br(t){var e;try{e=JSON.parse(Lf.Pr(t))||{}}catch(t){}return e},Dr(t,e,i,n,s){if(!r)return!1;try{var o="",a="",l=function(t,e){if(e){var i=function(t,e){if(void 0===e&&(e=r),Of)return Of;if(!e)return"";if(["localhost","127.0.0.1"].includes(t))return"";for(var i=t.split("."),n=Math.min(i.length,8),s="dmn_chk_"+Pf();!Of&&n--;){var o=i.slice(n).join("."),a=s+"=1;domain=."+o+";path=/";e.cookie=a+";max-age=3",e.cookie.includes(s)&&(e.cookie=a+";max-age=0",Of=o)}return Of}(t);if(!i){var n=(t=>{var e=t.match(Ff);return e?e[0]:""})(t);n!==i&&ji.info("Warning: cookie subdomain discovery mismatch",n,i),i=n}return i?"; domain=."+i:""}return""}(r.location.hostname,n);if(i){var u=new Date;u.setTime(u.getTime()+864e5*i),o="; expires="+u.toUTCString()}s&&(a="; secure");var h=t+"="+encodeURIComponent(JSON.stringify(e))+o+"; SameSite=Lax; path=/"+l+a;return h.length>3686.4&&ji.warn("cookieStore warning: large cookie, len="+h.length),r.cookie=h,!0}catch(t){return!1}},qr(t,e){if(null!=r&&r.cookie)try{Lf.Dr(t,"",-1,e)}catch(t){return}}},$f=null,Df={Nr(){if(!ht($f))return $f;var e=!0;if(at(t))e=!1;else try{var i="__mplssupport__";Df.Dr(i,"xyz"),'"xyz"'!==Df.Pr(i)&&(e=!1),Df.qr(i)}catch(t){e=!1}return e||ji.error("localStorage unsupported; falling back to cookie store"),$f=e,e},jr(t){ji.error("localStorage error: "+t)},Pr(e){try{return null==t?void 0:t.localStorage.getItem(e)}catch(t){Df.jr(t)}return null},Br(t){try{return JSON.parse(Df.Pr(t))||{}}catch(t){}return null},Dr(e,i){try{return null==t||t.localStorage.setItem(e,JSON.stringify(i)),!0}catch(t){Df.jr(t)}return!1},qr(e){try{null==t||t.localStorage.removeItem(e)}catch(t){Df.jr(t)}}},Nf=[Xn,Wn,zn,Gn,Zn,Qn,ds,hs,ls],qf=[pn,fn,Fn,Ln,ys,ms,vs],jf=t=>t+"_cpm",Bf=["__proto__","constructor","prototype"],Uf=t=>{if(!st(t))return{};var e={};return Object.keys(t).forEach((i=>{-1===Bf.indexOf(i)&&(e[i]=t[i])})),e},Hf=function(t,e){void 0===e&&(e=[]);var i={};return[...qf,...e].forEach((e=>{var r=t[e];at(r)||ht(r)||""===r||(i[e]=r)})),i},zf=t=>{for(var e=5381,i=2166136261,r=0;t.length>r;r++){var n=t.charCodeAt(r);e=33*e^n,i=Math.imul(i^n,16777619)}return t.length.toString(36)+"."+(e>>>0).toString(36)+"."+(i>>>0).toString(36)},Wf=(t,e)=>({p:e,f:zf(JSON.stringify(t))}),Vf=(t,e)=>{if(!e)return{properties:[],isValid:!1};try{var i=Lf.Br(jf(t)),r=(null==i?void 0:i.f)===zf(e)&&rt(i.p);return{properties:r?i.p:[],isValid:r}}catch(t){return{properties:[],isValid:!1}}},Gf=(t,e)=>e+"|"+(Lf.Pr(jf(t))||""),Zf={},Qf={Nr:()=>!0,jr(t){ji.error("memoryStorage error: "+t)},Pr:t=>Zf[t]||null,Br:t=>Zf[t]||null,Dr:(t,e)=>(Zf[t]=e,!0),qr(t){delete Zf[t]}},Jf=null,Kf={Nr(){if(!ht(Jf))return Jf;if(Jf=!0,at(t))Jf=!1;else try{var e="__support__";Kf.Dr(e,"xyz"),'"xyz"'!==Kf.Pr(e)&&(Jf=!1),Kf.qr(e)}catch(t){Jf=!1}return Jf},jr(t){ji.error("sessionStorage error: ",t)},Pr(e){try{return null==t?void 0:t.sessionStorage.getItem(e)}catch(t){Kf.jr(t)}return null},Br(t){try{return JSON.parse(Kf.Pr(t))||null}catch(t){}return null},Dr(e,i){try{return null==t||t.sessionStorage.setItem(e,JSON.stringify(i)),!0}catch(t){Kf.jr(t)}return!1},qr(e){try{null==t||t.sessionStorage.removeItem(e)}catch(t){Kf.jr(t)}}},Yf=Bi("[Stylesheet Loader]"),Xf=t,tp=r,ep="#020617",ip={fontFamily:"inherit",backgroundColor:"#eeeded",submitButtonColor:"black",submitButtonTextColor:"white",ratingButtonColor:"white",ratingButtonActiveColor:"black",borderColor:"#c9c6c6",placeholder:"Start typing...",whiteLabel:!1,displayThankYouMessage:!0,thankYouMessageHeader:"Thank you for your feedback!",position:af.Right,widgetType:of.Tab,widgetLabel:"Feedback",widgetColor:"black",zIndex:String(2147483645),disabledButtonOpacity:"0.6",maxWidth:"300px",textSubtleColor:"#939393",boxPadding:"20px 24px",boxShadow:"0 4px 12px rgba(0, 0, 0, 0.15)",borderRadius:"10px",shuffleQuestions:!1,surveyPopupDelaySeconds:void 0,outlineColor:"rgba(59, 130, 246, 0.8)",inputBackground:"white",inputTextColor:ep,scrollbarThumbColor:"var(--ph-survey-border-color)",scrollbarTrackColor:"var(--ph-survey-background-color)"},rp=[af.Center,af.Left,af.Right];function np(t){if(t.startsWith("#")){var e=t.replace(/^#/,"");return/^[0-9A-Fa-f]{3}$/.test(e)&&(e=e[0]+e[0]+e[1]+e[1]+e[2]+e[2]),/^[0-9A-Fa-f]{6}$/.test(e)?"rgb("+parseInt(e.slice(0,2),16)+","+parseInt(e.slice(2,4),16)+","+parseInt(e.slice(4,6),16)+")":"rgb(255, 255, 255)"}return"rgb(255, 255, 255)"}function sp(t){var e;void 0===t&&(t=ip.backgroundColor),"#"===t[0]&&(e=np(t)),t.startsWith("rgb")&&(e=t);var i={aliceblue:"#f0f8ff",antiquewhite:"#faebd7",aqua:"#00ffff",aquamarine:"#7fffd4",azure:"#f0ffff",beige:"#f5f5dc",bisque:"#ffe4c4",black:"#000000",blanchedalmond:"#ffebcd",blue:"#0000ff",blueviolet:"#8a2be2",brown:"#a52a2a",burlywood:"#deb887",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",cornflowerblue:"#6495ed",cornsilk:"#fff8dc",crimson:"#dc143c",cyan:"#00ffff",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkgray:"#a9a9a9",darkgreen:"#006400",darkkhaki:"#bdb76b",darkmagenta:"#8b008b",darkolivegreen:"#556b2f",darkorange:"#ff8c00",darkorchid:"#9932cc",darkred:"#8b0000",darksalmon:"#e9967a",darkseagreen:"#8fbc8f",darkslateblue:"#483d8b",darkslategray:"#2f4f4f",darkturquoise:"#00ced1",darkviolet:"#9400d3",deeppink:"#ff1493",deepskyblue:"#00bfff",dimgray:"#696969",dodgerblue:"#1e90ff",firebrick:"#b22222",floralwhite:"#fffaf0",forestgreen:"#228b22",fuchsia:"#ff00ff",gainsboro:"#dcdcdc",ghostwhite:"#f8f8ff",gold:"#ffd700",goldenrod:"#daa520",gray:"#808080",green:"#008000",greenyellow:"#adff2f",honeydew:"#f0fff0",hotpink:"#ff69b4","indianred ":"#cd5c5c",indigo:"#4b0082",ivory:"#fffff0",khaki:"#f0e68c",lavender:"#e6e6fa",lavenderblush:"#fff0f5",lawngreen:"#7cfc00",lemonchiffon:"#fffacd",lightblue:"#add8e6",lightcoral:"#f08080",lightcyan:"#e0ffff",lightgoldenrodyellow:"#fafad2",lightgrey:"#d3d3d3",lightgreen:"#90ee90",lightpink:"#ffb6c1",lightsalmon:"#ffa07a",lightseagreen:"#20b2aa",lightskyblue:"#87cefa",lightslategray:"#778899",lightsteelblue:"#b0c4de",lightyellow:"#ffffe0",lime:"#00ff00",limegreen:"#32cd32",linen:"#faf0e6",magenta:"#ff00ff",maroon:"#800000",mediumaquamarine:"#66cdaa",mediumblue:"#0000cd",mediumorchid:"#ba55d3",mediumpurple:"#9370d8",mediumseagreen:"#3cb371",mediumslateblue:"#7b68ee",mediumspringgreen:"#00fa9a",mediumturquoise:"#48d1cc",mediumvioletred:"#c71585",midnightblue:"#191970",mintcream:"#f5fffa",mistyrose:"#ffe4e1",moccasin:"#ffe4b5",navajowhite:"#ffdead",navy:"#000080",oldlace:"#fdf5e6",olive:"#808000",olivedrab:"#6b8e23",orange:"#ffa500",orangered:"#ff4500",orchid:"#da70d6",palegoldenrod:"#eee8aa",palegreen:"#98fb98",paleturquoise:"#afeeee",palevioletred:"#d87093",papayawhip:"#ffefd5",peachpuff:"#ffdab9",peru:"#cd853f",pink:"#ffc0cb",plum:"#dda0dd",powderblue:"#b0e0e6",purple:"#800080",red:"#ff0000",rosybrown:"#bc8f8f",royalblue:"#4169e1",saddlebrown:"#8b4513",salmon:"#fa8072",sandybrown:"#f4a460",seagreen:"#2e8b57",seashell:"#fff5ee",sienna:"#a0522d",silver:"#c0c0c0",skyblue:"#87ceeb",slateblue:"#6a5acd",slategray:"#708090",snow:"#fffafa",springgreen:"#00ff7f",steelblue:"#4682b4",tan:"#d2b48c",teal:"#008080",thistle:"#d8bfd8",tomato:"#ff6347",turquoise:"#40e0d0",violet:"#ee82ee",wheat:"#f5deb3",white:"#ffffff",whitesmoke:"#f5f5f5",yellow:"#ffff00",yellowgreen:"#9acd32"}[t.toLowerCase()];if(i&&(e=np(i)),!e)return ep;var r=e.match(/^rgba?\((\d+),\s*(\d+),\s*(\d+)(?:,\s*(\d+(?:\.\d+)?))?\)$/);if(r){var n=parseInt(r[1]),s=parseInt(r[2]),o=parseInt(r[3]);return Math.sqrt(n*n*.299+s*s*.587+o*o*.114)>127.5?ep:"white"}return ep}var op=(t,e,i)=>{var r=xp(t),n=tp.querySelector("."+r);if(n&&n.shadowRoot)return{shadow:n.shadowRoot,isNewlyCreated:!1};var s=tp.createElement("div");((t,e,i)=>{var r=p({},ip,i),n=t.style,s=!rp.includes(r.position)||e===uf.Widget&&(null==i?void 0:i.widgetType)===of.Tab;n.setProperty("--ph-survey-font-family",function(t){if("inherit"===t)return"inherit";var e='BlinkMacSystemFont, "Inter", "Segoe UI", "Roboto", Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol"';return t?t+", "+e:"-apple-system, "+e}(r.fontFamily)),n.setProperty("--ph-survey-box-padding",r.boxPadding),n.setProperty("--ph-survey-max-width",r.maxWidth),n.setProperty("--ph-survey-z-index",r.zIndex),n.setProperty("--ph-survey-border-color",r.borderColor),s?(n.setProperty("--ph-survey-border-radius",r.borderRadius),n.setProperty("--ph-survey-border-bottom","1.5px solid var(--ph-survey-border-color)")):(n.setProperty("--ph-survey-border-bottom","none"),n.setProperty("--ph-survey-border-radius",r.borderRadius+" "+r.borderRadius+" 0 0")),n.setProperty("--ph-survey-background-color",r.backgroundColor),n.setProperty("--ph-survey-box-shadow",r.boxShadow),n.setProperty("--ph-survey-disabled-button-opacity",r.disabledButtonOpacity),n.setProperty("--ph-survey-submit-button-color",r.submitButtonColor),n.setProperty("--ph-survey-submit-button-text-color",(null==i?void 0:i.submitButtonTextColor)||sp(r.submitButtonColor)),n.setProperty("--ph-survey-rating-bg-color",r.ratingButtonColor),n.setProperty("--ph-survey-rating-active-bg-color",r.ratingButtonActiveColor),n.setProperty("--ph-survey-rating-active-text-color",sp(r.ratingButtonActiveColor)),n.setProperty("--ph-survey-text-primary-color",(null==i?void 0:i.textColor)||sp(r.backgroundColor)),n.setProperty("--ph-survey-text-subtle-color",r.textSubtleColor),n.setProperty("--ph-widget-color",r.widgetColor),n.setProperty("--ph-widget-text-color",sp(r.widgetColor)),n.setProperty("--ph-widget-z-index",r.zIndex);var o=(null==i?void 0:i.inputBackground)||(null==i?void 0:i.inputBackgroundColor),a=o||r.inputBackground;o||"white"!==r.backgroundColor||(a="#f8f8f8"),n.setProperty("--ph-survey-input-background",a);var l=(null==i?void 0:i.inputTextColor)||sp(a);n.setProperty("--ph-survey-input-text-color",l),n.setProperty("--ph-survey-rating-text-color",l),n.setProperty("--ph-survey-scrollbar-thumb-color",r.scrollbarThumbColor),n.setProperty("--ph-survey-scrollbar-track-color",r.scrollbarTrackColor),n.setProperty("--ph-survey-outline-color",r.outlineColor)})(s,t.type,t.appearance),s.className=r;var o=s.attachShadow({mode:"open"}),a=function(t){var e=((t,e,i)=>{var r=t.createElement("style");r.innerText=e;var n=(t=>{var e;return nt(t)?t:null==t||null==(e=t.config)?void 0:e.prepare_external_dependency_stylesheet})(i);return n&&(r=n(r)),r||(Yf.error("prepare_external_dependency_stylesheet returned null"),null)})(tp,':host{--ph-survey-font-family:-apple-system,BlinkMacSystemFont,"Inter","Segoe UI","Roboto",Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol";--ph-survey-box-padding:20px 24px;--ph-survey-max-width:300px;--ph-survey-z-index:2147483645;--ph-survey-border-color:#dcdcdc;--ph-survey-border-bottom:1.5px solid var(--ph-survey-border-color);--ph-survey-border-radius:10px;--ph-survey-background-color:#eeeded;--ph-survey-box-shadow:0 4px 12px rgba(0,0,0,.15);--ph-survey-submit-button-color:#000;--ph-survey-submit-button-text-color:#fff;--ph-survey-rating-bg-color:#fff;--ph-survey-rating-text-color:#020617;--ph-survey-rating-active-bg-color:#000;--ph-survey-rating-active-text-color:#fff;--ph-survey-text-primary-color:#020617;--ph-survey-text-subtle-color:#939393;--ph-widget-color:#e0a045;--ph-widget-text-color:#fff;--ph-survey-scrollbar-thumb-color:var(--ph-survey-border-color);--ph-survey-scrollbar-track-color:var(--ph-survey-background-color);--ph-survey-outline-color:rgba(59,130,246,.8);--ph-survey-input-background:#fff;--ph-survey-input-text-color:#020617;--ph-survey-disabled-button-opacity:0.6}.ph-survey{bottom:0;height:fit-content;margin:0;max-width:85%;min-width:300px;position:fixed;width:var(--ph-survey-max-width);z-index:var(--ph-survey-z-index)}.ph-survey h3,.ph-survey p{margin:0}.ph-survey *{box-sizing:border-box;color:var(--ph-survey-text-primary-color);font-family:var(--ph-survey-font-family)}.ph-survey .multiple-choice-options label,.ph-survey input[type=text],.ph-survey textarea{background:var(--ph-survey-input-background);border:1.5px solid var(--ph-survey-border-color);border-radius:4px;color:var(--ph-survey-input-text-color);padding:10px;transition:border-color .2s ease-out,box-shadow .2s ease-out,transform .15s ease-out}.ph-survey input[type=text],.ph-survey textarea{transition:border-color .2s ease-out,box-shadow .2s ease-out,transform .15s ease-out}.ph-survey input{margin:0}.ph-survey .form-submit:focus,.ph-survey .form-submit:focus-visible,.ph-survey input[type=checkbox]:focus,.ph-survey input[type=checkbox]:focus-visible,.ph-survey input[type=radio]:focus,.ph-survey input[type=radio]:focus-visible,.ph-survey input[type=text]:focus,.ph-survey input[type=text]:focus-visible,.ph-survey textarea:focus,.ph-survey textarea:focus-visible{border-color:var(--ph-survey-rating-active-bg-color);outline:1.5px solid var(--ph-survey-outline-color);outline-offset:2px}.ph-survey button:focus:not(:focus-visible),.ph-survey input[type=checkbox]:focus:not(:focus-visible),.ph-survey input[type=radio]:focus:not(:focus-visible),.ph-survey input[type=text]:focus:not(:focus-visible),.ph-survey textarea:focus:not(:focus-visible){outline:none}.ph-survey input[type=text]:hover:not(:focus),.ph-survey textarea:hover:not(:focus){border-color:var(--ph-survey-rating-active-bg-color)}@media (max-width:768px){.ph-survey input[type=text],.ph-survey textarea{font-size:1rem}}.ph-survey .form-cancel,.ph-survey .multiple-choice-options label,.ph-survey .rating-options-number,.ph-survey input[type=checkbox],.ph-survey input[type=radio]{border:1.5px solid var(--ph-survey-border-color)}.ph-survey .footer-branding,.ph-survey .form-cancel,.ph-survey .form-submit,.ph-survey .ratings-emoji,.ph-survey .ratings-number,.ph-survey input[type=checkbox],.ph-survey input[type=radio],.ph-survey label{transition:all .2s ease-out}@media (prefers-reduced-motion:no-preference){.ph-survey button:active,.ph-survey input[type=checkbox]:active,.ph-survey input[type=radio]:active,.ph-survey label:active{transition-duration:.1s}}.ph-survey-widget-tab{background:var(--ph-widget-color);border:none;border-radius:3px 3px 0 0;color:var(--ph-widget-text-color);cursor:pointer;padding:10px 12px;position:fixed;text-align:center;transition:padding .2s ease-out;z-index:var(--ph-survey-z-index)}.ph-survey-widget-tab:hover:not(.widget-tab-top){padding-bottom:16px}.ph-survey-widget-tab.widget-tab-top{border-radius:0 0 3px 3px}.ph-survey-widget-tab.widget-tab-top:hover{padding-top:16px}@keyframes ph-survey-fade-in{0%{opacity:0}to{opacity:1}}.survey-box{gap:16px}.bottom-section,.survey-box{display:flex;flex-direction:column}.bottom-section{gap:8px}.intro-screen-header~.bottom-section,.thank-you-message-header~.bottom-section{padding-top:16px}.intro-screen,.question-container,.thank-you-message{display:flex;flex-direction:column;gap:8px}.survey-question{font-size:14px;font-weight:500}.survey-question-description{font-size:13px;opacity:.8;padding-top:4px}.intro-screen-body,.survey-question-description,.thank-you-message-body{word-wrap:break-word;overflow-wrap:break-word}:is(.survey-question-description,.thank-you-message-body,.intro-screen-body) embed,:is(.survey-question-description,.thank-you-message-body,.intro-screen-body) iframe,:is(.survey-question-description,.thank-you-message-body,.intro-screen-body) img,:is(.survey-question-description,.thank-you-message-body,.intro-screen-body) object,:is(.survey-question-description,.thank-you-message-body,.intro-screen-body) video{height:auto;max-width:100%}:is(.survey-question-description,.thank-you-message-body,.intro-screen-body) svg{height:auto;max-width:100%}.question-textarea-wrapper{display:flex;flex-direction:column}.survey-form{animation:ph-survey-fade-in .3s ease-out forwards}.intro-screen,.survey-form,.thank-you-message{background:var(--ph-survey-background-color);border:1.5px solid var(--ph-survey-border-color);border-bottom:var(--ph-survey-border-bottom);border-radius:var(--ph-survey-border-radius);box-shadow:var(--ph-survey-box-shadow);margin:0;padding:var(--ph-survey-box-padding);position:relative;text-align:left;width:100%;z-index:var(--ph-survey-z-index)}.survey-form input[type=text],.survey-form textarea{min-width:100%}:is(.survey-form textarea):focus,:is(.survey-form textarea):focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.08)}:is(.survey-form textarea):focus:not(:focus-visible){box-shadow:none}:is(.survey-box .question-header--empty)~.multiple-choice-options,:is(.survey-box .question-header--empty)~textarea{margin-top:0}.multiple-choice-options{border:none;display:flex;flex-direction:column;font-size:14px;gap:8px;margin:0;padding:1px 0}.multiple-choice-options .response-choice,.multiple-choice-options label{align-items:center;color:inherit;display:flex;gap:8px}.multiple-choice-options label{cursor:pointer;font-size:13px}:is(.multiple-choice-options label):hover:not(:has(input:checked)){border-color:var(--ph-survey-text-subtle-color);box-shadow:0 2px 8px rgba(0,0,0,.08)}:is(.multiple-choice-options label):has(input:checked){border-color:var(--ph-survey-rating-active-bg-color);box-shadow:0 1px 4px rgba(0,0,0,.05)}.choice-option-open:is(.multiple-choice-options label){flex-wrap:wrap}:is(.multiple-choice-options label) span{color:inherit}.multiple-choice-options input[type=checkbox],.multiple-choice-options input[type=radio]{appearance:none;-webkit-appearance:none;-moz-appearance:none;background:var(--ph-survey-input-background);border-radius:3px;cursor:pointer;flex-shrink:0;height:1rem;position:relative;transition:all .2s cubic-bezier(.4,0,.2,1),transform .15s ease-out;width:1rem;z-index:1}:is(.multiple-choice-options input[type=checkbox],.multiple-choice-options input[type=radio]):focus{transform:scale(1.05)}:is(.multiple-choice-options input[type=checkbox],.multiple-choice-options input[type=radio]):hover{border-color:var(--ph-survey-rating-active-bg-color);transform:scale(1.05)}:is(.multiple-choice-options input[type=checkbox],.multiple-choice-options input[type=radio]):active{transform:scale(.95)}:is(.multiple-choice-options input[type=checkbox],.multiple-choice-options input[type=radio]):checked{background:var(--ph-survey-rating-active-bg-color);border-color:var(--ph-survey-rating-active-bg-color);transform:scale(1)}:is(.multiple-choice-options input[type=checkbox],.multiple-choice-options input[type=radio]):checked:hover{transform:scale(1.05)}.multiple-choice-options input[type=checkbox]:checked:after{animation:ph-survey-checkmark-reveal .2s ease-out .1s forwards;border:solid var(--ph-survey-rating-active-text-color);border-width:0 2px 2px 0;height:8px;left:4px;transform:rotate(45deg) scale(0);width:4px}.multiple-choice-options input[type=radio]:checked:after{animation:ph-survey-radio-reveal .15s ease-out .05s forwards;background:var(--ph-survey-rating-active-text-color);border-radius:50%;height:6px;left:5px;top:5px;transform:scale(0);width:6px}.multiple-choice-options input[type=checkbox]:checked:after,.multiple-choice-options input[type=radio]:checked:after{box-sizing:content-box;content:"";position:absolute}.multiple-choice-options input[type=radio]{border-radius:50%}.multiple-choice-options input[type=radio]:checked{border:none}:is(.multiple-choice-options input[type=checkbox]:checked,.multiple-choice-options input[type=radio]:checked)~*{font-weight:700}:is(:is(.multiple-choice-options .choice-option-open) input[type=text])::placeholder{color:var(--ph-survey-text-subtle-color);font-weight:400}.rating-options-emoji{display:flex;justify-content:space-between}.rating-options-emoji-2{justify-content:space-around}.ratings-emoji{background-color:transparent;border:none;font-size:16px;opacity:.5;padding:0}.ratings-emoji:hover{cursor:pointer;opacity:1;transform:scale(1.15)}.ratings-emoji.rating-active{opacity:1}.ratings-emoji svg{fill:var(--ph-survey-text-primary-color);transition:fill .2s ease-out}.rating-options-number{border-radius:6px;display:grid;grid-auto-columns:1fr;grid-auto-flow:column;overflow:hidden}.rating-options-number .ratings-number{border:none;border-right:1px solid var(--ph-survey-border-color);color:var(--ph-survey-rating-text-color);cursor:pointer;font-weight:700;text-align:center}:is(.rating-options-number .ratings-number):last-of-type{border-right:0}.rating-active:is(.rating-options-number .ratings-number){background:var(--ph-survey-rating-active-bg-color);color:var(--ph-survey-rating-active-text-color)}.ratings-number{background-color:var(--ph-survey-rating-bg-color);border:none;padding:8px 0}.ratings-number .rating-active{background-color:var(--ph-survey-rating-active-bg-color)}.ratings-number{cursor:pointer}@media (hover:hover) and (pointer:fine){.ratings-number:hover:not(.rating-active){background-color:color-mix(in srgb,var(--ph-survey-rating-active-bg-color) 14%,var(--ph-survey-rating-bg-color))}}.rating-text{font-size:11px;justify-content:space-between;opacity:.7}.form-buttons,.rating-text{display:flex;flex-direction:row}.form-buttons{gap:8px;width:100%}.form-buttons-with-back>.form-submit{flex:1 1 auto;min-width:0}.form-submit{background:var(--ph-survey-submit-button-color);border:none;border-radius:6px;box-shadow:0 2px 0 rgba(0,0,0,.045);color:var(--ph-survey-submit-button-text-color);cursor:pointer;font-weight:700;min-width:100%;padding:12px;text-align:center;user-select:none}.form-submit:not([disabled]):hover{box-shadow:0 4px 8px rgba(0,0,0,.1);transform:scale(1.02)}.form-submit:not([disabled]):active{box-shadow:0 1px 2px rgba(0,0,0,.05);transform:scale(.98)}.form-submit[disabled]{cursor:not-allowed;opacity:var(--ph-survey-disabled-button-opacity)}.form-back{background:transparent;border:1.5px solid var(--ph-survey-border-color);border-radius:6px;color:var(--ph-survey-text-primary-color);cursor:pointer;flex:0 0 auto;font-weight:600;padding:12px 16px;text-align:center;user-select:none}.form-back:hover{transform:scale(1.02)}.form-back:active{transform:scale(.98)}.validation-hint{font-size:12px;margin-top:4px;opacity:.7}.form-cancel{background:#fff;border-radius:100%;cursor:pointer;line-height:0;padding:12px;position:absolute;right:0;top:0;transform:translate(50%,-50%)}.form-cancel:hover{opacity:.7;transform:translate(50%,-50%) scale(1.1)}.footer-branding{align-items:center;display:flex;font-size:11px;font-weight:500;gap:4px;justify-content:center;opacity:.6;text-decoration:none}.footer-branding:hover{opacity:1}.footer-branding a{text-decoration:none}.thank-you-message{text-align:center}.thank-you-message-header{margin:10px 0 0}.thank-you-message-body{font-size:14px;opacity:.8}.intro-screen{animation:ph-survey-fade-in .3s ease-out forwards;text-align:center}.intro-screen-header{margin:10px 0 0}.intro-screen-body{font-size:14px;opacity:.8}.limit-height{max-height:256px;overflow-x:hidden;overflow-y:auto;scrollbar-color:var(--ph-survey-scrollbar-thumb-color) var(--ph-survey-scrollbar-track-color);scrollbar-width:thin}.limit-height::-webkit-scrollbar{width:8px}.limit-height::-webkit-scrollbar-track{background:var(--ph-survey-scrollbar-track-color);border-radius:4px}.limit-height::-webkit-scrollbar-thumb{background-color:var(--ph-survey-scrollbar-thumb-color);border:2px solid var(--ph-survey-scrollbar-track-color);border-radius:4px}:is(.limit-height::-webkit-scrollbar-thumb):hover{background-color:var(--ph-survey-text-subtle-color)}.sr-only{clip:rect(0,0,0,0);border:0;height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;white-space:nowrap;width:1px}@media (prefers-reduced-motion:reduce){.ph-survey *{animation-duration:.01ms!important;animation-iteration-count:1!important;scroll-behavior:auto!important;transition-duration:.01ms!important}}@keyframes ph-survey-checkmark-reveal{0%{opacity:0;transform:rotate(45deg) scale(0)}50%{opacity:1;transform:rotate(45deg) scale(1.2)}to{opacity:1;transform:rotate(45deg) scale(1)}}@keyframes ph-survey-radio-reveal{0%{opacity:0;transform:scale(0)}50%{opacity:1;transform:scale(1.3)}to{opacity:1;transform:scale(1)}}',t);return null==e||e.setAttribute("data-ph-survey-style","true"),e}(e);if(a){var l=o.querySelector("style");l&&o.removeChild(l),o.appendChild(a)}return tp.body.appendChild(s),{shadow:o,isNewlyCreated:!0}},ap=t=>{var e=t.responses,i=t.survey,r=t.surveySubmissionId,n=t.posthog,s=t.isSurveyCompleted,o=t.properties,a=t.surveyLanguage;n?(Sf(i),n.capture(cf.SENT,p({[ff.SURVEY_NAME]:i.name,[ff.SURVEY_ID]:i.id,[ff.SURVEY_ITERATION]:i.current_iteration,[ff.SURVEY_ITERATION_START_DATE]:i.current_iteration_start_date,[ff.SURVEY_SUBMISSION_ID]:r,[ff.SURVEY_COMPLETED]:s},a&&{[ff.SURVEY_LANGUAGE]:a},{sessionRecordingUrl:null==n.get_session_replay_url?void 0:n.get_session_replay_url()},da(e,i),o,{$set:{[va(i,"responded")]:!0}})),s&&(Xf.dispatchEvent(new CustomEvent("PHSurveySent",{detail:{surveyId:i.id}})),Sp(i),n.reloadFeatureFlags())):gf.error("[survey sent] event not captured, PostHog instance not found.")},lp=(t,e,i)=>{return p({[ff.SURVEY_NAME]:t.name,[ff.SURVEY_ID]:t.id,[ff.SURVEY_ITERATION]:t.current_iteration,[ff.SURVEY_ITERATION_START_DATE]:t.current_iteration_start_date,[ff.SURVEY_PARTIALLY_COMPLETED]:(r=null==e?void 0:e.responses,void 0===r&&(r={}),Object.values(r).some((t=>!dt(t))))},(null==e?void 0:e.surveyLanguage)&&{[ff.SURVEY_LANGUAGE]:e.surveyLanguage},{sessionRecordingUrl:null==i.get_session_replay_url?void 0:i.get_session_replay_url(),[ff.SURVEY_SUBMISSION_ID]:null==e?void 0:e.surveySubmissionId},da(null==e?void 0:e.responses,t));var r},up=(t,e,i,r)=>{if(e){if(!i){var n=wp(t);e.capture(cf.DISMISSED,p({},lp(t,n,e),r&&{[ff.SURVEY_LANGUAGE]:r},{$set:{[va(t,"dismissed")]:!0}})),Sp(t),Sf(t),Xf.dispatchEvent(new CustomEvent("PHSurveyClosed",{detail:{surveyId:t.id}}))}}else gf.error("[survey dismissed] event not captured, PostHog instance not found.")},hp=(t,e)=>{if(e){var i=(t=>wf("abandonedSurvey_",t))(t);try{if("true"===localStorage.getItem(i))return}catch(t){return}var r=wp(t);if(r){try{localStorage.setItem(i,"true")}catch(t){}e.capture(cf.ABANDONED,lp(t,r,e),{transport:"sendBeacon"})}}else gf.error("[survey abandoned] event not captured, PostHog instance not found.")},dp=t=>t.map((t=>({sort:Math.floor(10*Math.random()),value:t}))).sort(((t,e)=>t.sort-e.sort)).map((t=>t.value)),vp=(t,e)=>t.length===e.length&&t.every(((t,i)=>t===e[i]))?e.reverse():e,cp=t=>t.appearance&&t.appearance.shuffleQuestions&&!t.enable_partial_responses?vp(t.questions,dp(t.questions)):t.questions,fp=t=>_a(t)||kp(t),pp=function(t){function e(t){var i,r;return this.getChildContext||(i=new Set,(r={})[e.__c]=this,this.getChildContext=function(){return r},this.componentWillUnmount=function(){i=null},this.shouldComponentUpdate=function(t){this.props.value!=t.value&&i.forEach((function(t){t.__e=!0,fc(t)}))},this.sub=function(t){i.add(t);var e=t.componentWillUnmount;t.componentWillUnmount=function(){i&&i.delete(t),e&&e.call(t)}}),t.children}return e.__c="__cC"+tc++,e.__=t,e.Provider=e.__l=(e.Consumer=function(t,e){return t.children(e)}).contextType=e,e}({isPreviewMode:!1,previewPageIndex:0,onPopupSurveyDismissed(){},isPopup:!0,onPreviewSubmit(){},onPreviewBack(){},surveySubmissionId:"",properties:void 0,surveyLanguage:null}),gp=()=>Zc(pp),mp=t=>{var e=t.children,i=t.style;return function(t,e,i){var r,n,s,o,a=sc({},t.props);for(s in t.type&&t.type.defaultProps&&(o=t.type.defaultProps),e)"key"==s?r=e[s]:"ref"==s?n=e[s]:a[s]=void 0===e[s]&&null!=o?o[s]:e[s];return arguments.length>2&&(a.children=arguments.length>3?jv.call(arguments,2):i),lc(t.type,a,r||t.key,n||t.ref,null)}(t.component,t.renderAsHtml?{dangerouslySetInnerHTML:{__html:e},style:i}:{children:e,style:i})};function yp(t,e){var i,r;if(null==(i=t.conditions)||!i.url)return!0;var n=ur(e);if(!n)return!1;var s=[t.conditions.url],o=function(t){return null!=t?t:"icontains"}(null==(r=t.conditions)?void 0:r.urlMatchType);return ka[o](s,[n])}var _p=t=>wf(bf,t),bp=(t,e)=>{try{localStorage.setItem(_p(t),JSON.stringify(e))}catch(t){gf.error("Error setting in-progress survey state in localStorage",t)}},wp=t=>{try{var e=localStorage.getItem(_p(t));if(e)return JSON.parse(e)}catch(t){gf.error("Error getting in-progress survey state from localStorage",t)}return null},kp=t=>{var e=wp(t);return!dt(null==e?void 0:e.surveySubmissionId)},Sp=t=>{try{localStorage.removeItem(_p(t))}catch(t){gf.error("Error clearing in-progress survey state from localStorage",t)}};function xp(t,e){void 0===e&&(e=!1);var i="PostHogSurvey-"+t.id;return e?"."+i:i}function Cp(t,e,i){if(void 0===e&&(e=af.Right),t===uf.ExternalSurvey)return{};switch(e){case af.TopLeft:return{top:"0",left:"0",transform:"translate(30px, 30px)"};case af.TopRight:return{top:"0",right:"0",transform:"translate(-30px, 30px)"};case af.TopCenter:return{top:"0",left:"50%",transform:"translate(-50%, 30px)"};case af.MiddleLeft:return{top:"50%",left:"0",transform:"translate(30px, -50%)"};case af.MiddleRight:return{top:"50%",right:"0",transform:"translate(-30px, -50%)"};case af.MiddleCenter:return{top:"50%",left:"50%",transform:"translate(-50%, -50%)"};case af.Left:return{left:"30px"};case af.Center:return{left:"50%",transform:"translateX(-50%)"};default:return{right:t===uf.Widget&&i===of.Tab?"60px":"30px"}}}var Tp=0;function Ep(t,e,i,r,n,s){e||(e={});var o,a,l=e;if("ref"in l)for(a in l={},e)"ref"==a?o=e[a]:l[a]=e[a];var u={type:t,props:l,key:i,ref:o,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:--Tp,__i:-1,__u:0,__source:n,__self:s};if("function"==typeof t&&(o=t.defaultProps))for(a in o)void 0===l[a]&&(l[a]=o[a]);return Bv.vnode&&Bv.vnode(u),u}var Mp=Ep("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 -960 960 960",width:"48",children:Ep("path",{d:"M626-533q22.5 0 38.25-15.75T680-587q0-22.5-15.75-38.25T626-641q-22.5 0-38.25 15.75T572-587q0 22.5 15.75 38.25T626-533Zm-292 0q22.5 0 38.25-15.75T388-587q0-22.5-15.75-38.25T334-641q-22.5 0-38.25 15.75T280-587q0 22.5 15.75 38.25T334-533Zm146 272q66 0 121.5-35.5T682-393h-52q-23 40-63 61.5T480.5-310q-46.5 0-87-21T331-393h-53q26 61 81 96.5T480-261Zm0 181q-83 0-156-31.5T197-197q-54-54-85.5-127T80-480q0-83 31.5-156T197-763q54-54 127-85.5T480-880q83 0 156 31.5T763-763q54 54 85.5 127T880-480q0 83-31.5 156T763-197q-54 54-127 85.5T480-80Zm0-400Zm0 340q142.375 0 241.188-98.812Q820-337.625 820-480t-98.812-241.188Q622.375-820 480-820t-241.188 98.812Q140-622.375 140-480t98.812 241.188Q337.625-140 480-140Z"})}),Ip=Ep("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 -960 960 960",width:"48",children:Ep("path",{d:"M626-533q22.5 0 38.25-15.75T680-587q0-22.5-15.75-38.25T626-641q-22.5 0-38.25 15.75T572-587q0 22.5 15.75 38.25T626-533Zm-292 0q22.5 0 38.25-15.75T388-587q0-22.5-15.75-38.25T334-641q-22.5 0-38.25 15.75T280-587q0 22.5 15.75 38.25T334-533Zm20 194h253v-49H354v49ZM480-80q-83 0-156-31.5T197-197q-54-54-85.5-127T80-480q0-83 31.5-156T197-763q54-54 127-85.5T480-880q83 0 156 31.5T763-763q54 54 85.5 127T880-480q0 83-31.5 156T763-197q-54 54-127 85.5T480-80Zm0-400Zm0 340q142.375 0 241.188-98.812Q820-337.625 820-480t-98.812-241.188Q622.375-820 480-820t-241.188 98.812Q140-622.375 140-480t98.812 241.188Q337.625-140 480-140Z"})}),Rp=Ep("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 -960 960 960",width:"48",children:Ep("path",{d:"M626-533q22.5 0 38.25-15.75T680-587q0-22.5-15.75-38.25T626-641q-22.5 0-38.25 15.75T572-587q0 22.5 15.75 38.25T626-533Zm-292 0q22.5 0 38.25-15.75T388-587q0-22.5-15.75-38.25T334-641q-22.5 0-38.25 15.75T280-587q0 22.5 15.75 38.25T334-533Zm146.174 116Q413-417 358.5-379.5T278-280h53q22-42 62.173-65t87.5-23Q528-368 567.5-344.5T630-280h52q-25-63-79.826-100-54.826-37-122-37ZM480-80q-83 0-156-31.5T197-197q-54-54-85.5-127T80-480q0-83 31.5-156T197-763q54-54 127-85.5T480-880q83 0 156 31.5T763-763q54 54 85.5 127T880-480q0 83-31.5 156T763-197q-54 54-127 85.5T480-80Zm0-400Zm0 340q142.375 0 241.188-98.812Q820-337.625 820-480t-98.812-241.188Q622.375-820 480-820t-241.188 98.812Q140-622.375 140-480t98.812 241.188Q337.625-140 480-140Z"})}),Pp=Ep("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 -960 960 960",width:"48",children:Ep("path",{d:"M480-417q-67 0-121.5 37.5T278-280h404q-25-63-80-100t-122-37Zm-183-72 50-45 45 45 31-36-45-45 45-45-31-36-45 45-50-45-31 36 45 45-45 45 31 36Zm272 0 44-45 51 45 31-36-45-45 45-45-31-36-51 45-44-45-31 36 44 45-44 45 31 36ZM480-80q-83 0-156-31.5T197-197q-54-54-85.5-127T80-480q0-83 31.5-156T197-763q54-54 127-85.5T480-880q83 0 156 31.5T763-763q54 54 85.5 127T880-480q0 83-31.5 156T763-197q-54 54-127 85.5T480-80Zm0-400Zm0 340q142 0 241-99t99-241q0-142-99-241t-241-99q-142 0-241 99t-99 241q0 142 99 241t241 99Z"})}),Ap=Ep("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 -960 960 960",width:"48",children:Ep("path",{d:"M479.504-261Q537-261 585.5-287q48.5-26 78.5-72.4 6-11.6-.75-22.6-6.75-11-20.25-11H316.918Q303-393 296.5-382t-.5 22.6q30 46.4 78.5 72.4 48.5 26 105.004 26ZM347-578l27 27q7.636 8 17.818 8Q402-543 410-551q8-8 8-18t-8-18l-42-42q-8.8-9-20.9-9-12.1 0-21.1 9l-42 42q-8 7.636-8 17.818Q276-559 284-551q8 8 18 8t18-8l27-27Zm267 0 27 27q7.714 8 18 8t18-8q8-7.636 8-17.818Q685-579 677-587l-42-42q-8.8-9-20.9-9-12.1 0-21.1 9l-42 42q-8 7.714-8 18t8 18q7.636 8 17.818 8Q579-543 587-551l27-27ZM480-80q-83 0-156-31.5T197-197q-54-54-85.5-127T80-480q0-83 31.5-156T197-763q54-54 127-85.5T480-880q83 0 156 31.5T763-763q54 54 85.5 127T880-480q0 83-31.5 156T763-197q-54 54-127 85.5T480-80Zm0-400Zm0 340q142.375 0 241.188-98.812Q820-337.625 820-480t-98.812-241.188Q622.375-820 480-820t-241.188 98.812Q140-622.375 140-480t98.812 241.188Q337.625-140 480-140Z"})}),Op=Ep("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 0 24 24",width:"48",children:Ep("path",{d:"M2 20h2c.55 0 1-.45 1-1v-9c0-.55-.45-1-1-1H2v11zm19.83-7.12c.11-.25.17-.52.17-.8V11c0-1.1-.9-2-2-2h-5.5l.92-4.65c.05-.22.02-.46-.08-.66-.23-.45-.52-.86-.88-1.22L14 2 7.59 8.41C7.21 8.79 7 9.3 7 9.83v7.84C7 18.95 8.05 20 9.34 20h8.11c.7 0 1.36-.37 1.72-.97l2.66-6.15z"})}),Fp=Ep("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 0 24 24",width:"48",children:Ep("path",{d:"M22 4h-2c-.55 0-1 .45-1 1v9c0 .55.45 1 1 1h2V4zM2.17 11.12c-.11.25-.17.52-.17.8V13c0 1.1.9 2 2 2h5.5l-.92 4.65c-.05.22-.02.46.08.66.23.45.52.86.88 1.22L10 22l6.41-6.41c.38-.38.59-.89.59-1.42V6.34C17 5.05 15.95 4 14.66 4H6.55c-.7 0-1.36.37-1.72.97l-2.66 6.15z"})}),Lp=function(t){var e=(void 0===t?{}:t).fill,i=void 0===e?"currentColor":e;return Ep("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:i,xmlns:"http://www.w3.org/2000/svg","aria-labelledby":"close-survey-title-adam",children:[Ep("title",{id:"close-survey-title",className:"adam-testing",children:"Close survey"}),Ep("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M0.164752 0.164752C0.384422 -0.0549175 0.740578 -0.0549175 0.960248 0.164752L6 5.20451L11.0398 0.164752C11.2594 -0.0549175 11.6156 -0.0549175 11.8352 0.164752C12.0549 0.384422 12.0549 0.740578 11.8352 0.960248L6.79549 6L11.8352 11.0398C12.0549 11.2594 12.0549 11.6156 11.8352 11.8352C11.6156 12.0549 11.2594 12.0549 11.0398 11.8352L6 6.79549L0.960248 11.8352C0.740578 12.0549 0.384422 12.0549 0.164752 11.8352C-0.0549175 11.6156 -0.0549175 11.2594 0.164752 11.0398L5.20451 6L0.164752 0.960248C-0.0549175 0.740578 -0.0549175 0.384422 0.164752 0.164752Z",fill:i})]})},$p=Ep("svg",{width:"77",height:"14",viewBox:"0 0 77 14",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[Ep("g",{"clip-path":"url(#clip0_2415_6911)",children:[Ep("mask",{id:"mask0_2415_6911",style:{maskType:"luminance"},maskUnits:"userSpaceOnUse",x:"0",y:"0",width:"77",height:"14",children:Ep("path",{d:"M0.5 0H76.5V14H0.5V0Z",fill:"white"})}),Ep("g",{mask:"url(#mask0_2415_6911)",children:[Ep("path",{d:"M5.77226 8.02931C5.59388 8.37329 5.08474 8.37329 4.90634 8.02931L4.4797 7.20672C4.41155 7.07535 4.41155 6.9207 4.4797 6.78933L4.90634 5.96669C5.08474 5.62276 5.59388 5.62276 5.77226 5.96669L6.19893 6.78933C6.26709 6.9207 6.26709 7.07535 6.19893 7.20672L5.77226 8.02931ZM5.77226 12.6946C5.59388 13.0386 5.08474 13.0386 4.90634 12.6946L4.4797 11.872C4.41155 11.7406 4.41155 11.586 4.4797 11.4546L4.90634 10.632C5.08474 10.288 5.59388 10.288 5.77226 10.632L6.19893 11.4546C6.26709 11.586 6.26709 11.7406 6.19893 11.872L5.77226 12.6946Z",fill:"#1D4AFF"}),Ep("path",{d:"M0.5 10.9238C0.5 10.508 1.02142 10.2998 1.32637 10.5938L3.54508 12.7327C3.85003 13.0267 3.63405 13.5294 3.20279 13.5294H0.984076C0.716728 13.5294 0.5 13.3205 0.5 13.0627V10.9238ZM0.5 8.67083C0.5 8.79459 0.551001 8.91331 0.641783 9.00081L5.19753 13.3927C5.28831 13.4802 5.41144 13.5294 5.53982 13.5294H8.0421C8.47337 13.5294 8.68936 13.0267 8.3844 12.7327L1.32637 5.92856C1.02142 5.63456 0.5 5.84278 0.5 6.25854V8.67083ZM0.5 4.00556C0.5 4.12932 0.551001 4.24802 0.641783 4.33554L10.0368 13.3927C10.1276 13.4802 10.2508 13.5294 10.3791 13.5294H12.8814C13.3127 13.5294 13.5287 13.0267 13.2237 12.7327L1.32637 1.26329C1.02142 0.969312 0.5 1.17752 0.5 1.59327V4.00556ZM5.33931 4.00556C5.33931 4.12932 5.39033 4.24802 5.4811 4.33554L14.1916 12.7327C14.4965 13.0267 15.0179 12.8185 15.0179 12.4028V9.99047C15.0179 9.86671 14.9669 9.74799 14.8762 9.66049L6.16568 1.26329C5.86071 0.969307 5.33931 1.17752 5.33931 1.59327V4.00556ZM11.005 1.26329C10.7 0.969307 10.1786 1.17752 10.1786 1.59327V4.00556C10.1786 4.12932 10.2296 4.24802 10.3204 4.33554L14.1916 8.06748C14.4965 8.36148 15.0179 8.15325 15.0179 7.7375V5.3252C15.0179 5.20144 14.9669 5.08272 14.8762 4.99522L11.005 1.26329Z",fill:"#F9BD2B"}),Ep("path",{d:"M21.0852 10.981L16.5288 6.58843C16.2238 6.29443 15.7024 6.50266 15.7024 6.91841V13.0627C15.7024 13.3205 15.9191 13.5294 16.1865 13.5294H23.2446C23.5119 13.5294 23.7287 13.3205 23.7287 13.0627V12.5032C23.7287 12.2455 23.511 12.0396 23.2459 12.0063C22.4323 11.9042 21.6713 11.546 21.0852 10.981ZM18.0252 12.0365C17.5978 12.0365 17.251 11.7021 17.251 11.2901C17.251 10.878 17.5978 10.5436 18.0252 10.5436C18.4527 10.5436 18.7996 10.878 18.7996 11.2901C18.7996 11.7021 18.4527 12.0365 18.0252 12.0365Z",fill:"currentColor"}),Ep("path",{d:"M0.5 13.0627C0.5 13.3205 0.716728 13.5294 0.984076 13.5294H3.20279C3.63405 13.5294 3.85003 13.0267 3.54508 12.7327L1.32637 10.5938C1.02142 10.2998 0.5 10.508 0.5 10.9238V13.0627ZM5.33931 5.13191L1.32637 1.26329C1.02142 0.969306 0.5 1.17752 0.5 1.59327V4.00556C0.5 4.12932 0.551001 4.24802 0.641783 4.33554L5.33931 8.86412V5.13191ZM1.32637 5.92855C1.02142 5.63455 0.5 5.84278 0.5 6.25853V8.67083C0.5 8.79459 0.551001 8.91331 0.641783 9.00081L5.33931 13.5294V9.79717L1.32637 5.92855Z",fill:"#1D4AFF"}),Ep("path",{d:"M10.1787 5.3252C10.1787 5.20144 10.1277 5.08272 10.0369 4.99522L6.16572 1.26329C5.8608 0.969306 5.33936 1.17752 5.33936 1.59327V4.00556C5.33936 4.12932 5.39037 4.24802 5.48114 4.33554L10.1787 8.86412V5.3252ZM5.33936 13.5294H8.04214C8.47341 13.5294 8.6894 13.0267 8.38443 12.7327L5.33936 9.79717V13.5294ZM5.33936 5.13191V8.67083C5.33936 8.79459 5.39037 8.91331 5.48114 9.00081L10.1787 13.5294V9.99047C10.1787 9.86671 10.1277 9.74803 10.0369 9.66049L5.33936 5.13191Z",fill:"#F54E00"}),Ep("path",{d:"M29.375 11.6667H31.3636V8.48772H33.0249C34.8499 8.48772 36.0204 7.4443 36.0204 5.83052C36.0204 4.21681 34.8499 3.17334 33.0249 3.17334H29.375V11.6667ZM31.3636 6.84972V4.81136H32.8236C33.5787 4.81136 34.0318 5.19958 34.0318 5.83052C34.0318 6.4615 33.5787 6.84972 32.8236 6.84972H31.3636ZM39.618 11.7637C41.5563 11.7637 42.9659 10.429 42.9659 8.60905C42.9659 6.78905 41.5563 5.45438 39.618 5.45438C37.6546 5.45438 36.2701 6.78905 36.2701 8.60905C36.2701 10.429 37.6546 11.7637 39.618 11.7637ZM38.1077 8.60905C38.1077 7.63838 38.7118 6.97105 39.618 6.97105C40.5116 6.97105 41.1157 7.63838 41.1157 8.60905C41.1157 9.57972 40.5116 10.2471 39.618 10.2471C38.7118 10.2471 38.1077 9.57972 38.1077 8.60905ZM46.1482 11.7637C47.6333 11.7637 48.6402 10.8658 48.6402 9.81025C48.6402 7.33505 45.2294 8.13585 45.2294 7.16518C45.2294 6.8983 45.5189 6.72843 45.9342 6.72843C46.3622 6.72843 46.8782 6.98318 47.0418 7.54132L48.527 6.94678C48.2375 6.06105 47.1677 5.45438 45.8713 5.45438C44.4743 5.45438 43.6058 6.25518 43.6058 7.21372C43.6058 9.53118 46.9663 8.88812 46.9663 9.84665C46.9663 10.1864 46.6391 10.417 46.1482 10.417C45.4434 10.417 44.9525 9.94376 44.8015 9.3735L43.3164 9.93158C43.6436 10.8537 44.6001 11.7637 46.1482 11.7637ZM53.4241 11.606L53.2982 10.0651C53.0843 10.1743 52.8074 10.2106 52.5808 10.2106C52.1278 10.2106 51.8257 9.89523 51.8257 9.34918V7.03172H53.3612V5.55145H51.8257V3.78001H49.9755V5.55145H48.9687V7.03172H49.9755V9.57972C49.9755 11.06 51.0202 11.7637 52.3921 11.7637C52.7696 11.7637 53.122 11.7031 53.4241 11.606ZM59.8749 3.17334V6.47358H56.376V3.17334H54.3874V11.6667H56.376V8.11158H59.8749V11.6667H61.8761V3.17334H59.8749ZM66.2899 11.7637C68.2281 11.7637 69.6378 10.429 69.6378 8.60905C69.6378 6.78905 68.2281 5.45438 66.2899 5.45438C64.3265 5.45438 62.942 6.78905 62.942 8.60905C62.942 10.429 64.3265 11.7637 66.2899 11.7637ZM64.7796 8.60905C64.7796 7.63838 65.3837 6.97105 66.2899 6.97105C67.1835 6.97105 67.7876 7.63838 67.7876 8.60905C67.7876 9.57972 67.1835 10.2471 66.2899 10.2471C65.3837 10.2471 64.7796 9.57972 64.7796 8.60905ZM73.2088 11.4725C73.901 11.4725 74.5177 11.242 74.845 10.8416V11.424C74.845 12.1034 74.2786 12.5767 73.4102 12.5767C72.7935 12.5767 72.2523 12.2854 72.1642 11.788L70.4776 12.0428C70.7042 13.1955 71.925 13.972 73.4102 13.972C75.361 13.972 76.6574 12.8679 76.6574 11.2298V5.55145H74.8324V6.07318C74.4926 5.69705 73.9136 5.45438 73.171 5.45438C71.409 5.45438 70.3014 6.61918 70.3014 8.46345C70.3014 10.3077 71.409 11.4725 73.2088 11.4725ZM72.1012 8.46345C72.1012 7.55345 72.655 6.97105 73.5109 6.97105C74.3793 6.97105 74.9331 7.55345 74.9331 8.46345C74.9331 9.37345 74.3793 9.95585 73.5109 9.95585C72.655 9.95585 72.1012 9.37345 72.1012 8.46345Z",fill:"currentColor"})]})]}),Ep("defs",{children:Ep("clipPath",{id:"clip0_2415_6911",children:Ep("rect",{width:"76",height:"14",fill:"white",transform:"translate(0.5)"})})})]});function Dp(t){var e=t.urlParams,i=e?Object.entries(e).map((t=>{var e=t[1];return encodeURIComponent(t[0])+"="+encodeURIComponent(e)})).join("&"):"";return Ep("a",{href:"https://posthog.com/surveys"+(i?"?"+i:""),target:"_blank",rel:"noopener",className:"footer-branding",children:["Survey by ",$p]})}function Np(e){var i=e.text,r=e.submitDisabled,n=e.appearance,s=e.onSubmit,o=e.link,a=e.onPreviewSubmit,l=e.skipSubmitButton,u=e.canGoBack,h=e.onBack,d=Zc(pp).isPreviewMode,v=!!u&&!!h,c=!l&&Ep("button",{className:"form-submit",disabled:r,"aria-label":"Submit survey",type:"button",onClick(){o&&(null==t||t.open(o)),d?null==a||a():s()},children:i});return Ep("div",{className:"bottom-section",children:[v?Ep("div",{className:"form-buttons form-buttons-with-back",children:[Ep("button",{className:"form-back",type:"button","aria-label":"Go to previous question",onClick:h,children:n.backButtonText||"Back"}),c]}):c,!n.whiteLabel&&Ep(Dp,{urlParams:{utm_source:"survey-footer"}})]})}function qp(t){var e=t.question,i=t.forceDisableHtml;return Ep("div",{class:e.question||e.description?"question-header":"question-header question-header--empty",children:[Ep(e.type===hf.Open?"label":"h3",{className:"survey-question",htmlFor:t.htmlFor,children:e.question}),e.description&&mp({component:ac("p",{className:"survey-question-description"}),children:e.description,renderAsHtml:!i&&"text"!==e.descriptionContentType})]})}function jp(t){return Ep("button",{className:"form-cancel",onClick:t.onClick,disabled:Zc(pp).isPreviewMode,"aria-label":"Close survey",type:"button",children:Lp({fill:"black"})})}Ep("svg",{width:"16",height:"12",viewBox:"0 0 16 12",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:Ep("path",{d:"M5.30769 10.6923L4.77736 11.2226C4.91801 11.3633 5.10878 11.4423 5.30769 11.4423C5.5066 11.4423 5.69737 11.3633 5.83802 11.2226L5.30769 10.6923ZM15.5303 1.53033C15.8232 1.23744 15.8232 0.762563 15.5303 0.46967C15.2374 0.176777 14.7626 0.176777 14.4697 0.46967L15.5303 1.53033ZM1.53033 5.85429C1.23744 5.56139 0.762563 5.56139 0.46967 5.85429C0.176777 6.14718 0.176777 6.62205 0.46967 6.91495L1.53033 5.85429ZM5.83802 11.2226L15.5303 1.53033L14.4697 0.46967L4.77736 10.162L5.83802 11.2226ZM0.46967 6.91495L4.77736 11.2226L5.83802 10.162L1.53033 5.85429L0.46967 6.91495Z",fill:"currentColor"})});var Bp=t;function Up(t){var e=t.header,i=t.description,r=t.contentType,n=t.forceDisableHtml,s=t.appearance,o=t.onClose,a=Zc(pp).isPopup;return Wc((()=>{var t=t=>{"Enter"!==t.key&&"Escape"!==t.key||(t.preventDefault(),o())};return Ki(Bp,"keydown",t),()=>{Bp.removeEventListener("keydown",t)}}),[o]),Ep("div",{className:"thank-you-message",role:"status",tabIndex:0,"aria-atomic":"true",children:[a&&!0!==s.hideCancelButton&&Ep(jp,{onClick:()=>o()}),Ep("h3",{className:"thank-you-message-header",children:e}),i&&mp({component:ac("p",{className:"thank-you-message-body"}),children:i,renderAsHtml:!n&&"text"!==r}),a&&Ep(Np,{text:s.thankYouMessageCloseButtonText||"Close",submitDisabled:!1,appearance:s,onSubmit:()=>o()})]})}function Hp(t){var e=t.header,i=t.description,r=t.contentType,n=t.forceDisableHtml,s=t.appearance,o=t.onStart,a=Zc(pp),l=a.onPreviewSubmit,u=a.onPopupSurveyDismissed;return Ep("div",{className:"intro-screen",role:"status",tabIndex:0,"aria-atomic":"true",children:[a.isPopup&&!0!==s.hideCancelButton&&Ep(jp,{onClick:()=>u()}),e&&Ep("h3",{className:"intro-screen-header",children:e}),i&&mp({component:ac("p",{className:"intro-screen-body"}),children:i,renderAsHtml:!n&&"text"!==r}),Ep(Np,{text:s.introScreenButtonText||"Get started",submitDisabled:!1,appearance:s,onSubmit:o,onPreviewSubmit:()=>l(null)})]})}var zp=t=>rt(t)&&t.every((t=>lt(t)));function Wp(t){var e=t.question,i=t.forceDisableHtml,r=t.appearance,n=t.onSubmit,s=t.onPreviewSubmit,o=t.displayQuestionIndex,a=t.initialValue,l=t.canGoBack,u=t.onBack,h=gp().isPreviewMode,d=Vc(null),v=zc((()=>lt(a)?a:"")),c=v[0],f=v[1],p=null==r?void 0:r.disableAutofocus;Wc((()=>{p||setTimeout((()=>{var t;h||null==(t=d.current)||t.focus()}),100)}),[h,p]);var g="surveyQuestion"+o,m=Gc((()=>function(t,e,i){var r,n,s=t.trim();if(!i&&""===s)return"This field is required";if(""===s)return!1;if(e&&e.length>0)for(var o of e)switch(o.type){case T:if(void 0!==o.value&&o.value>s.length)return null!==(r=o.errorMessage)&&void 0!==r?r:"Please enter at least "+o.value+" characters";break;case E:if(void 0!==o.value&&s.length>o.value)return null!==(n=o.errorMessage)&&void 0!==n?n:"Please enter no more than "+o.value+" characters"}return!1}(c,e.validation,e.optional)),[c,e.validation,e.optional]),y=ii(e.validation,T),_=ii(e.validation,E),b=Gc((()=>function(t,e){var i=1===t?void 0:t;return i&&e?"Enter "+i+"-"+e+" characters":i?"Enter at least "+i+" "+(1===i?"character":"characters"):e?"Maximum "+e+" "+(1===e?"character":"characters"):void 0}(y,_)),[y,_]),w=()=>{m||n(c.trim())},k=()=>{m||s(c.trim())};return Ep(uc,{children:[Ep("div",{className:"question-container",children:[Ep(qp,{question:e,forceDisableHtml:i,htmlFor:g}),Ep("textarea",{ref:d,id:g,rows:4,placeholder:null==r?void 0:r.placeholder,minLength:y,maxLength:_,onInput(t){f(t.currentTarget.value),t.stopPropagation()},onKeyDown(t){t.stopPropagation(),"Enter"!==t.key||!t.metaKey&&!t.ctrlKey||m||(t.preventDefault(),h?k():w())},value:c}),b&&Ep("div",{className:"validation-hint",children:b})]}),Ep(Np,{text:e.buttonText||"Submit",submitDisabled:!!m,appearance:r,onSubmit:w,onPreviewSubmit:k,canGoBack:l,onBack:u})]})}function Vp(t){var e=t.question,i=t.appearance,r=t.onSubmit,n=t.onPreviewSubmit,s=t.canGoBack,o=t.onBack;return Ep(uc,{children:[Ep("div",{className:"question-container",children:Ep(qp,{question:e,forceDisableHtml:t.forceDisableHtml})}),Ep(Np,{text:e.buttonText||"Submit",submitDisabled:!1,link:e.link,appearance:i,onSubmit:()=>r("link clicked"),onPreviewSubmit:()=>n("link clicked"),canGoBack:s,onBack:o})]})}function Gp(t){var e,i=t.question,r=t.forceDisableHtml,n=t.displayQuestionIndex,s=t.appearance,o=t.onSubmit,a=t.onPreviewSubmit,l=t.initialValue,u=t.canGoBack,h=t.onBack,d=i.scale,v=10===i.scale?0:1,c=zc((()=>vt(l)?l:rt(l)&&l.length>0&&vt(parseInt(l[0]))?parseInt(l[0]):lt(l)&&vt(parseInt(l))?parseInt(l):null)),f=c[0],p=c[1],g="emoji"===i.display&&2===i.scale,m=gp().isPreviewMode,y=t=>m?a(t):o(t);return Ep(uc,{children:[Ep("div",{className:"question-container",children:[Ep(qp,{question:i,forceDisableHtml:r}),Ep("div",{className:"rating-section",children:[Ep("div",{className:"rating-options",children:["emoji"===i.display&&Ep("div",{className:"rating-options-emoji"+(g?" rating-options-emoji-2":""),children:null==(e=Xp[i.scale])?void 0:e.map(((t,e)=>Ep("button",{"aria-label":"Rate "+(e+1),className:"ratings-emoji question-"+n+"-rating-"+e+" "+(e+1===f?"rating-active":""),value:e+1,type:"button",onClick(){var t=e+1;p(t),i.skipSubmitButton&&y(t)},children:t},e)))}),"number"===i.display&&Ep("div",{className:"rating-options-number",style:{gridTemplateColumns:"repeat("+(d-v+1)+", minmax(0, 1fr))"},children:tg(i.scale).map(((t,e)=>Ep(Zp,{displayQuestionIndex:n,active:f===t,appearance:s,num:t,setActiveNumber(t){p(t),i.skipSubmitButton&&y(t)}},e)))})]}),!g&&Ep("div",{className:"rating-text",children:[Ep("div",{children:i.lowerBoundLabel}),Ep("div",{children:i.upperBoundLabel})]})]})]}),Ep(Np,{text:i.buttonText||(null==s?void 0:s.submitButtonText)||"Submit",submitDisabled:ht(f)&&!i.optional,appearance:s,onSubmit:()=>o(f),onPreviewSubmit:()=>a(f),skipSubmitButton:i.skipSubmitButton,canGoBack:u,onBack:h})]})}function Zp(t){var e=t.num,i=t.setActiveNumber;return Ep("button",{"aria-label":"Rate "+e,className:"ratings-number question-"+t.displayQuestionIndex+"-rating-"+e+" "+(t.active?"rating-active":""),type:"button",onClick(){i(e)},children:e})}function Qp(t){var e=t.question,i=t.forceDisableHtml,r=t.displayQuestionIndex,n=t.appearance,s=t.onSubmit,o=t.onPreviewSubmit,a=t.initialValue,l=t.canGoBack,u=t.onBack,h=Vc(null),d=Gc((()=>(t=>{if(!t.shuffleOptions)return t.choices;var e=t.choices,i="";t.hasOpenChoice&&(i=e.pop());var r=vp(e,dp(e));return t.hasOpenChoice&&(t.choices.push(i),r.push(i)),r})(e)),[e]),v=zc((()=>((t,e)=>lt(t)||zp(t)?t:e===hf.SingleChoice?null:[])(a,e.type))),c=v[0],f=v[1],g=zc((()=>((t,e)=>{if(lt(t)&&!e.includes(t))return{isSelected:!0,inputValue:t};if(zp(t)){var i=t.find((t=>!e.includes(t)));if(i)return{isSelected:!0,inputValue:i}}return{isSelected:!1,inputValue:""}})(a,d))),m=g[0],y=g[1],_=gp().isPreviewMode,b=e.type===hf.SingleChoice,w=e.type===hf.MultipleChoice,k=e.skipSubmitButton&&b&&!e.hasOpenChoice,S=(t,e)=>{if(e){var i=!m.isSelected;return y((t=>p({},t,{isSelected:i,inputValue:i?t.inputValue:""}))),b&&f(""),void(i&&setTimeout((()=>{var t;return null==(t=h.current)?void 0:t.focus()}),75))}if(b)return f(t),y((t=>p({},t,{isSelected:!1,inputValue:""}))),void(k&&(s(t),_&&o(t)));w&&rt(c)&&(c.includes(t)?f(c.filter((e=>e!==t))):f([...c,t]))},x=t=>{t.stopPropagation();var e=t.currentTarget.value;y((t=>p({},t,{inputValue:e}))),b&&f(e)},C=t=>{t.stopPropagation(),"Enter"!==t.key||T()||(t.preventDefault(),E()),"Escape"===t.key&&(t.preventDefault(),y((t=>p({},t,{isSelected:!1,inputValue:""}))),b&&f(null))},T=()=>!(e.optional||!ht(c)&&(!rt(c)||m.isSelected||0!==c.length)&&(!m.isSelected||""!==m.inputValue.trim())),E=()=>{m.isSelected&&w?rt(c)&&(_?o([...c,m.inputValue]):s([...c,m.inputValue])):_?o(c):s(c)};return Ep(uc,{children:[Ep("div",{className:"question-container",children:[Ep(qp,{question:e,forceDisableHtml:i}),Ep("fieldset",{className:"multiple-choice-options limit-height",children:[Ep("legend",{className:"sr-only",children:w?" Select all that apply":" Select one"}),d.map(((t,i)=>{var n=!!e.hasOpenChoice&&i===e.choices.length-1,s="surveyQuestion"+r+"Choice"+i,o=s+"Open",a=n?m.isSelected:b?c===t:rt(c)&&c.includes(t);return Ep("label",{className:n?"choice-option-open":"",children:[Ep("div",{className:"response-choice",children:[Ep("input",{type:b?"radio":"checkbox",name:s,checked:a,onChange:()=>S(t,n),id:s,"aria-controls":o}),Ep("span",{children:n?t+":":t})]}),n&&Ep("input",{type:"text",ref:h,id:o,name:"question"+r+"Open",value:m.inputValue,onKeyDown:C,onInput:x,onClick(e){m.isSelected||S(t,!0),e.stopPropagation()},"aria-label":t+" - please specify"})]},i)}))]})]}),Ep(Np,{text:e.buttonText||"Submit",submitDisabled:T(),appearance:n,onSubmit:E,onPreviewSubmit:E,skipSubmitButton:k,canGoBack:l,onBack:u})]})}var Jp=[1,2,3,4,5],Kp=[1,2,3,4,5,6,7],Yp=[0,1,2,3,4,5,6,7,8,9,10],Xp={2:[Op,Fp],3:[Rp,Ip,Mp],5:[Pp,Rp,Ip,Mp,Ap]};function tg(t){switch(t){case 5:default:return Jp;case 7:return Kp;case 10:return Yp}}var eg=Bi("[Surveys]");function ig(t,e,i){var r,n=t.questions[e],s=e+1;if(null==(r=n.branching)||!r.type)return e===t.questions.length-1?df.End:s;if(n.branching.type===df.End)return df.End;if(n.branching.type===df.SpecificQuestion){if(Number.isInteger(n.branching.index))return n.branching.index}else if(n.branching.type===df.ResponseBased){if(n.type===hf.SingleChoice){var o,a=n.choices.indexOf(""+i);if(-1===a&&n.hasOpenChoice&&(a=n.choices.length-1),null!=(o=n.branching)&&null!=(o=o.responseValues)&&o.hasOwnProperty(a)){var l=n.branching.responseValues[a];return Number.isInteger(l)?l:l===df.End?df.End:s}}else if(n.type===hf.Rating){var u;if("number"!=typeof i||!Number.isInteger(i))throw new Error("The response type must be an integer");var h=function(t,e){if(2===e){if(1>t||t>2)throw new Error("The response must be in range 1-2");return 1===t?"positive":"negative"}if(3===e){if(1>t||t>3)throw new Error("The response must be in range 1-3");return 1===t?"negative":2===t?"neutral":"positive"}if(5===e){if(1>t||t>5)throw new Error("The response must be in range 1-5");return t>2?3===t?"neutral":"positive":"negative"}if(7===e){if(1>t||t>7)throw new Error("The response must be in range 1-7");return t>3?4===t?"neutral":"positive":"negative"}if(10===e){if(0>t||t>10)throw new Error("The response must be in range 0-10");return t>6?t>8?"promoters":"passives":"detractors"}throw new Error("The scale must be one of: 2, 3, 5, 7, 10")}(i,n.scale);if(null!=(u=n.branching)&&null!=(u=u.responseValues)&&u.hasOwnProperty(h)){var d=n.branching.responseValues[h];return Number.isInteger(d)?d:d===df.End?df.End:s}}return s}return eg.warn("Falling back to next question index due to unexpected branching type"),s}var rg=Bi("[SurveyTranslations]");function ng(t,e){var i=function(t){return function(t,e){var i=t.storedPersonProperties,r=t.locale,n=ca(t.overrideLanguage);if(n)return null==e||e.info("Using override display language: "+n),n;var s=function(t){return t&&"object"==typeof t&&"language"in t?ca(t.language):null}(i);if(s)return null==e||e.info("Using person property language: "+s),s;var o=ca(r);return o?(null==e||e.info("Using detected locale: "+o),o):(null==e||e.info("No user language detected"),null)}({overrideLanguage:t.config.override_display_language,storedPersonProperties:nt(t.get_property)?t.get_property(Xn):void 0,locale:Ba()},rg)}(e);if(!i)return rg.info("No user language detected"),{survey:t,language:null};var r=ma(t,i,rg);return{survey:r.survey,language:r.matchedKey}}var sg=-1,og=t,ag=r,lg="ph:show_survey_widget",ug="PHWidgetSurveyClickListener";function hg(t,e){try{var i=t.getBoundingClientRect(),r=og.innerHeight,n=og.innerWidth,s=i.left+i.width/2-e/2;s+e>n-20&&(s=n-e-20),20>s&&(s=20);var o=r-i.bottom,a=250>o&&i.top>o;return{position:"fixed",top:a?"auto":i.bottom+12+"px",left:s+"px",right:"auto",bottom:a?r-i.top+12+"px":"auto",zIndex:ip.zIndex}}catch(t){return gf.warn("Failed to calculate trigger position:",t),null}}class dg{constructor(t){var e=this;this.Hr=new Map,this.$r=new Map,this.Ur=new Map,this.Wr=new Set,this.handlePageUnload=()=>{var t=this._posthog.get_property(is);if(t)for(var e of t)kp(e)&&hp(e,this._posthog)},this.handlePopoverSurvey=function(t,i,r){var n,s,o,a,l,u=(void 0===r?{}:r).resumeDelayFromActivation,h=void 0!==u&&u,d=e.zr(t),v=d.survey,c=d.language,f=null!=i&&i.position||null!=i&&i.selector?p({},v,{appearance:p({},v.appearance,i.position&&{position:i.position},i.selector&&{widgetSelector:i.selector})}):v;e.Vr(f.id);var g=null!=i?i:{},m=g.properties,y=g.initialResponses,_=!(!y||0>=Object.keys(y).length)&&e.Zr(f,y,m,c);if(!_||null!=(n=f.appearance)&&n.displayThankYouMessage){e.Qr(f);var b={};if((null==(s=f.appearance)?void 0:s.position)===af.NextToTrigger&&null!=(o=f.appearance)&&o.widgetSelector){var w,k=ag.querySelector(f.appearance.widgetSelector);k&&(b=hg(k,parseInt((null==(w=f.appearance)?void 0:w.maxWidth)||ip.maxWidth))||{})}var S=(null==(a=f.appearance)?void 0:a.surveyPopupDelaySeconds)||0,x=op(f,e._posthog).shadow;e.Ur.set(x,x.host);var C={posthog:e._posthog,survey:f,removeSurveyFromFocus:e.Gr,properties:m,style:b,isSurveyCompleted:_,skipShownEvent:null==i?void 0:i.skipShownEvent,surveyLanguage:c};if(0>=S)return Ic(Ep(gg,p({},C)),x);var T=()=>{if(!e.Yr(f))return gf.info("Survey "+f.id+" no longer eligible when its display delay elapsed; not displaying"),e.Gr(f);Ic(Ep(gg,p({},C,{survey:p({},f,{appearance:p({},f.appearance,{surveyPopupDelaySeconds:0})})})),x)},E=h?null==(l=e._posthog.surveys)||null==(l=l._surveyEventReceiver)||null==l.getActivationTimestamp?void 0:l.getActivationTimestamp(f.id):void 0,M=vt(E)?Math.max(0,Date.now()-E):0,I=Math.max(0,1e3*S-M);if(0>=I)return T();var R=og.setTimeout((()=>{e.Hr.delete(f.id),T()}),I);e.Hr.set(f.id,R)}},this.Jr=t=>{var e=this.zr(t),i=e.survey,r=e.language,n=op(i,this._posthog),s=n.shadow,o=n.isNewlyCreated;this.Ur.set(s,s.host),o&&Ic(Ep(yg,{posthog:this._posthog,survey:i,surveyLanguage:r},t.id),s)},this.Kr=t=>{var e=this.$r.get(t);e&&(e.element.removeEventListener("click",e.listener),e.element.removeAttribute(ug),this.$r.delete(t),gf.info("Removed click listener for survey "+t))},this.Xr=t=>{this.ei(t)||(this.ti(t),this.Kr(t.id))},this.ei=t=>{try{var e,i=ag.querySelector(xp(t,!0));return!(null==i||null==(e=i.shadowRoot)||!e.querySelector(".ph-survey"))}catch(t){return!1}},this.ri=(t,e)=>{var i=ag.querySelector(e),r=this.$r.get(t.id);if(i){if(this.Jr(t),r){if(i===r.element)return;gf.info("Selector element changed for survey "+t.id+". Re-attaching listener."),this.Kr(t.id)}if(!i.hasAttribute(ug)){var n=e=>{var i,r;e.stopPropagation();var n=(null==(i=t.appearance)?void 0:i.position)===af.NextToTrigger?hg(e.currentTarget,parseInt((null==(r=t.appearance)?void 0:r.maxWidth)||ip.maxWidth)):{};og.dispatchEvent(new CustomEvent(lg,{detail:{surveyId:t.id,position:n}}))};Ki(i,"click",n),i.setAttribute(ug,"true"),this.$r.set(t.id,{element:i,listener:n,survey:t}),gf.info("Attached click listener for feedback button survey "+t.id)}}else r&&this.Xr(t)},this.renderPopover=t=>{var e=this.zr(t),i=e.survey,r=e.language,n=op(i,this._posthog).shadow;this.Ur.set(n,n.host),Ic(Ep(gg,{posthog:this._posthog,survey:i,removeSurveyFromFocus:this.Gr,surveyLanguage:r}),n)},this.renderSurvey=(t,e,i)=>{var r,n=this.zr(t),s=n.survey,o=n.language,a=!1;null!=(r=this._posthog.config)&&null!=(r=r.surveys)&&r.prefillFromUrl&&(a=this.ii(s,o,i)),Ic(Ep(gg,{posthog:this._posthog,survey:s,removeSurveyFromFocus:this.Gr,isPopup:!1,properties:i,isSurveyCompleted:a,surveyLanguage:o}),e)},this.getActiveMatchingSurveys=function(t,i){var r;void 0===i&&(i=!1),null==(r=e._posthog)||null==(r=r.surveys)||r.getSurveys((i=>{var r=i.filter((t=>e.Yr(t)));t(r)}),i)},this.callSurveysAndEvaluateDisplayLogic=function(t){void 0===t&&(t=!1),e.getActiveMatchingSurveys((t=>{var i=t.filter((t=>t.type===uf.Popover||t.type===uf.Widget)),r=new Set(i.map((t=>t.id)));for(var n of Array.from(e.Hr.keys()))r.has(n)||e.cancelSurvey(n);var s=e.ni(i),o=new Set;s.forEach((t=>{if(t.type===uf.Widget){var i,r,n,s;if((null==(i=t.appearance)?void 0:i.widgetType)===of.Tab)return void e.Jr(t);(null==(r=t.appearance)?void 0:r.widgetType)===of.Selector&&null!=(n=t.appearance)&&n.widgetSelector&&(o.add(t.id),e.ri(t,null==(s=t.appearance)?void 0:s.widgetSelector))}ht(e.ai)&&t.type===uf.Popover&&e.handlePopoverSurvey(t,void 0,{resumeDelayFromActivation:!0})})),e.$r.forEach((t=>{var i=t.survey;o.has(i.id)||e.Xr(i)}))}),t)},this.Qr=t=>{ht(this.ai)||gf.error("Survey "+this.ai+" already in focus. Cannot add survey "+t.id+"."),this.ai=t.id},this.Gr=t=>{this.ai!==t.id&&gf.error("Survey "+t.id+" is not in focus. Cannot remove survey "+t.id+"."),this.Vr(t.id),this.ai=null,this.ti(t)},this._posthog=t,this.ai=null}Vr(t){var e=this.Hr.get(t);e&&(clearTimeout(e),this.Hr.delete(t))}cancelSurvey(t){this.Hr.has(t)&&(gf.info("Cancelled pending survey "+t),this.Vr(t),this.ai===t&&(this.ai=null))}setAutomaticDisplayDispose(t){this.oi=t}dispose(){var t;null==(t=this.oi)||t.call(this),this.oi=void 0,this.Hr.forEach(((t,e)=>this.Vr(e))),this.$r.forEach(((t,e)=>this.Kr(e))),this.Ur.forEach(((t,e)=>{Ic(null,e),null==t||t.remove()})),this.Ur.clear(),this.ai=null}ni(t){return t.sort(((t,e)=>{var i,r,n=kp(t),s=kp(e);if(n&&!s)return-1;if(!n&&s)return 1;var o=t.schedule===vf.Always,a=e.schedule===vf.Always;return o&&!a?1:!o&&a?-1:((null==(i=t.appearance)?void 0:i.surveyPopupDelaySeconds)||0)-((null==(r=e.appearance)?void 0:r.surveyPopupDelaySeconds)||0)}))}zr(t){return ng(t,this._posthog)}ii(t,e,i){if(this.Wr.has(t.id))return!1;var r=function(t){var e={},i=!1,r=og.location.search.replace(/^\?/,"");if(!r)return{params:e,autoSubmit:i};var n=r.split("&");for(var s of n){var o=s.split("="),a=o[0],l=o[1];if(a&&!at(l)){var u=decodeURIComponent(a),h=decodeURIComponent(l);if("auto_submit"!==u||"true"!==h){var d=u.match(/^q(\d+)$/);if(d){var v=parseInt(d[1],10);e[v]||(e[v]=[]),e[v].push(h)}}else i=!0}}return{params:e,autoSubmit:i}}(),n=r.params;if(0===Object.keys(n).length)return!1;gf.info("[Survey Prefill] Detected URL prefill parameters");var s=this.si(t,n,e);if(!s)return!1;var o=s.responses,a=s.submissionId,l=s.isSurveyCompleted,u=s.skippedResponses;return(Object.keys(u).length>0&&t.enable_partial_responses||l)&&ap({responses:l?o:u,survey:t,surveySubmissionId:a,posthog:this._posthog,isSurveyCompleted:l,properties:i,surveyLanguage:e}),this.Wr.add(t.id),l}Zr(t,e,i,r){var n={};for(var s of Object.entries(e)){var o=s[1];n[parseInt(s[0])]=rt(o)?o.map(String):[String(o)]}gf.info("[Survey] Processing initial responses");var a=this.si(t,n,r);if(!a)return!1;var l=a.isSurveyCompleted;return ap({responses:a.responses,survey:t,surveySubmissionId:a.submissionId,posthog:this._posthog,isSurveyCompleted:l,properties:i,surveyLanguage:r}),l}si(t,e,i){try{var r=function(t,e){var i={};return t.questions.forEach(((t,r)=>{if(e[r]&&t.id){var n=e[r],s=ua(t.id);try{switch(t.type){case hf.SingleChoice:if(!t.choices||0===t.choices.length)return void ji.warn("[Survey Prefill] Question "+r+" has no choices");var o=parseInt(n[0],10);if(isNaN(o)||0>o||o>=t.choices.length)return void ji.warn("[Survey Prefill] Invalid choice index for q"+r+": "+n[0]);i[s]=t.choices[o];break;case hf.MultipleChoice:if(!t.choices||0===t.choices.length)return void ji.warn("[Survey Prefill] Question "+r+" has no choices");var a=n.map((t=>parseInt(t,10))).filter((e=>!isNaN(e)&&e>=0&&t.choices.length>e));if(0===a.length)return void ji.warn("[Survey Prefill] No valid choices for q"+r);var l=[...new Set(a.map((e=>t.choices[e])))];a.length>l.length&&ji.warn("[Survey Prefill] Removed duplicate choices for q"+r),i[s]=l;break;case hf.Rating:var u=parseInt(n[0],10),h=t.scale||10;if(isNaN(u)||0>u||u>h)return void ji.warn("[Survey Prefill] Invalid rating for q"+r+": "+n[0]+" (scale: 0-"+h+")");i[s]=u;break;default:ji.info("[Survey Prefill] Question type "+t.type+" does not support prefill")}}catch(t){ji.error("[Survey Prefill] Error converting q"+r+":",t)}}})),i}(t,e);if(0===Object.keys(r).length)return gf.warn("[Survey Prefill] No valid responses after conversion"),null;var n=Pf(),s=Object.keys(e).map((t=>parseInt(t,10))),o=function(t,e,i){for(var r=0,n={},s=[],o=t.questions.length+1,a=0;t.questions.length>r&&o>a&&(a++,e.includes(r));){var l=t.questions[r];if(!l||!("skipSubmitButton"in l)||!l.skipSubmitButton)break;if(l.id){var u=ua(l.id);at(i[u])||(n[u]=i[u])}s.push(r);var h=ig(t,r,l.id?i[ua(l.id)]:null);if(h===df.End)return{startQuestionIndex:t.questions.length,skippedResponses:n,skippedIndices:s};r=h}return{startQuestionIndex:r,skippedResponses:n,skippedIndices:s}}(t,s,r),a=o.startQuestionIndex,l=o.skippedResponses,u=a>=t.questions.length;return bp(t,{surveySubmissionId:n,responses:r,lastQuestionIndex:a,visitedIndices:o.skippedIndices,surveyLanguage:i}),gf.info("[Survey Prefill] Stored prefilled responses in localStorage"),{responses:r,submissionId:n,startQuestionIndex:a,isSurveyCompleted:u,skippedResponses:l}}catch(t){return gf.error("[Survey Prefill] Error handling prefill:",t),null}}ui(t,e){var i;if(void 0===e&&(e=void 0),!t)return!0;var r,n=!(null==(i=this._posthog.featureFlags)||!i.isFeatureEnabled(t,{send_event:!t.startsWith("survey-targeting-")})),s=!0;return e&&(s=(null==(r=this._posthog.featureFlags)?void 0:r.getFeatureFlag(t,{send_event:!1}))===e||"any"===e),n&&s}li(e){return!e.conditions||yp(e,this._posthog)&&function(e){var r,n;return function(e,r){var n,s,o;if(!e||0===e.length)return!0;if(!u)return!1;var a=Ae(u,{userAgentDataPlatform:null==i||null==(n=i.userAgentData)?void 0:n.platform,maxTouchPoints:null==i?void 0:i.maxTouchPoints,screenWidth:null==t||null==(s=t.screen)?void 0:s.width,screenHeight:null==t||null==(o=t.screen)?void 0:o.height,devicePixelRatio:null==t?void 0:t.devicePixelRatio});return ka[null!=r?r:"icontains"](e,[a])}(null==(r=e.conditions)?void 0:r.deviceTypes,null==(n=e.conditions)?void 0:n.deviceTypesMatchType)}(e)&&function(t){var e;return null==(e=t.conditions)||!e.selector||!(null==tp||!tp.querySelector(t.conditions.selector))}(e)}hi(t){var e;return fp(t)?{satisfied:!0}:!t.internal_targeting_flag_key||!function(t){var e;return"recurring"===t.schedule||(null!==(e=t.current_iteration)&&void 0!==e?e:0)>0}(t)||null!=(e=this._posthog.featureFlags)&&e.hasLoadedFlags?{satisfied:this.ui(t.internal_targeting_flag_key)}:{satisfied:!1,reason:"Feature flags have not loaded yet; deferring internal targeting flag check"}}checkSurveyEligibility(t){var e,i,r={eligible:!0,reason:void 0};if(!mf(t))return r.eligible=!1,r.reason="Survey is not running. It was completed on "+t.end_date,r;if(!xf.includes(t.type))return r.eligible=!1,r.reason="Surveys of type "+t.type+" are never eligible to be shown in the app",r;var n=null==(e=t.conditions)?void 0:e.linkedFlagVariant;if(!this.ui(t.linked_flag_key,n))return r.eligible=!1,r.reason=n?"Survey linked feature flag is not enabled for variant "+n:"Survey linked feature flag is not enabled",r;if(!this.ui(t.targeting_flag_key))return r.eligible=!1,r.reason="Survey targeting feature flag is not enabled",r;var s,o=this.hi(t);return o.satisfied?function(t,e){if(!t||!e)return!0;var i="string"==typeof e?new Date(e):e,r=new Date,n=Math.abs(r.getTime()-i.getTime());return Math.ceil(n/864e5)>t}(null==(i=t.conditions)?void 0:i.seenSurveyWaitPeriodInDays,Df.Pr("lastSeenSurveyDate"))?(t=>!!Df.Pr(kf(t))&&!fp(t))(t)?(r.eligible=!1,r.reason="Survey has already been seen and it can't be activated again",r):r:(r.eligible=!1,r.reason="Survey wait period has not passed",r):(r.eligible=!1,r.reason=null!==(s=o.reason)&&void 0!==s?s:"Survey internal targeting flag is not enabled and survey cannot activate repeatedly and survey is not in progress",r)}checkSurveyRenderability(t){var e=this.checkSurveyEligibility(t);return e.eligible&&!this.ci(t)?{eligible:!1,reason:"Survey event/action trigger has not been fired yet"}:e}ci(t){var e;if(!ya(t)&&!yf(t))return!0;var i=null==(e=this._posthog.surveys)||null==(e=e._surveyEventReceiver)?void 0:e.getSurveys();return!(null==i||!i.includes(t.id))}di(t){var e;return null==(e=t.feature_flag_keys)||!e.length||t.feature_flag_keys.every((t=>{var e=t.value;return!t.key||!e||this.ui(e)}))}Yr(t){return this.checkSurveyEligibility(t).eligible&&this.li(t)&&this.ci(t)&&this.di(t)}ti(t){try{var e=ag.querySelector(xp(t,!0));null!=e&&e.shadowRoot&&(Ic(null,e.shadowRoot),this.Ur.delete(e.shadowRoot)),null==e||e.remove()}catch(e){gf.warn("Failed to remove survey "+t.id+" from DOM:",e)}}getTestAPI(){return{addSurveyToFocus:this.Qr,removeSurveyFromFocus:this.Gr,surveyInFocus:this.ai,surveyTimeouts:this.Hr,handleWidget:this.Jr,handlePopoverSurvey:this.handlePopoverSurvey,manageWidgetSelectorListener:this.ri,sortSurveysByAppearanceDelay:this.ni,checkFlags:this.di.bind(this),isSurveyFeatureFlagEnabled:this.ui.bind(this)}}}function vg(t,e){if(ag&&og){var i,r=new dg(t);if(t.config.disable_surveys_automatic_display)return gf.info("Surveys automatic display is disabled. Skipping call surveys and evaluate display logic."),r;if(!1===e)return gf.info("There are no surveys to load or Surveys is disabled in the project settings."),r;r.callSurveysAndEvaluateDisplayLogic(!0);var n=()=>{at(i)&&(i=setInterval((()=>{r.callSurveysAndEvaluateDisplayLogic(!1)}),1e3))},s=()=>{at(i)||(clearInterval(i),i=void 0)};n();var o=()=>{ag.hidden?s():(r.callSurveysAndEvaluateDisplayLogic(!1),n())};return Ki(ag,"visibilitychange",o),r.setAutomaticDisplayDispose((()=>{s(),ag.removeEventListener("visibilitychange",o)})),r}}function cg(t){var e=t.survey,i=t.removeSurveyFromFocus,r=void 0===i?()=>{}:i,n=t.setSurveyVisible,s=t.isPreviewMode,o=void 0!==s&&s,a=t.posthog;Wc((()=>{var t;if(!o&&null!=(t=e.conditions)&&t.url){var i=()=>{var t,i=e.type===uf.Widget,s=yp(e,a),o=(null==(t=e.appearance)?void 0:t.widgetType)===of.Tab&&i;if(!s)return gf.info("Hiding survey "+e.id+" because URL does not match"),n(!1),r(e);o&&(gf.info("Showing survey "+e.id+" because it is a feedback button tab and URL matches"),n(!0))};Ki(og,"popstate",i),Ki(og,"hashchange",i);var s=og.history.pushState,l=og.history.replaceState;return og.history.pushState=function(){for(var t=arguments.length,e=new Array(t),r=0;t>r;r++)e[r]=arguments[r];s.apply(this,e),i()},og.history.replaceState=function(){for(var t=arguments.length,e=new Array(t),r=0;t>r;r++)e[r]=arguments[r];l.apply(this,e),i()},()=>{og.removeEventListener("popstate",i),og.removeEventListener("hashchange",i),og.history.pushState=s,og.history.replaceState=l}}}),[o,e,r,n,a])}var fg=200;function pg(t){switch(void 0===t&&(t=lf.Right),t){case lf.Top:return{top:"0",left:"50%",transform:"translateX(-50%)"};case lf.Left:return{top:"50%",left:"0",transform:"rotate(90deg) translateY(-100%)",transformOrigin:"left top"};case lf.Bottom:return{bottom:"0",left:"50%",transform:"translateX(-50%)"};default:return{top:"50%",right:"0",transform:"rotate(-90deg) translateY(-100%)",transformOrigin:"right top"}}}function gg(t){var e,i,r,n,s,o,a,l,u,h,d,v,c=t.survey,f=t.forceDisableHtml,g=t.posthog,m=t.style,y=void 0===m?{}:m,_=t.previewPageIndex,b=t.removeSurveyFromFocus,w=void 0===b?()=>{}:b,k=t.isPopup,S=void 0===k||k,x=t.onPreviewSubmit,C=void 0===x?()=>{}:x,T=t.onPreviewBack,E=void 0===T?()=>{}:T,M=t.onPopupSurveyDismissed,I=void 0===M?()=>{}:M,R=t.onCloseConfirmationMessage,P=void 0===R?()=>{}:R,A=t.properties,O=t.isSurveyCompleted,F=t.skipShownEvent,L=t.surveyLanguage,D=Vc(null),N=Number.isInteger(_),q=null!=(e=c.appearance)&&e.surveyPopupDelaySeconds?1e3*c.appearance.surveyPopupDelaySeconds:0,j=function(t,e,i,r,n,s,o,a,l){var u=zc(r||0===i||t.type===uf.ExternalSurvey),h=u[0],d=u[1],v=zc(!1),c=v[0],f=v[1],g=Vc(!1),m=()=>{var e=()=>{s&&n(t),d(!1)};if(!g.current){var i=null==o?void 0:o.current;i?(g.current=!0,i.style.transition="opacity "+fg+"ms ease-out",i.style.opacity="0",setTimeout((()=>{g.current=!1,e()}),fg+50)):e()}},y=e=>{e.detail.surveyId===t.id&&m()};return Wc((()=>{if(e){if(!r){var n,s=e=>{var i,r;if(e.detail.surveyId===t.id){if(null==(i=t.appearance)||!i.displayThankYouMessage)return m();f(!0),null!=(r=t.appearance)&&r.autoDisappear&&(n&&clearTimeout(n),n=setTimeout(m,5e3))}},o=()=>{if(yp(t,e)){d(!0),og.dispatchEvent(new Event("PHSurveyShown")),a||e.capture(cf.SHOWN,p({[ff.SURVEY_NAME]:t.name,[ff.SURVEY_ID]:t.id,[ff.SURVEY_ITERATION]:t.current_iteration,[ff.SURVEY_ITERATION_START_DATE]:t.current_iteration_start_date},l&&{[ff.SURVEY_LANGUAGE]:l},{sessionRecordingUrl:null==e.get_session_replay_url?void 0:e.get_session_replay_url()}));try{localStorage.setItem("lastSeenSurveyDate",(new Date).toISOString())}catch(t){}}};Ki(og,"PHSurveyClosed",y),Ki(og,"PHSurveySent",s);var u=i>0?setTimeout(o,i):void 0;return at(u)&&o(),()=>{at(u)||clearTimeout(u),at(n)||clearTimeout(n),og.removeEventListener("PHSurveyClosed",y),og.removeEventListener("PHSurveySent",s)}}}else gf.error("usePopupVisibility hook called without a PostHog instance.")}),[]),cg({survey:t,removeSurveyFromFocus:n,setSurveyVisible:d,isPreviewMode:r,posthog:e}),{isPopupVisible:h,isSurveySent:c,setIsPopupVisible:d,hidePopupWithAnimation:m}}(c,g,q,N,w,S,D,F,L),B=j.isPopupVisible,U=j.hidePopupWithAnimation,H=j.isSurveySent||_===c.questions.length||!0===O,z=zc(!1),W=z[0],V=z[1],G=Gc((()=>!!wp(c)),[c]),Z=!!(null!=(i=c.appearance)&&i.introScreenHeader||null!=(r=c.appearance)&&r.introScreenDescription),Q=N?_===sg:!(null==(n=c.appearance)||!n.displayIntroScreen)&&Z&&!W&&!G,J=Gc((()=>{var t=wp(c),e=(null==t?void 0:t.surveySubmissionId)||Pf();return{isPreviewMode:N,previewPageIndex:_,onPopupSurveyDismissed(){L?up(c,g,N,L):up(c,g,N),I()},isPopup:S||!1,surveySubmissionId:e,onPreviewSubmit:C,onPreviewBack:E,posthog:g,properties:A,surveyLanguage:L}}),[N,_,S,g,c,I,C,E,A,L]);return B?Ep(pp.Provider,{value:J,children:Ep("div",{className:"ph-survey",style:p({},Cp(c.type,null==(s=c.appearance)?void 0:s.position,null==(o=c.appearance)?void 0:o.widgetType),y),ref:D,children:H?Ep(Up,{header:(null==(a=c.appearance)?void 0:a.thankYouMessageHeader)||"Thank you!",description:(null==(l=c.appearance)?void 0:l.thankYouMessageDescription)||"",forceDisableHtml:!!f,contentType:null==(u=c.appearance)?void 0:u.thankYouMessageDescriptionContentType,appearance:c.appearance||ip,onClose(){U(),P()}}):Q?Ep(Hp,{header:(null==(h=c.appearance)?void 0:h.introScreenHeader)||"",description:(null==(d=c.appearance)?void 0:d.introScreenDescription)||"",forceDisableHtml:!!f,contentType:null==(v=c.appearance)?void 0:v.introScreenDescriptionContentType,appearance:c.appearance||ip,onStart:()=>V(!0)}):Ep(mg,{survey:c,forceDisableHtml:!!f,posthog:g})})}):null}function mg(t){var e,i,r=t.survey,n=t.forceDisableHtml,s=t.posthog,o=Gc((()=>{var t=wp(r);if(!t)return null;var e=vt(t.lastQuestionIndex);return!e||e&&t.lastQuestionIndex>=0&&r.questions.length>t.lastQuestionIndex?t:(Sp(r),null)}),[r]),a=zc((()=>(null!=o&&o.responses&&gf.info("Survey is already in progress, filling in initial responses"),(null==o?void 0:o.responses)||{}))),l=a[0],u=a[1],h=Zc(pp),d=h.previewPageIndex,v=h.onPopupSurveyDismissed,c=h.isPopup,f=h.onPreviewSubmit,g=h.onPreviewBack,m=h.surveySubmissionId,y=h.isPreviewMode,_=h.properties,b=h.surveyLanguage,w=zc((()=>{var t=null==o?void 0:o.lastQuestionIndex,e=vt(t)&&t>=0&&r.questions.length>t?t:0;return vt(d)&&d>=0?d:e})),k=w[0],S=w[1],x=zc((()=>{var t;return(null!==(t=null==o?void 0:o.visitedIndices)&&void 0!==t?t:[]).filter((t=>t>=0&&r.questions.length>t))})),C=x[0],T=x[1],E=Gc((()=>cp(r)),[r]);Wc((()=>{!y||at(d)||0>d||S(d)}),[d,y]);var M=!(null==(e=r.appearance)||!e.allowGoBack)&&(y?(null!=d?d:0)>0:C.length>0),I=E.at(k);return I?Ep("form",{className:"survey-form",name:"surveyForm",children:[c&&!0!==(null==(i=r.appearance)?void 0:i.hideCancelButton)&&Ep(jp,{onClick(){v()}}),Ep("div",{className:"survey-box","data-question-index":k,children:_g({question:I,forceDisableHtml:n,displayQuestionIndex:k,appearance:r.appearance||ip,onSubmit:t=>(t=>{var e=t.res,i=t.displayQuestionIndex,n=t.questionId;if(s)if(n){var o=ua(n),a=p({},l,{[o]:e});u(a);var h=ig(r,i,e),d=h===df.End,v=[...C,i];if(d||(T(v),S(h),bp(r,{surveySubmissionId:m,responses:a,lastQuestionIndex:h,visitedIndices:v,surveyLanguage:b})),r.enable_partial_responses||d){var c=new Set(v.map((t=>{var e;return null==(e=E[t])?void 0:e.id})).filter((t=>!!t)).map((t=>ua(t)))),f=Object.fromEntries(Object.entries(a).filter((t=>c.has(t[0]))));ap({responses:f,survey:r,surveySubmissionId:m,isSurveyCompleted:d,posthog:s,properties:_,surveyLanguage:b})}}else gf.error("onNextButtonClick called without a questionId.");else gf.error("onNextButtonClick called without a PostHog instance.")})({res:t,displayQuestionIndex:k,questionId:I.id}),onPreviewSubmit:f,initialValue:I.id?l[ua(I.id)]:void 0,canGoBack:M,onBack(){if(y)g();else if(0!==C.length){var t=C[C.length-1],e=C.slice(0,-1);T(e),S(t),bp(r,{surveySubmissionId:m,responses:l,lastQuestionIndex:t,visitedIndices:e,surveyLanguage:b})}}})})]}):null}function yg(t){var e,i,r,n,s,o,a,l=t.survey,u=t.forceDisableHtml,h=t.posthog,d=t.readOnly,v=t.surveyLanguage,c=zc(!0),f=c[0],p=c[1],g=zc(!1),m=g[0],y=g[1],_=zc({}),b=_[0],w=_[1],k=Vc(void 0),S=()=>{y(!m)};if(Wc((()=>{var t;if(h){if(!d){"tab"===(null==(t=l.appearance)?void 0:t.widgetType)&&w({top:"50%",bottom:"auto"});var e=t=>{var e,i=t;(null==(e=i.detail)?void 0:e.surveyId)===l.id&&(gf.info("Received show event for feedback button survey "+l.id),w(i.detail.position||{}),S())};return Ki(og,lg,e),()=>{at(k.current)||(clearTimeout(k.current),k.current=void 0),og.removeEventListener(lg,e)}}}else gf.error("FeedbackWidget called without a PostHog instance.")}),[h,d,l.id,null==(e=l.appearance)?void 0:e.widgetType,null==(i=l.appearance)?void 0:i.widgetSelector,null==(r=l.appearance)?void 0:r.borderColor]),cg({survey:l,setSurveyVisible:p,posthog:h}),!f)return null;var x=()=>{l.schedule!==vf.Always&&p(!1),at(k.current)||clearTimeout(k.current),k.current=setTimeout((()=>{k.current=void 0,y(!1)}),200)};return Ep(uc,{children:["tab"===(null==(n=l.appearance)?void 0:n.widgetType)&&Ep("button",{className:"ph-survey-widget-tab "+((null==(s=l.appearance)?void 0:s.tabPosition)===lf.Top?"widget-tab-top":""),onClick:S,disabled:d,style:pg(null==(o=l.appearance)?void 0:o.tabPosition),children:(null==(a=l.appearance)?void 0:a.widgetLabel)||""}),m&&Ep(gg,{posthog:h,survey:l,forceDisableHtml:u,style:b,onPopupSurveyDismissed:x,onCloseConfirmationMessage:x,surveyLanguage:v})]})}var _g=t=>{var e=t.question,i=t.onSubmit,r=t.onPreviewSubmit,n={forceDisableHtml:t.forceDisableHtml,appearance:t.appearance,onPreviewSubmit(t){r(t)},onSubmit(t){i(t)},initialValue:t.initialValue,displayQuestionIndex:t.displayQuestionIndex,canGoBack:t.canGoBack,onBack:t.onBack};switch(e.type){case hf.Open:return ac(Wp,p({},n,{question:e,key:e.id}));case hf.Link:return ac(Vp,p({},n,{question:e,key:e.id}));case hf.Rating:return ac(Gp,p({},n,{question:e,key:e.id}));case hf.SingleChoice:case hf.MultipleChoice:return ac(Qp,p({},n,{question:e,key:e.id}));default:return gf.error("Unsupported question type: "+e.type),null}};v.__PosthogExtensions__=v.__PosthogExtensions__||{},v.__PosthogExtensions__.generateSurveys=vg,v.extendPostHogWithSurveys=vg;var bg=(t,e,i)=>i.remaining>0?e.length>i.remaining?(t.push(e.slice(0,i.remaining)),i.remaining=0,i.truncated=!0,!1):(t.push(e),i.remaining-=e.length,!0):(i.truncated=!0,!1),wg=(t,e,i)=>{var r=JSON.stringify(t);if(i.remaining>=r.length)return bg(e,r,i);if(i.truncated=!0,2>i.remaining)return!1;for(var n=0,s=Math.min(t.length,i.remaining-2);s>n;){var o=Math.ceil((n+s)/2);JSON.stringify(t.slice(0,o)).length>i.remaining?s=o-1:n=o}return bg(e,JSON.stringify(t.slice(0,n)),i)},kg=t=>void 0!==t&&"function"!=typeof t&&"symbol"!=typeof t&&"bigint"!=typeof t,Sg=(t,e,i)=>{if(!i.truncated){if(i.keysRemaining-=1,i.sizeRemaining-=String(e).length+t.length,0>=i.keysRemaining||0>=i.sizeRemaining)return i.truncated=!0,void(i.result.attributes_truncated=!0);i.result[t]=e}},xg=(t,e,i)=>{if(!i.truncated)if(st(t)){if(i.seen.has(t))return void Sg(e||"circular","[Circular]",i);i.seen.add(t);try{for(var r in t)try{if(!{}.hasOwnProperty.call(t,r))continue;if(xg(t[r],e?e+"."+r:r,i),i.truncated)return}catch(t){continue}}catch(t){}}else Sg(e,t,i)},Cg=function(t,e,i,r,n,s){if(void 0===n&&(n=!1),!kg(t))return!n||bg(e,"null",i);if(ht(t)||(t=>{try{return vt(t)||ft(t)}catch(t){return!1}})(t))return bg(e,JSON.stringify(t),i);if("string"==typeof t)return wg(t,e,i);if(!st(t)&&!rt(t))return bg(e,JSON.stringify(t),i);if(r.has(t))return wg("[Circular]",e,i);r.add(t);try{var o=t.toJSON;if(nt(o))return Cg(o.call(t),e,i,r,n)}catch(t){}try{var a={}.toString.call(t);if("[object String]"===a)return wg(String(t.valueOf()),e,i);if("[object Number]"===a||"[object Boolean]"===a)return bg(e,JSON.stringify(t.valueOf()),i)}catch(t){}if(t instanceof Error){var l={};try{for(var u in t)({}).hasOwnProperty.call(t,u)&&(l[u]=t[u])}catch(t){}try{l.name=t.name}catch(t){}try{l.message=t.message}catch(t){}try{l.stack=t.stack}catch(t){}return Cg(l,e,i,r,n,s)}if(rt(t)){if(!bg(e,"[",i))return!1;for(var h=0;t.length>h;h++){if(h>0&&!bg(e,",",i))return!1;var d=void 0;try{d=t[h]}catch(t){d=void 0}if(!Cg(d,e,i,r,!0))return!1}return bg(e,"]",i)}if(!bg(e,"{",i))return!1;var v=!0;try{for(var c in t)if({}.hasOwnProperty.call(t,c)){if(0>=i.remaining)return i.truncated=!0,!1;var f=void 0;try{f=t[c]}catch(t){continue}if(s)try{xg(f,c,s)}catch(t){}if(kg(f)){var p=(v?"":",")+JSON.stringify(c)+":";if(p.length>=i.remaining)return i.truncated=!0,!1;var g=e.length,m=i.remaining,y=i.truncated;if(!bg(e,p,i))return!1;var _=e.length,b=Cg(f,e,i,r,!1),w=i.truncated;if(e.length!==_){if(v=!1,!b)return!1}else if(e.length=g,i.remaining=m,i.truncated=b?y:w,!b)return!1}}}catch(t){}return bg(e,"}",i)},Tg={debug:"debug",log:"info",warn:"warn",error:"error",info:"info"};v.__PosthogExtensions__=v.__PosthogExtensions__||{},v.__PosthogExtensions__.logs={initializeLogs(t){var e={host:v.location.host},i=!1,r=function(r){var n=v.console[r],s=(n=>function(){for(var s=!1,o=arguments.length,a=new Array(o),l=0;o>l;l++)a[l]=arguments[l];try{if(a.length>0&&!i&&t.is_capturing()){var u;i=!0,s=!0;var h=((t,e)=>{for(var i=[],r={remaining:1e4,truncated:!1},n=st(t[0])?{result:{},keysRemaining:50,sizeRemaining:1e4,truncated:!1,seen:new WeakSet([t[0]])}:void 0,s=0;t.length>s&&(0>=s||bg(i," ",r))&&Cg(t[s],i,r,new WeakSet,!1,0===s?n:void 0);s++);return{body:i.join("")+(r.truncated?"...":""),truncated:r.truncated,attributes:(null==n?void 0:n.result)||{}}})(a),d=h.body,c=h.attributes,f=p({},e,h.truncated?{body_truncated:"true"}:{});null==(u=t.logs)||u.vi({level:Tg[r],body:d,attributes:p({"log.source":"console."+r},f,c)})}}catch(t){}finally{s&&(i=!1),n.apply(v.console,a)}})(n);s.__rrweb_original__=(t=>{for(;null!=(e=t)&&e.__rrweb_original__;){var e;t=t.__rrweb_original__}return t})(n),v.console[r]=s};for(var n of Object.keys(Tg))r(n)}};var Eg=Bi("[Error tracking]"),Mg=["chrome-extension://","moz-extension://","safari-extension:","safari-web-extension:"],Ig=["__firefox__","__gCrWeb"];function Rg(){return new ai([new bi,new Ri,new ki,new wi,new Mi,new Ei,new xi,new Ii],function(t){for(var e=arguments.length,i=new Array(e>1?e-1:0),r=1;e>r;r++)i[r-1]=arguments[r];return function(e,r){void 0===r&&(r=0);for(var n=[],s=e.split("\n"),o=r;s.length>o;o++){var a=s[o];if(1024>=a.length){var l=yi.test(a)?a.replace(yi,"$1"):a;if(!l.match(/\S*Error: /)){for(var u of i){var h=u(l,t);if(h){n.push(h);break}}if(n.length>=_i)break}}}return function(t){if(!t.length)return[];var e=Array.from(t);return e.reverse(),e.slice(0,_i).map((t=>{return p({},t,{filename:t.filename||(i=e,i[i.length-1]||{}).filename,function:t.function||li});var i}))}(n)}}("web:javascript",fi,mi))}var Pg=Bi("[ExceptionAutocapture]"),Ag=Rg(),Og=e=>{var i=t;i||Pg.info("window not available, cannot wrap onerror");var r=i.onerror;return i.onerror=function(){for(var t,i=arguments.length,n=new Array(i),s=0;i>s;s++)n[s]=arguments[s];var o=Ag.buildFromUnknown((t=>{var e=t[0],i=t[1],r=t[2],n=t[3],s=t[4];if(null!=s)return s;if(lt(e)&&lt(i)&&i.length>0&&"undefined"!=typeof ErrorEvent)try{return new ErrorEvent("error",{message:e,filename:i,lineno:r,colno:n})}catch(t){return e}return e})(n),{mechanism:{handled:!1}});return e(o),!!nt(r)&&null!==(t=r(...n))&&void 0!==t&&t},i.onerror.__POSTHOG_INSTRUMENTED__=!0,()=>{var t;null==(t=i.onerror)||delete t.__POSTHOG_INSTRUMENTED__,i.onerror=r}},Fg=function(e,i){void 0===i&&(i=!1);var r=t;r||Pg.info("window not available, cannot wrap onUnhandledRejection");var n=r.onunhandledrejection;return r.onunhandledrejection=function(t){var r,s=Ag.buildFromUnknown(t,{mechanism:{handled:!1}});return e(s),nt(n)?null!==(r=n(t))&&void 0!==r&&r:i},r.onunhandledrejection.__POSTHOG_INSTRUMENTED__=!0,()=>{var t;null==(t=r.onunhandledrejection)||delete t.__POSTHOG_INSTRUMENTED__,r.onunhandledrejection=n}},Lg={wrapOnError:Og,wrapUnhandledRejection:Fg,wrapConsoleError(t){var e=console;e||Pg.info("console not available, cannot wrap console.error");var i=e.error;return e.error=function(){for(var e,r=arguments.length,n=new Array(r),s=0;r>s;s++)n[s]=arguments[s];e=1==n.length?n[0]:n.join(" ");var o=n.find((t=>t instanceof Error)),a=Ag.buildFromUnknown(o||e,{mechanism:{handled:!1},syntheticException:new Error("PostHog syntheticException"),skipFirstLines:2});t(a),nt(i)&&i(...n)},e.error.__POSTHOG_INSTRUMENTED__=!0,()=>{var t;null==(t=e.error)||delete t.__POSTHOG_INSTRUMENTED__,e.error=i}}};v.__PosthogExtensions__=v.__PosthogExtensions__||{},v.__PosthogExtensions__.errorWrappingFunctions=Lg,v.posthogErrorWrappingFunctions=Lg;var $g=(t,e)=>{if(nt(null==t?void 0:t.capture)){var i=null==e?void 0:e.autocaptureExceptions,r=!ht(i)&&"object"==typeof i&&rt(i.errors_to_ignore)?i.errors_to_ignore.reduce(((t,e)=>{try{t.push(new RegExp(e))}catch(t){Pg.error("Ignoring invalid legacy exception exclusion rule",e,t)}return t}),[]):[],n=e=>{try{null==t.capture||t.capture("$exception",e,{_noTruncate:!0,_batchKey:"exceptionEvent",_noHeatmaps:!0})}catch(t){Pg.error("Failed to capture exception for a legacy client",t)}};Og((t=>{r.some((e=>t.$exception_list.some((t=>e.test(t.value||"")))))||n(t)})),Fg(n,!0)}};v.extendPostHogWithExceptionAutoCapture=$g,v.extendPostHogWithExceptionAutocapture=$g;var Dg="X-POSTHOG-SESSION-ID",Ng="X-POSTHOG-WINDOW-ID",qg="X-POSTHOG-DISTINCT-ID",jg=[Dg,Ng,qg],Bg=["attributionReporting","body","browsingTopics","cache","credentials","dispatcher","duplex","integrity","keepalive","method","mode","priority","redirect","referrer","referrerPolicy","signal","window"],Ug=(t,e)=>({}.hasOwnProperty.call(t,e)),Hg=t=>"object"==typeof t&&!ht(t)||nt(t),zg=t=>"undefined"!=typeof Request&&(t instanceof Request||"[object Request]"==={}.toString.call(t)),Wg=e=>{try{var i;return zg(e)?e.url:new URL(e instanceof URL?e.toString():String(e),null==t||null==(i=t.location)?void 0:i.href).toString()}catch(t){return}},Vg=(t,e,i,r,n)=>{var s;try{s=new URL(r).hostname}catch(t){return!1}if(!t)return!1;if(rt(t)&&!t.includes(s))return!1;var o=!1;if(i){var a=i.checkAndGetSessionAndWindowId(!0),l=a.windowId;n.set(Dg,a.sessionId),n.set(Ng,l),o=!0}var u=(t=>nt(t)?t():t)(e);return u&&u!==_s&&(n.set(qg,u),o=!0),o};v.__PosthogExtensions__=v.__PosthogExtensions__||{};var Gg={_patchFetch:(e,i,r)=>cv(t,"fetch",(t=>function(n,s){var o=arguments.length>1?[n,s]:[n],a=o;try{var l=Wg(n);if(l)if(zg(n)){var u=new Request(n,s);Vg(e,i,r,u.url,u.headers),a=[u]}else{var h=new Headers(Hg(s)?s.headers:void 0);if(Vg(e,i,r,l,h)){var d=((t,e)=>{if(at(t)||ht(t))return{headers:e};if(Hg(t)){var i=t;if("undefined"==typeof Proxy||"undefined"==typeof Reflect){var r=Object.create(i);return Object.defineProperty(r,"headers",{configurable:!0,enumerable:!0,value:e,writable:!0}),r}return new Proxy({headers:e},{get:(t,e)=>Ug(t,e)?Reflect.get(t,e):Reflect.get(i,e,i),has:(t,e)=>Ug(t,e)||e in i,ownKeys(t){var e=new Set(Reflect.ownKeys(t));return Reflect.ownKeys(i).forEach((t=>e.add(t))),Bg.forEach((t=>{t in i&&e.add(t)})),Array.from(e)},getOwnPropertyDescriptor(t,e){var r=Reflect.getOwnPropertyDescriptor(t,e);if(r)return r;if("string"==typeof e&&Bg.includes(e)&&e in i)return{configurable:!0,enumerable:!0,get(){return Reflect.get(i,e,i)}};var n=Reflect.getOwnPropertyDescriptor(i,e);return n?p({},n,{configurable:!0}):void 0},getPrototypeOf:()=>Object.getPrototypeOf(i)})}})(s,h);d&&(a=[n,d])}}}catch(t){a=o}return t.apply(this,a)})),_patchXHR:(e,i,r)=>cv(t.XMLHttpRequest.prototype,"open",(t=>function(n,s,o,a,l){void 0===o&&(o=!0);var u=this,h=new Headers,d=Wg(s);d&&Vg(e,i,r,d,h);var v=t.call(u,n,s,o,a,l);return jg.forEach((t=>{var e=h.get(t);if(e)try{u.setRequestHeader(t,e)}catch(t){}})),v}))};v.__PosthogExtensions__.tracingHeadersPatchFns=Gg,v.postHogTracingHeadersPatchFns=Gg,"function"!=typeof[].at&&Object.defineProperty(Array.prototype,"at",{value(t){var e=this.length,i=Math.trunc(t)||0;return 0>i&&(i+=e),0>i||i>=e?void 0:this[i]},writable:!0,enumerable:!1,configurable:!0});let Zg=class{constructor(){this.t=void 0,this.o=0,this.i=[]}l(t){var e;if(!t.hadRecentInput){var i=this.i[0],r=this.i.at(-1);this.o&&i&&r&&1e3>t.startTime-r.startTime&&5e3>t.startTime-i.startTime?(this.o+=t.value,this.i.push(t)):(this.o=t.value,this.i=[t]),null==(e=this.t)||e.call(this,t)}}};var Qg=()=>{var t=performance.getEntriesByType("navigation")[0];if(t&&t.responseStart>0&&t.responseStart<performance.now())return t},Jg=t=>{if("loading"===document.readyState)return"loading";var e=Qg();if(e){if(e.domInteractive>t)return"loading";if(0===e.domContentLoadedEventStart||e.domContentLoadedEventStart>t)return"dom-interactive";if(0===e.domComplete||e.domComplete>t)return"dom-content-loaded"}return"complete"},Kg=t=>{var e=t.nodeName;return 1===t.nodeType?e.toLowerCase():e.toUpperCase().replace(/^#/,"")},Yg=t=>{var e="";try{for(;9!==(null==(i=t)?void 0:i.nodeType);){var i,r,n=t,s=n.id?"#"+n.id:[Kg(n),...Array.from(null!==(r=n.classList)&&void 0!==r?r:[]).sort()].join(".");if(e.length+s.length>99)return e||s;if(e=e?s+">"+e:s,n.id)break;t=n.parentNode}}catch(t){}return e},Xg=new WeakMap;function tm(t,e){var i=Xg.get(e);return i||(i=new WeakMap,Xg.set(e,i)),i.get(t)||i.set(t,new e),i.get(t)}var em=-1,im=()=>em,rm=t=>{addEventListener("pageshow",(e=>{e.persisted&&(em=e.timeStamp,t(e))}),!0)},nm=(t,e,i,r)=>{var n,s;return o=>{e.value>=0&&(o||r)&&((s=e.value-(null!=n?n:0))||void 0===n)&&(n=e.value,e.delta=s,e.rating=((t,e)=>t>e[1]?"poor":t>e[0]?"needs-improvement":"good")(e.value,i),t(e))}},sm=t=>{requestAnimationFrame((()=>requestAnimationFrame(t)))},om=()=>{var t,e;return null!==(t=null==(e=Qg())?void 0:e.activationStart)&&void 0!==t?t:0},am=-1,lm=new Set,um=()=>"hidden"!==document.visibilityState||document.prerendering?1/0:0,hm=t=>{if("hidden"===document.visibilityState){if("visibilitychange"===t.type)for(var e of lm)e();isFinite(am)||(am="visibilitychange"===t.type?t.timeStamp:0,removeEventListener("prerenderingchange",hm,!0))}},dm=function(t){if(void 0===t&&(t=!1),t&&(am=1/0),0>am){var e,i=om(),r=document.prerendering||null==(e=globalThis.performance.getEntriesByType("visibility-state").find((t=>"hidden"===t.name&&t.startTime>=i)))?void 0:e.startTime;am=null!=r?r:um(),addEventListener("visibilitychange",hm,!0),addEventListener("prerenderingchange",hm,!0),rm((()=>{setTimeout((()=>{am=um()}))}))}return{get firstHiddenTime(){return am},onHidden(t){lm.add(t)}}},vm=function(t,e,i,r,n,s,o){void 0===e&&(e=-1),void 0===r&&(r=0);var a=Qg(),l=(null==a?void 0:a.navigationId)||0,u="navigate";return i?u=i:0>im()?a&&(document.prerendering||om()>0?u="prerender":document.wasDiscarded?u="restore":a.type&&(u=a.type.replace(/_/g,"-"))):u="back-forward-cache",{name:t,value:e,rating:"good",delta:0,entries:[],id:"v6-"+Date.now()+"-"+(Math.floor(8999999999999*Math.random())+1e12),navigationType:u,navigationId:r||l,navigationInteractionId:n,navigationURL:s||(null==a?void 0:a.name),navigationStartTime:o||0}},cm=function(t,e,i){void 0===i&&(i={});try{var r=t.filter((t=>PerformanceObserver.supportedEntryTypes.includes(t)));if(r.length>0){var n=new PerformanceObserver((t=>{queueMicrotask((()=>{var i=t.getEntries();r.length>1&&i.sort(((t,e)=>t.startTime+t.duration-(e.startTime+e.duration))),e(i)}))}));for(var s of r)n.observe(p({type:s,buffered:!0},i));return n}}catch(t){}},fm=t=>{var e;return PerformanceObserver.supportedEntryTypes.includes("soft-navigation")&&"function"==typeof(null==(e=globalThis.PerformanceSoftNavigation)||null==(e=e.prototype)?void 0:e.getLargestInteractionContentfulPaint)&&t&&t.reportSoftNavs},pm=(t,e)=>{if(t.set(e.navigationId,e),t.size>2){var i=t.keys().next().value;void 0!==i&&t.delete(i)}},gm=t=>{var e=!1;return()=>{e||(t(),e=!0)}};let mm=class{constructor(){this.u=void 0}};var ym,_m=t=>{document.prerendering?addEventListener("prerenderingchange",t,!0):t()},bm=[1800,3e3],wm=function(t,e){void 0===e&&(e={});var i=fm(e);_m((()=>{var r,n=tm(e,mm),s=dm(),o=vm("FCP"),a=cm(["paint"],(t=>{for(var e of t)"first-contentful-paint"===e.name&&(a.disconnect(),s.firstHiddenTime>e.startTime&&(o.value=Math.max(e.startTime-om(),0),o.entries.push(e),o.navigationId=e.navigationId||o.navigationId,r(!0)))}));a&&(r=nm(t,o,bm,e.reportAllChanges),rm((i=>{o=vm("FCP",-1,"back-forward-cache",o.navigationId,o.navigationInteractionId,o.navigationURL,im()),r=nm(t,o,bm,e.reportAllChanges),sm((()=>{o.value=performance.now()-i.timeStamp,r(!0)}))}))),i&&cm(["soft-navigation"],(i=>{i.forEach((i=>{n.u&&i.navigationId&&pm(n.u,i);var s=Math.max((i.presentationTime||i.paintTime||0)-i.startTime,0);o=vm("FCP",s,"soft-navigation",i.navigationId,i.interactionId,i.name,i.startTime),(r=nm(t,o,bm,e.reportAllChanges))(!0)}))}),e)}))},km=[.1,.25],Sm=t=>t.find((t=>{var e;return 1===(null==(e=t.node)?void 0:e.nodeType)}))||t[0],xm=0,Cm=1/0,Tm=0,Em=t=>{for(var e of t)e.interactionId&&(Cm=Math.min(Cm,e.interactionId),Tm=Math.max(Tm,e.interactionId),xm=Tm?(Tm-Cm)/7+1:0)},Mm=()=>{var t;return ym?xm:null!==(t=performance.interactionCount)&&void 0!==t?t:0},Im=0;let Rm=class{constructor(){this.h=[],this.v=new Map,this.p=void 0,this.m=void 0}M(){Im=Mm(),this.h.length=0,this.v.clear()}T(t){var e=Mm()-Im,i=Math.min(this.h.length-1,Math.floor(e/50));return!e||-1!==i||"soft-navigation"!==t&&"back-forward-cache"!==t?this.h[i]:{D:8,id:-1,entries:[]}}l(t){var e;if(null!=(e=this.p)&&e.call(this,t),t.interactionId||"first-input"===t.entryType){var i=this.h.at(-1),r=this.v.get(t.interactionId);if(r||10>this.h.length||t.duration>i.D){var n;if(r?t.duration>r.D?(r.entries=[t],r.D=t.duration):t.duration===r.D&&t.startTime===r.entries[0].startTime&&r.entries.push(t):(this.v.set((r={id:t.interactionId,entries:[t],D:t.duration}).id,r),this.h.push(r)),this.h.sort(((t,e)=>e.D-t.D)),this.h.length>10){var s=this.h.splice(10);for(var o of s)this.v.delete(o.id)}null==(n=this.m)||n.call(this,r)}}}};var Pm=t=>{var e="requestIdleCallback"in globalThis?1e3:0,i=globalThis.requestIdleCallback||setTimeout,r=globalThis.cancelIdleCallback||clearTimeout;if("hidden"===document.visibilityState)t();else{var n=gm(t),s=-1,o=()=>{r(s),n()};addEventListener("visibilitychange",o,{once:!0,capture:!0}),s=i((()=>{removeEventListener("visibilitychange",o,{capture:!0}),n()}),{timeout:e})}},Am=[200,500];let Om=class{constructor(){this.p=void 0,this.u=void 0}l(t){var e;null==(e=this.p)||e.call(this,t)}};var Fm=[2500,4e3],Lm=-1,$m=()=>Lm,Dm=t=>{addEventListener("pageshow",(e=>{e.persisted&&(Lm=e.timeStamp,t(e))}),!0)},Nm=(t,e,i,r)=>{var n,s;return o=>{e.value>=0&&(o||r)&&((s=e.value-(null!=n?n:0))||void 0===n)&&(n=e.value,e.delta=s,e.rating=((t,e)=>t>e[1]?"poor":t>e[0]?"needs-improvement":"good")(e.value,i),t(e))}},qm=t=>{requestAnimationFrame((()=>requestAnimationFrame(t)))},jm=()=>{var t=performance.getEntriesByType("navigation")[0];if(t&&t.responseStart>0&&t.responseStart<performance.now())return t},Bm=()=>{var t,e;return null!==(t=null==(e=jm())?void 0:e.activationStart)&&void 0!==t?t:0},Um=-1,Hm=new Set,zm=()=>"hidden"!==document.visibilityState||document.prerendering?1/0:0,Wm=t=>{if("hidden"===document.visibilityState){if("visibilitychange"===t.type)for(var e of Hm)e();isFinite(Um)||(Um="visibilitychange"===t.type?t.timeStamp:0,removeEventListener("prerenderingchange",Wm,!0))}},Vm=function(t){if(void 0===t&&(t=!1),t&&(Um=1/0),0>Um){var e,i=Bm(),r=document.prerendering||null==(e=globalThis.performance.getEntriesByType("visibility-state").find((t=>"hidden"===t.name&&t.startTime>=i)))?void 0:e.startTime;Um=null!=r?r:zm(),addEventListener("visibilitychange",Wm,!0),addEventListener("prerenderingchange",Wm,!0),Dm((()=>{setTimeout((()=>{Um=zm()}))}))}return{get firstHiddenTime(){return Um},onHidden(t){Hm.add(t)}}},Gm=function(t,e,i,r,n,s,o){void 0===e&&(e=-1),void 0===r&&(r=0);var a=jm(),l=(null==a?void 0:a.navigationId)||0,u="navigate";return i?u=i:0>$m()?a&&(document.prerendering||Bm()>0?u="prerender":document.wasDiscarded?u="restore":a.type&&(u=a.type.replace(/_/g,"-"))):u="back-forward-cache",{name:t,value:e,rating:"good",delta:0,entries:[],id:"v6-"+Date.now()+"-"+(Math.floor(8999999999999*Math.random())+1e12),navigationType:u,navigationId:r||l,navigationInteractionId:n,navigationURL:s||(null==a?void 0:a.name),navigationStartTime:o||0}},Zm=new WeakMap;function Qm(t,e){var i=Zm.get(e);return i||(i=new WeakMap,Zm.set(e,i)),i.get(t)||i.set(t,new e),i.get(t)}let Jm=class{constructor(){this.t=void 0,this.i=0,this.o=[]}h(t){var e;if(!t.hadRecentInput){var i=this.o[0],r=this.o.at(-1);this.i&&i&&r&&1e3>t.startTime-r.startTime&&5e3>t.startTime-i.startTime?(this.i+=t.value,this.o.push(t)):(this.i=t.value,this.o=[t]),null==(e=this.t)||e.call(this,t)}}};var Km=function(t,e,i){void 0===i&&(i={});try{var r=t.filter((t=>PerformanceObserver.supportedEntryTypes.includes(t)));if(r.length>0){var n=new PerformanceObserver((t=>{queueMicrotask((()=>{var i=t.getEntries();r.length>1&&i.sort(((t,e)=>t.startTime+t.duration-(e.startTime+e.duration))),e(i)}))}));for(var s of r)n.observe(p({type:s,buffered:!0},i));return n}}catch(t){}},Ym=t=>{var e;return PerformanceObserver.supportedEntryTypes.includes("soft-navigation")&&"function"==typeof(null==(e=globalThis.PerformanceSoftNavigation)||null==(e=e.prototype)?void 0:e.getLargestInteractionContentfulPaint)&&t&&t.reportSoftNavs},Xm=(t,e)=>{if(t.set(e.navigationId,e),t.size>2){var i=t.keys().next().value;void 0!==i&&t.delete(i)}},ty=t=>{var e=!1;return()=>{e||(t(),e=!0)}};let ey=class{constructor(){this.l=void 0}};var iy,ry=t=>{document.prerendering?addEventListener("prerenderingchange",t,!0):t()},ny=[1800,3e3],sy=function(t,e){void 0===e&&(e={});var i=Ym(e);ry((()=>{var r,n=Qm(e,ey),s=Vm(),o=Gm("FCP"),a=Km(["paint"],(t=>{for(var e of t)"first-contentful-paint"===e.name&&(a.disconnect(),s.firstHiddenTime>e.startTime&&(o.value=Math.max(e.startTime-Bm(),0),o.entries.push(e),o.navigationId=e.navigationId||o.navigationId,r(!0)))}));a&&(r=Nm(t,o,ny,e.reportAllChanges),Dm((i=>{o=Gm("FCP",-1,"back-forward-cache",o.navigationId,o.navigationInteractionId,o.navigationURL,$m()),r=Nm(t,o,ny,e.reportAllChanges),qm((()=>{o.value=performance.now()-i.timeStamp,r(!0)}))}))),i&&Km(["soft-navigation"],(i=>{i.forEach((i=>{n.l&&i.navigationId&&Xm(n.l,i);var s=Math.max((i.presentationTime||i.paintTime||0)-i.startTime,0);o=Gm("FCP",s,"soft-navigation",i.navigationId,i.interactionId,i.name,i.startTime),(r=Nm(t,o,ny,e.reportAllChanges))(!0)}))}),e)}))},oy=[.1,.25],ay=function(t,e){void 0===e&&(e={});var i=Vm();sy(ty((()=>{var r,n=Gm("CLS",0),s=Qm(e,Jm),o=(i,o,a,l,u)=>{n=Gm("CLS",0,i,o,a,l,u),s.i=0,r=Nm(t,n,oy,e.reportAllChanges)},a=function(t){void 0===t&&(t=!1),s.i>n.value&&(n.value=s.i,n.entries=s.o),r(t)},l=t=>{a(!0),o("soft-navigation",t.navigationId,t.interactionId,t.name,t.startTime)},u=t=>{for(var e of t)"soft-navigation"!==e.entryType?s.h(e):l(e);a()},h=["layout-shift"];Ym(e)&&h.push("soft-navigation");var d=Km(h,u);d&&(r=Nm(t,n,oy,e.reportAllChanges),i.onHidden((()=>{u(d.takeRecords()),r(!0)})),Dm((()=>{o("back-forward-cache",n.navigationId,n.navigationInteractionId,n.navigationURL,$m()),qm(r)})),setTimeout(r))})))},ly=0,uy=1/0,hy=0,dy=t=>{for(var e of t)e.interactionId&&(uy=Math.min(uy,e.interactionId),hy=Math.max(hy,e.interactionId),ly=hy?(hy-uy)/7+1:0)},vy=()=>{var t;return iy?ly:null!==(t=performance.interactionCount)&&void 0!==t?t:0},cy=0;let fy=class{constructor(){this.u=[],this.v=new Map,this.m=void 0,this.p=void 0}T(){cy=vy(),this.u.length=0,this.v.clear()}M(t){var e=vy()-cy,i=Math.min(this.u.length-1,Math.floor(e/50));return!e||-1!==i||"soft-navigation"!==t&&"back-forward-cache"!==t?this.u[i]:{_:8,id:-1,entries:[]}}h(t){var e;if(null!=(e=this.m)&&e.call(this,t),t.interactionId||"first-input"===t.entryType){var i=this.u.at(-1),r=this.v.get(t.interactionId);if(r||10>this.u.length||t.duration>i._){var n;if(r?t.duration>r._?(r.entries=[t],r._=t.duration):t.duration===r._&&t.startTime===r.entries[0].startTime&&r.entries.push(t):(this.v.set((r={id:t.interactionId,entries:[t],_:t.duration}).id,r),this.u.push(r)),this.u.sort(((t,e)=>e._-t._)),this.u.length>10){var s=this.u.splice(10);for(var o of s)this.v.delete(o.id)}null==(n=this.p)||n.call(this,r)}}}};var py=t=>{var e="requestIdleCallback"in globalThis?1e3:0,i=globalThis.requestIdleCallback||setTimeout,r=globalThis.cancelIdleCallback||clearTimeout;if("hidden"===document.visibilityState)t();else{var n=ty(t),s=-1,o=()=>{r(s),n()};addEventListener("visibilitychange",o,{once:!0,capture:!0}),s=i((()=>{removeEventListener("visibilitychange",o,{capture:!0}),n()}),{timeout:e})}},gy=[200,500],my=function(t,e){if(void 0===e&&(e={}),globalThis.PerformanceEventTiming&&"interactionId"in PerformanceEventTiming.prototype){var i=Vm();ry((()=>{var r;"interactionCount"in performance||iy||(iy=Km(["event"],dy,{durationThreshold:0}));var n,s=Gm("INP"),o=Qm(e,fy),a=(i,r,a,l,u)=>{o.T(),s=Gm("INP",-1,i,r,a,l,u),n=Nm(t,s,gy,e.reportAllChanges)},l=()=>{var t=o.M(s.navigationType);t&&t._!==s.value&&(s.value=t._,s.entries=t.entries,n())},u=t=>{l(),n(!0),a("soft-navigation",t.navigationId,t.interactionId,t.name,t.startTime)},h=function(t,e){void 0===e&&(e=!1),py((()=>{for(var i of t)"soft-navigation"!==i.entryType?o.h(i):u(i);l(),e&&n(!0)}))},d=["event","first-input"];Ym(e)&&d.push("soft-navigation");var v=Km(d,h,p({},e,{durationThreshold:null!==(r=e.durationThreshold)&&void 0!==r?r:40}));n=Nm(t,s,gy,e.reportAllChanges),v&&(i.onHidden((()=>{h(v.takeRecords(),!0)})),Dm((()=>{a("back-forward-cache",s.navigationId,s.navigationInteractionId,s.navigationURL,$m())})))}))}};let yy=class{constructor(){this.m=void 0,this.l=void 0}h(t){var e;null==(e=this.m)||e.call(this,t)}};var _y=[2500,4e3],by=function(t,e){void 0===e&&(e={});var i=!1,r=Ym(e);ry((()=>{var n,s=Vm(),o=Gm("LCP"),a=Qm(e,yy),l=(r,a,l,u,h)=>{o=Gm("LCP",-1,r,a,l,u,h),n=Nm(t,o,_y,e.reportAllChanges),i=!1,"soft-navigation"===r&&(s=Vm(!0))},u=t=>{a.l&&t.navigationId&&Xm(a.l,t),i||n(!0),l("soft-navigation",t.navigationId,t.interactionId,t.name,t.startTime);var e=null==t.getLargestInteractionContentfulPaint?void 0:t.getLargestInteractionContentfulPaint();e&&h([e])},h=t=>{for(var i of(e.reportAllChanges||r||(t=t.slice(-1)),t))if(i)if("soft-navigation"!==i.entryType){var l=0,h=[],d=i.startTime;if("largest-contentful-paint"===i.entryType)l=Math.max(i.startTime-Bm(),0),a.h(i),h=[i];else if("interaction-contentful-paint"===i.entryType){var v,c=i;if(!o.navigationId)continue;if("interactionId"in c&&c.interactionId!=o.navigationInteractionId)continue;d=(null==(v=c.largestContentfulPaint)?void 0:v.renderTime)||0,l=Math.max(d-i.startTime,0),c.largestContentfulPaint&&(a.h(c.largestContentfulPaint),h=[c.largestContentfulPaint])}s.firstHiddenTime>d&&(o.value=l,o.entries=h,n())}else u(i)},d=["largest-contentful-paint"];r&&d.push("interaction-contentful-paint","soft-navigation");var v=Km(d,h);if(v){n=Nm(t,o,_y,e.reportAllChanges);var c=["keydown","click","visibilitychange"],f=t=>{if(t.isTrusted&&!i){var e=o.id;py((()=>{if(!i){if(!r)for(var t of(v.disconnect(),c))removeEventListener(t,f,{capture:!0});e===o.id&&(i=!0,n(!0))}}))}};for(var p of c)addEventListener(p,f,{capture:!0});Dm((r=>{l("back-forward-cache",o.navigationId,o.navigationInteractionId,o.navigationURL,$m()),n=Nm(t,o,_y,e.reportAllChanges),qm((()=>{o.value=performance.now()-r.timeStamp,i=!0,n(!0)}))}))}}))},wy={onLCP(t,e){void 0===e&&(e={});var i=tm(e=Object.assign({},e),Om),r=new WeakMap;fm(e)&&(i.u=new Map),i.p=t=>{var i=t.element;if(i){var n,s=null!==(n=null==e.generateTarget?void 0:e.generateTarget(i))&&void 0!==n?n:Yg(i);r.set(t,s)}else t.id&&r.set(t,"#"+t.id)},function(t,e){void 0===e&&(e={});var i=!1,r=fm(e);_m((()=>{var n,s=dm(),o=vm("LCP"),a=tm(e,Om),l=(r,a,l,u,h)=>{o=vm("LCP",-1,r,a,l,u,h),n=nm(t,o,Fm,e.reportAllChanges),i=!1,"soft-navigation"===r&&(s=dm(!0))},u=t=>{a.u&&t.navigationId&&pm(a.u,t),i||n(!0),l("soft-navigation",t.navigationId,t.interactionId,t.name,t.startTime);var e=null==t.getLargestInteractionContentfulPaint?void 0:t.getLargestInteractionContentfulPaint();e&&h([e])},h=t=>{for(var i of(e.reportAllChanges||r||(t=t.slice(-1)),t))if(i)if("soft-navigation"!==i.entryType){var l=0,h=[],d=i.startTime;if("largest-contentful-paint"===i.entryType)l=Math.max(i.startTime-om(),0),a.l(i),h=[i];else if("interaction-contentful-paint"===i.entryType){var v,c=i;if(!o.navigationId)continue;if("interactionId"in c&&c.interactionId!=o.navigationInteractionId)continue;d=(null==(v=c.largestContentfulPaint)?void 0:v.renderTime)||0,l=Math.max(d-i.startTime,0),c.largestContentfulPaint&&(a.l(c.largestContentfulPaint),h=[c.largestContentfulPaint])}s.firstHiddenTime>d&&(o.value=l,o.entries=h,n())}else u(i)},d=["largest-contentful-paint"];r&&d.push("interaction-contentful-paint","soft-navigation");var v=cm(d,h);if(v){n=nm(t,o,Fm,e.reportAllChanges);var c=["keydown","click","visibilitychange"],f=t=>{if(t.isTrusted&&!i){var e=o.id;Pm((()=>{if(!i){if(!r)for(var t of(v.disconnect(),c))removeEventListener(t,f,{capture:!0});e===o.id&&(i=!0,n(!0))}}))}};for(var p of c)addEventListener(p,f,{capture:!0});rm((r=>{l("back-forward-cache",o.navigationId,o.navigationInteractionId,o.navigationURL,im()),n=nm(t,o,Fm,e.reportAllChanges),sm((()=>{o.value=performance.now()-r.timeStamp,i=!0,n(!0)}))}))}}))}((e=>{t((t=>{var e={timeToFirstByte:0,resourceLoadDelay:0,resourceLoadDuration:0,elementRenderDelay:t.value};if(t.entries.length){var n,s,o,a,l,u,h=t.entries.at(-1),d=h.url&&performance.getEntriesByType("resource").find((t=>t.name===h.url));e.target=r.get(h),e.lcpEntry=h,h.url&&(e.url=h.url),d&&(e.lcpResourceEntry=d);var v=0,c=0;if("soft-navigation"!==t.navigationType?(v=null!==(n=null==(s=u=Qg())?void 0:s.activationStart)&&void 0!==n?n:0,c=null!==(o=null==(a=u)?void 0:a.responseStart)&&void 0!==o?o:0):(v=t.navigationStartTime||0,u=null==(l=i.u)?void 0:l.get(t.navigationId)),u){var f=Math.max(0,c-v),g=Math.max(f,d?(d.requestStart||d.startTime)-v:0),m=Math.min(t.value,Math.max(g,d?d.responseEnd-v:0));e=p({},e,{timeToFirstByte:f,resourceLoadDelay:g-f,resourceLoadDuration:m-g,elementRenderDelay:t.value-m,navigationEntry:u})}}return Object.assign(t,{attribution:e})})(e))}),e)},onCLS(t,e){void 0===e&&(e={});var i=tm(e=Object.assign({},e),Zg),r=new WeakMap;i.t=t=>{var i;if(null!=t&&null!=(i=t.sources)&&i.length){var n=Sm(t.sources),s=null==n?void 0:n.node;if(s){var o,a=null!==(o=null==e.generateTarget?void 0:e.generateTarget(s))&&void 0!==o?o:Yg(s);r.set(n,a)}}},function(t,e){void 0===e&&(e={});var i=dm();wm(gm((()=>{var r,n=vm("CLS",0),s=tm(e,Zg),o=(i,o,a,l,u)=>{n=vm("CLS",0,i,o,a,l,u),s.o=0,r=nm(t,n,km,e.reportAllChanges)},a=function(t){void 0===t&&(t=!1),s.o>n.value&&(n.value=s.o,n.entries=s.i),r(t)},l=t=>{a(!0),o("soft-navigation",t.navigationId,t.interactionId,t.name,t.startTime)},u=t=>{for(var e of t)"soft-navigation"!==e.entryType?s.l(e):l(e);a()},h=["layout-shift"];fm(e)&&h.push("soft-navigation");var d=cm(h,u);d&&(r=nm(t,n,km,e.reportAllChanges),i.onHidden((()=>{u(d.takeRecords()),r(!0)})),rm((()=>{o("back-forward-cache",n.navigationId,n.navigationInteractionId,n.navigationURL,im()),sm(r)})),setTimeout(r))})))}((e=>{t((t=>{var e={};if(t.entries.length){var i,n=t.entries.reduce(((t,e)=>t.value>e.value?t:e));if(null!=n&&null!=(i=n.sources)&&i.length){var s=Sm(n.sources);s&&(e={largestShiftTarget:r.get(s),largestShiftTime:n.startTime,largestShiftValue:n.value,largestShiftSource:s,largestShiftEntry:n,loadState:Jg(n.startTime)})}}return Object.assign(t,{attribution:e})})(e))}),e)},onFCP(t,e){void 0===e&&(e={});var i=tm(e=Object.assign({},e),mm);fm(e)&&(i.u=new Map),wm((e=>{t((t=>{var e={timeToFirstByte:0,firstByteToFCP:t.value,loadState:Jg(im())};if("soft-navigation"!==t.navigationType){if(t.entries.length){var r=Qg(),n=t.entries.at(-1);if(r){var s=Math.max(0,r.responseStart-(r.activationStart||0));e={timeToFirstByte:s,firstByteToFCP:t.value-s,loadState:Jg(t.entries[0].startTime),navigationEntry:r,fcpEntry:n}}}}else{var o,a=null==(o=i.u)?void 0:o.get(t.navigationId);a&&(e={timeToFirstByte:0,firstByteToFCP:t.value,loadState:"complete",navigationEntry:a})}return Object.assign(t,{attribution:e})})(e))}),e)},onINP(t,e){void 0===e&&(e={});var i=tm(e=Object.assign({},e),Rm),r=[],n=[],s=0,o=new WeakMap,a=new WeakMap,l=!1,u=()=>{l||(Pm(h),l=!0)},h=()=>{var t=new Set(i.h.map((t=>o.get(t.entries[0])))),e=n.length-10;n=n.filter(((i,r)=>r>=e||t.has(i)));var a=new Set;for(var u of n){var h=d(u.startTime,u.processingEnd);for(var v of h)a.add(v)}r=r.filter((t=>t.startTime>s||a.has(t))),l=!1};i.p=t=>{var i,r=t.startTime+t.duration;s=Math.max(s,t.processingEnd);for(var a=n.length-1;a>=0;a--){var l=n[a];if(8>=Math.abs(r-l.renderTime)){(i=l).startTime=Math.min(t.startTime,i.startTime),i.processingStart=Math.min(t.processingStart,i.processingStart),i.processingEnd=Math.max(t.processingEnd,i.processingEnd),e.includeProcessedEventEntries&&i.entries.push(t);break}}i||n.push(i={startTime:t.startTime,processingStart:t.processingStart,processingEnd:t.processingEnd,renderTime:r,entries:e.includeProcessedEventEntries?[t]:[]}),(t.interactionId||"first-input"===t.entryType)&&o.set(t,i),u()},i.m=t=>{if(!a.get(t)){var i,r=null==(i=t.entries.find((t=>t.target)))?void 0:i.target;if(r){var n,s=null!==(n=null==e.generateTarget?void 0:e.generateTarget(r))&&void 0!==n?n:Yg(r);a.set(t,s)}else{var o,l=null==(o=t.entries.find((t=>t.targetSelector)))?void 0:o.targetSelector;l&&a.set(t,l)}}};var d=(t,e)=>{var i=[];for(var n of r)if(n.startTime+n.duration>=t){if(n.startTime>e)break;i.push(n)}return i};cm(["long-animation-frame"],(t=>{r=r.concat(t),u()}),e),function(t,e){if(void 0===e&&(e={}),globalThis.PerformanceEventTiming&&"interactionId"in PerformanceEventTiming.prototype){var i=dm();_m((()=>{var r;"interactionCount"in performance||ym||(ym=cm(["event"],Em,{durationThreshold:0}));var n,s=vm("INP"),o=tm(e,Rm),a=(i,r,a,l,u)=>{o.M(),s=vm("INP",-1,i,r,a,l,u),n=nm(t,s,Am,e.reportAllChanges)},l=()=>{var t=o.T(s.navigationType);t&&t.D!==s.value&&(s.value=t.D,s.entries=t.entries,n())},u=t=>{l(),n(!0),a("soft-navigation",t.navigationId,t.interactionId,t.name,t.startTime)},h=function(t,e){void 0===e&&(e=!1),Pm((()=>{for(var i of t)"soft-navigation"!==i.entryType?o.l(i):u(i);l(),e&&n(!0)}))},d=["event","first-input"];fm(e)&&d.push("soft-navigation");var v=cm(d,h,p({},e,{durationThreshold:null!==(r=e.durationThreshold)&&void 0!==r?r:40}));n=nm(t,s,Am,e.reportAllChanges),v&&(i.onHidden((()=>{h(v.takeRecords(),!0)})),rm((()=>{a("back-forward-cache",s.navigationId,s.navigationInteractionId,s.navigationURL,im())})))}))}}((e=>{t((t=>{if(0===t.entries.length){var e={processedEventEntries:[],longAnimationFrameEntries:[],inputDelay:0,processingDuration:0,presentationDelay:t.value,loadState:Jg(t.navigationStartTime||0)};return Object.assign(t,{attribution:e})}var r=t.entries[0],n=o.get(r),s=n.processingStart,l=Math.max(r.startTime+r.duration,s),u=Math.min(n.processingEnd,l),h=n.entries.sort(((t,e)=>t.processingStart-e.processingStart)),v=d(r.startTime,u),c=i.v.get(r.interactionId),f={interactionTarget:a.get(c),interactionType:r.name.startsWith("key")?"keyboard":"pointer",interactionTime:r.startTime,nextPaintTime:l,processedEventEntries:h,longAnimationFrameEntries:v,inputDelay:s-r.startTime,processingDuration:u-s,presentationDelay:l-u,loadState:Jg(r.startTime),longestScript:void 0,totalScriptDuration:void 0,totalStyleAndLayoutDuration:void 0,totalPaintDuration:void 0,totalUnattributedDuration:void 0};return((t,e)=>{var i=t.interactionTime,r=t.nextPaintTime;if(null!=(e=t.longAnimationFrameEntries)&&e.length&&i&&r){var n,s,o=t.inputDelay,a=t.processingDuration,l=0,u=0,h=0,d=0;for(var v of t.longAnimationFrameEntries)for(var c of(u=u+v.startTime+v.duration-v.styleAndLayoutStart,v.scripts)){var f=c.startTime+c.duration;if(f>=i){var p=f-Math.max(i,c.startTime),g=c.duration?p/c.duration*c.forcedStyleAndLayoutDuration:0;l+=p-g,u+=g,p>d&&(s=i+o>c.startTime?"input-delay":i+o+a>c.startTime?"processing-duration":"presentation-delay",n=c,d=p)}}var m=t.longAnimationFrameEntries.at(-1),y=m?m.startTime+m.duration:0;y>=i+o+a&&(h=r-y),n&&s&&(t.longestScript={entry:n,subpart:s,intersectingDuration:d}),t.totalScriptDuration=l,t.totalStyleAndLayoutDuration=u,t.totalPaintDuration=h,t.totalUnattributedDuration=r-i-l-u-h}})(f),Object.assign(t,{attribution:f})})(e))}),e)},withoutAttribution:{onLCP:by,onCLS:ay,onFCP:sy,onINP:my}};v.__PosthogExtensions__=v.__PosthogExtensions__||{},v.__PosthogExtensions__.postHogWebVitalsCallbacksByFlavor=v.__PosthogExtensions__.postHogWebVitalsCallbacksByFlavor||{},v.__PosthogExtensions__.postHogWebVitalsCallbacksByFlavor["web-vitals-with-attribution-soft-navs"]=wy,v.__PosthogExtensions__.postHogWebVitalsCallbacks=wy,v.postHogWebVitalsCallbacks=wy;var ky={onLCP:by,onCLS:ay,onFCP:sy,onINP:my};v.__PosthogExtensions__=v.__PosthogExtensions__||{},v.__PosthogExtensions__.postHogWebVitalsCallbacksByFlavor=v.__PosthogExtensions__.postHogWebVitalsCallbacksByFlavor||{},v.__PosthogExtensions__.postHogWebVitalsCallbacksByFlavor["web-vitals-soft-navs"]=ky,v.__PosthogExtensions__.postHogWebVitalsCallbacks=ky,v.postHogWebVitalsCallbacks=ky,v.__PosthogExtensions__.loadWebVitalsCallbacks=()=>ky;let Sy=class{constructor(){this.t=void 0,this.o=0,this.i=[]}u(t){var e;if(!t.hadRecentInput){var i=this.i[0],r=this.i.at(-1);this.o&&i&&r&&1e3>t.startTime-r.startTime&&5e3>t.startTime-i.startTime?(this.o+=t.value,this.i.push(t)):(this.o=t.value,this.i=[t]),null==(e=this.t)||e.call(this,t)}}};var xy=()=>{var t=performance.getEntriesByType("navigation")[0];if(t&&t.responseStart>0&&t.responseStart<performance.now())return t},Cy=t=>{if("loading"===document.readyState)return"loading";var e=xy();if(e){if(e.domInteractive>t)return"loading";if(0===e.domContentLoadedEventStart||e.domContentLoadedEventStart>t)return"dom-interactive";if(0===e.domComplete||e.domComplete>t)return"dom-content-loaded"}return"complete"},Ty=t=>{var e=t.nodeName;return 1===t.nodeType?e.toLowerCase():e.toUpperCase().replace(/^#/,"")},Ey=t=>{var e="";try{for(;9!==(null==(i=t)?void 0:i.nodeType);){var i,r=t,n=r.id?"#"+r.id:[Ty(r),...Array.from(r.classList).sort()].join(".");if(e.length+n.length>99)return e||n;if(e=e?n+">"+e:n,r.id)break;t=r.parentNode}}catch(t){}return e},My=new WeakMap;function Iy(t,e){var i=My.get(e);return i||(i=new WeakMap,My.set(e,i)),i.get(t)||i.set(t,new e),i.get(t)}var Ry,Py=-1,Ay=()=>Py,Oy=t=>{addEventListener("pageshow",(e=>{e.persisted&&(Py=e.timeStamp,t(e))}),!0)},Fy=(t,e,i,r)=>{var n,s;return o=>{e.value>=0&&(o||r)&&((s=e.value-(null!=n?n:0))||void 0===n)&&(n=e.value,e.delta=s,e.rating=((t,e)=>t>e[1]?"poor":t>e[0]?"needs-improvement":"good")(e.value,i),t(e))}},Ly=t=>{requestAnimationFrame((()=>requestAnimationFrame(t)))},$y=()=>{var t,e;return null!==(t=null==(e=xy())?void 0:e.activationStart)&&void 0!==t?t:0},Dy=function(t,e){void 0===e&&(e=-1);var i=xy(),r="navigate";return 0>Ay()?i&&(document.prerendering||$y()>0?r="prerender":document.wasDiscarded?r="restore":i.type&&(r=i.type.replace(/_/g,"-"))):r="back-forward-cache",{name:t,value:e,rating:"good",delta:0,entries:[],id:"v5-"+Date.now()+"-"+(Math.floor(8999999999999*Math.random())+1e12),navigationType:r}},Ny=function(t,e,i){void 0===i&&(i={});try{if(PerformanceObserver.supportedEntryTypes.includes(t)){var r=new PerformanceObserver((t=>{queueMicrotask((()=>{e(t.getEntries())}))}));return r.observe(p({type:t,buffered:!0},i)),r}}catch(t){}},qy=t=>{var e=!1;return()=>{e||(t(),e=!0)}},jy=-1,By=new Set,Uy=()=>"hidden"!==document.visibilityState||document.prerendering?1/0:0,Hy=t=>{if("hidden"===document.visibilityState){if("visibilitychange"===t.type)for(var e of By)e();isFinite(jy)||(jy="visibilitychange"===t.type?t.timeStamp:0,removeEventListener("prerenderingchange",Hy,!0))}},zy=()=>{if(0>jy){var t,e=$y(),i=document.prerendering||null==(t=globalThis.performance.getEntriesByType("visibility-state").find((t=>"hidden"===t.name&&t.startTime>=e)))?void 0:t.startTime;jy=null!=i?i:Uy(),addEventListener("visibilitychange",Hy,!0),addEventListener("prerenderingchange",Hy,!0),Oy((()=>{setTimeout((()=>{jy=Uy()}))}))}return{get firstHiddenTime(){return jy},onHidden(t){By.add(t)}}},Wy=t=>{document.prerendering?addEventListener("prerenderingchange",t,!0):t()},Vy=[1800,3e3],Gy=function(t,e){void 0===e&&(e={}),Wy((()=>{var i,r=zy(),n=Dy("FCP"),s=Ny("paint",(t=>{for(var e of t)"first-contentful-paint"===e.name&&(s.disconnect(),r.firstHiddenTime>e.startTime&&(n.value=Math.max(e.startTime-$y(),0),n.entries.push(e),i(!0)))}));s&&(i=Fy(t,n,Vy,e.reportAllChanges),Oy((r=>{n=Dy("FCP"),i=Fy(t,n,Vy,e.reportAllChanges),Ly((()=>{n.value=performance.now()-r.timeStamp,i(!0)}))})))}))},Zy=[.1,.25],Qy=t=>t.find((t=>{var e;return 1===(null==(e=t.node)?void 0:e.nodeType)}))||t[0],Jy=0,Ky=1/0,Yy=0,Xy=t=>{for(var e of t)e.interactionId&&(Ky=Math.min(Ky,e.interactionId),Yy=Math.max(Yy,e.interactionId),Jy=Yy?(Yy-Ky)/7+1:0)},t_=()=>{var t;return Ry?Jy:null!==(t=performance.interactionCount)&&void 0!==t?t:0},e_=0;let i_=class{constructor(){this.l=[],this.h=new Map,this.m=void 0,this.p=void 0}v(){e_=t_(),this.l.length=0,this.h.clear()}M(){var t=Math.min(this.l.length-1,Math.floor((t_()-e_)/50));return this.l[t]}u(t){var e;if(null!=(e=this.m)&&e.call(this,t),t.interactionId||"first-input"===t.entryType){var i=this.l.at(-1),r=this.h.get(t.interactionId);if(r||10>this.l.length||t.duration>i.T){var n;if(r?t.duration>r.T?(r.entries=[t],r.T=t.duration):t.duration===r.T&&t.startTime===r.entries[0].startTime&&r.entries.push(t):(this.h.set((r={id:t.interactionId,entries:[t],T:t.duration}).id,r),this.l.push(r)),this.l.sort(((t,e)=>e.T-t.T)),this.l.length>10){var s=this.l.splice(10);for(var o of s)this.h.delete(o.id)}null==(n=this.p)||n.call(this,r)}}}};var r_=t=>{var e=globalThis.requestIdleCallback||setTimeout,i=globalThis.cancelIdleCallback||clearTimeout;if("hidden"===document.visibilityState)t();else{var r=qy(t),n=-1,s=()=>{i(n),r()};addEventListener("visibilitychange",s,{once:!0,capture:!0}),n=e((()=>{removeEventListener("visibilitychange",s,{capture:!0}),r()}))}},n_=[200,500];let s_=class{constructor(){this.m=void 0}u(t){var e;null==(e=this.m)||e.call(this,t)}};var $=[2500,4e3],o_=-1,a_=t=>{addEventListener("pageshow",(e=>{e.persisted&&(o_=e.timeStamp,t(e))}),!0)},l_=(t,e,i,r)=>{var n,s;return o=>{e.value>=0&&(o||r)&&((s=e.value-(null!=n?n:0))||void 0===n)&&(n=e.value,e.delta=s,e.rating=((t,e)=>t>e[1]?"poor":t>e[0]?"needs-improvement":"good")(e.value,i),t(e))}},u_=t=>{requestAnimationFrame((()=>requestAnimationFrame(t)))},h_=()=>{var t=performance.getEntriesByType("navigation")[0];if(t&&t.responseStart>0&&t.responseStart<performance.now())return t},d_=()=>{var t,e;return null!==(t=null==(e=h_())?void 0:e.activationStart)&&void 0!==t?t:0},v_=function(t,e){void 0===e&&(e=-1);var i=h_(),r="navigate";return 0>o_?i&&(document.prerendering||d_()>0?r="prerender":document.wasDiscarded?r="restore":i.type&&(r=i.type.replace(/_/g,"-"))):r="back-forward-cache",{name:t,value:e,rating:"good",delta:0,entries:[],id:"v5-"+Date.now()+"-"+(Math.floor(8999999999999*Math.random())+1e12),navigationType:r}},c_=new WeakMap;function f_(t,e){var i=c_.get(e);return i||(i=new WeakMap,c_.set(e,i)),i.get(t)||i.set(t,new e),i.get(t)}class p_{constructor(){this.t=void 0,this.i=0,this.o=[]}h(t){var e;if(!t.hadRecentInput){var i=this.o[0],r=this.o.at(-1);this.i&&i&&r&&1e3>t.startTime-r.startTime&&5e3>t.startTime-i.startTime?(this.i+=t.value,this.o.push(t)):(this.i=t.value,this.o=[t]),null==(e=this.t)||e.call(this,t)}}}var g_,m_=function(t,e,i){void 0===i&&(i={});try{if(PerformanceObserver.supportedEntryTypes.includes(t)){var r=new PerformanceObserver((t=>{queueMicrotask((()=>{e(t.getEntries())}))}));return r.observe(p({type:t,buffered:!0},i)),r}}catch(t){}},y_=t=>{var e=!1;return()=>{e||(t(),e=!0)}},__=-1,b_=new Set,w_=()=>"hidden"!==document.visibilityState||document.prerendering?1/0:0,k_=t=>{if("hidden"===document.visibilityState){if("visibilitychange"===t.type)for(var e of b_)e();isFinite(__)||(__="visibilitychange"===t.type?t.timeStamp:0,removeEventListener("prerenderingchange",k_,!0))}},S_=()=>{if(0>__){var t,e=d_(),i=document.prerendering||null==(t=globalThis.performance.getEntriesByType("visibility-state").find((t=>"hidden"===t.name&&t.startTime>=e)))?void 0:t.startTime;__=null!=i?i:w_(),addEventListener("visibilitychange",k_,!0),addEventListener("prerenderingchange",k_,!0),a_((()=>{setTimeout((()=>{__=w_()}))}))}return{get firstHiddenTime(){return __},onHidden(t){b_.add(t)}}},x_=t=>{document.prerendering?addEventListener("prerenderingchange",t,!0):t()},C_=[1800,3e3],T_=function(t,e){void 0===e&&(e={}),x_((()=>{var i,r=S_(),n=v_("FCP"),s=m_("paint",(t=>{for(var e of t)"first-contentful-paint"===e.name&&(s.disconnect(),r.firstHiddenTime>e.startTime&&(n.value=Math.max(e.startTime-d_(),0),n.entries.push(e),i(!0)))}));s&&(i=l_(t,n,C_,e.reportAllChanges),a_((r=>{n=v_("FCP"),i=l_(t,n,C_,e.reportAllChanges),u_((()=>{n.value=performance.now()-r.timeStamp,i(!0)}))})))}))},E_=[.1,.25],M_=function(t,e){void 0===e&&(e={});var i=S_();T_(y_((()=>{var r,n=v_("CLS",0),s=f_(e,p_),o=t=>{for(var e of t)s.h(e);s.i>n.value&&(n.value=s.i,n.entries=s.o,r())},a=m_("layout-shift",o);a&&(r=l_(t,n,E_,e.reportAllChanges),i.onHidden((()=>{o(a.takeRecords()),r(!0)})),a_((()=>{s.i=0,n=v_("CLS",0),r=l_(t,n,E_,e.reportAllChanges),u_(r)})),setTimeout(r))})))},I_=0,R_=1/0,P_=0,A_=t=>{for(var e of t)e.interactionId&&(R_=Math.min(R_,e.interactionId),P_=Math.max(P_,e.interactionId),I_=P_?(P_-R_)/7+1:0)},O_=()=>{var t;return g_?I_:null!==(t=performance.interactionCount)&&void 0!==t?t:0},F_=0;class L_{constructor(){this.l=[],this.u=new Map,this.m=void 0,this.p=void 0}v(){F_=O_(),this.l.length=0,this.u.clear()}T(){var t=Math.min(this.l.length-1,Math.floor((O_()-F_)/50));return this.l[t]}h(t){var e;if(null!=(e=this.m)&&e.call(this,t),t.interactionId||"first-input"===t.entryType){var i=this.l.at(-1),r=this.u.get(t.interactionId);if(r||10>this.l.length||t.duration>i.L){var n;if(r?t.duration>r.L?(r.entries=[t],r.L=t.duration):t.duration===r.L&&t.startTime===r.entries[0].startTime&&r.entries.push(t):(this.u.set((r={id:t.interactionId,entries:[t],L:t.duration}).id,r),this.l.push(r)),this.l.sort(((t,e)=>e.L-t.L)),this.l.length>10){var s=this.l.splice(10);for(var o of s)this.u.delete(o.id)}null==(n=this.p)||n.call(this,r)}}}}var $_=t=>{var e=globalThis.requestIdleCallback||setTimeout,i=globalThis.cancelIdleCallback||clearTimeout;if("hidden"===document.visibilityState)t();else{var r=y_(t),n=-1,s=()=>{i(n),r()};addEventListener("visibilitychange",s,{once:!0,capture:!0}),n=e((()=>{removeEventListener("visibilitychange",s,{capture:!0}),r()}))}},D_=[200,500],N_=function(t,e){if(void 0===e&&(e={}),globalThis.PerformanceEventTiming&&"interactionId"in PerformanceEventTiming.prototype){var i=S_();x_((()=>{var r;"interactionCount"in performance||g_||(g_=m_("event",A_,{durationThreshold:0}));var n,s=v_("INP"),o=f_(e,L_),a=t=>{$_((()=>{for(var e of t)o.h(e);var i=o.T();i&&i.L!==s.value&&(s.value=i.L,s.entries=i.entries,n())}))},l=m_("event",a,{durationThreshold:null!==(r=e.durationThreshold)&&void 0!==r?r:40});n=l_(t,s,D_,e.reportAllChanges),l&&(l.observe({type:"first-input",buffered:!0}),i.onHidden((()=>{a(l.takeRecords()),n(!0)})),a_((()=>{o.v(),s=v_("INP"),n=l_(t,s,D_,e.reportAllChanges)})))}))}};class q_{constructor(){this.m=void 0}h(t){var e;null==(e=this.m)||e.call(this,t)}}var j_=[2500,4e3],B_=function(t,e){void 0===e&&(e={}),x_((()=>{var i,r=S_(),n=v_("LCP"),s=f_(e,q_),o=t=>{for(var o of(e.reportAllChanges||(t=t.slice(-1)),t))s.h(o),r.firstHiddenTime>o.startTime&&(n.value=Math.max(o.startTime-d_(),0),n.entries=[o],i())},a=m_("largest-contentful-paint",o);if(a){i=l_(t,n,j_,e.reportAllChanges);var l=y_((()=>{o(a.takeRecords()),a.disconnect(),i(!0)})),u=t=>{t.isTrusted&&($_(l),removeEventListener(t.type,u,{capture:!0}))};for(var h of["keydown","click","visibilitychange"])addEventListener(h,u,{capture:!0});a_((r=>{n=v_("LCP"),i=l_(t,n,j_,e.reportAllChanges),u_((()=>{n.value=performance.now()-r.timeStamp,i(!0)}))}))}}))},U_={onLCP(t,e){void 0===e&&(e={});var i=Iy(e=Object.assign({},e),s_),r=new WeakMap;i.m=t=>{var i=t.element;if(i){var n,s=null!==(n=null==e.generateTarget?void 0:e.generateTarget(i))&&void 0!==n?n:Ey(i);r.set(t,s)}else t.id&&r.set(t,"#"+t.id)},function(t,e){void 0===e&&(e={}),Wy((()=>{var i,r=zy(),n=Dy("LCP"),s=Iy(e,s_),o=t=>{for(var o of(e.reportAllChanges||(t=t.slice(-1)),t))s.u(o),r.firstHiddenTime>o.startTime&&(n.value=Math.max(o.startTime-$y(),0),n.entries=[o],i())},a=Ny("largest-contentful-paint",o);if(a){i=Fy(t,n,$,e.reportAllChanges);var l=qy((()=>{o(a.takeRecords()),a.disconnect(),i(!0)})),u=t=>{t.isTrusted&&(r_(l),removeEventListener(t.type,u,{capture:!0}))};for(var h of["keydown","click","visibilitychange"])addEventListener(h,u,{capture:!0});Oy((r=>{n=Dy("LCP"),i=Fy(t,n,$,e.reportAllChanges),Ly((()=>{n.value=performance.now()-r.timeStamp,i(!0)}))}))}}))}((e=>{t((t=>{var e={timeToFirstByte:0,resourceLoadDelay:0,resourceLoadDuration:0,elementRenderDelay:t.value};if(t.entries.length){var i=t.entries.at(-1),n=i.url&&performance.getEntriesByType("resource").find((t=>t.name===i.url));e.target=r.get(i),e.lcpEntry=i,i.url&&(e.url=i.url),n&&(e.lcpResourceEntry=n);var s=xy();if(s){var o=s.activationStart||0,a=Math.max(0,s.responseStart-o),l=Math.max(a,n?(n.requestStart||n.startTime)-o:0),u=Math.min(t.value,Math.max(l,n?n.responseEnd-o:0));e=p({},e,{timeToFirstByte:a,resourceLoadDelay:l-a,resourceLoadDuration:u-l,elementRenderDelay:t.value-u,navigationEntry:s})}}return Object.assign(t,{attribution:e})})(e))}),e)},onCLS(t,e){void 0===e&&(e={});var i=Iy(e=Object.assign({},e),Sy),r=new WeakMap;i.t=t=>{var i;if(null!=t&&null!=(i=t.sources)&&i.length){var n=Qy(t.sources),s=null==n?void 0:n.node;if(s){var o,a=null!==(o=null==e.generateTarget?void 0:e.generateTarget(s))&&void 0!==o?o:Ey(s);r.set(n,a)}}},function(t,e){void 0===e&&(e={});var i=zy();Gy(qy((()=>{var r,n=Dy("CLS",0),s=Iy(e,Sy),o=t=>{for(var e of t)s.u(e);s.o>n.value&&(n.value=s.o,n.entries=s.i,r())},a=Ny("layout-shift",o);a&&(r=Fy(t,n,Zy,e.reportAllChanges),i.onHidden((()=>{o(a.takeRecords()),r(!0)})),Oy((()=>{s.o=0,n=Dy("CLS",0),r=Fy(t,n,Zy,e.reportAllChanges),Ly(r)})),setTimeout(r))})))}((e=>{t((t=>{var e={};if(t.entries.length){var i,n=t.entries.reduce(((t,e)=>t.value>e.value?t:e));if(null!=n&&null!=(i=n.sources)&&i.length){var s=Qy(n.sources);s&&(e={largestShiftTarget:r.get(s),largestShiftTime:n.startTime,largestShiftValue:n.value,largestShiftSource:s,largestShiftEntry:n,loadState:Cy(n.startTime)})}}return Object.assign(t,{attribution:e})})(e))}),e)},onFCP(t,e){void 0===e&&(e={}),Gy((e=>{t((t=>{var e={timeToFirstByte:0,firstByteToFCP:t.value,loadState:Cy(Ay())};if(t.entries.length){var i=xy(),r=t.entries.at(-1);if(i){var n=Math.max(0,i.responseStart-(i.activationStart||0));e={timeToFirstByte:n,firstByteToFCP:t.value-n,loadState:Cy(t.entries[0].startTime),navigationEntry:i,fcpEntry:r}}}return Object.assign(t,{attribution:e})})(e))}),e)},onINP(t,e){void 0===e&&(e={});var i=Iy(e=Object.assign({},e),i_),r=[],n=[],s=0,o=new WeakMap,a=new WeakMap,l=!1,u=()=>{l||(r_(h),l=!0)},h=()=>{var t=new Set(i.l.map((t=>o.get(t.entries[0])))),e=n.length-10;n=n.filter(((i,r)=>r>=e||t.has(i)));var a=new Set;for(var u of n){var h=d(u.startTime,u.processingEnd);for(var v of h)a.add(v)}r=r.filter((t=>t.startTime>s||a.has(t))),l=!1};i.m=t=>{var i,r=t.startTime+t.duration;s=Math.max(s,t.processingEnd);for(var a=n.length-1;a>=0;a--){var l=n[a];if(8>=Math.abs(r-l.renderTime)){(i=l).startTime=Math.min(t.startTime,i.startTime),i.processingStart=Math.min(t.processingStart,i.processingStart),i.processingEnd=Math.max(t.processingEnd,i.processingEnd),!1!==e.includeProcessedEventEntries&&i.entries.push(t);break}}i||n.push(i={startTime:t.startTime,processingStart:t.processingStart,processingEnd:t.processingEnd,renderTime:r,entries:!1!==e.includeProcessedEventEntries?[t]:[]}),(t.interactionId||"first-input"===t.entryType)&&o.set(t,i),u()},i.p=t=>{if(!a.get(t)){var i,r=null==(i=t.entries.find((t=>t.target)))?void 0:i.target;if(r){var n,s=null!==(n=null==e.generateTarget?void 0:e.generateTarget(r))&&void 0!==n?n:Ey(r);a.set(t,s)}else{var o,l=null==(o=t.entries.find((t=>t.targetSelector)))?void 0:o.targetSelector;l&&a.set(t,l)}}};var d=(t,e)=>{var i=[];for(var n of r)if(n.startTime+n.duration>=t){if(n.startTime>e)break;i.push(n)}return i};Ny("long-animation-frame",(t=>{r=r.concat(t),u()})),function(t,e){if(void 0===e&&(e={}),globalThis.PerformanceEventTiming&&"interactionId"in PerformanceEventTiming.prototype){var i=zy();Wy((()=>{var r;"interactionCount"in performance||Ry||(Ry=Ny("event",Xy,{durationThreshold:0}));var n,s=Dy("INP"),o=Iy(e,i_),a=t=>{r_((()=>{for(var e of t)o.u(e);var i=o.M();i&&i.T!==s.value&&(s.value=i.T,s.entries=i.entries,n())}))},l=Ny("event",a,{durationThreshold:null!==(r=e.durationThreshold)&&void 0!==r?r:40});n=Fy(t,s,n_,e.reportAllChanges),l&&(l.observe({type:"first-input",buffered:!0}),i.onHidden((()=>{a(l.takeRecords()),n(!0)})),Oy((()=>{o.v(),s=Dy("INP"),n=Fy(t,s,n_,e.reportAllChanges)})))}))}}((e=>{t((t=>{var e=t.entries[0],r=o.get(e),n=e.processingStart,s=Math.max(e.startTime+e.duration,n),l=Math.min(r.processingEnd,s),u=r.entries.sort(((t,e)=>t.processingStart-e.processingStart)),h=d(e.startTime,l),v=i.h.get(e.interactionId),c={interactionTarget:a.get(v),interactionType:e.name.startsWith("key")?"keyboard":"pointer",interactionTime:e.startTime,nextPaintTime:s,processedEventEntries:u,longAnimationFrameEntries:h,inputDelay:n-e.startTime,processingDuration:l-n,presentationDelay:s-l,loadState:Cy(e.startTime),longestScript:void 0,totalScriptDuration:void 0,totalStyleAndLayoutDuration:void 0,totalPaintDuration:void 0,totalUnattributedDuration:void 0};return((t,e)=>{if(null!=(e=t.longAnimationFrameEntries)&&e.length){var i,r,n=t.interactionTime,s=t.inputDelay,o=t.processingDuration,a=0,l=0,u=0,h=0;for(var d of t.longAnimationFrameEntries)for(var v of(l=l+d.startTime+d.duration-d.styleAndLayoutStart,d.scripts)){var c=v.startTime+v.duration;if(c>=n){var f=c-Math.max(n,v.startTime),p=v.duration?f/v.duration*v.forcedStyleAndLayoutDuration:0;a+=f-p,l+=p,f>h&&(r=n+s>v.startTime?"input-delay":n+s+o>v.startTime?"processing-duration":"presentation-delay",i=v,h=f)}}var g=t.longAnimationFrameEntries.at(-1),m=g?g.startTime+g.duration:0;m>=n+s+o&&(u=t.nextPaintTime-m),i&&r&&(t.longestScript={entry:i,subpart:r,intersectingDuration:h}),t.totalScriptDuration=a,t.totalStyleAndLayoutDuration=l,t.totalPaintDuration=u,t.totalUnattributedDuration=t.nextPaintTime-n-a-l-u}})(c),Object.assign(t,{attribution:c})})(e))}),e)},withoutAttribution:{onLCP:B_,onCLS:M_,onFCP:T_,onINP:N_}};v.__PosthogExtensions__=v.__PosthogExtensions__||{},v.__PosthogExtensions__.postHogWebVitalsCallbacksByFlavor=v.__PosthogExtensions__.postHogWebVitalsCallbacksByFlavor||{},v.__PosthogExtensions__.postHogWebVitalsCallbacksByFlavor["web-vitals-with-attribution"]=U_,v.__PosthogExtensions__.postHogWebVitalsCallbacks=U_,v.postHogWebVitalsCallbacks=U_;var H_={onLCP:B_,onCLS:M_,onFCP:T_,onINP:N_};v.__PosthogExtensions__=v.__PosthogExtensions__||{},v.__PosthogExtensions__.postHogWebVitalsCallbacksByFlavor=v.__PosthogExtensions__.postHogWebVitalsCallbacksByFlavor||{},v.__PosthogExtensions__.postHogWebVitalsCallbacksByFlavor["web-vitals"]=H_,v.__PosthogExtensions__.postHogWebVitalsCallbacks=H_,v.postHogWebVitalsCallbacks=H_,v.__PosthogExtensions__.loadWebVitalsCallbacks=()=>H_;class z_{constructor(t){this.disabled=!1===t;var e=st(t)?t:{};this.thresholdPx=e.threshold_px||30,this.timeoutMs=e.timeout_ms||1e3,this.clickCount=e.click_count||3,this.clicks=[]}isRageClick(t,e,i){if(this.disabled)return!1;var r=this.clicks[this.clicks.length-1];if(r&&Math.abs(t-r.x)+Math.abs(e-r.y)<this.thresholdPx&&this.timeoutMs>i-r.timestamp){if(this.clicks.push({x:t,y:e,timestamp:i}),this.clicks.length===this.clickCount)return!0}else this.clicks=[{x:t,y:e,timestamp:i}];return!1}}var W_="$copy_autocapture",V_=Bi("[AutoCapture]");function G_(t,e){return e.length>t?e.slice(0,t)+"...":e}function Z_(t){if(t.previousElementSibling)return t.previousElementSibling;var e=t;do{e=e.previousSibling}while(e&&!pr(e));return e}function Q_(e,i){var r,n,s=i.e,o=i.maskAllElementAttributes,a=i.maskAllText,l=i.elementAttributeIgnoreList,u=i.elementsChainAsString,h=i.disableCaptureUrlHashes;if(!pr(e))return{props:{}};for(var d=[e],v=new Set([e]),c=e;c.parentNode&&!gr(c,"body")&&_r>d.length;)if(yr(c.parentNode)){var f=c.parentNode.host;if(v.has(f))break;v.add(f),d.push(f),c=f}else{if(!pr(c.parentNode))break;if(v.has(c.parentNode))break;v.add(c.parentNode),d.push(c.parentNode),c=c.parentNode}var g,m,y=[],_={},b=!1,w=!1;if(Hi(d,(t=>{var e=qr(t);if(gr(t,"a")){var i=t.getAttribute("href");b=!!(e&&i&&Zr(i))&&(h?Le(i):i)}J(kr(t),"ph-no-capture")&&(w=!0),y.push(function(t,e,i,r,n){void 0===n&&(n=!1);var s=t.tagName.toLowerCase(),o={tag_name:s};Tr.indexOf(s)>-1&&!i&&(o.$el_text="a"===s.toLowerCase()||"button"===s.toLowerCase()?G_(1024,Qr(t)):G_(1024,xr(t)));var a=kr(t);a.length>0&&(o.classes=a.filter((function(t){return""!==t}))),Hi(t.attributes,(function(i){var s;if((!jr(t)||-1!==["name","id","class","aria-label"].indexOf(i.name))&&(null==r||!r.includes(i.name))&&!e&&Zr(i.value)&&(!lt(s=i.name)||"_ngcontent"!==s.substring(0,10)&&"_nghost"!==s.substring(0,7))){var a=i.value;"class"===i.name&&(a=br(a).join(" ")),o["attr__"+i.name]=G_(1024,"href"===i.name&&n?Le(a):a)}}));for(var l=1,u=1,h=t;h=Z_(h);)l++,h.tagName===t.tagName&&u++;return o.nth_child=l,o.nth_of_type=u,o}(t,o,a,l,h));var r=function(t){if(!qr(t))return{};var e={};return Hi(t.attributes,(function(t){if(t.name&&0===t.name.indexOf("data-ph-capture-attribute")){var i=t.name.replace("data-ph-capture-attribute-",""),r=t.value;i&&r&&Zr(r)&&(e[i]=r)}})),e}(t);zi(_,r)})),w)return{props:{},explicitNoCapture:w};if(a||(y[0].$el_text=gr(e,"a")||gr(e,"button")?Qr(e):xr(e)),b){var k,S;y[0].attr__href=b;var x=null==(k=er(b))?void 0:k.host,C=null==t||null==(S=t.location)?void 0:S.host;x&&C&&x!==C&&(g=b)}return{props:zi({$event_type:s.type,$ce_version:1},u?{}:{$elements:y},{$elements_chain:(m=y,function(t){return t.map((t=>{var e,i,r="";if(t.tag_name&&(r+=t.tag_name),t.attr_class)for(var n of(t.attr_class.sort(),t.attr_class))r+="."+n.replace(/"/g,"");var s=p({},t.text?{text:t.text}:{},{"nth-child":null!==(e=t.nth_child)&&void 0!==e?e:0,"nth-of-type":null!==(i=t.nth_of_type)&&void 0!==i?i:0},t.href?{href:t.href}:{},t.attr_id?{attr_id:t.attr_id}:{},t.attributes),o={};return Wi(s).sort(((t,e)=>t[0].localeCompare(e[0]))).forEach((t=>{var e=t[1];return o[Kr(t[0].toString())]=Kr(e.toString())})),(r+=":")+Wi(o).map((t=>t[0]+'="'+t[1]+'"')).join("")})).join(";")}(function(t){return t.map((t=>{var e,i,r={text:null==(e=t.$el_text)?void 0:e.slice(0,400),tag_name:t.tag_name,href:null==(i=t.attr__href)?void 0:i.slice(0,2048),attr_class:Yr(t),attr_id:t.attr__id,nth_child:t.nth_child,nth_of_type:t.nth_of_type,attributes:{}};return Wi(t).filter((t=>0===t[0].indexOf("attr__"))).forEach((t=>r.attributes[t[0]]=t[1])),r}))}(m)))},null!=(r=y[0])&&r.$el_text?{$el_text:null==(n=y[0])?void 0:n.$el_text}:{},g&&"click"===s.type?{$external_click_url:g}:{},_)}}class J_{constructor(t){this.name="autocapture",this.Qn=!1,this.Jn=null,this.Kn=!1,this.Yn=!1,this.qi={enabled:!1,rageclick:!1,maskAllElementAttributes:!1,maskAllText:!1,disableCaptureUrlHashes:!1,remoteRequestsDisabled:!1},this.Xn=!1,this.ts=t,this.ts.refresh(this.qi),this.rageclicks=new z_(this.qi.rageclick),this.es=null}setup(t){this.rs(),this.ns=t;var e=t.onRemoteConfig(this.onRemoteConfig.bind(this));this.Xn?e.dispose():(this.ss=e,this.startIfEnabled())}dispose(){var t;this.Xn||(this.Xn=!0,this.ns=void 0,null==(t=this.ss)||t.dispose(),this.ss=void 0,this.os())}ls(){return this.ts.refresh(this.qi),this.qi}rs(){var t,e;return this.ls(),this.qi.url_allowlist=null==(t=this.qi.url_allowlist)?void 0:t.map((t=>new RegExp(t))),this.qi.url_ignorelist=null==(e=this.qi.url_ignorelist)?void 0:e.map((t=>new RegExp(t))),this.qi}us(){if(this.isBrowserSupported()){if(t&&r){var e=this.hs=e=>{e=e||(null==t?void 0:t.event);try{this.ds(e)}catch(t){V_.error("Failed to capture event",t)}};if(Ki(r,"submit",e,{capture:!0}),Ki(r,"change",e,{capture:!0}),Ki(r,"click",e,{capture:!0}),this.ls().capture_copied_text){var i=this.vs=e=>{e=e||(null==t?void 0:t.event);try{this.ds(e,W_)}catch(t){V_.error("Failed to capture copy/cut event",t)}};Ki(r,"copy",i,{capture:!0}),Ki(r,"cut",i,{capture:!0})}}}else V_.info("Disabling Automatic Event Collection because this browser is not supported")}os(){this.hs&&(null==r||r.removeEventListener("submit",this.hs,!0),null==r||r.removeEventListener("change",this.hs,!0),null==r||r.removeEventListener("click",this.hs,!0),this.hs=void 0),this.vs&&(null==r||r.removeEventListener("copy",this.vs,!0),null==r||r.removeEventListener("cut",this.vs,!0),this.vs=void 0),this.Qn=!1}startIfEnabled(){!this.Xn&&this.ns&&this.isEnabled&&!this.Qn&&(this.us(),this.Qn=!0)}onRemoteConfig(t){if(!this.Xn)if(this.Kn=!0,t.ok){var e=t.config;e.elementsChainAsString&&(this.Yn=e.elementsChainAsString);var i,r=e.autocapture_opt_out;ft(r)&&(null==(i=this.ns)||i.kv.set(_n,r),this.Jn=r),this.startIfEnabled()}else this.startIfEnabled()}setElementSelectors(t){this.es=t}getElementSelectors(t){var e,i=[];return null==(e=this.es)||e.forEach((e=>{var n=null==r?void 0:r.querySelectorAll(e);null==n||n.forEach((r=>{t===r&&i.push(e)}))})),i}get isEnabled(){var t,e;if(this.Xn)return!1;var i=null==(t=this.ns)?void 0:t.kv.get(_n),r=this.Jn,n=this.ls(),s=n.remoteRequestsDisabled&&!this.Kn;if(ht(r)&&!ft(i)&&!s)return!1;var o=null!==(e=this.Jn)&&void 0!==e?e:!!i;return!!n.enabled&&!o}ds(e,i){if(void 0===i&&(i="$autocapture"),this.isEnabled){var r=Cr(e);mr(r)&&(r=r.parentNode||null);var n,s=this.rs();"$autocapture"===i&&"click"===e.type&&e instanceof MouseEvent&&s.rageclick&&null!=(n=this.rageclicks)&&n.isRageClick(e.clientX,e.clientY,e.timeStamp||(new Date).getTime())&&$r(r,s.rageclick)&&this.ds(e,"$rageclick");var o=i===W_;if(r&&function(e,i,r,n,s,o){var a;if(!t||Dr(e))return!1;if(null!=r&&r.url_allowlist&&!wr(r.url_allowlist,o))return!1;if(null!=r&&r.url_ignorelist&&wr(r.url_ignorelist,o))return!1;if(null!=r&&r.dom_event_allowlist){var l=r.dom_event_allowlist;if(l&&!l.some((t=>i.type===t)))return!1}var u=Nr(e,n),h=u.parentIsUsefulElement,d=u.targetElementList;if(!function(t,e){var i=null==e?void 0:e.element_allowlist;if(at(i))return!0;var r,n=function(t){if(i.some((e=>t.tagName.toLowerCase()===e)))return{v:!0}};for(var s of t)if(r=n(s))return r.v;return!1}(d,r))return!1;if(!Er(d,null==r?void 0:r.css_selector_allowlist))return!1;if(Er(d,null!==(a=null==r?void 0:r.css_selector_ignorelist)&&void 0!==a?a:Ir))return!1;try{var v=t.getComputedStyle(e);if(v&&"pointer"===v.getPropertyValue("cursor")&&"click"===i.type)return!0}catch(t){}var c=e.tagName.toLowerCase();switch(c){case"html":return!1;case"form":return(s||["submit"]).indexOf(i.type)>=0;case"input":case"select":case"textarea":return(s||["change","click"]).indexOf(i.type)>=0;default:return h?(s||["click"]).indexOf(i.type)>=0:(s||["click"]).indexOf(i.type)>=0&&(Tr.indexOf(c)>-1||"true"===e.getAttribute("contenteditable"))}}(r,e,s,o,o?["copy","cut"]:void 0,{config:{get_current_url:s.getCurrentUrl}})){var a,l=Q_(r,{e:e,maskAllElementAttributes:s.maskAllElementAttributes,maskAllText:s.maskAllText,elementAttributeIgnoreList:s.element_attribute_ignorelist,elementsChainAsString:this.Yn,disableCaptureUrlHashes:s.disableCaptureUrlHashes}),u=l.props;if(l.explicitNoCapture)return!1;var h=this.getElementSelectors(r);if(h&&h.length>0&&(u.$element_selectors=h),i===W_){var d,v=Sr(null==t||null==(d=t.getSelection())?void 0:d.toString()),c=e.type||"clipboard";if(!v)return!1;u.$selected_content=v,u.$copy_type=c}return null==(a=this.ns)||a.capture(i,u).catch((t=>V_.error("Failed to capture event",t))),!0}}}isBrowserSupported(){return nt(null==r?void 0:r.querySelectorAll)}}var K_={};function Y_(e,i){var r=K_[e];if(r)return r;var n=i[e];if((t=>nt(t)&&-1!==t.toString().indexOf("[native code]"))(n)&&(null==t||!t.Zone))return K_[e]=n.bind(i);var s=i.document;if(s&&nt(s.createElement)){var o,a=!1;try{(o=s.createElement("iframe")).hidden=!0,s.head.appendChild(o);var l,u,h=o.contentWindow;h&&h[e]&&(n=h[e],"MutationObserver"===e&&function(t){return J(t,"AppleWebKit")&&!J(t,"Chrome")}(null!==(l=null==(u=i.navigator)?void 0:u.userAgent)&&void 0!==l?l:"")&&(o.classList.add("rr-block","ph-no-capture"),a=!0))}catch(t){ji.warn("Could not create sandbox iframe for "+e+" check, bailing to assignableWindow."+e+": ",t)}finally{var d;!a&&null!=(d=o)&&d.parentNode&&o.parentNode.removeChild(o)}}return n&&nt(n)?K_[e]=n.bind(i):n}function X_(t,e){var i=Cr(t);return i?p({node:i,originalEvent:t,timestamp:Date.now()},e):null}function tb(t,e){return Math.abs(t)<Math.abs(e)?0>e?"up":"down":0>t?"left":"right"}function eb(t){return"swipe"===t.type?"$dead_swipe":"$dead_click"}var ib="canvas,video,audio,embed,object",rb=1e3;function nb(t,e){return vt(t)&&t>=e}function sb(t){return t>=0&&rb>t?t:void 0}function ob(t,e){return e?sb(t-e):void 0}class ab{mi(t){var e,i,r,n,s,o,a,l,u=this.gi((null==t?void 0:t.__onCapture)||this.yi.bind(this));return{element_attribute_ignorelist:null!==(e=null==t?void 0:t.element_attribute_ignorelist)&&void 0!==e?e:u.element_attribute_ignorelist,scroll_threshold_ms:null!==(i=null==t?void 0:t.scroll_threshold_ms)&&void 0!==i?i:u.scroll_threshold_ms,selection_change_threshold_ms:null!==(r=null==t?void 0:t.selection_change_threshold_ms)&&void 0!==r?r:u.selection_change_threshold_ms,mutation_threshold_ms:null!==(n=null==t?void 0:t.mutation_threshold_ms)&&void 0!==n?n:u.mutation_threshold_ms,capture_clicks_with_modifier_keys:null!==(s=null==t?void 0:t.capture_clicks_with_modifier_keys)&&void 0!==s?s:u.capture_clicks_with_modifier_keys,capture_dead_swipes:null!==(o=null==t?void 0:t.capture_dead_swipes)&&void 0!==o?o:u.capture_dead_swipes,swipe_threshold_px:null!==(a=null==t?void 0:t.swipe_threshold_px)&&void 0!==a?a:u.swipe_threshold_px,max_dead_swipes_per_page_load:null!==(l=null==t?void 0:t.max_dead_swipes_per_page_load)&&void 0!==l?l:u.max_dead_swipes_per_page_load,css_selector_ignorelist:null==t?void 0:t.css_selector_ignorelist,__onCapture:u.__onCapture}}constructor(t,e){this.bi=[],this.wi=0,this.gi=t=>({element_attribute_ignorelist:[],scroll_threshold_ms:100,selection_change_threshold_ms:100,mutation_threshold_ms:2500,capture_clicks_with_modifier_keys:!1,capture_dead_swipes:!0,swipe_threshold_px:30,max_dead_swipes_per_page_load:10,__onCapture:t}),this.ki=t=>{var e=X_(t,{type:"click"});ht(e)||this.Si(e)||this.xi(e),this.Ci()},this.Mi=()=>{var t=Date.now();this.Ti=t,t%50==0&&this.bi.forEach((e=>{at(e.scrollDelayMs)&&(e.scrollDelayMs=t-e.timestamp)}))},this.Ii=()=>{this.Ei=Date.now()},this.It=()=>{var t=Date.now();this.Ri=t,this.Ai("visibilityChangedDelayMs",t)},this.Li=()=>{var t=Date.now();this.Oi=t,this.Ai("focusChangedDelayMs",t)},this.Fi=t=>{var e=t.touches,i=1===(null==e?void 0:e.length)?e[0]:void 0;this.Ni=i?{x:i.clientX,y:i.clientY,timestamp:Date.now()}:void 0},this.Di=()=>{this.Ni=void 0},this.Pi=t=>{var e,i=this.Ni;if(this.Ni=void 0,!at(i)&&this.qi.max_dead_swipes_per_page_load>this.wi){var n=t,s=null==(e=n.changedTouches)?void 0:e[0];if(s){var o=s.clientX-i.x,a=s.clientY-i.y,l=o*o+a*a,u=this.qi.swipe_threshold_px;if(l>=u*u&&![this.Ti,this.ji,this.Ei].some((t=>vt(t)&&t>=i.timestamp))){var h;if(this.Bi()&&(null!==(h=null==r||null==r.elementsFromPoint?void 0:r.elementsFromPoint(i.x,i.y))&&void 0!==h?h:[]).some((t=>null==t.matches?void 0:t.matches(ib))))return;var d=X_(n,{type:"swipe",swipeDirection:tb(o,a),swipeDistancePx:Math.round(Math.sqrt(l))});ht(d)||this.Si(d)||this.xi(d),this.Ci()}}}},this.instance=t,this.qi=this.mi(e),this._onCapture=this.qi.__onCapture}start(t){this.Hi(),this.$i(),this.Ui(),this.Wi(),this.zi(),this.Vi(t),this.qi.capture_dead_swipes&&this.Zi()}Vi(t){if(!this.Qi){var e=function(t){return Y_("MutationObserver",t)}(v);this.Qi=new e((t=>{this.Gi(t)})),this.Qi.observe(t,{attributes:!0,characterData:!0,childList:!0,subtree:!0})}}stop(){var t;null==(t=this.Qi)||t.disconnect(),this.Qi=void 0,v.removeEventListener("click",this.ki),v.removeEventListener("scroll",this.Mi,{capture:!0}),v.removeEventListener("selectionchange",this.Ii),v.removeEventListener("touchstart",this.Fi,{capture:!0}),v.removeEventListener("touchend",this.Pi,{capture:!0}),v.removeEventListener("touchcancel",this.Di,{capture:!0}),null==r||r.removeEventListener("visibilitychange",this.It),v.removeEventListener("blur",this.Li),v.removeEventListener("focus",this.Li),this.Ni=void 0}Gi(t){this.ji=Date.now()}Hi(){Ki(v,"click",this.ki)}xi(t){t.visibilityChangedDelayMs=ob(t.timestamp,this.Ri),t.focusChangedDelayMs=ob(t.timestamp,this.Oi),this.bi.push(t)}Ci(){this.bi.length&&at(this.Yi)&&(this.Yi=v.setTimeout((()=>{this.Ji()}),1e3))}$i(){Ki(v,"scroll",this.Mi,{capture:!0})}Ui(){Ki(v,"selectionchange",this.Ii)}Wi(){Ki(r,"visibilitychange",this.It)}zi(){Ki(v,"blur",this.Li),Ki(v,"focus",this.Li)}Ai(t,e){this.bi.forEach((i=>{var r=sb(e-i.timestamp);vt(r)&&(at(i[t])||i[t]>r)&&(i[t]=r)}))}Zi(){Ki(v,"touchstart",this.Fi,{capture:!0,passive:!0}),Ki(v,"touchend",this.Pi,{capture:!0,passive:!0}),Ki(v,"touchcancel",this.Di,{capture:!0,passive:!0})}Bi(){var t=at(this.Ki)||vt(this.ji)&&this.ji>this.Ki;return(at(this.Xi)||t)&&(this.Ki=Date.now(),this.Xi=!(null==r||!r.querySelector(ib))),!!this.Xi}Si(t){return!t||("swipe"===t.type?this.en(t):this.tn(t))}en(e){if(fr(e.node))return!0;var i=this.bi.some((t=>t.type===e.type&&t.node===e.node&&1e3>Math.abs(t.timestamp-e.timestamp)));return!(!i&&!gr(e.node,"html")&&pr(e.node)&&function(e,i){var r;if(!t||Dr(e))return!1;var n=ft(i)?Or:null!==(r=null==i?void 0:i.css_selector_ignorelist)&&void 0!==r?r:Or;return!Er(Nr(e,!1).targetElementList,n)}(e.node,{css_selector_ignorelist:this.qi.css_selector_ignorelist}))}tn(e){return!(this.qi.capture_clicks_with_modifier_keys||(i=e.originalEvent,!(i.ctrlKey||i.metaKey||i.altKey||i.shiftKey)))||!!this.en(e)||(r=e.node,!(!t||Dr(r))&&Nr(r,!1).targetElementList.some((t=>gr(t,"a"))));var i,r}Ji(){if(this.bi.length){clearTimeout(this.Yi),this.Yi=void 0;var t=this.bi;for(var e of(this.bi=[],t)){var i;e.mutationDelayMs=null!==(i=e.mutationDelayMs)&&void 0!==i?i:this.ji&&this.ji>=e.timestamp?this.ji-e.timestamp:void 0,e.absoluteDelayMs=Date.now()-e.timestamp,e.selectionChangedDelayMs=this.Ei&&this.Ei>=e.timestamp?this.Ei-e.timestamp:void 0;var r=nb(e.scrollDelayMs,this.qi.scroll_threshold_ms),n=nb(e.selectionChangedDelayMs,this.qi.selection_change_threshold_ms),s=nb(e.mutationDelayMs,this.qi.mutation_threshold_ms),o=nb(e.absoluteDelayMs,1.1*this.qi.mutation_threshold_ms),a=vt(e.scrollDelayMs)&&this.qi.scroll_threshold_ms>e.scrollDelayMs,l=vt(e.mutationDelayMs)&&this.qi.mutation_threshold_ms>e.mutationDelayMs,u=vt(e.selectionChangedDelayMs)&&this.qi.selection_change_threshold_ms>e.selectionChangedDelayMs,h=vt(e.visibilityChangedDelayMs),d=vt(e.focusChangedDelayMs);if(!(a||l||u||h||d))if(r||s||o||n){var v=eb(e);if("$dead_swipe"===v){if(this.wi>=this.qi.max_dead_swipes_per_page_load)continue;this.wi++}this._onCapture(e,{[v+"_last_mutation_timestamp"]:this.ji,[v+"_event_timestamp"]:e.timestamp,[v+"_scroll_timeout"]:r,[v+"_mutation_timeout"]:s,[v+"_absolute_timeout"]:o,[v+"_selection_changed_timeout"]:n,[v+"_visibility_changed_timeout"]:!1})}else this.qi.mutation_threshold_ms>e.absoluteDelayMs&&this.bi.push(e)}this.Ci()}}yi(t,e){var i=eb(t);this.instance.capture(i,p({},e,Q_(t.node,{e:t.originalEvent,maskAllElementAttributes:this.instance.config.mask_all_element_attributes,maskAllText:this.instance.config.mask_all_text,elementAttributeIgnoreList:this.qi.element_attribute_ignorelist,elementsChainAsString:!1,disableCaptureUrlHashes:this.instance.config.disable_capture_url_hashes}).props,{[i+"_scroll_delay_ms"]:t.scrollDelayMs,[i+"_mutation_delay_ms"]:t.mutationDelayMs,[i+"_absolute_delay_ms"]:t.absoluteDelayMs,[i+"_selection_changed_delay_ms"]:t.selectionChangedDelayMs,[i+"_visibility_changed_delay_ms"]:t.visibilityChangedDelayMs,[i+"_focus_changed_delay_ms"]:t.focusChangedDelayMs,$dead_swipe_direction:t.swipeDirection,$dead_swipe_distance_px:t.swipeDistancePx}),{timestamp:new Date(t.timestamp)})}}v.__PosthogExtensions__=v.__PosthogExtensions__||{},v.__PosthogExtensions__.initDeadClicksAutocapture=(t,e)=>new ab(t,e);var lb=Bi("[ExternalScriptsLoader]"),ub=t=>{var e=null==r?void 0:r.querySelectorAll("script");if(e)for(var i=0;e.length>i;i++)if(e[i].src===t||e[i].getAttribute("src")===t)return e[i]},hb=(t,e,i)=>{if(t.config.disable_external_dependency_loading)return lb.warn(e+" was requested but loading of external scripts is disabled."),i("Loading of external scripts is disabled");var n=ub(e);if(n){if(n.__posthog_loading_callback_fired)return i();var s=n.__posthog_loading_error;return s?i(s):(n.addEventListener("load",(t=>{n.__posthog_loading_callback_fired=!0,i(void 0,t)})),void n.addEventListener("error",(t=>{n.__posthog_loading_error=t,i(t)})))}var o=()=>{if(!r)return i("document not found");if(ub(e))return hb(t,e,i);var n=r.createElement("script");if(n.type="text/javascript",n.crossOrigin="anonymous",n.src=e,n.onload=t=>{n.__posthog_loading_callback_fired=!0,i(void 0,t)},n.onerror=t=>{n.__posthog_loading_error=t,i(t)},t.config.prepare_external_dependency_script&&(n=t.config.prepare_external_dependency_script(n)),!n)return i("prepare_external_dependency_script returned null");if("head"===t.config.external_scripts_inject_target)r.head.appendChild(n);else{var s,o=r.querySelectorAll("body > script");o.length>0?null==(s=o[0].parentNode)||s.insertBefore(n,o[0]):r.body.appendChild(n)}};null!=r&&r.body?o():null==r||r.addEventListener("DOMContentLoaded",o)},db={},vb=(t,e)=>{var i="/static/"+e+".js?v="+t.version;if("toolbar"===e){var r=3e5;i=i+"&t="+Math.floor(Date.now()/r)*r}return t.requestRouter.endpointFor("assets",i)};v.__PosthogExtensions__=v.__PosthogExtensions__||{},v.__PosthogExtensions__.loadExternalDependency=(t,e,i)=>{if("remote-config"!==e){var r=t.config.strict_script_versioning;if(r){var n=t.requestRouter.endpointFor("assets","/static/"+t.version+"/"+e+".js"),s=db[n];if("fallback"===r&&s){if(ub(s))return void hb(t,s,i);delete db[n]}hb(t,n,"fallback"===r?(r,s)=>{if(r)if("string"==typeof r)i(r);else{var o,a=vb(t,e);db[n]=a;var l=ub(n);null==l||null==(o=l.parentNode)||o.removeChild(l),hb(t,a,i)}else i(void 0,s)}:i)}else hb(t,vb(t,e),i)}else{var o=t.requestRouter.endpointFor("assets","/array/"+t.config.token+"/config.js");hb(t,o,i)}},v.__PosthogExtensions__.loadSiteApp=(t,e,i)=>{var r=t.requestRouter.endpointFor("api",e);hb(t,r,i)};class cb{constructor(t){this._instance=t}get qi(){return this._instance.config}get consent(){return this.cs()?0:this.fs}isOptedOut(){return this.qi.cookieless_mode===Fs||this.isRejected()||-1===this.consent&&this.qi.cookieless_mode===Os}isOptedIn(){return!this.isOptedOut()}isExplicitlyOptedOut(){return 0===this.consent}isRejected(){return 0===this.consent||-1===this.consent&&this.qi.opt_out_capturing_by_default}optInOut(t){this.ps.Dr(this.gs,t?1:0,this.qi.cookie_expiration,this.qi.cross_subdomain_cookie,this.qi.secure_cookie)}reset(){this.ps.qr(this.gs,this.qi.cross_subdomain_cookie)}get gs(){var t=this._instance.config,e=t.token,i=t.opt_out_capturing_cookie_prefix;return t.consent_persistence_name||(i?i+e:"__ph_opt_in_out_"+e)}get fs(){var t=this.ps.Pr(this.gs);return xt(t)?1:J(Ct,t)?0:-1}get ps(){var t=this.qi.opt_out_capturing_persistence_type,e="localStorage"===t?Df:Lf;if(!this.ys||this.ys!==e){this.ys=e;var i="localStorage"===t?Lf:Df;i.Pr(this.gs)&&(this.ys.Pr(this.gs)||this.optInOut(xt(i.Pr(this.gs))),i.qr(this.gs,this.qi.cross_subdomain_cookie))}return this.ys}cs(){return!!this.qi.respect_dnt&&[null==i?void 0:i.doNotTrack,null==i?void 0:i.msDoNotTrack,v.doNotTrack].some((t=>xt(t)))}}var fb=Bi("[Dead Clicks]"),pb=()=>!0,gb=t=>{var e,i=!(null==(e=t.instance.persistence)||!e.get_property(Cn)),r=t.instance.config.capture_dead_clicks;return ft(r)?r:!!st(r)||i};class mb{get lazyLoadedDeadClicksAutocapture(){return this.bs}constructor(t,e,i){this.instance=t,this.isEnabled=e,this.onCapture=i,this.startIfEnabledOrStop()}onRemoteConfig(t){if(t.ok){var e=t.config;"captureDeadClicks"in e&&(this.instance.persistence&&this.instance.persistence.register({[Cn]:e.captureDeadClicks}),this.startIfEnabledOrStop())}}startIfEnabledOrStop(){this.isEnabled(this)?this._s((()=>{this.ws()})):this.stop()}_s(t){var e,i;null!=(e=v.__PosthogExtensions__)&&e.initDeadClicksAutocapture?t():null==(i=v.__PosthogExtensions__)||null==i.loadExternalDependency||i.loadExternalDependency(this.instance,"dead-clicks-autocapture",(e=>{e?fb.error("failed to load script",e):t()}))}ws(){var t;if(r){if(!this.bs&&null!=(t=v.__PosthogExtensions__)&&t.initDeadClicksAutocapture){var e=st(this.instance.config.capture_dead_clicks)?p({},this.instance.config.capture_dead_clicks):{};e.__onCapture=this.onCapture,this.onCapture&&(e.capture_dead_swipes=!1),this.bs=v.__PosthogExtensions__.initDeadClicksAutocapture(this.instance,e),this.bs.start(r),fb.info("starting...")}}else fb.error("`document` not found. Cannot start.")}stop(){this.bs&&(this.bs.stop(),this.bs=void 0,fb.info("stopping..."))}}var yb=Bi("[SegmentIntegration]");var _b="posthog-js";function bb(t,e){var i=void 0===e?{}:e,r=i.organization,n=i.projectId,s=i.prefix,o=i.severityAllowList,a=void 0===o?["error"]:o,l=i.sendExceptionsToPostHog,u=void 0===l||l;return e=>{var i,o,l,h,d;if("*"!==a&&!a.includes(e.level)||!t.__loaded)return e;e.tags||(e.tags={});var v=t.requestRouter.endpointFor("ui","/project/"+t.config.token+"/person/"+t.get_distinct_id());e.tags["PostHog Person URL"]=v,t.sessionRecordingStarted()&&(e.tags["PostHog Recording URL"]=t.get_session_replay_url({withTimestamp:!0}));var c,f=(null==(i=e.exception)?void 0:i.values)||[],g=f.map((t=>p({},t,{stacktrace:t.stacktrace?p({},t.stacktrace,{type:"raw",frames:(t.stacktrace.frames||[]).map((t=>p({},t,{platform:"web:javascript"})))}):void 0}))),m={$exception_message:(null==(o=f[0])?void 0:o.value)||e.message,$exception_type:null==(l=f[0])?void 0:l.type,$exception_level:e.level,$exception_list:g,$sentry_event_id:e.event_id,$sentry_exception:e.exception,$sentry_exception_message:(null==(h=f[0])?void 0:h.value)||e.message,$sentry_exception_type:null==(d=f[0])?void 0:d.type,$sentry_tags:e.tags};return r&&n&&(m.$sentry_url=(s||"https://sentry.io/organizations/")+r+"/issues/?project="+n+"&query="+e.event_id),u&&(null==(c=t.exceptions)||c.sendExceptionEvent(m)),e}}class wb{constructor(t,e,i,r,n,s){this.name=_b,this.setupOnce=function(o){o(bb(t,{organization:e,projectId:i,prefix:r,severityAllowList:n,sendExceptionsToPostHog:null==s||s}))}}}class kb{constructor(t){this.ks=(t,e,i)=>{i&&(i.noSessionId||i.activityTimeout||i.sessionPastMaximumLength||i.crossTabAdoption)&&(ji.info("[PageViewManager] Session rotated, clearing pageview state",{sessionId:t,changeReason:i}),this.Ss=void 0,this._instance.scrollManager.resetContext())},this._instance=t,this.xs()}xs(){var t;this.Cs=null==(t=this._instance.sessionManager)?void 0:t.onSessionId(this.ks)}destroy(){var t;null==(t=this.Cs)||t.call(this),this.Cs=void 0}doPageView(e,i){var r,n=this.Ts(e,i);return this.Ss={pathname:null!==(r=null==t?void 0:t.location.pathname)&&void 0!==r?r:"",pageViewId:i,timestamp:e},this._instance.scrollManager.resetContext(),n}doPageLeave(t){var e;return this.Ts(t,null==(e=this.Ss)?void 0:e.pageViewId)}doEvent(){var t;return{$pageview_id:null==(t=this.Ss)?void 0:t.pageViewId}}Ts(t,e){var i=this.Ss;if(!i)return{$pageview_id:e};var r={$pageview_id:e,$prev_pageview_id:i.pageViewId},n=this._instance.scrollManager.getContext();if(n&&!this._instance.config.disable_scroll_properties){var s=n.maxScrollHeight,o=n.lastScrollY,a=n.maxScrollY,l=n.maxContentHeight,u=n.lastContentY,h=n.maxContentY;if(!(at(s)||at(o)||at(a)||at(l)||at(u)||at(h))){s=Math.ceil(s),o=Math.ceil(o),a=Math.ceil(a),l=Math.ceil(l),u=Math.ceil(u),h=Math.ceil(h);var d=s>1?Tt(o/s,0,1,ji):1,v=s>1?Tt(a/s,0,1,ji):1,c=l>1?Tt(u/l,0,1,ji):1,f=l>1?Tt(h/l,0,1,ji):1;r=zi(r,{$prev_pageview_last_scroll:o,$prev_pageview_last_scroll_percentage:d,$prev_pageview_max_scroll:a,$prev_pageview_max_scroll_percentage:v,$prev_pageview_last_content:u,$prev_pageview_last_content_percentage:c,$prev_pageview_max_content:h,$prev_pageview_max_content_percentage:f})}}return i.pathname&&(r.$prev_pageview_pathname=i.pathname),i.timestamp&&(r.$prev_pageview_duration=(t.getTime()-i.timestamp.getTime())/1e3),r}}var Sb=["flags","surveys"],xb={[cn]:{exposure:"hidden"},[mn]:{exposure:"hidden"},__cmpns:{exposure:"hidden"},[yn]:{exposure:"hidden"},[_n]:{exposure:"event"},[bn]:{exposure:"hidden"},[wn]:{exposure:"event"},[kn]:{exposure:"hidden"},[Sn]:{exposure:"event"},[xn]:{exposure:"event"},[Cn]:{exposure:"event"},[Tn]:{exposure:"hidden"},[En]:{exposure:"event"},[Mn]:{exposure:"hidden"},$session_recording_enabled_server_side:{exposure:"hidden"},[Fn]:{exposure:"hidden"},[Ln]:{exposure:"event"},[In]:{exposure:"event",shouldSkipFromEventProperties:t=>ht(t)},[$n]:{exposure:"event"},[Dn]:{exposure:"event"},[Nn]:{exposure:"event"},[Un]:{exposure:"event"},[Hn]:{exposure:"hidden"},[zn]:{exposure:"hidden",storageGroup:"flags"},[Wn]:{exposure:"hidden",storageGroup:"flags"},[Vn]:{exposure:"hidden"},[Gn]:{exposure:"hidden",storageGroup:"flags"},[Zn]:{exposure:"hidden",storageGroup:"flags"},[Qn]:{exposure:"hidden",storageGroup:"flags",volatile:!0},[Jn]:{exposure:"hidden",storageGroup:"flags"},[Kn]:{exposure:"hidden"},[Yn]:{exposure:"hidden"},[Xn]:{exposure:"hidden"},[ts]:{exposure:"hidden"},[is]:{exposure:"hidden",storageGroup:"surveys"},[rs]:{exposure:"hidden",storageGroup:"surveys",volatile:!0},[ns]:{exposure:"event"},[ss]:{exposure:"hidden"},[os]:{exposure:"hidden"},[as]:{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"},[ls]:{exposure:"hidden"},[us]:{exposure:"hidden"},[es]:{exposure:"event"},[hs]:{exposure:"hidden"},[ds]:{exposure:"hidden",storageGroup:"flags",volatile:!0},[vs]:{exposure:"hidden"},[cs]:{exposure:"hidden"},[fs]:{exposure:"hidden"},[ps]:{exposure:"hidden"},[gs]:{exposure:"hidden"},[ms]:{exposure:"hidden"},[ys]:{exposure:"hidden"},[Rn]:{exposure:"event"},[Pn]:{exposure:"event"},[An]:{exposure:"event"},[On]:{exposure:"event"},[ws]:{exposure:"event"},[ks]:{exposure:"event"},[Ss]:{exposure:"event"},[xs]:{exposure:"event"},[Cs]:{exposure:"event"},[Ts]:{exposure:"event"},[Es]:{exposure:"event"},[Ms]:{exposure:"event"},[Is]:{exposure:"event"},[Rs]:{exposure:"event"},[Ps]:{exposure:"event"}},Cb=[[qn,{exposure:"hidden"}],[jn,{exposure:"hidden"}],[Bn,{exposure:"hidden"}]],Tb=t=>{var e=xb[t];if(e)return e;for(var i of Cb){var r=i[1];if(0===t.indexOf(i[0]))return r}},Eb={flags:ds,surveys:rs},Mb=["cookie","localstorage","localstorage+cookie","sessionstorage","memory"],Ib=t=>t+"_cookie_identity_change_pending",Rb="main",Pb=(t,e)=>{Hi(t,((i,r)=>{var n=Tb(r);n&&"event"!==n.exposure||{}.hasOwnProperty.call(e,r)||delete t[r]}))};class Ab{constructor(e,i,r){if(void 0===r&&(r=!0),this.Ms={},this.Es=!1,this.Is=!1,this.Rs=!1,this.Ps=!1,this.qi=e,this.As=r,this.props={},this.Fs=void 0,this.Ls=(t=>{var e="";return t.token&&(e=t.token.replace(/\+/g,"PL").replace(/\//g,"SL").replace(/=/g,"EQ")),t.persistence_name?"ph_"+t.persistence_name:"ph_"+e+"_posthog"})(e),this.ps=this.Os(e),this.Is=this.Ds(e),this.load(),e.debug&&ji.info("Persistence loaded",e.persistence,p({},this.props)),this.update_config(e,e,i),this.save(),t){var n=()=>this.flush();Ki(t,"beforeunload",n,{capture:!1}),Ki(t,"pagehide",n,{capture:!1})}}$s(){var t,e=null==(t=this.qi)?void 0:t.persistence_save_debounce_ms;return vt(e)&&e>0?e:0}Ns(t){if(this.qi.cookieWinsOnConflict&&"localstorage+cookie"===this.qi.persistence.toLowerCase())if(t)try{var e=Hf(t,this.qi.cookie_persisted_properties||[]),i=Wf(e,this.qi.cookie_persisted_properties||[]),r=JSON.stringify(e)+"|"+JSON.stringify(i),n=Lf.Pr(this.Ls)||void 0;n&&Gf(this.Ls,n)===r&&(this.qs=r,this.js=n)}catch(t){}else try{var s=Lf.Pr(this.Ls)||void 0;this.qs=s?Gf(this.Ls,s):void 0,this.js=s}catch(t){}}syncCookieProperties(){return this.Bs(this.qi)}Bs(t,e){if(void 0===e&&(e=!1),this.Hs&&!e||this.Ps||!t.cookieWinsOnConflict||"localstorage+cookie"!==t.persistence.toLowerCase())return!1;var i;try{i=Lf.Pr(this.Ls)||void 0}catch(t){}if(!i||i===this.js)return!1;var r,n=Gf(this.Ls,i);try{r=Uf(JSON.parse(i))}catch(t){return!1}if((Lf.Pr(this.Ls)||void 0)!==i)return!1;this.qs=n,this.js=i;var s=Vf(this.Ls,i),o=[...qf,...s.properties],a={};if(Object.keys(r).forEach((t=>{var e=r[t];(at(e)||ht(e)||""===e||t===vs&&e!==Ls&&e!==$s)&&(a[t]=!0,delete r[t])})),ot(r))return!1;var l=fn in r||r[vs]===Ls||r[vs]===$s,u=this.props[fn],h=this.props[vs],d=zi({},this.props);[...qf,...t.cookie_persisted_properties||[]].forEach((t=>{if(-1!==o.indexOf(t)&&!(t in r)&&!a[t]&&(l||t!==fn&&t!==vs)){var e=d[t];!s.isValid&&-1!==qf.indexOf(t)&&(!1===e||0===e)||delete d[t]}})),this.props=zi(d,r),!l||vs in r||vs in this.props||this.Us(vs,Ls);var v=this.props[fn],c=this.props[vs];return!l||v===u&&c===h||(this.Rs=!0,Kf.Dr(Ib(this.Ls),!0),this.zs(Xn),this.zs(Wn),this.zs(zn),this.zs(Gn),this.zs(Zn),this.zs(Qn),this.zs(ds),this.zs(hs),this.zs(ls),c===Ls&&(h===$s||r[vs]===Ls||!at(u)&&v!==u)&&(Pb(this.props,r),this.zs(ts)),c===$s?this.props.$user_id=v:delete this.props.$user_id,this.zs(mn)),!0}consumeCookieIdentityChange(){var t=Ib(this.Ls),e=this.Rs||!!Kf.Pr(t);return this.Rs=!1,e&&Kf.qr(t),e}Ws(t){return void 0===t&&(t=!1),!(this.Ps||this.Hs&&!t||!this.qi.cookieWinsOnConflict||"localstorage+cookie"!==this.qi.persistence.toLowerCase()||(this.Ps=!0,0))}Vs(){this.Ps&&(at(this.Gs)||(clearTimeout(this.Gs),this.Gs=void 0),delete this.Ms[Rb],this.Zs(!0))}Qs(t){if(void 0===t&&(t=!0),this.Ps)try{t?this.Vs():at(this.Gs)||(clearTimeout(this.Gs),this.Gs=void 0)}finally{this.Ps=!1}}isDisabled(){return!!this.Hs}Os(e){-1===Mb.indexOf(e.persistence.toLowerCase())&&(ji.critical("Unknown persistence type "+e.persistence+"; falling back to localStorage+cookie"),e.persistence="localStorage+cookie");var i,r=function(e,i){void 0===e&&(e=[]),void 0===i&&(i=!1);var r=[...qf,...e];return p({},Df,{Br(t){try{var e,n={};try{e=Lf.Pr(t)||void 0,n=e?Uf(JSON.parse(e)):{}}catch(t){}var s,o=JSON.parse(Df.Pr(t)||"{}");if(i){var a=Vf(t,e),l=[...qf,...a.properties],u={};Object.keys(n).forEach((t=>{var e=n[t];ht(e)||""===e||t===vs&&e!==Ls&&e!==$s||(u[t]=e)}));var h=fn in u||u[vs]===Ls||u[vs]===$s;if(Object.keys(u).length>0){var d,v=o[fn],c=null!==(d=o[vs])&&void 0!==d?d:Ls;r.forEach((t=>{if(-1!==l.indexOf(t)&&!(t in n)&&(h||t!==fn&&t!==vs)){var e=o[t];!a.isValid&&-1!==qf.indexOf(t)&&(!1===e||0===e)||delete o[t]}})),!h||vs in n||vs in o||(o[vs]=Ls),!h||(fn in u?u[fn]:o[fn])===v&&(vs in u?u[vs]:o[vs])===c||(Nf.forEach((t=>delete o[t])),u[vs]===$s&&fn in u?o.$user_id=u[fn]:delete o.$user_id,u[vs]!==$s&&(delete o[es],delete o[ts]),delete o.__alias)}s=zi(o,u)}else s=zi(n,o);return Df.Dr(t,s),s}catch(t){}return null},Dr(t,r,n,s,o,a){var l=Df.Dr(t,r,void 0,void 0,a);try{var u=Hf(r,e);if(Object.keys(u).length){if(i){var h=jf(t),d=Wf(u,e);if(Lf.Dr(h,d,n,s,o,a),Lf.Pr(h)!==JSON.stringify(d)){Lf.qr(h,s);var v=Hf(r);return Lf.Dr(t,v,n,s,o,a),l}}Lf.Dr(t,u,n,s,o,a)}}catch(t){Df.jr(t)}return l},qr(e,i){try{null==t||t.localStorage.removeItem(e),Lf.qr(e,i),Lf.qr(jf(e),i)}catch(t){Df.jr(t)}}})}(e.cookie_persisted_properties||[],e.cookieWinsOnConflict),n=!1,s=e.persistence.toLowerCase();return"localstorage"===s&&Df.Nr()?(i=Df,n=!0):"localstorage+cookie"===s&&r.Nr()?(i=r,n=!0):"sessionstorage"===s&&Kf.Nr()?i=Kf:"memory"===s?i=Qf:"cookie"===s?i=Lf:r.Nr()?(i=r,n=!0):i=Lf,this.Es=n,i}Js(t){return this.Ls+"__"+t}Ds(t){return this.Es&&!!t.split_storage}properties(){var t={};return Hi(this.props,((e,i)=>{var r=Tb(i);if(!r||"event"===r.exposure){if(null!=r&&null!=r.shouldSkipFromEventProperties&&r.shouldSkipFromEventProperties(e))return;t[i]=e}})),t}load(t){if(void 0===t&&(t=!1),!this.Hs||t){var e=this.qi.cookieWinsOnConflict&&"localstorage+cookie"===this.qi.persistence.toLowerCase(),i=e?Df.Br(this.Ls):null,r={};if(e)try{Hi(r=Uf(Lf.Br(this.Ls)),((t,e)=>{(at(t)||ht(t)||""===t)&&delete r[e]}))}catch(t){}var n=this.ps.Br(this.Ls);if(n&&(this.props=zi({},n)),this.Is&&this.Ks(),e&&n){var s,o,a=null==i?void 0:i[fn],l=null!==(s=null==i?void 0:i[vs])&&void 0!==s?s:Ls,u=n[fn],h=null!==(o=n[vs])&&void 0!==o?o:Ls;if(u!==a||h!==l){this.Rs=!0,Kf.Dr(Ib(this.Ls),!0);var d=zi({},this.props);Nf.forEach((t=>delete d[t])),h===Ls&&(l===$s||r[vs]===Ls||!at(a)&&u!==a)&&(Pb(d,r),delete d[ts]),this.props=d;var v=new Set;Nf.forEach((t=>{var e,i=null==(e=Tb(t))?void 0:e.storageGroup;i&&v.add(i)})),v.forEach((t=>{var e={};Hi(this.props,((i,r)=>{var n;(null==(n=Tb(r))?void 0:n.storageGroup)===t&&(e[r]=i)})),ot(e)?(Df.qr(this.Js(t)),this.Ms[t]={}):Df.Dr(this.Js(t),e)&&(this.Ms[t]={persisted:!0,fingerprint:this.Ys(e,t)})}))}}Kf.Pr(Ib(this.Ls))&&(this.Rs=!0)}}Ks(){for(var t of Sb){var e=Df.Br(this.Js(t));if(e&&!ot(e)){var i=this.Xs(t);i.persisted=!0,this.ta(t)||(i.fingerprint=this.Ys(e,t)),this.ea(t,e)||zi(this.props,e)}}}ta(t){return Object.keys(this.props).some((e=>{var i;return(null==(i=Tb(e))?void 0:i.storageGroup)===t}))}ea(t,e){var i=Eb[t];if(!i)return!1;var r=e[i],n=this.props[i];return vt(r)&&vt(n)&&n>r}refreshKey(t){var e;if(!this.Hs){var i=this.Is?null==(e=Tb(t))?void 0:e.storageGroup:void 0,r=i?Df.Br(this.Js(i)):this.ps.Br(this.Ls);if(r&&t in r)this.Us(t,r[t]);else{if(i){var n=this.ps.Br(this.Ls);if(n&&t in n)return void this.Us(t,n[t])}this.zs(t)}}}save(){if(!this.Hs){var t=this.$s();t>0?at(this.Gs)&&(this.Gs=setTimeout((()=>{this.Gs=void 0,this.Zs()}),t)):this.Zs()}}flush(){at(this.Gs)||(clearTimeout(this.Gs),this.Gs=void 0,this.Zs())}Zs(t){void 0===t&&(t=!1),this.Hs||this.Ps&&!t||(t||this.syncCookieProperties(),this.Is?this.ia():this.ra(this.ps,this.Ls,this.props,Rb)&&this.Ns(this.props))}ia(){var t=this.na(),e=t.main,i=t.groups;for(var r of(this.ra(this.ps,this.Ls,e,Rb)&&this.Ns(e),Sb)){var n,s=i[r];(!ot(s)||null!=(n=this.Ms[r])&&n.persisted)&&this.ra(Df,this.Js(r),s,r)}}na(){var t={},e={flags:{},surveys:{}};return Hi(this.props,((i,r)=>{var n,s=null==(n=Tb(r))?void 0:n.storageGroup;s?e[s][r]=i:t[r]=i})),{main:t,groups:e}}Ys(t,e){if(e===Rb)return JSON.stringify(t)+"|"+this.sa+"|"+this.aa+"|"+this.oa;var i={};return Hi(t,((t,e)=>{var r;i[e]=null!=(r=Tb(e))&&r.volatile?"__volatile__":t})),JSON.stringify(i)}ra(t,e,i,r){var n,s=this.Xs(r);if(r!==Rb&&!s.dirty&&!at(s.fingerprint))return!1;try{if((n=this.Ys(i,r))===s.fingerprint)return s.dirty=!1,!1}catch(t){n=void 0}return t.Dr(e,i,this.sa,this.aa,this.oa,this.qi.debug)?(s.dirty=!1,r!==Rb&&(s.persisted=!0),at(n)||(s.fingerprint=n),!0):(this.qi.debug&&ji.warn('failed to persist storage entry "'+e+'"; will retry on next save'),!1)}remove(t){var e=(void 0===t?{}:t).keepGroupEntries,i=void 0!==e&&e;if(at(this.Gs)||(clearTimeout(this.Gs),this.Gs=void 0),this.ps.qr(this.Ls,!1),this.ps.qr(this.Ls,!0),!i&&this.As)for(var r of Sb)Df.qr(this.Js(r));i?delete this.Ms[Rb]:this.Ms={},this.qs=void 0,this.js=void 0}clear(){this.remove(),this.props={}}register_once(t,e,i){if(st(t)){this.syncCookieProperties(),at(e)&&(e="None"),this.sa=at(i)?this.la:i;var r=!1;if(Hi(t,((t,i)=>{this.props.hasOwnProperty(i)&&this.props[i]!==e||(this.Us(i,t),r=!0)})),r)return this.save(),!0}return!1}register(t,e){if(st(t)){this.syncCookieProperties(),this.sa=at(e)?this.la:e;var i=!1;if(Hi(t,((e,r)=>{t.hasOwnProperty(r)&&(this.props[r]!==e||st(e)||rt(e))&&(this.Us(r,e),i=!0)})),i)return this.save(),!0}return!1}unregister(t){this.syncCookieProperties();var e="string"==typeof t?[t]:t,i=!1;for(var r of e)r in this.props&&(this.zs(r),i=!0);i&&this.save()}update_campaign_params(){var t=null==r?void 0:r.URL;if(t!==this.Fs){var e=Na(this.qi.custom_campaign_params,this.qi.mask_personal_data_properties,this.qi.custom_personal_data_properties);ot(Zi(e))||this.register(e),this.Fs=t}}update_search_keyword(){var t;this.register((t=null==r?void 0:r.referrer)?ja(t):{})}update_referrer_info(){var t;this.register_once({$referrer:Ha(),$referring_domain:null!=r&&r.referrer&&(null==(t=er(r.referrer))?void 0:t.host)||Ua},void 0)}set_initial_person_info(){this.props[ps]||this.props[gs]||this.register_once({[ms]:za(this.qi.mask_personal_data_properties,this.qi.custom_personal_data_properties,this.qi.disable_capture_url_hashes)},void 0)}get_initial_props(){var t={};Hi([gs,ps],(e=>{var i=this.props[e];i&&Hi(i,(function(e,i){t["$initial_"+Y(i)]=e}))}));var e=this.props[ms];if(e){var i=function(t,e){void 0===e&&(e=!1);var i=Wa(t,e),r={};return Hi(i,(function(t,e){r["$initial_"+Y(e)]=t})),r}(e,this.qi.disable_capture_url_hashes);zi(t,i)}return t}safe_merge(t){return Hi(this.props,(function(e,i){i in t||(t[i]=e)})),t}update_config(t,e,i){var r=t.persistence!==e.persistence,n=!((t,e)=>{if(t.length!==e.length)return!1;var i=[...t].sort(),r=[...e].sort();return i.every(((t,e)=>t===r[e]))})(t.cookie_persisted_properties||[],e.cookie_persisted_properties||[]),s=r||n,o=t.cookieWinsOnConflict!==e.cookieWinsOnConflict,a=t.disable_persistence||!!i,l=!!this.Hs&&!a;a||this.Bs(e,l),this.qi=t,!a&&(r||n||o)&&(this.qs=void 0,this.js=void 0,this.Bs(p({},t,{cookie_persisted_properties:e.cookie_persisted_properties}),l));var u=s||o?this.Os(t):this.ps,h=this.Ds(t),d=s||h!==this.Is,v=!a&&(d||t.cross_subdomain_cookie!==this.aa||t.secure_cookie!==this.oa)&&this.Ws(l);try{if(this.la=this.sa=t.cookie_expiration,this.set_disabled(a),this.set_cross_subdomain(t.cross_subdomain_cookie),this.set_secure(t.secure_cookie),d){var c=this.props;this.clear(),this.ps=u,this.Is=h,this.props=c,this.save()}else o&&(this.ps=u,a||(delete this.Ms[Rb],this.Zs()))}finally{v&&this.Qs()}}set_disabled(t){this.Hs=t,this.Hs?this.remove():this.save()}set_cross_subdomain(t){t!==this.aa&&(this.aa=t,this.remove({keepGroupEntries:!0}),this.save())}set_secure(t){t!==this.oa&&(this.oa=t,this.remove({keepGroupEntries:!0}),this.save())}set_event_timer(t,e){var i=this.props[yn]||{};i[t]=e,this.Us(yn,i),this.save()}remove_event_timer(t){var e=this.props[yn]||{},i=e[t];return at(i)||(delete e[t],this.Us(yn,e),this.save()),i}get_property(t){return this.props[t]}set_property(t,e){this.Us(t,e),this.save()}Us(t,e){var i;this.props[t]=e,null!=(i=Tb(t))&&i.volatile||this.ua(t)}zs(t){delete this.props[t],this.ua(t)}ua(t){var e,i=null==(e=Tb(t))?void 0:e.storageGroup;i&&(this.Xs(i).dirty=!0)}Xs(t){return this.Ms[t]||(this.Ms[t]={})}}var Ob={backgroundColor:"#ffffff",textColor:"#1d1f27",buttonColor:"#1d1f27",borderRadius:8,buttonBorderRadius:6,borderColor:"#e5e7eb",fontFamily:"system-ui",boxShadow:"0 4px 12px rgba(0, 0, 0, 0.15)",showOverlay:!0,whiteLabel:!1,dismissOnClickOutside:!0,zIndex:2147483646},Fb={SHOWN:"product tour shown",DISMISSED:"product tour dismissed",COMPLETED:"product tour completed",STEP_SHOWN:"product tour step shown",STEP_COMPLETED:"product tour step completed",BUTTON_CLICKED:"product tour button clicked",STEP_SELECTOR_FAILED:"product tour step selector failed",BANNER_CONTAINER_SELECTOR_FAILED:"product tour banner container selector failed",BANNER_ACTION_CLICKED:"product tour banner action clicked"},Lb={TOUR_ID:"$product_tour_id",TOUR_NAME:"$product_tour_name",TOUR_ITERATION:"$product_tour_iteration",TOUR_RENDER_REASON:"$product_tour_render_reason",TOUR_STEP_ID:"$product_tour_step_id",TOUR_STEP_ORDER:"$product_tour_step_order",TOUR_STEP_TYPE:"$product_tour_step_type",TOUR_DISMISS_REASON:"$product_tour_dismiss_reason",TOUR_BUTTON_TEXT:"$product_tour_button_text",TOUR_BUTTON_ACTION:"$product_tour_button_action",TOUR_BUTTON_LINK:"$product_tour_button_link",TOUR_BUTTON_TOUR_ID:"$product_tour_button_tour_id",TOUR_STEPS_COUNT:"$product_tour_steps_count",TOUR_STEP_SELECTOR:"$product_tour_step_selector",TOUR_STEP_SELECTOR_FOUND:"$product_tour_step_selector_found",TOUR_STEP_ELEMENT_TAG:"$product_tour_step_element_tag",TOUR_STEP_ELEMENT_ID:"$product_tour_step_element_id",TOUR_STEP_ELEMENT_CLASSES:"$product_tour_step_element_classes",TOUR_STEP_ELEMENT_TEXT:"$product_tour_step_element_text",TOUR_ERROR:"$product_tour_error",TOUR_MATCHES_COUNT:"$product_tour_matches_count",TOUR_FAILURE_PHASE:"$product_tour_failure_phase",TOUR_WAITED_FOR_ELEMENT:"$product_tour_waited_for_element",TOUR_WAIT_DURATION_MS:"$product_tour_wait_duration_ms",TOUR_BANNER_SELECTOR:"$product_tour_banner_selector",TOUR_LINKED_SURVEY_ID:"$product_tour_linked_survey_id",USE_MANUAL_SELECTOR:"$use_manual_selector",INFERENCE_DATA_PRESENT:"$inference_data_present",TOUR_LAST_SEEN_DATE:"$product_tour_last_seen_date",TOUR_TYPE:"$product_tour_type"},$b=Bi("[RateLimiter]");class Db{constructor(t){this.serverLimits={},this.lastEventRateLimited=!1,this.checkForLimiting=t=>{var e=t.text;if(e&&e.length)try{(JSON.parse(e).quota_limited||[]).forEach((t=>{$b.info((t||"events")+" is quota limited."),this.serverLimits[t]=(new Date).getTime()+6e4}))}catch(t){return void $b.warn('could not rate limit - continuing. Error: "'+(null==t?void 0:t.message)+'"',{text:e})}},this.instance=t,this.lastEventRateLimited=this.clientRateLimitContext(!0).isRateLimited}get captureEventsPerSecond(){var t;return(null==(t=this.instance.config.rate_limiting)?void 0:t.events_per_second)||10}get captureEventsBurstLimit(){var t;return Math.max((null==(t=this.instance.config.rate_limiting)?void 0:t.events_burst_limit)||10*this.captureEventsPerSecond,this.captureEventsPerSecond)}clientRateLimitContext(t){var e,i,r;void 0===t&&(t=!1);var n=this.captureEventsBurstLimit,s=this.captureEventsPerSecond,o=(new Date).getTime(),a=null!==(e=null==(i=this.instance.persistence)?void 0:i.get_property(fs))&&void 0!==e?e:{tokens:n,last:o};a.tokens+=(o-a.last)/1e3*s,a.last=o,a.tokens>n&&(a.tokens=n);var l=1>a.tokens;if(l||t||(a.tokens=Math.max(0,a.tokens-1)),l&&!t){var u=(vt(a.dropped)?a.dropped:0)+1;a.dropped=u,!this.lastEventRateLimited&&this.ha(u)&&(a.dropped=0)}return this.lastEventRateLimited=l,null==(r=this.instance.persistence)||r.set_property(fs,a),{isRateLimited:l,remainingTokens:a.tokens}}da(t){var e=this.instance.config.property_denylist;return!rt(e)||!e.includes(t)}va(){var t;if(this.da("$current_url")&&this.da("$pathname")&&null!=n&&n.pathname)return""+(null!==(t=n.origin)&&void 0!==t?t:"")+n.pathname}ha(t){var e,i,r=this.captureEventsBurstLimit,n=this.captureEventsPerSecond,s=this.va(),o=this.da("$session_id")?null==(e=(i=this.instance).get_session_id)?void 0:e.call(i):void 0,a=[t+" event(s) dropped since the last warning",s?"triggered on "+s: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 "+n+" events per second and "+r+" events burst limit."},{skip_client_rate_limiting:!0})}isServerRateLimited(t){var e=this.serverLimits[t||"events"]||!1;return!1!==e&&(new Date).getTime()<e}}var Nb=Bi("[RemoteConfig]");class qb{constructor(t){this._instance=t}get remoteConfig(){var t;return null==(t=v._POSTHOG_REMOTE_CONFIG)||null==(t=t[this._instance.config.token])?void 0:t.config}ca(t){var e,i;null!=(e=v.__PosthogExtensions__)&&e.loadExternalDependency?null==(i=v.__PosthogExtensions__)||null==i.loadExternalDependency||i.loadExternalDependency(this._instance,"remote-config",(()=>t(this.remoteConfig))):t()}fa(t){this._instance._send_request({method:"GET",url:this._instance.requestRouter.endpointFor("assets","/array/"+this._instance.config.token+"/config"),callback:t})}load(){try{if(this.remoteConfig)return Nb.info("Using preloaded remote config",this.remoteConfig),this.pa(this.remoteConfig),void this.ga();if(this._instance.ma())return void Nb.warn("Remote config is disabled. Falling back to local config.");this.ca((t=>{if(!t)return Nb.info("No config found after loading remote JS config. Falling back to JSON."),void this.fa((t=>{this.pa(t.json,t),this.ga()}));this.pa(t),this.ga()}))}catch(t){Nb.error("Error loading remote config",t),this.pa()}}stop(){this.ya&&(clearInterval(this.ya),this.ya=void 0)}refresh(){!this._instance.ma()&&r&&"hidden"!==r.visibilityState&&this._instance.reloadFeatureFlags()}ga(){var t;if(!this.ya){var e=null!==(t=this._instance.config.remote_config_refresh_interval_ms)&&void 0!==t?t:3e5;0!==e&&(this.ya=setInterval((()=>{this.refresh()}),e))}}pa(t,e){!t&&e&&(0===e.statusCode?e.error||Nb.warn("Failed to fetch remote config from PostHog."):Nb.error("Failed to fetch remote config from PostHog."));try{this._instance.pa(t?{ok:!0,config:t}:{ok:!1})}catch(t){Nb.error("Error applying remote config",t)}if(!1!==(null==t?void 0:t.hasFeatureFlags)&&!this._instance.config.advanced_disable_feature_flags_on_first_load)try{var i;null==(i=this._instance.featureFlags)||i.ensureFlagsLoaded()}catch(t){Nb.error("Error loading feature flags",t)}}}var jb=["fatal","error","warning","log","info","debug"],Bb=!!o||!!s,Ub="text/plain",Hb=!1,zb=(t,e)=>{var i=t.split("#"),r=i[1],n=i[0].split("?"),s=n[0],o=n[1];if(!o)return t;var a=o.split("&").filter((t=>t.split("=")[0]!==e)).join("&");return s+(a?"?"+a:"")+(r?"#"+r:"")},Wb=function(t,e,i){var r;void 0===i&&(i=!0);var n=t.split("?"),s=n[0],o=n[1],a=p({},e),l=null!==(r=null==o?void 0:o.split("&").map((t=>{var e,r=t.split("="),n=r[0],s=i&&null!==(e=a[n])&&void 0!==e?e:r[1];return delete a[n],n+"="+s})))&&void 0!==r?r:[],u=ir(a);return u&&l.push(u),l.length>0?s+"?"+l.join("&"):s},Vb=t=>{if(t.ba)return t.ba;var e=t.data,i=t.compression;if(e){if(i===nf.GZipJS){var r=ra(na(tr(e)),{mtime:0});return{contentType:Ub,body:r.buffer.slice(r.byteOffset,r.byteOffset+r.byteLength),estimatedSize:r.byteLength}}if(i===nf.Base64){var n=function(t){return t?btoa(encodeURIComponent(t).replace(/%([0-9A-F]{2})/g,((t,e)=>String.fromCharCode(parseInt(e,16))))):t}(tr(e)),s=(t=>"data="+encodeURIComponent("string"==typeof t?t:tr(t)))(n);return{contentType:"application/x-www-form-urlencoded",body:s,estimatedSize:new Blob([s]).size}}var o=tr(e);return{contentType:"application/json",body:o,estimatedSize:new Blob([o]).size}}},Gb=t=>{var e,i,r=()=>"sendBeacon"===t.transport?{url:Wb(t.url,{compression:nf.Base64}),encodedBody:Vb(p({},t,{compression:nf.Base64,ba:void 0}))}:{url:zb(t.url,"compression"),encodedBody:Vb(p({},t,{compression:void 0,ba:void 0}))};try{e=Vb(t)}catch(e){if(A(t.compression,rr(t.url,"compression")))return ji.error("Failed to gzip request body, sending uncompressed payload",e),r();throw e}return e&&A(t.compression,rr(t.url,"compression"))&&!((i=e.body)instanceof ArrayBuffer?P(new Uint8Array(i)):ArrayBuffer.isView(i)&&P(new Uint8Array(i.buffer,i.byteOffset,i.byteLength)))?(Hb=!0,r()):{url:t.url,encodedBody:e}},Zb=t=>{try{return Gb(t)}catch(e){return ji.error(e),void(null==t.callback||t.callback({statusCode:0,error:e}))}},Qb=function(){var t=f((function*(t){var e=tr(t.data),i=yield N(e,Ni.DEBUG,{rethrow:!0});if(!i)return t;var r=yield i.arrayBuffer();return p({},t,{ba:{contentType:Ub,body:r,estimatedSize:r.byteLength}})}));return function(e){return t.apply(this,arguments)}}(),Jb=/Failed to fetch|NetworkError|Load failed/i,Kb=t=>"TypeError"===(null==t?void 0:t.name)&&Jb.test((null==t?void 0:t.message)||""),Yb=t=>{var e=Zb(t);if(e){var i=e.url,r=e.encodedBody,n=null!=r?r:{},o=n.contentType,l=n.body,u=n.estimatedSize,h=new Headers;Hi(t.headers,(function(t,e){h.append(e,t)})),o&&h.append("Content-Type",o);var d=null,v=!1;if(a){var c=new a;d={signal:c.signal,timeout:setTimeout((()=>{var e,i;v=!0,c.abort((e=t.timeout,(i=new Error("PostHog request timed out"+(e?" after "+e+"ms":""))).name="AbortError",i))}),t.timeout)}}var f=e=>{v&&"AbortError"===(null==e?void 0:e.name)||Kb(e)?ji.warn(e):ji.error(e),null==t.callback||t.callback({statusCode:0,error:e})};try{var g;s(i,p({method:(null==t?void 0:t.method)||"GET",headers:h,keepalive:"POST"===t.method&&!t._a&&52428.8>(u||0),body:l,signal:null==(g=d)?void 0:g.signal},t.fetchOptions)).then((e=>e.text().then((i=>{var r={statusCode:e.status,text:i};if(200===e.status)try{r.json=JSON.parse(i)}catch(t){ji.error(t)}null==t.callback||t.callback(r)})))).catch(f).finally((()=>d?clearTimeout(d.timeout):null))}catch(t){d&&clearTimeout(d.timeout),f(t)}}},Xb=t=>{try{var e,r=Gb(t),n=r.url,s=r.encodedBody,o=null!=s?s:{},a=o.body,l=o.estimatedSize;if(!a)return;var u=a instanceof Blob?a:new Blob([a],{type:o.contentType});if(i.sendBeacon(n,u))return;var h=rt(t.data)?t.data:null==(e=t.data)?void 0:e.batch;if(rt(h)&&h.length>1&&(null!=l?l:0)>16384){var d=Math.ceil(h.length/2),v=e=>rt(t.data)?e:p({},t.data,{batch:e});return Xb(p({},t,{data:v(h.slice(0,d))})),void Xb(p({},t,{data:v(h.slice(d))}))}ji.warn("Beacon of ~"+(null!=l?l:0)+" bytes was rejected by the browser, falling back to fetch"),Yb(p({},t,{_a:!0}))}catch(t){ji.warn("Beacon send failed",t)}},tw=(t,e,i,r)=>{var n="query"===r?"POST"===e?"sent_at":"_":void 0;return Wb(i===nf.GZipJS?zb(t,"compression"):t,p({},n?{[n]:Date.now().toString()}:{},i===nf.GZipJS?{}:{compression:i}))},ew=[];s&&ew.push({transport:"fetch",method:Yb}),o&&ew.push({transport:"XHR",method(t){var e=Zb(t);if(e){var i=new o,r=e.encodedBody;i.open(t.method||"GET",e.url,!0);var n=null!=r?r:{},s=n.contentType,a=n.body;Hi(t.headers,(function(t,e){i.setRequestHeader(e,t)})),s&&i.setRequestHeader("Content-Type",s),t.timeout&&(i.timeout=t.timeout),i.onreadystatechange=()=>{if(4===i.readyState){var e={statusCode:i.status,text:i.responseText};if(200===i.status)try{e.json=JSON.parse(i.responseText)}catch(t){}null==t.callback||t.callback(e)}},i.send(a)}}}),null!=i&&i.sendBeacon&&ew.push({transport:"sendBeacon",method:Xb});var iw=3e3;class rw{constructor(t,e){this.wa=!0,this.ka=[],this.Sa=Tt((null==e?void 0:e.flush_interval_ms)||iw,250,5e3,ji.createLogger("flush interval"),iw),this.xa=t}enqueue(t){this.ka.push(t),this.Ca||this.Ta()}unload(){this.Ma();var t=this.ka.length>0?this.Ea():{},e=Object.values(t),i=[...e.filter((t=>0===t.url.indexOf("/e"))),...e.filter((t=>0!==t.url.indexOf("/e")))];i.map((t=>{this.Ia(p({},t,{transport:"sendBeacon"}))}))}enable(){this.wa=!1,this.Ta()}Ta(){var t=this;this.wa||(this.Ca=setTimeout((()=>{if(this.Ma(),this.ka.length>0){var e=this.Ea(),i=function(){var i=e[r],n=(new Date).getTime();i.data&&rt(i.data)&&Hi(i.data,(t=>{t.offset=Math.abs(t.timestamp-n),delete t.timestamp})),t.Ia(i)};for(var r in e)i()}}),this.Sa))}Ia(t){try{this.xa(t)}catch(t){ji.error(t)}}Ma(){clearTimeout(this.Ca),this.Ca=void 0}Ea(){var t={};return Hi(this.ka,(e=>{var i,r=e,n=(r?r.batchKey:null)||r.url;at(t[n])&&(t[n]=p({},r,{data:[]})),null==(i=t[n].data)||i.push(r.data)})),this.ka=[],t}}var nw=["retriesPerformedSoFar"];class sw{constructor(e){this.Ra=!1,this.Pa=3e3,this.ka=[],this._instance=e,this.ka=[],this.Aa=!0,!at(t)&&"onLine"in t.navigator&&(this.Aa=t.navigator.onLine,this.Fa=()=>{this.Aa=!0,this.La()},this.Oa=()=>{this.Aa=!1},Ki(t,"online",this.Fa),Ki(t,"offline",this.Oa))}get length(){return this.ka.length}retriableRequest(t){var e=t.retriesPerformedSoFar,i=g(t,nw);ct(e)&&(i.url=Wb(i.url,{retry_count:e})),this._instance._send_request(p({},i,{callback:t=>{if(200!==t.statusCode&&(400>t.statusCode||t.statusCode>=500)){if((0===t.statusCode?3:10)>(null!=e?e:0))return void this.xn(p({retriesPerformedSoFar:e},i));0===t.statusCode&&ji.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!=e?e:0)+" retries.")}null==i.callback||i.callback(t)}}))}xn(t){var e=t.retriesPerformedSoFar||0;t.retriesPerformedSoFar=e+1;var i=function(t){var e=3e3*Math.pow(2,t),i=e/2,r=Math.min(18e5,e),n=Math.random()-.5;return Math.ceil(r+n*(r-i))}(e),r=Date.now()+i;this.ka.push({retryAt:r,requestOptions:t});var n="Enqueued failed request for retry in "+i;navigator.onLine||(n+=" (Browser is offline)"),ji.warn(n),this.Ra||(this.Ra=!0,this.Da())}Da(){if(this.$a&&clearTimeout(this.$a),0===this.ka.length)return this.Ra=!1,void(this.$a=void 0);this.$a=setTimeout((()=>{this.Aa&&this.ka.length>0&&this.La(),this.Da()}),this.Pa)}La(){var t=Date.now(),e=[],i=this.ka.filter((i=>t>i.retryAt||(e.push(i),!1)));if(this.ka=e,i.length>0)for(var r of i)this.retriableRequest(r.requestOptions)}unload(){for(var e of(this.$a&&(clearTimeout(this.$a),this.$a=void 0),this.Ra=!1,at(t)||(this.Fa&&(t.removeEventListener("online",this.Fa),this.Fa=void 0),this.Oa&&(t.removeEventListener("offline",this.Oa),this.Oa=void 0)),this.ka)){var i=e.requestOptions;try{this._instance._send_request(p({},i,{transport:"sendBeacon"}))}catch(t){ji.error(t)}}this.ka=[]}}class ow{constructor(t){this.Na=()=>{var t,e,i,r;this.qa||(this.qa={});var n=this.scrollElement(),s=this.scrollY(),o=n?Math.max(0,n.scrollHeight-n.clientHeight):0,a=s+((null==n?void 0:n.clientHeight)||0),l=(null==n?void 0:n.scrollHeight)||0;this.qa.lastScrollY=Math.ceil(s),this.qa.maxScrollY=Math.max(s,null!==(t=this.qa.maxScrollY)&&void 0!==t?t:0),this.qa.maxScrollHeight=Math.max(o,null!==(e=this.qa.maxScrollHeight)&&void 0!==e?e:0),this.qa.lastContentY=a,this.qa.maxContentY=Math.max(a,null!==(i=this.qa.maxContentY)&&void 0!==i?i:0),this.qa.maxContentHeight=Math.max(l,null!==(r=this.qa.maxContentHeight)&&void 0!==r?r:0)},this._instance=t}get ja(){return this._instance.config.scroll_root_selector}getContext(){return this.qa}resetContext(){var t=this.qa;return setTimeout(this.Na,0),t}startMeasuringScrollPosition(){Ki(t,"scroll",this.Na,{capture:!0}),Ki(t,"scrollend",this.Na,{capture:!0}),Ki(t,"resize",this.Na)}scrollElement(){if(!this.ja)return null==t?void 0:t.document.documentElement;var e=rt(this.ja)?this.ja:[this.ja];for(var i of e){var r=null==t?void 0:t.document.querySelector(i);if(r)return r}}Ba(e){var i="y"===e?"scrollTop":"scrollLeft";if(this.ja){var r=this.scrollElement();return r&&r[i]||0}return t?"y"===e?t.scrollY||t.pageYOffset||t.document.documentElement.scrollTop||0:t.scrollX||t.pageXOffset||t.document.documentElement.scrollLeft||0:0}scrollY(){return this.Ba("y")}scrollX(){return this.Ba("x")}}var aw=t=>za(null==t?void 0:t.config.mask_personal_data_properties,null==t?void 0:t.config.custom_personal_data_properties,null==t?void 0:t.config.disable_capture_url_hashes);class lw{constructor(t,e,i,r){this.ot=t=>{var e=this.Ha();if(!e||e.sessionId!==t){var i={sessionId:t,props:this.Ua(this._instance)};this.za.register({[cs]:i})}},this._instance=t,this.Wa=e,this.za=i,this.Ua=r||aw,this.Wa.onSessionId(this.ot)}Ha(){return this.za.props[cs]}getSetOnceProps(){var t,e=null==(t=this.Ha())?void 0:t.props;return e?"r"in e?Wa(e,this._instance.config.disable_capture_url_hashes):{$referring_domain:e.referringDomain,$pathname:e.initialPathName,utm_source:e.utm_source,utm_campaign:e.utm_campaign,utm_medium:e.utm_medium,utm_content:e.utm_content,utm_term:e.utm_term}:{}}getSessionProps(){var t={};return Hi(Zi(this.getSetOnceProps()),((e,i)=>{"$current_url"===i&&(i="url"),t["$session_entry_"+Y(i)]=e})),t}}class uw{on(t,e){return this.Va[t]||(this.Va[t]=[]),this.Va[t].push(e),()=>{this.Va[t]=this.Va[t].filter((t=>t!==e))}}emit(t,e){for(var i of this.Va[t]||[])i(e);for(var r of this.Va["*"]||[])r(t,e)}constructor(){this.Va={}}}var hw=Bi("[SessionId]"),dw=864e5;class vw{on(t,e){return this.Ga.on(t,e)}constructor(t,e,i){var r;if(this.Za=null,this.Qa=null,this.Ja=[],this.Ka=void 0,this.Ya=!1,this.Ga=new uw,this.Xa=(t,e)=>!(!ct(t)||!ct(e))&&Math.abs(t-e)>this.sessionTimeoutMs,!t.persistence)throw new Error("SessionIdManager requires a PostHogPersistence instance");if(t.config.cookieless_mode===Fs)throw new Error('SessionIdManager cannot be used with cookieless_mode="always"');this.qi=t.config,this.za=t.persistence,this.st=void 0,this._e=void 0,this._sessionStartTimestamp=null,this.eo=void 0,this._sessionActivityTimestamp=null,this.io=e||Pf,this.ro=i||Pf;var n=this.qi.persistence_name||this.qi.token;if(this._sessionTimeoutMs=1e3*Tt(this.qi.session_idle_timeout_seconds||1800,60,36e3,hw.createLogger("session_idle_timeout_seconds"),1800),t.register({$configured_session_timeout_ms:this._sessionTimeoutMs}),this.no(),this.so="ph_"+n+"_window_id",this.ao="ph_"+n+"_primary_window_exists",this.oo()){var s=Kf.Br(this.so),o=Kf.Br(this.ao);s&&!o?this.st=s:Kf.qr(this.so),Kf.Dr(this.ao,!0)}null!=(r=this.qi.bootstrap)&&r.sessionID&&this.setBootstrapSessionId(this.qi.bootstrap.sessionID),this.lo()}get sessionTimeoutMs(){return this._sessionTimeoutMs}onSessionId(t){return at(this.Ja)&&(this.Ja=[]),this.Ja.push(t),this._e&&t(this._e,this.st),()=>{this.Ja=this.Ja.filter((e=>e!==t))}}oo(){return"memory"!==this.qi.persistence&&!this.za.Hs&&Kf.Nr()}uo(t){t!==this.st&&(this.st=t,this.oo()&&Kf.Dr(this.so,t))}ho(){return this.st?this.st:this.oo()?Kf.Br(this.so):null}do(t){var e=this.Za;return!ht(e)&&!ht(t)&&5e3>Math.abs(t-e)}vo(t,e,i){var r=e!==this._sessionActivityTimestamp,n=!(t!==this._e||i!==this._sessionStartTimestamp);this._sessionStartTimestamp=i,this._sessionActivityTimestamp=e,this._e=t,n&&!r||n&&this.do(e)||(this.Za=e,this.za.register({[Fn]:[e,t,i]}))}co(){var t,e=null==(t=this.qi)?void 0:t.persistence_save_debounce_ms;return ct(e)&&e>0}fo(){this.co()?this.za.refreshKey(Fn):(this.za.flush(),this.za.load())}po(){var t;if(!ht(this._sessionActivityTimestamp)&&this._sessionActivityTimestamp!==this.Za){this.fo();var e=this.mo();e[1]===this._e&&e[2]===this._sessionStartTimestamp&&(this.Za=this._sessionActivityTimestamp,this.za.register({[Fn]:[this._sessionActivityTimestamp,null!==(t=this._e)&&void 0!==t?t:null,this._sessionStartTimestamp]}),this.za.flush())}}yo(){var t=this.mo()[0],e=ct(t)?t:0,i=ct(this._sessionActivityTimestamp)?this._sessionActivityTimestamp:0;return Math.max(e,i)}bo(t){return this.fo(),this.Xa(t,this.yo())}mo(){var t=this.za.props[Fn];return rt(t)&&2===t.length&&t.push(t[0]),t||[0,null,0]}resetSessionId(){this.Za=null,this.eo=void 0,clearTimeout(this._o),this._o=void 0,this.vo(null,null,null)}setBootstrapSessionId(t,e){void 0===e&&(e=!1);var i=function(t,e){void 0===e&&(e=(new Date).getTime());try{var i=(t=>{var e=t.replace(/-/g,"");if(32!==e.length)throw new Error("Not a valid UUID");if("7"!==e[12])throw new Error("Not a UUIDv7");return parseInt(e.substring(0,12),16)})(t);return i>e+6e4?void hw.error("Bootstrap sessionID cannot be in the future"):i}catch(t){return void hw.error("Invalid sessionID in bootstrap",t)}}(t);return!at(i)&&(e?this.eo={sessionId:t,sessionStartTimestamp:i}:this.vo(t,(new Date).getTime(),i),!0)}destroy(){this.Ya=!0,this.po(),clearTimeout(this._o),this._o=void 0,this.Ka&&t&&(t.removeEventListener(qs,this.Ka,{capture:!1}),this.Ka=void 0),this.Ja=[]}lo(){this.Ka=()=>{this.po(),this.oo()&&Kf.qr(this.ao)},Ki(t,qs,this.Ka,{capture:!1})}checkAndGetSessionAndWindowId(t,e,i){if(void 0===t&&(t=!1),void 0===e&&(e=null),void 0===i&&(i=!1),this.qi.cookieless_mode===Fs)throw new Error('checkAndGetSessionAndWindowId should not be called with cookieless_mode="always"');var r=e||(new Date).getTime(),n=this._e;if(i)this.Qa=r;else if(ht(this.Qa)||this.Qa>r||r-this.Qa>=1e3){var s,o;null==(s=(o=this.za).syncCookieProperties)||s.call(o),this.Qa=r}var a=this.mo(),l=a[1],u=a[2],h=!at(n)&&l!==n,d=this.yo(),v=this.ho(),c=this.eo,f=!!c&&(c.sessionStartTimestamp>r+6e4||r-c.sessionStartTimestamp>dw),p=c?f:ct(u)&&Math.abs(r-u)>dw,g=!1,m=h,y=!l||!!c,_=l,b=!y&&!t&&this.Xa(r,d);if(b){(b=this.bo(r))||hw.info("cross-tab refresh kept the session alive",{sessionId:l});var w=this.mo();l=w[1],u=w[2]}if(y||b||p){m=!1;var k=c&&!f;l=k?c.sessionId:this.io(),v=this.ro(),hw.info("new session ID assigned",{sessionId:l,windowId:v,bootstrapped:!!k,changeReason:{noSessionId:y,activityTimeout:b,sessionPastMaximumLength:p}}),u=k?c.sessionStartTimestamp:r,this.eo=void 0,g=!0}else v||(v=this.ro(),g=!0),(m=m||l!==_)&&(hw.info("adopted cross-tab session id",{sessionId:l,windowId:v}),g=!0);var S=ct(d)&&t&&!p?d:r,x=ct(u)?u:(new Date).getTime();this.uo(v),this.vo(l,S,x),t||this.no();var C={noSessionId:y,activityTimeout:b,sessionPastMaximumLength:p,crossTabAdoption:m};return g&&this.Ja.forEach((t=>t(l,v,C))),{sessionId:l,windowId:v,sessionStartTimestamp:x,changeReason:g?C:void 0,lastActivityTimestamp:d}}no(){this.Ya||(clearTimeout(this._o),this._o=setTimeout((()=>{if(!this.Ya)if(this.bo((new Date).getTime())){var t=this._e;this.resetSessionId(),this.Ga.emit("forcedIdleReset",{idleSessionId:t})}else this.no()}),1.1*this.sessionTimeoutMs))}}var cw=function(t,e){if(!t)return!1;var i=t.userAgent;if(i&&Q(i,e))return!0;try{var r=null==t?void 0:t.userAgentData;if(null!=r&&r.brands&&r.brands.some((t=>Q(null==t?void 0:t.brand,e))))return!0}catch(t){}return!!t.webdriver};function fw(){return fw=f((function*(){var t=null==i?void 0:i.userAgentData;if(null!=t&&t.getHighEntropyValues)try{var e=yield t.getHighEntropyValues(["model"]),r=null==e?void 0:e.model;return lt(r)&&r.length>0?r:void 0}catch(t){return void ji.info("Unable to resolve $device_model from userAgentData.getHighEntropyValues",t)}})),fw.apply(this,arguments)}var pw="custom",gw="i.posthog.com",mw=/^\/static\//,yw=["/s/","/e/","/i/"];class _w{constructor(t){this.wo={},this.instance=t}get apiHost(){var t=this.instance.config.api_host.trim().replace(/\/$/,"");return"https://app.posthog.com"===t?"https://us.i.posthog.com":t}get flagsApiHost(){var t=this.instance.config.flags_api_host;return t?t.trim().replace(/\/$/,""):this.apiHost}get uiHost(){var t,e=null==(t=this.instance.config.ui_host)?void 0:t.replace(/\/$/,"");return e||(e=this.apiHost.replace("."+gw,".posthog.com")),"https://app.posthog.com"===e?"https://us.posthog.com":e}get region(){return this.wo[this.apiHost]||(this.wo[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":pw),this.wo[this.apiHost]}ko(t){if(mw.test(t)){var e=this.instance.config.asset_host;if("string"==typeof e)return e.trim().replace(/\/$/,"")||void 0}}So(t){var e=er(t);return e?e.protocol+"//"+e.host+e.pathname:void 0}xo(t,e,i){if("ui"===t)return i;var r=i,n=this.instance.config.rewriteRequestPath;if(n){var s,o=(null==(s=er(i))?void 0:s.href)||i;r=n(new URL(o)).toString()}if(n&&"api"===t&&yw.some((t=>0===e.indexOf(t)))){var a=this.So(r);if(a){var l,u=this.apiHost,h=this.Co;(null==(l=h)?void 0:l.apiHost)===u&&h.rewriteRequestPath===n||(h={apiHost:u,rewriteRequestPath:n,urls:new Set},this.Co=h),h.urls.add(a)}}return r}isIngestionEndpoint(t){var e=this.Co,i=this.So(t);return(null==e?void 0:e.apiHost)===this.apiHost&&e.rewriteRequestPath===this.instance.config.rewriteRequestPath&&!!i&&e.urls.has(i)}endpointFor(t,e){if(void 0===e&&(e=""),e&&(e="/"===e[0]?e:"/"+e),"ui"===t)return this.xo(t,e,this.uiHost+e);if("flags"===t)return this.xo(t,e,this.flagsApiHost+e);if("assets"===t){var i=this.ko(e);if(i)return this.xo(t,e,""+i+e)}if(this.region===pw)return this.xo(t,e,this.apiHost+e);var r=gw+e;switch(t){case"assets":return this.xo(t,e,"https://"+this.region+"-assets."+r);case"api":return this.xo(t,e,"https://"+this.region+"."+r)}}}var bw=Bi("[PostHog ExternalIntegrations]"),ww={intercom:"intercom-integration",crispChat:"crisp-chat-integration"};class kw{constructor(t){this._instance=t}_s(t,e){var i;null==(i=v.__PosthogExtensions__)||null==i.loadExternalDependency||i.loadExternalDependency(this._instance,t,(t=>{if(t)return bw.error("failed to load script",t);e()}))}startIfEnabledOrStop(){var t=this,e=function(){var e,r,n,s=i[0],o=i[1];!o||null!=(e=v.__PosthogExtensions__)&&null!=(e=e.integrations)&&e[s]||t._s(ww[s],(()=>{var e;null==(e=v.__PosthogExtensions__)||null==(e=e.integrations)||null==(e=e[s])||e.start(t._instance)})),!o&&null!=(r=v.__PosthogExtensions__)&&null!=(r=r.integrations)&&r[s]&&(null==(n=v.__PosthogExtensions__)||null==(n=n.integrations)||null==(n=n[s])||n.stop())};for(var i of Object.entries(null!==(r=this._instance.config.integrations)&&void 0!==r?r:{})){var r;e()}}}class Sw{constructor(t,e){this.I=t,this.ns=e,this.To=new Map,this.Xn=!1}add(t){var e=this;return f((function*(){if(e.Xn)throw new Error("Cannot add an extension to a disposed ExtensionRuntime");if(e.To.has(t.name))throw new Error('Browser extension "'+t.name+'" is already registered');e.To.set(t.name,t);try{var i=t.setup(e.ns);i&&(yield i)}catch(i){var r=e.To.get(t.name)===t;r&&e.To.delete(t.name),e.I.error('Failed to set up browser extension "'+t.name+'"',i),r&&e.Mo(t)}}))()}dispose(){if(!this.Xn){this.Xn=!0;var t=Array.from(this.To.values()).reverse();for(var e of(this.To.clear(),t))this.Mo(e)}}Mo(t){try{var e=null==t.dispose?void 0:t.dispose();e&&nt(e.then)&&e.then(void 0,(e=>{this.I.error('Failed to dispose browser extension "'+t.name+'"',e)}))}catch(e){this.I.error('Failed to dispose browser extension "'+t.name+'"',e)}}}class xw{constructor(t){this._instance=t}initialize(){}get(t){var e=this._instance.persistence;if("string"==typeof t)return null==e?void 0:e.get_property(t);var i={};for(var r of t){var n=null==e?void 0:e.get_property(r);at(n)||(i[r]=n)}return i}set(t,e){var i;null==(i=this._instance.persistence)||i.register("string"==typeof t?{[t]:e}:t)}remove(t){var e;null==(e=this._instance.persistence)||e.unregister(t)}}var Cw="extensionsRemoteConfig";class Tw{constructor(t){this.Xn=!1,this.instance=t,this.I=ji,this.Eo=t.Io,this.kv=new xw(t),this.onEvent=t=>rf(this.instance.on("eventCaptured",(e=>{try{t({event:e.event,properties:e.properties})}catch(t){this.I.error("Browser extension event listener failed",t)}}))),this.onRemoteConfig=t=>{if(this.Xn)return rf((()=>{}));var e=e=>{try{t(e)}catch(t){this.I.error("Browser extension remote config listener failed",t)}},i=this.instance.Ro.on(Cw,e);return this.Eo&&e(this.Eo),rf(i)},this.Po=new Sw(ji.createLogger("[BrowserExtensions]"),this)}get logger(){return this.I}get distinctId(){return this.instance.get_distinct_id()}get anonymousId(){var t;return null!==(t=this.instance.get_property(pn))&&void 0!==t?t:this.distinctId}get deviceId(){var t=this.instance.get_property(pn);return"string"==typeof t?t:void 0}get library(){return{name:Ni.LIB_NAME,version:Ni.LIB_VERSION}}get initialPersonProperties(){var t,e;return null!==(t=null==(e=this.instance.persistence)?void 0:e.get_initial_props())&&void 0!==t?t:{}}get groups(){return this.instance.getGroups()}get session(){try{var t,e,i,r,n=null==(t=this.instance.sessionManager)?void 0:t.checkAndGetSessionAndWindowId(!0);return{sessionId:null!==(e=null==n?void 0:n.sessionId)&&void 0!==e?e:"",windowId:null!==(i=null==n?void 0:n.windowId)&&void 0!==i?i:"",sessionStartTimestamp:null!==(r=null==n?void 0:n.sessionStartTimestamp)&&void 0!==r?r:0}}catch(t){return{sessionId:"",windowId:"",sessionStartTimestamp:0}}}get projectToken(){return this.instance.config.token}add(t){return this.Po.add(t)}capture(t,e,i){var r=this;return f((function*(){i?r.instance.capture(t,e,{timestamp:i.timestamp,uuid:i.uuid,$set:i.set,$set_once:i.setOnce}):r.instance.capture(t,e)}))()}registerDynamicEventProperties(t){return rf(this.instance.Ao(t))}handleRemoteConfig(t){this.Xn||(this.Eo=t,this.instance.Ro.emit(Cw,t))}sendRequest(t,e){var i=this;return f((function*(){var r;void 0===e&&(e={});var n=i.instance.requestRouter.endpointFor(null!==(r=e.target)&&void 0!==r?r:"api",t),s={method:e.method,url:e.query?Wb(n,e.query):n,data:e.body,headers:e.headers,timeout:e.timeoutMs,fireCallbackOnDrop:!0,transport:e.transport,compression:e.compression,timestampMode:e.sentAt};return"sendBeacon"===e.transport?(i.instance._send_request(s),{statusCode:202}):new Promise((t=>{s.callback=t,i.instance._send_request(s)}))}))()}dispose(){this.Xn||(this.Xn=!0,this.Po.dispose())}}var Ew={},Mw=0,Iw=()=>{},Rw='Consent opt in/out is not valid with cookieless_mode="always" and will be ignored',Pw="Surveys module not available",Aw="sanitize_properties is deprecated. Use before_send instead",Ow="Invalid value for property_denylist config: ",Fw=["token","distinct_id",bs],Lw="posthog",$w=!Bb&&-1===(null==u?void 0:u.indexOf("MSIE"))&&-1===(null==u?void 0:u.indexOf("Mozilla")),Dw=e=>{var i;return p({api_host:"https://us.i.posthog.com",flags_api_host:null,ui_host:null,asset_host:null,token:"",autocapture:!0,cross_subdomain_cookie:Ji(null==r?void 0:r.location),persistence:"localStorage+cookie",persistence_name:"",cookie_persisted_properties:[],loaded:Iw,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:n&&lt(null==n?void 0:n.search)&&-1!==n.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==t||null==(i=t.location)?void 0:i.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(t){ji.error("Bad HTTP status: "+t.statusCode+" "+t.text)},get_device_id:t=>t,capture_performance:void 0,name:"posthog",bootstrap:{},disable_compression:!1,session_idle_timeout_seconds:1800,person_profiles:Ds,before_send:void 0,get_current_url:void 0,request_queue_config:{flush_interval_ms:iw},error_tracking:{},_onCapture:Iw},(t=>({rageclick:t&&t>="2026-05-30"?{content_ignorelist:Pr,ignore_text_selection:!0}:!t||"2025-11-30">t||{content_ignorelist:!0},capture_pageview:!t||"2025-05-24">t||"history_change",session_recording:t&&t>="2026-06-25"?{strictMinimumDuration:!0,canvasCapture:{resolutionScale:.6},streamNetworkBody:!0}:t&&t>="2026-05-30"?{strictMinimumDuration:!0,canvasCapture:{resolutionScale:.6}}:t&&t>="2025-11-30"?{strictMinimumDuration:!0}:{},external_scripts_inject_target:t&&t>="2026-01-30"?"head":"body",internal_or_test_user_hostname:t&&t>="2026-01-30"?/^(localhost|127\.0\.0\.1)$/:void 0,persistence_save_debounce_ms:t&&t>="2026-05-30"?250:0,split_storage:!(!t||"2026-05-30">t),detect_google_search_app:!(!t||"2026-05-30">t),disable_capture_url_hashes:!(!t||"2026-06-25">t),cookieWinsOnConflict:!(!t||"unset"===t||"2026-08-29">t)}))(e))},Nw=[["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"]],qw=t=>{var e={};for(var i of Nw){var r=i[0],n=i[1];at(t[r])||(e[n]=t[r])}var s=zi({},e,t),o=t.__preview_external_dependency_versioned_paths;return at(o)||(at(t.strict_script_versioning)&&(s.strict_script_versioning=!!o),lt(o)&&at(t.asset_host)&&(s.asset_host=o)),rt(t.property_blacklist)&&(at(t.property_denylist)?s.property_denylist=t.property_blacklist:rt(t.property_denylist)?s.property_denylist=[...t.property_blacklist,...t.property_denylist]:ji.error(Ow+t.property_denylist)),s};class jw{constructor(){this.__forceAllowLocalhost=!1}get Fo(){return this.__forceAllowLocalhost}set Fo(t){ji.error("WebPerformanceObserver is deprecated and has no impact on network capture. Use `_forceAllowLocalhostNetworkCapture` on `posthog.sessionRecording`"),this.__forceAllowLocalhost=t}}class Bw{Lo(t,e){if(t){var i=this.To.indexOf(t);-1!==i&&this.To.splice(i,1)}return this.To.push(e),null==e.initialize||e.initialize(),e}Oo(){return this.config.cookieless_mode===Fs||this.config.cookieless_mode===Os&&this.consent.isRejected()}Do(){if(!this.Oo()&&this.get_distinct_id()===_s){var t=this.persistence;if(t){this.$o()||t.load(!0);var e=this.get_distinct_id();if(!e||e===_s){var i=this.config.get_device_id(Pf());this.register({distinct_id:i,$device_id:i}),t.set_property(vs,Ls)}this.No()}}}get decideEndpointWasHit(){var t,e;return null!==(t=null==(e=this.featureFlags)?void 0:e.hasLoadedFlags)&&void 0!==t&&t}get flagsEndpointWasHit(){var t,e;return null!==(t=null==(e=this.featureFlags)?void 0:e.hasLoadedFlags)&&void 0!==t&&t}constructor(){var t;this.webPerformance=new jw,this.qo=!1,this.version=Ni.LIB_VERSION,this.jo=new Set,this.Bo="",this.Ro=new uw,this.To=[],this.Ho=[],this._calculate_event_properties=this.calculateEventProperties.bind(this),this.config=Dw(),this.SentryIntegration=wb,this.sentryIntegration=t=>function(t,e){var i=bb(t,e);return{name:_b,processEvent:t=>i(t)}}(this,t),this.__request_queue=[],this.__loaded=!1,this.analyticsDefaultEndpoint="/e/",this.Uo=!1,this.zo=null,this.Wo=null,this.Vo=null,this.scrollManager=new ow(this),this.pageViewManager=new kb(this),this.rateLimiter=new Db(this),this.requestRouter=new _w(this),this.consent=new cb(this),this.externalIntegrations=new kw(this);var e=null!==(t=Bw.__defaultExtensionClasses)&&void 0!==t?t:{};this.featureFlags=e.featureFlags&&new e.featureFlags(this),this.toolbar=e.toolbar&&new e.toolbar(this),this.surveys=e.surveys&&new e.surveys(this),this.conversations=e.conversations&&new e.conversations(this),this.logs=e.logs&&new e.logs(this),this.metrics=e.metrics&&new e.metrics(this),this.experiments=e.experiments&&new e.experiments(this),this.exceptions=e.exceptions&&new e.exceptions(this),this.people={set:(t,e,i)=>{var r=lt(t)?{[t]:e}:t;this.setPersonProperties(r),null==i||i({})},set_once:(t,e,i)=>{var r=lt(t)?{[t]:e}:t;this.setPersonProperties(void 0,r),null==i||i({})}},this.on("eventCaptured",(t=>ji.info('send "'+(null==t?void 0:t.event)+'"',t)))}init(t,e,i){if(i&&i!==Lw){var r,n=null!==(r=Ew[i])&&void 0!==r?r:new Bw;return n._init(t,e,i),Ew[i]=n,Ew[Lw][i]=n,n}return this._init(t,e,i)}_init(e,i,r){var n,s;void 0===i&&(i={});var o,a=lt(e)?e.trim():"";if(!a)return ji.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=Dw(i.defaults),i.debug=this.Go(i.debug),this.Zo=i,this.Qo=[],i.person_profiles?this.Wo=i.person_profiles:i.process_person&&(this.Wo=i.process_person);var l=Dw(i.defaults),u=qw(i),h=zi({},l,u,{name:r,token:a});st(l.rageclick)&&st(u.rageclick)&&(h.rageclick=zi({},l.rageclick,u.rageclick)),st(l.session_recording)&&st(u.session_recording)&&(h.session_recording=zi({},l.session_recording,u.session_recording)),this.set_config(h),this.config.on_xhr_error&&ji.error("on_xhr_error is deprecated. Use on_request_error instead"),this.compression=i.disable_compression?void 0:nf.GZipJS;var d=this.$o();if(this.persistence=new Ab(this.config,d),this.sessionPersistence="sessionStorage"===this.config.persistence||"memory"===this.config.persistence?this.persistence:new Ab(p({},this.config,{persistence:"sessionStorage"}),d,!1),this.Bo="ph_"+(this.config.persistence_name||this.config.token)+"_session_registered_properties","memory"!==this.config.persistence&&!d&&Kf.Nr()){var v=Kf.Br(this.Bo);rt(v)&&v.forEach((t=>{lt(t)&&this.jo.add(t)}))}else Kf.qr(this.Bo);var c=p({},this.persistence.props),f=p({},this.sessionPersistence.props);this.register({$initialization_time:(new Date).toISOString()}),this.Jo=new rw((t=>this.Ko(t)),this.config.request_queue_config),this.Yo=new sw(this),this.__request_queue=[];var g=this.Oo();if(g||(this.sessionManager=new vw(this),this.sessionPropsManager=new lw(this,this.sessionManager,this.persistence),this.sessionManager.onSessionId(((t,e,i)=>{(null!=i&&i.activityTimeout||null!=i&&i.sessionPastMaximumLength||null!=i&&i.crossTabAdoption)&&this.Xo()}))),this.tl(),this.config.__preview_deferred_init_extensions?(ji.info("Deferring extension initialization to improve startup performance"),setTimeout((()=>{this.el(g)}),0)):(ji.info("Initializing extensions synchronously"),this.el(g)),Ni.DEBUG=Ni.DEBUG||this.config.debug,Ni.DEBUG&&ji.info("Starting in debug mode",{this:this,config:i,thisC:p({},this.config),p:c,s:f}),!this.config.identity_distinct_id||null!=(n=i.bootstrap)&&n.distinctID||(i.bootstrap=p({},i.bootstrap,{distinctID:this.config.identity_distinct_id,isIdentifiedID:!0})),void 0!==(null==(s=i.bootstrap)?void 0:s.distinctID)){var m=i.bootstrap.distinctID,y=this.get_distinct_id(),_=this.persistence.get_property(vs);if(i.bootstrap.isIdentifiedID&&null!=y&&y!==m&&_===Ls)this.identify(m);else if(i.bootstrap.isIdentifiedID&&null!=y&&y!==m&&_===$s)ji.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 b=this.config.get_device_id(Pf()),w=i.bootstrap.isIdentifiedID?b:m;this.persistence.set_property(vs,i.bootstrap.isIdentifiedID?$s:Ls),this.register({distinct_id:m,$device_id:w})}}if(g)this.register_once({distinct_id:_s,$device_id:null},"");else if(!this.get_distinct_id()){var k=this.config.get_device_id(Pf());this.register_once({distinct_id:k,$device_id:k},""),this.persistence.set_property(vs,Ls)}return Ki(t,"onpagehide"in self?"pagehide":"unload",this._handle_unload.bind(this),{passive:!1}),i.segment?function(t,e){var i=t.config.segment;if(!i)return e();!function(t,e){var i=t.config.segment;if(!i)return e();var r=i=>{var r=()=>i.anonymousId()||Pf();t.config.get_device_id=r,i.id()&&(t.register({distinct_id:i.id(),$device_id:r()}),t.persistence.set_property(vs,$s)),e()},n=i.user();"then"in n&&nt(n.then)?n.then(r):r(n)}(t,(()=>{i.register((t=>{"undefined"!=typeof Promise&&Promise.resolve||yb.warn("This browser does not have Promise support, and can not use the segment integration");var e=(e,i)=>{if(!i)return e;e.event.userId||e.event.anonymousId===t.get_distinct_id()||(yb.info("No userId set, resetting PostHog"),t.reset()),e.event.userId&&e.event.userId!==t.get_distinct_id()&&(yb.info("UserId set, identifying with PostHog"),t.identify(e.event.userId));var r=t.calculateEventProperties(i,e.event.properties);return e.event.properties=Object.assign({},r,e.event.properties),e};return{name:"PostHog JS",type:"enrichment",version:"1.0.0",isLoaded:()=>!0,load:()=>Promise.resolve(),track:t=>e(t,t.event.event),page:t=>e(t,js),identify:t=>e(t,Us),screen:t=>e(t,"$screen")}})(t)).then((()=>{e()}))}))}(this,(()=>this.il())):this.il(),nt(this.config._onCapture)&&this.config._onCapture!==Iw&&(ji.warn("onCapture is deprecated. Please use `before_send` instead"),this.on("eventCaptured",(t=>this.config._onCapture(t.event,t)))),this.config.ip&&ji.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 fw.apply(this,arguments)}().then((t=>{t&&this.register({[gn]:t})})).catch(Iw),this}rl(t){var e=t;return lt(e.name)&&nt(e.setup)}nl(t,e){this.rl(t)?e.push((()=>{this.sl().add(t).catch(Iw)})):this.To.push(t)}tl(){var t,e,i,r,n,s,o=null!==(t=null==(e=this.config.__extensionClasses)?void 0:e.featureFlags)&&void 0!==t?t:null==(i=Bw.__defaultExtensionClasses)?void 0:i.featureFlags;o&&(this.featureFlags&&this.featureFlags instanceof o||(null==(r=this.al)||r.call(this),this.al=void 0,this.featureFlags=new o(this)),nt(this.featureFlags.onReloading)&&nt(this.featureFlags.setup)?this.al||(this.al=this.featureFlags.onReloading((()=>{this.Ro.emit("featureFlagsReloading",!0)})),this.sl().add(this.featureFlags)):null==(n=(s=this.featureFlags).initialize)||n.call(s))}el(t){var e,i,r,n,s,o,a,l=performance.now(),u=p({},Bw.__defaultExtensionClasses,this.config.__extensionClasses),h=[];u.exceptions&&this.To.push(this.exceptions=null!==(e=this.exceptions)&&void 0!==e?e:new u.exceptions(this)),u.historyAutocapture&&this.To.push(this.historyAutocapture=new u.historyAutocapture(this)),u.tracingHeaders&&this.To.push(this.tracingHeaders=new u.tracingHeaders(this)),u.siteApps&&this.To.push(this.siteApps=new u.siteApps(this)),u.sessionRecording&&!t&&this.To.push(this.sessionRecording=new u.sessionRecording(this)),this.config.disable_scroll_properties||h.push((()=>{this.scrollManager.startMeasuringScrollPosition()})),u.autocapture&&this.nl(this.autocapture=new u.autocapture(this),h),u.surveys&&this.nl(this.surveys=null!==(i=this.surveys)&&void 0!==i?i:new u.surveys(this),h),u.logs&&this.To.push(this.logs=null!==(r=this.logs)&&void 0!==r?r:new u.logs(this)),u.metrics&&this.To.push(this.metrics=null!==(n=this.metrics)&&void 0!==n?n:new u.metrics(this)),u.conversations&&this.To.push(this.conversations=null!==(s=this.conversations)&&void 0!==s?s:new u.conversations(this)),u.productTours&&this.To.push(this.productTours=new u.productTours(this)),u.heatmaps&&this.To.push(this.heatmaps=new u.heatmaps(this)),u.webVitalsAutocapture&&this.To.push(this.webVitalsAutocapture=new u.webVitalsAutocapture(this)),u.exceptionObserver&&this.To.push(this.exceptionObserver=new u.exceptionObserver(this)),u.deadClicksAutocapture&&this.To.push(this.deadClicksAutocapture=new u.deadClicksAutocapture(this,gb)),u.toolbar&&this.To.push(this.toolbar=null!==(o=this.toolbar)&&void 0!==o?o:new u.toolbar(this)),u.experiments&&this.To.push(this.experiments=null!==(a=this.experiments)&&void 0!==a?a:new u.experiments(this)),this.To.forEach((t=>{t.initialize&&h.push((()=>{null==t.initialize||t.initialize()}))})),h.push((()=>{if(this.ol){var t=this.ol;this.ol=void 0,this.To.forEach((e=>null==e.onRemoteConfig?void 0:e.onRemoteConfig(t)))}})),this.ll(h,l)}ll(t,e){for(;t.length>0;){if(this.config.__preview_deferred_init_extensions&&performance.now()-e>=30&&t.length>0)return void setTimeout((()=>{this.ll(t,e)}),0);var i=t.shift();if(i)try{i()}catch(t){ji.error("Error initializing extension:",t)}}var r=Math.round(performance.now()-e);this.register_for_session({[ws]:this.config.__preview_deferred_init_extensions?"deferred":"synchronous",[ks]:r}),this.config.__preview_deferred_init_extensions&&ji.info("PostHog extensions initialized ("+r+"ms)")}pa(t){var e;if(!r||!r.body)return ji.info("document not ready yet, trying again in 500 milliseconds..."),void setTimeout((()=>{this.pa(t)}),500);if(this.config.__preview_deferred_init_extensions&&(this.ol=t),this.Io=t,this.compression=void 0,t.ok){var i,n=t.config;n.supportedCompression&&!this.config.disable_compression&&(this.compression=J(n.supportedCompression,nf.GZipJS)?nf.GZipJS:J(n.supportedCompression,nf.Base64)?nf.Base64:void 0),null!=(i=n.analytics)&&i.endpoint&&(this.analyticsDefaultEndpoint=n.analytics.endpoint)}this.set_config({person_profiles:this.Wo?this.Wo:Ds}),null==(e=this.ul)||e.handleRemoteConfig(t),this.To.forEach((e=>null==e.onRemoteConfig?void 0:e.onRemoteConfig(t)))}il(){try{this.config.loaded(this)}catch(t){ji.critical("`loaded` function failed",t)}if(this.hl(),this.config.internal_or_test_user_hostname&&null!=n&&n.hostname){var t=n.hostname,e=this.config.internal_or_test_user_hostname;("string"==typeof e?t===e:e.test(t))&&this.setInternalOrTestUser()}this.config.capture_pageview&&setTimeout((()=>{(this.consent.isOptedIn()||this.Oo())&&this.dl()}),1),this.vl=new qb(this),this.vl.load()}hl(){var t;this.is_capturing()&&this.config.request_batching&&(null==(t=this.Jo)||t.enable())}_dom_loaded(){this.is_capturing()&&Ui(this.__request_queue,(t=>this.Ko(t))),this.__request_queue=[],this.hl()}_handle_unload(){var t,e,i,r,n;null==(t=this.surveys)||null==t.handlePageUnload||t.handlePageUnload(),null==(e=this.metrics)||e.flush("sendBeacon"),this.config.request_batching?(this.cl()&&this.capture(Bs),null==(i=this.logs)||i.flushLogs("sendBeacon"),null==(r=this.Jo)||r.unload(),null==(n=this.Yo)||n.unload()):this.cl()&&this.capture(Bs,null,{transport:"sendBeacon"})}_send_request(t){this.__loaded?$w?this.__request_queue.push(t):this.rateLimiter.isServerRateLimited(t.batchKey)?t.fireCallbackOnDrop&&(null==t.callback||t.callback({statusCode:429})):(t.transport=t.transport||this.config.api_transport,t.headers=p({},this.config.request_headers,t.headers),t.compression="best-available"===t.compression?this.compression:t.compression,(at(this.config.disable_beacon)?this.config.__preview_disable_beacon:this.config.disable_beacon)&&(t.disableTransport=["sendBeacon"]),t.fetchOptions=t.fetchOptions||this.config.fetch_options,(t=>{var e,i,r,n=p({},t);n.timeout=n.timeout||6e4;var s,o,a,u,h,d=null!==(e=n.transport)&&void 0!==e?e:"fetch";"sendBeacon"===d&&at(n.compression)&&n.data&&(n.compression=nf.Base64),"POST"===n.method&&n.data&&("capture-body"===n.timestampMode?n.data={api_key:null!==(o=null==(h=(u=(rt(s=n.data)?s:[s]).map((t=>p({},t,t.timestamp instanceof Date&&!isNaN(t.timestamp.getTime())?{timestamp:t.timestamp.toISOString()}:{}))))[0])||null==(a=h.properties)?void 0:a.token)&&void 0!==o?o:null==h?void 0:h.token,batch:u,sent_at:(new Date).toISOString()}:"body"===n.timestampMode&&(n.data=function(t,e){return void 0===e&&(e=(new Date).toISOString()),rt(t)?t.map((t=>p({},t,{sent_at:e}))):p({},t,{sent_at:e})}(n.data))),n.url=tw(n.url,n.method,n.compression,n.timestampMode);var v=ew.filter((t=>!n.disableTransport||!t.transport||!n.disableTransport.includes(t.transport))),c=null!==(i=null==(r=function(t,e){for(var i=0;t.length>i;i++)if(e(t[i]))return t[i]}(v,(t=>t.transport===d)))?void 0:r.method)&&void 0!==i?i:v[0].method;if(!c)throw new Error("No available transport method");var f=t=>{try{c(t)}catch(t){Kb(t)?ji.warn(t):ji.error(t),null==n.callback||n.callback({statusCode:0,error:t})}};"sendBeacon"!==d&&n.data&&n.compression===nf.GZipJS&&l&&"undefined"!=typeof Promise&&!Hb?Qb(n).then((t=>{f(t)})).catch((e=>{if(O(e))return Hb=!0,void f(p({},n,{compression:void 0,url:tw(t.url,t.method,void 0,t.timestampMode)}));F(e)&&(Hb=!0),f(n)})):c(n)})(p({},t,{callback:e=>{var i,r;this.rateLimiter.checkForLimiting(e),400>e.statusCode||null==(i=(r=this.config).on_request_error)||i.call(r,e),null==t.callback||t.callback(e)}}))):t.fireCallbackOnDrop&&(null==t.callback||t.callback({statusCode:0}))}Ko(t){this.Yo?this.Yo.retriableRequest(t):this._send_request(t)}_execute_array(t){Mw++;try{var e,i=[],r=[],n=[];Ui(t,(t=>{if(t)if(rt(e=t[0]))n.push(t);else if(nt(t))try{t.call(this)}catch(e){ji.error("Error executing queued PostHog call",t,e)}else rt(t)&&"alias"===e?i.push(t):rt(t)&&-1!==e.indexOf("capture")&&nt(this[e])?n.push(t):r.push(t)}));var s=function(t,e){Ui(t,(function(t){try{if(rt(t[0])){var i=e;Hi(t,(function(t){i=i[t[0]].apply(i,t.slice(1))}))}else e[t[0]].apply(e,t.slice(1))}catch(e){ji.error("Error executing queued PostHog call",t,e)}}))};s(i,this),s(r,this),s(n,this)}finally{Mw--}}push(t){if(Mw>0&&rt(t)&&lt(t[0])){var e=Bw.prototype[t[0]];nt(e)&&e.apply(this,t.slice(1))}else this._execute_array([t])}capture(t,e,i){var r,n,s,o,a;if(this.__loaded&&this.persistence&&this.sessionPersistence&&this.Jo){if(this.is_capturing())if(!at(t)&&lt(t)){this.Do();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!=e&&e.$current_url&&!lt(null==e?void 0:e.$current_url)&&(ji.error("Invalid `$current_url` property provided to `posthog.capture`. Input must be a string. Ignoring provided value."),null==e||delete e.$current_url),"$exception"!==t||null!=i&&i.fl||ji.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,d=(null==i?void 0:i.timestamp)||h,v=Fe(null==i?void 0:i.uuid,Pf),c={uuid:v,event:t,properties:this.calculateEventProperties(t,e||{},d,v)};t===js&&this.config.__preview_capture_bot_pageviews&&l&&(c.event="$bot_pageview",c.properties.$browser_type="bot"),u&&(c.properties.$lib_rate_limit_remaining_tokens=u.remainingTokens);var f="$feature_flag_called"===t&&!1===c.properties.$feature_flag_has_experiment&&!0===this.get_property(Jn);(null==i?void 0:i.$set)&&!f&&(c.$set=null==i?void 0:i.$set);var g=null==i?void 0:i.$unset;g&&(c.$unset=g);var m=f?void 0:this.pl(null==i?void 0:i.$set_once,t!==Hs,t===Us);if(m&&(c.$set_once=m),null!=i&&i._noTruncate||(n=this.config.properties_string_max_length,s=c,o=t=>lt(t)?t.slice(0,n):t,a=new Set,c=function t(e,i){if(e!==Object(e))return o?o(e):e;if(!a.has(e)){var r;if(a.add(e),rt(e))r=[],Ui(e,(e=>{r.push(t(e))}));else{var n={};Hi(e,((e,i)=>{a.has(e)||(n[i]=t(e,i))})),r=n}return r}}(s)),c.timestamp=d,at(null==i?void 0:i.timestamp)||(c.properties.$event_time_override_provided=!0,c.properties.$event_time_override_system_time=h),f&&(c.properties=function(t,e){void 0===e&&(e=[]);var i={},r=e=>{void 0!==t[e]&&(i[e]=t[e])};return S.forEach(r),e.forEach(r),i}(c.properties,Fw)),t===cf.DISMISSED||t===cf.SENT){var y=null==e?void 0:e[ff.SURVEY_ID],_=null==e?void 0:e[ff.SURVEY_ITERATION];Sf({id:y,current_iteration:_}),c.$set=p({},c.$set,{[va({id:y,current_iteration:_},t===cf.SENT?"responded":"dismissed")]:!0})}else t===cf.SHOWN&&(c.$set=p({},c.$set,{[ff.SURVEY_LAST_SEEN_DATE]:(new Date).toISOString()}));if(t===Fb.SHOWN){var b=null==e?void 0:e[Lb.TOUR_TYPE];b&&(c.$set=p({},c.$set,{[Lb.TOUR_LAST_SEEN_DATE+"/"+b]:(new Date).toISOString()}))}var w=p({},c.properties.$set,c.$set);if(ot(w)||this.setPersonPropertiesForFlags(w),!dt(this.config.before_send)){var k=this.kn(c);if(!k)return;(c=k).uuid=Fe(c.uuid,Pf)}this.Ro.emit("eventCaptured",c);var x=null!==(r=null==i?void 0:i._url)&&void 0!==r?r:this.requestRouter.endpointFor("api",this.analyticsDefaultEndpoint),C={method:"POST",url:x,data:c,compression:"best-available",timestampMode:"recordings"===(null==i?void 0:i._batchKey)||/\/s\/(?:\?|$)/.test(x)?"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.Ko(C):this.Jo.enqueue(C),c}ji.critical("This capture call is ignored due to client rate limiting.")}}else ji.error("No event name provided to posthog.capture")}else ji.uninitializedWarning("posthog.capture")}_addCaptureHook(t){return this.on("eventCaptured",(e=>t(e.event,e)))}sl(){var t;return null!==(t=this.ul)&&void 0!==t?t:this.ul=new Tw(this)}Ao(t){this.Ho.push(t);var e=!0;return()=>{if(e){e=!1;var i=this.Ho.indexOf(t);-1!==i&&this.Ho.splice(i,1)}}}gl(t){var e,i,r;return void 0===t&&(t=!0),!(null==(e=this.persistence)||!e.consumeCookieIdentityChange())&&(this.Vo=null,this.persistence.get_property(vs)===Ls&&(null==(r=this.sessionPersistence)||r.clear(),this.jo.clear(),this.ml()),null==(i=this.featureFlags)||i.reset(),t&&this.reloadFeatureFlags(),!0)}calculateEventProperties(e,i,s,o,a){if(s=s||new Date,!this.persistence||!this.sessionPersistence)return i;this.persistence.syncCookieProperties(),this.gl();var l=a?void 0:this.persistence.remove_event_timer(e),h=p({},i);if(h.token=this.config.token,h.$config_defaults=this.config.defaults,this.Oo()&&(h[bs]=!0),"$snapshot"===e){var d=p({},this.persistence.properties(),this.sessionPersistence.properties());return h.distinct_id=d.distinct_id,(!lt(h.distinct_id)&&!vt(h.distinct_id)||ut(h.distinct_id))&&ji.error("Invalid distinct_id for replay event. This indicates a bug in your implementation"),h}var v,c=function(e,i,r,s){var o,a,l,h;if(void 0===s&&(s=!1),!u)return{};var d,v=e?[...Fa,...i||[]]:[],c=function(t){for(var e=0;Re.length>e;e++){var i=Re[e],r=i[1],n=i[0].exec(t),s=n&&(nt(r)?r(n,t):r);if(s)return s}return["",""]}(u),f=c[0],p=c[1],g=null!=(d="undefined"!=typeof navigator?navigator:void 0)&&d.brave?{brave:!0}:{},m={};at(r)||(m.detectGoogleSearchApp=r);var y={},_=null==(o=navigator)||null==(o=o.userAgentData)?void 0:o.platform,b=null==(a=navigator)?void 0:a.maxTouchPoints,w=null==t||null==(l=t.screen)?void 0:l.width,k=null==t||null==(h=t.screen)?void 0:h.height,S=null==t?void 0:t.devicePixelRatio;at(_)||(y.userAgentDataPlatform=_),at(b)||(y.maxTouchPoints=b),at(w)||(y.screenWidth=w),at(k)||(y.screenHeight=k),at(S)||(y.devicePixelRatio=S);var x,C=zi(Zi({$os:f,$os_version:p,$browser:Ee(u,navigator.vendor,g,m),$device:Pe(u),$device_type:Ae(u,y),$timezone:Va(),$timezone_offset:Ga()}),{$current_url:nr(s?Le(null==n?void 0:n.href):null==n?void 0:n.href,v,$a),$host:null==n?void 0:n.host,$pathname:null==n?void 0:n.pathname,$raw_user_agent:u.length>1e3?u.substring(0,997)+"...":u,$browser_version:Ie(u,navigator.vendor,g,m),$browser_language:Ba(),$browser_language_prefix:(x=Ba(),"string"==typeof x?x.split("-")[0]:void 0),$screen_height:null==t?void 0:t.screen.height,$screen_width:null==t?void 0:t.screen.width,$viewport_height:null==t?void 0:t.innerHeight,$viewport_width:null==t?void 0:t.innerWidth,$lib:Ni.LIB_NAME,$lib_version:Ni.LIB_VERSION,$insert_id:Math.random().toString(36).substring(2,10)+Math.random().toString(36).substring(2,10),$time:Date.now()/1e3});return Ni.SDK_DIST_CHANNEL&&(C.$sdk_dist_channel=Ni.SDK_DIST_CHANNEL),C}(this.config.mask_personal_data_properties,this.config.custom_personal_data_properties,this.config.detect_google_search_app,this.config.disable_capture_url_hashes);if(this.sessionManager){var f=this.sessionManager.checkAndGetSessionAndWindowId(a,s.getTime(),!0),g=f.windowId;h.$session_id=f.sessionId,h.$window_id=g}this.sessionPropsManager&&zi(h,this.sessionPropsManager.getSessionProps());try{var m;this.sessionRecording&&zi(h,this.sessionRecording.sdkDebugProperties),h.$sdk_debug_retry_queue_size=null==(m=this.Yo)?void 0:m.length}catch(t){h.$sdk_debug_error_capturing_properties=String(t)}if(this.requestRouter.region===pw&&(h.$lib_custom_api_host=this.config.api_host),v=e!==js||a?e!==Bs||a?this.pageViewManager.doEvent():this.pageViewManager.doPageLeave(s):this.pageViewManager.doPageView(s,o),h=zi(h,v),e===js&&r&&(h.title=r.title),!at(l)){var y=s.getTime()-l;h.$duration=parseFloat((y/1e3).toFixed(3))}u&&this.config.opt_out_useragent_filter&&(h.$browser_type=this._is_bot()?"bot":"browser");var _=this.persistence.properties(),b=this.sessionPersistence.properties();Hi(["$referrer","$referring_domain"],(t=>{t in _&&delete b[t]}));var w={};if(this.Ho.length>0)for(var k of this.Ho.slice())try{zi(w,k())}catch(t){ji.error("Failed to produce browser extension event properties",t)}(h=zi({},c,_,b,p({},w,h))).$is_identified=this._isIdentified(),rt(this.config.property_denylist)?Hi(this.config.property_denylist,(function(t){delete h[t]})):ji.error(Ow+this.config.property_denylist+" or property_blacklist config: "+this.config.property_blacklist);var S=this.config.sanitize_properties;S&&(ji.error(Aw),h=S(h,e));var x=this.yl();return h.$process_person_profile=x,x&&!a&&this.bl("_calculate_event_properties"),h}pl(t,e,i){var r;if(void 0===e&&(e=!0),void 0===i&&(i=!1),!this.persistence||!this.yl())return t;if(this.qo&&!i)return t;var n=this.persistence.get_initial_props(),s=null==(r=this.sessionPropsManager)?void 0:r.getSetOnceProps(),o=zi({},n,s||{},t||{}),a=this.config.sanitize_properties;return a&&(ji.error(Aw),o=a(o,"$set_once")),e&&(this.qo=!0),ot(o)?void 0:o}register(t,e){var i;null==(i=this.persistence)||i.register(t,e)}register_once(t,e,i){var r;null==(r=this.persistence)||r.register_once(t,e,i)}register_for_session(t){var e,i;null==(e=this.persistence)||e.syncCookieProperties(),this.gl(),null==(i=this.sessionPersistence)||i.register(t),Object.keys(t).forEach((t=>this.jo.add(t))),this.ml()}unregister(t){var e;null==(e=this.persistence)||e.unregister(t)}unregister_for_session(t){var e;null==(e=this.sessionPersistence)||e.unregister(t),this.jo.delete(t),this.ml()}_l(t,e){this.register({[t]:e})}Xo(){this.jo.forEach((t=>{var e;null==(e=this.sessionPersistence)||e.unregister(t)})),this.jo.clear(),this.ml()}ml(){var t;if(this.Bo)if("memory"===this.config.persistence||null!=(t=this.sessionPersistence)&&t.Hs||!Kf.Nr())Kf.qr(this.Bo);else{var e=[];this.jo.forEach((t=>e.push(t))),e.length>0?Kf.Dr(this.Bo,e):Kf.qr(this.Bo)}}getFeatureFlag(t,e){var i;return null==(i=this.featureFlags)?void 0:i.getFeatureFlag(t,e)}getFeatureFlagPayload(t){var e;return null==(e=this.featureFlags)?void 0:e.getFeatureFlagPayload(t)}getFeatureFlagResult(t,e){var i;return null==(i=this.featureFlags)?void 0:i.getFeatureFlagResult(t,e)}getAllFeatureFlags(){var t,e;return null!==(t=null==(e=this.featureFlags)?void 0:e.getAllFeatureFlags())&&void 0!==t?t:[]}isFeatureEnabled(t,e){var i,r;return null!==(i=null==(r=this.featureFlags)?void 0:r.isFeatureEnabled(t,e))&&void 0!==i?i:null==e?void 0:e.defaultValue}reloadFeatureFlags(){var t;null==(t=this.featureFlags)||t.reloadFeatureFlags()}updateFlags(t,e,i){var r;null==(r=this.featureFlags)||r.updateFlags(t,e,i)}updateEarlyAccessFeatureEnrollment(t,e,i){var r;null==(r=this.featureFlags)||r.updateEarlyAccessFeatureEnrollment(t,e,i)}getEarlyAccessFeatures(t,e,i){var r;return void 0===e&&(e=!1),null==(r=this.featureFlags)?void 0:r.getEarlyAccessFeatures(t,e,i)}on(t,e){return this.Ro.on(t,e)}onFeatureFlags(t){return this.featureFlags?this.featureFlags.onFeatureFlags(t):(t([],{},{errorsLoading:!0}),()=>{})}onSurveysLoaded(t){return this.surveys?this.surveys.onSurveysLoaded(t):(t([],{isLoaded:!1,error:Pw}),()=>{})}onSessionId(t){var e,i;return null!==(e=null==(i=this.sessionManager)?void 0:i.onSessionId(t))&&void 0!==e?e:()=>{}}getSurveys(t,e){void 0===e&&(e=!1),this.surveys?this.surveys.getSurveys(t,e):t([],{isLoaded:!1,error:Pw})}getActiveMatchingSurveys(t,e){void 0===e&&(e=!1),this.surveys?this.surveys.getActiveMatchingSurveys(t,e):t([],{isLoaded:!1,error:Pw})}renderSurvey(t,e){var i;null==(i=this.surveys)||i.renderSurvey(t,e)}displaySurvey(t,e){var i;void 0===e&&(e=Cf),null==(i=this.surveys)||i.displaySurvey(t,e)}cancelPendingSurvey(t){var e;null==(e=this.surveys)||e.cancelPendingSurvey(t)}canRenderSurvey(t){var e,i;return null!==(e=null==(i=this.surveys)?void 0:i.canRenderSurvey(t))&&void 0!==e?e:{visible:!1,disabledReason:Pw}}canRenderSurveyAsync(t,e){var i,r;return void 0===e&&(e=!1),null!==(i=null==(r=this.surveys)?void 0:r.canRenderSurveyAsync(t,e))&&void 0!==i?i:Promise.resolve({visible:!1,disabledReason:Pw})}wl(t){return!t||ut(t)?(ji.critical("Unique user id has not been set in posthog.identify"),!1):t===_s?(ji.critical('The string "'+t+'" was set in posthog.identify which indicates an error. This ID is only used as a sentinel value.'),!1):!["distinct_id","distinctid"].includes(t.toLowerCase())&&!["undefined","null"].includes(t.toLowerCase())||(ji.critical('The string "'+t+'" was set in posthog.identify which indicates an error. This ID should be unique to the user and not a hardcoded string.'),!1)}identify(t,e,i){if(!this.__loaded||!this.persistence)return ji.uninitializedWarning("posthog.identify");if(vt(t)&&(t=t.toString(),ji.warn("The first argument to posthog.identify was a number, but it should be a string. It has been converted to a string.")),this.wl(t)&&this.bl("posthog.identify")){this.Do();var r=this.get_distinct_id(),n=this.persistence.syncCookieProperties()&&this.get_distinct_id()!==r,s=this.gl(!1),o=this.persistence.Ws(),a=!1;try{var l=this.get_distinct_id();this.register({$user_id:t}),this.get_property(pn)||this.register_once({$had_persisted_distinct_id:!0,$device_id:l},""),t!==l&&t!==this.get_property(mn)&&(this.unregister(mn),this.register({distinct_id:t}));var u,h=(this.persistence.get_property(vs)||Ls)===Ls,d=t!==l,v=!d&&h;if(d&&h)this.persistence.set_property(vs,$s),this.setPersonPropertiesForFlags({$set:e||{},$set_once:i||{}},!1),this.config.cookieWinsOnConflict&&this.persistence.Vs(),this.capture(Us,{distinct_id:t,$anon_distinct_id:l},{$set:e||{},$set_once:i||{}}),this.Vo=xa(t,e,i),null==(u=this.featureFlags)||u.setAnonymousDistinctId(l);else if(v){this.persistence.set_property(vs,$s);var c=e||{},f=i||{};this.setPersonPropertiesForFlags({$set:c,$set_once:f},!1),this.config.cookieWinsOnConflict&&this.persistence.Vs(),this.capture("$set",{$set:c,$set_once:f}),this.Vo=xa(t,e,i)}else(e||i)&&this.setPersonProperties(e,i);d||n||s?(this.reloadFeatureFlags(),this.featureFlags?this.featureFlags.resetFlagCallReported():this.unregister(ls)):v&&(e||i)&&this.reloadFeatureFlags(),a=!0}finally{o&&this.persistence.Qs(a)}}}setPersonProperties(t,e){if((t||e)&&this.bl("posthog.setPersonProperties")){var i=xa(this.get_distinct_id(),t,e);this.Vo!==i?(this.setPersonPropertiesForFlags({$set:t||{},$set_once:e||{}},!0),this.capture("$set",{$set:t||{},$set_once:e||{}}),this.Vo=i):ji.info("A duplicate setPersonProperties call was made with the same properties. It has been ignored.")}}unsetPersonProperties(t){var e,i=(rt(t)?t:[t]).filter((t=>lt(t)&&t.length>0));0!==i.length&&this.bl("posthog.unsetPersonProperties")&&(null==(e=this.featureFlags)||e.unsetPersonPropertiesForFlags(i,!0),this.capture("$set",{$unset:i}),this.Vo=null)}group(t,e,i){var r;if(t&&e){null==(r=this.persistence)||r.syncCookieProperties(),this.gl();var n=this.getGroups(),s=n[t]!==e;if(s&&this.resetGroupPropertiesForFlags(t),this.register({$groups:p({},n,{[t]:e})}),s||i){var o={$group_type:t,$group_key:e};i&&(o.$group_set=i),this.capture(Hs,o)}i&&this.setGroupPropertiesForFlags({[t]:i}),s&&!i&&this.reloadFeatureFlags()}else ji.error("posthog.group requires a group type and group key")}resetGroups(){this.register({$groups:{}}),this.resetGroupPropertiesForFlags(),this.reloadFeatureFlags()}setPersonPropertiesForFlags(t,e){var i;void 0===e&&(e=!0),null==(i=this.featureFlags)||i.setPersonPropertiesForFlags(t,e)}resetPersonPropertiesForFlags(t){var e;void 0===t&&(t=!0),null==(e=this.featureFlags)||e.resetPersonPropertiesForFlags(t)}setGroupPropertiesForFlags(t,e){var i;void 0===e&&(e=!0),this.bl("posthog.setGroupPropertiesForFlags")&&(null==(i=this.featureFlags)||i.setGroupPropertiesForFlags(t,e))}resetGroupPropertiesForFlags(t){var e;null==(e=this.featureFlags)||e.resetGroupPropertiesForFlags(t)}reset(t){var e=ft(t)?t:null==t?void 0:t.resetDeviceID,i=ft(t)||null==t?void 0:t.bootstrap;this.kl(e,!1,i)}kl(t,e,i){var r,n,s;if(void 0===e&&(e=!1),ji.info("reset"),!this.__loaded)return ji.uninitializedWarning("posthog.reset");var o=null==i?void 0:i.sessionID;this.config.bootstrap=i||(null==(r=this.Zo)?void 0:r.bootstrap)||{},null==(n=this.featureFlags)||null==n.updateConfig||n.updateConfig(this.config,this.ma());var a=this.get_property(pn),l=this.get_property(gn),u=this.get_property(Mn),h=this.is_capturing();this.consent.reset(),e||!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 d=null==(s=this.persistence)||null==s.Ws?void 0:s.Ws(),v=!1;try{var c,f,g,m,y,_,b,w,k,S,x,C,T,E;if(null==(c=this.persistence)||c.clear(),null==(f=this.sessionPersistence)||f.clear(),this.jo.clear(),this.ml(),at(u)||null==(x=this.persistence)||x.register({[Mn]:u}),null==(g=this.surveys)||g.reset(),null==(m=this.vl)||m.stop(),null==(y=this.featureFlags)||y.reset(),null==(_=this.conversations)||_.reset(),null==(b=this.logs)||b.reset(),null==(w=this.metrics)||w.reset(),null==(k=this.persistence)||k.set_property(vs,Ls),null==(S=this.sessionManager)||S.resetSessionId(),this.Vo=null,this.config.cookieless_mode===Fs)this.register_once({distinct_id:_s,$device_id:null},"");else{var M=this.config.get_device_id(Pf());this.register_once({distinct_id:M,$device_id:t?M:a},""),t||at(l)||this.register({[gn]:l})}if(this.register({$last_posthog_reset:(new Date).toISOString()},1),i)if(void 0===i.distinctID||this.Oo()||(null==(E=this.persistence)||E.set_property(vs,i.isIdentifiedID?$s:Ls),this.register({distinct_id:i.distinctID})),null==(C=this.featureFlags)||C.initialize(),!(at(o)||null!=(T=this.sessionManager)&&T.setBootstrapSessionId(o,!0))){var I=p({},i);delete I.sessionID,this.config.bootstrap=I}delete this.config.identity_distinct_id,delete this.config.identity_hash,v=!0}finally{var R;d&&(null==(R=this.persistence)||null==R.Qs||R.Qs(v))}this.reloadFeatureFlags()}shutdown(t){var e=this;return f((function*(){var t,i,r,n,s,o;if(e.__loaded){null==(t=e.vl)||t.stop(),e.sl().dispose(),null==(i=e.sessionRecording)||i.dispose(),null==(r=e.logs)||r.flushLogs("sendBeacon"),null==(n=e.metrics)||n.flush("sendBeacon"),null==(s=e.Jo)||s.unload(),null==(o=e.Yo)||o.unload();try{var a;null==(a=e.featureFlags)||a.destroy()}catch(t){ji.error("Error while destroying feature flags",t)}}else ji.uninitializedWarning("posthog.shutdown")}))()}setIdentity(t,e){var i;this.config.identity_distinct_id=t,this.config.identity_hash=e,this.alias(t),null==(i=this.conversations)||i.Sl()}clearIdentity(){var t;delete this.config.identity_distinct_id,delete this.config.identity_hash,null==(t=this.conversations)||t.xl()}get_distinct_id(){return this.get_property("distinct_id")}getGroups(){return this.get_property("$groups")||{}}get_session_id(){var t,e;return null!==(t=null==(e=this.sessionManager)?void 0:e.checkAndGetSessionAndWindowId(!0).sessionId)&&void 0!==t?t:""}get_session_replay_url(t){if(!this.sessionManager)return"";var e=this.sessionManager.checkAndGetSessionAndWindowId(!0),i=e.sessionStartTimestamp,r=this.requestRouter.endpointFor("ui","/project/"+this.config.token+"/replay/"+e.sessionId);if(null!=t&&t.withTimestamp&&i){var n,s=null!==(n=t.timestampLookBack)&&void 0!==n?n:10;if(!i)return r;r+="?t="+Math.max(Math.floor(((new Date).getTime()-i)/1e3)-s,0)}return r}alias(t,e){return t===this.get_property(cn)?(ji.critical("Attempting to create alias for existing People user - aborting."),-2):this.bl("posthog.alias")?(at(e)&&(e=this.get_distinct_id()),t!==e?(this._l(mn,t),this.capture("$create_alias",{alias:t,distinct_id:e})):(ji.warn("alias matches current distinct_id - skipping api call."),this.identify(t),-1)):void 0}set_config(t){var e=p({},this.config);if(st(t)){var i,r,n,s,o,a,l,u,h,d,v,c;zi(this.config,qw(t));var f=this.$o();null==(i=this.persistence)||i.update_config(this.config,e,f),this.sessionPersistence="sessionStorage"===this.config.persistence||"memory"===this.config.persistence?this.persistence:new Ab(p({},this.config,{persistence:"sessionStorage"}),f,!1);var g,m=this.Go(this.config.debug);ft(m)&&(this.config.debug=m),ft(this.config.debug)&&(this.config.debug?(Ni.DEBUG=!0,Df.Nr()&&Df.Dr("ph_debug",!0),ji.info("set_config",{config:t,oldConfig:e,newConfig:p({},this.config)})):(Ni.DEBUG=!1,Df.Nr()&&Df.qr("ph_debug"))),null==(r=this.featureFlags)||null==r.updateConfig||r.updateConfig(this.config,this.ma()),null==(n=this.exceptionObserver)||n.onConfigChange(),null==(s=this.exceptions)||s.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(),("capture_pageview"in t||"disable_capture_url_hashes"in t)&&(null==(g=this.historyAutocapture)||g.startIfEnabledOrStop()),null==(h=this.exceptionObserver)||h.startIfEnabledOrStop(),null==(d=this.deadClicksAutocapture)||d.startIfEnabledOrStop(),null==(v=this.surveys)||v.loadIfEnabled(),this.No(),null==(c=this.externalIntegrations)||c.startIfEnabledOrStop()}}_overrideSDKInfo(t,e){Ni.LIB_NAME=t,Ni.LIB_VERSION=e}startSessionRecording(t){var e,i,r,n,s,o=!0===t,a={sampling:o||!(null==t||!t.sampling),linked_flag:o||!(null==t||!t.linked_flag),url_trigger:o||!(null==t||!t.url_trigger),event_trigger:o||!(null==t||!t.event_trigger)};Object.values(a).some(Boolean)&&(null==(e=this.sessionManager)||e.checkAndGetSessionAndWindowId(),a.sampling&&(null==(i=this.sessionRecording)||i.overrideSampling()),a.linked_flag&&(null==(r=this.sessionRecording)||r.overrideLinkedFlag()),a.url_trigger&&(null==(n=this.sessionRecording)||n.overrideTrigger("url")),a.event_trigger&&(null==(s=this.sessionRecording)||s.overrideTrigger("event")));this.set_config({disable_session_recording:!1})}stopSessionRecording(){this.set_config({disable_session_recording:!0})}sessionRecordingStarted(){var t;return!(null==(t=this.sessionRecording)||!t.started)}captureException(t,e){if(this.exceptions){var i=new Error("PostHog syntheticException"),r=this.exceptions.buildProperties(t,{handled:!0,syntheticException:i});return this.exceptions.sendExceptionEvent(p({},r,e))}}addExceptionStep(t,e){var i;null==(i=this.exceptions)||i.addExceptionStep(t,e)}captureLog(t){var e;null==(e=this.logs)||e.captureLog(t)}get logger(){var t,e;return null!==(t=null==(e=this.logs)?void 0:e.logger)&&void 0!==t?t:Bw.Cl}startExceptionAutocapture(t){this.set_config({capture_exceptions:null==t||t})}stopExceptionAutocapture(){this.set_config({capture_exceptions:!1})}loadToolbar(t){var e,i;return null!==(e=null==(i=this.toolbar)?void 0:i.loadToolbar(t))&&void 0!==e&&e}get_property(t){var e;return null==(e=this.persistence)?void 0:e.props[t]}getSessionProperty(t){var e;return null==(e=this.sessionPersistence)?void 0:e.props[t]}toString(){var t,e=null!==(t=this.config.name)&&void 0!==t?t:Lw;return e!==Lw&&(e=Lw+"."+e),e}_isIdentified(){var t,e;return(null==(t=this.persistence)?void 0:t.get_property(vs))===$s||(null==(e=this.sessionPersistence)?void 0:e.get_property(vs))===$s}yl(){var t,e;return!("never"===this.config.person_profiles||this.config.person_profiles===Ds&&!this._isIdentified()&&ot(this.getGroups())&&(null==(t=this.persistence)||null==(t=t.props)||!t[mn])&&(null==(e=this.persistence)||null==(e=e.props)||!e[ys]))}cl(){return!0===this.config.capture_pageleave||"if_capture_pageview"===this.config.capture_pageleave&&!!this.config.capture_pageview}createPersonProfile(){this.yl()||this.bl("posthog.createPersonProfile")&&this.setPersonProperties({},{})}setInternalOrTestUser(){this.bl("posthog.setInternalOrTestUser")&&this.setPersonProperties({$internal_or_test_user:!0})}bl(t){return"never"===this.config.person_profiles?(ji.error(t+' was called, but process_person is set to "never". This call will be ignored.'),!1):(this._l(ys,!0),!0)}$o(){if("always"===this.config.cookieless_mode)return!0;var t=this.consent.isOptedOut();return this.config.disable_persistence||t&&!(!this.config.opt_out_persistence_by_default&&this.config.cookieless_mode!==Os)}No(){var t,e,i,r,n=this.$o();return(null==(t=this.persistence)?void 0:t.Hs)!==n&&(null==(i=this.persistence)||i.set_disabled(n)),(null==(e=this.sessionPersistence)?void 0:e.Hs)!==n&&(null==(r=this.sessionPersistence)||r.set_disabled(n)),n&&(this.jo.clear(),this.ml()),n}opt_in_capturing(t){var e;if(this.config.cookieless_mode!==Fs){if(this.Oo()){var i,r,n,s,o;this.kl(!0,!0),null==(i=this.sessionManager)||i.destroy(),null==(r=this.pageViewManager)||r.destroy(),this.sessionManager=new vw(this),this.pageViewManager=new kb(this),this.persistence&&(this.sessionPropsManager=new lw(this,this.sessionManager,this.persistence));var a,l=null!==(n=null==(s=this.config.__extensionClasses)?void 0:s.sessionRecording)&&void 0!==n?n:null==(o=Bw.__defaultExtensionClasses)?void 0:o.sessionRecording;l&&(this.sessionRecording=this.Lo(this.sessionRecording,new l(this)),this.Io&&(null==(a=this.sessionRecording)||null==a.onRemoteConfig||a.onRemoteConfig(this.Io)))}var u,h;this.consent.optInOut(!0),this.No(),this.hl(),null==(e=this.sessionRecording)||e.startIfEnabledOrStop(),this.config.cookieless_mode==Os&&(null==(u=this.surveys)||u.loadIfEnabled()),(at(null==t?void 0:t.captureEventName)||null!=t&&t.captureEventName)&&this.capture(null!==(h=null==t?void 0:t.captureEventName)&&void 0!==h?h:"$opt_in",null==t?void 0:t.captureProperties,{send_instantly:!0}),this.config.capture_pageview&&this.dl()}else ji.warn(Rw)}opt_out_capturing(){var t,e,i;this.config.cookieless_mode!==Fs?(this.config.cookieless_mode===Os&&this.consent.isOptedIn()&&this.kl(!0,!0),this.consent.optInOut(!1),this.No(),this.config.cookieless_mode===Os&&(this.register({distinct_id:_s,$device_id:null}),null==(t=this.sessionRecording)||t.stopRecording(),this.sessionRecording=void 0,null==(e=this.sessionManager)||e.destroy(),null==(i=this.pageViewManager)||i.destroy(),this.sessionManager=void 0,this.sessionPropsManager=void 0,this.config.capture_pageview&&this.dl(),this.hl())):ji.warn(Rw)}has_opted_in_capturing(){return this.consent.isOptedIn()}has_opted_out_capturing(){return this.consent.isOptedOut()}get_explicit_consent_status(){var t=this.consent.consent;return 1===t?"granted":0===t?"denied":"pending"}is_capturing(){return this.config.cookieless_mode===Fs||(this.config.cookieless_mode===Os?this.consent.isRejected()||this.consent.isOptedIn():!this.has_opted_out_capturing())}clear_opt_in_out_capturing(){this.consent.reset(),this.No()}_is_bot(){return i?cw(i,this.config.custom_blocked_useragents):void 0}dl(){r&&("visible"===r.visibilityState?this.Uo||(this.Uo=!0,this.capture(js,{title:r.title},{send_instantly:!0}),this.zo&&(r.removeEventListener(Ns,this.zo),this.zo=null)):this.zo||(this.zo=this.dl.bind(this),Ki(r,Ns,this.zo)))}debug(e){!1===e?(null==t||t.console.log("You've disabled debug mode."),this.set_config({debug:!1})):(null==t||t.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}))}ma(){var t=this.Zo||{};return"advanced_disable_flags"in t?!!t.advanced_disable_flags:!1!==this.config.advanced_disable_flags?!!this.config.advanced_disable_flags:!0===this.config.advanced_disable_decide?(ji.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(t,e,i,r,n){var s=e in t&&!dt(t[e]),o=i in t&&!dt(t[i]);return s?t[e]:!!o&&(n&&n.warn("Config field '"+i+"' is deprecated. Please use '"+e+"' instead. The old field will be removed in a future major version."),t[i])}(t,"advanced_disable_flags","advanced_disable_decide",0,ji)}kn(t){var e;if(dt(this.config.before_send))return t;var i=Object.keys(null!==(e=t.properties)&&void 0!==e?e:{}).filter(mt),r=rt(this.config.before_send)?this.config.before_send:[this.config.before_send],n=t;for(var s of r)try{if(n=s(n),dt(n)){var o="Event '"+t.event+"' was rejected in beforeSend function";return gt(t.event)?ji.warn(o+". This can cause unexpected behavior."):ji.info(o),null}n.properties&&!ot(n.properties)||ji.warn("Event '"+t.event+"' has no properties after beforeSend function, this is likely an error.")}catch(e){return ji.error("Error in beforeSend function for event '"+t.event+"':",e),null}for(var a of i)if(n.properties&&dt(n.properties[a]))return ji.warn("Event '"+t.event+"' had its '"+a+"' property removed in a beforeSend function. This property is required for ingestion, so the event will be dropped."),null;return n}getPageViewId(){var t;return null==(t=this.pageViewManager.Ss)?void 0:t.pageViewId}captureTraceFeedback(t,e){this.capture("$ai_feedback",{$ai_trace_id:String(t),$ai_feedback_text:e})}captureTraceMetric(t,e,i){this.capture("$ai_metric",{$ai_trace_id:String(t),$ai_metric_name:e,$ai_metric_value:String(i)})}Go(t){var e=ft(t)&&!t,i=Df.Nr()&&"true"===Df.Pr("ph_debug");return!e&&(!!i||t)}}Bw.__defaultExtensionClasses={},Bw.Cl=(()=>{var t=()=>{};return{trace:t,debug:t,info:t,warn:t,error:t,fatal:t}})(),function(t,e){for(var i=0;e.length>i;i++)t.prototype[e[i]]=Gi(t.prototype[e[i]])}(Bw,["identify"]);class Uw{constructor(t){this._instance=t}refresh(t){var e=this._instance.config,i=st(e.autocapture)?e.autocapture:void 0;t.enabled=!!e.autocapture,t.rageclick=e.rageclick,t.maskAllElementAttributes=e.mask_all_element_attributes,t.maskAllText=e.mask_all_text,t.disableCaptureUrlHashes=e.disable_capture_url_hashes,t.getCurrentUrl=e.get_current_url,t.remoteRequestsDisabled=this._instance.ma(),t.url_allowlist=null==i?void 0:i.url_allowlist,t.url_ignorelist=null==i?void 0:i.url_ignorelist,t.dom_event_allowlist=null==i?void 0:i.dom_event_allowlist,t.element_allowlist=null==i?void 0:i.element_allowlist,t.css_selector_allowlist=null==i?void 0:i.css_selector_allowlist,t.css_selector_ignorelist=null==i?void 0:i.css_selector_ignorelist,t.element_attribute_ignorelist=null==i?void 0:i.element_attribute_ignorelist,t.capture_copied_text=null==i?void 0:i.capture_copied_text}}var Hw=Bi("[ExceptionAutocapture]"),zw=Bi("[TracingHeaders]"),Ww=Bi("[Web Vitals]"),Vw=9e5,Gw=["CLS","FCP","INP","LCP"],Zw=["INP","LCP"],Qw=["interactionTarget","interactionType","inputDelay","processingDuration","presentationDelay","loadState","target","url","timeToFirstByte","resourceLoadDelay","resourceLoadDuration","elementRenderDelay","largestShiftTarget","largestShiftTime","largestShiftValue","firstByteToFCP"],Jw="[SessionRecording]",Kw=Bi(Jw),Yw=Bi("[Heatmaps]");function Xw(t){return st(t)&&"clientX"in t&&"clientY"in t&&vt(t.clientX)&&vt(t.clientY)}var tk=Bi("[Product Tours]"),ek=t=>{var e;return!t.config.disable_product_tours&&!(null==(e=t.persistence)||!e.get_property(Tn))},ik=["$set_once","$set"],rk=Bi("[SiteApps]"),nk="Error while initializing PostHog app with config id ",sk=(t,e)=>null!=t&&t.then?t.then(e):e(t),ok="SDK is not enabled or survey functionality is not yet loaded",ak="Disabled. Not loading surveys.";class lk{constructor(t,e){this.name="surveys",this._surveyEventReceiver=null,this._surveyManager=null,this.Tl=!1,this.Ml=[],this.El=null,this.Il=null,this.Xn=!1,this.Rl=new Set,this.onRemoteConfig=t=>{if(!this.Xn&&!this.qi.disableSurveys){if(!t.ok)return gf.warn("Remote config unavailable. Not loading surveys.");var e=t.config.surveys;if(dt(e))return gf.warn("Flags not loaded yet. Not loading surveys.");this.Pl=ft(e)?e:e.length>0,gf.info("flags response received, isSurveysEnabled: "+this.Pl),this.loadIfEnabled()}},this.ts=t,this.Al=e}setup(t){if(!this.Xn)return this.Fl=t,sk(t.kv.initialize(),(()=>{if(this.Fl===t&&!this.Xn){this.Fl=void 0,this.ns=t;var e=t.onRemoteConfig(this.onRemoteConfig);this.Xn?e.dispose():(this.ss=e,this.loadIfEnabled())}}))}dispose(){var t,e,i;this.Xn||(this.Xn=!0,this.Fl=void 0,this.ns=void 0,null==(t=this.ss)||t.dispose(),this.ss=void 0,null==(e=this._surveyEventReceiver)||e.dispose(),this._surveyEventReceiver=null,null==(i=this._surveyManager)||null==i.dispose||i.dispose(),this._surveyManager=null,this.Ml=[],this.El=null,this.Rl.forEach((t=>clearTimeout(t))),this.Rl.clear())}get qi(){return this.ts.get()}initialize(){this.loadIfEnabled()}reset(){try{var t;null==(t=this._surveyEventReceiver)||t.reset(),localStorage.removeItem("lastSeenSurveyDate");for(var e=[],i=0;i<localStorage.length;i++){var r=localStorage.key(i);(null!=r&&r.startsWith(_f)||null!=r&&r.startsWith(bf))&&e.push(r)}e.forEach((t=>localStorage.removeItem(t)))}catch(t){}}loadIfEnabled(){if(!this.Xn&&this.ns){var t=this.qi;if(!this._surveyManager)if(this.Tl)gf.info("Already initializing surveys, skipping...");else if(t.disableSurveys)gf.info(ak);else if(t.cookielessMode&&this.ts.isOptedOut())gf.info("Not loading surveys in cookieless mode without consent.");else{var e=this.ts.getExtensions();if(e){if(!at(this.Pl)||t.advancedEnableSurveys){var i=this.Pl||t.advancedEnableSurveys;this.Tl=!0;try{var r=e.generateSurveys;if(r)return this.Ll(r,i),void(this.Tl=!1);var n=e.loadExternalDependency;if(!n)return this.Ol(As),void(this.Tl=!1);n((t=>{try{if(this.Xn)return;var e=this.ts.getExtensions();t||null==e||!e.generateSurveys?this.Ol("Could not load surveys script",t):this.Ll(e.generateSurveys,i)}finally{this.Tl=!1}}))}catch(t){throw this.Tl=!1,this.Ol("Error initializing surveys",t),t}}}else gf.error("PostHog Extensions not found.")}}}Ll(t,e){this.Xn||(this._surveyManager=t(e),this._surveyEventReceiver=this.ts.createEventReceiver(),gf.info("Surveys loaded successfully"),this.Dl({isLoaded:!0}))}Ol(t,e){gf.error(t,e),this.Dl({isLoaded:!1,error:t})}onSurveysLoaded(t){return this.Ml.push(t),this._surveyManager&&this.Dl({isLoaded:!0}),()=>{this.Ml=this.Ml.filter((e=>e!==t))}}getSurveys(t,e){var i;void 0===e&&(e=!1);var r=null!==(i=this.ns)&&void 0!==i?i:this.Al;if(r&&!this.Xn){if(this.qi.disableSurveys)return gf.info(ak),t([]);var n=r.kv.get(is);if(n&&!e)return t(n,{isLoaded:!0}),void(this.$l()&&this.getSurveys((()=>{}),!0));if(this.El)this.El.then((e=>{this.Xn||t(e.surveys,e.context)})).catch((t=>gf.error("Error in survey callback",t)));else{var s=this.Nl("/api/surveys/",{method:"GET",query:{token:r.projectToken},sentAt:"query",timeoutMs:this.qi.requestTimeoutMs}).then((t=>{try{return this.ql(r,t)}catch(t){return gf.error("Error processing surveys response",t),this.ql(r,{statusCode:0,error:t})}}),(t=>this.ql(r,{statusCode:0,error:t})));this.El=s;var o=()=>{this.El===s&&(this.El=null)};s.then((e=>{o(),this.Xn||t(e.surveys,e.context)}),o).catch((t=>gf.error("Error in survey callback",t)))}}}Nl(t,e){var i=this.ns;return i?i.sendRequest(t,e):new Promise((t=>t({statusCode:0,error:new Error(ok)})))}ql(t,e){if(this.Xn)return{surveys:[],context:{isLoaded:!1,error:ok}};var i=e.statusCode;if(200!==i||!e.json){var r="Surveys API could not be loaded, status: "+i;return 0!==i?gf.error(r):e.error||gf.warn(r),this.Il=Date.now(),{surveys:[],context:{isLoaded:!1,error:r}}}this.Il=null;var n,s=e.json.surveys||[],o=s.filter((t=>mf(t)&&(ya(t)||yf(t))));return o.length>0&&(null==(n=this._surveyEventReceiver)||n.register(o)),t.kv.set({[is]:s,[rs]:Date.now()}),{surveys:s,context:{isLoaded:!0}}}$l(){return this.jl()&&!this.El&&!this.Bl()}jl(){var t,e,i=null==(t=null!==(e=this.ns)&&void 0!==e?e:this.Al)?void 0:t.kv.get(rs);return vt(i)&&Date.now()-i>3e5}Bl(){return vt(this.Il)&&3e5>Date.now()-this.Il}markSurveyAsSeen(t,e){var i,r={id:t,current_iteration:null!==(i=null==e?void 0:e.iteration)&&void 0!==i?i:null};Sf(r);try{localStorage.setItem("lastSeenSurveyDate",(new Date).toISOString())}catch(t){}}Dl(t){for(var e of this.Ml)try{if(!t.isLoaded)return e([],t);this.getSurveys(e)}catch(t){gf.error("Error in survey callback",t)}}getActiveMatchingSurveys(t,e){if(void 0===e&&(e=!1),!dt(this._surveyManager))return this._surveyManager.getActiveMatchingSurveys(t,e);gf.warn("init was not called")}Hl(t){var e=null;return this.getSurveys((i=>{var r;e=null!==(r=i.find((e=>e.id===t)))&&void 0!==r?r:null})),e}Ul(t){if(dt(this._surveyManager))return{eligible:!1,reason:ok};var e="string"==typeof t?this.Hl(t):t;return e?this._surveyManager.checkSurveyEligibility(e):{eligible:!1,reason:"Survey not found"}}zl(t){if(dt(this._surveyManager))return{eligible:!1,reason:ok};var e="string"==typeof t?this.Hl(t):t;return e?this._surveyManager.checkSurveyRenderability(e):{eligible:!1,reason:"Survey not found"}}canRenderSurvey(t){if(dt(this._surveyManager))return gf.warn("init was not called"),{visible:!1,disabledReason:ok};var e=this.zl(t);return{visible:e.eligible,disabledReason:e.reason}}canRenderSurveyAsync(t,e){return dt(this._surveyManager)?(gf.warn("init was not called"),Promise.resolve({visible:!1,disabledReason:ok})):new Promise((i=>{this.getSurveys((e=>{var r,n=null!==(r=e.find((e=>e.id===t)))&&void 0!==r?r:null;if(n){var s=this.zl(n);i({visible:s.eligible,disabledReason:s.reason})}else i({visible:!1,disabledReason:"Survey not found"})}),e)}))}renderSurvey(t,e,i){var n;if(dt(this._surveyManager))gf.warn("init was not called");else{var s="string"==typeof t?this.Hl(t):t;if(null!=s&&s.id)if(xf.includes(s.type)){var o=null==r?void 0:r.querySelector(e);if(o)if(null!=(n=s.appearance)&&n.surveyPopupDelaySeconds){gf.info("Rendering survey "+s.id+" with delay of "+s.appearance.surveyPopupDelaySeconds+" seconds");var a=setTimeout((()=>{var t,e;this.Rl.delete(a),this.Xn||(gf.info("Rendering survey "+s.id+" with delay of "+(null==(t=s.appearance)?void 0:t.surveyPopupDelaySeconds)+" seconds"),null==(e=this._surveyManager)||e.renderSurvey(s,o,i),gf.info("Survey "+s.id+" rendered"))}),1e3*s.appearance.surveyPopupDelaySeconds);this.Rl.add(a)}else this._surveyManager.renderSurvey(s,o,i);else gf.warn("Survey element not found")}else gf.warn("Surveys of type "+s.type+" cannot be rendered in the app");else gf.warn("Survey not found")}}displaySurvey(t,e){var i;if(dt(this._surveyManager))gf.warn("init was not called");else{var r=this.Hl(t);if(r){var n=r;if(null!=(i=r.appearance)&&i.surveyPopupDelaySeconds&&e.ignoreDelay&&(n=p({},r,{appearance:p({},r.appearance,{surveyPopupDelaySeconds:0})})),e.displayType!==pf.Popover&&e.initialResponses&&gf.warn("initialResponses is only supported for popover surveys. prefill will not be applied."),!1===e.ignoreConditions){var s=this.Ul(r);if(!s.eligible)return void gf.warn("Survey is not eligible to be displayed: ",s.reason)}e.displayType!==pf.Inline?this._surveyManager.handlePopoverSurvey(n,e):this.renderSurvey(n,e.selector,e.properties)}else gf.warn("Survey not found")}}cancelPendingSurvey(t){dt(this._surveyManager)?gf.warn("init was not called"):this._surveyManager.cancelSurvey(t)}handlePageUnload(){var t;null==(t=this._surveyManager)||null==t.handlePageUnload||t.handlePageUnload()}}function uk(t,e,i){if(dt(t))return!1;switch(i){case"exact":return t===e;case"contains":var r=e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&").replace(/_/g,".").replace(/%/g,".*");return new RegExp(r,"i").test(t);case"regex":try{return new RegExp(e).test(t)}catch(t){return!1}default:return!1}}class hk{constructor(t){this.Wl=new Set,this.Vl=new Set,this.Gl=new uw,this.Zl=(t,e)=>this.Ql(t,e)&&this.Jl(t,e)&&this.Kl(t,e)&&this.Yl(t,e),this.Ql=(t,e)=>null==e||!e.event||(null==t?void 0:t.event)===(null==e?void 0:e.event),this._instance=t}init(){var t,e;at(null==(t=this._instance)?void 0:t._addCaptureHook)||(this.Xl=null==(e=this._instance)?void 0:e._addCaptureHook(((t,e)=>{this.on(t,e)})))}dispose(){var t;null==(t=this.Xl)||t.call(this),this.Xl=void 0,this.Gl=new uw}register(t){var e,i;if(!at(null==(e=this._instance)?void 0:e._addCaptureHook)&&(t.forEach((t=>{var e;this.Wl.add(t),null==(e=t.steps)||e.forEach((t=>{this.Vl.add((null==t?void 0:t.event)||"")}))})),null!=(i=this._instance)&&i.autocapture)){var r=new Set;this.Wl.forEach((t=>{var e;null==(e=t.steps)||e.forEach((t=>{null!=t&&t.selector&&r.add(t.selector)}))})),this._instance.autocapture.setElementSelectors(r)}}replace(t){this.Wl.clear(),this.Vl.clear(),this.register(t)}on(t,e){null!=e&&0!=t.length&&(this.Vl.has(t)||this.Vl.has(e.event))&&this.Wl.forEach((t=>{this.tu(e,t)&&this.Gl.emit("actionCaptured",t.name)}))}eu(t){this.onAction("actionCaptured",(e=>t(e)))}tu(t,e){if(null==(null==e?void 0:e.steps))return!1;for(var i of e.steps)if(this.Zl(t,i))return!0;return!1}onAction(t,e){return this.Gl.on(t,e)}Jl(t,e){if(null!=e&&e.url){var i,r=null==t||null==(i=t.properties)?void 0:i.$current_url;if(!r||"string"!=typeof r)return!1;if(!uk(r,e.url,e.url_matching||"contains"))return!1}return!0}Kl(t,e){return!!this.iu(t,e)&&!!this.ru(t,e)&&!!this.nu(t,e)}iu(t,e){var i;if(null==e||!e.href)return!0;var r=this.su(t);if(r.length>0)return r.some((t=>uk(t.href,e.href,e.href_matching||"exact")));var n,s=(null==t||null==(i=t.properties)?void 0:i.$elements_chain)||"";return!!s&&uk((n=s.match(/(?::|")href="(.*?)"/))?n[1]:"",e.href,e.href_matching||"exact")}ru(t,e){var i;if(null==e||!e.text)return!0;var r=this.su(t);if(r.length>0)return r.some((t=>uk(t.text,e.text,e.text_matching||"exact")||uk(t.$el_text,e.text,e.text_matching||"exact")));var n,s,o,a=(null==t||null==(i=t.properties)?void 0:i.$elements_chain)||"";return!!a&&(n=function(t){for(var e,i=[],r=/(?::|")text="(.*?)"/g;!dt(e=r.exec(t));)i.includes(e[1])||i.push(e[1]);return i}(a),s=e.text,o=e.text_matching||"exact",n.some((t=>uk(t,s,o))))}nu(t,e){var i,r;if(null==e||!e.selector)return!0;var n=null==t||null==(i=t.properties)?void 0:i.$element_selectors;if(null!=n&&n.includes(e.selector))return!0;var s=(null==t||null==(r=t.properties)?void 0:r.$elements_chain)||"";if(e.selector_regex&&s)try{return new RegExp(e.selector_regex).test(s)}catch(t){return!1}return!1}su(t){var e;return null==(null==t||null==(e=t.properties)?void 0:e.$elements)?[]:null==t?void 0:t.properties.$elements}Yl(t,e){return null==e||!e.properties||0===e.properties.length||Sa(e.properties.reduce(((t,e)=>{var i=rt(e.value)?e.value.map(String):null!=e.value?[String(e.value)]:[];return t[e.key]={values:i,operator:e.operator||"exact"},t}),{}),null==t?void 0:t.properties)}}class dk{constructor(t){var e;this.au=[],this._instance=t,this.ou=new Map,this.lu=new Map,this.uu=new Map,this.hu=null==(e=this._instance)||null==e.onSessionId?void 0:e.onSessionId((t=>this.du(t)))}vu(t){return!1}cu(){return null}fu(t){}pu(){}gu(t,e){return!!t&&Sa(t.propertyFilters,null==e?void 0:e.properties)}mu(t,e){var i=new Map;return t.forEach((t=>{var r;null==(r=t.conditions)||null==(r=r[e])||null==(r=r.values)||r.forEach((e=>{if(null!=e&&e.name){var r=i.get(e.name)||[];r.push(t.id),i.set(e.name,r)}}))})),i}yu(t,e,i){var r=(i===sf.Activation?this.ou:this.lu).get(t),n=[];return this.bu((t=>{n=t.filter((t=>null==r?void 0:r.includes(t.id)))})),n.filter((r=>{var n,s=null==(n=r.conditions)||null==(n=n[i])||null==(n=n.values)?void 0:n.find((e=>e.name===t));return this.gu(s,e)}))}register(t){this._u(t,!1)}replace(t){this._u(t,!0)}_u(t,e){var i;at(null==(i=this._instance)?void 0:i._addCaptureHook)||(this.wu(t,e),this.ku(t,e))}ku(t,e){var i=t.filter((t=>{var e;return null==(e=t.conditions)||null==(e=e.actions)||null==(e=e.values)?void 0:e.length}));if(e&&this.uu.clear(),0!==i.length){this.Su||(this.Su=new hk(this._instance),this.Su.init(),this.Su.eu((t=>this.onAction(t))));var r=[];i.forEach((t=>{var e;null==(e=t.conditions)||null==(e=e.actions)||e.values.forEach((e=>{if(r.push(e),e.name){var i,n=null!==(i=this.uu.get(e.name))&&void 0!==i?i:[];n.includes(t.id)||n.push(t.id),this.uu.set(e.name,n)}}))})),e?this.Su.replace(r):this.Su.register(r)}else{var n;e&&(null==(n=this.Su)||n.replace([]))}}xu(t,e){e.forEach(((e,i)=>{var r,n=null!==(r=t.get(i))&&void 0!==r?r:[];e.forEach((t=>{n.includes(t)||n.push(t)})),t.set(i,n)}))}wu(t,e){var i,r,n=t.filter((t=>{var e,i;return(null==(e=t.conditions)?void 0:e.events)&&(null==(i=t.conditions)||null==(i=i.events)||null==(i=i.values)?void 0:i.length)>0})),s=t.filter((t=>{var e,i;return(null==(e=t.conditions)?void 0:e.cancelEvents)&&(null==(i=t.conditions)||null==(i=i.cancelEvents)||null==(i=i.values)?void 0:i.length)>0})),o=this.mu(t,sf.Activation),a=this.mu(t,sf.Cancellation);e?(this.ou=o,this.lu=a):(this.xu(this.ou,o),this.xu(this.lu,a)),(0!==n.length||0!==s.length)&&(null!==(i=this.Xl)&&void 0!==i||(this.Xl=null==(r=this._instance)?void 0:r._addCaptureHook(((t,e)=>{this.onEvent(t,e)}))))}onEvent(t,e){var i,r,n=this.Cu(),s=(null==e||null==(i=e.properties)?void 0:i.$survey_id)||(null==e||null==(r=e.properties)?void 0:r.$product_tour_id);if(s&&this.getActivatedIds().includes(s)){var o=this.Tu(t,s);if("consume"===o)return n.info("event consumed activated item, removing it",{event:t,itemId:s}),void this.Mu([s]);if("persist"===o)return n.info("shown item promoted to persisted activation",{event:t,itemId:s}),this.Eu(s),void this.Iu([s])}if(this.lu.has(t)){var a=this.yu(t,e,sf.Cancellation);a.length>0&&(n.info("cancel event matched, cancelling items",{event:t,itemsToCancel:a.map((t=>t.id))}),this.Mu(a.map((t=>t.id))),a.forEach((t=>this.Ru(t.id))))}if(this.ou.has(t)){n.info("event name matched",{event:t,eventPayload:e,items:this.ou.get(t)});var l=this.yu(t,e,sf.Activation);this.Pu(l.map((t=>t.id)))}}onAction(t){this.uu.has(t)&&this.Pu(this.uu.get(t)||[])}Pu(t){var e;if(0!==t.length){var i=!(null==(e=this._instance)||null==e.get_session_id||!e.get_session_id()),r=[];for(var n of t)i&&this.vu(n)?this.Eu(n)&&this.Au(n):r.push(n);r.length>0&&(this.au=[...new Set([...this.au,...r])]),this.Cu().info("updating activated items",{activatedItems:this.getActivatedIds()})}}Eu(t){this.au=this.au.filter((e=>e!==t));var e=this.Fu();return!e.includes(t)&&(this.Lu([...e,t]),this.Ou(),!0)}Mu(t){var e=new Set(t);this.au=this.au.filter((t=>!e.has(t)));var i=this.Du(),r=i.filter((t=>!e.has(t)));r.length!==i.length&&(this.Lu(r),0===r.length&&this.$u()),this.Iu(t)}Nu(){var t,e=this.cu();if(!e)return{};var i=null==(t=this._instance)||null==(t=t.persistence)?void 0:t.props[e];return i&&"object"==typeof i?i:{}}Au(t){if(this.cu()){var e=this.Nu();this.fu(p({},e,{[t]:Date.now()}))}}Iu(t){if(this.cu()){var e=this.Nu(),i={},r=!1;for(var n of Object.entries(e)){var s=n[0],o=n[1];t.includes(s)?r=!0:i[s]=o}r&&(ot(i)?this.pu():this.fu(i))}}qu(){this.cu()&&this.pu()}getActivationTimestamp(t){if(this.Fu().includes(t)){var e=this.Nu()[t];return vt(e)?e:void 0}}Du(){var t,e=this.ju();return(null==(t=this._instance)||null==(t=t.persistence)?void 0:t.props[e])||[]}Fu(){var t,e,i=this.Du();if(0===i.length)return[];var r=null==(t=this._instance)||null==(t=t.persistence)?void 0:t.props[this.Bu()],n=null==(e=this._instance)||null==e.get_session_id?void 0:e.get_session_id();return n&&r===n?i:[]}Ou(){var t,e=null==(t=this._instance)||null==t.get_session_id?void 0:t.get_session_id();e&&this.Hu(e)}$u(){this.Uu()}du(t){var e,i=null==(e=this._instance)||null==(e=e.persistence)?void 0:e.props[this.Bu()];if(i&&i!==t){var r=this.Du(),n=this.Nu();r.length>0&&(this.Lu([]),r.filter((t=>vt(n[t]))).forEach((t=>this.Ru(t)))),this.$u(),this.qu()}}getActivatedIds(){return[...new Set([...this.Fu(),...this.au])].filter((t=>!this.zu(t)))}dispose(){var t,e,i;null==(t=this.hu)||t.call(this),this.hu=void 0,null==(e=this.Xl)||e.call(this),this.Xl=void 0,null==(i=this.Su)||i.dispose(),this.Su=void 0}reset(){this.au=[],this.Du().length>0&&this.Lu([]),this.$u(),this.qu()}getEventToItemsMap(){return this.ou}Wu(){return this.Su}}class vk extends dk{constructor(t){super(t)}ju(){return ns}Bu(){return ss}cu(){return os}fu(t){var e;null==(e=this._instance)||null==(e=e.persistence)||e.register({[os]:t})}pu(){var t;null==(t=this._instance)||null==(t=t.persistence)||t.unregister(os)}vu(t){var e,i;this.bu((e=>{i=e.find((e=>e.id===t))}));var r=null==(e=i)||null==(e=e.appearance)?void 0:e.surveyPopupDelaySeconds;return vt(r)&&r>0}Vu(){return cf.SHOWN}bu(t){var e;null==(e=this._instance)||e.getSurveys(t)}Ru(t){var e;null==(e=this._instance)||e.cancelPendingSurvey(t)}Cu(){return gf}Lu(t){var e;null==(e=this._instance)||null==(e=e.persistence)||e.register({[ns]:t})}Hu(t){var e;null==(e=this._instance)||null==(e=e.persistence)||e.register({[ss]:t})}Uu(){var t;null==(t=this._instance)||null==(t=t.persistence)||t.unregister(ss)}zu(){return!1}Tu(t,e){var i;return this.bu((t=>{i=t.find((t=>t.id===e))})),!i||_a(i)?t===cf.SHOWN?"consume":"ignore":t===cf.SHOWN?"persist":t===cf.DISMISSED||t===cf.SENT?"consume":"ignore"}getSurveys(){return this.getActivatedIds()}getEventToSurveys(){return this.getEventToItemsMap()}}class ck{constructor(t){this._instance=t}initialize(){}get(t){if("string"==typeof t)return this._instance.get_property(t);var e={};for(var i of t){var r=this._instance.get_property(i);at(r)||(e[i]=r)}return e}set(t,e){this._instance.register("string"==typeof t?{[t]:e}:t)}remove(t){"string"!=typeof t?t.forEach((t=>this._instance.unregister(t))):this._instance.unregister(t)}}class fk{constructor(t){this._instance=t}get(){var t=this._instance.config;return{disableSurveys:t.disable_surveys,cookielessMode:!!t.cookieless_mode,advancedEnableSurveys:t.advanced_enable_surveys,requestTimeoutMs:t.surveys_request_timeout_ms}}isOptedOut(){return this._instance.consent.isOptedOut()}getExtensions(){var t=null==v?void 0:v.__PosthogExtensions__;if(t){var e=t.generateSurveys,i=t.loadExternalDependency;return{generateSurveys:e?t=>e(this._instance,t):void 0,loadExternalDependency:i?t=>i(this._instance,"surveys",t):void 0}}}createEventReceiver(){return new vk(this._instance)}}var pk=null!=t&&t.location?sr(t.location.hash,"__posthog")||sr(location.hash,"state"):null,gk="_postHogToolbarParams",mk=Bi("[Toolbar]"),yk=Bi("[FeatureFlags]");class _k{constructor(t,e){void 0===e&&(e=!1),this.Gu=!1,this.update(t,e)}update(t,e){this.Zu=((t,e)=>{var i,r,n,s;return{bootstrap:{featureFlags:null==(i=t.bootstrap)?void 0:i.featureFlags,featureFlagPayloads:null==(r=t.bootstrap)?void 0:r.featureFlagPayloads},remoteRequestsDisabled:e,featureFlagsDisabled:!!t.advanced_disable_feature_flags,onlyEvaluateSurveyFeatureFlags:!!t.advanced_only_evaluate_survey_feature_flags,deduplicateCallsPerSession:!!t.advanced_feature_flags_dedup_per_session,cacheTtlMs:t.feature_flag_cache_ttl_ms,requestTimeoutMs:t.feature_flag_request_timeout_ms,compression:t.disable_compression?"none":"base64",evaluationContexts:null!==(n=null!==(s=t.evaluation_contexts)&&void 0!==s?s:t.evaluation_environments)&&void 0!==n?n:[],flagKeys:rt(t.flag_keys)?t.flag_keys:void 0}})(t,e),!t.evaluation_environments||t.evaluation_contexts||this.Gu||(yk.warn("evaluation_environments is deprecated. Use evaluation_contexts instead. evaluation_environments will be removed in a future version."),this.Gu=!0),at(t.flag_keys)||rt(t.flag_keys)||yk.error("Invalid flag_keys found:",t.flag_keys,"Expected array of non-empty strings")}get(){return this.Zu}}var bk=Bi("[FeatureFlags]"),wk=Bi("[FeatureFlags]",{debugEnabled:!0}),kk="\" failed. Feature flags didn't load in time.",Sk="connection_error",xk=t=>{for(var e={},i=0;t.length>i;i++)e[t[i]]=!0;return e},Ck=t=>{var e={};for(var i of Wi(t||{})){var r=i[1];r&&(e[i[0]]=r)}return e},Tk="Refusing to render web experiment since the viewer is a likely bot",Ek={icontains:(t,e)=>e.toLowerCase().indexOf(t.toLowerCase())>-1,not_icontains:(t,e)=>-1===e.toLowerCase().indexOf(t.toLowerCase()),regex:(t,e)=>ba(e,t),not_regex:(t,e)=>!ba(e,t),exact:(t,e)=>e===t,is_not:(t,e)=>e!==t};class Mk{get qi(){return this._instance.config}constructor(t){var e=this;this.getWebExperimentsAndEvaluateDisplayLogic=function(t){void 0===t&&(t=!1),e.getWebExperiments((t=>{Mk.Qu("retrieved web experiments from the server"),e.Ju=new Map,t.forEach((t=>{if(t.feature_flag_key){var i;e.Ju&&(Mk.Qu("setting flag key ",t.feature_flag_key," to web experiment ",t),null==(i=e.Ju)||i.set(t.feature_flag_key,t));var r=e._instance.getFeatureFlag(t.feature_flag_key);lt(r)&&t.variants[r]&&e.Ku(t.name,r,t.variants[r].transforms)}else if(t.variants)for(var n in t.variants){var s=t.variants[n];Mk.Yu(s,e._instance)&&e.Ku(t.name,n,s.transforms)}}))}),t)},this._instance=t,this._instance.onFeatureFlags((t=>{this.onFeatureFlags(t)}))}initialize(){}onFeatureFlags(t){if(this._is_bot())Mk.Qu(Tk);else if(!this.qi.disable_web_experiments){if(dt(this.Ju))return this.Ju=new Map,this.loadIfEnabled(),void this.previewWebExperiment();Mk.Qu("applying feature flags",t),t.forEach((t=>{var e;if(this.Ju&&null!=(e=this.Ju)&&e.has(t)){var i,r=this._instance.getFeatureFlag(t),n=null==(i=this.Ju)?void 0:i.get(t);r&&null!=n&&n.variants[r]&&this.Ku(n.name,r,n.variants[r].transforms)}}))}}previewWebExperiment(){var t=Mk.getWindowLocation();if(null!=t&&t.search){var e=rr(null==t?void 0:t.search,"__experiment_id"),i=rr(null==t?void 0:t.search,"__experiment_variant");e&&i&&(Mk.Qu("previewing web experiments "+e+" && "+i),this.getWebExperiments((t=>{this.Xu(parseInt(e),i,t)}),!1,!0))}}loadIfEnabled(){this.qi.disable_web_experiments||this.getWebExperimentsAndEvaluateDisplayLogic()}getWebExperiments(t,e,i){if(this.qi.disable_web_experiments&&!i)return t([]);var r=this._instance.get_property("$web_experiments");if(r&&!e)return t(r);this._instance._send_request({url:this._instance.requestRouter.endpointFor("api","/api/web_experiments/?token="+this.qi.token),method:"GET",timestampMode:"query",callback:e=>t(200===e.statusCode&&e.json&&e.json.experiments||[])})}Xu(t,e,i){var r=i.filter((e=>e.id===t));r&&r.length>0&&(Mk.Qu("Previewing web experiment ["+r[0].name+"] with variant ["+e+"]"),this.Ku(r[0].name,e,r[0].variants[e].transforms))}static Yu(t,e){return!dt(t.conditions)&&Mk.th(t,e)&&Mk.eh(t)}static th(t,e){var i;if(dt(t.conditions)||dt(null==(i=t.conditions)?void 0:i.url))return!0;var r=Mk.getWindowLocation();if(r){var n,s,o,a=lr(e,r.href);return null==(n=t.conditions)||!n.url||Ek[null!==(s=null==(o=t.conditions)?void 0:o.urlMatchType)&&void 0!==s?s:"icontains"](t.conditions.url,a)}return!1}static getWindowLocation(){return null==t?void 0:t.location}static eh(t){var e;if(dt(t.conditions)||dt(null==(e=t.conditions)?void 0:e.utm))return!0;var i=Na();if(i.utm_source){var r,n,s,o,a,l,u,h,d=null==(r=t.conditions)||null==(r=r.utm)||!r.utm_campaign||(null==(n=t.conditions)||null==(n=n.utm)?void 0:n.utm_campaign)==i.utm_campaign,v=null==(s=t.conditions)||null==(s=s.utm)||!s.utm_source||(null==(o=t.conditions)||null==(o=o.utm)?void 0:o.utm_source)==i.utm_source,c=null==(a=t.conditions)||null==(a=a.utm)||!a.utm_medium||(null==(l=t.conditions)||null==(l=l.utm)?void 0:l.utm_medium)==i.utm_medium,f=null==(u=t.conditions)||null==(u=u.utm)||!u.utm_term||(null==(h=t.conditions)||null==(h=h.utm)?void 0:h.utm_term)==i.utm_term;return d&&c&&f&&v}return!1}static Qu(t){for(var e=arguments.length,i=new Array(e>1?e-1:0),r=1;e>r;r++)i[r-1]=arguments[r];ji.info("[WebExperiments] "+t,i)}Ku(t,e,i){this._is_bot()?Mk.Qu(Tk):"control"!==e?i.forEach((i=>{if(i.selector){var r;Mk.Qu("applying transform of variant "+e+" for experiment "+t+" ",i);var n=null==(r=document)?void 0:r.querySelectorAll(i.selector);null==n||n.forEach((t=>{var e=t;i.html&&(e.innerHTML=i.html),i.css&&e.setAttribute("style",i.css)}))}})):Mk.Qu("Control variants leave the page unmodified.")}_is_bot(){return i&&this._instance?cw(i,this.qi.custom_blocked_useragents):void 0}}var Ik=Bi("[Conversations]"),Rk="Conversations not available yet.",Pk="console",Ak="__posthogHandledLogsRequestError",Ok=(t,e)=>{var i=t instanceof Error?t:new Error(e);return i[Ak]=!0,i},Fk=t=>!!t&&"object"==typeof t&&!0===t[Ak],Lk={featureFlags:class{constructor(t){this.name="featureFlags",this.ih=!1,this.featureFlagEventHandlers=[],this.I=bk,this.rh={},this.nh={},this.sh=[],this.ah=!1,this.oh=!1,this.lh=0,this.uh=!1,this.hh=!1,this.dh=!1,this.fh=!1,this.ph=0,this.Tt=()=>{var t=this.gh();this.ph=0,t&&this.reloadFeatureFlags()},"get"in t?this.ts=t:(this.mh=new _k(t.config,t.ma()),this.ts=this.mh)}updateConfig(t,e){var i;null==(i=this.mh)||i.update(t,e)}setup(t){return this.Fl=t,this.I=t.logger.createLogger("[FeatureFlags]"),sk(t.kv.initialize(),(()=>{this.Fl===t&&(this.Fl=void 0,this.ns=t,this.yh(t))}))}yh(e){if(this.ns===e)return t&&Ki(t,"online",this.Tt),this.bh=e.registerDynamicEventProperties((()=>this._h()?this.rh:this.nh)),this.wh(),this.initialize()}destroy(){null==t||t.removeEventListener("online",this.Tt)}dispose(){var e;this.lh++,this.hh=!1,this.Fl=void 0,this.ns&&(this.kh(),null==(e=this.bh)||e.dispose(),this.bh=void 0,this.sh=[],null==t||t.removeEventListener("online",this.Tt),this.ns=void 0)}get qi(){return this.ts.get()}Sh(t){var e;return null==(e=this.ns)?void 0:e.kv.get(t)}Dr(t){this.xh((()=>{var e;return null==(e=this.ns)?void 0:e.kv.set(t)}))}qr(t){this.xh((()=>{var e;return null==(e=this.ns)?void 0:e.kv.remove(t)}))}xh(t){try{t()}catch(t){this.I.error("Failed to update feature flag persistence",t)}}wh(){var t={};for(var e of[Wn,Zn,Qn,Kn]){var i=this.Sh(e);at(i)||(t[e]=i)}this.rh=t;var r=p({},t),n=this.Sh(zn);if(n)for(var s of Object.entries(n))r["$feature/"+s[0]]=s[1];this.nh=r}_h(){var t=this.qi.cacheTtlMs;if(!t||0>=t)return!1;var e=this.Sh(ds);return"number"!=typeof e||Date.now()-e>t}Ch(){return!!this._h()&&(this.fh||this.oh||(this.fh=!0,this.I.warn("Feature flag cache is stale, triggering refresh..."),this.reloadFeatureFlags()),!0)}Th(){var t=this.qi.evaluationContexts;return null!=t&&t.length?t.filter((t=>{var e=t&&"string"==typeof t&&t.trim().length>0;return e||this.I.error("Invalid evaluation context found:",t,"Expected non-empty string"),e})):[]}Mh(){var t=this.qi.flagKeys;if(!at(t))return t.filter((t=>{var e=t&&"string"==typeof t&&t.trim().length>0;return e||this.I.error("Invalid flag key found:",t,"Expected non-empty string"),e}))}initialize(){var t,e,i=this.qi,r=null!==(t=null==(e=i.bootstrap)?void 0:e.featureFlags)&&void 0!==t?t:{};if(Object.keys(r).length){var n,s,o=null!==(n=null==(s=i.bootstrap)?void 0:s.featureFlagPayloads)&&void 0!==n?n:{},a=Object.keys(r).filter((t=>!!r[t])).reduce(((t,e)=>(t[e]=r[e]||!1,t)),{}),l=Object.keys(o).filter((t=>a[t])).reduce(((t,e)=>(t[e]=o[e],t)),{});return this.Eh({featureFlags:a,featureFlagPayloads:l})}}updateFlags(t,e,i){var r,n,s=null!=i&&i.merge&&null!==(r=this.Sh(zn))&&void 0!==r?r:{},o=null!=i&&i.merge&&null!==(n=this.Sh(Zn))&&void 0!==n?n:{},a=p({},s,t),l=p({},o,e),u={};for(var h of Object.entries(a)){var d=h[0],v=h[1];u[d]={key:d,enabled:b(v),variant:w(v),reason:void 0,metadata:at(null==l?void 0:l[d])?void 0:{id:0,version:void 0,description:void 0,payload:l[d]}}}this.Eh({flags:u})}get hasLoadedFlags(){return this.ah}getFlags(){return Object.keys(this.getFlagVariants())}getFlagsWithDetails(){var t=this.Sh(Gn),e=this.Sh(Kn),i=this.Sh(Yn);if(!i&&!e)return t||{};var r=zi({},t||{}),n=[...new Set([...Object.keys(i||{}),...Object.keys(e||{})])];for(var s of n){var o,a,l=r[s],u=null==e?void 0:e[s],h=at(u)?null!==(o=null==l?void 0:l.enabled)&&void 0!==o&&o:!!u,d=at(u)?null==l?void 0:l.variant:"string"==typeof u?u:void 0,v=null==i?void 0:i[s],c=p({},l,{enabled:h,variant:h?null!=d?d:null==l?void 0:l.variant:void 0});h!==(null==l?void 0:l.enabled)&&(c.original_enabled=null==l?void 0:l.enabled),d!==(null==l?void 0:l.variant)&&(c.original_variant=null==l?void 0:l.variant),v&&(c.metadata=p({},null==l?void 0:l.metadata,{payload:v,original_payload:null==l||null==(a=l.metadata)?void 0:a.payload})),r[s]=c}return this.ih||(this.I.warn(" Overriding feature flag details!",{flagDetails:t,overriddenPayloads:i,finalDetails:r}),this.ih=!0),r}getAllFeatureFlags(){var t=this.getFlagVariants(),e=this.getFlagPayloads();return Object.keys(t).map((i=>{var r=t[i];return{key:i,enabled:b(r),variant:w(r),payload:_(e[i])}}))}getFlagVariants(){var t=this.Sh(zn),e=this.Sh(Kn);if(!e)return t||{};for(var i=zi({},t||{}),r=Object.keys(e),n=0;r.length>n;n++)i[r[n]]=e[r[n]];return this.ih||(this.I.warn(" Overriding feature flags!",{enabledFlags:t,overriddenFlags:e,finalFlags:i}),this.ih=!0),i}getFlagPayloads(){var t=this.Sh(Zn),e=this.Sh(Yn);if(!e)return t||{};for(var i=zi({},t||{}),r=Object.keys(e),n=0;r.length>n;n++)i[r[n]]=e[r[n]];return this.ih||(this.I.warn(" Overriding feature flag payloads!",{flagPayloads:t,overriddenPayloads:e,finalPayloads:i}),this.ih=!0),i}reloadFeatureFlags(){this.uh||this.qi.featureFlagsDisabled||this.gh()||this.Ih||(this.sh.slice().forEach((t=>{try{t()}catch(t){this.I.error("Error while running feature flags reloading callback",t)}})),this.Ih=setTimeout((()=>{this.Rh()}),5))}kh(){clearTimeout(this.Ih),this.Ih=void 0}onReloading(t){return this.sh.push(t),()=>{this.sh=this.sh.filter((e=>e!==t))}}ensureFlagsLoaded(){this.ah||this.oh||this.Ih||this.reloadFeatureFlags()}setAnonymousDistinctId(t){this.$anon_distinct_id=t}setReloadingPaused(t){this.uh=t}resetFlagCallReported(){this.qr(ls)}Rh(t){this.kh();var e=this.ns;if(e&&!this.qi.remoteRequestsDisabled&&!this.gh())if(this.oh)this.hh=!0;else{var i={token:e.projectToken,distinct_id:e.distinctId,groups:e.groups,$anon_distinct_id:this.$anon_distinct_id,person_properties:p({},e.initialPersonProperties,this.Sh(Xn)||{},{$lib:e.library.name,$lib_version:e.library.version}),group_properties:this.Sh(ts),timezone:Va()};at(e.deviceId)||(i.$device_id=e.deviceId),(null!=t&&t.disableFlags||this.qi.featureFlagsDisabled)&&(i.disable_flags=!0);var r=this.Th();r.length&&(i.evaluation_contexts=r);var n=this.Mh();at(n)||(i.flag_keys=n);var s=this.qi.onlyEvaluateSurveyFeatureFlags,o="/flags/?v=2"+(s?"&only_evaluate_survey_feature_flags=true":""),a=this.lh;this.oh=!0;var l=()=>{this.hh&&(this.hh=!1,this.Rh())},u=t=>{this.oh=!1,a===this.lh?(this.Dr({[hs]:[Sk]}),this.I.error("Feature flag request failed",t),l()):l()};try{e.sendRequest(o,{target:"flags",method:"POST",body:i,compression:"base64"===this.qi.compression?nf.Base64:void 0,sentAt:"body",timeoutMs:this.qi.requestTimeoutMs}).then((t=>{var e,r,n=null!==(e=t.json)&&void 0!==e?e:{},o=200!==t.statusCode;if(this.oh=!1,a===this.lh){if(this.Ph(t.statusCode),o||this.hh||(this.$anon_distinct_id=void 0),!i.disable_flags||this.hh){this.dh=!o;var u=[];t.error?u.push(t.error instanceof Error&&"AbortError"===t.error.name?"timeout":t.error instanceof Error?Sk:"unknown_error"):200!==t.statusCode&&u.push("api_error_"+t.statusCode),n.errorsWhileComputingFlags&&u.push("errors_while_computing_flags");var h=!(null==(r=n.quotaLimited)||!r.includes("feature_flags"));h&&u.push("quota_limited"),this.Dr({[hs]: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.Eh(n,o,{partialResponse:s}),l()}}else l()})).catch(u)}catch(t){u(t)}}}gh(){return or(this.ph,3)}Ph(t){this.ph=ar(t,this.ph,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(t,e){var i;if(void 0===e&&(e={}),!e.fresh||this.dh)if(this.ah||this.getFlags()&&this.getFlags().length>0){if(!this.Ch()){var r=this.getFeatureFlagResult(t,e);return null!==(i=null==r?void 0:r.variant)&&void 0!==i?i:null==r?void 0:r.enabled}}else this.I.warn('getFeatureFlag for key "'+t+kk)}getFeatureFlagDetails(t){return this.getFlagsWithDetails()[t]}getFeatureFlagPayload(t){var e=this.getFeatureFlagResult(t,{send_event:!1});return null==e?void 0:e.payload}getFeatureFlagResult(t,e){if(void 0===e&&(e={}),!e.fresh||this.dh)if(this.ah||this.getFlags()&&this.getFlags().length>0){if(!this.Ch()){var i,r=this.getFlagVariants(),n=t in r,s=r[t],o=this.getFlagPayloads()[t],a=String(s),l=this.Sh(Qn)||void 0,u=this.Sh(ds)||void 0,h=this.Sh(ls)||{};if(this.qi.deduplicateCallsPerSession){var d,v=null==(d=this.ns)?void 0:d.session.sessionId,c=this.Sh(us);v&&v!==c&&(h={},i=v)}if(e.send_event||!("send_event"in e))if(t in h&&h[t].includes(a))i&&this.Dr({[ls]:h,[us]:i});else{var f,g,m,y,b,w,k,S,x,C,T,E;rt(h[t])?h[t].push(a):h[t]=[a],this.Dr(p({[ls]:h},i?{[us]:i}:{}));var M=this.getFeatureFlagDetails(t),I=[...null!==(f=this.Sh(hs))&&void 0!==f?f:[]];at(s)&&I.push("flag_missing");var R={$feature_flag:t,$feature_flag_response:s,$feature_flag_payload:null!=o?o:null,$feature_flag_request_id:l,$feature_flag_evaluated_at:u,$feature_flag_bootstrapped_response:null!==(g=null==(m=this.qi.bootstrap)||null==(m=m.featureFlags)?void 0:m[t])&&void 0!==g?g:null,$feature_flag_bootstrapped_payload:null!==(y=null==(b=this.qi.bootstrap)||null==(b=b.featureFlagPayloads)?void 0:b[t])&&void 0!==y?y:null,$used_bootstrap_value:!this.dh};at(null==M||null==(w=M.metadata)?void 0:w.has_experiment)||(R.$feature_flag_has_experiment=M.metadata.has_experiment),at(null==M||null==(k=M.metadata)?void 0:k.version)||(R.$feature_flag_version=M.metadata.version);var P,A=null!==(S=null==M||null==(x=M.reason)?void 0:x.description)&&void 0!==S?S:null==M||null==(C=M.reason)?void 0:C.code;A&&(R.$feature_flag_reason=A),null!=M&&null!=(T=M.metadata)&&T.id&&(R.$feature_flag_id=M.metadata.id),at(null==M?void 0:M.original_variant)&&at(null==M?void 0:M.original_enabled)||(R.$feature_flag_original_response=at(M.original_variant)?M.original_enabled:M.original_variant),null!=M&&null!=(E=M.metadata)&&E.original_payload&&(R.$feature_flag_original_payload=null==M||null==(P=M.metadata)?void 0:P.original_payload),I.length&&(R.$feature_flag_error=I.join(",")),this.Ah(R)}else i&&this.Dr({[ls]:h,[us]:i});if(n)return{key:t,enabled:!!s,variant:"string"==typeof s?s:void 0,payload:_(o)}}}else this.I.warn('getFeatureFlagResult for key "'+t+kk)}Ah(t){try{var e;null==(e=this.ns)||e.capture("$feature_flag_called",t).catch((t=>{this.I.error("Failed to capture feature flag call",t)}))}catch(t){this.I.error("Failed to capture feature flag call",t)}}getRemoteConfigPayload(t,e){this.Fh(t,e)}Fh(t,e){var i=this;return f((function*(){var r=i.ns;if(r){var n={distinct_id:r.distinctId,token:r.projectToken,person_properties:{$lib:r.library.name,$lib_version:r.library.version}},s=i.Th();s.length&&(n.evaluation_contexts=s);var o,a=i.Mh();at(a)||(n.flag_keys=a);try{var l,u=null==(l=(yield r.sendRequest("/flags/?v=2",{target:"flags",method:"POST",body:n,compression:"base64"===i.qi.compression?nf.Base64:void 0,sentAt:"body",timeoutMs:i.qi.requestTimeoutMs})).json)?void 0:l.featureFlagPayloads;o=(null==u?void 0:u[t])||void 0}catch(t){return void i.I.error("Remote config feature flag request failed",t)}try{e(o)}catch(t){i.I.error("Remote config feature flag callback failed",t)}}}))()}isFeatureEnabled(t,e){if(void 0===e&&(e={}),e.fresh&&!this.dh)return e.defaultValue;if(!(this.ah||this.getFlags()&&this.getFlags().length>0))return this.I.warn('isFeatureEnabled for key "'+t+kk),e.defaultValue;var i=this.getFeatureFlag(t,e);return at(i)?e.defaultValue:!!i}addFeatureFlagsHandler(t){this.featureFlagEventHandlers.push(t)}removeFeatureFlagsHandler(t){this.featureFlagEventHandlers=this.featureFlagEventHandlers.filter((e=>e!==t))}receivedFeatureFlags(t,e,i){this.Eh(t,e,i)}Eh(t,e,i){if(this.ns){this.ah=!0;var r=function(t,e,i,r,n,s){void 0===e&&(e={}),void 0===i&&(i={}),void 0===r&&(r={}),void 0===s&&(s=bk);var o=((t,e)=>{var i=t.flags;return i?p({},t,{featureFlags:Object.fromEntries(Object.keys(i).map((t=>{var e;return[t,null!==(e=i[t].variant)&&void 0!==e?e:i[t].enabled]}))),featureFlagPayloads:Object.fromEntries(Object.keys(i).filter((t=>i[t].enabled)).filter((t=>{var e;return null==(e=i[t].metadata)?void 0:e.payload})).map((t=>{var e;return[t,null==(e=i[t].metadata)?void 0:e.payload]})))}):(t.featureFlags&&e.warn("Using an older version of the feature flags endpoint. Please upgrade your PostHog server to the latest version"),t)})(t,s),a=o.flags,l=o.featureFlags,u=o.featureFlagPayloads;if(l){var h=t.requestId,d=t.evaluatedAt;if(rt(l)){s.warn("v1 of the feature flags endpoint is deprecated. Please use the latest version.");var v={};if(l)for(var c=0;l.length>c;c++)v[l[c]]=!0;return{[Wn]:l,[zn]:v,[Jn]:!1}}var f=l,g=u,m=a;if(null!=n&&n.partialResponse)f=p({},e,f),g=p({},i,g),m=p({},r,m);else if(t.errorsWhileComputingFlags)if(a){var y=new Set(Object.keys(a).filter((t=>{var e;return!(null!=(e=a[t])&&e.failed)})));f=p({},e,Object.fromEntries(Object.entries(f).filter((t=>y.has(t[0]))))),g=p({},i,Object.fromEntries(Object.entries(g||{}).filter((t=>y.has(t[0]))))),m=p({},r,Object.fromEntries(Object.entries(m||{}).filter((t=>y.has(t[0])))))}else f=p({},e,f),g=p({},i,g),m=p({},r,m);return p({[Wn]:Object.keys(Ck(f)),[zn]:f||{},[Zn]:g||{},[Gn]:m||{},[Jn]:!0===t.minimalFlagCalledEvents},h?{[Qn]:h}:{},d?{[ds]:d}:{})}}(t,this.getFlagVariants(),this.getFlagPayloads(),this.getFlagsWithDetails(),i,this.I);r&&this.Dr(r),e||(this.fh=!1),this.Lh(e)}}override(t,e){void 0===e&&(e=!1),this.I.warn("override is deprecated. Please use overrideFeatureFlags instead."),this.overrideFeatureFlags({flags:t,suppressWarning:e})}overrideFeatureFlags(t){this.Oh(t)}Oh(t){if(this.ns){if(!1===t)return this.qr([Kn,Yn]),this.Lh(),void wk.info("All overrides cleared");if(rt(t))return this.Dr({[Kn]:xk(t)}),this.Lh(),void wk.info("Flag overrides set",{flags:t});if(t&&"object"==typeof t&&("flags"in t||"payloads"in t)){var e,i=t;this.ih=Boolean(null!==(e=i.suppressWarning)&&void 0!==e&&e);var r={},n=i.flags,s=i.payloads;return n&&(r[Kn]=rt(n)?xk(n):n),s&&(r[Yn]=s),Object.keys(r).length&&this.Dr(r),!1===n&&!1===s?this.qr([Kn,Yn]):!1===n?this.qr(Kn):!1===s&&this.qr(Yn),this.Lh(),!1===n?wk.info("Flag overrides cleared"):n&&wk.info("Flag overrides set",{flags:n}),void(!1===s?wk.info("Payload overrides cleared"):s&&wk.info("Payload overrides set",{payloads:s}))}if(t&&"object"==typeof t)return this.Dr({[Kn]:t}),this.Lh(),void wk.info("Flag overrides set",{flags:t});this.I.warn("Invalid overrideOptions provided to overrideFeatureFlags",{overrideOptions:t})}else this.I.warn("posthog.featureFlags.overrideFeatureFlags called before feature flags were ready")}onFeatureFlags(t){if(this.addFeatureFlagsHandler(t),this.ah){var e=this.Dh(),i=e.flags,r=e.flagVariants;try{t(i,r)}catch(t){this.I.error("Error while running feature flags callback",t)}}return()=>this.removeFeatureFlagsHandler(t)}updateEarlyAccessFeatureEnrollment(t,e,i){var r=(this.Sh(Vn)||[]).find((e=>e.flagKey===t)),n={["$feature_enrollment/"+t]:e},s={$feature_flag:t,$feature_enrollment:e,$set:n};r&&(s.$early_access_feature_name=r.name),i&&(s.$feature_enrollment_stage=i);var o=p({},this.getFlagVariants(),{[t]:e});this.Dr({[Wn]:Object.keys(Ck(o)),[zn]:o,[Xn]:p({},this.Sh(Xn)||{},n)}),this.Lh();try{var a;null==(a=this.ns)||a.capture("$feature_enrollment_update",s).catch((t=>{this.I.error("Failed to capture early access feature enrollment",t)}))}catch(t){this.I.error("Failed to capture early access feature enrollment",t)}}getEarlyAccessFeatures(t,e,i){void 0===e&&(e=!1);var r=this.Sh(Vn);!r||e?this.$h(t,i):t(r)}$h(t,e){var i=this;return f((function*(){var r=i.ns;if(r){var n,s=e?"&"+e.map((t=>"stage="+t)).join("&"):"";try{var o=yield r.sendRequest("/api/early_access_features/?token="+r.projectToken+s,{target:"api",method:"GET",sentAt:"query"});if(!o.json)return;i.Dr({[Vn]:n=o.json.earlyAccessFeatures})}catch(t){return void i.I.error("Early access feature request failed",t)}try{t(n)}catch(t){i.I.error("Early access feature callback failed",t)}}}))()}Dh(){var t=this.getFlags(),e=this.getFlagVariants();return{flags:t.filter((t=>e[t])),flagVariants:Object.keys(e).filter((t=>e[t])).reduce(((t,i)=>(t[i]=e[i],t)),{})}}Lh(t){this.wh();var e=this.Dh(),i=e.flags,r=e.flagVariants;this.featureFlagEventHandlers.forEach((e=>{try{e(i,r,{errorsLoading:t})}catch(t){this.I.error("Error while running feature flags callback",t)}}))}setPersonPropertiesForFlags(t,e){void 0===e&&(e=!0),this.Nh(t,e)}Nh(t,e){void 0===e&&(e=!0);var i=this.Sh(Xn)||{},r=(null==t?void 0:t.$set)||(null!=t&&t.$set_once?{}:t),n=null==t?void 0:t.$set_once,s={};if(n)for(var o in n)({}).hasOwnProperty.call(n,o)&&(o in i||(s[o]=n[o]));this.Dr({[Xn]:p({},i,s,r)}),e&&this.reloadFeatureFlags()}unsetPersonPropertiesForFlags(t,e){void 0===e&&(e=!0);var i=p({},this.Sh(Xn)||{});t.forEach((t=>{delete i[t]})),this.Dr({[Xn]:i}),e&&this.reloadFeatureFlags()}resetPersonPropertiesForFlags(t){void 0===t&&(t=!0),this.qr(Xn),t&&this.reloadFeatureFlags()}setGroupPropertiesForFlags(t,e){void 0===e&&(e=!0);var i=this.Sh(ts)||{},r=p({},i);for(var n of Object.keys(t))r[n]=p({},i[n],t[n]);this.Dr({[ts]:r}),e&&this.reloadFeatureFlags()}resetGroupPropertiesForFlags(t){if(t){var e=this.Sh(ts)||{};this.Dr({[ts]:p({},e,{[t]:{}})})}else this.qr(ts)}reset(){this.lh++,this.hh=!1,this.rh={},this.nh={},this.ah=!1,this.uh=!1,this.dh=!1,this.$anon_distinct_id=void 0,this.kh(),this.ih=!1,this.ph=0}}},$k={sessionRecording:class{get qi(){return this._instance.config}get za(){return this._instance.persistence}get started(){var t;return!(null==(t=this.qh)||!t.isStarted)}get status(){var t,e;return this.jh===Js||this.jh===Ks?this.jh:null!==(t=null==(e=this.qh)?void 0:e.status)&&void 0!==t?t:this.jh}constructor(e){if(this._forceAllowLocalhostNetworkCapture=!1,this.jh=zs,this.Bh=void 0,this.Hh=!1,this.kt=(()=>{var e;if(null==r||!r.visibilityState||"visible"===r.visibilityState)return!0;var i=null==t||null==(e=t.performance)||null==e.getEntriesByType?void 0:e.getEntriesByType("visibility-state");return!(null!=i&&i.length)||i.some((t=>"visible"===t.name))})(),this.It=()=>{var t;"visible"===(null==r?void 0:r.visibilityState)&&(this.kt=!0,null==(t=this.qh)||null==t.setDocumentWasEverVisible||t.setDocumentWasEverVisible(!0))},this._instance=e,!this._instance.sessionManager)throw Kw.error("started without valid sessionManager"),new Error(Jw+" started without valid sessionManager. This is a bug.");if(this.qi.cookieless_mode===Fs)throw new Error(Jw+' cannot be used with cookieless_mode="always"');null!=r&&r.addEventListener&&Ki(r,"visibilitychange",this.It)}initialize(){this.startIfEnabledOrStop()}dispose(){this.Hh=!0,null==r||null==r.removeEventListener||r.removeEventListener("visibilitychange",this.It),this.stopRecording()}get Uh(){var e,i=!(null==(e=this._instance.get_property(Mn))||!e.enabled),r=!this.qi.disable_session_recording,n=this.qi.disable_session_recording||this._instance.consent.isOptedOut();return t&&i&&r&&!n}startIfEnabledOrStop(t){var e;if(!(this.Hh||this.Uh&&null!=(e=this.qh)&&e.isStarted)){var i=!at(Object.assign)&&!at(Array.from);this.Uh&&i?(this.zh(t),Kw.info("starting")):(this.jh=zs,this.stopRecording())}}zh(t){var e,i,r;this.Uh&&(this.jh!==Js&&this.jh!==Ks&&(this.jh=Qs),null!=v&&null!=(e=v.__PosthogExtensions__)&&null!=(e=e.rrweb)&&e.record&&null!=(i=v.__PosthogExtensions__)&&i.initSessionRecording?this.Wh(t):null==(r=v.__PosthogExtensions__)||null==r.loadExternalDependency||r.loadExternalDependency(this._instance,this.Vh,(e=>{if(e)return this._instance.register_for_session({[Ss]:!0}),Kw.error("could not load recorder",e);this.Wh(t)})))}stopRecording(){var t,e;null==(t=this.Bh)||t.call(this),this.Bh=void 0,null==(e=this.qh)||e.stop()}Gh(){var t,e;null==(t=this.Bh)||t.call(this),this.Bh=void 0,null==(e=this.qh)||e.discard()}Zh(){var t,e;null==(t=this.za)||t.unregister(Ln),null==(e=this.za)||e.unregister(In)}Qh(t,e){if(dt(t))return null;var i,r=vt(t)?t:parseFloat(t);return"number"!=typeof(i=r)||!Number.isFinite(i)||0>i||i>1?(Kw.warn(e+" must be between 0 and 1. Ignoring invalid value:",t),null):r}Jh(t){if(this.za){var e,i,r=this.za,n=()=>{var e,i=!1===t.sessionRecording?void 0:t.sessionRecording,n=this.Qh(null==(e=this.qi.session_recording)?void 0:e.sampleRate,"session_recording.sampleRate"),s=this.Qh(null==i?void 0:i.sampleRate,"remote config sampleRate"),o=null!=n?n:s;dt(o)&&this.Zh();var a=null==i?void 0:i.minimumDurationMilliseconds;r.register({[Mn]:p({cache_timestamp:Date.now(),enabled:!!i},i,{networkPayloadCapture:p({capturePerformance:t.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:at(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})})};n(),null==(e=this.Bh)||e.call(this),this.Bh=null==(i=this._instance.sessionManager)?void 0:i.onSessionId(n)}}onRemoteConfig(t){var e=t.ok?t.config:void 0;return e&&"sessionRecording"in e?!1===e.sessionRecording?(this.Jh(e),void this.Gh()):(this.Jh(e),void this.startIfEnabledOrStop()):(this.jh===Js&&(this.jh=Ks,Kw.warn("config refresh failed, recording will not start until page reload")),void this.startIfEnabledOrStop())}log(t,e){var i;void 0===e&&(e="log"),null!=(i=this.qh)&&i.log?this.qh.log(t,e):Kw.warn("log called before recorder was ready")}get Vh(){var t,e,i=null==(t=this._instance)||null==(t=t.persistence)?void 0:t.get_property(Mn);return(null==i||null==(e=i.scriptConfig)?void 0:e.script)||"lazy-recorder"}Kh(){var t,e=this._instance.get_property(Mn);if(!e)return!1;try{t="object"==typeof e?e:JSON.parse(e)}catch(t){return Kw.warn("persisted remote config for session recording is invalid and will be ignored",t),!1}return!dt(t.cache_timestamp)&&Date.now()-t.cache_timestamp<=Ya}Wh(t){var e,i,r;if(!this.Hh){if(null==(e=v.__PosthogExtensions__)||!e.initSessionRecording)return Kw.warn("Called on script loaded before session recording is available. This can be caused by adblockers."),void this._instance.register_for_session({[Ss]:!0});var n;if(this.qh||(this.qh=null==(n=v.__PosthogExtensions__)?void 0:n.initSessionRecording(this._instance,this.kt),this.qh._forceAllowLocalhostNetworkCapture=this._forceAllowLocalhostNetworkCapture),!this.Kh()){if(this.jh===Ks||this.jh===Js)return;return this.jh=Js,Kw.info("persisted remote config is stale, requesting fresh config before starting"),void new qb(this._instance).load()}this.jh=Qs,null==(i=(r=this.qh).setDocumentWasEverVisible)||i.call(r,this.kt),this.qh.start(t)}}onRRwebEmit(t){var e;null==(e=this.qh)||null==e.onRRwebEmit||e.onRRwebEmit(t)}overrideLinkedFlag(){var t,e;this.qh||null==(e=this.za)||e.register({[Pn]:!0}),null==(t=this.qh)||t.overrideLinkedFlag()}overrideSampling(){var t,e;this.qh||null==(e=this.za)||e.register({[Rn]:!0}),null==(t=this.qh)||t.overrideSampling()}overrideTrigger(t){var e,i;this.qh||null==(i=this.za)||i.register({["url"===t?An:On]:!0}),null==(e=this.qh)||e.overrideTrigger(t)}get sdkDebugProperties(){var t;return(null==(t=this.qh)?void 0:t.sdkDebugProperties)||{$recording_status:this.status}}tryAddCustomEvent(t,e){var i;return!(null==(i=this.qh)||!i.tryAddCustomEvent(t,e))}}},Dk={autocapture:class extends J_{constructor(t){super(new Uw(t)),this.instance=t}},historyAutocapture:class{constructor(t){this._instance=t,this.Yh=this.Xh()}initialize(){this.startIfEnabled()}get isEnabled(){var t=this.td();return!!(t.path||t.search||this.ed(t))}startIfEnabled(){this.isEnabled&&(ji.info("History API monitoring enabled, starting..."),this.monitorHistoryChanges())}startIfEnabledOrStop(){this.stop(),this.Yh=this.Xh(),this.startIfEnabled()}stop(){this.rd&&this.rd(),this.rd=void 0,this.nd&&this.nd(),this.nd=void 0,ji.info("History API monitoring stopped")}monitorHistoryChanges(){t&&t.history&&(this.sd("pushState"),this.sd("replaceState"),this.ad(),this.ed()&&this.od())}sd(e){var i;if(t&&(null==(i=t.history[e])||!i.__posthog_wrapped__)){var r=this;cv(t.history,e,(t=>function(i,n,s){t.call(this,i,n,s),r.ld(e)}))}}Xh(){var e=null==t?void 0:t.location;if(null!=e&&e.pathname)return{pathname:e.pathname,search:e.search,hash:e.hash}}td(){var t=this._instance.config.capture_pageview;return"history_change"===t?{path:!0}:st(t)?t:{}}ed(t){return void 0===t&&(t=this.td()),!!t.hash&&!this._instance.config.disable_capture_url_hashes}ud(t){var e=this.td(),i=this.Yh;return!(!i||!(e.path&&t.pathname!==i.pathname||e.search&&t.search!==i.search||this.ed(e)&&t.hash!==i.hash))}ld(t){try{var e=this.Xh();if(!e)return;this.ud(e)&&this._instance.capture(js,{navigation_type:t}),this.Yh=e}catch(e){ji.error("Error capturing "+t+" pageview",e)}}ad(){if(!this.rd){var e=()=>{this.ld("popstate")};Ki(t,"popstate",e),this.rd=()=>{t&&t.removeEventListener("popstate",e)}}}od(){if(!this.nd){var e=()=>{this.ld("hashchange")};Ki(t,"hashchange",e),this.nd=()=>{t&&t.removeEventListener("hashchange",e)}}}},heatmaps:class{get qi(){return this.instance.config}constructor(t){var e;this.hd=!1,this.Qn=!1,this.dd=null,this.instance=t,this.hd=!(null==(e=this.instance.persistence)||!e.props[bn]),this.rageclicks=new z_(t.config.rageclick)}initialize(){this.startIfEnabled()}get flushIntervalMilliseconds(){var t=5e3;return st(this.qi.capture_heatmaps)&&this.qi.capture_heatmaps.flush_interval_milliseconds&&(t=this.qi.capture_heatmaps.flush_interval_milliseconds),t}get isEnabled(){return dt(this.qi.capture_heatmaps)?dt(this.qi.enable_heatmaps)?this.hd:this.qi.enable_heatmaps:!1!==this.qi.capture_heatmaps}startIfEnabled(){if(this.isEnabled){if(this.Qn)return;Yw.info("starting..."),this.vd(),this.It()}else{var t;clearInterval(null!==(t=this.dd)&&void 0!==t?t:void 0),this.fd(),this.getAndClearBuffer()}}onRemoteConfig(t){if(t.ok){var e=t.config;if("heatmaps"in e){var i=!!e.heatmaps;this.instance.persistence&&this.instance.persistence.register({[bn]:i}),this.hd=i,this.startIfEnabled()}}}getAndClearBuffer(){var t=this.ft;return this.ft=void 0,t}pd(t){Xw(t.originalEvent)&&this.ki(t.originalEvent,"deadclick")}It(){this.dd&&clearInterval(this.dd),this.dd="visible"===(null==r?void 0:r.visibilityState)?setInterval(this.La.bind(this),this.flushIntervalMilliseconds):null}vd(){t&&r&&(this.gd=this.La.bind(this),Ki(t,qs,this.gd),this.md=e=>this.ki(e||(null==t?void 0:t.event)),Ki(r,"click",this.md,{capture:!0}),this.yd=e=>this.bd(e||(null==t?void 0:t.event)),Ki(r,"mousemove",this.yd,{capture:!0}),this._d=new mb(this.instance,pb,this.pd.bind(this)),this._d.startIfEnabledOrStop(),this.wd=this.It.bind(this),Ki(r,Ns,this.wd),this.Qn=!0)}fd(){var e;t&&r&&(this.gd&&t.removeEventListener(qs,this.gd),this.md&&r.removeEventListener("click",this.md,{capture:!0}),this.yd&&r.removeEventListener("mousemove",this.yd,{capture:!0}),this.wd&&r.removeEventListener(Ns,this.wd),clearTimeout(this.kd),null==(e=this._d)||e.stop(),this.Qn=!1)}Sd(e,i){var r=this.instance.scrollManager.scrollY(),n=this.instance.scrollManager.scrollX(),s=this.instance.scrollManager.scrollElement(),o=function(e,i,r){for(var n=e;n&&pr(n)&&!gr(n,"body");){if(n===r)return!1;var s=void 0;try{var o,a,l;s=null==(o=null!==(a=null==(l=n.ownerDocument)?void 0:l.defaultView)&&void 0!==a?a:t)?void 0:o.getComputedStyle(n).position}catch(t){return!1}if(J(i,s))return!0;n=Mr(n)}return!1}(Cr(e),["fixed","sticky"],s);return{x:e.clientX+(o?0:n),y:e.clientY+(o?0:r),target_fixed:o,type:i}}ki(t,e){var i;if(void 0===e&&(e="click"),!fr(t.target)&&Xw(t)){var r=this.Sd(t,e);null!=(i=this.rageclicks)&&i.isRageClick(t.clientX,t.clientY,(new Date).getTime())&&$r(Cr(t),this.instance.config.rageclick)&&this.Nn(p({},r,{type:"rageclick"})),this.Nn(r)}}bd(t){!fr(t.target)&&Xw(t)&&(clearTimeout(this.kd),this.kd=setTimeout((()=>{this.Nn(this.Sd(t,"mousemove"))}),500))}Nn(e){if(t){var i=this.qi.disable_capture_url_hashes?Le(t.location.href):t.location.href,r=this.qi.custom_personal_data_properties,n=this.qi.mask_personal_data_properties?[...Fa,...r||[]]:[],s=nr(i,n,$a);this.ft=this.ft||{},this.ft[s]||(this.ft[s]=[]),this.ft[s].push(e)}}La(){this.ft&&!ot(this.ft)&&this.instance.capture("$$heatmap",{$heatmap_data:this.getAndClearBuffer()})}},deadClicksAutocapture:mb,webVitalsAutocapture:class{constructor(t){var e;this.hd=!1,this.Qn=!1,this.ft={navigationKey:void 0,url:void 0,metrics:[],firstMetricTimestamp:void 0},this.xd=()=>{clearTimeout(this.Cd),this.Cd=void 0,0!==this.ft.metrics.length&&(this._instance.capture("$web_vitals",p({$current_url:this.ft.url},this.ft.metrics.reduce(((t,e)=>p({},t,{["$web_vitals_"+e.name+"_event"]:p({},e),["$web_vitals_"+e.name+"_value"]:e.value})),{}))),this.ft={navigationKey:void 0,url:void 0,metrics:[],firstMetricTimestamp:void 0})},this.Td=t=>{var e;if(this.ft=this.ft||{navigationKey:void 0,url:void 0,metrics:[],firstMetricTimestamp:void 0},dt(null==t?void 0:t.name)||dt(null==t?void 0:t.value))Ww.error("Invalid metric received",t);else{var i="string"==typeof t.navigationURL?t.navigationURL:void 0,r=this.Md(i);if(!at(r)){var n=vt(t.navigationId)||"string"==typeof t.navigationId?"navigation:"+t.navigationId:"url:"+r;if(!this.Ed||this.Ed>t.value){this.ft.navigationKey!==n&&(this.xd(),this.Cd=setTimeout(this.xd,this.flushToCaptureTimeoutMs)),at(this.ft.navigationKey)&&(this.ft.navigationKey=n,this.ft.url=r),this.ft.firstMetricTimestamp=at(this.ft.firstMetricTimestamp)?Date.now():this.ft.firstMetricTimestamp;var s=null==(e=this._instance.sessionManager)?void 0:e.checkAndGetSessionAndWindowId(!0),o=p({},t,i?{navigationURL:r}:{},{$current_url:r,timestamp:Date.now()});if(delete o.entries,st(t.attribution)&&this.attributionMetrics.indexOf(t.name)>-1){var a={};for(var l of Qw){var u="url"===l&&"string"==typeof t.attribution[l]?this.Md(t.attribution[l]):t.attribution[l];at(u)||(a[l]=u)}o.attribution=a}else delete o.attribution;at(s)||(o.$session_id=s.sessionId,o.$window_id=s.windowId),this.ft.metrics.push(o),this.ft.metrics.length===this.allowedMetrics.length&&this.xd()}else Ww.error("Ignoring metric with value >= "+this.Ed,t)}}},this.Id=()=>{if(!this.Qn){var t,e,i,r,n=!1,s=v.__PosthogExtensions__,o=null==s?void 0:s.postHogWebVitalsCallbacksByFlavor,a=(null==o?void 0:o[this.Rd])||("web-vitals"===this.Rd&&at(o)?null==s?void 0:s.postHogWebVitalsCallbacks:void 0);if(!at(a)){var l=a.withoutAttribution,u=this.attributionMetrics;n=!at(l),t=u.indexOf("LCP")>-1?a.onLCP:(null==l?void 0:l.onLCP)||a.onLCP,e=u.indexOf("CLS")>-1?a.onCLS:(null==l?void 0:l.onCLS)||a.onCLS,i=u.indexOf("FCP")>-1?a.onFCP:(null==l?void 0:l.onFCP)||a.onFCP,r=u.indexOf("INP")>-1?a.onINP:(null==l?void 0:l.onINP)||a.onINP}if(t&&e&&i&&r){var h={reportSoftNavs:this.useSoftNavs},d=n&&this.attributionMetrics.indexOf("INP")>-1?p({},h,{includeProcessedEventEntries:!1}):h;this.allowedMetrics.indexOf("LCP")>-1&&t(this.Td.bind(this),h),this.allowedMetrics.indexOf("CLS")>-1&&e(this.Td.bind(this),h),this.allowedMetrics.indexOf("FCP")>-1&&i(this.Td.bind(this),h),this.allowedMetrics.indexOf("INP")>-1&&r(this.Td.bind(this),d),this.Qn=!0}else Ww.error("web vitals callbacks not loaded - not starting")}},this._instance=t,this.hd=!(null==(e=this._instance.persistence)||!e.props[xn]),this.startIfEnabled()}get Pd(){return this._instance.config.capture_performance}get allowedMetrics(){var t,e,i=st(this.Pd)?null==(t=this.Pd)?void 0:t.web_vitals_allowed_metrics:void 0;return dt(i)?(null==(e=this._instance.persistence)?void 0:e.props[En])||Gw:i}get flushToCaptureTimeoutMs(){return(st(this.Pd)?this.Pd.web_vitals_delayed_flush_ms:void 0)||5e3}get attributionMetrics(){var t=st(this.Pd)?this.Pd.web_vitals_attribution:void 0;return ft(t)?t?Gw:[]:rt(t)?t:Zw}get useAttribution(){return this.attributionMetrics.length>0}get useSoftNavs(){var t=st(this.Pd)?this.Pd.__preview_web_vitals_soft_navs:void 0;return null!=t&&t}get Ed(){var t=st(this.Pd)&&vt(this.Pd.__web_vitals_max_value)?this.Pd.__web_vitals_max_value:Vw;return t>0&&6e4>=t?Vw:t}get isEnabled(){var t=null==n?void 0:n.protocol;if("http:"!==t&&"https:"!==t)return Ww.info("Web Vitals are disabled on non-http/https protocols"),!1;var e=st(this.Pd)?this.Pd.web_vitals:ft(this.Pd)?this.Pd:void 0;return ft(e)?e:this.hd}startIfEnabled(){this.isEnabled&&!this.Qn&&(Ww.info("enabled, starting..."),this._s(this.Id))}onRemoteConfig(t){if(t.ok){var e=t.config;if("capturePerformance"in e){var i=st(e.capturePerformance)&&!!e.capturePerformance.web_vitals,r=st(e.capturePerformance)?e.capturePerformance.web_vitals_allowed_metrics:void 0;this._instance.persistence&&(this._instance.persistence.register({[xn]:i}),this._instance.persistence.register({[En]:r})),this.hd=i,this.startIfEnabled()}}}get Rd(){return this.useSoftNavs?this.useAttribution?"web-vitals-with-attribution-soft-navs":"web-vitals-soft-navs":this.useAttribution?"web-vitals-with-attribution":"web-vitals"}_s(t){var e=v.__PosthogExtensions__,i=this.Rd,r=null==e?void 0:e.postHogWebVitalsCallbacksByFlavor;null!=r&&r[i]||"web-vitals"===i&&at(r)&&null!=e&&e.postHogWebVitalsCallbacks?t():null==e||null==e.loadExternalDependency||e.loadExternalDependency(this._instance,i,(e=>{e?Ww.error("failed to load script",e):t()}))}Md(e){var i=e||(null==t?void 0:t.location.href);if(i){var r=this._instance.config.disable_capture_url_hashes?Le(i):i,n=this._instance.config.custom_personal_data_properties,s=this._instance.config.mask_personal_data_properties?[...Fa,...n||[]]:[];return nr(r,s,$a)}Ww.error("Could not determine current URL")}}},Nk={exceptionObserver:class{constructor(e){var i;this.Id=()=>{var e;if(t&&this.isEnabled&&null!=(e=v.__PosthogExtensions__)&&e.errorWrappingFunctions){var i=v.__PosthogExtensions__.errorWrappingFunctions.wrapOnError,r=v.__PosthogExtensions__.errorWrappingFunctions.wrapUnhandledRejection,n=v.__PosthogExtensions__.errorWrappingFunctions.wrapConsoleError;try{!this.Ad&&this.qi.capture_unhandled_errors&&(this.Ad=i(this.captureException.bind(this))),!this.Fd&&this.qi.capture_unhandled_rejections&&(this.Fd=r(this.captureException.bind(this))),!this.Ld&&this.qi.capture_console_errors&&(this.Ld=n(this.captureException.bind(this)))}catch(t){Hw.error("failed to start",t),this.Od()}}},this._instance=e,this.Dd=!(null==(i=this._instance.persistence)||!i.props[wn]),this.oe=new Et(p({},function(t){var e,i,r,n;return void 0===t&&(t={}),{refillRate:null!==(e=null!==(i=t.exceptionRateLimiterRefillRate)&&void 0!==i?i:t.__exceptionRateLimiterRefillRate)&&void 0!==e?e:1,bucketSize:null!==(r=null!==(n=t.exceptionRateLimiterBucketSize)&&void 0!==n?n:t.__exceptionRateLimiterBucketSize)&&void 0!==r?r:10}}(this._instance.config.error_tracking),{refillInterval:1e4,I:Hw})),this.qi=this.$d(),this.startIfEnabledOrStop()}$d(){var t=this._instance.config.capture_exceptions,e={capture_unhandled_errors:!1,capture_unhandled_rejections:!1,capture_console_errors:!1};return st(t)?e=p({},e,t):(at(t)?this.Dd:t)&&(e=p({},e,{capture_unhandled_errors:!0,capture_unhandled_rejections:!0})),e}get isEnabled(){return this.qi.capture_console_errors||this.qi.capture_unhandled_errors||this.qi.capture_unhandled_rejections}startIfEnabledOrStop(){this.isEnabled?(Hw.info("enabled"),this.Od(),this._s(this.Id)):this.Od()}_s(t){var e,i;null!=(e=v.__PosthogExtensions__)&&e.errorWrappingFunctions?t():null==(i=v.__PosthogExtensions__)||null==i.loadExternalDependency||i.loadExternalDependency(this._instance,"exception-autocapture",(e=>{if(e)return Hw.error("failed to load script",e);t()}))}Od(){var t,e,i;null==(t=this.Ad)||t.call(this),this.Ad=void 0,null==(e=this.Fd)||e.call(this),this.Fd=void 0,null==(i=this.Ld)||i.call(this),this.Ld=void 0}onRemoteConfig(t){if(t.ok){var e=t.config;"autocaptureExceptions"in e&&(this.Dd=!!e.autocaptureExceptions||!1,this._instance.persistence&&this._instance.persistence.register({[wn]:this.Dd}),this.qi=this.$d(),this.startIfEnabledOrStop())}}onConfigChange(){this.qi=this.$d()}captureException(t){var e,i,r,n=null!==(e=null==t||null==(i=t.$exception_list)||null==(i=i[0])?void 0:i.type)&&void 0!==e?e:"Exception";this.oe.consumeRateLimit(n)?Hw.info("Skipping exception capture because of client rate limiting.",{exception:n}):null==(r=this._instance.exceptions)||r.sendExceptionEvent(t)}},exceptions:class{constructor(t){var e,i;this.Nd=[],this.qd=Rg(),this._instance=t,this.Nd=null!==(e=null==(i=this._instance.persistence)?void 0:i.get_property(kn))&&void 0!==e?e:[],this.jd=Li(this.Bd()),this.Hd=new $i(this.jd)}onConfigChange(){this.jd=Li(this.Bd()),this.Hd.setConfig(this.jd)}onRemoteConfig(t){var e,i,r;if(t.ok){var n=t.config;if("errorTracking"in n){var s=null!==(e=null==(i=n.errorTracking)?void 0:i.suppressionRules)&&void 0!==e?e:[],o=null==(r=n.errorTracking)?void 0:r.captureExtensionExceptions;this.Nd=s,this._instance.persistence&&this._instance.persistence.register({[kn]:this.Nd,[Sn]:o})}}}get Ud(){var t,e=!!this._instance.get_property(Sn),i=this._instance.config.error_tracking.captureExtensionExceptions;return null!==(t=null!=i?i:e)&&void 0!==t&&t}buildProperties(t,e){return this.qd.buildFromUnknown(t,{syntheticException:null==e?void 0:e.syntheticException,mechanism:{handled:null==e?void 0:e.handled}})}addExceptionStep(t,e){if(this.jd.enabled)try{if(!lt(t)||0===t.trim().length)return void Eg.warn("Ignoring exception step because message must be a non-empty string");var i=function(t){if(!t)return{sanitizedProperties:{},droppedKeys:[]};var e=[];return{sanitizedProperties:Object.keys(t).reduce(((i,r)=>Oi.has(r)?(e.push(r),i):(i[r]=t[r],i)),{}),droppedKeys:e}}(this.zd(e)),r=i.sanitizedProperties,n=i.droppedKeys;n.length>0&&Eg.warn("Ignoring reserved exception step fields",{droppedKeys:n}),this.Hd.add(p({[Pi]:t,[Ai]:(new Date).toISOString()},r))}catch(t){Eg.error("Failed to add exception step. Ignoring breadcrumb.",t)}}sendExceptionEvent(t){try{var e=t.$exception_list;if(this.Wd(e)){if(this.Vd(e))return this.Gd("Exception dropped: matched a suppression rule"),void Eg.info("Skipping exception capture because a suppression rule matched");if(!this.Ud&&this.Zd(e))return this.Gd("Exception dropped: thrown by a browser extension"),void Eg.info("Skipping exception capture because it was thrown by an extension");if(!this.Ud&&this.Qd(e))return this.Gd("Exception dropped: thrown by an injected browser script"),void Eg.info("Skipping exception capture because it was thrown by an injected browser script");if(!this._instance.config.error_tracking.__capturePostHogExceptions&&this.Jd(e))return this.Gd("Exception dropped: thrown by the PostHog SDK"),void Eg.info("Skipping exception capture because it was thrown by the PostHog SDK")}var i=this.jd.enabled&&dt(t.$exception_steps)?this.Kd(t):t,r="string"==typeof(s=globalThis._posthogReleaseId)&&s.length>0?s:void 0;r&&(i.$release_id=r);try{var n=this._instance.capture("$exception",i,{_noTruncate:!0,_batchKey:"exceptionEvent",fl:!0});return n&&this.Hd.clear(),n}catch(t){return Eg.error("Failed to capture exception event. Dropping this exception.",t),void this.Hd.clear()}}catch(t){return void Eg.error("Failed to process exception event. Ignoring this exception.",t)}var s}Kd(t){try{var e=this.Hd.getAttachable();return 0===e.length?t:p({},t,{$exception_steps:e})}catch(e){return Eg.error("Failed to read buffered exception steps. Capturing exception without steps.",e),t}}Gd(t){this.jd.enabled&&this.Hd.add({[Pi]:t,[Ai]:(new Date).toISOString()})}zd(t){return st(t)?p({},t):{}}Bd(){var t,e;return null!==(t=null==(e=this._instance.config.error_tracking)?void 0:e.exception_steps)&&void 0!==t?t:{}}Vd(t){if(0===t.length)return!1;try{var e=t.reduce(((t,e)=>{var i=e.type,r=e.value;return lt(i)&&i.length>0&&t.$exception_types.push(i),lt(r)&&r.length>0&&t.$exception_values.push(r),t}),{$exception_types:[],$exception_values:[]});return this.Nd.some((t=>{var i=t.values.map((t=>{var i=ka[t.operator],r=e[t.key];if(!i||!r)return!1;var n=rt(t.value)?t.value:[t.value];return n.length>0&&i(n,r)}));return"OR"===t.type?i.some(Boolean):i.every(Boolean)}))}catch(t){return Eg.warn("Failed to evaluate suppression rules. Capturing the exception.",t),!1}}Zd(t){var e=t.flatMap((t=>{var e,i;return null!==(e=null==(i=t.stacktrace)?void 0:i.frames)&&void 0!==e?e:[]}));return e.some((t=>{var e=t.filename;return!!e&&Mg.some((t=>e.startsWith(t)))}))}Qd(t){return t.some((t=>{var e=t.value;return lt(e)&&Ig.some((t=>e.includes(t)))}))}Jd(t){if(t.length>0){var e,i,r,n,s=null!==(e=null==(i=t[0].stacktrace)?void 0:i.frames)&&void 0!==e?e:[],o=s[s.length-1];return null!==(r=null==o||null==(n=o.filename)?void 0:n.includes("posthog.com/static"))&&void 0!==r&&r}return!1}Wd(t){return!dt(t)&&rt(t)}}},qk=p({productTours:class{get za(){return this._instance.persistence}constructor(t){this.Yd=null,this.Xd=null,this._instance=t}initialize(){this.loadIfEnabled()}onRemoteConfig(t){if(t.ok){var e=t.config;if("productTours"in e){var i,r;if(this.za&&this.za.register({[Tn]:!!e.productTours}),!ek(this._instance))return!this.Yd&&dt(null==(i=this.za)?void 0:i.props[as])||tk.info("product tours disabled; stopping and clearing cached tours"),null==(r=this.Yd)||r.stop(),this.Yd=null,void this.clearCache();this.loadIfEnabled()}}}loadIfEnabled(){!this.Yd&&ek(this._instance)&&this._s((()=>this.tv()))}_s(t){var e,i;null!=(e=v.__PosthogExtensions__)&&e.generateProductTours?t():null==(i=v.__PosthogExtensions__)||null==i.loadExternalDependency||i.loadExternalDependency(this._instance,"product-tours",(e=>{e?tk.error("Could not load product tours script",e):t()}))}tv(){var t;!this.Yd&&null!=(t=v.__PosthogExtensions__)&&t.generateProductTours&&(this.Yd=v.__PosthogExtensions__.generateProductTours(this._instance,!0))}getProductTours(t,e){if(void 0===e&&(e=!1),!rt(this.Xd)||e){var i=this.za;if(i){var r=i.props[as];if(rt(r)&&!e)return this.Xd=r,void t(r,{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:e=>{if(ek(this._instance)){var r=e.statusCode;if(200!==r||!e.json){var n="Product Tours API could not be loaded, status: "+r;return 0===r?e.error||tk.warn(n):tk.error(n),void t([],{isLoaded:!1,error:n})}var s=rt(e.json.product_tours)?e.json.product_tours:[];this.Xd=s,i&&i.register({[as]:s}),t(s,{isLoaded:!0})}else t([],{isLoaded:!0})}})}else t(this.Xd,{isLoaded:!0})}getActiveProductTours(t){dt(this.Yd)?t([],{isLoaded:!1,error:"Product tours not loaded"}):this.Yd.getActiveProductTours(t)}showProductTour(t){var e;null==(e=this.Yd)||e.showTourById(t)}previewTour(t){this.Yd?this.Yd.previewTour(t):this._s((()=>{var e;this.tv(),null==(e=this.Yd)||e.previewTour(t)}))}dismissProductTour(){var t;null==(t=this.Yd)||t.dismissTour("user_clicked_skip")}nextStep(){var t;null==(t=this.Yd)||t.nextStep()}previousStep(){var t;null==(t=this.Yd)||t.previousStep()}clearCache(){var t;this.Xd=null,null==(t=this.za)||t.unregister(as)}resetTour(t){var e;null==(e=this.Yd)||e.resetTour(t)}resetAllTours(){var t;null==(t=this.Yd)||t.resetAllTours()}cancelPendingTour(t){var e;null==(e=this.Yd)||e.cancelPendingTour(t)}}},Lk),jk={siteApps:class{constructor(t){this.ev=0,this._instance=t,this.iv=[],this.apps={}}get isEnabled(){return!!this._instance.config.opt_in_site_apps}rv(t,e){if(e){var i=this.globalsForEvent(e);this.iv.push(i),this.iv.length>1e3&&(this.iv=this.iv.slice(10))}}get siteAppLoaders(){var t;return null==(t=v._POSTHOG_REMOTE_CONFIG)||null==(t=t[this._instance.config.token])?void 0:t.siteApps}initialize(){if(this.isEnabled){var t=this._instance._addCaptureHook(this.rv.bind(this));this.nv=()=>{t(),this.iv=[],this.nv=void 0}}}globalsForEvent(t){var e,i,r,n,s,o,a;if(!t)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 d of Object.entries(h)){var v=d[0];l[v]={id:u[v],type:v,properties:d[1]}}var c=t.$set_once,f=t.$set;return{event:p({},g(t,ik),{properties:p({},t.properties,f?{$set:p({},null!==(e=null==(i=t.properties)?void 0:i.$set)&&void 0!==e?e:{},f)}:{},c?{$set_once:p({},null!==(r=null==(n=t.properties)?void 0:n.$set_once)&&void 0!==r?r:{},c)}:{}),elements_chain:null!==(s=null==(o=t.properties)?void 0:o.$elements_chain)&&void 0!==s?s:"",distinct_id:null==(a=t.properties)?void 0:a.distinct_id}),person:{properties:this._instance.get_property("$stored_person_properties")},groups:l}}sv(t){var e,i=null==(e=t.tagName)?void 0:e.toLowerCase();return"style"===i&&this._instance.config.prepare_external_dependency_stylesheet?this._instance.config.prepare_external_dependency_stylesheet(t)||(rk.error("prepare_external_dependency_stylesheet returned null"),null):"script"===i&&this._instance.config.prepare_external_dependency_script?this._instance.config.prepare_external_dependency_script(t)||(rk.error("prepare_external_dependency_script returned null"),null):t}av(){var t,e,i,n,s,o,a,l;if(!this._instance.config.prepare_external_dependency_stylesheet&&!this._instance.config.prepare_external_dependency_script)return()=>{};var u=null==r?void 0:r.defaultView,h=null==u||null==(t=u.Node)?void 0:t.prototype;if(!u||!h)return()=>{};if(this.ev++,this.ov)return this.lv();var d=[],v=this,c=new WeakSet,f=(t,e,i)=>{if(null!=t&&t[e]){var r=t[e];t[e]=i(r),d.push((()=>{t[e]=r}))}},p=t=>{if(c.has(t))return t;var e=v.sv(t);return e&&c.add(e),e},g=t=>t.map((t=>"string"==typeof t?t:p(t))).filter((t=>!ht(t)));return f(h,"appendChild",(t=>function(e){var i=p(e);return i?t.call(this,i):e})),f(h,"insertBefore",(t=>function(e,i){var r=p(e);return r?t.call(this,r,i):e})),f(h,"replaceChild",(t=>function(e,i){var r=p(e);return r?t.call(this,r,i):i})),[null==(e=u.Element)?void 0:e.prototype,null==(i=u.Document)?void 0:i.prototype,null==(n=u.DocumentFragment)?void 0:n.prototype].forEach((t=>{f(t,"append",(t=>function(){for(var e=arguments.length,i=new Array(e),r=0;e>r;r++)i[r]=arguments[r];return t.apply(this,g(i))})),f(t,"prepend",(t=>function(){for(var e=arguments.length,i=new Array(e),r=0;e>r;r++)i[r]=arguments[r];return t.apply(this,g(i))}))})),[null==(s=u.Element)?void 0:s.prototype,null==(o=u.CharacterData)?void 0:o.prototype,null==(a=u.DocumentType)?void 0:a.prototype].forEach((t=>{f(t,"before",(t=>function(){for(var e=arguments.length,i=new Array(e),r=0;e>r;r++)i[r]=arguments[r];return t.apply(this,g(i))})),f(t,"after",(t=>function(){for(var e=arguments.length,i=new Array(e),r=0;e>r;r++)i[r]=arguments[r];return t.apply(this,g(i))})),f(t,"replaceWith",(t=>function(){for(var e=arguments.length,i=new Array(e),r=0;e>r;r++)i[r]=arguments[r];var n=g(i);return i.length&&!n.length?void 0:t.apply(this,n)}))})),f(null==(l=u.Element)?void 0:l.prototype,"insertAdjacentElement",(t=>function(e,i){var r=p(i);return r?t.call(this,e,r):null})),this.ov=()=>{d.forEach((t=>t())),this.ov=void 0},this.lv()}lv(){var t=!1;return()=>{var e;t||(t=!0,this.ev--,0===this.ev&&(null==(e=this.ov)||e.call(this)))}}uv(t,e){void 0===e&&(e=!0);var i=this.av();try{var r=t(i);return e&&i(),r}catch(t){throw i(),t}}setupSiteApp(t){var e=this.apps[t.id],i=()=>{var i;!e.errored&&this.iv.length&&(rk.info("Processing "+this.iv.length+" events for site app with id "+t.id),this.iv.forEach((t=>this.uv((()=>null==e.processEvent?void 0:e.processEvent(t))))),e.processedBuffer=!0),Object.values(this.apps).every((t=>t.processedBuffer||t.errored))&&(null==(i=this.nv)||i.call(this))},r=!1,n=n=>{e.errored=!n,e.loaded=!0,rk.info("Site app with id "+t.id+" "+(n?"loaded":"errored")),r&&i()};try{var s=this.uv((e=>t.init({posthog:this._instance,callback(t){e(),n(t)}})),!1).processEvent;s&&(e.processEvent=s),r=!0}catch(e){rk.error(nk+t.id,e),n(!1)}if(r&&e.loaded)try{i()}catch(i){rk.error("Error while processing buffered events PostHog app with config id "+t.id,i),e.errored=!0}}hv(){var t=this.siteAppLoaders||[];for(var e of t)this.apps[e.id]={id:e.id,loaded:!1,errored:!1,processedBuffer:!1};for(var i of t)this.setupSiteApp(i)}dv(t){var e=this;if(0!==Object.keys(this.apps).length){var i=this.globalsForEvent(t),r=function(r){try{e.uv((()=>null==r.processEvent?void 0:r.processEvent(i)))}catch(e){rk.error("Error while processing event "+t.event+" for site app "+r.id,e)}};for(var n of Object.values(this.apps))r(n)}}onRemoteConfig(t){var e,i,r,n=this;if(null!=(e=this.siteAppLoaders)&&e.length)return this.isEnabled?(this.hv(),void this._instance.on("eventCaptured",(t=>this.dv(t)))):void rk.error('PostHog site apps are disabled. Enable the "opt_in_site_apps" config to proceed.');if(null==(i=this.nv)||i.call(this),t.ok){var s=t.config;if(null!=(r=s.siteApps)&&r.length)if(this.isEnabled){var o=function(){var t,e=a.id,i=a.url;v["__$$ph_site_app_"+e]=n._instance,null==(t=v.__PosthogExtensions__)||null==t.loadSiteApp||t.loadSiteApp(n._instance,i,(t=>{if(t)return rk.error(nk+e,t)}))};for(var a of s.siteApps)o()}else rk.error('PostHog site apps are disabled. Enable the "opt_in_site_apps" config to proceed.')}}}},Bk={tracingHeaders:class{constructor(t){this.vv=void 0,this.fv=void 0,this.pv=void 0,this.Id=()=>{var t,e,i=this.gv();i?(at(this.vv)&&(this.vv=null==(t=v.__PosthogExtensions__)||null==(t=t.tracingHeadersPatchFns)?void 0:t._patchXHR(i,(()=>this._instance.get_distinct_id()),this._instance.sessionManager)),at(this.fv)&&(this.fv=null==(e=v.__PosthogExtensions__)||null==(e=e.tracingHeadersPatchFns)?void 0:e._patchFetch(i,(()=>this._instance.get_distinct_id()),this._instance.sessionManager))):this.Od()},this._instance=t}initialize(){this.startIfEnabledOrStop()}_s(t){var e,i;null!=(e=v.__PosthogExtensions__)&&e.tracingHeadersPatchFns?t():null==(i=v.__PosthogExtensions__)||null==i.loadExternalDependency||i.loadExternalDependency(this._instance,"tracing-headers",(e=>{if(e)return zw.error("failed to load script",e);t()}))}mv(){var t,e;return null!==(t=null!==(e=this._instance.config.tracing_headers)&&void 0!==e?e:this._instance.config.addTracingHeaders)&&void 0!==t?t:this._instance.config.__add_tracing_headers}gv(){var t=this.mv();return rt(t)?(rt(this.pv)?this.pv.splice(0,this.pv.length,...t):this.pv=[...t],t.length>0?this.pv:void 0):(rt(this.pv)&&this.pv.splice(0),this.pv=t||void 0,this.pv)}Od(){var t,e;null==(t=this.vv)||t.call(this),null==(e=this.fv)||e.call(this),this.vv=void 0,this.fv=void 0}startIfEnabledOrStop(){this.gv()?this._s(this.Id):this.Od()}}},Uk=p({surveys:class extends lk{constructor(t){var e;super(new fk(t),{get projectToken(){return e.config.token},kv:new ck(e=t)}),this._instance=t}Nl(t,e){var i=e.query?Wb(t,e.query):t;return new Promise((t=>{var r;this._instance._send_request({method:e.method,url:this._instance.requestRouter.endpointFor(null!==(r=e.target)&&void 0!==r?r:"api",i),data:e.body,headers:e.headers,timeout:e.timeoutMs,fireCallbackOnDrop:!0,transport:e.transport,compression:e.compression,timestampMode:e.sentAt,callback:t})}))}}},Lk),Hk={toolbar:class{constructor(t){this.instance=t}yv(t){v.ph_toolbar_state=t}bv(){var t;return null!==(t=v.ph_toolbar_state)&&void 0!==t?t:0}initialize(){return this.maybeLoadToolbar()}maybeLoadToolbar(e,i,n){if(void 0===e&&(e=void 0),void 0===i&&(i=void 0),void 0===n&&(n=void 0),Yi(this.instance.config))return!1;if(!t||!r)return!1;e=null!=e?e:t.location,n=null!=n?n:t.history;try{if(!i){try{t.localStorage.setItem("test","test"),t.localStorage.removeItem("test")}catch(t){return!1}i=null==t?void 0:t.localStorage}var s,o=pk||sr(e.hash,"__posthog")||sr(e.hash,"state"),a=o?Vi((()=>JSON.parse(atob(decodeURIComponent(o)))))||Vi((()=>JSON.parse(decodeURIComponent(o)))):null;return a&&"ph_authorize"===a.action?((s=a).source="url",s&&Object.keys(s).length>0&&(a.desiredHash?e.hash=a.desiredHash:n?n.replaceState(n.state,"",e.pathname+e.search):e.hash="")):((s=JSON.parse(i.getItem(gk)||"{}")).source="localstorage",delete s.userIntent),!(!s.token||this.instance.config.token!==s.token||(this.loadToolbar(s),0))}catch(t){return!1}}_v(t){var e=v.ph_load_toolbar||v.ph_load_editor;!dt(e)&&nt(e)?e(t,this.instance):mk.warn("No toolbar load function found")}loadToolbar(e){var i=!(null==r||!r.getElementById(hr));if(!t||i)return!1;var n="custom"===this.instance.requestRouter.region&&this.instance.config.advanced_disable_toolbar_metrics,s=p({token:this.instance.config.token},e,{apiURL:this.instance.requestRouter.endpointFor("ui")},n?{instrument:!1}:{});if(t.localStorage.setItem(gk,JSON.stringify(p({},s,{source:void 0}))),2===this.bv())this._v(s);else if(0===this.bv()){var o;this.yv(1),null==(o=v.__PosthogExtensions__)||null==o.loadExternalDependency||o.loadExternalDependency(this.instance,"toolbar",(t=>{if(t)return mk.error("[Toolbar] Failed to load",t),void this.yv(0);this.yv(2),this._v(s)})),Ki(t,"turbolinks:load",(()=>{this.yv(0),this.loadToolbar(s)}))}return!0}wv(t){return this.loadToolbar(t)}maybeLoadEditor(t,e,i){return void 0===t&&(t=void 0),void 0===e&&(e=void 0),void 0===i&&(i=void 0),this.maybeLoadToolbar(t,e,i)}}},zk=p({experiments:Mk},Lk),Wk={conversations:class{constructor(t){this.Sv=void 0,this._conversationsManager=null,this.xv=!1,this.Me=null,this.Cv=!1,this._instance=t}initialize(){this.loadIfEnabled()}onRemoteConfig(t){if(!this._instance.config.disable_conversations&&(this.Tv=t.ok,t.ok)){var e=t.config.conversations;dt(e)||(ft(e)?this.Sv=e:(this.Sv=e.enabled,this.Me=e),this.loadIfEnabled())}}reset(){var t;null==(t=this._conversationsManager)||t.reset(),this._conversationsManager=null,this.Sv=void 0,this.Me=null,this.Tv=void 0,this.Cv=!1}loadIfEnabled(){if(!(this._conversationsManager||this.xv||this._instance.config.disable_conversations||Yi(this._instance.config)||this._instance.config.cookieless_mode&&this._instance.consent.isOptedOut())){var t=null==v?void 0:v.__PosthogExtensions__;if(t&&!at(this.Sv)&&this.Sv)if(this.Me&&this.Me.token){this.xv=!0;try{var e=t.initConversations;if(e)return this.Mv(e),void(this.xv=!1);var i=t.loadExternalDependency;if(!i)return void this.Ev(As);i(this._instance,"conversations",(e=>{e||!t.initConversations?this.Ev("Could not load conversations script",e):this.Mv(t.initConversations),this.xv=!1}))}catch(t){this.Ev("Error initializing conversations",t),this.xv=!1}}else Ik.error("Conversations enabled but missing token in remote config.")}}Mv(t){if(this.Me)try{this._conversationsManager=t(this.Me,this._instance),this.Cv=!1,Ik.info("Conversations loaded successfully")}catch(t){this.Ev("Error completing conversations initialization",t)}else Ik.error("Cannot complete initialization: remote config is null")}Ev(t,e){Ik.error(t,e),this._conversationsManager=null,this.xv=!1,this.Cv=!0}show(){this._conversationsManager?this._conversationsManager.show():Ik.warn("Conversations not loaded yet.")}hide(){this._conversationsManager&&this._conversationsManager.hide()}isAvailable(){return!0===this.Sv&&!ht(this._conversationsManager)}getUnavailableReason(){return this.isAvailable()?null:this._instance.config.disable_conversations?"disabled_by_config":Yi(this._instance.config)?"disabled_for_toolbar":this._instance.config.cookieless_mode&&this._instance.consent.isOptedOut()?"consent_opted_out":!1===this.Tv?"remote_config_failed":at(this.Sv)?this.Tv?"disabled_in_project":"remote_config_pending":this.Sv?dt(this.Me)||!this.Me.token?"missing_token":null!=v&&v.__PosthogExtensions__?this.xv?"initializing":this.Cv?"load_failed":"not_loaded":"extensions_unavailable":"disabled_in_project"}isVisible(){var t,e;return null!==(t=null==(e=this._conversationsManager)?void 0:e.isVisible())&&void 0!==t&&t}sendMessage(t,e,i){var r=this;return f((function*(){return r._conversationsManager?r._conversationsManager.sendMessage(t,e,i):(Ik.warn(Rk),null)}))()}getMessages(t,e){var i=this;return f((function*(){return i._conversationsManager?i._conversationsManager.getMessages(t,e):(Ik.warn(Rk),null)}))()}markAsRead(t){var e=this;return f((function*(){return e._conversationsManager?e._conversationsManager.markAsRead(t):(Ik.warn(Rk),null)}))()}getTickets(t){var e=this;return f((function*(){return e._conversationsManager?e._conversationsManager.getTickets(t):(Ik.warn(Rk),null)}))()}requestRestoreLink(t){var e=this;return f((function*(){return e._conversationsManager?e._conversationsManager.requestRestoreLink(t):(Ik.warn(Rk),null)}))()}restoreFromToken(t){var e=this;return f((function*(){return e._conversationsManager?e._conversationsManager.restoreFromToken(t):(Ik.warn(Rk),null)}))()}restoreFromUrlToken(){var t=this;return f((function*(){return t._conversationsManager?t._conversationsManager.restoreFromUrlToken():(Ik.warn(Rk),null)}))()}getCurrentTicketId(){var t,e;return null!==(t=null==(e=this._conversationsManager)?void 0:e.getCurrentTicketId())&&void 0!==t?t:null}getWidgetSessionId(){var t,e;return null!==(t=null==(e=this._conversationsManager)?void 0:e.getWidgetSessionId())&&void 0!==t?t:null}Sl(){var t;null==(t=this._conversationsManager)||t.setIdentity()}xl(){var t;null==(t=this._conversationsManager)||t.clearIdentity()}}},Vk={logs:class{constructor(e){var i,r=this;this.Iv=!1,this.Rv=!1,this.I=Bi("[logs]"),this.Pv=p({},this.I,{error(){for(var t=arguments.length,e=new Array(t),i=0;t>i;i++)e[i]=arguments[i];e.some(Fk)||r.I.error(...e)}}),this.ka=[],this.Av=[],this.ph=0,this.Fv=()=>{var t,e;this.ph=0,null==(t=this.Lv)||t.onReconnect(),null==(e=this.Ov)||e.onReconnect()},this._instance=e,this._instance&&null!=(i=this._instance.config.logs)&&i.captureConsoleLogs&&(this.Iv=!0),t&&Ki(t,"online",this.Fv)}Dv(t,e,i,r){var n,s=function(t,e){var i,r,n,s,o,a,l,u=null!==(i=null==t?void 0:t.flushIntervalMs)&&void 0!==i?i:3e3,h=null!==(r=null==t?void 0:t.maxBufferSize)&&void 0!==r?r:100,d=null!=e&&e.consoleCapture?void 0:null!==(n=null==t?void 0:t.maxLogsPerInterval)&&void 0!==n?n:1e3,v=at(d)?Math.max(h,2048):Math.max(h,d),c=null==t?void 0:t.resourceAttributes;return{serviceName:null!==(s=null!==(o=null==c?void 0:c["service.name"])&&void 0!==o?o:null==t?void 0:t.serviceName)&&void 0!==s?s:null==e?void 0:e.serviceNameDefault,serviceVersion:null!==(a=null==c?void 0:c["service.version"])&&void 0!==a?a:null==t?void 0:t.serviceVersion,environment:null!==(l=null==c?void 0:c["deployment.environment"])&&void 0!==l?l:null==t?void 0:t.environment,resourceAttributes:c,beforeSend:null==t?void 0:t.beforeSend,flushIntervalMs:u,maxBufferSize:h,maxQueueSize:v,maxBatchRecordsPerPost:100,rateCapWindowMs:u,maxLogsPerInterval:d,backgroundFlushBudgetMs:0,terminationFlushBudgetMs:0}}(null==(n=this._instance)||null==(n=n.config)?void 0:n.logs,i);return[new Ke(this.$v(t,e),s,this.Pv,(()=>this.Nv()),(t=>t()),void 0,r),s]}qv(){var t,e=null==(t=this._instance)||null==(t=t.config)?void 0:t.logs;if(!this.Lv||this.jv!==e){var i;null==(i=this.Lv)||i.reset(),this.jv=e;var r=this.Dv((()=>this.ka),(t=>{this.ka=t}));this.Lv=r[0],this.Bv=r[1]}return this.Lv}Hv(){var t,e=null==(t=this._instance)||null==(t=t.config)?void 0:t.logs;if(!this.Ov||this.Uv!==e){var i;null==(i=this.Ov)||i.reset(),this.Uv=e;var r=this.Dv((()=>this.Av),(t=>{this.Av=t}),{serviceNameDefault:"posthog-browser-logs",consoleCapture:!0},Pk);this.Ov=r[0],this.zv=r[1]}return this.Ov}initialize(){this.loadIfEnabled()}onRemoteConfig(t){var e;if(t.ok){var i=null==(e=t.config.logs)?void 0:e.captureConsoleLogs;!dt(i)&&i&&(this.Iv=!0,this.loadIfEnabled())}}reset(){var t,e;this.ka=[],null==(t=this.Lv)||t.reset(),this.Av=[],null==(e=this.Ov)||e.reset(),this.ph=0}captureLog(t){this.qv().captureLog(t)}vi(t){this.Hv().captureLog(t)}get logger(){return this.Wv||(this.Wv={trace:(t,e)=>this.captureLog({body:t,level:"trace",attributes:e}),debug:(t,e)=>this.captureLog({body:t,level:"debug",attributes:e}),info:(t,e)=>this.captureLog({body:t,level:"info",attributes:e}),warn:(t,e)=>this.captureLog({body:t,level:"warn",attributes:e}),error:(t,e)=>this.captureLog({body:t,level:"error",attributes:e}),fatal:(t,e)=>this.captureLog({body:t,level:"fatal",attributes:e})}),this.Wv}flushLogs(t){t?this.Vv(t):(this.Lv&&this.Lv.flush().catch((t=>this.Gv(t))),this.Ov&&this.Ov.flush().catch((t=>this.Gv(t))))}Gv(t){Fk(t)||this.I.error("PostHog logs flush failed:",t)}loadIfEnabled(){if(this.Iv&&!this.Rv){var t=null==v?void 0:v.__PosthogExtensions__;if(t){var e=t.loadExternalDependency;e?e(this._instance,"logs",(e=>{var i;e||null==(i=t.logs)||!i.initializeLogs?this.I.error("Could not load logs script",e):(t.logs.initializeLogs(this._instance),this.Rv=!0)})):this.I.error(As)}else this.I.error("PostHog Extensions not found.")}}$v(t,e){var i=this._instance;return{get isDisabled(){return!1},get optedOut(){return!i.is_capturing()},getPersistedProperty:e=>e===x.LogsQueue?t():void 0,setPersistedProperty(t,i){var r;t===x.LogsQueue&&e(null!==(r=i)&&void 0!==r?r:[])},Mn:t=>this.Mn(t),getLibraryId:()=>Ni.LIB_NAME,getLibraryVersion:()=>Ni.LIB_VERSION}}Mn(t){return new Promise((e=>{if(or(this.ph,3))e({kind:"fatal",error:Ok(void 0,"logs endpoint is unreachable, dropping batch")});else{var i=!1,r=t=>{i||(i=!0,clearTimeout(n),e(t))},n=setTimeout((()=>{this.I.warn("Logs request timed out before receiving a response"),r({kind:"retry-later",error:Ok(void 0,"logs request timed out")})}),9e4);this._instance._send_request({method:"POST",url:this.Zv(),data:t,compression:"best-available",batchKey:"logs",fireCallbackOnDrop:!0,callback:t=>{var e=t.statusCode;if(this.Qv(e),e>=200&&300>e)r({kind:"ok"});else if(413===e)r({kind:"too-large"});else if(0!==e&&408!==e&&429!==e&&500>e)r({kind:"fatal",error:new Error("logs request failed with status "+e)});else{var i;0===e?(t.error||this.I.warn("Logs request failed before receiving an HTTP response"),r({kind:"retry-later",error:Ok(t.error,"logs request failed before receiving an HTTP response")})):r({kind:"retry-later",error:null!==(i=t.error)&&void 0!==i?i:new Error("logs request failed with status "+e)})}}})}}))}Qv(t){(0!==t||this._instance.__loaded)&&(this.ph=ar(t,this.ph,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."))))}Vv(t){this.ka.length>0&&this.Jv(t,this.ka,this.Bv,Ni.LIB_NAME,(t=>{this.ka=t})),this.Av.length>0&&this.Jv(t,this.Av,this.zv,Pk,(t=>{this.Av=t}))}Jv(t,e,i,r,n){if(0!==e.length){var s=e.map((t=>t.record));n([]);var o=Je(s,Qe(i,Ni.LIB_NAME,Ni.LIB_VERSION),r,Ni.LIB_VERSION);this._instance._send_request({method:"POST",url:this.Zv(),data:o,compression:"best-available",batchKey:"logs",transport:t})}}Zv(){return this._instance.requestRouter.endpointFor("api","/i/v1/logs")+"?token="+encodeURIComponent(this._instance.config.token)}Nv(){var t,e={};if(e.distinctId=this._instance.get_distinct_id(),this._instance.sessionManager){var i=this._instance.sessionManager.checkAndGetSessionAndWindowId(!0),r=i.windowId,n=i.sessionStartTimestamp,s=i.lastActivityTimestamp;e.sessionId=i.sessionId,e.windowId=r,dt(n)||(e.sessionStartTimestamp=n),dt(s)||(e.lastActivityTimestamp=s)}if(null!=v&&null!=(t=v.location)&&t.href&&(e.currentUrl=this._instance.config.disable_capture_url_hashes?Le(v.location.href):v.location.href),this._instance.featureFlags){var o=this._instance.featureFlags.getFlags();o&&o.length>0&&(e.activeFeatureFlags=o)}return e}}},Gk={metrics:class{constructor(t){this.I=Bi("[metrics]"),this._instance=t}initialize(){}qv(){var t,e,i=null==(t=this._instance)||null==(t=t.config)?void 0:t.metrics;return this.Lv&&this.jv===i||(null==(e=this.Lv)||e.reset(),this.jv=i,this.Lv=new ei(this.$v(),function(t){var e,i,r,n,s,o=null==t?void 0:t.resourceAttributes;return{serviceName:null!==(e=null==o?void 0:o["service.name"])&&void 0!==e?e:null==t?void 0:t.serviceName,serviceVersion:null!==(i=null==o?void 0:o["service.version"])&&void 0!==i?i:null==t?void 0:t.serviceVersion,environment:null!==(r=null==o?void 0:o["deployment.environment"])&&void 0!==r?r:null==t?void 0:t.environment,resourceAttributes:o,beforeSend:null==t?void 0:t.beforeSend,flushIntervalMs:null!==(n=null==t?void 0:t.flushIntervalMs)&&void 0!==n?n:1e4,maxSeriesPerFlush:null!==(s=null==t?void 0:t.maxSeriesPerFlush)&&void 0!==s?s:1e3}}(i),this.I)),this.Lv}count(t,e,i){void 0===e&&(e=1),this.qv().count(t,e,i)}gauge(t,e,i){this.qv().gauge(t,e,i)}histogram(t,e,i){this.qv().histogram(t,e,i)}flush(t){if(!this.Lv)return Promise.resolve();if(t){var e=this.Lv.drainWindow();return e&&this.Un(e,t),Promise.resolve()}return this.Lv.flush().catch((t=>this.I.error("PostHog metrics flush failed:",t)))}reset(){var t;null==(t=this.Lv)||t.reset()}$v(){var t=this._instance,e=this;return{get isDisabled(){return!1},get optedOut(){return!t.is_capturing()},Un:t=>e.Un(t),getLibraryId:()=>Ni.LIB_NAME,getLibraryVersion:()=>Ni.LIB_VERSION}}Un(t,e){return new Promise((i=>{var r=!1,n=t=>{r||(r=!0,clearTimeout(s),i(t))},s=setTimeout((()=>n({kind:"retry-later",error:new Error("metrics request timed out")})),9e4);this._instance._send_request(p({method:"POST",url:this.Kv(),data:t,compression:"best-available",batchKey:"metrics"},e&&{transport:e},{fireCallbackOnDrop:!0,callback(t){var e=t.statusCode;if(e>=200&&300>e)n({kind:"ok"});else if(413===e)n({kind:"too-large"});else if(0!==e&&408!==e&&429!==e&&500>e)n({kind:"fatal",error:new Error("metrics request failed with status "+e)});else{var i;n({kind:"retry-later",error:null!==(i=t.error)&&void 0!==i?i:new Error("metrics request failed with status "+e)})}}}))}))}Kv(){return this._instance.requestRouter.endpointFor("api","/i/v1/metrics")+"?token="+encodeURIComponent(this._instance.config.token)}}},Zk=p({},Lk,$k,Dk,Nk,qk,jk,Uk,Bk,Hk,zk,Wk,Vk,Gk);Bw.__defaultExtensionClasses=p({},Zk);var Qk=function(){Ni.SDK_DIST_CHANNEL="npm";var e=Ew[Lw]=new Bw;return function(){function e(){e.done||(e.done=!0,$w=!1,Hi(Ew,(function(t){t._dom_loaded()})))}null!=r&&r.addEventListener?"complete"===r.readyState?e():Ki(r,"DOMContentLoaded",e,{capture:!1}):t&&ji.error("Browser doesn't support `document.addEventListener` so PostHog couldn't be initialized")}(),e}();export{nf as Compression,Ob as DEFAULT_PRODUCT_TOUR_APPEARANCE,pf as DisplaySurveyType,Bw as PostHog,Fb as ProductTourEventName,Lb as ProductTourEventProperties,cf as SurveyEventName,ff as SurveyEventProperties,sf as SurveyEventType,af as SurveyPosition,df as SurveyQuestionBranchingType,hf as SurveyQuestionType,vf as SurveySchedule,lf as SurveyTabPosition,uf as SurveyType,of as SurveyWidgetType,Qk as default,Qk as posthog,jb as severityLevels};
2
2
  //# sourceMappingURL=module.full.js.map