posthog-js 1.422.3 → 1.422.4

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.
Files changed (53) hide show
  1. package/dist/all-external-dependencies.js +1 -1
  2. package/dist/all-external-dependencies.js.map +1 -1
  3. package/dist/array.full.es5.js +1 -1
  4. package/dist/array.full.es5.js.map +1 -1
  5. package/dist/array.full.js +1 -1
  6. package/dist/array.full.js.map +1 -1
  7. package/dist/array.full.no-external.js +1 -1
  8. package/dist/array.full.no-external.js.map +1 -1
  9. package/dist/array.js +1 -1
  10. package/dist/array.no-external.js +1 -1
  11. package/dist/conversations.js +1 -1
  12. package/dist/customizations.d.ts +11 -0
  13. package/dist/customizations.full.js +1 -1
  14. package/dist/customizations.js +1 -1
  15. package/dist/dead-clicks-autocapture.js +1 -1
  16. package/dist/default-extensions.js +1 -1
  17. package/dist/exception-autocapture.js +1 -1
  18. package/dist/extension-bundles.js +1 -1
  19. package/dist/lazy-recorder.js +1 -1
  20. package/dist/main.d.ts +11 -0
  21. package/dist/main.js +1 -1
  22. package/dist/module.d.ts +11 -0
  23. package/dist/module.full.d.ts +11 -0
  24. package/dist/module.full.js +1 -1
  25. package/dist/module.full.js.map +1 -1
  26. package/dist/module.full.no-external.d.ts +11 -0
  27. package/dist/module.full.no-external.js +1 -1
  28. package/dist/module.full.no-external.js.map +1 -1
  29. package/dist/module.js +1 -1
  30. package/dist/module.no-external.d.ts +11 -0
  31. package/dist/module.no-external.js +1 -1
  32. package/dist/module.slim.js +1 -1
  33. package/dist/module.slim.no-external.d.ts +11 -0
  34. package/dist/module.slim.no-external.js +1 -1
  35. package/dist/posthog-recorder.js +1 -1
  36. package/dist/product-tours-preview.js.map +1 -1
  37. package/dist/product-tours.js +1 -1
  38. package/dist/product-tours.js.map +1 -1
  39. package/dist/src/extensions/surveys/surveys-extension-utils.d.ts +4 -1
  40. package/dist/src/extensions/surveys.d.ts +11 -0
  41. package/dist/surveys-preview.js +1 -1
  42. package/dist/surveys-preview.js.map +1 -1
  43. package/dist/surveys.d.ts +11 -0
  44. package/dist/surveys.js +1 -1
  45. package/dist/surveys.js.map +1 -1
  46. package/lib/package.json +1 -1
  47. package/lib/src/extensions/surveys/surveys-extension-utils.d.ts +4 -1
  48. package/lib/src/extensions/surveys/surveys-extension-utils.js +10 -4
  49. package/lib/src/extensions/surveys/surveys-extension-utils.js.map +1 -1
  50. package/lib/src/extensions/surveys.d.ts +11 -0
  51. package/lib/src/extensions/surveys.js +120 -6
  52. package/lib/src/extensions/surveys.js.map +1 -1
  53. package/package.json +5 -5
@@ -1,2 +1,2 @@
1
- !function(){"use strict";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,a=null!=e&&e.XMLHttpRequest&&"withCredentials"in new e.XMLHttpRequest?e.XMLHttpRequest:void 0,o=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,a){try{var o=t[s](a),l=o.value}catch(t){return void i(t)}o.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 a(t){c(s,r,n,a,o,"next",t)}function o(t){c(s,r,n,a,o,"throw",t)}a(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},b=t=>{if("string"!=typeof t)return t;try{return JSON.parse(t)}catch(e){return t}};function _(t){return"string"==typeof t||t}function w(t){return"string"==typeof t?t:void 0}var k=["$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"],S=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}({}),x=function(t){return t.GZipJS="gzip-js",t.Base64="base64",t}({}),C="min_length",T="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"],E=["token"],I=20,R=1e3,P=1e4,A="[Circular]",F="[Truncated]",O="[Unserializable]",L="[Function]";function D(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 N=["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","pinterestbot","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 N.concat(e).some((t=>{var e=t.toLowerCase();return-1!==i.indexOf(e)}))};function j(t,e){return-1!==t.indexOf(e)}var B=function(t){return t.trim()},H=function(t){return t.replace(/^\$/,"")};function z(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 U=Object.prototype,W=U.hasOwnProperty,V=U.toString,G=Array.isArray||function(t){return"[object Array]"===V.call(t)},Z=t=>"function"==typeof t,Q=t=>t===Object(t)&&!G(t),J=t=>{if(Q(t)){for(var e in t)if(W.call(t,e))return!1;return!0}return!1},K=t=>void 0===t,Y=t=>"[object String]"==V.call(t),X=t=>Y(t)&&0===t.trim().length,tt=t=>null===t,et=t=>K(t)||tt(t),it=t=>"[object Number]"==V.call(t)&&t==t,rt=t=>it(t)&&t>0,nt=t=>"[object Boolean]"===V.call(t),st=t=>t instanceof FormData,at=t=>j(M,t),ot=t=>j(E,t);function lt(t){return null===t||"object"!=typeof t}function ut(t,e){return{}.toString.call(t)==="[object "+e+"]"}function ht(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 vt(t,Error)}}function dt(t){return"undefined"!=typeof Event&&vt(t,Event)}function vt(t,e){try{return t instanceof e}catch(t){return!1}}var ct=[!0,"true",1,"1","yes"],ft=t=>j(ct,t),pt=[!1,"false",0,"0","no"];function gt(t,e,i,r,n){return e>i&&(r.warn("min cannot be greater than max."),e=i),it(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),gt(n||i,e,i,r))}class mt{constructor(t){this.k={},this.S=t.S,this.C=gt(t.bucketSize,0,100,t.I),this.R=gt(t.refillRate,0,this.C,t.I),this.A=gt(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 yt="Mobile",bt="iOS",_t="Android",wt="Tablet",kt=_t+" "+wt,St="iPad",xt="Apple",Ct=xt+" Watch",Tt="Safari",Mt="BlackBerry",Et="Samsung",It=Et+"Browser",Rt=Et+" Internet",Pt="Chrome",At=Pt+" OS",Ft=Pt+" "+bt,Ot="Internet Explorer",Lt=Ot+" "+yt,Dt="Opera",$t=Dt+" Mini",Nt="Edge",qt="Microsoft "+Nt,jt="Firefox",Bt=jt+" "+bt,Ht="Nintendo",zt="PlayStation",Ut="Xbox",Wt=_t+" "+yt,Vt=yt+" "+Tt,Gt="Windows",Zt=Gt+" Phone",Qt="Nokia",Jt="Ouya",Kt="Generic",Yt=Kt+" "+yt.toLowerCase(),Xt=Kt+" "+wt.toLowerCase(),te="Konqueror",ee="Oculus Browser",ie="Vivaldi",re="Yandex",ne="Whale",se="DuckDuckGo",ae="Pale Moon",oe="Waterfox",le="Brave",ue="Google Search App",he="(\\d+(\\.\\d+)?)",de=new RegExp("Version/"+he),ve=new RegExp(Ut,"i"),ce=new RegExp(zt+" \\w+","i"),fe=new RegExp(Ht+" \\w+","i"),pe=new RegExp(Mt+"|PlayBook|BB10","i"),ge={"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"},me=function(t,e,i,r){e=e||"";var n=function(t){return null!=t&&t.brave?le:null}(i);return n||(null!=r&&r.detectGoogleSearchApp&&j(t,"GSA/")?ue:j(t," OPR/")&&j(t,"Mini")?$t:j(t," OPR/")?Dt:pe.test(t)?Mt:j(t,"IE"+yt)||j(t,"WPDesktop")?Lt:j(t,"OculusBrowser")?ee:j(t,It)?Rt:j(t,Nt)||j(t,"Edg/")?qt:j(t,ie+"/")?ie:j(t,"YaBrowser/")?re:j(t,ne+"/")?ne:j(t,se+"/")||j(t,"Ddg/")?se:j(t,"FBIOS")?"Facebook "+yt:j(t,"UCWEB")||j(t,"UCBrowser")?"UC Browser":j(t,"CriOS")?Ft:j(t,"CrMo")||j(t,Pt)?Pt:j(t,_t)&&j(t,Tt)?Wt:j(t,"FxiOS")?Bt:j(t.toLowerCase(),te.toLowerCase())?te:j(t,le+"/")?le:((t,e)=>e&&j(e,xt)||function(t){return j(t,Tt)&&!j(t,Pt)&&!j(t,_t)}(t))(t,e)?j(t,yt)?Vt:Tt:j(t,"PaleMoon/")?ae:j(t,oe+"/")?oe:j(t,jt)?jt:j(t,"MSIE")||j(t,"Trident/")?Ot:j(t,"Gecko")?jt:"")},ye={[Lt]:[new RegExp("rv:"+he)],[qt]:[new RegExp(Nt+"?\\/"+he)],[Pt]:[new RegExp("("+Pt+"|CrMo)\\/"+he)],[Ft]:[new RegExp("CriOS\\/"+he)],"UC Browser":[new RegExp("(UCBrowser|UCWEB)\\/"+he)],[Tt]:[de],[Vt]:[de],[Dt]:[new RegExp("(Opera|OPR)\\/"+he)],[jt]:[new RegExp(jt+"\\/"+he)],[Bt]:[new RegExp("FxiOS\\/"+he)],[te]:[new RegExp("Konqueror[:/]?"+he,"i")],[Mt]:[new RegExp(Mt+" "+he),de],[Wt]:[new RegExp("android\\s"+he,"i")],[Rt]:[new RegExp(It+"\\/"+he)],[ee]:[new RegExp("OculusBrowser\\/"+he)],[ie]:[new RegExp(ie+"\\/"+he)],[re]:[new RegExp("YaBrowser\\/"+he)],[ne]:[new RegExp(ne+"\\/"+he)],[le]:[new RegExp(le+"\\/"+he)],[se]:[new RegExp("(DuckDuckGo|Ddg)\\/"+he)],[ae]:[new RegExp("PaleMoon\\/"+he)],[oe]:[new RegExp(oe+"\\/"+he)],[ue]:[new RegExp("GSA\\/"+he)],[Ot]:[new RegExp("(rv:|MSIE )"+he)],Mozilla:[new RegExp("rv:"+he)]},be=function(t,e,i,r){var n=me(t,e,i,r),s=ye[n];if(K(s))return null;for(var a=0;s.length>a;a++){var o=t.match(s[a]);if(o)return parseFloat(o[o.length-2])}return null},_e=[[new RegExp(Ut+"; "+Ut+" (.*?)[);]","i"),t=>[Ut,t&&t[1]||""]],[new RegExp(Ht,"i"),[Ht,""]],[new RegExp(zt,"i"),[zt,""]],[pe,[Mt,""]],[new RegExp(Gt,"i"),(t,e)=>{if(/Phone/.test(e)||/WPDesktop/.test(e))return[Zt,""];if(new RegExp(yt).test(e)&&!/IEMobile\b/.test(e))return[Gt+" "+yt,""];var i=/Windows NT ([0-9.]+)/i.exec(e);if(i&&i[1]){var r=ge[i[1]]||"";return/arm/i.test(e)&&(r="RT"),[Gt,r]}return[Gt,""]}],[/((iPhone|iPad|iPod).*?OS (\d+)_(\d+)_?(\d+)?|iPhone)/,t=>t&&t[3]?[bt,[t[3],t[4],t[5]||"0"].join(".")]:[bt,""]],[/(watch.*\/(\d+\.\d+\.\d+)|watch os,(\d+\.\d+),)/i,t=>{var e="";return t&&t.length>=3&&(e=K(t[2])?t[3]:t[2]),["watchOS",e]}],[new RegExp("("+_t+" (\\d+)\\.(\\d+)\\.?(\\d+)?|"+_t+")","i"),t=>t&&t[2]?[_t,[t[2],t[3],t[4]||"0"].join(".")]:[_t,""]],[/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/,[At,""]],[/Linux|debian/i,["Linux",""]]],we=function(t){return fe.test(t)?Ht:ce.test(t)?zt:ve.test(t)?Ut:new RegExp(Jt,"i").test(t)?Jt:new RegExp("("+Zt+"|WPDesktop)","i").test(t)?Zt:/iPad/.test(t)?St:/iPod/.test(t)?"iPod Touch":/iPhone/.test(t)?"iPhone":/(watch)(?: ?os[,/]|\d,\d\/)[\d.]+/i.test(t)?Ct:pe.test(t)?Mt:/(kobo)\s(ereader|touch)/i.test(t)?"Kobo":new RegExp(Qt,"i").test(t)?Qt:/(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(yt).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)?_t:kt:new RegExp("(pda|"+yt+")","i").test(t)?Yt:new RegExp(wt,"i").test(t)&&!new RegExp(wt+" pc","i").test(t)?Xt:""},ke=function(t,e){var i,r,n,s,a=we(t);return a===St||a===kt||"Kobo"===a||"Kindle Fire"===a||a===Xt?wt:a===Ht||a===Ut||a===zt||a===Jt?"Console":a===Ct?"Wearable":a?yt:"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)?yt:wt:"Desktop"},Se=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;function xe(t,e){return"string"==typeof(i=t)&&Se.test(i)?t:e();var i}function Ce(t,e){var i=new Error(e);try{Object.defineProperty(i,"name",{value:t,writable:!0,enumerable:!0,configurable:!0})}catch(t){}return i}function Te(t){return t?t.split("#")[0]:t}function Me(t,e){var i=setTimeout(t,e);return(null==i?void 0:i.unref)&&(null==i||i.unref()),i}function Ee(t,e,i){return Ie.apply(this,arguments)}function Ie(){return(Ie=f((function*(t,e,i){var r;try{return yield Promise.race([t,new Promise(((t,n)=>{r=Me((()=>{try{null==i||i(),t()}catch(t){n(t)}}),e)}))])}finally{clearTimeout(r)}}))).apply(this,arguments)}var Re,Pe="NativeGzipValidationError",Ae=t=>t.length>=2&&31===t[0]&&139===t[1],Fe=(t,e)=>t===x.GZipJS||e===x.GZipJS||"gzip"===e,Oe=t=>!(!t||"object"!=typeof t)&&"NotReadableError"===("name"in t?String(t.name):""),Le=t=>{if(!t||"object"!=typeof t)return!1;var e="name"in t?String(t.name):"";return Oe(t)||e===Pe},De=t=>{throw Ce(Pe,"Native gzip produced invalid output: "+t)},$e=function(){var t=f((function*(t,e){18>t.size&&De("too-short");var i=new Uint8Array(yield t.slice(0,10).arrayBuffer());Ae(i)&&8===i[2]||De("invalid-header");var r=new DataView(yield t.slice(t.size-8).arrayBuffer());r.getUint32(0,!0)!==(t=>{for(var e=(()=>{if(Re)return Re;Re=[];for(var t=0;256>t;t++){for(var e=t,i=0;8>i;i++)e=1&e?3988292384^e>>>1:e>>>1;Re[t]=e>>>0}return Re})(),i=4294967295,r=0;t.length>r;r++)i=e[255&(i^t[r])]^i>>>8;return(4294967295^i)>>>0})(e)&&De("invalid-crc");var n=e.length>>>0;r.getUint32(4,!0)!==n&&De("invalid-size")}));return function(e,i){return t.apply(this,arguments)}}();function Ne(t,e,i){return qe.apply(this,arguments)}function qe(){return qe=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(),a=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)}}()),o=new Response(n.readable).blob(),l=(yield Promise.all([o,a]))[0];return yield $e(l,r),l}catch(t){if(null!=i&&i.rethrow)throw t;return e&&console.error("Failed to gzip compress data",t),null}})),qe.apply(this,arguments)}var je={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}},Be=je.info,He=0x8000000000000000,ze={}.propertyIsEnumerable;function Ue(t,e){try{return Ge(t,e,{ancestors:new WeakSet,remainingNodes:P},0)}catch(t){return[]}}function We(t,e,i,r){if(0>=i.remainingNodes)return{stringValue:F};if(i.remainingNodes--,nt(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>=He||-He>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:D(t)};if("function"==typeof t)return{stringValue:L};if("symbol"==typeof t)return{stringValue:String(t)};if("object"==typeof t&&null!==t){if(i.ancestors.has(t))return{stringValue:A};if(r>=I)return{stringValue:F};if(t instanceof Date){var s=t.getTime(),a=Number.isFinite(s)?t.toISOString():String(t);return{stringValue:"string"==typeof a?D(a):String(a)}}i.ancestors.add(t);try{try{var o=t.toJSON;if("function"==typeof o)return We(o.call(t),e,i,r+1)}catch(t){}return G(t)?{arrayValue:{values:Ve(t,e,i,r+1)}}:{kvlistValue:{values:Ge(t,e,i,r+1)}}}finally{i.ancestors.delete(t)}}return{stringValue:D(String(t))}}function Ve(t,e,i,r){for(var n=[],s=Math.min(t.length,R),a=0;s>a&&i.remainingNodes>0;a++)try{var o=a in t?t[a]:void 0;if(et(o))continue;n.push(We(o,e,i,r))}catch(t){n.push({stringValue:O})}return t.length>a&&n.push({stringValue:F}),n}function Ge(t,e,i,r){var n=[];for(var s in t)if(ze.call(t,s)){if(n.length>=R||0>=i.remainingNodes){null==e||e.debug("Attributes truncated: the value exceeds the OTLP encoder budget");break}try{var a=t[s];if(tt(a)||K(a))continue;n.push({key:D(s),value:We(a,e,i,r)})}catch(t){n.push({key:D(s),value:{stringValue:O}})}}return n}function Ze(t){try{return D(String(t))}catch(t){return O}}function Qe(t,e,i,r){var n,s=je[t.level||"info"]||Be,a=s.text,o=s.number,l=(void 0===(n=it(r)?r:void 0)&&(n=Date.now()),String(n)+"000000"),u={};e.distinctId&&(u.posthogDistinctId=e.distinctId),e.sessionId&&(u.sessionId=e.sessionId),e.windowId&&(u["window.id"]=e.windowId),et(e.sessionStartTimestamp)||(u.sessionStartTimestamp=String(e.sessionStartTimestamp)),et(e.lastActivityTimestamp)||(u.lastActivityTimestamp=String(e.lastActivityTimestamp)),e.currentUrl&&(u["url.full"]=e.currentUrl),e.screenName&&(u["screen.name"]=e.screenName),e.appState&&(u["app.state"]=e.appState),e.activeFeatureFlags&&e.activeFeatureFlags.length>0&&(u.feature_flags=e.activeFeatureFlags);var h=p({},u),d=t.attributes;if(d){var v=[];try{v=Object.keys(d)}catch(t){v=[]}for(var c of v){var f=void 0;try{f=d[c]}catch(t){f=O}Object.defineProperty(h,c,{value:f,enumerable:!0,writable:!0,configurable:!0})}}var g={timeUnixNano:l,observedTimeUnixNano:l,severityNumber:o,severityText:a,body:{stringValue:Ze(t.body)},attributes:Ue(h,i)};return t.trace_id&&(g.traceId=t.trace_id),t.span_id&&(g.spanId=t.span_id),K(t.trace_flags)||(g.flags=t.trace_flags),g}function Je(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 Ke(t,e,i,r){return{resourceLogs:[{resource:{attributes:Ue(e)},scopeLogs:[{scope:{name:i,version:r},logRecords:t}]}]}}let Ye=class{constructor(t,e,i,r,n,s,a){var o;void 0===s&&(s=()=>Promise.resolve()),this._instance=t,this.nn=e,this.I=i,this.Sn=r,this.xn=n,this.Cn=s,this.Tn=a,this.Mn=null,this.En=0,this.In=0,this.Rn=0,this.Pn=0,this.An=0,this.Fn=!1,this.On=e.maxBufferSize,this.Ln=Math.max(null!==(o=e.maxQueueSize)&&void 0!==o?o:e.maxBufferSize,e.maxBufferSize),this.Dn=e.flushIntervalMs,this.$n=e.maxBatchRecordsPerPost,this.Nn=e.rateCapWindowMs,this.qn=e.maxLogsPerInterval}clearQueue(){this.In++,this._instance.setPersistedProperty(S.LogsQueue,[])}reset(){this.jn(),this.Pn=0,this.An=0,this.Fn=!1,this.Rn=0,this.$n=this.nn.maxBatchRecordsPerPost}onReconnect(){this.Rn=0,this.Bn()}captureLog(t,e){var i;if(!this._instance.isDisabled&&!this._instance.optedOut&&null!=t&&t.body){var r=this.Hn(t);if(null!==r)if(r.body){if(this.zn()){var n={record:Qe(r,null!==(i=null==e?void 0:e.context)&&void 0!==i?i:this.Sn(),this.I,null==e?void 0:e.occurredAtMs)};this.xn((()=>this.Un(n)))}}else this.I.info("Log was rejected in beforeSend function")}}Hn(t){var e=this.nn.beforeSend;if(!e)return t;var i=G(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}zn(){if(void 0===this.qn)return!0;var t=Date.now(),e=t-this.Pn;return this.Nn>e&&e>=0||(this.Pn=t,this.An=0,this.Fn=!1),this.qn>this.An?(this.An++,!0):(this.Fn||(this.I.warn("captureLog dropping logs: exceeded "+this.qn+" logs per "+this.Nn+"ms"),this.Fn=!0),!1)}flush(){var t=this;return f((function*(){if(!t._instance.isDisabled)return t.Mn||(t.Mn=t.Wn().finally((()=>{t.Mn=null}))),t.Mn}))()}Wn(){var t=this;return f((function*(){var e;t.jn();var i=null!==(e=t._instance.getPersistedProperty(S.LogsQueue))&&void 0!==e?e:[];if(0!==i.length)for(var r=i.length,n=0;i.length>0&&r>n;){var s,a,o=t.In;t.En=0;var l=Math.min(i.length,t.$n),u=i.slice(0,l),h=u.map((t=>t.record)),d=Ke(h,t.Vn(),null!==(s=t.Tn)&&void 0!==s?s:t._instance.getLibraryId(),t._instance.getLibraryVersion()),v=yield t._instance.Gn(d);if(t.In!==o)return;if("too-large"===v.kind&&u.length>1)t.$n=Math.max(1,Math.floor(u.length/2)),t.I.warn("Received 413 when sending logs batch of size "+u.length+", reducing batch size to "+t.$n);else{if("retry-later"===v.kind)throw v.error;if("too-large"===v.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"===v.kind&&t.nn.maxBatchRecordsPerPost>t.$n&&(t.$n=Math.min(t.nn.maxBatchRecordsPerPost,t.$n+1)),yield t.Zn(u.length),i=null!==(a=t._instance.getPersistedProperty(S.LogsQueue))&&void 0!==a?a:[],n+=u.length,"fatal"===v.kind)throw v.error}}}))()}Zn(t){var e=this;return f((function*(){var i,r=Math.max(0,t-e.En),n=null!==(i=e._instance.getPersistedProperty(S.LogsQueue))&&void 0!==i?i:[];e._instance.setPersistedProperty(S.LogsQueue,n.slice(r)),yield e.Cn()}))()}Vn(){return Je(this.nn,this._instance.getLibraryId(),this._instance.getLibraryVersion())}Un(t){var e;if(!this._instance.optedOut){var i=null!==(e=this._instance.getPersistedProperty(S.LogsQueue))&&void 0!==e?e:[];this.Ln>i.length||(i.shift(),this.En++,this.I.info("Logs queue is full, dropping oldest record.")),i.push(t),this._instance.setPersistedProperty(S.LogsQueue,i),this.On>i.length?this.Qn():this.Bn()}}Qn(t){void 0===t&&(t=this.Dn),this.Jn||(this.Jn=Me((()=>{this.Jn=void 0,this.Bn()}),t))}Kn(){var t=Math.min(Math.max(0,this.Rn-1),6);return this.Dn*Math.pow(2,t)}Yn(){var t=this._instance.getPersistedProperty(S.LogsQueue);return!!t&&t.length>0}shutdown(t){var e=this;return f((function*(){e.jn();var i=e.flush().catch((()=>{}));void 0!==t?yield Ee(i,t):yield i}))()}flushWithTimeout(t){var e=this;return f((function*(){var i=e.flush();yield Ee(i,t,(()=>{i.catch((()=>{}))}))}))()}Bn(){this.flush().then((()=>{this.Rn=0}),(t=>{this.Rn++,this.I.error("PostHog logs flush failed:",t)})).finally((()=>{!this._instance.isDisabled&&this.Yn()&&this.Qn(this.Kn())}))}jn(){this.Jn&&(clearTimeout(this.Jn),this.Jn=void 0)}};var Xe=[0,5,10,25,50,75,100,250,500,750,1e3,2500,5e3,7500,1e4];function ti(t){return String(t)+"000000"}function ei(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 ii=class{constructor(t,e,i){this._instance=t,this.nn=e,this.I=i,this.Xn=new Map,this.Mn=null,this.ts=!1,this.es=new Map,this.rs=new Set,this.ns=0}count(t,e,i){void 0===e&&(e=1),this.ss({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.ss({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.ss({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.Mn,i=function(){var i=f((function*(){e&&(yield e.catch((()=>{}))),yield t.os()}));return function(){return i.apply(this,arguments)}}(),r=i().finally((()=>{this.Mn===r&&(this.Mn=null)}));return this.Mn=r,r}drainWindow(){if(0===this.Xn.size)return null;var t=this.Xn;return this.Xn=new Map,this.ts=!1,this.es=new Map,this.rs=new Set,this.ls(t)}reset(){this.ns++,this.jn(),this.Xn=new Map,this.Mn=null,this.ts=!1,this.es=new Map,this.rs=new Set}ss(t){if(!this._instance.isDisabled&&!this._instance.optedOut){var e=this.Hn(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=ei(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.Xn.get(r);if(!n){if(!this.us())return;n={name:e.name,type:e.type,unit:e.unit,attributes:i,windowStartMs:Date.now()},this.Xn.set(r,n)}var s=this.es.get(e.name);void 0===s?this.es.set(e.name,e.type):s===e.type||this.rs.has(e.name)||(this.rs.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.hs(n,e.value),this.Qn()}else this.I.warn("Dropping metric '"+e.name+"': value must be a finite number");else this.I.warn("Dropping metric with empty name")}}us(){return this.nn.maxSeriesPerFlush>this.Xn.size||(this.ts||(this.ts=!0,this.I.warn("Metric series cap reached ("+this.nn.maxSeriesPerFlush+" per flush window); dropping new series until the next flush. Reduce attribute cardinality.")),!1)}hs(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(Xe.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,Xe)]+=1}}Hn(t){var e=this.nn.beforeSend;if(!e)return t;var i=G(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}Qn(){this.Jn||(this.Jn=Me((()=>{this.Jn=void 0,this.flush().catch((t=>{this.I.error("Metrics flush failed:",t)}))}),this.nn.flushIntervalMs))}jn(){this.Jn&&(clearTimeout(this.Jn),this.Jn=void 0)}os(){var t=this;return f((function*(){if(0!==t.Xn.size){var e=t.Xn;t.Xn=new Map,t.ts=!1,t.es=new Map,t.rs=new Set;var i=t.ns,r=yield t._instance.ds(t.ls(e));if(i===t.ns)switch(r.kind){case"ok":return;case"retry-later":return t.vs(e),void t.Qn();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)}}}))()}ls(t){return e=this.cs(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.nn,this._instance.getLibraryId(),this._instance.getLibraryVersion()),r=this._instance.getLibraryId(),n=this._instance.getLibraryVersion(),{resourceMetrics:[{resource:{attributes:Ue(i)},scopeMetrics:[{scope:{name:r,version:n},metrics:e}]}]};var e,i,r,n}cs(t){var e=ti(Date.now()),i=new Map;for(var r of t.values()){var n,s=ei(r.type,r.name,r.unit,void 0),a=i.get(s);a||(a=p({name:r.name},r.unit&&{unit:r.unit}),"count"===r.type?a.sum={aggregationTemporality:1,isMonotonic:!0,dataPoints:[]}:"gauge"===r.type?a.gauge={dataPoints:[]}:a.histogram={aggregationTemporality:1,dataPoints:[]},i.set(s,a));var o=Ue(null!==(n=r.attributes)&&void 0!==n?n:{},this.I),l=ti(r.windowStartMs);if("count"===r.type){var u,h={attributes:o,startTimeUnixNano:l,timeUnixNano:e,asDouble:null!==(u=r.total)&&void 0!==u?u:0};a.sum.dataPoints.push(h)}else if("gauge"===r.type){var d,v={attributes:o,timeUnixNano:e,asDouble:null!==(d=r.last)&&void 0!==d?d:0};a.gauge.dataPoints.push(v)}else r.hist&&a.histogram.dataPoints.push({attributes:o,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:Xe})}return Array.from(i.values())}vs(t){var e,i;for(var r of t){var n=r[0],s=r[1],a=this.Xn.get(n);if(a)switch(a.windowStartMs=Math.min(a.windowStartMs,s.windowStartMs),a.type){case"count":a.total=(null!==(e=a.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(a.hist){a.hist.count+=s.hist.count,a.hist.sum+=s.hist.sum,a.hist.min=Math.min(a.hist.min,s.hist.min),a.hist.max=Math.max(a.hist.max,s.hist.max);for(var o=0;a.hist.bucketCounts.length>o;o++)a.hist.bucketCounts[o]+=s.hist.bucketCounts[o]}else a.hist=s.hist}else this.us()&&this.Xn.set(n,s)}}};function ri(t,e){if(t){var i=t.find((t=>t.type===e));return null==i?void 0:i.value}}var ni,si,ai;function oi(t){var e=globalThis._posthogChunkIds;if(e){var i=Object.keys(e);return ai&&i.length===si||(si=i.length,ai=i.reduce(((i,r)=>{ni||(ni={});var n=ni[r];if(n)i[n[0]]=n[1];else for(var s=t(r),a=s.length-1;a>=0;a--){var o=s[a],l=null==o?void 0:o.filename,u=e[r];if(l&&u){i[l]=u,ni[r]=[l,u];break}}return i}),{})),ai}}class li{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&&G(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 a=[s];return null!=t.cause&&a.push(...this.convertToExceptionList(t.cause,p({},e,{handled:!0}))),a}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 ui="?";function hi(t,e,i,r,n){var s={platform:t,filename:e,function:"<anonymous>"===i?ui:i,in_app:!(null!=e&&e.startsWith("webkit-masked-url://"))&&"<anonymous>"!==e};return K(r)||(s.lineno=r),K(n)||(s.colno=n),s}var di=(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]:ui,i?"safari-extension:"+e:"safari-web-extension:"+e]:[t,e]},vi=/^\s*at (\S+?)(?::(\d+))(?::(\d+))\s*$/i,ci=/^\s*at (?:(.+?\)(?: \[.+\])?|.*?) ?\((?:address at )?)?(?:async )?((?:<anonymous>|[-a-z]+:|.*bundle|\/)?.*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i,fi=/\((\S*)(?::(\d+))(?::(\d+))\)/,pi=(t,e)=>{var i=vi.exec(t);if(i)return hi(e,i[1],ui,+i[2],+i[3]);var r=ci.exec(t);if(r){if(r[2]&&0===r[2].indexOf("eval")){var n=fi.exec(r[2]);n&&(r[2]=n[1],r[3]=n[2],r[4]=n[3])}var s=di(r[1]||ui,r[2]);return hi(e,s[1],s[0],r[3]?+r[3]:void 0,r[4]?+r[4]:void 0)}},gi=/^\s*(.*?)(?:\((.*?)\))?(?:^|@)?((?:[-a-z]+)?:\/.*?|\[native code\]|[^@]*(?:bundle|\d+\.js)|\/[\w\-. /=]+)(?::(\d+))?(?::(\d+))?\s*$/i,mi=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i,yi=(t,e)=>{var i=gi.exec(t);if(i){if(i[3]&&i[3].indexOf(" > eval")>-1){var r=mi.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]||ui,a=di(s,n);return hi(e,n=a[1],s=a[0],i[4]?+i[4]:void 0,i[5]?+i[5]:void 0)}},bi=/\(error: (.*)\)/,_i=50;class wi{match(t){return this.isDOMException(t)||this.isDOMError(t)}coerce(t,e){var i=Y(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 ut(t,"DOMException")}isDOMError(t){return ut(t,"DOMError")}}class ki{match(t){return ht(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 Si{constructor(){}match(t){return!!ut(t,"ErrorEvent")&&(null!=t.error||this.Pi(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.Di(t))&&void 0!==i?i:r.stack,synthetic:!0})}Pi(t){return Y(t.message)&&t.message.length>0}Di(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(Y(r.filename)&&0!==r.filename.length&&0!==n)return"Error\n at "+r.filename+":"+n+":"+s}}var xi=/^(?:[Uu]ncaught (?:exception: )?)?(?:((?:Eval|Internal|Range|Reference|Syntax|Type|URI|)Error): )?(.*)$/i;class Ci{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(xi);return r&&(e=r[1],i=r[2]),[e,i]}}var Ti=["fatal","error","warning","log","info","debug"];function Mi(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(dt(t))return t.constructor.name;var e="name"in t?t.name:void 0;return Y(e)&&!X(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: "+Mi(t)}isSeverityLevel(t){return Y(t)&&!X(t)&&Ti.indexOf(t)>=0}getStack(t){try{return Y(t.stacktrace)&&t.stacktrace.length>0?t.stacktrace:Y(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(ht(i))return i}}getObjectClassName(t){try{var e=Object.getPrototypeOf(t);return e?e.constructor.name:void 0}catch(t){return}}}class Ii{match(t){return dt(t)}coerce(t,e){var i,r=t.constructor.name;return{type:r,value:r+" captured as exception with keys: "+Mi(t),stack:null==(i=e.syntheticException)?void 0:i.stack,synthetic:!0}}}class Ri{match(t){return lt(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 Pi{match(t){return ut(t,"PromiseRejectionEvent")||this.isCustomEventWrappingRejection(t)}isCustomEventWrappingRejection(t){if(!dt(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 lt(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 Ai="$message",Fi="$timestamp",Oi=new Set([Ai,Fi]),Li={enabled:!0,max_bytes:32768};function Di(t){var e;return t?{enabled:null!==(e=t.enabled)&&void 0!==e?e:Li.enabled,max_bytes:Ni(t.max_bytes,Li.max_bytes)}:p({},Li)}class $i{constructor(t){this.fs=[],this.ps=0,this.nn=Di(t)}setConfig(t){this.nn=Di(t),this.gs()}add(t){var e=function(t){var e;try{e=z(t)}catch(t){return}try{var i=JSON.parse(e);if(!Q(i))return;var r=i,n=r[Ai],s=r[Fi];if(!Y(n)||0===n.trim().length)return;if(!Y(s)&&!it(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.nn.max_bytes||(this.fs.push({step:e.step,bytes:i}),this.ps+=i,this.gs())}}getAttachable(){return this.fs.map((t=>t.step))}clear(){this.fs=[],this.ps=0}size(){return this.fs.length}gs(){for(;this.ps>this.nn.max_bytes&&this.fs.length>0;){var t=this.fs.shift();t&&(this.ps-=t.bytes)}}}function Ni(t,e){if(!it(t)||t===1/0||t===-1/0)return e;var i=Math.floor(t);return 0>i?e:i}var qi={DEBUG:!1,LIB_VERSION:"0.6.2",LIB_NAME:"browser-common"},ji=function(e,i){var r=(void 0===i?{}:i).debugEnabled,n={P(i){if(t&&(qi.DEBUG||t.POSTHOG_DEBUG||r)&&!K(t.console)&&t.console){for(var n=("__rrweb_original__"in t.console[i]?t.console[i].__rrweb_original__:t.console[i]),s=arguments.length,a=new Array(s>1?s-1:0),o=1;s>o;o++)a[o-1]=arguments[o];n(e,...a)}},debug(){for(var t=arguments.length,e=new Array(t),i=0;t>i;i++)e[i]=arguments[i];n.P("debug",...e)},info(){for(var t=arguments.length,e=new Array(t),i=0;t>i;i++)e[i]=arguments[i];n.P("log",...e)},warn(){for(var t=arguments.length,e=new Array(t),i=0;t>i;i++)e[i]=arguments[i];n.P("warn",...e)},error(){for(var t=arguments.length,e=new Array(t),i=0;t>i;i++)e[i]=arguments[i];n.P("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)=>ji(e+" "+t,i)};return n},Bi=ji("[PostHog.js]"),Hi=Bi.createLogger;function zi(t,e){G(t)&&t.forEach(e)}function Ui(t,e){if(!et(t))if(G(t))t.forEach(e);else if(st(t))t.forEach(((t,i)=>e(t,i)));else for(var i in t)W.call(t,i)&&e(t[i],i)}var Wi=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 Vi(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 Gi=function(t){try{return t()}catch(t){return}},Zi=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){Bi.critical("Implementation error. Please turn on debug mode and open a ticket on https://app.posthog.com/home#panel=support%3Asupport%3A."),Bi.critical(t)}}},Qi=function(t){var e={};return Ui(t,(function(t,i){(Y(t)&&t.length>0||it(t))&&(e[i]=t)})),e};var Ji=["herokuapp.com","vercel.app","netlify.app"];function Ki(t){var e=null==t?void 0:t.hostname;if(!Y(e))return!1;var i=e.split(".").slice(-2).join(".");for(var r of Ji)if(i===r)return!1;return!0}function Yi(t,e,i,r){var n=null!=r?r:{},s=n.capture,a=n.passive;null==t||t.addEventListener(e,i,{capture:void 0!==s&&s,passive:void 0===a||a})}function Xi(t){return"ph_toolbar_internal"===t.name}var tr=["localhost","127.0.0.1"],er=(t,e)=>{try{return JSON.stringify(t,((t,e)=>"bigint"==typeof e?e.toString():e),e)}catch(e){return z(t)}},ir=t=>{var e=null==r?void 0:r.createElement("a");return K(e)?null:(e.href=t,e)},rr=function(t,e){var i,r;void 0===e&&(e="&");var n=[];return Ui(t,(function(t,e){K(t)||K(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)},nr=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(!G(i)||2>i.length)return"";var a=i[1];try{a=decodeURIComponent(a)}catch(t){Bi.error("Skipping decoding for malformed query param: "+a)}return a.replace(/\+/g," ")},sr=function(t,e,i){if(!t||!e||!e.length)return t;for(var r=t.split("#"),n=r[1],s=(r[0]||"").split("?"),a=s[1],o=s[0],l=(a||"").split("&"),u=[],h=0;l.length>h;h++){var d=l[h].split("=");G(d)&&(e.includes(d[0])?u.push(d[0]+"="+i):u.push(l[h]))}var v=o;return null!=a&&(v+="?"+u.join("&")),null!=n&&(v+="#"+n),v},ar=function(t,e){var i=t.match(new RegExp(e+"=([^&]*)"));return i?i[1]:null},or=(t,e)=>t>=e&&h(),lr=(t,e,i,r)=>{if(0===t){if(h()){var n=e+1;return n===i&&r(),n}return e}return 0};function ur(t,e){var i,r=null==t||null==(i=t.config)?void 0:i.get_current_url;if(!Z(r))return e;try{var n=r(e);return Y(n)&&n?n:e}catch(t){return Bi.error("Error in get_current_url, falling back to window.location.href",t),e}}function hr(e){var i,r=null==t||null==(i=t.location)?void 0:i.href;return K(r)?void 0:ur(e,r)}var dr="__POSTHOG_TOOLBAR__",vr=1,cr=3,fr=11;function pr(t){return t instanceof Element&&(t.id===dr||!(null==t.closest||!t.closest(".toolbar-global-fade-container")))}function gr(t){return!!t&&t.nodeType===vr}function mr(t,e){return!!t&&!!t.tagName&&t.tagName.toLowerCase()===e.toLowerCase()}function yr(t){return!!t&&t.nodeType===cr}function br(t){return!!t&&t.nodeType===fr&&gr(t.host)}var _r=1e3;function wr(t){return t?B(t).split(/\s+/):[]}function kr(t,e){var i=hr(e);return!!(i&&t&&t.some((t=>i.match(t))))}function Sr(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 wr(e)}function xr(t){return et(t)?null:B(t).split(/(\s+)/).filter((t=>Qr(t))).join("").replace(/[\r\n]/g," ").replace(/[ ]+/g," ").substring(0,255)}function Cr(t){var e="";return jr(t)&&!Br(t)&&t.childNodes&&t.childNodes.length&&Ui(t.childNodes,(function(t){var i;yr(t)&&t.textContent&&(e+=null!==(i=xr(t.textContent))&&void 0!==i?i:"")})),B(e)}function Tr(t){var e;return K(t.target)?t.srcElement||null:null!=(e=t.target)&&e.shadowRoot?t.composedPath()[0]||null:t.target||null}var Mr=["a","button","form","input","select","textarea","label"];function Er(t,e){if(K(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 Ir(t){var e=t.parentNode;return!(!e||!gr(e))&&e}var Rr=[".ph-no-autocapture","[data-ph-no-autocapture]"],Pr=["next","previous","prev",">","<"],Ar=[...Pr,"+","-","−","–"],Fr=(t,e)=>/[a-z0-9]/i.test(e)?t.includes(e):t===e,Or=[".ph-no-deadclick",".ph-no-capture"],Lr=[".ph-no-rageclick",".ph-no-capture"],Dr=["","text","search","email","password","url","tel","number"];function $r(e,i){if(!t||Nr(e))return!1;var r,n,s,a,o;if(nt(i)?(r=!!i&&Lr,n=void 0,s=!1):(r=null!==(a=null==i?void 0:i.css_selector_ignorelist)&&void 0!==a?a:Lr,n=null==i?void 0:i.content_ignorelist,s=null!==(o=null==i?void 0:i.ignore_text_selection)&&void 0!==o&&o),!1===r)return!1;if(s&&function(t){return!(!t||!gr(t))&&(!!mr(t,"textarea")||(mr(t,"input")?j(Dr,(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=qr(e,!1).targetElementList;return!function(t,e){if(!1===t||K(t))return!1;var i;if(!0===t)i=Pr;else{if(!G(t))return!1;if(t.length>10)return Bi.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=>Fr(e,t)||Fr(r,t)))}))}(n,l.map((t=>{var e;return{safeText:Cr(t).toLowerCase(),ariaLabel:(null==(e=t.getAttribute("aria-label"))?void 0:e.toLowerCase().trim())||""}})))&&!Er(l,r)}var Nr=t=>!t||mr(t,"html")||!gr(t),qr=(e,i)=>{if(!t||Nr(e))return{parentIsUsefulElement:!1,targetElementList:[]};for(var r=!1,n=[e],s=e;s.parentNode&&!mr(s,"body");)if(br(s.parentNode))n.push(s.parentNode.host),s=s.parentNode.host;else{var a=Ir(s);if(!a)break;if(i||Mr.indexOf(a.tagName.toLowerCase())>-1)r=!0;else try{var o=t.getComputedStyle(a);o&&"pointer"===o.getPropertyValue("cursor")&&(r=!0)}catch(t){}n.push(a),s=a}return{parentIsUsefulElement:r,targetElementList:n}};function jr(t){for(var e=new Set,i=0,r=t;r.parentNode&&!mr(r,"body");r=r.parentNode){if(i++>=_r||e.has(r))return!1;e.add(r);var n=Sr(r);if(j(n,"ph-sensitive")||j(n,"ph-no-capture"))return!1}if(j(Sr(t),"ph-include"))return!0;var s=t.type||"";if(Y(s))switch(s.toLowerCase()){case"hidden":case"password":return!1}var a=t.name||t.id||"";return!Y(a)||!/^cc|cardnum|ccnum|creditcard|csc|cvc|cvv|exp|pass|pwd|routing|seccode|securitycode|securitynum|socialsec|socsec|ssn/i.test(a.replace(/[^a-zA-Z0-9]/g,""))}function Br(t){return!!(mr(t,"input")&&!["button","checkbox","submit","reset"].includes(t.type)||mr(t,"select")||mr(t,"textarea")||"true"===t.getAttribute("contenteditable"))}var Hr=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}))$"),zr=/(^|[^0-9A-Za-z_])([0-9][0-9 -]*[0-9])(?=$|[^0-9A-Za-z_])/g,Ur=[16,15,14,13],Wr=new RegExp("^(\\d{3}-?\\d{2}-?\\d{4})$"),Vr=new RegExp("(^|[^0-9])((?!000|666)[0-9]{3}-?(?!00)[0-9]{2}-?(?!0000)[0-9]{4})(?=$|([^0-9]))","g"),Gr=/[0-9A-Za-z_]/;function Zr(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 Qr(t,e){if(void 0===e&&(e=!0),et(t))return!1;if(Y(t)){t=B(t);var i=e?Hr.test((t||"").replace(/[- ]/g,"")):function(t){var e;for(zr.lastIndex=0;e=zr.exec(t);){var i=e[2];if(i)for(var r=i.replace(/[- ]/g,""),n=0;r.length>n;n++)for(var s of Ur){var a=n+s;if(r.length>=a){var o=r.slice(n,a);if(Hr.test(o)&&Zr(o))return!0}}}return!1}(t);if(i)return!1;var r=e?Wr.test(t):function(t){var e;for(Vr.lastIndex=0;e=Vr.exec(t);){var i=e[1],r=e[3];if(!(i&&r&&Gr.test(i)&&Gr.test(r)))return!0}return!1}(t);if(r)return!1}return!0}function Jr(t){var e=Cr(t);return Qr(e=(e+" "+Kr(t)).trim())?e:""}function Kr(t){var e="";return t&&t.childNodes&&t.childNodes.length&&Ui(t.childNodes,(function(t){var i;if(t&&"span"===(null==(i=t.tagName)?void 0:i.toLowerCase()))try{var r=Cr(t);e=(e+" "+r).trim(),t.childNodes&&t.childNodes.length&&(e=(e+" "+Kr(t)).trim())}catch(t){Bi.error("[AutoCapture]",t)}})),e}function Yr(t){return t.replace(/"|\\"/g,'\\"')}function Xr(t){var e=t.attr__class;if(e)return G(e)?e:wr(e)}var tn="[SessionRecording]",en="redacted",rn=1e6;function nn(t){var e;return Math.min(rn,null!==(e=t.payloadSizeLimitBytes)&&void 0!==e?e:rn)}var sn={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:rn,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},an=["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"],ln=["auth","token","secret","session","api-key","apikey","api_key","credential","password","passwd","cookie","csrf","xsrf"],un=t=>{et(t)||Ui(Object.keys(t),(e=>{(t=>{var e=t.toLowerCase();return an.includes(e)||ln.some((t=>e.includes(t)))})(e)&&(t[e]=en)}))},hn=["/s/","/e/","/i/"];function dn(t,e,i,r){if(et(t))return t;var n=(null==e?void 0:e["content-length"])||function(t){return new Blob([t]).size}(t);return Y(n)&&(n=parseInt(n)),n>i?tn+" "+r+" body too large to record ("+n+" bytes)":t}function vn(t,e){if(et(t))return t;var i=t;return Qr(i,!1)||(i=tn+" "+e+" body "+en),Ui(on,(t=>{var r,n;null!=(r=i)&&r.length&&-1!==(null==(n=i)?void 0:n.indexOf(t))&&(i=tn+" "+e+" body "+en+" as might contain: "+t)})),i}var cn=new WeakSet,fn="$people_distinct_id",pn="distinct_id",gn="$device_id",mn="$device_model",yn="__alias",bn="__timers",_n="$autocapture_disabled_server_side",wn="$heatmaps_enabled_server_side",kn="$exception_capture_enabled_server_side",Sn="$error_tracking_suppression_rules",xn="$error_tracking_capture_extension_exceptions",Cn="$web_vitals_enabled_server_side",Tn="$dead_clicks_enabled_server_side",Mn="$product_tours_enabled_server_side",En="$logs_capture_enabled_server_side",In="$web_vitals_allowed_metrics",Rn="$session_recording_remote_config",Pn="$replay_sample_rate",An="$replay_override_sampling",Fn="$replay_override_linked_flag",On="$replay_override_url_trigger",Ln="$replay_override_event_trigger",Dn="$sesid",$n="$session_is_sampled",Nn="$session_past_minimum_duration",qn="$session_recording_url_trigger_activated_session",jn="$session_recording_event_trigger_activated_session",Bn="$posthog_sr_group_event_trigger_",Hn="$posthog_sr_group_url_trigger_",zn="$posthog_sr_group_sampling_",Un="$debug_first_full_snapshot_timestamp",Wn="$sess_rec_flush_size",Vn="$enabled_feature_flags",Gn="$active_feature_flags",Zn="$early_access_features",Qn="$feature_flag_details",Jn="$feature_flag_payloads",Kn="$feature_flag_request_id",Yn="$minimal_flag_called_events",Xn="$override_feature_flags",ts="$override_feature_flag_payloads",es="$stored_person_properties",is="$stored_group_properties",rs="$groups",ns="$surveys",ss="$surveys_loaded_at",as="$surveys_activated",os="$surveys_activated_session",ls="$surveys_activated_timestamps",us="ph_product_tours",hs="$flag_call_reported",ds="$flag_call_reported_session_id",vs="$feature_flag_errors",cs="$feature_flag_evaluated_at",fs="$user_state",ps="$client_session_props",gs="$capture_rate_limit",ms="$initial_campaign_params",ys="$initial_referrer_info",bs="$initial_person_info",_s="$epp",ws="$posthog_cookieless",ks="$cookieless_mode",Ss="$sdk_debug_extensions_init_method",xs="$sdk_debug_extensions_init_time_ms",Cs="$sdk_debug_recording_script_not_loaded",Ts="$sdk_debug_replay_event_trigger_status",Ms="$sdk_debug_replay_linked_flag_trigger_status",Es="$sdk_debug_replay_matched_recording_trigger_groups",Is="$sdk_debug_replay_pending_trigger_conditions",Rs="$sdk_debug_replay_remote_trigger_matching_config",Ps="$sdk_debug_replay_trigger_groups_count",As="$sdk_debug_replay_url_trigger_status",Fs="$session_recording_start_reason",Os="PostHog loadExternalDependency extension not found.",Ls="on_reject",Ds="always",$s="anonymous",Ns="identified",qs="identified_only",js="visibilitychange",Bs="beforeunload",Hs="$pageview",zs="$pageleave",Us="$identify",Ws="$groupidentify",Vs="disabled",Gs="sampled",Zs="active",Qs="buffering",Js="paused",Ks="lazy_loading",Ys="awaiting_config",Xs="missing_config",ta="rrweb_error",ea="trigger",ia=ea+"_activated",ra=ea+"_pending",na=ea+"_"+Vs;function sa(t,e,i,r,n,s){return 0===e?na:(null==t?void 0:t.get_property(i?r+i:n))===s?ia:ra}function aa(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 oa(t){return t.includes(ia)?ia:t.includes(ra)?ra:na}function la(t){var e=new Set(t);switch(e.delete(na),e.size){case 0:return na;case 1:return Array.from(e)[0];default:return ra}}class ua{constructor(t){this.F=t}triggerStatus(t){return oa(this.F.map((e=>e.triggerStatus(t))))}triggerStatusNoSideEffects(t){return oa(this.F.map((e=>e.triggerStatusNoSideEffects(t))))}stop(){this.F.forEach((t=>t.stop()))}}class ha{constructor(t){this.F=t}triggerStatus(t){return la(this.F.map((e=>e.triggerStatus(t))))}triggerStatusNoSideEffects(t){return la(this.F.map((e=>e.triggerStatusNoSideEffects(t))))}stop(){this.F.forEach((t=>t.stop()))}}class da{triggerStatus(){return this.triggerStatusNoSideEffects()}triggerStatusNoSideEffects(){return ia}stop(){}}var va=t=>"sessionRecording"in t;class ca{constructor(t,e){this.N=[],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.N=(va(t)?Q(t.sessionRecording)?null==(e=t.sessionRecording)?void 0:e.urlTriggers:[]:null==t?void 0:t.urlTriggers)||[],this.q=(va(t)?Q(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.N))if("regex"===t.matching&&!this.j.has(t.url))try{this.j.set(t.url,new RegExp(t.url))}catch(e){Bi.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){Bi.error("Invalid URL blocklist regex pattern:",e.url,t)}}onRemoteConfig(t){this.onConfig(t)}W(t){return sa(this._instance,this.N.length,this.$,Hn,qn,t)}triggerStatus(t){var e=this.triggerStatusNoSideEffects(t);return this._instance.register_for_session({[As]:e}),e}triggerStatusNoSideEffects(t){return this.W(t)}isCurrentUrlBlocked(){var t=hr(this._instance);if(!t)return!1;try{return aa(t,this.q,this.B)}catch(t){return!0}}checkUrlBlocklist(t,e){var i=hr(this._instance);if(i&&i!==this.H){this.H=i;var r=this.urlBlocked,n=aa(i,this.q,this.B);r&&n||(n&&!r?t():!n&&r&&e())}}checkUrlTriggerConditions(t,e,i,r){var n=hr(this._instance);if(n&&n!==this.H){this.H=n;var s=this.urlBlocked,a=aa(n,this.q,this.B);a&&!s?t():!a&&s&&e();var o=this.W(r)===ia,l=aa(n,this.N,this.j);!o&&l&&i("url",n)}}stop(){this.H=""}}class fa{constructor(t){this.linkedFlag=null,this.linkedFlagSeen=!1,this.V=()=>{},this._instance=t}triggerStatus(){var t=this.triggerStatusNoSideEffects();return this._instance.register_for_session({[Ms]:t}),t}triggerStatusNoSideEffects(){var t=ra;return et(this.linkedFlag)&&(t=na),this.linkedFlagSeen&&(t=ia),t}onConfig(t,e){var i;if(this.linkedFlag=(va(t)?Q(t.sessionRecording)?null==(i=t.sessionRecording)?void 0:i.linkedFlag:null:null==t?void 0:t.linkedFlag)||null,!et(this.linkedFlag)&&!this.linkedFlagSeen){var r=Y(this.linkedFlag)?this.linkedFlag:this.linkedFlag.flag,n=Y(this.linkedFlag)?null:this.linkedFlag.variant;this.V=this._instance.onFeatureFlags(((t,i)=>{var s=!1;if(Q(i)&&r in i){var a=i[r];s=nt(a)?!0===a:n?a===n:!!a}var o=s&&!this.linkedFlagSeen;this.linkedFlagSeen=s,o&&e(r,n)}))}}onRemoteConfig(t,e){this.onConfig(t,e)}stop(){this.V()}}class pa{constructor(t,e){this.Z=[],this._instance=t,this.$=e}onConfig(t){var e;this.Z=(va(t)?Q(t.sessionRecording)?null==(e=t.sessionRecording)?void 0:e.eventTriggers:[]:null==t?void 0:t.eventTriggers)||[]}onRemoteConfig(t){this.onConfig(t)}G(t){return sa(this._instance,this.Z.length,this.$,Bn,jn,t)}triggerStatus(t){var e=this.triggerStatusNoSideEffects(t);return this._instance.register_for_session({[Ts]:e}),e}triggerStatusNoSideEffects(t){return this.G(t)}checkEventTriggerConditions(t,e,i){if(0!==this.Z.length){var r=this.G(i)===ia,n=this.Z.includes(t);!r&&n&&e("event",t)}}stop(){}}class ga{constructor(t,e,i){if(this._instance=t,this.group=e,this.J=new ca(t,e.id),this.Y=new pa(t,e.id),this.K=new fa(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.J.onConfig(n),this.Y.onConfig(n),this.K.onConfig(n,i);var s=[this.Y,this.J,this.K];this.X="any"===e.conditions.matchType?new ua(s):new ha(s)}else this.X=new da}triggerStatus(t){return this.X.triggerStatus(t)}triggerStatusNoSideEffects(t){return this.X.triggerStatusNoSideEffects(t)}getPendingTriggerConditions(t){return this.triggerStatusNoSideEffects(t)!==ra?[]:[{label:"URL condition not matched",status:this.J.triggerStatusNoSideEffects(t)},{label:"event condition not matched",status:this.Y.triggerStatusNoSideEffects(t)},{label:"linked flag condition not matched",status:this.K.triggerStatusNoSideEffects()}].filter((t=>t.status===ra)).map((t=>t.label))}checkEventTriggerConditions(t,e,i){this.Y.checkEventTriggerConditions(t,e,i)}checkUrlTriggerConditions(t,e,i,r){this.J.checkUrlTriggerConditions(t,e,i,r)}activateTrigger(t,e){var i;null==(i=this._instance.persistence)||i.register({["url"===t?Hn+this.group.id:Bn+this.group.id]:e})}stop(){this.J.stop(),this.Y.stop(),this.K.stop()}}function ma(t){if(t.rrwebError)return ta;if(!t.receivedFlags)return Qs;if(!t.isRecordingEnabled)return Vs;if(t.urlTriggerMatching.urlBlocked)return Js;var e=!0===t.isSampled,i=new ua([t.eventTriggerMatching,t.urlTriggerMatching,t.linkedFlagMatching]).triggerStatus(t.sessionId);return e?Gs:i===ia?Zs:i===ra?Qs:!1===t.isSampled?Vs:Zs}function ya(t){if(t.rrwebError)return ta;if(!t.receivedFlags)return Qs;if(!t.isRecordingEnabled)return Vs;if(t.urlTriggerMatching.urlBlocked)return Js;var e=new ha([t.eventTriggerMatching,t.urlTriggerMatching,t.linkedFlagMatching]).triggerStatus(t.sessionId),i=e!==na,r=nt(t.isSampled);return i&&e===ra?Qs:i&&e===na||r&&!t.isSampled?Vs:!0===t.isSampled?Gs:Zs}function ba(){var t=[];return function(e,i){if(Q(i)||G(i)){for(;t.length>0&&t[t.length-1]!==this;)t.pop();return t.includes(i)?"[Circular]":(t.push(i),i)}return i}}function _a(t){var e=JSON.stringify(t,ba());return e?new Blob([e]).size:0}function wa(t){if(tt(t))return 4;if(K(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(G(t)){for(var e=2,i=0;t.length>i;i++){i>0&&(e+=1);var r=t[i];e+=K(r)||tt(r)?4:wa(r)}return e}var n=t,s=2,a=!0;for(var o in n)if({}.hasOwnProperty.call(n,o)){var l=n[o];K(l)||(a||(s+=1),a=!1,s+=o.length+3+wa(l))}return s;default:return 0}}function ka(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[ka({size:r.reduce(((t,e)=>t+e),0),data:t.data.slice(0,i),sizes:r,sessionId:t.sessionId,windowId:t.windowId}),ka({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 Sa=Uint8Array,xa=Uint16Array,Ca=Uint32Array,Ta=new Sa([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]),Ma=new Sa([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]),Ea=new Sa([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),Ia=function(t,e){for(var i=new xa(31),r=0;31>r;++r)i[r]=e+=1<<t[r-1];var n=new Ca(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]},Ra=Ia(Ta,2),Pa=Ra[1];Ra[0][28]=258,Pa[258]=28;for(var Aa=Ia(Ma,0)[1],Fa=new xa(32768),Oa=0;32768>Oa;++Oa){var La=(43690&Oa)>>>1|(21845&Oa)<<1;Fa[Oa]=((65280&(La=(61680&(La=(52428&La)>>>2|(13107&La)<<2))>>>4|(3855&La)<<4))>>>8|(255&La)<<8)>>>1}var Da=function(t,e,i){for(var r=t.length,n=0,s=new xa(e);r>n;++n)++s[t[n]-1];var a,o=new xa(e);for(n=0;e>n;++n)o[n]=o[n-1]+s[n-1]<<1;if(i){a=new xa(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=o[t[n]-1]++<<h,v=d|(1<<h)-1;v>=d;++d)a[Fa[d]>>>l]=u}else for(a=new xa(r),n=0;r>n;++n)a[n]=Fa[o[t[n]-1]++]>>>15-t[n];return a},$a=new Sa(288);for(Oa=0;144>Oa;++Oa)$a[Oa]=8;for(Oa=144;256>Oa;++Oa)$a[Oa]=9;for(Oa=256;280>Oa;++Oa)$a[Oa]=7;for(Oa=280;288>Oa;++Oa)$a[Oa]=8;var Na=new Sa(32);for(Oa=0;32>Oa;++Oa)Na[Oa]=5;var qa=Da($a,9,0),ja=Da(Na,5,0),Ba=function(t){return(t/8>>0)+(7&t&&1)},Ha=function(t,e,i){(null==i||i>t.length)&&(i=t.length);var r=new(t instanceof xa?xa:t instanceof Ca?Ca:Sa)(i-e);return r.set(t.subarray(e,i)),r},za=function(t,e,i){var r=e/8>>0;t[r]|=i<<=7&e,t[r+1]|=i>>>8},Ua=function(t,e,i){var r=e/8>>0;t[r]|=i<<=7&e,t[r+1]|=i>>>8,t[r+2]|=i>>>16},Wa=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 Sa(0),0];if(1==n){var a=new Sa(i[0].s+1);return a[i[0].s]=1,[a,1]}i.sort((function(t,e){return t.f-e.f})),i.push({s:-1,f:25001});var o=i[0],l=i[1],u=0,h=1,d=2;for(i[0]={s:-1,f:o.f+l.f,l:o,r:l};h!=n-1;)o=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:o.f+l.f,l:o,r:l};var v=s[0].s;for(r=1;n>r;++r)s[r].s>v&&(v=s[r].s);var c=new xa(v+1),f=Va(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 b=s[r].s;e>c[b]?p-=1<<e-c[b]++-1:++r}for(;r>=0&&p;--r){var _=s[r].s;c[_]==e&&(--c[_],++p)}f=e}return[new Sa(c),f]},Va=function(t,e,i){return-1==t.s?Math.max(Va(t.l,e,i+1),Va(t.r,e,i+1)):e[t.s]=i},Ga=function(t){for(var e=t.length;e&&!t[--e];);for(var i=new xa(++e),r=0,n=t[0],s=1,a=function(t){i[r++]=t},o=1;e>=o;++o)if(t[o]==n&&o!=e)++s;else{if(!n&&s>2){for(;s>138;s-=138)a(32754);s>2&&(a(s>10?s-11<<5|28690:s-3<<5|12305),s=0)}else if(s>3){for(a(n),--s;s>6;s-=6)a(8304);s>2&&(a(s-3<<5|8208),s=0)}for(;s--;)a(n);s=1,n=t[o]}return[i.subarray(0,r),e]},Za=function(t,e){for(var i=0,r=0;e.length>r;++r)i+=t[r]*e[r];return i},Qa=function(t,e,i){var r=i.length,n=Ba(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)},Ja=function(t,e,i,r,n,s,a,o,l,u,h){za(e,h++,i),++n[256];for(var d=Wa(n,15),v=d[0],c=d[1],f=Wa(s,15),p=f[0],g=f[1],m=Ga(v),y=m[0],b=m[1],_=Ga(p),w=_[0],k=_[1],S=new xa(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=Wa(S,7),T=C[0],M=C[1],E=19;E>4&&!T[Ea[E-1]];--E);var I,R,P,A,F=u+5<<3,O=Za(n,$a)+Za(s,Na)+a,L=Za(n,v)+Za(s,p)+a+14+3*E+Za(S,T)+(2*S[16]+3*S[17]+7*S[18]);if(O>=F&&L>=F)return Qa(e,h,t.subarray(l,l+u));if(za(e,h,1+(O>L)),h+=2,O>L){I=Da(v,c,0),R=v,P=Da(p,g,0),A=p;var D=Da(T,M,0);for(za(e,h,b-257),za(e,h+5,k-1),za(e,h+10,E-4),h+=14,x=0;E>x;++x)za(e,h+3*x,T[Ea[x]]);h+=3*E;for(var N=[y,w],q=0;2>q;++q){var j=N[q];for(x=0;j.length>x;++x)za(e,h,D[B=31&j[x]]),h+=T[B],B>15&&(za(e,h,j[x]>>>5&127),h+=j[x]>>>12)}}else I=qa,R=$a,P=ja,A=Na;for(x=0;o>x;++x)if(r[x]>255){var B;Ua(e,h,I[257+(B=r[x]>>>18&31)]),h+=R[B+257],B>7&&(za(e,h,r[x]>>>23&31),h+=Ta[B]);var H=31&r[x];Ua(e,h,P[H]),h+=A[H],H>3&&(Ua(e,h,r[x]>>>5&8191),h+=Ma[H])}else Ua(e,h,I[r[x]]),h+=R[r[x]];return Ua(e,h,I[256]),h+R[256]},Ka=new Ca([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),Ya=function(){for(var t=new Ca(256),e=0;256>e;++e){for(var i=e,r=9;--r;)i=(1&i&&3988292384)^i>>>1;t[e]=i}return t}(),Xa=function(){var t=4294967295;return{p(e){for(var i=t,r=0;e.length>r;++r)i=Ya[255&i^e[r]]^i>>>8;t=i},d:()=>4294967295^t}},to=function(t,e,i,r,n){return function(t,e,i,r,n,s){var a=t.length,o=new Sa(r+a+5*(1+Math.floor(a/7e3))+n),l=o.subarray(r,o.length-n),u=0;if(!e||8>a)for(var h=0;a>=h;h+=65535){var d=h+65535;a>d?u=Qa(l,u,t.subarray(h,d)):(l[h]=true,u=Qa(l,u,t.subarray(h,a)))}else{for(var v=Ka[e-1],c=v>>>13,f=8191&v,p=(1<<i)-1,g=new xa(32768),m=new xa(p+1),y=Math.ceil(i/3),b=2*y,_=function(e){return(t[e]^t[e+1]<<y^t[e+2]<<b)&p},w=new Ca(25e3),k=new xa(288),S=new xa(32),x=0,C=0,T=(h=0,0),M=0,E=0;a>h;++h){var I=_(h),R=32767&h,P=m[I];if(g[R]=P,m[I]=R,h>=M){var A=a-h;if((x>7e3||T>24576)&&A>423){u=Ja(t,l,0,w,k,S,C,T,E,h-E,u),T=x=C=0,E=h;for(var F=0;286>F;++F)k[F]=0;for(F=0;30>F;++F)S[F]=0}var O=2,L=0,D=f,N=R-P&32767;if(A>2&&I==_(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+O]==t[h+O-N]){for(var H=0;B>H&&t[h+H]==t[h+H-N];++H);if(H>O){if(O=H,L=N,H>q)break;var z=Math.min(N,H-2),U=0;for(F=0;z>F;++F){var W=h-N+F+32768&32767,V=W-g[W]+32768&32767;V>U&&(U=V,P=W)}}}N+=(R=P)-(P=g[R])+32768&32767}if(L){w[T++]=268435456|Pa[O]<<18|Aa[L];var G=31&Pa[O],Z=31&Aa[L];C+=Ta[G]+Ma[Z],++k[257+G],++S[Z],M=h+O,++x}else w[T++]=t[h],++k[t[h]]}}u=Ja(t,l,true,w,k,S,C,T,E,h-E,u)}return Ha(o,0,r+Ba(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)},eo=function(t,e,i){for(;i;++e)t[e]=i,i>>>=8},io=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&&eo(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)}},ro=function(t){return 10+(t.filename&&t.filename.length+1||0)};function no(t,e){void 0===e&&(e={});var i=Xa(),r=t.length;i.p(t);var n=to(t,e,ro(e),8),s=n.length;return io(n,e),eo(n,s-8,i.d()),eo(n,s-4,r),n}function so(t,e){var i=t.length;if("undefined"!=typeof TextEncoder)return(new TextEncoder).encode(t);for(var r=new Sa(t.length+(t.length>>>1)),n=0,s=function(t){r[n++]=t},a=0;i>a;++a){if(n+5>r.length){var o=new Sa(n+8+(i-a<<1));o.set(r),r=o}var l=t.charCodeAt(a);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(++a))>>>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 Ha(r,0,n)}function ao(t,e){for(var i="",r=0;t.length>r;){var n=t[r++];i+=String.fromCharCode(n)}return i}class oo{constructor(t,e){var i,r,n,s;void 0===e&&(e={}),this.ee={},this.te=Date.now(),this.re=-1/0,this.ie=()=>{var t=Date.now(),e=t-this.te;e>0?(this.ne=Math.min(this.ae,this.ne+e/1e3*this.oe),this.te=t):this.te=t},this.se=t=>{if(!this.ee[t]){var e,i;this.ee[t]=!0;var r=this.ue(t);null==(e=(i=this.le).onBlockedNode)||e.call(i,t,r)}},this.he=t=>{var e=this.ue(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.ue=t=>this._rrweb.mirror.getNode(t),this.ce=t=>{var e,i,r,n,s,a,o,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==(a=t.texts)?void 0:a.length)&&void 0!==s?s:0)+(null!==(o=null==(l=t.adds)?void 0:l.length)&&void 0!==o?o:0)},this.throttleMutations=t=>{if(3!==t.type||0!==t.data.source)return t;var e=t.data,i=this.ce(e);if(e.attributes){var r=e.attributes.length;e.attributes=e.attributes.filter((t=>{var e=this.he(t.id);return!this.de.consumeRateLimit(e[0])&&t}));var n,s,a=r-e.attributes.length;a>0&&(null==(n=(s=this.le).onDroppedAttributeMutations)||n.call(s,a))}var o=this.ce(e);if(0!==o||i===o){if(this.ve)return t;this.ie();var l,u,h=wa(t);return h>this.ne?(null==(l=(u=this.le).onDroppedOversizedMutation)||l.call(u,h),void this.fe()):(this.ne-=h,t)}},this.fe=()=>{if(!this.pe){var t=Math.max(0,this.ge-(Date.now()-this.re));this.pe=setTimeout((()=>{var t,e;this.pe=void 0,this.re=Date.now(),null==(t=(e=this.le).requestFullSnapshot)||t.call(e)}),t)}},this._rrweb=t,this.le=e,this.de=new mt({bucketSize:null!==(i=this.le.bucketSize)&&void 0!==i?i:100,refillRate:null!==(r=this.le.refillRate)&&void 0!==r?r:10,refillInterval:1e3,S:this.se,I:Bi}),this.ae=null!==(n=this.le.bytesBucketSize)&&void 0!==n?n:0,this.oe=null!==(s=this.le.bytesRefillRate)&&void 0!==s?s:25600,this.ve=!Number.isFinite(this.ae)||0>=this.ae,this.ne=this.ae;var a=this.le.resyncIntervalMs;this.ge=it(a)&&Number.isFinite(a)&&a>0?a:3e5}reset(){this.ee={},this.pe&&(clearTimeout(this.pe),this.pe=void 0),this.re=Date.now()}stop(){this.de.stop(),this.reset(),this.ne=this.ae,this.te=Date.now(),this.re=-1/0}}qi.DEBUG=!1,qi.LIB_VERSION="1.422.3",qi.LIB_NAME="web";class lo{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.me=t.get_property.bind(t),this.ye=t.persistence.set_property.bind(t.persistence)}trackSize(t,e){this.ye(Wn,{sessionId:t,size:this.currentTrackedSize(t)+e})}currentTrackedSize(t){var e,i=this.me(Wn);return Q(e=i)&&Y(e.sessionId)&&it(e.size)&&i.sessionId===t?i.size:0}}function uo(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<gt(100*e,0,100,Bi)}function ho(t){return"$survey_response_"+t}function vo(t,e){if(!e)return null;var i=t[ho(e)];return G(i)?[...i]:i}function co(t,e){void 0===t&&(t={});var i={};return e.questions.forEach((e=>{if(!K(e.originalQuestionIndex)){var r,n=0===(r=e.originalQuestionIndex)?"$survey_response":"$survey_response_"+r,s=vo(t,e.id);K(s)||(i[n]=s)}})),p({$survey_questions:e.questions.map((e=>({id:e.id,question:e.question,response:vo(t,e.id)})))},t,i)}function fo(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 po(t){return"string"==typeof t&&t.trim()?t.trim():null}function go(t){return t.toLowerCase()}function mo(t,e,i){if(!t||!e)return null;var r=go(e),n=Object.keys(t).find((t=>go(t)===r));if(n)return null==i||i.debug("Found exact translation match: "+n),n;if(r.includes("-")){var s=r.split("-")[0],a=Object.keys(t).find((t=>go(t)===s));if(a)return null==i||i.debug("Found base language translation match: "+a+" (from "+e+")"),a}return null}var yo=["thankYouMessageHeader","thankYouMessageDescription","thankYouMessageCloseButtonText","introScreenHeader","introScreenDescription","introScreenButtonText","submitButtonText","backButtonText"];function bo(t,e,i){var r,n=mo(t.translations,e,i),s=p({},t),a=!1;if(n){var o,l=null==(o=t.translations)?void 0:o[n];if(l)if(null==i||i.info("Applying survey-level translation for language: "+n),K(l.name)||(s.name=l.name,a=!0),s.appearance){var u=p({},s.appearance);for(var h of yo){var d=l[h];K(d)||(u[h]=d,a=!0)}s.appearance=u}else(function(t){return yo.some((e=>!K(t[e])))})(l)&&(a=!0)}var v=t.questions.map((t=>function(t,e,i){var r,n=mo(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 a=p({},t),o=!1;return K(s.question)||(a.question=s.question,o=!0),K(s.description)||(a.description=s.description,o=!0),K(s.buttonText)||(a.buttonText=s.buttonText,o=!0),"link"in a&&!K(s.link)&&(a.link=s.link,o=!0),"lowerBoundLabel"in a&&!K(s.lowerBoundLabel)&&(a.lowerBoundLabel=s.lowerBoundLabel,o=!0),"upperBoundLabel"in a&&!K(s.upperBoundLabel)&&(a.upperBoundLabel=s.upperBoundLabel,o=!0),"choices"in a&&function(t){return G(t.choices)}(s)&&(a.choices=s.choices,o=!0),{question:o?a:t,matchedKey:o?n:null,hasChanges:o}}(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,a=!0,null==i||i.info("Applied question-level translations for language: "+e)),{survey:s,matchedKey:a?n||g:null}}function _o(t){var e;return!(null==(e=t.conditions)||null==(e=e.events)||null==(e=e.values)||!e.length)}function wo(t){var e;return _o(t)&&!(null==(e=t.conditions)||null==(e=e.events)||!e.repeatedActivation)||"always"===t.schedule}var ko=(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}},So=t=>t.toLowerCase(),xo={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=>ko(e,t))))),not_regex:(t,e)=>e.every((e=>t.every((t=>!ko(e,t))))),icontains:(t,e)=>e.map(So).some((e=>t.map(So).some((t=>e.includes(t))))),not_icontains:(t,e)=>e.map(So).every((e=>t.map(So).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 Co(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=xo[i.operator];return!!n&&n(i.values,[String(r)])}))}function To(t,e,i){return er({distinct_id:t,userPropertiesToSet:e,userPropertiesToSetOnce:i})}var Mo=new Set(["is_not","not_icontains","not_regex"]);function Eo(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(K(n)||tt(n))return Mo.has(s);var a=xo[s];return!!a&&!K(t.value)&&!tt(t.value)&&a(G(t.value)?t.value.map(String):[String(t.value)],G(n)?n.map(String):[String(n)])}))}var Io=Hi("[SessionRecording]");function Ro(t,e){return e?t:"!"+t}function Po(t,e){return t===e||t!=="!"+e&&null}class Ao{constructor(t,e,i,r,n,s,a){this.be=null,this.we=ya,this._instance=t,this.J=e,this.Y=i,this.K=r,this.ke=n,this._e=s,this.Se=a}onRemoteConfig(t){this.be=it(t.sampleRate)?t.sampleRate:null,"any"===t.triggerMatchType?(this.xe=new ua([this.Y,this.J]),this.we=ma):(this.xe=new ha([this.Y,this.J]),this.we=ya),this._instance.register_for_session({[Rs]:t.triggerMatchType}),this.J.onConfig(t),this.Y.onConfig(t),this.K.onConfig(t,((t,e)=>{this.ke("linked_flag_matched",{flag:t,variant:e}),this.Se()}))}getStatus(t){return this.we({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 it(i)?i:null}checkUrlTriggers(t,e,i,r){this.J.checkUrlTriggerConditions(e,i,r,t)}setupEventTriggerListeners(t,e,i){if(0!==this.Y.Z.length&&et(this.Ce))return this.Ce=t((t=>{try{this.Y.checkEventTriggerConditions(t.event,i,e)}catch(t){Io.error("Could not activate event trigger",t)}})),this.Ce}makeSamplingDecisions(t){var e,i,r,n=this.be;if(!it(n))return null==(i=this._instance.persistence)||i.unregister($n),void(null==(r=this._instance.persistence)||r.unregister(Pn));var s=this._instance.get_property($n),a=this._instance.get_property(Pn),o=Po(s,t),l=it(a)&&a!==n,u=K(a)&&s===t,h=l||u||!nt(o),d=h?uo(t,n):o;h&&(d?this.ke("sampled"):Io.warn("Sample rate ("+n+") has determined that this sessionId ("+t+") will not be sent to the server.")),null==(e=this._instance.persistence)||e.register({[$n]:Ro(t,d),[Pn]:tt(a)&&s===t?null:n})}ensureSamplingDecision(t){if(it(this.be)){var e=this._instance.get_property($n);nt(Po(e,t))||this.makeSamplingDecisions(t)}}onFlushComplete(){}clearConditionalRecordingPersistence(){var t,e,i,r,n;null==(t=this._instance.persistence)||t.unregister(jn),null==(e=this._instance.persistence)||e.unregister(qn),null==(i=this._instance.persistence)||i.unregister($n),null==(r=this._instance.persistence)||r.unregister(Pn),null==(n=this._instance.persistence)||n.unregister(Nn)}updateActiveTriggers(t){}hasPendingTriggers(t){var e;return(null==(e=this.xe)?void 0:e.triggerStatus(t))===ra}getPendingTriggerConditions(t){return[{label:"URL condition not matched",status:this.J.triggerStatusNoSideEffects(t)},{label:"event condition not matched",status:this.Y.triggerStatusNoSideEffects(t)},{label:"linked flag condition not matched",status:this.K.triggerStatusNoSideEffects()}].filter((t=>t.status===ra)).map((t=>t.label))}stop(){var t;null==(t=this.Ce)||t.call(this),this.Ce=void 0,this.Y.stop(),this.J.stop(),this.K.stop()}}class Fo{constructor(t,e,i,r,n){this.Me=[],this.Te=new Map,this.Ie=!1,this._instance=t,this.J=e,this.ke=i,this.Ee=r,this.Se=n}onRemoteConfig(t){t.triggerGroups&&0!==t.triggerGroups.length?(this.Re(t.triggerGroups),this._instance.register_for_session({[Rs]:"v2_trigger_groups",[Ps]:t.triggerGroups.length}),this.J.onConfig(t)):Io.warn("[V2Strategy] No trigger groups configured")}getStatus(t){return function(t){if(t.rrwebError)return ta;if(t.urlTriggerMatching.urlBlocked)return Js;var e=t.triggerGroupMatchers,i=t.triggerGroupSamplingResults;if(0===e.length)return Vs;var r=!1,n=!1;for(var s of e){var a=s.triggerStatus(t.sessionId);if(a===ia){var o=s.group.id,l=i.get(o);K(l)?Bi.warn("[V2 Triggers] Group activated but no sampling decision found",{groupId:o}):!0===l&&(n=!0)}else a===ra&&(r=!0)}return n?Gs:r?Qs:Vs}({isSampled:t.isSampled,rrwebError:t.rrwebError,urlTriggerMatching:t.urlTriggerMatching,eventTriggerMatching:t.eventTriggerMatching,linkedFlagMatching:t.linkedFlagMatching,sessionId:t.sessionId,triggerGroupMatchers:this.Me,triggerGroupSamplingResults:this.Te,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;it(r)&&(tt(e)||e>r)&&(e=r)}return e}checkUrlTriggers(t,e,i,r){var n=this;this.J.checkUrlBlocklist(e,i);var s=function(r){r.checkUrlTriggerConditions(e,i,(e=>{n.Ae(r,void 0)&&(r.activateTrigger(e,t),n.updateActiveTriggers(t),n.Se(e))}),t)};for(var a of this.Me)s(a)}setupEventTriggerListeners(t,e,i){var r=this;return this.Ce=t((t=>{var i;if(this.Ie)return Io.info("[SessionRecorder] Stopping trigger checks - initial buffer flushed"),null==(i=this.Ce)||i.call(this),void(this.Ce=void 0);try{var n=function(i){i.checkEventTriggerConditions(t.event,(n=>{if(r.Ae(i,t.properties)){var s=(i.group.conditions.events||[]).filter((e=>e.name===t.event)),a=r._instance.get_property(es),o=s.some((e=>!e.properties||0===e.properties.length||Eo(e.properties,t.properties,a)));o&&(i.activateTrigger(n,e),r.updateActiveTriggers(e),r.Se(n))}}),e)};for(var s of this.Me)n(s)}catch(t){Io.error("Could not activate event trigger for trigger groups",t)}})),this.Ce}makeSamplingDecisions(t){for(var e of this.Me){var i,r=e.group,n=r.id,s=r.sampleRate,a=zn+n,o=this._instance.get_property(a),l=null,u=!1,h=!1,d=!1;if(Q(o)){var v=o.sessionId,c=o.sampleRate,f=o.sampled;u="string"==typeof v&&v!==t,h=it(c)&&c!==s,l=v===t&&it(c)&&c===s&&nt(f)?f:null}else l=o===t||null,u="string"==typeof o&&o!==t,d=o===t;var p=u||h||d||!nt(l),g=p?uo(t+n,s):l;p&&this.Ee("triggerGroupSamplingDecisionMade",{group_id:n,group_name:r.name,sampleRate:s,isSampled:g}),this.Te.set(n,g),null==(i=this._instance.persistence)||i.register({[a]:{sessionId:t,sampleRate:s,sampled:g}})}this.updateActiveTriggers(t)}ensureSamplingDecision(t){}onFlushComplete(){this.Ie=!0}clearConditionalRecordingPersistence(){var t,e,i;for(var r of(null==(t=this._instance.persistence)||t.unregister($n),null==(e=this._instance.persistence)||e.unregister(Pn),null==(i=this._instance.persistence)||i.unregister(Nn),this.Me)){var n,s,a,o=r.group.id;null==(n=this._instance.persistence)||n.unregister(Bn+o),null==(s=this._instance.persistence)||s.unregister(Hn+o),null==(a=this._instance.persistence)||a.unregister(zn+o)}}updateActiveTriggers(t){var e=[];for(var i of this.Me){var r=i.group,n=r.id,s="trigger_activated"===i.triggerStatus(t),a=!0===this.Te.get(n);s&&e.push({id:n,name:r.name,matched:!0,sampled:a})}this._instance.register_for_session({[Es]:e})}hasPendingTriggers(t){for(var e of this.Me)if(e.triggerStatus(t)===ra)return!0;return!1}getPendingTriggerConditions(t){return this.Me.flatMap((e=>e.triggerStatusNoSideEffects(t)!==ra?[]:e.getPendingTriggerConditions(t).map((t=>'trigger group "'+e.group.name+'": '+t))))}stop(){var t;null==(t=this.Ce)||t.call(this),this.Ce=void 0,this.Me.forEach((t=>t.stop())),this.Me=[],this.Te.clear(),this.J.stop()}Ae(t,e){var i=t.group.conditions.properties;return!i||0===i.length||Eo(i,e,this._instance.get_property(es))}Re(t){var e=this;this.Me.forEach((t=>t.stop())),this.Me=[],this.Te.clear();var i=function(t){var i=new ga(e._instance,t,((i,r)=>{e.ke("linked_flag_matched",{flag:i,variant:r,group_id:t.id,group_name:t.name}),e.Se()}));e.Me.push(i)};for(var r of t)i(r)}}var Oo=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}},Lo="https?://(.*)",Do=["gclid","gclsrc","dclid","gbraid","wbraid","fbclid","msclkid","twclid","li_fat_id","igshid","ttclid","rdt_cid","epik","qclid","sccid","irclid","_kx"],$o=["utm_source","utm_medium","utm_campaign","utm_content","utm_term","gad_source","mc_cid",...Do],No="<masked>",qo=["li_fat_id"];function jo(t,e,i){if(!r)return{};var n,s=e?[...Do,...i||[]]:[],a=Bo(sr(r.URL,s,No),t),o=(n={},Ui(qo,(function(t){var e=Oo(t);n[t]=e||null})),n);return Wi(o,a)}function Bo(t,e){var i=$o.concat(e||[]),r={};return Ui(i,(function(e){var i=nr(t,e);r[e]=i||null})),r}function Ho(t){var e=function(t){return t?0===t.search(Lo+"google.([^/?]*)")?"google":0===t.search(Lo+"bing.com")?"bing":0===t.search(Lo+"yahoo.com")?"yahoo":0===t.search(Lo+"duckduckgo.com")?"duckduckgo":null:null}(t),i="yahoo"!=e?"q":"p",n={};if(!tt(e)){n.$search_engine=e;var s=r?nr(r.referrer,i):"";s.length&&(n.ph_keyword=s)}return n}function zo(){return navigator.language||navigator.userLanguage}var Uo="$direct";function Wo(){return(null==r?void 0:r.referrer)||Uo}function Vo(t,e,i){void 0===i&&(i=!1);var r=t?[...Do,...e||[]]:[],s=i?Te(null==n?void 0:n.href):null==n?void 0:n.href,a=null==s?void 0:s.substring(0,1e3);return{r:Wo().substring(0,1e3),u:a?sr(a,r,No):void 0}}function Go(t,e){var i;void 0===e&&(e=!1);var r=t.r,n=t.u,s=e?Te(n):n,a={$referrer:r,$referring_domain:null==r?void 0:r==Uo?Uo:null==(i=ir(r))?void 0:i.host};if(s){a.$current_url=s;var o=ir(s);a.$host=null==o?void 0:o.host,a.$pathname=null==o?void 0:o.pathname;var l=Bo(s);Wi(a,l)}if(r){var u=Ho(r);Wi(a,u)}return a}function Zo(){try{return Intl.DateTimeFormat().resolvedOptions().timeZone}catch(t){return}}function Qo(){try{return(new Date).getTimezoneOffset()}catch(t){return}}var Jo=1e5,Ko="https://schema.org",Yo=[],Xo="actionStatus availability bestRating contentRating encodingFormat eventAttendanceMode eventStatus highPrice inLanguage isAccessibleForFree isFamilyFriendly itemCondition itemListOrder lowPrice maximumAttendeeCapacity nonprofitStatus numberOfItems offerCount position price priceCurrency priceValidUntil publicAccess ratingCount ratingValue reviewCount smokingAllowed worstRating".split(" "),tl="Action BorrowAction ReadAction SearchAction SeekToAction SolveMathAction WatchAction".split(" "),el="AutoDealer Bakery BarOrPub CafeOrCoffeeShop CollegeOrUniversity Corporation DaySpa Dentist EducationalOrganization Electrician FoodEstablishment GovernmentOrganization HealthClub Hotel LegalService Library LibrarySystem LocalBusiness Locksmith LodgingBusiness MedicalBusiness NGO OnlineStore Organization PerformingGroup Pharmacy Physician Plumber RealEstateAgent Restaurant School SportsOrganization Store".split(" "),il="Accommodation AdministrativeArea Country Place State".split(" "),rl={AggregateOffer:{offers:["Offer"]},Brand:{name:!0},BreadcrumbList:{itemListElement:["ListItem"]},CreativeWork:{genre:!0,dateCreated:!0,dateModified:!0,datePublished:!0,expires:!0,learningResourceType:!0,educationalLevel:!0,educationalUse:!0,interactivityType:!0,aggregateRating:["AggregateRating"],potentialAction:tl,publisher:el},Event:{startDate:!0,endDate:!0,previousStartDate:!0,aggregateRating:["AggregateRating"],offers:["AggregateOffer","Offer"]},ItemList:{itemListElement:["ListItem"]},ListItem:{item:Yo},Offer:{seller:el},Organization:{name:!0,legalName:!0,foundingDate:!0,dissolutionDate:!0,aggregateRating:["AggregateRating"],brand:["Brand"]},Person:{},Place:{aggregateRating:["AggregateRating"]},Product:{name:!0,sku:!0,mpn:!0,gtin:!0,gtin8:!0,gtin12:!0,gtin13:!0,gtin14:!0,productID:!0,productGroupID:!0,asin:!0,model:!0,category:!0,color:!0,material:!0,pattern:!0,size:!0,productionDate:!0,releaseDate:!0,brand:["Brand","Organization"],manufacturer:el,offers:["Offer","AggregateOffer"],aggregateRating:["AggregateRating"]},Service:{name:!0,serviceType:!0,category:!0,provider:el,areaServed:il,offers:["AggregateOffer","Offer"],aggregateRating:["AggregateRating"]},OfferCatalog:{name:!0,itemListElement:Yo}},nl={},sl=[[tl,nl],["3DModel AboutPage Answer Article AudioObject Blog BlogPosting Book Clip CollectionPage Comment ContactPage Course CreativeWorkSeason CreativeWorkSeries DataCatalog DataDownload DataFeed Dataset DiscussionForumPosting Episode FAQPage Game HowTo HowToDirection HowToSection HowToStep HowToTip ImageObject LearningResource MediaObject Message MobileApplication Movie MusicPlaylist MusicRecording NewsArticle Photograph PodcastEpisode PodcastSeries ProfilePage QAPage Question Quiz Recipe Review ScholarlyArticle SearchResultsPage SiteNavigationElement SocialMediaPosting SoftwareApplication TVEpisode TVSeries TechArticle VacationRental VideoGame VideoObject WebApplication WebPage WebPageElement WebSite".split(" "),rl.CreativeWork],["BroadcastEvent BusinessEvent EducationEvent Festival MusicEvent SportsEvent TheaterEvent".split(" "),rl.Event],[el,rl.Organization],[il,rl.Place],["Car IndividualProduct ProductGroup ProductModel".split(" "),rl.Product],["AggregateRating EmployerAggregateRating Rating".split(" "),nl]],al="AlignmentObject BedDetails Certification ContactPoint CreditCard DefinedRegion EducationalOccupationalCredential EntryPoint GeoCoordinates GeoShape InteractionCounter JobPosting LocationFeatureSpecification MathSolver MemberProgram MemberProgramTier MerchantReturnPolicy MerchantReturnPolicySeasonalOverride MonetaryAmount NutritionInformation OccupationalExperienceRequirements OfferShippingDetails OpeningHoursSpecification PeopleAudience PostalAddress PriceSpecification PropertyValue QuantitativeValue ServicePeriod ShippingConditions ShippingDeliveryTime ShippingRateSettings ShippingService SpeakableSpecification Thing UnitPriceSpecification".split(" ");function ol(t,e){return W.call(t,e)?t[e]:void 0}function ll(t){var e=typeof t;return tt(t)||"string"===e||"number"===e||"boolean"===e}function ul(t){return ll(t)||G(t)&&t.every(ll)?t:void 0}function hl(t){if(W.call(rl,t))return rl[t];for(var e of sl){var i=e[1];if(e[0].includes(t))return i}return al.includes(t)?nl:void 0}function dl(t,e){if(!Q(t))return null;var i=ol(t,"@type"),r=function(t){return("string"==typeof t?[t]:G(t)?t:[]).filter((t=>"string"==typeof t)).map((t=>t.replace(/^https?:\/\/schema\.org\//,""))).filter((t=>!!hl(t)))}(i).filter((t=>!e||!e.length||e.includes(t)));if(!r.length)return null;var n={"@type":"string"==typeof i?r[0]:r},s=ul(ol(t,"@id"));for(var a of(K(s)||(n["@id"]=s),Xo)){var o=ul(ol(t,a));K(o)||(n[a]=o)}for(var l of r){var u=hl(l),h=function(){var e=ol(t,d),i=u[d];if(!0===i){var r=ul(e);K(r)||(n[d]=r)}else if(G(e)){var s=e.map((t=>dl(t,i))).filter(Q);s.length&&(n[d]=s)}else{var a=dl(e,i);a&&(n[d]=a)}};for(var d of Object.keys(u))h()}return n}function vl(t){if(!Q(t))return null;var e=ol(t,"@context");if("string"!=typeof e||!/^https?:\/\/schema\.org\/?$/.test(e))return null;var i=dl(t);if(i)return p({"@context":Ko},i);var r=ol(t,"@graph");if(!G(r))return null;var n=r.map((t=>dl(t))).filter(Q);return n.length?{"@context":Ko,"@graph":n}:null}function cl(t){var e;return"SCRIPT"===t.nodeName&&"application/ld+json"===(null==(e=t.getAttribute("type"))?void 0:e.trim().toLowerCase())}function fl(t,e,i){if("string"==typeof e?t.classList.contains(e):e&&Array.from(t.classList).some((t=>(e.lastIndex=0,e.test(t)))))return!0;try{return!!i&&t.matches(i)}catch(t){return!1}}function pl(t){return cl(t)?[t]:t.nodeType!==t.ELEMENT_NODE?[]:Array.from(t.querySelectorAll("script")).filter(cl)}function gl(t){return K(t)?void 0:Math.round(t)}function ml(t){return Q(t)?t.network_timing:t}var yl,bl,_l=36e5,wl=943718.4,kl="[SessionRecording]",Sl=Hi(kl),xl=[y.MouseMove,y.MouseInteraction,y.Scroll,y.ViewportResize,y.Input,y.TouchMove,y.MediaInteraction,y.Drag],Cl=t=>({rrwebMethod:t,enqueuedAt:Date.now(),attempt:1});function Tl(){var t;return null==v||null==(t=v.__PosthogExtensions__)?void 0:t.rrweb}function Ml(){var t;return null==(t=Tl())?void 0:t.record}function El(t){try{return JSON.stringify(t)}catch(e){return JSON.stringify(t,ba())}}function Il(t){return ao(no(so(El(t))))}function Rl(t){return Pl.apply(this,arguments)}function Pl(){return(Pl=f((function*(t){var e=El(t),i=yield Ne(e,qi.DEBUG,{rethrow:!0});return ao(new Uint8Array(yield i.arrayBuffer()))}))).apply(this,arguments)}var Al="undefined"!=typeof globalThis&&"CompressionStream"in globalThis&&"TextEncoder"in globalThis&&"Response"in globalThis&&"function"==typeof Response.prototype.blob,Fl=!1;function Ol(t){return G(t)&&0===t.length?yl=null!=yl?yl:Il([]):Il(t)}function Ll(t){return Dl.apply(this,arguments)}function Dl(){return(Dl=f((function*(t){return G(t)&&0===t.length?yl||(bl=null!=bl?bl:Rl([]).then((t=>(yl=t,t))).catch((t=>{throw yl=void 0,bl=void 0,t}))):Rl(t)}))).apply(this,arguments)}function $l(t){return Al&&!Fl&&function(t){return t.type===m.FullSnapshot||t.type===m.IncrementalSnapshot&&(t.data.source===y.Mutation||t.data.source===y.StyleSheetRule)}(t)}function Nl(t){return{event:t,size:wa(t)}}function ql(t,e){return p({},t,{data:e,cv:"2024-10"})}function jl(t,e){return p({},t,{cv:"2024-10",data:p({},t.data,e)})}function Bl(t){try{if(t.type===m.FullSnapshot)return Nl(ql(t,Il(t.data)));if(t.type===m.IncrementalSnapshot&&t.data.source===y.Mutation)return Nl(jl(t,{texts:Ol(t.data.texts),attributes:Ol(t.data.attributes),removes:Ol(t.data.removes),adds:Ol(t.data.adds)}));if(t.type===m.IncrementalSnapshot&&t.data.source===y.StyleSheetRule)return Nl(jl(t,{adds:t.data.adds?Il(t.data.adds):void 0,removes:t.data.removes?Il(t.data.removes):void 0}))}catch(t){Sl.error("could not compress event - will use uncompressed event",t)}return{event:t,size:_a(t)}}function Hl(){return Hl=f((function*(t){try{if(t.type===m.FullSnapshot)return Nl(ql(t,yield Rl(t.data)));if(t.type===m.IncrementalSnapshot&&t.data.source===y.Mutation){var e=yield Promise.all([Ll(t.data.texts),Ll(t.data.attributes),Ll(t.data.removes),Ll(t.data.adds)]);return Nl(jl(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?Rl(t.data.adds):void 0,t.data.removes?Rl(t.data.removes):void 0]);return Nl(jl(t,{adds:i[0],removes:i[1]}))}}catch(e){return Le(e)&&(Fl=!0),Sl.error("could not compress event asynchronously - trying synchronous compression",e),Bl(t)}return{event:t,size:_a(t)}})),Hl.apply(this,arguments)}function zl(t,e){return t.type===m.Custom&&t.data.tag===e}function Ul(t){return zl(t,"sessionIdle")}function Wl(t){return zl(t,"$session_ending")}function Vl(t){return zl(t,"$session_starting")}class Gl{get sessionId(){return this.Le}get Oe(){if(!this._instance.sessionManager)throw new Error(kl+" must be started with a valid sessionManager.");return this._instance.sessionManager}get Pe(){return this._instance.config.session_recording.session_idle_threshold_ms||3e5}get De(){return Po(this._instance.get_property($n),this.sessionId)}get be(){var t,e=null==(t=this.Fe)?void 0:t.sampleRate;return it(e)?e:null}get Ne(){var t,e;return null!==(t=null==(e=this.qe)?void 0:e.getMinimumDuration(this.sessionId))&&void 0!==t?t:null}constructor(t,e){this.je="/s/",this._forceAllowLocalhostNetworkCapture=!1,this.Be=void 0,this.He=!1,this.$e=Date.now(),this.Ue=!1,this.We=[],this.ze="unknown",this.Ve=0,this.Ze=0,this.Ge=0,this.Qe=0,this.Je=!1,this.Ye=!1,this.Ke=!1,this.Xe=!1,this.et=!1,this.tt=!1,this.rt=!1,this.it=!1,this.nt=!1,this.ot=!1,this.st=!1,this.ut=!1,this.ht=[],this.ct=void 0,this.dt=void 0,this.vt=[],this.ft=0,this.yt=0,this.bt=!1,this.wt=void 0,this.Ce=void 0,this.kt=void 0,this._t=void 0,this.St=void 0,this.xt=(t,e,i)=>{var r,n,s;if(i&&(t!==this.Le||e!==this.Ct)){var a,o=!i.noSessionId&&(i.activityTimeout||i.sessionPastMaximumLength),l=this.Le,u=this.Ct;if(o&&this.Ee("$session_ending",{currentSessionId:l,currentWindowId:u,nextSessionId:t,nextWindowId:e,changeReason:i,lastActivityTimestamp:this.$e,flushed_size:null==(a=this.Mt)?void 0:a.currentTrackedSize(l)}),null==(r=this._instance.persistence)||r.unregister(Un),this.rt=!1,null==(n=Tl())||null==n.resetMaxDepthState||n.resetMaxDepthState(),this.Ee("$session_id_change",{sessionId:t,windowId:e,changeReason:i}),this.Tt(),!(!1===this.ze&&this.isStarted||this.Le===t&&this.Ct===e)){var h=this.Le!==t&&!1!==this.ze;this.ze="unknown",this.It(h)}o&&this.Ee("$session_starting",{previousSessionId:l,previousWindowId:u,nextSessionId:t,nextWindowId:e,changeReason:i,lastActivityTimestamp:this.$e}),null==(s=this.qe)||s.makeSamplingDecisions(t)}},this.Et=()=>{var t;return(null==(t=this._instance.persistence)?void 0:t.props[Nn])===this.Le},this.Rt=()=>{var t,e;if(0===this.At.data.length)return null;var i=null==(t=this.At.data[0])?void 0:t.timestamp,r=null==(e=this.At.data[this.At.data.length-1])?void 0:e.timestamp;return it(i)&&it(r)?r-i:null},this.Lt=()=>{var t,e,i=this.Ne;if(!it(i))return!1;if(null===(t=null==(e=this._instance.config.session_recording)?void 0:e.strictMinimumDuration)||void 0===t||!t){var r=this.Ot;return it(r)&&r>=0&&i>r}if(this.Et())return!1;var n,s=this.Rt();return!!tt(s)||i>s||(null==(n=this._instance.persistence)||n.register({[Nn]:this.Le}),!1)},this.Pt=()=>{this.status!==Qs?(this.Je&&this.Ye&&this.Dt&&!this.Ke&&(this.Je=!1),this.Ft(),this.Nt()):this.qt()},this.jt=()=>{this.Pt()},this.Bt=()=>{this.Ee("browser offline",{})},this.Ht=()=>{this.Ee("browser online",{})},this.$t=()=>{null!=r&&r.visibilityState&&("visible"===r.visibilityState&&(this.Dt=!0),this.Ee("window "+r.visibilityState,{}))},this._instance=t,this.Dt=null==e||e;var i=this.Oe.checkAndGetSessionAndWindowId(),n=i.windowId;this.Le=i.sessionId,this.Ct=n,this.K=new fa(this._instance),this.J=new ca(this._instance),this.Y=new pa(this._instance),this.At=this.qt(),this.Oe.sessionTimeoutMs>this.Pe||Sl.warn("session_idle_threshold_ms ("+this.Pe+") is greater than the session timeout ("+this.Oe.sessionTimeoutMs+"). Session will never be detected as idle"),this.Mt=new lo(this._instance)}setDocumentWasEverVisible(t){t&&(this.Dt=!0)}get Ut(){var t,e,i,r,n,s,a,o,l,u=null==(t=this.Fe)?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!==(a=null==h?void 0:h.maskTextSelector)&&void 0!==a?a:null==u?void 0:u.maskTextSelector,c=null!==(o=null==h?void 0:h.blockSelector)&&void 0!==o?o: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 K(d)&&K(v)&&K(c)&&K(f)?void 0:{maskAllInputs:null==d||d,maskTextSelector:v,blockSelector:c,maskAllElementAttributes:f}}Wt(){var t;if(!this.nt){var e=null==(t=this.Fe)?void 0:t.masking;if(!et(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!K(r)&&r!==n}));0!==r.length&&(this.nt=!0,Sl.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 zt(){var t;return gt(null==(t=this._instance.config.session_recording.canvasCapture)?void 0:t.resolutionScale,.1,1,Hi("canvas recording resolution scale"),1)}get Vt(){var t,e,i,r,n,s,a,o=this._instance.config.session_recording.captureCanvas,l=null==(t=this.Fe)?void 0:t.canvasRecording,u=null!==(e=null!==(i=null==o?void 0:o.recordCanvas)&&void 0!==i?i:null==l?void 0:l.enabled)&&void 0!==e&&e,h=null!==(r=null!==(n=null==o?void 0:o.canvasFps)&&void 0!==n?n:null==l?void 0:l.fps)&&void 0!==r?r:4,d=null!==(s=null!==(a=null==o?void 0:o.canvasQuality)&&void 0!==a?a: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:gt(h,0,12,Hi("canvas recording fps"),4),quality:gt(d,0,1,Hi("canvas recording quality"),.4)}}get Zt(){var t,e=!(null==(t=this.Fe)||!t.consoleLogRecordingEnabled),i=this._instance.config.enable_recording_console_log;return null!=i?i:e}get Gt(){var t,e,i,r=null==(t=this.Fe)?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),a=(null==n?void 0:n.recordBody)||(null==r?void 0:r.recordBody),o=ml(this._instance.config.capture_performance),l=ml(null==r?void 0:r.capturePerformance),u=!!(nt(o)?o:l);return s||a||u?{recordHeaders:s,recordBody:a,recordPerformance:u}:void 0}Qt(){var t,e,i=[],r=null==(t=v.__PosthogExtensions__)||null==(t=t.rrwebPlugins)?void 0:t.getRecordConsolePlugin;r&&this.Zt&&i.push(r());var s=null==(e=v.__PosthogExtensions__)||null==(e=e.rrwebPlugins)?void 0:e.getRecordNetworkPlugin;if(this.Gt&&Z(s))if(!tr.includes(n.hostname)||this._forceAllowLocalhostNetworkCapture){var a=Z(this._instance.requestRouter.isIngestionEndpoint)?this._instance.requestRouter.isIngestionEndpoint.bind(this._instance.requestRouter):void 0;i.push(s(((t,e,i)=>{var r,n={payloadSizeLimitBytes:sn.payloadSizeLimitBytes,performanceEntryTypeToObserve:[...sn.performanceEntryTypeToObserve],payloadHostDenyList:[...e.payloadHostDenyList||[],...sn.payloadHostDenyList]},s=!1!==t.session_recording.recordHeaders&&e.recordHeaders,a=!1!==t.session_recording.recordBody&&e.recordBody,o=!1!==t.capture_performance&&e.recordPerformance,l=(r=nn(n),t=>(null!=t&&t.requestBody&&(t.requestBody=dn(t.requestBody,t.requestHeaders,r,"Request")),null!=t&&t.responseBody&&(t.responseBody=dn(t.responseBody,t.responseHeaders,r,"Response")),t)),u=e=>{return l(((t,e,i)=>{var r;if(null==i||!i(t.name)){var n=ir(t.name),s=0===e.indexOf("http")?null==(r=ir(e))?void 0:r.pathname:e;"/"===s&&(s="");var a=null==n?void 0:n.pathname.replace(s||"","");if(!(n&&a&&hn.some((t=>0===a.indexOf(t)))))return t}})((un((r=e).requestHeaders),un(r.responseHeaders),r),t.api_host,i));var r},h=Z(t.session_recording.maskNetworkRequestFn);return h&&Z(t.session_recording.maskCapturedNetworkRequestFn)&&Bi.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=Z(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 et(n)&&r?(cn.add(r),r):null!=n?n:void 0}}:t=>function(t){if(!K(t))return t.requestBody=vn(t.requestBody,"Request"),t.responseBody=vn(t.responseBody,"Response"),t}(u(t)),p({},sn,n,{recordHeaders:s,recordBody:a,recordPerformance:o,recordInitialRequests:o,streamNetworkBody:!0===t.session_recording.streamNetworkBody})})(this._instance.config,this.Gt,a)))}else Sl.info("NetworkCapture not started because we are on localhost.");return i}Jt(t){return this._instance.config.disable_capture_url_hashes?Te(t):t}Yt(t,e){void 0===e&&(e=!1);var i=e?Te(t):this.Jt(t),r=this._instance.config.mask_personal_data_properties?[...Do,...this._instance.config.custom_personal_data_properties||[]]:[];return this.Kt(sr(i,r,No))}Kt(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}Xt(t){try{return t.rrwebMethod(),!0}catch(e){return 10>this.We.length?this.We.push({enqueuedAt:t.enqueuedAt||Date.now(),attempt:t.attempt+1,rrwebMethod:t.rrwebMethod}):Sl.warn("could not emit queued rrweb event.",e,t),!1}}Ee(t,e){return this.Xt(Cl((()=>Ml().addCustomEvent(t,e))))}er(){var t;return this.He&&!0===(null==(t=this._instance.config.session_recording)?void 0:t.captureJsonLd)&&!this.J.urlBlocked&&!0!==this.ze}tr(t){if(!this.er())return!1;try{var e=Ml();return!!e&&(e.addCustomEvent("$json_ld",t),this.er())}catch(t){return!1}}rr(t){void 0===t&&(t=!1),Promise.resolve().then((()=>{var e;return null==(e=this.ir)?void 0:e.scan(t)}))}nr(){try{if(this._instance.config.capture_pageview||!t)return;var e=new URL(t.location.href),i=this.Yt(e.origin+e.pathname+e.search);this.ar!==i&&(this.ar=i,this.Ee("$url_changed",{href:i}))}catch(t){}}sr(){if(this.We.length){var t=[...this.We];this.We=[],t.forEach((t=>{Date.now()-t.enqueuedAt>2e3||this.Xt(t)}))}}_e(){return this.Xt(Cl((()=>Ml().takeFullSnapshot())))}get ur(){var t,e,i;if(null!=(t=this.qe)&&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 it(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}lr(){if(this.hr&&clearInterval(this.hr),!0!==this.ze){var t=this.ur;t&&(this.hr=setInterval((()=>{this._e()}),t))}}Se(t){"event"===t&&this.cr(),!this.J.urlBlocked&&["sampled","active"].includes(this.status)&&this.lr()}dr(){var t;this.J.urlBlocked||(this.J.urlBlocked=!0,null==(t=this.ir)||t.scan(),clearInterval(this.hr),Sl.info("recording paused due to URL blocker"),this.Ee("recording paused",{reason:"url blocker"}))}vr(){var t;this.J.urlBlocked&&(null==(t=this.ir)||t.scan(),this.J.urlBlocked=!1,this._e(),this.rr(),this.lr(),this.Ee("recording resumed",{reason:"left blocked url"}),Sl.info("recording resumed"))}pr(t,e){var i;if("event"===t&&this.cr(),!this.Ue&&null!=(i=this.qe)&&i.hasPendingTriggers(this.sessionId)){this.Ue=!0;try{var r,n;null==(r=this._instance.persistence)||r.register({["url"===t?qn:jn]:this.sessionId}),null==(n=this.qe)||n.updateActiveTriggers(this.sessionId),this.Se(),this.Nt(),this.ke(t+"_trigger_matched",{["url"===t?"matchedUrl":"matchedEvent"]:e})}finally{this.Ue=!1}}}get isStarted(){return!!this.Be}get Fe(){var t=this._instance.get_property(Rn);if(t){var e;try{e=Q(t)?t:JSON.parse(t)}catch(t){return void Sl.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>_l)return Sl.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(Rn))}return e}}gr(t,e,i){this._instance.get_property(t)&&(e(),i())}start(e){var i,n,s=this.Fe;if(s){this.isStarted||(this.Je=!1!==this.ze&&!this.Xe,this.Xe=!1,this.Ye=this.Je,this.Ke=!1),this.bt&&(this.mr(),this.qt());var a=this.Oe.checkAndGetSessionAndWindowId(),o=a.windowId;this.Le=a.sessionId,this.Ct=o,null==(i=this._instance.persistence)||i.unregister(Un),null!=s&&s.endpoint&&(this.je=null==s?void 0:s.endpoint),this.qe=2===(null==s?void 0:s.version)&&(null==s?void 0:s.triggerGroups)&&s.triggerGroups.length>0?new Fo(this._instance,this.J,this.ke.bind(this),this.Ee.bind(this),this.Se.bind(this)):new Ao(this._instance,this.J,this.Y,this.K,this.ke.bind(this),this._e.bind(this),this.Se.bind(this)),this.qe.onRemoteConfig(s),null==(n=this.Ce)||n.call(this),this.Ce=this.qe.setupEventTriggerListeners(this._instance.on.bind(this._instance,"eventCaptured"),this.sessionId,((t,e)=>this.pr(t,e))),this.gr(An,(()=>{this.overrideSampling()}),(()=>{var t;return null==(t=this._instance.persistence)?void 0:t.unregister(An)})),this.gr(Fn,(()=>{this.overrideLinkedFlag()}),(()=>{var t;return null==(t=this._instance.persistence)?void 0:t.unregister(Fn)})),this.gr(Ln,(()=>{this.overrideTrigger("event")}),(()=>{var t;return null==(t=this._instance.persistence)?void 0:t.unregister(Ln)})),this.gr(On,(()=>{this.overrideTrigger("url")}),(()=>{var t;return null==(t=this._instance.persistence)?void 0:t.unregister(On)})),this.qe.makeSamplingDecisions(this.sessionId),this.yr(),this.et||(Yi(t,"beforeunload",this.Pt),Yi(t,"pagehide",this.jt),Yi(t,"offline",this.Bt),Yi(t,"online",this.Ht),Yi(r,"visibilitychange",this.$t),!this.kt&&Z(this.Oe.onSessionId)&&(this.kt=this.Oe.onSessionId(this.xt)),!this._t&&Z(this.Oe.on)?this._t=this.Oe.on("forcedIdleReset",(()=>{this.Tt(),this.ze="unknown",this.stop(),this.St=this.Oe.onSessionId(((t,e,i)=>{var r;null==(r=this.St)||r.call(this),this.St=void 0,this.xt(t,e,i)}))})):Z(this.Oe.on)||Sl.warn("bundled core has no SessionIdManager.on (requires posthog-js >= 1.268.6); recording will start but skip forced-idle-reset handling"),et(this.wt)&&(this.wt=this._instance.on("eventCaptured",(t=>{try{if("$pageview"===t.event){var e=null!=t&&t.properties.$current_url?this.Yt(t.properties.$current_url):"";if(!e)return;this.Ee("$pageview",{href:e})}}catch(t){Sl.error("Could not add $pageview to rrweb session",t)}}))),this.status===Zs&&this.ke(e||"recording_initialized"))}else Sl.info("remote config must be stored in persistence before recording can start")}br(){var e,i,n,s,a,o;null==t||t.removeEventListener("beforeunload",this.Pt),null==t||t.removeEventListener("pagehide",this.jt),null==t||t.removeEventListener("offline",this.Bt),null==t||t.removeEventListener("online",this.Ht),null==r||r.removeEventListener("visibilitychange",this.$t),clearInterval(this.hr),this.wr(),null==(e=this.wt)||e.call(this),this.wt=void 0,null==(i=this.Ce)||i.call(this),this.Ce=void 0,null==(n=this.kt)||n.call(this),this.kt=void 0,null==(s=this._t)||s.call(this),this._t=void 0,null==(a=this.St)||a.call(this),this.St=void 0,null==(o=this.qe)||o.stop(),this.kr(),this.mr()}mr(){this.yt+=1,this.vt=[],this.ft=0,this._r=void 0,this.bt=!1}kr(){var t,e,i;null==(t=this.Sr)||t.stop(),this.We=[],null==(e=this.ir)||e.stop(),this.ir=void 0,this.He=!1,null==(i=this.Be)||i.call(this),this.Be=void 0}Cr(){if(!this._r||0===this.ft)return!1;if(this.bt)return!0;this.bt=!0;var t=this.yt;return this.wr(),this.kr(),this._r.catch((()=>{})).then((()=>{t===this.yt&&(this.bt=!1,this.Nt(),this.qt(),this.br(),Sl.info("stopped"))})).catch((()=>{this.bt=!1,this.br(),Sl.info("stopped")})),!0}stop(){this.kr(),this.Cr()||(this.Nt(),this.qt(),this.br(),Sl.info("stopped"))}It(t){var e;this.stop(),this.Mr=void 0,this.Tr=void 0,this.Ze=0,this.Ge=0,this.Qe=0,null==(e=Tl())||null==e.resetSnapshotCostState||e.resetSnapshotCostState(),this.start("session_id_changed"),this.Je=t,this.Ye=!1}cr(){this.isStarted||(this.Xe=!0),this.Je&&(this.Je=!1,this.Ye=!1,this.Ke&&(this.Ke=!1,this._e()),this.Ir())}discard(){this.qt(),this.br(),Sl.info("discarded")}Er(t,e,i,r,n){var s={$snapshot_bytes:i,$snapshot_data:e,$session_id:r,$window_id:n};this.status!==Vs?(this.Rr(t,r),this.Ar(s)):this.qt()}Lr(){try{this.Or()}catch(t){this.it||(this.it=!0,Sl.error("could not track full snapshot cost",t))}}Or(){var t,e=null==(t=Tl())||null==t.getLastSnapshotCost?void 0:t.getLastSnapshotCost();e&&e!==this.Tr&&(this.Tr=e,this.Mr&&this.Mr.durationMs>=e.durationMs||(this.Mr=e),500>e.durationMs||Sl.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}))}Rr(t,e){t.type!==m.FullSnapshot?t.type===m.IncrementalSnapshot&&(K(this.ct)||this.ct===e||this.dt===e||(this.dt=e,Sl.info("incremental snapshot for a session with no full snapshot - requesting one",{sessionId:e}),this._e())):this.ct=e}Pr(t){t.counted&&t.generation===this.yt&&(this.ft=Math.max(0,this.ft-1)),t.counted=!1,this.vt=this.vt.filter((e=>e!==t))}Dr(t,e,i){t.processed||t.generation!==this.yt||(t.processed=!0,this.Er(t.event,e,i,t.targetSessionId,t.targetWindowId))}Fr(t){try{var e=t.compressionEnabled?Bl(t.event):{event:t.event,size:_a(t.event)};this.Dr(t,e.event,e.size)}finally{this.Pr(t)}}Ft(){[...this.vt].forEach((t=>{this.Fr(t)}))}Nr(t,e,i,r){var n=this,s={event:t,compressionEnabled:e,targetSessionId:i,targetWindowId:r,generation:this.yt,processed:!1,counted:!0};this.vt.push(s),this.ft+=1;var a=function(){var i=f((function*(){try{if(s.processed)return;var i,r;try{var a=e?$l(t)?yield function(t){return Hl.apply(this,arguments)}(t):Bl(t):{event:t,size:_a(t)};i=a.event,r=a.size}catch(e){Sl.error("could not process queued compression event - will use uncompressed event",e),i=t,r=_a(t)}n.Dr(s,i,r)}finally{n.Pr(s)}}));return function(){return i.apply(this,arguments)}}();this._r=this._r?this._r.catch((()=>{})).then(a):a()}onRRwebEmit(t){var e,i,r,n,s,a,o,l,u;if(this._instance.sessionManager&&(this.sr(),t&&Q(t))){if(t.type===m.Meta){var h=this.Yt(t.data.href);if(this.ar=h,!h)return;t.data.href=h}else this.nr();if(null==(e=this.qe)||e.checkUrlTriggers(this.sessionId,(()=>this.dr()),(()=>this.vr()),((t,e)=>this.pr(t,e))),!this.J.urlBlocked||function(t){return t.type===m.Custom&&"recording paused"===t.data.tag}(t)){var d,v,c;t.type===m.FullSnapshot&&(null!=(d=Tl())&&null!=d.wasMaxDepthReached&&d.wasMaxDepthReached()&&(this.rt=!0),this.Lr(),Promise.resolve().then((()=>this.Lr())),this.lr(),null==(v=this.Sr)||v.reset(),null==(c=this._instance.persistence)||c.register_once({[Un]:t.timestamp},void 0));var f=t.type===m.FullSnapshot&&(null==(i=this.qe)?void 0:i.hasPendingTriggers(this.sessionId));f&&this.qr();var p=this.Sr?this.Sr.throttleMutations(t):t;if(p){var g=function(t){var e=t;if(e&&Q(e)&&6===e.type&&Q(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}(p),b=function(t){return Wl(t)?t.data.payload:null}(g),_=function(t){return Vl(t)?t.data.payload:null}(g),w=function(t){return Ul(t)?t.data.payload:null}(g);b||_?null!=b&&b.lastActivityTimestamp&&(g.timestamp=b.lastActivityTimestamp):null!=w&&w.sessionId||this.jr(g),t.type===m.FullSnapshot&&(this.ht.push([this.Le,t.timestamp]),this.ht.length>6&&(this.ht=this.ht.slice(-6)));var k=null!==(r=null!==(n=null!==(s=null==b?void 0:b.currentSessionId)&&void 0!==s?s:null==_?void 0:_.nextSessionId)&&void 0!==n?n:null==w?void 0:w.sessionId)&&void 0!==r?r:this.Le,S=null!==(a=null!==(o=null!==(l=null==b?void 0:b.currentWindowId)&&void 0!==l?l:null==_?void 0:_.nextWindowId)&&void 0!==o?o:null==w?void 0:w.windowId)&&void 0!==a?a:this.Ct;if(!0!==this.ze||function(t){return Ul(t)||Wl(t)||Vl(t)}(g)){g.type===m.FullSnapshot&&(this.Ve=0),w&&(g.timestamp=w.lastActivityTimestamp+w.threshold);var x=this.He;this.He=!0,f?this.rr(!0):x||this.rr();var C=null===(u=this._instance.config.session_recording.compress_events)||void 0===u||u;if(this.ft>0||C&&$l(g))this.Nr(g,C,k,S);else{var T=C?Bl(g):{event:g,size:_a(g)};this.Er(g,T.event,T.size,k,S)}}else(function(t){return t.type===m.FullSnapshot||t.type===m.Meta||t.type===m.IncrementalSnapshot&&t.data.source!==y.CanvasMutation})(g)&&this.Ve++}else!0===this.ze&&this.Ve++}}}get status(){return this.qe?this.qe.getStatus({instance:this._instance,sessionId:this.sessionId,isSampled:this.De,rrwebError:this.et,urlTriggerMatching:this.J,eventTriggerMatching:this.Y,linkedFlagMatching:this.K,remoteConfig:this.Fe}):Vs}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._e(),this.cr(),this.ke("linked_flag_overridden")}overrideSampling(){var t;null==(t=this._instance.persistence)||t.register({[$n]:this.sessionId,[Pn]:null}),this._e(),this.cr(),this.ke("sampling_overridden")}overrideTrigger(t){this.pr(t),this.cr()}Br(){try{var e,i=null==t||null==(e=t.location)?void 0:e.href;if(!i)return;var r=this.Yt(i);if(!r)return;return new URL(r).hostname||void 0}catch(t){return}}wr(){this.Hr&&(clearTimeout(this.Hr),this.Hr=void 0)}Ir(){this.Hr||(this.Hr=setTimeout((()=>{this.Nt()}),2e3))}$r(){return this.ct!==this.At.sessionId&&0!==this.At.data.length&&this.At.data.every((t=>(null==t?void 0:t.type)===m.Custom&&!Wl(t)&&!Vl(t)))}Ur(){var t,e;return null!==(t=null==(e=this.qe)?void 0:e.getPendingTriggerConditions(this.sessionId))&&void 0!==t?t:[]}Wr(t){if(t!==Qs)return K(this.zr)||this._instance.register_for_session({[Is]:[]}),void(this.zr=void 0);var e=this.Ur();if(0===e.length)return K(this.zr)||this._instance.register_for_session({[Is]:[]}),void(this.zr=void 0);var i=e.join(", "),r=this.sessionId+":"+i;r!==this.zr&&(this.zr=r,this._instance.register_for_session({[Is]:e}),Sl.info("buffering: "+i))}Nt(){var t;if(this.wr(),this.Je)return this.At;if(this.$r())return this.At.size>wl?this.qt():this.At;var e=this.At;null==(t=this.qe)||t.ensureSamplingDecision(this.sessionId);var i=this.Lt(),r=this.status;if(this.Wr(r),r===Qs||r===Js||r===Vs||i)return this.Ir(),this.At;if(this.At!==e)return this.At;if(e.data.length>0){var n,s=this.Br();ka(e).forEach((t=>{var e;null==(e=this.Mt)||e.trackSize(t.sessionId,t.size),this.Vr({$snapshot_bytes:t.size,$snapshot_data:t.data,$session_id:t.sessionId,$window_id:t.windowId,$lib:qi.LIB_NAME,$lib_version:qi.LIB_VERSION,$snapshot_host:s})})),null==(n=this.qe)||n.onFlushComplete()}return this.qt()}Ar(t){var e,i=2+((null==(e=this.At)?void 0:e.data.length)||0),r=t.$session_id,n=this.At.sessionId!==r;if(n||!0!==this.ze&&!this.Je&&this.At.size+t.$snapshot_bytes+i>wl){var s=this.Le;if(this.At=this.Nt(),this.Le!==s)return;n&&this.At.data.length>0&&(this.At=this.qt()),this.At.sessionId=r,this.At.windowId=t.$window_id}this.Je&&(this.Ke||this.At.size+t.$snapshot_bytes+i>wl)?this.Ke||(this.Ke=!0,this.At=this.qt()):(this.At.size+=t.$snapshot_bytes,this.At.data.push(t.$snapshot_data),this.At.sizes.push(t.$snapshot_bytes),!0===this.ze||this.Je||this.Ir())}Vr(t){this._instance.capture("$snapshot",t,{_url:this._instance.requestRouter.endpointFor("api",this.je),_noTruncate:!0,_batchKey:"recordings",skip_client_rate_limiting:!0})}get Ot(){var t,e,i=null==(t=this.At)?void 0:t.data[(null==(e=this.At)?void 0:e.data.length)-1],r=this.Oe.checkAndGetSessionAndWindowId(!0);return i?i.timestamp-r.sessionStartTimestamp:null}qr(){if(!this.At||0===this.At.data.length)return this.qt();for(var t=-1,e=this.At.data.length-1;e>=0;e--)if(this.At.data[e].type===m.Meta){t=e;break}return 0>t?this.qt():(this.At.data=this.At.data.slice(t),this.At.sizes=this.At.sizes.slice(t),this.At.size=this.At.sizes.reduce(((t,e)=>t+e),0),this.At)}qt(){return this.At={size:0,data:[],sizes:[],sessionId:this.Le,windowId:this.Ct},this.At}ke(t,e){this._instance.register_for_session({[Fs]:t}),Sl.info(t.replace("_"," "),e),"session_id_changed"!==t&&this.Ee("$recording_started",p({reason:t},e))}Zr(t){var e;return 3===t.type&&-1!==xl.indexOf(null==(e=t.data)?void 0:e.source)}jr(t){var e=this.Zr(t);e||!0===this.ze||t.timestamp-this.$e>this.Pe&&(this.ze=!0,clearInterval(this.hr),this.Ee("sessionIdle",{eventTimestamp:t.timestamp,lastActivityTimestamp:this.$e,threshold:this.Pe,bufferLength:this.At.data.length,bufferSize:this.At.size,sessionId:this.Le,windowId:this.Ct}),this.Nt());var i=!1;if(e&&(this.$e=t.timestamp,this.ze)){var r="unknown"===this.ze;this.ze=!1,r||(this.Ee("sessionNoLongerIdle",{reason:"user activity",type:t.type}),i=!0)}var n=this.Oe.checkAndGetSessionAndWindowId(!e,t.timestamp),s=n.windowId,a=n.sessionId,o=this.Le!==a,l=this.Ct!==s;if(this.Ct=s,this.Le=a,o||l){var u=o&&!1!==this.ze;u&&(this.ze="unknown"),this.It(u)}else if(e&&this.cr(),i){var h,d=["sampled","active"].includes(this.status)||(null==(h=this.qe)?void 0:h.hasPendingTriggers(this.sessionId));this.Ve>0&&d&&this._e(),this.rr(),this.lr()}}Tt(){var t;null==(t=this.qe)||t.clearConditionalRecordingPersistence()}get sdkDebugProperties(){var t,e,i,r,n,s,a,o,l,u=this.Oe.checkAndGetSessionAndWindowId(!0).sessionStartTimestamp,h=null==(t=Tl())||null==t.getDeferredStylesheetStats?void 0:t.getDeferredStylesheetStats();return{$recording_status:this.status,$sdk_debug_replay_internal_buffer_length:this.At.data.length,$sdk_debug_replay_internal_buffer_size:this.At.size,$sdk_debug_current_session_duration:this.Ot,$sdk_debug_session_start:u,$sdk_debug_replay_flushed_size:null==(e=this.Mt)?void 0:e.currentTrackedSize(this.sessionId),$sdk_debug_replay_full_snapshots:this.ht,$snapshot_max_depth_exceeded:this.rt,$sdk_debug_replay_slowest_full_snapshot_ms:gl(null==(i=this.Mr)?void 0:i.durationMs),$sdk_debug_replay_slowest_full_snapshot_stylesheet_ms:gl(null==(r=this.Mr)?void 0:r.stylesheetMs),$sdk_debug_replay_slowest_full_snapshot_nodes:null==(n=this.Mr)?void 0:n.nodeCount,$sdk_debug_replay_slowest_full_snapshot_css_rules:null==(s=this.Mr)?void 0:s.cssRuleCount,$sdk_debug_replay_slowest_full_snapshot_css_rules_non_deferrable:null==(a=this.Mr)?void 0:a.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:gl(null==h?void 0:h.totalMs),$sdk_debug_replay_deferred_stylesheet_slowest_slice_ms:gl(null==h?void 0:h.slowestSliceMs),$sdk_debug_replay_slowest_mutation_batch_ms:gl(null==(o=Tl())||null==o.getMutationCost||null==(o=o.getMutationCost())?void 0:o.slowestBatchMs),$sdk_debug_replay_discarded_duration_samples:null==(l=Tl())||null==l.getDiscardedDurationSamples?void 0:l.getDiscardedDurationSamples(),$sdk_debug_replay_throttled_mutations_dropped:this.Ze,$sdk_debug_replay_oversized_mutations_dropped:this.Ge,$sdk_debug_replay_oversized_mutation_bytes_dropped:this.Qe,$sdk_debug_replay_rrweb_error:this.et,$sdk_debug_rrweb_attached:!!this.Be,$sdk_debug_rrweb_start_attempted:this.tt}}yr(){var e;if(!this.Be){this.tt=!0;var i,n,s,a,o={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},l=this._instance.config.session_recording;for(var u of Object.entries(l||{})){var h=u[0],d=u[1];if(h in o)if("maskInputOptions"===h)o.maskInputOptions=p({password:!0},d);else if("sampling"===h){var v=null!=d?d:{},c={};K(v.mousemove)||(c.mousemove=v.mousemove),K(v.mouseInteraction)||(c.mouseInteraction=v.mouseInteraction),o.sampling=c}else o[h]=d}!0===(null==l?void 0:l.captureJsonLd)&&!0!==o.slimDOMOptions&&"all"!==o.slimDOMOptions&&(o.slimDOMOptions=p({},o.slimDOMOptions,{script:!0})),this.Vt&&this.Vt.enabled&&(o.recordCanvas=!0,o.sampling=p({},o.sampling,{canvas:this.Vt.fps}),o.dataURLOptions={type:"image/webp",quality:this.Vt.quality},o.canvasResolutionScale=this.zt,o.canvasMasking={configured:()=>{var t;return Z(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(Z(i))try{var r;return null!==(r=i(t))&&void 0!==r?r:null}catch(t){return this.st||(this.st=!0,Sl.warn("canvasCapture.maskRegionsFn threw, canvas frames will be skipped",t)),null}}}),this.Ut&&(o.maskAllInputs=null===(i=this.Ut.maskAllInputs)||void 0===i||i,o.maskTextSelector=null!==(n=this.Ut.maskTextSelector)&&void 0!==n?n:void 0,o.blockSelector=null!==(s=this.Ut.blockSelector)&&void 0!==s?s:void 0,o.maskAllElementAttributes=null!==(a=this.Ut.maskAllElementAttributes)&&void 0!==a&&a),o.maskAllElementAttributes&&o.maskAttributeFn&&(o.maskAttributeFn=void 0,this.ot||(this.ot=!0,Sl.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.Wt();var f=Ml();if(f){this.Sr=null!==(e=this.Sr)&&void 0!==e?e:new oo(f,{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";Sl.info(i,{node:e}),this.log(kl+" "+i,"warn")},onDroppedAttributeMutations:t=>this.Ze+=t,bytesRefillRate:this._instance.config.session_recording.__mutationBytesRefillRate,bytesBucketSize:this._instance.config.session_recording.__mutationBytesBucketSize,resyncIntervalMs:this.ur,onDroppedOversizedMutation:t=>{0===this.Ge&&this.log(kl+" Dropped an oversized DOM mutation to keep the recording playable. The recording will resync with a full snapshot.","warn"),this.Ge+=1,this.Qe+=t},requestFullSnapshot:()=>this._e()});var g=this.Qt();if(this.Be=f(p({emit:t=>{this.onRRwebEmit(t)},plugins:g,errorHandler:(t,e)=>"rrweb"===e&&(this.ut||(this.ut=!0,Sl.error("rrweb internal error - recording will continue but may be incomplete",t)),!0)},o)),!this.Be)return this.et=!0,void Sl.error("rrweb failed to start - Loss of recording data is possible. Check the browser console for rrweb errors.");this.et=!1,!0===(null==l?void 0:l.captureJsonLd)&&r&&null!=t&&t.MutationObserver&&!this.ir&&(this.ir=function(t,e,i){var r=new WeakMap,n=i.getCaptureState||(()=>!0),s=Jo,a=e=>{try{var a=n();if(!s||!1===a||!e.isConnected||e.ownerDocument!==t||function(t,e){for(var i=t;i;){if(fl(i,e.blockClass,e.blockSelector)||fl(i,e.maskTextClass,e.maskTextSelector))return!0;var r=i.parentNode;i=i.parentElement||(r&&r.nodeType===r.DOCUMENT_FRAGMENT_NODE?r.host:null)}return!1}(e,i))return;var o=function(t){if(!t||t.length>Jo)return null;try{var e=JSON.parse(t),i=G(e)?e.map(vl):vl(e);if(tt(i)||G(i)&&(!i.length||i.some(tt)))return null;var r=JSON.stringify(i);return r.length>2e4?null:[i,r]}catch(t){return null}}(e.text);if(!o)return void r.delete(e);var l=o[0],u=o[1];if(tt(a))return void r.set(e,u);if(r.get(e)!==u){if(u.length>s)return void(s=0);i.emit(l)&&(r.set(e,u),s-=u.length)}}catch(t){return}};try{var o=new e((t=>{try{if(!s||!1===n())return;var e=t=>{for(var e of pl(t))a(e)};for(var i of t)if("childList"===i.type)cl(i.target)&&a(i.target),i.addedNodes.forEach(e);else if("characterData"===i.type){var r=i.target.parentNode;r&&cl(r)&&a(r)}else"attributes"===i.type&&cl(i.target)&&a(i.target)}catch(t){return}}));return o.observe(t,{attributes:!0,attributeFilter:["type"],characterData:!0,childList:!0,subtree:!0}),{scan(e){void 0===e&&(e=!1),s&&!1!==n()&&pl(t.documentElement).forEach((t=>{e&&r.delete(t),a(t)}))},stop(){return o.disconnect()}}}catch(t){return{scan(){},stop(){}}}}(r,t.MutationObserver,{blockClass:o.blockClass,blockSelector:o.blockSelector,maskTextClass:o.maskTextClass,maskTextSelector:o.maskTextSelector,getCaptureState:()=>{var t;return!0!==(null==(t=this._instance.config.session_recording)?void 0:t.captureJsonLd)||this.J.urlBlocked||this.J.isCurrentUrlBlocked()?null:this.er()},emit:t=>this.tr(t)}),this.J.isCurrentUrlBlocked()&&this.ir.scan()),this.$e=Date.now(),this.ze=nt(this.ze)?this.ze:"unknown",this.tryAddCustomEvent("$remote_config_received",this.Fe),this.Ee("$session_options",{sessionRecordingOptions:o,activePlugins:g.map((t=>null==t?void 0:t.name))}),this.Ee("$posthog_config",{config:this._instance.config})}else Sl.error("_startRecorder was called but rrwebRecord is not available. This indicates something has gone wrong.")}}tryAddCustomEvent(t,e){return this.Ee(t,e)}}var Zl,Ql=["type"],Jl=Object.defineProperty,Kl=(t,e,i)=>((t,e,i)=>e in t?Jl(t,e,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[e]=i)(t,"symbol"!=typeof e?e+"":e,i),Yl=(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))(Yl||{}),Xl=(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))(Xl||{}),tu=(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))(tu||{}),eu=(t=>(t[t.Mouse=0]="Mouse",t[t.Pen=1]="Pen",t[t.Touch=2]="Touch",t))(eu||{}),iu=(t=>(t[t["2D"]=0]="2D",t[t.WebGL=1]="WebGL",t[t.WebGL2=2]="WebGL2",t))(iu||{}),ru=(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))(ru||{}),nu=(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))(nu||{});function su(t,e){return-1!==t.indexOf(e)}var au={Node:["childNodes","parentNode","parentElement","textContent"],ShadowRoot:["host","styleSheets"],Element:["shadowRoot"],MutationObserver:[]},ou={Node:["contains","getRootNode"],ShadowRoot:["getSelection"],Element:["querySelector","querySelectorAll"],MutationObserver:["constructor"]},lu={};function uu(t){if(lu[t])return lu[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 au?au[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 ou?ou[t]:void 0,a=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&&a)return lu[t]=e.prototype,e.prototype;var o=document.createElement("iframe");o.style.display="none";var l=!1;try{document.body.appendChild(o);var u=o.contentWindow;if(!u)return e.prototype;var h=u[t].prototype;return h?(function(t){return su(t,"AppleWebKit")&&!su(t,"Chrome")}(navigator.userAgent)&&(o.classList.add("rr-block","ph-no-capture"),o.setAttribute("__rrwebUntaintedPrototype",t),l=!0),lu[t]=h):i}catch(t){return i}finally{!l&&o.parentNode&&document.body.removeChild(o)}}var hu={};function du(t,e,i){var r,n=t+"."+String(i);if(hu[n])return hu[n].call(e);var s=uu(t),a=null==(r=Object.getOwnPropertyDescriptor(s,i))?void 0:r.get;return a?(hu[n]=a,a.call(e)):e[i]}var vu={};function cu(t,e,i){var r=t+"."+String(i);if(vu[r])return vu[r].bind(e);var n=uu(t)[i];return"function"!=typeof n?e[i]:(vu[r]=n,n.bind(e))}function fu(){return uu("MutationObserver").constructor}function pu(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=>{var e;return"function"==typeof t?null!==(e=t.__rrweb_layer__)&&void 0!==e?e:t.__posthog_layer__:void 0},r=t[e],a=i(r);a;){if(a.next===s)return void(a.next=n.next);a=i(r=a.next)}else t[e]=n.next}}catch(t){return()=>{}}}var gu={childNodes:t=>du("Node",t,"childNodes"),parentNode:t=>du("Node",t,"parentNode"),parentElement:t=>du("Node",t,"parentElement"),textContent:t=>du("Node",t,"textContent"),contains:(t,e)=>cu("Node",t,"contains")(e),getRootNode:t=>cu("Node",t,"getRootNode")(),host:t=>t&&"host"in t?du("ShadowRoot",t,"host"):null,styleSheets:t=>t.styleSheets,shadowRoot:t=>t&&"shadowRoot"in t?du("Element",t,"shadowRoot"):null,querySelector:(t,e)=>cu("Element",t,"querySelector")(e),querySelectorAll:(t,e)=>cu("Element",t,"querySelectorAll")(e),mutationObserver:fu,patch:pu},mu=()=>({durationMs:0,stylesheetMs:0,nodeCount:0,cssRuleCount:0,nonDeferrableCssRuleCount:0,deferredStylesheetCount:0});function yu(){try{if("undefined"!=typeof performance&&performance.now)return performance.now()}catch(t){}return Date.now()}var bu=0,_u=6e4;function wu(){bu+=1}function ku(){return bu}function Su(t,e){return e!==bu||t>_u}var xu=0,Cu=0,Tu=0,Mu=mu(),Eu=null,Iu=null,Ru=[],Pu=0,Au=0,Fu={slowestBatchMs:0},Ou={deferredCount:0,failedCount:0,abandonedCount:0,totalMs:0,slowestSliceMs:0},Lu=t=>t&&t>0?t:null;function Du(t){(xu+=1)>1||(Mu=mu(),Ru=[],Pu=0,Iu=Lu(t),Cu=yu(),Tu=bu)}function $u(){return 0===xu?Eu||mu():(xu-=1)>0?Mu:(Mu.durationMs=yu()-Cu,Mu.deferredStylesheetCount=Pu,Ou.deferredCount+=Pu,Iu=null,Su(Mu.durationMs,Tu)?Mu:Eu=Mu)}var Nu=32;function qu(t,e,i){var r=t.length;if(i>=Nu)return r;for(var n=0;t.length>n;n++){var s=t[n];try{var a=s.cssRules;if(a&&a.length)r+=qu(a,e,i+1);else if(e&&s.styleSheet){var o=s.styleSheet;if(!e.has(o)){e.add(o);var l=o.rules||o.cssRules;l&&(r+=qu(l,e,i+1))}}}catch(t){}}return r}function ju(t){if(0!==xu){var e=qu(t,null,0);Mu.cssRuleCount+=e,Au>0&&(Mu.nonDeferrableCssRuleCount+=e)}}function Bu(t){Au+=1;try{return t()}finally{Au-=1}}function Hu(t){xu>0&&(Mu.stylesheetMs+=t)}function zu(t){if(0===xu||null===Iu)return!1;var e=Mu.cssRuleCount-Mu.nonDeferrableCssRuleCount;return e>=Iu||e+function(t){try{var e=t&&(t.rules||t.cssRules);if(!e)return 0;var i=new WeakSet;return i.add(t),qu(e,i,0)}catch(t){return 0}}(t)>Iu}function Uu(){Ou.failedCount+=1}function Wu(t){t>0&&(Ou.abandonedCount+=t)}function Vu(t){return t.nodeType===t.ELEMENT_NODE}function Gu(t){var e=t&&"host"in t&&"mode"in t&&gu.host(t)||null;return Boolean(e&&"shadowRoot"in e&&gu.shadowRoot(e)===t)}function Zu(t){return"[object ShadowRoot]"==={}.toString.call(t)}function Qu(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 Ju(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 Ku=0;function Yu(t){var e=0===Ku,i=e?yu():0;Ku+=1;try{var r=t.rules||t.cssRules;if(!r)return null;ju(r);var n=t.href;return!n&&t.ownerNode&&(n=t.ownerNode.baseURI),Qu(Array.from(r,(t=>Xu(t,n))).join(""))}catch(t){return null}finally{Ku-=1,e&&Hu(yu()-i)}}function Xu(t,e){var i;if(eh(t)){var r;try{r=Yu(t.styleSheet)||Ju(t)}catch(e){r=t.cssText}try{if(r&&(null==(i=t.styleSheet)?void 0:i.href))return mh(r,t.styleSheet.href)}catch(t){}return r}var n=t.cssText;return ih(t)&&t.selectorText.includes(":")&&(n=th(n)),e?mh(n,e):n}function th(t){return t.replace(/(\[(?:[\w-]+)[^\\])(:(?:[\w-]+)\])/gm,"$1\\$2")}function eh(t){return"styleSheet"in t}function ih(t){return"selectorText"in t}var rh=/^-?[A-Za-z_][\w-]*$/,nh=/^-?[A-Za-z_][\w-]*(\.-?[A-Za-z_][\w-]*)*$/;function sh(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 o=e[e.length-1];return o.parts.push(t),void(o.index+=1)}if(!n.importRule)return i=!0,void(r=t);a(e[e.length-1],n.importRule,t)}function a(t,e,i){var r;try{var n;try{n=i||Ju(e)}catch(t){n=e.cssText}try{n&&(null==(r=e.styleSheet)?void 0:r.href)&&(n=mh(n,e.styleSheet.href))}catch(t){}n&&t.parts.push(n),t.index+=1}catch(t){s(null)}}function o(t){var i=t.rules[t.index];if("sheet"===t.kind&&eh(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 a(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(ih(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&&!rh.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]?rh.test(i.name)?"@keyframes "+i.name+" {":null:""===i.name?"@layer {":nh.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?mh(r,n):r,fixColons:"sheet"===i.kind&&ih(t)&&t.selectorText.includes(":")}),!0}catch(t){return!1}}(i,t)){var s=i.cssText;"sheet"===t.kind&&ih(i)&&i.selectorText.includes(":")&&(s=th(s)),t.parts.push(t.sheetHref?mh(s,t.sheetHref):s),t.index+=1}}return function(t){try{var i=t.rules||t.cssRules;if(!i)return!1;ju(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,!eh(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;ju(s);var a=r.href;!a&&r.ownerNode&&(a=r.ownerNode.baseURI);var o=Array.from(s);n.set(e,{sheet:r,rules:o,sheetHref:a}),i.push({sheet:r,rules:o,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=yu(),a=t>0?t:1;try{for(;!i&&a>0;){var l=e[e.length-1];if(l.rules.length>l.index){a-=1;try{o(l)}catch(t){s(null)}}else{var u=null;try{if("group"===l.kind){var h=l.prelude+l.parts.join("")+"}";u=l.fixColons?th(h):h}else u=Qu(l.parts.join(""))}catch(t){}s(u)}}}catch(t){i=!0,r=null}finally{Hu(yu()-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 ah{constructor(){Kl(this,"idNodeMap",new Map),Kl(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))),Vu(t)){var i=gu.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 oh(t){var e=t.element,i=t.maskInputOptions,r=t.tagName,n=t.type,s=t.maskInputFn,a=t.value||"",o=n&&lh(n);return(i[r.toLowerCase()]||o&&i[o])&&(a=s?s(a,e):"*".repeat(a.length)),a}function lh(t){return t.toLowerCase()}var uh=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 hh(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&&uh.has(lh(i))?r:"*".repeat(r.length):n?n(i,r,e):r:r}var dh="__rrweb_original__";function vh(t){try{var e=t.type;return t.hasAttribute("data-rr-is-password")?"password":e?lh(e):null}catch(t){return null}}var ch=/url\((?:(')([^']*)'|(")(.*?)"|([^)]*))\)/gm,fh=/^(?:[a-z+]+:)?\/\//i,ph=/^www\..*/i,gh=/^(data:)([^,]*),(.*)/i;function mh(t,e){return(t||"").replace(ch,((t,i,r,n,s,a)=>{var o,l=r||s||a,u=i||n||"";if(!l)return t;if(fh.test(l)||ph.test(l))return"url("+u+l+u+")";if(gh.test(l))return"url("+u+l+u+")";if("/"===l[0])return"url("+u+(((o=e).indexOf("//")>-1?o.split("/").slice(0,3).join("/"):o.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 yh,bh,_h="data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTAwJSIgaGVpZ2h0PSIxMDAlIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPgogIDxkZWZzPgogICAgPHBhdHRlcm4gaWQ9InN0cmlwZXMiIHBhdHRlcm5Vbml0cz0idXNlclNwYWNlT25Vc2UiIHdpZHRoPSIxNiIgaGVpZ2h0PSIxNiI+CiAgICAgIDxyZWN0IHdpZHRoPSIxNiIgaGVpZ2h0PSIxNiIgZmlsbD0iYmxhY2siLz4KICAgICAgPHBhdGggZD0iTTggMEgxNkwwIDE2VjhMOCAwWiIgZmlsbD0iIzJEMkQyRCIvPgogICAgICA8cGF0aCBkPSJNMTYgOFYxNkg4TDE2IDhaIiBmaWxsPSIjMkQyRDJEIi8+CiAgICA8L3BhdHRlcm4+CiAgPC9kZWZzPgogIDxyZWN0IHdpZHRoPSIxMDAlIiBoZWlnaHQ9IjEwMCUiIGZpbGw9InVybCgjc3RyaXBlcykiLz4KPC9zdmc+Cg==",wh=4096,kh=1e5,Sh=10,xh=new Map,Ch=1,Th=new RegExp("[^a-z0-9-_:]"),Mh=-2;function Eh(){return Ch++}var Ih=/^[^ \t\n\r\u000c]+/,Rh=/^[, \t\n\r\u000c]+/,Ph=new WeakMap;function Ah(t,e){return e&&""!==e.trim()?Fh(t,e):e}function Fh(t,e){var i=Ph.get(t);if(i||(i=t.createElement("a"),Ph.set(t,i)),e){if(e.startsWith("blob:")||e.startsWith("data:"))return e}else e="";return i.setAttribute("href",e),i.href}function Oh(t,e){return(null==e?void 0:e.maxBase64ImageLength)?function(t,e){return e&&t.length>e?_h:t}(t,e.maxBase64ImageLength):t}function Lh(t,e,i,r,n,s){var a;if(!r)return r;if("src"===i||"href"===i&&("use"!==e||"#"!==r[0])){if("link"===e&&n){var o=null==(a=n.sheet)?void 0:a.href;if(o)return o}var l=Ah(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(kh>e.length)return e;if(!t.complete||0===t.naturalWidth)return e;if(t.naturalWidth>wh||t.naturalHeight>wh)return e;var n=xh.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 a=s.getContext("2d");if(!a)return e;a.drawImage(t,0,0);var o=s.toDataURL(i||"image/webp",null!=r?r:.4),l=e.length>o.length?o:e;if(xh.size>=Sh){var u=xh.keys().next().value;void 0!==u&&xh.delete(u)}return xh.set(e,{type:i,quality:r,result:l}),l}catch(t){return e}}(n,l,s.type,s.quality)),Oh(u,s)}if("image"===e)return Oh(l,s)}return l}if("xlink:href"===i&&"#"!==r[0]){var h=Ah(t,r);return"image"===e&&h.startsWith("data:")?Oh(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(Rh),e.length>i;){var s=r(Ih);if(","===s.slice(-1))s=Ah(t,s.substring(0,s.length-1)),n.push(s);else{var a="";s=Ah(t,s);for(var o=!1;;){var l=e.charAt(i);if(""===l){n.push((s+a).trim());break}if(o)")"===l&&(o=!1);else{if(","===l){i+=1,n.push((s+a).trim());break}"("===l&&(o=!0)}a+=l,i+=1}}}return n.join(", ")}(t,r):"style"===i?mh(r,Fh(t)):"object"===e&&"data"===i?Ah(t,r):r:Ah(t,r)}function Dh(t,e,i){return("video"===t||"audio"===t)&&"autoplay"===e}function $h(t,e,i){if(!t)return!1;if(t.nodeType!==t.ELEMENT_NODE)return!!i&&$h(gu.parentNode(t),e,i);for(var r=t.classList.length;r--;)if(e.test(t.classList[r]))return!0;return!!i&&$h(gu.parentNode(t),e,i)}function Nh(t,e,i,r){var n;if(Vu(t)){if(!gu.childNodes(n=t).length)return!1}else{if(null===gu.parentElement(t))return!1;n=gu.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($h(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 qh(t,e,i){var r=t.removeEventListener;"function"==typeof r&&r.call(t,e,i)}var jh=new Map;function Bh(t,e){return Array.from(t.styleSheets).find((t=>t.href===e))}function Hh(t){return null==t?"":t.toLowerCase()}var zh=50,Uh=!1,Wh=!1;function Vh(t,e){var i=e.doc,r=e.mirror,n=e.blockClass,s=e.blockSelector,a=e.maskTextClass,o=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,b=e.slimDOMOptions,_=e.dataURLOptions,w=void 0===_?{}:_,k=e.inlineImages,S=void 0!==k&&k,x=e.recordCanvas,C=void 0!==x&&x,T=e.canvasMaskingConfigured,M=e.onSerialize,E=e.onIframeLoad,I=e.iframeLoadTimeout,R=void 0===I?5e3:I,P=e.onIframeListenerRegistered,A=e.onStylesheetLoad,F=e.stylesheetLoadTimeout,O=void 0===F?5e3:F,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,H=e.maxDepth,z=void 0===H?zh:H,U=e.needsMask,W=e.preserveWhiteSpace,V=void 0===W||W;if(B>=z)return Wh=!0,Uh||(Uh=!0,console.warn("[rrweb-snapshot] DOM tree depth exceeded max depth of "+z+". Children beyond this depth will not be recorded. This may indicate deeply nested DOM structures.")),null;U||(U=Nh(t,a,o,void 0===U)),xu>0&&(Mu.nodeCount+=1);var G,Z=function(t,e){var i=e.doc,r=e.blockClass,n=e.blockSelector,s=e.needsMask,a=e.inlineStylesheet,o=e.maskInputOptions,l=void 0===o?{}:o,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,b=e.keepIframeSrcFn,_=e.newlyAddedElement,w=void 0!==_&&_,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:nu.Document,childNodes:[],compatMode:t.compatMode}:{type:nu.Document,childNodes:[]};case t.DOCUMENT_TYPE_NODE:return{type:nu.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,a=e.inlineStylesheet,o=e.maskInputOptions,l=void 0===o?{}:o,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,b=e.newlyAddedElement,_=void 0!==b&&b,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=lh(t.tagName);return Th.test(e)?"div":e}(t),x=new Set,C={},T=t.attributes.length,M=0;T>M;M++){var E=t.attributes[M];Dh(S,E.name)||(C[E.name]=Lh(s,S,lh(E.name),E.value,t,f))}if("link"===S&&a&&!k){var I=t.sheet;if(!I){var R=function(t){return t.href}(t);R&&!(I=Bh(s,R))&&R.includes(".css")&&(I=Bh(s,window.location.origin+"/"+R.replace(window.location.href,"")))}var P=null;I&&(zu(I)?xu>0&&(Ru.push(t),Pu+=1):P=Yu(I)),P&&(delete C.rel,delete C.href,C._cssText=P)}if("style"===S&&t.sheet&&!(t.innerText||gu.textContent(t)||"").trim().length){var A=Bu((()=>Yu(t.sheet)));A&&(C._cssText=A)}if("input"===S||"textarea"===S||"select"===S){var F=t.value,O=t.checked;"radio"!==C.type&&"checkbox"!==C.type&&"submit"!==C.type&&"button"!==C.type&&F?C.value=oh({element:t,type:vh(t),tagName:S,value:F,maskInputOptions:l,maskInputFn:u}):O&&(C.checked=O)}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((dh in n?n[dh]: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){yh||(yh=s.createElement("canvas"),bh=yh.getContext("2d"));var B=t,H=B.currentSrc||B.getAttribute("src")||"<unknown-src>",z=B.crossOrigin,U=(e,i)=>j?hh({element:t,name:e,value:i,maskAllElementAttributes:d,maskAttributeFn:v}):i,W=()=>{qh(B,"load",W);try{yh.width=B.naturalWidth,yh.height=B.naturalHeight,bh.drawImage(B,0,0);var t=yh.toDataURL(f.type,f.quality);C.rr_dataURL=U("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="+H+"! Error: "+t)}"anonymous"===B.crossOrigin&&(z?C.crossOrigin=U("crossOrigin",z):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(_||(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]=hh({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:nu.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:a,maskInputOptions:l,maskInputFn:h,maskAllElementAttributes:v,maskAttributeFn:c,dataURLOptions:p,inlineImages:g,recordCanvas:m,canvasMaskingConfigured:y,keepIframeSrcFn:b,newlyAddedElement:w,rootId:k});case t.TEXT_NODE:return function(t,e){var i,r=e.needsMask,n=e.maskTextFn,s=e.rootId,a=gu.parentNode(t),o=a&&a.tagName,l=gu.textContent(t),u="STYLE"===o||void 0,h="SCRIPT"===o||void 0;if(u&&l){try{if(t.nextSibling||t.previousSibling);else if(zu(a.sheet));else if(null==(i=a.sheet)?void 0:i.cssRules){var d=Yu(a.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=mh(l,Fh(e.doc))}return h&&(l="SCRIPT_PLACEHOLDER"),!u&&!h&&l&&r&&(l=n?n(l,gu.parentElement(t)):l.replace(/[\S]/g,"*")),{type:nu.Text,textContent:l||"",isStyle:u,rootId:s}}(t,{doc:i,needsMask:s,maskTextFn:u,rootId:k});case t.CDATA_SECTION_NODE:return{type:nu.CDATA,textContent:"",rootId:k};case t.COMMENT_NODE:return{type:nu.Comment,textContent:gu.textContent(t)||"",rootId:k};default:return!1}}(t,{doc:i,mirror:r,blockClass:n,blockSelector:s,needsMask:U,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===nu.Comment)return!0;if(t.type===nu.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&&(Hh(t.attributes.name).match(/^msapplication-tile(image|color)$/)||"application-name"===Hh(t.attributes.name)||["icon","apple-touch-icon","shortcut icon"].includes(Hh(t.attributes.rel)))))return!0;if("meta"===t.tagName){if(e.headMetaDescKeywords&&Hh(t.attributes.name).match(/^description|keywords$/))return!0;if(e.headMetaSocial&&(Hh(t.attributes.property).match(/^(og|twitter|fb):/)||Hh(t.attributes.name).match(/^(og|twitter):/)||"pinterest"===Hh(t.attributes.name)))return!0;if(e.headMetaRobots&&["robots","googlebot","bingbot"].includes(Hh(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(Hh(t.attributes.name))||Hh(t.attributes.property).match(/^article:/)||Hh(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(Hh(t.attributes.name)))return!0}}return!1}(Z,b)||!V&&Z.type===nu.Text&&!Z.isStyle&&!Z.textContent.replace(/^\s+|\s+$/gm,"").length?Mh:Eh();var Q=Object.assign(Z,{id:G});if(r.add(t,Q),G===Mh)return null;M&&M(t);var J=!u;if(Q.type===nu.Element){J=J&&!Q.needBlock,delete Q.needBlock;var K=gu.shadowRoot(t);K&&Zu(K)&&(Q.isShadowHost=!0)}if((Q.type===nu.Document||Q.type===nu.Element)&&J){b.headWhitespace&&Q.type===nu.Element&&"head"===Q.tagName&&(V=!1);var Y={doc:i,mirror:r,blockClass:n,blockSelector:s,needsMask:U,maskTextClass:a,maskTextSelector:o,skipChild:u,inlineStylesheet:d,maskInputOptions:c,maskTextFn:f,maskInputFn:p,maskAllElementAttributes:m,maskAttributeFn:y,slimDOMOptions:b,dataURLOptions:w,inlineImages:S,recordCanvas:C,canvasMaskingConfigured:T,preserveWhiteSpace:V,onSerialize:M,onIframeLoad:E,iframeLoadTimeout:R,onIframeListenerRegistered:P,onStylesheetLoad:A,stylesheetLoadTimeout:O,keepIframeSrcFn:D,depth:B+1,maxDepth:z};if(Q.type===nu.Element&&"textarea"===Q.tagName&&void 0!==Q.attributes.value);else for(var X of Array.from(gu.childNodes(t))){var tt=Vh(X,Y);tt&&Q.childNodes.push(tt)}var et=null;if(Vu(t)&&(et=gu.shadowRoot(t)))for(var it of Array.from(gu.childNodes(et))){var rt=Vh(it,Y);rt&&(Zu(et)&&(rt.isShadow=!0),Q.childNodes.push(rt))}}var nt=gu.parentNode(t);if(nt&&Gu(nt)&&Zu(nt)&&(Q.isShadow=!0),Q.type===nu.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 a=()=>e();if("complete"!==r){var o=!1,l=null,u=()=>{o||(o=!0,null!==l&&(clearTimeout(l),l=null),qh(t,"load",h),t.addEventListener("load",a),e())},h=()=>u();return l=setTimeout(u,i),t.addEventListener("load",h),()=>{null!==l&&(clearTimeout(l),l=null),o?qh(t,"load",a):(o=!0,qh(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",a),()=>{clearTimeout(c),qh(t,"load",a)}}return t.addEventListener("load",a),()=>{qh(t,"load",a)}}(t,(()=>{var e=t.contentDocument;if(e&&E){var i=Vh(e,{doc:e,mirror:r,blockClass:n,blockSelector:s,needsMask:U,maskTextClass:a,maskTextSelector:o,skipChild:!1,inlineStylesheet:d,maskInputOptions:c,maskTextFn:f,maskInputFn:p,maskAllElementAttributes:m,maskAttributeFn:y,slimDOMOptions:b,dataURLOptions:w,inlineImages:S,recordCanvas:C,canvasMaskingConfigured:T,preserveWhiteSpace:V,onSerialize:M,onIframeLoad:E,iframeLoadTimeout:R,onIframeListenerRegistered:P,onStylesheetLoad:A,stylesheetLoadTimeout:O,keepIframeSrcFn:D,depth:B+1,maxDepth:z});i&&E(t,i)}}),R);null==P||P(t,st)}return Q.type===nu.Element&&"link"===Q.tagName&&"stylesheet"===Q.attributes.rel&&function(e,l,u){if(!jh.has(e)){var h;try{h=e.sheet}catch(t){return}if(!h){var v=new AbortController,g=!1,_=()=>{if(!g){g=!0;try{(()=>{if(A){var e=Vh(t,{doc:i,mirror:r,blockClass:n,blockSelector:s,needsMask:U,maskTextClass:a,maskTextSelector:o,skipChild:!1,inlineStylesheet:d,maskInputOptions:c,maskTextFn:f,maskInputFn:p,maskAllElementAttributes:m,maskAttributeFn:y,slimDOMOptions:b,dataURLOptions:w,inlineImages:S,recordCanvas:C,canvasMaskingConfigured:T,preserveWhiteSpace:V,onSerialize:M,onIframeLoad:E,iframeLoadTimeout:R,onStylesheetLoad:A,stylesheetLoadTimeout:O,keepIframeSrcFn:D,depth:B,maxDepth:z});e&&A(t,e)}})()}finally{jh.delete(e),v.abort()}}},k=setTimeout(_,u);v.signal.addEventListener("abort",(()=>clearTimeout(k)),{once:!0}),e.addEventListener("load",_,{signal:v.signal,once:!0}),jh.set(e,v)}}}(t,0,O),Q}function Gh(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 Zh{constructor(){Kl(this,"parentElement",null),Kl(this,"parentNode",null),Kl(this,"ownerDocument"),Kl(this,"firstChild",null),Kl(this,"lastChild",null),Kl(this,"previousSibling",null),Kl(this,"nextSibling",null),Kl(this,"ELEMENT_NODE",1),Kl(this,"TEXT_NODE",3),Kl(this,"nodeType"),Kl(this,"nodeName"),Kl(this,"RRNodeType")}get childNodes(){for(var t=[],e=this.firstChild;e;)t.push(e),e=e.nextSibling;return t}contains(t){if(!(t instanceof Zh))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 Qh(t,e,i){void 0===i&&(i=document);var r={capture:!0,passive:!0};return i.addEventListener(t,e,r),()=>Jh(i,t,e,r)}function Jh(t,e,i,r){Kh((()=>{var n=t.removeEventListener;"function"==typeof n&&(void 0!==r?n.call(t,e,i,r):n.call(t,e,i))}))}function Kh(t){try{t()}catch(t){if(!(t instanceof DOMException&&"SecurityError"===t.name))throw t}}var Yh="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.",Xh={map:{},getId(){return console.error(Yh),-1},getNode(){return console.error(Yh),null},removeNodeFromMap(){console.error(Yh)},has(){return console.error(Yh),!1},reset(){console.error(Yh)}};function td(t,e,i){void 0===i&&(i={});var r=null,n=0;return function(){for(var s=arguments.length,a=new Array(s),o=0;s>o;o++)a[o]=arguments[o];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,a)):r||!1===i.trailing||(r=setTimeout((()=>{n=!1===i.leading?0:Date.now(),r=null,t.apply(h,a)}),u))}}function ed(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)}}}),()=>ed(t,e,s||{},!0)}"undefined"!=typeof window&&window.Proxy&&window.Reflect&&(Xh=new Proxy(Xh,{get(t,e,i){return"map"===e&&console.error(Yh),Reflect.get(t,e,i)}}));var id=Date.now;function rd(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=gu.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=gu.parentElement(s.body))?void 0:r.scrollTop)||(null==(n=null==s?void 0:s.body)?void 0:n.scrollTop)||0}}function nd(){return window.innerHeight||document.documentElement&&document.documentElement.clientHeight||document.body&&document.body.clientHeight}function sd(){return window.innerWidth||document.documentElement&&document.documentElement.clientWidth||document.body&&document.body.clientWidth}function ad(t){return t?t.nodeType===t.ELEMENT_NODE?t:gu.parentElement(t):null}function od(t,e,i,r){if(!t)return!1;var n=ad(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($h(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 ld(t,e,i){return!("TITLE"!==t.tagName||!i.headTitleMutations)||e.getId(t)===Mh}function ud(t,e){if(Gu(t))return!1;var i=e.getId(t);if(!e.has(i))return!0;var r=gu.parentNode(t);return(!r||r.nodeType!==t.DOCUMENT_NODE)&&(!r||ud(r,e))}function hd(t){return Boolean(t.changedTouches)}function dd(t,e){return Boolean("IFRAME"===t.nodeName&&e.getMeta(t))}function vd(t,e){return Boolean("LINK"===t.nodeName&&t.nodeType===t.ELEMENT_NODE&&t.getAttribute&&"stylesheet"===t.getAttribute("rel")&&e.getMeta(t))}function cd(t){return!!t&&(t instanceof Zh&&"shadowRoot"in t?Boolean(t.shadowRoot):Boolean(gu.shadowRoot(t)))}/[1-9][0-9]{12}/.test(Date.now().toString())||(id=()=>(new Date).getTime());class fd{constructor(){Kl(this,"id",1),Kl(this,"styleIDMap",new WeakMap),Kl(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 pd(t){var e,i=null;return"getRootNode"in t&&(null==(e=gu.getRootNode(t))?void 0:e.nodeType)===Node.DOCUMENT_FRAGMENT_NODE&&gu.host(gu.getRootNode(t))&&(i=gu.host(gu.getRootNode(t))),i}function gd(t){var e=t.ownerDocument;return!!e&&(gu.contains(e,t)||function(t){var e=t.ownerDocument;if(!e)return!1;var i=function(t){for(var e,i=t;e=pd(i);)i=e;return i}(t);return gu.contains(e,i)}(t))}function md(t){return"__ln"in t}class yd{constructor(){Kl(this,"length",0),Kl(this,"head",null),Kl(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&&md(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&&md(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 bd,_d=(t,e)=>t+"@"+e;class wd{constructor(){Kl(this,"frozen",!1),Kl(this,"locked",!1),Kl(this,"texts",[]),Kl(this,"attributes",[]),Kl(this,"attributeMap",new WeakMap),Kl(this,"generatedAttributes",new WeakMap),Kl(this,"removes",[]),Kl(this,"mapRemoves",[]),Kl(this,"movedMap",{}),Kl(this,"addedSet",new Set),Kl(this,"movedSet",new Set),Kl(this,"droppedSet",new Set),Kl(this,"removesSubTreeCache",new Set),Kl(this,"mutationCb"),Kl(this,"blockClass"),Kl(this,"blockSelector"),Kl(this,"maskTextClass"),Kl(this,"maskTextSelector"),Kl(this,"inlineStylesheet"),Kl(this,"maskInputOptions"),Kl(this,"maskTextFn"),Kl(this,"maskInputFn"),Kl(this,"maskAllElementAttributes"),Kl(this,"maskAttributeFn"),Kl(this,"keepIframeSrcFn"),Kl(this,"recordCanvas"),Kl(this,"canvasMaskingConfigured"),Kl(this,"inlineImages"),Kl(this,"slimDOMOptions"),Kl(this,"dataURLOptions"),Kl(this,"doc"),Kl(this,"mirror"),Kl(this,"iframeManager"),Kl(this,"stylesheetManager"),Kl(this,"shadowDomManager"),Kl(this,"canvasManager"),Kl(this,"processedNodeManager"),Kl(this,"unattachedDoc"),Kl(this,"canvasManagerReleased",!1),Kl(this,"processMutations",(t=>{t.forEach(this.processMutation),this.emit()})),Kl(this,"emit",(()=>{if(!this.frozen&&!this.locked){var t,e,i=yu(),r=ku();try{this.processBufferedMutations()}finally{t=yu()-i,e=r,xu>0||Su(t,null!=e?e:bu)||t>Fu.slowestBatchMs&&(Fu.slowestBatchMs=t)}}})),Kl(this,"processBufferedMutations",(()=>{for(var t=[],e=new Set,i=new yd,r=t=>{for(var e=t,i=Mh;i===Mh;)i=(e=e&&e.nextSibling)&&this.mirror.getId(e);return i},n=n=>{var s=gu.parentNode(n);if(s&&gd(n)&&"TEXTAREA"!==s.tagName){var a=Gu(s)?this.mirror.getId(pd(n)):this.mirror.getId(s),o=r(n);if(-1===a||-1===o)return i.addNode(n);var l=Vh(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=>{dd(t,this.mirror)&&this.iframeManager.addIframe(t),vd(t,this.mirror)&&this.stylesheetManager.trackLinkElement(t),cd(t)&&!od(t,this.blockClass,this.blockSelector,!0)&&this.shadowDomManager.addShadowRoot(gu.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:a,nextId:o,node:l}),e.add(l.id))}};this.mapRemoves.length;)this.mirror.removeNodeFromMap(this.mapRemoves.shift());for(var s of this.movedSet)Sd(this.removesSubTreeCache,s)&&!this.movedSet.has(gu.parentNode(s))||n(s);for(var a of this.addedSet)xd(this.droppedSet,a)||Sd(this.removesSubTreeCache,a)?xd(this.movedSet,a)?n(a):this.droppedSet.add(a):n(a);for(var o=null;i.length;){var l=null;if(o){var u=this.mirror.getId(gu.parentNode(o.value)),h=r(o.value);-1!==u&&-1!==h&&(l=o)}if(!l)for(var d=i.tail;d;){var v=d;if(d=d.previous,v){var c=this.mirror.getId(gu.parentNode(v.value));if(-1===r(v.value))continue;if(-1!==c){l=v;break}var f=gu.parentNode(v.value);if(f&&f.nodeType===Node.DOCUMENT_FRAGMENT_NODE){var p=gu.host(f);if(-1!==this.mirror.getId(p)){l=v;break}}}}if(!l){for(;i.head;)i.removeNode(i.head.value);break}o=l.previous,i.removeNode(l.value),n(l.value)}var g={texts:this.texts.map((t=>{var e=t.node,i=gu.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 a=s[0],o=s[1];"string"!=typeof o&&null!==o||(i[a]=hh({element:t.node,name:a,value:o,maskAllElementAttributes:this.maskAllElementAttributes,maskAttributeFn:this.maskAttributeFn,isGenerated:null==(e=this.generatedAttributes.get(t.node))?void 0:e.has(a)}))}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))})),Kl(this,"bufferBelongsToIframe",(t=>this.doc===t.contentDocument)),Kl(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(gu.childNodes(t),(t=>gu.textContent(t)||"")).join("");e.attributes.value=oh({element:t,maskInputOptions:this.maskInputOptions,tagName:t.tagName,type:vh(t),value:i,maskInputFn:this.maskInputFn})})),Kl(this,"processMutation",(t=>{var e;if(!ld(t.target,this.mirror,this.slimDOMOptions))switch(t.type){case"characterData":var i=gu.textContent(t.target);od(t.target,this.blockClass,this.blockSelector,!1)||i===t.oldValue||this.texts.push({value:Nh(t.target,this.maskTextClass,this.maskTextSelector,!0)&&i?this.maskTextFn?this.maskTextFn(i,ad(t.target)):i.replace(/[\S]/g,"*"):i,node:t.target});break;case"attributes":var r,n=t.target,s=t.attributeName,a=null!==(r=t.attributeNamespace)&&void 0!==r?r:null,o=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,a),l=a?n.getAttributeNS(a,s):t.target.getAttribute(s);if("value"===o){var u=n,h=vh(u);l=oh({element:u,maskInputOptions:this.maskInputOptions,tagName:n.tagName,type:h,value:l,maskInputFn:this.maskInputFn})}if(od(t.target,this.blockClass,this.blockSelector,!1)||l===t.oldValue)return;var d=this.attributeMap.get(t.target),v="IFRAME"===n.tagName&&"src"===o;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"===o&&"INPUT"===n.tagName&&"password"===(t.oldValue||"").toLowerCase()&&n.setAttribute("data-rr-is-password","true"),!Dh(n.tagName,o)){var c=Lh(this.doc,lh(n.tagName),lh(o),l,n,this.dataURLOptions);if(v&&!this.keepIframeSrcFn(l)&&(o="rr_src"),d.attributes[o]=c,null==(e=this.generatedAttributes.get(t.target))||e.delete(o),"style"===o){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 b of Array.from(f.style))""===p.getPropertyValue(b)&&(d.styleDiff[b]=!1)}else if("open"===o&&"DIALOG"===n.tagName){d.attributes.rr_open_mode=n.matches("dialog:modal")?"modal":"non-modal";var _=this.generatedAttributes.get(t.target);_||this.generatedAttributes.set(t.target,_=new Set),_.add("rr_open_mode")}}break;case"childList":if(od(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=Gu(t.target)?this.mirror.getId(gu.host(t.target)):this.mirror.getId(t.target);od(t.target,this.blockClass,this.blockSelector,!1)||ld(e,this.mirror,this.slimDOMOptions)||!function(t,e){return-1!==e.getId(t)}(e,this.mirror)||(this.addedSet.has(e)?(kd(this.addedSet,e),this.droppedSet.add(e)):this.addedSet.has(t.target)&&-1===i||ud(t.target,this.mirror)||(this.movedSet.has(e)&&this.movedMap[_d(i,r)]?kd(this.movedSet,e):(this.removes.push({parentId:r,id:i,isShadow:!(!Gu(t.target)||!Zu(t.target))||void 0}),function(t,e){for(var i=[t];i.length;){var r=i.pop();e.has(r)||(e.add(r),gu.childNodes(r).forEach((t=>i.push(t))))}}(e,this.removesSubTreeCache))),this.mapRemoves.push(e))}))}})),Kl(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(ld(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[_d(this.mirror.getId(t),i)]=!0)}else this.addedSet.add(t),this.droppedSet.delete(t);od(t,this.blockClass,this.blockSelector,!1)||(gu.childNodes(t).forEach((t=>this.genAdds(t))),cd(t)&&gu.childNodes(gu.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 kd(t,e){for(var i=[e];i.length;){var r=i.pop();t.delete(r),gu.childNodes(r).forEach((t=>i.push(t)))}}function Sd(t,e,i){return 0!==t.size&&function(t,e,i){var r=gu.parentNode(e);return!!r&&t.has(r)}(t,e)}function xd(t,e){if(0===t.size)return!1;for(var i=gu.parentNode(e);i;){if(t.has(i))return!0;i=gu.parentNode(i)}return!1}var Cd=function(t,e){return void 0===e&&(e="rrweb"),bd?function(){try{return t(...arguments)}catch(t){if(bd&&!0===bd(t,e))return;throw t}}:t},Td=[];function Md(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 Ed(t,e){var i,r=new wd;r.init(t);try{i=new(fu())(Cd(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),Td.push(r),{observer:i,buffer:r}}catch(t){try{null==i||i.disconnect(),r.destroy(),r.reset()}catch(t){}throw t}}function Id(t){var e=t.scrollCb,i=t.doc,r=t.mirror,n=t.blockClass,s=t.blockSelector,a=t.sampling,o=new Map,l=t=>{var a=Md(t);if(a&&!od(a,n,s,!0)){var l,u,h=r.getId(a);if(a===i&&i.defaultView){var d=rd(i.defaultView);l=d.left,u=d.top}else l=a.scrollLeft,u=a.scrollTop;var v=l+","+u;o.get(h)!==v&&(o.set(h,v),e({id:h,x:l,y:u}))}},u=[Qh("scroll",Cd(td(Cd((t=>l(t))),a.scroll||100)),i)];return"onscrollend"in i&&u.push(Qh("scrollend",Cd(l),i)),()=>u.forEach((t=>t()))}function Rd(t,e){for(var i=Td.length-1;i>=0;i--){var r=Td[i];if(r){var n=r.bufferBelongsToIframe(t);!n&&e&&e.has(r.bufferDoc())&&(n=!0),n&&(r.reset(),Td.splice(i,1))}}}var Pd=["INPUT","TEXTAREA","SELECT"],Ad=new WeakMap;function Fd(t){return function t(e,i){if(Nd("CSSGroupingRule")&&e.parentRule instanceof CSSGroupingRule||Nd("CSSMediaRule")&&e.parentRule instanceof CSSMediaRule||Nd("CSSSupportsRule")&&e.parentRule instanceof CSSSupportsRule||Nd("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 Od(t,e,i){var r,n;return t?(t.ownerNode?r=e.getId(t.ownerNode):n=i.getId(t),{styleId:n,id:r}):{}}var Ld=5e3;function Dd(t,e){var i,r,n,s,a=t.stylesheetManager;s=t.mirror.getId("#document"===e.nodeName?e:gu.host(e));var o="#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==o?void 0:o.prototype)?Object.getOwnPropertyDescriptor(null==o?void 0:o.prototype,"adoptedStyleSheets"):void 0;return null!==s&&-1!==s&&o&&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{a.adoptStyleSheets(t,s)}catch(t){}return i}}),Cd((()=>{Object.defineProperty(e,"adoptedStyleSheets",{configurable:l.configurable,enumerable:l.enumerable,get:l.get,set:l.set})}))):()=>{}}function $d(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,a=t.viewportResizeCb,o=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),a(...arguments)},t.inputCb=function(){e.input&&e.input(...arguments),o(...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,a,o,l,u,h,d,v,c=[],f=Cd((()=>{if(r){r.destroy(),r.reset();var e=Td.indexOf(r);-1!==e&&Td.splice(e,1)}t.shadowDomManager.resetForDoc(t.doc),null==i||i.disconnect(),c.forEach((t=>t()))}));try{if(t.recordDOM){var g=Ed(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,a="number"==typeof i.mousemove?i.mousemove:50,o="number"==typeof i.mousemoveCallback?i.mousemoveCallback:500,l=[],u=td(Cd((t=>{var i=Date.now()-s;e(l.map((t=>(t.timeOffset-=i,t))),t),l=[],s=null})),o),h=Cd(td(Cd((t=>{var e=Md(t),i=hd(t)?t.changedTouches[0]:t,r=i.clientX,a=i.clientY;s||(s=id()),l.push({x:r,y:a,id:n.getId(e),timeOffset:id()-s}),u("undefined"!=typeof DragEvent&&t instanceof DragEvent?Xl.Drag:t instanceof MouseEvent?Xl.MouseMove:Xl.TouchMove)})),a,{trailing:!1})),d=[Qh("mousemove",h,r),Qh("touchmove",h,r),Qh("drag",h,r)];return Cd((()=>{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,a=t.sampling;if(!1===a.mouseInteraction)return()=>{};var o=!0===a.mouseInteraction||void 0===a.mouseInteraction?{}:a.mouseInteraction,l=[],u=null;return Object.keys(tu).filter((t=>Number.isNaN(Number(t))&&!t.endsWith("_Departed")&&!1!==o[t])).forEach((t=>{var a=lh(t),o=(t=>i=>{var a=Md(i);if(!od(a,n,s,!0)){var o=null,l=t;if("pointerType"in i){switch(i.pointerType){case"mouse":o=eu.Mouse;break;case"touch":o=eu.Touch;break;case"pen":o=eu.Pen}o===eu.Touch&&(tu[t]===tu.MouseDown?l="TouchStart":tu[t]===tu.MouseUp&&(l="TouchEnd"))}else hd(i)&&(o=eu.Touch);null!==o?(u=o,(l.startsWith("Touch")&&o===eu.Touch||l.startsWith("Mouse")&&o===eu.Mouse)&&(o=null)):tu[t]===tu.Click&&(o=u,u=null);var h=hd(i)?i.changedTouches[0]:i;if(h){var d=r.getId(a),v=h.clientX,c=h.clientY;Cd(e)(p({type:tu[l],id:d,x:v,y:c},null!==o&&{pointerType:o}))}}})(t);if(window.PointerEvent)switch(tu[t]){case tu.MouseDown:case tu.MouseUp:a=a.replace("mouse","pointer");break;case tu.TouchStart:case tu.TouchEnd:return}l.push(Qh(a,o,i))})),Cd((()=>{l.forEach((t=>t()))}))}(t)),c.push(Id(t)),c.push(function(t,e){var i=t.viewportResizeCb,r=e.win,n=-1,s=-1;return Qh("resize",Cd(td(Cd((()=>{var t=nd(),e=sd();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,a=t.ignoreClass,o=t.ignoreSelector,l=t.maskInputOptions,u=t.maskInputFn,h=t.userTriggeredOnInput;function d(t){var e=Md(t),r=t.isTrusted,d=i.defaultView;if(!e||!d||e instanceof d.HTMLElement){var c=e&&e.tagName;if(e&&"OPTION"===c&&(e=gu.parentElement(e)),e&&c&&Pd.indexOf(c)>=0&&!od(e,n,s,!0)&&!(e.classList.contains(a)||o&&e.matches(o))){var f=e.value,p=!1,g=vh(e)||"";"radio"===g||"checkbox"===g?p=e.checked:(l[c.toLowerCase()]||l[g])&&(f=oh({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=Ad.get(t);if(!n||n.text!==i.text||n.isChecked!==i.isChecked){Ad.set(t,i);var s=r.getId(t);Cd(e)(p({},i,{id:s}))}}var c=("last"===t.sampling.input?["change"]:["input","change"]).map((t=>Qh(t,Cd(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=>ed(t[0],t[1],{set(){Cd(d)({target:this,isTrusted:!1})}},!1,f)))),Cd((()=>{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,a=t.doc,o=Cd((t=>td(Cd((s=>{var a=Md(s);if(a&&!od(a,i,r,!0)){var o=a.currentTime,l=a.volume,u=a.muted,h=a.playbackRate,d=a.loop;e({type:t,id:n.getId(a),currentTime:o,volume:l,muted:u,playbackRate:h,loop:d})}})),s.media||500))),l=[Qh("play",o(ru.Play),a),Qh("pause",o(ru.Pause),a),Qh("seeked",o(ru.Seeked),a),Qh("volumechange",o(ru.VolumeChange),a),Qh("ratechange",o(ru.RateChange),a)];return Cd((()=>{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(a,o,l){if(!r)return()=>{};var u=e.get(a);u||e.set(a,u=[]);var h={emit:o,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(a))};try{d=t.setTimeout(f,Ld),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(a)))}},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,a=e.mutationQueue;if(!s.CSSStyleSheet||!s.CSSStyleSheet.prototype)return()=>{};var o=s.CSSStyleSheet.prototype.insertRule;s.CSSStyleSheet.prototype.insertRule=new Proxy(o,{apply:Cd(((t,e,s)=>{var o=s[0],l=t.apply(e,s);n.onCssomSheetMutation(e);var u=Od(e,r,n.styleMirror),h=u.id,d=u.styleId;return(h&&-1!==h||d&&-1!==d)&&a.queueMutation(e,(()=>i({id:h,styleId:d,adds:[{rule:o,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:Cd(((t,e,s)=>{var o=s[0],l=t.apply(e,s);n.onCssomSheetMutation(e);var u=Od(e,r,n.styleMirror),h=u.id,d=u.styleId;return(h&&-1!==h||d&&-1!==d)&&a.queueMutation(e,(()=>i({id:h,styleId:d,removes:[{index:o}]}))),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:Cd(((t,e,s)=>{var o=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=Od(e,r,n.styleMirror),d=h.id,v=h.styleId;if(!(d&&-1!==d||v&&-1!==v))return l;var c=a.queuePendingMutation(e,(()=>i({id:d,styleId:v,replace:o})),(()=>{var t=Yu(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:Cd(((t,e,s)=>{var o=s[0],l=t.apply(e,s);n.onCssomSheetMutation(e);var u=Od(e,r,n.styleMirror),h=u.id,d=u.styleId;return(h&&-1!==h||d&&-1!==d)&&a.queueMutation(e,(()=>i({id:h,styleId:d,replaceSync:o}))),l}),"host")}));var d={};qd("CSSGroupingRule")?d.CSSGroupingRule=s.CSSGroupingRule:(qd("CSSMediaRule")&&(d.CSSMediaRule=s.CSSMediaRule),qd("CSSConditionRule")&&(d.CSSConditionRule=s.CSSConditionRule),qd("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:Cd(((t,e,s)=>{var o=s[0],l=t.apply(e,s);n.onCssomSheetMutation(e.parentStyleSheet);var u=Od(e.parentStyleSheet,r,n.styleMirror),h=u.id,d=u.styleId;if(e.parentStyleSheet&&(h&&-1!==h||d&&-1!==d)){var v=[...Fd(e),l];a.queueMutation(e.parentStyleSheet,(()=>i({id:h,styleId:d,adds:[{rule:o,index:v}]})))}return l}),"host")}),s.prototype.deleteRule=new Proxy(v[e].deleteRule,{apply:Cd(((t,e,s)=>{var o=s[0],l=t.apply(e,s);n.onCssomSheetMutation(e.parentStyleSheet);var u=Od(e.parentStyleSheet,r,n.styleMirror),h=u.id,d=u.styleId;if(e.parentStyleSheet&&(h&&-1!==h||d&&-1!==d)){var v=[...Fd(e),o];a.queueMutation(e.parentStyleSheet,(()=>i({id:h,styleId:d,removes:[{index:v}]})))}return l}),"host")})})),Cd((()=>{s.CSSStyleSheet.prototype.insertRule=o,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(Dd(t,t.doc)),c.push(function(t,e){var i=t.styleDeclarationCb,r=t.mirror,n=t.ignoreCSSAttributes,s=t.stylesheetManager,a=e.win,o=e.mutationQueue,l=a.CSSStyleDeclaration.prototype.setProperty;a.CSSStyleDeclaration.prototype.setProperty=new Proxy(l,{apply:Cd(((t,e,a)=>{var l,u=a[0],h=a[1],d=a[2],v=t.apply(e,a);if(n.has(u))return v;var c=null==(l=e.parentRule)?void 0:l.parentStyleSheet;s.onCssomSheetMutation(c);var f=Od(c,r,s.styleMirror),p=f.id,g=f.styleId;if(p&&-1!==p||g&&-1!==g){var m=Fd(e.parentRule);o.queueMutation(c,(()=>i({id:p,styleId:g,set:{property:u,value:h,priority:d},index:m})))}return v}),"host")});var u=a.CSSStyleDeclaration.prototype.removeProperty;return a.CSSStyleDeclaration.prototype.removeProperty=new Proxy(u,{apply:Cd(((t,e,a)=>{var l,u=a[0],h=t.apply(e,a);if(n.has(u))return h;var d=null==(l=e.parentRule)?void 0:l.parentStyleSheet;s.onCssomSheetMutation(d);var v=Od(d,r,s.styleMirror),c=v.id,f=v.styleId;if(c&&-1!==c||f&&-1!==f){var p=Fd(e.parentRule);o.queueMutation(d,(()=>i({id:c,styleId:f,remove:{property:u},index:p})))}return h}),"host")}),Cd((()=>{a.CSSStyleDeclaration.prototype.setProperty=l,a.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,a=r.FontFace;r.FontFace=function(t,e,i){var r=new a(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 o=pu(i.fonts,"add",(function(t){return function(i){return setTimeout(Cd((()=>{var t=s.get(i);t&&(e(t),s.delete(i))})),0),t.apply(this,[i])}}));return n.push((()=>{r.FontFace=a})),n.push(o),Cd((()=>{n.forEach((t=>t()))}))}(t))}for(var y of(c.push((a=(s=t).doc,o=s.mirror,l=s.blockClass,u=s.blockSelector,h=s.selectionCb,d=!0,(v=Cd((()=>{var t=a.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;od(s,l,u,!0)||od(c,l,u,!0)||e.push({start:o.getId(s),startOffset:v,end:o.getId(c),endOffset:f})}h({ranges:e})}})))(),Qh("selectionchange",v))),c.push(function(t){var e=t.customElementCb,i=t.doc.defaultView;return i&&i.customElements?pu(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 Nd(t){return void 0!==window[t]}function qd(t){return Boolean(void 0!==window[t]&&window[t].prototype&&"insertRule"in window[t].prototype&&"deleteRule"in window[t].prototype)}class jd{constructor(t){Kl(this,"iframeRemoteIdToLocalIdMap",new WeakMap),Kl(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),a=n.get(e);return void 0===a&&(a=this.generateIdFn(),n.set(e,a),s.set(a,e)),a}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 Bd{constructor(t){Kl(this,"iframes",new WeakMap),Kl(this,"crossOriginIframeMap",new WeakMap),Kl(this,"crossOriginIframeMirror",new jd(Eh)),Kl(this,"crossOriginIframeStyleMirror"),Kl(this,"crossOriginIframeRootIdMap",new WeakMap),Kl(this,"mirror"),Kl(this,"mutationCb"),Kl(this,"wrappedEmit"),Kl(this,"loadListener"),Kl(this,"pageHideListener"),Kl(this,"stylesheetManager"),Kl(this,"recordCrossOriginIframes"),Kl(this,"messageHandler"),Kl(this,"nestedIframeListeners",new Map),Kl(this,"attachedWindows",new WeakMap),Kl(this,"attachedDocuments",new WeakMap),Kl(this,"attachedIframes",new Map),Kl(this,"loadListenerDisposers",new WeakMap),Kl(this,"iframeElementsById",new Map),Kl(this,"pageHideHandlers",new WeakMap),this.mutationCb=t.mutationCb,this.wrappedEmit=t.wrappedEmit,this.stylesheetManager=t.stylesheetManager,this.recordCrossOriginIframes=t.recordCrossOriginIframes,this.crossOriginIframeStyleMirror=new jd(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=>Kh(t))),this.loadListenerDisposers.delete(t))}removePageHideListener(t){var e=this.pageHideHandlers.get(t);e&&(e.forEach((t=>{Jh(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 a=this.handleMessage.bind(this);Kh((()=>{s.addEventListener("message",a),this.nestedIframeListeners.set(s,a);var e=this.attachedWindows.get(t);e||this.attachedWindows.set(t,e=new Set),e.add(s)}))}Kh((()=>{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 Yl.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:Yl.IncrementalSnapshot,data:{source:Xl.Mutation,adds:[{parentId:this.mirror.getId(t),nextId:null,node:e.data.node}],removes:[],texts:[],attributes:[],isAttachIframe:!0}};case Yl.Meta:case Yl.Load:case Yl.DomContentLoaded:return!1;case Yl.Plugin:return e;case Yl.Custom:return this.replaceIds(e.data.payload,t,["id","parentId","previousId","nextId"]),e;case Yl.IncrementalSnapshot:switch(e.data.source){case Xl.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 Xl.Drag:case Xl.TouchMove:case Xl.MouseMove:return e.data.positions.forEach((e=>{this.replaceIds(e,t,["id"])})),e;case Xl.ViewportResize:return!1;case Xl.MediaInteraction:case Xl.MouseInteraction:case Xl.Scroll:case Xl.CanvasMutation:case Xl.Input:return this.replaceIds(e.data,t,["id"]),e;case Xl.StyleSheetRule:case Xl.StyleDeclaration:return this.replaceIds(e.data,t,["id"]),this.replaceStyleIds(e.data,t,["styleId"]),e;case Xl.Font:return e;case Xl.Selection:return e.data.ranges.forEach((e=>{this.replaceIds(e,t,["start","end"])})),e;case Xl.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===nu.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&&(Jh(t,"message",e),this.nestedIframeListeners.delete(t)),this.crossOriginIframeMap.delete(t)})),this.attachedWindows.delete(i)),r&&this.nestedIframeListeners.has(r)&&(Jh(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=>{Kh((()=>this.mirror.removeNodeFromMap(t)))})),Kh((()=>Rd(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&&Jh(window,"message",this.messageHandler),this.nestedIframeListeners.forEach(((t,e)=>{Jh(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 Hd{constructor(t){Kl(this,"shadowDoms",new WeakSet),Kl(this,"mutationCb"),Kl(this,"scrollCb"),Kl(this,"bypassOptions"),Kl(this,"mirror"),Kl(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(Zu(t)&&!this.shadowDoms.has(t)){this.shadowDoms.add(t);var n=null!==(i=null==(r=gu.host(t))?void 0:r.ownerDocument)&&void 0!==i?i:e,s=Ed(p({},this.bypassOptions,{doc:n,mutationCb:this.mutationCb,mirror:this.mirror,shadowDomManager:this}),t),a=s.observer,o=s.buffer;this.restoreHandlers.push({doc:n,handler(){a.disconnect(),o.destroy(),o.releaseCanvasManager();var t=Td.indexOf(o);-1!==t&&Td.splice(t,1)}}),this.restoreHandlers.push({doc:n,handler:Id(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(gu.host(t))),this.restoreHandlers.push({doc:n,handler:Dd({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:pu(t.prototype,"attachShadow",(function(t){return function(r){var n=t.call(this,r),s=gu.shadowRoot(this);return s&&gd(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 zd="skip-frame";function Ud(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 Wd="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",Vd="undefined"==typeof Uint8Array?[]:new Uint8Array(256),Gd=0;64>Gd;Gd++)Vd[Wd.charCodeAt(Gd)]=Gd;var Zd=new Map,Qd=(t,e,i)=>{if(t&&(Yd(t,e)||"object"==typeof t)){var r=function(t,e){var i=Zd.get(t);return i||Zd.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 Jd(t,e,i,r){if(t instanceof Array)return t.map((t=>Jd(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+=Wd[i[e]>>2],n+=Wd[(3&i[e])<<4|i[e+1]>>4],n+=Wd[(15&i[e+1])<<2|i[e+2]>>6],n+=Wd[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:[Jd(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:[Jd(t.data,e,i,r),t.width,t.height]}:Yd(t,e)||"object"==typeof t?{rr_type:t.constructor.name,index:Qd(t,e,i)}:t}var Kd=(t,e,i,r)=>t.map((t=>Jd(t,e,i,r))),Yd=(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])))},Xd=["webgl","webgl2"];function tv(t){return"nodeType"in t}function ev(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 pu(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||tv(s)&&od(s,e,i,!0))return r.call(this,n);tv(s)&&!("__context"in s)&&(s.__context="webgpu");var a=function(t){var e=t.GPUTextureUsage;return e?e.COPY_SRC|e.RENDER_ATTACHMENT:null}(t);return r.call(this,null!==a&&n?p({},n,{usage:"number"==typeof n.usage?n.usage|a:a}):n)}}))}(t,e,i);s&&n.push(s)}var a=pu(t.HTMLCanvasElement.prototype,"getContext",(function(t){return function(n){for(var s=function(t){return"experimental-webgl"===t?"webgl":t}(n),a=arguments.length,o=new Array(a>1?a-1:0),l=1;a>l;l++)o[l-1]=arguments[l];if(!od(this,e,i,!0)&&("__context"in this||(this.__context=s),r&&Xd.includes(s)))if(o[0]&&"object"==typeof o[0]){var u=o[0];u.preserveDrawingBuffer||(u.preserveDrawingBuffer=!0)}else o.splice(0,1,{preserveDrawingBuffer:!0});return t.apply(this,[n,...o])}}));n.push(a)}catch(t){console.error("failed to patch HTMLCanvasElement.prototype.getContext")}return()=>{n.forEach((t=>t()))}}function iv(t,e,i,r,n,s,a){var o=[],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=pu(t,l,(function(t){return function(){for(var o=arguments.length,u=new Array(o),h=0;o>h;h++)u[h]=arguments[h];var d=t.apply(this,u);if(Qd(d,s,this),this.canvas&&"tagName"in this.canvas&&!od(this.canvas,r,n,!0)){var v=Kd(u,s,this,a);i(this.canvas,{type:e,property:l,args:v})}return d}}));o.push(u)}catch(s){var h=ed(t,l,{set(t){this.canvas&&"tagName"in this.canvas&&!od(this.canvas,r,n,!0)&&i(this.canvas,{type:e,property:l,args:[t],setter:!0})}});o.push(h)}};for(var h of l)u(h);return o}var rv,nv,sv,av='(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',ov="undefined"!=typeof self&&self.Blob&&new Blob([av],{type:"text/javascript;charset=utf-8"});function lv(t){var e;try{if(!(e=ov&&(self.URL||self.webkitURL).createObjectURL(ov)))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(av),{name:null==t?void 0:t.name})}finally{e&&(self.URL||self.webkitURL).revokeObjectURL(e)}}class uv{constructor(t){Kl(this,"pendingCanvasMutations",new Map),Kl(this,"rafStamps",{latestId:0,invokeId:null}),Kl(this,"mirror"),Kl(this,"mutationCb"),Kl(this,"resetObservers"),Kl(this,"frozen",!1),Kl(this,"locked",!1),Kl(this,"rafIdTimestamp",null),Kl(this,"rafIdFlush",null),Kl(this,"refCount",0),Kl(this,"torndown",!1),Kl(this,"resetFrameDedup",null),Kl(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,a=t.recordCanvas,o=t.dataURLOptions,l=t.resolutionScale,u=t.canvasMasking;this.mutationCb=t.mutationCb,this.mirror=t.mirror,a&&"all"===i&&this.initCanvasMutationObserver(r,n,s,o),a&&"number"==typeof i&&this.initCanvasFPSObserver(i,r,n,s,{dataURLOptions:o,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 a,o="number"==typeof n.resolutionScale&&Number.isFinite(n.resolutionScale)?Math.min(1,Math.max(.1,n.resolutionScale)):1,l=ev(e,i,r,!0),u=new Map;try{a=new lv}catch(t){return}var h=!1;a.onerror=()=>{var t;h=!0,cancelAnimationFrame(d),null==(t=a.terminate)||t.call(a),this.resetFrameDedup=null},this.resetFrameDedup=()=>{a.postMessage({resetFrameDedup:!0})},a.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:iu["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=>{od(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*o)),c=Math.max(1,Math.round(d*o)),f=function(t,e,i,r,n,s){if(t&&"function"==typeof t.regionsFn){var a;try{a=t.regionsFn(e)}catch(t){return zd}if(void 0!==a){if(!Array.isArray(a)||!a.every(Ud))return zd;var o=i/n,l=r/s;return a.filter((t=>t.width>0&&t.height>0)).map((t=>{var e=Math.floor(t.x*o),i=Math.floor(t.y*l);return{x:e,y:i,width:Math.ceil((t.x+t.width)*o)-e,height:Math.ceil((t.y+t.height)*l)-i}}))}}}(n.canvasMasking,t,v,c,h,d);if(f===zd)return void u.set(r,!1);var p=yield createImageBitmap(t,1>o?{resizeWidth:v,resizeHeight:c,resizeQuality:"medium"}:{resizeWidth:v,resizeHeight:c});a.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=a.terminate)||t.call(a),this.resetFrameDedup=null}}}initCanvasMutationObserver(t,e,i,r){this.startRAFTimestamping(),this.startPendingCanvasMutationFlusher();var n=ev(t,e,i,!1),s=function(t,e,i,r,n){var s=[],a=Object.getOwnPropertyNames(e.CanvasRenderingContext2D.prototype),o=function(a){try{if("function"!=typeof e.CanvasRenderingContext2D.prototype[a])return 1;var o=pu(e.CanvasRenderingContext2D.prototype,a,(function(s){return function(){for(var o=arguments.length,l=new Array(o),u=0;o>u;u++)l[u]=arguments[u];return od(this.canvas,i,r,!0)||setTimeout((()=>{var i=Kd(l,e,this,n);t(this.canvas,{type:iu["2D"],property:a,args:i})}),0),s.apply(this,l)}}));s.push(o)}catch(n){var l=ed(e.CanvasRenderingContext2D.prototype,a,{set(e){od(this.canvas,i,r,!0)||t(this.canvas,{type:iu["2D"],property:a,args:[e],setter:!0})}});s.push(l)}};for(var l of a)o(l);return()=>{s.forEach((t=>t()))}}(this.processMutation.bind(this),t,e,i,r),a=function(t,e,i,r,n){var s=[];return void 0!==e.WebGLRenderingContext&&s.push(...iv(e.WebGLRenderingContext.prototype,iu.WebGL,t,i,r,e,n)),void 0!==e.WebGL2RenderingContext&&s.push(...iv(e.WebGL2RenderingContext.prototype,iu.WebGL2,t,i,r,e,n)),()=>{s.forEach((t=>t()))}}(this.processMutation.bind(this),t,e,i,r);this.resetObservers=()=>{n(),s(),a()}}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,Ql)));this.mutationCb({id:e,type:i[0].type,commands:r}),this.pendingCanvasMutations.delete(t)}}}}class hv{constructor(t){var e;Kl(this,"trackedLinkElements",new WeakSet),Kl(this,"pendingDeferredSheets",new Set),Kl(this,"mutationCb"),Kl(this,"adoptedStyleSheetCb"),Kl(this,"maskAllElementAttributes"),Kl(this,"maskAttributeFn"),Kl(this,"styleMirror",new fd),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=sh(r))}catch(t){}if(!i||!r)return Uu(),null;var n=i,s=!1,a={sheet:r,invalidate(){s=!0}};this.pendingDeferredSheets.add(a);var o=!1;return{advance:i=>{if(o)return!0;var l,u,h=yu(),d=ku(),v=!0;try{if(s)return o=!0,Uu(),!0;if(!n.advance(i))return v=!1,!1;o=!0;var c=n.text();if(!t.isConnected)return!0;var f=null;try{f=t.sheet}catch(t){}return f!==r?(Uu(),!0):c?(this.emitCssTextMutation(t,e,c),!0):(Uu(),!0)}finally{v&&this.pendingDeferredSheets.delete(a),Su(l=yu()-h,null!=(u=d)?u:bu)||(Ou.totalMs+=l,l>Ou.slowestSliceMs&&(Ou.slowestSliceMs=l))}},remainingRules:()=>n.remainingRules(),discard:()=>{this.pendingDeferredSheets.delete(a)}}}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:hh({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 a=yu();try{Bu((()=>{try{var e=t.rules||t.cssRules;e&&ju(e)}catch(t){}n.push({styleId:s,rules:Array.from(t.rules||CSSRule,((e,i)=>({rule:Xu(e,t.href),index:i})))})}))}finally{Hu(yu()-a)}}r.styleIds.push(e)};for(var a of t)s(a);n.length>0&&(r.styles=n),this.adoptedStyleSheetCb(r)}}reset(){this.styleMirror.reset(),this.trackedLinkElements=new WeakSet,this.pendingDeferredSheets.clear(),jh.forEach((t=>t.abort())),jh.clear()}trackStylesheetInLinkElement(t){}}class dv{constructor(){Kl(this,"nodeMap",new WeakMap),Kl(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 vv=!1;try{if(2!==Array.from([1],(t=>2*t))[0]){var cv=document.createElement("iframe");document.body.appendChild(cv),Array.from=(null==(Zl=cv.contentWindow)?void 0:Zl.Array.from)||Array.from,document.body.removeChild(cv)}}catch(t){console.debug("Unable to override Array.from",t)}var fv=new ah,pv=new Set([Xl.Mutation,Xl.MediaInteraction,Xl.StyleSheetRule,Xl.CanvasMutation,Xl.Font,Xl.Log,Xl.StyleDeclaration,Xl.AdoptedStyleSheet]);function gv(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 mv(t){var e;void 0===t&&(t={});var i=t,r=i.emit,n=i.checkoutEveryNms,s=i.checkoutEveryNth,a=i.blockClass,o=void 0===a?"rr-block":a,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,b=i.inlineStylesheet,_=void 0===b||b,w=i.inlineStylesheetBudgetRules,k=i.maskAllInputs,S=i.maskInputOptions,x=i.slimDOMOptions,C=i.maskInputFn,T=i.maskTextFn,M=i.maskAllElementAttributes,E=void 0!==M&&M,I=i.maskAttributeFn,R=i.hooks,P=i.packFn,A=i.sampling,F=void 0===A?{}:A,O=i.dataURLOptions,L=void 0===O?{}:O,D=i.canvasResolutionScale,N=i.canvasMasking,q=i.mousemoveWait,j=i.recordDOM,B=void 0===j||j,H=i.recordCanvas,z=void 0!==H&&H,U=i.recordCrossOriginIframes,W=void 0!==U&&U,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;bd=i.errorHandler;var at=p({type:"image/webp",quality:.4,maxBase64ImageLength:1048576},L),ot=!W||window.parent===window,lt=!1;if(!ot)try{window.parent.document&&(lt=!1)}catch(t){lt=!0}if(ot&&!r)throw new Error("emit function is required");if(!ot&&!lt)return()=>{};void 0!==q&&void 0===F.mousemove&&(F.mousemove=q),fv.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=Gh(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};rv=(t,e)=>{var i,a=t;if(a.timestamp=id(),!(null==(i=Td[0])?void 0:i.isFrozen())||a.type===Yl.FullSnapshot||a.type===Yl.IncrementalSnapshot&&pv.has(a.data.source)||Td.forEach((t=>t.unfreeze())),ot)null==r||r(gt(a),e);else if(lt){var o={type:"rrweb",event:gt(a),origin:window.location.origin,isCheckout:e};window.parent.postMessage(o,"*")}if(a.type===Yl.FullSnapshot)ut=a,ft=0;else if(a.type===Yl.IncrementalSnapshot){if(a.data.source===Xl.Mutation&&a.data.isAttachIframe)return;ft++,(s&&ft>=s||n&&a.timestamp-ut.timestamp>n)&&nv(!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=fv.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()}rv({type:Yl.IncrementalSnapshot,data:p({source:Xl.Mutation},t)})},yt=t=>rv({type:Yl.IncrementalSnapshot,data:p({source:Xl.Scroll},t)}),bt=t=>rv({type:Yl.IncrementalSnapshot,data:p({source:Xl.CanvasMutation},t)}),_t=new hv({mutationCb:mt,adoptedStyleSheetCb:t=>rv({type:Yl.IncrementalSnapshot,data:p({source:Xl.AdoptedStyleSheet},t)}),maskAllElementAttributes:E,maskAttributeFn:I}),wt=new Bd({mirror:fv,mutationCb:mt,stylesheetManager:_t,recordCrossOriginIframes:W,wrappedEmit:rv});for(var kt of tt||[])kt.getMirror&&kt.getMirror({nodeMirror:fv,crossOriginIframeMirror:wt.crossOriginIframeMirror,crossOriginIframeStyleMirror:wt.crossOriginIframeStyleMirror});var St=new dv,xt=null==N?void 0:N.configured;sv=new uv({recordCanvas:z,mutationCb:bt,win:window,blockClass:o,blockSelector:u,mirror:fv,sampling:F.canvas,dataURLOptions:at,resolutionScale:D,canvasMasking:N});var Ct=new Hd({mutationCb:mt,scrollCb:yt,bypassOptions:{blockClass:o,blockSelector:u,maskTextClass:g,maskTextSelector:y,inlineStylesheet:_,maskInputOptions:ht,dataURLOptions:at,maskTextFn:T,maskInputFn:C,maskAllElementAttributes:E,maskAttributeFn:I,recordCanvas:z,canvasMaskingConfigured:xt,inlineImages:X,sampling:F,slimDOMOptions:dt,iframeManager:wt,stylesheetManager:_t,canvasManager:sv,keepIframeSrcFn:it,processedNodeManager:St,attributeFilter:st},mirror:fv});nv=function(t){if(void 0===t&&(t=!1),B){Du(w);try{rv({type:Yl.Meta,data:{href:window.location.href,width:sd(),height:nd()}},t),null==e||e.cancel(),e=void 0,_t.reset(),Ct.init(),Td.forEach((t=>t.lock()));var i,r=null;try{r=function(t,e){var i=e||{},r=i.mirror,n=void 0===r?new ah:r,s=i.blockClass,a=void 0===s?"rr-block":s,o=i.blockSelector,l=void 0===o?null:o,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,b=i.canvasMaskingConfigured,_=i.maskAllInputs,w=void 0!==_&&_,k=i.maskTextFn,S=i.maskInputFn,x=i.maskAllElementAttributes,C=void 0!==x&&x,T=i.maskAttributeFn,M=i.slimDOM,E=i.dataURLOptions,I=i.preserveWhiteSpace,R=i.onSerialize,P=i.onIframeLoad,A=i.iframeLoadTimeout,F=i.onIframeListenerRegistered,O=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,H=Gh(void 0!==M&&M);Du(j);try{return Vh(t,{doc:t,mirror:n,blockClass:a,blockSelector:l,maskTextClass:h,maskTextSelector:v,skipChild:!1,inlineStylesheet:f,maskInputOptions:B,maskTextFn:k,maskInputFn:S,maskAllElementAttributes:C,maskAttributeFn:T,slimDOMOptions:H,dataURLOptions:E,inlineImages:g,recordCanvas:y,canvasMaskingConfigured:b,preserveWhiteSpace:I,onSerialize:R,onIframeLoad:P,iframeLoadTimeout:A,onIframeListenerRegistered:F,onStylesheetLoad:O,stylesheetLoadTimeout:L,keepIframeSrcFn:N,newlyAddedElement:!1,maxDepth:q})}finally{$u()}}(document,{mirror:fv,blockClass:o,blockSelector:u,maskTextClass:g,maskTextSelector:y,inlineStylesheet:_,maskAllInputs:ht,inlineStylesheetBudgetRules:w,maskTextFn:T,maskInputFn:C,maskAllElementAttributes:E,maskAttributeFn:I,slimDOM:dt,dataURLOptions:at,recordCanvas:z,canvasMaskingConfigured:xt,inlineImages:X,onSerialize(t){dd(t,fv)&&wt.addIframe(t),vd(t,fv)&&_t.trackLinkElement(t),cd(t)&&Ct.addShadowRoot(gu.shadowRoot(t),document)},onIframeLoad(t,e){wt.attachIframe(t,e),Ct.observeAttachShadow(t)},onIframeListenerRegistered(t,e){wt.registerLoadListenerDisposer(t,e)},onStylesheetLoad(t,e){_t.attachLinkElement(t,e)},keepIframeSrcFn:it})}finally{s=Ru,Ru=[],i=s}if(!r)return console.warn("Failed to snapshot the document");if(rv({type:Yl.FullSnapshot,data:{node:r,initialOffset:rd(window)}},t),Td.forEach((t=>t.unlock())),sv.onFullSnapshot(),i.length){var n=function(t,e,i){var r=!1,n=null,s=0,a=null,o=()=>null!==a||t.length>s,l=()=>{var i=t[s];t[s]=null,s+=1,i&&Kh((()=>{a=e.beginDeferredLinkInlining(i,fv.getId(i))}))},u=()=>{if(a){var t=a,e=!0;Kh((()=>{e=t.advance(200)})),e&&(a=null)}},h=t=>{if(n=null,!r){var e=0;do{try{a||l(),u()}catch(t){null==a||a.discard(),a=null,Wu(1)}e+=1}while(!r&&o()&&(t?!t.didTimeout&&t.timeRemaining()>5:10>e));r||(o()?n=gv(h):i())}};return n=gv(h),{cancel(){r=!0,null==a||a.discard(),a=null,null==n||n.cancel(),n=null},flush(){if(!r){r=!0,null==n||n.cancel(),n=null;for(var e=0,h=0;o()&&50>e;){a||l();var d=a;if(d)if(Math.floor(d.remainingRules()/200)+1>50-e)d.discard(),a=null,h+=1;else{try{u()}catch(t){null==a||a.discard(),a=null,h+=1}e+=1}}if(o()||h>0){for(var v=h+(null!==a?1:0),c=s;t.length>c;c++)null!==t[c]&&(v+=1);Wu(v),null==a||a.discard(),a=null}i()}}}}(i,_t,(()=>{e===n&&(e=void 0)}));e=n}W&&wt.reattachIframes(),document.adoptedStyleSheets&&document.adoptedStyleSheets.length>0&&_t.adoptStyleSheets(document.adoptedStyleSheets,fv.getId(document))}finally{$u()}var s}};try{var Tt=[];for(var Mt of(Tt.push(Qh("pagehide",(()=>{try{null==e||e.flush()}catch(t){}e=void 0}),window)),["visibilitychange","freeze","resume"]))Tt.push(Qh(Mt,wu,document));vt=t=>{var e=pt.get(t);e&&(e.forEach((t=>{Kh(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=fv.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 Et=t=>{var e;return Cd($d)({mutationCb:mt,mousemoveCb:(t,e)=>rv({type:Yl.IncrementalSnapshot,data:{source:e,positions:t}}),mouseInteractionCb:t=>rv({type:Yl.IncrementalSnapshot,data:p({source:Xl.MouseInteraction},t)}),scrollCb:yt,viewportResizeCb:t=>rv({type:Yl.IncrementalSnapshot,data:p({source:Xl.ViewportResize},t)}),inputCb:t=>rv({type:Yl.IncrementalSnapshot,data:p({source:Xl.Input},t)}),mediaInteractionCb:t=>rv({type:Yl.IncrementalSnapshot,data:p({source:Xl.MediaInteraction},t)}),styleSheetRuleCb:t=>rv({type:Yl.IncrementalSnapshot,data:p({source:Xl.StyleSheetRule},t)}),styleDeclarationCb:t=>rv({type:Yl.IncrementalSnapshot,data:p({source:Xl.StyleDeclaration},t)}),canvasMutationCb:bt,fontCb:t=>rv({type:Yl.IncrementalSnapshot,data:p({source:Xl.Font},t)}),selectionCb(t){rv({type:Yl.IncrementalSnapshot,data:p({source:Xl.Selection},t)})},customElementCb(t){rv({type:Yl.IncrementalSnapshot,data:p({source:Xl.CustomElement},t)})},blockClass:o,ignoreClass:d,ignoreSelector:c,maskTextClass:g,maskTextSelector:y,maskInputOptions:ht,inlineStylesheet:_,sampling:F,recordDOM:B,recordCanvas:z,canvasMaskingConfigured:xt,inlineImages:X,userTriggeredOnInput:Q,collectFonts:K,doc:t,maskInputFn:C,maskTextFn:T,maskAllElementAttributes:E,maskAttributeFn:I,keepIframeSrcFn:it,blockSelector:u,slimDOMOptions:dt,dataURLOptions:at,mirror:fv,iframeManager:wt,stylesheetManager:_t,shadowDomManager:Ct,processedNodeManager:St,canvasManager:sv,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=>rv({type:Yl.Plugin,data:{plugin:t.name,payload:e}})}))))||[]},R)};wt.addLoadListener((t=>{try{var e=fv.getId(t),i=Et(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=fv.getId(t);null==vt||vt(e),Rd(t)}));var It=-1,Rt=t=>rv({type:Yl.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,a=s?fv.getId(s):-1;a!==It&&(-1!==It&&Rt({id:It,enter:!1}),It=a,-1!==a&&Rt({id:a,enter:!0}))},At=()=>{nv();var t=Et(document);"function"==typeof t&&Tt.push(t),Tt.push(Qh("fullscreenchange",Pt)),Tt.push(Qh("webkitfullscreenchange",Pt)),Tt.push(Qh("mozfullscreenchange",Pt)),Tt.push(Qh("MSFullscreenChange",Pt)),vv=!0};return["interactive","complete"].includes(document.readyState)?At():(Tt.push(Qh("DOMContentLoaded",(()=>{rv({type:Yl.DomContentLoaded,data:{}}),"DOMContentLoaded"===G&&At()}))),Tt.push(Qh("load",(()=>{rv({type:Yl.Load,data:{}}),"load"===G&&At()}),window))),()=>{try{null==e||e.flush()}catch(t){}e=void 0,Tt.forEach((t=>Kh(t))),St.destroy(),wt.removeLoadListener(),wt.destroy(),pt.clear(),Ct.reset(),fv.reset(),vv=!1,bd=void 0}}catch(t){console.warn(t)}}mv.addCustomEvent=(t,e)=>{if(!vv)throw new Error("please add custom event after start recording");rv({type:Yl.Custom,data:{tag:t,payload:e}})},mv.freezePage=()=>{Td.forEach((t=>t.freeze()))},mv.takeFullSnapshot=t=>{if(!vv)throw new Error("please take full snapshot after start recording");nv(t)},mv.mirror=fv;var yv=Object.defineProperty,bv=(t,e,i)=>((t,e,i)=>e in t?yv(t,e,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[e]=i)(t,"symbol"!=typeof e?e+"":e,i);class _v{constructor(t){bv(this,"fileName"),bv(this,"functionName"),bv(this,"lineNumber"),bv(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 wv=/(^|@)\S+:\d+/,kv=/^\s*at .*(\S+:\d+|\(native\))/m,Sv=/^(eval@)?(\[native code])?$/,xv={parse(t){return t?void 0!==t.stacktrace||void 0!==t["opera#sourceloc"]?this.parseOpera(t):t.stack&&t.stack.match(kv)?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(kv)}),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,a=["eval","<anonymous>"].indexOf(n[0])>-1?void 0:n[0];return new _v({functionName:s,fileName:a,lineNumber:n[1],columnNumber:n[2]})}),this)},parseFFOrSafari(t){return t.stack.split("\n").filter((function(t){return!t.match(Sv)}),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 _v({functionName:t});var e=/((.*".+"[^@]*)?[^@]*)(?:@)/,i=t.match(e),r=i&&i[1]?i[1]:void 0,n=this.extractLocation(t.replace(e,""));return new _v({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 a=e.exec(i[n]);a&&r.push(new _v({fileName:a[2],lineNumber:parseFloat(a[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 a=e.exec(i[n]);a&&r.push(new _v({functionName:a[3]||void 0,fileName:a[2],lineNumber:parseFloat(a[1])}))}return r},parseOpera11(t){return t.stack.split("\n").filter((function(t){return!!t.match(wv)&&!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 _v({functionName:r,fileName:i[0],lineNumber:i[1],columnNumber:i[2]})}),this)}};function Cv(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 a=r.children[s];a.localName&&a.localName.toLowerCase&&a.localName.toLowerCase()===i&&n.push(a)}n.length>1&&(i+=":eq("+n.indexOf(t)+")"),e=i+(e?">"+e:""),t=r}return e}function Tv(t){return Array.isArray(t)}function Mv(t){return"object"==typeof t&&null!==t&&!Tv(t)}function Ev(t,e){if(0===e)return!0;var i=Object.keys(t);for(var r of i)if(Mv(t[r])&&Ev(t[r],e-1))return!0;return!1}function Iv(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(Mv(a=e)&&Object.keys(a).length>i.numOfKeysLimit||"function"==typeof a||Mv(a)&&Ev(a,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 a;if("bigint"==typeof e)return e.toString()+"n";if(e instanceof Event){var o={};for(var l in e){var u=e[l];o[l]=Tv(u)?Cv(u.length?u[0]:null):u}return o}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 Rv={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 Pv(t,e,i){var r,n=i?Object.assign({},Rv,i):Rv,s=n.logger;if(!s)return()=>{};r="string"==typeof s?e[s]:s;var a=0,o=!1,l=[];if(n.level.includes("error")){var u=e=>{var i=e.message,r=xv.parse(e.error).map((t=>t.toString())),s=[Iv(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=[Iv("Uncaught (in promise) "+(i=e.reason).name+": "+i.message,n.stringifyOptions)]:(i=new Error,r=[Iv("Uncaught (in promise)",n.stringifyOptions),Iv(e.reason,n.stringifyOptions)]);var s=xv.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]||o)){o=!0;try{var h=xv.parse(new Error).map((t=>t.toString())).splice(1),d=("assert"===i?l.slice(1):l).map((t=>Iv(t,n.stringifyOptions)));a++,n.lengthThreshold>a?t({level:i,trace:h,payload:d}):a===n.lengthThreshold&&t({level:"warn",trace:[],payload:[Iv("The number of log records reached the threshold.")]})}catch(t){e("rrweb logger error:",t,...l)}finally{o=!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=t=>{var e;return"function"==typeof t?null!==(e=t.__rrweb_layer__)&&void 0!==e?e:t.__posthog_layer__:void 0},i=e[s],r=t(i);r;){if(r.next===d)return void(r.next=h.next);r=t(i=r.next)}else e[s]=h.next}}catch(t){return()=>{}}}(e,i):()=>{}}}var Av=t=>({name:"rrweb/console@1",observer:Pv,options:t}),Fv=t=>"undefined"!=typeof Document&&t instanceof Document,Ov=()=>{},Lv=t=>{var e;if(Z(t))return null!==(e=t.__posthog_layer__)&&void 0!==e?e:t.__rrweb_layer__};function Dv(t,e,i){try{if(!(e in t))return Ov;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 Z(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],s=Lv(i);s;){if(s.next===n)return void(s.next=r.next);s=Lv(i=s.next)}else t[e]=r.next}}catch(t){return Ov}}function $v(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 Nv=Hi("[Recorder]"),qv=t=>"navigation"===t.entryType,jv=t=>"resource"===t.entryType;function Bv(t,e){return!!e&&(nt(e)||e[t])}function Hv(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 zv=["image/","video/","audio/","font/","application/octet-stream","application/pdf","application/zip","application/wasm"];function Uv(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:!!Hv(e)&&t(e.url)}catch(t){return!1}}(t.url))return!1;if(n(zv))return!1;if(nt(i))return!0;if(G(i))return n(i);var s=i[e];return nt(s)?s:n(s)}function Wv(t,e,i,r,n,s){return Vv.apply(this,arguments)}function Vv(){return Vv=f((function*(t,e,i,r,n,s){if(void 0===s&&(s=0),s>10)return Nv.warn("Failed to get performance entry for request",{url:i,initiatorType:e}),null;var a=function(t,i){for(var s=t.length-1;s>=0;s-=1)if(jv(a=t[s])&&a.initiatorType===e&&(K(r)||a.startTime>=r)&&(K(n)||n>=a.startTime))return t[s];var a}(t.performance.getEntriesByName(i));return a||(yield new Promise((t=>setTimeout(t,50*s))),Wv(t,e,i,r,n,s+1))})),Vv.apply(this,arguments)}function Gv(t){var e=t.body,i=t.options,r=t.url;if(et(e))return null;var n=$v(r,i);if(n.isHostDenied)return n.hostname+" is in deny list";if(Y(e))return e;if(Fv(e))return e.textContent;if(st(e))return rr(e);if(Q(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 Zv=t=>!tt(t)&&("navigation"===t.entryType||"resource"===t.entryType);function Qv(t){var e=t.entry,i=t.method,r=t.status,n=t.networkRequest,s=t.isInitial,a=t.start,o=t.end,l=t.url,u=t.initiatorType;a=e?e.startTime:a,o=e?e.responseEnd:o;var h=Math.floor(Date.now()-performance.now()),d=Math.floor(h+(a||0)),v=[p({},e?e.toJSON():{name:l},{startTime:K(a)?void 0:Math.round(a),endTime:K(o)?void 0:Math.round(o),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(Zv(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 Jv=["video/","audio/"];function Kv(t){return Q(t)&&Z(t.getReader)&&Z(t.tee)}var Yv=500,Xv="[SessionReplay] Timeout while trying to read body",tc="[SessionReplay] Failed to read body";function ec(t){return tc+": "+t}function ic(t){return"[SessionReplay] Body too large to record (> "+t+" bytes)"}function rc(t,e){if(!e.streamNetworkBody)return function(t){return new Promise((e=>{var i=setTimeout((()=>e(Xv)),Yv);try{t.clone().text().then((t=>e(t)),(t=>e(ec(t)))).finally((()=>clearTimeout(i)))}catch(t){clearTimeout(i),e(tc)}}))}(t);var i=nn(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(ic(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 a(t){n||(n=!0,clearTimeout(l),s(),i(t))}var o,l=setTimeout((()=>a(Xv)),Yv);try{o=t.clone()}catch(t){return void a(tc)}var u=o.body;if(Kv(u)&&"undefined"!=typeof TextDecoder){try{r=u.getReader()}catch(t){return void a(tc)}var h=[],d=0;!function t(){r.read().then((i=>{var r=i.done,o=i.value;if(n)s();else if(r)a((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(o){if(d+o.byteLength>e)return void a(ic(e));d+=o.byteLength,h.push(o)}t()}}),(t=>a(ec(t))))}()}else try{o.text().then((t=>a(t)),(t=>a(ec(t))))}catch(t){a(tc)}}))}(t,i)}function nc(){return nc=f((function*(t){var e=t.r,i=t.options,r=$v(t.url,i);return r.isHostDenied?Promise.resolve(r.hostname+" is in deny list"):rc(e,i)})),nc.apply(this,arguments)}function sc(){return sc=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(),a=Jv.some((t=>null==s?void 0:s.startsWith(t)));if(s&&a)return"Content-Type "+s+" is not supported";var o=$v(n,r);return o.isHostDenied?o.hostname+" is in deny list":null}({r:e,options:i,url:t.url});return tt(r)?rc(e,i):Promise.resolve(r)})),sc.apply(this,arguments)}var ac=null;function oc(t,e,i){if(!("performance"in e))return()=>{};if(ac)return Nv.warn("Network observer already initialised, doing nothing"),()=>{};var r=i?Object.assign({},sn,i):sn,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&&cn.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=>qv(t)||jv(t)&&i.initiatorTypes.includes(t.initiatorType)));t({requests:r.flatMap((t=>Qv({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=>qv(t)||jv(t)&&i.initiatorTypes.includes(t.initiatorType)&&(t=>!i.recordBody&&!i.recordHeaders||"xmlhttprequest"!==t.initiatorType&&"fetch"!==t.initiatorType)(t)));t({requests:r.flatMap((t=>Qv({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),a=()=>{},o=()=>{};return(r.recordHeaders||r.recordBody)&&(a=function(t,e,i){if(!i.initiatorTypes.includes("xmlhttprequest"))return()=>{};var r=Bv("request",i.recordHeaders),n=Bv("response",i.recordHeaders),s=Dv(e.XMLHttpRequest.prototype,"open",(s=>function(a,o,l,u,h){void 0===l&&(l=!0);var d=this;try{var v,c,f=new Request(o),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=>(Uv({type:"request",headers:g,url:o,recordBody:i.recordBody})&&(p.requestBody=Gv({body:t,options:i,url:o})),v=e.performance.now(),y(t));var b=()=>{d.removeEventListener("readystatechange",_),d.removeEventListener("error",b),d.removeEventListener("abort",b),d.removeEventListener("timeout",b)},_=()=>{if(d.readyState===d.DONE){b(),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),Uv({type:"response",headers:r,url:o,recordBody:i.recordBody})&&(p.responseBody=Gv({body:d.response,options:i,url:o})),Wv(e,"xmlhttprequest",f.url,v,c).then((e=>{var i=Qv({entry:e,method:a,status:null==d?void 0:d.status,networkRequest:p,start:v,end:c,url:o.toString(),initiatorType:"xmlhttprequest"});t({requests:i})})).catch((()=>{}))}};d.addEventListener("readystatechange",_),d.addEventListener("error",b),d.addEventListener("abort",b),d.addEventListener("timeout",b)}catch(t){Nv.error("Failed to instrument XHR for network capture",t)}s.call(d,a,o.toString(),l,u,h)}));return()=>{s()}}(n,e,r),o=function(t,e,i){if(!i.initiatorTypes.includes("fetch"))return()=>{};var r=Bv("request",i.recordHeaders),n=Bv("response",i.recordHeaders),s=Dv(e,"fetch",(s=>function(){var a=f((function*(a,o){var l,u;try{l=new Request(a,o)}catch(t){return Nv.error("Failed to instrument fetch for network capture",t),s(a,o)}var h,d,v={};try{try{var c={};l.headers.forEach(((t,e)=>{c[e]=t})),r&&(v.requestHeaders=c),!Kv(null==o?void 0:o.body)&&Uv({type:"request",headers:c,url:a,recordBody:i.recordBody})&&(v.requestBody=yield function(t){return nc.apply(this,arguments)}({r:l,options:i,url:a}))}catch(t){Nv.error("Failed to record fetch request for network capture",t)}h=e.performance.now(),u=Hv(a)?yield s(l):yield s(a,o),d=e.performance.now();var f={};return u.headers.forEach(((t,e)=>{f[e]=t})),n&&(v.responseHeaders=f),Uv({type:"response",headers:f,url:a,recordBody:i.recordBody})&&(v.responseBody=yield function(t){return sc.apply(this,arguments)}({r:u,options:i,url:a})),u}finally{Wv(e,"fetch",l.url,h,d).then((e=>{var i,r=Qv({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 a.apply(this,arguments)}}()));return()=>{s()}}(n,e,r)),ac=()=>{s(),a(),o(),ac=null}}var lc=t=>({name:"rrweb/network@1",observer:oc,options:t});v.__PosthogExtensions__=v.__PosthogExtensions__||{},v.__PosthogExtensions__.rrwebPlugins={getRecordConsolePlugin:Av,getRecordNetworkPlugin:lc},v.__PosthogExtensions__.rrweb={record:mv,version:"v2",wasMaxDepthReached:()=>Wh,resetMaxDepthState(){Wh=!1,Uh=!1},getLastSnapshotCost:()=>Eu,getMutationCost:()=>p({},Fu),resetSnapshotCostState(){xu=0,Cu=0,Tu=0,bu=0,Mu=mu(),Eu=null,Iu=null,Ru=[],Pu=0,Au=0,Fu={slowestBatchMs:0},Ou={deferredCount:0,failedCount:0,abandonedCount:0,totalMs:0,slowestSliceMs:0}}},v.rrweb={record:mv,version:"v2"},v.rrwebConsoleRecord={getRecordConsolePlugin:Av},v.getRecordNetworkPlugin=lc,v.__PosthogExtensions__=v.__PosthogExtensions__||{},v.__PosthogExtensions__.initSessionRecording=(t,e)=>new Gl(t,e);var uc,hc,dc,vc,cc,fc,pc,gc,mc,yc,bc,_c,wc,kc,Sc,xc={},Cc=[],Tc=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,Mc=Array.isArray;function Ec(t,e){for(var i in e)t[i]=e[i];return t}function Ic(t){t&&t.parentNode&&t.parentNode.removeChild(t)}function Rc(t,e,i){var r,n,s,a={};for(s in e)"key"==s?r=e[s]:"ref"==s?n=e[s]:a[s]=e[s];if(arguments.length>2&&(a.children=arguments.length>3?uc.call(arguments,2):i),"function"==typeof t&&null!=t.defaultProps)for(s in t.defaultProps)void 0===a[s]&&(a[s]=t.defaultProps[s]);return Pc(t,a,r,n,null)}function Pc(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?++dc:n,__i:-1,__u:0};return null==n&&null!=hc.vnode&&hc.vnode(s),s}function Ac(t){return t.children}function Fc(t,e){this.props=t,this.context=e}function Oc(t,e){if(null==e)return t.__?Oc(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?Oc(t):null}function Lc(t){if(t.__P&&t.__d){var e=t.__v,i=e.__e,r=[],n=[],s=Ec({},e);s.__v=e.__v+1,hc.vnode&&hc.vnode(s),Wc(t.__P,s,e,t.__n,t.__P.namespaceURI,32&e.__u?[i]:null,r,null==i?Oc(e):i,!!(32&e.__u),n),s.__v=e.__v,s.__.__k[s.__i]=s,Gc(r,s,n),e.__e=e.__=null,s.__e!=i&&Dc(s)}}function Dc(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})),Dc(t)}function $c(t){(!t.__d&&(t.__d=!0)&&vc.push(t)&&!Nc.__r++||cc!=hc.debounceRendering)&&((cc=hc.debounceRendering)||fc)(Nc)}function Nc(){try{for(var t,e=1;vc.length;)vc.length>e&&vc.sort(pc),t=vc.shift(),e=vc.length,Lc(t)}finally{vc.length=Nc.__r=0}}function qc(t,e,i,r,n,s,a,o,l,u,h){var d,v,c,f,p,g,m,y=r&&r.__k||Cc,b=e.length;for(l=function(t,e,i,r,n){var s,a,o,l,u,h=i.length,d=h,v=0;for(t.__k=new Array(n),s=0;n>s;s++)null!=(a=e[s])&&"boolean"!=typeof a&&"function"!=typeof a?("string"==typeof a||"number"==typeof a||"bigint"==typeof a||a.constructor==String?a=t.__k[s]=Pc(null,a,null,null,null):Mc(a)?a=t.__k[s]=Pc(Ac,{children:a},null,null,null):void 0===a.constructor&&a.__b>0?a=t.__k[s]=Pc(a.type,a.props,a.key,a.ref?a.ref:null,a.__v):t.__k[s]=a,l=s+v,a.__=t,a.__b=t.__b+1,o=null,-1!=(u=a.__i=Bc(a,i,l,d))&&(d--,(o=i[u])&&(o.__u|=2)),null==o||null==o.__v?(-1==u&&(n>h?v--:h>n&&v++),"function"!=typeof a.type&&(a.__u|=4)):u!=l&&(u==l-1?v--:u==l+1?v++:(u>l?v--:v++,a.__u|=4))):t.__k[s]=null;if(d)for(s=0;h>s;s++)null!=(o=i[s])&&0==(2&o.__u)&&(o.__e==r&&(r=Oc(o)),Jc(o,o));return r}(i,e,y,l,b),d=0;b>d;d++)null!=(c=i.__k[d])&&(v=-1!=c.__i&&y[c.__i]||xc,c.__i=d,g=Wc(t,c,v,n,s,a,o,l,u,h),f=c.__e,c.ref&&v.ref!=c.ref&&(v.ref&&Qc(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=jc(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 jc(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=jc(n[s],e,i,r));return e}t.__e!=e&&(r&&(e&&t.type&&!e.parentNode&&(e=Oc(t)),i.insertBefore(t.__e,e||null)),e=t.__e);do{e=e&&e.nextSibling}while(null!=e&&8==e.nodeType);return e}function Bc(t,e,i,r){var n,s,a,o=t.key,l=t.type,u=e[i],h=null!=u&&0==(2&u.__u);if(null===u&&null==o||h&&o==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[a=0>n?s++:n--])&&0==(2&u.__u)&&o==u.key&&l==u.type)return a;return-1}function Hc(t,e,i){"-"==e[0]?t.setProperty(e,null==i?"":i):t[e]=null==i?"":"number"!=typeof i||Tc.test(e)?i:i+"px"}function zc(t,e,i,r,n){var s,a;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||Hc(t.style,e,"");if(i)for(e in i)r&&i[e]==r[e]||Hc(t.style,e,i[e])}else if("o"==e[0]&&"n"==e[1])s=e!=(e=e.replace(bc,"$1")),a=e.toLowerCase(),e=a in t||"onFocusOut"==e||"onFocusIn"==e?a.slice(2):e.slice(2),t.l||(t.l={}),t.l[e+s]=i,i?r?i[yc]=r[yc]:(i[yc]=_c,t.addEventListener(e,s?kc:wc,s)):t.removeEventListener(e,s?kc:wc,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 Uc(t){return function(e){if(this.l){var i=this.l[e.type+t];if(null==e[mc])e[mc]=_c++;else if(i[yc]>e[mc])return;return i(hc.event?hc.event(e):e)}}}function Wc(t,e,i,r,n,s,a,o,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=[o=e.__e=i.__e]),(h=hc.__b)&&h(e);t:if("function"==typeof C){d=a.length;try{if(y=e.props,b=C.prototype&&C.prototype.render,$=(h=C.contextType)&&r[h.__c],_=h?$?$.props.value:h.__:r,i.__c?m=(v=e.__c=i.__c).__=v.__E:(b?e.__c=v=new C(y,_):(e.__c=v=new Fc(y,_),v.constructor=C,v.render=Kc),$&&$.sub(v),v.state||(v.state={}),v.__n=r,c=v.__d=!0,v.__h=[],v._sb=[]),b&&null==v.__s&&(v.__s=v.state),b&&null!=C.getDerivedStateFromProps&&(v.__s==v.state&&(v.__s=Ec({},v.__s)),Ec(v.__s,C.getDerivedStateFromProps(y,v.__s))),f=v.props,p=v.state,v.__v=e,c)b&&null==C.getDerivedStateFromProps&&null!=v.componentWillMount&&v.componentWillMount(),b&&null!=v.componentDidMount&&v.__h.push(v.componentDidMount);else{if(b&&null==C.getDerivedStateFromProps&&y!==f&&null!=v.componentWillReceiveProps&&v.componentWillReceiveProps(y,_),e.__v==i.__v||!v.__e&&null!=v.shouldComponentUpdate&&!1===v.shouldComponentUpdate(y,v.__s,_)){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)})),Cc.push.apply(v.__h,v._sb),v._sb=[],v.__h.length&&a.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=_,v.props=y,v.__P=t,v.__e=!1,w=hc.__r,k=0,b)v.state=v.__s,v.__d=!1,w&&w(e),h=v.render(v.props,v.state,v.context),Cc.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=Ec(Ec({},r),v.getChildContext())),b&&!c&&null!=v.getSnapshotBeforeUpdate&&(g=v.getSnapshotBeforeUpdate(f,p)),S=null!=h&&h.type===Ac&&null==h.key?Zc(h.props.children):h,o=qc(t,Mc(S)?S:[S],e,i,r,n,s,a,o,l,u),v.base=e.__e,e.__u&=-161,v.__h.length&&a.push(v),m&&(v.__E=v.__=null)}catch(t){if(a.length=d,e.__v=null,l||null!=s)if(t.then){for(e.__u|=l?160:128;o&&8==o.nodeType&&o.nextSibling;)o=o.nextSibling;null!=s&&(s[s.indexOf(o)]=null),e.__e=o}else{if(null!=s)for(x=s.length;x--;)Ic(s[x]);Vc(e)}else e.__e=i.__e,!e.__k&&i.__k&&(e.__k=i.__k),t.then||Vc(e);hc.__e(t,e,i)}}else null==s&&e.__v==i.__v?(e.__k=i.__k,e.__e=i.__e):o=e.__e=function(t,e,i,r,n,s,a,o,l){var u,h,d,v,c,f,p,g=i.props||xc,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),o&&(hc.__m&&hc.__m(e,s),o=!1),s=null}if(null==y)g===m||o&&t.data==m||(t.data=m);else{if(s="textarea"==y&&null!=m.defaultValue?null:s&&uc.call(t.childNodes),!o&&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||zc(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:o&&"function"!=typeof c||g[u]===c||zc(t,u,c,g[u],n);if(h)o||d&&(h.__html==d.__html||h.__html==t.innerHTML)||(t.innerHTML=h.__html),e.__k=[];else if(d&&(t.innerHTML=""),qc("template"==e.type?t.content:t,Mc(v)?v:[v],e,i,r,"foreignObject"==y?"http://www.w3.org/1999/xhtml":n,s,a,s?s[0]:i.__k&&Oc(i,0),o,l),null!=s)for(u=s.length;u--;)Ic(s[u]);o&&"textarea"!=y||(u="value","progress"==y&&null==f?t.removeAttribute("value"):null!=f&&(f!==t[u]||"progress"==y&&!f||"option"==y&&f!=g[u])&&zc(t,u,f,g[u],n),u="checked",null!=p&&p!=t[u]&&zc(t,u,p,g[u],n))}return t}(i.__e,e,i,r,n,s,a,l,u);return(h=hc.diffed)&&h(e),128&e.__u?void 0:o}function Vc(t){t&&(t.__c&&(t.__c.__e=!0),t.__k&&t.__k.some(Vc))}function Gc(t,e,i){for(var r=0;i.length>r;r++)Qc(i[r],i[++r],i[++r]);hc.__c&&hc.__c(e,t),t.some((function(e){try{t=e.__h,e.__h=[],t.some((function(t){t.call(e)}))}catch(t){hc.__e(t,e.__v)}}))}function Zc(t){return"object"!=typeof t||null==t||t.__b>0?t:Mc(t)?t.map(Zc):void 0!==t.constructor?null:Ec({},t)}function Qc(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){hc.__e(t,i)}}function Jc(t,e,i){var r,n;if(hc.unmount&&hc.unmount(t),(r=t.ref)&&(r.current&&r.current!=t.__e||Qc(r,null,e)),null!=(r=t.__c)){if(r.componentWillUnmount)try{r.componentWillUnmount()}catch(t){hc.__e(t,e)}r.base=r.__P=r.__n=null}if(r=t.__k)for(n=0;r.length>n;n++)r[n]&&Jc(r[n],e,i||"function"!=typeof t.type);i||Ic(t.__e),t.__c=t.__=t.__e=void 0}function Kc(t,e,i){return this.constructor(t,i)}function Yc(t,e,i){var r,n,s;e==document&&(e=document.documentElement),hc.__&&hc.__(t,e),r=e.__k,n=[],s=[],Wc(e,t=e.__k=Rc(Ac,null,[t]),r||xc,xc,e.namespaceURI,r?null:e.firstChild?uc.call(e.childNodes):null,n,r?r.__e:e.firstChild,!1,s),Gc(n,t,s),t.props.children=null}uc=Cc.slice,hc={__e(t,e,i,r){for(var n,s,a;e=e.__;)if((n=e.__c)&&!n.__)try{if((s=n.constructor)&&null!=s.getDerivedStateFromError&&(n.setState(s.getDerivedStateFromError(t)),a=n.__d),null!=n.componentDidCatch&&(n.componentDidCatch(t,r||{}),a=n.__d),a)return n.__E=n}catch(e){t=e}throw t}},dc=0,Fc.prototype.setState=function(t,e){var i;i=null!=this.__s&&this.__s!=this.state?this.__s:this.__s=Ec({},this.state),"function"==typeof t&&(t=t(Ec({},i),this.props)),t&&Ec(i,t),null!=t&&this.__v&&(e&&this._sb.push(e),$c(this))},Fc.prototype.forceUpdate=function(t){this.__v&&(this.__e=!0,t&&this.__h.push(t),$c(this))},Fc.prototype.render=Ac,vc=[],fc="function"==typeof Promise?Promise.prototype.then.bind(Promise.resolve()):setTimeout,pc=function(t,e){return t.__v.__b-e.__v.__b},Nc.__r=0,gc=Math.random().toString(8),mc="__d"+gc,yc="__a"+gc,bc=/(PointerCapture)$|Capture$/i,_c=0,wc=Uc(!1),kc=Uc(!0),Sc=0;var Xc,tf,ef,rf,nf=0,sf=[],af=hc,of=af.__b,lf=af.__r,uf=af.diffed,hf=af.__c,df=af.unmount,vf=af.__;function cf(t,e){af.__h&&af.__h(tf,t,nf||e),nf=0;var i=tf.__H||(tf.__H={__:[],__h:[]});return t>=i.__.length&&i.__.push({}),i.__[t]}function ff(t){return nf=1,function(t,e,i){var r=cf(Xc++,2);if(r.t=t,!r.__c&&(r.__=[Cf(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=tf,!tf.__f)){var n=function(t,e,i){if(!r.__c.__H)return!0;var n=!1,a=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]&&(a=!0)}})),s){var o=s.call(this,t,e,i);return n?o||a:o}return!n||a};tf.__f=!0;var s=tf.shouldComponentUpdate,a=tf.componentWillUpdate;tf.componentWillUpdate=function(t,e,i){if(this.__e){var r=s;s=void 0,n(t,e,i),s=r}a&&a.call(this,t,e,i)},tf.shouldComponentUpdate=n}return r.__N||r.__}(Cf,t)}function pf(t,e){var i=cf(Xc++,3);!af.__s&&xf(i.__H,e)&&(i.__=t,i.u=e,tf.__H.__h.push(i))}function gf(t){return nf=5,mf((function(){return{current:t}}),[])}function mf(t,e){var i=cf(Xc++,7);return xf(i.__H,e)&&(i.__=t(),i.__H=e,i.__h=t),i.__}function yf(t){var e=tf.context[t.__c],i=cf(Xc++,9);return i.c=t,e?(null==i.__&&(i.__=!0,e.sub(tf)),e.props.value):t.__}function bf(){for(var t;t=sf.shift();){var e=t.__H;if(t.__P&&e)try{e.__h.some(kf),e.__h.some(Sf),e.__h=[]}catch(i){e.__h=[],af.__e(i,t.__v)}}}af.__b=function(t){tf=null,of&&of(t)},af.__=function(t,e){t&&e.__k&&e.__k.__m&&(t.__m=e.__k.__m),vf&&vf(t,e)},af.__r=function(t){lf&&lf(t),Xc=0;var e=(tf=t.__c).__H;e&&(ef===tf?(e.__h=[],tf.__h=[],e.__.some((function(t){t.__N&&(t.__=t.__N),t.u=t.__N=void 0}))):(e.__h.length&&bf(),Xc=0)),ef=tf},af.diffed=function(t){uf&&uf(t);var e=t.__c;e&&e.__H&&(e.__H.__h.length&&(1!==sf.push(e)&&rf===af.requestAnimationFrame||((rf=af.requestAnimationFrame)||wf)(bf)),e.__H.__.some((function(t){t.u&&(t.__H=t.u,t.u=void 0)}))),ef=tf=null},af.__c=function(t,e){e.some((function(t){try{t.__h.some(kf),t.__h=t.__h.filter((function(t){return!t.__||Sf(t)}))}catch(i){e.some((function(t){t.__h&&(t.__h=[])})),e=[],af.__e(i,t.__v)}})),hf&&hf(t,e)},af.unmount=function(t){df&&df(t);var e,i=t.__c;i&&i.__H&&(i.__H.__.some((function(t){try{kf(t)}catch(t){e=t}})),i.__H=void 0,e&&af.__e(e,i.__v))};var _f="function"==typeof requestAnimationFrame;function wf(t){var e,i=function(){clearTimeout(r),_f&&cancelAnimationFrame(e),setTimeout(t)},r=setTimeout(i,35);_f&&(e=requestAnimationFrame(i))}function kf(t){var e=tf,i=t.__c;"function"==typeof i&&(t.__c=void 0,i()),tf=e}function Sf(t){var e=tf;t.__c=t.__(),tf=e}function xf(t,e){return!t||t.length!==e.length||e.some((function(e,i){return e!==t[i]}))}function Cf(t,e){return"function"==typeof e?e(t):e}function Tf(t){var e=!0;return{dispose(){if(e){e=!1;var i=t();i&&Z(i.then)&&i.then(void 0,(()=>{}))}}}}var Mf="gzip-js",Ef="base64",If="events",Rf="cancelEvents",Pf={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"},Ff={Top:"top",Left:"left",Right:"right",Bottom:"bottom"},Of={Popover:"popover",API:"api",Widget:"widget",ExternalSurvey:"external_survey"},Lf={Open:"open",MultipleChoice:"multiple_choice",SingleChoice:"single_choice",Rating:"rating",Link:"link"},Df={End:"end",ResponseBased:"response_based",SpecificQuestion:"specific_question"},$f="always",Nf={SHOWN:"survey shown",DISMISSED:"survey dismissed",SENT:"survey sent",ABANDONED:"survey abandoned"},qf={SURVEY_ID:"$survey_id",SURVEY_NAME:"$survey_name",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_COMPLETED:"$survey_completed",SURVEY_LAST_SEEN_DATE:"$survey_last_seen_date",SURVEY_LANGUAGE:"$survey_language"},jf="popover",Bf=Hi("[Surveys]");function Hf(t){return!(!t.start_date||t.end_date)}function zf(t){var e;return!(null==(e=t.conditions)||null==(e=e.actions)||null==(e=e.values)||!e.length)}var Uf="seenSurvey_",Wf="inProgressSurvey_",Vf=(t,e)=>""+t+function(t){return t.current_iteration&&t.current_iteration>0?t.id+"_"+t.current_iteration:t.id}(e),Gf=t=>Vf(Uf,t),Zf=t=>{try{var e=Gf(t);if(localStorage.getItem(e))return;localStorage.setItem(e,"true")}catch(t){Bf.error("Failed to persist survey seen state",t)}},Qf=[Of.Popover,Of.Widget,Of.API],Jf={ignoreConditions:!1,ignoreDelay:!1,displayType:jf},Kf="featureFlags",Yf="logs";Math.trunc||(Math.trunc=function(t){return 0>t?Math.ceil(t):Math.floor(t)}),Number.isInteger||(Number.isInteger=function(t){return it(t)&&isFinite(t)&&Math.floor(t)===t});class Xf{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 Xf(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 Xf(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 tp{generate(){var t=this.generateOrAbort();if(!K(t))return t;this.Gr=0;var e=this.generateOrAbort();if(K(e))throw new Error("Could not generate UUID after timestamp reset");return e}generateOrAbort(){var t=Date.now();if(t>this.Gr)this.Gr=t,this.Qr();else{if(this.Gr>=t+1e4)return;this.Jr++,this.Jr>4398046511103&&(this.Gr++,this.Qr())}return Xf.fromFieldsV7(this.Gr,Math.trunc(this.Jr/Math.pow(2,30)),this.Jr&Math.pow(2,30)-1,this.Yr.nextUint32())}Qr(){this.Jr=1024*this.Yr.nextUint32()+(1023&this.Yr.nextUint32())}constructor(){this.Gr=0,this.Jr=0,this.Yr=new rp}}var ep,ip=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&&!K(t.crypto)&&crypto.getRandomValues&&(ip=t=>crypto.getRandomValues(t));class rp{nextUint32(){return this.At.length>this.Kr||(ip(this.At),this.Kr=0),this.At[this.Kr++]}constructor(){this.At=new Uint32Array(8),this.Kr=1/0}}var np=()=>sp().toString(),sp=()=>(ep||(ep=new tp)).generate(),ap="",op=/[a-z0-9][a-z0-9-]+\.[a-z]{2,}$/i;var lp={Xr:()=>!!r,ii(t){Bi.error("cookieStore error: "+t)},ti:Oo,ni(t){var e;try{e=JSON.parse(lp.ti(t))||{}}catch(t){}return e},ei(t,e,i,n,s){if(!r)return!1;try{var a="",o="",l=function(t,e){if(e){var i=function(t,e){if(void 0===e&&(e=r),ap)return ap;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_"+np();!ap&&n--;){var a=i.slice(n).join("."),o=s+"=1;domain=."+a+";path=/";e.cookie=o+";max-age=3",e.cookie.includes(s)&&(e.cookie=o+";max-age=0",ap=a)}return ap}(t);if(!i){var n=(t=>{var e=t.match(op);return e?e[0]:""})(t);n!==i&&Bi.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),a="; expires="+u.toUTCString()}s&&(o="; secure");var h=t+"="+encodeURIComponent(JSON.stringify(e))+a+"; SameSite=Lax; path=/"+l+o;return h.length>3686.4&&Bi.warn("cookieStore warning: large cookie, len="+h.length),r.cookie=h,!0}catch(t){return!1}},ri(t,e){if(null!=r&&r.cookie)try{lp.ei(t,"",-1,e)}catch(t){return}}},up=null,hp={Xr(){if(!tt(up))return up;var e=!0;if(K(t))e=!1;else try{var i="__mplssupport__";hp.ei(i,"xyz"),'"xyz"'!==hp.ti(i)&&(e=!1),hp.ri(i)}catch(t){e=!1}return e||Bi.error("localStorage unsupported; falling back to cookie store"),up=e,e},ii(t){Bi.error("localStorage error: "+t)},ti(e){try{return null==t?void 0:t.localStorage.getItem(e)}catch(t){hp.ii(t)}return null},ni(t){try{return JSON.parse(hp.ti(t))||{}}catch(t){}return null},ei(e,i){try{return null==t||t.localStorage.setItem(e,JSON.stringify(i)),!0}catch(t){hp.ii(t)}return!1},ri(e){try{null==t||t.localStorage.removeItem(e)}catch(t){hp.ii(t)}}},dp=[es,Gn,Vn,Qn,Jn,Kn,cs,vs,hs],vp=[gn,pn,Dn,$n,_s,bs,fs],cp=t=>t+"_cpm",fp=["__proto__","constructor","prototype"],pp=t=>{if(!Q(t))return{};var e={};return Object.keys(t).forEach((i=>{-1===fp.indexOf(i)&&(e[i]=t[i])})),e},gp=function(t,e){void 0===e&&(e=[]);var i={};return[...vp,...e].forEach((e=>{var r=t[e];K(r)||tt(r)||""===r||(i[e]=r)})),i},mp=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)},yp=(t,e)=>({p:e,f:mp(JSON.stringify(t))}),bp=(t,e)=>{if(!e)return{properties:[],isValid:!1};try{var i=lp.ni(cp(t)),r=(null==i?void 0:i.f)===mp(e)&&G(i.p);return{properties:r?i.p:[],isValid:r}}catch(t){return{properties:[],isValid:!1}}},_p=(t,e)=>e+"|"+(lp.ti(cp(t))||""),wp={},kp={Xr:()=>!0,ii(t){Bi.error("memoryStorage error: "+t)},ti:t=>wp[t]||null,ni:t=>wp[t]||null,ei:(t,e)=>(wp[t]=e,!0),ri(t){delete wp[t]}},Sp=null,xp={Xr(){if(!tt(Sp))return Sp;if(Sp=!0,K(t))Sp=!1;else try{var e="__support__";xp.ei(e,"xyz"),'"xyz"'!==xp.ti(e)&&(Sp=!1),xp.ri(e)}catch(t){Sp=!1}return Sp},ii(t){Bi.error("sessionStorage error: ",t)},ti(e){try{return null==t?void 0:t.sessionStorage.getItem(e)}catch(t){xp.ii(t)}return null},ni(t){try{return JSON.parse(xp.ti(t))||null}catch(t){}return null},ei(e,i){try{return null==t||t.sessionStorage.setItem(e,JSON.stringify(i)),!0}catch(t){xp.ii(t)}return!1},ri(e){try{null==t||t.sessionStorage.removeItem(e)}catch(t){xp.ii(t)}}},Cp=Hi("[Stylesheet Loader]"),Tp=t,Mp=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:Pf.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 Pp(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 Ap(t){var e;void 0===t&&(t=Ip.backgroundColor),"#"===t[0]&&(e=Pp(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=Pp(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]),a=parseInt(r[3]);return Math.sqrt(n*n*.299+s*s*.587+a*a*.114)>127.5?Ep:"white"}return Ep}var Fp=(t,e,i)=>{var r=Yp(t),n=Mp.querySelector("."+r);if(n&&n.shadowRoot)return{shadow:n.shadowRoot,isNewlyCreated:!1};var s=Mp.createElement("div");((t,e,i)=>{var r=p({},Ip,i),n=t.style,s=!Rp.includes(r.position)||e===Of.Widget&&(null==i?void 0:i.widgetType)===Pf.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)||Ap(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",Ap(r.ratingButtonActiveColor)),n.setProperty("--ph-survey-text-primary-color",(null==i?void 0:i.textColor)||Ap(r.backgroundColor)),n.setProperty("--ph-survey-text-subtle-color",r.textSubtleColor),n.setProperty("--ph-widget-color",r.widgetColor),n.setProperty("--ph-widget-text-color",Ap(r.widgetColor)),n.setProperty("--ph-widget-z-index",r.zIndex);var a=(null==i?void 0:i.inputBackground)||(null==i?void 0:i.inputBackgroundColor),o=a||r.inputBackground;a||"white"!==r.backgroundColor||(o="#f8f8f8"),n.setProperty("--ph-survey-input-background",o);var l=(null==i?void 0:i.inputTextColor)||Ap(o);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 a=s.attachShadow({mode:"open"}),o=function(t){var e=((t,e,i)=>{var r=t.createElement("style");r.innerText=e;var n=(t=>{var e;return Z(t)?t:null==t||null==(e=t.config)?void 0:e.prepare_external_dependency_stylesheet})(i);return n&&(r=n(r)),r||(Cp.error("prepare_external_dependency_stylesheet returned null"),null)})(Mp,':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(o){var l=a.querySelector("style");l&&a.removeChild(l),a.appendChild(o)}return Mp.body.appendChild(s),{shadow:a,isNewlyCreated:!0}},Op=t=>{var e=t.responses,i=t.survey,r=t.surveySubmissionId,n=t.posthog,s=t.isSurveyCompleted,a=t.properties,o=t.surveyLanguage;n?(Zf(i),n.capture(Nf.SENT,p({[qf.SURVEY_NAME]:i.name,[qf.SURVEY_ID]:i.id,[qf.SURVEY_ITERATION]:i.current_iteration,[qf.SURVEY_ITERATION_START_DATE]:i.current_iteration_start_date,[qf.SURVEY_SUBMISSION_ID]:r,[qf.SURVEY_COMPLETED]:s},o&&{[qf.SURVEY_LANGUAGE]:o},{sessionRecordingUrl:null==n.get_session_replay_url?void 0:n.get_session_replay_url()},co(e,i),a,{$set:{[fo(i,"responded")]:!0}})),s&&(Tp.dispatchEvent(new CustomEvent("PHSurveySent",{detail:{surveyId:i.id}})),Kp(i),n.reloadFeatureFlags())):Bf.error("[survey sent] event not captured, PostHog instance not found.")},Lp=(t,e,i)=>{return p({[qf.SURVEY_NAME]:t.name,[qf.SURVEY_ID]:t.id,[qf.SURVEY_ITERATION]:t.current_iteration,[qf.SURVEY_ITERATION_START_DATE]:t.current_iteration_start_date,[qf.SURVEY_PARTIALLY_COMPLETED]:(r=null==e?void 0:e.responses,void 0===r&&(r={}),Object.values(r).some((t=>!et(t))))},(null==e?void 0:e.surveyLanguage)&&{[qf.SURVEY_LANGUAGE]:e.surveyLanguage},{sessionRecordingUrl:null==i.get_session_replay_url?void 0:i.get_session_replay_url(),[qf.SURVEY_SUBMISSION_ID]:null==e?void 0:e.surveySubmissionId},co(null==e?void 0:e.responses,t));var r},Dp=(t,e,i,r)=>{if(e){if(!i){var n=Qp(t);e.capture(Nf.DISMISSED,p({},Lp(t,n,e),r&&{[qf.SURVEY_LANGUAGE]:r},{$set:{[fo(t,"dismissed")]:!0}})),Kp(t),Zf(t),Tp.dispatchEvent(new CustomEvent("PHSurveyClosed",{detail:{surveyId:t.id}}))}}else Bf.error("[survey dismissed] event not captured, PostHog instance not found.")},$p=(t,e)=>{if(e){var i=(t=>Vf("abandonedSurvey_",t))(t);try{if("true"===localStorage.getItem(i))return}catch(t){return}var r=Qp(t);if(r){try{localStorage.setItem(i,"true")}catch(t){}e.capture(Nf.ABANDONED,Lp(t,r,e),{transport:"sendBeacon"})}}else Bf.error("[survey abandoned] event not captured, PostHog instance not found.")},Np=t=>t.map((t=>({sort:Math.floor(10*Math.random()),value:t}))).sort(((t,e)=>t.sort-e.sort)).map((t=>t.value)),qp=(t,e)=>t.length===e.length&&t.every(((t,i)=>t===e[i]))?e.reverse():e,jp=t=>{var e=t.map((t=>t.id));return e.every((t=>!!t))?e:void 0},Bp=(t,e)=>{return(t=>t.questions.some((t=>{var e;return!(null==(e=t.branching)||!e.type)})))(t)?t.questions:e?null!==(i=((t,e)=>{if(!e||e.length!==t.questions.length)return null;var i=new Map(t.questions.map((t=>[t.id,t]))),r=[];for(var n of e){var s=i.get(n);if(!s)return null;r.push(s)}return r})(t,e.questionOrder))&&void 0!==i?i:t.questions:t.appearance&&t.appearance.shuffleQuestions&&!t.enable_partial_responses?qp(t.questions,Np(t.questions)):t.questions;var i},Hp=t=>wo(t)||Jp(t),zp=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,$c(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"+Sc++,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}),Up=()=>yf(zp),Wp=t=>{var e=t.children,i=t.style;return function(t,e,i){var r,n,s,a,o=Ec({},t.props);for(s in t.type&&t.type.defaultProps&&(a=t.type.defaultProps),e)"key"==s?r=e[s]:"ref"==s?n=e[s]:o[s]=void 0===e[s]&&null!=a?a[s]:e[s];return arguments.length>2&&(o.children=arguments.length>3?uc.call(arguments,2):i),Pc(t.type,o,r||t.key,n||t.ref,null)}(t.component,t.renderAsHtml?{dangerouslySetInnerHTML:{__html:e},style:i}:{children:e,style:i})};function Vp(t,e){var i,r;if(null==(i=t.conditions)||!i.url)return!0;var n=hr(e);if(!n)return!1;var s=[t.conditions.url],a=function(t){return null!=t?t:"icontains"}(null==(r=t.conditions)?void 0:r.urlMatchType);return xo[a](s,[n])}var Gp=t=>Vf(Wf,t),Zp=(t,e)=>{try{localStorage.setItem(Gp(t),JSON.stringify(e))}catch(t){Bf.error("Error setting in-progress survey state in localStorage",t)}},Qp=t=>{try{var e=localStorage.getItem(Gp(t));if(e)return JSON.parse(e)}catch(t){Bf.error("Error getting in-progress survey state from localStorage",t)}return null},Jp=t=>{var e=Qp(t);return!et(null==e?void 0:e.surveySubmissionId)},Kp=t=>{try{localStorage.removeItem(Gp(t))}catch(t){Bf.error("Error clearing in-progress survey state from localStorage",t)}};function Yp(t,e){void 0===e&&(e=!1);var i="PostHogSurvey-"+t.id;return e?"."+i:i}function Xp(t,e,i){if(void 0===e&&(e=Af.Right),t===Of.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===Of.Widget&&i===Pf.Tab?"60px":"30px"}}}var tg=0;function eg(t,e,i,r,n,s){e||(e={});var a,o,l=e;if("ref"in l)for(o in l={},e)"ref"==o?a=e[o]:l[o]=e[o];var u={type:t,props:l,key:i,ref:a,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:--tg,__i:-1,__u:0,__source:n,__self:s};if("function"==typeof t&&(a=t.defaultProps))for(o in a)void 0===l[o]&&(l[o]=a[o]);return hc.vnode&&hc.vnode(u),u}var ig=eg("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 -960 960 960",width:"48",children:eg("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"})}),rg=eg("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 -960 960 960",width:"48",children:eg("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"})}),ng=eg("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 -960 960 960",width:"48",children:eg("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"})}),sg=eg("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 -960 960 960",width:"48",children:eg("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"})}),ag=eg("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 -960 960 960",width:"48",children:eg("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"})}),og=eg("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 0 24 24",width:"48",children:eg("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"})}),lg=eg("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 0 24 24",width:"48",children:eg("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"})}),ug=function(t){var e=(void 0===t?{}:t).fill,i=void 0===e?"currentColor":e;return eg("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:[eg("title",{id:"close-survey-title",className:"adam-testing",children:"Close survey"}),eg("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})]})},hg=eg("svg",{width:"77",height:"14",viewBox:"0 0 77 14",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[eg("g",{"clip-path":"url(#clip0_2415_6911)",children:[eg("mask",{id:"mask0_2415_6911",style:{maskType:"luminance"},maskUnits:"userSpaceOnUse",x:"0",y:"0",width:"77",height:"14",children:eg("path",{d:"M0.5 0H76.5V14H0.5V0Z",fill:"white"})}),eg("g",{mask:"url(#mask0_2415_6911)",children:[eg("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"}),eg("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"}),eg("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"}),eg("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"}),eg("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"}),eg("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"})]})]}),eg("defs",{children:eg("clipPath",{id:"clip0_2415_6911",children:eg("rect",{width:"76",height:"14",fill:"white",transform:"translate(0.5)"})})})]});function dg(t){var e=t.urlParams,i=e?Object.entries(e).map((t=>{var e=t[1];return encodeURIComponent(t[0])+"="+encodeURIComponent(e)})).join("&"):"";return eg("a",{href:"https://posthog.com/surveys"+(i?"?"+i:""),target:"_blank",rel:"noopener",className:"footer-branding",children:["Survey by ",hg]})}function vg(e){var i=e.text,r=e.submitDisabled,n=e.appearance,s=e.onSubmit,a=e.link,o=e.onPreviewSubmit,l=e.skipSubmitButton,u=e.canGoBack,h=e.onBack,d=yf(zp).isPreviewMode,v=!!u&&!!h,c=!l&&eg("button",{className:"form-submit",disabled:r,"aria-label":"Submit survey",type:"button",onClick(){a&&(null==t||t.open(a)),d?null==o||o():s()},children:i});return eg("div",{className:"bottom-section",children:[v?eg("div",{className:"form-buttons form-buttons-with-back",children:[eg("button",{className:"form-back",type:"button","aria-label":"Go to previous question",onClick:h,children:n.backButtonText||"Back"}),c]}):c,!n.whiteLabel&&eg(dg,{urlParams:{utm_source:"survey-footer"}})]})}function cg(t){var e=t.question,i=t.forceDisableHtml;return eg("div",{class:e.question||e.description?"question-header":"question-header question-header--empty",children:[eg(e.type===Lf.Open?"label":"h3",{className:"survey-question",htmlFor:t.htmlFor,children:e.question}),e.description&&Wp({component:Rc("p",{className:"survey-question-description"}),children:e.description,renderAsHtml:!i&&"text"!==e.descriptionContentType})]})}function fg(t){return eg("button",{className:"form-cancel",onClick:t.onClick,disabled:yf(zp).isPreviewMode,"aria-label":"Close survey",type:"button",children:ug({fill:"black"})})}eg("svg",{width:"16",height:"12",viewBox:"0 0 16 12",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:eg("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 pg=t;function gg(t){var e=t.header,i=t.description,r=t.contentType,n=t.forceDisableHtml,s=t.appearance,a=t.onClose,o=yf(zp).isPopup;return pf((()=>{var t=t=>{"Enter"!==t.key&&"Escape"!==t.key||(t.preventDefault(),a())};return Yi(pg,"keydown",t),()=>{pg.removeEventListener("keydown",t)}}),[a]),eg("div",{className:"thank-you-message",role:"status",tabIndex:0,"aria-atomic":"true",children:[o&&!0!==s.hideCancelButton&&eg(fg,{onClick:()=>a()}),eg("h3",{className:"thank-you-message-header",children:e}),i&&Wp({component:Rc("p",{className:"thank-you-message-body"}),children:i,renderAsHtml:!n&&"text"!==r}),o&&eg(vg,{text:s.thankYouMessageCloseButtonText||"Close",submitDisabled:!1,appearance:s,onSubmit:()=>a()})]})}function mg(t){var e=t.header,i=t.description,r=t.contentType,n=t.forceDisableHtml,s=t.appearance,a=t.onStart,o=yf(zp),l=o.onPreviewSubmit,u=o.onPopupSurveyDismissed;return eg("div",{className:"intro-screen",role:"status",tabIndex:0,"aria-atomic":"true",children:[o.isPopup&&!0!==s.hideCancelButton&&eg(fg,{onClick:()=>u()}),e&&eg("h3",{className:"intro-screen-header",children:e}),i&&Wp({component:Rc("p",{className:"intro-screen-body"}),children:i,renderAsHtml:!n&&"text"!==r}),eg(vg,{text:s.introScreenButtonText||"Get started",submitDisabled:!1,appearance:s,onSubmit:a,onPreviewSubmit:()=>l(null)})]})}var yg=t=>G(t)&&t.every((t=>Y(t)));function bg(t){var e=t.question,i=t.forceDisableHtml,r=t.appearance,n=t.onSubmit,s=t.onPreviewSubmit,a=t.displayQuestionIndex,o=t.initialValue,l=t.canGoBack,u=t.onBack,h=Up().isPreviewMode,d=gf(null),v=ff((()=>Y(o)?o:"")),c=v[0],f=v[1],p=null==r?void 0:r.disableAutofocus;pf((()=>{p||setTimeout((()=>{var t;h||null==(t=d.current)||t.focus()}),100)}),[h,p]);var g="surveyQuestion"+a,m=mf((()=>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 a of e)switch(a.type){case C:if(void 0!==a.value&&a.value>s.length)return null!==(r=a.errorMessage)&&void 0!==r?r:"Please enter at least "+a.value+" characters";break;case T:if(void 0!==a.value&&s.length>a.value)return null!==(n=a.errorMessage)&&void 0!==n?n:"Please enter no more than "+a.value+" characters"}return!1}(c,e.validation,e.optional)),[c,e.validation,e.optional]),y=ri(e.validation,C),b=ri(e.validation,T),_=mf((()=>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,b)),[y,b]),w=()=>{m||n(c.trim())},k=()=>{m||s(c.trim())};return eg(Ac,{children:[eg("div",{className:"question-container",children:[eg(cg,{question:e,forceDisableHtml:i,htmlFor:g}),eg("textarea",{ref:d,id:g,rows:4,placeholder:null==r?void 0:r.placeholder,minLength:y,maxLength:b,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}),_&&eg("div",{className:"validation-hint",children:_})]}),eg(vg,{text:e.buttonText||"Submit",submitDisabled:!!m,appearance:r,onSubmit:w,onPreviewSubmit:k,canGoBack:l,onBack:u})]})}function _g(t){var e=t.question,i=t.appearance,r=t.onSubmit,n=t.onPreviewSubmit,s=t.canGoBack,a=t.onBack;return eg(Ac,{children:[eg("div",{className:"question-container",children:eg(cg,{question:e,forceDisableHtml:t.forceDisableHtml})}),eg(vg,{text:e.buttonText||"Submit",submitDisabled:!1,link:e.link,appearance:i,onSubmit:()=>r("link clicked"),onPreviewSubmit:()=>n("link clicked"),canGoBack:s,onBack:a})]})}function wg(t){var e,i=t.question,r=t.forceDisableHtml,n=t.displayQuestionIndex,s=t.appearance,a=t.onSubmit,o=t.onPreviewSubmit,l=t.initialValue,u=t.canGoBack,h=t.onBack,d=i.scale,v=10===i.scale?0:1,c=ff((()=>it(l)?l:G(l)&&l.length>0&&it(parseInt(l[0]))?parseInt(l[0]):Y(l)&&it(parseInt(l))?parseInt(l):null)),f=c[0],p=c[1],g="emoji"===i.display&&2===i.scale,m=Up().isPreviewMode,y=t=>m?o(t):a(t);return eg(Ac,{children:[eg("div",{className:"question-container",children:[eg(cg,{question:i,forceDisableHtml:r}),eg("div",{className:"rating-section",children:[eg("div",{className:"rating-options",children:["emoji"===i.display&&eg("div",{className:"rating-options-emoji"+(g?" rating-options-emoji-2":""),children:null==(e=Mg[i.scale])?void 0:e.map(((t,e)=>eg("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&&eg("div",{className:"rating-options-number",style:{gridTemplateColumns:"repeat("+(d-v+1)+", minmax(0, 1fr))"},children:Eg(i.scale).map(((t,e)=>eg(kg,{displayQuestionIndex:n,active:f===t,appearance:s,num:t,setActiveNumber(t){p(t),i.skipSubmitButton&&y(t)}},e)))})]}),!g&&eg("div",{className:"rating-text",children:[eg("div",{children:i.lowerBoundLabel}),eg("div",{children:i.upperBoundLabel})]})]})]}),eg(vg,{text:i.buttonText||(null==s?void 0:s.submitButtonText)||"Submit",submitDisabled:tt(f)&&!i.optional,appearance:s,onSubmit:()=>a(f),onPreviewSubmit:()=>o(f),skipSubmitButton:i.skipSubmitButton,canGoBack:u,onBack:h})]})}function kg(t){var e=t.num,i=t.setActiveNumber;return eg("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 Sg(t){var e=t.question,i=t.forceDisableHtml,r=t.displayQuestionIndex,n=t.appearance,s=t.onSubmit,a=t.onPreviewSubmit,o=t.initialValue,l=t.canGoBack,u=t.onBack,h=gf(null),d=mf((()=>(t=>{if(!t.shuffleOptions)return t.choices;var e=t.choices,i="";t.hasOpenChoice&&(i=e.pop());var r=qp(e,Np(e));return t.hasOpenChoice&&(t.choices.push(i),r.push(i)),r})(e)),[e]),v=ff((()=>((t,e)=>Y(t)||yg(t)?t:e===Lf.SingleChoice?null:[])(o,e.type))),c=v[0],f=v[1],g=ff((()=>((t,e)=>{if(Y(t)&&!e.includes(t))return{isSelected:!0,inputValue:t};if(yg(t)){var i=t.find((t=>!e.includes(t)));if(i)return{isSelected:!0,inputValue:i}}return{isSelected:!1,inputValue:""}})(o,d))),m=g[0],y=g[1],b=Up().isPreviewMode,_=e.type===Lf.SingleChoice,w=e.type===Lf.MultipleChoice,k=e.skipSubmitButton&&_&&!e.hasOpenChoice,S=(t,e)=>{if(e){var i=!m.isSelected;return y((t=>p({},t,{isSelected:i,inputValue:i?t.inputValue:""}))),_&&f(""),void(i&&setTimeout((()=>{var t;return null==(t=h.current)?void 0:t.focus()}),75))}if(_)return f(t),y((t=>p({},t,{isSelected:!1,inputValue:""}))),void(k&&(s(t),b&&a(t)));w&&G(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}))),_&&f(e)},C=t=>{t.stopPropagation(),"Enter"!==t.key||T()||(t.preventDefault(),M()),"Escape"===t.key&&(t.preventDefault(),y((t=>p({},t,{isSelected:!1,inputValue:""}))),_&&f(null))},T=()=>!(e.optional||!tt(c)&&(!G(c)||m.isSelected||0!==c.length)&&(!m.isSelected||""!==m.inputValue.trim())),M=()=>{m.isSelected&&w?G(c)&&(b?a([...c,m.inputValue]):s([...c,m.inputValue])):b?a(c):s(c)};return eg(Ac,{children:[eg("div",{className:"question-container",children:[eg(cg,{question:e,forceDisableHtml:i}),eg("fieldset",{className:"multiple-choice-options limit-height",children:[eg("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,a=s+"Open",o=n?m.isSelected:_?c===t:G(c)&&c.includes(t);return eg("label",{className:n?"choice-option-open":"",children:[eg("div",{className:"response-choice",children:[eg("input",{type:_?"radio":"checkbox",name:s,checked:o,onChange:()=>S(t,n),id:s,"aria-controls":a}),eg("span",{children:n?t+":":t})]}),n&&eg("input",{type:"text",ref:h,id:a,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)}))]})]}),eg(vg,{text:e.buttonText||"Submit",submitDisabled:T(),appearance:n,onSubmit:M,onPreviewSubmit:M,skipSubmitButton:k,canGoBack:l,onBack:u})]})}var xg=[1,2,3,4,5],Cg=[1,2,3,4,5,6,7],Tg=[0,1,2,3,4,5,6,7,8,9,10],Mg={2:[og,lg],3:[ng,rg,ig],5:[sg,ng,rg,ig,ag]};function Eg(t){switch(t){case 5:default:return xg;case 7:return Cg;case 10:return Tg}}var Ig=Hi("[Surveys]");function Rg(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===Lf.SingleChoice){var a,o=n.choices.indexOf(""+i);if(-1===o&&n.hasOpenChoice&&(o=n.choices.length-1),null!=(a=n.branching)&&null!=(a=a.responseValues)&&a.hasOwnProperty(o)){var l=n.branching.responseValues[o];return Number.isInteger(l)?l:l===Df.End?Df.End:s}}else if(n.type===Lf.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 Ig.warn("Falling back to next question index due to unexpected branching type"),s}var Pg=Hi("[SurveyTranslations]");function Ag(t,e){var i=function(t){return function(t,e){var i=t.storedPersonProperties,r=t.locale,n=po(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?po(t.language):null}(i);if(s)return null==e||e.info("Using person property language: "+s),s;var a=po(r);return a?(null==e||e.info("Using detected locale: "+a),a):(null==e||e.info("No user language detected"),null)}({overrideLanguage:t.config.override_display_language,storedPersonProperties:Z(t.get_property)?t.get_property(es):void 0,locale:zo()},Pg)}(e);if(!i)return Pg.info("No user language detected"),{survey:t,language:null};var r=bo(t,i,Pg);return{survey:r.survey,language:r.matchedKey}}var Fg=-1,Og=t,Lg=r,Dg="ph:show_survey_widget",$g="PHWidgetSurveyClickListener";function Ng(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 a=r-i.bottom,o=250>a&&i.top>a;return{position:"fixed",top:o?"auto":i.bottom+12+"px",left:s+"px",right:"auto",bottom:o?r-i.top+12+"px":"auto",zIndex:Ip.zIndex}}catch(t){return Bf.warn("Failed to calculate trigger position:",t),null}}class qg{constructor(t){var e=this;this.ai=new Map,this.oi=new Map,this.si=new Map,this.ui=new Set,this.handlePageUnload=()=>{var t=this._posthog.get_property(ns);if(t)for(var e of t)Jp(e)&&$p(e,this._posthog)},this.handlePopoverSurvey=function(t,i,r){var n,s,a,o,l,u=(void 0===r?{}:r).resumeDelayFromActivation,h=void 0!==u&&u,d=e.li(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.hi(f.id);var g=null!=i?i:{},m=g.properties,y=g.initialResponses,b=!(!y||0>=Object.keys(y).length)&&e.ci(f,y,m,c);if(!b||null!=(n=f.appearance)&&n.displayThankYouMessage){e.di(f);var _={};if((null==(s=f.appearance)?void 0:s.position)===Af.NextToTrigger&&null!=(a=f.appearance)&&a.widgetSelector){var w,k=Lg.querySelector(f.appearance.widgetSelector);k&&(_=Ng(k,parseInt((null==(w=f.appearance)?void 0:w.maxWidth)||Ip.maxWidth))||{})}var S=(null==(o=f.appearance)?void 0:o.surveyPopupDelaySeconds)||0,x=Fp(f,e._posthog).shadow;e.si.set(x,x.host);var C={posthog:e._posthog,survey:f,removeSurveyFromFocus:e.vi,properties:m,style:_,isSurveyCompleted:b,skipShownEvent:null==i?void 0:i.skipShownEvent,surveyLanguage:c};if(0>=S)return Yc(eg(Ug,p({},C)),x);var T=()=>{if(!e.fi(f))return Bf.info("Survey "+f.id+" no longer eligible when its display delay elapsed; not displaying"),e.vi(f);Yc(eg(Ug,p({},C,{survey:p({},f,{appearance:p({},f.appearance,{surveyPopupDelaySeconds:0})})})),x)},M=h?null==(l=e._posthog.surveys)||null==(l=l._surveyEventReceiver)||null==l.getActivationTimestamp?void 0:l.getActivationTimestamp(f.id):void 0,E=it(M)?Math.max(0,Date.now()-M):0,I=Math.max(0,1e3*S-E);if(0>=I)return T();var R=Og.setTimeout((()=>{e.ai.delete(f.id),T()}),I);e.ai.set(f.id,R)}},this.pi=t=>{var e=this.li(t),i=e.survey,r=e.language,n=Fp(i,this._posthog),s=n.shadow,a=n.isNewlyCreated;this.si.set(s,s.host),a&&Yc(eg(Vg,{posthog:this._posthog,survey:i,surveyLanguage:r},t.id),s)},this.gi=t=>{var e=this.oi.get(t);e&&(e.element.removeEventListener("click",e.listener),e.element.removeAttribute($g),this.oi.delete(t),Bf.info("Removed click listener for survey "+t))},this.mi=t=>{this.yi(t)||(this.bi(t),this.gi(t.id))},this.yi=t=>{try{var e,i=Lg.querySelector(Yp(t,!0));return!(null==i||null==(e=i.shadowRoot)||!e.querySelector(".ph-survey"))}catch(t){return!1}},this.wi=(t,e)=>{var i=Lg.querySelector(e),r=this.oi.get(t.id);if(i){if(this.pi(t),r){if(i===r.element)return;Bf.info("Selector element changed for survey "+t.id+". Re-attaching listener."),this.gi(t.id)}if(!i.hasAttribute($g)){var n=e=>{var i,r;e.stopPropagation();var n=(null==(i=t.appearance)?void 0:i.position)===Af.NextToTrigger?Ng(e.currentTarget,parseInt((null==(r=t.appearance)?void 0:r.maxWidth)||Ip.maxWidth)):{};Og.dispatchEvent(new CustomEvent(Dg,{detail:{surveyId:t.id,position:n}}))};Yi(i,"click",n),i.setAttribute($g,"true"),this.oi.set(t.id,{element:i,listener:n,survey:t}),Bf.info("Attached click listener for feedback button survey "+t.id)}}else r&&this.mi(t)},this.renderPopover=t=>{var e=this.li(t),i=e.survey,r=e.language,n=Fp(i,this._posthog).shadow;this.si.set(n,n.host),Yc(eg(Ug,{posthog:this._posthog,survey:i,removeSurveyFromFocus:this.vi,surveyLanguage:r}),n)},this.renderSurvey=(t,e,i)=>{var r,n=this.li(t),s=n.survey,a=n.language,o=!1;null!=(r=this._posthog.config)&&null!=(r=r.surveys)&&r.prefillFromUrl&&(o=this.ki(s,a,i)),Yc(eg(Ug,{posthog:this._posthog,survey:s,removeSurveyFromFocus:this.vi,isPopup:!1,properties:i,isSurveyCompleted:o,surveyLanguage:a}),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.fi(t)));t(r)}),i)},this.callSurveysAndEvaluateDisplayLogic=function(t){void 0===t&&(t=!1),e.getActiveMatchingSurveys((t=>{var i=t.filter((t=>t.type===Of.Popover||t.type===Of.Widget)),r=new Set(i.map((t=>t.id)));for(var n of Array.from(e.ai.keys()))r.has(n)||e.cancelSurvey(n);var s=e.Si(i),a=new Set;s.forEach((t=>{if(t.type===Of.Widget){var i,r,n,s;if((null==(i=t.appearance)?void 0:i.widgetType)===Pf.Tab)return void e.pi(t);(null==(r=t.appearance)?void 0:r.widgetType)===Pf.Selector&&null!=(n=t.appearance)&&n.widgetSelector&&(a.add(t.id),e.wi(t,null==(s=t.appearance)?void 0:s.widgetSelector))}tt(e.xi)&&t.type===Of.Popover&&e.handlePopoverSurvey(t,void 0,{resumeDelayFromActivation:!0})})),e.oi.forEach((t=>{var i=t.survey;a.has(i.id)||e.mi(i)}))}),t)},this.di=t=>{tt(this.xi)||Bf.error("Survey "+this.xi+" already in focus. Cannot add survey "+t.id+"."),this.xi=t.id},this.vi=t=>{this.xi!==t.id&&Bf.error("Survey "+t.id+" is not in focus. Cannot remove survey "+t.id+"."),this.hi(t.id),this.xi=null,this.bi(t)},this._posthog=t,this.xi=null}get Ci(){var t,e,i;return null!==(t=null==(e=(i=this._posthog).getExtension)?void 0:e.call(i,Kf))&&void 0!==t?t:this._posthog.featureFlags}hi(t){var e=this.ai.get(t);e&&(clearTimeout(e),this.ai.delete(t))}cancelSurvey(t){this.ai.has(t)&&(Bf.info("Cancelled pending survey "+t),this.hi(t),this.xi===t&&(this.xi=null))}setAutomaticDisplayDispose(t){this.Mi=t}dispose(){var t;null==(t=this.Mi)||t.call(this),this.Mi=void 0,this.ai.forEach(((t,e)=>this.hi(e))),this.oi.forEach(((t,e)=>this.gi(e))),this.si.forEach(((t,e)=>{Yc(null,e),null==t||t.remove()})),this.si.clear(),this.xi=null}Si(t){return t.sort(((t,e)=>{var i,r,n=Jp(t),s=Jp(e);if(n&&!s)return-1;if(!n&&s)return 1;var a=t.schedule===$f,o=e.schedule===$f;return a&&!o?1:!a&&o?-1:((null==(i=t.appearance)?void 0:i.surveyPopupDelaySeconds)||0)-((null==(r=e.appearance)?void 0:r.surveyPopupDelaySeconds)||0)}))}li(t){return Ag(t,this._posthog)}ki(t,e,i){if(this.ui.has(t.id))return!1;var r=function(t){var e={},i=!1,r=t.replace(/^\?/,"");if(!r)return{params:e,autoSubmit:i};var n=r.split("&");for(var s of n){var a=s.split("="),o=a[0],l=a[1];if(o&&!K(l)){var u=decodeURIComponent(o),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}}(Og.location.search),n=r.params;if(0===Object.keys(n).length)return!1;Bf.info("[Survey Prefill] Detected URL prefill parameters");var s=this.Ti(t,n,e);return!!s&&(this.Ii(t,s,i,e),this.ui.add(t.id),s.isSurveyCompleted)}Ii(t,e,i,r){var n=e.responses,s=e.submissionId,a=e.isSurveyCompleted,o=e.skippedResponses;(Object.keys(o).length>0&&t.enable_partial_responses||a)&&Op({responses:a?n:o,survey:t,surveySubmissionId:s,posthog:this._posthog,isSurveyCompleted:a,properties:i,surveyLanguage:r})}ci(t,e,i,r){var n={};for(var s of Object.entries(e)){var a=s[1];n[parseInt(s[0])]=G(a)?a.map(String):[String(a)]}Bf.info("[Survey] Processing initial responses");var o=this.Ti(t,n,r);return!!o&&(this.Ii(t,o,i,r),o.isSurveyCompleted)}Ti(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=ho(t.id);try{switch(t.type){case Lf.SingleChoice:if(!t.choices||0===t.choices.length)return void Bi.warn("[Survey Prefill] Question "+r+" has no choices");var a=parseInt(n[0],10);if(isNaN(a)||0>a||a>=t.choices.length)return void Bi.warn("[Survey Prefill] Invalid choice index for q"+r+": "+n[0]);i[s]=t.choices[a];break;case Lf.MultipleChoice:if(!t.choices||0===t.choices.length)return void Bi.warn("[Survey Prefill] Question "+r+" has no choices");var o=n.map((t=>parseInt(t,10))).filter((e=>!isNaN(e)&&e>=0&&t.choices.length>e));if(0===o.length)return void Bi.warn("[Survey Prefill] No valid choices for q"+r);var l=[...new Set(o.map((e=>t.choices[e])))];o.length>l.length&&Bi.warn("[Survey Prefill] Removed duplicate choices for q"+r),i[s]=l;break;case Lf.Rating:var u=parseInt(n[0],10),h=t.scale||10;if(isNaN(u)||0>u||u>h)return void Bi.warn("[Survey Prefill] Invalid rating for q"+r+": "+n[0]+" (scale: 0-"+h+")");i[s]=u;break;default:Bi.info("[Survey Prefill] Question type "+t.type+" does not support prefill")}}catch(t){Bi.error("[Survey Prefill] Error converting q"+r+":",t)}}})),i}(t,e);if(0===Object.keys(r).length)return Bf.warn("[Survey Prefill] No valid responses after conversion"),null;var n=np(),s=Object.keys(e).map((t=>parseInt(t,10))),a=function(t,e,i){for(var r=0,n={},s=[],a=t.questions.length+1,o=0;t.questions.length>r&&a>o&&(o++,e.includes(r));){var l=t.questions[r];if(!l||!("skipSubmitButton"in l)||!l.skipSubmitButton)break;if(l.id){var u=ho(l.id);K(i[u])||(n[u]=i[u])}s.push(r);var h=Rg(t,r,l.id?i[ho(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),o=a.startQuestionIndex,l=a.skippedResponses,u=a.skippedIndices,h=o>=t.questions.length;return Zp(t,{surveySubmissionId:n,responses:r,lastQuestionIndex:o,questionOrder:jp(t.questions),visitedIndices:u,surveyLanguage:i}),Bf.info("[Survey Prefill] Stored prefilled responses in localStorage"),{responses:r,submissionId:n,startQuestionIndex:o,isSurveyCompleted:h,skippedResponses:l}}catch(t){return Bf.error("[Survey Prefill] Error handling prefill:",t),null}}Ei(t,e){if(void 0===e&&(e=void 0),!t)return!0;var i=this.Ci,r=!(null==i||!i.isFeatureEnabled(t,{send_event:!t.startsWith("survey-targeting-")})),n=!0;return e&&(n=(null==i?void 0:i.getFeatureFlag(t,{send_event:!1}))===e||"any"===e),r&&n}Ri(e){return!e.conditions||Vp(e,this._posthog)&&function(e){var r,n;return function(e,r){var n,s,a;if(!e||0===e.length)return!0;if(!u)return!1;var o=ke(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==(a=t.screen)?void 0:a.height,devicePixelRatio:null==t?void 0:t.devicePixelRatio});return xo[null!=r?r:"icontains"](e,[o])}(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==Mp||!Mp.querySelector(t.conditions.selector))}(e)}Ai(t){var e;return Hp(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.Ci)&&e.hasLoadedFlags?{satisfied:this.Ei(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(!Hf(t))return r.eligible=!1,r.reason="Survey is not running. It was completed on "+t.end_date,r;if(!Qf.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.Ei(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.Ei(t.targeting_flag_key))return r.eligible=!1,r.reason="Survey targeting feature flag is not enabled",r;var s,a=this.Ai(t);return a.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,hp.ti("lastSeenSurveyDate"))?(t=>!!hp.ti(Gf(t))&&!Hp(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=a.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.Li(t)?{eligible:!1,reason:"Survey event/action trigger has not been fired yet"}:e}Li(t){var e;if(!_o(t)&&!zf(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))}Oi(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.Ei(e)}))}fi(t){return this.checkSurveyEligibility(t).eligible&&this.Ri(t)&&this.Li(t)&&this.Oi(t)}bi(t){try{var e=Lg.querySelector(Yp(t,!0));null!=e&&e.shadowRoot&&(Yc(null,e.shadowRoot),this.si.delete(e.shadowRoot)),null==e||e.remove()}catch(e){Bf.warn("Failed to remove survey "+t.id+" from DOM:",e)}}getTestAPI(){return{addSurveyToFocus:this.di,removeSurveyFromFocus:this.vi,surveyInFocus:this.xi,surveyTimeouts:this.ai,handleWidget:this.pi,handlePopoverSurvey:this.handlePopoverSurvey,manageWidgetSelectorListener:this.wi,sortSurveysByAppearanceDelay:this.Si,checkFlags:this.Oi.bind(this),isSurveyFeatureFlagEnabled:this.Ei.bind(this)}}}function jg(t,e){if(Lg&&Og){var i,r=new qg(t);if(t.config.disable_surveys_automatic_display)return Bf.info("Surveys automatic display is disabled. Skipping call surveys and evaluate display logic."),r;if(!1===e)return Bf.info("There are no surveys to load or Surveys is disabled in the project settings."),r;r.callSurveysAndEvaluateDisplayLogic(!0);var n=()=>{K(i)&&(i=setInterval((()=>{r.callSurveysAndEvaluateDisplayLogic(!1)}),1e3))},s=()=>{K(i)||(clearInterval(i),i=void 0)};n();var a=()=>{Lg.hidden?s():(r.callSurveysAndEvaluateDisplayLogic(!1),n())};return Yi(Lg,"visibilitychange",a),r.setAutomaticDisplayDispose((()=>{s(),Lg.removeEventListener("visibilitychange",a)})),r}}function Bg(t){var e=t.survey,i=t.removeSurveyFromFocus,r=void 0===i?()=>{}:i,n=t.setSurveyVisible,s=t.isPreviewMode,a=void 0!==s&&s,o=t.posthog;pf((()=>{var t;if(!a&&null!=(t=e.conditions)&&t.url){var i=()=>{var t,i=e.type===Of.Widget,s=Vp(e,o),a=(null==(t=e.appearance)?void 0:t.widgetType)===Pf.Tab&&i;if(!s)return Bf.info("Hiding survey "+e.id+" because URL does not match"),n(!1),r(e);a&&(Bf.info("Showing survey "+e.id+" because it is a feedback button tab and URL matches"),n(!0))};Yi(Og,"popstate",i),Yi(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}}}),[a,e,r,n,o])}var Hg=200;function zg(t){switch(void 0===t&&(t=Ff.Right),t){case Ff.Top:return{top:"0",left:"50%",transform:"translateX(-50%)"};case Ff.Left:return{top:"50%",left:"0",transform:"rotate(90deg) translateY(-100%)",transformOrigin:"left top"};case Ff.Bottom:return{bottom:"0",left:"50%",transform:"translateX(-50%)"};default:return{top:"50%",right:"0",transform:"rotate(-90deg) translateY(-100%)",transformOrigin:"right top"}}}function Ug(t){var e,i,r,n,s,a,o,l,u,h,d,v,c=t.survey,f=t.forceDisableHtml,g=t.posthog,m=t.style,y=void 0===m?{}:m,b=t.previewPageIndex,_=t.removeSurveyFromFocus,w=void 0===_?()=>{}:_,k=t.isPopup,S=void 0===k||k,x=t.onPreviewSubmit,C=void 0===x?()=>{}:x,T=t.onPreviewBack,M=void 0===T?()=>{}:T,E=t.onPopupSurveyDismissed,I=void 0===E?()=>{}:E,R=t.onCloseConfirmationMessage,P=void 0===R?()=>{}:R,A=t.properties,F=t.isSurveyCompleted,O=t.skipShownEvent,L=t.surveyLanguage,D=gf(null),N=Number.isInteger(b),q=null!=(e=c.appearance)&&e.surveyPopupDelaySeconds?1e3*c.appearance.surveyPopupDelaySeconds:0,j=function(t,e,i,r,n,s,a,o,l){var u=ff(r||0===i||t.type===Of.ExternalSurvey),h=u[0],d=u[1],v=ff(!1),c=v[0],f=v[1],g=gf(!1),m=()=>{var e=()=>{s&&n(t),d(!1)};if(!g.current){var i=null==a?void 0:a.current;i?(g.current=!0,i.style.transition="opacity "+Hg+"ms ease-out",i.style.opacity="0",setTimeout((()=>{g.current=!1,e()}),Hg+50)):e()}},y=e=>{e.detail.surveyId===t.id&&m()};return pf((()=>{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))}},a=()=>{if(Vp(t,e)){d(!0),Og.dispatchEvent(new Event("PHSurveyShown")),o||e.capture(Nf.SHOWN,p({[qf.SURVEY_NAME]:t.name,[qf.SURVEY_ID]:t.id,[qf.SURVEY_ITERATION]:t.current_iteration,[qf.SURVEY_ITERATION_START_DATE]:t.current_iteration_start_date},l&&{[qf.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){}}};Yi(Og,"PHSurveyClosed",y),Yi(Og,"PHSurveySent",s);var u=i>0?setTimeout(a,i):void 0;return K(u)&&a(),()=>{K(u)||clearTimeout(u),K(n)||clearTimeout(n),Og.removeEventListener("PHSurveyClosed",y),Og.removeEventListener("PHSurveySent",s)}}}else Bf.error("usePopupVisibility hook called without a PostHog instance.")}),[]),Bg({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,O,L),B=j.isPopupVisible,H=j.hidePopupWithAnimation,z=j.isSurveySent||b===c.questions.length||!0===F,U=ff(!1),W=U[0],V=U[1],G=mf((()=>!!Qp(c)),[c]),Z=!!(null!=(i=c.appearance)&&i.introScreenHeader||null!=(r=c.appearance)&&r.introScreenDescription),Q=N?b===Fg:!(null==(n=c.appearance)||!n.displayIntroScreen)&&Z&&!W&&!G,J=mf((()=>{var t=Qp(c),e=(null==t?void 0:t.surveySubmissionId)||np();return{isPreviewMode:N,previewPageIndex:b,onPopupSurveyDismissed(){L?Dp(c,g,N,L):Dp(c,g,N),I()},isPopup:S||!1,surveySubmissionId:e,onPreviewSubmit:C,onPreviewBack:M,posthog:g,properties:A,surveyLanguage:L}}),[N,b,S,g,c,I,C,M,A,L]);return B?eg(zp.Provider,{value:J,children:eg("div",{className:"ph-survey",style:p({},Xp(c.type,null==(s=c.appearance)?void 0:s.position,null==(a=c.appearance)?void 0:a.widgetType),y),ref:D,children:z?eg(gg,{header:(null==(o=c.appearance)?void 0:o.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(){H(),P()}}):Q?eg(mg,{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)}):eg(Wg,{survey:c,forceDisableHtml:!!f,posthog:g})})}):null}function Wg(t){var e,i,r=t.survey,n=t.forceDisableHtml,s=t.posthog,a=mf((()=>{var t=Qp(r);if(!t)return null;var e=it(t.lastQuestionIndex);return!e||e&&t.lastQuestionIndex>=0&&r.questions.length>t.lastQuestionIndex?t:(Kp(r),null)}),[r]),o=ff((()=>(null!=a&&a.responses&&Bf.info("Survey is already in progress, filling in initial responses"),(null==a?void 0:a.responses)||{}))),l=o[0],u=o[1],h=yf(zp),d=h.previewPageIndex,v=h.onPopupSurveyDismissed,c=h.isPopup,f=h.onPreviewSubmit,g=h.onPreviewBack,m=h.surveySubmissionId,y=h.isPreviewMode,b=h.properties,_=h.surveyLanguage,w=ff((()=>{var t=null==a?void 0:a.lastQuestionIndex,e=it(t)&&t>=0&&r.questions.length>t?t:0;return it(d)&&d>=0?d:e})),k=w[0],S=w[1],x=ff((()=>{var t;return(null!==(t=null==a?void 0:a.visitedIndices)&&void 0!==t?t:[]).filter((t=>t>=0&&r.questions.length>t))})),C=x[0],T=x[1],M=mf((()=>Bp(r,a)),[r,a]);pf((()=>{!y||K(d)||0>d||S(d)}),[d,y]);var E=!(null==(e=r.appearance)||!e.allowGoBack)&&(y?(null!=d?d:0)>0:C.length>0),I=M.at(k);return I?eg("form",{className:"survey-form",name:"surveyForm",children:[c&&!0!==(null==(i=r.appearance)?void 0:i.hideCancelButton)&&eg(fg,{onClick(){v()}}),eg("div",{className:"survey-box","data-question-index":k,children:Gg({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 a=ho(n),o=p({},l,{[a]:e});u(o);var h=Rg(r,i,e),d=h===Df.End,v=[...C,i];if(d||(T(v),S(h),Zp(r,{surveySubmissionId:m,responses:o,lastQuestionIndex:h,questionOrder:jp(M),visitedIndices:v,surveyLanguage:_})),r.enable_partial_responses||d){var c=new Set(v.map((t=>{var e;return null==(e=M[t])?void 0:e.id})).filter((t=>!!t)).map((t=>ho(t)))),f=Object.fromEntries(Object.entries(o).filter((t=>c.has(t[0]))));Op({responses:f,survey:r,surveySubmissionId:m,isSurveyCompleted:d,posthog:s,properties:b,surveyLanguage:_})}}else Bf.error("onNextButtonClick called without a questionId.");else Bf.error("onNextButtonClick called without a PostHog instance.")})({res:t,displayQuestionIndex:k,questionId:I.id}),onPreviewSubmit:f,initialValue:I.id?l[ho(I.id)]:void 0,canGoBack:E,onBack(){if(y)g();else if(0!==C.length){var t=C[C.length-1],e=C.slice(0,-1);T(e),S(t),Zp(r,{surveySubmissionId:m,responses:l,lastQuestionIndex:t,questionOrder:jp(M),visitedIndices:e,surveyLanguage:_})}}})})]}):null}function Vg(t){var e,i,r,n,s,a,o,l=t.survey,u=t.forceDisableHtml,h=t.posthog,d=t.readOnly,v=t.surveyLanguage,c=ff(!0),f=c[0],p=c[1],g=ff(!1),m=g[0],y=g[1],b=ff({}),_=b[0],w=b[1],k=gf(void 0),S=()=>{y(!m)};if(pf((()=>{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&&(Bf.info("Received show event for feedback button survey "+l.id),w(i.detail.position||{}),S())};return Yi(Og,Dg,e),()=>{K(k.current)||(clearTimeout(k.current),k.current=void 0),Og.removeEventListener(Dg,e)}}}else Bf.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]),Bg({survey:l,setSurveyVisible:p,posthog:h}),!f)return null;var x=()=>{l.schedule!==$f&&p(!1),K(k.current)||clearTimeout(k.current),k.current=setTimeout((()=>{k.current=void 0,y(!1)}),200)};return eg(Ac,{children:["tab"===(null==(n=l.appearance)?void 0:n.widgetType)&&eg("button",{className:"ph-survey-widget-tab "+((null==(s=l.appearance)?void 0:s.tabPosition)===Ff.Top?"widget-tab-top":""),onClick:S,disabled:d,style:zg(null==(a=l.appearance)?void 0:a.tabPosition),children:(null==(o=l.appearance)?void 0:o.widgetLabel)||""}),m&&eg(Ug,{posthog:h,survey:l,forceDisableHtml:u,style:_,onPopupSurveyDismissed:x,onCloseConfirmationMessage:x,surveyLanguage:v})]})}var Gg=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 Lf.Open:return Rc(bg,p({},n,{question:e,key:e.id}));case Lf.Link:return Rc(_g,p({},n,{question:e,key:e.id}));case Lf.Rating:return Rc(wg,p({},n,{question:e,key:e.id}));case Lf.SingleChoice:case Lf.MultipleChoice:return Rc(Sg,p({},n,{question:e,key:e.id}));default:return Bf.error("Unsupported question type: "+e.type),null}};v.__PosthogExtensions__=v.__PosthogExtensions__||{},v.__PosthogExtensions__.generateSurveys=jg,v.extendPostHogWithSurveys=jg;var Zg=t=>{for(;null!=(e=t)&&e.__rrweb_original__;){var e;t=t.__rrweb_original__}return t},Qg=1e4,Jg=(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),Kg=(t,e,i)=>{var r=JSON.stringify(t);if(i.remaining>=r.length)return Jg(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 a=Math.ceil((n+s)/2);JSON.stringify(t.slice(0,a)).length>i.remaining?s=a-1:n=a}return Jg(e,JSON.stringify(t.slice(0,n)),i)},Yg=t=>void 0!==t&&"function"!=typeof t&&"symbol"!=typeof t&&"bigint"!=typeof t,Xg=(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}},tm=(t,e,i)=>{if(!i.truncated)if(Q(t)){if(i.seen.has(t))return void Xg(e||"circular","[Circular]",i);i.seen.add(t);try{for(var r in t)try{if(!{}.hasOwnProperty.call(t,r))continue;if(tm(t[r],e?e+"."+r:r,i),i.truncated)return}catch(t){continue}}catch(t){}}else Xg(e,t,i)},em=function(t,e,i,r,n,s){if(void 0===n&&(n=!1),!Yg(t))return!n||Jg(e,"null",i);if(tt(t)||(t=>{try{return it(t)||nt(t)}catch(t){return!1}})(t))return Jg(e,JSON.stringify(t),i);if("string"==typeof t)return Kg(t,e,i);if(!Q(t)&&!G(t))return Jg(e,JSON.stringify(t),i);if(r.has(t))return Kg("[Circular]",e,i);r.add(t);try{var a=t.toJSON;if(Z(a))return em(a.call(t),e,i,r,n)}catch(t){}try{var o={}.toString.call(t);if("[object String]"===o)return Kg(String(t.valueOf()),e,i);if("[object Number]"===o||"[object Boolean]"===o)return Jg(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 em(l,e,i,r,n,s)}if(G(t)){if(!Jg(e,"[",i))return!1;for(var h=0;t.length>h;h++){if(h>0&&!Jg(e,",",i))return!1;var d=void 0;try{d=t[h]}catch(t){d=void 0}if(!em(d,e,i,r,!0))return!1}return Jg(e,"]",i)}if(!Jg(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{tm(f,c,s)}catch(t){}if(Yg(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(!Jg(e,p,i))return!1;var b=e.length,_=em(f,e,i,r,!1),w=i.truncated;if(e.length!==b){if(v=!1,!_)return!1}else if(e.length=g,i.remaining=m,i.truncated=_?y:w,!_)return!1}}}catch(t){}return Jg(e,"}",i)},im=(t,e)=>{for(var i=[],r={remaining:e,truncated:!1},n=Q(t[0])?{result:{},keysRemaining:50,sizeRemaining:Qg,truncated:!1,seen:new WeakSet([t[0]])}:void 0,s=0;t.length>s&&(0>=s||Jg(i," ",r))&&em(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)||{}}},rm={debug:"debug",log:"info",warn:"warn",error:"error",info:"info"},nm=t=>"canCapture"in t,sm=t=>nm(t)?t.canCapture?t.getExtension(Yf):void 0:t.is_capturing()?t.logs:void 0;v.__PosthogExtensions__=v.__PosthogExtensions__||{},v.__PosthogExtensions__.logs={initializeLogs(t){var e=t,i=[],r={host:v.location.host},n=!1,s=function(t){var s=v.console[t];i.push(Dv(v.console,t,(i=>{var a=(i=>function(){for(var s=!1,a=arguments.length,o=new Array(a),l=0;a>l;l++)o[l]=arguments[l];try{var u=e;if(o.length>0&&!n&&u){var h=sm(u);if(h){n=!0,s=!0;var d=im(o,Qg),c=d.body,f=d.attributes,g=p({},r,d.truncated?{body_truncated:"true"}:{});((t,e,i)=>{if(nm(t))e.captureConsoleLog(i);else{var r=(t=>{var e=/^1\.(\d+)\.(\d+)$/.exec(t);if(e){var i=Number(e[1]),r=Number(e[2]);if(i>=392&&419>=i)return 410===i?r>4?r>10?void 0:"de":"le":418===i?r>3?r>10?r>14?r>17?void 0:"vi":"ci":"ui":"he":419===i?r>2?void 0:"vi":410>i?"le":"he"}})(t.version),n=r?e[r]:void 0;Z(n)&&n.call(e,i)}})(u,h,{level:rm[t],body:c,attributes:p({"log.source":"console."+t},g,f)})}}}catch(t){}finally{s&&(n=!1),i.apply(v.console,o)}})(i);return a.__rrweb_original__=Zg(s),a})))};for(var a of Object.keys(rm))s(a);return()=>{e=void 0,i.forEach((t=>t()))}},replayConsoleBuffer(t,e){var i=sm(t);if(i)for(var r of e)try{var n=im(r.args,Qg);null==i.captureBufferedConsoleLog||i.captureBufferedConsoleLog({level:rm[r.level],body:n.body,attributes:p({"log.source":"console."+r.level,host:v.location.host},n.truncated?{body_truncated:"true"}:{},n.attributes)},r.context,r.occurredAtMs)}catch(t){}}};var am=Hi("[Error tracking]"),om=["chrome-extension://","moz-extension://","safari-extension:","safari-web-extension:"],lm=["__firefox__","__gCrWeb"];function um(){return new li([new wi,new Pi,new Si,new ki,new Ii,new Ei,new Ci,new Ri],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"),a=r;s.length>a;a++){var o=s[a];if(1024>=o.length){var l=bi.test(o)?o.replace(bi,"$1"):o;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||ui});var i}))}(n)}}("web:javascript",pi,yi))}var hm=Hi("[ExceptionAutocapture]"),dm=um(),vm=e=>{var i=t;i||hm.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 a=dm.buildFromUnknown((t=>{var e=t[0],i=t[1],r=t[2],n=t[3],s=t[4];if(null!=s)return s;if(Y(e)&&Y(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(a),!!Z(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}},cm=function(e,i){void 0===i&&(i=!1);var r=t;r||hm.info("window not available, cannot wrap onUnhandledRejection");var n=r.onunhandledrejection;return r.onunhandledrejection=function(t){var r,s=dm.buildFromUnknown(t,{mechanism:{handled:!1}});return e(s),Z(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}},fm={wrapOnError:vm,wrapUnhandledRejection:cm,wrapConsoleError(t){var e=console;e||hm.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 a=n.find((t=>t instanceof Error)),o=dm.buildFromUnknown(a||e,{mechanism:{handled:!1},syntheticException:new Error("PostHog syntheticException"),skipFirstLines:2});t(o),Z(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=fm,v.posthogErrorWrappingFunctions=fm;var pm=(t,e)=>{if(Z(null==t?void 0:t.capture)){var i=null==e?void 0:e.autocaptureExceptions,r=!tt(i)&&"object"==typeof i&&G(i.errors_to_ignore)?i.errors_to_ignore.reduce(((t,e)=>{try{t.push(new RegExp(e))}catch(t){hm.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){hm.error("Failed to capture exception for a legacy client",t)}};vm((t=>{r.some((e=>t.$exception_list.some((t=>e.test(t.value||"")))))||n(t)})),cm(n,!0)}};v.extendPostHogWithExceptionAutoCapture=pm,v.extendPostHogWithExceptionAutocapture=pm;var gm="X-POSTHOG-SESSION-ID",mm="X-POSTHOG-WINDOW-ID",ym="X-POSTHOG-DISTINCT-ID",bm=[gm,mm,ym],_m=["attributionReporting","body","browsingTopics","cache","credentials","dispatcher","duplex","integrity","keepalive","method","mode","priority","redirect","referrer","referrerPolicy","signal","window"],wm=(t,e)=>({}.hasOwnProperty.call(t,e)),km=t=>"object"==typeof t&&!tt(t)||Z(t),Sm=t=>"undefined"!=typeof Request&&(t instanceof Request||"[object Request]"==={}.toString.call(t)),xm=e=>{try{var i;return Sm(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}},Cm=(t,e,i,r,n)=>{var s;try{s=new URL(r).hostname}catch(t){return!1}if(!t)return!1;if(G(t)&&!t.includes(s))return!1;var a=!1;if(i){var o=i.checkAndGetSessionAndWindowId(!0),l=o.windowId;n.set(gm,o.sessionId),n.set(mm,l),a=!0}var u=(t=>Z(t)?t():t)(e);return u&&u!==ws&&(n.set(ym,u),a=!0),a};v.__PosthogExtensions__=v.__PosthogExtensions__||{};var Tm={_patchFetch:(e,i,r)=>Dv(t,"fetch",(t=>function(n,s){var a=arguments.length>1?[n,s]:[n],o=a;try{var l=xm(n);if(l)if(Sm(n)){var u=new Request(n,s);Cm(e,i,r,u.url,u.headers),o=[u]}else{var h=new Headers(km(s)?s.headers:void 0);if(Cm(e,i,r,l,h)){var d=((t,e)=>{if(K(t)||tt(t))return{headers:e};if(km(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)=>wm(t,e)?Reflect.get(t,e):Reflect.get(i,e,i),has:(t,e)=>wm(t,e)||e in i,ownKeys(t){var e=new Set(Reflect.ownKeys(t));return Reflect.ownKeys(i).forEach((t=>e.add(t))),_m.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&&_m.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&&(o=[n,d])}}}catch(t){o=a}return t.apply(this,o)})),_patchXHR:(e,i,r)=>Dv(t.XMLHttpRequest.prototype,"open",(t=>function(n,s,a,o,l){void 0===a&&(a=!0);var u=this,h=new Headers,d=xm(s);d&&Cm(e,i,r,d,h);var v=t.call(u,n,s,a,o,l);return bm.forEach((t=>{var e=h.get(t);if(e)try{u.setRequestHeader(t,e)}catch(t){}})),v}))};v.__PosthogExtensions__.tracingHeadersPatchFns=Tm,v.postHogTracingHeadersPatchFns=Tm,"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 Mm=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 Em=()=>{var t=performance.getEntriesByType("navigation")[0];if(t&&t.responseStart>0&&t.responseStart<performance.now())return t},Im=t=>{if("loading"===document.readyState)return"loading";var e=Em();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"},Rm=t=>{var e=t.nodeName;return 1===t.nodeType?e.toLowerCase():e.toUpperCase().replace(/^#/,"")},Pm=t=>{var e="";try{for(;9!==(null==(i=t)?void 0:i.nodeType);){var i,r,n=t,s=n.id?"#"+n.id:[Rm(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},Am=new WeakMap;function Fm(t,e){var i=Am.get(e);return i||(i=new WeakMap,Am.set(e,i)),i.get(t)||i.set(t,new e),i.get(t)}var Om=-1,Lm=()=>Om,Dm=t=>{addEventListener("pageshow",(e=>{e.persisted&&(Om=e.timeStamp,t(e))}),!0)},$m=(t,e,i,r)=>{var n,s;return a=>{e.value>=0&&(a||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))}},Nm=t=>{requestAnimationFrame((()=>requestAnimationFrame(t)))},qm=()=>{var t,e;return null!==(t=null==(e=Em())?void 0:e.activationStart)&&void 0!==t?t:0},jm=-1,Bm=new Set,Hm=()=>"hidden"!==document.visibilityState||document.prerendering?1/0:0,zm=t=>{if("hidden"===document.visibilityState){if("visibilitychange"===t.type)for(var e of Bm)e();isFinite(jm)||(jm="visibilitychange"===t.type?t.timeStamp:0,removeEventListener("prerenderingchange",zm,!0))}},Um=function(t){if(void 0===t&&(t=!1),t&&(jm=1/0),0>jm){var e,i=qm(),r=document.prerendering||null==(e=globalThis.performance.getEntriesByType("visibility-state").find((t=>"hidden"===t.name&&t.startTime>=i)))?void 0:e.startTime;jm=null!=r?r:Hm(),addEventListener("visibilitychange",zm,!0),addEventListener("prerenderingchange",zm,!0),Dm((()=>{setTimeout((()=>{jm=Hm()}))}))}return{get firstHiddenTime(){return jm},onHidden(t){Bm.add(t)}}},Wm=function(t,e,i,r,n,s,a){void 0===e&&(e=-1),void 0===r&&(r=0);var o=Em(),l=(null==o?void 0:o.navigationId)||0,u="navigate";return i?u=i:0>Lm()?o&&(document.prerendering||qm()>0?u="prerender":document.wasDiscarded?u="restore":o.type&&(u=o.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==o?void 0:o.name),navigationStartTime:a||0}},Vm=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){}},Gm=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},Zm=(t,e)=>{if(t.set(e.navigationId,e),t.size>2){var i=t.keys().next().value;void 0!==i&&t.delete(i)}},Qm=t=>{var e=!1;return()=>{e||(t(),e=!0)}};let Jm=class{constructor(){this.u=void 0}};var Km,Ym=t=>{document.prerendering?addEventListener("prerenderingchange",t,!0):t()},Xm=[1800,3e3],ty=function(t,e){void 0===e&&(e={});var i=Gm(e);Ym((()=>{var r,n=Fm(e,Jm),s=Um(),a=Wm("FCP"),o=Vm(["paint"],(t=>{for(var e of t)"first-contentful-paint"===e.name&&(o.disconnect(),s.firstHiddenTime>e.startTime&&(a.value=Math.max(e.startTime-qm(),0),a.entries.push(e),a.navigationId=e.navigationId||a.navigationId,r(!0)))}));o&&(r=$m(t,a,Xm,e.reportAllChanges),Dm((i=>{a=Wm("FCP",-1,"back-forward-cache",a.navigationId,a.navigationInteractionId,a.navigationURL,Lm()),r=$m(t,a,Xm,e.reportAllChanges),Nm((()=>{a.value=performance.now()-i.timeStamp,r(!0)}))}))),i&&Vm(["soft-navigation"],(i=>{i.forEach((i=>{n.u&&i.navigationId&&Zm(n.u,i);var s=Math.max((i.presentationTime||i.paintTime||0)-i.startTime,0);a=Wm("FCP",s,"soft-navigation",i.navigationId,i.interactionId,i.name,i.startTime),(r=$m(t,a,Xm,e.reportAllChanges))(!0)}))}),e)}))},ey=[.1,.25],iy=t=>t.find((t=>{var e;return 1===(null==(e=t.node)?void 0:e.nodeType)}))||t[0],ry=0,ny=1/0,sy=0,ay=t=>{for(var e of t)e.interactionId&&(ny=Math.min(ny,e.interactionId),sy=Math.max(sy,e.interactionId),ry=sy?(sy-ny)/7+1:0)},oy=()=>{var t;return Km?ry:null!==(t=performance.interactionCount)&&void 0!==t?t:0},ly=0;let uy=class{constructor(){this.h=[],this.v=new Map,this.p=void 0,this.m=void 0}M(){ly=oy(),this.h.length=0,this.v.clear()}T(t){var e=oy()-ly,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 a of s)this.v.delete(a.id)}null==(n=this.m)||n.call(this,r)}}}};var hy=t=>{var e="requestIdleCallback"in globalThis?1e3:0,i=globalThis.requestIdleCallback||setTimeout,r=globalThis.cancelIdleCallback||clearTimeout;if("hidden"===document.visibilityState)t();else{var n=Qm(t),s=-1,a=()=>{r(s),n()};addEventListener("visibilitychange",a,{once:!0,capture:!0}),s=i((()=>{removeEventListener("visibilitychange",a,{capture:!0}),n()}),{timeout:e})}},dy=[200,500];let vy=class{constructor(){this.p=void 0,this.u=void 0}l(t){var e;null==(e=this.p)||e.call(this,t)}};var cy=[2500,4e3],fy=-1,py=()=>fy,gy=t=>{addEventListener("pageshow",(e=>{e.persisted&&(fy=e.timeStamp,t(e))}),!0)},my=(t,e,i,r)=>{var n,s;return a=>{e.value>=0&&(a||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))}},yy=t=>{requestAnimationFrame((()=>requestAnimationFrame(t)))},by=()=>{var t=performance.getEntriesByType("navigation")[0];if(t&&t.responseStart>0&&t.responseStart<performance.now())return t},_y=()=>{var t,e;return null!==(t=null==(e=by())?void 0:e.activationStart)&&void 0!==t?t:0},wy=-1,ky=new Set,Sy=()=>"hidden"!==document.visibilityState||document.prerendering?1/0:0,xy=t=>{if("hidden"===document.visibilityState){if("visibilitychange"===t.type)for(var e of ky)e();isFinite(wy)||(wy="visibilitychange"===t.type?t.timeStamp:0,removeEventListener("prerenderingchange",xy,!0))}},Cy=function(t){if(void 0===t&&(t=!1),t&&(wy=1/0),0>wy){var e,i=_y(),r=document.prerendering||null==(e=globalThis.performance.getEntriesByType("visibility-state").find((t=>"hidden"===t.name&&t.startTime>=i)))?void 0:e.startTime;wy=null!=r?r:Sy(),addEventListener("visibilitychange",xy,!0),addEventListener("prerenderingchange",xy,!0),gy((()=>{setTimeout((()=>{wy=Sy()}))}))}return{get firstHiddenTime(){return wy},onHidden(t){ky.add(t)}}},Ty=function(t,e,i,r,n,s,a){void 0===e&&(e=-1),void 0===r&&(r=0);var o=by(),l=(null==o?void 0:o.navigationId)||0,u="navigate";return i?u=i:0>py()?o&&(document.prerendering||_y()>0?u="prerender":document.wasDiscarded?u="restore":o.type&&(u=o.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==o?void 0:o.name),navigationStartTime:a||0}},My=new WeakMap;function Ey(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)}let Iy=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 Ry=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){}},Py=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},Ay=(t,e)=>{if(t.set(e.navigationId,e),t.size>2){var i=t.keys().next().value;void 0!==i&&t.delete(i)}},Fy=t=>{var e=!1;return()=>{e||(t(),e=!0)}};let Oy=class{constructor(){this.l=void 0}};var Ly,Dy=t=>{document.prerendering?addEventListener("prerenderingchange",t,!0):t()},$y=[1800,3e3],Ny=function(t,e){void 0===e&&(e={});var i=Py(e);Dy((()=>{var r,n=Ey(e,Oy),s=Cy(),a=Ty("FCP"),o=Ry(["paint"],(t=>{for(var e of t)"first-contentful-paint"===e.name&&(o.disconnect(),s.firstHiddenTime>e.startTime&&(a.value=Math.max(e.startTime-_y(),0),a.entries.push(e),a.navigationId=e.navigationId||a.navigationId,r(!0)))}));o&&(r=my(t,a,$y,e.reportAllChanges),gy((i=>{a=Ty("FCP",-1,"back-forward-cache",a.navigationId,a.navigationInteractionId,a.navigationURL,py()),r=my(t,a,$y,e.reportAllChanges),yy((()=>{a.value=performance.now()-i.timeStamp,r(!0)}))}))),i&&Ry(["soft-navigation"],(i=>{i.forEach((i=>{n.l&&i.navigationId&&Ay(n.l,i);var s=Math.max((i.presentationTime||i.paintTime||0)-i.startTime,0);a=Ty("FCP",s,"soft-navigation",i.navigationId,i.interactionId,i.name,i.startTime),(r=my(t,a,$y,e.reportAllChanges))(!0)}))}),e)}))},qy=[.1,.25],jy=function(t,e){void 0===e&&(e={});var i=Cy();Ny(Fy((()=>{var r,n=Ty("CLS",0),s=Ey(e,Iy),a=(i,a,o,l,u)=>{n=Ty("CLS",0,i,a,o,l,u),s.i=0,r=my(t,n,qy,e.reportAllChanges)},o=function(t){void 0===t&&(t=!1),s.i>n.value&&(n.value=s.i,n.entries=s.o),r(t)},l=t=>{o(!0),a("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);o()},h=["layout-shift"];Py(e)&&h.push("soft-navigation");var d=Ry(h,u);d&&(r=my(t,n,qy,e.reportAllChanges),i.onHidden((()=>{u(d.takeRecords()),r(!0)})),gy((()=>{a("back-forward-cache",n.navigationId,n.navigationInteractionId,n.navigationURL,py()),yy(r)})),setTimeout(r))})))},By=0,Hy=1/0,zy=0,Uy=t=>{for(var e of t)e.interactionId&&(Hy=Math.min(Hy,e.interactionId),zy=Math.max(zy,e.interactionId),By=zy?(zy-Hy)/7+1:0)},Wy=()=>{var t;return Ly?By:null!==(t=performance.interactionCount)&&void 0!==t?t:0},Vy=0;let Gy=class{constructor(){this.u=[],this.v=new Map,this.m=void 0,this.p=void 0}T(){Vy=Wy(),this.u.length=0,this.v.clear()}M(t){var e=Wy()-Vy,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 a of s)this.v.delete(a.id)}null==(n=this.p)||n.call(this,r)}}}};var Zy=t=>{var e="requestIdleCallback"in globalThis?1e3:0,i=globalThis.requestIdleCallback||setTimeout,r=globalThis.cancelIdleCallback||clearTimeout;if("hidden"===document.visibilityState)t();else{var n=Fy(t),s=-1,a=()=>{r(s),n()};addEventListener("visibilitychange",a,{once:!0,capture:!0}),s=i((()=>{removeEventListener("visibilitychange",a,{capture:!0}),n()}),{timeout:e})}},Qy=[200,500],Jy=function(t,e){if(void 0===e&&(e={}),globalThis.PerformanceEventTiming&&"interactionId"in PerformanceEventTiming.prototype){var i=Cy();Dy((()=>{var r;"interactionCount"in performance||Ly||(Ly=Ry(["event"],Uy,{durationThreshold:0}));var n,s=Ty("INP"),a=Ey(e,Gy),o=(i,r,o,l,u)=>{a.T(),s=Ty("INP",-1,i,r,o,l,u),n=my(t,s,Qy,e.reportAllChanges)},l=()=>{var t=a.M(s.navigationType);t&&t._!==s.value&&(s.value=t._,s.entries=t.entries,n())},u=t=>{l(),n(!0),o("soft-navigation",t.navigationId,t.interactionId,t.name,t.startTime)},h=function(t,e){void 0===e&&(e=!1),Zy((()=>{for(var i of t)"soft-navigation"!==i.entryType?a.h(i):u(i);l(),e&&n(!0)}))},d=["event","first-input"];Py(e)&&d.push("soft-navigation");var v=Ry(d,h,p({},e,{durationThreshold:null!==(r=e.durationThreshold)&&void 0!==r?r:40}));n=my(t,s,Qy,e.reportAllChanges),v&&(i.onHidden((()=>{h(v.takeRecords(),!0)})),gy((()=>{o("back-forward-cache",s.navigationId,s.navigationInteractionId,s.navigationURL,py())})))}))}};let Ky=class{constructor(){this.m=void 0,this.l=void 0}h(t){var e;null==(e=this.m)||e.call(this,t)}};var Yy=[2500,4e3],Xy=function(t,e){void 0===e&&(e={});var i=!1,r=Py(e);Dy((()=>{var n,s=Cy(),a=Ty("LCP"),o=Ey(e,Ky),l=(r,o,l,u,h)=>{a=Ty("LCP",-1,r,o,l,u,h),n=my(t,a,Yy,e.reportAllChanges),i=!1,"soft-navigation"===r&&(s=Cy(!0))},u=t=>{o.l&&t.navigationId&&Ay(o.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-_y(),0),o.h(i),h=[i];else if("interaction-contentful-paint"===i.entryType){var v,c=i;if(!a.navigationId)continue;if("interactionId"in c&&c.interactionId!=a.navigationInteractionId)continue;d=(null==(v=c.largestContentfulPaint)?void 0:v.renderTime)||0,l=Math.max(d-i.startTime,0),c.largestContentfulPaint&&(o.h(c.largestContentfulPaint),h=[c.largestContentfulPaint])}s.firstHiddenTime>d&&(a.value=l,a.entries=h,n())}else u(i)},d=["largest-contentful-paint"];r&&d.push("interaction-contentful-paint","soft-navigation");var v=Ry(d,h);if(v){n=my(t,a,Yy,e.reportAllChanges);var c=["keydown","click","visibilitychange"],f=t=>{if(t.isTrusted&&!i){var e=a.id;Zy((()=>{if(!i){if(!r)for(var t of(v.disconnect(),c))removeEventListener(t,f,{capture:!0});e===a.id&&(i=!0,n(!0))}}))}};for(var p of c)addEventListener(p,f,{capture:!0});gy((r=>{l("back-forward-cache",a.navigationId,a.navigationInteractionId,a.navigationURL,py()),n=my(t,a,Yy,e.reportAllChanges),yy((()=>{a.value=performance.now()-r.timeStamp,i=!0,n(!0)}))}))}}))},tb={onLCP(t,e){void 0===e&&(e={});var i=Fm(e=Object.assign({},e),vy),r=new WeakMap;Gm(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:Pm(i);r.set(t,s)}else t.id&&r.set(t,"#"+t.id)},function(t,e){void 0===e&&(e={});var i=!1,r=Gm(e);Ym((()=>{var n,s=Um(),a=Wm("LCP"),o=Fm(e,vy),l=(r,o,l,u,h)=>{a=Wm("LCP",-1,r,o,l,u,h),n=$m(t,a,cy,e.reportAllChanges),i=!1,"soft-navigation"===r&&(s=Um(!0))},u=t=>{o.u&&t.navigationId&&Zm(o.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-qm(),0),o.l(i),h=[i];else if("interaction-contentful-paint"===i.entryType){var v,c=i;if(!a.navigationId)continue;if("interactionId"in c&&c.interactionId!=a.navigationInteractionId)continue;d=(null==(v=c.largestContentfulPaint)?void 0:v.renderTime)||0,l=Math.max(d-i.startTime,0),c.largestContentfulPaint&&(o.l(c.largestContentfulPaint),h=[c.largestContentfulPaint])}s.firstHiddenTime>d&&(a.value=l,a.entries=h,n())}else u(i)},d=["largest-contentful-paint"];r&&d.push("interaction-contentful-paint","soft-navigation");var v=Vm(d,h);if(v){n=$m(t,a,cy,e.reportAllChanges);var c=["keydown","click","visibilitychange"],f=t=>{if(t.isTrusted&&!i){var e=a.id;hy((()=>{if(!i){if(!r)for(var t of(v.disconnect(),c))removeEventListener(t,f,{capture:!0});e===a.id&&(i=!0,n(!0))}}))}};for(var p of c)addEventListener(p,f,{capture:!0});Dm((r=>{l("back-forward-cache",a.navigationId,a.navigationInteractionId,a.navigationURL,Lm()),n=$m(t,a,cy,e.reportAllChanges),Nm((()=>{a.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,a,o,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=Em())?void 0:s.activationStart)&&void 0!==n?n:0,c=null!==(a=null==(o=u)?void 0:o.responseStart)&&void 0!==a?a: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=Fm(e=Object.assign({},e),Mm),r=new WeakMap;i.t=t=>{var i;if(null!=t&&null!=(i=t.sources)&&i.length){var n=iy(t.sources),s=null==n?void 0:n.node;if(s){var a,o=null!==(a=null==e.generateTarget?void 0:e.generateTarget(s))&&void 0!==a?a:Pm(s);r.set(n,o)}}},function(t,e){void 0===e&&(e={});var i=Um();ty(Qm((()=>{var r,n=Wm("CLS",0),s=Fm(e,Mm),a=(i,a,o,l,u)=>{n=Wm("CLS",0,i,a,o,l,u),s.o=0,r=$m(t,n,ey,e.reportAllChanges)},o=function(t){void 0===t&&(t=!1),s.o>n.value&&(n.value=s.o,n.entries=s.i),r(t)},l=t=>{o(!0),a("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);o()},h=["layout-shift"];Gm(e)&&h.push("soft-navigation");var d=Vm(h,u);d&&(r=$m(t,n,ey,e.reportAllChanges),i.onHidden((()=>{u(d.takeRecords()),r(!0)})),Dm((()=>{a("back-forward-cache",n.navigationId,n.navigationInteractionId,n.navigationURL,Lm()),Nm(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=iy(n.sources);s&&(e={largestShiftTarget:r.get(s),largestShiftTime:n.startTime,largestShiftValue:n.value,largestShiftSource:s,largestShiftEntry:n,loadState:Im(n.startTime)})}}return Object.assign(t,{attribution:e})})(e))}),e)},onFCP(t,e){void 0===e&&(e={});var i=Fm(e=Object.assign({},e),Jm);Gm(e)&&(i.u=new Map),ty((e=>{t((t=>{var e={timeToFirstByte:0,firstByteToFCP:t.value,loadState:Im(Lm())};if("soft-navigation"!==t.navigationType){if(t.entries.length){var r=Em(),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:Im(t.entries[0].startTime),navigationEntry:r,fcpEntry:n}}}}else{var a,o=null==(a=i.u)?void 0:a.get(t.navigationId);o&&(e={timeToFirstByte:0,firstByteToFCP:t.value,loadState:"complete",navigationEntry:o})}return Object.assign(t,{attribution:e})})(e))}),e)},onINP(t,e){void 0===e&&(e={});var i=Fm(e=Object.assign({},e),uy),r=[],n=[],s=0,a=new WeakMap,o=new WeakMap,l=!1,u=()=>{l||(hy(h),l=!0)},h=()=>{var t=new Set(i.h.map((t=>a.get(t.entries[0])))),e=n.length-10;n=n.filter(((i,r)=>r>=e||t.has(i)));var o=new Set;for(var u of n){var h=d(u.startTime,u.processingEnd);for(var v of h)o.add(v)}r=r.filter((t=>t.startTime>s||o.has(t))),l=!1};i.p=t=>{var i,r=t.startTime+t.duration;s=Math.max(s,t.processingEnd);for(var o=n.length-1;o>=0;o--){var l=n[o];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)&&a.set(t,i),u()},i.m=t=>{if(!o.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:Pm(r);o.set(t,s)}else{var a,l=null==(a=t.entries.find((t=>t.targetSelector)))?void 0:a.targetSelector;l&&o.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};Vm(["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=Um();Ym((()=>{var r;"interactionCount"in performance||Km||(Km=Vm(["event"],ay,{durationThreshold:0}));var n,s=Wm("INP"),a=Fm(e,uy),o=(i,r,o,l,u)=>{a.M(),s=Wm("INP",-1,i,r,o,l,u),n=$m(t,s,dy,e.reportAllChanges)},l=()=>{var t=a.T(s.navigationType);t&&t.D!==s.value&&(s.value=t.D,s.entries=t.entries,n())},u=t=>{l(),n(!0),o("soft-navigation",t.navigationId,t.interactionId,t.name,t.startTime)},h=function(t,e){void 0===e&&(e=!1),hy((()=>{for(var i of t)"soft-navigation"!==i.entryType?a.l(i):u(i);l(),e&&n(!0)}))},d=["event","first-input"];Gm(e)&&d.push("soft-navigation");var v=Vm(d,h,p({},e,{durationThreshold:null!==(r=e.durationThreshold)&&void 0!==r?r:40}));n=$m(t,s,dy,e.reportAllChanges),v&&(i.onHidden((()=>{h(v.takeRecords(),!0)})),Dm((()=>{o("back-forward-cache",s.navigationId,s.navigationInteractionId,s.navigationURL,Lm())})))}))}}((e=>{t((t=>{if(0===t.entries.length){var e={processedEventEntries:[],longAnimationFrameEntries:[],inputDelay:0,processingDuration:0,presentationDelay:t.value,loadState:Im(t.navigationStartTime||0)};return Object.assign(t,{attribution:e})}var r=t.entries[0],n=a.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:o.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:Im(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,a=t.inputDelay,o=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+a>c.startTime?"input-delay":i+a+o>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+a+o&&(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:Xy,onCLS:jy,onFCP:Ny,onINP:Jy}};v.__PosthogExtensions__=v.__PosthogExtensions__||{},v.__PosthogExtensions__.postHogWebVitalsCallbacksByFlavor=v.__PosthogExtensions__.postHogWebVitalsCallbacksByFlavor||{},v.__PosthogExtensions__.postHogWebVitalsCallbacksByFlavor["web-vitals-with-attribution-soft-navs"]=tb,v.__PosthogExtensions__.postHogWebVitalsCallbacks=tb,v.postHogWebVitalsCallbacks=tb;var eb={onLCP:Xy,onCLS:jy,onFCP:Ny,onINP:Jy};v.__PosthogExtensions__=v.__PosthogExtensions__||{},v.__PosthogExtensions__.postHogWebVitalsCallbacksByFlavor=v.__PosthogExtensions__.postHogWebVitalsCallbacksByFlavor||{},v.__PosthogExtensions__.postHogWebVitalsCallbacksByFlavor["web-vitals-soft-navs"]=eb,v.__PosthogExtensions__.postHogWebVitalsCallbacks=eb,v.postHogWebVitalsCallbacks=eb,v.__PosthogExtensions__.loadWebVitalsCallbacks=()=>eb;let ib=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 rb=()=>{var t=performance.getEntriesByType("navigation")[0];if(t&&t.responseStart>0&&t.responseStart<performance.now())return t},nb=t=>{if("loading"===document.readyState)return"loading";var e=rb();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"},sb=t=>{var e=t.nodeName;return 1===t.nodeType?e.toLowerCase():e.toUpperCase().replace(/^#/,"")},ab=t=>{var e="";try{for(;9!==(null==(i=t)?void 0:i.nodeType);){var i,r=t,n=r.id?"#"+r.id:[sb(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},ob=new WeakMap;function lb(t,e){var i=ob.get(e);return i||(i=new WeakMap,ob.set(e,i)),i.get(t)||i.set(t,new e),i.get(t)}var ub,hb=-1,db=()=>hb,vb=t=>{addEventListener("pageshow",(e=>{e.persisted&&(hb=e.timeStamp,t(e))}),!0)},cb=(t,e,i,r)=>{var n,s;return a=>{e.value>=0&&(a||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))}},fb=t=>{requestAnimationFrame((()=>requestAnimationFrame(t)))},pb=()=>{var t,e;return null!==(t=null==(e=rb())?void 0:e.activationStart)&&void 0!==t?t:0},gb=function(t,e){void 0===e&&(e=-1);var i=rb(),r="navigate";return 0>db()?i&&(document.prerendering||pb()>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}},mb=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){}},yb=t=>{var e=!1;return()=>{e||(t(),e=!0)}},bb=-1,_b=new Set,wb=()=>"hidden"!==document.visibilityState||document.prerendering?1/0:0,kb=t=>{if("hidden"===document.visibilityState){if("visibilitychange"===t.type)for(var e of _b)e();isFinite(bb)||(bb="visibilitychange"===t.type?t.timeStamp:0,removeEventListener("prerenderingchange",kb,!0))}},Sb=()=>{if(0>bb){var t,e=pb(),i=document.prerendering||null==(t=globalThis.performance.getEntriesByType("visibility-state").find((t=>"hidden"===t.name&&t.startTime>=e)))?void 0:t.startTime;bb=null!=i?i:wb(),addEventListener("visibilitychange",kb,!0),addEventListener("prerenderingchange",kb,!0),vb((()=>{setTimeout((()=>{bb=wb()}))}))}return{get firstHiddenTime(){return bb},onHidden(t){_b.add(t)}}},xb=t=>{document.prerendering?addEventListener("prerenderingchange",t,!0):t()},Cb=[1800,3e3],Tb=function(t,e){void 0===e&&(e={}),xb((()=>{var i,r=Sb(),n=gb("FCP"),s=mb("paint",(t=>{for(var e of t)"first-contentful-paint"===e.name&&(s.disconnect(),r.firstHiddenTime>e.startTime&&(n.value=Math.max(e.startTime-pb(),0),n.entries.push(e),i(!0)))}));s&&(i=cb(t,n,Cb,e.reportAllChanges),vb((r=>{n=gb("FCP"),i=cb(t,n,Cb,e.reportAllChanges),fb((()=>{n.value=performance.now()-r.timeStamp,i(!0)}))})))}))},Mb=[.1,.25],Eb=t=>t.find((t=>{var e;return 1===(null==(e=t.node)?void 0:e.nodeType)}))||t[0],Ib=0,Rb=1/0,Pb=0,Ab=t=>{for(var e of t)e.interactionId&&(Rb=Math.min(Rb,e.interactionId),Pb=Math.max(Pb,e.interactionId),Ib=Pb?(Pb-Rb)/7+1:0)},Fb=()=>{var t;return ub?Ib:null!==(t=performance.interactionCount)&&void 0!==t?t:0},Ob=0;let Lb=class{constructor(){this.l=[],this.h=new Map,this.m=void 0,this.p=void 0}v(){Ob=Fb(),this.l.length=0,this.h.clear()}M(){var t=Math.min(this.l.length-1,Math.floor((Fb()-Ob)/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 a of s)this.h.delete(a.id)}null==(n=this.p)||n.call(this,r)}}}};var Db=t=>{var e=globalThis.requestIdleCallback||setTimeout,i=globalThis.cancelIdleCallback||clearTimeout;if("hidden"===document.visibilityState)t();else{var r=yb(t),n=-1,s=()=>{i(n),r()};addEventListener("visibilitychange",s,{once:!0,capture:!0}),n=e((()=>{removeEventListener("visibilitychange",s,{capture:!0}),r()}))}},$b=[200,500];let Nb=class{constructor(){this.m=void 0}u(t){var e;null==(e=this.m)||e.call(this,t)}};var $=[2500,4e3],qb=-1,jb=t=>{addEventListener("pageshow",(e=>{e.persisted&&(qb=e.timeStamp,t(e))}),!0)},Bb=(t,e,i,r)=>{var n,s;return a=>{e.value>=0&&(a||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))}},Hb=t=>{requestAnimationFrame((()=>requestAnimationFrame(t)))},zb=()=>{var t=performance.getEntriesByType("navigation")[0];if(t&&t.responseStart>0&&t.responseStart<performance.now())return t},Ub=()=>{var t,e;return null!==(t=null==(e=zb())?void 0:e.activationStart)&&void 0!==t?t:0},Wb=function(t,e){void 0===e&&(e=-1);var i=zb(),r="navigate";return 0>qb?i&&(document.prerendering||Ub()>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}},Vb=new WeakMap;function Gb(t,e){var i=Vb.get(e);return i||(i=new WeakMap,Vb.set(e,i)),i.get(t)||i.set(t,new e),i.get(t)}class Zb{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 Qb,Jb=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){}},Kb=t=>{var e=!1;return()=>{e||(t(),e=!0)}},Yb=-1,Xb=new Set,t_=()=>"hidden"!==document.visibilityState||document.prerendering?1/0:0,e_=t=>{if("hidden"===document.visibilityState){if("visibilitychange"===t.type)for(var e of Xb)e();isFinite(Yb)||(Yb="visibilitychange"===t.type?t.timeStamp:0,removeEventListener("prerenderingchange",e_,!0))}},i_=()=>{if(0>Yb){var t,e=Ub(),i=document.prerendering||null==(t=globalThis.performance.getEntriesByType("visibility-state").find((t=>"hidden"===t.name&&t.startTime>=e)))?void 0:t.startTime;Yb=null!=i?i:t_(),addEventListener("visibilitychange",e_,!0),addEventListener("prerenderingchange",e_,!0),jb((()=>{setTimeout((()=>{Yb=t_()}))}))}return{get firstHiddenTime(){return Yb},onHidden(t){Xb.add(t)}}},r_=t=>{document.prerendering?addEventListener("prerenderingchange",t,!0):t()},n_=[1800,3e3],s_=function(t,e){void 0===e&&(e={}),r_((()=>{var i,r=i_(),n=Wb("FCP"),s=Jb("paint",(t=>{for(var e of t)"first-contentful-paint"===e.name&&(s.disconnect(),r.firstHiddenTime>e.startTime&&(n.value=Math.max(e.startTime-Ub(),0),n.entries.push(e),i(!0)))}));s&&(i=Bb(t,n,n_,e.reportAllChanges),jb((r=>{n=Wb("FCP"),i=Bb(t,n,n_,e.reportAllChanges),Hb((()=>{n.value=performance.now()-r.timeStamp,i(!0)}))})))}))},a_=[.1,.25],o_=function(t,e){void 0===e&&(e={});var i=i_();s_(Kb((()=>{var r,n=Wb("CLS",0),s=Gb(e,Zb),a=t=>{for(var e of t)s.h(e);s.i>n.value&&(n.value=s.i,n.entries=s.o,r())},o=Jb("layout-shift",a);o&&(r=Bb(t,n,a_,e.reportAllChanges),i.onHidden((()=>{a(o.takeRecords()),r(!0)})),jb((()=>{s.i=0,n=Wb("CLS",0),r=Bb(t,n,a_,e.reportAllChanges),Hb(r)})),setTimeout(r))})))},l_=0,u_=1/0,h_=0,d_=t=>{for(var e of t)e.interactionId&&(u_=Math.min(u_,e.interactionId),h_=Math.max(h_,e.interactionId),l_=h_?(h_-u_)/7+1:0)},v_=()=>{var t;return Qb?l_:null!==(t=performance.interactionCount)&&void 0!==t?t:0},c_=0;class f_{constructor(){this.l=[],this.u=new Map,this.m=void 0,this.p=void 0}v(){c_=v_(),this.l.length=0,this.u.clear()}T(){var t=Math.min(this.l.length-1,Math.floor((v_()-c_)/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 a of s)this.u.delete(a.id)}null==(n=this.p)||n.call(this,r)}}}}var p_=t=>{var e=globalThis.requestIdleCallback||setTimeout,i=globalThis.cancelIdleCallback||clearTimeout;if("hidden"===document.visibilityState)t();else{var r=Kb(t),n=-1,s=()=>{i(n),r()};addEventListener("visibilitychange",s,{once:!0,capture:!0}),n=e((()=>{removeEventListener("visibilitychange",s,{capture:!0}),r()}))}},g_=[200,500],m_=function(t,e){if(void 0===e&&(e={}),globalThis.PerformanceEventTiming&&"interactionId"in PerformanceEventTiming.prototype){var i=i_();r_((()=>{var r;"interactionCount"in performance||Qb||(Qb=Jb("event",d_,{durationThreshold:0}));var n,s=Wb("INP"),a=Gb(e,f_),o=t=>{p_((()=>{for(var e of t)a.h(e);var i=a.T();i&&i.L!==s.value&&(s.value=i.L,s.entries=i.entries,n())}))},l=Jb("event",o,{durationThreshold:null!==(r=e.durationThreshold)&&void 0!==r?r:40});n=Bb(t,s,g_,e.reportAllChanges),l&&(l.observe({type:"first-input",buffered:!0}),i.onHidden((()=>{o(l.takeRecords()),n(!0)})),jb((()=>{a.v(),s=Wb("INP"),n=Bb(t,s,g_,e.reportAllChanges)})))}))}};class y_{constructor(){this.m=void 0}h(t){var e;null==(e=this.m)||e.call(this,t)}}var b_=[2500,4e3],__=function(t,e){void 0===e&&(e={}),r_((()=>{var i,r=i_(),n=Wb("LCP"),s=Gb(e,y_),a=t=>{for(var a of(e.reportAllChanges||(t=t.slice(-1)),t))s.h(a),r.firstHiddenTime>a.startTime&&(n.value=Math.max(a.startTime-Ub(),0),n.entries=[a],i())},o=Jb("largest-contentful-paint",a);if(o){i=Bb(t,n,b_,e.reportAllChanges);var l=Kb((()=>{a(o.takeRecords()),o.disconnect(),i(!0)})),u=t=>{t.isTrusted&&(p_(l),removeEventListener(t.type,u,{capture:!0}))};for(var h of["keydown","click","visibilitychange"])addEventListener(h,u,{capture:!0});jb((r=>{n=Wb("LCP"),i=Bb(t,n,b_,e.reportAllChanges),Hb((()=>{n.value=performance.now()-r.timeStamp,i(!0)}))}))}}))},w_={onLCP(t,e){void 0===e&&(e={});var i=lb(e=Object.assign({},e),Nb),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:ab(i);r.set(t,s)}else t.id&&r.set(t,"#"+t.id)},function(t,e){void 0===e&&(e={}),xb((()=>{var i,r=Sb(),n=gb("LCP"),s=lb(e,Nb),a=t=>{for(var a of(e.reportAllChanges||(t=t.slice(-1)),t))s.u(a),r.firstHiddenTime>a.startTime&&(n.value=Math.max(a.startTime-pb(),0),n.entries=[a],i())},o=mb("largest-contentful-paint",a);if(o){i=cb(t,n,$,e.reportAllChanges);var l=yb((()=>{a(o.takeRecords()),o.disconnect(),i(!0)})),u=t=>{t.isTrusted&&(Db(l),removeEventListener(t.type,u,{capture:!0}))};for(var h of["keydown","click","visibilitychange"])addEventListener(h,u,{capture:!0});vb((r=>{n=gb("LCP"),i=cb(t,n,$,e.reportAllChanges),fb((()=>{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=rb();if(s){var a=s.activationStart||0,o=Math.max(0,s.responseStart-a),l=Math.max(o,n?(n.requestStart||n.startTime)-a:0),u=Math.min(t.value,Math.max(l,n?n.responseEnd-a:0));e=p({},e,{timeToFirstByte:o,resourceLoadDelay:l-o,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=lb(e=Object.assign({},e),ib),r=new WeakMap;i.t=t=>{var i;if(null!=t&&null!=(i=t.sources)&&i.length){var n=Eb(t.sources),s=null==n?void 0:n.node;if(s){var a,o=null!==(a=null==e.generateTarget?void 0:e.generateTarget(s))&&void 0!==a?a:ab(s);r.set(n,o)}}},function(t,e){void 0===e&&(e={});var i=Sb();Tb(yb((()=>{var r,n=gb("CLS",0),s=lb(e,ib),a=t=>{for(var e of t)s.u(e);s.o>n.value&&(n.value=s.o,n.entries=s.i,r())},o=mb("layout-shift",a);o&&(r=cb(t,n,Mb,e.reportAllChanges),i.onHidden((()=>{a(o.takeRecords()),r(!0)})),vb((()=>{s.o=0,n=gb("CLS",0),r=cb(t,n,Mb,e.reportAllChanges),fb(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=Eb(n.sources);s&&(e={largestShiftTarget:r.get(s),largestShiftTime:n.startTime,largestShiftValue:n.value,largestShiftSource:s,largestShiftEntry:n,loadState:nb(n.startTime)})}}return Object.assign(t,{attribution:e})})(e))}),e)},onFCP(t,e){void 0===e&&(e={}),Tb((e=>{t((t=>{var e={timeToFirstByte:0,firstByteToFCP:t.value,loadState:nb(db())};if(t.entries.length){var i=rb(),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:nb(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=lb(e=Object.assign({},e),Lb),r=[],n=[],s=0,a=new WeakMap,o=new WeakMap,l=!1,u=()=>{l||(Db(h),l=!0)},h=()=>{var t=new Set(i.l.map((t=>a.get(t.entries[0])))),e=n.length-10;n=n.filter(((i,r)=>r>=e||t.has(i)));var o=new Set;for(var u of n){var h=d(u.startTime,u.processingEnd);for(var v of h)o.add(v)}r=r.filter((t=>t.startTime>s||o.has(t))),l=!1};i.m=t=>{var i,r=t.startTime+t.duration;s=Math.max(s,t.processingEnd);for(var o=n.length-1;o>=0;o--){var l=n[o];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)&&a.set(t,i),u()},i.p=t=>{if(!o.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:ab(r);o.set(t,s)}else{var a,l=null==(a=t.entries.find((t=>t.targetSelector)))?void 0:a.targetSelector;l&&o.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};mb("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=Sb();xb((()=>{var r;"interactionCount"in performance||ub||(ub=mb("event",Ab,{durationThreshold:0}));var n,s=gb("INP"),a=lb(e,Lb),o=t=>{Db((()=>{for(var e of t)a.u(e);var i=a.M();i&&i.T!==s.value&&(s.value=i.T,s.entries=i.entries,n())}))},l=mb("event",o,{durationThreshold:null!==(r=e.durationThreshold)&&void 0!==r?r:40});n=cb(t,s,$b,e.reportAllChanges),l&&(l.observe({type:"first-input",buffered:!0}),i.onHidden((()=>{o(l.takeRecords()),n(!0)})),vb((()=>{a.v(),s=gb("INP"),n=cb(t,s,$b,e.reportAllChanges)})))}))}}((e=>{t((t=>{var e=t.entries[0],r=a.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:o.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:nb(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,a=t.processingDuration,o=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;o+=f-p,l+=p,f>h&&(r=n+s>v.startTime?"input-delay":n+s+a>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+a&&(u=t.nextPaintTime-m),i&&r&&(t.longestScript={entry:i,subpart:r,intersectingDuration:h}),t.totalScriptDuration=o,t.totalStyleAndLayoutDuration=l,t.totalPaintDuration=u,t.totalUnattributedDuration=t.nextPaintTime-n-o-l-u}})(c),Object.assign(t,{attribution:c})})(e))}),e)},withoutAttribution:{onLCP:__,onCLS:o_,onFCP:s_,onINP:m_}};v.__PosthogExtensions__=v.__PosthogExtensions__||{},v.__PosthogExtensions__.postHogWebVitalsCallbacksByFlavor=v.__PosthogExtensions__.postHogWebVitalsCallbacksByFlavor||{},v.__PosthogExtensions__.postHogWebVitalsCallbacksByFlavor["web-vitals-with-attribution"]=w_,v.__PosthogExtensions__.postHogWebVitalsCallbacks=w_,v.postHogWebVitalsCallbacks=w_;var k_={onLCP:__,onCLS:o_,onFCP:s_,onINP:m_};v.__PosthogExtensions__=v.__PosthogExtensions__||{},v.__PosthogExtensions__.postHogWebVitalsCallbacksByFlavor=v.__PosthogExtensions__.postHogWebVitalsCallbacksByFlavor||{},v.__PosthogExtensions__.postHogWebVitalsCallbacksByFlavor["web-vitals"]=k_,v.__PosthogExtensions__.postHogWebVitalsCallbacks=k_,v.postHogWebVitalsCallbacks=k_,v.__PosthogExtensions__.loadWebVitalsCallbacks=()=>k_;class S_{constructor(t){this.disabled=!1===t;var e=Q(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 x_="$copy_autocapture",C_=Hi("[AutoCapture]");function T_(t,e){return e.length>t?e.slice(0,t)+"...":e}function M_(t){if(t.previousElementSibling)return t.previousElementSibling;var e=t;do{e=e.previousSibling}while(e&&!gr(e));return e}function E_(e,i){var r,n,s=i.e,a=i.maskAllElementAttributes,o=i.maskAllText,l=i.elementAttributeIgnoreList,u=i.elementsChainAsString,h=i.disableCaptureUrlHashes;if(!gr(e))return{props:{}};for(var d=[e],v=new Set([e]),c=e;c.parentNode&&!mr(c,"body")&&_r>d.length;)if(br(c.parentNode)){var f=c.parentNode.host;if(v.has(f))break;v.add(f),d.push(f),c=f}else{if(!gr(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(Ui(d,(t=>{var e=jr(t);if(mr(t,"a")){var i=t.getAttribute("href");_=!!(e&&i&&Qr(i))&&(h?Te(i):i)}j(Sr(t),"ph-no-capture")&&(w=!0),y.push(function(t,e,i,r,n){void 0===n&&(n=!1);var s=t.tagName.toLowerCase(),a={tag_name:s};Mr.indexOf(s)>-1&&!i&&(a.$el_text="a"===s.toLowerCase()||"button"===s.toLowerCase()?T_(1024,Jr(t)):T_(1024,Cr(t)));var o=Sr(t);o.length>0&&(a.classes=o.filter((function(t){return""!==t}))),Ui(t.attributes,(function(i){var s;if((!Br(t)||-1!==["name","id","class","aria-label"].indexOf(i.name))&&(null==r||!r.includes(i.name))&&!e&&Qr(i.value)&&(!Y(s=i.name)||"_ngcontent"!==s.substring(0,10)&&"_nghost"!==s.substring(0,7))){var o=i.value;"class"===i.name&&(o=wr(o).join(" ")),a["attr__"+i.name]=T_(1024,"href"===i.name&&n?Te(o):o)}}));for(var l=1,u=1,h=t;h=M_(h);)l++,h.tagName===t.tagName&&u++;return a.nth_child=l,a.nth_of_type=u,a}(t,a,o,l,h));var r=function(t){if(!jr(t))return{};var e={};return Ui(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&&Qr(r)&&(e[i]=r)}})),e}(t);Wi(b,r)})),w)return{props:{},explicitNoCapture:w};if(o||(y[0].$el_text=mr(e,"a")||mr(e,"button")?Jr(e):Cr(e)),_){var k,S;y[0].attr__href=_;var x=null==(k=ir(_))?void 0:k.host,C=null==t||null==(S=t.location)?void 0:S.host;x&&C&&x!==C&&(g=_)}return{props:Wi({$event_type:s.type,$ce_version:1},u?{}:{$elements:y},{$elements_chain:(m=y,function(t){var e=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),a={};return Vi(s).sort(((t,e)=>function(t,e){return e>t?-1:t>e?1:0}(t[0],e[0]))).forEach((t=>{var e=t[1];return a[Yr(t[0].toString())]=Yr(e.toString())})),(r+=":")+Vi(a).map((t=>t[0]+'="'+t[1]+'"')).join("")}));return e.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:Xr(t),attr_id:t.attr__id,nth_child:t.nth_child,nth_of_type:t.nth_of_type,attributes:{}};return Vi(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}:{},b)}}class I_{constructor(t){this.name="autocapture",this.ys=!1,this.bs=null,this._s=!1,this.ws=!1,this.nn={enabled:!1,rageclick:!1,maskAllElementAttributes:!1,maskAllText:!1,disableCaptureUrlHashes:!1,remoteRequestsDisabled:!1},this.ks=!1,this.Ss=t,this.Ss.refresh(this.nn),this.rageclicks=new S_(this.nn.rageclick),this.xs=null}setup(t){this.Cs(),this.Ts=t;var e=t.onRemoteConfig(this.onRemoteConfig.bind(this));this.ks?e.dispose():(this.Ms=e,this.startIfEnabled())}dispose(){var t;this.ks||(this.ks=!0,this.Ts=void 0,null==(t=this.Ms)||t.dispose(),this.Ms=void 0,this.Es())}Is(){return this.Ss.refresh(this.nn),this.nn}Cs(){var t,e;return this.Is(),this.nn.url_allowlist=null==(t=this.nn.url_allowlist)?void 0:t.map((t=>new RegExp(t))),this.nn.url_ignorelist=null==(e=this.nn.url_ignorelist)?void 0:e.map((t=>new RegExp(t))),this.nn}Rs(){if(this.isBrowserSupported()){if(t&&r){var e=this.Ps=e=>{e=e||(null==t?void 0:t.event);try{this.As(e)}catch(t){C_.error("Failed to capture event",t)}};if(Yi(r,"submit",e,{capture:!0}),Yi(r,"change",e,{capture:!0}),Yi(r,"click",e,{capture:!0}),this.Is().capture_copied_text){var i=this.Fs=e=>{e=e||(null==t?void 0:t.event);try{this.As(e,x_)}catch(t){C_.error("Failed to capture clipboard event",t)}};Yi(r,"copy",i,{capture:!0}),Yi(r,"cut",i,{capture:!0}),Yi(r,"paste",i,{capture:!0})}}}else C_.info("Disabling Automatic Event Collection because this browser is not supported")}Es(){this.Ps&&(null==r||r.removeEventListener("submit",this.Ps,!0),null==r||r.removeEventListener("change",this.Ps,!0),null==r||r.removeEventListener("click",this.Ps,!0),this.Ps=void 0),this.Fs&&(null==r||r.removeEventListener("copy",this.Fs,!0),null==r||r.removeEventListener("cut",this.Fs,!0),null==r||r.removeEventListener("paste",this.Fs,!0),this.Fs=void 0),this.ys=!1}startIfEnabled(){!this.ks&&this.Ts&&this.isEnabled&&!this.ys&&(this.Rs(),this.ys=!0)}onRemoteConfig(t){if(!this.ks)if(this._s=!0,t.ok){var e=t.config;e.elementsChainAsString&&(this.ws=e.elementsChainAsString);var i,r=e.autocapture_opt_out;nt(r)&&(null==(i=this.Ts)||i.kv.set(_n,r),this.bs=r),this.startIfEnabled()}else this.startIfEnabled()}setElementSelectors(t){this.xs=t}getElementSelectors(t){var e,i=[];return null==(e=this.xs)||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.ks)return!1;var i=null==(t=this.Ts)?void 0:t.kv.get(_n),r=this.bs,n=this.Is(),s=n.remoteRequestsDisabled&&!this._s;if(tt(r)&&!nt(i)&&!s)return!1;var a=null!==(e=this.bs)&&void 0!==e?e:!!i;return!!n.enabled&&!a}As(e,i){if(void 0===i&&(i="$autocapture"),this.isEnabled){var r=Tr(e);yr(r)&&(r=r.parentNode||null);var n,s=this.Cs();"$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.As(e,"$rageclick");var a=i===x_,o=a?p({},s,{dom_event_allowlist:void 0}):s;if(r&&function(e,i,r,n,s,a){var o;if(!t||Nr(e))return!1;if(null!=r&&r.url_allowlist&&!kr(r.url_allowlist,a))return!1;if(null!=r&&r.url_ignorelist&&kr(r.url_ignorelist,a))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=qr(e,n),h=u.parentIsUsefulElement,d=u.targetElementList;if(!function(t,e){var i=null==e?void 0:e.element_allowlist;if(K(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!==(o=null==r?void 0:r.css_selector_ignorelist)&&void 0!==o?o:Rr))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&&(Mr.indexOf(c)>-1||"true"===e.getAttribute("contenteditable"))}}(r,e,o,a,a?["copy","cut","paste"]:void 0,{config:{get_current_url:s.getCurrentUrl}})){var l,u=E_(r,{e:e,maskAllElementAttributes:s.maskAllElementAttributes,maskAllText:s.maskAllText,elementAttributeIgnoreList:s.element_attribute_ignorelist,elementsChainAsString:this.ws,disableCaptureUrlHashes:s.disableCaptureUrlHashes}),h=u.props;if(u.explicitNoCapture)return!1;var d=this.getElementSelectors(r);if(d&&d.length>0&&(h.$element_selectors=d),i===x_){var v=e.type||"clipboard";if("paste"!==v){var c,f,g=null==t||null==(c=t.getSelection())?void 0:c.toString(),m=xr(g);if(!m)return!1;h.$selected_content=m,h.$clipboard_text_length=null!==(f=null==g?void 0:g.length)&&void 0!==f?f:0}h.$copy_type=v}return null==(l=this.Ts)||l.capture(i,h).catch((t=>C_.error("Failed to capture event",t))),!0}}}isBrowserSupported(){return Z(null==r?void 0:r.querySelectorAll)}}var R_={};function P_(e,i){var r=R_[e];if(r)return r;var n=i[e];if((t=>Z(t)&&-1!==t.toString().indexOf("[native code]"))(n)&&(null==t||!t.Zone))return R_[e]=n.bind(i);var s=i.document;if(s&&Z(s.createElement)){var a,o=!1;try{(a=s.createElement("iframe")).hidden=!0,s.head.appendChild(a);var l,u,h=a.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:"")&&(a.classList.add("rr-block","ph-no-capture"),o=!0))}catch(t){Bi.warn("Could not create sandbox iframe for "+e+" check, bailing to assignableWindow."+e+": ",t)}finally{var d;!o&&null!=(d=a)&&d.parentNode&&a.parentNode.removeChild(a)}}return n&&Z(n)?R_[e]=n.bind(i):n}function A_(t,e){var i=Tr(t);return i?p({node:i,originalEvent:t,timestamp:Date.now()},e):null}function F_(t,e){return Math.abs(t)<Math.abs(e)?0>e?"up":"down":0>t?"left":"right"}function O_(t){return"swipe"===t.type?"$dead_swipe":"$dead_click"}var L_="canvas,video,audio,embed,object",D_=1e3;function $_(t,e){return it(t)&&t>=e}function N_(t){return t>=0&&D_>t?t:void 0}function q_(t,e){return e?N_(t-e):void 0}class j_{Fi(t){var e,i,r,n,s,a,o,l,u=this.Ni((null==t?void 0:t.__onCapture)||this.qi.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!==(a=null==t?void 0:t.capture_dead_swipes)&&void 0!==a?a:u.capture_dead_swipes,swipe_threshold_px:null!==(o=null==t?void 0:t.swipe_threshold_px)&&void 0!==o?o: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.ji=[],this.Bi=0,this.Ni=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.Hi=t=>{var e=A_(t,{type:"click"});tt(e)||this.$i(e)||this.Ui(e),this.Wi()},this.zi=()=>{var t=Date.now();this.Vi=t,t%50==0&&this.ji.forEach((e=>{K(e.scrollDelayMs)&&(e.scrollDelayMs=t-e.timestamp)}))},this.Zi=()=>{this.Gi=Date.now()},this.$t=()=>{var t=Date.now();this.Qi=t,this.Ji("visibilityChangedDelayMs",t)},this.Yi=()=>{var t=Date.now();this.Ki=t,this.Ji("focusChangedDelayMs",t)},this.Xi=t=>{var e=t.touches,i=1===(null==e?void 0:e.length)?e[0]:void 0;this.en=i?{x:i.clientX,y:i.clientY,timestamp:Date.now()}:void 0},this.tn=()=>{this.en=void 0},this.rn=t=>{var e,i=this.en;if(this.en=void 0,!K(i)&&this.nn.max_dead_swipes_per_page_load>this.Bi){var n=t,s=null==(e=n.changedTouches)?void 0:e[0];if(s){var a=s.clientX-i.x,o=s.clientY-i.y,l=a*a+o*o,u=this.nn.swipe_threshold_px;if(l>=u*u&&![this.Vi,this.an,this.Gi].some((t=>it(t)&&t>=i.timestamp))){var h;if(this.sn()&&(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(L_))))return;var d=A_(n,{type:"swipe",swipeDirection:F_(a,o),swipeDistancePx:Math.round(Math.sqrt(l))});tt(d)||this.$i(d)||this.Ui(d),this.Wi()}}}},this.instance=t,this.nn=this.Fi(e),this._onCapture=this.nn.__onCapture}start(t){this.un(),this.ln(),this.hn(),this.cn(),this.dn(),this.vn(t),this.nn.capture_dead_swipes&&this.fn()}vn(t){if(!this.pn){var e=function(t){return P_("MutationObserver",t)}(v);this.pn=new e((t=>{this.gn(t)})),this.pn.observe(t,{attributes:!0,characterData:!0,childList:!0,subtree:!0})}}stop(){var t;null==(t=this.pn)||t.disconnect(),this.pn=void 0,v.removeEventListener("click",this.Hi),v.removeEventListener("scroll",this.zi,{capture:!0}),v.removeEventListener("selectionchange",this.Zi),v.removeEventListener("touchstart",this.Xi,{capture:!0}),v.removeEventListener("touchend",this.rn,{capture:!0}),v.removeEventListener("touchcancel",this.tn,{capture:!0}),null==r||r.removeEventListener("visibilitychange",this.$t),v.removeEventListener("blur",this.Yi),v.removeEventListener("focus",this.Yi),this.en=void 0}gn(t){this.an=Date.now()}un(){Yi(v,"click",this.Hi)}Ui(t){t.visibilityChangedDelayMs=q_(t.timestamp,this.Qi),t.focusChangedDelayMs=q_(t.timestamp,this.Ki),this.ji.push(t)}Wi(){this.ji.length&&K(this.mn)&&(this.mn=v.setTimeout((()=>{this.yn()}),1e3))}ln(){Yi(v,"scroll",this.zi,{capture:!0})}hn(){Yi(v,"selectionchange",this.Zi)}cn(){Yi(r,"visibilitychange",this.$t)}dn(){Yi(v,"blur",this.Yi),Yi(v,"focus",this.Yi)}Ji(t,e){this.ji.forEach((i=>{var r=N_(e-i.timestamp);it(r)&&(K(i[t])||i[t]>r)&&(i[t]=r)}))}fn(){Yi(v,"touchstart",this.Xi,{capture:!0,passive:!0}),Yi(v,"touchend",this.rn,{capture:!0,passive:!0}),Yi(v,"touchcancel",this.tn,{capture:!0,passive:!0})}sn(){var t=K(this.bn)||it(this.an)&&this.an>this.bn;return(K(this.wn)||t)&&(this.bn=Date.now(),this.wn=!(null==r||!r.querySelector(L_))),!!this.wn}$i(t){return!t||("swipe"===t.type?this.kn(t):this._n(t))}kn(e){if(pr(e.node))return!0;var i=this.ji.some((t=>t.type===e.type&&t.node===e.node&&1e3>Math.abs(t.timestamp-e.timestamp)));return!(!i&&!mr(e.node,"html")&&gr(e.node)&&function(e,i){var r;if(!t||Nr(e))return!1;var n=nt(i)?Or:null!==(r=null==i?void 0:i.css_selector_ignorelist)&&void 0!==r?r:Or;return!Er(qr(e,!1).targetElementList,n)}(e.node,{css_selector_ignorelist:this.nn.css_selector_ignorelist}))}_n(e){return!(this.nn.capture_clicks_with_modifier_keys||(i=e.originalEvent,!(i.ctrlKey||i.metaKey||i.altKey||i.shiftKey)))||!!this.kn(e)||(r=e.node,!(!t||Nr(r))&&qr(r,!1).targetElementList.some((t=>mr(t,"a"))));var i,r}yn(){if(this.ji.length){clearTimeout(this.mn),this.mn=void 0;var t=this.ji;for(var e of(this.ji=[],t)){var i;e.mutationDelayMs=null!==(i=e.mutationDelayMs)&&void 0!==i?i:this.an&&this.an>=e.timestamp?this.an-e.timestamp:void 0,e.absoluteDelayMs=Date.now()-e.timestamp,e.selectionChangedDelayMs=this.Gi&&this.Gi>=e.timestamp?this.Gi-e.timestamp:void 0;var r=$_(e.scrollDelayMs,this.nn.scroll_threshold_ms),n=$_(e.selectionChangedDelayMs,this.nn.selection_change_threshold_ms),s=$_(e.mutationDelayMs,this.nn.mutation_threshold_ms),a=$_(e.absoluteDelayMs,1.1*this.nn.mutation_threshold_ms),o=it(e.scrollDelayMs)&&this.nn.scroll_threshold_ms>e.scrollDelayMs,l=it(e.mutationDelayMs)&&this.nn.mutation_threshold_ms>e.mutationDelayMs,u=it(e.selectionChangedDelayMs)&&this.nn.selection_change_threshold_ms>e.selectionChangedDelayMs,h=it(e.visibilityChangedDelayMs),d=it(e.focusChangedDelayMs);if(!(o||l||u||h||d))if(r||s||a||n){var v=O_(e);if("$dead_swipe"===v){if(this.Bi>=this.nn.max_dead_swipes_per_page_load)continue;this.Bi++}this._onCapture(e,{[v+"_last_mutation_timestamp"]:this.an,[v+"_event_timestamp"]:e.timestamp,[v+"_scroll_timeout"]:r,[v+"_mutation_timeout"]:s,[v+"_absolute_timeout"]:a,[v+"_selection_changed_timeout"]:n,[v+"_visibility_changed_timeout"]:!1})}else this.nn.mutation_threshold_ms>e.absoluteDelayMs&&this.ji.push(e)}this.Wi()}}qi(t,e){var i=O_(t);this.instance.capture(i,p({},e,E_(t.node,{e:t.originalEvent,maskAllElementAttributes:this.instance.config.mask_all_element_attributes,maskAllText:this.instance.config.mask_all_text,elementAttributeIgnoreList:this.nn.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 j_(t,e);var B_=Hi("[ExternalScriptsLoader]"),H_=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]},z_=(t,e,i)=>{if(t.config.disable_external_dependency_loading)return B_.warn(e+" was requested but loading of external scripts is disabled."),i("Loading of external scripts is disabled");var n=H_(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 a=()=>{if(!r)return i("document not found");if(H_(e))return z_(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,a=r.querySelectorAll("body > script");a.length>0?null==(s=a[0].parentNode)||s.insertBefore(n,a[0]):r.body.appendChild(n)}};null!=r&&r.body?a():null==r||r.addEventListener("DOMContentLoaded",a)},U_={},W_=(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=U_[n];if("fallback"===r&&s){if(H_(s))return void z_(t,s,i);delete U_[n]}z_(t,n,"fallback"===r?(r,s)=>{if(r)if("string"==typeof r)i(r);else{var a,o=W_(t,e);U_[n]=o;var l=H_(n);null==l||null==(a=l.parentNode)||a.removeChild(l),z_(t,o,i)}else i(void 0,s)}:i)}else z_(t,W_(t,e),i)}else{var a=t.requestRouter.endpointFor("assets","/array/"+t.config.token+"/config.js");z_(t,a,i)}},v.__PosthogExtensions__.loadSiteApp=(t,e,i)=>{var r=t.requestRouter.endpointFor("api",e);z_(t,r,i)};class V_{constructor(t){this._instance=t}get nn(){return this._instance.config}get consent(){return this.Os()?0:this.Ls}isOptedOut(){return this.nn.cookieless_mode===Ds||this.isRejected()||-1===this.consent&&this.nn.cookieless_mode===Ls}isOptedIn(){return!this.isOptedOut()}isExplicitlyOptedOut(){return 0===this.consent}isRejected(){return 0===this.consent||-1===this.consent&&this.nn.opt_out_capturing_by_default}optInOut(t){this.Ds.ei(this.$s,t?1:0,this.nn.cookie_expiration,this.nn.cross_subdomain_cookie,this.nn.secure_cookie)}reset(){this.Ds.ri(this.$s,this.nn.cross_subdomain_cookie)}get $s(){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 Ls(){var t=this.Ds.ti(this.$s);return ft(t)?1:j(pt,t)?0:-1}get Ds(){var t=this.nn.opt_out_capturing_persistence_type,e="localStorage"===t?hp:lp;if(!this.Ns||this.Ns!==e){this.Ns=e;var i="localStorage"===t?lp:hp;i.ti(this.$s)&&(this.Ns.ti(this.$s)||this.optInOut(ft(i.ti(this.$s))),i.ri(this.$s,this.nn.cross_subdomain_cookie))}return this.Ns}Os(){return!!this.nn.respect_dnt&&[null==i?void 0:i.doNotTrack,null==i?void 0:i.msDoNotTrack,v.doNotTrack].some((t=>ft(t)))}}var G_=Hi("[Dead Clicks]"),Z_=()=>!0,Q_=t=>{var e,i=!(null==(e=t.instance.persistence)||!e.get_property(Tn)),r=t.instance.config.capture_dead_clicks;return nt(r)?r:!!Q(r)||i};class J_{get lazyLoadedDeadClicksAutocapture(){return this.qs}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({[Tn]:e.captureDeadClicks}),this.startIfEnabledOrStop())}}startIfEnabledOrStop(){this.isEnabled(this)?this.js((()=>{this.Bs()})):this.stop()}js(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?G_.error("failed to load script",e):t()}))}Bs(){var t;if(r){if(!this.qs&&null!=(t=v.__PosthogExtensions__)&&t.initDeadClicksAutocapture){var e=Q(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.qs=v.__PosthogExtensions__.initDeadClicksAutocapture(this.instance,e),this.qs.start(r),G_.info("starting...")}}else G_.error("`document` not found. Cannot start.")}stop(){this.qs&&(this.qs.stop(),this.qs=void 0,G_.info("stopping..."))}}var K_=Hi("[SegmentIntegration]");var Y_="posthog-js";function X_(t,e){var i=void 0===e?{}:e,r=i.organization,n=i.projectId,s=i.prefix,a=i.severityAllowList,o=void 0===a?["error"]:a,l=i.sendExceptionsToPostHog,u=void 0===l||l;return e=>{var i,a,l,h,d;if("*"!==o&&!o.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==(a=f[0])?void 0:a.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 tw{constructor(t,e,i,r,n,s){this.name=Y_,this.setupOnce=function(a){a(X_(t,{organization:e,projectId:i,prefix:r,severityAllowList:n,sendExceptionsToPostHog:null==s||s}))}}}class ew{constructor(t){this.Hs=(t,e,i)=>{i&&(i.noSessionId||i.activityTimeout||i.sessionPastMaximumLength||i.crossTabAdoption)&&(Bi.info("[PageViewManager] Session rotated, clearing pageview state",{sessionId:t,changeReason:i}),this.zs=void 0,this._instance.scrollManager.resetContext())},this._instance=t,this.Us()}Us(){var t;this.Ws=null==(t=this._instance.sessionManager)?void 0:t.onSessionId(this.Hs)}destroy(){var t;null==(t=this.Ws)||t.call(this),this.Ws=void 0}doPageView(e,i){var r,n=this.Vs(e,i);return this.zs={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.Vs(t,null==(e=this.zs)?void 0:e.pageViewId)}doEvent(){var t;return{$pageview_id:null==(t=this.zs)?void 0:t.pageViewId}}Vs(t,e){var i=this.zs;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,a=n.lastScrollY,o=n.maxScrollY,l=n.maxContentHeight,u=n.lastContentY,h=n.maxContentY;if(!(K(s)||K(a)||K(o)||K(l)||K(u)||K(h))){s=Math.ceil(s),a=Math.ceil(a),o=Math.ceil(o),l=Math.ceil(l),u=Math.ceil(u),h=Math.ceil(h);var d=s>1?gt(a/s,0,1,Bi):1,v=s>1?gt(o/s,0,1,Bi):1,c=l>1?gt(u/l,0,1,Bi):1,f=l>1?gt(h/l,0,1,Bi):1;r=Wi(r,{$prev_pageview_last_scroll:a,$prev_pageview_last_scroll_percentage:d,$prev_pageview_max_scroll:o,$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 iw=["flags","surveys"],rw={[fn]:{exposure:"hidden"},[yn]:{exposure:"hidden"},__cmpns:{exposure:"hidden"},[bn]:{exposure:"hidden"},[_n]:{exposure:"event"},[wn]:{exposure:"hidden"},[En]:{exposure:"hidden"},[kn]:{exposure:"event"},[Sn]:{exposure:"hidden"},[xn]:{exposure:"event"},[Cn]:{exposure:"event"},[Tn]:{exposure:"event"},[Mn]:{exposure:"hidden"},[In]:{exposure:"event"},[Rn]:{exposure:"hidden"},$session_recording_enabled_server_side:{exposure:"hidden"},[Dn]:{exposure:"hidden"},[$n]:{exposure:"event"},[Pn]:{exposure:"event",shouldSkipFromEventProperties:t=>tt(t)},[Nn]:{exposure:"event"},[qn]:{exposure:"event"},[jn]:{exposure:"event"},[Un]:{exposure:"event"},[Wn]:{exposure:"hidden"},[Vn]:{exposure:"hidden",storageGroup:"flags"},[Gn]:{exposure:"hidden",storageGroup:"flags"},[Zn]:{exposure:"hidden"},[Qn]:{exposure:"hidden",storageGroup:"flags"},[Jn]:{exposure:"hidden",storageGroup:"flags"},[Kn]:{exposure:"hidden",storageGroup:"flags",volatile:!0},[Yn]:{exposure:"hidden",storageGroup:"flags"},[Xn]:{exposure:"hidden"},[ts]:{exposure:"hidden"},[es]:{exposure:"hidden"},[is]:{exposure:"hidden"},[ns]:{exposure:"hidden",storageGroup:"surveys"},[ss]:{exposure:"hidden",storageGroup:"surveys",volatile:!0},[as]:{exposure:"event"},[os]:{exposure:"hidden"},[ls]:{exposure:"hidden"},[us]:{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"},[hs]:{exposure:"hidden"},[ds]:{exposure:"hidden"},[rs]:{exposure:"event"},[vs]:{exposure:"hidden"},[cs]:{exposure:"hidden",storageGroup:"flags",volatile:!0},[fs]:{exposure:"hidden"},[ps]:{exposure:"hidden"},[gs]:{exposure:"hidden"},[ms]:{exposure:"hidden"},[ys]:{exposure:"hidden"},[bs]:{exposure:"hidden"},[_s]:{exposure:"hidden"},[An]:{exposure:"event"},[Fn]:{exposure:"event"},[On]:{exposure:"event"},[Ln]:{exposure:"event"},[Ss]:{exposure:"event"},[xs]:{exposure:"event"},[Cs]:{exposure:"event"},[Ts]:{exposure:"event"},[Ms]:{exposure:"event"},[Es]:{exposure:"event"},[Is]:{exposure:"event"},[Rs]:{exposure:"event"},[Ps]:{exposure:"event"},[As]:{exposure:"event"},[Fs]:{exposure:"event"}},nw=[[Bn,{exposure:"hidden"}],[Hn,{exposure:"hidden"}],[zn,{exposure:"hidden"}]],sw=t=>{var e=rw[t];if(e)return e;for(var i of nw){var r=i[1];if(0===t.indexOf(i[0]))return r}},aw={flags:cs,surveys:ss},ow=["cookie","localstorage","localstorage+cookie","sessionstorage","memory"],lw=t=>t+"_cookie_identity_change_pending",uw="main",hw=(t,e)=>{Ui(t,((i,r)=>{var n=sw(r);n&&"event"!==n.exposure||{}.hasOwnProperty.call(e,r)||delete t[r]}))};class dw{constructor(e,i,r){if(void 0===r&&(r=!0),this.Gs={},this.Zs=!1,this.Qs=!1,this.Js=!1,this.Ks=!1,this.nn=e,this.Ys=r,this.props={},this.Xs=void 0,this.ta=(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.Ds=this.ea(e),this.Qs=this.ia(e),this.load(),e.debug&&Bi.info("Persistence loaded",e.persistence,p({},this.props)),this.update_config(e,e,i),this.save(),t){var n=()=>this.flush();Yi(t,"beforeunload",n,{capture:!1}),Yi(t,"pagehide",n,{capture:!1})}}ra(){var t,e=null==(t=this.nn)?void 0:t.persistence_save_debounce_ms;return it(e)&&e>0?e:0}na(t){if(this.nn.cookieWinsOnConflict&&"localstorage+cookie"===this.nn.persistence.toLowerCase())if(t)try{var e=gp(t,this.nn.cookie_persisted_properties||[]),i=yp(e,this.nn.cookie_persisted_properties||[]),r=JSON.stringify(e)+"|"+JSON.stringify(i),n=lp.ti(this.ta)||void 0;n&&_p(this.ta,n)===r&&(this.sa=r,this.aa=n)}catch(t){}else try{var s=lp.ti(this.ta)||void 0;this.sa=s?_p(this.ta,s):void 0,this.aa=s}catch(t){}}syncCookieProperties(){return this.oa(this.nn)}oa(t,e){if(void 0===e&&(e=!1),this.la&&!e||this.Ks||!t.cookieWinsOnConflict||"localstorage+cookie"!==t.persistence.toLowerCase())return!1;var i;try{i=lp.ti(this.ta)||void 0}catch(t){}if(!i||i===this.aa)return!1;var r,n=_p(this.ta,i);try{r=pp(JSON.parse(i))}catch(t){return!1}if((lp.ti(this.ta)||void 0)!==i)return!1;this.sa=n,this.aa=i;var s=bp(this.ta,i),a=[...vp,...s.properties],o={};if(Object.keys(r).forEach((t=>{var e=r[t];(K(e)||tt(e)||""===e||t===fs&&e!==$s&&e!==Ns)&&(o[t]=!0,delete r[t])})),J(r))return!1;var l=pn in r||r[fs]===$s||r[fs]===Ns,u=this.props[pn],h=this.props[fs],d=Wi({},this.props);[...vp,...t.cookie_persisted_properties||[]].forEach((t=>{if(-1!==a.indexOf(t)&&!(t in r)&&!o[t]&&(l||t!==pn&&t!==fs)){var e=d[t];!s.isValid&&-1!==vp.indexOf(t)&&(!1===e||0===e)||delete d[t]}})),this.props=Wi(d,r),!l||fs in r||fs in this.props||this.ua(fs,$s);var v=this.props[pn],c=this.props[fs];return!l||v===u&&c===h||(this.Js=!0,xp.ei(lw(this.ta),!0),this.ha(es),this.ha(Gn),this.ha(Vn),this.ha(Qn),this.ha(Jn),this.ha(Kn),this.ha(cs),this.ha(vs),this.ha(hs),c===$s&&(h===Ns||r[fs]===$s||!K(u)&&v!==u)&&(hw(this.props,r),this.ha(is)),c===Ns?this.props.$user_id=v:delete this.props.$user_id,this.ha(yn)),!0}consumeCookieIdentityChange(){var t=lw(this.ta),e=this.Js||!!xp.ti(t);return this.Js=!1,e&&xp.ri(t),e}da(t){return void 0===t&&(t=!1),!(this.Ks||this.la&&!t||!this.nn.cookieWinsOnConflict||"localstorage+cookie"!==this.nn.persistence.toLowerCase()||(this.Ks=!0,0))}va(){this.Ks&&(K(this.ca)||(clearTimeout(this.ca),this.ca=void 0),delete this.Gs[uw],this.fa(!0))}pa(t){if(void 0===t&&(t=!0),this.Ks)try{t?this.va():K(this.ca)||(clearTimeout(this.ca),this.ca=void 0)}finally{this.Ks=!1}}isDisabled(){return!!this.la}ea(e){-1===ow.indexOf(e.persistence.toLowerCase())&&(Bi.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=[...vp,...e];return p({},hp,{ni(t){try{var e,n={};try{e=lp.ti(t)||void 0,n=e?pp(JSON.parse(e)):{}}catch(t){}var s,a=JSON.parse(hp.ti(t)||"{}");if(i){var o=bp(t,e),l=[...vp,...o.properties],u={};Object.keys(n).forEach((t=>{var e=n[t];tt(e)||""===e||t===fs&&e!==$s&&e!==Ns||(u[t]=e)}));var h=pn in u||u[fs]===$s||u[fs]===Ns;if(Object.keys(u).length>0){var d,v=a[pn],c=null!==(d=a[fs])&&void 0!==d?d:$s;r.forEach((t=>{if(-1!==l.indexOf(t)&&!(t in n)&&(h||t!==pn&&t!==fs)){var e=a[t];!o.isValid&&-1!==vp.indexOf(t)&&(!1===e||0===e)||delete a[t]}})),!h||fs in n||fs in a||(a[fs]=$s),!h||(pn in u?u[pn]:a[pn])===v&&(fs in u?u[fs]:a[fs])===c||(dp.forEach((t=>delete a[t])),u[fs]===Ns&&pn in u?a.$user_id=u[pn]:delete a.$user_id,u[fs]!==Ns&&(delete a[rs],delete a[is]),delete a.__alias)}s=Wi(a,u)}else s=Wi(n,a);return hp.ei(t,s),s}catch(t){}return null},ei(t,r,n,s,a,o){var l=hp.ei(t,r,void 0,void 0,o);try{var u=gp(r,e);if(Object.keys(u).length){if(i){var h=cp(t),d=yp(u,e);if(lp.ei(h,d,n,s,a,o),lp.ti(h)!==JSON.stringify(d)){lp.ri(h,s);var v=gp(r);return lp.ei(t,v,n,s,a,o),l}}lp.ei(t,u,n,s,a,o)}}catch(t){hp.ii(t)}return l},ri(e,i){try{null==t||t.localStorage.removeItem(e),lp.ri(e,i),lp.ri(cp(e),i)}catch(t){hp.ii(t)}}})}(e.cookie_persisted_properties||[],e.cookieWinsOnConflict),n=!1,s=e.persistence.toLowerCase();return"localstorage"===s&&hp.Xr()?(i=hp,n=!0):"localstorage+cookie"===s&&r.Xr()?(i=r,n=!0):"sessionstorage"===s&&xp.Xr()?i=xp:"memory"===s?i=kp:"cookie"===s?i=lp:r.Xr()?(i=r,n=!0):i=lp,this.Zs=n,i}ga(t){return this.ta+"__"+t}ia(t){return this.Zs&&!!t.split_storage}properties(){var t={};return Ui(this.props,((e,i)=>{var r=sw(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.la||t){var e=this.nn.cookieWinsOnConflict&&"localstorage+cookie"===this.nn.persistence.toLowerCase(),i=e?hp.ni(this.ta):null,r={};if(e)try{Ui(r=pp(lp.ni(this.ta)),((t,e)=>{(K(t)||tt(t)||""===t)&&delete r[e]}))}catch(t){}var n=this.Ds.ni(this.ta);if(n&&(this.props=Wi({},n)),this.Qs&&this.ma(),e&&n){var s,a,o=null==i?void 0:i[pn],l=null!==(s=null==i?void 0:i[fs])&&void 0!==s?s:$s,u=n[pn],h=null!==(a=n[fs])&&void 0!==a?a:$s;if(u!==o||h!==l){this.Js=!0,xp.ei(lw(this.ta),!0);var d=Wi({},this.props);dp.forEach((t=>delete d[t])),h===$s&&(l===Ns||r[fs]===$s||!K(o)&&u!==o)&&(hw(d,r),delete d[is]),this.props=d;var v=new Set;dp.forEach((t=>{var e,i=null==(e=sw(t))?void 0:e.storageGroup;i&&v.add(i)})),v.forEach((t=>{var e={};Ui(this.props,((i,r)=>{var n;(null==(n=sw(r))?void 0:n.storageGroup)===t&&(e[r]=i)})),J(e)?(hp.ri(this.ga(t)),this.Gs[t]={}):hp.ei(this.ga(t),e)&&(this.Gs[t]={persisted:!0,fingerprint:this.ya(e,t)})}))}}xp.ti(lw(this.ta))&&(this.Js=!0)}}ma(){for(var t of iw){var e=hp.ni(this.ga(t));if(e&&!J(e)){var i=this.ba(t);i.persisted=!0,this._a(t)||(i.fingerprint=this.ya(e,t)),this.wa(t,e)||Wi(this.props,e)}}}_a(t){return Object.keys(this.props).some((e=>{var i;return(null==(i=sw(e))?void 0:i.storageGroup)===t}))}wa(t,e){var i=aw[t];if(!i)return!1;var r=e[i],n=this.props[i];return it(r)&&it(n)&&n>r}refreshKey(t){var e;if(!this.la){var i=this.Qs?null==(e=sw(t))?void 0:e.storageGroup:void 0,r=i?hp.ni(this.ga(i)):this.Ds.ni(this.ta);if(r&&t in r)this.ua(t,r[t]);else{if(i){var n=this.Ds.ni(this.ta);if(n&&t in n)return void this.ua(t,n[t])}this.ha(t)}}}save(){if(!this.la){var t=this.ra();t>0?K(this.ca)&&(this.ca=setTimeout((()=>{this.ca=void 0,this.fa()}),t)):this.fa()}}flush(){K(this.ca)||(clearTimeout(this.ca),this.ca=void 0,this.fa())}fa(t){void 0===t&&(t=!1),this.la||this.Ks&&!t||(t||this.syncCookieProperties(),this.Qs?this.ka():this.Sa(this.Ds,this.ta,this.props,uw)&&this.na(this.props))}ka(){var t=this.xa(),e=t.main,i=t.groups;for(var r of(this.Sa(this.Ds,this.ta,e,uw)&&this.na(e),iw)){var n,s=i[r];(!J(s)||null!=(n=this.Gs[r])&&n.persisted)&&this.Sa(hp,this.ga(r),s,r)}}xa(){var t={},e={flags:{},surveys:{}};return Ui(this.props,((i,r)=>{var n,s=null==(n=sw(r))?void 0:n.storageGroup;s?e[s][r]=i:t[r]=i})),{main:t,groups:e}}ya(t,e){if(e===uw)return JSON.stringify(t)+"|"+this.Ca+"|"+this.Ta+"|"+this.Ma;var i={};return Ui(t,((t,e)=>{var r;i[e]=null!=(r=sw(e))&&r.volatile?"__volatile__":t})),JSON.stringify(i)}Sa(t,e,i,r){var n,s=this.ba(r);if(r!==uw&&!s.dirty&&!K(s.fingerprint))return!1;try{if((n=this.ya(i,r))===s.fingerprint)return s.dirty=!1,!1}catch(t){n=void 0}return t.ei(e,i,this.Ca,this.Ta,this.Ma,this.nn.debug)?(s.dirty=!1,r!==uw&&(s.persisted=!0),K(n)||(s.fingerprint=n),!0):(this.nn.debug&&Bi.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(K(this.ca)||(clearTimeout(this.ca),this.ca=void 0),this.Ds.ri(this.ta,!1),this.Ds.ri(this.ta,!0),!i&&this.Ys)for(var r of iw)hp.ri(this.ga(r));i?delete this.Gs[uw]:this.Gs={},this.sa=void 0,this.aa=void 0}clear(){this.remove(),this.props={}}register_once(t,e,i){if(Q(t)){this.syncCookieProperties(),K(e)&&(e="None"),this.Ca=K(i)?this.Ea:i;var r=!1;if(Ui(t,((t,i)=>{this.props.hasOwnProperty(i)&&this.props[i]!==e||(this.ua(i,t),r=!0)})),r)return this.save(),!0}return!1}register(t,e){if(Q(t)){this.syncCookieProperties(),this.Ca=K(e)?this.Ea:e;var i=!1;if(Ui(t,((e,r)=>{t.hasOwnProperty(r)&&(this.props[r]!==e||Q(e)||G(e))&&(this.ua(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.ha(r),i=!0);i&&this.save()}update_campaign_params(){var t=null==r?void 0:r.URL;if(t!==this.Xs){var e=jo(this.nn.custom_campaign_params,this.nn.mask_personal_data_properties,this.nn.custom_personal_data_properties);J(Qi(e))||this.register(e),this.Xs=t}}update_search_keyword(){var t;this.register((t=null==r?void 0:r.referrer)?Ho(t):{})}update_referrer_info(){var t;this.register_once({$referrer:Wo(),$referring_domain:null!=r&&r.referrer&&(null==(t=ir(r.referrer))?void 0:t.host)||Uo},void 0)}set_initial_person_info(){this.props[ms]||this.props[ys]||this.register_once({[bs]:Vo(this.nn.mask_personal_data_properties,this.nn.custom_personal_data_properties,this.nn.disable_capture_url_hashes)},void 0)}get_initial_props(){var t={};Ui([ys,ms],(e=>{var i=this.props[e];i&&Ui(i,(function(e,i){t["$initial_"+H(i)]=e}))}));var e=this.props[bs];if(e){var i=function(t,e){void 0===e&&(e=!1);var i=Go(t,e),r={};return Ui(i,(function(t,e){r["$initial_"+H(e)]=t})),r}(e,this.nn.disable_capture_url_hashes);Wi(t,i)}return t}safe_merge(t){return Ui(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,a=t.cookieWinsOnConflict!==e.cookieWinsOnConflict,o=t.disable_persistence||!!i,l=!!this.la&&!o;o||this.oa(e,l),this.nn=t,!o&&(r||n||a)&&(this.sa=void 0,this.aa=void 0,this.oa(p({},t,{cookie_persisted_properties:e.cookie_persisted_properties}),l));var u=s||a?this.ea(t):this.Ds,h=this.ia(t),d=s||h!==this.Qs,v=!o&&(d||t.cross_subdomain_cookie!==this.Ta||t.secure_cookie!==this.Ma)&&this.da(l);try{if(this.Ea=this.Ca=t.cookie_expiration,this.set_disabled(o),this.set_cross_subdomain(t.cross_subdomain_cookie),this.set_secure(t.secure_cookie),d){var c=this.props;this.clear(),this.Ds=u,this.Qs=h,this.props=c,this.save()}else a&&(this.Ds=u,o||(delete this.Gs[uw],this.fa()))}finally{v&&this.pa()}}set_disabled(t){this.la=t,this.la?this.remove():this.save()}set_cross_subdomain(t){t!==this.Ta&&(this.Ta=t,this.remove({keepGroupEntries:!0}),this.save())}set_secure(t){t!==this.Ma&&(this.Ma=t,this.remove({keepGroupEntries:!0}),this.save())}set_event_timer(t,e){var i=this.props[bn]||{};i[t]=e,this.ua(bn,i),this.save()}remove_event_timer(t){var e=this.props[bn]||{},i=e[t];return K(i)||(delete e[t],this.ua(bn,e),this.save()),i}get_property(t){return this.props[t]}set_property(t,e){this.ua(t,e),this.save()}ua(t,e){var i;this.props[t]=e,null!=(i=sw(t))&&i.volatile||this.Ia(t)}ha(t){delete this.props[t],this.Ia(t)}Ia(t){var e,i=null==(e=sw(t))?void 0:e.storageGroup;i&&(this.ba(i).dirty=!0)}ba(t){return this.Gs[t]||(this.Gs[t]={})}}var vw=Hi("[RateLimiter]");class cw{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=>{vw.info((t||"events")+" is quota limited."),this.serverLimits[t]=(new Date).getTime()+6e4}))}catch(t){return void vw.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,a=(new Date).getTime(),o=null!==(e=null==(i=this.instance.persistence)?void 0:i.get_property(gs))&&void 0!==e?e:{tokens:n,last:a};o.tokens+=(a-o.last)/1e3*s,o.last=a,o.tokens>n&&(o.tokens=n);var l=1>o.tokens;if(l||t||(o.tokens=Math.max(0,o.tokens-1)),l&&!t){var u=(it(o.dropped)?o.dropped:0)+1;o.dropped=u,!this.lastEventRateLimited&&this.Ra(u)&&(o.dropped=0)}return this.lastEventRateLimited=l,null==(r=this.instance.persistence)||r.set_property(gs,o),{isRateLimited:l,remainingTokens:o.tokens}}Pa(t){var e=this.instance.config.property_denylist;return!G(e)||!e.includes(t)}Aa(){var t;if(this.Pa("$current_url")&&this.Pa("$pathname")&&null!=n&&n.pathname)return""+(null!==(t=n.origin)&&void 0!==t?t:"")+n.pathname}Ra(t){var e,i,r=this.captureEventsBurstLimit,n=this.captureEventsPerSecond,s=this.Aa(),a=this.Pa("$session_id")?null==(e=(i=this.instance).get_session_id)?void 0:e.call(i):void 0,o=[t+" event(s) dropped since the last warning",s?"triggered on "+s:void 0,a?"session "+a:void 0].filter(Boolean).join(", ");return!!this.instance.capture("$$client_ingestion_warning",{$$client_ingestion_warning_message:"posthog-js client rate limited: "+o+". 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 fw=Hi("[RemoteConfig]");class pw{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}Fa(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()}Oa(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 fw.info("Using preloaded remote config",this.remoteConfig),void this.La(this.remoteConfig);if(this._instance.Da())return void fw.warn("Remote config is disabled. Falling back to local config.");this.Fa((t=>{if(!t)return fw.info("No config found after loading remote JS config. Falling back to JSON."),void this.Oa((t=>{this.La(t.json,t)}));this.La(t)}))}catch(t){fw.error("Error loading remote config",t),this.La()}}La(t,e){!t&&e&&(0===e.statusCode?e.error||fw.warn("Failed to fetch remote config from PostHog."):fw.error("Failed to fetch remote config from PostHog."));try{this._instance.La(t?{ok:!0,config:t}:{ok:!1})}catch(t){fw.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){fw.error("Error loading feature flags",t)}}}var gw=!!a||!!s,mw="text/plain",yw=!1,bw=(t,e)=>{var i=t.split("#"),r=i[1],n=i[0].split("?"),s=n[0],a=n[1];if(!a)return t;var o=a.split("&").filter((t=>t.split("=")[0]!==e)).join("&");return s+(o?"?"+o:"")+(r?"#"+r:"")},_w=function(t,e,i){var r;void 0===i&&(i=!0);var n=t.split("?"),s=n[0],a=n[1],o=p({},e),l=null!==(r=null==a?void 0:a.split("&").map((t=>{var e,r=t.split("="),n=r[0],s=i&&null!==(e=o[n])&&void 0!==e?e:r[1];return delete o[n],n+"="+s})))&&void 0!==r?r:[],u=rr(o);return u&&l.push(u),l.length>0?s+"?"+l.join("&"):s},ww=t=>{if(t.$a)return t.$a;var e=t.data,i=t.compression;if(e){if(i===Mf){var r=no(so(er(e)),{mtime:0});return{contentType:mw,body:r.buffer.slice(r.byteOffset,r.byteOffset+r.byteLength),estimatedSize:r.byteLength}}if(i===Ef){var n=function(t){return t?btoa(encodeURIComponent(t).replace(/%([0-9A-F]{2})/g,((t,e)=>String.fromCharCode(parseInt(e,16))))):t}(er(e)),s=(t=>"data="+encodeURIComponent("string"==typeof t?t:er(t)))(n);return{contentType:"application/x-www-form-urlencoded",body:s,estimatedSize:new Blob([s]).size}}var a=er(e);return{contentType:"application/json",body:a,estimatedSize:new Blob([a]).size}}},kw=t=>{var e,i,r=()=>"sendBeacon"===t.transport?{url:_w(t.url,{compression:Ef}),encodedBody:ww(p({},t,{compression:Ef,$a:void 0}))}:{url:bw(t.url,"compression"),encodedBody:ww(p({},t,{compression:void 0,$a:void 0}))};try{e=ww(t)}catch(e){if(Fe(t.compression,nr(t.url,"compression")))return Bi.error("Failed to gzip request body, sending uncompressed payload",e),r();throw e}return e&&Fe(t.compression,nr(t.url,"compression"))&&!((i=e.body)instanceof ArrayBuffer?Ae(new Uint8Array(i)):ArrayBuffer.isView(i)&&Ae(new Uint8Array(i.buffer,i.byteOffset,i.byteLength)))?(yw=!0,r()):{url:t.url,encodedBody:e}},Sw=t=>{try{return kw(t)}catch(e){return Bi.error(e),void(null==t.callback||t.callback({statusCode:0,error:e}))}},xw=function(){var t=f((function*(t){var e=er(t.data),i=yield Ne(e,qi.DEBUG,{rethrow:!0});if(!i)return t;var r=yield i.arrayBuffer();return p({},t,{$a:{contentType:mw,body:r,estimatedSize:r.byteLength}})}));return function(e){return t.apply(this,arguments)}}(),Cw=/Failed to fetch|NetworkError|Load failed/i,Tw=t=>"TypeError"===(null==t?void 0:t.name)&&Cw.test((null==t?void 0:t.message)||""),Mw=t=>{var e=Sw(t);if(e){var i=e.url,r=e.encodedBody,n=null!=r?r:{},a=n.contentType,l=n.body,u=n.estimatedSize,h=new Headers;Ui(t.headers,(function(t,e){h.append(e,t)})),a&&h.append("Content-Type",a);var d=null,v=!1;if(o){var c=new o;d={signal:c.signal,timeout:setTimeout((()=>{var e;v=!0,c.abort(Ce("AbortError","PostHog request timed out"+((e=t.timeout)?" after "+e+"ms":"")))}),t.timeout)}}var f=e=>{v&&"AbortError"===(null==e?void 0:e.name)||Tw(e)?Bi.warn(e):Bi.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.Na&&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){Bi.error(t)}null==t.callback||t.callback(r)})))).catch(f).finally((()=>d?clearTimeout(d.timeout):null))}catch(t){d&&clearTimeout(d.timeout),f(t)}}},Ew=t=>{try{var e,r=kw(t),n=r.url,s=r.encodedBody,a=null!=s?s:{},o=a.body,l=a.estimatedSize;if(!o)return;var u=o instanceof Blob?o:new Blob([o],{type:a.contentType});if(i.sendBeacon(n,u))return;var h=G(t.data)?t.data:null==(e=t.data)?void 0:e.batch;if(G(h)&&h.length>1&&(null!=l?l:0)>16384){var d=Math.ceil(h.length/2),v=e=>G(t.data)?e:p({},t.data,{batch:e});return Ew(p({},t,{data:v(h.slice(0,d))})),void Ew(p({},t,{data:v(h.slice(d))}))}Bi.warn("Beacon of ~"+(null!=l?l:0)+" bytes was rejected by the browser, falling back to fetch"),Mw(p({},t,{Na:!0}))}catch(t){Bi.warn("Beacon send failed",t)}},Iw=(t,e,i,r)=>{var n="query"===r?"POST"===e?"sent_at":"_":void 0;return _w(i===Mf?bw(t,"compression"):t,p({},n?{[n]:Date.now().toString()}:{},i===Mf?{}:{compression:i}))},Rw=[];s&&Rw.push({transport:"fetch",method:Mw}),a&&Rw.push({transport:"XHR",method(t){var e=Sw(t);if(e){var i=new a,r=e.encodedBody;i.open(t.method||"GET",e.url,!0);var n=null!=r?r:{},s=n.contentType,o=n.body;Ui(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(o)}}}),null!=i&&i.sendBeacon&&Rw.push({transport:"sendBeacon",method:Ew});var Pw=3e3;class Aw{constructor(t,e){this.qa=!0,this.ja=[],this.Ba=gt((null==e?void 0:e.flush_interval_ms)||Pw,250,5e3,Bi.createLogger("flush interval"),Pw),this.Ha=t}enqueue(t){this.ja.push(t),this.za||this.Ua()}unload(){this.Wa();var t=this.ja.length>0?this.Va():{},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.Ga(p({},t,{transport:"sendBeacon"}))}))}enable(){this.qa=!1,this.Ua()}Ua(){var t=this;this.qa||(this.za=setTimeout((()=>{if(this.Wa(),this.ja.length>0){var e=this.Va(),i=function(){var i=e[r],n=(new Date).getTime();i.data&&G(i.data)&&Ui(i.data,(t=>{t.offset=Math.abs(t.timestamp-n),delete t.timestamp})),t.Ga(i)};for(var r in e)i()}}),this.Ba))}Ga(t){try{this.Ha(t)}catch(t){Bi.error(t)}}Wa(){clearTimeout(this.za),this.za=void 0}Va(){var t={};return Ui(this.ja,(e=>{var i,r=e,n=(r?r.batchKey:null)||r.url;K(t[n])&&(t[n]=p({},r,{data:[]})),null==(i=t[n].data)||i.push(r.data)})),this.ja=[],t}}var Fw=["retriesPerformedSoFar"];class Ow{constructor(e){this.Za=!1,this.Qa=3e3,this.ja=[],this._instance=e,this.ja=[],this.Ja=!0,!K(t)&&"onLine"in t.navigator&&(this.Ja=t.navigator.onLine,this.Ka=()=>{this.Ja=!0,this.Ya()},this.Xa=()=>{this.Ja=!1},Yi(t,"online",this.Ka),Yi(t,"offline",this.Xa))}get length(){return this.ja.length}retriableRequest(t){var e=t.retriesPerformedSoFar,i=g(t,Fw);rt(e)&&(i.url=_w(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.Un(p({retriesPerformedSoFar:e},i));0===t.statusCode&&Bi.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)}}))}Un(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.ja.push({retryAt:r,requestOptions:t});var n="Enqueued failed request for retry in "+i;navigator.onLine||(n+=" (Browser is offline)"),Bi.warn(n),this.Za||(this.Za=!0,this.eo())}eo(){if(this.io&&clearTimeout(this.io),0===this.ja.length)return this.Za=!1,void(this.io=void 0);this.io=setTimeout((()=>{this.Ja&&this.ja.length>0&&this.Ya(),this.eo()}),this.Qa)}Ya(){var t=Date.now(),e=[],i=this.ja.filter((i=>t>i.retryAt||(e.push(i),!1)));if(this.ja=e,i.length>0)for(var r of i)this.retriableRequest(r.requestOptions)}unload(){for(var e of(this.io&&(clearTimeout(this.io),this.io=void 0),this.Za=!1,K(t)||(this.Ka&&(t.removeEventListener("online",this.Ka),this.Ka=void 0),this.Xa&&(t.removeEventListener("offline",this.Xa),this.Xa=void 0)),this.ja)){var i=e.requestOptions;try{this._instance._send_request(p({},i,{transport:"sendBeacon"}))}catch(t){Bi.error(t)}}this.ja=[]}}class Lw{constructor(t){this.ro=()=>{var t,e,i,r;this.no||(this.no={});var n=this.scrollElement(),s=this.scrollY(),a=n?Math.max(0,n.scrollHeight-n.clientHeight):0,o=s+((null==n?void 0:n.clientHeight)||0),l=(null==n?void 0:n.scrollHeight)||0;this.no.lastScrollY=Math.ceil(s),this.no.maxScrollY=Math.max(s,null!==(t=this.no.maxScrollY)&&void 0!==t?t:0),this.no.maxScrollHeight=Math.max(a,null!==(e=this.no.maxScrollHeight)&&void 0!==e?e:0),this.no.lastContentY=o,this.no.maxContentY=Math.max(o,null!==(i=this.no.maxContentY)&&void 0!==i?i:0),this.no.maxContentHeight=Math.max(l,null!==(r=this.no.maxContentHeight)&&void 0!==r?r:0)},this._instance=t}get so(){return this._instance.config.scroll_root_selector}getContext(){return this.no}resetContext(){var t=this.no;return setTimeout(this.ro,0),t}startMeasuringScrollPosition(){Yi(t,"scroll",this.ro,{capture:!0}),Yi(t,"scrollend",this.ro,{capture:!0}),Yi(t,"resize",this.ro)}scrollElement(){if(!this.so)return null==t?void 0:t.document.documentElement;var e=G(this.so)?this.so:[this.so];for(var i of e){var r=null==t?void 0:t.document.querySelector(i);if(r)return r}}ao(e){var i="y"===e?"scrollTop":"scrollLeft";if(this.so){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.ao("y")}scrollX(){return this.ao("x")}}var Dw=t=>Vo(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 $w{constructor(t,e,i,r){this.xt=t=>{var e=this.oo();if(!e||e.sessionId!==t){var i={sessionId:t,props:this.lo(this._instance)};this.uo.register({[ps]:i})}},this._instance=t,this.ho=e,this.uo=i,this.lo=r||Dw,this.ho.onSessionId(this.xt)}oo(){return this.uo.props[ps]}getSetOnceProps(){var t,e=null==(t=this.oo())?void 0:t.props;return e?"r"in e?Go(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 Ui(Qi(this.getSetOnceProps()),((e,i)=>{"$current_url"===i&&(i="url"),t["$session_entry_"+H(i)]=e})),t}}class Nw{on(t,e){return this.do[t]||(this.do[t]=[]),this.do[t].push(e),()=>{this.do[t]=this.do[t].filter((t=>t!==e))}}emit(t,e){for(var i of this.do[t]||[])i(e);for(var r of this.do["*"]||[])r(t,e)}constructor(){this.do={}}}var qw=Hi("[SessionId]"),jw=864e5;class Bw{on(t,e){return this.vo.on(t,e)}constructor(t,e,i){var r;if(this.co=null,this.fo=null,this.po=[],this.mo=void 0,this.yo=!1,this.vo=new Nw,this.bo=(t,e)=>!(!rt(t)||!rt(e))&&Math.abs(t-e)>this.sessionTimeoutMs,!t.persistence)throw new Error("SessionIdManager requires a PostHogPersistence instance");if(t.config.cookieless_mode===Ds)throw new Error('SessionIdManager cannot be used with cookieless_mode="always"');this.nn=t.config,this.uo=t.persistence,this.Ct=void 0,this.Le=void 0,this._sessionStartTimestamp=null,this._o=void 0,this._sessionActivityTimestamp=null,this.wo=e||np,this.ko=i||np;var n=this.nn.persistence_name||this.nn.token;if(this._sessionTimeoutMs=1e3*gt(this.nn.session_idle_timeout_seconds||1800,60,36e3,qw.createLogger("session_idle_timeout_seconds"),1800),t.register({$configured_session_timeout_ms:this._sessionTimeoutMs}),this.So(),this.xo="ph_"+n+"_window_id",this.Co="ph_"+n+"_primary_window_exists",this.To()){var s=xp.ni(this.xo),a=xp.ni(this.Co);s&&!a?this.Ct=s:xp.ri(this.xo),xp.ei(this.Co,!0)}null!=(r=this.nn.bootstrap)&&r.sessionID&&this.setBootstrapSessionId(this.nn.bootstrap.sessionID),this.Mo()}get sessionTimeoutMs(){return this._sessionTimeoutMs}onSessionId(t){return K(this.po)&&(this.po=[]),this.po.push(t),this.Le&&t(this.Le,this.Ct),()=>{this.po=this.po.filter((e=>e!==t))}}To(){return"memory"!==this.nn.persistence&&!this.uo.la&&xp.Xr()}Eo(t){t!==this.Ct&&(this.Ct=t,this.To()&&xp.ei(this.xo,t))}Io(){return this.Ct?this.Ct:this.To()?xp.ni(this.xo):null}Ro(t){var e=this.co;return!tt(e)&&!tt(t)&&5e3>Math.abs(t-e)}Po(t,e,i){var r=e!==this._sessionActivityTimestamp,n=!(t!==this.Le||i!==this._sessionStartTimestamp);this._sessionStartTimestamp=i,this._sessionActivityTimestamp=e,this.Le=t,n&&!r||n&&this.Ro(e)||(this.co=e,this.uo.register({[Dn]:[e,t,i]}))}Ao(){var t,e=null==(t=this.nn)?void 0:t.persistence_save_debounce_ms;return rt(e)&&e>0}Fo(){this.Ao()?this.uo.refreshKey(Dn):(this.uo.flush(),this.uo.load())}Oo(){var t;if(!tt(this._sessionActivityTimestamp)&&this._sessionActivityTimestamp!==this.co){this.Fo();var e=this.Lo();e[1]===this.Le&&e[2]===this._sessionStartTimestamp&&(this.co=this._sessionActivityTimestamp,this.uo.register({[Dn]:[this._sessionActivityTimestamp,null!==(t=this.Le)&&void 0!==t?t:null,this._sessionStartTimestamp]}),this.uo.flush())}}Do(){var t=this.Lo()[0],e=rt(t)?t:0,i=rt(this._sessionActivityTimestamp)?this._sessionActivityTimestamp:0;return Math.max(e,i)}$o(t){return this.Fo(),this.bo(t,this.Do())}Lo(){var t=this.uo.props[Dn];return G(t)&&2===t.length&&t.push(t[0]),t||[0,null,0]}resetSessionId(){this.co=null,this._o=void 0,clearTimeout(this.No),this.No=void 0,this.Po(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 qw.error("Bootstrap sessionID cannot be in the future"):i}catch(t){return void qw.error("Invalid sessionID in bootstrap",t)}}(t);return!K(i)&&(e?this._o={sessionId:t,sessionStartTimestamp:i}:this.Po(t,(new Date).getTime(),i),!0)}destroy(){this.yo=!0,this.Oo(),clearTimeout(this.No),this.No=void 0,this.mo&&t&&(t.removeEventListener(Bs,this.mo,{capture:!1}),this.mo=void 0),this.po=[]}Mo(){this.mo=()=>{this.Oo(),this.To()&&xp.ri(this.Co)},Yi(t,Bs,this.mo,{capture:!1})}checkAndGetSessionAndWindowId(t,e,i){if(void 0===t&&(t=!1),void 0===e&&(e=null),void 0===i&&(i=!1),this.nn.cookieless_mode===Ds)throw new Error('checkAndGetSessionAndWindowId should not be called with cookieless_mode="always"');var r=e||(new Date).getTime(),n=this.Le;if(i)this.fo=r;else if(tt(this.fo)||this.fo>r||r-this.fo>=1e3){var s,a;null==(s=(a=this.uo).syncCookieProperties)||s.call(a),this.fo=r}var o=this.Lo(),l=o[1],u=o[2],h=!K(n)&&l!==n,d=this.Do(),v=this.Io(),c=this._o,f=!!c&&(c.sessionStartTimestamp>r+6e4||r-c.sessionStartTimestamp>jw),p=c?f:rt(u)&&Math.abs(r-u)>jw,g=!1,m=h,y=!l||!!c,b=l,_=!y&&!t&&this.bo(r,d);if(_){(_=this.$o(r))||qw.info("cross-tab refresh kept the session alive",{sessionId:l});var w=this.Lo();l=w[1],u=w[2]}if(y||_||p){m=!1;var k=c&&!f;l=k?c.sessionId:this.wo(),v=this.ko(),qw.info("new session ID assigned",{sessionId:l,windowId:v,bootstrapped:!!k,changeReason:{noSessionId:y,activityTimeout:_,sessionPastMaximumLength:p}}),u=k?c.sessionStartTimestamp:r,this._o=void 0,g=!0}else v||(v=this.ko(),g=!0),(m=m||l!==b)&&(qw.info("adopted cross-tab session id",{sessionId:l,windowId:v}),g=!0);var S=rt(d)&&t&&!p?d:r,x=rt(u)?u:(new Date).getTime();this.Eo(v),this.Po(l,S,x),t||this.So();var C={noSessionId:y,activityTimeout:_,sessionPastMaximumLength:p,crossTabAdoption:m};return g&&this.po.forEach((t=>t(l,v,C))),{sessionId:l,windowId:v,sessionStartTimestamp:x,changeReason:g?C:void 0,lastActivityTimestamp:d}}So(){this.yo||(clearTimeout(this.No),this.No=setTimeout((()=>{if(!this.yo)if(this.$o((new Date).getTime())){var t=this.Le;this.resetSessionId(),this.vo.emit("forcedIdleReset",{idleSessionId:t})}else this.So()}),1.1*this.sessionTimeoutMs))}}var Hw=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 zw(){return zw=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 Y(r)&&r.length>0?r:void 0}catch(t){return void Bi.info("Unable to resolve $device_model from userAgentData.getHighEntropyValues",t)}})),zw.apply(this,arguments)}var Uw="custom",Ww="i.posthog.com",Vw=/^\/static\//,Gw=["/s/","/e/","/i/"];class Zw{constructor(t){this.qo={},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("."+Ww,".posthog.com")),"https://app.posthog.com"===e?"https://us.posthog.com":e}get region(){return this.qo[this.apiHost]||(this.qo[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":Uw),this.qo[this.apiHost]}jo(t){if(Vw.test(t)){var e=this.instance.config.asset_host;if("string"==typeof e)return e.trim().replace(/\/$/,"")||void 0}}Bo(t){var e=ir(t);return e?e.protocol+"//"+e.host+e.pathname:void 0}Ho(t,e,i){if("ui"===t)return i;var r=i,n=this.instance.config.rewriteRequestPath;if(n){var s,a=(null==(s=ir(i))?void 0:s.href)||i;r=n(new URL(a)).toString()}if(n&&"api"===t&&Gw.some((t=>0===e.indexOf(t)))){var o=this.Bo(r);if(o){var l,u=this.apiHost,h=this.zo;(null==(l=h)?void 0:l.apiHost)===u&&h.rewriteRequestPath===n||(h={apiHost:u,rewriteRequestPath:n,urls:new Set},this.zo=h),h.urls.add(o)}}return r}isIngestionEndpoint(t){var e=this.zo,i=this.Bo(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.Ho(t,e,this.uiHost+e);if("flags"===t)return this.Ho(t,e,this.flagsApiHost+e);if("assets"===t){var i=this.jo(e);if(i)return this.Ho(t,e,""+i+e)}if(this.region===Uw)return this.Ho(t,e,this.apiHost+e);var r=Ww+e;switch(t){case"assets":return this.Ho(t,e,"https://"+this.region+"-assets."+r);case"api":return this.Ho(t,e,"https://"+this.region+"."+r)}}}var Qw=Hi("[PostHog ExternalIntegrations]"),Jw={intercom:"intercom-integration",crispChat:"crisp-chat-integration"};class Kw{constructor(t){this._instance=t}js(t,e){var i;null==(i=v.__PosthogExtensions__)||null==i.loadExternalDependency||i.loadExternalDependency(this._instance,t,(t=>{if(t)return Qw.error("failed to load script",t);e()}))}startIfEnabledOrStop(){var t=this,e=function(){var e,r,n,s=i[0],a=i[1];!a||null!=(e=v.__PosthogExtensions__)&&null!=(e=e.integrations)&&e[s]||t.js(Jw[s],(()=>{var e;null==(e=v.__PosthogExtensions__)||null==(e=e.integrations)||null==(e=e[s])||e.start(t._instance)})),!a&&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 Yw{constructor(t,e){this.I=t,this.Ts=e,this.Uo=new Map,this.ks=!1}add(t){var e=this;return f((function*(){if(e.ks)throw new Error("Cannot add an extension to a disposed ExtensionRuntime");if(e.Uo.has(t.name))throw new Error('Browser extension "'+t.name+'" is already registered');e.Uo.set(t.name,t);try{var i=t.setup(e.Ts);i&&(yield i)}catch(i){var r=e.Uo.get(t.name)===t;r&&e.Uo.delete(t.name),e.I.error('Failed to set up browser extension "'+t.name+'"',i),r&&e.Wo(t)}}))()}getExtension(t){return this.Uo.get(t)}dispose(){if(!this.ks){this.ks=!0;var t=Array.from(this.Uo.values()).reverse();for(var e of(this.Uo.clear(),t))this.Wo(e)}}Wo(t){try{var e=null==t.dispose?void 0:t.dispose();e&&Z(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);K(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 tk="extensionsRemoteConfig";class ek{constructor(t){this.ks=!1,this.instance=t,this.I=Bi,this.Vo=t.Go,this.kv=new Xw(t),this.onEvent=t=>Tf(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.ks)return Tf((()=>{}));var e=e=>{try{t(e)}catch(t){this.I.error("Browser extension remote config listener failed",t)}},i=this.instance.Zo.on(tk,e);return this.Vo&&e(this.Vo),Tf(i)},this.Qo=new Yw(Bi.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(gn))&&void 0!==t?t:this.distinctId}get deviceId(){var t=this.instance.get_property(gn);return"string"==typeof t?t:void 0}get library(){return{name:qi.LIB_NAME,version:qi.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 canCapture(){return this.instance.is_capturing()}get projectToken(){return this.instance.config.token}add(t){return this.Qo.add(t)}getExtension(t){return this.Qo.getExtension(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 Tf(this.instance.Jo(t))}handleRemoteConfig(t){this.ks||(this.Vo=t,this.instance.Zo.emit(tk,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?_w(n,e.query):n,data:e.body,headers:e.headers,timeout:e.timeoutMs,fireCallbackOnDrop:!0,transport:e.transport,compression:e.compression,compressionFallback:"flags"===e.target&&"best-available"===e.compression?x.Base64:void 0,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.ks||(this.ks=!0,this.Qo.dispose())}}var ik={},rk=0,nk=()=>{},sk='Consent opt in/out is not valid with cookieless_mode="always" and will be ignored',ak="Surveys module not available",ok="sanitize_properties is deprecated. Use before_send instead",lk="Invalid value for property_denylist config: ",uk=["token","distinct_id",ks],hk="posthog",dk=!gw&&-1===(null==u?void 0:u.indexOf("MSIE"))&&-1===(null==u?void 0:u.indexOf("Mozilla")),vk=t=>{var e={};return t&&"unset"!==t?("2025-11-30">t||(e.strictMinimumDuration=!0),"2026-05-30">t||(e.canvasCapture={resolutionScale:.6}),"2026-06-25">t||(e.streamNetworkBody=!0),"2026-08-30">t||(e.captureJsonLd=!0),e):e},ck=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:Ki(null==r?void 0:r.location),persistence:"localStorage+cookie",persistence_name:"",cookie_persisted_properties:[],loaded:nk,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&&Y(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){Bi.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:qs,before_send:void 0,get_current_url:void 0,request_queue_config:{flush_interval_ms:Pw},error_tracking:{},_onCapture:nk},(t=>({rageclick:t&&t>="2026-05-30"?{content_ignorelist:Ar,ignore_text_selection:!0}:!t||"2025-11-30">t||{content_ignorelist:!0},capture_pageview:!t||"2025-05-24">t||"history_change",session_recording:vk(t),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))},fk=[["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"]],pk=t=>{var e={};for(var i of fk){var r=i[0],n=i[1];K(t[r])||(e[n]=t[r])}var s=Wi({},e,t),a=t.__preview_external_dependency_versioned_paths;return K(a)||(K(t.strict_script_versioning)&&(s.strict_script_versioning=!!a),Y(a)&&K(t.asset_host)&&(s.asset_host=a)),G(t.property_blacklist)&&(K(t.property_denylist)?s.property_denylist=t.property_blacklist:G(t.property_denylist)?s.property_denylist=[...t.property_blacklist,...t.property_denylist]:Bi.error(lk+t.property_denylist)),s};class gk{constructor(){this.__forceAllowLocalhost=!1}get Ko(){return this.__forceAllowLocalhost}set Ko(t){Bi.error("WebPerformanceObserver is deprecated and has no impact on network capture. Use `_forceAllowLocalhostNetworkCapture` on `posthog.sessionRecording`"),this.__forceAllowLocalhost=t}}class mk{Yo(t,e){if(t){var i=this.Uo.indexOf(t);-1!==i&&this.Uo.splice(i,1)}return this.Uo.push(e),null==e.initialize||e.initialize(),e}Xo(){return this.config.cookieless_mode===Ds||this.config.cookieless_mode===Ls&&this.consent.isRejected()}tl(){if(!this.Xo()&&this.get_distinct_id()===ws){var t=this.persistence;if(t){this.el()||t.load(!0);var e=this.get_distinct_id();if(!e||e===ws){var i=this.config.get_device_id(np());this.register({distinct_id:i,$device_id:i}),t.set_property(fs,$s)}this.il()}}}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 gk,this.rl=!1,this.version=qi.LIB_VERSION,this.nl=new Set,this.sl="",this.Zo=new Nw,this.Uo=[],this.al=[],this._calculate_event_properties=this.calculateEventProperties.bind(this),this.config=ck(),this.SentryIntegration=tw,this.sentryIntegration=t=>function(t,e){var i=X_(t,e);return{name:Y_,processEvent:t=>i(t)}}(this,t),this.__request_queue=[],this.__loaded=!1,this.analyticsDefaultEndpoint="/e/",this.ol=!1,this.ll=null,this.ul=null,this.hl=null,this.scrollManager=new Lw(this),this.pageViewManager=new ew(this),this.rateLimiter=new cw(this),this.requestRouter=new Zw(this),this.consent=new V_(this),this.externalIntegrations=new Kw(this);var e=null!==(t=mk.__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=Y(t)?{[t]:e}:t;this.setPersonProperties(r),null==i||i({})},set_once:(t,e,i)=>{var r=Y(t)?{[t]:e}:t;this.setPersonProperties(void 0,r),null==i||i({})}},this.on("eventCaptured",(t=>Bi.info('send "'+(null==t?void 0:t.event)+'"',t)))}init(t,e,i){if(i&&i!==hk){var r,n=null!==(r=ik[i])&&void 0!==r?r:new mk;return n._init(t,e,i),ik[i]=n,ik[hk][i]=n,n}return this._init(t,e,i)}_init(e,i,r){var n,s;void 0===i&&(i={});var a,o=Y(e)?e.trim():"";if(!o)return Bi.critical("PostHog was initialized without a token. This likely indicates a misconfiguration. Please check the first argument passed to posthog.init()"),this;if(this.__loaded)return o!==(null==(a=this.config)?void 0:a.token)?console.warn("[PostHog.js]","You have already initialized PostHog with a different project token! Re-initializing is a no-op, so events will keep going to the project this instance was initialized with. To capture into a second project, load PostHog once, then initialize a named instance after the SDK has loaded, e.g. posthog.init('"+o+"', { ... }, 'project2')"):console.warn("[PostHog.js]","You have already initialized PostHog! Re-initializing is a no-op"),this;this.__loaded=!0,this.config=ck(i.defaults),i.debug=this.dl(i.debug),this.vl=i,this.cl=[],i.person_profiles?this.ul=i.person_profiles:i.process_person&&(this.ul=i.process_person);var l=ck(i.defaults),u=pk(i),h=Wi({},l,u,{name:r,token:o});Q(l.rageclick)&&Q(u.rageclick)&&(h.rageclick=Wi({},l.rageclick,u.rageclick)),Q(l.session_recording)&&Q(u.session_recording)&&(h.session_recording=Wi({},l.session_recording,u.session_recording)),this.set_config(h),this.config.on_xhr_error&&Bi.error("on_xhr_error is deprecated. Use on_request_error instead"),this.compression=i.disable_compression?void 0:Mf;var d=this.el();if(this.persistence=new dw(this.config,d),this.sessionPersistence="sessionStorage"===this.config.persistence||"memory"===this.config.persistence?this.persistence:new dw(p({},this.config,{persistence:"sessionStorage"}),d,!1),this.sl="ph_"+(this.config.persistence_name||this.config.token)+"_session_registered_properties","memory"!==this.config.persistence&&!d&&xp.Xr()){var v=xp.ni(this.sl);G(v)&&v.forEach((t=>{Y(t)&&this.nl.add(t)}))}else xp.ri(this.sl);var c=p({},this.persistence.props),f=p({},this.sessionPersistence.props);this.register({$initialization_time:(new Date).toISOString()}),this.fl=new Aw((t=>this.pl(t)),this.config.request_queue_config),this.gl=new Ow(this),this.__request_queue=[];var g=this.Xo();if(g||(this.sessionManager=new Bw(this),this.sessionPropsManager=new $w(this,this.sessionManager,this.persistence),this.sessionManager.onSessionId(((t,e,i)=>{(null!=i&&i.activityTimeout||null!=i&&i.sessionPastMaximumLength||null!=i&&i.crossTabAdoption)&&this.ml()}))),this.yl(),this.config.__preview_deferred_init_extensions?(Bi.info("Deferring extension initialization to improve startup performance"),setTimeout((()=>{this.bl(g)}),0)):(Bi.info("Initializing extensions synchronously"),this.bl(g)),qi.DEBUG=qi.DEBUG||this.config.debug,qi.DEBUG&&Bi.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(),b=this.persistence.get_property(fs);if(i.bootstrap.isIdentifiedID&&null!=y&&y!==m&&b===$s)this.identify(m);else if(i.bootstrap.isIdentifiedID&&null!=y&&y!==m&&b===Ns)Bi.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 _=this.config.get_device_id(np()),w=i.bootstrap.isIdentifiedID?_:m;this.persistence.set_property(fs,i.bootstrap.isIdentifiedID?Ns:$s),this.register({distinct_id:m,$device_id:w})}}if(g)this.register_once({distinct_id:ws,$device_id:null},"");else if(!this.get_distinct_id()){var k=this.config.get_device_id(np());this.register_once({distinct_id:k,$device_id:k},""),this.persistence.set_property(fs,$s)}return Yi(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()||np();t.config.get_device_id=r,i.id()&&(t.register({distinct_id:i.id(),$device_id:r()}),t.persistence.set_property(fs,Ns)),e()},n=i.user();"then"in n&&Z(n.then)?n.then(r):r(n)}(t,(()=>{i.register((t=>{"undefined"!=typeof Promise&&Promise.resolve||K_.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()||(K_.info("No userId set, resetting PostHog"),t.reset()),e.event.userId&&e.event.userId!==t.get_distinct_id()&&(K_.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,Hs),identify:t=>e(t,Us),screen:t=>e(t,"$screen")}})(t)).then((()=>{e()}))}))}(this,(()=>this._l())):this._l(),Z(this.config._onCapture)&&this.config._onCapture!==nk&&(Bi.warn("onCapture is deprecated. Please use `before_send` instead"),this.on("eventCaptured",(t=>this.config._onCapture(t.event,t)))),this.config.ip&&Bi.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 zw.apply(this,arguments)}().then((t=>{t&&this.register({[mn]:t})})).catch(nk),this}wl(t){var e=t;return Y(e.name)&&Z(e.setup)}kl(t,e){this.wl(t)?e.push((()=>{this.Sl().add(t).catch((()=>null==t.dispose?void 0:t.dispose())).catch((e=>{Bi.error('Failed to dispose browser extension "'+t.name+'"',e)}))})):this.Uo.push(t)}yl(){var t,e,i,r,n,s,a=null!==(t=null==(e=this.config.__extensionClasses)?void 0:e.featureFlags)&&void 0!==t?t:null==(i=mk.__defaultExtensionClasses)?void 0:i.featureFlags;a&&(this.featureFlags&&this.featureFlags instanceof a||(null==(r=this.xl)||r.call(this),this.xl=void 0,this.featureFlags=new a(this)),Z(this.featureFlags.onReloading)&&Z(this.featureFlags.setup)?this.xl||(this.xl=this.featureFlags.onReloading((()=>{this.Zo.emit("featureFlagsReloading",!0)})),this.Sl().add(this.featureFlags)):null==(n=(s=this.featureFlags).initialize)||n.call(s))}bl(t){var e,i,r,n,s,a,o,l=performance.now(),u=p({},mk.__defaultExtensionClasses,this.config.__extensionClasses),h=[];u.exceptions&&this.Uo.push(this.exceptions=null!==(e=this.exceptions)&&void 0!==e?e:new u.exceptions(this)),u.historyAutocapture&&this.Uo.push(this.historyAutocapture=new u.historyAutocapture(this)),u.tracingHeaders&&this.Uo.push(this.tracingHeaders=new u.tracingHeaders(this)),u.siteApps&&this.Uo.push(this.siteApps=new u.siteApps(this)),u.sessionRecording&&!t&&this.Uo.push(this.sessionRecording=new u.sessionRecording(this)),this.config.disable_scroll_properties||h.push((()=>{this.scrollManager.startMeasuringScrollPosition()})),u.autocapture&&this.kl(this.autocapture=new u.autocapture(this),h),u.surveys&&this.kl(this.surveys=null!==(i=this.surveys)&&void 0!==i?i:new u.surveys(this),h),u.logs&&this.kl(this.logs=null!==(r=this.logs)&&void 0!==r?r:new u.logs(this),h),u.metrics&&this.Uo.push(this.metrics=null!==(n=this.metrics)&&void 0!==n?n:new u.metrics(this)),u.conversations&&this.Uo.push(this.conversations=null!==(s=this.conversations)&&void 0!==s?s:new u.conversations(this)),u.productTours&&this.Uo.push(this.productTours=new u.productTours(this)),u.heatmaps&&this.Uo.push(this.heatmaps=new u.heatmaps(this)),u.webVitalsAutocapture&&this.Uo.push(this.webVitalsAutocapture=new u.webVitalsAutocapture(this)),u.exceptionObserver&&this.Uo.push(this.exceptionObserver=new u.exceptionObserver(this)),u.deadClicksAutocapture&&this.Uo.push(this.deadClicksAutocapture=new u.deadClicksAutocapture(this,Q_)),u.toolbar&&this.Uo.push(this.toolbar=null!==(a=this.toolbar)&&void 0!==a?a:new u.toolbar(this)),u.experiments&&this.Uo.push(this.experiments=null!==(o=this.experiments)&&void 0!==o?o:new u.experiments(this)),this.Uo.forEach((t=>{t.initialize&&h.push((()=>{null==t.initialize||t.initialize()}))})),h.push((()=>{if(this.Cl){var t=this.Cl;this.Cl=void 0,this.Uo.forEach((e=>null==e.onRemoteConfig?void 0:e.onRemoteConfig(t)))}})),this.Tl(h,l)}Tl(t,e){for(;t.length>0;){if(this.config.__preview_deferred_init_extensions&&performance.now()-e>=30&&t.length>0)return void setTimeout((()=>{this.Tl(t,e)}),0);var i=t.shift();if(i)try{i()}catch(t){Bi.error("Error initializing extension:",t)}}var r=Math.round(performance.now()-e);this.register_for_session({[Ss]:this.config.__preview_deferred_init_extensions?"deferred":"synchronous",[xs]:r}),this.config.__preview_deferred_init_extensions&&Bi.info("PostHog extensions initialized ("+r+"ms)")}La(t){var e;if(!r||!r.body)return Bi.info("document not ready yet, trying again in 500 milliseconds..."),void setTimeout((()=>{this.La(t)}),500);if(this.config.__preview_deferred_init_extensions&&(this.Cl=t),this.Go=t,this.compression=void 0,t.ok){var i,n=t.config;n.supportedCompression&&!this.config.disable_compression&&(this.compression=j(n.supportedCompression,Mf)?Mf:j(n.supportedCompression,Ef)?Ef:void 0),null!=(i=n.analytics)&&i.endpoint&&(this.analyticsDefaultEndpoint=n.analytics.endpoint)}this.set_config({person_profiles:this.ul?this.ul:qs}),null==(e=this.Ml)||e.handleRemoteConfig(t),this.Uo.forEach((e=>null==e.onRemoteConfig?void 0:e.onRemoteConfig(t)))}_l(){try{this.config.loaded(this)}catch(t){Bi.critical("`loaded` function failed",t)}if(this.El(),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.Xo())&&this.Il()}),1),this.Rl=new pw(this),this.Rl.load()}El(){var t;this.is_capturing()&&this.config.request_batching&&(null==(t=this.fl)||t.enable())}_dom_loaded(){this.is_capturing()&&zi(this.__request_queue,(t=>this.pl(t))),this.__request_queue=[],this.El()}_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.Pl()&&this.capture(zs),null==(i=this.logs)||i.flushLogs("sendBeacon"),null==(r=this.fl)||r.unload(),null==(n=this.gl)||n.unload()):this.Pl()&&this.capture(zs,null,{transport:"sendBeacon"})}_send_request(t){var e;this.__loaded?dk?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?null!==(e=this.compression)&&void 0!==e?e:t.compressionFallback:t.compression,(K(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,a,o,u,h,d=null!==(e=n.transport)&&void 0!==e?e:"fetch";"sendBeacon"===d&&K(n.compression)&&n.data&&(n.compression=Ef),"POST"===n.method&&n.data&&("capture-body"===n.timestampMode?n.data={api_key:null!==(a=null==(h=(u=(G(s=n.data)?s:[s]).map((t=>p({},t,t.timestamp instanceof Date&&!isNaN(t.timestamp.getTime())?{timestamp:t.timestamp.toISOString()}:{}))))[0])||null==(o=h.properties)?void 0:o.token)&&void 0!==a?a: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()),G(t)?t.map((t=>p({},t,{sent_at:e}))):p({},t,{sent_at:e})}(n.data))),n.url=Iw(n.url,n.method,n.compression,n.timestampMode);var v=Rw.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){Tw(t)?Bi.warn(t):Bi.error(t),null==n.callback||n.callback({statusCode:0,error:t})}};"sendBeacon"!==d&&n.data&&n.compression===Mf&&l&&"undefined"!=typeof Promise&&!yw?xw(n).then((t=>{f(t)})).catch((e=>{if(Oe(e))return yw=!0,void f(p({},n,{compression:void 0,url:Iw(t.url,t.method,void 0,t.timestampMode)}));Le(e)&&(yw=!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}))}pl(t){this.gl?this.gl.retriableRequest(t):this._send_request(t)}_execute_array(t){rk++;try{var e,i=[],r=[],n=[];zi(t,(t=>{if(t)if(G(e=t[0]))n.push(t);else if(Z(t))try{t.call(this)}catch(e){Bi.error("Error executing queued PostHog call",t,e)}else G(t)&&"alias"===e?i.push(t):G(t)&&-1!==e.indexOf("capture")&&Z(this[e])?n.push(t):r.push(t)}));var s=function(t,e){zi(t,(function(t){try{if(G(t[0])){var i=e;Ui(t,(function(t){i=i[t[0]].apply(i,t.slice(1))}))}else e[t[0]].apply(e,t.slice(1))}catch(e){Bi.error("Error executing queued PostHog call",t,e)}}))};s(i,this),s(r,this),s(n,this)}finally{rk--}}push(t){if(rk>0&&G(t)&&Y(t[0])){var e=mk.prototype[t[0]];Z(e)&&e.apply(this,t.slice(1))}else this._execute_array([t])}capture(t,e,i){var r,n,s,a,o;if(this.__loaded&&this.persistence&&this.sessionPersistence&&this.fl){if(this.is_capturing())if(!K(t)&&Y(t)){this.tl();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&&!Y(null==e?void 0:e.$current_url)&&(Bi.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.Al||Bi.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=xe(null==i?void 0:i.uuid,np),c={uuid:v,event:t,properties:this.calculateEventProperties(t,e||{},d,v)};t===Hs&&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(Yn);(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.Fl(null==i?void 0:i.$set_once,t!==Ws,t===Us);if(m&&(c.$set_once=m),null!=i&&i._noTruncate||(n=this.config.properties_string_max_length,s=c,a=t=>Y(t)?t.slice(0,n):t,o=new Set,c=function t(e,i){if(e!==Object(e))return a?a(e):e;if(!o.has(e)){var r;if(o.add(e),G(e))r=[],zi(e,(e=>{r.push(t(e))}));else{var n={};Ui(e,((e,i)=>{o.has(e)||(n[i]=t(e,i))})),r=n}return r}}(s)),c.timestamp=d,K(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 k.forEach(r),e.forEach(r),i}(c.properties,uk)),t===Nf.DISMISSED||t===Nf.SENT){var y=null==e?void 0:e[qf.SURVEY_ID],b=null==e?void 0:e[qf.SURVEY_ITERATION];Zf({id:y,current_iteration:b}),c.$set=p({},c.$set,{[fo({id:y,current_iteration:b},t===Nf.SENT?"responded":"dismissed")]:!0})}else t===Nf.SHOWN&&(c.$set=p({},c.$set,{[qf.SURVEY_LAST_SEEN_DATE]:(new Date).toISOString()}));if("product tour shown"===t){var _=null==e?void 0:e.$product_tour_type;_&&(c.$set=p({},c.$set,{["$product_tour_last_seen_date/"+_]:(new Date).toISOString()}))}var w=p({},c.properties.$set,c.$set);if(J(w)||this.setPersonPropertiesForFlags(w),!et(this.config.before_send)){var S=this.Hn(c);if(!S)return;(c=S).uuid=xe(c.uuid,np)}this.Zo.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.pl(C):this.fl.enqueue(C),c}Bi.critical("This capture call is ignored due to client rate limiting.")}}else Bi.error("No event name provided to posthog.capture")}else Bi.uninitializedWarning("posthog.capture")}_addCaptureHook(t){return this.on("eventCaptured",(e=>t(e.event,e)))}getExtension(t){var e;return null==(e=this.Ml)?void 0:e.getExtension(t)}Sl(){var t;return null!==(t=this.Ml)&&void 0!==t?t:this.Ml=new ek(this)}Jo(t){this.al.push(t);var e=!0;return()=>{if(e){e=!1;var i=this.al.indexOf(t);-1!==i&&this.al.splice(i,1)}}}Ol(t){var e,i,r;return void 0===t&&(t=!0),!(null==(e=this.persistence)||!e.consumeCookieIdentityChange())&&(this.hl=null,this.persistence.get_property(fs)===$s&&(null==(r=this.sessionPersistence)||r.clear(),this.nl.clear(),this.Ll()),null==(i=this.featureFlags)||i.reset(),t&&this.reloadFeatureFlags(),!0)}calculateEventProperties(e,i,s,a,o){if(s=s||new Date,!this.persistence||!this.sessionPersistence)return i;this.persistence.syncCookieProperties(),this.Ol();var l=o?void 0:this.persistence.remove_event_timer(e),h=p({},i);if(h.token=this.config.token,h.$config_defaults=this.config.defaults,this.Xo()&&(h[ks]=!0),"$snapshot"===e){var d=p({},this.persistence.properties(),this.sessionPersistence.properties());return h.distinct_id=d.distinct_id,(!Y(h.distinct_id)&&!it(h.distinct_id)||X(h.distinct_id))&&Bi.error("Invalid distinct_id for replay event. This indicates a bug in your implementation"),h}var v,c=function(e,i,r,s){var a,o,l,h;if(void 0===s&&(s=!1),!u)return{};var d,v=e?[...Do,...i||[]]:[],c=function(t){for(var e=0;_e.length>e;e++){var i=_e[e],r=i[1],n=i[0].exec(t),s=n&&(Z(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={};K(r)||(m.detectGoogleSearchApp=r);var y={},b=null==(a=navigator)||null==(a=a.userAgentData)?void 0:a.platform,_=null==(o=navigator)?void 0:o.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;K(b)||(y.userAgentDataPlatform=b),K(_)||(y.maxTouchPoints=_),K(w)||(y.screenWidth=w),K(k)||(y.screenHeight=k),K(S)||(y.devicePixelRatio=S);var x,C=Wi(Qi({$os:f,$os_version:p,$browser:me(u,navigator.vendor,g,m),$device:we(u),$device_type:ke(u,y),$timezone:Zo(),$timezone_offset:Qo()}),{$current_url:sr(s?Te(null==n?void 0:n.href):null==n?void 0:n.href,v,No),$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:be(u,navigator.vendor,g,m),$browser_language:zo(),$browser_language_prefix:(x=zo(),"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:qi.LIB_NAME,$lib_version:qi.LIB_VERSION,$insert_id:Math.random().toString(36).substring(2,10)+Math.random().toString(36).substring(2,10),$time:Date.now()/1e3});return qi.SDK_DIST_CHANNEL&&(C.$sdk_dist_channel=qi.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(o,s.getTime(),!0),g=f.windowId;h.$session_id=f.sessionId,h.$window_id=g}this.sessionPropsManager&&Wi(h,this.sessionPropsManager.getSessionProps());try{var m;this.sessionRecording&&Wi(h,this.sessionRecording.sdkDebugProperties),h.$sdk_debug_retry_queue_size=null==(m=this.gl)?void 0:m.length}catch(t){h.$sdk_debug_error_capturing_properties=String(t)}if(this.requestRouter.region===Uw&&(h.$lib_custom_api_host=this.config.api_host),v=e!==Hs||o?e!==zs||o?this.pageViewManager.doEvent():this.pageViewManager.doPageLeave(s):this.pageViewManager.doPageView(s,a),h=Wi(h,v),e===Hs&&r&&(h.title=r.title),!K(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 b=this.persistence.properties(),_=this.sessionPersistence.properties();Ui(["$referrer","$referring_domain"],(t=>{t in b&&delete _[t]}));var w={};if(this.al.length>0)for(var k of this.al.slice())try{Wi(w,k())}catch(t){Bi.error("Failed to produce browser extension event properties",t)}(h=Wi({},c,b,_,p({},w,h))).$is_identified=this._isIdentified(),G(this.config.property_denylist)?Ui(this.config.property_denylist,(function(t){delete h[t]})):Bi.error(lk+this.config.property_denylist+" or property_blacklist config: "+this.config.property_blacklist);var S=this.config.sanitize_properties;S&&(Bi.error(ok),h=S(h,e));var x=this.Dl();return h.$process_person_profile=x,x&&!o&&this.$l("_calculate_event_properties"),h}Fl(t,e,i){var r;if(void 0===e&&(e=!0),void 0===i&&(i=!1),!this.persistence||!this.Dl())return t;if(this.rl&&!i)return t;var n=this.persistence.get_initial_props(),s=null==(r=this.sessionPropsManager)?void 0:r.getSetOnceProps(),a=Wi({},n,s||{},t||{}),o=this.config.sanitize_properties;return o&&(Bi.error(ok),a=o(a,"$set_once")),e&&(this.rl=!0),J(a)?void 0:a}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.Ol(),null==(i=this.sessionPersistence)||i.register(t),Object.keys(t).forEach((t=>this.nl.add(t))),this.Ll()}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.nl.delete(t),this.Ll()}Nl(t,e){this.register({[t]:e})}ml(){this.nl.forEach((t=>{var e;null==(e=this.sessionPersistence)||e.unregister(t)})),this.nl.clear(),this.Ll()}Ll(){var t;if(this.sl)if("memory"===this.config.persistence||null!=(t=this.sessionPersistence)&&t.la||!xp.Xr())xp.ri(this.sl);else{var e=[];this.nl.forEach((t=>e.push(t))),e.length>0?xp.ei(this.sl,e):xp.ri(this.sl)}}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.Zo.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:ak}),()=>{})}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:ak})}getActiveMatchingSurveys(t,e){void 0===e&&(e=!1),this.surveys?this.surveys.getActiveMatchingSurveys(t,e):t([],{isLoaded:!1,error:ak})}renderSurvey(t,e){var i;null==(i=this.surveys)||i.renderSurvey(t,e)}displaySurvey(t,e){var i;void 0===e&&(e=Jf),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:ak}}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:ak})}ql(t){return!t||X(t)?(Bi.critical("Unique user id has not been set in posthog.identify"),!1):t===ws?(Bi.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())||(Bi.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 Bi.uninitializedWarning("posthog.identify");if(it(t)&&(t=t.toString(),Bi.warn("The first argument to posthog.identify was a number, but it should be a string. It has been converted to a string.")),this.ql(t)&&this.$l("posthog.identify")){this.tl();var r=this.get_distinct_id(),n=this.persistence.syncCookieProperties()&&this.get_distinct_id()!==r,s=this.Ol(!1),a=this.persistence.da(),o=!1;try{var l=this.get_distinct_id();this.register({$user_id:t}),this.get_property(gn)||this.register_once({$had_persisted_distinct_id:!0,$device_id:l},""),t!==l&&t!==this.get_property(yn)&&(this.unregister(yn),this.register({distinct_id:t}));var u,h=(this.persistence.get_property(fs)||$s)===$s,d=t!==l,v=!d&&h;if(d&&h)this.persistence.set_property(fs,Ns),this.setPersonPropertiesForFlags({$set:e||{},$set_once:i||{}},!1),this.config.cookieWinsOnConflict&&this.persistence.va(),this.capture(Us,{distinct_id:t,$anon_distinct_id:l},{$set:e||{},$set_once:i||{}}),this.hl=To(t,e,i),null==(u=this.featureFlags)||u.setAnonymousDistinctId(l);else if(v){this.persistence.set_property(fs,Ns);var c=e||{},f=i||{};this.setPersonPropertiesForFlags({$set:c,$set_once:f},!1),this.config.cookieWinsOnConflict&&this.persistence.va(),this.capture("$set",{$set:c,$set_once:f}),this.hl=To(t,e,i)}else(e||i)&&this.setPersonProperties(e,i);d||n||s?(this.reloadFeatureFlags(),this.featureFlags?this.featureFlags.resetFlagCallReported():this.unregister(hs)):v&&(e||i)&&this.reloadFeatureFlags(),o=!0}finally{a&&this.persistence.pa(o)}}}setPersonProperties(t,e){if((t||e)&&this.$l("posthog.setPersonProperties")){var i=To(this.get_distinct_id(),t,e);this.hl!==i?(this.setPersonPropertiesForFlags({$set:t||{},$set_once:e||{}},!0),this.capture("$set",{$set:t||{},$set_once:e||{}}),this.hl=i):Bi.info("A duplicate setPersonProperties call was made with the same properties. It has been ignored.")}}unsetPersonProperties(t){var e,i=(G(t)?t:[t]).filter((t=>Y(t)&&t.length>0));0!==i.length&&this.$l("posthog.unsetPersonProperties")&&(null==(e=this.featureFlags)||e.unsetPersonPropertiesForFlags(i,!0),this.capture("$set",{$unset:i}),this.hl=null)}group(t,e,i){var r;if(t&&e){null==(r=this.persistence)||r.syncCookieProperties(),this.Ol();var n=this.getGroups(),s=n[t]!==e;if(s&&this.resetGroupPropertiesForFlags(t),this.register({$groups:p({},n,{[t]:e})}),s||i){var a={$group_type:t,$group_key:e};i&&(a.$group_set=i),this.capture(Ws,a)}i&&this.setGroupPropertiesForFlags({[t]:i}),s&&!i&&this.reloadFeatureFlags()}else Bi.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.$l("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=nt(t)?t:null==t?void 0:t.resetDeviceID,i=nt(t)||null==t?void 0:t.bootstrap;this.jl(e,!1,i)}jl(t,e,i){var r,n,s;if(void 0===e&&(e=!1),Bi.info("reset"),!this.__loaded)return Bi.uninitializedWarning("posthog.reset");var a=null==i?void 0:i.sessionID;this.config.bootstrap=i||(null==(r=this.vl)?void 0:r.bootstrap)||{},null==(n=this.featureFlags)||null==n.updateConfig||n.updateConfig(this.config,this.Da());var o=this.get_property(gn),l=this.get_property(mn),u=this.get_property(Rn),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.da?void 0:s.da(),v=!1;try{var c,f,g,m,y,b,_,w,k,S,x,C,T;if(null==(c=this.persistence)||c.clear(),null==(f=this.sessionPersistence)||f.clear(),this.nl.clear(),this.Ll(),K(u)||null==(S=this.persistence)||S.register({[Rn]:u}),null==(g=this.surveys)||g.reset(),null==(m=this.featureFlags)||m.reset(),null==(y=this.conversations)||y.reset(),null==(b=this.logs)||b.reset(),null==(_=this.metrics)||_.reset(),null==(w=this.persistence)||w.set_property(fs,$s),null==(k=this.sessionManager)||k.resetSessionId(),this.hl=null,this.config.cookieless_mode===Ds)this.register_once({distinct_id:ws,$device_id:null},"");else{var M=this.config.get_device_id(np());this.register_once({distinct_id:M,$device_id:t?M:o},""),t||K(l)||this.register({[mn]:l})}if(this.register({$last_posthog_reset:(new Date).toISOString()},1),i)if(void 0===i.distinctID||this.Xo()||(null==(T=this.persistence)||T.set_property(fs,i.isIdentifiedID?Ns:$s),this.register({distinct_id:i.distinctID})),null==(x=this.featureFlags)||x.initialize(),!(K(a)||null!=(C=this.sessionManager)&&C.setBootstrapSessionId(a,!0))){var E=p({},i);delete E.sessionID,this.config.bootstrap=E}delete this.config.identity_distinct_id,delete this.config.identity_hash,v=!0}finally{var I;d&&(null==(I=this.persistence)||null==I.pa||I.pa(v))}this.reloadFeatureFlags()}shutdown(t){var e=this;return f((function*(){var t,i,r,n,s;if(e.__loaded){e.Sl().dispose(),null==(t=e.sessionRecording)||t.dispose(),null==(i=e.logs)||i.flushLogs("sendBeacon"),null==(r=e.metrics)||r.flush("sendBeacon"),null==(n=e.fl)||n.unload(),null==(s=e.gl)||s.unload();try{var a;null==(a=e.featureFlags)||a.destroy()}catch(t){Bi.error("Error while destroying feature flags",t)}}else Bi.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.Bl()}clearIdentity(){var t;delete this.config.identity_distinct_id,delete this.config.identity_hash,null==(t=this.conversations)||t.Hl()}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(fn)?(Bi.critical("Attempting to create alias for existing People user - aborting."),-2):this.$l("posthog.alias")?(K(e)&&(e=this.get_distinct_id()),t!==e?(this.Nl(yn,t),this.capture("$create_alias",{alias:t,distinct_id:e})):(Bi.warn("alias matches current distinct_id - skipping api call."),this.identify(t),-1)):void 0}set_config(t){var e=p({},this.config);if(Q(t)){var i,r,n,s,a,o,l,u,h,d,v,c;Wi(this.config,pk(t));var f=this.el();null==(i=this.persistence)||i.update_config(this.config,e,f),this.sessionPersistence="sessionStorage"===this.config.persistence||"memory"===this.config.persistence?this.persistence:new dw(p({},this.config,{persistence:"sessionStorage"}),f,!1);var g,m=this.dl(this.config.debug);nt(m)&&(this.config.debug=m),nt(this.config.debug)&&(this.config.debug?(qi.DEBUG=!0,hp.Xr()&&hp.ei("ph_debug",!0),Bi.info("set_config",{config:t,oldConfig:e,newConfig:p({},this.config)})):(qi.DEBUG=!1,hp.Xr()&&hp.ri("ph_debug"))),null==(r=this.featureFlags)||null==r.updateConfig||r.updateConfig(this.config,this.Da()),null==(n=this.exceptionObserver)||n.onConfigChange(),null==(s=this.exceptions)||s.onConfigChange(),null==(a=this.sessionRecording)||a.startIfEnabledOrStop(),null==(o=this.tracingHeaders)||o.startIfEnabledOrStop(),null==(l=this.autocapture)||l.startIfEnabled(),null==(u=this.heatmaps)||u.startIfEnabled(),("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.il(),null==(c=this.externalIntegrations)||c.startIfEnabledOrStop()}}_overrideSDKInfo(t,e){qi.LIB_NAME=t,qi.LIB_VERSION=e}startSessionRecording(t){var e,i,r,n,s,a=!0===t,o={sampling:a||!(null==t||!t.sampling),linked_flag:a||!(null==t||!t.linked_flag),url_trigger:a||!(null==t||!t.url_trigger),event_trigger:a||!(null==t||!t.event_trigger)};Object.values(o).some(Boolean)&&(null==(e=this.sessionManager)||e.checkAndGetSessionAndWindowId(),o.sampling&&(null==(i=this.sessionRecording)||i.overrideSampling()),o.linked_flag&&(null==(r=this.sessionRecording)||r.overrideLinkedFlag()),o.url_trigger&&(null==(n=this.sessionRecording)||n.overrideTrigger("url")),o.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:mk.zl}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:hk;return e!==hk&&(e=hk+"."+e),e}_isIdentified(){var t,e;return(null==(t=this.persistence)?void 0:t.get_property(fs))===Ns||(null==(e=this.sessionPersistence)?void 0:e.get_property(fs))===Ns}Dl(){var t,e;return!("never"===this.config.person_profiles||this.config.person_profiles===qs&&!this._isIdentified()&&J(this.getGroups())&&(null==(t=this.persistence)||null==(t=t.props)||!t[yn])&&(null==(e=this.persistence)||null==(e=e.props)||!e[_s]))}Pl(){return!0===this.config.capture_pageleave||"if_capture_pageview"===this.config.capture_pageleave&&!!this.config.capture_pageview}createPersonProfile(){this.Dl()||this.$l("posthog.createPersonProfile")&&this.setPersonProperties({},{})}setInternalOrTestUser(){this.$l("posthog.setInternalOrTestUser")&&this.setPersonProperties({$internal_or_test_user:!0})}$l(t){return"never"===this.config.person_profiles?(Bi.error(t+' was called, but process_person is set to "never". This call will be ignored.'),!1):(this.Nl(_s,!0),!0)}el(){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!==Ls)}il(){var t,e,i,r,n,s=this.el();return this.is_capturing()||null==(i=this.logs)||i.Ul(),(null==(t=this.persistence)?void 0:t.la)!==s&&(null==(r=this.persistence)||r.set_disabled(s)),(null==(e=this.sessionPersistence)?void 0:e.la)!==s&&(null==(n=this.sessionPersistence)||n.set_disabled(s)),s&&(this.nl.clear(),this.Ll()),s}opt_in_capturing(t){var e;if(this.config.cookieless_mode!==Ds){if(this.Xo()){var i,r,n,s,a;this.jl(!0,!0),null==(i=this.sessionManager)||i.destroy(),null==(r=this.pageViewManager)||r.destroy(),this.sessionManager=new Bw(this),this.pageViewManager=new ew(this),this.persistence&&(this.sessionPropsManager=new $w(this,this.sessionManager,this.persistence));var o,l=null!==(n=null==(s=this.config.__extensionClasses)?void 0:s.sessionRecording)&&void 0!==n?n:null==(a=mk.__defaultExtensionClasses)?void 0:a.sessionRecording;l&&(this.sessionRecording=this.Yo(this.sessionRecording,new l(this)),this.Go&&(null==(o=this.sessionRecording)||null==o.onRemoteConfig||o.onRemoteConfig(this.Go)))}var u,h;this.consent.optInOut(!0),this.il(),this.El(),null==(e=this.sessionRecording)||e.startIfEnabledOrStop(),this.config.cookieless_mode==Ls&&(null==(u=this.surveys)||u.loadIfEnabled()),(K(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.Il()}else Bi.warn(sk)}opt_out_capturing(){var t,e,i;this.config.cookieless_mode!==Ds?(this.config.cookieless_mode===Ls&&this.consent.isOptedIn()&&this.jl(!0,!0),this.consent.optInOut(!1),this.il(),this.config.cookieless_mode===Ls&&(this.register({distinct_id:ws,$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.Il(),this.El())):Bi.warn(sk)}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===Ds||(this.config.cookieless_mode===Ls?this.consent.isRejected()||this.consent.isOptedIn():!this.has_opted_out_capturing())}clear_opt_in_out_capturing(){this.consent.reset(),this.il()}_is_bot(){return i?Hw(i,this.config.custom_blocked_useragents):void 0}Il(){r&&("visible"===r.visibilityState?this.ol||(this.ol=!0,this.capture(Hs,{title:r.title},{send_instantly:!0}),this.ll&&(r.removeEventListener(js,this.ll),this.ll=null)):this.ll||(this.ll=this.Il.bind(this),Yi(r,js,this.ll)))}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}))}Da(){var t=this.vl||{};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?(Bi.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&&!et(t[e]),a=i in t&&!et(t[i]);return s?t[e]:!!a&&(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,Bi)}Hn(t){var e;if(et(this.config.before_send))return t;var i=Object.keys(null!==(e=t.properties)&&void 0!==e?e:{}).filter(ot),r=G(this.config.before_send)?this.config.before_send:[this.config.before_send],n=t;for(var s of r)try{if(n=s(n),et(n)){var a="Event '"+t.event+"' was rejected in beforeSend function";return at(t.event)?Bi.warn(a+". This can cause unexpected behavior."):Bi.info(a),null}n.properties&&!J(n.properties)||Bi.warn("Event '"+t.event+"' has no properties after beforeSend function, this is likely an error.")}catch(e){return Bi.error("Error in beforeSend function for event '"+t.event+"':",e),null}for(var o of i)if(n.properties&&et(n.properties[o]))return Bi.warn("Event '"+t.event+"' had its '"+o+"' 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.zs)?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)})}dl(t){var e=nt(t)&&!t,i=hp.Xr()&&"true"===hp.ti("ph_debug");return!e&&(!!i||t)}}mk.__defaultExtensionClasses={},mk.zl=(()=>{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]]=Zi(t.prototype[e[i]])}(mk,["identify"]);class yk{constructor(t){this._instance=t}refresh(t){var e=this._instance.config,i=Q(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.Da(),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 bk=Hi("[ExceptionAutocapture]"),_k=Hi("[TracingHeaders]"),wk=Hi("[Web Vitals]"),kk=9e5,Sk=["CLS","FCP","INP","LCP"],xk=["INP","LCP"],Ck=["interactionTarget","interactionType","inputDelay","processingDuration","presentationDelay","loadState","target","url","timeToFirstByte","resourceLoadDelay","resourceLoadDuration","elementRenderDelay","largestShiftTarget","largestShiftTime","largestShiftValue","firstByteToFCP"],Tk="[SessionRecording]",Mk=Hi(Tk),Ek=Hi("[Heatmaps]");function Ik(t){return Q(t)&&"clientX"in t&&"clientY"in t&&it(t.clientX)&&it(t.clientY)}var Rk=Hi("[Product Tours]"),Pk=t=>{var e;return!t.config.disable_product_tours&&!(null==(e=t.persistence)||!e.get_property(Mn))},Ak=["$set_once","$set"],Fk=Hi("[SiteApps]"),Ok="Error while initializing PostHog app with config id ",Lk=(t,e)=>null!=t&&t.then?t.then(e):e(t),Dk="SDK is not enabled or survey functionality is not yet loaded",$k="Disabled. Not loading surveys.";class Nk{constructor(t,e){this.name="surveys",this._surveyEventReceiver=null,this._surveyManager=null,this.Wl=!1,this.Vl=[],this.Gl=null,this.Zl=null,this.ks=!1,this.Ql=new Set,this.onRemoteConfig=t=>{if(!this.ks&&!this.nn.disableSurveys){if(!t.ok)return Bf.warn("Remote config unavailable. Not loading surveys.");var e=t.config.surveys;if(et(e))return Bf.warn("Flags not loaded yet. Not loading surveys.");this.Jl=nt(e)?e:e.length>0,Bf.info("flags response received, isSurveysEnabled: "+this.Jl),this.loadIfEnabled()}},this.Ss=t,this.Kl=e}setup(t){if(!this.ks)return this.Yl=t,Lk(t.kv.initialize(),(()=>{if(this.Yl===t&&!this.ks){this.Yl=void 0,this.Ts=t;var e=t.onRemoteConfig(this.onRemoteConfig);this.ks?e.dispose():(this.Ms=e,this.loadIfEnabled())}}))}dispose(){var t,e,i;this.ks||(this.ks=!0,this.Yl=void 0,this.Ts=void 0,null==(t=this.Ms)||t.dispose(),this.Ms=void 0,null==(e=this._surveyEventReceiver)||e.dispose(),this._surveyEventReceiver=null,null==(i=this._surveyManager)||null==i.dispose||i.dispose(),this._surveyManager=null,this.Vl=[],this.Gl=null,this.Ql.forEach((t=>clearTimeout(t))),this.Ql.clear())}get nn(){return this.Ss.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(Uf)||null!=r&&r.startsWith(Wf))&&e.push(r)}e.forEach((t=>localStorage.removeItem(t)))}catch(t){}}loadIfEnabled(){if(!this.ks&&this.Ts){var t=this.nn;if(!this._surveyManager)if(this.Wl)Bf.info("Already initializing surveys, skipping...");else if(t.disableSurveys)Bf.info($k);else if(t.cookielessMode&&this.Ss.isOptedOut())Bf.info("Not loading surveys in cookieless mode without consent.");else{var e=this.Ss.getExtensions();if(e){if(!K(this.Jl)||t.advancedEnableSurveys){var i=this.Jl||t.advancedEnableSurveys;this.Wl=!0;try{var r=e.generateSurveys;if(r)return this.Xl(r,i),void(this.Wl=!1);var n=e.loadExternalDependency;if(!n)return this.tu(Os),void(this.Wl=!1);n((t=>{try{if(this.ks)return;var e=this.Ss.getExtensions();t||null==e||!e.generateSurveys?this.tu("Could not load surveys script",t):this.Xl(e.generateSurveys,i)}finally{this.Wl=!1}}))}catch(t){throw this.Wl=!1,this.tu("Error initializing surveys",t),t}}}else Bf.error("PostHog Extensions not found.")}}}Xl(t,e){this.ks||(this._surveyManager=t(e),this._surveyEventReceiver=this.Ss.createEventReceiver(),Bf.info("Surveys loaded successfully"),this.eu({isLoaded:!0}))}tu(t,e){Bf.error(t,e),this.eu({isLoaded:!1,error:t})}onSurveysLoaded(t){return this.Vl.push(t),this._surveyManager&&this.eu({isLoaded:!0}),()=>{this.Vl=this.Vl.filter((e=>e!==t))}}getSurveys(t,e){var i;void 0===e&&(e=!1);var r=null!==(i=this.Ts)&&void 0!==i?i:this.Kl;if(r&&!this.ks){if(this.nn.disableSurveys)return Bf.info($k),t([]);var n=r.kv.get(ns);if(n&&!e)return t(n,{isLoaded:!0}),void(this.iu()&&this.getSurveys((()=>{}),!0));if(this.Gl)this.Gl.then((e=>{this.ks||t(e.surveys,e.context)})).catch((t=>Bf.error("Error in survey callback",t)));else{var s=this.ru("/api/surveys/",{method:"GET",query:{token:r.projectToken},sentAt:"query",timeoutMs:this.nn.requestTimeoutMs}).then((t=>{try{return this.nu(r,t)}catch(t){return Bf.error("Error processing surveys response",t),this.nu(r,{statusCode:0,error:t})}}),(t=>this.nu(r,{statusCode:0,error:t})));this.Gl=s;var a=()=>{this.Gl===s&&(this.Gl=null)};s.then((e=>{a(),this.ks||t(e.surveys,e.context)}),a).catch((t=>Bf.error("Error in survey callback",t)))}}}ru(t,e){var i=this.Ts;return i?i.sendRequest(t,e):new Promise((t=>t({statusCode:0,error:new Error(Dk)})))}nu(t,e){if(this.ks)return{surveys:[],context:{isLoaded:!1,error:Dk}};var i=e.statusCode;if(200!==i||!e.json){var r="Surveys API could not be loaded, status: "+i;return 0!==i?Bf.error(r):e.error||Bf.warn(r),this.Zl=Date.now(),{surveys:[],context:{isLoaded:!1,error:r}}}this.Zl=null;var n,s=e.json.surveys||[],a=s.filter((t=>Hf(t)&&(_o(t)||zf(t))));return a.length>0&&(null==(n=this._surveyEventReceiver)||n.register(a)),t.kv.set({[ns]:s,[ss]:Date.now()}),{surveys:s,context:{isLoaded:!0}}}iu(){return this.su()&&!this.Gl&&!this.au()}su(){var t,e,i=null==(t=null!==(e=this.Ts)&&void 0!==e?e:this.Kl)?void 0:t.kv.get(ss);return it(i)&&Date.now()-i>3e5}au(){return it(this.Zl)&&3e5>Date.now()-this.Zl}markSurveyAsSeen(t,e){var i,r={id:t,current_iteration:null!==(i=null==e?void 0:e.iteration)&&void 0!==i?i:null};Zf(r);try{localStorage.setItem("lastSeenSurveyDate",(new Date).toISOString())}catch(t){}}eu(t){for(var e of this.Vl)try{if(!t.isLoaded)return e([],t);this.getSurveys(e)}catch(t){Bf.error("Error in survey callback",t)}}getActiveMatchingSurveys(t,e){if(void 0===e&&(e=!1),!et(this._surveyManager))return this._surveyManager.getActiveMatchingSurveys(t,e);Bf.warn("init was not called")}ou(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}lu(t){if(et(this._surveyManager))return{eligible:!1,reason:Dk};var e="string"==typeof t?this.ou(t):t;return e?this._surveyManager.checkSurveyEligibility(e):{eligible:!1,reason:"Survey not found"}}uu(t){if(et(this._surveyManager))return{eligible:!1,reason:Dk};var e="string"==typeof t?this.ou(t):t;return e?this._surveyManager.checkSurveyRenderability(e):{eligible:!1,reason:"Survey not found"}}canRenderSurvey(t){if(et(this._surveyManager))return Bf.warn("init was not called"),{visible:!1,disabledReason:Dk};var e=this.uu(t);return{visible:e.eligible,disabledReason:e.reason}}canRenderSurveyAsync(t,e){return et(this._surveyManager)?(Bf.warn("init was not called"),Promise.resolve({visible:!1,disabledReason:Dk})):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.uu(n);i({visible:s.eligible,disabledReason:s.reason})}else i({visible:!1,disabledReason:"Survey not found"})}),e)}))}renderSurvey(t,e,i){var n;if(et(this._surveyManager))Bf.warn("init was not called");else{var s="string"==typeof t?this.ou(t):t;if(null!=s&&s.id)if(Qf.includes(s.type)){var a=null==r?void 0:r.querySelector(e);if(a)if(null!=(n=s.appearance)&&n.surveyPopupDelaySeconds){Bf.info("Rendering survey "+s.id+" with delay of "+s.appearance.surveyPopupDelaySeconds+" seconds");var o=setTimeout((()=>{var t,e;this.Ql.delete(o),this.ks||(Bf.info("Rendering survey "+s.id+" with delay of "+(null==(t=s.appearance)?void 0:t.surveyPopupDelaySeconds)+" seconds"),null==(e=this._surveyManager)||e.renderSurvey(s,a,i),Bf.info("Survey "+s.id+" rendered"))}),1e3*s.appearance.surveyPopupDelaySeconds);this.Ql.add(o)}else this._surveyManager.renderSurvey(s,a,i);else Bf.warn("Survey element not found")}else Bf.warn("Surveys of type "+s.type+" cannot be rendered in the app");else Bf.warn("Survey not found")}}displaySurvey(t,e){var i;if(et(this._surveyManager))Bf.warn("init was not called");else{var r=this.ou(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!==jf&&e.initialResponses&&Bf.warn("initialResponses is only supported for popover surveys. prefill will not be applied."),!1===e.ignoreConditions){var s=this.lu(r);if(!s.eligible)return void Bf.warn("Survey is not eligible to be displayed: ",s.reason)}"inline"!==e.displayType?this._surveyManager.handlePopoverSurvey(n,e):this.renderSurvey(n,e.selector,e.properties)}else Bf.warn("Survey not found")}}cancelPendingSurvey(t){et(this._surveyManager)?Bf.warn("init was not called"):this._surveyManager.cancelSurvey(t)}handlePageUnload(){var t;null==(t=this._surveyManager)||null==t.handlePageUnload||t.handlePageUnload()}}function qk(t,e,i){if(et(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 jk{constructor(t){this.hu=new Set,this.du=new Set,this.vu=new Nw,this.cu=(t,e)=>this.fu(t,e)&&this.pu(t,e)&&this.gu(t,e)&&this.mu(t,e),this.fu=(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;K(null==(t=this._instance)?void 0:t._addCaptureHook)||(this.yu=null==(e=this._instance)?void 0:e._addCaptureHook(((t,e)=>{this.on(t,e)})))}dispose(){var t;null==(t=this.yu)||t.call(this),this.yu=void 0,this.vu=new Nw}register(t){var e,i;if(!K(null==(e=this._instance)?void 0:e._addCaptureHook)&&(t.forEach((t=>{var e;this.hu.add(t),null==(e=t.steps)||e.forEach((t=>{this.du.add((null==t?void 0:t.event)||"")}))})),null!=(i=this._instance)&&i.autocapture)){var r=new Set;this.hu.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.hu.clear(),this.du.clear(),this.register(t)}on(t,e){null!=e&&0!=t.length&&(this.du.has(t)||this.du.has(e.event))&&this.hu.forEach((t=>{this.bu(e,t)&&this.vu.emit("actionCaptured",t.name)}))}_u(t){this.onAction("actionCaptured",(e=>t(e)))}bu(t,e){if(null==(null==e?void 0:e.steps))return!1;for(var i of e.steps)if(this.cu(t,i))return!0;return!1}onAction(t,e){return this.vu.on(t,e)}pu(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(!qk(r,e.url,e.url_matching||"contains"))return!1}return!0}gu(t,e){return!!this.wu(t,e)&&!!this.ku(t,e)&&!!this.Su(t,e)}wu(t,e){var i;if(null==e||!e.href)return!0;var r=this.xu(t);if(r.length>0)return r.some((t=>qk(t.href,e.href,e.href_matching||"exact")));var n,s=(null==t||null==(i=t.properties)?void 0:i.$elements_chain)||"";return!!s&&qk((n=s.match(/(?::|")href="(.*?)"/))?n[1]:"",e.href,e.href_matching||"exact")}ku(t,e){var i;if(null==e||!e.text)return!0;var r=this.xu(t);if(r.length>0)return r.some((t=>qk(t.text,e.text,e.text_matching||"exact")||qk(t.$el_text,e.text,e.text_matching||"exact")));var n,s,a,o=(null==t||null==(i=t.properties)?void 0:i.$elements_chain)||"";return!!o&&(n=function(t){for(var e,i=[],r=/(?::|")text="(.*?)"/g;!et(e=r.exec(t));)i.includes(e[1])||i.push(e[1]);return i}(o),s=e.text,a=e.text_matching||"exact",n.some((t=>qk(t,s,a))))}Su(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}xu(t){var e;return null==(null==t||null==(e=t.properties)?void 0:e.$elements)?[]:null==t?void 0:t.properties.$elements}mu(t,e){return null==e||!e.properties||0===e.properties.length||Co(e.properties.reduce(((t,e)=>{var i=G(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 Bk{constructor(t){var e;this.Cu=[],this._instance=t,this.Tu=new Map,this.Mu=new Map,this.Eu=new Map,this.Iu=null==(e=this._instance)||null==e.onSessionId?void 0:e.onSessionId((t=>this.Ru(t)))}Pu(t){return!1}Au(){return null}Fu(t){}Ou(){}Lu(t,e){return!!t&&Co(t.propertyFilters,null==e?void 0:e.properties)}Du(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}$u(t,e,i){var r=(i===If?this.Tu:this.Mu).get(t),n=[];return this.Nu((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.Lu(s,e)}))}register(t){this.qu(t,!1)}replace(t){this.qu(t,!0)}qu(t,e){var i;K(null==(i=this._instance)?void 0:i._addCaptureHook)||(this.ju(t,e),this.Bu(t,e))}Bu(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.Eu.clear(),0!==i.length){this.Hu||(this.Hu=new jk(this._instance),this.Hu.init(),this.Hu._u((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.Eu.get(e.name))&&void 0!==i?i:[];n.includes(t.id)||n.push(t.id),this.Eu.set(e.name,n)}}))})),e?this.Hu.replace(r):this.Hu.register(r)}else{var n;e&&(null==(n=this.Hu)||n.replace([]))}}zu(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)}))}ju(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})),a=this.Du(t,If),o=this.Du(t,Rf);e?(this.Tu=a,this.Mu=o):(this.zu(this.Tu,a),this.zu(this.Mu,o)),(0!==n.length||0!==s.length)&&(null!==(i=this.yu)&&void 0!==i||(this.yu=null==(r=this._instance)?void 0:r._addCaptureHook(((t,e)=>{this.onEvent(t,e)}))))}onEvent(t,e){var i,r,n=this.Uu(),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 a=this.Wu(t,s);if("consume"===a)return n.info("event consumed activated item, removing it",{event:t,itemId:s}),void this.Vu([s]);if("persist"===a)return n.info("shown item promoted to persisted activation",{event:t,itemId:s}),this.Gu(s),void this.Zu([s])}if(this.Mu.has(t)){var o=this.$u(t,e,Rf);o.length>0&&(n.info("cancel event matched, cancelling items",{event:t,itemsToCancel:o.map((t=>t.id))}),this.Vu(o.map((t=>t.id))),o.forEach((t=>this.Qu(t.id))))}if(this.Tu.has(t)){n.info("event name matched",{event:t,eventPayload:e,items:this.Tu.get(t)});var l=this.$u(t,e,If);this.Ju(l.map((t=>t.id)))}}onAction(t){this.Eu.has(t)&&this.Ju(this.Eu.get(t)||[])}Ju(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.Pu(n)?this.Gu(n)&&this.Ku(n):r.push(n);r.length>0&&(this.Cu=[...new Set([...this.Cu,...r])]),this.Uu().info("updating activated items",{activatedItems:this.getActivatedIds()})}}Gu(t){this.Cu=this.Cu.filter((e=>e!==t));var e=this.Yu();return!e.includes(t)&&(this.Xu([...e,t]),this.th(),!0)}Vu(t){var e=new Set(t);this.Cu=this.Cu.filter((t=>!e.has(t)));var i=this.eh(),r=i.filter((t=>!e.has(t)));r.length!==i.length&&(this.Xu(r),0===r.length&&this.ih()),this.Zu(t)}rh(){var t,e=this.Au();if(!e)return{};var i=null==(t=this._instance)||null==(t=t.persistence)?void 0:t.props[e];return i&&"object"==typeof i?i:{}}Ku(t){if(this.Au()){var e=this.rh();this.Fu(p({},e,{[t]:Date.now()}))}}Zu(t){if(this.Au()){var e=this.rh(),i={},r=!1;for(var n of Object.entries(e)){var s=n[0],a=n[1];t.includes(s)?r=!0:i[s]=a}r&&(J(i)?this.Ou():this.Fu(i))}}nh(){this.Au()&&this.Ou()}getActivationTimestamp(t){if(this.Yu().includes(t)){var e=this.rh()[t];return it(e)?e:void 0}}eh(){var t,e=this.sh();return(null==(t=this._instance)||null==(t=t.persistence)?void 0:t.props[e])||[]}Yu(){var t,e,i=this.eh();if(0===i.length)return[];var r=null==(t=this._instance)||null==(t=t.persistence)?void 0:t.props[this.ah()],n=null==(e=this._instance)||null==e.get_session_id?void 0:e.get_session_id();return n&&r===n?i:[]}th(){var t,e=null==(t=this._instance)||null==t.get_session_id?void 0:t.get_session_id();e&&this.oh(e)}ih(){this.lh()}Ru(t){var e,i=null==(e=this._instance)||null==(e=e.persistence)?void 0:e.props[this.ah()];if(i&&i!==t){var r=this.eh(),n=this.rh();r.length>0&&(this.Xu([]),r.filter((t=>it(n[t]))).forEach((t=>this.Qu(t)))),this.ih(),this.nh()}}getActivatedIds(){return[...new Set([...this.Yu(),...this.Cu])].filter((t=>!this.uh(t)))}dispose(){var t,e,i;null==(t=this.Iu)||t.call(this),this.Iu=void 0,null==(e=this.yu)||e.call(this),this.yu=void 0,null==(i=this.Hu)||i.dispose(),this.Hu=void 0}reset(){this.Cu=[],this.eh().length>0&&this.Xu([]),this.ih(),this.nh()}getEventToItemsMap(){return this.Tu}hh(){return this.Hu}}class Hk extends Bk{constructor(t){super(t)}sh(){return as}ah(){return os}Au(){return ls}Fu(t){var e;null==(e=this._instance)||null==(e=e.persistence)||e.register({[ls]:t})}Ou(){var t;null==(t=this._instance)||null==(t=t.persistence)||t.unregister(ls)}Pu(t){var e,i;this.Nu((e=>{i=e.find((e=>e.id===t))}));var r=null==(e=i)||null==(e=e.appearance)?void 0:e.surveyPopupDelaySeconds;return it(r)&&r>0}dh(){return Nf.SHOWN}Nu(t){var e;null==(e=this._instance)||e.getSurveys(t)}Qu(t){var e;null==(e=this._instance)||e.cancelPendingSurvey(t)}Uu(){return Bf}Xu(t){var e;null==(e=this._instance)||null==(e=e.persistence)||e.register({[as]:t})}oh(t){var e;null==(e=this._instance)||null==(e=e.persistence)||e.register({[os]:t})}lh(){var t;null==(t=this._instance)||null==(t=t.persistence)||t.unregister(os)}uh(){return!1}Wu(t,e){var i;return this.Nu((t=>{i=t.find((t=>t.id===e))})),!i||wo(i)?t===Nf.SHOWN?"consume":"ignore":t===Nf.SHOWN?"persist":t===Nf.DISMISSED||t===Nf.SENT?"consume":"ignore"}getSurveys(){return this.getActivatedIds()}getEventToSurveys(){return this.getEventToItemsMap()}}class zk{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);K(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 Uk{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 Hk(this._instance)}}var Wk=null!=t&&t.location?ar(t.location.hash,"__posthog")||ar(location.hash,"state"):null,Vk="_postHogToolbarParams",Gk=Hi("[Toolbar]"),Zk=Hi("[FeatureFlags]");class Qk{constructor(t,e){void 0===e&&(e=!1),this.fh=!1,this.update(t,e)}update(t,e){this.ph=((t,e)=>{var i,r,n,s,a;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,refreshIntervalMs:null!==(n=t.remote_config_refresh_interval_ms)&&void 0!==n?n:3e5,requestTimeoutMs:t.feature_flag_request_timeout_ms,compression:t.disable_compression?void 0:"best-available",evaluationContexts:null!==(s=null!==(a=t.evaluation_contexts)&&void 0!==a?a:t.evaluation_environments)&&void 0!==s?s:[],flagKeys:G(t.flag_keys)?t.flag_keys:void 0}})(t,e),!t.evaluation_environments||t.evaluation_contexts||this.fh||(Zk.warn("evaluation_environments is deprecated. Use evaluation_contexts instead. evaluation_environments will be removed in a future version."),this.fh=!0),K(t.flag_keys)||G(t.flag_keys)||Zk.error("Invalid flag_keys found:",t.flag_keys,"Expected array of non-empty strings")}get(){return this.ph}}var Jk=Hi("[FeatureFlags]"),Kk=Hi("[FeatureFlags]",{debugEnabled:!0}),Yk="\" failed. Feature flags didn't load in time.",Xk="connection_error",tS=t=>{for(var e={},i=0;t.length>i;i++)e[t[i]]=!0;return e},eS=t=>{var e={};for(var i of Vi(t||{})){var r=i[1];r&&(e[i[0]]=r)}return e},iS="Refusing to render web experiment since the viewer is a likely bot",rS={icontains:(t,e)=>e.toLowerCase().indexOf(t.toLowerCase())>-1,not_icontains:(t,e)=>-1===e.toLowerCase().indexOf(t.toLowerCase()),regex:(t,e)=>ko(e,t),not_regex:(t,e)=>!ko(e,t),exact:(t,e)=>e===t,is_not:(t,e)=>e!==t};class nS{get nn(){return this._instance.config}constructor(t){var e=this;this.getWebExperimentsAndEvaluateDisplayLogic=function(t){void 0===t&&(t=!1),e.getWebExperiments((t=>{nS.gh("retrieved web experiments from the server"),e.mh=new Map,t.forEach((t=>{if(t.feature_flag_key){var i;e.mh&&(nS.gh("setting flag key ",t.feature_flag_key," to web experiment ",t),null==(i=e.mh)||i.set(t.feature_flag_key,t));var r=e._instance.getFeatureFlag(t.feature_flag_key);Y(r)&&t.variants[r]&&e.yh(t.name,r,t.variants[r].transforms)}else if(t.variants)for(var n in t.variants){var s=t.variants[n];nS.bh(s,e._instance)&&e.yh(t.name,n,s.transforms)}}))}),t)},this._instance=t,this._instance.onFeatureFlags((t=>{this.onFeatureFlags(t)}))}initialize(){}onFeatureFlags(t){if(this._is_bot())nS.gh(iS);else if(!this.nn.disable_web_experiments){if(et(this.mh))return this.mh=new Map,this.loadIfEnabled(),void this.previewWebExperiment();nS.gh("applying feature flags",t),t.forEach((t=>{var e;if(this.mh&&null!=(e=this.mh)&&e.has(t)){var i,r=this._instance.getFeatureFlag(t),n=null==(i=this.mh)?void 0:i.get(t);r&&null!=n&&n.variants[r]&&this.yh(n.name,r,n.variants[r].transforms)}}))}}previewWebExperiment(){var t=nS.getWindowLocation();if(null!=t&&t.search){var e=nr(null==t?void 0:t.search,"__experiment_id"),i=nr(null==t?void 0:t.search,"__experiment_variant");e&&i&&(nS.gh("previewing web experiments "+e+" && "+i),this.getWebExperiments((t=>{this._h(parseInt(e),i,t)}),!1,!0))}}loadIfEnabled(){this.nn.disable_web_experiments||this.getWebExperimentsAndEvaluateDisplayLogic()}getWebExperiments(t,e,i){if(this.nn.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.nn.token),method:"GET",timestampMode:"query",callback:e=>t(200===e.statusCode&&e.json&&e.json.experiments||[])})}_h(t,e,i){var r=i.filter((e=>e.id===t));r&&r.length>0&&(nS.gh("Previewing web experiment ["+r[0].name+"] with variant ["+e+"]"),this.yh(r[0].name,e,r[0].variants[e].transforms))}static bh(t,e){return!et(t.conditions)&&nS.wh(t,e)&&nS.kh(t)}static wh(t,e){var i;if(et(t.conditions)||et(null==(i=t.conditions)?void 0:i.url))return!0;var r=nS.getWindowLocation();if(r){var n,s,a,o=ur(e,r.href);return null==(n=t.conditions)||!n.url||rS[null!==(s=null==(a=t.conditions)?void 0:a.urlMatchType)&&void 0!==s?s:"icontains"](t.conditions.url,o)}return!1}static getWindowLocation(){return null==t?void 0:t.location}static kh(t){var e;if(et(t.conditions)||et(null==(e=t.conditions)?void 0:e.utm))return!0;var i=jo();if(i.utm_source){var r,n,s,a,o,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==(a=t.conditions)||null==(a=a.utm)?void 0:a.utm_source)==i.utm_source,c=null==(o=t.conditions)||null==(o=o.utm)||!o.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 gh(t){for(var e=arguments.length,i=new Array(e>1?e-1:0),r=1;e>r;r++)i[r-1]=arguments[r];Bi.info("[WebExperiments] "+t,i)}yh(t,e,i){this._is_bot()?nS.gh(iS):"control"!==e?i.forEach((i=>{if(i.selector){var r;nS.gh("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)}))}})):nS.gh("Control variants leave the page unmodified.")}_is_bot(){return i&&this._instance?Hw(i,this.nn.custom_blocked_useragents):void 0}}var sS=Hi("[Conversations]"),aS="Conversations not available yet.";function oS(t,e){var i,r,n,s,a,o,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=K(d)?Math.max(h,2048):Math.max(h,d),c=null==t?void 0:t.resourceAttributes;return{serviceName:null!==(s=null!==(a=null==c?void 0:c["service.name"])&&void 0!==a?a:null==t?void 0:t.serviceName)&&void 0!==s?s:null==e?void 0:e.serviceNameDefault,serviceVersion:null!==(o=null==c?void 0:c["service.version"])&&void 0!==o?o: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}}var lS=["debug","log","warn","error","info"],uS="console",hS="__posthogHandledLogsRequestError",dS=(t,e)=>{var i=t instanceof Error?t:new Error(e);return i[hS]=!0,i},vS=t=>!!t&&"object"==typeof t&&!0===t[hS],cS={featureFlags:class{constructor(t){this.name=Kf,this.Sh=!1,this.featureFlagEventHandlers=[],this.I=Jk,this.xh={},this.Ch={},this.Th=[],this.Mh=!1,this.Eh=!1,this.Ih=0,this.Rh=!1,this.Ph=!1,this.Ah=!1,this.Fh=!1,this.Oh=0,this.Ht=()=>{var t=this.Lh();this.Oh=0,t&&this.reloadFeatureFlags()},this.Dh=()=>{var t,e=this.$h;K(e)||this.nn.remoteRequestsDisabled||!r||"hidden"===r.visibilityState||Date.now()-(null!==(t=this.Nh)&&void 0!==t?t:0)<e||(this.reloadFeatureFlags(),this.qh())},this.$t=()=>{"visible"===(null==r?void 0:r.visibilityState)&&this.Dh()},"get"in t?this.Ss=t:(this.jh=new Qk(t.config,t.Da()),this.Ss=this.jh)}updateConfig(t,e){var i;null==(i=this.jh)||i.update(t,e),this.Ts&&this.Bh()}setup(t){return this.Yl=t,this.I=t.logger.createLogger("[FeatureFlags]"),Lk(t.kv.initialize(),(()=>{this.Yl===t&&(this.Yl=void 0,this.Ts=t,this.Hh(t))}))}Hh(e){if(this.Ts===e)return t&&Yi(t,"online",this.Ht),this.Bh(),this.zh=e.registerDynamicEventProperties((()=>this.Uh()?this.xh:this.Ch)),this.Wh(),this.initialize()}Bh(){var t=this.nn.refreshIntervalMs,e=!this.nn.remoteRequestsDisabled&&r&&!K(t)&&t>0?t:void 0;e!==this.$h&&(this.Vh(),K(e)||(this.$h=e,this.qh(),null!=r&&r.addEventListener&&Yi(r,js,this.$t)))}qh(){K(this.$h)||(K(this.Gh)||clearInterval(this.Gh),this.Nh=Date.now(),this.Gh=setInterval(this.Dh,this.$h))}Vh(){K(this.Gh)||(clearInterval(this.Gh),this.Gh=void 0,null==r||null==r.removeEventListener||r.removeEventListener(js,this.$t)),this.$h=void 0,this.Nh=void 0}destroy(){this.Zh()}dispose(){this.Zh()}Zh(){var e;this.Vh(),this.Ih++,this.Ph=!1,this.Yl=void 0,this.Ts&&(this.Qh(),null==(e=this.zh)||e.dispose(),this.zh=void 0,this.Th=[],null==t||t.removeEventListener("online",this.Ht),this.Ts=void 0)}get nn(){return this.Ss.get()}Jh(t){var e;return null==(e=this.Ts)?void 0:e.kv.get(t)}ei(t){this.Kh((()=>{var e;return null==(e=this.Ts)?void 0:e.kv.set(t)}))}ri(t){this.Kh((()=>{var e;return null==(e=this.Ts)?void 0:e.kv.remove(t)}))}Kh(t){try{t()}catch(t){this.I.error("Failed to update feature flag persistence",t)}}Wh(){var t={};for(var e of[Gn,Jn,Kn,Xn]){var i=this.Jh(e);K(i)||(t[e]=i)}this.xh=t;var r=p({},t),n=this.Jh(Vn);if(n)for(var s of Object.entries(n))r["$feature/"+s[0]]=s[1];this.Ch=r}Uh(){var t=this.nn.cacheTtlMs;if(!t||0>=t)return!1;var e=this.Jh(cs);return"number"!=typeof e||Date.now()-e>t}Yh(){return!!this.Uh()&&(this.Fh||this.Eh||(this.Fh=!0,this.I.warn("Feature flag cache is stale, triggering refresh..."),this.reloadFeatureFlags()),!0)}Xh(){var t=this.nn.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})):[]}td(){var t=this.nn.flagKeys;if(!K(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.nn,r=null!==(t=null==(e=i.bootstrap)?void 0:e.featureFlags)&&void 0!==t?t:{};if(Object.keys(r).length){var n,s,a=null!==(n=null==(s=i.bootstrap)?void 0:s.featureFlagPayloads)&&void 0!==n?n:{},o=Object.keys(r).filter((t=>!!r[t])).reduce(((t,e)=>(t[e]=r[e]||!1,t)),{}),l=Object.keys(a).filter((t=>o[t])).reduce(((t,e)=>(t[e]=a[e],t)),{});return this.ed({featureFlags:o,featureFlagPayloads:l})}}updateFlags(t,e,i){var r,n,s=null!=i&&i.merge&&null!==(r=this.Jh(Vn))&&void 0!==r?r:{},a=null!=i&&i.merge&&null!==(n=this.Jh(Jn))&&void 0!==n?n:{},o=p({},s,t),l=p({},a,e),u={};for(var h of Object.entries(o)){var d=h[0],v=h[1];u[d]={key:d,enabled:_(v),variant:w(v),reason:void 0,metadata:K(null==l?void 0:l[d])?void 0:{id:0,version:void 0,description:void 0,payload:l[d]}}}this.ed({flags:u})}get hasLoadedFlags(){return this.Mh}getFlags(){return Object.keys(this.getFlagVariants())}getFlagsWithDetails(){var t=this.Jh(Qn),e=this.Jh(Xn),i=this.Jh(ts);if(!i&&!e)return t||{};var r=Wi({},t||{}),n=[...new Set([...Object.keys(i||{}),...Object.keys(e||{})])];for(var s of n){var a,o,l=r[s],u=null==e?void 0:e[s],h=K(u)?null!==(a=null==l?void 0:l.enabled)&&void 0!==a&&a:!!u,d=K(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==(o=l.metadata)?void 0:o.payload})),r[s]=c}return this.Sh||(this.I.warn(" Overriding feature flag details!",{flagDetails:t,overriddenPayloads:i,finalDetails:r}),this.Sh=!0),r}getAllFeatureFlags(){var t=this.getFlagVariants(),e=this.getFlagPayloads();return Object.keys(t).map((i=>{var r=t[i];return{key:i,enabled:_(r),variant:w(r),payload:b(e[i])}}))}getFlagVariants(){var t=this.Jh(Vn),e=this.Jh(Xn);if(!e)return t||{};for(var i=Wi({},t||{}),r=Object.keys(e),n=0;r.length>n;n++)i[r[n]]=e[r[n]];return this.Sh||(this.I.warn(" Overriding feature flags!",{enabledFlags:t,overriddenFlags:e,finalFlags:i}),this.Sh=!0),i}getFlagPayloads(){var t=this.Jh(Jn),e=this.Jh(ts);if(!e)return t||{};for(var i=Wi({},t||{}),r=Object.keys(e),n=0;r.length>n;n++)i[r[n]]=e[r[n]];return this.Sh||(this.I.warn(" Overriding feature flag payloads!",{flagPayloads:t,overriddenPayloads:e,finalPayloads:i}),this.Sh=!0),i}reloadFeatureFlags(){this.Rh||this.nn.featureFlagsDisabled||this.Lh()||this.rd||(this.Th.slice().forEach((t=>{try{t()}catch(t){this.I.error("Error while running feature flags reloading callback",t)}})),this.rd=setTimeout((()=>{this.nd()}),5))}Qh(){clearTimeout(this.rd),this.rd=void 0}onReloading(t){return this.Th.push(t),()=>{this.Th=this.Th.filter((e=>e!==t))}}ensureFlagsLoaded(){this.Mh||this.Eh||this.rd||this.reloadFeatureFlags()}setAnonymousDistinctId(t){this.$anon_distinct_id=t}setReloadingPaused(t){this.Rh=t}resetFlagCallReported(){this.ri(hs)}nd(t){this.Qh();var e=this.Ts;if(e&&!this.nn.remoteRequestsDisabled&&!this.Lh())if(this.Eh)this.Ph=!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.Jh(es)||{},{$lib:e.library.name,$lib_version:e.library.version}),group_properties:this.Jh(is),timezone:Zo()};K(e.deviceId)||(i.$device_id=e.deviceId),(null!=t&&t.disableFlags||this.nn.featureFlagsDisabled)&&(i.disable_flags=!0);var r=this.Xh();r.length&&(i.evaluation_contexts=r);var n=this.td();K(n)||(i.flag_keys=n);var s=this.nn.onlyEvaluateSurveyFeatureFlags,a="/flags/?v=2"+(s?"&only_evaluate_survey_feature_flags=true":""),o=this.Ih;this.Eh=!0;var l=()=>{this.Ph&&(this.Ph=!1,this.nd())},u=t=>{this.Eh=!1,o===this.Ih?(this.ei({[vs]:[Xk]}),this.I.error("Feature flag request failed",t),l()):l()};try{e.sendRequest(a,{target:"flags",method:"POST",body:i,compression:this.nn.compression,sentAt:"body",timeoutMs:this.nn.requestTimeoutMs}).then((t=>{var e,r,n=null!==(e=t.json)&&void 0!==e?e:{},a=200!==t.statusCode;if(this.Eh=!1,o===this.Ih){if(this.sd(t.statusCode),a||this.Ph||(this.$anon_distinct_id=void 0),!i.disable_flags||this.Ph){this.Ah=!a;var u=[];t.error?u.push(t.error instanceof Error&&"AbortError"===t.error.name?"timeout":t.error instanceof Error?Xk:"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.ei({[vs]: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.ed(n,a,{partialResponse:s}),l()}}else l()})).catch(u)}catch(t){u(t)}}}Lh(){return or(this.Oh,3)}sd(t){this.Oh=lr(t,this.Oh,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.Ah)if(this.Mh||this.getFlags()&&this.getFlags().length>0){if(!this.Yh()){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+Yk)}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.Ah)if(this.Mh||this.getFlags()&&this.getFlags().length>0){if(!this.Yh()){var i,r=this.getFlagVariants(),n=t in r,s=r[t],a=this.getFlagPayloads()[t],o=String(s),l=this.Jh(Kn)||void 0,u=this.Jh(cs)||void 0,h=this.Jh(hs)||{};if(this.nn.deduplicateCallsPerSession){var d,v=null==(d=this.Ts)?void 0:d.session.sessionId,c=this.Jh(ds);v&&v!==c&&(h={},i=v)}if(e.send_event||!("send_event"in e))if(t in h&&h[t].includes(o))i&&this.ei({[hs]:h,[ds]:i});else{var f,g,m,y,_,w,k,S,x,C,T,M;G(h[t])?h[t].push(o):h[t]=[o],this.ei(p({[hs]:h},i?{[ds]:i}:{}));var E=this.getFeatureFlagDetails(t),I=[...null!==(f=this.Jh(vs))&&void 0!==f?f:[]];K(s)&&I.push("flag_missing");var R={$feature_flag:t,$feature_flag_response:s,$feature_flag_payload:null!=a?a:null,$feature_flag_request_id:l,$feature_flag_evaluated_at:u,$feature_flag_bootstrapped_response:null!==(g=null==(m=this.nn.bootstrap)||null==(m=m.featureFlags)?void 0:m[t])&&void 0!==g?g:null,$feature_flag_bootstrapped_payload:null!==(y=null==(_=this.nn.bootstrap)||null==(_=_.featureFlagPayloads)?void 0:_[t])&&void 0!==y?y:null,$used_bootstrap_value:!this.Ah};K(null==E||null==(w=E.metadata)?void 0:w.has_experiment)||(R.$feature_flag_has_experiment=E.metadata.has_experiment),K(null==E||null==(k=E.metadata)?void 0:k.version)||(R.$feature_flag_version=E.metadata.version);var P,A=null!==(S=null==E||null==(x=E.reason)?void 0:x.description)&&void 0!==S?S:null==E||null==(C=E.reason)?void 0:C.code;A&&(R.$feature_flag_reason=A),null!=E&&null!=(T=E.metadata)&&T.id&&(R.$feature_flag_id=E.metadata.id),K(null==E?void 0:E.original_variant)&&K(null==E?void 0:E.original_enabled)||(R.$feature_flag_original_response=K(E.original_variant)?E.original_enabled:E.original_variant),null!=E&&null!=(M=E.metadata)&&M.original_payload&&(R.$feature_flag_original_payload=null==E||null==(P=E.metadata)?void 0:P.original_payload),I.length&&(R.$feature_flag_error=I.join(",")),this.ad(R)}else i&&this.ei({[hs]:h,[ds]:i});if(n)return{key:t,enabled:!!s,variant:"string"==typeof s?s:void 0,payload:b(a)}}}else this.I.warn('getFeatureFlagResult for key "'+t+Yk)}ad(t){try{var e;null==(e=this.Ts)||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.od(t,e)}od(t,e){var i=this;return f((function*(){var r=i.Ts;if(r){var n={distinct_id:r.distinctId,token:r.projectToken,person_properties:{$lib:r.library.name,$lib_version:r.library.version}},s=i.Xh();s.length&&(n.evaluation_contexts=s);var a,o=i.td();K(o)||(n.flag_keys=o);try{var l,u=null==(l=(yield r.sendRequest("/flags/?v=2",{target:"flags",method:"POST",body:n,compression:i.nn.compression,sentAt:"body",timeoutMs:i.nn.requestTimeoutMs})).json)?void 0:l.featureFlagPayloads;a=(null==u?void 0:u[t])||void 0}catch(t){return void i.I.error("Remote config feature flag request failed",t)}try{e(a)}catch(t){i.I.error("Remote config feature flag callback failed",t)}}}))()}isFeatureEnabled(t,e){if(void 0===e&&(e={}),e.fresh&&!this.Ah)return e.defaultValue;if(!(this.Mh||this.getFlags()&&this.getFlags().length>0))return this.I.warn('isFeatureEnabled for key "'+t+Yk),e.defaultValue;var i=this.getFeatureFlag(t,e);return K(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.ed(t,e,i)}ed(t,e,i){if(this.Ts){this.Mh=!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=Jk);var a=((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),o=a.flags,l=a.featureFlags,u=a.featureFlagPayloads;if(l){var h=t.requestId,d=t.evaluatedAt;if(G(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{[Gn]:l,[Vn]:v,[Yn]:!1}}var f=l,g=u,m=o;if(null!=n&&n.partialResponse)f=p({},e,f),g=p({},i,g),m=p({},r,m);else if(t.errorsWhileComputingFlags)if(o){var y=new Set(Object.keys(o).filter((t=>{var e;return!(null!=(e=o[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({[Gn]:Object.keys(eS(f)),[Vn]:f||{},[Jn]:g||{},[Qn]:m||{},[Yn]:!0===t.minimalFlagCalledEvents},h?{[Kn]:h}:{},d?{[cs]:d}:{})}}(t,this.getFlagVariants(),this.getFlagPayloads(),this.getFlagsWithDetails(),i,this.I);r&&this.ei(r),e||(this.Fh=!1),this.ld(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.ud(t)}ud(t){if(this.Ts){if(!1===t)return this.ri([Xn,ts]),this.ld(),void Kk.info("All overrides cleared");if(G(t))return this.ei({[Xn]:tS(t)}),this.ld(),void Kk.info("Flag overrides set",{flags:t});if(t&&"object"==typeof t&&("flags"in t||"payloads"in t)){var e,i=t;this.Sh=Boolean(null!==(e=i.suppressWarning)&&void 0!==e&&e);var r={},n=i.flags,s=i.payloads;return n&&(r[Xn]=G(n)?tS(n):n),s&&(r[ts]=s),Object.keys(r).length&&this.ei(r),!1===n&&!1===s?this.ri([Xn,ts]):!1===n?this.ri(Xn):!1===s&&this.ri(ts),this.ld(),!1===n?Kk.info("Flag overrides cleared"):n&&Kk.info("Flag overrides set",{flags:n}),void(!1===s?Kk.info("Payload overrides cleared"):s&&Kk.info("Payload overrides set",{payloads:s}))}if(t&&"object"==typeof t)return this.ei({[Xn]:t}),this.ld(),void Kk.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.Mh){var e=this.hd(),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.Jh(Zn)||[]).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 a=p({},this.getFlagVariants(),{[t]:e});this.ei({[Gn]:Object.keys(eS(a)),[Vn]:a,[es]:p({},this.Jh(es)||{},n)}),this.ld();try{var o;null==(o=this.Ts)||o.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.Jh(Zn);!r||e?this.dd(t,i):t(r)}dd(t,e){var i=this;return f((function*(){var r=i.Ts;if(r){var n,s=e?"&"+e.map((t=>"stage="+t)).join("&"):"";try{var a=yield r.sendRequest("/api/early_access_features/?token="+r.projectToken+s,{target:"api",method:"GET",sentAt:"query"});if(!a.json)return;i.ei({[Zn]:n=a.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)}}}))()}hd(){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)),{})}}ld(t){this.Wh();var e=this.hd(),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.vd(t,e)}vd(t,e){void 0===e&&(e=!0);var i=this.Jh(es)||{},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 a in n)({}).hasOwnProperty.call(n,a)&&(a in i||(s[a]=n[a]));this.ei({[es]:p({},i,s,r)}),e&&this.reloadFeatureFlags()}unsetPersonPropertiesForFlags(t,e){void 0===e&&(e=!0);var i=p({},this.Jh(es)||{});t.forEach((t=>{delete i[t]})),this.ei({[es]:i}),e&&this.reloadFeatureFlags()}resetPersonPropertiesForFlags(t){void 0===t&&(t=!0),this.ri(es),t&&this.reloadFeatureFlags()}setGroupPropertiesForFlags(t,e){void 0===e&&(e=!0);var i=this.Jh(is)||{},r=p({},i);for(var n of Object.keys(t))r[n]=p({},i[n],t[n]);this.ei({[is]:r}),e&&this.reloadFeatureFlags()}resetGroupPropertiesForFlags(t){if(t){var e=this.Jh(is)||{};this.ei({[is]:p({},e,{[t]:{}})})}else this.ri(is)}reset(){this.Ih++,this.Ph=!1,this.xh={},this.Ch={},this.Mh=!1,this.Rh=!1,this.Ah=!1,this.$anon_distinct_id=void 0,this.Qh(),this.Sh=!1,this.Oh=0}}},fS={sessionRecording:class{get nn(){return this._instance.config}get uo(){return this._instance.persistence}get started(){var t;return!(null==(t=this.fd)||!t.isStarted)}get status(){var t,e;return this.pd===Ys||this.pd===Xs?this.pd:null!==(t=null==(e=this.fd)?void 0:e.status)&&void 0!==t?t:this.pd}constructor(e){if(this._forceAllowLocalhostNetworkCapture=!1,this.pd=Vs,this.gd=void 0,this.md=!1,this.Dt=(()=>{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.$t=()=>{var t;"visible"===(null==r?void 0:r.visibilityState)&&(this.Dt=!0,null==(t=this.fd)||null==t.setDocumentWasEverVisible||t.setDocumentWasEverVisible(!0))},this._instance=e,!this._instance.sessionManager)throw Mk.error("started without valid sessionManager"),new Error(Tk+" started without valid sessionManager. This is a bug.");if(this.nn.cookieless_mode===Ds)throw new Error(Tk+' cannot be used with cookieless_mode="always"');null!=r&&r.addEventListener&&Yi(r,"visibilitychange",this.$t)}initialize(){this.startIfEnabledOrStop()}dispose(){this.md=!0,null==r||null==r.removeEventListener||r.removeEventListener("visibilitychange",this.$t),this.stopRecording()}get yd(){var e,i=!(null==(e=this._instance.get_property(Rn))||!e.enabled),r=!this.nn.disable_session_recording,n=this.nn.disable_session_recording||this._instance.consent.isOptedOut();return t&&i&&r&&!n}startIfEnabledOrStop(t){var e;if(!(this.md||this.yd&&null!=(e=this.fd)&&e.isStarted)){var i=!K(Object.assign)&&!K(Array.from);this.yd&&i?(this.bd(t),Mk.info("starting")):(this.pd=Vs,this.stopRecording())}}bd(t){var e,i,r;this.yd&&(this.pd!==Ys&&this.pd!==Xs&&(this.pd=Ks),null!=v&&null!=(e=v.__PosthogExtensions__)&&null!=(e=e.rrweb)&&e.record&&null!=(i=v.__PosthogExtensions__)&&i.initSessionRecording?this._d(t):null==(r=v.__PosthogExtensions__)||null==r.loadExternalDependency||r.loadExternalDependency(this._instance,this.wd,(e=>{if(e)return this._instance.register_for_session({[Cs]:!0}),Mk.error("could not load recorder",e);this._d(t)})))}stopRecording(){var t,e;null==(t=this.gd)||t.call(this),this.gd=void 0,null==(e=this.fd)||e.stop()}kd(){var t,e;null==(t=this.gd)||t.call(this),this.gd=void 0,null==(e=this.fd)||e.discard()}Sd(){var t,e;null==(t=this.uo)||t.unregister($n),null==(e=this.uo)||e.unregister(Pn)}xd(t,e){if(et(t))return null;var i,r=it(t)?t:parseFloat(t);return"number"!=typeof(i=r)||!Number.isFinite(i)||0>i||i>1?(Mk.warn(e+" must be between 0 and 1. Ignoring invalid value:",t),null):r}Cd(t){if(this.uo){var e,i,r=this.uo,n=()=>{var e,i=!1===t.sessionRecording?void 0:t.sessionRecording,n=this.xd(null==(e=this.nn.session_recording)?void 0:e.sampleRate,"session_recording.sampleRate"),s=this.xd(null==i?void 0:i.sampleRate,"remote config sampleRate"),a=null!=n?n:s;et(a)&&this.Sd();var o=null==i?void 0:i.minimumDurationMilliseconds;r.register({[Rn]: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:a,minimumDurationMilliseconds:K(o)?null:o,endpoint:null==i?void 0:i.endpoint,triggerMatchType:null==i?void 0:i.triggerMatchType,masking:null==i?void 0:i.masking,urlTriggers:null==i?void 0:i.urlTriggers,version:null==i?void 0:i.version,triggerGroups:null==i?void 0:i.triggerGroups})})};n(),null==(e=this.gd)||e.call(this),this.gd=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.Cd(e),void this.kd()):(this.Cd(e),void this.startIfEnabledOrStop()):(this.pd===Ys&&(this.pd=Xs,Mk.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.fd)&&i.log?this.fd.log(t,e):Mk.warn("log called before recorder was ready")}get wd(){var t,e,i=null==(t=this._instance)||null==(t=t.persistence)?void 0:t.get_property(Rn);return(null==i||null==(e=i.scriptConfig)?void 0:e.script)||"lazy-recorder"}Td(){var t,e=this._instance.get_property(Rn);if(!e)return!1;try{t="object"==typeof e?e:JSON.parse(e)}catch(t){return Mk.warn("persisted remote config for session recording is invalid and will be ignored",t),!1}return!et(t.cache_timestamp)&&Date.now()-t.cache_timestamp<=_l}_d(t){var e,i,r;if(!this.md){if(null==(e=v.__PosthogExtensions__)||!e.initSessionRecording)return Mk.warn("Called on script loaded before session recording is available. This can be caused by adblockers."),void this._instance.register_for_session({[Cs]:!0});var n;if(this.fd||(this.fd=null==(n=v.__PosthogExtensions__)?void 0:n.initSessionRecording(this._instance,this.Dt),this.fd._forceAllowLocalhostNetworkCapture=this._forceAllowLocalhostNetworkCapture),!this.Td()){if(this.pd===Xs||this.pd===Ys)return;return this.pd=Ys,Mk.info("persisted remote config is stale, requesting fresh config before starting"),void new pw(this._instance).load()}this.pd=Ks,null==(i=(r=this.fd).setDocumentWasEverVisible)||i.call(r,this.Dt),this.fd.start(t)}}onRRwebEmit(t){var e;null==(e=this.fd)||null==e.onRRwebEmit||e.onRRwebEmit(t)}overrideLinkedFlag(){var t,e;this.fd||null==(e=this.uo)||e.register({[Fn]:!0}),null==(t=this.fd)||t.overrideLinkedFlag()}overrideSampling(){var t,e;this.fd||null==(e=this.uo)||e.register({[An]:!0}),null==(t=this.fd)||t.overrideSampling()}overrideTrigger(t){var e,i;this.fd||null==(i=this.uo)||i.register({["url"===t?On:Ln]:!0}),null==(e=this.fd)||e.overrideTrigger(t)}get sdkDebugProperties(){var t;return(null==(t=this.fd)?void 0:t.sdkDebugProperties)||{$recording_status:this.status}}tryAddCustomEvent(t,e){var i;return!(null==(i=this.fd)||!i.tryAddCustomEvent(t,e))}}},pS={autocapture:class extends I_{constructor(t){super(new yk(t)),this.instance=t}},historyAutocapture:class{constructor(t){this._instance=t,this.Md=this.Ed()}initialize(){this.startIfEnabled()}get isEnabled(){var t=this.Id();return!!(t.path||t.search||this.Rd(t))}startIfEnabled(){this.isEnabled&&(Bi.info("History API monitoring enabled, starting..."),this.monitorHistoryChanges())}startIfEnabledOrStop(){this.stop(),this.Md=this.Ed(),this.startIfEnabled()}stop(){this.Pd&&this.Pd(),this.Pd=void 0,this.Ad&&this.Ad(),this.Ad=void 0,Bi.info("History API monitoring stopped")}monitorHistoryChanges(){t&&t.history&&(this.Fd("pushState"),this.Fd("replaceState"),this.Od(),this.Rd()&&this.Ld())}Fd(e){var i;if(t&&(null==(i=t.history[e])||!i.__posthog_wrapped__)){var r=this;Dv(t.history,e,(t=>function(i,n,s){t.call(this,i,n,s),r.Dd(e)}))}}Ed(){var e=null==t?void 0:t.location;if(null!=e&&e.pathname)return{pathname:e.pathname,search:e.search,hash:e.hash}}Id(){var t=this._instance.config.capture_pageview;return"history_change"===t?{path:!0}:Q(t)?t:{}}Rd(t){return void 0===t&&(t=this.Id()),!!t.hash&&!this._instance.config.disable_capture_url_hashes}$d(t){var e=this.Id(),i=this.Md;return!(!i||!(e.path&&t.pathname!==i.pathname||e.search&&t.search!==i.search||this.Rd(e)&&t.hash!==i.hash))}Dd(t){try{var e=this.Ed();if(!e)return;this.$d(e)&&this._instance.capture(Hs,{navigation_type:t}),this.Md=e}catch(e){Bi.error("Error capturing "+t+" pageview",e)}}Od(){if(!this.Pd){var e=()=>{this.Dd("popstate")};Yi(t,"popstate",e),this.Pd=()=>{t&&t.removeEventListener("popstate",e)}}}Ld(){if(!this.Ad){var e=()=>{this.Dd("hashchange")};Yi(t,"hashchange",e),this.Ad=()=>{t&&t.removeEventListener("hashchange",e)}}}},heatmaps:class{get nn(){return this.instance.config}constructor(t){var e;this.Nd=!1,this.ys=!1,this.qd=null,this.instance=t,this.Nd=!(null==(e=this.instance.persistence)||!e.props[wn]),this.rageclicks=new S_(t.config.rageclick)}initialize(){this.startIfEnabled()}get flushIntervalMilliseconds(){var t=5e3;return Q(this.nn.capture_heatmaps)&&this.nn.capture_heatmaps.flush_interval_milliseconds&&(t=this.nn.capture_heatmaps.flush_interval_milliseconds),t}get isEnabled(){return et(this.nn.capture_heatmaps)?et(this.nn.enable_heatmaps)?this.Nd:this.nn.enable_heatmaps:!1!==this.nn.capture_heatmaps}startIfEnabled(){if(this.isEnabled){if(this.ys)return;Ek.info("starting..."),this.jd(),this.$t()}else{var t;clearInterval(null!==(t=this.qd)&&void 0!==t?t:void 0),this.Bd(),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({[wn]:i}),this.Nd=i,this.startIfEnabled()}}}getAndClearBuffer(){var t=this.At;return this.At=void 0,t}Hd(t){Ik(t.originalEvent)&&this.Hi(t.originalEvent,"deadclick")}$t(){this.qd&&clearInterval(this.qd),this.qd=function(t){return"visible"===(null==t?void 0:t.visibilityState)}(r)?setInterval(this.Ya.bind(this),this.flushIntervalMilliseconds):null}jd(){t&&r&&(this.zd=this.Ya.bind(this),Yi(t,Bs,this.zd),this.Ud=e=>this.Hi(e||(null==t?void 0:t.event)),Yi(r,"click",this.Ud,{capture:!0}),this.Wd=e=>this.Vd(e||(null==t?void 0:t.event)),Yi(r,"mousemove",this.Wd,{capture:!0}),this.Gd=new J_(this.instance,Z_,this.Hd.bind(this)),this.Gd.startIfEnabledOrStop(),this.Zd=this.$t.bind(this),Yi(r,js,this.Zd),this.ys=!0)}Bd(){var e;t&&r&&(this.zd&&t.removeEventListener(Bs,this.zd),this.Ud&&r.removeEventListener("click",this.Ud,{capture:!0}),this.Wd&&r.removeEventListener("mousemove",this.Wd,{capture:!0}),this.Zd&&r.removeEventListener(js,this.Zd),clearTimeout(this.Qd),null==(e=this.Gd)||e.stop(),this.ys=!1)}Jd(e,i){var r=this.instance.scrollManager.scrollY(),n=this.instance.scrollManager.scrollX(),s=this.instance.scrollManager.scrollElement(),a=function(e,i,r){for(var n=e;n&&gr(n)&&!mr(n,"body");){if(n===r)return!1;var s=void 0;try{var a,o,l;s=null==(a=null!==(o=null==(l=n.ownerDocument)?void 0:l.defaultView)&&void 0!==o?o:t)?void 0:a.getComputedStyle(n).position}catch(t){return!1}if(j(i,s))return!0;n=Ir(n)}return!1}(Tr(e),["fixed","sticky"],s);return{x:e.clientX+(a?0:n),y:e.clientY+(a?0:r),target_fixed:a,type:i}}Hi(t,e){var i;if(void 0===e&&(e="click"),!pr(t.target)&&Ik(t)){var r=this.Jd(t,e);null!=(i=this.rageclicks)&&i.isRageClick(t.clientX,t.clientY,(new Date).getTime())&&$r(Tr(t),this.instance.config.rageclick)&&this.ss(p({},r,{type:"rageclick"})),this.ss(r)}}Vd(t){!pr(t.target)&&Ik(t)&&(clearTimeout(this.Qd),this.Qd=setTimeout((()=>{this.ss(this.Jd(t,"mousemove"))}),500))}ss(e){if(t){var i=this.nn.disable_capture_url_hashes?Te(t.location.href):t.location.href,r=this.nn.custom_personal_data_properties,n=this.nn.mask_personal_data_properties?[...Do,...r||[]]:[],s=sr(i,n,No);this.At=this.At||{},this.At[s]||(this.At[s]=[]),this.At[s].push(e)}}Ya(){this.At&&!J(this.At)&&this.instance.capture("$$heatmap",{$heatmap_data:this.getAndClearBuffer()})}},deadClicksAutocapture:J_,webVitalsAutocapture:class{constructor(t){var e;this.Nd=!1,this.ys=!1,this.At={navigationKey:void 0,url:void 0,metrics:[],firstMetricTimestamp:void 0},this.Kd=()=>{clearTimeout(this.Yd),this.Yd=void 0,0!==this.At.metrics.length&&(this._instance.capture("$web_vitals",p({$current_url:this.At.url},this.At.metrics.reduce(((t,e)=>p({},t,{["$web_vitals_"+e.name+"_event"]:p({},e),["$web_vitals_"+e.name+"_value"]:e.value})),{}))),this.At={navigationKey:void 0,url:void 0,metrics:[],firstMetricTimestamp:void 0})},this.Xd=t=>{var e;if(this.At=this.At||{navigationKey:void 0,url:void 0,metrics:[],firstMetricTimestamp:void 0},et(null==t?void 0:t.name)||et(null==t?void 0:t.value))wk.error("Invalid metric received",t);else{var i="string"==typeof t.navigationURL?t.navigationURL:void 0,r=this.tv(i);if(!K(r)){var n=it(t.navigationId)||"string"==typeof t.navigationId?"navigation:"+t.navigationId:"url:"+r;if(!this.ev||this.ev>t.value){this.At.navigationKey!==n&&(this.Kd(),this.Yd=setTimeout(this.Kd,this.flushToCaptureTimeoutMs)),K(this.At.navigationKey)&&(this.At.navigationKey=n,this.At.url=r),this.At.firstMetricTimestamp=K(this.At.firstMetricTimestamp)?Date.now():this.At.firstMetricTimestamp;var s=null==(e=this._instance.sessionManager)?void 0:e.checkAndGetSessionAndWindowId(!0),a=p({},t,i?{navigationURL:r}:{},{$current_url:r,timestamp:Date.now()});if(delete a.entries,Q(t.attribution)&&this.attributionMetrics.indexOf(t.name)>-1){var o={};for(var l of Ck){var u="url"===l&&"string"==typeof t.attribution[l]?this.tv(t.attribution[l]):t.attribution[l];K(u)||(o[l]=u)}a.attribution=o}else delete a.attribution;K(s)||(a.$session_id=s.sessionId,a.$window_id=s.windowId),this.At.metrics.push(a),this.At.metrics.length===this.allowedMetrics.length&&this.Kd()}else wk.error("Ignoring metric with value >= "+this.ev,t)}}},this.iv=()=>{if(!this.ys){var t,e,i,r,n=!1,s=v.__PosthogExtensions__,a=null==s?void 0:s.postHogWebVitalsCallbacksByFlavor,o=(null==a?void 0:a[this.rv])||("web-vitals"===this.rv&&K(a)?null==s?void 0:s.postHogWebVitalsCallbacks:void 0);if(!K(o)){var l=o.withoutAttribution,u=this.attributionMetrics;n=!K(l),t=u.indexOf("LCP")>-1?o.onLCP:(null==l?void 0:l.onLCP)||o.onLCP,e=u.indexOf("CLS")>-1?o.onCLS:(null==l?void 0:l.onCLS)||o.onCLS,i=u.indexOf("FCP")>-1?o.onFCP:(null==l?void 0:l.onFCP)||o.onFCP,r=u.indexOf("INP")>-1?o.onINP:(null==l?void 0:l.onINP)||o.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.Xd.bind(this),h),this.allowedMetrics.indexOf("CLS")>-1&&e(this.Xd.bind(this),h),this.allowedMetrics.indexOf("FCP")>-1&&i(this.Xd.bind(this),h),this.allowedMetrics.indexOf("INP")>-1&&r(this.Xd.bind(this),d),this.ys=!0}else wk.error("web vitals callbacks not loaded - not starting")}},this._instance=t,this.Nd=!(null==(e=this._instance.persistence)||!e.props[Cn]),this.startIfEnabled()}get nv(){return this._instance.config.capture_performance}get allowedMetrics(){var t,e,i=Q(this.nv)?null==(t=this.nv)?void 0:t.web_vitals_allowed_metrics:void 0;return et(i)?(null==(e=this._instance.persistence)?void 0:e.props[In])||Sk:i}get flushToCaptureTimeoutMs(){return(Q(this.nv)?this.nv.web_vitals_delayed_flush_ms:void 0)||5e3}get attributionMetrics(){var t=Q(this.nv)?this.nv.web_vitals_attribution:void 0;return nt(t)?t?Sk:[]:G(t)?t:xk}get useAttribution(){return this.attributionMetrics.length>0}get useSoftNavs(){var t=Q(this.nv)?this.nv.__preview_web_vitals_soft_navs:void 0;return null!=t&&t}get ev(){var t=Q(this.nv)&&it(this.nv.__web_vitals_max_value)?this.nv.__web_vitals_max_value:kk;return t>0&&6e4>=t?kk:t}get isEnabled(){var t=null==n?void 0:n.protocol;if("http:"!==t&&"https:"!==t)return wk.info("Web Vitals are disabled on non-http/https protocols"),!1;var e=Q(this.nv)?this.nv.web_vitals:nt(this.nv)?this.nv:void 0;return nt(e)?e:this.Nd}startIfEnabled(){this.isEnabled&&!this.ys&&(wk.info("enabled, starting..."),this.js(this.iv))}onRemoteConfig(t){if(t.ok){var e=t.config;if("capturePerformance"in e){var i=Q(e.capturePerformance)&&!!e.capturePerformance.web_vitals,r=Q(e.capturePerformance)?e.capturePerformance.web_vitals_allowed_metrics:void 0;this._instance.persistence&&(this._instance.persistence.register({[Cn]:i}),this._instance.persistence.register({[In]:r})),this.Nd=i,this.startIfEnabled()}}}get rv(){return this.useSoftNavs?this.useAttribution?"web-vitals-with-attribution-soft-navs":"web-vitals-soft-navs":this.useAttribution?"web-vitals-with-attribution":"web-vitals"}js(t){var e=v.__PosthogExtensions__,i=this.rv,r=null==e?void 0:e.postHogWebVitalsCallbacksByFlavor;null!=r&&r[i]||"web-vitals"===i&&K(r)&&null!=e&&e.postHogWebVitalsCallbacks?t():null==e||null==e.loadExternalDependency||e.loadExternalDependency(this._instance,i,(e=>{e?wk.error("failed to load script",e):t()}))}tv(e){var i=e||(null==t?void 0:t.location.href);if(i){var r=this._instance.config.disable_capture_url_hashes?Te(i):i,n=this._instance.config.custom_personal_data_properties,s=this._instance.config.mask_personal_data_properties?[...Do,...n||[]]:[];return sr(r,s,No)}wk.error("Could not determine current URL")}}},gS={exceptionObserver:class{constructor(e){var i;this.iv=()=>{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.sv&&this.nn.capture_unhandled_errors&&(this.sv=i(this.captureException.bind(this))),!this.av&&this.nn.capture_unhandled_rejections&&(this.av=r(this.captureException.bind(this))),!this.ov&&this.nn.capture_console_errors&&(this.ov=n(this.captureException.bind(this)))}catch(t){bk.error("failed to start",t),this.lv()}}},this._instance=e,this.uv=!(null==(i=this._instance.persistence)||!i.props[kn]),this.de=new mt(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:bk})),this.nn=this.hv(),this.startIfEnabledOrStop()}hv(){var t=this._instance.config.capture_exceptions,e={capture_unhandled_errors:!1,capture_unhandled_rejections:!1,capture_console_errors:!1};return Q(t)?e=p({},e,t):(K(t)?this.uv:t)&&(e=p({},e,{capture_unhandled_errors:!0,capture_unhandled_rejections:!0})),e}get isEnabled(){return this.nn.capture_console_errors||this.nn.capture_unhandled_errors||this.nn.capture_unhandled_rejections}startIfEnabledOrStop(){this.isEnabled?(bk.info("enabled"),this.lv(),this.js(this.iv)):this.lv()}js(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 bk.error("failed to load script",e);t()}))}lv(){var t,e,i;null==(t=this.sv)||t.call(this),this.sv=void 0,null==(e=this.av)||e.call(this),this.av=void 0,null==(i=this.ov)||i.call(this),this.ov=void 0}onRemoteConfig(t){if(t.ok){var e=t.config;"autocaptureExceptions"in e&&(this.uv=!!e.autocaptureExceptions||!1,this._instance.persistence&&this._instance.persistence.register({[kn]:this.uv}),this.nn=this.hv(),this.startIfEnabledOrStop())}}onConfigChange(){this.nn=this.hv()}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.de.consumeRateLimit(n)?bk.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.dv=[],this.vv=um(),this._instance=t,this.dv=null!==(e=null==(i=this._instance.persistence)?void 0:i.get_property(Sn))&&void 0!==e?e:[],this.fv=Di(this.pv()),this.gv=new $i(this.fv)}onConfigChange(){this.fv=Di(this.pv()),this.gv.setConfig(this.fv)}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:[],a=null==(r=n.errorTracking)?void 0:r.captureExtensionExceptions;this.dv=s,this._instance.persistence&&this._instance.persistence.register({[Sn]:this.dv,[xn]:a})}}}get mv(){var t,e=!!this._instance.get_property(xn),i=this._instance.config.error_tracking.captureExtensionExceptions;return null!==(t=null!=i?i:e)&&void 0!==t&&t}buildProperties(t,e){return this.vv.buildFromUnknown(t,{syntheticException:null==e?void 0:e.syntheticException,mechanism:{handled:null==e?void 0:e.handled}})}addExceptionStep(t,e){if(this.fv.enabled)try{if(!Y(t)||0===t.trim().length)return void am.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.yv(e)),r=i.sanitizedProperties,n=i.droppedKeys;n.length>0&&am.warn("Ignoring reserved exception step fields",{droppedKeys:n}),this.gv.add(p({[Ai]:t,[Fi]:(new Date).toISOString()},r))}catch(t){am.error("Failed to add exception step. Ignoring breadcrumb.",t)}}sendExceptionEvent(t){try{var e=t.$exception_list;if(this.bv(e)){if(this._v(e))return this.wv("Exception dropped: matched a suppression rule"),void am.info("Skipping exception capture because a suppression rule matched");if(!this.mv&&this.Sv(e))return this.wv("Exception dropped: thrown by a browser extension"),void am.info("Skipping exception capture because it was thrown by an extension");if(!this.mv&&this.xv(e))return this.wv("Exception dropped: thrown by an injected browser script"),void am.info("Skipping exception capture because it was thrown by an injected browser script");if(!this._instance.config.error_tracking.__capturePostHogExceptions&&this.Cv(e))return this.wv("Exception dropped: thrown by the PostHog SDK"),void am.info("Skipping exception capture because it was thrown by the PostHog SDK")}var i=this.fv.enabled&&et(t.$exception_steps)?this.Tv(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",Al:!0});return n&&this.gv.clear(),n}catch(t){return am.error("Failed to capture exception event. Dropping this exception.",t),void this.gv.clear()}}catch(t){return void am.error("Failed to process exception event. Ignoring this exception.",t)}var s}Tv(t){try{var e=this.gv.getAttachable();return 0===e.length?t:p({},t,{$exception_steps:e})}catch(e){return am.error("Failed to read buffered exception steps. Capturing exception without steps.",e),t}}wv(t){this.fv.enabled&&this.gv.add({[Ai]:t,[Fi]:(new Date).toISOString()})}yv(t){return Q(t)?p({},t):{}}pv(){var t,e;return null!==(t=null==(e=this._instance.config.error_tracking)?void 0:e.exception_steps)&&void 0!==t?t:{}}_v(t){if(0===t.length)return!1;try{var e=t.reduce(((t,e)=>{var i=e.type,r=e.value;return Y(i)&&i.length>0&&t.$exception_types.push(i),Y(r)&&r.length>0&&t.$exception_values.push(r),t}),{$exception_types:[],$exception_values:[]});return this.dv.some((t=>{var i=t.values.map((t=>{var i=xo[t.operator],r=e[t.key];if(!i||!r)return!1;var n=G(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 am.warn("Failed to evaluate suppression rules. Capturing the exception.",t),!1}}Sv(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&&om.some((t=>e.startsWith(t)))}))}xv(t){return t.some((t=>{var e=t.value;return Y(e)&&lm.some((t=>e.includes(t)))}))}Cv(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:[],a=s[s.length-1];return null!==(r=null==a||null==(n=a.filename)?void 0:n.includes("posthog.com/static"))&&void 0!==r&&r}return!1}bv(t){return!et(t)&&G(t)}}},mS=p({productTours:class{get uo(){return this._instance.persistence}constructor(t){this.Mv=null,this.Ev=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.uo&&this.uo.register({[Mn]:!!e.productTours}),!Pk(this._instance))return!this.Mv&&et(null==(i=this.uo)?void 0:i.props[us])||Rk.info("product tours disabled; stopping and clearing cached tours"),null==(r=this.Mv)||r.stop(),this.Mv=null,void this.clearCache();this.loadIfEnabled()}}}loadIfEnabled(){!this.Mv&&Pk(this._instance)&&this.js((()=>this.Iv()))}js(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?Rk.error("Could not load product tours script",e):t()}))}Iv(){var t;!this.Mv&&null!=(t=v.__PosthogExtensions__)&&t.generateProductTours&&(this.Mv=v.__PosthogExtensions__.generateProductTours(this._instance,!0))}getProductTours(t,e){if(void 0===e&&(e=!1),!G(this.Ev)||e){var i=this.uo;if(i){var r=i.props[us];if(G(r)&&!e)return this.Ev=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(Pk(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||Rk.warn(n):Rk.error(n),void t([],{isLoaded:!1,error:n})}var s=G(e.json.product_tours)?e.json.product_tours:[];this.Ev=s,i&&i.register({[us]:s}),t(s,{isLoaded:!0})}else t([],{isLoaded:!0})}})}else t(this.Ev,{isLoaded:!0})}getActiveProductTours(t){et(this.Mv)?t([],{isLoaded:!1,error:"Product tours not loaded"}):this.Mv.getActiveProductTours(t)}showProductTour(t){var e;null==(e=this.Mv)||e.showTourById(t)}previewTour(t){this.Mv?this.Mv.previewTour(t):this.js((()=>{var e;this.Iv(),null==(e=this.Mv)||e.previewTour(t)}))}dismissProductTour(){var t;null==(t=this.Mv)||t.dismissTour("user_clicked_skip")}nextStep(){var t;null==(t=this.Mv)||t.nextStep()}previousStep(){var t;null==(t=this.Mv)||t.previousStep()}clearCache(){var t;this.Ev=null,null==(t=this.uo)||t.unregister(us)}resetTour(t){var e;null==(e=this.Mv)||e.resetTour(t)}resetAllTours(){var t;null==(t=this.Mv)||t.resetAllTours()}cancelPendingTour(t){var e;null==(e=this.Mv)||e.cancelPendingTour(t)}}},cS),yS={siteApps:class{constructor(t){this.Rv=0,this._instance=t,this.Pv=[],this.apps={}}get isEnabled(){return!!this._instance.config.opt_in_site_apps}Av(t,e){if(e){var i=this.globalsForEvent(e);this.Pv.push(i),this.Pv.length>1e3&&(this.Pv=this.Pv.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.Av.bind(this));this.Fv=()=>{t(),this.Pv=[],this.Fv=void 0}}}globalsForEvent(t){var e,i,r,n,s,a,o;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,Ak),{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==(a=t.properties)?void 0:a.$elements_chain)&&void 0!==s?s:"",distinct_id:null==(o=t.properties)?void 0:o.distinct_id}),person:{properties:this._instance.get_property("$stored_person_properties")},groups:l}}Ov(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)||(Fk.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)||(Fk.error("prepare_external_dependency_script returned null"),null):t}Lv(){var t,e,i,n,s,a,o,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.Rv++,this.Dv)return this.$v();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.Ov(t);return e&&c.add(e),e},g=t=>t.map((t=>"string"==typeof t?t:p(t))).filter((t=>!tt(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==(a=u.CharacterData)?void 0:a.prototype,null==(o=u.DocumentType)?void 0:o.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.Dv=()=>{d.forEach((t=>t())),this.Dv=void 0},this.$v()}$v(){var t=!1;return()=>{var e;t||(t=!0,this.Rv--,0===this.Rv&&(null==(e=this.Dv)||e.call(this)))}}Nv(t,e){void 0===e&&(e=!0);var i=this.Lv();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.Pv.length&&(Fk.info("Processing "+this.Pv.length+" events for site app with id "+t.id),this.Pv.forEach((t=>this.Nv((()=>null==e.processEvent?void 0:e.processEvent(t))))),e.processedBuffer=!0),Object.values(this.apps).every((t=>t.processedBuffer||t.errored))&&(null==(i=this.Fv)||i.call(this))},r=!1,n=n=>{e.errored=!n,e.loaded=!0,Fk.info("Site app with id "+t.id+" "+(n?"loaded":"errored")),r&&i()};try{var s=this.Nv((e=>t.init({posthog:this._instance,callback(t){e(),n(t)}})),!1).processEvent;s&&(e.processEvent=s),r=!0}catch(e){Fk.error(Ok+t.id,e),n(!1)}if(r&&e.loaded)try{i()}catch(i){Fk.error("Error while processing buffered events PostHog app with config id "+t.id,i),e.errored=!0}}qv(){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)}jv(t){var e=this;if(0!==Object.keys(this.apps).length){var i=this.globalsForEvent(t),r=function(r){try{e.Nv((()=>null==r.processEvent?void 0:r.processEvent(i)))}catch(e){Fk.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.qv(),void this._instance.on("eventCaptured",(t=>this.jv(t)))):void Fk.error('PostHog site apps are disabled. Enable the "opt_in_site_apps" config to proceed.');if(null==(i=this.Fv)||i.call(this),t.ok){var s=t.config;if(null!=(r=s.siteApps)&&r.length)if(this.isEnabled){var a=function(){var t,e=o.id,i=o.url;v["__$$ph_site_app_"+e]=n._instance,null==(t=v.__PosthogExtensions__)||null==t.loadSiteApp||t.loadSiteApp(n._instance,i,(t=>{if(t)return Fk.error(Ok+e,t)}))};for(var o of s.siteApps)a()}else Fk.error('PostHog site apps are disabled. Enable the "opt_in_site_apps" config to proceed.')}}}},bS={tracingHeaders:class{constructor(t){this.Bv=void 0,this.Hv=void 0,this.zv=void 0,this.iv=()=>{var t,e,i=this.Uv();i?(K(this.Bv)&&(this.Bv=null==(t=v.__PosthogExtensions__)||null==(t=t.tracingHeadersPatchFns)?void 0:t._patchXHR(i,(()=>this._instance.get_distinct_id()),this._instance.sessionManager)),K(this.Hv)&&(this.Hv=null==(e=v.__PosthogExtensions__)||null==(e=e.tracingHeadersPatchFns)?void 0:e._patchFetch(i,(()=>this._instance.get_distinct_id()),this._instance.sessionManager))):this.lv()},this._instance=t}initialize(){this.startIfEnabledOrStop()}js(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 _k.error("failed to load script",e);t()}))}Wv(){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}Uv(){var t=this.Wv();return G(t)?(G(this.zv)?this.zv.splice(0,this.zv.length,...t):this.zv=[...t],t.length>0?this.zv:void 0):(G(this.zv)&&this.zv.splice(0),this.zv=t||void 0,this.zv)}lv(){var t,e;null==(t=this.Bv)||t.call(this),null==(e=this.Hv)||e.call(this),this.Bv=void 0,this.Hv=void 0}startIfEnabledOrStop(){this.Uv()?this.js(this.iv):this.lv()}}},_S=p({surveys:class extends Nk{constructor(t){var e;super(new Uk(t),{get projectToken(){return e.config.token},kv:new zk(e=t)}),this._instance=t}ru(t,e){var i=e.query?_w(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})}))}}},cS),wS={toolbar:class{constructor(t){this.instance=t}Vv(t){v.ph_toolbar_state=t}Gv(){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),Xi(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,a=Wk||ar(e.hash,"__posthog")||ar(e.hash,"state"),o=a?Gi((()=>JSON.parse(atob(decodeURIComponent(a)))))||Gi((()=>JSON.parse(decodeURIComponent(a)))):null;return o&&"ph_authorize"===o.action?((s=o).source="url",s&&Object.keys(s).length>0&&(o.desiredHash?e.hash=o.desiredHash:n?n.replaceState(n.state,"",e.pathname+e.search):e.hash="")):((s=JSON.parse(i.getItem(Vk)||"{}")).source="localstorage",delete s.userIntent),!(!s.token||this.instance.config.token!==s.token||(this.loadToolbar(s),0))}catch(t){return!1}}Zv(t){var e=v.ph_load_toolbar||v.ph_load_editor;!et(e)&&Z(e)?e(t,this.instance):Gk.warn("No toolbar load function found")}loadToolbar(e){var i=!(null==r||!r.getElementById(dr));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(Vk,JSON.stringify(p({},s,{source:void 0}))),2===this.Gv())this.Zv(s);else if(0===this.Gv()){var a;this.Vv(1),null==(a=v.__PosthogExtensions__)||null==a.loadExternalDependency||a.loadExternalDependency(this.instance,"toolbar",(t=>{if(t)return Gk.error("[Toolbar] Failed to load",t),void this.Vv(0);this.Vv(2),this.Zv(s)})),Yi(t,"turbolinks:load",(()=>{this.Vv(0),this.loadToolbar(s)}))}return!0}Qv(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)}}},kS=p({experiments:nS},cS),SS={conversations:class{constructor(t){this.Jv=void 0,this._conversationsManager=null,this.Kv=!1,this.Fe=null,this.Yv=!1,this._instance=t}initialize(){this.loadIfEnabled()}onRemoteConfig(t){if(!this._instance.config.disable_conversations&&(this.Xv=t.ok,t.ok)){var e=t.config.conversations;et(e)||(nt(e)?this.Jv=e:(this.Jv=e.enabled,this.Fe=e),this.loadIfEnabled())}}reset(){var t;null==(t=this._conversationsManager)||t.reset(),this._conversationsManager=null,this.Jv=void 0,this.Fe=null,this.Xv=void 0,this.Yv=!1}loadIfEnabled(){if(!(this._conversationsManager||this.Kv||this._instance.config.disable_conversations||Xi(this._instance.config)||this._instance.config.cookieless_mode&&this._instance.consent.isOptedOut())){var t=null==v?void 0:v.__PosthogExtensions__;if(t&&!K(this.Jv)&&this.Jv)if(this.Fe&&this.Fe.token){this.Kv=!0;try{var e=t.initConversations;if(e)return this.tc(e),void(this.Kv=!1);var i=t.loadExternalDependency;if(!i)return void this.ec(Os);i(this._instance,"conversations",(e=>{e||!t.initConversations?this.ec("Could not load conversations script",e):this.tc(t.initConversations),this.Kv=!1}))}catch(t){this.ec("Error initializing conversations",t),this.Kv=!1}}else sS.error("Conversations enabled but missing token in remote config.")}}tc(t){if(this.Fe)try{this._conversationsManager=t(this.Fe,this._instance),this.Yv=!1,sS.info("Conversations loaded successfully")}catch(t){this.ec("Error completing conversations initialization",t)}else sS.error("Cannot complete initialization: remote config is null")}ec(t,e){sS.error(t,e),this._conversationsManager=null,this.Kv=!1,this.Yv=!0}show(){this._conversationsManager?this._conversationsManager.show():sS.warn("Conversations not loaded yet.")}hide(){this._conversationsManager&&this._conversationsManager.hide()}isAvailable(){return!0===this.Jv&&!tt(this._conversationsManager)}getUnavailableReason(){return this.isAvailable()?null:this._instance.config.disable_conversations?"disabled_by_config":Xi(this._instance.config)?"disabled_for_toolbar":this._instance.config.cookieless_mode&&this._instance.consent.isOptedOut()?"consent_opted_out":!1===this.Xv?"remote_config_failed":K(this.Jv)?this.Xv?"disabled_in_project":"remote_config_pending":this.Jv?et(this.Fe)||!this.Fe.token?"missing_token":null!=v&&v.__PosthogExtensions__?this.Kv?"initializing":this.Yv?"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):(sS.warn(aS),null)}))()}getMessages(t,e){var i=this;return f((function*(){return i._conversationsManager?i._conversationsManager.getMessages(t,e):(sS.warn(aS),null)}))()}markAsRead(t){var e=this;return f((function*(){return e._conversationsManager?e._conversationsManager.markAsRead(t):(sS.warn(aS),null)}))()}getTickets(t){var e=this;return f((function*(){return e._conversationsManager?e._conversationsManager.getTickets(t):(sS.warn(aS),null)}))()}requestRestoreLink(t){var e=this;return f((function*(){return e._conversationsManager?e._conversationsManager.requestRestoreLink(t):(sS.warn(aS),null)}))()}restoreFromToken(t){var e=this;return f((function*(){return e._conversationsManager?e._conversationsManager.restoreFromToken(t):(sS.warn(aS),null)}))()}restoreFromUrlToken(){var t=this;return f((function*(){return t._conversationsManager?t._conversationsManager.restoreFromUrlToken():(sS.warn(aS),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}Bl(){var t;null==(t=this._conversationsManager)||t.setIdentity()}Hl(){var t;null==(t=this._conversationsManager)||t.clearIdentity()}}},xS={logs:class{constructor(e){var i,r=this;this.name=Yf,this.ic=!1,this.rc=!1,this.nc=!1,this.I=Hi("[logs]"),this.sc=p({},this.I,{error(){for(var t=arguments.length,e=new Array(t),i=0;t>i;i++)e[i]=arguments[i];e.some(vS)||r.I.error(...e)}}),this.ja=[],this.ac=[],this.Oh=0,this.ks=!1,this.oc=[],this.lc=[],this.uc=!1,this.hc=!1,this.dc=()=>{var t,e;this.ks||(this.Oh=0,null==(t=this.vc)||t.onReconnect(),null==(e=this.cc)||e.onReconnect())},this._instance=e,this._instance&&null!=(i=this._instance.config.logs)&&i.captureConsoleLogs&&(this.ic=!0),t&&Yi(t,"online",this.dc)}fc(t,e,i,r){var n,s=oS(null==(n=this._instance)||null==(n=n.config)?void 0:n.logs,i);return[new Ye(this.gc(t,e),s,this.sc,(()=>this.mc()),(t=>t()),void 0,r),s]}yc(){var t,e=null==(t=this._instance)||null==(t=t.config)?void 0:t.logs;if(!this.vc||this.bc!==e){var i;null==(i=this.vc)||i.reset(),this.bc=e;var r=this.fc((()=>this.ja),(t=>{this.ja=t}));this.vc=r[0],this._c=r[1]}return this.vc}wc(){var t,e=null==(t=this._instance)||null==(t=t.config)?void 0:t.logs;if(!this.cc||this.kc!==e){var i;null==(i=this.cc)||i.reset(),this.kc=e;var r=this.fc((()=>this.ac),(t=>{this.ac=t}),{serviceNameDefault:"posthog-browser-logs",consoleCapture:!0},uS);this.cc=r[0],this.Sc=r[1]}return this.cc}setup(t){var e;if(!this.ks){this.Ts=t,null!=(e=this._instance)&&null!=(e=e.config)&&null!=(e=e.logs)&&e.captureConsoleLogs&&(this.ic=!0),(this.ic||this.xc()&&this.Cc())&&this.Tc();var i=!1,r=t.onRemoteConfig((t=>{var e;i=t.ok&&!0===(null==(e=t.config.logs)?void 0:e.captureConsoleLogs),this.onRemoteConfig(t)}));this.ks?r.dispose():(this.Ms=r,i||this.loadIfEnabled())}}dispose(){var e,i,r,n;this.ks||(this.ks=!0,this.Mc(),null==(e=this.Ms)||e.dispose(),this.Ms=void 0,this.Ts=void 0,this.nc=!1,null==t||t.removeEventListener("online",this.dc),null==(i=this.Ec)||i.call(this),this.Ec=void 0,null==(r=this.vc)||r.reset(),null==(n=this.cc)||n.reset())}onRemoteConfig(t){var e,i;if(!this.ks){var r=t.ok?null==(e=t.config.logs)?void 0:e.captureConsoleLogs:void 0;et(r)?this.Ic():(null==(i=this._instance)||null==(i=i.persistence)||i.register({[En]:!!r}),r?(this.ic=!0,this.rc||this.Tc(),this.loadIfEnabled()):this.Ic())}}reset(){var t,e,i,r;this.Mc(),null==(t=this.vc)||t.clearQueue(),this.ja=[],null==(e=this.vc)||e.reset(),null==(i=this.cc)||i.clearQueue(),this.ac=[],null==(r=this.cc)||r.reset(),this.Oh=0}captureLog(t){this.ks||this.yc().captureLog(t)}captureConsoleLog(t){this.ks||this.wc().captureLog(t)}captureBufferedConsoleLog(t,e,i){this.ks||this.wc().captureLog(t,{context:e,occurredAtMs:i})}Cc(){var t;return!(null==(t=this._instance)||null==(t=t.persistence)||null==(t=t.props)||!t[En])}xc(){var t,e;return null==(t=this._instance)||null==t.Da||!t.Da()||!(null==(e=v._POSTHOG_REMOTE_CONFIG)||null==(e=e[this._instance.config.token])||!e.config)}Ul(){var t;this.Mc(),null==(t=this.cc)||t.clearQueue(),this.ac=[]}Ic(){this.ic||this.Mc()}Tc(){var t,e=this;if(!this.uc&&null!=v&&v.console){var i=oS(null==(t=this._instance)||null==(t=t.config)?void 0:t.logs).maxBufferSize,r=function(t){var r;try{r=Zg(v.console[t])}catch(t){return 0}if(!r)return 0;e.lc.push(Dv(v.console,t,(n=>{var s=function(){for(var r=arguments.length,s=new Array(r),a=0;r>a;a++)s[a]=arguments[a];try{e.Rc(t,s,i)}catch(t){}return n.apply(v.console,s)};return s.__rrweb_original__=r,s})))};for(var n of lS)r(n);this.uc=!0,this.Pc=setTimeout((()=>{this.Mc()}),3e4)}}Rc(t,e,i){var r;if(this.uc&&!this.hc&&0!==e.length)if(null!=(r=this._instance)&&r.is_capturing()){if(i>this.oc.length){this.hc=!0;try{this.oc.push({level:t,args:e,occurredAtMs:Date.now(),context:this.mc()})}finally{this.hc=!1}}}else this.Mc()}Mc(){if(this.oc=[],this.uc){for(var t of(this.uc=!1,this.Pc&&(clearTimeout(this.Pc),this.Pc=void 0),this.lc))t();this.lc=[]}}Ac(){var t=this.oc;return this.Mc(),t}get logger(){return this.Fc||(this.Fc={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.Fc}flushLogs(t){t?this.Oc(t):(this.vc&&this.vc.flush().catch((t=>this.Lc(t))),this.cc&&this.cc.flush().catch((t=>this.Lc(t))))}Lc(t){vS(t)||this.I.error("PostHog logs flush failed:",t)}loadIfEnabled(){if(!this.ks&&this.ic&&!this.rc&&!this.nc){var t=null==v?void 0:v.__PosthogExtensions__;if(!t)return this.I.error("PostHog Extensions not found."),void this.Mc();var e=t.loadExternalDependency;if(!e)return this.I.error(Os),void this.Mc();this.nc=!0;try{e(this._instance,"logs",(e=>{if(this.nc=!1,!this.ks&&this.ic){var i=t.logs;if(e||null==i||!i.initializeLogs)this.I.error("Could not load logs script",e),this.Mc();else{var r,n,s=this.Ac();this.Ec=i.initializeLogs(null!==(r=this.Ts)&&void 0!==r?r:this._instance),this.rc=!0,s.length>0&&(null==i.replayConsoleBuffer||i.replayConsoleBuffer(null!==(n=this.Ts)&&void 0!==n?n:this._instance,s))}}}))}catch(t){throw this.nc=!1,t}}}gc(t,e){var i=this._instance;return{get isDisabled(){return!1},get optedOut(){return!i.is_capturing()},getPersistedProperty:e=>e===S.LogsQueue?t():void 0,setPersistedProperty(t,i){var r;t===S.LogsQueue&&e(null!==(r=i)&&void 0!==r?r:[])},Gn:t=>this.Gn(t),getLibraryId:()=>qi.LIB_NAME,getLibraryVersion:()=>qi.LIB_VERSION}}Gn(t){return new Promise((e=>{if(or(this.Oh,3))e({kind:"fatal",error:dS(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:dS(void 0,"logs request timed out")})}),9e4);this._instance._send_request({method:"POST",url:this.Dc(),data:t,compression:"best-available",batchKey:"logs",fireCallbackOnDrop:!0,callback:t=>{var e=t.statusCode;if(this.$c(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:dS(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)})}}})}}))}$c(t){(0!==t||this._instance.__loaded)&&(this.Oh=lr(t,this.Oh,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."))))}Oc(t){this.ja.length>0&&this.Nc(t,this.ja,this._c,qi.LIB_NAME,(t=>{this.ja=t})),this.ac.length>0&&this.Nc(t,this.ac,this.Sc,uS,(t=>{this.ac=t}))}Nc(t,e,i,r,n){if(0!==e.length){var s=e.map((t=>t.record));n([]);var a=Ke(s,Je(i,qi.LIB_NAME,qi.LIB_VERSION),r,qi.LIB_VERSION);this._instance._send_request({method:"POST",url:this.Dc(),data:a,compression:"best-available",batchKey:"logs",transport:t})}}Dc(){return this._instance.requestRouter.endpointFor("api","/i/v1/logs")+"?token="+encodeURIComponent(this._instance.config.token)}mc(){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,et(n)||(e.sessionStartTimestamp=n),et(s)||(e.lastActivityTimestamp=s)}if(null!=v&&null!=(t=v.location)&&t.href&&(e.currentUrl=this._instance.config.disable_capture_url_hashes?Te(v.location.href):v.location.href),this._instance.featureFlags){var a=this._instance.featureFlags.getFlags();a&&a.length>0&&(e.activeFeatureFlags=a)}return e}}},CS={metrics:class{constructor(t){this.I=Hi("[metrics]"),this._instance=t}initialize(){}yc(){var t,e,i=null==(t=this._instance)||null==(t=t.config)?void 0:t.metrics;return this.vc&&this.bc===i||(null==(e=this.vc)||e.reset(),this.bc=i,this.vc=new ii(this.gc(),function(t){var e,i,r,n,s,a=null==t?void 0:t.resourceAttributes;return{serviceName:null!==(e=null==a?void 0:a["service.name"])&&void 0!==e?e:null==t?void 0:t.serviceName,serviceVersion:null!==(i=null==a?void 0:a["service.version"])&&void 0!==i?i:null==t?void 0:t.serviceVersion,environment:null!==(r=null==a?void 0:a["deployment.environment"])&&void 0!==r?r:null==t?void 0:t.environment,resourceAttributes:a,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.vc}count(t,e,i){void 0===e&&(e=1),this.yc().count(t,e,i)}gauge(t,e,i){this.yc().gauge(t,e,i)}histogram(t,e,i){this.yc().histogram(t,e,i)}flush(t){if(!this.vc)return Promise.resolve();if(t){var e=this.vc.drainWindow();return e&&this.ds(e,t),Promise.resolve()}return this.vc.flush().catch((t=>this.I.error("PostHog metrics flush failed:",t)))}reset(){var t;null==(t=this.vc)||t.reset()}gc(){var t=this._instance,e=this;return{get isDisabled(){return!1},get optedOut(){return!t.is_capturing()},ds:t=>e.ds(t),getLibraryId:()=>qi.LIB_NAME,getLibraryVersion:()=>qi.LIB_VERSION}}ds(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.qc(),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)})}}}))}))}qc(){return this._instance.requestRouter.endpointFor("api","/i/v1/metrics")+"?token="+encodeURIComponent(this._instance.config.token)}}},TS=p({},cS,fS,pS,gS,mS,yS,_S,bS,wS,kS,SS,xS,CS);mk.__defaultExtensionClasses=p({},TS),function(){qi.SDK_DIST_CHANNEL="cdn";var e=v.posthog;if(!e||G(e._i)){var i=ik[hk]=new mk;if(e){var n=[];Ui(e._i,(function(t){if(t&&G(t)){var r=i.init(t[0],t[1],t[2]),s=e[t[2]]||e;r.__loaded&&-1===n.indexOf(s)&&(n.push(s),r._execute_array.call(r.people,s.people),r._execute_array(s))}}))}i.__SV=1,v.posthog=i,function(){function e(){e.done||(e.done=!0,dk=!1,Ui(ik,(function(t){t._dom_loaded()})))}null!=r&&r.addEventListener?"complete"===r.readyState?e():Yi(r,"DOMContentLoaded",e,{capture:!1}):t&&Bi.error("Browser doesn't support `document.addEventListener` so PostHog couldn't be initialized")}()}}()}();
1
+ !function(){"use strict";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,a=null!=e&&e.XMLHttpRequest&&"withCredentials"in new e.XMLHttpRequest?e.XMLHttpRequest:void 0,o=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,a){try{var o=t[s](a),l=o.value}catch(t){return void i(t)}o.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 a(t){c(s,r,n,a,o,"next",t)}function o(t){c(s,r,n,a,o,"throw",t)}a(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},b=t=>{if("string"!=typeof t)return t;try{return JSON.parse(t)}catch(e){return t}};function _(t){return"string"==typeof t||t}function w(t){return"string"==typeof t?t:void 0}var k=["$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"],S=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}({}),x=function(t){return t.GZipJS="gzip-js",t.Base64="base64",t}({}),C="min_length",T="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"],E=["token"],I=20,R=1e3,P=1e4,A="[Circular]",F="[Truncated]",O="[Unserializable]",L="[Function]";function D(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 N=["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","pinterestbot","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 N.concat(e).some((t=>{var e=t.toLowerCase();return-1!==i.indexOf(e)}))};function j(t,e){return-1!==t.indexOf(e)}var B=function(t){return t.trim()},H=function(t){return t.replace(/^\$/,"")};function z(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 U=Object.prototype,W=U.hasOwnProperty,V=U.toString,G=Array.isArray||function(t){return"[object Array]"===V.call(t)},Z=t=>"function"==typeof t,Q=t=>t===Object(t)&&!G(t),J=t=>{if(Q(t)){for(var e in t)if(W.call(t,e))return!1;return!0}return!1},K=t=>void 0===t,Y=t=>"[object String]"==V.call(t),X=t=>Y(t)&&0===t.trim().length,tt=t=>null===t,et=t=>K(t)||tt(t),it=t=>"[object Number]"==V.call(t)&&t==t,rt=t=>it(t)&&t>0,nt=t=>"[object Boolean]"===V.call(t),st=t=>t instanceof FormData,at=t=>j(M,t),ot=t=>j(E,t);function lt(t){return null===t||"object"!=typeof t}function ut(t,e){return{}.toString.call(t)==="[object "+e+"]"}function ht(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 vt(t,Error)}}function dt(t){return"undefined"!=typeof Event&&vt(t,Event)}function vt(t,e){try{return t instanceof e}catch(t){return!1}}var ct=[!0,"true",1,"1","yes"],ft=t=>j(ct,t),pt=[!1,"false",0,"0","no"];function gt(t,e,i,r,n){return e>i&&(r.warn("min cannot be greater than max."),e=i),it(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),gt(n||i,e,i,r))}class mt{constructor(t){this.k={},this.S=t.S,this.C=gt(t.bucketSize,0,100,t.I),this.R=gt(t.refillRate,0,this.C,t.I),this.A=gt(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 yt="Mobile",bt="iOS",_t="Android",wt="Tablet",kt=_t+" "+wt,St="iPad",xt="Apple",Ct=xt+" Watch",Tt="Safari",Mt="BlackBerry",Et="Samsung",It=Et+"Browser",Rt=Et+" Internet",Pt="Chrome",At=Pt+" OS",Ft=Pt+" "+bt,Ot="Internet Explorer",Lt=Ot+" "+yt,Dt="Opera",$t=Dt+" Mini",Nt="Edge",qt="Microsoft "+Nt,jt="Firefox",Bt=jt+" "+bt,Ht="Nintendo",zt="PlayStation",Ut="Xbox",Wt=_t+" "+yt,Vt=yt+" "+Tt,Gt="Windows",Zt=Gt+" Phone",Qt="Nokia",Jt="Ouya",Kt="Generic",Yt=Kt+" "+yt.toLowerCase(),Xt=Kt+" "+wt.toLowerCase(),te="Konqueror",ee="Oculus Browser",ie="Vivaldi",re="Yandex",ne="Whale",se="DuckDuckGo",ae="Pale Moon",oe="Waterfox",le="Brave",ue="Google Search App",he="(\\d+(\\.\\d+)?)",de=new RegExp("Version/"+he),ve=new RegExp(Ut,"i"),ce=new RegExp(zt+" \\w+","i"),fe=new RegExp(Ht+" \\w+","i"),pe=new RegExp(Mt+"|PlayBook|BB10","i"),ge={"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"},me=function(t,e,i,r){e=e||"";var n=function(t){return null!=t&&t.brave?le:null}(i);return n||(null!=r&&r.detectGoogleSearchApp&&j(t,"GSA/")?ue:j(t," OPR/")&&j(t,"Mini")?$t:j(t," OPR/")?Dt:pe.test(t)?Mt:j(t,"IE"+yt)||j(t,"WPDesktop")?Lt:j(t,"OculusBrowser")?ee:j(t,It)?Rt:j(t,Nt)||j(t,"Edg/")?qt:j(t,ie+"/")?ie:j(t,"YaBrowser/")?re:j(t,ne+"/")?ne:j(t,se+"/")||j(t,"Ddg/")?se:j(t,"FBIOS")?"Facebook "+yt:j(t,"UCWEB")||j(t,"UCBrowser")?"UC Browser":j(t,"CriOS")?Ft:j(t,"CrMo")||j(t,Pt)?Pt:j(t,_t)&&j(t,Tt)?Wt:j(t,"FxiOS")?Bt:j(t.toLowerCase(),te.toLowerCase())?te:j(t,le+"/")?le:((t,e)=>e&&j(e,xt)||function(t){return j(t,Tt)&&!j(t,Pt)&&!j(t,_t)}(t))(t,e)?j(t,yt)?Vt:Tt:j(t,"PaleMoon/")?ae:j(t,oe+"/")?oe:j(t,jt)?jt:j(t,"MSIE")||j(t,"Trident/")?Ot:j(t,"Gecko")?jt:"")},ye={[Lt]:[new RegExp("rv:"+he)],[qt]:[new RegExp(Nt+"?\\/"+he)],[Pt]:[new RegExp("("+Pt+"|CrMo)\\/"+he)],[Ft]:[new RegExp("CriOS\\/"+he)],"UC Browser":[new RegExp("(UCBrowser|UCWEB)\\/"+he)],[Tt]:[de],[Vt]:[de],[Dt]:[new RegExp("(Opera|OPR)\\/"+he)],[jt]:[new RegExp(jt+"\\/"+he)],[Bt]:[new RegExp("FxiOS\\/"+he)],[te]:[new RegExp("Konqueror[:/]?"+he,"i")],[Mt]:[new RegExp(Mt+" "+he),de],[Wt]:[new RegExp("android\\s"+he,"i")],[Rt]:[new RegExp(It+"\\/"+he)],[ee]:[new RegExp("OculusBrowser\\/"+he)],[ie]:[new RegExp(ie+"\\/"+he)],[re]:[new RegExp("YaBrowser\\/"+he)],[ne]:[new RegExp(ne+"\\/"+he)],[le]:[new RegExp(le+"\\/"+he)],[se]:[new RegExp("(DuckDuckGo|Ddg)\\/"+he)],[ae]:[new RegExp("PaleMoon\\/"+he)],[oe]:[new RegExp(oe+"\\/"+he)],[ue]:[new RegExp("GSA\\/"+he)],[Ot]:[new RegExp("(rv:|MSIE )"+he)],Mozilla:[new RegExp("rv:"+he)]},be=function(t,e,i,r){var n=me(t,e,i,r),s=ye[n];if(K(s))return null;for(var a=0;s.length>a;a++){var o=t.match(s[a]);if(o)return parseFloat(o[o.length-2])}return null},_e=[[new RegExp(Ut+"; "+Ut+" (.*?)[);]","i"),t=>[Ut,t&&t[1]||""]],[new RegExp(Ht,"i"),[Ht,""]],[new RegExp(zt,"i"),[zt,""]],[pe,[Mt,""]],[new RegExp(Gt,"i"),(t,e)=>{if(/Phone/.test(e)||/WPDesktop/.test(e))return[Zt,""];if(new RegExp(yt).test(e)&&!/IEMobile\b/.test(e))return[Gt+" "+yt,""];var i=/Windows NT ([0-9.]+)/i.exec(e);if(i&&i[1]){var r=ge[i[1]]||"";return/arm/i.test(e)&&(r="RT"),[Gt,r]}return[Gt,""]}],[/((iPhone|iPad|iPod).*?OS (\d+)_(\d+)_?(\d+)?|iPhone)/,t=>t&&t[3]?[bt,[t[3],t[4],t[5]||"0"].join(".")]:[bt,""]],[/(watch.*\/(\d+\.\d+\.\d+)|watch os,(\d+\.\d+),)/i,t=>{var e="";return t&&t.length>=3&&(e=K(t[2])?t[3]:t[2]),["watchOS",e]}],[new RegExp("("+_t+" (\\d+)\\.(\\d+)\\.?(\\d+)?|"+_t+")","i"),t=>t&&t[2]?[_t,[t[2],t[3],t[4]||"0"].join(".")]:[_t,""]],[/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/,[At,""]],[/Linux|debian/i,["Linux",""]]],we=function(t){return fe.test(t)?Ht:ce.test(t)?zt:ve.test(t)?Ut:new RegExp(Jt,"i").test(t)?Jt:new RegExp("("+Zt+"|WPDesktop)","i").test(t)?Zt:/iPad/.test(t)?St:/iPod/.test(t)?"iPod Touch":/iPhone/.test(t)?"iPhone":/(watch)(?: ?os[,/]|\d,\d\/)[\d.]+/i.test(t)?Ct:pe.test(t)?Mt:/(kobo)\s(ereader|touch)/i.test(t)?"Kobo":new RegExp(Qt,"i").test(t)?Qt:/(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(yt).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)?_t:kt:new RegExp("(pda|"+yt+")","i").test(t)?Yt:new RegExp(wt,"i").test(t)&&!new RegExp(wt+" pc","i").test(t)?Xt:""},ke=function(t,e){var i,r,n,s,a=we(t);return a===St||a===kt||"Kobo"===a||"Kindle Fire"===a||a===Xt?wt:a===Ht||a===Ut||a===zt||a===Jt?"Console":a===Ct?"Wearable":a?yt:"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)?yt:wt:"Desktop"},Se=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;function xe(t,e){return"string"==typeof(i=t)&&Se.test(i)?t:e();var i}function Ce(t,e){var i=new Error(e);try{Object.defineProperty(i,"name",{value:t,writable:!0,enumerable:!0,configurable:!0})}catch(t){}return i}function Te(t){return t?t.split("#")[0]:t}function Me(t,e){var i=setTimeout(t,e);return(null==i?void 0:i.unref)&&(null==i||i.unref()),i}function Ee(t,e,i){return Ie.apply(this,arguments)}function Ie(){return(Ie=f((function*(t,e,i){var r;try{return yield Promise.race([t,new Promise(((t,n)=>{r=Me((()=>{try{null==i||i(),t()}catch(t){n(t)}}),e)}))])}finally{clearTimeout(r)}}))).apply(this,arguments)}var Re,Pe="NativeGzipValidationError",Ae=t=>t.length>=2&&31===t[0]&&139===t[1],Fe=(t,e)=>t===x.GZipJS||e===x.GZipJS||"gzip"===e,Oe=t=>!(!t||"object"!=typeof t)&&"NotReadableError"===("name"in t?String(t.name):""),Le=t=>{if(!t||"object"!=typeof t)return!1;var e="name"in t?String(t.name):"";return Oe(t)||e===Pe},De=t=>{throw Ce(Pe,"Native gzip produced invalid output: "+t)},$e=function(){var t=f((function*(t,e){18>t.size&&De("too-short");var i=new Uint8Array(yield t.slice(0,10).arrayBuffer());Ae(i)&&8===i[2]||De("invalid-header");var r=new DataView(yield t.slice(t.size-8).arrayBuffer());r.getUint32(0,!0)!==(t=>{for(var e=(()=>{if(Re)return Re;Re=[];for(var t=0;256>t;t++){for(var e=t,i=0;8>i;i++)e=1&e?3988292384^e>>>1:e>>>1;Re[t]=e>>>0}return Re})(),i=4294967295,r=0;t.length>r;r++)i=e[255&(i^t[r])]^i>>>8;return(4294967295^i)>>>0})(e)&&De("invalid-crc");var n=e.length>>>0;r.getUint32(4,!0)!==n&&De("invalid-size")}));return function(e,i){return t.apply(this,arguments)}}();function Ne(t,e,i){return qe.apply(this,arguments)}function qe(){return qe=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(),a=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)}}()),o=new Response(n.readable).blob(),l=(yield Promise.all([o,a]))[0];return yield $e(l,r),l}catch(t){if(null!=i&&i.rethrow)throw t;return e&&console.error("Failed to gzip compress data",t),null}})),qe.apply(this,arguments)}var je={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}},Be=je.info,He=0x8000000000000000,ze={}.propertyIsEnumerable;function Ue(t,e){try{return Ge(t,e,{ancestors:new WeakSet,remainingNodes:P},0)}catch(t){return[]}}function We(t,e,i,r){if(0>=i.remainingNodes)return{stringValue:F};if(i.remainingNodes--,nt(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>=He||-He>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:D(t)};if("function"==typeof t)return{stringValue:L};if("symbol"==typeof t)return{stringValue:String(t)};if("object"==typeof t&&null!==t){if(i.ancestors.has(t))return{stringValue:A};if(r>=I)return{stringValue:F};if(t instanceof Date){var s=t.getTime(),a=Number.isFinite(s)?t.toISOString():String(t);return{stringValue:"string"==typeof a?D(a):String(a)}}i.ancestors.add(t);try{try{var o=t.toJSON;if("function"==typeof o)return We(o.call(t),e,i,r+1)}catch(t){}return G(t)?{arrayValue:{values:Ve(t,e,i,r+1)}}:{kvlistValue:{values:Ge(t,e,i,r+1)}}}finally{i.ancestors.delete(t)}}return{stringValue:D(String(t))}}function Ve(t,e,i,r){for(var n=[],s=Math.min(t.length,R),a=0;s>a&&i.remainingNodes>0;a++)try{var o=a in t?t[a]:void 0;if(et(o))continue;n.push(We(o,e,i,r))}catch(t){n.push({stringValue:O})}return t.length>a&&n.push({stringValue:F}),n}function Ge(t,e,i,r){var n=[];for(var s in t)if(ze.call(t,s)){if(n.length>=R||0>=i.remainingNodes){null==e||e.debug("Attributes truncated: the value exceeds the OTLP encoder budget");break}try{var a=t[s];if(tt(a)||K(a))continue;n.push({key:D(s),value:We(a,e,i,r)})}catch(t){n.push({key:D(s),value:{stringValue:O}})}}return n}function Ze(t){try{return D(String(t))}catch(t){return O}}function Qe(t,e,i,r){var n,s=je[t.level||"info"]||Be,a=s.text,o=s.number,l=(void 0===(n=it(r)?r:void 0)&&(n=Date.now()),String(n)+"000000"),u={};e.distinctId&&(u.posthogDistinctId=e.distinctId),e.sessionId&&(u.sessionId=e.sessionId),e.windowId&&(u["window.id"]=e.windowId),et(e.sessionStartTimestamp)||(u.sessionStartTimestamp=String(e.sessionStartTimestamp)),et(e.lastActivityTimestamp)||(u.lastActivityTimestamp=String(e.lastActivityTimestamp)),e.currentUrl&&(u["url.full"]=e.currentUrl),e.screenName&&(u["screen.name"]=e.screenName),e.appState&&(u["app.state"]=e.appState),e.activeFeatureFlags&&e.activeFeatureFlags.length>0&&(u.feature_flags=e.activeFeatureFlags);var h=p({},u),d=t.attributes;if(d){var v=[];try{v=Object.keys(d)}catch(t){v=[]}for(var c of v){var f=void 0;try{f=d[c]}catch(t){f=O}Object.defineProperty(h,c,{value:f,enumerable:!0,writable:!0,configurable:!0})}}var g={timeUnixNano:l,observedTimeUnixNano:l,severityNumber:o,severityText:a,body:{stringValue:Ze(t.body)},attributes:Ue(h,i)};return t.trace_id&&(g.traceId=t.trace_id),t.span_id&&(g.spanId=t.span_id),K(t.trace_flags)||(g.flags=t.trace_flags),g}function Je(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 Ke(t,e,i,r){return{resourceLogs:[{resource:{attributes:Ue(e)},scopeLogs:[{scope:{name:i,version:r},logRecords:t}]}]}}let Ye=class{constructor(t,e,i,r,n,s,a){var o;void 0===s&&(s=()=>Promise.resolve()),this._instance=t,this.vn=e,this.I=i,this.Pn=r,this.An=n,this.Fn=s,this.On=a,this.Ln=null,this.Dn=0,this.$n=0,this.Nn=0,this.qn=0,this.jn=0,this.Bn=!1,this.Hn=e.maxBufferSize,this.zn=Math.max(null!==(o=e.maxQueueSize)&&void 0!==o?o:e.maxBufferSize,e.maxBufferSize),this.Un=e.flushIntervalMs,this.Wn=e.maxBatchRecordsPerPost,this.Vn=e.rateCapWindowMs,this.Gn=e.maxLogsPerInterval}clearQueue(){this.$n++,this._instance.setPersistedProperty(S.LogsQueue,[])}reset(){this.Zn(),this.qn=0,this.jn=0,this.Bn=!1,this.Nn=0,this.Wn=this.vn.maxBatchRecordsPerPost}onReconnect(){this.Nn=0,this.Qn()}captureLog(t,e){var i;if(!this._instance.isDisabled&&!this._instance.optedOut&&null!=t&&t.body){var r=this.Jn(t);if(null!==r)if(r.body){if(this.Kn()){var n={record:Qe(r,null!==(i=null==e?void 0:e.context)&&void 0!==i?i:this.Pn(),this.I,null==e?void 0:e.occurredAtMs)};this.An((()=>this.Yn(n)))}}else this.I.info("Log was rejected in beforeSend function")}}Jn(t){var e=this.vn.beforeSend;if(!e)return t;var i=G(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}Kn(){if(void 0===this.Gn)return!0;var t=Date.now(),e=t-this.qn;return this.Vn>e&&e>=0||(this.qn=t,this.jn=0,this.Bn=!1),this.Gn>this.jn?(this.jn++,!0):(this.Bn||(this.I.warn("captureLog dropping logs: exceeded "+this.Gn+" logs per "+this.Vn+"ms"),this.Bn=!0),!1)}flush(){var t=this;return f((function*(){if(!t._instance.isDisabled)return t.Ln||(t.Ln=t.Xn().finally((()=>{t.Ln=null}))),t.Ln}))()}Xn(){var t=this;return f((function*(){var e;t.Zn();var i=null!==(e=t._instance.getPersistedProperty(S.LogsQueue))&&void 0!==e?e:[];if(0!==i.length)for(var r=i.length,n=0;i.length>0&&r>n;){var s,a,o=t.$n;t.Dn=0;var l=Math.min(i.length,t.Wn),u=i.slice(0,l),h=u.map((t=>t.record)),d=Ke(h,t.ts(),null!==(s=t.On)&&void 0!==s?s:t._instance.getLibraryId(),t._instance.getLibraryVersion()),v=yield t._instance.es(d);if(t.$n!==o)return;if("too-large"===v.kind&&u.length>1)t.Wn=Math.max(1,Math.floor(u.length/2)),t.I.warn("Received 413 when sending logs batch of size "+u.length+", reducing batch size to "+t.Wn);else{if("retry-later"===v.kind)throw v.error;if("too-large"===v.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"===v.kind&&t.vn.maxBatchRecordsPerPost>t.Wn&&(t.Wn=Math.min(t.vn.maxBatchRecordsPerPost,t.Wn+1)),yield t.rs(u.length),i=null!==(a=t._instance.getPersistedProperty(S.LogsQueue))&&void 0!==a?a:[],n+=u.length,"fatal"===v.kind)throw v.error}}}))()}rs(t){var e=this;return f((function*(){var i,r=Math.max(0,t-e.Dn),n=null!==(i=e._instance.getPersistedProperty(S.LogsQueue))&&void 0!==i?i:[];e._instance.setPersistedProperty(S.LogsQueue,n.slice(r)),yield e.Fn()}))()}ts(){return Je(this.vn,this._instance.getLibraryId(),this._instance.getLibraryVersion())}Yn(t){var e;if(!this._instance.optedOut){var i=null!==(e=this._instance.getPersistedProperty(S.LogsQueue))&&void 0!==e?e:[];this.zn>i.length||(i.shift(),this.Dn++,this.I.info("Logs queue is full, dropping oldest record.")),i.push(t),this._instance.setPersistedProperty(S.LogsQueue,i),this.Hn>i.length?this.ns():this.Qn()}}ns(t){void 0===t&&(t=this.Un),this.ss||(this.ss=Me((()=>{this.ss=void 0,this.Qn()}),t))}os(){var t=Math.min(Math.max(0,this.Nn-1),6);return this.Un*Math.pow(2,t)}ls(){var t=this._instance.getPersistedProperty(S.LogsQueue);return!!t&&t.length>0}shutdown(t){var e=this;return f((function*(){e.Zn();var i=e.flush().catch((()=>{}));void 0!==t?yield Ee(i,t):yield i}))()}flushWithTimeout(t){var e=this;return f((function*(){var i=e.flush();yield Ee(i,t,(()=>{i.catch((()=>{}))}))}))()}Qn(){this.flush().then((()=>{this.Nn=0}),(t=>{this.Nn++,this.I.error("PostHog logs flush failed:",t)})).finally((()=>{!this._instance.isDisabled&&this.ls()&&this.ns(this.os())}))}Zn(){this.ss&&(clearTimeout(this.ss),this.ss=void 0)}};var Xe=[0,5,10,25,50,75,100,250,500,750,1e3,2500,5e3,7500,1e4];function ti(t){return String(t)+"000000"}function ei(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 ii=class{constructor(t,e,i){this._instance=t,this.vn=e,this.I=i,this.us=new Map,this.Ln=null,this.hs=!1,this.ds=new Map,this.vs=new Set,this.cs=0}count(t,e,i){void 0===e&&(e=1),this.fs({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.fs({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.fs({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.ps()}));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.us.size)return null;var t=this.us;return this.us=new Map,this.hs=!1,this.ds=new Map,this.vs=new Set,this.gs(t)}reset(){this.cs++,this.Zn(),this.us=new Map,this.Ln=null,this.hs=!1,this.ds=new Map,this.vs=new Set}fs(t){if(!this._instance.isDisabled&&!this._instance.optedOut){var e=this.Jn(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=ei(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.us.get(r);if(!n){if(!this.ys())return;n={name:e.name,type:e.type,unit:e.unit,attributes:i,windowStartMs:Date.now()},this.us.set(r,n)}var s=this.ds.get(e.name);void 0===s?this.ds.set(e.name,e.type):s===e.type||this.vs.has(e.name)||(this.vs.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.bs(n,e.value),this.ns()}else this.I.warn("Dropping metric '"+e.name+"': value must be a finite number");else this.I.warn("Dropping metric with empty name")}}ys(){return this.vn.maxSeriesPerFlush>this.us.size||(this.hs||(this.hs=!0,this.I.warn("Metric series cap reached ("+this.vn.maxSeriesPerFlush+" per flush window); dropping new series until the next flush. Reduce attribute cardinality.")),!1)}bs(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(Xe.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,Xe)]+=1}}Jn(t){var e=this.vn.beforeSend;if(!e)return t;var i=G(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}ns(){this.ss||(this.ss=Me((()=>{this.ss=void 0,this.flush().catch((t=>{this.I.error("Metrics flush failed:",t)}))}),this.vn.flushIntervalMs))}Zn(){this.ss&&(clearTimeout(this.ss),this.ss=void 0)}ps(){var t=this;return f((function*(){if(0!==t.us.size){var e=t.us;t.us=new Map,t.hs=!1,t.ds=new Map,t.vs=new Set;var i=t.cs,r=yield t._instance._s(t.gs(e));if(i===t.cs)switch(r.kind){case"ok":return;case"retry-later":return t.ws(e),void t.ns();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)}}}))()}gs(t){return e=this.ks(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.vn,this._instance.getLibraryId(),this._instance.getLibraryVersion()),r=this._instance.getLibraryId(),n=this._instance.getLibraryVersion(),{resourceMetrics:[{resource:{attributes:Ue(i)},scopeMetrics:[{scope:{name:r,version:n},metrics:e}]}]};var e,i,r,n}ks(t){var e=ti(Date.now()),i=new Map;for(var r of t.values()){var n,s=ei(r.type,r.name,r.unit,void 0),a=i.get(s);a||(a=p({name:r.name},r.unit&&{unit:r.unit}),"count"===r.type?a.sum={aggregationTemporality:1,isMonotonic:!0,dataPoints:[]}:"gauge"===r.type?a.gauge={dataPoints:[]}:a.histogram={aggregationTemporality:1,dataPoints:[]},i.set(s,a));var o=Ue(null!==(n=r.attributes)&&void 0!==n?n:{},this.I),l=ti(r.windowStartMs);if("count"===r.type){var u,h={attributes:o,startTimeUnixNano:l,timeUnixNano:e,asDouble:null!==(u=r.total)&&void 0!==u?u:0};a.sum.dataPoints.push(h)}else if("gauge"===r.type){var d,v={attributes:o,timeUnixNano:e,asDouble:null!==(d=r.last)&&void 0!==d?d:0};a.gauge.dataPoints.push(v)}else r.hist&&a.histogram.dataPoints.push({attributes:o,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:Xe})}return Array.from(i.values())}ws(t){var e,i;for(var r of t){var n=r[0],s=r[1],a=this.us.get(n);if(a)switch(a.windowStartMs=Math.min(a.windowStartMs,s.windowStartMs),a.type){case"count":a.total=(null!==(e=a.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(a.hist){a.hist.count+=s.hist.count,a.hist.sum+=s.hist.sum,a.hist.min=Math.min(a.hist.min,s.hist.min),a.hist.max=Math.max(a.hist.max,s.hist.max);for(var o=0;a.hist.bucketCounts.length>o;o++)a.hist.bucketCounts[o]+=s.hist.bucketCounts[o]}else a.hist=s.hist}else this.ys()&&this.us.set(n,s)}}};function ri(t,e){if(t){var i=t.find((t=>t.type===e));return null==i?void 0:i.value}}var ni,si,ai;function oi(t){var e=globalThis._posthogChunkIds;if(e){var i=Object.keys(e);return ai&&i.length===si||(si=i.length,ai=i.reduce(((i,r)=>{ni||(ni={});var n=ni[r];if(n)i[n[0]]=n[1];else for(var s=t(r),a=s.length-1;a>=0;a--){var o=s[a],l=null==o?void 0:o.filename,u=e[r];if(l&&u){i[l]=u,ni[r]=[l,u];break}}return i}),{})),ai}}class li{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&&G(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 a=[s];return null!=t.cause&&a.push(...this.convertToExceptionList(t.cause,p({},e,{handled:!0}))),a}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 ui="?";function hi(t,e,i,r,n){var s={platform:t,filename:e,function:"<anonymous>"===i?ui:i,in_app:!(null!=e&&e.startsWith("webkit-masked-url://"))&&"<anonymous>"!==e};return K(r)||(s.lineno=r),K(n)||(s.colno=n),s}var di=(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]:ui,i?"safari-extension:"+e:"safari-web-extension:"+e]:[t,e]},vi=/^\s*at (\S+?)(?::(\d+))(?::(\d+))\s*$/i,ci=/^\s*at (?:(.+?\)(?: \[.+\])?|.*?) ?\((?:address at )?)?(?:async )?((?:<anonymous>|[-a-z]+:|.*bundle|\/)?.*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i,fi=/\((\S*)(?::(\d+))(?::(\d+))\)/,pi=(t,e)=>{var i=vi.exec(t);if(i)return hi(e,i[1],ui,+i[2],+i[3]);var r=ci.exec(t);if(r){if(r[2]&&0===r[2].indexOf("eval")){var n=fi.exec(r[2]);n&&(r[2]=n[1],r[3]=n[2],r[4]=n[3])}var s=di(r[1]||ui,r[2]);return hi(e,s[1],s[0],r[3]?+r[3]:void 0,r[4]?+r[4]:void 0)}},gi=/^\s*(.*?)(?:\((.*?)\))?(?:^|@)?((?:[-a-z]+)?:\/.*?|\[native code\]|[^@]*(?:bundle|\d+\.js)|\/[\w\-. /=]+)(?::(\d+))?(?::(\d+))?\s*$/i,mi=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i,yi=(t,e)=>{var i=gi.exec(t);if(i){if(i[3]&&i[3].indexOf(" > eval")>-1){var r=mi.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]||ui,a=di(s,n);return hi(e,n=a[1],s=a[0],i[4]?+i[4]:void 0,i[5]?+i[5]:void 0)}},bi=/\(error: (.*)\)/,_i=50;class wi{match(t){return this.isDOMException(t)||this.isDOMError(t)}coerce(t,e){var i=Y(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 ut(t,"DOMException")}isDOMError(t){return ut(t,"DOMError")}}class ki{match(t){return ht(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 Si{constructor(){}match(t){return!!ut(t,"ErrorEvent")&&(null!=t.error||this.$i(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.Ui(t))&&void 0!==i?i:r.stack,synthetic:!0})}$i(t){return Y(t.message)&&t.message.length>0}Ui(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(Y(r.filename)&&0!==r.filename.length&&0!==n)return"Error\n at "+r.filename+":"+n+":"+s}}var xi=/^(?:[Uu]ncaught (?:exception: )?)?(?:((?:Eval|Internal|Range|Reference|Syntax|Type|URI|)Error): )?(.*)$/i;class Ci{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(xi);return r&&(e=r[1],i=r[2]),[e,i]}}var Ti=["fatal","error","warning","log","info","debug"];function Mi(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(dt(t))return t.constructor.name;var e="name"in t?t.name:void 0;return Y(e)&&!X(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: "+Mi(t)}isSeverityLevel(t){return Y(t)&&!X(t)&&Ti.indexOf(t)>=0}getStack(t){try{return Y(t.stacktrace)&&t.stacktrace.length>0?t.stacktrace:Y(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(ht(i))return i}}getObjectClassName(t){try{var e=Object.getPrototypeOf(t);return e?e.constructor.name:void 0}catch(t){return}}}class Ii{match(t){return dt(t)}coerce(t,e){var i,r=t.constructor.name;return{type:r,value:r+" captured as exception with keys: "+Mi(t),stack:null==(i=e.syntheticException)?void 0:i.stack,synthetic:!0}}}class Ri{match(t){return lt(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 Pi{match(t){return ut(t,"PromiseRejectionEvent")||this.isCustomEventWrappingRejection(t)}isCustomEventWrappingRejection(t){if(!dt(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 lt(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 Ai="$message",Fi="$timestamp",Oi=new Set([Ai,Fi]),Li={enabled:!0,max_bytes:32768};function Di(t){var e;return t?{enabled:null!==(e=t.enabled)&&void 0!==e?e:Li.enabled,max_bytes:Ni(t.max_bytes,Li.max_bytes)}:p({},Li)}class $i{constructor(t){this.Ss=[],this.xs=0,this.vn=Di(t)}setConfig(t){this.vn=Di(t),this.Cs()}add(t){var e=function(t){var e;try{e=z(t)}catch(t){return}try{var i=JSON.parse(e);if(!Q(i))return;var r=i,n=r[Ai],s=r[Fi];if(!Y(n)||0===n.trim().length)return;if(!Y(s)&&!it(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.vn.max_bytes||(this.Ss.push({step:e.step,bytes:i}),this.xs+=i,this.Cs())}}getAttachable(){return this.Ss.map((t=>t.step))}clear(){this.Ss=[],this.xs=0}size(){return this.Ss.length}Cs(){for(;this.xs>this.vn.max_bytes&&this.Ss.length>0;){var t=this.Ss.shift();t&&(this.xs-=t.bytes)}}}function Ni(t,e){if(!it(t)||t===1/0||t===-1/0)return e;var i=Math.floor(t);return 0>i?e:i}var qi={DEBUG:!1,LIB_VERSION:"0.6.2",LIB_NAME:"browser-common"},ji=function(e,i){var r=(void 0===i?{}:i).debugEnabled,n={P(i){if(t&&(qi.DEBUG||t.POSTHOG_DEBUG||r)&&!K(t.console)&&t.console){for(var n=("__rrweb_original__"in t.console[i]?t.console[i].__rrweb_original__:t.console[i]),s=arguments.length,a=new Array(s>1?s-1:0),o=1;s>o;o++)a[o-1]=arguments[o];n(e,...a)}},debug(){for(var t=arguments.length,e=new Array(t),i=0;t>i;i++)e[i]=arguments[i];n.P("debug",...e)},info(){for(var t=arguments.length,e=new Array(t),i=0;t>i;i++)e[i]=arguments[i];n.P("log",...e)},warn(){for(var t=arguments.length,e=new Array(t),i=0;t>i;i++)e[i]=arguments[i];n.P("warn",...e)},error(){for(var t=arguments.length,e=new Array(t),i=0;t>i;i++)e[i]=arguments[i];n.P("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)=>ji(e+" "+t,i)};return n},Bi=ji("[PostHog.js]"),Hi=Bi.createLogger;function zi(t,e){G(t)&&t.forEach(e)}function Ui(t,e){if(!et(t))if(G(t))t.forEach(e);else if(st(t))t.forEach(((t,i)=>e(t,i)));else for(var i in t)W.call(t,i)&&e(t[i],i)}var Wi=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 Vi(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 Gi=function(t){try{return t()}catch(t){return}},Zi=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){Bi.critical("Implementation error. Please turn on debug mode and open a ticket on https://app.posthog.com/home#panel=support%3Asupport%3A."),Bi.critical(t)}}},Qi=function(t){var e={};return Ui(t,(function(t,i){(Y(t)&&t.length>0||it(t))&&(e[i]=t)})),e};var Ji=["herokuapp.com","vercel.app","netlify.app"];function Ki(t){var e=null==t?void 0:t.hostname;if(!Y(e))return!1;var i=e.split(".").slice(-2).join(".");for(var r of Ji)if(i===r)return!1;return!0}function Yi(t,e,i,r){var n=null!=r?r:{},s=n.capture,a=n.passive;null==t||t.addEventListener(e,i,{capture:void 0!==s&&s,passive:void 0===a||a})}function Xi(t){return"ph_toolbar_internal"===t.name}var tr=["localhost","127.0.0.1"],er=(t,e)=>{try{return JSON.stringify(t,((t,e)=>"bigint"==typeof e?e.toString():e),e)}catch(e){return z(t)}},ir=t=>{var e=null==r?void 0:r.createElement("a");return K(e)?null:(e.href=t,e)},rr=function(t,e){var i,r;void 0===e&&(e="&");var n=[];return Ui(t,(function(t,e){K(t)||K(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)},nr=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(!G(i)||2>i.length)return"";var a=i[1];try{a=decodeURIComponent(a)}catch(t){Bi.error("Skipping decoding for malformed query param: "+a)}return a.replace(/\+/g," ")},sr=function(t,e,i){if(!t||!e||!e.length)return t;for(var r=t.split("#"),n=r[1],s=(r[0]||"").split("?"),a=s[1],o=s[0],l=(a||"").split("&"),u=[],h=0;l.length>h;h++){var d=l[h].split("=");G(d)&&(e.includes(d[0])?u.push(d[0]+"="+i):u.push(l[h]))}var v=o;return null!=a&&(v+="?"+u.join("&")),null!=n&&(v+="#"+n),v},ar=function(t,e){var i=t.match(new RegExp(e+"=([^&]*)"));return i?i[1]:null},or=(t,e)=>t>=e&&h(),lr=(t,e,i,r)=>{if(0===t){if(h()){var n=e+1;return n===i&&r(),n}return e}return 0};function ur(t,e){var i,r=null==t||null==(i=t.config)?void 0:i.get_current_url;if(!Z(r))return e;try{var n=r(e);return Y(n)&&n?n:e}catch(t){return Bi.error("Error in get_current_url, falling back to window.location.href",t),e}}function hr(e){var i,r=null==t||null==(i=t.location)?void 0:i.href;return K(r)?void 0:ur(e,r)}var dr="__POSTHOG_TOOLBAR__",vr=1,cr=3,fr=11;function pr(t){return t instanceof Element&&(t.id===dr||!(null==t.closest||!t.closest(".toolbar-global-fade-container")))}function gr(t){return!!t&&t.nodeType===vr}function mr(t,e){return!!t&&!!t.tagName&&t.tagName.toLowerCase()===e.toLowerCase()}function yr(t){return!!t&&t.nodeType===cr}function br(t){return!!t&&t.nodeType===fr&&gr(t.host)}var _r=1e3;function wr(t){return t?B(t).split(/\s+/):[]}function kr(t,e){var i=hr(e);return!!(i&&t&&t.some((t=>i.match(t))))}function Sr(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 wr(e)}function xr(t){return et(t)?null:B(t).split(/(\s+)/).filter((t=>Qr(t))).join("").replace(/[\r\n]/g," ").replace(/[ ]+/g," ").substring(0,255)}function Cr(t){var e="";return jr(t)&&!Br(t)&&t.childNodes&&t.childNodes.length&&Ui(t.childNodes,(function(t){var i;yr(t)&&t.textContent&&(e+=null!==(i=xr(t.textContent))&&void 0!==i?i:"")})),B(e)}function Tr(t){var e;return K(t.target)?t.srcElement||null:null!=(e=t.target)&&e.shadowRoot?t.composedPath()[0]||null:t.target||null}var Mr=["a","button","form","input","select","textarea","label"];function Er(t,e){if(K(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 Ir(t){var e=t.parentNode;return!(!e||!gr(e))&&e}var Rr=[".ph-no-autocapture","[data-ph-no-autocapture]"],Pr=["next","previous","prev",">","<"],Ar=[...Pr,"+","-","−","–"],Fr=(t,e)=>/[a-z0-9]/i.test(e)?t.includes(e):t===e,Or=[".ph-no-deadclick",".ph-no-capture"],Lr=[".ph-no-rageclick",".ph-no-capture"],Dr=["","text","search","email","password","url","tel","number"];function $r(e,i){if(!t||Nr(e))return!1;var r,n,s,a,o;if(nt(i)?(r=!!i&&Lr,n=void 0,s=!1):(r=null!==(a=null==i?void 0:i.css_selector_ignorelist)&&void 0!==a?a:Lr,n=null==i?void 0:i.content_ignorelist,s=null!==(o=null==i?void 0:i.ignore_text_selection)&&void 0!==o&&o),!1===r)return!1;if(s&&function(t){return!(!t||!gr(t))&&(!!mr(t,"textarea")||(mr(t,"input")?j(Dr,(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=qr(e,!1).targetElementList;return!function(t,e){if(!1===t||K(t))return!1;var i;if(!0===t)i=Pr;else{if(!G(t))return!1;if(t.length>10)return Bi.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=>Fr(e,t)||Fr(r,t)))}))}(n,l.map((t=>{var e;return{safeText:Cr(t).toLowerCase(),ariaLabel:(null==(e=t.getAttribute("aria-label"))?void 0:e.toLowerCase().trim())||""}})))&&!Er(l,r)}var Nr=t=>!t||mr(t,"html")||!gr(t),qr=(e,i)=>{if(!t||Nr(e))return{parentIsUsefulElement:!1,targetElementList:[]};for(var r=!1,n=[e],s=e;s.parentNode&&!mr(s,"body");)if(br(s.parentNode))n.push(s.parentNode.host),s=s.parentNode.host;else{var a=Ir(s);if(!a)break;if(i||Mr.indexOf(a.tagName.toLowerCase())>-1)r=!0;else try{var o=t.getComputedStyle(a);o&&"pointer"===o.getPropertyValue("cursor")&&(r=!0)}catch(t){}n.push(a),s=a}return{parentIsUsefulElement:r,targetElementList:n}};function jr(t){for(var e=new Set,i=0,r=t;r.parentNode&&!mr(r,"body");r=r.parentNode){if(i++>=_r||e.has(r))return!1;e.add(r);var n=Sr(r);if(j(n,"ph-sensitive")||j(n,"ph-no-capture"))return!1}if(j(Sr(t),"ph-include"))return!0;var s=t.type||"";if(Y(s))switch(s.toLowerCase()){case"hidden":case"password":return!1}var a=t.name||t.id||"";return!Y(a)||!/^cc|cardnum|ccnum|creditcard|csc|cvc|cvv|exp|pass|pwd|routing|seccode|securitycode|securitynum|socialsec|socsec|ssn/i.test(a.replace(/[^a-zA-Z0-9]/g,""))}function Br(t){return!!(mr(t,"input")&&!["button","checkbox","submit","reset"].includes(t.type)||mr(t,"select")||mr(t,"textarea")||"true"===t.getAttribute("contenteditable"))}var Hr=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}))$"),zr=/(^|[^0-9A-Za-z_])([0-9][0-9 -]*[0-9])(?=$|[^0-9A-Za-z_])/g,Ur=[16,15,14,13],Wr=new RegExp("^(\\d{3}-?\\d{2}-?\\d{4})$"),Vr=new RegExp("(^|[^0-9])((?!000|666)[0-9]{3}-?(?!00)[0-9]{2}-?(?!0000)[0-9]{4})(?=$|([^0-9]))","g"),Gr=/[0-9A-Za-z_]/;function Zr(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 Qr(t,e){if(void 0===e&&(e=!0),et(t))return!1;if(Y(t)){t=B(t);var i=e?Hr.test((t||"").replace(/[- ]/g,"")):function(t){var e;for(zr.lastIndex=0;e=zr.exec(t);){var i=e[2];if(i)for(var r=i.replace(/[- ]/g,""),n=0;r.length>n;n++)for(var s of Ur){var a=n+s;if(r.length>=a){var o=r.slice(n,a);if(Hr.test(o)&&Zr(o))return!0}}}return!1}(t);if(i)return!1;var r=e?Wr.test(t):function(t){var e;for(Vr.lastIndex=0;e=Vr.exec(t);){var i=e[1],r=e[3];if(!(i&&r&&Gr.test(i)&&Gr.test(r)))return!0}return!1}(t);if(r)return!1}return!0}function Jr(t){var e=Cr(t);return Qr(e=(e+" "+Kr(t)).trim())?e:""}function Kr(t){var e="";return t&&t.childNodes&&t.childNodes.length&&Ui(t.childNodes,(function(t){var i;if(t&&"span"===(null==(i=t.tagName)?void 0:i.toLowerCase()))try{var r=Cr(t);e=(e+" "+r).trim(),t.childNodes&&t.childNodes.length&&(e=(e+" "+Kr(t)).trim())}catch(t){Bi.error("[AutoCapture]",t)}})),e}function Yr(t){return t.replace(/"|\\"/g,'\\"')}function Xr(t){var e=t.attr__class;if(e)return G(e)?e:wr(e)}var tn="[SessionRecording]",en="redacted",rn=1e6;function nn(t){var e;return Math.min(rn,null!==(e=t.payloadSizeLimitBytes)&&void 0!==e?e:rn)}var sn={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:rn,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},an=["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"],ln=["auth","token","secret","session","api-key","apikey","api_key","credential","password","passwd","cookie","csrf","xsrf"],un=t=>{et(t)||Ui(Object.keys(t),(e=>{(t=>{var e=t.toLowerCase();return an.includes(e)||ln.some((t=>e.includes(t)))})(e)&&(t[e]=en)}))},hn=["/s/","/e/","/i/"];function dn(t,e,i,r){if(et(t))return t;var n=(null==e?void 0:e["content-length"])||function(t){return new Blob([t]).size}(t);return Y(n)&&(n=parseInt(n)),n>i?tn+" "+r+" body too large to record ("+n+" bytes)":t}function vn(t,e){if(et(t))return t;var i=t;return Qr(i,!1)||(i=tn+" "+e+" body "+en),Ui(on,(t=>{var r,n;null!=(r=i)&&r.length&&-1!==(null==(n=i)?void 0:n.indexOf(t))&&(i=tn+" "+e+" body "+en+" as might contain: "+t)})),i}var cn=new WeakSet,fn="$people_distinct_id",pn="distinct_id",gn="$device_id",mn="$device_model",yn="__alias",bn="__timers",_n="$autocapture_disabled_server_side",wn="$heatmaps_enabled_server_side",kn="$exception_capture_enabled_server_side",Sn="$error_tracking_suppression_rules",xn="$error_tracking_capture_extension_exceptions",Cn="$web_vitals_enabled_server_side",Tn="$dead_clicks_enabled_server_side",Mn="$product_tours_enabled_server_side",En="$logs_capture_enabled_server_side",In="$web_vitals_allowed_metrics",Rn="$session_recording_remote_config",Pn="$replay_sample_rate",An="$replay_override_sampling",Fn="$replay_override_linked_flag",On="$replay_override_url_trigger",Ln="$replay_override_event_trigger",Dn="$sesid",$n="$session_is_sampled",Nn="$session_past_minimum_duration",qn="$session_recording_url_trigger_activated_session",jn="$session_recording_event_trigger_activated_session",Bn="$posthog_sr_group_event_trigger_",Hn="$posthog_sr_group_url_trigger_",zn="$posthog_sr_group_sampling_",Un="$debug_first_full_snapshot_timestamp",Wn="$sess_rec_flush_size",Vn="$enabled_feature_flags",Gn="$active_feature_flags",Zn="$early_access_features",Qn="$feature_flag_details",Jn="$feature_flag_payloads",Kn="$feature_flag_request_id",Yn="$minimal_flag_called_events",Xn="$override_feature_flags",ts="$override_feature_flag_payloads",es="$stored_person_properties",is="$stored_group_properties",rs="$groups",ns="$surveys",ss="$surveys_loaded_at",as="$surveys_activated",os="$surveys_activated_session",ls="$surveys_activated_timestamps",us="ph_product_tours",hs="$flag_call_reported",ds="$flag_call_reported_session_id",vs="$feature_flag_errors",cs="$feature_flag_evaluated_at",fs="$user_state",ps="$client_session_props",gs="$capture_rate_limit",ms="$initial_campaign_params",ys="$initial_referrer_info",bs="$initial_person_info",_s="$epp",ws="$posthog_cookieless",ks="$cookieless_mode",Ss="$sdk_debug_extensions_init_method",xs="$sdk_debug_extensions_init_time_ms",Cs="$sdk_debug_recording_script_not_loaded",Ts="$sdk_debug_replay_event_trigger_status",Ms="$sdk_debug_replay_linked_flag_trigger_status",Es="$sdk_debug_replay_matched_recording_trigger_groups",Is="$sdk_debug_replay_pending_trigger_conditions",Rs="$sdk_debug_replay_remote_trigger_matching_config",Ps="$sdk_debug_replay_trigger_groups_count",As="$sdk_debug_replay_url_trigger_status",Fs="$session_recording_start_reason",Os="PostHog loadExternalDependency extension not found.",Ls="on_reject",Ds="always",$s="anonymous",Ns="identified",qs="identified_only",js="visibilitychange",Bs="beforeunload",Hs="$pageview",zs="$pageleave",Us="$identify",Ws="$groupidentify",Vs="disabled",Gs="sampled",Zs="active",Qs="buffering",Js="paused",Ks="lazy_loading",Ys="awaiting_config",Xs="missing_config",ta="rrweb_error",ea="trigger",ia=ea+"_activated",ra=ea+"_pending",na=ea+"_"+Vs;function sa(t,e,i,r,n,s){return 0===e?na:(null==t?void 0:t.get_property(i?r+i:n))===s?ia:ra}function aa(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 oa(t){return t.includes(ia)?ia:t.includes(ra)?ra:na}function la(t){var e=new Set(t);switch(e.delete(na),e.size){case 0:return na;case 1:return Array.from(e)[0];default:return ra}}class ua{constructor(t){this.F=t}triggerStatus(t){return oa(this.F.map((e=>e.triggerStatus(t))))}triggerStatusNoSideEffects(t){return oa(this.F.map((e=>e.triggerStatusNoSideEffects(t))))}stop(){this.F.forEach((t=>t.stop()))}}class ha{constructor(t){this.F=t}triggerStatus(t){return la(this.F.map((e=>e.triggerStatus(t))))}triggerStatusNoSideEffects(t){return la(this.F.map((e=>e.triggerStatusNoSideEffects(t))))}stop(){this.F.forEach((t=>t.stop()))}}class da{triggerStatus(){return this.triggerStatusNoSideEffects()}triggerStatusNoSideEffects(){return ia}stop(){}}var va=t=>"sessionRecording"in t;class ca{constructor(t,e){this.N=[],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.N=(va(t)?Q(t.sessionRecording)?null==(e=t.sessionRecording)?void 0:e.urlTriggers:[]:null==t?void 0:t.urlTriggers)||[],this.q=(va(t)?Q(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.N))if("regex"===t.matching&&!this.j.has(t.url))try{this.j.set(t.url,new RegExp(t.url))}catch(e){Bi.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){Bi.error("Invalid URL blocklist regex pattern:",e.url,t)}}onRemoteConfig(t){this.onConfig(t)}W(t){return sa(this._instance,this.N.length,this.$,Hn,qn,t)}triggerStatus(t){var e=this.triggerStatusNoSideEffects(t);return this._instance.register_for_session({[As]:e}),e}triggerStatusNoSideEffects(t){return this.W(t)}isCurrentUrlBlocked(){var t=hr(this._instance);if(!t)return!1;try{return aa(t,this.q,this.B)}catch(t){return!0}}checkUrlBlocklist(t,e){var i=hr(this._instance);if(i&&i!==this.H){this.H=i;var r=this.urlBlocked,n=aa(i,this.q,this.B);r&&n||(n&&!r?t():!n&&r&&e())}}checkUrlTriggerConditions(t,e,i,r){var n=hr(this._instance);if(n&&n!==this.H){this.H=n;var s=this.urlBlocked,a=aa(n,this.q,this.B);a&&!s?t():!a&&s&&e();var o=this.W(r)===ia,l=aa(n,this.N,this.j);!o&&l&&i("url",n)}}stop(){this.H=""}}class fa{constructor(t){this.linkedFlag=null,this.linkedFlagSeen=!1,this.V=()=>{},this._instance=t}triggerStatus(){var t=this.triggerStatusNoSideEffects();return this._instance.register_for_session({[Ms]:t}),t}triggerStatusNoSideEffects(){var t=ra;return et(this.linkedFlag)&&(t=na),this.linkedFlagSeen&&(t=ia),t}onConfig(t,e){var i;if(this.linkedFlag=(va(t)?Q(t.sessionRecording)?null==(i=t.sessionRecording)?void 0:i.linkedFlag:null:null==t?void 0:t.linkedFlag)||null,!et(this.linkedFlag)&&!this.linkedFlagSeen){var r=Y(this.linkedFlag)?this.linkedFlag:this.linkedFlag.flag,n=Y(this.linkedFlag)?null:this.linkedFlag.variant;this.V=this._instance.onFeatureFlags(((t,i)=>{var s=!1;if(Q(i)&&r in i){var a=i[r];s=nt(a)?!0===a:n?a===n:!!a}var o=s&&!this.linkedFlagSeen;this.linkedFlagSeen=s,o&&e(r,n)}))}}onRemoteConfig(t,e){this.onConfig(t,e)}stop(){this.V()}}class pa{constructor(t,e){this.Z=[],this._instance=t,this.$=e}onConfig(t){var e;this.Z=(va(t)?Q(t.sessionRecording)?null==(e=t.sessionRecording)?void 0:e.eventTriggers:[]:null==t?void 0:t.eventTriggers)||[]}onRemoteConfig(t){this.onConfig(t)}G(t){return sa(this._instance,this.Z.length,this.$,Bn,jn,t)}triggerStatus(t){var e=this.triggerStatusNoSideEffects(t);return this._instance.register_for_session({[Ts]:e}),e}triggerStatusNoSideEffects(t){return this.G(t)}checkEventTriggerConditions(t,e,i){if(0!==this.Z.length){var r=this.G(i)===ia,n=this.Z.includes(t);!r&&n&&e("event",t)}}stop(){}}class ga{constructor(t,e,i){if(this._instance=t,this.group=e,this.J=new ca(t,e.id),this.Y=new pa(t,e.id),this.K=new fa(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.J.onConfig(n),this.Y.onConfig(n),this.K.onConfig(n,i);var s=[this.Y,this.J,this.K];this.X="any"===e.conditions.matchType?new ua(s):new ha(s)}else this.X=new da}triggerStatus(t){return this.X.triggerStatus(t)}triggerStatusNoSideEffects(t){return this.X.triggerStatusNoSideEffects(t)}getPendingTriggerConditions(t){return this.triggerStatusNoSideEffects(t)!==ra?[]:[{label:"URL condition not matched",status:this.J.triggerStatusNoSideEffects(t)},{label:"event condition not matched",status:this.Y.triggerStatusNoSideEffects(t)},{label:"linked flag condition not matched",status:this.K.triggerStatusNoSideEffects()}].filter((t=>t.status===ra)).map((t=>t.label))}checkEventTriggerConditions(t,e,i){this.Y.checkEventTriggerConditions(t,e,i)}checkUrlTriggerConditions(t,e,i,r){this.J.checkUrlTriggerConditions(t,e,i,r)}activateTrigger(t,e){var i;null==(i=this._instance.persistence)||i.register({["url"===t?Hn+this.group.id:Bn+this.group.id]:e})}stop(){this.J.stop(),this.Y.stop(),this.K.stop()}}function ma(t){if(t.rrwebError)return ta;if(!t.receivedFlags)return Qs;if(!t.isRecordingEnabled)return Vs;if(t.urlTriggerMatching.urlBlocked)return Js;var e=!0===t.isSampled,i=new ua([t.eventTriggerMatching,t.urlTriggerMatching,t.linkedFlagMatching]).triggerStatus(t.sessionId);return e?Gs:i===ia?Zs:i===ra?Qs:!1===t.isSampled?Vs:Zs}function ya(t){if(t.rrwebError)return ta;if(!t.receivedFlags)return Qs;if(!t.isRecordingEnabled)return Vs;if(t.urlTriggerMatching.urlBlocked)return Js;var e=new ha([t.eventTriggerMatching,t.urlTriggerMatching,t.linkedFlagMatching]).triggerStatus(t.sessionId),i=e!==na,r=nt(t.isSampled);return i&&e===ra?Qs:i&&e===na||r&&!t.isSampled?Vs:!0===t.isSampled?Gs:Zs}function ba(){var t=[];return function(e,i){if(Q(i)||G(i)){for(;t.length>0&&t[t.length-1]!==this;)t.pop();return t.includes(i)?"[Circular]":(t.push(i),i)}return i}}function _a(t){var e=JSON.stringify(t,ba());return e?new Blob([e]).size:0}function wa(t){if(tt(t))return 4;if(K(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(G(t)){for(var e=2,i=0;t.length>i;i++){i>0&&(e+=1);var r=t[i];e+=K(r)||tt(r)?4:wa(r)}return e}var n=t,s=2,a=!0;for(var o in n)if({}.hasOwnProperty.call(n,o)){var l=n[o];K(l)||(a||(s+=1),a=!1,s+=o.length+3+wa(l))}return s;default:return 0}}function ka(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[ka({size:r.reduce(((t,e)=>t+e),0),data:t.data.slice(0,i),sizes:r,sessionId:t.sessionId,windowId:t.windowId}),ka({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 Sa=Uint8Array,xa=Uint16Array,Ca=Uint32Array,Ta=new Sa([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]),Ma=new Sa([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]),Ea=new Sa([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),Ia=function(t,e){for(var i=new xa(31),r=0;31>r;++r)i[r]=e+=1<<t[r-1];var n=new Ca(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]},Ra=Ia(Ta,2),Pa=Ra[1];Ra[0][28]=258,Pa[258]=28;for(var Aa=Ia(Ma,0)[1],Fa=new xa(32768),Oa=0;32768>Oa;++Oa){var La=(43690&Oa)>>>1|(21845&Oa)<<1;Fa[Oa]=((65280&(La=(61680&(La=(52428&La)>>>2|(13107&La)<<2))>>>4|(3855&La)<<4))>>>8|(255&La)<<8)>>>1}var Da=function(t,e,i){for(var r=t.length,n=0,s=new xa(e);r>n;++n)++s[t[n]-1];var a,o=new xa(e);for(n=0;e>n;++n)o[n]=o[n-1]+s[n-1]<<1;if(i){a=new xa(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=o[t[n]-1]++<<h,v=d|(1<<h)-1;v>=d;++d)a[Fa[d]>>>l]=u}else for(a=new xa(r),n=0;r>n;++n)a[n]=Fa[o[t[n]-1]++]>>>15-t[n];return a},$a=new Sa(288);for(Oa=0;144>Oa;++Oa)$a[Oa]=8;for(Oa=144;256>Oa;++Oa)$a[Oa]=9;for(Oa=256;280>Oa;++Oa)$a[Oa]=7;for(Oa=280;288>Oa;++Oa)$a[Oa]=8;var Na=new Sa(32);for(Oa=0;32>Oa;++Oa)Na[Oa]=5;var qa=Da($a,9,0),ja=Da(Na,5,0),Ba=function(t){return(t/8>>0)+(7&t&&1)},Ha=function(t,e,i){(null==i||i>t.length)&&(i=t.length);var r=new(t instanceof xa?xa:t instanceof Ca?Ca:Sa)(i-e);return r.set(t.subarray(e,i)),r},za=function(t,e,i){var r=e/8>>0;t[r]|=i<<=7&e,t[r+1]|=i>>>8},Ua=function(t,e,i){var r=e/8>>0;t[r]|=i<<=7&e,t[r+1]|=i>>>8,t[r+2]|=i>>>16},Wa=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 Sa(0),0];if(1==n){var a=new Sa(i[0].s+1);return a[i[0].s]=1,[a,1]}i.sort((function(t,e){return t.f-e.f})),i.push({s:-1,f:25001});var o=i[0],l=i[1],u=0,h=1,d=2;for(i[0]={s:-1,f:o.f+l.f,l:o,r:l};h!=n-1;)o=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:o.f+l.f,l:o,r:l};var v=s[0].s;for(r=1;n>r;++r)s[r].s>v&&(v=s[r].s);var c=new xa(v+1),f=Va(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 b=s[r].s;e>c[b]?p-=1<<e-c[b]++-1:++r}for(;r>=0&&p;--r){var _=s[r].s;c[_]==e&&(--c[_],++p)}f=e}return[new Sa(c),f]},Va=function(t,e,i){return-1==t.s?Math.max(Va(t.l,e,i+1),Va(t.r,e,i+1)):e[t.s]=i},Ga=function(t){for(var e=t.length;e&&!t[--e];);for(var i=new xa(++e),r=0,n=t[0],s=1,a=function(t){i[r++]=t},o=1;e>=o;++o)if(t[o]==n&&o!=e)++s;else{if(!n&&s>2){for(;s>138;s-=138)a(32754);s>2&&(a(s>10?s-11<<5|28690:s-3<<5|12305),s=0)}else if(s>3){for(a(n),--s;s>6;s-=6)a(8304);s>2&&(a(s-3<<5|8208),s=0)}for(;s--;)a(n);s=1,n=t[o]}return[i.subarray(0,r),e]},Za=function(t,e){for(var i=0,r=0;e.length>r;++r)i+=t[r]*e[r];return i},Qa=function(t,e,i){var r=i.length,n=Ba(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)},Ja=function(t,e,i,r,n,s,a,o,l,u,h){za(e,h++,i),++n[256];for(var d=Wa(n,15),v=d[0],c=d[1],f=Wa(s,15),p=f[0],g=f[1],m=Ga(v),y=m[0],b=m[1],_=Ga(p),w=_[0],k=_[1],S=new xa(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=Wa(S,7),T=C[0],M=C[1],E=19;E>4&&!T[Ea[E-1]];--E);var I,R,P,A,F=u+5<<3,O=Za(n,$a)+Za(s,Na)+a,L=Za(n,v)+Za(s,p)+a+14+3*E+Za(S,T)+(2*S[16]+3*S[17]+7*S[18]);if(O>=F&&L>=F)return Qa(e,h,t.subarray(l,l+u));if(za(e,h,1+(O>L)),h+=2,O>L){I=Da(v,c,0),R=v,P=Da(p,g,0),A=p;var D=Da(T,M,0);for(za(e,h,b-257),za(e,h+5,k-1),za(e,h+10,E-4),h+=14,x=0;E>x;++x)za(e,h+3*x,T[Ea[x]]);h+=3*E;for(var N=[y,w],q=0;2>q;++q){var j=N[q];for(x=0;j.length>x;++x)za(e,h,D[B=31&j[x]]),h+=T[B],B>15&&(za(e,h,j[x]>>>5&127),h+=j[x]>>>12)}}else I=qa,R=$a,P=ja,A=Na;for(x=0;o>x;++x)if(r[x]>255){var B;Ua(e,h,I[257+(B=r[x]>>>18&31)]),h+=R[B+257],B>7&&(za(e,h,r[x]>>>23&31),h+=Ta[B]);var H=31&r[x];Ua(e,h,P[H]),h+=A[H],H>3&&(Ua(e,h,r[x]>>>5&8191),h+=Ma[H])}else Ua(e,h,I[r[x]]),h+=R[r[x]];return Ua(e,h,I[256]),h+R[256]},Ka=new Ca([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),Ya=function(){for(var t=new Ca(256),e=0;256>e;++e){for(var i=e,r=9;--r;)i=(1&i&&3988292384)^i>>>1;t[e]=i}return t}(),Xa=function(){var t=4294967295;return{p(e){for(var i=t,r=0;e.length>r;++r)i=Ya[255&i^e[r]]^i>>>8;t=i},d:()=>4294967295^t}},to=function(t,e,i,r,n){return function(t,e,i,r,n,s){var a=t.length,o=new Sa(r+a+5*(1+Math.floor(a/7e3))+n),l=o.subarray(r,o.length-n),u=0;if(!e||8>a)for(var h=0;a>=h;h+=65535){var d=h+65535;a>d?u=Qa(l,u,t.subarray(h,d)):(l[h]=true,u=Qa(l,u,t.subarray(h,a)))}else{for(var v=Ka[e-1],c=v>>>13,f=8191&v,p=(1<<i)-1,g=new xa(32768),m=new xa(p+1),y=Math.ceil(i/3),b=2*y,_=function(e){return(t[e]^t[e+1]<<y^t[e+2]<<b)&p},w=new Ca(25e3),k=new xa(288),S=new xa(32),x=0,C=0,T=(h=0,0),M=0,E=0;a>h;++h){var I=_(h),R=32767&h,P=m[I];if(g[R]=P,m[I]=R,h>=M){var A=a-h;if((x>7e3||T>24576)&&A>423){u=Ja(t,l,0,w,k,S,C,T,E,h-E,u),T=x=C=0,E=h;for(var F=0;286>F;++F)k[F]=0;for(F=0;30>F;++F)S[F]=0}var O=2,L=0,D=f,N=R-P&32767;if(A>2&&I==_(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+O]==t[h+O-N]){for(var H=0;B>H&&t[h+H]==t[h+H-N];++H);if(H>O){if(O=H,L=N,H>q)break;var z=Math.min(N,H-2),U=0;for(F=0;z>F;++F){var W=h-N+F+32768&32767,V=W-g[W]+32768&32767;V>U&&(U=V,P=W)}}}N+=(R=P)-(P=g[R])+32768&32767}if(L){w[T++]=268435456|Pa[O]<<18|Aa[L];var G=31&Pa[O],Z=31&Aa[L];C+=Ta[G]+Ma[Z],++k[257+G],++S[Z],M=h+O,++x}else w[T++]=t[h],++k[t[h]]}}u=Ja(t,l,true,w,k,S,C,T,E,h-E,u)}return Ha(o,0,r+Ba(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)},eo=function(t,e,i){for(;i;++e)t[e]=i,i>>>=8},io=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&&eo(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)}},ro=function(t){return 10+(t.filename&&t.filename.length+1||0)};function no(t,e){void 0===e&&(e={});var i=Xa(),r=t.length;i.p(t);var n=to(t,e,ro(e),8),s=n.length;return io(n,e),eo(n,s-8,i.d()),eo(n,s-4,r),n}function so(t,e){var i=t.length;if("undefined"!=typeof TextEncoder)return(new TextEncoder).encode(t);for(var r=new Sa(t.length+(t.length>>>1)),n=0,s=function(t){r[n++]=t},a=0;i>a;++a){if(n+5>r.length){var o=new Sa(n+8+(i-a<<1));o.set(r),r=o}var l=t.charCodeAt(a);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(++a))>>>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 Ha(r,0,n)}function ao(t,e){for(var i="",r=0;t.length>r;){var n=t[r++];i+=String.fromCharCode(n)}return i}class oo{constructor(t,e){var i,r,n,s;void 0===e&&(e={}),this.ee={},this.te=Date.now(),this.re=-1/0,this.ie=()=>{var t=Date.now(),e=t-this.te;e>0?(this.ne=Math.min(this.ae,this.ne+e/1e3*this.oe),this.te=t):this.te=t},this.se=t=>{if(!this.ee[t]){var e,i;this.ee[t]=!0;var r=this.ue(t);null==(e=(i=this.le).onBlockedNode)||e.call(i,t,r)}},this.he=t=>{var e=this.ue(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.ue=t=>this._rrweb.mirror.getNode(t),this.ce=t=>{var e,i,r,n,s,a,o,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==(a=t.texts)?void 0:a.length)&&void 0!==s?s:0)+(null!==(o=null==(l=t.adds)?void 0:l.length)&&void 0!==o?o:0)},this.throttleMutations=t=>{if(3!==t.type||0!==t.data.source)return t;var e=t.data,i=this.ce(e);if(e.attributes){var r=e.attributes.length;e.attributes=e.attributes.filter((t=>{var e=this.he(t.id);return!this.de.consumeRateLimit(e[0])&&t}));var n,s,a=r-e.attributes.length;a>0&&(null==(n=(s=this.le).onDroppedAttributeMutations)||n.call(s,a))}var o=this.ce(e);if(0!==o||i===o){if(this.ve)return t;this.ie();var l,u,h=wa(t);return h>this.ne?(null==(l=(u=this.le).onDroppedOversizedMutation)||l.call(u,h),void this.fe()):(this.ne-=h,t)}},this.fe=()=>{if(!this.pe){var t=Math.max(0,this.ge-(Date.now()-this.re));this.pe=setTimeout((()=>{var t,e;this.pe=void 0,this.re=Date.now(),null==(t=(e=this.le).requestFullSnapshot)||t.call(e)}),t)}},this._rrweb=t,this.le=e,this.de=new mt({bucketSize:null!==(i=this.le.bucketSize)&&void 0!==i?i:100,refillRate:null!==(r=this.le.refillRate)&&void 0!==r?r:10,refillInterval:1e3,S:this.se,I:Bi}),this.ae=null!==(n=this.le.bytesBucketSize)&&void 0!==n?n:0,this.oe=null!==(s=this.le.bytesRefillRate)&&void 0!==s?s:25600,this.ve=!Number.isFinite(this.ae)||0>=this.ae,this.ne=this.ae;var a=this.le.resyncIntervalMs;this.ge=it(a)&&Number.isFinite(a)&&a>0?a:3e5}reset(){this.ee={},this.pe&&(clearTimeout(this.pe),this.pe=void 0),this.re=Date.now()}stop(){this.de.stop(),this.reset(),this.ne=this.ae,this.te=Date.now(),this.re=-1/0}}qi.DEBUG=!1,qi.LIB_VERSION="1.422.4",qi.LIB_NAME="web";class lo{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.me=t.get_property.bind(t),this.ye=t.persistence.set_property.bind(t.persistence)}trackSize(t,e){this.ye(Wn,{sessionId:t,size:this.currentTrackedSize(t)+e})}currentTrackedSize(t){var e,i=this.me(Wn);return Q(e=i)&&Y(e.sessionId)&&it(e.size)&&i.sessionId===t?i.size:0}}function uo(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<gt(100*e,0,100,Bi)}function ho(t){return"$survey_response_"+t}function vo(t,e){if(!e)return null;var i=t[ho(e)];return G(i)?[...i]:i}function co(t,e,i){void 0===t&&(t={});var r={};return e.questions.forEach((e=>{if(!K(e.originalQuestionIndex)){var i,n=0===(i=e.originalQuestionIndex)?"$survey_response":"$survey_response_"+i,s=vo(t,e.id);K(s)||(r[n]=s)}})),p({$survey_questions:e.questions.map((e=>{var r,n;return{id:e.id,question:null!==(r=null==i?void 0:i[null!==(n=e.id)&&void 0!==n?n:""])&&void 0!==r?r:e.question,response:vo(t,e.id)}}))},t,r)}function fo(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 po(t){return"string"==typeof t&&t.trim()?t.trim():null}function go(t){return t.toLowerCase()}function mo(t,e,i){if(!t||!e)return null;var r=go(e),n=Object.keys(t).find((t=>go(t)===r));if(n)return null==i||i.debug("Found exact translation match: "+n),n;if(r.includes("-")){var s=r.split("-")[0],a=Object.keys(t).find((t=>go(t)===s));if(a)return null==i||i.debug("Found base language translation match: "+a+" (from "+e+")"),a}return null}var yo=["thankYouMessageHeader","thankYouMessageDescription","thankYouMessageCloseButtonText","introScreenHeader","introScreenDescription","introScreenButtonText","submitButtonText","backButtonText"];function bo(t,e,i){var r,n=mo(t.translations,e,i),s=p({},t),a=!1;if(n){var o,l=null==(o=t.translations)?void 0:o[n];if(l)if(null==i||i.info("Applying survey-level translation for language: "+n),K(l.name)||(s.name=l.name,a=!0),s.appearance){var u=p({},s.appearance);for(var h of yo){var d=l[h];K(d)||(u[h]=d,a=!0)}s.appearance=u}else(function(t){return yo.some((e=>!K(t[e])))})(l)&&(a=!0)}var v=t.questions.map((t=>function(t,e,i){var r,n=mo(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 a=p({},t),o=!1;return K(s.question)||(a.question=s.question,o=!0),K(s.description)||(a.description=s.description,o=!0),K(s.buttonText)||(a.buttonText=s.buttonText,o=!0),"link"in a&&!K(s.link)&&(a.link=s.link,o=!0),"lowerBoundLabel"in a&&!K(s.lowerBoundLabel)&&(a.lowerBoundLabel=s.lowerBoundLabel,o=!0),"upperBoundLabel"in a&&!K(s.upperBoundLabel)&&(a.upperBoundLabel=s.upperBoundLabel,o=!0),"choices"in a&&function(t){return G(t.choices)}(s)&&(a.choices=s.choices,o=!0),{question:o?a:t,matchedKey:o?n:null,hasChanges:o}}(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,a=!0,null==i||i.info("Applied question-level translations for language: "+e)),{survey:s,matchedKey:a?n||g:null}}function _o(t){var e;return!(null==(e=t.conditions)||null==(e=e.events)||null==(e=e.values)||!e.length)}function wo(t){var e;return _o(t)&&!(null==(e=t.conditions)||null==(e=e.events)||!e.repeatedActivation)||"always"===t.schedule}var ko=(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}},So=t=>t.toLowerCase(),xo={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=>ko(e,t))))),not_regex:(t,e)=>e.every((e=>t.every((t=>!ko(e,t))))),icontains:(t,e)=>e.map(So).some((e=>t.map(So).some((t=>e.includes(t))))),not_icontains:(t,e)=>e.map(So).every((e=>t.map(So).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 Co(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=xo[i.operator];return!!n&&n(i.values,[String(r)])}))}function To(t,e,i){return er({distinct_id:t,userPropertiesToSet:e,userPropertiesToSetOnce:i})}var Mo=new Set(["is_not","not_icontains","not_regex"]);function Eo(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(K(n)||tt(n))return Mo.has(s);var a=xo[s];return!!a&&!K(t.value)&&!tt(t.value)&&a(G(t.value)?t.value.map(String):[String(t.value)],G(n)?n.map(String):[String(n)])}))}var Io=Hi("[SessionRecording]");function Ro(t,e){return e?t:"!"+t}function Po(t,e){return t===e||t!=="!"+e&&null}class Ao{constructor(t,e,i,r,n,s,a){this.be=null,this.we=ya,this._instance=t,this.J=e,this.Y=i,this.K=r,this.ke=n,this._e=s,this.Se=a}onRemoteConfig(t){this.be=it(t.sampleRate)?t.sampleRate:null,"any"===t.triggerMatchType?(this.xe=new ua([this.Y,this.J]),this.we=ma):(this.xe=new ha([this.Y,this.J]),this.we=ya),this._instance.register_for_session({[Rs]:t.triggerMatchType}),this.J.onConfig(t),this.Y.onConfig(t),this.K.onConfig(t,((t,e)=>{this.ke("linked_flag_matched",{flag:t,variant:e}),this.Se()}))}getStatus(t){return this.we({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 it(i)?i:null}checkUrlTriggers(t,e,i,r){this.J.checkUrlTriggerConditions(e,i,r,t)}setupEventTriggerListeners(t,e,i){if(0!==this.Y.Z.length&&et(this.Ce))return this.Ce=t((t=>{try{this.Y.checkEventTriggerConditions(t.event,i,e)}catch(t){Io.error("Could not activate event trigger",t)}})),this.Ce}makeSamplingDecisions(t){var e,i,r,n=this.be;if(!it(n))return null==(i=this._instance.persistence)||i.unregister($n),void(null==(r=this._instance.persistence)||r.unregister(Pn));var s=this._instance.get_property($n),a=this._instance.get_property(Pn),o=Po(s,t),l=it(a)&&a!==n,u=K(a)&&s===t,h=l||u||!nt(o),d=h?uo(t,n):o;h&&(d?this.ke("sampled"):Io.warn("Sample rate ("+n+") has determined that this sessionId ("+t+") will not be sent to the server.")),null==(e=this._instance.persistence)||e.register({[$n]:Ro(t,d),[Pn]:tt(a)&&s===t?null:n})}ensureSamplingDecision(t){if(it(this.be)){var e=this._instance.get_property($n);nt(Po(e,t))||this.makeSamplingDecisions(t)}}onFlushComplete(){}clearConditionalRecordingPersistence(){var t,e,i,r,n;null==(t=this._instance.persistence)||t.unregister(jn),null==(e=this._instance.persistence)||e.unregister(qn),null==(i=this._instance.persistence)||i.unregister($n),null==(r=this._instance.persistence)||r.unregister(Pn),null==(n=this._instance.persistence)||n.unregister(Nn)}updateActiveTriggers(t){}hasPendingTriggers(t){var e;return(null==(e=this.xe)?void 0:e.triggerStatus(t))===ra}getPendingTriggerConditions(t){return[{label:"URL condition not matched",status:this.J.triggerStatusNoSideEffects(t)},{label:"event condition not matched",status:this.Y.triggerStatusNoSideEffects(t)},{label:"linked flag condition not matched",status:this.K.triggerStatusNoSideEffects()}].filter((t=>t.status===ra)).map((t=>t.label))}stop(){var t;null==(t=this.Ce)||t.call(this),this.Ce=void 0,this.Y.stop(),this.J.stop(),this.K.stop()}}class Fo{constructor(t,e,i,r,n){this.Me=[],this.Te=new Map,this.Ie=!1,this._instance=t,this.J=e,this.ke=i,this.Ee=r,this.Se=n}onRemoteConfig(t){t.triggerGroups&&0!==t.triggerGroups.length?(this.Re(t.triggerGroups),this._instance.register_for_session({[Rs]:"v2_trigger_groups",[Ps]:t.triggerGroups.length}),this.J.onConfig(t)):Io.warn("[V2Strategy] No trigger groups configured")}getStatus(t){return function(t){if(t.rrwebError)return ta;if(t.urlTriggerMatching.urlBlocked)return Js;var e=t.triggerGroupMatchers,i=t.triggerGroupSamplingResults;if(0===e.length)return Vs;var r=!1,n=!1;for(var s of e){var a=s.triggerStatus(t.sessionId);if(a===ia){var o=s.group.id,l=i.get(o);K(l)?Bi.warn("[V2 Triggers] Group activated but no sampling decision found",{groupId:o}):!0===l&&(n=!0)}else a===ra&&(r=!0)}return n?Gs:r?Qs:Vs}({isSampled:t.isSampled,rrwebError:t.rrwebError,urlTriggerMatching:t.urlTriggerMatching,eventTriggerMatching:t.eventTriggerMatching,linkedFlagMatching:t.linkedFlagMatching,sessionId:t.sessionId,triggerGroupMatchers:this.Me,triggerGroupSamplingResults:this.Te,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;it(r)&&(tt(e)||e>r)&&(e=r)}return e}checkUrlTriggers(t,e,i,r){var n=this;this.J.checkUrlBlocklist(e,i);var s=function(r){r.checkUrlTriggerConditions(e,i,(e=>{n.Ae(r,void 0)&&(r.activateTrigger(e,t),n.updateActiveTriggers(t),n.Se(e))}),t)};for(var a of this.Me)s(a)}setupEventTriggerListeners(t,e,i){var r=this;return this.Ce=t((t=>{var i;if(this.Ie)return Io.info("[SessionRecorder] Stopping trigger checks - initial buffer flushed"),null==(i=this.Ce)||i.call(this),void(this.Ce=void 0);try{var n=function(i){i.checkEventTriggerConditions(t.event,(n=>{if(r.Ae(i,t.properties)){var s=(i.group.conditions.events||[]).filter((e=>e.name===t.event)),a=r._instance.get_property(es),o=s.some((e=>!e.properties||0===e.properties.length||Eo(e.properties,t.properties,a)));o&&(i.activateTrigger(n,e),r.updateActiveTriggers(e),r.Se(n))}}),e)};for(var s of this.Me)n(s)}catch(t){Io.error("Could not activate event trigger for trigger groups",t)}})),this.Ce}makeSamplingDecisions(t){for(var e of this.Me){var i,r=e.group,n=r.id,s=r.sampleRate,a=zn+n,o=this._instance.get_property(a),l=null,u=!1,h=!1,d=!1;if(Q(o)){var v=o.sessionId,c=o.sampleRate,f=o.sampled;u="string"==typeof v&&v!==t,h=it(c)&&c!==s,l=v===t&&it(c)&&c===s&&nt(f)?f:null}else l=o===t||null,u="string"==typeof o&&o!==t,d=o===t;var p=u||h||d||!nt(l),g=p?uo(t+n,s):l;p&&this.Ee("triggerGroupSamplingDecisionMade",{group_id:n,group_name:r.name,sampleRate:s,isSampled:g}),this.Te.set(n,g),null==(i=this._instance.persistence)||i.register({[a]:{sessionId:t,sampleRate:s,sampled:g}})}this.updateActiveTriggers(t)}ensureSamplingDecision(t){}onFlushComplete(){this.Ie=!0}clearConditionalRecordingPersistence(){var t,e,i;for(var r of(null==(t=this._instance.persistence)||t.unregister($n),null==(e=this._instance.persistence)||e.unregister(Pn),null==(i=this._instance.persistence)||i.unregister(Nn),this.Me)){var n,s,a,o=r.group.id;null==(n=this._instance.persistence)||n.unregister(Bn+o),null==(s=this._instance.persistence)||s.unregister(Hn+o),null==(a=this._instance.persistence)||a.unregister(zn+o)}}updateActiveTriggers(t){var e=[];for(var i of this.Me){var r=i.group,n=r.id,s="trigger_activated"===i.triggerStatus(t),a=!0===this.Te.get(n);s&&e.push({id:n,name:r.name,matched:!0,sampled:a})}this._instance.register_for_session({[Es]:e})}hasPendingTriggers(t){for(var e of this.Me)if(e.triggerStatus(t)===ra)return!0;return!1}getPendingTriggerConditions(t){return this.Me.flatMap((e=>e.triggerStatusNoSideEffects(t)!==ra?[]:e.getPendingTriggerConditions(t).map((t=>'trigger group "'+e.group.name+'": '+t))))}stop(){var t;null==(t=this.Ce)||t.call(this),this.Ce=void 0,this.Me.forEach((t=>t.stop())),this.Me=[],this.Te.clear(),this.J.stop()}Ae(t,e){var i=t.group.conditions.properties;return!i||0===i.length||Eo(i,e,this._instance.get_property(es))}Re(t){var e=this;this.Me.forEach((t=>t.stop())),this.Me=[],this.Te.clear();var i=function(t){var i=new ga(e._instance,t,((i,r)=>{e.ke("linked_flag_matched",{flag:i,variant:r,group_id:t.id,group_name:t.name}),e.Se()}));e.Me.push(i)};for(var r of t)i(r)}}var Oo=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}},Lo="https?://(.*)",Do=["gclid","gclsrc","dclid","gbraid","wbraid","fbclid","msclkid","twclid","li_fat_id","igshid","ttclid","rdt_cid","epik","qclid","sccid","irclid","_kx"],$o=["utm_source","utm_medium","utm_campaign","utm_content","utm_term","gad_source","mc_cid",...Do],No="<masked>",qo=["li_fat_id"];function jo(t,e,i){if(!r)return{};var n,s=e?[...Do,...i||[]]:[],a=Bo(sr(r.URL,s,No),t),o=(n={},Ui(qo,(function(t){var e=Oo(t);n[t]=e||null})),n);return Wi(o,a)}function Bo(t,e){var i=$o.concat(e||[]),r={};return Ui(i,(function(e){var i=nr(t,e);r[e]=i||null})),r}function Ho(t){var e=function(t){return t?0===t.search(Lo+"google.([^/?]*)")?"google":0===t.search(Lo+"bing.com")?"bing":0===t.search(Lo+"yahoo.com")?"yahoo":0===t.search(Lo+"duckduckgo.com")?"duckduckgo":null:null}(t),i="yahoo"!=e?"q":"p",n={};if(!tt(e)){n.$search_engine=e;var s=r?nr(r.referrer,i):"";s.length&&(n.ph_keyword=s)}return n}function zo(){return navigator.language||navigator.userLanguage}var Uo="$direct";function Wo(){return(null==r?void 0:r.referrer)||Uo}function Vo(t,e,i){void 0===i&&(i=!1);var r=t?[...Do,...e||[]]:[],s=i?Te(null==n?void 0:n.href):null==n?void 0:n.href,a=null==s?void 0:s.substring(0,1e3);return{r:Wo().substring(0,1e3),u:a?sr(a,r,No):void 0}}function Go(t,e){var i;void 0===e&&(e=!1);var r=t.r,n=t.u,s=e?Te(n):n,a={$referrer:r,$referring_domain:null==r?void 0:r==Uo?Uo:null==(i=ir(r))?void 0:i.host};if(s){a.$current_url=s;var o=ir(s);a.$host=null==o?void 0:o.host,a.$pathname=null==o?void 0:o.pathname;var l=Bo(s);Wi(a,l)}if(r){var u=Ho(r);Wi(a,u)}return a}function Zo(){try{return Intl.DateTimeFormat().resolvedOptions().timeZone}catch(t){return}}function Qo(){try{return(new Date).getTimezoneOffset()}catch(t){return}}var Jo=1e5,Ko="https://schema.org",Yo=[],Xo="actionStatus availability bestRating contentRating encodingFormat eventAttendanceMode eventStatus highPrice inLanguage isAccessibleForFree isFamilyFriendly itemCondition itemListOrder lowPrice maximumAttendeeCapacity nonprofitStatus numberOfItems offerCount position price priceCurrency priceValidUntil publicAccess ratingCount ratingValue reviewCount smokingAllowed worstRating".split(" "),tl="Action BorrowAction ReadAction SearchAction SeekToAction SolveMathAction WatchAction".split(" "),el="AutoDealer Bakery BarOrPub CafeOrCoffeeShop CollegeOrUniversity Corporation DaySpa Dentist EducationalOrganization Electrician FoodEstablishment GovernmentOrganization HealthClub Hotel LegalService Library LibrarySystem LocalBusiness Locksmith LodgingBusiness MedicalBusiness NGO OnlineStore Organization PerformingGroup Pharmacy Physician Plumber RealEstateAgent Restaurant School SportsOrganization Store".split(" "),il="Accommodation AdministrativeArea Country Place State".split(" "),rl={AggregateOffer:{offers:["Offer"]},Brand:{name:!0},BreadcrumbList:{itemListElement:["ListItem"]},CreativeWork:{genre:!0,dateCreated:!0,dateModified:!0,datePublished:!0,expires:!0,learningResourceType:!0,educationalLevel:!0,educationalUse:!0,interactivityType:!0,aggregateRating:["AggregateRating"],potentialAction:tl,publisher:el},Event:{startDate:!0,endDate:!0,previousStartDate:!0,aggregateRating:["AggregateRating"],offers:["AggregateOffer","Offer"]},ItemList:{itemListElement:["ListItem"]},ListItem:{item:Yo},Offer:{seller:el},Organization:{name:!0,legalName:!0,foundingDate:!0,dissolutionDate:!0,aggregateRating:["AggregateRating"],brand:["Brand"]},Person:{},Place:{aggregateRating:["AggregateRating"]},Product:{name:!0,sku:!0,mpn:!0,gtin:!0,gtin8:!0,gtin12:!0,gtin13:!0,gtin14:!0,productID:!0,productGroupID:!0,asin:!0,model:!0,category:!0,color:!0,material:!0,pattern:!0,size:!0,productionDate:!0,releaseDate:!0,brand:["Brand","Organization"],manufacturer:el,offers:["Offer","AggregateOffer"],aggregateRating:["AggregateRating"]},Service:{name:!0,serviceType:!0,category:!0,provider:el,areaServed:il,offers:["AggregateOffer","Offer"],aggregateRating:["AggregateRating"]},OfferCatalog:{name:!0,itemListElement:Yo}},nl={},sl=[[tl,nl],["3DModel AboutPage Answer Article AudioObject Blog BlogPosting Book Clip CollectionPage Comment ContactPage Course CreativeWorkSeason CreativeWorkSeries DataCatalog DataDownload DataFeed Dataset DiscussionForumPosting Episode FAQPage Game HowTo HowToDirection HowToSection HowToStep HowToTip ImageObject LearningResource MediaObject Message MobileApplication Movie MusicPlaylist MusicRecording NewsArticle Photograph PodcastEpisode PodcastSeries ProfilePage QAPage Question Quiz Recipe Review ScholarlyArticle SearchResultsPage SiteNavigationElement SocialMediaPosting SoftwareApplication TVEpisode TVSeries TechArticle VacationRental VideoGame VideoObject WebApplication WebPage WebPageElement WebSite".split(" "),rl.CreativeWork],["BroadcastEvent BusinessEvent EducationEvent Festival MusicEvent SportsEvent TheaterEvent".split(" "),rl.Event],[el,rl.Organization],[il,rl.Place],["Car IndividualProduct ProductGroup ProductModel".split(" "),rl.Product],["AggregateRating EmployerAggregateRating Rating".split(" "),nl]],al="AlignmentObject BedDetails Certification ContactPoint CreditCard DefinedRegion EducationalOccupationalCredential EntryPoint GeoCoordinates GeoShape InteractionCounter JobPosting LocationFeatureSpecification MathSolver MemberProgram MemberProgramTier MerchantReturnPolicy MerchantReturnPolicySeasonalOverride MonetaryAmount NutritionInformation OccupationalExperienceRequirements OfferShippingDetails OpeningHoursSpecification PeopleAudience PostalAddress PriceSpecification PropertyValue QuantitativeValue ServicePeriod ShippingConditions ShippingDeliveryTime ShippingRateSettings ShippingService SpeakableSpecification Thing UnitPriceSpecification".split(" ");function ol(t,e){return W.call(t,e)?t[e]:void 0}function ll(t){var e=typeof t;return tt(t)||"string"===e||"number"===e||"boolean"===e}function ul(t){return ll(t)||G(t)&&t.every(ll)?t:void 0}function hl(t){if(W.call(rl,t))return rl[t];for(var e of sl){var i=e[1];if(e[0].includes(t))return i}return al.includes(t)?nl:void 0}function dl(t,e){if(!Q(t))return null;var i=ol(t,"@type"),r=function(t){return("string"==typeof t?[t]:G(t)?t:[]).filter((t=>"string"==typeof t)).map((t=>t.replace(/^https?:\/\/schema\.org\//,""))).filter((t=>!!hl(t)))}(i).filter((t=>!e||!e.length||e.includes(t)));if(!r.length)return null;var n={"@type":"string"==typeof i?r[0]:r},s=ul(ol(t,"@id"));for(var a of(K(s)||(n["@id"]=s),Xo)){var o=ul(ol(t,a));K(o)||(n[a]=o)}for(var l of r){var u=hl(l),h=function(){var e=ol(t,d),i=u[d];if(!0===i){var r=ul(e);K(r)||(n[d]=r)}else if(G(e)){var s=e.map((t=>dl(t,i))).filter(Q);s.length&&(n[d]=s)}else{var a=dl(e,i);a&&(n[d]=a)}};for(var d of Object.keys(u))h()}return n}function vl(t){if(!Q(t))return null;var e=ol(t,"@context");if("string"!=typeof e||!/^https?:\/\/schema\.org\/?$/.test(e))return null;var i=dl(t);if(i)return p({"@context":Ko},i);var r=ol(t,"@graph");if(!G(r))return null;var n=r.map((t=>dl(t))).filter(Q);return n.length?{"@context":Ko,"@graph":n}:null}function cl(t){var e;return"SCRIPT"===t.nodeName&&"application/ld+json"===(null==(e=t.getAttribute("type"))?void 0:e.trim().toLowerCase())}function fl(t,e,i){if("string"==typeof e?t.classList.contains(e):e&&Array.from(t.classList).some((t=>(e.lastIndex=0,e.test(t)))))return!0;try{return!!i&&t.matches(i)}catch(t){return!1}}function pl(t){return cl(t)?[t]:t.nodeType!==t.ELEMENT_NODE?[]:Array.from(t.querySelectorAll("script")).filter(cl)}function gl(t){return K(t)?void 0:Math.round(t)}function ml(t){return Q(t)?t.network_timing:t}var yl,bl,_l=36e5,wl=943718.4,kl="[SessionRecording]",Sl=Hi(kl),xl=[y.MouseMove,y.MouseInteraction,y.Scroll,y.ViewportResize,y.Input,y.TouchMove,y.MediaInteraction,y.Drag],Cl=t=>({rrwebMethod:t,enqueuedAt:Date.now(),attempt:1});function Tl(){var t;return null==v||null==(t=v.__PosthogExtensions__)?void 0:t.rrweb}function Ml(){var t;return null==(t=Tl())?void 0:t.record}function El(t){try{return JSON.stringify(t)}catch(e){return JSON.stringify(t,ba())}}function Il(t){return ao(no(so(El(t))))}function Rl(t){return Pl.apply(this,arguments)}function Pl(){return(Pl=f((function*(t){var e=El(t),i=yield Ne(e,qi.DEBUG,{rethrow:!0});return ao(new Uint8Array(yield i.arrayBuffer()))}))).apply(this,arguments)}var Al="undefined"!=typeof globalThis&&"CompressionStream"in globalThis&&"TextEncoder"in globalThis&&"Response"in globalThis&&"function"==typeof Response.prototype.blob,Fl=!1;function Ol(t){return G(t)&&0===t.length?yl=null!=yl?yl:Il([]):Il(t)}function Ll(t){return Dl.apply(this,arguments)}function Dl(){return(Dl=f((function*(t){return G(t)&&0===t.length?yl||(bl=null!=bl?bl:Rl([]).then((t=>(yl=t,t))).catch((t=>{throw yl=void 0,bl=void 0,t}))):Rl(t)}))).apply(this,arguments)}function $l(t){return Al&&!Fl&&function(t){return t.type===m.FullSnapshot||t.type===m.IncrementalSnapshot&&(t.data.source===y.Mutation||t.data.source===y.StyleSheetRule)}(t)}function Nl(t){return{event:t,size:wa(t)}}function ql(t,e){return p({},t,{data:e,cv:"2024-10"})}function jl(t,e){return p({},t,{cv:"2024-10",data:p({},t.data,e)})}function Bl(t){try{if(t.type===m.FullSnapshot)return Nl(ql(t,Il(t.data)));if(t.type===m.IncrementalSnapshot&&t.data.source===y.Mutation)return Nl(jl(t,{texts:Ol(t.data.texts),attributes:Ol(t.data.attributes),removes:Ol(t.data.removes),adds:Ol(t.data.adds)}));if(t.type===m.IncrementalSnapshot&&t.data.source===y.StyleSheetRule)return Nl(jl(t,{adds:t.data.adds?Il(t.data.adds):void 0,removes:t.data.removes?Il(t.data.removes):void 0}))}catch(t){Sl.error("could not compress event - will use uncompressed event",t)}return{event:t,size:_a(t)}}function Hl(){return Hl=f((function*(t){try{if(t.type===m.FullSnapshot)return Nl(ql(t,yield Rl(t.data)));if(t.type===m.IncrementalSnapshot&&t.data.source===y.Mutation){var e=yield Promise.all([Ll(t.data.texts),Ll(t.data.attributes),Ll(t.data.removes),Ll(t.data.adds)]);return Nl(jl(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?Rl(t.data.adds):void 0,t.data.removes?Rl(t.data.removes):void 0]);return Nl(jl(t,{adds:i[0],removes:i[1]}))}}catch(e){return Le(e)&&(Fl=!0),Sl.error("could not compress event asynchronously - trying synchronous compression",e),Bl(t)}return{event:t,size:_a(t)}})),Hl.apply(this,arguments)}function zl(t,e){return t.type===m.Custom&&t.data.tag===e}function Ul(t){return zl(t,"sessionIdle")}function Wl(t){return zl(t,"$session_ending")}function Vl(t){return zl(t,"$session_starting")}class Gl{get sessionId(){return this.Le}get Oe(){if(!this._instance.sessionManager)throw new Error(kl+" must be started with a valid sessionManager.");return this._instance.sessionManager}get Pe(){return this._instance.config.session_recording.session_idle_threshold_ms||3e5}get De(){return Po(this._instance.get_property($n),this.sessionId)}get be(){var t,e=null==(t=this.Fe)?void 0:t.sampleRate;return it(e)?e:null}get Ne(){var t,e;return null!==(t=null==(e=this.qe)?void 0:e.getMinimumDuration(this.sessionId))&&void 0!==t?t:null}constructor(t,e){this.je="/s/",this._forceAllowLocalhostNetworkCapture=!1,this.Be=void 0,this.He=!1,this.$e=Date.now(),this.Ue=!1,this.We=[],this.ze="unknown",this.Ve=0,this.Ze=0,this.Ge=0,this.Qe=0,this.Je=!1,this.Ye=!1,this.Ke=!1,this.Xe=!1,this.et=!1,this.tt=!1,this.rt=!1,this.it=!1,this.nt=!1,this.ot=!1,this.st=!1,this.ut=!1,this.ht=[],this.ct=void 0,this.dt=void 0,this.vt=[],this.ft=0,this.yt=0,this.bt=!1,this.wt=void 0,this.Ce=void 0,this.kt=void 0,this._t=void 0,this.St=void 0,this.xt=(t,e,i)=>{var r,n,s;if(i&&(t!==this.Le||e!==this.Ct)){var a,o=!i.noSessionId&&(i.activityTimeout||i.sessionPastMaximumLength),l=this.Le,u=this.Ct;if(o&&this.Ee("$session_ending",{currentSessionId:l,currentWindowId:u,nextSessionId:t,nextWindowId:e,changeReason:i,lastActivityTimestamp:this.$e,flushed_size:null==(a=this.Mt)?void 0:a.currentTrackedSize(l)}),null==(r=this._instance.persistence)||r.unregister(Un),this.rt=!1,null==(n=Tl())||null==n.resetMaxDepthState||n.resetMaxDepthState(),this.Ee("$session_id_change",{sessionId:t,windowId:e,changeReason:i}),this.Tt(),!(!1===this.ze&&this.isStarted||this.Le===t&&this.Ct===e)){var h=this.Le!==t&&!1!==this.ze;this.ze="unknown",this.It(h)}o&&this.Ee("$session_starting",{previousSessionId:l,previousWindowId:u,nextSessionId:t,nextWindowId:e,changeReason:i,lastActivityTimestamp:this.$e}),null==(s=this.qe)||s.makeSamplingDecisions(t)}},this.Et=()=>{var t;return(null==(t=this._instance.persistence)?void 0:t.props[Nn])===this.Le},this.Rt=()=>{var t,e;if(0===this.At.data.length)return null;var i=null==(t=this.At.data[0])?void 0:t.timestamp,r=null==(e=this.At.data[this.At.data.length-1])?void 0:e.timestamp;return it(i)&&it(r)?r-i:null},this.Lt=()=>{var t,e,i=this.Ne;if(!it(i))return!1;if(null===(t=null==(e=this._instance.config.session_recording)?void 0:e.strictMinimumDuration)||void 0===t||!t){var r=this.Ot;return it(r)&&r>=0&&i>r}if(this.Et())return!1;var n,s=this.Rt();return!!tt(s)||i>s||(null==(n=this._instance.persistence)||n.register({[Nn]:this.Le}),!1)},this.Pt=()=>{this.status!==Qs?(this.Je&&this.Ye&&this.Dt&&!this.Ke&&(this.Je=!1),this.Ft(),this.Nt()):this.qt()},this.jt=()=>{this.Pt()},this.Bt=()=>{this.Ee("browser offline",{})},this.Ht=()=>{this.Ee("browser online",{})},this.$t=()=>{null!=r&&r.visibilityState&&("visible"===r.visibilityState&&(this.Dt=!0),this.Ee("window "+r.visibilityState,{}))},this._instance=t,this.Dt=null==e||e;var i=this.Oe.checkAndGetSessionAndWindowId(),n=i.windowId;this.Le=i.sessionId,this.Ct=n,this.K=new fa(this._instance),this.J=new ca(this._instance),this.Y=new pa(this._instance),this.At=this.qt(),this.Oe.sessionTimeoutMs>this.Pe||Sl.warn("session_idle_threshold_ms ("+this.Pe+") is greater than the session timeout ("+this.Oe.sessionTimeoutMs+"). Session will never be detected as idle"),this.Mt=new lo(this._instance)}setDocumentWasEverVisible(t){t&&(this.Dt=!0)}get Ut(){var t,e,i,r,n,s,a,o,l,u=null==(t=this.Fe)?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!==(a=null==h?void 0:h.maskTextSelector)&&void 0!==a?a:null==u?void 0:u.maskTextSelector,c=null!==(o=null==h?void 0:h.blockSelector)&&void 0!==o?o: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 K(d)&&K(v)&&K(c)&&K(f)?void 0:{maskAllInputs:null==d||d,maskTextSelector:v,blockSelector:c,maskAllElementAttributes:f}}Wt(){var t;if(!this.nt){var e=null==(t=this.Fe)?void 0:t.masking;if(!et(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!K(r)&&r!==n}));0!==r.length&&(this.nt=!0,Sl.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 zt(){var t;return gt(null==(t=this._instance.config.session_recording.canvasCapture)?void 0:t.resolutionScale,.1,1,Hi("canvas recording resolution scale"),1)}get Vt(){var t,e,i,r,n,s,a,o=this._instance.config.session_recording.captureCanvas,l=null==(t=this.Fe)?void 0:t.canvasRecording,u=null!==(e=null!==(i=null==o?void 0:o.recordCanvas)&&void 0!==i?i:null==l?void 0:l.enabled)&&void 0!==e&&e,h=null!==(r=null!==(n=null==o?void 0:o.canvasFps)&&void 0!==n?n:null==l?void 0:l.fps)&&void 0!==r?r:4,d=null!==(s=null!==(a=null==o?void 0:o.canvasQuality)&&void 0!==a?a: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:gt(h,0,12,Hi("canvas recording fps"),4),quality:gt(d,0,1,Hi("canvas recording quality"),.4)}}get Zt(){var t,e=!(null==(t=this.Fe)||!t.consoleLogRecordingEnabled),i=this._instance.config.enable_recording_console_log;return null!=i?i:e}get Gt(){var t,e,i,r=null==(t=this.Fe)?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),a=(null==n?void 0:n.recordBody)||(null==r?void 0:r.recordBody),o=ml(this._instance.config.capture_performance),l=ml(null==r?void 0:r.capturePerformance),u=!!(nt(o)?o:l);return s||a||u?{recordHeaders:s,recordBody:a,recordPerformance:u}:void 0}Qt(){var t,e,i=[],r=null==(t=v.__PosthogExtensions__)||null==(t=t.rrwebPlugins)?void 0:t.getRecordConsolePlugin;r&&this.Zt&&i.push(r());var s=null==(e=v.__PosthogExtensions__)||null==(e=e.rrwebPlugins)?void 0:e.getRecordNetworkPlugin;if(this.Gt&&Z(s))if(!tr.includes(n.hostname)||this._forceAllowLocalhostNetworkCapture){var a=Z(this._instance.requestRouter.isIngestionEndpoint)?this._instance.requestRouter.isIngestionEndpoint.bind(this._instance.requestRouter):void 0;i.push(s(((t,e,i)=>{var r,n={payloadSizeLimitBytes:sn.payloadSizeLimitBytes,performanceEntryTypeToObserve:[...sn.performanceEntryTypeToObserve],payloadHostDenyList:[...e.payloadHostDenyList||[],...sn.payloadHostDenyList]},s=!1!==t.session_recording.recordHeaders&&e.recordHeaders,a=!1!==t.session_recording.recordBody&&e.recordBody,o=!1!==t.capture_performance&&e.recordPerformance,l=(r=nn(n),t=>(null!=t&&t.requestBody&&(t.requestBody=dn(t.requestBody,t.requestHeaders,r,"Request")),null!=t&&t.responseBody&&(t.responseBody=dn(t.responseBody,t.responseHeaders,r,"Response")),t)),u=e=>{return l(((t,e,i)=>{var r;if(null==i||!i(t.name)){var n=ir(t.name),s=0===e.indexOf("http")?null==(r=ir(e))?void 0:r.pathname:e;"/"===s&&(s="");var a=null==n?void 0:n.pathname.replace(s||"","");if(!(n&&a&&hn.some((t=>0===a.indexOf(t)))))return t}})((un((r=e).requestHeaders),un(r.responseHeaders),r),t.api_host,i));var r},h=Z(t.session_recording.maskNetworkRequestFn);return h&&Z(t.session_recording.maskCapturedNetworkRequestFn)&&Bi.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=Z(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 et(n)&&r?(cn.add(r),r):null!=n?n:void 0}}:t=>function(t){if(!K(t))return t.requestBody=vn(t.requestBody,"Request"),t.responseBody=vn(t.responseBody,"Response"),t}(u(t)),p({},sn,n,{recordHeaders:s,recordBody:a,recordPerformance:o,recordInitialRequests:o,streamNetworkBody:!0===t.session_recording.streamNetworkBody})})(this._instance.config,this.Gt,a)))}else Sl.info("NetworkCapture not started because we are on localhost.");return i}Jt(t){return this._instance.config.disable_capture_url_hashes?Te(t):t}Yt(t,e){void 0===e&&(e=!1);var i=e?Te(t):this.Jt(t),r=this._instance.config.mask_personal_data_properties?[...Do,...this._instance.config.custom_personal_data_properties||[]]:[];return this.Kt(sr(i,r,No))}Kt(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}Xt(t){try{return t.rrwebMethod(),!0}catch(e){return 10>this.We.length?this.We.push({enqueuedAt:t.enqueuedAt||Date.now(),attempt:t.attempt+1,rrwebMethod:t.rrwebMethod}):Sl.warn("could not emit queued rrweb event.",e,t),!1}}Ee(t,e){return this.Xt(Cl((()=>Ml().addCustomEvent(t,e))))}er(){var t;return this.He&&!0===(null==(t=this._instance.config.session_recording)?void 0:t.captureJsonLd)&&!this.J.urlBlocked&&!0!==this.ze}tr(t){if(!this.er())return!1;try{var e=Ml();return!!e&&(e.addCustomEvent("$json_ld",t),this.er())}catch(t){return!1}}rr(t){void 0===t&&(t=!1),Promise.resolve().then((()=>{var e;return null==(e=this.ir)?void 0:e.scan(t)}))}nr(){try{if(this._instance.config.capture_pageview||!t)return;var e=new URL(t.location.href),i=this.Yt(e.origin+e.pathname+e.search);this.ar!==i&&(this.ar=i,this.Ee("$url_changed",{href:i}))}catch(t){}}sr(){if(this.We.length){var t=[...this.We];this.We=[],t.forEach((t=>{Date.now()-t.enqueuedAt>2e3||this.Xt(t)}))}}_e(){return this.Xt(Cl((()=>Ml().takeFullSnapshot())))}get ur(){var t,e,i;if(null!=(t=this.qe)&&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 it(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}lr(){if(this.hr&&clearInterval(this.hr),!0!==this.ze){var t=this.ur;t&&(this.hr=setInterval((()=>{this._e()}),t))}}Se(t){"event"===t&&this.cr(),!this.J.urlBlocked&&["sampled","active"].includes(this.status)&&this.lr()}dr(){var t;this.J.urlBlocked||(this.J.urlBlocked=!0,null==(t=this.ir)||t.scan(),clearInterval(this.hr),Sl.info("recording paused due to URL blocker"),this.Ee("recording paused",{reason:"url blocker"}))}vr(){var t;this.J.urlBlocked&&(null==(t=this.ir)||t.scan(),this.J.urlBlocked=!1,this._e(),this.rr(),this.lr(),this.Ee("recording resumed",{reason:"left blocked url"}),Sl.info("recording resumed"))}pr(t,e){var i;if("event"===t&&this.cr(),!this.Ue&&null!=(i=this.qe)&&i.hasPendingTriggers(this.sessionId)){this.Ue=!0;try{var r,n;null==(r=this._instance.persistence)||r.register({["url"===t?qn:jn]:this.sessionId}),null==(n=this.qe)||n.updateActiveTriggers(this.sessionId),this.Se(),this.Nt(),this.ke(t+"_trigger_matched",{["url"===t?"matchedUrl":"matchedEvent"]:e})}finally{this.Ue=!1}}}get isStarted(){return!!this.Be}get Fe(){var t=this._instance.get_property(Rn);if(t){var e;try{e=Q(t)?t:JSON.parse(t)}catch(t){return void Sl.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>_l)return Sl.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(Rn))}return e}}gr(t,e,i){this._instance.get_property(t)&&(e(),i())}start(e){var i,n,s=this.Fe;if(s){this.isStarted||(this.Je=!1!==this.ze&&!this.Xe,this.Xe=!1,this.Ye=this.Je,this.Ke=!1),this.bt&&(this.mr(),this.qt());var a=this.Oe.checkAndGetSessionAndWindowId(),o=a.windowId;this.Le=a.sessionId,this.Ct=o,null==(i=this._instance.persistence)||i.unregister(Un),null!=s&&s.endpoint&&(this.je=null==s?void 0:s.endpoint),this.qe=2===(null==s?void 0:s.version)&&(null==s?void 0:s.triggerGroups)&&s.triggerGroups.length>0?new Fo(this._instance,this.J,this.ke.bind(this),this.Ee.bind(this),this.Se.bind(this)):new Ao(this._instance,this.J,this.Y,this.K,this.ke.bind(this),this._e.bind(this),this.Se.bind(this)),this.qe.onRemoteConfig(s),null==(n=this.Ce)||n.call(this),this.Ce=this.qe.setupEventTriggerListeners(this._instance.on.bind(this._instance,"eventCaptured"),this.sessionId,((t,e)=>this.pr(t,e))),this.gr(An,(()=>{this.overrideSampling()}),(()=>{var t;return null==(t=this._instance.persistence)?void 0:t.unregister(An)})),this.gr(Fn,(()=>{this.overrideLinkedFlag()}),(()=>{var t;return null==(t=this._instance.persistence)?void 0:t.unregister(Fn)})),this.gr(Ln,(()=>{this.overrideTrigger("event")}),(()=>{var t;return null==(t=this._instance.persistence)?void 0:t.unregister(Ln)})),this.gr(On,(()=>{this.overrideTrigger("url")}),(()=>{var t;return null==(t=this._instance.persistence)?void 0:t.unregister(On)})),this.qe.makeSamplingDecisions(this.sessionId),this.yr(),this.et||(Yi(t,"beforeunload",this.Pt),Yi(t,"pagehide",this.jt),Yi(t,"offline",this.Bt),Yi(t,"online",this.Ht),Yi(r,"visibilitychange",this.$t),!this.kt&&Z(this.Oe.onSessionId)&&(this.kt=this.Oe.onSessionId(this.xt)),!this._t&&Z(this.Oe.on)?this._t=this.Oe.on("forcedIdleReset",(()=>{this.Tt(),this.ze="unknown",this.stop(),this.St=this.Oe.onSessionId(((t,e,i)=>{var r;null==(r=this.St)||r.call(this),this.St=void 0,this.xt(t,e,i)}))})):Z(this.Oe.on)||Sl.warn("bundled core has no SessionIdManager.on (requires posthog-js >= 1.268.6); recording will start but skip forced-idle-reset handling"),et(this.wt)&&(this.wt=this._instance.on("eventCaptured",(t=>{try{if("$pageview"===t.event){var e=null!=t&&t.properties.$current_url?this.Yt(t.properties.$current_url):"";if(!e)return;this.Ee("$pageview",{href:e})}}catch(t){Sl.error("Could not add $pageview to rrweb session",t)}}))),this.status===Zs&&this.ke(e||"recording_initialized"))}else Sl.info("remote config must be stored in persistence before recording can start")}br(){var e,i,n,s,a,o;null==t||t.removeEventListener("beforeunload",this.Pt),null==t||t.removeEventListener("pagehide",this.jt),null==t||t.removeEventListener("offline",this.Bt),null==t||t.removeEventListener("online",this.Ht),null==r||r.removeEventListener("visibilitychange",this.$t),clearInterval(this.hr),this.wr(),null==(e=this.wt)||e.call(this),this.wt=void 0,null==(i=this.Ce)||i.call(this),this.Ce=void 0,null==(n=this.kt)||n.call(this),this.kt=void 0,null==(s=this._t)||s.call(this),this._t=void 0,null==(a=this.St)||a.call(this),this.St=void 0,null==(o=this.qe)||o.stop(),this.kr(),this.mr()}mr(){this.yt+=1,this.vt=[],this.ft=0,this._r=void 0,this.bt=!1}kr(){var t,e,i;null==(t=this.Sr)||t.stop(),this.We=[],null==(e=this.ir)||e.stop(),this.ir=void 0,this.He=!1,null==(i=this.Be)||i.call(this),this.Be=void 0}Cr(){if(!this._r||0===this.ft)return!1;if(this.bt)return!0;this.bt=!0;var t=this.yt;return this.wr(),this.kr(),this._r.catch((()=>{})).then((()=>{t===this.yt&&(this.bt=!1,this.Nt(),this.qt(),this.br(),Sl.info("stopped"))})).catch((()=>{this.bt=!1,this.br(),Sl.info("stopped")})),!0}stop(){this.kr(),this.Cr()||(this.Nt(),this.qt(),this.br(),Sl.info("stopped"))}It(t){var e;this.stop(),this.Mr=void 0,this.Tr=void 0,this.Ze=0,this.Ge=0,this.Qe=0,null==(e=Tl())||null==e.resetSnapshotCostState||e.resetSnapshotCostState(),this.start("session_id_changed"),this.Je=t,this.Ye=!1}cr(){this.isStarted||(this.Xe=!0),this.Je&&(this.Je=!1,this.Ye=!1,this.Ke&&(this.Ke=!1,this._e()),this.Ir())}discard(){this.qt(),this.br(),Sl.info("discarded")}Er(t,e,i,r,n){var s={$snapshot_bytes:i,$snapshot_data:e,$session_id:r,$window_id:n};this.status!==Vs?(this.Rr(t,r),this.Ar(s)):this.qt()}Lr(){try{this.Or()}catch(t){this.it||(this.it=!0,Sl.error("could not track full snapshot cost",t))}}Or(){var t,e=null==(t=Tl())||null==t.getLastSnapshotCost?void 0:t.getLastSnapshotCost();e&&e!==this.Tr&&(this.Tr=e,this.Mr&&this.Mr.durationMs>=e.durationMs||(this.Mr=e),500>e.durationMs||Sl.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}))}Rr(t,e){t.type!==m.FullSnapshot?t.type===m.IncrementalSnapshot&&(K(this.ct)||this.ct===e||this.dt===e||(this.dt=e,Sl.info("incremental snapshot for a session with no full snapshot - requesting one",{sessionId:e}),this._e())):this.ct=e}Pr(t){t.counted&&t.generation===this.yt&&(this.ft=Math.max(0,this.ft-1)),t.counted=!1,this.vt=this.vt.filter((e=>e!==t))}Dr(t,e,i){t.processed||t.generation!==this.yt||(t.processed=!0,this.Er(t.event,e,i,t.targetSessionId,t.targetWindowId))}Fr(t){try{var e=t.compressionEnabled?Bl(t.event):{event:t.event,size:_a(t.event)};this.Dr(t,e.event,e.size)}finally{this.Pr(t)}}Ft(){[...this.vt].forEach((t=>{this.Fr(t)}))}Nr(t,e,i,r){var n=this,s={event:t,compressionEnabled:e,targetSessionId:i,targetWindowId:r,generation:this.yt,processed:!1,counted:!0};this.vt.push(s),this.ft+=1;var a=function(){var i=f((function*(){try{if(s.processed)return;var i,r;try{var a=e?$l(t)?yield function(t){return Hl.apply(this,arguments)}(t):Bl(t):{event:t,size:_a(t)};i=a.event,r=a.size}catch(e){Sl.error("could not process queued compression event - will use uncompressed event",e),i=t,r=_a(t)}n.Dr(s,i,r)}finally{n.Pr(s)}}));return function(){return i.apply(this,arguments)}}();this._r=this._r?this._r.catch((()=>{})).then(a):a()}onRRwebEmit(t){var e,i,r,n,s,a,o,l,u;if(this._instance.sessionManager&&(this.sr(),t&&Q(t))){if(t.type===m.Meta){var h=this.Yt(t.data.href);if(this.ar=h,!h)return;t.data.href=h}else this.nr();if(null==(e=this.qe)||e.checkUrlTriggers(this.sessionId,(()=>this.dr()),(()=>this.vr()),((t,e)=>this.pr(t,e))),!this.J.urlBlocked||function(t){return t.type===m.Custom&&"recording paused"===t.data.tag}(t)){var d,v,c;t.type===m.FullSnapshot&&(null!=(d=Tl())&&null!=d.wasMaxDepthReached&&d.wasMaxDepthReached()&&(this.rt=!0),this.Lr(),Promise.resolve().then((()=>this.Lr())),this.lr(),null==(v=this.Sr)||v.reset(),null==(c=this._instance.persistence)||c.register_once({[Un]:t.timestamp},void 0));var f=t.type===m.FullSnapshot&&(null==(i=this.qe)?void 0:i.hasPendingTriggers(this.sessionId));f&&this.qr();var p=this.Sr?this.Sr.throttleMutations(t):t;if(p){var g=function(t){var e=t;if(e&&Q(e)&&6===e.type&&Q(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}(p),b=function(t){return Wl(t)?t.data.payload:null}(g),_=function(t){return Vl(t)?t.data.payload:null}(g),w=function(t){return Ul(t)?t.data.payload:null}(g);b||_?null!=b&&b.lastActivityTimestamp&&(g.timestamp=b.lastActivityTimestamp):null!=w&&w.sessionId||this.jr(g),t.type===m.FullSnapshot&&(this.ht.push([this.Le,t.timestamp]),this.ht.length>6&&(this.ht=this.ht.slice(-6)));var k=null!==(r=null!==(n=null!==(s=null==b?void 0:b.currentSessionId)&&void 0!==s?s:null==_?void 0:_.nextSessionId)&&void 0!==n?n:null==w?void 0:w.sessionId)&&void 0!==r?r:this.Le,S=null!==(a=null!==(o=null!==(l=null==b?void 0:b.currentWindowId)&&void 0!==l?l:null==_?void 0:_.nextWindowId)&&void 0!==o?o:null==w?void 0:w.windowId)&&void 0!==a?a:this.Ct;if(!0!==this.ze||function(t){return Ul(t)||Wl(t)||Vl(t)}(g)){g.type===m.FullSnapshot&&(this.Ve=0),w&&(g.timestamp=w.lastActivityTimestamp+w.threshold);var x=this.He;this.He=!0,f?this.rr(!0):x||this.rr();var C=null===(u=this._instance.config.session_recording.compress_events)||void 0===u||u;if(this.ft>0||C&&$l(g))this.Nr(g,C,k,S);else{var T=C?Bl(g):{event:g,size:_a(g)};this.Er(g,T.event,T.size,k,S)}}else(function(t){return t.type===m.FullSnapshot||t.type===m.Meta||t.type===m.IncrementalSnapshot&&t.data.source!==y.CanvasMutation})(g)&&this.Ve++}else!0===this.ze&&this.Ve++}}}get status(){return this.qe?this.qe.getStatus({instance:this._instance,sessionId:this.sessionId,isSampled:this.De,rrwebError:this.et,urlTriggerMatching:this.J,eventTriggerMatching:this.Y,linkedFlagMatching:this.K,remoteConfig:this.Fe}):Vs}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._e(),this.cr(),this.ke("linked_flag_overridden")}overrideSampling(){var t;null==(t=this._instance.persistence)||t.register({[$n]:this.sessionId,[Pn]:null}),this._e(),this.cr(),this.ke("sampling_overridden")}overrideTrigger(t){this.pr(t),this.cr()}Br(){try{var e,i=null==t||null==(e=t.location)?void 0:e.href;if(!i)return;var r=this.Yt(i);if(!r)return;return new URL(r).hostname||void 0}catch(t){return}}wr(){this.Hr&&(clearTimeout(this.Hr),this.Hr=void 0)}Ir(){this.Hr||(this.Hr=setTimeout((()=>{this.Nt()}),2e3))}$r(){return this.ct!==this.At.sessionId&&0!==this.At.data.length&&this.At.data.every((t=>(null==t?void 0:t.type)===m.Custom&&!Wl(t)&&!Vl(t)))}Ur(){var t,e;return null!==(t=null==(e=this.qe)?void 0:e.getPendingTriggerConditions(this.sessionId))&&void 0!==t?t:[]}Wr(t){if(t!==Qs)return K(this.zr)||this._instance.register_for_session({[Is]:[]}),void(this.zr=void 0);var e=this.Ur();if(0===e.length)return K(this.zr)||this._instance.register_for_session({[Is]:[]}),void(this.zr=void 0);var i=e.join(", "),r=this.sessionId+":"+i;r!==this.zr&&(this.zr=r,this._instance.register_for_session({[Is]:e}),Sl.info("buffering: "+i))}Nt(){var t;if(this.wr(),this.Je)return this.At;if(this.$r())return this.At.size>wl?this.qt():this.At;var e=this.At;null==(t=this.qe)||t.ensureSamplingDecision(this.sessionId);var i=this.Lt(),r=this.status;if(this.Wr(r),r===Qs||r===Js||r===Vs||i)return this.Ir(),this.At;if(this.At!==e)return this.At;if(e.data.length>0){var n,s=this.Br();ka(e).forEach((t=>{var e;null==(e=this.Mt)||e.trackSize(t.sessionId,t.size),this.Vr({$snapshot_bytes:t.size,$snapshot_data:t.data,$session_id:t.sessionId,$window_id:t.windowId,$lib:qi.LIB_NAME,$lib_version:qi.LIB_VERSION,$snapshot_host:s})})),null==(n=this.qe)||n.onFlushComplete()}return this.qt()}Ar(t){var e,i=2+((null==(e=this.At)?void 0:e.data.length)||0),r=t.$session_id,n=this.At.sessionId!==r;if(n||!0!==this.ze&&!this.Je&&this.At.size+t.$snapshot_bytes+i>wl){var s=this.Le;if(this.At=this.Nt(),this.Le!==s)return;n&&this.At.data.length>0&&(this.At=this.qt()),this.At.sessionId=r,this.At.windowId=t.$window_id}this.Je&&(this.Ke||this.At.size+t.$snapshot_bytes+i>wl)?this.Ke||(this.Ke=!0,this.At=this.qt()):(this.At.size+=t.$snapshot_bytes,this.At.data.push(t.$snapshot_data),this.At.sizes.push(t.$snapshot_bytes),!0===this.ze||this.Je||this.Ir())}Vr(t){this._instance.capture("$snapshot",t,{_url:this._instance.requestRouter.endpointFor("api",this.je),_noTruncate:!0,_batchKey:"recordings",skip_client_rate_limiting:!0})}get Ot(){var t,e,i=null==(t=this.At)?void 0:t.data[(null==(e=this.At)?void 0:e.data.length)-1],r=this.Oe.checkAndGetSessionAndWindowId(!0);return i?i.timestamp-r.sessionStartTimestamp:null}qr(){if(!this.At||0===this.At.data.length)return this.qt();for(var t=-1,e=this.At.data.length-1;e>=0;e--)if(this.At.data[e].type===m.Meta){t=e;break}return 0>t?this.qt():(this.At.data=this.At.data.slice(t),this.At.sizes=this.At.sizes.slice(t),this.At.size=this.At.sizes.reduce(((t,e)=>t+e),0),this.At)}qt(){return this.At={size:0,data:[],sizes:[],sessionId:this.Le,windowId:this.Ct},this.At}ke(t,e){this._instance.register_for_session({[Fs]:t}),Sl.info(t.replace("_"," "),e),"session_id_changed"!==t&&this.Ee("$recording_started",p({reason:t},e))}Zr(t){var e;return 3===t.type&&-1!==xl.indexOf(null==(e=t.data)?void 0:e.source)}jr(t){var e=this.Zr(t);e||!0===this.ze||t.timestamp-this.$e>this.Pe&&(this.ze=!0,clearInterval(this.hr),this.Ee("sessionIdle",{eventTimestamp:t.timestamp,lastActivityTimestamp:this.$e,threshold:this.Pe,bufferLength:this.At.data.length,bufferSize:this.At.size,sessionId:this.Le,windowId:this.Ct}),this.Nt());var i=!1;if(e&&(this.$e=t.timestamp,this.ze)){var r="unknown"===this.ze;this.ze=!1,r||(this.Ee("sessionNoLongerIdle",{reason:"user activity",type:t.type}),i=!0)}var n=this.Oe.checkAndGetSessionAndWindowId(!e,t.timestamp),s=n.windowId,a=n.sessionId,o=this.Le!==a,l=this.Ct!==s;if(this.Ct=s,this.Le=a,o||l){var u=o&&!1!==this.ze;u&&(this.ze="unknown"),this.It(u)}else if(e&&this.cr(),i){var h,d=["sampled","active"].includes(this.status)||(null==(h=this.qe)?void 0:h.hasPendingTriggers(this.sessionId));this.Ve>0&&d&&this._e(),this.rr(),this.lr()}}Tt(){var t;null==(t=this.qe)||t.clearConditionalRecordingPersistence()}get sdkDebugProperties(){var t,e,i,r,n,s,a,o,l,u=this.Oe.checkAndGetSessionAndWindowId(!0).sessionStartTimestamp,h=null==(t=Tl())||null==t.getDeferredStylesheetStats?void 0:t.getDeferredStylesheetStats();return{$recording_status:this.status,$sdk_debug_replay_internal_buffer_length:this.At.data.length,$sdk_debug_replay_internal_buffer_size:this.At.size,$sdk_debug_current_session_duration:this.Ot,$sdk_debug_session_start:u,$sdk_debug_replay_flushed_size:null==(e=this.Mt)?void 0:e.currentTrackedSize(this.sessionId),$sdk_debug_replay_full_snapshots:this.ht,$snapshot_max_depth_exceeded:this.rt,$sdk_debug_replay_slowest_full_snapshot_ms:gl(null==(i=this.Mr)?void 0:i.durationMs),$sdk_debug_replay_slowest_full_snapshot_stylesheet_ms:gl(null==(r=this.Mr)?void 0:r.stylesheetMs),$sdk_debug_replay_slowest_full_snapshot_nodes:null==(n=this.Mr)?void 0:n.nodeCount,$sdk_debug_replay_slowest_full_snapshot_css_rules:null==(s=this.Mr)?void 0:s.cssRuleCount,$sdk_debug_replay_slowest_full_snapshot_css_rules_non_deferrable:null==(a=this.Mr)?void 0:a.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:gl(null==h?void 0:h.totalMs),$sdk_debug_replay_deferred_stylesheet_slowest_slice_ms:gl(null==h?void 0:h.slowestSliceMs),$sdk_debug_replay_slowest_mutation_batch_ms:gl(null==(o=Tl())||null==o.getMutationCost||null==(o=o.getMutationCost())?void 0:o.slowestBatchMs),$sdk_debug_replay_discarded_duration_samples:null==(l=Tl())||null==l.getDiscardedDurationSamples?void 0:l.getDiscardedDurationSamples(),$sdk_debug_replay_throttled_mutations_dropped:this.Ze,$sdk_debug_replay_oversized_mutations_dropped:this.Ge,$sdk_debug_replay_oversized_mutation_bytes_dropped:this.Qe,$sdk_debug_replay_rrweb_error:this.et,$sdk_debug_rrweb_attached:!!this.Be,$sdk_debug_rrweb_start_attempted:this.tt}}yr(){var e;if(!this.Be){this.tt=!0;var i,n,s,a,o={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},l=this._instance.config.session_recording;for(var u of Object.entries(l||{})){var h=u[0],d=u[1];if(h in o)if("maskInputOptions"===h)o.maskInputOptions=p({password:!0},d);else if("sampling"===h){var v=null!=d?d:{},c={};K(v.mousemove)||(c.mousemove=v.mousemove),K(v.mouseInteraction)||(c.mouseInteraction=v.mouseInteraction),o.sampling=c}else o[h]=d}!0===(null==l?void 0:l.captureJsonLd)&&!0!==o.slimDOMOptions&&"all"!==o.slimDOMOptions&&(o.slimDOMOptions=p({},o.slimDOMOptions,{script:!0})),this.Vt&&this.Vt.enabled&&(o.recordCanvas=!0,o.sampling=p({},o.sampling,{canvas:this.Vt.fps}),o.dataURLOptions={type:"image/webp",quality:this.Vt.quality},o.canvasResolutionScale=this.zt,o.canvasMasking={configured:()=>{var t;return Z(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(Z(i))try{var r;return null!==(r=i(t))&&void 0!==r?r:null}catch(t){return this.st||(this.st=!0,Sl.warn("canvasCapture.maskRegionsFn threw, canvas frames will be skipped",t)),null}}}),this.Ut&&(o.maskAllInputs=null===(i=this.Ut.maskAllInputs)||void 0===i||i,o.maskTextSelector=null!==(n=this.Ut.maskTextSelector)&&void 0!==n?n:void 0,o.blockSelector=null!==(s=this.Ut.blockSelector)&&void 0!==s?s:void 0,o.maskAllElementAttributes=null!==(a=this.Ut.maskAllElementAttributes)&&void 0!==a&&a),o.maskAllElementAttributes&&o.maskAttributeFn&&(o.maskAttributeFn=void 0,this.ot||(this.ot=!0,Sl.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.Wt();var f=Ml();if(f){this.Sr=null!==(e=this.Sr)&&void 0!==e?e:new oo(f,{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";Sl.info(i,{node:e}),this.log(kl+" "+i,"warn")},onDroppedAttributeMutations:t=>this.Ze+=t,bytesRefillRate:this._instance.config.session_recording.__mutationBytesRefillRate,bytesBucketSize:this._instance.config.session_recording.__mutationBytesBucketSize,resyncIntervalMs:this.ur,onDroppedOversizedMutation:t=>{0===this.Ge&&this.log(kl+" Dropped an oversized DOM mutation to keep the recording playable. The recording will resync with a full snapshot.","warn"),this.Ge+=1,this.Qe+=t},requestFullSnapshot:()=>this._e()});var g=this.Qt();if(this.Be=f(p({emit:t=>{this.onRRwebEmit(t)},plugins:g,errorHandler:(t,e)=>"rrweb"===e&&(this.ut||(this.ut=!0,Sl.error("rrweb internal error - recording will continue but may be incomplete",t)),!0)},o)),!this.Be)return this.et=!0,void Sl.error("rrweb failed to start - Loss of recording data is possible. Check the browser console for rrweb errors.");this.et=!1,!0===(null==l?void 0:l.captureJsonLd)&&r&&null!=t&&t.MutationObserver&&!this.ir&&(this.ir=function(t,e,i){var r=new WeakMap,n=i.getCaptureState||(()=>!0),s=Jo,a=e=>{try{var a=n();if(!s||!1===a||!e.isConnected||e.ownerDocument!==t||function(t,e){for(var i=t;i;){if(fl(i,e.blockClass,e.blockSelector)||fl(i,e.maskTextClass,e.maskTextSelector))return!0;var r=i.parentNode;i=i.parentElement||(r&&r.nodeType===r.DOCUMENT_FRAGMENT_NODE?r.host:null)}return!1}(e,i))return;var o=function(t){if(!t||t.length>Jo)return null;try{var e=JSON.parse(t),i=G(e)?e.map(vl):vl(e);if(tt(i)||G(i)&&(!i.length||i.some(tt)))return null;var r=JSON.stringify(i);return r.length>2e4?null:[i,r]}catch(t){return null}}(e.text);if(!o)return void r.delete(e);var l=o[0],u=o[1];if(tt(a))return void r.set(e,u);if(r.get(e)!==u){if(u.length>s)return void(s=0);i.emit(l)&&(r.set(e,u),s-=u.length)}}catch(t){return}};try{var o=new e((t=>{try{if(!s||!1===n())return;var e=t=>{for(var e of pl(t))a(e)};for(var i of t)if("childList"===i.type)cl(i.target)&&a(i.target),i.addedNodes.forEach(e);else if("characterData"===i.type){var r=i.target.parentNode;r&&cl(r)&&a(r)}else"attributes"===i.type&&cl(i.target)&&a(i.target)}catch(t){return}}));return o.observe(t,{attributes:!0,attributeFilter:["type"],characterData:!0,childList:!0,subtree:!0}),{scan(e){void 0===e&&(e=!1),s&&!1!==n()&&pl(t.documentElement).forEach((t=>{e&&r.delete(t),a(t)}))},stop(){return o.disconnect()}}}catch(t){return{scan(){},stop(){}}}}(r,t.MutationObserver,{blockClass:o.blockClass,blockSelector:o.blockSelector,maskTextClass:o.maskTextClass,maskTextSelector:o.maskTextSelector,getCaptureState:()=>{var t;return!0!==(null==(t=this._instance.config.session_recording)?void 0:t.captureJsonLd)||this.J.urlBlocked||this.J.isCurrentUrlBlocked()?null:this.er()},emit:t=>this.tr(t)}),this.J.isCurrentUrlBlocked()&&this.ir.scan()),this.$e=Date.now(),this.ze=nt(this.ze)?this.ze:"unknown",this.tryAddCustomEvent("$remote_config_received",this.Fe),this.Ee("$session_options",{sessionRecordingOptions:o,activePlugins:g.map((t=>null==t?void 0:t.name))}),this.Ee("$posthog_config",{config:this._instance.config})}else Sl.error("_startRecorder was called but rrwebRecord is not available. This indicates something has gone wrong.")}}tryAddCustomEvent(t,e){return this.Ee(t,e)}}var Zl,Ql=["type"],Jl=Object.defineProperty,Kl=(t,e,i)=>((t,e,i)=>e in t?Jl(t,e,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[e]=i)(t,"symbol"!=typeof e?e+"":e,i),Yl=(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))(Yl||{}),Xl=(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))(Xl||{}),tu=(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))(tu||{}),eu=(t=>(t[t.Mouse=0]="Mouse",t[t.Pen=1]="Pen",t[t.Touch=2]="Touch",t))(eu||{}),iu=(t=>(t[t["2D"]=0]="2D",t[t.WebGL=1]="WebGL",t[t.WebGL2=2]="WebGL2",t))(iu||{}),ru=(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))(ru||{}),nu=(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))(nu||{});function su(t,e){return-1!==t.indexOf(e)}var au={Node:["childNodes","parentNode","parentElement","textContent"],ShadowRoot:["host","styleSheets"],Element:["shadowRoot"],MutationObserver:[]},ou={Node:["contains","getRootNode"],ShadowRoot:["getSelection"],Element:["querySelector","querySelectorAll"],MutationObserver:["constructor"]},lu={};function uu(t){if(lu[t])return lu[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 au?au[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 ou?ou[t]:void 0,a=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&&a)return lu[t]=e.prototype,e.prototype;var o=document.createElement("iframe");o.style.display="none";var l=!1;try{document.body.appendChild(o);var u=o.contentWindow;if(!u)return e.prototype;var h=u[t].prototype;return h?(function(t){return su(t,"AppleWebKit")&&!su(t,"Chrome")}(navigator.userAgent)&&(o.classList.add("rr-block","ph-no-capture"),o.setAttribute("__rrwebUntaintedPrototype",t),l=!0),lu[t]=h):i}catch(t){return i}finally{!l&&o.parentNode&&document.body.removeChild(o)}}var hu={};function du(t,e,i){var r,n=t+"."+String(i);if(hu[n])return hu[n].call(e);var s=uu(t),a=null==(r=Object.getOwnPropertyDescriptor(s,i))?void 0:r.get;return a?(hu[n]=a,a.call(e)):e[i]}var vu={};function cu(t,e,i){var r=t+"."+String(i);if(vu[r])return vu[r].bind(e);var n=uu(t)[i];return"function"!=typeof n?e[i]:(vu[r]=n,n.bind(e))}function fu(){return uu("MutationObserver").constructor}function pu(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=>{var e;return"function"==typeof t?null!==(e=t.__rrweb_layer__)&&void 0!==e?e:t.__posthog_layer__:void 0},r=t[e],a=i(r);a;){if(a.next===s)return void(a.next=n.next);a=i(r=a.next)}else t[e]=n.next}}catch(t){return()=>{}}}var gu={childNodes:t=>du("Node",t,"childNodes"),parentNode:t=>du("Node",t,"parentNode"),parentElement:t=>du("Node",t,"parentElement"),textContent:t=>du("Node",t,"textContent"),contains:(t,e)=>cu("Node",t,"contains")(e),getRootNode:t=>cu("Node",t,"getRootNode")(),host:t=>t&&"host"in t?du("ShadowRoot",t,"host"):null,styleSheets:t=>t.styleSheets,shadowRoot:t=>t&&"shadowRoot"in t?du("Element",t,"shadowRoot"):null,querySelector:(t,e)=>cu("Element",t,"querySelector")(e),querySelectorAll:(t,e)=>cu("Element",t,"querySelectorAll")(e),mutationObserver:fu,patch:pu},mu=()=>({durationMs:0,stylesheetMs:0,nodeCount:0,cssRuleCount:0,nonDeferrableCssRuleCount:0,deferredStylesheetCount:0});function yu(){try{if("undefined"!=typeof performance&&performance.now)return performance.now()}catch(t){}return Date.now()}var bu=0,_u=6e4;function wu(){bu+=1}function ku(){return bu}function Su(t,e){return e!==bu||t>_u}var xu=0,Cu=0,Tu=0,Mu=mu(),Eu=null,Iu=null,Ru=[],Pu=0,Au=0,Fu={slowestBatchMs:0},Ou={deferredCount:0,failedCount:0,abandonedCount:0,totalMs:0,slowestSliceMs:0},Lu=t=>t&&t>0?t:null;function Du(t){(xu+=1)>1||(Mu=mu(),Ru=[],Pu=0,Iu=Lu(t),Cu=yu(),Tu=bu)}function $u(){return 0===xu?Eu||mu():(xu-=1)>0?Mu:(Mu.durationMs=yu()-Cu,Mu.deferredStylesheetCount=Pu,Ou.deferredCount+=Pu,Iu=null,Su(Mu.durationMs,Tu)?Mu:Eu=Mu)}var Nu=32;function qu(t,e,i){var r=t.length;if(i>=Nu)return r;for(var n=0;t.length>n;n++){var s=t[n];try{var a=s.cssRules;if(a&&a.length)r+=qu(a,e,i+1);else if(e&&s.styleSheet){var o=s.styleSheet;if(!e.has(o)){e.add(o);var l=o.rules||o.cssRules;l&&(r+=qu(l,e,i+1))}}}catch(t){}}return r}function ju(t){if(0!==xu){var e=qu(t,null,0);Mu.cssRuleCount+=e,Au>0&&(Mu.nonDeferrableCssRuleCount+=e)}}function Bu(t){Au+=1;try{return t()}finally{Au-=1}}function Hu(t){xu>0&&(Mu.stylesheetMs+=t)}function zu(t){if(0===xu||null===Iu)return!1;var e=Mu.cssRuleCount-Mu.nonDeferrableCssRuleCount;return e>=Iu||e+function(t){try{var e=t&&(t.rules||t.cssRules);if(!e)return 0;var i=new WeakSet;return i.add(t),qu(e,i,0)}catch(t){return 0}}(t)>Iu}function Uu(){Ou.failedCount+=1}function Wu(t){t>0&&(Ou.abandonedCount+=t)}function Vu(t){return t.nodeType===t.ELEMENT_NODE}function Gu(t){var e=t&&"host"in t&&"mode"in t&&gu.host(t)||null;return Boolean(e&&"shadowRoot"in e&&gu.shadowRoot(e)===t)}function Zu(t){return"[object ShadowRoot]"==={}.toString.call(t)}function Qu(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 Ju(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 Ku=0;function Yu(t){var e=0===Ku,i=e?yu():0;Ku+=1;try{var r=t.rules||t.cssRules;if(!r)return null;ju(r);var n=t.href;return!n&&t.ownerNode&&(n=t.ownerNode.baseURI),Qu(Array.from(r,(t=>Xu(t,n))).join(""))}catch(t){return null}finally{Ku-=1,e&&Hu(yu()-i)}}function Xu(t,e){var i;if(eh(t)){var r;try{r=Yu(t.styleSheet)||Ju(t)}catch(e){r=t.cssText}try{if(r&&(null==(i=t.styleSheet)?void 0:i.href))return mh(r,t.styleSheet.href)}catch(t){}return r}var n=t.cssText;return ih(t)&&t.selectorText.includes(":")&&(n=th(n)),e?mh(n,e):n}function th(t){return t.replace(/(\[(?:[\w-]+)[^\\])(:(?:[\w-]+)\])/gm,"$1\\$2")}function eh(t){return"styleSheet"in t}function ih(t){return"selectorText"in t}var rh=/^-?[A-Za-z_][\w-]*$/,nh=/^-?[A-Za-z_][\w-]*(\.-?[A-Za-z_][\w-]*)*$/;function sh(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 o=e[e.length-1];return o.parts.push(t),void(o.index+=1)}if(!n.importRule)return i=!0,void(r=t);a(e[e.length-1],n.importRule,t)}function a(t,e,i){var r;try{var n;try{n=i||Ju(e)}catch(t){n=e.cssText}try{n&&(null==(r=e.styleSheet)?void 0:r.href)&&(n=mh(n,e.styleSheet.href))}catch(t){}n&&t.parts.push(n),t.index+=1}catch(t){s(null)}}function o(t){var i=t.rules[t.index];if("sheet"===t.kind&&eh(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 a(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(ih(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&&!rh.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]?rh.test(i.name)?"@keyframes "+i.name+" {":null:""===i.name?"@layer {":nh.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?mh(r,n):r,fixColons:"sheet"===i.kind&&ih(t)&&t.selectorText.includes(":")}),!0}catch(t){return!1}}(i,t)){var s=i.cssText;"sheet"===t.kind&&ih(i)&&i.selectorText.includes(":")&&(s=th(s)),t.parts.push(t.sheetHref?mh(s,t.sheetHref):s),t.index+=1}}return function(t){try{var i=t.rules||t.cssRules;if(!i)return!1;ju(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,!eh(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;ju(s);var a=r.href;!a&&r.ownerNode&&(a=r.ownerNode.baseURI);var o=Array.from(s);n.set(e,{sheet:r,rules:o,sheetHref:a}),i.push({sheet:r,rules:o,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=yu(),a=t>0?t:1;try{for(;!i&&a>0;){var l=e[e.length-1];if(l.rules.length>l.index){a-=1;try{o(l)}catch(t){s(null)}}else{var u=null;try{if("group"===l.kind){var h=l.prelude+l.parts.join("")+"}";u=l.fixColons?th(h):h}else u=Qu(l.parts.join(""))}catch(t){}s(u)}}}catch(t){i=!0,r=null}finally{Hu(yu()-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 ah{constructor(){Kl(this,"idNodeMap",new Map),Kl(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))),Vu(t)){var i=gu.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 oh(t){var e=t.element,i=t.maskInputOptions,r=t.tagName,n=t.type,s=t.maskInputFn,a=t.value||"",o=n&&lh(n);return(i[r.toLowerCase()]||o&&i[o])&&(a=s?s(a,e):"*".repeat(a.length)),a}function lh(t){return t.toLowerCase()}var uh=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 hh(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&&uh.has(lh(i))?r:"*".repeat(r.length):n?n(i,r,e):r:r}var dh="__rrweb_original__";function vh(t){try{var e=t.type;return t.hasAttribute("data-rr-is-password")?"password":e?lh(e):null}catch(t){return null}}var ch=/url\((?:(')([^']*)'|(")(.*?)"|([^)]*))\)/gm,fh=/^(?:[a-z+]+:)?\/\//i,ph=/^www\..*/i,gh=/^(data:)([^,]*),(.*)/i;function mh(t,e){return(t||"").replace(ch,((t,i,r,n,s,a)=>{var o,l=r||s||a,u=i||n||"";if(!l)return t;if(fh.test(l)||ph.test(l))return"url("+u+l+u+")";if(gh.test(l))return"url("+u+l+u+")";if("/"===l[0])return"url("+u+(((o=e).indexOf("//")>-1?o.split("/").slice(0,3).join("/"):o.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 yh,bh,_h="data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTAwJSIgaGVpZ2h0PSIxMDAlIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPgogIDxkZWZzPgogICAgPHBhdHRlcm4gaWQ9InN0cmlwZXMiIHBhdHRlcm5Vbml0cz0idXNlclNwYWNlT25Vc2UiIHdpZHRoPSIxNiIgaGVpZ2h0PSIxNiI+CiAgICAgIDxyZWN0IHdpZHRoPSIxNiIgaGVpZ2h0PSIxNiIgZmlsbD0iYmxhY2siLz4KICAgICAgPHBhdGggZD0iTTggMEgxNkwwIDE2VjhMOCAwWiIgZmlsbD0iIzJEMkQyRCIvPgogICAgICA8cGF0aCBkPSJNMTYgOFYxNkg4TDE2IDhaIiBmaWxsPSIjMkQyRDJEIi8+CiAgICA8L3BhdHRlcm4+CiAgPC9kZWZzPgogIDxyZWN0IHdpZHRoPSIxMDAlIiBoZWlnaHQ9IjEwMCUiIGZpbGw9InVybCgjc3RyaXBlcykiLz4KPC9zdmc+Cg==",wh=4096,kh=1e5,Sh=10,xh=new Map,Ch=1,Th=new RegExp("[^a-z0-9-_:]"),Mh=-2;function Eh(){return Ch++}var Ih=/^[^ \t\n\r\u000c]+/,Rh=/^[, \t\n\r\u000c]+/,Ph=new WeakMap;function Ah(t,e){return e&&""!==e.trim()?Fh(t,e):e}function Fh(t,e){var i=Ph.get(t);if(i||(i=t.createElement("a"),Ph.set(t,i)),e){if(e.startsWith("blob:")||e.startsWith("data:"))return e}else e="";return i.setAttribute("href",e),i.href}function Oh(t,e){return(null==e?void 0:e.maxBase64ImageLength)?function(t,e){return e&&t.length>e?_h:t}(t,e.maxBase64ImageLength):t}function Lh(t,e,i,r,n,s){var a;if(!r)return r;if("src"===i||"href"===i&&("use"!==e||"#"!==r[0])){if("link"===e&&n){var o=null==(a=n.sheet)?void 0:a.href;if(o)return o}var l=Ah(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(kh>e.length)return e;if(!t.complete||0===t.naturalWidth)return e;if(t.naturalWidth>wh||t.naturalHeight>wh)return e;var n=xh.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 a=s.getContext("2d");if(!a)return e;a.drawImage(t,0,0);var o=s.toDataURL(i||"image/webp",null!=r?r:.4),l=e.length>o.length?o:e;if(xh.size>=Sh){var u=xh.keys().next().value;void 0!==u&&xh.delete(u)}return xh.set(e,{type:i,quality:r,result:l}),l}catch(t){return e}}(n,l,s.type,s.quality)),Oh(u,s)}if("image"===e)return Oh(l,s)}return l}if("xlink:href"===i&&"#"!==r[0]){var h=Ah(t,r);return"image"===e&&h.startsWith("data:")?Oh(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(Rh),e.length>i;){var s=r(Ih);if(","===s.slice(-1))s=Ah(t,s.substring(0,s.length-1)),n.push(s);else{var a="";s=Ah(t,s);for(var o=!1;;){var l=e.charAt(i);if(""===l){n.push((s+a).trim());break}if(o)")"===l&&(o=!1);else{if(","===l){i+=1,n.push((s+a).trim());break}"("===l&&(o=!0)}a+=l,i+=1}}}return n.join(", ")}(t,r):"style"===i?mh(r,Fh(t)):"object"===e&&"data"===i?Ah(t,r):r:Ah(t,r)}function Dh(t,e,i){return("video"===t||"audio"===t)&&"autoplay"===e}function $h(t,e,i){if(!t)return!1;if(t.nodeType!==t.ELEMENT_NODE)return!!i&&$h(gu.parentNode(t),e,i);for(var r=t.classList.length;r--;)if(e.test(t.classList[r]))return!0;return!!i&&$h(gu.parentNode(t),e,i)}function Nh(t,e,i,r){var n;if(Vu(t)){if(!gu.childNodes(n=t).length)return!1}else{if(null===gu.parentElement(t))return!1;n=gu.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($h(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 qh(t,e,i){var r=t.removeEventListener;"function"==typeof r&&r.call(t,e,i)}var jh=new Map;function Bh(t,e){return Array.from(t.styleSheets).find((t=>t.href===e))}function Hh(t){return null==t?"":t.toLowerCase()}var zh=50,Uh=!1,Wh=!1;function Vh(t,e){var i=e.doc,r=e.mirror,n=e.blockClass,s=e.blockSelector,a=e.maskTextClass,o=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,b=e.slimDOMOptions,_=e.dataURLOptions,w=void 0===_?{}:_,k=e.inlineImages,S=void 0!==k&&k,x=e.recordCanvas,C=void 0!==x&&x,T=e.canvasMaskingConfigured,M=e.onSerialize,E=e.onIframeLoad,I=e.iframeLoadTimeout,R=void 0===I?5e3:I,P=e.onIframeListenerRegistered,A=e.onStylesheetLoad,F=e.stylesheetLoadTimeout,O=void 0===F?5e3:F,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,H=e.maxDepth,z=void 0===H?zh:H,U=e.needsMask,W=e.preserveWhiteSpace,V=void 0===W||W;if(B>=z)return Wh=!0,Uh||(Uh=!0,console.warn("[rrweb-snapshot] DOM tree depth exceeded max depth of "+z+". Children beyond this depth will not be recorded. This may indicate deeply nested DOM structures.")),null;U||(U=Nh(t,a,o,void 0===U)),xu>0&&(Mu.nodeCount+=1);var G,Z=function(t,e){var i=e.doc,r=e.blockClass,n=e.blockSelector,s=e.needsMask,a=e.inlineStylesheet,o=e.maskInputOptions,l=void 0===o?{}:o,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,b=e.keepIframeSrcFn,_=e.newlyAddedElement,w=void 0!==_&&_,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:nu.Document,childNodes:[],compatMode:t.compatMode}:{type:nu.Document,childNodes:[]};case t.DOCUMENT_TYPE_NODE:return{type:nu.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,a=e.inlineStylesheet,o=e.maskInputOptions,l=void 0===o?{}:o,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,b=e.newlyAddedElement,_=void 0!==b&&b,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=lh(t.tagName);return Th.test(e)?"div":e}(t),x=new Set,C={},T=t.attributes.length,M=0;T>M;M++){var E=t.attributes[M];Dh(S,E.name)||(C[E.name]=Lh(s,S,lh(E.name),E.value,t,f))}if("link"===S&&a&&!k){var I=t.sheet;if(!I){var R=function(t){return t.href}(t);R&&!(I=Bh(s,R))&&R.includes(".css")&&(I=Bh(s,window.location.origin+"/"+R.replace(window.location.href,"")))}var P=null;I&&(zu(I)?xu>0&&(Ru.push(t),Pu+=1):P=Yu(I)),P&&(delete C.rel,delete C.href,C._cssText=P)}if("style"===S&&t.sheet&&!(t.innerText||gu.textContent(t)||"").trim().length){var A=Bu((()=>Yu(t.sheet)));A&&(C._cssText=A)}if("input"===S||"textarea"===S||"select"===S){var F=t.value,O=t.checked;"radio"!==C.type&&"checkbox"!==C.type&&"submit"!==C.type&&"button"!==C.type&&F?C.value=oh({element:t,type:vh(t),tagName:S,value:F,maskInputOptions:l,maskInputFn:u}):O&&(C.checked=O)}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((dh in n?n[dh]: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){yh||(yh=s.createElement("canvas"),bh=yh.getContext("2d"));var B=t,H=B.currentSrc||B.getAttribute("src")||"<unknown-src>",z=B.crossOrigin,U=(e,i)=>j?hh({element:t,name:e,value:i,maskAllElementAttributes:d,maskAttributeFn:v}):i,W=()=>{qh(B,"load",W);try{yh.width=B.naturalWidth,yh.height=B.naturalHeight,bh.drawImage(B,0,0);var t=yh.toDataURL(f.type,f.quality);C.rr_dataURL=U("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="+H+"! Error: "+t)}"anonymous"===B.crossOrigin&&(z?C.crossOrigin=U("crossOrigin",z):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(_||(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]=hh({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:nu.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:a,maskInputOptions:l,maskInputFn:h,maskAllElementAttributes:v,maskAttributeFn:c,dataURLOptions:p,inlineImages:g,recordCanvas:m,canvasMaskingConfigured:y,keepIframeSrcFn:b,newlyAddedElement:w,rootId:k});case t.TEXT_NODE:return function(t,e){var i,r=e.needsMask,n=e.maskTextFn,s=e.rootId,a=gu.parentNode(t),o=a&&a.tagName,l=gu.textContent(t),u="STYLE"===o||void 0,h="SCRIPT"===o||void 0;if(u&&l){try{if(t.nextSibling||t.previousSibling);else if(zu(a.sheet));else if(null==(i=a.sheet)?void 0:i.cssRules){var d=Yu(a.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=mh(l,Fh(e.doc))}return h&&(l="SCRIPT_PLACEHOLDER"),!u&&!h&&l&&r&&(l=n?n(l,gu.parentElement(t)):l.replace(/[\S]/g,"*")),{type:nu.Text,textContent:l||"",isStyle:u,rootId:s}}(t,{doc:i,needsMask:s,maskTextFn:u,rootId:k});case t.CDATA_SECTION_NODE:return{type:nu.CDATA,textContent:"",rootId:k};case t.COMMENT_NODE:return{type:nu.Comment,textContent:gu.textContent(t)||"",rootId:k};default:return!1}}(t,{doc:i,mirror:r,blockClass:n,blockSelector:s,needsMask:U,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===nu.Comment)return!0;if(t.type===nu.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&&(Hh(t.attributes.name).match(/^msapplication-tile(image|color)$/)||"application-name"===Hh(t.attributes.name)||["icon","apple-touch-icon","shortcut icon"].includes(Hh(t.attributes.rel)))))return!0;if("meta"===t.tagName){if(e.headMetaDescKeywords&&Hh(t.attributes.name).match(/^description|keywords$/))return!0;if(e.headMetaSocial&&(Hh(t.attributes.property).match(/^(og|twitter|fb):/)||Hh(t.attributes.name).match(/^(og|twitter):/)||"pinterest"===Hh(t.attributes.name)))return!0;if(e.headMetaRobots&&["robots","googlebot","bingbot"].includes(Hh(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(Hh(t.attributes.name))||Hh(t.attributes.property).match(/^article:/)||Hh(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(Hh(t.attributes.name)))return!0}}return!1}(Z,b)||!V&&Z.type===nu.Text&&!Z.isStyle&&!Z.textContent.replace(/^\s+|\s+$/gm,"").length?Mh:Eh();var Q=Object.assign(Z,{id:G});if(r.add(t,Q),G===Mh)return null;M&&M(t);var J=!u;if(Q.type===nu.Element){J=J&&!Q.needBlock,delete Q.needBlock;var K=gu.shadowRoot(t);K&&Zu(K)&&(Q.isShadowHost=!0)}if((Q.type===nu.Document||Q.type===nu.Element)&&J){b.headWhitespace&&Q.type===nu.Element&&"head"===Q.tagName&&(V=!1);var Y={doc:i,mirror:r,blockClass:n,blockSelector:s,needsMask:U,maskTextClass:a,maskTextSelector:o,skipChild:u,inlineStylesheet:d,maskInputOptions:c,maskTextFn:f,maskInputFn:p,maskAllElementAttributes:m,maskAttributeFn:y,slimDOMOptions:b,dataURLOptions:w,inlineImages:S,recordCanvas:C,canvasMaskingConfigured:T,preserveWhiteSpace:V,onSerialize:M,onIframeLoad:E,iframeLoadTimeout:R,onIframeListenerRegistered:P,onStylesheetLoad:A,stylesheetLoadTimeout:O,keepIframeSrcFn:D,depth:B+1,maxDepth:z};if(Q.type===nu.Element&&"textarea"===Q.tagName&&void 0!==Q.attributes.value);else for(var X of Array.from(gu.childNodes(t))){var tt=Vh(X,Y);tt&&Q.childNodes.push(tt)}var et=null;if(Vu(t)&&(et=gu.shadowRoot(t)))for(var it of Array.from(gu.childNodes(et))){var rt=Vh(it,Y);rt&&(Zu(et)&&(rt.isShadow=!0),Q.childNodes.push(rt))}}var nt=gu.parentNode(t);if(nt&&Gu(nt)&&Zu(nt)&&(Q.isShadow=!0),Q.type===nu.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 a=()=>e();if("complete"!==r){var o=!1,l=null,u=()=>{o||(o=!0,null!==l&&(clearTimeout(l),l=null),qh(t,"load",h),t.addEventListener("load",a),e())},h=()=>u();return l=setTimeout(u,i),t.addEventListener("load",h),()=>{null!==l&&(clearTimeout(l),l=null),o?qh(t,"load",a):(o=!0,qh(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",a),()=>{clearTimeout(c),qh(t,"load",a)}}return t.addEventListener("load",a),()=>{qh(t,"load",a)}}(t,(()=>{var e=t.contentDocument;if(e&&E){var i=Vh(e,{doc:e,mirror:r,blockClass:n,blockSelector:s,needsMask:U,maskTextClass:a,maskTextSelector:o,skipChild:!1,inlineStylesheet:d,maskInputOptions:c,maskTextFn:f,maskInputFn:p,maskAllElementAttributes:m,maskAttributeFn:y,slimDOMOptions:b,dataURLOptions:w,inlineImages:S,recordCanvas:C,canvasMaskingConfigured:T,preserveWhiteSpace:V,onSerialize:M,onIframeLoad:E,iframeLoadTimeout:R,onIframeListenerRegistered:P,onStylesheetLoad:A,stylesheetLoadTimeout:O,keepIframeSrcFn:D,depth:B+1,maxDepth:z});i&&E(t,i)}}),R);null==P||P(t,st)}return Q.type===nu.Element&&"link"===Q.tagName&&"stylesheet"===Q.attributes.rel&&function(e,l,u){if(!jh.has(e)){var h;try{h=e.sheet}catch(t){return}if(!h){var v=new AbortController,g=!1,_=()=>{if(!g){g=!0;try{(()=>{if(A){var e=Vh(t,{doc:i,mirror:r,blockClass:n,blockSelector:s,needsMask:U,maskTextClass:a,maskTextSelector:o,skipChild:!1,inlineStylesheet:d,maskInputOptions:c,maskTextFn:f,maskInputFn:p,maskAllElementAttributes:m,maskAttributeFn:y,slimDOMOptions:b,dataURLOptions:w,inlineImages:S,recordCanvas:C,canvasMaskingConfigured:T,preserveWhiteSpace:V,onSerialize:M,onIframeLoad:E,iframeLoadTimeout:R,onStylesheetLoad:A,stylesheetLoadTimeout:O,keepIframeSrcFn:D,depth:B,maxDepth:z});e&&A(t,e)}})()}finally{jh.delete(e),v.abort()}}},k=setTimeout(_,u);v.signal.addEventListener("abort",(()=>clearTimeout(k)),{once:!0}),e.addEventListener("load",_,{signal:v.signal,once:!0}),jh.set(e,v)}}}(t,0,O),Q}function Gh(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 Zh{constructor(){Kl(this,"parentElement",null),Kl(this,"parentNode",null),Kl(this,"ownerDocument"),Kl(this,"firstChild",null),Kl(this,"lastChild",null),Kl(this,"previousSibling",null),Kl(this,"nextSibling",null),Kl(this,"ELEMENT_NODE",1),Kl(this,"TEXT_NODE",3),Kl(this,"nodeType"),Kl(this,"nodeName"),Kl(this,"RRNodeType")}get childNodes(){for(var t=[],e=this.firstChild;e;)t.push(e),e=e.nextSibling;return t}contains(t){if(!(t instanceof Zh))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 Qh(t,e,i){void 0===i&&(i=document);var r={capture:!0,passive:!0};return i.addEventListener(t,e,r),()=>Jh(i,t,e,r)}function Jh(t,e,i,r){Kh((()=>{var n=t.removeEventListener;"function"==typeof n&&(void 0!==r?n.call(t,e,i,r):n.call(t,e,i))}))}function Kh(t){try{t()}catch(t){if(!(t instanceof DOMException&&"SecurityError"===t.name))throw t}}var Yh="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.",Xh={map:{},getId(){return console.error(Yh),-1},getNode(){return console.error(Yh),null},removeNodeFromMap(){console.error(Yh)},has(){return console.error(Yh),!1},reset(){console.error(Yh)}};function td(t,e,i){void 0===i&&(i={});var r=null,n=0;return function(){for(var s=arguments.length,a=new Array(s),o=0;s>o;o++)a[o]=arguments[o];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,a)):r||!1===i.trailing||(r=setTimeout((()=>{n=!1===i.leading?0:Date.now(),r=null,t.apply(h,a)}),u))}}function ed(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)}}}),()=>ed(t,e,s||{},!0)}"undefined"!=typeof window&&window.Proxy&&window.Reflect&&(Xh=new Proxy(Xh,{get(t,e,i){return"map"===e&&console.error(Yh),Reflect.get(t,e,i)}}));var id=Date.now;function rd(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=gu.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=gu.parentElement(s.body))?void 0:r.scrollTop)||(null==(n=null==s?void 0:s.body)?void 0:n.scrollTop)||0}}function nd(){return window.innerHeight||document.documentElement&&document.documentElement.clientHeight||document.body&&document.body.clientHeight}function sd(){return window.innerWidth||document.documentElement&&document.documentElement.clientWidth||document.body&&document.body.clientWidth}function ad(t){return t?t.nodeType===t.ELEMENT_NODE?t:gu.parentElement(t):null}function od(t,e,i,r){if(!t)return!1;var n=ad(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($h(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 ld(t,e,i){return!("TITLE"!==t.tagName||!i.headTitleMutations)||e.getId(t)===Mh}function ud(t,e){if(Gu(t))return!1;var i=e.getId(t);if(!e.has(i))return!0;var r=gu.parentNode(t);return(!r||r.nodeType!==t.DOCUMENT_NODE)&&(!r||ud(r,e))}function hd(t){return Boolean(t.changedTouches)}function dd(t,e){return Boolean("IFRAME"===t.nodeName&&e.getMeta(t))}function vd(t,e){return Boolean("LINK"===t.nodeName&&t.nodeType===t.ELEMENT_NODE&&t.getAttribute&&"stylesheet"===t.getAttribute("rel")&&e.getMeta(t))}function cd(t){return!!t&&(t instanceof Zh&&"shadowRoot"in t?Boolean(t.shadowRoot):Boolean(gu.shadowRoot(t)))}/[1-9][0-9]{12}/.test(Date.now().toString())||(id=()=>(new Date).getTime());class fd{constructor(){Kl(this,"id",1),Kl(this,"styleIDMap",new WeakMap),Kl(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 pd(t){var e,i=null;return"getRootNode"in t&&(null==(e=gu.getRootNode(t))?void 0:e.nodeType)===Node.DOCUMENT_FRAGMENT_NODE&&gu.host(gu.getRootNode(t))&&(i=gu.host(gu.getRootNode(t))),i}function gd(t){var e=t.ownerDocument;return!!e&&(gu.contains(e,t)||function(t){var e=t.ownerDocument;if(!e)return!1;var i=function(t){for(var e,i=t;e=pd(i);)i=e;return i}(t);return gu.contains(e,i)}(t))}function md(t){return"__ln"in t}class yd{constructor(){Kl(this,"length",0),Kl(this,"head",null),Kl(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&&md(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&&md(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 bd,_d=(t,e)=>t+"@"+e;class wd{constructor(){Kl(this,"frozen",!1),Kl(this,"locked",!1),Kl(this,"texts",[]),Kl(this,"attributes",[]),Kl(this,"attributeMap",new WeakMap),Kl(this,"generatedAttributes",new WeakMap),Kl(this,"removes",[]),Kl(this,"mapRemoves",[]),Kl(this,"movedMap",{}),Kl(this,"addedSet",new Set),Kl(this,"movedSet",new Set),Kl(this,"droppedSet",new Set),Kl(this,"removesSubTreeCache",new Set),Kl(this,"mutationCb"),Kl(this,"blockClass"),Kl(this,"blockSelector"),Kl(this,"maskTextClass"),Kl(this,"maskTextSelector"),Kl(this,"inlineStylesheet"),Kl(this,"maskInputOptions"),Kl(this,"maskTextFn"),Kl(this,"maskInputFn"),Kl(this,"maskAllElementAttributes"),Kl(this,"maskAttributeFn"),Kl(this,"keepIframeSrcFn"),Kl(this,"recordCanvas"),Kl(this,"canvasMaskingConfigured"),Kl(this,"inlineImages"),Kl(this,"slimDOMOptions"),Kl(this,"dataURLOptions"),Kl(this,"doc"),Kl(this,"mirror"),Kl(this,"iframeManager"),Kl(this,"stylesheetManager"),Kl(this,"shadowDomManager"),Kl(this,"canvasManager"),Kl(this,"processedNodeManager"),Kl(this,"unattachedDoc"),Kl(this,"canvasManagerReleased",!1),Kl(this,"processMutations",(t=>{t.forEach(this.processMutation),this.emit()})),Kl(this,"emit",(()=>{if(!this.frozen&&!this.locked){var t,e,i=yu(),r=ku();try{this.processBufferedMutations()}finally{t=yu()-i,e=r,xu>0||Su(t,null!=e?e:bu)||t>Fu.slowestBatchMs&&(Fu.slowestBatchMs=t)}}})),Kl(this,"processBufferedMutations",(()=>{for(var t=[],e=new Set,i=new yd,r=t=>{for(var e=t,i=Mh;i===Mh;)i=(e=e&&e.nextSibling)&&this.mirror.getId(e);return i},n=n=>{var s=gu.parentNode(n);if(s&&gd(n)&&"TEXTAREA"!==s.tagName){var a=Gu(s)?this.mirror.getId(pd(n)):this.mirror.getId(s),o=r(n);if(-1===a||-1===o)return i.addNode(n);var l=Vh(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=>{dd(t,this.mirror)&&this.iframeManager.addIframe(t),vd(t,this.mirror)&&this.stylesheetManager.trackLinkElement(t),cd(t)&&!od(t,this.blockClass,this.blockSelector,!0)&&this.shadowDomManager.addShadowRoot(gu.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:a,nextId:o,node:l}),e.add(l.id))}};this.mapRemoves.length;)this.mirror.removeNodeFromMap(this.mapRemoves.shift());for(var s of this.movedSet)Sd(this.removesSubTreeCache,s)&&!this.movedSet.has(gu.parentNode(s))||n(s);for(var a of this.addedSet)xd(this.droppedSet,a)||Sd(this.removesSubTreeCache,a)?xd(this.movedSet,a)?n(a):this.droppedSet.add(a):n(a);for(var o=null;i.length;){var l=null;if(o){var u=this.mirror.getId(gu.parentNode(o.value)),h=r(o.value);-1!==u&&-1!==h&&(l=o)}if(!l)for(var d=i.tail;d;){var v=d;if(d=d.previous,v){var c=this.mirror.getId(gu.parentNode(v.value));if(-1===r(v.value))continue;if(-1!==c){l=v;break}var f=gu.parentNode(v.value);if(f&&f.nodeType===Node.DOCUMENT_FRAGMENT_NODE){var p=gu.host(f);if(-1!==this.mirror.getId(p)){l=v;break}}}}if(!l){for(;i.head;)i.removeNode(i.head.value);break}o=l.previous,i.removeNode(l.value),n(l.value)}var g={texts:this.texts.map((t=>{var e=t.node,i=gu.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 a=s[0],o=s[1];"string"!=typeof o&&null!==o||(i[a]=hh({element:t.node,name:a,value:o,maskAllElementAttributes:this.maskAllElementAttributes,maskAttributeFn:this.maskAttributeFn,isGenerated:null==(e=this.generatedAttributes.get(t.node))?void 0:e.has(a)}))}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))})),Kl(this,"bufferBelongsToIframe",(t=>this.doc===t.contentDocument)),Kl(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(gu.childNodes(t),(t=>gu.textContent(t)||"")).join("");e.attributes.value=oh({element:t,maskInputOptions:this.maskInputOptions,tagName:t.tagName,type:vh(t),value:i,maskInputFn:this.maskInputFn})})),Kl(this,"processMutation",(t=>{var e;if(!ld(t.target,this.mirror,this.slimDOMOptions))switch(t.type){case"characterData":var i=gu.textContent(t.target);od(t.target,this.blockClass,this.blockSelector,!1)||i===t.oldValue||this.texts.push({value:Nh(t.target,this.maskTextClass,this.maskTextSelector,!0)&&i?this.maskTextFn?this.maskTextFn(i,ad(t.target)):i.replace(/[\S]/g,"*"):i,node:t.target});break;case"attributes":var r,n=t.target,s=t.attributeName,a=null!==(r=t.attributeNamespace)&&void 0!==r?r:null,o=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,a),l=a?n.getAttributeNS(a,s):t.target.getAttribute(s);if("value"===o){var u=n,h=vh(u);l=oh({element:u,maskInputOptions:this.maskInputOptions,tagName:n.tagName,type:h,value:l,maskInputFn:this.maskInputFn})}if(od(t.target,this.blockClass,this.blockSelector,!1)||l===t.oldValue)return;var d=this.attributeMap.get(t.target),v="IFRAME"===n.tagName&&"src"===o;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"===o&&"INPUT"===n.tagName&&"password"===(t.oldValue||"").toLowerCase()&&n.setAttribute("data-rr-is-password","true"),!Dh(n.tagName,o)){var c=Lh(this.doc,lh(n.tagName),lh(o),l,n,this.dataURLOptions);if(v&&!this.keepIframeSrcFn(l)&&(o="rr_src"),d.attributes[o]=c,null==(e=this.generatedAttributes.get(t.target))||e.delete(o),"style"===o){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 b of Array.from(f.style))""===p.getPropertyValue(b)&&(d.styleDiff[b]=!1)}else if("open"===o&&"DIALOG"===n.tagName){d.attributes.rr_open_mode=n.matches("dialog:modal")?"modal":"non-modal";var _=this.generatedAttributes.get(t.target);_||this.generatedAttributes.set(t.target,_=new Set),_.add("rr_open_mode")}}break;case"childList":if(od(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=Gu(t.target)?this.mirror.getId(gu.host(t.target)):this.mirror.getId(t.target);od(t.target,this.blockClass,this.blockSelector,!1)||ld(e,this.mirror,this.slimDOMOptions)||!function(t,e){return-1!==e.getId(t)}(e,this.mirror)||(this.addedSet.has(e)?(kd(this.addedSet,e),this.droppedSet.add(e)):this.addedSet.has(t.target)&&-1===i||ud(t.target,this.mirror)||(this.movedSet.has(e)&&this.movedMap[_d(i,r)]?kd(this.movedSet,e):(this.removes.push({parentId:r,id:i,isShadow:!(!Gu(t.target)||!Zu(t.target))||void 0}),function(t,e){for(var i=[t];i.length;){var r=i.pop();e.has(r)||(e.add(r),gu.childNodes(r).forEach((t=>i.push(t))))}}(e,this.removesSubTreeCache))),this.mapRemoves.push(e))}))}})),Kl(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(ld(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[_d(this.mirror.getId(t),i)]=!0)}else this.addedSet.add(t),this.droppedSet.delete(t);od(t,this.blockClass,this.blockSelector,!1)||(gu.childNodes(t).forEach((t=>this.genAdds(t))),cd(t)&&gu.childNodes(gu.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 kd(t,e){for(var i=[e];i.length;){var r=i.pop();t.delete(r),gu.childNodes(r).forEach((t=>i.push(t)))}}function Sd(t,e,i){return 0!==t.size&&function(t,e,i){var r=gu.parentNode(e);return!!r&&t.has(r)}(t,e)}function xd(t,e){if(0===t.size)return!1;for(var i=gu.parentNode(e);i;){if(t.has(i))return!0;i=gu.parentNode(i)}return!1}var Cd=function(t,e){return void 0===e&&(e="rrweb"),bd?function(){try{return t(...arguments)}catch(t){if(bd&&!0===bd(t,e))return;throw t}}:t},Td=[];function Md(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 Ed(t,e){var i,r=new wd;r.init(t);try{i=new(fu())(Cd(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),Td.push(r),{observer:i,buffer:r}}catch(t){try{null==i||i.disconnect(),r.destroy(),r.reset()}catch(t){}throw t}}function Id(t){var e=t.scrollCb,i=t.doc,r=t.mirror,n=t.blockClass,s=t.blockSelector,a=t.sampling,o=new Map,l=t=>{var a=Md(t);if(a&&!od(a,n,s,!0)){var l,u,h=r.getId(a);if(a===i&&i.defaultView){var d=rd(i.defaultView);l=d.left,u=d.top}else l=a.scrollLeft,u=a.scrollTop;var v=l+","+u;o.get(h)!==v&&(o.set(h,v),e({id:h,x:l,y:u}))}},u=[Qh("scroll",Cd(td(Cd((t=>l(t))),a.scroll||100)),i)];return"onscrollend"in i&&u.push(Qh("scrollend",Cd(l),i)),()=>u.forEach((t=>t()))}function Rd(t,e){for(var i=Td.length-1;i>=0;i--){var r=Td[i];if(r){var n=r.bufferBelongsToIframe(t);!n&&e&&e.has(r.bufferDoc())&&(n=!0),n&&(r.reset(),Td.splice(i,1))}}}var Pd=["INPUT","TEXTAREA","SELECT"],Ad=new WeakMap;function Fd(t){return function t(e,i){if(Nd("CSSGroupingRule")&&e.parentRule instanceof CSSGroupingRule||Nd("CSSMediaRule")&&e.parentRule instanceof CSSMediaRule||Nd("CSSSupportsRule")&&e.parentRule instanceof CSSSupportsRule||Nd("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 Od(t,e,i){var r,n;return t?(t.ownerNode?r=e.getId(t.ownerNode):n=i.getId(t),{styleId:n,id:r}):{}}var Ld=5e3;function Dd(t,e){var i,r,n,s,a=t.stylesheetManager;s=t.mirror.getId("#document"===e.nodeName?e:gu.host(e));var o="#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==o?void 0:o.prototype)?Object.getOwnPropertyDescriptor(null==o?void 0:o.prototype,"adoptedStyleSheets"):void 0;return null!==s&&-1!==s&&o&&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{a.adoptStyleSheets(t,s)}catch(t){}return i}}),Cd((()=>{Object.defineProperty(e,"adoptedStyleSheets",{configurable:l.configurable,enumerable:l.enumerable,get:l.get,set:l.set})}))):()=>{}}function $d(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,a=t.viewportResizeCb,o=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),a(...arguments)},t.inputCb=function(){e.input&&e.input(...arguments),o(...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,a,o,l,u,h,d,v,c=[],f=Cd((()=>{if(r){r.destroy(),r.reset();var e=Td.indexOf(r);-1!==e&&Td.splice(e,1)}t.shadowDomManager.resetForDoc(t.doc),null==i||i.disconnect(),c.forEach((t=>t()))}));try{if(t.recordDOM){var g=Ed(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,a="number"==typeof i.mousemove?i.mousemove:50,o="number"==typeof i.mousemoveCallback?i.mousemoveCallback:500,l=[],u=td(Cd((t=>{var i=Date.now()-s;e(l.map((t=>(t.timeOffset-=i,t))),t),l=[],s=null})),o),h=Cd(td(Cd((t=>{var e=Md(t),i=hd(t)?t.changedTouches[0]:t,r=i.clientX,a=i.clientY;s||(s=id()),l.push({x:r,y:a,id:n.getId(e),timeOffset:id()-s}),u("undefined"!=typeof DragEvent&&t instanceof DragEvent?Xl.Drag:t instanceof MouseEvent?Xl.MouseMove:Xl.TouchMove)})),a,{trailing:!1})),d=[Qh("mousemove",h,r),Qh("touchmove",h,r),Qh("drag",h,r)];return Cd((()=>{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,a=t.sampling;if(!1===a.mouseInteraction)return()=>{};var o=!0===a.mouseInteraction||void 0===a.mouseInteraction?{}:a.mouseInteraction,l=[],u=null;return Object.keys(tu).filter((t=>Number.isNaN(Number(t))&&!t.endsWith("_Departed")&&!1!==o[t])).forEach((t=>{var a=lh(t),o=(t=>i=>{var a=Md(i);if(!od(a,n,s,!0)){var o=null,l=t;if("pointerType"in i){switch(i.pointerType){case"mouse":o=eu.Mouse;break;case"touch":o=eu.Touch;break;case"pen":o=eu.Pen}o===eu.Touch&&(tu[t]===tu.MouseDown?l="TouchStart":tu[t]===tu.MouseUp&&(l="TouchEnd"))}else hd(i)&&(o=eu.Touch);null!==o?(u=o,(l.startsWith("Touch")&&o===eu.Touch||l.startsWith("Mouse")&&o===eu.Mouse)&&(o=null)):tu[t]===tu.Click&&(o=u,u=null);var h=hd(i)?i.changedTouches[0]:i;if(h){var d=r.getId(a),v=h.clientX,c=h.clientY;Cd(e)(p({type:tu[l],id:d,x:v,y:c},null!==o&&{pointerType:o}))}}})(t);if(window.PointerEvent)switch(tu[t]){case tu.MouseDown:case tu.MouseUp:a=a.replace("mouse","pointer");break;case tu.TouchStart:case tu.TouchEnd:return}l.push(Qh(a,o,i))})),Cd((()=>{l.forEach((t=>t()))}))}(t)),c.push(Id(t)),c.push(function(t,e){var i=t.viewportResizeCb,r=e.win,n=-1,s=-1;return Qh("resize",Cd(td(Cd((()=>{var t=nd(),e=sd();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,a=t.ignoreClass,o=t.ignoreSelector,l=t.maskInputOptions,u=t.maskInputFn,h=t.userTriggeredOnInput;function d(t){var e=Md(t),r=t.isTrusted,d=i.defaultView;if(!e||!d||e instanceof d.HTMLElement){var c=e&&e.tagName;if(e&&"OPTION"===c&&(e=gu.parentElement(e)),e&&c&&Pd.indexOf(c)>=0&&!od(e,n,s,!0)&&!(e.classList.contains(a)||o&&e.matches(o))){var f=e.value,p=!1,g=vh(e)||"";"radio"===g||"checkbox"===g?p=e.checked:(l[c.toLowerCase()]||l[g])&&(f=oh({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=Ad.get(t);if(!n||n.text!==i.text||n.isChecked!==i.isChecked){Ad.set(t,i);var s=r.getId(t);Cd(e)(p({},i,{id:s}))}}var c=("last"===t.sampling.input?["change"]:["input","change"]).map((t=>Qh(t,Cd(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=>ed(t[0],t[1],{set(){Cd(d)({target:this,isTrusted:!1})}},!1,f)))),Cd((()=>{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,a=t.doc,o=Cd((t=>td(Cd((s=>{var a=Md(s);if(a&&!od(a,i,r,!0)){var o=a.currentTime,l=a.volume,u=a.muted,h=a.playbackRate,d=a.loop;e({type:t,id:n.getId(a),currentTime:o,volume:l,muted:u,playbackRate:h,loop:d})}})),s.media||500))),l=[Qh("play",o(ru.Play),a),Qh("pause",o(ru.Pause),a),Qh("seeked",o(ru.Seeked),a),Qh("volumechange",o(ru.VolumeChange),a),Qh("ratechange",o(ru.RateChange),a)];return Cd((()=>{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(a,o,l){if(!r)return()=>{};var u=e.get(a);u||e.set(a,u=[]);var h={emit:o,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(a))};try{d=t.setTimeout(f,Ld),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(a)))}},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,a=e.mutationQueue;if(!s.CSSStyleSheet||!s.CSSStyleSheet.prototype)return()=>{};var o=s.CSSStyleSheet.prototype.insertRule;s.CSSStyleSheet.prototype.insertRule=new Proxy(o,{apply:Cd(((t,e,s)=>{var o=s[0],l=t.apply(e,s);n.onCssomSheetMutation(e);var u=Od(e,r,n.styleMirror),h=u.id,d=u.styleId;return(h&&-1!==h||d&&-1!==d)&&a.queueMutation(e,(()=>i({id:h,styleId:d,adds:[{rule:o,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:Cd(((t,e,s)=>{var o=s[0],l=t.apply(e,s);n.onCssomSheetMutation(e);var u=Od(e,r,n.styleMirror),h=u.id,d=u.styleId;return(h&&-1!==h||d&&-1!==d)&&a.queueMutation(e,(()=>i({id:h,styleId:d,removes:[{index:o}]}))),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:Cd(((t,e,s)=>{var o=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=Od(e,r,n.styleMirror),d=h.id,v=h.styleId;if(!(d&&-1!==d||v&&-1!==v))return l;var c=a.queuePendingMutation(e,(()=>i({id:d,styleId:v,replace:o})),(()=>{var t=Yu(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:Cd(((t,e,s)=>{var o=s[0],l=t.apply(e,s);n.onCssomSheetMutation(e);var u=Od(e,r,n.styleMirror),h=u.id,d=u.styleId;return(h&&-1!==h||d&&-1!==d)&&a.queueMutation(e,(()=>i({id:h,styleId:d,replaceSync:o}))),l}),"host")}));var d={};qd("CSSGroupingRule")?d.CSSGroupingRule=s.CSSGroupingRule:(qd("CSSMediaRule")&&(d.CSSMediaRule=s.CSSMediaRule),qd("CSSConditionRule")&&(d.CSSConditionRule=s.CSSConditionRule),qd("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:Cd(((t,e,s)=>{var o=s[0],l=t.apply(e,s);n.onCssomSheetMutation(e.parentStyleSheet);var u=Od(e.parentStyleSheet,r,n.styleMirror),h=u.id,d=u.styleId;if(e.parentStyleSheet&&(h&&-1!==h||d&&-1!==d)){var v=[...Fd(e),l];a.queueMutation(e.parentStyleSheet,(()=>i({id:h,styleId:d,adds:[{rule:o,index:v}]})))}return l}),"host")}),s.prototype.deleteRule=new Proxy(v[e].deleteRule,{apply:Cd(((t,e,s)=>{var o=s[0],l=t.apply(e,s);n.onCssomSheetMutation(e.parentStyleSheet);var u=Od(e.parentStyleSheet,r,n.styleMirror),h=u.id,d=u.styleId;if(e.parentStyleSheet&&(h&&-1!==h||d&&-1!==d)){var v=[...Fd(e),o];a.queueMutation(e.parentStyleSheet,(()=>i({id:h,styleId:d,removes:[{index:v}]})))}return l}),"host")})})),Cd((()=>{s.CSSStyleSheet.prototype.insertRule=o,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(Dd(t,t.doc)),c.push(function(t,e){var i=t.styleDeclarationCb,r=t.mirror,n=t.ignoreCSSAttributes,s=t.stylesheetManager,a=e.win,o=e.mutationQueue,l=a.CSSStyleDeclaration.prototype.setProperty;a.CSSStyleDeclaration.prototype.setProperty=new Proxy(l,{apply:Cd(((t,e,a)=>{var l,u=a[0],h=a[1],d=a[2],v=t.apply(e,a);if(n.has(u))return v;var c=null==(l=e.parentRule)?void 0:l.parentStyleSheet;s.onCssomSheetMutation(c);var f=Od(c,r,s.styleMirror),p=f.id,g=f.styleId;if(p&&-1!==p||g&&-1!==g){var m=Fd(e.parentRule);o.queueMutation(c,(()=>i({id:p,styleId:g,set:{property:u,value:h,priority:d},index:m})))}return v}),"host")});var u=a.CSSStyleDeclaration.prototype.removeProperty;return a.CSSStyleDeclaration.prototype.removeProperty=new Proxy(u,{apply:Cd(((t,e,a)=>{var l,u=a[0],h=t.apply(e,a);if(n.has(u))return h;var d=null==(l=e.parentRule)?void 0:l.parentStyleSheet;s.onCssomSheetMutation(d);var v=Od(d,r,s.styleMirror),c=v.id,f=v.styleId;if(c&&-1!==c||f&&-1!==f){var p=Fd(e.parentRule);o.queueMutation(d,(()=>i({id:c,styleId:f,remove:{property:u},index:p})))}return h}),"host")}),Cd((()=>{a.CSSStyleDeclaration.prototype.setProperty=l,a.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,a=r.FontFace;r.FontFace=function(t,e,i){var r=new a(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 o=pu(i.fonts,"add",(function(t){return function(i){return setTimeout(Cd((()=>{var t=s.get(i);t&&(e(t),s.delete(i))})),0),t.apply(this,[i])}}));return n.push((()=>{r.FontFace=a})),n.push(o),Cd((()=>{n.forEach((t=>t()))}))}(t))}for(var y of(c.push((a=(s=t).doc,o=s.mirror,l=s.blockClass,u=s.blockSelector,h=s.selectionCb,d=!0,(v=Cd((()=>{var t=a.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;od(s,l,u,!0)||od(c,l,u,!0)||e.push({start:o.getId(s),startOffset:v,end:o.getId(c),endOffset:f})}h({ranges:e})}})))(),Qh("selectionchange",v))),c.push(function(t){var e=t.customElementCb,i=t.doc.defaultView;return i&&i.customElements?pu(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 Nd(t){return void 0!==window[t]}function qd(t){return Boolean(void 0!==window[t]&&window[t].prototype&&"insertRule"in window[t].prototype&&"deleteRule"in window[t].prototype)}class jd{constructor(t){Kl(this,"iframeRemoteIdToLocalIdMap",new WeakMap),Kl(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),a=n.get(e);return void 0===a&&(a=this.generateIdFn(),n.set(e,a),s.set(a,e)),a}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 Bd{constructor(t){Kl(this,"iframes",new WeakMap),Kl(this,"crossOriginIframeMap",new WeakMap),Kl(this,"crossOriginIframeMirror",new jd(Eh)),Kl(this,"crossOriginIframeStyleMirror"),Kl(this,"crossOriginIframeRootIdMap",new WeakMap),Kl(this,"mirror"),Kl(this,"mutationCb"),Kl(this,"wrappedEmit"),Kl(this,"loadListener"),Kl(this,"pageHideListener"),Kl(this,"stylesheetManager"),Kl(this,"recordCrossOriginIframes"),Kl(this,"messageHandler"),Kl(this,"nestedIframeListeners",new Map),Kl(this,"attachedWindows",new WeakMap),Kl(this,"attachedDocuments",new WeakMap),Kl(this,"attachedIframes",new Map),Kl(this,"loadListenerDisposers",new WeakMap),Kl(this,"iframeElementsById",new Map),Kl(this,"pageHideHandlers",new WeakMap),this.mutationCb=t.mutationCb,this.wrappedEmit=t.wrappedEmit,this.stylesheetManager=t.stylesheetManager,this.recordCrossOriginIframes=t.recordCrossOriginIframes,this.crossOriginIframeStyleMirror=new jd(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=>Kh(t))),this.loadListenerDisposers.delete(t))}removePageHideListener(t){var e=this.pageHideHandlers.get(t);e&&(e.forEach((t=>{Jh(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 a=this.handleMessage.bind(this);Kh((()=>{s.addEventListener("message",a),this.nestedIframeListeners.set(s,a);var e=this.attachedWindows.get(t);e||this.attachedWindows.set(t,e=new Set),e.add(s)}))}Kh((()=>{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 Yl.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:Yl.IncrementalSnapshot,data:{source:Xl.Mutation,adds:[{parentId:this.mirror.getId(t),nextId:null,node:e.data.node}],removes:[],texts:[],attributes:[],isAttachIframe:!0}};case Yl.Meta:case Yl.Load:case Yl.DomContentLoaded:return!1;case Yl.Plugin:return e;case Yl.Custom:return this.replaceIds(e.data.payload,t,["id","parentId","previousId","nextId"]),e;case Yl.IncrementalSnapshot:switch(e.data.source){case Xl.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 Xl.Drag:case Xl.TouchMove:case Xl.MouseMove:return e.data.positions.forEach((e=>{this.replaceIds(e,t,["id"])})),e;case Xl.ViewportResize:return!1;case Xl.MediaInteraction:case Xl.MouseInteraction:case Xl.Scroll:case Xl.CanvasMutation:case Xl.Input:return this.replaceIds(e.data,t,["id"]),e;case Xl.StyleSheetRule:case Xl.StyleDeclaration:return this.replaceIds(e.data,t,["id"]),this.replaceStyleIds(e.data,t,["styleId"]),e;case Xl.Font:return e;case Xl.Selection:return e.data.ranges.forEach((e=>{this.replaceIds(e,t,["start","end"])})),e;case Xl.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===nu.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&&(Jh(t,"message",e),this.nestedIframeListeners.delete(t)),this.crossOriginIframeMap.delete(t)})),this.attachedWindows.delete(i)),r&&this.nestedIframeListeners.has(r)&&(Jh(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=>{Kh((()=>this.mirror.removeNodeFromMap(t)))})),Kh((()=>Rd(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&&Jh(window,"message",this.messageHandler),this.nestedIframeListeners.forEach(((t,e)=>{Jh(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 Hd{constructor(t){Kl(this,"shadowDoms",new WeakSet),Kl(this,"mutationCb"),Kl(this,"scrollCb"),Kl(this,"bypassOptions"),Kl(this,"mirror"),Kl(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(Zu(t)&&!this.shadowDoms.has(t)){this.shadowDoms.add(t);var n=null!==(i=null==(r=gu.host(t))?void 0:r.ownerDocument)&&void 0!==i?i:e,s=Ed(p({},this.bypassOptions,{doc:n,mutationCb:this.mutationCb,mirror:this.mirror,shadowDomManager:this}),t),a=s.observer,o=s.buffer;this.restoreHandlers.push({doc:n,handler(){a.disconnect(),o.destroy(),o.releaseCanvasManager();var t=Td.indexOf(o);-1!==t&&Td.splice(t,1)}}),this.restoreHandlers.push({doc:n,handler:Id(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(gu.host(t))),this.restoreHandlers.push({doc:n,handler:Dd({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:pu(t.prototype,"attachShadow",(function(t){return function(r){var n=t.call(this,r),s=gu.shadowRoot(this);return s&&gd(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 zd="skip-frame";function Ud(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 Wd="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",Vd="undefined"==typeof Uint8Array?[]:new Uint8Array(256),Gd=0;64>Gd;Gd++)Vd[Wd.charCodeAt(Gd)]=Gd;var Zd=new Map,Qd=(t,e,i)=>{if(t&&(Yd(t,e)||"object"==typeof t)){var r=function(t,e){var i=Zd.get(t);return i||Zd.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 Jd(t,e,i,r){if(t instanceof Array)return t.map((t=>Jd(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+=Wd[i[e]>>2],n+=Wd[(3&i[e])<<4|i[e+1]>>4],n+=Wd[(15&i[e+1])<<2|i[e+2]>>6],n+=Wd[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:[Jd(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:[Jd(t.data,e,i,r),t.width,t.height]}:Yd(t,e)||"object"==typeof t?{rr_type:t.constructor.name,index:Qd(t,e,i)}:t}var Kd=(t,e,i,r)=>t.map((t=>Jd(t,e,i,r))),Yd=(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])))},Xd=["webgl","webgl2"];function tv(t){return"nodeType"in t}function ev(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 pu(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||tv(s)&&od(s,e,i,!0))return r.call(this,n);tv(s)&&!("__context"in s)&&(s.__context="webgpu");var a=function(t){var e=t.GPUTextureUsage;return e?e.COPY_SRC|e.RENDER_ATTACHMENT:null}(t);return r.call(this,null!==a&&n?p({},n,{usage:"number"==typeof n.usage?n.usage|a:a}):n)}}))}(t,e,i);s&&n.push(s)}var a=pu(t.HTMLCanvasElement.prototype,"getContext",(function(t){return function(n){for(var s=function(t){return"experimental-webgl"===t?"webgl":t}(n),a=arguments.length,o=new Array(a>1?a-1:0),l=1;a>l;l++)o[l-1]=arguments[l];if(!od(this,e,i,!0)&&("__context"in this||(this.__context=s),r&&Xd.includes(s)))if(o[0]&&"object"==typeof o[0]){var u=o[0];u.preserveDrawingBuffer||(u.preserveDrawingBuffer=!0)}else o.splice(0,1,{preserveDrawingBuffer:!0});return t.apply(this,[n,...o])}}));n.push(a)}catch(t){console.error("failed to patch HTMLCanvasElement.prototype.getContext")}return()=>{n.forEach((t=>t()))}}function iv(t,e,i,r,n,s,a){var o=[],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=pu(t,l,(function(t){return function(){for(var o=arguments.length,u=new Array(o),h=0;o>h;h++)u[h]=arguments[h];var d=t.apply(this,u);if(Qd(d,s,this),this.canvas&&"tagName"in this.canvas&&!od(this.canvas,r,n,!0)){var v=Kd(u,s,this,a);i(this.canvas,{type:e,property:l,args:v})}return d}}));o.push(u)}catch(s){var h=ed(t,l,{set(t){this.canvas&&"tagName"in this.canvas&&!od(this.canvas,r,n,!0)&&i(this.canvas,{type:e,property:l,args:[t],setter:!0})}});o.push(h)}};for(var h of l)u(h);return o}var rv,nv,sv,av='(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',ov="undefined"!=typeof self&&self.Blob&&new Blob([av],{type:"text/javascript;charset=utf-8"});function lv(t){var e;try{if(!(e=ov&&(self.URL||self.webkitURL).createObjectURL(ov)))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(av),{name:null==t?void 0:t.name})}finally{e&&(self.URL||self.webkitURL).revokeObjectURL(e)}}class uv{constructor(t){Kl(this,"pendingCanvasMutations",new Map),Kl(this,"rafStamps",{latestId:0,invokeId:null}),Kl(this,"mirror"),Kl(this,"mutationCb"),Kl(this,"resetObservers"),Kl(this,"frozen",!1),Kl(this,"locked",!1),Kl(this,"rafIdTimestamp",null),Kl(this,"rafIdFlush",null),Kl(this,"refCount",0),Kl(this,"torndown",!1),Kl(this,"resetFrameDedup",null),Kl(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,a=t.recordCanvas,o=t.dataURLOptions,l=t.resolutionScale,u=t.canvasMasking;this.mutationCb=t.mutationCb,this.mirror=t.mirror,a&&"all"===i&&this.initCanvasMutationObserver(r,n,s,o),a&&"number"==typeof i&&this.initCanvasFPSObserver(i,r,n,s,{dataURLOptions:o,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 a,o="number"==typeof n.resolutionScale&&Number.isFinite(n.resolutionScale)?Math.min(1,Math.max(.1,n.resolutionScale)):1,l=ev(e,i,r,!0),u=new Map;try{a=new lv}catch(t){return}var h=!1;a.onerror=()=>{var t;h=!0,cancelAnimationFrame(d),null==(t=a.terminate)||t.call(a),this.resetFrameDedup=null},this.resetFrameDedup=()=>{a.postMessage({resetFrameDedup:!0})},a.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:iu["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=>{od(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*o)),c=Math.max(1,Math.round(d*o)),f=function(t,e,i,r,n,s){if(t&&"function"==typeof t.regionsFn){var a;try{a=t.regionsFn(e)}catch(t){return zd}if(void 0!==a){if(!Array.isArray(a)||!a.every(Ud))return zd;var o=i/n,l=r/s;return a.filter((t=>t.width>0&&t.height>0)).map((t=>{var e=Math.floor(t.x*o),i=Math.floor(t.y*l);return{x:e,y:i,width:Math.ceil((t.x+t.width)*o)-e,height:Math.ceil((t.y+t.height)*l)-i}}))}}}(n.canvasMasking,t,v,c,h,d);if(f===zd)return void u.set(r,!1);var p=yield createImageBitmap(t,1>o?{resizeWidth:v,resizeHeight:c,resizeQuality:"medium"}:{resizeWidth:v,resizeHeight:c});a.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=a.terminate)||t.call(a),this.resetFrameDedup=null}}}initCanvasMutationObserver(t,e,i,r){this.startRAFTimestamping(),this.startPendingCanvasMutationFlusher();var n=ev(t,e,i,!1),s=function(t,e,i,r,n){var s=[],a=Object.getOwnPropertyNames(e.CanvasRenderingContext2D.prototype),o=function(a){try{if("function"!=typeof e.CanvasRenderingContext2D.prototype[a])return 1;var o=pu(e.CanvasRenderingContext2D.prototype,a,(function(s){return function(){for(var o=arguments.length,l=new Array(o),u=0;o>u;u++)l[u]=arguments[u];return od(this.canvas,i,r,!0)||setTimeout((()=>{var i=Kd(l,e,this,n);t(this.canvas,{type:iu["2D"],property:a,args:i})}),0),s.apply(this,l)}}));s.push(o)}catch(n){var l=ed(e.CanvasRenderingContext2D.prototype,a,{set(e){od(this.canvas,i,r,!0)||t(this.canvas,{type:iu["2D"],property:a,args:[e],setter:!0})}});s.push(l)}};for(var l of a)o(l);return()=>{s.forEach((t=>t()))}}(this.processMutation.bind(this),t,e,i,r),a=function(t,e,i,r,n){var s=[];return void 0!==e.WebGLRenderingContext&&s.push(...iv(e.WebGLRenderingContext.prototype,iu.WebGL,t,i,r,e,n)),void 0!==e.WebGL2RenderingContext&&s.push(...iv(e.WebGL2RenderingContext.prototype,iu.WebGL2,t,i,r,e,n)),()=>{s.forEach((t=>t()))}}(this.processMutation.bind(this),t,e,i,r);this.resetObservers=()=>{n(),s(),a()}}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,Ql)));this.mutationCb({id:e,type:i[0].type,commands:r}),this.pendingCanvasMutations.delete(t)}}}}class hv{constructor(t){var e;Kl(this,"trackedLinkElements",new WeakSet),Kl(this,"pendingDeferredSheets",new Set),Kl(this,"mutationCb"),Kl(this,"adoptedStyleSheetCb"),Kl(this,"maskAllElementAttributes"),Kl(this,"maskAttributeFn"),Kl(this,"styleMirror",new fd),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=sh(r))}catch(t){}if(!i||!r)return Uu(),null;var n=i,s=!1,a={sheet:r,invalidate(){s=!0}};this.pendingDeferredSheets.add(a);var o=!1;return{advance:i=>{if(o)return!0;var l,u,h=yu(),d=ku(),v=!0;try{if(s)return o=!0,Uu(),!0;if(!n.advance(i))return v=!1,!1;o=!0;var c=n.text();if(!t.isConnected)return!0;var f=null;try{f=t.sheet}catch(t){}return f!==r?(Uu(),!0):c?(this.emitCssTextMutation(t,e,c),!0):(Uu(),!0)}finally{v&&this.pendingDeferredSheets.delete(a),Su(l=yu()-h,null!=(u=d)?u:bu)||(Ou.totalMs+=l,l>Ou.slowestSliceMs&&(Ou.slowestSliceMs=l))}},remainingRules:()=>n.remainingRules(),discard:()=>{this.pendingDeferredSheets.delete(a)}}}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:hh({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 a=yu();try{Bu((()=>{try{var e=t.rules||t.cssRules;e&&ju(e)}catch(t){}n.push({styleId:s,rules:Array.from(t.rules||CSSRule,((e,i)=>({rule:Xu(e,t.href),index:i})))})}))}finally{Hu(yu()-a)}}r.styleIds.push(e)};for(var a of t)s(a);n.length>0&&(r.styles=n),this.adoptedStyleSheetCb(r)}}reset(){this.styleMirror.reset(),this.trackedLinkElements=new WeakSet,this.pendingDeferredSheets.clear(),jh.forEach((t=>t.abort())),jh.clear()}trackStylesheetInLinkElement(t){}}class dv{constructor(){Kl(this,"nodeMap",new WeakMap),Kl(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 vv=!1;try{if(2!==Array.from([1],(t=>2*t))[0]){var cv=document.createElement("iframe");document.body.appendChild(cv),Array.from=(null==(Zl=cv.contentWindow)?void 0:Zl.Array.from)||Array.from,document.body.removeChild(cv)}}catch(t){console.debug("Unable to override Array.from",t)}var fv=new ah,pv=new Set([Xl.Mutation,Xl.MediaInteraction,Xl.StyleSheetRule,Xl.CanvasMutation,Xl.Font,Xl.Log,Xl.StyleDeclaration,Xl.AdoptedStyleSheet]);function gv(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 mv(t){var e;void 0===t&&(t={});var i=t,r=i.emit,n=i.checkoutEveryNms,s=i.checkoutEveryNth,a=i.blockClass,o=void 0===a?"rr-block":a,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,b=i.inlineStylesheet,_=void 0===b||b,w=i.inlineStylesheetBudgetRules,k=i.maskAllInputs,S=i.maskInputOptions,x=i.slimDOMOptions,C=i.maskInputFn,T=i.maskTextFn,M=i.maskAllElementAttributes,E=void 0!==M&&M,I=i.maskAttributeFn,R=i.hooks,P=i.packFn,A=i.sampling,F=void 0===A?{}:A,O=i.dataURLOptions,L=void 0===O?{}:O,D=i.canvasResolutionScale,N=i.canvasMasking,q=i.mousemoveWait,j=i.recordDOM,B=void 0===j||j,H=i.recordCanvas,z=void 0!==H&&H,U=i.recordCrossOriginIframes,W=void 0!==U&&U,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;bd=i.errorHandler;var at=p({type:"image/webp",quality:.4,maxBase64ImageLength:1048576},L),ot=!W||window.parent===window,lt=!1;if(!ot)try{window.parent.document&&(lt=!1)}catch(t){lt=!0}if(ot&&!r)throw new Error("emit function is required");if(!ot&&!lt)return()=>{};void 0!==q&&void 0===F.mousemove&&(F.mousemove=q),fv.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=Gh(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};rv=(t,e)=>{var i,a=t;if(a.timestamp=id(),!(null==(i=Td[0])?void 0:i.isFrozen())||a.type===Yl.FullSnapshot||a.type===Yl.IncrementalSnapshot&&pv.has(a.data.source)||Td.forEach((t=>t.unfreeze())),ot)null==r||r(gt(a),e);else if(lt){var o={type:"rrweb",event:gt(a),origin:window.location.origin,isCheckout:e};window.parent.postMessage(o,"*")}if(a.type===Yl.FullSnapshot)ut=a,ft=0;else if(a.type===Yl.IncrementalSnapshot){if(a.data.source===Xl.Mutation&&a.data.isAttachIframe)return;ft++,(s&&ft>=s||n&&a.timestamp-ut.timestamp>n)&&nv(!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=fv.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()}rv({type:Yl.IncrementalSnapshot,data:p({source:Xl.Mutation},t)})},yt=t=>rv({type:Yl.IncrementalSnapshot,data:p({source:Xl.Scroll},t)}),bt=t=>rv({type:Yl.IncrementalSnapshot,data:p({source:Xl.CanvasMutation},t)}),_t=new hv({mutationCb:mt,adoptedStyleSheetCb:t=>rv({type:Yl.IncrementalSnapshot,data:p({source:Xl.AdoptedStyleSheet},t)}),maskAllElementAttributes:E,maskAttributeFn:I}),wt=new Bd({mirror:fv,mutationCb:mt,stylesheetManager:_t,recordCrossOriginIframes:W,wrappedEmit:rv});for(var kt of tt||[])kt.getMirror&&kt.getMirror({nodeMirror:fv,crossOriginIframeMirror:wt.crossOriginIframeMirror,crossOriginIframeStyleMirror:wt.crossOriginIframeStyleMirror});var St=new dv,xt=null==N?void 0:N.configured;sv=new uv({recordCanvas:z,mutationCb:bt,win:window,blockClass:o,blockSelector:u,mirror:fv,sampling:F.canvas,dataURLOptions:at,resolutionScale:D,canvasMasking:N});var Ct=new Hd({mutationCb:mt,scrollCb:yt,bypassOptions:{blockClass:o,blockSelector:u,maskTextClass:g,maskTextSelector:y,inlineStylesheet:_,maskInputOptions:ht,dataURLOptions:at,maskTextFn:T,maskInputFn:C,maskAllElementAttributes:E,maskAttributeFn:I,recordCanvas:z,canvasMaskingConfigured:xt,inlineImages:X,sampling:F,slimDOMOptions:dt,iframeManager:wt,stylesheetManager:_t,canvasManager:sv,keepIframeSrcFn:it,processedNodeManager:St,attributeFilter:st},mirror:fv});nv=function(t){if(void 0===t&&(t=!1),B){Du(w);try{rv({type:Yl.Meta,data:{href:window.location.href,width:sd(),height:nd()}},t),null==e||e.cancel(),e=void 0,_t.reset(),Ct.init(),Td.forEach((t=>t.lock()));var i,r=null;try{r=function(t,e){var i=e||{},r=i.mirror,n=void 0===r?new ah:r,s=i.blockClass,a=void 0===s?"rr-block":s,o=i.blockSelector,l=void 0===o?null:o,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,b=i.canvasMaskingConfigured,_=i.maskAllInputs,w=void 0!==_&&_,k=i.maskTextFn,S=i.maskInputFn,x=i.maskAllElementAttributes,C=void 0!==x&&x,T=i.maskAttributeFn,M=i.slimDOM,E=i.dataURLOptions,I=i.preserveWhiteSpace,R=i.onSerialize,P=i.onIframeLoad,A=i.iframeLoadTimeout,F=i.onIframeListenerRegistered,O=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,H=Gh(void 0!==M&&M);Du(j);try{return Vh(t,{doc:t,mirror:n,blockClass:a,blockSelector:l,maskTextClass:h,maskTextSelector:v,skipChild:!1,inlineStylesheet:f,maskInputOptions:B,maskTextFn:k,maskInputFn:S,maskAllElementAttributes:C,maskAttributeFn:T,slimDOMOptions:H,dataURLOptions:E,inlineImages:g,recordCanvas:y,canvasMaskingConfigured:b,preserveWhiteSpace:I,onSerialize:R,onIframeLoad:P,iframeLoadTimeout:A,onIframeListenerRegistered:F,onStylesheetLoad:O,stylesheetLoadTimeout:L,keepIframeSrcFn:N,newlyAddedElement:!1,maxDepth:q})}finally{$u()}}(document,{mirror:fv,blockClass:o,blockSelector:u,maskTextClass:g,maskTextSelector:y,inlineStylesheet:_,maskAllInputs:ht,inlineStylesheetBudgetRules:w,maskTextFn:T,maskInputFn:C,maskAllElementAttributes:E,maskAttributeFn:I,slimDOM:dt,dataURLOptions:at,recordCanvas:z,canvasMaskingConfigured:xt,inlineImages:X,onSerialize(t){dd(t,fv)&&wt.addIframe(t),vd(t,fv)&&_t.trackLinkElement(t),cd(t)&&Ct.addShadowRoot(gu.shadowRoot(t),document)},onIframeLoad(t,e){wt.attachIframe(t,e),Ct.observeAttachShadow(t)},onIframeListenerRegistered(t,e){wt.registerLoadListenerDisposer(t,e)},onStylesheetLoad(t,e){_t.attachLinkElement(t,e)},keepIframeSrcFn:it})}finally{s=Ru,Ru=[],i=s}if(!r)return console.warn("Failed to snapshot the document");if(rv({type:Yl.FullSnapshot,data:{node:r,initialOffset:rd(window)}},t),Td.forEach((t=>t.unlock())),sv.onFullSnapshot(),i.length){var n=function(t,e,i){var r=!1,n=null,s=0,a=null,o=()=>null!==a||t.length>s,l=()=>{var i=t[s];t[s]=null,s+=1,i&&Kh((()=>{a=e.beginDeferredLinkInlining(i,fv.getId(i))}))},u=()=>{if(a){var t=a,e=!0;Kh((()=>{e=t.advance(200)})),e&&(a=null)}},h=t=>{if(n=null,!r){var e=0;do{try{a||l(),u()}catch(t){null==a||a.discard(),a=null,Wu(1)}e+=1}while(!r&&o()&&(t?!t.didTimeout&&t.timeRemaining()>5:10>e));r||(o()?n=gv(h):i())}};return n=gv(h),{cancel(){r=!0,null==a||a.discard(),a=null,null==n||n.cancel(),n=null},flush(){if(!r){r=!0,null==n||n.cancel(),n=null;for(var e=0,h=0;o()&&50>e;){a||l();var d=a;if(d)if(Math.floor(d.remainingRules()/200)+1>50-e)d.discard(),a=null,h+=1;else{try{u()}catch(t){null==a||a.discard(),a=null,h+=1}e+=1}}if(o()||h>0){for(var v=h+(null!==a?1:0),c=s;t.length>c;c++)null!==t[c]&&(v+=1);Wu(v),null==a||a.discard(),a=null}i()}}}}(i,_t,(()=>{e===n&&(e=void 0)}));e=n}W&&wt.reattachIframes(),document.adoptedStyleSheets&&document.adoptedStyleSheets.length>0&&_t.adoptStyleSheets(document.adoptedStyleSheets,fv.getId(document))}finally{$u()}var s}};try{var Tt=[];for(var Mt of(Tt.push(Qh("pagehide",(()=>{try{null==e||e.flush()}catch(t){}e=void 0}),window)),["visibilitychange","freeze","resume"]))Tt.push(Qh(Mt,wu,document));vt=t=>{var e=pt.get(t);e&&(e.forEach((t=>{Kh(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=fv.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 Et=t=>{var e;return Cd($d)({mutationCb:mt,mousemoveCb:(t,e)=>rv({type:Yl.IncrementalSnapshot,data:{source:e,positions:t}}),mouseInteractionCb:t=>rv({type:Yl.IncrementalSnapshot,data:p({source:Xl.MouseInteraction},t)}),scrollCb:yt,viewportResizeCb:t=>rv({type:Yl.IncrementalSnapshot,data:p({source:Xl.ViewportResize},t)}),inputCb:t=>rv({type:Yl.IncrementalSnapshot,data:p({source:Xl.Input},t)}),mediaInteractionCb:t=>rv({type:Yl.IncrementalSnapshot,data:p({source:Xl.MediaInteraction},t)}),styleSheetRuleCb:t=>rv({type:Yl.IncrementalSnapshot,data:p({source:Xl.StyleSheetRule},t)}),styleDeclarationCb:t=>rv({type:Yl.IncrementalSnapshot,data:p({source:Xl.StyleDeclaration},t)}),canvasMutationCb:bt,fontCb:t=>rv({type:Yl.IncrementalSnapshot,data:p({source:Xl.Font},t)}),selectionCb(t){rv({type:Yl.IncrementalSnapshot,data:p({source:Xl.Selection},t)})},customElementCb(t){rv({type:Yl.IncrementalSnapshot,data:p({source:Xl.CustomElement},t)})},blockClass:o,ignoreClass:d,ignoreSelector:c,maskTextClass:g,maskTextSelector:y,maskInputOptions:ht,inlineStylesheet:_,sampling:F,recordDOM:B,recordCanvas:z,canvasMaskingConfigured:xt,inlineImages:X,userTriggeredOnInput:Q,collectFonts:K,doc:t,maskInputFn:C,maskTextFn:T,maskAllElementAttributes:E,maskAttributeFn:I,keepIframeSrcFn:it,blockSelector:u,slimDOMOptions:dt,dataURLOptions:at,mirror:fv,iframeManager:wt,stylesheetManager:_t,shadowDomManager:Ct,processedNodeManager:St,canvasManager:sv,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=>rv({type:Yl.Plugin,data:{plugin:t.name,payload:e}})}))))||[]},R)};wt.addLoadListener((t=>{try{var e=fv.getId(t),i=Et(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=fv.getId(t);null==vt||vt(e),Rd(t)}));var It=-1,Rt=t=>rv({type:Yl.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,a=s?fv.getId(s):-1;a!==It&&(-1!==It&&Rt({id:It,enter:!1}),It=a,-1!==a&&Rt({id:a,enter:!0}))},At=()=>{nv();var t=Et(document);"function"==typeof t&&Tt.push(t),Tt.push(Qh("fullscreenchange",Pt)),Tt.push(Qh("webkitfullscreenchange",Pt)),Tt.push(Qh("mozfullscreenchange",Pt)),Tt.push(Qh("MSFullscreenChange",Pt)),vv=!0};return["interactive","complete"].includes(document.readyState)?At():(Tt.push(Qh("DOMContentLoaded",(()=>{rv({type:Yl.DomContentLoaded,data:{}}),"DOMContentLoaded"===G&&At()}))),Tt.push(Qh("load",(()=>{rv({type:Yl.Load,data:{}}),"load"===G&&At()}),window))),()=>{try{null==e||e.flush()}catch(t){}e=void 0,Tt.forEach((t=>Kh(t))),St.destroy(),wt.removeLoadListener(),wt.destroy(),pt.clear(),Ct.reset(),fv.reset(),vv=!1,bd=void 0}}catch(t){console.warn(t)}}mv.addCustomEvent=(t,e)=>{if(!vv)throw new Error("please add custom event after start recording");rv({type:Yl.Custom,data:{tag:t,payload:e}})},mv.freezePage=()=>{Td.forEach((t=>t.freeze()))},mv.takeFullSnapshot=t=>{if(!vv)throw new Error("please take full snapshot after start recording");nv(t)},mv.mirror=fv;var yv=Object.defineProperty,bv=(t,e,i)=>((t,e,i)=>e in t?yv(t,e,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[e]=i)(t,"symbol"!=typeof e?e+"":e,i);class _v{constructor(t){bv(this,"fileName"),bv(this,"functionName"),bv(this,"lineNumber"),bv(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 wv=/(^|@)\S+:\d+/,kv=/^\s*at .*(\S+:\d+|\(native\))/m,Sv=/^(eval@)?(\[native code])?$/,xv={parse(t){return t?void 0!==t.stacktrace||void 0!==t["opera#sourceloc"]?this.parseOpera(t):t.stack&&t.stack.match(kv)?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(kv)}),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,a=["eval","<anonymous>"].indexOf(n[0])>-1?void 0:n[0];return new _v({functionName:s,fileName:a,lineNumber:n[1],columnNumber:n[2]})}),this)},parseFFOrSafari(t){return t.stack.split("\n").filter((function(t){return!t.match(Sv)}),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 _v({functionName:t});var e=/((.*".+"[^@]*)?[^@]*)(?:@)/,i=t.match(e),r=i&&i[1]?i[1]:void 0,n=this.extractLocation(t.replace(e,""));return new _v({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 a=e.exec(i[n]);a&&r.push(new _v({fileName:a[2],lineNumber:parseFloat(a[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 a=e.exec(i[n]);a&&r.push(new _v({functionName:a[3]||void 0,fileName:a[2],lineNumber:parseFloat(a[1])}))}return r},parseOpera11(t){return t.stack.split("\n").filter((function(t){return!!t.match(wv)&&!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 _v({functionName:r,fileName:i[0],lineNumber:i[1],columnNumber:i[2]})}),this)}};function Cv(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 a=r.children[s];a.localName&&a.localName.toLowerCase&&a.localName.toLowerCase()===i&&n.push(a)}n.length>1&&(i+=":eq("+n.indexOf(t)+")"),e=i+(e?">"+e:""),t=r}return e}function Tv(t){return Array.isArray(t)}function Mv(t){return"object"==typeof t&&null!==t&&!Tv(t)}function Ev(t,e){if(0===e)return!0;var i=Object.keys(t);for(var r of i)if(Mv(t[r])&&Ev(t[r],e-1))return!0;return!1}function Iv(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(Mv(a=e)&&Object.keys(a).length>i.numOfKeysLimit||"function"==typeof a||Mv(a)&&Ev(a,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 a;if("bigint"==typeof e)return e.toString()+"n";if(e instanceof Event){var o={};for(var l in e){var u=e[l];o[l]=Tv(u)?Cv(u.length?u[0]:null):u}return o}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 Rv={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 Pv(t,e,i){var r,n=i?Object.assign({},Rv,i):Rv,s=n.logger;if(!s)return()=>{};r="string"==typeof s?e[s]:s;var a=0,o=!1,l=[];if(n.level.includes("error")){var u=e=>{var i=e.message,r=xv.parse(e.error).map((t=>t.toString())),s=[Iv(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=[Iv("Uncaught (in promise) "+(i=e.reason).name+": "+i.message,n.stringifyOptions)]:(i=new Error,r=[Iv("Uncaught (in promise)",n.stringifyOptions),Iv(e.reason,n.stringifyOptions)]);var s=xv.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]||o)){o=!0;try{var h=xv.parse(new Error).map((t=>t.toString())).splice(1),d=("assert"===i?l.slice(1):l).map((t=>Iv(t,n.stringifyOptions)));a++,n.lengthThreshold>a?t({level:i,trace:h,payload:d}):a===n.lengthThreshold&&t({level:"warn",trace:[],payload:[Iv("The number of log records reached the threshold.")]})}catch(t){e("rrweb logger error:",t,...l)}finally{o=!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=t=>{var e;return"function"==typeof t?null!==(e=t.__rrweb_layer__)&&void 0!==e?e:t.__posthog_layer__:void 0},i=e[s],r=t(i);r;){if(r.next===d)return void(r.next=h.next);r=t(i=r.next)}else e[s]=h.next}}catch(t){return()=>{}}}(e,i):()=>{}}}var Av=t=>({name:"rrweb/console@1",observer:Pv,options:t}),Fv=t=>"undefined"!=typeof Document&&t instanceof Document,Ov=()=>{},Lv=t=>{var e;if(Z(t))return null!==(e=t.__posthog_layer__)&&void 0!==e?e:t.__rrweb_layer__};function Dv(t,e,i){try{if(!(e in t))return Ov;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 Z(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],s=Lv(i);s;){if(s.next===n)return void(s.next=r.next);s=Lv(i=s.next)}else t[e]=r.next}}catch(t){return Ov}}function $v(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 Nv=Hi("[Recorder]"),qv=t=>"navigation"===t.entryType,jv=t=>"resource"===t.entryType;function Bv(t,e){return!!e&&(nt(e)||e[t])}function Hv(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 zv=["image/","video/","audio/","font/","application/octet-stream","application/pdf","application/zip","application/wasm"];function Uv(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:!!Hv(e)&&t(e.url)}catch(t){return!1}}(t.url))return!1;if(n(zv))return!1;if(nt(i))return!0;if(G(i))return n(i);var s=i[e];return nt(s)?s:n(s)}function Wv(t,e,i,r,n,s){return Vv.apply(this,arguments)}function Vv(){return Vv=f((function*(t,e,i,r,n,s){if(void 0===s&&(s=0),s>10)return Nv.warn("Failed to get performance entry for request",{url:i,initiatorType:e}),null;var a=function(t,i){for(var s=t.length-1;s>=0;s-=1)if(jv(a=t[s])&&a.initiatorType===e&&(K(r)||a.startTime>=r)&&(K(n)||n>=a.startTime))return t[s];var a}(t.performance.getEntriesByName(i));return a||(yield new Promise((t=>setTimeout(t,50*s))),Wv(t,e,i,r,n,s+1))})),Vv.apply(this,arguments)}function Gv(t){var e=t.body,i=t.options,r=t.url;if(et(e))return null;var n=$v(r,i);if(n.isHostDenied)return n.hostname+" is in deny list";if(Y(e))return e;if(Fv(e))return e.textContent;if(st(e))return rr(e);if(Q(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 Zv=t=>!tt(t)&&("navigation"===t.entryType||"resource"===t.entryType);function Qv(t){var e=t.entry,i=t.method,r=t.status,n=t.networkRequest,s=t.isInitial,a=t.start,o=t.end,l=t.url,u=t.initiatorType;a=e?e.startTime:a,o=e?e.responseEnd:o;var h=Math.floor(Date.now()-performance.now()),d=Math.floor(h+(a||0)),v=[p({},e?e.toJSON():{name:l},{startTime:K(a)?void 0:Math.round(a),endTime:K(o)?void 0:Math.round(o),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(Zv(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 Jv=["video/","audio/"];function Kv(t){return Q(t)&&Z(t.getReader)&&Z(t.tee)}var Yv=500,Xv="[SessionReplay] Timeout while trying to read body",tc="[SessionReplay] Failed to read body";function ec(t){return tc+": "+t}function ic(t){return"[SessionReplay] Body too large to record (> "+t+" bytes)"}function rc(t,e){if(!e.streamNetworkBody)return function(t){return new Promise((e=>{var i=setTimeout((()=>e(Xv)),Yv);try{t.clone().text().then((t=>e(t)),(t=>e(ec(t)))).finally((()=>clearTimeout(i)))}catch(t){clearTimeout(i),e(tc)}}))}(t);var i=nn(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(ic(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 a(t){n||(n=!0,clearTimeout(l),s(),i(t))}var o,l=setTimeout((()=>a(Xv)),Yv);try{o=t.clone()}catch(t){return void a(tc)}var u=o.body;if(Kv(u)&&"undefined"!=typeof TextDecoder){try{r=u.getReader()}catch(t){return void a(tc)}var h=[],d=0;!function t(){r.read().then((i=>{var r=i.done,o=i.value;if(n)s();else if(r)a((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(o){if(d+o.byteLength>e)return void a(ic(e));d+=o.byteLength,h.push(o)}t()}}),(t=>a(ec(t))))}()}else try{o.text().then((t=>a(t)),(t=>a(ec(t))))}catch(t){a(tc)}}))}(t,i)}function nc(){return nc=f((function*(t){var e=t.r,i=t.options,r=$v(t.url,i);return r.isHostDenied?Promise.resolve(r.hostname+" is in deny list"):rc(e,i)})),nc.apply(this,arguments)}function sc(){return sc=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(),a=Jv.some((t=>null==s?void 0:s.startsWith(t)));if(s&&a)return"Content-Type "+s+" is not supported";var o=$v(n,r);return o.isHostDenied?o.hostname+" is in deny list":null}({r:e,options:i,url:t.url});return tt(r)?rc(e,i):Promise.resolve(r)})),sc.apply(this,arguments)}var ac=null;function oc(t,e,i){if(!("performance"in e))return()=>{};if(ac)return Nv.warn("Network observer already initialised, doing nothing"),()=>{};var r=i?Object.assign({},sn,i):sn,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&&cn.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=>qv(t)||jv(t)&&i.initiatorTypes.includes(t.initiatorType)));t({requests:r.flatMap((t=>Qv({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=>qv(t)||jv(t)&&i.initiatorTypes.includes(t.initiatorType)&&(t=>!i.recordBody&&!i.recordHeaders||"xmlhttprequest"!==t.initiatorType&&"fetch"!==t.initiatorType)(t)));t({requests:r.flatMap((t=>Qv({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),a=()=>{},o=()=>{};return(r.recordHeaders||r.recordBody)&&(a=function(t,e,i){if(!i.initiatorTypes.includes("xmlhttprequest"))return()=>{};var r=Bv("request",i.recordHeaders),n=Bv("response",i.recordHeaders),s=Dv(e.XMLHttpRequest.prototype,"open",(s=>function(a,o,l,u,h){void 0===l&&(l=!0);var d=this;try{var v,c,f=new Request(o),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=>(Uv({type:"request",headers:g,url:o,recordBody:i.recordBody})&&(p.requestBody=Gv({body:t,options:i,url:o})),v=e.performance.now(),y(t));var b=()=>{d.removeEventListener("readystatechange",_),d.removeEventListener("error",b),d.removeEventListener("abort",b),d.removeEventListener("timeout",b)},_=()=>{if(d.readyState===d.DONE){b(),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),Uv({type:"response",headers:r,url:o,recordBody:i.recordBody})&&(p.responseBody=Gv({body:d.response,options:i,url:o})),Wv(e,"xmlhttprequest",f.url,v,c).then((e=>{var i=Qv({entry:e,method:a,status:null==d?void 0:d.status,networkRequest:p,start:v,end:c,url:o.toString(),initiatorType:"xmlhttprequest"});t({requests:i})})).catch((()=>{}))}};d.addEventListener("readystatechange",_),d.addEventListener("error",b),d.addEventListener("abort",b),d.addEventListener("timeout",b)}catch(t){Nv.error("Failed to instrument XHR for network capture",t)}s.call(d,a,o.toString(),l,u,h)}));return()=>{s()}}(n,e,r),o=function(t,e,i){if(!i.initiatorTypes.includes("fetch"))return()=>{};var r=Bv("request",i.recordHeaders),n=Bv("response",i.recordHeaders),s=Dv(e,"fetch",(s=>function(){var a=f((function*(a,o){var l,u;try{l=new Request(a,o)}catch(t){return Nv.error("Failed to instrument fetch for network capture",t),s(a,o)}var h,d,v={};try{try{var c={};l.headers.forEach(((t,e)=>{c[e]=t})),r&&(v.requestHeaders=c),!Kv(null==o?void 0:o.body)&&Uv({type:"request",headers:c,url:a,recordBody:i.recordBody})&&(v.requestBody=yield function(t){return nc.apply(this,arguments)}({r:l,options:i,url:a}))}catch(t){Nv.error("Failed to record fetch request for network capture",t)}h=e.performance.now(),u=Hv(a)?yield s(l):yield s(a,o),d=e.performance.now();var f={};return u.headers.forEach(((t,e)=>{f[e]=t})),n&&(v.responseHeaders=f),Uv({type:"response",headers:f,url:a,recordBody:i.recordBody})&&(v.responseBody=yield function(t){return sc.apply(this,arguments)}({r:u,options:i,url:a})),u}finally{Wv(e,"fetch",l.url,h,d).then((e=>{var i,r=Qv({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 a.apply(this,arguments)}}()));return()=>{s()}}(n,e,r)),ac=()=>{s(),a(),o(),ac=null}}var lc=t=>({name:"rrweb/network@1",observer:oc,options:t});v.__PosthogExtensions__=v.__PosthogExtensions__||{},v.__PosthogExtensions__.rrwebPlugins={getRecordConsolePlugin:Av,getRecordNetworkPlugin:lc},v.__PosthogExtensions__.rrweb={record:mv,version:"v2",wasMaxDepthReached:()=>Wh,resetMaxDepthState(){Wh=!1,Uh=!1},getLastSnapshotCost:()=>Eu,getMutationCost:()=>p({},Fu),resetSnapshotCostState(){xu=0,Cu=0,Tu=0,bu=0,Mu=mu(),Eu=null,Iu=null,Ru=[],Pu=0,Au=0,Fu={slowestBatchMs:0},Ou={deferredCount:0,failedCount:0,abandonedCount:0,totalMs:0,slowestSliceMs:0}}},v.rrweb={record:mv,version:"v2"},v.rrwebConsoleRecord={getRecordConsolePlugin:Av},v.getRecordNetworkPlugin=lc,v.__PosthogExtensions__=v.__PosthogExtensions__||{},v.__PosthogExtensions__.initSessionRecording=(t,e)=>new Gl(t,e);var uc,hc,dc,vc,cc,fc,pc,gc,mc,yc,bc,_c,wc,kc,Sc,xc={},Cc=[],Tc=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,Mc=Array.isArray;function Ec(t,e){for(var i in e)t[i]=e[i];return t}function Ic(t){t&&t.parentNode&&t.parentNode.removeChild(t)}function Rc(t,e,i){var r,n,s,a={};for(s in e)"key"==s?r=e[s]:"ref"==s?n=e[s]:a[s]=e[s];if(arguments.length>2&&(a.children=arguments.length>3?uc.call(arguments,2):i),"function"==typeof t&&null!=t.defaultProps)for(s in t.defaultProps)void 0===a[s]&&(a[s]=t.defaultProps[s]);return Pc(t,a,r,n,null)}function Pc(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?++dc:n,__i:-1,__u:0};return null==n&&null!=hc.vnode&&hc.vnode(s),s}function Ac(t){return t.children}function Fc(t,e){this.props=t,this.context=e}function Oc(t,e){if(null==e)return t.__?Oc(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?Oc(t):null}function Lc(t){if(t.__P&&t.__d){var e=t.__v,i=e.__e,r=[],n=[],s=Ec({},e);s.__v=e.__v+1,hc.vnode&&hc.vnode(s),Wc(t.__P,s,e,t.__n,t.__P.namespaceURI,32&e.__u?[i]:null,r,null==i?Oc(e):i,!!(32&e.__u),n),s.__v=e.__v,s.__.__k[s.__i]=s,Gc(r,s,n),e.__e=e.__=null,s.__e!=i&&Dc(s)}}function Dc(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})),Dc(t)}function $c(t){(!t.__d&&(t.__d=!0)&&vc.push(t)&&!Nc.__r++||cc!=hc.debounceRendering)&&((cc=hc.debounceRendering)||fc)(Nc)}function Nc(){try{for(var t,e=1;vc.length;)vc.length>e&&vc.sort(pc),t=vc.shift(),e=vc.length,Lc(t)}finally{vc.length=Nc.__r=0}}function qc(t,e,i,r,n,s,a,o,l,u,h){var d,v,c,f,p,g,m,y=r&&r.__k||Cc,b=e.length;for(l=function(t,e,i,r,n){var s,a,o,l,u,h=i.length,d=h,v=0;for(t.__k=new Array(n),s=0;n>s;s++)null!=(a=e[s])&&"boolean"!=typeof a&&"function"!=typeof a?("string"==typeof a||"number"==typeof a||"bigint"==typeof a||a.constructor==String?a=t.__k[s]=Pc(null,a,null,null,null):Mc(a)?a=t.__k[s]=Pc(Ac,{children:a},null,null,null):void 0===a.constructor&&a.__b>0?a=t.__k[s]=Pc(a.type,a.props,a.key,a.ref?a.ref:null,a.__v):t.__k[s]=a,l=s+v,a.__=t,a.__b=t.__b+1,o=null,-1!=(u=a.__i=Bc(a,i,l,d))&&(d--,(o=i[u])&&(o.__u|=2)),null==o||null==o.__v?(-1==u&&(n>h?v--:h>n&&v++),"function"!=typeof a.type&&(a.__u|=4)):u!=l&&(u==l-1?v--:u==l+1?v++:(u>l?v--:v++,a.__u|=4))):t.__k[s]=null;if(d)for(s=0;h>s;s++)null!=(o=i[s])&&0==(2&o.__u)&&(o.__e==r&&(r=Oc(o)),Jc(o,o));return r}(i,e,y,l,b),d=0;b>d;d++)null!=(c=i.__k[d])&&(v=-1!=c.__i&&y[c.__i]||xc,c.__i=d,g=Wc(t,c,v,n,s,a,o,l,u,h),f=c.__e,c.ref&&v.ref!=c.ref&&(v.ref&&Qc(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=jc(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 jc(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=jc(n[s],e,i,r));return e}t.__e!=e&&(r&&(e&&t.type&&!e.parentNode&&(e=Oc(t)),i.insertBefore(t.__e,e||null)),e=t.__e);do{e=e&&e.nextSibling}while(null!=e&&8==e.nodeType);return e}function Bc(t,e,i,r){var n,s,a,o=t.key,l=t.type,u=e[i],h=null!=u&&0==(2&u.__u);if(null===u&&null==o||h&&o==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[a=0>n?s++:n--])&&0==(2&u.__u)&&o==u.key&&l==u.type)return a;return-1}function Hc(t,e,i){"-"==e[0]?t.setProperty(e,null==i?"":i):t[e]=null==i?"":"number"!=typeof i||Tc.test(e)?i:i+"px"}function zc(t,e,i,r,n){var s,a;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||Hc(t.style,e,"");if(i)for(e in i)r&&i[e]==r[e]||Hc(t.style,e,i[e])}else if("o"==e[0]&&"n"==e[1])s=e!=(e=e.replace(bc,"$1")),a=e.toLowerCase(),e=a in t||"onFocusOut"==e||"onFocusIn"==e?a.slice(2):e.slice(2),t.l||(t.l={}),t.l[e+s]=i,i?r?i[yc]=r[yc]:(i[yc]=_c,t.addEventListener(e,s?kc:wc,s)):t.removeEventListener(e,s?kc:wc,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 Uc(t){return function(e){if(this.l){var i=this.l[e.type+t];if(null==e[mc])e[mc]=_c++;else if(i[yc]>e[mc])return;return i(hc.event?hc.event(e):e)}}}function Wc(t,e,i,r,n,s,a,o,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=[o=e.__e=i.__e]),(h=hc.__b)&&h(e);t:if("function"==typeof C){d=a.length;try{if(y=e.props,b=C.prototype&&C.prototype.render,$=(h=C.contextType)&&r[h.__c],_=h?$?$.props.value:h.__:r,i.__c?m=(v=e.__c=i.__c).__=v.__E:(b?e.__c=v=new C(y,_):(e.__c=v=new Fc(y,_),v.constructor=C,v.render=Kc),$&&$.sub(v),v.state||(v.state={}),v.__n=r,c=v.__d=!0,v.__h=[],v._sb=[]),b&&null==v.__s&&(v.__s=v.state),b&&null!=C.getDerivedStateFromProps&&(v.__s==v.state&&(v.__s=Ec({},v.__s)),Ec(v.__s,C.getDerivedStateFromProps(y,v.__s))),f=v.props,p=v.state,v.__v=e,c)b&&null==C.getDerivedStateFromProps&&null!=v.componentWillMount&&v.componentWillMount(),b&&null!=v.componentDidMount&&v.__h.push(v.componentDidMount);else{if(b&&null==C.getDerivedStateFromProps&&y!==f&&null!=v.componentWillReceiveProps&&v.componentWillReceiveProps(y,_),e.__v==i.__v||!v.__e&&null!=v.shouldComponentUpdate&&!1===v.shouldComponentUpdate(y,v.__s,_)){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)})),Cc.push.apply(v.__h,v._sb),v._sb=[],v.__h.length&&a.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=_,v.props=y,v.__P=t,v.__e=!1,w=hc.__r,k=0,b)v.state=v.__s,v.__d=!1,w&&w(e),h=v.render(v.props,v.state,v.context),Cc.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=Ec(Ec({},r),v.getChildContext())),b&&!c&&null!=v.getSnapshotBeforeUpdate&&(g=v.getSnapshotBeforeUpdate(f,p)),S=null!=h&&h.type===Ac&&null==h.key?Zc(h.props.children):h,o=qc(t,Mc(S)?S:[S],e,i,r,n,s,a,o,l,u),v.base=e.__e,e.__u&=-161,v.__h.length&&a.push(v),m&&(v.__E=v.__=null)}catch(t){if(a.length=d,e.__v=null,l||null!=s)if(t.then){for(e.__u|=l?160:128;o&&8==o.nodeType&&o.nextSibling;)o=o.nextSibling;null!=s&&(s[s.indexOf(o)]=null),e.__e=o}else{if(null!=s)for(x=s.length;x--;)Ic(s[x]);Vc(e)}else e.__e=i.__e,!e.__k&&i.__k&&(e.__k=i.__k),t.then||Vc(e);hc.__e(t,e,i)}}else null==s&&e.__v==i.__v?(e.__k=i.__k,e.__e=i.__e):o=e.__e=function(t,e,i,r,n,s,a,o,l){var u,h,d,v,c,f,p,g=i.props||xc,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),o&&(hc.__m&&hc.__m(e,s),o=!1),s=null}if(null==y)g===m||o&&t.data==m||(t.data=m);else{if(s="textarea"==y&&null!=m.defaultValue?null:s&&uc.call(t.childNodes),!o&&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||zc(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:o&&"function"!=typeof c||g[u]===c||zc(t,u,c,g[u],n);if(h)o||d&&(h.__html==d.__html||h.__html==t.innerHTML)||(t.innerHTML=h.__html),e.__k=[];else if(d&&(t.innerHTML=""),qc("template"==e.type?t.content:t,Mc(v)?v:[v],e,i,r,"foreignObject"==y?"http://www.w3.org/1999/xhtml":n,s,a,s?s[0]:i.__k&&Oc(i,0),o,l),null!=s)for(u=s.length;u--;)Ic(s[u]);o&&"textarea"!=y||(u="value","progress"==y&&null==f?t.removeAttribute("value"):null!=f&&(f!==t[u]||"progress"==y&&!f||"option"==y&&f!=g[u])&&zc(t,u,f,g[u],n),u="checked",null!=p&&p!=t[u]&&zc(t,u,p,g[u],n))}return t}(i.__e,e,i,r,n,s,a,l,u);return(h=hc.diffed)&&h(e),128&e.__u?void 0:o}function Vc(t){t&&(t.__c&&(t.__c.__e=!0),t.__k&&t.__k.some(Vc))}function Gc(t,e,i){for(var r=0;i.length>r;r++)Qc(i[r],i[++r],i[++r]);hc.__c&&hc.__c(e,t),t.some((function(e){try{t=e.__h,e.__h=[],t.some((function(t){t.call(e)}))}catch(t){hc.__e(t,e.__v)}}))}function Zc(t){return"object"!=typeof t||null==t||t.__b>0?t:Mc(t)?t.map(Zc):void 0!==t.constructor?null:Ec({},t)}function Qc(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){hc.__e(t,i)}}function Jc(t,e,i){var r,n;if(hc.unmount&&hc.unmount(t),(r=t.ref)&&(r.current&&r.current!=t.__e||Qc(r,null,e)),null!=(r=t.__c)){if(r.componentWillUnmount)try{r.componentWillUnmount()}catch(t){hc.__e(t,e)}r.base=r.__P=r.__n=null}if(r=t.__k)for(n=0;r.length>n;n++)r[n]&&Jc(r[n],e,i||"function"!=typeof t.type);i||Ic(t.__e),t.__c=t.__=t.__e=void 0}function Kc(t,e,i){return this.constructor(t,i)}function Yc(t,e,i){var r,n,s;e==document&&(e=document.documentElement),hc.__&&hc.__(t,e),r=e.__k,n=[],s=[],Wc(e,t=e.__k=Rc(Ac,null,[t]),r||xc,xc,e.namespaceURI,r?null:e.firstChild?uc.call(e.childNodes):null,n,r?r.__e:e.firstChild,!1,s),Gc(n,t,s),t.props.children=null}uc=Cc.slice,hc={__e(t,e,i,r){for(var n,s,a;e=e.__;)if((n=e.__c)&&!n.__)try{if((s=n.constructor)&&null!=s.getDerivedStateFromError&&(n.setState(s.getDerivedStateFromError(t)),a=n.__d),null!=n.componentDidCatch&&(n.componentDidCatch(t,r||{}),a=n.__d),a)return n.__E=n}catch(e){t=e}throw t}},dc=0,Fc.prototype.setState=function(t,e){var i;i=null!=this.__s&&this.__s!=this.state?this.__s:this.__s=Ec({},this.state),"function"==typeof t&&(t=t(Ec({},i),this.props)),t&&Ec(i,t),null!=t&&this.__v&&(e&&this._sb.push(e),$c(this))},Fc.prototype.forceUpdate=function(t){this.__v&&(this.__e=!0,t&&this.__h.push(t),$c(this))},Fc.prototype.render=Ac,vc=[],fc="function"==typeof Promise?Promise.prototype.then.bind(Promise.resolve()):setTimeout,pc=function(t,e){return t.__v.__b-e.__v.__b},Nc.__r=0,gc=Math.random().toString(8),mc="__d"+gc,yc="__a"+gc,bc=/(PointerCapture)$|Capture$/i,_c=0,wc=Uc(!1),kc=Uc(!0),Sc=0;var Xc,tf,ef,rf,nf=0,sf=[],af=hc,of=af.__b,lf=af.__r,uf=af.diffed,hf=af.__c,df=af.unmount,vf=af.__;function cf(t,e){af.__h&&af.__h(tf,t,nf||e),nf=0;var i=tf.__H||(tf.__H={__:[],__h:[]});return t>=i.__.length&&i.__.push({}),i.__[t]}function ff(t){return nf=1,function(t,e,i){var r=cf(Xc++,2);if(r.t=t,!r.__c&&(r.__=[Cf(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=tf,!tf.__f)){var n=function(t,e,i){if(!r.__c.__H)return!0;var n=!1,a=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]&&(a=!0)}})),s){var o=s.call(this,t,e,i);return n?o||a:o}return!n||a};tf.__f=!0;var s=tf.shouldComponentUpdate,a=tf.componentWillUpdate;tf.componentWillUpdate=function(t,e,i){if(this.__e){var r=s;s=void 0,n(t,e,i),s=r}a&&a.call(this,t,e,i)},tf.shouldComponentUpdate=n}return r.__N||r.__}(Cf,t)}function pf(t,e){var i=cf(Xc++,3);!af.__s&&xf(i.__H,e)&&(i.__=t,i.u=e,tf.__H.__h.push(i))}function gf(t){return nf=5,mf((function(){return{current:t}}),[])}function mf(t,e){var i=cf(Xc++,7);return xf(i.__H,e)&&(i.__=t(),i.__H=e,i.__h=t),i.__}function yf(t){var e=tf.context[t.__c],i=cf(Xc++,9);return i.c=t,e?(null==i.__&&(i.__=!0,e.sub(tf)),e.props.value):t.__}function bf(){for(var t;t=sf.shift();){var e=t.__H;if(t.__P&&e)try{e.__h.some(kf),e.__h.some(Sf),e.__h=[]}catch(i){e.__h=[],af.__e(i,t.__v)}}}af.__b=function(t){tf=null,of&&of(t)},af.__=function(t,e){t&&e.__k&&e.__k.__m&&(t.__m=e.__k.__m),vf&&vf(t,e)},af.__r=function(t){lf&&lf(t),Xc=0;var e=(tf=t.__c).__H;e&&(ef===tf?(e.__h=[],tf.__h=[],e.__.some((function(t){t.__N&&(t.__=t.__N),t.u=t.__N=void 0}))):(e.__h.length&&bf(),Xc=0)),ef=tf},af.diffed=function(t){uf&&uf(t);var e=t.__c;e&&e.__H&&(e.__H.__h.length&&(1!==sf.push(e)&&rf===af.requestAnimationFrame||((rf=af.requestAnimationFrame)||wf)(bf)),e.__H.__.some((function(t){t.u&&(t.__H=t.u,t.u=void 0)}))),ef=tf=null},af.__c=function(t,e){e.some((function(t){try{t.__h.some(kf),t.__h=t.__h.filter((function(t){return!t.__||Sf(t)}))}catch(i){e.some((function(t){t.__h&&(t.__h=[])})),e=[],af.__e(i,t.__v)}})),hf&&hf(t,e)},af.unmount=function(t){df&&df(t);var e,i=t.__c;i&&i.__H&&(i.__H.__.some((function(t){try{kf(t)}catch(t){e=t}})),i.__H=void 0,e&&af.__e(e,i.__v))};var _f="function"==typeof requestAnimationFrame;function wf(t){var e,i=function(){clearTimeout(r),_f&&cancelAnimationFrame(e),setTimeout(t)},r=setTimeout(i,35);_f&&(e=requestAnimationFrame(i))}function kf(t){var e=tf,i=t.__c;"function"==typeof i&&(t.__c=void 0,i()),tf=e}function Sf(t){var e=tf;t.__c=t.__(),tf=e}function xf(t,e){return!t||t.length!==e.length||e.some((function(e,i){return e!==t[i]}))}function Cf(t,e){return"function"==typeof e?e(t):e}function Tf(t){var e=!0;return{dispose(){if(e){e=!1;var i=t();i&&Z(i.then)&&i.then(void 0,(()=>{}))}}}}var Mf="gzip-js",Ef="base64",If="events",Rf="cancelEvents",Pf={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"},Ff={Top:"top",Left:"left",Right:"right",Bottom:"bottom"},Of={Popover:"popover",API:"api",Widget:"widget",ExternalSurvey:"external_survey"},Lf={Open:"open",MultipleChoice:"multiple_choice",SingleChoice:"single_choice",Rating:"rating",Link:"link"},Df={End:"end",ResponseBased:"response_based",SpecificQuestion:"specific_question"},$f="always",Nf={SHOWN:"survey shown",DISMISSED:"survey dismissed",SENT:"survey sent",ABANDONED:"survey abandoned"},qf={SURVEY_ID:"$survey_id",SURVEY_NAME:"$survey_name",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_COMPLETED:"$survey_completed",SURVEY_LAST_SEEN_DATE:"$survey_last_seen_date",SURVEY_LANGUAGE:"$survey_language"},jf="popover",Bf=Hi("[Surveys]");function Hf(t){return!(!t.start_date||t.end_date)}function zf(t){var e;return!(null==(e=t.conditions)||null==(e=e.actions)||null==(e=e.values)||!e.length)}var Uf="seenSurvey_",Wf="inProgressSurvey_",Vf=(t,e)=>""+t+function(t){return t.current_iteration&&t.current_iteration>0?t.id+"_"+t.current_iteration:t.id}(e),Gf=t=>Vf(Uf,t),Zf=t=>{try{var e=Gf(t);if(localStorage.getItem(e))return;localStorage.setItem(e,"true")}catch(t){Bf.error("Failed to persist survey seen state",t)}},Qf=[Of.Popover,Of.Widget,Of.API],Jf={ignoreConditions:!1,ignoreDelay:!1,displayType:jf},Kf="featureFlags",Yf="logs";Math.trunc||(Math.trunc=function(t){return 0>t?Math.ceil(t):Math.floor(t)}),Number.isInteger||(Number.isInteger=function(t){return it(t)&&isFinite(t)&&Math.floor(t)===t});class Xf{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 Xf(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 Xf(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 tp{generate(){var t=this.generateOrAbort();if(!K(t))return t;this.Gr=0;var e=this.generateOrAbort();if(K(e))throw new Error("Could not generate UUID after timestamp reset");return e}generateOrAbort(){var t=Date.now();if(t>this.Gr)this.Gr=t,this.Qr();else{if(this.Gr>=t+1e4)return;this.Jr++,this.Jr>4398046511103&&(this.Gr++,this.Qr())}return Xf.fromFieldsV7(this.Gr,Math.trunc(this.Jr/Math.pow(2,30)),this.Jr&Math.pow(2,30)-1,this.Yr.nextUint32())}Qr(){this.Jr=1024*this.Yr.nextUint32()+(1023&this.Yr.nextUint32())}constructor(){this.Gr=0,this.Jr=0,this.Yr=new rp}}var ep,ip=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&&!K(t.crypto)&&crypto.getRandomValues&&(ip=t=>crypto.getRandomValues(t));class rp{nextUint32(){return this.At.length>this.Kr||(ip(this.At),this.Kr=0),this.At[this.Kr++]}constructor(){this.At=new Uint32Array(8),this.Kr=1/0}}var np=()=>sp().toString(),sp=()=>(ep||(ep=new tp)).generate(),ap="",op=/[a-z0-9][a-z0-9-]+\.[a-z]{2,}$/i;var lp={Xr:()=>!!r,ii(t){Bi.error("cookieStore error: "+t)},ti:Oo,ni(t){var e;try{e=JSON.parse(lp.ti(t))||{}}catch(t){}return e},ei(t,e,i,n,s){if(!r)return!1;try{var a="",o="",l=function(t,e){if(e){var i=function(t,e){if(void 0===e&&(e=r),ap)return ap;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_"+np();!ap&&n--;){var a=i.slice(n).join("."),o=s+"=1;domain=."+a+";path=/";e.cookie=o+";max-age=3",e.cookie.includes(s)&&(e.cookie=o+";max-age=0",ap=a)}return ap}(t);if(!i){var n=(t=>{var e=t.match(op);return e?e[0]:""})(t);n!==i&&Bi.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),a="; expires="+u.toUTCString()}s&&(o="; secure");var h=t+"="+encodeURIComponent(JSON.stringify(e))+a+"; SameSite=Lax; path=/"+l+o;return h.length>3686.4&&Bi.warn("cookieStore warning: large cookie, len="+h.length),r.cookie=h,!0}catch(t){return!1}},ri(t,e){if(null!=r&&r.cookie)try{lp.ei(t,"",-1,e)}catch(t){return}}},up=null,hp={Xr(){if(!tt(up))return up;var e=!0;if(K(t))e=!1;else try{var i="__mplssupport__";hp.ei(i,"xyz"),'"xyz"'!==hp.ti(i)&&(e=!1),hp.ri(i)}catch(t){e=!1}return e||Bi.error("localStorage unsupported; falling back to cookie store"),up=e,e},ii(t){Bi.error("localStorage error: "+t)},ti(e){try{return null==t?void 0:t.localStorage.getItem(e)}catch(t){hp.ii(t)}return null},ni(t){try{return JSON.parse(hp.ti(t))||{}}catch(t){}return null},ei(e,i){try{return null==t||t.localStorage.setItem(e,JSON.stringify(i)),!0}catch(t){hp.ii(t)}return!1},ri(e){try{null==t||t.localStorage.removeItem(e)}catch(t){hp.ii(t)}}},dp=[es,Gn,Vn,Qn,Jn,Kn,cs,vs,hs],vp=[gn,pn,Dn,$n,_s,bs,fs],cp=t=>t+"_cpm",fp=["__proto__","constructor","prototype"],pp=t=>{if(!Q(t))return{};var e={};return Object.keys(t).forEach((i=>{-1===fp.indexOf(i)&&(e[i]=t[i])})),e},gp=function(t,e){void 0===e&&(e=[]);var i={};return[...vp,...e].forEach((e=>{var r=t[e];K(r)||tt(r)||""===r||(i[e]=r)})),i},mp=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)},yp=(t,e)=>({p:e,f:mp(JSON.stringify(t))}),bp=(t,e)=>{if(!e)return{properties:[],isValid:!1};try{var i=lp.ni(cp(t)),r=(null==i?void 0:i.f)===mp(e)&&G(i.p);return{properties:r?i.p:[],isValid:r}}catch(t){return{properties:[],isValid:!1}}},_p=(t,e)=>e+"|"+(lp.ti(cp(t))||""),wp={},kp={Xr:()=>!0,ii(t){Bi.error("memoryStorage error: "+t)},ti:t=>wp[t]||null,ni:t=>wp[t]||null,ei:(t,e)=>(wp[t]=e,!0),ri(t){delete wp[t]}},Sp=null,xp={Xr(){if(!tt(Sp))return Sp;if(Sp=!0,K(t))Sp=!1;else try{var e="__support__";xp.ei(e,"xyz"),'"xyz"'!==xp.ti(e)&&(Sp=!1),xp.ri(e)}catch(t){Sp=!1}return Sp},ii(t){Bi.error("sessionStorage error: ",t)},ti(e){try{return null==t?void 0:t.sessionStorage.getItem(e)}catch(t){xp.ii(t)}return null},ni(t){try{return JSON.parse(xp.ti(t))||null}catch(t){}return null},ei(e,i){try{return null==t||t.sessionStorage.setItem(e,JSON.stringify(i)),!0}catch(t){xp.ii(t)}return!1},ri(e){try{null==t||t.sessionStorage.removeItem(e)}catch(t){xp.ii(t)}}},Cp=Hi("[Stylesheet Loader]"),Tp=t,Mp=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:Pf.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 Pp(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 Ap(t){var e;void 0===t&&(t=Ip.backgroundColor),"#"===t[0]&&(e=Pp(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=Pp(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]),a=parseInt(r[3]);return Math.sqrt(n*n*.299+s*s*.587+a*a*.114)>127.5?Ep:"white"}return Ep}var Fp=(t,e,i)=>{var r=Yp(t),n=Mp.querySelector("."+r);if(n&&n.shadowRoot)return{shadow:n.shadowRoot,isNewlyCreated:!1};var s=Mp.createElement("div");((t,e,i)=>{var r=p({},Ip,i),n=t.style,s=!Rp.includes(r.position)||e===Of.Widget&&(null==i?void 0:i.widgetType)===Pf.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)||Ap(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",Ap(r.ratingButtonActiveColor)),n.setProperty("--ph-survey-text-primary-color",(null==i?void 0:i.textColor)||Ap(r.backgroundColor)),n.setProperty("--ph-survey-text-subtle-color",r.textSubtleColor),n.setProperty("--ph-widget-color",r.widgetColor),n.setProperty("--ph-widget-text-color",Ap(r.widgetColor)),n.setProperty("--ph-widget-z-index",r.zIndex);var a=(null==i?void 0:i.inputBackground)||(null==i?void 0:i.inputBackgroundColor),o=a||r.inputBackground;a||"white"!==r.backgroundColor||(o="#f8f8f8"),n.setProperty("--ph-survey-input-background",o);var l=(null==i?void 0:i.inputTextColor)||Ap(o);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 a=s.attachShadow({mode:"open"}),o=function(t){var e=((t,e,i)=>{var r=t.createElement("style");r.innerText=e;var n=(t=>{var e;return Z(t)?t:null==t||null==(e=t.config)?void 0:e.prepare_external_dependency_stylesheet})(i);return n&&(r=n(r)),r||(Cp.error("prepare_external_dependency_stylesheet returned null"),null)})(Mp,':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(o){var l=a.querySelector("style");l&&a.removeChild(l),a.appendChild(o)}return Mp.body.appendChild(s),{shadow:a,isNewlyCreated:!0}},Op=t=>{var e=t.responses,i=t.survey,r=t.surveySubmissionId,n=t.posthog,s=t.isSurveyCompleted,a=t.properties,o=t.surveyLanguage,l=t.questionSnapshots;n?(Zf(i),n.capture(Nf.SENT,p({[qf.SURVEY_NAME]:i.name,[qf.SURVEY_ID]:i.id,[qf.SURVEY_ITERATION]:i.current_iteration,[qf.SURVEY_ITERATION_START_DATE]:i.current_iteration_start_date,[qf.SURVEY_SUBMISSION_ID]:r,[qf.SURVEY_COMPLETED]:s},o&&{[qf.SURVEY_LANGUAGE]:o},{sessionRecordingUrl:null==n.get_session_replay_url?void 0:n.get_session_replay_url()},co(e,i,l),a,{$set:{[fo(i,"responded")]:!0}})),s&&(Tp.dispatchEvent(new CustomEvent("PHSurveySent",{detail:{surveyId:i.id}})),Kp(i),n.reloadFeatureFlags())):Bf.error("[survey sent] event not captured, PostHog instance not found.")},Lp=(t,e,i)=>{return p({[qf.SURVEY_NAME]:t.name,[qf.SURVEY_ID]:t.id,[qf.SURVEY_ITERATION]:t.current_iteration,[qf.SURVEY_ITERATION_START_DATE]:t.current_iteration_start_date,[qf.SURVEY_PARTIALLY_COMPLETED]:(r=null==e?void 0:e.responses,void 0===r&&(r={}),Object.values(r).some((t=>!et(t))))},(null==e?void 0:e.surveyLanguage)&&{[qf.SURVEY_LANGUAGE]:e.surveyLanguage},{sessionRecordingUrl:null==i.get_session_replay_url?void 0:i.get_session_replay_url(),[qf.SURVEY_SUBMISSION_ID]:null==e?void 0:e.surveySubmissionId},co(null==e?void 0:e.responses,t,null==e?void 0:e.questionSnapshots));var r},Dp=(t,e,i,r)=>{if(e){if(!i){var n=Qp(t),s=n?n.surveyLanguage:r;e.capture(Nf.DISMISSED,p({},Lp(t,n,e),s&&{[qf.SURVEY_LANGUAGE]:s},{$set:{[fo(t,"dismissed")]:!0}})),Kp(t),Zf(t),Tp.dispatchEvent(new CustomEvent("PHSurveyClosed",{detail:{surveyId:t.id}}))}}else Bf.error("[survey dismissed] event not captured, PostHog instance not found.")},$p=(t,e)=>{if(e){var i=(t=>Vf("abandonedSurvey_",t))(t);try{if("true"===localStorage.getItem(i))return}catch(t){return}var r=Qp(t);if(r){try{localStorage.setItem(i,"true")}catch(t){}e.capture(Nf.ABANDONED,Lp(t,r,e),{transport:"sendBeacon"})}}else Bf.error("[survey abandoned] event not captured, PostHog instance not found.")},Np=t=>t.map((t=>({sort:Math.floor(10*Math.random()),value:t}))).sort(((t,e)=>t.sort-e.sort)).map((t=>t.value)),qp=(t,e)=>t.length===e.length&&t.every(((t,i)=>t===e[i]))?e.reverse():e,jp=t=>{var e=t.map((t=>t.id));return e.every((t=>!!t))?e:void 0},Bp=(t,e)=>{return(t=>t.questions.some((t=>{var e;return!(null==(e=t.branching)||!e.type)})))(t)?t.questions:e?null!==(i=((t,e)=>{if(!e||e.length!==t.questions.length)return null;var i=new Map(t.questions.map((t=>[t.id,t]))),r=[];for(var n of e){var s=i.get(n);if(!s)return null;r.push(s)}return r})(t,e.questionOrder))&&void 0!==i?i:t.questions:t.appearance&&t.appearance.shuffleQuestions&&!t.enable_partial_responses?qp(t.questions,Np(t.questions)):t.questions;var i},Hp=t=>wo(t)||Jp(t),zp=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,$c(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"+Sc++,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}),Up=()=>yf(zp),Wp=t=>{var e=t.children,i=t.style;return function(t,e,i){var r,n,s,a,o=Ec({},t.props);for(s in t.type&&t.type.defaultProps&&(a=t.type.defaultProps),e)"key"==s?r=e[s]:"ref"==s?n=e[s]:o[s]=void 0===e[s]&&null!=a?a[s]:e[s];return arguments.length>2&&(o.children=arguments.length>3?uc.call(arguments,2):i),Pc(t.type,o,r||t.key,n||t.ref,null)}(t.component,t.renderAsHtml?{dangerouslySetInnerHTML:{__html:e},style:i}:{children:e,style:i})};function Vp(t,e){var i,r;if(null==(i=t.conditions)||!i.url)return!0;var n=hr(e);if(!n)return!1;var s=[t.conditions.url],a=function(t){return null!=t?t:"icontains"}(null==(r=t.conditions)?void 0:r.urlMatchType);return xo[a](s,[n])}var Gp=t=>Vf(Wf,t),Zp=(t,e)=>{try{localStorage.setItem(Gp(t),JSON.stringify(e))}catch(t){Bf.error("Error setting in-progress survey state in localStorage",t)}},Qp=t=>{try{var e=localStorage.getItem(Gp(t));if(e)return JSON.parse(e)}catch(t){Bf.error("Error getting in-progress survey state from localStorage",t)}return null},Jp=t=>{var e=Qp(t);return!et(null==e?void 0:e.surveySubmissionId)},Kp=t=>{try{localStorage.removeItem(Gp(t))}catch(t){Bf.error("Error clearing in-progress survey state from localStorage",t)}};function Yp(t,e){void 0===e&&(e=!1);var i="PostHogSurvey-"+t.id;return e?"."+i:i}function Xp(t,e,i){if(void 0===e&&(e=Af.Right),t===Of.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===Of.Widget&&i===Pf.Tab?"60px":"30px"}}}var tg=0;function eg(t,e,i,r,n,s){e||(e={});var a,o,l=e;if("ref"in l)for(o in l={},e)"ref"==o?a=e[o]:l[o]=e[o];var u={type:t,props:l,key:i,ref:a,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:--tg,__i:-1,__u:0,__source:n,__self:s};if("function"==typeof t&&(a=t.defaultProps))for(o in a)void 0===l[o]&&(l[o]=a[o]);return hc.vnode&&hc.vnode(u),u}var ig=eg("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 -960 960 960",width:"48",children:eg("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"})}),rg=eg("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 -960 960 960",width:"48",children:eg("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"})}),ng=eg("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 -960 960 960",width:"48",children:eg("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"})}),sg=eg("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 -960 960 960",width:"48",children:eg("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"})}),ag=eg("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 -960 960 960",width:"48",children:eg("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"})}),og=eg("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 0 24 24",width:"48",children:eg("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"})}),lg=eg("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 0 24 24",width:"48",children:eg("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"})}),ug=function(t){var e=(void 0===t?{}:t).fill,i=void 0===e?"currentColor":e;return eg("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:[eg("title",{id:"close-survey-title",className:"adam-testing",children:"Close survey"}),eg("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})]})},hg=eg("svg",{width:"77",height:"14",viewBox:"0 0 77 14",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[eg("g",{"clip-path":"url(#clip0_2415_6911)",children:[eg("mask",{id:"mask0_2415_6911",style:{maskType:"luminance"},maskUnits:"userSpaceOnUse",x:"0",y:"0",width:"77",height:"14",children:eg("path",{d:"M0.5 0H76.5V14H0.5V0Z",fill:"white"})}),eg("g",{mask:"url(#mask0_2415_6911)",children:[eg("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"}),eg("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"}),eg("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"}),eg("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"}),eg("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"}),eg("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"})]})]}),eg("defs",{children:eg("clipPath",{id:"clip0_2415_6911",children:eg("rect",{width:"76",height:"14",fill:"white",transform:"translate(0.5)"})})})]});function dg(t){var e=t.urlParams,i=e?Object.entries(e).map((t=>{var e=t[1];return encodeURIComponent(t[0])+"="+encodeURIComponent(e)})).join("&"):"";return eg("a",{href:"https://posthog.com/surveys"+(i?"?"+i:""),target:"_blank",rel:"noopener",className:"footer-branding",children:["Survey by ",hg]})}function vg(e){var i=e.text,r=e.submitDisabled,n=e.appearance,s=e.onSubmit,a=e.link,o=e.onPreviewSubmit,l=e.skipSubmitButton,u=e.canGoBack,h=e.onBack,d=yf(zp).isPreviewMode,v=!!u&&!!h,c=!l&&eg("button",{className:"form-submit",disabled:r,"aria-label":"Submit survey",type:"button",onClick(){a&&(null==t||t.open(a)),d?null==o||o():s()},children:i});return eg("div",{className:"bottom-section",children:[v?eg("div",{className:"form-buttons form-buttons-with-back",children:[eg("button",{className:"form-back",type:"button","aria-label":"Go to previous question",onClick:h,children:n.backButtonText||"Back"}),c]}):c,!n.whiteLabel&&eg(dg,{urlParams:{utm_source:"survey-footer"}})]})}function cg(t){var e=t.question,i=t.forceDisableHtml;return eg("div",{class:e.question||e.description?"question-header":"question-header question-header--empty",children:[eg(e.type===Lf.Open?"label":"h3",{className:"survey-question",htmlFor:t.htmlFor,children:e.question}),e.description&&Wp({component:Rc("p",{className:"survey-question-description"}),children:e.description,renderAsHtml:!i&&"text"!==e.descriptionContentType})]})}function fg(t){return eg("button",{className:"form-cancel",onClick:t.onClick,disabled:yf(zp).isPreviewMode,"aria-label":"Close survey",type:"button",children:ug({fill:"black"})})}eg("svg",{width:"16",height:"12",viewBox:"0 0 16 12",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:eg("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 pg=t;function gg(t){var e=t.header,i=t.description,r=t.contentType,n=t.forceDisableHtml,s=t.appearance,a=t.onClose,o=yf(zp).isPopup;return pf((()=>{var t=t=>{"Enter"!==t.key&&"Escape"!==t.key||(t.preventDefault(),a())};return Yi(pg,"keydown",t),()=>{pg.removeEventListener("keydown",t)}}),[a]),eg("div",{className:"thank-you-message",role:"status",tabIndex:0,"aria-atomic":"true",children:[o&&!0!==s.hideCancelButton&&eg(fg,{onClick:()=>a()}),eg("h3",{className:"thank-you-message-header",children:e}),i&&Wp({component:Rc("p",{className:"thank-you-message-body"}),children:i,renderAsHtml:!n&&"text"!==r}),o&&eg(vg,{text:s.thankYouMessageCloseButtonText||"Close",submitDisabled:!1,appearance:s,onSubmit:()=>a()})]})}function mg(t){var e=t.header,i=t.description,r=t.contentType,n=t.forceDisableHtml,s=t.appearance,a=t.onStart,o=yf(zp),l=o.onPreviewSubmit,u=o.onPopupSurveyDismissed;return eg("div",{className:"intro-screen",role:"status",tabIndex:0,"aria-atomic":"true",children:[o.isPopup&&!0!==s.hideCancelButton&&eg(fg,{onClick:()=>u()}),e&&eg("h3",{className:"intro-screen-header",children:e}),i&&Wp({component:Rc("p",{className:"intro-screen-body"}),children:i,renderAsHtml:!n&&"text"!==r}),eg(vg,{text:s.introScreenButtonText||"Get started",submitDisabled:!1,appearance:s,onSubmit:a,onPreviewSubmit:()=>l(null)})]})}var yg=t=>G(t)&&t.every((t=>Y(t)));function bg(t){var e=t.question,i=t.forceDisableHtml,r=t.appearance,n=t.onSubmit,s=t.onPreviewSubmit,a=t.displayQuestionIndex,o=t.initialValue,l=t.canGoBack,u=t.onBack,h=Up().isPreviewMode,d=gf(null),v=ff((()=>Y(o)?o:"")),c=v[0],f=v[1],p=null==r?void 0:r.disableAutofocus;pf((()=>{p||setTimeout((()=>{var t;h||null==(t=d.current)||t.focus()}),100)}),[h,p]);var g="surveyQuestion"+a,m=mf((()=>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 a of e)switch(a.type){case C:if(void 0!==a.value&&a.value>s.length)return null!==(r=a.errorMessage)&&void 0!==r?r:"Please enter at least "+a.value+" characters";break;case T:if(void 0!==a.value&&s.length>a.value)return null!==(n=a.errorMessage)&&void 0!==n?n:"Please enter no more than "+a.value+" characters"}return!1}(c,e.validation,e.optional)),[c,e.validation,e.optional]),y=ri(e.validation,C),b=ri(e.validation,T),_=mf((()=>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,b)),[y,b]),w=()=>{m||n(c.trim())},k=()=>{m||s(c.trim())};return eg(Ac,{children:[eg("div",{className:"question-container",children:[eg(cg,{question:e,forceDisableHtml:i,htmlFor:g}),eg("textarea",{ref:d,id:g,rows:4,placeholder:null==r?void 0:r.placeholder,minLength:y,maxLength:b,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}),_&&eg("div",{className:"validation-hint",children:_})]}),eg(vg,{text:e.buttonText||"Submit",submitDisabled:!!m,appearance:r,onSubmit:w,onPreviewSubmit:k,canGoBack:l,onBack:u})]})}function _g(t){var e=t.question,i=t.appearance,r=t.onSubmit,n=t.onPreviewSubmit,s=t.canGoBack,a=t.onBack;return eg(Ac,{children:[eg("div",{className:"question-container",children:eg(cg,{question:e,forceDisableHtml:t.forceDisableHtml})}),eg(vg,{text:e.buttonText||"Submit",submitDisabled:!1,link:e.link,appearance:i,onSubmit:()=>r("link clicked"),onPreviewSubmit:()=>n("link clicked"),canGoBack:s,onBack:a})]})}function wg(t){var e,i=t.question,r=t.forceDisableHtml,n=t.displayQuestionIndex,s=t.appearance,a=t.onSubmit,o=t.onPreviewSubmit,l=t.initialValue,u=t.canGoBack,h=t.onBack,d=i.scale,v=10===i.scale?0:1,c=ff((()=>it(l)?l:G(l)&&l.length>0&&it(parseInt(l[0]))?parseInt(l[0]):Y(l)&&it(parseInt(l))?parseInt(l):null)),f=c[0],p=c[1],g="emoji"===i.display&&2===i.scale,m=Up().isPreviewMode,y=t=>m?o(t):a(t);return eg(Ac,{children:[eg("div",{className:"question-container",children:[eg(cg,{question:i,forceDisableHtml:r}),eg("div",{className:"rating-section",children:[eg("div",{className:"rating-options",children:["emoji"===i.display&&eg("div",{className:"rating-options-emoji"+(g?" rating-options-emoji-2":""),children:null==(e=Mg[i.scale])?void 0:e.map(((t,e)=>eg("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&&eg("div",{className:"rating-options-number",style:{gridTemplateColumns:"repeat("+(d-v+1)+", minmax(0, 1fr))"},children:Eg(i.scale).map(((t,e)=>eg(kg,{displayQuestionIndex:n,active:f===t,appearance:s,num:t,setActiveNumber(t){p(t),i.skipSubmitButton&&y(t)}},e)))})]}),!g&&eg("div",{className:"rating-text",children:[eg("div",{children:i.lowerBoundLabel}),eg("div",{children:i.upperBoundLabel})]})]})]}),eg(vg,{text:i.buttonText||(null==s?void 0:s.submitButtonText)||"Submit",submitDisabled:tt(f)&&!i.optional,appearance:s,onSubmit:()=>a(f),onPreviewSubmit:()=>o(f),skipSubmitButton:i.skipSubmitButton,canGoBack:u,onBack:h})]})}function kg(t){var e=t.num,i=t.setActiveNumber;return eg("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 Sg(t){var e=t.question,i=t.forceDisableHtml,r=t.displayQuestionIndex,n=t.appearance,s=t.onSubmit,a=t.onPreviewSubmit,o=t.initialValue,l=t.canGoBack,u=t.onBack,h=gf(null),d=mf((()=>(t=>{if(!t.shuffleOptions)return t.choices;var e=t.choices,i="";t.hasOpenChoice&&(i=e.pop());var r=qp(e,Np(e));return t.hasOpenChoice&&(t.choices.push(i),r.push(i)),r})(e)),[e]),v=ff((()=>((t,e)=>Y(t)||yg(t)?t:e===Lf.SingleChoice?null:[])(o,e.type))),c=v[0],f=v[1],g=ff((()=>((t,e)=>{if(Y(t)&&!e.includes(t))return{isSelected:!0,inputValue:t};if(yg(t)){var i=t.find((t=>!e.includes(t)));if(i)return{isSelected:!0,inputValue:i}}return{isSelected:!1,inputValue:""}})(o,d))),m=g[0],y=g[1],b=Up().isPreviewMode,_=e.type===Lf.SingleChoice,w=e.type===Lf.MultipleChoice,k=e.skipSubmitButton&&_&&!e.hasOpenChoice,S=(t,e)=>{if(e){var i=!m.isSelected;return y((t=>p({},t,{isSelected:i,inputValue:i?t.inputValue:""}))),_&&f(""),void(i&&setTimeout((()=>{var t;return null==(t=h.current)?void 0:t.focus()}),75))}if(_)return f(t),y((t=>p({},t,{isSelected:!1,inputValue:""}))),void(k&&(s(t),b&&a(t)));w&&G(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}))),_&&f(e)},C=t=>{t.stopPropagation(),"Enter"!==t.key||T()||(t.preventDefault(),M()),"Escape"===t.key&&(t.preventDefault(),y((t=>p({},t,{isSelected:!1,inputValue:""}))),_&&f(null))},T=()=>!(e.optional||!tt(c)&&(!G(c)||m.isSelected||0!==c.length)&&(!m.isSelected||""!==m.inputValue.trim())),M=()=>{m.isSelected&&w?G(c)&&(b?a([...c,m.inputValue]):s([...c,m.inputValue])):b?a(c):s(c)};return eg(Ac,{children:[eg("div",{className:"question-container",children:[eg(cg,{question:e,forceDisableHtml:i}),eg("fieldset",{className:"multiple-choice-options limit-height",children:[eg("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,a=s+"Open",o=n?m.isSelected:_?c===t:G(c)&&c.includes(t);return eg("label",{className:n?"choice-option-open":"",children:[eg("div",{className:"response-choice",children:[eg("input",{type:_?"radio":"checkbox",name:s,checked:o,onChange:()=>S(t,n),id:s,"aria-controls":a}),eg("span",{children:n?t+":":t})]}),n&&eg("input",{type:"text",ref:h,id:a,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)}))]})]}),eg(vg,{text:e.buttonText||"Submit",submitDisabled:T(),appearance:n,onSubmit:M,onPreviewSubmit:M,skipSubmitButton:k,canGoBack:l,onBack:u})]})}var xg=[1,2,3,4,5],Cg=[1,2,3,4,5,6,7],Tg=[0,1,2,3,4,5,6,7,8,9,10],Mg={2:[og,lg],3:[ng,rg,ig],5:[sg,ng,rg,ig,ag]};function Eg(t){switch(t){case 5:default:return xg;case 7:return Cg;case 10:return Tg}}var Ig=Hi("[Surveys]");function Rg(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===Lf.SingleChoice){var a,o=n.choices.indexOf(""+i);if(-1===o&&n.hasOpenChoice&&(o=n.choices.length-1),null!=(a=n.branching)&&null!=(a=a.responseValues)&&a.hasOwnProperty(o)){var l=n.branching.responseValues[o];return Number.isInteger(l)?l:l===Df.End?Df.End:s}}else if(n.type===Lf.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 Ig.warn("Falling back to next question index due to unexpected branching type"),s}var Pg=Hi("[SurveyTranslations]");function Ag(t,e){var i=function(t){return function(t,e){var i=t.storedPersonProperties,r=t.locale,n=po(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?po(t.language):null}(i);if(s)return null==e||e.info("Using person property language: "+s),s;var a=po(r);return a?(null==e||e.info("Using detected locale: "+a),a):(null==e||e.info("No user language detected"),null)}({overrideLanguage:t.config.override_display_language,storedPersonProperties:Z(t.get_property)?t.get_property(es):void 0,locale:zo()},Pg)}(e);if(!i)return Pg.info("No user language detected"),{survey:t,language:null};var r=bo(t,i,Pg);return{survey:r.survey,language:r.matchedKey}}var Fg=-1,Og=t,Lg=r,Dg="ph:show_survey_widget",$g="PHWidgetSurveyClickListener";function Ng(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 a=r-i.bottom,o=250>a&&i.top>a;return{position:"fixed",top:o?"auto":i.bottom+12+"px",left:s+"px",right:"auto",bottom:o?r-i.top+12+"px":"auto",zIndex:Ip.zIndex}}catch(t){return Bf.warn("Failed to calculate trigger position:",t),null}}class qg{constructor(t){var e=this;this.ai=new Map,this.oi=new Map,this.si=new Map,this.ui=new Set,this.li=null,this.hi=!1,this.ci=null,this.di=null,this.vi=null,this.handlePageUnload=()=>{var t=this._posthog.get_property(ns);if(t)for(var e of t)Jp(e)&&$p(e,this._posthog)},this.handlePopoverSurvey=function(t,i,r){var n,s,a,o,l,u=(void 0===r?{}:r).resumeDelayFromActivation,h=void 0!==u&&u,d=e.fi(t),v=d.survey,c=d.language;e.li=c,e.vi=null,e.pi=i;var f=e.gi(v,i);e.mi(f.id);var g=null!=i?i:{},m=g.properties,y=g.initialResponses,b=!(!y||0>=Object.keys(y).length)&&e.yi(f,y,m,c);if(!b||null!=(n=f.appearance)&&n.displayThankYouMessage){e.bi(f);var _={};if((null==(s=f.appearance)?void 0:s.position)===Af.NextToTrigger&&null!=(a=f.appearance)&&a.widgetSelector){var w,k=Lg.querySelector(f.appearance.widgetSelector);k&&(_=Ng(k,parseInt((null==(w=f.appearance)?void 0:w.maxWidth)||Ip.maxWidth))||{})}var S=(null==(o=f.appearance)?void 0:o.surveyPopupDelaySeconds)||0,x=Fp(f,e._posthog).shadow;e.si.set(x,x.host);var C={posthog:e._posthog,survey:f,removeSurveyFromFocus:e.wi,properties:m,style:_,isSurveyCompleted:b,skipShownEvent:null==i?void 0:i.skipShownEvent,surveyLanguage:c};if(e.vi=C,0>=S)return e.hi=!0,Yc(eg(Ug,p({},C)),x);var T=()=>{if(!e.ki(f))return Bf.info("Survey "+f.id+" no longer eligible when its display delay elapsed; not displaying"),e.wi(f);(()=>{e.hi=!0;var r=e.fi(t),n=r.survey,s=r.language;e.li=s;var a=e.gi(n,i),o=p({},C,{survey:a,surveyLanguage:s});e.vi=o,Yc(eg(Ug,p({},o,{survey:p({},a,{appearance:p({},a.appearance,{surveyPopupDelaySeconds:0})})})),x)})()},M=h?null==(l=e._posthog.surveys)||null==(l=l._surveyEventReceiver)||null==l.getActivationTimestamp?void 0:l.getActivationTimestamp(f.id):void 0,E=it(M)?Math.max(0,Date.now()-M):0,I=Math.max(0,1e3*S-E);if(0>=I)return T();var R=Og.setTimeout((()=>{e.ai.delete(f.id),T()}),I);e.ai.set(f.id,R)}},this.Si=t=>{var e=this.fi(t),i=e.survey,r=e.language,n=Fp(i,this._posthog),s=n.shadow,a=n.isNewlyCreated;this.si.set(s,s.host),a&&Yc(eg(Vg,{posthog:this._posthog,survey:i,surveyLanguage:r},t.id),s)},this.xi=t=>{var e=this.oi.get(t);e&&(e.element.removeEventListener("click",e.listener),e.element.removeAttribute($g),this.oi.delete(t),Bf.info("Removed click listener for survey "+t))},this.Ci=t=>{this.Mi(t)||(this.Ti(t),this.xi(t.id))},this.Mi=t=>{try{var e,i=Lg.querySelector(Yp(t,!0));return!(null==i||null==(e=i.shadowRoot)||!e.querySelector(".ph-survey"))}catch(t){return!1}},this.Ii=(t,e)=>{var i=Lg.querySelector(e),r=this.oi.get(t.id);if(i){if(this.Si(t),r){if(i===r.element)return;Bf.info("Selector element changed for survey "+t.id+". Re-attaching listener."),this.xi(t.id)}if(!i.hasAttribute($g)){var n=e=>{var i,r;e.stopPropagation();var n=(null==(i=t.appearance)?void 0:i.position)===Af.NextToTrigger?Ng(e.currentTarget,parseInt((null==(r=t.appearance)?void 0:r.maxWidth)||Ip.maxWidth)):{};Og.dispatchEvent(new CustomEvent(Dg,{detail:{surveyId:t.id,position:n}}))};Yi(i,"click",n),i.setAttribute($g,"true"),this.oi.set(t.id,{element:i,listener:n,survey:t}),Bf.info("Attached click listener for feedback button survey "+t.id)}}else r&&this.Ci(t)},this.renderPopover=t=>{var e=this.fi(t),i=e.survey,r=e.language,n=Fp(i,this._posthog).shadow;this.si.set(n,n.host),Yc(eg(Ug,{posthog:this._posthog,survey:i,removeSurveyFromFocus:this.wi,surveyLanguage:r}),n)},this.renderSurvey=(t,e,i)=>{var r,n=this.fi(t),s=n.survey,a=n.language,o=!1;null!=(r=this._posthog.config)&&null!=(r=r.surveys)&&r.prefillFromUrl&&(o=this.Ei(s,a,i)),Yc(eg(Ug,{posthog:this._posthog,survey:s,removeSurveyFromFocus:this.wi,isPopup:!1,properties:i,isSurveyCompleted:o,surveyLanguage:a}),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.ki(t)));t(r)}),i)},this.callSurveysAndEvaluateDisplayLogic=function(t){void 0===t&&(t=!1),e.getActiveMatchingSurveys((t=>{var i=t.filter((t=>t.type===Of.Popover||t.type===Of.Widget)),r=new Set(i.map((t=>t.id)));for(var n of Array.from(e.ai.keys()))r.has(n)||e.cancelSurvey(n);var s=e.Ri(i),a=new Set;s.forEach((t=>{if(t.type===Of.Widget){var i,r,n,s;if((null==(i=t.appearance)?void 0:i.widgetType)===Pf.Tab)return void e.Si(t);(null==(r=t.appearance)?void 0:r.widgetType)===Pf.Selector&&null!=(n=t.appearance)&&n.widgetSelector&&(a.add(t.id),e.Ii(t,null==(s=t.appearance)?void 0:s.widgetSelector))}tt(e.Ai)&&t.type===Of.Popover&&e.handlePopoverSurvey(t,void 0,{resumeDelayFromActivation:!0})})),e.oi.forEach((t=>{var i=t.survey;a.has(i.id)||e.Ci(i)}))}),t)},this.bi=t=>{tt(this.Ai)||Bf.error("Survey "+this.Ai+" already in focus. Cannot add survey "+t.id+"."),this.Ai=t.id},this.wi=t=>{this.Ai!==t.id&&Bf.error("Survey "+t.id+" is not in focus. Cannot remove survey "+t.id+"."),this.mi(t.id),this.Ai=null,this.li=null,this.hi=!1,this.vi=null,this.pi=void 0,this.Ti(t)},this._posthog=t,this.Ai=null,this.ci=()=>this.Li(),Yi(Og,"languagechange",this.ci),this.di=t.onFeatureFlags((()=>this.Li()))}Li(){if(!tt(this.Ai)){var t=this._posthog.get_property(ns),e=null==t?void 0:t.find((t=>t.id===this.Ai));if(e){var i=this.fi(e),r=i.survey,n=i.language;if(n!==this.li&&(this.li=n,this.hi)){var s=this.gi(r,this.pi),a=Fp(s,this._posthog).shadow;Yc(eg(Ug,p({},this.vi,{posthog:this._posthog,survey:s,removeSurveyFromFocus:this.wi,surveyLanguage:n})),a)}}}}get Oi(){var t,e,i;return null!==(t=null==(e=(i=this._posthog).getExtension)?void 0:e.call(i,Kf))&&void 0!==t?t:this._posthog.featureFlags}gi(t,e){return null!=e&&e.position||null!=e&&e.selector?p({},t,{appearance:p({},t.appearance,e.position&&{position:e.position},e.selector&&{widgetSelector:e.selector})}):t}mi(t){var e=this.ai.get(t);e&&(clearTimeout(e),this.ai.delete(t))}cancelSurvey(t){this.ai.has(t)&&(Bf.info("Cancelled pending survey "+t),this.mi(t),this.Ai===t&&(this.Ai=null,this.li=null,this.hi=!1,this.vi=null,this.pi=void 0))}setAutomaticDisplayDispose(t){this.Pi=t}dispose(){var t;null==(t=this.Pi)||t.call(this),this.Pi=void 0,this.ci&&(Og.removeEventListener("languagechange",this.ci),this.ci=null),this.di&&(this.di(),this.di=null),this.ai.forEach(((t,e)=>this.mi(e))),this.oi.forEach(((t,e)=>this.xi(e))),this.si.forEach(((t,e)=>{Yc(null,e),null==t||t.remove()})),this.si.clear(),this.Ai=null}Ri(t){return t.sort(((t,e)=>{var i,r,n=Jp(t),s=Jp(e);if(n&&!s)return-1;if(!n&&s)return 1;var a=t.schedule===$f,o=e.schedule===$f;return a&&!o?1:!a&&o?-1:((null==(i=t.appearance)?void 0:i.surveyPopupDelaySeconds)||0)-((null==(r=e.appearance)?void 0:r.surveyPopupDelaySeconds)||0)}))}fi(t){return Ag(t,this._posthog)}Ei(t,e,i){if(this.ui.has(t.id))return!1;var r=function(t){var e={},i=!1,r=t.replace(/^\?/,"");if(!r)return{params:e,autoSubmit:i};var n=r.split("&");for(var s of n){var a=s.split("="),o=a[0],l=a[1];if(o&&!K(l)){var u=decodeURIComponent(o),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}}(Og.location.search),n=r.params;if(0===Object.keys(n).length)return!1;Bf.info("[Survey Prefill] Detected URL prefill parameters");var s=this.Di(t,n,e);return!!s&&(this.Fi(t,s,i,e),this.ui.add(t.id),s.isSurveyCompleted)}Fi(t,e,i,r){var n=e.responses,s=e.submissionId,a=e.isSurveyCompleted,o=e.skippedResponses;(Object.keys(o).length>0&&t.enable_partial_responses||a)&&Op({responses:a?n:o,survey:t,surveySubmissionId:s,posthog:this._posthog,isSurveyCompleted:a,properties:i,surveyLanguage:r})}yi(t,e,i,r){var n={};for(var s of Object.entries(e)){var a=s[1];n[parseInt(s[0])]=G(a)?a.map(String):[String(a)]}Bf.info("[Survey] Processing initial responses");var o=this.Di(t,n,r);return!!o&&(this.Fi(t,o,i,r),o.isSurveyCompleted)}Di(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=ho(t.id);try{switch(t.type){case Lf.SingleChoice:if(!t.choices||0===t.choices.length)return void Bi.warn("[Survey Prefill] Question "+r+" has no choices");var a=parseInt(n[0],10);if(isNaN(a)||0>a||a>=t.choices.length)return void Bi.warn("[Survey Prefill] Invalid choice index for q"+r+": "+n[0]);i[s]=t.choices[a];break;case Lf.MultipleChoice:if(!t.choices||0===t.choices.length)return void Bi.warn("[Survey Prefill] Question "+r+" has no choices");var o=n.map((t=>parseInt(t,10))).filter((e=>!isNaN(e)&&e>=0&&t.choices.length>e));if(0===o.length)return void Bi.warn("[Survey Prefill] No valid choices for q"+r);var l=[...new Set(o.map((e=>t.choices[e])))];o.length>l.length&&Bi.warn("[Survey Prefill] Removed duplicate choices for q"+r),i[s]=l;break;case Lf.Rating:var u=parseInt(n[0],10),h=t.scale||10;if(isNaN(u)||0>u||u>h)return void Bi.warn("[Survey Prefill] Invalid rating for q"+r+": "+n[0]+" (scale: 0-"+h+")");i[s]=u;break;default:Bi.info("[Survey Prefill] Question type "+t.type+" does not support prefill")}}catch(t){Bi.error("[Survey Prefill] Error converting q"+r+":",t)}}})),i}(t,e);if(0===Object.keys(r).length)return Bf.warn("[Survey Prefill] No valid responses after conversion"),null;var n=np(),s=Object.keys(e).map((t=>parseInt(t,10))),a=function(t,e,i){for(var r=0,n={},s=[],a=t.questions.length+1,o=0;t.questions.length>r&&a>o&&(o++,e.includes(r));){var l=t.questions[r];if(!l||!("skipSubmitButton"in l)||!l.skipSubmitButton)break;if(l.id){var u=ho(l.id);K(i[u])||(n[u]=i[u])}s.push(r);var h=Rg(t,r,l.id?i[ho(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),o=a.startQuestionIndex,l=a.skippedResponses,u=a.skippedIndices,h=o>=t.questions.length;return Zp(t,{surveySubmissionId:n,responses:r,lastQuestionIndex:o,questionOrder:jp(t.questions),visitedIndices:u,surveyLanguage:i}),Bf.info("[Survey Prefill] Stored prefilled responses in localStorage"),{responses:r,submissionId:n,startQuestionIndex:o,isSurveyCompleted:h,skippedResponses:l}}catch(t){return Bf.error("[Survey Prefill] Error handling prefill:",t),null}}Ni(t,e){if(void 0===e&&(e=void 0),!t)return!0;var i=this.Oi,r=!(null==i||!i.isFeatureEnabled(t,{send_event:!t.startsWith("survey-targeting-")})),n=!0;return e&&(n=(null==i?void 0:i.getFeatureFlag(t,{send_event:!1}))===e||"any"===e),r&&n}qi(e){return!e.conditions||Vp(e,this._posthog)&&function(e){var r,n;return function(e,r){var n,s,a;if(!e||0===e.length)return!0;if(!u)return!1;var o=ke(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==(a=t.screen)?void 0:a.height,devicePixelRatio:null==t?void 0:t.devicePixelRatio});return xo[null!=r?r:"icontains"](e,[o])}(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==Mp||!Mp.querySelector(t.conditions.selector))}(e)}ji(t){var e;return Hp(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.Oi)&&e.hasLoadedFlags?{satisfied:this.Ni(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(!Hf(t))return r.eligible=!1,r.reason="Survey is not running. It was completed on "+t.end_date,r;if(!Qf.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.Ni(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.Ni(t.targeting_flag_key))return r.eligible=!1,r.reason="Survey targeting feature flag is not enabled",r;var s,a=this.ji(t);return a.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,hp.ti("lastSeenSurveyDate"))?(t=>!!hp.ti(Gf(t))&&!Hp(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=a.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.Bi(t)?{eligible:!1,reason:"Survey event/action trigger has not been fired yet"}:e}Bi(t){var e;if(!_o(t)&&!zf(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))}Hi(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.Ni(e)}))}ki(t){return this.checkSurveyEligibility(t).eligible&&this.qi(t)&&this.Bi(t)&&this.Hi(t)}Ti(t){try{var e=Lg.querySelector(Yp(t,!0));null!=e&&e.shadowRoot&&(Yc(null,e.shadowRoot),this.si.delete(e.shadowRoot)),null==e||e.remove()}catch(e){Bf.warn("Failed to remove survey "+t.id+" from DOM:",e)}}getTestAPI(){return{addSurveyToFocus:this.bi,removeSurveyFromFocus:this.wi,surveyInFocus:this.Ai,surveyTimeouts:this.ai,handleWidget:this.Si,handlePopoverSurvey:this.handlePopoverSurvey,manageWidgetSelectorListener:this.Ii,sortSurveysByAppearanceDelay:this.Ri,checkFlags:this.Hi.bind(this),isSurveyFeatureFlagEnabled:this.Ni.bind(this),onLanguageChange:this.Li.bind(this),currentLanguage:this.li,surveyIsRendered:this.hi}}}function jg(t,e){if(Lg&&Og){var i,r=new qg(t);if(t.config.disable_surveys_automatic_display)return Bf.info("Surveys automatic display is disabled. Skipping call surveys and evaluate display logic."),r;if(!1===e)return Bf.info("There are no surveys to load or Surveys is disabled in the project settings."),r;r.callSurveysAndEvaluateDisplayLogic(!0);var n=()=>{K(i)&&(i=setInterval((()=>{r.callSurveysAndEvaluateDisplayLogic(!1)}),1e3))},s=()=>{K(i)||(clearInterval(i),i=void 0)};n();var a=()=>{Lg.hidden?s():(r.callSurveysAndEvaluateDisplayLogic(!1),n())};return Yi(Lg,"visibilitychange",a),r.setAutomaticDisplayDispose((()=>{s(),Lg.removeEventListener("visibilitychange",a)})),r}}function Bg(t){var e=t.survey,i=t.removeSurveyFromFocus,r=void 0===i?()=>{}:i,n=t.setSurveyVisible,s=t.isPreviewMode,a=void 0!==s&&s,o=t.posthog;pf((()=>{var t;if(!a&&null!=(t=e.conditions)&&t.url){var i=()=>{var t,i=e.type===Of.Widget,s=Vp(e,o),a=(null==(t=e.appearance)?void 0:t.widgetType)===Pf.Tab&&i;if(!s)return Bf.info("Hiding survey "+e.id+" because URL does not match"),n(!1),r(e);a&&(Bf.info("Showing survey "+e.id+" because it is a feedback button tab and URL matches"),n(!0))};Yi(Og,"popstate",i),Yi(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}}}),[a,e,r,n,o])}var Hg=200;function zg(t){switch(void 0===t&&(t=Ff.Right),t){case Ff.Top:return{top:"0",left:"50%",transform:"translateX(-50%)"};case Ff.Left:return{top:"50%",left:"0",transform:"rotate(90deg) translateY(-100%)",transformOrigin:"left top"};case Ff.Bottom:return{bottom:"0",left:"50%",transform:"translateX(-50%)"};default:return{top:"50%",right:"0",transform:"rotate(-90deg) translateY(-100%)",transformOrigin:"right top"}}}function Ug(t){var e,i,r,n,s,a,o,l,u,h,d,v,c=t.survey,f=t.forceDisableHtml,g=t.posthog,m=t.style,y=void 0===m?{}:m,b=t.previewPageIndex,_=t.removeSurveyFromFocus,w=void 0===_?()=>{}:_,k=t.isPopup,S=void 0===k||k,x=t.onPreviewSubmit,C=void 0===x?()=>{}:x,T=t.onPreviewBack,M=void 0===T?()=>{}:T,E=t.onPopupSurveyDismissed,I=void 0===E?()=>{}:E,R=t.onCloseConfirmationMessage,P=void 0===R?()=>{}:R,A=t.properties,F=t.isSurveyCompleted,O=t.skipShownEvent,L=t.surveyLanguage,D=gf(null),N=Number.isInteger(b),q=null!=(e=c.appearance)&&e.surveyPopupDelaySeconds?1e3*c.appearance.surveyPopupDelaySeconds:0,j=function(t,e,i,r,n,s,a,o,l){var u=ff(r||0===i||t.type===Of.ExternalSurvey),h=u[0],d=u[1],v=ff(!1),c=v[0],f=v[1],g=gf(!1),m=()=>{var e=()=>{s&&n(t),d(!1)};if(!g.current){var i=null==a?void 0:a.current;i?(g.current=!0,i.style.transition="opacity "+Hg+"ms ease-out",i.style.opacity="0",setTimeout((()=>{g.current=!1,e()}),Hg+50)):e()}},y=e=>{e.detail.surveyId===t.id&&m()};return pf((()=>{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))}},a=()=>{if(Vp(t,e)){d(!0),Og.dispatchEvent(new Event("PHSurveyShown")),o||e.capture(Nf.SHOWN,p({[qf.SURVEY_NAME]:t.name,[qf.SURVEY_ID]:t.id,[qf.SURVEY_ITERATION]:t.current_iteration,[qf.SURVEY_ITERATION_START_DATE]:t.current_iteration_start_date},l&&{[qf.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){}}};Yi(Og,"PHSurveyClosed",y),Yi(Og,"PHSurveySent",s);var u=i>0?setTimeout(a,i):void 0;return K(u)&&a(),()=>{K(u)||clearTimeout(u),K(n)||clearTimeout(n),Og.removeEventListener("PHSurveyClosed",y),Og.removeEventListener("PHSurveySent",s)}}}else Bf.error("usePopupVisibility hook called without a PostHog instance.")}),[]),Bg({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,O,L),B=j.isPopupVisible,H=j.hidePopupWithAnimation,z=j.isSurveySent||b===c.questions.length||!0===F,U=ff(!1),W=U[0],V=U[1],G=mf((()=>!!Qp(c)),[c]),Z=!!(null!=(i=c.appearance)&&i.introScreenHeader||null!=(r=c.appearance)&&r.introScreenDescription),Q=N?b===Fg:!(null==(n=c.appearance)||!n.displayIntroScreen)&&Z&&!W&&!G,J=mf((()=>{var t=Qp(c),e=(null==t?void 0:t.surveySubmissionId)||np();return{isPreviewMode:N,previewPageIndex:b,onPopupSurveyDismissed(){L?Dp(c,g,N,L):Dp(c,g,N),I()},isPopup:S||!1,surveySubmissionId:e,onPreviewSubmit:C,onPreviewBack:M,posthog:g,properties:A,surveyLanguage:L}}),[N,b,S,g,c,I,C,M,A,L]);return B?eg(zp.Provider,{value:J,children:eg("div",{className:"ph-survey",style:p({},Xp(c.type,null==(s=c.appearance)?void 0:s.position,null==(a=c.appearance)?void 0:a.widgetType),y),ref:D,children:z?eg(gg,{header:(null==(o=c.appearance)?void 0:o.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(){H(),P()}}):Q?eg(mg,{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)}):eg(Wg,{survey:c,forceDisableHtml:!!f,posthog:g})})}):null}function Wg(t){var e,i,r=t.survey,n=t.forceDisableHtml,s=t.posthog,a=mf((()=>{var t=Qp(r);if(!t)return null;var e=it(t.lastQuestionIndex);return!e||e&&t.lastQuestionIndex>=0&&r.questions.length>t.lastQuestionIndex?t:(Kp(r),null)}),[r]),o=ff((()=>(null!=a&&a.responses&&Bf.info("Survey is already in progress, filling in initial responses"),(null==a?void 0:a.responses)||{}))),l=o[0],u=o[1],h=yf(zp),d=h.previewPageIndex,v=h.onPopupSurveyDismissed,c=h.isPopup,f=h.onPreviewSubmit,g=h.onPreviewBack,m=h.surveySubmissionId,y=h.isPreviewMode,b=h.properties,_=h.surveyLanguage,w=ff((()=>{var t=null==a?void 0:a.lastQuestionIndex,e=it(t)&&t>=0&&r.questions.length>t?t:0;return it(d)&&d>=0?d:e})),k=w[0],S=w[1],x=ff((()=>{var t;return(null!==(t=null==a?void 0:a.visitedIndices)&&void 0!==t?t:[]).filter((t=>t>=0&&r.questions.length>t))})),C=x[0],T=x[1],M=ff((()=>{var t,e=Qp(r);return null!==(t=null==e?void 0:e.questionSnapshots)&&void 0!==t?t:{}})),E=M[0],I=M[1],R=mf((()=>jp(Bp(r,a))),[r.id,a]),P=mf((()=>{if(!R||new Set(R).size!==R.length)return Bp(r,a);var t=new Map(r.questions.map((t=>[t.id,t]))),e=R.map((e=>t.get(e))).filter((t=>!!t));return e.length===R.length?e:r.questions}),[R,r.questions,r,a]);pf((()=>{!y||K(d)||0>d||S(d)}),[d,y]);var A=!(null==(e=r.appearance)||!e.allowGoBack)&&(y?(null!=d?d:0)>0:C.length>0),F=P.at(k);return F?eg("form",{className:"survey-form",name:"surveyForm",children:[c&&!0!==(null==(i=r.appearance)?void 0:i.hideCancelButton)&&eg(fg,{onClick(){v()}}),eg("div",{className:"survey-box","data-question-index":k,children:Gg({question:F,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 a=ho(n),o=p({},l,{[a]:e});u(o);var h=P[i],d=null!=h&&h.id?p({},E,{[h.id]:h.question}):E;I(d);var v=Rg(r,i,e),c=v===Df.End,f=[...C,i];if(c||(T(f),S(v),Zp(r,{surveySubmissionId:m,responses:o,lastQuestionIndex:v,questionOrder:jp(P),visitedIndices:f,surveyLanguage:_,questionSnapshots:d})),r.enable_partial_responses||c){var g=new Set(f.map((t=>{var e;return null==(e=P[t])?void 0:e.id})).filter((t=>!!t)).map((t=>ho(t)))),y=Object.fromEntries(Object.entries(o).filter((t=>g.has(t[0]))));Op({responses:y,survey:r,surveySubmissionId:m,isSurveyCompleted:c,posthog:s,properties:b,surveyLanguage:_,questionSnapshots:d})}}else Bf.error("onNextButtonClick called without a questionId.");else Bf.error("onNextButtonClick called without a PostHog instance.")})({res:t,displayQuestionIndex:k,questionId:F.id}),onPreviewSubmit:f,initialValue:F.id?l[ho(F.id)]:void 0,canGoBack:A,onBack(){if(y)g();else if(0!==C.length){var t=C[C.length-1],e=C.slice(0,-1);T(e),S(t),Zp(r,{surveySubmissionId:m,responses:l,lastQuestionIndex:t,questionOrder:jp(P),visitedIndices:e,surveyLanguage:_,questionSnapshots:E})}}})})]}):null}function Vg(t){var e,i,r,n,s,a,o,l=t.survey,u=t.forceDisableHtml,h=t.posthog,d=t.readOnly,v=t.surveyLanguage,c=ff(!0),f=c[0],p=c[1],g=ff(!1),m=g[0],y=g[1],b=ff({}),_=b[0],w=b[1],k=gf(void 0),S=()=>{y(!m)};if(pf((()=>{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&&(Bf.info("Received show event for feedback button survey "+l.id),w(i.detail.position||{}),S())};return Yi(Og,Dg,e),()=>{K(k.current)||(clearTimeout(k.current),k.current=void 0),Og.removeEventListener(Dg,e)}}}else Bf.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]),Bg({survey:l,setSurveyVisible:p,posthog:h}),!f)return null;var x=()=>{l.schedule!==$f&&p(!1),K(k.current)||clearTimeout(k.current),k.current=setTimeout((()=>{k.current=void 0,y(!1)}),200)};return eg(Ac,{children:["tab"===(null==(n=l.appearance)?void 0:n.widgetType)&&eg("button",{className:"ph-survey-widget-tab "+((null==(s=l.appearance)?void 0:s.tabPosition)===Ff.Top?"widget-tab-top":""),onClick:S,disabled:d,style:zg(null==(a=l.appearance)?void 0:a.tabPosition),children:(null==(o=l.appearance)?void 0:o.widgetLabel)||""}),m&&eg(Ug,{posthog:h,survey:l,forceDisableHtml:u,style:_,onPopupSurveyDismissed:x,onCloseConfirmationMessage:x,surveyLanguage:v})]})}var Gg=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 Lf.Open:return Rc(bg,p({},n,{question:e,key:e.id}));case Lf.Link:return Rc(_g,p({},n,{question:e,key:e.id}));case Lf.Rating:return Rc(wg,p({},n,{question:e,key:e.id}));case Lf.SingleChoice:case Lf.MultipleChoice:return Rc(Sg,p({},n,{question:e,key:e.id}));default:return Bf.error("Unsupported question type: "+e.type),null}};v.__PosthogExtensions__=v.__PosthogExtensions__||{},v.__PosthogExtensions__.generateSurveys=jg,v.extendPostHogWithSurveys=jg;var Zg=t=>{for(;null!=(e=t)&&e.__rrweb_original__;){var e;t=t.__rrweb_original__}return t},Qg=1e4,Jg=(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),Kg=(t,e,i)=>{var r=JSON.stringify(t);if(i.remaining>=r.length)return Jg(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 a=Math.ceil((n+s)/2);JSON.stringify(t.slice(0,a)).length>i.remaining?s=a-1:n=a}return Jg(e,JSON.stringify(t.slice(0,n)),i)},Yg=t=>void 0!==t&&"function"!=typeof t&&"symbol"!=typeof t&&"bigint"!=typeof t,Xg=(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}},tm=(t,e,i)=>{if(!i.truncated)if(Q(t)){if(i.seen.has(t))return void Xg(e||"circular","[Circular]",i);i.seen.add(t);try{for(var r in t)try{if(!{}.hasOwnProperty.call(t,r))continue;if(tm(t[r],e?e+"."+r:r,i),i.truncated)return}catch(t){continue}}catch(t){}}else Xg(e,t,i)},em=function(t,e,i,r,n,s){if(void 0===n&&(n=!1),!Yg(t))return!n||Jg(e,"null",i);if(tt(t)||(t=>{try{return it(t)||nt(t)}catch(t){return!1}})(t))return Jg(e,JSON.stringify(t),i);if("string"==typeof t)return Kg(t,e,i);if(!Q(t)&&!G(t))return Jg(e,JSON.stringify(t),i);if(r.has(t))return Kg("[Circular]",e,i);r.add(t);try{var a=t.toJSON;if(Z(a))return em(a.call(t),e,i,r,n)}catch(t){}try{var o={}.toString.call(t);if("[object String]"===o)return Kg(String(t.valueOf()),e,i);if("[object Number]"===o||"[object Boolean]"===o)return Jg(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 em(l,e,i,r,n,s)}if(G(t)){if(!Jg(e,"[",i))return!1;for(var h=0;t.length>h;h++){if(h>0&&!Jg(e,",",i))return!1;var d=void 0;try{d=t[h]}catch(t){d=void 0}if(!em(d,e,i,r,!0))return!1}return Jg(e,"]",i)}if(!Jg(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{tm(f,c,s)}catch(t){}if(Yg(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(!Jg(e,p,i))return!1;var b=e.length,_=em(f,e,i,r,!1),w=i.truncated;if(e.length!==b){if(v=!1,!_)return!1}else if(e.length=g,i.remaining=m,i.truncated=_?y:w,!_)return!1}}}catch(t){}return Jg(e,"}",i)},im=(t,e)=>{for(var i=[],r={remaining:e,truncated:!1},n=Q(t[0])?{result:{},keysRemaining:50,sizeRemaining:Qg,truncated:!1,seen:new WeakSet([t[0]])}:void 0,s=0;t.length>s&&(0>=s||Jg(i," ",r))&&em(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)||{}}},rm={debug:"debug",log:"info",warn:"warn",error:"error",info:"info"},nm=t=>"canCapture"in t,sm=t=>nm(t)?t.canCapture?t.getExtension(Yf):void 0:t.is_capturing()?t.logs:void 0;v.__PosthogExtensions__=v.__PosthogExtensions__||{},v.__PosthogExtensions__.logs={initializeLogs(t){var e=t,i=[],r={host:v.location.host},n=!1,s=function(t){var s=v.console[t];i.push(Dv(v.console,t,(i=>{var a=(i=>function(){for(var s=!1,a=arguments.length,o=new Array(a),l=0;a>l;l++)o[l]=arguments[l];try{var u=e;if(o.length>0&&!n&&u){var h=sm(u);if(h){n=!0,s=!0;var d=im(o,Qg),c=d.body,f=d.attributes,g=p({},r,d.truncated?{body_truncated:"true"}:{});((t,e,i)=>{if(nm(t))e.captureConsoleLog(i);else{var r=(t=>{var e=/^1\.(\d+)\.(\d+)$/.exec(t);if(e){var i=Number(e[1]),r=Number(e[2]);if(i>=392&&419>=i)return 410===i?r>4?r>10?void 0:"de":"le":418===i?r>3?r>10?r>14?r>17?void 0:"vi":"ci":"ui":"he":419===i?r>2?void 0:"vi":410>i?"le":"he"}})(t.version),n=r?e[r]:void 0;Z(n)&&n.call(e,i)}})(u,h,{level:rm[t],body:c,attributes:p({"log.source":"console."+t},g,f)})}}}catch(t){}finally{s&&(n=!1),i.apply(v.console,o)}})(i);return a.__rrweb_original__=Zg(s),a})))};for(var a of Object.keys(rm))s(a);return()=>{e=void 0,i.forEach((t=>t()))}},replayConsoleBuffer(t,e){var i=sm(t);if(i)for(var r of e)try{var n=im(r.args,Qg);null==i.captureBufferedConsoleLog||i.captureBufferedConsoleLog({level:rm[r.level],body:n.body,attributes:p({"log.source":"console."+r.level,host:v.location.host},n.truncated?{body_truncated:"true"}:{},n.attributes)},r.context,r.occurredAtMs)}catch(t){}}};var am=Hi("[Error tracking]"),om=["chrome-extension://","moz-extension://","safari-extension:","safari-web-extension:"],lm=["__firefox__","__gCrWeb"];function um(){return new li([new wi,new Pi,new Si,new ki,new Ii,new Ei,new Ci,new Ri],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"),a=r;s.length>a;a++){var o=s[a];if(1024>=o.length){var l=bi.test(o)?o.replace(bi,"$1"):o;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||ui});var i}))}(n)}}("web:javascript",pi,yi))}var hm=Hi("[ExceptionAutocapture]"),dm=um(),vm=e=>{var i=t;i||hm.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 a=dm.buildFromUnknown((t=>{var e=t[0],i=t[1],r=t[2],n=t[3],s=t[4];if(null!=s)return s;if(Y(e)&&Y(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(a),!!Z(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}},cm=function(e,i){void 0===i&&(i=!1);var r=t;r||hm.info("window not available, cannot wrap onUnhandledRejection");var n=r.onunhandledrejection;return r.onunhandledrejection=function(t){var r,s=dm.buildFromUnknown(t,{mechanism:{handled:!1}});return e(s),Z(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}},fm={wrapOnError:vm,wrapUnhandledRejection:cm,wrapConsoleError(t){var e=console;e||hm.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 a=n.find((t=>t instanceof Error)),o=dm.buildFromUnknown(a||e,{mechanism:{handled:!1},syntheticException:new Error("PostHog syntheticException"),skipFirstLines:2});t(o),Z(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=fm,v.posthogErrorWrappingFunctions=fm;var pm=(t,e)=>{if(Z(null==t?void 0:t.capture)){var i=null==e?void 0:e.autocaptureExceptions,r=!tt(i)&&"object"==typeof i&&G(i.errors_to_ignore)?i.errors_to_ignore.reduce(((t,e)=>{try{t.push(new RegExp(e))}catch(t){hm.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){hm.error("Failed to capture exception for a legacy client",t)}};vm((t=>{r.some((e=>t.$exception_list.some((t=>e.test(t.value||"")))))||n(t)})),cm(n,!0)}};v.extendPostHogWithExceptionAutoCapture=pm,v.extendPostHogWithExceptionAutocapture=pm;var gm="X-POSTHOG-SESSION-ID",mm="X-POSTHOG-WINDOW-ID",ym="X-POSTHOG-DISTINCT-ID",bm=[gm,mm,ym],_m=["attributionReporting","body","browsingTopics","cache","credentials","dispatcher","duplex","integrity","keepalive","method","mode","priority","redirect","referrer","referrerPolicy","signal","window"],wm=(t,e)=>({}.hasOwnProperty.call(t,e)),km=t=>"object"==typeof t&&!tt(t)||Z(t),Sm=t=>"undefined"!=typeof Request&&(t instanceof Request||"[object Request]"==={}.toString.call(t)),xm=e=>{try{var i;return Sm(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}},Cm=(t,e,i,r,n)=>{var s;try{s=new URL(r).hostname}catch(t){return!1}if(!t)return!1;if(G(t)&&!t.includes(s))return!1;var a=!1;if(i){var o=i.checkAndGetSessionAndWindowId(!0),l=o.windowId;n.set(gm,o.sessionId),n.set(mm,l),a=!0}var u=(t=>Z(t)?t():t)(e);return u&&u!==ws&&(n.set(ym,u),a=!0),a};v.__PosthogExtensions__=v.__PosthogExtensions__||{};var Tm={_patchFetch:(e,i,r)=>Dv(t,"fetch",(t=>function(n,s){var a=arguments.length>1?[n,s]:[n],o=a;try{var l=xm(n);if(l)if(Sm(n)){var u=new Request(n,s);Cm(e,i,r,u.url,u.headers),o=[u]}else{var h=new Headers(km(s)?s.headers:void 0);if(Cm(e,i,r,l,h)){var d=((t,e)=>{if(K(t)||tt(t))return{headers:e};if(km(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)=>wm(t,e)?Reflect.get(t,e):Reflect.get(i,e,i),has:(t,e)=>wm(t,e)||e in i,ownKeys(t){var e=new Set(Reflect.ownKeys(t));return Reflect.ownKeys(i).forEach((t=>e.add(t))),_m.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&&_m.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&&(o=[n,d])}}}catch(t){o=a}return t.apply(this,o)})),_patchXHR:(e,i,r)=>Dv(t.XMLHttpRequest.prototype,"open",(t=>function(n,s,a,o,l){void 0===a&&(a=!0);var u=this,h=new Headers,d=xm(s);d&&Cm(e,i,r,d,h);var v=t.call(u,n,s,a,o,l);return bm.forEach((t=>{var e=h.get(t);if(e)try{u.setRequestHeader(t,e)}catch(t){}})),v}))};v.__PosthogExtensions__.tracingHeadersPatchFns=Tm,v.postHogTracingHeadersPatchFns=Tm,"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 Mm=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 Em=()=>{var t=performance.getEntriesByType("navigation")[0];if(t&&t.responseStart>0&&t.responseStart<performance.now())return t},Im=t=>{if("loading"===document.readyState)return"loading";var e=Em();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"},Rm=t=>{var e=t.nodeName;return 1===t.nodeType?e.toLowerCase():e.toUpperCase().replace(/^#/,"")},Pm=t=>{var e="";try{for(;9!==(null==(i=t)?void 0:i.nodeType);){var i,r,n=t,s=n.id?"#"+n.id:[Rm(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},Am=new WeakMap;function Fm(t,e){var i=Am.get(e);return i||(i=new WeakMap,Am.set(e,i)),i.get(t)||i.set(t,new e),i.get(t)}var Om=-1,Lm=()=>Om,Dm=t=>{addEventListener("pageshow",(e=>{e.persisted&&(Om=e.timeStamp,t(e))}),!0)},$m=(t,e,i,r)=>{var n,s;return a=>{e.value>=0&&(a||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))}},Nm=t=>{requestAnimationFrame((()=>requestAnimationFrame(t)))},qm=()=>{var t,e;return null!==(t=null==(e=Em())?void 0:e.activationStart)&&void 0!==t?t:0},jm=-1,Bm=new Set,Hm=()=>"hidden"!==document.visibilityState||document.prerendering?1/0:0,zm=t=>{if("hidden"===document.visibilityState){if("visibilitychange"===t.type)for(var e of Bm)e();isFinite(jm)||(jm="visibilitychange"===t.type?t.timeStamp:0,removeEventListener("prerenderingchange",zm,!0))}},Um=function(t){if(void 0===t&&(t=!1),t&&(jm=1/0),0>jm){var e,i=qm(),r=document.prerendering||null==(e=globalThis.performance.getEntriesByType("visibility-state").find((t=>"hidden"===t.name&&t.startTime>=i)))?void 0:e.startTime;jm=null!=r?r:Hm(),addEventListener("visibilitychange",zm,!0),addEventListener("prerenderingchange",zm,!0),Dm((()=>{setTimeout((()=>{jm=Hm()}))}))}return{get firstHiddenTime(){return jm},onHidden(t){Bm.add(t)}}},Wm=function(t,e,i,r,n,s,a){void 0===e&&(e=-1),void 0===r&&(r=0);var o=Em(),l=(null==o?void 0:o.navigationId)||0,u="navigate";return i?u=i:0>Lm()?o&&(document.prerendering||qm()>0?u="prerender":document.wasDiscarded?u="restore":o.type&&(u=o.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==o?void 0:o.name),navigationStartTime:a||0}},Vm=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){}},Gm=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},Zm=(t,e)=>{if(t.set(e.navigationId,e),t.size>2){var i=t.keys().next().value;void 0!==i&&t.delete(i)}},Qm=t=>{var e=!1;return()=>{e||(t(),e=!0)}};let Jm=class{constructor(){this.u=void 0}};var Km,Ym=t=>{document.prerendering?addEventListener("prerenderingchange",t,!0):t()},Xm=[1800,3e3],ty=function(t,e){void 0===e&&(e={});var i=Gm(e);Ym((()=>{var r,n=Fm(e,Jm),s=Um(),a=Wm("FCP"),o=Vm(["paint"],(t=>{for(var e of t)"first-contentful-paint"===e.name&&(o.disconnect(),s.firstHiddenTime>e.startTime&&(a.value=Math.max(e.startTime-qm(),0),a.entries.push(e),a.navigationId=e.navigationId||a.navigationId,r(!0)))}));o&&(r=$m(t,a,Xm,e.reportAllChanges),Dm((i=>{a=Wm("FCP",-1,"back-forward-cache",a.navigationId,a.navigationInteractionId,a.navigationURL,Lm()),r=$m(t,a,Xm,e.reportAllChanges),Nm((()=>{a.value=performance.now()-i.timeStamp,r(!0)}))}))),i&&Vm(["soft-navigation"],(i=>{i.forEach((i=>{n.u&&i.navigationId&&Zm(n.u,i);var s=Math.max((i.presentationTime||i.paintTime||0)-i.startTime,0);a=Wm("FCP",s,"soft-navigation",i.navigationId,i.interactionId,i.name,i.startTime),(r=$m(t,a,Xm,e.reportAllChanges))(!0)}))}),e)}))},ey=[.1,.25],iy=t=>t.find((t=>{var e;return 1===(null==(e=t.node)?void 0:e.nodeType)}))||t[0],ry=0,ny=1/0,sy=0,ay=t=>{for(var e of t)e.interactionId&&(ny=Math.min(ny,e.interactionId),sy=Math.max(sy,e.interactionId),ry=sy?(sy-ny)/7+1:0)},oy=()=>{var t;return Km?ry:null!==(t=performance.interactionCount)&&void 0!==t?t:0},ly=0;let uy=class{constructor(){this.h=[],this.v=new Map,this.p=void 0,this.m=void 0}M(){ly=oy(),this.h.length=0,this.v.clear()}T(t){var e=oy()-ly,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 a of s)this.v.delete(a.id)}null==(n=this.m)||n.call(this,r)}}}};var hy=t=>{var e="requestIdleCallback"in globalThis?1e3:0,i=globalThis.requestIdleCallback||setTimeout,r=globalThis.cancelIdleCallback||clearTimeout;if("hidden"===document.visibilityState)t();else{var n=Qm(t),s=-1,a=()=>{r(s),n()};addEventListener("visibilitychange",a,{once:!0,capture:!0}),s=i((()=>{removeEventListener("visibilitychange",a,{capture:!0}),n()}),{timeout:e})}},dy=[200,500];let vy=class{constructor(){this.p=void 0,this.u=void 0}l(t){var e;null==(e=this.p)||e.call(this,t)}};var cy=[2500,4e3],fy=-1,py=()=>fy,gy=t=>{addEventListener("pageshow",(e=>{e.persisted&&(fy=e.timeStamp,t(e))}),!0)},my=(t,e,i,r)=>{var n,s;return a=>{e.value>=0&&(a||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))}},yy=t=>{requestAnimationFrame((()=>requestAnimationFrame(t)))},by=()=>{var t=performance.getEntriesByType("navigation")[0];if(t&&t.responseStart>0&&t.responseStart<performance.now())return t},_y=()=>{var t,e;return null!==(t=null==(e=by())?void 0:e.activationStart)&&void 0!==t?t:0},wy=-1,ky=new Set,Sy=()=>"hidden"!==document.visibilityState||document.prerendering?1/0:0,xy=t=>{if("hidden"===document.visibilityState){if("visibilitychange"===t.type)for(var e of ky)e();isFinite(wy)||(wy="visibilitychange"===t.type?t.timeStamp:0,removeEventListener("prerenderingchange",xy,!0))}},Cy=function(t){if(void 0===t&&(t=!1),t&&(wy=1/0),0>wy){var e,i=_y(),r=document.prerendering||null==(e=globalThis.performance.getEntriesByType("visibility-state").find((t=>"hidden"===t.name&&t.startTime>=i)))?void 0:e.startTime;wy=null!=r?r:Sy(),addEventListener("visibilitychange",xy,!0),addEventListener("prerenderingchange",xy,!0),gy((()=>{setTimeout((()=>{wy=Sy()}))}))}return{get firstHiddenTime(){return wy},onHidden(t){ky.add(t)}}},Ty=function(t,e,i,r,n,s,a){void 0===e&&(e=-1),void 0===r&&(r=0);var o=by(),l=(null==o?void 0:o.navigationId)||0,u="navigate";return i?u=i:0>py()?o&&(document.prerendering||_y()>0?u="prerender":document.wasDiscarded?u="restore":o.type&&(u=o.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==o?void 0:o.name),navigationStartTime:a||0}},My=new WeakMap;function Ey(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)}let Iy=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 Ry=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){}},Py=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},Ay=(t,e)=>{if(t.set(e.navigationId,e),t.size>2){var i=t.keys().next().value;void 0!==i&&t.delete(i)}},Fy=t=>{var e=!1;return()=>{e||(t(),e=!0)}};let Oy=class{constructor(){this.l=void 0}};var Ly,Dy=t=>{document.prerendering?addEventListener("prerenderingchange",t,!0):t()},$y=[1800,3e3],Ny=function(t,e){void 0===e&&(e={});var i=Py(e);Dy((()=>{var r,n=Ey(e,Oy),s=Cy(),a=Ty("FCP"),o=Ry(["paint"],(t=>{for(var e of t)"first-contentful-paint"===e.name&&(o.disconnect(),s.firstHiddenTime>e.startTime&&(a.value=Math.max(e.startTime-_y(),0),a.entries.push(e),a.navigationId=e.navigationId||a.navigationId,r(!0)))}));o&&(r=my(t,a,$y,e.reportAllChanges),gy((i=>{a=Ty("FCP",-1,"back-forward-cache",a.navigationId,a.navigationInteractionId,a.navigationURL,py()),r=my(t,a,$y,e.reportAllChanges),yy((()=>{a.value=performance.now()-i.timeStamp,r(!0)}))}))),i&&Ry(["soft-navigation"],(i=>{i.forEach((i=>{n.l&&i.navigationId&&Ay(n.l,i);var s=Math.max((i.presentationTime||i.paintTime||0)-i.startTime,0);a=Ty("FCP",s,"soft-navigation",i.navigationId,i.interactionId,i.name,i.startTime),(r=my(t,a,$y,e.reportAllChanges))(!0)}))}),e)}))},qy=[.1,.25],jy=function(t,e){void 0===e&&(e={});var i=Cy();Ny(Fy((()=>{var r,n=Ty("CLS",0),s=Ey(e,Iy),a=(i,a,o,l,u)=>{n=Ty("CLS",0,i,a,o,l,u),s.i=0,r=my(t,n,qy,e.reportAllChanges)},o=function(t){void 0===t&&(t=!1),s.i>n.value&&(n.value=s.i,n.entries=s.o),r(t)},l=t=>{o(!0),a("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);o()},h=["layout-shift"];Py(e)&&h.push("soft-navigation");var d=Ry(h,u);d&&(r=my(t,n,qy,e.reportAllChanges),i.onHidden((()=>{u(d.takeRecords()),r(!0)})),gy((()=>{a("back-forward-cache",n.navigationId,n.navigationInteractionId,n.navigationURL,py()),yy(r)})),setTimeout(r))})))},By=0,Hy=1/0,zy=0,Uy=t=>{for(var e of t)e.interactionId&&(Hy=Math.min(Hy,e.interactionId),zy=Math.max(zy,e.interactionId),By=zy?(zy-Hy)/7+1:0)},Wy=()=>{var t;return Ly?By:null!==(t=performance.interactionCount)&&void 0!==t?t:0},Vy=0;let Gy=class{constructor(){this.u=[],this.v=new Map,this.m=void 0,this.p=void 0}T(){Vy=Wy(),this.u.length=0,this.v.clear()}M(t){var e=Wy()-Vy,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 a of s)this.v.delete(a.id)}null==(n=this.p)||n.call(this,r)}}}};var Zy=t=>{var e="requestIdleCallback"in globalThis?1e3:0,i=globalThis.requestIdleCallback||setTimeout,r=globalThis.cancelIdleCallback||clearTimeout;if("hidden"===document.visibilityState)t();else{var n=Fy(t),s=-1,a=()=>{r(s),n()};addEventListener("visibilitychange",a,{once:!0,capture:!0}),s=i((()=>{removeEventListener("visibilitychange",a,{capture:!0}),n()}),{timeout:e})}},Qy=[200,500],Jy=function(t,e){if(void 0===e&&(e={}),globalThis.PerformanceEventTiming&&"interactionId"in PerformanceEventTiming.prototype){var i=Cy();Dy((()=>{var r;"interactionCount"in performance||Ly||(Ly=Ry(["event"],Uy,{durationThreshold:0}));var n,s=Ty("INP"),a=Ey(e,Gy),o=(i,r,o,l,u)=>{a.T(),s=Ty("INP",-1,i,r,o,l,u),n=my(t,s,Qy,e.reportAllChanges)},l=()=>{var t=a.M(s.navigationType);t&&t._!==s.value&&(s.value=t._,s.entries=t.entries,n())},u=t=>{l(),n(!0),o("soft-navigation",t.navigationId,t.interactionId,t.name,t.startTime)},h=function(t,e){void 0===e&&(e=!1),Zy((()=>{for(var i of t)"soft-navigation"!==i.entryType?a.h(i):u(i);l(),e&&n(!0)}))},d=["event","first-input"];Py(e)&&d.push("soft-navigation");var v=Ry(d,h,p({},e,{durationThreshold:null!==(r=e.durationThreshold)&&void 0!==r?r:40}));n=my(t,s,Qy,e.reportAllChanges),v&&(i.onHidden((()=>{h(v.takeRecords(),!0)})),gy((()=>{o("back-forward-cache",s.navigationId,s.navigationInteractionId,s.navigationURL,py())})))}))}};let Ky=class{constructor(){this.m=void 0,this.l=void 0}h(t){var e;null==(e=this.m)||e.call(this,t)}};var Yy=[2500,4e3],Xy=function(t,e){void 0===e&&(e={});var i=!1,r=Py(e);Dy((()=>{var n,s=Cy(),a=Ty("LCP"),o=Ey(e,Ky),l=(r,o,l,u,h)=>{a=Ty("LCP",-1,r,o,l,u,h),n=my(t,a,Yy,e.reportAllChanges),i=!1,"soft-navigation"===r&&(s=Cy(!0))},u=t=>{o.l&&t.navigationId&&Ay(o.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-_y(),0),o.h(i),h=[i];else if("interaction-contentful-paint"===i.entryType){var v,c=i;if(!a.navigationId)continue;if("interactionId"in c&&c.interactionId!=a.navigationInteractionId)continue;d=(null==(v=c.largestContentfulPaint)?void 0:v.renderTime)||0,l=Math.max(d-i.startTime,0),c.largestContentfulPaint&&(o.h(c.largestContentfulPaint),h=[c.largestContentfulPaint])}s.firstHiddenTime>d&&(a.value=l,a.entries=h,n())}else u(i)},d=["largest-contentful-paint"];r&&d.push("interaction-contentful-paint","soft-navigation");var v=Ry(d,h);if(v){n=my(t,a,Yy,e.reportAllChanges);var c=["keydown","click","visibilitychange"],f=t=>{if(t.isTrusted&&!i){var e=a.id;Zy((()=>{if(!i){if(!r)for(var t of(v.disconnect(),c))removeEventListener(t,f,{capture:!0});e===a.id&&(i=!0,n(!0))}}))}};for(var p of c)addEventListener(p,f,{capture:!0});gy((r=>{l("back-forward-cache",a.navigationId,a.navigationInteractionId,a.navigationURL,py()),n=my(t,a,Yy,e.reportAllChanges),yy((()=>{a.value=performance.now()-r.timeStamp,i=!0,n(!0)}))}))}}))},tb={onLCP(t,e){void 0===e&&(e={});var i=Fm(e=Object.assign({},e),vy),r=new WeakMap;Gm(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:Pm(i);r.set(t,s)}else t.id&&r.set(t,"#"+t.id)},function(t,e){void 0===e&&(e={});var i=!1,r=Gm(e);Ym((()=>{var n,s=Um(),a=Wm("LCP"),o=Fm(e,vy),l=(r,o,l,u,h)=>{a=Wm("LCP",-1,r,o,l,u,h),n=$m(t,a,cy,e.reportAllChanges),i=!1,"soft-navigation"===r&&(s=Um(!0))},u=t=>{o.u&&t.navigationId&&Zm(o.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-qm(),0),o.l(i),h=[i];else if("interaction-contentful-paint"===i.entryType){var v,c=i;if(!a.navigationId)continue;if("interactionId"in c&&c.interactionId!=a.navigationInteractionId)continue;d=(null==(v=c.largestContentfulPaint)?void 0:v.renderTime)||0,l=Math.max(d-i.startTime,0),c.largestContentfulPaint&&(o.l(c.largestContentfulPaint),h=[c.largestContentfulPaint])}s.firstHiddenTime>d&&(a.value=l,a.entries=h,n())}else u(i)},d=["largest-contentful-paint"];r&&d.push("interaction-contentful-paint","soft-navigation");var v=Vm(d,h);if(v){n=$m(t,a,cy,e.reportAllChanges);var c=["keydown","click","visibilitychange"],f=t=>{if(t.isTrusted&&!i){var e=a.id;hy((()=>{if(!i){if(!r)for(var t of(v.disconnect(),c))removeEventListener(t,f,{capture:!0});e===a.id&&(i=!0,n(!0))}}))}};for(var p of c)addEventListener(p,f,{capture:!0});Dm((r=>{l("back-forward-cache",a.navigationId,a.navigationInteractionId,a.navigationURL,Lm()),n=$m(t,a,cy,e.reportAllChanges),Nm((()=>{a.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,a,o,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=Em())?void 0:s.activationStart)&&void 0!==n?n:0,c=null!==(a=null==(o=u)?void 0:o.responseStart)&&void 0!==a?a: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=Fm(e=Object.assign({},e),Mm),r=new WeakMap;i.t=t=>{var i;if(null!=t&&null!=(i=t.sources)&&i.length){var n=iy(t.sources),s=null==n?void 0:n.node;if(s){var a,o=null!==(a=null==e.generateTarget?void 0:e.generateTarget(s))&&void 0!==a?a:Pm(s);r.set(n,o)}}},function(t,e){void 0===e&&(e={});var i=Um();ty(Qm((()=>{var r,n=Wm("CLS",0),s=Fm(e,Mm),a=(i,a,o,l,u)=>{n=Wm("CLS",0,i,a,o,l,u),s.o=0,r=$m(t,n,ey,e.reportAllChanges)},o=function(t){void 0===t&&(t=!1),s.o>n.value&&(n.value=s.o,n.entries=s.i),r(t)},l=t=>{o(!0),a("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);o()},h=["layout-shift"];Gm(e)&&h.push("soft-navigation");var d=Vm(h,u);d&&(r=$m(t,n,ey,e.reportAllChanges),i.onHidden((()=>{u(d.takeRecords()),r(!0)})),Dm((()=>{a("back-forward-cache",n.navigationId,n.navigationInteractionId,n.navigationURL,Lm()),Nm(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=iy(n.sources);s&&(e={largestShiftTarget:r.get(s),largestShiftTime:n.startTime,largestShiftValue:n.value,largestShiftSource:s,largestShiftEntry:n,loadState:Im(n.startTime)})}}return Object.assign(t,{attribution:e})})(e))}),e)},onFCP(t,e){void 0===e&&(e={});var i=Fm(e=Object.assign({},e),Jm);Gm(e)&&(i.u=new Map),ty((e=>{t((t=>{var e={timeToFirstByte:0,firstByteToFCP:t.value,loadState:Im(Lm())};if("soft-navigation"!==t.navigationType){if(t.entries.length){var r=Em(),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:Im(t.entries[0].startTime),navigationEntry:r,fcpEntry:n}}}}else{var a,o=null==(a=i.u)?void 0:a.get(t.navigationId);o&&(e={timeToFirstByte:0,firstByteToFCP:t.value,loadState:"complete",navigationEntry:o})}return Object.assign(t,{attribution:e})})(e))}),e)},onINP(t,e){void 0===e&&(e={});var i=Fm(e=Object.assign({},e),uy),r=[],n=[],s=0,a=new WeakMap,o=new WeakMap,l=!1,u=()=>{l||(hy(h),l=!0)},h=()=>{var t=new Set(i.h.map((t=>a.get(t.entries[0])))),e=n.length-10;n=n.filter(((i,r)=>r>=e||t.has(i)));var o=new Set;for(var u of n){var h=d(u.startTime,u.processingEnd);for(var v of h)o.add(v)}r=r.filter((t=>t.startTime>s||o.has(t))),l=!1};i.p=t=>{var i,r=t.startTime+t.duration;s=Math.max(s,t.processingEnd);for(var o=n.length-1;o>=0;o--){var l=n[o];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)&&a.set(t,i),u()},i.m=t=>{if(!o.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:Pm(r);o.set(t,s)}else{var a,l=null==(a=t.entries.find((t=>t.targetSelector)))?void 0:a.targetSelector;l&&o.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};Vm(["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=Um();Ym((()=>{var r;"interactionCount"in performance||Km||(Km=Vm(["event"],ay,{durationThreshold:0}));var n,s=Wm("INP"),a=Fm(e,uy),o=(i,r,o,l,u)=>{a.M(),s=Wm("INP",-1,i,r,o,l,u),n=$m(t,s,dy,e.reportAllChanges)},l=()=>{var t=a.T(s.navigationType);t&&t.D!==s.value&&(s.value=t.D,s.entries=t.entries,n())},u=t=>{l(),n(!0),o("soft-navigation",t.navigationId,t.interactionId,t.name,t.startTime)},h=function(t,e){void 0===e&&(e=!1),hy((()=>{for(var i of t)"soft-navigation"!==i.entryType?a.l(i):u(i);l(),e&&n(!0)}))},d=["event","first-input"];Gm(e)&&d.push("soft-navigation");var v=Vm(d,h,p({},e,{durationThreshold:null!==(r=e.durationThreshold)&&void 0!==r?r:40}));n=$m(t,s,dy,e.reportAllChanges),v&&(i.onHidden((()=>{h(v.takeRecords(),!0)})),Dm((()=>{o("back-forward-cache",s.navigationId,s.navigationInteractionId,s.navigationURL,Lm())})))}))}}((e=>{t((t=>{if(0===t.entries.length){var e={processedEventEntries:[],longAnimationFrameEntries:[],inputDelay:0,processingDuration:0,presentationDelay:t.value,loadState:Im(t.navigationStartTime||0)};return Object.assign(t,{attribution:e})}var r=t.entries[0],n=a.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:o.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:Im(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,a=t.inputDelay,o=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+a>c.startTime?"input-delay":i+a+o>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+a+o&&(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:Xy,onCLS:jy,onFCP:Ny,onINP:Jy}};v.__PosthogExtensions__=v.__PosthogExtensions__||{},v.__PosthogExtensions__.postHogWebVitalsCallbacksByFlavor=v.__PosthogExtensions__.postHogWebVitalsCallbacksByFlavor||{},v.__PosthogExtensions__.postHogWebVitalsCallbacksByFlavor["web-vitals-with-attribution-soft-navs"]=tb,v.__PosthogExtensions__.postHogWebVitalsCallbacks=tb,v.postHogWebVitalsCallbacks=tb;var eb={onLCP:Xy,onCLS:jy,onFCP:Ny,onINP:Jy};v.__PosthogExtensions__=v.__PosthogExtensions__||{},v.__PosthogExtensions__.postHogWebVitalsCallbacksByFlavor=v.__PosthogExtensions__.postHogWebVitalsCallbacksByFlavor||{},v.__PosthogExtensions__.postHogWebVitalsCallbacksByFlavor["web-vitals-soft-navs"]=eb,v.__PosthogExtensions__.postHogWebVitalsCallbacks=eb,v.postHogWebVitalsCallbacks=eb,v.__PosthogExtensions__.loadWebVitalsCallbacks=()=>eb;let ib=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 rb=()=>{var t=performance.getEntriesByType("navigation")[0];if(t&&t.responseStart>0&&t.responseStart<performance.now())return t},nb=t=>{if("loading"===document.readyState)return"loading";var e=rb();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"},sb=t=>{var e=t.nodeName;return 1===t.nodeType?e.toLowerCase():e.toUpperCase().replace(/^#/,"")},ab=t=>{var e="";try{for(;9!==(null==(i=t)?void 0:i.nodeType);){var i,r=t,n=r.id?"#"+r.id:[sb(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},ob=new WeakMap;function lb(t,e){var i=ob.get(e);return i||(i=new WeakMap,ob.set(e,i)),i.get(t)||i.set(t,new e),i.get(t)}var ub,hb=-1,db=()=>hb,vb=t=>{addEventListener("pageshow",(e=>{e.persisted&&(hb=e.timeStamp,t(e))}),!0)},cb=(t,e,i,r)=>{var n,s;return a=>{e.value>=0&&(a||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))}},fb=t=>{requestAnimationFrame((()=>requestAnimationFrame(t)))},pb=()=>{var t,e;return null!==(t=null==(e=rb())?void 0:e.activationStart)&&void 0!==t?t:0},gb=function(t,e){void 0===e&&(e=-1);var i=rb(),r="navigate";return 0>db()?i&&(document.prerendering||pb()>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}},mb=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){}},yb=t=>{var e=!1;return()=>{e||(t(),e=!0)}},bb=-1,_b=new Set,wb=()=>"hidden"!==document.visibilityState||document.prerendering?1/0:0,kb=t=>{if("hidden"===document.visibilityState){if("visibilitychange"===t.type)for(var e of _b)e();isFinite(bb)||(bb="visibilitychange"===t.type?t.timeStamp:0,removeEventListener("prerenderingchange",kb,!0))}},Sb=()=>{if(0>bb){var t,e=pb(),i=document.prerendering||null==(t=globalThis.performance.getEntriesByType("visibility-state").find((t=>"hidden"===t.name&&t.startTime>=e)))?void 0:t.startTime;bb=null!=i?i:wb(),addEventListener("visibilitychange",kb,!0),addEventListener("prerenderingchange",kb,!0),vb((()=>{setTimeout((()=>{bb=wb()}))}))}return{get firstHiddenTime(){return bb},onHidden(t){_b.add(t)}}},xb=t=>{document.prerendering?addEventListener("prerenderingchange",t,!0):t()},Cb=[1800,3e3],Tb=function(t,e){void 0===e&&(e={}),xb((()=>{var i,r=Sb(),n=gb("FCP"),s=mb("paint",(t=>{for(var e of t)"first-contentful-paint"===e.name&&(s.disconnect(),r.firstHiddenTime>e.startTime&&(n.value=Math.max(e.startTime-pb(),0),n.entries.push(e),i(!0)))}));s&&(i=cb(t,n,Cb,e.reportAllChanges),vb((r=>{n=gb("FCP"),i=cb(t,n,Cb,e.reportAllChanges),fb((()=>{n.value=performance.now()-r.timeStamp,i(!0)}))})))}))},Mb=[.1,.25],Eb=t=>t.find((t=>{var e;return 1===(null==(e=t.node)?void 0:e.nodeType)}))||t[0],Ib=0,Rb=1/0,Pb=0,Ab=t=>{for(var e of t)e.interactionId&&(Rb=Math.min(Rb,e.interactionId),Pb=Math.max(Pb,e.interactionId),Ib=Pb?(Pb-Rb)/7+1:0)},Fb=()=>{var t;return ub?Ib:null!==(t=performance.interactionCount)&&void 0!==t?t:0},Ob=0;let Lb=class{constructor(){this.l=[],this.h=new Map,this.m=void 0,this.p=void 0}v(){Ob=Fb(),this.l.length=0,this.h.clear()}M(){var t=Math.min(this.l.length-1,Math.floor((Fb()-Ob)/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 a of s)this.h.delete(a.id)}null==(n=this.p)||n.call(this,r)}}}};var Db=t=>{var e=globalThis.requestIdleCallback||setTimeout,i=globalThis.cancelIdleCallback||clearTimeout;if("hidden"===document.visibilityState)t();else{var r=yb(t),n=-1,s=()=>{i(n),r()};addEventListener("visibilitychange",s,{once:!0,capture:!0}),n=e((()=>{removeEventListener("visibilitychange",s,{capture:!0}),r()}))}},$b=[200,500];let Nb=class{constructor(){this.m=void 0}u(t){var e;null==(e=this.m)||e.call(this,t)}};var $=[2500,4e3],qb=-1,jb=t=>{addEventListener("pageshow",(e=>{e.persisted&&(qb=e.timeStamp,t(e))}),!0)},Bb=(t,e,i,r)=>{var n,s;return a=>{e.value>=0&&(a||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))}},Hb=t=>{requestAnimationFrame((()=>requestAnimationFrame(t)))},zb=()=>{var t=performance.getEntriesByType("navigation")[0];if(t&&t.responseStart>0&&t.responseStart<performance.now())return t},Ub=()=>{var t,e;return null!==(t=null==(e=zb())?void 0:e.activationStart)&&void 0!==t?t:0},Wb=function(t,e){void 0===e&&(e=-1);var i=zb(),r="navigate";return 0>qb?i&&(document.prerendering||Ub()>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}},Vb=new WeakMap;function Gb(t,e){var i=Vb.get(e);return i||(i=new WeakMap,Vb.set(e,i)),i.get(t)||i.set(t,new e),i.get(t)}class Zb{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 Qb,Jb=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){}},Kb=t=>{var e=!1;return()=>{e||(t(),e=!0)}},Yb=-1,Xb=new Set,t_=()=>"hidden"!==document.visibilityState||document.prerendering?1/0:0,e_=t=>{if("hidden"===document.visibilityState){if("visibilitychange"===t.type)for(var e of Xb)e();isFinite(Yb)||(Yb="visibilitychange"===t.type?t.timeStamp:0,removeEventListener("prerenderingchange",e_,!0))}},i_=()=>{if(0>Yb){var t,e=Ub(),i=document.prerendering||null==(t=globalThis.performance.getEntriesByType("visibility-state").find((t=>"hidden"===t.name&&t.startTime>=e)))?void 0:t.startTime;Yb=null!=i?i:t_(),addEventListener("visibilitychange",e_,!0),addEventListener("prerenderingchange",e_,!0),jb((()=>{setTimeout((()=>{Yb=t_()}))}))}return{get firstHiddenTime(){return Yb},onHidden(t){Xb.add(t)}}},r_=t=>{document.prerendering?addEventListener("prerenderingchange",t,!0):t()},n_=[1800,3e3],s_=function(t,e){void 0===e&&(e={}),r_((()=>{var i,r=i_(),n=Wb("FCP"),s=Jb("paint",(t=>{for(var e of t)"first-contentful-paint"===e.name&&(s.disconnect(),r.firstHiddenTime>e.startTime&&(n.value=Math.max(e.startTime-Ub(),0),n.entries.push(e),i(!0)))}));s&&(i=Bb(t,n,n_,e.reportAllChanges),jb((r=>{n=Wb("FCP"),i=Bb(t,n,n_,e.reportAllChanges),Hb((()=>{n.value=performance.now()-r.timeStamp,i(!0)}))})))}))},a_=[.1,.25],o_=function(t,e){void 0===e&&(e={});var i=i_();s_(Kb((()=>{var r,n=Wb("CLS",0),s=Gb(e,Zb),a=t=>{for(var e of t)s.h(e);s.i>n.value&&(n.value=s.i,n.entries=s.o,r())},o=Jb("layout-shift",a);o&&(r=Bb(t,n,a_,e.reportAllChanges),i.onHidden((()=>{a(o.takeRecords()),r(!0)})),jb((()=>{s.i=0,n=Wb("CLS",0),r=Bb(t,n,a_,e.reportAllChanges),Hb(r)})),setTimeout(r))})))},l_=0,u_=1/0,h_=0,d_=t=>{for(var e of t)e.interactionId&&(u_=Math.min(u_,e.interactionId),h_=Math.max(h_,e.interactionId),l_=h_?(h_-u_)/7+1:0)},v_=()=>{var t;return Qb?l_:null!==(t=performance.interactionCount)&&void 0!==t?t:0},c_=0;class f_{constructor(){this.l=[],this.u=new Map,this.m=void 0,this.p=void 0}v(){c_=v_(),this.l.length=0,this.u.clear()}T(){var t=Math.min(this.l.length-1,Math.floor((v_()-c_)/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 a of s)this.u.delete(a.id)}null==(n=this.p)||n.call(this,r)}}}}var p_=t=>{var e=globalThis.requestIdleCallback||setTimeout,i=globalThis.cancelIdleCallback||clearTimeout;if("hidden"===document.visibilityState)t();else{var r=Kb(t),n=-1,s=()=>{i(n),r()};addEventListener("visibilitychange",s,{once:!0,capture:!0}),n=e((()=>{removeEventListener("visibilitychange",s,{capture:!0}),r()}))}},g_=[200,500],m_=function(t,e){if(void 0===e&&(e={}),globalThis.PerformanceEventTiming&&"interactionId"in PerformanceEventTiming.prototype){var i=i_();r_((()=>{var r;"interactionCount"in performance||Qb||(Qb=Jb("event",d_,{durationThreshold:0}));var n,s=Wb("INP"),a=Gb(e,f_),o=t=>{p_((()=>{for(var e of t)a.h(e);var i=a.T();i&&i.L!==s.value&&(s.value=i.L,s.entries=i.entries,n())}))},l=Jb("event",o,{durationThreshold:null!==(r=e.durationThreshold)&&void 0!==r?r:40});n=Bb(t,s,g_,e.reportAllChanges),l&&(l.observe({type:"first-input",buffered:!0}),i.onHidden((()=>{o(l.takeRecords()),n(!0)})),jb((()=>{a.v(),s=Wb("INP"),n=Bb(t,s,g_,e.reportAllChanges)})))}))}};class y_{constructor(){this.m=void 0}h(t){var e;null==(e=this.m)||e.call(this,t)}}var b_=[2500,4e3],__=function(t,e){void 0===e&&(e={}),r_((()=>{var i,r=i_(),n=Wb("LCP"),s=Gb(e,y_),a=t=>{for(var a of(e.reportAllChanges||(t=t.slice(-1)),t))s.h(a),r.firstHiddenTime>a.startTime&&(n.value=Math.max(a.startTime-Ub(),0),n.entries=[a],i())},o=Jb("largest-contentful-paint",a);if(o){i=Bb(t,n,b_,e.reportAllChanges);var l=Kb((()=>{a(o.takeRecords()),o.disconnect(),i(!0)})),u=t=>{t.isTrusted&&(p_(l),removeEventListener(t.type,u,{capture:!0}))};for(var h of["keydown","click","visibilitychange"])addEventListener(h,u,{capture:!0});jb((r=>{n=Wb("LCP"),i=Bb(t,n,b_,e.reportAllChanges),Hb((()=>{n.value=performance.now()-r.timeStamp,i(!0)}))}))}}))},w_={onLCP(t,e){void 0===e&&(e={});var i=lb(e=Object.assign({},e),Nb),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:ab(i);r.set(t,s)}else t.id&&r.set(t,"#"+t.id)},function(t,e){void 0===e&&(e={}),xb((()=>{var i,r=Sb(),n=gb("LCP"),s=lb(e,Nb),a=t=>{for(var a of(e.reportAllChanges||(t=t.slice(-1)),t))s.u(a),r.firstHiddenTime>a.startTime&&(n.value=Math.max(a.startTime-pb(),0),n.entries=[a],i())},o=mb("largest-contentful-paint",a);if(o){i=cb(t,n,$,e.reportAllChanges);var l=yb((()=>{a(o.takeRecords()),o.disconnect(),i(!0)})),u=t=>{t.isTrusted&&(Db(l),removeEventListener(t.type,u,{capture:!0}))};for(var h of["keydown","click","visibilitychange"])addEventListener(h,u,{capture:!0});vb((r=>{n=gb("LCP"),i=cb(t,n,$,e.reportAllChanges),fb((()=>{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=rb();if(s){var a=s.activationStart||0,o=Math.max(0,s.responseStart-a),l=Math.max(o,n?(n.requestStart||n.startTime)-a:0),u=Math.min(t.value,Math.max(l,n?n.responseEnd-a:0));e=p({},e,{timeToFirstByte:o,resourceLoadDelay:l-o,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=lb(e=Object.assign({},e),ib),r=new WeakMap;i.t=t=>{var i;if(null!=t&&null!=(i=t.sources)&&i.length){var n=Eb(t.sources),s=null==n?void 0:n.node;if(s){var a,o=null!==(a=null==e.generateTarget?void 0:e.generateTarget(s))&&void 0!==a?a:ab(s);r.set(n,o)}}},function(t,e){void 0===e&&(e={});var i=Sb();Tb(yb((()=>{var r,n=gb("CLS",0),s=lb(e,ib),a=t=>{for(var e of t)s.u(e);s.o>n.value&&(n.value=s.o,n.entries=s.i,r())},o=mb("layout-shift",a);o&&(r=cb(t,n,Mb,e.reportAllChanges),i.onHidden((()=>{a(o.takeRecords()),r(!0)})),vb((()=>{s.o=0,n=gb("CLS",0),r=cb(t,n,Mb,e.reportAllChanges),fb(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=Eb(n.sources);s&&(e={largestShiftTarget:r.get(s),largestShiftTime:n.startTime,largestShiftValue:n.value,largestShiftSource:s,largestShiftEntry:n,loadState:nb(n.startTime)})}}return Object.assign(t,{attribution:e})})(e))}),e)},onFCP(t,e){void 0===e&&(e={}),Tb((e=>{t((t=>{var e={timeToFirstByte:0,firstByteToFCP:t.value,loadState:nb(db())};if(t.entries.length){var i=rb(),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:nb(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=lb(e=Object.assign({},e),Lb),r=[],n=[],s=0,a=new WeakMap,o=new WeakMap,l=!1,u=()=>{l||(Db(h),l=!0)},h=()=>{var t=new Set(i.l.map((t=>a.get(t.entries[0])))),e=n.length-10;n=n.filter(((i,r)=>r>=e||t.has(i)));var o=new Set;for(var u of n){var h=d(u.startTime,u.processingEnd);for(var v of h)o.add(v)}r=r.filter((t=>t.startTime>s||o.has(t))),l=!1};i.m=t=>{var i,r=t.startTime+t.duration;s=Math.max(s,t.processingEnd);for(var o=n.length-1;o>=0;o--){var l=n[o];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)&&a.set(t,i),u()},i.p=t=>{if(!o.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:ab(r);o.set(t,s)}else{var a,l=null==(a=t.entries.find((t=>t.targetSelector)))?void 0:a.targetSelector;l&&o.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};mb("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=Sb();xb((()=>{var r;"interactionCount"in performance||ub||(ub=mb("event",Ab,{durationThreshold:0}));var n,s=gb("INP"),a=lb(e,Lb),o=t=>{Db((()=>{for(var e of t)a.u(e);var i=a.M();i&&i.T!==s.value&&(s.value=i.T,s.entries=i.entries,n())}))},l=mb("event",o,{durationThreshold:null!==(r=e.durationThreshold)&&void 0!==r?r:40});n=cb(t,s,$b,e.reportAllChanges),l&&(l.observe({type:"first-input",buffered:!0}),i.onHidden((()=>{o(l.takeRecords()),n(!0)})),vb((()=>{a.v(),s=gb("INP"),n=cb(t,s,$b,e.reportAllChanges)})))}))}}((e=>{t((t=>{var e=t.entries[0],r=a.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:o.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:nb(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,a=t.processingDuration,o=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;o+=f-p,l+=p,f>h&&(r=n+s>v.startTime?"input-delay":n+s+a>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+a&&(u=t.nextPaintTime-m),i&&r&&(t.longestScript={entry:i,subpart:r,intersectingDuration:h}),t.totalScriptDuration=o,t.totalStyleAndLayoutDuration=l,t.totalPaintDuration=u,t.totalUnattributedDuration=t.nextPaintTime-n-o-l-u}})(c),Object.assign(t,{attribution:c})})(e))}),e)},withoutAttribution:{onLCP:__,onCLS:o_,onFCP:s_,onINP:m_}};v.__PosthogExtensions__=v.__PosthogExtensions__||{},v.__PosthogExtensions__.postHogWebVitalsCallbacksByFlavor=v.__PosthogExtensions__.postHogWebVitalsCallbacksByFlavor||{},v.__PosthogExtensions__.postHogWebVitalsCallbacksByFlavor["web-vitals-with-attribution"]=w_,v.__PosthogExtensions__.postHogWebVitalsCallbacks=w_,v.postHogWebVitalsCallbacks=w_;var k_={onLCP:__,onCLS:o_,onFCP:s_,onINP:m_};v.__PosthogExtensions__=v.__PosthogExtensions__||{},v.__PosthogExtensions__.postHogWebVitalsCallbacksByFlavor=v.__PosthogExtensions__.postHogWebVitalsCallbacksByFlavor||{},v.__PosthogExtensions__.postHogWebVitalsCallbacksByFlavor["web-vitals"]=k_,v.__PosthogExtensions__.postHogWebVitalsCallbacks=k_,v.postHogWebVitalsCallbacks=k_,v.__PosthogExtensions__.loadWebVitalsCallbacks=()=>k_;class S_{constructor(t){this.disabled=!1===t;var e=Q(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 x_="$copy_autocapture",C_=Hi("[AutoCapture]");function T_(t,e){return e.length>t?e.slice(0,t)+"...":e}function M_(t){if(t.previousElementSibling)return t.previousElementSibling;var e=t;do{e=e.previousSibling}while(e&&!gr(e));return e}function E_(e,i){var r,n,s=i.e,a=i.maskAllElementAttributes,o=i.maskAllText,l=i.elementAttributeIgnoreList,u=i.elementsChainAsString,h=i.disableCaptureUrlHashes;if(!gr(e))return{props:{}};for(var d=[e],v=new Set([e]),c=e;c.parentNode&&!mr(c,"body")&&_r>d.length;)if(br(c.parentNode)){var f=c.parentNode.host;if(v.has(f))break;v.add(f),d.push(f),c=f}else{if(!gr(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(Ui(d,(t=>{var e=jr(t);if(mr(t,"a")){var i=t.getAttribute("href");_=!!(e&&i&&Qr(i))&&(h?Te(i):i)}j(Sr(t),"ph-no-capture")&&(w=!0),y.push(function(t,e,i,r,n){void 0===n&&(n=!1);var s=t.tagName.toLowerCase(),a={tag_name:s};Mr.indexOf(s)>-1&&!i&&(a.$el_text="a"===s.toLowerCase()||"button"===s.toLowerCase()?T_(1024,Jr(t)):T_(1024,Cr(t)));var o=Sr(t);o.length>0&&(a.classes=o.filter((function(t){return""!==t}))),Ui(t.attributes,(function(i){var s;if((!Br(t)||-1!==["name","id","class","aria-label"].indexOf(i.name))&&(null==r||!r.includes(i.name))&&!e&&Qr(i.value)&&(!Y(s=i.name)||"_ngcontent"!==s.substring(0,10)&&"_nghost"!==s.substring(0,7))){var o=i.value;"class"===i.name&&(o=wr(o).join(" ")),a["attr__"+i.name]=T_(1024,"href"===i.name&&n?Te(o):o)}}));for(var l=1,u=1,h=t;h=M_(h);)l++,h.tagName===t.tagName&&u++;return a.nth_child=l,a.nth_of_type=u,a}(t,a,o,l,h));var r=function(t){if(!jr(t))return{};var e={};return Ui(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&&Qr(r)&&(e[i]=r)}})),e}(t);Wi(b,r)})),w)return{props:{},explicitNoCapture:w};if(o||(y[0].$el_text=mr(e,"a")||mr(e,"button")?Jr(e):Cr(e)),_){var k,S;y[0].attr__href=_;var x=null==(k=ir(_))?void 0:k.host,C=null==t||null==(S=t.location)?void 0:S.host;x&&C&&x!==C&&(g=_)}return{props:Wi({$event_type:s.type,$ce_version:1},u?{}:{$elements:y},{$elements_chain:(m=y,function(t){var e=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),a={};return Vi(s).sort(((t,e)=>function(t,e){return e>t?-1:t>e?1:0}(t[0],e[0]))).forEach((t=>{var e=t[1];return a[Yr(t[0].toString())]=Yr(e.toString())})),(r+=":")+Vi(a).map((t=>t[0]+'="'+t[1]+'"')).join("")}));return e.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:Xr(t),attr_id:t.attr__id,nth_child:t.nth_child,nth_of_type:t.nth_of_type,attributes:{}};return Vi(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}:{},b)}}class I_{constructor(t){this.name="autocapture",this.Ts=!1,this.Ms=null,this.Es=!1,this.Is=!1,this.vn={enabled:!1,rageclick:!1,maskAllElementAttributes:!1,maskAllText:!1,disableCaptureUrlHashes:!1,remoteRequestsDisabled:!1},this.Rs=!1,this.Ps=t,this.Ps.refresh(this.vn),this.rageclicks=new S_(this.vn.rageclick),this.As=null}setup(t){this.Fs(),this.Os=t;var e=t.onRemoteConfig(this.onRemoteConfig.bind(this));this.Rs?e.dispose():(this.Ls=e,this.startIfEnabled())}dispose(){var t;this.Rs||(this.Rs=!0,this.Os=void 0,null==(t=this.Ls)||t.dispose(),this.Ls=void 0,this.Ds())}$s(){return this.Ps.refresh(this.vn),this.vn}Fs(){var t,e;return this.$s(),this.vn.url_allowlist=null==(t=this.vn.url_allowlist)?void 0:t.map((t=>new RegExp(t))),this.vn.url_ignorelist=null==(e=this.vn.url_ignorelist)?void 0:e.map((t=>new RegExp(t))),this.vn}Ns(){if(this.isBrowserSupported()){if(t&&r){var e=this.qs=e=>{e=e||(null==t?void 0:t.event);try{this.js(e)}catch(t){C_.error("Failed to capture event",t)}};if(Yi(r,"submit",e,{capture:!0}),Yi(r,"change",e,{capture:!0}),Yi(r,"click",e,{capture:!0}),this.$s().capture_copied_text){var i=this.Bs=e=>{e=e||(null==t?void 0:t.event);try{this.js(e,x_)}catch(t){C_.error("Failed to capture clipboard event",t)}};Yi(r,"copy",i,{capture:!0}),Yi(r,"cut",i,{capture:!0}),Yi(r,"paste",i,{capture:!0})}}}else C_.info("Disabling Automatic Event Collection because this browser is not supported")}Ds(){this.qs&&(null==r||r.removeEventListener("submit",this.qs,!0),null==r||r.removeEventListener("change",this.qs,!0),null==r||r.removeEventListener("click",this.qs,!0),this.qs=void 0),this.Bs&&(null==r||r.removeEventListener("copy",this.Bs,!0),null==r||r.removeEventListener("cut",this.Bs,!0),null==r||r.removeEventListener("paste",this.Bs,!0),this.Bs=void 0),this.Ts=!1}startIfEnabled(){!this.Rs&&this.Os&&this.isEnabled&&!this.Ts&&(this.Ns(),this.Ts=!0)}onRemoteConfig(t){if(!this.Rs)if(this.Es=!0,t.ok){var e=t.config;e.elementsChainAsString&&(this.Is=e.elementsChainAsString);var i,r=e.autocapture_opt_out;nt(r)&&(null==(i=this.Os)||i.kv.set(_n,r),this.Ms=r),this.startIfEnabled()}else this.startIfEnabled()}setElementSelectors(t){this.As=t}getElementSelectors(t){var e,i=[];return null==(e=this.As)||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.Rs)return!1;var i=null==(t=this.Os)?void 0:t.kv.get(_n),r=this.Ms,n=this.$s(),s=n.remoteRequestsDisabled&&!this.Es;if(tt(r)&&!nt(i)&&!s)return!1;var a=null!==(e=this.Ms)&&void 0!==e?e:!!i;return!!n.enabled&&!a}js(e,i){if(void 0===i&&(i="$autocapture"),this.isEnabled){var r=Tr(e);yr(r)&&(r=r.parentNode||null);var n,s=this.Fs();"$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.js(e,"$rageclick");var a=i===x_,o=a?p({},s,{dom_event_allowlist:void 0}):s;if(r&&function(e,i,r,n,s,a){var o;if(!t||Nr(e))return!1;if(null!=r&&r.url_allowlist&&!kr(r.url_allowlist,a))return!1;if(null!=r&&r.url_ignorelist&&kr(r.url_ignorelist,a))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=qr(e,n),h=u.parentIsUsefulElement,d=u.targetElementList;if(!function(t,e){var i=null==e?void 0:e.element_allowlist;if(K(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!==(o=null==r?void 0:r.css_selector_ignorelist)&&void 0!==o?o:Rr))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&&(Mr.indexOf(c)>-1||"true"===e.getAttribute("contenteditable"))}}(r,e,o,a,a?["copy","cut","paste"]:void 0,{config:{get_current_url:s.getCurrentUrl}})){var l,u=E_(r,{e:e,maskAllElementAttributes:s.maskAllElementAttributes,maskAllText:s.maskAllText,elementAttributeIgnoreList:s.element_attribute_ignorelist,elementsChainAsString:this.Is,disableCaptureUrlHashes:s.disableCaptureUrlHashes}),h=u.props;if(u.explicitNoCapture)return!1;var d=this.getElementSelectors(r);if(d&&d.length>0&&(h.$element_selectors=d),i===x_){var v=e.type||"clipboard";if("paste"!==v){var c,f,g=null==t||null==(c=t.getSelection())?void 0:c.toString(),m=xr(g);if(!m)return!1;h.$selected_content=m,h.$clipboard_text_length=null!==(f=null==g?void 0:g.length)&&void 0!==f?f:0}h.$copy_type=v}return null==(l=this.Os)||l.capture(i,h).catch((t=>C_.error("Failed to capture event",t))),!0}}}isBrowserSupported(){return Z(null==r?void 0:r.querySelectorAll)}}var R_={};function P_(e,i){var r=R_[e];if(r)return r;var n=i[e];if((t=>Z(t)&&-1!==t.toString().indexOf("[native code]"))(n)&&(null==t||!t.Zone))return R_[e]=n.bind(i);var s=i.document;if(s&&Z(s.createElement)){var a,o=!1;try{(a=s.createElement("iframe")).hidden=!0,s.head.appendChild(a);var l,u,h=a.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:"")&&(a.classList.add("rr-block","ph-no-capture"),o=!0))}catch(t){Bi.warn("Could not create sandbox iframe for "+e+" check, bailing to assignableWindow."+e+": ",t)}finally{var d;!o&&null!=(d=a)&&d.parentNode&&a.parentNode.removeChild(a)}}return n&&Z(n)?R_[e]=n.bind(i):n}function A_(t,e){var i=Tr(t);return i?p({node:i,originalEvent:t,timestamp:Date.now()},e):null}function F_(t,e){return Math.abs(t)<Math.abs(e)?0>e?"up":"down":0>t?"left":"right"}function O_(t){return"swipe"===t.type?"$dead_swipe":"$dead_click"}var L_="canvas,video,audio,embed,object",D_=1e3;function $_(t,e){return it(t)&&t>=e}function N_(t){return t>=0&&D_>t?t:void 0}function q_(t,e){return e?N_(t-e):void 0}class j_{Wi(t){var e,i,r,n,s,a,o,l,u=this.zi((null==t?void 0:t.__onCapture)||this.Vi.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!==(a=null==t?void 0:t.capture_dead_swipes)&&void 0!==a?a:u.capture_dead_swipes,swipe_threshold_px:null!==(o=null==t?void 0:t.swipe_threshold_px)&&void 0!==o?o: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.Zi=[],this.Gi=0,this.zi=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.Qi=t=>{var e=A_(t,{type:"click"});tt(e)||this.Ji(e)||this.Yi(e),this.Ki()},this.Xi=()=>{var t=Date.now();this.en=t,t%50==0&&this.Zi.forEach((e=>{K(e.scrollDelayMs)&&(e.scrollDelayMs=t-e.timestamp)}))},this.tn=()=>{this.rn=Date.now()},this.$t=()=>{var t=Date.now();this.nn=t,this.an("visibilityChangedDelayMs",t)},this.sn=()=>{var t=Date.now();this.un=t,this.an("focusChangedDelayMs",t)},this.ln=t=>{var e=t.touches,i=1===(null==e?void 0:e.length)?e[0]:void 0;this.hn=i?{x:i.clientX,y:i.clientY,timestamp:Date.now()}:void 0},this.cn=()=>{this.hn=void 0},this.dn=t=>{var e,i=this.hn;if(this.hn=void 0,!K(i)&&this.vn.max_dead_swipes_per_page_load>this.Gi){var n=t,s=null==(e=n.changedTouches)?void 0:e[0];if(s){var a=s.clientX-i.x,o=s.clientY-i.y,l=a*a+o*o,u=this.vn.swipe_threshold_px;if(l>=u*u&&![this.en,this.fn,this.rn].some((t=>it(t)&&t>=i.timestamp))){var h;if(this.pn()&&(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(L_))))return;var d=A_(n,{type:"swipe",swipeDirection:F_(a,o),swipeDistancePx:Math.round(Math.sqrt(l))});tt(d)||this.Ji(d)||this.Yi(d),this.Ki()}}}},this.instance=t,this.vn=this.Wi(e),this._onCapture=this.vn.__onCapture}start(t){this.gn(),this.mn(),this.yn(),this.bn(),this.wn(),this.kn(t),this.vn.capture_dead_swipes&&this._n()}kn(t){if(!this.Sn){var e=function(t){return P_("MutationObserver",t)}(v);this.Sn=new e((t=>{this.xn(t)})),this.Sn.observe(t,{attributes:!0,characterData:!0,childList:!0,subtree:!0})}}stop(){var t;null==(t=this.Sn)||t.disconnect(),this.Sn=void 0,v.removeEventListener("click",this.Qi),v.removeEventListener("scroll",this.Xi,{capture:!0}),v.removeEventListener("selectionchange",this.tn),v.removeEventListener("touchstart",this.ln,{capture:!0}),v.removeEventListener("touchend",this.dn,{capture:!0}),v.removeEventListener("touchcancel",this.cn,{capture:!0}),null==r||r.removeEventListener("visibilitychange",this.$t),v.removeEventListener("blur",this.sn),v.removeEventListener("focus",this.sn),this.hn=void 0}xn(t){this.fn=Date.now()}gn(){Yi(v,"click",this.Qi)}Yi(t){t.visibilityChangedDelayMs=q_(t.timestamp,this.nn),t.focusChangedDelayMs=q_(t.timestamp,this.un),this.Zi.push(t)}Ki(){this.Zi.length&&K(this.Cn)&&(this.Cn=v.setTimeout((()=>{this.Mn()}),1e3))}mn(){Yi(v,"scroll",this.Xi,{capture:!0})}yn(){Yi(v,"selectionchange",this.tn)}bn(){Yi(r,"visibilitychange",this.$t)}wn(){Yi(v,"blur",this.sn),Yi(v,"focus",this.sn)}an(t,e){this.Zi.forEach((i=>{var r=N_(e-i.timestamp);it(r)&&(K(i[t])||i[t]>r)&&(i[t]=r)}))}_n(){Yi(v,"touchstart",this.ln,{capture:!0,passive:!0}),Yi(v,"touchend",this.dn,{capture:!0,passive:!0}),Yi(v,"touchcancel",this.cn,{capture:!0,passive:!0})}pn(){var t=K(this.Tn)||it(this.fn)&&this.fn>this.Tn;return(K(this.In)||t)&&(this.Tn=Date.now(),this.In=!(null==r||!r.querySelector(L_))),!!this.In}Ji(t){return!t||("swipe"===t.type?this.En(t):this.Rn(t))}En(e){if(pr(e.node))return!0;var i=this.Zi.some((t=>t.type===e.type&&t.node===e.node&&1e3>Math.abs(t.timestamp-e.timestamp)));return!(!i&&!mr(e.node,"html")&&gr(e.node)&&function(e,i){var r;if(!t||Nr(e))return!1;var n=nt(i)?Or:null!==(r=null==i?void 0:i.css_selector_ignorelist)&&void 0!==r?r:Or;return!Er(qr(e,!1).targetElementList,n)}(e.node,{css_selector_ignorelist:this.vn.css_selector_ignorelist}))}Rn(e){return!(this.vn.capture_clicks_with_modifier_keys||(i=e.originalEvent,!(i.ctrlKey||i.metaKey||i.altKey||i.shiftKey)))||!!this.En(e)||(r=e.node,!(!t||Nr(r))&&qr(r,!1).targetElementList.some((t=>mr(t,"a"))));var i,r}Mn(){if(this.Zi.length){clearTimeout(this.Cn),this.Cn=void 0;var t=this.Zi;for(var e of(this.Zi=[],t)){var i;e.mutationDelayMs=null!==(i=e.mutationDelayMs)&&void 0!==i?i:this.fn&&this.fn>=e.timestamp?this.fn-e.timestamp:void 0,e.absoluteDelayMs=Date.now()-e.timestamp,e.selectionChangedDelayMs=this.rn&&this.rn>=e.timestamp?this.rn-e.timestamp:void 0;var r=$_(e.scrollDelayMs,this.vn.scroll_threshold_ms),n=$_(e.selectionChangedDelayMs,this.vn.selection_change_threshold_ms),s=$_(e.mutationDelayMs,this.vn.mutation_threshold_ms),a=$_(e.absoluteDelayMs,1.1*this.vn.mutation_threshold_ms),o=it(e.scrollDelayMs)&&this.vn.scroll_threshold_ms>e.scrollDelayMs,l=it(e.mutationDelayMs)&&this.vn.mutation_threshold_ms>e.mutationDelayMs,u=it(e.selectionChangedDelayMs)&&this.vn.selection_change_threshold_ms>e.selectionChangedDelayMs,h=it(e.visibilityChangedDelayMs),d=it(e.focusChangedDelayMs);if(!(o||l||u||h||d))if(r||s||a||n){var v=O_(e);if("$dead_swipe"===v){if(this.Gi>=this.vn.max_dead_swipes_per_page_load)continue;this.Gi++}this._onCapture(e,{[v+"_last_mutation_timestamp"]:this.fn,[v+"_event_timestamp"]:e.timestamp,[v+"_scroll_timeout"]:r,[v+"_mutation_timeout"]:s,[v+"_absolute_timeout"]:a,[v+"_selection_changed_timeout"]:n,[v+"_visibility_changed_timeout"]:!1})}else this.vn.mutation_threshold_ms>e.absoluteDelayMs&&this.Zi.push(e)}this.Ki()}}Vi(t,e){var i=O_(t);this.instance.capture(i,p({},e,E_(t.node,{e:t.originalEvent,maskAllElementAttributes:this.instance.config.mask_all_element_attributes,maskAllText:this.instance.config.mask_all_text,elementAttributeIgnoreList:this.vn.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 j_(t,e);var B_=Hi("[ExternalScriptsLoader]"),H_=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]},z_=(t,e,i)=>{if(t.config.disable_external_dependency_loading)return B_.warn(e+" was requested but loading of external scripts is disabled."),i("Loading of external scripts is disabled");var n=H_(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 a=()=>{if(!r)return i("document not found");if(H_(e))return z_(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,a=r.querySelectorAll("body > script");a.length>0?null==(s=a[0].parentNode)||s.insertBefore(n,a[0]):r.body.appendChild(n)}};null!=r&&r.body?a():null==r||r.addEventListener("DOMContentLoaded",a)},U_={},W_=(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=U_[n];if("fallback"===r&&s){if(H_(s))return void z_(t,s,i);delete U_[n]}z_(t,n,"fallback"===r?(r,s)=>{if(r)if("string"==typeof r)i(r);else{var a,o=W_(t,e);U_[n]=o;var l=H_(n);null==l||null==(a=l.parentNode)||a.removeChild(l),z_(t,o,i)}else i(void 0,s)}:i)}else z_(t,W_(t,e),i)}else{var a=t.requestRouter.endpointFor("assets","/array/"+t.config.token+"/config.js");z_(t,a,i)}},v.__PosthogExtensions__.loadSiteApp=(t,e,i)=>{var r=t.requestRouter.endpointFor("api",e);z_(t,r,i)};class V_{constructor(t){this._instance=t}get vn(){return this._instance.config}get consent(){return this.Hs()?0:this.zs}isOptedOut(){return this.vn.cookieless_mode===Ds||this.isRejected()||-1===this.consent&&this.vn.cookieless_mode===Ls}isOptedIn(){return!this.isOptedOut()}isExplicitlyOptedOut(){return 0===this.consent}isRejected(){return 0===this.consent||-1===this.consent&&this.vn.opt_out_capturing_by_default}optInOut(t){this.Us.ei(this.Ws,t?1:0,this.vn.cookie_expiration,this.vn.cross_subdomain_cookie,this.vn.secure_cookie)}reset(){this.Us.ri(this.Ws,this.vn.cross_subdomain_cookie)}get Ws(){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 zs(){var t=this.Us.ti(this.Ws);return ft(t)?1:j(pt,t)?0:-1}get Us(){var t=this.vn.opt_out_capturing_persistence_type,e="localStorage"===t?hp:lp;if(!this.Vs||this.Vs!==e){this.Vs=e;var i="localStorage"===t?lp:hp;i.ti(this.Ws)&&(this.Vs.ti(this.Ws)||this.optInOut(ft(i.ti(this.Ws))),i.ri(this.Ws,this.vn.cross_subdomain_cookie))}return this.Vs}Hs(){return!!this.vn.respect_dnt&&[null==i?void 0:i.doNotTrack,null==i?void 0:i.msDoNotTrack,v.doNotTrack].some((t=>ft(t)))}}var G_=Hi("[Dead Clicks]"),Z_=()=>!0,Q_=t=>{var e,i=!(null==(e=t.instance.persistence)||!e.get_property(Tn)),r=t.instance.config.capture_dead_clicks;return nt(r)?r:!!Q(r)||i};class J_{get lazyLoadedDeadClicksAutocapture(){return this.Gs}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({[Tn]:e.captureDeadClicks}),this.startIfEnabledOrStop())}}startIfEnabledOrStop(){this.isEnabled(this)?this.Zs((()=>{this.Qs()})):this.stop()}Zs(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?G_.error("failed to load script",e):t()}))}Qs(){var t;if(r){if(!this.Gs&&null!=(t=v.__PosthogExtensions__)&&t.initDeadClicksAutocapture){var e=Q(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.Gs=v.__PosthogExtensions__.initDeadClicksAutocapture(this.instance,e),this.Gs.start(r),G_.info("starting...")}}else G_.error("`document` not found. Cannot start.")}stop(){this.Gs&&(this.Gs.stop(),this.Gs=void 0,G_.info("stopping..."))}}var K_=Hi("[SegmentIntegration]");var Y_="posthog-js";function X_(t,e){var i=void 0===e?{}:e,r=i.organization,n=i.projectId,s=i.prefix,a=i.severityAllowList,o=void 0===a?["error"]:a,l=i.sendExceptionsToPostHog,u=void 0===l||l;return e=>{var i,a,l,h,d;if("*"!==o&&!o.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==(a=f[0])?void 0:a.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 tw{constructor(t,e,i,r,n,s){this.name=Y_,this.setupOnce=function(a){a(X_(t,{organization:e,projectId:i,prefix:r,severityAllowList:n,sendExceptionsToPostHog:null==s||s}))}}}class ew{constructor(t){this.Js=(t,e,i)=>{i&&(i.noSessionId||i.activityTimeout||i.sessionPastMaximumLength||i.crossTabAdoption)&&(Bi.info("[PageViewManager] Session rotated, clearing pageview state",{sessionId:t,changeReason:i}),this.Ks=void 0,this._instance.scrollManager.resetContext())},this._instance=t,this.Ys()}Ys(){var t;this.Xs=null==(t=this._instance.sessionManager)?void 0:t.onSessionId(this.Js)}destroy(){var t;null==(t=this.Xs)||t.call(this),this.Xs=void 0}doPageView(e,i){var r,n=this.ta(e,i);return this.Ks={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.ta(t,null==(e=this.Ks)?void 0:e.pageViewId)}doEvent(){var t;return{$pageview_id:null==(t=this.Ks)?void 0:t.pageViewId}}ta(t,e){var i=this.Ks;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,a=n.lastScrollY,o=n.maxScrollY,l=n.maxContentHeight,u=n.lastContentY,h=n.maxContentY;if(!(K(s)||K(a)||K(o)||K(l)||K(u)||K(h))){s=Math.ceil(s),a=Math.ceil(a),o=Math.ceil(o),l=Math.ceil(l),u=Math.ceil(u),h=Math.ceil(h);var d=s>1?gt(a/s,0,1,Bi):1,v=s>1?gt(o/s,0,1,Bi):1,c=l>1?gt(u/l,0,1,Bi):1,f=l>1?gt(h/l,0,1,Bi):1;r=Wi(r,{$prev_pageview_last_scroll:a,$prev_pageview_last_scroll_percentage:d,$prev_pageview_max_scroll:o,$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 iw=["flags","surveys"],rw={[fn]:{exposure:"hidden"},[yn]:{exposure:"hidden"},__cmpns:{exposure:"hidden"},[bn]:{exposure:"hidden"},[_n]:{exposure:"event"},[wn]:{exposure:"hidden"},[En]:{exposure:"hidden"},[kn]:{exposure:"event"},[Sn]:{exposure:"hidden"},[xn]:{exposure:"event"},[Cn]:{exposure:"event"},[Tn]:{exposure:"event"},[Mn]:{exposure:"hidden"},[In]:{exposure:"event"},[Rn]:{exposure:"hidden"},$session_recording_enabled_server_side:{exposure:"hidden"},[Dn]:{exposure:"hidden"},[$n]:{exposure:"event"},[Pn]:{exposure:"event",shouldSkipFromEventProperties:t=>tt(t)},[Nn]:{exposure:"event"},[qn]:{exposure:"event"},[jn]:{exposure:"event"},[Un]:{exposure:"event"},[Wn]:{exposure:"hidden"},[Vn]:{exposure:"hidden",storageGroup:"flags"},[Gn]:{exposure:"hidden",storageGroup:"flags"},[Zn]:{exposure:"hidden"},[Qn]:{exposure:"hidden",storageGroup:"flags"},[Jn]:{exposure:"hidden",storageGroup:"flags"},[Kn]:{exposure:"hidden",storageGroup:"flags",volatile:!0},[Yn]:{exposure:"hidden",storageGroup:"flags"},[Xn]:{exposure:"hidden"},[ts]:{exposure:"hidden"},[es]:{exposure:"hidden"},[is]:{exposure:"hidden"},[ns]:{exposure:"hidden",storageGroup:"surveys"},[ss]:{exposure:"hidden",storageGroup:"surveys",volatile:!0},[as]:{exposure:"event"},[os]:{exposure:"hidden"},[ls]:{exposure:"hidden"},[us]:{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"},[hs]:{exposure:"hidden"},[ds]:{exposure:"hidden"},[rs]:{exposure:"event"},[vs]:{exposure:"hidden"},[cs]:{exposure:"hidden",storageGroup:"flags",volatile:!0},[fs]:{exposure:"hidden"},[ps]:{exposure:"hidden"},[gs]:{exposure:"hidden"},[ms]:{exposure:"hidden"},[ys]:{exposure:"hidden"},[bs]:{exposure:"hidden"},[_s]:{exposure:"hidden"},[An]:{exposure:"event"},[Fn]:{exposure:"event"},[On]:{exposure:"event"},[Ln]:{exposure:"event"},[Ss]:{exposure:"event"},[xs]:{exposure:"event"},[Cs]:{exposure:"event"},[Ts]:{exposure:"event"},[Ms]:{exposure:"event"},[Es]:{exposure:"event"},[Is]:{exposure:"event"},[Rs]:{exposure:"event"},[Ps]:{exposure:"event"},[As]:{exposure:"event"},[Fs]:{exposure:"event"}},nw=[[Bn,{exposure:"hidden"}],[Hn,{exposure:"hidden"}],[zn,{exposure:"hidden"}]],sw=t=>{var e=rw[t];if(e)return e;for(var i of nw){var r=i[1];if(0===t.indexOf(i[0]))return r}},aw={flags:cs,surveys:ss},ow=["cookie","localstorage","localstorage+cookie","sessionstorage","memory"],lw=t=>t+"_cookie_identity_change_pending",uw="main",hw=(t,e)=>{Ui(t,((i,r)=>{var n=sw(r);n&&"event"!==n.exposure||{}.hasOwnProperty.call(e,r)||delete t[r]}))};class dw{constructor(e,i,r){if(void 0===r&&(r=!0),this.ea={},this.ia=!1,this.ra=!1,this.na=!1,this.sa=!1,this.vn=e,this.aa=r,this.props={},this.oa=void 0,this.la=(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.Us=this.ua(e),this.ra=this.ha(e),this.load(),e.debug&&Bi.info("Persistence loaded",e.persistence,p({},this.props)),this.update_config(e,e,i),this.save(),t){var n=()=>this.flush();Yi(t,"beforeunload",n,{capture:!1}),Yi(t,"pagehide",n,{capture:!1})}}da(){var t,e=null==(t=this.vn)?void 0:t.persistence_save_debounce_ms;return it(e)&&e>0?e:0}va(t){if(this.vn.cookieWinsOnConflict&&"localstorage+cookie"===this.vn.persistence.toLowerCase())if(t)try{var e=gp(t,this.vn.cookie_persisted_properties||[]),i=yp(e,this.vn.cookie_persisted_properties||[]),r=JSON.stringify(e)+"|"+JSON.stringify(i),n=lp.ti(this.la)||void 0;n&&_p(this.la,n)===r&&(this.ca=r,this.fa=n)}catch(t){}else try{var s=lp.ti(this.la)||void 0;this.ca=s?_p(this.la,s):void 0,this.fa=s}catch(t){}}syncCookieProperties(){return this.pa(this.vn)}pa(t,e){if(void 0===e&&(e=!1),this.ga&&!e||this.sa||!t.cookieWinsOnConflict||"localstorage+cookie"!==t.persistence.toLowerCase())return!1;var i;try{i=lp.ti(this.la)||void 0}catch(t){}if(!i||i===this.fa)return!1;var r,n=_p(this.la,i);try{r=pp(JSON.parse(i))}catch(t){return!1}if((lp.ti(this.la)||void 0)!==i)return!1;this.ca=n,this.fa=i;var s=bp(this.la,i),a=[...vp,...s.properties],o={};if(Object.keys(r).forEach((t=>{var e=r[t];(K(e)||tt(e)||""===e||t===fs&&e!==$s&&e!==Ns)&&(o[t]=!0,delete r[t])})),J(r))return!1;var l=pn in r||r[fs]===$s||r[fs]===Ns,u=this.props[pn],h=this.props[fs],d=Wi({},this.props);[...vp,...t.cookie_persisted_properties||[]].forEach((t=>{if(-1!==a.indexOf(t)&&!(t in r)&&!o[t]&&(l||t!==pn&&t!==fs)){var e=d[t];!s.isValid&&-1!==vp.indexOf(t)&&(!1===e||0===e)||delete d[t]}})),this.props=Wi(d,r),!l||fs in r||fs in this.props||this.ma(fs,$s);var v=this.props[pn],c=this.props[fs];return!l||v===u&&c===h||(this.na=!0,xp.ei(lw(this.la),!0),this.ya(es),this.ya(Gn),this.ya(Vn),this.ya(Qn),this.ya(Jn),this.ya(Kn),this.ya(cs),this.ya(vs),this.ya(hs),c===$s&&(h===Ns||r[fs]===$s||!K(u)&&v!==u)&&(hw(this.props,r),this.ya(is)),c===Ns?this.props.$user_id=v:delete this.props.$user_id,this.ya(yn)),!0}consumeCookieIdentityChange(){var t=lw(this.la),e=this.na||!!xp.ti(t);return this.na=!1,e&&xp.ri(t),e}ba(t){return void 0===t&&(t=!1),!(this.sa||this.ga&&!t||!this.vn.cookieWinsOnConflict||"localstorage+cookie"!==this.vn.persistence.toLowerCase()||(this.sa=!0,0))}_a(){this.sa&&(K(this.wa)||(clearTimeout(this.wa),this.wa=void 0),delete this.ea[uw],this.ka(!0))}Sa(t){if(void 0===t&&(t=!0),this.sa)try{t?this._a():K(this.wa)||(clearTimeout(this.wa),this.wa=void 0)}finally{this.sa=!1}}isDisabled(){return!!this.ga}ua(e){-1===ow.indexOf(e.persistence.toLowerCase())&&(Bi.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=[...vp,...e];return p({},hp,{ni(t){try{var e,n={};try{e=lp.ti(t)||void 0,n=e?pp(JSON.parse(e)):{}}catch(t){}var s,a=JSON.parse(hp.ti(t)||"{}");if(i){var o=bp(t,e),l=[...vp,...o.properties],u={};Object.keys(n).forEach((t=>{var e=n[t];tt(e)||""===e||t===fs&&e!==$s&&e!==Ns||(u[t]=e)}));var h=pn in u||u[fs]===$s||u[fs]===Ns;if(Object.keys(u).length>0){var d,v=a[pn],c=null!==(d=a[fs])&&void 0!==d?d:$s;r.forEach((t=>{if(-1!==l.indexOf(t)&&!(t in n)&&(h||t!==pn&&t!==fs)){var e=a[t];!o.isValid&&-1!==vp.indexOf(t)&&(!1===e||0===e)||delete a[t]}})),!h||fs in n||fs in a||(a[fs]=$s),!h||(pn in u?u[pn]:a[pn])===v&&(fs in u?u[fs]:a[fs])===c||(dp.forEach((t=>delete a[t])),u[fs]===Ns&&pn in u?a.$user_id=u[pn]:delete a.$user_id,u[fs]!==Ns&&(delete a[rs],delete a[is]),delete a.__alias)}s=Wi(a,u)}else s=Wi(n,a);return hp.ei(t,s),s}catch(t){}return null},ei(t,r,n,s,a,o){var l=hp.ei(t,r,void 0,void 0,o);try{var u=gp(r,e);if(Object.keys(u).length){if(i){var h=cp(t),d=yp(u,e);if(lp.ei(h,d,n,s,a,o),lp.ti(h)!==JSON.stringify(d)){lp.ri(h,s);var v=gp(r);return lp.ei(t,v,n,s,a,o),l}}lp.ei(t,u,n,s,a,o)}}catch(t){hp.ii(t)}return l},ri(e,i){try{null==t||t.localStorage.removeItem(e),lp.ri(e,i),lp.ri(cp(e),i)}catch(t){hp.ii(t)}}})}(e.cookie_persisted_properties||[],e.cookieWinsOnConflict),n=!1,s=e.persistence.toLowerCase();return"localstorage"===s&&hp.Xr()?(i=hp,n=!0):"localstorage+cookie"===s&&r.Xr()?(i=r,n=!0):"sessionstorage"===s&&xp.Xr()?i=xp:"memory"===s?i=kp:"cookie"===s?i=lp:r.Xr()?(i=r,n=!0):i=lp,this.ia=n,i}xa(t){return this.la+"__"+t}ha(t){return this.ia&&!!t.split_storage}properties(){var t={};return Ui(this.props,((e,i)=>{var r=sw(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.ga||t){var e=this.vn.cookieWinsOnConflict&&"localstorage+cookie"===this.vn.persistence.toLowerCase(),i=e?hp.ni(this.la):null,r={};if(e)try{Ui(r=pp(lp.ni(this.la)),((t,e)=>{(K(t)||tt(t)||""===t)&&delete r[e]}))}catch(t){}var n=this.Us.ni(this.la);if(n&&(this.props=Wi({},n)),this.ra&&this.Ca(),e&&n){var s,a,o=null==i?void 0:i[pn],l=null!==(s=null==i?void 0:i[fs])&&void 0!==s?s:$s,u=n[pn],h=null!==(a=n[fs])&&void 0!==a?a:$s;if(u!==o||h!==l){this.na=!0,xp.ei(lw(this.la),!0);var d=Wi({},this.props);dp.forEach((t=>delete d[t])),h===$s&&(l===Ns||r[fs]===$s||!K(o)&&u!==o)&&(hw(d,r),delete d[is]),this.props=d;var v=new Set;dp.forEach((t=>{var e,i=null==(e=sw(t))?void 0:e.storageGroup;i&&v.add(i)})),v.forEach((t=>{var e={};Ui(this.props,((i,r)=>{var n;(null==(n=sw(r))?void 0:n.storageGroup)===t&&(e[r]=i)})),J(e)?(hp.ri(this.xa(t)),this.ea[t]={}):hp.ei(this.xa(t),e)&&(this.ea[t]={persisted:!0,fingerprint:this.Ta(e,t)})}))}}xp.ti(lw(this.la))&&(this.na=!0)}}Ca(){for(var t of iw){var e=hp.ni(this.xa(t));if(e&&!J(e)){var i=this.Ma(t);i.persisted=!0,this.Ea(t)||(i.fingerprint=this.Ta(e,t)),this.Ia(t,e)||Wi(this.props,e)}}}Ea(t){return Object.keys(this.props).some((e=>{var i;return(null==(i=sw(e))?void 0:i.storageGroup)===t}))}Ia(t,e){var i=aw[t];if(!i)return!1;var r=e[i],n=this.props[i];return it(r)&&it(n)&&n>r}refreshKey(t){var e;if(!this.ga){var i=this.ra?null==(e=sw(t))?void 0:e.storageGroup:void 0,r=i?hp.ni(this.xa(i)):this.Us.ni(this.la);if(r&&t in r)this.ma(t,r[t]);else{if(i){var n=this.Us.ni(this.la);if(n&&t in n)return void this.ma(t,n[t])}this.ya(t)}}}save(){if(!this.ga){var t=this.da();t>0?K(this.wa)&&(this.wa=setTimeout((()=>{this.wa=void 0,this.ka()}),t)):this.ka()}}flush(){K(this.wa)||(clearTimeout(this.wa),this.wa=void 0,this.ka())}ka(t){void 0===t&&(t=!1),this.ga||this.sa&&!t||(t||this.syncCookieProperties(),this.ra?this.Ra():this.Pa(this.Us,this.la,this.props,uw)&&this.va(this.props))}Ra(){var t=this.Aa(),e=t.main,i=t.groups;for(var r of(this.Pa(this.Us,this.la,e,uw)&&this.va(e),iw)){var n,s=i[r];(!J(s)||null!=(n=this.ea[r])&&n.persisted)&&this.Pa(hp,this.xa(r),s,r)}}Aa(){var t={},e={flags:{},surveys:{}};return Ui(this.props,((i,r)=>{var n,s=null==(n=sw(r))?void 0:n.storageGroup;s?e[s][r]=i:t[r]=i})),{main:t,groups:e}}Ta(t,e){if(e===uw)return JSON.stringify(t)+"|"+this.Fa+"|"+this.Oa+"|"+this.La;var i={};return Ui(t,((t,e)=>{var r;i[e]=null!=(r=sw(e))&&r.volatile?"__volatile__":t})),JSON.stringify(i)}Pa(t,e,i,r){var n,s=this.Ma(r);if(r!==uw&&!s.dirty&&!K(s.fingerprint))return!1;try{if((n=this.Ta(i,r))===s.fingerprint)return s.dirty=!1,!1}catch(t){n=void 0}return t.ei(e,i,this.Fa,this.Oa,this.La,this.vn.debug)?(s.dirty=!1,r!==uw&&(s.persisted=!0),K(n)||(s.fingerprint=n),!0):(this.vn.debug&&Bi.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(K(this.wa)||(clearTimeout(this.wa),this.wa=void 0),this.Us.ri(this.la,!1),this.Us.ri(this.la,!0),!i&&this.aa)for(var r of iw)hp.ri(this.xa(r));i?delete this.ea[uw]:this.ea={},this.ca=void 0,this.fa=void 0}clear(){this.remove(),this.props={}}register_once(t,e,i){if(Q(t)){this.syncCookieProperties(),K(e)&&(e="None"),this.Fa=K(i)?this.Da:i;var r=!1;if(Ui(t,((t,i)=>{this.props.hasOwnProperty(i)&&this.props[i]!==e||(this.ma(i,t),r=!0)})),r)return this.save(),!0}return!1}register(t,e){if(Q(t)){this.syncCookieProperties(),this.Fa=K(e)?this.Da:e;var i=!1;if(Ui(t,((e,r)=>{t.hasOwnProperty(r)&&(this.props[r]!==e||Q(e)||G(e))&&(this.ma(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.ya(r),i=!0);i&&this.save()}update_campaign_params(){var t=null==r?void 0:r.URL;if(t!==this.oa){var e=jo(this.vn.custom_campaign_params,this.vn.mask_personal_data_properties,this.vn.custom_personal_data_properties);J(Qi(e))||this.register(e),this.oa=t}}update_search_keyword(){var t;this.register((t=null==r?void 0:r.referrer)?Ho(t):{})}update_referrer_info(){var t;this.register_once({$referrer:Wo(),$referring_domain:null!=r&&r.referrer&&(null==(t=ir(r.referrer))?void 0:t.host)||Uo},void 0)}set_initial_person_info(){this.props[ms]||this.props[ys]||this.register_once({[bs]:Vo(this.vn.mask_personal_data_properties,this.vn.custom_personal_data_properties,this.vn.disable_capture_url_hashes)},void 0)}get_initial_props(){var t={};Ui([ys,ms],(e=>{var i=this.props[e];i&&Ui(i,(function(e,i){t["$initial_"+H(i)]=e}))}));var e=this.props[bs];if(e){var i=function(t,e){void 0===e&&(e=!1);var i=Go(t,e),r={};return Ui(i,(function(t,e){r["$initial_"+H(e)]=t})),r}(e,this.vn.disable_capture_url_hashes);Wi(t,i)}return t}safe_merge(t){return Ui(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,a=t.cookieWinsOnConflict!==e.cookieWinsOnConflict,o=t.disable_persistence||!!i,l=!!this.ga&&!o;o||this.pa(e,l),this.vn=t,!o&&(r||n||a)&&(this.ca=void 0,this.fa=void 0,this.pa(p({},t,{cookie_persisted_properties:e.cookie_persisted_properties}),l));var u=s||a?this.ua(t):this.Us,h=this.ha(t),d=s||h!==this.ra,v=!o&&(d||t.cross_subdomain_cookie!==this.Oa||t.secure_cookie!==this.La)&&this.ba(l);try{if(this.Da=this.Fa=t.cookie_expiration,this.set_disabled(o),this.set_cross_subdomain(t.cross_subdomain_cookie),this.set_secure(t.secure_cookie),d){var c=this.props;this.clear(),this.Us=u,this.ra=h,this.props=c,this.save()}else a&&(this.Us=u,o||(delete this.ea[uw],this.ka()))}finally{v&&this.Sa()}}set_disabled(t){this.ga=t,this.ga?this.remove():this.save()}set_cross_subdomain(t){t!==this.Oa&&(this.Oa=t,this.remove({keepGroupEntries:!0}),this.save())}set_secure(t){t!==this.La&&(this.La=t,this.remove({keepGroupEntries:!0}),this.save())}set_event_timer(t,e){var i=this.props[bn]||{};i[t]=e,this.ma(bn,i),this.save()}remove_event_timer(t){var e=this.props[bn]||{},i=e[t];return K(i)||(delete e[t],this.ma(bn,e),this.save()),i}get_property(t){return this.props[t]}set_property(t,e){this.ma(t,e),this.save()}ma(t,e){var i;this.props[t]=e,null!=(i=sw(t))&&i.volatile||this.$a(t)}ya(t){delete this.props[t],this.$a(t)}$a(t){var e,i=null==(e=sw(t))?void 0:e.storageGroup;i&&(this.Ma(i).dirty=!0)}Ma(t){return this.ea[t]||(this.ea[t]={})}}var vw=Hi("[RateLimiter]");class cw{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=>{vw.info((t||"events")+" is quota limited."),this.serverLimits[t]=(new Date).getTime()+6e4}))}catch(t){return void vw.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,a=(new Date).getTime(),o=null!==(e=null==(i=this.instance.persistence)?void 0:i.get_property(gs))&&void 0!==e?e:{tokens:n,last:a};o.tokens+=(a-o.last)/1e3*s,o.last=a,o.tokens>n&&(o.tokens=n);var l=1>o.tokens;if(l||t||(o.tokens=Math.max(0,o.tokens-1)),l&&!t){var u=(it(o.dropped)?o.dropped:0)+1;o.dropped=u,!this.lastEventRateLimited&&this.Na(u)&&(o.dropped=0)}return this.lastEventRateLimited=l,null==(r=this.instance.persistence)||r.set_property(gs,o),{isRateLimited:l,remainingTokens:o.tokens}}qa(t){var e=this.instance.config.property_denylist;return!G(e)||!e.includes(t)}ja(){var t;if(this.qa("$current_url")&&this.qa("$pathname")&&null!=n&&n.pathname)return""+(null!==(t=n.origin)&&void 0!==t?t:"")+n.pathname}Na(t){var e,i,r=this.captureEventsBurstLimit,n=this.captureEventsPerSecond,s=this.ja(),a=this.qa("$session_id")?null==(e=(i=this.instance).get_session_id)?void 0:e.call(i):void 0,o=[t+" event(s) dropped since the last warning",s?"triggered on "+s:void 0,a?"session "+a:void 0].filter(Boolean).join(", ");return!!this.instance.capture("$$client_ingestion_warning",{$$client_ingestion_warning_message:"posthog-js client rate limited: "+o+". 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 fw=Hi("[RemoteConfig]");class pw{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}Ba(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()}Ha(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 fw.info("Using preloaded remote config",this.remoteConfig),void this.za(this.remoteConfig);if(this._instance.Ua())return void fw.warn("Remote config is disabled. Falling back to local config.");this.Ba((t=>{if(!t)return fw.info("No config found after loading remote JS config. Falling back to JSON."),void this.Ha((t=>{this.za(t.json,t)}));this.za(t)}))}catch(t){fw.error("Error loading remote config",t),this.za()}}za(t,e){!t&&e&&(0===e.statusCode?e.error||fw.warn("Failed to fetch remote config from PostHog."):fw.error("Failed to fetch remote config from PostHog."));try{this._instance.za(t?{ok:!0,config:t}:{ok:!1})}catch(t){fw.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){fw.error("Error loading feature flags",t)}}}var gw=!!a||!!s,mw="text/plain",yw=!1,bw=(t,e)=>{var i=t.split("#"),r=i[1],n=i[0].split("?"),s=n[0],a=n[1];if(!a)return t;var o=a.split("&").filter((t=>t.split("=")[0]!==e)).join("&");return s+(o?"?"+o:"")+(r?"#"+r:"")},_w=function(t,e,i){var r;void 0===i&&(i=!0);var n=t.split("?"),s=n[0],a=n[1],o=p({},e),l=null!==(r=null==a?void 0:a.split("&").map((t=>{var e,r=t.split("="),n=r[0],s=i&&null!==(e=o[n])&&void 0!==e?e:r[1];return delete o[n],n+"="+s})))&&void 0!==r?r:[],u=rr(o);return u&&l.push(u),l.length>0?s+"?"+l.join("&"):s},ww=t=>{if(t.Wa)return t.Wa;var e=t.data,i=t.compression;if(e){if(i===Mf){var r=no(so(er(e)),{mtime:0});return{contentType:mw,body:r.buffer.slice(r.byteOffset,r.byteOffset+r.byteLength),estimatedSize:r.byteLength}}if(i===Ef){var n=function(t){return t?btoa(encodeURIComponent(t).replace(/%([0-9A-F]{2})/g,((t,e)=>String.fromCharCode(parseInt(e,16))))):t}(er(e)),s=(t=>"data="+encodeURIComponent("string"==typeof t?t:er(t)))(n);return{contentType:"application/x-www-form-urlencoded",body:s,estimatedSize:new Blob([s]).size}}var a=er(e);return{contentType:"application/json",body:a,estimatedSize:new Blob([a]).size}}},kw=t=>{var e,i,r=()=>"sendBeacon"===t.transport?{url:_w(t.url,{compression:Ef}),encodedBody:ww(p({},t,{compression:Ef,Wa:void 0}))}:{url:bw(t.url,"compression"),encodedBody:ww(p({},t,{compression:void 0,Wa:void 0}))};try{e=ww(t)}catch(e){if(Fe(t.compression,nr(t.url,"compression")))return Bi.error("Failed to gzip request body, sending uncompressed payload",e),r();throw e}return e&&Fe(t.compression,nr(t.url,"compression"))&&!((i=e.body)instanceof ArrayBuffer?Ae(new Uint8Array(i)):ArrayBuffer.isView(i)&&Ae(new Uint8Array(i.buffer,i.byteOffset,i.byteLength)))?(yw=!0,r()):{url:t.url,encodedBody:e}},Sw=t=>{try{return kw(t)}catch(e){return Bi.error(e),void(null==t.callback||t.callback({statusCode:0,error:e}))}},xw=function(){var t=f((function*(t){var e=er(t.data),i=yield Ne(e,qi.DEBUG,{rethrow:!0});if(!i)return t;var r=yield i.arrayBuffer();return p({},t,{Wa:{contentType:mw,body:r,estimatedSize:r.byteLength}})}));return function(e){return t.apply(this,arguments)}}(),Cw=/Failed to fetch|NetworkError|Load failed/i,Tw=t=>"TypeError"===(null==t?void 0:t.name)&&Cw.test((null==t?void 0:t.message)||""),Mw=t=>{var e=Sw(t);if(e){var i=e.url,r=e.encodedBody,n=null!=r?r:{},a=n.contentType,l=n.body,u=n.estimatedSize,h=new Headers;Ui(t.headers,(function(t,e){h.append(e,t)})),a&&h.append("Content-Type",a);var d=null,v=!1;if(o){var c=new o;d={signal:c.signal,timeout:setTimeout((()=>{var e;v=!0,c.abort(Ce("AbortError","PostHog request timed out"+((e=t.timeout)?" after "+e+"ms":"")))}),t.timeout)}}var f=e=>{v&&"AbortError"===(null==e?void 0:e.name)||Tw(e)?Bi.warn(e):Bi.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.Va&&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){Bi.error(t)}null==t.callback||t.callback(r)})))).catch(f).finally((()=>d?clearTimeout(d.timeout):null))}catch(t){d&&clearTimeout(d.timeout),f(t)}}},Ew=t=>{try{var e,r=kw(t),n=r.url,s=r.encodedBody,a=null!=s?s:{},o=a.body,l=a.estimatedSize;if(!o)return;var u=o instanceof Blob?o:new Blob([o],{type:a.contentType});if(i.sendBeacon(n,u))return;var h=G(t.data)?t.data:null==(e=t.data)?void 0:e.batch;if(G(h)&&h.length>1&&(null!=l?l:0)>16384){var d=Math.ceil(h.length/2),v=e=>G(t.data)?e:p({},t.data,{batch:e});return Ew(p({},t,{data:v(h.slice(0,d))})),void Ew(p({},t,{data:v(h.slice(d))}))}Bi.warn("Beacon of ~"+(null!=l?l:0)+" bytes was rejected by the browser, falling back to fetch"),Mw(p({},t,{Va:!0}))}catch(t){Bi.warn("Beacon send failed",t)}},Iw=(t,e,i,r)=>{var n="query"===r?"POST"===e?"sent_at":"_":void 0;return _w(i===Mf?bw(t,"compression"):t,p({},n?{[n]:Date.now().toString()}:{},i===Mf?{}:{compression:i}))},Rw=[];s&&Rw.push({transport:"fetch",method:Mw}),a&&Rw.push({transport:"XHR",method(t){var e=Sw(t);if(e){var i=new a,r=e.encodedBody;i.open(t.method||"GET",e.url,!0);var n=null!=r?r:{},s=n.contentType,o=n.body;Ui(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(o)}}}),null!=i&&i.sendBeacon&&Rw.push({transport:"sendBeacon",method:Ew});var Pw=3e3;class Aw{constructor(t,e){this.Ga=!0,this.Za=[],this.Qa=gt((null==e?void 0:e.flush_interval_ms)||Pw,250,5e3,Bi.createLogger("flush interval"),Pw),this.Ja=t}enqueue(t){this.Za.push(t),this.Ka||this.Ya()}unload(){this.Xa();var t=this.Za.length>0?this.eo():{},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.io(p({},t,{transport:"sendBeacon"}))}))}enable(){this.Ga=!1,this.Ya()}Ya(){var t=this;this.Ga||(this.Ka=setTimeout((()=>{if(this.Xa(),this.Za.length>0){var e=this.eo(),i=function(){var i=e[r],n=(new Date).getTime();i.data&&G(i.data)&&Ui(i.data,(t=>{t.offset=Math.abs(t.timestamp-n),delete t.timestamp})),t.io(i)};for(var r in e)i()}}),this.Qa))}io(t){try{this.Ja(t)}catch(t){Bi.error(t)}}Xa(){clearTimeout(this.Ka),this.Ka=void 0}eo(){var t={};return Ui(this.Za,(e=>{var i,r=e,n=(r?r.batchKey:null)||r.url;K(t[n])&&(t[n]=p({},r,{data:[]})),null==(i=t[n].data)||i.push(r.data)})),this.Za=[],t}}var Fw=["retriesPerformedSoFar"];class Ow{constructor(e){this.ro=!1,this.no=3e3,this.Za=[],this._instance=e,this.Za=[],this.so=!0,!K(t)&&"onLine"in t.navigator&&(this.so=t.navigator.onLine,this.ao=()=>{this.so=!0,this.oo()},this.lo=()=>{this.so=!1},Yi(t,"online",this.ao),Yi(t,"offline",this.lo))}get length(){return this.Za.length}retriableRequest(t){var e=t.retriesPerformedSoFar,i=g(t,Fw);rt(e)&&(i.url=_w(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.Yn(p({retriesPerformedSoFar:e},i));0===t.statusCode&&Bi.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)}}))}Yn(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.Za.push({retryAt:r,requestOptions:t});var n="Enqueued failed request for retry in "+i;navigator.onLine||(n+=" (Browser is offline)"),Bi.warn(n),this.ro||(this.ro=!0,this.uo())}uo(){if(this.ho&&clearTimeout(this.ho),0===this.Za.length)return this.ro=!1,void(this.ho=void 0);this.ho=setTimeout((()=>{this.so&&this.Za.length>0&&this.oo(),this.uo()}),this.no)}oo(){var t=Date.now(),e=[],i=this.Za.filter((i=>t>i.retryAt||(e.push(i),!1)));if(this.Za=e,i.length>0)for(var r of i)this.retriableRequest(r.requestOptions)}unload(){for(var e of(this.ho&&(clearTimeout(this.ho),this.ho=void 0),this.ro=!1,K(t)||(this.ao&&(t.removeEventListener("online",this.ao),this.ao=void 0),this.lo&&(t.removeEventListener("offline",this.lo),this.lo=void 0)),this.Za)){var i=e.requestOptions;try{this._instance._send_request(p({},i,{transport:"sendBeacon"}))}catch(t){Bi.error(t)}}this.Za=[]}}class Lw{constructor(t){this.do=()=>{var t,e,i,r;this.vo||(this.vo={});var n=this.scrollElement(),s=this.scrollY(),a=n?Math.max(0,n.scrollHeight-n.clientHeight):0,o=s+((null==n?void 0:n.clientHeight)||0),l=(null==n?void 0:n.scrollHeight)||0;this.vo.lastScrollY=Math.ceil(s),this.vo.maxScrollY=Math.max(s,null!==(t=this.vo.maxScrollY)&&void 0!==t?t:0),this.vo.maxScrollHeight=Math.max(a,null!==(e=this.vo.maxScrollHeight)&&void 0!==e?e:0),this.vo.lastContentY=o,this.vo.maxContentY=Math.max(o,null!==(i=this.vo.maxContentY)&&void 0!==i?i:0),this.vo.maxContentHeight=Math.max(l,null!==(r=this.vo.maxContentHeight)&&void 0!==r?r:0)},this._instance=t}get co(){return this._instance.config.scroll_root_selector}getContext(){return this.vo}resetContext(){var t=this.vo;return setTimeout(this.do,0),t}startMeasuringScrollPosition(){Yi(t,"scroll",this.do,{capture:!0}),Yi(t,"scrollend",this.do,{capture:!0}),Yi(t,"resize",this.do)}scrollElement(){if(!this.co)return null==t?void 0:t.document.documentElement;var e=G(this.co)?this.co:[this.co];for(var i of e){var r=null==t?void 0:t.document.querySelector(i);if(r)return r}}fo(e){var i="y"===e?"scrollTop":"scrollLeft";if(this.co){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.fo("y")}scrollX(){return this.fo("x")}}var Dw=t=>Vo(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 $w{constructor(t,e,i,r){this.xt=t=>{var e=this.po();if(!e||e.sessionId!==t){var i={sessionId:t,props:this.mo(this._instance)};this.yo.register({[ps]:i})}},this._instance=t,this.bo=e,this.yo=i,this.mo=r||Dw,this.bo.onSessionId(this.xt)}po(){return this.yo.props[ps]}getSetOnceProps(){var t,e=null==(t=this.po())?void 0:t.props;return e?"r"in e?Go(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 Ui(Qi(this.getSetOnceProps()),((e,i)=>{"$current_url"===i&&(i="url"),t["$session_entry_"+H(i)]=e})),t}}class Nw{on(t,e){return this._o[t]||(this._o[t]=[]),this._o[t].push(e),()=>{this._o[t]=this._o[t].filter((t=>t!==e))}}emit(t,e){for(var i of this._o[t]||[])i(e);for(var r of this._o["*"]||[])r(t,e)}constructor(){this._o={}}}var qw=Hi("[SessionId]"),jw=864e5;class Bw{on(t,e){return this.wo.on(t,e)}constructor(t,e,i){var r;if(this.ko=null,this.So=null,this.xo=[],this.Co=void 0,this.To=!1,this.wo=new Nw,this.Mo=(t,e)=>!(!rt(t)||!rt(e))&&Math.abs(t-e)>this.sessionTimeoutMs,!t.persistence)throw new Error("SessionIdManager requires a PostHogPersistence instance");if(t.config.cookieless_mode===Ds)throw new Error('SessionIdManager cannot be used with cookieless_mode="always"');this.vn=t.config,this.yo=t.persistence,this.Ct=void 0,this.Le=void 0,this._sessionStartTimestamp=null,this.Eo=void 0,this._sessionActivityTimestamp=null,this.Io=e||np,this.Ro=i||np;var n=this.vn.persistence_name||this.vn.token;if(this._sessionTimeoutMs=1e3*gt(this.vn.session_idle_timeout_seconds||1800,60,36e3,qw.createLogger("session_idle_timeout_seconds"),1800),t.register({$configured_session_timeout_ms:this._sessionTimeoutMs}),this.Po(),this.Ao="ph_"+n+"_window_id",this.Fo="ph_"+n+"_primary_window_exists",this.Oo()){var s=xp.ni(this.Ao),a=xp.ni(this.Fo);s&&!a?this.Ct=s:xp.ri(this.Ao),xp.ei(this.Fo,!0)}null!=(r=this.vn.bootstrap)&&r.sessionID&&this.setBootstrapSessionId(this.vn.bootstrap.sessionID),this.Lo()}get sessionTimeoutMs(){return this._sessionTimeoutMs}onSessionId(t){return K(this.xo)&&(this.xo=[]),this.xo.push(t),this.Le&&t(this.Le,this.Ct),()=>{this.xo=this.xo.filter((e=>e!==t))}}Oo(){return"memory"!==this.vn.persistence&&!this.yo.ga&&xp.Xr()}Do(t){t!==this.Ct&&(this.Ct=t,this.Oo()&&xp.ei(this.Ao,t))}$o(){return this.Ct?this.Ct:this.Oo()?xp.ni(this.Ao):null}No(t){var e=this.ko;return!tt(e)&&!tt(t)&&5e3>Math.abs(t-e)}qo(t,e,i){var r=e!==this._sessionActivityTimestamp,n=!(t!==this.Le||i!==this._sessionStartTimestamp);this._sessionStartTimestamp=i,this._sessionActivityTimestamp=e,this.Le=t,n&&!r||n&&this.No(e)||(this.ko=e,this.yo.register({[Dn]:[e,t,i]}))}jo(){var t,e=null==(t=this.vn)?void 0:t.persistence_save_debounce_ms;return rt(e)&&e>0}Bo(){this.jo()?this.yo.refreshKey(Dn):(this.yo.flush(),this.yo.load())}Ho(){var t;if(!tt(this._sessionActivityTimestamp)&&this._sessionActivityTimestamp!==this.ko){this.Bo();var e=this.zo();e[1]===this.Le&&e[2]===this._sessionStartTimestamp&&(this.ko=this._sessionActivityTimestamp,this.yo.register({[Dn]:[this._sessionActivityTimestamp,null!==(t=this.Le)&&void 0!==t?t:null,this._sessionStartTimestamp]}),this.yo.flush())}}Uo(){var t=this.zo()[0],e=rt(t)?t:0,i=rt(this._sessionActivityTimestamp)?this._sessionActivityTimestamp:0;return Math.max(e,i)}Wo(t){return this.Bo(),this.Mo(t,this.Uo())}zo(){var t=this.yo.props[Dn];return G(t)&&2===t.length&&t.push(t[0]),t||[0,null,0]}resetSessionId(){this.ko=null,this.Eo=void 0,clearTimeout(this.Vo),this.Vo=void 0,this.qo(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 qw.error("Bootstrap sessionID cannot be in the future"):i}catch(t){return void qw.error("Invalid sessionID in bootstrap",t)}}(t);return!K(i)&&(e?this.Eo={sessionId:t,sessionStartTimestamp:i}:this.qo(t,(new Date).getTime(),i),!0)}destroy(){this.To=!0,this.Ho(),clearTimeout(this.Vo),this.Vo=void 0,this.Co&&t&&(t.removeEventListener(Bs,this.Co,{capture:!1}),this.Co=void 0),this.xo=[]}Lo(){this.Co=()=>{this.Ho(),this.Oo()&&xp.ri(this.Fo)},Yi(t,Bs,this.Co,{capture:!1})}checkAndGetSessionAndWindowId(t,e,i){if(void 0===t&&(t=!1),void 0===e&&(e=null),void 0===i&&(i=!1),this.vn.cookieless_mode===Ds)throw new Error('checkAndGetSessionAndWindowId should not be called with cookieless_mode="always"');var r=e||(new Date).getTime(),n=this.Le;if(i)this.So=r;else if(tt(this.So)||this.So>r||r-this.So>=1e3){var s,a;null==(s=(a=this.yo).syncCookieProperties)||s.call(a),this.So=r}var o=this.zo(),l=o[1],u=o[2],h=!K(n)&&l!==n,d=this.Uo(),v=this.$o(),c=this.Eo,f=!!c&&(c.sessionStartTimestamp>r+6e4||r-c.sessionStartTimestamp>jw),p=c?f:rt(u)&&Math.abs(r-u)>jw,g=!1,m=h,y=!l||!!c,b=l,_=!y&&!t&&this.Mo(r,d);if(_){(_=this.Wo(r))||qw.info("cross-tab refresh kept the session alive",{sessionId:l});var w=this.zo();l=w[1],u=w[2]}if(y||_||p){m=!1;var k=c&&!f;l=k?c.sessionId:this.Io(),v=this.Ro(),qw.info("new session ID assigned",{sessionId:l,windowId:v,bootstrapped:!!k,changeReason:{noSessionId:y,activityTimeout:_,sessionPastMaximumLength:p}}),u=k?c.sessionStartTimestamp:r,this.Eo=void 0,g=!0}else v||(v=this.Ro(),g=!0),(m=m||l!==b)&&(qw.info("adopted cross-tab session id",{sessionId:l,windowId:v}),g=!0);var S=rt(d)&&t&&!p?d:r,x=rt(u)?u:(new Date).getTime();this.Do(v),this.qo(l,S,x),t||this.Po();var C={noSessionId:y,activityTimeout:_,sessionPastMaximumLength:p,crossTabAdoption:m};return g&&this.xo.forEach((t=>t(l,v,C))),{sessionId:l,windowId:v,sessionStartTimestamp:x,changeReason:g?C:void 0,lastActivityTimestamp:d}}Po(){this.To||(clearTimeout(this.Vo),this.Vo=setTimeout((()=>{if(!this.To)if(this.Wo((new Date).getTime())){var t=this.Le;this.resetSessionId(),this.wo.emit("forcedIdleReset",{idleSessionId:t})}else this.Po()}),1.1*this.sessionTimeoutMs))}}var Hw=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 zw(){return zw=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 Y(r)&&r.length>0?r:void 0}catch(t){return void Bi.info("Unable to resolve $device_model from userAgentData.getHighEntropyValues",t)}})),zw.apply(this,arguments)}var Uw="custom",Ww="i.posthog.com",Vw=/^\/static\//,Gw=["/s/","/e/","/i/"];class Zw{constructor(t){this.Go={},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("."+Ww,".posthog.com")),"https://app.posthog.com"===e?"https://us.posthog.com":e}get region(){return this.Go[this.apiHost]||(this.Go[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":Uw),this.Go[this.apiHost]}Zo(t){if(Vw.test(t)){var e=this.instance.config.asset_host;if("string"==typeof e)return e.trim().replace(/\/$/,"")||void 0}}Qo(t){var e=ir(t);return e?e.protocol+"//"+e.host+e.pathname:void 0}Jo(t,e,i){if("ui"===t)return i;var r=i,n=this.instance.config.rewriteRequestPath;if(n){var s,a=(null==(s=ir(i))?void 0:s.href)||i;r=n(new URL(a)).toString()}if(n&&"api"===t&&Gw.some((t=>0===e.indexOf(t)))){var o=this.Qo(r);if(o){var l,u=this.apiHost,h=this.Ko;(null==(l=h)?void 0:l.apiHost)===u&&h.rewriteRequestPath===n||(h={apiHost:u,rewriteRequestPath:n,urls:new Set},this.Ko=h),h.urls.add(o)}}return r}isIngestionEndpoint(t){var e=this.Ko,i=this.Qo(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.Jo(t,e,this.uiHost+e);if("flags"===t)return this.Jo(t,e,this.flagsApiHost+e);if("assets"===t){var i=this.Zo(e);if(i)return this.Jo(t,e,""+i+e)}if(this.region===Uw)return this.Jo(t,e,this.apiHost+e);var r=Ww+e;switch(t){case"assets":return this.Jo(t,e,"https://"+this.region+"-assets."+r);case"api":return this.Jo(t,e,"https://"+this.region+"."+r)}}}var Qw=Hi("[PostHog ExternalIntegrations]"),Jw={intercom:"intercom-integration",crispChat:"crisp-chat-integration"};class Kw{constructor(t){this._instance=t}Zs(t,e){var i;null==(i=v.__PosthogExtensions__)||null==i.loadExternalDependency||i.loadExternalDependency(this._instance,t,(t=>{if(t)return Qw.error("failed to load script",t);e()}))}startIfEnabledOrStop(){var t=this,e=function(){var e,r,n,s=i[0],a=i[1];!a||null!=(e=v.__PosthogExtensions__)&&null!=(e=e.integrations)&&e[s]||t.Zs(Jw[s],(()=>{var e;null==(e=v.__PosthogExtensions__)||null==(e=e.integrations)||null==(e=e[s])||e.start(t._instance)})),!a&&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 Yw{constructor(t,e){this.I=t,this.Os=e,this.Yo=new Map,this.Rs=!1}add(t){var e=this;return f((function*(){if(e.Rs)throw new Error("Cannot add an extension to a disposed ExtensionRuntime");if(e.Yo.has(t.name))throw new Error('Browser extension "'+t.name+'" is already registered');e.Yo.set(t.name,t);try{var i=t.setup(e.Os);i&&(yield i)}catch(i){var r=e.Yo.get(t.name)===t;r&&e.Yo.delete(t.name),e.I.error('Failed to set up browser extension "'+t.name+'"',i),r&&e.Xo(t)}}))()}getExtension(t){return this.Yo.get(t)}dispose(){if(!this.Rs){this.Rs=!0;var t=Array.from(this.Yo.values()).reverse();for(var e of(this.Yo.clear(),t))this.Xo(e)}}Xo(t){try{var e=null==t.dispose?void 0:t.dispose();e&&Z(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);K(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 tk="extensionsRemoteConfig";class ek{constructor(t){this.Rs=!1,this.instance=t,this.I=Bi,this.tl=t.el,this.kv=new Xw(t),this.onEvent=t=>Tf(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.Rs)return Tf((()=>{}));var e=e=>{try{t(e)}catch(t){this.I.error("Browser extension remote config listener failed",t)}},i=this.instance.il.on(tk,e);return this.tl&&e(this.tl),Tf(i)},this.rl=new Yw(Bi.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(gn))&&void 0!==t?t:this.distinctId}get deviceId(){var t=this.instance.get_property(gn);return"string"==typeof t?t:void 0}get library(){return{name:qi.LIB_NAME,version:qi.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 canCapture(){return this.instance.is_capturing()}get projectToken(){return this.instance.config.token}add(t){return this.rl.add(t)}getExtension(t){return this.rl.getExtension(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 Tf(this.instance.nl(t))}handleRemoteConfig(t){this.Rs||(this.tl=t,this.instance.il.emit(tk,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?_w(n,e.query):n,data:e.body,headers:e.headers,timeout:e.timeoutMs,fireCallbackOnDrop:!0,transport:e.transport,compression:e.compression,compressionFallback:"flags"===e.target&&"best-available"===e.compression?x.Base64:void 0,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.Rs||(this.Rs=!0,this.rl.dispose())}}var ik={},rk=0,nk=()=>{},sk='Consent opt in/out is not valid with cookieless_mode="always" and will be ignored',ak="Surveys module not available",ok="sanitize_properties is deprecated. Use before_send instead",lk="Invalid value for property_denylist config: ",uk=["token","distinct_id",ks],hk="posthog",dk=!gw&&-1===(null==u?void 0:u.indexOf("MSIE"))&&-1===(null==u?void 0:u.indexOf("Mozilla")),vk=t=>{var e={};return t&&"unset"!==t?("2025-11-30">t||(e.strictMinimumDuration=!0),"2026-05-30">t||(e.canvasCapture={resolutionScale:.6}),"2026-06-25">t||(e.streamNetworkBody=!0),"2026-08-30">t||(e.captureJsonLd=!0),e):e},ck=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:Ki(null==r?void 0:r.location),persistence:"localStorage+cookie",persistence_name:"",cookie_persisted_properties:[],loaded:nk,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&&Y(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){Bi.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:qs,before_send:void 0,get_current_url:void 0,request_queue_config:{flush_interval_ms:Pw},error_tracking:{},_onCapture:nk},(t=>({rageclick:t&&t>="2026-05-30"?{content_ignorelist:Ar,ignore_text_selection:!0}:!t||"2025-11-30">t||{content_ignorelist:!0},capture_pageview:!t||"2025-05-24">t||"history_change",session_recording:vk(t),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))},fk=[["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"]],pk=t=>{var e={};for(var i of fk){var r=i[0],n=i[1];K(t[r])||(e[n]=t[r])}var s=Wi({},e,t),a=t.__preview_external_dependency_versioned_paths;return K(a)||(K(t.strict_script_versioning)&&(s.strict_script_versioning=!!a),Y(a)&&K(t.asset_host)&&(s.asset_host=a)),G(t.property_blacklist)&&(K(t.property_denylist)?s.property_denylist=t.property_blacklist:G(t.property_denylist)?s.property_denylist=[...t.property_blacklist,...t.property_denylist]:Bi.error(lk+t.property_denylist)),s};class gk{constructor(){this.__forceAllowLocalhost=!1}get sl(){return this.__forceAllowLocalhost}set sl(t){Bi.error("WebPerformanceObserver is deprecated and has no impact on network capture. Use `_forceAllowLocalhostNetworkCapture` on `posthog.sessionRecording`"),this.__forceAllowLocalhost=t}}class mk{al(t,e){if(t){var i=this.Yo.indexOf(t);-1!==i&&this.Yo.splice(i,1)}return this.Yo.push(e),null==e.initialize||e.initialize(),e}ol(){return this.config.cookieless_mode===Ds||this.config.cookieless_mode===Ls&&this.consent.isRejected()}ll(){if(!this.ol()&&this.get_distinct_id()===ws){var t=this.persistence;if(t){this.ul()||t.load(!0);var e=this.get_distinct_id();if(!e||e===ws){var i=this.config.get_device_id(np());this.register({distinct_id:i,$device_id:i}),t.set_property(fs,$s)}this.hl()}}}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 gk,this.dl=!1,this.version=qi.LIB_VERSION,this.vl=new Set,this.cl="",this.il=new Nw,this.Yo=[],this.fl=[],this._calculate_event_properties=this.calculateEventProperties.bind(this),this.config=ck(),this.SentryIntegration=tw,this.sentryIntegration=t=>function(t,e){var i=X_(t,e);return{name:Y_,processEvent:t=>i(t)}}(this,t),this.__request_queue=[],this.__loaded=!1,this.analyticsDefaultEndpoint="/e/",this.pl=!1,this.gl=null,this.ml=null,this.yl=null,this.scrollManager=new Lw(this),this.pageViewManager=new ew(this),this.rateLimiter=new cw(this),this.requestRouter=new Zw(this),this.consent=new V_(this),this.externalIntegrations=new Kw(this);var e=null!==(t=mk.__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=Y(t)?{[t]:e}:t;this.setPersonProperties(r),null==i||i({})},set_once:(t,e,i)=>{var r=Y(t)?{[t]:e}:t;this.setPersonProperties(void 0,r),null==i||i({})}},this.on("eventCaptured",(t=>Bi.info('send "'+(null==t?void 0:t.event)+'"',t)))}init(t,e,i){if(i&&i!==hk){var r,n=null!==(r=ik[i])&&void 0!==r?r:new mk;return n._init(t,e,i),ik[i]=n,ik[hk][i]=n,n}return this._init(t,e,i)}_init(e,i,r){var n,s;void 0===i&&(i={});var a,o=Y(e)?e.trim():"";if(!o)return Bi.critical("PostHog was initialized without a token. This likely indicates a misconfiguration. Please check the first argument passed to posthog.init()"),this;if(this.__loaded)return o!==(null==(a=this.config)?void 0:a.token)?console.warn("[PostHog.js]","You have already initialized PostHog with a different project token! Re-initializing is a no-op, so events will keep going to the project this instance was initialized with. To capture into a second project, load PostHog once, then initialize a named instance after the SDK has loaded, e.g. posthog.init('"+o+"', { ... }, 'project2')"):console.warn("[PostHog.js]","You have already initialized PostHog! Re-initializing is a no-op"),this;this.__loaded=!0,this.config=ck(i.defaults),i.debug=this.bl(i.debug),this._l=i,this.wl=[],i.person_profiles?this.ml=i.person_profiles:i.process_person&&(this.ml=i.process_person);var l=ck(i.defaults),u=pk(i),h=Wi({},l,u,{name:r,token:o});Q(l.rageclick)&&Q(u.rageclick)&&(h.rageclick=Wi({},l.rageclick,u.rageclick)),Q(l.session_recording)&&Q(u.session_recording)&&(h.session_recording=Wi({},l.session_recording,u.session_recording)),this.set_config(h),this.config.on_xhr_error&&Bi.error("on_xhr_error is deprecated. Use on_request_error instead"),this.compression=i.disable_compression?void 0:Mf;var d=this.ul();if(this.persistence=new dw(this.config,d),this.sessionPersistence="sessionStorage"===this.config.persistence||"memory"===this.config.persistence?this.persistence:new dw(p({},this.config,{persistence:"sessionStorage"}),d,!1),this.cl="ph_"+(this.config.persistence_name||this.config.token)+"_session_registered_properties","memory"!==this.config.persistence&&!d&&xp.Xr()){var v=xp.ni(this.cl);G(v)&&v.forEach((t=>{Y(t)&&this.vl.add(t)}))}else xp.ri(this.cl);var c=p({},this.persistence.props),f=p({},this.sessionPersistence.props);this.register({$initialization_time:(new Date).toISOString()}),this.kl=new Aw((t=>this.Sl(t)),this.config.request_queue_config),this.xl=new Ow(this),this.__request_queue=[];var g=this.ol();if(g||(this.sessionManager=new Bw(this),this.sessionPropsManager=new $w(this,this.sessionManager,this.persistence),this.sessionManager.onSessionId(((t,e,i)=>{(null!=i&&i.activityTimeout||null!=i&&i.sessionPastMaximumLength||null!=i&&i.crossTabAdoption)&&this.Cl()}))),this.Tl(),this.config.__preview_deferred_init_extensions?(Bi.info("Deferring extension initialization to improve startup performance"),setTimeout((()=>{this.Ml(g)}),0)):(Bi.info("Initializing extensions synchronously"),this.Ml(g)),qi.DEBUG=qi.DEBUG||this.config.debug,qi.DEBUG&&Bi.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(),b=this.persistence.get_property(fs);if(i.bootstrap.isIdentifiedID&&null!=y&&y!==m&&b===$s)this.identify(m);else if(i.bootstrap.isIdentifiedID&&null!=y&&y!==m&&b===Ns)Bi.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 _=this.config.get_device_id(np()),w=i.bootstrap.isIdentifiedID?_:m;this.persistence.set_property(fs,i.bootstrap.isIdentifiedID?Ns:$s),this.register({distinct_id:m,$device_id:w})}}if(g)this.register_once({distinct_id:ws,$device_id:null},"");else if(!this.get_distinct_id()){var k=this.config.get_device_id(np());this.register_once({distinct_id:k,$device_id:k},""),this.persistence.set_property(fs,$s)}return Yi(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()||np();t.config.get_device_id=r,i.id()&&(t.register({distinct_id:i.id(),$device_id:r()}),t.persistence.set_property(fs,Ns)),e()},n=i.user();"then"in n&&Z(n.then)?n.then(r):r(n)}(t,(()=>{i.register((t=>{"undefined"!=typeof Promise&&Promise.resolve||K_.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()||(K_.info("No userId set, resetting PostHog"),t.reset()),e.event.userId&&e.event.userId!==t.get_distinct_id()&&(K_.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,Hs),identify:t=>e(t,Us),screen:t=>e(t,"$screen")}})(t)).then((()=>{e()}))}))}(this,(()=>this.El())):this.El(),Z(this.config._onCapture)&&this.config._onCapture!==nk&&(Bi.warn("onCapture is deprecated. Please use `before_send` instead"),this.on("eventCaptured",(t=>this.config._onCapture(t.event,t)))),this.config.ip&&Bi.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 zw.apply(this,arguments)}().then((t=>{t&&this.register({[mn]:t})})).catch(nk),this}Il(t){var e=t;return Y(e.name)&&Z(e.setup)}Rl(t,e){this.Il(t)?e.push((()=>{this.Pl().add(t).catch((()=>null==t.dispose?void 0:t.dispose())).catch((e=>{Bi.error('Failed to dispose browser extension "'+t.name+'"',e)}))})):this.Yo.push(t)}Tl(){var t,e,i,r,n,s,a=null!==(t=null==(e=this.config.__extensionClasses)?void 0:e.featureFlags)&&void 0!==t?t:null==(i=mk.__defaultExtensionClasses)?void 0:i.featureFlags;a&&(this.featureFlags&&this.featureFlags instanceof a||(null==(r=this.Al)||r.call(this),this.Al=void 0,this.featureFlags=new a(this)),Z(this.featureFlags.onReloading)&&Z(this.featureFlags.setup)?this.Al||(this.Al=this.featureFlags.onReloading((()=>{this.il.emit("featureFlagsReloading",!0)})),this.Pl().add(this.featureFlags)):null==(n=(s=this.featureFlags).initialize)||n.call(s))}Ml(t){var e,i,r,n,s,a,o,l=performance.now(),u=p({},mk.__defaultExtensionClasses,this.config.__extensionClasses),h=[];u.exceptions&&this.Yo.push(this.exceptions=null!==(e=this.exceptions)&&void 0!==e?e:new u.exceptions(this)),u.historyAutocapture&&this.Yo.push(this.historyAutocapture=new u.historyAutocapture(this)),u.tracingHeaders&&this.Yo.push(this.tracingHeaders=new u.tracingHeaders(this)),u.siteApps&&this.Yo.push(this.siteApps=new u.siteApps(this)),u.sessionRecording&&!t&&this.Yo.push(this.sessionRecording=new u.sessionRecording(this)),this.config.disable_scroll_properties||h.push((()=>{this.scrollManager.startMeasuringScrollPosition()})),u.autocapture&&this.Rl(this.autocapture=new u.autocapture(this),h),u.surveys&&this.Rl(this.surveys=null!==(i=this.surveys)&&void 0!==i?i:new u.surveys(this),h),u.logs&&this.Rl(this.logs=null!==(r=this.logs)&&void 0!==r?r:new u.logs(this),h),u.metrics&&this.Yo.push(this.metrics=null!==(n=this.metrics)&&void 0!==n?n:new u.metrics(this)),u.conversations&&this.Yo.push(this.conversations=null!==(s=this.conversations)&&void 0!==s?s:new u.conversations(this)),u.productTours&&this.Yo.push(this.productTours=new u.productTours(this)),u.heatmaps&&this.Yo.push(this.heatmaps=new u.heatmaps(this)),u.webVitalsAutocapture&&this.Yo.push(this.webVitalsAutocapture=new u.webVitalsAutocapture(this)),u.exceptionObserver&&this.Yo.push(this.exceptionObserver=new u.exceptionObserver(this)),u.deadClicksAutocapture&&this.Yo.push(this.deadClicksAutocapture=new u.deadClicksAutocapture(this,Q_)),u.toolbar&&this.Yo.push(this.toolbar=null!==(a=this.toolbar)&&void 0!==a?a:new u.toolbar(this)),u.experiments&&this.Yo.push(this.experiments=null!==(o=this.experiments)&&void 0!==o?o:new u.experiments(this)),this.Yo.forEach((t=>{t.initialize&&h.push((()=>{null==t.initialize||t.initialize()}))})),h.push((()=>{if(this.Fl){var t=this.Fl;this.Fl=void 0,this.Yo.forEach((e=>null==e.onRemoteConfig?void 0:e.onRemoteConfig(t)))}})),this.Ol(h,l)}Ol(t,e){for(;t.length>0;){if(this.config.__preview_deferred_init_extensions&&performance.now()-e>=30&&t.length>0)return void setTimeout((()=>{this.Ol(t,e)}),0);var i=t.shift();if(i)try{i()}catch(t){Bi.error("Error initializing extension:",t)}}var r=Math.round(performance.now()-e);this.register_for_session({[Ss]:this.config.__preview_deferred_init_extensions?"deferred":"synchronous",[xs]:r}),this.config.__preview_deferred_init_extensions&&Bi.info("PostHog extensions initialized ("+r+"ms)")}za(t){var e;if(!r||!r.body)return Bi.info("document not ready yet, trying again in 500 milliseconds..."),void setTimeout((()=>{this.za(t)}),500);if(this.config.__preview_deferred_init_extensions&&(this.Fl=t),this.el=t,this.compression=void 0,t.ok){var i,n=t.config;n.supportedCompression&&!this.config.disable_compression&&(this.compression=j(n.supportedCompression,Mf)?Mf:j(n.supportedCompression,Ef)?Ef:void 0),null!=(i=n.analytics)&&i.endpoint&&(this.analyticsDefaultEndpoint=n.analytics.endpoint)}this.set_config({person_profiles:this.ml?this.ml:qs}),null==(e=this.Ll)||e.handleRemoteConfig(t),this.Yo.forEach((e=>null==e.onRemoteConfig?void 0:e.onRemoteConfig(t)))}El(){try{this.config.loaded(this)}catch(t){Bi.critical("`loaded` function failed",t)}if(this.Dl(),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.ol())&&this.$l()}),1),this.Nl=new pw(this),this.Nl.load()}Dl(){var t;this.is_capturing()&&this.config.request_batching&&(null==(t=this.kl)||t.enable())}_dom_loaded(){this.is_capturing()&&zi(this.__request_queue,(t=>this.Sl(t))),this.__request_queue=[],this.Dl()}_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.ql()&&this.capture(zs),null==(i=this.logs)||i.flushLogs("sendBeacon"),null==(r=this.kl)||r.unload(),null==(n=this.xl)||n.unload()):this.ql()&&this.capture(zs,null,{transport:"sendBeacon"})}_send_request(t){var e;this.__loaded?dk?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?null!==(e=this.compression)&&void 0!==e?e:t.compressionFallback:t.compression,(K(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,a,o,u,h,d=null!==(e=n.transport)&&void 0!==e?e:"fetch";"sendBeacon"===d&&K(n.compression)&&n.data&&(n.compression=Ef),"POST"===n.method&&n.data&&("capture-body"===n.timestampMode?n.data={api_key:null!==(a=null==(h=(u=(G(s=n.data)?s:[s]).map((t=>p({},t,t.timestamp instanceof Date&&!isNaN(t.timestamp.getTime())?{timestamp:t.timestamp.toISOString()}:{}))))[0])||null==(o=h.properties)?void 0:o.token)&&void 0!==a?a: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()),G(t)?t.map((t=>p({},t,{sent_at:e}))):p({},t,{sent_at:e})}(n.data))),n.url=Iw(n.url,n.method,n.compression,n.timestampMode);var v=Rw.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){Tw(t)?Bi.warn(t):Bi.error(t),null==n.callback||n.callback({statusCode:0,error:t})}};"sendBeacon"!==d&&n.data&&n.compression===Mf&&l&&"undefined"!=typeof Promise&&!yw?xw(n).then((t=>{f(t)})).catch((e=>{if(Oe(e))return yw=!0,void f(p({},n,{compression:void 0,url:Iw(t.url,t.method,void 0,t.timestampMode)}));Le(e)&&(yw=!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}))}Sl(t){this.xl?this.xl.retriableRequest(t):this._send_request(t)}_execute_array(t){rk++;try{var e,i=[],r=[],n=[];zi(t,(t=>{if(t)if(G(e=t[0]))n.push(t);else if(Z(t))try{t.call(this)}catch(e){Bi.error("Error executing queued PostHog call",t,e)}else G(t)&&"alias"===e?i.push(t):G(t)&&-1!==e.indexOf("capture")&&Z(this[e])?n.push(t):r.push(t)}));var s=function(t,e){zi(t,(function(t){try{if(G(t[0])){var i=e;Ui(t,(function(t){i=i[t[0]].apply(i,t.slice(1))}))}else e[t[0]].apply(e,t.slice(1))}catch(e){Bi.error("Error executing queued PostHog call",t,e)}}))};s(i,this),s(r,this),s(n,this)}finally{rk--}}push(t){if(rk>0&&G(t)&&Y(t[0])){var e=mk.prototype[t[0]];Z(e)&&e.apply(this,t.slice(1))}else this._execute_array([t])}capture(t,e,i){var r,n,s,a,o;if(this.__loaded&&this.persistence&&this.sessionPersistence&&this.kl){if(this.is_capturing())if(!K(t)&&Y(t)){this.ll();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&&!Y(null==e?void 0:e.$current_url)&&(Bi.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.jl||Bi.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=xe(null==i?void 0:i.uuid,np),c={uuid:v,event:t,properties:this.calculateEventProperties(t,e||{},d,v)};t===Hs&&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(Yn);(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.Bl(null==i?void 0:i.$set_once,t!==Ws,t===Us);if(m&&(c.$set_once=m),null!=i&&i._noTruncate||(n=this.config.properties_string_max_length,s=c,a=t=>Y(t)?t.slice(0,n):t,o=new Set,c=function t(e,i){if(e!==Object(e))return a?a(e):e;if(!o.has(e)){var r;if(o.add(e),G(e))r=[],zi(e,(e=>{r.push(t(e))}));else{var n={};Ui(e,((e,i)=>{o.has(e)||(n[i]=t(e,i))})),r=n}return r}}(s)),c.timestamp=d,K(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 k.forEach(r),e.forEach(r),i}(c.properties,uk)),t===Nf.DISMISSED||t===Nf.SENT){var y=null==e?void 0:e[qf.SURVEY_ID],b=null==e?void 0:e[qf.SURVEY_ITERATION];Zf({id:y,current_iteration:b}),c.$set=p({},c.$set,{[fo({id:y,current_iteration:b},t===Nf.SENT?"responded":"dismissed")]:!0})}else t===Nf.SHOWN&&(c.$set=p({},c.$set,{[qf.SURVEY_LAST_SEEN_DATE]:(new Date).toISOString()}));if("product tour shown"===t){var _=null==e?void 0:e.$product_tour_type;_&&(c.$set=p({},c.$set,{["$product_tour_last_seen_date/"+_]:(new Date).toISOString()}))}var w=p({},c.properties.$set,c.$set);if(J(w)||this.setPersonPropertiesForFlags(w),!et(this.config.before_send)){var S=this.Jn(c);if(!S)return;(c=S).uuid=xe(c.uuid,np)}this.il.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.Sl(C):this.kl.enqueue(C),c}Bi.critical("This capture call is ignored due to client rate limiting.")}}else Bi.error("No event name provided to posthog.capture")}else Bi.uninitializedWarning("posthog.capture")}_addCaptureHook(t){return this.on("eventCaptured",(e=>t(e.event,e)))}getExtension(t){var e;return null==(e=this.Ll)?void 0:e.getExtension(t)}Pl(){var t;return null!==(t=this.Ll)&&void 0!==t?t:this.Ll=new ek(this)}nl(t){this.fl.push(t);var e=!0;return()=>{if(e){e=!1;var i=this.fl.indexOf(t);-1!==i&&this.fl.splice(i,1)}}}Hl(t){var e,i,r;return void 0===t&&(t=!0),!(null==(e=this.persistence)||!e.consumeCookieIdentityChange())&&(this.yl=null,this.persistence.get_property(fs)===$s&&(null==(r=this.sessionPersistence)||r.clear(),this.vl.clear(),this.zl()),null==(i=this.featureFlags)||i.reset(),t&&this.reloadFeatureFlags(),!0)}calculateEventProperties(e,i,s,a,o){if(s=s||new Date,!this.persistence||!this.sessionPersistence)return i;this.persistence.syncCookieProperties(),this.Hl();var l=o?void 0:this.persistence.remove_event_timer(e),h=p({},i);if(h.token=this.config.token,h.$config_defaults=this.config.defaults,this.ol()&&(h[ks]=!0),"$snapshot"===e){var d=p({},this.persistence.properties(),this.sessionPersistence.properties());return h.distinct_id=d.distinct_id,(!Y(h.distinct_id)&&!it(h.distinct_id)||X(h.distinct_id))&&Bi.error("Invalid distinct_id for replay event. This indicates a bug in your implementation"),h}var v,c=function(e,i,r,s){var a,o,l,h;if(void 0===s&&(s=!1),!u)return{};var d,v=e?[...Do,...i||[]]:[],c=function(t){for(var e=0;_e.length>e;e++){var i=_e[e],r=i[1],n=i[0].exec(t),s=n&&(Z(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={};K(r)||(m.detectGoogleSearchApp=r);var y={},b=null==(a=navigator)||null==(a=a.userAgentData)?void 0:a.platform,_=null==(o=navigator)?void 0:o.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;K(b)||(y.userAgentDataPlatform=b),K(_)||(y.maxTouchPoints=_),K(w)||(y.screenWidth=w),K(k)||(y.screenHeight=k),K(S)||(y.devicePixelRatio=S);var x,C=Wi(Qi({$os:f,$os_version:p,$browser:me(u,navigator.vendor,g,m),$device:we(u),$device_type:ke(u,y),$timezone:Zo(),$timezone_offset:Qo()}),{$current_url:sr(s?Te(null==n?void 0:n.href):null==n?void 0:n.href,v,No),$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:be(u,navigator.vendor,g,m),$browser_language:zo(),$browser_language_prefix:(x=zo(),"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:qi.LIB_NAME,$lib_version:qi.LIB_VERSION,$insert_id:Math.random().toString(36).substring(2,10)+Math.random().toString(36).substring(2,10),$time:Date.now()/1e3});return qi.SDK_DIST_CHANNEL&&(C.$sdk_dist_channel=qi.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(o,s.getTime(),!0),g=f.windowId;h.$session_id=f.sessionId,h.$window_id=g}this.sessionPropsManager&&Wi(h,this.sessionPropsManager.getSessionProps());try{var m;this.sessionRecording&&Wi(h,this.sessionRecording.sdkDebugProperties),h.$sdk_debug_retry_queue_size=null==(m=this.xl)?void 0:m.length}catch(t){h.$sdk_debug_error_capturing_properties=String(t)}if(this.requestRouter.region===Uw&&(h.$lib_custom_api_host=this.config.api_host),v=e!==Hs||o?e!==zs||o?this.pageViewManager.doEvent():this.pageViewManager.doPageLeave(s):this.pageViewManager.doPageView(s,a),h=Wi(h,v),e===Hs&&r&&(h.title=r.title),!K(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 b=this.persistence.properties(),_=this.sessionPersistence.properties();Ui(["$referrer","$referring_domain"],(t=>{t in b&&delete _[t]}));var w={};if(this.fl.length>0)for(var k of this.fl.slice())try{Wi(w,k())}catch(t){Bi.error("Failed to produce browser extension event properties",t)}(h=Wi({},c,b,_,p({},w,h))).$is_identified=this._isIdentified(),G(this.config.property_denylist)?Ui(this.config.property_denylist,(function(t){delete h[t]})):Bi.error(lk+this.config.property_denylist+" or property_blacklist config: "+this.config.property_blacklist);var S=this.config.sanitize_properties;S&&(Bi.error(ok),h=S(h,e));var x=this.Ul();return h.$process_person_profile=x,x&&!o&&this.Wl("_calculate_event_properties"),h}Bl(t,e,i){var r;if(void 0===e&&(e=!0),void 0===i&&(i=!1),!this.persistence||!this.Ul())return t;if(this.dl&&!i)return t;var n=this.persistence.get_initial_props(),s=null==(r=this.sessionPropsManager)?void 0:r.getSetOnceProps(),a=Wi({},n,s||{},t||{}),o=this.config.sanitize_properties;return o&&(Bi.error(ok),a=o(a,"$set_once")),e&&(this.dl=!0),J(a)?void 0:a}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.Hl(),null==(i=this.sessionPersistence)||i.register(t),Object.keys(t).forEach((t=>this.vl.add(t))),this.zl()}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.vl.delete(t),this.zl()}Vl(t,e){this.register({[t]:e})}Cl(){this.vl.forEach((t=>{var e;null==(e=this.sessionPersistence)||e.unregister(t)})),this.vl.clear(),this.zl()}zl(){var t;if(this.cl)if("memory"===this.config.persistence||null!=(t=this.sessionPersistence)&&t.ga||!xp.Xr())xp.ri(this.cl);else{var e=[];this.vl.forEach((t=>e.push(t))),e.length>0?xp.ei(this.cl,e):xp.ri(this.cl)}}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.il.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:ak}),()=>{})}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:ak})}getActiveMatchingSurveys(t,e){void 0===e&&(e=!1),this.surveys?this.surveys.getActiveMatchingSurveys(t,e):t([],{isLoaded:!1,error:ak})}renderSurvey(t,e){var i;null==(i=this.surveys)||i.renderSurvey(t,e)}displaySurvey(t,e){var i;void 0===e&&(e=Jf),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:ak}}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:ak})}Gl(t){return!t||X(t)?(Bi.critical("Unique user id has not been set in posthog.identify"),!1):t===ws?(Bi.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())||(Bi.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 Bi.uninitializedWarning("posthog.identify");if(it(t)&&(t=t.toString(),Bi.warn("The first argument to posthog.identify was a number, but it should be a string. It has been converted to a string.")),this.Gl(t)&&this.Wl("posthog.identify")){this.ll();var r=this.get_distinct_id(),n=this.persistence.syncCookieProperties()&&this.get_distinct_id()!==r,s=this.Hl(!1),a=this.persistence.ba(),o=!1;try{var l=this.get_distinct_id();this.register({$user_id:t}),this.get_property(gn)||this.register_once({$had_persisted_distinct_id:!0,$device_id:l},""),t!==l&&t!==this.get_property(yn)&&(this.unregister(yn),this.register({distinct_id:t}));var u,h=(this.persistence.get_property(fs)||$s)===$s,d=t!==l,v=!d&&h;if(d&&h)this.persistence.set_property(fs,Ns),this.setPersonPropertiesForFlags({$set:e||{},$set_once:i||{}},!1),this.config.cookieWinsOnConflict&&this.persistence._a(),this.capture(Us,{distinct_id:t,$anon_distinct_id:l},{$set:e||{},$set_once:i||{}}),this.yl=To(t,e,i),null==(u=this.featureFlags)||u.setAnonymousDistinctId(l);else if(v){this.persistence.set_property(fs,Ns);var c=e||{},f=i||{};this.setPersonPropertiesForFlags({$set:c,$set_once:f},!1),this.config.cookieWinsOnConflict&&this.persistence._a(),this.capture("$set",{$set:c,$set_once:f}),this.yl=To(t,e,i)}else(e||i)&&this.setPersonProperties(e,i);d||n||s?(this.reloadFeatureFlags(),this.featureFlags?this.featureFlags.resetFlagCallReported():this.unregister(hs)):v&&(e||i)&&this.reloadFeatureFlags(),o=!0}finally{a&&this.persistence.Sa(o)}}}setPersonProperties(t,e){if((t||e)&&this.Wl("posthog.setPersonProperties")){var i=To(this.get_distinct_id(),t,e);this.yl!==i?(this.setPersonPropertiesForFlags({$set:t||{},$set_once:e||{}},!0),this.capture("$set",{$set:t||{},$set_once:e||{}}),this.yl=i):Bi.info("A duplicate setPersonProperties call was made with the same properties. It has been ignored.")}}unsetPersonProperties(t){var e,i=(G(t)?t:[t]).filter((t=>Y(t)&&t.length>0));0!==i.length&&this.Wl("posthog.unsetPersonProperties")&&(null==(e=this.featureFlags)||e.unsetPersonPropertiesForFlags(i,!0),this.capture("$set",{$unset:i}),this.yl=null)}group(t,e,i){var r;if(t&&e){null==(r=this.persistence)||r.syncCookieProperties(),this.Hl();var n=this.getGroups(),s=n[t]!==e;if(s&&this.resetGroupPropertiesForFlags(t),this.register({$groups:p({},n,{[t]:e})}),s||i){var a={$group_type:t,$group_key:e};i&&(a.$group_set=i),this.capture(Ws,a)}i&&this.setGroupPropertiesForFlags({[t]:i}),s&&!i&&this.reloadFeatureFlags()}else Bi.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.Wl("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=nt(t)?t:null==t?void 0:t.resetDeviceID,i=nt(t)||null==t?void 0:t.bootstrap;this.Zl(e,!1,i)}Zl(t,e,i){var r,n,s;if(void 0===e&&(e=!1),Bi.info("reset"),!this.__loaded)return Bi.uninitializedWarning("posthog.reset");var a=null==i?void 0:i.sessionID;this.config.bootstrap=i||(null==(r=this._l)?void 0:r.bootstrap)||{},null==(n=this.featureFlags)||null==n.updateConfig||n.updateConfig(this.config,this.Ua());var o=this.get_property(gn),l=this.get_property(mn),u=this.get_property(Rn),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.ba?void 0:s.ba(),v=!1;try{var c,f,g,m,y,b,_,w,k,S,x,C,T;if(null==(c=this.persistence)||c.clear(),null==(f=this.sessionPersistence)||f.clear(),this.vl.clear(),this.zl(),K(u)||null==(S=this.persistence)||S.register({[Rn]:u}),null==(g=this.surveys)||g.reset(),null==(m=this.featureFlags)||m.reset(),null==(y=this.conversations)||y.reset(),null==(b=this.logs)||b.reset(),null==(_=this.metrics)||_.reset(),null==(w=this.persistence)||w.set_property(fs,$s),null==(k=this.sessionManager)||k.resetSessionId(),this.yl=null,this.config.cookieless_mode===Ds)this.register_once({distinct_id:ws,$device_id:null},"");else{var M=this.config.get_device_id(np());this.register_once({distinct_id:M,$device_id:t?M:o},""),t||K(l)||this.register({[mn]:l})}if(this.register({$last_posthog_reset:(new Date).toISOString()},1),i)if(void 0===i.distinctID||this.ol()||(null==(T=this.persistence)||T.set_property(fs,i.isIdentifiedID?Ns:$s),this.register({distinct_id:i.distinctID})),null==(x=this.featureFlags)||x.initialize(),!(K(a)||null!=(C=this.sessionManager)&&C.setBootstrapSessionId(a,!0))){var E=p({},i);delete E.sessionID,this.config.bootstrap=E}delete this.config.identity_distinct_id,delete this.config.identity_hash,v=!0}finally{var I;d&&(null==(I=this.persistence)||null==I.Sa||I.Sa(v))}this.reloadFeatureFlags()}shutdown(t){var e=this;return f((function*(){var t,i,r,n,s;if(e.__loaded){e.Pl().dispose(),null==(t=e.sessionRecording)||t.dispose(),null==(i=e.logs)||i.flushLogs("sendBeacon"),null==(r=e.metrics)||r.flush("sendBeacon"),null==(n=e.kl)||n.unload(),null==(s=e.xl)||s.unload();try{var a;null==(a=e.featureFlags)||a.destroy()}catch(t){Bi.error("Error while destroying feature flags",t)}}else Bi.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.Ql()}clearIdentity(){var t;delete this.config.identity_distinct_id,delete this.config.identity_hash,null==(t=this.conversations)||t.Jl()}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(fn)?(Bi.critical("Attempting to create alias for existing People user - aborting."),-2):this.Wl("posthog.alias")?(K(e)&&(e=this.get_distinct_id()),t!==e?(this.Vl(yn,t),this.capture("$create_alias",{alias:t,distinct_id:e})):(Bi.warn("alias matches current distinct_id - skipping api call."),this.identify(t),-1)):void 0}set_config(t){var e=p({},this.config);if(Q(t)){var i,r,n,s,a,o,l,u,h,d,v,c;Wi(this.config,pk(t));var f=this.ul();null==(i=this.persistence)||i.update_config(this.config,e,f),this.sessionPersistence="sessionStorage"===this.config.persistence||"memory"===this.config.persistence?this.persistence:new dw(p({},this.config,{persistence:"sessionStorage"}),f,!1);var g,m=this.bl(this.config.debug);nt(m)&&(this.config.debug=m),nt(this.config.debug)&&(this.config.debug?(qi.DEBUG=!0,hp.Xr()&&hp.ei("ph_debug",!0),Bi.info("set_config",{config:t,oldConfig:e,newConfig:p({},this.config)})):(qi.DEBUG=!1,hp.Xr()&&hp.ri("ph_debug"))),null==(r=this.featureFlags)||null==r.updateConfig||r.updateConfig(this.config,this.Ua()),null==(n=this.exceptionObserver)||n.onConfigChange(),null==(s=this.exceptions)||s.onConfigChange(),null==(a=this.sessionRecording)||a.startIfEnabledOrStop(),null==(o=this.tracingHeaders)||o.startIfEnabledOrStop(),null==(l=this.autocapture)||l.startIfEnabled(),null==(u=this.heatmaps)||u.startIfEnabled(),("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.hl(),null==(c=this.externalIntegrations)||c.startIfEnabledOrStop()}}_overrideSDKInfo(t,e){qi.LIB_NAME=t,qi.LIB_VERSION=e}startSessionRecording(t){var e,i,r,n,s,a=!0===t,o={sampling:a||!(null==t||!t.sampling),linked_flag:a||!(null==t||!t.linked_flag),url_trigger:a||!(null==t||!t.url_trigger),event_trigger:a||!(null==t||!t.event_trigger)};Object.values(o).some(Boolean)&&(null==(e=this.sessionManager)||e.checkAndGetSessionAndWindowId(),o.sampling&&(null==(i=this.sessionRecording)||i.overrideSampling()),o.linked_flag&&(null==(r=this.sessionRecording)||r.overrideLinkedFlag()),o.url_trigger&&(null==(n=this.sessionRecording)||n.overrideTrigger("url")),o.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:mk.Kl}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:hk;return e!==hk&&(e=hk+"."+e),e}_isIdentified(){var t,e;return(null==(t=this.persistence)?void 0:t.get_property(fs))===Ns||(null==(e=this.sessionPersistence)?void 0:e.get_property(fs))===Ns}Ul(){var t,e;return!("never"===this.config.person_profiles||this.config.person_profiles===qs&&!this._isIdentified()&&J(this.getGroups())&&(null==(t=this.persistence)||null==(t=t.props)||!t[yn])&&(null==(e=this.persistence)||null==(e=e.props)||!e[_s]))}ql(){return!0===this.config.capture_pageleave||"if_capture_pageview"===this.config.capture_pageleave&&!!this.config.capture_pageview}createPersonProfile(){this.Ul()||this.Wl("posthog.createPersonProfile")&&this.setPersonProperties({},{})}setInternalOrTestUser(){this.Wl("posthog.setInternalOrTestUser")&&this.setPersonProperties({$internal_or_test_user:!0})}Wl(t){return"never"===this.config.person_profiles?(Bi.error(t+' was called, but process_person is set to "never". This call will be ignored.'),!1):(this.Vl(_s,!0),!0)}ul(){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!==Ls)}hl(){var t,e,i,r,n,s=this.ul();return this.is_capturing()||null==(i=this.logs)||i.Yl(),(null==(t=this.persistence)?void 0:t.ga)!==s&&(null==(r=this.persistence)||r.set_disabled(s)),(null==(e=this.sessionPersistence)?void 0:e.ga)!==s&&(null==(n=this.sessionPersistence)||n.set_disabled(s)),s&&(this.vl.clear(),this.zl()),s}opt_in_capturing(t){var e;if(this.config.cookieless_mode!==Ds){if(this.ol()){var i,r,n,s,a;this.Zl(!0,!0),null==(i=this.sessionManager)||i.destroy(),null==(r=this.pageViewManager)||r.destroy(),this.sessionManager=new Bw(this),this.pageViewManager=new ew(this),this.persistence&&(this.sessionPropsManager=new $w(this,this.sessionManager,this.persistence));var o,l=null!==(n=null==(s=this.config.__extensionClasses)?void 0:s.sessionRecording)&&void 0!==n?n:null==(a=mk.__defaultExtensionClasses)?void 0:a.sessionRecording;l&&(this.sessionRecording=this.al(this.sessionRecording,new l(this)),this.el&&(null==(o=this.sessionRecording)||null==o.onRemoteConfig||o.onRemoteConfig(this.el)))}var u,h;this.consent.optInOut(!0),this.hl(),this.Dl(),null==(e=this.sessionRecording)||e.startIfEnabledOrStop(),this.config.cookieless_mode==Ls&&(null==(u=this.surveys)||u.loadIfEnabled()),(K(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.$l()}else Bi.warn(sk)}opt_out_capturing(){var t,e,i;this.config.cookieless_mode!==Ds?(this.config.cookieless_mode===Ls&&this.consent.isOptedIn()&&this.Zl(!0,!0),this.consent.optInOut(!1),this.hl(),this.config.cookieless_mode===Ls&&(this.register({distinct_id:ws,$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.$l(),this.Dl())):Bi.warn(sk)}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===Ds||(this.config.cookieless_mode===Ls?this.consent.isRejected()||this.consent.isOptedIn():!this.has_opted_out_capturing())}clear_opt_in_out_capturing(){this.consent.reset(),this.hl()}_is_bot(){return i?Hw(i,this.config.custom_blocked_useragents):void 0}$l(){r&&("visible"===r.visibilityState?this.pl||(this.pl=!0,this.capture(Hs,{title:r.title},{send_instantly:!0}),this.gl&&(r.removeEventListener(js,this.gl),this.gl=null)):this.gl||(this.gl=this.$l.bind(this),Yi(r,js,this.gl)))}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}))}Ua(){var t=this._l||{};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?(Bi.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&&!et(t[e]),a=i in t&&!et(t[i]);return s?t[e]:!!a&&(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,Bi)}Jn(t){var e;if(et(this.config.before_send))return t;var i=Object.keys(null!==(e=t.properties)&&void 0!==e?e:{}).filter(ot),r=G(this.config.before_send)?this.config.before_send:[this.config.before_send],n=t;for(var s of r)try{if(n=s(n),et(n)){var a="Event '"+t.event+"' was rejected in beforeSend function";return at(t.event)?Bi.warn(a+". This can cause unexpected behavior."):Bi.info(a),null}n.properties&&!J(n.properties)||Bi.warn("Event '"+t.event+"' has no properties after beforeSend function, this is likely an error.")}catch(e){return Bi.error("Error in beforeSend function for event '"+t.event+"':",e),null}for(var o of i)if(n.properties&&et(n.properties[o]))return Bi.warn("Event '"+t.event+"' had its '"+o+"' 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.Ks)?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)})}bl(t){var e=nt(t)&&!t,i=hp.Xr()&&"true"===hp.ti("ph_debug");return!e&&(!!i||t)}}mk.__defaultExtensionClasses={},mk.Kl=(()=>{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]]=Zi(t.prototype[e[i]])}(mk,["identify"]);class yk{constructor(t){this._instance=t}refresh(t){var e=this._instance.config,i=Q(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.Ua(),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 bk=Hi("[ExceptionAutocapture]"),_k=Hi("[TracingHeaders]"),wk=Hi("[Web Vitals]"),kk=9e5,Sk=["CLS","FCP","INP","LCP"],xk=["INP","LCP"],Ck=["interactionTarget","interactionType","inputDelay","processingDuration","presentationDelay","loadState","target","url","timeToFirstByte","resourceLoadDelay","resourceLoadDuration","elementRenderDelay","largestShiftTarget","largestShiftTime","largestShiftValue","firstByteToFCP"],Tk="[SessionRecording]",Mk=Hi(Tk),Ek=Hi("[Heatmaps]");function Ik(t){return Q(t)&&"clientX"in t&&"clientY"in t&&it(t.clientX)&&it(t.clientY)}var Rk=Hi("[Product Tours]"),Pk=t=>{var e;return!t.config.disable_product_tours&&!(null==(e=t.persistence)||!e.get_property(Mn))},Ak=["$set_once","$set"],Fk=Hi("[SiteApps]"),Ok="Error while initializing PostHog app with config id ",Lk=(t,e)=>null!=t&&t.then?t.then(e):e(t),Dk="SDK is not enabled or survey functionality is not yet loaded",$k="Disabled. Not loading surveys.";class Nk{constructor(t,e){this.name="surveys",this._surveyEventReceiver=null,this._surveyManager=null,this.Xl=!1,this.tu=[],this.eu=null,this.iu=null,this.Rs=!1,this.ru=new Set,this.onRemoteConfig=t=>{if(!this.Rs&&!this.vn.disableSurveys){if(!t.ok)return Bf.warn("Remote config unavailable. Not loading surveys.");var e=t.config.surveys;if(et(e))return Bf.warn("Flags not loaded yet. Not loading surveys.");this.nu=nt(e)?e:e.length>0,Bf.info("flags response received, isSurveysEnabled: "+this.nu),this.loadIfEnabled()}},this.Ps=t,this.su=e}setup(t){if(!this.Rs)return this.au=t,Lk(t.kv.initialize(),(()=>{if(this.au===t&&!this.Rs){this.au=void 0,this.Os=t;var e=t.onRemoteConfig(this.onRemoteConfig);this.Rs?e.dispose():(this.Ls=e,this.loadIfEnabled())}}))}dispose(){var t,e,i;this.Rs||(this.Rs=!0,this.au=void 0,this.Os=void 0,null==(t=this.Ls)||t.dispose(),this.Ls=void 0,null==(e=this._surveyEventReceiver)||e.dispose(),this._surveyEventReceiver=null,null==(i=this._surveyManager)||null==i.dispose||i.dispose(),this._surveyManager=null,this.tu=[],this.eu=null,this.ru.forEach((t=>clearTimeout(t))),this.ru.clear())}get vn(){return this.Ps.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(Uf)||null!=r&&r.startsWith(Wf))&&e.push(r)}e.forEach((t=>localStorage.removeItem(t)))}catch(t){}}loadIfEnabled(){if(!this.Rs&&this.Os){var t=this.vn;if(!this._surveyManager)if(this.Xl)Bf.info("Already initializing surveys, skipping...");else if(t.disableSurveys)Bf.info($k);else if(t.cookielessMode&&this.Ps.isOptedOut())Bf.info("Not loading surveys in cookieless mode without consent.");else{var e=this.Ps.getExtensions();if(e){if(!K(this.nu)||t.advancedEnableSurveys){var i=this.nu||t.advancedEnableSurveys;this.Xl=!0;try{var r=e.generateSurveys;if(r)return this.ou(r,i),void(this.Xl=!1);var n=e.loadExternalDependency;if(!n)return this.lu(Os),void(this.Xl=!1);n((t=>{try{if(this.Rs)return;var e=this.Ps.getExtensions();t||null==e||!e.generateSurveys?this.lu("Could not load surveys script",t):this.ou(e.generateSurveys,i)}finally{this.Xl=!1}}))}catch(t){throw this.Xl=!1,this.lu("Error initializing surveys",t),t}}}else Bf.error("PostHog Extensions not found.")}}}ou(t,e){this.Rs||(this._surveyManager=t(e),this._surveyEventReceiver=this.Ps.createEventReceiver(),Bf.info("Surveys loaded successfully"),this.uu({isLoaded:!0}))}lu(t,e){Bf.error(t,e),this.uu({isLoaded:!1,error:t})}onSurveysLoaded(t){return this.tu.push(t),this._surveyManager&&this.uu({isLoaded:!0}),()=>{this.tu=this.tu.filter((e=>e!==t))}}getSurveys(t,e){var i;void 0===e&&(e=!1);var r=null!==(i=this.Os)&&void 0!==i?i:this.su;if(r&&!this.Rs){if(this.vn.disableSurveys)return Bf.info($k),t([]);var n=r.kv.get(ns);if(n&&!e)return t(n,{isLoaded:!0}),void(this.hu()&&this.getSurveys((()=>{}),!0));if(this.eu)this.eu.then((e=>{this.Rs||t(e.surveys,e.context)})).catch((t=>Bf.error("Error in survey callback",t)));else{var s=this.du("/api/surveys/",{method:"GET",query:{token:r.projectToken},sentAt:"query",timeoutMs:this.vn.requestTimeoutMs}).then((t=>{try{return this.vu(r,t)}catch(t){return Bf.error("Error processing surveys response",t),this.vu(r,{statusCode:0,error:t})}}),(t=>this.vu(r,{statusCode:0,error:t})));this.eu=s;var a=()=>{this.eu===s&&(this.eu=null)};s.then((e=>{a(),this.Rs||t(e.surveys,e.context)}),a).catch((t=>Bf.error("Error in survey callback",t)))}}}du(t,e){var i=this.Os;return i?i.sendRequest(t,e):new Promise((t=>t({statusCode:0,error:new Error(Dk)})))}vu(t,e){if(this.Rs)return{surveys:[],context:{isLoaded:!1,error:Dk}};var i=e.statusCode;if(200!==i||!e.json){var r="Surveys API could not be loaded, status: "+i;return 0!==i?Bf.error(r):e.error||Bf.warn(r),this.iu=Date.now(),{surveys:[],context:{isLoaded:!1,error:r}}}this.iu=null;var n,s=e.json.surveys||[],a=s.filter((t=>Hf(t)&&(_o(t)||zf(t))));return a.length>0&&(null==(n=this._surveyEventReceiver)||n.register(a)),t.kv.set({[ns]:s,[ss]:Date.now()}),{surveys:s,context:{isLoaded:!0}}}hu(){return this.cu()&&!this.eu&&!this.fu()}cu(){var t,e,i=null==(t=null!==(e=this.Os)&&void 0!==e?e:this.su)?void 0:t.kv.get(ss);return it(i)&&Date.now()-i>3e5}fu(){return it(this.iu)&&3e5>Date.now()-this.iu}markSurveyAsSeen(t,e){var i,r={id:t,current_iteration:null!==(i=null==e?void 0:e.iteration)&&void 0!==i?i:null};Zf(r);try{localStorage.setItem("lastSeenSurveyDate",(new Date).toISOString())}catch(t){}}uu(t){for(var e of this.tu)try{if(!t.isLoaded)return e([],t);this.getSurveys(e)}catch(t){Bf.error("Error in survey callback",t)}}getActiveMatchingSurveys(t,e){if(void 0===e&&(e=!1),!et(this._surveyManager))return this._surveyManager.getActiveMatchingSurveys(t,e);Bf.warn("init was not called")}pu(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}gu(t){if(et(this._surveyManager))return{eligible:!1,reason:Dk};var e="string"==typeof t?this.pu(t):t;return e?this._surveyManager.checkSurveyEligibility(e):{eligible:!1,reason:"Survey not found"}}mu(t){if(et(this._surveyManager))return{eligible:!1,reason:Dk};var e="string"==typeof t?this.pu(t):t;return e?this._surveyManager.checkSurveyRenderability(e):{eligible:!1,reason:"Survey not found"}}canRenderSurvey(t){if(et(this._surveyManager))return Bf.warn("init was not called"),{visible:!1,disabledReason:Dk};var e=this.mu(t);return{visible:e.eligible,disabledReason:e.reason}}canRenderSurveyAsync(t,e){return et(this._surveyManager)?(Bf.warn("init was not called"),Promise.resolve({visible:!1,disabledReason:Dk})):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.mu(n);i({visible:s.eligible,disabledReason:s.reason})}else i({visible:!1,disabledReason:"Survey not found"})}),e)}))}renderSurvey(t,e,i){var n;if(et(this._surveyManager))Bf.warn("init was not called");else{var s="string"==typeof t?this.pu(t):t;if(null!=s&&s.id)if(Qf.includes(s.type)){var a=null==r?void 0:r.querySelector(e);if(a)if(null!=(n=s.appearance)&&n.surveyPopupDelaySeconds){Bf.info("Rendering survey "+s.id+" with delay of "+s.appearance.surveyPopupDelaySeconds+" seconds");var o=setTimeout((()=>{var t,e;this.ru.delete(o),this.Rs||(Bf.info("Rendering survey "+s.id+" with delay of "+(null==(t=s.appearance)?void 0:t.surveyPopupDelaySeconds)+" seconds"),null==(e=this._surveyManager)||e.renderSurvey(s,a,i),Bf.info("Survey "+s.id+" rendered"))}),1e3*s.appearance.surveyPopupDelaySeconds);this.ru.add(o)}else this._surveyManager.renderSurvey(s,a,i);else Bf.warn("Survey element not found")}else Bf.warn("Surveys of type "+s.type+" cannot be rendered in the app");else Bf.warn("Survey not found")}}displaySurvey(t,e){var i;if(et(this._surveyManager))Bf.warn("init was not called");else{var r=this.pu(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!==jf&&e.initialResponses&&Bf.warn("initialResponses is only supported for popover surveys. prefill will not be applied."),!1===e.ignoreConditions){var s=this.gu(r);if(!s.eligible)return void Bf.warn("Survey is not eligible to be displayed: ",s.reason)}"inline"!==e.displayType?this._surveyManager.handlePopoverSurvey(n,e):this.renderSurvey(n,e.selector,e.properties)}else Bf.warn("Survey not found")}}cancelPendingSurvey(t){et(this._surveyManager)?Bf.warn("init was not called"):this._surveyManager.cancelSurvey(t)}handlePageUnload(){var t;null==(t=this._surveyManager)||null==t.handlePageUnload||t.handlePageUnload()}}function qk(t,e,i){if(et(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 jk{constructor(t){this.yu=new Set,this.bu=new Set,this._u=new Nw,this.wu=(t,e)=>this.ku(t,e)&&this.Su(t,e)&&this.xu(t,e)&&this.Cu(t,e),this.ku=(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;K(null==(t=this._instance)?void 0:t._addCaptureHook)||(this.Tu=null==(e=this._instance)?void 0:e._addCaptureHook(((t,e)=>{this.on(t,e)})))}dispose(){var t;null==(t=this.Tu)||t.call(this),this.Tu=void 0,this._u=new Nw}register(t){var e,i;if(!K(null==(e=this._instance)?void 0:e._addCaptureHook)&&(t.forEach((t=>{var e;this.yu.add(t),null==(e=t.steps)||e.forEach((t=>{this.bu.add((null==t?void 0:t.event)||"")}))})),null!=(i=this._instance)&&i.autocapture)){var r=new Set;this.yu.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.yu.clear(),this.bu.clear(),this.register(t)}on(t,e){null!=e&&0!=t.length&&(this.bu.has(t)||this.bu.has(e.event))&&this.yu.forEach((t=>{this.Mu(e,t)&&this._u.emit("actionCaptured",t.name)}))}Eu(t){this.onAction("actionCaptured",(e=>t(e)))}Mu(t,e){if(null==(null==e?void 0:e.steps))return!1;for(var i of e.steps)if(this.wu(t,i))return!0;return!1}onAction(t,e){return this._u.on(t,e)}Su(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(!qk(r,e.url,e.url_matching||"contains"))return!1}return!0}xu(t,e){return!!this.Iu(t,e)&&!!this.Ru(t,e)&&!!this.Pu(t,e)}Iu(t,e){var i;if(null==e||!e.href)return!0;var r=this.Au(t);if(r.length>0)return r.some((t=>qk(t.href,e.href,e.href_matching||"exact")));var n,s=(null==t||null==(i=t.properties)?void 0:i.$elements_chain)||"";return!!s&&qk((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.Au(t);if(r.length>0)return r.some((t=>qk(t.text,e.text,e.text_matching||"exact")||qk(t.$el_text,e.text,e.text_matching||"exact")));var n,s,a,o=(null==t||null==(i=t.properties)?void 0:i.$elements_chain)||"";return!!o&&(n=function(t){for(var e,i=[],r=/(?::|")text="(.*?)"/g;!et(e=r.exec(t));)i.includes(e[1])||i.push(e[1]);return i}(o),s=e.text,a=e.text_matching||"exact",n.some((t=>qk(t,s,a))))}Pu(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}Au(t){var e;return null==(null==t||null==(e=t.properties)?void 0:e.$elements)?[]:null==t?void 0:t.properties.$elements}Cu(t,e){return null==e||!e.properties||0===e.properties.length||Co(e.properties.reduce(((t,e)=>{var i=G(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 Bk{constructor(t){var e;this.Fu=[],this._instance=t,this.Ou=new Map,this.Lu=new Map,this.Du=new Map,this.$u=null==(e=this._instance)||null==e.onSessionId?void 0:e.onSessionId((t=>this.Nu(t)))}qu(t){return!1}ju(){return null}Bu(t){}Hu(){}zu(t,e){return!!t&&Co(t.propertyFilters,null==e?void 0:e.properties)}Uu(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}Wu(t,e,i){var r=(i===If?this.Ou:this.Lu).get(t),n=[];return this.Vu((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.zu(s,e)}))}register(t){this.Gu(t,!1)}replace(t){this.Gu(t,!0)}Gu(t,e){var i;K(null==(i=this._instance)?void 0:i._addCaptureHook)||(this.Zu(t,e),this.Qu(t,e))}Qu(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.Du.clear(),0!==i.length){this.Ju||(this.Ju=new jk(this._instance),this.Ju.init(),this.Ju.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.Du.get(e.name))&&void 0!==i?i:[];n.includes(t.id)||n.push(t.id),this.Du.set(e.name,n)}}))})),e?this.Ju.replace(r):this.Ju.register(r)}else{var n;e&&(null==(n=this.Ju)||n.replace([]))}}Ku(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)}))}Zu(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})),a=this.Uu(t,If),o=this.Uu(t,Rf);e?(this.Ou=a,this.Lu=o):(this.Ku(this.Ou,a),this.Ku(this.Lu,o)),(0!==n.length||0!==s.length)&&(null!==(i=this.Tu)&&void 0!==i||(this.Tu=null==(r=this._instance)?void 0:r._addCaptureHook(((t,e)=>{this.onEvent(t,e)}))))}onEvent(t,e){var i,r,n=this.Yu(),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 a=this.Xu(t,s);if("consume"===a)return n.info("event consumed activated item, removing it",{event:t,itemId:s}),void this.th([s]);if("persist"===a)return n.info("shown item promoted to persisted activation",{event:t,itemId:s}),this.eh(s),void this.ih([s])}if(this.Lu.has(t)){var o=this.Wu(t,e,Rf);o.length>0&&(n.info("cancel event matched, cancelling items",{event:t,itemsToCancel:o.map((t=>t.id))}),this.th(o.map((t=>t.id))),o.forEach((t=>this.rh(t.id))))}if(this.Ou.has(t)){n.info("event name matched",{event:t,eventPayload:e,items:this.Ou.get(t)});var l=this.Wu(t,e,If);this.nh(l.map((t=>t.id)))}}onAction(t){this.Du.has(t)&&this.nh(this.Du.get(t)||[])}nh(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.qu(n)?this.eh(n)&&this.sh(n):r.push(n);r.length>0&&(this.Fu=[...new Set([...this.Fu,...r])]),this.Yu().info("updating activated items",{activatedItems:this.getActivatedIds()})}}eh(t){this.Fu=this.Fu.filter((e=>e!==t));var e=this.ah();return!e.includes(t)&&(this.oh([...e,t]),this.lh(),!0)}th(t){var e=new Set(t);this.Fu=this.Fu.filter((t=>!e.has(t)));var i=this.uh(),r=i.filter((t=>!e.has(t)));r.length!==i.length&&(this.oh(r),0===r.length&&this.hh()),this.ih(t)}dh(){var t,e=this.ju();if(!e)return{};var i=null==(t=this._instance)||null==(t=t.persistence)?void 0:t.props[e];return i&&"object"==typeof i?i:{}}sh(t){if(this.ju()){var e=this.dh();this.Bu(p({},e,{[t]:Date.now()}))}}ih(t){if(this.ju()){var e=this.dh(),i={},r=!1;for(var n of Object.entries(e)){var s=n[0],a=n[1];t.includes(s)?r=!0:i[s]=a}r&&(J(i)?this.Hu():this.Bu(i))}}fh(){this.ju()&&this.Hu()}getActivationTimestamp(t){if(this.ah().includes(t)){var e=this.dh()[t];return it(e)?e:void 0}}uh(){var t,e=this.ph();return(null==(t=this._instance)||null==(t=t.persistence)?void 0:t.props[e])||[]}ah(){var t,e,i=this.uh();if(0===i.length)return[];var r=null==(t=this._instance)||null==(t=t.persistence)?void 0:t.props[this.gh()],n=null==(e=this._instance)||null==e.get_session_id?void 0:e.get_session_id();return n&&r===n?i:[]}lh(){var t,e=null==(t=this._instance)||null==t.get_session_id?void 0:t.get_session_id();e&&this.mh(e)}hh(){this.yh()}Nu(t){var e,i=null==(e=this._instance)||null==(e=e.persistence)?void 0:e.props[this.gh()];if(i&&i!==t){var r=this.uh(),n=this.dh();r.length>0&&(this.oh([]),r.filter((t=>it(n[t]))).forEach((t=>this.rh(t)))),this.hh(),this.fh()}}getActivatedIds(){return[...new Set([...this.ah(),...this.Fu])].filter((t=>!this.bh(t)))}dispose(){var t,e,i;null==(t=this.$u)||t.call(this),this.$u=void 0,null==(e=this.Tu)||e.call(this),this.Tu=void 0,null==(i=this.Ju)||i.dispose(),this.Ju=void 0}reset(){this.Fu=[],this.uh().length>0&&this.oh([]),this.hh(),this.fh()}getEventToItemsMap(){return this.Ou}_h(){return this.Ju}}class Hk extends Bk{constructor(t){super(t)}ph(){return as}gh(){return os}ju(){return ls}Bu(t){var e;null==(e=this._instance)||null==(e=e.persistence)||e.register({[ls]:t})}Hu(){var t;null==(t=this._instance)||null==(t=t.persistence)||t.unregister(ls)}qu(t){var e,i;this.Vu((e=>{i=e.find((e=>e.id===t))}));var r=null==(e=i)||null==(e=e.appearance)?void 0:e.surveyPopupDelaySeconds;return it(r)&&r>0}wh(){return Nf.SHOWN}Vu(t){var e;null==(e=this._instance)||e.getSurveys(t)}rh(t){var e;null==(e=this._instance)||e.cancelPendingSurvey(t)}Yu(){return Bf}oh(t){var e;null==(e=this._instance)||null==(e=e.persistence)||e.register({[as]:t})}mh(t){var e;null==(e=this._instance)||null==(e=e.persistence)||e.register({[os]:t})}yh(){var t;null==(t=this._instance)||null==(t=t.persistence)||t.unregister(os)}bh(){return!1}Xu(t,e){var i;return this.Vu((t=>{i=t.find((t=>t.id===e))})),!i||wo(i)?t===Nf.SHOWN?"consume":"ignore":t===Nf.SHOWN?"persist":t===Nf.DISMISSED||t===Nf.SENT?"consume":"ignore"}getSurveys(){return this.getActivatedIds()}getEventToSurveys(){return this.getEventToItemsMap()}}class zk{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);K(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 Uk{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 Hk(this._instance)}}var Wk=null!=t&&t.location?ar(t.location.hash,"__posthog")||ar(location.hash,"state"):null,Vk="_postHogToolbarParams",Gk=Hi("[Toolbar]"),Zk=Hi("[FeatureFlags]");class Qk{constructor(t,e){void 0===e&&(e=!1),this.kh=!1,this.update(t,e)}update(t,e){this.Sh=((t,e)=>{var i,r,n,s,a;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,refreshIntervalMs:null!==(n=t.remote_config_refresh_interval_ms)&&void 0!==n?n:3e5,requestTimeoutMs:t.feature_flag_request_timeout_ms,compression:t.disable_compression?void 0:"best-available",evaluationContexts:null!==(s=null!==(a=t.evaluation_contexts)&&void 0!==a?a:t.evaluation_environments)&&void 0!==s?s:[],flagKeys:G(t.flag_keys)?t.flag_keys:void 0}})(t,e),!t.evaluation_environments||t.evaluation_contexts||this.kh||(Zk.warn("evaluation_environments is deprecated. Use evaluation_contexts instead. evaluation_environments will be removed in a future version."),this.kh=!0),K(t.flag_keys)||G(t.flag_keys)||Zk.error("Invalid flag_keys found:",t.flag_keys,"Expected array of non-empty strings")}get(){return this.Sh}}var Jk=Hi("[FeatureFlags]"),Kk=Hi("[FeatureFlags]",{debugEnabled:!0}),Yk="\" failed. Feature flags didn't load in time.",Xk="connection_error",tS=t=>{for(var e={},i=0;t.length>i;i++)e[t[i]]=!0;return e},eS=t=>{var e={};for(var i of Vi(t||{})){var r=i[1];r&&(e[i[0]]=r)}return e},iS="Refusing to render web experiment since the viewer is a likely bot",rS={icontains:(t,e)=>e.toLowerCase().indexOf(t.toLowerCase())>-1,not_icontains:(t,e)=>-1===e.toLowerCase().indexOf(t.toLowerCase()),regex:(t,e)=>ko(e,t),not_regex:(t,e)=>!ko(e,t),exact:(t,e)=>e===t,is_not:(t,e)=>e!==t};class nS{get vn(){return this._instance.config}constructor(t){var e=this;this.getWebExperimentsAndEvaluateDisplayLogic=function(t){void 0===t&&(t=!1),e.getWebExperiments((t=>{nS.xh("retrieved web experiments from the server"),e.Ch=new Map,t.forEach((t=>{if(t.feature_flag_key){var i;e.Ch&&(nS.xh("setting flag key ",t.feature_flag_key," to web experiment ",t),null==(i=e.Ch)||i.set(t.feature_flag_key,t));var r=e._instance.getFeatureFlag(t.feature_flag_key);Y(r)&&t.variants[r]&&e.Th(t.name,r,t.variants[r].transforms)}else if(t.variants)for(var n in t.variants){var s=t.variants[n];nS.Mh(s,e._instance)&&e.Th(t.name,n,s.transforms)}}))}),t)},this._instance=t,this._instance.onFeatureFlags((t=>{this.onFeatureFlags(t)}))}initialize(){}onFeatureFlags(t){if(this._is_bot())nS.xh(iS);else if(!this.vn.disable_web_experiments){if(et(this.Ch))return this.Ch=new Map,this.loadIfEnabled(),void this.previewWebExperiment();nS.xh("applying feature flags",t),t.forEach((t=>{var e;if(this.Ch&&null!=(e=this.Ch)&&e.has(t)){var i,r=this._instance.getFeatureFlag(t),n=null==(i=this.Ch)?void 0:i.get(t);r&&null!=n&&n.variants[r]&&this.Th(n.name,r,n.variants[r].transforms)}}))}}previewWebExperiment(){var t=nS.getWindowLocation();if(null!=t&&t.search){var e=nr(null==t?void 0:t.search,"__experiment_id"),i=nr(null==t?void 0:t.search,"__experiment_variant");e&&i&&(nS.xh("previewing web experiments "+e+" && "+i),this.getWebExperiments((t=>{this.Eh(parseInt(e),i,t)}),!1,!0))}}loadIfEnabled(){this.vn.disable_web_experiments||this.getWebExperimentsAndEvaluateDisplayLogic()}getWebExperiments(t,e,i){if(this.vn.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.vn.token),method:"GET",timestampMode:"query",callback:e=>t(200===e.statusCode&&e.json&&e.json.experiments||[])})}Eh(t,e,i){var r=i.filter((e=>e.id===t));r&&r.length>0&&(nS.xh("Previewing web experiment ["+r[0].name+"] with variant ["+e+"]"),this.Th(r[0].name,e,r[0].variants[e].transforms))}static Mh(t,e){return!et(t.conditions)&&nS.Ih(t,e)&&nS.Rh(t)}static Ih(t,e){var i;if(et(t.conditions)||et(null==(i=t.conditions)?void 0:i.url))return!0;var r=nS.getWindowLocation();if(r){var n,s,a,o=ur(e,r.href);return null==(n=t.conditions)||!n.url||rS[null!==(s=null==(a=t.conditions)?void 0:a.urlMatchType)&&void 0!==s?s:"icontains"](t.conditions.url,o)}return!1}static getWindowLocation(){return null==t?void 0:t.location}static Rh(t){var e;if(et(t.conditions)||et(null==(e=t.conditions)?void 0:e.utm))return!0;var i=jo();if(i.utm_source){var r,n,s,a,o,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==(a=t.conditions)||null==(a=a.utm)?void 0:a.utm_source)==i.utm_source,c=null==(o=t.conditions)||null==(o=o.utm)||!o.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 xh(t){for(var e=arguments.length,i=new Array(e>1?e-1:0),r=1;e>r;r++)i[r-1]=arguments[r];Bi.info("[WebExperiments] "+t,i)}Th(t,e,i){this._is_bot()?nS.xh(iS):"control"!==e?i.forEach((i=>{if(i.selector){var r;nS.xh("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)}))}})):nS.xh("Control variants leave the page unmodified.")}_is_bot(){return i&&this._instance?Hw(i,this.vn.custom_blocked_useragents):void 0}}var sS=Hi("[Conversations]"),aS="Conversations not available yet.";function oS(t,e){var i,r,n,s,a,o,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=K(d)?Math.max(h,2048):Math.max(h,d),c=null==t?void 0:t.resourceAttributes;return{serviceName:null!==(s=null!==(a=null==c?void 0:c["service.name"])&&void 0!==a?a:null==t?void 0:t.serviceName)&&void 0!==s?s:null==e?void 0:e.serviceNameDefault,serviceVersion:null!==(o=null==c?void 0:c["service.version"])&&void 0!==o?o: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}}var lS=["debug","log","warn","error","info"],uS="console",hS="__posthogHandledLogsRequestError",dS=(t,e)=>{var i=t instanceof Error?t:new Error(e);return i[hS]=!0,i},vS=t=>!!t&&"object"==typeof t&&!0===t[hS],cS={featureFlags:class{constructor(t){this.name=Kf,this.Ph=!1,this.featureFlagEventHandlers=[],this.I=Jk,this.Ah={},this.Fh={},this.Oh=[],this.Lh=!1,this.Dh=!1,this.$h=0,this.Nh=!1,this.qh=!1,this.jh=!1,this.Bh=!1,this.Hh=0,this.Ht=()=>{var t=this.zh();this.Hh=0,t&&this.reloadFeatureFlags()},this.Uh=()=>{var t,e=this.Wh;K(e)||this.vn.remoteRequestsDisabled||!r||"hidden"===r.visibilityState||Date.now()-(null!==(t=this.Vh)&&void 0!==t?t:0)<e||(this.reloadFeatureFlags(),this.Gh())},this.$t=()=>{"visible"===(null==r?void 0:r.visibilityState)&&this.Uh()},"get"in t?this.Ps=t:(this.Zh=new Qk(t.config,t.Ua()),this.Ps=this.Zh)}updateConfig(t,e){var i;null==(i=this.Zh)||i.update(t,e),this.Os&&this.Qh()}setup(t){return this.au=t,this.I=t.logger.createLogger("[FeatureFlags]"),Lk(t.kv.initialize(),(()=>{this.au===t&&(this.au=void 0,this.Os=t,this.Jh(t))}))}Jh(e){if(this.Os===e)return t&&Yi(t,"online",this.Ht),this.Qh(),this.Kh=e.registerDynamicEventProperties((()=>this.Yh()?this.Ah:this.Fh)),this.Xh(),this.initialize()}Qh(){var t=this.vn.refreshIntervalMs,e=!this.vn.remoteRequestsDisabled&&r&&!K(t)&&t>0?t:void 0;e!==this.Wh&&(this.td(),K(e)||(this.Wh=e,this.Gh(),null!=r&&r.addEventListener&&Yi(r,js,this.$t)))}Gh(){K(this.Wh)||(K(this.ed)||clearInterval(this.ed),this.Vh=Date.now(),this.ed=setInterval(this.Uh,this.Wh))}td(){K(this.ed)||(clearInterval(this.ed),this.ed=void 0,null==r||null==r.removeEventListener||r.removeEventListener(js,this.$t)),this.Wh=void 0,this.Vh=void 0}destroy(){this.rd()}dispose(){this.rd()}rd(){var e;this.td(),this.$h++,this.qh=!1,this.au=void 0,this.Os&&(this.nd(),null==(e=this.Kh)||e.dispose(),this.Kh=void 0,this.Oh=[],null==t||t.removeEventListener("online",this.Ht),this.Os=void 0)}get vn(){return this.Ps.get()}sd(t){var e;return null==(e=this.Os)?void 0:e.kv.get(t)}ei(t){this.ad((()=>{var e;return null==(e=this.Os)?void 0:e.kv.set(t)}))}ri(t){this.ad((()=>{var e;return null==(e=this.Os)?void 0:e.kv.remove(t)}))}ad(t){try{t()}catch(t){this.I.error("Failed to update feature flag persistence",t)}}Xh(){var t={};for(var e of[Gn,Jn,Kn,Xn]){var i=this.sd(e);K(i)||(t[e]=i)}this.Ah=t;var r=p({},t),n=this.sd(Vn);if(n)for(var s of Object.entries(n))r["$feature/"+s[0]]=s[1];this.Fh=r}Yh(){var t=this.vn.cacheTtlMs;if(!t||0>=t)return!1;var e=this.sd(cs);return"number"!=typeof e||Date.now()-e>t}od(){return!!this.Yh()&&(this.Bh||this.Dh||(this.Bh=!0,this.I.warn("Feature flag cache is stale, triggering refresh..."),this.reloadFeatureFlags()),!0)}ld(){var t=this.vn.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})):[]}ud(){var t=this.vn.flagKeys;if(!K(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.vn,r=null!==(t=null==(e=i.bootstrap)?void 0:e.featureFlags)&&void 0!==t?t:{};if(Object.keys(r).length){var n,s,a=null!==(n=null==(s=i.bootstrap)?void 0:s.featureFlagPayloads)&&void 0!==n?n:{},o=Object.keys(r).filter((t=>!!r[t])).reduce(((t,e)=>(t[e]=r[e]||!1,t)),{}),l=Object.keys(a).filter((t=>o[t])).reduce(((t,e)=>(t[e]=a[e],t)),{});return this.hd({featureFlags:o,featureFlagPayloads:l})}}updateFlags(t,e,i){var r,n,s=null!=i&&i.merge&&null!==(r=this.sd(Vn))&&void 0!==r?r:{},a=null!=i&&i.merge&&null!==(n=this.sd(Jn))&&void 0!==n?n:{},o=p({},s,t),l=p({},a,e),u={};for(var h of Object.entries(o)){var d=h[0],v=h[1];u[d]={key:d,enabled:_(v),variant:w(v),reason:void 0,metadata:K(null==l?void 0:l[d])?void 0:{id:0,version:void 0,description:void 0,payload:l[d]}}}this.hd({flags:u})}get hasLoadedFlags(){return this.Lh}getFlags(){return Object.keys(this.getFlagVariants())}getFlagsWithDetails(){var t=this.sd(Qn),e=this.sd(Xn),i=this.sd(ts);if(!i&&!e)return t||{};var r=Wi({},t||{}),n=[...new Set([...Object.keys(i||{}),...Object.keys(e||{})])];for(var s of n){var a,o,l=r[s],u=null==e?void 0:e[s],h=K(u)?null!==(a=null==l?void 0:l.enabled)&&void 0!==a&&a:!!u,d=K(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==(o=l.metadata)?void 0:o.payload})),r[s]=c}return this.Ph||(this.I.warn(" Overriding feature flag details!",{flagDetails:t,overriddenPayloads:i,finalDetails:r}),this.Ph=!0),r}getAllFeatureFlags(){var t=this.getFlagVariants(),e=this.getFlagPayloads();return Object.keys(t).map((i=>{var r=t[i];return{key:i,enabled:_(r),variant:w(r),payload:b(e[i])}}))}getFlagVariants(){var t=this.sd(Vn),e=this.sd(Xn);if(!e)return t||{};for(var i=Wi({},t||{}),r=Object.keys(e),n=0;r.length>n;n++)i[r[n]]=e[r[n]];return this.Ph||(this.I.warn(" Overriding feature flags!",{enabledFlags:t,overriddenFlags:e,finalFlags:i}),this.Ph=!0),i}getFlagPayloads(){var t=this.sd(Jn),e=this.sd(ts);if(!e)return t||{};for(var i=Wi({},t||{}),r=Object.keys(e),n=0;r.length>n;n++)i[r[n]]=e[r[n]];return this.Ph||(this.I.warn(" Overriding feature flag payloads!",{flagPayloads:t,overriddenPayloads:e,finalPayloads:i}),this.Ph=!0),i}reloadFeatureFlags(){this.Nh||this.vn.featureFlagsDisabled||this.zh()||this.dd||(this.Oh.slice().forEach((t=>{try{t()}catch(t){this.I.error("Error while running feature flags reloading callback",t)}})),this.dd=setTimeout((()=>{this.vd()}),5))}nd(){clearTimeout(this.dd),this.dd=void 0}onReloading(t){return this.Oh.push(t),()=>{this.Oh=this.Oh.filter((e=>e!==t))}}ensureFlagsLoaded(){this.Lh||this.Dh||this.dd||this.reloadFeatureFlags()}setAnonymousDistinctId(t){this.$anon_distinct_id=t}setReloadingPaused(t){this.Nh=t}resetFlagCallReported(){this.ri(hs)}vd(t){this.nd();var e=this.Os;if(e&&!this.vn.remoteRequestsDisabled&&!this.zh())if(this.Dh)this.qh=!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.sd(es)||{},{$lib:e.library.name,$lib_version:e.library.version}),group_properties:this.sd(is),timezone:Zo()};K(e.deviceId)||(i.$device_id=e.deviceId),(null!=t&&t.disableFlags||this.vn.featureFlagsDisabled)&&(i.disable_flags=!0);var r=this.ld();r.length&&(i.evaluation_contexts=r);var n=this.ud();K(n)||(i.flag_keys=n);var s=this.vn.onlyEvaluateSurveyFeatureFlags,a="/flags/?v=2"+(s?"&only_evaluate_survey_feature_flags=true":""),o=this.$h;this.Dh=!0;var l=()=>{this.qh&&(this.qh=!1,this.vd())},u=t=>{this.Dh=!1,o===this.$h?(this.ei({[vs]:[Xk]}),this.I.error("Feature flag request failed",t),l()):l()};try{e.sendRequest(a,{target:"flags",method:"POST",body:i,compression:this.vn.compression,sentAt:"body",timeoutMs:this.vn.requestTimeoutMs}).then((t=>{var e,r,n=null!==(e=t.json)&&void 0!==e?e:{},a=200!==t.statusCode;if(this.Dh=!1,o===this.$h){if(this.fd(t.statusCode),a||this.qh||(this.$anon_distinct_id=void 0),!i.disable_flags||this.qh){this.jh=!a;var u=[];t.error?u.push(t.error instanceof Error&&"AbortError"===t.error.name?"timeout":t.error instanceof Error?Xk:"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.ei({[vs]: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.hd(n,a,{partialResponse:s}),l()}}else l()})).catch(u)}catch(t){u(t)}}}zh(){return or(this.Hh,3)}fd(t){this.Hh=lr(t,this.Hh,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.jh)if(this.Lh||this.getFlags()&&this.getFlags().length>0){if(!this.od()){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+Yk)}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.jh)if(this.Lh||this.getFlags()&&this.getFlags().length>0){if(!this.od()){var i,r=this.getFlagVariants(),n=t in r,s=r[t],a=this.getFlagPayloads()[t],o=String(s),l=this.sd(Kn)||void 0,u=this.sd(cs)||void 0,h=this.sd(hs)||{};if(this.vn.deduplicateCallsPerSession){var d,v=null==(d=this.Os)?void 0:d.session.sessionId,c=this.sd(ds);v&&v!==c&&(h={},i=v)}if(e.send_event||!("send_event"in e))if(t in h&&h[t].includes(o))i&&this.ei({[hs]:h,[ds]:i});else{var f,g,m,y,_,w,k,S,x,C,T,M;G(h[t])?h[t].push(o):h[t]=[o],this.ei(p({[hs]:h},i?{[ds]:i}:{}));var E=this.getFeatureFlagDetails(t),I=[...null!==(f=this.sd(vs))&&void 0!==f?f:[]];K(s)&&I.push("flag_missing");var R={$feature_flag:t,$feature_flag_response:s,$feature_flag_payload:null!=a?a:null,$feature_flag_request_id:l,$feature_flag_evaluated_at:u,$feature_flag_bootstrapped_response:null!==(g=null==(m=this.vn.bootstrap)||null==(m=m.featureFlags)?void 0:m[t])&&void 0!==g?g:null,$feature_flag_bootstrapped_payload:null!==(y=null==(_=this.vn.bootstrap)||null==(_=_.featureFlagPayloads)?void 0:_[t])&&void 0!==y?y:null,$used_bootstrap_value:!this.jh};K(null==E||null==(w=E.metadata)?void 0:w.has_experiment)||(R.$feature_flag_has_experiment=E.metadata.has_experiment),K(null==E||null==(k=E.metadata)?void 0:k.version)||(R.$feature_flag_version=E.metadata.version);var P,A=null!==(S=null==E||null==(x=E.reason)?void 0:x.description)&&void 0!==S?S:null==E||null==(C=E.reason)?void 0:C.code;A&&(R.$feature_flag_reason=A),null!=E&&null!=(T=E.metadata)&&T.id&&(R.$feature_flag_id=E.metadata.id),K(null==E?void 0:E.original_variant)&&K(null==E?void 0:E.original_enabled)||(R.$feature_flag_original_response=K(E.original_variant)?E.original_enabled:E.original_variant),null!=E&&null!=(M=E.metadata)&&M.original_payload&&(R.$feature_flag_original_payload=null==E||null==(P=E.metadata)?void 0:P.original_payload),I.length&&(R.$feature_flag_error=I.join(",")),this.pd(R)}else i&&this.ei({[hs]:h,[ds]:i});if(n)return{key:t,enabled:!!s,variant:"string"==typeof s?s:void 0,payload:b(a)}}}else this.I.warn('getFeatureFlagResult for key "'+t+Yk)}pd(t){try{var e;null==(e=this.Os)||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.gd(t,e)}gd(t,e){var i=this;return f((function*(){var r=i.Os;if(r){var n={distinct_id:r.distinctId,token:r.projectToken,person_properties:{$lib:r.library.name,$lib_version:r.library.version}},s=i.ld();s.length&&(n.evaluation_contexts=s);var a,o=i.ud();K(o)||(n.flag_keys=o);try{var l,u=null==(l=(yield r.sendRequest("/flags/?v=2",{target:"flags",method:"POST",body:n,compression:i.vn.compression,sentAt:"body",timeoutMs:i.vn.requestTimeoutMs})).json)?void 0:l.featureFlagPayloads;a=(null==u?void 0:u[t])||void 0}catch(t){return void i.I.error("Remote config feature flag request failed",t)}try{e(a)}catch(t){i.I.error("Remote config feature flag callback failed",t)}}}))()}isFeatureEnabled(t,e){if(void 0===e&&(e={}),e.fresh&&!this.jh)return e.defaultValue;if(!(this.Lh||this.getFlags()&&this.getFlags().length>0))return this.I.warn('isFeatureEnabled for key "'+t+Yk),e.defaultValue;var i=this.getFeatureFlag(t,e);return K(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.hd(t,e,i)}hd(t,e,i){if(this.Os){this.Lh=!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=Jk);var a=((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),o=a.flags,l=a.featureFlags,u=a.featureFlagPayloads;if(l){var h=t.requestId,d=t.evaluatedAt;if(G(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{[Gn]:l,[Vn]:v,[Yn]:!1}}var f=l,g=u,m=o;if(null!=n&&n.partialResponse)f=p({},e,f),g=p({},i,g),m=p({},r,m);else if(t.errorsWhileComputingFlags)if(o){var y=new Set(Object.keys(o).filter((t=>{var e;return!(null!=(e=o[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({[Gn]:Object.keys(eS(f)),[Vn]:f||{},[Jn]:g||{},[Qn]:m||{},[Yn]:!0===t.minimalFlagCalledEvents},h?{[Kn]:h}:{},d?{[cs]:d}:{})}}(t,this.getFlagVariants(),this.getFlagPayloads(),this.getFlagsWithDetails(),i,this.I);r&&this.ei(r),e||(this.Bh=!1),this.md(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.yd(t)}yd(t){if(this.Os){if(!1===t)return this.ri([Xn,ts]),this.md(),void Kk.info("All overrides cleared");if(G(t))return this.ei({[Xn]:tS(t)}),this.md(),void Kk.info("Flag overrides set",{flags:t});if(t&&"object"==typeof t&&("flags"in t||"payloads"in t)){var e,i=t;this.Ph=Boolean(null!==(e=i.suppressWarning)&&void 0!==e&&e);var r={},n=i.flags,s=i.payloads;return n&&(r[Xn]=G(n)?tS(n):n),s&&(r[ts]=s),Object.keys(r).length&&this.ei(r),!1===n&&!1===s?this.ri([Xn,ts]):!1===n?this.ri(Xn):!1===s&&this.ri(ts),this.md(),!1===n?Kk.info("Flag overrides cleared"):n&&Kk.info("Flag overrides set",{flags:n}),void(!1===s?Kk.info("Payload overrides cleared"):s&&Kk.info("Payload overrides set",{payloads:s}))}if(t&&"object"==typeof t)return this.ei({[Xn]:t}),this.md(),void Kk.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.Lh){var e=this.bd(),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.sd(Zn)||[]).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 a=p({},this.getFlagVariants(),{[t]:e});this.ei({[Gn]:Object.keys(eS(a)),[Vn]:a,[es]:p({},this.sd(es)||{},n)}),this.md();try{var o;null==(o=this.Os)||o.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.sd(Zn);!r||e?this._d(t,i):t(r)}_d(t,e){var i=this;return f((function*(){var r=i.Os;if(r){var n,s=e?"&"+e.map((t=>"stage="+t)).join("&"):"";try{var a=yield r.sendRequest("/api/early_access_features/?token="+r.projectToken+s,{target:"api",method:"GET",sentAt:"query"});if(!a.json)return;i.ei({[Zn]:n=a.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)}}}))()}bd(){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)),{})}}md(t){this.Xh();var e=this.bd(),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.wd(t,e)}wd(t,e){void 0===e&&(e=!0);var i=this.sd(es)||{},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 a in n)({}).hasOwnProperty.call(n,a)&&(a in i||(s[a]=n[a]));this.ei({[es]:p({},i,s,r)}),e&&this.reloadFeatureFlags()}unsetPersonPropertiesForFlags(t,e){void 0===e&&(e=!0);var i=p({},this.sd(es)||{});t.forEach((t=>{delete i[t]})),this.ei({[es]:i}),e&&this.reloadFeatureFlags()}resetPersonPropertiesForFlags(t){void 0===t&&(t=!0),this.ri(es),t&&this.reloadFeatureFlags()}setGroupPropertiesForFlags(t,e){void 0===e&&(e=!0);var i=this.sd(is)||{},r=p({},i);for(var n of Object.keys(t))r[n]=p({},i[n],t[n]);this.ei({[is]:r}),e&&this.reloadFeatureFlags()}resetGroupPropertiesForFlags(t){if(t){var e=this.sd(is)||{};this.ei({[is]:p({},e,{[t]:{}})})}else this.ri(is)}reset(){this.$h++,this.qh=!1,this.Ah={},this.Fh={},this.Lh=!1,this.Nh=!1,this.jh=!1,this.$anon_distinct_id=void 0,this.nd(),this.Ph=!1,this.Hh=0}}},fS={sessionRecording:class{get vn(){return this._instance.config}get yo(){return this._instance.persistence}get started(){var t;return!(null==(t=this.kd)||!t.isStarted)}get status(){var t,e;return this.Sd===Ys||this.Sd===Xs?this.Sd:null!==(t=null==(e=this.kd)?void 0:e.status)&&void 0!==t?t:this.Sd}constructor(e){if(this._forceAllowLocalhostNetworkCapture=!1,this.Sd=Vs,this.xd=void 0,this.Cd=!1,this.Dt=(()=>{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.$t=()=>{var t;"visible"===(null==r?void 0:r.visibilityState)&&(this.Dt=!0,null==(t=this.kd)||null==t.setDocumentWasEverVisible||t.setDocumentWasEverVisible(!0))},this._instance=e,!this._instance.sessionManager)throw Mk.error("started without valid sessionManager"),new Error(Tk+" started without valid sessionManager. This is a bug.");if(this.vn.cookieless_mode===Ds)throw new Error(Tk+' cannot be used with cookieless_mode="always"');null!=r&&r.addEventListener&&Yi(r,"visibilitychange",this.$t)}initialize(){this.startIfEnabledOrStop()}dispose(){this.Cd=!0,null==r||null==r.removeEventListener||r.removeEventListener("visibilitychange",this.$t),this.stopRecording()}get Td(){var e,i=!(null==(e=this._instance.get_property(Rn))||!e.enabled),r=!this.vn.disable_session_recording,n=this.vn.disable_session_recording||this._instance.consent.isOptedOut();return t&&i&&r&&!n}startIfEnabledOrStop(t){var e;if(!(this.Cd||this.Td&&null!=(e=this.kd)&&e.isStarted)){var i=!K(Object.assign)&&!K(Array.from);this.Td&&i?(this.Md(t),Mk.info("starting")):(this.Sd=Vs,this.stopRecording())}}Md(t){var e,i,r;this.Td&&(this.Sd!==Ys&&this.Sd!==Xs&&(this.Sd=Ks),null!=v&&null!=(e=v.__PosthogExtensions__)&&null!=(e=e.rrweb)&&e.record&&null!=(i=v.__PosthogExtensions__)&&i.initSessionRecording?this.Ed(t):null==(r=v.__PosthogExtensions__)||null==r.loadExternalDependency||r.loadExternalDependency(this._instance,this.Id,(e=>{if(e)return this._instance.register_for_session({[Cs]:!0}),Mk.error("could not load recorder",e);this.Ed(t)})))}stopRecording(){var t,e;null==(t=this.xd)||t.call(this),this.xd=void 0,null==(e=this.kd)||e.stop()}Rd(){var t,e;null==(t=this.xd)||t.call(this),this.xd=void 0,null==(e=this.kd)||e.discard()}Pd(){var t,e;null==(t=this.yo)||t.unregister($n),null==(e=this.yo)||e.unregister(Pn)}Ad(t,e){if(et(t))return null;var i,r=it(t)?t:parseFloat(t);return"number"!=typeof(i=r)||!Number.isFinite(i)||0>i||i>1?(Mk.warn(e+" must be between 0 and 1. Ignoring invalid value:",t),null):r}Fd(t){if(this.yo){var e,i,r=this.yo,n=()=>{var e,i=!1===t.sessionRecording?void 0:t.sessionRecording,n=this.Ad(null==(e=this.vn.session_recording)?void 0:e.sampleRate,"session_recording.sampleRate"),s=this.Ad(null==i?void 0:i.sampleRate,"remote config sampleRate"),a=null!=n?n:s;et(a)&&this.Pd();var o=null==i?void 0:i.minimumDurationMilliseconds;r.register({[Rn]: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:a,minimumDurationMilliseconds:K(o)?null:o,endpoint:null==i?void 0:i.endpoint,triggerMatchType:null==i?void 0:i.triggerMatchType,masking:null==i?void 0:i.masking,urlTriggers:null==i?void 0:i.urlTriggers,version:null==i?void 0:i.version,triggerGroups:null==i?void 0:i.triggerGroups})})};n(),null==(e=this.xd)||e.call(this),this.xd=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.Fd(e),void this.Rd()):(this.Fd(e),void this.startIfEnabledOrStop()):(this.Sd===Ys&&(this.Sd=Xs,Mk.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.kd)&&i.log?this.kd.log(t,e):Mk.warn("log called before recorder was ready")}get Id(){var t,e,i=null==(t=this._instance)||null==(t=t.persistence)?void 0:t.get_property(Rn);return(null==i||null==(e=i.scriptConfig)?void 0:e.script)||"lazy-recorder"}Od(){var t,e=this._instance.get_property(Rn);if(!e)return!1;try{t="object"==typeof e?e:JSON.parse(e)}catch(t){return Mk.warn("persisted remote config for session recording is invalid and will be ignored",t),!1}return!et(t.cache_timestamp)&&Date.now()-t.cache_timestamp<=_l}Ed(t){var e,i,r;if(!this.Cd){if(null==(e=v.__PosthogExtensions__)||!e.initSessionRecording)return Mk.warn("Called on script loaded before session recording is available. This can be caused by adblockers."),void this._instance.register_for_session({[Cs]:!0});var n;if(this.kd||(this.kd=null==(n=v.__PosthogExtensions__)?void 0:n.initSessionRecording(this._instance,this.Dt),this.kd._forceAllowLocalhostNetworkCapture=this._forceAllowLocalhostNetworkCapture),!this.Od()){if(this.Sd===Xs||this.Sd===Ys)return;return this.Sd=Ys,Mk.info("persisted remote config is stale, requesting fresh config before starting"),void new pw(this._instance).load()}this.Sd=Ks,null==(i=(r=this.kd).setDocumentWasEverVisible)||i.call(r,this.Dt),this.kd.start(t)}}onRRwebEmit(t){var e;null==(e=this.kd)||null==e.onRRwebEmit||e.onRRwebEmit(t)}overrideLinkedFlag(){var t,e;this.kd||null==(e=this.yo)||e.register({[Fn]:!0}),null==(t=this.kd)||t.overrideLinkedFlag()}overrideSampling(){var t,e;this.kd||null==(e=this.yo)||e.register({[An]:!0}),null==(t=this.kd)||t.overrideSampling()}overrideTrigger(t){var e,i;this.kd||null==(i=this.yo)||i.register({["url"===t?On:Ln]:!0}),null==(e=this.kd)||e.overrideTrigger(t)}get sdkDebugProperties(){var t;return(null==(t=this.kd)?void 0:t.sdkDebugProperties)||{$recording_status:this.status}}tryAddCustomEvent(t,e){var i;return!(null==(i=this.kd)||!i.tryAddCustomEvent(t,e))}}},pS={autocapture:class extends I_{constructor(t){super(new yk(t)),this.instance=t}},historyAutocapture:class{constructor(t){this._instance=t,this.Ld=this.Dd()}initialize(){this.startIfEnabled()}get isEnabled(){var t=this.$d();return!!(t.path||t.search||this.Nd(t))}startIfEnabled(){this.isEnabled&&(Bi.info("History API monitoring enabled, starting..."),this.monitorHistoryChanges())}startIfEnabledOrStop(){this.stop(),this.Ld=this.Dd(),this.startIfEnabled()}stop(){this.qd&&this.qd(),this.qd=void 0,this.jd&&this.jd(),this.jd=void 0,Bi.info("History API monitoring stopped")}monitorHistoryChanges(){t&&t.history&&(this.Bd("pushState"),this.Bd("replaceState"),this.Hd(),this.Nd()&&this.zd())}Bd(e){var i;if(t&&(null==(i=t.history[e])||!i.__posthog_wrapped__)){var r=this;Dv(t.history,e,(t=>function(i,n,s){t.call(this,i,n,s),r.Ud(e)}))}}Dd(){var e=null==t?void 0:t.location;if(null!=e&&e.pathname)return{pathname:e.pathname,search:e.search,hash:e.hash}}$d(){var t=this._instance.config.capture_pageview;return"history_change"===t?{path:!0}:Q(t)?t:{}}Nd(t){return void 0===t&&(t=this.$d()),!!t.hash&&!this._instance.config.disable_capture_url_hashes}Wd(t){var e=this.$d(),i=this.Ld;return!(!i||!(e.path&&t.pathname!==i.pathname||e.search&&t.search!==i.search||this.Nd(e)&&t.hash!==i.hash))}Ud(t){try{var e=this.Dd();if(!e)return;this.Wd(e)&&this._instance.capture(Hs,{navigation_type:t}),this.Ld=e}catch(e){Bi.error("Error capturing "+t+" pageview",e)}}Hd(){if(!this.qd){var e=()=>{this.Ud("popstate")};Yi(t,"popstate",e),this.qd=()=>{t&&t.removeEventListener("popstate",e)}}}zd(){if(!this.jd){var e=()=>{this.Ud("hashchange")};Yi(t,"hashchange",e),this.jd=()=>{t&&t.removeEventListener("hashchange",e)}}}},heatmaps:class{get vn(){return this.instance.config}constructor(t){var e;this.Vd=!1,this.Ts=!1,this.Gd=null,this.instance=t,this.Vd=!(null==(e=this.instance.persistence)||!e.props[wn]),this.rageclicks=new S_(t.config.rageclick)}initialize(){this.startIfEnabled()}get flushIntervalMilliseconds(){var t=5e3;return Q(this.vn.capture_heatmaps)&&this.vn.capture_heatmaps.flush_interval_milliseconds&&(t=this.vn.capture_heatmaps.flush_interval_milliseconds),t}get isEnabled(){return et(this.vn.capture_heatmaps)?et(this.vn.enable_heatmaps)?this.Vd:this.vn.enable_heatmaps:!1!==this.vn.capture_heatmaps}startIfEnabled(){if(this.isEnabled){if(this.Ts)return;Ek.info("starting..."),this.Zd(),this.$t()}else{var t;clearInterval(null!==(t=this.Gd)&&void 0!==t?t:void 0),this.Qd(),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({[wn]:i}),this.Vd=i,this.startIfEnabled()}}}getAndClearBuffer(){var t=this.At;return this.At=void 0,t}Jd(t){Ik(t.originalEvent)&&this.Qi(t.originalEvent,"deadclick")}$t(){this.Gd&&clearInterval(this.Gd),this.Gd=function(t){return"visible"===(null==t?void 0:t.visibilityState)}(r)?setInterval(this.oo.bind(this),this.flushIntervalMilliseconds):null}Zd(){t&&r&&(this.Kd=this.oo.bind(this),Yi(t,Bs,this.Kd),this.Yd=e=>this.Qi(e||(null==t?void 0:t.event)),Yi(r,"click",this.Yd,{capture:!0}),this.Xd=e=>this.tv(e||(null==t?void 0:t.event)),Yi(r,"mousemove",this.Xd,{capture:!0}),this.ev=new J_(this.instance,Z_,this.Jd.bind(this)),this.ev.startIfEnabledOrStop(),this.iv=this.$t.bind(this),Yi(r,js,this.iv),this.Ts=!0)}Qd(){var e;t&&r&&(this.Kd&&t.removeEventListener(Bs,this.Kd),this.Yd&&r.removeEventListener("click",this.Yd,{capture:!0}),this.Xd&&r.removeEventListener("mousemove",this.Xd,{capture:!0}),this.iv&&r.removeEventListener(js,this.iv),clearTimeout(this.rv),null==(e=this.ev)||e.stop(),this.Ts=!1)}nv(e,i){var r=this.instance.scrollManager.scrollY(),n=this.instance.scrollManager.scrollX(),s=this.instance.scrollManager.scrollElement(),a=function(e,i,r){for(var n=e;n&&gr(n)&&!mr(n,"body");){if(n===r)return!1;var s=void 0;try{var a,o,l;s=null==(a=null!==(o=null==(l=n.ownerDocument)?void 0:l.defaultView)&&void 0!==o?o:t)?void 0:a.getComputedStyle(n).position}catch(t){return!1}if(j(i,s))return!0;n=Ir(n)}return!1}(Tr(e),["fixed","sticky"],s);return{x:e.clientX+(a?0:n),y:e.clientY+(a?0:r),target_fixed:a,type:i}}Qi(t,e){var i;if(void 0===e&&(e="click"),!pr(t.target)&&Ik(t)){var r=this.nv(t,e);null!=(i=this.rageclicks)&&i.isRageClick(t.clientX,t.clientY,(new Date).getTime())&&$r(Tr(t),this.instance.config.rageclick)&&this.fs(p({},r,{type:"rageclick"})),this.fs(r)}}tv(t){!pr(t.target)&&Ik(t)&&(clearTimeout(this.rv),this.rv=setTimeout((()=>{this.fs(this.nv(t,"mousemove"))}),500))}fs(e){if(t){var i=this.vn.disable_capture_url_hashes?Te(t.location.href):t.location.href,r=this.vn.custom_personal_data_properties,n=this.vn.mask_personal_data_properties?[...Do,...r||[]]:[],s=sr(i,n,No);this.At=this.At||{},this.At[s]||(this.At[s]=[]),this.At[s].push(e)}}oo(){this.At&&!J(this.At)&&this.instance.capture("$$heatmap",{$heatmap_data:this.getAndClearBuffer()})}},deadClicksAutocapture:J_,webVitalsAutocapture:class{constructor(t){var e;this.Vd=!1,this.Ts=!1,this.At={navigationKey:void 0,url:void 0,metrics:[],firstMetricTimestamp:void 0},this.sv=()=>{clearTimeout(this.av),this.av=void 0,0!==this.At.metrics.length&&(this._instance.capture("$web_vitals",p({$current_url:this.At.url},this.At.metrics.reduce(((t,e)=>p({},t,{["$web_vitals_"+e.name+"_event"]:p({},e),["$web_vitals_"+e.name+"_value"]:e.value})),{}))),this.At={navigationKey:void 0,url:void 0,metrics:[],firstMetricTimestamp:void 0})},this.ov=t=>{var e;if(this.At=this.At||{navigationKey:void 0,url:void 0,metrics:[],firstMetricTimestamp:void 0},et(null==t?void 0:t.name)||et(null==t?void 0:t.value))wk.error("Invalid metric received",t);else{var i="string"==typeof t.navigationURL?t.navigationURL:void 0,r=this.lv(i);if(!K(r)){var n=it(t.navigationId)||"string"==typeof t.navigationId?"navigation:"+t.navigationId:"url:"+r;if(!this.uv||this.uv>t.value){this.At.navigationKey!==n&&(this.sv(),this.av=setTimeout(this.sv,this.flushToCaptureTimeoutMs)),K(this.At.navigationKey)&&(this.At.navigationKey=n,this.At.url=r),this.At.firstMetricTimestamp=K(this.At.firstMetricTimestamp)?Date.now():this.At.firstMetricTimestamp;var s=null==(e=this._instance.sessionManager)?void 0:e.checkAndGetSessionAndWindowId(!0),a=p({},t,i?{navigationURL:r}:{},{$current_url:r,timestamp:Date.now()});if(delete a.entries,Q(t.attribution)&&this.attributionMetrics.indexOf(t.name)>-1){var o={};for(var l of Ck){var u="url"===l&&"string"==typeof t.attribution[l]?this.lv(t.attribution[l]):t.attribution[l];K(u)||(o[l]=u)}a.attribution=o}else delete a.attribution;K(s)||(a.$session_id=s.sessionId,a.$window_id=s.windowId),this.At.metrics.push(a),this.At.metrics.length===this.allowedMetrics.length&&this.sv()}else wk.error("Ignoring metric with value >= "+this.uv,t)}}},this.hv=()=>{if(!this.Ts){var t,e,i,r,n=!1,s=v.__PosthogExtensions__,a=null==s?void 0:s.postHogWebVitalsCallbacksByFlavor,o=(null==a?void 0:a[this.dv])||("web-vitals"===this.dv&&K(a)?null==s?void 0:s.postHogWebVitalsCallbacks:void 0);if(!K(o)){var l=o.withoutAttribution,u=this.attributionMetrics;n=!K(l),t=u.indexOf("LCP")>-1?o.onLCP:(null==l?void 0:l.onLCP)||o.onLCP,e=u.indexOf("CLS")>-1?o.onCLS:(null==l?void 0:l.onCLS)||o.onCLS,i=u.indexOf("FCP")>-1?o.onFCP:(null==l?void 0:l.onFCP)||o.onFCP,r=u.indexOf("INP")>-1?o.onINP:(null==l?void 0:l.onINP)||o.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.ov.bind(this),h),this.allowedMetrics.indexOf("CLS")>-1&&e(this.ov.bind(this),h),this.allowedMetrics.indexOf("FCP")>-1&&i(this.ov.bind(this),h),this.allowedMetrics.indexOf("INP")>-1&&r(this.ov.bind(this),d),this.Ts=!0}else wk.error("web vitals callbacks not loaded - not starting")}},this._instance=t,this.Vd=!(null==(e=this._instance.persistence)||!e.props[Cn]),this.startIfEnabled()}get vv(){return this._instance.config.capture_performance}get allowedMetrics(){var t,e,i=Q(this.vv)?null==(t=this.vv)?void 0:t.web_vitals_allowed_metrics:void 0;return et(i)?(null==(e=this._instance.persistence)?void 0:e.props[In])||Sk:i}get flushToCaptureTimeoutMs(){return(Q(this.vv)?this.vv.web_vitals_delayed_flush_ms:void 0)||5e3}get attributionMetrics(){var t=Q(this.vv)?this.vv.web_vitals_attribution:void 0;return nt(t)?t?Sk:[]:G(t)?t:xk}get useAttribution(){return this.attributionMetrics.length>0}get useSoftNavs(){var t=Q(this.vv)?this.vv.__preview_web_vitals_soft_navs:void 0;return null!=t&&t}get uv(){var t=Q(this.vv)&&it(this.vv.__web_vitals_max_value)?this.vv.__web_vitals_max_value:kk;return t>0&&6e4>=t?kk:t}get isEnabled(){var t=null==n?void 0:n.protocol;if("http:"!==t&&"https:"!==t)return wk.info("Web Vitals are disabled on non-http/https protocols"),!1;var e=Q(this.vv)?this.vv.web_vitals:nt(this.vv)?this.vv:void 0;return nt(e)?e:this.Vd}startIfEnabled(){this.isEnabled&&!this.Ts&&(wk.info("enabled, starting..."),this.Zs(this.hv))}onRemoteConfig(t){if(t.ok){var e=t.config;if("capturePerformance"in e){var i=Q(e.capturePerformance)&&!!e.capturePerformance.web_vitals,r=Q(e.capturePerformance)?e.capturePerformance.web_vitals_allowed_metrics:void 0;this._instance.persistence&&(this._instance.persistence.register({[Cn]:i}),this._instance.persistence.register({[In]:r})),this.Vd=i,this.startIfEnabled()}}}get dv(){return this.useSoftNavs?this.useAttribution?"web-vitals-with-attribution-soft-navs":"web-vitals-soft-navs":this.useAttribution?"web-vitals-with-attribution":"web-vitals"}Zs(t){var e=v.__PosthogExtensions__,i=this.dv,r=null==e?void 0:e.postHogWebVitalsCallbacksByFlavor;null!=r&&r[i]||"web-vitals"===i&&K(r)&&null!=e&&e.postHogWebVitalsCallbacks?t():null==e||null==e.loadExternalDependency||e.loadExternalDependency(this._instance,i,(e=>{e?wk.error("failed to load script",e):t()}))}lv(e){var i=e||(null==t?void 0:t.location.href);if(i){var r=this._instance.config.disable_capture_url_hashes?Te(i):i,n=this._instance.config.custom_personal_data_properties,s=this._instance.config.mask_personal_data_properties?[...Do,...n||[]]:[];return sr(r,s,No)}wk.error("Could not determine current URL")}}},gS={exceptionObserver:class{constructor(e){var i;this.hv=()=>{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.fv&&this.vn.capture_unhandled_errors&&(this.fv=i(this.captureException.bind(this))),!this.pv&&this.vn.capture_unhandled_rejections&&(this.pv=r(this.captureException.bind(this))),!this.gv&&this.vn.capture_console_errors&&(this.gv=n(this.captureException.bind(this)))}catch(t){bk.error("failed to start",t),this.mv()}}},this._instance=e,this.yv=!(null==(i=this._instance.persistence)||!i.props[kn]),this.de=new mt(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:bk})),this.vn=this.bv(),this.startIfEnabledOrStop()}bv(){var t=this._instance.config.capture_exceptions,e={capture_unhandled_errors:!1,capture_unhandled_rejections:!1,capture_console_errors:!1};return Q(t)?e=p({},e,t):(K(t)?this.yv:t)&&(e=p({},e,{capture_unhandled_errors:!0,capture_unhandled_rejections:!0})),e}get isEnabled(){return this.vn.capture_console_errors||this.vn.capture_unhandled_errors||this.vn.capture_unhandled_rejections}startIfEnabledOrStop(){this.isEnabled?(bk.info("enabled"),this.mv(),this.Zs(this.hv)):this.mv()}Zs(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 bk.error("failed to load script",e);t()}))}mv(){var t,e,i;null==(t=this.fv)||t.call(this),this.fv=void 0,null==(e=this.pv)||e.call(this),this.pv=void 0,null==(i=this.gv)||i.call(this),this.gv=void 0}onRemoteConfig(t){if(t.ok){var e=t.config;"autocaptureExceptions"in e&&(this.yv=!!e.autocaptureExceptions||!1,this._instance.persistence&&this._instance.persistence.register({[kn]:this.yv}),this.vn=this.bv(),this.startIfEnabledOrStop())}}onConfigChange(){this.vn=this.bv()}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.de.consumeRateLimit(n)?bk.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._v=[],this.wv=um(),this._instance=t,this._v=null!==(e=null==(i=this._instance.persistence)?void 0:i.get_property(Sn))&&void 0!==e?e:[],this.Sv=Di(this.xv()),this.Cv=new $i(this.Sv)}onConfigChange(){this.Sv=Di(this.xv()),this.Cv.setConfig(this.Sv)}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:[],a=null==(r=n.errorTracking)?void 0:r.captureExtensionExceptions;this._v=s,this._instance.persistence&&this._instance.persistence.register({[Sn]:this._v,[xn]:a})}}}get Tv(){var t,e=!!this._instance.get_property(xn),i=this._instance.config.error_tracking.captureExtensionExceptions;return null!==(t=null!=i?i:e)&&void 0!==t&&t}buildProperties(t,e){return this.wv.buildFromUnknown(t,{syntheticException:null==e?void 0:e.syntheticException,mechanism:{handled:null==e?void 0:e.handled}})}addExceptionStep(t,e){if(this.Sv.enabled)try{if(!Y(t)||0===t.trim().length)return void am.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.Mv(e)),r=i.sanitizedProperties,n=i.droppedKeys;n.length>0&&am.warn("Ignoring reserved exception step fields",{droppedKeys:n}),this.Cv.add(p({[Ai]:t,[Fi]:(new Date).toISOString()},r))}catch(t){am.error("Failed to add exception step. Ignoring breadcrumb.",t)}}sendExceptionEvent(t){try{var e=t.$exception_list;if(this.Ev(e)){if(this.Iv(e))return this.Rv("Exception dropped: matched a suppression rule"),void am.info("Skipping exception capture because a suppression rule matched");if(!this.Tv&&this.Pv(e))return this.Rv("Exception dropped: thrown by a browser extension"),void am.info("Skipping exception capture because it was thrown by an extension");if(!this.Tv&&this.Av(e))return this.Rv("Exception dropped: thrown by an injected browser script"),void am.info("Skipping exception capture because it was thrown by an injected browser script");if(!this._instance.config.error_tracking.__capturePostHogExceptions&&this.Fv(e))return this.Rv("Exception dropped: thrown by the PostHog SDK"),void am.info("Skipping exception capture because it was thrown by the PostHog SDK")}var i=this.Sv.enabled&&et(t.$exception_steps)?this.Ov(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",jl:!0});return n&&this.Cv.clear(),n}catch(t){return am.error("Failed to capture exception event. Dropping this exception.",t),void this.Cv.clear()}}catch(t){return void am.error("Failed to process exception event. Ignoring this exception.",t)}var s}Ov(t){try{var e=this.Cv.getAttachable();return 0===e.length?t:p({},t,{$exception_steps:e})}catch(e){return am.error("Failed to read buffered exception steps. Capturing exception without steps.",e),t}}Rv(t){this.Sv.enabled&&this.Cv.add({[Ai]:t,[Fi]:(new Date).toISOString()})}Mv(t){return Q(t)?p({},t):{}}xv(){var t,e;return null!==(t=null==(e=this._instance.config.error_tracking)?void 0:e.exception_steps)&&void 0!==t?t:{}}Iv(t){if(0===t.length)return!1;try{var e=t.reduce(((t,e)=>{var i=e.type,r=e.value;return Y(i)&&i.length>0&&t.$exception_types.push(i),Y(r)&&r.length>0&&t.$exception_values.push(r),t}),{$exception_types:[],$exception_values:[]});return this._v.some((t=>{var i=t.values.map((t=>{var i=xo[t.operator],r=e[t.key];if(!i||!r)return!1;var n=G(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 am.warn("Failed to evaluate suppression rules. Capturing the exception.",t),!1}}Pv(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&&om.some((t=>e.startsWith(t)))}))}Av(t){return t.some((t=>{var e=t.value;return Y(e)&&lm.some((t=>e.includes(t)))}))}Fv(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:[],a=s[s.length-1];return null!==(r=null==a||null==(n=a.filename)?void 0:n.includes("posthog.com/static"))&&void 0!==r&&r}return!1}Ev(t){return!et(t)&&G(t)}}},mS=p({productTours:class{get yo(){return this._instance.persistence}constructor(t){this.Lv=null,this.Dv=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.yo&&this.yo.register({[Mn]:!!e.productTours}),!Pk(this._instance))return!this.Lv&&et(null==(i=this.yo)?void 0:i.props[us])||Rk.info("product tours disabled; stopping and clearing cached tours"),null==(r=this.Lv)||r.stop(),this.Lv=null,void this.clearCache();this.loadIfEnabled()}}}loadIfEnabled(){!this.Lv&&Pk(this._instance)&&this.Zs((()=>this.$v()))}Zs(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?Rk.error("Could not load product tours script",e):t()}))}$v(){var t;!this.Lv&&null!=(t=v.__PosthogExtensions__)&&t.generateProductTours&&(this.Lv=v.__PosthogExtensions__.generateProductTours(this._instance,!0))}getProductTours(t,e){if(void 0===e&&(e=!1),!G(this.Dv)||e){var i=this.yo;if(i){var r=i.props[us];if(G(r)&&!e)return this.Dv=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(Pk(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||Rk.warn(n):Rk.error(n),void t([],{isLoaded:!1,error:n})}var s=G(e.json.product_tours)?e.json.product_tours:[];this.Dv=s,i&&i.register({[us]:s}),t(s,{isLoaded:!0})}else t([],{isLoaded:!0})}})}else t(this.Dv,{isLoaded:!0})}getActiveProductTours(t){et(this.Lv)?t([],{isLoaded:!1,error:"Product tours not loaded"}):this.Lv.getActiveProductTours(t)}showProductTour(t){var e;null==(e=this.Lv)||e.showTourById(t)}previewTour(t){this.Lv?this.Lv.previewTour(t):this.Zs((()=>{var e;this.$v(),null==(e=this.Lv)||e.previewTour(t)}))}dismissProductTour(){var t;null==(t=this.Lv)||t.dismissTour("user_clicked_skip")}nextStep(){var t;null==(t=this.Lv)||t.nextStep()}previousStep(){var t;null==(t=this.Lv)||t.previousStep()}clearCache(){var t;this.Dv=null,null==(t=this.yo)||t.unregister(us)}resetTour(t){var e;null==(e=this.Lv)||e.resetTour(t)}resetAllTours(){var t;null==(t=this.Lv)||t.resetAllTours()}cancelPendingTour(t){var e;null==(e=this.Lv)||e.cancelPendingTour(t)}}},cS),yS={siteApps:class{constructor(t){this.Nv=0,this._instance=t,this.qv=[],this.apps={}}get isEnabled(){return!!this._instance.config.opt_in_site_apps}jv(t,e){if(e){var i=this.globalsForEvent(e);this.qv.push(i),this.qv.length>1e3&&(this.qv=this.qv.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.jv.bind(this));this.Bv=()=>{t(),this.qv=[],this.Bv=void 0}}}globalsForEvent(t){var e,i,r,n,s,a,o;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,Ak),{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==(a=t.properties)?void 0:a.$elements_chain)&&void 0!==s?s:"",distinct_id:null==(o=t.properties)?void 0:o.distinct_id}),person:{properties:this._instance.get_property("$stored_person_properties")},groups:l}}Hv(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)||(Fk.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)||(Fk.error("prepare_external_dependency_script returned null"),null):t}zv(){var t,e,i,n,s,a,o,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.Nv++,this.Uv)return this.Wv();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.Hv(t);return e&&c.add(e),e},g=t=>t.map((t=>"string"==typeof t?t:p(t))).filter((t=>!tt(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==(a=u.CharacterData)?void 0:a.prototype,null==(o=u.DocumentType)?void 0:o.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.Uv=()=>{d.forEach((t=>t())),this.Uv=void 0},this.Wv()}Wv(){var t=!1;return()=>{var e;t||(t=!0,this.Nv--,0===this.Nv&&(null==(e=this.Uv)||e.call(this)))}}Vv(t,e){void 0===e&&(e=!0);var i=this.zv();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.qv.length&&(Fk.info("Processing "+this.qv.length+" events for site app with id "+t.id),this.qv.forEach((t=>this.Vv((()=>null==e.processEvent?void 0:e.processEvent(t))))),e.processedBuffer=!0),Object.values(this.apps).every((t=>t.processedBuffer||t.errored))&&(null==(i=this.Bv)||i.call(this))},r=!1,n=n=>{e.errored=!n,e.loaded=!0,Fk.info("Site app with id "+t.id+" "+(n?"loaded":"errored")),r&&i()};try{var s=this.Vv((e=>t.init({posthog:this._instance,callback(t){e(),n(t)}})),!1).processEvent;s&&(e.processEvent=s),r=!0}catch(e){Fk.error(Ok+t.id,e),n(!1)}if(r&&e.loaded)try{i()}catch(i){Fk.error("Error while processing buffered events PostHog app with config id "+t.id,i),e.errored=!0}}Gv(){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)}Zv(t){var e=this;if(0!==Object.keys(this.apps).length){var i=this.globalsForEvent(t),r=function(r){try{e.Vv((()=>null==r.processEvent?void 0:r.processEvent(i)))}catch(e){Fk.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.Gv(),void this._instance.on("eventCaptured",(t=>this.Zv(t)))):void Fk.error('PostHog site apps are disabled. Enable the "opt_in_site_apps" config to proceed.');if(null==(i=this.Bv)||i.call(this),t.ok){var s=t.config;if(null!=(r=s.siteApps)&&r.length)if(this.isEnabled){var a=function(){var t,e=o.id,i=o.url;v["__$$ph_site_app_"+e]=n._instance,null==(t=v.__PosthogExtensions__)||null==t.loadSiteApp||t.loadSiteApp(n._instance,i,(t=>{if(t)return Fk.error(Ok+e,t)}))};for(var o of s.siteApps)a()}else Fk.error('PostHog site apps are disabled. Enable the "opt_in_site_apps" config to proceed.')}}}},bS={tracingHeaders:class{constructor(t){this.Qv=void 0,this.Jv=void 0,this.Kv=void 0,this.hv=()=>{var t,e,i=this.Yv();i?(K(this.Qv)&&(this.Qv=null==(t=v.__PosthogExtensions__)||null==(t=t.tracingHeadersPatchFns)?void 0:t._patchXHR(i,(()=>this._instance.get_distinct_id()),this._instance.sessionManager)),K(this.Jv)&&(this.Jv=null==(e=v.__PosthogExtensions__)||null==(e=e.tracingHeadersPatchFns)?void 0:e._patchFetch(i,(()=>this._instance.get_distinct_id()),this._instance.sessionManager))):this.mv()},this._instance=t}initialize(){this.startIfEnabledOrStop()}Zs(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 _k.error("failed to load script",e);t()}))}Xv(){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}Yv(){var t=this.Xv();return G(t)?(G(this.Kv)?this.Kv.splice(0,this.Kv.length,...t):this.Kv=[...t],t.length>0?this.Kv:void 0):(G(this.Kv)&&this.Kv.splice(0),this.Kv=t||void 0,this.Kv)}mv(){var t,e;null==(t=this.Qv)||t.call(this),null==(e=this.Jv)||e.call(this),this.Qv=void 0,this.Jv=void 0}startIfEnabledOrStop(){this.Yv()?this.Zs(this.hv):this.mv()}}},_S=p({surveys:class extends Nk{constructor(t){var e;super(new Uk(t),{get projectToken(){return e.config.token},kv:new zk(e=t)}),this._instance=t}du(t,e){var i=e.query?_w(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})}))}}},cS),wS={toolbar:class{constructor(t){this.instance=t}tc(t){v.ph_toolbar_state=t}ec(){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),Xi(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,a=Wk||ar(e.hash,"__posthog")||ar(e.hash,"state"),o=a?Gi((()=>JSON.parse(atob(decodeURIComponent(a)))))||Gi((()=>JSON.parse(decodeURIComponent(a)))):null;return o&&"ph_authorize"===o.action?((s=o).source="url",s&&Object.keys(s).length>0&&(o.desiredHash?e.hash=o.desiredHash:n?n.replaceState(n.state,"",e.pathname+e.search):e.hash="")):((s=JSON.parse(i.getItem(Vk)||"{}")).source="localstorage",delete s.userIntent),!(!s.token||this.instance.config.token!==s.token||(this.loadToolbar(s),0))}catch(t){return!1}}ic(t){var e=v.ph_load_toolbar||v.ph_load_editor;!et(e)&&Z(e)?e(t,this.instance):Gk.warn("No toolbar load function found")}loadToolbar(e){var i=!(null==r||!r.getElementById(dr));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(Vk,JSON.stringify(p({},s,{source:void 0}))),2===this.ec())this.ic(s);else if(0===this.ec()){var a;this.tc(1),null==(a=v.__PosthogExtensions__)||null==a.loadExternalDependency||a.loadExternalDependency(this.instance,"toolbar",(t=>{if(t)return Gk.error("[Toolbar] Failed to load",t),void this.tc(0);this.tc(2),this.ic(s)})),Yi(t,"turbolinks:load",(()=>{this.tc(0),this.loadToolbar(s)}))}return!0}rc(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)}}},kS=p({experiments:nS},cS),SS={conversations:class{constructor(t){this.nc=void 0,this._conversationsManager=null,this.sc=!1,this.Fe=null,this.ac=!1,this._instance=t}initialize(){this.loadIfEnabled()}onRemoteConfig(t){if(!this._instance.config.disable_conversations&&(this.oc=t.ok,t.ok)){var e=t.config.conversations;et(e)||(nt(e)?this.nc=e:(this.nc=e.enabled,this.Fe=e),this.loadIfEnabled())}}reset(){var t;null==(t=this._conversationsManager)||t.reset(),this._conversationsManager=null,this.nc=void 0,this.Fe=null,this.oc=void 0,this.ac=!1}loadIfEnabled(){if(!(this._conversationsManager||this.sc||this._instance.config.disable_conversations||Xi(this._instance.config)||this._instance.config.cookieless_mode&&this._instance.consent.isOptedOut())){var t=null==v?void 0:v.__PosthogExtensions__;if(t&&!K(this.nc)&&this.nc)if(this.Fe&&this.Fe.token){this.sc=!0;try{var e=t.initConversations;if(e)return this.lc(e),void(this.sc=!1);var i=t.loadExternalDependency;if(!i)return void this.uc(Os);i(this._instance,"conversations",(e=>{e||!t.initConversations?this.uc("Could not load conversations script",e):this.lc(t.initConversations),this.sc=!1}))}catch(t){this.uc("Error initializing conversations",t),this.sc=!1}}else sS.error("Conversations enabled but missing token in remote config.")}}lc(t){if(this.Fe)try{this._conversationsManager=t(this.Fe,this._instance),this.ac=!1,sS.info("Conversations loaded successfully")}catch(t){this.uc("Error completing conversations initialization",t)}else sS.error("Cannot complete initialization: remote config is null")}uc(t,e){sS.error(t,e),this._conversationsManager=null,this.sc=!1,this.ac=!0}show(){this._conversationsManager?this._conversationsManager.show():sS.warn("Conversations not loaded yet.")}hide(){this._conversationsManager&&this._conversationsManager.hide()}isAvailable(){return!0===this.nc&&!tt(this._conversationsManager)}getUnavailableReason(){return this.isAvailable()?null:this._instance.config.disable_conversations?"disabled_by_config":Xi(this._instance.config)?"disabled_for_toolbar":this._instance.config.cookieless_mode&&this._instance.consent.isOptedOut()?"consent_opted_out":!1===this.oc?"remote_config_failed":K(this.nc)?this.oc?"disabled_in_project":"remote_config_pending":this.nc?et(this.Fe)||!this.Fe.token?"missing_token":null!=v&&v.__PosthogExtensions__?this.sc?"initializing":this.ac?"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):(sS.warn(aS),null)}))()}getMessages(t,e){var i=this;return f((function*(){return i._conversationsManager?i._conversationsManager.getMessages(t,e):(sS.warn(aS),null)}))()}markAsRead(t){var e=this;return f((function*(){return e._conversationsManager?e._conversationsManager.markAsRead(t):(sS.warn(aS),null)}))()}getTickets(t){var e=this;return f((function*(){return e._conversationsManager?e._conversationsManager.getTickets(t):(sS.warn(aS),null)}))()}requestRestoreLink(t){var e=this;return f((function*(){return e._conversationsManager?e._conversationsManager.requestRestoreLink(t):(sS.warn(aS),null)}))()}restoreFromToken(t){var e=this;return f((function*(){return e._conversationsManager?e._conversationsManager.restoreFromToken(t):(sS.warn(aS),null)}))()}restoreFromUrlToken(){var t=this;return f((function*(){return t._conversationsManager?t._conversationsManager.restoreFromUrlToken():(sS.warn(aS),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}Ql(){var t;null==(t=this._conversationsManager)||t.setIdentity()}Jl(){var t;null==(t=this._conversationsManager)||t.clearIdentity()}}},xS={logs:class{constructor(e){var i,r=this;this.name=Yf,this.hc=!1,this.dc=!1,this.vc=!1,this.I=Hi("[logs]"),this.cc=p({},this.I,{error(){for(var t=arguments.length,e=new Array(t),i=0;t>i;i++)e[i]=arguments[i];e.some(vS)||r.I.error(...e)}}),this.Za=[],this.fc=[],this.Hh=0,this.Rs=!1,this.gc=[],this.mc=[],this.yc=!1,this.bc=!1,this._c=()=>{var t,e;this.Rs||(this.Hh=0,null==(t=this.wc)||t.onReconnect(),null==(e=this.kc)||e.onReconnect())},this._instance=e,this._instance&&null!=(i=this._instance.config.logs)&&i.captureConsoleLogs&&(this.hc=!0),t&&Yi(t,"online",this._c)}Sc(t,e,i,r){var n,s=oS(null==(n=this._instance)||null==(n=n.config)?void 0:n.logs,i);return[new Ye(this.xc(t,e),s,this.cc,(()=>this.Cc()),(t=>t()),void 0,r),s]}Tc(){var t,e=null==(t=this._instance)||null==(t=t.config)?void 0:t.logs;if(!this.wc||this.Mc!==e){var i;null==(i=this.wc)||i.reset(),this.Mc=e;var r=this.Sc((()=>this.Za),(t=>{this.Za=t}));this.wc=r[0],this.Ec=r[1]}return this.wc}Ic(){var t,e=null==(t=this._instance)||null==(t=t.config)?void 0:t.logs;if(!this.kc||this.Rc!==e){var i;null==(i=this.kc)||i.reset(),this.Rc=e;var r=this.Sc((()=>this.fc),(t=>{this.fc=t}),{serviceNameDefault:"posthog-browser-logs",consoleCapture:!0},uS);this.kc=r[0],this.Pc=r[1]}return this.kc}setup(t){var e;if(!this.Rs){this.Os=t,null!=(e=this._instance)&&null!=(e=e.config)&&null!=(e=e.logs)&&e.captureConsoleLogs&&(this.hc=!0),(this.hc||this.Ac()&&this.Fc())&&this.Oc();var i=!1,r=t.onRemoteConfig((t=>{var e;i=t.ok&&!0===(null==(e=t.config.logs)?void 0:e.captureConsoleLogs),this.onRemoteConfig(t)}));this.Rs?r.dispose():(this.Ls=r,i||this.loadIfEnabled())}}dispose(){var e,i,r,n;this.Rs||(this.Rs=!0,this.Lc(),null==(e=this.Ls)||e.dispose(),this.Ls=void 0,this.Os=void 0,this.vc=!1,null==t||t.removeEventListener("online",this._c),null==(i=this.Dc)||i.call(this),this.Dc=void 0,null==(r=this.wc)||r.reset(),null==(n=this.kc)||n.reset())}onRemoteConfig(t){var e,i;if(!this.Rs){var r=t.ok?null==(e=t.config.logs)?void 0:e.captureConsoleLogs:void 0;et(r)?this.$c():(null==(i=this._instance)||null==(i=i.persistence)||i.register({[En]:!!r}),r?(this.hc=!0,this.dc||this.Oc(),this.loadIfEnabled()):this.$c())}}reset(){var t,e,i,r;this.Lc(),null==(t=this.wc)||t.clearQueue(),this.Za=[],null==(e=this.wc)||e.reset(),null==(i=this.kc)||i.clearQueue(),this.fc=[],null==(r=this.kc)||r.reset(),this.Hh=0}captureLog(t){this.Rs||this.Tc().captureLog(t)}captureConsoleLog(t){this.Rs||this.Ic().captureLog(t)}captureBufferedConsoleLog(t,e,i){this.Rs||this.Ic().captureLog(t,{context:e,occurredAtMs:i})}Fc(){var t;return!(null==(t=this._instance)||null==(t=t.persistence)||null==(t=t.props)||!t[En])}Ac(){var t,e;return null==(t=this._instance)||null==t.Ua||!t.Ua()||!(null==(e=v._POSTHOG_REMOTE_CONFIG)||null==(e=e[this._instance.config.token])||!e.config)}Yl(){var t;this.Lc(),null==(t=this.kc)||t.clearQueue(),this.fc=[]}$c(){this.hc||this.Lc()}Oc(){var t,e=this;if(!this.yc&&null!=v&&v.console){var i=oS(null==(t=this._instance)||null==(t=t.config)?void 0:t.logs).maxBufferSize,r=function(t){var r;try{r=Zg(v.console[t])}catch(t){return 0}if(!r)return 0;e.mc.push(Dv(v.console,t,(n=>{var s=function(){for(var r=arguments.length,s=new Array(r),a=0;r>a;a++)s[a]=arguments[a];try{e.Nc(t,s,i)}catch(t){}return n.apply(v.console,s)};return s.__rrweb_original__=r,s})))};for(var n of lS)r(n);this.yc=!0,this.qc=setTimeout((()=>{this.Lc()}),3e4)}}Nc(t,e,i){var r;if(this.yc&&!this.bc&&0!==e.length)if(null!=(r=this._instance)&&r.is_capturing()){if(i>this.gc.length){this.bc=!0;try{this.gc.push({level:t,args:e,occurredAtMs:Date.now(),context:this.Cc()})}finally{this.bc=!1}}}else this.Lc()}Lc(){if(this.gc=[],this.yc){for(var t of(this.yc=!1,this.qc&&(clearTimeout(this.qc),this.qc=void 0),this.mc))t();this.mc=[]}}jc(){var t=this.gc;return this.Lc(),t}get logger(){return this.Bc||(this.Bc={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.Bc}flushLogs(t){t?this.Hc(t):(this.wc&&this.wc.flush().catch((t=>this.zc(t))),this.kc&&this.kc.flush().catch((t=>this.zc(t))))}zc(t){vS(t)||this.I.error("PostHog logs flush failed:",t)}loadIfEnabled(){if(!this.Rs&&this.hc&&!this.dc&&!this.vc){var t=null==v?void 0:v.__PosthogExtensions__;if(!t)return this.I.error("PostHog Extensions not found."),void this.Lc();var e=t.loadExternalDependency;if(!e)return this.I.error(Os),void this.Lc();this.vc=!0;try{e(this._instance,"logs",(e=>{if(this.vc=!1,!this.Rs&&this.hc){var i=t.logs;if(e||null==i||!i.initializeLogs)this.I.error("Could not load logs script",e),this.Lc();else{var r,n,s=this.jc();this.Dc=i.initializeLogs(null!==(r=this.Os)&&void 0!==r?r:this._instance),this.dc=!0,s.length>0&&(null==i.replayConsoleBuffer||i.replayConsoleBuffer(null!==(n=this.Os)&&void 0!==n?n:this._instance,s))}}}))}catch(t){throw this.vc=!1,t}}}xc(t,e){var i=this._instance;return{get isDisabled(){return!1},get optedOut(){return!i.is_capturing()},getPersistedProperty:e=>e===S.LogsQueue?t():void 0,setPersistedProperty(t,i){var r;t===S.LogsQueue&&e(null!==(r=i)&&void 0!==r?r:[])},es:t=>this.es(t),getLibraryId:()=>qi.LIB_NAME,getLibraryVersion:()=>qi.LIB_VERSION}}es(t){return new Promise((e=>{if(or(this.Hh,3))e({kind:"fatal",error:dS(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:dS(void 0,"logs request timed out")})}),9e4);this._instance._send_request({method:"POST",url:this.Uc(),data:t,compression:"best-available",batchKey:"logs",fireCallbackOnDrop:!0,callback:t=>{var e=t.statusCode;if(this.Wc(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:dS(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)})}}})}}))}Wc(t){(0!==t||this._instance.__loaded)&&(this.Hh=lr(t,this.Hh,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."))))}Hc(t){this.Za.length>0&&this.Vc(t,this.Za,this.Ec,qi.LIB_NAME,(t=>{this.Za=t})),this.fc.length>0&&this.Vc(t,this.fc,this.Pc,uS,(t=>{this.fc=t}))}Vc(t,e,i,r,n){if(0!==e.length){var s=e.map((t=>t.record));n([]);var a=Ke(s,Je(i,qi.LIB_NAME,qi.LIB_VERSION),r,qi.LIB_VERSION);this._instance._send_request({method:"POST",url:this.Uc(),data:a,compression:"best-available",batchKey:"logs",transport:t})}}Uc(){return this._instance.requestRouter.endpointFor("api","/i/v1/logs")+"?token="+encodeURIComponent(this._instance.config.token)}Cc(){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,et(n)||(e.sessionStartTimestamp=n),et(s)||(e.lastActivityTimestamp=s)}if(null!=v&&null!=(t=v.location)&&t.href&&(e.currentUrl=this._instance.config.disable_capture_url_hashes?Te(v.location.href):v.location.href),this._instance.featureFlags){var a=this._instance.featureFlags.getFlags();a&&a.length>0&&(e.activeFeatureFlags=a)}return e}}},CS={metrics:class{constructor(t){this.I=Hi("[metrics]"),this._instance=t}initialize(){}Tc(){var t,e,i=null==(t=this._instance)||null==(t=t.config)?void 0:t.metrics;return this.wc&&this.Mc===i||(null==(e=this.wc)||e.reset(),this.Mc=i,this.wc=new ii(this.xc(),function(t){var e,i,r,n,s,a=null==t?void 0:t.resourceAttributes;return{serviceName:null!==(e=null==a?void 0:a["service.name"])&&void 0!==e?e:null==t?void 0:t.serviceName,serviceVersion:null!==(i=null==a?void 0:a["service.version"])&&void 0!==i?i:null==t?void 0:t.serviceVersion,environment:null!==(r=null==a?void 0:a["deployment.environment"])&&void 0!==r?r:null==t?void 0:t.environment,resourceAttributes:a,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.wc}count(t,e,i){void 0===e&&(e=1),this.Tc().count(t,e,i)}gauge(t,e,i){this.Tc().gauge(t,e,i)}histogram(t,e,i){this.Tc().histogram(t,e,i)}flush(t){if(!this.wc)return Promise.resolve();if(t){var e=this.wc.drainWindow();return e&&this._s(e,t),Promise.resolve()}return this.wc.flush().catch((t=>this.I.error("PostHog metrics flush failed:",t)))}reset(){var t;null==(t=this.wc)||t.reset()}xc(){var t=this._instance,e=this;return{get isDisabled(){return!1},get optedOut(){return!t.is_capturing()},_s:t=>e._s(t),getLibraryId:()=>qi.LIB_NAME,getLibraryVersion:()=>qi.LIB_VERSION}}_s(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.Gc(),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)})}}}))}))}Gc(){return this._instance.requestRouter.endpointFor("api","/i/v1/metrics")+"?token="+encodeURIComponent(this._instance.config.token)}}},TS=p({},cS,fS,pS,gS,mS,yS,_S,bS,wS,kS,SS,xS,CS);mk.__defaultExtensionClasses=p({},TS),function(){qi.SDK_DIST_CHANNEL="cdn";var e=v.posthog;if(!e||G(e._i)){var i=ik[hk]=new mk;if(e){var n=[];Ui(e._i,(function(t){if(t&&G(t)){var r=i.init(t[0],t[1],t[2]),s=e[t[2]]||e;r.__loaded&&-1===n.indexOf(s)&&(n.push(s),r._execute_array.call(r.people,s.people),r._execute_array(s))}}))}i.__SV=1,v.posthog=i,function(){function e(){e.done||(e.done=!0,dk=!1,Ui(ik,(function(t){t._dom_loaded()})))}null!=r&&r.addEventListener?"complete"===r.readyState?e():Yi(r,"DOMContentLoaded",e,{capture:!1}):t&&Bi.error("Browser doesn't support `document.addEventListener` so PostHog couldn't be initialized")}()}}()}();
2
2
  //# sourceMappingURL=array.full.js.map