posthog-js 1.428.1 → 1.428.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (49) 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.js.map +1 -1
  11. package/dist/array.no-external.js +1 -1
  12. package/dist/array.no-external.js.map +1 -1
  13. package/dist/conversations.js.map +1 -1
  14. package/dist/customizations.full.js +1 -1
  15. package/dist/customizations.full.js.map +1 -1
  16. package/dist/customizations.js +1 -1
  17. package/dist/customizations.js.map +1 -1
  18. package/dist/dead-clicks-autocapture.js.map +1 -1
  19. package/dist/default-extensions.js +1 -1
  20. package/dist/default-extensions.js.map +1 -1
  21. package/dist/extension-bundles.js +1 -1
  22. package/dist/extension-bundles.js.map +1 -1
  23. package/dist/lazy-recorder.js +1 -1
  24. package/dist/lazy-recorder.js.map +1 -1
  25. package/dist/main.js +1 -1
  26. package/dist/main.js.map +1 -1
  27. package/dist/module.full.js +1 -1
  28. package/dist/module.full.js.map +1 -1
  29. package/dist/module.full.no-external.js +1 -1
  30. package/dist/module.full.no-external.js.map +1 -1
  31. package/dist/module.js +1 -1
  32. package/dist/module.js.map +1 -1
  33. package/dist/module.mjs +1 -1
  34. package/dist/module.mjs.map +1 -1
  35. package/dist/module.no-external.js +1 -1
  36. package/dist/module.no-external.js.map +1 -1
  37. package/dist/module.slim.js +1 -1
  38. package/dist/module.slim.js.map +1 -1
  39. package/dist/module.slim.no-external.js +1 -1
  40. package/dist/module.slim.no-external.js.map +1 -1
  41. package/dist/posthog-recorder.js +1 -1
  42. package/dist/posthog-recorder.js.map +1 -1
  43. package/dist/product-tours.js.map +1 -1
  44. package/dist/recorder-v2.js.map +1 -1
  45. package/dist/recorder.js.map +1 -1
  46. package/dist/surveys-preview.js.map +1 -1
  47. package/dist/surveys.js.map +1 -1
  48. package/lib/package.json +1 -1
  49. package/package.json +5 -5
@@ -1,2 +1,2 @@
1
- !function(){var t=["type"],e=["retriesPerformedSoFar"],i=["$set_once","$set"];function r(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}function n(){return n=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},n.apply(null,arguments)}function s(t,e,i,r,n,s,o){try{var a=t[s](o),l=a.value}catch(t){return void i(t)}a.done?e(l):Promise.resolve(l).then(r,n)}function o(t){return function(){var e=this,i=arguments;return new Promise(function(r,n){var o=t.apply(e,i);function a(t){s(o,r,n,a,l,"next",t)}function l(t){s(o,r,n,a,l,"throw",t)}a(void 0)})}}!function(s){var a="u">typeof window?window:void 0,l="u">typeof globalThis?globalThis:a,u=null==l?void 0:l.navigator,h=null==l?void 0:l.document,d=null==l?void 0:l.location,v=null==l?void 0:l.fetch,c=null!=l&&l.XMLHttpRequest&&"withCredentials"in new l.XMLHttpRequest?l.XMLHttpRequest:void 0,f=null==l?void 0:l.AbortController,p=null==l?void 0:l.CompressionStream,g=null==u?void 0:u.userAgent;function m(){return!(!a||!1===a.navigator.onLine)}var y="undefined"!=typeof globalThis?globalThis:a;y&&"undefined"==typeof self&&(y.self=y),y&&"undefined"==typeof File&&(y.File=function(){});var b=null!=a?a:{},_="$people_distinct_id",w="distinct_id",k="$device_id",S="$device_model",x="__alias",C="__cmpns",T="$fbc",M="$fbc_persistence",I="__timers",E="$autocapture_disabled_server_side",R="$heatmaps_enabled_server_side",A="$exception_capture_enabled_server_side",P="$error_tracking_suppression_rules",F="$error_tracking_capture_extension_exceptions",O="$web_vitals_enabled_server_side",D="$dead_clicks_enabled_server_side",L="$product_tours_enabled_server_side",N="$logs_capture_enabled_server_side",q="$web_vitals_allowed_metrics",j="$session_recording_remote_config",B="$session_recording_enabled_server_side",H="$replay_sample_rate",z="$replay_override_sampling",U="$replay_override_linked_flag",W="$replay_override_url_trigger",V="$replay_override_event_trigger",G="$sesid",Z="$session_is_sampled",J="$session_past_minimum_duration",Q="$session_recording_url_trigger_activated_session",K="$session_recording_event_trigger_activated_session",X="$posthog_sr_group_event_trigger_",Y="$posthog_sr_group_url_trigger_",tt="$posthog_sr_group_sampling_",et="$debug_first_full_snapshot_timestamp",it="$sess_rec_flush_size",rt="$enabled_feature_flags",nt="$active_feature_flags",st="$early_access_features",ot="$feature_flag_details",at="$feature_flag_payloads",lt="$feature_flag_request_id",ut="$minimal_flag_called_events",ht="$override_feature_flags",dt="$override_feature_flag_payloads",vt="$stored_person_properties",ct="$stored_group_properties",ft="$groups",pt="$surveys",gt="$surveys_loaded_at",mt="$surveys_activated",yt="$surveys_activated_session",bt="$surveys_activated_timestamps",_t="ph_product_tours",wt="$product_tours_activated",kt="$product_tours_activated_session",St="$conversations_widget_session_id",xt="$conversations_ticket_id",Ct="$conversations_widget_state",Tt="$conversations_user_traits",Mt="$flag_call_reported",It="$flag_call_reported_session_id",Et="$feature_flag_errors",Rt="$feature_flag_evaluated_at",At="$user_state",Pt="$client_session_props",Ft="$capture_rate_limit",Ot="$initial_campaign_params",$t="$initial_referrer_info",Dt="$initial_person_info",Lt="$epp",Nt="$posthog_cookieless",qt="$cookieless_mode",jt="$sdk_debug_extensions_init_method",Bt="$sdk_debug_extensions_init_time_ms",Ht="$sdk_debug_recording_script_not_loaded",zt="$sdk_debug_replay_event_trigger_status",Ut="$sdk_debug_replay_linked_flag_trigger_status",Wt="$sdk_debug_replay_matched_recording_trigger_groups",Vt="$sdk_debug_replay_pending_trigger_conditions",Gt="$sdk_debug_replay_remote_trigger_matching_config",Zt="$sdk_debug_replay_trigger_groups_count",Jt="$sdk_debug_replay_url_trigger_status",Qt="$sdk_debug_rrweb_attached",Kt="$sdk_debug_rrweb_start_attempted",Xt="$session_recording_start_reason",Yt="PostHog loadExternalDependency extension not found.",te="anonymous",ee="identified",ie="identified_only",re="visibilitychange",ne="beforeunload",se="$pageview",oe="$pageleave",ae="$identify",le="$groupidentify",ue=["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"],he=function(t,e){if(void 0===e&&(e=[]),!t)return!1;var i=t.toLowerCase();return ue.concat(e).some(t=>{var e=t.toLowerCase();return-1!==i.indexOf(e)})};function de(t,e){return-1!==t.indexOf(e)}var ve=function(t){return t.trim()},ce=function(t){return t.replace(/^\$/,"")};function fe(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 pe=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}({}),ge=function(t){return t.GZipJS="gzip-js",t.Base64="base64",t}({}),me="min_length",ye="max_length",be=["$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"],we=Object.prototype,ke=we.hasOwnProperty,Se=we.toString,xe=Array.isArray||function(t){return"[object Array]"===Se.call(t)},Ce=t=>"function"==typeof t,Te=t=>t===Object(t)&&!xe(t),Me=t=>{if(Te(t)){for(var e in t)if(ke.call(t,e))return!1;return!0}return!1},Ie=t=>void 0===t,Ee=t=>"[object String]"==Se.call(t),Re=t=>Ee(t)&&0===t.trim().length,Ae=t=>null===t,Pe=t=>Ie(t)||Ae(t),Fe=t=>"[object Number]"==Se.call(t)&&t==t,Oe=t=>Fe(t)&&t>0,$e=t=>"[object Boolean]"===Se.call(t),De=t=>t instanceof FormData,Le=t=>de(be,t),Ne=t=>de(_e,t);function qe(t){return null===t||"object"!=typeof t}function je(t,e){return{}.toString.call(t)==="[object "+e+"]"}function Be(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 ze(t,Error)}}function He(t){return"u">typeof Event&&ze(t,Event)}function ze(t,e){try{return t instanceof e}catch(t){return!1}}var Ue=[!0,"true",1,"1","yes"],We=t=>de(Ue,t),Ve=[!1,"false",0,"0","no"];function Ge(t,e,i,r,n){return e>i&&(r.warn("min cannot be greater than max."),e=i),Fe(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),Ge(null!=n?n:i,e,i,r))}var Ze=class{constructor(t){this.C={},this.I=t.I,this.R=Ge(t.bucketSize,0,100,t.A),this.O=Ge(t.refillRate,0,this.R,t.A),this.F=Ge(t.refillInterval,0,864e5,t.A)}N(t,e){var i=Math.floor((e-t.lastAccess)/this.F);i>0&&(t.tokens=Math.min(t.tokens+i*this.O,this.R),t.lastAccess=t.lastAccess+i*this.F)}consumeRateLimit(t){var e,i=Date.now(),r=String(t),n=this.C[r];return n?this.N(n,i):this.C[r]=n={tokens:this.R,lastAccess:i},0===n.tokens||(n.tokens--,0===n.tokens&&(null==(e=this.I)||e.call(this,t)),0===n.tokens)}stop(){this.C={}}},Je="Mobile",Qe="Android",Ke="Tablet",Xe="Android Tablet",Ye="iPad",ti="Apple Watch",ei="Safari",ii="BlackBerry",ri="Samsung Internet",ni="Chrome",si="Chrome iOS",oi="Internet Explorer",ai="Internet Explorer Mobile",li="Opera",ui="Microsoft Edge",hi="Firefox",di="Firefox iOS",vi="Nintendo",ci="PlayStation",fi="Xbox",pi="Android Mobile",gi="Mobile Safari",mi="Windows",yi="Windows Phone",bi="Nokia",_i="Ouya",wi="Generic "+Je.toLowerCase(),ki="Generic "+Ke.toLowerCase(),Si="Konqueror",xi="Oculus Browser",Ci="Vivaldi",Ti="Yandex",Mi="Whale",Ii="DuckDuckGo",Ei="Pale Moon",Ri="Waterfox",Ai="Brave",Pi="Claude",Fi="Codex",Oi="ChatGPT",$i="Google Search App",Di=new RegExp("Version/(\\d+(\\.\\d+)?)"),Li=new RegExp("(Claude|Codex|ChatGPT)\\/(\\d+(\\.\\d+)?)"),Ni=new RegExp(fi,"i"),qi=new RegExp("PlayStation \\w+","i"),ji=new RegExp("Nintendo \\w+","i"),Bi=new RegExp("BlackBerry|PlayBook|BB10","i"),Hi={"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"},zi=function(t,e,i,r){e=e||"";var n=function(t){return null!=t&&t.brave?Ai:null}(i);return n||(null!=r&&r.detectGoogleSearchApp&&de(t,"GSA/")?$i:de(t," OPR/")&&de(t,"Mini")?"Opera Mini":de(t," OPR/")?li:Bi.test(t)?ii:de(t,"IEMobile")||de(t,"WPDesktop")?ai:de(t,"OculusBrowser")?xi:de(t,"SamsungBrowser")?ri:de(t,"Edge")||de(t,"Edg/")?ui:de(t,"Vivaldi/")?Ci:de(t,"YaBrowser/")?Ti:de(t,"Whale/")?Mi:de(t,"DuckDuckGo/")||de(t,"Ddg/")?Ii:de(t,"Claude/")?Pi:de(t,"Codex/")?Fi:de(t,"ChatGPT/")?Oi:de(t,"FBIOS")?"Facebook Mobile":de(t,"UCWEB")||de(t,"UCBrowser")?"UC Browser":de(t,"CriOS")?si:de(t,"CrMo")||de(t,ni)?ni:de(t,Qe)&&de(t,ei)?pi:de(t,"FxiOS")?di:de(t.toLowerCase(),Si.toLowerCase())?Si:de(t,"Brave/")?Ai:((t,e)=>e&&de(e,"Apple")||function(t){return de(t,ei)&&!de(t,ni)&&!de(t,Qe)}(t))(t,e)?de(t,Je)?gi:ei:de(t,"PaleMoon/")?Ei:de(t,"Waterfox/")?Ri:de(t,hi)?hi:de(t,"MSIE")||de(t,"Trident/")?oi:de(t,"Gecko")?hi:"")},Ui={[ai]:[new RegExp("rv:(\\d+(\\.\\d+)?)")],[ui]:[new RegExp("Edge?\\/(\\d+(\\.\\d+)?)")],[ni]:[new RegExp("(Chrome|CrMo)\\/(\\d+(\\.\\d+)?)")],[si]:[new RegExp("CriOS\\/(\\d+(\\.\\d+)?)")],"UC Browser":[new RegExp("(UCBrowser|UCWEB)\\/(\\d+(\\.\\d+)?)")],[ei]:[Di],[gi]:[Di],[li]:[new RegExp("(Opera|OPR)\\/(\\d+(\\.\\d+)?)")],[hi]:[new RegExp("Firefox\\/(\\d+(\\.\\d+)?)")],[di]:[new RegExp("FxiOS\\/(\\d+(\\.\\d+)?)")],[Si]:[new RegExp("Konqueror[:/]?(\\d+(\\.\\d+)?)","i")],[ii]:[new RegExp("BlackBerry (\\d+(\\.\\d+)?)"),Di],[pi]:[new RegExp("android\\s(\\d+(\\.\\d+)?)","i")],[ri]:[new RegExp("SamsungBrowser\\/(\\d+(\\.\\d+)?)")],[xi]:[new RegExp("OculusBrowser\\/(\\d+(\\.\\d+)?)")],[Ci]:[new RegExp("Vivaldi\\/(\\d+(\\.\\d+)?)")],[Ti]:[new RegExp("YaBrowser\\/(\\d+(\\.\\d+)?)")],[Mi]:[new RegExp("Whale\\/(\\d+(\\.\\d+)?)")],[Ai]:[new RegExp("Brave\\/(\\d+(\\.\\d+)?)")],[Pi]:[Li],[Fi]:[Li],[Oi]:[Li],[Ii]:[new RegExp("(DuckDuckGo|Ddg)\\/(\\d+(\\.\\d+)?)")],[Ei]:[new RegExp("PaleMoon\\/(\\d+(\\.\\d+)?)")],[Ri]:[new RegExp("Waterfox\\/(\\d+(\\.\\d+)?)")],[$i]:[new RegExp("GSA\\/(\\d+(\\.\\d+)?)")],[oi]:[new RegExp("(rv:|MSIE )(\\d+(\\.\\d+)?)")],Mozilla:[new RegExp("rv:(\\d+(\\.\\d+)?)")]},Wi=function(t,e,i,r){var n=Ui[zi(t,e,i,r)];if(Ie(n))return null;for(var s=0;n.length>s;s++){var o=t.match(n[s]);if(o)return parseFloat(o[o.length-2])}return null},Vi=[[new RegExp("Xbox; Xbox (.*?)[);]","i"),t=>[fi,t&&t[1]||""]],[new RegExp(vi,"i"),[vi,""]],[new RegExp(ci,"i"),[ci,""]],[Bi,[ii,""]],[new RegExp(mi,"i"),(t,e)=>{if(/Phone/.test(e)||/WPDesktop/.test(e))return[yi,""];if(new RegExp(Je).test(e)&&!/IEMobile\b/.test(e))return["Windows Mobile",""];var i=/Windows NT ([0-9.]+)/i.exec(e);if(i&&i[1]){var r=Hi[i[1]]||"";return/arm/i.test(e)&&(r="RT"),[mi,r]}return[mi,""]}],[/((iPhone|iPad|iPod).*?OS (\d+)_(\d+)_?(\d+)?|iPhone)/,t=>t&&t[3]?["iOS",[t[3],t[4],t[5]||"0"].join(".")]:["iOS",""]],[/(watch.*\/(\d+\.\d+\.\d+)|watch os,(\d+\.\d+),)/i,t=>{var e="";return t&&t.length>=3&&(e=Ie(t[2])?t[3]:t[2]),["watchOS",e]}],[new RegExp("(Android (\\d+)\\.(\\d+)\\.?(\\d+)?|Android)","i"),t=>t&&t[2]?[Qe,[t[2],t[3],t[4]||"0"].join(".")]:[Qe,""]],[/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/,["Chrome OS",""]],[/Linux|debian/i,["Linux",""]]],Gi=function(t){for(var e=0;Vi.length>e;e++){var i=Vi[e],r=i[1],n=i[0].exec(t),s=n&&(Ce(r)?r(n,t):r);if(s)return s}return["",""]},Zi=function(t){return ji.test(t)?vi:qi.test(t)?ci:Ni.test(t)?fi:new RegExp(_i,"i").test(t)?_i:new RegExp("(Windows Phone|WPDesktop)","i").test(t)?yi:/iPad/.test(t)?Ye:/iPod/.test(t)?"iPod Touch":/iPhone/.test(t)?"iPhone":/(watch)(?: ?os[,/]|\d,\d\/)[\d.]+/i.test(t)?ti:Bi.test(t)?ii:/(kobo)\s(ereader|touch)/i.test(t)?"Kobo":new RegExp(bi,"i").test(t)?bi:/(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(Je).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)?Qe:Xe:new RegExp("(pda|Mobile)","i").test(t)?wi:new RegExp(Ke,"i").test(t)&&!new RegExp("Tablet pc","i").test(t)?ki:""},Ji=function(t,e){var i,r,n,s,o=Zi(t);return o===Ye||o===Xe||"Kobo"===o||"Kindle Fire"===o||o===ki?Ke:o===vi||o===fi||o===ci||o===_i?"Console":o===ti?"Wearable":o?Je:"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)?Je:Ke:"Desktop"},Qi=/\bFBAV\/(\d+(?:\.\d+)*)/i,Ki=[[/\bInstagram(?:[ /](\d+(?:\.\d+)*))?\b/i,"Instagram"],[/\bBarcelona[ /](\d+(?:\.\d+)*)?/i,"Threads"],[/\b(?:MessengerForiOS|(?:FBAN|FB_IAB)\/Orca-Android)\b/i,"Messenger",Qi],[/\bFBAN\/EMA\b/i,"Facebook Lite",Qi],[/\b(?:FBIOS|(?:FBAN|FB_IAB)\/(?:FB4A|FBIOS))\b/i,"Facebook",Qi],[/\bLinkedInApp(?:\]?\/(\d+(?:\.\d+)*))?\b/i,"LinkedIn"],[/\bTwitter(?:Android| for (?:iPhone|iPad|Android))(?:\/(\d+(?:\.\d+)*))?\b/i,"Twitter"],[/\b(?:musical_ly|trill)(?:[_/](\d+\.\d+(?:\.\d+)*))?(?=\b|_)/i,"TikTok",/\bapp_version\/(\d+(?:\.\d+)*)/i],[/\b(?:MicroMessenger|WeChat)\/(\d+(?:\.\d+)*)?/i,"WeChat"],[/\bLine\/(\d+(?:\.\d+)*)?/i,"Line"],[/\bGSA\/(\d+(?:\.\d+)*)?/i,"Google"],[/\[Pinterest\/(?:iOS|Android)\b|\bPinterest(?: for (?:Android(?: Tablet)?|iOS))?\/(\d+(?:\.\d+)*)/i,"Pinterest"],[/\b(?:WA4A|WAiOS)\/(\d+(?:\.\d+)*)?/i,"WhatsApp"],[/\bSnapchat[ /](\d+(?:\.\d+)*)?/i,"Snapchat"],[/\bBing(?:Web|Sapphire)\/(\d+(?:\.\d+)*)?/i,"Bing"],[/\bNAVER\(inapp; search;/i,"Naver",/\bNAVER\(inapp; search;[^;)]*; (\d+(?:\.\d+)*)/i],[/\bKAKAOTALK[ /](\d+\.\d+(?:\.\d+)*)?/i,"KakaoTalk"]],Xi="[Truncated]",Yi="[Unserializable]";function tr(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}Date,Date;var er,ir,rr,nr=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;function sr(t,e){return"string"==typeof(i=t)&&nr.test(i)?t:e();var i}function or(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 ar(t){return t?t.split("#")[0]:t}function lr(t,e){var i=setTimeout(t,e);return null!=i&&i.unref&&(null==i||i.unref()),i}function ur(t,e,i){return hr.apply(this,arguments)}function hr(){return(hr=o(function*(t,e,i){var r;try{return yield Promise.race([t,new Promise((t,n)=>{r=lr(()=>{try{null==i||i(),t()}catch(t){n(t)}},e)})])}finally{clearTimeout(r)}})).apply(this,arguments)}function dr(t){var e=globalThis._posthogChunkIds;if(e){var i=Object.keys(e);return rr&&i.length===ir?rr:(ir=i.length,rr=i.reduce((i,r)=>{er||(er={});var n=er[r];if(n)i[n[0]]=n[1];else for(var s=t(r),o=s.length-1;o>=0;o--){var a,l=null==(a=s[o])?void 0:a.filename,u=e[r];if(l&&u){i[l]=u,er[r]=[l,u];break}}return i},{}))}}var vr=class{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 o(function*(){for(var i of t)i.stacktrace&&i.stacktrace.frames&&xe(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)),n({},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 o(function*(){var i=t;for(var r of e.modifiers)i=yield r(i);return i})()}convertToExceptionList(t,e){var i,r,s,o={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!==(s=t.synthetic)&&void 0!==s&&s}};t.stack&&(o.stacktrace={type:"raw",frames:t.stack});var a=[o];return null!=t.cause&&a.push(...this.convertToExceptionList(t.cause,n({},e,{handled:!0}))),a}buildParsingContext(t){var e;return{chunkIdMap:dr(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 n({},e,{syntheticException:0==i?e.syntheticException:void 0,mechanism:t,apply:t=>r(t,i),next:t=>r(t,i+1)})}};function cr(t,e,i,r,n){var s={platform:t,filename:e,function:"<anonymous>"===i?"?":i,in_app:!!e&&!e.startsWith("webkit-masked-url://")&&"<anonymous>"!==e};return Ie(r)||(s.lineno=r),Ie(n)||(s.colno=n),s}var fr=(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]:"?",i?"safari-extension:"+e:"safari-web-extension:"+e]:[t,e]},pr=/^\s*at (\S+?)(?::(\d+))(?::(\d+))\s*$/i,gr=/^\s*at (?:(.+?\)(?: \[.+\])?|.*?) ?\((?:address at )?)?(?:async )?((?:<anonymous>|[-a-z]+:|.*bundle|\/)?.*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i,mr=/\((\S*)(?::(\d+))(?::(\d+))\)/,yr=(t,e)=>{var i=pr.exec(t);if(i)return cr(e,i[1],"?",+i[2],+i[3]);var r=gr.exec(t);if(r){if(r[2]&&0===r[2].indexOf("eval")){var n=mr.exec(r[2]);n&&(r[2]=n[1],r[3]=n[2],r[4]=n[3])}var s=fr(r[1]||"?",r[2]);return cr(e,s[1],s[0],r[3]?+r[3]:void 0,r[4]?+r[4]:void 0)}},br=/^\s*(.*?)(?:\((.*?)\))?(?:^|@)?((?:[-a-z]+)?:\/.*?|\[native code\]|[^@]*(?:bundle|\d+\.js)|\/[\w\-. /=]+)(?::(\d+))?(?::(\d+))?\s*$/i,_r=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i,wr=(t,e)=>{var i=br.exec(t);if(i){if(i[3]&&i[3].indexOf(" > eval")>-1){var r=_r.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]||"?",o=fr(s,n);return cr(e,n=o[1],s=o[0],i[4]?+i[4]:void 0,i[5]?+i[5]:void 0)}},kr=/\(error: (.*)\)/;var Sr=class{match(t){return this.isDOMException(t)||this.isDOMError(t)}coerce(t,e){var i=Ee(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 je(t,"DOMException")}isDOMError(t){return je(t,"DOMError")}},xr=class{match(t){return Be(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}},Cr=class{match(t){return!!je(t,"ErrorEvent")&&(null!=t.error||this.Ki(t))}coerce(t,e){var i;if(null!=t.error)return e.apply(t.error);var r=e.apply(t.message);return n({},r,{stack:null!==(i=this.Xi(t))&&void 0!==i?i:r.stack,synthetic:!0})}Ki(t){return Ee(t.message)&&t.message.length>0}Xi(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(Ee(r.filename)&&0!==r.filename.length&&0!==n)return"Error\n at "+r.filename+":"+n+":"+s}},Tr=/^(?:[Uu]ncaught (?:exception: )?)?(?:((?:Eval|Internal|Range|Reference|Syntax|Type|URI|)Error): )?(.*)$/i,Mr=class{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(Tr);return r&&(e=r[1],i=r[2]),[e,i]}},Ir=["fatal","error","warning","log","info","debug"];function Er(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""}var Rr=class{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(He(t))return t.constructor.name;var e="name"in t?t.name:void 0;return Ee(e)&&!Re(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: "+Er(t)}isSeverityLevel(t){return Ee(t)&&!Re(t)&&Ir.indexOf(t)>=0}getStack(t){try{return Ee(t.stacktrace)&&t.stacktrace.length>0?t.stacktrace:Ee(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(Be(i))return i}}getObjectClassName(t){try{var e=Object.getPrototypeOf(t);return e?e.constructor.name:void 0}catch(t){return}}},Ar=class{match(t){return He(t)}coerce(t,e){var i,r=t.constructor.name;return{type:r,value:r+" captured as exception with keys: "+Er(t),stack:null==(i=e.syntheticException)?void 0:i.stack,synthetic:!0}}},Pr=class{match(t){return qe(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}}},Fr=class{match(t){return je(t,"PromiseRejectionEvent")||this.isCustomEventWrappingRejection(t)}isCustomEventWrappingRejection(t){if(!He(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 qe(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}},Or="$message",$r="$timestamp",Dr=new Set([Or,$r]),Lr={enabled:!0,max_bytes:32768};function Nr(t){var e;return t?{enabled:null!==(e=t.enabled)&&void 0!==e?e:Lr.enabled,max_bytes:jr(t.max_bytes,Lr.max_bytes)}:n({},Lr)}var qr=class{constructor(t){this.$n=[],this.Bn=0,this._n=Nr(t)}setConfig(t){this._n=Nr(t),this.Hn()}add(t){var e=function(t){var e;try{e=fe(t)}catch(t){return}try{var i=JSON.parse(e);if(!Te(i))return;var r=i,n=r[Or],s=r[$r];if(!Ee(n)||0===n.trim().length)return;if(!Ee(s)&&!Fe(s))return;return{step:r,json:e}}catch(t){return}}(t);if(e){var i=function(t){if("u">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._n.max_bytes||(this.$n.push({step:e.step,bytes:i}),this.Bn+=i,this.Hn())}}getAttachable(){return this.$n.map(t=>t.step)}clear(){this.$n=[],this.Bn=0}size(){return this.$n.length}Hn(){for(;this.Bn>this._n.max_bytes&&this.$n.length>0;){var t=this.$n.shift();t&&(this.Bn-=t.bytes)}}};function jr(t,e){if(!Fe(t)||1/0===t||-1/0===t)return e;var i=Math.floor(t);return 0>i?e:i}var Br=t=>{if("string"!=typeof t)return t;try{return JSON.parse(t)}catch(e){return t}};function Hr(t){return"string"==typeof t||t}function zr(t){return"string"==typeof t?t:void 0}var Ur,Wr=["$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"],Vr="NativeGzipValidationError",Gr=t=>t.length>=2&&31===t[0]&&139===t[1],Zr=(t,e)=>t===ge.GZipJS||e===ge.GZipJS||"gzip"===e,Jr=t=>!(!t||"object"!=typeof t)&&"NotReadableError"===("name"in t?String(t.name):""),Qr=t=>{if(!t||"object"!=typeof t)return!1;var e="name"in t?String(t.name):"";return Jr(t)||e===Vr},Kr=t=>{throw or(Vr,"Native gzip produced invalid output: "+t)},Xr=function(){var t=o(function*(t,e){18>t.size&&Kr("too-short");var i=new Uint8Array(yield t.slice(0,10).arrayBuffer());Gr(i)&&8===i[2]||Kr("invalid-header");var r=new DataView(yield t.slice(t.size-8).arrayBuffer());r.getUint32(0,!0)!==(t=>{for(var e=(()=>{if(Ur)return Ur;Ur=[];for(var t=0;256>t;t++){for(var e=t,i=0;8>i;i++)e=1&e?3988292384^e>>>1:e>>>1;Ur[t]=e>>>0}return Ur})(),i=4294967295,r=0;t.length>r;r++)i=e[255&(i^t[r])]^i>>>8;return(4294967295^i)>>>0})(e)&&Kr("invalid-crc");var n=e.length>>>0;r.getUint32(4,!0)!==n&&Kr("invalid-size")});return function(e,i){return t.apply(this,arguments)}}();function Yr(t,e,i){return tn.apply(this,arguments)}function tn(){return tn=o(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=o(function*(t){try{yield s.abort(t)}catch(t){}throw t});return function(e){return t.apply(this,arguments)}}()),l=new Response(n.readable).blob(),u=(yield Promise.all([l,a]))[0];return yield Xr(u,r),u}catch(t){if(null!=i&&i.rethrow)throw t;return e&&console.error("Failed to gzip compress data",t),null}}),tn.apply(this,arguments)}var en={}.propertyIsEnumerable;function rn(t,e){try{return on(t,e,{ancestors:new WeakSet,remainingNodes:1e4},0)}catch(t){return[]}}function nn(t,e,i,r){if(0>=i.remainingNodes)return{stringValue:Xi};if(i.remainingNodes--,$e(t))return{boolValue:t};if("bigint"==typeof t)return function(t,e){var i=t.toString(),r=BigInt("9223372036854775808");return t>=r||-r>t?(null==e||e.debug("Attribute "+i+" is outside the int64 range; encoding it as a string"),{stringValue:i}):{intValue:i}}(t,e);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(typeof BigInt>"u")return{stringValue:String(t)};var n=BigInt(t).toString();return t>=0x8000000000000000||-0x8000000000000000>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:tr(t)};if("function"==typeof t)return{stringValue:"[Function]"};if("symbol"==typeof t)return{stringValue:String(t)};if("object"==typeof t&&null!==t){if(i.ancestors.has(t))return{stringValue:"[Circular]"};if(r>=20)return{stringValue:Xi};if(t instanceof Date){var s=t.getTime(),o=Number.isFinite(s)?t.toISOString():String(t);return{stringValue:"string"==typeof o?tr(o):String(o)}}i.ancestors.add(t);try{try{var a=t.toJSON;if("function"==typeof a)return nn(a.call(t),e,i,r+1)}catch(t){}return xe(t)?{arrayValue:{values:sn(t,e,i,r+1)}}:{kvlistValue:{values:on(t,e,i,r+1)}}}finally{i.ancestors.delete(t)}}return{stringValue:tr(String(t))}}function sn(t,e,i,r){for(var n=[],s=Math.min(t.length,1e3),o=0;s>o&&i.remainingNodes>0;o++)try{var a=o in t?t[o]:void 0;if(Pe(a))continue;n.push(nn(a,e,i,r))}catch(t){n.push({stringValue:Yi})}return t.length>o&&n.push({stringValue:Xi}),n}function on(t,e,i,r){var n=[];for(var s in t)if(en.call(t,s)){if(!s){null==e||e.debug("Dropping an attribute with an empty key");continue}if(n.length>=1e3||0>=i.remainingNodes){null==e||e.debug("Attributes truncated: the value exceeds the OTLP encoder budget");break}try{var o=t[s];if(Ae(o)||Ie(o))continue;n.push({key:tr(s),value:nn(o,e,i,r)})}catch(t){n.push({key:tr(s),value:{stringValue:Yi}})}}return n}function an(t,e,i){return n({},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})}var ln={darwin:"macOS",win32:"Windows",linux:"Linux",android:"Android",freebsd:"FreeBSD",openbsd:"OpenBSD",sunos:"SunOS",aix:"AIX","Mac OS X":"macOS"};var un={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}},hn=un.info;function dn(t){try{return tr(String(t))}catch(t){return Yi}}function vn(t,e,i,r){var s,o=un[t.level||"info"]||hn,a=o.text,l=o.number,u=(void 0===(s=Fe(r)?r:void 0)&&(s=Date.now()),String(s)+"000000"),h={};e.distinctId&&(h.posthogDistinctId=e.distinctId),e.sessionId&&(h.sessionId=e.sessionId),e.windowId&&(h["window.id"]=e.windowId),Pe(e.sessionStartTimestamp)||(h.sessionStartTimestamp=String(e.sessionStartTimestamp)),Pe(e.lastActivityTimestamp)||(h.lastActivityTimestamp=String(e.lastActivityTimestamp)),e.currentUrl&&(h["url.full"]=e.currentUrl),e.screenName&&(h["screen.name"]=e.screenName),e.appState&&(h["app.state"]=e.appState),e.activeFeatureFlags&&e.activeFeatureFlags.length>0&&(h.feature_flags=e.activeFeatureFlags);var d=n({},h),v=t.attributes;if(v){var c=[];try{c=Object.keys(v)}catch(t){c=[]}for(var f of c){var p=void 0;try{p=v[f]}catch(t){p=Yi}Object.defineProperty(d,f,{value:p,enumerable:!0,writable:!0,configurable:!0})}}var g={timeUnixNano:u,observedTimeUnixNano:u,severityNumber:l,severityText:a,body:{stringValue:dn(t.body)},attributes:rn(d,i)};return t.trace_id&&(g.traceId=t.trace_id),t.span_id&&(g.spanId=t.span_id),Ie(t.trace_flags)||(g.flags=t.trace_flags),g}function cn(t,e,i){return an(t,e,i)}function fn(t,e,i,r){return{resourceLogs:[{resource:{attributes:rn(e)},scopeLogs:[{scope:{name:i,version:r},logRecords:t}]}]}}var pn=class{constructor(t,e,i,r,n,s,o){var a;void 0===s&&(s=()=>Promise.resolve()),this._instance=t,this._n=e,this.A=i,this.zn=r,this.Un=n,this.Wn=s,this.Vn=o,this.Gn=null,this.Zn=0,this.Jn=0,this.Qn=0,this.Kn=0,this.Xn=0,this.Yn=!1,this.ts=e.maxBufferSize,this.es=Math.max(null!==(a=e.maxQueueSize)&&void 0!==a?a:e.maxBufferSize,e.maxBufferSize),this.rs=e.flushIntervalMs,this.ns=e.maxBatchRecordsPerPost,this.ss=e.rateCapWindowMs,this.ls=e.maxLogsPerInterval}clearQueue(){this.Jn++,this._instance.setPersistedProperty(pe.LogsQueue,[])}reset(){this.us(),this.Kn=0,this.Xn=0,this.Yn=!1,this.Qn=0,this.ns=this._n.maxBatchRecordsPerPost}onReconnect(){this.Qn=0,this.hs()}captureLog(t,e){var i;if(!this._instance.isDisabled&&!this._instance.optedOut&&null!=t&&t.body){var r=this.ds(t);if(null!==r)if(r.body){if(this.vs()){var n={record:vn(r,null!==(i=null==e?void 0:e.context)&&void 0!==i?i:this.zn(),this.A,null==e?void 0:e.occurredAtMs)};this.Un(()=>this.cs(n))}}else this.A.info("Log was rejected in beforeSend function")}}ds(t){var e=this._n.beforeSend;if(!e)return t;var i=xe(e)?e:[e],r=t;for(var n of i)try{var s=n(r);if(!s)return this.A.info("Log was rejected in beforeSend function"),null;r=s}catch(t){return this.A.error("Error in beforeSend function for log:",t),null}return r}vs(){if(void 0===this.ls)return!0;var t=Date.now(),e=t-this.Kn;return this.ss>e&&e>=0||(this.Kn=t,this.Xn=0,this.Yn=!1),this.ls>this.Xn?(this.Xn++,!0):(this.Yn||(this.A.warn("captureLog dropping logs: exceeded "+this.ls+" logs per "+this.ss+"ms"),this.Yn=!0),!1)}flush(){var t=this;return o(function*(){if(!t._instance.isDisabled)return t.Gn||(t.Gn=t.fs().finally(()=>{t.Gn=null})),t.Gn})()}fs(){var t=this;return o(function*(){var e;t.us();var i=null!==(e=t._instance.getPersistedProperty(pe.LogsQueue))&&void 0!==e?e:[];if(0!==i.length)for(var r=i.length,n=0;i.length>0&&r>n;){var s,o,a=t.Jn;t.Zn=0;var l=Math.min(i.length,t.ns),u=i.slice(0,l),h=fn(u.map(t=>t.record),t.ps(),null!==(s=t.Vn)&&void 0!==s?s:t._instance.getLibraryId(),t._instance.getLibraryVersion()),d=yield t._instance.gs(h);if(t.Jn!==a)return;if("too-large"===d.kind&&u.length>1)t.ns=Math.max(1,Math.floor(u.length/2)),t.A.warn("Received 413 when sending logs batch of size "+u.length+", reducing batch size to "+t.ns);else{if("retry-later"===d.kind)throw d.error;if("too-large"===d.kind?t.A.warn("Dropping a single log record after 413 with batch size 1 — the record is larger than the server cap and cannot be split further."):"ok"===d.kind&&t._n.maxBatchRecordsPerPost>t.ns&&(t.ns=Math.min(t._n.maxBatchRecordsPerPost,t.ns+1)),yield t.ys(u.length),i=null!==(o=t._instance.getPersistedProperty(pe.LogsQueue))&&void 0!==o?o:[],n+=u.length,"fatal"===d.kind)throw d.error}}})()}ys(t){var e=this;return o(function*(){var i,r=Math.max(0,t-e.Zn),n=null!==(i=e._instance.getPersistedProperty(pe.LogsQueue))&&void 0!==i?i:[];e._instance.setPersistedProperty(pe.LogsQueue,n.slice(r)),yield e.Wn()})()}ps(){return cn(this._n,this._instance.getLibraryId(),this._instance.getLibraryVersion())}cs(t){var e;if(!this._instance.optedOut){var i=null!==(e=this._instance.getPersistedProperty(pe.LogsQueue))&&void 0!==e?e:[];this.es>i.length||(i.shift(),this.Zn++,this.A.info("Logs queue is full, dropping oldest record.")),i.push(t),this._instance.setPersistedProperty(pe.LogsQueue,i),this.ts>i.length?this.bs():this.hs()}}bs(t){void 0===t&&(t=this.rs),this._s||(this._s=lr(()=>{this._s=void 0,this.hs()},t))}ws(){var t=Math.min(Math.max(0,this.Qn-1),6);return this.rs*Math.pow(2,t)}ks(){var t=this._instance.getPersistedProperty(pe.LogsQueue);return!!t&&t.length>0}shutdown(t){var e=this;return o(function*(){e.us();var i=e.flush().catch(()=>{});void 0!==t?yield ur(i,t):yield i})()}flushWithTimeout(t){var e=this;return o(function*(){var i=e.flush();yield ur(i,t,()=>{i.catch(()=>{})})})()}hs(){this.flush().then(()=>{this.Qn=0},t=>{this.Qn++,this.A.error("PostHog logs flush failed:",t)}).finally(()=>{!this._instance.isDisabled&&this.ks()&&this.bs(this.ws())})}us(){this._s&&(clearTimeout(this._s),this._s=void 0)}},gn=[0,5,10,25,50,75,100,250,500,750,1e3,2500,5e3,7500,1e4];function mn(t){return String(t)+"000000"}function yn(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}var bn=class{constructor(t,e,i){this._instance=t,this._n=e,this.A=i,this.Ss=new Map,this.Gn=null,this.xs=!1,this.Cs=new Map,this.Ts=new Set,this.Ms=0}count(t,e,i){void 0===e&&(e=1),this.Is({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.Is({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.Is({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.Gn,i=function(){var i=o(function*(){e&&(yield e.catch(()=>{})),yield t.Es()});return function(){return i.apply(this,arguments)}}()().finally(()=>{this.Gn===i&&(this.Gn=null)});return this.Gn=i,i}drainWindow(){if(0===this.Ss.size)return null;var t=this.Ss;return this.Ss=new Map,this.xs=!1,this.Cs=new Map,this.Ts=new Set,this.Rs(t)}reset(){this.Ms++,this.us(),this.Ss=new Map,this.Gn=null,this.xs=!1,this.Cs=new Map,this.Ts=new Set}Is(t){if(!this._instance.isDisabled&&!this._instance.optedOut){var e=this.ds(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.A.warn("Dropping count '"+e.name+"': counters are monotonic, value must be >= 0");else{var i,r;try{i=e.attributes?n({},e.attributes):void 0,r=yn(e.type,e.name,e.unit,i)}catch(t){return void this.A.warn("Dropping metric '"+e.name+"': attributes could not be serialized",t)}var s=this.Ss.get(r);if(!s){if(!this.As())return;s={name:e.name,type:e.type,unit:e.unit,attributes:i,windowStartMs:Date.now()},this.Ss.set(r,s)}var o=this.Cs.get(e.name);void 0===o?this.Cs.set(e.name,e.type):o===e.type||this.Ts.has(e.name)||(this.Ts.add(e.name),this.A.warn("Metric name '"+e.name+"' is already used as a "+o+"; recording it as a "+e.type+" too will blend both series in charts. Use a distinct name.")),this.Ps(s,e.value),this.bs()}else this.A.warn("Dropping metric '"+e.name+"': value must be a finite number");else this.A.warn("Dropping metric with empty name")}}As(){return this._n.maxSeriesPerFlush>this.Ss.size||(this.xs||(this.xs=!0,this.A.warn("Metric series cap reached ("+this._n.maxSeriesPerFlush+" per flush window); dropping new series until the next flush. Reduce attribute cardinality.")),!1)}Ps(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(gn.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,gn)]+=1}}ds(t){var e=this._n.beforeSend;if(!e)return t;var i=xe(e)?e:[e],r=t;for(var n of i)try{var s=n(r);if(!s)return this.A.info("Metric was rejected in beforeSend function"),null;r=s}catch(t){return this.A.error("Error in beforeSend function for metric:",t),null}return r}bs(){this._s||(this._s=lr(()=>{this._s=void 0,this.flush().catch(t=>{this.A.error("Metrics flush failed:",t)})},this._n.flushIntervalMs))}us(){this._s&&(clearTimeout(this._s),this._s=void 0)}Es(){var t=this;return o(function*(){if(0!==t.Ss.size){var e=t.Ss;t.Ss=new Map,t.xs=!1,t.Cs=new Map,t.Ts=new Set;var i=t.Ms,r=yield t._instance.Fs(t.Rs(e));if(i===t.Ms)switch(r.kind){case"ok":return;case"retry-later":return t.Os(e),void t.bs();case"too-large":return void t.A.warn("Metrics batch exceeded the server size limit and was dropped");case"fatal":return void t.A.error("Failed to send metrics batch:",r.error)}}})()}Rs(t){return e=this.$s(t),i=function(t,e,i){return an(t,e,i)}(this._n,this._instance.getLibraryId(),this._instance.getLibraryVersion()),r=this._instance.getLibraryId(),n=this._instance.getLibraryVersion(),{resourceMetrics:[{resource:{attributes:rn(i)},scopeMetrics:[{scope:{name:r,version:n},metrics:e}]}]};var e,i,r,n}$s(t){var e=mn(Date.now()),i=new Map;for(var r of t.values()){var s,o=yn(r.type,r.name,r.unit,void 0),a=i.get(o);a||(a=n({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(o,a));var l=rn(null!==(s=r.attributes)&&void 0!==s?s:{},this.A),u=mn(r.windowStartMs);if("count"===r.type){var h,d={attributes:l,startTimeUnixNano:u,timeUnixNano:e,asDouble:null!==(h=r.total)&&void 0!==h?h:0};a.sum.dataPoints.push(d)}else if("gauge"===r.type){var v,c={attributes:l,timeUnixNano:e,asDouble:null!==(v=r.last)&&void 0!==v?v:0};a.gauge.dataPoints.push(c)}else r.hist&&a.histogram.dataPoints.push({attributes:l,startTimeUnixNano:u,timeUnixNano:e,count:r.hist.count,sum:r.hist.sum,min:r.hist.min,max:r.hist.max,bucketCounts:r.hist.bucketCounts,explicitBounds:gn})}return Array.from(i.values())}Os(t){var e,i;for(var r of t){var n=r[0],s=r[1],o=this.Ss.get(n);if(o)switch(o.windowStartMs=Math.min(o.windowStartMs,s.windowStartMs),o.type){case"count":o.total=(null!==(e=o.total)&&void 0!==e?e:0)+(null!==(i=s.total)&&void 0!==i?i:0);break;case"gauge":break;case"histogram":if(s.hist)if(o.hist){o.hist.count+=s.hist.count,o.hist.sum+=s.hist.sum,o.hist.min=Math.min(o.hist.min,s.hist.min),o.hist.max=Math.max(o.hist.max,s.hist.max);for(var a=0;o.hist.bucketCounts.length>a;a++)o.hist.bucketCounts[a]+=s.hist.bucketCounts[a]}else o.hist=s.hist}else this.As()&&this.Ss.set(n,s)}}};function _n(t,e){var i;if(t)return null==(i=t.find(t=>t.type===e))?void 0:i.value}var wn="0.8.1",kn={DEBUG:!1,LIB_VERSION:wn,LIB_NAME:"browser-common",JS_SDK_VERSION:wn},Sn=function(t,e){var i=(void 0===e?{}:e).debugEnabled,r={q(e){for(var r=arguments.length,n=new Array(r>1?r-1:0),s=1;r>s;s++)n[s-1]=arguments[s];a&&(kn.DEBUG||a.POSTHOG_DEBUG||i)&&!Ie(a.console)&&a.console&&("__rrweb_original__"in a.console[e]?a.console[e].__rrweb_original__:a.console[e])(t,...n)},debug(){for(var t=arguments.length,e=new Array(t),i=0;t>i;i++)e[i]=arguments[i];r.q("debug",...e)},info(){for(var t=arguments.length,e=new Array(t),i=0;t>i;i++)e[i]=arguments[i];r.q("log",...e)},warn(){for(var t=arguments.length,e=new Array(t),i=0;t>i;i++)e[i]=arguments[i];r.q("warn",...e)},error(){for(var t=arguments.length,e=new Array(t),i=0;t>i;i++)e[i]=arguments[i];r.q("error",...e)},critical(){for(var e=arguments.length,i=new Array(e),r=0;e>r;r++)i[r]=arguments[r];console.error(t,...i)},uninitializedWarning(t){r.error("You must initialize PostHog before calling "+t)},createLogger:(e,i)=>Sn(t+" "+e,i)};return r},xn=Sn("[PostHog.js]"),Cn=xn.createLogger;function Tn(t,e){xe(t)&&t.forEach(e)}function Mn(t,e){if(!Pe(t))if(xe(t))t.forEach(e);else if(De(t))t.forEach((t,i)=>e(t,i));else for(var i in t)ke.call(t,i)&&e(t[i],i)}var In=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 En(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 Rn=function(t){try{return t()}catch(t){return}},An=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){xn.critical("Implementation error. Please turn on debug mode and open a ticket on https://app.posthog.com/home#panel=support%3Asupport%3A."),xn.critical(t)}}},Pn=function(t){var e={};return Mn(t,function(t,i){(Ee(t)&&t.length>0||Fe(t))&&(e[i]=t)}),e};var Fn=["herokuapp.com","vercel.app","netlify.app"];function On(t){var e=null==t?void 0:t.hostname;if(!Ee(e))return!1;var i=e.split(".").slice(-2).join(".");for(var r of Fn)if(i===r)return!1;return!0}function $n(t,e,i,r){var n=null!=r?r:{},s=n.capture,o=n.passive;null==t||t.addEventListener(e,i,{capture:void 0!==s&&s,passive:void 0===o||o})}function Dn(t){return"ph_toolbar_internal"===t.name}var Ln=["localhost","127.0.0.1"],Nn=(t,e)=>{try{return JSON.stringify(t,(t,e)=>"bigint"==typeof e?e.toString():e,e)}catch(e){return fe(t)}},qn=t=>{var e=null==h?void 0:h.createElement("a");return Ie(e)?null:(e.href=t,e)},jn=function(t,e){var i,r;void 0===e&&(e="&");var n=[];return Mn(t,function(t,e){Ie(t)||Ie(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)},Bn=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(!xe(i)||2>i.length)return"";var o=i[1];try{o=decodeURIComponent(o)}catch(t){xn.error("Skipping decoding for malformed query param: "+o)}return o.replace(/\+/g," ")},Hn=function(t,e,i){if(!t||!e||!e.length)return t;for(var r=t.split("#"),n=r[1],s=(r[0]||"").split("?"),o=s[1],a=s[0],l=(o||"").split("&"),u=[],h=0;l.length>h;h++){var d=l[h].split("=");xe(d)&&(e.includes(d[0])?u.push(d[0]+"="+i):u.push(l[h]))}var v=a;return null!=o&&(v+="?"+u.join("&")),null!=n&&(v+="#"+n),v},zn=function(t,e){var i=t.match(new RegExp(e+"=([^&]*)"));return i?i[1]:null},Un=(t,e)=>t>=e&&m(),Wn=(t,e,i,r)=>{if(0===t){if(m()){var n=e+1;return n===i&&r(),n}return e}return 0};function Vn(t,e){var i,r=null==t||null==(i=t.config)?void 0:i.get_current_url;if(!Ce(r))return e;try{var n=r(e);return Ee(n)&&n?n:e}catch(t){return xn.error("Error in get_current_url, falling back to window.location.href",t),e}}function Gn(t){var e,i=null==a||null==(e=a.location)?void 0:e.href;return Ie(i)?void 0:Vn(t,i)}function Zn(t){return t instanceof Element&&("__POSTHOG_TOOLBAR__"===t.id||!(null==t.closest||!t.closest(".toolbar-global-fade-container")))}function Jn(t){return!!t&&1===t.nodeType}function Qn(t,e){return!!t&&!!t.tagName&&t.tagName.toLowerCase()===e.toLowerCase()}function Kn(t){return!!t&&3===t.nodeType}function Xn(t){return!!t&&11===t.nodeType&&Jn(t.host)}function Yn(t){return t?ve(t).split(/\s+/):[]}function ts(t,e){var i=Gn(e);return!!(i&&t&&t.some(t=>i.match(t)))}function es(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 Yn(e)}function is(t){return Pe(t)?null:ve(t).split(/(\s+)/).filter(t=>Is(t)).join("").replace(/[\r\n]/g," ").replace(/[ ]+/g," ").substring(0,255)}function rs(t){var e="";return bs(t)&&!_s(t)&&t.childNodes&&t.childNodes.length&&Mn(t.childNodes,function(t){var i;Kn(t)&&t.textContent&&(e+=null!==(i=is(t.textContent))&&void 0!==i?i:"")}),ve(e)}function ns(t){var e;return Ie(t.target)?t.srcElement||null:null!=(e=t.target)&&e.shadowRoot?t.composedPath()[0]||null:t.target||null}var ss=["a","button","form","input","select","textarea","label"];function os(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}}function as(t,e){if(Ie(e))return!0;var i,r=function(t){if(e.some(e=>os(t,e)))return{v:!0}};for(var n of t)if(i=r(n))return i.v;return!1}function ls(t){var e=t.parentNode;return!(!e||!Jn(e))&&e}var us=[".ph-no-autocapture","[data-ph-no-autocapture]"],hs=["next","previous","prev",">","<"],ds=[...hs,"+","-","−","–"],vs=(t,e)=>/[a-z0-9]/i.test(e)?t.includes(e):t===e,cs=[".ph-no-deadclick",".ph-no-capture"],fs=[".ph-no-rageclick",".ph-no-capture"],ps=["","text","search","email","password","url","tel","number"];function gs(t,e){if(!a||ms(t))return!1;var i,r,n,s,o;if($e(e)?(i=!!e&&fs,r=void 0,n=!1):(i=null!==(s=null==e?void 0:e.css_selector_ignorelist)&&void 0!==s?s:fs,r=null==e?void 0:e.content_ignorelist,n=null!==(o=null==e?void 0:e.ignore_text_selection)&&void 0!==o&&o),!1===i)return!1;if(n&&function(t){return!(!t||!Jn(t))&&(!!Qn(t,"textarea")||(Qn(t,"input")?de(ps,(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)))}(t))return!1;var l=ys(t,!1).targetElementList;return!function(t,e){if(!1===t||Ie(t))return!1;var i;if(!0===t)i=hs;else{if(!xe(t))return!1;if(t.length>10)return xn.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=>vs(e,t)||vs(r,t))})}(r,l.map(t=>{var e;return{safeText:rs(t).toLowerCase(),ariaLabel:(null==(e=t.getAttribute("aria-label"))?void 0:e.toLowerCase().trim())||""}}))&&!as(l,i)}var ms=t=>!t||Qn(t,"html")||!Jn(t),ys=(t,e)=>{if(!a||ms(t))return{parentIsUsefulElement:!1,targetElementList:[]};for(var i=!1,r=[t],n=t;n.parentNode&&!Qn(n,"body");)if(Xn(n.parentNode))r.push(n.parentNode.host),n=n.parentNode.host;else{var s=ls(n);if(!s)break;if(e||ss.indexOf(s.tagName.toLowerCase())>-1)i=!0;else try{var o=a.getComputedStyle(s);o&&"pointer"===o.getPropertyValue("cursor")&&(i=!0)}catch(t){}r.push(s),n=s}return{parentIsUsefulElement:i,targetElementList:r}};function bs(t){for(var e=new Set,i=0,r=t;r.parentNode&&!Qn(r,"body");r=r.parentNode){if(i++>=1e3||e.has(r))return!1;e.add(r);var n=es(r);if(de(n,"ph-sensitive")||de(n,"ph-no-capture"))return!1}if(de(es(t),"ph-include"))return!0;var s=t.type||"";if(Ee(s))switch(s.toLowerCase()){case"hidden":case"password":return!1}var o=t.name||t.id||"";return!Ee(o)||!/^cc|cardnum|ccnum|creditcard|csc|cvc|cvv|exp|pass|pwd|routing|seccode|securitycode|securitynum|socialsec|socsec|ssn/i.test(o.replace(/[^a-zA-Z0-9]/g,""))}function _s(t){return!!(Qn(t,"input")&&!["button","checkbox","submit","reset"].includes(t.type)||Qn(t,"select")||Qn(t,"textarea")||"true"===t.getAttribute("contenteditable"))}var ws=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}))$"),ks=/(^|[^0-9A-Za-z_])([0-9][0-9 -]*[0-9])(?=$|[^0-9A-Za-z_])/g,Ss=[16,15,14,13],xs=new RegExp("^(\\d{3}-?\\d{2}-?\\d{4})$"),Cs=new RegExp("(^|[^0-9])((?!000|666)[0-9]{3}-?(?!00)[0-9]{2}-?(?!0000)[0-9]{4})(?=$|([^0-9]))","g"),Ts=/[0-9A-Za-z_]/;function Ms(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 Is(t,e){if(void 0===e&&(e=!0),Pe(t))return!1;if(Ee(t)){if(t=ve(t),e?ws.test((t||"").replace(/[- ]/g,"")):function(t){var e;for(ks.lastIndex=0;e=ks.exec(t);){var i=e[2];if(i)for(var r=i.replace(/[- ]/g,""),n=0;r.length>n;n++)for(var s of Ss){var o=n+s;if(r.length>=o){var a=r.slice(n,o);if(ws.test(a)&&Ms(a))return!0}}}return!1}(t))return!1;if(e?xs.test(t):function(t){var e;for(Cs.lastIndex=0;e=Cs.exec(t);){var i=e[1],r=e[3];if(!(i&&r&&Ts.test(i)&&Ts.test(r)))return!0}return!1}(t))return!1}return!0}function Es(t){var e=rs(t);return Is(e=(e+" "+Rs(t)).trim())?e:""}function Rs(t){var e="";return t&&t.childNodes&&t.childNodes.length&&Mn(t.childNodes,function(t){var i;if(t&&"span"===(null==(i=t.tagName)?void 0:i.toLowerCase()))try{var r=rs(t);e=(e+" "+r).trim(),t.childNodes&&t.childNodes.length&&(e=(e+" "+Rs(t)).trim())}catch(t){xn.error("[AutoCapture]",t)}}),e}function As(t){return t.replace(/"|\\"/g,'\\"')}function Ps(t){var e=t.attr__class;if(e)return xe(e)?e:Yn(e)}var Fs=1e6;function Os(t){var e;return Math.min(Fs,null!==(e=t.payloadSizeLimitBytes)&&void 0!==e?e:1e6)}var $s={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:Fs,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},Ds=["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"],Ls=["password","secret","passwd","api_key","apikey","auth","credentials","mysql_pwd","privatekey","private_key","token"],Ns=["auth","token","secret","session","api-key","apikey","api_key","credential","password","passwd","cookie","csrf","xsrf"],qs=t=>{Pe(t)||Mn(Object.keys(t),e=>{(t=>{var e=t.toLowerCase();return Ds.includes(e)||Ns.some(t=>e.includes(t))})(e)&&(t[e]="redacted")})},js=["/s/","/e/","/i/"];function Bs(t,e,i,r){if(Pe(t))return t;var n=(null==e?void 0:e["content-length"])||function(t){return new Blob([t]).size}(t);return Ee(n)&&(n=parseInt(n)),n>i?"[SessionRecording] "+r+" body too large to record ("+n+" bytes)":t}function Hs(t,e){if(Pe(t))return t;var i=t;return Is(i,!1)||(i="[SessionRecording] "+e+" body redacted"),Mn(Ls,t=>{var r,n;null!=(r=i)&&r.length&&-1!==(null==(n=i)?void 0:n.indexOf(t))&&(i="[SessionRecording] "+e+" body redacted as might contain: "+t)}),i}var zs=new WeakSet,Us="disabled",Ws="sampled",Vs="active",Gs="buffering",Zs="paused",Js="lazy_loading",Qs="rrweb_error",Ks="trigger_activated",Xs="trigger_pending",Ys="trigger_disabled";function to(t,e,i,r,n,s){return 0===e?Ys:(null==t?void 0:t.get_property(i?r+i:n))===s?Ks:Xs}function eo(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 io(t){return t.includes("trigger_activated")?Ks:t.includes("trigger_pending")?Xs:Ys}function ro(t){var e=new Set(t);switch(e.delete(Ys),e.size){case 0:return Ys;case 1:return Array.from(e)[0];default:return Xs}}var no=class{constructor(t){this.j=t}triggerStatus(t){return io(this.j.map(e=>e.triggerStatus(t)))}triggerStatusNoSideEffects(t){return io(this.j.map(e=>e.triggerStatusNoSideEffects(t)))}stop(){this.j.forEach(t=>t.stop())}},so=class{constructor(t){this.j=t}triggerStatus(t){return ro(this.j.map(e=>e.triggerStatus(t)))}triggerStatusNoSideEffects(t){return ro(this.j.map(e=>e.triggerStatusNoSideEffects(t)))}stop(){this.j.forEach(t=>t.stop())}},oo=class{triggerStatus(){return this.triggerStatusNoSideEffects()}triggerStatusNoSideEffects(){return Ks}stop(){}},ao=t=>"sessionRecording"in t,lo=class{constructor(t,e){this._instance=t,this.B=[],this.H=[],this.$=new Map,this.U=new Map,this.W="",this.urlBlocked=!1,this.V=e}onConfig(t){var e,i;this.B=(ao(t)?Te(t.sessionRecording)?null==(e=t.sessionRecording)?void 0:e.urlTriggers:[]:null==t?void 0:t.urlTriggers)||[],this.H=(ao(t)?Te(t.sessionRecording)?null==(i=t.sessionRecording)?void 0:i.urlBlocklist:[]:null==t?void 0:t.urlBlocklist)||[],this.Z()}Z(){for(var t of(this.$.clear(),this.U.clear(),this.B))if("regex"===t.matching&&!this.$.has(t.url))try{this.$.set(t.url,new RegExp(t.url))}catch(e){xn.error("Invalid URL trigger regex pattern:",t.url,e)}for(var e of this.H)if("regex"===e.matching&&!this.U.has(e.url))try{this.U.set(e.url,new RegExp(e.url))}catch(t){xn.error("Invalid URL blocklist regex pattern:",e.url,t)}}onRemoteConfig(t){this.onConfig(t)}G(t){return to(this._instance,this.B.length,this.V,Y,Q,t)}triggerStatus(t){var e=this.triggerStatusNoSideEffects(t);return this._instance.register_for_session({[Jt]:e}),e}triggerStatusNoSideEffects(t){return this.G(t)}isCurrentUrlBlocked(){var t=Gn(this._instance);if(!t)return!1;try{return eo(t,this.H,this.U)}catch(t){return!0}}checkUrlBlocklist(t,e){var i=Gn(this._instance);if(i&&i!==this.W){this.W=i;var r=this.urlBlocked,n=eo(i,this.H,this.U);r&&n||(n&&!r?t():!n&&r&&e())}}checkUrlTriggerConditions(t,e,i,r){var n=Gn(this._instance);if(n&&n!==this.W){this.W=n;var s=this.urlBlocked,o=eo(n,this.H,this.U);o&&!s?t():!o&&s&&e();var a=this.G(r)===Ks,l=eo(n,this.B,this.$);!a&&l&&i("url",n)}}stop(){this.W=""}},uo=class{constructor(t){this._instance=t,this.linkedFlag=null,this.linkedFlagSeen=!1,this.J=()=>{}}triggerStatus(){var t=this.triggerStatusNoSideEffects();return this._instance.register_for_session({[Ut]:t}),t}triggerStatusNoSideEffects(){var t=Xs;return Pe(this.linkedFlag)&&(t=Ys),this.linkedFlagSeen&&(t=Ks),t}onConfig(t,e){var i;if(this.linkedFlag=(ao(t)?Te(t.sessionRecording)?null==(i=t.sessionRecording)?void 0:i.linkedFlag:null:null==t?void 0:t.linkedFlag)||null,!Pe(this.linkedFlag)&&!this.linkedFlagSeen){var r=Ee(this.linkedFlag)?this.linkedFlag:this.linkedFlag.flag,n=Ee(this.linkedFlag)?null:this.linkedFlag.variant;this.J=this._instance.onFeatureFlags((t,i)=>{var s=!1;if(Te(i)&&r in i){var o=i[r];s=$e(o)?!0===o:n?o===n:!!o}var a=s&&!this.linkedFlagSeen;this.linkedFlagSeen=s,a&&e(r,n)})}}onRemoteConfig(t,e){this.onConfig(t,e)}stop(){this.J()}},ho=class{constructor(t,e){this._instance=t,this.K=[],this.V=e}onConfig(t){var e;this.K=(ao(t)?Te(t.sessionRecording)?null==(e=t.sessionRecording)?void 0:e.eventTriggers:[]:null==t?void 0:t.eventTriggers)||[]}onRemoteConfig(t){this.onConfig(t)}X(t){return to(this._instance,this.K.length,this.V,X,K,t)}triggerStatus(t){var e=this.triggerStatusNoSideEffects(t);return this._instance.register_for_session({[zt]:e}),e}triggerStatusNoSideEffects(t){return this.X(t)}checkEventTriggerConditions(t,e,i){if(0!==this.K.length){var r=this.X(i)===Ks,n=this.K.includes(t);!r&&n&&e("event",t)}}stop(){}},vo=class{constructor(t,e,i){if(this._instance=t,this.group=e,this.Y=new lo(t,e.id),this.tt=new ho(t,e.id),this.et=new uo(t),e.conditions.events&&e.conditions.events.length>0||e.conditions.urls&&e.conditions.urls.length>0||e.conditions.flag){var r=(e.conditions.events||[]).map(t=>t.name),n={urlTriggers:e.conditions.urls||[],eventTriggers:r,linkedFlag:e.conditions.flag||null,urlBlocklist:[]};this.Y.onConfig(n),this.tt.onConfig(n),this.et.onConfig(n,i);var s=[this.tt,this.Y,this.et];this.rt="any"===e.conditions.matchType?new no(s):new so(s)}else this.rt=new oo}triggerStatus(t){return this.rt.triggerStatus(t)}triggerStatusNoSideEffects(t){return this.rt.triggerStatusNoSideEffects(t)}getPendingTriggerConditions(t){return"trigger_pending"!==this.triggerStatusNoSideEffects(t)?[]:[{label:"URL condition not matched",status:this.Y.triggerStatusNoSideEffects(t)},{label:"event condition not matched",status:this.tt.triggerStatusNoSideEffects(t)},{label:"linked flag condition not matched",status:this.et.triggerStatusNoSideEffects()}].filter(t=>t.status===Xs).map(t=>t.label)}checkEventTriggerConditions(t,e,i){this.tt.checkEventTriggerConditions(t,e,i)}checkUrlTriggerConditions(t,e,i,r){this.Y.checkUrlTriggerConditions(t,e,i,r)}activateTrigger(t,e){var i,r="url"===t?Y+this.group.id:X+this.group.id;null==(i=this._instance.persistence)||i.register({[r]:e})}stop(){this.Y.stop(),this.tt.stop(),this.et.stop()}};function co(t){if(t.rrwebError)return Qs;if(!t.receivedFlags)return Gs;if(!t.isRecordingEnabled)return Us;if(t.urlTriggerMatching.urlBlocked)return Zs;var e=!0===t.isSampled,i=new no([t.eventTriggerMatching,t.urlTriggerMatching,t.linkedFlagMatching]).triggerStatus(t.sessionId);return e?Ws:"trigger_activated"===i?Vs:"trigger_pending"===i?Gs:!1===t.isSampled?Us:Vs}function fo(t){if(t.rrwebError)return Qs;if(!t.receivedFlags)return Gs;if(!t.isRecordingEnabled)return Us;if(t.urlTriggerMatching.urlBlocked)return Zs;var e=new so([t.eventTriggerMatching,t.urlTriggerMatching,t.linkedFlagMatching]).triggerStatus(t.sessionId),i=e!==Ys,r=$e(t.isSampled);return i&&"trigger_pending"===e?Gs:i&&"trigger_disabled"===e||r&&!t.isSampled?Us:!0===t.isSampled?Ws:Vs}function po(){var t=[];return function(e,i){if(Te(i)||xe(i)){for(;t.length>0&&t[t.length-1]!==this;)t.pop();return t.includes(i)?"[Circular]":(t.push(i),i)}return i}}function go(t){var e=JSON.stringify(t,po());return e?new Blob([e]).size:0}function mo(t){if(Ae(t))return 4;if(Ie(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(xe(t)){for(var e=2,i=0;t.length>i;i++){i>0&&(e+=1);var r=t[i];e+=Ie(r)||Ae(r)?4:mo(r)}return e}var n=t,s=2,o=!0;for(var a in n)if({}.hasOwnProperty.call(n,a)){var l=n[a];Ie(l)||(o||(s+=1),o=!1,s+=a.length+3+mo(l))}return s;default:return 0}}function yo(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[yo({size:r.reduce((t,e)=>t+e,0),data:t.data.slice(0,i),sizes:r,sessionId:t.sessionId,windowId:t.windowId}),yo({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 bo=Uint8Array,_o=Uint16Array,wo=Uint32Array,ko=new bo([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]),So=new bo([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]),xo=new bo([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),Co=function(t,e){for(var i=new _o(31),r=0;31>r;++r)i[r]=e+=1<<t[r-1];var n=new wo(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]},To=Co(ko,2),Mo=To[1];To[0][28]=258,Mo[258]=28;for(var Io=Co(So,0)[1],Eo=new _o(32768),Ro=0;32768>Ro;++Ro){var Ao=(43690&Ro)>>>1|(21845&Ro)<<1;Eo[Ro]=((65280&(Ao=(61680&(Ao=(52428&Ao)>>>2|(13107&Ao)<<2))>>>4|(3855&Ao)<<4))>>>8|(255&Ao)<<8)>>>1}var Po=function(t,e,i){for(var r=t.length,n=0,s=new _o(e);r>n;++n)++s[t[n]-1];var o,a=new _o(e);for(n=0;e>n;++n)a[n]=a[n-1]+s[n-1]<<1;if(i){o=new _o(1<<e);var l=15-e;for(n=0;r>n;++n)if(t[n])for(var u=n<<4|t[n],h=e-t[n],d=a[t[n]-1]++<<h,v=d|(1<<h)-1;v>=d;++d)o[Eo[d]>>>l]=u}else for(o=new _o(r),n=0;r>n;++n)o[n]=Eo[a[t[n]-1]++]>>>15-t[n];return o},Fo=new bo(288);for(Ro=0;144>Ro;++Ro)Fo[Ro]=8;for(Ro=144;256>Ro;++Ro)Fo[Ro]=9;for(Ro=256;280>Ro;++Ro)Fo[Ro]=7;for(Ro=280;288>Ro;++Ro)Fo[Ro]=8;var Oo=new bo(32);for(Ro=0;32>Ro;++Ro)Oo[Ro]=5;var $o=Po(Fo,9,0),Do=Po(Oo,5,0),Lo=function(t){return(t/8|0)+(7&t&&1)},No=function(t,e,i){(null==e||0>e)&&(e=0),(null==i||i>t.length)&&(i=t.length);var r=new(t instanceof _o?_o:t instanceof wo?wo:bo)(i-e);return r.set(t.subarray(e,i)),r},qo=function(t,e,i){var r=e/8|0;t[r]|=i<<=7&e,t[r+1]|=i>>>8},jo=function(t,e,i){var r=e/8|0;t[r]|=i<<=7&e,t[r+1]|=i>>>8,t[r+2]|=i>>>16},Bo=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 bo(0),0];if(1==n){var o=new bo(i[0].s+1);return o[i[0].s]=1,[o,1]}i.sort(function(t,e){return t.f-e.f}),i.push({s:-1,f:25001});var a=i[0],l=i[1],u=0,h=1,d=2;for(i[0]={s:-1,f:a.f+l.f,l:a,r:l};h!=n-1;)a=i[i[d].f>i[u].f?u++:d++],l=i[u!=h&&i[d].f>i[u].f?u++:d++],i[h++]={s:-1,f:a.f+l.f,l:a,r:l};var v=s[0].s;for(r=1;n>r;++r)s[r].s>v&&(v=s[r].s);var c=new _o(v+1),f=Ho(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 bo(c),f]},Ho=function(t,e,i){return-1==t.s?Math.max(Ho(t.l,e,i+1),Ho(t.r,e,i+1)):e[t.s]=i},zo=function(t){for(var e=t.length;e&&!t[--e];);for(var i=new _o(++e),r=0,n=t[0],s=1,o=function(t){i[r++]=t},a=1;e>=a;++a)if(t[a]==n&&a!=e)++s;else{if(!n&&s>2){for(;s>138;s-=138)o(32754);s>2&&(o(s>10?s-11<<5|28690:s-3<<5|12305),s=0)}else if(s>3){for(o(n),--s;s>6;s-=6)o(8304);s>2&&(o(s-3<<5|8208),s=0)}for(;s--;)o(n);s=1,n=t[a]}return[i.subarray(0,r),e]},Uo=function(t,e){for(var i=0,r=0;e.length>r;++r)i+=t[r]*e[r];return i},Wo=function(t,e,i){var r=i.length,n=Lo(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)},Vo=function(t,e,i,r,n,s,o,a,l,u,h){qo(e,h++,i),++n[256];for(var d=Bo(n,15),v=d[0],c=d[1],f=Bo(s,15),p=f[0],g=f[1],m=zo(v),y=m[0],b=m[1],_=zo(p),w=_[0],k=_[1],S=new _o(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=Bo(S,7),T=C[0],M=C[1],I=19;I>4&&!T[xo[I-1]];--I);var E,R,A,P,F=u+5<<3,O=Uo(n,Fo)+Uo(s,Oo)+o,D=Uo(n,v)+Uo(s,p)+o+14+3*I+Uo(S,T)+(2*S[16]+3*S[17]+7*S[18]);if(O>=F&&D>=F)return Wo(e,h,t.subarray(l,l+u));if(qo(e,h,1+(O>D)),h+=2,O>D){E=Po(v,c,0),R=v,A=Po(p,g,0),P=p;var L=Po(T,M,0);for(qo(e,h,b-257),qo(e,h+5,k-1),qo(e,h+10,I-4),h+=14,x=0;I>x;++x)qo(e,h+3*x,T[xo[x]]);h+=3*I;for(var N=[y,w],q=0;2>q;++q){var j=N[q];for(x=0;j.length>x;++x)qo(e,h,L[B=31&j[x]]),h+=T[B],B>15&&(qo(e,h,j[x]>>>5&127),h+=j[x]>>>12)}}else E=$o,R=Fo,A=Do,P=Oo;for(x=0;a>x;++x)if(r[x]>255){var B;jo(e,h,E[257+(B=r[x]>>>18&31)]),h+=R[B+257],B>7&&(qo(e,h,r[x]>>>23&31),h+=ko[B]);var H=31&r[x];jo(e,h,A[H]),h+=P[H],H>3&&(jo(e,h,r[x]>>>5&8191),h+=So[H])}else jo(e,h,E[r[x]]),h+=R[r[x]];return jo(e,h,E[256]),h+R[256]},Go=new wo([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),Zo=new bo(0),Jo=function(){for(var t=new wo(256),e=0;256>e;++e){for(var i=e,r=9;--r;)i=(1&i&&3988292384)^i>>>1;t[e]=i}return t}(),Qo=function(t,e,i){for(;i;++e)t[e]=i,i>>>=8};function Ko(t,e){void 0===e&&(e={});var i=function(){var t=4294967295;return{p(e){for(var i=t,r=0;e.length>r;++r)i=Jo[255&i^e[r]]^i>>>8;t=i},d(){return 4294967295^t}}}(),r=t.length;i.p(t);var n,s,o,a,l,u=(n=t,s=e,o=function(t){return 10+(t.filename&&t.filename.length+1||0)}(e),a=8,function(t,e,i,r,n,s){var o=t.length,a=new bo(r+o+5*(1+Math.floor(o/7e3))+n),l=a.subarray(r,a.length-n),u=0;if(!e||8>o)for(var h=0;o>=h;h+=65535){var d=h+65535;o>d?u=Wo(l,u,t.subarray(h,d)):(l[h]=s,u=Wo(l,u,t.subarray(h,o)))}else{for(var v=Go[e-1],c=v>>>13,f=8191&v,p=(1<<i)-1,g=new _o(32768),m=new _o(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 wo(25e3),k=new _o(288),S=new _o(32),x=0,C=0,T=(h=0,0),M=0,I=0;o>h;++h){var E=_(h),R=32767&h,A=m[E];if(g[R]=A,m[E]=R,h>=M){var P=o-h;if((x>7e3||T>24576)&&P>423){u=Vo(t,l,0,w,k,S,C,T,I,h-I,u),T=x=C=0,I=h;for(var F=0;286>F;++F)k[F]=0;for(F=0;30>F;++F)S[F]=0}var O=2,D=0,L=f,N=R-A&32767;if(P>2&&E==_(h-N))for(var q=Math.min(c,P)-1,j=Math.min(32767,h),B=Math.min(258,P);j>=N&&--L&&R!=A;){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,D=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,A=W)}}}N+=(R=A)-(A=g[R])+32768&32767}if(D){w[T++]=268435456|Mo[O]<<18|Io[D];var G=31&Mo[O],Z=31&Io[D];C+=ko[G]+So[Z],++k[257+G],++S[Z],M=h+O,++x}else w[T++]=t[h],++k[t[h]]}}u=Vo(t,l,s,w,k,S,C,T,I,h-I,u),s||(u=Wo(l,u,Zo))}return No(a,0,r+Lo(u)+n)}(n,null==s.level?6:s.level,null==s.mem?Math.ceil(1.5*Math.max(8,Math.min(13,Math.log(n.length)))):12+s.mem,o,a,!l)),h=u.length;return 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&&Qo(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)}}(u,e),Qo(u,h-8,i.d()),Qo(u,h-4,r),u}function Xo(t,e){var i=t.length;if(!e&&"undefined"!=typeof TextEncoder)return(new TextEncoder).encode(t);for(var r=new bo(t.length+(t.length>>>1)),n=0,s=function(t){r[n++]=t},o=0;i>o;++o){if(n+5>r.length){var a=new bo(n+8+(i-o<<1));a.set(r),r=a}var l=t.charCodeAt(o);128>l||e?s(l):2048>l?(s(192|l>>>6),s(128|63&l)):l>55295&&57344>l?(s(240|(l=65536+(1047552&l)|1023&t.charCodeAt(++o))>>>18),s(128|l>>>12&63),s(128|l>>>6&63),s(128|63&l)):(s(224|l>>>12),s(128|l>>>6&63),s(128|63&l))}return No(r,0,n)}function Yo(t,e){var i="";if(!e&&"undefined"!=typeof TextDecoder)return(new TextDecoder).decode(t);for(var r=0;t.length>r;){var n=t[r++];128>n||e?i+=String.fromCharCode(n):224>n?i+=String.fromCharCode((31&n)<<6|63&t[r++]):240>n?i+=String.fromCharCode((15&n)<<12|(63&t[r++])<<6|63&t[r++]):(n=((15&n)<<18|(63&t[r++])<<12|(63&t[r++])<<6|63&t[r++])-65536,i+=String.fromCharCode(55296|n>>10,56320|1023&n))}return i}var ta=class{constructor(t,e){var i,r,n,s;void 0===e&&(e={}),this._rrweb=t,this.it=e,this.nt={},this.ot=Date.now(),this.st=-1/0,this.ut=()=>{var t=Date.now(),e=t-this.ot;e>0?(this.ht=Math.min(this.ct,this.ht+e/1e3*this.dt),this.ot=t):this.ot=t},this.vt=t=>{if(!this.nt[t]){var e,i;this.nt[t]=!0;var r=this.ft(t);null==(e=(i=this.it).onBlockedNode)||e.call(i,t,r)}},this.yt=t=>{var e=this.ft(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.ft=t=>this._rrweb.mirror.getNode(t),this.bt=t=>{var e,i,r,n,s,o,a,l;return(null!==(e=null==(i=t.removes)?void 0:i.length)&&void 0!==e?e:0)+(null!==(r=null==(n=t.attributes)?void 0:n.length)&&void 0!==r?r:0)+(null!==(s=null==(o=t.texts)?void 0:o.length)&&void 0!==s?s:0)+(null!==(a=null==(l=t.adds)?void 0:l.length)&&void 0!==a?a:0)},this.throttleMutations=t=>{if(3!==t.type||0!==t.data.source)return t;var e=t.data,i=this.bt(e);if(e.attributes){var r,n,s=e.attributes.length;e.attributes=e.attributes.filter(t=>{var e=this.yt(t.id)[0];return!this.wt.consumeRateLimit(e)&&t});var o=s-e.attributes.length;o>0&&(null==(r=(n=this.it).onDroppedAttributeMutations)||r.call(n,o))}var a=this.bt(e);if(0!==a||i===a){if(this.kt)return t;this.ut();var l,u,h=mo(t);return h>this.ht?(null==(l=(u=this.it).onDroppedOversizedMutation)||l.call(u,h),void this._t()):(this.ht-=h,t)}},this._t=()=>{if(!this.St){var t=Math.max(0,this.xt-(Date.now()-this.st));this.St=setTimeout(()=>{var t,e;this.St=void 0,this.st=Date.now(),null==(t=(e=this.it).requestFullSnapshot)||t.call(e)},t)}},this.wt=new Ze({bucketSize:null!==(i=this.it.bucketSize)&&void 0!==i?i:100,refillRate:null!==(r=this.it.refillRate)&&void 0!==r?r:10,refillInterval:1e3,I:this.vt,A:xn}),this.ct=null!==(n=this.it.bytesBucketSize)&&void 0!==n?n:0,this.dt=null!==(s=this.it.bytesRefillRate)&&void 0!==s?s:25600,this.kt=!Number.isFinite(this.ct)||0>=this.ct,this.ht=this.ct;var o=this.it.resyncIntervalMs;this.xt=Fe(o)&&Number.isFinite(o)&&o>0?o:3e5}reset(){this.nt={},this.St&&(clearTimeout(this.St),this.St=void 0),this.st=Date.now()}stop(){this.wt.stop(),this.reset(),this.ht=this.ct,this.ot=Date.now(),this.st=-1/0}};kn.DEBUG=!1,kn.LIB_VERSION="1.428.1",kn.LIB_NAME="web";var ea=kn,ia=class{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.Ct=t.get_property.bind(t),this.Mt=t.persistence.set_property.bind(t.persistence)}trackSize(t,e){this.Mt(it,{sessionId:t,size:this.currentTrackedSize(t)+e})}currentTrackedSize(t){var e,i=this.Ct(it);return Te(e=i)&&Ee(e.sessionId)&&Fe(e.size)&&i.sessionId===t?i.size:0}};function ra(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<Ge(100*e,0,100,xn)}function na(t){return"$survey_response_"+t}function sa(t,e){if(!e)return null;var i=t[na(e)];return xe(i)?[...i]:i}function oa(t,e,i){void 0===t&&(t={});var r={};return e.questions.forEach(e=>{if(!Ie(e.originalQuestionIndex)){var i,n=0===(i=e.originalQuestionIndex)?"$survey_response":"$survey_response_"+i,s=sa(t,e.id);Ie(s)||(r[n]=s)}}),n({$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:sa(t,e.id)}})},t,r)}function aa(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 la(t){return"string"==typeof t&&t.trim()?t.trim():null}function ua(t){return t.toLowerCase()}function ha(t,e,i){if(!t||!e)return null;var r=ua(e),n=Object.keys(t).find(t=>ua(t)===r);if(n)return null==i||i.debug("Found exact translation match: "+n),n;if(r.includes("-")){var s=r.split("-")[0],o=Object.keys(t).find(t=>ua(t)===s);if(o)return null==i||i.debug("Found base language translation match: "+o+" (from "+e+")"),o}return null}var da=["thankYouMessageHeader","thankYouMessageDescription","thankYouMessageCloseButtonText","introScreenHeader","introScreenDescription","introScreenButtonText","submitButtonText","backButtonText"];function va(t,e,i){var r,s=ha(t.translations,e,i),o=n({},t),a=!1;if(s){var l,u=null==(l=t.translations)?void 0:l[s];if(u)if(null==i||i.info("Applying survey-level translation for language: "+s),Ie(u.name)||(o.name=u.name,a=!0),o.appearance){var h=n({},o.appearance);for(var d of da){var v=u[d];Ie(v)||(h[d]=v,a=!0)}o.appearance=h}else(function(t){return da.some(e=>!Ie(t[e]))})(u)&&(a=!0)}var c=t.questions.map(t=>function(t,e,i){var r,s=ha(t.translations,e,i);if(!s)return{question:t,matchedKey:null,hasChanges:!1};var o=null==(r=t.translations)?void 0:r[s];if(!o)return{question:t,matchedKey:null,hasChanges:!1};var a=n({},t),l=!1;return Ie(o.question)||(a.question=o.question,l=!0),Ie(o.description)||(a.description=o.description,l=!0),Ie(o.buttonText)||(a.buttonText=o.buttonText,l=!0),"link"in a&&!Ie(o.link)&&(a.link=o.link,l=!0),"lowerBoundLabel"in a&&!Ie(o.lowerBoundLabel)&&(a.lowerBoundLabel=o.lowerBoundLabel,l=!0),"upperBoundLabel"in a&&!Ie(o.upperBoundLabel)&&(a.upperBoundLabel=o.upperBoundLabel,l=!0),"choices"in a&&function(t){return xe(t.choices)}(o)&&(a.choices=o.choices,l=!0),{question:l?a:t,matchedKey:l?s:null,hasChanges:l}}(t,e,i)),f=c.map(t=>t.question),p=c.some(t=>t.hasChanges),g=null;return s||(g=(null==(r=c.find(t=>t.matchedKey))?void 0:r.matchedKey)||null),p&&(o.questions=f,a=!0,null==i||i.info("Applied question-level translations for language: "+e)),{survey:o,matchedKey:a?s||g:null}}function ca(t){var e;return!(null==(e=t.conditions)||null==(e=e.events)||null==(e=e.values)||!e.length)}function fa(t){var e;return ca(t)&&!(null==(e=t.conditions)||null==(e=e.events)||!e.repeatedActivation)||"always"===t.schedule}var pa=(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}},ga=t=>t.toLowerCase(),ma={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=>pa(e,t))),not_regex:(t,e)=>e.every(e=>t.every(t=>!pa(e,t))),icontains:(t,e)=>e.map(ga).some(e=>t.map(ga).some(t=>e.includes(t))),not_icontains:(t,e)=>e.map(ga).every(e=>t.map(ga).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 ya(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=ma[i.operator];return!!n&&n(i.values,[String(r)])})}function ba(t,e,i){return Nn({distinct_id:t,userPropertiesToSet:e,userPropertiesToSetOnce:i})}var _a=new Set(["is_not","not_icontains","not_regex"]);function wa(t,e,i){return!t||0===t.length||t.every(t=>{var r,n=null==(r="person"===t.type?i:e)?void 0:r[t.key],s=t.operator||"exact";if(Ie(n)||Ae(n))return _a.has(s);var o=ma[s];return!!o&&!Ie(t.value)&&!Ae(t.value)&&o(xe(t.value)?t.value.map(String):[String(t.value)],xe(n)?n.map(String):[String(n)])})}var ka=Cn("[SessionRecording]");function Sa(t,e){return e?t:"!"+t}function xa(t,e){return t===e||t!=="!"+e&&null}var Ca=class{constructor(t,e,i,r,n,s,o){this._instance=t,this.Y=e,this.tt=i,this.et=r,this.Tt=n,this.It=s,this.Rt=o,this.At=null,this.Et=fo}onRemoteConfig(t){this.At=Fe(t.sampleRate)?t.sampleRate:null,"any"===t.triggerMatchType?(this.Lt=new no([this.tt,this.Y]),this.Et=co):(this.Lt=new so([this.tt,this.Y]),this.Et=fo),this._instance.register_for_session({[Gt]:t.triggerMatchType}),this.Y.onConfig(t),this.tt.onConfig(t),this.et.onConfig(t,(t,e)=>{this.Tt("linked_flag_matched",{flag:t,variant:e}),this.Rt()})}getStatus(t){return this.Et({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,i=null==(e=this._instance.get_property("$session_recording_remote_config"))?void 0:e.minimumDurationMilliseconds;return Fe(i)?i:null}checkUrlTriggers(t,e,i,r){this.Y.checkUrlTriggerConditions(e,i,r,t)}setupEventTriggerListeners(t,e,i){if(0!==this.tt.K.length&&Pe(this.Ot))return this.Ot=t(t=>{try{this.tt.checkEventTriggerConditions(t.event,i,e)}catch(t){ka.error("Could not activate event trigger",t)}}),this.Ot}makeSamplingDecisions(t){var e,i,r,n=this.At;if(!Fe(n))return null==(i=this._instance.persistence)||i.unregister(Z),void(null==(r=this._instance.persistence)||r.unregister(H));var s=this._instance.get_property(Z),o=this._instance.get_property(H),a=xa(s,t),l=Fe(o)&&o!==n,u=Ie(o)&&s===t,h=l||u||!$e(a),d=h?ra(t,n):a;h&&(d?this.Tt("sampled"):ka.warn("Sample rate ("+n+") has determined that this sessionId ("+t+") will not be sent to the server.")),null==(e=this._instance.persistence)||e.register({[Z]:Sa(t,d),[H]:Ae(o)&&s===t?null:n})}ensureSamplingDecision(t){Fe(this.At)&&($e(xa(this._instance.get_property(Z),t))||this.makeSamplingDecisions(t))}onFlushComplete(){}clearConditionalRecordingPersistence(){var t,e,i,r,n;null==(t=this._instance.persistence)||t.unregister(K),null==(e=this._instance.persistence)||e.unregister(Q),null==(i=this._instance.persistence)||i.unregister(Z),null==(r=this._instance.persistence)||r.unregister(H),null==(n=this._instance.persistence)||n.unregister(J)}updateActiveTriggers(t){}hasPendingTriggers(t){var e;return(null==(e=this.Lt)?void 0:e.triggerStatus(t))===Xs}getPendingTriggerConditions(t){return[{label:"URL condition not matched",status:this.Y.triggerStatusNoSideEffects(t)},{label:"event condition not matched",status:this.tt.triggerStatusNoSideEffects(t)},{label:"linked flag condition not matched",status:this.et.triggerStatusNoSideEffects()}].filter(t=>t.status===Xs).map(t=>t.label)}stop(){var t;null==(t=this.Ot)||t.call(this),this.Ot=void 0,this.tt.stop(),this.Y.stop(),this.et.stop()}},Ta=class{constructor(t,e,i,r,n){this._instance=t,this.Y=e,this.Tt=i,this.Dt=r,this.Rt=n,this.Pt=[],this.Ft=new Map,this.Nt=!1}onRemoteConfig(t){t.triggerGroups&&0!==t.triggerGroups.length?(this.qt(t.triggerGroups),this._instance.register_for_session({[Gt]:"v2_trigger_groups",[Zt]:t.triggerGroups.length}),this.Y.onConfig(t)):ka.warn("[V2Strategy] No trigger groups configured")}getStatus(t){return function(t){if(t.rrwebError)return Qs;if(!t.receivedFlags)return Gs;if(!t.isRecordingEnabled)return Us;if(t.urlTriggerMatching.urlBlocked)return Zs;var e=t.triggerGroupMatchers,i=t.triggerGroupSamplingResults;if(0===e.length)return Us;var r=!1,n=!1;for(var s of e){var o=s.triggerStatus(t.sessionId);if("trigger_activated"===o){var a=s.group.id,l=i.get(a);Ie(l)?xn.warn("[V2 Triggers] Group activated but no sampling decision found",{groupId:a}):!0===l&&(n=!0)}else"trigger_pending"===o&&(r=!0)}return n?Ws:r?Gs:Us}({receivedFlags:!0,isRecordingEnabled:!0,isSampled:t.isSampled,rrwebError:t.rrwebError,urlTriggerMatching:t.urlTriggerMatching,eventTriggerMatching:t.eventTriggerMatching,linkedFlagMatching:t.linkedFlagMatching,sessionId:t.sessionId,triggerGroupMatchers:this.Pt,triggerGroupSamplingResults:this.Ft,minimumDuration:this.getMinimumDuration(t.sessionId)})}getMinimumDuration(t){var e=null;for(var i of this.Pt)if("trigger_activated"===i.triggerStatus(t)){var r=i.group.minDurationMs;Fe(r)&&(Ae(e)||e>r)&&(e=r)}return e}checkUrlTriggers(t,e,i,r){var n=this;this.Y.checkUrlBlocklist(e,i);var s=function(r){r.checkUrlTriggerConditions(e,i,e=>{n.jt(r,void 0)&&(r.activateTrigger(e,t),n.updateActiveTriggers(t),n.Rt(e))},t)};for(var o of this.Pt)s(o)}setupEventTriggerListeners(t,e,i){var r=this;return this.Ot=t(t=>{var i;if(this.Nt)return ka.info("[SessionRecorder] Stopping trigger checks - initial buffer flushed"),null==(i=this.Ot)||i.call(this),void(this.Ot=void 0);try{var n=function(i){i.checkEventTriggerConditions(t.event,n=>{if(r.jt(i,t.properties)){var s=(i.group.conditions.events||[]).filter(e=>e.name===t.event),o=r._instance.get_property(vt);s.some(e=>!e.properties||0===e.properties.length||wa(e.properties,t.properties,o))&&(i.activateTrigger(n,e),r.updateActiveTriggers(e),r.Rt(n))}},e)};for(var s of this.Pt)n(s)}catch(t){ka.error("Could not activate event trigger for trigger groups",t)}}),this.Ot}makeSamplingDecisions(t){for(var e of this.Pt){var i,r=e.group,n=r.id,s=r.sampleRate,o=tt+n,a=this._instance.get_property(o),l=null,u=!1,h=!1,d=!1;if(Te(a)){var v=a.sessionId,c=a.sampleRate,f=a.sampled;u="string"==typeof v&&v!==t,h=Fe(c)&&c!==s,l=v===t&&Fe(c)&&c===s&&$e(f)?f:null}else l=a===t||null,u="string"==typeof a&&a!==t,d=a===t;var p=u||h||d||!$e(l),g=p?ra(t+n,s):l;p&&this.Dt("triggerGroupSamplingDecisionMade",{group_id:n,group_name:r.name,sampleRate:s,isSampled:g}),this.Ft.set(n,g),null==(i=this._instance.persistence)||i.register({[o]:{sessionId:t,sampleRate:s,sampled:g}})}this.updateActiveTriggers(t)}ensureSamplingDecision(t){}onFlushComplete(){this.Nt=!0}clearConditionalRecordingPersistence(){var t,e,i;for(var r of(null==(t=this._instance.persistence)||t.unregister(Z),null==(e=this._instance.persistence)||e.unregister(H),null==(i=this._instance.persistence)||i.unregister(J),this.Pt)){var n,s,o,a=r.group.id;null==(n=this._instance.persistence)||n.unregister(X+a),null==(s=this._instance.persistence)||s.unregister(Y+a),null==(o=this._instance.persistence)||o.unregister(tt+a)}}updateActiveTriggers(t){var e=[];for(var i of this.Pt){var r=i.group,n=r.id,s="trigger_activated"===i.triggerStatus(t),o=!0===this.Ft.get(n);s&&e.push({id:n,name:r.name,matched:!0,sampled:o})}this._instance.register_for_session({[Wt]:e})}hasPendingTriggers(t){for(var e of this.Pt)if("trigger_pending"===e.triggerStatus(t))return!0;return!1}getPendingTriggerConditions(t){return this.Pt.flatMap(e=>"trigger_pending"!==e.triggerStatusNoSideEffects(t)?[]:e.getPendingTriggerConditions(t).map(t=>'trigger group "'+e.group.name+'": '+t))}stop(){var t;null==(t=this.Ot)||t.call(this),this.Ot=void 0,this.Pt.forEach(t=>t.stop()),this.Pt=[],this.Ft.clear(),this.Y.stop()}jt(t,e){var i=t.group.conditions.properties;return!i||0===i.length||wa(i,e,this._instance.get_property(vt))}qt(t){var e=this;this.Pt.forEach(t=>t.stop()),this.Pt=[],this.Ft.clear();var i=function(t){var i=new vo(e._instance,t,(i,r)=>{e.Tt("linked_flag_matched",{flag:i,variant:r,group_id:t.id,group_name:t.name}),e.Rt()});e.Pt.push(i)};for(var r of t)i(r)}},Ma=t=>{if(h){try{for(var e=t+"=",i=h.cookie.split(";").filter(t=>t.length),r=0;i.length>r;r++){for(var n=i[r];" "==n.charAt(0);)n=n.substring(1,n.length);if(0===n.indexOf(e))return decodeURIComponent(n.substring(e.length,n.length))}}catch(t){}return null}},Ia=["gclid","gclsrc","dclid","gbraid","wbraid","fbclid","msclkid","twclid","li_fat_id","igshid","ttclid","rdt_cid","epik","qclid","sccid","irclid","_kx"],Ea=["utm_source","utm_medium","utm_campaign","utm_content","utm_term","gad_source","mc_cid",...Ia],Ra="<masked>",Aa=["li_fat_id"];function Pa(t,e,i){if(!h)return{};var r,n=e?[...Ia,...i||[]]:[],s=Fa(Hn(h.URL,n,Ra),t);return In((r={},Mn(Aa,function(t){var e=Ma(t);r[t]=e||null}),r),s)}function Fa(t,e){var i=Ea.concat(e||[]),r={};return Mn(i,function(e){var i=Bn(t,e);r[e]=i||null}),r}function Oa(t){var e=function(t){return t?0===t.search("https?://(.*)google.([^/?]*)")?"google":0===t.search("https?://(.*)bing.com")?"bing":0===t.search("https?://(.*)yahoo.com")?"yahoo":0===t.search("https?://(.*)duckduckgo.com")?"duckduckgo":null:null}(t),i="yahoo"!=e?"q":"p",r={};if(!Ae(e)){r.$search_engine=e;var n=h?Bn(h.referrer,i):"";n.length&&(r.ph_keyword=n)}return r}function $a(){return navigator.language||navigator.userLanguage}var Da="$direct";function La(){return(null==h?void 0:h.referrer)||Da}function Na(t,e,i){var r;void 0===i&&(i=!1);var n=t?[...Ia,...e||[]]:[],s=null==(r=i?ar(null==d?void 0:d.href):null==d?void 0:d.href)?void 0:r.substring(0,1e3);return{r:La().substring(0,1e3),u:s?Hn(s,n,Ra):void 0}}function qa(t,e){var i;void 0===e&&(e=!1);var r=t.r,n=t.u,s=e?ar(n):n,o={$referrer:r,$referring_domain:null==r?void 0:r==Da?Da:null==(i=qn(r))?void 0:i.host};if(s){o.$current_url=s;var a=qn(s);o.$host=null==a?void 0:a.host,o.$pathname=null==a?void 0:a.pathname,In(o,Fa(s))}return r&&In(o,Oa(r)),o}function ja(){try{return Intl.DateTimeFormat().resolvedOptions().timeZone}catch(t){return}}function Ba(){try{return(new Date).getTimezoneOffset()}catch(t){return}}var Ha=1e5,za=/^[A-Za-z0-9]*[A-Za-z][A-Za-z0-9]*$/,Ua=[],Wa=()=>!1,Va="@type @id 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(" "),Ga="Action BorrowAction ReadAction SearchAction SeekToAction SolveMathAction WatchAction".split(" "),Za="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(" "),Ja="Accommodation AdministrativeArea Country Place State".split(" "),Qa={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:Ga,publisher:Za},Event:{startDate:!0,endDate:!0,previousStartDate:!0,aggregateRating:["AggregateRating"],offers:["AggregateOffer","Offer"]},ItemList:{itemListElement:["ListItem"]},ListItem:{item:Ua},Offer:{seller:Za},Organization:{name:!0,legalName:!0,foundingDate:!0,dissolutionDate:!0,aggregateRating:["AggregateRating"],brand:["Brand"]},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:Za,offers:["Offer","AggregateOffer"],aggregateRating:["AggregateRating"]},Service:{name:!0,serviceType:!0,category:!0,provider:Za,areaServed:Ja,offers:["AggregateOffer","Offer"],aggregateRating:["AggregateRating"]},OfferCatalog:{name:!0,itemListElement:Ua}},Ka=[["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(" "),Qa.CreativeWork],["BroadcastEvent BusinessEvent EducationEvent Festival MusicEvent SportsEvent TheaterEvent".split(" "),Qa.Event],[Za,Qa.Organization],[Ja,Qa.Place],["Car IndividualProduct ProductGroup ProductModel".split(" "),Qa.Product]];function Xa(t,e){return ke.call(t,e)?t[e]:void 0}function Ya(t){var e=typeof t;return Ae(t)||"string"===e||"number"===e||"boolean"===e}function tl(t){return Ya(t)||xe(t)&&t.every(Ya)?t:void 0}function el(t,e){if("string"==typeof t){var i=t.trim(),r=i.indexOf("#"),n=0>r?i:i.slice(r+1);if(!(!n||0>r&&(/^[a-z][a-z\d+.-]*:/i.test(i)||i.includes("/")||i.includes("?"))))try{return e(n)?n:void 0}catch(t){return}}}function il(t){if(ke.call(Qa,t))return Qa[t];for(var e of Ka){var i=e[1];if(e[0].includes(t))return i}}function rl(t,e,i){Object.defineProperty(t,e,{configurable:!0,enumerable:!0,value:i,writable:!0})}function nl(t,e,i,r){if(xe(t)){var n=t.map(t=>nl(t,e,i,r)).filter(t=>!Ie(t));return n.length?n:void 0}return sl(t,e,i,r)||void 0}function sl(t,e,i,r){if(!Te(t)||!function(t){return t.remainingNodes?(t.remainingNodes--,!0):(t.exceeded=!0,!1)}(i))return null;var n=Xa(t,"@type"),s=function(t){var e=new Set,i="string"==typeof t?[t]:xe(t)?t:[],r=[];for(var n of i)if("string"==typeof n){var s=n.replace(/^https?:\/\/schema\.org\//,"");if(100>=s.length&&za.test(s)&&!e.has(s)&&(e.add(s),r.push(s),20===r.length))break}return r}(n),o=s.filter(t=>!!il(t)&&(!r||!r.length||r.includes(t))),a={};for(var l of Va){var u="@type"===l?s.length?"string"==typeof n?s[0]:s:void 0:"@id"===l?el(Xa(t,l),e):tl(Xa(t,l));Ie(u)||rl(a,l,u)}for(var h of o){var d=il(h);for(var v of Object.keys(d)){var c=Xa(t,v),f=d[v];if(!0===f){var p=tl(c);Ie(p)||rl(a,v,p)}else{var g=nl(c,e,i,f);Ie(g)||rl(a,v,g)}}}var m=nl(Xa(t,"@graph"),e,i);return Ie(m)||rl(a,"@graph",m),Object.keys(a).length?a:null}function ol(t,e,i){if(!Te(t))return null;var r=Xa(t,"@context");if("string"!=typeof r||!/^https?:\/\/schema\.org\/?$/.test(r))return null;var s=sl(t,e,i);return s?n({"@context":"https://schema.org"},s):null}function al(t){var e;return"SCRIPT"===t.nodeName&&"application/ld+json"===(null==(e=t.getAttribute("type"))?void 0:e.trim().toLowerCase())}function ll(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 ul(t,e,i){for(var r=t;r;){if(ll(r,e,i))return!0;var n=r.parentNode;r=r.parentElement||(n&&n.nodeType===n.DOCUMENT_FRAGMENT_NODE?n.host:null)}return!1}function hl(t){return al(t)?[t]:t.nodeType!==t.ELEMENT_NODE?[]:Array.from(t.querySelectorAll("script")).filter(al)}function dl(t){return Ie(t)?void 0:Math.round(t)}function vl(t){return Te(t)?t.network_timing:t}var cl,fl,pl=Cn("[SessionRecording]"),gl=[1,2,3,4,5,6,7,12],ml=t=>({rrwebMethod:t,enqueuedAt:Date.now(),attempt:1});function yl(){var t;return null==b||null==(t=b.__PosthogExtensions__)?void 0:t.rrweb}function bl(){var t;return null==(t=yl())?void 0:t.record}function _l(t){try{return JSON.stringify(t)}catch(e){return JSON.stringify(t,po())}}function wl(t){return Yo(Ko(Xo(_l(t))),!0)}function kl(t){return Sl.apply(this,arguments)}function Sl(){return(Sl=o(function*(t){var e=yield Yr(_l(t),ea.DEBUG,{rethrow:!0});return Yo(new Uint8Array(yield e.arrayBuffer()),!0)})).apply(this,arguments)}var xl="undefined"!=typeof globalThis&&"CompressionStream"in globalThis&&"TextEncoder"in globalThis&&"Response"in globalThis&&"function"==typeof Response.prototype.blob,Cl=!1;function Tl(t){return xe(t)&&0===t.length?cl=null!=cl?cl:wl([]):wl(t)}function Ml(t){return Il.apply(this,arguments)}function Il(){return(Il=o(function*(t){return xe(t)&&0===t.length?cl||(fl=null!=fl?fl:kl([]).then(t=>(cl=t,t)).catch(t=>{throw cl=void 0,fl=void 0,t})):kl(t)})).apply(this,arguments)}function El(t){return xl&&!Cl&&function(t){return 2===t.type||3===t.type&&(0===t.data.source||8===t.data.source)}(t)}function Rl(t){return{event:t,size:mo(t)}}function Al(t,e){return n({},t,{data:e,cv:"2024-10"})}function Pl(t,e){return n({},t,{cv:"2024-10",data:n({},t.data,e)})}function Fl(t){try{if(2===t.type)return Rl(Al(t,wl(t.data)));if(3===t.type&&0===t.data.source)return Rl(Pl(t,{texts:Tl(t.data.texts),attributes:Tl(t.data.attributes),removes:Tl(t.data.removes),adds:Tl(t.data.adds)}));if(3===t.type&&8===t.data.source)return Rl(Pl(t,{adds:t.data.adds?wl(t.data.adds):void 0,removes:t.data.removes?wl(t.data.removes):void 0}))}catch(t){pl.error("could not compress event - will use uncompressed event",t)}return{event:t,size:go(t)}}function Ol(){return Ol=o(function*(t){try{if(2===t.type)return Rl(Al(t,yield kl(t.data)));if(3===t.type&&0===t.data.source){var e=yield Promise.all([Ml(t.data.texts),Ml(t.data.attributes),Ml(t.data.removes),Ml(t.data.adds)]);return Rl(Pl(t,{texts:e[0],attributes:e[1],removes:e[2],adds:e[3]}))}if(3===t.type&&8===t.data.source){var i=yield Promise.all([t.data.adds?kl(t.data.adds):void 0,t.data.removes?kl(t.data.removes):void 0]);return Rl(Pl(t,{adds:i[0],removes:i[1]}))}}catch(e){return Qr(e)&&(Cl=!0),pl.error("could not compress event asynchronously - trying synchronous compression",e),Fl(t)}return{event:t,size:go(t)}}),Ol.apply(this,arguments)}function $l(t,e){return 5===t.type&&t.data.tag===e}function Dl(t){return $l(t,"sessionIdle")}function Ll(t){return $l(t,"$session_ending")}function Nl(t){return $l(t,"$session_starting")}var ql=class{get sessionId(){return this.Bt}get Ht(){if(!this._instance.sessionManager)throw new Error("[SessionRecording] must be started with a valid sessionManager.");return this._instance.sessionManager}get $t(){return this._instance.config.session_recording.session_idle_threshold_ms||3e5}get Ut(){return xa(this._instance.get_property(Z),this.sessionId)}get At(){var t,e=null==(t=this.zt)?void 0:t.sampleRate;return Fe(e)?e:null}get Wt(){var t,e;return null!==(t=null==(e=this.Vt)?void 0:e.getMinimumDuration(this.sessionId))&&void 0!==t?t:null}constructor(t,e){this._instance=t,this.Zt="/s/",this._forceAllowLocalhostNetworkCapture=!1,this.Gt=void 0,this.Qt=!1,this.Jt=Date.now(),this.Kt=!1,this.Xt=[],this.Yt="unknown",this.te=0,this.ee=0,this.re=0,this.ie=0,this.ne=!1,this.oe=!1,this.ae=!1,this.se=!1,this.ue=!1,this.le=!1,this.he=!1,this.ce=!1,this.de=!1,this.ve=!1,this.fe=!1,this.pe=!1,this.ge=[],this.me=void 0,this.ye=void 0,this.be=[],this.we=0,this.ke=0,this._e=!1,this.Se=void 0,this.Ot=void 0,this.xe=void 0,this.Ce=void 0,this.Me=void 0,this.Te=(t,e,i)=>{var r,n,s,o;if(i&&(t!==this.Bt||e!==this.Ie)){var a=!i.noSessionId&&(i.activityTimeout||i.sessionPastMaximumLength),l=this.Bt,u=this.Ie;if(a&&this.Dt("$session_ending",{currentSessionId:l,currentWindowId:u,nextSessionId:t,nextWindowId:e,changeReason:i,lastActivityTimestamp:this.Jt,flushed_size:null==(r=this.Re)?void 0:r.currentTrackedSize(l)}),null==(n=this._instance.persistence)||n.unregister(et),this.he=!1,null==(s=yl())||null==s.resetMaxDepthState||s.resetMaxDepthState(),this.Dt("$session_id_change",{sessionId:t,windowId:e,changeReason:i}),this.Ae(),!(!1===this.Yt&&this.isStarted||this.Bt===t&&this.Ie===e)){var h=this.Bt!==t&&!1!==this.Yt;this.Yt="unknown",this.Ee(h)}a&&this.Dt("$session_starting",{previousSessionId:l,previousWindowId:u,nextSessionId:t,nextWindowId:e,changeReason:i,lastActivityTimestamp:this.Jt}),null==(o=this.Vt)||o.makeSamplingDecisions(t)}},this.Le=!1,this.Oe=()=>{var t;return(null==(t=this._instance.persistence)?void 0:t.props[J])===this.Bt},this.De=()=>{var t,e;if(0===this.Pe.data.length)return null;var i=null==(t=this.Pe.data[0])?void 0:t.timestamp,r=null==(e=this.Pe.data[this.Pe.data.length-1])?void 0:e.timestamp;return Fe(i)&&Fe(r)?r-i:null},this.Fe=()=>{var t,e,i=this.Wt;if(!Fe(i))return!1;if(null===(t=null==(e=this._instance.config.session_recording)?void 0:e.strictMinimumDuration)||void 0===t||!t){var r=this.Ne;return Fe(r)&&r>=0&&i>r}if(this.Oe())return!1;var n,s=this.De();return!!Ae(s)||i>s||(null==(n=this._instance.persistence)||n.register({[J]:this.Bt}),!1)},this.qe=()=>{"buffering"!==this.status?(this.ne&&this.oe&&this.je&&!this.ae&&this.Be(void 0),this.He(),this.$e()):this.Ue()},this.ze=()=>{this.qe()},this.We=()=>{this.Dt("browser offline",{})},this.Ve=()=>{this.Dt("browser online",{})},this.Ze=()=>{null!=h&&h.visibilityState&&("visible"===h.visibilityState&&(this.je=!0),this.Dt("window "+h.visibilityState,{}))},this.je=null==e||e;var i=this.Ht.checkAndGetSessionAndWindowId(),r=i.windowId;this.Bt=i.sessionId,this.Ie=r,this.et=new uo(this._instance),this.Y=new lo(this._instance),this.tt=new ho(this._instance),this.Pe=this.Ue(),this.Ht.sessionTimeoutMs>this.$t||pl.warn("session_idle_threshold_ms ("+this.$t+") is greater than the session timeout ("+this.Ht.sessionTimeoutMs+"). Session will never be detected as idle"),this.Re=new ia(this._instance)}setDocumentWasEverVisible(t){t&&(this.je=!0)}get Ge(){var t,e,i,r,n,s,o,a,l,u=null==(t=this.zt)?void 0:t.masking,h={maskAllInputs:null==(e=this._instance.config.session_recording)?void 0:e.maskAllInputs,maskTextSelector:null==(i=this._instance.config.session_recording)?void 0:i.maskTextSelector,blockSelector:null==(r=this._instance.config.session_recording)?void 0:r.blockSelector,maskAllElementAttributes:null==(n=this._instance.config.session_recording)?void 0:n.maskAllElementAttributes},d=null!==(s=null==h?void 0:h.maskAllInputs)&&void 0!==s?s:null==u?void 0:u.maskAllInputs,v=null!==(o=null==h?void 0:h.maskTextSelector)&&void 0!==o?o:null==u?void 0:u.maskTextSelector,c=null!==(a=null==h?void 0:h.blockSelector)&&void 0!==a?a:null==u?void 0:u.blockSelector,f=null!==(l=null==h?void 0:h.maskAllElementAttributes)&&void 0!==l?l:null==u?void 0:u.maskAllElementAttributes;return Ie(d)&&Ie(v)&&Ie(c)&&Ie(f)?void 0:{maskAllInputs:null==d||d,maskTextSelector:v,blockSelector:c,maskAllElementAttributes:f}}Qe(){var t;if(!this.de){var e=null==(t=this.zt)?void 0:t.masking;if(!Pe(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!Ie(r)&&r!==n});0!==r.length&&(this.de=!0,pl.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 Je(){var t;return Ge(null==(t=this._instance.config.session_recording.canvasCapture)?void 0:t.resolutionScale,.1,1,Cn("canvas recording resolution scale"),1)}get Ke(){var t,e,i,r,n,s,o,a=this._instance.config.session_recording.captureCanvas,l=null==(t=this.zt)?void 0:t.canvasRecording,u=null!==(e=null!==(i=null==a?void 0:a.recordCanvas)&&void 0!==i?i:null==l?void 0:l.enabled)&&void 0!==e&&e,h=null!==(r=null!==(n=null==a?void 0:a.canvasFps)&&void 0!==n?n:null==l?void 0:l.fps)&&void 0!==r?r:4,d=null!==(s=null!==(o=null==a?void 0:a.canvasQuality)&&void 0!==o?o:null==l?void 0:l.quality)&&void 0!==s?s:.4;if("string"==typeof d){var v=parseFloat(d);d=isNaN(v)?.4:v}return{enabled:u,fps:Ge(h,0,12,Cn("canvas recording fps"),4),quality:Ge(d,0,1,Cn("canvas recording quality"),.4)}}get Xe(){var t,e,i=!(null==(t=this.zt)||!t.consoleLogRecordingEnabled);return null!==(e=this._instance.config.enable_recording_console_log)&&void 0!==e?e:i}get Ye(){var t,e,i,r=null==(t=this.zt)?void 0:t.networkPayloadCapture,n={recordHeaders:null==(e=this._instance.config.session_recording)?void 0:e.recordHeaders,recordBody:null==(i=this._instance.config.session_recording)?void 0:i.recordBody},s=(null==n?void 0:n.recordHeaders)||(null==r?void 0:r.recordHeaders),o=(null==n?void 0:n.recordBody)||(null==r?void 0:r.recordBody),a=vl(this._instance.config.capture_performance),l=vl(null==r?void 0:r.capturePerformance),u=!!($e(a)?a:l);return s||o||u?{recordHeaders:s,recordBody:o,recordPerformance:u}:void 0}tr(){var t,e,i=[],r=null==(t=b.__PosthogExtensions__)||null==(t=t.rrwebPlugins)?void 0:t.getRecordConsolePlugin;r&&this.Xe&&i.push(r());var s=null==(e=b.__PosthogExtensions__)||null==(e=e.rrwebPlugins)?void 0:e.getRecordNetworkPlugin;if(this.Ye&&Ce(s))if(!Ln.includes(d.hostname)||this._forceAllowLocalhostNetworkCapture){var o=Ce(this._instance.requestRouter.isIngestionEndpoint)?this._instance.requestRouter.isIngestionEndpoint.bind(this._instance.requestRouter):void 0;i.push(s(((t,e,i)=>{var r,s={payloadSizeLimitBytes:$s.payloadSizeLimitBytes,performanceEntryTypeToObserve:[...$s.performanceEntryTypeToObserve],payloadHostDenyList:[...e.payloadHostDenyList||[],...$s.payloadHostDenyList]},o=!1!==t.session_recording.recordHeaders&&e.recordHeaders,a=!1!==t.session_recording.recordBody&&e.recordBody,l=!1!==t.capture_performance&&e.recordPerformance,u=(r=Os(s),t=>(null!=t&&t.requestBody&&(t.requestBody=Bs(t.requestBody,t.requestHeaders,r,"Request")),null!=t&&t.responseBody&&(t.responseBody=Bs(t.responseBody,t.responseHeaders,r,"Response")),t)),h=e=>{return u(((t,e,i)=>{var r;if(null==i||!i(t.name)){var n=qn(t.name),s=0===e.indexOf("http")?null==(r=qn(e))?void 0:r.pathname:e;"/"===s&&(s="");var o=null==n?void 0:n.pathname.replace(s||"","");if(!(n&&o&&js.some(t=>0===o.indexOf(t))))return t}})((qs((r=e).requestHeaders),qs(r.responseHeaders),r),t.api_host,i));var r},d=Ce(t.session_recording.maskNetworkRequestFn);return d&&Ce(t.session_recording.maskCapturedNetworkRequestFn)&&xn.warn("Both `maskNetworkRequestFn` and `maskCapturedNetworkRequestFn` are defined. `maskNetworkRequestFn` will be ignored."),d&&(t.session_recording.maskCapturedNetworkRequestFn=e=>{var i=t.session_recording.maskNetworkRequestFn({url:e.name});return!i&&e.isInitial?i:n({},e,{name:null==i?void 0:i.url})}),s.maskRequestFn=Ce(t.session_recording.maskCapturedNetworkRequestFn)?e=>{var i=h(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 Pe(n)&&r?(zs.add(r),r):null!=n?n:void 0}}:t=>function(t){if(!Ie(t))return t.requestBody=Hs(t.requestBody,"Request"),t.responseBody=Hs(t.responseBody,"Response"),t}(h(t)),n({},$s,s,{recordHeaders:o,recordBody:a,recordPerformance:l,recordInitialRequests:l,streamNetworkBody:!0===t.session_recording.streamNetworkBody})})(this._instance.config,this.Ye,o)))}else pl.info("NetworkCapture not started because we are on localhost.");return i}er(t){return this._instance.config.disable_capture_url_hashes?ar(t):t}rr(t,e){void 0===e&&(e=!1);var i=e?ar(t):this.er(t),r=this._instance.config.mask_personal_data_properties?[...Ia,...this._instance.config.custom_personal_data_properties||[]]:[];return this.ir(Hn(i,r,Ra))}ir(t){var e,i=this._instance.config.session_recording;if(i.maskCapturedNetworkRequestFn){var r,n=i.maskCapturedNetworkRequestFn({name:t});return null!==(r=null==n?void 0:n.name)&&void 0!==r?r:null==n?void 0:n.url}return i.maskNetworkRequestFn?null==(e=i.maskNetworkRequestFn({url:t}))?void 0:e.url:t}nr(t){try{return t.rrwebMethod(),!0}catch(e){return 10>this.Xt.length?this.Xt.push({enqueuedAt:t.enqueuedAt||Date.now(),attempt:t.attempt+1,rrwebMethod:t.rrwebMethod}):pl.warn("could not emit queued rrweb event.",e,t),!1}}Dt(t,e){return this.nr(ml(()=>bl().addCustomEvent(t,e)))}ar(){var t;return this.Qt&&!0===(null==(t=this._instance.config.session_recording)?void 0:t.captureJsonLd)&&!this.Y.urlBlocked&&!0!==this.Yt}sr(t){if(!this.ar())return!1;try{var e=bl();return!!e&&(e.addCustomEvent("$json_ld",t),this.ar())}catch(t){return!1}}ur(t){void 0===t&&(t=!1),Promise.resolve().then(()=>{var e;return null==(e=this.lr)?void 0:e.scan(t)})}hr(){try{if(this._instance.config.capture_pageview||!a)return;var t=new URL(a.location.href),e=this.rr(t.origin+t.pathname+t.search);this.cr!==e&&(this.cr=e,this.Dt("$url_changed",{href:e}))}catch(t){}}dr(){if(this.Xt.length){var t=[...this.Xt];this.Xt=[],t.forEach(t=>{Date.now()-t.enqueuedAt>2e3||this.nr(t)})}}It(){return this.nr(ml(()=>bl().takeFullSnapshot()))}get vr(){var t,e,i;if(null!=(t=this.Vt)&&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 Fe(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}pr(){if(this.gr&&clearInterval(this.gr),!0!==this.Yt){var t=this.vr;t&&(this.gr=setInterval(()=>{this.It()},t))}}Rt(t){"event"===t&&this.mr(),!this.Y.urlBlocked&&["sampled","active"].includes(this.status)&&this.pr()}yr(){var t;this.Y.urlBlocked||(this.Y.urlBlocked=!0,null==(t=this.lr)||t.scan(),clearInterval(this.gr),pl.info("recording paused due to URL blocker"),this.Dt("recording paused",{reason:"url blocker"}))}br(){var t;this.Y.urlBlocked&&(null==(t=this.lr)||t.scan(),this.Y.urlBlocked=!1,this.It(),this.ur(),this.pr(),this.Dt("recording resumed",{reason:"left blocked url"}),pl.info("recording resumed"))}wr(t,e){var i;if("event"===t&&this.mr(),!this.Kt&&null!=(i=this.Vt)&&i.hasPendingTriggers(this.sessionId)){this.Kt=!0;try{var r,n,s="url"===t?Q:K;null==(r=this._instance.persistence)||r.register({[s]:this.sessionId}),null==(n=this.Vt)||n.updateActiveTriggers(this.sessionId),this.Rt(),this.$e(),this.Tt(t+"_trigger_matched",{["url"===t?"matchedUrl":"matchedEvent"]:e})}finally{this.Kt=!1}}}get isStarted(){return!!this.Gt}get zt(){var t=this._instance.get_property(j);if(t){var e;try{e=Te(t)?t:JSON.parse(t)}catch(t){return void pl.warn("persisted remote config for session recording is invalid and will be ignored",t)}if(!this.isStarted&&!this.Le){var i,r,n=null!==(i=e.cache_timestamp)&&void 0!==i?i:Date.now();if(Date.now()-n>36e5)return pl.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(j))}return e}}kr(t,e,i){this._instance.get_property(t)&&(e(),i())}start(t){var e,i,r=this.zt;if(r){if(!this.isStarted){var n=!1!==this.Yt&&!this.se;this.Be(n?"no_interaction_since_recording_started":void 0),this.se=!1,this.oe=n,this.ae=!1}this._e&&(this._r(),this.Ue());var s=this.Ht.checkAndGetSessionAndWindowId(),o=s.windowId;this.Bt=s.sessionId,this.Ie=o,null==(e=this._instance.persistence)||e.unregister(et),null!=r&&r.endpoint&&(this.Zt=null==r?void 0:r.endpoint),this.Vt=2===(null==r?void 0:r.version)&&null!=r&&r.triggerGroups&&r.triggerGroups.length>0?new Ta(this._instance,this.Y,this.Tt.bind(this),this.Dt.bind(this),this.Rt.bind(this)):new Ca(this._instance,this.Y,this.tt,this.et,this.Tt.bind(this),this.It.bind(this),this.Rt.bind(this)),this.Vt.onRemoteConfig(r),null==(i=this.Ot)||i.call(this),this.Ot=this.Vt.setupEventTriggerListeners(this._instance.on.bind(this._instance,"eventCaptured"),this.sessionId,(t,e)=>this.wr(t,e)),this.kr(z,()=>{this.overrideSampling()},()=>{var t;return null==(t=this._instance.persistence)?void 0:t.unregister(z)}),this.kr(U,()=>{this.overrideLinkedFlag()},()=>{var t;return null==(t=this._instance.persistence)?void 0:t.unregister(U)}),this.kr(V,()=>{this.overrideTrigger("event")},()=>{var t;return null==(t=this._instance.persistence)?void 0:t.unregister(V)}),this.kr(W,()=>{this.overrideTrigger("url")},()=>{var t;return null==(t=this._instance.persistence)?void 0:t.unregister(W)}),this.Vt.makeSamplingDecisions(this.sessionId),this.Sr(),this.ue||($n(a,"beforeunload",this.qe),$n(a,"pagehide",this.ze),$n(a,"offline",this.We),$n(a,"online",this.Ve),$n(h,"visibilitychange",this.Ze),!this.xe&&Ce(this.Ht.onSessionId)&&(this.xe=this.Ht.onSessionId(this.Te)),!this.Ce&&Ce(this.Ht.on)?this.Ce=this.Ht.on("forcedIdleReset",()=>{this.Ae(),this.Yt="unknown",this.stop(),this.Me=this.Ht.onSessionId((t,e,i)=>{var r;null==(r=this.Me)||r.call(this),this.Me=void 0,this.Te(t,e,i)})}):Ce(this.Ht.on)||pl.warn("bundled core has no SessionIdManager.on (requires posthog-js >= 1.268.6); recording will start but skip forced-idle-reset handling"),Pe(this.Se)&&(this.Se=this._instance.on("eventCaptured",t=>{try{if("$pageview"===t.event){var e=null!=t&&t.properties.$current_url?this.rr(t.properties.$current_url):"";if(!e)return;this.Dt("$pageview",{href:e})}}catch(t){pl.error("Could not add $pageview to rrweb session",t)}})),"active"===this.status&&this.Tt(t||"recording_initialized"))}else pl.info("remote config must be stored in persistence before recording can start")}Cr(){var t,e,i,r,n,s;null==a||a.removeEventListener("beforeunload",this.qe),null==a||a.removeEventListener("pagehide",this.ze),null==a||a.removeEventListener("offline",this.We),null==a||a.removeEventListener("online",this.Ve),null==h||h.removeEventListener("visibilitychange",this.Ze),clearInterval(this.gr),this.Mr(),null==(t=this.Se)||t.call(this),this.Se=void 0,null==(e=this.Ot)||e.call(this),this.Ot=void 0,null==(i=this.xe)||i.call(this),this.xe=void 0,null==(r=this.Ce)||r.call(this),this.Ce=void 0,null==(n=this.Me)||n.call(this),this.Me=void 0,null==(s=this.Vt)||s.stop(),this.Tr(),this._r()}_r(){this.ke+=1,this.be=[],this.we=0,this.Ir=void 0,this._e=!1}Tr(){var t,e,i;null==(t=this.Rr)||t.stop(),this.Xt=[],null==(e=this.lr)||e.stop(),this.lr=void 0,this.Qt=!1,null==(i=this.Gt)||i.call(this),this.Gt=void 0}Ar(){if(!this.Ir||0===this.we)return!1;if(this._e)return!0;this._e=!0,this.Er=void 0;var t=this.ke;return this.Mr(),this.Tr(),this.Ir.catch(()=>{}).then(()=>{t===this.ke&&(this._e=!1,this.$e(),this.Ue(),this.Lr(),this.Cr(),pl.info("stopped"))}).catch(()=>{this._e=!1,this.Lr(),this.Cr(),pl.info("stopped")}),!0}stop(){if(this.Tr(),this.Le)this.He();else if(this.Ar())return;this.$e(),this.Ue(),this.Lr(),this.Cr(),pl.info("stopped")}Lr(){this.Be(void 0,{preserveLogDedup:this.Le}),this.oe=!1}flushBeforeIdentityReset(){(this.isStarted||this._e)&&(this.He(),this.$e())}Ee(t){this.Le=!0,this.Jt=Date.now();try{var e;this.stop(),this.Or=void 0,this.Dr=void 0,this.ee=0,this.re=0,this.ie=0,null==(e=yl())||null==e.resetSnapshotCostState||e.resetSnapshotCostState(),this.start("session_id_changed")}finally{this.Le=!1}this.Be(t?"no_interaction_since_session_rotated":void 0),this.oe=!1}Be(t,e){var i=(void 0===e?{}:e).preserveLogDedup,r=void 0!==i&&i;if(this.ne=!Ie(t),this.Er=t,Ie(t))r||(this.Pr=void 0);else if(!this.Le){var n=this.sessionId+":"+t;n!==this.Pr&&(this.Pr=n,pl.info("holding buffer: "+t+". nothing is uploaded until the user interacts with the page"))}}mr(){this.isStarted||(this.se=!0),this.ne&&(this.Be(void 0),this.oe=!1,this.ae&&(this.ae=!1,this.It()),this.Fr())}discard(t){var e=(void 0===t?{}:t).discardProducerEvents,i=void 0!==e&&e;this.ne=!0,i&&(this.Ue(),this.Tr()),this.Ue(),this.Cr(),this.Ue(),this.Lr(),pl.info("discarded")}Nr(t,e,i,r,n){var s={$snapshot_bytes:i,$snapshot_data:e,$session_id:r,$window_id:n};"disabled"!==this.status?(this.qr(t,r),this.jr(s)):this.Ue()}Br(){try{this.Hr()}catch(t){this.ce||(this.ce=!0,pl.error("could not track full snapshot cost",t))}}Hr(){var t,e=null==(t=yl())||null==t.getLastSnapshotCost?void 0:t.getLastSnapshotCost();e&&e!==this.Dr&&(this.Dr=e,this.Or&&this.Or.durationMs>=e.durationMs||(this.Or=e),500>e.durationMs||pl.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}))}qr(t,e){2!==t.type?3===t.type&&(Ie(this.me)||this.me===e||this.ye===e||(this.ye=e,pl.info("incremental snapshot for a session with no full snapshot - requesting one",{sessionId:e}),this.It())):this.me=e}$r(t){t.counted&&t.generation===this.ke&&(this.we=Math.max(0,this.we-1)),t.counted=!1,this.be=this.be.filter(e=>e!==t)}Ur(t,e,i){t.processed||t.generation!==this.ke||(t.processed=!0,this.Nr(t.event,e,i,t.targetSessionId,t.targetWindowId))}zr(t){try{var e=t.event,i=go(t.event);if(t.compressionEnabled)try{var r=Fl(t.event);e=r.event,i=r.size}catch(t){pl.error("could not process queued compression event - will use uncompressed event",t)}try{this.Ur(t,e,i)}catch(t){pl.error("could not capture queued compression event",t)}}finally{this.$r(t)}}He(){[...this.be].forEach(t=>{this.zr(t)})}Wr(t,e,i,r){var n=this,s={event:t,compressionEnabled:e,targetSessionId:i,targetWindowId:r,generation:this.ke,processed:!1,counted:!0};this.be.push(s),this.we+=1;var a=function(){var i=o(function*(){try{if(s.processed)return;var i,r;try{var o=e?El(t)?yield function(t){return Ol.apply(this,arguments)}(t):Fl(t):{event:t,size:go(t)};i=o.event,r=o.size}catch(e){pl.error("could not process queued compression event - will use uncompressed event",e),i=t,r=go(t)}n.Ur(s,i,r)}finally{n.$r(s)}});return function(){return i.apply(this,arguments)}}();this.Ir=this.Ir?this.Ir.catch(()=>{}).then(a):a()}onRRwebEmit(t){var e,i,r,n,s,o,a,l,u;if(this._instance.sessionManager&&(this.dr(),t&&Te(t))){if(4===t.type){var h=this.rr(t.data.href);if(this.cr=h,!h)return;t.data.href=h}else this.hr();if(null==(e=this.Vt)||e.checkUrlTriggers(this.sessionId,()=>this.yr(),()=>this.br(),(t,e)=>this.wr(t,e)),!this.Y.urlBlocked||function(t){return 5===t.type&&"recording paused"===t.data.tag}(t)){var d,v,c;2===t.type&&(null!=(d=yl())&&null!=d.wasMaxDepthReached&&d.wasMaxDepthReached()&&(this.he=!0),this.Br(),Promise.resolve().then(()=>this.Br()),this.pr(),null==(v=this.Rr)||v.reset(),null==(c=this._instance.persistence)||c.register_once({[et]:t.timestamp},void 0));var f=2===t.type&&(null==(i=this.Vt)?void 0:i.hasPendingTriggers(this.sessionId));f&&this.Vr();var p=this.Rr?this.Rr.throttleMutations(t):t;if(p){var g=function(t){var e=t;if(e&&Te(e)&&6===e.type&&Te(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),m=function(t){return Ll(t)?t.data.payload:null}(g),y=function(t){return Nl(t)?t.data.payload:null}(g),b=function(t){return Dl(t)?t.data.payload:null}(g);m||y?null!=m&&m.lastActivityTimestamp&&(g.timestamp=m.lastActivityTimestamp):null!=b&&b.sessionId||this.Zr(g),2===t.type&&(this.ge.push([this.Bt,t.timestamp]),this.ge.length>6&&(this.ge=this.ge.slice(-6)));var _=null!==(r=null!==(n=null!==(s=null==m?void 0:m.currentSessionId)&&void 0!==s?s:null==y?void 0:y.nextSessionId)&&void 0!==n?n:null==b?void 0:b.sessionId)&&void 0!==r?r:this.Bt,w=null!==(o=null!==(a=null!==(l=null==m?void 0:m.currentWindowId)&&void 0!==l?l:null==y?void 0:y.nextWindowId)&&void 0!==a?a:null==b?void 0:b.windowId)&&void 0!==o?o:this.Ie;if(!0!==this.Yt||function(t){return Dl(t)||Ll(t)||Nl(t)}(g)){2===g.type&&(this.te=0),b&&(g.timestamp=b.lastActivityTimestamp+b.threshold);var k=this.Qt;this.Qt=!0,f?this.ur(!0):k||this.ur();var S=null===(u=this._instance.config.session_recording.compress_events)||void 0===u||u;if(this.we>0||S&&El(g))this.Wr(g,S,_,w);else{var x=S?Fl(g):{event:g,size:go(g)};this.Nr(g,x.event,x.size,_,w)}}else(function(t){return 2===t.type||4===t.type||3===t.type&&9!==t.data.source})(g)&&this.te++}else!0===this.Yt&&this.te++}}}get status(){return this.Vt?this.Vt.getStatus({instance:this._instance,sessionId:this.sessionId,isSampled:this.Ut,rrwebError:this.ue,urlTriggerMatching:this.Y,eventTriggerMatching:this.tt,linkedFlagMatching:this.et,remoteConfig:this.zt}):Us}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.et.linkedFlagSeen=!0,this.It(),this.mr(),this.Tt("linked_flag_overridden")}overrideSampling(){var t;null==(t=this._instance.persistence)||t.register({[Z]:this.sessionId,[H]:null}),this.It(),this.mr(),this.Tt("sampling_overridden")}overrideTrigger(t){this.wr(t),this.mr()}Gr(){try{var t,e=null==a||null==(t=a.location)?void 0:t.href;if(!e)return;var i=this.rr(e);if(!i)return;return new URL(i).hostname||void 0}catch(t){return}}Mr(){this.Qr&&(clearTimeout(this.Qr),this.Qr=void 0)}Fr(){this.Qr||(this.Qr=setTimeout(()=>{this.$e()},2e3))}Jr(){return this.me!==this.Pe.sessionId&&0!==this.Pe.data.length&&this.Pe.data.every(t=>5===(null==t?void 0:t.type)&&!Ll(t)&&!Nl(t))}Kr(){var t,e;return null!==(t=null==(e=this.Vt)?void 0:e.getPendingTriggerConditions(this.sessionId))&&void 0!==t?t:[]}Xr(t){if("buffering"!==t)return Ie(this.Yr)||this._instance.register_for_session({[Vt]:[]}),void(this.Yr=void 0);var e=this.Kr();if(0===e.length)return Ie(this.Yr)||this._instance.register_for_session({[Vt]:[]}),void(this.Yr=void 0);var i=e.join(", "),r=this.sessionId+":"+i;r!==this.Yr&&(this.Yr=r,this._instance.register_for_session({[Vt]:e}),pl.info("buffering: "+i))}$e(){var t;if(this.Mr(),this.ne)return this.Pe;if(this.Jr())return this.Pe.size>943718.4?this.Ue():this.Pe;var e=this.Pe;null==(t=this.Vt)||t.ensureSamplingDecision(this.sessionId);var i=this.Fe(),r=this.status;if(this.Xr(r),"buffering"===r||"paused"===r||"disabled"===r||i)return this.Fr(),this.Pe;if(this.Pe!==e)return this.Pe;if(e.data.length>0){var n,s=this.Gr();yo(e).forEach(t=>{try{var e;null==(e=this.Re)||e.trackSize(t.sessionId,t.size),this.ti({$snapshot_bytes:t.size,$snapshot_data:t.data,$session_id:t.sessionId,$window_id:t.windowId,$lib:ea.LIB_NAME,$lib_version:ea.LIB_VERSION,$snapshot_host:s})}catch(t){pl.warn("could not capture snapshot chunk - skipping it",t)}}),null==(n=this.Vt)||n.onFlushComplete()}return this.Ue()}jr(t){var e,i=2+((null==(e=this.Pe)?void 0:e.data.length)||0),r=t.$session_id,n=this.Pe.sessionId!==r;if(n||!0!==this.Yt&&!this.ne&&this.Pe.size+t.$snapshot_bytes+i>943718.4){var s=this.Bt;if(this.Pe=this.$e(),this.Bt!==s)return;n&&this.Pe.data.length>0&&(this.Pe=this.Ue()),this.Pe.sessionId=r,this.Pe.windowId=t.$window_id}this.ne&&(this.ae||this.Pe.size+t.$snapshot_bytes+i>943718.4)?this.ae||(this.ae=!0,this.Pe=this.Ue()):(this.Pe.size+=t.$snapshot_bytes,this.Pe.data.push(t.$snapshot_data),this.Pe.sizes.push(t.$snapshot_bytes),!0===this.Yt||this.ne||this.Fr())}ti(t){this._instance.capture("$snapshot",t,{_url:this._instance.requestRouter.endpointFor("api",this.Zt),_noTruncate:!0,_batchKey:"recordings",skip_client_rate_limiting:!0})}get Ne(){var t,e,i=null==(t=this.Pe)?void 0:t.data[(null==(e=this.Pe)?void 0:e.data.length)-1],r=this.Ht.checkAndGetSessionAndWindowId(!0).sessionStartTimestamp;return i?i.timestamp-r:null}Vr(){if(!this.Pe||0===this.Pe.data.length)return this.Ue();for(var t=-1,e=this.Pe.data.length-1;e>=0;e--)if(4===this.Pe.data[e].type){t=e;break}return 0>t?this.Ue():(this.Pe.data=this.Pe.data.slice(t),this.Pe.sizes=this.Pe.sizes.slice(t),this.Pe.size=this.Pe.sizes.reduce((t,e)=>t+e,0),this.Pe)}Ue(){return this.Pe={size:0,data:[],sizes:[],sessionId:this.Bt,windowId:this.Ie},this.Pe}Tt(t,e){this._instance.register_for_session({[Xt]:t}),pl.info(t.replace("_"," "),e),"session_id_changed"!==t&&this.Dt("$recording_started",n({reason:t},e))}ei(t){var e;return 3===t.type&&-1!==gl.indexOf(null==(e=t.data)?void 0:e.source)}Zr(t){var e=this.ei(t);e||!0===this.Yt||t.timestamp-this.Jt>this.$t&&(this.Yt=!0,clearInterval(this.gr),this.Dt("sessionIdle",{eventTimestamp:t.timestamp,lastActivityTimestamp:this.Jt,threshold:this.$t,bufferLength:this.Pe.data.length,bufferSize:this.Pe.size,sessionId:this.Bt,windowId:this.Ie}),this.$e());var i=!1;if(e&&(this.Jt=t.timestamp,this.Yt)){var r="unknown"===this.Yt;this.Yt=!1,r||(this.Dt("sessionNoLongerIdle",{reason:"user activity",type:t.type}),i=!0)}var n=this.Ht.checkAndGetSessionAndWindowId(!e,t.timestamp),s=n.windowId,o=n.sessionId,a=this.Bt!==o,l=this.Ie!==s;if(this.Ie=s,this.Bt=o,a||l){var u=a&&!1!==this.Yt;u&&(this.Yt="unknown"),this.Ee(u)}else if(e&&this.mr(),i){var h,d=["sampled","active"].includes(this.status)||(null==(h=this.Vt)?void 0:h.hasPendingTriggers(this.sessionId));this.te>0&&d&&this.It(),this.ur(),this.pr()}}Ae(){var t;null==(t=this.Vt)||t.clearConditionalRecordingPersistence()}get sdkDebugProperties(){var t,e,i,r,n,s,o,a,l,u=this.Ht.checkAndGetSessionAndWindowId(!0).sessionStartTimestamp,h=null==(t=yl())||null==t.getDeferredStylesheetStats?void 0:t.getDeferredStylesheetStats();return{$recording_status:this.status,$sdk_debug_replay_flush_hold_reason:this.Er,$sdk_debug_replay_internal_buffer_length:this.Pe.data.length,$sdk_debug_replay_internal_buffer_size:this.Pe.size,$sdk_debug_current_session_duration:this.Ne,$sdk_debug_session_start:u,$sdk_debug_replay_flushed_size:null==(e=this.Re)?void 0:e.currentTrackedSize(this.sessionId),$sdk_debug_replay_full_snapshots:this.ge,$snapshot_max_depth_exceeded:this.he,$sdk_debug_replay_slowest_full_snapshot_ms:dl(null==(i=this.Or)?void 0:i.durationMs),$sdk_debug_replay_slowest_full_snapshot_stylesheet_ms:dl(null==(r=this.Or)?void 0:r.stylesheetMs),$sdk_debug_replay_slowest_full_snapshot_nodes:null==(n=this.Or)?void 0:n.nodeCount,$sdk_debug_replay_slowest_full_snapshot_css_rules:null==(s=this.Or)?void 0:s.cssRuleCount,$sdk_debug_replay_slowest_full_snapshot_css_rules_non_deferrable:null==(o=this.Or)?void 0:o.nonDeferrableCssRuleCount,$sdk_debug_replay_deferred_stylesheets:null==h?void 0:h.deferredCount,$sdk_debug_replay_deferred_stylesheets_failed:null==h?void 0:h.failedCount,$sdk_debug_replay_deferred_stylesheets_abandoned:null==h?void 0:h.abandonedCount,$sdk_debug_replay_deferred_stylesheet_ms:dl(null==h?void 0:h.totalMs),$sdk_debug_replay_deferred_stylesheet_slowest_slice_ms:dl(null==h?void 0:h.slowestSliceMs),$sdk_debug_replay_slowest_mutation_batch_ms:dl(null==(a=yl())||null==a.getMutationCost||null==(a=a.getMutationCost())?void 0:a.slowestBatchMs),$sdk_debug_replay_discarded_duration_samples:null==(l=yl())||null==l.getDiscardedDurationSamples?void 0:l.getDiscardedDurationSamples(),$sdk_debug_replay_throttled_mutations_dropped:this.ee,$sdk_debug_replay_oversized_mutations_dropped:this.re,$sdk_debug_replay_oversized_mutation_bytes_dropped:this.ie,$sdk_debug_replay_rrweb_error:this.ue,[Qt]:!!this.Gt,[Kt]:this.le}}Sr(){var t;if(!this.Gt){this.le=!0;var e,i,r,s,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 d=u[0],v=u[1];if(d in o)if("maskInputOptions"===d)o.maskInputOptions=n({password:!0},v);else if("sampling"===d){var c=null!=v?v:{},f={};Ie(c.mousemove)||(f.mousemove=c.mousemove),Ie(c.mouseInteraction)||(f.mouseInteraction=c.mouseInteraction),o.sampling=f}else o[d]=v}!0===(null==l?void 0:l.captureJsonLd)&&!0!==o.slimDOMOptions&&"all"!==o.slimDOMOptions&&(o.slimDOMOptions=n({},o.slimDOMOptions,{script:!0})),this.Ke&&this.Ke.enabled&&(o.recordCanvas=!0,o.sampling=n({},o.sampling,{canvas:this.Ke.fps}),o.dataURLOptions={type:"image/webp",quality:this.Ke.quality},o.canvasResolutionScale=this.Je,o.canvasMasking={configured:()=>{var t;return Ce(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(Ce(i))try{var r;return null!==(r=i(t))&&void 0!==r?r:null}catch(t){return this.fe||(this.fe=!0,pl.warn("canvasCapture.maskRegionsFn threw, canvas frames will be skipped",t)),null}}}),this.Ge&&(o.maskAllInputs=null===(e=this.Ge.maskAllInputs)||void 0===e||e,o.maskTextSelector=null!==(i=this.Ge.maskTextSelector)&&void 0!==i?i:void 0,o.blockSelector=null!==(r=this.Ge.blockSelector)&&void 0!==r?r:void 0,o.maskAllElementAttributes=null!==(s=this.Ge.maskAllElementAttributes)&&void 0!==s&&s),o.maskAllElementAttributes&&o.maskAttributeFn&&(o.maskAttributeFn=void 0,this.ve||(this.ve=!0,pl.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.Qe();var p=bl();if(p){this.Rr=null!==(t=this.Rr)&&void 0!==t?t:new ta(p,{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";pl.info(i,{node:e}),this.log("[SessionRecording] "+i,"warn")},onDroppedAttributeMutations:t=>this.ee+=t,bytesRefillRate:this._instance.config.session_recording.__mutationBytesRefillRate,bytesBucketSize:this._instance.config.session_recording.__mutationBytesBucketSize,resyncIntervalMs:this.vr,onDroppedOversizedMutation:t=>{0===this.re&&this.log("[SessionRecording] Dropped an oversized DOM mutation to keep the recording playable. The recording will resync with a full snapshot.","warn"),this.re+=1,this.ie+=t},requestFullSnapshot:()=>this.It()});var g=this.tr();if(this.Gt=p(n({emit:t=>{this.onRRwebEmit(t)},plugins:g,errorHandler:(t,e)=>"rrweb"===e&&(this.pe||(this.pe=!0,pl.error("rrweb internal error - recording will continue but may be incomplete",t)),!0)},o)),!this.Gt)return this.ue=!0,void pl.error("rrweb failed to start - Loss of recording data is possible. Check the browser console for rrweb errors.");this.ue=!1,!0===(null==l?void 0:l.captureJsonLd)&&h&&null!=a&&a.MutationObserver&&!this.lr&&(this.lr=function(t,e,i){var r=new WeakMap,n=i.getCaptureState||(()=>!0),s=Ha,o=function(t,e){var i=e.attributeFilter;return e.maskAllElementAttributes||e.maskAttributeFn||null!=i&&i.length&&!i.includes("id")?Wa:i=>{var r=t.getElementById(i);return!!r&&"SCRIPT"!==r.nodeName&&(!e.isRecordedElement||e.isRecordedElement(r))&&!ul(r,e.blockClass,e.blockSelector)}}(t,i),a=e=>{try{var a=n();if(!s||!1===a||!e.isConnected||e.ownerDocument!==t||function(t,e){return ul(t,e.blockClass,e.blockSelector)||ul(t,e.maskTextClass,e.maskTextSelector)}(e,i))return;var l=function(t,e){if(void 0===e&&(e=Wa),!t||t.length>Ha)return null;try{var i=JSON.parse(t),r={remainingNodes:2048,exceeded:!1},n=xe(i)?i.map(t=>ol(t,e,r)):ol(i,e,r);if(r.exceeded||Ae(n)||xe(n)&&(!n.length||n.some(Ae)))return null;var s=JSON.stringify(n);return s.length>2e4?null:[n,s]}catch(t){return null}}(e.text,o);if(!l)return void r.delete(e);var u=l[0],h=l[1];if(Ae(a))return void r.set(e,h);if(r.get(e)!==h){if(h.length>s)return void(s=0);i.emit(u)&&(r.set(e,h),s-=h.length)}}catch(t){return}};try{var l=new e(t=>{try{if(!s||!1===n())return;var e=t=>{for(var e of hl(t))a(e)};for(var i of t)if("childList"===i.type)al(i.target)&&a(i.target),i.addedNodes.forEach(e);else if("characterData"===i.type){var r=i.target.parentNode;r&&al(r)&&a(r)}else"attributes"===i.type&&al(i.target)&&a(i.target)}catch(t){return}});return l.observe(t,{attributes:!0,attributeFilter:["type"],characterData:!0,childList:!0,subtree:!0}),{scan(e){void 0===e&&(e=!1),s&&!1!==n()&&hl(t.documentElement).forEach(t=>{e&&r.delete(t),a(t)})},stop(){return l.disconnect()}}}catch(t){return{scan(){},stop(){}}}}(h,a.MutationObserver,{attributeFilter:o.attributeFilter,blockClass:o.blockClass,blockSelector:o.blockSelector,isRecordedElement:t=>p.mirror.getId(t)>0,maskAllElementAttributes:o.maskAllElementAttributes,maskAttributeFn:o.maskAttributeFn,maskTextClass:o.maskTextClass,maskTextSelector:o.maskTextSelector,getCaptureState:()=>{var t;return!0!==(null==(t=this._instance.config.session_recording)?void 0:t.captureJsonLd)||this.Y.urlBlocked||this.Y.isCurrentUrlBlocked()?null:this.ar()},emit:t=>this.sr(t)}),this.Y.isCurrentUrlBlocked()&&this.lr.scan()),this.Jt=Date.now(),this.Yt=$e(this.Yt)?this.Yt:"unknown",this.tryAddCustomEvent("$remote_config_received",this.zt),this.Dt("$session_options",{sessionRecordingOptions:o,activePlugins:g.map(t=>null==t?void 0:t.name)}),this.Dt("$posthog_config",{config:this._instance.config})}else pl.error("_startRecorder was called but rrwebRecord is not available. This indicates something has gone wrong.")}}tryAddCustomEvent(t,e){return this.Dt(t,e)}},jl=function(t){return 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}({}),Bl=function(t){return 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}({}),Hl=function(t){return 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}({}),zl=function(t){return t[t.Mouse=0]="Mouse",t[t.Pen=1]="Pen",t[t.Touch=2]="Touch",t}({}),Ul=function(t){return t[t["2D"]=0]="2D",t[t.WebGL=1]="WebGL",t[t.WebGL2=2]="WebGL2",t}({}),Wl=function(t){return 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}({}),Vl=function(t){return 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}({});function Gl(t,e){return-1!==t.indexOf(e)}"Mobile".toLowerCase(),"Tablet".toLowerCase(),new RegExp("Xbox","i"),new RegExp("Nintendo","i"),new RegExp("PlayStation","i"),new RegExp("Windows","i"),Date,Date;var Zl={Node:["childNodes","parentNode","parentElement","textContent"],ShadowRoot:["host","styleSheets"],Element:["shadowRoot"],MutationObserver:[]},Jl={Node:["contains","getRootNode"],ShadowRoot:["getSelection"],Element:["querySelector","querySelectorAll"],MutationObserver:["constructor"]},Ql={};function Kl(t){if(Ql[t])return Ql[t];var e=function(t){var e,i,r=null===(e=globalThis)||void 0===e||null===(e=e.Zone)||void 0===e||null===(i=e.__symbol__)||void 0===i?void 0:i.call(e,t);return r&&globalThis[r]?globalThis[r]:void 0}(t)||globalThis[t],i=e.prototype,r=t in Zl?Zl[t]:void 0,n=Boolean(r&&r.every(t=>{var e;return Boolean(null===(e=Object.getOwnPropertyDescriptor(i,t))||void 0===e||null===(e=e.get)||void 0===e?void 0:e.toString().includes("[native code]"))})),s=t in Jl?Jl[t]:void 0,o=Boolean(s&&s.every(t=>{var e;return"function"==typeof i[t]&&(null===(e=i[t])||void 0===e?void 0:e.toString().includes("[native code]"))}));if(n&&o)return Ql[t]=e.prototype,e.prototype;var a=document.createElement("iframe");a.style.display="none";var l=!1;try{document.body.appendChild(a);var u=a.contentWindow;if(!u)return e.prototype;var h=u[t].prototype;return h?(function(t){return Gl(t,"AppleWebKit")&&!Gl(t,"Chrome")}(navigator.userAgent)&&(a.classList.add("rr-block","ph-no-capture"),a.setAttribute("__rrwebUntaintedPrototype",t),l=!0),Ql[t]=h):i}catch(t){return i}finally{!l&&a.parentNode&&document.body.removeChild(a)}}var Xl={};function Yl(t,e,i){var r,n=t+"."+String(i);if(Xl[n])return Xl[n].call(e);var s=Kl(t),o=null===(r=Object.getOwnPropertyDescriptor(s,i))||void 0===r?void 0:r.get;return o?(Xl[n]=o,o.call(e)):e[i]}var tu={};function eu(t,e,i){var r=t+"."+String(i);if(tu[r])return tu[r].bind(e);var n=Kl(t)[i];return"function"!=typeof n?e[i]:(tu[r]=n,n.bind(e))}function iu(){return Kl("MutationObserver").constructor}function ru(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],o=i(r);o;){if(o.next===s)return void(o.next=n.next);o=i(r=o.next)}else t[e]=n.next}}catch(t){return()=>{}}}var nu={childNodes:t=>Yl("Node",t,"childNodes"),parentNode:t=>Yl("Node",t,"parentNode"),parentElement:t=>Yl("Node",t,"parentElement"),textContent:t=>Yl("Node",t,"textContent"),contains:(t,e)=>eu("Node",t,"contains")(e),getRootNode:t=>eu("Node",t,"getRootNode")(),host:t=>t&&"host"in t?Yl("ShadowRoot",t,"host"):null,styleSheets:t=>t.styleSheets,shadowRoot:t=>t&&"shadowRoot"in t?Yl("Element",t,"shadowRoot"):null,querySelector:(t,e)=>eu("Element",t,"querySelector")(e),querySelectorAll:(t,e)=>eu("Element",t,"querySelectorAll")(e),mutationObserver:iu,patch:ru};function su(){try{if("undefined"!=typeof performance&&performance.now)return performance.now()}catch(t){}return Date.now()}var ou=0;function au(){ou+=1}function lu(){return ou}function uu(t,e){return(e!==ou||t>6e4)&&!0}var hu=0,du=0,vu=0,cu={durationMs:0,stylesheetMs:0,nodeCount:0,cssRuleCount:0,nonDeferrableCssRuleCount:0,deferredStylesheetCount:0},fu=null,pu=null,gu=[],mu=0,yu=0,bu={slowestBatchMs:0},_u={deferredCount:0,failedCount:0,abandonedCount:0,totalMs:0,slowestSliceMs:0};function wu(t){(hu+=1)>1||(cu={durationMs:0,stylesheetMs:0,nodeCount:0,cssRuleCount:0,nonDeferrableCssRuleCount:0,deferredStylesheetCount:0},gu=[],mu=0,pu=(t=>t&&t>0?t:null)(t),du=su(),vu=ou)}function ku(){return 0===hu?fu||{durationMs:0,stylesheetMs:0,nodeCount:0,cssRuleCount:0,nonDeferrableCssRuleCount:0,deferredStylesheetCount:0}:(hu-=1)>0?cu:(cu.durationMs=su()-du,cu.deferredStylesheetCount=mu,_u.deferredCount+=mu,pu=null,uu(cu.durationMs,vu)?cu:fu=cu)}function Su(t,e,i){var r=t.length;if(i>=32)return r;for(var n=0;t.length>n;n++){var s=t[n];try{var o=s.cssRules;if(o&&o.length)r+=Su(o,e,i+1);else if(e&&s.styleSheet){var a=s.styleSheet;if(!e.has(a)){e.add(a);var l=a.rules||a.cssRules;l&&(r+=Su(l,e,i+1))}}}catch(t){}}return r}function xu(t){if(0!==hu){var e=Su(t,null,0);cu.cssRuleCount+=e,yu>0&&(cu.nonDeferrableCssRuleCount+=e)}}function Cu(t){yu+=1;try{return t()}finally{yu-=1}}function Tu(t){hu>0&&(cu.stylesheetMs+=t)}function Mu(t){if(0===hu||null===pu)return!1;var e=cu.cssRuleCount-cu.nonDeferrableCssRuleCount;return e>=pu||e+function(t){try{var e=t&&(t.rules||t.cssRules);if(!e)return 0;var i=new WeakSet;return i.add(t),Su(e,i,0)}catch(t){return 0}}(t)>pu}function Iu(){_u.failedCount+=1}function Eu(t){t>0&&(_u.abandonedCount+=t)}function Ru(t){return Ru="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Ru(t)}function Au(t,e,i){return(e=function(t){var e=function(t){if("object"!=Ru(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var i=e.call(t,"string");if("object"!=Ru(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==Ru(e)?e:e+""}(e))in t?Object.defineProperty(t,e,{value:i,enumerable:!0,configurable:!0,writable:!0}):t[e]=i,t}function Pu(t){return t.nodeType===t.ELEMENT_NODE}function Fu(t){var e=t&&"host"in t&&"mode"in t&&nu.host(t)||null;return Boolean(e&&"shadowRoot"in e&&nu.shadowRoot(e)===t)}function Ou(t){return"[object ShadowRoot]"==={}.toString.call(t)}function $u(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 Du(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 Lu=0;function Nu(t){var e=0===Lu,i=e?su():0;Lu+=1;try{var r=t.rules||t.cssRules;if(!r)return null;xu(r);var n=t.href;return!n&&t.ownerNode&&(n=t.ownerNode.baseURI),$u(Array.from(r,t=>qu(t,n)).join(""))}catch(t){return null}finally{Lu-=1,e&&Tu(su()-i)}}function qu(t,e){if(Bu(t)){var i;try{i=Nu(t.styleSheet)||Du(t)}catch(e){i=t.cssText}try{var r;if(i&&(null===(r=t.styleSheet)||void 0===r?void 0:r.href))return rh(i,t.styleSheet.href)}catch(t){}return i}var n=t.cssText;return Hu(t)&&t.selectorText.includes(":")&&(n=ju(n)),e?rh(n,e):n}function ju(t){return t.replace(/(\[(?:[\w-]+)[^\\])(:(?:[\w-]+)\])/gm,"$1\\$2")}function Bu(t){return"styleSheet"in t}function Hu(t){return"selectorText"in t}var zu=/^-?[A-Za-z_][\w-]*$/,Uu=/^-?[A-Za-z_][\w-]*(\.-?[A-Za-z_][\w-]*)*$/;function Wu(t){var e=[],i=!1,r=null,n=new Map;function s(t){var n=e.pop();if("group"===n.kind){if(null===t){for(;e.length>0&&"group"===e[e.length-1].kind;)e.pop();return void s(null)}var a=e[e.length-1];return a.parts.push(t),void(a.index+=1)}if(!n.importRule)return i=!0,void(r=t);o(e[e.length-1],n.importRule,t)}function o(t,e,i){try{var r;try{r=i||Du(e)}catch(t){r=e.cssText}try{var n;r&&(null===(n=e.styleSheet)||void 0===n?void 0:n.href)&&(r=rh(r,e.styleSheet.href))}catch(t){}r&&t.parts.push(r),t.index+=1}catch(t){s(null)}}function a(t){var i=t.rules[t.index];if("sheet"===t.kind&&Bu(i)){var r=n.get(i);return null===r?(t.parts.push(i.cssText),void(t.index+=1)):r?void e.push({kind:"sheet",sheet:r.sheet,rules:r.rules,sheetHref:r.sheetHref,index:0,parts:[],importRule:i}):void o(t,i,null)}if(!function(t,i){try{var r=function(t){var e=t;if(!e.cssRules||0===e.cssRules.length)return null;if(e.media&&"string"==typeof e.media.mediaText)return"@media "+e.media.mediaText+" {";if(Hu(t)){if("number"==typeof e.type&&1!==e.type)return null;var i=e.style?e.style.cssText:"";return t.selectorText+" {"+(i?" "+i:"")}if("containerName"in e)return"string"!=typeof e.containerQuery||e.containerName&&!zu.test(e.containerName)?null:"@container "+(e.containerName?e.containerName+" ":"")+e.containerQuery+" {";if("string"==typeof e.conditionText){var r="";try{var n;r=(null===(n=t.constructor)||void 0===n?void 0:n.name)||""}catch(t){return null}return""===r||"Object"===r||"CSSSupportsRule"===r?"@supports "+e.conditionText+" {":null}return"string"==typeof e.name?"keyText"in e.cssRules[0]?zu.test(e.name)?"@keyframes "+e.name+" {":null:""===e.name?"@layer {":Uu.test(e.name)?"@layer "+e.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?rh(r,n):r,fixColons:"sheet"===i.kind&&Hu(t)&&t.selectorText.includes(":")}),!0}catch(t){return!1}}(i,t)){var s=i.cssText;"sheet"===t.kind&&Hu(i)&&i.selectorText.includes(":")&&(s=ju(s)),t.parts.push(t.sheetHref?rh(s,t.sheetHref):s),t.index+=1}}return function(t){try{var i=t.rules||t.cssRules;if(!i)return!1;xu(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,!Bu(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;xu(s);var o=r.href;!o&&r.ownerNode&&(o=r.ownerNode.baseURI);var a=Array.from(s);n.set(e,{sheet:r,rules:a,sheetHref:o}),i.push({sheet:r,rules:a,index:0})}catch(t){}};i.length>0;)r()}(s,t),!0}catch(t){return!1}}(t)||(i=!0),{advance(t){if(i)return!0;var n=su(),o=t>0?t:1;try{for(;!i&&o>0;){var l=e[e.length-1];if(l.rules.length>l.index){o-=1;try{a(l)}catch(t){s(null)}}else{var u=null;try{if("group"===l.kind){var h=l.prelude+l.parts.join("")+"}";u=l.fixColons?ju(h):h}else u=$u(l.parts.join(""))}catch(t){}s(u)}}}catch(t){i=!0,r=null}finally{Tu(su()-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}}}var Vu=class{constructor(){Au(this,"idNodeMap",new Map),Au(this,"nodeMetaMap",new WeakMap)}getId(t){var e,i;return t&&null!==(e=null===(i=this.getMeta(t))||void 0===i?void 0:i.id)&&void 0!==e?e:-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)),Pu(t)){var i=nu.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 Gu(t){var e=t.element,i=t.maskInputOptions,r=t.tagName,n=t.type,s=t.maskInputFn,o=t.value||"",a=n&&Zu(n);return(i[r.toLowerCase()]||a&&i[a])&&(o=s?s(o,e):"*".repeat(o.length)),o}function Zu(t){return t.toLowerCase()}var Ju=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 Qu(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&&Ju.has(Zu(i))?r:"*".repeat(r.length):n?n(i,r,e):r:r}var Ku="__rrweb_original__";function Xu(t){try{var e=t.type;return t.hasAttribute("data-rr-is-password")?"password":e?Zu(e):null}catch(t){return null}}var Yu=/url\((?:(')([^']*)'|(")(.*?)"|([^)]*))\)/gm,th=/^(?:[a-z+]+:)?\/\//i,eh=/^www\..*/i,ih=/^(data:)([^,]*),(.*)/i;function rh(t,e){return(t||"").replace(Yu,(t,i,r,n,s,o)=>{var a,l=r||s||o,u=i||n||"";if(!l)return t;if(th.test(l)||eh.test(l))return"url("+u+l+u+")";if(ih.test(l))return"url("+u+l+u+")";if("/"===l[0])return"url("+u+(((a=e).indexOf("//")>-1?a.split("/").slice(0,3).join("/"):a.split("/")[0]).split("?")[0]+l)+u+")";var h=e.split("/"),d=l.split("/");for(var v of(h.pop(),d))"."!==v&&(".."===v?h.pop():h.push(v));return"url("+u+h.join("/")+u+")"})}var nh,sh,oh=new Map,ah=1,lh=new RegExp("[^a-z0-9-_:]");function uh(){return ah++}var hh=/^[^ \t\n\r\u000c]+/,dh=/^[, \t\n\r\u000c]+/,vh=new WeakMap;function ch(t,e){return e&&""!==e.trim()?fh(t,e):e}function fh(t,e){var i=vh.get(t);if(i||(i=t.createElement("a"),vh.set(t,i)),e){if(e.startsWith("blob:")||e.startsWith("data:"))return e}else e="";return i.setAttribute("href",e),i.href}function ph(t,e){return(null==e?void 0:e.maxBase64ImageLength)?function(t,e){return e&&t.length>e?"data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTAwJSIgaGVpZ2h0PSIxMDAlIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPgogIDxkZWZzPgogICAgPHBhdHRlcm4gaWQ9InN0cmlwZXMiIHBhdHRlcm5Vbml0cz0idXNlclNwYWNlT25Vc2UiIHdpZHRoPSIxNiIgaGVpZ2h0PSIxNiI+CiAgICAgIDxyZWN0IHdpZHRoPSIxNiIgaGVpZ2h0PSIxNiIgZmlsbD0iYmxhY2siLz4KICAgICAgPHBhdGggZD0iTTggMEgxNkwwIDE2VjhMOCAwWiIgZmlsbD0iIzJEMkQyRCIvPgogICAgICA8cGF0aCBkPSJNMTYgOFYxNkg4TDE2IDhaIiBmaWxsPSIjMkQyRDJEIi8+CiAgICA8L3BhdHRlcm4+CiAgPC9kZWZzPgogIDxyZWN0IHdpZHRoPSIxMDAlIiBoZWlnaHQ9IjEwMCUiIGZpbGw9InVybCgjc3RyaXBlcykiLz4KPC9zdmc+Cg==":t}(t,e.maxBase64ImageLength):t}function gh(t,e,i,r,n,s){if(!r)return r;if("src"===i||"href"===i&&("use"!==e||"#"!==r[0])){if("link"===e&&n){var o,a=null===(o=n.sheet)||void 0===o?void 0:o.href;if(a)return a}var l=ch(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(1e5>e.length)return e;if(!t.complete||0===t.naturalWidth)return e;if(t.naturalWidth>4096||t.naturalHeight>4096)return e;var n=oh.get(e);if(n&&n.type===i&&n.quality===r)return n.result;try{var s=document.createElement("canvas");s.width=t.naturalWidth,s.height=t.naturalHeight;var o=s.getContext("2d");if(!o)return e;o.drawImage(t,0,0);var a=s.toDataURL(i||"image/webp",null!=r?r:.4),l=e.length>a.length?a:e;if(oh.size>=10){var u=oh.keys().next().value;void 0!==u&&oh.delete(u)}return oh.set(e,{type:i,quality:r,result:l}),l}catch(t){return e}}(n,l,s.type,s.quality)),ph(u,s)}if("image"===e)return ph(l,s)}return l}if("xlink:href"===i&&"#"!==r[0]){var h=ch(t,r);return"image"===e&&h.startsWith("data:")?ph(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(dh),e.length>i;){var s=r(hh);if(","===s.slice(-1))s=ch(t,s.substring(0,s.length-1)),n.push(s);else{var o="";s=ch(t,s);for(var a=!1;;){var l=e.charAt(i);if(""===l){n.push((s+o).trim());break}if(a)")"===l&&(a=!1);else{if(","===l){i+=1,n.push((s+o).trim());break}"("===l&&(a=!0)}o+=l,i+=1}}}return n.join(", ")}(t,r):"style"===i?rh(r,fh(t)):"object"===e&&"data"===i?ch(t,r):r:ch(t,r)}function mh(t,e,i){return("video"===t||"audio"===t)&&"autoplay"===e}function yh(t,e,i){if(!t)return!1;if(t.nodeType!==t.ELEMENT_NODE)return!!i&&yh(nu.parentNode(t),e,i);for(var r=t.classList.length;r--;)if(e.test(t.classList[r]))return!0;return!!i&&yh(nu.parentNode(t),e,i)}function bh(t,e,i,r){var n;if(Pu(t)){if(!nu.childNodes(n=t).length)return!1}else{if(null===nu.parentElement(t))return!1;n=nu.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(yh(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 _h(t,e,i){var r=t.removeEventListener;"function"==typeof r&&r.call(t,e,i)}var wh=new Map;function kh(t,e){return Array.from(t.styleSheets).find(t=>t.href===e)}function Sh(t){return null==t?"":t.toLowerCase()}var xh=!1,Ch=!1;function Th(t,e){var i=e.doc,r=e.mirror,n=e.blockClass,s=e.blockSelector,o=e.maskTextClass,a=e.maskTextSelector,l=e.skipChild,u=void 0!==l&&l,h=e.inlineStylesheet,d=void 0===h||h,v=e.maskInputOptions,c=void 0===v?{}:v,f=e.maskTextFn,p=e.maskInputFn,g=e.maskAllElementAttributes,m=void 0!==g&&g,y=e.maskAttributeFn,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,I=e.onIframeLoad,E=e.iframeLoadTimeout,R=void 0===E?5e3:E,A=e.onIframeListenerRegistered,P=e.onStylesheetLoad,F=e.stylesheetLoadTimeout,O=void 0===F?5e3:F,D=e.keepIframeSrcFn,L=void 0===D?()=>!1:D,N=e.newlyAddedElement,q=void 0!==N&&N,j=e.depth,B=void 0===j?0:j,H=e.maxDepth,z=void 0===H?50:H,U=e.needsMask,W=e.preserveWhiteSpace,V=void 0===W||W;if(B>=z)return Ch=!0,xh||(xh=!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=bh(t,o,a,void 0===U)),hu>0&&(cu.nodeCount+=1);var G,Z=function(t,e){var i=e.doc,r=e.blockClass,n=e.blockSelector,s=e.needsMask,o=e.inlineStylesheet,a=e.maskInputOptions,l=void 0===a?{}:a,u=e.maskTextFn,h=e.maskInputFn,d=e.maskAllElementAttributes,v=void 0!==d&&d,c=e.maskAttributeFn,f=e.dataURLOptions,p=void 0===f?{}:f,g=e.inlineImages,m=e.recordCanvas,y=e.canvasMaskingConfigured,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:Vl.Document,childNodes:[],compatMode:t.compatMode}:{type:Vl.Document,childNodes:[]};case t.DOCUMENT_TYPE_NODE:return{type:Vl.DocumentType,name:t.name,publicId:t.publicId,systemId:t.systemId,rootId:k};case t.ELEMENT_NODE:return function(t,e){for(var i=e.doc,r=e.inlineStylesheet,n=e.maskInputOptions,s=void 0===n?{}:n,o=e.maskInputFn,a=e.maskAllElementAttributes,l=void 0!==a&&a,u=e.maskAttributeFn,h=e.dataURLOptions,d=void 0===h?{}:h,v=e.inlineImages,c=e.recordCanvas,f=e.canvasMaskingConfigured,p=e.keepIframeSrcFn,g=e.newlyAddedElement,m=void 0!==g&&g,y=e.rootId,b=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),_=function(t){if(t instanceof HTMLFormElement)return"form";var e=Zu(t.tagName);return lh.test(e)?"div":e}(t),w=new Set,k={},S=t.attributes.length,x=0;S>x;x++){var C=t.attributes[x];mh(_,C.name)||(k[C.name]=gh(i,_,Zu(C.name),C.value,t,d))}if("link"===_&&r&&!b){var T=t.sheet;if(!T){var M=function(t){return t.href}(t);M&&!(T=kh(i,M))&&M.includes(".css")&&(T=kh(i,window.location.origin+"/"+M.replace(window.location.href,"")))}var I=null;T&&(Mu(T)?hu>0&&(gu.push(t),mu+=1):I=Nu(T)),I&&(delete k.rel,delete k.href,k._cssText=I)}if("style"===_&&t.sheet&&!(t.innerText||nu.textContent(t)||"").trim().length){var E=Cu(()=>Nu(t.sheet));E&&(k._cssText=E)}if("input"===_||"textarea"===_||"select"===_){var R=t.value,A=t.checked;"radio"!==k.type&&"checkbox"!==k.type&&"submit"!==k.type&&"button"!==k.type&&R?k.value=Gu({element:t,type:Xu(t),tagName:_,value:R,maskInputOptions:s,maskInputFn:o}):A&&(k.checked=A)}if("option"===_&&(t.selected&&!s.select?k.selected=!0:delete k.selected),"dialog"===_&&t.open){try{k.rr_open_mode=t.matches("dialog:modal")?"modal":"non-modal"}catch(t){k.rr_open_mode="modal",k.ph_rr_could_not_detect_modal=!0}w.add("rr_open_mode")}if("canvas"===_&&c&&!(null==f?void 0:f()))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((Ku in n?n[Ku]: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)||(k.rr_dataURL=t.toDataURL(d.type,d.quality));else if(!("__context"in t)){var P=t.toDataURL(d.type,d.quality),F=i.createElement("canvas");F.width=t.width,F.height=t.height,P!==F.toDataURL(d.type,d.quality)&&(k.rr_dataURL=P)}var O,D,L=!1;if("img"===_&&v){nh||(nh=i.createElement("canvas"),sh=nh.getContext("2d"));var N=t,q=N.currentSrc||N.getAttribute("src")||"<unknown-src>",j=N.crossOrigin,B=(e,i)=>L?Qu({element:t,name:e,value:i,maskAllElementAttributes:l,maskAttributeFn:u}):i,H=()=>{_h(N,"load",H);try{nh.width=N.naturalWidth,nh.height=N.naturalHeight,sh.drawImage(N,0,0);var t=nh.toDataURL(d.type,d.quality);k.rr_dataURL=B("rr_dataURL",t)}catch(t){if("anonymous"!==N.crossOrigin)return N.crossOrigin="anonymous",void(N.complete&&0!==N.naturalWidth?H():N.addEventListener("load",H));console.warn("Cannot inline img src="+q+"! Error: "+t)}"anonymous"===N.crossOrigin&&(j?k.crossOrigin=B("crossOrigin",j):N.removeAttribute("crossorigin"))};N.complete&&0!==N.naturalWidth?H():N.addEventListener("load",H)}if("audio"===_||"video"===_){var z=k;z.rr_mediaState=t.paused?"paused":"played",w.add("rr_mediaState"),z.rr_mediaCurrentTime=t.currentTime,z.rr_mediaPlaybackRate=t.playbackRate,z.rr_mediaMuted=t.muted,z.rr_mediaLoop=t.loop,z.rr_mediaVolume=t.volume}if(m||(t.scrollLeft&&(k.rr_scrollLeft=t.scrollLeft),t.scrollTop&&(k.rr_scrollTop=t.scrollTop)),b){var U,W,V,G=t.getBoundingClientRect(),Z=G.width,J=G.height,Q=G.left,K=G.top,X=null===(U=i.defaultView)||void 0===U?void 0:U.getComputedStyle(t);k={class:k.class,rr_width:Z+"px",rr_height:J+"px",rr_left:Math.floor(Q+((null===(W=i.defaultView)||void 0===W?void 0:W.scrollX)||0))+"px",rr_top:Math.floor(K+((null===(V=i.defaultView)||void 0===V?void 0:V.scrollY)||0))+"px"},w.add("rr_width"),w.add("rr_height"),w.add("rr_left"),w.add("rr_top"),X&&(k.rr_position=X.position||"static",w.add("rr_position"),X.transform&&"none"!==X.transform&&(k.rr_transform=X.transform,w.add("rr_transform")),X.display&&X.display.startsWith("inline")&&(k.rr_display=X.display,w.add("rr_display")))}if("iframe"!==_||p(k.src)||(t.contentDocument||(k.rr_src=k.src),delete k.src),l||u)for(var Y of Object.entries(k)){var tt=Y[0],et=Y[1];"string"!=typeof et&&null!==et||(k[tt]=Qu({element:t,name:tt,value:et,maskAllElementAttributes:l,maskAttributeFn:u,isGenerated:w.has(tt)}))}L=!0;try{customElements.get(_)&&(O=!0)}catch(t){}return{type:Vl.Element,tagName:_,attributes:k,childNodes:[],isSVG:(D=t,Boolean("svg"===D.tagName||D.ownerSVGElement)||void 0),needBlock:b,rootId:y,isCustom:O}}(t,{doc:i,blockClass:r,blockSelector:n,inlineStylesheet:o,maskInputOptions:l,maskInputFn:h,maskAllElementAttributes:v,maskAttributeFn:c,dataURLOptions:p,inlineImages:g,recordCanvas:m,canvasMaskingConfigured:y,keepIframeSrcFn:b,newlyAddedElement:w,rootId:k});case t.TEXT_NODE:return function(t,e){var i=e.needsMask,r=e.maskTextFn,n=e.rootId,s=nu.parentNode(t),o=s&&s.tagName,a=nu.textContent(t),l="STYLE"===o||void 0,u="SCRIPT"===o||void 0;if(l&&a){try{var h;if(t.nextSibling||t.previousSibling);else if(Mu(s.sheet));else if(null===(h=s.sheet)||void 0===h?void 0:h.cssRules){var d=Nu(s.sheet);d&&!/(?:^|[\s;{}])-?[a-zA-Z][\w-]*\s*:\s*;/.test(d)&&(a=d)}}catch(e){console.warn("Cannot get CSS styles from text's parentNode. Error: "+e,t)}a=rh(a,fh(e.doc))}return u&&(a="SCRIPT_PLACEHOLDER"),!l&&!u&&a&&i&&(a=r?r(a,nu.parentElement(t)):a.replace(/[\S]/g,"*")),{type:Vl.Text,textContent:a||"",isStyle:l,rootId:n}}(t,{doc:i,needsMask:s,maskTextFn:u,rootId:k});case t.CDATA_SECTION_NODE:return{type:Vl.CDATA,textContent:"",rootId:k};case t.COMMENT_NODE:return{type:Vl.Comment,textContent:nu.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:L,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===Vl.Comment)return!0;if(t.type===Vl.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){var e,i;try{i=new URL(t,window.location.href)}catch(t){return null}var r=i.pathname.match(/\.([0-9a-z]+)(?:$)/i);return null!==(e=null==r?void 0:r[1])&&void 0!==e?e:null}(t.attributes.href)))return!0;if(e.headFavicon&&("link"===t.tagName&&"shortcut icon"===t.attributes.rel||"meta"===t.tagName&&(Sh(t.attributes.name).match(/^msapplication-tile(image|color)$/)||"application-name"===Sh(t.attributes.name)||["icon","apple-touch-icon","shortcut icon"].includes(Sh(t.attributes.rel)))))return!0;if("meta"===t.tagName){if(e.headMetaDescKeywords&&Sh(t.attributes.name).match(/^description|keywords$/))return!0;if(e.headMetaSocial&&(Sh(t.attributes.property).match(/^(og|twitter|fb):/)||Sh(t.attributes.name).match(/^(og|twitter):/)||"pinterest"===Sh(t.attributes.name)))return!0;if(e.headMetaRobots&&["robots","googlebot","bingbot"].includes(Sh(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(Sh(t.attributes.name))||Sh(t.attributes.property).match(/^article:/)||Sh(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(Sh(t.attributes.name)))return!0}}return!1}(Z,b)||!V&&Z.type===Vl.Text&&!Z.isStyle&&!Z.textContent.replace(/^\s+|\s+$/gm,"").length?-2:uh();var J=Object.assign(Z,{id:G});if(r.add(t,J),-2===G)return null;M&&M(t);var Q=!u;if(J.type===Vl.Element){Q=Q&&!J.needBlock,delete J.needBlock;var K=nu.shadowRoot(t);K&&Ou(K)&&(J.isShadowHost=!0)}if((J.type===Vl.Document||J.type===Vl.Element)&&Q){b.headWhitespace&&J.type===Vl.Element&&"head"===J.tagName&&(V=!1);var X={doc:i,mirror:r,blockClass:n,blockSelector:s,needsMask:U,maskTextClass:o,maskTextSelector:a,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:I,iframeLoadTimeout:R,onIframeListenerRegistered:A,onStylesheetLoad:P,stylesheetLoadTimeout:O,keepIframeSrcFn:L,depth:B+1,maxDepth:z};if(J.type===Vl.Element&&"textarea"===J.tagName&&void 0!==J.attributes.value);else for(var Y of Array.from(nu.childNodes(t))){var tt=Th(Y,X);tt&&J.childNodes.push(tt)}var et=null;if(Pu(t)&&(et=nu.shadowRoot(t)))for(var it of Array.from(nu.childNodes(et))){var rt=Th(it,X);rt&&(Ou(et)&&(rt.isShadow=!0),J.childNodes.push(rt))}}var nt=nu.parentNode(t);if(nt&&Fu(nt)&&Ou(nt)&&(J.isShadow=!0),J.type===Vl.Element&&"iframe"===J.tagName){var st=function(t,e,i){var r,n=()=>{},s=t.contentWindow;if(!s)return n;try{r=s.document.readyState}catch(t){return n}var o=()=>e();if("complete"!==r){var a=!1,l=null,u=()=>{a||(a=!0,null!==l&&(clearTimeout(l),l=null),_h(t,"load",h),t.addEventListener("load",o),e())},h=()=>u();return l=setTimeout(u,i),t.addEventListener("load",h),()=>{null!==l&&(clearTimeout(l),l=null),a?_h(t,"load",o):(a=!0,_h(t,"load",h))}}var d,v="about:blank";try{d=s.location.href}catch(t){return n}if(d!==v||t.src===v||""===t.src){var c=setTimeout(e,0);return t.addEventListener("load",o),()=>{clearTimeout(c),_h(t,"load",o)}}return t.addEventListener("load",o),()=>{_h(t,"load",o)}}(t,()=>{var e=t.contentDocument;if(e&&I){var i=Th(e,{doc:e,mirror:r,blockClass:n,blockSelector:s,needsMask:U,maskTextClass:o,maskTextSelector:a,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:I,iframeLoadTimeout:R,onIframeListenerRegistered:A,onStylesheetLoad:P,stylesheetLoadTimeout:O,keepIframeSrcFn:L,depth:B+1,maxDepth:z});i&&I(t,i)}},R);null==A||A(t,st)}return J.type===Vl.Element&&"link"===J.tagName&&"stylesheet"===J.attributes.rel&&function(e,l,u){if(!wh.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(P){var e=Th(t,{doc:i,mirror:r,blockClass:n,blockSelector:s,needsMask:U,maskTextClass:o,maskTextSelector:a,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:I,iframeLoadTimeout:R,onStylesheetLoad:P,stylesheetLoadTimeout:O,keepIframeSrcFn:L,depth:B,maxDepth:z});e&&P(t,e)}})()}finally{wh.delete(e),v.abort()}}},k=setTimeout(_,u);v.signal.addEventListener("abort",()=>clearTimeout(k),{once:!0}),e.addEventListener("load",_,{signal:v.signal,once:!0}),wh.set(e,v)}}}(t,0,O),J}function Mh(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}var Ih=class t{constructor(){Au(this,"parentElement",null),Au(this,"parentNode",null),Au(this,"ownerDocument",void 0),Au(this,"firstChild",null),Au(this,"lastChild",null),Au(this,"previousSibling",null),Au(this,"nextSibling",null),Au(this,"ELEMENT_NODE",1),Au(this,"TEXT_NODE",3),Au(this,"nodeType",void 0),Au(this,"nodeName",void 0),Au(this,"RRNodeType",void 0)}get childNodes(){for(var t=[],e=this.firstChild;e;)t.push(e),e=e.nextSibling;return t}contains(e){if(!(e instanceof t))return!1;if(e.ownerDocument!==this.ownerDocument)return!1;if(e===this)return!0;for(;e.parentNode;){if(e.parentNode===this)return!0;e=e.parentNode}return!1}appendChild(t){throw new Error("RRDomException: Failed to execute 'appendChild' on 'RRNode': This RRNode type does not support this method.")}insertBefore(t,e){throw new Error("RRDomException: Failed to execute 'insertBefore' on 'RRNode': This RRNode type does not support this method.")}removeChild(t){throw new Error("RRDomException: Failed to execute 'removeChild' on 'RRNode': This RRNode type does not support this method.")}toString(){return"RRNode"}};function Eh(t,e,i){void 0===i&&(i=document);var r={capture:!0,passive:!0};return i.addEventListener(t,e,r),()=>Rh(i,t,e,r)}function Rh(t,e,i,r){Ah(()=>{var n=t.removeEventListener;"function"==typeof n&&(void 0!==r?n.call(t,e,i,r):n.call(t,e,i))})}function Ah(t){try{t()}catch(t){if(!(t instanceof DOMException&&"SecurityError"===t.name))throw t}}var Ph="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.",Fh={map:{},getId(){return console.error(Ph),-1},getNode(){return console.error(Ph),null},removeNodeFromMap(){console.error(Ph)},has(){return console.error(Ph),!1},reset(){console.error(Ph)}};function Oh(t,e,i){void 0===i&&(i={});var r=null,n=0;return function(){for(var s=arguments.length,o=new Array(s),a=0;s>a;a++)o[a]=arguments[a];var l=Date.now();n||!1!==i.leading||(n=l);var u=e-(l-n),h=this;0>=u||u>e?(r&&(clearTimeout(r),r=null),n=l,t.apply(h,o)):r||!1===i.trailing||(r=setTimeout(()=>{n=!1===i.leading?0:Date.now(),r=null,t.apply(h,o)},u))}}function $h(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)}}}),()=>$h(t,e,s||{},!0)}"undefined"!=typeof window&&window.Proxy&&window.Reflect&&(Fh=new Proxy(Fh,{get(t,e,i){return"map"===e&&console.error(Ph),Reflect.get(t,e,i)}}));var Dh=Date.now;function Lh(t){var e,i,r,n,s=t.document;return{left:s.scrollingElement?s.scrollingElement.scrollLeft:void 0!==t.pageXOffset?t.pageXOffset:s.documentElement.scrollLeft||(null==s?void 0:s.body)&&(null===(e=nu.parentElement(s.body))||void 0===e?void 0:e.scrollLeft)||(null==s||null===(i=s.body)||void 0===i?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=nu.parentElement(s.body))||void 0===r?void 0:r.scrollTop)||(null==s||null===(n=s.body)||void 0===n?void 0:n.scrollTop)||0}}function Nh(){return window.innerHeight||document.documentElement&&document.documentElement.clientHeight||document.body&&document.body.clientHeight}function qh(){return window.innerWidth||document.documentElement&&document.documentElement.clientWidth||document.body&&document.body.clientWidth}function jh(t){return t?t.nodeType===t.ELEMENT_NODE?t:nu.parentElement(t):null}function Bh(t,e,i,r){if(!t)return!1;var n=jh(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(yh(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 Hh(t,e,i){return!("TITLE"!==t.tagName||!i.headTitleMutations)||-2===e.getId(t)}function zh(t,e){if(Fu(t))return!1;var i=e.getId(t);if(!e.has(i))return!0;var r=nu.parentNode(t);return(!r||r.nodeType!==t.DOCUMENT_NODE)&&(!r||zh(r,e))}function Uh(t){return Boolean(t.changedTouches)}function Wh(t,e){return Boolean("IFRAME"===t.nodeName&&e.getMeta(t))}function Vh(t,e){return Boolean("LINK"===t.nodeName&&t.nodeType===t.ELEMENT_NODE&&t.getAttribute&&"stylesheet"===t.getAttribute("rel")&&e.getMeta(t))}function Gh(t){return!!t&&(t instanceof Ih&&"shadowRoot"in t?Boolean(t.shadowRoot):Boolean(nu.shadowRoot(t)))}/[1-9][0-9]{12}/.test(Date.now().toString())||(Dh=()=>(new Date).getTime());var Zh=class{constructor(){Au(this,"id",1),Au(this,"styleIDMap",new WeakMap),Au(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 Jh(t){var e,i=null;return"getRootNode"in t&&(null===(e=nu.getRootNode(t))||void 0===e?void 0:e.nodeType)===Node.DOCUMENT_FRAGMENT_NODE&&nu.host(nu.getRootNode(t))&&(i=nu.host(nu.getRootNode(t))),i}function Qh(t){var e=t.ownerDocument;return!!e&&(nu.contains(e,t)||function(t){var e=t.ownerDocument;if(!e)return!1;var i=function(t){for(var e,i=t;e=Jh(i);)i=e;return i}(t);return nu.contains(e,i)}(t))}function Kh(t){return"__ln"in t}var Xh,Yh=class{constructor(){Au(this,"length",0),Au(this,"head",null),Au(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&&Kh(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&&Kh(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--)}},td=(t,e)=>t+"@"+e,ed=class{constructor(){Au(this,"frozen",!1),Au(this,"locked",!1),Au(this,"texts",[]),Au(this,"attributes",[]),Au(this,"attributeMap",new WeakMap),Au(this,"generatedAttributes",new WeakMap),Au(this,"removes",[]),Au(this,"mapRemoves",[]),Au(this,"movedMap",{}),Au(this,"addedSet",new Set),Au(this,"movedSet",new Set),Au(this,"droppedSet",new Set),Au(this,"removesSubTreeCache",new Set),Au(this,"mutationCb",void 0),Au(this,"blockClass",void 0),Au(this,"blockSelector",void 0),Au(this,"maskTextClass",void 0),Au(this,"maskTextSelector",void 0),Au(this,"inlineStylesheet",void 0),Au(this,"maskInputOptions",void 0),Au(this,"maskTextFn",void 0),Au(this,"maskInputFn",void 0),Au(this,"maskAllElementAttributes",void 0),Au(this,"maskAttributeFn",void 0),Au(this,"keepIframeSrcFn",void 0),Au(this,"recordCanvas",void 0),Au(this,"canvasMaskingConfigured",void 0),Au(this,"inlineImages",void 0),Au(this,"slimDOMOptions",void 0),Au(this,"dataURLOptions",void 0),Au(this,"doc",void 0),Au(this,"mirror",void 0),Au(this,"iframeManager",void 0),Au(this,"stylesheetManager",void 0),Au(this,"shadowDomManager",void 0),Au(this,"canvasManager",void 0),Au(this,"processedNodeManager",void 0),Au(this,"unattachedDoc",void 0),Au(this,"canvasManagerReleased",!1),Au(this,"processMutations",t=>{t.forEach(this.processMutation),this.emit()}),Au(this,"emit",()=>{if(!this.frozen&&!this.locked){var t,e,i=su(),r=lu();try{this.processBufferedMutations()}finally{t=su()-i,e=r,hu>0||uu(t,null!=e?e:ou)||t>bu.slowestBatchMs&&(bu.slowestBatchMs=t)}}}),Au(this,"processBufferedMutations",()=>{for(var t=[],e=new Set,i=new Yh,r=t=>{for(var e=t,i=-2;-2===i;)i=(e=e&&e.nextSibling)&&this.mirror.getId(e);return i},n=n=>{var s=nu.parentNode(n);if(s&&Qh(n)&&"TEXTAREA"!==s.tagName&&!this.isBlockedAtEmission(s)){var o=Fu(s)?this.mirror.getId(Jh(n)):this.mirror.getId(s),a=r(n);if(-1===o||-1===a)return i.addNode(n);var l=Th(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=>{Wh(t,this.mirror)&&this.iframeManager.addIframe(t),Vh(t,this.mirror)&&this.stylesheetManager.trackLinkElement(t),Gh(t)&&!Bh(t,this.blockClass,this.blockSelector,!0)&&this.shadowDomManager.addShadowRoot(nu.shadowRoot(t),this.doc)},onIframeLoad:(t,e)=>{this.iframeManager.attachIframe(t,e),this.shadowDomManager.observeAttachShadow(t)},onIframeListenerRegistered:(t,e)=>{this.iframeManager.registerLoadListenerDisposer(t,e)},onStylesheetLoad:(t,e)=>{this.stylesheetManager.attachLinkElement(t,e)}});l&&(t.push({parentId:o,nextId:a,node:l}),e.add(l.id))}};this.mapRemoves.length;)this.mirror.removeNodeFromMap(this.mapRemoves.shift());for(var s of this.movedSet)rd(this.removesSubTreeCache,s)&&!this.movedSet.has(nu.parentNode(s))||n(s);for(var o of this.addedSet)nd(this.droppedSet,o)||rd(this.removesSubTreeCache,o)?nd(this.movedSet,o)?n(o):this.droppedSet.add(o):n(o);for(var a=null;i.length;){var l=null;if(a){var u=this.mirror.getId(nu.parentNode(a.value)),h=r(a.value);-1!==u&&-1!==h&&(l=a)}if(!l)for(var d=i.tail;d;){var v=d;if(d=d.previous,v){var c=this.mirror.getId(nu.parentNode(v.value));if(-1===r(v.value))continue;if(-1!==c){l=v;break}var f=nu.parentNode(v.value);if(f&&f.nodeType===Node.DOCUMENT_FRAGMENT_NODE){var p=nu.host(f);if(-1!==this.mirror.getId(p)){l=v;break}}}}if(!l){for(;i.head;)i.removeNode(i.head.value);break}a=l.previous,i.removeNode(l.value),n(l.value)}var g={texts:this.texts.filter(t=>!this.isBlockedAtEmission(t.node)).map(t=>{var e=t.node,i=nu.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.filter(t=>!this.isBlockedAtEmission(t.node)).map(t=>{var e=t.attributes;if(!this.maskAllElementAttributes&&!this.maskAttributeFn&&"string"==typeof e.style){var i=JSON.stringify(t.styleDiff),r=JSON.stringify(t._unchangedStyles);e.style.length>i.length&&(i+r).split("var(").length===e.style.split("var(").length&&(e.style=t.styleDiff)}if(this.maskAllElementAttributes||this.maskAttributeFn)for(var n of Object.entries(e)){var s,o=n[0],a=n[1];"string"!=typeof a&&null!==a||(e[o]=Qu({element:t.node,name:o,value:a,maskAllElementAttributes:this.maskAllElementAttributes,maskAttributeFn:this.maskAttributeFn,isGenerated:null===(s=this.generatedAttributes.get(t.node))||void 0===s?void 0:s.has(o)}))}return{id:this.mirror.getId(t.node),attributes:e}}).filter(t=>!e.has(t.id)).filter(t=>this.mirror.has(t.id)),removes:this.removes,adds:t};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={},(g.texts.length||g.attributes.length||g.removes.length||g.adds.length)&&this.mutationCb(g)}),Au(this,"bufferBelongsToIframe",t=>this.doc===t.contentDocument),Au(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(nu.childNodes(t),t=>nu.textContent(t)||"").join("");e.attributes.value=Gu({element:t,maskInputOptions:this.maskInputOptions,tagName:t.tagName,type:Xu(t),value:i,maskInputFn:this.maskInputFn})}),Au(this,"processMutation",t=>{if(!Hh(t.target,this.mirror,this.slimDOMOptions))switch(t.type){case"characterData":var e=nu.textContent(t.target);Bh(t.target,this.blockClass,this.blockSelector,!1)||e===t.oldValue||this.texts.push({value:bh(t.target,this.maskTextClass,this.maskTextSelector,!0)&&e?this.maskTextFn?this.maskTextFn(e,jh(t.target)):e.replace(/[\S]/g,"*"):e,node:t.target});break;case"attributes":var i,r=t.target,n=t.attributeName,s=null!==(i=t.attributeNamespace)&&void 0!==i?i: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}(r,n,s),a=s?r.getAttributeNS(s,n):t.target.getAttribute(n);if("value"===o){var l=r,u=Xu(l);a=Gu({element:l,maskInputOptions:this.maskInputOptions,tagName:r.tagName,type:u,value:a,maskInputFn:this.maskInputFn})}if(Bh(t.target,this.blockClass,this.blockSelector,!1)||a===t.oldValue)return;var h=this.attributeMap.get(t.target),d="IFRAME"===r.tagName&&"src"===o;if(d&&!this.keepIframeSrcFn(a)&&r.contentDocument)return;if(h||(this.attributes.push(h={node:t.target,attributes:{},styleDiff:{},_unchangedStyles:{}}),this.attributeMap.set(t.target,h)),"type"===o&&"INPUT"===r.tagName&&"password"===(t.oldValue||"").toLowerCase()&&r.setAttribute("data-rr-is-password","true"),!mh(r.tagName,o)){var v,c=gh(this.doc,Zu(r.tagName),Zu(o),a,r,this.dataURLOptions);if(d&&!this.keepIframeSrcFn(a)&&(o="rr_src"),h.attributes[o]=c,null===(v=this.generatedAttributes.get(t.target))||void 0===v||v.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=r.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)?h.styleDiff[g]=""===y?m:[m,y]:h._unchangedStyles[g]=[m,y]}for(var b of Array.from(f.style))""===p.getPropertyValue(b)&&(h.styleDiff[b]=!1)}else if("open"===o&&"DIALOG"===r.tagName){h.attributes.rr_open_mode=r.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(Bh(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=Fu(t.target)?this.mirror.getId(nu.host(t.target)):this.mirror.getId(t.target);Bh(t.target,this.blockClass,this.blockSelector,!1)||Hh(e,this.mirror,this.slimDOMOptions)||!function(t,e){return-1!==e.getId(t)}(e,this.mirror)||(this.addedSet.has(e)?(id(this.addedSet,e),this.droppedSet.add(e)):this.addedSet.has(t.target)&&-1===i||zh(t.target,this.mirror)||(this.movedSet.has(e)&&this.movedMap[td(i,r)]?id(this.movedSet,e):(this.removes.push({parentId:r,id:i,isShadow:!(!Fu(t.target)||!Ou(t.target))||void 0}),function(t,e){for(var i=[t];i.length;){var r=i.pop();e.has(r)||(e.add(r),nu.childNodes(r).forEach(t=>i.push(t)))}}(e,this.removesSubTreeCache))),this.mapRemoves.push(e))})}}),Au(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(Hh(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[td(this.mirror.getId(t),i)]=!0)}else this.addedSet.add(t),this.droppedSet.delete(t);Bh(t,this.blockClass,this.blockSelector,!1)||(nu.childNodes(t).forEach(t=>this.genAdds(t)),Gh(t)&&nu.childNodes(nu.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())}isBlockedAtEmission(t){for(var e=this.blockClass,i=e&&"string"!=typeof e&&(e.global||e.sticky)?new RegExp(e):null;t;){if(i&&(i.lastIndex=0),Bh(t,i||e,this.blockSelector,!0))return!0;var r="getRootNode"in t?nu.getRootNode(t):null;t=(null==r?void 0:r.nodeType)===Node.DOCUMENT_FRAGMENT_NODE?nu.host(r):null}return!1}};function id(t,e){for(var i=[e];i.length;){var r=i.pop();t.delete(r),nu.childNodes(r).forEach(t=>i.push(t))}}function rd(t,e,i){return 0!==t.size&&function(t,e){var i=nu.parentNode(e);return!!i&&t.has(i)}(t,e)}function nd(t,e){if(0===t.size)return!1;for(var i=nu.parentNode(e);i;){if(t.has(i))return!0;i=nu.parentNode(i)}return!1}var sd=function(t,e){return void 0===e&&(e="rrweb"),Xh?function(){try{return t(...arguments)}catch(t){if(Xh&&!0===Xh(t,e))return;throw t}}:t},od=[];function ad(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 ld(t,e){var i,r=new ed;r.init(t);try{i=new(iu())(sd(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),od.push(r),{observer:i,buffer:r}}catch(t){try{null==i||i.disconnect(),r.destroy(),r.reset()}catch(t){}throw t}}function ud(t){var e=t.scrollCb,i=t.doc,r=t.mirror,n=t.blockClass,s=t.blockSelector,o=t.sampling,a=new Map,l=t=>{var o=ad(t);if(o&&!Bh(o,n,s,!0)){var l,u,h=r.getId(o);if(o===i&&i.defaultView){var d=Lh(i.defaultView);l=d.left,u=d.top}else l=o.scrollLeft,u=o.scrollTop;var v=l+","+u;a.get(h)!==v&&(a.set(h,v),e({id:h,x:l,y:u}))}},u=[Eh("scroll",sd(Oh(sd(t=>l(t)),o.scroll||100)),i)];return"onscrollend"in i&&u.push(Eh("scrollend",sd(l),i)),()=>u.forEach(t=>t())}function hd(t,e){for(var i=od.length-1;i>=0;i--){var r=od[i];if(r){var n=r.bufferBelongsToIframe(t);!n&&e&&e.has(r.bufferDoc())&&(n=!0),n&&(r.reset(),od.splice(i,1))}}}var dd=["INPUT","TEXTAREA","SELECT"],vd=new WeakMap;function cd(t){return function t(e,i){if(md("CSSGroupingRule")&&e.parentRule instanceof CSSGroupingRule||md("CSSMediaRule")&&e.parentRule instanceof CSSMediaRule||md("CSSSupportsRule")&&e.parentRule instanceof CSSSupportsRule||md("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 fd(t,e,i){var r,n;return t?(t.ownerNode?r=e.getId(t.ownerNode):n=i.getId(t),{styleId:n,id:r}):{}}function pd(t,e){var i,r,n,s=t.stylesheetManager;n=t.mirror.getId("#document"===e.nodeName?e:nu.host(e));var o="#document"===e.nodeName?null===(i=e.defaultView)||void 0===i?void 0:i.Document:null===(r=e.ownerDocument)||void 0===r||null===(r=r.defaultView)||void 0===r?void 0:r.ShadowRoot,a=(null==o?void 0:o.prototype)?Object.getOwnPropertyDescriptor(null==o?void 0:o.prototype,"adoptedStyleSheets"):void 0;return null!==n&&-1!==n&&o&&a?(Object.defineProperty(e,"adoptedStyleSheets",{configurable:a.configurable,enumerable:a.enumerable,get(){var t;return null===(t=a.get)||void 0===t?void 0:t.call(this)},set(t){var e;try{var i;e=null===(i=a.set)||void 0===i?void 0:i.call(this,t)}catch(t){if(t&&"object"==typeof t&&"NotAllowedError"===t.name)return;throw t}if(null!==n&&-1!==n)try{s.adoptStyleSheets(t,n)}catch(t){}return e}}),sd(()=>{Object.defineProperty(e,"adoptedStyleSheets",{configurable:a.configurable,enumerable:a.enumerable,get:a.get,set:a.set})})):()=>{}}function gd(t,e){void 0===e&&(e={});var i,r,s=t.doc.defaultView;if(!s)return()=>{};!function(t,e){var i=t.mutationCb,r=t.mousemoveCb,n=t.mouseInteractionCb,s=t.scrollCb,o=t.viewportResizeCb,a=t.inputCb,l=t.mediaInteractionCb,u=t.styleSheetRuleCb,h=t.styleDeclarationCb,d=t.canvasMutationCb,v=t.fontCb,c=t.selectionCb,f=t.customElementCb;t.mutationCb=function(){e.mutation&&e.mutation(...arguments),i(...arguments)},t.mousemoveCb=function(){e.mousemove&&e.mousemove(...arguments),r(...arguments)},t.mouseInteractionCb=function(){e.mouseInteraction&&e.mouseInteraction(...arguments),n(...arguments)},t.scrollCb=function(){e.scroll&&e.scroll(...arguments),s(...arguments)},t.viewportResizeCb=function(){e.viewportResize&&e.viewportResize(...arguments),o(...arguments)},t.inputCb=function(){e.input&&e.input(...arguments),a(...arguments)},t.mediaInteractionCb=function(){e.mediaInteaction&&e.mediaInteaction(...arguments),l(...arguments)},t.styleSheetRuleCb=function(){e.styleSheetRule&&e.styleSheetRule(...arguments),u(...arguments)},t.styleDeclarationCb=function(){e.styleDeclaration&&e.styleDeclaration(...arguments),h(...arguments)},t.canvasMutationCb=function(){e.canvasMutation&&e.canvasMutation(...arguments),d(...arguments)},t.fontCb=function(){e.font&&e.font(...arguments),v(...arguments)},t.selectionCb=function(){e.selection&&e.selection(...arguments),c(...arguments)},t.customElementCb=function(){e.customElement&&e.customElement(...arguments),f(...arguments)}}(t,e);var o=[],a=sd(()=>{if(r){r.destroy(),r.reset();var e=od.indexOf(r);-1!==e&&od.splice(e,1)}t.shadowDomManager.resetForDoc(t.doc),null==i||i.disconnect(),o.forEach(t=>t())});try{if(t.recordDOM){var l=ld(t,t.doc);i=l.observer,r=l.buffer}if(o.push(function(t){var e=t.mousemoveCb,i=t.sampling,r=t.doc,n=t.mirror;if(!1===i.mousemove)return()=>{};var s,o="number"==typeof i.mousemove?i.mousemove:50,a="number"==typeof i.mousemoveCallback?i.mousemoveCallback:500,l=[],u=Oh(sd(t=>{var i=Date.now()-s;e(l.map(t=>(t.timeOffset-=i,t)),t),l=[],s=null}),a),h=sd(Oh(sd(t=>{var e=ad(t),i=Uh(t)?t.changedTouches[0]:t,r=i.clientX,o=i.clientY;s||(s=Dh()),l.push({x:r,y:o,id:n.getId(e),timeOffset:Dh()-s}),u("undefined"!=typeof DragEvent&&t instanceof DragEvent?Bl.Drag:t instanceof MouseEvent?Bl.MouseMove:Bl.TouchMove)}),o,{trailing:!1})),d=[Eh("mousemove",h,r),Eh("touchmove",h,r),Eh("drag",h,r)];return sd(()=>{d.forEach(t=>t())})}(t)),o.push(function(t){var e=t.mouseInteractionCb,i=t.doc,r=t.mirror,s=t.blockClass,o=t.blockSelector,a=t.sampling;if(!1===a.mouseInteraction)return()=>{};var l=!0===a.mouseInteraction||void 0===a.mouseInteraction?{}:a.mouseInteraction,u=[],h=null;return Object.keys(Hl).filter(t=>Number.isNaN(Number(t))&&!t.endsWith("_Departed")&&!1!==l[t]).forEach(t=>{var a=Zu(t),l=(t=>i=>{var a=ad(i);if(!Bh(a,s,o,!0)){var l=null,u=t;if("pointerType"in i){switch(i.pointerType){case"mouse":l=zl.Mouse;break;case"touch":l=zl.Touch;break;case"pen":l=zl.Pen}l===zl.Touch&&(Hl[t]===Hl.MouseDown?u="TouchStart":Hl[t]===Hl.MouseUp&&(u="TouchEnd"))}else Uh(i)&&(l=zl.Touch);null!==l?(h=l,(u.startsWith("Touch")&&l===zl.Touch||u.startsWith("Mouse")&&l===zl.Mouse)&&(l=null)):Hl[t]===Hl.Click&&(l=h,h=null);var d=Uh(i)?i.changedTouches[0]:i;if(d){var v=r.getId(a),c=d.clientX,f=d.clientY;sd(e)(n({type:Hl[u],id:v,x:c,y:f},null!==l&&{pointerType:l}))}}})(t);if(window.PointerEvent)switch(Hl[t]){case Hl.MouseDown:case Hl.MouseUp:a=a.replace("mouse","pointer");break;case Hl.TouchStart:case Hl.TouchEnd:return}u.push(Eh(a,l,i))}),sd(()=>{u.forEach(t=>t())})}(t)),o.push(ud(t)),o.push(function(t,e){var i=t.viewportResizeCb,r=e.win,n=-1,s=-1;return Eh("resize",sd(Oh(sd(()=>{var t=Nh(),e=qh();n===t&&s===e||(i({width:Number(e),height:Number(t)}),n=t,s=e)}),200)),r)}(t,{win:s})),o.push(function(t){var e=t.inputCb,i=t.doc,r=t.mirror,s=t.blockClass,o=t.blockSelector,a=t.ignoreClass,l=t.ignoreSelector,u=t.maskInputOptions,h=t.maskInputFn,d=t.userTriggeredOnInput;function v(t){var e=ad(t),r=t.isTrusted,n=i.defaultView;if(!e||!n||e instanceof n.HTMLElement){var v=e&&e.tagName;if(e&&"OPTION"===v&&(e=nu.parentElement(e)),e&&v&&dd.indexOf(v)>=0&&!Bh(e,s,o,!0)&&!(e.classList.contains(a)||l&&e.matches(l))){var f=e.value,p=!1,g=Xu(e)||"";"radio"===g||"checkbox"===g?p=e.checked:(u[v.toLowerCase()]||u[g])&&(f=Gu({element:e,maskInputOptions:u,tagName:v,type:g,value:f,maskInputFn:h})),c(e,d?{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;c(t,d?{text:i,isChecked:!p,userTriggered:!1}:{text:i,isChecked:!p})}})}}}function c(t,i){var s=vd.get(t);if(!s||s.text!==i.text||s.isChecked!==i.isChecked){vd.set(t,i);var o=r.getId(t);sd(e)(n({},i,{id:o}))}}var f=("last"===t.sampling.input?["change"]:["input","change"]).map(t=>Eh(t,sd(v),i)),p=i.defaultView;if(!p)return()=>{f.forEach(t=>t())};var g=p.Object.getOwnPropertyDescriptor(p.HTMLInputElement.prototype,"value");return g&&g.set&&f.push(...[[p.HTMLInputElement.prototype,"value"],[p.HTMLInputElement.prototype,"checked"],[p.HTMLSelectElement.prototype,"value"],[p.HTMLTextAreaElement.prototype,"value"],[p.HTMLSelectElement.prototype,"selectedIndex"],[p.HTMLOptionElement.prototype,"selected"]].map(t=>$h(t[0],t[1],{set(){sd(v)({target:this,isTrusted:!1})}},!1,p))),sd(()=>{f.forEach(t=>t())})}(t)),o.push(function(t){var e=t.mediaInteractionCb,i=t.blockClass,r=t.blockSelector,n=t.mirror,s=t.sampling,o=t.doc,a=sd(t=>Oh(sd(s=>{var o=ad(s);if(o&&!Bh(o,i,r,!0)){var a=o.currentTime,l=o.volume,u=o.muted,h=o.playbackRate,d=o.loop;e({type:t,id:n.getId(o),currentTime:a,volume:l,muted:u,playbackRate:h,loop:d})}}),s.media||500)),l=[Eh("play",a(Wl.Play),o),Eh("pause",a(Wl.Pause),o),Eh("seeked",a(Wl.Seeked),o),Eh("volumechange",a(Wl.VolumeChange),o),Eh("ratechange",a(Wl.RateChange),o)];return sd(()=>{l.forEach(t=>t())})}(t)),t.recordDOM){var u=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?void 0:i.ready;){var s=r.shift();(null==s?void 0:s.emit)&&n(s.emit)}0===r.length&&e.delete(t)}};return{queueMutation(t,i){if(t){var r=e.get(t);r?(r.push({emit:i,ready:!0}),s(t)):n(i)}else n(i)},queuePendingMutation(o,a,l){if(!r)return()=>{};var u=e.get(o);u||e.set(o,u=[]);var h={emit:a,ready:!1};u.push(h);var d,v=!1,c=!1,f=()=>{v||c||(v=!0,void 0!==d&&i.delete(d),h.ready=!0,h.emit=void 0,s(o))};try{d=t.setTimeout(f,5e3),v||c?t.clearTimeout(d):i.add(d)}catch(t){f()}return e=>{!c&&r&&(c=!0,void 0!==d&&(t.clearTimeout(d),i.delete(d)),v?e&&n(l):(h.ready=!0,e||(h.emit=void 0),s(o)))}},reset(){r=!1,i.forEach(e=>t.clearTimeout(e)),i.clear(),e.clear()}}}(s);o.push(u.reset),o.push(function(t,e){var i=t.styleSheetRuleCb,r=t.mirror,n=t.stylesheetManager,s=e.win,o=e.mutationQueue;if(!s.CSSStyleSheet||!s.CSSStyleSheet.prototype)return()=>{};var a=s.CSSStyleSheet.prototype.insertRule;s.CSSStyleSheet.prototype.insertRule=new Proxy(a,{apply:sd((t,e,s)=>{var a=s[0],l=t.apply(e,s);n.onCssomSheetMutation(e);var u=fd(e,r,n.styleMirror),h=u.id,d=u.styleId;return(h&&-1!==h||d&&-1!==d)&&o.queueMutation(e,()=>i({id:h,styleId:d,adds:[{rule:a,index:l}]})),l},"host")}),s.CSSStyleSheet.prototype.addRule=function(t,e,i){return void 0===i&&(i=this.cssRules.length),s.CSSStyleSheet.prototype.insertRule.apply(this,[t+" { "+e+" }",i])};var l,u,h=s.CSSStyleSheet.prototype.deleteRule;s.CSSStyleSheet.prototype.deleteRule=new Proxy(h,{apply:sd((t,e,s)=>{var a=s[0],l=t.apply(e,s);n.onCssomSheetMutation(e);var u=fd(e,r,n.styleMirror),h=u.id,d=u.styleId;return(h&&-1!==h||d&&-1!==d)&&o.queueMutation(e,()=>i({id:h,styleId:d,removes:[{index:a}]})),l},"host")}),s.CSSStyleSheet.prototype.removeRule=function(t){return s.CSSStyleSheet.prototype.deleteRule.apply(this,[t])},s.CSSStyleSheet.prototype.replace&&(l=s.CSSStyleSheet.prototype.replace,s.CSSStyleSheet.prototype.replace=new Proxy(l,{apply:sd((t,e,s)=>{var a=s[0],l=t.apply(e,s);try{var u=null==l?void 0:l.then;if(e.ownerNode||!l||"function"!=typeof u)return l;n.onCssomSheetMutation(e);var h=fd(e,r,n.styleMirror),d=h.id,v=h.styleId;if(!(d&&-1!==d||v&&-1!==v))return l;var c=o.queuePendingMutation(e,()=>i({id:d,styleId:v,replace:a}),()=>{var t=Nu(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:sd((t,e,s)=>{var a=s[0],l=t.apply(e,s);n.onCssomSheetMutation(e);var u=fd(e,r,n.styleMirror),h=u.id,d=u.styleId;return(h&&-1!==h||d&&-1!==d)&&o.queueMutation(e,()=>i({id:h,styleId:d,replaceSync:a})),l},"host")}));var d={};yd("CSSGroupingRule")?d.CSSGroupingRule=s.CSSGroupingRule:(yd("CSSMediaRule")&&(d.CSSMediaRule=s.CSSMediaRule),yd("CSSConditionRule")&&(d.CSSConditionRule=s.CSSConditionRule),yd("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:sd((t,e,s)=>{var a=s[0],l=t.apply(e,s);n.onCssomSheetMutation(e.parentStyleSheet);var u=fd(e.parentStyleSheet,r,n.styleMirror),h=u.id,d=u.styleId;if(e.parentStyleSheet&&(h&&-1!==h||d&&-1!==d)){var v=[...cd(e),l];o.queueMutation(e.parentStyleSheet,()=>i({id:h,styleId:d,adds:[{rule:a,index:v}]}))}return l},"host")}),s.prototype.deleteRule=new Proxy(v[e].deleteRule,{apply:sd((t,e,s)=>{var a=s[0],l=t.apply(e,s);n.onCssomSheetMutation(e.parentStyleSheet);var u=fd(e.parentStyleSheet,r,n.styleMirror),h=u.id,d=u.styleId;if(e.parentStyleSheet&&(h&&-1!==h||d&&-1!==d)){var v=[...cd(e),a];o.queueMutation(e.parentStyleSheet,()=>i({id:h,styleId:d,removes:[{index:v}]}))}return l},"host")})}),sd(()=>{s.CSSStyleSheet.prototype.insertRule=a,s.CSSStyleSheet.prototype.deleteRule=h,l&&(s.CSSStyleSheet.prototype.replace=l),u&&(s.CSSStyleSheet.prototype.replaceSync=u),Object.entries(d).forEach(t=>{var e=t[0],i=t[1];i.prototype.insertRule=v[e].insertRule,i.prototype.deleteRule=v[e].deleteRule})})}(t,{win:s,mutationQueue:u})),o.push(pd(t,t.doc)),o.push(function(t,e){var i=t.styleDeclarationCb,r=t.mirror,n=t.ignoreCSSAttributes,s=t.stylesheetManager,o=e.win,a=e.mutationQueue,l=o.CSSStyleDeclaration.prototype.setProperty;o.CSSStyleDeclaration.prototype.setProperty=new Proxy(l,{apply:sd((t,e,o)=>{var l,u=o[0],h=o[1],d=o[2],v=t.apply(e,o);if(n.has(u))return v;var c=null===(l=e.parentRule)||void 0===l?void 0:l.parentStyleSheet;s.onCssomSheetMutation(c);var f=fd(c,r,s.styleMirror),p=f.id,g=f.styleId;if(p&&-1!==p||g&&-1!==g){var m=cd(e.parentRule);a.queueMutation(c,()=>i({id:p,styleId:g,set:{property:u,value:h,priority:d},index:m}))}return v},"host")});var u=o.CSSStyleDeclaration.prototype.removeProperty;return o.CSSStyleDeclaration.prototype.removeProperty=new Proxy(u,{apply:sd((t,e,o)=>{var l,u=o[0],h=t.apply(e,o);if(n.has(u))return h;var d=null===(l=e.parentRule)||void 0===l?void 0:l.parentStyleSheet;s.onCssomSheetMutation(d);var v=fd(d,r,s.styleMirror),c=v.id,f=v.styleId;if(c&&-1!==c||f&&-1!==f){var p=cd(e.parentRule);a.queueMutation(d,()=>i({id:c,styleId:f,remove:{property:u},index:p}))}return h},"host")}),sd(()=>{o.CSSStyleDeclaration.prototype.setProperty=l,o.CSSStyleDeclaration.prototype.removeProperty=u})}(t,{win:s,mutationQueue:u})),t.collectFonts&&o.push(function(t){var e=t.fontCb,i=t.doc,r=i.defaultView;if(!r)return()=>{};var n=[],s=new WeakMap,o=r.FontFace;r.FontFace=function(t,e,i){var r=new o(t,e,i);return s.set(r,{family:t,buffer:"string"!=typeof e,descriptors:i,fontSource:"string"==typeof e?e:JSON.stringify(Array.from(new Uint8Array(e)))}),r};var a=ru(i.fonts,"add",function(t){return function(i){return setTimeout(sd(()=>{var t=s.get(i);t&&(e(t),s.delete(i))}),0),t.apply(this,[i])}});return n.push(()=>{r.FontFace=o}),n.push(a),sd(()=>{n.forEach(t=>t())})}(t))}for(var h of(o.push(function(t){var e=t.doc,i=t.mirror,r=t.blockClass,n=t.blockSelector,s=t.selectionCb,o=!0,a=sd(()=>{var t=e.getSelection();if(!(!t||o&&(null==t?void 0:t.isCollapsed))){o=t.isCollapsed||!1;for(var a=[],l=t.rangeCount||0,u=0;l>u;u++){var h=t.getRangeAt(u),d=h.startContainer,v=h.startOffset,c=h.endContainer,f=h.endOffset;Bh(d,r,n,!0)||Bh(c,r,n,!0)||a.push({start:i.getId(d),startOffset:v,end:i.getId(c),endOffset:f})}s({ranges:a})}});return a(),Eh("selectionchange",a)}(t)),o.push(function(t){var e=t.customElementCb,i=t.doc.defaultView;return i&&i.customElements?ru(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))o.push(h.observer(h.callback,s,h.options))}catch(t){try{a()}catch(t){}throw t}return a}function md(t){return void 0!==window[t]}function yd(t){return Boolean(void 0!==window[t]&&window[t].prototype&&"insertRule"in window[t].prototype&&"deleteRule"in window[t].prototype)}var bd=class{constructor(t){Au(this,"generateIdFn",void 0),Au(this,"iframeRemoteIdToLocalIdMap",new WeakMap),Au(this,"iframeLocalIdToRemoteIdMap",new WeakMap),this.generateIdFn=t}getId(t,e,i,r){if(0>e)return e;var n=i||this.getRemoteIdToLocalIdMap(t),s=r||this.getLocalIdToRemoteIdMap(t),o=n.get(e);return void 0===o&&(o=this.generateIdFn(),n.set(e,o),s.set(o,e)),o}getIds(t,e){var i=this.getRemoteIdToLocalIdMap(t),r=this.getLocalIdToRemoteIdMap(t);return e.map(e=>this.getId(t,e,i,r))}getRemoteId(t,e,i){var r;return"number"!=typeof e||0>e?e:null!==(r=(i||this.getLocalIdToRemoteIdMap(t)).get(e))&&void 0!==r?r:-1}getRemoteIds(t,e){var i=this.getLocalIdToRemoteIdMap(t);return e.map(e=>this.getRemoteId(t,e,i))}reset(t){if(!t)return this.iframeRemoteIdToLocalIdMap=new WeakMap,void(this.iframeLocalIdToRemoteIdMap=new WeakMap);this.iframeRemoteIdToLocalIdMap.delete(t),this.iframeLocalIdToRemoteIdMap.delete(t)}getRemoteIdToLocalIdMap(t){var e=this.iframeRemoteIdToLocalIdMap.get(t);return e||this.iframeRemoteIdToLocalIdMap.set(t,e=new Map),e}getLocalIdToRemoteIdMap(t){var e=this.iframeLocalIdToRemoteIdMap.get(t);return e||this.iframeLocalIdToRemoteIdMap.set(t,e=new Map),e}},_d=class{constructor(t){Au(this,"iframes",new WeakMap),Au(this,"crossOriginIframeMap",new WeakMap),Au(this,"crossOriginIframeMirror",new bd(uh)),Au(this,"crossOriginIframeStyleMirror",void 0),Au(this,"crossOriginIframeRootIdMap",new WeakMap),Au(this,"mirror",void 0),Au(this,"mutationCb",void 0),Au(this,"wrappedEmit",void 0),Au(this,"loadListener",void 0),Au(this,"pageHideListener",void 0),Au(this,"stylesheetManager",void 0),Au(this,"recordCrossOriginIframes",void 0),Au(this,"messageHandler",void 0),Au(this,"nestedIframeListeners",new Map),Au(this,"attachedWindows",new WeakMap),Au(this,"attachedDocuments",new WeakMap),Au(this,"attachedIframes",new Map),Au(this,"loadListenerDisposers",new WeakMap),Au(this,"iframeElementsById",new Map),Au(this,"pageHideHandlers",new WeakMap),this.mutationCb=t.mutationCb,this.wrappedEmit=t.wrappedEmit,this.stylesheetManager=t.stylesheetManager,this.recordCrossOriginIframes=t.recordCrossOriginIframes,this.crossOriginIframeStyleMirror=new bd(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?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=>Ah(t)),this.loadListenerDisposers.delete(t))}removePageHideListener(t){var e=this.pageHideHandlers.get(t);e&&(e.forEach(t=>{Rh(t.win,"pagehide",t.handler)}),this.pageHideHandlers.delete(t))}addLoadListener(t){this.loadListener=t}addPageHideListener(t){this.pageHideListener=t}removeLoadListener(){this.loadListener=void 0}trackIframeContent(t,e){var i=this.mirror.getId(t);return this.attachedIframes.set(i,{element:t,content:e}),i}attachIframe(t,e){var i,r=this.trackIframeContent(t,e);if(t.contentDocument){var n=this.attachedDocuments.get(t);n||this.attachedDocuments.set(t,n=new Set),n.add(t.contentDocument)}this.mutationCb({adds:[{parentId:r,nextId:null,node:e}],removes:[],texts:[],attributes:[],isAttachIframe:!0});var s=t.contentWindow;if(this.recordCrossOriginIframes&&s&&!this.nestedIframeListeners.has(s)){var o=this.handleMessage.bind(this);Ah(()=>{s.addEventListener("message",o),this.nestedIframeListeners.set(s,o);var e=this.attachedWindows.get(t);e||this.attachedWindows.set(t,e=new Set),e.add(s)})}Ah(()=>{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)||void 0===e||e.call(this,t),t.contentDocument&&this.mirror.removeNodeFromMap(t.contentDocument)};e.addEventListener("pagehide",n),i||this.pageHideHandlers.set(t,i=new Set),i.add({win:e,handler:n})}}),null===(i=this.loadListener)||void 0===i||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){switch(e.type){case jl.FullSnapshot:this.crossOriginIframeMirror.reset(t),this.crossOriginIframeStyleMirror.reset(t),this.replaceIdOnNode(e.data.node,t);var i=e.data.node.id;return this.crossOriginIframeRootIdMap.set(t,i),this.patchRootIdOnNode(e.data.node,i),this.trackIframeContent(t,e.data.node),{timestamp:e.timestamp,type:jl.IncrementalSnapshot,data:{source:Bl.Mutation,adds:[{parentId:this.mirror.getId(t),nextId:null,node:e.data.node}],removes:[],texts:[],attributes:[],isAttachIframe:!0}};case jl.Meta:case jl.Load:case jl.DomContentLoaded:return!1;case jl.Plugin:return e;case jl.Custom:return this.replaceIds(e.data.payload,t,["id","parentId","previousId","nextId"]),e;case jl.IncrementalSnapshot:switch(e.data.source){case Bl.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 Bl.Drag:case Bl.TouchMove:case Bl.MouseMove:return e.data.positions.forEach(e=>{this.replaceIds(e,t,["id"])}),e;case Bl.ViewportResize:return!1;case Bl.MediaInteraction:case Bl.MouseInteraction:case Bl.Scroll:case Bl.CanvasMutation:case Bl.Input:return this.replaceIds(e.data,t,["id"]),e;case Bl.StyleSheetRule:case Bl.StyleDeclaration:return this.replaceIds(e.data,t,["id"]),this.replaceStyleIds(e.data,t,["styleId"]),e;case Bl.Font:return e;case Bl.Selection:return e.data.ranges.forEach(e=>{this.replaceIds(e,t,["start","end"])}),e;case Bl.AdoptedStyleSheet:var r;return this.replaceIds(e.data,t,["id"]),this.replaceStyleIds(e.data,t,["styleIds"]),null===(r=e.data.styles)||void 0===r||r.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===Vl.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&&(Rh(t,"message",e),this.nestedIframeListeners.delete(t)),this.crossOriginIframeMap.delete(t)}),this.attachedWindows.delete(i)),r&&this.nestedIframeListeners.has(r)&&(Rh(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=>{Ah(()=>this.mirror.removeNodeFromMap(t))}),Ah(()=>hd(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&&Rh(window,"message",this.messageHandler),this.nestedIframeListeners.forEach((t,e)=>{Rh(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}},wd=class{constructor(t){Au(this,"shadowDoms",new WeakSet),Au(this,"mutationCb",void 0),Au(this,"scrollCb",void 0),Au(this,"bypassOptions",void 0),Au(this,"mirror",void 0),Au(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(Ou(t)&&!this.shadowDoms.has(t)){this.shadowDoms.add(t);var s=null!==(i=null===(r=nu.host(t))||void 0===r?void 0:r.ownerDocument)&&void 0!==i?i:e,o=ld(n({},this.bypassOptions,{doc:s,mutationCb:this.mutationCb,mirror:this.mirror,shadowDomManager:this}),t),a=o.observer,l=o.buffer;this.restoreHandlers.push({doc:s,handler(){a.disconnect(),l.destroy(),l.releaseCanvasManager();var t=od.indexOf(l);-1!==t&&od.splice(t,1)}}),this.restoreHandlers.push({doc:s,handler:ud(n({},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(nu.host(t))),this.restoreHandlers.push({doc:s,handler:pd({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:ru(t.prototype,"attachShadow",function(t){return function(r){var n=t.call(this,r),s=nu.shadowRoot(this);return s&&Qh(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}},kd="skip-frame";function Sd(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 xd="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",Cd="undefined"==typeof Uint8Array?[]:new Uint8Array(256),Td=0;64>Td;Td++)Cd[xd.charCodeAt(Td)]=Td;var Md=function(t){var e,i=new Uint8Array(t),r=i.length,n="";for(e=0;r>e;e+=3)n+=xd[i[e]>>2],n+=xd[(3&i[e])<<4|i[e+1]>>4],n+=xd[(15&i[e+1])<<2|i[e+2]>>6],n+=xd[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},Id=new Map,Ed=(t,e,i)=>{if(t&&(Pd(t,e)||"object"==typeof t)){var r=function(t,e){var i=Id.get(t);return i||Id.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 Rd(t,e,i,r){return t instanceof Array?t.map(t=>Rd(t,e,i,r)):null===t?t: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?{rr_type:t.constructor.name,args:[Object.values(t)]}:t instanceof ArrayBuffer?{rr_type:t.constructor.name,base64:Md(t)}:t instanceof DataView?{rr_type:t.constructor.name,args:[Rd(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:[Rd(t.data,e,i,r),t.width,t.height]}:Pd(t,e)||"object"==typeof t?{rr_type:t.constructor.name,index:Ed(t,e,i)}:t}var Ad=(t,e,i,r)=>t.map(t=>Rd(t,e,i,r)),Pd=(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]))},Fd=["webgl","webgl2"];function Od(t){return"nodeType"in t}function $d(t,e,i,r){var s=[];try{if(r){var o=function(t,e,i){var r=t.GPUCanvasContext;if((null==r?void 0:r.prototype)&&"function"==typeof r.prototype.configure)return ru(r.prototype,"configure",function(r){return function(s){var o=function(t){var e=t.canvas;return e&&"object"==typeof e?e:null}(this);if(!o||Od(o)&&Bh(o,e,i,!0))return r.call(this,s);Od(o)&&!("__context"in o)&&(o.__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&&s?n({},s,{usage:"number"==typeof s.usage?s.usage|a:a}):s)}})}(t,e,i);o&&s.push(o)}var a=ru(t.HTMLCanvasElement.prototype,"getContext",function(t){return function(n){for(var s=function(t){return"experimental-webgl"===t?"webgl":t}(n),o=arguments.length,a=new Array(o>1?o-1:0),l=1;o>l;l++)a[l-1]=arguments[l];if(!Bh(this,e,i,!0)&&("__context"in this||(this.__context=s),r&&Fd.includes(s)))if(a[0]&&"object"==typeof a[0]){var u=a[0];u.preserveDrawingBuffer||(u.preserveDrawingBuffer=!0)}else a.splice(0,1,{preserveDrawingBuffer:!0});return t.apply(this,[n,...a])}});s.push(a)}catch(t){console.error("failed to patch HTMLCanvasElement.prototype.getContext")}return()=>{s.forEach(t=>t())}}function Dd(t,e,i,r,n,s,o){var a=[],l=Object.getOwnPropertyNames(t),u=function(l){if(["isContextLost","canvas","drawingBufferWidth","drawingBufferHeight"].includes(l))return 0;try{if("function"!=typeof t[l])return 0;var u=ru(t,l,function(t){return function(){for(var a=arguments.length,u=new Array(a),h=0;a>h;h++)u[h]=arguments[h];var d=t.apply(this,u);if(Ed(d,s,this),this.canvas&&"tagName"in this.canvas&&!Bh(this.canvas,r,n,!0)){var v={type:e,property:l,args:Ad(u,s,this,o)};i(this.canvas,v)}return d}});a.push(u)}catch(s){var h=$h(t,l,{set(t){this.canvas&&"tagName"in this.canvas&&!Bh(this.canvas,r,n,!0)&&i(this.canvas,{type:e,property:l,args:[t],setter:!0})}});a.push(h)}};for(var h of l)u(h);return a}var Ld='(function() {\n\t//#region ../../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/base64-arraybuffer/1.0.2/f63fa6b5c318cf1c9f6bdd1d4292ad2f15f76f2ec78475025a2d44070e896fe9/node_modules/base64-arraybuffer/dist/base64-arraybuffer.es5.js\n\tvar chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";\n\tvar lookup = typeof Uint8Array === "undefined" ? [] : /* @__PURE__ */ new Uint8Array(256);\n\tfor (var i = 0; i < chars.length; i++) lookup[chars.charCodeAt(i)] = i;\n\tvar encode = function(arraybuffer) {\n\t\tvar bytes = new Uint8Array(arraybuffer), i, len = bytes.length, base64 = "";\n\t\tfor (i = 0; i < len; i += 3) {\n\t\t\tbase64 += chars[bytes[i] >> 2];\n\t\t\tbase64 += chars[(bytes[i] & 3) << 4 | bytes[i + 1] >> 4];\n\t\t\tbase64 += chars[(bytes[i + 1] & 15) << 2 | bytes[i + 2] >> 6];\n\t\t\tbase64 += chars[bytes[i + 2] & 63];\n\t\t}\n\t\tif (len % 3 === 2) base64 = base64.substring(0, base64.length - 1) + "=";\n\t\telse if (len % 3 === 1) base64 = base64.substring(0, base64.length - 2) + "==";\n\t\treturn base64;\n\t};\n\t//#endregion\n\t//#region ../rrweb/src/record/workers/image-bitmap-data-url-worker.ts\n\tconst lastFingerprintMap = /* @__PURE__ */ new Map();\n\tconst transparentFingerprintMap = /* @__PURE__ */ new Map();\n\tconst lastSentAtMap = /* @__PURE__ */ new Map();\n\tconst PROVIDER_KEYFRAME_INTERVAL_MS = 3e4;\n\tfunction hashPixels(data) {\n\t\tconst view = new Uint32Array(data.buffer, data.byteOffset, data.byteLength >>> 2);\n\t\tlet primaryHash = 2166136261;\n\t\tlet secondaryHash = 2654435769;\n\t\tfor (let i = 0; i < view.length; i++) {\n\t\t\tprimaryHash ^= view[i];\n\t\t\tprimaryHash = Math.imul(primaryHash, 16777619);\n\t\t\tsecondaryHash ^= view[i];\n\t\t\tsecondaryHash = Math.imul(secondaryHash, 2246822507);\n\t\t}\n\t\treturn `${(primaryHash >>> 0).toString(16)}:${(secondaryHash >>> 0).toString(16)}`;\n\t}\n\tfunction frameFingerprint(width, height, data) {\n\t\treturn `${width}x${height}:${hashPixels(data)}`;\n\t}\n\tfunction transparentFingerprint(width, height) {\n\t\tconst pixelCount = width * height;\n\t\tlet hash = transparentFingerprintMap.get(pixelCount);\n\t\tif (hash === void 0) {\n\t\t\thash = hashPixels(new Uint8ClampedArray(pixelCount * 4));\n\t\t\ttransparentFingerprintMap.set(pixelCount, hash);\n\t\t}\n\t\treturn `${width}x${height}:${hash}`;\n\t}\n\tconst worker = self;\n\tlet reusableCanvas = null;\n\tlet reusableCtx = null;\n\tworker.onmessage = async function(e) {\n\t\tif ("resetFrameDedup" in e.data) {\n\t\t\tlastFingerprintMap.clear();\n\t\t\treturn;\n\t\t}\n\t\tif ("OffscreenCanvas" in globalThis) {\n\t\t\tconst { id, bitmap, width, height, displayWidth, displayHeight, dataURLOptions, maskRegions } = e.data;\n\t\t\ttry {\n\t\t\t\tif (!reusableCanvas || reusableCanvas.width !== width || reusableCanvas.height !== height) {\n\t\t\t\t\treusableCanvas = new OffscreenCanvas(width, height);\n\t\t\t\t\treusableCtx = reusableCanvas.getContext("2d", { willReadFrequently: true });\n\t\t\t\t}\n\t\t\t\tconst ctx = reusableCtx;\n\t\t\t\tctx.clearRect(0, 0, width, height);\n\t\t\t\tctx.drawImage(bitmap, 0, 0);\n\t\t\t\tbitmap.close();\n\t\t\t\tif (maskRegions) {\n\t\t\t\t\tctx.fillStyle = "black";\n\t\t\t\t\tfor (const region of maskRegions) ctx.fillRect(region.x, region.y, region.width, region.height);\n\t\t\t\t}\n\t\t\t\tconst fingerprint = frameFingerprint(width, height, ctx.getImageData(0, 0, width, height).data);\n\t\t\t\tif (fingerprint === (lastFingerprintMap.get(id) ?? transparentFingerprint(width, height))) {\n\t\t\t\t\tconst lastSentAt = lastSentAtMap.get(id);\n\t\t\t\t\tif (!(maskRegions !== void 0 && lastSentAt !== void 0 && Date.now() - lastSentAt >= PROVIDER_KEYFRAME_INTERVAL_MS)) return worker.postMessage({ id });\n\t\t\t\t}\n\t\t\t\tconst blob = await reusableCanvas.convertToBlob(dataURLOptions);\n\t\t\t\tconst arrayBuffer = await blob.arrayBuffer();\n\t\t\t\tworker.postMessage({\n\t\t\t\t\tid,\n\t\t\t\t\ttype: blob.type,\n\t\t\t\t\tbase64: encode(arrayBuffer),\n\t\t\t\t\tdisplayWidth,\n\t\t\t\t\tdisplayHeight\n\t\t\t\t});\n\t\t\t\tlastFingerprintMap.set(id, fingerprint);\n\t\t\t\tlastSentAtMap.set(id, Date.now());\n\t\t\t} catch {\n\t\t\t\tworker.postMessage({ id });\n\t\t\t}\n\t\t} else {\n\t\t\te.data.bitmap.close();\n\t\t\treturn worker.postMessage({ id: e.data.id });\n\t\t}\n\t};\n\t//#endregion\n})();\n',Nd="undefined"!=typeof self&&self.Blob&&new Blob(["(self.URL || self.webkitURL).revokeObjectURL(self.location.href);",Ld],{type:"text/javascript;charset=utf-8"});function qd(t){var e;try{if(!(e=Nd&&(self.URL||self.webkitURL).createObjectURL(Nd)))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(Ld),{name:null==t?void 0:t.name})}}var jd,Bd,Hd,zd=class{onFullSnapshot(){var t;null===(t=this.resetFrameDedup)||void 0===t||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}constructor(t){Au(this,"pendingCanvasMutations",new Map),Au(this,"rafStamps",{latestId:0,invokeId:null}),Au(this,"mirror",void 0),Au(this,"mutationCb",void 0),Au(this,"resetObservers",void 0),Au(this,"frozen",!1),Au(this,"locked",!1),Au(this,"rafIdTimestamp",null),Au(this,"rafIdFlush",null),Au(this,"refCount",0),Au(this,"torndown",!1),Au(this,"resetFrameDedup",null),Au(this,"processMutation",(t,e)=>{(this.rafStamps.invokeId&&this.rafStamps.latestId!==this.rafStamps.invokeId||!this.rafStamps.invokeId)&&(this.rafStamps.invokeId=this.rafStamps.latestId),this.pendingCanvasMutations.has(t)||this.pendingCanvasMutations.set(t,[]),this.pendingCanvasMutations.get(t).push(e)});var e=t.sampling,i=void 0===e?"all":e,r=t.win,n=t.blockClass,s=t.blockSelector,o=t.recordCanvas,a=t.dataURLOptions,l=t.resolutionScale,u=t.canvasMasking;this.mutationCb=t.mutationCb,this.mirror=t.mirror,o&&"all"===i&&this.initCanvasMutationObserver(r,n,s,a),o&&"number"==typeof i&&this.initCanvasFPSObserver(i,r,n,s,{dataURLOptions:a,resolutionScale:l,canvasMasking:u})}initCanvasFPSObserver(t,e,i,r,n){var s=this;if("OffscreenCanvas"in e){var a,l="number"==typeof n.resolutionScale&&Number.isFinite(n.resolutionScale)?Math.min(1,Math.max(.1,n.resolutionScale)):1,u=$d(e,i,r,!0),h=new Map;try{a=new qd}catch(t){return}var d=!1;a.onerror=()=>{var t;d=!0,cancelAnimationFrame(v),null===(t=a.terminate)||void 0===t||t.call(a),this.resetFrameDedup=null},this.resetFrameDedup=()=>{a.postMessage({resetFrameDedup:!0})},a.onmessage=t=>{var e=t.data.id;if(h.set(e,!1),"base64"in t.data){var i=t.data,r=i.displayWidth,n=i.displayHeight;this.mutationCb({id:e,type:Ul["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 v,c=1e3/t,f=0,p=t=>{var u,g;d||(f&&c>t-f||(f=t,(u=[],g=t=>{try{t.querySelectorAll("canvas").forEach(t=>{Bh(t,i,r,!0)||u.push(t)}),t.querySelectorAll("*").forEach(t=>{t.shadowRoot&&g(t.shadowRoot)})}catch(t){}},g(e.document),u).forEach(function(){var t=o(function*(t){var e=s.mirror.getId(t);if(!h.get(e)&&0!==t.width&&0!==t.height){h.set(e,!0);try{if(["webgl","webgl2"].includes(t.__context)){var i,r,o=t.getContext(t.__context);if(null==o||null===(i=o.isContextLost)||void 0===i?void 0:i.call(o))return void h.set(e,!1);!1===(null==o||null===(r=o.getContextAttributes())||void 0===r?void 0:r.preserveDrawingBuffer)&&o.clear(o.COLOR_BUFFER_BIT)}var u=t.clientWidth||t.width,d=t.clientHeight||t.height,v=Math.max(1,Math.round(u*l)),c=Math.max(1,Math.round(d*l)),f=function(t,e,i,r,n,s){if(t&&"function"==typeof t.regionsFn){var o;try{o=t.regionsFn(e)}catch(t){return kd}if(void 0!==o){if(!Array.isArray(o)||!o.every(Sd))return kd;var a=i/n,l=r/s;return o.filter(t=>t.width>0&&t.height>0).map(t=>{var e=Math.floor(t.x*a),i=Math.floor(t.y*l);return{x:e,y:i,width:Math.ceil((t.x+t.width)*a)-e,height:Math.ceil((t.y+t.height)*l)-i}})}}}(n.canvasMasking,t,v,c,u,d);if("skip-frame"===f)return void h.set(e,!1);var p=yield createImageBitmap(t,1>l?{resizeWidth:v,resizeHeight:c,resizeQuality:"medium"}:{resizeWidth:v,resizeHeight:c});a.postMessage({id:e,bitmap:p,width:v,height:c,displayWidth:u,displayHeight:d,dataURLOptions:n.dataURLOptions,maskRegions:f},[p])}catch(t){h.set(e,!1)}}});return function(e){return t.apply(this,arguments)}}())),v=requestAnimationFrame(p))};v=requestAnimationFrame(p),this.resetObservers=()=>{var t;u(),cancelAnimationFrame(v),null===(t=a.terminate)||void 0===t||t.call(a),this.resetFrameDedup=null}}}initCanvasMutationObserver(t,e,i,r){this.startRAFTimestamping(),this.startPendingCanvasMutationFlusher();var n=$d(t,e,i,!1),s=function(t,e,i,r,n){var s=[],o=Object.getOwnPropertyNames(e.CanvasRenderingContext2D.prototype),a=function(o){try{if("function"!=typeof e.CanvasRenderingContext2D.prototype[o])return 1;var a=ru(e.CanvasRenderingContext2D.prototype,o,function(s){return function(){for(var a=arguments.length,l=new Array(a),u=0;a>u;u++)l[u]=arguments[u];return Bh(this.canvas,i,r,!0)||setTimeout(()=>{var i=Ad(l,e,this,n);t(this.canvas,{type:Ul["2D"],property:o,args:i})},0),s.apply(this,l)}});s.push(a)}catch(n){var l=$h(e.CanvasRenderingContext2D.prototype,o,{set(e){Bh(this.canvas,i,r,!0)||t(this.canvas,{type:Ul["2D"],property:o,args:[e],setter:!0})}});s.push(l)}};for(var l of o)if(a(l))continue;return()=>{s.forEach(t=>t())}}(this.processMutation.bind(this),t,e,i,r),o=function(t,e,i,r,n){var s=[];return void 0!==e.WebGLRenderingContext&&s.push(...Dd(e.WebGLRenderingContext.prototype,Ul.WebGL,t,i,r,e,n)),void 0!==e.WebGL2RenderingContext&&s.push(...Dd(e.WebGL2RenderingContext.prototype,Ul.WebGL2,t,i,r,e,n)),()=>{s.forEach(t=>t())}}(this.processMutation.bind(this),t,e,i,r);this.resetObservers=()=>{n(),s(),o()}}startPendingCanvasMutationFlusher(){this.rafIdFlush=requestAnimationFrame(()=>this.flushPendingCanvasMutations())}startRAFTimestamping(){var t=e=>{this.rafStamps.latestId=e,this.rafIdTimestamp=requestAnimationFrame(t)};this.rafIdTimestamp=requestAnimationFrame(t)}flushPendingCanvasMutations(){this.pendingCanvasMutations.forEach((t,e)=>{var i=this.mirror.getId(e);this.flushPendingCanvasMutationFor(e,i)}),this.rafIdFlush=requestAnimationFrame(()=>this.flushPendingCanvasMutations())}flushPendingCanvasMutationFor(e,i){if(!this.frozen&&!this.locked){var n=this.pendingCanvasMutations.get(e);if(n&&-1!==i){var s=n.map(e=>r(e,t));this.mutationCb({id:i,type:n[0].type,commands:s}),this.pendingCanvasMutations.delete(e)}}}},Ud=class{constructor(t){var e;Au(this,"trackedLinkElements",new WeakSet),Au(this,"pendingDeferredSheets",new Set),Au(this,"mutationCb",void 0),Au(this,"adoptedStyleSheetCb",void 0),Au(this,"maskAllElementAttributes",void 0),Au(this,"maskAttributeFn",void 0),Au(this,"styleMirror",new Zh),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=Wu(r))}catch(t){}if(!i||!r)return Iu(),null;var n=i,s=!1,o={sheet:r,invalidate(){s=!0}};this.pendingDeferredSheets.add(o);var a=!1;return{advance:i=>{if(a)return!0;var l,u,h=su(),d=lu(),v=!0;try{if(s)return a=!0,Iu(),!0;if(!n.advance(i))return v=!1,!1;a=!0;var c=n.text();if(!t.isConnected)return!0;var f=null;try{f=t.sheet}catch(t){}return f!==r?(Iu(),!0):c?(this.emitCssTextMutation(t,e,c),!0):(Iu(),!0)}finally{v&&this.pendingDeferredSheets.delete(o),uu(l=su()-h,null!=(u=d)?u:ou)||(_u.totalMs+=l,l>_u.slowestSliceMs&&(_u.slowestSliceMs=l))}},remainingRules:()=>n.remainingRules(),discard:()=>{this.pendingDeferredSheets.delete(o)}}}onCssomSheetMutation(t){if(t&&0!==this.pendingDeferredSheets.size)for(var e of this.pendingDeferredSheets)e.sheet===t&&(this.pendingDeferredSheets.delete(e),e.invalidate())}inlineDeferredLinkElement(t,e){var i;null===(i=this.beginDeferredLinkInlining(t,e))||void 0===i||i.advance(1/0)}emitCssTextMutation(t,e,i){this.mutationCb({adds:[],removes:[],texts:[],attributes:[{id:e,attributes:{_cssText:Qu({element:t,name:"_cssText",value:i,maskAllElementAttributes:this.maskAllElementAttributes,maskAttributeFn:this.maskAttributeFn})}}]})}trackLinkElement(t){this.trackedLinkElements.has(t)||(this.trackedLinkElements.add(t),this.trackStylesheetInLinkElement(t))}adoptStyleSheets(t,e){var i=this;if(0!==t.length){var r={id:e,styleIds:[]},n=[],s=function(t){var e;if(i.styleMirror.has(t))e=i.styleMirror.getId(t);else{var s=i.styleMirror.add(t);e=s;var o=su();try{Cu(()=>{try{var e=t.rules||t.cssRules;e&&xu(e)}catch(t){}n.push({styleId:s,rules:Array.from(t.rules||CSSRule,(e,i)=>({rule:qu(e,t.href),index:i}))})})}finally{Tu(su()-o)}}r.styleIds.push(e)};for(var o of t)s(o);n.length>0&&(r.styles=n),this.adoptedStyleSheetCb(r)}}reset(){this.styleMirror.reset(),this.trackedLinkElements=new WeakSet,this.pendingDeferredSheets.clear(),wh.forEach(t=>t.abort()),wh.clear()}trackStylesheetInLinkElement(t){}},Wd=class{constructor(){Au(this,"nodeMap",new WeakMap),Au(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(){}},Vd=!1;try{if(2!==Array.from([1],t=>2*t)[0]){var Gd,Zd=document.createElement("iframe");document.body.appendChild(Zd),Array.from=(null===(Gd=Zd.contentWindow)||void 0===Gd?void 0:Gd.Array.from)||Array.from,document.body.removeChild(Zd)}}catch(t){console.debug("Unable to override Array.from",t)}var Jd=new Vu,Qd=new Set([Bl.Mutation,Bl.MediaInteraction,Bl.StyleSheetRule,Bl.CanvasMutation,Bl.Font,Bl.Log,Bl.StyleDeclaration,Bl.AdoptedStyleSheet]);function Kd(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?void 0:t.call(e,i)}}}var r=setTimeout(t,250);return{cancel:()=>clearTimeout(r)}}function Xd(t){var e;void 0===t&&(t={});var i=t,r=i.emit,s=i.checkoutEveryNms,o=i.checkoutEveryNth,a=i.blockClass,l=void 0===a?"rr-block":a,u=i.blockSelector,h=void 0===u?null:u,d=i.ignoreClass,v=void 0===d?"rr-ignore":d,c=i.ignoreSelector,f=void 0===c?null:c,p=i.maskTextClass,g=void 0===p?"rr-mask":p,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,I=void 0!==M&&M,E=i.maskAttributeFn,R=i.hooks,A=i.packFn,P=i.sampling,F=void 0===P?{}:P,O=i.dataURLOptions,D=void 0===O?{}:O,L=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,J=void 0!==Z&&Z,Q=i.collectFonts,K=void 0!==Q&&Q,X=i.inlineImages,Y=void 0!==X&&X,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;Xh=i.errorHandler;var ot=n({type:"image/webp",quality:.4,maxBase64ImageLength:1048576},D),at=!W||window.parent===window,lt=!1;if(!at)try{window.parent.document&&(lt=!1)}catch(t){lt=!0}if(at&&!r)throw new Error("emit function is required");if(!at&&!lt)return()=>{};void 0!==q&&void 0===F.mousemove&&(F.mousemove=q),Jd.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=Mh(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 A&&!lt&&(t=A(t)),t};jd=(t,e)=>{var i,n=t;if(n.timestamp=Dh(),!(null===(i=od[0])||void 0===i?void 0:i.isFrozen())||n.type===jl.FullSnapshot||n.type===jl.IncrementalSnapshot&&Qd.has(n.data.source)||od.forEach(t=>t.unfreeze()),at)null==r||r(gt(n),e);else if(lt){var a={type:"rrweb",event:gt(n),origin:window.location.origin,isCheckout:e};window.parent.postMessage(a,"*")}if(n.type===jl.FullSnapshot)ut=n,ft=0;else if(n.type===jl.IncrementalSnapshot){if(n.data.source===Bl.Mutation&&n.data.isAttachIframe)return;ft++,(o&&ft>=o||s&&n.timestamp-ut.timestamp>s)&&Bd(!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 s=Jd.getNode(r.node.id);s&&"IFRAME"===s.nodeName&&i.add(s)}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()}jd({type:jl.IncrementalSnapshot,data:n({source:Bl.Mutation},t)})},yt=t=>jd({type:jl.IncrementalSnapshot,data:n({source:Bl.Scroll},t)}),bt=t=>jd({type:jl.IncrementalSnapshot,data:n({source:Bl.CanvasMutation},t)}),_t=new Ud({mutationCb:mt,adoptedStyleSheetCb:t=>jd({type:jl.IncrementalSnapshot,data:n({source:Bl.AdoptedStyleSheet},t)}),maskAllElementAttributes:I,maskAttributeFn:E}),wt=new _d({mirror:Jd,mutationCb:mt,stylesheetManager:_t,recordCrossOriginIframes:W,wrappedEmit:jd});for(var kt of tt||[])kt.getMirror&&kt.getMirror({nodeMirror:Jd,crossOriginIframeMirror:wt.crossOriginIframeMirror,crossOriginIframeStyleMirror:wt.crossOriginIframeStyleMirror});var St=new Wd,xt=null==N?void 0:N.configured;Hd=new zd({recordCanvas:z,mutationCb:bt,win:window,blockClass:l,blockSelector:h,mirror:Jd,sampling:F.canvas,dataURLOptions:ot,resolutionScale:L,canvasMasking:N});var Ct=new wd({mutationCb:mt,scrollCb:yt,bypassOptions:{blockClass:l,blockSelector:h,maskTextClass:g,maskTextSelector:y,inlineStylesheet:_,maskInputOptions:ht,dataURLOptions:ot,maskTextFn:T,maskInputFn:C,maskAllElementAttributes:I,maskAttributeFn:E,recordCanvas:z,canvasMaskingConfigured:xt,inlineImages:Y,sampling:F,slimDOMOptions:dt,iframeManager:wt,stylesheetManager:_t,canvasManager:Hd,keepIframeSrcFn:it,processedNodeManager:St,attributeFilter:st},mirror:Jd});Bd=function(t){if(void 0===t&&(t=!1),B){wu(w);try{jd({type:jl.Meta,data:{href:window.location.href,width:qh(),height:Nh()}},t),null==e||e.cancel(),e=void 0,_t.reset(),Ct.init(),od.forEach(t=>t.lock());var i,r=null;try{r=function(t,e){var i=e||{},r=i.mirror,n=void 0===r?new Vu:r,s=i.blockClass,o=void 0===s?"rr-block":s,a=i.blockSelector,l=void 0===a?null:a,u=i.maskTextClass,h=void 0===u?"rr-mask":u,d=i.maskTextSelector,v=void 0===d?null:d,c=i.inlineStylesheet,f=void 0===c||c,p=i.inlineImages,g=void 0!==p&&p,m=i.recordCanvas,y=void 0!==m&&m,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,I=i.dataURLOptions,E=i.preserveWhiteSpace,R=i.onSerialize,A=i.onIframeLoad,P=i.iframeLoadTimeout,F=i.onIframeListenerRegistered,O=i.onStylesheetLoad,D=i.stylesheetLoadTimeout,L=i.keepIframeSrcFn,N=void 0===L?()=>!1:L,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=Mh(void 0!==M&&M);wu(j);try{return Th(t,{doc:t,mirror:n,blockClass:o,blockSelector:l,maskTextClass:h,maskTextSelector:v,skipChild:!1,inlineStylesheet:f,maskInputOptions:B,maskTextFn:k,maskInputFn:S,maskAllElementAttributes:C,maskAttributeFn:T,slimDOMOptions:H,dataURLOptions:I,inlineImages:g,recordCanvas:y,canvasMaskingConfigured:b,preserveWhiteSpace:E,onSerialize:R,onIframeLoad:A,iframeLoadTimeout:P,onIframeListenerRegistered:F,onStylesheetLoad:O,stylesheetLoadTimeout:D,keepIframeSrcFn:N,newlyAddedElement:!1,maxDepth:q})}finally{ku()}}(document,{mirror:Jd,blockClass:l,blockSelector:h,maskTextClass:g,maskTextSelector:y,inlineStylesheet:_,maskAllInputs:ht,inlineStylesheetBudgetRules:w,maskTextFn:T,maskInputFn:C,maskAllElementAttributes:I,maskAttributeFn:E,slimDOM:dt,dataURLOptions:ot,recordCanvas:z,canvasMaskingConfigured:xt,inlineImages:Y,onSerialize(t){Wh(t,Jd)&&wt.addIframe(t),Vh(t,Jd)&&_t.trackLinkElement(t),Gh(t)&&Ct.addShadowRoot(nu.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=gu,gu=[],i=s}if(!r)return console.warn("Failed to snapshot the document");if(jd({type:jl.FullSnapshot,data:{node:r,initialOffset:Lh(window)}},t),od.forEach(t=>t.unlock()),Hd.onFullSnapshot(),i.length){var n=function(t,e,i){var r=!1,n=null,s=0,o=null,a=()=>null!==o||t.length>s,l=()=>{var i=t[s];t[s]=null,s+=1,i&&Ah(()=>{o=e.beginDeferredLinkInlining(i,Jd.getId(i))})},u=()=>{if(o){var t=o,e=!0;Ah(()=>{e=t.advance(200)}),e&&(o=null)}},h=()=>{o||l(),u()},d=t=>{if(n=null,!r){var e=0;do{try{h()}catch(t){null==o||o.discard(),o=null,Eu(1)}e+=1}while(!r&&a()&&(t?!t.didTimeout&&t.timeRemaining()>5:10>e));r||(a()?n=Kd(d):i())}};return n=Kd(d),{cancel(){r=!0,null==o||o.discard(),o=null,null==n||n.cancel(),n=null},flush(){if(!r){r=!0,null==n||n.cancel(),n=null;for(var e=0,h=0;a()&&50>e;){o||l();var d=o;if(d)if(Math.floor(d.remainingRules()/200)+1>50-e)d.discard(),o=null,h+=1;else{try{u()}catch(t){null==o||o.discard(),o=null,h+=1}e+=1}}if(a()||h>0){for(var v=h+(null!==o?1:0),c=s;t.length>c;c++)null!==t[c]&&(v+=1);Eu(v),null==o||o.discard(),o=null}i()}}}}(i,_t,()=>{e===n&&(e=void 0)});e=n}W&&wt.reattachIframes(),document.adoptedStyleSheets&&document.adoptedStyleSheets.length>0&&_t.adoptStyleSheets(document.adoptedStyleSheets,Jd.getId(document))}finally{ku()}var s}};try{var Tt=[];for(var Mt of(Tt.push(Eh("pagehide",()=>{try{null==e||e.flush()}catch(t){}e=void 0},window)),["visibilitychange","freeze","resume"]))Tt.push(Eh(Mt,au,document));vt=t=>{var e=pt.get(t);e&&(e.forEach(t=>{Ah(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=Jd.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 It=t=>{var e;return sd(gd)({mutationCb:mt,mousemoveCb:(t,e)=>jd({type:jl.IncrementalSnapshot,data:{source:e,positions:t}}),mouseInteractionCb:t=>jd({type:jl.IncrementalSnapshot,data:n({source:Bl.MouseInteraction},t)}),scrollCb:yt,viewportResizeCb:t=>jd({type:jl.IncrementalSnapshot,data:n({source:Bl.ViewportResize},t)}),inputCb:t=>jd({type:jl.IncrementalSnapshot,data:n({source:Bl.Input},t)}),mediaInteractionCb:t=>jd({type:jl.IncrementalSnapshot,data:n({source:Bl.MediaInteraction},t)}),styleSheetRuleCb:t=>jd({type:jl.IncrementalSnapshot,data:n({source:Bl.StyleSheetRule},t)}),styleDeclarationCb:t=>jd({type:jl.IncrementalSnapshot,data:n({source:Bl.StyleDeclaration},t)}),canvasMutationCb:bt,fontCb:t=>jd({type:jl.IncrementalSnapshot,data:n({source:Bl.Font},t)}),selectionCb(t){jd({type:jl.IncrementalSnapshot,data:n({source:Bl.Selection},t)})},customElementCb(t){jd({type:jl.IncrementalSnapshot,data:n({source:Bl.CustomElement},t)})},blockClass:l,ignoreClass:v,ignoreSelector:f,maskTextClass:g,maskTextSelector:y,maskInputOptions:ht,inlineStylesheet:_,sampling:F,recordDOM:B,recordCanvas:z,canvasMaskingConfigured:xt,inlineImages:Y,userTriggeredOnInput:J,collectFonts:K,doc:t,maskInputFn:C,maskTextFn:T,maskAllElementAttributes:I,maskAttributeFn:E,keepIframeSrcFn:it,blockSelector:h,slimDOMOptions:dt,dataURLOptions:ot,mirror:Jd,iframeManager:wt,stylesheetManager:_t,shadowDomManager:Ct,processedNodeManager:St,canvasManager:Hd,ignoreCSSAttributes:nt,attributeFilter:st,plugins:(null==tt||null===(e=tt.filter(t=>t.observer))||void 0===e?void 0:e.map(t=>({observer:t.observer,options:t.options,callback:e=>jd({type:jl.Plugin,data:{plugin:t.name,payload:e}})})))||[]},R)};wt.addLoadListener(t=>{try{var e=Jd.getId(t),i=It(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=Jd.getId(t);null==vt||vt(e),hd(t)});var Et=-1,Rt=t=>jd({type:jl.Custom,data:{tag:"rrweb/fullscreen",payload:t}}),At=()=>{var t,e,i,r,n=document,s=null!==(t=null!==(e=null!==(i=null!==(r=n.fullscreenElement)&&void 0!==r?r:n.webkitFullscreenElement)&&void 0!==i?i:n.mozFullScreenElement)&&void 0!==e?e:n.msFullscreenElement)&&void 0!==t?t:null,o=s?Jd.getId(s):-1;o!==Et&&(-1!==Et&&Rt({id:Et,enter:!1}),Et=o,-1!==o&&Rt({id:o,enter:!0}))},Pt=()=>{Bd();var t=It(document);"function"==typeof t&&Tt.push(t),Tt.push(Eh("fullscreenchange",At)),Tt.push(Eh("webkitfullscreenchange",At)),Tt.push(Eh("mozfullscreenchange",At)),Tt.push(Eh("MSFullscreenChange",At)),Vd=!0};return["interactive","complete"].includes(document.readyState)?Pt():(Tt.push(Eh("DOMContentLoaded",()=>{jd({type:jl.DomContentLoaded,data:{}}),"DOMContentLoaded"===G&&Pt()})),Tt.push(Eh("load",()=>{jd({type:jl.Load,data:{}}),"load"===G&&Pt()},window))),()=>{try{null==e||e.flush()}catch(t){}e=void 0,Tt.forEach(t=>Ah(t)),St.destroy(),wt.removeLoadListener(),wt.destroy(),pt.clear(),Ct.reset(),Jd.reset(),Vd=!1,Xh=void 0}}catch(t){console.warn(t)}}function Yd(t){return Yd="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Yd(t)}function tv(t,e,i){return(e=function(t){var e=function(t){if("object"!=Yd(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var i=e.call(t,"string");if("object"!=Yd(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==Yd(e)?e:e+""}(e))in t?Object.defineProperty(t,e,{value:i,enumerable:!0,configurable:!0,writable:!0}):t[e]=i,t}Xd.addCustomEvent=(t,e)=>{if(!Vd)throw new Error("please add custom event after start recording");jd({type:jl.Custom,data:{tag:t,payload:e}})},Xd.freezePage=()=>{od.forEach(t=>t.freeze())},Xd.takeFullSnapshot=t=>{if(!Vd)throw new Error("please take full snapshot after start recording");Bd(t)},Xd.mirror=Jd,"Mobile".toLowerCase(),"Tablet".toLowerCase(),new RegExp("Xbox","i"),new RegExp("Nintendo","i"),new RegExp("PlayStation","i"),new RegExp("Windows","i"),Date,Date;var ev=class{constructor(t){tv(this,"fileName",void 0),tv(this,"functionName",void 0),tv(this,"lineNumber",void 0),tv(this,"columnNumber",void 0),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}},iv=/(^|@)\S+:\d+/,rv=/^\s*at .*(\S+:\d+|\(native\))/m,nv=/^(eval@)?(\[native code])?$/,sv={parse(t){return t?void 0!==t.stacktrace||void 0!==t["opera#sourceloc"]?this.parseOpera(t):t.stack&&t.stack.match(rv)?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(rv)},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());return new ev({functionName:r.join(" ")||void 0,fileName:["eval","<anonymous>"].indexOf(n[0])>-1?void 0:n[0],lineNumber:n[1],columnNumber:n[2]})},this)},parseFFOrSafari(t){return t.stack.split("\n").filter(function(t){return!t.match(nv)},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 ev({functionName:t});var e=/((.*".+"[^@]*)?[^@]*)(?:@)/,i=t.match(e),r=i&&i[1]?i[1]:void 0,n=this.extractLocation(t.replace(e,""));return new ev({functionName:r,fileName:n[0],lineNumber:n[1],columnNumber:n[2]})},this)},parseOpera(t){return!t.stacktrace||t.message.indexOf("\n")>-1&&t.message.split("\n").length>t.stacktrace.split("\n").length?this.parseOpera9(t):t.stack?this.parseOpera11(t):this.parseOpera10(t)},parseOpera9(t){for(var e=/Line (\d+).*script (?:in )?(\S+)/i,i=t.message.split("\n"),r=[],n=2,s=i.length;s>n;n+=2){var o=e.exec(i[n]);o&&r.push(new ev({fileName:o[2],lineNumber:parseFloat(o[1])}))}return r},parseOpera10(t){for(var e=/Line (\d+).*script (?:in )?(\S+)(?:: In function (\S+))?$/i,i=t.stacktrace.split("\n"),r=[],n=0,s=i.length;s>n;n+=2){var o=e.exec(i[n]);o&&r.push(new ev({functionName:o[3]||void 0,fileName:o[2],lineNumber:parseFloat(o[1])}))}return r},parseOpera11(t){return t.stack.split("\n").filter(function(t){return!!t.match(iv)&&!t.match(/^Error created at/)},this).map(function(t){var e=t.split("@"),i=this.extractLocation(e.pop());return new ev({functionName:(e.shift()||"").replace(/<anonymous function(: (\w+))?>/,"$2").replace(/\([^)]*\)/g,"")||void 0,fileName:i[0],lineNumber:i[1],columnNumber:i[2]})},this)}};function ov(t){if(!t||!t.outerHTML)return"";for(var e="";t.parentElement;){var i=t.localName;if(!i)break;i=i.toLowerCase();var r=t.parentElement,n=[];if(r.children&&r.children.length>0)for(var s=0;r.children.length>s;s++){var o=r.children[s];o.localName&&o.localName.toLowerCase&&o.localName.toLowerCase()===i&&n.push(o)}n.length>1&&(i+=":eq("+n.indexOf(t)+")"),e=i+(e?">"+e:""),t=r}return e}function av(t){return Array.isArray(t)}function lv(t){return"object"==typeof t&&null!==t&&!av(t)}function uv(t,e){if(0===e)return!0;for(var i of Object.keys(t))if(lv(t[i])&&uv(t[i],e-1))return!0;return!1}function hv(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(lv(o=e)&&Object.keys(o).length>i.numOfKeysLimit||"function"==typeof o||lv(o)&&uv(o,i.depthOfLimit))return function(t){var e=t.toString();return i.stringLengthLimit&&e.length>i.stringLengthLimit&&(e=e.slice(0,i.stringLengthLimit)+"..."),e}(e);var o;if("bigint"==typeof e)return e.toString()+"n";if(e instanceof Event){var a={};for(var l in e){var u=e[l];a[l]=av(u)?ov(u.length?u[0]:null):u}return a}return e instanceof Node?e instanceof HTMLElement?e?e.outerHTML:"":e.nodeName:e instanceof Error?e.stack?e.stack+"\nEnd of stack for Error object":e.name+": "+e.message:e})}var dv={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 vv(t,e,i){var r,n=i?Object.assign({},dv,i):dv,s=n.logger;if(!s)return()=>{};r="string"==typeof s?e[s]:s;var o=0,a=!1,l=[];if(n.level.includes("error")){var u=e=>{var i=e.message;t({level:"error",trace:sv.parse(e.error).map(t=>t.toString()),payload:[hv(i,n.stringifyOptions)]})};e.addEventListener("error",u),l.push(()=>{e.removeEventListener("error",u)});var h=e=>{var i,r;e.reason instanceof Error?r=[hv("Uncaught (in promise) "+(i=e.reason).name+": "+i.message,n.stringifyOptions)]:(i=new Error,r=[hv("Uncaught (in promise)",n.stringifyOptions),hv(e.reason,n.stringifyOptions)]),t({level:"error",trace:sv.parse(i).map(t=>t.toString()),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){try{if(!(s in e))return()=>{};var l=e[s],u={next:l},h=(e=>function(){for(var s=arguments.length,l=new Array(s),u=0;s>u;u++)l[u]=arguments[u];if(e.apply(r,l),!("assert"===i&&l[0]||a)){a=!0;try{var h=sv.parse(new Error).map(t=>t.toString()).splice(1),d=("assert"===i?l.slice(1):l).map(t=>hv(t,n.stringifyOptions));o++,n.lengthThreshold>o?t({level:i,trace:h,payload:d}):o===n.lengthThreshold&&t({level:"warn",trace:[],payload:[hv("The number of log records reached the threshold.")]})}catch(t){e("rrweb logger error:",t,...l)}finally{a=!1}}})(function(){for(var t=arguments.length,e=new Array(t),i=0;t>i;i++)e[i]=arguments[i];return u.next.apply(this,e)});return"function"==typeof h&&(h.prototype=h.prototype||{},Object.defineProperties(h,{__rrweb_original__:{enumerable:!1,value:l},__rrweb_layer__:{enumerable:!1,value:u}})),e[s]=h,()=>{if(e[s]!==h)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===h)return void(r.next=u.next);r=t(i=r.next)}else e[s]=u.next}}catch(t){return()=>{}}}(e,i):()=>{}}}var cv=t=>({name:"rrweb/console@1",observer:vv,options:t}),fv=()=>{},pv=t=>{var e;if(Ce(t))return null!==(e=t.__posthog_layer__)&&void 0!==e?e:t.__rrweb_layer__};function gv(t,e,i){try{if(!(e in t))return fv;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 Ce(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=pv(i);s;){if(s.next===n)return void(s.next=r.next);s=pv(i=s.next)}else t[e]=r.next}}catch(t){return fv}}function mv(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 yv=Cn("[Recorder]"),bv=t=>"navigation"===t.entryType,_v=t=>"resource"===t.entryType;function wv(t,e){return!!e&&($e(e)||e[t])}function kv(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 Sv=["image/","video/","audio/","font/","application/octet-stream","application/pdf","application/zip","application/wasm"];function xv(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:!!kv(e)&&t(e.url)}catch(t){return!1}}(t.url))return!1;if(n(Sv))return!1;if($e(i))return!0;if(xe(i))return n(i);var s=i[e];return $e(s)?s:n(s)}function Cv(t,e,i,r,n,s){return Tv.apply(this,arguments)}function Tv(){return Tv=o(function*(t,e,i,r,n,s){return void 0===s&&(s=0),s>10?(yv.warn("Failed to get performance entry for request",{url:i,initiatorType:e}),null):function(t,e){for(var i=t.length-1;i>=0;i-=1)if(e(t[i]))return t[i]}(t.performance.getEntriesByName(i),t=>_v(t)&&t.initiatorType===e&&(Ie(r)||t.startTime>=r)&&(Ie(n)||n>=t.startTime))||(yield new Promise(t=>setTimeout(t,50*s)),Cv(t,e,i,r,n,s+1))}),Tv.apply(this,arguments)}function Mv(t){var e=t.body,i=t.options,r=t.url;if(Pe(e))return null;var n=mv(r,i);if(n.isHostDenied)return n.hostname+" is in deny list";if(Ee(e))return e;if((t=>"u">typeof Document&&t instanceof Document)(e))return e.textContent;if(De(e))return jn(e);if(Te(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 Iv=t=>!Ae(t)&&("navigation"===t.entryType||"resource"===t.entryType);function Ev(t){var e=t.entry,i=t.method,r=t.status,s=t.networkRequest,o=t.isInitial,a=t.start,l=t.end,u=t.url,h=t.initiatorType;a=e?e.startTime:a,l=e?e.responseEnd:l;var d=Math.floor(Date.now()-performance.now()),v=Math.floor(d+(a||0)),c=[n({},e?e.toJSON():{name:u},{startTime:Ie(a)?void 0:Math.round(a),endTime:Ie(l)?void 0:Math.round(l),timeOrigin:d,timestamp:v,method:i,initiatorType:h||(e?e.initiatorType:void 0),status:r,requestHeaders:s.requestHeaders,requestBody:s.requestBody,responseHeaders:s.responseHeaders,responseBody:s.responseBody,isInitial:o})];if(Iv(e))for(var f of e.serverTiming||[])c.push({timeOrigin:d,timestamp:v,startTime:Math.round(e.startTime),name:f.name,duration:f.duration,entryType:"serverTiming"});return c}var Rv=["video/","audio/"];function Av(t){return Te(t)&&Ce(t.getReader)&&Ce(t.tee)}var Pv="[SessionReplay] Timeout while trying to read body",Fv="[SessionReplay] Failed to read body";function Ov(t){return Fv+": "+t}function $v(t){return"[SessionReplay] Body too large to record (> "+t+" bytes)"}function Dv(t,e){if(!e.streamNetworkBody)return function(t){return new Promise(e=>{var i=setTimeout(()=>e(Pv),500);try{t.clone().text().then(t=>e(t),t=>e(Ov(t))).finally(()=>clearTimeout(i))}catch(t){clearTimeout(i),e(Fv)}})}(t);var i=Os(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($v(i)):function(t,e){return new Promise(i=>{var r,n=!1;function s(){try{var t;null==(t=r)||t.cancel().catch(()=>{})}catch(t){}}function o(t){n||(n=!0,clearTimeout(l),s(),i(t))}var a,l=setTimeout(()=>o(Pv),500);try{a=t.clone()}catch(t){return void o(Fv)}var u=a.body;if(Av(u)&&"undefined"!=typeof TextDecoder){try{r=u.getReader()}catch(t){return void o(Fv)}var h=[],d=0;!function t(){r.read().then(i=>{var r=i.done,a=i.value;if(n)s();else if(r)o((new TextDecoder).decode(function(t,e){var i=new Uint8Array(e),r=0;for(var n of t)i.set(n,r),r+=n.byteLength;return i}(h,d)));else{if(a){if(d+a.byteLength>e)return void o($v(e));d+=a.byteLength,h.push(a)}t()}},t=>o(Ov(t)))}()}else try{a.text().then(t=>o(t),t=>o(Ov(t)))}catch(t){o(Fv)}})}(t,i)}function Lv(){return Lv=o(function*(t){var e=t.r,i=t.options,r=mv(t.url,i);return r.isHostDenied?Promise.resolve(r.hostname+" is in deny list"):Dv(e,i)}),Lv.apply(this,arguments)}function Nv(){return Nv=o(function*(t){var e=t.r,i=t.options,r=function(t){var e,i=t.r,r=t.options,n=t.url;if("chunked"===i.headers.get("Transfer-Encoding"))return"Chunked Transfer-Encoding is not supported";var s=null==(e=i.headers.get("Content-Type"))?void 0:e.toLowerCase(),o=Rv.some(t=>null==s?void 0:s.startsWith(t));if(s&&o)return"Content-Type "+s+" is not supported";var a=mv(n,r);return a.isHostDenied?a.hostname+" is in deny list":null}({r:e,options:i,url:t.url});return Ae(r)?Dv(e,i):Promise.resolve(r)}),Nv.apply(this,arguments)}var qv=null;function jv(t,e,i){if(!("performance"in e))return()=>{};if(qv)return yv.warn("Network observer already initialised, doing nothing"),()=>{};var r=i?Object.assign({},$s,i):$s,s=e=>{var i=[],s=!1;e.requests.forEach(t=>{var e="serverTiming"===t.entryType;if(!e||!s){var n=r.maskRequestFn(t);e||(s=!n||(t=>!!t&&zs.has(t))(n)),n&&i.push(n)}}),i.length>0&&t(n({},e,{requests:i}))},a=function(t,e,i){i.recordInitialRequests&&t({requests:e.performance.getEntries().filter(t=>bv(t)||_v(t)&&i.initiatorTypes.includes(t.initiatorType)).flatMap(t=>Ev({entry:t,method:void 0,status:void 0,networkRequest:{},isInitial:!0})),isInitial:!0});var r=new e.PerformanceObserver(e=>{t({requests:e.getEntries().filter(t=>bv(t)||_v(t)&&i.initiatorTypes.includes(t.initiatorType)&&(t=>!i.recordBody&&!i.recordHeaders||"xmlhttprequest"!==t.initiatorType&&"fetch"!==t.initiatorType)(t)).flatMap(t=>Ev({entry:t,method:void 0,status:void 0,networkRequest:{}}))})}),n=PerformanceObserver.supportedEntryTypes.filter(t=>i.performanceEntryTypeToObserve.includes(t));return r.observe({entryTypes:n}),()=>{r.disconnect()}}(s,e,r),l=()=>{},u=()=>{};return(r.recordHeaders||r.recordBody)&&(l=function(t,e,i){if(!i.initiatorTypes.includes("xmlhttprequest"))return()=>{};var r=wv("request",i.recordHeaders),n=wv("response",i.recordHeaders),s=gv(e.XMLHttpRequest.prototype,"open",s=>function(o,a,l,u,h){void 0===l&&(l=!0);var d=this;try{var v,c,f=new Request(a),p={},g={},m=d.setRequestHeader.bind(d);d.setRequestHeader=(t,e)=>(g[t]=e,m(t,e)),r&&(p.requestHeaders=g);var y=d.send.bind(d);d.send=t=>(xv({type:"request",headers:g,url:a,recordBody:i.recordBody})&&(p.requestBody=Mv({body:t,options:i,url:a})),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),xv({type:"response",headers:r,url:a,recordBody:i.recordBody})&&(p.responseBody=Mv({body:d.response,options:i,url:a})),Cv(e,"xmlhttprequest",f.url,v,c).then(e=>{t({requests:Ev({entry:e,method:o,status:null==d?void 0:d.status,networkRequest:p,start:v,end:c,url:a.toString(),initiatorType:"xmlhttprequest"})})}).catch(()=>{})}};d.addEventListener("readystatechange",_),d.addEventListener("error",b),d.addEventListener("abort",b),d.addEventListener("timeout",b)}catch(t){yv.error("Failed to instrument XHR for network capture",t)}s.call(d,o,a.toString(),l,u,h)});return()=>{s()}}(s,e,r),u=function(t,e,i){if(!i.initiatorTypes.includes("fetch"))return()=>{};var r=wv("request",i.recordHeaders),n=wv("response",i.recordHeaders),s=gv(e,"fetch",s=>function(){var a=o(function*(o,a){var l,u;try{l=new Request(o,a)}catch(t){return yv.error("Failed to instrument fetch for network capture",t),s(o,a)}var h,d,v={};try{try{var c={};l.headers.forEach((t,e)=>{c[e]=t}),r&&(v.requestHeaders=c),!Av(null==a?void 0:a.body)&&xv({type:"request",headers:c,url:o,recordBody:i.recordBody})&&(v.requestBody=yield function(t){return Lv.apply(this,arguments)}({r:l,options:i,url:o}))}catch(t){yv.error("Failed to record fetch request for network capture",t)}h=e.performance.now(),u=kv(o)?yield s(l):yield s(o,a),d=e.performance.now();try{var f={};u.headers.forEach((t,e)=>{f[e]=t}),n&&(v.responseHeaders=f),xv({type:"response",headers:f,url:o,recordBody:i.recordBody})&&(v.responseBody=yield function(t){return Nv.apply(this,arguments)}({r:u,options:i,url:o}))}catch(t){yv.error("Failed to record fetch response for network capture",t)}return u}finally{Cv(e,"fetch",l.url,h,d).then(e=>{var i;t({requests:Ev({entry:e,method:l.method,status:null==(i=u)?void 0:i.status,networkRequest:v,start:h,end:d,url:l.url,initiatorType:"fetch"})})}).catch(()=>{})}});return function(t,e){return a.apply(this,arguments)}}());return()=>{s()}}(s,e,r)),qv=()=>{a(),l(),u(),qv=null}}var Bv,Hv,zv,Uv,Wv,Vv,Gv,Zv,Jv,Qv,Kv,Xv,Yv,tc,ec,ic=t=>({name:"rrweb/network@1",observer:jv,options:t});b.__PosthogExtensions__=b.__PosthogExtensions__||{},b.__PosthogExtensions__.rrwebPlugins={getRecordConsolePlugin:cv,getRecordNetworkPlugin:ic},b.__PosthogExtensions__.rrweb={record:Xd,version:"v2",wasMaxDepthReached:()=>Ch,resetMaxDepthState(){Ch=!1,xh=!1},getLastSnapshotCost:()=>fu,getMutationCost:()=>n({},bu),resetSnapshotCostState(){hu=0,du=0,vu=0,ou=0,cu={durationMs:0,stylesheetMs:0,nodeCount:0,cssRuleCount:0,nonDeferrableCssRuleCount:0,deferredStylesheetCount:0},fu=null,pu=null,gu=[],mu=0,yu=0,bu={slowestBatchMs:0},_u={deferredCount:0,failedCount:0,abandonedCount:0,totalMs:0,slowestSliceMs:0}}},b.rrweb={record:Xd,version:"v2"},b.rrwebConsoleRecord={getRecordConsolePlugin:cv},b.getRecordNetworkPlugin=ic,b.__PosthogExtensions__=b.__PosthogExtensions__||{},b.__PosthogExtensions__.initSessionRecording=(t,e)=>new ql(t,e);var rc,nc,sc,oc,ac={},lc=[],uc=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,hc=Array.isArray;function dc(t,e){for(var i in e)t[i]=e[i];return t}function vc(t){t&&t.parentNode&&t.parentNode.removeChild(t)}function cc(t,e,i){var r,n,s,o={};for(s in e)"key"==s?r=e[s]:"ref"==s?n=e[s]:o[s]=e[s];if(arguments.length>2&&(o.children=arguments.length>3?Bv.call(arguments,2):i),"function"==typeof t&&null!=t.defaultProps)for(s in t.defaultProps)void 0===o[s]&&(o[s]=t.defaultProps[s]);return fc(t,o,r,n,null)}function fc(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?++zv:n,__i:-1,__u:0};return null==n&&null!=Hv.vnode&&Hv.vnode(s),s}function pc(t){return t.children}function gc(t,e){this.props=t,this.context=e}function mc(t,e){if(null==e)return t.__?mc(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?mc(t):null}function yc(t){if(t.__P&&t.__d){var e=t.__v,i=e.__e,r=[],n=[],s=dc({},e);s.__v=e.__v+1,Hv.vnode&&Hv.vnode(s),Ic(t.__P,s,e,t.__n,t.__P.namespaceURI,32&e.__u?[i]:null,r,null==i?mc(e):i,!!(32&e.__u),n),s.__v=e.__v,s.__.__k[s.__i]=s,Rc(r,s,n),e.__e=e.__=null,s.__e!=i&&bc(s)}}function bc(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}),bc(t)}function _c(t){(!t.__d&&(t.__d=!0)&&Uv.push(t)&&!wc.__r++||Wv!=Hv.debounceRendering)&&((Wv=Hv.debounceRendering)||Vv)(wc)}function wc(){try{for(var t,e=1;Uv.length;)Uv.length>e&&Uv.sort(Gv),t=Uv.shift(),e=Uv.length,yc(t)}finally{Uv.length=wc.__r=0}}function kc(t,e,i,r,n,s,o,a,l,u,h){var d,v,c,f,p,g,m,y=r&&r.__k||lc,b=e.length;for(l=function(t,e,i,r,n){var s,o,a,l,u,h=i.length,d=h,v=0;for(t.__k=new Array(n),s=0;n>s;s++)null!=(o=e[s])&&"boolean"!=typeof o&&"function"!=typeof o?("string"==typeof o||"number"==typeof o||"bigint"==typeof o||o.constructor==String?o=t.__k[s]=fc(null,o,null,null,null):hc(o)?o=t.__k[s]=fc(pc,{children:o},null,null,null):void 0===o.constructor&&o.__b>0?o=t.__k[s]=fc(o.type,o.props,o.key,o.ref?o.ref:null,o.__v):t.__k[s]=o,l=s+v,o.__=t,o.__b=t.__b+1,a=null,-1!=(u=o.__i=xc(o,i,l,d))&&(d--,(a=i[u])&&(a.__u|=2)),null==a||null==a.__v?(-1==u&&(n>h?v--:h>n&&v++),"function"!=typeof o.type&&(o.__u|=4)):u!=l&&(u==l-1?v--:u==l+1?v++:(u>l?v--:v++,o.__u|=4))):t.__k[s]=null;if(d)for(s=0;h>s;s++)null!=(a=i[s])&&!(2&a.__u)&&(a.__e==r&&(r=mc(a)),Fc(a,a));return r}(i,e,y,l,b),d=0;b>d;d++)null!=(c=i.__k[d])&&(v=-1!=c.__i&&y[c.__i]||ac,c.__i=d,g=Ic(t,c,v,n,s,o,a,l,u,h),f=c.__e,c.ref&&v.ref!=c.ref&&(v.ref&&Pc(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=Sc(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 Sc(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=Sc(n[s],e,i,r));return e}t.__e!=e&&(r&&(e&&t.type&&!e.parentNode&&(e=mc(t)),i.insertBefore(t.__e,e||null)),e=t.__e);do{e=e&&e.nextSibling}while(null!=e&&8==e.nodeType);return e}function xc(t,e,i,r){var n,s,o,a=t.key,l=t.type,u=e[i],h=null!=u&&!(2&u.__u);if(null===u&&null==a||h&&a==u.key&&l==u.type)return i;if(r>(h?1:0))for(n=i-1,s=i+1;n>=0||e.length>s;)if(null!=(u=e[o=0>n?s++:n--])&&!(2&u.__u)&&a==u.key&&l==u.type)return o;return-1}function Cc(t,e,i){"-"==e[0]?t.setProperty(e,null==i?"":i):t[e]=null==i?"":"number"!=typeof i||uc.test(e)?i:i+"px"}function Tc(t,e,i,r,n){var s,o;t:if("style"==e)if("string"==typeof i)t.style.cssText=i;else{if("string"==typeof r&&(t.style.cssText=r=""),r)for(e in r)i&&e in i||Cc(t.style,e,"");if(i)for(e in i)r&&i[e]==r[e]||Cc(t.style,e,i[e])}else if("o"==e[0]&&"n"==e[1])s=e!=(e=e.replace(Kv,"$1")),o=e.toLowerCase(),e=o in t||"onFocusOut"==e||"onFocusIn"==e?o.slice(2):e.slice(2),t.l||(t.l={}),t.l[e+s]=i,i?r?i[Qv]=r[Qv]:(i[Qv]=Xv,t.addEventListener(e,s?tc:Yv,s)):t.removeEventListener(e,s?tc:Yv,s);else{if("http://www.w3.org/2000/svg"==n)e=e.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if("width"!=e&&"height"!=e&&"href"!=e&&"list"!=e&&"form"!=e&&"tabIndex"!=e&&"download"!=e&&"rowSpan"!=e&&"colSpan"!=e&&"role"!=e&&"popover"!=e&&e in t)try{t[e]=null==i?"":i;break t}catch(t){}"function"==typeof i||(null==i||!1===i&&"-"!=e[4]?t.removeAttribute(e):t.setAttribute(e,"popover"==e&&1==i?"":i))}}function Mc(t){return function(e){if(this.l){var i=this.l[e.type+t];if(null==e[Jv])e[Jv]=Xv++;else if(i[Qv]>e[Jv])return;return i(Hv.event?Hv.event(e):e)}}}function Ic(t,e,i,r,n,s,o,a,l,u){var h,d,v,c,f,p,g,m,y,b,$,_,w,k,S,x,C=e.type;if(void 0!==e.constructor)return null;128&i.__u&&(l=!!(32&i.__u),s=[a=e.__e=i.__e]),(h=Hv.__b)&&h(e);t:if("function"==typeof C){d=o.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 gc(y,_),v.constructor=C,v.render=Oc),$&&$.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=dc({},v.__s)),dc(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)}),lc.push.apply(v.__h,v._sb),v._sb=[],v.__h.length&&o.push(v);break t}null!=v.componentWillUpdate&&v.componentWillUpdate(y,v.__s,_),b&&null!=v.componentDidUpdate&&v.__h.push(function(){v.componentDidUpdate(f,p,g)})}if(v.context=_,v.props=y,v.__P=t,v.__e=!1,w=Hv.__r,k=0,b)v.state=v.__s,v.__d=!1,w&&w(e),h=v.render(v.props,v.state,v.context),lc.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=dc(dc({},r),v.getChildContext())),b&&!c&&null!=v.getSnapshotBeforeUpdate&&(g=v.getSnapshotBeforeUpdate(f,p)),S=null!=h&&h.type===pc&&null==h.key?Ac(h.props.children):h,a=kc(t,hc(S)?S:[S],e,i,r,n,s,o,a,l,u),v.base=e.__e,e.__u&=-161,v.__h.length&&o.push(v),m&&(v.__E=v.__=null)}catch(t){if(o.length=d,e.__v=null,l||null!=s)if(t.then){for(e.__u|=l?160:128;a&&8==a.nodeType&&a.nextSibling;)a=a.nextSibling;null!=s&&(s[s.indexOf(a)]=null),e.__e=a}else{if(null!=s)for(x=s.length;x--;)vc(s[x]);Ec(e)}else e.__e=i.__e,!e.__k&&i.__k&&(e.__k=i.__k),t.then||Ec(e);Hv.__e(t,e,i)}}else null==s&&e.__v==i.__v?(e.__k=i.__k,e.__e=i.__e):a=e.__e=function(t,e,i,r,n,s,o,a,l){var u,h,d,v,c,f,p,g=i.props||ac,m=e.props,y=e.type;if("svg"==y?n="http://www.w3.org/2000/svg":"math"==y?n="http://www.w3.org/1998/Math/MathML":n||(n="http://www.w3.org/1999/xhtml"),null!=s)for(u=0;s.length>u;u++)if((c=s[u])&&"setAttribute"in c==!!y&&(y?c.localName==y:3==c.nodeType)){t=c,s[u]=null;break}if(null==t){if(null==y)return document.createTextNode(m);t=document.createElementNS(n,y,m.is&&m),a&&(Hv.__m&&Hv.__m(e,s),a=!1),s=null}if(null==y)g===m||a&&t.data==m||(t.data=m);else{if(s="textarea"==y&&null!=m.defaultValue?null:s&&Bv.call(t.childNodes),!a&&null!=s)for(g={},u=0;t.attributes.length>u;u++)g[(c=t.attributes[u]).name]=c.value;for(u in g)c=g[u],"dangerouslySetInnerHTML"==u?d=c:"children"==u||u in m||"value"==u&&"defaultValue"in m||"checked"==u&&"defaultChecked"in m||Tc(t,u,null,c,n);for(u in m)c=m[u],"children"==u?v=c:"dangerouslySetInnerHTML"==u?h=c:"value"==u?f=c:"checked"==u?p=c:a&&"function"!=typeof c||g[u]===c||Tc(t,u,c,g[u],n);if(h)a||d&&(h.__html==d.__html||h.__html==t.innerHTML)||(t.innerHTML=h.__html),e.__k=[];else if(d&&(t.innerHTML=""),kc("template"==e.type?t.content:t,hc(v)?v:[v],e,i,r,"foreignObject"==y?"http://www.w3.org/1999/xhtml":n,s,o,s?s[0]:i.__k&&mc(i,0),a,l),null!=s)for(u=s.length;u--;)vc(s[u]);a&&"textarea"!=y||(u="value","progress"==y&&null==f?t.removeAttribute("value"):null!=f&&(f!==t[u]||"progress"==y&&!f||"option"==y&&f!=g[u])&&Tc(t,u,f,g[u],n),u="checked",null!=p&&p!=t[u]&&Tc(t,u,p,g[u],n))}return t}(i.__e,e,i,r,n,s,o,l,u);return(h=Hv.diffed)&&h(e),128&e.__u?void 0:a}function Ec(t){t&&(t.__c&&(t.__c.__e=!0),t.__k&&t.__k.some(Ec))}function Rc(t,e,i){for(var r=0;i.length>r;r++)Pc(i[r],i[++r],i[++r]);Hv.__c&&Hv.__c(e,t),t.some(function(e){try{t=e.__h,e.__h=[],t.some(function(t){t.call(e)})}catch(t){Hv.__e(t,e.__v)}})}function Ac(t){return"object"!=typeof t||null==t||t.__b>0?t:hc(t)?t.map(Ac):void 0!==t.constructor?null:dc({},t)}function Pc(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){Hv.__e(t,i)}}function Fc(t,e,i){var r,n;if(Hv.unmount&&Hv.unmount(t),(r=t.ref)&&(r.current&&r.current!=t.__e||Pc(r,null,e)),null!=(r=t.__c)){if(r.componentWillUnmount)try{r.componentWillUnmount()}catch(t){Hv.__e(t,e)}r.base=r.__P=r.__n=null}if(r=t.__k)for(n=0;r.length>n;n++)r[n]&&Fc(r[n],e,i||"function"!=typeof t.type);i||vc(t.__e),t.__c=t.__=t.__e=void 0}function Oc(t,e,i){return this.constructor(t,i)}function $c(t,e,i){var r,n,s,o;e==document&&(e=document.documentElement),Hv.__&&Hv.__(t,e),n=(r="function"==typeof i)?null:i&&i.__k||e.__k,s=[],o=[],Ic(e,t=(!r&&i||e).__k=cc(pc,null,[t]),n||ac,ac,e.namespaceURI,!r&&i?[i]:n?null:e.firstChild?Bv.call(e.childNodes):null,s,!r&&i?i:n?n.__e:e.firstChild,r,o),Rc(s,t,o),t.props.children=null}Bv=lc.slice,Hv={__e(t,e,i,r){for(var n,s,o;e=e.__;)if((n=e.__c)&&!n.__)try{if((s=n.constructor)&&null!=s.getDerivedStateFromError&&(n.setState(s.getDerivedStateFromError(t)),o=n.__d),null!=n.componentDidCatch&&(n.componentDidCatch(t,r||{}),o=n.__d),o)return n.__E=n}catch(e){t=e}throw t}},zv=0,gc.prototype.setState=function(t,e){var i=null!=this.__s&&this.__s!=this.state?this.__s:this.__s=dc({},this.state);"function"==typeof t&&(t=t(dc({},i),this.props)),t&&dc(i,t),null!=t&&this.__v&&(e&&this._sb.push(e),_c(this))},gc.prototype.forceUpdate=function(t){this.__v&&(this.__e=!0,t&&this.__h.push(t),_c(this))},gc.prototype.render=pc,Uv=[],Vv="function"==typeof Promise?Promise.prototype.then.bind(Promise.resolve()):setTimeout,Gv=function(t,e){return t.__v.__b-e.__v.__b},wc.__r=0,Zv=Math.random().toString(8),Jv="__d"+Zv,Qv="__a"+Zv,Kv=/(PointerCapture)$|Capture$/i,Xv=0,Yv=Mc(!1),tc=Mc(!0),ec=0;var Dc=0,Lc=[],Nc=Hv,qc=Nc.__b,jc=Nc.__r,Bc=Nc.diffed,Hc=Nc.__c,zc=Nc.unmount,Uc=Nc.__;function Wc(t,e){Nc.__h&&Nc.__h(nc,t,Dc||e),Dc=0;var i=nc.__H||(nc.__H={__:[],__h:[]});return t>=i.__.length&&i.__.push({}),i.__[t]}function Vc(t){return Dc=1,function(t,e){var i=Wc(rc++,2);if(i.t=t,!i.__c&&(i.__=[nf(void 0,e),function(t){var e=i.__N?i.__N[0]:i.__[0],r=i.t(e,t);e!==r&&(i.__N=[r,i.__[1]],i.__c.setState({}))}],i.__c=nc,!nc.__f)){var r=function(t,e,r){if(!i.__c.__H)return!0;var s=!1,o=i.__c.props!==t;if(i.__c.__H.__.some(function(t){if(t.__N){s=!0;var e=t.__[0];t.__=t.__N,t.__N=void 0,e!==t.__[0]&&(o=!0)}}),n){var a=n.call(this,t,e,r);return s?a||o:a}return!s||o};nc.__f=!0;var n=nc.shouldComponentUpdate,s=nc.componentWillUpdate;nc.componentWillUpdate=function(t,e,i){if(this.__e){var o=n;n=void 0,r(t,e,i),n=o}s&&s.call(this,t,e,i)},nc.shouldComponentUpdate=r}return i.__N||i.__}(nf,t)}function Gc(t,e){var i=Wc(rc++,3);!Nc.__s&&rf(i.__H,e)&&(i.__=t,i.u=e,nc.__H.__h.push(i))}function Zc(t){return Dc=5,Jc(function(){return{current:t}},[])}function Jc(t,e){var i=Wc(rc++,7);return rf(i.__H,e)&&(i.__=t(),i.__H=e,i.__h=t),i.__}function Qc(t){var e,i=nc.context[t.__c],r=Wc(rc++,9);return r.c=t,i?(null!==(e=r.__)&&void 0!==e||(r.__=!0,i.sub(nc)),i.props.value):t.__}function Kc(){for(var t;t=Lc.shift();){var e=t.__H;if(t.__P&&e)try{e.__h.some(tf),e.__h.some(ef),e.__h=[]}catch(i){e.__h=[],Nc.__e(i,t.__v)}}}Nc.__b=function(t){nc=null,qc&&qc(t)},Nc.__=function(t,e){t&&e.__k&&e.__k.__m&&(t.__m=e.__k.__m),Uc&&Uc(t,e)},Nc.__r=function(t){jc&&jc(t),rc=0;var e=(nc=t.__c).__H;e&&(sc===nc?(e.__h=[],nc.__h=[],e.__.some(function(t){t.__N&&(t.__=t.__N),t.u=t.__N=void 0})):(e.__h.length&&Kc(),rc=0)),sc=nc},Nc.diffed=function(t){Bc&&Bc(t);var e=t.__c;e&&e.__H&&(e.__H.__h.length&&(1!==Lc.push(e)&&oc===Nc.requestAnimationFrame||((oc=Nc.requestAnimationFrame)||Yc)(Kc)),e.__H.__.some(function(t){t.u&&(t.__H=t.u,t.u=void 0)})),sc=nc=null},Nc.__c=function(t,e){e.some(function(t){try{t.__h.some(tf),t.__h=t.__h.filter(function(t){return!t.__||ef(t)})}catch(i){e.some(function(t){t.__h&&(t.__h=[])}),e=[],Nc.__e(i,t.__v)}}),Hc&&Hc(t,e)},Nc.unmount=function(t){zc&&zc(t);var e,i=t.__c;i&&i.__H&&(i.__H.__.some(function(t){try{tf(t)}catch(t){e=t}}),i.__H=void 0,e&&Nc.__e(e,i.__v))};var Xc="function"==typeof requestAnimationFrame;function Yc(t){var e,i=function(){clearTimeout(r),Xc&&cancelAnimationFrame(e),setTimeout(t)},r=setTimeout(i,35);Xc&&(e=requestAnimationFrame(i))}function tf(t){var e=nc,i=t.__c;"function"==typeof i&&(t.__c=void 0,i()),nc=e}function ef(t){var e=nc;t.__c=t.__(),nc=e}function rf(t,e){return!t||t.length!==e.length||e.some(function(e,i){return e!==t[i]})}function nf(t,e){return"function"==typeof e?e(t):e}var sf="gzip-js",of="base64",af="events",lf="cancelEvents",uf="tab",hf="left",df="center",vf="right",cf="next_to_trigger",ff="popover",pf="widget",gf="external_survey",mf="open",yf="multiple_choice",bf="single_choice",_f="rating",wf="end",kf="always",Sf="survey shown",xf="survey dismissed",Cf="survey sent",Tf="$survey_id",Mf="$survey_name",If="$survey_iteration",Ef="$survey_iteration_start_date",Rf="$survey_partially_completed",Af="$survey_submission_id",Pf="$survey_completed",Ff="$survey_last_seen_date",Of="$survey_language",$f="popover";function Df(t){var e=!0;return{dispose(){if(e){e=!1;var i=t();i&&Ce(i.then)&&i.then(void 0,()=>{})}}}}var Lf=Cn("[Surveys]");function Nf(t){return!(!t.start_date||t.end_date)}function qf(t){var e;return!(null==(e=t.conditions)||null==(e=e.actions)||null==(e=e.values)||!e.length)}var jf=(t,e)=>""+t+function(t){return t.current_iteration&&t.current_iteration>0?t.id+"_"+t.current_iteration:t.id}(e),Bf=t=>jf("seenSurvey_",t),Hf=t=>{try{var e=Bf(t);if(localStorage.getItem(e))return;localStorage.setItem(e,"true")}catch(t){Lf.error("Failed to persist survey seen state",t)}},zf=[ff,pf,"api"],Uf={ignoreConditions:!1,ignoreDelay:!1,displayType:$f},Wf="logs";Math.trunc||(Math.trunc=function(t){return 0>t?Math.ceil(t):Math.floor(t)}),Number.isInteger||(Number.isInteger=function(t){return Fe(t)&&isFinite(t)&&Math.floor(t)===t});var Vf=class t{constructor(t){if(this.bytes=t,16!==t.length)throw new TypeError("not 128-bit length")}static fromFieldsV7(e,i,r,n){if(!Number.isInteger(e)||!Number.isInteger(i)||!Number.isInteger(r)||!Number.isInteger(n)||0>e||0>i||0>r||0>n||e>0xffffffffffff||i>4095||r>1073741823||n>4294967295)throw new RangeError("invalid field value");var s=new Uint8Array(16);return s[0]=e/Math.pow(2,40),s[1]=e/Math.pow(2,32),s[2]=e/Math.pow(2,24),s[3]=e/Math.pow(2,16),s[4]=e/256,s[5]=e,s[6]=112|i>>>8,s[7]=i,s[8]=128|r>>>24,s[9]=r>>>16,s[10]=r>>>8,s[11]=r,s[12]=n>>>24,s[13]=n>>>16,s[14]=n>>>8,s[15]=n,new t(s)}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 t(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}},Gf=class{generate(){var t=this.generateOrAbort();if(!Ie(t))return t;this.ri=0;var e=this.generateOrAbort();if(Ie(e))throw new Error("Could not generate UUID after timestamp reset");return e}generateOrAbort(){var t,e=(t=Date.now(),Fe(t)&&isFinite(t)?Math.min(Math.max(Math.floor(t),0),0xffffffffffff):0);if(e>this.ri)this.ri=e,this.ii();else{if(this.ri>=e+1e4)return;this.ni++,this.ni>4398046511103&&(this.ri++,this.ii())}return Vf.fromFieldsV7(this.ri,Math.trunc(this.ni/Math.pow(2,30)),this.ni&Math.pow(2,30)-1,this.oi.nextUint32())}ii(){this.ni=1024*this.oi.nextUint32()+(1023&this.oi.nextUint32())}constructor(){this.ri=0,this.ni=0,this.oi=new Qf}},Zf=t=>{if("u">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};a&&!Ie(a.crypto)&&crypto.getRandomValues&&(Zf=t=>crypto.getRandomValues(t));var Jf,Qf=class{nextUint32(){return this.Pe.length>this.ai||(Zf(this.Pe),this.ai=0),this.Pe[this.ai++]}constructor(){this.Pe=new Uint32Array(8),this.ai=1/0}},Kf=()=>Xf().toString(),Xf=()=>(Jf||(Jf=new Gf)).generate(),Yf="",tp=/[a-z0-9][a-z0-9-]+\.[a-z]{2,}$/i;var ep=null,ip={si(){if(!Ae(ep))return ep;if(ep=!1,h)try{var t="__ph_cookie_support_"+Kf();ip.ui(t,"xyz"),ep='"xyz"'===Ma(t),ip.hi(t)}catch(t){ep=!1}return ep},ci(t){xn.error("cookieStore error: "+t)},li:Ma,di(t){var e;try{e=JSON.parse(ip.li(t))||{}}catch(t){}return e},ui(t,e,i,r,n){if(!h)return!1;try{var s="",o="",a=function(t,e){if(e){var i=function(t,e){if(void 0===e&&(e=h),Yf)return Yf;if(!e)return"";if(["localhost","127.0.0.1"].includes(t))return"";for(var i=t.split("."),r=Math.min(i.length,8),n="dmn_chk_"+Kf();!Yf&&r--;){var s=i.slice(r).join("."),o=n+"=1;domain=."+s+";path=/";e.cookie=o+";max-age=3",e.cookie.includes(n)&&(e.cookie=o+";max-age=0",Yf=s)}return Yf}(t);if(!i){var r=(t=>{var e=t.match(tp);return e?e[0]:""})(t);r!==i&&xn.info("Warning: cookie subdomain discovery mismatch",r,i),i=r}return i?"; domain=."+i:""}return""}(h.location.hostname,r);if(i){var l=new Date;l.setTime(l.getTime()+864e5*i),s="; expires="+l.toUTCString()}n&&(o="; secure");var u=t+"="+encodeURIComponent(JSON.stringify(e))+s+"; SameSite=Lax; path=/"+a+o;return u.length>3686.4&&xn.warn("cookieStore warning: large cookie, len="+u.length),h.cookie=u,!0}catch(t){return!1}},hi(t,e){if(null!=h&&h.cookie)try{ip.ui(t,"",-1,e)}catch(t){return}}},rp=null,np={si(){if(!Ae(rp))return rp;var t=!0;if(Ie(a))t=!1;else try{var e="__mplssupport__";np.ui(e,"xyz"),'"xyz"'!==np.li(e)&&(t=!1),np.hi(e)}catch(e){t=!1}return t||xn.error("localStorage unsupported; falling back to cookie store"),rp=t,t},ci(t){xn.error("localStorage error: "+t)},li(t){try{return null==a?void 0:a.localStorage.getItem(t)}catch(t){np.ci(t)}return null},di(t){try{return JSON.parse(np.li(t))||{}}catch(t){}return null},ui(t,e){try{return null==a||a.localStorage.setItem(t,JSON.stringify(e)),!0}catch(t){np.ci(t)}return!1},hi(t){try{null==a||a.localStorage.removeItem(t)}catch(t){np.ci(t)}}},sp=[vt,nt,rt,ot,at,lt,Rt,Et,Mt],op=[k,w,G,Z,Lt,Dt,M,At],ap=t=>t+"_cpm",lp=["__proto__","constructor","prototype"],up=t=>{if(!Te(t))return{};var e={};return Object.keys(t).forEach(i=>{-1===lp.indexOf(i)&&(e[i]=t[i])}),e},hp=function(t,e){void 0===e&&(e=[]);var i={};return[...op,...e].forEach(e=>{var r=t[e];Ie(r)||Ae(r)||""===r||(i[e]=r)}),i},dp=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)},vp=(t,e)=>({p:e,f:dp(JSON.stringify(t))}),cp=(t,e)=>{if(!e)return{properties:[],isValid:!1};try{var i=ip.di(ap(t)),r=(null==i?void 0:i.f)===dp(e)&&xe(i.p);return{properties:r?i.p:[],isValid:r}}catch(t){return{properties:[],isValid:!1}}},fp=(t,e)=>e+"|"+(ip.li(ap(t))||""),pp={},gp={si:()=>!0,ci(t){xn.error("memoryStorage error: "+t)},li:t=>t in pp?pp[t]:null,di:t=>t in pp?pp[t]:null,ui:(t,e)=>(pp[t]=e,!0),hi(t){delete pp[t]}},mp=null,yp={si(){if(!Ae(mp))return mp;if(mp=!0,Ie(a))mp=!1;else try{var t="__support__";yp.ui(t,"xyz"),'"xyz"'!==yp.li(t)&&(mp=!1),yp.hi(t)}catch(t){mp=!1}return mp},ci(t){xn.error("sessionStorage error: ",t)},li(t){try{return null==a?void 0:a.sessionStorage.getItem(t)}catch(t){yp.ci(t)}return null},di(t){try{return JSON.parse(yp.li(t))||null}catch(t){}return null},ui(t,e){try{return null==a||a.sessionStorage.setItem(t,JSON.stringify(e)),!0}catch(t){yp.ci(t)}return!1},hi(t){try{null==a||a.sessionStorage.removeItem(t)}catch(t){yp.ci(t)}}},bp=Cn("[Stylesheet Loader]"),_p=a,wp=h,kp="#020617",Sp={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:vf,widgetType:uf,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:kp,scrollbarThumbColor:"var(--ph-survey-border-color)",scrollbarTrackColor:"var(--ph-survey-background-color)"},xp=[df,hf,vf];function Cp(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 Tp(t){var e;void 0===t&&(t=Sp.backgroundColor),"#"===t[0]&&(e=Cp(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=Cp(i)),!e)return kp;var r=e.match(/^rgba?\((\d+),\s*(\d+),\s*(\d+)(?:,\s*(\d+(?:\.\d+)?))?\)$/);if(r){var n=parseInt(r[1]),s=parseInt(r[2]),o=parseInt(r[3]);return Math.sqrt(n*n*.299+s*s*.587+o*o*.114)>127.5?kp:"white"}return kp}var Mp=(t,e,i)=>{var r=Vp(t),s=wp.querySelector("."+r);if(s&&s.shadowRoot)return{shadow:s.shadowRoot,isNewlyCreated:!1};var o=wp.createElement("div");((t,e,i)=>{var r=n({},Sp,i),s=t.style,o=!xp.includes(r.position)||e===pf&&(null==i?void 0:i.widgetType)===uf;s.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)),s.setProperty("--ph-survey-box-padding",r.boxPadding),s.setProperty("--ph-survey-max-width",r.maxWidth),s.setProperty("--ph-survey-z-index",r.zIndex),s.setProperty("--ph-survey-border-color",r.borderColor),o?(s.setProperty("--ph-survey-border-radius",r.borderRadius),s.setProperty("--ph-survey-border-bottom","1.5px solid var(--ph-survey-border-color)")):(s.setProperty("--ph-survey-border-bottom","none"),s.setProperty("--ph-survey-border-radius",r.borderRadius+" "+r.borderRadius+" 0 0")),s.setProperty("--ph-survey-background-color",r.backgroundColor),s.setProperty("--ph-survey-box-shadow",r.boxShadow),s.setProperty("--ph-survey-disabled-button-opacity",r.disabledButtonOpacity),s.setProperty("--ph-survey-submit-button-color",r.submitButtonColor),s.setProperty("--ph-survey-submit-button-text-color",(null==i?void 0:i.submitButtonTextColor)||Tp(r.submitButtonColor)),s.setProperty("--ph-survey-rating-bg-color",r.ratingButtonColor),s.setProperty("--ph-survey-rating-active-bg-color",r.ratingButtonActiveColor),s.setProperty("--ph-survey-rating-active-text-color",Tp(r.ratingButtonActiveColor)),s.setProperty("--ph-survey-text-primary-color",(null==i?void 0:i.textColor)||Tp(r.backgroundColor)),s.setProperty("--ph-survey-text-subtle-color",r.textSubtleColor),s.setProperty("--ph-widget-color",r.widgetColor),s.setProperty("--ph-widget-text-color",Tp(r.widgetColor)),s.setProperty("--ph-widget-z-index",r.zIndex);var a=(null==i?void 0:i.inputBackground)||(null==i?void 0:i.inputBackgroundColor),l=a||r.inputBackground;a||"white"!==r.backgroundColor||(l="#f8f8f8"),s.setProperty("--ph-survey-input-background",l);var u=(null==i?void 0:i.inputTextColor)||Tp(l);s.setProperty("--ph-survey-input-text-color",u),s.setProperty("--ph-survey-rating-text-color",u),s.setProperty("--ph-survey-scrollbar-thumb-color",r.scrollbarThumbColor),s.setProperty("--ph-survey-scrollbar-track-color",r.scrollbarTrackColor),s.setProperty("--ph-survey-outline-color",r.outlineColor)})(o,t.type,t.appearance),o.className=r;var a=o.attachShadow({mode:"open"}),l=function(t){var e=((t,e,i)=>{var r=t.createElement("style");r.innerText=e;var n=(t=>{var e;return Ce(t)?t:null==t||null==(e=t.config)?void 0:e.prepare_external_dependency_stylesheet})(i);return n&&(r=n(r)),r||(bp.error("prepare_external_dependency_stylesheet returned null"),null)})(wp,':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:calc(2147480000 + 3645);--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 #00000026;--ph-survey-submit-button-color:black;--ph-survey-submit-button-text-color:white;--ph-survey-rating-bg-color:white;--ph-survey-rating-text-color:#020617;--ph-survey-rating-active-bg-color:black;--ph-survey-rating-active-text-color:white;--ph-survey-text-primary-color:#020617;--ph-survey-text-subtle-color:#939393;--ph-widget-color:#e0a045;--ph-widget-text-color:white;--ph-survey-scrollbar-thumb-color:var(--ph-survey-border-color);--ph-survey-scrollbar-track-color:var(--ph-survey-background-color);--ph-survey-outline-color:#3b82f6cc;--ph-survey-input-background:white;--ph-survey-input-text-color:#020617;--ph-survey-disabled-button-opacity:.6}.ph-survey{min-width:300px;width:var(--ph-survey-max-width);max-width:85%;z-index:var(--ph-survey-z-index);height:fit-content;margin:0;position:fixed;bottom:0}.ph-survey h3,.ph-survey p{margin:0}.ph-survey *{box-sizing:border-box;font-family:var(--ph-survey-font-family);color:var(--ph-survey-text-primary-color)}.ph-survey textarea,.ph-survey input[type=text],.ph-survey .multiple-choice-options label{color:var(--ph-survey-input-text-color);background:var(--ph-survey-input-background);border:1.5px solid var(--ph-survey-border-color);border-radius:4px;padding:10px;transition:border-color .2s ease-out,box-shadow .2s ease-out,transform .15s ease-out}.ph-survey textarea,.ph-survey input[type=text]{transition:border-color .2s ease-out,box-shadow .2s ease-out,transform .15s ease-out}.ph-survey input{margin:0}.ph-survey textarea:focus,.ph-survey textarea:focus-visible,.ph-survey input[type=text]:focus,.ph-survey input[type=text]:focus-visible,.ph-survey .form-submit:focus,.ph-survey .form-submit:focus-visible,.ph-survey input[type=checkbox]:focus,.ph-survey input[type=radio]:focus,.ph-survey input[type=checkbox]:focus-visible,.ph-survey input[type=radio]:focus-visible{outline:1.5px solid var(--ph-survey-outline-color);border-color:var(--ph-survey-rating-active-bg-color);outline-offset:2px}.ph-survey textarea:focus:not(:focus-visible),.ph-survey input[type=text]:focus:not(:focus-visible),.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){outline:none}.ph-survey textarea:hover:not(:focus),.ph-survey input[type=text]:hover:not(:focus){border-color:var(--ph-survey-rating-active-bg-color)}@media (max-width:768px){.ph-survey textarea,.ph-survey input[type=text]{font-size:1rem}}.ph-survey .multiple-choice-options label,.ph-survey .rating-options-number,.ph-survey .form-cancel,.ph-survey input[type=checkbox],.ph-survey input[type=radio]{border:1.5px solid var(--ph-survey-border-color)}.ph-survey label,.ph-survey input[type=checkbox],.ph-survey input[type=radio],.ph-survey .ratings-emoji,.ph-survey .ratings-number,.ph-survey .footer-branding,.ph-survey .form-cancel,.ph-survey .form-submit{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);color:var(--ph-widget-text-color);text-align:center;cursor:pointer;z-index:var(--ph-survey-z-index);border:none;border-radius:3px 3px 0 0;padding:10px 12px;transition:padding .2s ease-out;position:fixed}.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{flex-direction:column;gap:16px;display:flex}.bottom-section{flex-direction:column;gap:8px;display:flex}.thank-you-message-header~.bottom-section,.intro-screen-header~.bottom-section{padding-top:16px}.question-container,.thank-you-message,.intro-screen{flex-direction:column;gap:8px;display:flex}.survey-question{font-size:14px;font-weight:500}.survey-question-description{opacity:.8;padding-top:4px;font-size:13px}.survey-question-description,.thank-you-message-body,.intro-screen-body{word-wrap:break-word;overflow-wrap:break-word}:is(.survey-question-description,.thank-you-message-body,.intro-screen-body) img,:is(.survey-question-description,.thank-you-message-body,.intro-screen-body) video,:is(.survey-question-description,.thank-you-message-body,.intro-screen-body) iframe,:is(.survey-question-description,.thank-you-message-body,.intro-screen-body) embed,:is(.survey-question-description,.thank-you-message-body,.intro-screen-body) object,:is(.survey-question-description,.thank-you-message-body,.intro-screen-body) svg{max-width:100%;height:auto}.question-textarea-wrapper{flex-direction:column;display:flex}.survey-form{animation:.3s ease-out forwards ph-survey-fade-in}.survey-form,.thank-you-message,.intro-screen{text-align:left;width:100%;z-index:var(--ph-survey-z-index);border:1.5px solid var(--ph-survey-border-color);border-bottom:var(--ph-survey-border-bottom);background:var(--ph-survey-background-color);border-radius:var(--ph-survey-border-radius);box-shadow:var(--ph-survey-box-shadow);padding:var(--ph-survey-box-padding);margin:0;position:relative}.survey-form textarea,.survey-form input[type=text]{min-width:100%}.survey-form textarea:focus,.survey-form textarea:focus-visible{box-shadow:0 4px 12px #00000014}.survey-form textarea:focus:not(:focus-visible){box-shadow:none}.survey-box .question-header--empty~.multiple-choice-options,.survey-box .question-header--empty~textarea{margin-top:0}.multiple-choice-options{border:none;flex-direction:column;gap:8px;margin:0;padding:1px 0;font-size:14px;display:flex}.multiple-choice-options label,.multiple-choice-options .response-choice{color:inherit;align-items:center;gap:8px;display:flex}.multiple-choice-options label{cursor:pointer;font-size:13px}.multiple-choice-options label:hover:not(:has(input:checked)){border-color:var(--ph-survey-text-subtle-color);box-shadow:0 2px 8px #00000014}.multiple-choice-options label:has(input:checked){border-color:var(--ph-survey-rating-active-bg-color);box-shadow:0 1px 4px #0000000d}.multiple-choice-options label.choice-option-open{flex-wrap:wrap}.multiple-choice-options label span{color:inherit}.multiple-choice-options input[type=checkbox],.multiple-choice-options input[type=radio]{-webkit-appearance:none;-moz-appearance:none;appearance:none;background:var(--ph-survey-input-background);cursor:pointer;z-index:1;border-radius:3px;flex-shrink:0;width:1rem;height:1rem;transition:all .2s cubic-bezier(.4,0,.2,1),transform .15s ease-out;position:relative}: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{border:solid var(--ph-survey-rating-active-text-color);border-width:0 2px 2px 0;width:4px;height:8px;animation:.2s ease-out .1s forwards ph-survey-checkmark-reveal;left:4px;transform:rotate(45deg)scale(0)}.multiple-choice-options input[type=radio]:checked:after{background:var(--ph-survey-rating-active-text-color);border-radius:50%;width:6px;height:6px;animation:.15s ease-out 50ms forwards ph-survey-radio-reveal;top:5px;left:5px;transform:scale(0)}.multiple-choice-options input[type=checkbox]:checked:after,.multiple-choice-options input[type=radio]:checked:after{content:"";box-sizing:content-box;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}.multiple-choice-options .choice-option-open input[type=text]::placeholder{color:var(--ph-survey-text-subtle-color);font-weight:400}.rating-options-emoji{justify-content:space-between;display:flex}.rating-options-emoji-2{justify-content:space-around}.ratings-emoji{opacity:.5;background-color:#0000;border:none;padding:0;font-size:16px}.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;grid-auto-columns:1fr;grid-auto-flow:column;display:grid;overflow:hidden}.rating-options-number .ratings-number{border-right:1px solid var(--ph-survey-border-color);text-align:center;cursor:pointer;color:var(--ph-survey-rating-text-color);border-top:none;border-bottom:none;border-left:none;font-weight:700}.rating-options-number .ratings-number:last-of-type{border-right:0}.rating-options-number .ratings-number.rating-active{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{opacity:.7;flex-direction:row;justify-content:space-between;font-size:11px;display:flex}.form-buttons{flex-direction:row;gap:8px;width:100%;display:flex}.form-buttons-with-back>.form-submit{flex:auto;min-width:0}.form-submit{text-align:center;cursor:pointer;user-select:none;background:var(--ph-survey-submit-button-color);color:var(--ph-survey-submit-button-text-color);border:none;border-radius:6px;min-width:100%;padding:12px;font-weight:700;box-shadow:0 2px #0000000b}.form-submit:not([disabled]):hover{transform:scale(1.02);box-shadow:0 4px 8px #0000001a}.form-submit:not([disabled]):active{transform:scale(.98);box-shadow:0 1px 2px #0000000d}.form-submit[disabled]{opacity:var(--ph-survey-disabled-button-opacity);cursor:not-allowed}.form-back{text-align:center;cursor:pointer;user-select:none;color:var(--ph-survey-text-primary-color);border:1.5px solid var(--ph-survey-border-color);background:0 0;border-radius:6px;flex:none;padding:12px 16px;font-weight:600}.form-back:hover{transform:scale(1.02)}.form-back:active{transform:scale(.98)}.validation-hint{opacity:.7;margin-top:4px;font-size:12px}.form-cancel{cursor:pointer;background:#fff;border-radius:100%;padding:12px;line-height:0;position:absolute;top:0;right:0;transform:translate(50%,-50%)}.form-cancel:hover{opacity:.7;transform:translate(50%,-50%)scale(1.1)}.footer-branding{opacity:.6;justify-content:center;align-items:center;gap:4px;font-size:11px;font-weight:500;text-decoration:none;display:flex}.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{opacity:.8;font-size:14px}.intro-screen{text-align:center;animation:.3s ease-out forwards ph-survey-fade-in}.intro-screen-header{margin:10px 0 0}.intro-screen-body{opacity:.8;font-size:14px}.limit-height{scrollbar-width:thin;scrollbar-color:var(--ph-survey-scrollbar-thumb-color) var(--ph-survey-scrollbar-track-color);max-height:256px;overflow:hidden auto}.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}.limit-height::-webkit-scrollbar-thumb:hover{background-color:var(--ph-survey-text-subtle-color)}.sr-only{clip:rect(0, 0, 0, 0);white-space:nowrap;border:0;width:1px;height:1px;margin:-1px;padding:0;position:absolute;overflow:hidden}@media (prefers-reduced-motion:reduce){.ph-survey *{scroll-behavior:auto!important;transition-duration:.01ms!important;animation-duration:.01ms!important;animation-iteration-count:1!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(l){var u=a.querySelector("style");u&&a.removeChild(u),a.appendChild(l)}return(i||wp.body).appendChild(o),{shadow:a,isNewlyCreated:!0}},Ip=t=>{var e=t.responses,i=t.survey,r=t.surveySubmissionId,s=t.posthog,o=t.isSurveyCompleted,a=t.properties,l=t.surveyLanguage,u=t.questionSnapshots;s?(Hf(i),s.capture(Cf,n({[Mf]:i.name,[Tf]:i.id,[If]:i.current_iteration,[Ef]:i.current_iteration_start_date,[Af]:r,[Pf]:o},l&&{[Of]:l},{sessionRecordingUrl:null==s.get_session_replay_url?void 0:s.get_session_replay_url()},oa(e,i,u),a,{$set:{[aa(i,"responded")]:!0}})),o&&(_p.dispatchEvent(new CustomEvent("PHSurveySent",{detail:{surveyId:i.id}})),Wp(i),s.reloadFeatureFlags())):Lf.error("[survey sent] event not captured, PostHog instance not found.")},Ep=(t,e,i)=>{return n({[Mf]:t.name,[Tf]:t.id,[If]:t.current_iteration,[Ef]:t.current_iteration_start_date,[Rf]:(r=null==e?void 0:e.responses,void 0===r&&(r={}),Object.values(r).some(t=>!Pe(t)))},(null==e?void 0:e.surveyLanguage)&&{[Of]:e.surveyLanguage},{sessionRecordingUrl:null==i.get_session_replay_url?void 0:i.get_session_replay_url(),[Af]:null==e?void 0:e.surveySubmissionId},oa(null==e?void 0:e.responses,t,null==e?void 0:e.questionSnapshots));var r},Rp=(t,e,i,r)=>{if(e){if(!i){var s=zp(t),o=s?s.surveyLanguage:r;e.capture(xf,n({},Ep(t,s,e),o&&{[Of]:o},{$set:{[aa(t,"dismissed")]:!0}})),Wp(t),Hf(t),_p.dispatchEvent(new CustomEvent("PHSurveyClosed",{detail:{surveyId:t.id}}))}}else Lf.error("[survey dismissed] event not captured, PostHog instance not found.")},Ap=(t,e)=>{if(e){var i=(t=>jf("abandonedSurvey_",t))(t);try{if("true"===localStorage.getItem(i))return}catch(t){return}var r=zp(t);if(r){try{localStorage.setItem(i,"true")}catch(t){}e.capture("survey abandoned",Ep(t,r,e),{transport:"sendBeacon"})}}else Lf.error("[survey abandoned] event not captured, PostHog instance not found.")},Pp=t=>t.map(t=>({sort:Math.floor(10*Math.random()),value:t})).sort((t,e)=>t.sort-e.sort).map(t=>t.value),Fp=(t,e)=>t.length===e.length&&t.every((t,i)=>t===e[i])?e.reverse():e,Op=t=>{var e=t.map(t=>t.id);return e.every(t=>!!t)?e:void 0},$p=(t,e)=>{var i;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?Fp(t.questions,Pp(t.questions)):t.questions},Dp=t=>fa(t)||Up(t),Lp=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"+ec++,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}),Np=()=>Qc(Lp),qp=t=>{var e=t.children,i=t.style;return function(t,e,i){var r,n,s,o,a=dc({},t.props);for(s in t.type&&t.type.defaultProps&&(o=t.type.defaultProps),e)"key"==s?r=e[s]:"ref"==s?n=e[s]:a[s]=void 0===e[s]&&null!=o?o[s]:e[s];return arguments.length>2&&(a.children=arguments.length>3?Bv.call(arguments,2):i),fc(t.type,a,r||t.key,n||t.ref,null)}(t.component,t.renderAsHtml?{dangerouslySetInnerHTML:{__html:e},style:i}:{children:e,style:i})};function jp(t,e){var i,r;if(null==(i=t.conditions)||!i.url)return!0;var n,s=Gn(e);return!!s&&ma[n=null==(r=t.conditions)?void 0:r.urlMatchType,null!=n?n:"icontains"]([t.conditions.url],[s])}var Bp=t=>jf("inProgressSurvey_",t),Hp=(t,e)=>{try{localStorage.setItem(Bp(t),JSON.stringify(e))}catch(t){Lf.error("Error setting in-progress survey state in localStorage",t)}},zp=t=>{try{var e=localStorage.getItem(Bp(t));if(e)return JSON.parse(e)}catch(t){Lf.error("Error getting in-progress survey state from localStorage",t)}return null},Up=t=>{var e=zp(t);return!Pe(null==e?void 0:e.surveySubmissionId)},Wp=t=>{try{localStorage.removeItem(Bp(t))}catch(t){Lf.error("Error clearing in-progress survey state from localStorage",t)}};function Vp(t,e){void 0===e&&(e=!1);var i="PostHogSurvey-"+t.id;return e?"."+i:i}function Gp(t,e,i){if(void 0===e&&(e=vf),t===gf)return{};switch(e){case"top_left":return{top:"0",left:"0",transform:"translate(30px, 30px)"};case"top_right":return{top:"0",right:"0",transform:"translate(-30px, 30px)"};case"top_center":return{top:"0",left:"50%",transform:"translate(-50%, 30px)"};case"middle_left":return{top:"50%",left:"0",transform:"translate(30px, -50%)"};case"middle_right":return{top:"50%",right:"0",transform:"translate(-30px, -50%)"};case"middle_center":return{top:"50%",left:"50%",transform:"translate(-50%, -50%)"};case hf:return{left:"30px"};case df:return{left:"50%",transform:"translateX(-50%)"};default:return{right:t===pf&&i===uf?"60px":"30px"}}}var Zp=0;function Jp(t,e,i,r,n,s){e||(e={});var o,a,l=e;if("ref"in l)for(a in l={},e)"ref"==a?o=e[a]:l[a]=e[a];var u={type:t,props:l,key:i,ref:o,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:--Zp,__i:-1,__u:0,__source:n,__self:s};if("function"==typeof t&&(o=t.defaultProps))for(a in o)void 0===l[a]&&(l[a]=o[a]);return Hv.vnode&&Hv.vnode(u),u}var Qp=Jp("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 -960 960 960",width:"48",children:Jp("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"})}),Kp=Jp("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 -960 960 960",width:"48",children:Jp("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"})}),Xp=Jp("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 -960 960 960",width:"48",children:Jp("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"})}),Yp=Jp("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 -960 960 960",width:"48",children:Jp("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"})}),tg=Jp("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 -960 960 960",width:"48",children:Jp("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"})}),eg=Jp("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 0 24 24",width:"48",children:Jp("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"})}),ig=Jp("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 0 24 24",width:"48",children:Jp("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"})}),rg=Jp("svg",{width:"77",height:"14",viewBox:"0 0 77 14",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[Jp("g",{"clip-path":"url(#clip0_2415_6911)",children:[Jp("mask",{id:"mask0_2415_6911",style:{maskType:"luminance"},maskUnits:"userSpaceOnUse",x:"0",y:"0",width:"77",height:"14",children:Jp("path",{d:"M0.5 0H76.5V14H0.5V0Z",fill:"white"})}),Jp("g",{mask:"url(#mask0_2415_6911)",children:[Jp("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"}),Jp("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"}),Jp("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"}),Jp("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"}),Jp("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"}),Jp("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"})]})]}),Jp("defs",{children:Jp("clipPath",{id:"clip0_2415_6911",children:Jp("rect",{width:"76",height:"14",fill:"white",transform:"translate(0.5)"})})})]});function ng(t){var e=t.urlParams,i=e?Object.entries(e).map(t=>{var e=t[1];return encodeURIComponent(t[0])+"="+encodeURIComponent(e)}).join("&"):"";return Jp("a",{href:"https://posthog.com/surveys"+(i?"?"+i:""),target:"_blank",rel:"noopener",className:"footer-branding",children:["Survey by ",rg]})}function sg(t){var e=t.text,i=t.submitDisabled,r=t.appearance,n=t.onSubmit,s=t.link,o=t.onPreviewSubmit,l=t.skipSubmitButton,u=t.canGoBack,h=t.onBack,d=Qc(Lp).isPreviewMode,v=!!u&&!!h,c=!l&&Jp("button",{className:"form-submit",disabled:i,"aria-label":"Submit survey",type:"button",onClick(){s&&(null==a||a.open(s)),d?null==o||o():n()},children:e});return Jp("div",{className:"bottom-section",children:[v?Jp("div",{className:"form-buttons form-buttons-with-back",children:[Jp("button",{className:"form-back",type:"button","aria-label":"Go to previous question",onClick:h,children:r.backButtonText||"Back"}),c]}):c,!r.whiteLabel&&Jp(ng,{urlParams:{utm_source:"survey-footer"}})]})}function og(t){var e=t.question,i=t.forceDisableHtml;return Jp("div",{class:e.question||e.description?"question-header":"question-header question-header--empty",children:[Jp(e.type===mf?"label":"h3",{className:"survey-question",htmlFor:t.htmlFor,children:e.question}),e.description&&qp({component:cc("p",{className:"survey-question-description"}),children:e.description,renderAsHtml:!i&&"text"!==e.descriptionContentType})]})}function ag(t){var e,i,r;return Jp("button",{className:"form-cancel",onClick:t.onClick,disabled:Qc(Lp).isPreviewMode,"aria-label":"Close survey",type:"button",children:(e={fill:"black"},i=(void 0===e?{}:e).fill,r=void 0===i?"currentColor":i,Jp("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:r,xmlns:"http://www.w3.org/2000/svg","aria-labelledby":"close-survey-title-adam",children:[Jp("title",{id:"close-survey-title",className:"adam-testing",children:"Close survey"}),Jp("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:r})]}))})}var lg=a;function ug(t){var e=t.header,i=t.description,r=t.contentType,n=t.forceDisableHtml,s=t.appearance,o=t.onClose,a=Qc(Lp).isPopup;return Gc(()=>{var t=t=>{"Enter"!==t.key&&"Escape"!==t.key||(t.preventDefault(),o())};return $n(lg,"keydown",t),()=>{lg.removeEventListener("keydown",t)}},[o]),Jp("div",{className:"thank-you-message",role:"status",tabIndex:0,"aria-atomic":"true",children:[a&&!0!==s.hideCancelButton&&Jp(ag,{onClick:()=>o()}),Jp("h3",{className:"thank-you-message-header",children:e}),i&&qp({component:cc("p",{className:"thank-you-message-body"}),children:i,renderAsHtml:!n&&"text"!==r}),a&&Jp(sg,{text:s.thankYouMessageCloseButtonText||"Close",submitDisabled:!1,appearance:s,onSubmit:()=>o()})]})}function hg(t){var e=t.header,i=t.description,r=t.contentType,n=t.forceDisableHtml,s=t.appearance,o=t.onStart,a=Qc(Lp),l=a.onPreviewSubmit,u=a.onPopupSurveyDismissed;return Jp("div",{className:"intro-screen",role:"status",tabIndex:0,"aria-atomic":"true",children:[a.isPopup&&!0!==s.hideCancelButton&&Jp(ag,{onClick:()=>u()}),e&&Jp("h3",{className:"intro-screen-header",children:e}),i&&qp({component:cc("p",{className:"intro-screen-body"}),children:i,renderAsHtml:!n&&"text"!==r}),Jp(sg,{text:s.introScreenButtonText||"Get started",submitDisabled:!1,appearance:s,onSubmit:o,onPreviewSubmit:()=>l(null)})]})}var dg=t=>xe(t)&&t.every(t=>Ee(t));function vg(t){var e=t.question,i=t.forceDisableHtml,r=t.appearance,n=t.onSubmit,s=t.onPreviewSubmit,o=t.displayQuestionIndex,a=t.initialValue,l=t.canGoBack,u=t.onBack,h=Np().isPreviewMode,d=Zc(null),v=Vc(()=>Ee(a)?a:""),c=v[0],f=v[1],p=null==r?void 0:r.disableAutofocus;Gc(()=>{p||setTimeout(()=>{var t;h||null==(t=d.current)||t.focus()},100)},[h,p]);var g="surveyQuestion"+o,m=Jc(()=>function(t,e,i){var r,n,s=t.trim();if(!i&&""===s)return"This field is required";if(""===s)return!1;if(e&&e.length>0)for(var o of e)switch(o.type){case me:if(void 0!==o.value&&o.value>s.length)return null!==(r=o.errorMessage)&&void 0!==r?r:"Please enter at least "+o.value+" characters";break;case ye:if(void 0!==o.value&&s.length>o.value)return null!==(n=o.errorMessage)&&void 0!==n?n:"Please enter no more than "+o.value+" characters"}return!1}(c,e.validation,e.optional),[c,e.validation,e.optional]),y=_n(e.validation,me),b=_n(e.validation,ye),_=Jc(()=>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 Jp(pc,{children:[Jp("div",{className:"question-container",children:[Jp(og,{question:e,forceDisableHtml:i,htmlFor:g}),Jp("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}),_&&Jp("div",{className:"validation-hint",children:_})]}),Jp(sg,{text:e.buttonText||"Submit",submitDisabled:!!m,appearance:r,onSubmit:w,onPreviewSubmit:k,canGoBack:l,onBack:u})]})}function cg(t){var e=t.question,i=t.appearance,r=t.onSubmit,n=t.onPreviewSubmit,s=t.canGoBack,o=t.onBack;return Jp(pc,{children:[Jp("div",{className:"question-container",children:Jp(og,{question:e,forceDisableHtml:t.forceDisableHtml})}),Jp(sg,{text:e.buttonText||"Submit",submitDisabled:!1,link:e.link,appearance:i,onSubmit:()=>r("link clicked"),onPreviewSubmit:()=>n("link clicked"),canGoBack:s,onBack:o})]})}function fg(t){var e,i=t.question,r=t.forceDisableHtml,n=t.displayQuestionIndex,s=t.appearance,o=t.onSubmit,a=t.onPreviewSubmit,l=t.initialValue,u=t.canGoBack,h=t.onBack,d=i.scale,v=10===i.scale?0:1,c=Vc(()=>Fe(l)?l:xe(l)&&l.length>0&&Fe(parseInt(l[0]))?parseInt(l[0]):Ee(l)&&Fe(parseInt(l))?parseInt(l):null),f=c[0],p=c[1],g="emoji"===i.display&&2===i.scale,m=Np().isPreviewMode,y=t=>m?a(t):o(t);return Jp(pc,{children:[Jp("div",{className:"question-container",children:[Jp(og,{question:i,forceDisableHtml:r}),Jp("div",{className:"rating-section",children:[Jp("div",{className:"rating-options",children:["emoji"===i.display&&Jp("div",{className:"rating-options-emoji"+(g?" rating-options-emoji-2":""),children:null==(e=_g[i.scale])?void 0:e.map((t,e)=>Jp("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&&Jp("div",{className:"rating-options-number",style:{gridTemplateColumns:"repeat("+(d-v+1)+", minmax(0, 1fr))"},children:wg(i.scale).map((t,e)=>Jp(pg,{displayQuestionIndex:n,active:f===t,appearance:s,num:t,setActiveNumber(t){p(t),i.skipSubmitButton&&y(t)}},e))})]}),!g&&Jp("div",{className:"rating-text",children:[Jp("div",{children:i.lowerBoundLabel}),Jp("div",{children:i.upperBoundLabel})]})]})]}),Jp(sg,{text:i.buttonText||(null==s?void 0:s.submitButtonText)||"Submit",submitDisabled:Ae(f)&&!i.optional,appearance:s,onSubmit:()=>o(f),onPreviewSubmit:()=>a(f),skipSubmitButton:i.skipSubmitButton,canGoBack:u,onBack:h})]})}function pg(t){var e=t.num,i=t.setActiveNumber;return Jp("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 gg(t){var e=t.question,i=t.forceDisableHtml,r=t.displayQuestionIndex,s=t.appearance,o=t.onSubmit,a=t.onPreviewSubmit,l=t.initialValue,u=t.canGoBack,h=t.onBack,d=Zc(null),v=Jc(()=>(t=>{if(!t.shuffleOptions)return t.choices;var e=t.choices,i="";t.hasOpenChoice&&(i=e.pop());var r=Fp(e,Pp(e));return t.hasOpenChoice&&(t.choices.push(i),r.push(i)),r})(e),[e]),c=Vc(()=>((t,e)=>Ee(t)||dg(t)?t:e===bf?null:[])(l,e.type)),f=c[0],p=c[1],g=Vc(()=>((t,e)=>{if(Ee(t)&&!e.includes(t))return{isSelected:!0,inputValue:t};if(dg(t)){var i=t.find(t=>!e.includes(t));if(i)return{isSelected:!0,inputValue:i}}return{isSelected:!1,inputValue:""}})(l,v)),m=g[0],y=g[1],b=Np().isPreviewMode,_=e.type===bf,w=e.type===yf,k=e.skipSubmitButton&&_&&!e.hasOpenChoice,S=(t,e)=>{if(e){var i=!m.isSelected;return y(t=>n({},t,{isSelected:i,inputValue:i?t.inputValue:""})),_&&p(""),void(i&&setTimeout(()=>{var t;return null==(t=d.current)?void 0:t.focus()},75))}if(_)return p(t),y(t=>n({},t,{isSelected:!1,inputValue:""})),void(k&&(o(t),b&&a(t)));w&&xe(f)&&(f.includes(t)?p(f.filter(e=>e!==t)):p([...f,t]))},x=t=>{t.stopPropagation();var e=t.currentTarget.value;y(t=>n({},t,{inputValue:e})),_&&p(e)},C=t=>{t.stopPropagation(),"Enter"!==t.key||T()||(t.preventDefault(),M()),"Escape"===t.key&&(t.preventDefault(),y(t=>n({},t,{isSelected:!1,inputValue:""})),_&&p(null))},T=()=>!(e.optional||!Ae(f)&&(!xe(f)||m.isSelected||0!==f.length)&&(!m.isSelected||""!==m.inputValue.trim())),M=()=>{m.isSelected&&w?xe(f)&&(b?a([...f,m.inputValue]):o([...f,m.inputValue])):b?a(f):o(f)};return Jp(pc,{children:[Jp("div",{className:"question-container",children:[Jp(og,{question:e,forceDisableHtml:i}),Jp("fieldset",{className:"multiple-choice-options limit-height",children:[Jp("legend",{className:"sr-only",children:w?" Select all that apply":" Select one"}),v.map((t,i)=>{var n=!!e.hasOpenChoice&&i===e.choices.length-1,s="surveyQuestion"+r+"Choice"+i,o=s+"Open",a=n?m.isSelected:_?f===t:xe(f)&&f.includes(t);return Jp("label",{className:n?"choice-option-open":"",children:[Jp("div",{className:"response-choice",children:[Jp("input",{type:_?"radio":"checkbox",name:s,checked:a,onChange:()=>S(t,n),id:s,"aria-controls":o}),Jp("span",{children:n?t+":":t})]}),n&&Jp("input",{type:"text",ref:d,id:o,name:"question"+r+"Open",value:m.inputValue,onKeyDown:C,onInput:x,onClick(e){m.isSelected||S(t,!0),e.stopPropagation()},"aria-label":t+" - please specify"})]},i)})]})]}),Jp(sg,{text:e.buttonText||"Submit",submitDisabled:T(),appearance:s,onSubmit:M,onPreviewSubmit:M,skipSubmitButton:k,canGoBack:u,onBack:h})]})}var mg=[1,2,3,4,5],yg=[1,2,3,4,5,6,7],bg=[0,1,2,3,4,5,6,7,8,9,10],_g={2:[eg,ig],3:[Xp,Kp,Qp],5:[Yp,Xp,Kp,Qp,tg]};function wg(t){switch(t){case 5:default:return mg;case 7:return yg;case 10:return bg}}var kg=Cn("[Surveys]");function Sg(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?wf:s;if(n.branching.type===wf)return wf;if("specific_question"===n.branching.type){if(Number.isInteger(n.branching.index))return n.branching.index}else if("response_based"===n.branching.type){if(n.type===bf){var o,a=n.choices.indexOf(""+i);if(-1===a&&n.hasOpenChoice&&(a=n.choices.length-1),null!=(o=n.branching)&&null!=(o=o.responseValues)&&o.hasOwnProperty(a)){var l=n.branching.responseValues[a];return Number.isInteger(l)?l:l===wf?wf:s}}else if(n.type===_f){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===wf?wf:s}}return s}return kg.warn("Falling back to next question index due to unexpected branching type"),s}var xg=Cn("[SurveyTranslations]");function Cg(t,e){var i=function(t){return function(t,e){var i=t.storedPersonProperties,r=t.locale,n=la(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?la(t.language):null}(i);if(s)return null==e||e.info("Using person property language: "+s),s;var o=la(r);return o?(null==e||e.info("Using detected locale: "+o),o):(null==e||e.info("No user language detected"),null)}({overrideLanguage:t.config.override_display_language,storedPersonProperties:Ce(t.get_property)?t.get_property(vt):void 0,locale:$a()},xg)}(e);if(!i)return xg.info("No user language detected"),{survey:t,language:null};var r=va(t,i,xg);return{survey:r.survey,language:r.matchedKey}}var Tg=a,Mg=h,Ig="ph:show_survey_widget",Eg="PHWidgetSurveyClickListener";function Rg(t,e){try{var i=t.getBoundingClientRect(),r=Tg.innerHeight,n=Tg.innerWidth,s=i.left+i.width/2-e/2;s+e>n-20&&(s=n-e-20),20>s&&(s=20);var o=r-i.bottom,a=250>o&&i.top>o;return{position:"fixed",top:a?"auto":i.bottom+12+"px",left:s+"px",right:"auto",bottom:a?r-i.top+12+"px":"auto",zIndex:Sp.zIndex}}catch(t){return Lf.warn("Failed to calculate trigger position:",t),null}}var Ag=class{constructor(t){var e=this;this.fi=new Map,this.pi=new Map,this.gi=new Map,this.mi=new Set,this.yi=null,this.bi=!1,this.wi=null,this.ki=null,this.Si=null,this.handlePageUnload=()=>{var t=this._posthog.get_property(pt);if(t)for(var e of t)Up(e)&&Ap(e,this._posthog)},this.handlePopoverSurvey=function(t,i,r){var s,o,a,l,u,h=(void 0===r?{}:r).resumeDelayFromActivation,d=void 0!==h&&h,v=e.xi(t),c=v.survey,f=v.language;e.yi=f,e.Si=null,e.Ci=i;var p=e.Mi(c,i);e.Ti(p.id);var g=null!=i?i:{},m=g.properties,y=g.initialResponses,b=!(!y||0>=Object.keys(y).length)&&e.Ii(p,y,m,f);if(!b||null!=(s=p.appearance)&&s.displayThankYouMessage){e.Ri(p);var _={};if((null==(o=p.appearance)?void 0:o.position)===cf&&null!=(a=p.appearance)&&a.widgetSelector){var w,k=Mg.querySelector(p.appearance.widgetSelector);k&&(_=Rg(k,parseInt((null==(w=p.appearance)?void 0:w.maxWidth)||Sp.maxWidth))||{})}var S=(null==(l=p.appearance)?void 0:l.surveyPopupDelaySeconds)||0,x=Mp(p,e._posthog).shadow;e.gi.set(x,x.host);var C={posthog:e._posthog,survey:p,removeSurveyFromFocus:e.Ai,properties:m,style:_,isSurveyCompleted:b,skipShownEvent:null==i?void 0:i.skipShownEvent,surveyLanguage:f};if(e.Si=C,0>=S)return e.bi=!0,$c(Jp(Dg,n({},C)),x);var T=()=>{if(!e.Ei(p))return Lf.info("Survey "+p.id+" no longer eligible when its display delay elapsed; not displaying"),e.Ai(p);(()=>{e.bi=!0;var r=e.xi(t),s=r.survey,o=r.language;e.yi=o;var a=e.Mi(s,i),l=n({},C,{survey:a,surveyLanguage:o});e.Si=l,$c(Jp(Dg,n({},l,{survey:n({},a,{appearance:n({},a.appearance,{surveyPopupDelaySeconds:0})})})),x)})()},M=d?null==(u=e._posthog.surveys)||null==(u=u._surveyEventReceiver)||null==u.getActivationTimestamp?void 0:u.getActivationTimestamp(p.id):void 0,I=Fe(M)?Math.max(0,Date.now()-M):0,E=Math.max(0,1e3*S-I);if(0>=E)return T();var R=Tg.setTimeout(()=>{e.fi.delete(p.id),T()},E);e.fi.set(p.id,R)}},this.Li=t=>{var e=this.xi(t),i=e.survey,r=e.language,n=Mp(i,this._posthog),s=n.shadow,o=n.isNewlyCreated;this.gi.set(s,s.host),o&&$c(Jp(Ng,{posthog:this._posthog,survey:i,surveyLanguage:r},t.id),s)},this.Oi=t=>{var e=this.pi.get(t);e&&(e.element.removeEventListener("click",e.listener),e.element.removeAttribute(Eg),this.pi.delete(t),Lf.info("Removed click listener for survey "+t))},this.Di=t=>{this.Pi(t)||(this.Fi(t),this.Oi(t.id))},this.Pi=t=>{try{var e;return!(null==(e=Mg.querySelector(Vp(t,!0)))||null==(e=e.shadowRoot)||!e.querySelector(".ph-survey"))}catch(t){return!1}},this.Ni=(t,e)=>{var i=Mg.querySelector(e),r=this.pi.get(t.id);if(i){if(this.Li(t),r){if(i===r.element)return;Lf.info("Selector element changed for survey "+t.id+". Re-attaching listener."),this.Oi(t.id)}if(!i.hasAttribute(Eg)){var n=e=>{var i,r;e.stopPropagation();var n=(null==(i=t.appearance)?void 0:i.position)===cf?Rg(e.currentTarget,parseInt((null==(r=t.appearance)?void 0:r.maxWidth)||Sp.maxWidth)):{};Tg.dispatchEvent(new CustomEvent(Ig,{detail:{surveyId:t.id,position:n}}))};$n(i,"click",n),i.setAttribute(Eg,"true"),this.pi.set(t.id,{element:i,listener:n,survey:t}),Lf.info("Attached click listener for feedback button survey "+t.id)}}else r&&this.Di(t)},this.renderPopover=t=>{var e=this.xi(t),i=e.survey,r=e.language,n=Mp(i,this._posthog).shadow;this.gi.set(n,n.host),$c(Jp(Dg,{posthog:this._posthog,survey:i,removeSurveyFromFocus:this.Ai,surveyLanguage:r}),n)},this.renderSurvey=(t,e,i)=>{var r,n=this.xi(t),s=n.survey,o=n.language,a=!1;null!=(r=this._posthog.config)&&null!=(r=r.surveys)&&r.prefillFromUrl&&(a=this.qi(s,o,i)),$c(Jp(Dg,{posthog:this._posthog,survey:s,removeSurveyFromFocus:this.Ai,isPopup:!1,properties:i,isSurveyCompleted:a,surveyLanguage:o}),e)},this.getActiveMatchingSurveys=function(t,i){var r;void 0===i&&(i=!1),null==(r=e._posthog)||null==(r=r.surveys)||r.getSurveys(i=>{t(i.filter(t=>e.Ei(t)))},i)},this.callSurveysAndEvaluateDisplayLogic=function(t){void 0===t&&(t=!1),e.getActiveMatchingSurveys(t=>{var i=t.filter(t=>t.type===ff||t.type===pf),r=new Set(i.map(t=>t.id));for(var n of Array.from(e.fi.keys()))r.has(n)||e.cancelSurvey(n);var s=e.ji(i),o=new Set;s.forEach(t=>{if(t.type===pf){var i,r,n,s;if((null==(i=t.appearance)?void 0:i.widgetType)===uf)return void e.Li(t);"selector"===(null==(r=t.appearance)?void 0:r.widgetType)&&null!=(n=t.appearance)&&n.widgetSelector&&(o.add(t.id),e.Ni(t,null==(s=t.appearance)?void 0:s.widgetSelector))}Ae(e.Bi)&&t.type===ff&&e.handlePopoverSurvey(t,void 0,{resumeDelayFromActivation:!0})}),e.pi.forEach(t=>{var i=t.survey;o.has(i.id)||e.Di(i)})},t)},this.Ri=t=>{Ae(this.Bi)||Lf.error("Survey "+this.Bi+" already in focus. Cannot add survey "+t.id+"."),this.Bi=t.id},this.Ai=t=>{this.Bi!==t.id&&Lf.error("Survey "+t.id+" is not in focus. Cannot remove survey "+t.id+"."),this.Ti(t.id),this.Bi=null,this.yi=null,this.bi=!1,this.Si=null,this.Ci=void 0,this.Fi(t)},this._posthog=t,this.Bi=null,this.wi=()=>this.Hi(),$n(Tg,"languagechange",this.wi),this.ki=t.onFeatureFlags(()=>this.Hi())}Hi(){var t;if(!Ae(this.Bi)){var e=null==(t=this._posthog.get_property(pt))?void 0:t.find(t=>t.id===this.Bi);if(e){var i=this.xi(e),r=i.survey,s=i.language;if(s!==this.yi&&(this.yi=s,this.bi)){var o=this.Mi(r,this.Ci),a=Mp(o,this._posthog).shadow;$c(Jp(Dg,n({},this.Si,{posthog:this._posthog,survey:o,removeSurveyFromFocus:this.Ai,surveyLanguage:s})),a)}}}}get $i(){var t,e,i;return null!==(t=null==(e=(i=this._posthog).getExtension)?void 0:e.call(i,"featureFlags"))&&void 0!==t?t:this._posthog.featureFlags}Mi(t,e){return null!=e&&e.position||null!=e&&e.selector?n({},t,{appearance:n({},t.appearance,e.position&&{position:e.position},e.selector&&{widgetSelector:e.selector})}):t}Ti(t){var e=this.fi.get(t);e&&(clearTimeout(e),this.fi.delete(t))}cancelSurvey(t){this.fi.has(t)&&(Lf.info("Cancelled pending survey "+t),this.Ti(t),this.Bi===t&&(this.Bi=null,this.yi=null,this.bi=!1,this.Si=null,this.Ci=void 0))}setAutomaticDisplayDispose(t){this.Ui=t}dispose(){var t;null==(t=this.Ui)||t.call(this),this.Ui=void 0,this.wi&&(Tg.removeEventListener("languagechange",this.wi),this.wi=null),this.ki&&(this.ki(),this.ki=null),this.fi.forEach((t,e)=>this.Ti(e)),this.pi.forEach((t,e)=>this.Oi(e)),this.gi.forEach((t,e)=>{$c(null,e),null==t||t.remove()}),this.gi.clear(),this.Bi=null}ji(t){return t.sort((t,e)=>{var i,r,n=Up(t),s=Up(e);if(n&&!s)return-1;if(!n&&s)return 1;var o=t.schedule===kf,a=e.schedule===kf;return o&&!a?1:!o&&a?-1:((null==(i=t.appearance)?void 0:i.surveyPopupDelaySeconds)||0)-((null==(r=e.appearance)?void 0:r.surveyPopupDelaySeconds)||0)})}xi(t){return Cg(t,this._posthog)}qi(t,e,i){if(this.mi.has(t.id))return!1;var r=function(t){var e={},i=!1,r=t.replace(/^\?/,"");if(!r)return{params:e,autoSubmit:i};for(var n of r.split("&")){var s=n.split("="),o=s[0],a=s[1];if(o&&!Ie(a)){var l=decodeURIComponent(o),u=decodeURIComponent(a);if("auto_submit"!==l||"true"!==u){var h=l.match(/^q(\d+)$/);if(h){var d=parseInt(h[1],10);e[d]||(e[d]=[]),e[d].push(u)}}else i=!0}}return{params:e,autoSubmit:i}}(Tg.location.search).params;if(0===Object.keys(r).length)return!1;Lf.info("[Survey Prefill] Detected URL prefill parameters");var n=this.zi(t,r,e);return!!n&&(this.Wi(t,n,i,e),this.mi.add(t.id),n.isSurveyCompleted)}Wi(t,e,i,r){var n=e.responses,s=e.submissionId,o=e.isSurveyCompleted,a=e.skippedResponses;(Object.keys(a).length>0&&t.enable_partial_responses||o)&&Ip({responses:o?n:a,survey:t,surveySubmissionId:s,posthog:this._posthog,isSurveyCompleted:o,properties:i,surveyLanguage:r})}Ii(t,e,i,r){var n={};for(var s of Object.entries(e)){var o=s[1];n[parseInt(s[0])]=xe(o)?o.map(String):[String(o)]}Lf.info("[Survey] Processing initial responses");var a=this.zi(t,n,r);return!!a&&(this.Wi(t,a,i,r),a.isSurveyCompleted)}zi(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=na(t.id);try{switch(t.type){case bf:if(!t.choices||0===t.choices.length)return void xn.warn("[Survey Prefill] Question "+r+" has no choices");var o=parseInt(n[0],10);if(isNaN(o)||0>o||o>=t.choices.length)return void xn.warn("[Survey Prefill] Invalid choice index for q"+r+": "+n[0]);i[s]=t.choices[o];break;case yf:if(!t.choices||0===t.choices.length)return void xn.warn("[Survey Prefill] Question "+r+" has no choices");var a=n.map(t=>parseInt(t,10)).filter(e=>!isNaN(e)&&e>=0&&t.choices.length>e);if(0===a.length)return void xn.warn("[Survey Prefill] No valid choices for q"+r);var l=[...new Set(a.map(e=>t.choices[e]))];a.length>l.length&&xn.warn("[Survey Prefill] Removed duplicate choices for q"+r),i[s]=l;break;case _f:var u=parseInt(n[0],10),h=t.scale||10;if(isNaN(u)||0>u||u>h)return void xn.warn("[Survey Prefill] Invalid rating for q"+r+": "+n[0]+" (scale: 0-"+h+")");i[s]=u;break;default:xn.info("[Survey Prefill] Question type "+t.type+" does not support prefill")}}catch(t){xn.error("[Survey Prefill] Error converting q"+r+":",t)}}}),i}(t,e);if(0===Object.keys(r).length)return Lf.warn("[Survey Prefill] No valid responses after conversion"),null;var n=Kf(),s=function(t,e,i){for(var r=0,n={},s=[],o=t.questions.length+1,a=0;t.questions.length>r&&o>a&&(a++,e.includes(r));){var l=t.questions[r];if(!l||!("skipSubmitButton"in l)||!l.skipSubmitButton)break;if(l.id){var u=na(l.id);Ie(i[u])||(n[u]=i[u])}s.push(r);var h=Sg(t,r,l.id?i[na(l.id)]:null);if(h===wf)return{startQuestionIndex:t.questions.length,skippedResponses:n,skippedIndices:s};r=h}return{startQuestionIndex:r,skippedResponses:n,skippedIndices:s}}(t,Object.keys(e).map(t=>parseInt(t,10)),r),o=s.startQuestionIndex,a=s.skippedResponses,l=s.skippedIndices,u=o>=t.questions.length;return Hp(t,{surveySubmissionId:n,responses:r,lastQuestionIndex:o,questionOrder:Op(t.questions),visitedIndices:l,surveyLanguage:i}),Lf.info("[Survey Prefill] Stored prefilled responses in localStorage"),{responses:r,submissionId:n,startQuestionIndex:o,isSurveyCompleted:u,skippedResponses:a}}catch(t){return Lf.error("[Survey Prefill] Error handling prefill:",t),null}}Vi(t,e){if(void 0===e&&(e=void 0),!t)return!0;var i=this.$i,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}Zi(t){return!t.conditions||jp(t,this._posthog)&&function(t){var e,i;return function(t,e){var i,r,n;if(!t||0===t.length)return!0;if(!g)return!1;var s=Ji(g,{userAgentDataPlatform:null==u||null==(i=u.userAgentData)?void 0:i.platform,maxTouchPoints:null==u?void 0:u.maxTouchPoints,screenWidth:null==a||null==(r=a.screen)?void 0:r.width,screenHeight:null==a||null==(n=a.screen)?void 0:n.height,devicePixelRatio:null==a?void 0:a.devicePixelRatio});return ma[null!=e?e:"icontains"](t,[s])}(null==(e=t.conditions)?void 0:e.deviceTypes,null==(i=t.conditions)?void 0:i.deviceTypesMatchType)}(t)&&function(t){var e;return null==(e=t.conditions)||!e.selector||!(null==wp||!wp.querySelector(t.conditions.selector))}(t)}Gi(t){var e;return Dp(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.$i)&&e.hasLoadedFlags?{satisfied:this.Vi(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(!Nf(t))return r.eligible=!1,r.reason="Survey is not running. It was completed on "+t.end_date,r;if(!zf.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.Vi(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.Vi(t.targeting_flag_key))return r.eligible=!1,r.reason="Survey targeting feature flag is not enabled",r;var s,o=this.Gi(t);return o.satisfied?function(t,e){if(!t||!e)return!0;var i="string"==typeof e?new Date(e):e,r=Math.abs((new Date).getTime()-i.getTime());return Math.ceil(r/864e5)>t}(null==(i=t.conditions)?void 0:i.seenSurveyWaitPeriodInDays,np.li("lastSeenSurveyDate"))?(t=>!!np.li(Bf(t))&&!Dp(t))(t)?(r.eligible=!1,r.reason="Survey has already been seen and it can't be activated again",r):r:(r.eligible=!1,r.reason="Survey wait period has not passed",r):(r.eligible=!1,r.reason=null!==(s=o.reason)&&void 0!==s?s:"Survey internal targeting flag is not enabled and survey cannot activate repeatedly and survey is not in progress",r)}checkSurveyRenderability(t){var e=this.checkSurveyEligibility(t);return e.eligible&&!this.Qi(t)?{eligible:!1,reason:"Survey event/action trigger has not been fired yet"}:e}Qi(t){var e;return!ca(t)&&!qf(t)||!(null==(e=this._posthog.surveys)||null==(e=e._surveyEventReceiver)||null==(e=e.getSurveys())||!e.includes(t.id))}Ji(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.Vi(e)})}Ei(t){return this.checkSurveyEligibility(t).eligible&&this.Zi(t)&&this.Qi(t)&&this.Ji(t)}Fi(t){try{var e=Mg.querySelector(Vp(t,!0));null!=e&&e.shadowRoot&&($c(null,e.shadowRoot),this.gi.delete(e.shadowRoot)),null==e||e.remove()}catch(e){Lf.warn("Failed to remove survey "+t.id+" from DOM:",e)}}getTestAPI(){return{addSurveyToFocus:this.Ri,removeSurveyFromFocus:this.Ai,surveyInFocus:this.Bi,surveyTimeouts:this.fi,handleWidget:this.Li,handlePopoverSurvey:this.handlePopoverSurvey,manageWidgetSelectorListener:this.Ni,sortSurveysByAppearanceDelay:this.ji,checkFlags:this.Ji.bind(this),isSurveyFeatureFlagEnabled:this.Vi.bind(this),onLanguageChange:this.Hi.bind(this),currentLanguage:this.yi,surveyIsRendered:this.bi}}};function Pg(t,e){if(Mg&&Tg){var i,r=new Ag(t);if(t.config.disable_surveys_automatic_display)return Lf.info("Surveys automatic display is disabled. Skipping call surveys and evaluate display logic."),r;if(!1===e)return Lf.info("There are no surveys to load or Surveys is disabled in the project settings."),r;r.callSurveysAndEvaluateDisplayLogic(!0);var n=()=>{Ie(i)&&(i=setInterval(()=>{r.callSurveysAndEvaluateDisplayLogic(!1)},1e3))},s=()=>{Ie(i)||(clearInterval(i),i=void 0)};n();var o=()=>{Mg.hidden?s():(r.callSurveysAndEvaluateDisplayLogic(!1),n())};return $n(Mg,"visibilitychange",o),r.setAutomaticDisplayDispose(()=>{s(),Mg.removeEventListener("visibilitychange",o)}),r}}function Fg(t){var e=t.survey,i=t.removeSurveyFromFocus,r=void 0===i?()=>{}:i,n=t.setSurveyVisible,s=t.isPreviewMode,o=void 0!==s&&s,a=t.posthog;Gc(()=>{var t;if(!o&&null!=(t=e.conditions)&&t.url){var i=()=>{var t,i=e.type===pf,s=jp(e,a),o=(null==(t=e.appearance)?void 0:t.widgetType)===uf&&i;if(!s)return Lf.info("Hiding survey "+e.id+" because URL does not match"),n(!1),r(e);o&&(Lf.info("Showing survey "+e.id+" because it is a feedback button tab and URL matches"),n(!0))};$n(Tg,"popstate",i),$n(Tg,"hashchange",i);var s=Tg.history.pushState,l=Tg.history.replaceState;return Tg.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()},Tg.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()},()=>{Tg.removeEventListener("popstate",i),Tg.removeEventListener("hashchange",i),Tg.history.pushState=s,Tg.history.replaceState=l}}},[o,e,r,n,a])}var Og=200;function $g(t){switch(void 0===t&&(t="right"),t){case"top":return{top:"0",left:"50%",transform:"translateX(-50%)"};case"left":return{top:"50%",left:"0",transform:"rotate(90deg) translateY(-100%)",transformOrigin:"left top"};case"bottom":return{bottom:"0",left:"50%",transform:"translateX(-50%)"};default:return{top:"50%",right:"0",transform:"rotate(-90deg) translateY(-100%)",transformOrigin:"right top"}}}function Dg(t){var e,i,r,s,o,a,l,u,h,d,v,c,f=t.survey,p=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,I=t.onPopupSurveyDismissed,E=void 0===I?()=>{}:I,R=t.onCloseConfirmationMessage,A=void 0===R?()=>{}:R,P=t.properties,F=t.isSurveyCompleted,O=t.skipShownEvent,D=t.surveyLanguage,L=Zc(null),N=Number.isInteger(b),q=function(t,e,i,r,s,o,a,l,u){var h=Vc(r||0===i||t.type===gf),d=h[0],v=h[1],c=Vc(!1),f=c[0],p=c[1],g=Zc(!1),m=()=>{var e=()=>{o&&s(t),v(!1)};if(!g.current){var i=null==a?void 0:a.current;i?(g.current=!0,i.style.transition="opacity "+Og+"ms ease-out",i.style.opacity="0",setTimeout(()=>{g.current=!1,e()},250)):e()}},y=e=>{e.detail.surveyId===t.id&&m()};return Gc(()=>{if(e){if(!r){var s,o=e=>{var i,r;if(e.detail.surveyId===t.id){if(null==(i=t.appearance)||!i.displayThankYouMessage)return m();p(!0),null!=(r=t.appearance)&&r.autoDisappear&&(s&&clearTimeout(s),s=setTimeout(m,5e3))}},a=()=>{if(jp(t,e)){v(!0),Tg.dispatchEvent(new Event("PHSurveyShown")),l||e.capture(Sf,n({[Mf]:t.name,[Tf]:t.id,[If]:t.current_iteration,[Ef]:t.current_iteration_start_date},u&&{[Of]:u},{sessionRecordingUrl:null==e.get_session_replay_url?void 0:e.get_session_replay_url()}));try{localStorage.setItem("lastSeenSurveyDate",(new Date).toISOString())}catch(t){}}};$n(Tg,"PHSurveyClosed",y),$n(Tg,"PHSurveySent",o);var h=i>0?setTimeout(a,i):void 0;return Ie(h)&&a(),()=>{Ie(h)||clearTimeout(h),Ie(s)||clearTimeout(s),Tg.removeEventListener("PHSurveyClosed",y),Tg.removeEventListener("PHSurveySent",o)}}}else Lf.error("usePopupVisibility hook called without a PostHog instance.")},[]),Fg({survey:t,removeSurveyFromFocus:s,setSurveyVisible:v,isPreviewMode:r,posthog:e}),{isPopupVisible:d,isSurveySent:f,setIsPopupVisible:v,hidePopupWithAnimation:m}}(f,g,null!=(e=f.appearance)&&e.surveyPopupDelaySeconds?1e3*f.appearance.surveyPopupDelaySeconds:0,N,w,S,L,O,D),j=q.isPopupVisible,B=q.hidePopupWithAnimation,H=q.isSurveySent||b===f.questions.length||!0===F,z=Vc(!1),U=z[0],W=z[1],V=Jc(()=>!!zp(f),[f]),G=!!(null!=(i=f.appearance)&&i.introScreenHeader||null!=(r=f.appearance)&&r.introScreenDescription),Z=N?-1===b:!(null==(s=f.appearance)||!s.displayIntroScreen)&&G&&!U&&!V,J=Jc(()=>{var t,e=(null==(t=zp(f))?void 0:t.surveySubmissionId)||Kf();return{isPreviewMode:N,previewPageIndex:b,onPopupSurveyDismissed(){D?Rp(f,g,N,D):Rp(f,g,N),E()},isPopup:S||!1,surveySubmissionId:e,onPreviewSubmit:C,onPreviewBack:M,posthog:g,properties:P,surveyLanguage:D}},[N,b,S,g,f,E,C,M,P,D]);return j?Jp(Lp.Provider,{value:J,children:Jp("div",{className:"ph-survey",style:n({},Gp(f.type,null==(o=f.appearance)?void 0:o.position,null==(a=f.appearance)?void 0:a.widgetType),y),ref:L,children:H?Jp(ug,{header:(null==(l=f.appearance)?void 0:l.thankYouMessageHeader)||"Thank you!",description:(null==(u=f.appearance)?void 0:u.thankYouMessageDescription)||"",forceDisableHtml:!!p,contentType:null==(h=f.appearance)?void 0:h.thankYouMessageDescriptionContentType,appearance:f.appearance||Sp,onClose(){B(),A()}}):Z?Jp(hg,{header:(null==(d=f.appearance)?void 0:d.introScreenHeader)||"",description:(null==(v=f.appearance)?void 0:v.introScreenDescription)||"",forceDisableHtml:!!p,contentType:null==(c=f.appearance)?void 0:c.introScreenDescriptionContentType,appearance:f.appearance||Sp,onStart:()=>W(!0)}):Jp(Lg,{survey:f,forceDisableHtml:!!p,posthog:g})})}):null}function Lg(t){var e,i,r=t.survey,s=t.forceDisableHtml,o=t.posthog,a=Jc(()=>{var t=zp(r);if(!t)return null;var e=Fe(t.lastQuestionIndex);return!e||e&&t.lastQuestionIndex>=0&&r.questions.length>t.lastQuestionIndex?t:(Wp(r),null)},[r]),l=Vc(()=>(null!=a&&a.responses&&Lf.info("Survey is already in progress, filling in initial responses"),(null==a?void 0:a.responses)||{})),u=l[0],h=l[1],d=Qc(Lp),v=d.previewPageIndex,c=d.onPopupSurveyDismissed,f=d.isPopup,p=d.onPreviewSubmit,g=d.onPreviewBack,m=d.surveySubmissionId,y=d.isPreviewMode,b=d.properties,_=d.surveyLanguage,w=Vc(()=>{var t=null==a?void 0:a.lastQuestionIndex,e=Fe(t)&&t>=0&&r.questions.length>t?t:0;return Fe(v)&&v>=0?v:e}),k=w[0],S=w[1],x=Vc(()=>{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=Vc(()=>{var t,e;return null!==(t=null==(e=zp(r))?void 0:e.questionSnapshots)&&void 0!==t?t:{}}),I=M[0],E=M[1],R=Jc(()=>Op($p(r,a)),[r.id,a]),A=Jc(()=>{if(!R||new Set(R).size!==R.length)return $p(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]);Gc(()=>{!y||Ie(v)||0>v||S(v)},[v,y]);var P=!(null==(e=r.appearance)||!e.allowGoBack)&&(y?(null!=v?v:0)>0:C.length>0),F=A.at(k);return F?Jp("form",{className:"survey-form",name:"surveyForm",children:[f&&!0!==(null==(i=r.appearance)?void 0:i.hideCancelButton)&&Jp(ag,{onClick(){c()}}),Jp("div",{className:"survey-box","data-question-index":k,children:qg({question:F,forceDisableHtml:s,displayQuestionIndex:k,appearance:r.appearance||Sp,onSubmit:t=>(t=>{var e=t.res,i=t.displayQuestionIndex,s=t.questionId;if(o)if(s){var a=na(s),l=n({},u,{[a]:e});h(l);var d=A[i],v=null!=d&&d.id?n({},I,{[d.id]:d.question}):I;E(v);var c=Sg(r,i,e),f=c===wf,p=[...C,i];if(f||(T(p),S(c),Hp(r,{surveySubmissionId:m,responses:l,lastQuestionIndex:c,questionOrder:Op(A),visitedIndices:p,surveyLanguage:_,questionSnapshots:v})),r.enable_partial_responses||f){var g=new Set(p.map(t=>{var e;return null==(e=A[t])?void 0:e.id}).filter(t=>!!t).map(t=>na(t)));Ip({responses:Object.fromEntries(Object.entries(l).filter(t=>g.has(t[0]))),survey:r,surveySubmissionId:m,isSurveyCompleted:f,posthog:o,properties:b,surveyLanguage:_,questionSnapshots:v})}}else Lf.error("onNextButtonClick called without a questionId.");else Lf.error("onNextButtonClick called without a PostHog instance.")})({res:t,displayQuestionIndex:k,questionId:F.id}),onPreviewSubmit:p,initialValue:F.id?u[na(F.id)]:void 0,canGoBack:P,onBack(){if(y)g();else if(0!==C.length){var t=C[C.length-1],e=C.slice(0,-1);T(e),S(t),Hp(r,{surveySubmissionId:m,responses:u,lastQuestionIndex:t,questionOrder:Op(A),visitedIndices:e,surveyLanguage:_,questionSnapshots:I})}}})})]}):null}function Ng(t){var e,i,r,n,s,o,a,l=t.survey,u=t.forceDisableHtml,h=t.posthog,d=t.readOnly,v=t.surveyLanguage,c=Vc(!0),f=c[0],p=c[1],g=Vc(!1),m=g[0],y=g[1],b=Vc({}),_=b[0],w=b[1],k=Zc(void 0),S=()=>{y(!m)};if(Gc(()=>{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&&(Lf.info("Received show event for feedback button survey "+l.id),w(i.detail.position||{}),S())};return $n(Tg,Ig,e),()=>{Ie(k.current)||(clearTimeout(k.current),k.current=void 0),Tg.removeEventListener(Ig,e)}}}else Lf.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]),Fg({survey:l,setSurveyVisible:p,posthog:h}),!f)return null;var x=()=>{l.schedule!==kf&&p(!1),Ie(k.current)||clearTimeout(k.current),k.current=setTimeout(()=>{k.current=void 0,y(!1)},200)};return Jp(pc,{children:["tab"===(null==(n=l.appearance)?void 0:n.widgetType)&&Jp("button",{className:"ph-survey-widget-tab "+("top"===(null==(s=l.appearance)?void 0:s.tabPosition)?"widget-tab-top":""),onClick:S,disabled:d,style:$g(null==(o=l.appearance)?void 0:o.tabPosition),children:(null==(a=l.appearance)?void 0:a.widgetLabel)||""}),m&&Jp(Dg,{posthog:h,survey:l,forceDisableHtml:u,style:_,onPopupSurveyDismissed:x,onCloseConfirmationMessage:x,surveyLanguage:v})]})}var qg=t=>{var e=t.question,i=t.displayQuestionIndex,r=t.onSubmit,s=t.onPreviewSubmit,o={forceDisableHtml:t.forceDisableHtml,appearance:t.appearance,onPreviewSubmit(t){s(t)},onSubmit(t){r(t)},initialValue:t.initialValue,displayQuestionIndex:i,canGoBack:t.canGoBack,onBack:t.onBack};switch(e.type){case mf:return cc(vg,n({},o,{question:e,key:e.id}));case"link":return cc(cg,n({},o,{question:e,key:e.id}));case _f:return cc(fg,n({},o,{question:e,key:e.id}));case bf:case yf:return cc(gg,n({},o,{question:e,key:e.id}));default:return Lf.error("Unsupported question type: "+e.type),null}};b.__PosthogExtensions__=b.__PosthogExtensions__||{},b.__PosthogExtensions__.generateSurveys=Pg,b.extendPostHogWithSurveys=Pg;var jg=t=>{for(;null!=(e=t)&&e.__rrweb_original__;){var e;t=t.__rrweb_original__}return t},Bg=1e4,Hg=(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),zg=(t,e,i)=>{var r=JSON.stringify(t);if(i.remaining>=r.length)return Hg(e,r,i);if(i.truncated=!0,2>i.remaining)return!1;for(var n=0,s=Math.min(t.length,i.remaining-2);s>n;){var o=Math.ceil((n+s)/2);JSON.stringify(t.slice(0,o)).length>i.remaining?s=o-1:n=o}return Hg(e,JSON.stringify(t.slice(0,n)),i)},Ug=t=>void 0!==t&&"function"!=typeof t&&"symbol"!=typeof t&&"bigint"!=typeof t,Wg=(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}},Vg=(t,e,i)=>{if(!i.truncated)if(Te(t)){if(i.seen.has(t))return void Wg(e||"circular","[Circular]",i);i.seen.add(t);try{for(var r in t)try{if(!{}.hasOwnProperty.call(t,r))continue;if(Vg(t[r],e?e+"."+r:r,i),i.truncated)return}catch(t){continue}}catch(t){}}else Wg(e,t,i)},Gg=function(t,e,i,r,n,s){if(void 0===n&&(n=!1),!Ug(t))return!n||Hg(e,"null",i);if(Ae(t)||(t=>{try{return Fe(t)||$e(t)}catch(t){return!1}})(t))return Hg(e,JSON.stringify(t),i);if("string"==typeof t)return zg(t,e,i);if(!Te(t)&&!xe(t))return Hg(e,JSON.stringify(t),i);if(r.has(t))return zg("[Circular]",e,i);r.add(t);try{var o=t.toJSON;if(Ce(o))return Gg(o.call(t),e,i,r,n)}catch(t){}try{var a={}.toString.call(t);if("[object String]"===a)return zg(String(t.valueOf()),e,i);if("[object Number]"===a||"[object Boolean]"===a)return Hg(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 Gg(l,e,i,r,n,s)}if(xe(t)){if(!Hg(e,"[",i))return!1;for(var h=0;t.length>h;h++){if(h>0&&!Hg(e,",",i))return!1;var d=void 0;try{d=t[h]}catch(t){d=void 0}if(!Gg(d,e,i,r,!0))return!1}return Hg(e,"]",i)}if(!Hg(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{Vg(f,c,s)}catch(t){}if(Ug(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(!Hg(e,p,i))return!1;var b=e.length,_=Gg(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 Hg(e,"}",i)},Zg=(t,e)=>{for(var i=[],r={remaining:e,truncated:!1},n=Te(t[0])?{result:{},keysRemaining:50,sizeRemaining:Bg,truncated:!1,seen:new WeakSet([t[0]])}:void 0,s=0;t.length>s&&(0>=s||Hg(i," ",r))&&Gg(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)||{}}},Jg={debug:"debug",log:"info",warn:"warn",error:"error",info:"info"},Qg=t=>"canCapture"in t,Kg=t=>Qg(t)?t.canCapture?t.getExtension(Wf):void 0:t.is_capturing()?t.logs:void 0;b.__PosthogExtensions__=b.__PosthogExtensions__||{},b.__PosthogExtensions__.logs={initializeLogs(t){var e=t,i=[],r={host:b.location.host},s=!1,o=function(t){var o=b.console[t];i.push(gv(b.console,t,i=>{var a=(i=>function(){for(var o=!1,a=arguments.length,l=new Array(a),u=0;a>u;u++)l[u]=arguments[u];try{var h=e;if(l.length>0&&!s&&h){var d=Kg(h);if(d){s=!0,o=!0;var v=Zg(l,Bg),c=v.body,f=v.attributes,p=n({},r,v.truncated?{body_truncated:"true"}:{});((t,e,i)=>{if(Qg(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;Ce(n)&&n.call(e,i)}})(h,d,{level:Jg[t],body:c,attributes:n({"log.source":"console."+t},p,f)})}}}catch(t){}finally{o&&(s=!1),i.apply(b.console,l)}})(i);return a.__rrweb_original__=jg(o),a}))};for(var a of Object.keys(Jg))o(a);return()=>{e=void 0,i.forEach(t=>t())}},replayConsoleBuffer(t,e){var i=Kg(t);if(i)for(var r of e)try{var s=Zg(r.args,Bg);null==i.captureBufferedConsoleLog||i.captureBufferedConsoleLog({level:Jg[r.level],body:s.body,attributes:n({"log.source":"console."+r.level,host:b.location.host},s.truncated?{body_truncated:"true"}:{},s.attributes)},r.context,r.occurredAtMs)}catch(t){}}};var Xg=t=>Be(t)&&("RangeError"===t.name&&0===t.message.indexOf("Maximum call stack size exceeded")||"InternalError"===t.name&&"too much recursion"===t.message),Yg=Cn("[Error tracking]"),tm="webkit-masked-url:",em=["chrome-extension://","moz-extension://","safari-extension:","safari-web-extension:",tm],im=["__firefox__","__gCrWeb"];function rm(){return new vr([new Sr,new Fr,new Cr,new xr,new Ar,new Rr,new Mr,new Pr],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 s=[],o=e.split("\n"),a=r;o.length>a;a++){var l=o[a];if(1024>=l.length){var u=kr.test(l)?l.replace(kr,"$1"):l;if(!u.match(/\S*Error: /)){for(var h of i){var d=h(u,t);if(d){s.push(d);break}}if(s.length>=50)break}}}return function(t){if(!t.length)return[];var e=Array.from(t);return e.reverse(),e.slice(0,50).map(t=>{return n({},t,{filename:t.filename||(i=e,i[i.length-1]||{}).filename,function:t.function||"?"});var i})}(s)}}("web:javascript",yr,wr))}var nm=Cn("[ExceptionAutocapture]"),sm=rm(),om=(t,e)=>{try{return t()}catch(t){return e}},am=(t,e)=>om(()=>t(e()),void 0),lm=t=>om(()=>Ce(t)&&Ce(t.call),!1),um=(t,e)=>om(()=>{t[e].__POSTHOG_INSTRUMENTED__=!0},void 0),hm=(t,e,i)=>{om(()=>{var i;null==(i=t[e])||delete i.__POSTHOG_INSTRUMENTED__},void 0),om(()=>{t[e]=i},void 0)},dm=t=>{var e=a;e||nm.info("window not available, cannot wrap onerror");var i=om(()=>e.onerror,void 0);return e.onerror=function(){for(var e,r=arguments.length,n=new Array(r),s=0;r>s;s++)n[s]=arguments[s];return am(t,()=>sm.buildFromUnknown((t=>{var e=t[0],i=t[1],r=t[2],n=t[3],s=t[4];if(null!=s)return s;if(Ee(e)&&Ee(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}})),!!lm(i)&&null!==(e=i(...n))&&void 0!==e&&e},um(e,"onerror"),()=>hm(e,"onerror",i)},vm=function(t,e){void 0===e&&(e=!1);var i=a;i||nm.info("window not available, cannot wrap onUnhandledRejection");var r=om(()=>i.onunhandledrejection,void 0);return i.onunhandledrejection=function(i){var n;return am(t,()=>sm.buildFromUnknown(i,{mechanism:{handled:!1}})),lm(r)?null!==(n=r(i))&&void 0!==n&&n:e},um(i,"onunhandledrejection"),()=>hm(i,"onunhandledrejection",r)},cm={wrapOnError:dm,wrapUnhandledRejection:vm,wrapConsoleError(t){var e=console;e||nm.info("console not available, cannot wrap console.error");var i=om(()=>e.error,void 0);return e.error=function(){for(var e=arguments.length,r=new Array(e),n=0;e>n;n++)r[n]=arguments[n];am(t,()=>{var t;t=1==r.length?r[0]:r.join(" ");var e=r.find(t=>t instanceof Error);return sm.buildFromUnknown(e||t,{mechanism:{handled:!1},syntheticException:new Error("PostHog syntheticException"),skipFirstLines:2})}),lm(i)&&i(...r)},um(e,"error"),()=>hm(e,"error",i)}};b.__PosthogExtensions__=b.__PosthogExtensions__||{},b.__PosthogExtensions__.errorWrappingFunctions=cm,b.posthogErrorWrappingFunctions=cm;var fm=(t,e)=>{if(Ce(null==t?void 0:t.capture)){var i=null==e?void 0:e.autocaptureExceptions,r=!Ae(i)&&"object"==typeof i&&xe(i.errors_to_ignore)?i.errors_to_ignore.reduce((t,e)=>{try{t.push(new RegExp(e))}catch(t){nm.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){nm.error("Failed to capture exception for a legacy client",t)}};dm(t=>{r.some(e=>t.$exception_list.some(t=>e.test(t.value||"")))||n(t)}),vm(n,!0)}};b.extendPostHogWithExceptionAutoCapture=fm,b.extendPostHogWithExceptionAutocapture=fm;var pm="X-POSTHOG-SESSION-ID",gm="X-POSTHOG-WINDOW-ID",mm="X-POSTHOG-DISTINCT-ID",ym=[pm,gm,mm],bm=["attributionReporting","body","browsingTopics","cache","credentials","dispatcher","duplex","integrity","keepalive","method","mode","priority","redirect","referrer","referrerPolicy","signal","window"],_m=(t,e)=>({}.hasOwnProperty.call(t,e)),wm=t=>"object"==typeof t&&!Ae(t)||Ce(t),km=t=>"undefined"!=typeof Request&&(t instanceof Request||"[object Request]"==={}.toString.call(t)),Sm=t=>{try{var e;return km(t)?t.url:new URL(t instanceof URL?t.toString():String(t),null==a||null==(e=a.location)?void 0:e.href).toString()}catch(t){return}},xm=(t,e,i,r,n)=>{var s;try{s=new URL(r).hostname}catch(t){return!1}if(!t)return!1;if(xe(t)&&!t.includes(s))return!1;var o=!1;if(i){var a=i.checkAndGetSessionAndWindowId(!0),l=a.windowId;n.set(pm,a.sessionId),n.set(gm,l),o=!0}var u=(t=>Ce(t)?t():t)(e);return u&&"$posthog_cookieless"!==u&&(n.set(mm,u),o=!0),o};b.__PosthogExtensions__=b.__PosthogExtensions__||{};var Cm={_patchFetch:(t,e,i)=>gv(a,"fetch",r=>function(s,o){var a=arguments.length>1?[s,o]:[s],l=a;try{var u=Sm(s);if(u)if(km(s)){var h=new Request(s,o);xm(t,e,i,h.url,h.headers),l=[h]}else{var d=new Headers(wm(o)?o.headers:void 0);if(xm(t,e,i,u,d)){var v=((t,e)=>{if(Ie(t)||Ae(t))return{headers:e};if(wm(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)=>_m(t,e)?Reflect.get(t,e):Reflect.get(i,e,i),has:(t,e)=>_m(t,e)||e in i,ownKeys(t){var e=new Set(Reflect.ownKeys(t));return Reflect.ownKeys(i).forEach(t=>e.add(t)),bm.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&&bm.includes(e)&&e in i)return{configurable:!0,enumerable:!0,get(){return Reflect.get(i,e,i)}};var s=Reflect.getOwnPropertyDescriptor(i,e);return s?n({},s,{configurable:!0}):void 0},getPrototypeOf:()=>Object.getPrototypeOf(i)})}})(o,d);v&&(l=[s,v])}}}catch(t){l=a}return r.apply(this,l)}),_patchXHR:(t,e,i)=>gv(a.XMLHttpRequest.prototype,"open",r=>function(n,s,o,a,l){void 0===o&&(o=!0);var u=this,h=new Headers,d=Sm(s);d&&xm(t,e,i,d,h);var v=r.call(u,n,s,o,a,l);return ym.forEach(t=>{var e=h.get(t);if(e)try{u.setRequestHeader(t,e)}catch(t){}}),v})};b.__PosthogExtensions__.tracingHeadersPatchFns=Cm,b.postHogTracingHeadersPatchFns=Cm,"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}),"function"!=typeof[].findLast&&Object.defineProperty(Array.prototype,"findLast",{value(t,e){for(var i=this.length-1;i>=0;i--){var r=this[i];if(t.call(e,r,i,this))return r}},writable:!0,enumerable:!1,configurable:!0});var Tm=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)}}},Mm=()=>{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=Mm();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"},Em=t=>{var e=t.nodeName;return 1===t.nodeType?e.toLowerCase():e.toUpperCase().replace(/^#/,"")},Rm=t=>{var e="";try{for(;9!==(null==(i=t)?void 0:i.nodeType);){var i,r,n=t,s=n.id?"#"+n.id:[Em(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 Pm(t,e){var i=Am.get(e);return i||Am.set(e,i=new WeakMap),i.get(t)||i.set(t,new e),i.get(t)}var Fm,Om=-1,$m=()=>Om,Dm=t=>{addEventListener("pageshow",e=>{e.persisted&&(Om=e.timeStamp,t(e))},!0)},Lm=(t,e,i,r)=>{var n,s;return o=>{e.value>=0&&(o||r)&&((s=e.value-(null!=n?n:0))||void 0===n)&&(n=e.value,e.delta=s,e.rating=((t,e)=>t>e[1]?"poor":t>e[0]?"needs-improvement":"good")(e.value,i),t(e))}},Nm=t=>{requestAnimationFrame(()=>requestAnimationFrame(()=>t()))},qm=()=>{var t,e;return null!==(t=null==(e=Mm())?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,r=qm();jm=null!==(e=document.prerendering||null==(i=globalThis.performance.getEntriesByType("visibility-state").find(t=>"hidden"===t.name&&t.startTime>=r))?void 0:i.startTime)&&void 0!==e?e: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,o){void 0===e&&(e=-1),void 0===r&&(r=0);var a=Mm(),l=(null==a?void 0:a.navigationId)||0,u="navigate";return i?u=i:0>$m()?a&&(document.prerendering||qm()>0?u="prerender":document.wasDiscarded?u="restore":a.type&&(u=a.type.replace(/_/g,"-"))):u="back-forward-cache",{name:t,value:e,rating:"good",delta:0,entries:[],id:"v6-"+Date.now()+"-"+(Math.floor(8999999999999*Math.random())+1e12),navigationType:u,navigationId:r||l,navigationInteractionId:n,navigationURL:s||(null==a?void 0:a.name),navigationStartTime:o||0}},Vm=function(t,e,i){void 0===i&&(i={});try{var r=t.filter(t=>PerformanceObserver.supportedEntryTypes.includes(t));if(r.length>0){var s=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 o of r)s.observe(n({type:o,buffered:!0},i));return s}}catch(t){}},Gm=t=>{var e,i;return(null==(e=globalThis.PerformanceObserver)||null==(e=e.supportedEntryTypes)?void 0:e.includes("soft-navigation"))&&"function"==typeof(null==(i=globalThis.PerformanceSoftNavigation)||null==(i=i.prototype)?void 0:i.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)}},Jm=t=>{var e=!1;return()=>{e||(t(),e=!0)}},Qm=class{constructor(){this.u=void 0}},Km=t=>{document.prerendering?addEventListener("prerenderingchange",t,!0):t()},Xm=[1800,3e3],Ym=function(t,e){void 0===e&&(e={});var i=Gm(e);Km(()=>{var r,n=Pm(e,Qm),s=Um(),o=Wm("FCP"),a=Vm(["paint"],t=>{for(var e of t)"first-contentful-paint"===e.name&&(a.disconnect(),s.firstHiddenTime>e.startTime&&(o.value=Math.max(e.startTime-qm(),0),o.entries.push(e),o.navigationId=e.navigationId||o.navigationId,r(!0)))});a&&(r=Lm(t,o,Xm,e.reportAllChanges),Dm(i=>{o=Wm("FCP",-1,"back-forward-cache",o.navigationId,o.navigationInteractionId,o.navigationURL,$m()),r=Lm(t,o,Xm,e.reportAllChanges),Nm(()=>{o.value=performance.now()-i.timeStamp,r(!0)})})),i&&Vm(["soft-navigation"],i=>{i.forEach(i=>{n.u&&i.navigationId&&Zm(n.u,i),o=Wm("FCP",Math.max((i.presentationTime||i.paintTime||0)-i.startTime,0),"soft-navigation",i.navigationId,i.interactionId,i.name,i.startTime),(r=Lm(t,o,Xm,e.reportAllChanges))(!0)})},e)})},ty=[.1,.25],ey=t=>t.find(t=>{var e;return 1===(null==(e=t.node)?void 0:e.nodeType)})||t[0],iy=function(t,e){void 0===e&&(e={});var i=Pm(e=Object.assign({},e),Tm),r=new WeakMap;i.t=t=>{var i;if(null!=t&&null!=(i=t.sources)&&i.length){var n=ey(t.sources),s=null==n?void 0:n.node;if(s){var o,a=null!==(o=null==e.generateTarget?void 0:e.generateTarget(s))&&void 0!==o?o:Rm(s);r.set(n,a)}}},function(t,e){void 0===e&&(e={});var i=Um();Ym(Jm(()=>{var r,n=Wm("CLS",0),s=Pm(e,Tm),o=(i,o,a,l,u)=>{n=Wm("CLS",0,i,o,a,l,u),s.o=0,r=Lm(t,n,ty,e.reportAllChanges)},a=function(t){void 0===t&&(t=!1),s.o>n.value&&(n.value=s.o,n.entries=s.i),r(t)},l=t=>{a(!0),o("soft-navigation",t.navigationId,t.interactionId,t.name,t.startTime)},u=t=>{for(var e of t)"soft-navigation"!==e.entryType?s.l(e):l(e);a()},h=["layout-shift"];Gm(e)&&h.push("soft-navigation");var d=Vm(h,u);d&&(r=Lm(t,n,ty,e.reportAllChanges),i.onHidden(()=>{u(d.takeRecords()),r(!0)}),Dm(()=>{o("back-forward-cache",n.navigationId,n.navigationInteractionId,n.navigationURL,$m()),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=ey(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)},ry=function(t,e){void 0===e&&(e={});var i=Pm(e=Object.assign({},e),Qm);Gm(e)&&(i.u=new Map),Ym(e=>{t((t=>{var e={timeToFirstByte:0,firstByteToFCP:t.value,loadState:Im($m())};if("soft-navigation"!==t.navigationType){if(t.entries.length){var r=Mm(),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 o,a=null==(o=i.u)?void 0:o.get(t.navigationId);a&&(e={timeToFirstByte:0,firstByteToFCP:t.value,loadState:"complete",navigationEntry:a})}return Object.assign(t,{attribution:e})})(e))},e)},ny=0,sy=1/0,oy=0,ay=t=>{for(var e of t)e.interactionId&&(sy=Math.min(sy,e.interactionId),oy=Math.max(oy,e.interactionId),ny=oy?(oy-sy)/7+1:0)},ly=()=>{var t;return Fm?ny:null!==(t=performance.interactionCount)&&void 0!==t?t:0},uy=class{constructor(){this.h=0,this.v=[],this.p=new Map,this.m=void 0,this.M=void 0}T(){return ly()-this.h}D(){this.h=ly(),this.v.length=0,this.p.clear()}S(t){var e=this.T(),i=Math.min(this.v.length-1,Math.floor(e/50));return!e||-1!==i||"soft-navigation"!==t&&"back-forward-cache"!==t?this.v[i]:{k:8,id:-1,entries:[]}}l(t){var e;if(null!=(e=this.m)&&e.call(this,t),t.interactionId){var i=this.v.at(-1),r=this.p.get(t.interactionId);if(r||10>this.v.length||t.duration>i.k){var n;if(r?t.duration>r.k?(r.entries=[t],r.k=t.duration):t.duration===r.k&&t.startTime===r.entries[0].startTime&&r.entries.push(t):(this.p.set((r={id:t.interactionId,entries:[t],k:t.duration}).id,r),this.v.push(r)),this.v.sort((t,e)=>e.k-t.k),this.v.length>10)for(var s of this.v.splice(10))this.p.delete(s.id);null==(n=this.M)||n.call(this,r)}}}},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=Jm(t),s=-1,o=()=>{r(s),n()};addEventListener("visibilitychange",o,{once:!0,capture:!0}),s=i(()=>{removeEventListener("visibilitychange",o,{capture:!0}),n()},{timeout:e})}},dy=[200,500],vy=function(t,e){void 0===e&&(e={});var i=Pm(e=Object.assign({},e),uy),r=[],s=[],o=0,a=new WeakMap,l=new WeakMap,u=!1,h=()=>{u||(hy(d),u=!0)},d=()=>{var t=new Set(i.v.map(t=>a.get(t.entries[0]))),e=s.length-10;s=s.filter((i,r)=>r>=e||t.has(i));var n=new Set;for(var l of s)for(var h of v(l.startTime,l.processingEnd))n.add(h);r=r.filter(t=>t.startTime>o||n.has(t)),u=!1};i.m=t=>{var i,r=t.startTime+t.duration;o=Math.max(o,t.processingEnd);for(var n=s.length-1;n>=0;n--){var l=s[n];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||s.push(i={startTime:t.startTime,processingStart:t.processingStart,processingEnd:t.processingEnd,renderTime:r,entries:e.includeProcessedEventEntries?[t]:[]}),t.interactionId&&a.set(t,i),h()},i.M=t=>{if(!l.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:Rm(r);l.set(t,s)}else{var o,a=null==(o=t.entries.find(t=>t.targetSelector))?void 0:o.targetSelector;a&&l.set(t,a)}}};var v=(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),h()},e),function(t,e){if(void 0===e&&(e={}),globalThis.PerformanceEventTiming&&"interactionId"in PerformanceEventTiming.prototype){var i=Um();Km(()=>{var r;"interactionCount"in performance||Fm||(Fm=Vm(["event"],ay,{durationThreshold:0}));var s,o=Wm("INP"),a=Pm(e,uy),l=(i,r,n,l,u)=>{a.D(),o=Wm("INP",-1,i,r,n,l,u),s=Lm(t,o,dy,e.reportAllChanges)},u=()=>{var t=a.S(o.navigationType);t&&t.k!==o.value&&(o.value=t.k,o.entries=t.entries,s())},h=t=>{u(),s(!0),l("soft-navigation",t.navigationId,t.interactionId,t.name,t.startTime)},d=function(t,e){void 0===e&&(e=!1),hy(()=>{for(var i of t)"soft-navigation"!==i.entryType?a.l(i):h(i);u(),e&&s(!0)})},v=["event","first-input"];Gm(e)&&v.push("soft-navigation");var c=Vm(v,d,n({},e,{durationThreshold:null!==(r=e.durationThreshold)&&void 0!==r?r:40}));s=Lm(t,o,dy,e.reportAllChanges),c&&(i.onHidden(()=>{d(c.takeRecords(),!0)}),Dm(()=>{l("back-forward-cache",o.navigationId,o.navigationInteractionId,o.navigationURL,$m())}))})}}(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=Math.max(n.processingStart,r.startTime),o=Math.max(r.startTime+r.duration,s),u=Math.min(n.processingEnd,o),h=n.entries.sort((t,e)=>t.processingStart-e.processingStart),d=v(r.startTime,u),c=i.p.get(r.interactionId),f={interactionTarget:l.get(c),interactionType:r.name.startsWith("key")?"keyboard":"pointer",interactionTime:r.startTime,nextPaintTime:o,processedEventEntries:h,longAnimationFrameEntries:d,inputDelay:s-r.startTime,processingDuration:u-s,presentationDelay:o-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,o=t.inputDelay,a=t.processingDuration,l=0,u=0,h=0,d=0;for(var v of t.longAnimationFrameEntries)for(var c of(u=u+v.startTime+v.duration-v.styleAndLayoutStart,v.scripts)){var f=c.startTime+c.duration;if(f>=i){var p=f-Math.max(i,c.startTime),g=c.duration?p/c.duration*c.forcedStyleAndLayoutDuration:0;l+=p-g,u+=g,p>d&&(s=i+o>c.startTime?"input-delay":i+o+a>c.startTime?"processing-duration":"presentation-delay",n=c,d=p)}}var m=t.longAnimationFrameEntries.at(-1),y=m?m.startTime+m.duration:0;y>=i+o+a&&(h=r-y),n&&s&&(t.longestScript={entry:n,subpart:s,intersectingDuration:d}),t.totalScriptDuration=l,t.totalStyleAndLayoutDuration=u,t.totalPaintDuration=h,t.totalUnattributedDuration=r-i-l-u-h}})(f),Object.assign(t,{attribution:f})})(e))},e)},cy=class{constructor(){this.m=void 0,this.u=void 0}l(t){var e;null==(e=this.m)||e.call(this,t)}},$=[2500,4e3],fy=50,py=[];Vm(["resource"],t=>{for(var e of t)py.push(e),py.length>fy&&py.shift()});var gy=function(t,e){void 0===e&&(e={}),null!=(e=Object.assign({},e)).resourceBufferSize&&(fy=e.resourceBufferSize);var i=Pm(e,cy),r=new WeakMap;Gm(e)&&(i.u=new Map),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:Rm(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);Km(()=>{var n,s=Um(),o=Wm("LCP"),a=Pm(e,cy),l=(r,a,l,u,h)=>{o=Wm("LCP",-1,r,a,l,u,h),n=Lm(t,o,$,e.reportAllChanges),i=!1,"soft-navigation"===r&&(s=Um(!0))},u=t=>{a.u&&t.navigationId&&Zm(a.u,t),i||n(!0),l("soft-navigation",t.navigationId,t.interactionId,t.name,t.startTime);var e=null==t.getLargestInteractionContentfulPaint?void 0:t.getLargestInteractionContentfulPaint();e&&h([e])},h=t=>{for(var i of(e.reportAllChanges||r||(t=t.slice(-1)),t))if(i)if("soft-navigation"!==i.entryType){var l=0,h=[],d=i.startTime;if("largest-contentful-paint"===i.entryType)l=Math.max(i.startTime-qm(),0),a.l(i),h=[i];else if("interaction-contentful-paint"===i.entryType){var v,c=i;if(!o.navigationId)continue;if("interactionId"in c&&c.interactionId!=o.navigationInteractionId)continue;d=(null==(v=c.largestContentfulPaint)?void 0:v.renderTime)||0,l=Math.max(d-i.startTime,0),c.largestContentfulPaint&&(a.l(c.largestContentfulPaint),h=[c.largestContentfulPaint])}s.firstHiddenTime>d&&(o.value=l,o.entries=h,n())}else u(i)},d=["largest-contentful-paint"];r&&d.push("interaction-contentful-paint","soft-navigation");var v=Vm(d,h);if(v){n=Lm(t,o,$,e.reportAllChanges);var c=["keydown","click","visibilitychange"],f=t=>{if(t.isTrusted&&!i){var e=o.id;hy(()=>{if(!i){if(!r)for(var t of(v.disconnect(),c))removeEventListener(t,f,{capture:!0});e===o.id&&(i=!0,n(!0))}})}};for(var p of c)addEventListener(p,f,{capture:!0});Dm(r=>{l("back-forward-cache",o.navigationId,o.navigationInteractionId,o.navigationURL,$m()),n=Lm(t,o,$,e.reportAllChanges),Nm(()=>{o.value=performance.now()-r.timeStamp,i=!0,n(!0)})})}})}(e=>{t((t=>{var e={timeToFirstByte:0,resourceLoadDelay:0,resourceLoadDuration:0,elementRenderDelay:t.value};if(t.entries.length){var s,o,a,l,u,h,d=t.entries.at(-1),v=d.url&&(py.findLast(t=>t.name===d.url)||performance.getEntriesByType("resource").findLast(t=>t.name===d.url));e.target=r.get(d),e.lcpEntry=d,d.url&&(e.url=d.url),v&&(e.lcpResourceEntry=v);var c=0,f=0;if("soft-navigation"!==t.navigationType?(c=null!==(s=null==(o=h=Mm())?void 0:o.activationStart)&&void 0!==s?s:0,f=null!==(a=null==(l=h)?void 0:l.responseStart)&&void 0!==a?a:0):(c=t.navigationStartTime||0,h=null==(u=i.u)?void 0:u.get(t.navigationId)),h){var p=Math.max(0,f-c),g=Math.max(p,v?(v.requestStart||v.startTime)-c:0),m=Math.min(t.value,Math.max(g,v?v.responseEnd-c:0));e=n({},e,{timeToFirstByte:p,resourceLoadDelay:g-p,resourceLoadDuration:m-g,elementRenderDelay:t.value-m,navigationEntry:h})}}return Object.assign(t,{attribution:e})})(e))},e)},my=-1,yy=()=>my,by=t=>{addEventListener("pageshow",e=>{e.persisted&&(my=e.timeStamp,t(e))},!0)},_y=(t,e,i,r)=>{var n,s;return o=>{e.value>=0&&(o||r)&&((s=e.value-(null!=n?n:0))||void 0===n)&&(n=e.value,e.delta=s,e.rating=((t,e)=>t>e[1]?"poor":t>e[0]?"needs-improvement":"good")(e.value,i),t(e))}},wy=t=>{requestAnimationFrame(()=>requestAnimationFrame(()=>t()))},ky=()=>{var t=performance.getEntriesByType("navigation")[0];if(t&&t.responseStart>0&&t.responseStart<performance.now())return t},Sy=()=>{var t,e;return null!==(t=null==(e=ky())?void 0:e.activationStart)&&void 0!==t?t:0},xy=-1,Cy=new Set,Ty=()=>"hidden"!==document.visibilityState||document.prerendering?1/0:0,My=t=>{if("hidden"===document.visibilityState){if("visibilitychange"===t.type)for(var e of Cy)e();isFinite(xy)||(xy="visibilitychange"===t.type?t.timeStamp:0,removeEventListener("prerenderingchange",My,!0))}},Iy=function(t){if(void 0===t&&(t=!1),t&&(xy=1/0),0>xy){var e,i,r=Sy();xy=null!==(e=document.prerendering||null==(i=globalThis.performance.getEntriesByType("visibility-state").find(t=>"hidden"===t.name&&t.startTime>=r))?void 0:i.startTime)&&void 0!==e?e:Ty(),addEventListener("visibilitychange",My,!0),addEventListener("prerenderingchange",My,!0),by(()=>{setTimeout(()=>{xy=Ty()})})}return{get firstHiddenTime(){return xy},onHidden(t){Cy.add(t)}}},Ey=function(t,e,i,r,n,s,o){void 0===e&&(e=-1),void 0===r&&(r=0);var a=ky(),l=(null==a?void 0:a.navigationId)||0,u="navigate";return i?u=i:0>yy()?a&&(document.prerendering||Sy()>0?u="prerender":document.wasDiscarded?u="restore":a.type&&(u=a.type.replace(/_/g,"-"))):u="back-forward-cache",{name:t,value:e,rating:"good",delta:0,entries:[],id:"v6-"+Date.now()+"-"+(Math.floor(8999999999999*Math.random())+1e12),navigationType:u,navigationId:r||l,navigationInteractionId:n,navigationURL:s||(null==a?void 0:a.name),navigationStartTime:o||0}},Ry=new WeakMap;function Ay(t,e){var i=Ry.get(e);return i||Ry.set(e,i=new WeakMap),i.get(t)||i.set(t,new e),i.get(t)}var Py,Fy=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)}}},Oy=function(t,e,i){void 0===i&&(i={});try{var r=t.filter(t=>PerformanceObserver.supportedEntryTypes.includes(t));if(r.length>0){var s=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 o of r)s.observe(n({type:o,buffered:!0},i));return s}}catch(t){}},$y=t=>{var e,i;return(null==(e=globalThis.PerformanceObserver)||null==(e=e.supportedEntryTypes)?void 0:e.includes("soft-navigation"))&&"function"==typeof(null==(i=globalThis.PerformanceSoftNavigation)||null==(i=i.prototype)?void 0:i.getLargestInteractionContentfulPaint)&&t&&t.reportSoftNavs},Dy=(t,e)=>{if(t.set(e.navigationId,e),t.size>2){var i=t.keys().next().value;void 0!==i&&t.delete(i)}},Ly=t=>{var e=!1;return()=>{e||(t(),e=!0)}},Ny=class{constructor(){this.l=void 0}},qy=t=>{document.prerendering?addEventListener("prerenderingchange",t,!0):t()},jy=[1800,3e3],By=function(t,e){void 0===e&&(e={});var i=$y(e);qy(()=>{var r,n=Ay(e,Ny),s=Iy(),o=Ey("FCP"),a=Oy(["paint"],t=>{for(var e of t)"first-contentful-paint"===e.name&&(a.disconnect(),s.firstHiddenTime>e.startTime&&(o.value=Math.max(e.startTime-Sy(),0),o.entries.push(e),o.navigationId=e.navigationId||o.navigationId,r(!0)))});a&&(r=_y(t,o,jy,e.reportAllChanges),by(i=>{o=Ey("FCP",-1,"back-forward-cache",o.navigationId,o.navigationInteractionId,o.navigationURL,yy()),r=_y(t,o,jy,e.reportAllChanges),wy(()=>{o.value=performance.now()-i.timeStamp,r(!0)})})),i&&Oy(["soft-navigation"],i=>{i.forEach(i=>{n.l&&i.navigationId&&Dy(n.l,i),o=Ey("FCP",Math.max((i.presentationTime||i.paintTime||0)-i.startTime,0),"soft-navigation",i.navigationId,i.interactionId,i.name,i.startTime),(r=_y(t,o,jy,e.reportAllChanges))(!0)})},e)})},Hy=[.1,.25],zy=function(t,e){void 0===e&&(e={});var i=Iy();By(Ly(()=>{var r,n=Ey("CLS",0),s=Ay(e,Fy),o=(i,o,a,l,u)=>{n=Ey("CLS",0,i,o,a,l,u),s.i=0,r=_y(t,n,Hy,e.reportAllChanges)},a=function(t){void 0===t&&(t=!1),s.i>n.value&&(n.value=s.i,n.entries=s.o),r(t)},l=t=>{a(!0),o("soft-navigation",t.navigationId,t.interactionId,t.name,t.startTime)},u=t=>{for(var e of t)"soft-navigation"!==e.entryType?s.h(e):l(e);a()},h=["layout-shift"];$y(e)&&h.push("soft-navigation");var d=Oy(h,u);d&&(r=_y(t,n,Hy,e.reportAllChanges),i.onHidden(()=>{u(d.takeRecords()),r(!0)}),by(()=>{o("back-forward-cache",n.navigationId,n.navigationInteractionId,n.navigationURL,yy()),wy(r)}),setTimeout(r))}))},Uy=0,Wy=1/0,Vy=0,Gy=t=>{for(var e of t)e.interactionId&&(Wy=Math.min(Wy,e.interactionId),Vy=Math.max(Vy,e.interactionId),Uy=Vy?(Vy-Wy)/7+1:0)},Zy=()=>{var t;return Py?Uy:null!==(t=performance.interactionCount)&&void 0!==t?t:0},Jy=class{constructor(){this.u=0,this.v=[],this.m=new Map,this.p=void 0,this.T=void 0}_(){return Zy()-this.u}M(){this.u=Zy(),this.v.length=0,this.m.clear()}L(t){var e=this._(),i=Math.min(this.v.length-1,Math.floor(e/50));return!e||-1!==i||"soft-navigation"!==t&&"back-forward-cache"!==t?this.v[i]:{P:8,id:-1,entries:[]}}h(t){var e;if(null!=(e=this.p)&&e.call(this,t),t.interactionId){var i=this.v.at(-1),r=this.m.get(t.interactionId);if(r||10>this.v.length||t.duration>i.P){var n;if(r?t.duration>r.P?(r.entries=[t],r.P=t.duration):t.duration===r.P&&t.startTime===r.entries[0].startTime&&r.entries.push(t):(this.m.set((r={id:t.interactionId,entries:[t],P:t.duration}).id,r),this.v.push(r)),this.v.sort((t,e)=>e.P-t.P),this.v.length>10)for(var s of this.v.splice(10))this.m.delete(s.id);null==(n=this.T)||n.call(this,r)}}}},Qy=t=>{var e="requestIdleCallback"in globalThis?1e3:0,i=globalThis.requestIdleCallback||setTimeout,r=globalThis.cancelIdleCallback||clearTimeout;if("hidden"===document.visibilityState)t();else{var n=Ly(t),s=-1,o=()=>{r(s),n()};addEventListener("visibilitychange",o,{once:!0,capture:!0}),s=i(()=>{removeEventListener("visibilitychange",o,{capture:!0}),n()},{timeout:e})}},Ky=[200,500],Xy=function(t,e){if(void 0===e&&(e={}),globalThis.PerformanceEventTiming&&"interactionId"in PerformanceEventTiming.prototype){var i=Iy();qy(()=>{var r;"interactionCount"in performance||Py||(Py=Oy(["event"],Gy,{durationThreshold:0}));var s,o=Ey("INP"),a=Ay(e,Jy),l=(i,r,n,l,u)=>{a.M(),o=Ey("INP",-1,i,r,n,l,u),s=_y(t,o,Ky,e.reportAllChanges)},u=()=>{var t=a.L(o.navigationType);t&&t.P!==o.value&&(o.value=t.P,o.entries=t.entries,s())},h=t=>{u(),s(!0),l("soft-navigation",t.navigationId,t.interactionId,t.name,t.startTime)},d=function(t,e){void 0===e&&(e=!1),Qy(()=>{for(var i of t)"soft-navigation"!==i.entryType?a.h(i):h(i);u(),e&&s(!0)})},v=["event","first-input"];$y(e)&&v.push("soft-navigation");var c=Oy(v,d,n({},e,{durationThreshold:null!==(r=e.durationThreshold)&&void 0!==r?r:40}));s=_y(t,o,Ky,e.reportAllChanges),c&&(i.onHidden(()=>{d(c.takeRecords(),!0)}),by(()=>{l("back-forward-cache",o.navigationId,o.navigationInteractionId,o.navigationURL,yy())}))})}},Yy=class{constructor(){this.p=void 0,this.l=void 0}h(t){var e;null==(e=this.p)||e.call(this,t)}},tb=[2500,4e3],eb=function(t,e){void 0===e&&(e={});var i=!1,r=$y(e);qy(()=>{var n,s=Iy(),o=Ey("LCP"),a=Ay(e,Yy),l=(r,a,l,u,h)=>{o=Ey("LCP",-1,r,a,l,u,h),n=_y(t,o,tb,e.reportAllChanges),i=!1,"soft-navigation"===r&&(s=Iy(!0))},u=t=>{a.l&&t.navigationId&&Dy(a.l,t),i||n(!0),l("soft-navigation",t.navigationId,t.interactionId,t.name,t.startTime);var e=null==t.getLargestInteractionContentfulPaint?void 0:t.getLargestInteractionContentfulPaint();e&&h([e])},h=t=>{for(var i of(e.reportAllChanges||r||(t=t.slice(-1)),t))if(i)if("soft-navigation"!==i.entryType){var l=0,h=[],d=i.startTime;if("largest-contentful-paint"===i.entryType)l=Math.max(i.startTime-Sy(),0),a.h(i),h=[i];else if("interaction-contentful-paint"===i.entryType){var v,c=i;if(!o.navigationId)continue;if("interactionId"in c&&c.interactionId!=o.navigationInteractionId)continue;d=(null==(v=c.largestContentfulPaint)?void 0:v.renderTime)||0,l=Math.max(d-i.startTime,0),c.largestContentfulPaint&&(a.h(c.largestContentfulPaint),h=[c.largestContentfulPaint])}s.firstHiddenTime>d&&(o.value=l,o.entries=h,n())}else u(i)},d=["largest-contentful-paint"];r&&d.push("interaction-contentful-paint","soft-navigation");var v=Oy(d,h);if(v){n=_y(t,o,tb,e.reportAllChanges);var c=["keydown","click","visibilitychange"],f=t=>{if(t.isTrusted&&!i){var e=o.id;Qy(()=>{if(!i){if(!r)for(var t of(v.disconnect(),c))removeEventListener(t,f,{capture:!0});e===o.id&&(i=!0,n(!0))}})}};for(var p of c)addEventListener(p,f,{capture:!0});by(r=>{l("back-forward-cache",o.navigationId,o.navigationInteractionId,o.navigationURL,yy()),n=_y(t,o,tb,e.reportAllChanges),wy(()=>{o.value=performance.now()-r.timeStamp,i=!0,n(!0)})})}})},ib={onLCP:gy,onCLS:iy,onFCP:ry,onINP:vy,withoutAttribution:{onLCP:eb,onCLS:zy,onFCP:By,onINP:Xy}};b.__PosthogExtensions__=b.__PosthogExtensions__||{},b.__PosthogExtensions__.postHogWebVitalsCallbacksByFlavor=b.__PosthogExtensions__.postHogWebVitalsCallbacksByFlavor||{},b.__PosthogExtensions__.postHogWebVitalsCallbacksByFlavor["web-vitals-with-attribution-soft-navs"]=ib,b.__PosthogExtensions__.postHogWebVitalsCallbacks=ib,b.postHogWebVitalsCallbacks=ib;var rb={onLCP:eb,onCLS:zy,onFCP:By,onINP:Xy};b.__PosthogExtensions__=b.__PosthogExtensions__||{},b.__PosthogExtensions__.postHogWebVitalsCallbacksByFlavor=b.__PosthogExtensions__.postHogWebVitalsCallbacksByFlavor||{},b.__PosthogExtensions__.postHogWebVitalsCallbacksByFlavor["web-vitals-soft-navs"]=rb,b.__PosthogExtensions__.postHogWebVitalsCallbacks=rb,b.postHogWebVitalsCallbacks=rb,b.__PosthogExtensions__.loadWebVitalsCallbacks=()=>rb;var nb={onLCP:gy,onCLS:iy,onFCP:ry,onINP:vy,withoutAttribution:{onLCP:eb,onCLS:zy,onFCP:By,onINP:Xy}};b.__PosthogExtensions__=b.__PosthogExtensions__||{},b.__PosthogExtensions__.postHogWebVitalsCallbacksByFlavor=b.__PosthogExtensions__.postHogWebVitalsCallbacksByFlavor||{},b.__PosthogExtensions__.postHogWebVitalsCallbacksByFlavor["web-vitals-with-attribution"]=nb,b.__PosthogExtensions__.postHogWebVitalsCallbacks=nb,b.postHogWebVitalsCallbacks=nb;var sb={onLCP:eb,onCLS:zy,onFCP:By,onINP:Xy};b.__PosthogExtensions__=b.__PosthogExtensions__||{},b.__PosthogExtensions__.postHogWebVitalsCallbacksByFlavor=b.__PosthogExtensions__.postHogWebVitalsCallbacksByFlavor||{},b.__PosthogExtensions__.postHogWebVitalsCallbacksByFlavor["web-vitals"]=sb,b.__PosthogExtensions__.postHogWebVitalsCallbacks=sb,b.postHogWebVitalsCallbacks=sb,b.__PosthogExtensions__.loadWebVitalsCallbacks=()=>sb;var ob=class{constructor(t){this.disabled=!1===t;var e=Te(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}},ab="$copy_autocapture",lb=Cn("[AutoCapture]");function ub(t,e){return e.length>t?e.slice(0,t)+"...":e}function hb(t){if(t.previousElementSibling)return t.previousElementSibling;var e=t;do{e=e.previousSibling}while(e&&!Jn(e));return e}function db(t,e){var i,r,s=e.e,o=e.maskAllElementAttributes,l=e.maskAllText,u=e.elementAttributeIgnoreList,h=e.elementsChainAsString,d=e.disableCaptureUrlHashes;if(!Jn(t))return{props:{}};for(var v=[t],c=new Set([t]),f=t;f.parentNode&&!Qn(f,"body")&&1e3>v.length;)if(Xn(f.parentNode)){var p=f.parentNode.host;if(c.has(p))break;c.add(p),v.push(p),f=p}else{if(!Jn(f.parentNode))break;if(c.has(f.parentNode))break;c.add(f.parentNode),v.push(f.parentNode),f=f.parentNode}var g="click"===s.type&&"http://www.w3.org/2000/svg"===t.namespaceURI?v.findIndex(t=>Qn(t,"button")||Qn(t,"a")):-1;g>0&&(l=l||v.slice(0,g+1).some(t=>!bs(t)||_s(t)));var m,y,b,_=[],w={},k=!1,S=!1;if(Mn(v,t=>{var e=bs(t);if(Qn(t,"a")){var i=t.getAttribute("href");k=!!(e&&i&&Is(i))&&(d?ar(i):i)}de(es(t),"ph-no-capture")&&(S=!0),_.push(function(t,e,i,r,n){void 0===n&&(n=!1);var s=t.tagName.toLowerCase(),o={tag_name:s};ss.indexOf(s)>-1&&!i&&(o.$el_text="a"===s.toLowerCase()||"button"===s.toLowerCase()?ub(1024,Es(t)):ub(1024,rs(t)));var a=es(t);a.length>0&&(o.classes=a.filter(function(t){return""!==t})),Mn(t.attributes,function(i){var s;if((!_s(t)||-1!==["name","id","class","aria-label"].indexOf(i.name))&&(null==r||!r.includes(i.name))&&!e&&Is(i.value)&&(!Ee(s=i.name)||"_ngcontent"!==s.substring(0,10)&&"_nghost"!==s.substring(0,7))){var a=i.value;"class"===i.name&&(a=Yn(a).join(" ")),o["attr__"+i.name]=ub(1024,"href"===i.name&&n?ar(a):a)}});for(var l=1,u=1,h=t;h=hb(h);)l++,h.tagName===t.tagName&&u++;return o.nth_child=l,o.nth_of_type=u,o}(t,o,l,u,d)),Mn(function(t){if(!bs(t))return{};var e={};return Mn(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&&Is(r)&&(e[i]=r)}}),e}(t),(t,e)=>{({}).hasOwnProperty.call(w,e)||(w[e]=t)})}),S)return{props:{},explicitNoCapture:S};if(g>0&&(t=v[g],_.splice(0,g)),l||(_[0].$el_text=Qn(t,"a")||Qn(t,"button")?Es(t):rs(t)),k){var x,C;_[0].attr__href=k;var T=null==(x=qn(k))?void 0:x.host,M=null==a||null==(C=a.location)?void 0:C.host;T&&M&&T!==M&&(m=k)}return{props:In((y=s.type,{$event_type:y,$ce_version:1}),h?{}:{$elements:_},{$elements_chain:(b=_,xe(b)?function(t){return t.map(t=>{var e,i,r="";if(t.tag_name&&(r+=t.tag_name),t.attr_class)for(var s of(t.attr_class.sort(),t.attr_class))r+="."+s.replace(/"/g,"");var o=n({},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 En(o).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[As(t[0].toString())]=As(e.toString())}),(r+=":")+En(a).map(t=>t[0]+'="'+t[1]+'"').join("")}).join(";")}(function(t){return t.map(t=>{var e,i,r={text:null==(e=t.$el_text)?void 0:e.slice(0,400),tag_name:t.tag_name,href:null==(i=t.attr__href)?void 0:i.slice(0,2048),attr_class:Ps(t),attr_id:t.attr__id,nth_child:t.nth_child,nth_of_type:t.nth_of_type,attributes:{}};return En(t).filter(t=>0===t[0].indexOf("attr__")).forEach(t=>r.attributes[t[0]]=t[1]),r})}(b)):"")},null!=(i=_[0])&&i.$el_text?{$el_text:null==(r=_[0])?void 0:r.$el_text}:{},m&&"click"===s.type?{$external_click_url:m}:{},w),target:t}}var vb=class{Ds(){this.Ls=void 0,clearTimeout(this.Ns),this.Ns=void 0}qs(t){var e;if(!bs(t))return!0;for(var i,r=null!==(e=this.js().css_selector_ignorelist)&&void 0!==e?e:us,n=new Set,s=t,o=function(){if(n.size>=1e3||n.has(s))return{v:!0};n.add(s);var t=s,e=es(t);if(de(e,"ph-no-capture")||de(e,"ph-sensitive")||_s(t)||r.some(e=>os(t,e)))return{v:!0};var i=s.parentNode;s=Xn(i)?i.host:i&&Jn(i)?i:null};s;)if(i=o())return i.v;return!1}Bs(t){if(this.isEnabled&&"pointercancel"!==t.type)if("pointerdown"!==t.type){var e=this.Ls;e&&(t.pointerId!==e.id||Math.abs(t.clientX-e.x)>5||Math.abs(t.clientY-e.y)>5?this.Ds():"pointerup"===t.type&&(e.released=!0,this.Ns=setTimeout(()=>this.Ds(),0)))}else{var i;this.Ds();var r=ns(t);t.isPrimary&&0===t.button&&!t.ctrlKey&&r&&Jn(r)&&(this.Ls={target:r,excluded:this.qs(r),id:t.pointerId,x:t.clientX,y:t.clientY,released:!1,distinctId:null==(i=this.Hs)?void 0:i.distinctId})}else this.Ds()}zs(t){var e,i=this.Ls;this.Ds();var r=ns(t);if(null!=i&&i.released&&i.target.isConnected&&i.distinctId===(null==(e=this.Hs)?void 0:e.distinctId)&&t.pointerId===i.id&&(t.detail>0||"touch"===t.pointerType||"pen"===t.pointerType)&&0===t.button&&5>=Math.abs(t.clientX-i.x)&&5>=Math.abs(t.clientY-i.y)&&r&&(Qn(r,"html")||Qn(r,"body"))){var n;if(i.excluded)return null;var s=null!==(n=this.js().css_selector_ignorelist)&&void 0!==n?n:us;return[r,null==h?void 0:h.documentElement,null==h?void 0:h.body].some(t=>{if(!t)return!1;var e=es(t);return de(e,"ph-no-capture")||de(e,"ph-sensitive")||!bs(t)||_s(t)||s.some(e=>os(t,e))})?null:i.target}}constructor(t){this.Us=t,this.name="autocapture",this.Ws=!1,this.Vs=null,this.Gs=!1,this.Zs=!1,this._n={enabled:!1,rageclick:!1,maskAllElementAttributes:!1,maskAllText:!1,disableCaptureUrlHashes:!1,remoteRequestsDisabled:!1},this.Js=!1,this.Us.refresh(this._n),this.rageclicks=new ob(this._n.rageclick),this.Qs=null}setup(t){this.Ks(),this.Hs=t;var e=t.onRemoteConfig(this.onRemoteConfig.bind(this));this.Js?e.dispose():(this.Xs=e,this.startIfEnabled())}dispose(){var t;this.Js||(this.Js=!0,this.Hs=void 0,null==(t=this.Xs)||t.dispose(),this.Xs=void 0,this.Ys())}js(){return this.Us.refresh(this._n),this._n}Ks(){var t,e;return this.js(),this._n.url_allowlist=null==(t=this._n.url_allowlist)?void 0:t.map(t=>new RegExp(t)),this._n.url_ignorelist=null==(e=this._n.url_ignorelist)?void 0:e.map(t=>new RegExp(t)),this._n}eo(){if(this.isBrowserSupported()){if(a&&h){var t=this.io=t=>{t=t||(null==a?void 0:a.event);try{if("blur"===t.type)return void this.Ds();if(0===t.type.indexOf("pointer"))return void this.Bs(t);var e="click"===t.type?this.zs(t):void 0;if(Ae(e))return;this.ro(t,"$autocapture",e)}catch(t){lb.error("Failed to capture event",t)}};if($n(a,"blur",t),$n(h,"submit",t,{capture:!0}),$n(h,"change",t,{capture:!0}),$n(h,"click",t,{capture:!0}),Mn(["pointerdown","pointermove","pointerup","pointercancel"],e=>{$n(h,e,t,{capture:!0})}),this.js().capture_copied_text){var e=this.no=t=>{t=t||(null==a?void 0:a.event);try{this.ro(t,ab)}catch(t){lb.error("Failed to capture clipboard event",t)}};$n(h,"copy",e,{capture:!0}),$n(h,"cut",e,{capture:!0}),$n(h,"paste",e,{capture:!0})}}}else lb.info("Disabling Automatic Event Collection because this browser is not supported")}Ys(){this.Ds(),this.io&&(null==a||a.removeEventListener("blur",this.io),Mn(["pointerdown","pointermove","pointerup","pointercancel"],t=>{null==h||h.removeEventListener(t,this.io,!0)}),null==h||h.removeEventListener("submit",this.io,!0),null==h||h.removeEventListener("change",this.io,!0),null==h||h.removeEventListener("click",this.io,!0),this.io=void 0),this.no&&(null==h||h.removeEventListener("copy",this.no,!0),null==h||h.removeEventListener("cut",this.no,!0),null==h||h.removeEventListener("paste",this.no,!0),this.no=void 0),this.Ws=!1}startIfEnabled(){this.isEnabled||this.Ds(),!this.Js&&this.Hs&&this.isEnabled&&!this.Ws&&(this.eo(),this.Ws=!0)}onRemoteConfig(t){if(!this.Js)if(this.Gs=!0,t.ok){var e=t.config;e.elementsChainAsString&&(this.Zs=e.elementsChainAsString);var i,r=e.autocapture_opt_out;$e(r)&&(null==(i=this.Hs)||i.kv.set(E,r),this.Vs=r),this.startIfEnabled()}else this.startIfEnabled()}setElementSelectors(t){this.Qs=t}getElementSelectors(t,e){var i,r=[];return null==(i=this.Qs)||i.forEach(i=>{var n;null==h||null==(n=h.querySelectorAll(i))||n.forEach(n=>{t!==n&&e!==n||de(r,i)||r.push(i)})}),r}get isEnabled(){var t,e;if(this.Js)return!1;var i=null==(t=this.Hs)?void 0:t.kv.get(E),r=this.Vs,n=this.js(),s=n.remoteRequestsDisabled&&!this.Gs;if(Ae(r)&&!$e(i)&&!s)return!1;var o=null!==(e=this.Vs)&&void 0!==e?e:!!i;return!!n.enabled&&!o}ro(t,e,i){if(void 0===e&&(e="$autocapture"),this.isEnabled){var r=i||ns(t);Kn(r)&&(r=r.parentNode||null);var s,o=this.Ks();"$autocapture"===e&&"click"===t.type&&t instanceof MouseEvent&&o.rageclick&&null!=(s=this.rageclicks)&&s.isRageClick(t.clientX,t.clientY,t.timeStamp||(new Date).getTime())&&gs(r,o.rageclick)&&this.ro(t,"$rageclick",i);var l=e===ab,u=l?n({},o,{dom_event_allowlist:void 0}):o;if(r&&function(t,e,i,r,n,s){var o;if(!a||ms(t))return!1;if(null!=i&&i.url_allowlist&&!ts(i.url_allowlist,s))return!1;if(null!=i&&i.url_ignorelist&&ts(i.url_ignorelist,s))return!1;if(null!=i&&i.dom_event_allowlist){var l=i.dom_event_allowlist;if(l&&!l.some(t=>e.type===t))return!1}var u=ys(t,r),h=u.parentIsUsefulElement,d=u.targetElementList;if(!function(t,e){var i=null==e?void 0:e.element_allowlist;if(Ie(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,i))return!1;if(!as(d,null==i?void 0:i.css_selector_allowlist))return!1;if(as(d,null!==(o=null==i?void 0:i.css_selector_ignorelist)&&void 0!==o?o:us))return!1;try{var v=a.getComputedStyle(t);if(v&&"pointer"===v.getPropertyValue("cursor")&&"click"===e.type)return!0}catch(t){}var c=t.tagName.toLowerCase();switch(c){case"html":return!1;case"form":return(n||["submit"]).indexOf(e.type)>=0;case"input":case"select":case"textarea":return(n||["change","click"]).indexOf(e.type)>=0;default:return h?(n||["click"]).indexOf(e.type)>=0:(n||["click"]).indexOf(e.type)>=0&&(ss.indexOf(c)>-1||"true"===t.getAttribute("contenteditable"))}}(r,t,u,l,l?["copy","cut","paste"]:void 0,{config:{get_current_url:o.getCurrentUrl}})){var h,d=db(r,{e:t,maskAllElementAttributes:o.maskAllElementAttributes,maskAllText:o.maskAllText,elementAttributeIgnoreList:o.element_attribute_ignorelist,elementsChainAsString:this.Zs,disableCaptureUrlHashes:o.disableCaptureUrlHashes}),v=d.props;if(d.explicitNoCapture)return!1;var c=this.getElementSelectors(r,d.target);if(c&&c.length>0&&(v.$element_selectors=c),e===ab){var f=t.type||"clipboard";if("paste"!==f){var p,g,m=null==a||null==(p=a.getSelection())?void 0:p.toString(),y=is(m);if(!y)return!1;v.$selected_content=y,v.$clipboard_text_length=null!==(g=null==m?void 0:m.length)&&void 0!==g?g:0}v.$copy_type=f}return null==(h=this.Hs)||h.capture(e,v).catch(t=>lb.error("Failed to capture event",t)),!0}}else this.Ds()}isBrowserSupported(){return Ce(null==h?void 0:h.querySelectorAll)}},cb={};function fb(t,e){var i=ns(t);return i?n({node:i,originalEvent:t,timestamp:Date.now()},e):null}function pb(t,e){return Math.abs(t)<Math.abs(e)?0>e?"up":"down":0>t?"left":"right"}function gb(t){return"swipe"===t.type?"$dead_swipe":"$dead_click"}var mb="canvas,video,audio,embed,object";function yb(t,e){return Fe(t)&&t>=e}function bb(t){return t>=0&&1e3>t?t:void 0}function _b(t,e){return e?bb(t-e):void 0}var wb=class{Yi(t){var e,i,r,n,s,o,a,l,u=this.tn((null==t?void 0:t.__onCapture)||this.en.bind(this));return{element_attribute_ignorelist:null!==(e=null==t?void 0:t.element_attribute_ignorelist)&&void 0!==e?e:u.element_attribute_ignorelist,scroll_threshold_ms:null!==(i=null==t?void 0:t.scroll_threshold_ms)&&void 0!==i?i:u.scroll_threshold_ms,selection_change_threshold_ms:null!==(r=null==t?void 0:t.selection_change_threshold_ms)&&void 0!==r?r:u.selection_change_threshold_ms,mutation_threshold_ms:null!==(n=null==t?void 0:t.mutation_threshold_ms)&&void 0!==n?n:u.mutation_threshold_ms,capture_clicks_with_modifier_keys:null!==(s=null==t?void 0:t.capture_clicks_with_modifier_keys)&&void 0!==s?s:u.capture_clicks_with_modifier_keys,capture_dead_swipes:null!==(o=null==t?void 0:t.capture_dead_swipes)&&void 0!==o?o:u.capture_dead_swipes,swipe_threshold_px:null!==(a=null==t?void 0:t.swipe_threshold_px)&&void 0!==a?a:u.swipe_threshold_px,max_dead_swipes_per_page_load:null!==(l=null==t?void 0:t.max_dead_swipes_per_page_load)&&void 0!==l?l:u.max_dead_swipes_per_page_load,css_selector_ignorelist:null==t?void 0:t.css_selector_ignorelist,__onCapture:u.__onCapture}}constructor(t,e){this.instance=t,this.rn=[],this.nn=0,this.tn=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.an=t=>{var e=fb(t,{type:"click"});Ae(e)||this.sn(e)||this.un(e),this.ln()},this.hn=()=>{var t=Date.now();this.cn=t,t%50==0&&this.rn.forEach(e=>{Ie(e.scrollDelayMs)&&(e.scrollDelayMs=t-e.timestamp)})},this.dn=()=>{this.vn=Date.now()},this.Ze=()=>{var t=Date.now();this.fn=t,this.pn("visibilityChangedDelayMs",t)},this.gn=()=>{var t=Date.now();this.mn=t,this.pn("focusChangedDelayMs",t)},this.yn=t=>{var e=t.touches,i=1===(null==e?void 0:e.length)?e[0]:void 0;this.bn=i?{x:i.clientX,y:i.clientY,timestamp:Date.now()}:void 0},this.wn=()=>{this.bn=void 0},this.kn=t=>{var e,i=this.bn;if(this.bn=void 0,!Ie(i)&&this._n.max_dead_swipes_per_page_load>this.nn){var r=t,n=null==(e=r.changedTouches)?void 0:e[0];if(n){var s=n.clientX-i.x,o=n.clientY-i.y,a=s*s+o*o,l=this._n.swipe_threshold_px;if(a>=l*l&&![this.cn,this.Sn,this.vn].some(t=>Fe(t)&&t>=i.timestamp)){var u;if(this.xn()&&(null!==(u=null==h||null==h.elementsFromPoint?void 0:h.elementsFromPoint(i.x,i.y))&&void 0!==u?u:[]).some(t=>null==t.matches?void 0:t.matches(mb)))return;var d=fb(r,{type:"swipe",swipeDirection:pb(s,o),swipeDistancePx:Math.round(Math.sqrt(a))});Ae(d)||this.sn(d)||this.un(d),this.ln()}}}},this._n=this.Yi(e),this._onCapture=this._n.__onCapture}start(t){this.Cn(),this.Mn(),this.Tn(),this.In(),this.Rn(),this.An(t),this._n.capture_dead_swipes&&this.En()}An(t){if(!this.Ln){var e=function(t){return function(t,e){var i=cb[t];if(i)return i;var r=e[t];if((t=>Ce(t)&&-1!==t.toString().indexOf("[native code]"))(r)&&(null==a||!a.Zone))return cb[t]=r.bind(e);var n=e.document;if(n&&Ce(n.createElement)){var s,o=!1;try{(s=n.createElement("iframe")).hidden=!0,n.head.appendChild(s);var l,u,h=s.contentWindow;h&&h[t]&&(r=h[t],"MutationObserver"===t&&function(t){return de(t,"AppleWebKit")&&!de(t,"Chrome")}(null!==(l=null==(u=e.navigator)?void 0:u.userAgent)&&void 0!==l?l:"")&&(s.classList.add("rr-block","ph-no-capture"),o=!0))}catch(e){xn.warn("Could not create sandbox iframe for "+t+" check, bailing to assignableWindow."+t+": ",e)}finally{var d;!o&&null!=(d=s)&&d.parentNode&&s.parentNode.removeChild(s)}}return r&&Ce(r)?cb[t]=r.bind(e):r}("MutationObserver",t)}(b);this.Ln=new e(t=>{this.On(t)}),this.Ln.observe(t,{attributes:!0,characterData:!0,childList:!0,subtree:!0})}}stop(){var t;null==(t=this.Ln)||t.disconnect(),this.Ln=void 0,b.removeEventListener("click",this.an),b.removeEventListener("scroll",this.hn,{capture:!0}),b.removeEventListener("selectionchange",this.dn),b.removeEventListener("touchstart",this.yn,{capture:!0}),b.removeEventListener("touchend",this.kn,{capture:!0}),b.removeEventListener("touchcancel",this.wn,{capture:!0}),null==h||h.removeEventListener("visibilitychange",this.Ze),b.removeEventListener("blur",this.gn),b.removeEventListener("focus",this.gn),this.bn=void 0}On(t){this.Sn=Date.now()}Cn(){$n(b,"click",this.an)}un(t){t.visibilityChangedDelayMs=_b(t.timestamp,this.fn),t.focusChangedDelayMs=_b(t.timestamp,this.mn),this.rn.push(t)}ln(){this.rn.length&&Ie(this.Dn)&&(this.Dn=b.setTimeout(()=>{this.Pn()},1e3))}Mn(){$n(b,"scroll",this.hn,{capture:!0})}Tn(){$n(b,"selectionchange",this.dn)}In(){$n(h,"visibilitychange",this.Ze)}Rn(){$n(b,"blur",this.gn),$n(b,"focus",this.gn)}pn(t,e){this.rn.forEach(i=>{var r=bb(e-i.timestamp);Fe(r)&&(Ie(i[t])||i[t]>r)&&(i[t]=r)})}En(){$n(b,"touchstart",this.yn,{capture:!0,passive:!0}),$n(b,"touchend",this.kn,{capture:!0,passive:!0}),$n(b,"touchcancel",this.wn,{capture:!0,passive:!0})}xn(){var t=Ie(this.Fn)||Fe(this.Sn)&&this.Sn>this.Fn;return(Ie(this.Nn)||t)&&(this.Fn=Date.now(),this.Nn=!(null==h||!h.querySelector(mb))),!!this.Nn}sn(t){return!t||("swipe"===t.type?this.qn(t):this.jn(t))}qn(t){return!(!Zn(t.node)&&!this.rn.some(e=>e.type===t.type&&e.node===t.node&&1e3>Math.abs(e.timestamp-t.timestamp))&&!Qn(t.node,"html")&&Jn(t.node)&&function(t,e){var i;if(!a||ms(t))return!1;var r=$e(e)?cs:null!==(i=null==e?void 0:e.css_selector_ignorelist)&&void 0!==i?i:cs;return!as(ys(t,!1).targetElementList,r)}(t.node,{css_selector_ignorelist:this._n.css_selector_ignorelist}))}jn(t){return!(this._n.capture_clicks_with_modifier_keys||(e=t.originalEvent,!(e.ctrlKey||e.metaKey||e.altKey||e.shiftKey)))||!!this.qn(t)||(i=t.node,!(!a||ms(i))&&ys(i,!1).targetElementList.some(t=>Qn(t,"a")));var e,i}Pn(){if(this.rn.length){clearTimeout(this.Dn),this.Dn=void 0;var t=this.rn;for(var e of(this.rn=[],t)){var i;e.mutationDelayMs=null!==(i=e.mutationDelayMs)&&void 0!==i?i:this.Sn&&this.Sn>=e.timestamp?this.Sn-e.timestamp:void 0,e.absoluteDelayMs=Date.now()-e.timestamp,e.selectionChangedDelayMs=this.vn&&this.vn>=e.timestamp?this.vn-e.timestamp:void 0;var r=yb(e.scrollDelayMs,this._n.scroll_threshold_ms),n=yb(e.selectionChangedDelayMs,this._n.selection_change_threshold_ms),s=yb(e.mutationDelayMs,this._n.mutation_threshold_ms),o=yb(e.absoluteDelayMs,1.1*this._n.mutation_threshold_ms),a=Fe(e.scrollDelayMs)&&this._n.scroll_threshold_ms>e.scrollDelayMs,l=Fe(e.mutationDelayMs)&&this._n.mutation_threshold_ms>e.mutationDelayMs,u=Fe(e.selectionChangedDelayMs)&&this._n.selection_change_threshold_ms>e.selectionChangedDelayMs,h=Fe(e.visibilityChangedDelayMs),d=Fe(e.focusChangedDelayMs);if(!(a||l||u||h||d))if(r||s||o||n){var v=gb(e);if("$dead_swipe"===v){if(this.nn>=this._n.max_dead_swipes_per_page_load)continue;this.nn++}this._onCapture(e,{[v+"_last_mutation_timestamp"]:this.Sn,[v+"_event_timestamp"]:e.timestamp,[v+"_scroll_timeout"]:r,[v+"_mutation_timeout"]:s,[v+"_absolute_timeout"]:o,[v+"_selection_changed_timeout"]:n,[v+"_visibility_changed_timeout"]:!1})}else this._n.mutation_threshold_ms>e.absoluteDelayMs&&this.rn.push(e)}this.ln()}}en(t,e){var i=gb(t);this.instance.capture(i,n({},e,db(t.node,{e:t.originalEvent,maskAllElementAttributes:this.instance.config.mask_all_element_attributes,maskAllText:this.instance.config.mask_all_text,elementAttributeIgnoreList:this._n.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)})}};b.__PosthogExtensions__=b.__PosthogExtensions__||{},b.__PosthogExtensions__.initDeadClicksAutocapture=(t,e)=>new wb(t,e);var kb=Cn("[ExternalScriptsLoader]"),Sb=t=>{var e=null==h?void 0:h.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]},xb=(t,e,i)=>{if(t.config.disable_external_dependency_loading)return kb.warn(e+" was requested but loading of external scripts is disabled."),i("Loading of external scripts is disabled");var r=Sb(e);if(r){if(r.__posthog_loading_callback_fired)return i();var n=r.__posthog_loading_error;return n?i(n):(r.addEventListener("load",t=>{r.__posthog_loading_callback_fired=!0,i(void 0,t)}),void r.addEventListener("error",t=>{r.__posthog_loading_error=t,i(t)}))}var s=()=>{if(!h)return i("document not found");if(Sb(e))return xb(t,e,i);var r=h.createElement("script");if(r.type="text/javascript",r.crossOrigin="anonymous",r.src=e,r.onload=t=>{r.__posthog_loading_callback_fired=!0,i(void 0,t)},r.onerror=t=>{r.__posthog_loading_error=t,i(t)},t.config.prepare_external_dependency_script&&(r=t.config.prepare_external_dependency_script(r)),!r)return i("prepare_external_dependency_script returned null");if("head"===t.config.external_scripts_inject_target)h.head.appendChild(r);else{var n,s=h.querySelectorAll("body > script");s.length>0?null==(n=s[0].parentNode)||n.insertBefore(r,s[0]):h.body.appendChild(r)}};null!=h&&h.body?s():null==h||h.addEventListener("DOMContentLoaded",s)},Cb={},Tb=(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)};b.__PosthogExtensions__=b.__PosthogExtensions__||{},b.__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=Cb[n];if("fallback"===r&&s){if(Sb(s))return void xb(t,s,i);delete Cb[n]}xb(t,n,"fallback"===r?(r,s)=>{if(r)if("string"==typeof r)i(r);else{var o,a=Tb(t,e);Cb[n]=a;var l=Sb(n);null==l||null==(o=l.parentNode)||o.removeChild(l),xb(t,a,i)}else i(void 0,s)}:i)}else xb(t,Tb(t,e),i)}else xb(t,t.requestRouter.endpointFor("assets","/array/"+t.config.token+"/config.js"),i)},b.__PosthogExtensions__.loadSiteApp=(t,e,i)=>{xb(t,t.requestRouter.endpointFor("api",e),i)};var Mb=class{constructor(t){this._instance=t}get _n(){return this._instance.config}get consent(){return this.so()?0:this.oo}isOptedOut(){return"always"===this._n.cookieless_mode||this.isRejected()||-1===this.consent&&"on_reject"===this._n.cookieless_mode}isOptedIn(){return!this.isOptedOut()}isExplicitlyOptedOut(){return 0===this.consent}isRejected(){return 0===this.consent||-1===this.consent&&this._n.opt_out_capturing_by_default}optInOut(t){this.ao.ui(this.lo,t?1:0,this._n.cookie_expiration,this._n.cross_subdomain_cookie,this._n.secure_cookie)}reset(){this.ao.hi(this.lo,this._n.cross_subdomain_cookie)}get lo(){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 oo(){var t=this.ao.li(this.lo);return We(t)?1:de(Ve,t)?0:-1}get ao(){var t=this._n.opt_out_capturing_persistence_type,e="localStorage"===t?np:ip,i=e.si()?e:gp;if(!this.uo||this.uo!==i){this.uo=i;var r="localStorage"===t?ip:np;r.li(this.lo)&&(this.uo.li(this.lo)||this.optInOut(We(r.li(this.lo))),r.hi(this.lo,this._n.cross_subdomain_cookie))}return this.uo}so(){return!!this._n.respect_dnt&&[null==u?void 0:u.doNotTrack,null==u?void 0:u.msDoNotTrack,b.doNotTrack,null==u?void 0:u.globalPrivacyControl].some(t=>We(t))}},Ib=Cn("[Dead Clicks]"),Eb=()=>!0,Rb=t=>{var e,i=!(null==(e=t.instance.persistence)||!e.get_property(D)),r=t.instance.config.capture_dead_clicks;return $e(r)?r:!!Te(r)||i},Ab=class{get lazyLoadedDeadClicksAutocapture(){return this.ho}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({[D]:e.captureDeadClicks}),this.startIfEnabledOrStop())}}startIfEnabledOrStop(){this.isEnabled(this)?this.do(()=>{this.vo()}):this.stop()}do(t){var e,i;null!=(e=b.__PosthogExtensions__)&&e.initDeadClicksAutocapture?t():null==(i=b.__PosthogExtensions__)||null==i.loadExternalDependency||i.loadExternalDependency(this.instance,"dead-clicks-autocapture",e=>{e?Ib.error("failed to load script",e):t()})}vo(){var t;if(h){if(!this.ho&&null!=(t=b.__PosthogExtensions__)&&t.initDeadClicksAutocapture){var e=Te(this.instance.config.capture_dead_clicks)?n({},this.instance.config.capture_dead_clicks):{};e.__onCapture=this.onCapture,this.onCapture&&(e.capture_dead_swipes=!1),this.ho=b.__PosthogExtensions__.initDeadClicksAutocapture(this.instance,e),this.ho.start(h),Ib.info("starting...")}}else Ib.error("`document` not found. Cannot start.")}stop(){this.ho&&(this.ho.stop(),this.ho=void 0,Ib.info("stopping..."))}},Pb=Cn("[SegmentIntegration]");function Fb(t,e,i){void 0===i&&(i=!0);var r=t.config.segment;if(!r)return e();!function(t,e,i){var r=t.config.segment;if(!r)return e();var n=r=>{var n=()=>r.anonymousId()||Kf();t.config.get_device_id=n,i&&r.id()&&(t.register({distinct_id:r.id(),$device_id:n()}),t.persistence.set_property(At,ee)),e(i?void 0:r.anonymousId()||void 0)},s=r.user();"then"in s&&Ce(s.then)?s.then(n):n(s)}(t,i=>{r.register(((t,e)=>{"undefined"!=typeof Promise&&Promise.resolve||Pb.warn("This browser does not have Promise support, and can not use the segment integration");var i=(i,r)=>{if(!r)return i;var n=!!e&&i.event.anonymousId===e&&!i.event.userId;n||i.event.userId||i.event.anonymousId===t.get_distinct_id()||(Pb.info("No userId set, resetting PostHog"),t.reset()),n||(e=void 0),i.event.userId&&i.event.userId!==t.get_distinct_id()&&(Pb.info("UserId set, identifying with PostHog"),t.identify(i.event.userId));var s=t.calculateEventProperties(r,i.event.properties);return i.event.properties=Object.assign({},s,i.event.properties),i};return{name:"PostHog JS",type:"enrichment",version:"1.0.0",isLoaded(){return!0},load(){return Promise.resolve()},track(t){return i(t,t.event.event)},page(t){return i(t,se)},identify(t){return i(t,ae)},screen(t){return i(t,"$screen")}}})(t,i)).then(()=>{e()},t=>{Pb.error("Failed to register the Segment integration",t),e()})},i)}var Ob="posthog-js";function $b(t,e){var i=void 0===e?{}:e,r=i.organization,s=i.projectId,o=i.prefix,a=i.severityAllowList,l=void 0===a?["error"]:a,u=i.sendExceptionsToPostHog,h=void 0===u||u;return e=>{var i,a,u,d,v,c;if("*"!==l&&!l.includes(e.level)||!t.__loaded)return e;e.tags||(e.tags={});var f=t.requestRouter.endpointFor("ui","/project/"+t.config.token+"/person/"+t.get_distinct_id());e.tags["PostHog Person URL"]=f,t.sessionRecordingStarted()&&(e.tags["PostHog Recording URL"]=t.get_session_replay_url({withTimestamp:!0}));var p=(null==(i=e.exception)?void 0:i.values)||[],g=p.map(t=>n({},t,{stacktrace:t.stacktrace?n({},t.stacktrace,{type:"raw",frames:(t.stacktrace.frames||[]).map(t=>n({},t,{platform:"web:javascript"}))}):void 0})),m={$exception_message:(null==(a=p[0])?void 0:a.value)||e.message,$exception_type:null==(u=p[0])?void 0:u.type,$exception_level:e.level,$exception_list:g,$sentry_event_id:e.event_id,$sentry_exception:e.exception,$sentry_exception_message:(null==(d=p[0])?void 0:d.value)||e.message,$sentry_exception_type:null==(v=p[0])?void 0:v.type,$sentry_tags:e.tags};return r&&s&&(m.$sentry_url=(o||"https://sentry.io/organizations/")+r+"/issues/?project="+s+"&query="+e.event_id),h&&(null==(c=t.exceptions)||c.sendExceptionEvent(m)),e}}var Db=class{constructor(t,e,i,r,n,s){this.name=Ob,this.setupOnce=function(o){o($b(t,{organization:e,projectId:i,prefix:r,severityAllowList:n,sendExceptionsToPostHog:null==s||s}))}}},Lb=class{constructor(t){this.co=(t,e,i)=>{i&&(i.noSessionId||i.activityTimeout||i.sessionPastMaximumLength||i.crossTabAdoption)&&(xn.info("[PageViewManager] Session rotated, clearing pageview state",{sessionId:t,changeReason:i}),this.fo=void 0,this._instance.scrollManager.resetContext())},this._instance=t,this.po()}po(){var t;this.mo=null==(t=this._instance.sessionManager)?void 0:t.onSessionId(this.co)}destroy(){var t;null==(t=this.mo)||t.call(this),this.mo=void 0}doPageView(t,e){var i,r=this.yo(t,e);return this.fo={pathname:null!==(i=null==a?void 0:a.location.pathname)&&void 0!==i?i:"",pageViewId:e,timestamp:t},this._instance.scrollManager.resetContext(),r}doPageLeave(t){var e;return this.yo(t,null==(e=this.fo)?void 0:e.pageViewId)}doEvent(){var t;return{$pageview_id:null==(t=this.fo)?void 0:t.pageViewId}}yo(t,e){var i=this.fo;if(!i)return{$pageview_id:e};var r={$pageview_id:e,$prev_pageview_id:i.pageViewId},n=this._instance.scrollManager.getContext();if(n&&!this._instance.config.disable_scroll_properties){var s=n.maxScrollHeight,o=n.lastScrollY,a=n.maxScrollY,l=n.maxContentHeight,u=n.lastContentY,h=n.maxContentY;if(!(Ie(s)||Ie(o)||Ie(a)||Ie(l)||Ie(u)||Ie(h))){s=Math.ceil(s),o=Math.ceil(o),a=Math.ceil(a),l=Math.ceil(l),u=Math.ceil(u),h=Math.ceil(h);var d=s>1?Ge(o/s,0,1,xn):1,v=s>1?Ge(a/s,0,1,xn):1,c=l>1?Ge(u/l,0,1,xn):1,f=l>1?Ge(h/l,0,1,xn):1;r=In(r,{$prev_pageview_last_scroll:o,$prev_pageview_last_scroll_percentage:d,$prev_pageview_max_scroll:a,$prev_pageview_max_scroll_percentage:v,$prev_pageview_last_content:u,$prev_pageview_last_content_percentage:c,$prev_pageview_max_content:h,$prev_pageview_max_content_percentage:f})}}return i.pathname&&(r.$prev_pageview_pathname=i.pathname),i.timestamp&&(r.$prev_pageview_duration=(t.getTime()-i.timestamp.getTime())/1e3),r}},Nb=["flags","surveys"],qb={[_]:{exposure:"hidden"},[x]:{exposure:"hidden"},[C]:{exposure:"hidden"},[I]:{exposure:"hidden"},[M]:{exposure:"hidden"},[E]:{exposure:"event"},[R]:{exposure:"hidden"},[N]:{exposure:"hidden"},[A]:{exposure:"event"},[P]:{exposure:"hidden"},[F]:{exposure:"event"},[O]:{exposure:"event"},[D]:{exposure:"event"},[L]:{exposure:"hidden"},[q]:{exposure:"event"},[j]:{exposure:"hidden"},[B]:{exposure:"hidden"},[G]:{exposure:"hidden"},[Z]:{exposure:"event"},[H]:{exposure:"event",shouldSkipFromEventProperties:t=>Ae(t)},[J]:{exposure:"event"},[Q]:{exposure:"event"},[K]:{exposure:"event"},[et]:{exposure:"event"},[it]:{exposure:"hidden"},[rt]:{exposure:"hidden",storageGroup:"flags"},[nt]:{exposure:"hidden",storageGroup:"flags"},[st]:{exposure:"hidden"},[ot]:{exposure:"hidden",storageGroup:"flags"},[at]:{exposure:"hidden",storageGroup:"flags"},[lt]:{exposure:"hidden",storageGroup:"flags",volatile:!0},[ut]:{exposure:"hidden",storageGroup:"flags"},[ht]:{exposure:"hidden"},[dt]:{exposure:"hidden"},[vt]:{exposure:"hidden"},[ct]:{exposure:"hidden"},[pt]:{exposure:"hidden",storageGroup:"surveys"},[gt]:{exposure:"hidden",storageGroup:"surveys",volatile:!0},[mt]:{exposure:"event"},[yt]:{exposure:"hidden"},[bt]:{exposure:"hidden"},[_t]:{exposure:"hidden"},[wt]:{exposure:"hidden"},[kt]:{exposure:"hidden"},[St]:{exposure:"event"},[xt]:{exposure:"event"},[Ct]:{exposure:"event"},[Tt]:{exposure:"event"},[Mt]:{exposure:"hidden"},[It]:{exposure:"hidden"},[ft]:{exposure:"event"},[Et]:{exposure:"hidden"},[Rt]:{exposure:"hidden",storageGroup:"flags",volatile:!0},[At]:{exposure:"hidden"},[Pt]:{exposure:"hidden"},[Ft]:{exposure:"hidden"},[Ot]:{exposure:"hidden"},[$t]:{exposure:"hidden"},[Dt]:{exposure:"hidden"},[Lt]:{exposure:"hidden"},[z]:{exposure:"event"},[U]:{exposure:"event"},[W]:{exposure:"event"},[V]:{exposure:"event"},[jt]:{exposure:"event"},[Bt]:{exposure:"event"},[Ht]:{exposure:"event"},[zt]:{exposure:"event"},[Ut]:{exposure:"event"},[Wt]:{exposure:"event"},[Vt]:{exposure:"event"},[Gt]:{exposure:"event"},[Zt]:{exposure:"event"},[Jt]:{exposure:"event"},[Xt]:{exposure:"event"}},jb=[[X,{exposure:"hidden"}],[Y,{exposure:"hidden"}],[tt,{exposure:"hidden"}]],Bb=t=>{var e=qb[t];if(e)return e;for(var i of jb){var r=i[1];if(0===t.indexOf(i[0]))return r}},Hb={flags:Rt,surveys:gt},zb=["cookie","localstorage","localstorage+cookie","sessionstorage","memory"],Ub=t=>t+"_cookie_identity_change_pending",Wb=t=>{var e="",i=0;for(var r of t){var n=encodeURIComponent(JSON.stringify(r).slice(1,-1)).length;if(i+n>1e3)break;e+=r,i+=n}return e},Vb="main",Gb=[rt,nt,ot,at,lt,Rt,ut,vt],Zb=t=>-1!==Gb.indexOf(t),Jb=(t,e)=>{try{return JSON.stringify(t)===JSON.stringify(e)}catch(i){return t===e}},Qb=t=>{if(!t)return{};var e=JSON.parse(t);return Te(e)?e:{}},Kb=(t,e)=>{Mn(t,(i,r)=>{var n=Bb(r);n&&"event"!==n.exposure||{}.hasOwnProperty.call(e,r)||delete t[r]})},Xb=class{constructor(t,e,i){if(void 0===i&&(i=!0),this.bo={},this._o=!1,this.wo=!1,this.ko=!1,this.So=!1,this.xo=!1,this.Co=new Map,this.To=!1,this.Mo=!1,this.Io=!1,this.Eo=!1,this.Ro=new Set,this._n=t,this.Ao=i,this.props={},this.Po=void 0,this.Fo=(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"})(t),this.ao=this.Oo(t),this.ko=this.$o(t),this.load(),this.Do(),t.debug&&xn.info("Persistence loaded",t.persistence,n({},this.props)),this.update_config(t,t,e),this.save(),a){var r=()=>this.flush();$n(a,"beforeunload",r,{capture:!1}),$n(a,"pagehide",r,{capture:!1}),this.Lo=t=>{if(this._o&&(!t.storageArea||t.storageArea===(null==a?void 0:a.localStorage))&&t.key)if(t.key!==this.Fo){if(this.ko){var e=Nb.find(e=>t.key===this.No(e));e&&this.qo(t.key,e)}}else this.qo(t.key,Vb)},$n(a,"storage",this.Lo)}}markCrossTabFeatureFlagChanges(t){Object.entries(t).forEach(t=>{var e=t[0],i=t[1],r=this.Co.get(e);if(Zb(e)&&!0!==r)if(!0!==i){var n=new Set(r||[]);i.forEach(t=>n.add(t)),n.size&&this.jo(e,n)}else this.jo(e,!0)})}onCrossTabFeatureFlagChange(t){return this.Ro.add(t),()=>this.Ro.delete(t)}destroy(){this.Lo&&a&&(a.removeEventListener("storage",this.Lo),this.Lo=void 0),this.Ro.clear()}qo(t,e,i){if(void 0===i&&(i=!0),this.Bo)return!1;var r,n;try{if(n=np.li(t),Ae(n)){var s=this.Ho(e);return s.storageValue=null,e!==Vb&&(s.persisted=!1),!1}r=Qb(n)}catch(t){return!1}var o=e===Vb?r:np.di(this.Fo);if(o&&this.zo(o))return!1;var a=this.Uo(r,e,i);return e===Vb&&this.ko&&!Jb(this.Wo().main,r)||this.Vo(r,e,!0,n),a}zo(t){var e=this.props[w],i=t[w];return!Ie(e)&&!Ie(i)&&e!==i}Vo(t,e,i,r){var n=this.Ho(e);n.storageValue=r,e!==Vb&&(n.persisted=i);try{n.fingerprint=this.Go(t,e)}catch(t){n.fingerprint=void 0}}Uo(t,e,i){var r=!1;return Gb.forEach(i=>{var n,s=null==(n=Bb(i))?void 0:n.storageGroup;if(!(e===Vb&&this.ko&&s||e!==Vb&&s!==e)){var o=i in t,a=this.Zo(i,o?t[i]:void 0),l=this.Co.has(i)?i in this.props:o;l===i in this.props&&Jb(a,this.props[i])||(l?this.Jo(i,a,!1):this.Qo(i,!1),r=!0)}}),r&&i&&this.Ro.forEach(t=>t()),r}Ko(){if(!this._o)return!1;try{this.Io=!1;var t,e=np.li(this.Fo),i=this.Ho(Vb),r=!1,n=!1;if(e!==i.storageValue)if(Ae(e))i.storageValue=null;else{if(t=Qb(e),this.Io=!this.Mo&&this.zo(t),this.Io)return!1;n=this.Uo(t,Vb,!1),!this.ko||Jb(this.Wo().main,t)?this.Vo(t,Vb,!0,e):i.storageValue=e,r=!0}return this.ko&&Nb.forEach(e=>{var i=np.li(this.No(e)),s=this.Ho(e),o=t||{},a=r&&Gb.some(t=>{var i;return(null==(i=Bb(t))?void 0:i.storageGroup)===e&&t in o});if(i!==s.storageValue||a){if(Ae(i))return s.storageValue=null,s.persisted=!1,void(a&&(n=this.Uo(o,e,!1)||n));var l=Qb(i);n=this.Uo(l,e,!1)||n,this.Vo(l,e,!0,i)}}),n}catch(t){return!1}}jo(t,e){this.Co.set(t,e);var i=Bb(t);null!=i&&i.volatile||(this.Ho((this.ko?null==i?void 0:i.storageGroup:void 0)||Vb).fingerprint=void 0,this.Xo(t))}Yo(){Gb.forEach(t=>this.Co.set(t,!0))}Do(){if(this._o)try{var t=np.li(this.Fo),e=Qb(t);this.Ho(Vb).storageValue=t,Gb.forEach(t=>{var i,r=this.ko?null==(i=Bb(t))?void 0:i.storageGroup:void 0,n=r?np.li(this.No(r)):null;if(r){var s=this.Ho(r);s.storageValue=n,s.persisted=!Ae(n)}var o=r&&!Ae(n)?Qb(n):e;t in this.props?this.ta(t,o[t],this.props[t]):t in o&&this.jo(t,!0)})}catch(t){}}Zo(t,e){var i=this.Co.get(t);if(!i)return e;if(!0===i)return this.props[t];if("$active_feature_flags"===t){var r=new Set(xe(e)?e:[]),s=new Set(xe(this.props[t])?this.props[t]:[]);return i.forEach(t=>s.has(t)?r.add(t):r.delete(t)),Array.from(r)}var o=Te(e)?n({},e):{},a=Te(this.props[t])?this.props[t]:{};return i.forEach(t=>{t in a?o[t]=a[t]:delete o[t]}),o}ta(t,e,i){if(Zb(t)){var r=this.Co.get(t);if(!0!==r){var n=e;if(this._o)try{var s,o=this.ko?null==(s=Bb(t))?void 0:s.storageGroup:void 0,a=o?this.No(o):this.Fo;n=Qb(np.li(a))[t]}catch(t){}var l=new Set(r||[]);if("$active_feature_flags"===t){if(!Ie(e)&&!xe(e)||!Ie(n)&&!xe(n)||!xe(i))return void this.jo(t,!0);var u=new Set(e||[]),h=new Set(n||[]),d=new Set(i);new Set([...u,...d]).forEach(t=>{u.has(t)!==d.has(t)&&l.add(t)}),l.forEach(t=>{h.has(t)===d.has(t)&&l.delete(t)})}else{if(!Te(i))return void(Jb(n,i)?this.Co.delete(t):this.jo(t,!0));if(!Ie(e)&&!Te(e)||Ie(e)&&Me(i)&&Ie(n))return void this.jo(t,!0);var v=Te(e)?e:{},c=Te(n)?n:{};new Set([...Object.keys(v),...Object.keys(i)]).forEach(t=>{t in v==t in i&&Jb(v[t],i[t])||l.add(t)}),l.forEach(t=>{t in c==t in i&&Jb(c[t],i[t])&&l.delete(t)})}l.size?this.jo(t,l):this.Co.delete(t)}}}ea(){var t,e=null==(t=this._n)?void 0:t.persistence_save_debounce_ms;return Fe(e)&&e>0?e:0}ia(t){if(this._n.cookieWinsOnConflict&&"localstorage+cookie"===this._n.persistence.toLowerCase())if(t)try{var e=hp(t,this._n.cookie_persisted_properties||[]),i=vp(e,this._n.cookie_persisted_properties||[]),r=JSON.stringify(e)+"|"+JSON.stringify(i),n=ip.li(this.Fo)||void 0;n&&fp(this.Fo,n)===r&&(this.ra=r,this.na=n)}catch(t){}else try{var s=ip.li(this.Fo)||void 0;this.ra=s?fp(this.Fo,s):void 0,this.na=s}catch(t){}}syncCookieProperties(){return this.sa(this._n)}sa(t,e){if(void 0===e&&(e=!1),this.Bo&&!e||this.xo||!t.cookieWinsOnConflict||"localstorage+cookie"!==t.persistence.toLowerCase())return!1;var i;try{i=ip.li(this.Fo)||void 0}catch(t){}if(!i||i===this.na)return!1;var r,n=fp(this.Fo,i);try{r=up(JSON.parse(i))}catch(t){return!1}if((ip.li(this.Fo)||void 0)!==i)return!1;this.ra=n,this.na=i;var s=cp(this.Fo,i),o=[...op,...s.properties],a={};if(Object.keys(r).forEach(t=>{var e=r[t];(Ie(e)||Ae(e)||""===e||"$user_state"===t&&"anonymous"!==e&&"identified"!==e)&&(a[t]=!0,delete r[t])}),Me(r))return!1;var l="distinct_id"in r||"anonymous"===r.$user_state||"identified"===r.$user_state,u=this.props,h=u[w],d=u[At],v=In({},u);[...op,...t.cookie_persisted_properties||[]].forEach(t=>{if(-1!==o.indexOf(t)&&!(t in r)&&!a[t]&&(l||"distinct_id"!==t&&"$user_state"!==t)){var e=v[t];(s.isValid||-1===op.indexOf(t)||!1!==e&&0!==e)&&delete v[t]}}),this.props=In(v,r),Gb.forEach(t=>{var e=t in this.props;t in u===e&&Jb(u[t],this.props[t])||(e?this.ta(t,u[t],this.props[t]):this.jo(t,!0))}),!l||"$user_state"in r||"$user_state"in this.props||this.Jo(At,te);var c=this.props[w],f=this.props[At];return!l||c===h&&f===d||(this.Mo=!0,this.So=!0,yp.ui(Ub(this.Fo),!0),this.Qo(vt),this.Qo(nt),this.Qo(rt),this.Qo(ot),this.Qo(at),this.Qo(lt),this.Qo(Rt),this.Qo(Et),this.Qo(Mt),"anonymous"!==f||"identified"!==d&&"anonymous"!==r.$user_state&&(Ie(h)||c===h)||(Kb(this.props,r),this.Qo(ct)),"identified"===f?this.props.$user_id=c:delete this.props.$user_id,this.Qo(x)),!0}consumeCookieIdentityChange(){var t=Ub(this.Fo),e=this.So||!!yp.li(t);return this.So=!1,e&&yp.hi(t),e}oa(t){return void 0===t&&(t=!1),!(this.xo||this.Bo&&!t||!this._n.cookieWinsOnConflict||"localstorage+cookie"!==this._n.persistence.toLowerCase()||(this.xo=!0,0))}aa(){this.xo&&(Ie(this.la)||(clearTimeout(this.la),this.la=void 0),delete this.bo[Vb],this.ua(!0))}ha(t){if(void 0===t&&(t=!0),this.xo)try{t?this.aa():Ie(this.la)||(clearTimeout(this.la),this.la=void 0)}finally{this.xo=!1}}isDisabled(){return!!this.Bo}Oo(t){-1===zb.indexOf(t.persistence.toLowerCase())&&(xn.critical("Unknown persistence type "+t.persistence+"; falling back to localStorage+cookie"),t.persistence="localStorage+cookie");var e,i=function(t,e){void 0===t&&(t=[]),void 0===e&&(e=!1);var i=[...op,...t];return n({},np,{di(t){try{var r,n={};try{r=ip.li(t)||void 0,n=r?up(JSON.parse(r)):{}}catch(t){}var s,o=JSON.parse(np.li(t)||"{}");if(e){var a=cp(t,r),l=[...op,...a.properties],u={};Object.keys(n).forEach(t=>{var e=n[t];Ae(e)||""===e||"$user_state"===t&&"anonymous"!==e&&"identified"!==e||(u[t]=e)});var h="distinct_id"in u||"anonymous"===u.$user_state||"identified"===u.$user_state;if(Object.keys(u).length>0){var d,v=o[w],c=null!==(d=o.$user_state)&&void 0!==d?d:"anonymous";i.forEach(t=>{if(-1!==l.indexOf(t)&&!(t in n)&&(h||"distinct_id"!==t&&"$user_state"!==t)){var e=o[t];(a.isValid||-1===op.indexOf(t)||!1!==e&&0!==e)&&delete o[t]}}),!h||"$user_state"in n||"$user_state"in o||(o[At]=te),!h||("distinct_id"in u?u[w]:o[w])===v&&("$user_state"in u?u[At]:o[At])===c||(sp.forEach(t=>delete o[t]),"identified"===u.$user_state&&"distinct_id"in u?o.$user_id=u[w]:delete o.$user_id,"identified"!==u.$user_state&&(delete o[ft],delete o[ct]),delete o.__alias)}s=In(o,u)}else s=In(n,o);return np.ui(t,s),s}catch(t){}return null},ui(i,r,n,s,o,a){var l=np.ui(i,r,void 0,void 0,a);try{var u=hp(r,t);if(Object.keys(u).length){if(e){var h=ap(i),d=vp(u,t);if(ip.ui(h,d,n,s,o,a),ip.li(h)!==JSON.stringify(d)){ip.hi(h,s);var v=hp(r);return ip.ui(i,v,n,s,o,a),l}}ip.ui(i,u,n,s,o,a)}}catch(t){np.ci(t)}return l},hi(t,e){try{null==a||a.localStorage.removeItem(t),ip.hi(t,e),ip.hi(ap(t),e)}catch(t){np.ci(t)}}})}(t.cookie_persisted_properties||[],t.cookieWinsOnConflict),r=!1,s=!1,o=t.persistence.toLowerCase();return"localstorage"===o&&np.si()?(e=np,s=!0):"localstorage+cookie"===o&&i.si()?(e=i,s=!0,r=!0):"sessionstorage"===o&&yp.si()?e=yp:"memory"===o?e=gp:"cookie"===o&&ip.si()?(e=ip,r=!0):i.si()?(e=i,s=!0,r=!0):ip.si()?(e=ip,r=!0):e=gp,this._o=s,this.wo=r,e}No(t){return this.Fo+"__"+t}$o(t){return this._o&&!!t.split_storage}properties(){var t={};return Mn(this.props,(e,i)=>{var r=Bb(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.Bo||t){var e=this._n.cookieWinsOnConflict&&"localstorage+cookie"===this._n.persistence.toLowerCase(),i=e?np.di(this.Fo):null,r={};if(e)try{Mn(r=up(ip.di(this.Fo)),(t,e)=>{(Ie(t)||Ae(t)||""===t)&&delete r[e]})}catch(t){}var n=this.ao.di(this.Fo);if(n&&(this.props=In({},n)),this.ko&&this.da(),e&&n){var s,o,a=null==i?void 0:i[w],l=null!==(s=null==i?void 0:i.$user_state)&&void 0!==s?s:"anonymous",u=n[w],h=null!==(o=n.$user_state)&&void 0!==o?o:"anonymous";if(u!==a||h!==l){this.So=!0,yp.ui(Ub(this.Fo),!0);var d=In({},this.props);sp.forEach(t=>delete d[t]),"anonymous"!==h||"identified"!==l&&"anonymous"!==r.$user_state&&(Ie(a)||u===a)||(Kb(d,r),delete d[ct]),this.props=d;var v=new Set;sp.forEach(t=>{var e,i=null==(e=Bb(t))?void 0:e.storageGroup;i&&v.add(i)}),v.forEach(t=>{var e={};Mn(this.props,(i,r)=>{var n;(null==(n=Bb(r))?void 0:n.storageGroup)===t&&(e[r]=i)}),Me(e)?(np.hi(this.No(t)),this.bo[t]={}):np.ui(this.No(t),e)&&(this.bo[t]={persisted:!0,fingerprint:this.Go(e,t)})})}}yp.li(Ub(this.Fo))&&(this.So=!0)}}da(){for(var t of Nb){var e=np.di(this.No(t));if(e&&!Me(e)){var i=this.Ho(t);i.persisted=!0,this.va(t)||(i.fingerprint=this.Go(e,t)),this.ca(t,e)||In(this.props,e)}}}va(t){return Object.keys(this.props).some(e=>{var i;return(null==(i=Bb(e))?void 0:i.storageGroup)===t})}ca(t,e){var i=Hb[t];if(!i)return!1;var r=e[i],n=this.props[i];return Fe(r)&&Fe(n)&&n>r}refreshKey(t){var e;if(!(this.Bo||"$fbc_persistence"===t&&this.Eo)){var i=this.ko?null==(e=Bb(t))?void 0:e.storageGroup:void 0,r=i?np.di(this.No(i)):this.ao.di(this.Fo);if(r&&t in r)this.Jo(t,r[t],!1);else{if(i){var n=this.ao.di(this.Fo);if(n&&t in n)return void this.Jo(t,n[t],!1)}this.Qo(t,!1)}}}save(){if(!this.Bo){var t=this.ea();t>0?Ie(this.la)&&(this.la=setTimeout(()=>{this.la=void 0,this.ua()},t)):this.ua()}}flush(){Ie(this.la)||(clearTimeout(this.la),this.la=void 0,this.ua())}ua(t){if(void 0===t&&(t=!1),!(this.Bo||this.xo&&!t)){t||(this.syncCookieProperties(),this.Eo||this._n.cookieWinsOnConflict&&"localstorage+cookie"===this._n.persistence.toLowerCase()||this.refreshKey(M));var e=!t&&!this.To;e||(this.Io=!1);var i=!!e&&this.Ko();if(this.Io)this._n.debug&&xn.warn("skipping persistence write because storage belongs to a different distinct ID");else{if(this.ko)return this.fa(),void(i&&this.Ro.forEach(t=>t()));var r=this.pa(this.ao,this.Fo,this.props,Vb);"written"===r&&this.ia(this.props),"failed"!==r&&(this.Co.clear(),this.Mo=!1,this.Eo=!1),i&&this.Ro.forEach(t=>t())}}}fa(){var t=this,e=this.Wo(),i=e.main,r=e.groups,n=this.pa(this.ao,this.Fo,i,Vb);"written"===n&&this.ia(i),"failed"!==n&&(this.Mo=!1,this.Eo=!1,Gb.forEach(t=>{var e;null!=(e=Bb(t))&&e.storageGroup||this.Co.delete(t)}));var s=function(e){var i,n=r[e];if(Me(n)&&(null==(i=t.bo[e])||!i.persisted))return Gb.forEach(i=>{var r;(null==(r=Bb(i))?void 0:r.storageGroup)===e&&t.Co.delete(i)}),1;var s=t.pa(np,t.No(e),n,e);"failed"!==s&&Gb.forEach(i=>{var r=Bb(i);(null==r?void 0:r.storageGroup)!==e||"written"!==s&&r.volatile||t.Co.delete(i)})};for(var o of Nb)if(s(o))continue}Wo(){var t={},e={flags:{},surveys:{}};return Mn(this.props,(i,r)=>{var n,s=null==(n=Bb(r))?void 0:n.storageGroup;s?e[s][r]=i:t[r]=i}),{main:t,groups:e}}Go(t,e){if(e===Vb)return JSON.stringify(t)+"|"+this.ga+"|"+this.ma+"|"+this.ya;var i={};return Mn(t,(t,e)=>{var r;i[e]=null!=(r=Bb(e))&&r.volatile?"__volatile__":t}),JSON.stringify(i)}pa(t,e,i,r){var n,s=this.Ho(r);if(r!==Vb&&!s.dirty&&!Ie(s.fingerprint))return"skipped";try{if((n=this.Go(i,r))===s.fingerprint)return s.dirty=!1,"skipped"}catch(t){n=void 0}return t.ui(e,i,this.ga,this.ma,this.ya,this._n.debug)?(s.dirty=!1,r!==Vb&&(s.persisted=!0),Ie(n)||(s.fingerprint=n),this._o&&(s.storageValue=np.li(e)),"written"):(this._n.debug&&xn.warn('failed to persist storage entry "'+e+'"; will retry on next save'),"failed")}remove(t){var e=(void 0===t?{}:t).keepGroupEntries,i=void 0!==e&&e;if(this.Yo(),Ie(this.la)||(clearTimeout(this.la),this.la=void 0),this.ao.hi(this.Fo,!1),this.ao.hi(this.Fo,!0),!i&&this.Ao)for(var r of Nb)np.hi(this.No(r));i?delete this.bo[Vb]:this.bo={},this.ra=void 0,this.na=void 0}clear(){this.remove(),this.props={}}register_once(t,e,i){if(Te(t)){this.syncCookieProperties(),Ie(e)&&(e="None"),this.ga=Ie(i)?this.ba:i;var r=!1;if(Mn(t,(t,i)=>{this.props.hasOwnProperty(i)&&this.props[i]!==e||(this.Jo(i,t),r=!0)}),r)return this.save(),!0}return!1}register(t,e){if(Te(t)){this.syncCookieProperties(),this.ga=Ie(e)?this.ba:e;var i=!1;if(Mn(t,(e,r)=>{t.hasOwnProperty(r)&&(this.props[r]!==e||Te(e)||xe(e))&&(this.Jo(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.Qo(r),i=!0);i&&this.save()}update_campaign_params(){var t=null==h?void 0:h.URL;if(t!==this.Po){var e=Pa(this._n.custom_campaign_params,this._n.mask_personal_data_properties,this._n.custom_personal_data_properties),i=!Me(Pn(e));return i&&this.register(e),this.Po=t,i?e:void 0}}update_search_keyword(){var t;this.register((t=null==h?void 0:h.referrer)?Oa(t):{})}update_referrer_info(){var t;this.register_once({$referrer:La(),$referring_domain:null!=h&&h.referrer&&(null==(t=qn(h.referrer))?void 0:t.host)||Da},void 0)}set_initial_person_info(){if(!this.props.$initial_campaign_params&&!this.props.$initial_referrer_info){var t=Na(this._n.mask_personal_data_properties,this._n.custom_personal_data_properties,this._n.disable_capture_url_hashes);this.register_once({[Dt]:this.wo?{r:Wb(t.r),u:t.u?Wb(t.u):void 0}:t},void 0)}}get_initial_props(){var t={};Mn([$t,Ot],e=>{var i=this.props[e];i&&Mn(i,function(e,i){t["$initial_"+ce(i)]=e})});var e=this.props[Dt];return e&&In(t,function(t,e){void 0===e&&(e=!1);var i=qa(t,e),r={};return Mn(i,function(t,e){r["$initial_"+ce(e)]=t}),r}(e,this._n.disable_capture_url_hashes)),t}safe_merge(t){return Mn(this.props,function(e,i){i in t||(t[i]=e)}),t}update_config(t,e,i){var r=t.persistence!==e.persistence,s=!((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||[]),o=r||s,a=t.cookieWinsOnConflict!==e.cookieWinsOnConflict,l=t.disable_persistence||!!i,u=!!this.Bo&&!l;l||this.sa(e,u),this._n=t,!l&&(r||s||a)&&(this.ra=void 0,this.na=void 0,this.sa(n({},t,{cookie_persisted_properties:e.cookie_persisted_properties}),u));var h=o||a?this.Oo(t):this.ao;this._a();var d=this.$o(t),v=o||d!==this.ko,c=!l&&(v||t.cross_subdomain_cookie!==this.ma||t.secure_cookie!==this.ya)&&this.oa(u);this.To=v;try{if(this.ba=this.ga=t.cookie_expiration,this.set_disabled(l),this.set_cross_subdomain(t.cross_subdomain_cookie),this.set_secure(t.secure_cookie),v){var f=this.props;this.clear(),this.ao=h,this.ko=d,this.props=f,this.save()}else a&&(this.ao=h,l||(delete this.bo[Vb],this.ua()))}finally{this.To=!1,c&&this.ha()}}_a(){var t=this.props[Dt];if(this.wo&&Te(t)&&"string"==typeof t.r){var e=Wb(t.r),i="string"==typeof t.u?Wb(t.u):t.u;e===t.r&&i===t.u||this.Jo(Dt,n({},t,{r:e,u:i}))}}set_disabled(t){this.Bo=t,this.Bo?this.remove():this.save()}set_cross_subdomain(t){t!==this.ma&&(this.ma=t,this.remove({keepGroupEntries:!0}),this.save())}set_secure(t){t!==this.ya&&(this.ya=t,this.remove({keepGroupEntries:!0}),this.save())}set_event_timer(t,e){var i=this.props.__timers||{};i[t]=e,this.Jo(I,i),this.save()}remove_event_timer(t){var e=this.props.__timers||{},i=e[t];return Ie(i)||(delete e[t],this.Jo(I,e),this.save()),i}get_property(t){return this.props[t]}set_property(t,e){this.Jo(t,e),this.save()}Jo(t,e,i){var r;void 0===i&&(i=!0);var n=this.props[t];this.props[t]=e,i&&("distinct_id"!==t&&"$user_state"!==t||n===e||(this.Mo=!0),"$fbc_persistence"!==t||Jb(n,e)||(this.Eo=!0),this.ta(t,n,e),null!=(r=Bb(t))&&r.volatile||this.Xo(t))}Qo(t,e){void 0===e&&(e=!0),delete this.props[t],e&&(Zb(t)&&this.jo(t,!0),"$fbc_persistence"===t&&(this.Eo=!0),this.Xo(t))}Xo(t){var e,i=null==(e=Bb(t))?void 0:e.storageGroup;i&&(this.Ho(i).dirty=!0)}Ho(t){return this.bo[t]||(this.bo[t]={})}},Yb=Cn("[RateLimiter]"),t_=class{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=>{Yb.info((t||"events")+" is quota limited."),this.serverLimits[t]=(new Date).getTime()+6e4})}catch(t){return void Yb.warn('could not rate limit - continuing. Error: "'+(null==t?void 0:t.message)+'"',{text:e})}},this.instance=t,this.lastEventRateLimited=this.clientRateLimitContext(!0).isRateLimited}get captureEventsPerSecond(){var t;return(null==(t=this.instance.config.rate_limiting)?void 0:t.events_per_second)||10}get captureEventsBurstLimit(){var t;return Math.max((null==(t=this.instance.config.rate_limiting)?void 0:t.events_burst_limit)||10*this.captureEventsPerSecond,this.captureEventsPerSecond)}clientRateLimitContext(t){var e,i,r;void 0===t&&(t=!1);var n=this.captureEventsBurstLimit,s=this.captureEventsPerSecond,o=(new Date).getTime(),a=null!==(e=null==(i=this.instance.persistence)?void 0:i.get_property("$capture_rate_limit"))&&void 0!==e?e:{tokens:n,last:o};a.tokens+=(o-a.last)/1e3*s,a.last=o,a.tokens>n&&(a.tokens=n);var l=1>a.tokens;if(l||t||(a.tokens=Math.max(0,a.tokens-1)),l&&!t){var u=(Fe(a.dropped)?a.dropped:0)+1;a.dropped=u,!this.lastEventRateLimited&&this.wa(u)&&(a.dropped=0)}return this.lastEventRateLimited=l,null==(r=this.instance.persistence)||r.set_property(Ft,a),{isRateLimited:l,remainingTokens:a.tokens}}ka(t){var e=this.instance.config.property_denylist;return!xe(e)||!e.includes(t)}Sa(){var t;if(this.ka("$current_url")&&this.ka("$pathname")&&null!=d&&d.pathname)return""+(null!==(t=d.origin)&&void 0!==t?t:"")+d.pathname}wa(t){var e,i,r=this.captureEventsBurstLimit,n=this.captureEventsPerSecond,s=this.Sa(),o=this.ka("$session_id")?null==(e=(i=this.instance).get_session_id)?void 0:e.call(i):void 0,a=[t+" event(s) dropped since the last warning",s?"triggered on "+s:void 0,o?"session "+o:void 0].filter(Boolean).join(", ");return!!this.instance.capture("$$client_ingestion_warning",{$$client_ingestion_warning_message:"posthog-js client rate limited: "+a+". Config is set to "+n+" events per second and "+r+" events burst limit."},{skip_client_rate_limiting:!0})}isServerRateLimited(t){var e=this.serverLimits[t||"events"]||!1;return!1!==e&&(new Date).getTime()<e}},e_=Cn("[RemoteConfig]"),i_=class{constructor(t){this._instance=t}get remoteConfig(){var t;return null==(t=b._POSTHOG_REMOTE_CONFIG)||null==(t=t[this._instance.config.token])?void 0:t.config}xa(t){var e,i;null!=(e=b.__PosthogExtensions__)&&e.loadExternalDependency?null==(i=b.__PosthogExtensions__)||null==i.loadExternalDependency||i.loadExternalDependency(this._instance,"remote-config",()=>t(this.remoteConfig)):t()}Ca(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 e_.info("Using preloaded remote config",this.remoteConfig),void this.Ta(this.remoteConfig);if(this._instance.Ma())return void e_.warn("Remote config is disabled. Falling back to local config.");this.xa(t=>{if(!t)return e_.info("No config found after loading remote JS config. Falling back to JSON."),void this.Ca(t=>{this.Ta(t.json,t)});this.Ta(t)})}catch(t){e_.error("Error loading remote config",t),this.Ta()}}Ta(t,e){!t&&e&&(0===e.statusCode?e.error||e_.warn("Failed to fetch remote config from PostHog."):e_.error("Failed to fetch remote config from PostHog."));try{this._instance.Ta(t?{ok:!0,config:t}:{ok:!1})}catch(t){e_.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){e_.error("Error loading feature flags",t)}}},r_=!!c||!!v,n_="text/plain",s_=!1,o_=(t,e)=>{var i=t.split("#"),r=i[1],n=i[0].split("?"),s=n[0],o=n[1];if(!o)return t;var a=o.split("&").filter(t=>t.split("=")[0]!==e).join("&");return s+(a?"?"+a:"")+(r?"#"+r:"")},a_=function(t,e,i){var r;void 0===i&&(i=!0);var s=t.split("?"),o=s[0],a=s[1],l=n({},e),u=null!==(r=null==a?void 0:a.split("&").map(t=>{var e,r=t.split("="),n=r[0],s=i&&null!==(e=l[n])&&void 0!==e?e:r[1];return delete l[n],n+"="+s}))&&void 0!==r?r:[],h=jn(l);return h&&u.push(h),u.length>0?o+"?"+u.join("&"):o},l_=t=>{if(t.Ia)return t.Ia;var e=t.data,i=t.compression;if(e){if(i===sf){var r=Ko(Xo(Nn(e)),{mtime:0});return{contentType:n_,body:r.buffer.slice(r.byteOffset,r.byteOffset+r.byteLength),estimatedSize:r.byteLength}}if(i===of){var n=(t=>"data="+encodeURIComponent("string"==typeof t?t:Nn(t)))(function(t){return t?btoa(encodeURIComponent(t).replace(/%([0-9A-F]{2})/g,(t,e)=>String.fromCharCode(parseInt(e,16)))):t}(Nn(e)));return{contentType:"application/x-www-form-urlencoded",body:n,estimatedSize:new Blob([n]).size}}var s=Nn(e);return{contentType:"application/json",body:s,estimatedSize:new Blob([s]).size}}},u_=t=>{var e,i,r=()=>"sendBeacon"===t.transport?{url:a_(t.url,{compression:of}),encodedBody:l_(n({},t,{compression:of,Ia:void 0}))}:{url:o_(t.url,"compression"),encodedBody:l_(n({},t,{compression:void 0,Ia:void 0}))};try{e=l_(t)}catch(e){if(Zr(t.compression,Bn(t.url,"compression")))return xn.error("Failed to gzip request body, sending uncompressed payload",e),r();throw e}return e&&Zr(t.compression,Bn(t.url,"compression"))&&!((i=e.body)instanceof ArrayBuffer?Gr(new Uint8Array(i)):ArrayBuffer.isView(i)&&Gr(new Uint8Array(i.buffer,i.byteOffset,i.byteLength)))?(s_=!0,r()):{url:t.url,encodedBody:e}},h_=t=>{try{return u_(t)}catch(e){return xn.error(e),void(null==t.callback||t.callback({statusCode:0,error:e}))}},d_=function(){var t=o(function*(t){var e=yield Yr(Nn(t.data),ea.DEBUG,{rethrow:!0});if(!e)return t;var i=yield e.arrayBuffer();return n({},t,{Ia:{contentType:n_,body:i,estimatedSize:i.byteLength}})});return function(e){return t.apply(this,arguments)}}(),v_=/Failed to fetch|NetworkError|Load failed/i,c_=t=>"TypeError"===(null==t?void 0:t.name)&&v_.test((null==t?void 0:t.message)||""),f_=t=>{var e=h_(t);if(e){var i=e.url,r=e.encodedBody,s=null!=r?r:{},o=s.contentType,a=s.body,l=s.estimatedSize,u=new Headers;Mn(t.headers,function(t,e){u.append(e,t)}),o&&u.append("Content-Type",o);var h=null,d=!1;if(f){var c=new f;h={signal:c.signal,timeout:setTimeout(()=>{var e;d=!0,c.abort(or("AbortError","PostHog request timed out"+((e=t.timeout)?" after "+e+"ms":"")))},t.timeout)}}var p=e=>{d&&"AbortError"===(null==e?void 0:e.name)||c_(e)?xn.warn(e):xn.error(e),null==t.callback||t.callback({statusCode:0,error:e})};try{var g;v(i,n({method:(null==t?void 0:t.method)||"GET",headers:u,keepalive:"POST"===t.method&&!t.Ea&&52428.8>(l||0),body:a,signal:null==(g=h)?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){xn.error(t)}null==t.callback||t.callback(r)})).catch(p).finally(()=>h?clearTimeout(h.timeout):null)}catch(t){h&&clearTimeout(h.timeout),p(t)}}},p_=t=>{try{var e,i=u_(t),r=i.url,s=i.encodedBody,o=null!=s?s:{},a=o.body,l=o.estimatedSize;if(!a)return;var h=a instanceof Blob?a:new Blob([a],{type:o.contentType});if(u.sendBeacon(r,h))return;var d=xe(t.data)?t.data:null==(e=t.data)?void 0:e.batch;if(xe(d)&&d.length>1&&(null!=l?l:0)>16384){var v=Math.ceil(d.length/2),c=e=>xe(t.data)?e:n({},t.data,{batch:e});return p_(n({},t,{data:c(d.slice(0,v))})),void p_(n({},t,{data:c(d.slice(v))}))}xn.warn("Beacon of ~"+(null!=l?l:0)+" bytes was rejected by the browser, falling back to fetch"),f_(n({},t,{Ea:!0}))}catch(t){xn.warn("Beacon send failed",t)}},g_=(t,e,i,r)=>{var s="query"===r?"POST"===e?"sent_at":"_":void 0;return a_(i===sf?o_(t,"compression"):t,n({},s?{[s]:Date.now().toString()}:{},i===sf?{}:{compression:i}))},m_=[];v&&m_.push({transport:"fetch",method:f_}),c&&m_.push({transport:"XHR",method(t){var e=h_(t);if(e){var i=new c,r=e.encodedBody;i.open(t.method||"GET",e.url,!0);var n=null!=r?r:{},s=n.contentType,o=n.body;Mn(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!=u&&u.sendBeacon&&m_.push({transport:"sendBeacon",method:p_});var y_=class{constructor(t,e){this.Ra=!0,this.Aa=[],this.Pa=Ge((null==e?void 0:e.flush_interval_ms)||3e3,250,5e3,xn.createLogger("flush interval"),3e3),this.Fa=t}enqueue(t){this.Aa.push(t),this.Oa||this.$a()}unload(){this.Da();var t=this.Aa.length>0?this.La():{},e=Object.values(t);[...e.filter(t=>0===t.url.indexOf("/e")),...e.filter(t=>0!==t.url.indexOf("/e"))].map(t=>{this.Na(n({},t,{transport:"sendBeacon"}))})}enable(){this.Ra=!1,this.$a()}$a(){var t=this;this.Ra||(this.Oa=setTimeout(()=>{if(this.Da(),this.Aa.length>0){var e=this.La(),i=function(){var i=e[r],n=(new Date).getTime();i.data&&xe(i.data)&&Mn(i.data,t=>{t.offset=Math.abs(t.timestamp-n),delete t.timestamp}),t.Na(i)};for(var r in e)i()}},this.Pa))}Na(t){try{this.Fa(t)}catch(t){xn.error(t)}}Da(){clearTimeout(this.Oa),this.Oa=void 0}La(){var t={};return Mn(this.Aa,e=>{var i,r=e,s=(r?r.batchKey:null)||r.url;Ie(t[s])&&(t[s]=n({},r,{data:[]})),null==(i=t[s].data)||i.push(r.data)}),this.Aa=[],t}},b_=class{constructor(t){this._instance=t,this.qa=!1,this.ja=3e3,this.Aa=[],this.Aa=[],this.Ba=!0,!Ie(a)&&"onLine"in a.navigator&&(this.Ba=a.navigator.onLine,this.Ha=()=>{this.Ba=!0,this.za()},this.Ua=()=>{this.Ba=!1},$n(a,"online",this.Ha),$n(a,"offline",this.Ua))}get length(){return this.Aa.length}retriableRequest(t){var i=t.retriesPerformedSoFar,s=r(t,e);Oe(i)&&(s.url=a_(s.url,{retry_count:i})),this._instance._send_request(n({},s,{callback:t=>{if(200!==t.statusCode&&(400>t.statusCode||t.statusCode>=500)){if((0===t.statusCode?3:10)>(null!=i?i:0))return void this.cs(n({retriesPerformedSoFar:i},s));0===t.statusCode&&xn.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!=i?i:0)+" retries.")}null==s.callback||s.callback(t)}}))}cs(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)*(r-i);return Math.ceil(r+n)}(e),r=Date.now()+i;this.Aa.push({retryAt:r,requestOptions:t});var n="Enqueued failed request for retry in "+i;navigator.onLine||(n+=" (Browser is offline)"),xn.warn(n),this.qa||(this.qa=!0,this.Wa())}Wa(){if(this.Va&&clearTimeout(this.Va),0===this.Aa.length)return this.qa=!1,void(this.Va=void 0);this.Va=setTimeout(()=>{this.Ba&&this.Aa.length>0&&this.za(),this.Wa()},this.ja)}za(){var t=Date.now(),e=[],i=this.Aa.filter(i=>t>i.retryAt||(e.push(i),!1));if(this.Aa=e,i.length>0)for(var r of i)this.retriableRequest(r.requestOptions)}unload(){for(var t of(this.Va&&(clearTimeout(this.Va),this.Va=void 0),this.qa=!1,Ie(a)||(this.Ha&&(a.removeEventListener("online",this.Ha),this.Ha=void 0),this.Ua&&(a.removeEventListener("offline",this.Ua),this.Ua=void 0)),this.Aa)){var e=t.requestOptions;try{this._instance._send_request(n({},e,{transport:"sendBeacon"}))}catch(t){xn.error(t)}}this.Aa=[]}},__=class{constructor(t){this._instance=t,this.Ga=()=>{var t,e,i,r;this.Za||(this.Za={});var n=this.scrollElement(),s=this.scrollY(),o=n?Math.max(0,n.scrollHeight-n.clientHeight):0,a=s+((null==n?void 0:n.clientHeight)||0),l=(null==n?void 0:n.scrollHeight)||0;this.Za.lastScrollY=Math.ceil(s),this.Za.maxScrollY=Math.max(s,null!==(t=this.Za.maxScrollY)&&void 0!==t?t:0),this.Za.maxScrollHeight=Math.max(o,null!==(e=this.Za.maxScrollHeight)&&void 0!==e?e:0),this.Za.lastContentY=a,this.Za.maxContentY=Math.max(a,null!==(i=this.Za.maxContentY)&&void 0!==i?i:0),this.Za.maxContentHeight=Math.max(l,null!==(r=this.Za.maxContentHeight)&&void 0!==r?r:0)}}get Ja(){return this._instance.config.scroll_root_selector}getContext(){return this.Za}resetContext(){var t=this.Za;return setTimeout(this.Ga,0),t}startMeasuringScrollPosition(){$n(a,"scroll",this.Ga,{capture:!0}),$n(a,"scrollend",this.Ga,{capture:!0}),$n(a,"resize",this.Ga)}scrollElement(){var t;if(!this.Ja)return null==a||null==(t=a.document)?void 0:t.documentElement;for(var e of xe(this.Ja)?this.Ja:[this.Ja]){var i,r=null==a||null==(i=a.document)?void 0:i.querySelector(e);if(r)return r}}Qa(t){var e,i,r="y"===t?"scrollTop":"scrollLeft";if(this.Ja){var n=this.scrollElement();return n&&n[r]||0}return a?"y"===t?a.scrollY||a.pageYOffset||(null==(e=a.document)||null==(e=e.documentElement)?void 0:e.scrollTop)||0:a.scrollX||a.pageXOffset||(null==(i=a.document)||null==(i=i.documentElement)?void 0:i.scrollLeft)||0:0}scrollY(){return this.Qa("y")}scrollX(){return this.Qa("x")}},w_=t=>Na(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),k_=class{constructor(t,e,i,r){this.Te=t=>{var e=this.Ka();if(!e||e.sessionId!==t){var i={sessionId:t,props:this.Xa(this._instance)};this.Ya.register({[Pt]:i})}},this._instance=t,this.tl=e,this.Ya=i,this.Xa=r||w_,this.tl.onSessionId(this.Te)}Ka(){return this.Ya.props[Pt]}getSetOnceProps(){var t,e=null==(t=this.Ka())?void 0:t.props;return e?"r"in e?qa(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 Mn(Pn(this.getSetOnceProps()),(e,i)=>{"$current_url"===i&&(i="url"),t["$session_entry_"+ce(i)]=e}),t}},S_=class{on(t,e){return this.el[t]||(this.el[t]=[]),this.el[t].push(e),()=>{this.el[t]=this.el[t].filter(t=>t!==e)}}emit(t,e){for(var i of this.el[t]||[])i(e);for(var r of this.el["*"]||[])r(t,e)}constructor(){this.el={}}},x_=Cn("[SessionId]"),C_=864e5,T_=class{on(t,e){return this.il.on(t,e)}constructor(t,e,i){var r;if(this.rl=null,this.nl=null,this.sl=[],this.ol=void 0,this.al=!1,this.il=new S_,this.ll=(t,e)=>!(!Oe(t)||!Oe(e))&&Math.abs(t-e)>this.sessionTimeoutMs,!t.persistence)throw new Error("SessionIdManager requires a PostHogPersistence instance");if("always"===t.config.cookieless_mode)throw new Error('SessionIdManager cannot be used with cookieless_mode="always"');this._n=t.config,this.Ya=t.persistence,this.Ie=void 0,this.Bt=void 0,this._sessionStartTimestamp=null,this.ul=void 0,this._sessionActivityTimestamp=null,this.hl=e||Kf,this.dl=i||Kf;var n=this._n.persistence_name||this._n.token;if(this._sessionTimeoutMs=1e3*Ge(this._n.session_idle_timeout_seconds||1800,60,36e3,x_.createLogger("session_idle_timeout_seconds"),1800),t.register({$configured_session_timeout_ms:this._sessionTimeoutMs}),this.vl(),this.cl="ph_"+n+"_window_id",this.fl="ph_"+n+"_primary_window_exists",this.pl()){var s=yp.di(this.cl),o=yp.di(this.fl);s&&!o?this.Ie=s:yp.hi(this.cl),yp.ui(this.fl,!0)}null!=(r=this._n.bootstrap)&&r.sessionID&&this.setBootstrapSessionId(this._n.bootstrap.sessionID),this.gl()}get sessionTimeoutMs(){return this._sessionTimeoutMs}onSessionId(t){return Ie(this.sl)&&(this.sl=[]),this.sl.push(t),this.Bt&&t(this.Bt,this.Ie),()=>{this.sl=this.sl.filter(e=>e!==t)}}pl(){return"memory"!==this._n.persistence&&!this.Ya.Bo&&yp.si()}ml(t){t!==this.Ie&&(this.Ie=t,this.pl()&&yp.ui(this.cl,t))}yl(){return this.Ie?this.Ie:this.pl()?yp.di(this.cl):null}bl(t){var e=this.rl;return!Ae(e)&&!Ae(t)&&5e3>Math.abs(t-e)}_l(t,e,i){var r=e!==this._sessionActivityTimestamp,n=!(t!==this.Bt||i!==this._sessionStartTimestamp);this._sessionStartTimestamp=i,this._sessionActivityTimestamp=e,this.Bt=t,n&&!r||n&&this.bl(e)||(this.rl=e,this.Ya.register({[G]:[e,t,i]}))}wl(){var t,e=null==(t=this._n)?void 0:t.persistence_save_debounce_ms;return Oe(e)&&e>0}kl(){this.wl()?this.Ya.refreshKey(G):(this.Ya.flush(),this.Ya.load())}Sl(){var t;if(!Ae(this._sessionActivityTimestamp)&&this._sessionActivityTimestamp!==this.rl){this.kl();var e=this.xl();e[1]===this.Bt&&e[2]===this._sessionStartTimestamp&&(this.rl=this._sessionActivityTimestamp,this.Ya.register({[G]:[this._sessionActivityTimestamp,null!==(t=this.Bt)&&void 0!==t?t:null,this._sessionStartTimestamp]}),this.Ya.flush())}}Cl(){var t=this.xl()[0],e=Oe(t)?t:0,i=Oe(this._sessionActivityTimestamp)?this._sessionActivityTimestamp:0;return Math.max(e,i)}Tl(t){return this.kl(),this.ll(t,this.Cl())}xl(){var t=this.Ya.props[G];return xe(t)&&2===t.length&&t.push(t[0]),t||[0,null,0]}resetSessionId(){this.rl=null,this.ul=void 0,clearTimeout(this.Ml),this.Ml=void 0,this._l(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 x_.error("Bootstrap sessionID cannot be in the future"):i}catch(t){return void x_.error("Invalid sessionID in bootstrap",t)}}(t);return!Ie(i)&&(e?this.ul={sessionId:t,sessionStartTimestamp:i}:this._l(t,(new Date).getTime(),i),!0)}destroy(){this.al=!0,this.Sl(),clearTimeout(this.Ml),this.Ml=void 0,this.ol&&a&&(a.removeEventListener(ne,this.ol,{capture:!1}),this.ol=void 0),this.sl=[]}gl(){this.ol=()=>{this.Sl(),this.pl()&&yp.hi(this.fl)},$n(a,ne,this.ol,{capture:!1})}checkAndGetSessionAndWindowId(t,e,i){if(void 0===t&&(t=!1),void 0===e&&(e=null),void 0===i&&(i=!1),"always"===this._n.cookieless_mode)throw new Error('checkAndGetSessionAndWindowId should not be called with cookieless_mode="always"');var r=e||(new Date).getTime(),n=this.Bt;if(i)this.nl=r;else if(Ae(this.nl)||this.nl>r||r-this.nl>=1e3){var s,o;null==(s=(o=this.Ya).syncCookieProperties)||s.call(o),this.nl=r}var a=this.xl(),l=a[1],u=a[2],h=!Ie(n)&&l!==n,d=this.Cl(),v=this.yl(),c=this.ul,f=!!c&&(c.sessionStartTimestamp>r+6e4||r-c.sessionStartTimestamp>C_),p=c?f:Oe(u)&&Math.abs(r-u)>C_,g=!1,m=h,y=!l||!!c,b=l,_=!y&&!t&&this.ll(r,d);if(_){(_=this.Tl(r))||x_.info("cross-tab refresh kept the session alive",{sessionId:l});var w=this.xl();l=w[1],u=w[2]}if(y||_||p){m=!1;var k=c&&!f;l=k?c.sessionId:this.hl(),v=this.dl(),x_.info("new session ID assigned",{sessionId:l,windowId:v,bootstrapped:!!k,changeReason:{noSessionId:y,activityTimeout:_,sessionPastMaximumLength:p}}),u=k?c.sessionStartTimestamp:r,this.ul=void 0,g=!0}else v||(v=this.dl(),g=!0),(m=m||l!==b)&&(x_.info("adopted cross-tab session id",{sessionId:l,windowId:v}),g=!0);var S=Oe(d)&&t&&!p?d:r,x=Oe(u)?u:(new Date).getTime();this.ml(v),this._l(l,S,x),t||this.vl();var C={noSessionId:y,activityTimeout:_,sessionPastMaximumLength:p,crossTabAdoption:m};return g&&this.sl.forEach(t=>t(l,v,C)),{sessionId:l,windowId:v,sessionStartTimestamp:x,changeReason:g?C:void 0,lastActivityTimestamp:d}}vl(){this.al||(clearTimeout(this.Ml),this.Ml=setTimeout(()=>{if(!this.al)if(this.Tl((new Date).getTime())){var t=this.Bt;this.resetSessionId(),this.il.emit("forcedIdleReset",{idleSessionId:t})}else this.vl()},1.1*this.sessionTimeoutMs))}},M_=function(t,e){if(!t)return!1;var i=t.userAgent;if(i&&he(i,e))return!0;try{var r=null==t?void 0:t.userAgentData;if(null!=r&&r.brands&&r.brands.some(t=>he(null==t?void 0:t.brand,e)))return!0}catch(t){}return!!t.webdriver};function I_(){return I_=o(function*(){var t=null==u?void 0:u.userAgentData;if(null!=t&&t.getHighEntropyValues)try{var e,i=null==(e=yield t.getHighEntropyValues(["model"]))?void 0:e.model;return Ee(i)&&i.length>0?i:void 0}catch(t){return void xn.info("Unable to resolve $device_model from userAgentData.getHighEntropyValues",t)}}),I_.apply(this,arguments)}var E_="custom",R_="i.posthog.com",A_=/^\/static\//,P_=["/s/","/e/","/i/"],F_=class{constructor(t){this.Il={},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("."+R_,".posthog.com")),"https://app.posthog.com"===e?"https://us.posthog.com":e}get region(){return this.Il[this.apiHost]||(this.Il[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":E_),this.Il[this.apiHost]}El(t){if(A_.test(t)){var e=this.instance.config.asset_host;if("string"==typeof e)return e.trim().replace(/\/$/,"")||void 0}}Rl(t){var e=qn(t);return e?e.protocol+"//"+e.host+e.pathname:void 0}Al(t,e,i){if("ui"===t)return i;var r=i,n=this.instance.config.rewriteRequestPath;if(n){var s,o=(null==(s=qn(i))?void 0:s.href)||i;r=n(new URL(o)).toString()}if(n&&"api"===t&&P_.some(t=>0===e.indexOf(t))){var a=this.Rl(r);if(a){var l,u=this.apiHost,h=this.Pl;(null==(l=h)?void 0:l.apiHost)===u&&h.rewriteRequestPath===n||(this.Pl=h={apiHost:u,rewriteRequestPath:n,urls:new Set}),h.urls.add(a)}}return r}isIngestionEndpoint(t){var e=this.Pl,i=this.Rl(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.Al(t,e,this.uiHost+e);if("flags"===t)return this.Al(t,e,this.flagsApiHost+e);if("assets"===t){var i=this.El(e);if(i)return this.Al(t,e,""+i+e)}if(this.region===E_)return this.Al(t,e,this.apiHost+e);var r=R_+e;switch(t){case"assets":return this.Al(t,e,"https://"+this.region+"-assets."+r);case"api":return this.Al(t,e,"https://"+this.region+"."+r)}}},O_=Cn("[PostHog ExternalIntegrations]"),$_={intercom:"intercom-integration",crispChat:"crisp-chat-integration"},D_=class{constructor(t){this._instance=t}do(t,e){var i;null==(i=b.__PosthogExtensions__)||null==i.loadExternalDependency||i.loadExternalDependency(this._instance,t,t=>{if(t)return O_.error("failed to load script",t);e()})}startIfEnabledOrStop(){var t=this,e=function(){var e,r,n,s=i[0],o=i[1];!o||null!=(e=b.__PosthogExtensions__)&&null!=(e=e.integrations)&&e[s]||t.do($_[s],()=>{var e;null==(e=b.__PosthogExtensions__)||null==(e=e.integrations)||null==(e=e[s])||e.start(t._instance)}),!o&&null!=(r=b.__PosthogExtensions__)&&null!=(r=r.integrations)&&r[s]&&(null==(n=b.__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()}}},L_=class{constructor(t,e){this.A=t,this.Hs=e,this.Fl=new Map,this.Js=!1}add(t){var e=this;return o(function*(){if(e.Js)throw new Error("Cannot add an extension to a disposed ExtensionRuntime");if(e.Fl.has(t.name))throw new Error('Browser extension "'+t.name+'" is already registered');e.Fl.set(t.name,t);try{var i=t.setup(e.Hs);i&&(yield i)}catch(i){var r=e.Fl.get(t.name)===t;r&&e.Fl.delete(t.name),e.A.error('Failed to set up browser extension "'+t.name+'"',i),r&&e.Ol(t)}})()}getExtension(t){return this.Fl.get(t)}dispose(){if(!this.Js){this.Js=!0;var t=Array.from(this.Fl.values()).reverse();for(var e of(this.Fl.clear(),t))this.Ol(e)}}Ol(t){try{var e=null==t.dispose?void 0:t.dispose();e&&Ce(e.then)&&e.then(void 0,e=>{this.A.error('Failed to dispose browser extension "'+t.name+'"',e)})}catch(e){this.A.error('Failed to dispose browser extension "'+t.name+'"',e)}}},N_=class{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);Ie(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)}},q_="extensionsRemoteConfig",j_=class{constructor(t){this.instance=t,this.Js=!1,this.A=xn,this.$l=t.Dl,this.kv=new N_(t),this.onEvent=t=>Df(this.instance.on("eventCaptured",e=>{try{t({event:e.event,properties:e.properties})}catch(t){this.A.error("Browser extension event listener failed",t)}})),this.onRemoteConfig=t=>{if(this.Js)return Df(()=>{});var e=e=>{try{t(e)}catch(t){this.A.error("Browser extension remote config listener failed",t)}},i=this.instance.Ll.on(q_,e);return this.$l&&e(this.$l),Df(i)},this.Nl=new L_(xn.createLogger("[BrowserExtensions]"),this)}get logger(){return this.A}get distinctId(){return this.instance.get_distinct_id()}get anonymousId(){var t;return null!==(t=this.instance.get_property("$device_id"))&&void 0!==t?t:this.distinctId}get deviceId(){var t=this.instance.get_property(k);return"string"==typeof t?t:void 0}get library(){return{name:ea.LIB_NAME,version:ea.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.Nl.add(t)}getExtension(t){return this.Nl.getExtension(t)}capture(t,e,i){var r=this;return o(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 Df(this.instance.ql(t))}handleRemoteConfig(t){this.Js||(this.$l=t,this.instance.Ll.emit(q_,t))}sendRequest(t,e){var i=this;return o(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?a_(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?ge.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.Js||(this.Js=!0,this.Nl.dispose())}},B_={},H_=0,z_=()=>{},U_='Consent opt in/out is not valid with cookieless_mode="always" and will be ignored',W_="Surveys module not available",V_="sanitize_properties is deprecated. Use before_send instead",G_="Invalid value for property_denylist config: ",Z_=/^[A-Za-z0-9_-]{1,400}$/,J_=/^fb\.[0-9]+\.[0-9]+\.[A-Za-z0-9_-]+(?:\.[A-Za-z0-9_-]+)?$/,Q_=["token","distinct_id",qt],K_="posthog",X_=!r_&&-1===(null==g?void 0:g.indexOf("MSIE"))&&-1===(null==g?void 0:g.indexOf("Mozilla")),Y_=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},tw=t=>{var e;return n({api_host:"https://us.i.posthog.com",flags_api_host:null,ui_host:null,asset_host:null,token:"",autocapture:!0,cross_subdomain_cookie:On(null==h?void 0:h.location),persistence:"localStorage+cookie",persistence_name:"",cookie_persisted_properties:[],loaded:z_,save_campaign_params:!0,custom_campaign_params:[],custom_blocked_useragents:[],save_referrer:!0,capture_pageleave:"if_capture_pageview",defaults:null!=t?t:"unset",__preview_deferred_init_extensions:!1,__preview_external_dependency_versioned_paths:!1,__preview_cookie_wins_on_conflict:!1,debug:d&&Ee(null==d?void 0:d.search)&&-1!==d.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,reuseAnonymousId:!1,disable_external_dependency_loading:!1,strict_script_versioning:"fallback",enable_recording_console_log:void 0,secure_cookie:"https:"===(null==a||null==(e=a.location)?void 0:e.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){xn.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:ie,before_send:void 0,get_current_url:void 0,request_queue_config:{flush_interval_ms:3e3},error_tracking:{},_onCapture:z_},(t=>({rageclick:t&&t>="2026-05-30"?{content_ignorelist:ds,ignore_text_selection:!0}:!t||"2025-11-30">t||{content_ignorelist:!0},capture_pageview:!t||"2025-05-24">t||"history_change",session_recording:Y_(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)}))(t))},ew=[["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"]],iw=t=>{var e={};for(var i of ew){var r=i[0],n=i[1];Ie(t[r])||(e[n]=t[r])}var s=In({},e,t),o=t.__preview_external_dependency_versioned_paths;return Ie(o)||(Ie(t.strict_script_versioning)&&(s.strict_script_versioning=!!o),Ee(o)&&Ie(t.asset_host)&&(s.asset_host=o)),xe(t.property_blacklist)&&(Ie(t.property_denylist)?s.property_denylist=t.property_blacklist:xe(t.property_denylist)?s.property_denylist=[...t.property_blacklist,...t.property_denylist]:xn.error(G_+t.property_denylist)),s},rw=class{constructor(){this.__forceAllowLocalhost=!1}get jl(){return this.__forceAllowLocalhost}set jl(t){xn.error("WebPerformanceObserver is deprecated and has no impact on network capture. Use `_forceAllowLocalhostNetworkCapture` on `posthog.sessionRecording`"),this.__forceAllowLocalhost=t}},nw=(s=class t{Bl(t){if(t){var e=this.Fl.indexOf(t);-1!==e&&this.Fl.splice(e,1)}}Hl(t,e){return this.Bl(t),this.Fl.push(e),null==e.initialize||e.initialize(),e}zl(){return"always"===this.config.cookieless_mode||"on_reject"===this.config.cookieless_mode&&this.consent.isRejected()}Ul(){if(!(this.Wl||this.config.reuseAnonymousId||this.config.segment||this.zl())){var t,e,i,r="memory"===this.config.persistence||"sessionStorage"===this.config.persistence;(r||this.config.disable_persistence)&&(this.Vl||(r?(t="persistence is set to '"+this.config.persistence+"'",e="memory"===this.config.persistence?"on every page load":"for every new browser tab or window",i="Either set persistence to 'localStorage+cookie', keep this persistence and pass a stable ID through bootstrap.distinctID, or enable reuseAnonymousId."):(t="persistence is disabled (disable_persistence is true)",e="on every page load",i="Either set disable_persistence to false, keep persistence disabled and pass a stable ID through bootstrap.distinctID, or enable reuseAnonymousId."),this.Wl=!0,console.warn("[PostHog.js]",t+" but no bootstrap.distinctID was provided. PostHog will mint a new distinct ID "+e+", so calling identify() merges a new ID onto the person each time. A person can then pass the distinct-ID limit and its events stop appearing on person pages and the session tab. "+i)))}}Gl(){if(!this.zl()&&"$posthog_cookieless"===this.get_distinct_id()){var t=this.persistence;if(t){this.Zl()||t.load(!0);var e=this.get_distinct_id();if(!e||"$posthog_cookieless"===e){var i=this.config.get_device_id(Kf());this.register({distinct_id:i,$device_id:i}),t.set_property(At,te)}this.Jl()}}}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 e;this.webPerformance=new rw,this.Ql=!1,this.version=ea.LIB_VERSION,this.Kl=new Set,this.Xl="",this.Ll=new S_,this.Fl=[],this.Yl=[],this.Vl=!1,this.Wl=!1,this._calculate_event_properties=this.calculateEventProperties.bind(this),this.config=tw(),this.SentryIntegration=Db,this.sentryIntegration=t=>function(t,e){var i=$b(t,e);return{name:Ob,processEvent:t=>i(t)}}(this,t),this.__request_queue=[],this.__loaded=!1,this.analyticsDefaultEndpoint="/e/",this.tu=!1,this.eu=null,this.iu=null,this.ru=null,this.scrollManager=new __(this),this.pageViewManager=new Lb(this),this.rateLimiter=new t_(this),this.requestRouter=new F_(this),this.consent=new Mb(this),this.externalIntegrations=new D_(this);var i=null!==(e=t.__defaultExtensionClasses)&&void 0!==e?e:{};this.featureFlags=i.featureFlags&&new i.featureFlags(this),this.toolbar=i.toolbar&&new i.toolbar(this),this.surveys=i.surveys&&new i.surveys(this),this.conversations=i.conversations&&new i.conversations(this),this.logs=i.logs&&new i.logs(this),this.metrics=i.metrics&&new i.metrics(this),this.experiments=i.experiments&&new i.experiments(this),this.exceptions=i.exceptions&&new i.exceptions(this),this.people={set:(t,e,i)=>{var r=Ee(t)?{[t]:e}:t;this.setPersonProperties(r),null==i||i({})},set_once:(t,e,i)=>{var r=Ee(t)?{[t]:e}:t;this.setPersonProperties(void 0,r),null==i||i({})}},this.on("eventCaptured",t=>xn.info('send "'+(null==t?void 0:t.event)+'"',t))}init(e,i,r){if(r&&r!==K_){var n,s=null!==(n=B_[r])&&void 0!==n?n:new t;return s._init(e,i,r),B_[r]=s,B_[K_][r]=s,s}return this._init(e,i,r)}_init(t,e,i){var r,s,o;void 0===e&&(e={});var l,u=Ee(t)?t.trim():"";if(!u)return xn.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 u!==(null==(l=this.config)?void 0:l.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('"+u+"', { ... }, 'project2')"):console.warn("[PostHog.js]","You have already initialized PostHog! Re-initializing is a no-op"),this;this.__loaded=!0,this.config=tw(e.defaults),e.debug=this.nu(e.debug),this.su=e,this.ou=[],e.person_profiles?this.iu=e.person_profiles:e.process_person&&(this.iu=e.process_person);var h=tw(e.defaults),d=iw(e),v=In({},h,d,{name:i,token:u});Te(h.rageclick)&&Te(d.rageclick)&&(v.rageclick=In({},h.rageclick,d.rageclick)),Te(h.session_recording)&&Te(d.session_recording)&&(v.session_recording=In({},h.session_recording,d.session_recording)),this.set_config(v),this.config.on_xhr_error&&xn.error("on_xhr_error is deprecated. Use on_request_error instead"),this.compression=e.disable_compression?void 0:sf;var c=this.Zl();if(this.persistence=new Xb(this.config,c),this.sessionPersistence="sessionStorage"===this.config.persistence||"memory"===this.config.persistence?this.persistence:new Xb(n({},this.config,{persistence:"sessionStorage"}),c,!1),this.Xl="ph_"+(this.config.persistence_name||this.config.token)+"_session_registered_properties","memory"!==this.config.persistence&&!c&&yp.si()){var f=yp.di(this.Xl);xe(f)&&f.forEach(t=>{Ee(t)&&this.Kl.add(t)})}else yp.hi(this.Xl);var p=n({},this.persistence.props),g=n({},this.sessionPersistence.props);this.register({$initialization_time:(new Date).toISOString()}),this.au=new y_(t=>this.lu(t),this.config.request_queue_config),this.uu=new b_(this),this.__request_queue=[];var m=this.zl();m||(this.sessionManager=new T_(this),this.sessionPropsManager=new k_(this,this.sessionManager,this.persistence),this.sessionManager.onSessionId((t,e,i)=>{(null!=i&&i.activityTimeout||null!=i&&i.sessionPastMaximumLength||null!=i&&i.crossTabAdoption)&&this.hu()})),this.du(),this.config.__preview_deferred_init_extensions?(xn.info("Deferring extension initialization to improve startup performance"),setTimeout(()=>{this.vu(m)},0)):(xn.info("Initializing extensions synchronously"),this.vu(m)),ea.DEBUG=ea.DEBUG||this.config.debug,ea.DEBUG&&xn.info("Starting in debug mode",{this:this,config:e,thisC:n({},this.config),p:p,s:g}),!this.config.identity_distinct_id||null!=(r=e.bootstrap)&&r.distinctID||(e.bootstrap=n({},e.bootstrap,{distinctID:this.config.identity_distinct_id,isIdentifiedID:!0}));var y=null==(s=e.bootstrap)?void 0:s.distinctID;if(this.Vl=!!y&&!Re(y),void 0!==(null==(o=e.bootstrap)?void 0:o.distinctID)){var b=e.bootstrap.distinctID,_=this.get_distinct_id(),w=this.persistence.get_property(At);if(e.bootstrap.isIdentifiedID&&null!=_&&_!==b&&"anonymous"===w)this.identify(b);else if(e.bootstrap.isIdentifiedID&&null!=_&&_!==b&&"identified"===w)xn.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 k=this.config.get_device_id(Kf()),x=e.bootstrap.isIdentifiedID?k:b;this.persistence.set_property(At,e.bootstrap.isIdentifiedID?ee:te),this.register({distinct_id:b,$device_id:x})}}if(m)this.register_once({distinct_id:Nt,$device_id:null},"");else if(!this.get_distinct_id()){var C=this.config.get_device_id(Kf());this.register_once({distinct_id:C,$device_id:C},""),this.persistence.set_property(At,te)}return $n(a,"onpagehide"in self?"pagehide":"unload",this._handle_unload.bind(this),{passive:!1}),e.segment?Fb(this,()=>this.cu()):this.cu(),Ce(this.config._onCapture)&&this.config._onCapture!==z_&&(xn.warn("onCapture is deprecated. Please use `before_send` instead"),this.on("eventCaptured",t=>this.config._onCapture(t.event,t))),this.config.ip&&xn.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 I_.apply(this,arguments)}().then(t=>{t&&this.register({[S]:t})}).catch(z_),this}fu(t){var e=t;return Ee(e.name)&&Ce(e.setup)}pu(t,e){this.fu(t)?e.push(()=>{this.gu().add(t).catch(()=>null==t.dispose?void 0:t.dispose()).catch(e=>{xn.error('Failed to dispose browser extension "'+t.name+'"',e)})}):this.Fl.push(t)}du(){var e,i,r,n,s,o,a=null!==(e=null==(i=this.config.__extensionClasses)?void 0:i.featureFlags)&&void 0!==e?e:null==(r=t.__defaultExtensionClasses)?void 0:r.featureFlags;a&&(this.featureFlags&&this.featureFlags instanceof a||(null==(o=this.mu)||o.call(this),this.mu=void 0,this.featureFlags=new a(this)),Ce(this.featureFlags.onReloading)&&Ce(this.featureFlags.setup)?this.mu||(this.mu=this.featureFlags.onReloading(()=>{this.Ll.emit("featureFlagsReloading",!0)}),this.gu().add(this.featureFlags)):null==(n=(s=this.featureFlags).initialize)||n.call(s))}vu(e){var i,r,s,o,a,l,u,h=performance.now(),d=n({},t.__defaultExtensionClasses,this.config.__extensionClasses),v=[];d.exceptions&&this.Fl.push(this.exceptions=null!==(i=this.exceptions)&&void 0!==i?i:new d.exceptions(this)),d.historyAutocapture&&this.Fl.push(this.historyAutocapture=new d.historyAutocapture(this)),d.tracingHeaders&&this.Fl.push(this.tracingHeaders=new d.tracingHeaders(this)),d.siteApps&&this.Fl.push(this.siteApps=new d.siteApps(this)),d.sessionRecording&&!e&&this.Fl.push(this.sessionRecording=new d.sessionRecording(this)),this.config.disable_scroll_properties||v.push(()=>{this.scrollManager.startMeasuringScrollPosition()}),d.autocapture&&this.pu(this.autocapture=new d.autocapture(this),v),d.surveys&&this.pu(this.surveys=null!==(r=this.surveys)&&void 0!==r?r:new d.surveys(this),v),d.logs&&this.pu(this.logs=null!==(s=this.logs)&&void 0!==s?s:new d.logs(this),v),d.metrics&&this.Fl.push(this.metrics=null!==(o=this.metrics)&&void 0!==o?o:new d.metrics(this)),d.conversations&&this.Fl.push(this.conversations=null!==(a=this.conversations)&&void 0!==a?a:new d.conversations(this)),d.productTours&&this.Fl.push(this.productTours=new d.productTours(this)),d.heatmaps&&this.Fl.push(this.heatmaps=new d.heatmaps(this)),d.webVitalsAutocapture&&this.Fl.push(this.webVitalsAutocapture=new d.webVitalsAutocapture(this)),d.exceptionObserver&&this.Fl.push(this.exceptionObserver=new d.exceptionObserver(this)),d.deadClicksAutocapture&&this.Fl.push(this.deadClicksAutocapture=new d.deadClicksAutocapture(this,Rb)),d.toolbar&&this.Fl.push(this.toolbar=null!==(l=this.toolbar)&&void 0!==l?l:new d.toolbar(this)),d.experiments&&this.Fl.push(this.experiments=null!==(u=this.experiments)&&void 0!==u?u:new d.experiments(this)),this.Fl.forEach(t=>{t.initialize&&v.push(()=>{null==t.initialize||t.initialize()})}),v.push(()=>{if(this.yu){var t=this.yu;this.yu=void 0,this.Fl.forEach(e=>null==e.onRemoteConfig?void 0:e.onRemoteConfig(t))}}),this.bu(v,h)}bu(t,e){for(;t.length>0;){if(this.config.__preview_deferred_init_extensions&&performance.now()-e>=30&&t.length>0)return void setTimeout(()=>{this.bu(t,e)},0);var i=t.shift();if(i)try{i()}catch(t){xn.error("Error initializing extension:",t)}}var r=Math.round(performance.now()-e);this.register_for_session({[jt]:this.config.__preview_deferred_init_extensions?"deferred":"synchronous",[Bt]:r}),this.config.__preview_deferred_init_extensions&&xn.info("PostHog extensions initialized ("+r+"ms)")}Ta(t){var e;if(!h||!h.body)return xn.info("document not ready yet, trying again in 500 milliseconds..."),void setTimeout(()=>{this.Ta(t)},500);if(this.config.__preview_deferred_init_extensions&&(this.yu=t),this.Dl=t,this.compression=void 0,t.ok){var i,r=t.config;r.supportedCompression&&!this.config.disable_compression&&(this.compression=de(r.supportedCompression,sf)?sf:de(r.supportedCompression,of)?of:void 0),null!=(i=r.analytics)&&i.endpoint&&(this.analyticsDefaultEndpoint=r.analytics.endpoint)}this.set_config({person_profiles:this.iu?this.iu:ie}),null==(e=this._u)||e.handleRemoteConfig(t),this.Fl.forEach(e=>null==e.onRemoteConfig?void 0:e.onRemoteConfig(t))}cu(){try{this.config.loaded(this)}catch(t){xn.critical("`loaded` function failed",t)}if(this.wu(),this.config.internal_or_test_user_hostname&&null!=d&&d.hostname){var t=d.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.zl())&&this.ku()},1),this.Su=new i_(this),this.Su.load()}wu(){var t;this.is_capturing()&&this.config.request_batching&&(null==(t=this.au)||t.enable())}_dom_loaded(){this.is_capturing()&&Tn(this.__request_queue,t=>this.lu(t)),this.__request_queue=[],this.wu()}_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.xu()&&this.capture(oe),null==(i=this.logs)||i.flushLogs("sendBeacon"),null==(r=this.au)||r.unload(),null==(n=this.uu)||n.unload()):this.xu()&&this.capture(oe,null,{transport:"sendBeacon"})}_send_request(t){var e;this.__loaded?X_?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=n({},this.config.request_headers,t.headers),t.compression="best-available"===t.compression?null!==(e=this.compression)&&void 0!==e?e:t.compressionFallback:t.compression,(Ie(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,s=n({},t);s.timeout=s.timeout||6e4;var o,a,l,u,h,d=null!==(e=s.transport)&&void 0!==e?e:"fetch";"sendBeacon"===d&&Ie(s.compression)&&s.data&&(s.compression=of),"POST"===s.method&&s.data&&("capture-body"===s.timestampMode?s.data={api_key:null!==(a=null==(h=(u=(xe(o=s.data)?o:[o]).map(t=>n({},t,t.timestamp instanceof Date&&!isNaN(t.timestamp.getTime())?{timestamp:t.timestamp.toISOString()}:{})))[0])||null==(l=h.properties)?void 0:l.token)&&void 0!==a?a:null==h?void 0:h.token,batch:u,sent_at:(new Date).toISOString()}:"body"===s.timestampMode&&(s.data=function(t,e){return void 0===e&&(e=(new Date).toISOString()),xe(t)?t.map(t=>n({},t,{sent_at:e})):n({},t,{sent_at:e})}(s.data))),s.url=g_(s.url,s.method,s.compression,s.timestampMode);var v=m_.filter(t=>!s.disableTransport||!t.transport||!s.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){c_(t)?xn.warn(t):xn.error(t),null==s.callback||s.callback({statusCode:0,error:t})}};"sendBeacon"!==d&&s.data&&s.compression===sf&&p&&"undefined"!=typeof Promise&&!s_?d_(s).then(t=>{f(t)}).catch(e=>{if(Jr(e))return s_=!0,void f(n({},s,{compression:void 0,url:g_(t.url,t.method,void 0,t.timestampMode)}));Qr(e)&&(s_=!0),f(s)}):c(s)})(n({},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}))}lu(t){this.uu?this.uu.retriableRequest(t):this._send_request(t)}_execute_array(t){H_++;try{var e,i=[],r=[],n=[];Tn(t,t=>{if(t)if(xe(e=t[0]))n.push(t);else if(Ce(t))try{t.call(this)}catch(e){xn.error("Error executing queued PostHog call",t,e)}else xe(t)&&"alias"===e?i.push(t):xe(t)&&-1!==e.indexOf("capture")&&Ce(this[e])?n.push(t):r.push(t)});var s=function(t,e){Tn(t,function(t){try{if(xe(t[0])){var i=e;Mn(t,function(t){i=i[t[0]].apply(i,t.slice(1))})}else e[t[0]].apply(e,t.slice(1))}catch(e){xn.error("Error executing queued PostHog call",t,e)}})};s(i,this),s(r,this),s(n,this)}finally{H_--}}push(e){if(H_>0&&xe(e)&&Ee(e[0])){var i=t.prototype[e[0]];Ce(i)&&i.apply(this,e.slice(1))}else this._execute_array([e])}Cu(){var t,e=null==(t=this.persistence)?void 0:t.get_property(M);return Ee(e)&&J_.test(e)?{value:e,delivered:!1}:Te(e)&&Ee(e.value)&&J_.test(e.value)?{value:e.value,delivered:!0===e.delivered}:void 0}Tu(t,e,i,r){if(this.persistence){this.persistence.refreshKey(M);var n=this.Cu();if(!r){if(i)return Ee(e)&&J_.test(e)?(e!==(null==n?void 0:n.value)&&this.persistence.register({[M]:{value:e,delivered:!1}}),{value:e,pending:e!==(null==n?void 0:n.value)||!n.delivered}):void this.persistence.unregister(M);if(Ee(t)&&Z_.test(t)){if((null==n?void 0:n.value.split(".")[3])===t)return{value:n.value,pending:!n.delivered};var s="fb.1."+Date.now()+"."+t;return this.persistence.register({[M]:{value:s,delivered:!1}}),{value:s,pending:!0}}return n?{value:n.value,pending:!n.delivered}:void 0}this.persistence.unregister(M)}}Mu(t){if(this.persistence){this.persistence.refreshKey(M);var e=this.Cu();(null==e?void 0:e.value)!==t||e.delivered||this.persistence.register({[M]:{value:t,delivered:!0}})}}capture(t,e,i){var r,s,o,a,l,u,h,d,v,c;if(this.__loaded&&this.persistence&&this.sessionPersistence&&this.au){if(this.is_capturing())if(!Ie(t)&&Ee(t)){this.Gl();var f=!this.config.opt_out_useragent_filter&&this._is_bot();if(!f||this.config.__preview_capture_bot_pageviews){var p=null!=i&&i.skip_client_rate_limiting?void 0:this.rateLimiter.clientRateLimitContext();if(null==p||!p.isRateLimited){var g;null!=e&&e.$current_url&&!Ee(null==e?void 0:e.$current_url)&&(xn.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.Iu||xn.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&&(g=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 m=new Date,y=(null==i?void 0:i.timestamp)||m,b=sr(null==i?void 0:i.uuid,Kf),_={uuid:b,event:t,properties:this.calculateEventProperties(t,e||{},y,b)};"$pageview"===t&&this.config.__preview_capture_bot_pageviews&&f&&(_.event="$bot_pageview",_.properties.$browser_type="bot"),p&&(_.properties.$lib_rate_limit_remaining_tokens=p.remainingTokens);var w="$feature_flag_called"===t&&!1===_.properties.$feature_flag_has_experiment&&!0===this.get_property("$minimal_flag_called_events");null!=i&&i.$set&&!w&&(_.$set=null==i?void 0:i.$set);var k=Te(null==e?void 0:e.$set)?e.$set:void 0,S=!(null==i||!i.$set)&&"$fbc"in i.$set,x=S||!!k&&"$fbc"in k,C=S?null==i||null==(r=i.$set)?void 0:r[T]:null==k?void 0:k[T],M=xe(null==e?void 0:e.$unset)?e.$unset:[],I=(null==i?void 0:i.$unset)||[],E=-1!==M.indexOf("$fbc")||-1!==I.indexOf("$fbc"),R=this.Tu(null==(s=g)?void 0:s.fbclid,C,x,E);R&&!0===_.properties.$process_person_profile&&R.pending&&!x&&!w&&(_.$set=n({[T]:R.value},_.$set));var A=null==i?void 0:i.$unset;A&&(_.$unset=A);var P=w?void 0:this.Eu(null==i?void 0:i.$set_once,t!==le,t===ae);if(P&&(_.$set_once=P),null!=i&&i._noTruncate||(h=this.config.properties_string_max_length,d=_,v=t=>Ee(t)?t.slice(0,h):t,c=new Set,_=function t(e,i){if(e!==Object(e))return v?v(e):e;if(!c.has(e)){var r;if(c.add(e),xe(e))r=[],Tn(e,e=>{r.push(t(e))});else{var n={};Mn(e,(e,i)=>{c.has(e)||(n[i]=t(e,i))}),r=n}return r}}(d)),_.timestamp=y,Ie(null==i?void 0:i.timestamp)||(_.properties.$event_time_override_provided=!0,_.properties.$event_time_override_system_time=m),w&&(_.properties=function(t,e){void 0===e&&(e=[]);var i={},r=e=>{void 0!==t[e]&&(i[e]=t[e])};return Wr.forEach(r),e.forEach(r),i}(_.properties,Q_)),t===xf||t===Cf){var F=null==e?void 0:e[Tf],O=null==e?void 0:e[If];Hf({id:F,current_iteration:O}),_.$set=n({},_.$set,{[aa({id:F,current_iteration:O},t===Cf?"responded":"dismissed")]:!0})}else t===Sf&&(_.$set=n({},_.$set,{[Ff]:(new Date).toISOString()}));if("product tour shown"===t){var D=null==e?void 0:e.$product_tour_type;D&&(_.$set=n({},_.$set,{["$product_tour_last_seen_date/"+D]:(new Date).toISOString()}))}var L=n({},_.properties.$set,_.$set);if(Me(L)||this.setPersonPropertiesForFlags(L),!Pe(this.config.before_send)){var N=this.ds(_);if(!N)return;(_=N).uuid=sr(_.uuid,Kf)}var q=null!==(o=null==(a=_.$set)?void 0:a.$fbc)&&void 0!==o?o:Te(null==(l=_.properties)?void 0:l.$set)?_.properties.$set.$fbc:void 0,j=null!=R&&R.pending&&q===R.value?R.value:void 0;this.Ll.emit("eventCaptured",_);var B=null!==(u=null==i?void 0:i._url)&&void 0!==u?u:this.requestRouter.endpointFor("api",this.analyticsDefaultEndpoint),H=n({method:"POST",url:B,data:_,compression:"best-available",timestampMode:"recordings"===(null==i?void 0:i._batchKey)||/\/s\/(?:\?|$)/.test(B)?"body":"capture-body",batchKey:null==i?void 0:i._batchKey},null!=i&&i.transport?{transport:i.transport}:{},j?{fireCallbackOnDrop:!0,callback:t=>{t.statusCode>=200&&300>t.statusCode&&this.Mu(j)}}:{});return!this.config.request_batching||i&&(null==i||!i._batchKey)||null!=i&&i.send_instantly||j?this.lu(H):this.au.enqueue(H),_}xn.critical("This capture call is ignored due to client rate limiting.")}}else xn.error("No event name provided to posthog.capture")}else xn.uninitializedWarning("posthog.capture")}_addCaptureHook(t){return this.on("eventCaptured",e=>t(e.event,e))}getExtension(t){var e;return null==(e=this._u)?void 0:e.getExtension(t)}gu(){var t;return null!==(t=this._u)&&void 0!==t?t:this._u=new j_(this)}ql(t){this.Yl.push(t);var e=!0;return()=>{if(e){e=!1;var i=this.Yl.indexOf(t);-1!==i&&this.Yl.splice(i,1)}}}Ru(t){var e,i,r;return void 0===t&&(t=!0),!(null==(e=this.persistence)||!e.consumeCookieIdentityChange())&&(this.ru=null,"anonymous"===this.persistence.get_property("$user_state")&&(null==(r=this.sessionPersistence)||r.clear(),this.Kl.clear(),this.Au()),null==(i=this.featureFlags)||i.reset(),t&&this.reloadFeatureFlags(),!0)}calculateEventProperties(t,e,i,r,s){if(i=i||new Date,!this.persistence||!this.sessionPersistence)return e;this.persistence.syncCookieProperties(),this.Ru();var o=s?void 0:this.persistence.remove_event_timer(t),l=n({},e);if(l.token=this.config.token,l.$config_defaults=this.config.defaults,this.zl()&&(l[qt]=!0),"$snapshot"===t){var u=n({},this.persistence.properties(),this.sessionPersistence.properties());return l.distinct_id=u.distinct_id,(!Ee(l.distinct_id)&&!Fe(l.distinct_id)||Re(l.distinct_id))&&xn.error("Invalid distinct_id for replay event. This indicates a bug in your implementation"),l}var v,c=function(t,e,i,r){var n,s,o,l;if(void 0===r&&(r=!1),!g)return{};var u,h=t?[...Ia,...e||[]]:[],v=Gi(g),c=v[0],f=v[1],p=function(t){for(var e=0;Ki.length>e;e++){var i,r=Ki[e],n=r[1],s=r[2],o=t.match(r[0]);if(o)return[n,(null==(i=s&&t.match(s)||o)?void 0:i[1])||""]}return["",""]}(g),m=p[0],y=p[1],b=null!=(u="u">typeof navigator?navigator:void 0)&&u.brave?{brave:!0}:{},_={};Ie(i)||(_.detectGoogleSearchApp=i);var w={},k=null==(n=navigator)||null==(n=n.userAgentData)?void 0:n.platform,S=null==(s=navigator)?void 0:s.maxTouchPoints,x=null==a||null==(o=a.screen)?void 0:o.width,C=null==a||null==(l=a.screen)?void 0:l.height,T=null==a?void 0:a.devicePixelRatio;Ie(k)||(w.userAgentDataPlatform=k),Ie(S)||(w.maxTouchPoints=S),Ie(x)||(w.screenWidth=x),Ie(C)||(w.screenHeight=C),Ie(T)||(w.devicePixelRatio=T);var M,I=In(Pn({$os:c,$os_version:f,$browser:zi(g,navigator.vendor,b,_),$webview_app:m,$webview_app_version:y,$device:Zi(g),$device_type:Ji(g,w),$timezone:ja(),$timezone_offset:Ba()}),{$current_url:Hn(r?ar(null==d?void 0:d.href):null==d?void 0:d.href,h,Ra),$host:null==d?void 0:d.host,$pathname:null==d?void 0:d.pathname,$raw_user_agent:g.length>1e3?g.substring(0,997)+"...":g,$browser_version:Wi(g,navigator.vendor,b,_),$browser_language:$a(),$browser_language_prefix:(M=$a(),"string"==typeof M?M.split("-")[0]:void 0),$screen_height:null==a?void 0:a.screen.height,$screen_width:null==a?void 0:a.screen.width,$viewport_height:null==a?void 0:a.innerHeight,$viewport_width:null==a?void 0:a.innerWidth,$lib:kn.LIB_NAME,$lib_version:kn.LIB_VERSION,$insert_id:Math.random().toString(36).substring(2,10)+Math.random().toString(36).substring(2,10),$time:Date.now()/1e3});return kn.SDK_DIST_CHANNEL&&(I.$sdk_dist_channel=kn.SDK_DIST_CHANNEL),I}(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(s,i.getTime(),!0),p=f.windowId;l.$session_id=f.sessionId,l.$window_id=p}this.sessionPropsManager&&In(l,this.sessionPropsManager.getSessionProps());try{var m;this.sessionRecording&&In(l,this.sessionRecording.sdkDebugProperties),l.$sdk_debug_retry_queue_size=null==(m=this.uu)?void 0:m.length}catch(t){l.$sdk_debug_error_capturing_properties=String(t)}if(this.requestRouter.region===E_&&(l.$lib_custom_api_host=this.config.api_host),v="$pageview"!==t||s?"$pageleave"!==t||s?this.pageViewManager.doEvent():this.pageViewManager.doPageLeave(i):this.pageViewManager.doPageView(i,r),l=In(l,v),"$pageview"===t&&h&&(l.title=h.title),!Ie(o)){var y=i.getTime()-o;l.$duration=parseFloat((y/1e3).toFixed(3))}g&&this.config.opt_out_useragent_filter&&(l.$browser_type=this._is_bot()?"bot":"browser");var b=this.persistence.properties(),_=this.sessionPersistence.properties(),w=l.$groups,k=b.$groups;Te(w)&&!Me(w)&&(l.$groups=n({},Te(k)?k:{},w)),Mn(["$referrer","$referring_domain"],t=>{t in b&&delete _[t]});var S={};if(this.Yl.length>0)for(var x of this.Yl.slice())try{In(S,x())}catch(t){xn.error("Failed to produce browser extension event properties",t)}(l=In({},c,b,_,n({},S,l))).$is_identified=this._isIdentified(),xe(this.config.property_denylist)?Mn(this.config.property_denylist,function(t){delete l[t]}):xn.error(G_+this.config.property_denylist+" or property_blacklist config: "+this.config.property_blacklist);var C=this.config.sanitize_properties;C&&(xn.error(V_),l=C(l,t));var T=this.Pu();return l.$process_person_profile=T,T&&!s&&this.Fu("_calculate_event_properties"),l}Eu(t,e,i){var r;if(void 0===e&&(e=!0),void 0===i&&(i=!1),!this.persistence||!this.Pu())return t;if(this.Ql&&!i)return t;var n=In({},this.persistence.get_initial_props(),(null==(r=this.sessionPropsManager)?void 0:r.getSetOnceProps())||{},t||{}),s=this.config.sanitize_properties;return s&&(xn.error(V_),n=s(n,"$set_once")),e&&(this.Ql=!0),Me(n)?void 0:n}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.Ru(),null==(i=this.sessionPersistence)||i.register(t),Object.keys(t).forEach(t=>this.Kl.add(t)),this.Au()}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.Kl.delete(t),this.Au()}Ou(t,e){this.register({[t]:e})}hu(){this.Kl.forEach(t=>{var e;null==(e=this.sessionPersistence)||e.unregister(t)}),this.Kl.clear(),this.Au()}Au(){var t;if(this.Xl)if("memory"===this.config.persistence||null!=(t=this.sessionPersistence)&&t.Bo||!yp.si())yp.hi(this.Xl);else{var e=[];this.Kl.forEach(t=>e.push(t)),e.length>0?yp.ui(this.Xl,e):yp.hi(this.Xl)}}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.Ll.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:W_}),()=>{})}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:W_})}getActiveMatchingSurveys(t,e){void 0===e&&(e=!1),this.surveys?this.surveys.getActiveMatchingSurveys(t,e):t([],{isLoaded:!1,error:W_})}renderSurvey(t,e){var i;null==(i=this.surveys)||i.renderSurvey(t,e)}displaySurvey(t,e){var i;void 0===e&&(e=Uf),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:W_}}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:W_})}$u(t){return!t||Re(t)?(xn.critical("Unique user id has not been set in posthog.identify"),!1):"$posthog_cookieless"===t?(xn.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())||(xn.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 xn.uninitializedWarning("posthog.identify");if(Fe(t)&&(t=t.toString(),xn.warn("The first argument to posthog.identify was a number, but it should be a string. It has been converted to a string.")),this.$u(t)&&this.Fu("posthog.identify")){this.Gl();var r=this.get_distinct_id(),n=this.persistence.syncCookieProperties()&&this.get_distinct_id()!==r,s=this.Ru(!1),o=this.persistence.oa(),a=!1;try{var l=this.get_distinct_id();this.register({$user_id:t}),this.get_property("$device_id")||this.register_once({$had_persisted_distinct_id:!0,$device_id:l},""),t!==l&&t!==this.get_property("__alias")&&(this.unregister(x),this.register({distinct_id:t}));var u=(this.persistence.get_property("$user_state")||"anonymous")===te,h=t!==l,d=!h&&u;if(h&&u){var v,c=this.config.reuseAnonymousId?{distinct_id:t}:{distinct_id:t,$anon_distinct_id:l};this.persistence.set_property(At,ee),this.setPersonPropertiesForFlags({$set:e||{},$set_once:i||{}},!1),this.config.cookieWinsOnConflict&&this.persistence.aa(),this.capture(ae,c,{$set:e||{},$set_once:i||{}}),this.ru=ba(t,e,i),null==(v=this.featureFlags)||v.setAnonymousDistinctId(this.config.reuseAnonymousId?void 0:l)}else if(d){this.persistence.set_property(At,ee);var f=e||{},p=i||{};this.setPersonPropertiesForFlags({$set:f,$set_once:p},!1),this.config.cookieWinsOnConflict&&this.persistence.aa(),this.capture("$set",{$set:f,$set_once:p}),this.ru=ba(t,e,i)}else(e||i)&&this.setPersonProperties(e,i);h||n||s?(this.reloadFeatureFlags(),this.featureFlags?this.featureFlags.resetFlagCallReported():this.unregister(Mt)):d&&(e||i)&&this.reloadFeatureFlags(),a=!0}finally{o&&this.persistence.ha(a)}}}setPersonProperties(t,e){if((t||e)&&this.Fu("posthog.setPersonProperties")){var i=ba(this.get_distinct_id(),t,e);this.ru!==i?(this.setPersonPropertiesForFlags({$set:t||{},$set_once:e||{}},!0),this.capture("$set",{$set:t||{},$set_once:e||{}}),this.ru=i):xn.info("A duplicate setPersonProperties call was made with the same properties. It has been ignored.")}}unsetPersonProperties(t){var e,i=(xe(t)?t:[t]).filter(t=>Ee(t)&&t.length>0);0!==i.length&&this.Fu("posthog.unsetPersonProperties")&&(null==(e=this.featureFlags)||e.unsetPersonPropertiesForFlags(i,!0),this.capture("$set",{$unset:i}),this.ru=null)}group(t,e,i){var r;if(t&&e){null==(r=this.persistence)||r.syncCookieProperties(),this.Ru();var s=this.getGroups(),o=s[t]!==e;if(o&&this.resetGroupPropertiesForFlags(t),this.register({$groups:n({},s,{[t]:e})}),(o||i)&&this.Pu()){var a={$group_type:t,$group_key:e};i&&(a.$group_set=i),this.capture(le,a)}i&&this.setGroupPropertiesForFlags({[t]:i}),o&&!i&&this.reloadFeatureFlags()}else xn.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.Fu("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=$e(t)?t:null==t?void 0:t.resetDeviceID,i=$e(t)||null==t?void 0:t.bootstrap;this.Du(e,!1,i)}Du(t,e,i){var r,s,o,a;if(void 0===e&&(e=!1),xn.info("reset"),!this.__loaded)return xn.uninitializedWarning("posthog.reset");var l=null==i?void 0:i.sessionID;this.config.bootstrap=i||(null==(r=this.su)?void 0:r.bootstrap)||{},null==(s=this.featureFlags)||null==s.updateConfig||s.updateConfig(this.config,this.Ma());var u=this.get_property(k),h=this.get_property(S),d=this.get_property(j);null==(o=this.sessionRecording)||o.flushBeforeIdentityReset();var v=this.is_capturing();this.consent.reset(),e||!v||this.is_capturing()||console.warn("[PostHog.js]","reset() cleared the stored consent, and capturing is now off because of `opt_out_capturing_by_default`. Call opt_in_capturing() again, and prefer calling reset() before opting in rather than after.");var c=null==(a=this.persistence)||null==a.oa?void 0:a.oa(),f=!1;try{var p,g,m,y,b,_,w,x,C,T,M,I,E;if(null==(p=this.persistence)||p.clear(),null==(g=this.sessionPersistence)||g.clear(),this.Kl.clear(),this.Au(),Ie(d)||null==(m=this.persistence)||m.register({[j]:d}),null==(y=this.surveys)||y.reset(),null==(b=this.featureFlags)||b.reset(),null==(_=this.conversations)||_.reset(),null==(w=this.logs)||w.reset(),null==(x=this.metrics)||x.reset(),null==(C=this.persistence)||C.set_property(At,te),null==(T=this.sessionManager)||T.resetSessionId(),this.ru=null,"always"===this.config.cookieless_mode)this.register_once({distinct_id:Nt,$device_id:null},"");else{var R=this.config.get_device_id(Kf());this.register_once({distinct_id:R,$device_id:t?R:u},""),t||Ie(h)||this.register({[S]:h})}if(this.register({$last_posthog_reset:(new Date).toISOString()},1),i)if(void 0===i.distinctID||this.zl()||(null==(E=this.persistence)||E.set_property(At,i.isIdentifiedID?ee:te),this.register({distinct_id:i.distinctID})),null==(M=this.featureFlags)||M.initialize(),!(Ie(l)||null!=(I=this.sessionManager)&&I.setBootstrapSessionId(l,!0))){var A=n({},i);delete A.sessionID,this.config.bootstrap=A}delete this.config.identity_distinct_id,delete this.config.identity_hash,delete this.config.identity_claims,f=!0}finally{var P;c&&(null==(P=this.persistence)||null==P.ha||P.ha(f))}this.reloadFeatureFlags()}shutdown(t){var e=this;return o(function*(){var t,i,r,n,s,o,a;if(e.__loaded){e.gu().dispose(),null==(t=e.sessionRecording)||t.dispose(),null==(i=e.logs)||i.flushLogs("sendBeacon"),null==(r=e.metrics)||r.flush("sendBeacon"),null==(n=e.au)||n.unload(),null==(s=e.uu)||s.unload();try{var l;null==(l=e.featureFlags)||l.destroy()}catch(t){xn.error("Error while destroying feature flags",t)}null==(o=e.persistence)||o.destroy(),null==(a=e.sessionPersistence)||a.destroy()}else xn.uninitializedWarning("posthog.shutdown")})()}setIdentity(t,e){var i;delete this.config.identity_claims,this.config.identity_distinct_id=t,this.config.identity_hash=e,this.alias(t),null==(i=this.conversations)||i.Lu()}clearIdentity(){var t;delete this.config.identity_distinct_id,delete this.config.identity_hash,delete this.config.identity_claims,null==(t=this.conversations)||t.Nu()}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("$people_distinct_id")?(xn.critical("Attempting to create alias for existing People user - aborting."),-2):this.Fu("posthog.alias")?(Ie(e)&&(e=this.get_distinct_id()),t!==e?(this.Ou(x,t),this.capture("$create_alias",{alias:t,distinct_id:e})):(xn.warn("alias matches current distinct_id - skipping api call."),this.identify(t),-1)):void 0}set_config(t){var e=n({},this.config);if(Te(t)){var i,r,s,o,a,l,u,h,d,v,c,f,p;In(this.config,iw(t));var g=this.Zl();null==(i=this.persistence)||i.update_config(this.config,e,g),this.sessionPersistence="sessionStorage"===this.config.persistence||"memory"===this.config.persistence?this.persistence:new Xb(n({},this.config,{persistence:"sessionStorage"}),g,!1);var m=this.nu(this.config.debug);$e(m)&&(this.config.debug=m),$e(this.config.debug)&&(this.config.debug?(ea.DEBUG=!0,np.si()&&np.ui("ph_debug",!0),xn.info("set_config",{config:t,oldConfig:e,newConfig:n({},this.config)})):(ea.DEBUG=!1,np.si()&&np.hi("ph_debug"))),null==(r=this.featureFlags)||null==r.updateConfig||r.updateConfig(this.config,this.Ma()),null==(s=this.exceptionObserver)||s.onConfigChange(),null==(o=this.exceptions)||o.onConfigChange(),null==(a=this.sessionRecording)||a.startIfEnabledOrStop(),null==(l=this.tracingHeaders)||l.startIfEnabledOrStop(),null==(u=this.autocapture)||u.startIfEnabled(),null==(h=this.heatmaps)||h.startIfEnabled(),("capture_pageview"in t||"disable_capture_url_hashes"in t)&&(null==(d=this.historyAutocapture)||d.startIfEnabledOrStop()),null==(v=this.exceptionObserver)||v.startIfEnabledOrStop(),null==(c=this.deadClicksAutocapture)||c.startIfEnabledOrStop(),null==(f=this.surveys)||f.loadIfEnabled(),this.Jl(),null==(p=this.externalIntegrations)||p.startIfEnabledOrStop(),!e.segment&&this.config.segment&&this.persistence&&Fb(this,z_,!1)}}_overrideSDKInfo(t,e){ea.LIB_NAME=t,ea.LIB_VERSION=e}startSessionRecording(t){var e,i,r,n,s,o=!0===t,a={sampling:o||!(null==t||!t.sampling),linked_flag:o||!(null==t||!t.linked_flag),url_trigger:o||!(null==t||!t.url_trigger),event_trigger:o||!(null==t||!t.event_trigger)};Object.values(a).some(Boolean)&&(null==(e=this.sessionManager)||e.checkAndGetSessionAndWindowId(),a.sampling&&(null==(i=this.sessionRecording)||i.overrideSampling()),a.linked_flag&&(null==(r=this.sessionRecording)||r.overrideLinkedFlag()),a.url_trigger&&(null==(n=this.sessionRecording)||n.overrideTrigger("url")),a.event_trigger&&(null==(s=this.sessionRecording)||s.overrideTrigger("event"))),this.set_config({disable_session_recording:!1})}stopSessionRecording(){this.set_config({disable_session_recording:!0})}sessionRecordingStarted(){var t;return!(null==(t=this.sessionRecording)||!t.started)}captureException(t,e){try{if(!this.exceptions)return;var i=this.exceptions.buildProperties(t,{handled:!0,syntheticException:new Error("PostHog syntheticException")});return this.exceptions.sendExceptionEvent(n({},i,e))}catch(t){return}}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 e,i;return null!==(e=null==(i=this.logs)?void 0:i.logger)&&void 0!==e?e:t.qu}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:K_;return e!==K_&&(e="posthog."+e),e}_isIdentified(){var t,e;return"identified"===(null==(t=this.persistence)?void 0:t.get_property("$user_state"))||"identified"===(null==(e=this.sessionPersistence)?void 0:e.get_property("$user_state"))}Pu(){var t,e;return!("never"===this.config.person_profiles||"identified_only"===this.config.person_profiles&&!this._isIdentified()&&Me(this.getGroups())&&(null==(t=this.persistence)||null==(t=t.props)||!t.__alias)&&(null==(e=this.persistence)||null==(e=e.props)||!e.$epp))}xu(){return!0===this.config.capture_pageleave||"if_capture_pageview"===this.config.capture_pageleave&&!!this.config.capture_pageview}createPersonProfile(){this.Pu()||this.Fu("posthog.createPersonProfile")&&this.setPersonProperties({},{})}setInternalOrTestUser(){this.Fu("posthog.setInternalOrTestUser")&&this.setPersonProperties({$internal_or_test_user:!0})}Fu(t){return"never"===this.config.person_profiles?(xn.error(t+' was called, but process_person is set to "never". This call will be ignored.'),!1):(this.Ul(),this.Ou(Lt,!0),!0)}Zl(){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&&"on_reject"!==this.config.cookieless_mode)}Jl(){var t,e,i,r,n,s=this.Zl();return this.is_capturing()||null==(t=this.logs)||t.ju(),(null==(e=this.persistence)?void 0:e.Bo)!==s&&(null==(i=this.persistence)||i.set_disabled(s)),(null==(r=this.sessionPersistence)?void 0:r.Bo)!==s&&(null==(n=this.sessionPersistence)||n.set_disabled(s)),s&&(this.Kl.clear(),this.Au()),s}opt_in_capturing(e){var i,r,n;if("always"!==this.config.cookieless_mode){if(this.zl()){var s,o,a,l,u,h;null==(s=this.sessionRecording)||s.dispose({discardBufferedEvents:!0}),this.Du(!0,!0),null==(o=this.sessionManager)||o.destroy(),null==(a=this.pageViewManager)||a.destroy(),this.sessionManager=new T_(this),this.pageViewManager=new Lb(this),this.persistence&&(this.sessionPropsManager=new k_(this,this.sessionManager,this.persistence));var d,v=null!==(l=null==(u=this.config.__extensionClasses)?void 0:u.sessionRecording)&&void 0!==l?l:null==(h=t.__defaultExtensionClasses)?void 0:h.sessionRecording;v&&(this.sessionRecording=this.Hl(this.sessionRecording,new v(this)),this.Dl&&(null==(d=this.sessionRecording)||null==d.onRemoteConfig||d.onRemoteConfig(this.Dl)))}this.consent.optInOut(!0),this.Jl(),this.wu(),null==(i=this.sessionRecording)||i.startIfEnabledOrStop(),"on_reject"==this.config.cookieless_mode&&(null==(r=this.surveys)||r.loadIfEnabled()),(Ie(null==e?void 0:e.captureEventName)||null!=e&&e.captureEventName)&&this.capture(null!==(n=null==e?void 0:e.captureEventName)&&void 0!==n?n:"$opt_in",null==e?void 0:e.captureProperties,{send_instantly:!0}),this.config.capture_pageview&&this.ku()}else xn.warn(U_)}opt_out_capturing(){if("always"!==this.config.cookieless_mode){var t,e,i="on_reject"===this.config.cookieless_mode?this.sessionRecording:void 0;null==i||i.dispose({discardBufferedEvents:!0}),"on_reject"===this.config.cookieless_mode&&this.consent.isOptedIn()&&this.Du(!0,!0),this.consent.optInOut(!1),this.Jl(),"on_reject"===this.config.cookieless_mode&&(this.register({distinct_id:Nt,$device_id:null}),this.Bl(i),this.sessionRecording=void 0,null==(t=this.sessionManager)||t.destroy(),null==(e=this.pageViewManager)||e.destroy(),this.sessionManager=void 0,this.sessionPropsManager=void 0,this.config.capture_pageview&&this.ku(),this.wu())}else xn.warn(U_)}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"always"===this.config.cookieless_mode||("on_reject"===this.config.cookieless_mode?this.consent.isRejected()||this.consent.isOptedIn():!this.has_opted_out_capturing())}clear_opt_in_out_capturing(){this.consent.reset(),this.Jl()}_is_bot(){return u?M_(u,this.config.custom_blocked_useragents):void 0}ku(){h&&("visible"===h.visibilityState?this.tu||(this.tu=!0,this.capture(se,{title:h.title},{send_instantly:!0}),this.eu&&(h.removeEventListener(re,this.eu),this.eu=null)):this.eu||(this.eu=this.ku.bind(this),$n(h,re,this.eu)))}debug(t){!1===t?(null==a||a.console.log("You've disabled debug mode."),this.set_config({debug:!1})):(null==a||a.console.log("You're now in debug mode. All calls to PostHog will be logged in your console.\nYou can disable this with `posthog.debug(false)`."),this.set_config({debug:!0}))}Ma(){var t=this.su||{};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?(xn.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&&!Pe(t[e]),o=i in t&&!Pe(t[i]);return s?t[e]:!!o&&(n&&n.warn("Config field '"+i+"' is deprecated. Please use '"+e+"' instead. The old field will be removed in a future major version."),t[i])}(t,"advanced_disable_flags","advanced_disable_decide",0,xn)}ds(t){var e;if(Pe(this.config.before_send))return t;var i=Object.keys(null!==(e=t.properties)&&void 0!==e?e:{}).filter(Ne),r=xe(this.config.before_send)?this.config.before_send:[this.config.before_send],n=t;for(var s of r)try{if(n=s(n),Pe(n)){var o="Event '"+t.event+"' was rejected in beforeSend function";return Le(t.event)?xn.warn(o+". This can cause unexpected behavior."):xn.info(o),null}n.properties&&!Me(n.properties)||xn.warn("Event '"+t.event+"' has no properties after beforeSend function, this is likely an error.")}catch(e){return xn.error("Error in beforeSend function for event '"+t.event+"':",e),null}for(var a of i)if(n.properties&&Pe(n.properties[a]))return xn.warn("Event '"+t.event+"' had its '"+a+"' property removed in a beforeSend function. This property is required for ingestion, so the event will be dropped."),null;return n}getPageViewId(){var t;return null==(t=this.pageViewManager.fo)?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)})}nu(t){var e=$e(t)&&!t,i=np.si()&&"true"===np.li("ph_debug");return!e&&(!!i||t)}},s.__defaultExtensionClasses={},s.qu=(()=>{var t=()=>{};return{trace:t,debug:t,info:t,warn:t,error:t,fatal:t}})(),s);!function(t,e){for(var i=0;e.length>i;i++)t.prototype[e[i]]=An(t.prototype[e[i]])}(nw,["identify"]);var sw=class{constructor(t){this._instance=t}refresh(t){var e=this._instance.config,i=Te(e.autocapture)?e.autocapture:void 0;t.enabled=!!e.autocapture,t.rageclick=e.rageclick,t.maskAllElementAttributes=e.mask_all_element_attributes,t.maskAllText=e.mask_all_text,t.disableCaptureUrlHashes=e.disable_capture_url_hashes,t.getCurrentUrl=e.get_current_url,t.remoteRequestsDisabled=this._instance.Ma(),t.url_allowlist=null==i?void 0:i.url_allowlist,t.url_ignorelist=null==i?void 0:i.url_ignorelist,t.dom_event_allowlist=null==i?void 0:i.dom_event_allowlist,t.element_allowlist=null==i?void 0:i.element_allowlist,t.css_selector_allowlist=null==i?void 0:i.css_selector_allowlist,t.css_selector_ignorelist=null==i?void 0:i.css_selector_ignorelist,t.element_attribute_ignorelist=null==i?void 0:i.element_attribute_ignorelist,t.capture_copied_text=null==i?void 0:i.capture_copied_text}},ow=Cn("[ExceptionAutocapture]"),aw=Cn("[TracingHeaders]"),lw=Cn("[Web Vitals]"),uw=9e5,hw=["CLS","FCP","INP","LCP"],dw=["INP","LCP"],vw=["interactionTarget","interactionType","inputDelay","processingDuration","presentationDelay","loadState","target","url","timeToFirstByte","resourceLoadDelay","resourceLoadDuration","elementRenderDelay","largestShiftTarget","largestShiftTime","largestShiftValue","firstByteToFCP"],cw=Cn("[SessionRecording]"),fw=Cn("[Heatmaps]");function pw(t){return Te(t)&&"clientX"in t&&"clientY"in t&&Fe(t.clientX)&&Fe(t.clientY)}var gw=Cn("[Product Tours]"),mw=t=>{var e;return!t.config.disable_product_tours&&!(null==(e=t.persistence)||!e.get_property(L))},yw=Cn("[SiteApps]"),bw="Error while initializing PostHog app with config id ",_w=(t,e)=>null!=t&&t.then?t.then(e):e(t),ww="SDK is not enabled or survey functionality is not yet loaded",kw="Disabled. Not loading surveys.",Sw=class{constructor(t,e){this.Us=t,this.Bu=e,this.name="surveys",this._surveyEventReceiver=null,this._surveyManager=null,this.Hu=!1,this.zu=[],this.Uu=null,this.Wu=null,this.Js=!1,this.Vu=new Set,this.onRemoteConfig=t=>{if(!this.Js&&!this._n.disableSurveys){if(!t.ok)return Lf.warn("Remote config unavailable. Not loading surveys.");var e=t.config.surveys;if(Pe(e))return Lf.warn("Flags not loaded yet. Not loading surveys.");this.Gu=$e(e)?e:e.length>0,Lf.info("flags response received, isSurveysEnabled: "+this.Gu),this.loadIfEnabled()}}}setup(t){if(!this.Js)return this.Zu=t,_w(t.kv.initialize(),()=>{if(this.Zu===t&&!this.Js){this.Zu=void 0,this.Hs=t;var e=t.onRemoteConfig(this.onRemoteConfig);this.Js?e.dispose():(this.Xs=e,this.loadIfEnabled())}})}dispose(){var t,e,i;this.Js||(this.Js=!0,this.Zu=void 0,this.Hs=void 0,null==(t=this.Xs)||t.dispose(),this.Xs=void 0,null==(e=this._surveyEventReceiver)||e.dispose(),this._surveyEventReceiver=null,null==(i=this._surveyManager)||null==i.dispose||i.dispose(),this._surveyManager=null,this.zu=[],this.Uu=null,this.Vu.forEach(t=>clearTimeout(t)),this.Vu.clear())}get _n(){return this.Us.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("seenSurvey_")||null!=r&&r.startsWith("inProgressSurvey_"))&&e.push(r)}e.forEach(t=>localStorage.removeItem(t))}catch(t){}}loadIfEnabled(){if(!this.Js&&this.Hs){var t=this._n;if(!this._surveyManager)if(this.Hu)Lf.info("Already initializing surveys, skipping...");else if(t.disableSurveys)Lf.info(kw);else if(t.cookielessMode&&this.Us.isOptedOut())Lf.info("Not loading surveys in cookieless mode without consent.");else{var e=this.Us.getExtensions();if(e){if(!Ie(this.Gu)||t.advancedEnableSurveys){var i=this.Gu||t.advancedEnableSurveys;this.Hu=!0;try{var r=e.generateSurveys;if(r)return this.Ju(r,i),void(this.Hu=!1);var n=e.loadExternalDependency;if(!n)return this.Qu(Yt),void(this.Hu=!1);n(t=>{try{if(this.Js)return;var e=this.Us.getExtensions();t||null==e||!e.generateSurveys?this.Qu("Could not load surveys script",t):this.Ju(e.generateSurveys,i)}finally{this.Hu=!1}})}catch(t){throw this.Hu=!1,this.Qu("Error initializing surveys",t),t}}}else Lf.error("PostHog Extensions not found.")}}}Ju(t,e){this.Js||(this._surveyManager=t(e),this._surveyEventReceiver=this.Us.createEventReceiver(),Lf.info("Surveys loaded successfully"),this.Ku({isLoaded:!0}))}Qu(t,e){Lf.error(t,e),this.Ku({isLoaded:!1,error:t})}onSurveysLoaded(t){return this.zu.push(t),this._surveyManager&&this.Ku({isLoaded:!0}),()=>{this.zu=this.zu.filter(e=>e!==t)}}getSurveys(t,e){var i;void 0===e&&(e=!1);var r=null!==(i=this.Hs)&&void 0!==i?i:this.Bu;if(r&&!this.Js){if(this._n.disableSurveys)return Lf.info(kw),t([]);var n=r.kv.get(pt);if(n&&!e)return t(n,{isLoaded:!0}),void(this.Xu()&&this.getSurveys(()=>{},!0));if(this.Uu)this.Uu.then(e=>{this.Js||t(e.surveys,e.context)}).catch(t=>Lf.error("Error in survey callback",t));else{var s=this.Yu("/api/surveys/",{method:"GET",query:{token:r.projectToken},sentAt:"query",timeoutMs:this._n.requestTimeoutMs}).then(t=>{try{return this.th(r,t)}catch(t){return Lf.error("Error processing surveys response",t),this.th(r,{statusCode:0,error:t})}},t=>this.th(r,{statusCode:0,error:t}));this.Uu=s;var o=()=>{this.Uu===s&&(this.Uu=null)};s.then(e=>{o(),this.Js||t(e.surveys,e.context)},o).catch(t=>Lf.error("Error in survey callback",t))}}}Yu(t,e){var i=this.Hs;return i?i.sendRequest(t,e):new Promise(t=>t({statusCode:0,error:new Error(ww)}))}th(t,e){var i;if(this.Js)return{surveys:[],context:{isLoaded:!1,error:ww}};var r=e.statusCode;if(200!==r||!e.json){var n="Surveys API could not be loaded, status: "+r;return 0!==r?Lf.error(n):e.error||Lf.warn(n),this.Wu=Date.now(),{surveys:[],context:{isLoaded:!1,error:n}}}this.Wu=null;var s=e.json.surveys||[],o=s.filter(t=>Nf(t)&&(ca(t)||qf(t)));return o.length>0&&(null==(i=this._surveyEventReceiver)||i.register(o)),t.kv.set({[pt]:s,[gt]:Date.now()}),{surveys:s,context:{isLoaded:!0}}}Xu(){return this.eh()&&!this.Uu&&!this.ih()}eh(){var t,e,i=null==(t=null!==(e=this.Hs)&&void 0!==e?e:this.Bu)?void 0:t.kv.get(gt);return Fe(i)&&Date.now()-i>3e5}ih(){return Fe(this.Wu)&&3e5>Date.now()-this.Wu}markSurveyAsSeen(t,e){var i;Hf({id:t,current_iteration:null!==(i=null==e?void 0:e.iteration)&&void 0!==i?i:null});try{localStorage.setItem("lastSeenSurveyDate",(new Date).toISOString())}catch(t){}}Ku(t){for(var e of this.zu)try{if(!t.isLoaded)return e([],t);this.getSurveys(e)}catch(t){Lf.error("Error in survey callback",t)}}getActiveMatchingSurveys(t,e){if(void 0===e&&(e=!1),!Pe(this._surveyManager))return this._surveyManager.getActiveMatchingSurveys(t,e);Lf.warn("init was not called")}rh(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}nh(t){if(Pe(this._surveyManager))return{eligible:!1,reason:ww};var e="string"==typeof t?this.rh(t):t;return e?this._surveyManager.checkSurveyEligibility(e):{eligible:!1,reason:"Survey not found"}}sh(t){if(Pe(this._surveyManager))return{eligible:!1,reason:ww};var e="string"==typeof t?this.rh(t):t;return e?this._surveyManager.checkSurveyRenderability(e):{eligible:!1,reason:"Survey not found"}}canRenderSurvey(t){if(Pe(this._surveyManager))return Lf.warn("init was not called"),{visible:!1,disabledReason:ww};var e=this.sh(t);return{visible:e.eligible,disabledReason:e.reason}}canRenderSurveyAsync(t,e){return Pe(this._surveyManager)?(Lf.warn("init was not called"),Promise.resolve({visible:!1,disabledReason:ww})):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.sh(n);i({visible:s.eligible,disabledReason:s.reason})}else i({visible:!1,disabledReason:"Survey not found"})},e)})}renderSurvey(t,e,i){var r;if(Pe(this._surveyManager))Lf.warn("init was not called");else{var n="string"==typeof t?this.rh(t):t;if(null!=n&&n.id)if(zf.includes(n.type)){var s=null==h?void 0:h.querySelector(e);if(s)if(null!=(r=n.appearance)&&r.surveyPopupDelaySeconds){Lf.info("Rendering survey "+n.id+" with delay of "+n.appearance.surveyPopupDelaySeconds+" seconds");var o=setTimeout(()=>{var t,e;this.Vu.delete(o),this.Js||(Lf.info("Rendering survey "+n.id+" with delay of "+(null==(t=n.appearance)?void 0:t.surveyPopupDelaySeconds)+" seconds"),null==(e=this._surveyManager)||e.renderSurvey(n,s,i),Lf.info("Survey "+n.id+" rendered"))},1e3*n.appearance.surveyPopupDelaySeconds);this.Vu.add(o)}else this._surveyManager.renderSurvey(n,s,i);else Lf.warn("Survey element not found")}else Lf.warn("Surveys of type "+n.type+" cannot be rendered in the app");else Lf.warn("Survey not found")}}displaySurvey(t,e){var i;if(Pe(this._surveyManager))Lf.warn("init was not called");else{var r=this.rh(t);if(r){var s=r;if(null!=(i=r.appearance)&&i.surveyPopupDelaySeconds&&e.ignoreDelay&&(s=n({},r,{appearance:n({},r.appearance,{surveyPopupDelaySeconds:0})})),e.displayType!==$f&&e.initialResponses&&Lf.warn("initialResponses is only supported for popover surveys. prefill will not be applied."),!1===e.ignoreConditions){var o=this.nh(r);if(!o.eligible)return void Lf.warn("Survey is not eligible to be displayed: ",o.reason)}"inline"!==e.displayType?this._surveyManager.handlePopoverSurvey(s,e):this.renderSurvey(s,e.selector,e.properties)}else Lf.warn("Survey not found")}}cancelPendingSurvey(t){Pe(this._surveyManager)?Lf.warn("init was not called"):this._surveyManager.cancelSurvey(t)}handlePageUnload(){var t;null==(t=this._surveyManager)||null==t.handlePageUnload||t.handlePageUnload()}};function xw(t,e,i){if(Pe(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}}var Cw=class{constructor(t){this._instance=t,this.oh=new Set,this.ah=new Set,this.uh=new S_,this.hh=(t,e)=>this.dh(t,e)&&this.fh(t,e)&&this.ph(t,e)&&this.gh(t,e),this.dh=(t,e)=>null==e||!e.event||(null==t?void 0:t.event)===(null==e?void 0:e.event)}init(){var t,e;Ie(null==(t=this._instance)?void 0:t._addCaptureHook)||(this.mh=null==(e=this._instance)?void 0:e._addCaptureHook((t,e)=>{this.on(t,e)}))}dispose(){var t;null==(t=this.mh)||t.call(this),this.mh=void 0,this.uh=new S_}register(t){var e,i;if(!Ie(null==(e=this._instance)?void 0:e._addCaptureHook)&&(t.forEach(t=>{var e;this.oh.add(t),null==(e=t.steps)||e.forEach(t=>{this.ah.add((null==t?void 0:t.event)||"")})}),null!=(i=this._instance)&&i.autocapture)){var r=new Set;this.oh.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.oh.clear(),this.ah.clear(),this.register(t)}on(t,e){null!=e&&0!=t.length&&(this.ah.has(t)||this.ah.has(e.event))&&this.oh.forEach(t=>{this.yh(e,t)&&this.uh.emit("actionCaptured",t.name)})}bh(t){this.onAction("actionCaptured",e=>t(e))}yh(t,e){if(null==(null==e?void 0:e.steps))return!1;for(var i of e.steps)if(this.hh(t,i))return!0;return!1}onAction(t,e){return this.uh.on(t,e)}fh(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(!xw(r,e.url,e.url_matching||"contains"))return!1}return!0}ph(t,e){return!!this._h(t,e)&&!!this.wh(t,e)&&!!this.kh(t,e)}_h(t,e){var i;if(null==e||!e.href)return!0;var r=this.Sh(t);if(r.length>0)return r.some(t=>xw(t.href,e.href,e.href_matching||"exact"));var n,s=(null==t||null==(i=t.properties)?void 0:i.$elements_chain)||"";return!!s&&xw((n=s.match(/(?::|")href="(.*?)"/))?n[1]:"",e.href,e.href_matching||"exact")}wh(t,e){var i;if(null==e||!e.text)return!0;var r=this.Sh(t);if(r.length>0)return r.some(t=>xw(t.text,e.text,e.text_matching||"exact")||xw(t.$el_text,e.text,e.text_matching||"exact"));var n,s,o,a=(null==t||null==(i=t.properties)?void 0:i.$elements_chain)||"";return!!a&&(n=function(t){for(var e,i=[],r=/(?::|")text="(.*?)"/g;!Pe(e=r.exec(t));)i.includes(e[1])||i.push(e[1]);return i}(a),s=e.text,o=e.text_matching||"exact",n.some(t=>xw(t,s,o)))}kh(t,e){var i,r;if(null==e||!e.selector)return!0;if(null!=t&&null!=(i=t.properties)&&null!=(i=i.$element_selectors)&&i.includes(e.selector))return!0;var n=(null==t||null==(r=t.properties)?void 0:r.$elements_chain)||"";if(e.selector_regex&&n)try{return new RegExp(e.selector_regex).test(n)}catch(t){return!1}return!1}Sh(t){var e;return null==(null==t||null==(e=t.properties)?void 0:e.$elements)?[]:null==t?void 0:t.properties.$elements}gh(t,e){return null==e||!e.properties||0===e.properties.length||ya(e.properties.reduce((t,e)=>{var i=xe(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)}},Tw=class{constructor(t){var e;this.xh=[],this._instance=t,this.Ch=new Map,this.Th=new Map,this.Mh=new Map,this.Ih=null==(e=this._instance)||null==e.onSessionId?void 0:e.onSessionId(t=>this.Eh(t))}Rh(t){return!1}Ah(){return null}Ph(t){}Fh(){}Oh(t,e){return!!t&&ya(t.propertyFilters,null==e?void 0:e.properties)}$h(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}Dh(t,e,i){var r=(i===af?this.Ch:this.Th).get(t),n=[];return this.Lh(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.Oh(s,e)})}register(t){this.Nh(t,!1)}replace(t){this.Nh(t,!0)}Nh(t,e){var i;Ie(null==(i=this._instance)?void 0:i._addCaptureHook)||(this.qh(t,e),this.jh(t,e))}jh(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.Mh.clear(),0!==i.length){this.Bh||(this.Bh=new Cw(this._instance),this.Bh.init(),this.Bh.bh(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.Mh.get(e.name))&&void 0!==i?i:[];n.includes(t.id)||n.push(t.id),this.Mh.set(e.name,n)}})}),e?this.Bh.replace(r):this.Bh.register(r)}else{var n;e&&(null==(n=this.Bh)||n.replace([]))}}Hh(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)})}qh(t,e){var i,r,n=t.filter(t=>{var e,i;return(null==(e=t.conditions)?void 0:e.events)&&(null==(i=t.conditions)||null==(i=i.events)||null==(i=i.values)?void 0:i.length)>0}),s=t.filter(t=>{var e,i;return(null==(e=t.conditions)?void 0:e.cancelEvents)&&(null==(i=t.conditions)||null==(i=i.cancelEvents)||null==(i=i.values)?void 0:i.length)>0}),o=this.$h(t,af),a=this.$h(t,lf);e?(this.Ch=o,this.Th=a):(this.Hh(this.Ch,o),this.Hh(this.Th,a)),(0!==n.length||0!==s.length)&&(null!==(i=this.mh)&&void 0!==i||(this.mh=null==(r=this._instance)?void 0:r._addCaptureHook((t,e)=>{this.onEvent(t,e)})))}onEvent(t,e){var i,r,n=this.zh(),s=(null==e||null==(i=e.properties)?void 0:i.$survey_id)||(null==e||null==(r=e.properties)?void 0:r.$product_tour_id);if(s&&this.getActivatedIds().includes(s)){var o=this.Uh(t,s);if("consume"===o)return n.info("event consumed activated item, removing it",{event:t,itemId:s}),void this.Wh([s]);if("persist"===o)return n.info("shown item promoted to persisted activation",{event:t,itemId:s}),this.Vh(s),void this.Gh([s])}if(this.Th.has(t)){var a=this.Dh(t,e,lf);a.length>0&&(n.info("cancel event matched, cancelling items",{event:t,itemsToCancel:a.map(t=>t.id)}),this.Wh(a.map(t=>t.id)),a.forEach(t=>this.Zh(t.id)))}if(this.Ch.has(t)){n.info("event name matched",{event:t,eventPayload:e,items:this.Ch.get(t)});var l=this.Dh(t,e,af);this.Jh(l.map(t=>t.id))}}onAction(t){this.Mh.has(t)&&this.Jh(this.Mh.get(t)||[])}Jh(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.Rh(n)?this.Vh(n)&&this.Qh(n):r.push(n);r.length>0&&(this.xh=[...new Set([...this.xh,...r])]),this.zh().info("updating activated items",{activatedItems:this.getActivatedIds()})}}Vh(t){this.xh=this.xh.filter(e=>e!==t);var e=this.Kh();return!e.includes(t)&&(this.Xh([...e,t]),this.Yh(),!0)}Wh(t){var e=new Set(t);this.xh=this.xh.filter(t=>!e.has(t));var i=this.td(),r=i.filter(t=>!e.has(t));r.length!==i.length&&(this.Xh(r),0===r.length&&this.ed()),this.Gh(t)}rd(){var t,e=this.Ah();if(!e)return{};var i=null==(t=this._instance)||null==(t=t.persistence)?void 0:t.props[e];return i&&"object"==typeof i?i:{}}Qh(t){if(this.Ah()){var e=this.rd();this.Ph(n({},e,{[t]:Date.now()}))}}Gh(t){if(this.Ah()){var e=this.rd(),i={},r=!1;for(var n of Object.entries(e)){var s=n[0],o=n[1];t.includes(s)?r=!0:i[s]=o}r&&(Me(i)?this.Fh():this.Ph(i))}}nd(){this.Ah()&&this.Fh()}getActivationTimestamp(t){if(this.Kh().includes(t)){var e=this.rd()[t];return Fe(e)?e:void 0}}td(){var t,e=this.sd();return(null==(t=this._instance)||null==(t=t.persistence)?void 0:t.props[e])||[]}Kh(){var t,e,i=this.td();if(0===i.length)return[];var r=null==(t=this._instance)||null==(t=t.persistence)?void 0:t.props[this.od()],n=null==(e=this._instance)||null==e.get_session_id?void 0:e.get_session_id();return n&&r===n?i:[]}Yh(){var t,e=null==(t=this._instance)||null==t.get_session_id?void 0:t.get_session_id();e&&this.ad(e)}ed(){this.ld()}Eh(t){var e,i=null==(e=this._instance)||null==(e=e.persistence)?void 0:e.props[this.od()];if(i&&i!==t){var r=this.td(),n=this.rd();r.length>0&&(this.Xh([]),r.filter(t=>Fe(n[t])).forEach(t=>this.Zh(t))),this.ed(),this.nd()}}getActivatedIds(){return[...new Set([...this.Kh(),...this.xh])].filter(t=>!this.ud(t))}dispose(){var t,e,i;null==(t=this.Ih)||t.call(this),this.Ih=void 0,null==(e=this.mh)||e.call(this),this.mh=void 0,null==(i=this.Bh)||i.dispose(),this.Bh=void 0}reset(){this.xh=[],this.td().length>0&&this.Xh([]),this.ed(),this.nd()}getEventToItemsMap(){return this.Ch}hd(){return this.Bh}},Mw=class extends Tw{constructor(t){super(t)}sd(){return mt}od(){return yt}Ah(){return bt}Ph(t){var e;null==(e=this._instance)||null==(e=e.persistence)||e.register({[bt]:t})}Fh(){var t;null==(t=this._instance)||null==(t=t.persistence)||t.unregister(bt)}Rh(t){var e,i;this.Lh(e=>{i=e.find(e=>e.id===t)});var r=null==(e=i)||null==(e=e.appearance)?void 0:e.surveyPopupDelaySeconds;return Fe(r)&&r>0}dd(){return Sf}Lh(t){var e;null==(e=this._instance)||e.getSurveys(t)}Zh(t){var e;null==(e=this._instance)||e.cancelPendingSurvey(t)}zh(){return Lf}Xh(t){var e;null==(e=this._instance)||null==(e=e.persistence)||e.register({[mt]:t})}ad(t){var e;null==(e=this._instance)||null==(e=e.persistence)||e.register({[yt]:t})}ld(){var t;null==(t=this._instance)||null==(t=t.persistence)||t.unregister(yt)}ud(){return!1}Uh(t,e){var i;return this.Lh(t=>{i=t.find(t=>t.id===e)}),!i||fa(i)?t===Sf?"consume":"ignore":t===Sf?"persist":t===xf||t===Cf?"consume":"ignore"}getSurveys(){return this.getActivatedIds()}getEventToSurveys(){return this.getEventToItemsMap()}},Iw=class{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);Ie(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)}},Ew=class{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==b?void 0:b.__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 Mw(this._instance)}},Rw=null!=a&&a.location?zn(a.location.hash,"__posthog")||zn(location.hash,"state"):null,Aw="_postHogToolbarParams",Pw=Cn("[Toolbar]"),Fw=Cn("[FeatureFlags]"),Ow=class{constructor(t,e){void 0===e&&(e=!1),this.vd=!1,this.update(t,e)}update(t,e){this.fd=((t,e)=>{var i,r,n,s,o;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!==(o=t.evaluation_contexts)&&void 0!==o?o:t.evaluation_environments)&&void 0!==s?s:[],flagKeys:xe(t.flag_keys)?t.flag_keys:void 0}})(t,e),!t.evaluation_environments||t.evaluation_contexts||this.vd||(Fw.warn("evaluation_environments is deprecated. Use evaluation_contexts instead. evaluation_environments will be removed in a future version."),this.vd=!0),Ie(t.flag_keys)||xe(t.flag_keys)||Fw.error("Invalid flag_keys found:",t.flag_keys,"Expected array of non-empty strings")}get(){return this.fd}},$w=Cn("[FeatureFlags]"),Dw=Cn("[FeatureFlags]",{debugEnabled:!0}),Lw="\" failed. Feature flags didn't load in time.",Nw="connection_error",qw=t=>{for(var e={},i=0;t.length>i;i++)e[t[i]]=!0;return e},jw=t=>{var e={};for(var i of En(t||{})){var r=i[1];r&&(e[i[0]]=r)}return e},Bw="Refusing to render web experiment since the viewer is a likely bot",Hw={icontains:(t,e)=>e.toLowerCase().indexOf(t.toLowerCase())>-1,not_icontains:(t,e)=>-1===e.toLowerCase().indexOf(t.toLowerCase()),regex:(t,e)=>pa(e,t),not_regex:(t,e)=>!pa(e,t),exact:(t,e)=>e===t,is_not:(t,e)=>e!==t},zw=Cn("[Conversations]"),Uw="Conversations not available yet.";function Ww(t,e){var i,r,s,o,a,l,h,d=null!==(i=null==t?void 0:t.flushIntervalMs)&&void 0!==i?i:3e3,v=null!==(r=null==t?void 0:t.maxBufferSize)&&void 0!==r?r:100,c=null!=e&&e.consoleCapture?void 0:null!==(s=null==t?void 0:t.maxLogsPerInterval)&&void 0!==s?s:1e3,f=Ie(c)?Math.max(v,2048):Math.max(v,c),p=n({},function(){var t="",e="";try{var i=null==u?void 0:u.userAgent;if(i){var r=Gi(i);t=r[0],e=r[1]}}catch(t){}return function(t,e){var i=function(t){if(t)return{}.hasOwnProperty.call(ln,t)?ln[t]:t}(t);return n({},i?{"os.name":i}:{},e?{"os.version":e}:{})}(t,e)}(),null==t?void 0:t.resourceAttributes);return{serviceName:null!==(o=null!==(a=null==p?void 0:p["service.name"])&&void 0!==a?a:null==t?void 0:t.serviceName)&&void 0!==o?o:null==e?void 0:e.serviceNameDefault,serviceVersion:null!==(l=null==p?void 0:p["service.version"])&&void 0!==l?l:null==t?void 0:t.serviceVersion,environment:null!==(h=null==p?void 0:p["deployment.environment"])&&void 0!==h?h:null==t?void 0:t.environment,resourceAttributes:p,beforeSend:null==t?void 0:t.beforeSend,flushIntervalMs:d,maxBufferSize:v,maxQueueSize:f,maxBatchRecordsPerPost:100,rateCapWindowMs:d,maxLogsPerInterval:c,backgroundFlushBudgetMs:0,terminationFlushBudgetMs:0}}var Vw=["debug","log","warn","error","info"],Gw="console",Zw="__posthogHandledLogsRequestError",Jw=(t,e)=>{var i=t instanceof Error?t:new Error(e);return i[Zw]=!0,i},Qw=t=>!!t&&"object"==typeof t&&!0===t[Zw],Kw={featureFlags:class{constructor(t){this.name="featureFlags",this.pd=!1,this.featureFlagEventHandlers=[],this.A=$w,this.gd={},this.md={},this.yd=[],this.bd=!1,this._d=!1,this.wd=0,this.kd=!1,this.Sd=!1,this.xd=!1,this.Cd=!1,this.Td=0,this.Ve=()=>{var t=this.Md();this.Td=0,t&&this.reloadFeatureFlags()},this.Id=()=>{var t,e=this.Ed;Ie(e)||this._n.remoteRequestsDisabled||!h||"hidden"===h.visibilityState||Date.now()-(null!==(t=this.Rd)&&void 0!==t?t:0)<e||(this.reloadFeatureFlags(),this.Ad())},this.Ze=()=>{"visible"===(null==h?void 0:h.visibilityState)&&this.Id()},"get"in t?this.Us=t:(this._instance=t,this.Pd=new Ow(t.config,t.Ma()),this.Us=this.Pd)}updateConfig(t,e){var i;null==(i=this.Pd)||i.update(t,e),this.Hs&&this.Fd()}setup(t){return this.Zu=t,this.A=t.logger.createLogger("[FeatureFlags]"),_w(t.kv.initialize(),()=>{this.Zu===t&&(this.Zu=void 0,this.Hs=t,this.Od(t))})}Od(t){var e;if(this.Hs===t)return a&&$n(a,"online",this.Ve),this.Fd(),this.$d=t.registerDynamicEventProperties(()=>this.Dd()?this.gd:this.md),this.Ld=null==(e=this._instance)||null==(e=e.persistence)?void 0:e.onCrossTabFeatureFlagChange(()=>{this.Nd(),this.qd(),this.jd()}),this.qd(),this.initialize()}Fd(){var t=this._n.refreshIntervalMs,e=!this._n.remoteRequestsDisabled&&h&&!Ie(t)&&t>0?t:void 0;e!==this.Ed&&(this.Bd(),Ie(e)||(this.Ed=e,this.Ad(),null!=h&&h.addEventListener&&$n(h,re,this.Ze)))}Ad(){Ie(this.Ed)||(Ie(this.Hd)||clearInterval(this.Hd),this.Rd=Date.now(),this.Hd=setInterval(this.Id,this.Ed))}Bd(){Ie(this.Hd)||(clearInterval(this.Hd),this.Hd=void 0,null==h||null==h.removeEventListener||h.removeEventListener(re,this.Ze)),this.Ed=void 0,this.Rd=void 0}destroy(){this.zd()}dispose(){this.zd()}zd(){var t,e;this.Bd(),this.wd++,this.Sd=!1,this.Zu=void 0,this.Hs&&(this.Ud(),null==(t=this.$d)||t.dispose(),this.$d=void 0,null==(e=this.Ld)||e.call(this),this.Ld=void 0,this.yd=[],null==a||a.removeEventListener("online",this.Ve),this.Hs=void 0)}get _n(){return this.Us.get()}Wd(t){var e;return this.Vd&&t in this.Vd?this.Vd[t]:null==(e=this.Hs)?void 0:e.kv.get(t)}Nd(){return!!this.Vd&&(this.Vd=void 0,!0)}Gd(){var t;return!Ie(null==(t=this.Hs)?void 0:t.kv.get("$enabled_feature_flags"))&&this.Nd()}ui(t){this.Zd(()=>{var e;return null==(e=this.Hs)?void 0:e.kv.set(t)})}Jd(t,e,i){var r;if(null!=(r=this._instance)&&r.persistence&&t.$enabled_feature_flags){var n=this.Wd("$enabled_feature_flags")||{},s=t.$enabled_feature_flags||{},o=e.flags||e.featureFlags,a=e.flags?Object.entries(e.flags).filter(t=>{var e=t[1];return!(null!=e&&e.failed)}).map(t=>t[0]):[],l=!!e.errorsWhileComputingFlags&&!!e.flags,u=l?a:i&&!xe(o)?Object.keys(o||{}):Array.from(new Set([...Object.keys(n),...Object.keys(s)])),h=this.Wd("$feature_flag_payloads")||{},d=t.$feature_flag_payloads||{},v=l||i?u:Array.from(new Set([...Object.keys(h),...Object.keys(d)])),c=!l&&!i,f=!!c||u,p=!!c||v,g={[nt]:f,[rt]:f,[at]:p};for(var m of(t.$feature_flag_details&&(g[ot]=f),[lt,Rt,ut]))Ie(t[m])||(g[m]=!0);this._instance.persistence.markCrossTabFeatureFlagChanges(g)}}hi(t){this.Zd(()=>{var e;return null==(e=this.Hs)?void 0:e.kv.remove(t)})}Zd(t){try{t()}catch(t){this.A.error("Failed to update feature flag persistence",t)}}qd(){var t={};for(var e of[nt,at,lt,ht]){var i=this.Wd(e);Ie(i)||(t[e]=i)}this.gd=t;var r=n({},t),s=this.Wd(rt);if(s)for(var o of Object.entries(s))r["$feature/"+o[0]]=o[1];this.md=r}Dd(){var t=this._n.cacheTtlMs;if(!t||0>=t)return!1;var e=this.Wd(Rt);return"number"!=typeof e||Date.now()-e>t}Qd(){return!!this.Dd()&&(this.Cd||this._d||(this.Cd=!0,this.A.warn("Feature flag cache is stale, triggering refresh..."),this.reloadFeatureFlags()),!0)}Kd(){var t=this._n.evaluationContexts;return null!=t&&t.length?t.filter(t=>{var e=t&&"string"==typeof t&&t.trim().length>0;return e||this.A.error("Invalid evaluation context found:",t,"Expected non-empty string"),e}):[]}Xd(){var t=this._n.flagKeys;if(!Ie(t))return t.filter(t=>{var e=t&&"string"==typeof t&&t.trim().length>0;return e||this.A.error("Invalid flag key found:",t,"Expected non-empty string"),e})}initialize(){var t,e,i=this._n,r=null!==(t=null==(e=i.bootstrap)?void 0:e.featureFlags)&&void 0!==t?t:{};if(Object.keys(r).length){var n,s,o=null!==(n=null==(s=i.bootstrap)?void 0:s.featureFlagPayloads)&&void 0!==n?n:{},a=Object.keys(r).filter(t=>!Ie(r[t])).reduce((t,e)=>(t[e]=r[e],t),{}),l=Object.keys(o).filter(t=>a[t]).reduce((t,e)=>(t[e]=o[e],t),{});return this.Yd({featureFlags:a,featureFlagPayloads:l},void 0,{persist:!1})}}updateFlags(t,e,i){var r,s,o=null!=i&&i.merge&&null!==(r=this.Wd("$enabled_feature_flags"))&&void 0!==r?r:{},a=null!=i&&i.merge&&null!==(s=this.Wd("$feature_flag_payloads"))&&void 0!==s?s:{},l=n({},o,t),u=n({},a,e),h={};for(var d of Object.entries(l)){var v=d[0],c=d[1];h[v]={key:v,enabled:Hr(c),variant:zr(c),reason:void 0,metadata:Ie(null==u?void 0:u[v])?void 0:{id:0,version:void 0,description:void 0,payload:u[v]}}}this.Yd({flags:h})}get hasLoadedFlags(){return this.bd}getFlags(){return Object.keys(this.getFlagVariants())}getFlagsWithDetails(){var t=this.Wd(ot),e=this.Wd(ht),i=this.Wd(dt);if(!i&&!e)return t||{};var r=In({},t||{});for(var s of[...new Set([...Object.keys(i||{}),...Object.keys(e||{})])]){var o,a,l=r[s],u=null==e?void 0:e[s],h=Ie(u)?null!==(o=null==l?void 0:l.enabled)&&void 0!==o&&o:!!u,d=Ie(u)?null==l?void 0:l.variant:"string"==typeof u?u:void 0,v=null==i?void 0:i[s],c=n({},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=n({},null==l?void 0:l.metadata,{payload:v,original_payload:null==l||null==(a=l.metadata)?void 0:a.payload})),r[s]=c}return this.pd||(this.A.warn(" Overriding feature flag details!",{flagDetails:t,overriddenPayloads:i,finalDetails:r}),this.pd=!0),r}getAllFeatureFlags(){var t=this.getFlagVariants(),e=this.getFlagPayloads();return Object.keys(t).map(i=>{var r=t[i];return{key:i,enabled:Hr(r),variant:zr(r),payload:Br(e[i])}})}getFlagVariants(){var t=this.Wd(rt),e=this.Wd(ht);if(!e)return t||{};for(var i=In({},t||{}),r=Object.keys(e),n=0;r.length>n;n++)i[r[n]]=e[r[n]];return this.pd||(this.A.warn(" Overriding feature flags!",{enabledFlags:t,overriddenFlags:e,finalFlags:i}),this.pd=!0),i}getFlagPayloads(){var t=this.Wd(at),e=this.Wd(dt);if(!e)return t||{};for(var i=In({},t||{}),r=Object.keys(e),n=0;r.length>n;n++)i[r[n]]=e[r[n]];return this.pd||(this.A.warn(" Overriding feature flag payloads!",{flagPayloads:t,overriddenPayloads:e,finalPayloads:i}),this.pd=!0),i}reloadFeatureFlags(){this.kd||this._n.featureFlagsDisabled||this.Md()||(this._d&&(this.Sd=!0),this.tv||(this.yd.slice().forEach(t=>{try{t()}catch(t){this.A.error("Error while running feature flags reloading callback",t)}}),this.tv=setTimeout(()=>{this.ev()},5)))}Ud(){clearTimeout(this.tv),this.tv=void 0}onReloading(t){return this.yd.push(t),()=>{this.yd=this.yd.filter(e=>e!==t)}}ensureFlagsLoaded(){this.bd||this._d||this.tv||this.reloadFeatureFlags()}setAnonymousDistinctId(t){this.$anon_distinct_id=t}setReloadingPaused(t){this.kd=t}resetFlagCallReported(){this.hi(Mt)}ev(t){this.Ud();var e=this.Hs;if(e&&!this._n.remoteRequestsDisabled&&!this.Md())if(this._d)this.Sd=!0;else{var i={token:e.projectToken,distinct_id:e.distinctId,groups:e.groups,$anon_distinct_id:this.$anon_distinct_id,person_properties:n({},e.initialPersonProperties,this.Wd("$stored_person_properties")||{},{$lib:e.library.name,$lib_version:e.library.version}),group_properties:this.Wd(ct),timezone:ja()};Ie(e.deviceId)||(i.$device_id=e.deviceId),(null!=t&&t.disableFlags||this._n.featureFlagsDisabled)&&(i.disable_flags=!0);var r=this.Kd();r.length&&(i.evaluation_contexts=r);var s=this.Xd();Ie(s)||(i.flag_keys=s);var o=this._n.onlyEvaluateSurveyFeatureFlags,a="/flags/?v=2"+(o?"&only_evaluate_survey_feature_flags=true":""),l=this.wd;this._d=!0;var u=()=>{this.Sd&&(this.Sd=!1,this.ev())},h=t=>{this._d=!1,l===this.wd?(this.ui({[Et]:[Nw]}),this.A.error("Feature flag request failed",t),this.Gd()&&this.jd(!0),u()):u()};try{e.sendRequest(a,{target:"flags",method:"POST",body:i,compression:this._n.compression,sentAt:"body",timeoutMs:this._n.requestTimeoutMs}).then(t=>{var e,r,n=null!==(e=t.json)&&void 0!==e?e:{},s=200!==t.statusCode;if(this._d=!1,l===this.wd){if(this.iv(t.statusCode),s||this.Sd||(this.$anon_distinct_id=void 0),!i.disable_flags||this.Sd){this.xd=!s;var a=[];t.error?a.push(t.error instanceof Error&&"AbortError"===t.error.name?"timeout":t.error instanceof Error?Nw:"unknown_error"):200!==t.statusCode&&a.push("api_error_"+t.statusCode),n.errorsWhileComputingFlags&&a.push("errors_while_computing_flags");var h=!(null==(r=n.quotaLimited)||!r.includes("feature_flags"));h&&a.push("quota_limited"),this.ui({[Et]:a}),h?this.A.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.Yd(n,s,{partialResponse:o}),u()}}else u()}).catch(h)}catch(t){h(t)}}}Md(){return Un(this.Td,3)}iv(t){this.Td=Wn(t,this.Td,3,()=>this.A.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.xd)if(this.bd||this.getFlags()&&this.getFlags().length>0){if(!this.Qd()){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.A.warn('getFeatureFlag for key "'+t+Lw)}getFeatureFlagDetails(t){return this.getFlagsWithDetails()[t]}getFeatureFlagPayload(t){var e;return null==(e=this.getFeatureFlagResult(t,{send_event:!1}))?void 0:e.payload}getFeatureFlagResult(t,e){if(void 0===e&&(e={}),!e.fresh||this.xd)if(this.bd||this.getFlags()&&this.getFlags().length>0){if(!this.Qd()){var i,r=this.getFlagVariants(),s=t in r,o=r[t],a=this.getFlagPayloads()[t],l=String(o),u=this.Wd("$feature_flag_request_id")||void 0,h=this.Wd("$feature_flag_evaluated_at")||void 0,d=this.Wd("$flag_call_reported")||{};if(this._n.deduplicateCallsPerSession){var v,c=null==(v=this.Hs)?void 0:v.session.sessionId,f=this.Wd(It);c&&c!==f&&(d={},i=c)}if(e.send_event||!("send_event"in e))if(t in d&&d[t].includes(l))i&&this.ui({[Mt]:d,[It]:i});else{var p,g,m,y,b,_,w,k,S,x,C,T,M;xe(d[t])?d[t].push(l):d[t]=[l],this.ui(n({[Mt]:d},i?{[It]:i}:{}));var I=this.getFeatureFlagDetails(t),E=[...null!==(p=this.Wd("$feature_flag_errors"))&&void 0!==p?p:[]];Ie(o)&&E.push("flag_missing");var R={$feature_flag:t,$feature_flag_response:o,$feature_flag_payload:null!=a?a:null,$feature_flag_request_id:u,$feature_flag_evaluated_at:h,$feature_flag_bootstrapped_response:null!==(g=null==(m=this._n.bootstrap)||null==(m=m.featureFlags)?void 0:m[t])&&void 0!==g?g:null,$feature_flag_bootstrapped_payload:null!==(y=null==(b=this._n.bootstrap)||null==(b=b.featureFlagPayloads)?void 0:b[t])&&void 0!==y?y:null,$used_bootstrap_value:!this.xd};Ie(null==I||null==(_=I.metadata)?void 0:_.has_experiment)||(R.$feature_flag_has_experiment=I.metadata.has_experiment),Ie(null==I||null==(w=I.metadata)?void 0:w.version)||(R.$feature_flag_version=I.metadata.version);var A=null!==(k=null==I||null==(S=I.reason)?void 0:S.description)&&void 0!==k?k:null==I||null==(x=I.reason)?void 0:x.code;A&&(R.$feature_flag_reason=A),null!=I&&null!=(C=I.metadata)&&C.id&&(R.$feature_flag_id=I.metadata.id),Ie(null==I?void 0:I.original_variant)&&Ie(null==I?void 0:I.original_enabled)||(R.$feature_flag_original_response=Ie(I.original_variant)?I.original_enabled:I.original_variant),null!=I&&null!=(T=I.metadata)&&T.original_payload&&(R.$feature_flag_original_payload=null==I||null==(M=I.metadata)?void 0:M.original_payload),E.length&&(R.$feature_flag_error=E.join(",")),this.rv(R)}else i&&this.ui({[Mt]:d,[It]:i});if(s)return{key:t,enabled:!!o,variant:"string"==typeof o?o:void 0,payload:Br(a)}}}else this.A.warn('getFeatureFlagResult for key "'+t+Lw)}rv(t){try{var e;null==(e=this.Hs)||e.capture("$feature_flag_called",t).catch(t=>{this.A.error("Failed to capture feature flag call",t)})}catch(t){this.A.error("Failed to capture feature flag call",t)}}getRemoteConfigPayload(t,e){this.nv(t,e)}nv(t,e){var i=this;return o(function*(){var r=i.Hs;if(r){var n={distinct_id:r.distinctId,token:r.projectToken,person_properties:{$lib:r.library.name,$lib_version:r.library.version}},s=i.Kd();s.length&&(n.evaluation_contexts=s);var o,a=i.Xd();Ie(a)||(n.flag_keys=a);try{var l;o=(null==(l=(yield r.sendRequest("/flags/?v=2",{target:"flags",method:"POST",body:n,compression:i._n.compression,sentAt:"body",timeoutMs:i._n.requestTimeoutMs})).json)||null==(l=l.featureFlagPayloads)?void 0:l[t])||void 0}catch(t){return void i.A.error("Remote config feature flag request failed",t)}try{e(o)}catch(t){i.A.error("Remote config feature flag callback failed",t)}}})()}isFeatureEnabled(t,e){if(void 0===e&&(e={}),e.fresh&&!this.xd)return e.defaultValue;if(!(this.bd||this.getFlags()&&this.getFlags().length>0))return this.A.warn('isFeatureEnabled for key "'+t+Lw),e.defaultValue;var i=this.getFeatureFlag(t,e);return Ie(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.Yd(t,e,i)}Yd(t,e,i){if(this.Hs){this.bd=!0;var r=function(t,e,i,r,s,o){void 0===e&&(e={}),void 0===i&&(i={}),void 0===r&&(r={}),void 0===o&&(o=$w);var a=((t,e)=>{var i=t.flags;return i?n({},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!Ie(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,o),l=a.flags,u=a.featureFlags,h=a.featureFlagPayloads;if(u){var d=t.requestId,v=t.evaluatedAt;if(xe(u)){o.warn("v1 of the feature flags endpoint is deprecated. Please use the latest version.");var c={};if(u)for(var f=0;u.length>f;f++)c[u[f]]=!0;return{[nt]:u,[rt]:c,[ut]:!1}}var p=u,g=h,m=l;if(null!=s&&s.partialResponse){var y=Object.keys(p),b=g||{};p=n({},e,p),g=n({},i,b),y.forEach(t=>{var e;t in b||null==(e=g)||delete e[t]}),m=n({},r,m)}else if(t.errorsWhileComputingFlags)if(l){var _=new Set(Object.keys(l).filter(t=>{var e;return!(null!=(e=l[t])&&e.failed)}));p=n({},e,Object.fromEntries(Object.entries(p).filter(t=>_.has(t[0]))));var w=Object.fromEntries(Object.entries(g||{}).filter(t=>_.has(t[0])));g=n({},i,w),_.forEach(t=>{var e;t in w||null==(e=g)||delete e[t]}),m=n({},r,Object.fromEntries(Object.entries(m||{}).filter(t=>_.has(t[0]))))}else p=n({},e,p),g=n({},i,g),m=n({},r,m);return n({[nt]:Object.keys(jw(p)),[rt]:p||{},[at]:g||{},[ot]:m||{},[ut]:!0===t.minimalFlagCalledEvents},d?{[lt]:d}:{},v?{[Rt]:v}:{})}}(t,this.getFlagVariants(),this.getFlagPayloads(),this.getFlagsWithDetails(),i,this.A);if(r)if(!1===(null==i?void 0:i.persist)){var s=!Ie(this.Hs.kv.get(rt));this.Vd=r,s||this.ui(r)}else this.Nd(),this.Jd(r,t,!(null==i||!i.partialResponse)),this.ui(r);else e&&this.Gd();e||(this.Cd=!1),this.jd(e)}}override(t,e){void 0===e&&(e=!1),this.A.warn("override is deprecated. Please use overrideFeatureFlags instead."),this.overrideFeatureFlags({flags:t,suppressWarning:e})}overrideFeatureFlags(t){this.sv(t)}sv(t){if(this.Hs){if(!1===t)return this.hi([ht,dt]),this.jd(),void Dw.info("All overrides cleared");if(xe(t))return this.ui({[ht]:qw(t)}),this.jd(),void Dw.info("Flag overrides set",{flags:t});if(t&&"object"==typeof t&&("flags"in t||"payloads"in t)){var e,i=t;this.pd=Boolean(null!==(e=i.suppressWarning)&&void 0!==e&&e);var r={},n=i.flags,s=i.payloads;return n&&(r[ht]=xe(n)?qw(n):n),s&&(r[dt]=s),Object.keys(r).length&&this.ui(r),!1===n&&!1===s?this.hi([ht,dt]):!1===n?this.hi(ht):!1===s&&this.hi(dt),this.jd(),!1===n?Dw.info("Flag overrides cleared"):n&&Dw.info("Flag overrides set",{flags:n}),void(!1===s?Dw.info("Payload overrides cleared"):s&&Dw.info("Payload overrides set",{payloads:s}))}if(t&&"object"==typeof t)return this.ui({[ht]:t}),this.jd(),void Dw.info("Flag overrides set",{flags:t});this.A.warn("Invalid overrideOptions provided to overrideFeatureFlags",{overrideOptions:t})}else this.A.warn("posthog.featureFlags.overrideFeatureFlags called before feature flags were ready")}onFeatureFlags(t){if(this.addFeatureFlagsHandler(t),this.bd){var e=this.ov(),i=e.flags,r=e.flagVariants;try{t(i,r)}catch(t){this.A.error("Error while running feature flags callback",t)}}return()=>this.removeFeatureFlagsHandler(t)}updateEarlyAccessFeatureEnrollment(t,e,i){var r,s=(this.Wd("$early_access_features")||[]).find(e=>e.flagKey===t),o={["$feature_enrollment/"+t]:e},a={$feature_flag:t,$feature_enrollment:e,$set:o};s&&(a.$early_access_feature_name=s.name),i&&(a.$feature_enrollment_stage=i);var l=n({},this.getFlagVariants(),{[t]:e});null==(r=this._instance)||null==(r=r.persistence)||r.markCrossTabFeatureFlagChanges({[nt]:[t],[rt]:[t],[vt]:Object.keys(o)}),this.ui({[nt]:Object.keys(jw(l)),[rt]:l,[vt]:n({},this.Wd("$stored_person_properties")||{},o)}),this.jd();try{var u;null==(u=this.Hs)||u.capture("$feature_enrollment_update",a).catch(t=>{this.A.error("Failed to capture early access feature enrollment",t)})}catch(t){this.A.error("Failed to capture early access feature enrollment",t)}}getEarlyAccessFeatures(t,e,i){void 0===e&&(e=!1);var r=this.Wd(st);!r||e?this.av(t,i):t(r)}av(t,e){var i=this;return o(function*(){var r=i.Hs;if(r){var n,s=e?"&"+e.map(t=>"stage="+t).join("&"):"";try{var o=yield r.sendRequest("/api/early_access_features/?token="+r.projectToken+s,{target:"api",method:"GET",sentAt:"query"});if(!o.json)return;n=o.json.earlyAccessFeatures,i.ui({[st]:n})}catch(t){return void i.A.error("Early access feature request failed",t)}try{t(n)}catch(t){i.A.error("Early access feature callback failed",t)}}})()}ov(){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),{})}}jd(t){this.qd();var e=this.ov(),i=e.flags,r=e.flagVariants;this.featureFlagEventHandlers.forEach(e=>{try{e(i,r,{errorsLoading:t})}catch(t){this.A.error("Error while running feature flags callback",t)}})}setPersonPropertiesForFlags(t,e){void 0===e&&(e=!0),this.lv(t,e)}lv(t,e){void 0===e&&(e=!0);var i=this.Wd("$stored_person_properties")||{},r=(null==t?void 0:t.$set)||(null!=t&&t.$set_once?{}:t),s=null==t?void 0:t.$set_once,o={};if(s)for(var a in s)({}).hasOwnProperty.call(s,a)&&(a in i||(o[a]=s[a]));this.ui({[vt]:n({},i,o,r)}),e&&this.reloadFeatureFlags()}unsetPersonPropertiesForFlags(t,e){void 0===e&&(e=!0);var i=n({},this.Wd("$stored_person_properties")||{});t.forEach(t=>{delete i[t]}),this.ui({[vt]:i}),e&&this.reloadFeatureFlags()}resetPersonPropertiesForFlags(t){void 0===t&&(t=!0),this.hi(vt),t&&this.reloadFeatureFlags()}setGroupPropertiesForFlags(t,e){void 0===e&&(e=!0);var i=this.Wd("$stored_group_properties")||{},r=n({},i);for(var s of Object.keys(t))r[s]=n({},i[s],t[s]);this.ui({[ct]:r}),e&&this.reloadFeatureFlags()}resetGroupPropertiesForFlags(t){if(t){var e=this.Wd("$stored_group_properties")||{};this.ui({[ct]:n({},e,{[t]:{}})})}else this.hi(ct)}reset(){this.wd++,this.Sd=!1,this.gd={},this.md={},this.Vd=void 0,this.bd=!1,this.kd=!1,this.xd=!1,this.$anon_distinct_id=void 0,this.Ud(),this.pd=!1,this.Td=0}}},Xw={sessionRecording:class{get _n(){return this._instance.config}get Ya(){return this._instance.persistence}get started(){var t;return!(null==(t=this.uv)||!t.isStarted)}get status(){var t,e;return"awaiting_config"===this.hv||"missing_config"===this.hv?this.hv:null!==(t=null==(e=this.uv)?void 0:e.status)&&void 0!==t?t:this.hv}constructor(t){if(this._instance=t,this._forceAllowLocalhostNetworkCapture=!1,this.hv=Us,this.dv=void 0,this.vv=!1,this.je=(()=>{var t;if(null==h||!h.visibilityState||"visible"===h.visibilityState)return!0;var e=null==a||null==(t=a.performance)||null==t.getEntriesByType?void 0:t.getEntriesByType("visibility-state");return!(null!=e&&e.length)||e.some(t=>"visible"===t.name)})(),this.Ze=()=>{var t;"visible"===(null==h?void 0:h.visibilityState)&&(this.je=!0,null==(t=this.uv)||null==t.setDocumentWasEverVisible||t.setDocumentWasEverVisible(!0))},!this._instance.sessionManager)throw cw.error("started without valid sessionManager"),new Error("[SessionRecording] started without valid sessionManager. This is a bug.");if("always"===this._n.cookieless_mode)throw new Error('[SessionRecording] cannot be used with cookieless_mode="always"');null!=h&&h.addEventListener&&$n(h,"visibilitychange",this.Ze)}initialize(){this.startIfEnabledOrStop()}dispose(t){var e=(void 0===t?{}:t).discardBufferedEvents,i=void 0!==e&&e;this.vv=!0,null==h||null==h.removeEventListener||h.removeEventListener("visibilitychange",this.Ze),i?this.fv(!0):this.stopRecording()}get pv(){var t,e=!(null==(t=this._instance.get_property(j))||!t.enabled),i=!this._n.disable_session_recording,r=this._n.disable_session_recording||this._instance.consent.isOptedOut();return a&&e&&i&&!r}startIfEnabledOrStop(t){var e;if(!(this.vv||this.pv&&null!=(e=this.uv)&&e.isStarted)){var i=!Ie(Object.assign)&&!Ie(Array.from);this.pv&&i?(this.gv(t),cw.info("starting")):(this.hv=Us,this.stopRecording())}}gv(t){var e,i;if(this.pv)if("awaiting_config"!==this.hv&&"missing_config"!==this.hv&&(this.hv=Js),null!=b&&null!=(e=b.__PosthogExtensions__)&&null!=(e=e.rrweb)&&e.record&&null!=(i=b.__PosthogExtensions__)&&i.initSessionRecording)this.mv(t);else{var r,n=this._instance.sessionManager;null==(r=b.__PosthogExtensions__)||null==r.loadExternalDependency||r.loadExternalDependency(this._instance,this.yv,e=>{if(!this.vv&&this.pv&&this._instance.sessionManager===n)return e?(this._instance.register_for_session({[Ht]:!0}),cw.error("could not load recorder",e)):void this.mv(t);this.hv=Us})}}stopRecording(){var t,e;null==(t=this.dv)||t.call(this),this.dv=void 0,null==(e=this.uv)||e.stop()}fv(t){var e,i;void 0===t&&(t=!1),null==(e=this.dv)||e.call(this),this.dv=void 0,null==(i=this.uv)||i.discard({discardProducerEvents:t})}bv(){var t,e;null==(t=this.Ya)||t.unregister(Z),null==(e=this.Ya)||e.unregister(H)}_v(t,e){if(Pe(t))return null;var i,r=Fe(t)?t:parseFloat(t);return"number"!=typeof(i=r)||!Number.isFinite(i)||0>i||i>1?(cw.warn(e+" must be between 0 and 1. Ignoring invalid value:",t),null):r}wv(t){if(this.Ya){var e,i,r=this.Ya,s=()=>{var e,i=!1===t.sessionRecording?void 0:t.sessionRecording,s=this._v(null==(e=this._n.session_recording)?void 0:e.sampleRate,"session_recording.sampleRate"),o=this._v(null==i?void 0:i.sampleRate,"remote config sampleRate"),a=null!=s?s:o;Pe(a)&&this.bv();var l=null==i?void 0:i.minimumDurationMilliseconds;r.register({[j]:n({cache_timestamp:Date.now(),enabled:!!i},i,{networkPayloadCapture:n({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:Ie(l)?null:l,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})})};s(),null==(e=this.dv)||e.call(this),this.dv=null==(i=this._instance.sessionManager)?void 0:i.onSessionId(s)}}onRemoteConfig(t){var e=t.ok?t.config:void 0;return e&&"sessionRecording"in e?!1===e.sessionRecording?(this.wv(e),void this.fv()):(this.wv(e),void this.startIfEnabledOrStop()):("awaiting_config"===this.hv&&(this.hv="missing_config",cw.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.uv)&&i.log?this.uv.log(t,e):cw.warn("log called before recorder was ready")}get yv(){var t;return(null==(t=this._instance)||null==(t=t.persistence)||null==(t=t.get_property("$session_recording_remote_config"))||null==(t=t.scriptConfig)?void 0:t.script)||"lazy-recorder"}Sv(){var t,e=this._instance.get_property(j);if(!e)return!1;try{t="object"==typeof e?e:JSON.parse(e)}catch(t){return cw.warn("persisted remote config for session recording is invalid and will be ignored",t),!1}return!Pe(t.cache_timestamp)&&36e5>=Date.now()-t.cache_timestamp}mv(t){var e,i,r;if(!this.vv&&this.pv&&this._instance.sessionManager){if(null==(e=b.__PosthogExtensions__)||!e.initSessionRecording)return cw.warn("Called on script loaded before session recording is available. This can be caused by adblockers."),void this._instance.register_for_session({[Ht]:!0});var n;if(this.uv||(this.uv=null==(n=b.__PosthogExtensions__)?void 0:n.initSessionRecording(this._instance,this.je),this.uv._forceAllowLocalhostNetworkCapture=this._forceAllowLocalhostNetworkCapture),!this.Sv()){if("missing_config"===this.hv||"awaiting_config"===this.hv)return;return this.hv="awaiting_config",cw.info("persisted remote config is stale, requesting fresh config before starting"),void new i_(this._instance).load()}this.hv=Js,null==(i=(r=this.uv).setDocumentWasEverVisible)||i.call(r,this.je),this.uv.start(t)}else this.hv=Us}onRRwebEmit(t){var e;null==(e=this.uv)||null==e.onRRwebEmit||e.onRRwebEmit(t)}overrideLinkedFlag(){var t,e;this.uv||null==(t=this.Ya)||t.register({[U]:!0}),null==(e=this.uv)||e.overrideLinkedFlag()}overrideSampling(){var t,e;this.uv||null==(t=this.Ya)||t.register({[z]:!0}),null==(e=this.uv)||e.overrideSampling()}overrideTrigger(t){var e,i;this.uv||null==(e=this.Ya)||e.register({["url"===t?W:V]:!0}),null==(i=this.uv)||i.overrideTrigger(t)}get sdkDebugProperties(){var t;return(null==(t=this.uv)?void 0:t.sdkDebugProperties)||{$recording_status:this.status}}tryAddCustomEvent(t,e){var i;return!(null==(i=this.uv)||!i.tryAddCustomEvent(t,e))}flushBeforeIdentityReset(){var t;null==(t=this.uv)||null==t.flushBeforeIdentityReset||t.flushBeforeIdentityReset()}}},Yw={autocapture:class extends vb{constructor(t){super(new sw(t)),this.instance=t}},historyAutocapture:class{constructor(t){this._instance=t,this.xv=this.Cv()}initialize(){this.startIfEnabled()}get isEnabled(){var t=this.Tv();return!!(t.path||t.search||this.Mv(t))}startIfEnabled(){this.isEnabled&&(xn.info("History API monitoring enabled, starting..."),this.monitorHistoryChanges())}startIfEnabledOrStop(){this.stop(),this.xv=this.Cv(),this.startIfEnabled()}stop(){this.Iv&&this.Iv(),this.Iv=void 0,this.Ev&&this.Ev(),this.Ev=void 0,xn.info("History API monitoring stopped")}monitorHistoryChanges(){a&&a.history&&(this.Rv("pushState"),this.Rv("replaceState"),this.Av(),this.Mv()&&this.Pv())}Rv(t){var e;if(a&&(null==(e=a.history[t])||!e.__posthog_wrapped__)){var i=this;gv(a.history,t,e=>function(r,n,s){e.call(this,r,n,s),i.Fv(t)})}}Cv(){var t=null==a?void 0:a.location;if(null!=t&&t.pathname)return{pathname:t.pathname,search:t.search,hash:t.hash}}Tv(){var t=this._instance.config.capture_pageview;return"history_change"===t?{path:!0}:Te(t)?t:{}}Mv(t){return void 0===t&&(t=this.Tv()),!!t.hash&&!this._instance.config.disable_capture_url_hashes}Ov(t){var e=this.Tv(),i=this.xv;return!(!i||!(e.path&&t.pathname!==i.pathname||e.search&&t.search!==i.search||this.Mv(e)&&t.hash!==i.hash))}Fv(t){try{var e=this.Cv();if(!e)return;this.Ov(e)&&this._instance.capture(se,{navigation_type:t}),this.xv=e}catch(e){xn.error("Error capturing "+t+" pageview",e)}}Av(){if(!this.Iv){var t=()=>{this.Fv("popstate")};$n(a,"popstate",t),this.Iv=()=>{a&&a.removeEventListener("popstate",t)}}}Pv(){if(!this.Ev){var t=()=>{this.Fv("hashchange")};$n(a,"hashchange",t),this.Ev=()=>{a&&a.removeEventListener("hashchange",t)}}}},heatmaps:class{get _n(){return this.instance.config}constructor(t){var e;this.$v=!1,this.Ws=!1,this.Dv=null,this.instance=t,this.$v=!(null==(e=this.instance.persistence)||!e.props[R]),this.rageclicks=new ob(t.config.rageclick)}initialize(){this.startIfEnabled()}get flushIntervalMilliseconds(){var t=5e3;return Te(this._n.capture_heatmaps)&&this._n.capture_heatmaps.flush_interval_milliseconds&&(t=this._n.capture_heatmaps.flush_interval_milliseconds),t}get isEnabled(){return Pe(this._n.capture_heatmaps)?Pe(this._n.enable_heatmaps)?this.$v:this._n.enable_heatmaps:!1!==this._n.capture_heatmaps}startIfEnabled(){if(this.isEnabled){if(this.Ws)return;fw.info("starting..."),this.Lv(),this.Ze()}else{var t;clearInterval(null!==(t=this.Dv)&&void 0!==t?t:void 0),this.Nv(),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({[R]:i}),this.$v=i,this.startIfEnabled()}}}getAndClearBuffer(){var t=this.Pe;return this.Pe=void 0,t}qv(t){pw(t.originalEvent)&&this.an(t.originalEvent,"deadclick")}Ze(){this.Dv&&clearInterval(this.Dv),this.Dv=function(t){return"visible"===(null==t?void 0:t.visibilityState)}(h)?setInterval(this.za.bind(this),this.flushIntervalMilliseconds):null}Lv(){a&&h&&(this.jv=this.za.bind(this),$n(a,ne,this.jv),this.Bv=t=>this.an(t||(null==a?void 0:a.event)),$n(h,"click",this.Bv,{capture:!0}),this.Hv=t=>this.zv(t||(null==a?void 0:a.event)),$n(h,"mousemove",this.Hv,{capture:!0}),this.Uv=new Ab(this.instance,Eb,this.qv.bind(this)),this.Uv.startIfEnabledOrStop(),this.Wv=this.Ze.bind(this),$n(h,re,this.Wv),this.Ws=!0)}Nv(){var t;a&&h&&(this.jv&&a.removeEventListener(ne,this.jv),this.Bv&&h.removeEventListener("click",this.Bv,{capture:!0}),this.Hv&&h.removeEventListener("mousemove",this.Hv,{capture:!0}),this.Wv&&h.removeEventListener(re,this.Wv),clearTimeout(this.Vv),null==(t=this.Uv)||t.stop(),this.Ws=!1)}Gv(t,e){var i=this.instance.scrollManager.scrollY(),r=this.instance.scrollManager.scrollX(),n=this.instance.scrollManager.scrollElement(),s=function(t,e,i){for(var r=t;r&&Jn(r)&&!Qn(r,"body");){if(r===i)return!1;var n=void 0;try{var s,o,l;n=null==(s=null!==(o=null==(l=r.ownerDocument)?void 0:l.defaultView)&&void 0!==o?o:a)?void 0:s.getComputedStyle(r).position}catch(t){return!1}if(de(e,n))return!0;r=ls(r)}return!1}(ns(t),["fixed","sticky"],n);return{x:t.clientX+(s?0:r),y:t.clientY+(s?0:i),target_fixed:s,type:e}}an(t,e){var i;if(void 0===e&&(e="click"),!Zn(t.target)&&pw(t)){var r=this.Gv(t,e);null!=(i=this.rageclicks)&&i.isRageClick(t.clientX,t.clientY,(new Date).getTime())&&gs(ns(t),this.instance.config.rageclick)&&this.Is(n({},r,{type:"rageclick"})),this.Is(r)}}zv(t){!Zn(t.target)&&pw(t)&&(clearTimeout(this.Vv),this.Vv=setTimeout(()=>{this.Is(this.Gv(t,"mousemove"))},500))}Is(t){if(a){var e=this._n.disable_capture_url_hashes?ar(a.location.href):a.location.href,i=this._n.custom_personal_data_properties,r=Hn(e,this._n.mask_personal_data_properties?[...Ia,...i||[]]:[],Ra);this.Pe=this.Pe||{},this.Pe[r]||(this.Pe[r]=[]),this.Pe[r].push(t)}}za(){this.Pe&&!Me(this.Pe)&&this.instance.capture("$$heatmap",{$heatmap_data:this.getAndClearBuffer()})}},deadClicksAutocapture:Ab,webVitalsAutocapture:class{constructor(t){var e;this._instance=t,this.$v=!1,this.Ws=!1,this.Pe={navigationKey:void 0,url:void 0,metrics:[],firstMetricTimestamp:void 0},this.Zv=()=>{clearTimeout(this.Jv),this.Jv=void 0,0!==this.Pe.metrics.length&&(this._instance.capture("$web_vitals",n({$current_url:this.Pe.url},this.Pe.metrics.reduce((t,e)=>n({},t,{["$web_vitals_"+e.name+"_event"]:n({},e),["$web_vitals_"+e.name+"_value"]:e.value}),{}))),this.Pe={navigationKey:void 0,url:void 0,metrics:[],firstMetricTimestamp:void 0})},this.Qv=t=>{var e;if(this.Pe=this.Pe||{navigationKey:void 0,url:void 0,metrics:[],firstMetricTimestamp:void 0},Pe(null==t?void 0:t.name)||Pe(null==t?void 0:t.value))lw.error("Invalid metric received",t);else{var i="string"==typeof t.navigationURL?t.navigationURL:void 0,r=this.Kv(i);if(!Ie(r)){var s=Fe(t.navigationId)||"string"==typeof t.navigationId?"navigation:"+t.navigationId:"url:"+r;if(!this.Xv||this.Xv>t.value){this.Pe.navigationKey!==s&&(this.Zv(),this.Jv=setTimeout(this.Zv,this.flushToCaptureTimeoutMs)),Ie(this.Pe.navigationKey)&&(this.Pe.navigationKey=s,this.Pe.url=r),this.Pe.firstMetricTimestamp=Ie(this.Pe.firstMetricTimestamp)?Date.now():this.Pe.firstMetricTimestamp;var o=null==(e=this._instance.sessionManager)?void 0:e.checkAndGetSessionAndWindowId(!0),a=n({},t,i?{navigationURL:r}:{},{$current_url:r,timestamp:Date.now()});if(delete a.entries,Te(t.attribution)&&this.attributionMetrics.indexOf(t.name)>-1){var l={};for(var u of vw){var h="url"===u&&"string"==typeof t.attribution[u]?this.Kv(t.attribution[u]):t.attribution[u];Ie(h)||(l[u]=h)}a.attribution=l}else delete a.attribution;Ie(o)||(a.$session_id=o.sessionId,a.$window_id=o.windowId),this.Pe.metrics.push(a),this.Pe.metrics.length===this.allowedMetrics.length&&this.Zv()}else lw.error("Ignoring metric with value >= "+this.Xv,t)}}},this.Yv=()=>{if(!this.Ws){var t,e,i,r,s=!1,o=b.__PosthogExtensions__,a=null==o?void 0:o.postHogWebVitalsCallbacksByFlavor,l=(null==a?void 0:a[this.tc])||("web-vitals"===this.tc&&Ie(a)?null==o?void 0:o.postHogWebVitalsCallbacks:void 0);if(!Ie(l)){var u=l.withoutAttribution,h=this.attributionMetrics;s=!Ie(u),t=h.indexOf("LCP")>-1?l.onLCP:(null==u?void 0:u.onLCP)||l.onLCP,e=h.indexOf("CLS")>-1?l.onCLS:(null==u?void 0:u.onCLS)||l.onCLS,i=h.indexOf("FCP")>-1?l.onFCP:(null==u?void 0:u.onFCP)||l.onFCP,r=h.indexOf("INP")>-1?l.onINP:(null==u?void 0:u.onINP)||l.onINP}if(t&&e&&i&&r){var d={reportSoftNavs:this.useSoftNavs},v=s&&this.attributionMetrics.indexOf("INP")>-1?n({},d,{includeProcessedEventEntries:!1}):d;this.allowedMetrics.indexOf("LCP")>-1&&t(this.Qv.bind(this),d),this.allowedMetrics.indexOf("CLS")>-1&&e(this.Qv.bind(this),d),this.allowedMetrics.indexOf("FCP")>-1&&i(this.Qv.bind(this),d),this.allowedMetrics.indexOf("INP")>-1&&r(this.Qv.bind(this),v),this.Ws=!0}else lw.error("web vitals callbacks not loaded - not starting")}},this.$v=!(null==(e=this._instance.persistence)||!e.props[O]),this.startIfEnabled()}get ec(){return this._instance.config.capture_performance}get allowedMetrics(){var t,e,i=Te(this.ec)?null==(t=this.ec)?void 0:t.web_vitals_allowed_metrics:void 0;return Pe(i)?(null==(e=this._instance.persistence)?void 0:e.props.$web_vitals_allowed_metrics)||hw:i}get flushToCaptureTimeoutMs(){return(Te(this.ec)?this.ec.web_vitals_delayed_flush_ms:void 0)||5e3}get attributionMetrics(){var t=Te(this.ec)?this.ec.web_vitals_attribution:void 0;return $e(t)?t?hw:[]:xe(t)?t:dw}get useAttribution(){return this.attributionMetrics.length>0}get useSoftNavs(){var t;return null!==(t=Te(this.ec)?this.ec.__preview_web_vitals_soft_navs:void 0)&&void 0!==t&&t}get Xv(){var t=Te(this.ec)&&Fe(this.ec.__web_vitals_max_value)?this.ec.__web_vitals_max_value:uw;return t>0&&6e4>=t?uw:t}get isEnabled(){var t=null==d?void 0:d.protocol;if("http:"!==t&&"https:"!==t)return lw.info("Web Vitals are disabled on non-http/https protocols"),!1;var e=Te(this.ec)?this.ec.web_vitals:$e(this.ec)?this.ec:void 0;return $e(e)?e:this.$v}startIfEnabled(){this.isEnabled&&!this.Ws&&(lw.info("enabled, starting..."),this.do(this.Yv))}onRemoteConfig(t){if(t.ok){var e=t.config;if("capturePerformance"in e){var i=Te(e.capturePerformance)&&!!e.capturePerformance.web_vitals,r=Te(e.capturePerformance)?e.capturePerformance.web_vitals_allowed_metrics:void 0;this._instance.persistence&&(this._instance.persistence.register({[O]:i}),this._instance.persistence.register({[q]:r})),this.$v=i,this.startIfEnabled()}}}get tc(){return this.useSoftNavs?this.useAttribution?"web-vitals-with-attribution-soft-navs":"web-vitals-soft-navs":this.useAttribution?"web-vitals-with-attribution":"web-vitals"}do(t){var e=b.__PosthogExtensions__,i=this.tc,r=null==e?void 0:e.postHogWebVitalsCallbacksByFlavor;null!=r&&r[i]||"web-vitals"===i&&Ie(r)&&null!=e&&e.postHogWebVitalsCallbacks?t():null==e||null==e.loadExternalDependency||e.loadExternalDependency(this._instance,i,e=>{e?lw.error("failed to load script",e):t()})}Kv(t){var e=t||(null==a?void 0:a.location.href);if(e){var i=this._instance.config.disable_capture_url_hashes?ar(e):e,r=this._instance.config.custom_personal_data_properties;return Hn(i,this._instance.config.mask_personal_data_properties?[...Ia,...r||[]]:[],Ra)}lw.error("Could not determine current URL")}}},tk={exceptionObserver:class{constructor(t){var e;this.Yv=()=>{var t;if(a&&this.isEnabled&&null!=(t=b.__PosthogExtensions__)&&t.errorWrappingFunctions){var e=b.__PosthogExtensions__.errorWrappingFunctions.wrapOnError,i=b.__PosthogExtensions__.errorWrappingFunctions.wrapUnhandledRejection,r=b.__PosthogExtensions__.errorWrappingFunctions.wrapConsoleError;try{!this.rc&&this._n.capture_unhandled_errors&&(this.rc=e(this.captureException.bind(this))),!this.nc&&this._n.capture_unhandled_rejections&&(this.nc=i(this.captureException.bind(this))),!this.sc&&this._n.capture_console_errors&&(this.sc=r(this.captureException.bind(this)))}catch(t){ow.error("failed to start",t),this.oc()}}},this._instance=t,this.ac=!(null==(e=this._instance.persistence)||!e.props[A]),this.wt=new Ze(n({},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,A:ow})),this._n=this.lc(),this.startIfEnabledOrStop()}lc(){var t=this._instance.config.capture_exceptions,e={capture_unhandled_errors:!1,capture_unhandled_rejections:!1,capture_console_errors:!1};return Te(t)?e=n({},e,t):(Ie(t)?this.ac:t)&&(e=n({},e,{capture_unhandled_errors:!0,capture_unhandled_rejections:!0})),e}get isEnabled(){return this._n.capture_console_errors||this._n.capture_unhandled_errors||this._n.capture_unhandled_rejections}startIfEnabledOrStop(){this.isEnabled?(ow.info("enabled"),this.oc(),this.do(this.Yv)):this.oc()}do(t){var e,i;null!=(e=b.__PosthogExtensions__)&&e.errorWrappingFunctions?t():null==(i=b.__PosthogExtensions__)||null==i.loadExternalDependency||i.loadExternalDependency(this._instance,"exception-autocapture",e=>{if(e)return ow.error("failed to load script",e);t()})}oc(){var t,e,i;null==(t=this.rc)||t.call(this),this.rc=void 0,null==(e=this.nc)||e.call(this),this.nc=void 0,null==(i=this.sc)||i.call(this),this.sc=void 0}onRemoteConfig(t){if(t.ok){var e=t.config;"autocaptureExceptions"in e&&(this.ac=!!e.autocaptureExceptions||!1,this._instance.persistence&&this._instance.persistence.register({[A]:this.ac}),this._n=this.lc(),this.startIfEnabledOrStop())}}onConfigChange(){this._n=this.lc()}captureException(t){try{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";if(this.wt.consumeRateLimit(n))return void ow.info("Skipping exception capture because of client rate limiting.",{exception:n});null==(r=this._instance.exceptions)||r.sendExceptionEvent(t)}catch(t){}}},exceptions:class{constructor(t){var e,i;this.uc=[],this.hc=rm(),this._instance=t,this.uc=null!==(e=null==(i=this._instance.persistence)?void 0:i.get_property("$error_tracking_suppression_rules"))&&void 0!==e?e:[],this.dc=Nr(this.vc()),this.cc=new qr(this.dc)}onConfigChange(){this.dc=Nr(this.vc()),this.cc.setConfig(this.dc)}onRemoteConfig(t){var e,i,r;if(t.ok){var n=t.config;if("errorTracking"in n){var s=null!==(e=null==(i=n.errorTracking)?void 0:i.suppressionRules)&&void 0!==e?e:[],o=null==(r=n.errorTracking)?void 0:r.captureExtensionExceptions;this.uc=s,this._instance.persistence&&this._instance.persistence.register({[P]:this.uc,[F]:o})}}}get fc(){var t,e,i=!!this._instance.get_property(F);return null!==(t=null!==(e=this._instance.config.error_tracking.captureExtensionExceptions)&&void 0!==e?e:i)&&void 0!==t&&t}buildProperties(t,e){return this.hc.buildFromUnknown(t,{syntheticException:null==e?void 0:e.syntheticException,mechanism:{handled:null==e?void 0:e.handled}})}addExceptionStep(t,e){if(this.dc.enabled)try{if(!Ee(t)||0===t.trim().length)return void Yg.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)=>Dr.has(r)?(e.push(r),i):(i[r]=t[r],i),{}),droppedKeys:e}}(this.gc(e)),r=i.sanitizedProperties,s=i.droppedKeys;s.length>0&&Yg.warn("Ignoring reserved exception step fields",{droppedKeys:s}),this.cc.add(n({[Or]:t,[$r]:(new Date).toISOString()},r))}catch(t){Yg.error("Failed to add exception step. Ignoring breadcrumb.",t)}}sendExceptionEvent(t){try{var e=t.$exception_list;if(this.mc(e)){if(this.yc(e))return this.bc("Exception dropped: matched a suppression rule"),void Yg.info("Skipping exception capture because a suppression rule matched");if(!this.fc&&this._c(e))return this.bc("Exception dropped: thrown by a browser extension"),void Yg.info("Skipping exception capture because it was thrown by an extension");if(!this.fc&&this.wc(e))return this.bc("Exception dropped: thrown by an injected browser script"),void Yg.info("Skipping exception capture because it was thrown by an injected browser script");if(!this._instance.config.error_tracking.__capturePostHogExceptions&&this.kc(e))return this.bc("Exception dropped: thrown by the PostHog SDK"),void Yg.info("Skipping exception capture because it was thrown by the PostHog SDK")}var i=this.dc.enabled&&Pe(t.$exception_steps)?this.Sc(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",Iu:!0});return n&&this.cc.clear(),n}catch(t){return Xg(t)||Yg.error("Failed to capture exception event. Dropping this exception.",t),void this.cc.clear()}}catch(t){return void(Xg(t)||Yg.error("Failed to process exception event. Ignoring this exception.",t))}var s}Sc(t){try{var e=this.cc.getAttachable();return 0===e.length?t:n({},t,{$exception_steps:e})}catch(e){return Yg.error("Failed to read buffered exception steps. Capturing exception without steps.",e),t}}bc(t){this.dc.enabled&&this.cc.add({[Or]:t,[$r]:(new Date).toISOString()})}gc(t){return Te(t)?n({},t):{}}vc(){var t,e;return null!==(t=null==(e=this._instance.config.error_tracking)?void 0:e.exception_steps)&&void 0!==t?t:{}}yc(t){if(0===t.length)return!1;try{var e=t.reduce((t,e)=>{var i=e.type,r=e.value;return Ee(i)&&i.length>0&&t.$exception_types.push(i),Ee(r)&&r.length>0&&t.$exception_values.push(r),t},{$exception_types:[],$exception_values:[]});return this.uc.some(t=>{var i=t.values.map(t=>{var i=ma[t.operator],r=e[t.key];if(!i||!r)return!1;var n=xe(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 Yg.warn("Failed to evaluate suppression rules. Capturing the exception.",t),!1}}_c(t){var e=t.flatMap(t=>{var e,i;return null!==(e=null==(i=t.stacktrace)?void 0:i.frames)&&void 0!==e?e:[]}),i=e.filter(t=>{var e=t.filename;return!!e&&em.some(t=>e.startsWith(t))});return 0!==i.length&&(!i.every(t=>{var e=t.filename;return!!e&&e.startsWith(tm)})||t.some(t=>{var e=t.value;return Ee(e)&&e.includes("isolatedAPI.contexts.topHostname")})&&!e.some(t=>{var e=t.filename;return t.in_app&&!(null!=e&&e.startsWith(tm))}))}wc(t){return t.some(t=>{var e=t.value;return Ee(e)&&im.some(t=>e.includes(t))})}kc(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:[];return null!==(r=null==(n=s[s.length-1])||null==(n=n.filename)?void 0:n.includes("posthog.com/static"))&&void 0!==r&&r}return!1}mc(t){return!Pe(t)&&xe(t)}}},ek=n({productTours:class{get Ya(){return this._instance.persistence}constructor(t){this.xc=null,this.Cc=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.Ya&&this.Ya.register({[L]:!!e.productTours}),!mw(this._instance))return!this.xc&&Pe(null==(i=this.Ya)?void 0:i.props.ph_product_tours)||gw.info("product tours disabled; stopping and clearing cached tours"),null==(r=this.xc)||r.stop(),this.xc=null,void this.clearCache();this.loadIfEnabled()}}}loadIfEnabled(){!this.xc&&mw(this._instance)&&this.do(()=>this.Tc())}do(t){var e,i;null!=(e=b.__PosthogExtensions__)&&e.generateProductTours?t():null==(i=b.__PosthogExtensions__)||null==i.loadExternalDependency||i.loadExternalDependency(this._instance,"product-tours",e=>{e?gw.error("Could not load product tours script",e):t()})}Tc(){var t;!this.xc&&null!=(t=b.__PosthogExtensions__)&&t.generateProductTours&&(this.xc=b.__PosthogExtensions__.generateProductTours(this._instance,!0))}getProductTours(t,e){if(void 0===e&&(e=!1),!xe(this.Cc)||e){var i=this.Ya;if(i){var r=i.props[_t];if(xe(r)&&!e)return this.Cc=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(mw(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||gw.warn(n):gw.error(n),void t([],{isLoaded:!1,error:n})}var s=xe(e.json.product_tours)?e.json.product_tours:[];this.Cc=s,i&&i.register({[_t]:s}),t(s,{isLoaded:!0})}else t([],{isLoaded:!0})}})}else t(this.Cc,{isLoaded:!0})}getActiveProductTours(t){Pe(this.xc)?t([],{isLoaded:!1,error:"Product tours not loaded"}):this.xc.getActiveProductTours(t)}showProductTour(t){var e;null==(e=this.xc)||e.showTourById(t)}previewTour(t){this.xc?this.xc.previewTour(t):this.do(()=>{var e;this.Tc(),null==(e=this.xc)||e.previewTour(t)})}dismissProductTour(){var t;null==(t=this.xc)||t.dismissTour("user_clicked_skip")}nextStep(){var t;null==(t=this.xc)||t.nextStep()}previousStep(){var t;null==(t=this.xc)||t.previousStep()}clearCache(){var t;this.Cc=null,null==(t=this.Ya)||t.unregister(_t)}resetTour(t){var e;null==(e=this.xc)||e.resetTour(t)}resetAllTours(){var t;null==(t=this.xc)||t.resetAllTours()}cancelPendingTour(t){var e;null==(e=this.xc)||e.cancelPendingTour(t)}}},Kw),ik={siteApps:class{constructor(t){this._instance=t,this.Mc=0,this.Ic=[],this.apps={}}get isEnabled(){return!!this._instance.config.opt_in_site_apps}Ec(t,e){if(e){var i=this.globalsForEvent(e);this.Ic.push(i),this.Ic.length>1e3&&(this.Ic=this.Ic.slice(10))}}get siteAppLoaders(){var t;return null==(t=b._POSTHOG_REMOTE_CONFIG)||null==(t=t[this._instance.config.token])?void 0:t.siteApps}initialize(){if(this.isEnabled){var t=this._instance._addCaptureHook(this.Ec.bind(this));this.Rc=()=>{t(),this.Ic=[],this.Rc=void 0}}}globalsForEvent(t){var e,s,o,a,l,u,h;if(!t)throw new Error("Event payload is required");var d={},v=this._instance.get_property("$groups")||[],c=this._instance.get_property("$stored_group_properties")||{};for(var f of Object.entries(c)){var p=f[0];d[p]={id:v[p],type:p,properties:f[1]}}var g=t.$set_once,m=t.$set;return{event:n({},r(t,i),{properties:n({},t.properties,m?{$set:n({},null!==(e=null==(s=t.properties)?void 0:s.$set)&&void 0!==e?e:{},m)}:{},g?{$set_once:n({},null!==(o=null==(a=t.properties)?void 0:a.$set_once)&&void 0!==o?o:{},g)}:{}),elements_chain:null!==(l=null==(u=t.properties)?void 0:u.$elements_chain)&&void 0!==l?l:"",distinct_id:null==(h=t.properties)?void 0:h.distinct_id}),person:{properties:this._instance.get_property("$stored_person_properties")},groups:d}}Ac(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)||(yw.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)||(yw.error("prepare_external_dependency_script returned null"),null):t}Pc(){var t,e,i,r,n,s,o,a;if(!this._instance.config.prepare_external_dependency_stylesheet&&!this._instance.config.prepare_external_dependency_script)return()=>{};var l=null==h?void 0:h.defaultView,u=null==l||null==(t=l.Node)?void 0:t.prototype;if(!l||!u)return()=>{};if(this.Mc++,this.Fc)return this.Oc();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.Ac(t);return e&&c.add(e),e},g=t=>t.map(t=>"string"==typeof t?t:p(t)).filter(t=>!Ae(t));return f(u,"appendChild",t=>function(e){var i=p(e);return i?t.call(this,i):e}),f(u,"insertBefore",t=>function(e,i){var r=p(e);return r?t.call(this,r,i):e}),f(u,"replaceChild",t=>function(e,i){var r=p(e);return r?t.call(this,r,i):i}),[null==(e=l.Element)?void 0:e.prototype,null==(i=l.Document)?void 0:i.prototype,null==(r=l.DocumentFragment)?void 0:r.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==(n=l.Element)?void 0:n.prototype,null==(s=l.CharacterData)?void 0:s.prototype,null==(o=l.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==(a=l.Element)?void 0:a.prototype,"insertAdjacentElement",t=>function(e,i){var r=p(i);return r?t.call(this,e,r):null}),this.Fc=()=>{d.forEach(t=>t()),this.Fc=void 0},this.Oc()}Oc(){var t=!1;return()=>{var e;t||(t=!0,this.Mc--,0===this.Mc&&(null==(e=this.Fc)||e.call(this)))}}$c(t,e){void 0===e&&(e=!0);var i=this.Pc();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.Ic.length&&(yw.info("Processing "+this.Ic.length+" events for site app with id "+t.id),this.Ic.forEach(t=>this.$c(()=>null==e.processEvent?void 0:e.processEvent(t))),e.processedBuffer=!0),Object.values(this.apps).every(t=>t.processedBuffer||t.errored)&&(null==(i=this.Rc)||i.call(this))},r=!1,n=n=>{e.errored=!n,e.loaded=!0,yw.info("Site app with id "+t.id+" "+(n?"loaded":"errored")),r&&i()};try{var s=this.$c(e=>t.init({posthog:this._instance,callback(t){e(),n(t)}}),!1).processEvent;s&&(e.processEvent=s),r=!0}catch(e){yw.error(bw+t.id,e),n(!1)}if(r&&e.loaded)try{i()}catch(i){yw.error("Error while processing buffered events PostHog app with config id "+t.id,i),e.errored=!0}}Dc(){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)}Lc(t){var e=this;if(0!==Object.keys(this.apps).length){var i=this.globalsForEvent(t),r=function(r){try{e.$c(()=>null==r.processEvent?void 0:r.processEvent(i))}catch(e){yw.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.Dc(),void this._instance.on("eventCaptured",t=>this.Lc(t))):void yw.error('PostHog site apps are disabled. Enable the "opt_in_site_apps" config to proceed.');if(null==(i=this.Rc)||i.call(this),t.ok){var s=t.config;if(null!=(r=s.siteApps)&&r.length)if(this.isEnabled){var o=function(){var t,e=a.id,i=a.url;b["__$$ph_site_app_"+e]=n._instance,null==(t=b.__PosthogExtensions__)||null==t.loadSiteApp||t.loadSiteApp(n._instance,i,t=>{if(t)return yw.error(bw+e,t)})};for(var a of s.siteApps)o()}else yw.error('PostHog site apps are disabled. Enable the "opt_in_site_apps" config to proceed.')}}}},rk={tracingHeaders:class{constructor(t){this._instance=t,this.Nc=void 0,this.qc=void 0,this.jc=void 0,this.Yv=()=>{var t,e,i=this.Bc();i?(Ie(this.Nc)&&(this.Nc=null==(t=b.__PosthogExtensions__)||null==(t=t.tracingHeadersPatchFns)?void 0:t._patchXHR(i,()=>this._instance.get_distinct_id(),this._instance.sessionManager)),Ie(this.qc)&&(this.qc=null==(e=b.__PosthogExtensions__)||null==(e=e.tracingHeadersPatchFns)?void 0:e._patchFetch(i,()=>this._instance.get_distinct_id(),this._instance.sessionManager))):this.oc()}}initialize(){this.startIfEnabledOrStop()}do(t){var e,i;null!=(e=b.__PosthogExtensions__)&&e.tracingHeadersPatchFns?t():null==(i=b.__PosthogExtensions__)||null==i.loadExternalDependency||i.loadExternalDependency(this._instance,"tracing-headers",e=>{if(e)return aw.error("failed to load script",e);t()})}Hc(){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}Bc(){var t=this.Hc();return xe(t)?(xe(this.jc)?this.jc.splice(0,this.jc.length,...t):this.jc=[...t],t.length>0?this.jc:void 0):(xe(this.jc)&&this.jc.splice(0),this.jc=t||void 0,this.jc)}oc(){var t,e;null==(t=this.Nc)||t.call(this),null==(e=this.qc)||e.call(this),this.Nc=void 0,this.qc=void 0}startIfEnabledOrStop(){this.Bc()?this.do(this.Yv):this.oc()}}},nk=n({surveys:class extends Sw{constructor(t){var e;super(new Ew(t),(e=t,{get projectToken(){return e.config.token},kv:new Iw(e)})),this._instance=t}Yu(t,e){var i=e.query?a_(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})})}}},Kw),sk={toolbar:class{constructor(t){this.instance=t}zc(t){b.ph_toolbar_state=t}Uc(){var t;return null!==(t=b.ph_toolbar_state)&&void 0!==t?t:0}initialize(){return this.maybeLoadToolbar()}maybeLoadToolbar(t,e,i){if(void 0===t&&(t=void 0),void 0===e&&(e=void 0),void 0===i&&(i=void 0),Dn(this.instance.config))return!1;if(!a||!h)return!1;t=null!=t?t:a.location,i=null!=i?i:a.history;try{if(!e){try{a.localStorage.setItem("test","test"),a.localStorage.removeItem("test")}catch(t){return!1}e=null==a?void 0:a.localStorage}var r,n=Rw||zn(t.hash,"__posthog")||zn(t.hash,"state"),s=n?Rn(()=>JSON.parse(atob(decodeURIComponent(n))))||Rn(()=>JSON.parse(decodeURIComponent(n))):null;return s&&"ph_authorize"===s.action?((r=s).source="url",r&&Object.keys(r).length>0&&(s.desiredHash?t.hash=s.desiredHash:i?i.replaceState(i.state,"",t.pathname+t.search):t.hash="")):((r=JSON.parse(e.getItem(Aw)||"{}")).source="localstorage",delete r.userIntent),!(!r.token||this.instance.config.token!==r.token||(this.loadToolbar(r),0))}catch(t){return!1}}Wc(t){var e=b.ph_load_toolbar||b.ph_load_editor;!Pe(e)&&Ce(e)?e(t,this.instance):Pw.warn("No toolbar load function found")}loadToolbar(t){var e=!(null==h||!h.getElementById("__POSTHOG_TOOLBAR__"));if(!a||e)return!1;var i="custom"===this.instance.requestRouter.region&&this.instance.config.advanced_disable_toolbar_metrics,r=n({token:this.instance.config.token},t,{apiURL:this.instance.requestRouter.endpointFor("ui")},i?{instrument:!1}:{});if(a.localStorage.setItem(Aw,JSON.stringify(n({},r,{source:void 0}))),2===this.Uc())this.Wc(r);else if(0===this.Uc()){var s;this.zc(1),null==(s=b.__PosthogExtensions__)||null==s.loadExternalDependency||s.loadExternalDependency(this.instance,"toolbar",t=>{if(t)return Pw.error("[Toolbar] Failed to load",t),void this.zc(0);this.zc(2),this.Wc(r)}),$n(a,"turbolinks:load",()=>{this.zc(0),this.loadToolbar(r)})}return!0}Vc(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)}}},ok=n({experiments:class t{get _n(){return this._instance.config}constructor(e){var i=this;this._instance=e,this.getWebExperimentsAndEvaluateDisplayLogic=function(e){void 0===e&&(e=!1),i.getWebExperiments(e=>{t.Gc("retrieved web experiments from the server"),i.Zc=new Map,e.forEach(e=>{if(e.feature_flag_key){var r;i.Zc&&(t.Gc("setting flag key ",e.feature_flag_key," to web experiment ",e),null==(r=i.Zc)||r.set(e.feature_flag_key,e));var n=i._instance.getFeatureFlag(e.feature_flag_key);Ee(n)&&e.variants[n]&&i.Jc(e.name,n,e.variants[n].transforms)}else if(e.variants)for(var s in e.variants){var o=e.variants[s];t.Qc(o,i._instance)&&i.Jc(e.name,s,o.transforms)}})},e)},this._instance.onFeatureFlags(t=>{this.onFeatureFlags(t)})}initialize(){}onFeatureFlags(e){if(this._is_bot())t.Gc(Bw);else if(!this._n.disable_web_experiments){if(Pe(this.Zc))return this.Zc=new Map,this.loadIfEnabled(),void this.previewWebExperiment();t.Gc("applying feature flags",e),e.forEach(t=>{var e;if(this.Zc&&null!=(e=this.Zc)&&e.has(t)){var i,r=this._instance.getFeatureFlag(t),n=null==(i=this.Zc)?void 0:i.get(t);r&&null!=n&&n.variants[r]&&this.Jc(n.name,r,n.variants[r].transforms)}})}}previewWebExperiment(){var e=t.getWindowLocation();if(null!=e&&e.search){var i=Bn(null==e?void 0:e.search,"__experiment_id"),r=Bn(null==e?void 0:e.search,"__experiment_variant");i&&r&&(t.Gc("previewing web experiments "+i+" && "+r),this.getWebExperiments(t=>{this.Kc(parseInt(i),r,t)},!1,!0))}}loadIfEnabled(){this._n.disable_web_experiments||this.getWebExperimentsAndEvaluateDisplayLogic()}getWebExperiments(t,e,i){if(this._n.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._n.token),method:"GET",timestampMode:"query",callback:e=>t(200===e.statusCode&&e.json&&e.json.experiments||[])})}Kc(e,i,r){var n=r.filter(t=>t.id===e);n&&n.length>0&&(t.Gc("Previewing web experiment ["+n[0].name+"] with variant ["+i+"]"),this.Jc(n[0].name,i,n[0].variants[i].transforms))}static Qc(e,i){return!Pe(e.conditions)&&t.Xc(e,i)&&t.Yc(e)}static Xc(e,i){var r;if(Pe(e.conditions)||Pe(null==(r=e.conditions)?void 0:r.url))return!0;var n=t.getWindowLocation();if(n){var s,o,a,l=Vn(i,n.href);return null==(s=e.conditions)||!s.url||Hw[null!==(o=null==(a=e.conditions)?void 0:a.urlMatchType)&&void 0!==o?o:"icontains"](e.conditions.url,l)}return!1}static getWindowLocation(){return null==a?void 0:a.location}static Yc(t){var e;if(Pe(t.conditions)||Pe(null==(e=t.conditions)?void 0:e.utm))return!0;var i=Pa();if(i.utm_source){var r,n,s,o,a,l,u,h,d=null==(r=t.conditions)||null==(r=r.utm)||!r.utm_campaign||(null==(n=t.conditions)||null==(n=n.utm)?void 0:n.utm_campaign)==i.utm_campaign,v=null==(s=t.conditions)||null==(s=s.utm)||!s.utm_source||(null==(o=t.conditions)||null==(o=o.utm)?void 0:o.utm_source)==i.utm_source,c=null==(a=t.conditions)||null==(a=a.utm)||!a.utm_medium||(null==(l=t.conditions)||null==(l=l.utm)?void 0:l.utm_medium)==i.utm_medium,f=null==(u=t.conditions)||null==(u=u.utm)||!u.utm_term||(null==(h=t.conditions)||null==(h=h.utm)?void 0:h.utm_term)==i.utm_term;return d&&c&&f&&v}return!1}static Gc(t){for(var e=arguments.length,i=new Array(e>1?e-1:0),r=1;e>r;r++)i[r-1]=arguments[r];xn.info("[WebExperiments] "+t,i)}Jc(e,i,r){this._is_bot()?t.Gc(Bw):"control"!==i?r.forEach(r=>{var n;r.selector&&(t.Gc("applying transform of variant "+i+" for experiment "+e+" ",r),null==(n=document)||null==(n=n.querySelectorAll(r.selector))||n.forEach(t=>{var e=t;r.html&&(e.innerHTML=r.html),r.css&&e.setAttribute("style",r.css)}))}):t.Gc("Control variants leave the page unmodified.")}_is_bot(){return u&&this._instance?M_(u,this._n.custom_blocked_useragents):void 0}}},Kw),ak=n({},Kw,Xw,Yw,tk,ek,ik,nk,rk,sk,ok,{conversations:class{constructor(t){this._instance=t,this.tf=void 0,this._conversationsManager=null,this.ef=!1,this.zt=null,this.if=!1}initialize(){this.loadIfEnabled()}onRemoteConfig(t){if(!this._instance.config.disable_conversations&&(this.rf=t.ok,t.ok)){var e=t.config.conversations;Pe(e)||($e(e)?this.tf=e:(this.tf=e.enabled,this.zt=e),this.loadIfEnabled())}}reset(){var t;null==(t=this._conversationsManager)||t.reset(),this._conversationsManager=null,this.tf=void 0,this.zt=null,this.rf=void 0,this.if=!1}loadIfEnabled(){if(!(this._conversationsManager||this.ef||this._instance.config.disable_conversations||Dn(this._instance.config)||this._instance.config.cookieless_mode&&this._instance.consent.isOptedOut())){var t=null==b?void 0:b.__PosthogExtensions__;if(t&&!Ie(this.tf)&&this.tf)if(this.zt&&this.zt.token){this.ef=!0;try{var e=t.initConversations;if(e)return this.nf(e),void(this.ef=!1);var i=t.loadExternalDependency;if(!i)return void this.sf(Yt);i(this._instance,"conversations",e=>{e||!t.initConversations?this.sf("Could not load conversations script",e):this.nf(t.initConversations),this.ef=!1})}catch(t){this.sf("Error initializing conversations",t),this.ef=!1}}else zw.error("Conversations enabled but missing token in remote config.")}}nf(t){if(this.zt)try{this._conversationsManager=t(this.zt,this._instance),this.if=!1,zw.info("Conversations loaded successfully")}catch(t){this.sf("Error completing conversations initialization",t)}else zw.error("Cannot complete initialization: remote config is null")}sf(t,e){zw.error(t,e),this._conversationsManager=null,this.ef=!1,this.if=!0}show(){this._conversationsManager?this._conversationsManager.show():zw.warn("Conversations not loaded yet.")}hide(){this._conversationsManager&&this._conversationsManager.hide()}isAvailable(){return!0===this.tf&&!Ae(this._conversationsManager)}getUnavailableReason(){return this.isAvailable()?null:this._instance.config.disable_conversations?"disabled_by_config":Dn(this._instance.config)?"disabled_for_toolbar":this._instance.config.cookieless_mode&&this._instance.consent.isOptedOut()?"consent_opted_out":!1===this.rf?"remote_config_failed":Ie(this.tf)?this.rf?"disabled_in_project":"remote_config_pending":this.tf?Pe(this.zt)||!this.zt.token?"missing_token":null!=b&&b.__PosthogExtensions__?this.ef?"initializing":this.if?"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 o(function*(){return r._conversationsManager?r._conversationsManager.sendMessage(t,e,i):(zw.warn(Uw),null)})()}getMessages(t,e){var i=this;return o(function*(){return i._conversationsManager?i._conversationsManager.getMessages(t,e):(zw.warn(Uw),null)})()}markAsRead(t){var e=this;return o(function*(){return e._conversationsManager?e._conversationsManager.markAsRead(t):(zw.warn(Uw),null)})()}getTickets(t){var e=this;return o(function*(){return e._conversationsManager?e._conversationsManager.getTickets(t):(zw.warn(Uw),null)})()}requestRestoreLink(t){var e=this;return o(function*(){return e._conversationsManager?e._conversationsManager.requestRestoreLink(t):(zw.warn(Uw),null)})()}restoreFromToken(t){var e=this;return o(function*(){return e._conversationsManager?e._conversationsManager.restoreFromToken(t):(zw.warn(Uw),null)})()}restoreFromUrlToken(){var t=this;return o(function*(){return t._conversationsManager?t._conversationsManager.restoreFromUrlToken():(zw.warn(Uw),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}Lu(){var t;null==(t=this._conversationsManager)||t.setIdentity()}Nu(){var t;null==(t=this._conversationsManager)||t.clearIdentity()}}},{logs:class{constructor(t){var e,i=this;this._instance=t,this.name=Wf,this.af=!1,this.lf=!1,this.uf=!1,this.A=Cn("[logs]"),this.hf=n({},this.A,{error(){for(var t=arguments.length,e=new Array(t),r=0;t>r;r++)e[r]=arguments[r];e.some(Qw)||i.A.error(...e)}}),this.Aa=[],this.df=[],this.Td=0,this.Js=!1,this.vf=[],this.cf=[],this.ff=!1,this.pf=!1,this.gf=()=>{var t,e;this.Js||(this.Td=0,null==(t=this.mf)||t.onReconnect(),null==(e=this.yf)||e.onReconnect())},this._instance&&null!=(e=this._instance.config.logs)&&e.captureConsoleLogs&&(this.af=!0),a&&$n(a,"online",this.gf)}bf(t,e,i,r){var n,s=Ww(null==(n=this._instance)||null==(n=n.config)?void 0:n.logs,i);return[new pn(this._f(t,e),s,this.hf,()=>this.wf(),t=>t(),void 0,r),s]}kf(){var t,e=null==(t=this._instance)||null==(t=t.config)?void 0:t.logs;if(!this.mf||this.Sf!==e){var i;null==(i=this.mf)||i.reset(),this.Sf=e;var r=this.bf(()=>this.Aa,t=>{this.Aa=t});this.mf=r[0],this.xf=r[1]}return this.mf}Cf(){var t,e=null==(t=this._instance)||null==(t=t.config)?void 0:t.logs;if(!this.yf||this.Tf!==e){var i;null==(i=this.yf)||i.reset(),this.Tf=e;var r=this.bf(()=>this.df,t=>{this.df=t},{serviceNameDefault:"posthog-browser-logs",consoleCapture:!0},Gw);this.yf=r[0],this.Mf=r[1]}return this.yf}setup(t){var e;if(!this.Js){this.Hs=t,null!=(e=this._instance)&&null!=(e=e.config)&&null!=(e=e.logs)&&e.captureConsoleLogs&&(this.af=!0),(this.af||this.If()&&this.Ef())&&this.Rf();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.Js?r.dispose():(this.Xs=r,i||this.loadIfEnabled())}}dispose(){var t,e,i,r;this.Js||(this.Js=!0,this.Af(),null==(t=this.Xs)||t.dispose(),this.Xs=void 0,this.Hs=void 0,this.uf=!1,null==a||a.removeEventListener("online",this.gf),null==(e=this.Pf)||e.call(this),this.Pf=void 0,null==(i=this.mf)||i.reset(),null==(r=this.yf)||r.reset())}onRemoteConfig(t){var e,i;if(!this.Js){var r=t.ok?null==(e=t.config.logs)?void 0:e.captureConsoleLogs:void 0;Pe(r)?this.Ff():(null==(i=this._instance)||null==(i=i.persistence)||i.register({[N]:!!r}),r?(this.af=!0,this.lf||this.Rf(),this.loadIfEnabled()):this.Ff())}}reset(){var t,e,i,r;this.Af(),null==(t=this.mf)||t.clearQueue(),this.Aa=[],null==(e=this.mf)||e.reset(),null==(i=this.yf)||i.clearQueue(),this.df=[],null==(r=this.yf)||r.reset(),this.Td=0}captureLog(t){this.Js||this.kf().captureLog(t)}captureConsoleLog(t){this.Js||this.Cf().captureLog(t)}captureBufferedConsoleLog(t,e,i){this.Js||this.Cf().captureLog(t,{context:e,occurredAtMs:i})}Ef(){var t;return!(null==(t=this._instance)||null==(t=t.persistence)||null==(t=t.props)||!t[N])}If(){var t,e;return null==(t=this._instance)||null==t.Ma||!t.Ma()||!(null==(e=b._POSTHOG_REMOTE_CONFIG)||null==(e=e[this._instance.config.token])||!e.config)}ju(){var t;this.Af(),null==(t=this.yf)||t.clearQueue(),this.df=[]}Ff(){this.af||this.Af()}Rf(){var t,e=this;if(!this.ff&&null!=b&&b.console){var i=Ww(null==(t=this._instance)||null==(t=t.config)?void 0:t.logs).maxBufferSize,r=function(t){var r;try{r=jg(b.console[t])}catch(t){return 0}if(!r)return 0;e.cf.push(gv(b.console,t,n=>{var s=function(){for(var r=arguments.length,s=new Array(r),o=0;r>o;o++)s[o]=arguments[o];try{e.Of(t,s,i)}catch(t){}return n.apply(b.console,s)};return s.__rrweb_original__=r,s}))};for(var n of Vw)r(n);this.ff=!0,this.$f=setTimeout(()=>{this.Af()},3e4)}}Of(t,e,i){var r;if(this.ff&&!this.pf&&0!==e.length)if(null!=(r=this._instance)&&r.is_capturing()){if(i>this.vf.length){this.pf=!0;try{this.vf.push({level:t,args:e,occurredAtMs:Date.now(),context:this.wf()})}finally{this.pf=!1}}}else this.Af()}Af(){if(this.vf=[],this.ff){for(var t of(this.ff=!1,this.$f&&(clearTimeout(this.$f),this.$f=void 0),this.cf))t();this.cf=[]}}Df(){var t=this.vf;return this.Af(),t}get logger(){return this.Lf||(this.Lf={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.Lf}flushLogs(t){t?this.Nf(t):(this.mf&&this.mf.flush().catch(t=>this.qf(t)),this.yf&&this.yf.flush().catch(t=>this.qf(t)))}qf(t){Qw(t)||this.A.error("PostHog logs flush failed:",t)}loadIfEnabled(){if(!this.Js&&this.af&&!this.lf&&!this.uf){var t=null==b?void 0:b.__PosthogExtensions__;if(!t)return this.A.error("PostHog Extensions not found."),void this.Af();var e=t.loadExternalDependency;if(!e)return this.A.error(Yt),void this.Af();this.uf=!0;try{e(this._instance,"logs",e=>{if(this.uf=!1,!this.Js&&this.af){var i=t.logs;if(e||null==i||!i.initializeLogs)this.A.error("Could not load logs script",e),this.Af();else{var r,n,s=this.Df();this.Pf=i.initializeLogs(null!==(r=this.Hs)&&void 0!==r?r:this._instance),this.lf=!0,s.length>0&&(null==i.replayConsoleBuffer||i.replayConsoleBuffer(null!==(n=this.Hs)&&void 0!==n?n:this._instance,s))}}})}catch(t){throw this.uf=!1,t}}}_f(t,e){var i=this._instance;return{get isDisabled(){return!1},get optedOut(){return!i.is_capturing()},getPersistedProperty:e=>e===pe.LogsQueue?t():void 0,setPersistedProperty(t,i){t===pe.LogsQueue&&e(null!=i?i:[])},gs:t=>this.gs(t),getLibraryId:()=>ea.LIB_NAME,getLibraryVersion:()=>ea.LIB_VERSION}}gs(t){return new Promise(e=>{if(Un(this.Td,3))e({kind:"fatal",error:Jw(void 0,"logs endpoint is unreachable, dropping batch")});else{var i=!1,r=t=>{i||(i=!0,clearTimeout(n),e(t))},n=setTimeout(()=>{this.A.warn("Logs request timed out before receiving a response"),r({kind:"retry-later",error:Jw(void 0,"logs request timed out")})},9e4);this._instance._send_request({method:"POST",url:this.jf(),data:t,compression:"best-available",batchKey:"logs",fireCallbackOnDrop:!0,callback:t=>{var e=t.statusCode;if(this.Bf(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.A.warn("Logs request failed before receiving an HTTP response"),r({kind:"retry-later",error:Jw(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)})}}})}})}Bf(t){(0!==t||this._instance.__loaded)&&(this.Td=Wn(t,this.Td,3,()=>this.A.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.")))}Nf(t){this.Aa.length>0&&this.Hf(t,this.Aa,this.xf,ea.LIB_NAME,t=>{this.Aa=t}),this.df.length>0&&this.Hf(t,this.df,this.Mf,Gw,t=>{this.df=t})}Hf(t,e,i,r,n){if(0!==e.length){var s=e.map(t=>t.record);n([]);var o=fn(s,cn(i,ea.LIB_NAME,ea.LIB_VERSION),r,ea.LIB_VERSION);this._instance._send_request({method:"POST",url:this.jf(),data:o,compression:"best-available",batchKey:"logs",transport:t})}}jf(){return this._instance.requestRouter.endpointFor("api","/i/v1/logs")+"?token="+encodeURIComponent(this._instance.config.token)}wf(){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,Pe(n)||(e.sessionStartTimestamp=n),Pe(s)||(e.lastActivityTimestamp=s)}if(null!=b&&null!=(t=b.location)&&t.href&&(e.currentUrl=this._instance.config.disable_capture_url_hashes?ar(b.location.href):b.location.href),this._instance.featureFlags){var o=this._instance.featureFlags.getFlags();o&&o.length>0&&(e.activeFeatureFlags=o)}return e}}},{metrics:class{constructor(t){this._instance=t,this.A=Cn("[metrics]")}initialize(){}kf(){var t,e,i=null==(t=this._instance)||null==(t=t.config)?void 0:t.metrics;return this.mf&&this.Sf===i||(null==(e=this.mf)||e.reset(),this.Sf=i,this.mf=new bn(this._f(),function(t){var e,i,r,n,s,o=null==t?void 0:t.resourceAttributes;return{serviceName:null!==(e=null==o?void 0:o["service.name"])&&void 0!==e?e:null==t?void 0:t.serviceName,serviceVersion:null!==(i=null==o?void 0:o["service.version"])&&void 0!==i?i:null==t?void 0:t.serviceVersion,environment:null!==(r=null==o?void 0:o["deployment.environment"])&&void 0!==r?r:null==t?void 0:t.environment,resourceAttributes:o,beforeSend:null==t?void 0:t.beforeSend,flushIntervalMs:null!==(n=null==t?void 0:t.flushIntervalMs)&&void 0!==n?n:1e4,maxSeriesPerFlush:null!==(s=null==t?void 0:t.maxSeriesPerFlush)&&void 0!==s?s:1e3}}(i),this.A)),this.mf}count(t,e,i){void 0===e&&(e=1),this.kf().count(t,e,i)}gauge(t,e,i){this.kf().gauge(t,e,i)}histogram(t,e,i){this.kf().histogram(t,e,i)}flush(t){if(!this.mf)return Promise.resolve();if(t){var e=this.mf.drainWindow();return e&&this.Fs(e,t),Promise.resolve()}return this.mf.flush().catch(t=>this.A.error("PostHog metrics flush failed:",t))}reset(){var t;null==(t=this.mf)||t.reset()}_f(){var t=this._instance,e=this;return{get isDisabled(){return!1},get optedOut(){return!t.is_capturing()},Fs:t=>e.Fs(t),getLibraryId:()=>ea.LIB_NAME,getLibraryVersion:()=>ea.LIB_VERSION}}Fs(t,e){return new Promise(i=>{var r=!1,s=t=>{r||(r=!0,clearTimeout(o),i(t))},o=setTimeout(()=>s({kind:"retry-later",error:new Error("metrics request timed out")}),9e4);this._instance._send_request(n({method:"POST",url:this.zf(),data:t,compression:"best-available",batchKey:"metrics"},e&&{transport:e},{fireCallbackOnDrop:!0,callback(t){var e,i=t.statusCode;s(i>=200&&300>i?{kind:"ok"}:413===i?{kind:"too-large"}:0!==i&&408!==i&&429!==i&&500>i?{kind:"fatal",error:new Error("metrics request failed with status "+i)}:{kind:"retry-later",error:null!==(e=t.error)&&void 0!==e?e:new Error("metrics request failed with status "+i)})}}))})}zf(){return this._instance.requestRouter.endpointFor("api","/i/v1/metrics")+"?token="+encodeURIComponent(this._instance.config.token)}}});nw.__defaultExtensionClasses=n({},ak),function(){ea.SDK_DIST_CHANNEL="cdn";var t=b.posthog;if(!t||xe(t._i)){var e=B_[K_]=new nw;if(t){var i=[];Mn(t._i,function(r){if(r&&xe(r)){var n=e.init(r[0],r[1],r[2]),s=t[r[2]]||t;n.__loaded&&-1===i.indexOf(s)&&(i.push(s),n._execute_array.call(n.people,s.people),n._execute_array(s))}})}e.__SV=1,b.posthog=e,function(){function t(){t.done||(t.done=!0,X_=!1,Mn(B_,function(t){t._dom_loaded()}))}null!=h&&h.addEventListener?"complete"===h.readyState?t():$n(h,"DOMContentLoaded",t,{capture:!1}):a&&xn.error("Browser doesn't support `document.addEventListener` so PostHog couldn't be initialized")}()}}()}()}();
1
+ !function(){var t=["type"],e=["retriesPerformedSoFar"],i=["$set_once","$set"];function r(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}function n(){return n=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},n.apply(null,arguments)}function s(t,e,i,r,n,s,o){try{var a=t[s](o),l=a.value}catch(t){return void i(t)}a.done?e(l):Promise.resolve(l).then(r,n)}function o(t){return function(){var e=this,i=arguments;return new Promise(function(r,n){var o=t.apply(e,i);function a(t){s(o,r,n,a,l,"next",t)}function l(t){s(o,r,n,a,l,"throw",t)}a(void 0)})}}!function(s){var a="u">typeof window?window:void 0,l="u">typeof globalThis?globalThis:a,u=null==l?void 0:l.navigator,h=null==l?void 0:l.document,d=null==l?void 0:l.location,v=null==l?void 0:l.fetch,c=null!=l&&l.XMLHttpRequest&&"withCredentials"in new l.XMLHttpRequest?l.XMLHttpRequest:void 0,f=null==l?void 0:l.AbortController,p=null==l?void 0:l.CompressionStream,g=null==u?void 0:u.userAgent;function m(){return!(!a||!1===a.navigator.onLine)}var y="undefined"!=typeof globalThis?globalThis:a;y&&"undefined"==typeof self&&(y.self=y),y&&"undefined"==typeof File&&(y.File=function(){});var b=null!=a?a:{},_="$people_distinct_id",w="distinct_id",k="$device_id",S="$device_model",x="__alias",C="__cmpns",T="$fbc",M="$fbc_persistence",I="__timers",E="$autocapture_disabled_server_side",R="$heatmaps_enabled_server_side",A="$exception_capture_enabled_server_side",P="$error_tracking_suppression_rules",F="$error_tracking_capture_extension_exceptions",O="$web_vitals_enabled_server_side",D="$dead_clicks_enabled_server_side",L="$product_tours_enabled_server_side",N="$logs_capture_enabled_server_side",q="$web_vitals_allowed_metrics",j="$session_recording_remote_config",B="$session_recording_enabled_server_side",H="$replay_sample_rate",z="$replay_override_sampling",U="$replay_override_linked_flag",W="$replay_override_url_trigger",V="$replay_override_event_trigger",G="$sesid",Z="$session_is_sampled",J="$session_past_minimum_duration",Q="$session_recording_url_trigger_activated_session",K="$session_recording_event_trigger_activated_session",X="$posthog_sr_group_event_trigger_",Y="$posthog_sr_group_url_trigger_",tt="$posthog_sr_group_sampling_",et="$debug_first_full_snapshot_timestamp",it="$sess_rec_flush_size",rt="$enabled_feature_flags",nt="$active_feature_flags",st="$early_access_features",ot="$feature_flag_details",at="$feature_flag_payloads",lt="$feature_flag_request_id",ut="$minimal_flag_called_events",ht="$override_feature_flags",dt="$override_feature_flag_payloads",vt="$stored_person_properties",ct="$stored_group_properties",ft="$groups",pt="$surveys",gt="$surveys_loaded_at",mt="$surveys_activated",yt="$surveys_activated_session",bt="$surveys_activated_timestamps",_t="ph_product_tours",wt="$product_tours_activated",kt="$product_tours_activated_session",St="$conversations_widget_session_id",xt="$conversations_ticket_id",Ct="$conversations_widget_state",Tt="$conversations_user_traits",Mt="$flag_call_reported",It="$flag_call_reported_session_id",Et="$feature_flag_errors",Rt="$feature_flag_evaluated_at",At="$user_state",Pt="$client_session_props",Ft="$capture_rate_limit",Ot="$initial_campaign_params",$t="$initial_referrer_info",Dt="$initial_person_info",Lt="$epp",Nt="$posthog_cookieless",qt="$cookieless_mode",jt="$sdk_debug_extensions_init_method",Bt="$sdk_debug_extensions_init_time_ms",Ht="$sdk_debug_recording_script_not_loaded",zt="$sdk_debug_replay_event_trigger_status",Ut="$sdk_debug_replay_linked_flag_trigger_status",Wt="$sdk_debug_replay_matched_recording_trigger_groups",Vt="$sdk_debug_replay_pending_trigger_conditions",Gt="$sdk_debug_replay_remote_trigger_matching_config",Zt="$sdk_debug_replay_trigger_groups_count",Jt="$sdk_debug_replay_url_trigger_status",Qt="$sdk_debug_rrweb_attached",Kt="$sdk_debug_rrweb_start_attempted",Xt="$session_recording_start_reason",Yt="PostHog loadExternalDependency extension not found.",te="anonymous",ee="identified",ie="identified_only",re="visibilitychange",ne="beforeunload",se="$pageview",oe="$pageleave",ae="$identify",le="$groupidentify",ue=["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"],he=function(t,e){if(void 0===e&&(e=[]),!t)return!1;var i=t.toLowerCase();return ue.concat(e).some(t=>{var e=t.toLowerCase();return-1!==i.indexOf(e)})};function de(t,e){return-1!==t.indexOf(e)}var ve=function(t){return t.trim()},ce=function(t){return t.replace(/^\$/,"")};function fe(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 pe=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}({}),ge=function(t){return t.GZipJS="gzip-js",t.Base64="base64",t}({}),me="min_length",ye="max_length",be=["$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"],we=Object.prototype,ke=we.hasOwnProperty,Se=we.toString,xe=Array.isArray||function(t){return"[object Array]"===Se.call(t)},Ce=t=>"function"==typeof t,Te=t=>t===Object(t)&&!xe(t),Me=t=>{if(Te(t)){for(var e in t)if(ke.call(t,e))return!1;return!0}return!1},Ie=t=>void 0===t,Ee=t=>"[object String]"==Se.call(t),Re=t=>Ee(t)&&0===t.trim().length,Ae=t=>null===t,Pe=t=>Ie(t)||Ae(t),Fe=t=>"[object Number]"==Se.call(t)&&t==t,Oe=t=>Fe(t)&&t>0,$e=t=>"[object Boolean]"===Se.call(t),De=t=>t instanceof FormData,Le=t=>de(be,t),Ne=t=>de(_e,t);function qe(t){return null===t||"object"!=typeof t}function je(t,e){return{}.toString.call(t)==="[object "+e+"]"}function Be(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 ze(t,Error)}}function He(t){return"u">typeof Event&&ze(t,Event)}function ze(t,e){try{return t instanceof e}catch(t){return!1}}var Ue=[!0,"true",1,"1","yes"],We=t=>de(Ue,t),Ve=[!1,"false",0,"0","no"];function Ge(t,e,i,r,n){return e>i&&(r.warn("min cannot be greater than max."),e=i),Fe(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),Ge(null!=n?n:i,e,i,r))}var Ze=class{constructor(t){this.C={},this.I=t.I,this.R=Ge(t.bucketSize,0,100,t.A),this.O=Ge(t.refillRate,0,this.R,t.A),this.F=Ge(t.refillInterval,0,864e5,t.A)}N(t,e){var i=Math.floor((e-t.lastAccess)/this.F);i>0&&(t.tokens=Math.min(t.tokens+i*this.O,this.R),t.lastAccess=t.lastAccess+i*this.F)}consumeRateLimit(t){var e,i=Date.now(),r=String(t),n=this.C[r];return n?this.N(n,i):this.C[r]=n={tokens:this.R,lastAccess:i},0===n.tokens||(n.tokens--,0===n.tokens&&(null==(e=this.I)||e.call(this,t)),0===n.tokens)}stop(){this.C={}}},Je="Mobile",Qe="Android",Ke="Tablet",Xe="Android Tablet",Ye="iPad",ti="Apple Watch",ei="Safari",ii="BlackBerry",ri="Samsung Internet",ni="Chrome",si="Chrome iOS",oi="Internet Explorer",ai="Internet Explorer Mobile",li="Opera",ui="Microsoft Edge",hi="Firefox",di="Firefox iOS",vi="Nintendo",ci="PlayStation",fi="Xbox",pi="Android Mobile",gi="Mobile Safari",mi="Windows",yi="Windows Phone",bi="Nokia",_i="Ouya",wi="Generic "+Je.toLowerCase(),ki="Generic "+Ke.toLowerCase(),Si="Konqueror",xi="Oculus Browser",Ci="Vivaldi",Ti="Yandex",Mi="Whale",Ii="DuckDuckGo",Ei="Pale Moon",Ri="Waterfox",Ai="Brave",Pi="Claude",Fi="Codex",Oi="ChatGPT",$i="Google Search App",Di=new RegExp("Version/(\\d+(\\.\\d+)?)"),Li=new RegExp("(Claude|Codex|ChatGPT)\\/(\\d+(\\.\\d+)?)"),Ni=new RegExp(fi,"i"),qi=new RegExp("PlayStation \\w+","i"),ji=new RegExp("Nintendo \\w+","i"),Bi=new RegExp("BlackBerry|PlayBook|BB10","i"),Hi={"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"},zi=function(t,e,i,r){e=e||"";var n=function(t){return null!=t&&t.brave?Ai:null}(i);return n||(null!=r&&r.detectGoogleSearchApp&&de(t,"GSA/")?$i:de(t," OPR/")&&de(t,"Mini")?"Opera Mini":de(t," OPR/")?li:Bi.test(t)?ii:de(t,"IEMobile")||de(t,"WPDesktop")?ai:de(t,"OculusBrowser")?xi:de(t,"SamsungBrowser")?ri:de(t,"Edge")||de(t,"Edg/")?ui:de(t,"Vivaldi/")?Ci:de(t,"YaBrowser/")?Ti:de(t,"Whale/")?Mi:de(t,"DuckDuckGo/")||de(t,"Ddg/")?Ii:de(t,"Claude/")?Pi:de(t,"Codex/")?Fi:de(t,"ChatGPT/")?Oi:de(t,"FBIOS")?"Facebook Mobile":de(t,"UCWEB")||de(t,"UCBrowser")?"UC Browser":de(t,"CriOS")?si:de(t,"CrMo")||de(t,ni)?ni:de(t,Qe)&&de(t,ei)?pi:de(t,"FxiOS")?di:de(t.toLowerCase(),Si.toLowerCase())?Si:de(t,"Brave/")?Ai:((t,e)=>e&&de(e,"Apple")||function(t){return de(t,ei)&&!de(t,ni)&&!de(t,Qe)}(t))(t,e)?de(t,Je)?gi:ei:de(t,"PaleMoon/")?Ei:de(t,"Waterfox/")?Ri:de(t,hi)?hi:de(t,"MSIE")||de(t,"Trident/")?oi:de(t,"Gecko")?hi:"")},Ui={[ai]:[new RegExp("rv:(\\d+(\\.\\d+)?)")],[ui]:[new RegExp("Edge?\\/(\\d+(\\.\\d+)?)")],[ni]:[new RegExp("(Chrome|CrMo)\\/(\\d+(\\.\\d+)?)")],[si]:[new RegExp("CriOS\\/(\\d+(\\.\\d+)?)")],"UC Browser":[new RegExp("(UCBrowser|UCWEB)\\/(\\d+(\\.\\d+)?)")],[ei]:[Di],[gi]:[Di],[li]:[new RegExp("(Opera|OPR)\\/(\\d+(\\.\\d+)?)")],[hi]:[new RegExp("Firefox\\/(\\d+(\\.\\d+)?)")],[di]:[new RegExp("FxiOS\\/(\\d+(\\.\\d+)?)")],[Si]:[new RegExp("Konqueror[:/]?(\\d+(\\.\\d+)?)","i")],[ii]:[new RegExp("BlackBerry (\\d+(\\.\\d+)?)"),Di],[pi]:[new RegExp("android\\s(\\d+(\\.\\d+)?)","i")],[ri]:[new RegExp("SamsungBrowser\\/(\\d+(\\.\\d+)?)")],[xi]:[new RegExp("OculusBrowser\\/(\\d+(\\.\\d+)?)")],[Ci]:[new RegExp("Vivaldi\\/(\\d+(\\.\\d+)?)")],[Ti]:[new RegExp("YaBrowser\\/(\\d+(\\.\\d+)?)")],[Mi]:[new RegExp("Whale\\/(\\d+(\\.\\d+)?)")],[Ai]:[new RegExp("Brave\\/(\\d+(\\.\\d+)?)")],[Pi]:[Li],[Fi]:[Li],[Oi]:[Li],[Ii]:[new RegExp("(DuckDuckGo|Ddg)\\/(\\d+(\\.\\d+)?)")],[Ei]:[new RegExp("PaleMoon\\/(\\d+(\\.\\d+)?)")],[Ri]:[new RegExp("Waterfox\\/(\\d+(\\.\\d+)?)")],[$i]:[new RegExp("GSA\\/(\\d+(\\.\\d+)?)")],[oi]:[new RegExp("(rv:|MSIE )(\\d+(\\.\\d+)?)")],Mozilla:[new RegExp("rv:(\\d+(\\.\\d+)?)")]},Wi=function(t,e,i,r){var n=Ui[zi(t,e,i,r)];if(Ie(n))return null;for(var s=0;n.length>s;s++){var o=t.match(n[s]);if(o)return parseFloat(o[o.length-2])}return null},Vi=[[new RegExp("Xbox; Xbox (.*?)[);]","i"),t=>[fi,t&&t[1]||""]],[new RegExp(vi,"i"),[vi,""]],[new RegExp(ci,"i"),[ci,""]],[Bi,[ii,""]],[new RegExp(mi,"i"),(t,e)=>{if(/Phone/.test(e)||/WPDesktop/.test(e))return[yi,""];if(new RegExp(Je).test(e)&&!/IEMobile\b/.test(e))return["Windows Mobile",""];var i=/Windows NT ([0-9.]+)/i.exec(e);if(i&&i[1]){var r=Hi[i[1]]||"";return/arm/i.test(e)&&(r="RT"),[mi,r]}return[mi,""]}],[/((iPhone|iPad|iPod).*?OS (\d+)_(\d+)_?(\d+)?|iPhone)/,t=>t&&t[3]?["iOS",[t[3],t[4],t[5]||"0"].join(".")]:["iOS",""]],[/(watch.*\/(\d+\.\d+\.\d+)|watch os,(\d+\.\d+),)/i,t=>{var e="";return t&&t.length>=3&&(e=Ie(t[2])?t[3]:t[2]),["watchOS",e]}],[new RegExp("(Android (\\d+)\\.(\\d+)\\.?(\\d+)?|Android)","i"),t=>t&&t[2]?[Qe,[t[2],t[3],t[4]||"0"].join(".")]:[Qe,""]],[/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/,["Chrome OS",""]],[/Linux|debian/i,["Linux",""]]],Gi=function(t){for(var e=0;Vi.length>e;e++){var i=Vi[e],r=i[1],n=i[0].exec(t),s=n&&(Ce(r)?r(n,t):r);if(s)return s}return["",""]},Zi=function(t){return ji.test(t)?vi:qi.test(t)?ci:Ni.test(t)?fi:new RegExp(_i,"i").test(t)?_i:new RegExp("(Windows Phone|WPDesktop)","i").test(t)?yi:/iPad/.test(t)?Ye:/iPod/.test(t)?"iPod Touch":/iPhone/.test(t)?"iPhone":/(watch)(?: ?os[,/]|\d,\d\/)[\d.]+/i.test(t)?ti:Bi.test(t)?ii:/(kobo)\s(ereader|touch)/i.test(t)?"Kobo":new RegExp(bi,"i").test(t)?bi:/(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(Je).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)?Qe:Xe:new RegExp("(pda|Mobile)","i").test(t)?wi:new RegExp(Ke,"i").test(t)&&!new RegExp("Tablet pc","i").test(t)?ki:""},Ji=function(t,e){var i,r,n,s,o=Zi(t);return o===Ye||o===Xe||"Kobo"===o||"Kindle Fire"===o||o===ki?Ke:o===vi||o===fi||o===ci||o===_i?"Console":o===ti?"Wearable":o?Je:"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)?Je:Ke:"Desktop"},Qi=/\bFBAV\/(\d+(?:\.\d+)*)/i,Ki=[[/\bInstagram(?:[ /](\d+(?:\.\d+)*))?\b/i,"Instagram"],[/\bBarcelona[ /](\d+(?:\.\d+)*)?/i,"Threads"],[/\b(?:MessengerForiOS|(?:FBAN|FB_IAB)\/Orca-Android)\b/i,"Messenger",Qi],[/\bFBAN\/EMA\b/i,"Facebook Lite",Qi],[/\b(?:FBIOS|(?:FBAN|FB_IAB)\/(?:FB4A|FBIOS))\b/i,"Facebook",Qi],[/\bLinkedInApp(?:\]?\/(\d+(?:\.\d+)*))?\b/i,"LinkedIn"],[/\bTwitter(?:Android| for (?:iPhone|iPad|Android))(?:\/(\d+(?:\.\d+)*))?\b/i,"Twitter"],[/\b(?:musical_ly|trill)(?:[_/](\d+\.\d+(?:\.\d+)*))?(?=\b|_)/i,"TikTok",/\bapp_version\/(\d+(?:\.\d+)*)/i],[/\b(?:MicroMessenger|WeChat)\/(\d+(?:\.\d+)*)?/i,"WeChat"],[/\bLine\/(\d+(?:\.\d+)*)?/i,"Line"],[/\bGSA\/(\d+(?:\.\d+)*)?/i,"Google"],[/\[Pinterest\/(?:iOS|Android)\b|\bPinterest(?: for (?:Android(?: Tablet)?|iOS))?\/(\d+(?:\.\d+)*)/i,"Pinterest"],[/\b(?:WA4A|WAiOS)\/(\d+(?:\.\d+)*)?/i,"WhatsApp"],[/\bSnapchat[ /](\d+(?:\.\d+)*)?/i,"Snapchat"],[/\bBing(?:Web|Sapphire)\/(\d+(?:\.\d+)*)?/i,"Bing"],[/\bNAVER\(inapp; search;/i,"Naver",/\bNAVER\(inapp; search;[^;)]*; (\d+(?:\.\d+)*)/i],[/\bKAKAOTALK[ /](\d+\.\d+(?:\.\d+)*)?/i,"KakaoTalk"]],Xi="[Truncated]",Yi="[Unserializable]";function tr(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}Date,Date;var er,ir,rr,nr=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;function sr(t,e){return"string"==typeof(i=t)&&nr.test(i)?t:e();var i}function or(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 ar(t){return t?t.split("#")[0]:t}function lr(t,e){var i=setTimeout(t,e);return null!=i&&i.unref&&(null==i||i.unref()),i}function ur(t,e,i){return hr.apply(this,arguments)}function hr(){return(hr=o(function*(t,e,i){var r;try{return yield Promise.race([t,new Promise((t,n)=>{r=lr(()=>{try{null==i||i(),t()}catch(t){n(t)}},e)})])}finally{clearTimeout(r)}})).apply(this,arguments)}function dr(t){var e=globalThis._posthogChunkIds;if(e){var i=Object.keys(e);return rr&&i.length===ir?rr:(ir=i.length,rr=i.reduce((i,r)=>{er||(er={});var n=er[r];if(n)i[n[0]]=n[1];else for(var s=t(r),o=s.length-1;o>=0;o--){var a,l=null==(a=s[o])?void 0:a.filename,u=e[r];if(l&&u){i[l]=u,er[r]=[l,u];break}}return i},{}))}}var vr=class{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 o(function*(){for(var i of t)i.stacktrace&&i.stacktrace.frames&&xe(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)),n({},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 o(function*(){var i=t;for(var r of e.modifiers)i=yield r(i);return i})()}convertToExceptionList(t,e){var i,r,s,o={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!==(s=t.synthetic)&&void 0!==s&&s}};t.stack&&(o.stacktrace={type:"raw",frames:t.stack});var a=[o];return null!=t.cause&&a.push(...this.convertToExceptionList(t.cause,n({},e,{handled:!0}))),a}buildParsingContext(t){var e;return{chunkIdMap:dr(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 n({},e,{syntheticException:0==i?e.syntheticException:void 0,mechanism:t,apply:t=>r(t,i),next:t=>r(t,i+1)})}};function cr(t,e,i,r,n){var s={platform:t,filename:e,function:"<anonymous>"===i?"?":i,in_app:!!e&&!e.startsWith("webkit-masked-url://")&&"<anonymous>"!==e};return Ie(r)||(s.lineno=r),Ie(n)||(s.colno=n),s}var fr=(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]:"?",i?"safari-extension:"+e:"safari-web-extension:"+e]:[t,e]},pr=/^\s*at (\S+?)(?::(\d+))(?::(\d+))\s*$/i,gr=/^\s*at (?:(.+?\)(?: \[.+\])?|.*?) ?\((?:address at )?)?(?:async )?((?:<anonymous>|[-a-z]+:|.*bundle|\/)?.*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i,mr=/\((\S*)(?::(\d+))(?::(\d+))\)/,yr=(t,e)=>{var i=pr.exec(t);if(i)return cr(e,i[1],"?",+i[2],+i[3]);var r=gr.exec(t);if(r){if(r[2]&&0===r[2].indexOf("eval")){var n=mr.exec(r[2]);n&&(r[2]=n[1],r[3]=n[2],r[4]=n[3])}var s=fr(r[1]||"?",r[2]);return cr(e,s[1],s[0],r[3]?+r[3]:void 0,r[4]?+r[4]:void 0)}},br=/^\s*(.*?)(?:\((.*?)\))?(?:^|@)?((?:[-a-z]+)?:\/.*?|\[native code\]|[^@]*(?:bundle|\d+\.js)|\/[\w\-. /=]+)(?::(\d+))?(?::(\d+))?\s*$/i,_r=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i,wr=(t,e)=>{var i=br.exec(t);if(i){if(i[3]&&i[3].indexOf(" > eval")>-1){var r=_r.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]||"?",o=fr(s,n);return cr(e,n=o[1],s=o[0],i[4]?+i[4]:void 0,i[5]?+i[5]:void 0)}},kr=/\(error: (.*)\)/;var Sr=class{match(t){return this.isDOMException(t)||this.isDOMError(t)}coerce(t,e){var i=Ee(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 je(t,"DOMException")}isDOMError(t){return je(t,"DOMError")}},xr=class{match(t){return Be(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}},Cr=class{match(t){return!!je(t,"ErrorEvent")&&(null!=t.error||this.Ki(t))}coerce(t,e){var i;if(null!=t.error)return e.apply(t.error);var r=e.apply(t.message);return n({},r,{stack:null!==(i=this.Xi(t))&&void 0!==i?i:r.stack,synthetic:!0})}Ki(t){return Ee(t.message)&&t.message.length>0}Xi(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(Ee(r.filename)&&0!==r.filename.length&&0!==n)return"Error\n at "+r.filename+":"+n+":"+s}},Tr=/^(?:[Uu]ncaught (?:exception: )?)?(?:((?:Eval|Internal|Range|Reference|Syntax|Type|URI|)Error): )?(.*)$/i,Mr=class{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(Tr);return r&&(e=r[1],i=r[2]),[e,i]}},Ir=["fatal","error","warning","log","info","debug"];function Er(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""}var Rr=class{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(He(t))return t.constructor.name;var e="name"in t?t.name:void 0;return Ee(e)&&!Re(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: "+Er(t)}isSeverityLevel(t){return Ee(t)&&!Re(t)&&Ir.indexOf(t)>=0}getStack(t){try{return Ee(t.stacktrace)&&t.stacktrace.length>0?t.stacktrace:Ee(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(Be(i))return i}}getObjectClassName(t){try{var e=Object.getPrototypeOf(t);return e?e.constructor.name:void 0}catch(t){return}}},Ar=class{match(t){return He(t)}coerce(t,e){var i,r=t.constructor.name;return{type:r,value:r+" captured as exception with keys: "+Er(t),stack:null==(i=e.syntheticException)?void 0:i.stack,synthetic:!0}}},Pr=class{match(t){return qe(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}}},Fr=class{match(t){return je(t,"PromiseRejectionEvent")||this.isCustomEventWrappingRejection(t)}isCustomEventWrappingRejection(t){if(!He(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 qe(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}},Or="$message",$r="$timestamp",Dr=new Set([Or,$r]),Lr={enabled:!0,max_bytes:32768};function Nr(t){var e;return t?{enabled:null!==(e=t.enabled)&&void 0!==e?e:Lr.enabled,max_bytes:jr(t.max_bytes,Lr.max_bytes)}:n({},Lr)}var qr=class{constructor(t){this.$n=[],this.Bn=0,this._n=Nr(t)}setConfig(t){this._n=Nr(t),this.Hn()}add(t){var e=function(t){var e;try{e=fe(t)}catch(t){return}try{var i=JSON.parse(e);if(!Te(i))return;var r=i,n=r[Or],s=r[$r];if(!Ee(n)||0===n.trim().length)return;if(!Ee(s)&&!Fe(s))return;return{step:r,json:e}}catch(t){return}}(t);if(e){var i=function(t){if("u">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._n.max_bytes||(this.$n.push({step:e.step,bytes:i}),this.Bn+=i,this.Hn())}}getAttachable(){return this.$n.map(t=>t.step)}clear(){this.$n=[],this.Bn=0}size(){return this.$n.length}Hn(){for(;this.Bn>this._n.max_bytes&&this.$n.length>0;){var t=this.$n.shift();t&&(this.Bn-=t.bytes)}}};function jr(t,e){if(!Fe(t)||1/0===t||-1/0===t)return e;var i=Math.floor(t);return 0>i?e:i}var Br=t=>{if("string"!=typeof t)return t;try{return JSON.parse(t)}catch(e){return t}};function Hr(t){return"string"==typeof t||t}function zr(t){return"string"==typeof t?t:void 0}var Ur,Wr=["$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"],Vr="NativeGzipValidationError",Gr=t=>t.length>=2&&31===t[0]&&139===t[1],Zr=(t,e)=>t===ge.GZipJS||e===ge.GZipJS||"gzip"===e,Jr=t=>!(!t||"object"!=typeof t)&&"NotReadableError"===("name"in t?String(t.name):""),Qr=t=>{if(!t||"object"!=typeof t)return!1;var e="name"in t?String(t.name):"";return Jr(t)||e===Vr},Kr=t=>{throw or(Vr,"Native gzip produced invalid output: "+t)},Xr=function(){var t=o(function*(t,e){18>t.size&&Kr("too-short");var i=new Uint8Array(yield t.slice(0,10).arrayBuffer());Gr(i)&&8===i[2]||Kr("invalid-header");var r=new DataView(yield t.slice(t.size-8).arrayBuffer());r.getUint32(0,!0)!==(t=>{for(var e=(()=>{if(Ur)return Ur;Ur=[];for(var t=0;256>t;t++){for(var e=t,i=0;8>i;i++)e=1&e?3988292384^e>>>1:e>>>1;Ur[t]=e>>>0}return Ur})(),i=4294967295,r=0;t.length>r;r++)i=e[255&(i^t[r])]^i>>>8;return(4294967295^i)>>>0})(e)&&Kr("invalid-crc");var n=e.length>>>0;r.getUint32(4,!0)!==n&&Kr("invalid-size")});return function(e,i){return t.apply(this,arguments)}}();function Yr(t,e,i){return tn.apply(this,arguments)}function tn(){return tn=o(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=o(function*(t){try{yield s.abort(t)}catch(t){}throw t});return function(e){return t.apply(this,arguments)}}()),l=new Response(n.readable).blob(),u=(yield Promise.all([l,a]))[0];return yield Xr(u,r),u}catch(t){if(null!=i&&i.rethrow)throw t;return e&&console.error("Failed to gzip compress data",t),null}}),tn.apply(this,arguments)}var en={}.propertyIsEnumerable;function rn(t,e){try{return on(t,e,{ancestors:new WeakSet,remainingNodes:1e4},0)}catch(t){return[]}}function nn(t,e,i,r){if(0>=i.remainingNodes)return{stringValue:Xi};if(i.remainingNodes--,$e(t))return{boolValue:t};if("bigint"==typeof t)return function(t,e){var i=t.toString(),r=BigInt("9223372036854775808");return t>=r||-r>t?(null==e||e.debug("Attribute "+i+" is outside the int64 range; encoding it as a string"),{stringValue:i}):{intValue:i}}(t,e);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(typeof BigInt>"u")return{stringValue:String(t)};var n=BigInt(t).toString();return t>=0x8000000000000000||-0x8000000000000000>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:tr(t)};if("function"==typeof t)return{stringValue:"[Function]"};if("symbol"==typeof t)return{stringValue:String(t)};if("object"==typeof t&&null!==t){if(i.ancestors.has(t))return{stringValue:"[Circular]"};if(r>=20)return{stringValue:Xi};if(t instanceof Date){var s=t.getTime(),o=Number.isFinite(s)?t.toISOString():String(t);return{stringValue:"string"==typeof o?tr(o):String(o)}}i.ancestors.add(t);try{try{var a=t.toJSON;if("function"==typeof a)return nn(a.call(t),e,i,r+1)}catch(t){}return xe(t)?{arrayValue:{values:sn(t,e,i,r+1)}}:{kvlistValue:{values:on(t,e,i,r+1)}}}finally{i.ancestors.delete(t)}}return{stringValue:tr(String(t))}}function sn(t,e,i,r){for(var n=[],s=Math.min(t.length,1e3),o=0;s>o&&i.remainingNodes>0;o++)try{var a=o in t?t[o]:void 0;if(Pe(a))continue;n.push(nn(a,e,i,r))}catch(t){n.push({stringValue:Yi})}return t.length>o&&n.push({stringValue:Xi}),n}function on(t,e,i,r){var n=[];for(var s in t)if(en.call(t,s)){if(!s){null==e||e.debug("Dropping an attribute with an empty key");continue}if(n.length>=1e3||0>=i.remainingNodes){null==e||e.debug("Attributes truncated: the value exceeds the OTLP encoder budget");break}try{var o=t[s];if(Ae(o)||Ie(o))continue;n.push({key:tr(s),value:nn(o,e,i,r)})}catch(t){n.push({key:tr(s),value:{stringValue:Yi}})}}return n}function an(t,e,i){return n({},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})}var ln={darwin:"macOS",win32:"Windows",linux:"Linux",android:"Android",freebsd:"FreeBSD",openbsd:"OpenBSD",sunos:"SunOS",aix:"AIX","Mac OS X":"macOS"};var un={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}},hn=un.info;function dn(t){try{return tr(String(t))}catch(t){return Yi}}function vn(t,e,i,r){var s,o=un[t.level||"info"]||hn,a=o.text,l=o.number,u=(void 0===(s=Fe(r)?r:void 0)&&(s=Date.now()),String(s)+"000000"),h={};e.distinctId&&(h.posthogDistinctId=e.distinctId),e.sessionId&&(h.sessionId=e.sessionId),e.windowId&&(h["window.id"]=e.windowId),Pe(e.sessionStartTimestamp)||(h.sessionStartTimestamp=String(e.sessionStartTimestamp)),Pe(e.lastActivityTimestamp)||(h.lastActivityTimestamp=String(e.lastActivityTimestamp)),e.currentUrl&&(h["url.full"]=e.currentUrl),e.screenName&&(h["screen.name"]=e.screenName),e.appState&&(h["app.state"]=e.appState),e.activeFeatureFlags&&e.activeFeatureFlags.length>0&&(h.feature_flags=e.activeFeatureFlags);var d=n({},h),v=t.attributes;if(v){var c=[];try{c=Object.keys(v)}catch(t){c=[]}for(var f of c){var p=void 0;try{p=v[f]}catch(t){p=Yi}Object.defineProperty(d,f,{value:p,enumerable:!0,writable:!0,configurable:!0})}}var g={timeUnixNano:u,observedTimeUnixNano:u,severityNumber:l,severityText:a,body:{stringValue:dn(t.body)},attributes:rn(d,i)};return t.trace_id&&(g.traceId=t.trace_id),t.span_id&&(g.spanId=t.span_id),Ie(t.trace_flags)||(g.flags=t.trace_flags),g}function cn(t,e,i){return an(t,e,i)}function fn(t,e,i,r){return{resourceLogs:[{resource:{attributes:rn(e)},scopeLogs:[{scope:{name:i,version:r},logRecords:t}]}]}}var pn=class{constructor(t,e,i,r,n,s,o){var a;void 0===s&&(s=()=>Promise.resolve()),this._instance=t,this._n=e,this.A=i,this.zn=r,this.Un=n,this.Wn=s,this.Vn=o,this.Gn=null,this.Zn=0,this.Jn=0,this.Qn=0,this.Kn=0,this.Xn=0,this.Yn=!1,this.ts=e.maxBufferSize,this.es=Math.max(null!==(a=e.maxQueueSize)&&void 0!==a?a:e.maxBufferSize,e.maxBufferSize),this.rs=e.flushIntervalMs,this.ns=e.maxBatchRecordsPerPost,this.ss=e.rateCapWindowMs,this.ls=e.maxLogsPerInterval}clearQueue(){this.Jn++,this._instance.setPersistedProperty(pe.LogsQueue,[])}reset(){this.us(),this.Kn=0,this.Xn=0,this.Yn=!1,this.Qn=0,this.ns=this._n.maxBatchRecordsPerPost}onReconnect(){this.Qn=0,this.hs()}captureLog(t,e){var i;if(!this._instance.isDisabled&&!this._instance.optedOut&&null!=t&&t.body){var r=this.ds(t);if(null!==r)if(r.body){if(this.vs()){var n={record:vn(r,null!==(i=null==e?void 0:e.context)&&void 0!==i?i:this.zn(),this.A,null==e?void 0:e.occurredAtMs)};this.Un(()=>this.cs(n))}}else this.A.info("Log was rejected in beforeSend function")}}ds(t){var e=this._n.beforeSend;if(!e)return t;var i=xe(e)?e:[e],r=t;for(var n of i)try{var s=n(r);if(!s)return this.A.info("Log was rejected in beforeSend function"),null;r=s}catch(t){return this.A.error("Error in beforeSend function for log:",t),null}return r}vs(){if(void 0===this.ls)return!0;var t=Date.now(),e=t-this.Kn;return this.ss>e&&e>=0||(this.Kn=t,this.Xn=0,this.Yn=!1),this.ls>this.Xn?(this.Xn++,!0):(this.Yn||(this.A.warn("captureLog dropping logs: exceeded "+this.ls+" logs per "+this.ss+"ms"),this.Yn=!0),!1)}flush(){var t=this;return o(function*(){if(!t._instance.isDisabled)return t.Gn||(t.Gn=t.fs().finally(()=>{t.Gn=null})),t.Gn})()}fs(){var t=this;return o(function*(){var e;t.us();var i=null!==(e=t._instance.getPersistedProperty(pe.LogsQueue))&&void 0!==e?e:[];if(0!==i.length)for(var r=i.length,n=0;i.length>0&&r>n;){var s,o,a=t.Jn;t.Zn=0;var l=Math.min(i.length,t.ns),u=i.slice(0,l),h=fn(u.map(t=>t.record),t.ps(),null!==(s=t.Vn)&&void 0!==s?s:t._instance.getLibraryId(),t._instance.getLibraryVersion()),d=yield t._instance.gs(h);if(t.Jn!==a)return;if("too-large"===d.kind&&u.length>1)t.ns=Math.max(1,Math.floor(u.length/2)),t.A.warn("Received 413 when sending logs batch of size "+u.length+", reducing batch size to "+t.ns);else{if("retry-later"===d.kind)throw d.error;if("too-large"===d.kind?t.A.warn("Dropping a single log record after 413 with batch size 1 — the record is larger than the server cap and cannot be split further."):"ok"===d.kind&&t._n.maxBatchRecordsPerPost>t.ns&&(t.ns=Math.min(t._n.maxBatchRecordsPerPost,t.ns+1)),yield t.ys(u.length),i=null!==(o=t._instance.getPersistedProperty(pe.LogsQueue))&&void 0!==o?o:[],n+=u.length,"fatal"===d.kind)throw d.error}}})()}ys(t){var e=this;return o(function*(){var i,r=Math.max(0,t-e.Zn),n=null!==(i=e._instance.getPersistedProperty(pe.LogsQueue))&&void 0!==i?i:[];e._instance.setPersistedProperty(pe.LogsQueue,n.slice(r)),yield e.Wn()})()}ps(){return cn(this._n,this._instance.getLibraryId(),this._instance.getLibraryVersion())}cs(t){var e;if(!this._instance.optedOut){var i=null!==(e=this._instance.getPersistedProperty(pe.LogsQueue))&&void 0!==e?e:[];this.es>i.length||(i.shift(),this.Zn++,this.A.info("Logs queue is full, dropping oldest record.")),i.push(t),this._instance.setPersistedProperty(pe.LogsQueue,i),this.ts>i.length?this.bs():this.hs()}}bs(t){void 0===t&&(t=this.rs),this._s||(this._s=lr(()=>{this._s=void 0,this.hs()},t))}ws(){var t=Math.min(Math.max(0,this.Qn-1),6);return this.rs*Math.pow(2,t)}ks(){var t=this._instance.getPersistedProperty(pe.LogsQueue);return!!t&&t.length>0}shutdown(t){var e=this;return o(function*(){e.us();var i=e.flush().catch(()=>{});void 0!==t?yield ur(i,t):yield i})()}flushWithTimeout(t){var e=this;return o(function*(){var i=e.flush();yield ur(i,t,()=>{i.catch(()=>{})})})()}hs(){this.flush().then(()=>{this.Qn=0},t=>{this.Qn++,this.A.error("PostHog logs flush failed:",t)}).finally(()=>{!this._instance.isDisabled&&this.ks()&&this.bs(this.ws())})}us(){this._s&&(clearTimeout(this._s),this._s=void 0)}},gn=[0,5,10,25,50,75,100,250,500,750,1e3,2500,5e3,7500,1e4];function mn(t){return String(t)+"000000"}function yn(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}var bn=class{constructor(t,e,i){this._instance=t,this._n=e,this.A=i,this.Ss=new Map,this.Gn=null,this.xs=!1,this.Cs=new Map,this.Ts=new Set,this.Ms=0}count(t,e,i){void 0===e&&(e=1),this.Is({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.Is({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.Is({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.Gn,i=function(){var i=o(function*(){e&&(yield e.catch(()=>{})),yield t.Es()});return function(){return i.apply(this,arguments)}}()().finally(()=>{this.Gn===i&&(this.Gn=null)});return this.Gn=i,i}drainWindow(){if(0===this.Ss.size)return null;var t=this.Ss;return this.Ss=new Map,this.xs=!1,this.Cs=new Map,this.Ts=new Set,this.Rs(t)}reset(){this.Ms++,this.us(),this.Ss=new Map,this.Gn=null,this.xs=!1,this.Cs=new Map,this.Ts=new Set}Is(t){if(!this._instance.isDisabled&&!this._instance.optedOut){var e=this.ds(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.A.warn("Dropping count '"+e.name+"': counters are monotonic, value must be >= 0");else{var i,r;try{i=e.attributes?n({},e.attributes):void 0,r=yn(e.type,e.name,e.unit,i)}catch(t){return void this.A.warn("Dropping metric '"+e.name+"': attributes could not be serialized",t)}var s=this.Ss.get(r);if(!s){if(!this.As())return;s={name:e.name,type:e.type,unit:e.unit,attributes:i,windowStartMs:Date.now()},this.Ss.set(r,s)}var o=this.Cs.get(e.name);void 0===o?this.Cs.set(e.name,e.type):o===e.type||this.Ts.has(e.name)||(this.Ts.add(e.name),this.A.warn("Metric name '"+e.name+"' is already used as a "+o+"; recording it as a "+e.type+" too will blend both series in charts. Use a distinct name.")),this.Ps(s,e.value),this.bs()}else this.A.warn("Dropping metric '"+e.name+"': value must be a finite number");else this.A.warn("Dropping metric with empty name")}}As(){return this._n.maxSeriesPerFlush>this.Ss.size||(this.xs||(this.xs=!0,this.A.warn("Metric series cap reached ("+this._n.maxSeriesPerFlush+" per flush window); dropping new series until the next flush. Reduce attribute cardinality.")),!1)}Ps(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(gn.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,gn)]+=1}}ds(t){var e=this._n.beforeSend;if(!e)return t;var i=xe(e)?e:[e],r=t;for(var n of i)try{var s=n(r);if(!s)return this.A.info("Metric was rejected in beforeSend function"),null;r=s}catch(t){return this.A.error("Error in beforeSend function for metric:",t),null}return r}bs(){this._s||(this._s=lr(()=>{this._s=void 0,this.flush().catch(t=>{this.A.error("Metrics flush failed:",t)})},this._n.flushIntervalMs))}us(){this._s&&(clearTimeout(this._s),this._s=void 0)}Es(){var t=this;return o(function*(){if(0!==t.Ss.size){var e=t.Ss;t.Ss=new Map,t.xs=!1,t.Cs=new Map,t.Ts=new Set;var i=t.Ms,r=yield t._instance.Fs(t.Rs(e));if(i===t.Ms)switch(r.kind){case"ok":return;case"retry-later":return t.Os(e),void t.bs();case"too-large":return void t.A.warn("Metrics batch exceeded the server size limit and was dropped");case"fatal":return void t.A.error("Failed to send metrics batch:",r.error)}}})()}Rs(t){return e=this.$s(t),i=function(t,e,i){return an(t,e,i)}(this._n,this._instance.getLibraryId(),this._instance.getLibraryVersion()),r=this._instance.getLibraryId(),n=this._instance.getLibraryVersion(),{resourceMetrics:[{resource:{attributes:rn(i)},scopeMetrics:[{scope:{name:r,version:n},metrics:e}]}]};var e,i,r,n}$s(t){var e=mn(Date.now()),i=new Map;for(var r of t.values()){var s,o=yn(r.type,r.name,r.unit,void 0),a=i.get(o);a||(a=n({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(o,a));var l=rn(null!==(s=r.attributes)&&void 0!==s?s:{},this.A),u=mn(r.windowStartMs);if("count"===r.type){var h,d={attributes:l,startTimeUnixNano:u,timeUnixNano:e,asDouble:null!==(h=r.total)&&void 0!==h?h:0};a.sum.dataPoints.push(d)}else if("gauge"===r.type){var v,c={attributes:l,timeUnixNano:e,asDouble:null!==(v=r.last)&&void 0!==v?v:0};a.gauge.dataPoints.push(c)}else r.hist&&a.histogram.dataPoints.push({attributes:l,startTimeUnixNano:u,timeUnixNano:e,count:r.hist.count,sum:r.hist.sum,min:r.hist.min,max:r.hist.max,bucketCounts:r.hist.bucketCounts,explicitBounds:gn})}return Array.from(i.values())}Os(t){var e,i;for(var r of t){var n=r[0],s=r[1],o=this.Ss.get(n);if(o)switch(o.windowStartMs=Math.min(o.windowStartMs,s.windowStartMs),o.type){case"count":o.total=(null!==(e=o.total)&&void 0!==e?e:0)+(null!==(i=s.total)&&void 0!==i?i:0);break;case"gauge":break;case"histogram":if(s.hist)if(o.hist){o.hist.count+=s.hist.count,o.hist.sum+=s.hist.sum,o.hist.min=Math.min(o.hist.min,s.hist.min),o.hist.max=Math.max(o.hist.max,s.hist.max);for(var a=0;o.hist.bucketCounts.length>a;a++)o.hist.bucketCounts[a]+=s.hist.bucketCounts[a]}else o.hist=s.hist}else this.As()&&this.Ss.set(n,s)}}};function _n(t,e){var i;if(t)return null==(i=t.find(t=>t.type===e))?void 0:i.value}var wn="0.8.2",kn={DEBUG:!1,LIB_VERSION:wn,LIB_NAME:"browser-common",JS_SDK_VERSION:wn},Sn=function(t,e){var i=(void 0===e?{}:e).debugEnabled,r={q(e){for(var r=arguments.length,n=new Array(r>1?r-1:0),s=1;r>s;s++)n[s-1]=arguments[s];a&&(kn.DEBUG||a.POSTHOG_DEBUG||i)&&!Ie(a.console)&&a.console&&("__rrweb_original__"in a.console[e]?a.console[e].__rrweb_original__:a.console[e])(t,...n)},debug(){for(var t=arguments.length,e=new Array(t),i=0;t>i;i++)e[i]=arguments[i];r.q("debug",...e)},info(){for(var t=arguments.length,e=new Array(t),i=0;t>i;i++)e[i]=arguments[i];r.q("log",...e)},warn(){for(var t=arguments.length,e=new Array(t),i=0;t>i;i++)e[i]=arguments[i];r.q("warn",...e)},error(){for(var t=arguments.length,e=new Array(t),i=0;t>i;i++)e[i]=arguments[i];r.q("error",...e)},critical(){for(var e=arguments.length,i=new Array(e),r=0;e>r;r++)i[r]=arguments[r];console.error(t,...i)},uninitializedWarning(t){r.error("You must initialize PostHog before calling "+t)},createLogger:(e,i)=>Sn(t+" "+e,i)};return r},xn=Sn("[PostHog.js]"),Cn=xn.createLogger;function Tn(t,e){xe(t)&&t.forEach(e)}function Mn(t,e){if(!Pe(t))if(xe(t))t.forEach(e);else if(De(t))t.forEach((t,i)=>e(t,i));else for(var i in t)ke.call(t,i)&&e(t[i],i)}var In=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 En(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 Rn=function(t){try{return t()}catch(t){return}},An=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){xn.critical("Implementation error. Please turn on debug mode and open a ticket on https://app.posthog.com/home#panel=support%3Asupport%3A."),xn.critical(t)}}},Pn=function(t){var e={};return Mn(t,function(t,i){(Ee(t)&&t.length>0||Fe(t))&&(e[i]=t)}),e};function Fn(t){var e=n({},t);for(var i of["name","message","stack","cause","errors"])try{i in t&&(e[i]=t[i])}catch(t){}return e}var On=["herokuapp.com","vercel.app","netlify.app"];function $n(t){var e=null==t?void 0:t.hostname;if(!Ee(e))return!1;var i=e.split(".").slice(-2).join(".");for(var r of On)if(i===r)return!1;return!0}function Dn(t,e,i,r){var n=null!=r?r:{},s=n.capture,o=n.passive;null==t||t.addEventListener(e,i,{capture:void 0!==s&&s,passive:void 0===o||o})}function Ln(t){return"ph_toolbar_internal"===t.name}var Nn=["localhost","127.0.0.1"],qn=(t,e)=>{try{var i;return JSON.stringify(t,(t,e)=>Be(e)?(null!=i||(i=new WeakMap),i.has(e)||i.set(e,Fn(e)),i.get(e)):"bigint"==typeof e?e.toString():e,e)}catch(e){return fe(t)}},jn=t=>{var e=null==h?void 0:h.createElement("a");return Ie(e)?null:(e.href=t,e)},Bn=function(t,e){var i,r;void 0===e&&(e="&");var n=[];return Mn(t,function(t,e){Ie(t)||Ie(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)},Hn=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(!xe(i)||2>i.length)return"";var o=i[1];try{o=decodeURIComponent(o)}catch(t){xn.error("Skipping decoding for malformed query param: "+o)}return o.replace(/\+/g," ")},zn=function(t,e,i){if(!t||!e||!e.length)return t;for(var r=t.split("#"),n=r[1],s=(r[0]||"").split("?"),o=s[1],a=s[0],l=(o||"").split("&"),u=[],h=0;l.length>h;h++){var d=l[h].split("=");xe(d)&&(e.includes(d[0])?u.push(d[0]+"="+i):u.push(l[h]))}var v=a;return null!=o&&(v+="?"+u.join("&")),null!=n&&(v+="#"+n),v},Un=function(t,e){var i=t.match(new RegExp(e+"=([^&]*)"));return i?i[1]:null},Wn=(t,e)=>t>=e&&m(),Vn=(t,e,i,r)=>{if(0===t){if(m()){var n=e+1;return n===i&&r(),n}return e}return 0};function Gn(t,e){var i,r=null==t||null==(i=t.config)?void 0:i.get_current_url;if(!Ce(r))return e;try{var n=r(e);return Ee(n)&&n?n:e}catch(t){return xn.error("Error in get_current_url, falling back to window.location.href",t),e}}function Zn(t){var e,i=null==a||null==(e=a.location)?void 0:e.href;return Ie(i)?void 0:Gn(t,i)}function Jn(t){return t instanceof Element&&("__POSTHOG_TOOLBAR__"===t.id||!(null==t.closest||!t.closest(".toolbar-global-fade-container")))}function Qn(t){return!!t&&1===t.nodeType}function Kn(t,e){return!!t&&!!t.tagName&&t.tagName.toLowerCase()===e.toLowerCase()}function Xn(t){return!!t&&3===t.nodeType}function Yn(t){return!!t&&11===t.nodeType&&Qn(t.host)}function ts(t){return t?ve(t).split(/\s+/):[]}function es(t,e){var i=Zn(e);return!!(i&&t&&t.some(t=>i.match(t)))}function is(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 ts(e)}function rs(t){return Pe(t)?null:ve(t).split(/(\s+)/).filter(t=>Es(t)).join("").replace(/[\r\n]/g," ").replace(/[ ]+/g," ").substring(0,255)}function ns(t){var e="";return _s(t)&&!ws(t)&&t.childNodes&&t.childNodes.length&&Mn(t.childNodes,function(t){var i;Xn(t)&&t.textContent&&(e+=null!==(i=rs(t.textContent))&&void 0!==i?i:"")}),ve(e)}function ss(t){var e;return Ie(t.target)?t.srcElement||null:null!=(e=t.target)&&e.shadowRoot?t.composedPath()[0]||null:t.target||null}var os=["a","button","form","input","select","textarea","label"];function as(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}}function ls(t,e){if(Ie(e))return!0;var i,r=function(t){if(e.some(e=>as(t,e)))return{v:!0}};for(var n of t)if(i=r(n))return i.v;return!1}function us(t){var e=t.parentNode;return!(!e||!Qn(e))&&e}var hs=[".ph-no-autocapture","[data-ph-no-autocapture]"],ds=["next","previous","prev",">","<"],vs=[...ds,"+","-","−","–"],cs=(t,e)=>/[a-z0-9]/i.test(e)?t.includes(e):t===e,fs=[".ph-no-deadclick",".ph-no-capture"],ps=[".ph-no-rageclick",".ph-no-capture"],gs=["","text","search","email","password","url","tel","number"];function ms(t,e){if(!a||ys(t))return!1;var i,r,n,s,o;if($e(e)?(i=!!e&&ps,r=void 0,n=!1):(i=null!==(s=null==e?void 0:e.css_selector_ignorelist)&&void 0!==s?s:ps,r=null==e?void 0:e.content_ignorelist,n=null!==(o=null==e?void 0:e.ignore_text_selection)&&void 0!==o&&o),!1===i)return!1;if(n&&function(t){return!(!t||!Qn(t))&&(!!Kn(t,"textarea")||(Kn(t,"input")?de(gs,(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)))}(t))return!1;var l=bs(t,!1).targetElementList;return!function(t,e){if(!1===t||Ie(t))return!1;var i;if(!0===t)i=ds;else{if(!xe(t))return!1;if(t.length>10)return xn.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=>cs(e,t)||cs(r,t))})}(r,l.map(t=>{var e;return{safeText:ns(t).toLowerCase(),ariaLabel:(null==(e=t.getAttribute("aria-label"))?void 0:e.toLowerCase().trim())||""}}))&&!ls(l,i)}var ys=t=>!t||Kn(t,"html")||!Qn(t),bs=(t,e)=>{if(!a||ys(t))return{parentIsUsefulElement:!1,targetElementList:[]};for(var i=!1,r=[t],n=t;n.parentNode&&!Kn(n,"body");)if(Yn(n.parentNode))r.push(n.parentNode.host),n=n.parentNode.host;else{var s=us(n);if(!s)break;if(e||os.indexOf(s.tagName.toLowerCase())>-1)i=!0;else try{var o=a.getComputedStyle(s);o&&"pointer"===o.getPropertyValue("cursor")&&(i=!0)}catch(t){}r.push(s),n=s}return{parentIsUsefulElement:i,targetElementList:r}};function _s(t){for(var e=new Set,i=0,r=t;r.parentNode&&!Kn(r,"body");r=r.parentNode){if(i++>=1e3||e.has(r))return!1;e.add(r);var n=is(r);if(de(n,"ph-sensitive")||de(n,"ph-no-capture"))return!1}if(de(is(t),"ph-include"))return!0;var s=t.type||"";if(Ee(s))switch(s.toLowerCase()){case"hidden":case"password":return!1}var o=t.name||t.id||"";return!Ee(o)||!/^cc|cardnum|ccnum|creditcard|csc|cvc|cvv|exp|pass|pwd|routing|seccode|securitycode|securitynum|socialsec|socsec|ssn/i.test(o.replace(/[^a-zA-Z0-9]/g,""))}function ws(t){return!!(Kn(t,"input")&&!["button","checkbox","submit","reset"].includes(t.type)||Kn(t,"select")||Kn(t,"textarea")||"true"===t.getAttribute("contenteditable"))}var ks=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}))$"),Ss=/(^|[^0-9A-Za-z_])([0-9][0-9 -]*[0-9])(?=$|[^0-9A-Za-z_])/g,xs=[16,15,14,13],Cs=new RegExp("^(\\d{3}-?\\d{2}-?\\d{4})$"),Ts=new RegExp("(^|[^0-9])((?!000|666)[0-9]{3}-?(?!00)[0-9]{2}-?(?!0000)[0-9]{4})(?=$|([^0-9]))","g"),Ms=/[0-9A-Za-z_]/;function Is(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 Es(t,e){if(void 0===e&&(e=!0),Pe(t))return!1;if(Ee(t)){if(t=ve(t),e?ks.test((t||"").replace(/[- ]/g,"")):function(t){var e;for(Ss.lastIndex=0;e=Ss.exec(t);){var i=e[2];if(i)for(var r=i.replace(/[- ]/g,""),n=0;r.length>n;n++)for(var s of xs){var o=n+s;if(r.length>=o){var a=r.slice(n,o);if(ks.test(a)&&Is(a))return!0}}}return!1}(t))return!1;if(e?Cs.test(t):function(t){var e;for(Ts.lastIndex=0;e=Ts.exec(t);){var i=e[1],r=e[3];if(!(i&&r&&Ms.test(i)&&Ms.test(r)))return!0}return!1}(t))return!1}return!0}function Rs(t){var e=ns(t);return Es(e=(e+" "+As(t)).trim())?e:""}function As(t){var e="";return t&&t.childNodes&&t.childNodes.length&&Mn(t.childNodes,function(t){var i;if(t&&"span"===(null==(i=t.tagName)?void 0:i.toLowerCase()))try{var r=ns(t);e=(e+" "+r).trim(),t.childNodes&&t.childNodes.length&&(e=(e+" "+As(t)).trim())}catch(t){xn.error("[AutoCapture]",t)}}),e}function Ps(t){return t.replace(/"|\\"/g,'\\"')}function Fs(t){var e=t.attr__class;if(e)return xe(e)?e:ts(e)}var Os=1e6;function $s(t){var e;return Math.min(Os,null!==(e=t.payloadSizeLimitBytes)&&void 0!==e?e:1e6)}var Ds={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:Os,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},Ls=["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"],Ns=["password","secret","passwd","api_key","apikey","auth","credentials","mysql_pwd","privatekey","private_key","token"],qs=["auth","token","secret","session","api-key","apikey","api_key","credential","password","passwd","cookie","csrf","xsrf"],js=t=>{Pe(t)||Mn(Object.keys(t),e=>{(t=>{var e=t.toLowerCase();return Ls.includes(e)||qs.some(t=>e.includes(t))})(e)&&(t[e]="redacted")})},Bs=["/s/","/e/","/i/"];function Hs(t,e,i,r){if(Pe(t))return t;var n=(null==e?void 0:e["content-length"])||function(t){return new Blob([t]).size}(t);return Ee(n)&&(n=parseInt(n)),n>i?"[SessionRecording] "+r+" body too large to record ("+n+" bytes)":t}function zs(t,e){if(Pe(t))return t;var i=t;return Es(i,!1)||(i="[SessionRecording] "+e+" body redacted"),Mn(Ns,t=>{var r,n;null!=(r=i)&&r.length&&-1!==(null==(n=i)?void 0:n.indexOf(t))&&(i="[SessionRecording] "+e+" body redacted as might contain: "+t)}),i}var Us=new WeakSet,Ws="disabled",Vs="sampled",Gs="active",Zs="buffering",Js="paused",Qs="lazy_loading",Ks="rrweb_error",Xs="trigger_activated",Ys="trigger_pending",to="trigger_disabled";function eo(t,e,i,r,n,s){return 0===e?to:(null==t?void 0:t.get_property(i?r+i:n))===s?Xs:Ys}function io(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 ro(t){return t.includes("trigger_activated")?Xs:t.includes("trigger_pending")?Ys:to}function no(t){var e=new Set(t);switch(e.delete(to),e.size){case 0:return to;case 1:return Array.from(e)[0];default:return Ys}}var so=class{constructor(t){this.j=t}triggerStatus(t){return ro(this.j.map(e=>e.triggerStatus(t)))}triggerStatusNoSideEffects(t){return ro(this.j.map(e=>e.triggerStatusNoSideEffects(t)))}stop(){this.j.forEach(t=>t.stop())}},oo=class{constructor(t){this.j=t}triggerStatus(t){return no(this.j.map(e=>e.triggerStatus(t)))}triggerStatusNoSideEffects(t){return no(this.j.map(e=>e.triggerStatusNoSideEffects(t)))}stop(){this.j.forEach(t=>t.stop())}},ao=class{triggerStatus(){return this.triggerStatusNoSideEffects()}triggerStatusNoSideEffects(){return Xs}stop(){}},lo=t=>"sessionRecording"in t,uo=class{constructor(t,e){this._instance=t,this.B=[],this.H=[],this.$=new Map,this.U=new Map,this.W="",this.urlBlocked=!1,this.V=e}onConfig(t){var e,i;this.B=(lo(t)?Te(t.sessionRecording)?null==(e=t.sessionRecording)?void 0:e.urlTriggers:[]:null==t?void 0:t.urlTriggers)||[],this.H=(lo(t)?Te(t.sessionRecording)?null==(i=t.sessionRecording)?void 0:i.urlBlocklist:[]:null==t?void 0:t.urlBlocklist)||[],this.Z()}Z(){for(var t of(this.$.clear(),this.U.clear(),this.B))if("regex"===t.matching&&!this.$.has(t.url))try{this.$.set(t.url,new RegExp(t.url))}catch(e){xn.error("Invalid URL trigger regex pattern:",t.url,e)}for(var e of this.H)if("regex"===e.matching&&!this.U.has(e.url))try{this.U.set(e.url,new RegExp(e.url))}catch(t){xn.error("Invalid URL blocklist regex pattern:",e.url,t)}}onRemoteConfig(t){this.onConfig(t)}G(t){return eo(this._instance,this.B.length,this.V,Y,Q,t)}triggerStatus(t){var e=this.triggerStatusNoSideEffects(t);return this._instance.register_for_session({[Jt]:e}),e}triggerStatusNoSideEffects(t){return this.G(t)}isCurrentUrlBlocked(){var t=Zn(this._instance);if(!t)return!1;try{return io(t,this.H,this.U)}catch(t){return!0}}checkUrlBlocklist(t,e){var i=Zn(this._instance);if(i&&i!==this.W){this.W=i;var r=this.urlBlocked,n=io(i,this.H,this.U);r&&n||(n&&!r?t():!n&&r&&e())}}checkUrlTriggerConditions(t,e,i,r){var n=Zn(this._instance);if(n&&n!==this.W){this.W=n;var s=this.urlBlocked,o=io(n,this.H,this.U);o&&!s?t():!o&&s&&e();var a=this.G(r)===Xs,l=io(n,this.B,this.$);!a&&l&&i("url",n)}}stop(){this.W=""}},ho=class{constructor(t){this._instance=t,this.linkedFlag=null,this.linkedFlagSeen=!1,this.J=()=>{}}triggerStatus(){var t=this.triggerStatusNoSideEffects();return this._instance.register_for_session({[Ut]:t}),t}triggerStatusNoSideEffects(){var t=Ys;return Pe(this.linkedFlag)&&(t=to),this.linkedFlagSeen&&(t=Xs),t}onConfig(t,e){var i;if(this.linkedFlag=(lo(t)?Te(t.sessionRecording)?null==(i=t.sessionRecording)?void 0:i.linkedFlag:null:null==t?void 0:t.linkedFlag)||null,!Pe(this.linkedFlag)&&!this.linkedFlagSeen){var r=Ee(this.linkedFlag)?this.linkedFlag:this.linkedFlag.flag,n=Ee(this.linkedFlag)?null:this.linkedFlag.variant;this.J=this._instance.onFeatureFlags((t,i)=>{var s=!1;if(Te(i)&&r in i){var o=i[r];s=$e(o)?!0===o:n?o===n:!!o}var a=s&&!this.linkedFlagSeen;this.linkedFlagSeen=s,a&&e(r,n)})}}onRemoteConfig(t,e){this.onConfig(t,e)}stop(){this.J()}},vo=class{constructor(t,e){this._instance=t,this.K=[],this.V=e}onConfig(t){var e;this.K=(lo(t)?Te(t.sessionRecording)?null==(e=t.sessionRecording)?void 0:e.eventTriggers:[]:null==t?void 0:t.eventTriggers)||[]}onRemoteConfig(t){this.onConfig(t)}X(t){return eo(this._instance,this.K.length,this.V,X,K,t)}triggerStatus(t){var e=this.triggerStatusNoSideEffects(t);return this._instance.register_for_session({[zt]:e}),e}triggerStatusNoSideEffects(t){return this.X(t)}checkEventTriggerConditions(t,e,i){if(0!==this.K.length){var r=this.X(i)===Xs,n=this.K.includes(t);!r&&n&&e("event",t)}}stop(){}},co=class{constructor(t,e,i){if(this._instance=t,this.group=e,this.Y=new uo(t,e.id),this.tt=new vo(t,e.id),this.et=new ho(t),e.conditions.events&&e.conditions.events.length>0||e.conditions.urls&&e.conditions.urls.length>0||e.conditions.flag){var r=(e.conditions.events||[]).map(t=>t.name),n={urlTriggers:e.conditions.urls||[],eventTriggers:r,linkedFlag:e.conditions.flag||null,urlBlocklist:[]};this.Y.onConfig(n),this.tt.onConfig(n),this.et.onConfig(n,i);var s=[this.tt,this.Y,this.et];this.rt="any"===e.conditions.matchType?new so(s):new oo(s)}else this.rt=new ao}triggerStatus(t){return this.rt.triggerStatus(t)}triggerStatusNoSideEffects(t){return this.rt.triggerStatusNoSideEffects(t)}getPendingTriggerConditions(t){return"trigger_pending"!==this.triggerStatusNoSideEffects(t)?[]:[{label:"URL condition not matched",status:this.Y.triggerStatusNoSideEffects(t)},{label:"event condition not matched",status:this.tt.triggerStatusNoSideEffects(t)},{label:"linked flag condition not matched",status:this.et.triggerStatusNoSideEffects()}].filter(t=>t.status===Ys).map(t=>t.label)}checkEventTriggerConditions(t,e,i){this.tt.checkEventTriggerConditions(t,e,i)}checkUrlTriggerConditions(t,e,i,r){this.Y.checkUrlTriggerConditions(t,e,i,r)}activateTrigger(t,e){var i,r="url"===t?Y+this.group.id:X+this.group.id;null==(i=this._instance.persistence)||i.register({[r]:e})}stop(){this.Y.stop(),this.tt.stop(),this.et.stop()}};function fo(t){if(t.rrwebError)return Ks;if(!t.receivedFlags)return Zs;if(!t.isRecordingEnabled)return Ws;if(t.urlTriggerMatching.urlBlocked)return Js;var e=!0===t.isSampled,i=new so([t.eventTriggerMatching,t.urlTriggerMatching,t.linkedFlagMatching]).triggerStatus(t.sessionId);return e?Vs:"trigger_activated"===i?Gs:"trigger_pending"===i?Zs:!1===t.isSampled?Ws:Gs}function po(t){if(t.rrwebError)return Ks;if(!t.receivedFlags)return Zs;if(!t.isRecordingEnabled)return Ws;if(t.urlTriggerMatching.urlBlocked)return Js;var e=new oo([t.eventTriggerMatching,t.urlTriggerMatching,t.linkedFlagMatching]).triggerStatus(t.sessionId),i=e!==to,r=$e(t.isSampled);return i&&"trigger_pending"===e?Zs:i&&"trigger_disabled"===e||r&&!t.isSampled?Ws:!0===t.isSampled?Vs:Gs}function go(){var t=[];return function(e,i){if(Te(i)||xe(i)){for(;t.length>0&&t[t.length-1]!==this;)t.pop();return t.includes(i)?"[Circular]":(t.push(i),i)}return i}}function mo(t){var e=JSON.stringify(t,go());return e?new Blob([e]).size:0}function yo(t){if(Ae(t))return 4;if(Ie(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(xe(t)){for(var e=2,i=0;t.length>i;i++){i>0&&(e+=1);var r=t[i];e+=Ie(r)||Ae(r)?4:yo(r)}return e}var n=t,s=2,o=!0;for(var a in n)if({}.hasOwnProperty.call(n,a)){var l=n[a];Ie(l)||(o||(s+=1),o=!1,s+=a.length+3+yo(l))}return s;default:return 0}}function bo(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[bo({size:r.reduce((t,e)=>t+e,0),data:t.data.slice(0,i),sizes:r,sessionId:t.sessionId,windowId:t.windowId}),bo({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 _o=Uint8Array,wo=Uint16Array,ko=Uint32Array,So=new _o([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]),xo=new _o([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]),Co=new _o([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),To=function(t,e){for(var i=new wo(31),r=0;31>r;++r)i[r]=e+=1<<t[r-1];var n=new ko(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]},Mo=To(So,2),Io=Mo[1];Mo[0][28]=258,Io[258]=28;for(var Eo=To(xo,0)[1],Ro=new wo(32768),Ao=0;32768>Ao;++Ao){var Po=(43690&Ao)>>>1|(21845&Ao)<<1;Ro[Ao]=((65280&(Po=(61680&(Po=(52428&Po)>>>2|(13107&Po)<<2))>>>4|(3855&Po)<<4))>>>8|(255&Po)<<8)>>>1}var Fo=function(t,e,i){for(var r=t.length,n=0,s=new wo(e);r>n;++n)++s[t[n]-1];var o,a=new wo(e);for(n=0;e>n;++n)a[n]=a[n-1]+s[n-1]<<1;if(i){o=new wo(1<<e);var l=15-e;for(n=0;r>n;++n)if(t[n])for(var u=n<<4|t[n],h=e-t[n],d=a[t[n]-1]++<<h,v=d|(1<<h)-1;v>=d;++d)o[Ro[d]>>>l]=u}else for(o=new wo(r),n=0;r>n;++n)o[n]=Ro[a[t[n]-1]++]>>>15-t[n];return o},Oo=new _o(288);for(Ao=0;144>Ao;++Ao)Oo[Ao]=8;for(Ao=144;256>Ao;++Ao)Oo[Ao]=9;for(Ao=256;280>Ao;++Ao)Oo[Ao]=7;for(Ao=280;288>Ao;++Ao)Oo[Ao]=8;var $o=new _o(32);for(Ao=0;32>Ao;++Ao)$o[Ao]=5;var Do=Fo(Oo,9,0),Lo=Fo($o,5,0),No=function(t){return(t/8|0)+(7&t&&1)},qo=function(t,e,i){(null==e||0>e)&&(e=0),(null==i||i>t.length)&&(i=t.length);var r=new(t instanceof wo?wo:t instanceof ko?ko:_o)(i-e);return r.set(t.subarray(e,i)),r},jo=function(t,e,i){var r=e/8|0;t[r]|=i<<=7&e,t[r+1]|=i>>>8},Bo=function(t,e,i){var r=e/8|0;t[r]|=i<<=7&e,t[r+1]|=i>>>8,t[r+2]|=i>>>16},Ho=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 _o(0),0];if(1==n){var o=new _o(i[0].s+1);return o[i[0].s]=1,[o,1]}i.sort(function(t,e){return t.f-e.f}),i.push({s:-1,f:25001});var a=i[0],l=i[1],u=0,h=1,d=2;for(i[0]={s:-1,f:a.f+l.f,l:a,r:l};h!=n-1;)a=i[i[d].f>i[u].f?u++:d++],l=i[u!=h&&i[d].f>i[u].f?u++:d++],i[h++]={s:-1,f:a.f+l.f,l:a,r:l};var v=s[0].s;for(r=1;n>r;++r)s[r].s>v&&(v=s[r].s);var c=new wo(v+1),f=zo(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 _o(c),f]},zo=function(t,e,i){return-1==t.s?Math.max(zo(t.l,e,i+1),zo(t.r,e,i+1)):e[t.s]=i},Uo=function(t){for(var e=t.length;e&&!t[--e];);for(var i=new wo(++e),r=0,n=t[0],s=1,o=function(t){i[r++]=t},a=1;e>=a;++a)if(t[a]==n&&a!=e)++s;else{if(!n&&s>2){for(;s>138;s-=138)o(32754);s>2&&(o(s>10?s-11<<5|28690:s-3<<5|12305),s=0)}else if(s>3){for(o(n),--s;s>6;s-=6)o(8304);s>2&&(o(s-3<<5|8208),s=0)}for(;s--;)o(n);s=1,n=t[a]}return[i.subarray(0,r),e]},Wo=function(t,e){for(var i=0,r=0;e.length>r;++r)i+=t[r]*e[r];return i},Vo=function(t,e,i){var r=i.length,n=No(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)},Go=function(t,e,i,r,n,s,o,a,l,u,h){jo(e,h++,i),++n[256];for(var d=Ho(n,15),v=d[0],c=d[1],f=Ho(s,15),p=f[0],g=f[1],m=Uo(v),y=m[0],b=m[1],_=Uo(p),w=_[0],k=_[1],S=new wo(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=Ho(S,7),T=C[0],M=C[1],I=19;I>4&&!T[Co[I-1]];--I);var E,R,A,P,F=u+5<<3,O=Wo(n,Oo)+Wo(s,$o)+o,D=Wo(n,v)+Wo(s,p)+o+14+3*I+Wo(S,T)+(2*S[16]+3*S[17]+7*S[18]);if(O>=F&&D>=F)return Vo(e,h,t.subarray(l,l+u));if(jo(e,h,1+(O>D)),h+=2,O>D){E=Fo(v,c,0),R=v,A=Fo(p,g,0),P=p;var L=Fo(T,M,0);for(jo(e,h,b-257),jo(e,h+5,k-1),jo(e,h+10,I-4),h+=14,x=0;I>x;++x)jo(e,h+3*x,T[Co[x]]);h+=3*I;for(var N=[y,w],q=0;2>q;++q){var j=N[q];for(x=0;j.length>x;++x)jo(e,h,L[B=31&j[x]]),h+=T[B],B>15&&(jo(e,h,j[x]>>>5&127),h+=j[x]>>>12)}}else E=Do,R=Oo,A=Lo,P=$o;for(x=0;a>x;++x)if(r[x]>255){var B;Bo(e,h,E[257+(B=r[x]>>>18&31)]),h+=R[B+257],B>7&&(jo(e,h,r[x]>>>23&31),h+=So[B]);var H=31&r[x];Bo(e,h,A[H]),h+=P[H],H>3&&(Bo(e,h,r[x]>>>5&8191),h+=xo[H])}else Bo(e,h,E[r[x]]),h+=R[r[x]];return Bo(e,h,E[256]),h+R[256]},Zo=new ko([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),Jo=new _o(0),Qo=function(){for(var t=new ko(256),e=0;256>e;++e){for(var i=e,r=9;--r;)i=(1&i&&3988292384)^i>>>1;t[e]=i}return t}(),Ko=function(t,e,i){for(;i;++e)t[e]=i,i>>>=8};function Xo(t,e){void 0===e&&(e={});var i=function(){var t=4294967295;return{p(e){for(var i=t,r=0;e.length>r;++r)i=Qo[255&i^e[r]]^i>>>8;t=i},d(){return 4294967295^t}}}(),r=t.length;i.p(t);var n,s,o,a,l,u=(n=t,s=e,o=function(t){return 10+(t.filename&&t.filename.length+1||0)}(e),a=8,function(t,e,i,r,n,s){var o=t.length,a=new _o(r+o+5*(1+Math.floor(o/7e3))+n),l=a.subarray(r,a.length-n),u=0;if(!e||8>o)for(var h=0;o>=h;h+=65535){var d=h+65535;o>d?u=Vo(l,u,t.subarray(h,d)):(l[h]=s,u=Vo(l,u,t.subarray(h,o)))}else{for(var v=Zo[e-1],c=v>>>13,f=8191&v,p=(1<<i)-1,g=new wo(32768),m=new wo(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 ko(25e3),k=new wo(288),S=new wo(32),x=0,C=0,T=(h=0,0),M=0,I=0;o>h;++h){var E=_(h),R=32767&h,A=m[E];if(g[R]=A,m[E]=R,h>=M){var P=o-h;if((x>7e3||T>24576)&&P>423){u=Go(t,l,0,w,k,S,C,T,I,h-I,u),T=x=C=0,I=h;for(var F=0;286>F;++F)k[F]=0;for(F=0;30>F;++F)S[F]=0}var O=2,D=0,L=f,N=R-A&32767;if(P>2&&E==_(h-N))for(var q=Math.min(c,P)-1,j=Math.min(32767,h),B=Math.min(258,P);j>=N&&--L&&R!=A;){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,D=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,A=W)}}}N+=(R=A)-(A=g[R])+32768&32767}if(D){w[T++]=268435456|Io[O]<<18|Eo[D];var G=31&Io[O],Z=31&Eo[D];C+=So[G]+xo[Z],++k[257+G],++S[Z],M=h+O,++x}else w[T++]=t[h],++k[t[h]]}}u=Go(t,l,s,w,k,S,C,T,I,h-I,u),s||(u=Vo(l,u,Jo))}return qo(a,0,r+No(u)+n)}(n,null==s.level?6:s.level,null==s.mem?Math.ceil(1.5*Math.max(8,Math.min(13,Math.log(n.length)))):12+s.mem,o,a,!l)),h=u.length;return 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&&Ko(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)}}(u,e),Ko(u,h-8,i.d()),Ko(u,h-4,r),u}function Yo(t,e){var i=t.length;if(!e&&"undefined"!=typeof TextEncoder)return(new TextEncoder).encode(t);for(var r=new _o(t.length+(t.length>>>1)),n=0,s=function(t){r[n++]=t},o=0;i>o;++o){if(n+5>r.length){var a=new _o(n+8+(i-o<<1));a.set(r),r=a}var l=t.charCodeAt(o);128>l||e?s(l):2048>l?(s(192|l>>>6),s(128|63&l)):l>55295&&57344>l?(s(240|(l=65536+(1047552&l)|1023&t.charCodeAt(++o))>>>18),s(128|l>>>12&63),s(128|l>>>6&63),s(128|63&l)):(s(224|l>>>12),s(128|l>>>6&63),s(128|63&l))}return qo(r,0,n)}function ta(t,e){var i="";if(!e&&"undefined"!=typeof TextDecoder)return(new TextDecoder).decode(t);for(var r=0;t.length>r;){var n=t[r++];128>n||e?i+=String.fromCharCode(n):224>n?i+=String.fromCharCode((31&n)<<6|63&t[r++]):240>n?i+=String.fromCharCode((15&n)<<12|(63&t[r++])<<6|63&t[r++]):(n=((15&n)<<18|(63&t[r++])<<12|(63&t[r++])<<6|63&t[r++])-65536,i+=String.fromCharCode(55296|n>>10,56320|1023&n))}return i}var ea=class{constructor(t,e){var i,r,n,s;void 0===e&&(e={}),this._rrweb=t,this.it=e,this.nt={},this.ot=Date.now(),this.st=-1/0,this.ut=()=>{var t=Date.now(),e=t-this.ot;e>0?(this.ht=Math.min(this.ct,this.ht+e/1e3*this.dt),this.ot=t):this.ot=t},this.vt=t=>{if(!this.nt[t]){var e,i;this.nt[t]=!0;var r=this.ft(t);null==(e=(i=this.it).onBlockedNode)||e.call(i,t,r)}},this.yt=t=>{var e=this.ft(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.ft=t=>this._rrweb.mirror.getNode(t),this.bt=t=>{var e,i,r,n,s,o,a,l;return(null!==(e=null==(i=t.removes)?void 0:i.length)&&void 0!==e?e:0)+(null!==(r=null==(n=t.attributes)?void 0:n.length)&&void 0!==r?r:0)+(null!==(s=null==(o=t.texts)?void 0:o.length)&&void 0!==s?s:0)+(null!==(a=null==(l=t.adds)?void 0:l.length)&&void 0!==a?a:0)},this.throttleMutations=t=>{if(3!==t.type||0!==t.data.source)return t;var e=t.data,i=this.bt(e);if(e.attributes){var r,n,s=e.attributes.length;e.attributes=e.attributes.filter(t=>{var e=this.yt(t.id)[0];return!this.wt.consumeRateLimit(e)&&t});var o=s-e.attributes.length;o>0&&(null==(r=(n=this.it).onDroppedAttributeMutations)||r.call(n,o))}var a=this.bt(e);if(0!==a||i===a){if(this.kt)return t;this.ut();var l,u,h=yo(t);return h>this.ht?(null==(l=(u=this.it).onDroppedOversizedMutation)||l.call(u,h),void this._t()):(this.ht-=h,t)}},this._t=()=>{if(!this.St){var t=Math.max(0,this.xt-(Date.now()-this.st));this.St=setTimeout(()=>{var t,e;this.St=void 0,this.st=Date.now(),null==(t=(e=this.it).requestFullSnapshot)||t.call(e)},t)}},this.wt=new Ze({bucketSize:null!==(i=this.it.bucketSize)&&void 0!==i?i:100,refillRate:null!==(r=this.it.refillRate)&&void 0!==r?r:10,refillInterval:1e3,I:this.vt,A:xn}),this.ct=null!==(n=this.it.bytesBucketSize)&&void 0!==n?n:0,this.dt=null!==(s=this.it.bytesRefillRate)&&void 0!==s?s:25600,this.kt=!Number.isFinite(this.ct)||0>=this.ct,this.ht=this.ct;var o=this.it.resyncIntervalMs;this.xt=Fe(o)&&Number.isFinite(o)&&o>0?o:3e5}reset(){this.nt={},this.St&&(clearTimeout(this.St),this.St=void 0),this.st=Date.now()}stop(){this.wt.stop(),this.reset(),this.ht=this.ct,this.ot=Date.now(),this.st=-1/0}};kn.DEBUG=!1,kn.LIB_VERSION="1.428.2",kn.LIB_NAME="web";var ia=kn,ra=class{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.Ct=t.get_property.bind(t),this.Mt=t.persistence.set_property.bind(t.persistence)}trackSize(t,e){this.Mt(it,{sessionId:t,size:this.currentTrackedSize(t)+e})}currentTrackedSize(t){var e,i=this.Ct(it);return Te(e=i)&&Ee(e.sessionId)&&Fe(e.size)&&i.sessionId===t?i.size:0}};function na(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<Ge(100*e,0,100,xn)}function sa(t){return"$survey_response_"+t}function oa(t,e){if(!e)return null;var i=t[sa(e)];return xe(i)?[...i]:i}function aa(t,e,i){void 0===t&&(t={});var r={};return e.questions.forEach(e=>{if(!Ie(e.originalQuestionIndex)){var i,n=0===(i=e.originalQuestionIndex)?"$survey_response":"$survey_response_"+i,s=oa(t,e.id);Ie(s)||(r[n]=s)}}),n({$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:oa(t,e.id)}})},t,r)}function la(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 ua(t){return"string"==typeof t&&t.trim()?t.trim():null}function ha(t){return t.toLowerCase()}function da(t,e,i){if(!t||!e)return null;var r=ha(e),n=Object.keys(t).find(t=>ha(t)===r);if(n)return null==i||i.debug("Found exact translation match: "+n),n;if(r.includes("-")){var s=r.split("-")[0],o=Object.keys(t).find(t=>ha(t)===s);if(o)return null==i||i.debug("Found base language translation match: "+o+" (from "+e+")"),o}return null}var va=["thankYouMessageHeader","thankYouMessageDescription","thankYouMessageCloseButtonText","introScreenHeader","introScreenDescription","introScreenButtonText","submitButtonText","backButtonText"];function ca(t,e,i){var r,s=da(t.translations,e,i),o=n({},t),a=!1;if(s){var l,u=null==(l=t.translations)?void 0:l[s];if(u)if(null==i||i.info("Applying survey-level translation for language: "+s),Ie(u.name)||(o.name=u.name,a=!0),o.appearance){var h=n({},o.appearance);for(var d of va){var v=u[d];Ie(v)||(h[d]=v,a=!0)}o.appearance=h}else(function(t){return va.some(e=>!Ie(t[e]))})(u)&&(a=!0)}var c=t.questions.map(t=>function(t,e,i){var r,s=da(t.translations,e,i);if(!s)return{question:t,matchedKey:null,hasChanges:!1};var o=null==(r=t.translations)?void 0:r[s];if(!o)return{question:t,matchedKey:null,hasChanges:!1};var a=n({},t),l=!1;return Ie(o.question)||(a.question=o.question,l=!0),Ie(o.description)||(a.description=o.description,l=!0),Ie(o.buttonText)||(a.buttonText=o.buttonText,l=!0),"link"in a&&!Ie(o.link)&&(a.link=o.link,l=!0),"lowerBoundLabel"in a&&!Ie(o.lowerBoundLabel)&&(a.lowerBoundLabel=o.lowerBoundLabel,l=!0),"upperBoundLabel"in a&&!Ie(o.upperBoundLabel)&&(a.upperBoundLabel=o.upperBoundLabel,l=!0),"choices"in a&&function(t){return xe(t.choices)}(o)&&(a.choices=o.choices,l=!0),{question:l?a:t,matchedKey:l?s:null,hasChanges:l}}(t,e,i)),f=c.map(t=>t.question),p=c.some(t=>t.hasChanges),g=null;return s||(g=(null==(r=c.find(t=>t.matchedKey))?void 0:r.matchedKey)||null),p&&(o.questions=f,a=!0,null==i||i.info("Applied question-level translations for language: "+e)),{survey:o,matchedKey:a?s||g:null}}function fa(t){var e;return!(null==(e=t.conditions)||null==(e=e.events)||null==(e=e.values)||!e.length)}function pa(t){var e;return fa(t)&&!(null==(e=t.conditions)||null==(e=e.events)||!e.repeatedActivation)||"always"===t.schedule}var ga=(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}},ma=t=>t.toLowerCase(),ya={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=>ga(e,t))),not_regex:(t,e)=>e.every(e=>t.every(t=>!ga(e,t))),icontains:(t,e)=>e.map(ma).some(e=>t.map(ma).some(t=>e.includes(t))),not_icontains:(t,e)=>e.map(ma).every(e=>t.map(ma).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 ba(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=ya[i.operator];return!!n&&n(i.values,[String(r)])})}function _a(t,e,i){return qn({distinct_id:t,userPropertiesToSet:e,userPropertiesToSetOnce:i})}var wa=new Set(["is_not","not_icontains","not_regex"]);function ka(t,e,i){return!t||0===t.length||t.every(t=>{var r,n=null==(r="person"===t.type?i:e)?void 0:r[t.key],s=t.operator||"exact";if(Ie(n)||Ae(n))return wa.has(s);var o=ya[s];return!!o&&!Ie(t.value)&&!Ae(t.value)&&o(xe(t.value)?t.value.map(String):[String(t.value)],xe(n)?n.map(String):[String(n)])})}var Sa=Cn("[SessionRecording]");function xa(t,e){return e?t:"!"+t}function Ca(t,e){return t===e||t!=="!"+e&&null}var Ta=class{constructor(t,e,i,r,n,s,o){this._instance=t,this.Y=e,this.tt=i,this.et=r,this.Tt=n,this.It=s,this.Rt=o,this.At=null,this.Et=po}onRemoteConfig(t){this.At=Fe(t.sampleRate)?t.sampleRate:null,"any"===t.triggerMatchType?(this.Lt=new so([this.tt,this.Y]),this.Et=fo):(this.Lt=new oo([this.tt,this.Y]),this.Et=po),this._instance.register_for_session({[Gt]:t.triggerMatchType}),this.Y.onConfig(t),this.tt.onConfig(t),this.et.onConfig(t,(t,e)=>{this.Tt("linked_flag_matched",{flag:t,variant:e}),this.Rt()})}getStatus(t){return this.Et({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,i=null==(e=this._instance.get_property("$session_recording_remote_config"))?void 0:e.minimumDurationMilliseconds;return Fe(i)?i:null}checkUrlTriggers(t,e,i,r){this.Y.checkUrlTriggerConditions(e,i,r,t)}setupEventTriggerListeners(t,e,i){if(0!==this.tt.K.length&&Pe(this.Ot))return this.Ot=t(t=>{try{this.tt.checkEventTriggerConditions(t.event,i,e)}catch(t){Sa.error("Could not activate event trigger",t)}}),this.Ot}makeSamplingDecisions(t){var e,i,r,n=this.At;if(!Fe(n))return null==(i=this._instance.persistence)||i.unregister(Z),void(null==(r=this._instance.persistence)||r.unregister(H));var s=this._instance.get_property(Z),o=this._instance.get_property(H),a=Ca(s,t),l=Fe(o)&&o!==n,u=Ie(o)&&s===t,h=l||u||!$e(a),d=h?na(t,n):a;h&&(d?this.Tt("sampled"):Sa.warn("Sample rate ("+n+") has determined that this sessionId ("+t+") will not be sent to the server.")),null==(e=this._instance.persistence)||e.register({[Z]:xa(t,d),[H]:Ae(o)&&s===t?null:n})}ensureSamplingDecision(t){Fe(this.At)&&($e(Ca(this._instance.get_property(Z),t))||this.makeSamplingDecisions(t))}onFlushComplete(){}clearConditionalRecordingPersistence(){var t,e,i,r,n;null==(t=this._instance.persistence)||t.unregister(K),null==(e=this._instance.persistence)||e.unregister(Q),null==(i=this._instance.persistence)||i.unregister(Z),null==(r=this._instance.persistence)||r.unregister(H),null==(n=this._instance.persistence)||n.unregister(J)}updateActiveTriggers(t){}hasPendingTriggers(t){var e;return(null==(e=this.Lt)?void 0:e.triggerStatus(t))===Ys}getPendingTriggerConditions(t){return[{label:"URL condition not matched",status:this.Y.triggerStatusNoSideEffects(t)},{label:"event condition not matched",status:this.tt.triggerStatusNoSideEffects(t)},{label:"linked flag condition not matched",status:this.et.triggerStatusNoSideEffects()}].filter(t=>t.status===Ys).map(t=>t.label)}stop(){var t;null==(t=this.Ot)||t.call(this),this.Ot=void 0,this.tt.stop(),this.Y.stop(),this.et.stop()}},Ma=class{constructor(t,e,i,r,n){this._instance=t,this.Y=e,this.Tt=i,this.Dt=r,this.Rt=n,this.Pt=[],this.Ft=new Map,this.Nt=!1}onRemoteConfig(t){t.triggerGroups&&0!==t.triggerGroups.length?(this.qt(t.triggerGroups),this._instance.register_for_session({[Gt]:"v2_trigger_groups",[Zt]:t.triggerGroups.length}),this.Y.onConfig(t)):Sa.warn("[V2Strategy] No trigger groups configured")}getStatus(t){return function(t){if(t.rrwebError)return Ks;if(!t.receivedFlags)return Zs;if(!t.isRecordingEnabled)return Ws;if(t.urlTriggerMatching.urlBlocked)return Js;var e=t.triggerGroupMatchers,i=t.triggerGroupSamplingResults;if(0===e.length)return Ws;var r=!1,n=!1;for(var s of e){var o=s.triggerStatus(t.sessionId);if("trigger_activated"===o){var a=s.group.id,l=i.get(a);Ie(l)?xn.warn("[V2 Triggers] Group activated but no sampling decision found",{groupId:a}):!0===l&&(n=!0)}else"trigger_pending"===o&&(r=!0)}return n?Vs:r?Zs:Ws}({receivedFlags:!0,isRecordingEnabled:!0,isSampled:t.isSampled,rrwebError:t.rrwebError,urlTriggerMatching:t.urlTriggerMatching,eventTriggerMatching:t.eventTriggerMatching,linkedFlagMatching:t.linkedFlagMatching,sessionId:t.sessionId,triggerGroupMatchers:this.Pt,triggerGroupSamplingResults:this.Ft,minimumDuration:this.getMinimumDuration(t.sessionId)})}getMinimumDuration(t){var e=null;for(var i of this.Pt)if("trigger_activated"===i.triggerStatus(t)){var r=i.group.minDurationMs;Fe(r)&&(Ae(e)||e>r)&&(e=r)}return e}checkUrlTriggers(t,e,i,r){var n=this;this.Y.checkUrlBlocklist(e,i);var s=function(r){r.checkUrlTriggerConditions(e,i,e=>{n.jt(r,void 0)&&(r.activateTrigger(e,t),n.updateActiveTriggers(t),n.Rt(e))},t)};for(var o of this.Pt)s(o)}setupEventTriggerListeners(t,e,i){var r=this;return this.Ot=t(t=>{var i;if(this.Nt)return Sa.info("[SessionRecorder] Stopping trigger checks - initial buffer flushed"),null==(i=this.Ot)||i.call(this),void(this.Ot=void 0);try{var n=function(i){i.checkEventTriggerConditions(t.event,n=>{if(r.jt(i,t.properties)){var s=(i.group.conditions.events||[]).filter(e=>e.name===t.event),o=r._instance.get_property(vt);s.some(e=>!e.properties||0===e.properties.length||ka(e.properties,t.properties,o))&&(i.activateTrigger(n,e),r.updateActiveTriggers(e),r.Rt(n))}},e)};for(var s of this.Pt)n(s)}catch(t){Sa.error("Could not activate event trigger for trigger groups",t)}}),this.Ot}makeSamplingDecisions(t){for(var e of this.Pt){var i,r=e.group,n=r.id,s=r.sampleRate,o=tt+n,a=this._instance.get_property(o),l=null,u=!1,h=!1,d=!1;if(Te(a)){var v=a.sessionId,c=a.sampleRate,f=a.sampled;u="string"==typeof v&&v!==t,h=Fe(c)&&c!==s,l=v===t&&Fe(c)&&c===s&&$e(f)?f:null}else l=a===t||null,u="string"==typeof a&&a!==t,d=a===t;var p=u||h||d||!$e(l),g=p?na(t+n,s):l;p&&this.Dt("triggerGroupSamplingDecisionMade",{group_id:n,group_name:r.name,sampleRate:s,isSampled:g}),this.Ft.set(n,g),null==(i=this._instance.persistence)||i.register({[o]:{sessionId:t,sampleRate:s,sampled:g}})}this.updateActiveTriggers(t)}ensureSamplingDecision(t){}onFlushComplete(){this.Nt=!0}clearConditionalRecordingPersistence(){var t,e,i;for(var r of(null==(t=this._instance.persistence)||t.unregister(Z),null==(e=this._instance.persistence)||e.unregister(H),null==(i=this._instance.persistence)||i.unregister(J),this.Pt)){var n,s,o,a=r.group.id;null==(n=this._instance.persistence)||n.unregister(X+a),null==(s=this._instance.persistence)||s.unregister(Y+a),null==(o=this._instance.persistence)||o.unregister(tt+a)}}updateActiveTriggers(t){var e=[];for(var i of this.Pt){var r=i.group,n=r.id,s="trigger_activated"===i.triggerStatus(t),o=!0===this.Ft.get(n);s&&e.push({id:n,name:r.name,matched:!0,sampled:o})}this._instance.register_for_session({[Wt]:e})}hasPendingTriggers(t){for(var e of this.Pt)if("trigger_pending"===e.triggerStatus(t))return!0;return!1}getPendingTriggerConditions(t){return this.Pt.flatMap(e=>"trigger_pending"!==e.triggerStatusNoSideEffects(t)?[]:e.getPendingTriggerConditions(t).map(t=>'trigger group "'+e.group.name+'": '+t))}stop(){var t;null==(t=this.Ot)||t.call(this),this.Ot=void 0,this.Pt.forEach(t=>t.stop()),this.Pt=[],this.Ft.clear(),this.Y.stop()}jt(t,e){var i=t.group.conditions.properties;return!i||0===i.length||ka(i,e,this._instance.get_property(vt))}qt(t){var e=this;this.Pt.forEach(t=>t.stop()),this.Pt=[],this.Ft.clear();var i=function(t){var i=new co(e._instance,t,(i,r)=>{e.Tt("linked_flag_matched",{flag:i,variant:r,group_id:t.id,group_name:t.name}),e.Rt()});e.Pt.push(i)};for(var r of t)i(r)}},Ia=t=>{if(h){try{for(var e=t+"=",i=h.cookie.split(";").filter(t=>t.length),r=0;i.length>r;r++){for(var n=i[r];" "==n.charAt(0);)n=n.substring(1,n.length);if(0===n.indexOf(e))return decodeURIComponent(n.substring(e.length,n.length))}}catch(t){}return null}},Ea=["gclid","gclsrc","dclid","gbraid","wbraid","fbclid","msclkid","twclid","li_fat_id","igshid","ttclid","rdt_cid","epik","qclid","sccid","irclid","_kx"],Ra=["utm_source","utm_medium","utm_campaign","utm_content","utm_term","gad_source","mc_cid",...Ea],Aa="<masked>",Pa=["li_fat_id"];function Fa(t,e,i){if(!h)return{};var r,n=e?[...Ea,...i||[]]:[],s=Oa(zn(h.URL,n,Aa),t);return In((r={},Mn(Pa,function(t){var e=Ia(t);r[t]=e||null}),r),s)}function Oa(t,e){var i=Ra.concat(e||[]),r={};return Mn(i,function(e){var i=Hn(t,e);r[e]=i||null}),r}function $a(t){var e=function(t){return t?0===t.search("https?://(.*)google.([^/?]*)")?"google":0===t.search("https?://(.*)bing.com")?"bing":0===t.search("https?://(.*)yahoo.com")?"yahoo":0===t.search("https?://(.*)duckduckgo.com")?"duckduckgo":null:null}(t),i="yahoo"!=e?"q":"p",r={};if(!Ae(e)){r.$search_engine=e;var n=h?Hn(h.referrer,i):"";n.length&&(r.ph_keyword=n)}return r}function Da(){return navigator.language||navigator.userLanguage}var La="$direct";function Na(){return(null==h?void 0:h.referrer)||La}function qa(t,e,i){var r;void 0===i&&(i=!1);var n=t?[...Ea,...e||[]]:[],s=null==(r=i?ar(null==d?void 0:d.href):null==d?void 0:d.href)?void 0:r.substring(0,1e3);return{r:Na().substring(0,1e3),u:s?zn(s,n,Aa):void 0}}function ja(t,e){var i;void 0===e&&(e=!1);var r=t.r,n=t.u,s=e?ar(n):n,o={$referrer:r,$referring_domain:null==r?void 0:r==La?La:null==(i=jn(r))?void 0:i.host};if(s){o.$current_url=s;var a=jn(s);o.$host=null==a?void 0:a.host,o.$pathname=null==a?void 0:a.pathname,In(o,Oa(s))}return r&&In(o,$a(r)),o}function Ba(){try{return Intl.DateTimeFormat().resolvedOptions().timeZone}catch(t){return}}function Ha(){try{return(new Date).getTimezoneOffset()}catch(t){return}}var za=1e5,Ua=/^[A-Za-z0-9]*[A-Za-z][A-Za-z0-9]*$/,Wa=[],Va=()=>!1,Ga="@type @id 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(" "),Za="Action BorrowAction ReadAction SearchAction SeekToAction SolveMathAction WatchAction".split(" "),Ja="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(" "),Qa="Accommodation AdministrativeArea Country Place State".split(" "),Ka={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:Za,publisher:Ja},Event:{startDate:!0,endDate:!0,previousStartDate:!0,aggregateRating:["AggregateRating"],offers:["AggregateOffer","Offer"]},ItemList:{itemListElement:["ListItem"]},ListItem:{item:Wa},Offer:{seller:Ja},Organization:{name:!0,legalName:!0,foundingDate:!0,dissolutionDate:!0,aggregateRating:["AggregateRating"],brand:["Brand"]},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:Ja,offers:["Offer","AggregateOffer"],aggregateRating:["AggregateRating"]},Service:{name:!0,serviceType:!0,category:!0,provider:Ja,areaServed:Qa,offers:["AggregateOffer","Offer"],aggregateRating:["AggregateRating"]},OfferCatalog:{name:!0,itemListElement:Wa}},Xa=[["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(" "),Ka.CreativeWork],["BroadcastEvent BusinessEvent EducationEvent Festival MusicEvent SportsEvent TheaterEvent".split(" "),Ka.Event],[Ja,Ka.Organization],[Qa,Ka.Place],["Car IndividualProduct ProductGroup ProductModel".split(" "),Ka.Product]];function Ya(t,e){return ke.call(t,e)?t[e]:void 0}function tl(t){var e=typeof t;return Ae(t)||"string"===e||"number"===e||"boolean"===e}function el(t){return tl(t)||xe(t)&&t.every(tl)?t:void 0}function il(t,e){if("string"==typeof t){var i=t.trim(),r=i.indexOf("#"),n=0>r?i:i.slice(r+1);if(!(!n||0>r&&(/^[a-z][a-z\d+.-]*:/i.test(i)||i.includes("/")||i.includes("?"))))try{return e(n)?n:void 0}catch(t){return}}}function rl(t){if(ke.call(Ka,t))return Ka[t];for(var e of Xa){var i=e[1];if(e[0].includes(t))return i}}function nl(t,e,i){Object.defineProperty(t,e,{configurable:!0,enumerable:!0,value:i,writable:!0})}function sl(t,e,i,r){if(xe(t)){var n=t.map(t=>sl(t,e,i,r)).filter(t=>!Ie(t));return n.length?n:void 0}return ol(t,e,i,r)||void 0}function ol(t,e,i,r){if(!Te(t)||!function(t){return t.remainingNodes?(t.remainingNodes--,!0):(t.exceeded=!0,!1)}(i))return null;var n=Ya(t,"@type"),s=function(t){var e=new Set,i="string"==typeof t?[t]:xe(t)?t:[],r=[];for(var n of i)if("string"==typeof n){var s=n.replace(/^https?:\/\/schema\.org\//,"");if(100>=s.length&&Ua.test(s)&&!e.has(s)&&(e.add(s),r.push(s),20===r.length))break}return r}(n),o=s.filter(t=>!!rl(t)&&(!r||!r.length||r.includes(t))),a={};for(var l of Ga){var u="@type"===l?s.length?"string"==typeof n?s[0]:s:void 0:"@id"===l?il(Ya(t,l),e):el(Ya(t,l));Ie(u)||nl(a,l,u)}for(var h of o){var d=rl(h);for(var v of Object.keys(d)){var c=Ya(t,v),f=d[v];if(!0===f){var p=el(c);Ie(p)||nl(a,v,p)}else{var g=sl(c,e,i,f);Ie(g)||nl(a,v,g)}}}var m=sl(Ya(t,"@graph"),e,i);return Ie(m)||nl(a,"@graph",m),Object.keys(a).length?a:null}function al(t,e,i){if(!Te(t))return null;var r=Ya(t,"@context");if("string"!=typeof r||!/^https?:\/\/schema\.org\/?$/.test(r))return null;var s=ol(t,e,i);return s?n({"@context":"https://schema.org"},s):null}function ll(t){var e;return"SCRIPT"===t.nodeName&&"application/ld+json"===(null==(e=t.getAttribute("type"))?void 0:e.trim().toLowerCase())}function ul(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 hl(t,e,i){for(var r=t;r;){if(ul(r,e,i))return!0;var n=r.parentNode;r=r.parentElement||(n&&n.nodeType===n.DOCUMENT_FRAGMENT_NODE?n.host:null)}return!1}function dl(t){return ll(t)?[t]:t.nodeType!==t.ELEMENT_NODE?[]:Array.from(t.querySelectorAll("script")).filter(ll)}function vl(t){return Ie(t)?void 0:Math.round(t)}function cl(t){return Te(t)?t.network_timing:t}var fl,pl,gl=Cn("[SessionRecording]"),ml=[1,2,3,4,5,6,7,12],yl=t=>({rrwebMethod:t,enqueuedAt:Date.now(),attempt:1});function bl(){var t;return null==b||null==(t=b.__PosthogExtensions__)?void 0:t.rrweb}function _l(){var t;return null==(t=bl())?void 0:t.record}function wl(t){try{return JSON.stringify(t)}catch(e){return JSON.stringify(t,go())}}function kl(t){return ta(Xo(Yo(wl(t))),!0)}function Sl(t){return xl.apply(this,arguments)}function xl(){return(xl=o(function*(t){var e=yield Yr(wl(t),ia.DEBUG,{rethrow:!0});return ta(new Uint8Array(yield e.arrayBuffer()),!0)})).apply(this,arguments)}var Cl="undefined"!=typeof globalThis&&"CompressionStream"in globalThis&&"TextEncoder"in globalThis&&"Response"in globalThis&&"function"==typeof Response.prototype.blob,Tl=!1;function Ml(t){return xe(t)&&0===t.length?fl=null!=fl?fl:kl([]):kl(t)}function Il(t){return El.apply(this,arguments)}function El(){return(El=o(function*(t){return xe(t)&&0===t.length?fl||(pl=null!=pl?pl:Sl([]).then(t=>(fl=t,t)).catch(t=>{throw fl=void 0,pl=void 0,t})):Sl(t)})).apply(this,arguments)}function Rl(t){return Cl&&!Tl&&function(t){return 2===t.type||3===t.type&&(0===t.data.source||8===t.data.source)}(t)}function Al(t){return{event:t,size:yo(t)}}function Pl(t,e){return n({},t,{data:e,cv:"2024-10"})}function Fl(t,e){return n({},t,{cv:"2024-10",data:n({},t.data,e)})}function Ol(t){try{if(2===t.type)return Al(Pl(t,kl(t.data)));if(3===t.type&&0===t.data.source)return Al(Fl(t,{texts:Ml(t.data.texts),attributes:Ml(t.data.attributes),removes:Ml(t.data.removes),adds:Ml(t.data.adds)}));if(3===t.type&&8===t.data.source)return Al(Fl(t,{adds:t.data.adds?kl(t.data.adds):void 0,removes:t.data.removes?kl(t.data.removes):void 0}))}catch(t){gl.error("could not compress event - will use uncompressed event",t)}return{event:t,size:mo(t)}}function $l(){return $l=o(function*(t){try{if(2===t.type)return Al(Pl(t,yield Sl(t.data)));if(3===t.type&&0===t.data.source){var e=yield Promise.all([Il(t.data.texts),Il(t.data.attributes),Il(t.data.removes),Il(t.data.adds)]);return Al(Fl(t,{texts:e[0],attributes:e[1],removes:e[2],adds:e[3]}))}if(3===t.type&&8===t.data.source){var i=yield Promise.all([t.data.adds?Sl(t.data.adds):void 0,t.data.removes?Sl(t.data.removes):void 0]);return Al(Fl(t,{adds:i[0],removes:i[1]}))}}catch(e){return Qr(e)&&(Tl=!0),gl.error("could not compress event asynchronously - trying synchronous compression",e),Ol(t)}return{event:t,size:mo(t)}}),$l.apply(this,arguments)}function Dl(t,e){return 5===t.type&&t.data.tag===e}function Ll(t){return Dl(t,"sessionIdle")}function Nl(t){return Dl(t,"$session_ending")}function ql(t){return Dl(t,"$session_starting")}var jl=class{get sessionId(){return this.Bt}get Ht(){if(!this._instance.sessionManager)throw new Error("[SessionRecording] must be started with a valid sessionManager.");return this._instance.sessionManager}get $t(){return this._instance.config.session_recording.session_idle_threshold_ms||3e5}get Ut(){return Ca(this._instance.get_property(Z),this.sessionId)}get At(){var t,e=null==(t=this.zt)?void 0:t.sampleRate;return Fe(e)?e:null}get Wt(){var t,e;return null!==(t=null==(e=this.Vt)?void 0:e.getMinimumDuration(this.sessionId))&&void 0!==t?t:null}constructor(t,e){this._instance=t,this.Zt="/s/",this._forceAllowLocalhostNetworkCapture=!1,this.Gt=void 0,this.Qt=!1,this.Jt=Date.now(),this.Kt=!1,this.Xt=[],this.Yt="unknown",this.te=0,this.ee=0,this.re=0,this.ie=0,this.ne=!1,this.oe=!1,this.ae=!1,this.se=!1,this.ue=!1,this.le=!1,this.he=!1,this.ce=!1,this.de=!1,this.ve=!1,this.fe=!1,this.pe=!1,this.ge=[],this.me=void 0,this.ye=void 0,this.be=[],this.we=0,this.ke=0,this._e=!1,this.Se=void 0,this.Ot=void 0,this.xe=void 0,this.Ce=void 0,this.Me=void 0,this.Te=(t,e,i)=>{var r,n,s,o;if(i&&(t!==this.Bt||e!==this.Ie)){var a=!i.noSessionId&&(i.activityTimeout||i.sessionPastMaximumLength),l=this.Bt,u=this.Ie;if(a&&this.Dt("$session_ending",{currentSessionId:l,currentWindowId:u,nextSessionId:t,nextWindowId:e,changeReason:i,lastActivityTimestamp:this.Jt,flushed_size:null==(r=this.Re)?void 0:r.currentTrackedSize(l)}),null==(n=this._instance.persistence)||n.unregister(et),this.he=!1,null==(s=bl())||null==s.resetMaxDepthState||s.resetMaxDepthState(),this.Dt("$session_id_change",{sessionId:t,windowId:e,changeReason:i}),this.Ae(),!(!1===this.Yt&&this.isStarted||this.Bt===t&&this.Ie===e)){var h=this.Bt!==t&&!1!==this.Yt;this.Yt="unknown",this.Ee(h)}a&&this.Dt("$session_starting",{previousSessionId:l,previousWindowId:u,nextSessionId:t,nextWindowId:e,changeReason:i,lastActivityTimestamp:this.Jt}),null==(o=this.Vt)||o.makeSamplingDecisions(t)}},this.Le=!1,this.Oe=()=>{var t;return(null==(t=this._instance.persistence)?void 0:t.props[J])===this.Bt},this.De=()=>{var t,e;if(0===this.Pe.data.length)return null;var i=null==(t=this.Pe.data[0])?void 0:t.timestamp,r=null==(e=this.Pe.data[this.Pe.data.length-1])?void 0:e.timestamp;return Fe(i)&&Fe(r)?r-i:null},this.Fe=()=>{var t,e,i=this.Wt;if(!Fe(i))return!1;if(null===(t=null==(e=this._instance.config.session_recording)?void 0:e.strictMinimumDuration)||void 0===t||!t){var r=this.Ne;return Fe(r)&&r>=0&&i>r}if(this.Oe())return!1;var n,s=this.De();return!!Ae(s)||i>s||(null==(n=this._instance.persistence)||n.register({[J]:this.Bt}),!1)},this.qe=()=>{"buffering"!==this.status?(this.ne&&this.oe&&this.je&&!this.ae&&this.Be(void 0),this.He(),this.$e()):this.Ue()},this.ze=()=>{this.qe()},this.We=()=>{this.Dt("browser offline",{})},this.Ve=()=>{this.Dt("browser online",{})},this.Ze=()=>{null!=h&&h.visibilityState&&("visible"===h.visibilityState&&(this.je=!0),this.Dt("window "+h.visibilityState,{}))},this.je=null==e||e;var i=this.Ht.checkAndGetSessionAndWindowId(),r=i.windowId;this.Bt=i.sessionId,this.Ie=r,this.et=new ho(this._instance),this.Y=new uo(this._instance),this.tt=new vo(this._instance),this.Pe=this.Ue(),this.Ht.sessionTimeoutMs>this.$t||gl.warn("session_idle_threshold_ms ("+this.$t+") is greater than the session timeout ("+this.Ht.sessionTimeoutMs+"). Session will never be detected as idle"),this.Re=new ra(this._instance)}setDocumentWasEverVisible(t){t&&(this.je=!0)}get Ge(){var t,e,i,r,n,s,o,a,l,u=null==(t=this.zt)?void 0:t.masking,h={maskAllInputs:null==(e=this._instance.config.session_recording)?void 0:e.maskAllInputs,maskTextSelector:null==(i=this._instance.config.session_recording)?void 0:i.maskTextSelector,blockSelector:null==(r=this._instance.config.session_recording)?void 0:r.blockSelector,maskAllElementAttributes:null==(n=this._instance.config.session_recording)?void 0:n.maskAllElementAttributes},d=null!==(s=null==h?void 0:h.maskAllInputs)&&void 0!==s?s:null==u?void 0:u.maskAllInputs,v=null!==(o=null==h?void 0:h.maskTextSelector)&&void 0!==o?o:null==u?void 0:u.maskTextSelector,c=null!==(a=null==h?void 0:h.blockSelector)&&void 0!==a?a:null==u?void 0:u.blockSelector,f=null!==(l=null==h?void 0:h.maskAllElementAttributes)&&void 0!==l?l:null==u?void 0:u.maskAllElementAttributes;return Ie(d)&&Ie(v)&&Ie(c)&&Ie(f)?void 0:{maskAllInputs:null==d||d,maskTextSelector:v,blockSelector:c,maskAllElementAttributes:f}}Qe(){var t;if(!this.de){var e=null==(t=this.zt)?void 0:t.masking;if(!Pe(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!Ie(r)&&r!==n});0!==r.length&&(this.de=!0,gl.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 Je(){var t;return Ge(null==(t=this._instance.config.session_recording.canvasCapture)?void 0:t.resolutionScale,.1,1,Cn("canvas recording resolution scale"),1)}get Ke(){var t,e,i,r,n,s,o,a=this._instance.config.session_recording.captureCanvas,l=null==(t=this.zt)?void 0:t.canvasRecording,u=null!==(e=null!==(i=null==a?void 0:a.recordCanvas)&&void 0!==i?i:null==l?void 0:l.enabled)&&void 0!==e&&e,h=null!==(r=null!==(n=null==a?void 0:a.canvasFps)&&void 0!==n?n:null==l?void 0:l.fps)&&void 0!==r?r:4,d=null!==(s=null!==(o=null==a?void 0:a.canvasQuality)&&void 0!==o?o:null==l?void 0:l.quality)&&void 0!==s?s:.4;if("string"==typeof d){var v=parseFloat(d);d=isNaN(v)?.4:v}return{enabled:u,fps:Ge(h,0,12,Cn("canvas recording fps"),4),quality:Ge(d,0,1,Cn("canvas recording quality"),.4)}}get Xe(){var t,e,i=!(null==(t=this.zt)||!t.consoleLogRecordingEnabled);return null!==(e=this._instance.config.enable_recording_console_log)&&void 0!==e?e:i}get Ye(){var t,e,i,r=null==(t=this.zt)?void 0:t.networkPayloadCapture,n={recordHeaders:null==(e=this._instance.config.session_recording)?void 0:e.recordHeaders,recordBody:null==(i=this._instance.config.session_recording)?void 0:i.recordBody},s=(null==n?void 0:n.recordHeaders)||(null==r?void 0:r.recordHeaders),o=(null==n?void 0:n.recordBody)||(null==r?void 0:r.recordBody),a=cl(this._instance.config.capture_performance),l=cl(null==r?void 0:r.capturePerformance),u=!!($e(a)?a:l);return s||o||u?{recordHeaders:s,recordBody:o,recordPerformance:u}:void 0}tr(){var t,e,i=[],r=null==(t=b.__PosthogExtensions__)||null==(t=t.rrwebPlugins)?void 0:t.getRecordConsolePlugin;r&&this.Xe&&i.push(r());var s=null==(e=b.__PosthogExtensions__)||null==(e=e.rrwebPlugins)?void 0:e.getRecordNetworkPlugin;if(this.Ye&&Ce(s))if(!Nn.includes(d.hostname)||this._forceAllowLocalhostNetworkCapture){var o=Ce(this._instance.requestRouter.isIngestionEndpoint)?this._instance.requestRouter.isIngestionEndpoint.bind(this._instance.requestRouter):void 0;i.push(s(((t,e,i)=>{var r,s={payloadSizeLimitBytes:Ds.payloadSizeLimitBytes,performanceEntryTypeToObserve:[...Ds.performanceEntryTypeToObserve],payloadHostDenyList:[...e.payloadHostDenyList||[],...Ds.payloadHostDenyList]},o=!1!==t.session_recording.recordHeaders&&e.recordHeaders,a=!1!==t.session_recording.recordBody&&e.recordBody,l=!1!==t.capture_performance&&e.recordPerformance,u=(r=$s(s),t=>(null!=t&&t.requestBody&&(t.requestBody=Hs(t.requestBody,t.requestHeaders,r,"Request")),null!=t&&t.responseBody&&(t.responseBody=Hs(t.responseBody,t.responseHeaders,r,"Response")),t)),h=e=>{return u(((t,e,i)=>{var r;if(null==i||!i(t.name)){var n=jn(t.name),s=0===e.indexOf("http")?null==(r=jn(e))?void 0:r.pathname:e;"/"===s&&(s="");var o=null==n?void 0:n.pathname.replace(s||"","");if(!(n&&o&&Bs.some(t=>0===o.indexOf(t))))return t}})((js((r=e).requestHeaders),js(r.responseHeaders),r),t.api_host,i));var r},d=Ce(t.session_recording.maskNetworkRequestFn);return d&&Ce(t.session_recording.maskCapturedNetworkRequestFn)&&xn.warn("Both `maskNetworkRequestFn` and `maskCapturedNetworkRequestFn` are defined. `maskNetworkRequestFn` will be ignored."),d&&(t.session_recording.maskCapturedNetworkRequestFn=e=>{var i=t.session_recording.maskNetworkRequestFn({url:e.name});return!i&&e.isInitial?i:n({},e,{name:null==i?void 0:i.url})}),s.maskRequestFn=Ce(t.session_recording.maskCapturedNetworkRequestFn)?e=>{var i=h(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 Pe(n)&&r?(Us.add(r),r):null!=n?n:void 0}}:t=>function(t){if(!Ie(t))return t.requestBody=zs(t.requestBody,"Request"),t.responseBody=zs(t.responseBody,"Response"),t}(h(t)),n({},Ds,s,{recordHeaders:o,recordBody:a,recordPerformance:l,recordInitialRequests:l,streamNetworkBody:!0===t.session_recording.streamNetworkBody})})(this._instance.config,this.Ye,o)))}else gl.info("NetworkCapture not started because we are on localhost.");return i}er(t){return this._instance.config.disable_capture_url_hashes?ar(t):t}rr(t,e){void 0===e&&(e=!1);var i=e?ar(t):this.er(t),r=this._instance.config.mask_personal_data_properties?[...Ea,...this._instance.config.custom_personal_data_properties||[]]:[];return this.ir(zn(i,r,Aa))}ir(t){var e,i=this._instance.config.session_recording;if(i.maskCapturedNetworkRequestFn){var r,n=i.maskCapturedNetworkRequestFn({name:t});return null!==(r=null==n?void 0:n.name)&&void 0!==r?r:null==n?void 0:n.url}return i.maskNetworkRequestFn?null==(e=i.maskNetworkRequestFn({url:t}))?void 0:e.url:t}nr(t){try{return t.rrwebMethod(),!0}catch(e){return 10>this.Xt.length?this.Xt.push({enqueuedAt:t.enqueuedAt||Date.now(),attempt:t.attempt+1,rrwebMethod:t.rrwebMethod}):gl.warn("could not emit queued rrweb event.",e,t),!1}}Dt(t,e){return this.nr(yl(()=>_l().addCustomEvent(t,e)))}ar(){var t;return this.Qt&&!0===(null==(t=this._instance.config.session_recording)?void 0:t.captureJsonLd)&&!this.Y.urlBlocked&&!0!==this.Yt}sr(t){if(!this.ar())return!1;try{var e=_l();return!!e&&(e.addCustomEvent("$json_ld",t),this.ar())}catch(t){return!1}}ur(t){void 0===t&&(t=!1),Promise.resolve().then(()=>{var e;return null==(e=this.lr)?void 0:e.scan(t)})}hr(){try{if(this._instance.config.capture_pageview||!a)return;var t=new URL(a.location.href),e=this.rr(t.origin+t.pathname+t.search);this.cr!==e&&(this.cr=e,this.Dt("$url_changed",{href:e}))}catch(t){}}dr(){if(this.Xt.length){var t=[...this.Xt];this.Xt=[],t.forEach(t=>{Date.now()-t.enqueuedAt>2e3||this.nr(t)})}}It(){return this.nr(yl(()=>_l().takeFullSnapshot()))}get vr(){var t,e,i;if(null!=(t=this.Vt)&&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 Fe(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}pr(){if(this.gr&&clearInterval(this.gr),!0!==this.Yt){var t=this.vr;t&&(this.gr=setInterval(()=>{this.It()},t))}}Rt(t){"event"===t&&this.mr(),!this.Y.urlBlocked&&["sampled","active"].includes(this.status)&&this.pr()}yr(){var t;this.Y.urlBlocked||(this.Y.urlBlocked=!0,null==(t=this.lr)||t.scan(),clearInterval(this.gr),gl.info("recording paused due to URL blocker"),this.Dt("recording paused",{reason:"url blocker"}))}br(){var t;this.Y.urlBlocked&&(null==(t=this.lr)||t.scan(),this.Y.urlBlocked=!1,this.It(),this.ur(),this.pr(),this.Dt("recording resumed",{reason:"left blocked url"}),gl.info("recording resumed"))}wr(t,e){var i;if("event"===t&&this.mr(),!this.Kt&&null!=(i=this.Vt)&&i.hasPendingTriggers(this.sessionId)){this.Kt=!0;try{var r,n,s="url"===t?Q:K;null==(r=this._instance.persistence)||r.register({[s]:this.sessionId}),null==(n=this.Vt)||n.updateActiveTriggers(this.sessionId),this.Rt(),this.$e(),this.Tt(t+"_trigger_matched",{["url"===t?"matchedUrl":"matchedEvent"]:e})}finally{this.Kt=!1}}}get isStarted(){return!!this.Gt}get zt(){var t=this._instance.get_property(j);if(t){var e;try{e=Te(t)?t:JSON.parse(t)}catch(t){return void gl.warn("persisted remote config for session recording is invalid and will be ignored",t)}if(!this.isStarted&&!this.Le){var i,r,n=null!==(i=e.cache_timestamp)&&void 0!==i?i:Date.now();if(Date.now()-n>36e5)return gl.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(j))}return e}}kr(t,e,i){this._instance.get_property(t)&&(e(),i())}start(t){var e,i,r=this.zt;if(r){if(!this.isStarted){var n=!1!==this.Yt&&!this.se;this.Be(n?"no_interaction_since_recording_started":void 0),this.se=!1,this.oe=n,this.ae=!1}this._e&&(this._r(),this.Ue());var s=this.Ht.checkAndGetSessionAndWindowId(),o=s.windowId;this.Bt=s.sessionId,this.Ie=o,null==(e=this._instance.persistence)||e.unregister(et),null!=r&&r.endpoint&&(this.Zt=null==r?void 0:r.endpoint),this.Vt=2===(null==r?void 0:r.version)&&null!=r&&r.triggerGroups&&r.triggerGroups.length>0?new Ma(this._instance,this.Y,this.Tt.bind(this),this.Dt.bind(this),this.Rt.bind(this)):new Ta(this._instance,this.Y,this.tt,this.et,this.Tt.bind(this),this.It.bind(this),this.Rt.bind(this)),this.Vt.onRemoteConfig(r),null==(i=this.Ot)||i.call(this),this.Ot=this.Vt.setupEventTriggerListeners(this._instance.on.bind(this._instance,"eventCaptured"),this.sessionId,(t,e)=>this.wr(t,e)),this.kr(z,()=>{this.overrideSampling()},()=>{var t;return null==(t=this._instance.persistence)?void 0:t.unregister(z)}),this.kr(U,()=>{this.overrideLinkedFlag()},()=>{var t;return null==(t=this._instance.persistence)?void 0:t.unregister(U)}),this.kr(V,()=>{this.overrideTrigger("event")},()=>{var t;return null==(t=this._instance.persistence)?void 0:t.unregister(V)}),this.kr(W,()=>{this.overrideTrigger("url")},()=>{var t;return null==(t=this._instance.persistence)?void 0:t.unregister(W)}),this.Vt.makeSamplingDecisions(this.sessionId),this.Sr(),this.ue||(Dn(a,"beforeunload",this.qe),Dn(a,"pagehide",this.ze),Dn(a,"offline",this.We),Dn(a,"online",this.Ve),Dn(h,"visibilitychange",this.Ze),!this.xe&&Ce(this.Ht.onSessionId)&&(this.xe=this.Ht.onSessionId(this.Te)),!this.Ce&&Ce(this.Ht.on)?this.Ce=this.Ht.on("forcedIdleReset",()=>{this.Ae(),this.Yt="unknown",this.stop(),this.Me=this.Ht.onSessionId((t,e,i)=>{var r;null==(r=this.Me)||r.call(this),this.Me=void 0,this.Te(t,e,i)})}):Ce(this.Ht.on)||gl.warn("bundled core has no SessionIdManager.on (requires posthog-js >= 1.268.6); recording will start but skip forced-idle-reset handling"),Pe(this.Se)&&(this.Se=this._instance.on("eventCaptured",t=>{try{if("$pageview"===t.event){var e=null!=t&&t.properties.$current_url?this.rr(t.properties.$current_url):"";if(!e)return;this.Dt("$pageview",{href:e})}}catch(t){gl.error("Could not add $pageview to rrweb session",t)}})),"active"===this.status&&this.Tt(t||"recording_initialized"))}else gl.info("remote config must be stored in persistence before recording can start")}Cr(){var t,e,i,r,n,s;null==a||a.removeEventListener("beforeunload",this.qe),null==a||a.removeEventListener("pagehide",this.ze),null==a||a.removeEventListener("offline",this.We),null==a||a.removeEventListener("online",this.Ve),null==h||h.removeEventListener("visibilitychange",this.Ze),clearInterval(this.gr),this.Mr(),null==(t=this.Se)||t.call(this),this.Se=void 0,null==(e=this.Ot)||e.call(this),this.Ot=void 0,null==(i=this.xe)||i.call(this),this.xe=void 0,null==(r=this.Ce)||r.call(this),this.Ce=void 0,null==(n=this.Me)||n.call(this),this.Me=void 0,null==(s=this.Vt)||s.stop(),this.Tr(),this._r()}_r(){this.ke+=1,this.be=[],this.we=0,this.Ir=void 0,this._e=!1}Tr(){var t,e,i;null==(t=this.Rr)||t.stop(),this.Xt=[],null==(e=this.lr)||e.stop(),this.lr=void 0,this.Qt=!1,null==(i=this.Gt)||i.call(this),this.Gt=void 0}Ar(){if(!this.Ir||0===this.we)return!1;if(this._e)return!0;this._e=!0,this.Er=void 0;var t=this.ke;return this.Mr(),this.Tr(),this.Ir.catch(()=>{}).then(()=>{t===this.ke&&(this._e=!1,this.$e(),this.Ue(),this.Lr(),this.Cr(),gl.info("stopped"))}).catch(()=>{this._e=!1,this.Lr(),this.Cr(),gl.info("stopped")}),!0}stop(){if(this.Tr(),this.Le)this.He();else if(this.Ar())return;this.$e(),this.Ue(),this.Lr(),this.Cr(),gl.info("stopped")}Lr(){this.Be(void 0,{preserveLogDedup:this.Le}),this.oe=!1}flushBeforeIdentityReset(){(this.isStarted||this._e)&&(this.He(),this.$e())}Ee(t){this.Le=!0,this.Jt=Date.now();try{var e;this.stop(),this.Or=void 0,this.Dr=void 0,this.ee=0,this.re=0,this.ie=0,null==(e=bl())||null==e.resetSnapshotCostState||e.resetSnapshotCostState(),this.start("session_id_changed")}finally{this.Le=!1}this.Be(t?"no_interaction_since_session_rotated":void 0),this.oe=!1}Be(t,e){var i=(void 0===e?{}:e).preserveLogDedup,r=void 0!==i&&i;if(this.ne=!Ie(t),this.Er=t,Ie(t))r||(this.Pr=void 0);else if(!this.Le){var n=this.sessionId+":"+t;n!==this.Pr&&(this.Pr=n,gl.info("holding buffer: "+t+". nothing is uploaded until the user interacts with the page"))}}mr(){this.isStarted||(this.se=!0),this.ne&&(this.Be(void 0),this.oe=!1,this.ae&&(this.ae=!1,this.It()),this.Fr())}discard(t){var e=(void 0===t?{}:t).discardProducerEvents,i=void 0!==e&&e;this.ne=!0,i&&(this.Ue(),this.Tr()),this.Ue(),this.Cr(),this.Ue(),this.Lr(),gl.info("discarded")}Nr(t,e,i,r,n){var s={$snapshot_bytes:i,$snapshot_data:e,$session_id:r,$window_id:n};"disabled"!==this.status?(this.qr(t,r),this.jr(s)):this.Ue()}Br(){try{this.Hr()}catch(t){this.ce||(this.ce=!0,gl.error("could not track full snapshot cost",t))}}Hr(){var t,e=null==(t=bl())||null==t.getLastSnapshotCost?void 0:t.getLastSnapshotCost();e&&e!==this.Dr&&(this.Dr=e,this.Or&&this.Or.durationMs>=e.durationMs||(this.Or=e),500>e.durationMs||gl.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}))}qr(t,e){2!==t.type?3===t.type&&(Ie(this.me)||this.me===e||this.ye===e||(this.ye=e,gl.info("incremental snapshot for a session with no full snapshot - requesting one",{sessionId:e}),this.It())):this.me=e}$r(t){t.counted&&t.generation===this.ke&&(this.we=Math.max(0,this.we-1)),t.counted=!1,this.be=this.be.filter(e=>e!==t)}Ur(t,e,i){t.processed||t.generation!==this.ke||(t.processed=!0,this.Nr(t.event,e,i,t.targetSessionId,t.targetWindowId))}zr(t){try{var e=t.event,i=mo(t.event);if(t.compressionEnabled)try{var r=Ol(t.event);e=r.event,i=r.size}catch(t){gl.error("could not process queued compression event - will use uncompressed event",t)}try{this.Ur(t,e,i)}catch(t){gl.error("could not capture queued compression event",t)}}finally{this.$r(t)}}He(){[...this.be].forEach(t=>{this.zr(t)})}Wr(t,e,i,r){var n=this,s={event:t,compressionEnabled:e,targetSessionId:i,targetWindowId:r,generation:this.ke,processed:!1,counted:!0};this.be.push(s),this.we+=1;var a=function(){var i=o(function*(){try{if(s.processed)return;var i,r;try{var o=e?Rl(t)?yield function(t){return $l.apply(this,arguments)}(t):Ol(t):{event:t,size:mo(t)};i=o.event,r=o.size}catch(e){gl.error("could not process queued compression event - will use uncompressed event",e),i=t,r=mo(t)}n.Ur(s,i,r)}finally{n.$r(s)}});return function(){return i.apply(this,arguments)}}();this.Ir=this.Ir?this.Ir.catch(()=>{}).then(a):a()}onRRwebEmit(t){var e,i,r,n,s,o,a,l,u;if(this._instance.sessionManager&&(this.dr(),t&&Te(t))){if(4===t.type){var h=this.rr(t.data.href);if(this.cr=h,!h)return;t.data.href=h}else this.hr();if(null==(e=this.Vt)||e.checkUrlTriggers(this.sessionId,()=>this.yr(),()=>this.br(),(t,e)=>this.wr(t,e)),!this.Y.urlBlocked||function(t){return 5===t.type&&"recording paused"===t.data.tag}(t)){var d,v,c;2===t.type&&(null!=(d=bl())&&null!=d.wasMaxDepthReached&&d.wasMaxDepthReached()&&(this.he=!0),this.Br(),Promise.resolve().then(()=>this.Br()),this.pr(),null==(v=this.Rr)||v.reset(),null==(c=this._instance.persistence)||c.register_once({[et]:t.timestamp},void 0));var f=2===t.type&&(null==(i=this.Vt)?void 0:i.hasPendingTriggers(this.sessionId));f&&this.Vr();var p=this.Rr?this.Rr.throttleMutations(t):t;if(p){var g=function(t){var e=t;if(e&&Te(e)&&6===e.type&&Te(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),m=function(t){return Nl(t)?t.data.payload:null}(g),y=function(t){return ql(t)?t.data.payload:null}(g),b=function(t){return Ll(t)?t.data.payload:null}(g);m||y?null!=m&&m.lastActivityTimestamp&&(g.timestamp=m.lastActivityTimestamp):null!=b&&b.sessionId||this.Zr(g),2===t.type&&(this.ge.push([this.Bt,t.timestamp]),this.ge.length>6&&(this.ge=this.ge.slice(-6)));var _=null!==(r=null!==(n=null!==(s=null==m?void 0:m.currentSessionId)&&void 0!==s?s:null==y?void 0:y.nextSessionId)&&void 0!==n?n:null==b?void 0:b.sessionId)&&void 0!==r?r:this.Bt,w=null!==(o=null!==(a=null!==(l=null==m?void 0:m.currentWindowId)&&void 0!==l?l:null==y?void 0:y.nextWindowId)&&void 0!==a?a:null==b?void 0:b.windowId)&&void 0!==o?o:this.Ie;if(!0!==this.Yt||function(t){return Ll(t)||Nl(t)||ql(t)}(g)){2===g.type&&(this.te=0),b&&(g.timestamp=b.lastActivityTimestamp+b.threshold);var k=this.Qt;this.Qt=!0,f?this.ur(!0):k||this.ur();var S=null===(u=this._instance.config.session_recording.compress_events)||void 0===u||u;if(this.we>0||S&&Rl(g))this.Wr(g,S,_,w);else{var x=S?Ol(g):{event:g,size:mo(g)};this.Nr(g,x.event,x.size,_,w)}}else(function(t){return 2===t.type||4===t.type||3===t.type&&9!==t.data.source})(g)&&this.te++}else!0===this.Yt&&this.te++}}}get status(){return this.Vt?this.Vt.getStatus({instance:this._instance,sessionId:this.sessionId,isSampled:this.Ut,rrwebError:this.ue,urlTriggerMatching:this.Y,eventTriggerMatching:this.tt,linkedFlagMatching:this.et,remoteConfig:this.zt}):Ws}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.et.linkedFlagSeen=!0,this.It(),this.mr(),this.Tt("linked_flag_overridden")}overrideSampling(){var t;null==(t=this._instance.persistence)||t.register({[Z]:this.sessionId,[H]:null}),this.It(),this.mr(),this.Tt("sampling_overridden")}overrideTrigger(t){this.wr(t),this.mr()}Gr(){try{var t,e=null==a||null==(t=a.location)?void 0:t.href;if(!e)return;var i=this.rr(e);if(!i)return;return new URL(i).hostname||void 0}catch(t){return}}Mr(){this.Qr&&(clearTimeout(this.Qr),this.Qr=void 0)}Fr(){this.Qr||(this.Qr=setTimeout(()=>{this.$e()},2e3))}Jr(){return this.me!==this.Pe.sessionId&&0!==this.Pe.data.length&&this.Pe.data.every(t=>5===(null==t?void 0:t.type)&&!Nl(t)&&!ql(t))}Kr(){var t,e;return null!==(t=null==(e=this.Vt)?void 0:e.getPendingTriggerConditions(this.sessionId))&&void 0!==t?t:[]}Xr(t){if("buffering"!==t)return Ie(this.Yr)||this._instance.register_for_session({[Vt]:[]}),void(this.Yr=void 0);var e=this.Kr();if(0===e.length)return Ie(this.Yr)||this._instance.register_for_session({[Vt]:[]}),void(this.Yr=void 0);var i=e.join(", "),r=this.sessionId+":"+i;r!==this.Yr&&(this.Yr=r,this._instance.register_for_session({[Vt]:e}),gl.info("buffering: "+i))}$e(){var t;if(this.Mr(),this.ne)return this.Pe;if(this.Jr())return this.Pe.size>943718.4?this.Ue():this.Pe;var e=this.Pe;null==(t=this.Vt)||t.ensureSamplingDecision(this.sessionId);var i=this.Fe(),r=this.status;if(this.Xr(r),"buffering"===r||"paused"===r||"disabled"===r||i)return this.Fr(),this.Pe;if(this.Pe!==e)return this.Pe;if(e.data.length>0){var n,s=this.Gr();bo(e).forEach(t=>{try{var e;null==(e=this.Re)||e.trackSize(t.sessionId,t.size),this.ti({$snapshot_bytes:t.size,$snapshot_data:t.data,$session_id:t.sessionId,$window_id:t.windowId,$lib:ia.LIB_NAME,$lib_version:ia.LIB_VERSION,$snapshot_host:s})}catch(t){gl.warn("could not capture snapshot chunk - skipping it",t)}}),null==(n=this.Vt)||n.onFlushComplete()}return this.Ue()}jr(t){var e,i=2+((null==(e=this.Pe)?void 0:e.data.length)||0),r=t.$session_id,n=this.Pe.sessionId!==r;if(n||!0!==this.Yt&&!this.ne&&this.Pe.size+t.$snapshot_bytes+i>943718.4){var s=this.Bt;if(this.Pe=this.$e(),this.Bt!==s)return;n&&this.Pe.data.length>0&&(this.Pe=this.Ue()),this.Pe.sessionId=r,this.Pe.windowId=t.$window_id}this.ne&&(this.ae||this.Pe.size+t.$snapshot_bytes+i>943718.4)?this.ae||(this.ae=!0,this.Pe=this.Ue()):(this.Pe.size+=t.$snapshot_bytes,this.Pe.data.push(t.$snapshot_data),this.Pe.sizes.push(t.$snapshot_bytes),!0===this.Yt||this.ne||this.Fr())}ti(t){this._instance.capture("$snapshot",t,{_url:this._instance.requestRouter.endpointFor("api",this.Zt),_noTruncate:!0,_batchKey:"recordings",skip_client_rate_limiting:!0})}get Ne(){var t,e,i=null==(t=this.Pe)?void 0:t.data[(null==(e=this.Pe)?void 0:e.data.length)-1],r=this.Ht.checkAndGetSessionAndWindowId(!0).sessionStartTimestamp;return i?i.timestamp-r:null}Vr(){if(!this.Pe||0===this.Pe.data.length)return this.Ue();for(var t=-1,e=this.Pe.data.length-1;e>=0;e--)if(4===this.Pe.data[e].type){t=e;break}return 0>t?this.Ue():(this.Pe.data=this.Pe.data.slice(t),this.Pe.sizes=this.Pe.sizes.slice(t),this.Pe.size=this.Pe.sizes.reduce((t,e)=>t+e,0),this.Pe)}Ue(){return this.Pe={size:0,data:[],sizes:[],sessionId:this.Bt,windowId:this.Ie},this.Pe}Tt(t,e){this._instance.register_for_session({[Xt]:t}),gl.info(t.replace("_"," "),e),"session_id_changed"!==t&&this.Dt("$recording_started",n({reason:t},e))}ei(t){var e;return 3===t.type&&-1!==ml.indexOf(null==(e=t.data)?void 0:e.source)}Zr(t){var e=this.ei(t);e||!0===this.Yt||t.timestamp-this.Jt>this.$t&&(this.Yt=!0,clearInterval(this.gr),this.Dt("sessionIdle",{eventTimestamp:t.timestamp,lastActivityTimestamp:this.Jt,threshold:this.$t,bufferLength:this.Pe.data.length,bufferSize:this.Pe.size,sessionId:this.Bt,windowId:this.Ie}),this.$e());var i=!1;if(e&&(this.Jt=t.timestamp,this.Yt)){var r="unknown"===this.Yt;this.Yt=!1,r||(this.Dt("sessionNoLongerIdle",{reason:"user activity",type:t.type}),i=!0)}var n=this.Ht.checkAndGetSessionAndWindowId(!e,t.timestamp),s=n.windowId,o=n.sessionId,a=this.Bt!==o,l=this.Ie!==s;if(this.Ie=s,this.Bt=o,a||l){var u=a&&!1!==this.Yt;u&&(this.Yt="unknown"),this.Ee(u)}else if(e&&this.mr(),i){var h,d=["sampled","active"].includes(this.status)||(null==(h=this.Vt)?void 0:h.hasPendingTriggers(this.sessionId));this.te>0&&d&&this.It(),this.ur(),this.pr()}}Ae(){var t;null==(t=this.Vt)||t.clearConditionalRecordingPersistence()}get sdkDebugProperties(){var t,e,i,r,n,s,o,a,l,u=this.Ht.checkAndGetSessionAndWindowId(!0).sessionStartTimestamp,h=null==(t=bl())||null==t.getDeferredStylesheetStats?void 0:t.getDeferredStylesheetStats();return{$recording_status:this.status,$sdk_debug_replay_flush_hold_reason:this.Er,$sdk_debug_replay_internal_buffer_length:this.Pe.data.length,$sdk_debug_replay_internal_buffer_size:this.Pe.size,$sdk_debug_current_session_duration:this.Ne,$sdk_debug_session_start:u,$sdk_debug_replay_flushed_size:null==(e=this.Re)?void 0:e.currentTrackedSize(this.sessionId),$sdk_debug_replay_full_snapshots:this.ge,$snapshot_max_depth_exceeded:this.he,$sdk_debug_replay_slowest_full_snapshot_ms:vl(null==(i=this.Or)?void 0:i.durationMs),$sdk_debug_replay_slowest_full_snapshot_stylesheet_ms:vl(null==(r=this.Or)?void 0:r.stylesheetMs),$sdk_debug_replay_slowest_full_snapshot_nodes:null==(n=this.Or)?void 0:n.nodeCount,$sdk_debug_replay_slowest_full_snapshot_css_rules:null==(s=this.Or)?void 0:s.cssRuleCount,$sdk_debug_replay_slowest_full_snapshot_css_rules_non_deferrable:null==(o=this.Or)?void 0:o.nonDeferrableCssRuleCount,$sdk_debug_replay_deferred_stylesheets:null==h?void 0:h.deferredCount,$sdk_debug_replay_deferred_stylesheets_failed:null==h?void 0:h.failedCount,$sdk_debug_replay_deferred_stylesheets_abandoned:null==h?void 0:h.abandonedCount,$sdk_debug_replay_deferred_stylesheet_ms:vl(null==h?void 0:h.totalMs),$sdk_debug_replay_deferred_stylesheet_slowest_slice_ms:vl(null==h?void 0:h.slowestSliceMs),$sdk_debug_replay_slowest_mutation_batch_ms:vl(null==(a=bl())||null==a.getMutationCost||null==(a=a.getMutationCost())?void 0:a.slowestBatchMs),$sdk_debug_replay_discarded_duration_samples:null==(l=bl())||null==l.getDiscardedDurationSamples?void 0:l.getDiscardedDurationSamples(),$sdk_debug_replay_throttled_mutations_dropped:this.ee,$sdk_debug_replay_oversized_mutations_dropped:this.re,$sdk_debug_replay_oversized_mutation_bytes_dropped:this.ie,$sdk_debug_replay_rrweb_error:this.ue,[Qt]:!!this.Gt,[Kt]:this.le}}Sr(){var t;if(!this.Gt){this.le=!0;var e,i,r,s,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 d=u[0],v=u[1];if(d in o)if("maskInputOptions"===d)o.maskInputOptions=n({password:!0},v);else if("sampling"===d){var c=null!=v?v:{},f={};Ie(c.mousemove)||(f.mousemove=c.mousemove),Ie(c.mouseInteraction)||(f.mouseInteraction=c.mouseInteraction),o.sampling=f}else o[d]=v}!0===(null==l?void 0:l.captureJsonLd)&&!0!==o.slimDOMOptions&&"all"!==o.slimDOMOptions&&(o.slimDOMOptions=n({},o.slimDOMOptions,{script:!0})),this.Ke&&this.Ke.enabled&&(o.recordCanvas=!0,o.sampling=n({},o.sampling,{canvas:this.Ke.fps}),o.dataURLOptions={type:"image/webp",quality:this.Ke.quality},o.canvasResolutionScale=this.Je,o.canvasMasking={configured:()=>{var t;return Ce(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(Ce(i))try{var r;return null!==(r=i(t))&&void 0!==r?r:null}catch(t){return this.fe||(this.fe=!0,gl.warn("canvasCapture.maskRegionsFn threw, canvas frames will be skipped",t)),null}}}),this.Ge&&(o.maskAllInputs=null===(e=this.Ge.maskAllInputs)||void 0===e||e,o.maskTextSelector=null!==(i=this.Ge.maskTextSelector)&&void 0!==i?i:void 0,o.blockSelector=null!==(r=this.Ge.blockSelector)&&void 0!==r?r:void 0,o.maskAllElementAttributes=null!==(s=this.Ge.maskAllElementAttributes)&&void 0!==s&&s),o.maskAllElementAttributes&&o.maskAttributeFn&&(o.maskAttributeFn=void 0,this.ve||(this.ve=!0,gl.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.Qe();var p=_l();if(p){this.Rr=null!==(t=this.Rr)&&void 0!==t?t:new ea(p,{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";gl.info(i,{node:e}),this.log("[SessionRecording] "+i,"warn")},onDroppedAttributeMutations:t=>this.ee+=t,bytesRefillRate:this._instance.config.session_recording.__mutationBytesRefillRate,bytesBucketSize:this._instance.config.session_recording.__mutationBytesBucketSize,resyncIntervalMs:this.vr,onDroppedOversizedMutation:t=>{0===this.re&&this.log("[SessionRecording] Dropped an oversized DOM mutation to keep the recording playable. The recording will resync with a full snapshot.","warn"),this.re+=1,this.ie+=t},requestFullSnapshot:()=>this.It()});var g=this.tr();if(this.Gt=p(n({emit:t=>{this.onRRwebEmit(t)},plugins:g,errorHandler:(t,e)=>"rrweb"===e&&(this.pe||(this.pe=!0,gl.error("rrweb internal error - recording will continue but may be incomplete",t)),!0)},o)),!this.Gt)return this.ue=!0,void gl.error("rrweb failed to start - Loss of recording data is possible. Check the browser console for rrweb errors.");this.ue=!1,!0===(null==l?void 0:l.captureJsonLd)&&h&&null!=a&&a.MutationObserver&&!this.lr&&(this.lr=function(t,e,i){var r=new WeakMap,n=i.getCaptureState||(()=>!0),s=za,o=function(t,e){var i=e.attributeFilter;return e.maskAllElementAttributes||e.maskAttributeFn||null!=i&&i.length&&!i.includes("id")?Va:i=>{var r=t.getElementById(i);return!!r&&"SCRIPT"!==r.nodeName&&(!e.isRecordedElement||e.isRecordedElement(r))&&!hl(r,e.blockClass,e.blockSelector)}}(t,i),a=e=>{try{var a=n();if(!s||!1===a||!e.isConnected||e.ownerDocument!==t||function(t,e){return hl(t,e.blockClass,e.blockSelector)||hl(t,e.maskTextClass,e.maskTextSelector)}(e,i))return;var l=function(t,e){if(void 0===e&&(e=Va),!t||t.length>za)return null;try{var i=JSON.parse(t),r={remainingNodes:2048,exceeded:!1},n=xe(i)?i.map(t=>al(t,e,r)):al(i,e,r);if(r.exceeded||Ae(n)||xe(n)&&(!n.length||n.some(Ae)))return null;var s=JSON.stringify(n);return s.length>2e4?null:[n,s]}catch(t){return null}}(e.text,o);if(!l)return void r.delete(e);var u=l[0],h=l[1];if(Ae(a))return void r.set(e,h);if(r.get(e)!==h){if(h.length>s)return void(s=0);i.emit(u)&&(r.set(e,h),s-=h.length)}}catch(t){return}};try{var l=new e(t=>{try{if(!s||!1===n())return;var e=t=>{for(var e of dl(t))a(e)};for(var i of t)if("childList"===i.type)ll(i.target)&&a(i.target),i.addedNodes.forEach(e);else if("characterData"===i.type){var r=i.target.parentNode;r&&ll(r)&&a(r)}else"attributes"===i.type&&ll(i.target)&&a(i.target)}catch(t){return}});return l.observe(t,{attributes:!0,attributeFilter:["type"],characterData:!0,childList:!0,subtree:!0}),{scan(e){void 0===e&&(e=!1),s&&!1!==n()&&dl(t.documentElement).forEach(t=>{e&&r.delete(t),a(t)})},stop(){return l.disconnect()}}}catch(t){return{scan(){},stop(){}}}}(h,a.MutationObserver,{attributeFilter:o.attributeFilter,blockClass:o.blockClass,blockSelector:o.blockSelector,isRecordedElement:t=>p.mirror.getId(t)>0,maskAllElementAttributes:o.maskAllElementAttributes,maskAttributeFn:o.maskAttributeFn,maskTextClass:o.maskTextClass,maskTextSelector:o.maskTextSelector,getCaptureState:()=>{var t;return!0!==(null==(t=this._instance.config.session_recording)?void 0:t.captureJsonLd)||this.Y.urlBlocked||this.Y.isCurrentUrlBlocked()?null:this.ar()},emit:t=>this.sr(t)}),this.Y.isCurrentUrlBlocked()&&this.lr.scan()),this.Jt=Date.now(),this.Yt=$e(this.Yt)?this.Yt:"unknown",this.tryAddCustomEvent("$remote_config_received",this.zt),this.Dt("$session_options",{sessionRecordingOptions:o,activePlugins:g.map(t=>null==t?void 0:t.name)}),this.Dt("$posthog_config",{config:this._instance.config})}else gl.error("_startRecorder was called but rrwebRecord is not available. This indicates something has gone wrong.")}}tryAddCustomEvent(t,e){return this.Dt(t,e)}},Bl=function(t){return 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}({}),Hl=function(t){return 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}({}),zl=function(t){return 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}({}),Ul=function(t){return t[t.Mouse=0]="Mouse",t[t.Pen=1]="Pen",t[t.Touch=2]="Touch",t}({}),Wl=function(t){return t[t["2D"]=0]="2D",t[t.WebGL=1]="WebGL",t[t.WebGL2=2]="WebGL2",t}({}),Vl=function(t){return 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}({}),Gl=function(t){return 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}({});function Zl(t,e){return-1!==t.indexOf(e)}"Mobile".toLowerCase(),"Tablet".toLowerCase(),new RegExp("Xbox","i"),new RegExp("Nintendo","i"),new RegExp("PlayStation","i"),new RegExp("Windows","i"),Date,Date;var Jl={Node:["childNodes","parentNode","parentElement","textContent"],ShadowRoot:["host","styleSheets"],Element:["shadowRoot"],MutationObserver:[]},Ql={Node:["contains","getRootNode"],ShadowRoot:["getSelection"],Element:["querySelector","querySelectorAll"],MutationObserver:["constructor"]},Kl={};function Xl(t){if(Kl[t])return Kl[t];var e=function(t){var e,i,r=null===(e=globalThis)||void 0===e||null===(e=e.Zone)||void 0===e||null===(i=e.__symbol__)||void 0===i?void 0:i.call(e,t);return r&&globalThis[r]?globalThis[r]:void 0}(t)||globalThis[t],i=e.prototype,r=t in Jl?Jl[t]:void 0,n=Boolean(r&&r.every(t=>{var e;return Boolean(null===(e=Object.getOwnPropertyDescriptor(i,t))||void 0===e||null===(e=e.get)||void 0===e?void 0:e.toString().includes("[native code]"))})),s=t in Ql?Ql[t]:void 0,o=Boolean(s&&s.every(t=>{var e;return"function"==typeof i[t]&&(null===(e=i[t])||void 0===e?void 0:e.toString().includes("[native code]"))}));if(n&&o)return Kl[t]=e.prototype,e.prototype;var a=document.createElement("iframe");a.style.display="none";var l=!1;try{document.body.appendChild(a);var u=a.contentWindow;if(!u)return e.prototype;var h=u[t].prototype;return h?(function(t){return Zl(t,"AppleWebKit")&&!Zl(t,"Chrome")}(navigator.userAgent)&&(a.classList.add("rr-block","ph-no-capture"),a.setAttribute("__rrwebUntaintedPrototype",t),l=!0),Kl[t]=h):i}catch(t){return i}finally{!l&&a.parentNode&&document.body.removeChild(a)}}var Yl={};function tu(t,e,i){var r,n=t+"."+String(i);if(Yl[n])return Yl[n].call(e);var s=Xl(t),o=null===(r=Object.getOwnPropertyDescriptor(s,i))||void 0===r?void 0:r.get;return o?(Yl[n]=o,o.call(e)):e[i]}var eu={};function iu(t,e,i){var r=t+"."+String(i);if(eu[r])return eu[r].bind(e);var n=Xl(t)[i];return"function"!=typeof n?e[i]:(eu[r]=n,n.bind(e))}function ru(){return Xl("MutationObserver").constructor}function nu(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],o=i(r);o;){if(o.next===s)return void(o.next=n.next);o=i(r=o.next)}else t[e]=n.next}}catch(t){return()=>{}}}var su={childNodes:t=>tu("Node",t,"childNodes"),parentNode:t=>tu("Node",t,"parentNode"),parentElement:t=>tu("Node",t,"parentElement"),textContent:t=>tu("Node",t,"textContent"),contains:(t,e)=>iu("Node",t,"contains")(e),getRootNode:t=>iu("Node",t,"getRootNode")(),host:t=>t&&"host"in t?tu("ShadowRoot",t,"host"):null,styleSheets:t=>t.styleSheets,shadowRoot:t=>t&&"shadowRoot"in t?tu("Element",t,"shadowRoot"):null,querySelector:(t,e)=>iu("Element",t,"querySelector")(e),querySelectorAll:(t,e)=>iu("Element",t,"querySelectorAll")(e),mutationObserver:ru,patch:nu};function ou(){try{if("undefined"!=typeof performance&&performance.now)return performance.now()}catch(t){}return Date.now()}var au=0;function lu(){au+=1}function uu(){return au}function hu(t,e){return(e!==au||t>6e4)&&!0}var du=0,vu=0,cu=0,fu={durationMs:0,stylesheetMs:0,nodeCount:0,cssRuleCount:0,nonDeferrableCssRuleCount:0,deferredStylesheetCount:0},pu=null,gu=null,mu=[],yu=0,bu=0,_u={slowestBatchMs:0},wu={deferredCount:0,failedCount:0,abandonedCount:0,totalMs:0,slowestSliceMs:0};function ku(t){(du+=1)>1||(fu={durationMs:0,stylesheetMs:0,nodeCount:0,cssRuleCount:0,nonDeferrableCssRuleCount:0,deferredStylesheetCount:0},mu=[],yu=0,gu=(t=>t&&t>0?t:null)(t),vu=ou(),cu=au)}function Su(){return 0===du?pu||{durationMs:0,stylesheetMs:0,nodeCount:0,cssRuleCount:0,nonDeferrableCssRuleCount:0,deferredStylesheetCount:0}:(du-=1)>0?fu:(fu.durationMs=ou()-vu,fu.deferredStylesheetCount=yu,wu.deferredCount+=yu,gu=null,hu(fu.durationMs,cu)?fu:pu=fu)}function xu(t,e,i){var r=t.length;if(i>=32)return r;for(var n=0;t.length>n;n++){var s=t[n];try{var o=s.cssRules;if(o&&o.length)r+=xu(o,e,i+1);else if(e&&s.styleSheet){var a=s.styleSheet;if(!e.has(a)){e.add(a);var l=a.rules||a.cssRules;l&&(r+=xu(l,e,i+1))}}}catch(t){}}return r}function Cu(t){if(0!==du){var e=xu(t,null,0);fu.cssRuleCount+=e,bu>0&&(fu.nonDeferrableCssRuleCount+=e)}}function Tu(t){bu+=1;try{return t()}finally{bu-=1}}function Mu(t){du>0&&(fu.stylesheetMs+=t)}function Iu(t){if(0===du||null===gu)return!1;var e=fu.cssRuleCount-fu.nonDeferrableCssRuleCount;return e>=gu||e+function(t){try{var e=t&&(t.rules||t.cssRules);if(!e)return 0;var i=new WeakSet;return i.add(t),xu(e,i,0)}catch(t){return 0}}(t)>gu}function Eu(){wu.failedCount+=1}function Ru(t){t>0&&(wu.abandonedCount+=t)}function Au(t){return Au="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Au(t)}function Pu(t,e,i){return(e=function(t){var e=function(t){if("object"!=Au(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var i=e.call(t,"string");if("object"!=Au(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==Au(e)?e:e+""}(e))in t?Object.defineProperty(t,e,{value:i,enumerable:!0,configurable:!0,writable:!0}):t[e]=i,t}function Fu(t){return t.nodeType===t.ELEMENT_NODE}function Ou(t){var e=t&&"host"in t&&"mode"in t&&su.host(t)||null;return Boolean(e&&"shadowRoot"in e&&su.shadowRoot(e)===t)}function $u(t){return"[object ShadowRoot]"==={}.toString.call(t)}function Du(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 Lu(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 Nu=0;function qu(t){var e=0===Nu,i=e?ou():0;Nu+=1;try{var r=t.rules||t.cssRules;if(!r)return null;Cu(r);var n=t.href;return!n&&t.ownerNode&&(n=t.ownerNode.baseURI),Du(Array.from(r,t=>ju(t,n)).join(""))}catch(t){return null}finally{Nu-=1,e&&Mu(ou()-i)}}function ju(t,e){if(Hu(t)){var i;try{i=qu(t.styleSheet)||Lu(t)}catch(e){i=t.cssText}try{var r;if(i&&(null===(r=t.styleSheet)||void 0===r?void 0:r.href))return nh(i,t.styleSheet.href)}catch(t){}return i}var n=t.cssText;return zu(t)&&t.selectorText.includes(":")&&(n=Bu(n)),e?nh(n,e):n}function Bu(t){return t.replace(/(\[(?:[\w-]+)[^\\])(:(?:[\w-]+)\])/gm,"$1\\$2")}function Hu(t){return"styleSheet"in t}function zu(t){return"selectorText"in t}var Uu=/^-?[A-Za-z_][\w-]*$/,Wu=/^-?[A-Za-z_][\w-]*(\.-?[A-Za-z_][\w-]*)*$/;function Vu(t){var e=[],i=!1,r=null,n=new Map;function s(t){var n=e.pop();if("group"===n.kind){if(null===t){for(;e.length>0&&"group"===e[e.length-1].kind;)e.pop();return void s(null)}var a=e[e.length-1];return a.parts.push(t),void(a.index+=1)}if(!n.importRule)return i=!0,void(r=t);o(e[e.length-1],n.importRule,t)}function o(t,e,i){try{var r;try{r=i||Lu(e)}catch(t){r=e.cssText}try{var n;r&&(null===(n=e.styleSheet)||void 0===n?void 0:n.href)&&(r=nh(r,e.styleSheet.href))}catch(t){}r&&t.parts.push(r),t.index+=1}catch(t){s(null)}}function a(t){var i=t.rules[t.index];if("sheet"===t.kind&&Hu(i)){var r=n.get(i);return null===r?(t.parts.push(i.cssText),void(t.index+=1)):r?void e.push({kind:"sheet",sheet:r.sheet,rules:r.rules,sheetHref:r.sheetHref,index:0,parts:[],importRule:i}):void o(t,i,null)}if(!function(t,i){try{var r=function(t){var e=t;if(!e.cssRules||0===e.cssRules.length)return null;if(e.media&&"string"==typeof e.media.mediaText)return"@media "+e.media.mediaText+" {";if(zu(t)){if("number"==typeof e.type&&1!==e.type)return null;var i=e.style?e.style.cssText:"";return t.selectorText+" {"+(i?" "+i:"")}if("containerName"in e)return"string"!=typeof e.containerQuery||e.containerName&&!Uu.test(e.containerName)?null:"@container "+(e.containerName?e.containerName+" ":"")+e.containerQuery+" {";if("string"==typeof e.conditionText){var r="";try{var n;r=(null===(n=t.constructor)||void 0===n?void 0:n.name)||""}catch(t){return null}return""===r||"Object"===r||"CSSSupportsRule"===r?"@supports "+e.conditionText+" {":null}return"string"==typeof e.name?"keyText"in e.cssRules[0]?Uu.test(e.name)?"@keyframes "+e.name+" {":null:""===e.name?"@layer {":Wu.test(e.name)?"@layer "+e.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?nh(r,n):r,fixColons:"sheet"===i.kind&&zu(t)&&t.selectorText.includes(":")}),!0}catch(t){return!1}}(i,t)){var s=i.cssText;"sheet"===t.kind&&zu(i)&&i.selectorText.includes(":")&&(s=Bu(s)),t.parts.push(t.sheetHref?nh(s,t.sheetHref):s),t.index+=1}}return function(t){try{var i=t.rules||t.cssRules;if(!i)return!1;Cu(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,!Hu(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;Cu(s);var o=r.href;!o&&r.ownerNode&&(o=r.ownerNode.baseURI);var a=Array.from(s);n.set(e,{sheet:r,rules:a,sheetHref:o}),i.push({sheet:r,rules:a,index:0})}catch(t){}};i.length>0;)r()}(s,t),!0}catch(t){return!1}}(t)||(i=!0),{advance(t){if(i)return!0;var n=ou(),o=t>0?t:1;try{for(;!i&&o>0;){var l=e[e.length-1];if(l.rules.length>l.index){o-=1;try{a(l)}catch(t){s(null)}}else{var u=null;try{if("group"===l.kind){var h=l.prelude+l.parts.join("")+"}";u=l.fixColons?Bu(h):h}else u=Du(l.parts.join(""))}catch(t){}s(u)}}}catch(t){i=!0,r=null}finally{Mu(ou()-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}}}var Gu=class{constructor(){Pu(this,"idNodeMap",new Map),Pu(this,"nodeMetaMap",new WeakMap)}getId(t){var e,i;return t&&null!==(e=null===(i=this.getMeta(t))||void 0===i?void 0:i.id)&&void 0!==e?e:-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)),Fu(t)){var i=su.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 Zu(t){var e=t.element,i=t.maskInputOptions,r=t.tagName,n=t.type,s=t.maskInputFn,o=t.value||"",a=n&&Ju(n);return(i[r.toLowerCase()]||a&&i[a])&&(o=s?s(o,e):"*".repeat(o.length)),o}function Ju(t){return t.toLowerCase()}var Qu=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 Ku(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&&Qu.has(Ju(i))?r:"*".repeat(r.length):n?n(i,r,e):r:r}var Xu="__rrweb_original__";function Yu(t){try{var e=t.type;return t.hasAttribute("data-rr-is-password")?"password":e?Ju(e):null}catch(t){return null}}var th=/url\((?:(')([^']*)'|(")(.*?)"|([^)]*))\)/gm,eh=/^(?:[a-z+]+:)?\/\//i,ih=/^www\..*/i,rh=/^(data:)([^,]*),(.*)/i;function nh(t,e){return(t||"").replace(th,(t,i,r,n,s,o)=>{var a,l=r||s||o,u=i||n||"";if(!l)return t;if(eh.test(l)||ih.test(l))return"url("+u+l+u+")";if(rh.test(l))return"url("+u+l+u+")";if("/"===l[0])return"url("+u+(((a=e).indexOf("//")>-1?a.split("/").slice(0,3).join("/"):a.split("/")[0]).split("?")[0]+l)+u+")";var h=e.split("/"),d=l.split("/");for(var v of(h.pop(),d))"."!==v&&(".."===v?h.pop():h.push(v));return"url("+u+h.join("/")+u+")"})}var sh,oh,ah=new Map,lh=1,uh=new RegExp("[^a-z0-9-_:]");function hh(){return lh++}var dh=/^[^ \t\n\r\u000c]+/,vh=/^[, \t\n\r\u000c]+/,ch=new WeakMap;function fh(t,e){return e&&""!==e.trim()?ph(t,e):e}function ph(t,e){var i=ch.get(t);if(i||(i=t.createElement("a"),ch.set(t,i)),e){if(e.startsWith("blob:")||e.startsWith("data:"))return e}else e="";return i.setAttribute("href",e),i.href}function gh(t,e){return(null==e?void 0:e.maxBase64ImageLength)?function(t,e){return e&&t.length>e?"data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTAwJSIgaGVpZ2h0PSIxMDAlIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPgogIDxkZWZzPgogICAgPHBhdHRlcm4gaWQ9InN0cmlwZXMiIHBhdHRlcm5Vbml0cz0idXNlclNwYWNlT25Vc2UiIHdpZHRoPSIxNiIgaGVpZ2h0PSIxNiI+CiAgICAgIDxyZWN0IHdpZHRoPSIxNiIgaGVpZ2h0PSIxNiIgZmlsbD0iYmxhY2siLz4KICAgICAgPHBhdGggZD0iTTggMEgxNkwwIDE2VjhMOCAwWiIgZmlsbD0iIzJEMkQyRCIvPgogICAgICA8cGF0aCBkPSJNMTYgOFYxNkg4TDE2IDhaIiBmaWxsPSIjMkQyRDJEIi8+CiAgICA8L3BhdHRlcm4+CiAgPC9kZWZzPgogIDxyZWN0IHdpZHRoPSIxMDAlIiBoZWlnaHQ9IjEwMCUiIGZpbGw9InVybCgjc3RyaXBlcykiLz4KPC9zdmc+Cg==":t}(t,e.maxBase64ImageLength):t}function mh(t,e,i,r,n,s){if(!r)return r;if("src"===i||"href"===i&&("use"!==e||"#"!==r[0])){if("link"===e&&n){var o,a=null===(o=n.sheet)||void 0===o?void 0:o.href;if(a)return a}var l=fh(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(1e5>e.length)return e;if(!t.complete||0===t.naturalWidth)return e;if(t.naturalWidth>4096||t.naturalHeight>4096)return e;var n=ah.get(e);if(n&&n.type===i&&n.quality===r)return n.result;try{var s=document.createElement("canvas");s.width=t.naturalWidth,s.height=t.naturalHeight;var o=s.getContext("2d");if(!o)return e;o.drawImage(t,0,0);var a=s.toDataURL(i||"image/webp",null!=r?r:.4),l=e.length>a.length?a:e;if(ah.size>=10){var u=ah.keys().next().value;void 0!==u&&ah.delete(u)}return ah.set(e,{type:i,quality:r,result:l}),l}catch(t){return e}}(n,l,s.type,s.quality)),gh(u,s)}if("image"===e)return gh(l,s)}return l}if("xlink:href"===i&&"#"!==r[0]){var h=fh(t,r);return"image"===e&&h.startsWith("data:")?gh(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(vh),e.length>i;){var s=r(dh);if(","===s.slice(-1))s=fh(t,s.substring(0,s.length-1)),n.push(s);else{var o="";s=fh(t,s);for(var a=!1;;){var l=e.charAt(i);if(""===l){n.push((s+o).trim());break}if(a)")"===l&&(a=!1);else{if(","===l){i+=1,n.push((s+o).trim());break}"("===l&&(a=!0)}o+=l,i+=1}}}return n.join(", ")}(t,r):"style"===i?nh(r,ph(t)):"object"===e&&"data"===i?fh(t,r):r:fh(t,r)}function yh(t,e,i){return("video"===t||"audio"===t)&&"autoplay"===e}function bh(t,e,i){if(!t)return!1;if(t.nodeType!==t.ELEMENT_NODE)return!!i&&bh(su.parentNode(t),e,i);for(var r=t.classList.length;r--;)if(e.test(t.classList[r]))return!0;return!!i&&bh(su.parentNode(t),e,i)}function _h(t,e,i,r){var n;if(Fu(t)){if(!su.childNodes(n=t).length)return!1}else{if(null===su.parentElement(t))return!1;n=su.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(bh(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 wh(t,e,i){var r=t.removeEventListener;"function"==typeof r&&r.call(t,e,i)}var kh=new Map;function Sh(t,e){return Array.from(t.styleSheets).find(t=>t.href===e)}function xh(t){return null==t?"":t.toLowerCase()}var Ch=!1,Th=!1;function Mh(t,e){var i=e.doc,r=e.mirror,n=e.blockClass,s=e.blockSelector,o=e.maskTextClass,a=e.maskTextSelector,l=e.skipChild,u=void 0!==l&&l,h=e.inlineStylesheet,d=void 0===h||h,v=e.maskInputOptions,c=void 0===v?{}:v,f=e.maskTextFn,p=e.maskInputFn,g=e.maskAllElementAttributes,m=void 0!==g&&g,y=e.maskAttributeFn,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,I=e.onIframeLoad,E=e.iframeLoadTimeout,R=void 0===E?5e3:E,A=e.onIframeListenerRegistered,P=e.onStylesheetLoad,F=e.stylesheetLoadTimeout,O=void 0===F?5e3:F,D=e.keepIframeSrcFn,L=void 0===D?()=>!1:D,N=e.newlyAddedElement,q=void 0!==N&&N,j=e.depth,B=void 0===j?0:j,H=e.maxDepth,z=void 0===H?50:H,U=e.needsMask,W=e.preserveWhiteSpace,V=void 0===W||W;if(B>=z)return Th=!0,Ch||(Ch=!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=_h(t,o,a,void 0===U)),du>0&&(fu.nodeCount+=1);var G,Z=function(t,e){var i=e.doc,r=e.blockClass,n=e.blockSelector,s=e.needsMask,o=e.inlineStylesheet,a=e.maskInputOptions,l=void 0===a?{}:a,u=e.maskTextFn,h=e.maskInputFn,d=e.maskAllElementAttributes,v=void 0!==d&&d,c=e.maskAttributeFn,f=e.dataURLOptions,p=void 0===f?{}:f,g=e.inlineImages,m=e.recordCanvas,y=e.canvasMaskingConfigured,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:Gl.Document,childNodes:[],compatMode:t.compatMode}:{type:Gl.Document,childNodes:[]};case t.DOCUMENT_TYPE_NODE:return{type:Gl.DocumentType,name:t.name,publicId:t.publicId,systemId:t.systemId,rootId:k};case t.ELEMENT_NODE:return function(t,e){for(var i=e.doc,r=e.inlineStylesheet,n=e.maskInputOptions,s=void 0===n?{}:n,o=e.maskInputFn,a=e.maskAllElementAttributes,l=void 0!==a&&a,u=e.maskAttributeFn,h=e.dataURLOptions,d=void 0===h?{}:h,v=e.inlineImages,c=e.recordCanvas,f=e.canvasMaskingConfigured,p=e.keepIframeSrcFn,g=e.newlyAddedElement,m=void 0!==g&&g,y=e.rootId,b=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),_=function(t){if(t instanceof HTMLFormElement)return"form";var e=Ju(t.tagName);return uh.test(e)?"div":e}(t),w=new Set,k={},S=t.attributes.length,x=0;S>x;x++){var C=t.attributes[x];yh(_,C.name)||(k[C.name]=mh(i,_,Ju(C.name),C.value,t,d))}if("link"===_&&r&&!b){var T=t.sheet;if(!T){var M=function(t){return t.href}(t);M&&!(T=Sh(i,M))&&M.includes(".css")&&(T=Sh(i,window.location.origin+"/"+M.replace(window.location.href,"")))}var I=null;T&&(Iu(T)?du>0&&(mu.push(t),yu+=1):I=qu(T)),I&&(delete k.rel,delete k.href,k._cssText=I)}if("style"===_&&t.sheet&&!(t.innerText||su.textContent(t)||"").trim().length){var E=Tu(()=>qu(t.sheet));E&&(k._cssText=E)}if("input"===_||"textarea"===_||"select"===_){var R=t.value,A=t.checked;"radio"!==k.type&&"checkbox"!==k.type&&"submit"!==k.type&&"button"!==k.type&&R?k.value=Zu({element:t,type:Yu(t),tagName:_,value:R,maskInputOptions:s,maskInputFn:o}):A&&(k.checked=A)}if("option"===_&&(t.selected&&!s.select?k.selected=!0:delete k.selected),"dialog"===_&&t.open){try{k.rr_open_mode=t.matches("dialog:modal")?"modal":"non-modal"}catch(t){k.rr_open_mode="modal",k.ph_rr_could_not_detect_modal=!0}w.add("rr_open_mode")}if("canvas"===_&&c&&!(null==f?void 0:f()))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((Xu in n?n[Xu]: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)||(k.rr_dataURL=t.toDataURL(d.type,d.quality));else if(!("__context"in t)){var P=t.toDataURL(d.type,d.quality),F=i.createElement("canvas");F.width=t.width,F.height=t.height,P!==F.toDataURL(d.type,d.quality)&&(k.rr_dataURL=P)}var O,D,L=!1;if("img"===_&&v){sh||(sh=i.createElement("canvas"),oh=sh.getContext("2d"));var N=t,q=N.currentSrc||N.getAttribute("src")||"<unknown-src>",j=N.crossOrigin,B=(e,i)=>L?Ku({element:t,name:e,value:i,maskAllElementAttributes:l,maskAttributeFn:u}):i,H=()=>{wh(N,"load",H);try{sh.width=N.naturalWidth,sh.height=N.naturalHeight,oh.drawImage(N,0,0);var t=sh.toDataURL(d.type,d.quality);k.rr_dataURL=B("rr_dataURL",t)}catch(t){if("anonymous"!==N.crossOrigin)return N.crossOrigin="anonymous",void(N.complete&&0!==N.naturalWidth?H():N.addEventListener("load",H));console.warn("Cannot inline img src="+q+"! Error: "+t)}"anonymous"===N.crossOrigin&&(j?k.crossOrigin=B("crossOrigin",j):N.removeAttribute("crossorigin"))};N.complete&&0!==N.naturalWidth?H():N.addEventListener("load",H)}if("audio"===_||"video"===_){var z=k;z.rr_mediaState=t.paused?"paused":"played",w.add("rr_mediaState"),z.rr_mediaCurrentTime=t.currentTime,z.rr_mediaPlaybackRate=t.playbackRate,z.rr_mediaMuted=t.muted,z.rr_mediaLoop=t.loop,z.rr_mediaVolume=t.volume}if(m||(t.scrollLeft&&(k.rr_scrollLeft=t.scrollLeft),t.scrollTop&&(k.rr_scrollTop=t.scrollTop)),b){var U,W,V,G=t.getBoundingClientRect(),Z=G.width,J=G.height,Q=G.left,K=G.top,X=null===(U=i.defaultView)||void 0===U?void 0:U.getComputedStyle(t);k={class:k.class,rr_width:Z+"px",rr_height:J+"px",rr_left:Math.floor(Q+((null===(W=i.defaultView)||void 0===W?void 0:W.scrollX)||0))+"px",rr_top:Math.floor(K+((null===(V=i.defaultView)||void 0===V?void 0:V.scrollY)||0))+"px"},w.add("rr_width"),w.add("rr_height"),w.add("rr_left"),w.add("rr_top"),X&&(k.rr_position=X.position||"static",w.add("rr_position"),X.transform&&"none"!==X.transform&&(k.rr_transform=X.transform,w.add("rr_transform")),X.display&&X.display.startsWith("inline")&&(k.rr_display=X.display,w.add("rr_display")))}if("iframe"!==_||p(k.src)||(t.contentDocument||(k.rr_src=k.src),delete k.src),l||u)for(var Y of Object.entries(k)){var tt=Y[0],et=Y[1];"string"!=typeof et&&null!==et||(k[tt]=Ku({element:t,name:tt,value:et,maskAllElementAttributes:l,maskAttributeFn:u,isGenerated:w.has(tt)}))}L=!0;try{customElements.get(_)&&(O=!0)}catch(t){}return{type:Gl.Element,tagName:_,attributes:k,childNodes:[],isSVG:(D=t,Boolean("svg"===D.tagName||D.ownerSVGElement)||void 0),needBlock:b,rootId:y,isCustom:O}}(t,{doc:i,blockClass:r,blockSelector:n,inlineStylesheet:o,maskInputOptions:l,maskInputFn:h,maskAllElementAttributes:v,maskAttributeFn:c,dataURLOptions:p,inlineImages:g,recordCanvas:m,canvasMaskingConfigured:y,keepIframeSrcFn:b,newlyAddedElement:w,rootId:k});case t.TEXT_NODE:return function(t,e){var i=e.needsMask,r=e.maskTextFn,n=e.rootId,s=su.parentNode(t),o=s&&s.tagName,a=su.textContent(t),l="STYLE"===o||void 0,u="SCRIPT"===o||void 0;if(l&&a){try{var h;if(t.nextSibling||t.previousSibling);else if(Iu(s.sheet));else if(null===(h=s.sheet)||void 0===h?void 0:h.cssRules){var d=qu(s.sheet);d&&!/(?:^|[\s;{}])-?[a-zA-Z][\w-]*\s*:\s*;/.test(d)&&(a=d)}}catch(e){console.warn("Cannot get CSS styles from text's parentNode. Error: "+e,t)}a=nh(a,ph(e.doc))}return u&&(a="SCRIPT_PLACEHOLDER"),!l&&!u&&a&&i&&(a=r?r(a,su.parentElement(t)):a.replace(/[\S]/g,"*")),{type:Gl.Text,textContent:a||"",isStyle:l,rootId:n}}(t,{doc:i,needsMask:s,maskTextFn:u,rootId:k});case t.CDATA_SECTION_NODE:return{type:Gl.CDATA,textContent:"",rootId:k};case t.COMMENT_NODE:return{type:Gl.Comment,textContent:su.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:L,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===Gl.Comment)return!0;if(t.type===Gl.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){var e,i;try{i=new URL(t,window.location.href)}catch(t){return null}var r=i.pathname.match(/\.([0-9a-z]+)(?:$)/i);return null!==(e=null==r?void 0:r[1])&&void 0!==e?e:null}(t.attributes.href)))return!0;if(e.headFavicon&&("link"===t.tagName&&"shortcut icon"===t.attributes.rel||"meta"===t.tagName&&(xh(t.attributes.name).match(/^msapplication-tile(image|color)$/)||"application-name"===xh(t.attributes.name)||["icon","apple-touch-icon","shortcut icon"].includes(xh(t.attributes.rel)))))return!0;if("meta"===t.tagName){if(e.headMetaDescKeywords&&xh(t.attributes.name).match(/^description|keywords$/))return!0;if(e.headMetaSocial&&(xh(t.attributes.property).match(/^(og|twitter|fb):/)||xh(t.attributes.name).match(/^(og|twitter):/)||"pinterest"===xh(t.attributes.name)))return!0;if(e.headMetaRobots&&["robots","googlebot","bingbot"].includes(xh(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(xh(t.attributes.name))||xh(t.attributes.property).match(/^article:/)||xh(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(xh(t.attributes.name)))return!0}}return!1}(Z,b)||!V&&Z.type===Gl.Text&&!Z.isStyle&&!Z.textContent.replace(/^\s+|\s+$/gm,"").length?-2:hh();var J=Object.assign(Z,{id:G});if(r.add(t,J),-2===G)return null;M&&M(t);var Q=!u;if(J.type===Gl.Element){Q=Q&&!J.needBlock,delete J.needBlock;var K=su.shadowRoot(t);K&&$u(K)&&(J.isShadowHost=!0)}if((J.type===Gl.Document||J.type===Gl.Element)&&Q){b.headWhitespace&&J.type===Gl.Element&&"head"===J.tagName&&(V=!1);var X={doc:i,mirror:r,blockClass:n,blockSelector:s,needsMask:U,maskTextClass:o,maskTextSelector:a,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:I,iframeLoadTimeout:R,onIframeListenerRegistered:A,onStylesheetLoad:P,stylesheetLoadTimeout:O,keepIframeSrcFn:L,depth:B+1,maxDepth:z};if(J.type===Gl.Element&&"textarea"===J.tagName&&void 0!==J.attributes.value);else for(var Y of Array.from(su.childNodes(t))){var tt=Mh(Y,X);tt&&J.childNodes.push(tt)}var et=null;if(Fu(t)&&(et=su.shadowRoot(t)))for(var it of Array.from(su.childNodes(et))){var rt=Mh(it,X);rt&&($u(et)&&(rt.isShadow=!0),J.childNodes.push(rt))}}var nt=su.parentNode(t);if(nt&&Ou(nt)&&$u(nt)&&(J.isShadow=!0),J.type===Gl.Element&&"iframe"===J.tagName){var st=function(t,e,i){var r,n=()=>{},s=t.contentWindow;if(!s)return n;try{r=s.document.readyState}catch(t){return n}var o=()=>e();if("complete"!==r){var a=!1,l=null,u=()=>{a||(a=!0,null!==l&&(clearTimeout(l),l=null),wh(t,"load",h),t.addEventListener("load",o),e())},h=()=>u();return l=setTimeout(u,i),t.addEventListener("load",h),()=>{null!==l&&(clearTimeout(l),l=null),a?wh(t,"load",o):(a=!0,wh(t,"load",h))}}var d,v="about:blank";try{d=s.location.href}catch(t){return n}if(d!==v||t.src===v||""===t.src){var c=setTimeout(e,0);return t.addEventListener("load",o),()=>{clearTimeout(c),wh(t,"load",o)}}return t.addEventListener("load",o),()=>{wh(t,"load",o)}}(t,()=>{var e=t.contentDocument;if(e&&I){var i=Mh(e,{doc:e,mirror:r,blockClass:n,blockSelector:s,needsMask:U,maskTextClass:o,maskTextSelector:a,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:I,iframeLoadTimeout:R,onIframeListenerRegistered:A,onStylesheetLoad:P,stylesheetLoadTimeout:O,keepIframeSrcFn:L,depth:B+1,maxDepth:z});i&&I(t,i)}},R);null==A||A(t,st)}return J.type===Gl.Element&&"link"===J.tagName&&"stylesheet"===J.attributes.rel&&function(e,l,u){if(!kh.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(P){var e=Mh(t,{doc:i,mirror:r,blockClass:n,blockSelector:s,needsMask:U,maskTextClass:o,maskTextSelector:a,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:I,iframeLoadTimeout:R,onStylesheetLoad:P,stylesheetLoadTimeout:O,keepIframeSrcFn:L,depth:B,maxDepth:z});e&&P(t,e)}})()}finally{kh.delete(e),v.abort()}}},k=setTimeout(_,u);v.signal.addEventListener("abort",()=>clearTimeout(k),{once:!0}),e.addEventListener("load",_,{signal:v.signal,once:!0}),kh.set(e,v)}}}(t,0,O),J}function Ih(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}var Eh=class t{constructor(){Pu(this,"parentElement",null),Pu(this,"parentNode",null),Pu(this,"ownerDocument",void 0),Pu(this,"firstChild",null),Pu(this,"lastChild",null),Pu(this,"previousSibling",null),Pu(this,"nextSibling",null),Pu(this,"ELEMENT_NODE",1),Pu(this,"TEXT_NODE",3),Pu(this,"nodeType",void 0),Pu(this,"nodeName",void 0),Pu(this,"RRNodeType",void 0)}get childNodes(){for(var t=[],e=this.firstChild;e;)t.push(e),e=e.nextSibling;return t}contains(e){if(!(e instanceof t))return!1;if(e.ownerDocument!==this.ownerDocument)return!1;if(e===this)return!0;for(;e.parentNode;){if(e.parentNode===this)return!0;e=e.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 Rh(t,e,i){void 0===i&&(i=document);var r={capture:!0,passive:!0};return i.addEventListener(t,e,r),()=>Ah(i,t,e,r)}function Ah(t,e,i,r){Ph(()=>{var n=t.removeEventListener;"function"==typeof n&&(void 0!==r?n.call(t,e,i,r):n.call(t,e,i))})}function Ph(t){try{t()}catch(t){if(!(t instanceof DOMException&&"SecurityError"===t.name))throw t}}var Fh="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.",Oh={map:{},getId(){return console.error(Fh),-1},getNode(){return console.error(Fh),null},removeNodeFromMap(){console.error(Fh)},has(){return console.error(Fh),!1},reset(){console.error(Fh)}};function $h(t,e,i){void 0===i&&(i={});var r=null,n=0;return function(){for(var s=arguments.length,o=new Array(s),a=0;s>a;a++)o[a]=arguments[a];var l=Date.now();n||!1!==i.leading||(n=l);var u=e-(l-n),h=this;0>=u||u>e?(r&&(clearTimeout(r),r=null),n=l,t.apply(h,o)):r||!1===i.trailing||(r=setTimeout(()=>{n=!1===i.leading?0:Date.now(),r=null,t.apply(h,o)},u))}}function Dh(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)}}}),()=>Dh(t,e,s||{},!0)}"undefined"!=typeof window&&window.Proxy&&window.Reflect&&(Oh=new Proxy(Oh,{get(t,e,i){return"map"===e&&console.error(Fh),Reflect.get(t,e,i)}}));var Lh=Date.now;function Nh(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=su.parentElement(s.body))||void 0===e?void 0:e.scrollLeft)||(null==s||null===(i=s.body)||void 0===i?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=su.parentElement(s.body))||void 0===r?void 0:r.scrollTop)||(null==s||null===(n=s.body)||void 0===n?void 0:n.scrollTop)||0}}function qh(){return window.innerHeight||document.documentElement&&document.documentElement.clientHeight||document.body&&document.body.clientHeight}function jh(){return window.innerWidth||document.documentElement&&document.documentElement.clientWidth||document.body&&document.body.clientWidth}function Bh(t){return t?t.nodeType===t.ELEMENT_NODE?t:su.parentElement(t):null}function Hh(t,e,i,r){if(!t)return!1;var n=Bh(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(bh(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 zh(t,e,i){return!("TITLE"!==t.tagName||!i.headTitleMutations)||-2===e.getId(t)}function Uh(t,e){if(Ou(t))return!1;var i=e.getId(t);if(!e.has(i))return!0;var r=su.parentNode(t);return(!r||r.nodeType!==t.DOCUMENT_NODE)&&(!r||Uh(r,e))}function Wh(t){return Boolean(t.changedTouches)}function Vh(t,e){return Boolean("IFRAME"===t.nodeName&&e.getMeta(t))}function Gh(t,e){return Boolean("LINK"===t.nodeName&&t.nodeType===t.ELEMENT_NODE&&t.getAttribute&&"stylesheet"===t.getAttribute("rel")&&e.getMeta(t))}function Zh(t){return!!t&&(t instanceof Eh&&"shadowRoot"in t?Boolean(t.shadowRoot):Boolean(su.shadowRoot(t)))}/[1-9][0-9]{12}/.test(Date.now().toString())||(Lh=()=>(new Date).getTime());var Jh=class{constructor(){Pu(this,"id",1),Pu(this,"styleIDMap",new WeakMap),Pu(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 Qh(t){var e,i=null;return"getRootNode"in t&&(null===(e=su.getRootNode(t))||void 0===e?void 0:e.nodeType)===Node.DOCUMENT_FRAGMENT_NODE&&su.host(su.getRootNode(t))&&(i=su.host(su.getRootNode(t))),i}function Kh(t){var e=t.ownerDocument;return!!e&&(su.contains(e,t)||function(t){var e=t.ownerDocument;if(!e)return!1;var i=function(t){for(var e,i=t;e=Qh(i);)i=e;return i}(t);return su.contains(e,i)}(t))}function Xh(t){return"__ln"in t}var Yh,td=class{constructor(){Pu(this,"length",0),Pu(this,"head",null),Pu(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&&Xh(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&&Xh(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--)}},ed=(t,e)=>t+"@"+e,id=class{constructor(){Pu(this,"frozen",!1),Pu(this,"locked",!1),Pu(this,"texts",[]),Pu(this,"attributes",[]),Pu(this,"attributeMap",new WeakMap),Pu(this,"generatedAttributes",new WeakMap),Pu(this,"removes",[]),Pu(this,"mapRemoves",[]),Pu(this,"movedMap",{}),Pu(this,"addedSet",new Set),Pu(this,"movedSet",new Set),Pu(this,"droppedSet",new Set),Pu(this,"removesSubTreeCache",new Set),Pu(this,"mutationCb",void 0),Pu(this,"blockClass",void 0),Pu(this,"blockSelector",void 0),Pu(this,"maskTextClass",void 0),Pu(this,"maskTextSelector",void 0),Pu(this,"inlineStylesheet",void 0),Pu(this,"maskInputOptions",void 0),Pu(this,"maskTextFn",void 0),Pu(this,"maskInputFn",void 0),Pu(this,"maskAllElementAttributes",void 0),Pu(this,"maskAttributeFn",void 0),Pu(this,"keepIframeSrcFn",void 0),Pu(this,"recordCanvas",void 0),Pu(this,"canvasMaskingConfigured",void 0),Pu(this,"inlineImages",void 0),Pu(this,"slimDOMOptions",void 0),Pu(this,"dataURLOptions",void 0),Pu(this,"doc",void 0),Pu(this,"mirror",void 0),Pu(this,"iframeManager",void 0),Pu(this,"stylesheetManager",void 0),Pu(this,"shadowDomManager",void 0),Pu(this,"canvasManager",void 0),Pu(this,"processedNodeManager",void 0),Pu(this,"unattachedDoc",void 0),Pu(this,"canvasManagerReleased",!1),Pu(this,"processMutations",t=>{t.forEach(this.processMutation),this.emit()}),Pu(this,"emit",()=>{if(!this.frozen&&!this.locked){var t,e,i=ou(),r=uu();try{this.processBufferedMutations()}finally{t=ou()-i,e=r,du>0||hu(t,null!=e?e:au)||t>_u.slowestBatchMs&&(_u.slowestBatchMs=t)}}}),Pu(this,"processBufferedMutations",()=>{for(var t=[],e=new Set,i=new td,r=t=>{for(var e=t,i=-2;-2===i;)i=(e=e&&e.nextSibling)&&this.mirror.getId(e);return i},n=n=>{var s=su.parentNode(n);if(s&&Kh(n)&&"TEXTAREA"!==s.tagName&&!this.isBlockedAtEmission(s)){var o=Ou(s)?this.mirror.getId(Qh(n)):this.mirror.getId(s),a=r(n);if(-1===o||-1===a)return i.addNode(n);var l=Mh(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=>{Vh(t,this.mirror)&&this.iframeManager.addIframe(t),Gh(t,this.mirror)&&this.stylesheetManager.trackLinkElement(t),Zh(t)&&!Hh(t,this.blockClass,this.blockSelector,!0)&&this.shadowDomManager.addShadowRoot(su.shadowRoot(t),this.doc)},onIframeLoad:(t,e)=>{this.iframeManager.attachIframe(t,e),this.shadowDomManager.observeAttachShadow(t)},onIframeListenerRegistered:(t,e)=>{this.iframeManager.registerLoadListenerDisposer(t,e)},onStylesheetLoad:(t,e)=>{this.stylesheetManager.attachLinkElement(t,e)}});l&&(t.push({parentId:o,nextId:a,node:l}),e.add(l.id))}};this.mapRemoves.length;)this.mirror.removeNodeFromMap(this.mapRemoves.shift());for(var s of this.movedSet)nd(this.removesSubTreeCache,s)&&!this.movedSet.has(su.parentNode(s))||n(s);for(var o of this.addedSet)sd(this.droppedSet,o)||nd(this.removesSubTreeCache,o)?sd(this.movedSet,o)?n(o):this.droppedSet.add(o):n(o);for(var a=null;i.length;){var l=null;if(a){var u=this.mirror.getId(su.parentNode(a.value)),h=r(a.value);-1!==u&&-1!==h&&(l=a)}if(!l)for(var d=i.tail;d;){var v=d;if(d=d.previous,v){var c=this.mirror.getId(su.parentNode(v.value));if(-1===r(v.value))continue;if(-1!==c){l=v;break}var f=su.parentNode(v.value);if(f&&f.nodeType===Node.DOCUMENT_FRAGMENT_NODE){var p=su.host(f);if(-1!==this.mirror.getId(p)){l=v;break}}}}if(!l){for(;i.head;)i.removeNode(i.head.value);break}a=l.previous,i.removeNode(l.value),n(l.value)}var g={texts:this.texts.filter(t=>!this.isBlockedAtEmission(t.node)).map(t=>{var e=t.node,i=su.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.filter(t=>!this.isBlockedAtEmission(t.node)).map(t=>{var e=t.attributes;if(!this.maskAllElementAttributes&&!this.maskAttributeFn&&"string"==typeof e.style){var i=JSON.stringify(t.styleDiff),r=JSON.stringify(t._unchangedStyles);e.style.length>i.length&&(i+r).split("var(").length===e.style.split("var(").length&&(e.style=t.styleDiff)}if(this.maskAllElementAttributes||this.maskAttributeFn)for(var n of Object.entries(e)){var s,o=n[0],a=n[1];"string"!=typeof a&&null!==a||(e[o]=Ku({element:t.node,name:o,value:a,maskAllElementAttributes:this.maskAllElementAttributes,maskAttributeFn:this.maskAttributeFn,isGenerated:null===(s=this.generatedAttributes.get(t.node))||void 0===s?void 0:s.has(o)}))}return{id:this.mirror.getId(t.node),attributes:e}}).filter(t=>!e.has(t.id)).filter(t=>this.mirror.has(t.id)),removes:this.removes,adds:t};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={},(g.texts.length||g.attributes.length||g.removes.length||g.adds.length)&&this.mutationCb(g)}),Pu(this,"bufferBelongsToIframe",t=>this.doc===t.contentDocument),Pu(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(su.childNodes(t),t=>su.textContent(t)||"").join("");e.attributes.value=Zu({element:t,maskInputOptions:this.maskInputOptions,tagName:t.tagName,type:Yu(t),value:i,maskInputFn:this.maskInputFn})}),Pu(this,"processMutation",t=>{if(!zh(t.target,this.mirror,this.slimDOMOptions))switch(t.type){case"characterData":var e=su.textContent(t.target);Hh(t.target,this.blockClass,this.blockSelector,!1)||e===t.oldValue||this.texts.push({value:_h(t.target,this.maskTextClass,this.maskTextSelector,!0)&&e?this.maskTextFn?this.maskTextFn(e,Bh(t.target)):e.replace(/[\S]/g,"*"):e,node:t.target});break;case"attributes":var i,r=t.target,n=t.attributeName,s=null!==(i=t.attributeNamespace)&&void 0!==i?i: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}(r,n,s),a=s?r.getAttributeNS(s,n):t.target.getAttribute(n);if("value"===o){var l=r,u=Yu(l);a=Zu({element:l,maskInputOptions:this.maskInputOptions,tagName:r.tagName,type:u,value:a,maskInputFn:this.maskInputFn})}if(Hh(t.target,this.blockClass,this.blockSelector,!1)||a===t.oldValue)return;var h=this.attributeMap.get(t.target),d="IFRAME"===r.tagName&&"src"===o;if(d&&!this.keepIframeSrcFn(a)&&r.contentDocument)return;if(h||(this.attributes.push(h={node:t.target,attributes:{},styleDiff:{},_unchangedStyles:{}}),this.attributeMap.set(t.target,h)),"type"===o&&"INPUT"===r.tagName&&"password"===(t.oldValue||"").toLowerCase()&&r.setAttribute("data-rr-is-password","true"),!yh(r.tagName,o)){var v,c=mh(this.doc,Ju(r.tagName),Ju(o),a,r,this.dataURLOptions);if(d&&!this.keepIframeSrcFn(a)&&(o="rr_src"),h.attributes[o]=c,null===(v=this.generatedAttributes.get(t.target))||void 0===v||v.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=r.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)?h.styleDiff[g]=""===y?m:[m,y]:h._unchangedStyles[g]=[m,y]}for(var b of Array.from(f.style))""===p.getPropertyValue(b)&&(h.styleDiff[b]=!1)}else if("open"===o&&"DIALOG"===r.tagName){h.attributes.rr_open_mode=r.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(Hh(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=Ou(t.target)?this.mirror.getId(su.host(t.target)):this.mirror.getId(t.target);Hh(t.target,this.blockClass,this.blockSelector,!1)||zh(e,this.mirror,this.slimDOMOptions)||!function(t,e){return-1!==e.getId(t)}(e,this.mirror)||(this.addedSet.has(e)?(rd(this.addedSet,e),this.droppedSet.add(e)):this.addedSet.has(t.target)&&-1===i||Uh(t.target,this.mirror)||(this.movedSet.has(e)&&this.movedMap[ed(i,r)]?rd(this.movedSet,e):(this.removes.push({parentId:r,id:i,isShadow:!(!Ou(t.target)||!$u(t.target))||void 0}),function(t,e){for(var i=[t];i.length;){var r=i.pop();e.has(r)||(e.add(r),su.childNodes(r).forEach(t=>i.push(t)))}}(e,this.removesSubTreeCache))),this.mapRemoves.push(e))})}}),Pu(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(zh(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[ed(this.mirror.getId(t),i)]=!0)}else this.addedSet.add(t),this.droppedSet.delete(t);Hh(t,this.blockClass,this.blockSelector,!1)||(su.childNodes(t).forEach(t=>this.genAdds(t)),Zh(t)&&su.childNodes(su.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())}isBlockedAtEmission(t){for(var e=this.blockClass,i=e&&"string"!=typeof e&&(e.global||e.sticky)?new RegExp(e):null;t;){if(i&&(i.lastIndex=0),Hh(t,i||e,this.blockSelector,!0))return!0;var r="getRootNode"in t?su.getRootNode(t):null;t=(null==r?void 0:r.nodeType)===Node.DOCUMENT_FRAGMENT_NODE?su.host(r):null}return!1}};function rd(t,e){for(var i=[e];i.length;){var r=i.pop();t.delete(r),su.childNodes(r).forEach(t=>i.push(t))}}function nd(t,e,i){return 0!==t.size&&function(t,e){var i=su.parentNode(e);return!!i&&t.has(i)}(t,e)}function sd(t,e){if(0===t.size)return!1;for(var i=su.parentNode(e);i;){if(t.has(i))return!0;i=su.parentNode(i)}return!1}var od=function(t,e){return void 0===e&&(e="rrweb"),Yh?function(){try{return t(...arguments)}catch(t){if(Yh&&!0===Yh(t,e))return;throw t}}:t},ad=[];function ld(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 ud(t,e){var i,r=new id;r.init(t);try{i=new(ru())(od(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),ad.push(r),{observer:i,buffer:r}}catch(t){try{null==i||i.disconnect(),r.destroy(),r.reset()}catch(t){}throw t}}function hd(t){var e=t.scrollCb,i=t.doc,r=t.mirror,n=t.blockClass,s=t.blockSelector,o=t.sampling,a=new Map,l=t=>{var o=ld(t);if(o&&!Hh(o,n,s,!0)){var l,u,h=r.getId(o);if(o===i&&i.defaultView){var d=Nh(i.defaultView);l=d.left,u=d.top}else l=o.scrollLeft,u=o.scrollTop;var v=l+","+u;a.get(h)!==v&&(a.set(h,v),e({id:h,x:l,y:u}))}},u=[Rh("scroll",od($h(od(t=>l(t)),o.scroll||100)),i)];return"onscrollend"in i&&u.push(Rh("scrollend",od(l),i)),()=>u.forEach(t=>t())}function dd(t,e){for(var i=ad.length-1;i>=0;i--){var r=ad[i];if(r){var n=r.bufferBelongsToIframe(t);!n&&e&&e.has(r.bufferDoc())&&(n=!0),n&&(r.reset(),ad.splice(i,1))}}}var vd=["INPUT","TEXTAREA","SELECT"],cd=new WeakMap;function fd(t){return function t(e,i){if(yd("CSSGroupingRule")&&e.parentRule instanceof CSSGroupingRule||yd("CSSMediaRule")&&e.parentRule instanceof CSSMediaRule||yd("CSSSupportsRule")&&e.parentRule instanceof CSSSupportsRule||yd("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 pd(t,e,i){var r,n;return t?(t.ownerNode?r=e.getId(t.ownerNode):n=i.getId(t),{styleId:n,id:r}):{}}function gd(t,e){var i,r,n,s=t.stylesheetManager;n=t.mirror.getId("#document"===e.nodeName?e:su.host(e));var o="#document"===e.nodeName?null===(i=e.defaultView)||void 0===i?void 0:i.Document:null===(r=e.ownerDocument)||void 0===r||null===(r=r.defaultView)||void 0===r?void 0:r.ShadowRoot,a=(null==o?void 0:o.prototype)?Object.getOwnPropertyDescriptor(null==o?void 0:o.prototype,"adoptedStyleSheets"):void 0;return null!==n&&-1!==n&&o&&a?(Object.defineProperty(e,"adoptedStyleSheets",{configurable:a.configurable,enumerable:a.enumerable,get(){var t;return null===(t=a.get)||void 0===t?void 0:t.call(this)},set(t){var e;try{var i;e=null===(i=a.set)||void 0===i?void 0:i.call(this,t)}catch(t){if(t&&"object"==typeof t&&"NotAllowedError"===t.name)return;throw t}if(null!==n&&-1!==n)try{s.adoptStyleSheets(t,n)}catch(t){}return e}}),od(()=>{Object.defineProperty(e,"adoptedStyleSheets",{configurable:a.configurable,enumerable:a.enumerable,get:a.get,set:a.set})})):()=>{}}function md(t,e){void 0===e&&(e={});var i,r,s=t.doc.defaultView;if(!s)return()=>{};!function(t,e){var i=t.mutationCb,r=t.mousemoveCb,n=t.mouseInteractionCb,s=t.scrollCb,o=t.viewportResizeCb,a=t.inputCb,l=t.mediaInteractionCb,u=t.styleSheetRuleCb,h=t.styleDeclarationCb,d=t.canvasMutationCb,v=t.fontCb,c=t.selectionCb,f=t.customElementCb;t.mutationCb=function(){e.mutation&&e.mutation(...arguments),i(...arguments)},t.mousemoveCb=function(){e.mousemove&&e.mousemove(...arguments),r(...arguments)},t.mouseInteractionCb=function(){e.mouseInteraction&&e.mouseInteraction(...arguments),n(...arguments)},t.scrollCb=function(){e.scroll&&e.scroll(...arguments),s(...arguments)},t.viewportResizeCb=function(){e.viewportResize&&e.viewportResize(...arguments),o(...arguments)},t.inputCb=function(){e.input&&e.input(...arguments),a(...arguments)},t.mediaInteractionCb=function(){e.mediaInteaction&&e.mediaInteaction(...arguments),l(...arguments)},t.styleSheetRuleCb=function(){e.styleSheetRule&&e.styleSheetRule(...arguments),u(...arguments)},t.styleDeclarationCb=function(){e.styleDeclaration&&e.styleDeclaration(...arguments),h(...arguments)},t.canvasMutationCb=function(){e.canvasMutation&&e.canvasMutation(...arguments),d(...arguments)},t.fontCb=function(){e.font&&e.font(...arguments),v(...arguments)},t.selectionCb=function(){e.selection&&e.selection(...arguments),c(...arguments)},t.customElementCb=function(){e.customElement&&e.customElement(...arguments),f(...arguments)}}(t,e);var o=[],a=od(()=>{if(r){r.destroy(),r.reset();var e=ad.indexOf(r);-1!==e&&ad.splice(e,1)}t.shadowDomManager.resetForDoc(t.doc),null==i||i.disconnect(),o.forEach(t=>t())});try{if(t.recordDOM){var l=ud(t,t.doc);i=l.observer,r=l.buffer}if(o.push(function(t){var e=t.mousemoveCb,i=t.sampling,r=t.doc,n=t.mirror;if(!1===i.mousemove)return()=>{};var s,o="number"==typeof i.mousemove?i.mousemove:50,a="number"==typeof i.mousemoveCallback?i.mousemoveCallback:500,l=[],u=$h(od(t=>{var i=Date.now()-s;e(l.map(t=>(t.timeOffset-=i,t)),t),l=[],s=null}),a),h=od($h(od(t=>{var e=ld(t),i=Wh(t)?t.changedTouches[0]:t,r=i.clientX,o=i.clientY;s||(s=Lh()),l.push({x:r,y:o,id:n.getId(e),timeOffset:Lh()-s}),u("undefined"!=typeof DragEvent&&t instanceof DragEvent?Hl.Drag:t instanceof MouseEvent?Hl.MouseMove:Hl.TouchMove)}),o,{trailing:!1})),d=[Rh("mousemove",h,r),Rh("touchmove",h,r),Rh("drag",h,r)];return od(()=>{d.forEach(t=>t())})}(t)),o.push(function(t){var e=t.mouseInteractionCb,i=t.doc,r=t.mirror,s=t.blockClass,o=t.blockSelector,a=t.sampling;if(!1===a.mouseInteraction)return()=>{};var l=!0===a.mouseInteraction||void 0===a.mouseInteraction?{}:a.mouseInteraction,u=[],h=null;return Object.keys(zl).filter(t=>Number.isNaN(Number(t))&&!t.endsWith("_Departed")&&!1!==l[t]).forEach(t=>{var a=Ju(t),l=(t=>i=>{var a=ld(i);if(!Hh(a,s,o,!0)){var l=null,u=t;if("pointerType"in i){switch(i.pointerType){case"mouse":l=Ul.Mouse;break;case"touch":l=Ul.Touch;break;case"pen":l=Ul.Pen}l===Ul.Touch&&(zl[t]===zl.MouseDown?u="TouchStart":zl[t]===zl.MouseUp&&(u="TouchEnd"))}else Wh(i)&&(l=Ul.Touch);null!==l?(h=l,(u.startsWith("Touch")&&l===Ul.Touch||u.startsWith("Mouse")&&l===Ul.Mouse)&&(l=null)):zl[t]===zl.Click&&(l=h,h=null);var d=Wh(i)?i.changedTouches[0]:i;if(d){var v=r.getId(a),c=d.clientX,f=d.clientY;od(e)(n({type:zl[u],id:v,x:c,y:f},null!==l&&{pointerType:l}))}}})(t);if(window.PointerEvent)switch(zl[t]){case zl.MouseDown:case zl.MouseUp:a=a.replace("mouse","pointer");break;case zl.TouchStart:case zl.TouchEnd:return}u.push(Rh(a,l,i))}),od(()=>{u.forEach(t=>t())})}(t)),o.push(hd(t)),o.push(function(t,e){var i=t.viewportResizeCb,r=e.win,n=-1,s=-1;return Rh("resize",od($h(od(()=>{var t=qh(),e=jh();n===t&&s===e||(i({width:Number(e),height:Number(t)}),n=t,s=e)}),200)),r)}(t,{win:s})),o.push(function(t){var e=t.inputCb,i=t.doc,r=t.mirror,s=t.blockClass,o=t.blockSelector,a=t.ignoreClass,l=t.ignoreSelector,u=t.maskInputOptions,h=t.maskInputFn,d=t.userTriggeredOnInput;function v(t){var e=ld(t),r=t.isTrusted,n=i.defaultView;if(!e||!n||e instanceof n.HTMLElement){var v=e&&e.tagName;if(e&&"OPTION"===v&&(e=su.parentElement(e)),e&&v&&vd.indexOf(v)>=0&&!Hh(e,s,o,!0)&&!(e.classList.contains(a)||l&&e.matches(l))){var f=e.value,p=!1,g=Yu(e)||"";"radio"===g||"checkbox"===g?p=e.checked:(u[v.toLowerCase()]||u[g])&&(f=Zu({element:e,maskInputOptions:u,tagName:v,type:g,value:f,maskInputFn:h})),c(e,d?{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;c(t,d?{text:i,isChecked:!p,userTriggered:!1}:{text:i,isChecked:!p})}})}}}function c(t,i){var s=cd.get(t);if(!s||s.text!==i.text||s.isChecked!==i.isChecked){cd.set(t,i);var o=r.getId(t);od(e)(n({},i,{id:o}))}}var f=("last"===t.sampling.input?["change"]:["input","change"]).map(t=>Rh(t,od(v),i)),p=i.defaultView;if(!p)return()=>{f.forEach(t=>t())};var g=p.Object.getOwnPropertyDescriptor(p.HTMLInputElement.prototype,"value");return g&&g.set&&f.push(...[[p.HTMLInputElement.prototype,"value"],[p.HTMLInputElement.prototype,"checked"],[p.HTMLSelectElement.prototype,"value"],[p.HTMLTextAreaElement.prototype,"value"],[p.HTMLSelectElement.prototype,"selectedIndex"],[p.HTMLOptionElement.prototype,"selected"]].map(t=>Dh(t[0],t[1],{set(){od(v)({target:this,isTrusted:!1})}},!1,p))),od(()=>{f.forEach(t=>t())})}(t)),o.push(function(t){var e=t.mediaInteractionCb,i=t.blockClass,r=t.blockSelector,n=t.mirror,s=t.sampling,o=t.doc,a=od(t=>$h(od(s=>{var o=ld(s);if(o&&!Hh(o,i,r,!0)){var a=o.currentTime,l=o.volume,u=o.muted,h=o.playbackRate,d=o.loop;e({type:t,id:n.getId(o),currentTime:a,volume:l,muted:u,playbackRate:h,loop:d})}}),s.media||500)),l=[Rh("play",a(Vl.Play),o),Rh("pause",a(Vl.Pause),o),Rh("seeked",a(Vl.Seeked),o),Rh("volumechange",a(Vl.VolumeChange),o),Rh("ratechange",a(Vl.RateChange),o)];return od(()=>{l.forEach(t=>t())})}(t)),t.recordDOM){var u=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?void 0:i.ready;){var s=r.shift();(null==s?void 0:s.emit)&&n(s.emit)}0===r.length&&e.delete(t)}};return{queueMutation(t,i){if(t){var r=e.get(t);r?(r.push({emit:i,ready:!0}),s(t)):n(i)}else n(i)},queuePendingMutation(o,a,l){if(!r)return()=>{};var u=e.get(o);u||e.set(o,u=[]);var h={emit:a,ready:!1};u.push(h);var d,v=!1,c=!1,f=()=>{v||c||(v=!0,void 0!==d&&i.delete(d),h.ready=!0,h.emit=void 0,s(o))};try{d=t.setTimeout(f,5e3),v||c?t.clearTimeout(d):i.add(d)}catch(t){f()}return e=>{!c&&r&&(c=!0,void 0!==d&&(t.clearTimeout(d),i.delete(d)),v?e&&n(l):(h.ready=!0,e||(h.emit=void 0),s(o)))}},reset(){r=!1,i.forEach(e=>t.clearTimeout(e)),i.clear(),e.clear()}}}(s);o.push(u.reset),o.push(function(t,e){var i=t.styleSheetRuleCb,r=t.mirror,n=t.stylesheetManager,s=e.win,o=e.mutationQueue;if(!s.CSSStyleSheet||!s.CSSStyleSheet.prototype)return()=>{};var a=s.CSSStyleSheet.prototype.insertRule;s.CSSStyleSheet.prototype.insertRule=new Proxy(a,{apply:od((t,e,s)=>{var a=s[0],l=t.apply(e,s);n.onCssomSheetMutation(e);var u=pd(e,r,n.styleMirror),h=u.id,d=u.styleId;return(h&&-1!==h||d&&-1!==d)&&o.queueMutation(e,()=>i({id:h,styleId:d,adds:[{rule:a,index:l}]})),l},"host")}),s.CSSStyleSheet.prototype.addRule=function(t,e,i){return void 0===i&&(i=this.cssRules.length),s.CSSStyleSheet.prototype.insertRule.apply(this,[t+" { "+e+" }",i])};var l,u,h=s.CSSStyleSheet.prototype.deleteRule;s.CSSStyleSheet.prototype.deleteRule=new Proxy(h,{apply:od((t,e,s)=>{var a=s[0],l=t.apply(e,s);n.onCssomSheetMutation(e);var u=pd(e,r,n.styleMirror),h=u.id,d=u.styleId;return(h&&-1!==h||d&&-1!==d)&&o.queueMutation(e,()=>i({id:h,styleId:d,removes:[{index:a}]})),l},"host")}),s.CSSStyleSheet.prototype.removeRule=function(t){return s.CSSStyleSheet.prototype.deleteRule.apply(this,[t])},s.CSSStyleSheet.prototype.replace&&(l=s.CSSStyleSheet.prototype.replace,s.CSSStyleSheet.prototype.replace=new Proxy(l,{apply:od((t,e,s)=>{var a=s[0],l=t.apply(e,s);try{var u=null==l?void 0:l.then;if(e.ownerNode||!l||"function"!=typeof u)return l;n.onCssomSheetMutation(e);var h=pd(e,r,n.styleMirror),d=h.id,v=h.styleId;if(!(d&&-1!==d||v&&-1!==v))return l;var c=o.queuePendingMutation(e,()=>i({id:d,styleId:v,replace:a}),()=>{var t=qu(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:od((t,e,s)=>{var a=s[0],l=t.apply(e,s);n.onCssomSheetMutation(e);var u=pd(e,r,n.styleMirror),h=u.id,d=u.styleId;return(h&&-1!==h||d&&-1!==d)&&o.queueMutation(e,()=>i({id:h,styleId:d,replaceSync:a})),l},"host")}));var d={};bd("CSSGroupingRule")?d.CSSGroupingRule=s.CSSGroupingRule:(bd("CSSMediaRule")&&(d.CSSMediaRule=s.CSSMediaRule),bd("CSSConditionRule")&&(d.CSSConditionRule=s.CSSConditionRule),bd("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:od((t,e,s)=>{var a=s[0],l=t.apply(e,s);n.onCssomSheetMutation(e.parentStyleSheet);var u=pd(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];o.queueMutation(e.parentStyleSheet,()=>i({id:h,styleId:d,adds:[{rule:a,index:v}]}))}return l},"host")}),s.prototype.deleteRule=new Proxy(v[e].deleteRule,{apply:od((t,e,s)=>{var a=s[0],l=t.apply(e,s);n.onCssomSheetMutation(e.parentStyleSheet);var u=pd(e.parentStyleSheet,r,n.styleMirror),h=u.id,d=u.styleId;if(e.parentStyleSheet&&(h&&-1!==h||d&&-1!==d)){var v=[...fd(e),a];o.queueMutation(e.parentStyleSheet,()=>i({id:h,styleId:d,removes:[{index:v}]}))}return l},"host")})}),od(()=>{s.CSSStyleSheet.prototype.insertRule=a,s.CSSStyleSheet.prototype.deleteRule=h,l&&(s.CSSStyleSheet.prototype.replace=l),u&&(s.CSSStyleSheet.prototype.replaceSync=u),Object.entries(d).forEach(t=>{var e=t[0],i=t[1];i.prototype.insertRule=v[e].insertRule,i.prototype.deleteRule=v[e].deleteRule})})}(t,{win:s,mutationQueue:u})),o.push(gd(t,t.doc)),o.push(function(t,e){var i=t.styleDeclarationCb,r=t.mirror,n=t.ignoreCSSAttributes,s=t.stylesheetManager,o=e.win,a=e.mutationQueue,l=o.CSSStyleDeclaration.prototype.setProperty;o.CSSStyleDeclaration.prototype.setProperty=new Proxy(l,{apply:od((t,e,o)=>{var l,u=o[0],h=o[1],d=o[2],v=t.apply(e,o);if(n.has(u))return v;var c=null===(l=e.parentRule)||void 0===l?void 0:l.parentStyleSheet;s.onCssomSheetMutation(c);var f=pd(c,r,s.styleMirror),p=f.id,g=f.styleId;if(p&&-1!==p||g&&-1!==g){var m=fd(e.parentRule);a.queueMutation(c,()=>i({id:p,styleId:g,set:{property:u,value:h,priority:d},index:m}))}return v},"host")});var u=o.CSSStyleDeclaration.prototype.removeProperty;return o.CSSStyleDeclaration.prototype.removeProperty=new Proxy(u,{apply:od((t,e,o)=>{var l,u=o[0],h=t.apply(e,o);if(n.has(u))return h;var d=null===(l=e.parentRule)||void 0===l?void 0:l.parentStyleSheet;s.onCssomSheetMutation(d);var v=pd(d,r,s.styleMirror),c=v.id,f=v.styleId;if(c&&-1!==c||f&&-1!==f){var p=fd(e.parentRule);a.queueMutation(d,()=>i({id:c,styleId:f,remove:{property:u},index:p}))}return h},"host")}),od(()=>{o.CSSStyleDeclaration.prototype.setProperty=l,o.CSSStyleDeclaration.prototype.removeProperty=u})}(t,{win:s,mutationQueue:u})),t.collectFonts&&o.push(function(t){var e=t.fontCb,i=t.doc,r=i.defaultView;if(!r)return()=>{};var n=[],s=new WeakMap,o=r.FontFace;r.FontFace=function(t,e,i){var r=new o(t,e,i);return s.set(r,{family:t,buffer:"string"!=typeof e,descriptors:i,fontSource:"string"==typeof e?e:JSON.stringify(Array.from(new Uint8Array(e)))}),r};var a=nu(i.fonts,"add",function(t){return function(i){return setTimeout(od(()=>{var t=s.get(i);t&&(e(t),s.delete(i))}),0),t.apply(this,[i])}});return n.push(()=>{r.FontFace=o}),n.push(a),od(()=>{n.forEach(t=>t())})}(t))}for(var h of(o.push(function(t){var e=t.doc,i=t.mirror,r=t.blockClass,n=t.blockSelector,s=t.selectionCb,o=!0,a=od(()=>{var t=e.getSelection();if(!(!t||o&&(null==t?void 0:t.isCollapsed))){o=t.isCollapsed||!1;for(var a=[],l=t.rangeCount||0,u=0;l>u;u++){var h=t.getRangeAt(u),d=h.startContainer,v=h.startOffset,c=h.endContainer,f=h.endOffset;Hh(d,r,n,!0)||Hh(c,r,n,!0)||a.push({start:i.getId(d),startOffset:v,end:i.getId(c),endOffset:f})}s({ranges:a})}});return a(),Rh("selectionchange",a)}(t)),o.push(function(t){var e=t.customElementCb,i=t.doc.defaultView;return i&&i.customElements?nu(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))o.push(h.observer(h.callback,s,h.options))}catch(t){try{a()}catch(t){}throw t}return a}function yd(t){return void 0!==window[t]}function bd(t){return Boolean(void 0!==window[t]&&window[t].prototype&&"insertRule"in window[t].prototype&&"deleteRule"in window[t].prototype)}var _d=class{constructor(t){Pu(this,"generateIdFn",void 0),Pu(this,"iframeRemoteIdToLocalIdMap",new WeakMap),Pu(this,"iframeLocalIdToRemoteIdMap",new WeakMap),this.generateIdFn=t}getId(t,e,i,r){if(0>e)return e;var n=i||this.getRemoteIdToLocalIdMap(t),s=r||this.getLocalIdToRemoteIdMap(t),o=n.get(e);return void 0===o&&(o=this.generateIdFn(),n.set(e,o),s.set(o,e)),o}getIds(t,e){var i=this.getRemoteIdToLocalIdMap(t),r=this.getLocalIdToRemoteIdMap(t);return e.map(e=>this.getId(t,e,i,r))}getRemoteId(t,e,i){var r;return"number"!=typeof e||0>e?e:null!==(r=(i||this.getLocalIdToRemoteIdMap(t)).get(e))&&void 0!==r?r:-1}getRemoteIds(t,e){var i=this.getLocalIdToRemoteIdMap(t);return e.map(e=>this.getRemoteId(t,e,i))}reset(t){if(!t)return this.iframeRemoteIdToLocalIdMap=new WeakMap,void(this.iframeLocalIdToRemoteIdMap=new WeakMap);this.iframeRemoteIdToLocalIdMap.delete(t),this.iframeLocalIdToRemoteIdMap.delete(t)}getRemoteIdToLocalIdMap(t){var e=this.iframeRemoteIdToLocalIdMap.get(t);return e||this.iframeRemoteIdToLocalIdMap.set(t,e=new Map),e}getLocalIdToRemoteIdMap(t){var e=this.iframeLocalIdToRemoteIdMap.get(t);return e||this.iframeLocalIdToRemoteIdMap.set(t,e=new Map),e}},wd=class{constructor(t){Pu(this,"iframes",new WeakMap),Pu(this,"crossOriginIframeMap",new WeakMap),Pu(this,"crossOriginIframeMirror",new _d(hh)),Pu(this,"crossOriginIframeStyleMirror",void 0),Pu(this,"crossOriginIframeRootIdMap",new WeakMap),Pu(this,"mirror",void 0),Pu(this,"mutationCb",void 0),Pu(this,"wrappedEmit",void 0),Pu(this,"loadListener",void 0),Pu(this,"pageHideListener",void 0),Pu(this,"stylesheetManager",void 0),Pu(this,"recordCrossOriginIframes",void 0),Pu(this,"messageHandler",void 0),Pu(this,"nestedIframeListeners",new Map),Pu(this,"attachedWindows",new WeakMap),Pu(this,"attachedDocuments",new WeakMap),Pu(this,"attachedIframes",new Map),Pu(this,"loadListenerDisposers",new WeakMap),Pu(this,"iframeElementsById",new Map),Pu(this,"pageHideHandlers",new WeakMap),this.mutationCb=t.mutationCb,this.wrappedEmit=t.wrappedEmit,this.stylesheetManager=t.stylesheetManager,this.recordCrossOriginIframes=t.recordCrossOriginIframes,this.crossOriginIframeStyleMirror=new _d(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?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=>Ph(t)),this.loadListenerDisposers.delete(t))}removePageHideListener(t){var e=this.pageHideHandlers.get(t);e&&(e.forEach(t=>{Ah(t.win,"pagehide",t.handler)}),this.pageHideHandlers.delete(t))}addLoadListener(t){this.loadListener=t}addPageHideListener(t){this.pageHideListener=t}removeLoadListener(){this.loadListener=void 0}trackIframeContent(t,e){var i=this.mirror.getId(t);return this.attachedIframes.set(i,{element:t,content:e}),i}attachIframe(t,e){var i,r=this.trackIframeContent(t,e);if(t.contentDocument){var n=this.attachedDocuments.get(t);n||this.attachedDocuments.set(t,n=new Set),n.add(t.contentDocument)}this.mutationCb({adds:[{parentId:r,nextId:null,node:e}],removes:[],texts:[],attributes:[],isAttachIframe:!0});var s=t.contentWindow;if(this.recordCrossOriginIframes&&s&&!this.nestedIframeListeners.has(s)){var o=this.handleMessage.bind(this);Ph(()=>{s.addEventListener("message",o),this.nestedIframeListeners.set(s,o);var e=this.attachedWindows.get(t);e||this.attachedWindows.set(t,e=new Set),e.add(s)})}Ph(()=>{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)||void 0===e||e.call(this,t),t.contentDocument&&this.mirror.removeNodeFromMap(t.contentDocument)};e.addEventListener("pagehide",n),i||this.pageHideHandlers.set(t,i=new Set),i.add({win:e,handler:n})}}),null===(i=this.loadListener)||void 0===i||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){switch(e.type){case Bl.FullSnapshot:this.crossOriginIframeMirror.reset(t),this.crossOriginIframeStyleMirror.reset(t),this.replaceIdOnNode(e.data.node,t);var i=e.data.node.id;return this.crossOriginIframeRootIdMap.set(t,i),this.patchRootIdOnNode(e.data.node,i),this.trackIframeContent(t,e.data.node),{timestamp:e.timestamp,type:Bl.IncrementalSnapshot,data:{source:Hl.Mutation,adds:[{parentId:this.mirror.getId(t),nextId:null,node:e.data.node}],removes:[],texts:[],attributes:[],isAttachIframe:!0}};case Bl.Meta:case Bl.Load:case Bl.DomContentLoaded:return!1;case Bl.Plugin:return e;case Bl.Custom:return this.replaceIds(e.data.payload,t,["id","parentId","previousId","nextId"]),e;case Bl.IncrementalSnapshot:switch(e.data.source){case Hl.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 Hl.Drag:case Hl.TouchMove:case Hl.MouseMove:return e.data.positions.forEach(e=>{this.replaceIds(e,t,["id"])}),e;case Hl.ViewportResize:return!1;case Hl.MediaInteraction:case Hl.MouseInteraction:case Hl.Scroll:case Hl.CanvasMutation:case Hl.Input:return this.replaceIds(e.data,t,["id"]),e;case Hl.StyleSheetRule:case Hl.StyleDeclaration:return this.replaceIds(e.data,t,["id"]),this.replaceStyleIds(e.data,t,["styleId"]),e;case Hl.Font:return e;case Hl.Selection:return e.data.ranges.forEach(e=>{this.replaceIds(e,t,["start","end"])}),e;case Hl.AdoptedStyleSheet:var r;return this.replaceIds(e.data,t,["id"]),this.replaceStyleIds(e.data,t,["styleIds"]),null===(r=e.data.styles)||void 0===r||r.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===Gl.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&&(Ah(t,"message",e),this.nestedIframeListeners.delete(t)),this.crossOriginIframeMap.delete(t)}),this.attachedWindows.delete(i)),r&&this.nestedIframeListeners.has(r)&&(Ah(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=>{Ph(()=>this.mirror.removeNodeFromMap(t))}),Ph(()=>dd(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&&Ah(window,"message",this.messageHandler),this.nestedIframeListeners.forEach((t,e)=>{Ah(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}},kd=class{constructor(t){Pu(this,"shadowDoms",new WeakSet),Pu(this,"mutationCb",void 0),Pu(this,"scrollCb",void 0),Pu(this,"bypassOptions",void 0),Pu(this,"mirror",void 0),Pu(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($u(t)&&!this.shadowDoms.has(t)){this.shadowDoms.add(t);var s=null!==(i=null===(r=su.host(t))||void 0===r?void 0:r.ownerDocument)&&void 0!==i?i:e,o=ud(n({},this.bypassOptions,{doc:s,mutationCb:this.mutationCb,mirror:this.mirror,shadowDomManager:this}),t),a=o.observer,l=o.buffer;this.restoreHandlers.push({doc:s,handler(){a.disconnect(),l.destroy(),l.releaseCanvasManager();var t=ad.indexOf(l);-1!==t&&ad.splice(t,1)}}),this.restoreHandlers.push({doc:s,handler:hd(n({},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(su.host(t))),this.restoreHandlers.push({doc:s,handler:gd({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:nu(t.prototype,"attachShadow",function(t){return function(r){var n=t.call(this,r),s=su.shadowRoot(this);return s&&Kh(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}},Sd="skip-frame";function xd(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 Cd="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",Td="undefined"==typeof Uint8Array?[]:new Uint8Array(256),Md=0;64>Md;Md++)Td[Cd.charCodeAt(Md)]=Md;var Id=function(t){var e,i=new Uint8Array(t),r=i.length,n="";for(e=0;r>e;e+=3)n+=Cd[i[e]>>2],n+=Cd[(3&i[e])<<4|i[e+1]>>4],n+=Cd[(15&i[e+1])<<2|i[e+2]>>6],n+=Cd[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},Ed=new Map,Rd=(t,e,i)=>{if(t&&(Fd(t,e)||"object"==typeof t)){var r=function(t,e){var i=Ed.get(t);return i||Ed.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 Ad(t,e,i,r){return t instanceof Array?t.map(t=>Ad(t,e,i,r)):null===t?t: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?{rr_type:t.constructor.name,args:[Object.values(t)]}:t instanceof ArrayBuffer?{rr_type:t.constructor.name,base64:Id(t)}:t instanceof DataView?{rr_type:t.constructor.name,args:[Ad(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:[Ad(t.data,e,i,r),t.width,t.height]}:Fd(t,e)||"object"==typeof t?{rr_type:t.constructor.name,index:Rd(t,e,i)}:t}var Pd=(t,e,i,r)=>t.map(t=>Ad(t,e,i,r)),Fd=(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]))},Od=["webgl","webgl2"];function $d(t){return"nodeType"in t}function Dd(t,e,i,r){var s=[];try{if(r){var o=function(t,e,i){var r=t.GPUCanvasContext;if((null==r?void 0:r.prototype)&&"function"==typeof r.prototype.configure)return nu(r.prototype,"configure",function(r){return function(s){var o=function(t){var e=t.canvas;return e&&"object"==typeof e?e:null}(this);if(!o||$d(o)&&Hh(o,e,i,!0))return r.call(this,s);$d(o)&&!("__context"in o)&&(o.__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&&s?n({},s,{usage:"number"==typeof s.usage?s.usage|a:a}):s)}})}(t,e,i);o&&s.push(o)}var a=nu(t.HTMLCanvasElement.prototype,"getContext",function(t){return function(n){for(var s=function(t){return"experimental-webgl"===t?"webgl":t}(n),o=arguments.length,a=new Array(o>1?o-1:0),l=1;o>l;l++)a[l-1]=arguments[l];if(!Hh(this,e,i,!0)&&("__context"in this||(this.__context=s),r&&Od.includes(s)))if(a[0]&&"object"==typeof a[0]){var u=a[0];u.preserveDrawingBuffer||(u.preserveDrawingBuffer=!0)}else a.splice(0,1,{preserveDrawingBuffer:!0});return t.apply(this,[n,...a])}});s.push(a)}catch(t){console.error("failed to patch HTMLCanvasElement.prototype.getContext")}return()=>{s.forEach(t=>t())}}function Ld(t,e,i,r,n,s,o){var a=[],l=Object.getOwnPropertyNames(t),u=function(l){if(["isContextLost","canvas","drawingBufferWidth","drawingBufferHeight"].includes(l))return 0;try{if("function"!=typeof t[l])return 0;var u=nu(t,l,function(t){return function(){for(var a=arguments.length,u=new Array(a),h=0;a>h;h++)u[h]=arguments[h];var d=t.apply(this,u);if(Rd(d,s,this),this.canvas&&"tagName"in this.canvas&&!Hh(this.canvas,r,n,!0)){var v={type:e,property:l,args:Pd(u,s,this,o)};i(this.canvas,v)}return d}});a.push(u)}catch(s){var h=Dh(t,l,{set(t){this.canvas&&"tagName"in this.canvas&&!Hh(this.canvas,r,n,!0)&&i(this.canvas,{type:e,property:l,args:[t],setter:!0})}});a.push(h)}};for(var h of l)u(h);return a}var Nd='(function() {\n\t//#region ../../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/base64-arraybuffer/1.0.2/f63fa6b5c318cf1c9f6bdd1d4292ad2f15f76f2ec78475025a2d44070e896fe9/node_modules/base64-arraybuffer/dist/base64-arraybuffer.es5.js\n\tvar chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";\n\tvar lookup = typeof Uint8Array === "undefined" ? [] : /* @__PURE__ */ new Uint8Array(256);\n\tfor (var i = 0; i < chars.length; i++) lookup[chars.charCodeAt(i)] = i;\n\tvar encode = function(arraybuffer) {\n\t\tvar bytes = new Uint8Array(arraybuffer), i, len = bytes.length, base64 = "";\n\t\tfor (i = 0; i < len; i += 3) {\n\t\t\tbase64 += chars[bytes[i] >> 2];\n\t\t\tbase64 += chars[(bytes[i] & 3) << 4 | bytes[i + 1] >> 4];\n\t\t\tbase64 += chars[(bytes[i + 1] & 15) << 2 | bytes[i + 2] >> 6];\n\t\t\tbase64 += chars[bytes[i + 2] & 63];\n\t\t}\n\t\tif (len % 3 === 2) base64 = base64.substring(0, base64.length - 1) + "=";\n\t\telse if (len % 3 === 1) base64 = base64.substring(0, base64.length - 2) + "==";\n\t\treturn base64;\n\t};\n\t//#endregion\n\t//#region ../rrweb/src/record/workers/image-bitmap-data-url-worker.ts\n\tconst lastFingerprintMap = /* @__PURE__ */ new Map();\n\tconst transparentFingerprintMap = /* @__PURE__ */ new Map();\n\tconst lastSentAtMap = /* @__PURE__ */ new Map();\n\tconst PROVIDER_KEYFRAME_INTERVAL_MS = 3e4;\n\tfunction hashPixels(data) {\n\t\tconst view = new Uint32Array(data.buffer, data.byteOffset, data.byteLength >>> 2);\n\t\tlet primaryHash = 2166136261;\n\t\tlet secondaryHash = 2654435769;\n\t\tfor (let i = 0; i < view.length; i++) {\n\t\t\tprimaryHash ^= view[i];\n\t\t\tprimaryHash = Math.imul(primaryHash, 16777619);\n\t\t\tsecondaryHash ^= view[i];\n\t\t\tsecondaryHash = Math.imul(secondaryHash, 2246822507);\n\t\t}\n\t\treturn `${(primaryHash >>> 0).toString(16)}:${(secondaryHash >>> 0).toString(16)}`;\n\t}\n\tfunction frameFingerprint(width, height, data) {\n\t\treturn `${width}x${height}:${hashPixels(data)}`;\n\t}\n\tfunction transparentFingerprint(width, height) {\n\t\tconst pixelCount = width * height;\n\t\tlet hash = transparentFingerprintMap.get(pixelCount);\n\t\tif (hash === void 0) {\n\t\t\thash = hashPixels(new Uint8ClampedArray(pixelCount * 4));\n\t\t\ttransparentFingerprintMap.set(pixelCount, hash);\n\t\t}\n\t\treturn `${width}x${height}:${hash}`;\n\t}\n\tconst worker = self;\n\tlet reusableCanvas = null;\n\tlet reusableCtx = null;\n\tworker.onmessage = async function(e) {\n\t\tif ("resetFrameDedup" in e.data) {\n\t\t\tlastFingerprintMap.clear();\n\t\t\treturn;\n\t\t}\n\t\tif ("OffscreenCanvas" in globalThis) {\n\t\t\tconst { id, bitmap, width, height, displayWidth, displayHeight, dataURLOptions, maskRegions } = e.data;\n\t\t\ttry {\n\t\t\t\tif (!reusableCanvas || reusableCanvas.width !== width || reusableCanvas.height !== height) {\n\t\t\t\t\treusableCanvas = new OffscreenCanvas(width, height);\n\t\t\t\t\treusableCtx = reusableCanvas.getContext("2d", { willReadFrequently: true });\n\t\t\t\t}\n\t\t\t\tconst ctx = reusableCtx;\n\t\t\t\tctx.clearRect(0, 0, width, height);\n\t\t\t\tctx.drawImage(bitmap, 0, 0);\n\t\t\t\tbitmap.close();\n\t\t\t\tif (maskRegions) {\n\t\t\t\t\tctx.fillStyle = "black";\n\t\t\t\t\tfor (const region of maskRegions) ctx.fillRect(region.x, region.y, region.width, region.height);\n\t\t\t\t}\n\t\t\t\tconst fingerprint = frameFingerprint(width, height, ctx.getImageData(0, 0, width, height).data);\n\t\t\t\tif (fingerprint === (lastFingerprintMap.get(id) ?? transparentFingerprint(width, height))) {\n\t\t\t\t\tconst lastSentAt = lastSentAtMap.get(id);\n\t\t\t\t\tif (!(maskRegions !== void 0 && lastSentAt !== void 0 && Date.now() - lastSentAt >= PROVIDER_KEYFRAME_INTERVAL_MS)) return worker.postMessage({ id });\n\t\t\t\t}\n\t\t\t\tconst blob = await reusableCanvas.convertToBlob(dataURLOptions);\n\t\t\t\tconst arrayBuffer = await blob.arrayBuffer();\n\t\t\t\tworker.postMessage({\n\t\t\t\t\tid,\n\t\t\t\t\ttype: blob.type,\n\t\t\t\t\tbase64: encode(arrayBuffer),\n\t\t\t\t\tdisplayWidth,\n\t\t\t\t\tdisplayHeight\n\t\t\t\t});\n\t\t\t\tlastFingerprintMap.set(id, fingerprint);\n\t\t\t\tlastSentAtMap.set(id, Date.now());\n\t\t\t} catch {\n\t\t\t\tworker.postMessage({ id });\n\t\t\t}\n\t\t} else {\n\t\t\te.data.bitmap.close();\n\t\t\treturn worker.postMessage({ id: e.data.id });\n\t\t}\n\t};\n\t//#endregion\n})();\n',qd="undefined"!=typeof self&&self.Blob&&new Blob(["(self.URL || self.webkitURL).revokeObjectURL(self.location.href);",Nd],{type:"text/javascript;charset=utf-8"});function jd(t){var e;try{if(!(e=qd&&(self.URL||self.webkitURL).createObjectURL(qd)))throw"";var i=new Worker(e,{name:null==t?void 0:t.name});return i.addEventListener("error",()=>{(self.URL||self.webkitURL).revokeObjectURL(e)}),i}catch(e){return new Worker("data:text/javascript;charset=utf-8,"+encodeURIComponent(Nd),{name:null==t?void 0:t.name})}}var Bd,Hd,zd,Ud=class{onFullSnapshot(){var t;null===(t=this.resetFrameDedup)||void 0===t||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}constructor(t){Pu(this,"pendingCanvasMutations",new Map),Pu(this,"rafStamps",{latestId:0,invokeId:null}),Pu(this,"mirror",void 0),Pu(this,"mutationCb",void 0),Pu(this,"resetObservers",void 0),Pu(this,"frozen",!1),Pu(this,"locked",!1),Pu(this,"rafIdTimestamp",null),Pu(this,"rafIdFlush",null),Pu(this,"refCount",0),Pu(this,"torndown",!1),Pu(this,"resetFrameDedup",null),Pu(this,"processMutation",(t,e)=>{(this.rafStamps.invokeId&&this.rafStamps.latestId!==this.rafStamps.invokeId||!this.rafStamps.invokeId)&&(this.rafStamps.invokeId=this.rafStamps.latestId),this.pendingCanvasMutations.has(t)||this.pendingCanvasMutations.set(t,[]),this.pendingCanvasMutations.get(t).push(e)});var e=t.sampling,i=void 0===e?"all":e,r=t.win,n=t.blockClass,s=t.blockSelector,o=t.recordCanvas,a=t.dataURLOptions,l=t.resolutionScale,u=t.canvasMasking;this.mutationCb=t.mutationCb,this.mirror=t.mirror,o&&"all"===i&&this.initCanvasMutationObserver(r,n,s,a),o&&"number"==typeof i&&this.initCanvasFPSObserver(i,r,n,s,{dataURLOptions:a,resolutionScale:l,canvasMasking:u})}initCanvasFPSObserver(t,e,i,r,n){var s=this;if("OffscreenCanvas"in e){var a,l="number"==typeof n.resolutionScale&&Number.isFinite(n.resolutionScale)?Math.min(1,Math.max(.1,n.resolutionScale)):1,u=Dd(e,i,r,!0),h=new Map;try{a=new jd}catch(t){return}var d=!1;a.onerror=()=>{var t;d=!0,cancelAnimationFrame(v),null===(t=a.terminate)||void 0===t||t.call(a),this.resetFrameDedup=null},this.resetFrameDedup=()=>{a.postMessage({resetFrameDedup:!0})},a.onmessage=t=>{var e=t.data.id;if(h.set(e,!1),"base64"in t.data){var i=t.data,r=i.displayWidth,n=i.displayHeight;this.mutationCb({id:e,type:Wl["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 v,c=1e3/t,f=0,p=t=>{var u,g;d||(f&&c>t-f||(f=t,(u=[],g=t=>{try{t.querySelectorAll("canvas").forEach(t=>{Hh(t,i,r,!0)||u.push(t)}),t.querySelectorAll("*").forEach(t=>{t.shadowRoot&&g(t.shadowRoot)})}catch(t){}},g(e.document),u).forEach(function(){var t=o(function*(t){var e=s.mirror.getId(t);if(!h.get(e)&&0!==t.width&&0!==t.height){h.set(e,!0);try{if(["webgl","webgl2"].includes(t.__context)){var i,r,o=t.getContext(t.__context);if(null==o||null===(i=o.isContextLost)||void 0===i?void 0:i.call(o))return void h.set(e,!1);!1===(null==o||null===(r=o.getContextAttributes())||void 0===r?void 0:r.preserveDrawingBuffer)&&o.clear(o.COLOR_BUFFER_BIT)}var u=t.clientWidth||t.width,d=t.clientHeight||t.height,v=Math.max(1,Math.round(u*l)),c=Math.max(1,Math.round(d*l)),f=function(t,e,i,r,n,s){if(t&&"function"==typeof t.regionsFn){var o;try{o=t.regionsFn(e)}catch(t){return Sd}if(void 0!==o){if(!Array.isArray(o)||!o.every(xd))return Sd;var a=i/n,l=r/s;return o.filter(t=>t.width>0&&t.height>0).map(t=>{var e=Math.floor(t.x*a),i=Math.floor(t.y*l);return{x:e,y:i,width:Math.ceil((t.x+t.width)*a)-e,height:Math.ceil((t.y+t.height)*l)-i}})}}}(n.canvasMasking,t,v,c,u,d);if("skip-frame"===f)return void h.set(e,!1);var p=yield createImageBitmap(t,1>l?{resizeWidth:v,resizeHeight:c,resizeQuality:"medium"}:{resizeWidth:v,resizeHeight:c});a.postMessage({id:e,bitmap:p,width:v,height:c,displayWidth:u,displayHeight:d,dataURLOptions:n.dataURLOptions,maskRegions:f},[p])}catch(t){h.set(e,!1)}}});return function(e){return t.apply(this,arguments)}}())),v=requestAnimationFrame(p))};v=requestAnimationFrame(p),this.resetObservers=()=>{var t;u(),cancelAnimationFrame(v),null===(t=a.terminate)||void 0===t||t.call(a),this.resetFrameDedup=null}}}initCanvasMutationObserver(t,e,i,r){this.startRAFTimestamping(),this.startPendingCanvasMutationFlusher();var n=Dd(t,e,i,!1),s=function(t,e,i,r,n){var s=[],o=Object.getOwnPropertyNames(e.CanvasRenderingContext2D.prototype),a=function(o){try{if("function"!=typeof e.CanvasRenderingContext2D.prototype[o])return 1;var a=nu(e.CanvasRenderingContext2D.prototype,o,function(s){return function(){for(var a=arguments.length,l=new Array(a),u=0;a>u;u++)l[u]=arguments[u];return Hh(this.canvas,i,r,!0)||setTimeout(()=>{var i=Pd(l,e,this,n);t(this.canvas,{type:Wl["2D"],property:o,args:i})},0),s.apply(this,l)}});s.push(a)}catch(n){var l=Dh(e.CanvasRenderingContext2D.prototype,o,{set(e){Hh(this.canvas,i,r,!0)||t(this.canvas,{type:Wl["2D"],property:o,args:[e],setter:!0})}});s.push(l)}};for(var l of o)if(a(l))continue;return()=>{s.forEach(t=>t())}}(this.processMutation.bind(this),t,e,i,r),o=function(t,e,i,r,n){var s=[];return void 0!==e.WebGLRenderingContext&&s.push(...Ld(e.WebGLRenderingContext.prototype,Wl.WebGL,t,i,r,e,n)),void 0!==e.WebGL2RenderingContext&&s.push(...Ld(e.WebGL2RenderingContext.prototype,Wl.WebGL2,t,i,r,e,n)),()=>{s.forEach(t=>t())}}(this.processMutation.bind(this),t,e,i,r);this.resetObservers=()=>{n(),s(),o()}}startPendingCanvasMutationFlusher(){this.rafIdFlush=requestAnimationFrame(()=>this.flushPendingCanvasMutations())}startRAFTimestamping(){var t=e=>{this.rafStamps.latestId=e,this.rafIdTimestamp=requestAnimationFrame(t)};this.rafIdTimestamp=requestAnimationFrame(t)}flushPendingCanvasMutations(){this.pendingCanvasMutations.forEach((t,e)=>{var i=this.mirror.getId(e);this.flushPendingCanvasMutationFor(e,i)}),this.rafIdFlush=requestAnimationFrame(()=>this.flushPendingCanvasMutations())}flushPendingCanvasMutationFor(e,i){if(!this.frozen&&!this.locked){var n=this.pendingCanvasMutations.get(e);if(n&&-1!==i){var s=n.map(e=>r(e,t));this.mutationCb({id:i,type:n[0].type,commands:s}),this.pendingCanvasMutations.delete(e)}}}},Wd=class{constructor(t){var e;Pu(this,"trackedLinkElements",new WeakSet),Pu(this,"pendingDeferredSheets",new Set),Pu(this,"mutationCb",void 0),Pu(this,"adoptedStyleSheetCb",void 0),Pu(this,"maskAllElementAttributes",void 0),Pu(this,"maskAttributeFn",void 0),Pu(this,"styleMirror",new Jh),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=Vu(r))}catch(t){}if(!i||!r)return Eu(),null;var n=i,s=!1,o={sheet:r,invalidate(){s=!0}};this.pendingDeferredSheets.add(o);var a=!1;return{advance:i=>{if(a)return!0;var l,u,h=ou(),d=uu(),v=!0;try{if(s)return a=!0,Eu(),!0;if(!n.advance(i))return v=!1,!1;a=!0;var c=n.text();if(!t.isConnected)return!0;var f=null;try{f=t.sheet}catch(t){}return f!==r?(Eu(),!0):c?(this.emitCssTextMutation(t,e,c),!0):(Eu(),!0)}finally{v&&this.pendingDeferredSheets.delete(o),hu(l=ou()-h,null!=(u=d)?u:au)||(wu.totalMs+=l,l>wu.slowestSliceMs&&(wu.slowestSliceMs=l))}},remainingRules:()=>n.remainingRules(),discard:()=>{this.pendingDeferredSheets.delete(o)}}}onCssomSheetMutation(t){if(t&&0!==this.pendingDeferredSheets.size)for(var e of this.pendingDeferredSheets)e.sheet===t&&(this.pendingDeferredSheets.delete(e),e.invalidate())}inlineDeferredLinkElement(t,e){var i;null===(i=this.beginDeferredLinkInlining(t,e))||void 0===i||i.advance(1/0)}emitCssTextMutation(t,e,i){this.mutationCb({adds:[],removes:[],texts:[],attributes:[{id:e,attributes:{_cssText:Ku({element:t,name:"_cssText",value:i,maskAllElementAttributes:this.maskAllElementAttributes,maskAttributeFn:this.maskAttributeFn})}}]})}trackLinkElement(t){this.trackedLinkElements.has(t)||(this.trackedLinkElements.add(t),this.trackStylesheetInLinkElement(t))}adoptStyleSheets(t,e){var i=this;if(0!==t.length){var r={id:e,styleIds:[]},n=[],s=function(t){var e;if(i.styleMirror.has(t))e=i.styleMirror.getId(t);else{var s=i.styleMirror.add(t);e=s;var o=ou();try{Tu(()=>{try{var e=t.rules||t.cssRules;e&&Cu(e)}catch(t){}n.push({styleId:s,rules:Array.from(t.rules||CSSRule,(e,i)=>({rule:ju(e,t.href),index:i}))})})}finally{Mu(ou()-o)}}r.styleIds.push(e)};for(var o of t)s(o);n.length>0&&(r.styles=n),this.adoptedStyleSheetCb(r)}}reset(){this.styleMirror.reset(),this.trackedLinkElements=new WeakSet,this.pendingDeferredSheets.clear(),kh.forEach(t=>t.abort()),kh.clear()}trackStylesheetInLinkElement(t){}},Vd=class{constructor(){Pu(this,"nodeMap",new WeakMap),Pu(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(){}},Gd=!1;try{if(2!==Array.from([1],t=>2*t)[0]){var Zd,Jd=document.createElement("iframe");document.body.appendChild(Jd),Array.from=(null===(Zd=Jd.contentWindow)||void 0===Zd?void 0:Zd.Array.from)||Array.from,document.body.removeChild(Jd)}}catch(t){console.debug("Unable to override Array.from",t)}var Qd=new Gu,Kd=new Set([Hl.Mutation,Hl.MediaInteraction,Hl.StyleSheetRule,Hl.CanvasMutation,Hl.Font,Hl.Log,Hl.StyleDeclaration,Hl.AdoptedStyleSheet]);function Xd(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?void 0:t.call(e,i)}}}var r=setTimeout(t,250);return{cancel:()=>clearTimeout(r)}}function Yd(t){var e;void 0===t&&(t={});var i=t,r=i.emit,s=i.checkoutEveryNms,o=i.checkoutEveryNth,a=i.blockClass,l=void 0===a?"rr-block":a,u=i.blockSelector,h=void 0===u?null:u,d=i.ignoreClass,v=void 0===d?"rr-ignore":d,c=i.ignoreSelector,f=void 0===c?null:c,p=i.maskTextClass,g=void 0===p?"rr-mask":p,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,I=void 0!==M&&M,E=i.maskAttributeFn,R=i.hooks,A=i.packFn,P=i.sampling,F=void 0===P?{}:P,O=i.dataURLOptions,D=void 0===O?{}:O,L=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,J=void 0!==Z&&Z,Q=i.collectFonts,K=void 0!==Q&&Q,X=i.inlineImages,Y=void 0!==X&&X,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;Yh=i.errorHandler;var ot=n({type:"image/webp",quality:.4,maxBase64ImageLength:1048576},D),at=!W||window.parent===window,lt=!1;if(!at)try{window.parent.document&&(lt=!1)}catch(t){lt=!0}if(at&&!r)throw new Error("emit function is required");if(!at&&!lt)return()=>{};void 0!==q&&void 0===F.mousemove&&(F.mousemove=q),Qd.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=Ih(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 A&&!lt&&(t=A(t)),t};Bd=(t,e)=>{var i,n=t;if(n.timestamp=Lh(),!(null===(i=ad[0])||void 0===i?void 0:i.isFrozen())||n.type===Bl.FullSnapshot||n.type===Bl.IncrementalSnapshot&&Kd.has(n.data.source)||ad.forEach(t=>t.unfreeze()),at)null==r||r(gt(n),e);else if(lt){var a={type:"rrweb",event:gt(n),origin:window.location.origin,isCheckout:e};window.parent.postMessage(a,"*")}if(n.type===Bl.FullSnapshot)ut=n,ft=0;else if(n.type===Bl.IncrementalSnapshot){if(n.data.source===Hl.Mutation&&n.data.isAttachIframe)return;ft++,(o&&ft>=o||s&&n.timestamp-ut.timestamp>s)&&Hd(!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 s=Qd.getNode(r.node.id);s&&"IFRAME"===s.nodeName&&i.add(s)}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()}Bd({type:Bl.IncrementalSnapshot,data:n({source:Hl.Mutation},t)})},yt=t=>Bd({type:Bl.IncrementalSnapshot,data:n({source:Hl.Scroll},t)}),bt=t=>Bd({type:Bl.IncrementalSnapshot,data:n({source:Hl.CanvasMutation},t)}),_t=new Wd({mutationCb:mt,adoptedStyleSheetCb:t=>Bd({type:Bl.IncrementalSnapshot,data:n({source:Hl.AdoptedStyleSheet},t)}),maskAllElementAttributes:I,maskAttributeFn:E}),wt=new wd({mirror:Qd,mutationCb:mt,stylesheetManager:_t,recordCrossOriginIframes:W,wrappedEmit:Bd});for(var kt of tt||[])kt.getMirror&&kt.getMirror({nodeMirror:Qd,crossOriginIframeMirror:wt.crossOriginIframeMirror,crossOriginIframeStyleMirror:wt.crossOriginIframeStyleMirror});var St=new Vd,xt=null==N?void 0:N.configured;zd=new Ud({recordCanvas:z,mutationCb:bt,win:window,blockClass:l,blockSelector:h,mirror:Qd,sampling:F.canvas,dataURLOptions:ot,resolutionScale:L,canvasMasking:N});var Ct=new kd({mutationCb:mt,scrollCb:yt,bypassOptions:{blockClass:l,blockSelector:h,maskTextClass:g,maskTextSelector:y,inlineStylesheet:_,maskInputOptions:ht,dataURLOptions:ot,maskTextFn:T,maskInputFn:C,maskAllElementAttributes:I,maskAttributeFn:E,recordCanvas:z,canvasMaskingConfigured:xt,inlineImages:Y,sampling:F,slimDOMOptions:dt,iframeManager:wt,stylesheetManager:_t,canvasManager:zd,keepIframeSrcFn:it,processedNodeManager:St,attributeFilter:st},mirror:Qd});Hd=function(t){if(void 0===t&&(t=!1),B){ku(w);try{Bd({type:Bl.Meta,data:{href:window.location.href,width:jh(),height:qh()}},t),null==e||e.cancel(),e=void 0,_t.reset(),Ct.init(),ad.forEach(t=>t.lock());var i,r=null;try{r=function(t,e){var i=e||{},r=i.mirror,n=void 0===r?new Gu:r,s=i.blockClass,o=void 0===s?"rr-block":s,a=i.blockSelector,l=void 0===a?null:a,u=i.maskTextClass,h=void 0===u?"rr-mask":u,d=i.maskTextSelector,v=void 0===d?null:d,c=i.inlineStylesheet,f=void 0===c||c,p=i.inlineImages,g=void 0!==p&&p,m=i.recordCanvas,y=void 0!==m&&m,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,I=i.dataURLOptions,E=i.preserveWhiteSpace,R=i.onSerialize,A=i.onIframeLoad,P=i.iframeLoadTimeout,F=i.onIframeListenerRegistered,O=i.onStylesheetLoad,D=i.stylesheetLoadTimeout,L=i.keepIframeSrcFn,N=void 0===L?()=>!1:L,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=Ih(void 0!==M&&M);ku(j);try{return Mh(t,{doc:t,mirror:n,blockClass:o,blockSelector:l,maskTextClass:h,maskTextSelector:v,skipChild:!1,inlineStylesheet:f,maskInputOptions:B,maskTextFn:k,maskInputFn:S,maskAllElementAttributes:C,maskAttributeFn:T,slimDOMOptions:H,dataURLOptions:I,inlineImages:g,recordCanvas:y,canvasMaskingConfigured:b,preserveWhiteSpace:E,onSerialize:R,onIframeLoad:A,iframeLoadTimeout:P,onIframeListenerRegistered:F,onStylesheetLoad:O,stylesheetLoadTimeout:D,keepIframeSrcFn:N,newlyAddedElement:!1,maxDepth:q})}finally{Su()}}(document,{mirror:Qd,blockClass:l,blockSelector:h,maskTextClass:g,maskTextSelector:y,inlineStylesheet:_,maskAllInputs:ht,inlineStylesheetBudgetRules:w,maskTextFn:T,maskInputFn:C,maskAllElementAttributes:I,maskAttributeFn:E,slimDOM:dt,dataURLOptions:ot,recordCanvas:z,canvasMaskingConfigured:xt,inlineImages:Y,onSerialize(t){Vh(t,Qd)&&wt.addIframe(t),Gh(t,Qd)&&_t.trackLinkElement(t),Zh(t)&&Ct.addShadowRoot(su.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=mu,mu=[],i=s}if(!r)return console.warn("Failed to snapshot the document");if(Bd({type:Bl.FullSnapshot,data:{node:r,initialOffset:Nh(window)}},t),ad.forEach(t=>t.unlock()),zd.onFullSnapshot(),i.length){var n=function(t,e,i){var r=!1,n=null,s=0,o=null,a=()=>null!==o||t.length>s,l=()=>{var i=t[s];t[s]=null,s+=1,i&&Ph(()=>{o=e.beginDeferredLinkInlining(i,Qd.getId(i))})},u=()=>{if(o){var t=o,e=!0;Ph(()=>{e=t.advance(200)}),e&&(o=null)}},h=()=>{o||l(),u()},d=t=>{if(n=null,!r){var e=0;do{try{h()}catch(t){null==o||o.discard(),o=null,Ru(1)}e+=1}while(!r&&a()&&(t?!t.didTimeout&&t.timeRemaining()>5:10>e));r||(a()?n=Xd(d):i())}};return n=Xd(d),{cancel(){r=!0,null==o||o.discard(),o=null,null==n||n.cancel(),n=null},flush(){if(!r){r=!0,null==n||n.cancel(),n=null;for(var e=0,h=0;a()&&50>e;){o||l();var d=o;if(d)if(Math.floor(d.remainingRules()/200)+1>50-e)d.discard(),o=null,h+=1;else{try{u()}catch(t){null==o||o.discard(),o=null,h+=1}e+=1}}if(a()||h>0){for(var v=h+(null!==o?1:0),c=s;t.length>c;c++)null!==t[c]&&(v+=1);Ru(v),null==o||o.discard(),o=null}i()}}}}(i,_t,()=>{e===n&&(e=void 0)});e=n}W&&wt.reattachIframes(),document.adoptedStyleSheets&&document.adoptedStyleSheets.length>0&&_t.adoptStyleSheets(document.adoptedStyleSheets,Qd.getId(document))}finally{Su()}var s}};try{var Tt=[];for(var Mt of(Tt.push(Rh("pagehide",()=>{try{null==e||e.flush()}catch(t){}e=void 0},window)),["visibilitychange","freeze","resume"]))Tt.push(Rh(Mt,lu,document));vt=t=>{var e=pt.get(t);e&&(e.forEach(t=>{Ph(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=Qd.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 It=t=>{var e;return od(md)({mutationCb:mt,mousemoveCb:(t,e)=>Bd({type:Bl.IncrementalSnapshot,data:{source:e,positions:t}}),mouseInteractionCb:t=>Bd({type:Bl.IncrementalSnapshot,data:n({source:Hl.MouseInteraction},t)}),scrollCb:yt,viewportResizeCb:t=>Bd({type:Bl.IncrementalSnapshot,data:n({source:Hl.ViewportResize},t)}),inputCb:t=>Bd({type:Bl.IncrementalSnapshot,data:n({source:Hl.Input},t)}),mediaInteractionCb:t=>Bd({type:Bl.IncrementalSnapshot,data:n({source:Hl.MediaInteraction},t)}),styleSheetRuleCb:t=>Bd({type:Bl.IncrementalSnapshot,data:n({source:Hl.StyleSheetRule},t)}),styleDeclarationCb:t=>Bd({type:Bl.IncrementalSnapshot,data:n({source:Hl.StyleDeclaration},t)}),canvasMutationCb:bt,fontCb:t=>Bd({type:Bl.IncrementalSnapshot,data:n({source:Hl.Font},t)}),selectionCb(t){Bd({type:Bl.IncrementalSnapshot,data:n({source:Hl.Selection},t)})},customElementCb(t){Bd({type:Bl.IncrementalSnapshot,data:n({source:Hl.CustomElement},t)})},blockClass:l,ignoreClass:v,ignoreSelector:f,maskTextClass:g,maskTextSelector:y,maskInputOptions:ht,inlineStylesheet:_,sampling:F,recordDOM:B,recordCanvas:z,canvasMaskingConfigured:xt,inlineImages:Y,userTriggeredOnInput:J,collectFonts:K,doc:t,maskInputFn:C,maskTextFn:T,maskAllElementAttributes:I,maskAttributeFn:E,keepIframeSrcFn:it,blockSelector:h,slimDOMOptions:dt,dataURLOptions:ot,mirror:Qd,iframeManager:wt,stylesheetManager:_t,shadowDomManager:Ct,processedNodeManager:St,canvasManager:zd,ignoreCSSAttributes:nt,attributeFilter:st,plugins:(null==tt||null===(e=tt.filter(t=>t.observer))||void 0===e?void 0:e.map(t=>({observer:t.observer,options:t.options,callback:e=>Bd({type:Bl.Plugin,data:{plugin:t.name,payload:e}})})))||[]},R)};wt.addLoadListener(t=>{try{var e=Qd.getId(t),i=It(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=Qd.getId(t);null==vt||vt(e),dd(t)});var Et=-1,Rt=t=>Bd({type:Bl.Custom,data:{tag:"rrweb/fullscreen",payload:t}}),At=()=>{var t,e,i,r,n=document,s=null!==(t=null!==(e=null!==(i=null!==(r=n.fullscreenElement)&&void 0!==r?r:n.webkitFullscreenElement)&&void 0!==i?i:n.mozFullScreenElement)&&void 0!==e?e:n.msFullscreenElement)&&void 0!==t?t:null,o=s?Qd.getId(s):-1;o!==Et&&(-1!==Et&&Rt({id:Et,enter:!1}),Et=o,-1!==o&&Rt({id:o,enter:!0}))},Pt=()=>{Hd();var t=It(document);"function"==typeof t&&Tt.push(t),Tt.push(Rh("fullscreenchange",At)),Tt.push(Rh("webkitfullscreenchange",At)),Tt.push(Rh("mozfullscreenchange",At)),Tt.push(Rh("MSFullscreenChange",At)),Gd=!0};return["interactive","complete"].includes(document.readyState)?Pt():(Tt.push(Rh("DOMContentLoaded",()=>{Bd({type:Bl.DomContentLoaded,data:{}}),"DOMContentLoaded"===G&&Pt()})),Tt.push(Rh("load",()=>{Bd({type:Bl.Load,data:{}}),"load"===G&&Pt()},window))),()=>{try{null==e||e.flush()}catch(t){}e=void 0,Tt.forEach(t=>Ph(t)),St.destroy(),wt.removeLoadListener(),wt.destroy(),pt.clear(),Ct.reset(),Qd.reset(),Gd=!1,Yh=void 0}}catch(t){console.warn(t)}}function tv(t){return tv="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},tv(t)}function ev(t,e,i){return(e=function(t){var e=function(t){if("object"!=tv(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var i=e.call(t,"string");if("object"!=tv(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==tv(e)?e:e+""}(e))in t?Object.defineProperty(t,e,{value:i,enumerable:!0,configurable:!0,writable:!0}):t[e]=i,t}Yd.addCustomEvent=(t,e)=>{if(!Gd)throw new Error("please add custom event after start recording");Bd({type:Bl.Custom,data:{tag:t,payload:e}})},Yd.freezePage=()=>{ad.forEach(t=>t.freeze())},Yd.takeFullSnapshot=t=>{if(!Gd)throw new Error("please take full snapshot after start recording");Hd(t)},Yd.mirror=Qd,"Mobile".toLowerCase(),"Tablet".toLowerCase(),new RegExp("Xbox","i"),new RegExp("Nintendo","i"),new RegExp("PlayStation","i"),new RegExp("Windows","i"),Date,Date;var iv=class{constructor(t){ev(this,"fileName",void 0),ev(this,"functionName",void 0),ev(this,"lineNumber",void 0),ev(this,"columnNumber",void 0),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}},rv=/(^|@)\S+:\d+/,nv=/^\s*at .*(\S+:\d+|\(native\))/m,sv=/^(eval@)?(\[native code])?$/,ov={parse(t){return t?void 0!==t.stacktrace||void 0!==t["opera#sourceloc"]?this.parseOpera(t):t.stack&&t.stack.match(nv)?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(nv)},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());return new iv({functionName:r.join(" ")||void 0,fileName:["eval","<anonymous>"].indexOf(n[0])>-1?void 0:n[0],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 iv({functionName:t});var e=/((.*".+"[^@]*)?[^@]*)(?:@)/,i=t.match(e),r=i&&i[1]?i[1]:void 0,n=this.extractLocation(t.replace(e,""));return new iv({functionName:r,fileName:n[0],lineNumber:n[1],columnNumber:n[2]})},this)},parseOpera(t){return!t.stacktrace||t.message.indexOf("\n")>-1&&t.message.split("\n").length>t.stacktrace.split("\n").length?this.parseOpera9(t):t.stack?this.parseOpera11(t):this.parseOpera10(t)},parseOpera9(t){for(var e=/Line (\d+).*script (?:in )?(\S+)/i,i=t.message.split("\n"),r=[],n=2,s=i.length;s>n;n+=2){var o=e.exec(i[n]);o&&r.push(new iv({fileName:o[2],lineNumber:parseFloat(o[1])}))}return r},parseOpera10(t){for(var e=/Line (\d+).*script (?:in )?(\S+)(?:: In function (\S+))?$/i,i=t.stacktrace.split("\n"),r=[],n=0,s=i.length;s>n;n+=2){var o=e.exec(i[n]);o&&r.push(new iv({functionName:o[3]||void 0,fileName:o[2],lineNumber:parseFloat(o[1])}))}return r},parseOpera11(t){return t.stack.split("\n").filter(function(t){return!!t.match(rv)&&!t.match(/^Error created at/)},this).map(function(t){var e=t.split("@"),i=this.extractLocation(e.pop());return new iv({functionName:(e.shift()||"").replace(/<anonymous function(: (\w+))?>/,"$2").replace(/\([^)]*\)/g,"")||void 0,fileName:i[0],lineNumber:i[1],columnNumber:i[2]})},this)}};function av(t){if(!t||!t.outerHTML)return"";for(var e="";t.parentElement;){var i=t.localName;if(!i)break;i=i.toLowerCase();var r=t.parentElement,n=[];if(r.children&&r.children.length>0)for(var s=0;r.children.length>s;s++){var o=r.children[s];o.localName&&o.localName.toLowerCase&&o.localName.toLowerCase()===i&&n.push(o)}n.length>1&&(i+=":eq("+n.indexOf(t)+")"),e=i+(e?">"+e:""),t=r}return e}function lv(t){return Array.isArray(t)}function uv(t){return"object"==typeof t&&null!==t&&!lv(t)}function hv(t,e){if(0===e)return!0;for(var i of Object.keys(t))if(uv(t[i])&&hv(t[i],e-1))return!0;return!1}function dv(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(uv(o=e)&&Object.keys(o).length>i.numOfKeysLimit||"function"==typeof o||uv(o)&&hv(o,i.depthOfLimit))return function(t){var e=t.toString();return i.stringLengthLimit&&e.length>i.stringLengthLimit&&(e=e.slice(0,i.stringLengthLimit)+"..."),e}(e);var o;if("bigint"==typeof e)return e.toString()+"n";if(e instanceof Event){var a={};for(var l in e){var u=e[l];a[l]=lv(u)?av(u.length?u[0]:null):u}return a}return e instanceof Node?e instanceof HTMLElement?e?e.outerHTML:"":e.nodeName:e instanceof Error?e.stack?e.stack+"\nEnd of stack for Error object":e.name+": "+e.message:e})}var vv={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 cv(t,e,i){var r,n=i?Object.assign({},vv,i):vv,s=n.logger;if(!s)return()=>{};r="string"==typeof s?e[s]:s;var o=0,a=!1,l=[];if(n.level.includes("error")){var u=e=>{var i=e.message;t({level:"error",trace:ov.parse(e.error).map(t=>t.toString()),payload:[dv(i,n.stringifyOptions)]})};e.addEventListener("error",u),l.push(()=>{e.removeEventListener("error",u)});var h=e=>{var i,r;e.reason instanceof Error?r=[dv("Uncaught (in promise) "+(i=e.reason).name+": "+i.message,n.stringifyOptions)]:(i=new Error,r=[dv("Uncaught (in promise)",n.stringifyOptions),dv(e.reason,n.stringifyOptions)]),t({level:"error",trace:ov.parse(i).map(t=>t.toString()),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){try{if(!(s in e))return()=>{};var l=e[s],u={next:l},h=(e=>function(){for(var s=arguments.length,l=new Array(s),u=0;s>u;u++)l[u]=arguments[u];if(e.apply(r,l),!("assert"===i&&l[0]||a)){a=!0;try{var h=ov.parse(new Error).map(t=>t.toString()).splice(1),d=("assert"===i?l.slice(1):l).map(t=>dv(t,n.stringifyOptions));o++,n.lengthThreshold>o?t({level:i,trace:h,payload:d}):o===n.lengthThreshold&&t({level:"warn",trace:[],payload:[dv("The number of log records reached the threshold.")]})}catch(t){e("rrweb logger error:",t,...l)}finally{a=!1}}})(function(){for(var t=arguments.length,e=new Array(t),i=0;t>i;i++)e[i]=arguments[i];return u.next.apply(this,e)});return"function"==typeof h&&(h.prototype=h.prototype||{},Object.defineProperties(h,{__rrweb_original__:{enumerable:!1,value:l},__rrweb_layer__:{enumerable:!1,value:u}})),e[s]=h,()=>{if(e[s]!==h)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===h)return void(r.next=u.next);r=t(i=r.next)}else e[s]=u.next}}catch(t){return()=>{}}}(e,i):()=>{}}}var fv=t=>({name:"rrweb/console@1",observer:cv,options:t}),pv=()=>{},gv=t=>{var e;if(Ce(t))return null!==(e=t.__posthog_layer__)&&void 0!==e?e:t.__rrweb_layer__};function mv(t,e,i){try{if(!(e in t))return pv;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 Ce(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=gv(i);s;){if(s.next===n)return void(s.next=r.next);s=gv(i=s.next)}else t[e]=r.next}}catch(t){return pv}}function yv(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 bv=Cn("[Recorder]"),_v=t=>"navigation"===t.entryType,wv=t=>"resource"===t.entryType;function kv(t,e){return!!e&&($e(e)||e[t])}function Sv(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 xv=["image/","video/","audio/","font/","application/octet-stream","application/pdf","application/zip","application/wasm"];function Cv(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:!!Sv(e)&&t(e.url)}catch(t){return!1}}(t.url))return!1;if(n(xv))return!1;if($e(i))return!0;if(xe(i))return n(i);var s=i[e];return $e(s)?s:n(s)}function Tv(t,e,i,r,n,s){return Mv.apply(this,arguments)}function Mv(){return Mv=o(function*(t,e,i,r,n,s){return void 0===s&&(s=0),s>10?(bv.warn("Failed to get performance entry for request",{url:i,initiatorType:e}),null):function(t,e){for(var i=t.length-1;i>=0;i-=1)if(e(t[i]))return t[i]}(t.performance.getEntriesByName(i),t=>wv(t)&&t.initiatorType===e&&(Ie(r)||t.startTime>=r)&&(Ie(n)||n>=t.startTime))||(yield new Promise(t=>setTimeout(t,50*s)),Tv(t,e,i,r,n,s+1))}),Mv.apply(this,arguments)}function Iv(t){var e=t.body,i=t.options,r=t.url;if(Pe(e))return null;var n=yv(r,i);if(n.isHostDenied)return n.hostname+" is in deny list";if(Ee(e))return e;if((t=>"u">typeof Document&&t instanceof Document)(e))return e.textContent;if(De(e))return Bn(e);if(Te(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 Ev=t=>!Ae(t)&&("navigation"===t.entryType||"resource"===t.entryType);function Rv(t){var e=t.entry,i=t.method,r=t.status,s=t.networkRequest,o=t.isInitial,a=t.start,l=t.end,u=t.url,h=t.initiatorType;a=e?e.startTime:a,l=e?e.responseEnd:l;var d=Math.floor(Date.now()-performance.now()),v=Math.floor(d+(a||0)),c=[n({},e?e.toJSON():{name:u},{startTime:Ie(a)?void 0:Math.round(a),endTime:Ie(l)?void 0:Math.round(l),timeOrigin:d,timestamp:v,method:i,initiatorType:h||(e?e.initiatorType:void 0),status:r,requestHeaders:s.requestHeaders,requestBody:s.requestBody,responseHeaders:s.responseHeaders,responseBody:s.responseBody,isInitial:o})];if(Ev(e))for(var f of e.serverTiming||[])c.push({timeOrigin:d,timestamp:v,startTime:Math.round(e.startTime),name:f.name,duration:f.duration,entryType:"serverTiming"});return c}var Av=["video/","audio/"];function Pv(t){return Te(t)&&Ce(t.getReader)&&Ce(t.tee)}var Fv="[SessionReplay] Timeout while trying to read body",Ov="[SessionReplay] Failed to read body";function $v(t){return Ov+": "+t}function Dv(t){return"[SessionReplay] Body too large to record (> "+t+" bytes)"}function Lv(t,e){if(!e.streamNetworkBody)return function(t){return new Promise(e=>{var i=setTimeout(()=>e(Fv),500);try{t.clone().text().then(t=>e(t),t=>e($v(t))).finally(()=>clearTimeout(i))}catch(t){clearTimeout(i),e(Ov)}})}(t);var i=$s(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(Dv(i)):function(t,e){return new Promise(i=>{var r,n=!1;function s(){try{var t;null==(t=r)||t.cancel().catch(()=>{})}catch(t){}}function o(t){n||(n=!0,clearTimeout(l),s(),i(t))}var a,l=setTimeout(()=>o(Fv),500);try{a=t.clone()}catch(t){return void o(Ov)}var u=a.body;if(Pv(u)&&"undefined"!=typeof TextDecoder){try{r=u.getReader()}catch(t){return void o(Ov)}var h=[],d=0;!function t(){r.read().then(i=>{var r=i.done,a=i.value;if(n)s();else if(r)o((new TextDecoder).decode(function(t,e){var i=new Uint8Array(e),r=0;for(var n of t)i.set(n,r),r+=n.byteLength;return i}(h,d)));else{if(a){if(d+a.byteLength>e)return void o(Dv(e));d+=a.byteLength,h.push(a)}t()}},t=>o($v(t)))}()}else try{a.text().then(t=>o(t),t=>o($v(t)))}catch(t){o(Ov)}})}(t,i)}function Nv(){return Nv=o(function*(t){var e=t.r,i=t.options,r=yv(t.url,i);return r.isHostDenied?Promise.resolve(r.hostname+" is in deny list"):Lv(e,i)}),Nv.apply(this,arguments)}function qv(){return qv=o(function*(t){var e=t.r,i=t.options,r=function(t){var e,i=t.r,r=t.options,n=t.url;if("chunked"===i.headers.get("Transfer-Encoding"))return"Chunked Transfer-Encoding is not supported";var s=null==(e=i.headers.get("Content-Type"))?void 0:e.toLowerCase(),o=Av.some(t=>null==s?void 0:s.startsWith(t));if(s&&o)return"Content-Type "+s+" is not supported";var a=yv(n,r);return a.isHostDenied?a.hostname+" is in deny list":null}({r:e,options:i,url:t.url});return Ae(r)?Lv(e,i):Promise.resolve(r)}),qv.apply(this,arguments)}var jv=null;function Bv(t,e,i){if(!("performance"in e))return()=>{};if(jv)return bv.warn("Network observer already initialised, doing nothing"),()=>{};var r=i?Object.assign({},Ds,i):Ds,s=e=>{var i=[],s=!1;e.requests.forEach(t=>{var e="serverTiming"===t.entryType;if(!e||!s){var n=r.maskRequestFn(t);e||(s=!n||(t=>!!t&&Us.has(t))(n)),n&&i.push(n)}}),i.length>0&&t(n({},e,{requests:i}))},a=function(t,e,i){i.recordInitialRequests&&t({requests:e.performance.getEntries().filter(t=>_v(t)||wv(t)&&i.initiatorTypes.includes(t.initiatorType)).flatMap(t=>Rv({entry:t,method:void 0,status:void 0,networkRequest:{},isInitial:!0})),isInitial:!0});var r=new e.PerformanceObserver(e=>{t({requests:e.getEntries().filter(t=>_v(t)||wv(t)&&i.initiatorTypes.includes(t.initiatorType)&&(t=>!i.recordBody&&!i.recordHeaders||"xmlhttprequest"!==t.initiatorType&&"fetch"!==t.initiatorType)(t)).flatMap(t=>Rv({entry:t,method:void 0,status:void 0,networkRequest:{}}))})}),n=PerformanceObserver.supportedEntryTypes.filter(t=>i.performanceEntryTypeToObserve.includes(t));return r.observe({entryTypes:n}),()=>{r.disconnect()}}(s,e,r),l=()=>{},u=()=>{};return(r.recordHeaders||r.recordBody)&&(l=function(t,e,i){if(!i.initiatorTypes.includes("xmlhttprequest"))return()=>{};var r=kv("request",i.recordHeaders),n=kv("response",i.recordHeaders),s=mv(e.XMLHttpRequest.prototype,"open",s=>function(o,a,l,u,h){void 0===l&&(l=!0);var d=this;try{var v,c,f=new Request(a),p={},g={},m=d.setRequestHeader.bind(d);d.setRequestHeader=(t,e)=>(g[t]=e,m(t,e)),r&&(p.requestHeaders=g);var y=d.send.bind(d);d.send=t=>(Cv({type:"request",headers:g,url:a,recordBody:i.recordBody})&&(p.requestBody=Iv({body:t,options:i,url:a})),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),Cv({type:"response",headers:r,url:a,recordBody:i.recordBody})&&(p.responseBody=Iv({body:d.response,options:i,url:a})),Tv(e,"xmlhttprequest",f.url,v,c).then(e=>{t({requests:Rv({entry:e,method:o,status:null==d?void 0:d.status,networkRequest:p,start:v,end:c,url:a.toString(),initiatorType:"xmlhttprequest"})})}).catch(()=>{})}};d.addEventListener("readystatechange",_),d.addEventListener("error",b),d.addEventListener("abort",b),d.addEventListener("timeout",b)}catch(t){bv.error("Failed to instrument XHR for network capture",t)}s.call(d,o,a.toString(),l,u,h)});return()=>{s()}}(s,e,r),u=function(t,e,i){if(!i.initiatorTypes.includes("fetch"))return()=>{};var r=kv("request",i.recordHeaders),n=kv("response",i.recordHeaders),s=mv(e,"fetch",s=>function(){var a=o(function*(o,a){var l,u;try{l=new Request(o,a)}catch(t){return bv.error("Failed to instrument fetch for network capture",t),s(o,a)}var h,d,v={};try{try{var c={};l.headers.forEach((t,e)=>{c[e]=t}),r&&(v.requestHeaders=c),!Pv(null==a?void 0:a.body)&&Cv({type:"request",headers:c,url:o,recordBody:i.recordBody})&&(v.requestBody=yield function(t){return Nv.apply(this,arguments)}({r:l,options:i,url:o}))}catch(t){bv.error("Failed to record fetch request for network capture",t)}h=e.performance.now(),u=Sv(o)?yield s(l):yield s(o,a),d=e.performance.now();try{var f={};u.headers.forEach((t,e)=>{f[e]=t}),n&&(v.responseHeaders=f),Cv({type:"response",headers:f,url:o,recordBody:i.recordBody})&&(v.responseBody=yield function(t){return qv.apply(this,arguments)}({r:u,options:i,url:o}))}catch(t){bv.error("Failed to record fetch response for network capture",t)}return u}finally{Tv(e,"fetch",l.url,h,d).then(e=>{var i;t({requests:Rv({entry:e,method:l.method,status:null==(i=u)?void 0:i.status,networkRequest:v,start:h,end:d,url:l.url,initiatorType:"fetch"})})}).catch(()=>{})}});return function(t,e){return a.apply(this,arguments)}}());return()=>{s()}}(s,e,r)),jv=()=>{a(),l(),u(),jv=null}}var Hv,zv,Uv,Wv,Vv,Gv,Zv,Jv,Qv,Kv,Xv,Yv,tc,ec,ic,rc=t=>({name:"rrweb/network@1",observer:Bv,options:t});b.__PosthogExtensions__=b.__PosthogExtensions__||{},b.__PosthogExtensions__.rrwebPlugins={getRecordConsolePlugin:fv,getRecordNetworkPlugin:rc},b.__PosthogExtensions__.rrweb={record:Yd,version:"v2",wasMaxDepthReached:()=>Th,resetMaxDepthState(){Th=!1,Ch=!1},getLastSnapshotCost:()=>pu,getMutationCost:()=>n({},_u),resetSnapshotCostState(){du=0,vu=0,cu=0,au=0,fu={durationMs:0,stylesheetMs:0,nodeCount:0,cssRuleCount:0,nonDeferrableCssRuleCount:0,deferredStylesheetCount:0},pu=null,gu=null,mu=[],yu=0,bu=0,_u={slowestBatchMs:0},wu={deferredCount:0,failedCount:0,abandonedCount:0,totalMs:0,slowestSliceMs:0}}},b.rrweb={record:Yd,version:"v2"},b.rrwebConsoleRecord={getRecordConsolePlugin:fv},b.getRecordNetworkPlugin=rc,b.__PosthogExtensions__=b.__PosthogExtensions__||{},b.__PosthogExtensions__.initSessionRecording=(t,e)=>new jl(t,e);var nc,sc,oc,ac,lc={},uc=[],hc=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,dc=Array.isArray;function vc(t,e){for(var i in e)t[i]=e[i];return t}function cc(t){t&&t.parentNode&&t.parentNode.removeChild(t)}function fc(t,e,i){var r,n,s,o={};for(s in e)"key"==s?r=e[s]:"ref"==s?n=e[s]:o[s]=e[s];if(arguments.length>2&&(o.children=arguments.length>3?Hv.call(arguments,2):i),"function"==typeof t&&null!=t.defaultProps)for(s in t.defaultProps)void 0===o[s]&&(o[s]=t.defaultProps[s]);return pc(t,o,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?++Uv:n,__i:-1,__u:0};return null==n&&null!=zv.vnode&&zv.vnode(s),s}function gc(t){return t.children}function mc(t,e){this.props=t,this.context=e}function yc(t,e){if(null==e)return t.__?yc(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?yc(t):null}function bc(t){if(t.__P&&t.__d){var e=t.__v,i=e.__e,r=[],n=[],s=vc({},e);s.__v=e.__v+1,zv.vnode&&zv.vnode(s),Ec(t.__P,s,e,t.__n,t.__P.namespaceURI,32&e.__u?[i]:null,r,null==i?yc(e):i,!!(32&e.__u),n),s.__v=e.__v,s.__.__k[s.__i]=s,Ac(r,s,n),e.__e=e.__=null,s.__e!=i&&_c(s)}}function _c(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}),_c(t)}function wc(t){(!t.__d&&(t.__d=!0)&&Wv.push(t)&&!kc.__r++||Vv!=zv.debounceRendering)&&((Vv=zv.debounceRendering)||Gv)(kc)}function kc(){try{for(var t,e=1;Wv.length;)Wv.length>e&&Wv.sort(Zv),t=Wv.shift(),e=Wv.length,bc(t)}finally{Wv.length=kc.__r=0}}function Sc(t,e,i,r,n,s,o,a,l,u,h){var d,v,c,f,p,g,m,y=r&&r.__k||uc,b=e.length;for(l=function(t,e,i,r,n){var s,o,a,l,u,h=i.length,d=h,v=0;for(t.__k=new Array(n),s=0;n>s;s++)null!=(o=e[s])&&"boolean"!=typeof o&&"function"!=typeof o?("string"==typeof o||"number"==typeof o||"bigint"==typeof o||o.constructor==String?o=t.__k[s]=pc(null,o,null,null,null):dc(o)?o=t.__k[s]=pc(gc,{children:o},null,null,null):void 0===o.constructor&&o.__b>0?o=t.__k[s]=pc(o.type,o.props,o.key,o.ref?o.ref:null,o.__v):t.__k[s]=o,l=s+v,o.__=t,o.__b=t.__b+1,a=null,-1!=(u=o.__i=Cc(o,i,l,d))&&(d--,(a=i[u])&&(a.__u|=2)),null==a||null==a.__v?(-1==u&&(n>h?v--:h>n&&v++),"function"!=typeof o.type&&(o.__u|=4)):u!=l&&(u==l-1?v--:u==l+1?v++:(u>l?v--:v++,o.__u|=4))):t.__k[s]=null;if(d)for(s=0;h>s;s++)null!=(a=i[s])&&!(2&a.__u)&&(a.__e==r&&(r=yc(a)),Oc(a,a));return r}(i,e,y,l,b),d=0;b>d;d++)null!=(c=i.__k[d])&&(v=-1!=c.__i&&y[c.__i]||lc,c.__i=d,g=Ec(t,c,v,n,s,o,a,l,u,h),f=c.__e,c.ref&&v.ref!=c.ref&&(v.ref&&Fc(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=xc(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 xc(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=xc(n[s],e,i,r));return e}t.__e!=e&&(r&&(e&&t.type&&!e.parentNode&&(e=yc(t)),i.insertBefore(t.__e,e||null)),e=t.__e);do{e=e&&e.nextSibling}while(null!=e&&8==e.nodeType);return e}function Cc(t,e,i,r){var n,s,o,a=t.key,l=t.type,u=e[i],h=null!=u&&!(2&u.__u);if(null===u&&null==a||h&&a==u.key&&l==u.type)return i;if(r>(h?1:0))for(n=i-1,s=i+1;n>=0||e.length>s;)if(null!=(u=e[o=0>n?s++:n--])&&!(2&u.__u)&&a==u.key&&l==u.type)return o;return-1}function Tc(t,e,i){"-"==e[0]?t.setProperty(e,null==i?"":i):t[e]=null==i?"":"number"!=typeof i||hc.test(e)?i:i+"px"}function Mc(t,e,i,r,n){var s,o;t:if("style"==e)if("string"==typeof i)t.style.cssText=i;else{if("string"==typeof r&&(t.style.cssText=r=""),r)for(e in r)i&&e in i||Tc(t.style,e,"");if(i)for(e in i)r&&i[e]==r[e]||Tc(t.style,e,i[e])}else if("o"==e[0]&&"n"==e[1])s=e!=(e=e.replace(Xv,"$1")),o=e.toLowerCase(),e=o in t||"onFocusOut"==e||"onFocusIn"==e?o.slice(2):e.slice(2),t.l||(t.l={}),t.l[e+s]=i,i?r?i[Kv]=r[Kv]:(i[Kv]=Yv,t.addEventListener(e,s?ec:tc,s)):t.removeEventListener(e,s?ec:tc,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 Ic(t){return function(e){if(this.l){var i=this.l[e.type+t];if(null==e[Qv])e[Qv]=Yv++;else if(i[Kv]>e[Qv])return;return i(zv.event?zv.event(e):e)}}}function Ec(t,e,i,r,n,s,o,a,l,u){var h,d,v,c,f,p,g,m,y,b,$,_,w,k,S,x,C=e.type;if(void 0!==e.constructor)return null;128&i.__u&&(l=!!(32&i.__u),s=[a=e.__e=i.__e]),(h=zv.__b)&&h(e);t:if("function"==typeof C){d=o.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 mc(y,_),v.constructor=C,v.render=$c),$&&$.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=vc({},v.__s)),vc(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)}),uc.push.apply(v.__h,v._sb),v._sb=[],v.__h.length&&o.push(v);break t}null!=v.componentWillUpdate&&v.componentWillUpdate(y,v.__s,_),b&&null!=v.componentDidUpdate&&v.__h.push(function(){v.componentDidUpdate(f,p,g)})}if(v.context=_,v.props=y,v.__P=t,v.__e=!1,w=zv.__r,k=0,b)v.state=v.__s,v.__d=!1,w&&w(e),h=v.render(v.props,v.state,v.context),uc.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=vc(vc({},r),v.getChildContext())),b&&!c&&null!=v.getSnapshotBeforeUpdate&&(g=v.getSnapshotBeforeUpdate(f,p)),S=null!=h&&h.type===gc&&null==h.key?Pc(h.props.children):h,a=Sc(t,dc(S)?S:[S],e,i,r,n,s,o,a,l,u),v.base=e.__e,e.__u&=-161,v.__h.length&&o.push(v),m&&(v.__E=v.__=null)}catch(t){if(o.length=d,e.__v=null,l||null!=s)if(t.then){for(e.__u|=l?160:128;a&&8==a.nodeType&&a.nextSibling;)a=a.nextSibling;null!=s&&(s[s.indexOf(a)]=null),e.__e=a}else{if(null!=s)for(x=s.length;x--;)cc(s[x]);Rc(e)}else e.__e=i.__e,!e.__k&&i.__k&&(e.__k=i.__k),t.then||Rc(e);zv.__e(t,e,i)}}else null==s&&e.__v==i.__v?(e.__k=i.__k,e.__e=i.__e):a=e.__e=function(t,e,i,r,n,s,o,a,l){var u,h,d,v,c,f,p,g=i.props||lc,m=e.props,y=e.type;if("svg"==y?n="http://www.w3.org/2000/svg":"math"==y?n="http://www.w3.org/1998/Math/MathML":n||(n="http://www.w3.org/1999/xhtml"),null!=s)for(u=0;s.length>u;u++)if((c=s[u])&&"setAttribute"in c==!!y&&(y?c.localName==y:3==c.nodeType)){t=c,s[u]=null;break}if(null==t){if(null==y)return document.createTextNode(m);t=document.createElementNS(n,y,m.is&&m),a&&(zv.__m&&zv.__m(e,s),a=!1),s=null}if(null==y)g===m||a&&t.data==m||(t.data=m);else{if(s="textarea"==y&&null!=m.defaultValue?null:s&&Hv.call(t.childNodes),!a&&null!=s)for(g={},u=0;t.attributes.length>u;u++)g[(c=t.attributes[u]).name]=c.value;for(u in g)c=g[u],"dangerouslySetInnerHTML"==u?d=c:"children"==u||u in m||"value"==u&&"defaultValue"in m||"checked"==u&&"defaultChecked"in m||Mc(t,u,null,c,n);for(u in m)c=m[u],"children"==u?v=c:"dangerouslySetInnerHTML"==u?h=c:"value"==u?f=c:"checked"==u?p=c:a&&"function"!=typeof c||g[u]===c||Mc(t,u,c,g[u],n);if(h)a||d&&(h.__html==d.__html||h.__html==t.innerHTML)||(t.innerHTML=h.__html),e.__k=[];else if(d&&(t.innerHTML=""),Sc("template"==e.type?t.content:t,dc(v)?v:[v],e,i,r,"foreignObject"==y?"http://www.w3.org/1999/xhtml":n,s,o,s?s[0]:i.__k&&yc(i,0),a,l),null!=s)for(u=s.length;u--;)cc(s[u]);a&&"textarea"!=y||(u="value","progress"==y&&null==f?t.removeAttribute("value"):null!=f&&(f!==t[u]||"progress"==y&&!f||"option"==y&&f!=g[u])&&Mc(t,u,f,g[u],n),u="checked",null!=p&&p!=t[u]&&Mc(t,u,p,g[u],n))}return t}(i.__e,e,i,r,n,s,o,l,u);return(h=zv.diffed)&&h(e),128&e.__u?void 0:a}function Rc(t){t&&(t.__c&&(t.__c.__e=!0),t.__k&&t.__k.some(Rc))}function Ac(t,e,i){for(var r=0;i.length>r;r++)Fc(i[r],i[++r],i[++r]);zv.__c&&zv.__c(e,t),t.some(function(e){try{t=e.__h,e.__h=[],t.some(function(t){t.call(e)})}catch(t){zv.__e(t,e.__v)}})}function Pc(t){return"object"!=typeof t||null==t||t.__b>0?t:dc(t)?t.map(Pc):void 0!==t.constructor?null:vc({},t)}function Fc(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){zv.__e(t,i)}}function Oc(t,e,i){var r,n;if(zv.unmount&&zv.unmount(t),(r=t.ref)&&(r.current&&r.current!=t.__e||Fc(r,null,e)),null!=(r=t.__c)){if(r.componentWillUnmount)try{r.componentWillUnmount()}catch(t){zv.__e(t,e)}r.base=r.__P=r.__n=null}if(r=t.__k)for(n=0;r.length>n;n++)r[n]&&Oc(r[n],e,i||"function"!=typeof t.type);i||cc(t.__e),t.__c=t.__=t.__e=void 0}function $c(t,e,i){return this.constructor(t,i)}function Dc(t,e,i){var r,n,s,o;e==document&&(e=document.documentElement),zv.__&&zv.__(t,e),n=(r="function"==typeof i)?null:i&&i.__k||e.__k,s=[],o=[],Ec(e,t=(!r&&i||e).__k=fc(gc,null,[t]),n||lc,lc,e.namespaceURI,!r&&i?[i]:n?null:e.firstChild?Hv.call(e.childNodes):null,s,!r&&i?i:n?n.__e:e.firstChild,r,o),Ac(s,t,o),t.props.children=null}Hv=uc.slice,zv={__e(t,e,i,r){for(var n,s,o;e=e.__;)if((n=e.__c)&&!n.__)try{if((s=n.constructor)&&null!=s.getDerivedStateFromError&&(n.setState(s.getDerivedStateFromError(t)),o=n.__d),null!=n.componentDidCatch&&(n.componentDidCatch(t,r||{}),o=n.__d),o)return n.__E=n}catch(e){t=e}throw t}},Uv=0,mc.prototype.setState=function(t,e){var i=null!=this.__s&&this.__s!=this.state?this.__s:this.__s=vc({},this.state);"function"==typeof t&&(t=t(vc({},i),this.props)),t&&vc(i,t),null!=t&&this.__v&&(e&&this._sb.push(e),wc(this))},mc.prototype.forceUpdate=function(t){this.__v&&(this.__e=!0,t&&this.__h.push(t),wc(this))},mc.prototype.render=gc,Wv=[],Gv="function"==typeof Promise?Promise.prototype.then.bind(Promise.resolve()):setTimeout,Zv=function(t,e){return t.__v.__b-e.__v.__b},kc.__r=0,Jv=Math.random().toString(8),Qv="__d"+Jv,Kv="__a"+Jv,Xv=/(PointerCapture)$|Capture$/i,Yv=0,tc=Ic(!1),ec=Ic(!0),ic=0;var Lc=0,Nc=[],qc=zv,jc=qc.__b,Bc=qc.__r,Hc=qc.diffed,zc=qc.__c,Uc=qc.unmount,Wc=qc.__;function Vc(t,e){qc.__h&&qc.__h(sc,t,Lc||e),Lc=0;var i=sc.__H||(sc.__H={__:[],__h:[]});return t>=i.__.length&&i.__.push({}),i.__[t]}function Gc(t){return Lc=1,function(t,e){var i=Vc(nc++,2);if(i.t=t,!i.__c&&(i.__=[sf(void 0,e),function(t){var e=i.__N?i.__N[0]:i.__[0],r=i.t(e,t);e!==r&&(i.__N=[r,i.__[1]],i.__c.setState({}))}],i.__c=sc,!sc.__f)){var r=function(t,e,r){if(!i.__c.__H)return!0;var s=!1,o=i.__c.props!==t;if(i.__c.__H.__.some(function(t){if(t.__N){s=!0;var e=t.__[0];t.__=t.__N,t.__N=void 0,e!==t.__[0]&&(o=!0)}}),n){var a=n.call(this,t,e,r);return s?a||o:a}return!s||o};sc.__f=!0;var n=sc.shouldComponentUpdate,s=sc.componentWillUpdate;sc.componentWillUpdate=function(t,e,i){if(this.__e){var o=n;n=void 0,r(t,e,i),n=o}s&&s.call(this,t,e,i)},sc.shouldComponentUpdate=r}return i.__N||i.__}(sf,t)}function Zc(t,e){var i=Vc(nc++,3);!qc.__s&&nf(i.__H,e)&&(i.__=t,i.u=e,sc.__H.__h.push(i))}function Jc(t){return Lc=5,Qc(function(){return{current:t}},[])}function Qc(t,e){var i=Vc(nc++,7);return nf(i.__H,e)&&(i.__=t(),i.__H=e,i.__h=t),i.__}function Kc(t){var e,i=sc.context[t.__c],r=Vc(nc++,9);return r.c=t,i?(null!==(e=r.__)&&void 0!==e||(r.__=!0,i.sub(sc)),i.props.value):t.__}function Xc(){for(var t;t=Nc.shift();){var e=t.__H;if(t.__P&&e)try{e.__h.some(ef),e.__h.some(rf),e.__h=[]}catch(i){e.__h=[],qc.__e(i,t.__v)}}}qc.__b=function(t){sc=null,jc&&jc(t)},qc.__=function(t,e){t&&e.__k&&e.__k.__m&&(t.__m=e.__k.__m),Wc&&Wc(t,e)},qc.__r=function(t){Bc&&Bc(t),nc=0;var e=(sc=t.__c).__H;e&&(oc===sc?(e.__h=[],sc.__h=[],e.__.some(function(t){t.__N&&(t.__=t.__N),t.u=t.__N=void 0})):(e.__h.length&&Xc(),nc=0)),oc=sc},qc.diffed=function(t){Hc&&Hc(t);var e=t.__c;e&&e.__H&&(e.__H.__h.length&&(1!==Nc.push(e)&&ac===qc.requestAnimationFrame||((ac=qc.requestAnimationFrame)||tf)(Xc)),e.__H.__.some(function(t){t.u&&(t.__H=t.u,t.u=void 0)})),oc=sc=null},qc.__c=function(t,e){e.some(function(t){try{t.__h.some(ef),t.__h=t.__h.filter(function(t){return!t.__||rf(t)})}catch(i){e.some(function(t){t.__h&&(t.__h=[])}),e=[],qc.__e(i,t.__v)}}),zc&&zc(t,e)},qc.unmount=function(t){Uc&&Uc(t);var e,i=t.__c;i&&i.__H&&(i.__H.__.some(function(t){try{ef(t)}catch(t){e=t}}),i.__H=void 0,e&&qc.__e(e,i.__v))};var Yc="function"==typeof requestAnimationFrame;function tf(t){var e,i=function(){clearTimeout(r),Yc&&cancelAnimationFrame(e),setTimeout(t)},r=setTimeout(i,35);Yc&&(e=requestAnimationFrame(i))}function ef(t){var e=sc,i=t.__c;"function"==typeof i&&(t.__c=void 0,i()),sc=e}function rf(t){var e=sc;t.__c=t.__(),sc=e}function nf(t,e){return!t||t.length!==e.length||e.some(function(e,i){return e!==t[i]})}function sf(t,e){return"function"==typeof e?e(t):e}var of="gzip-js",af="base64",lf="events",uf="cancelEvents",hf="tab",df="left",vf="center",cf="right",ff="next_to_trigger",pf="popover",gf="widget",mf="external_survey",yf="open",bf="multiple_choice",_f="single_choice",wf="rating",kf="end",Sf="always",xf="survey shown",Cf="survey dismissed",Tf="survey sent",Mf="$survey_id",If="$survey_name",Ef="$survey_iteration",Rf="$survey_iteration_start_date",Af="$survey_partially_completed",Pf="$survey_submission_id",Ff="$survey_completed",Of="$survey_last_seen_date",$f="$survey_language",Df="popover";function Lf(t){var e=!0;return{dispose(){if(e){e=!1;var i=t();i&&Ce(i.then)&&i.then(void 0,()=>{})}}}}var Nf=Cn("[Surveys]");function qf(t){return!(!t.start_date||t.end_date)}function jf(t){var e;return!(null==(e=t.conditions)||null==(e=e.actions)||null==(e=e.values)||!e.length)}var Bf=(t,e)=>""+t+function(t){return t.current_iteration&&t.current_iteration>0?t.id+"_"+t.current_iteration:t.id}(e),Hf=t=>Bf("seenSurvey_",t),zf=t=>{try{var e=Hf(t);if(localStorage.getItem(e))return;localStorage.setItem(e,"true")}catch(t){Nf.error("Failed to persist survey seen state",t)}},Uf=[pf,gf,"api"],Wf={ignoreConditions:!1,ignoreDelay:!1,displayType:Df},Vf="logs";Math.trunc||(Math.trunc=function(t){return 0>t?Math.ceil(t):Math.floor(t)}),Number.isInteger||(Number.isInteger=function(t){return Fe(t)&&isFinite(t)&&Math.floor(t)===t});var Gf=class t{constructor(t){if(this.bytes=t,16!==t.length)throw new TypeError("not 128-bit length")}static fromFieldsV7(e,i,r,n){if(!Number.isInteger(e)||!Number.isInteger(i)||!Number.isInteger(r)||!Number.isInteger(n)||0>e||0>i||0>r||0>n||e>0xffffffffffff||i>4095||r>1073741823||n>4294967295)throw new RangeError("invalid field value");var s=new Uint8Array(16);return s[0]=e/Math.pow(2,40),s[1]=e/Math.pow(2,32),s[2]=e/Math.pow(2,24),s[3]=e/Math.pow(2,16),s[4]=e/256,s[5]=e,s[6]=112|i>>>8,s[7]=i,s[8]=128|r>>>24,s[9]=r>>>16,s[10]=r>>>8,s[11]=r,s[12]=n>>>24,s[13]=n>>>16,s[14]=n>>>8,s[15]=n,new t(s)}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 t(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}},Zf=class{generate(){var t=this.generateOrAbort();if(!Ie(t))return t;this.ri=0;var e=this.generateOrAbort();if(Ie(e))throw new Error("Could not generate UUID after timestamp reset");return e}generateOrAbort(){var t,e=(t=Date.now(),Fe(t)&&isFinite(t)?Math.min(Math.max(Math.floor(t),0),0xffffffffffff):0);if(e>this.ri)this.ri=e,this.ii();else{if(this.ri>=e+1e4)return;this.ni++,this.ni>4398046511103&&(this.ri++,this.ii())}return Gf.fromFieldsV7(this.ri,Math.trunc(this.ni/Math.pow(2,30)),this.ni&Math.pow(2,30)-1,this.oi.nextUint32())}ii(){this.ni=1024*this.oi.nextUint32()+(1023&this.oi.nextUint32())}constructor(){this.ri=0,this.ni=0,this.oi=new Kf}},Jf=t=>{if("u">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};a&&!Ie(a.crypto)&&crypto.getRandomValues&&(Jf=t=>crypto.getRandomValues(t));var Qf,Kf=class{nextUint32(){return this.Pe.length>this.ai||(Jf(this.Pe),this.ai=0),this.Pe[this.ai++]}constructor(){this.Pe=new Uint32Array(8),this.ai=1/0}},Xf=()=>Yf().toString(),Yf=()=>(Qf||(Qf=new Zf)).generate(),tp="",ep=/[a-z0-9][a-z0-9-]+\.[a-z]{2,}$/i;var ip=null,rp={si(){if(!Ae(ip))return ip;if(ip=!1,h)try{var t="__ph_cookie_support_"+Xf();rp.ui(t,"xyz"),ip='"xyz"'===Ia(t),rp.hi(t)}catch(t){ip=!1}return ip},ci(t){xn.error("cookieStore error: "+t)},li:Ia,di(t){var e;try{e=JSON.parse(rp.li(t))||{}}catch(t){}return e},ui(t,e,i,r,n){if(!h)return!1;try{var s="",o="",a=function(t,e){if(e){var i=function(t,e){if(void 0===e&&(e=h),tp)return tp;if(!e)return"";if(["localhost","127.0.0.1"].includes(t))return"";for(var i=t.split("."),r=Math.min(i.length,8),n="dmn_chk_"+Xf();!tp&&r--;){var s=i.slice(r).join("."),o=n+"=1;domain=."+s+";path=/";e.cookie=o+";max-age=3",e.cookie.includes(n)&&(e.cookie=o+";max-age=0",tp=s)}return tp}(t);if(!i){var r=(t=>{var e=t.match(ep);return e?e[0]:""})(t);r!==i&&xn.info("Warning: cookie subdomain discovery mismatch",r,i),i=r}return i?"; domain=."+i:""}return""}(h.location.hostname,r);if(i){var l=new Date;l.setTime(l.getTime()+864e5*i),s="; expires="+l.toUTCString()}n&&(o="; secure");var u=t+"="+encodeURIComponent(JSON.stringify(e))+s+"; SameSite=Lax; path=/"+a+o;return u.length>3686.4&&xn.warn("cookieStore warning: large cookie, len="+u.length),h.cookie=u,!0}catch(t){return!1}},hi(t,e){if(null!=h&&h.cookie)try{rp.ui(t,"",-1,e)}catch(t){return}}},np=null,sp={si(){if(!Ae(np))return np;var t=!0;if(Ie(a))t=!1;else try{var e="__mplssupport__";sp.ui(e,"xyz"),'"xyz"'!==sp.li(e)&&(t=!1),sp.hi(e)}catch(e){t=!1}return t||xn.error("localStorage unsupported; falling back to cookie store"),np=t,t},ci(t){xn.error("localStorage error: "+t)},li(t){try{return null==a?void 0:a.localStorage.getItem(t)}catch(t){sp.ci(t)}return null},di(t){try{return JSON.parse(sp.li(t))||{}}catch(t){}return null},ui(t,e){try{return null==a||a.localStorage.setItem(t,JSON.stringify(e)),!0}catch(t){sp.ci(t)}return!1},hi(t){try{null==a||a.localStorage.removeItem(t)}catch(t){sp.ci(t)}}},op=[vt,nt,rt,ot,at,lt,Rt,Et,Mt],ap=[k,w,G,Z,Lt,Dt,M,At],lp=t=>t+"_cpm",up=["__proto__","constructor","prototype"],hp=t=>{if(!Te(t))return{};var e={};return Object.keys(t).forEach(i=>{-1===up.indexOf(i)&&(e[i]=t[i])}),e},dp=function(t,e){void 0===e&&(e=[]);var i={};return[...ap,...e].forEach(e=>{var r=t[e];Ie(r)||Ae(r)||""===r||(i[e]=r)}),i},vp=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)},cp=(t,e)=>({p:e,f:vp(JSON.stringify(t))}),fp=(t,e)=>{if(!e)return{properties:[],isValid:!1};try{var i=rp.di(lp(t)),r=(null==i?void 0:i.f)===vp(e)&&xe(i.p);return{properties:r?i.p:[],isValid:r}}catch(t){return{properties:[],isValid:!1}}},pp=(t,e)=>e+"|"+(rp.li(lp(t))||""),gp={},mp={si:()=>!0,ci(t){xn.error("memoryStorage error: "+t)},li:t=>t in gp?gp[t]:null,di:t=>t in gp?gp[t]:null,ui:(t,e)=>(gp[t]=e,!0),hi(t){delete gp[t]}},yp=null,bp={si(){if(!Ae(yp))return yp;if(yp=!0,Ie(a))yp=!1;else try{var t="__support__";bp.ui(t,"xyz"),'"xyz"'!==bp.li(t)&&(yp=!1),bp.hi(t)}catch(t){yp=!1}return yp},ci(t){xn.error("sessionStorage error: ",t)},li(t){try{return null==a?void 0:a.sessionStorage.getItem(t)}catch(t){bp.ci(t)}return null},di(t){try{return JSON.parse(bp.li(t))||null}catch(t){}return null},ui(t,e){try{return null==a||a.sessionStorage.setItem(t,JSON.stringify(e)),!0}catch(t){bp.ci(t)}return!1},hi(t){try{null==a||a.sessionStorage.removeItem(t)}catch(t){bp.ci(t)}}},_p=Cn("[Stylesheet Loader]"),wp=a,kp=h,Sp="#020617",xp={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:cf,widgetType:hf,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:Sp,scrollbarThumbColor:"var(--ph-survey-border-color)",scrollbarTrackColor:"var(--ph-survey-background-color)"},Cp=[vf,df,cf];function Tp(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 Mp(t){var e;void 0===t&&(t=xp.backgroundColor),"#"===t[0]&&(e=Tp(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=Tp(i)),!e)return Sp;var r=e.match(/^rgba?\((\d+),\s*(\d+),\s*(\d+)(?:,\s*(\d+(?:\.\d+)?))?\)$/);if(r){var n=parseInt(r[1]),s=parseInt(r[2]),o=parseInt(r[3]);return Math.sqrt(n*n*.299+s*s*.587+o*o*.114)>127.5?Sp:"white"}return Sp}var Ip=(t,e,i)=>{var r=Gp(t),s=kp.querySelector("."+r);if(s&&s.shadowRoot)return{shadow:s.shadowRoot,isNewlyCreated:!1};var o=kp.createElement("div");((t,e,i)=>{var r=n({},xp,i),s=t.style,o=!Cp.includes(r.position)||e===gf&&(null==i?void 0:i.widgetType)===hf;s.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)),s.setProperty("--ph-survey-box-padding",r.boxPadding),s.setProperty("--ph-survey-max-width",r.maxWidth),s.setProperty("--ph-survey-z-index",r.zIndex),s.setProperty("--ph-survey-border-color",r.borderColor),o?(s.setProperty("--ph-survey-border-radius",r.borderRadius),s.setProperty("--ph-survey-border-bottom","1.5px solid var(--ph-survey-border-color)")):(s.setProperty("--ph-survey-border-bottom","none"),s.setProperty("--ph-survey-border-radius",r.borderRadius+" "+r.borderRadius+" 0 0")),s.setProperty("--ph-survey-background-color",r.backgroundColor),s.setProperty("--ph-survey-box-shadow",r.boxShadow),s.setProperty("--ph-survey-disabled-button-opacity",r.disabledButtonOpacity),s.setProperty("--ph-survey-submit-button-color",r.submitButtonColor),s.setProperty("--ph-survey-submit-button-text-color",(null==i?void 0:i.submitButtonTextColor)||Mp(r.submitButtonColor)),s.setProperty("--ph-survey-rating-bg-color",r.ratingButtonColor),s.setProperty("--ph-survey-rating-active-bg-color",r.ratingButtonActiveColor),s.setProperty("--ph-survey-rating-active-text-color",Mp(r.ratingButtonActiveColor)),s.setProperty("--ph-survey-text-primary-color",(null==i?void 0:i.textColor)||Mp(r.backgroundColor)),s.setProperty("--ph-survey-text-subtle-color",r.textSubtleColor),s.setProperty("--ph-widget-color",r.widgetColor),s.setProperty("--ph-widget-text-color",Mp(r.widgetColor)),s.setProperty("--ph-widget-z-index",r.zIndex);var a=(null==i?void 0:i.inputBackground)||(null==i?void 0:i.inputBackgroundColor),l=a||r.inputBackground;a||"white"!==r.backgroundColor||(l="#f8f8f8"),s.setProperty("--ph-survey-input-background",l);var u=(null==i?void 0:i.inputTextColor)||Mp(l);s.setProperty("--ph-survey-input-text-color",u),s.setProperty("--ph-survey-rating-text-color",u),s.setProperty("--ph-survey-scrollbar-thumb-color",r.scrollbarThumbColor),s.setProperty("--ph-survey-scrollbar-track-color",r.scrollbarTrackColor),s.setProperty("--ph-survey-outline-color",r.outlineColor)})(o,t.type,t.appearance),o.className=r;var a=o.attachShadow({mode:"open"}),l=function(t){var e=((t,e,i)=>{var r=t.createElement("style");r.innerText=e;var n=(t=>{var e;return Ce(t)?t:null==t||null==(e=t.config)?void 0:e.prepare_external_dependency_stylesheet})(i);return n&&(r=n(r)),r||(_p.error("prepare_external_dependency_stylesheet returned null"),null)})(kp,':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:calc(2147480000 + 3645);--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 #00000026;--ph-survey-submit-button-color:black;--ph-survey-submit-button-text-color:white;--ph-survey-rating-bg-color:white;--ph-survey-rating-text-color:#020617;--ph-survey-rating-active-bg-color:black;--ph-survey-rating-active-text-color:white;--ph-survey-text-primary-color:#020617;--ph-survey-text-subtle-color:#939393;--ph-widget-color:#e0a045;--ph-widget-text-color:white;--ph-survey-scrollbar-thumb-color:var(--ph-survey-border-color);--ph-survey-scrollbar-track-color:var(--ph-survey-background-color);--ph-survey-outline-color:#3b82f6cc;--ph-survey-input-background:white;--ph-survey-input-text-color:#020617;--ph-survey-disabled-button-opacity:.6}.ph-survey{min-width:300px;width:var(--ph-survey-max-width);max-width:85%;z-index:var(--ph-survey-z-index);height:fit-content;margin:0;position:fixed;bottom:0}.ph-survey h3,.ph-survey p{margin:0}.ph-survey *{box-sizing:border-box;font-family:var(--ph-survey-font-family);color:var(--ph-survey-text-primary-color)}.ph-survey textarea,.ph-survey input[type=text],.ph-survey .multiple-choice-options label{color:var(--ph-survey-input-text-color);background:var(--ph-survey-input-background);border:1.5px solid var(--ph-survey-border-color);border-radius:4px;padding:10px;transition:border-color .2s ease-out,box-shadow .2s ease-out,transform .15s ease-out}.ph-survey textarea,.ph-survey input[type=text]{transition:border-color .2s ease-out,box-shadow .2s ease-out,transform .15s ease-out}.ph-survey input{margin:0}.ph-survey textarea:focus,.ph-survey textarea:focus-visible,.ph-survey input[type=text]:focus,.ph-survey input[type=text]:focus-visible,.ph-survey .form-submit:focus,.ph-survey .form-submit:focus-visible,.ph-survey input[type=checkbox]:focus,.ph-survey input[type=radio]:focus,.ph-survey input[type=checkbox]:focus-visible,.ph-survey input[type=radio]:focus-visible{outline:1.5px solid var(--ph-survey-outline-color);border-color:var(--ph-survey-rating-active-bg-color);outline-offset:2px}.ph-survey textarea:focus:not(:focus-visible),.ph-survey input[type=text]:focus:not(:focus-visible),.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){outline:none}.ph-survey textarea:hover:not(:focus),.ph-survey input[type=text]:hover:not(:focus){border-color:var(--ph-survey-rating-active-bg-color)}@media (max-width:768px){.ph-survey textarea,.ph-survey input[type=text]{font-size:1rem}}.ph-survey .multiple-choice-options label,.ph-survey .rating-options-number,.ph-survey .form-cancel,.ph-survey input[type=checkbox],.ph-survey input[type=radio]{border:1.5px solid var(--ph-survey-border-color)}.ph-survey label,.ph-survey input[type=checkbox],.ph-survey input[type=radio],.ph-survey .ratings-emoji,.ph-survey .ratings-number,.ph-survey .footer-branding,.ph-survey .form-cancel,.ph-survey .form-submit{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);color:var(--ph-widget-text-color);text-align:center;cursor:pointer;z-index:var(--ph-survey-z-index);border:none;border-radius:3px 3px 0 0;padding:10px 12px;transition:padding .2s ease-out;position:fixed}.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{flex-direction:column;gap:16px;display:flex}.bottom-section{flex-direction:column;gap:8px;display:flex}.thank-you-message-header~.bottom-section,.intro-screen-header~.bottom-section{padding-top:16px}.question-container,.thank-you-message,.intro-screen{flex-direction:column;gap:8px;display:flex}.survey-question{font-size:14px;font-weight:500}.survey-question-description{opacity:.8;padding-top:4px;font-size:13px}.survey-question-description,.thank-you-message-body,.intro-screen-body{word-wrap:break-word;overflow-wrap:break-word}:is(.survey-question-description,.thank-you-message-body,.intro-screen-body) img,:is(.survey-question-description,.thank-you-message-body,.intro-screen-body) video,:is(.survey-question-description,.thank-you-message-body,.intro-screen-body) iframe,:is(.survey-question-description,.thank-you-message-body,.intro-screen-body) embed,:is(.survey-question-description,.thank-you-message-body,.intro-screen-body) object,:is(.survey-question-description,.thank-you-message-body,.intro-screen-body) svg{max-width:100%;height:auto}.question-textarea-wrapper{flex-direction:column;display:flex}.survey-form{animation:.3s ease-out forwards ph-survey-fade-in}.survey-form,.thank-you-message,.intro-screen{text-align:left;width:100%;z-index:var(--ph-survey-z-index);border:1.5px solid var(--ph-survey-border-color);border-bottom:var(--ph-survey-border-bottom);background:var(--ph-survey-background-color);border-radius:var(--ph-survey-border-radius);box-shadow:var(--ph-survey-box-shadow);padding:var(--ph-survey-box-padding);margin:0;position:relative}.survey-form textarea,.survey-form input[type=text]{min-width:100%}.survey-form textarea:focus,.survey-form textarea:focus-visible{box-shadow:0 4px 12px #00000014}.survey-form textarea:focus:not(:focus-visible){box-shadow:none}.survey-box .question-header--empty~.multiple-choice-options,.survey-box .question-header--empty~textarea{margin-top:0}.multiple-choice-options{border:none;flex-direction:column;gap:8px;margin:0;padding:1px 0;font-size:14px;display:flex}.multiple-choice-options label,.multiple-choice-options .response-choice{color:inherit;align-items:center;gap:8px;display:flex}.multiple-choice-options label{cursor:pointer;font-size:13px}.multiple-choice-options label:hover:not(:has(input:checked)){border-color:var(--ph-survey-text-subtle-color);box-shadow:0 2px 8px #00000014}.multiple-choice-options label:has(input:checked){border-color:var(--ph-survey-rating-active-bg-color);box-shadow:0 1px 4px #0000000d}.multiple-choice-options label.choice-option-open{flex-wrap:wrap}.multiple-choice-options label span{color:inherit}.multiple-choice-options input[type=checkbox],.multiple-choice-options input[type=radio]{-webkit-appearance:none;-moz-appearance:none;appearance:none;background:var(--ph-survey-input-background);cursor:pointer;z-index:1;border-radius:3px;flex-shrink:0;width:1rem;height:1rem;transition:all .2s cubic-bezier(.4,0,.2,1),transform .15s ease-out;position:relative}: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{border:solid var(--ph-survey-rating-active-text-color);border-width:0 2px 2px 0;width:4px;height:8px;animation:.2s ease-out .1s forwards ph-survey-checkmark-reveal;left:4px;transform:rotate(45deg)scale(0)}.multiple-choice-options input[type=radio]:checked:after{background:var(--ph-survey-rating-active-text-color);border-radius:50%;width:6px;height:6px;animation:.15s ease-out 50ms forwards ph-survey-radio-reveal;top:5px;left:5px;transform:scale(0)}.multiple-choice-options input[type=checkbox]:checked:after,.multiple-choice-options input[type=radio]:checked:after{content:"";box-sizing:content-box;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}.multiple-choice-options .choice-option-open input[type=text]::placeholder{color:var(--ph-survey-text-subtle-color);font-weight:400}.rating-options-emoji{justify-content:space-between;display:flex}.rating-options-emoji-2{justify-content:space-around}.ratings-emoji{opacity:.5;background-color:#0000;border:none;padding:0;font-size:16px}.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;grid-auto-columns:1fr;grid-auto-flow:column;display:grid;overflow:hidden}.rating-options-number .ratings-number{border-right:1px solid var(--ph-survey-border-color);text-align:center;cursor:pointer;color:var(--ph-survey-rating-text-color);border-top:none;border-bottom:none;border-left:none;font-weight:700}.rating-options-number .ratings-number:last-of-type{border-right:0}.rating-options-number .ratings-number.rating-active{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{opacity:.7;flex-direction:row;justify-content:space-between;font-size:11px;display:flex}.form-buttons{flex-direction:row;gap:8px;width:100%;display:flex}.form-buttons-with-back>.form-submit{flex:auto;min-width:0}.form-submit{text-align:center;cursor:pointer;user-select:none;background:var(--ph-survey-submit-button-color);color:var(--ph-survey-submit-button-text-color);border:none;border-radius:6px;min-width:100%;padding:12px;font-weight:700;box-shadow:0 2px #0000000b}.form-submit:not([disabled]):hover{transform:scale(1.02);box-shadow:0 4px 8px #0000001a}.form-submit:not([disabled]):active{transform:scale(.98);box-shadow:0 1px 2px #0000000d}.form-submit[disabled]{opacity:var(--ph-survey-disabled-button-opacity);cursor:not-allowed}.form-back{text-align:center;cursor:pointer;user-select:none;color:var(--ph-survey-text-primary-color);border:1.5px solid var(--ph-survey-border-color);background:0 0;border-radius:6px;flex:none;padding:12px 16px;font-weight:600}.form-back:hover{transform:scale(1.02)}.form-back:active{transform:scale(.98)}.validation-hint{opacity:.7;margin-top:4px;font-size:12px}.form-cancel{cursor:pointer;background:#fff;border-radius:100%;padding:12px;line-height:0;position:absolute;top:0;right:0;transform:translate(50%,-50%)}.form-cancel:hover{opacity:.7;transform:translate(50%,-50%)scale(1.1)}.footer-branding{opacity:.6;justify-content:center;align-items:center;gap:4px;font-size:11px;font-weight:500;text-decoration:none;display:flex}.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{opacity:.8;font-size:14px}.intro-screen{text-align:center;animation:.3s ease-out forwards ph-survey-fade-in}.intro-screen-header{margin:10px 0 0}.intro-screen-body{opacity:.8;font-size:14px}.limit-height{scrollbar-width:thin;scrollbar-color:var(--ph-survey-scrollbar-thumb-color) var(--ph-survey-scrollbar-track-color);max-height:256px;overflow:hidden auto}.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}.limit-height::-webkit-scrollbar-thumb:hover{background-color:var(--ph-survey-text-subtle-color)}.sr-only{clip:rect(0, 0, 0, 0);white-space:nowrap;border:0;width:1px;height:1px;margin:-1px;padding:0;position:absolute;overflow:hidden}@media (prefers-reduced-motion:reduce){.ph-survey *{scroll-behavior:auto!important;transition-duration:.01ms!important;animation-duration:.01ms!important;animation-iteration-count:1!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(l){var u=a.querySelector("style");u&&a.removeChild(u),a.appendChild(l)}return(i||kp.body).appendChild(o),{shadow:a,isNewlyCreated:!0}},Ep=t=>{var e=t.responses,i=t.survey,r=t.surveySubmissionId,s=t.posthog,o=t.isSurveyCompleted,a=t.properties,l=t.surveyLanguage,u=t.questionSnapshots;s?(zf(i),s.capture(Tf,n({[If]:i.name,[Mf]:i.id,[Ef]:i.current_iteration,[Rf]:i.current_iteration_start_date,[Pf]:r,[Ff]:o},l&&{[$f]:l},{sessionRecordingUrl:null==s.get_session_replay_url?void 0:s.get_session_replay_url()},aa(e,i,u),a,{$set:{[la(i,"responded")]:!0}})),o&&(wp.dispatchEvent(new CustomEvent("PHSurveySent",{detail:{surveyId:i.id}})),Vp(i),s.reloadFeatureFlags())):Nf.error("[survey sent] event not captured, PostHog instance not found.")},Rp=(t,e,i)=>{return n({[If]:t.name,[Mf]:t.id,[Ef]:t.current_iteration,[Rf]:t.current_iteration_start_date,[Af]:(r=null==e?void 0:e.responses,void 0===r&&(r={}),Object.values(r).some(t=>!Pe(t)))},(null==e?void 0:e.surveyLanguage)&&{[$f]:e.surveyLanguage},{sessionRecordingUrl:null==i.get_session_replay_url?void 0:i.get_session_replay_url(),[Pf]:null==e?void 0:e.surveySubmissionId},aa(null==e?void 0:e.responses,t,null==e?void 0:e.questionSnapshots));var r},Ap=(t,e,i,r)=>{if(e){if(!i){var s=Up(t),o=s?s.surveyLanguage:r;e.capture(Cf,n({},Rp(t,s,e),o&&{[$f]:o},{$set:{[la(t,"dismissed")]:!0}})),Vp(t),zf(t),wp.dispatchEvent(new CustomEvent("PHSurveyClosed",{detail:{surveyId:t.id}}))}}else Nf.error("[survey dismissed] event not captured, PostHog instance not found.")},Pp=(t,e)=>{if(e){var i=(t=>Bf("abandonedSurvey_",t))(t);try{if("true"===localStorage.getItem(i))return}catch(t){return}var r=Up(t);if(r){try{localStorage.setItem(i,"true")}catch(t){}e.capture("survey abandoned",Rp(t,r,e),{transport:"sendBeacon"})}}else Nf.error("[survey abandoned] event not captured, PostHog instance not found.")},Fp=t=>t.map(t=>({sort:Math.floor(10*Math.random()),value:t})).sort((t,e)=>t.sort-e.sort).map(t=>t.value),Op=(t,e)=>t.length===e.length&&t.every((t,i)=>t===e[i])?e.reverse():e,$p=t=>{var e=t.map(t=>t.id);return e.every(t=>!!t)?e:void 0},Dp=(t,e)=>{var i;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?Op(t.questions,Fp(t.questions)):t.questions},Lp=t=>pa(t)||Wp(t),Np=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,wc(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"+ic++,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}),qp=()=>Kc(Np),jp=t=>{var e=t.children,i=t.style;return function(t,e,i){var r,n,s,o,a=vc({},t.props);for(s in t.type&&t.type.defaultProps&&(o=t.type.defaultProps),e)"key"==s?r=e[s]:"ref"==s?n=e[s]:a[s]=void 0===e[s]&&null!=o?o[s]:e[s];return arguments.length>2&&(a.children=arguments.length>3?Hv.call(arguments,2):i),pc(t.type,a,r||t.key,n||t.ref,null)}(t.component,t.renderAsHtml?{dangerouslySetInnerHTML:{__html:e},style:i}:{children:e,style:i})};function Bp(t,e){var i,r;if(null==(i=t.conditions)||!i.url)return!0;var n,s=Zn(e);return!!s&&ya[n=null==(r=t.conditions)?void 0:r.urlMatchType,null!=n?n:"icontains"]([t.conditions.url],[s])}var Hp=t=>Bf("inProgressSurvey_",t),zp=(t,e)=>{try{localStorage.setItem(Hp(t),JSON.stringify(e))}catch(t){Nf.error("Error setting in-progress survey state in localStorage",t)}},Up=t=>{try{var e=localStorage.getItem(Hp(t));if(e)return JSON.parse(e)}catch(t){Nf.error("Error getting in-progress survey state from localStorage",t)}return null},Wp=t=>{var e=Up(t);return!Pe(null==e?void 0:e.surveySubmissionId)},Vp=t=>{try{localStorage.removeItem(Hp(t))}catch(t){Nf.error("Error clearing in-progress survey state from localStorage",t)}};function Gp(t,e){void 0===e&&(e=!1);var i="PostHogSurvey-"+t.id;return e?"."+i:i}function Zp(t,e,i){if(void 0===e&&(e=cf),t===mf)return{};switch(e){case"top_left":return{top:"0",left:"0",transform:"translate(30px, 30px)"};case"top_right":return{top:"0",right:"0",transform:"translate(-30px, 30px)"};case"top_center":return{top:"0",left:"50%",transform:"translate(-50%, 30px)"};case"middle_left":return{top:"50%",left:"0",transform:"translate(30px, -50%)"};case"middle_right":return{top:"50%",right:"0",transform:"translate(-30px, -50%)"};case"middle_center":return{top:"50%",left:"50%",transform:"translate(-50%, -50%)"};case df:return{left:"30px"};case vf:return{left:"50%",transform:"translateX(-50%)"};default:return{right:t===gf&&i===hf?"60px":"30px"}}}var Jp=0;function Qp(t,e,i,r,n,s){e||(e={});var o,a,l=e;if("ref"in l)for(a in l={},e)"ref"==a?o=e[a]:l[a]=e[a];var u={type:t,props:l,key:i,ref:o,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:--Jp,__i:-1,__u:0,__source:n,__self:s};if("function"==typeof t&&(o=t.defaultProps))for(a in o)void 0===l[a]&&(l[a]=o[a]);return zv.vnode&&zv.vnode(u),u}var Kp=Qp("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 -960 960 960",width:"48",children:Qp("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"})}),Xp=Qp("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 -960 960 960",width:"48",children:Qp("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"})}),Yp=Qp("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 -960 960 960",width:"48",children:Qp("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"})}),tg=Qp("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 -960 960 960",width:"48",children:Qp("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"})}),eg=Qp("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 -960 960 960",width:"48",children:Qp("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"})}),ig=Qp("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 0 24 24",width:"48",children:Qp("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"})}),rg=Qp("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 0 24 24",width:"48",children:Qp("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"})}),ng=Qp("svg",{width:"77",height:"14",viewBox:"0 0 77 14",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[Qp("g",{"clip-path":"url(#clip0_2415_6911)",children:[Qp("mask",{id:"mask0_2415_6911",style:{maskType:"luminance"},maskUnits:"userSpaceOnUse",x:"0",y:"0",width:"77",height:"14",children:Qp("path",{d:"M0.5 0H76.5V14H0.5V0Z",fill:"white"})}),Qp("g",{mask:"url(#mask0_2415_6911)",children:[Qp("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"}),Qp("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"}),Qp("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"}),Qp("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"}),Qp("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"}),Qp("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"})]})]}),Qp("defs",{children:Qp("clipPath",{id:"clip0_2415_6911",children:Qp("rect",{width:"76",height:"14",fill:"white",transform:"translate(0.5)"})})})]});function sg(t){var e=t.urlParams,i=e?Object.entries(e).map(t=>{var e=t[1];return encodeURIComponent(t[0])+"="+encodeURIComponent(e)}).join("&"):"";return Qp("a",{href:"https://posthog.com/surveys"+(i?"?"+i:""),target:"_blank",rel:"noopener",className:"footer-branding",children:["Survey by ",ng]})}function og(t){var e=t.text,i=t.submitDisabled,r=t.appearance,n=t.onSubmit,s=t.link,o=t.onPreviewSubmit,l=t.skipSubmitButton,u=t.canGoBack,h=t.onBack,d=Kc(Np).isPreviewMode,v=!!u&&!!h,c=!l&&Qp("button",{className:"form-submit",disabled:i,"aria-label":"Submit survey",type:"button",onClick(){s&&(null==a||a.open(s)),d?null==o||o():n()},children:e});return Qp("div",{className:"bottom-section",children:[v?Qp("div",{className:"form-buttons form-buttons-with-back",children:[Qp("button",{className:"form-back",type:"button","aria-label":"Go to previous question",onClick:h,children:r.backButtonText||"Back"}),c]}):c,!r.whiteLabel&&Qp(sg,{urlParams:{utm_source:"survey-footer"}})]})}function ag(t){var e=t.question,i=t.forceDisableHtml;return Qp("div",{class:e.question||e.description?"question-header":"question-header question-header--empty",children:[Qp(e.type===yf?"label":"h3",{className:"survey-question",htmlFor:t.htmlFor,children:e.question}),e.description&&jp({component:fc("p",{className:"survey-question-description"}),children:e.description,renderAsHtml:!i&&"text"!==e.descriptionContentType})]})}function lg(t){var e,i,r;return Qp("button",{className:"form-cancel",onClick:t.onClick,disabled:Kc(Np).isPreviewMode,"aria-label":"Close survey",type:"button",children:(e={fill:"black"},i=(void 0===e?{}:e).fill,r=void 0===i?"currentColor":i,Qp("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:r,xmlns:"http://www.w3.org/2000/svg","aria-labelledby":"close-survey-title-adam",children:[Qp("title",{id:"close-survey-title",className:"adam-testing",children:"Close survey"}),Qp("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:r})]}))})}var ug=a;function hg(t){var e=t.header,i=t.description,r=t.contentType,n=t.forceDisableHtml,s=t.appearance,o=t.onClose,a=Kc(Np).isPopup;return Zc(()=>{var t=t=>{"Enter"!==t.key&&"Escape"!==t.key||(t.preventDefault(),o())};return Dn(ug,"keydown",t),()=>{ug.removeEventListener("keydown",t)}},[o]),Qp("div",{className:"thank-you-message",role:"status",tabIndex:0,"aria-atomic":"true",children:[a&&!0!==s.hideCancelButton&&Qp(lg,{onClick:()=>o()}),Qp("h3",{className:"thank-you-message-header",children:e}),i&&jp({component:fc("p",{className:"thank-you-message-body"}),children:i,renderAsHtml:!n&&"text"!==r}),a&&Qp(og,{text:s.thankYouMessageCloseButtonText||"Close",submitDisabled:!1,appearance:s,onSubmit:()=>o()})]})}function dg(t){var e=t.header,i=t.description,r=t.contentType,n=t.forceDisableHtml,s=t.appearance,o=t.onStart,a=Kc(Np),l=a.onPreviewSubmit,u=a.onPopupSurveyDismissed;return Qp("div",{className:"intro-screen",role:"status",tabIndex:0,"aria-atomic":"true",children:[a.isPopup&&!0!==s.hideCancelButton&&Qp(lg,{onClick:()=>u()}),e&&Qp("h3",{className:"intro-screen-header",children:e}),i&&jp({component:fc("p",{className:"intro-screen-body"}),children:i,renderAsHtml:!n&&"text"!==r}),Qp(og,{text:s.introScreenButtonText||"Get started",submitDisabled:!1,appearance:s,onSubmit:o,onPreviewSubmit:()=>l(null)})]})}var vg=t=>xe(t)&&t.every(t=>Ee(t));function cg(t){var e=t.question,i=t.forceDisableHtml,r=t.appearance,n=t.onSubmit,s=t.onPreviewSubmit,o=t.displayQuestionIndex,a=t.initialValue,l=t.canGoBack,u=t.onBack,h=qp().isPreviewMode,d=Jc(null),v=Gc(()=>Ee(a)?a:""),c=v[0],f=v[1],p=null==r?void 0:r.disableAutofocus;Zc(()=>{p||setTimeout(()=>{var t;h||null==(t=d.current)||t.focus()},100)},[h,p]);var g="surveyQuestion"+o,m=Qc(()=>function(t,e,i){var r,n,s=t.trim();if(!i&&""===s)return"This field is required";if(""===s)return!1;if(e&&e.length>0)for(var o of e)switch(o.type){case me:if(void 0!==o.value&&o.value>s.length)return null!==(r=o.errorMessage)&&void 0!==r?r:"Please enter at least "+o.value+" characters";break;case ye:if(void 0!==o.value&&s.length>o.value)return null!==(n=o.errorMessage)&&void 0!==n?n:"Please enter no more than "+o.value+" characters"}return!1}(c,e.validation,e.optional),[c,e.validation,e.optional]),y=_n(e.validation,me),b=_n(e.validation,ye),_=Qc(()=>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 Qp(gc,{children:[Qp("div",{className:"question-container",children:[Qp(ag,{question:e,forceDisableHtml:i,htmlFor:g}),Qp("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}),_&&Qp("div",{className:"validation-hint",children:_})]}),Qp(og,{text:e.buttonText||"Submit",submitDisabled:!!m,appearance:r,onSubmit:w,onPreviewSubmit:k,canGoBack:l,onBack:u})]})}function fg(t){var e=t.question,i=t.appearance,r=t.onSubmit,n=t.onPreviewSubmit,s=t.canGoBack,o=t.onBack;return Qp(gc,{children:[Qp("div",{className:"question-container",children:Qp(ag,{question:e,forceDisableHtml:t.forceDisableHtml})}),Qp(og,{text:e.buttonText||"Submit",submitDisabled:!1,link:e.link,appearance:i,onSubmit:()=>r("link clicked"),onPreviewSubmit:()=>n("link clicked"),canGoBack:s,onBack:o})]})}function pg(t){var e,i=t.question,r=t.forceDisableHtml,n=t.displayQuestionIndex,s=t.appearance,o=t.onSubmit,a=t.onPreviewSubmit,l=t.initialValue,u=t.canGoBack,h=t.onBack,d=i.scale,v=10===i.scale?0:1,c=Gc(()=>Fe(l)?l:xe(l)&&l.length>0&&Fe(parseInt(l[0]))?parseInt(l[0]):Ee(l)&&Fe(parseInt(l))?parseInt(l):null),f=c[0],p=c[1],g="emoji"===i.display&&2===i.scale,m=qp().isPreviewMode,y=t=>m?a(t):o(t);return Qp(gc,{children:[Qp("div",{className:"question-container",children:[Qp(ag,{question:i,forceDisableHtml:r}),Qp("div",{className:"rating-section",children:[Qp("div",{className:"rating-options",children:["emoji"===i.display&&Qp("div",{className:"rating-options-emoji"+(g?" rating-options-emoji-2":""),children:null==(e=wg[i.scale])?void 0:e.map((t,e)=>Qp("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&&Qp("div",{className:"rating-options-number",style:{gridTemplateColumns:"repeat("+(d-v+1)+", minmax(0, 1fr))"},children:kg(i.scale).map((t,e)=>Qp(gg,{displayQuestionIndex:n,active:f===t,appearance:s,num:t,setActiveNumber(t){p(t),i.skipSubmitButton&&y(t)}},e))})]}),!g&&Qp("div",{className:"rating-text",children:[Qp("div",{children:i.lowerBoundLabel}),Qp("div",{children:i.upperBoundLabel})]})]})]}),Qp(og,{text:i.buttonText||(null==s?void 0:s.submitButtonText)||"Submit",submitDisabled:Ae(f)&&!i.optional,appearance:s,onSubmit:()=>o(f),onPreviewSubmit:()=>a(f),skipSubmitButton:i.skipSubmitButton,canGoBack:u,onBack:h})]})}function gg(t){var e=t.num,i=t.setActiveNumber;return Qp("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 mg(t){var e=t.question,i=t.forceDisableHtml,r=t.displayQuestionIndex,s=t.appearance,o=t.onSubmit,a=t.onPreviewSubmit,l=t.initialValue,u=t.canGoBack,h=t.onBack,d=Jc(null),v=Qc(()=>(t=>{if(!t.shuffleOptions)return t.choices;var e=t.choices,i="";t.hasOpenChoice&&(i=e.pop());var r=Op(e,Fp(e));return t.hasOpenChoice&&(t.choices.push(i),r.push(i)),r})(e),[e]),c=Gc(()=>((t,e)=>Ee(t)||vg(t)?t:e===_f?null:[])(l,e.type)),f=c[0],p=c[1],g=Gc(()=>((t,e)=>{if(Ee(t)&&!e.includes(t))return{isSelected:!0,inputValue:t};if(vg(t)){var i=t.find(t=>!e.includes(t));if(i)return{isSelected:!0,inputValue:i}}return{isSelected:!1,inputValue:""}})(l,v)),m=g[0],y=g[1],b=qp().isPreviewMode,_=e.type===_f,w=e.type===bf,k=e.skipSubmitButton&&_&&!e.hasOpenChoice,S=(t,e)=>{if(e){var i=!m.isSelected;return y(t=>n({},t,{isSelected:i,inputValue:i?t.inputValue:""})),_&&p(""),void(i&&setTimeout(()=>{var t;return null==(t=d.current)?void 0:t.focus()},75))}if(_)return p(t),y(t=>n({},t,{isSelected:!1,inputValue:""})),void(k&&(o(t),b&&a(t)));w&&xe(f)&&(f.includes(t)?p(f.filter(e=>e!==t)):p([...f,t]))},x=t=>{t.stopPropagation();var e=t.currentTarget.value;y(t=>n({},t,{inputValue:e})),_&&p(e)},C=t=>{t.stopPropagation(),"Enter"!==t.key||T()||(t.preventDefault(),M()),"Escape"===t.key&&(t.preventDefault(),y(t=>n({},t,{isSelected:!1,inputValue:""})),_&&p(null))},T=()=>!(e.optional||!Ae(f)&&(!xe(f)||m.isSelected||0!==f.length)&&(!m.isSelected||""!==m.inputValue.trim())),M=()=>{m.isSelected&&w?xe(f)&&(b?a([...f,m.inputValue]):o([...f,m.inputValue])):b?a(f):o(f)};return Qp(gc,{children:[Qp("div",{className:"question-container",children:[Qp(ag,{question:e,forceDisableHtml:i}),Qp("fieldset",{className:"multiple-choice-options limit-height",children:[Qp("legend",{className:"sr-only",children:w?" Select all that apply":" Select one"}),v.map((t,i)=>{var n=!!e.hasOpenChoice&&i===e.choices.length-1,s="surveyQuestion"+r+"Choice"+i,o=s+"Open",a=n?m.isSelected:_?f===t:xe(f)&&f.includes(t);return Qp("label",{className:n?"choice-option-open":"",children:[Qp("div",{className:"response-choice",children:[Qp("input",{type:_?"radio":"checkbox",name:s,checked:a,onChange:()=>S(t,n),id:s,"aria-controls":o}),Qp("span",{children:n?t+":":t})]}),n&&Qp("input",{type:"text",ref:d,id:o,name:"question"+r+"Open",value:m.inputValue,onKeyDown:C,onInput:x,onClick(e){m.isSelected||S(t,!0),e.stopPropagation()},"aria-label":t+" - please specify"})]},i)})]})]}),Qp(og,{text:e.buttonText||"Submit",submitDisabled:T(),appearance:s,onSubmit:M,onPreviewSubmit:M,skipSubmitButton:k,canGoBack:u,onBack:h})]})}var yg=[1,2,3,4,5],bg=[1,2,3,4,5,6,7],_g=[0,1,2,3,4,5,6,7,8,9,10],wg={2:[ig,rg],3:[Yp,Xp,Kp],5:[tg,Yp,Xp,Kp,eg]};function kg(t){switch(t){case 5:default:return yg;case 7:return bg;case 10:return _g}}var Sg=Cn("[Surveys]");function xg(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?kf:s;if(n.branching.type===kf)return kf;if("specific_question"===n.branching.type){if(Number.isInteger(n.branching.index))return n.branching.index}else if("response_based"===n.branching.type){if(n.type===_f){var o,a=n.choices.indexOf(""+i);if(-1===a&&n.hasOpenChoice&&(a=n.choices.length-1),null!=(o=n.branching)&&null!=(o=o.responseValues)&&o.hasOwnProperty(a)){var l=n.branching.responseValues[a];return Number.isInteger(l)?l:l===kf?kf:s}}else if(n.type===wf){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===kf?kf:s}}return s}return Sg.warn("Falling back to next question index due to unexpected branching type"),s}var Cg=Cn("[SurveyTranslations]");function Tg(t,e){var i=function(t){return function(t,e){var i=t.storedPersonProperties,r=t.locale,n=ua(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?ua(t.language):null}(i);if(s)return null==e||e.info("Using person property language: "+s),s;var o=ua(r);return o?(null==e||e.info("Using detected locale: "+o),o):(null==e||e.info("No user language detected"),null)}({overrideLanguage:t.config.override_display_language,storedPersonProperties:Ce(t.get_property)?t.get_property(vt):void 0,locale:Da()},Cg)}(e);if(!i)return Cg.info("No user language detected"),{survey:t,language:null};var r=ca(t,i,Cg);return{survey:r.survey,language:r.matchedKey}}var Mg=a,Ig=h,Eg="ph:show_survey_widget",Rg="PHWidgetSurveyClickListener";function Ag(t,e){try{var i=t.getBoundingClientRect(),r=Mg.innerHeight,n=Mg.innerWidth,s=i.left+i.width/2-e/2;s+e>n-20&&(s=n-e-20),20>s&&(s=20);var o=r-i.bottom,a=250>o&&i.top>o;return{position:"fixed",top:a?"auto":i.bottom+12+"px",left:s+"px",right:"auto",bottom:a?r-i.top+12+"px":"auto",zIndex:xp.zIndex}}catch(t){return Nf.warn("Failed to calculate trigger position:",t),null}}var Pg=class{constructor(t){var e=this;this.fi=new Map,this.pi=new Map,this.gi=new Map,this.mi=new Set,this.yi=null,this.bi=!1,this.wi=null,this.ki=null,this.Si=null,this.handlePageUnload=()=>{var t=this._posthog.get_property(pt);if(t)for(var e of t)Wp(e)&&Pp(e,this._posthog)},this.handlePopoverSurvey=function(t,i,r){var s,o,a,l,u,h=(void 0===r?{}:r).resumeDelayFromActivation,d=void 0!==h&&h,v=e.xi(t),c=v.survey,f=v.language;e.yi=f,e.Si=null,e.Ci=i;var p=e.Mi(c,i);e.Ti(p.id);var g=null!=i?i:{},m=g.properties,y=g.initialResponses,b=!(!y||0>=Object.keys(y).length)&&e.Ii(p,y,m,f);if(!b||null!=(s=p.appearance)&&s.displayThankYouMessage){e.Ri(p);var _={};if((null==(o=p.appearance)?void 0:o.position)===ff&&null!=(a=p.appearance)&&a.widgetSelector){var w,k=Ig.querySelector(p.appearance.widgetSelector);k&&(_=Ag(k,parseInt((null==(w=p.appearance)?void 0:w.maxWidth)||xp.maxWidth))||{})}var S=(null==(l=p.appearance)?void 0:l.surveyPopupDelaySeconds)||0,x=Ip(p,e._posthog).shadow;e.gi.set(x,x.host);var C={posthog:e._posthog,survey:p,removeSurveyFromFocus:e.Ai,properties:m,style:_,isSurveyCompleted:b,skipShownEvent:null==i?void 0:i.skipShownEvent,surveyLanguage:f};if(e.Si=C,0>=S)return e.bi=!0,Dc(Qp(Lg,n({},C)),x);var T=()=>{if(!e.Ei(p))return Nf.info("Survey "+p.id+" no longer eligible when its display delay elapsed; not displaying"),e.Ai(p);(()=>{e.bi=!0;var r=e.xi(t),s=r.survey,o=r.language;e.yi=o;var a=e.Mi(s,i),l=n({},C,{survey:a,surveyLanguage:o});e.Si=l,Dc(Qp(Lg,n({},l,{survey:n({},a,{appearance:n({},a.appearance,{surveyPopupDelaySeconds:0})})})),x)})()},M=d?null==(u=e._posthog.surveys)||null==(u=u._surveyEventReceiver)||null==u.getActivationTimestamp?void 0:u.getActivationTimestamp(p.id):void 0,I=Fe(M)?Math.max(0,Date.now()-M):0,E=Math.max(0,1e3*S-I);if(0>=E)return T();var R=Mg.setTimeout(()=>{e.fi.delete(p.id),T()},E);e.fi.set(p.id,R)}},this.Li=t=>{var e=this.xi(t),i=e.survey,r=e.language,n=Ip(i,this._posthog),s=n.shadow,o=n.isNewlyCreated;this.gi.set(s,s.host),o&&Dc(Qp(qg,{posthog:this._posthog,survey:i,surveyLanguage:r},t.id),s)},this.Oi=t=>{var e=this.pi.get(t);e&&(e.element.removeEventListener("click",e.listener),e.element.removeAttribute(Rg),this.pi.delete(t),Nf.info("Removed click listener for survey "+t))},this.Di=t=>{this.Pi(t)||(this.Fi(t),this.Oi(t.id))},this.Pi=t=>{try{var e;return!(null==(e=Ig.querySelector(Gp(t,!0)))||null==(e=e.shadowRoot)||!e.querySelector(".ph-survey"))}catch(t){return!1}},this.Ni=(t,e)=>{var i=Ig.querySelector(e),r=this.pi.get(t.id);if(i){if(this.Li(t),r){if(i===r.element)return;Nf.info("Selector element changed for survey "+t.id+". Re-attaching listener."),this.Oi(t.id)}if(!i.hasAttribute(Rg)){var n=e=>{var i,r;e.stopPropagation();var n=(null==(i=t.appearance)?void 0:i.position)===ff?Ag(e.currentTarget,parseInt((null==(r=t.appearance)?void 0:r.maxWidth)||xp.maxWidth)):{};Mg.dispatchEvent(new CustomEvent(Eg,{detail:{surveyId:t.id,position:n}}))};Dn(i,"click",n),i.setAttribute(Rg,"true"),this.pi.set(t.id,{element:i,listener:n,survey:t}),Nf.info("Attached click listener for feedback button survey "+t.id)}}else r&&this.Di(t)},this.renderPopover=t=>{var e=this.xi(t),i=e.survey,r=e.language,n=Ip(i,this._posthog).shadow;this.gi.set(n,n.host),Dc(Qp(Lg,{posthog:this._posthog,survey:i,removeSurveyFromFocus:this.Ai,surveyLanguage:r}),n)},this.renderSurvey=(t,e,i)=>{var r,n=this.xi(t),s=n.survey,o=n.language,a=!1;null!=(r=this._posthog.config)&&null!=(r=r.surveys)&&r.prefillFromUrl&&(a=this.qi(s,o,i)),Dc(Qp(Lg,{posthog:this._posthog,survey:s,removeSurveyFromFocus:this.Ai,isPopup:!1,properties:i,isSurveyCompleted:a,surveyLanguage:o}),e)},this.getActiveMatchingSurveys=function(t,i){var r;void 0===i&&(i=!1),null==(r=e._posthog)||null==(r=r.surveys)||r.getSurveys(i=>{t(i.filter(t=>e.Ei(t)))},i)},this.callSurveysAndEvaluateDisplayLogic=function(t){void 0===t&&(t=!1),e.getActiveMatchingSurveys(t=>{var i=t.filter(t=>t.type===pf||t.type===gf),r=new Set(i.map(t=>t.id));for(var n of Array.from(e.fi.keys()))r.has(n)||e.cancelSurvey(n);var s=e.ji(i),o=new Set;s.forEach(t=>{if(t.type===gf){var i,r,n,s;if((null==(i=t.appearance)?void 0:i.widgetType)===hf)return void e.Li(t);"selector"===(null==(r=t.appearance)?void 0:r.widgetType)&&null!=(n=t.appearance)&&n.widgetSelector&&(o.add(t.id),e.Ni(t,null==(s=t.appearance)?void 0:s.widgetSelector))}Ae(e.Bi)&&t.type===pf&&e.handlePopoverSurvey(t,void 0,{resumeDelayFromActivation:!0})}),e.pi.forEach(t=>{var i=t.survey;o.has(i.id)||e.Di(i)})},t)},this.Ri=t=>{Ae(this.Bi)||Nf.error("Survey "+this.Bi+" already in focus. Cannot add survey "+t.id+"."),this.Bi=t.id},this.Ai=t=>{this.Bi!==t.id&&Nf.error("Survey "+t.id+" is not in focus. Cannot remove survey "+t.id+"."),this.Ti(t.id),this.Bi=null,this.yi=null,this.bi=!1,this.Si=null,this.Ci=void 0,this.Fi(t)},this._posthog=t,this.Bi=null,this.wi=()=>this.Hi(),Dn(Mg,"languagechange",this.wi),this.ki=t.onFeatureFlags(()=>this.Hi())}Hi(){var t;if(!Ae(this.Bi)){var e=null==(t=this._posthog.get_property(pt))?void 0:t.find(t=>t.id===this.Bi);if(e){var i=this.xi(e),r=i.survey,s=i.language;if(s!==this.yi&&(this.yi=s,this.bi)){var o=this.Mi(r,this.Ci),a=Ip(o,this._posthog).shadow;Dc(Qp(Lg,n({},this.Si,{posthog:this._posthog,survey:o,removeSurveyFromFocus:this.Ai,surveyLanguage:s})),a)}}}}get $i(){var t,e,i;return null!==(t=null==(e=(i=this._posthog).getExtension)?void 0:e.call(i,"featureFlags"))&&void 0!==t?t:this._posthog.featureFlags}Mi(t,e){return null!=e&&e.position||null!=e&&e.selector?n({},t,{appearance:n({},t.appearance,e.position&&{position:e.position},e.selector&&{widgetSelector:e.selector})}):t}Ti(t){var e=this.fi.get(t);e&&(clearTimeout(e),this.fi.delete(t))}cancelSurvey(t){this.fi.has(t)&&(Nf.info("Cancelled pending survey "+t),this.Ti(t),this.Bi===t&&(this.Bi=null,this.yi=null,this.bi=!1,this.Si=null,this.Ci=void 0))}setAutomaticDisplayDispose(t){this.Ui=t}dispose(){var t;null==(t=this.Ui)||t.call(this),this.Ui=void 0,this.wi&&(Mg.removeEventListener("languagechange",this.wi),this.wi=null),this.ki&&(this.ki(),this.ki=null),this.fi.forEach((t,e)=>this.Ti(e)),this.pi.forEach((t,e)=>this.Oi(e)),this.gi.forEach((t,e)=>{Dc(null,e),null==t||t.remove()}),this.gi.clear(),this.Bi=null}ji(t){return t.sort((t,e)=>{var i,r,n=Wp(t),s=Wp(e);if(n&&!s)return-1;if(!n&&s)return 1;var o=t.schedule===Sf,a=e.schedule===Sf;return o&&!a?1:!o&&a?-1:((null==(i=t.appearance)?void 0:i.surveyPopupDelaySeconds)||0)-((null==(r=e.appearance)?void 0:r.surveyPopupDelaySeconds)||0)})}xi(t){return Tg(t,this._posthog)}qi(t,e,i){if(this.mi.has(t.id))return!1;var r=function(t){var e={},i=!1,r=t.replace(/^\?/,"");if(!r)return{params:e,autoSubmit:i};for(var n of r.split("&")){var s=n.split("="),o=s[0],a=s[1];if(o&&!Ie(a)){var l=decodeURIComponent(o),u=decodeURIComponent(a);if("auto_submit"!==l||"true"!==u){var h=l.match(/^q(\d+)$/);if(h){var d=parseInt(h[1],10);e[d]||(e[d]=[]),e[d].push(u)}}else i=!0}}return{params:e,autoSubmit:i}}(Mg.location.search).params;if(0===Object.keys(r).length)return!1;Nf.info("[Survey Prefill] Detected URL prefill parameters");var n=this.zi(t,r,e);return!!n&&(this.Wi(t,n,i,e),this.mi.add(t.id),n.isSurveyCompleted)}Wi(t,e,i,r){var n=e.responses,s=e.submissionId,o=e.isSurveyCompleted,a=e.skippedResponses;(Object.keys(a).length>0&&t.enable_partial_responses||o)&&Ep({responses:o?n:a,survey:t,surveySubmissionId:s,posthog:this._posthog,isSurveyCompleted:o,properties:i,surveyLanguage:r})}Ii(t,e,i,r){var n={};for(var s of Object.entries(e)){var o=s[1];n[parseInt(s[0])]=xe(o)?o.map(String):[String(o)]}Nf.info("[Survey] Processing initial responses");var a=this.zi(t,n,r);return!!a&&(this.Wi(t,a,i,r),a.isSurveyCompleted)}zi(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=sa(t.id);try{switch(t.type){case _f:if(!t.choices||0===t.choices.length)return void xn.warn("[Survey Prefill] Question "+r+" has no choices");var o=parseInt(n[0],10);if(isNaN(o)||0>o||o>=t.choices.length)return void xn.warn("[Survey Prefill] Invalid choice index for q"+r+": "+n[0]);i[s]=t.choices[o];break;case bf:if(!t.choices||0===t.choices.length)return void xn.warn("[Survey Prefill] Question "+r+" has no choices");var a=n.map(t=>parseInt(t,10)).filter(e=>!isNaN(e)&&e>=0&&t.choices.length>e);if(0===a.length)return void xn.warn("[Survey Prefill] No valid choices for q"+r);var l=[...new Set(a.map(e=>t.choices[e]))];a.length>l.length&&xn.warn("[Survey Prefill] Removed duplicate choices for q"+r),i[s]=l;break;case wf:var u=parseInt(n[0],10),h=t.scale||10;if(isNaN(u)||0>u||u>h)return void xn.warn("[Survey Prefill] Invalid rating for q"+r+": "+n[0]+" (scale: 0-"+h+")");i[s]=u;break;default:xn.info("[Survey Prefill] Question type "+t.type+" does not support prefill")}}catch(t){xn.error("[Survey Prefill] Error converting q"+r+":",t)}}}),i}(t,e);if(0===Object.keys(r).length)return Nf.warn("[Survey Prefill] No valid responses after conversion"),null;var n=Xf(),s=function(t,e,i){for(var r=0,n={},s=[],o=t.questions.length+1,a=0;t.questions.length>r&&o>a&&(a++,e.includes(r));){var l=t.questions[r];if(!l||!("skipSubmitButton"in l)||!l.skipSubmitButton)break;if(l.id){var u=sa(l.id);Ie(i[u])||(n[u]=i[u])}s.push(r);var h=xg(t,r,l.id?i[sa(l.id)]:null);if(h===kf)return{startQuestionIndex:t.questions.length,skippedResponses:n,skippedIndices:s};r=h}return{startQuestionIndex:r,skippedResponses:n,skippedIndices:s}}(t,Object.keys(e).map(t=>parseInt(t,10)),r),o=s.startQuestionIndex,a=s.skippedResponses,l=s.skippedIndices,u=o>=t.questions.length;return zp(t,{surveySubmissionId:n,responses:r,lastQuestionIndex:o,questionOrder:$p(t.questions),visitedIndices:l,surveyLanguage:i}),Nf.info("[Survey Prefill] Stored prefilled responses in localStorage"),{responses:r,submissionId:n,startQuestionIndex:o,isSurveyCompleted:u,skippedResponses:a}}catch(t){return Nf.error("[Survey Prefill] Error handling prefill:",t),null}}Vi(t,e){if(void 0===e&&(e=void 0),!t)return!0;var i=this.$i,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}Zi(t){return!t.conditions||Bp(t,this._posthog)&&function(t){var e,i;return function(t,e){var i,r,n;if(!t||0===t.length)return!0;if(!g)return!1;var s=Ji(g,{userAgentDataPlatform:null==u||null==(i=u.userAgentData)?void 0:i.platform,maxTouchPoints:null==u?void 0:u.maxTouchPoints,screenWidth:null==a||null==(r=a.screen)?void 0:r.width,screenHeight:null==a||null==(n=a.screen)?void 0:n.height,devicePixelRatio:null==a?void 0:a.devicePixelRatio});return ya[null!=e?e:"icontains"](t,[s])}(null==(e=t.conditions)?void 0:e.deviceTypes,null==(i=t.conditions)?void 0:i.deviceTypesMatchType)}(t)&&function(t){var e;return null==(e=t.conditions)||!e.selector||!(null==kp||!kp.querySelector(t.conditions.selector))}(t)}Gi(t){var e;return Lp(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.$i)&&e.hasLoadedFlags?{satisfied:this.Vi(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(!qf(t))return r.eligible=!1,r.reason="Survey is not running. It was completed on "+t.end_date,r;if(!Uf.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.Vi(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.Vi(t.targeting_flag_key))return r.eligible=!1,r.reason="Survey targeting feature flag is not enabled",r;var s,o=this.Gi(t);return o.satisfied?function(t,e){if(!t||!e)return!0;var i="string"==typeof e?new Date(e):e,r=Math.abs((new Date).getTime()-i.getTime());return Math.ceil(r/864e5)>t}(null==(i=t.conditions)?void 0:i.seenSurveyWaitPeriodInDays,sp.li("lastSeenSurveyDate"))?(t=>!!sp.li(Hf(t))&&!Lp(t))(t)?(r.eligible=!1,r.reason="Survey has already been seen and it can't be activated again",r):r:(r.eligible=!1,r.reason="Survey wait period has not passed",r):(r.eligible=!1,r.reason=null!==(s=o.reason)&&void 0!==s?s:"Survey internal targeting flag is not enabled and survey cannot activate repeatedly and survey is not in progress",r)}checkSurveyRenderability(t){var e=this.checkSurveyEligibility(t);return e.eligible&&!this.Qi(t)?{eligible:!1,reason:"Survey event/action trigger has not been fired yet"}:e}Qi(t){var e;return!fa(t)&&!jf(t)||!(null==(e=this._posthog.surveys)||null==(e=e._surveyEventReceiver)||null==(e=e.getSurveys())||!e.includes(t.id))}Ji(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.Vi(e)})}Ei(t){return this.checkSurveyEligibility(t).eligible&&this.Zi(t)&&this.Qi(t)&&this.Ji(t)}Fi(t){try{var e=Ig.querySelector(Gp(t,!0));null!=e&&e.shadowRoot&&(Dc(null,e.shadowRoot),this.gi.delete(e.shadowRoot)),null==e||e.remove()}catch(e){Nf.warn("Failed to remove survey "+t.id+" from DOM:",e)}}getTestAPI(){return{addSurveyToFocus:this.Ri,removeSurveyFromFocus:this.Ai,surveyInFocus:this.Bi,surveyTimeouts:this.fi,handleWidget:this.Li,handlePopoverSurvey:this.handlePopoverSurvey,manageWidgetSelectorListener:this.Ni,sortSurveysByAppearanceDelay:this.ji,checkFlags:this.Ji.bind(this),isSurveyFeatureFlagEnabled:this.Vi.bind(this),onLanguageChange:this.Hi.bind(this),currentLanguage:this.yi,surveyIsRendered:this.bi}}};function Fg(t,e){if(Ig&&Mg){var i,r=new Pg(t);if(t.config.disable_surveys_automatic_display)return Nf.info("Surveys automatic display is disabled. Skipping call surveys and evaluate display logic."),r;if(!1===e)return Nf.info("There are no surveys to load or Surveys is disabled in the project settings."),r;r.callSurveysAndEvaluateDisplayLogic(!0);var n=()=>{Ie(i)&&(i=setInterval(()=>{r.callSurveysAndEvaluateDisplayLogic(!1)},1e3))},s=()=>{Ie(i)||(clearInterval(i),i=void 0)};n();var o=()=>{Ig.hidden?s():(r.callSurveysAndEvaluateDisplayLogic(!1),n())};return Dn(Ig,"visibilitychange",o),r.setAutomaticDisplayDispose(()=>{s(),Ig.removeEventListener("visibilitychange",o)}),r}}function Og(t){var e=t.survey,i=t.removeSurveyFromFocus,r=void 0===i?()=>{}:i,n=t.setSurveyVisible,s=t.isPreviewMode,o=void 0!==s&&s,a=t.posthog;Zc(()=>{var t;if(!o&&null!=(t=e.conditions)&&t.url){var i=()=>{var t,i=e.type===gf,s=Bp(e,a),o=(null==(t=e.appearance)?void 0:t.widgetType)===hf&&i;if(!s)return Nf.info("Hiding survey "+e.id+" because URL does not match"),n(!1),r(e);o&&(Nf.info("Showing survey "+e.id+" because it is a feedback button tab and URL matches"),n(!0))};Dn(Mg,"popstate",i),Dn(Mg,"hashchange",i);var s=Mg.history.pushState,l=Mg.history.replaceState;return Mg.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()},Mg.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()},()=>{Mg.removeEventListener("popstate",i),Mg.removeEventListener("hashchange",i),Mg.history.pushState=s,Mg.history.replaceState=l}}},[o,e,r,n,a])}var $g=200;function Dg(t){switch(void 0===t&&(t="right"),t){case"top":return{top:"0",left:"50%",transform:"translateX(-50%)"};case"left":return{top:"50%",left:"0",transform:"rotate(90deg) translateY(-100%)",transformOrigin:"left top"};case"bottom":return{bottom:"0",left:"50%",transform:"translateX(-50%)"};default:return{top:"50%",right:"0",transform:"rotate(-90deg) translateY(-100%)",transformOrigin:"right top"}}}function Lg(t){var e,i,r,s,o,a,l,u,h,d,v,c,f=t.survey,p=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,I=t.onPopupSurveyDismissed,E=void 0===I?()=>{}:I,R=t.onCloseConfirmationMessage,A=void 0===R?()=>{}:R,P=t.properties,F=t.isSurveyCompleted,O=t.skipShownEvent,D=t.surveyLanguage,L=Jc(null),N=Number.isInteger(b),q=function(t,e,i,r,s,o,a,l,u){var h=Gc(r||0===i||t.type===mf),d=h[0],v=h[1],c=Gc(!1),f=c[0],p=c[1],g=Jc(!1),m=()=>{var e=()=>{o&&s(t),v(!1)};if(!g.current){var i=null==a?void 0:a.current;i?(g.current=!0,i.style.transition="opacity "+$g+"ms ease-out",i.style.opacity="0",setTimeout(()=>{g.current=!1,e()},250)):e()}},y=e=>{e.detail.surveyId===t.id&&m()};return Zc(()=>{if(e){if(!r){var s,o=e=>{var i,r;if(e.detail.surveyId===t.id){if(null==(i=t.appearance)||!i.displayThankYouMessage)return m();p(!0),null!=(r=t.appearance)&&r.autoDisappear&&(s&&clearTimeout(s),s=setTimeout(m,5e3))}},a=()=>{if(Bp(t,e)){v(!0),Mg.dispatchEvent(new Event("PHSurveyShown")),l||e.capture(xf,n({[If]:t.name,[Mf]:t.id,[Ef]:t.current_iteration,[Rf]:t.current_iteration_start_date},u&&{[$f]:u},{sessionRecordingUrl:null==e.get_session_replay_url?void 0:e.get_session_replay_url()}));try{localStorage.setItem("lastSeenSurveyDate",(new Date).toISOString())}catch(t){}}};Dn(Mg,"PHSurveyClosed",y),Dn(Mg,"PHSurveySent",o);var h=i>0?setTimeout(a,i):void 0;return Ie(h)&&a(),()=>{Ie(h)||clearTimeout(h),Ie(s)||clearTimeout(s),Mg.removeEventListener("PHSurveyClosed",y),Mg.removeEventListener("PHSurveySent",o)}}}else Nf.error("usePopupVisibility hook called without a PostHog instance.")},[]),Og({survey:t,removeSurveyFromFocus:s,setSurveyVisible:v,isPreviewMode:r,posthog:e}),{isPopupVisible:d,isSurveySent:f,setIsPopupVisible:v,hidePopupWithAnimation:m}}(f,g,null!=(e=f.appearance)&&e.surveyPopupDelaySeconds?1e3*f.appearance.surveyPopupDelaySeconds:0,N,w,S,L,O,D),j=q.isPopupVisible,B=q.hidePopupWithAnimation,H=q.isSurveySent||b===f.questions.length||!0===F,z=Gc(!1),U=z[0],W=z[1],V=Qc(()=>!!Up(f),[f]),G=!!(null!=(i=f.appearance)&&i.introScreenHeader||null!=(r=f.appearance)&&r.introScreenDescription),Z=N?-1===b:!(null==(s=f.appearance)||!s.displayIntroScreen)&&G&&!U&&!V,J=Qc(()=>{var t,e=(null==(t=Up(f))?void 0:t.surveySubmissionId)||Xf();return{isPreviewMode:N,previewPageIndex:b,onPopupSurveyDismissed(){D?Ap(f,g,N,D):Ap(f,g,N),E()},isPopup:S||!1,surveySubmissionId:e,onPreviewSubmit:C,onPreviewBack:M,posthog:g,properties:P,surveyLanguage:D}},[N,b,S,g,f,E,C,M,P,D]);return j?Qp(Np.Provider,{value:J,children:Qp("div",{className:"ph-survey",style:n({},Zp(f.type,null==(o=f.appearance)?void 0:o.position,null==(a=f.appearance)?void 0:a.widgetType),y),ref:L,children:H?Qp(hg,{header:(null==(l=f.appearance)?void 0:l.thankYouMessageHeader)||"Thank you!",description:(null==(u=f.appearance)?void 0:u.thankYouMessageDescription)||"",forceDisableHtml:!!p,contentType:null==(h=f.appearance)?void 0:h.thankYouMessageDescriptionContentType,appearance:f.appearance||xp,onClose(){B(),A()}}):Z?Qp(dg,{header:(null==(d=f.appearance)?void 0:d.introScreenHeader)||"",description:(null==(v=f.appearance)?void 0:v.introScreenDescription)||"",forceDisableHtml:!!p,contentType:null==(c=f.appearance)?void 0:c.introScreenDescriptionContentType,appearance:f.appearance||xp,onStart:()=>W(!0)}):Qp(Ng,{survey:f,forceDisableHtml:!!p,posthog:g})})}):null}function Ng(t){var e,i,r=t.survey,s=t.forceDisableHtml,o=t.posthog,a=Qc(()=>{var t=Up(r);if(!t)return null;var e=Fe(t.lastQuestionIndex);return!e||e&&t.lastQuestionIndex>=0&&r.questions.length>t.lastQuestionIndex?t:(Vp(r),null)},[r]),l=Gc(()=>(null!=a&&a.responses&&Nf.info("Survey is already in progress, filling in initial responses"),(null==a?void 0:a.responses)||{})),u=l[0],h=l[1],d=Kc(Np),v=d.previewPageIndex,c=d.onPopupSurveyDismissed,f=d.isPopup,p=d.onPreviewSubmit,g=d.onPreviewBack,m=d.surveySubmissionId,y=d.isPreviewMode,b=d.properties,_=d.surveyLanguage,w=Gc(()=>{var t=null==a?void 0:a.lastQuestionIndex,e=Fe(t)&&t>=0&&r.questions.length>t?t:0;return Fe(v)&&v>=0?v:e}),k=w[0],S=w[1],x=Gc(()=>{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=Gc(()=>{var t,e;return null!==(t=null==(e=Up(r))?void 0:e.questionSnapshots)&&void 0!==t?t:{}}),I=M[0],E=M[1],R=Qc(()=>$p(Dp(r,a)),[r.id,a]),A=Qc(()=>{if(!R||new Set(R).size!==R.length)return Dp(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]);Zc(()=>{!y||Ie(v)||0>v||S(v)},[v,y]);var P=!(null==(e=r.appearance)||!e.allowGoBack)&&(y?(null!=v?v:0)>0:C.length>0),F=A.at(k);return F?Qp("form",{className:"survey-form",name:"surveyForm",children:[f&&!0!==(null==(i=r.appearance)?void 0:i.hideCancelButton)&&Qp(lg,{onClick(){c()}}),Qp("div",{className:"survey-box","data-question-index":k,children:jg({question:F,forceDisableHtml:s,displayQuestionIndex:k,appearance:r.appearance||xp,onSubmit:t=>(t=>{var e=t.res,i=t.displayQuestionIndex,s=t.questionId;if(o)if(s){var a=sa(s),l=n({},u,{[a]:e});h(l);var d=A[i],v=null!=d&&d.id?n({},I,{[d.id]:d.question}):I;E(v);var c=xg(r,i,e),f=c===kf,p=[...C,i];if(f||(T(p),S(c),zp(r,{surveySubmissionId:m,responses:l,lastQuestionIndex:c,questionOrder:$p(A),visitedIndices:p,surveyLanguage:_,questionSnapshots:v})),r.enable_partial_responses||f){var g=new Set(p.map(t=>{var e;return null==(e=A[t])?void 0:e.id}).filter(t=>!!t).map(t=>sa(t)));Ep({responses:Object.fromEntries(Object.entries(l).filter(t=>g.has(t[0]))),survey:r,surveySubmissionId:m,isSurveyCompleted:f,posthog:o,properties:b,surveyLanguage:_,questionSnapshots:v})}}else Nf.error("onNextButtonClick called without a questionId.");else Nf.error("onNextButtonClick called without a PostHog instance.")})({res:t,displayQuestionIndex:k,questionId:F.id}),onPreviewSubmit:p,initialValue:F.id?u[sa(F.id)]:void 0,canGoBack:P,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:u,lastQuestionIndex:t,questionOrder:$p(A),visitedIndices:e,surveyLanguage:_,questionSnapshots:I})}}})})]}):null}function qg(t){var e,i,r,n,s,o,a,l=t.survey,u=t.forceDisableHtml,h=t.posthog,d=t.readOnly,v=t.surveyLanguage,c=Gc(!0),f=c[0],p=c[1],g=Gc(!1),m=g[0],y=g[1],b=Gc({}),_=b[0],w=b[1],k=Jc(void 0),S=()=>{y(!m)};if(Zc(()=>{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&&(Nf.info("Received show event for feedback button survey "+l.id),w(i.detail.position||{}),S())};return Dn(Mg,Eg,e),()=>{Ie(k.current)||(clearTimeout(k.current),k.current=void 0),Mg.removeEventListener(Eg,e)}}}else Nf.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]),Og({survey:l,setSurveyVisible:p,posthog:h}),!f)return null;var x=()=>{l.schedule!==Sf&&p(!1),Ie(k.current)||clearTimeout(k.current),k.current=setTimeout(()=>{k.current=void 0,y(!1)},200)};return Qp(gc,{children:["tab"===(null==(n=l.appearance)?void 0:n.widgetType)&&Qp("button",{className:"ph-survey-widget-tab "+("top"===(null==(s=l.appearance)?void 0:s.tabPosition)?"widget-tab-top":""),onClick:S,disabled:d,style:Dg(null==(o=l.appearance)?void 0:o.tabPosition),children:(null==(a=l.appearance)?void 0:a.widgetLabel)||""}),m&&Qp(Lg,{posthog:h,survey:l,forceDisableHtml:u,style:_,onPopupSurveyDismissed:x,onCloseConfirmationMessage:x,surveyLanguage:v})]})}var jg=t=>{var e=t.question,i=t.displayQuestionIndex,r=t.onSubmit,s=t.onPreviewSubmit,o={forceDisableHtml:t.forceDisableHtml,appearance:t.appearance,onPreviewSubmit(t){s(t)},onSubmit(t){r(t)},initialValue:t.initialValue,displayQuestionIndex:i,canGoBack:t.canGoBack,onBack:t.onBack};switch(e.type){case yf:return fc(cg,n({},o,{question:e,key:e.id}));case"link":return fc(fg,n({},o,{question:e,key:e.id}));case wf:return fc(pg,n({},o,{question:e,key:e.id}));case _f:case bf:return fc(mg,n({},o,{question:e,key:e.id}));default:return Nf.error("Unsupported question type: "+e.type),null}};b.__PosthogExtensions__=b.__PosthogExtensions__||{},b.__PosthogExtensions__.generateSurveys=Fg,b.extendPostHogWithSurveys=Fg;var Bg=t=>{for(;null!=(e=t)&&e.__rrweb_original__;){var e;t=t.__rrweb_original__}return t},Hg=1e4,zg=(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),Ug=(t,e,i)=>{var r=JSON.stringify(t);if(i.remaining>=r.length)return zg(e,r,i);if(i.truncated=!0,2>i.remaining)return!1;for(var n=0,s=Math.min(t.length,i.remaining-2);s>n;){var o=Math.ceil((n+s)/2);JSON.stringify(t.slice(0,o)).length>i.remaining?s=o-1:n=o}return zg(e,JSON.stringify(t.slice(0,n)),i)},Wg=t=>void 0!==t&&"function"!=typeof t&&"symbol"!=typeof t&&"bigint"!=typeof t,Vg=(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}},Gg=(t,e,i)=>{if(!i.truncated)if(Te(t)){if(i.seen.has(t))return void Vg(e||"circular","[Circular]",i);i.seen.add(t);try{for(var r in t)try{if(!{}.hasOwnProperty.call(t,r))continue;if(Gg(t[r],e?e+"."+r:r,i),i.truncated)return}catch(t){continue}}catch(t){}}else Vg(e,t,i)},Zg=function(t,e,i,r,n,s){if(void 0===n&&(n=!1),!Wg(t))return!n||zg(e,"null",i);if(Ae(t)||(t=>{try{return Fe(t)||$e(t)}catch(t){return!1}})(t))return zg(e,JSON.stringify(t),i);if("string"==typeof t)return Ug(t,e,i);if(!Te(t)&&!xe(t))return zg(e,JSON.stringify(t),i);if(r.has(t))return Ug("[Circular]",e,i);r.add(t);try{var o=t.toJSON;if(Ce(o))return Zg(o.call(t),e,i,r,n)}catch(t){}try{var a={}.toString.call(t);if("[object String]"===a)return Ug(String(t.valueOf()),e,i);if("[object Number]"===a||"[object Boolean]"===a)return zg(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 Zg(l,e,i,r,n,s)}if(xe(t)){if(!zg(e,"[",i))return!1;for(var h=0;t.length>h;h++){if(h>0&&!zg(e,",",i))return!1;var d=void 0;try{d=t[h]}catch(t){d=void 0}if(!Zg(d,e,i,r,!0))return!1}return zg(e,"]",i)}if(!zg(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{Gg(f,c,s)}catch(t){}if(Wg(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(!zg(e,p,i))return!1;var b=e.length,_=Zg(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 zg(e,"}",i)},Jg=(t,e)=>{for(var i=[],r={remaining:e,truncated:!1},n=Te(t[0])?{result:{},keysRemaining:50,sizeRemaining:Hg,truncated:!1,seen:new WeakSet([t[0]])}:void 0,s=0;t.length>s&&(0>=s||zg(i," ",r))&&Zg(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)||{}}},Qg={debug:"debug",log:"info",warn:"warn",error:"error",info:"info"},Kg=t=>"canCapture"in t,Xg=t=>Kg(t)?t.canCapture?t.getExtension(Vf):void 0:t.is_capturing()?t.logs:void 0;b.__PosthogExtensions__=b.__PosthogExtensions__||{},b.__PosthogExtensions__.logs={initializeLogs(t){var e=t,i=[],r={host:b.location.host},s=!1,o=function(t){var o=b.console[t];i.push(mv(b.console,t,i=>{var a=(i=>function(){for(var o=!1,a=arguments.length,l=new Array(a),u=0;a>u;u++)l[u]=arguments[u];try{var h=e;if(l.length>0&&!s&&h){var d=Xg(h);if(d){s=!0,o=!0;var v=Jg(l,Hg),c=v.body,f=v.attributes,p=n({},r,v.truncated?{body_truncated:"true"}:{});((t,e,i)=>{if(Kg(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;Ce(n)&&n.call(e,i)}})(h,d,{level:Qg[t],body:c,attributes:n({"log.source":"console."+t},p,f)})}}}catch(t){}finally{o&&(s=!1),i.apply(b.console,l)}})(i);return a.__rrweb_original__=Bg(o),a}))};for(var a of Object.keys(Qg))o(a);return()=>{e=void 0,i.forEach(t=>t())}},replayConsoleBuffer(t,e){var i=Xg(t);if(i)for(var r of e)try{var s=Jg(r.args,Hg);null==i.captureBufferedConsoleLog||i.captureBufferedConsoleLog({level:Qg[r.level],body:s.body,attributes:n({"log.source":"console."+r.level,host:b.location.host},s.truncated?{body_truncated:"true"}:{},s.attributes)},r.context,r.occurredAtMs)}catch(t){}}};var Yg=t=>Be(t)&&("RangeError"===t.name&&0===t.message.indexOf("Maximum call stack size exceeded")||"InternalError"===t.name&&"too much recursion"===t.message),tm=Cn("[Error tracking]"),em="webkit-masked-url:",im=["chrome-extension://","moz-extension://","safari-extension:","safari-web-extension:",em],rm=["__firefox__","__gCrWeb"];function nm(){return new vr([new Sr,new Fr,new Cr,new xr,new Ar,new Rr,new Mr,new Pr],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 s=[],o=e.split("\n"),a=r;o.length>a;a++){var l=o[a];if(1024>=l.length){var u=kr.test(l)?l.replace(kr,"$1"):l;if(!u.match(/\S*Error: /)){for(var h of i){var d=h(u,t);if(d){s.push(d);break}}if(s.length>=50)break}}}return function(t){if(!t.length)return[];var e=Array.from(t);return e.reverse(),e.slice(0,50).map(t=>{return n({},t,{filename:t.filename||(i=e,i[i.length-1]||{}).filename,function:t.function||"?"});var i})}(s)}}("web:javascript",yr,wr))}var sm=Cn("[ExceptionAutocapture]"),om=nm(),am=(t,e)=>{try{return t()}catch(t){return e}},lm=(t,e)=>am(()=>t(e()),void 0),um=t=>am(()=>Ce(t)&&Ce(t.call),!1),hm=(t,e)=>am(()=>{t[e].__POSTHOG_INSTRUMENTED__=!0},void 0),dm=(t,e,i)=>{am(()=>{var i;null==(i=t[e])||delete i.__POSTHOG_INSTRUMENTED__},void 0),am(()=>{t[e]=i},void 0)},vm=t=>{var e=a;e||sm.info("window not available, cannot wrap onerror");var i=am(()=>e.onerror,void 0);return e.onerror=function(){for(var e,r=arguments.length,n=new Array(r),s=0;r>s;s++)n[s]=arguments[s];return lm(t,()=>om.buildFromUnknown((t=>{var e=t[0],i=t[1],r=t[2],n=t[3],s=t[4];if(null!=s)return s;if(Ee(e)&&Ee(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}})),!!um(i)&&null!==(e=i(...n))&&void 0!==e&&e},hm(e,"onerror"),()=>dm(e,"onerror",i)},cm=function(t,e){void 0===e&&(e=!1);var i=a;i||sm.info("window not available, cannot wrap onUnhandledRejection");var r=am(()=>i.onunhandledrejection,void 0);return i.onunhandledrejection=function(i){var n;return lm(t,()=>om.buildFromUnknown(i,{mechanism:{handled:!1}})),um(r)?null!==(n=r(i))&&void 0!==n&&n:e},hm(i,"onunhandledrejection"),()=>dm(i,"onunhandledrejection",r)},fm={wrapOnError:vm,wrapUnhandledRejection:cm,wrapConsoleError(t){var e=console;e||sm.info("console not available, cannot wrap console.error");var i=am(()=>e.error,void 0);return e.error=function(){for(var e=arguments.length,r=new Array(e),n=0;e>n;n++)r[n]=arguments[n];lm(t,()=>{var t;t=1==r.length?r[0]:r.join(" ");var e=r.find(t=>t instanceof Error);return om.buildFromUnknown(e||t,{mechanism:{handled:!1},syntheticException:new Error("PostHog syntheticException"),skipFirstLines:2})}),um(i)&&i(...r)},hm(e,"error"),()=>dm(e,"error",i)}};b.__PosthogExtensions__=b.__PosthogExtensions__||{},b.__PosthogExtensions__.errorWrappingFunctions=fm,b.posthogErrorWrappingFunctions=fm;var pm=(t,e)=>{if(Ce(null==t?void 0:t.capture)){var i=null==e?void 0:e.autocaptureExceptions,r=!Ae(i)&&"object"==typeof i&&xe(i.errors_to_ignore)?i.errors_to_ignore.reduce((t,e)=>{try{t.push(new RegExp(e))}catch(t){sm.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){sm.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)}};b.extendPostHogWithExceptionAutoCapture=pm,b.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&&!Ae(t)||Ce(t),Sm=t=>"undefined"!=typeof Request&&(t instanceof Request||"[object Request]"==={}.toString.call(t)),xm=t=>{try{var e;return Sm(t)?t.url:new URL(t instanceof URL?t.toString():String(t),null==a||null==(e=a.location)?void 0:e.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(xe(t)&&!t.includes(s))return!1;var o=!1;if(i){var a=i.checkAndGetSessionAndWindowId(!0),l=a.windowId;n.set(gm,a.sessionId),n.set(mm,l),o=!0}var u=(t=>Ce(t)?t():t)(e);return u&&"$posthog_cookieless"!==u&&(n.set(ym,u),o=!0),o};b.__PosthogExtensions__=b.__PosthogExtensions__||{};var Tm={_patchFetch:(t,e,i)=>mv(a,"fetch",r=>function(s,o){var a=arguments.length>1?[s,o]:[s],l=a;try{var u=xm(s);if(u)if(Sm(s)){var h=new Request(s,o);Cm(t,e,i,h.url,h.headers),l=[h]}else{var d=new Headers(km(o)?o.headers:void 0);if(Cm(t,e,i,u,d)){var v=((t,e)=>{if(Ie(t)||Ae(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 s=Reflect.getOwnPropertyDescriptor(i,e);return s?n({},s,{configurable:!0}):void 0},getPrototypeOf:()=>Object.getPrototypeOf(i)})}})(o,d);v&&(l=[s,v])}}}catch(t){l=a}return r.apply(this,l)}),_patchXHR:(t,e,i)=>mv(a.XMLHttpRequest.prototype,"open",r=>function(n,s,o,a,l){void 0===o&&(o=!0);var u=this,h=new Headers,d=xm(s);d&&Cm(t,e,i,d,h);var v=r.call(u,n,s,o,a,l);return bm.forEach(t=>{var e=h.get(t);if(e)try{u.setRequestHeader(t,e)}catch(t){}}),v})};b.__PosthogExtensions__.tracingHeadersPatchFns=Tm,b.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}),"function"!=typeof[].findLast&&Object.defineProperty(Array.prototype,"findLast",{value(t,e){for(var i=this.length-1;i>=0;i--){var r=this[i];if(t.call(e,r,i,this))return r}},writable:!0,enumerable:!1,configurable:!0});var 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)}}},Im=()=>{var t=performance.getEntriesByType("navigation")[0];if(t&&t.responseStart>0&&t.responseStart<performance.now())return t},Em=t=>{if("loading"===document.readyState)return"loading";var e=Im();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(/^#/,"")},Am=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},Pm=new WeakMap;function Fm(t,e){var i=Pm.get(e);return i||Pm.set(e,i=new WeakMap),i.get(t)||i.set(t,new e),i.get(t)}var Om,$m=-1,Dm=()=>$m,Lm=t=>{addEventListener("pageshow",e=>{e.persisted&&($m=e.timeStamp,t(e))},!0)},Nm=(t,e,i,r)=>{var n,s;return o=>{e.value>=0&&(o||r)&&((s=e.value-(null!=n?n:0))||void 0===n)&&(n=e.value,e.delta=s,e.rating=((t,e)=>t>e[1]?"poor":t>e[0]?"needs-improvement":"good")(e.value,i),t(e))}},qm=t=>{requestAnimationFrame(()=>requestAnimationFrame(()=>t()))},jm=()=>{var t,e;return null!==(t=null==(e=Im())?void 0:e.activationStart)&&void 0!==t?t:0},Bm=-1,Hm=new Set,zm=()=>"hidden"!==document.visibilityState||document.prerendering?1/0:0,Um=t=>{if("hidden"===document.visibilityState){if("visibilitychange"===t.type)for(var e of Hm)e();isFinite(Bm)||(Bm="visibilitychange"===t.type?t.timeStamp:0,removeEventListener("prerenderingchange",Um,!0))}},Wm=function(t){if(void 0===t&&(t=!1),t&&(Bm=1/0),0>Bm){var e,i,r=jm();Bm=null!==(e=document.prerendering||null==(i=globalThis.performance.getEntriesByType("visibility-state").find(t=>"hidden"===t.name&&t.startTime>=r))?void 0:i.startTime)&&void 0!==e?e:zm(),addEventListener("visibilitychange",Um,!0),addEventListener("prerenderingchange",Um,!0),Lm(()=>{setTimeout(()=>{Bm=zm()})})}return{get firstHiddenTime(){return Bm},onHidden(t){Hm.add(t)}}},Vm=function(t,e,i,r,n,s,o){void 0===e&&(e=-1),void 0===r&&(r=0);var a=Im(),l=(null==a?void 0:a.navigationId)||0,u="navigate";return i?u=i:0>Dm()?a&&(document.prerendering||jm()>0?u="prerender":document.wasDiscarded?u="restore":a.type&&(u=a.type.replace(/_/g,"-"))):u="back-forward-cache",{name:t,value:e,rating:"good",delta:0,entries:[],id:"v6-"+Date.now()+"-"+(Math.floor(8999999999999*Math.random())+1e12),navigationType:u,navigationId:r||l,navigationInteractionId:n,navigationURL:s||(null==a?void 0:a.name),navigationStartTime:o||0}},Gm=function(t,e,i){void 0===i&&(i={});try{var r=t.filter(t=>PerformanceObserver.supportedEntryTypes.includes(t));if(r.length>0){var s=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 o of r)s.observe(n({type:o,buffered:!0},i));return s}}catch(t){}},Zm=t=>{var e,i;return(null==(e=globalThis.PerformanceObserver)||null==(e=e.supportedEntryTypes)?void 0:e.includes("soft-navigation"))&&"function"==typeof(null==(i=globalThis.PerformanceSoftNavigation)||null==(i=i.prototype)?void 0:i.getLargestInteractionContentfulPaint)&&t&&t.reportSoftNavs},Jm=(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)}},Km=class{constructor(){this.u=void 0}},Xm=t=>{document.prerendering?addEventListener("prerenderingchange",t,!0):t()},Ym=[1800,3e3],ty=function(t,e){void 0===e&&(e={});var i=Zm(e);Xm(()=>{var r,n=Fm(e,Km),s=Wm(),o=Vm("FCP"),a=Gm(["paint"],t=>{for(var e of t)"first-contentful-paint"===e.name&&(a.disconnect(),s.firstHiddenTime>e.startTime&&(o.value=Math.max(e.startTime-jm(),0),o.entries.push(e),o.navigationId=e.navigationId||o.navigationId,r(!0)))});a&&(r=Nm(t,o,Ym,e.reportAllChanges),Lm(i=>{o=Vm("FCP",-1,"back-forward-cache",o.navigationId,o.navigationInteractionId,o.navigationURL,Dm()),r=Nm(t,o,Ym,e.reportAllChanges),qm(()=>{o.value=performance.now()-i.timeStamp,r(!0)})})),i&&Gm(["soft-navigation"],i=>{i.forEach(i=>{n.u&&i.navigationId&&Jm(n.u,i),o=Vm("FCP",Math.max((i.presentationTime||i.paintTime||0)-i.startTime,0),"soft-navigation",i.navigationId,i.interactionId,i.name,i.startTime),(r=Nm(t,o,Ym,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=function(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 o,a=null!==(o=null==e.generateTarget?void 0:e.generateTarget(s))&&void 0!==o?o:Am(s);r.set(n,a)}}},function(t,e){void 0===e&&(e={});var i=Wm();ty(Qm(()=>{var r,n=Vm("CLS",0),s=Fm(e,Mm),o=(i,o,a,l,u)=>{n=Vm("CLS",0,i,o,a,l,u),s.o=0,r=Nm(t,n,ey,e.reportAllChanges)},a=function(t){void 0===t&&(t=!1),s.o>n.value&&(n.value=s.o,n.entries=s.i),r(t)},l=t=>{a(!0),o("soft-navigation",t.navigationId,t.interactionId,t.name,t.startTime)},u=t=>{for(var e of t)"soft-navigation"!==e.entryType?s.l(e):l(e);a()},h=["layout-shift"];Zm(e)&&h.push("soft-navigation");var d=Gm(h,u);d&&(r=Nm(t,n,ey,e.reportAllChanges),i.onHidden(()=>{u(d.takeRecords()),r(!0)}),Lm(()=>{o("back-forward-cache",n.navigationId,n.navigationInteractionId,n.navigationURL,Dm()),qm(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:Em(n.startTime)})}}return Object.assign(t,{attribution:e})})(e))},e)},ny=function(t,e){void 0===e&&(e={});var i=Fm(e=Object.assign({},e),Km);Zm(e)&&(i.u=new Map),ty(e=>{t((t=>{var e={timeToFirstByte:0,firstByteToFCP:t.value,loadState:Em(Dm())};if("soft-navigation"!==t.navigationType){if(t.entries.length){var r=Im(),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:Em(t.entries[0].startTime),navigationEntry:r,fcpEntry:n}}}}else{var o,a=null==(o=i.u)?void 0:o.get(t.navigationId);a&&(e={timeToFirstByte:0,firstByteToFCP:t.value,loadState:"complete",navigationEntry:a})}return Object.assign(t,{attribution:e})})(e))},e)},sy=0,oy=1/0,ay=0,ly=t=>{for(var e of t)e.interactionId&&(oy=Math.min(oy,e.interactionId),ay=Math.max(ay,e.interactionId),sy=ay?(ay-oy)/7+1:0)},uy=()=>{var t;return Om?sy:null!==(t=performance.interactionCount)&&void 0!==t?t:0},hy=class{constructor(){this.h=0,this.v=[],this.p=new Map,this.m=void 0,this.M=void 0}T(){return uy()-this.h}D(){this.h=uy(),this.v.length=0,this.p.clear()}S(t){var e=this.T(),i=Math.min(this.v.length-1,Math.floor(e/50));return!e||-1!==i||"soft-navigation"!==t&&"back-forward-cache"!==t?this.v[i]:{k:8,id:-1,entries:[]}}l(t){var e;if(null!=(e=this.m)&&e.call(this,t),t.interactionId){var i=this.v.at(-1),r=this.p.get(t.interactionId);if(r||10>this.v.length||t.duration>i.k){var n;if(r?t.duration>r.k?(r.entries=[t],r.k=t.duration):t.duration===r.k&&t.startTime===r.entries[0].startTime&&r.entries.push(t):(this.p.set((r={id:t.interactionId,entries:[t],k:t.duration}).id,r),this.v.push(r)),this.v.sort((t,e)=>e.k-t.k),this.v.length>10)for(var s of this.v.splice(10))this.p.delete(s.id);null==(n=this.M)||n.call(this,r)}}}},dy=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,o=()=>{r(s),n()};addEventListener("visibilitychange",o,{once:!0,capture:!0}),s=i(()=>{removeEventListener("visibilitychange",o,{capture:!0}),n()},{timeout:e})}},vy=[200,500],cy=function(t,e){void 0===e&&(e={});var i=Fm(e=Object.assign({},e),hy),r=[],s=[],o=0,a=new WeakMap,l=new WeakMap,u=!1,h=()=>{u||(dy(d),u=!0)},d=()=>{var t=new Set(i.v.map(t=>a.get(t.entries[0]))),e=s.length-10;s=s.filter((i,r)=>r>=e||t.has(i));var n=new Set;for(var l of s)for(var h of v(l.startTime,l.processingEnd))n.add(h);r=r.filter(t=>t.startTime>o||n.has(t)),u=!1};i.m=t=>{var i,r=t.startTime+t.duration;o=Math.max(o,t.processingEnd);for(var n=s.length-1;n>=0;n--){var l=s[n];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||s.push(i={startTime:t.startTime,processingStart:t.processingStart,processingEnd:t.processingEnd,renderTime:r,entries:e.includeProcessedEventEntries?[t]:[]}),t.interactionId&&a.set(t,i),h()},i.M=t=>{if(!l.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:Am(r);l.set(t,s)}else{var o,a=null==(o=t.entries.find(t=>t.targetSelector))?void 0:o.targetSelector;a&&l.set(t,a)}}};var v=(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};Gm(["long-animation-frame"],t=>{r=r.concat(t),h()},e),function(t,e){if(void 0===e&&(e={}),globalThis.PerformanceEventTiming&&"interactionId"in PerformanceEventTiming.prototype){var i=Wm();Xm(()=>{var r;"interactionCount"in performance||Om||(Om=Gm(["event"],ly,{durationThreshold:0}));var s,o=Vm("INP"),a=Fm(e,hy),l=(i,r,n,l,u)=>{a.D(),o=Vm("INP",-1,i,r,n,l,u),s=Nm(t,o,vy,e.reportAllChanges)},u=()=>{var t=a.S(o.navigationType);t&&t.k!==o.value&&(o.value=t.k,o.entries=t.entries,s())},h=t=>{u(),s(!0),l("soft-navigation",t.navigationId,t.interactionId,t.name,t.startTime)},d=function(t,e){void 0===e&&(e=!1),dy(()=>{for(var i of t)"soft-navigation"!==i.entryType?a.l(i):h(i);u(),e&&s(!0)})},v=["event","first-input"];Zm(e)&&v.push("soft-navigation");var c=Gm(v,d,n({},e,{durationThreshold:null!==(r=e.durationThreshold)&&void 0!==r?r:40}));s=Nm(t,o,vy,e.reportAllChanges),c&&(i.onHidden(()=>{d(c.takeRecords(),!0)}),Lm(()=>{l("back-forward-cache",o.navigationId,o.navigationInteractionId,o.navigationURL,Dm())}))})}}(e=>{t((t=>{if(0===t.entries.length){var e={processedEventEntries:[],longAnimationFrameEntries:[],inputDelay:0,processingDuration:0,presentationDelay:t.value,loadState:Em(t.navigationStartTime||0)};return Object.assign(t,{attribution:e})}var r=t.entries[0],n=a.get(r),s=Math.max(n.processingStart,r.startTime),o=Math.max(r.startTime+r.duration,s),u=Math.min(n.processingEnd,o),h=n.entries.sort((t,e)=>t.processingStart-e.processingStart),d=v(r.startTime,u),c=i.p.get(r.interactionId),f={interactionTarget:l.get(c),interactionType:r.name.startsWith("key")?"keyboard":"pointer",interactionTime:r.startTime,nextPaintTime:o,processedEventEntries:h,longAnimationFrameEntries:d,inputDelay:s-r.startTime,processingDuration:u-s,presentationDelay:o-u,loadState:Em(r.startTime),longestScript:void 0,totalScriptDuration:void 0,totalStyleAndLayoutDuration:void 0,totalPaintDuration:void 0,totalUnattributedDuration:void 0};return((t,e)=>{var i=t.interactionTime,r=t.nextPaintTime;if(null!=(e=t.longAnimationFrameEntries)&&e.length&&i&&r){var n,s,o=t.inputDelay,a=t.processingDuration,l=0,u=0,h=0,d=0;for(var v of t.longAnimationFrameEntries)for(var c of(u=u+v.startTime+v.duration-v.styleAndLayoutStart,v.scripts)){var f=c.startTime+c.duration;if(f>=i){var p=f-Math.max(i,c.startTime),g=c.duration?p/c.duration*c.forcedStyleAndLayoutDuration:0;l+=p-g,u+=g,p>d&&(s=i+o>c.startTime?"input-delay":i+o+a>c.startTime?"processing-duration":"presentation-delay",n=c,d=p)}}var m=t.longAnimationFrameEntries.at(-1),y=m?m.startTime+m.duration:0;y>=i+o+a&&(h=r-y),n&&s&&(t.longestScript={entry:n,subpart:s,intersectingDuration:d}),t.totalScriptDuration=l,t.totalStyleAndLayoutDuration=u,t.totalPaintDuration=h,t.totalUnattributedDuration=r-i-l-u-h}})(f),Object.assign(t,{attribution:f})})(e))},e)},fy=class{constructor(){this.m=void 0,this.u=void 0}l(t){var e;null==(e=this.m)||e.call(this,t)}},$=[2500,4e3],py=50,gy=[];Gm(["resource"],t=>{for(var e of t)gy.push(e),gy.length>py&&gy.shift()});var my=function(t,e){void 0===e&&(e={}),null!=(e=Object.assign({},e)).resourceBufferSize&&(py=e.resourceBufferSize);var i=Fm(e,fy),r=new WeakMap;Zm(e)&&(i.u=new Map),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:Am(i);r.set(t,s)}else t.id&&r.set(t,"#"+t.id)},function(t,e){void 0===e&&(e={});var i=!1,r=Zm(e);Xm(()=>{var n,s=Wm(),o=Vm("LCP"),a=Fm(e,fy),l=(r,a,l,u,h)=>{o=Vm("LCP",-1,r,a,l,u,h),n=Nm(t,o,$,e.reportAllChanges),i=!1,"soft-navigation"===r&&(s=Wm(!0))},u=t=>{a.u&&t.navigationId&&Jm(a.u,t),i||n(!0),l("soft-navigation",t.navigationId,t.interactionId,t.name,t.startTime);var e=null==t.getLargestInteractionContentfulPaint?void 0:t.getLargestInteractionContentfulPaint();e&&h([e])},h=t=>{for(var i of(e.reportAllChanges||r||(t=t.slice(-1)),t))if(i)if("soft-navigation"!==i.entryType){var l=0,h=[],d=i.startTime;if("largest-contentful-paint"===i.entryType)l=Math.max(i.startTime-jm(),0),a.l(i),h=[i];else if("interaction-contentful-paint"===i.entryType){var v,c=i;if(!o.navigationId)continue;if("interactionId"in c&&c.interactionId!=o.navigationInteractionId)continue;d=(null==(v=c.largestContentfulPaint)?void 0:v.renderTime)||0,l=Math.max(d-i.startTime,0),c.largestContentfulPaint&&(a.l(c.largestContentfulPaint),h=[c.largestContentfulPaint])}s.firstHiddenTime>d&&(o.value=l,o.entries=h,n())}else u(i)},d=["largest-contentful-paint"];r&&d.push("interaction-contentful-paint","soft-navigation");var v=Gm(d,h);if(v){n=Nm(t,o,$,e.reportAllChanges);var c=["keydown","click","visibilitychange"],f=t=>{if(t.isTrusted&&!i){var e=o.id;dy(()=>{if(!i){if(!r)for(var t of(v.disconnect(),c))removeEventListener(t,f,{capture:!0});e===o.id&&(i=!0,n(!0))}})}};for(var p of c)addEventListener(p,f,{capture:!0});Lm(r=>{l("back-forward-cache",o.navigationId,o.navigationInteractionId,o.navigationURL,Dm()),n=Nm(t,o,$,e.reportAllChanges),qm(()=>{o.value=performance.now()-r.timeStamp,i=!0,n(!0)})})}})}(e=>{t((t=>{var e={timeToFirstByte:0,resourceLoadDelay:0,resourceLoadDuration:0,elementRenderDelay:t.value};if(t.entries.length){var s,o,a,l,u,h,d=t.entries.at(-1),v=d.url&&(gy.findLast(t=>t.name===d.url)||performance.getEntriesByType("resource").findLast(t=>t.name===d.url));e.target=r.get(d),e.lcpEntry=d,d.url&&(e.url=d.url),v&&(e.lcpResourceEntry=v);var c=0,f=0;if("soft-navigation"!==t.navigationType?(c=null!==(s=null==(o=h=Im())?void 0:o.activationStart)&&void 0!==s?s:0,f=null!==(a=null==(l=h)?void 0:l.responseStart)&&void 0!==a?a:0):(c=t.navigationStartTime||0,h=null==(u=i.u)?void 0:u.get(t.navigationId)),h){var p=Math.max(0,f-c),g=Math.max(p,v?(v.requestStart||v.startTime)-c:0),m=Math.min(t.value,Math.max(g,v?v.responseEnd-c:0));e=n({},e,{timeToFirstByte:p,resourceLoadDelay:g-p,resourceLoadDuration:m-g,elementRenderDelay:t.value-m,navigationEntry:h})}}return Object.assign(t,{attribution:e})})(e))},e)},yy=-1,by=()=>yy,_y=t=>{addEventListener("pageshow",e=>{e.persisted&&(yy=e.timeStamp,t(e))},!0)},wy=(t,e,i,r)=>{var n,s;return o=>{e.value>=0&&(o||r)&&((s=e.value-(null!=n?n:0))||void 0===n)&&(n=e.value,e.delta=s,e.rating=((t,e)=>t>e[1]?"poor":t>e[0]?"needs-improvement":"good")(e.value,i),t(e))}},ky=t=>{requestAnimationFrame(()=>requestAnimationFrame(()=>t()))},Sy=()=>{var t=performance.getEntriesByType("navigation")[0];if(t&&t.responseStart>0&&t.responseStart<performance.now())return t},xy=()=>{var t,e;return null!==(t=null==(e=Sy())?void 0:e.activationStart)&&void 0!==t?t:0},Cy=-1,Ty=new Set,My=()=>"hidden"!==document.visibilityState||document.prerendering?1/0:0,Iy=t=>{if("hidden"===document.visibilityState){if("visibilitychange"===t.type)for(var e of Ty)e();isFinite(Cy)||(Cy="visibilitychange"===t.type?t.timeStamp:0,removeEventListener("prerenderingchange",Iy,!0))}},Ey=function(t){if(void 0===t&&(t=!1),t&&(Cy=1/0),0>Cy){var e,i,r=xy();Cy=null!==(e=document.prerendering||null==(i=globalThis.performance.getEntriesByType("visibility-state").find(t=>"hidden"===t.name&&t.startTime>=r))?void 0:i.startTime)&&void 0!==e?e:My(),addEventListener("visibilitychange",Iy,!0),addEventListener("prerenderingchange",Iy,!0),_y(()=>{setTimeout(()=>{Cy=My()})})}return{get firstHiddenTime(){return Cy},onHidden(t){Ty.add(t)}}},Ry=function(t,e,i,r,n,s,o){void 0===e&&(e=-1),void 0===r&&(r=0);var a=Sy(),l=(null==a?void 0:a.navigationId)||0,u="navigate";return i?u=i:0>by()?a&&(document.prerendering||xy()>0?u="prerender":document.wasDiscarded?u="restore":a.type&&(u=a.type.replace(/_/g,"-"))):u="back-forward-cache",{name:t,value:e,rating:"good",delta:0,entries:[],id:"v6-"+Date.now()+"-"+(Math.floor(8999999999999*Math.random())+1e12),navigationType:u,navigationId:r||l,navigationInteractionId:n,navigationURL:s||(null==a?void 0:a.name),navigationStartTime:o||0}},Ay=new WeakMap;function Py(t,e){var i=Ay.get(e);return i||Ay.set(e,i=new WeakMap),i.get(t)||i.set(t,new e),i.get(t)}var Fy,Oy=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)}}},$y=function(t,e,i){void 0===i&&(i={});try{var r=t.filter(t=>PerformanceObserver.supportedEntryTypes.includes(t));if(r.length>0){var s=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 o of r)s.observe(n({type:o,buffered:!0},i));return s}}catch(t){}},Dy=t=>{var e,i;return(null==(e=globalThis.PerformanceObserver)||null==(e=e.supportedEntryTypes)?void 0:e.includes("soft-navigation"))&&"function"==typeof(null==(i=globalThis.PerformanceSoftNavigation)||null==(i=i.prototype)?void 0:i.getLargestInteractionContentfulPaint)&&t&&t.reportSoftNavs},Ly=(t,e)=>{if(t.set(e.navigationId,e),t.size>2){var i=t.keys().next().value;void 0!==i&&t.delete(i)}},Ny=t=>{var e=!1;return()=>{e||(t(),e=!0)}},qy=class{constructor(){this.l=void 0}},jy=t=>{document.prerendering?addEventListener("prerenderingchange",t,!0):t()},By=[1800,3e3],Hy=function(t,e){void 0===e&&(e={});var i=Dy(e);jy(()=>{var r,n=Py(e,qy),s=Ey(),o=Ry("FCP"),a=$y(["paint"],t=>{for(var e of t)"first-contentful-paint"===e.name&&(a.disconnect(),s.firstHiddenTime>e.startTime&&(o.value=Math.max(e.startTime-xy(),0),o.entries.push(e),o.navigationId=e.navigationId||o.navigationId,r(!0)))});a&&(r=wy(t,o,By,e.reportAllChanges),_y(i=>{o=Ry("FCP",-1,"back-forward-cache",o.navigationId,o.navigationInteractionId,o.navigationURL,by()),r=wy(t,o,By,e.reportAllChanges),ky(()=>{o.value=performance.now()-i.timeStamp,r(!0)})})),i&&$y(["soft-navigation"],i=>{i.forEach(i=>{n.l&&i.navigationId&&Ly(n.l,i),o=Ry("FCP",Math.max((i.presentationTime||i.paintTime||0)-i.startTime,0),"soft-navigation",i.navigationId,i.interactionId,i.name,i.startTime),(r=wy(t,o,By,e.reportAllChanges))(!0)})},e)})},zy=[.1,.25],Uy=function(t,e){void 0===e&&(e={});var i=Ey();Hy(Ny(()=>{var r,n=Ry("CLS",0),s=Py(e,Oy),o=(i,o,a,l,u)=>{n=Ry("CLS",0,i,o,a,l,u),s.i=0,r=wy(t,n,zy,e.reportAllChanges)},a=function(t){void 0===t&&(t=!1),s.i>n.value&&(n.value=s.i,n.entries=s.o),r(t)},l=t=>{a(!0),o("soft-navigation",t.navigationId,t.interactionId,t.name,t.startTime)},u=t=>{for(var e of t)"soft-navigation"!==e.entryType?s.h(e):l(e);a()},h=["layout-shift"];Dy(e)&&h.push("soft-navigation");var d=$y(h,u);d&&(r=wy(t,n,zy,e.reportAllChanges),i.onHidden(()=>{u(d.takeRecords()),r(!0)}),_y(()=>{o("back-forward-cache",n.navigationId,n.navigationInteractionId,n.navigationURL,by()),ky(r)}),setTimeout(r))}))},Wy=0,Vy=1/0,Gy=0,Zy=t=>{for(var e of t)e.interactionId&&(Vy=Math.min(Vy,e.interactionId),Gy=Math.max(Gy,e.interactionId),Wy=Gy?(Gy-Vy)/7+1:0)},Jy=()=>{var t;return Fy?Wy:null!==(t=performance.interactionCount)&&void 0!==t?t:0},Qy=class{constructor(){this.u=0,this.v=[],this.m=new Map,this.p=void 0,this.T=void 0}_(){return Jy()-this.u}M(){this.u=Jy(),this.v.length=0,this.m.clear()}L(t){var e=this._(),i=Math.min(this.v.length-1,Math.floor(e/50));return!e||-1!==i||"soft-navigation"!==t&&"back-forward-cache"!==t?this.v[i]:{P:8,id:-1,entries:[]}}h(t){var e;if(null!=(e=this.p)&&e.call(this,t),t.interactionId){var i=this.v.at(-1),r=this.m.get(t.interactionId);if(r||10>this.v.length||t.duration>i.P){var n;if(r?t.duration>r.P?(r.entries=[t],r.P=t.duration):t.duration===r.P&&t.startTime===r.entries[0].startTime&&r.entries.push(t):(this.m.set((r={id:t.interactionId,entries:[t],P:t.duration}).id,r),this.v.push(r)),this.v.sort((t,e)=>e.P-t.P),this.v.length>10)for(var s of this.v.splice(10))this.m.delete(s.id);null==(n=this.T)||n.call(this,r)}}}},Ky=t=>{var e="requestIdleCallback"in globalThis?1e3:0,i=globalThis.requestIdleCallback||setTimeout,r=globalThis.cancelIdleCallback||clearTimeout;if("hidden"===document.visibilityState)t();else{var n=Ny(t),s=-1,o=()=>{r(s),n()};addEventListener("visibilitychange",o,{once:!0,capture:!0}),s=i(()=>{removeEventListener("visibilitychange",o,{capture:!0}),n()},{timeout:e})}},Xy=[200,500],Yy=function(t,e){if(void 0===e&&(e={}),globalThis.PerformanceEventTiming&&"interactionId"in PerformanceEventTiming.prototype){var i=Ey();jy(()=>{var r;"interactionCount"in performance||Fy||(Fy=$y(["event"],Zy,{durationThreshold:0}));var s,o=Ry("INP"),a=Py(e,Qy),l=(i,r,n,l,u)=>{a.M(),o=Ry("INP",-1,i,r,n,l,u),s=wy(t,o,Xy,e.reportAllChanges)},u=()=>{var t=a.L(o.navigationType);t&&t.P!==o.value&&(o.value=t.P,o.entries=t.entries,s())},h=t=>{u(),s(!0),l("soft-navigation",t.navigationId,t.interactionId,t.name,t.startTime)},d=function(t,e){void 0===e&&(e=!1),Ky(()=>{for(var i of t)"soft-navigation"!==i.entryType?a.h(i):h(i);u(),e&&s(!0)})},v=["event","first-input"];Dy(e)&&v.push("soft-navigation");var c=$y(v,d,n({},e,{durationThreshold:null!==(r=e.durationThreshold)&&void 0!==r?r:40}));s=wy(t,o,Xy,e.reportAllChanges),c&&(i.onHidden(()=>{d(c.takeRecords(),!0)}),_y(()=>{l("back-forward-cache",o.navigationId,o.navigationInteractionId,o.navigationURL,by())}))})}},tb=class{constructor(){this.p=void 0,this.l=void 0}h(t){var e;null==(e=this.p)||e.call(this,t)}},eb=[2500,4e3],ib=function(t,e){void 0===e&&(e={});var i=!1,r=Dy(e);jy(()=>{var n,s=Ey(),o=Ry("LCP"),a=Py(e,tb),l=(r,a,l,u,h)=>{o=Ry("LCP",-1,r,a,l,u,h),n=wy(t,o,eb,e.reportAllChanges),i=!1,"soft-navigation"===r&&(s=Ey(!0))},u=t=>{a.l&&t.navigationId&&Ly(a.l,t),i||n(!0),l("soft-navigation",t.navigationId,t.interactionId,t.name,t.startTime);var e=null==t.getLargestInteractionContentfulPaint?void 0:t.getLargestInteractionContentfulPaint();e&&h([e])},h=t=>{for(var i of(e.reportAllChanges||r||(t=t.slice(-1)),t))if(i)if("soft-navigation"!==i.entryType){var l=0,h=[],d=i.startTime;if("largest-contentful-paint"===i.entryType)l=Math.max(i.startTime-xy(),0),a.h(i),h=[i];else if("interaction-contentful-paint"===i.entryType){var v,c=i;if(!o.navigationId)continue;if("interactionId"in c&&c.interactionId!=o.navigationInteractionId)continue;d=(null==(v=c.largestContentfulPaint)?void 0:v.renderTime)||0,l=Math.max(d-i.startTime,0),c.largestContentfulPaint&&(a.h(c.largestContentfulPaint),h=[c.largestContentfulPaint])}s.firstHiddenTime>d&&(o.value=l,o.entries=h,n())}else u(i)},d=["largest-contentful-paint"];r&&d.push("interaction-contentful-paint","soft-navigation");var v=$y(d,h);if(v){n=wy(t,o,eb,e.reportAllChanges);var c=["keydown","click","visibilitychange"],f=t=>{if(t.isTrusted&&!i){var e=o.id;Ky(()=>{if(!i){if(!r)for(var t of(v.disconnect(),c))removeEventListener(t,f,{capture:!0});e===o.id&&(i=!0,n(!0))}})}};for(var p of c)addEventListener(p,f,{capture:!0});_y(r=>{l("back-forward-cache",o.navigationId,o.navigationInteractionId,o.navigationURL,by()),n=wy(t,o,eb,e.reportAllChanges),ky(()=>{o.value=performance.now()-r.timeStamp,i=!0,n(!0)})})}})},rb={onLCP:my,onCLS:ry,onFCP:ny,onINP:cy,withoutAttribution:{onLCP:ib,onCLS:Uy,onFCP:Hy,onINP:Yy}};b.__PosthogExtensions__=b.__PosthogExtensions__||{},b.__PosthogExtensions__.postHogWebVitalsCallbacksByFlavor=b.__PosthogExtensions__.postHogWebVitalsCallbacksByFlavor||{},b.__PosthogExtensions__.postHogWebVitalsCallbacksByFlavor["web-vitals-with-attribution-soft-navs"]=rb,b.__PosthogExtensions__.postHogWebVitalsCallbacks=rb,b.postHogWebVitalsCallbacks=rb;var nb={onLCP:ib,onCLS:Uy,onFCP:Hy,onINP:Yy};b.__PosthogExtensions__=b.__PosthogExtensions__||{},b.__PosthogExtensions__.postHogWebVitalsCallbacksByFlavor=b.__PosthogExtensions__.postHogWebVitalsCallbacksByFlavor||{},b.__PosthogExtensions__.postHogWebVitalsCallbacksByFlavor["web-vitals-soft-navs"]=nb,b.__PosthogExtensions__.postHogWebVitalsCallbacks=nb,b.postHogWebVitalsCallbacks=nb,b.__PosthogExtensions__.loadWebVitalsCallbacks=()=>nb;var sb={onLCP:my,onCLS:ry,onFCP:ny,onINP:cy,withoutAttribution:{onLCP:ib,onCLS:Uy,onFCP:Hy,onINP:Yy}};b.__PosthogExtensions__=b.__PosthogExtensions__||{},b.__PosthogExtensions__.postHogWebVitalsCallbacksByFlavor=b.__PosthogExtensions__.postHogWebVitalsCallbacksByFlavor||{},b.__PosthogExtensions__.postHogWebVitalsCallbacksByFlavor["web-vitals-with-attribution"]=sb,b.__PosthogExtensions__.postHogWebVitalsCallbacks=sb,b.postHogWebVitalsCallbacks=sb;var ob={onLCP:ib,onCLS:Uy,onFCP:Hy,onINP:Yy};b.__PosthogExtensions__=b.__PosthogExtensions__||{},b.__PosthogExtensions__.postHogWebVitalsCallbacksByFlavor=b.__PosthogExtensions__.postHogWebVitalsCallbacksByFlavor||{},b.__PosthogExtensions__.postHogWebVitalsCallbacksByFlavor["web-vitals"]=ob,b.__PosthogExtensions__.postHogWebVitalsCallbacks=ob,b.postHogWebVitalsCallbacks=ob,b.__PosthogExtensions__.loadWebVitalsCallbacks=()=>ob;var ab=class{constructor(t){this.disabled=!1===t;var e=Te(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}},lb="$copy_autocapture",ub=Cn("[AutoCapture]");function hb(t,e){return e.length>t?e.slice(0,t)+"...":e}function db(t){if(t.previousElementSibling)return t.previousElementSibling;var e=t;do{e=e.previousSibling}while(e&&!Qn(e));return e}function vb(t,e){var i,r,s=e.e,o=e.maskAllElementAttributes,l=e.maskAllText,u=e.elementAttributeIgnoreList,h=e.elementsChainAsString,d=e.disableCaptureUrlHashes;if(!Qn(t))return{props:{}};for(var v=[t],c=new Set([t]),f=t;f.parentNode&&!Kn(f,"body")&&1e3>v.length;)if(Yn(f.parentNode)){var p=f.parentNode.host;if(c.has(p))break;c.add(p),v.push(p),f=p}else{if(!Qn(f.parentNode))break;if(c.has(f.parentNode))break;c.add(f.parentNode),v.push(f.parentNode),f=f.parentNode}var g="click"===s.type&&"http://www.w3.org/2000/svg"===t.namespaceURI?v.findIndex(t=>Kn(t,"button")||Kn(t,"a")):-1;g>0&&(l=l||v.slice(0,g+1).some(t=>!_s(t)||ws(t)));var m,y,b,_=[],w={},k=!1,S=!1;if(Mn(v,t=>{var e=_s(t);if(Kn(t,"a")){var i=t.getAttribute("href");k=!!(e&&i&&Es(i))&&(d?ar(i):i)}de(is(t),"ph-no-capture")&&(S=!0),_.push(function(t,e,i,r,n){void 0===n&&(n=!1);var s=t.tagName.toLowerCase(),o={tag_name:s};os.indexOf(s)>-1&&!i&&(o.$el_text="a"===s.toLowerCase()||"button"===s.toLowerCase()?hb(1024,Rs(t)):hb(1024,ns(t)));var a=is(t);a.length>0&&(o.classes=a.filter(function(t){return""!==t})),Mn(t.attributes,function(i){var s;if((!ws(t)||-1!==["name","id","class","aria-label"].indexOf(i.name))&&(null==r||!r.includes(i.name))&&!e&&Es(i.value)&&(!Ee(s=i.name)||"_ngcontent"!==s.substring(0,10)&&"_nghost"!==s.substring(0,7))){var a=i.value;"class"===i.name&&(a=ts(a).join(" ")),o["attr__"+i.name]=hb(1024,"href"===i.name&&n?ar(a):a)}});for(var l=1,u=1,h=t;h=db(h);)l++,h.tagName===t.tagName&&u++;return o.nth_child=l,o.nth_of_type=u,o}(t,o,l,u,d)),Mn(function(t){if(!_s(t))return{};var e={};return Mn(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&&Es(r)&&(e[i]=r)}}),e}(t),(t,e)=>{({}).hasOwnProperty.call(w,e)||(w[e]=t)})}),S)return{props:{},explicitNoCapture:S};if(g>0&&(t=v[g],_.splice(0,g)),l||(_[0].$el_text=Kn(t,"a")||Kn(t,"button")?Rs(t):ns(t)),k){var x,C;_[0].attr__href=k;var T=null==(x=jn(k))?void 0:x.host,M=null==a||null==(C=a.location)?void 0:C.host;T&&M&&T!==M&&(m=k)}return{props:In((y=s.type,{$event_type:y,$ce_version:1}),h?{}:{$elements:_},{$elements_chain:(b=_,xe(b)?function(t){return t.map(t=>{var e,i,r="";if(t.tag_name&&(r+=t.tag_name),t.attr_class)for(var s of(t.attr_class.sort(),t.attr_class))r+="."+s.replace(/"/g,"");var o=n({},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 En(o).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[Ps(t[0].toString())]=Ps(e.toString())}),(r+=":")+En(a).map(t=>t[0]+'="'+t[1]+'"').join("")}).join(";")}(function(t){return t.map(t=>{var e,i,r={text:null==(e=t.$el_text)?void 0:e.slice(0,400),tag_name:t.tag_name,href:null==(i=t.attr__href)?void 0:i.slice(0,2048),attr_class:Fs(t),attr_id:t.attr__id,nth_child:t.nth_child,nth_of_type:t.nth_of_type,attributes:{}};return En(t).filter(t=>0===t[0].indexOf("attr__")).forEach(t=>r.attributes[t[0]]=t[1]),r})}(b)):"")},null!=(i=_[0])&&i.$el_text?{$el_text:null==(r=_[0])?void 0:r.$el_text}:{},m&&"click"===s.type?{$external_click_url:m}:{},w),target:t}}var cb=class{Ds(){this.Ls=void 0,clearTimeout(this.Ns),this.Ns=void 0}qs(t){var e;if(!_s(t))return!0;for(var i,r=null!==(e=this.js().css_selector_ignorelist)&&void 0!==e?e:hs,n=new Set,s=t,o=function(){if(n.size>=1e3||n.has(s))return{v:!0};n.add(s);var t=s,e=is(t);if(de(e,"ph-no-capture")||de(e,"ph-sensitive")||ws(t)||r.some(e=>as(t,e)))return{v:!0};var i=s.parentNode;s=Yn(i)?i.host:i&&Qn(i)?i:null};s;)if(i=o())return i.v;return!1}Bs(t){if(this.isEnabled&&"pointercancel"!==t.type)if("pointerdown"!==t.type){var e=this.Ls;e&&(t.pointerId!==e.id||Math.abs(t.clientX-e.x)>5||Math.abs(t.clientY-e.y)>5?this.Ds():"pointerup"===t.type&&(e.released=!0,this.Ns=setTimeout(()=>this.Ds(),0)))}else{var i;this.Ds();var r=ss(t);t.isPrimary&&0===t.button&&!t.ctrlKey&&r&&Qn(r)&&(this.Ls={target:r,excluded:this.qs(r),id:t.pointerId,x:t.clientX,y:t.clientY,released:!1,distinctId:null==(i=this.Hs)?void 0:i.distinctId})}else this.Ds()}zs(t){var e,i=this.Ls;this.Ds();var r=ss(t);if(null!=i&&i.released&&i.target.isConnected&&i.distinctId===(null==(e=this.Hs)?void 0:e.distinctId)&&t.pointerId===i.id&&(t.detail>0||"touch"===t.pointerType||"pen"===t.pointerType)&&0===t.button&&5>=Math.abs(t.clientX-i.x)&&5>=Math.abs(t.clientY-i.y)&&r&&(Kn(r,"html")||Kn(r,"body"))){var n;if(i.excluded)return null;var s=null!==(n=this.js().css_selector_ignorelist)&&void 0!==n?n:hs;return[r,null==h?void 0:h.documentElement,null==h?void 0:h.body].some(t=>{if(!t)return!1;var e=is(t);return de(e,"ph-no-capture")||de(e,"ph-sensitive")||!_s(t)||ws(t)||s.some(e=>as(t,e))})?null:i.target}}constructor(t){this.Us=t,this.name="autocapture",this.Ws=!1,this.Vs=null,this.Gs=!1,this.Zs=!1,this._n={enabled:!1,rageclick:!1,maskAllElementAttributes:!1,maskAllText:!1,disableCaptureUrlHashes:!1,remoteRequestsDisabled:!1},this.Js=!1,this.Us.refresh(this._n),this.rageclicks=new ab(this._n.rageclick),this.Qs=null}setup(t){this.Ks(),this.Hs=t;var e=t.onRemoteConfig(this.onRemoteConfig.bind(this));this.Js?e.dispose():(this.Xs=e,this.startIfEnabled())}dispose(){var t;this.Js||(this.Js=!0,this.Hs=void 0,null==(t=this.Xs)||t.dispose(),this.Xs=void 0,this.Ys())}js(){return this.Us.refresh(this._n),this._n}Ks(){var t,e;return this.js(),this._n.url_allowlist=null==(t=this._n.url_allowlist)?void 0:t.map(t=>new RegExp(t)),this._n.url_ignorelist=null==(e=this._n.url_ignorelist)?void 0:e.map(t=>new RegExp(t)),this._n}eo(){if(this.isBrowserSupported()){if(a&&h){var t=this.io=t=>{t=t||(null==a?void 0:a.event);try{if("blur"===t.type)return void this.Ds();if(0===t.type.indexOf("pointer"))return void this.Bs(t);var e="click"===t.type?this.zs(t):void 0;if(Ae(e))return;this.ro(t,"$autocapture",e)}catch(t){ub.error("Failed to capture event",t)}};if(Dn(a,"blur",t),Dn(h,"submit",t,{capture:!0}),Dn(h,"change",t,{capture:!0}),Dn(h,"click",t,{capture:!0}),Mn(["pointerdown","pointermove","pointerup","pointercancel"],e=>{Dn(h,e,t,{capture:!0})}),this.js().capture_copied_text){var e=this.no=t=>{t=t||(null==a?void 0:a.event);try{this.ro(t,lb)}catch(t){ub.error("Failed to capture clipboard event",t)}};Dn(h,"copy",e,{capture:!0}),Dn(h,"cut",e,{capture:!0}),Dn(h,"paste",e,{capture:!0})}}}else ub.info("Disabling Automatic Event Collection because this browser is not supported")}Ys(){this.Ds(),this.io&&(null==a||a.removeEventListener("blur",this.io),Mn(["pointerdown","pointermove","pointerup","pointercancel"],t=>{null==h||h.removeEventListener(t,this.io,!0)}),null==h||h.removeEventListener("submit",this.io,!0),null==h||h.removeEventListener("change",this.io,!0),null==h||h.removeEventListener("click",this.io,!0),this.io=void 0),this.no&&(null==h||h.removeEventListener("copy",this.no,!0),null==h||h.removeEventListener("cut",this.no,!0),null==h||h.removeEventListener("paste",this.no,!0),this.no=void 0),this.Ws=!1}startIfEnabled(){this.isEnabled||this.Ds(),!this.Js&&this.Hs&&this.isEnabled&&!this.Ws&&(this.eo(),this.Ws=!0)}onRemoteConfig(t){if(!this.Js)if(this.Gs=!0,t.ok){var e=t.config;e.elementsChainAsString&&(this.Zs=e.elementsChainAsString);var i,r=e.autocapture_opt_out;$e(r)&&(null==(i=this.Hs)||i.kv.set(E,r),this.Vs=r),this.startIfEnabled()}else this.startIfEnabled()}setElementSelectors(t){this.Qs=t}getElementSelectors(t,e){var i,r=[];return null==(i=this.Qs)||i.forEach(i=>{var n;null==h||null==(n=h.querySelectorAll(i))||n.forEach(n=>{t!==n&&e!==n||de(r,i)||r.push(i)})}),r}get isEnabled(){var t,e;if(this.Js)return!1;var i=null==(t=this.Hs)?void 0:t.kv.get(E),r=this.Vs,n=this.js(),s=n.remoteRequestsDisabled&&!this.Gs;if(Ae(r)&&!$e(i)&&!s)return!1;var o=null!==(e=this.Vs)&&void 0!==e?e:!!i;return!!n.enabled&&!o}ro(t,e,i){if(void 0===e&&(e="$autocapture"),this.isEnabled){var r=i||ss(t);Xn(r)&&(r=r.parentNode||null);var s,o=this.Ks();"$autocapture"===e&&"click"===t.type&&t instanceof MouseEvent&&o.rageclick&&null!=(s=this.rageclicks)&&s.isRageClick(t.clientX,t.clientY,t.timeStamp||(new Date).getTime())&&ms(r,o.rageclick)&&this.ro(t,"$rageclick",i);var l=e===lb,u=l?n({},o,{dom_event_allowlist:void 0}):o;if(r&&function(t,e,i,r,n,s){var o;if(!a||ys(t))return!1;if(null!=i&&i.url_allowlist&&!es(i.url_allowlist,s))return!1;if(null!=i&&i.url_ignorelist&&es(i.url_ignorelist,s))return!1;if(null!=i&&i.dom_event_allowlist){var l=i.dom_event_allowlist;if(l&&!l.some(t=>e.type===t))return!1}var u=bs(t,r),h=u.parentIsUsefulElement,d=u.targetElementList;if(!function(t,e){var i=null==e?void 0:e.element_allowlist;if(Ie(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,i))return!1;if(!ls(d,null==i?void 0:i.css_selector_allowlist))return!1;if(ls(d,null!==(o=null==i?void 0:i.css_selector_ignorelist)&&void 0!==o?o:hs))return!1;try{var v=a.getComputedStyle(t);if(v&&"pointer"===v.getPropertyValue("cursor")&&"click"===e.type)return!0}catch(t){}var c=t.tagName.toLowerCase();switch(c){case"html":return!1;case"form":return(n||["submit"]).indexOf(e.type)>=0;case"input":case"select":case"textarea":return(n||["change","click"]).indexOf(e.type)>=0;default:return h?(n||["click"]).indexOf(e.type)>=0:(n||["click"]).indexOf(e.type)>=0&&(os.indexOf(c)>-1||"true"===t.getAttribute("contenteditable"))}}(r,t,u,l,l?["copy","cut","paste"]:void 0,{config:{get_current_url:o.getCurrentUrl}})){var h,d=vb(r,{e:t,maskAllElementAttributes:o.maskAllElementAttributes,maskAllText:o.maskAllText,elementAttributeIgnoreList:o.element_attribute_ignorelist,elementsChainAsString:this.Zs,disableCaptureUrlHashes:o.disableCaptureUrlHashes}),v=d.props;if(d.explicitNoCapture)return!1;var c=this.getElementSelectors(r,d.target);if(c&&c.length>0&&(v.$element_selectors=c),e===lb){var f=t.type||"clipboard";if("paste"!==f){var p,g,m=null==a||null==(p=a.getSelection())?void 0:p.toString(),y=rs(m);if(!y)return!1;v.$selected_content=y,v.$clipboard_text_length=null!==(g=null==m?void 0:m.length)&&void 0!==g?g:0}v.$copy_type=f}return null==(h=this.Hs)||h.capture(e,v).catch(t=>ub.error("Failed to capture event",t)),!0}}else this.Ds()}isBrowserSupported(){return Ce(null==h?void 0:h.querySelectorAll)}},fb={};function pb(t,e){var i=ss(t);return i?n({node:i,originalEvent:t,timestamp:Date.now()},e):null}function gb(t,e){return Math.abs(t)<Math.abs(e)?0>e?"up":"down":0>t?"left":"right"}function mb(t){return"swipe"===t.type?"$dead_swipe":"$dead_click"}var yb="canvas,video,audio,embed,object";function bb(t,e){return Fe(t)&&t>=e}function _b(t){return t>=0&&1e3>t?t:void 0}function wb(t,e){return e?_b(t-e):void 0}var kb=class{Yi(t){var e,i,r,n,s,o,a,l,u=this.tn((null==t?void 0:t.__onCapture)||this.en.bind(this));return{element_attribute_ignorelist:null!==(e=null==t?void 0:t.element_attribute_ignorelist)&&void 0!==e?e:u.element_attribute_ignorelist,scroll_threshold_ms:null!==(i=null==t?void 0:t.scroll_threshold_ms)&&void 0!==i?i:u.scroll_threshold_ms,selection_change_threshold_ms:null!==(r=null==t?void 0:t.selection_change_threshold_ms)&&void 0!==r?r:u.selection_change_threshold_ms,mutation_threshold_ms:null!==(n=null==t?void 0:t.mutation_threshold_ms)&&void 0!==n?n:u.mutation_threshold_ms,capture_clicks_with_modifier_keys:null!==(s=null==t?void 0:t.capture_clicks_with_modifier_keys)&&void 0!==s?s:u.capture_clicks_with_modifier_keys,capture_dead_swipes:null!==(o=null==t?void 0:t.capture_dead_swipes)&&void 0!==o?o:u.capture_dead_swipes,swipe_threshold_px:null!==(a=null==t?void 0:t.swipe_threshold_px)&&void 0!==a?a:u.swipe_threshold_px,max_dead_swipes_per_page_load:null!==(l=null==t?void 0:t.max_dead_swipes_per_page_load)&&void 0!==l?l:u.max_dead_swipes_per_page_load,css_selector_ignorelist:null==t?void 0:t.css_selector_ignorelist,__onCapture:u.__onCapture}}constructor(t,e){this.instance=t,this.rn=[],this.nn=0,this.tn=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.an=t=>{var e=pb(t,{type:"click"});Ae(e)||this.sn(e)||this.un(e),this.ln()},this.hn=()=>{var t=Date.now();this.cn=t,t%50==0&&this.rn.forEach(e=>{Ie(e.scrollDelayMs)&&(e.scrollDelayMs=t-e.timestamp)})},this.dn=()=>{this.vn=Date.now()},this.Ze=()=>{var t=Date.now();this.fn=t,this.pn("visibilityChangedDelayMs",t)},this.gn=()=>{var t=Date.now();this.mn=t,this.pn("focusChangedDelayMs",t)},this.yn=t=>{var e=t.touches,i=1===(null==e?void 0:e.length)?e[0]:void 0;this.bn=i?{x:i.clientX,y:i.clientY,timestamp:Date.now()}:void 0},this.wn=()=>{this.bn=void 0},this.kn=t=>{var e,i=this.bn;if(this.bn=void 0,!Ie(i)&&this._n.max_dead_swipes_per_page_load>this.nn){var r=t,n=null==(e=r.changedTouches)?void 0:e[0];if(n){var s=n.clientX-i.x,o=n.clientY-i.y,a=s*s+o*o,l=this._n.swipe_threshold_px;if(a>=l*l&&![this.cn,this.Sn,this.vn].some(t=>Fe(t)&&t>=i.timestamp)){var u;if(this.xn()&&(null!==(u=null==h||null==h.elementsFromPoint?void 0:h.elementsFromPoint(i.x,i.y))&&void 0!==u?u:[]).some(t=>null==t.matches?void 0:t.matches(yb)))return;var d=pb(r,{type:"swipe",swipeDirection:gb(s,o),swipeDistancePx:Math.round(Math.sqrt(a))});Ae(d)||this.sn(d)||this.un(d),this.ln()}}}},this._n=this.Yi(e),this._onCapture=this._n.__onCapture}start(t){this.Cn(),this.Mn(),this.Tn(),this.In(),this.Rn(),this.An(t),this._n.capture_dead_swipes&&this.En()}An(t){if(!this.Ln){var e=function(t){return function(t,e){var i=fb[t];if(i)return i;var r=e[t];if((t=>Ce(t)&&-1!==t.toString().indexOf("[native code]"))(r)&&(null==a||!a.Zone))return fb[t]=r.bind(e);var n=e.document;if(n&&Ce(n.createElement)){var s,o=!1;try{(s=n.createElement("iframe")).hidden=!0,n.head.appendChild(s);var l,u,h=s.contentWindow;h&&h[t]&&(r=h[t],"MutationObserver"===t&&function(t){return de(t,"AppleWebKit")&&!de(t,"Chrome")}(null!==(l=null==(u=e.navigator)?void 0:u.userAgent)&&void 0!==l?l:"")&&(s.classList.add("rr-block","ph-no-capture"),o=!0))}catch(e){xn.warn("Could not create sandbox iframe for "+t+" check, bailing to assignableWindow."+t+": ",e)}finally{var d;!o&&null!=(d=s)&&d.parentNode&&s.parentNode.removeChild(s)}}return r&&Ce(r)?fb[t]=r.bind(e):r}("MutationObserver",t)}(b);this.Ln=new e(t=>{this.On(t)}),this.Ln.observe(t,{attributes:!0,characterData:!0,childList:!0,subtree:!0})}}stop(){var t;null==(t=this.Ln)||t.disconnect(),this.Ln=void 0,b.removeEventListener("click",this.an),b.removeEventListener("scroll",this.hn,{capture:!0}),b.removeEventListener("selectionchange",this.dn),b.removeEventListener("touchstart",this.yn,{capture:!0}),b.removeEventListener("touchend",this.kn,{capture:!0}),b.removeEventListener("touchcancel",this.wn,{capture:!0}),null==h||h.removeEventListener("visibilitychange",this.Ze),b.removeEventListener("blur",this.gn),b.removeEventListener("focus",this.gn),this.bn=void 0}On(t){this.Sn=Date.now()}Cn(){Dn(b,"click",this.an)}un(t){t.visibilityChangedDelayMs=wb(t.timestamp,this.fn),t.focusChangedDelayMs=wb(t.timestamp,this.mn),this.rn.push(t)}ln(){this.rn.length&&Ie(this.Dn)&&(this.Dn=b.setTimeout(()=>{this.Pn()},1e3))}Mn(){Dn(b,"scroll",this.hn,{capture:!0})}Tn(){Dn(b,"selectionchange",this.dn)}In(){Dn(h,"visibilitychange",this.Ze)}Rn(){Dn(b,"blur",this.gn),Dn(b,"focus",this.gn)}pn(t,e){this.rn.forEach(i=>{var r=_b(e-i.timestamp);Fe(r)&&(Ie(i[t])||i[t]>r)&&(i[t]=r)})}En(){Dn(b,"touchstart",this.yn,{capture:!0,passive:!0}),Dn(b,"touchend",this.kn,{capture:!0,passive:!0}),Dn(b,"touchcancel",this.wn,{capture:!0,passive:!0})}xn(){var t=Ie(this.Fn)||Fe(this.Sn)&&this.Sn>this.Fn;return(Ie(this.Nn)||t)&&(this.Fn=Date.now(),this.Nn=!(null==h||!h.querySelector(yb))),!!this.Nn}sn(t){return!t||("swipe"===t.type?this.qn(t):this.jn(t))}qn(t){return!(!Jn(t.node)&&!this.rn.some(e=>e.type===t.type&&e.node===t.node&&1e3>Math.abs(e.timestamp-t.timestamp))&&!Kn(t.node,"html")&&Qn(t.node)&&function(t,e){var i;if(!a||ys(t))return!1;var r=$e(e)?fs:null!==(i=null==e?void 0:e.css_selector_ignorelist)&&void 0!==i?i:fs;return!ls(bs(t,!1).targetElementList,r)}(t.node,{css_selector_ignorelist:this._n.css_selector_ignorelist}))}jn(t){return!(this._n.capture_clicks_with_modifier_keys||(e=t.originalEvent,!(e.ctrlKey||e.metaKey||e.altKey||e.shiftKey)))||!!this.qn(t)||(i=t.node,!(!a||ys(i))&&bs(i,!1).targetElementList.some(t=>Kn(t,"a")));var e,i}Pn(){if(this.rn.length){clearTimeout(this.Dn),this.Dn=void 0;var t=this.rn;for(var e of(this.rn=[],t)){var i;e.mutationDelayMs=null!==(i=e.mutationDelayMs)&&void 0!==i?i:this.Sn&&this.Sn>=e.timestamp?this.Sn-e.timestamp:void 0,e.absoluteDelayMs=Date.now()-e.timestamp,e.selectionChangedDelayMs=this.vn&&this.vn>=e.timestamp?this.vn-e.timestamp:void 0;var r=bb(e.scrollDelayMs,this._n.scroll_threshold_ms),n=bb(e.selectionChangedDelayMs,this._n.selection_change_threshold_ms),s=bb(e.mutationDelayMs,this._n.mutation_threshold_ms),o=bb(e.absoluteDelayMs,1.1*this._n.mutation_threshold_ms),a=Fe(e.scrollDelayMs)&&this._n.scroll_threshold_ms>e.scrollDelayMs,l=Fe(e.mutationDelayMs)&&this._n.mutation_threshold_ms>e.mutationDelayMs,u=Fe(e.selectionChangedDelayMs)&&this._n.selection_change_threshold_ms>e.selectionChangedDelayMs,h=Fe(e.visibilityChangedDelayMs),d=Fe(e.focusChangedDelayMs);if(!(a||l||u||h||d))if(r||s||o||n){var v=mb(e);if("$dead_swipe"===v){if(this.nn>=this._n.max_dead_swipes_per_page_load)continue;this.nn++}this._onCapture(e,{[v+"_last_mutation_timestamp"]:this.Sn,[v+"_event_timestamp"]:e.timestamp,[v+"_scroll_timeout"]:r,[v+"_mutation_timeout"]:s,[v+"_absolute_timeout"]:o,[v+"_selection_changed_timeout"]:n,[v+"_visibility_changed_timeout"]:!1})}else this._n.mutation_threshold_ms>e.absoluteDelayMs&&this.rn.push(e)}this.ln()}}en(t,e){var i=mb(t);this.instance.capture(i,n({},e,vb(t.node,{e:t.originalEvent,maskAllElementAttributes:this.instance.config.mask_all_element_attributes,maskAllText:this.instance.config.mask_all_text,elementAttributeIgnoreList:this._n.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)})}};b.__PosthogExtensions__=b.__PosthogExtensions__||{},b.__PosthogExtensions__.initDeadClicksAutocapture=(t,e)=>new kb(t,e);var Sb=Cn("[ExternalScriptsLoader]"),xb=t=>{var e=null==h?void 0:h.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]},Cb=(t,e,i)=>{if(t.config.disable_external_dependency_loading)return Sb.warn(e+" was requested but loading of external scripts is disabled."),i("Loading of external scripts is disabled");var r=xb(e);if(r){if(r.__posthog_loading_callback_fired)return i();var n=r.__posthog_loading_error;return n?i(n):(r.addEventListener("load",t=>{r.__posthog_loading_callback_fired=!0,i(void 0,t)}),void r.addEventListener("error",t=>{r.__posthog_loading_error=t,i(t)}))}var s=()=>{if(!h)return i("document not found");if(xb(e))return Cb(t,e,i);var r=h.createElement("script");if(r.type="text/javascript",r.crossOrigin="anonymous",r.src=e,r.onload=t=>{r.__posthog_loading_callback_fired=!0,i(void 0,t)},r.onerror=t=>{r.__posthog_loading_error=t,i(t)},t.config.prepare_external_dependency_script&&(r=t.config.prepare_external_dependency_script(r)),!r)return i("prepare_external_dependency_script returned null");if("head"===t.config.external_scripts_inject_target)h.head.appendChild(r);else{var n,s=h.querySelectorAll("body > script");s.length>0?null==(n=s[0].parentNode)||n.insertBefore(r,s[0]):h.body.appendChild(r)}};null!=h&&h.body?s():null==h||h.addEventListener("DOMContentLoaded",s)},Tb={},Mb=(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)};b.__PosthogExtensions__=b.__PosthogExtensions__||{},b.__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=Tb[n];if("fallback"===r&&s){if(xb(s))return void Cb(t,s,i);delete Tb[n]}Cb(t,n,"fallback"===r?(r,s)=>{if(r)if("string"==typeof r)i(r);else{var o,a=Mb(t,e);Tb[n]=a;var l=xb(n);null==l||null==(o=l.parentNode)||o.removeChild(l),Cb(t,a,i)}else i(void 0,s)}:i)}else Cb(t,Mb(t,e),i)}else Cb(t,t.requestRouter.endpointFor("assets","/array/"+t.config.token+"/config.js"),i)},b.__PosthogExtensions__.loadSiteApp=(t,e,i)=>{Cb(t,t.requestRouter.endpointFor("api",e),i)};var Ib=class{constructor(t){this._instance=t}get _n(){return this._instance.config}get consent(){return this.so()?0:this.oo}isOptedOut(){return"always"===this._n.cookieless_mode||this.isRejected()||-1===this.consent&&"on_reject"===this._n.cookieless_mode}isOptedIn(){return!this.isOptedOut()}isExplicitlyOptedOut(){return 0===this.consent}isRejected(){return 0===this.consent||-1===this.consent&&this._n.opt_out_capturing_by_default}optInOut(t){this.ao.ui(this.lo,t?1:0,this._n.cookie_expiration,this._n.cross_subdomain_cookie,this._n.secure_cookie)}reset(){this.ao.hi(this.lo,this._n.cross_subdomain_cookie)}get lo(){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 oo(){var t=this.ao.li(this.lo);return We(t)?1:de(Ve,t)?0:-1}get ao(){var t=this._n.opt_out_capturing_persistence_type,e="localStorage"===t?sp:rp,i=e.si()?e:mp;if(!this.uo||this.uo!==i){this.uo=i;var r="localStorage"===t?rp:sp;r.li(this.lo)&&(this.uo.li(this.lo)||this.optInOut(We(r.li(this.lo))),r.hi(this.lo,this._n.cross_subdomain_cookie))}return this.uo}so(){return!!this._n.respect_dnt&&[null==u?void 0:u.doNotTrack,null==u?void 0:u.msDoNotTrack,b.doNotTrack,null==u?void 0:u.globalPrivacyControl].some(t=>We(t))}},Eb=Cn("[Dead Clicks]"),Rb=()=>!0,Ab=t=>{var e,i=!(null==(e=t.instance.persistence)||!e.get_property(D)),r=t.instance.config.capture_dead_clicks;return $e(r)?r:!!Te(r)||i},Pb=class{get lazyLoadedDeadClicksAutocapture(){return this.ho}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({[D]:e.captureDeadClicks}),this.startIfEnabledOrStop())}}startIfEnabledOrStop(){this.isEnabled(this)?this.do(()=>{this.vo()}):this.stop()}do(t){var e,i;null!=(e=b.__PosthogExtensions__)&&e.initDeadClicksAutocapture?t():null==(i=b.__PosthogExtensions__)||null==i.loadExternalDependency||i.loadExternalDependency(this.instance,"dead-clicks-autocapture",e=>{e?Eb.error("failed to load script",e):t()})}vo(){var t;if(h){if(!this.ho&&null!=(t=b.__PosthogExtensions__)&&t.initDeadClicksAutocapture){var e=Te(this.instance.config.capture_dead_clicks)?n({},this.instance.config.capture_dead_clicks):{};e.__onCapture=this.onCapture,this.onCapture&&(e.capture_dead_swipes=!1),this.ho=b.__PosthogExtensions__.initDeadClicksAutocapture(this.instance,e),this.ho.start(h),Eb.info("starting...")}}else Eb.error("`document` not found. Cannot start.")}stop(){this.ho&&(this.ho.stop(),this.ho=void 0,Eb.info("stopping..."))}},Fb=Cn("[SegmentIntegration]");function Ob(t,e,i){void 0===i&&(i=!0);var r=t.config.segment;if(!r)return e();!function(t,e,i){var r=t.config.segment;if(!r)return e();var n=r=>{var n=()=>r.anonymousId()||Xf();t.config.get_device_id=n,i&&r.id()&&(t.register({distinct_id:r.id(),$device_id:n()}),t.persistence.set_property(At,ee)),e(i?void 0:r.anonymousId()||void 0)},s=r.user();"then"in s&&Ce(s.then)?s.then(n):n(s)}(t,i=>{r.register(((t,e)=>{"undefined"!=typeof Promise&&Promise.resolve||Fb.warn("This browser does not have Promise support, and can not use the segment integration");var i=(i,r)=>{if(!r)return i;var n=!!e&&i.event.anonymousId===e&&!i.event.userId;n||i.event.userId||i.event.anonymousId===t.get_distinct_id()||(Fb.info("No userId set, resetting PostHog"),t.reset()),n||(e=void 0),i.event.userId&&i.event.userId!==t.get_distinct_id()&&(Fb.info("UserId set, identifying with PostHog"),t.identify(i.event.userId));var s=t.calculateEventProperties(r,i.event.properties);return i.event.properties=Object.assign({},s,i.event.properties),i};return{name:"PostHog JS",type:"enrichment",version:"1.0.0",isLoaded(){return!0},load(){return Promise.resolve()},track(t){return i(t,t.event.event)},page(t){return i(t,se)},identify(t){return i(t,ae)},screen(t){return i(t,"$screen")}}})(t,i)).then(()=>{e()},t=>{Fb.error("Failed to register the Segment integration",t),e()})},i)}var $b="posthog-js";function Db(t,e){var i=void 0===e?{}:e,r=i.organization,s=i.projectId,o=i.prefix,a=i.severityAllowList,l=void 0===a?["error"]:a,u=i.sendExceptionsToPostHog,h=void 0===u||u;return e=>{var i,a,u,d,v,c;if("*"!==l&&!l.includes(e.level)||!t.__loaded)return e;e.tags||(e.tags={});var f=t.requestRouter.endpointFor("ui","/project/"+t.config.token+"/person/"+t.get_distinct_id());e.tags["PostHog Person URL"]=f,t.sessionRecordingStarted()&&(e.tags["PostHog Recording URL"]=t.get_session_replay_url({withTimestamp:!0}));var p=(null==(i=e.exception)?void 0:i.values)||[],g=p.map(t=>n({},t,{stacktrace:t.stacktrace?n({},t.stacktrace,{type:"raw",frames:(t.stacktrace.frames||[]).map(t=>n({},t,{platform:"web:javascript"}))}):void 0})),m={$exception_message:(null==(a=p[0])?void 0:a.value)||e.message,$exception_type:null==(u=p[0])?void 0:u.type,$exception_level:e.level,$exception_list:g,$sentry_event_id:e.event_id,$sentry_exception:e.exception,$sentry_exception_message:(null==(d=p[0])?void 0:d.value)||e.message,$sentry_exception_type:null==(v=p[0])?void 0:v.type,$sentry_tags:e.tags};return r&&s&&(m.$sentry_url=(o||"https://sentry.io/organizations/")+r+"/issues/?project="+s+"&query="+e.event_id),h&&(null==(c=t.exceptions)||c.sendExceptionEvent(m)),e}}var Lb=class{constructor(t,e,i,r,n,s){this.name=$b,this.setupOnce=function(o){o(Db(t,{organization:e,projectId:i,prefix:r,severityAllowList:n,sendExceptionsToPostHog:null==s||s}))}}},Nb=class{constructor(t){this.co=(t,e,i)=>{i&&(i.noSessionId||i.activityTimeout||i.sessionPastMaximumLength||i.crossTabAdoption)&&(xn.info("[PageViewManager] Session rotated, clearing pageview state",{sessionId:t,changeReason:i}),this.fo=void 0,this._instance.scrollManager.resetContext())},this._instance=t,this.po()}po(){var t;this.mo=null==(t=this._instance.sessionManager)?void 0:t.onSessionId(this.co)}destroy(){var t;null==(t=this.mo)||t.call(this),this.mo=void 0}doPageView(t,e){var i,r=this.yo(t,e);return this.fo={pathname:null!==(i=null==a?void 0:a.location.pathname)&&void 0!==i?i:"",pageViewId:e,timestamp:t},this._instance.scrollManager.resetContext(),r}doPageLeave(t){var e;return this.yo(t,null==(e=this.fo)?void 0:e.pageViewId)}doEvent(){var t;return{$pageview_id:null==(t=this.fo)?void 0:t.pageViewId}}yo(t,e){var i=this.fo;if(!i)return{$pageview_id:e};var r={$pageview_id:e,$prev_pageview_id:i.pageViewId},n=this._instance.scrollManager.getContext();if(n&&!this._instance.config.disable_scroll_properties){var s=n.maxScrollHeight,o=n.lastScrollY,a=n.maxScrollY,l=n.maxContentHeight,u=n.lastContentY,h=n.maxContentY;if(!(Ie(s)||Ie(o)||Ie(a)||Ie(l)||Ie(u)||Ie(h))){s=Math.ceil(s),o=Math.ceil(o),a=Math.ceil(a),l=Math.ceil(l),u=Math.ceil(u),h=Math.ceil(h);var d=s>1?Ge(o/s,0,1,xn):1,v=s>1?Ge(a/s,0,1,xn):1,c=l>1?Ge(u/l,0,1,xn):1,f=l>1?Ge(h/l,0,1,xn):1;r=In(r,{$prev_pageview_last_scroll:o,$prev_pageview_last_scroll_percentage:d,$prev_pageview_max_scroll:a,$prev_pageview_max_scroll_percentage:v,$prev_pageview_last_content:u,$prev_pageview_last_content_percentage:c,$prev_pageview_max_content:h,$prev_pageview_max_content_percentage:f})}}return i.pathname&&(r.$prev_pageview_pathname=i.pathname),i.timestamp&&(r.$prev_pageview_duration=(t.getTime()-i.timestamp.getTime())/1e3),r}},qb=["flags","surveys"],jb={[_]:{exposure:"hidden"},[x]:{exposure:"hidden"},[C]:{exposure:"hidden"},[I]:{exposure:"hidden"},[M]:{exposure:"hidden"},[E]:{exposure:"event"},[R]:{exposure:"hidden"},[N]:{exposure:"hidden"},[A]:{exposure:"event"},[P]:{exposure:"hidden"},[F]:{exposure:"event"},[O]:{exposure:"event"},[D]:{exposure:"event"},[L]:{exposure:"hidden"},[q]:{exposure:"event"},[j]:{exposure:"hidden"},[B]:{exposure:"hidden"},[G]:{exposure:"hidden"},[Z]:{exposure:"event"},[H]:{exposure:"event",shouldSkipFromEventProperties:t=>Ae(t)},[J]:{exposure:"event"},[Q]:{exposure:"event"},[K]:{exposure:"event"},[et]:{exposure:"event"},[it]:{exposure:"hidden"},[rt]:{exposure:"hidden",storageGroup:"flags"},[nt]:{exposure:"hidden",storageGroup:"flags"},[st]:{exposure:"hidden"},[ot]:{exposure:"hidden",storageGroup:"flags"},[at]:{exposure:"hidden",storageGroup:"flags"},[lt]:{exposure:"hidden",storageGroup:"flags",volatile:!0},[ut]:{exposure:"hidden",storageGroup:"flags"},[ht]:{exposure:"hidden"},[dt]:{exposure:"hidden"},[vt]:{exposure:"hidden"},[ct]:{exposure:"hidden"},[pt]:{exposure:"hidden",storageGroup:"surveys"},[gt]:{exposure:"hidden",storageGroup:"surveys",volatile:!0},[mt]:{exposure:"event"},[yt]:{exposure:"hidden"},[bt]:{exposure:"hidden"},[_t]:{exposure:"hidden"},[wt]:{exposure:"hidden"},[kt]:{exposure:"hidden"},[St]:{exposure:"event"},[xt]:{exposure:"event"},[Ct]:{exposure:"event"},[Tt]:{exposure:"event"},[Mt]:{exposure:"hidden"},[It]:{exposure:"hidden"},[ft]:{exposure:"event"},[Et]:{exposure:"hidden"},[Rt]:{exposure:"hidden",storageGroup:"flags",volatile:!0},[At]:{exposure:"hidden"},[Pt]:{exposure:"hidden"},[Ft]:{exposure:"hidden"},[Ot]:{exposure:"hidden"},[$t]:{exposure:"hidden"},[Dt]:{exposure:"hidden"},[Lt]:{exposure:"hidden"},[z]:{exposure:"event"},[U]:{exposure:"event"},[W]:{exposure:"event"},[V]:{exposure:"event"},[jt]:{exposure:"event"},[Bt]:{exposure:"event"},[Ht]:{exposure:"event"},[zt]:{exposure:"event"},[Ut]:{exposure:"event"},[Wt]:{exposure:"event"},[Vt]:{exposure:"event"},[Gt]:{exposure:"event"},[Zt]:{exposure:"event"},[Jt]:{exposure:"event"},[Xt]:{exposure:"event"}},Bb=[[X,{exposure:"hidden"}],[Y,{exposure:"hidden"}],[tt,{exposure:"hidden"}]],Hb=t=>{var e=jb[t];if(e)return e;for(var i of Bb){var r=i[1];if(0===t.indexOf(i[0]))return r}},zb={flags:Rt,surveys:gt},Ub=["cookie","localstorage","localstorage+cookie","sessionstorage","memory"],Wb=t=>t+"_cookie_identity_change_pending",Vb=t=>{var e="",i=0;for(var r of t){var n=encodeURIComponent(JSON.stringify(r).slice(1,-1)).length;if(i+n>1e3)break;e+=r,i+=n}return e},Gb="main",Zb=[rt,nt,ot,at,lt,Rt,ut,vt],Jb=t=>-1!==Zb.indexOf(t),Qb=(t,e)=>{try{return JSON.stringify(t)===JSON.stringify(e)}catch(i){return t===e}},Kb=t=>{if(!t)return{};var e=JSON.parse(t);return Te(e)?e:{}},Xb=(t,e)=>{Mn(t,(i,r)=>{var n=Hb(r);n&&"event"!==n.exposure||{}.hasOwnProperty.call(e,r)||delete t[r]})},Yb=class{constructor(t,e,i){if(void 0===i&&(i=!0),this.bo={},this._o=!1,this.wo=!1,this.ko=!1,this.So=!1,this.xo=!1,this.Co=new Map,this.To=!1,this.Mo=!1,this.Io=!1,this.Eo=!1,this.Ro=new Set,this._n=t,this.Ao=i,this.props={},this.Po=void 0,this.Fo=(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"})(t),this.ao=this.Oo(t),this.ko=this.$o(t),this.load(),this.Do(),t.debug&&xn.info("Persistence loaded",t.persistence,n({},this.props)),this.update_config(t,t,e),this.save(),a){var r=()=>this.flush();Dn(a,"beforeunload",r,{capture:!1}),Dn(a,"pagehide",r,{capture:!1}),this.Lo=t=>{if(this._o&&(!t.storageArea||t.storageArea===(null==a?void 0:a.localStorage))&&t.key)if(t.key!==this.Fo){if(this.ko){var e=qb.find(e=>t.key===this.No(e));e&&this.qo(t.key,e)}}else this.qo(t.key,Gb)},Dn(a,"storage",this.Lo)}}markCrossTabFeatureFlagChanges(t){Object.entries(t).forEach(t=>{var e=t[0],i=t[1],r=this.Co.get(e);if(Jb(e)&&!0!==r)if(!0!==i){var n=new Set(r||[]);i.forEach(t=>n.add(t)),n.size&&this.jo(e,n)}else this.jo(e,!0)})}onCrossTabFeatureFlagChange(t){return this.Ro.add(t),()=>this.Ro.delete(t)}destroy(){this.Lo&&a&&(a.removeEventListener("storage",this.Lo),this.Lo=void 0),this.Ro.clear()}qo(t,e,i){if(void 0===i&&(i=!0),this.Bo)return!1;var r,n;try{if(n=sp.li(t),Ae(n)){var s=this.Ho(e);return s.storageValue=null,e!==Gb&&(s.persisted=!1),!1}r=Kb(n)}catch(t){return!1}var o=e===Gb?r:sp.di(this.Fo);if(o&&this.zo(o))return!1;var a=this.Uo(r,e,i);return e===Gb&&this.ko&&!Qb(this.Wo().main,r)||this.Vo(r,e,!0,n),a}zo(t){var e=this.props[w],i=t[w];return!Ie(e)&&!Ie(i)&&e!==i}Vo(t,e,i,r){var n=this.Ho(e);n.storageValue=r,e!==Gb&&(n.persisted=i);try{n.fingerprint=this.Go(t,e)}catch(t){n.fingerprint=void 0}}Uo(t,e,i){var r=!1;return Zb.forEach(i=>{var n,s=null==(n=Hb(i))?void 0:n.storageGroup;if(!(e===Gb&&this.ko&&s||e!==Gb&&s!==e)){var o=i in t,a=this.Zo(i,o?t[i]:void 0),l=this.Co.has(i)?i in this.props:o;l===i in this.props&&Qb(a,this.props[i])||(l?this.Jo(i,a,!1):this.Qo(i,!1),r=!0)}}),r&&i&&this.Ro.forEach(t=>t()),r}Ko(){if(!this._o)return!1;try{this.Io=!1;var t,e=sp.li(this.Fo),i=this.Ho(Gb),r=!1,n=!1;if(e!==i.storageValue)if(Ae(e))i.storageValue=null;else{if(t=Kb(e),this.Io=!this.Mo&&this.zo(t),this.Io)return!1;n=this.Uo(t,Gb,!1),!this.ko||Qb(this.Wo().main,t)?this.Vo(t,Gb,!0,e):i.storageValue=e,r=!0}return this.ko&&qb.forEach(e=>{var i=sp.li(this.No(e)),s=this.Ho(e),o=t||{},a=r&&Zb.some(t=>{var i;return(null==(i=Hb(t))?void 0:i.storageGroup)===e&&t in o});if(i!==s.storageValue||a){if(Ae(i))return s.storageValue=null,s.persisted=!1,void(a&&(n=this.Uo(o,e,!1)||n));var l=Kb(i);n=this.Uo(l,e,!1)||n,this.Vo(l,e,!0,i)}}),n}catch(t){return!1}}jo(t,e){this.Co.set(t,e);var i=Hb(t);null!=i&&i.volatile||(this.Ho((this.ko?null==i?void 0:i.storageGroup:void 0)||Gb).fingerprint=void 0,this.Xo(t))}Yo(){Zb.forEach(t=>this.Co.set(t,!0))}Do(){if(this._o)try{var t=sp.li(this.Fo),e=Kb(t);this.Ho(Gb).storageValue=t,Zb.forEach(t=>{var i,r=this.ko?null==(i=Hb(t))?void 0:i.storageGroup:void 0,n=r?sp.li(this.No(r)):null;if(r){var s=this.Ho(r);s.storageValue=n,s.persisted=!Ae(n)}var o=r&&!Ae(n)?Kb(n):e;t in this.props?this.ta(t,o[t],this.props[t]):t in o&&this.jo(t,!0)})}catch(t){}}Zo(t,e){var i=this.Co.get(t);if(!i)return e;if(!0===i)return this.props[t];if("$active_feature_flags"===t){var r=new Set(xe(e)?e:[]),s=new Set(xe(this.props[t])?this.props[t]:[]);return i.forEach(t=>s.has(t)?r.add(t):r.delete(t)),Array.from(r)}var o=Te(e)?n({},e):{},a=Te(this.props[t])?this.props[t]:{};return i.forEach(t=>{t in a?o[t]=a[t]:delete o[t]}),o}ta(t,e,i){if(Jb(t)){var r=this.Co.get(t);if(!0!==r){var n=e;if(this._o)try{var s,o=this.ko?null==(s=Hb(t))?void 0:s.storageGroup:void 0,a=o?this.No(o):this.Fo;n=Kb(sp.li(a))[t]}catch(t){}var l=new Set(r||[]);if("$active_feature_flags"===t){if(!Ie(e)&&!xe(e)||!Ie(n)&&!xe(n)||!xe(i))return void this.jo(t,!0);var u=new Set(e||[]),h=new Set(n||[]),d=new Set(i);new Set([...u,...d]).forEach(t=>{u.has(t)!==d.has(t)&&l.add(t)}),l.forEach(t=>{h.has(t)===d.has(t)&&l.delete(t)})}else{if(!Te(i))return void(Qb(n,i)?this.Co.delete(t):this.jo(t,!0));if(!Ie(e)&&!Te(e)||Ie(e)&&Me(i)&&Ie(n))return void this.jo(t,!0);var v=Te(e)?e:{},c=Te(n)?n:{};new Set([...Object.keys(v),...Object.keys(i)]).forEach(t=>{t in v==t in i&&Qb(v[t],i[t])||l.add(t)}),l.forEach(t=>{t in c==t in i&&Qb(c[t],i[t])&&l.delete(t)})}l.size?this.jo(t,l):this.Co.delete(t)}}}ea(){var t,e=null==(t=this._n)?void 0:t.persistence_save_debounce_ms;return Fe(e)&&e>0?e:0}ia(t){if(this._n.cookieWinsOnConflict&&"localstorage+cookie"===this._n.persistence.toLowerCase())if(t)try{var e=dp(t,this._n.cookie_persisted_properties||[]),i=cp(e,this._n.cookie_persisted_properties||[]),r=JSON.stringify(e)+"|"+JSON.stringify(i),n=rp.li(this.Fo)||void 0;n&&pp(this.Fo,n)===r&&(this.ra=r,this.na=n)}catch(t){}else try{var s=rp.li(this.Fo)||void 0;this.ra=s?pp(this.Fo,s):void 0,this.na=s}catch(t){}}syncCookieProperties(){return this.sa(this._n)}sa(t,e){if(void 0===e&&(e=!1),this.Bo&&!e||this.xo||!t.cookieWinsOnConflict||"localstorage+cookie"!==t.persistence.toLowerCase())return!1;var i;try{i=rp.li(this.Fo)||void 0}catch(t){}if(!i||i===this.na)return!1;var r,n=pp(this.Fo,i);try{r=hp(JSON.parse(i))}catch(t){return!1}if((rp.li(this.Fo)||void 0)!==i)return!1;this.ra=n,this.na=i;var s=fp(this.Fo,i),o=[...ap,...s.properties],a={};if(Object.keys(r).forEach(t=>{var e=r[t];(Ie(e)||Ae(e)||""===e||"$user_state"===t&&"anonymous"!==e&&"identified"!==e)&&(a[t]=!0,delete r[t])}),Me(r))return!1;var l="distinct_id"in r||"anonymous"===r.$user_state||"identified"===r.$user_state,u=this.props,h=u[w],d=u[At],v=In({},u);[...ap,...t.cookie_persisted_properties||[]].forEach(t=>{if(-1!==o.indexOf(t)&&!(t in r)&&!a[t]&&(l||"distinct_id"!==t&&"$user_state"!==t)){var e=v[t];(s.isValid||-1===ap.indexOf(t)||!1!==e&&0!==e)&&delete v[t]}}),this.props=In(v,r),Zb.forEach(t=>{var e=t in this.props;t in u===e&&Qb(u[t],this.props[t])||(e?this.ta(t,u[t],this.props[t]):this.jo(t,!0))}),!l||"$user_state"in r||"$user_state"in this.props||this.Jo(At,te);var c=this.props[w],f=this.props[At];return!l||c===h&&f===d||(this.Mo=!0,this.So=!0,bp.ui(Wb(this.Fo),!0),this.Qo(vt),this.Qo(nt),this.Qo(rt),this.Qo(ot),this.Qo(at),this.Qo(lt),this.Qo(Rt),this.Qo(Et),this.Qo(Mt),"anonymous"!==f||"identified"!==d&&"anonymous"!==r.$user_state&&(Ie(h)||c===h)||(Xb(this.props,r),this.Qo(ct)),"identified"===f?this.props.$user_id=c:delete this.props.$user_id,this.Qo(x)),!0}consumeCookieIdentityChange(){var t=Wb(this.Fo),e=this.So||!!bp.li(t);return this.So=!1,e&&bp.hi(t),e}oa(t){return void 0===t&&(t=!1),!(this.xo||this.Bo&&!t||!this._n.cookieWinsOnConflict||"localstorage+cookie"!==this._n.persistence.toLowerCase()||(this.xo=!0,0))}aa(){this.xo&&(Ie(this.la)||(clearTimeout(this.la),this.la=void 0),delete this.bo[Gb],this.ua(!0))}ha(t){if(void 0===t&&(t=!0),this.xo)try{t?this.aa():Ie(this.la)||(clearTimeout(this.la),this.la=void 0)}finally{this.xo=!1}}isDisabled(){return!!this.Bo}Oo(t){-1===Ub.indexOf(t.persistence.toLowerCase())&&(xn.critical("Unknown persistence type "+t.persistence+"; falling back to localStorage+cookie"),t.persistence="localStorage+cookie");var e,i=function(t,e){void 0===t&&(t=[]),void 0===e&&(e=!1);var i=[...ap,...t];return n({},sp,{di(t){try{var r,n={};try{r=rp.li(t)||void 0,n=r?hp(JSON.parse(r)):{}}catch(t){}var s,o=JSON.parse(sp.li(t)||"{}");if(e){var a=fp(t,r),l=[...ap,...a.properties],u={};Object.keys(n).forEach(t=>{var e=n[t];Ae(e)||""===e||"$user_state"===t&&"anonymous"!==e&&"identified"!==e||(u[t]=e)});var h="distinct_id"in u||"anonymous"===u.$user_state||"identified"===u.$user_state;if(Object.keys(u).length>0){var d,v=o[w],c=null!==(d=o.$user_state)&&void 0!==d?d:"anonymous";i.forEach(t=>{if(-1!==l.indexOf(t)&&!(t in n)&&(h||"distinct_id"!==t&&"$user_state"!==t)){var e=o[t];(a.isValid||-1===ap.indexOf(t)||!1!==e&&0!==e)&&delete o[t]}}),!h||"$user_state"in n||"$user_state"in o||(o[At]=te),!h||("distinct_id"in u?u[w]:o[w])===v&&("$user_state"in u?u[At]:o[At])===c||(op.forEach(t=>delete o[t]),"identified"===u.$user_state&&"distinct_id"in u?o.$user_id=u[w]:delete o.$user_id,"identified"!==u.$user_state&&(delete o[ft],delete o[ct]),delete o.__alias)}s=In(o,u)}else s=In(n,o);return sp.ui(t,s),s}catch(t){}return null},ui(i,r,n,s,o,a){var l=sp.ui(i,r,void 0,void 0,a);try{var u=dp(r,t);if(Object.keys(u).length){if(e){var h=lp(i),d=cp(u,t);if(rp.ui(h,d,n,s,o,a),rp.li(h)!==JSON.stringify(d)){rp.hi(h,s);var v=dp(r);return rp.ui(i,v,n,s,o,a),l}}rp.ui(i,u,n,s,o,a)}}catch(t){sp.ci(t)}return l},hi(t,e){try{null==a||a.localStorage.removeItem(t),rp.hi(t,e),rp.hi(lp(t),e)}catch(t){sp.ci(t)}}})}(t.cookie_persisted_properties||[],t.cookieWinsOnConflict),r=!1,s=!1,o=t.persistence.toLowerCase();return"localstorage"===o&&sp.si()?(e=sp,s=!0):"localstorage+cookie"===o&&i.si()?(e=i,s=!0,r=!0):"sessionstorage"===o&&bp.si()?e=bp:"memory"===o?e=mp:"cookie"===o&&rp.si()?(e=rp,r=!0):i.si()?(e=i,s=!0,r=!0):rp.si()?(e=rp,r=!0):e=mp,this._o=s,this.wo=r,e}No(t){return this.Fo+"__"+t}$o(t){return this._o&&!!t.split_storage}properties(){var t={};return Mn(this.props,(e,i)=>{var r=Hb(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.Bo||t){var e=this._n.cookieWinsOnConflict&&"localstorage+cookie"===this._n.persistence.toLowerCase(),i=e?sp.di(this.Fo):null,r={};if(e)try{Mn(r=hp(rp.di(this.Fo)),(t,e)=>{(Ie(t)||Ae(t)||""===t)&&delete r[e]})}catch(t){}var n=this.ao.di(this.Fo);if(n&&(this.props=In({},n)),this.ko&&this.da(),e&&n){var s,o,a=null==i?void 0:i[w],l=null!==(s=null==i?void 0:i.$user_state)&&void 0!==s?s:"anonymous",u=n[w],h=null!==(o=n.$user_state)&&void 0!==o?o:"anonymous";if(u!==a||h!==l){this.So=!0,bp.ui(Wb(this.Fo),!0);var d=In({},this.props);op.forEach(t=>delete d[t]),"anonymous"!==h||"identified"!==l&&"anonymous"!==r.$user_state&&(Ie(a)||u===a)||(Xb(d,r),delete d[ct]),this.props=d;var v=new Set;op.forEach(t=>{var e,i=null==(e=Hb(t))?void 0:e.storageGroup;i&&v.add(i)}),v.forEach(t=>{var e={};Mn(this.props,(i,r)=>{var n;(null==(n=Hb(r))?void 0:n.storageGroup)===t&&(e[r]=i)}),Me(e)?(sp.hi(this.No(t)),this.bo[t]={}):sp.ui(this.No(t),e)&&(this.bo[t]={persisted:!0,fingerprint:this.Go(e,t)})})}}bp.li(Wb(this.Fo))&&(this.So=!0)}}da(){for(var t of qb){var e=sp.di(this.No(t));if(e&&!Me(e)){var i=this.Ho(t);i.persisted=!0,this.va(t)||(i.fingerprint=this.Go(e,t)),this.ca(t,e)||In(this.props,e)}}}va(t){return Object.keys(this.props).some(e=>{var i;return(null==(i=Hb(e))?void 0:i.storageGroup)===t})}ca(t,e){var i=zb[t];if(!i)return!1;var r=e[i],n=this.props[i];return Fe(r)&&Fe(n)&&n>r}refreshKey(t){var e;if(!(this.Bo||"$fbc_persistence"===t&&this.Eo)){var i=this.ko?null==(e=Hb(t))?void 0:e.storageGroup:void 0,r=i?sp.di(this.No(i)):this.ao.di(this.Fo);if(r&&t in r)this.Jo(t,r[t],!1);else{if(i){var n=this.ao.di(this.Fo);if(n&&t in n)return void this.Jo(t,n[t],!1)}this.Qo(t,!1)}}}save(){if(!this.Bo){var t=this.ea();t>0?Ie(this.la)&&(this.la=setTimeout(()=>{this.la=void 0,this.ua()},t)):this.ua()}}flush(){Ie(this.la)||(clearTimeout(this.la),this.la=void 0,this.ua())}ua(t){if(void 0===t&&(t=!1),!(this.Bo||this.xo&&!t)){t||(this.syncCookieProperties(),this.Eo||this._n.cookieWinsOnConflict&&"localstorage+cookie"===this._n.persistence.toLowerCase()||this.refreshKey(M));var e=!t&&!this.To;e||(this.Io=!1);var i=!!e&&this.Ko();if(this.Io)this._n.debug&&xn.warn("skipping persistence write because storage belongs to a different distinct ID");else{if(this.ko)return this.fa(),void(i&&this.Ro.forEach(t=>t()));var r=this.pa(this.ao,this.Fo,this.props,Gb);"written"===r&&this.ia(this.props),"failed"!==r&&(this.Co.clear(),this.Mo=!1,this.Eo=!1),i&&this.Ro.forEach(t=>t())}}}fa(){var t=this,e=this.Wo(),i=e.main,r=e.groups,n=this.pa(this.ao,this.Fo,i,Gb);"written"===n&&this.ia(i),"failed"!==n&&(this.Mo=!1,this.Eo=!1,Zb.forEach(t=>{var e;null!=(e=Hb(t))&&e.storageGroup||this.Co.delete(t)}));var s=function(e){var i,n=r[e];if(Me(n)&&(null==(i=t.bo[e])||!i.persisted))return Zb.forEach(i=>{var r;(null==(r=Hb(i))?void 0:r.storageGroup)===e&&t.Co.delete(i)}),1;var s=t.pa(sp,t.No(e),n,e);"failed"!==s&&Zb.forEach(i=>{var r=Hb(i);(null==r?void 0:r.storageGroup)!==e||"written"!==s&&r.volatile||t.Co.delete(i)})};for(var o of qb)if(s(o))continue}Wo(){var t={},e={flags:{},surveys:{}};return Mn(this.props,(i,r)=>{var n,s=null==(n=Hb(r))?void 0:n.storageGroup;s?e[s][r]=i:t[r]=i}),{main:t,groups:e}}Go(t,e){if(e===Gb)return JSON.stringify(t)+"|"+this.ga+"|"+this.ma+"|"+this.ya;var i={};return Mn(t,(t,e)=>{var r;i[e]=null!=(r=Hb(e))&&r.volatile?"__volatile__":t}),JSON.stringify(i)}pa(t,e,i,r){var n,s=this.Ho(r);if(r!==Gb&&!s.dirty&&!Ie(s.fingerprint))return"skipped";try{if((n=this.Go(i,r))===s.fingerprint)return s.dirty=!1,"skipped"}catch(t){n=void 0}return t.ui(e,i,this.ga,this.ma,this.ya,this._n.debug)?(s.dirty=!1,r!==Gb&&(s.persisted=!0),Ie(n)||(s.fingerprint=n),this._o&&(s.storageValue=sp.li(e)),"written"):(this._n.debug&&xn.warn('failed to persist storage entry "'+e+'"; will retry on next save'),"failed")}remove(t){var e=(void 0===t?{}:t).keepGroupEntries,i=void 0!==e&&e;if(this.Yo(),Ie(this.la)||(clearTimeout(this.la),this.la=void 0),this.ao.hi(this.Fo,!1),this.ao.hi(this.Fo,!0),!i&&this.Ao)for(var r of qb)sp.hi(this.No(r));i?delete this.bo[Gb]:this.bo={},this.ra=void 0,this.na=void 0}clear(){this.remove(),this.props={}}register_once(t,e,i){if(Te(t)){this.syncCookieProperties(),Ie(e)&&(e="None"),this.ga=Ie(i)?this.ba:i;var r=!1;if(Mn(t,(t,i)=>{this.props.hasOwnProperty(i)&&this.props[i]!==e||(this.Jo(i,t),r=!0)}),r)return this.save(),!0}return!1}register(t,e){if(Te(t)){this.syncCookieProperties(),this.ga=Ie(e)?this.ba:e;var i=!1;if(Mn(t,(e,r)=>{t.hasOwnProperty(r)&&(this.props[r]!==e||Te(e)||xe(e))&&(this.Jo(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.Qo(r),i=!0);i&&this.save()}update_campaign_params(){var t=null==h?void 0:h.URL;if(t!==this.Po){var e=Fa(this._n.custom_campaign_params,this._n.mask_personal_data_properties,this._n.custom_personal_data_properties),i=!Me(Pn(e));return i&&this.register(e),this.Po=t,i?e:void 0}}update_search_keyword(){var t;this.register((t=null==h?void 0:h.referrer)?$a(t):{})}update_referrer_info(){var t;this.register_once({$referrer:Na(),$referring_domain:null!=h&&h.referrer&&(null==(t=jn(h.referrer))?void 0:t.host)||La},void 0)}set_initial_person_info(){if(!this.props.$initial_campaign_params&&!this.props.$initial_referrer_info){var t=qa(this._n.mask_personal_data_properties,this._n.custom_personal_data_properties,this._n.disable_capture_url_hashes);this.register_once({[Dt]:this.wo?{r:Vb(t.r),u:t.u?Vb(t.u):void 0}:t},void 0)}}get_initial_props(){var t={};Mn([$t,Ot],e=>{var i=this.props[e];i&&Mn(i,function(e,i){t["$initial_"+ce(i)]=e})});var e=this.props[Dt];return e&&In(t,function(t,e){void 0===e&&(e=!1);var i=ja(t,e),r={};return Mn(i,function(t,e){r["$initial_"+ce(e)]=t}),r}(e,this._n.disable_capture_url_hashes)),t}safe_merge(t){return Mn(this.props,function(e,i){i in t||(t[i]=e)}),t}update_config(t,e,i){var r=t.persistence!==e.persistence,s=!((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||[]),o=r||s,a=t.cookieWinsOnConflict!==e.cookieWinsOnConflict,l=t.disable_persistence||!!i,u=!!this.Bo&&!l;l||this.sa(e,u),this._n=t,!l&&(r||s||a)&&(this.ra=void 0,this.na=void 0,this.sa(n({},t,{cookie_persisted_properties:e.cookie_persisted_properties}),u));var h=o||a?this.Oo(t):this.ao;this._a();var d=this.$o(t),v=o||d!==this.ko,c=!l&&(v||t.cross_subdomain_cookie!==this.ma||t.secure_cookie!==this.ya)&&this.oa(u);this.To=v;try{if(this.ba=this.ga=t.cookie_expiration,this.set_disabled(l),this.set_cross_subdomain(t.cross_subdomain_cookie),this.set_secure(t.secure_cookie),v){var f=this.props;this.clear(),this.ao=h,this.ko=d,this.props=f,this.save()}else a&&(this.ao=h,l||(delete this.bo[Gb],this.ua()))}finally{this.To=!1,c&&this.ha()}}_a(){var t=this.props[Dt];if(this.wo&&Te(t)&&"string"==typeof t.r){var e=Vb(t.r),i="string"==typeof t.u?Vb(t.u):t.u;e===t.r&&i===t.u||this.Jo(Dt,n({},t,{r:e,u:i}))}}set_disabled(t){this.Bo=t,this.Bo?this.remove():this.save()}set_cross_subdomain(t){t!==this.ma&&(this.ma=t,this.remove({keepGroupEntries:!0}),this.save())}set_secure(t){t!==this.ya&&(this.ya=t,this.remove({keepGroupEntries:!0}),this.save())}set_event_timer(t,e){var i=this.props.__timers||{};i[t]=e,this.Jo(I,i),this.save()}remove_event_timer(t){var e=this.props.__timers||{},i=e[t];return Ie(i)||(delete e[t],this.Jo(I,e),this.save()),i}get_property(t){return this.props[t]}set_property(t,e){this.Jo(t,e),this.save()}Jo(t,e,i){var r;void 0===i&&(i=!0);var n=this.props[t];this.props[t]=e,i&&("distinct_id"!==t&&"$user_state"!==t||n===e||(this.Mo=!0),"$fbc_persistence"!==t||Qb(n,e)||(this.Eo=!0),this.ta(t,n,e),null!=(r=Hb(t))&&r.volatile||this.Xo(t))}Qo(t,e){void 0===e&&(e=!0),delete this.props[t],e&&(Jb(t)&&this.jo(t,!0),"$fbc_persistence"===t&&(this.Eo=!0),this.Xo(t))}Xo(t){var e,i=null==(e=Hb(t))?void 0:e.storageGroup;i&&(this.Ho(i).dirty=!0)}Ho(t){return this.bo[t]||(this.bo[t]={})}},t_=Cn("[RateLimiter]"),e_=class{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=>{t_.info((t||"events")+" is quota limited."),this.serverLimits[t]=(new Date).getTime()+6e4})}catch(t){return void t_.warn('could not rate limit - continuing. Error: "'+(null==t?void 0:t.message)+'"',{text:e})}},this.instance=t,this.lastEventRateLimited=this.clientRateLimitContext(!0).isRateLimited}get captureEventsPerSecond(){var t;return(null==(t=this.instance.config.rate_limiting)?void 0:t.events_per_second)||10}get captureEventsBurstLimit(){var t;return Math.max((null==(t=this.instance.config.rate_limiting)?void 0:t.events_burst_limit)||10*this.captureEventsPerSecond,this.captureEventsPerSecond)}clientRateLimitContext(t){var e,i,r;void 0===t&&(t=!1);var n=this.captureEventsBurstLimit,s=this.captureEventsPerSecond,o=(new Date).getTime(),a=null!==(e=null==(i=this.instance.persistence)?void 0:i.get_property("$capture_rate_limit"))&&void 0!==e?e:{tokens:n,last:o};a.tokens+=(o-a.last)/1e3*s,a.last=o,a.tokens>n&&(a.tokens=n);var l=1>a.tokens;if(l||t||(a.tokens=Math.max(0,a.tokens-1)),l&&!t){var u=(Fe(a.dropped)?a.dropped:0)+1;a.dropped=u,!this.lastEventRateLimited&&this.wa(u)&&(a.dropped=0)}return this.lastEventRateLimited=l,null==(r=this.instance.persistence)||r.set_property(Ft,a),{isRateLimited:l,remainingTokens:a.tokens}}ka(t){var e=this.instance.config.property_denylist;return!xe(e)||!e.includes(t)}Sa(){var t;if(this.ka("$current_url")&&this.ka("$pathname")&&null!=d&&d.pathname)return""+(null!==(t=d.origin)&&void 0!==t?t:"")+d.pathname}wa(t){var e,i,r=this.captureEventsBurstLimit,n=this.captureEventsPerSecond,s=this.Sa(),o=this.ka("$session_id")?null==(e=(i=this.instance).get_session_id)?void 0:e.call(i):void 0,a=[t+" event(s) dropped since the last warning",s?"triggered on "+s:void 0,o?"session "+o:void 0].filter(Boolean).join(", ");return!!this.instance.capture("$$client_ingestion_warning",{$$client_ingestion_warning_message:"posthog-js client rate limited: "+a+". Config is set to "+n+" events per second and "+r+" events burst limit."},{skip_client_rate_limiting:!0})}isServerRateLimited(t){var e=this.serverLimits[t||"events"]||!1;return!1!==e&&(new Date).getTime()<e}},i_=Cn("[RemoteConfig]"),r_=class{constructor(t){this._instance=t}get remoteConfig(){var t;return null==(t=b._POSTHOG_REMOTE_CONFIG)||null==(t=t[this._instance.config.token])?void 0:t.config}xa(t){var e,i;null!=(e=b.__PosthogExtensions__)&&e.loadExternalDependency?null==(i=b.__PosthogExtensions__)||null==i.loadExternalDependency||i.loadExternalDependency(this._instance,"remote-config",()=>t(this.remoteConfig)):t()}Ca(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 i_.info("Using preloaded remote config",this.remoteConfig),void this.Ta(this.remoteConfig);if(this._instance.Ma())return void i_.warn("Remote config is disabled. Falling back to local config.");this.xa(t=>{if(!t)return i_.info("No config found after loading remote JS config. Falling back to JSON."),void this.Ca(t=>{this.Ta(t.json,t)});this.Ta(t)})}catch(t){i_.error("Error loading remote config",t),this.Ta()}}Ta(t,e){!t&&e&&(0===e.statusCode?e.error||i_.warn("Failed to fetch remote config from PostHog."):i_.error("Failed to fetch remote config from PostHog."));try{this._instance.Ta(t?{ok:!0,config:t}:{ok:!1})}catch(t){i_.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){i_.error("Error loading feature flags",t)}}},n_=!!c||!!v,s_="text/plain",o_=!1,a_=(t,e)=>{var i=t.split("#"),r=i[1],n=i[0].split("?"),s=n[0],o=n[1];if(!o)return t;var a=o.split("&").filter(t=>t.split("=")[0]!==e).join("&");return s+(a?"?"+a:"")+(r?"#"+r:"")},l_=function(t,e,i){var r;void 0===i&&(i=!0);var s=t.split("?"),o=s[0],a=s[1],l=n({},e),u=null!==(r=null==a?void 0:a.split("&").map(t=>{var e,r=t.split("="),n=r[0],s=i&&null!==(e=l[n])&&void 0!==e?e:r[1];return delete l[n],n+"="+s}))&&void 0!==r?r:[],h=Bn(l);return h&&u.push(h),u.length>0?o+"?"+u.join("&"):o},u_=t=>{if(t.Ia)return t.Ia;var e=t.data,i=t.compression;if(e){if(i===of){var r=Xo(Yo(qn(e)),{mtime:0});return{contentType:s_,body:r.buffer.slice(r.byteOffset,r.byteOffset+r.byteLength),estimatedSize:r.byteLength}}if(i===af){var n=(t=>"data="+encodeURIComponent("string"==typeof t?t:qn(t)))(function(t){return t?btoa(encodeURIComponent(t).replace(/%([0-9A-F]{2})/g,(t,e)=>String.fromCharCode(parseInt(e,16)))):t}(qn(e)));return{contentType:"application/x-www-form-urlencoded",body:n,estimatedSize:new Blob([n]).size}}var s=qn(e);return{contentType:"application/json",body:s,estimatedSize:new Blob([s]).size}}},h_=t=>{var e,i,r=()=>"sendBeacon"===t.transport?{url:l_(t.url,{compression:af}),encodedBody:u_(n({},t,{compression:af,Ia:void 0}))}:{url:a_(t.url,"compression"),encodedBody:u_(n({},t,{compression:void 0,Ia:void 0}))};try{e=u_(t)}catch(e){if(Zr(t.compression,Hn(t.url,"compression")))return xn.error("Failed to gzip request body, sending uncompressed payload",e),r();throw e}return e&&Zr(t.compression,Hn(t.url,"compression"))&&!((i=e.body)instanceof ArrayBuffer?Gr(new Uint8Array(i)):ArrayBuffer.isView(i)&&Gr(new Uint8Array(i.buffer,i.byteOffset,i.byteLength)))?(o_=!0,r()):{url:t.url,encodedBody:e}},d_=t=>{try{return h_(t)}catch(e){return xn.error(e),void(null==t.callback||t.callback({statusCode:0,error:e}))}},v_=function(){var t=o(function*(t){var e=yield Yr(qn(t.data),ia.DEBUG,{rethrow:!0});if(!e)return t;var i=yield e.arrayBuffer();return n({},t,{Ia:{contentType:s_,body:i,estimatedSize:i.byteLength}})});return function(e){return t.apply(this,arguments)}}(),c_=/Failed to fetch|NetworkError|Load failed/i,f_=t=>"TypeError"===(null==t?void 0:t.name)&&c_.test((null==t?void 0:t.message)||""),p_=t=>{var e=d_(t);if(e){var i=e.url,r=e.encodedBody,s=null!=r?r:{},o=s.contentType,a=s.body,l=s.estimatedSize,u=new Headers;Mn(t.headers,function(t,e){u.append(e,t)}),o&&u.append("Content-Type",o);var h=null,d=!1;if(f){var c=new f;h={signal:c.signal,timeout:setTimeout(()=>{var e;d=!0,c.abort(or("AbortError","PostHog request timed out"+((e=t.timeout)?" after "+e+"ms":"")))},t.timeout)}}var p=e=>{d&&"AbortError"===(null==e?void 0:e.name)||f_(e)?xn.warn(e):xn.error(e),null==t.callback||t.callback({statusCode:0,error:e})};try{var g;v(i,n({method:(null==t?void 0:t.method)||"GET",headers:u,keepalive:"POST"===t.method&&!t.Ea&&52428.8>(l||0),body:a,signal:null==(g=h)?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){xn.error(t)}null==t.callback||t.callback(r)})).catch(p).finally(()=>h?clearTimeout(h.timeout):null)}catch(t){h&&clearTimeout(h.timeout),p(t)}}},g_=t=>{try{var e,i=h_(t),r=i.url,s=i.encodedBody,o=null!=s?s:{},a=o.body,l=o.estimatedSize;if(!a)return;var h=a instanceof Blob?a:new Blob([a],{type:o.contentType});if(u.sendBeacon(r,h))return;var d=xe(t.data)?t.data:null==(e=t.data)?void 0:e.batch;if(xe(d)&&d.length>1&&(null!=l?l:0)>16384){var v=Math.ceil(d.length/2),c=e=>xe(t.data)?e:n({},t.data,{batch:e});return g_(n({},t,{data:c(d.slice(0,v))})),void g_(n({},t,{data:c(d.slice(v))}))}xn.warn("Beacon of ~"+(null!=l?l:0)+" bytes was rejected by the browser, falling back to fetch"),p_(n({},t,{Ea:!0}))}catch(t){xn.warn("Beacon send failed",t)}},m_=(t,e,i,r)=>{var s="query"===r?"POST"===e?"sent_at":"_":void 0;return l_(i===of?a_(t,"compression"):t,n({},s?{[s]:Date.now().toString()}:{},i===of?{}:{compression:i}))},y_=[];v&&y_.push({transport:"fetch",method:p_}),c&&y_.push({transport:"XHR",method(t){var e=d_(t);if(e){var i=new c,r=e.encodedBody;i.open(t.method||"GET",e.url,!0);var n=null!=r?r:{},s=n.contentType,o=n.body;Mn(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!=u&&u.sendBeacon&&y_.push({transport:"sendBeacon",method:g_});var b_=class{constructor(t,e){this.Ra=!0,this.Aa=[],this.Pa=Ge((null==e?void 0:e.flush_interval_ms)||3e3,250,5e3,xn.createLogger("flush interval"),3e3),this.Fa=t}enqueue(t){this.Aa.push(t),this.Oa||this.$a()}unload(){this.Da();var t=this.Aa.length>0?this.La():{},e=Object.values(t);[...e.filter(t=>0===t.url.indexOf("/e")),...e.filter(t=>0!==t.url.indexOf("/e"))].map(t=>{this.Na(n({},t,{transport:"sendBeacon"}))})}enable(){this.Ra=!1,this.$a()}$a(){var t=this;this.Ra||(this.Oa=setTimeout(()=>{if(this.Da(),this.Aa.length>0){var e=this.La(),i=function(){var i=e[r],n=(new Date).getTime();i.data&&xe(i.data)&&Mn(i.data,t=>{t.offset=Math.abs(t.timestamp-n),delete t.timestamp}),t.Na(i)};for(var r in e)i()}},this.Pa))}Na(t){try{this.Fa(t)}catch(t){xn.error(t)}}Da(){clearTimeout(this.Oa),this.Oa=void 0}La(){var t={};return Mn(this.Aa,e=>{var i,r=e,s=(r?r.batchKey:null)||r.url;Ie(t[s])&&(t[s]=n({},r,{data:[]})),null==(i=t[s].data)||i.push(r.data)}),this.Aa=[],t}},__=class{constructor(t){this._instance=t,this.qa=!1,this.ja=3e3,this.Aa=[],this.Aa=[],this.Ba=!0,!Ie(a)&&"onLine"in a.navigator&&(this.Ba=a.navigator.onLine,this.Ha=()=>{this.Ba=!0,this.za()},this.Ua=()=>{this.Ba=!1},Dn(a,"online",this.Ha),Dn(a,"offline",this.Ua))}get length(){return this.Aa.length}retriableRequest(t){var i=t.retriesPerformedSoFar,s=r(t,e);Oe(i)&&(s.url=l_(s.url,{retry_count:i})),this._instance._send_request(n({},s,{callback:t=>{if(200!==t.statusCode&&(400>t.statusCode||t.statusCode>=500)){if((0===t.statusCode?3:10)>(null!=i?i:0))return void this.cs(n({retriesPerformedSoFar:i},s));0===t.statusCode&&xn.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!=i?i:0)+" retries.")}null==s.callback||s.callback(t)}}))}cs(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)*(r-i);return Math.ceil(r+n)}(e),r=Date.now()+i;this.Aa.push({retryAt:r,requestOptions:t});var n="Enqueued failed request for retry in "+i;navigator.onLine||(n+=" (Browser is offline)"),xn.warn(n),this.qa||(this.qa=!0,this.Wa())}Wa(){if(this.Va&&clearTimeout(this.Va),0===this.Aa.length)return this.qa=!1,void(this.Va=void 0);this.Va=setTimeout(()=>{this.Ba&&this.Aa.length>0&&this.za(),this.Wa()},this.ja)}za(){var t=Date.now(),e=[],i=this.Aa.filter(i=>t>i.retryAt||(e.push(i),!1));if(this.Aa=e,i.length>0)for(var r of i)this.retriableRequest(r.requestOptions)}unload(){for(var t of(this.Va&&(clearTimeout(this.Va),this.Va=void 0),this.qa=!1,Ie(a)||(this.Ha&&(a.removeEventListener("online",this.Ha),this.Ha=void 0),this.Ua&&(a.removeEventListener("offline",this.Ua),this.Ua=void 0)),this.Aa)){var e=t.requestOptions;try{this._instance._send_request(n({},e,{transport:"sendBeacon"}))}catch(t){xn.error(t)}}this.Aa=[]}},w_=class{constructor(t){this._instance=t,this.Ga=()=>{var t,e,i,r;this.Za||(this.Za={});var n=this.scrollElement(),s=this.scrollY(),o=n?Math.max(0,n.scrollHeight-n.clientHeight):0,a=s+((null==n?void 0:n.clientHeight)||0),l=(null==n?void 0:n.scrollHeight)||0;this.Za.lastScrollY=Math.ceil(s),this.Za.maxScrollY=Math.max(s,null!==(t=this.Za.maxScrollY)&&void 0!==t?t:0),this.Za.maxScrollHeight=Math.max(o,null!==(e=this.Za.maxScrollHeight)&&void 0!==e?e:0),this.Za.lastContentY=a,this.Za.maxContentY=Math.max(a,null!==(i=this.Za.maxContentY)&&void 0!==i?i:0),this.Za.maxContentHeight=Math.max(l,null!==(r=this.Za.maxContentHeight)&&void 0!==r?r:0)}}get Ja(){return this._instance.config.scroll_root_selector}getContext(){return this.Za}resetContext(){var t=this.Za;return setTimeout(this.Ga,0),t}startMeasuringScrollPosition(){Dn(a,"scroll",this.Ga,{capture:!0}),Dn(a,"scrollend",this.Ga,{capture:!0}),Dn(a,"resize",this.Ga)}scrollElement(){var t;if(!this.Ja)return null==a||null==(t=a.document)?void 0:t.documentElement;for(var e of xe(this.Ja)?this.Ja:[this.Ja]){var i,r=null==a||null==(i=a.document)?void 0:i.querySelector(e);if(r)return r}}Qa(t){var e,i,r="y"===t?"scrollTop":"scrollLeft";if(this.Ja){var n=this.scrollElement();return n&&n[r]||0}return a?"y"===t?a.scrollY||a.pageYOffset||(null==(e=a.document)||null==(e=e.documentElement)?void 0:e.scrollTop)||0:a.scrollX||a.pageXOffset||(null==(i=a.document)||null==(i=i.documentElement)?void 0:i.scrollLeft)||0:0}scrollY(){return this.Qa("y")}scrollX(){return this.Qa("x")}},k_=t=>qa(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),S_=class{constructor(t,e,i,r){this.Te=t=>{var e=this.Ka();if(!e||e.sessionId!==t){var i={sessionId:t,props:this.Xa(this._instance)};this.Ya.register({[Pt]:i})}},this._instance=t,this.tl=e,this.Ya=i,this.Xa=r||k_,this.tl.onSessionId(this.Te)}Ka(){return this.Ya.props[Pt]}getSetOnceProps(){var t,e=null==(t=this.Ka())?void 0:t.props;return e?"r"in e?ja(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 Mn(Pn(this.getSetOnceProps()),(e,i)=>{"$current_url"===i&&(i="url"),t["$session_entry_"+ce(i)]=e}),t}},x_=class{on(t,e){return this.el[t]||(this.el[t]=[]),this.el[t].push(e),()=>{this.el[t]=this.el[t].filter(t=>t!==e)}}emit(t,e){for(var i of this.el[t]||[])i(e);for(var r of this.el["*"]||[])r(t,e)}constructor(){this.el={}}},C_=Cn("[SessionId]"),T_=864e5,M_=class{on(t,e){return this.il.on(t,e)}constructor(t,e,i){var r;if(this.rl=null,this.nl=null,this.sl=[],this.ol=void 0,this.al=!1,this.il=new x_,this.ll=(t,e)=>!(!Oe(t)||!Oe(e))&&Math.abs(t-e)>this.sessionTimeoutMs,!t.persistence)throw new Error("SessionIdManager requires a PostHogPersistence instance");if("always"===t.config.cookieless_mode)throw new Error('SessionIdManager cannot be used with cookieless_mode="always"');this._n=t.config,this.Ya=t.persistence,this.Ie=void 0,this.Bt=void 0,this._sessionStartTimestamp=null,this.ul=void 0,this._sessionActivityTimestamp=null,this.hl=e||Xf,this.dl=i||Xf;var n=this._n.persistence_name||this._n.token;if(this._sessionTimeoutMs=1e3*Ge(this._n.session_idle_timeout_seconds||1800,60,36e3,C_.createLogger("session_idle_timeout_seconds"),1800),t.register({$configured_session_timeout_ms:this._sessionTimeoutMs}),this.vl(),this.cl="ph_"+n+"_window_id",this.fl="ph_"+n+"_primary_window_exists",this.pl()){var s=bp.di(this.cl),o=bp.di(this.fl);s&&!o?this.Ie=s:bp.hi(this.cl),bp.ui(this.fl,!0)}null!=(r=this._n.bootstrap)&&r.sessionID&&this.setBootstrapSessionId(this._n.bootstrap.sessionID),this.gl()}get sessionTimeoutMs(){return this._sessionTimeoutMs}onSessionId(t){return Ie(this.sl)&&(this.sl=[]),this.sl.push(t),this.Bt&&t(this.Bt,this.Ie),()=>{this.sl=this.sl.filter(e=>e!==t)}}pl(){return"memory"!==this._n.persistence&&!this.Ya.Bo&&bp.si()}ml(t){t!==this.Ie&&(this.Ie=t,this.pl()&&bp.ui(this.cl,t))}yl(){return this.Ie?this.Ie:this.pl()?bp.di(this.cl):null}bl(t){var e=this.rl;return!Ae(e)&&!Ae(t)&&5e3>Math.abs(t-e)}_l(t,e,i){var r=e!==this._sessionActivityTimestamp,n=!(t!==this.Bt||i!==this._sessionStartTimestamp);this._sessionStartTimestamp=i,this._sessionActivityTimestamp=e,this.Bt=t,n&&!r||n&&this.bl(e)||(this.rl=e,this.Ya.register({[G]:[e,t,i]}))}wl(){var t,e=null==(t=this._n)?void 0:t.persistence_save_debounce_ms;return Oe(e)&&e>0}kl(){this.wl()?this.Ya.refreshKey(G):(this.Ya.flush(),this.Ya.load())}Sl(){var t;if(!Ae(this._sessionActivityTimestamp)&&this._sessionActivityTimestamp!==this.rl){this.kl();var e=this.xl();e[1]===this.Bt&&e[2]===this._sessionStartTimestamp&&(this.rl=this._sessionActivityTimestamp,this.Ya.register({[G]:[this._sessionActivityTimestamp,null!==(t=this.Bt)&&void 0!==t?t:null,this._sessionStartTimestamp]}),this.Ya.flush())}}Cl(){var t=this.xl()[0],e=Oe(t)?t:0,i=Oe(this._sessionActivityTimestamp)?this._sessionActivityTimestamp:0;return Math.max(e,i)}Tl(t){return this.kl(),this.ll(t,this.Cl())}xl(){var t=this.Ya.props[G];return xe(t)&&2===t.length&&t.push(t[0]),t||[0,null,0]}resetSessionId(){this.rl=null,this.ul=void 0,clearTimeout(this.Ml),this.Ml=void 0,this._l(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 C_.error("Bootstrap sessionID cannot be in the future"):i}catch(t){return void C_.error("Invalid sessionID in bootstrap",t)}}(t);return!Ie(i)&&(e?this.ul={sessionId:t,sessionStartTimestamp:i}:this._l(t,(new Date).getTime(),i),!0)}destroy(){this.al=!0,this.Sl(),clearTimeout(this.Ml),this.Ml=void 0,this.ol&&a&&(a.removeEventListener(ne,this.ol,{capture:!1}),this.ol=void 0),this.sl=[]}gl(){this.ol=()=>{this.Sl(),this.pl()&&bp.hi(this.fl)},Dn(a,ne,this.ol,{capture:!1})}checkAndGetSessionAndWindowId(t,e,i){if(void 0===t&&(t=!1),void 0===e&&(e=null),void 0===i&&(i=!1),"always"===this._n.cookieless_mode)throw new Error('checkAndGetSessionAndWindowId should not be called with cookieless_mode="always"');var r=e||(new Date).getTime(),n=this.Bt;if(i)this.nl=r;else if(Ae(this.nl)||this.nl>r||r-this.nl>=1e3){var s,o;null==(s=(o=this.Ya).syncCookieProperties)||s.call(o),this.nl=r}var a=this.xl(),l=a[1],u=a[2],h=!Ie(n)&&l!==n,d=this.Cl(),v=this.yl(),c=this.ul,f=!!c&&(c.sessionStartTimestamp>r+6e4||r-c.sessionStartTimestamp>T_),p=c?f:Oe(u)&&Math.abs(r-u)>T_,g=!1,m=h,y=!l||!!c,b=l,_=!y&&!t&&this.ll(r,d);if(_){(_=this.Tl(r))||C_.info("cross-tab refresh kept the session alive",{sessionId:l});var w=this.xl();l=w[1],u=w[2]}if(y||_||p){m=!1;var k=c&&!f;l=k?c.sessionId:this.hl(),v=this.dl(),C_.info("new session ID assigned",{sessionId:l,windowId:v,bootstrapped:!!k,changeReason:{noSessionId:y,activityTimeout:_,sessionPastMaximumLength:p}}),u=k?c.sessionStartTimestamp:r,this.ul=void 0,g=!0}else v||(v=this.dl(),g=!0),(m=m||l!==b)&&(C_.info("adopted cross-tab session id",{sessionId:l,windowId:v}),g=!0);var S=Oe(d)&&t&&!p?d:r,x=Oe(u)?u:(new Date).getTime();this.ml(v),this._l(l,S,x),t||this.vl();var C={noSessionId:y,activityTimeout:_,sessionPastMaximumLength:p,crossTabAdoption:m};return g&&this.sl.forEach(t=>t(l,v,C)),{sessionId:l,windowId:v,sessionStartTimestamp:x,changeReason:g?C:void 0,lastActivityTimestamp:d}}vl(){this.al||(clearTimeout(this.Ml),this.Ml=setTimeout(()=>{if(!this.al)if(this.Tl((new Date).getTime())){var t=this.Bt;this.resetSessionId(),this.il.emit("forcedIdleReset",{idleSessionId:t})}else this.vl()},1.1*this.sessionTimeoutMs))}},I_=function(t,e){if(!t)return!1;var i=t.userAgent;if(i&&he(i,e))return!0;try{var r=null==t?void 0:t.userAgentData;if(null!=r&&r.brands&&r.brands.some(t=>he(null==t?void 0:t.brand,e)))return!0}catch(t){}return!!t.webdriver};function E_(){return E_=o(function*(){var t=null==u?void 0:u.userAgentData;if(null!=t&&t.getHighEntropyValues)try{var e,i=null==(e=yield t.getHighEntropyValues(["model"]))?void 0:e.model;return Ee(i)&&i.length>0?i:void 0}catch(t){return void xn.info("Unable to resolve $device_model from userAgentData.getHighEntropyValues",t)}}),E_.apply(this,arguments)}var R_="custom",A_="i.posthog.com",P_=/^\/static\//,F_=["/s/","/e/","/i/"],O_=class{constructor(t){this.Il={},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("."+A_,".posthog.com")),"https://app.posthog.com"===e?"https://us.posthog.com":e}get region(){return this.Il[this.apiHost]||(this.Il[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":R_),this.Il[this.apiHost]}El(t){if(P_.test(t)){var e=this.instance.config.asset_host;if("string"==typeof e)return e.trim().replace(/\/$/,"")||void 0}}Rl(t){var e=jn(t);return e?e.protocol+"//"+e.host+e.pathname:void 0}Al(t,e,i){if("ui"===t)return i;var r=i,n=this.instance.config.rewriteRequestPath;if(n){var s,o=(null==(s=jn(i))?void 0:s.href)||i;r=n(new URL(o)).toString()}if(n&&"api"===t&&F_.some(t=>0===e.indexOf(t))){var a=this.Rl(r);if(a){var l,u=this.apiHost,h=this.Pl;(null==(l=h)?void 0:l.apiHost)===u&&h.rewriteRequestPath===n||(this.Pl=h={apiHost:u,rewriteRequestPath:n,urls:new Set}),h.urls.add(a)}}return r}isIngestionEndpoint(t){var e=this.Pl,i=this.Rl(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.Al(t,e,this.uiHost+e);if("flags"===t)return this.Al(t,e,this.flagsApiHost+e);if("assets"===t){var i=this.El(e);if(i)return this.Al(t,e,""+i+e)}if(this.region===R_)return this.Al(t,e,this.apiHost+e);var r=A_+e;switch(t){case"assets":return this.Al(t,e,"https://"+this.region+"-assets."+r);case"api":return this.Al(t,e,"https://"+this.region+"."+r)}}},$_=Cn("[PostHog ExternalIntegrations]"),D_={intercom:"intercom-integration",crispChat:"crisp-chat-integration"},L_=class{constructor(t){this._instance=t}do(t,e){var i;null==(i=b.__PosthogExtensions__)||null==i.loadExternalDependency||i.loadExternalDependency(this._instance,t,t=>{if(t)return $_.error("failed to load script",t);e()})}startIfEnabledOrStop(){var t=this,e=function(){var e,r,n,s=i[0],o=i[1];!o||null!=(e=b.__PosthogExtensions__)&&null!=(e=e.integrations)&&e[s]||t.do(D_[s],()=>{var e;null==(e=b.__PosthogExtensions__)||null==(e=e.integrations)||null==(e=e[s])||e.start(t._instance)}),!o&&null!=(r=b.__PosthogExtensions__)&&null!=(r=r.integrations)&&r[s]&&(null==(n=b.__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()}}},N_=class{constructor(t,e){this.A=t,this.Hs=e,this.Fl=new Map,this.Js=!1}add(t){var e=this;return o(function*(){if(e.Js)throw new Error("Cannot add an extension to a disposed ExtensionRuntime");if(e.Fl.has(t.name))throw new Error('Browser extension "'+t.name+'" is already registered');e.Fl.set(t.name,t);try{var i=t.setup(e.Hs);i&&(yield i)}catch(i){var r=e.Fl.get(t.name)===t;r&&e.Fl.delete(t.name),e.A.error('Failed to set up browser extension "'+t.name+'"',i),r&&e.Ol(t)}})()}getExtension(t){return this.Fl.get(t)}dispose(){if(!this.Js){this.Js=!0;var t=Array.from(this.Fl.values()).reverse();for(var e of(this.Fl.clear(),t))this.Ol(e)}}Ol(t){try{var e=null==t.dispose?void 0:t.dispose();e&&Ce(e.then)&&e.then(void 0,e=>{this.A.error('Failed to dispose browser extension "'+t.name+'"',e)})}catch(e){this.A.error('Failed to dispose browser extension "'+t.name+'"',e)}}},q_=class{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);Ie(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)}},j_="extensionsRemoteConfig",B_=class{constructor(t){this.instance=t,this.Js=!1,this.A=xn,this.$l=t.Dl,this.kv=new q_(t),this.onEvent=t=>Lf(this.instance.on("eventCaptured",e=>{try{t({event:e.event,properties:e.properties})}catch(t){this.A.error("Browser extension event listener failed",t)}})),this.onRemoteConfig=t=>{if(this.Js)return Lf(()=>{});var e=e=>{try{t(e)}catch(t){this.A.error("Browser extension remote config listener failed",t)}},i=this.instance.Ll.on(j_,e);return this.$l&&e(this.$l),Lf(i)},this.Nl=new N_(xn.createLogger("[BrowserExtensions]"),this)}get logger(){return this.A}get distinctId(){return this.instance.get_distinct_id()}get anonymousId(){var t;return null!==(t=this.instance.get_property("$device_id"))&&void 0!==t?t:this.distinctId}get deviceId(){var t=this.instance.get_property(k);return"string"==typeof t?t:void 0}get library(){return{name:ia.LIB_NAME,version:ia.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.Nl.add(t)}getExtension(t){return this.Nl.getExtension(t)}capture(t,e,i){var r=this;return o(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 Lf(this.instance.ql(t))}handleRemoteConfig(t){this.Js||(this.$l=t,this.instance.Ll.emit(j_,t))}sendRequest(t,e){var i=this;return o(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?l_(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?ge.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.Js||(this.Js=!0,this.Nl.dispose())}},H_={},z_=0,U_=()=>{},W_='Consent opt in/out is not valid with cookieless_mode="always" and will be ignored',V_="Surveys module not available",G_="sanitize_properties is deprecated. Use before_send instead",Z_="Invalid value for property_denylist config: ",J_=/^[A-Za-z0-9_-]{1,400}$/,Q_=/^fb\.[0-9]+\.[0-9]+\.[A-Za-z0-9_-]+(?:\.[A-Za-z0-9_-]+)?$/,K_=["token","distinct_id",qt],X_="posthog",Y_=!n_&&-1===(null==g?void 0:g.indexOf("MSIE"))&&-1===(null==g?void 0:g.indexOf("Mozilla")),tw=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},ew=t=>{var e;return n({api_host:"https://us.i.posthog.com",flags_api_host:null,ui_host:null,asset_host:null,token:"",autocapture:!0,cross_subdomain_cookie:$n(null==h?void 0:h.location),persistence:"localStorage+cookie",persistence_name:"",cookie_persisted_properties:[],loaded:U_,save_campaign_params:!0,custom_campaign_params:[],custom_blocked_useragents:[],save_referrer:!0,capture_pageleave:"if_capture_pageview",defaults:null!=t?t:"unset",__preview_deferred_init_extensions:!1,__preview_external_dependency_versioned_paths:!1,__preview_cookie_wins_on_conflict:!1,debug:d&&Ee(null==d?void 0:d.search)&&-1!==d.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,reuseAnonymousId:!1,disable_external_dependency_loading:!1,strict_script_versioning:"fallback",enable_recording_console_log:void 0,secure_cookie:"https:"===(null==a||null==(e=a.location)?void 0:e.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){xn.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:ie,before_send:void 0,get_current_url:void 0,request_queue_config:{flush_interval_ms:3e3},error_tracking:{},_onCapture:U_},(t=>({rageclick:t&&t>="2026-05-30"?{content_ignorelist:vs,ignore_text_selection:!0}:!t||"2025-11-30">t||{content_ignorelist:!0},capture_pageview:!t||"2025-05-24">t||"history_change",session_recording:tw(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)}))(t))},iw=[["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"]],rw=t=>{var e={};for(var i of iw){var r=i[0],n=i[1];Ie(t[r])||(e[n]=t[r])}var s=In({},e,t),o=t.__preview_external_dependency_versioned_paths;return Ie(o)||(Ie(t.strict_script_versioning)&&(s.strict_script_versioning=!!o),Ee(o)&&Ie(t.asset_host)&&(s.asset_host=o)),xe(t.property_blacklist)&&(Ie(t.property_denylist)?s.property_denylist=t.property_blacklist:xe(t.property_denylist)?s.property_denylist=[...t.property_blacklist,...t.property_denylist]:xn.error(Z_+t.property_denylist)),s},nw=class{constructor(){this.__forceAllowLocalhost=!1}get jl(){return this.__forceAllowLocalhost}set jl(t){xn.error("WebPerformanceObserver is deprecated and has no impact on network capture. Use `_forceAllowLocalhostNetworkCapture` on `posthog.sessionRecording`"),this.__forceAllowLocalhost=t}},sw=(s=class t{Bl(t){if(t){var e=this.Fl.indexOf(t);-1!==e&&this.Fl.splice(e,1)}}Hl(t,e){return this.Bl(t),this.Fl.push(e),null==e.initialize||e.initialize(),e}zl(){return"always"===this.config.cookieless_mode||"on_reject"===this.config.cookieless_mode&&this.consent.isRejected()}Ul(){if(!(this.Wl||this.config.reuseAnonymousId||this.config.segment||this.zl())){var t,e,i,r="memory"===this.config.persistence||"sessionStorage"===this.config.persistence;(r||this.config.disable_persistence)&&(this.Vl||(r?(t="persistence is set to '"+this.config.persistence+"'",e="memory"===this.config.persistence?"on every page load":"for every new browser tab or window",i="Either set persistence to 'localStorage+cookie', keep this persistence and pass a stable ID through bootstrap.distinctID, or enable reuseAnonymousId."):(t="persistence is disabled (disable_persistence is true)",e="on every page load",i="Either set disable_persistence to false, keep persistence disabled and pass a stable ID through bootstrap.distinctID, or enable reuseAnonymousId."),this.Wl=!0,console.warn("[PostHog.js]",t+" but no bootstrap.distinctID was provided. PostHog will mint a new distinct ID "+e+", so calling identify() merges a new ID onto the person each time. A person can then pass the distinct-ID limit and its events stop appearing on person pages and the session tab. "+i)))}}Gl(){if(!this.zl()&&"$posthog_cookieless"===this.get_distinct_id()){var t=this.persistence;if(t){this.Zl()||t.load(!0);var e=this.get_distinct_id();if(!e||"$posthog_cookieless"===e){var i=this.config.get_device_id(Xf());this.register({distinct_id:i,$device_id:i}),t.set_property(At,te)}this.Jl()}}}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 e;this.webPerformance=new nw,this.Ql=!1,this.version=ia.LIB_VERSION,this.Kl=new Set,this.Xl="",this.Ll=new x_,this.Fl=[],this.Yl=[],this.Vl=!1,this.Wl=!1,this._calculate_event_properties=this.calculateEventProperties.bind(this),this.config=ew(),this.SentryIntegration=Lb,this.sentryIntegration=t=>function(t,e){var i=Db(t,e);return{name:$b,processEvent:t=>i(t)}}(this,t),this.__request_queue=[],this.__loaded=!1,this.analyticsDefaultEndpoint="/e/",this.tu=!1,this.eu=null,this.iu=null,this.ru=null,this.scrollManager=new w_(this),this.pageViewManager=new Nb(this),this.rateLimiter=new e_(this),this.requestRouter=new O_(this),this.consent=new Ib(this),this.externalIntegrations=new L_(this);var i=null!==(e=t.__defaultExtensionClasses)&&void 0!==e?e:{};this.featureFlags=i.featureFlags&&new i.featureFlags(this),this.toolbar=i.toolbar&&new i.toolbar(this),this.surveys=i.surveys&&new i.surveys(this),this.conversations=i.conversations&&new i.conversations(this),this.logs=i.logs&&new i.logs(this),this.metrics=i.metrics&&new i.metrics(this),this.experiments=i.experiments&&new i.experiments(this),this.exceptions=i.exceptions&&new i.exceptions(this),this.people={set:(t,e,i)=>{var r=Ee(t)?{[t]:e}:t;this.setPersonProperties(r),null==i||i({})},set_once:(t,e,i)=>{var r=Ee(t)?{[t]:e}:t;this.setPersonProperties(void 0,r),null==i||i({})}},this.on("eventCaptured",t=>xn.info('send "'+(null==t?void 0:t.event)+'"',t))}init(e,i,r){if(r&&r!==X_){var n,s=null!==(n=H_[r])&&void 0!==n?n:new t;return s._init(e,i,r),H_[r]=s,H_[X_][r]=s,s}return this._init(e,i,r)}_init(t,e,i){var r,s,o;void 0===e&&(e={});var l,u=Ee(t)?t.trim():"";if(!u)return xn.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 u!==(null==(l=this.config)?void 0:l.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('"+u+"', { ... }, 'project2')"):console.warn("[PostHog.js]","You have already initialized PostHog! Re-initializing is a no-op"),this;this.__loaded=!0,this.config=ew(e.defaults),e.debug=this.nu(e.debug),this.su=e,this.ou=[],e.person_profiles?this.iu=e.person_profiles:e.process_person&&(this.iu=e.process_person);var h=ew(e.defaults),d=rw(e),v=In({},h,d,{name:i,token:u});Te(h.rageclick)&&Te(d.rageclick)&&(v.rageclick=In({},h.rageclick,d.rageclick)),Te(h.session_recording)&&Te(d.session_recording)&&(v.session_recording=In({},h.session_recording,d.session_recording)),this.set_config(v),this.config.on_xhr_error&&xn.error("on_xhr_error is deprecated. Use on_request_error instead"),this.compression=e.disable_compression?void 0:of;var c=this.Zl();if(this.persistence=new Yb(this.config,c),this.sessionPersistence="sessionStorage"===this.config.persistence||"memory"===this.config.persistence?this.persistence:new Yb(n({},this.config,{persistence:"sessionStorage"}),c,!1),this.Xl="ph_"+(this.config.persistence_name||this.config.token)+"_session_registered_properties","memory"!==this.config.persistence&&!c&&bp.si()){var f=bp.di(this.Xl);xe(f)&&f.forEach(t=>{Ee(t)&&this.Kl.add(t)})}else bp.hi(this.Xl);var p=n({},this.persistence.props),g=n({},this.sessionPersistence.props);this.register({$initialization_time:(new Date).toISOString()}),this.au=new b_(t=>this.lu(t),this.config.request_queue_config),this.uu=new __(this),this.__request_queue=[];var m=this.zl();m||(this.sessionManager=new M_(this),this.sessionPropsManager=new S_(this,this.sessionManager,this.persistence),this.sessionManager.onSessionId((t,e,i)=>{(null!=i&&i.activityTimeout||null!=i&&i.sessionPastMaximumLength||null!=i&&i.crossTabAdoption)&&this.hu()})),this.du(),this.config.__preview_deferred_init_extensions?(xn.info("Deferring extension initialization to improve startup performance"),setTimeout(()=>{this.vu(m)},0)):(xn.info("Initializing extensions synchronously"),this.vu(m)),ia.DEBUG=ia.DEBUG||this.config.debug,ia.DEBUG&&xn.info("Starting in debug mode",{this:this,config:e,thisC:n({},this.config),p:p,s:g}),!this.config.identity_distinct_id||null!=(r=e.bootstrap)&&r.distinctID||(e.bootstrap=n({},e.bootstrap,{distinctID:this.config.identity_distinct_id,isIdentifiedID:!0}));var y=null==(s=e.bootstrap)?void 0:s.distinctID;if(this.Vl=!!y&&!Re(y),void 0!==(null==(o=e.bootstrap)?void 0:o.distinctID)){var b=e.bootstrap.distinctID,_=this.get_distinct_id(),w=this.persistence.get_property(At);if(e.bootstrap.isIdentifiedID&&null!=_&&_!==b&&"anonymous"===w)this.identify(b);else if(e.bootstrap.isIdentifiedID&&null!=_&&_!==b&&"identified"===w)xn.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 k=this.config.get_device_id(Xf()),x=e.bootstrap.isIdentifiedID?k:b;this.persistence.set_property(At,e.bootstrap.isIdentifiedID?ee:te),this.register({distinct_id:b,$device_id:x})}}if(m)this.register_once({distinct_id:Nt,$device_id:null},"");else if(!this.get_distinct_id()){var C=this.config.get_device_id(Xf());this.register_once({distinct_id:C,$device_id:C},""),this.persistence.set_property(At,te)}return Dn(a,"onpagehide"in self?"pagehide":"unload",this._handle_unload.bind(this),{passive:!1}),e.segment?Ob(this,()=>this.cu()):this.cu(),Ce(this.config._onCapture)&&this.config._onCapture!==U_&&(xn.warn("onCapture is deprecated. Please use `before_send` instead"),this.on("eventCaptured",t=>this.config._onCapture(t.event,t))),this.config.ip&&xn.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 E_.apply(this,arguments)}().then(t=>{t&&this.register({[S]:t})}).catch(U_),this}fu(t){var e=t;return Ee(e.name)&&Ce(e.setup)}pu(t,e){this.fu(t)?e.push(()=>{this.gu().add(t).catch(()=>null==t.dispose?void 0:t.dispose()).catch(e=>{xn.error('Failed to dispose browser extension "'+t.name+'"',e)})}):this.Fl.push(t)}du(){var e,i,r,n,s,o,a=null!==(e=null==(i=this.config.__extensionClasses)?void 0:i.featureFlags)&&void 0!==e?e:null==(r=t.__defaultExtensionClasses)?void 0:r.featureFlags;a&&(this.featureFlags&&this.featureFlags instanceof a||(null==(o=this.mu)||o.call(this),this.mu=void 0,this.featureFlags=new a(this)),Ce(this.featureFlags.onReloading)&&Ce(this.featureFlags.setup)?this.mu||(this.mu=this.featureFlags.onReloading(()=>{this.Ll.emit("featureFlagsReloading",!0)}),this.gu().add(this.featureFlags)):null==(n=(s=this.featureFlags).initialize)||n.call(s))}vu(e){var i,r,s,o,a,l,u,h=performance.now(),d=n({},t.__defaultExtensionClasses,this.config.__extensionClasses),v=[];d.exceptions&&this.Fl.push(this.exceptions=null!==(i=this.exceptions)&&void 0!==i?i:new d.exceptions(this)),d.historyAutocapture&&this.Fl.push(this.historyAutocapture=new d.historyAutocapture(this)),d.tracingHeaders&&this.Fl.push(this.tracingHeaders=new d.tracingHeaders(this)),d.siteApps&&this.Fl.push(this.siteApps=new d.siteApps(this)),d.sessionRecording&&!e&&this.Fl.push(this.sessionRecording=new d.sessionRecording(this)),this.config.disable_scroll_properties||v.push(()=>{this.scrollManager.startMeasuringScrollPosition()}),d.autocapture&&this.pu(this.autocapture=new d.autocapture(this),v),d.surveys&&this.pu(this.surveys=null!==(r=this.surveys)&&void 0!==r?r:new d.surveys(this),v),d.logs&&this.pu(this.logs=null!==(s=this.logs)&&void 0!==s?s:new d.logs(this),v),d.metrics&&this.Fl.push(this.metrics=null!==(o=this.metrics)&&void 0!==o?o:new d.metrics(this)),d.conversations&&this.Fl.push(this.conversations=null!==(a=this.conversations)&&void 0!==a?a:new d.conversations(this)),d.productTours&&this.Fl.push(this.productTours=new d.productTours(this)),d.heatmaps&&this.Fl.push(this.heatmaps=new d.heatmaps(this)),d.webVitalsAutocapture&&this.Fl.push(this.webVitalsAutocapture=new d.webVitalsAutocapture(this)),d.exceptionObserver&&this.Fl.push(this.exceptionObserver=new d.exceptionObserver(this)),d.deadClicksAutocapture&&this.Fl.push(this.deadClicksAutocapture=new d.deadClicksAutocapture(this,Ab)),d.toolbar&&this.Fl.push(this.toolbar=null!==(l=this.toolbar)&&void 0!==l?l:new d.toolbar(this)),d.experiments&&this.Fl.push(this.experiments=null!==(u=this.experiments)&&void 0!==u?u:new d.experiments(this)),this.Fl.forEach(t=>{t.initialize&&v.push(()=>{null==t.initialize||t.initialize()})}),v.push(()=>{if(this.yu){var t=this.yu;this.yu=void 0,this.Fl.forEach(e=>null==e.onRemoteConfig?void 0:e.onRemoteConfig(t))}}),this.bu(v,h)}bu(t,e){for(;t.length>0;){if(this.config.__preview_deferred_init_extensions&&performance.now()-e>=30&&t.length>0)return void setTimeout(()=>{this.bu(t,e)},0);var i=t.shift();if(i)try{i()}catch(t){xn.error("Error initializing extension:",t)}}var r=Math.round(performance.now()-e);this.register_for_session({[jt]:this.config.__preview_deferred_init_extensions?"deferred":"synchronous",[Bt]:r}),this.config.__preview_deferred_init_extensions&&xn.info("PostHog extensions initialized ("+r+"ms)")}Ta(t){var e;if(!h||!h.body)return xn.info("document not ready yet, trying again in 500 milliseconds..."),void setTimeout(()=>{this.Ta(t)},500);if(this.config.__preview_deferred_init_extensions&&(this.yu=t),this.Dl=t,this.compression=void 0,t.ok){var i,r=t.config;r.supportedCompression&&!this.config.disable_compression&&(this.compression=de(r.supportedCompression,of)?of:de(r.supportedCompression,af)?af:void 0),null!=(i=r.analytics)&&i.endpoint&&(this.analyticsDefaultEndpoint=r.analytics.endpoint)}this.set_config({person_profiles:this.iu?this.iu:ie}),null==(e=this._u)||e.handleRemoteConfig(t),this.Fl.forEach(e=>null==e.onRemoteConfig?void 0:e.onRemoteConfig(t))}cu(){try{this.config.loaded(this)}catch(t){xn.critical("`loaded` function failed",t)}if(this.wu(),this.config.internal_or_test_user_hostname&&null!=d&&d.hostname){var t=d.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.zl())&&this.ku()},1),this.Su=new r_(this),this.Su.load()}wu(){var t;this.is_capturing()&&this.config.request_batching&&(null==(t=this.au)||t.enable())}_dom_loaded(){this.is_capturing()&&Tn(this.__request_queue,t=>this.lu(t)),this.__request_queue=[],this.wu()}_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.xu()&&this.capture(oe),null==(i=this.logs)||i.flushLogs("sendBeacon"),null==(r=this.au)||r.unload(),null==(n=this.uu)||n.unload()):this.xu()&&this.capture(oe,null,{transport:"sendBeacon"})}_send_request(t){var e;this.__loaded?Y_?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=n({},this.config.request_headers,t.headers),t.compression="best-available"===t.compression?null!==(e=this.compression)&&void 0!==e?e:t.compressionFallback:t.compression,(Ie(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,s=n({},t);s.timeout=s.timeout||6e4;var o,a,l,u,h,d=null!==(e=s.transport)&&void 0!==e?e:"fetch";"sendBeacon"===d&&Ie(s.compression)&&s.data&&(s.compression=af),"POST"===s.method&&s.data&&("capture-body"===s.timestampMode?s.data={api_key:null!==(a=null==(h=(u=(xe(o=s.data)?o:[o]).map(t=>n({},t,t.timestamp instanceof Date&&!isNaN(t.timestamp.getTime())?{timestamp:t.timestamp.toISOString()}:{})))[0])||null==(l=h.properties)?void 0:l.token)&&void 0!==a?a:null==h?void 0:h.token,batch:u,sent_at:(new Date).toISOString()}:"body"===s.timestampMode&&(s.data=function(t,e){return void 0===e&&(e=(new Date).toISOString()),xe(t)?t.map(t=>n({},t,{sent_at:e})):n({},t,{sent_at:e})}(s.data))),s.url=m_(s.url,s.method,s.compression,s.timestampMode);var v=y_.filter(t=>!s.disableTransport||!t.transport||!s.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){f_(t)?xn.warn(t):xn.error(t),null==s.callback||s.callback({statusCode:0,error:t})}};"sendBeacon"!==d&&s.data&&s.compression===of&&p&&"undefined"!=typeof Promise&&!o_?v_(s).then(t=>{f(t)}).catch(e=>{if(Jr(e))return o_=!0,void f(n({},s,{compression:void 0,url:m_(t.url,t.method,void 0,t.timestampMode)}));Qr(e)&&(o_=!0),f(s)}):c(s)})(n({},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}))}lu(t){this.uu?this.uu.retriableRequest(t):this._send_request(t)}_execute_array(t){z_++;try{var e,i=[],r=[],n=[];Tn(t,t=>{if(t)if(xe(e=t[0]))n.push(t);else if(Ce(t))try{t.call(this)}catch(e){xn.error("Error executing queued PostHog call",t,e)}else xe(t)&&"alias"===e?i.push(t):xe(t)&&-1!==e.indexOf("capture")&&Ce(this[e])?n.push(t):r.push(t)});var s=function(t,e){Tn(t,function(t){try{if(xe(t[0])){var i=e;Mn(t,function(t){i=i[t[0]].apply(i,t.slice(1))})}else e[t[0]].apply(e,t.slice(1))}catch(e){xn.error("Error executing queued PostHog call",t,e)}})};s(i,this),s(r,this),s(n,this)}finally{z_--}}push(e){if(z_>0&&xe(e)&&Ee(e[0])){var i=t.prototype[e[0]];Ce(i)&&i.apply(this,e.slice(1))}else this._execute_array([e])}Cu(){var t,e=null==(t=this.persistence)?void 0:t.get_property(M);return Ee(e)&&Q_.test(e)?{value:e,delivered:!1}:Te(e)&&Ee(e.value)&&Q_.test(e.value)?{value:e.value,delivered:!0===e.delivered}:void 0}Tu(t,e,i,r){if(this.persistence){this.persistence.refreshKey(M);var n=this.Cu();if(!r){if(i)return Ee(e)&&Q_.test(e)?(e!==(null==n?void 0:n.value)&&this.persistence.register({[M]:{value:e,delivered:!1}}),{value:e,pending:e!==(null==n?void 0:n.value)||!n.delivered}):void this.persistence.unregister(M);if(Ee(t)&&J_.test(t)){if((null==n?void 0:n.value.split(".")[3])===t)return{value:n.value,pending:!n.delivered};var s="fb.1."+Date.now()+"."+t;return this.persistence.register({[M]:{value:s,delivered:!1}}),{value:s,pending:!0}}return n?{value:n.value,pending:!n.delivered}:void 0}this.persistence.unregister(M)}}Mu(t){if(this.persistence){this.persistence.refreshKey(M);var e=this.Cu();(null==e?void 0:e.value)!==t||e.delivered||this.persistence.register({[M]:{value:t,delivered:!0}})}}capture(t,e,i){var r,s,o,a,l,u,h,d,v,c;if(this.__loaded&&this.persistence&&this.sessionPersistence&&this.au){if(this.is_capturing())if(!Ie(t)&&Ee(t)){this.Gl();var f=!this.config.opt_out_useragent_filter&&this._is_bot();if(!f||this.config.__preview_capture_bot_pageviews){var p=null!=i&&i.skip_client_rate_limiting?void 0:this.rateLimiter.clientRateLimitContext();if(null==p||!p.isRateLimited){var g;null!=e&&e.$current_url&&!Ee(null==e?void 0:e.$current_url)&&(xn.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.Iu||xn.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&&(g=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 m=new Date,y=(null==i?void 0:i.timestamp)||m,b=sr(null==i?void 0:i.uuid,Xf),_={uuid:b,event:t,properties:this.calculateEventProperties(t,e||{},y,b)};"$pageview"===t&&this.config.__preview_capture_bot_pageviews&&f&&(_.event="$bot_pageview",_.properties.$browser_type="bot"),p&&(_.properties.$lib_rate_limit_remaining_tokens=p.remainingTokens);var w="$feature_flag_called"===t&&!1===_.properties.$feature_flag_has_experiment&&!0===this.get_property("$minimal_flag_called_events");null!=i&&i.$set&&!w&&(_.$set=null==i?void 0:i.$set);var k=Te(null==e?void 0:e.$set)?e.$set:void 0,S=!(null==i||!i.$set)&&"$fbc"in i.$set,x=S||!!k&&"$fbc"in k,C=S?null==i||null==(r=i.$set)?void 0:r[T]:null==k?void 0:k[T],M=xe(null==e?void 0:e.$unset)?e.$unset:[],I=(null==i?void 0:i.$unset)||[],E=-1!==M.indexOf("$fbc")||-1!==I.indexOf("$fbc"),R=this.Tu(null==(s=g)?void 0:s.fbclid,C,x,E);R&&!0===_.properties.$process_person_profile&&R.pending&&!x&&!w&&(_.$set=n({[T]:R.value},_.$set));var A=null==i?void 0:i.$unset;A&&(_.$unset=A);var P=w?void 0:this.Eu(null==i?void 0:i.$set_once,t!==le,t===ae);if(P&&(_.$set_once=P),null!=i&&i._noTruncate||(h=this.config.properties_string_max_length,d=_,v=t=>Ee(t)?t.slice(0,h):t,c=new Set,_=function t(e,i){if(e!==Object(e))return v?v(e):e;if(!c.has(e)){var r;if(c.add(e),xe(e))r=[],Tn(e,e=>{r.push(t(e))});else{var n={};Mn(Be(e)?Fn(e):e,(e,i)=>{c.has(e)||(n[i]=t(e,i))}),r=n}return r}}(d)),_.timestamp=y,Ie(null==i?void 0:i.timestamp)||(_.properties.$event_time_override_provided=!0,_.properties.$event_time_override_system_time=m),w&&(_.properties=function(t,e){void 0===e&&(e=[]);var i={},r=e=>{void 0!==t[e]&&(i[e]=t[e])};return Wr.forEach(r),e.forEach(r),i}(_.properties,K_)),t===Cf||t===Tf){var F=null==e?void 0:e[Mf],O=null==e?void 0:e[Ef];zf({id:F,current_iteration:O}),_.$set=n({},_.$set,{[la({id:F,current_iteration:O},t===Tf?"responded":"dismissed")]:!0})}else t===xf&&(_.$set=n({},_.$set,{[Of]:(new Date).toISOString()}));if("product tour shown"===t){var D=null==e?void 0:e.$product_tour_type;D&&(_.$set=n({},_.$set,{["$product_tour_last_seen_date/"+D]:(new Date).toISOString()}))}var L=n({},_.properties.$set,_.$set);if(Me(L)||this.setPersonPropertiesForFlags(L),!Pe(this.config.before_send)){var N=this.ds(_);if(!N)return;(_=N).uuid=sr(_.uuid,Xf)}var q=null!==(o=null==(a=_.$set)?void 0:a.$fbc)&&void 0!==o?o:Te(null==(l=_.properties)?void 0:l.$set)?_.properties.$set.$fbc:void 0,j=null!=R&&R.pending&&q===R.value?R.value:void 0;this.Ll.emit("eventCaptured",_);var B=null!==(u=null==i?void 0:i._url)&&void 0!==u?u:this.requestRouter.endpointFor("api",this.analyticsDefaultEndpoint),H=n({method:"POST",url:B,data:_,compression:"best-available",timestampMode:"recordings"===(null==i?void 0:i._batchKey)||/\/s\/(?:\?|$)/.test(B)?"body":"capture-body",batchKey:null==i?void 0:i._batchKey},null!=i&&i.transport?{transport:i.transport}:{},j?{fireCallbackOnDrop:!0,callback:t=>{t.statusCode>=200&&300>t.statusCode&&this.Mu(j)}}:{});return!this.config.request_batching||i&&(null==i||!i._batchKey)||null!=i&&i.send_instantly||j?this.lu(H):this.au.enqueue(H),_}xn.critical("This capture call is ignored due to client rate limiting.")}}else xn.error("No event name provided to posthog.capture")}else xn.uninitializedWarning("posthog.capture")}_addCaptureHook(t){return this.on("eventCaptured",e=>t(e.event,e))}getExtension(t){var e;return null==(e=this._u)?void 0:e.getExtension(t)}gu(){var t;return null!==(t=this._u)&&void 0!==t?t:this._u=new B_(this)}ql(t){this.Yl.push(t);var e=!0;return()=>{if(e){e=!1;var i=this.Yl.indexOf(t);-1!==i&&this.Yl.splice(i,1)}}}Ru(t){var e,i,r;return void 0===t&&(t=!0),!(null==(e=this.persistence)||!e.consumeCookieIdentityChange())&&(this.ru=null,"anonymous"===this.persistence.get_property("$user_state")&&(null==(r=this.sessionPersistence)||r.clear(),this.Kl.clear(),this.Au()),null==(i=this.featureFlags)||i.reset(),t&&this.reloadFeatureFlags(),!0)}calculateEventProperties(t,e,i,r,s){if(i=i||new Date,!this.persistence||!this.sessionPersistence)return e;this.persistence.syncCookieProperties(),this.Ru();var o=s?void 0:this.persistence.remove_event_timer(t),l=n({},e);if(l.token=this.config.token,l.$config_defaults=this.config.defaults,this.zl()&&(l[qt]=!0),"$snapshot"===t){var u=n({},this.persistence.properties(),this.sessionPersistence.properties());return l.distinct_id=u.distinct_id,(!Ee(l.distinct_id)&&!Fe(l.distinct_id)||Re(l.distinct_id))&&xn.error("Invalid distinct_id for replay event. This indicates a bug in your implementation"),l}var v,c=function(t,e,i,r){var n,s,o,l;if(void 0===r&&(r=!1),!g)return{};var u,h=t?[...Ea,...e||[]]:[],v=Gi(g),c=v[0],f=v[1],p=function(t){for(var e=0;Ki.length>e;e++){var i,r=Ki[e],n=r[1],s=r[2],o=t.match(r[0]);if(o)return[n,(null==(i=s&&t.match(s)||o)?void 0:i[1])||""]}return["",""]}(g),m=p[0],y=p[1],b=null!=(u="u">typeof navigator?navigator:void 0)&&u.brave?{brave:!0}:{},_={};Ie(i)||(_.detectGoogleSearchApp=i);var w={},k=null==(n=navigator)||null==(n=n.userAgentData)?void 0:n.platform,S=null==(s=navigator)?void 0:s.maxTouchPoints,x=null==a||null==(o=a.screen)?void 0:o.width,C=null==a||null==(l=a.screen)?void 0:l.height,T=null==a?void 0:a.devicePixelRatio;Ie(k)||(w.userAgentDataPlatform=k),Ie(S)||(w.maxTouchPoints=S),Ie(x)||(w.screenWidth=x),Ie(C)||(w.screenHeight=C),Ie(T)||(w.devicePixelRatio=T);var M,I=In(Pn({$os:c,$os_version:f,$browser:zi(g,navigator.vendor,b,_),$webview_app:m,$webview_app_version:y,$device:Zi(g),$device_type:Ji(g,w),$timezone:Ba(),$timezone_offset:Ha()}),{$current_url:zn(r?ar(null==d?void 0:d.href):null==d?void 0:d.href,h,Aa),$host:null==d?void 0:d.host,$pathname:null==d?void 0:d.pathname,$raw_user_agent:g.length>1e3?g.substring(0,997)+"...":g,$browser_version:Wi(g,navigator.vendor,b,_),$browser_language:Da(),$browser_language_prefix:(M=Da(),"string"==typeof M?M.split("-")[0]:void 0),$screen_height:null==a?void 0:a.screen.height,$screen_width:null==a?void 0:a.screen.width,$viewport_height:null==a?void 0:a.innerHeight,$viewport_width:null==a?void 0:a.innerWidth,$lib:kn.LIB_NAME,$lib_version:kn.LIB_VERSION,$insert_id:Math.random().toString(36).substring(2,10)+Math.random().toString(36).substring(2,10),$time:Date.now()/1e3});return kn.SDK_DIST_CHANNEL&&(I.$sdk_dist_channel=kn.SDK_DIST_CHANNEL),I}(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(s,i.getTime(),!0),p=f.windowId;l.$session_id=f.sessionId,l.$window_id=p}this.sessionPropsManager&&In(l,this.sessionPropsManager.getSessionProps());try{var m;this.sessionRecording&&In(l,this.sessionRecording.sdkDebugProperties),l.$sdk_debug_retry_queue_size=null==(m=this.uu)?void 0:m.length}catch(t){l.$sdk_debug_error_capturing_properties=String(t)}if(this.requestRouter.region===R_&&(l.$lib_custom_api_host=this.config.api_host),v="$pageview"!==t||s?"$pageleave"!==t||s?this.pageViewManager.doEvent():this.pageViewManager.doPageLeave(i):this.pageViewManager.doPageView(i,r),l=In(l,v),"$pageview"===t&&h&&(l.title=h.title),!Ie(o)){var y=i.getTime()-o;l.$duration=parseFloat((y/1e3).toFixed(3))}g&&this.config.opt_out_useragent_filter&&(l.$browser_type=this._is_bot()?"bot":"browser");var b=this.persistence.properties(),_=this.sessionPersistence.properties(),w=l.$groups,k=b.$groups;Te(w)&&!Me(w)&&(l.$groups=n({},Te(k)?k:{},w)),Mn(["$referrer","$referring_domain"],t=>{t in b&&delete _[t]});var S={};if(this.Yl.length>0)for(var x of this.Yl.slice())try{In(S,x())}catch(t){xn.error("Failed to produce browser extension event properties",t)}(l=In({},c,b,_,n({},S,l))).$is_identified=this._isIdentified(),xe(this.config.property_denylist)?Mn(this.config.property_denylist,function(t){delete l[t]}):xn.error(Z_+this.config.property_denylist+" or property_blacklist config: "+this.config.property_blacklist);var C=this.config.sanitize_properties;C&&(xn.error(G_),l=C(l,t));var T=this.Pu();return l.$process_person_profile=T,T&&!s&&this.Fu("_calculate_event_properties"),l}Eu(t,e,i){var r;if(void 0===e&&(e=!0),void 0===i&&(i=!1),!this.persistence||!this.Pu())return t;if(this.Ql&&!i)return t;var n=In({},this.persistence.get_initial_props(),(null==(r=this.sessionPropsManager)?void 0:r.getSetOnceProps())||{},t||{}),s=this.config.sanitize_properties;return s&&(xn.error(G_),n=s(n,"$set_once")),e&&(this.Ql=!0),Me(n)?void 0:n}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.Ru(),null==(i=this.sessionPersistence)||i.register(t),Object.keys(t).forEach(t=>this.Kl.add(t)),this.Au()}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.Kl.delete(t),this.Au()}Ou(t,e){this.register({[t]:e})}hu(){this.Kl.forEach(t=>{var e;null==(e=this.sessionPersistence)||e.unregister(t)}),this.Kl.clear(),this.Au()}Au(){var t;if(this.Xl)if("memory"===this.config.persistence||null!=(t=this.sessionPersistence)&&t.Bo||!bp.si())bp.hi(this.Xl);else{var e=[];this.Kl.forEach(t=>e.push(t)),e.length>0?bp.ui(this.Xl,e):bp.hi(this.Xl)}}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.Ll.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:V_}),()=>{})}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:V_})}getActiveMatchingSurveys(t,e){void 0===e&&(e=!1),this.surveys?this.surveys.getActiveMatchingSurveys(t,e):t([],{isLoaded:!1,error:V_})}renderSurvey(t,e){var i;null==(i=this.surveys)||i.renderSurvey(t,e)}displaySurvey(t,e){var i;void 0===e&&(e=Wf),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:V_}}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:V_})}$u(t){return!t||Re(t)?(xn.critical("Unique user id has not been set in posthog.identify"),!1):"$posthog_cookieless"===t?(xn.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())||(xn.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 xn.uninitializedWarning("posthog.identify");if(Fe(t)&&(t=t.toString(),xn.warn("The first argument to posthog.identify was a number, but it should be a string. It has been converted to a string.")),this.$u(t)&&this.Fu("posthog.identify")){this.Gl();var r=this.get_distinct_id(),n=this.persistence.syncCookieProperties()&&this.get_distinct_id()!==r,s=this.Ru(!1),o=this.persistence.oa(),a=!1;try{var l=this.get_distinct_id();this.register({$user_id:t}),this.get_property("$device_id")||this.register_once({$had_persisted_distinct_id:!0,$device_id:l},""),t!==l&&t!==this.get_property("__alias")&&(this.unregister(x),this.register({distinct_id:t}));var u=(this.persistence.get_property("$user_state")||"anonymous")===te,h=t!==l,d=!h&&u;if(h&&u){var v,c=this.config.reuseAnonymousId?{distinct_id:t}:{distinct_id:t,$anon_distinct_id:l};this.persistence.set_property(At,ee),this.setPersonPropertiesForFlags({$set:e||{},$set_once:i||{}},!1),this.config.cookieWinsOnConflict&&this.persistence.aa(),this.capture(ae,c,{$set:e||{},$set_once:i||{}}),this.ru=_a(t,e,i),null==(v=this.featureFlags)||v.setAnonymousDistinctId(this.config.reuseAnonymousId?void 0:l)}else if(d){this.persistence.set_property(At,ee);var f=e||{},p=i||{};this.setPersonPropertiesForFlags({$set:f,$set_once:p},!1),this.config.cookieWinsOnConflict&&this.persistence.aa(),this.capture("$set",{$set:f,$set_once:p}),this.ru=_a(t,e,i)}else(e||i)&&this.setPersonProperties(e,i);h||n||s?(this.reloadFeatureFlags(),this.featureFlags?this.featureFlags.resetFlagCallReported():this.unregister(Mt)):d&&(e||i)&&this.reloadFeatureFlags(),a=!0}finally{o&&this.persistence.ha(a)}}}setPersonProperties(t,e){if((t||e)&&this.Fu("posthog.setPersonProperties")){var i=_a(this.get_distinct_id(),t,e);this.ru!==i?(this.setPersonPropertiesForFlags({$set:t||{},$set_once:e||{}},!0),this.capture("$set",{$set:t||{},$set_once:e||{}}),this.ru=i):xn.info("A duplicate setPersonProperties call was made with the same properties. It has been ignored.")}}unsetPersonProperties(t){var e,i=(xe(t)?t:[t]).filter(t=>Ee(t)&&t.length>0);0!==i.length&&this.Fu("posthog.unsetPersonProperties")&&(null==(e=this.featureFlags)||e.unsetPersonPropertiesForFlags(i,!0),this.capture("$set",{$unset:i}),this.ru=null)}group(t,e,i){var r;if(t&&e){null==(r=this.persistence)||r.syncCookieProperties(),this.Ru();var s=this.getGroups(),o=s[t]!==e;if(o&&this.resetGroupPropertiesForFlags(t),this.register({$groups:n({},s,{[t]:e})}),(o||i)&&this.Pu()){var a={$group_type:t,$group_key:e};i&&(a.$group_set=i),this.capture(le,a)}i&&this.setGroupPropertiesForFlags({[t]:i}),o&&!i&&this.reloadFeatureFlags()}else xn.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.Fu("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=$e(t)?t:null==t?void 0:t.resetDeviceID,i=$e(t)||null==t?void 0:t.bootstrap;this.Du(e,!1,i)}Du(t,e,i){var r,s,o,a;if(void 0===e&&(e=!1),xn.info("reset"),!this.__loaded)return xn.uninitializedWarning("posthog.reset");var l=null==i?void 0:i.sessionID;this.config.bootstrap=i||(null==(r=this.su)?void 0:r.bootstrap)||{},null==(s=this.featureFlags)||null==s.updateConfig||s.updateConfig(this.config,this.Ma());var u=this.get_property(k),h=this.get_property(S),d=this.get_property(j);null==(o=this.sessionRecording)||o.flushBeforeIdentityReset();var v=this.is_capturing();this.consent.reset(),e||!v||this.is_capturing()||console.warn("[PostHog.js]","reset() cleared the stored consent, and capturing is now off because of `opt_out_capturing_by_default`. Call opt_in_capturing() again, and prefer calling reset() before opting in rather than after.");var c=null==(a=this.persistence)||null==a.oa?void 0:a.oa(),f=!1;try{var p,g,m,y,b,_,w,x,C,T,M,I,E;if(null==(p=this.persistence)||p.clear(),null==(g=this.sessionPersistence)||g.clear(),this.Kl.clear(),this.Au(),Ie(d)||null==(m=this.persistence)||m.register({[j]:d}),null==(y=this.surveys)||y.reset(),null==(b=this.featureFlags)||b.reset(),null==(_=this.conversations)||_.reset(),null==(w=this.logs)||w.reset(),null==(x=this.metrics)||x.reset(),null==(C=this.persistence)||C.set_property(At,te),null==(T=this.sessionManager)||T.resetSessionId(),this.ru=null,"always"===this.config.cookieless_mode)this.register_once({distinct_id:Nt,$device_id:null},"");else{var R=this.config.get_device_id(Xf());this.register_once({distinct_id:R,$device_id:t?R:u},""),t||Ie(h)||this.register({[S]:h})}if(this.register({$last_posthog_reset:(new Date).toISOString()},1),i)if(void 0===i.distinctID||this.zl()||(null==(E=this.persistence)||E.set_property(At,i.isIdentifiedID?ee:te),this.register({distinct_id:i.distinctID})),null==(M=this.featureFlags)||M.initialize(),!(Ie(l)||null!=(I=this.sessionManager)&&I.setBootstrapSessionId(l,!0))){var A=n({},i);delete A.sessionID,this.config.bootstrap=A}delete this.config.identity_distinct_id,delete this.config.identity_hash,delete this.config.identity_claims,f=!0}finally{var P;c&&(null==(P=this.persistence)||null==P.ha||P.ha(f))}this.reloadFeatureFlags()}shutdown(t){var e=this;return o(function*(){var t,i,r,n,s,o,a;if(e.__loaded){e.gu().dispose(),null==(t=e.sessionRecording)||t.dispose(),null==(i=e.logs)||i.flushLogs("sendBeacon"),null==(r=e.metrics)||r.flush("sendBeacon"),null==(n=e.au)||n.unload(),null==(s=e.uu)||s.unload();try{var l;null==(l=e.featureFlags)||l.destroy()}catch(t){xn.error("Error while destroying feature flags",t)}null==(o=e.persistence)||o.destroy(),null==(a=e.sessionPersistence)||a.destroy()}else xn.uninitializedWarning("posthog.shutdown")})()}setIdentity(t,e){var i;delete this.config.identity_claims,this.config.identity_distinct_id=t,this.config.identity_hash=e,this.alias(t),null==(i=this.conversations)||i.Lu()}clearIdentity(){var t;delete this.config.identity_distinct_id,delete this.config.identity_hash,delete this.config.identity_claims,null==(t=this.conversations)||t.Nu()}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("$people_distinct_id")?(xn.critical("Attempting to create alias for existing People user - aborting."),-2):this.Fu("posthog.alias")?(Ie(e)&&(e=this.get_distinct_id()),t!==e?(this.Ou(x,t),this.capture("$create_alias",{alias:t,distinct_id:e})):(xn.warn("alias matches current distinct_id - skipping api call."),this.identify(t),-1)):void 0}set_config(t){var e=n({},this.config);if(Te(t)){var i,r,s,o,a,l,u,h,d,v,c,f,p;In(this.config,rw(t));var g=this.Zl();null==(i=this.persistence)||i.update_config(this.config,e,g),this.sessionPersistence="sessionStorage"===this.config.persistence||"memory"===this.config.persistence?this.persistence:new Yb(n({},this.config,{persistence:"sessionStorage"}),g,!1);var m=this.nu(this.config.debug);$e(m)&&(this.config.debug=m),$e(this.config.debug)&&(this.config.debug?(ia.DEBUG=!0,sp.si()&&sp.ui("ph_debug",!0),xn.info("set_config",{config:t,oldConfig:e,newConfig:n({},this.config)})):(ia.DEBUG=!1,sp.si()&&sp.hi("ph_debug"))),null==(r=this.featureFlags)||null==r.updateConfig||r.updateConfig(this.config,this.Ma()),null==(s=this.exceptionObserver)||s.onConfigChange(),null==(o=this.exceptions)||o.onConfigChange(),null==(a=this.sessionRecording)||a.startIfEnabledOrStop(),null==(l=this.tracingHeaders)||l.startIfEnabledOrStop(),null==(u=this.autocapture)||u.startIfEnabled(),null==(h=this.heatmaps)||h.startIfEnabled(),("capture_pageview"in t||"disable_capture_url_hashes"in t)&&(null==(d=this.historyAutocapture)||d.startIfEnabledOrStop()),null==(v=this.exceptionObserver)||v.startIfEnabledOrStop(),null==(c=this.deadClicksAutocapture)||c.startIfEnabledOrStop(),null==(f=this.surveys)||f.loadIfEnabled(),this.Jl(),null==(p=this.externalIntegrations)||p.startIfEnabledOrStop(),!e.segment&&this.config.segment&&this.persistence&&Ob(this,U_,!1)}}_overrideSDKInfo(t,e){ia.LIB_NAME=t,ia.LIB_VERSION=e}startSessionRecording(t){var e,i,r,n,s,o=!0===t,a={sampling:o||!(null==t||!t.sampling),linked_flag:o||!(null==t||!t.linked_flag),url_trigger:o||!(null==t||!t.url_trigger),event_trigger:o||!(null==t||!t.event_trigger)};Object.values(a).some(Boolean)&&(null==(e=this.sessionManager)||e.checkAndGetSessionAndWindowId(),a.sampling&&(null==(i=this.sessionRecording)||i.overrideSampling()),a.linked_flag&&(null==(r=this.sessionRecording)||r.overrideLinkedFlag()),a.url_trigger&&(null==(n=this.sessionRecording)||n.overrideTrigger("url")),a.event_trigger&&(null==(s=this.sessionRecording)||s.overrideTrigger("event"))),this.set_config({disable_session_recording:!1})}stopSessionRecording(){this.set_config({disable_session_recording:!0})}sessionRecordingStarted(){var t;return!(null==(t=this.sessionRecording)||!t.started)}captureException(t,e){try{if(!this.exceptions)return;var i=this.exceptions.buildProperties(t,{handled:!0,syntheticException:new Error("PostHog syntheticException")});return this.exceptions.sendExceptionEvent(n({},i,e))}catch(t){return}}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 e,i;return null!==(e=null==(i=this.logs)?void 0:i.logger)&&void 0!==e?e:t.qu}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:X_;return e!==X_&&(e="posthog."+e),e}_isIdentified(){var t,e;return"identified"===(null==(t=this.persistence)?void 0:t.get_property("$user_state"))||"identified"===(null==(e=this.sessionPersistence)?void 0:e.get_property("$user_state"))}Pu(){var t,e;return!("never"===this.config.person_profiles||"identified_only"===this.config.person_profiles&&!this._isIdentified()&&Me(this.getGroups())&&(null==(t=this.persistence)||null==(t=t.props)||!t.__alias)&&(null==(e=this.persistence)||null==(e=e.props)||!e.$epp))}xu(){return!0===this.config.capture_pageleave||"if_capture_pageview"===this.config.capture_pageleave&&!!this.config.capture_pageview}createPersonProfile(){this.Pu()||this.Fu("posthog.createPersonProfile")&&this.setPersonProperties({},{})}setInternalOrTestUser(){this.Fu("posthog.setInternalOrTestUser")&&this.setPersonProperties({$internal_or_test_user:!0})}Fu(t){return"never"===this.config.person_profiles?(xn.error(t+' was called, but process_person is set to "never". This call will be ignored.'),!1):(this.Ul(),this.Ou(Lt,!0),!0)}Zl(){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&&"on_reject"!==this.config.cookieless_mode)}Jl(){var t,e,i,r,n,s=this.Zl();return this.is_capturing()||null==(t=this.logs)||t.ju(),(null==(e=this.persistence)?void 0:e.Bo)!==s&&(null==(i=this.persistence)||i.set_disabled(s)),(null==(r=this.sessionPersistence)?void 0:r.Bo)!==s&&(null==(n=this.sessionPersistence)||n.set_disabled(s)),s&&(this.Kl.clear(),this.Au()),s}opt_in_capturing(e){var i,r,n;if("always"!==this.config.cookieless_mode){if(this.zl()){var s,o,a,l,u,h;null==(s=this.sessionRecording)||s.dispose({discardBufferedEvents:!0}),this.Du(!0,!0),null==(o=this.sessionManager)||o.destroy(),null==(a=this.pageViewManager)||a.destroy(),this.sessionManager=new M_(this),this.pageViewManager=new Nb(this),this.persistence&&(this.sessionPropsManager=new S_(this,this.sessionManager,this.persistence));var d,v=null!==(l=null==(u=this.config.__extensionClasses)?void 0:u.sessionRecording)&&void 0!==l?l:null==(h=t.__defaultExtensionClasses)?void 0:h.sessionRecording;v&&(this.sessionRecording=this.Hl(this.sessionRecording,new v(this)),this.Dl&&(null==(d=this.sessionRecording)||null==d.onRemoteConfig||d.onRemoteConfig(this.Dl)))}this.consent.optInOut(!0),this.Jl(),this.wu(),null==(i=this.sessionRecording)||i.startIfEnabledOrStop(),"on_reject"==this.config.cookieless_mode&&(null==(r=this.surveys)||r.loadIfEnabled()),(Ie(null==e?void 0:e.captureEventName)||null!=e&&e.captureEventName)&&this.capture(null!==(n=null==e?void 0:e.captureEventName)&&void 0!==n?n:"$opt_in",null==e?void 0:e.captureProperties,{send_instantly:!0}),this.config.capture_pageview&&this.ku()}else xn.warn(W_)}opt_out_capturing(){if("always"!==this.config.cookieless_mode){var t,e,i="on_reject"===this.config.cookieless_mode?this.sessionRecording:void 0;null==i||i.dispose({discardBufferedEvents:!0}),"on_reject"===this.config.cookieless_mode&&this.consent.isOptedIn()&&this.Du(!0,!0),this.consent.optInOut(!1),this.Jl(),"on_reject"===this.config.cookieless_mode&&(this.register({distinct_id:Nt,$device_id:null}),this.Bl(i),this.sessionRecording=void 0,null==(t=this.sessionManager)||t.destroy(),null==(e=this.pageViewManager)||e.destroy(),this.sessionManager=void 0,this.sessionPropsManager=void 0,this.config.capture_pageview&&this.ku(),this.wu())}else xn.warn(W_)}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"always"===this.config.cookieless_mode||("on_reject"===this.config.cookieless_mode?this.consent.isRejected()||this.consent.isOptedIn():!this.has_opted_out_capturing())}clear_opt_in_out_capturing(){this.consent.reset(),this.Jl()}_is_bot(){return u?I_(u,this.config.custom_blocked_useragents):void 0}ku(){h&&("visible"===h.visibilityState?this.tu||(this.tu=!0,this.capture(se,{title:h.title},{send_instantly:!0}),this.eu&&(h.removeEventListener(re,this.eu),this.eu=null)):this.eu||(this.eu=this.ku.bind(this),Dn(h,re,this.eu)))}debug(t){!1===t?(null==a||a.console.log("You've disabled debug mode."),this.set_config({debug:!1})):(null==a||a.console.log("You're now in debug mode. All calls to PostHog will be logged in your console.\nYou can disable this with `posthog.debug(false)`."),this.set_config({debug:!0}))}Ma(){var t=this.su||{};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?(xn.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&&!Pe(t[e]),o=i in t&&!Pe(t[i]);return s?t[e]:!!o&&(n&&n.warn("Config field '"+i+"' is deprecated. Please use '"+e+"' instead. The old field will be removed in a future major version."),t[i])}(t,"advanced_disable_flags","advanced_disable_decide",0,xn)}ds(t){var e;if(Pe(this.config.before_send))return t;var i=Object.keys(null!==(e=t.properties)&&void 0!==e?e:{}).filter(Ne),r=xe(this.config.before_send)?this.config.before_send:[this.config.before_send],n=t;for(var s of r)try{if(n=s(n),Pe(n)){var o="Event '"+t.event+"' was rejected in beforeSend function";return Le(t.event)?xn.warn(o+". This can cause unexpected behavior."):xn.info(o),null}n.properties&&!Me(n.properties)||xn.warn("Event '"+t.event+"' has no properties after beforeSend function, this is likely an error.")}catch(e){return xn.error("Error in beforeSend function for event '"+t.event+"':",e),null}for(var a of i)if(n.properties&&Pe(n.properties[a]))return xn.warn("Event '"+t.event+"' had its '"+a+"' property removed in a beforeSend function. This property is required for ingestion, so the event will be dropped."),null;return n}getPageViewId(){var t;return null==(t=this.pageViewManager.fo)?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)})}nu(t){var e=$e(t)&&!t,i=sp.si()&&"true"===sp.li("ph_debug");return!e&&(!!i||t)}},s.__defaultExtensionClasses={},s.qu=(()=>{var t=()=>{};return{trace:t,debug:t,info:t,warn:t,error:t,fatal:t}})(),s);!function(t,e){for(var i=0;e.length>i;i++)t.prototype[e[i]]=An(t.prototype[e[i]])}(sw,["identify"]);var ow=class{constructor(t){this._instance=t}refresh(t){var e=this._instance.config,i=Te(e.autocapture)?e.autocapture:void 0;t.enabled=!!e.autocapture,t.rageclick=e.rageclick,t.maskAllElementAttributes=e.mask_all_element_attributes,t.maskAllText=e.mask_all_text,t.disableCaptureUrlHashes=e.disable_capture_url_hashes,t.getCurrentUrl=e.get_current_url,t.remoteRequestsDisabled=this._instance.Ma(),t.url_allowlist=null==i?void 0:i.url_allowlist,t.url_ignorelist=null==i?void 0:i.url_ignorelist,t.dom_event_allowlist=null==i?void 0:i.dom_event_allowlist,t.element_allowlist=null==i?void 0:i.element_allowlist,t.css_selector_allowlist=null==i?void 0:i.css_selector_allowlist,t.css_selector_ignorelist=null==i?void 0:i.css_selector_ignorelist,t.element_attribute_ignorelist=null==i?void 0:i.element_attribute_ignorelist,t.capture_copied_text=null==i?void 0:i.capture_copied_text}},aw=Cn("[ExceptionAutocapture]"),lw=Cn("[TracingHeaders]"),uw=Cn("[Web Vitals]"),hw=9e5,dw=["CLS","FCP","INP","LCP"],vw=["INP","LCP"],cw=["interactionTarget","interactionType","inputDelay","processingDuration","presentationDelay","loadState","target","url","timeToFirstByte","resourceLoadDelay","resourceLoadDuration","elementRenderDelay","largestShiftTarget","largestShiftTime","largestShiftValue","firstByteToFCP"],fw=Cn("[SessionRecording]"),pw=Cn("[Heatmaps]");function gw(t){return Te(t)&&"clientX"in t&&"clientY"in t&&Fe(t.clientX)&&Fe(t.clientY)}var mw=Cn("[Product Tours]"),yw=t=>{var e;return!t.config.disable_product_tours&&!(null==(e=t.persistence)||!e.get_property(L))},bw=Cn("[SiteApps]"),_w="Error while initializing PostHog app with config id ",ww=(t,e)=>null!=t&&t.then?t.then(e):e(t),kw="SDK is not enabled or survey functionality is not yet loaded",Sw="Disabled. Not loading surveys.",xw=class{constructor(t,e){this.Us=t,this.Bu=e,this.name="surveys",this._surveyEventReceiver=null,this._surveyManager=null,this.Hu=!1,this.zu=[],this.Uu=null,this.Wu=null,this.Js=!1,this.Vu=new Set,this.onRemoteConfig=t=>{if(!this.Js&&!this._n.disableSurveys){if(!t.ok)return Nf.warn("Remote config unavailable. Not loading surveys.");var e=t.config.surveys;if(Pe(e))return Nf.warn("Flags not loaded yet. Not loading surveys.");this.Gu=$e(e)?e:e.length>0,Nf.info("flags response received, isSurveysEnabled: "+this.Gu),this.loadIfEnabled()}}}setup(t){if(!this.Js)return this.Zu=t,ww(t.kv.initialize(),()=>{if(this.Zu===t&&!this.Js){this.Zu=void 0,this.Hs=t;var e=t.onRemoteConfig(this.onRemoteConfig);this.Js?e.dispose():(this.Xs=e,this.loadIfEnabled())}})}dispose(){var t,e,i;this.Js||(this.Js=!0,this.Zu=void 0,this.Hs=void 0,null==(t=this.Xs)||t.dispose(),this.Xs=void 0,null==(e=this._surveyEventReceiver)||e.dispose(),this._surveyEventReceiver=null,null==(i=this._surveyManager)||null==i.dispose||i.dispose(),this._surveyManager=null,this.zu=[],this.Uu=null,this.Vu.forEach(t=>clearTimeout(t)),this.Vu.clear())}get _n(){return this.Us.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("seenSurvey_")||null!=r&&r.startsWith("inProgressSurvey_"))&&e.push(r)}e.forEach(t=>localStorage.removeItem(t))}catch(t){}}loadIfEnabled(){if(!this.Js&&this.Hs){var t=this._n;if(!this._surveyManager)if(this.Hu)Nf.info("Already initializing surveys, skipping...");else if(t.disableSurveys)Nf.info(Sw);else if(t.cookielessMode&&this.Us.isOptedOut())Nf.info("Not loading surveys in cookieless mode without consent.");else{var e=this.Us.getExtensions();if(e){if(!Ie(this.Gu)||t.advancedEnableSurveys){var i=this.Gu||t.advancedEnableSurveys;this.Hu=!0;try{var r=e.generateSurveys;if(r)return this.Ju(r,i),void(this.Hu=!1);var n=e.loadExternalDependency;if(!n)return this.Qu(Yt),void(this.Hu=!1);n(t=>{try{if(this.Js)return;var e=this.Us.getExtensions();t||null==e||!e.generateSurveys?this.Qu("Could not load surveys script",t):this.Ju(e.generateSurveys,i)}finally{this.Hu=!1}})}catch(t){throw this.Hu=!1,this.Qu("Error initializing surveys",t),t}}}else Nf.error("PostHog Extensions not found.")}}}Ju(t,e){this.Js||(this._surveyManager=t(e),this._surveyEventReceiver=this.Us.createEventReceiver(),Nf.info("Surveys loaded successfully"),this.Ku({isLoaded:!0}))}Qu(t,e){Nf.error(t,e),this.Ku({isLoaded:!1,error:t})}onSurveysLoaded(t){return this.zu.push(t),this._surveyManager&&this.Ku({isLoaded:!0}),()=>{this.zu=this.zu.filter(e=>e!==t)}}getSurveys(t,e){var i;void 0===e&&(e=!1);var r=null!==(i=this.Hs)&&void 0!==i?i:this.Bu;if(r&&!this.Js){if(this._n.disableSurveys)return Nf.info(Sw),t([]);var n=r.kv.get(pt);if(n&&!e)return t(n,{isLoaded:!0}),void(this.Xu()&&this.getSurveys(()=>{},!0));if(this.Uu)this.Uu.then(e=>{this.Js||t(e.surveys,e.context)}).catch(t=>Nf.error("Error in survey callback",t));else{var s=this.Yu("/api/surveys/",{method:"GET",query:{token:r.projectToken},sentAt:"query",timeoutMs:this._n.requestTimeoutMs}).then(t=>{try{return this.th(r,t)}catch(t){return Nf.error("Error processing surveys response",t),this.th(r,{statusCode:0,error:t})}},t=>this.th(r,{statusCode:0,error:t}));this.Uu=s;var o=()=>{this.Uu===s&&(this.Uu=null)};s.then(e=>{o(),this.Js||t(e.surveys,e.context)},o).catch(t=>Nf.error("Error in survey callback",t))}}}Yu(t,e){var i=this.Hs;return i?i.sendRequest(t,e):new Promise(t=>t({statusCode:0,error:new Error(kw)}))}th(t,e){var i;if(this.Js)return{surveys:[],context:{isLoaded:!1,error:kw}};var r=e.statusCode;if(200!==r||!e.json){var n="Surveys API could not be loaded, status: "+r;return 0!==r?Nf.error(n):e.error||Nf.warn(n),this.Wu=Date.now(),{surveys:[],context:{isLoaded:!1,error:n}}}this.Wu=null;var s=e.json.surveys||[],o=s.filter(t=>qf(t)&&(fa(t)||jf(t)));return o.length>0&&(null==(i=this._surveyEventReceiver)||i.register(o)),t.kv.set({[pt]:s,[gt]:Date.now()}),{surveys:s,context:{isLoaded:!0}}}Xu(){return this.eh()&&!this.Uu&&!this.ih()}eh(){var t,e,i=null==(t=null!==(e=this.Hs)&&void 0!==e?e:this.Bu)?void 0:t.kv.get(gt);return Fe(i)&&Date.now()-i>3e5}ih(){return Fe(this.Wu)&&3e5>Date.now()-this.Wu}markSurveyAsSeen(t,e){var i;zf({id:t,current_iteration:null!==(i=null==e?void 0:e.iteration)&&void 0!==i?i:null});try{localStorage.setItem("lastSeenSurveyDate",(new Date).toISOString())}catch(t){}}Ku(t){for(var e of this.zu)try{if(!t.isLoaded)return e([],t);this.getSurveys(e)}catch(t){Nf.error("Error in survey callback",t)}}getActiveMatchingSurveys(t,e){if(void 0===e&&(e=!1),!Pe(this._surveyManager))return this._surveyManager.getActiveMatchingSurveys(t,e);Nf.warn("init was not called")}rh(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}nh(t){if(Pe(this._surveyManager))return{eligible:!1,reason:kw};var e="string"==typeof t?this.rh(t):t;return e?this._surveyManager.checkSurveyEligibility(e):{eligible:!1,reason:"Survey not found"}}sh(t){if(Pe(this._surveyManager))return{eligible:!1,reason:kw};var e="string"==typeof t?this.rh(t):t;return e?this._surveyManager.checkSurveyRenderability(e):{eligible:!1,reason:"Survey not found"}}canRenderSurvey(t){if(Pe(this._surveyManager))return Nf.warn("init was not called"),{visible:!1,disabledReason:kw};var e=this.sh(t);return{visible:e.eligible,disabledReason:e.reason}}canRenderSurveyAsync(t,e){return Pe(this._surveyManager)?(Nf.warn("init was not called"),Promise.resolve({visible:!1,disabledReason:kw})):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.sh(n);i({visible:s.eligible,disabledReason:s.reason})}else i({visible:!1,disabledReason:"Survey not found"})},e)})}renderSurvey(t,e,i){var r;if(Pe(this._surveyManager))Nf.warn("init was not called");else{var n="string"==typeof t?this.rh(t):t;if(null!=n&&n.id)if(Uf.includes(n.type)){var s=null==h?void 0:h.querySelector(e);if(s)if(null!=(r=n.appearance)&&r.surveyPopupDelaySeconds){Nf.info("Rendering survey "+n.id+" with delay of "+n.appearance.surveyPopupDelaySeconds+" seconds");var o=setTimeout(()=>{var t,e;this.Vu.delete(o),this.Js||(Nf.info("Rendering survey "+n.id+" with delay of "+(null==(t=n.appearance)?void 0:t.surveyPopupDelaySeconds)+" seconds"),null==(e=this._surveyManager)||e.renderSurvey(n,s,i),Nf.info("Survey "+n.id+" rendered"))},1e3*n.appearance.surveyPopupDelaySeconds);this.Vu.add(o)}else this._surveyManager.renderSurvey(n,s,i);else Nf.warn("Survey element not found")}else Nf.warn("Surveys of type "+n.type+" cannot be rendered in the app");else Nf.warn("Survey not found")}}displaySurvey(t,e){var i;if(Pe(this._surveyManager))Nf.warn("init was not called");else{var r=this.rh(t);if(r){var s=r;if(null!=(i=r.appearance)&&i.surveyPopupDelaySeconds&&e.ignoreDelay&&(s=n({},r,{appearance:n({},r.appearance,{surveyPopupDelaySeconds:0})})),e.displayType!==Df&&e.initialResponses&&Nf.warn("initialResponses is only supported for popover surveys. prefill will not be applied."),!1===e.ignoreConditions){var o=this.nh(r);if(!o.eligible)return void Nf.warn("Survey is not eligible to be displayed: ",o.reason)}"inline"!==e.displayType?this._surveyManager.handlePopoverSurvey(s,e):this.renderSurvey(s,e.selector,e.properties)}else Nf.warn("Survey not found")}}cancelPendingSurvey(t){Pe(this._surveyManager)?Nf.warn("init was not called"):this._surveyManager.cancelSurvey(t)}handlePageUnload(){var t;null==(t=this._surveyManager)||null==t.handlePageUnload||t.handlePageUnload()}};function Cw(t,e,i){if(Pe(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}}var Tw=class{constructor(t){this._instance=t,this.oh=new Set,this.ah=new Set,this.uh=new x_,this.hh=(t,e)=>this.dh(t,e)&&this.fh(t,e)&&this.ph(t,e)&&this.gh(t,e),this.dh=(t,e)=>null==e||!e.event||(null==t?void 0:t.event)===(null==e?void 0:e.event)}init(){var t,e;Ie(null==(t=this._instance)?void 0:t._addCaptureHook)||(this.mh=null==(e=this._instance)?void 0:e._addCaptureHook((t,e)=>{this.on(t,e)}))}dispose(){var t;null==(t=this.mh)||t.call(this),this.mh=void 0,this.uh=new x_}register(t){var e,i;if(!Ie(null==(e=this._instance)?void 0:e._addCaptureHook)&&(t.forEach(t=>{var e;this.oh.add(t),null==(e=t.steps)||e.forEach(t=>{this.ah.add((null==t?void 0:t.event)||"")})}),null!=(i=this._instance)&&i.autocapture)){var r=new Set;this.oh.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.oh.clear(),this.ah.clear(),this.register(t)}on(t,e){null!=e&&0!=t.length&&(this.ah.has(t)||this.ah.has(e.event))&&this.oh.forEach(t=>{this.yh(e,t)&&this.uh.emit("actionCaptured",t.name)})}bh(t){this.onAction("actionCaptured",e=>t(e))}yh(t,e){if(null==(null==e?void 0:e.steps))return!1;for(var i of e.steps)if(this.hh(t,i))return!0;return!1}onAction(t,e){return this.uh.on(t,e)}fh(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(!Cw(r,e.url,e.url_matching||"contains"))return!1}return!0}ph(t,e){return!!this._h(t,e)&&!!this.wh(t,e)&&!!this.kh(t,e)}_h(t,e){var i;if(null==e||!e.href)return!0;var r=this.Sh(t);if(r.length>0)return r.some(t=>Cw(t.href,e.href,e.href_matching||"exact"));var n,s=(null==t||null==(i=t.properties)?void 0:i.$elements_chain)||"";return!!s&&Cw((n=s.match(/(?::|")href="(.*?)"/))?n[1]:"",e.href,e.href_matching||"exact")}wh(t,e){var i;if(null==e||!e.text)return!0;var r=this.Sh(t);if(r.length>0)return r.some(t=>Cw(t.text,e.text,e.text_matching||"exact")||Cw(t.$el_text,e.text,e.text_matching||"exact"));var n,s,o,a=(null==t||null==(i=t.properties)?void 0:i.$elements_chain)||"";return!!a&&(n=function(t){for(var e,i=[],r=/(?::|")text="(.*?)"/g;!Pe(e=r.exec(t));)i.includes(e[1])||i.push(e[1]);return i}(a),s=e.text,o=e.text_matching||"exact",n.some(t=>Cw(t,s,o)))}kh(t,e){var i,r;if(null==e||!e.selector)return!0;if(null!=t&&null!=(i=t.properties)&&null!=(i=i.$element_selectors)&&i.includes(e.selector))return!0;var n=(null==t||null==(r=t.properties)?void 0:r.$elements_chain)||"";if(e.selector_regex&&n)try{return new RegExp(e.selector_regex).test(n)}catch(t){return!1}return!1}Sh(t){var e;return null==(null==t||null==(e=t.properties)?void 0:e.$elements)?[]:null==t?void 0:t.properties.$elements}gh(t,e){return null==e||!e.properties||0===e.properties.length||ba(e.properties.reduce((t,e)=>{var i=xe(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)}},Mw=class{constructor(t){var e;this.xh=[],this._instance=t,this.Ch=new Map,this.Th=new Map,this.Mh=new Map,this.Ih=null==(e=this._instance)||null==e.onSessionId?void 0:e.onSessionId(t=>this.Eh(t))}Rh(t){return!1}Ah(){return null}Ph(t){}Fh(){}Oh(t,e){return!!t&&ba(t.propertyFilters,null==e?void 0:e.properties)}$h(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}Dh(t,e,i){var r=(i===lf?this.Ch:this.Th).get(t),n=[];return this.Lh(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.Oh(s,e)})}register(t){this.Nh(t,!1)}replace(t){this.Nh(t,!0)}Nh(t,e){var i;Ie(null==(i=this._instance)?void 0:i._addCaptureHook)||(this.qh(t,e),this.jh(t,e))}jh(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.Mh.clear(),0!==i.length){this.Bh||(this.Bh=new Tw(this._instance),this.Bh.init(),this.Bh.bh(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.Mh.get(e.name))&&void 0!==i?i:[];n.includes(t.id)||n.push(t.id),this.Mh.set(e.name,n)}})}),e?this.Bh.replace(r):this.Bh.register(r)}else{var n;e&&(null==(n=this.Bh)||n.replace([]))}}Hh(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)})}qh(t,e){var i,r,n=t.filter(t=>{var e,i;return(null==(e=t.conditions)?void 0:e.events)&&(null==(i=t.conditions)||null==(i=i.events)||null==(i=i.values)?void 0:i.length)>0}),s=t.filter(t=>{var e,i;return(null==(e=t.conditions)?void 0:e.cancelEvents)&&(null==(i=t.conditions)||null==(i=i.cancelEvents)||null==(i=i.values)?void 0:i.length)>0}),o=this.$h(t,lf),a=this.$h(t,uf);e?(this.Ch=o,this.Th=a):(this.Hh(this.Ch,o),this.Hh(this.Th,a)),(0!==n.length||0!==s.length)&&(null!==(i=this.mh)&&void 0!==i||(this.mh=null==(r=this._instance)?void 0:r._addCaptureHook((t,e)=>{this.onEvent(t,e)})))}onEvent(t,e){var i,r,n=this.zh(),s=(null==e||null==(i=e.properties)?void 0:i.$survey_id)||(null==e||null==(r=e.properties)?void 0:r.$product_tour_id);if(s&&this.getActivatedIds().includes(s)){var o=this.Uh(t,s);if("consume"===o)return n.info("event consumed activated item, removing it",{event:t,itemId:s}),void this.Wh([s]);if("persist"===o)return n.info("shown item promoted to persisted activation",{event:t,itemId:s}),this.Vh(s),void this.Gh([s])}if(this.Th.has(t)){var a=this.Dh(t,e,uf);a.length>0&&(n.info("cancel event matched, cancelling items",{event:t,itemsToCancel:a.map(t=>t.id)}),this.Wh(a.map(t=>t.id)),a.forEach(t=>this.Zh(t.id)))}if(this.Ch.has(t)){n.info("event name matched",{event:t,eventPayload:e,items:this.Ch.get(t)});var l=this.Dh(t,e,lf);this.Jh(l.map(t=>t.id))}}onAction(t){this.Mh.has(t)&&this.Jh(this.Mh.get(t)||[])}Jh(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.Rh(n)?this.Vh(n)&&this.Qh(n):r.push(n);r.length>0&&(this.xh=[...new Set([...this.xh,...r])]),this.zh().info("updating activated items",{activatedItems:this.getActivatedIds()})}}Vh(t){this.xh=this.xh.filter(e=>e!==t);var e=this.Kh();return!e.includes(t)&&(this.Xh([...e,t]),this.Yh(),!0)}Wh(t){var e=new Set(t);this.xh=this.xh.filter(t=>!e.has(t));var i=this.td(),r=i.filter(t=>!e.has(t));r.length!==i.length&&(this.Xh(r),0===r.length&&this.ed()),this.Gh(t)}rd(){var t,e=this.Ah();if(!e)return{};var i=null==(t=this._instance)||null==(t=t.persistence)?void 0:t.props[e];return i&&"object"==typeof i?i:{}}Qh(t){if(this.Ah()){var e=this.rd();this.Ph(n({},e,{[t]:Date.now()}))}}Gh(t){if(this.Ah()){var e=this.rd(),i={},r=!1;for(var n of Object.entries(e)){var s=n[0],o=n[1];t.includes(s)?r=!0:i[s]=o}r&&(Me(i)?this.Fh():this.Ph(i))}}nd(){this.Ah()&&this.Fh()}getActivationTimestamp(t){if(this.Kh().includes(t)){var e=this.rd()[t];return Fe(e)?e:void 0}}td(){var t,e=this.sd();return(null==(t=this._instance)||null==(t=t.persistence)?void 0:t.props[e])||[]}Kh(){var t,e,i=this.td();if(0===i.length)return[];var r=null==(t=this._instance)||null==(t=t.persistence)?void 0:t.props[this.od()],n=null==(e=this._instance)||null==e.get_session_id?void 0:e.get_session_id();return n&&r===n?i:[]}Yh(){var t,e=null==(t=this._instance)||null==t.get_session_id?void 0:t.get_session_id();e&&this.ad(e)}ed(){this.ld()}Eh(t){var e,i=null==(e=this._instance)||null==(e=e.persistence)?void 0:e.props[this.od()];if(i&&i!==t){var r=this.td(),n=this.rd();r.length>0&&(this.Xh([]),r.filter(t=>Fe(n[t])).forEach(t=>this.Zh(t))),this.ed(),this.nd()}}getActivatedIds(){return[...new Set([...this.Kh(),...this.xh])].filter(t=>!this.ud(t))}dispose(){var t,e,i;null==(t=this.Ih)||t.call(this),this.Ih=void 0,null==(e=this.mh)||e.call(this),this.mh=void 0,null==(i=this.Bh)||i.dispose(),this.Bh=void 0}reset(){this.xh=[],this.td().length>0&&this.Xh([]),this.ed(),this.nd()}getEventToItemsMap(){return this.Ch}hd(){return this.Bh}},Iw=class extends Mw{constructor(t){super(t)}sd(){return mt}od(){return yt}Ah(){return bt}Ph(t){var e;null==(e=this._instance)||null==(e=e.persistence)||e.register({[bt]:t})}Fh(){var t;null==(t=this._instance)||null==(t=t.persistence)||t.unregister(bt)}Rh(t){var e,i;this.Lh(e=>{i=e.find(e=>e.id===t)});var r=null==(e=i)||null==(e=e.appearance)?void 0:e.surveyPopupDelaySeconds;return Fe(r)&&r>0}dd(){return xf}Lh(t){var e;null==(e=this._instance)||e.getSurveys(t)}Zh(t){var e;null==(e=this._instance)||e.cancelPendingSurvey(t)}zh(){return Nf}Xh(t){var e;null==(e=this._instance)||null==(e=e.persistence)||e.register({[mt]:t})}ad(t){var e;null==(e=this._instance)||null==(e=e.persistence)||e.register({[yt]:t})}ld(){var t;null==(t=this._instance)||null==(t=t.persistence)||t.unregister(yt)}ud(){return!1}Uh(t,e){var i;return this.Lh(t=>{i=t.find(t=>t.id===e)}),!i||pa(i)?t===xf?"consume":"ignore":t===xf?"persist":t===Cf||t===Tf?"consume":"ignore"}getSurveys(){return this.getActivatedIds()}getEventToSurveys(){return this.getEventToItemsMap()}},Ew=class{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);Ie(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)}},Rw=class{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==b?void 0:b.__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 Iw(this._instance)}},Aw=null!=a&&a.location?Un(a.location.hash,"__posthog")||Un(location.hash,"state"):null,Pw="_postHogToolbarParams",Fw=Cn("[Toolbar]"),Ow=Cn("[FeatureFlags]"),$w=class{constructor(t,e){void 0===e&&(e=!1),this.vd=!1,this.update(t,e)}update(t,e){this.fd=((t,e)=>{var i,r,n,s,o;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!==(o=t.evaluation_contexts)&&void 0!==o?o:t.evaluation_environments)&&void 0!==s?s:[],flagKeys:xe(t.flag_keys)?t.flag_keys:void 0}})(t,e),!t.evaluation_environments||t.evaluation_contexts||this.vd||(Ow.warn("evaluation_environments is deprecated. Use evaluation_contexts instead. evaluation_environments will be removed in a future version."),this.vd=!0),Ie(t.flag_keys)||xe(t.flag_keys)||Ow.error("Invalid flag_keys found:",t.flag_keys,"Expected array of non-empty strings")}get(){return this.fd}},Dw=Cn("[FeatureFlags]"),Lw=Cn("[FeatureFlags]",{debugEnabled:!0}),Nw="\" failed. Feature flags didn't load in time.",qw="connection_error",jw=t=>{for(var e={},i=0;t.length>i;i++)e[t[i]]=!0;return e},Bw=t=>{var e={};for(var i of En(t||{})){var r=i[1];r&&(e[i[0]]=r)}return e},Hw="Refusing to render web experiment since the viewer is a likely bot",zw={icontains:(t,e)=>e.toLowerCase().indexOf(t.toLowerCase())>-1,not_icontains:(t,e)=>-1===e.toLowerCase().indexOf(t.toLowerCase()),regex:(t,e)=>ga(e,t),not_regex:(t,e)=>!ga(e,t),exact:(t,e)=>e===t,is_not:(t,e)=>e!==t},Uw=Cn("[Conversations]"),Ww="Conversations not available yet.";function Vw(t,e){var i,r,s,o,a,l,h,d=null!==(i=null==t?void 0:t.flushIntervalMs)&&void 0!==i?i:3e3,v=null!==(r=null==t?void 0:t.maxBufferSize)&&void 0!==r?r:100,c=null!=e&&e.consoleCapture?void 0:null!==(s=null==t?void 0:t.maxLogsPerInterval)&&void 0!==s?s:1e3,f=Ie(c)?Math.max(v,2048):Math.max(v,c),p=n({},function(){var t="",e="";try{var i=null==u?void 0:u.userAgent;if(i){var r=Gi(i);t=r[0],e=r[1]}}catch(t){}return function(t,e){var i=function(t){if(t)return{}.hasOwnProperty.call(ln,t)?ln[t]:t}(t);return n({},i?{"os.name":i}:{},e?{"os.version":e}:{})}(t,e)}(),null==t?void 0:t.resourceAttributes);return{serviceName:null!==(o=null!==(a=null==p?void 0:p["service.name"])&&void 0!==a?a:null==t?void 0:t.serviceName)&&void 0!==o?o:null==e?void 0:e.serviceNameDefault,serviceVersion:null!==(l=null==p?void 0:p["service.version"])&&void 0!==l?l:null==t?void 0:t.serviceVersion,environment:null!==(h=null==p?void 0:p["deployment.environment"])&&void 0!==h?h:null==t?void 0:t.environment,resourceAttributes:p,beforeSend:null==t?void 0:t.beforeSend,flushIntervalMs:d,maxBufferSize:v,maxQueueSize:f,maxBatchRecordsPerPost:100,rateCapWindowMs:d,maxLogsPerInterval:c,backgroundFlushBudgetMs:0,terminationFlushBudgetMs:0}}var Gw=["debug","log","warn","error","info"],Zw="console",Jw="__posthogHandledLogsRequestError",Qw=(t,e)=>{var i=t instanceof Error?t:new Error(e);return i[Jw]=!0,i},Kw=t=>!!t&&"object"==typeof t&&!0===t[Jw],Xw={featureFlags:class{constructor(t){this.name="featureFlags",this.pd=!1,this.featureFlagEventHandlers=[],this.A=Dw,this.gd={},this.md={},this.yd=[],this.bd=!1,this._d=!1,this.wd=0,this.kd=!1,this.Sd=!1,this.xd=!1,this.Cd=!1,this.Td=0,this.Ve=()=>{var t=this.Md();this.Td=0,t&&this.reloadFeatureFlags()},this.Id=()=>{var t,e=this.Ed;Ie(e)||this._n.remoteRequestsDisabled||!h||"hidden"===h.visibilityState||Date.now()-(null!==(t=this.Rd)&&void 0!==t?t:0)<e||(this.reloadFeatureFlags(),this.Ad())},this.Ze=()=>{"visible"===(null==h?void 0:h.visibilityState)&&this.Id()},"get"in t?this.Us=t:(this._instance=t,this.Pd=new $w(t.config,t.Ma()),this.Us=this.Pd)}updateConfig(t,e){var i;null==(i=this.Pd)||i.update(t,e),this.Hs&&this.Fd()}setup(t){return this.Zu=t,this.A=t.logger.createLogger("[FeatureFlags]"),ww(t.kv.initialize(),()=>{this.Zu===t&&(this.Zu=void 0,this.Hs=t,this.Od(t))})}Od(t){var e;if(this.Hs===t)return a&&Dn(a,"online",this.Ve),this.Fd(),this.$d=t.registerDynamicEventProperties(()=>this.Dd()?this.gd:this.md),this.Ld=null==(e=this._instance)||null==(e=e.persistence)?void 0:e.onCrossTabFeatureFlagChange(()=>{this.Nd(),this.qd(),this.jd()}),this.qd(),this.initialize()}Fd(){var t=this._n.refreshIntervalMs,e=!this._n.remoteRequestsDisabled&&h&&!Ie(t)&&t>0?t:void 0;e!==this.Ed&&(this.Bd(),Ie(e)||(this.Ed=e,this.Ad(),null!=h&&h.addEventListener&&Dn(h,re,this.Ze)))}Ad(){Ie(this.Ed)||(Ie(this.Hd)||clearInterval(this.Hd),this.Rd=Date.now(),this.Hd=setInterval(this.Id,this.Ed))}Bd(){Ie(this.Hd)||(clearInterval(this.Hd),this.Hd=void 0,null==h||null==h.removeEventListener||h.removeEventListener(re,this.Ze)),this.Ed=void 0,this.Rd=void 0}destroy(){this.zd()}dispose(){this.zd()}zd(){var t,e;this.Bd(),this.wd++,this.Sd=!1,this.Zu=void 0,this.Hs&&(this.Ud(),null==(t=this.$d)||t.dispose(),this.$d=void 0,null==(e=this.Ld)||e.call(this),this.Ld=void 0,this.yd=[],null==a||a.removeEventListener("online",this.Ve),this.Hs=void 0)}get _n(){return this.Us.get()}Wd(t){var e;return this.Vd&&t in this.Vd?this.Vd[t]:null==(e=this.Hs)?void 0:e.kv.get(t)}Nd(){return!!this.Vd&&(this.Vd=void 0,!0)}Gd(){var t;return!Ie(null==(t=this.Hs)?void 0:t.kv.get("$enabled_feature_flags"))&&this.Nd()}ui(t){this.Zd(()=>{var e;return null==(e=this.Hs)?void 0:e.kv.set(t)})}Jd(t,e,i){var r;if(null!=(r=this._instance)&&r.persistence&&t.$enabled_feature_flags){var n=this.Wd("$enabled_feature_flags")||{},s=t.$enabled_feature_flags||{},o=e.flags||e.featureFlags,a=e.flags?Object.entries(e.flags).filter(t=>{var e=t[1];return!(null!=e&&e.failed)}).map(t=>t[0]):[],l=!!e.errorsWhileComputingFlags&&!!e.flags,u=l?a:i&&!xe(o)?Object.keys(o||{}):Array.from(new Set([...Object.keys(n),...Object.keys(s)])),h=this.Wd("$feature_flag_payloads")||{},d=t.$feature_flag_payloads||{},v=l||i?u:Array.from(new Set([...Object.keys(h),...Object.keys(d)])),c=!l&&!i,f=!!c||u,p=!!c||v,g={[nt]:f,[rt]:f,[at]:p};for(var m of(t.$feature_flag_details&&(g[ot]=f),[lt,Rt,ut]))Ie(t[m])||(g[m]=!0);this._instance.persistence.markCrossTabFeatureFlagChanges(g)}}hi(t){this.Zd(()=>{var e;return null==(e=this.Hs)?void 0:e.kv.remove(t)})}Zd(t){try{t()}catch(t){this.A.error("Failed to update feature flag persistence",t)}}qd(){var t={};for(var e of[nt,at,lt,ht]){var i=this.Wd(e);Ie(i)||(t[e]=i)}this.gd=t;var r=n({},t),s=this.Wd(rt);if(s)for(var o of Object.entries(s))r["$feature/"+o[0]]=o[1];this.md=r}Dd(){var t=this._n.cacheTtlMs;if(!t||0>=t)return!1;var e=this.Wd(Rt);return"number"!=typeof e||Date.now()-e>t}Qd(){return!!this.Dd()&&(this.Cd||this._d||(this.Cd=!0,this.A.warn("Feature flag cache is stale, triggering refresh..."),this.reloadFeatureFlags()),!0)}Kd(){var t=this._n.evaluationContexts;return null!=t&&t.length?t.filter(t=>{var e=t&&"string"==typeof t&&t.trim().length>0;return e||this.A.error("Invalid evaluation context found:",t,"Expected non-empty string"),e}):[]}Xd(){var t=this._n.flagKeys;if(!Ie(t))return t.filter(t=>{var e=t&&"string"==typeof t&&t.trim().length>0;return e||this.A.error("Invalid flag key found:",t,"Expected non-empty string"),e})}initialize(){var t,e,i=this._n,r=null!==(t=null==(e=i.bootstrap)?void 0:e.featureFlags)&&void 0!==t?t:{};if(Object.keys(r).length){var n,s,o=null!==(n=null==(s=i.bootstrap)?void 0:s.featureFlagPayloads)&&void 0!==n?n:{},a=Object.keys(r).filter(t=>!Ie(r[t])).reduce((t,e)=>(t[e]=r[e],t),{}),l=Object.keys(o).filter(t=>a[t]).reduce((t,e)=>(t[e]=o[e],t),{});return this.Yd({featureFlags:a,featureFlagPayloads:l},void 0,{persist:!1})}}updateFlags(t,e,i){var r,s,o=null!=i&&i.merge&&null!==(r=this.Wd("$enabled_feature_flags"))&&void 0!==r?r:{},a=null!=i&&i.merge&&null!==(s=this.Wd("$feature_flag_payloads"))&&void 0!==s?s:{},l=n({},o,t),u=n({},a,e),h={};for(var d of Object.entries(l)){var v=d[0],c=d[1];h[v]={key:v,enabled:Hr(c),variant:zr(c),reason:void 0,metadata:Ie(null==u?void 0:u[v])?void 0:{id:0,version:void 0,description:void 0,payload:u[v]}}}this.Yd({flags:h})}get hasLoadedFlags(){return this.bd}getFlags(){return Object.keys(this.getFlagVariants())}getFlagsWithDetails(){var t=this.Wd(ot),e=this.Wd(ht),i=this.Wd(dt);if(!i&&!e)return t||{};var r=In({},t||{});for(var s of[...new Set([...Object.keys(i||{}),...Object.keys(e||{})])]){var o,a,l=r[s],u=null==e?void 0:e[s],h=Ie(u)?null!==(o=null==l?void 0:l.enabled)&&void 0!==o&&o:!!u,d=Ie(u)?null==l?void 0:l.variant:"string"==typeof u?u:void 0,v=null==i?void 0:i[s],c=n({},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=n({},null==l?void 0:l.metadata,{payload:v,original_payload:null==l||null==(a=l.metadata)?void 0:a.payload})),r[s]=c}return this.pd||(this.A.warn(" Overriding feature flag details!",{flagDetails:t,overriddenPayloads:i,finalDetails:r}),this.pd=!0),r}getAllFeatureFlags(){var t=this.getFlagVariants(),e=this.getFlagPayloads();return Object.keys(t).map(i=>{var r=t[i];return{key:i,enabled:Hr(r),variant:zr(r),payload:Br(e[i])}})}getFlagVariants(){var t=this.Wd(rt),e=this.Wd(ht);if(!e)return t||{};for(var i=In({},t||{}),r=Object.keys(e),n=0;r.length>n;n++)i[r[n]]=e[r[n]];return this.pd||(this.A.warn(" Overriding feature flags!",{enabledFlags:t,overriddenFlags:e,finalFlags:i}),this.pd=!0),i}getFlagPayloads(){var t=this.Wd(at),e=this.Wd(dt);if(!e)return t||{};for(var i=In({},t||{}),r=Object.keys(e),n=0;r.length>n;n++)i[r[n]]=e[r[n]];return this.pd||(this.A.warn(" Overriding feature flag payloads!",{flagPayloads:t,overriddenPayloads:e,finalPayloads:i}),this.pd=!0),i}reloadFeatureFlags(){this.kd||this._n.featureFlagsDisabled||this.Md()||(this._d&&(this.Sd=!0),this.tv||(this.yd.slice().forEach(t=>{try{t()}catch(t){this.A.error("Error while running feature flags reloading callback",t)}}),this.tv=setTimeout(()=>{this.ev()},5)))}Ud(){clearTimeout(this.tv),this.tv=void 0}onReloading(t){return this.yd.push(t),()=>{this.yd=this.yd.filter(e=>e!==t)}}ensureFlagsLoaded(){this.bd||this._d||this.tv||this.reloadFeatureFlags()}setAnonymousDistinctId(t){this.$anon_distinct_id=t}setReloadingPaused(t){this.kd=t}resetFlagCallReported(){this.hi(Mt)}ev(t){this.Ud();var e=this.Hs;if(e&&!this._n.remoteRequestsDisabled&&!this.Md())if(this._d)this.Sd=!0;else{var i={token:e.projectToken,distinct_id:e.distinctId,groups:e.groups,$anon_distinct_id:this.$anon_distinct_id,person_properties:n({},e.initialPersonProperties,this.Wd("$stored_person_properties")||{},{$lib:e.library.name,$lib_version:e.library.version}),group_properties:this.Wd(ct),timezone:Ba()};Ie(e.deviceId)||(i.$device_id=e.deviceId),(null!=t&&t.disableFlags||this._n.featureFlagsDisabled)&&(i.disable_flags=!0);var r=this.Kd();r.length&&(i.evaluation_contexts=r);var s=this.Xd();Ie(s)||(i.flag_keys=s);var o=this._n.onlyEvaluateSurveyFeatureFlags,a="/flags/?v=2"+(o?"&only_evaluate_survey_feature_flags=true":""),l=this.wd;this._d=!0;var u=()=>{this.Sd&&(this.Sd=!1,this.ev())},h=t=>{this._d=!1,l===this.wd?(this.ui({[Et]:[qw]}),this.A.error("Feature flag request failed",t),this.Gd()&&this.jd(!0),u()):u()};try{e.sendRequest(a,{target:"flags",method:"POST",body:i,compression:this._n.compression,sentAt:"body",timeoutMs:this._n.requestTimeoutMs}).then(t=>{var e,r,n=null!==(e=t.json)&&void 0!==e?e:{},s=200!==t.statusCode;if(this._d=!1,l===this.wd){if(this.iv(t.statusCode),s||this.Sd||(this.$anon_distinct_id=void 0),!i.disable_flags||this.Sd){this.xd=!s;var a=[];t.error?a.push(t.error instanceof Error&&"AbortError"===t.error.name?"timeout":t.error instanceof Error?qw:"unknown_error"):200!==t.statusCode&&a.push("api_error_"+t.statusCode),n.errorsWhileComputingFlags&&a.push("errors_while_computing_flags");var h=!(null==(r=n.quotaLimited)||!r.includes("feature_flags"));h&&a.push("quota_limited"),this.ui({[Et]:a}),h?this.A.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.Yd(n,s,{partialResponse:o}),u()}}else u()}).catch(h)}catch(t){h(t)}}}Md(){return Wn(this.Td,3)}iv(t){this.Td=Vn(t,this.Td,3,()=>this.A.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.xd)if(this.bd||this.getFlags()&&this.getFlags().length>0){if(!this.Qd()){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.A.warn('getFeatureFlag for key "'+t+Nw)}getFeatureFlagDetails(t){return this.getFlagsWithDetails()[t]}getFeatureFlagPayload(t){var e;return null==(e=this.getFeatureFlagResult(t,{send_event:!1}))?void 0:e.payload}getFeatureFlagResult(t,e){if(void 0===e&&(e={}),!e.fresh||this.xd)if(this.bd||this.getFlags()&&this.getFlags().length>0){if(!this.Qd()){var i,r=this.getFlagVariants(),s=t in r,o=r[t],a=this.getFlagPayloads()[t],l=String(o),u=this.Wd("$feature_flag_request_id")||void 0,h=this.Wd("$feature_flag_evaluated_at")||void 0,d=this.Wd("$flag_call_reported")||{};if(this._n.deduplicateCallsPerSession){var v,c=null==(v=this.Hs)?void 0:v.session.sessionId,f=this.Wd(It);c&&c!==f&&(d={},i=c)}if(e.send_event||!("send_event"in e))if(t in d&&d[t].includes(l))i&&this.ui({[Mt]:d,[It]:i});else{var p,g,m,y,b,_,w,k,S,x,C,T,M;xe(d[t])?d[t].push(l):d[t]=[l],this.ui(n({[Mt]:d},i?{[It]:i}:{}));var I=this.getFeatureFlagDetails(t),E=[...null!==(p=this.Wd("$feature_flag_errors"))&&void 0!==p?p:[]];Ie(o)&&E.push("flag_missing");var R={$feature_flag:t,$feature_flag_response:o,$feature_flag_payload:null!=a?a:null,$feature_flag_request_id:u,$feature_flag_evaluated_at:h,$feature_flag_bootstrapped_response:null!==(g=null==(m=this._n.bootstrap)||null==(m=m.featureFlags)?void 0:m[t])&&void 0!==g?g:null,$feature_flag_bootstrapped_payload:null!==(y=null==(b=this._n.bootstrap)||null==(b=b.featureFlagPayloads)?void 0:b[t])&&void 0!==y?y:null,$used_bootstrap_value:!this.xd};Ie(null==I||null==(_=I.metadata)?void 0:_.has_experiment)||(R.$feature_flag_has_experiment=I.metadata.has_experiment),Ie(null==I||null==(w=I.metadata)?void 0:w.version)||(R.$feature_flag_version=I.metadata.version);var A=null!==(k=null==I||null==(S=I.reason)?void 0:S.description)&&void 0!==k?k:null==I||null==(x=I.reason)?void 0:x.code;A&&(R.$feature_flag_reason=A),null!=I&&null!=(C=I.metadata)&&C.id&&(R.$feature_flag_id=I.metadata.id),Ie(null==I?void 0:I.original_variant)&&Ie(null==I?void 0:I.original_enabled)||(R.$feature_flag_original_response=Ie(I.original_variant)?I.original_enabled:I.original_variant),null!=I&&null!=(T=I.metadata)&&T.original_payload&&(R.$feature_flag_original_payload=null==I||null==(M=I.metadata)?void 0:M.original_payload),E.length&&(R.$feature_flag_error=E.join(",")),this.rv(R)}else i&&this.ui({[Mt]:d,[It]:i});if(s)return{key:t,enabled:!!o,variant:"string"==typeof o?o:void 0,payload:Br(a)}}}else this.A.warn('getFeatureFlagResult for key "'+t+Nw)}rv(t){try{var e;null==(e=this.Hs)||e.capture("$feature_flag_called",t).catch(t=>{this.A.error("Failed to capture feature flag call",t)})}catch(t){this.A.error("Failed to capture feature flag call",t)}}getRemoteConfigPayload(t,e){this.nv(t,e)}nv(t,e){var i=this;return o(function*(){var r=i.Hs;if(r){var n={distinct_id:r.distinctId,token:r.projectToken,person_properties:{$lib:r.library.name,$lib_version:r.library.version}},s=i.Kd();s.length&&(n.evaluation_contexts=s);var o,a=i.Xd();Ie(a)||(n.flag_keys=a);try{var l;o=(null==(l=(yield r.sendRequest("/flags/?v=2",{target:"flags",method:"POST",body:n,compression:i._n.compression,sentAt:"body",timeoutMs:i._n.requestTimeoutMs})).json)||null==(l=l.featureFlagPayloads)?void 0:l[t])||void 0}catch(t){return void i.A.error("Remote config feature flag request failed",t)}try{e(o)}catch(t){i.A.error("Remote config feature flag callback failed",t)}}})()}isFeatureEnabled(t,e){if(void 0===e&&(e={}),e.fresh&&!this.xd)return e.defaultValue;if(!(this.bd||this.getFlags()&&this.getFlags().length>0))return this.A.warn('isFeatureEnabled for key "'+t+Nw),e.defaultValue;var i=this.getFeatureFlag(t,e);return Ie(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.Yd(t,e,i)}Yd(t,e,i){if(this.Hs){this.bd=!0;var r=function(t,e,i,r,s,o){void 0===e&&(e={}),void 0===i&&(i={}),void 0===r&&(r={}),void 0===o&&(o=Dw);var a=((t,e)=>{var i=t.flags;return i?n({},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!Ie(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,o),l=a.flags,u=a.featureFlags,h=a.featureFlagPayloads;if(u){var d=t.requestId,v=t.evaluatedAt;if(xe(u)){o.warn("v1 of the feature flags endpoint is deprecated. Please use the latest version.");var c={};if(u)for(var f=0;u.length>f;f++)c[u[f]]=!0;return{[nt]:u,[rt]:c,[ut]:!1}}var p=u,g=h,m=l;if(null!=s&&s.partialResponse){var y=Object.keys(p),b=g||{};p=n({},e,p),g=n({},i,b),y.forEach(t=>{var e;t in b||null==(e=g)||delete e[t]}),m=n({},r,m)}else if(t.errorsWhileComputingFlags)if(l){var _=new Set(Object.keys(l).filter(t=>{var e;return!(null!=(e=l[t])&&e.failed)}));p=n({},e,Object.fromEntries(Object.entries(p).filter(t=>_.has(t[0]))));var w=Object.fromEntries(Object.entries(g||{}).filter(t=>_.has(t[0])));g=n({},i,w),_.forEach(t=>{var e;t in w||null==(e=g)||delete e[t]}),m=n({},r,Object.fromEntries(Object.entries(m||{}).filter(t=>_.has(t[0]))))}else p=n({},e,p),g=n({},i,g),m=n({},r,m);return n({[nt]:Object.keys(Bw(p)),[rt]:p||{},[at]:g||{},[ot]:m||{},[ut]:!0===t.minimalFlagCalledEvents},d?{[lt]:d}:{},v?{[Rt]:v}:{})}}(t,this.getFlagVariants(),this.getFlagPayloads(),this.getFlagsWithDetails(),i,this.A);if(r)if(!1===(null==i?void 0:i.persist)){var s=!Ie(this.Hs.kv.get(rt));this.Vd=r,s||this.ui(r)}else this.Nd(),this.Jd(r,t,!(null==i||!i.partialResponse)),this.ui(r);else e&&this.Gd();e||(this.Cd=!1),this.jd(e)}}override(t,e){void 0===e&&(e=!1),this.A.warn("override is deprecated. Please use overrideFeatureFlags instead."),this.overrideFeatureFlags({flags:t,suppressWarning:e})}overrideFeatureFlags(t){this.sv(t)}sv(t){if(this.Hs){if(!1===t)return this.hi([ht,dt]),this.jd(),void Lw.info("All overrides cleared");if(xe(t))return this.ui({[ht]:jw(t)}),this.jd(),void Lw.info("Flag overrides set",{flags:t});if(t&&"object"==typeof t&&("flags"in t||"payloads"in t)){var e,i=t;this.pd=Boolean(null!==(e=i.suppressWarning)&&void 0!==e&&e);var r={},n=i.flags,s=i.payloads;return n&&(r[ht]=xe(n)?jw(n):n),s&&(r[dt]=s),Object.keys(r).length&&this.ui(r),!1===n&&!1===s?this.hi([ht,dt]):!1===n?this.hi(ht):!1===s&&this.hi(dt),this.jd(),!1===n?Lw.info("Flag overrides cleared"):n&&Lw.info("Flag overrides set",{flags:n}),void(!1===s?Lw.info("Payload overrides cleared"):s&&Lw.info("Payload overrides set",{payloads:s}))}if(t&&"object"==typeof t)return this.ui({[ht]:t}),this.jd(),void Lw.info("Flag overrides set",{flags:t});this.A.warn("Invalid overrideOptions provided to overrideFeatureFlags",{overrideOptions:t})}else this.A.warn("posthog.featureFlags.overrideFeatureFlags called before feature flags were ready")}onFeatureFlags(t){if(this.addFeatureFlagsHandler(t),this.bd){var e=this.ov(),i=e.flags,r=e.flagVariants;try{t(i,r)}catch(t){this.A.error("Error while running feature flags callback",t)}}return()=>this.removeFeatureFlagsHandler(t)}updateEarlyAccessFeatureEnrollment(t,e,i){var r,s=(this.Wd("$early_access_features")||[]).find(e=>e.flagKey===t),o={["$feature_enrollment/"+t]:e},a={$feature_flag:t,$feature_enrollment:e,$set:o};s&&(a.$early_access_feature_name=s.name),i&&(a.$feature_enrollment_stage=i);var l=n({},this.getFlagVariants(),{[t]:e});null==(r=this._instance)||null==(r=r.persistence)||r.markCrossTabFeatureFlagChanges({[nt]:[t],[rt]:[t],[vt]:Object.keys(o)}),this.ui({[nt]:Object.keys(Bw(l)),[rt]:l,[vt]:n({},this.Wd("$stored_person_properties")||{},o)}),this.jd();try{var u;null==(u=this.Hs)||u.capture("$feature_enrollment_update",a).catch(t=>{this.A.error("Failed to capture early access feature enrollment",t)})}catch(t){this.A.error("Failed to capture early access feature enrollment",t)}}getEarlyAccessFeatures(t,e,i){void 0===e&&(e=!1);var r=this.Wd(st);!r||e?this.av(t,i):t(r)}av(t,e){var i=this;return o(function*(){var r=i.Hs;if(r){var n,s=e?"&"+e.map(t=>"stage="+t).join("&"):"";try{var o=yield r.sendRequest("/api/early_access_features/?token="+r.projectToken+s,{target:"api",method:"GET",sentAt:"query"});if(!o.json)return;n=o.json.earlyAccessFeatures,i.ui({[st]:n})}catch(t){return void i.A.error("Early access feature request failed",t)}try{t(n)}catch(t){i.A.error("Early access feature callback failed",t)}}})()}ov(){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),{})}}jd(t){this.qd();var e=this.ov(),i=e.flags,r=e.flagVariants;this.featureFlagEventHandlers.forEach(e=>{try{e(i,r,{errorsLoading:t})}catch(t){this.A.error("Error while running feature flags callback",t)}})}setPersonPropertiesForFlags(t,e){void 0===e&&(e=!0),this.lv(t,e)}lv(t,e){void 0===e&&(e=!0);var i=this.Wd("$stored_person_properties")||{},r=(null==t?void 0:t.$set)||(null!=t&&t.$set_once?{}:t),s=null==t?void 0:t.$set_once,o={};if(s)for(var a in s)({}).hasOwnProperty.call(s,a)&&(a in i||(o[a]=s[a]));this.ui({[vt]:n({},i,o,r)}),e&&this.reloadFeatureFlags()}unsetPersonPropertiesForFlags(t,e){void 0===e&&(e=!0);var i=n({},this.Wd("$stored_person_properties")||{});t.forEach(t=>{delete i[t]}),this.ui({[vt]:i}),e&&this.reloadFeatureFlags()}resetPersonPropertiesForFlags(t){void 0===t&&(t=!0),this.hi(vt),t&&this.reloadFeatureFlags()}setGroupPropertiesForFlags(t,e){void 0===e&&(e=!0);var i=this.Wd("$stored_group_properties")||{},r=n({},i);for(var s of Object.keys(t))r[s]=n({},i[s],t[s]);this.ui({[ct]:r}),e&&this.reloadFeatureFlags()}resetGroupPropertiesForFlags(t){if(t){var e=this.Wd("$stored_group_properties")||{};this.ui({[ct]:n({},e,{[t]:{}})})}else this.hi(ct)}reset(){this.wd++,this.Sd=!1,this.gd={},this.md={},this.Vd=void 0,this.bd=!1,this.kd=!1,this.xd=!1,this.$anon_distinct_id=void 0,this.Ud(),this.pd=!1,this.Td=0}}},Yw={sessionRecording:class{get _n(){return this._instance.config}get Ya(){return this._instance.persistence}get started(){var t;return!(null==(t=this.uv)||!t.isStarted)}get status(){var t,e;return"awaiting_config"===this.hv||"missing_config"===this.hv?this.hv:null!==(t=null==(e=this.uv)?void 0:e.status)&&void 0!==t?t:this.hv}constructor(t){if(this._instance=t,this._forceAllowLocalhostNetworkCapture=!1,this.hv=Ws,this.dv=void 0,this.vv=!1,this.je=(()=>{var t;if(null==h||!h.visibilityState||"visible"===h.visibilityState)return!0;var e=null==a||null==(t=a.performance)||null==t.getEntriesByType?void 0:t.getEntriesByType("visibility-state");return!(null!=e&&e.length)||e.some(t=>"visible"===t.name)})(),this.Ze=()=>{var t;"visible"===(null==h?void 0:h.visibilityState)&&(this.je=!0,null==(t=this.uv)||null==t.setDocumentWasEverVisible||t.setDocumentWasEverVisible(!0))},!this._instance.sessionManager)throw fw.error("started without valid sessionManager"),new Error("[SessionRecording] started without valid sessionManager. This is a bug.");if("always"===this._n.cookieless_mode)throw new Error('[SessionRecording] cannot be used with cookieless_mode="always"');null!=h&&h.addEventListener&&Dn(h,"visibilitychange",this.Ze)}initialize(){this.startIfEnabledOrStop()}dispose(t){var e=(void 0===t?{}:t).discardBufferedEvents,i=void 0!==e&&e;this.vv=!0,null==h||null==h.removeEventListener||h.removeEventListener("visibilitychange",this.Ze),i?this.fv(!0):this.stopRecording()}get pv(){var t,e=!(null==(t=this._instance.get_property(j))||!t.enabled),i=!this._n.disable_session_recording,r=this._n.disable_session_recording||this._instance.consent.isOptedOut();return a&&e&&i&&!r}startIfEnabledOrStop(t){var e;if(!(this.vv||this.pv&&null!=(e=this.uv)&&e.isStarted)){var i=!Ie(Object.assign)&&!Ie(Array.from);this.pv&&i?(this.gv(t),fw.info("starting")):(this.hv=Ws,this.stopRecording())}}gv(t){var e,i;if(this.pv)if("awaiting_config"!==this.hv&&"missing_config"!==this.hv&&(this.hv=Qs),null!=b&&null!=(e=b.__PosthogExtensions__)&&null!=(e=e.rrweb)&&e.record&&null!=(i=b.__PosthogExtensions__)&&i.initSessionRecording)this.mv(t);else{var r,n=this._instance.sessionManager;null==(r=b.__PosthogExtensions__)||null==r.loadExternalDependency||r.loadExternalDependency(this._instance,this.yv,e=>{if(!this.vv&&this.pv&&this._instance.sessionManager===n)return e?(this._instance.register_for_session({[Ht]:!0}),fw.error("could not load recorder",e)):void this.mv(t);this.hv=Ws})}}stopRecording(){var t,e;null==(t=this.dv)||t.call(this),this.dv=void 0,null==(e=this.uv)||e.stop()}fv(t){var e,i;void 0===t&&(t=!1),null==(e=this.dv)||e.call(this),this.dv=void 0,null==(i=this.uv)||i.discard({discardProducerEvents:t})}bv(){var t,e;null==(t=this.Ya)||t.unregister(Z),null==(e=this.Ya)||e.unregister(H)}_v(t,e){if(Pe(t))return null;var i,r=Fe(t)?t:parseFloat(t);return"number"!=typeof(i=r)||!Number.isFinite(i)||0>i||i>1?(fw.warn(e+" must be between 0 and 1. Ignoring invalid value:",t),null):r}wv(t){if(this.Ya){var e,i,r=this.Ya,s=()=>{var e,i=!1===t.sessionRecording?void 0:t.sessionRecording,s=this._v(null==(e=this._n.session_recording)?void 0:e.sampleRate,"session_recording.sampleRate"),o=this._v(null==i?void 0:i.sampleRate,"remote config sampleRate"),a=null!=s?s:o;Pe(a)&&this.bv();var l=null==i?void 0:i.minimumDurationMilliseconds;r.register({[j]:n({cache_timestamp:Date.now(),enabled:!!i},i,{networkPayloadCapture:n({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:Ie(l)?null:l,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})})};s(),null==(e=this.dv)||e.call(this),this.dv=null==(i=this._instance.sessionManager)?void 0:i.onSessionId(s)}}onRemoteConfig(t){var e=t.ok?t.config:void 0;return e&&"sessionRecording"in e?!1===e.sessionRecording?(this.wv(e),void this.fv()):(this.wv(e),void this.startIfEnabledOrStop()):("awaiting_config"===this.hv&&(this.hv="missing_config",fw.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.uv)&&i.log?this.uv.log(t,e):fw.warn("log called before recorder was ready")}get yv(){var t;return(null==(t=this._instance)||null==(t=t.persistence)||null==(t=t.get_property("$session_recording_remote_config"))||null==(t=t.scriptConfig)?void 0:t.script)||"lazy-recorder"}Sv(){var t,e=this._instance.get_property(j);if(!e)return!1;try{t="object"==typeof e?e:JSON.parse(e)}catch(t){return fw.warn("persisted remote config for session recording is invalid and will be ignored",t),!1}return!Pe(t.cache_timestamp)&&36e5>=Date.now()-t.cache_timestamp}mv(t){var e,i,r;if(!this.vv&&this.pv&&this._instance.sessionManager){if(null==(e=b.__PosthogExtensions__)||!e.initSessionRecording)return fw.warn("Called on script loaded before session recording is available. This can be caused by adblockers."),void this._instance.register_for_session({[Ht]:!0});var n;if(this.uv||(this.uv=null==(n=b.__PosthogExtensions__)?void 0:n.initSessionRecording(this._instance,this.je),this.uv._forceAllowLocalhostNetworkCapture=this._forceAllowLocalhostNetworkCapture),!this.Sv()){if("missing_config"===this.hv||"awaiting_config"===this.hv)return;return this.hv="awaiting_config",fw.info("persisted remote config is stale, requesting fresh config before starting"),void new r_(this._instance).load()}this.hv=Qs,null==(i=(r=this.uv).setDocumentWasEverVisible)||i.call(r,this.je),this.uv.start(t)}else this.hv=Ws}onRRwebEmit(t){var e;null==(e=this.uv)||null==e.onRRwebEmit||e.onRRwebEmit(t)}overrideLinkedFlag(){var t,e;this.uv||null==(t=this.Ya)||t.register({[U]:!0}),null==(e=this.uv)||e.overrideLinkedFlag()}overrideSampling(){var t,e;this.uv||null==(t=this.Ya)||t.register({[z]:!0}),null==(e=this.uv)||e.overrideSampling()}overrideTrigger(t){var e,i;this.uv||null==(e=this.Ya)||e.register({["url"===t?W:V]:!0}),null==(i=this.uv)||i.overrideTrigger(t)}get sdkDebugProperties(){var t;return(null==(t=this.uv)?void 0:t.sdkDebugProperties)||{$recording_status:this.status}}tryAddCustomEvent(t,e){var i;return!(null==(i=this.uv)||!i.tryAddCustomEvent(t,e))}flushBeforeIdentityReset(){var t;null==(t=this.uv)||null==t.flushBeforeIdentityReset||t.flushBeforeIdentityReset()}}},tk={autocapture:class extends cb{constructor(t){super(new ow(t)),this.instance=t}},historyAutocapture:class{constructor(t){this._instance=t,this.xv=this.Cv()}initialize(){this.startIfEnabled()}get isEnabled(){var t=this.Tv();return!!(t.path||t.search||this.Mv(t))}startIfEnabled(){this.isEnabled&&(xn.info("History API monitoring enabled, starting..."),this.monitorHistoryChanges())}startIfEnabledOrStop(){this.stop(),this.xv=this.Cv(),this.startIfEnabled()}stop(){this.Iv&&this.Iv(),this.Iv=void 0,this.Ev&&this.Ev(),this.Ev=void 0,xn.info("History API monitoring stopped")}monitorHistoryChanges(){a&&a.history&&(this.Rv("pushState"),this.Rv("replaceState"),this.Av(),this.Mv()&&this.Pv())}Rv(t){var e;if(a&&(null==(e=a.history[t])||!e.__posthog_wrapped__)){var i=this;mv(a.history,t,e=>function(r,n,s){e.call(this,r,n,s),i.Fv(t)})}}Cv(){var t=null==a?void 0:a.location;if(null!=t&&t.pathname)return{pathname:t.pathname,search:t.search,hash:t.hash}}Tv(){var t=this._instance.config.capture_pageview;return"history_change"===t?{path:!0}:Te(t)?t:{}}Mv(t){return void 0===t&&(t=this.Tv()),!!t.hash&&!this._instance.config.disable_capture_url_hashes}Ov(t){var e=this.Tv(),i=this.xv;return!(!i||!(e.path&&t.pathname!==i.pathname||e.search&&t.search!==i.search||this.Mv(e)&&t.hash!==i.hash))}Fv(t){try{var e=this.Cv();if(!e)return;this.Ov(e)&&this._instance.capture(se,{navigation_type:t}),this.xv=e}catch(e){xn.error("Error capturing "+t+" pageview",e)}}Av(){if(!this.Iv){var t=()=>{this.Fv("popstate")};Dn(a,"popstate",t),this.Iv=()=>{a&&a.removeEventListener("popstate",t)}}}Pv(){if(!this.Ev){var t=()=>{this.Fv("hashchange")};Dn(a,"hashchange",t),this.Ev=()=>{a&&a.removeEventListener("hashchange",t)}}}},heatmaps:class{get _n(){return this.instance.config}constructor(t){var e;this.$v=!1,this.Ws=!1,this.Dv=null,this.instance=t,this.$v=!(null==(e=this.instance.persistence)||!e.props[R]),this.rageclicks=new ab(t.config.rageclick)}initialize(){this.startIfEnabled()}get flushIntervalMilliseconds(){var t=5e3;return Te(this._n.capture_heatmaps)&&this._n.capture_heatmaps.flush_interval_milliseconds&&(t=this._n.capture_heatmaps.flush_interval_milliseconds),t}get isEnabled(){return Pe(this._n.capture_heatmaps)?Pe(this._n.enable_heatmaps)?this.$v:this._n.enable_heatmaps:!1!==this._n.capture_heatmaps}startIfEnabled(){if(this.isEnabled){if(this.Ws)return;pw.info("starting..."),this.Lv(),this.Ze()}else{var t;clearInterval(null!==(t=this.Dv)&&void 0!==t?t:void 0),this.Nv(),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({[R]:i}),this.$v=i,this.startIfEnabled()}}}getAndClearBuffer(){var t=this.Pe;return this.Pe=void 0,t}qv(t){gw(t.originalEvent)&&this.an(t.originalEvent,"deadclick")}Ze(){this.Dv&&clearInterval(this.Dv),this.Dv=function(t){return"visible"===(null==t?void 0:t.visibilityState)}(h)?setInterval(this.za.bind(this),this.flushIntervalMilliseconds):null}Lv(){a&&h&&(this.jv=this.za.bind(this),Dn(a,ne,this.jv),this.Bv=t=>this.an(t||(null==a?void 0:a.event)),Dn(h,"click",this.Bv,{capture:!0}),this.Hv=t=>this.zv(t||(null==a?void 0:a.event)),Dn(h,"mousemove",this.Hv,{capture:!0}),this.Uv=new Pb(this.instance,Rb,this.qv.bind(this)),this.Uv.startIfEnabledOrStop(),this.Wv=this.Ze.bind(this),Dn(h,re,this.Wv),this.Ws=!0)}Nv(){var t;a&&h&&(this.jv&&a.removeEventListener(ne,this.jv),this.Bv&&h.removeEventListener("click",this.Bv,{capture:!0}),this.Hv&&h.removeEventListener("mousemove",this.Hv,{capture:!0}),this.Wv&&h.removeEventListener(re,this.Wv),clearTimeout(this.Vv),null==(t=this.Uv)||t.stop(),this.Ws=!1)}Gv(t,e){var i=this.instance.scrollManager.scrollY(),r=this.instance.scrollManager.scrollX(),n=this.instance.scrollManager.scrollElement(),s=function(t,e,i){for(var r=t;r&&Qn(r)&&!Kn(r,"body");){if(r===i)return!1;var n=void 0;try{var s,o,l;n=null==(s=null!==(o=null==(l=r.ownerDocument)?void 0:l.defaultView)&&void 0!==o?o:a)?void 0:s.getComputedStyle(r).position}catch(t){return!1}if(de(e,n))return!0;r=us(r)}return!1}(ss(t),["fixed","sticky"],n);return{x:t.clientX+(s?0:r),y:t.clientY+(s?0:i),target_fixed:s,type:e}}an(t,e){var i;if(void 0===e&&(e="click"),!Jn(t.target)&&gw(t)){var r=this.Gv(t,e);null!=(i=this.rageclicks)&&i.isRageClick(t.clientX,t.clientY,(new Date).getTime())&&ms(ss(t),this.instance.config.rageclick)&&this.Is(n({},r,{type:"rageclick"})),this.Is(r)}}zv(t){!Jn(t.target)&&gw(t)&&(clearTimeout(this.Vv),this.Vv=setTimeout(()=>{this.Is(this.Gv(t,"mousemove"))},500))}Is(t){if(a){var e=this._n.disable_capture_url_hashes?ar(a.location.href):a.location.href,i=this._n.custom_personal_data_properties,r=zn(e,this._n.mask_personal_data_properties?[...Ea,...i||[]]:[],Aa);this.Pe=this.Pe||{},this.Pe[r]||(this.Pe[r]=[]),this.Pe[r].push(t)}}za(){this.Pe&&!Me(this.Pe)&&this.instance.capture("$$heatmap",{$heatmap_data:this.getAndClearBuffer()})}},deadClicksAutocapture:Pb,webVitalsAutocapture:class{constructor(t){var e;this._instance=t,this.$v=!1,this.Ws=!1,this.Pe={navigationKey:void 0,url:void 0,metrics:[],firstMetricTimestamp:void 0},this.Zv=()=>{clearTimeout(this.Jv),this.Jv=void 0,0!==this.Pe.metrics.length&&(this._instance.capture("$web_vitals",n({$current_url:this.Pe.url},this.Pe.metrics.reduce((t,e)=>n({},t,{["$web_vitals_"+e.name+"_event"]:n({},e),["$web_vitals_"+e.name+"_value"]:e.value}),{}))),this.Pe={navigationKey:void 0,url:void 0,metrics:[],firstMetricTimestamp:void 0})},this.Qv=t=>{var e;if(this.Pe=this.Pe||{navigationKey:void 0,url:void 0,metrics:[],firstMetricTimestamp:void 0},Pe(null==t?void 0:t.name)||Pe(null==t?void 0:t.value))uw.error("Invalid metric received",t);else{var i="string"==typeof t.navigationURL?t.navigationURL:void 0,r=this.Kv(i);if(!Ie(r)){var s=Fe(t.navigationId)||"string"==typeof t.navigationId?"navigation:"+t.navigationId:"url:"+r;if(!this.Xv||this.Xv>t.value){this.Pe.navigationKey!==s&&(this.Zv(),this.Jv=setTimeout(this.Zv,this.flushToCaptureTimeoutMs)),Ie(this.Pe.navigationKey)&&(this.Pe.navigationKey=s,this.Pe.url=r),this.Pe.firstMetricTimestamp=Ie(this.Pe.firstMetricTimestamp)?Date.now():this.Pe.firstMetricTimestamp;var o=null==(e=this._instance.sessionManager)?void 0:e.checkAndGetSessionAndWindowId(!0),a=n({},t,i?{navigationURL:r}:{},{$current_url:r,timestamp:Date.now()});if(delete a.entries,Te(t.attribution)&&this.attributionMetrics.indexOf(t.name)>-1){var l={};for(var u of cw){var h="url"===u&&"string"==typeof t.attribution[u]?this.Kv(t.attribution[u]):t.attribution[u];Ie(h)||(l[u]=h)}a.attribution=l}else delete a.attribution;Ie(o)||(a.$session_id=o.sessionId,a.$window_id=o.windowId),this.Pe.metrics.push(a),this.Pe.metrics.length===this.allowedMetrics.length&&this.Zv()}else uw.error("Ignoring metric with value >= "+this.Xv,t)}}},this.Yv=()=>{if(!this.Ws){var t,e,i,r,s=!1,o=b.__PosthogExtensions__,a=null==o?void 0:o.postHogWebVitalsCallbacksByFlavor,l=(null==a?void 0:a[this.tc])||("web-vitals"===this.tc&&Ie(a)?null==o?void 0:o.postHogWebVitalsCallbacks:void 0);if(!Ie(l)){var u=l.withoutAttribution,h=this.attributionMetrics;s=!Ie(u),t=h.indexOf("LCP")>-1?l.onLCP:(null==u?void 0:u.onLCP)||l.onLCP,e=h.indexOf("CLS")>-1?l.onCLS:(null==u?void 0:u.onCLS)||l.onCLS,i=h.indexOf("FCP")>-1?l.onFCP:(null==u?void 0:u.onFCP)||l.onFCP,r=h.indexOf("INP")>-1?l.onINP:(null==u?void 0:u.onINP)||l.onINP}if(t&&e&&i&&r){var d={reportSoftNavs:this.useSoftNavs},v=s&&this.attributionMetrics.indexOf("INP")>-1?n({},d,{includeProcessedEventEntries:!1}):d;this.allowedMetrics.indexOf("LCP")>-1&&t(this.Qv.bind(this),d),this.allowedMetrics.indexOf("CLS")>-1&&e(this.Qv.bind(this),d),this.allowedMetrics.indexOf("FCP")>-1&&i(this.Qv.bind(this),d),this.allowedMetrics.indexOf("INP")>-1&&r(this.Qv.bind(this),v),this.Ws=!0}else uw.error("web vitals callbacks not loaded - not starting")}},this.$v=!(null==(e=this._instance.persistence)||!e.props[O]),this.startIfEnabled()}get ec(){return this._instance.config.capture_performance}get allowedMetrics(){var t,e,i=Te(this.ec)?null==(t=this.ec)?void 0:t.web_vitals_allowed_metrics:void 0;return Pe(i)?(null==(e=this._instance.persistence)?void 0:e.props.$web_vitals_allowed_metrics)||dw:i}get flushToCaptureTimeoutMs(){return(Te(this.ec)?this.ec.web_vitals_delayed_flush_ms:void 0)||5e3}get attributionMetrics(){var t=Te(this.ec)?this.ec.web_vitals_attribution:void 0;return $e(t)?t?dw:[]:xe(t)?t:vw}get useAttribution(){return this.attributionMetrics.length>0}get useSoftNavs(){var t;return null!==(t=Te(this.ec)?this.ec.__preview_web_vitals_soft_navs:void 0)&&void 0!==t&&t}get Xv(){var t=Te(this.ec)&&Fe(this.ec.__web_vitals_max_value)?this.ec.__web_vitals_max_value:hw;return t>0&&6e4>=t?hw:t}get isEnabled(){var t=null==d?void 0:d.protocol;if("http:"!==t&&"https:"!==t)return uw.info("Web Vitals are disabled on non-http/https protocols"),!1;var e=Te(this.ec)?this.ec.web_vitals:$e(this.ec)?this.ec:void 0;return $e(e)?e:this.$v}startIfEnabled(){this.isEnabled&&!this.Ws&&(uw.info("enabled, starting..."),this.do(this.Yv))}onRemoteConfig(t){if(t.ok){var e=t.config;if("capturePerformance"in e){var i=Te(e.capturePerformance)&&!!e.capturePerformance.web_vitals,r=Te(e.capturePerformance)?e.capturePerformance.web_vitals_allowed_metrics:void 0;this._instance.persistence&&(this._instance.persistence.register({[O]:i}),this._instance.persistence.register({[q]:r})),this.$v=i,this.startIfEnabled()}}}get tc(){return this.useSoftNavs?this.useAttribution?"web-vitals-with-attribution-soft-navs":"web-vitals-soft-navs":this.useAttribution?"web-vitals-with-attribution":"web-vitals"}do(t){var e=b.__PosthogExtensions__,i=this.tc,r=null==e?void 0:e.postHogWebVitalsCallbacksByFlavor;null!=r&&r[i]||"web-vitals"===i&&Ie(r)&&null!=e&&e.postHogWebVitalsCallbacks?t():null==e||null==e.loadExternalDependency||e.loadExternalDependency(this._instance,i,e=>{e?uw.error("failed to load script",e):t()})}Kv(t){var e=t||(null==a?void 0:a.location.href);if(e){var i=this._instance.config.disable_capture_url_hashes?ar(e):e,r=this._instance.config.custom_personal_data_properties;return zn(i,this._instance.config.mask_personal_data_properties?[...Ea,...r||[]]:[],Aa)}uw.error("Could not determine current URL")}}},ek={exceptionObserver:class{constructor(t){var e;this.Yv=()=>{var t;if(a&&this.isEnabled&&null!=(t=b.__PosthogExtensions__)&&t.errorWrappingFunctions){var e=b.__PosthogExtensions__.errorWrappingFunctions.wrapOnError,i=b.__PosthogExtensions__.errorWrappingFunctions.wrapUnhandledRejection,r=b.__PosthogExtensions__.errorWrappingFunctions.wrapConsoleError;try{!this.rc&&this._n.capture_unhandled_errors&&(this.rc=e(this.captureException.bind(this))),!this.nc&&this._n.capture_unhandled_rejections&&(this.nc=i(this.captureException.bind(this))),!this.sc&&this._n.capture_console_errors&&(this.sc=r(this.captureException.bind(this)))}catch(t){aw.error("failed to start",t),this.oc()}}},this._instance=t,this.ac=!(null==(e=this._instance.persistence)||!e.props[A]),this.wt=new Ze(n({},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,A:aw})),this._n=this.lc(),this.startIfEnabledOrStop()}lc(){var t=this._instance.config.capture_exceptions,e={capture_unhandled_errors:!1,capture_unhandled_rejections:!1,capture_console_errors:!1};return Te(t)?e=n({},e,t):(Ie(t)?this.ac:t)&&(e=n({},e,{capture_unhandled_errors:!0,capture_unhandled_rejections:!0})),e}get isEnabled(){return this._n.capture_console_errors||this._n.capture_unhandled_errors||this._n.capture_unhandled_rejections}startIfEnabledOrStop(){this.isEnabled?(aw.info("enabled"),this.oc(),this.do(this.Yv)):this.oc()}do(t){var e,i;null!=(e=b.__PosthogExtensions__)&&e.errorWrappingFunctions?t():null==(i=b.__PosthogExtensions__)||null==i.loadExternalDependency||i.loadExternalDependency(this._instance,"exception-autocapture",e=>{if(e)return aw.error("failed to load script",e);t()})}oc(){var t,e,i;null==(t=this.rc)||t.call(this),this.rc=void 0,null==(e=this.nc)||e.call(this),this.nc=void 0,null==(i=this.sc)||i.call(this),this.sc=void 0}onRemoteConfig(t){if(t.ok){var e=t.config;"autocaptureExceptions"in e&&(this.ac=!!e.autocaptureExceptions||!1,this._instance.persistence&&this._instance.persistence.register({[A]:this.ac}),this._n=this.lc(),this.startIfEnabledOrStop())}}onConfigChange(){this._n=this.lc()}captureException(t){try{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";if(this.wt.consumeRateLimit(n))return void aw.info("Skipping exception capture because of client rate limiting.",{exception:n});null==(r=this._instance.exceptions)||r.sendExceptionEvent(t)}catch(t){}}},exceptions:class{constructor(t){var e,i;this.uc=[],this.hc=nm(),this._instance=t,this.uc=null!==(e=null==(i=this._instance.persistence)?void 0:i.get_property("$error_tracking_suppression_rules"))&&void 0!==e?e:[],this.dc=Nr(this.vc()),this.cc=new qr(this.dc)}onConfigChange(){this.dc=Nr(this.vc()),this.cc.setConfig(this.dc)}onRemoteConfig(t){var e,i,r;if(t.ok){var n=t.config;if("errorTracking"in n){var s=null!==(e=null==(i=n.errorTracking)?void 0:i.suppressionRules)&&void 0!==e?e:[],o=null==(r=n.errorTracking)?void 0:r.captureExtensionExceptions;this.uc=s,this._instance.persistence&&this._instance.persistence.register({[P]:this.uc,[F]:o})}}}get fc(){var t,e,i=!!this._instance.get_property(F);return null!==(t=null!==(e=this._instance.config.error_tracking.captureExtensionExceptions)&&void 0!==e?e:i)&&void 0!==t&&t}buildProperties(t,e){return this.hc.buildFromUnknown(t,{syntheticException:null==e?void 0:e.syntheticException,mechanism:{handled:null==e?void 0:e.handled}})}addExceptionStep(t,e){if(this.dc.enabled)try{if(!Ee(t)||0===t.trim().length)return void tm.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)=>Dr.has(r)?(e.push(r),i):(i[r]=t[r],i),{}),droppedKeys:e}}(this.gc(e)),r=i.sanitizedProperties,s=i.droppedKeys;s.length>0&&tm.warn("Ignoring reserved exception step fields",{droppedKeys:s}),this.cc.add(n({[Or]:t,[$r]:(new Date).toISOString()},r))}catch(t){tm.error("Failed to add exception step. Ignoring breadcrumb.",t)}}sendExceptionEvent(t){try{var e=t.$exception_list;if(this.mc(e)){if(this.yc(e))return this.bc("Exception dropped: matched a suppression rule"),void tm.info("Skipping exception capture because a suppression rule matched");if(!this.fc&&this._c(e))return this.bc("Exception dropped: thrown by a browser extension"),void tm.info("Skipping exception capture because it was thrown by an extension");if(!this.fc&&this.wc(e))return this.bc("Exception dropped: thrown by an injected browser script"),void tm.info("Skipping exception capture because it was thrown by an injected browser script");if(!this._instance.config.error_tracking.__capturePostHogExceptions&&this.kc(e))return this.bc("Exception dropped: thrown by the PostHog SDK"),void tm.info("Skipping exception capture because it was thrown by the PostHog SDK")}var i=this.dc.enabled&&Pe(t.$exception_steps)?this.Sc(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",Iu:!0});return n&&this.cc.clear(),n}catch(t){return Yg(t)||tm.error("Failed to capture exception event. Dropping this exception.",t),void this.cc.clear()}}catch(t){return void(Yg(t)||tm.error("Failed to process exception event. Ignoring this exception.",t))}var s}Sc(t){try{var e=this.cc.getAttachable();return 0===e.length?t:n({},t,{$exception_steps:e})}catch(e){return tm.error("Failed to read buffered exception steps. Capturing exception without steps.",e),t}}bc(t){this.dc.enabled&&this.cc.add({[Or]:t,[$r]:(new Date).toISOString()})}gc(t){return Te(t)?n({},t):{}}vc(){var t,e;return null!==(t=null==(e=this._instance.config.error_tracking)?void 0:e.exception_steps)&&void 0!==t?t:{}}yc(t){if(0===t.length)return!1;try{var e=t.reduce((t,e)=>{var i=e.type,r=e.value;return Ee(i)&&i.length>0&&t.$exception_types.push(i),Ee(r)&&r.length>0&&t.$exception_values.push(r),t},{$exception_types:[],$exception_values:[]});return this.uc.some(t=>{var i=t.values.map(t=>{var i=ya[t.operator],r=e[t.key];if(!i||!r)return!1;var n=xe(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 tm.warn("Failed to evaluate suppression rules. Capturing the exception.",t),!1}}_c(t){var e=t.flatMap(t=>{var e,i;return null!==(e=null==(i=t.stacktrace)?void 0:i.frames)&&void 0!==e?e:[]}),i=e.filter(t=>{var e=t.filename;return!!e&&im.some(t=>e.startsWith(t))});return 0!==i.length&&(!i.every(t=>{var e=t.filename;return!!e&&e.startsWith(em)})||t.some(t=>{var e=t.value;return Ee(e)&&e.includes("isolatedAPI.contexts.topHostname")})&&!e.some(t=>{var e=t.filename;return t.in_app&&!(null!=e&&e.startsWith(em))}))}wc(t){return t.some(t=>{var e=t.value;return Ee(e)&&rm.some(t=>e.includes(t))})}kc(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:[];return null!==(r=null==(n=s[s.length-1])||null==(n=n.filename)?void 0:n.includes("posthog.com/static"))&&void 0!==r&&r}return!1}mc(t){return!Pe(t)&&xe(t)}}},ik=n({productTours:class{get Ya(){return this._instance.persistence}constructor(t){this.xc=null,this.Cc=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.Ya&&this.Ya.register({[L]:!!e.productTours}),!yw(this._instance))return!this.xc&&Pe(null==(i=this.Ya)?void 0:i.props.ph_product_tours)||mw.info("product tours disabled; stopping and clearing cached tours"),null==(r=this.xc)||r.stop(),this.xc=null,void this.clearCache();this.loadIfEnabled()}}}loadIfEnabled(){!this.xc&&yw(this._instance)&&this.do(()=>this.Tc())}do(t){var e,i;null!=(e=b.__PosthogExtensions__)&&e.generateProductTours?t():null==(i=b.__PosthogExtensions__)||null==i.loadExternalDependency||i.loadExternalDependency(this._instance,"product-tours",e=>{e?mw.error("Could not load product tours script",e):t()})}Tc(){var t;!this.xc&&null!=(t=b.__PosthogExtensions__)&&t.generateProductTours&&(this.xc=b.__PosthogExtensions__.generateProductTours(this._instance,!0))}getProductTours(t,e){if(void 0===e&&(e=!1),!xe(this.Cc)||e){var i=this.Ya;if(i){var r=i.props[_t];if(xe(r)&&!e)return this.Cc=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(yw(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||mw.warn(n):mw.error(n),void t([],{isLoaded:!1,error:n})}var s=xe(e.json.product_tours)?e.json.product_tours:[];this.Cc=s,i&&i.register({[_t]:s}),t(s,{isLoaded:!0})}else t([],{isLoaded:!0})}})}else t(this.Cc,{isLoaded:!0})}getActiveProductTours(t){Pe(this.xc)?t([],{isLoaded:!1,error:"Product tours not loaded"}):this.xc.getActiveProductTours(t)}showProductTour(t){var e;null==(e=this.xc)||e.showTourById(t)}previewTour(t){this.xc?this.xc.previewTour(t):this.do(()=>{var e;this.Tc(),null==(e=this.xc)||e.previewTour(t)})}dismissProductTour(){var t;null==(t=this.xc)||t.dismissTour("user_clicked_skip")}nextStep(){var t;null==(t=this.xc)||t.nextStep()}previousStep(){var t;null==(t=this.xc)||t.previousStep()}clearCache(){var t;this.Cc=null,null==(t=this.Ya)||t.unregister(_t)}resetTour(t){var e;null==(e=this.xc)||e.resetTour(t)}resetAllTours(){var t;null==(t=this.xc)||t.resetAllTours()}cancelPendingTour(t){var e;null==(e=this.xc)||e.cancelPendingTour(t)}}},Xw),rk={siteApps:class{constructor(t){this._instance=t,this.Mc=0,this.Ic=[],this.apps={}}get isEnabled(){return!!this._instance.config.opt_in_site_apps}Ec(t,e){if(e){var i=this.globalsForEvent(e);this.Ic.push(i),this.Ic.length>1e3&&(this.Ic=this.Ic.slice(10))}}get siteAppLoaders(){var t;return null==(t=b._POSTHOG_REMOTE_CONFIG)||null==(t=t[this._instance.config.token])?void 0:t.siteApps}initialize(){if(this.isEnabled){var t=this._instance._addCaptureHook(this.Ec.bind(this));this.Rc=()=>{t(),this.Ic=[],this.Rc=void 0}}}globalsForEvent(t){var e,s,o,a,l,u,h;if(!t)throw new Error("Event payload is required");var d={},v=this._instance.get_property("$groups")||[],c=this._instance.get_property("$stored_group_properties")||{};for(var f of Object.entries(c)){var p=f[0];d[p]={id:v[p],type:p,properties:f[1]}}var g=t.$set_once,m=t.$set;return{event:n({},r(t,i),{properties:n({},t.properties,m?{$set:n({},null!==(e=null==(s=t.properties)?void 0:s.$set)&&void 0!==e?e:{},m)}:{},g?{$set_once:n({},null!==(o=null==(a=t.properties)?void 0:a.$set_once)&&void 0!==o?o:{},g)}:{}),elements_chain:null!==(l=null==(u=t.properties)?void 0:u.$elements_chain)&&void 0!==l?l:"",distinct_id:null==(h=t.properties)?void 0:h.distinct_id}),person:{properties:this._instance.get_property("$stored_person_properties")},groups:d}}Ac(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)||(bw.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)||(bw.error("prepare_external_dependency_script returned null"),null):t}Pc(){var t,e,i,r,n,s,o,a;if(!this._instance.config.prepare_external_dependency_stylesheet&&!this._instance.config.prepare_external_dependency_script)return()=>{};var l=null==h?void 0:h.defaultView,u=null==l||null==(t=l.Node)?void 0:t.prototype;if(!l||!u)return()=>{};if(this.Mc++,this.Fc)return this.Oc();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.Ac(t);return e&&c.add(e),e},g=t=>t.map(t=>"string"==typeof t?t:p(t)).filter(t=>!Ae(t));return f(u,"appendChild",t=>function(e){var i=p(e);return i?t.call(this,i):e}),f(u,"insertBefore",t=>function(e,i){var r=p(e);return r?t.call(this,r,i):e}),f(u,"replaceChild",t=>function(e,i){var r=p(e);return r?t.call(this,r,i):i}),[null==(e=l.Element)?void 0:e.prototype,null==(i=l.Document)?void 0:i.prototype,null==(r=l.DocumentFragment)?void 0:r.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==(n=l.Element)?void 0:n.prototype,null==(s=l.CharacterData)?void 0:s.prototype,null==(o=l.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==(a=l.Element)?void 0:a.prototype,"insertAdjacentElement",t=>function(e,i){var r=p(i);return r?t.call(this,e,r):null}),this.Fc=()=>{d.forEach(t=>t()),this.Fc=void 0},this.Oc()}Oc(){var t=!1;return()=>{var e;t||(t=!0,this.Mc--,0===this.Mc&&(null==(e=this.Fc)||e.call(this)))}}$c(t,e){void 0===e&&(e=!0);var i=this.Pc();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.Ic.length&&(bw.info("Processing "+this.Ic.length+" events for site app with id "+t.id),this.Ic.forEach(t=>this.$c(()=>null==e.processEvent?void 0:e.processEvent(t))),e.processedBuffer=!0),Object.values(this.apps).every(t=>t.processedBuffer||t.errored)&&(null==(i=this.Rc)||i.call(this))},r=!1,n=n=>{e.errored=!n,e.loaded=!0,bw.info("Site app with id "+t.id+" "+(n?"loaded":"errored")),r&&i()};try{var s=this.$c(e=>t.init({posthog:this._instance,callback(t){e(),n(t)}}),!1).processEvent;s&&(e.processEvent=s),r=!0}catch(e){bw.error(_w+t.id,e),n(!1)}if(r&&e.loaded)try{i()}catch(i){bw.error("Error while processing buffered events PostHog app with config id "+t.id,i),e.errored=!0}}Dc(){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)}Lc(t){var e=this;if(0!==Object.keys(this.apps).length){var i=this.globalsForEvent(t),r=function(r){try{e.$c(()=>null==r.processEvent?void 0:r.processEvent(i))}catch(e){bw.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.Dc(),void this._instance.on("eventCaptured",t=>this.Lc(t))):void bw.error('PostHog site apps are disabled. Enable the "opt_in_site_apps" config to proceed.');if(null==(i=this.Rc)||i.call(this),t.ok){var s=t.config;if(null!=(r=s.siteApps)&&r.length)if(this.isEnabled){var o=function(){var t,e=a.id,i=a.url;b["__$$ph_site_app_"+e]=n._instance,null==(t=b.__PosthogExtensions__)||null==t.loadSiteApp||t.loadSiteApp(n._instance,i,t=>{if(t)return bw.error(_w+e,t)})};for(var a of s.siteApps)o()}else bw.error('PostHog site apps are disabled. Enable the "opt_in_site_apps" config to proceed.')}}}},nk={tracingHeaders:class{constructor(t){this._instance=t,this.Nc=void 0,this.qc=void 0,this.jc=void 0,this.Yv=()=>{var t,e,i=this.Bc();i?(Ie(this.Nc)&&(this.Nc=null==(t=b.__PosthogExtensions__)||null==(t=t.tracingHeadersPatchFns)?void 0:t._patchXHR(i,()=>this._instance.get_distinct_id(),this._instance.sessionManager)),Ie(this.qc)&&(this.qc=null==(e=b.__PosthogExtensions__)||null==(e=e.tracingHeadersPatchFns)?void 0:e._patchFetch(i,()=>this._instance.get_distinct_id(),this._instance.sessionManager))):this.oc()}}initialize(){this.startIfEnabledOrStop()}do(t){var e,i;null!=(e=b.__PosthogExtensions__)&&e.tracingHeadersPatchFns?t():null==(i=b.__PosthogExtensions__)||null==i.loadExternalDependency||i.loadExternalDependency(this._instance,"tracing-headers",e=>{if(e)return lw.error("failed to load script",e);t()})}Hc(){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}Bc(){var t=this.Hc();return xe(t)?(xe(this.jc)?this.jc.splice(0,this.jc.length,...t):this.jc=[...t],t.length>0?this.jc:void 0):(xe(this.jc)&&this.jc.splice(0),this.jc=t||void 0,this.jc)}oc(){var t,e;null==(t=this.Nc)||t.call(this),null==(e=this.qc)||e.call(this),this.Nc=void 0,this.qc=void 0}startIfEnabledOrStop(){this.Bc()?this.do(this.Yv):this.oc()}}},sk=n({surveys:class extends xw{constructor(t){var e;super(new Rw(t),(e=t,{get projectToken(){return e.config.token},kv:new Ew(e)})),this._instance=t}Yu(t,e){var i=e.query?l_(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})})}}},Xw),ok={toolbar:class{constructor(t){this.instance=t}zc(t){b.ph_toolbar_state=t}Uc(){var t;return null!==(t=b.ph_toolbar_state)&&void 0!==t?t:0}initialize(){return this.maybeLoadToolbar()}maybeLoadToolbar(t,e,i){if(void 0===t&&(t=void 0),void 0===e&&(e=void 0),void 0===i&&(i=void 0),Ln(this.instance.config))return!1;if(!a||!h)return!1;t=null!=t?t:a.location,i=null!=i?i:a.history;try{if(!e){try{a.localStorage.setItem("test","test"),a.localStorage.removeItem("test")}catch(t){return!1}e=null==a?void 0:a.localStorage}var r,n=Aw||Un(t.hash,"__posthog")||Un(t.hash,"state"),s=n?Rn(()=>JSON.parse(atob(decodeURIComponent(n))))||Rn(()=>JSON.parse(decodeURIComponent(n))):null;return s&&"ph_authorize"===s.action?((r=s).source="url",r&&Object.keys(r).length>0&&(s.desiredHash?t.hash=s.desiredHash:i?i.replaceState(i.state,"",t.pathname+t.search):t.hash="")):((r=JSON.parse(e.getItem(Pw)||"{}")).source="localstorage",delete r.userIntent),!(!r.token||this.instance.config.token!==r.token||(this.loadToolbar(r),0))}catch(t){return!1}}Wc(t){var e=b.ph_load_toolbar||b.ph_load_editor;!Pe(e)&&Ce(e)?e(t,this.instance):Fw.warn("No toolbar load function found")}loadToolbar(t){var e=!(null==h||!h.getElementById("__POSTHOG_TOOLBAR__"));if(!a||e)return!1;var i="custom"===this.instance.requestRouter.region&&this.instance.config.advanced_disable_toolbar_metrics,r=n({token:this.instance.config.token},t,{apiURL:this.instance.requestRouter.endpointFor("ui")},i?{instrument:!1}:{});if(a.localStorage.setItem(Pw,JSON.stringify(n({},r,{source:void 0}))),2===this.Uc())this.Wc(r);else if(0===this.Uc()){var s;this.zc(1),null==(s=b.__PosthogExtensions__)||null==s.loadExternalDependency||s.loadExternalDependency(this.instance,"toolbar",t=>{if(t)return Fw.error("[Toolbar] Failed to load",t),void this.zc(0);this.zc(2),this.Wc(r)}),Dn(a,"turbolinks:load",()=>{this.zc(0),this.loadToolbar(r)})}return!0}Vc(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)}}},ak=n({experiments:class t{get _n(){return this._instance.config}constructor(e){var i=this;this._instance=e,this.getWebExperimentsAndEvaluateDisplayLogic=function(e){void 0===e&&(e=!1),i.getWebExperiments(e=>{t.Gc("retrieved web experiments from the server"),i.Zc=new Map,e.forEach(e=>{if(e.feature_flag_key){var r;i.Zc&&(t.Gc("setting flag key ",e.feature_flag_key," to web experiment ",e),null==(r=i.Zc)||r.set(e.feature_flag_key,e));var n=i._instance.getFeatureFlag(e.feature_flag_key);Ee(n)&&e.variants[n]&&i.Jc(e.name,n,e.variants[n].transforms)}else if(e.variants)for(var s in e.variants){var o=e.variants[s];t.Qc(o,i._instance)&&i.Jc(e.name,s,o.transforms)}})},e)},this._instance.onFeatureFlags(t=>{this.onFeatureFlags(t)})}initialize(){}onFeatureFlags(e){if(this._is_bot())t.Gc(Hw);else if(!this._n.disable_web_experiments){if(Pe(this.Zc))return this.Zc=new Map,this.loadIfEnabled(),void this.previewWebExperiment();t.Gc("applying feature flags",e),e.forEach(t=>{var e;if(this.Zc&&null!=(e=this.Zc)&&e.has(t)){var i,r=this._instance.getFeatureFlag(t),n=null==(i=this.Zc)?void 0:i.get(t);r&&null!=n&&n.variants[r]&&this.Jc(n.name,r,n.variants[r].transforms)}})}}previewWebExperiment(){var e=t.getWindowLocation();if(null!=e&&e.search){var i=Hn(null==e?void 0:e.search,"__experiment_id"),r=Hn(null==e?void 0:e.search,"__experiment_variant");i&&r&&(t.Gc("previewing web experiments "+i+" && "+r),this.getWebExperiments(t=>{this.Kc(parseInt(i),r,t)},!1,!0))}}loadIfEnabled(){this._n.disable_web_experiments||this.getWebExperimentsAndEvaluateDisplayLogic()}getWebExperiments(t,e,i){if(this._n.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._n.token),method:"GET",timestampMode:"query",callback:e=>t(200===e.statusCode&&e.json&&e.json.experiments||[])})}Kc(e,i,r){var n=r.filter(t=>t.id===e);n&&n.length>0&&(t.Gc("Previewing web experiment ["+n[0].name+"] with variant ["+i+"]"),this.Jc(n[0].name,i,n[0].variants[i].transforms))}static Qc(e,i){return!Pe(e.conditions)&&t.Xc(e,i)&&t.Yc(e)}static Xc(e,i){var r;if(Pe(e.conditions)||Pe(null==(r=e.conditions)?void 0:r.url))return!0;var n=t.getWindowLocation();if(n){var s,o,a,l=Gn(i,n.href);return null==(s=e.conditions)||!s.url||zw[null!==(o=null==(a=e.conditions)?void 0:a.urlMatchType)&&void 0!==o?o:"icontains"](e.conditions.url,l)}return!1}static getWindowLocation(){return null==a?void 0:a.location}static Yc(t){var e;if(Pe(t.conditions)||Pe(null==(e=t.conditions)?void 0:e.utm))return!0;var i=Fa();if(i.utm_source){var r,n,s,o,a,l,u,h,d=null==(r=t.conditions)||null==(r=r.utm)||!r.utm_campaign||(null==(n=t.conditions)||null==(n=n.utm)?void 0:n.utm_campaign)==i.utm_campaign,v=null==(s=t.conditions)||null==(s=s.utm)||!s.utm_source||(null==(o=t.conditions)||null==(o=o.utm)?void 0:o.utm_source)==i.utm_source,c=null==(a=t.conditions)||null==(a=a.utm)||!a.utm_medium||(null==(l=t.conditions)||null==(l=l.utm)?void 0:l.utm_medium)==i.utm_medium,f=null==(u=t.conditions)||null==(u=u.utm)||!u.utm_term||(null==(h=t.conditions)||null==(h=h.utm)?void 0:h.utm_term)==i.utm_term;return d&&c&&f&&v}return!1}static Gc(t){for(var e=arguments.length,i=new Array(e>1?e-1:0),r=1;e>r;r++)i[r-1]=arguments[r];xn.info("[WebExperiments] "+t,i)}Jc(e,i,r){this._is_bot()?t.Gc(Hw):"control"!==i?r.forEach(r=>{var n;r.selector&&(t.Gc("applying transform of variant "+i+" for experiment "+e+" ",r),null==(n=document)||null==(n=n.querySelectorAll(r.selector))||n.forEach(t=>{var e=t;r.html&&(e.innerHTML=r.html),r.css&&e.setAttribute("style",r.css)}))}):t.Gc("Control variants leave the page unmodified.")}_is_bot(){return u&&this._instance?I_(u,this._n.custom_blocked_useragents):void 0}}},Xw),lk=n({},Xw,Yw,tk,ek,ik,rk,sk,nk,ok,ak,{conversations:class{constructor(t){this._instance=t,this.tf=void 0,this._conversationsManager=null,this.ef=!1,this.zt=null,this.if=!1}initialize(){this.loadIfEnabled()}onRemoteConfig(t){if(!this._instance.config.disable_conversations&&(this.rf=t.ok,t.ok)){var e=t.config.conversations;Pe(e)||($e(e)?this.tf=e:(this.tf=e.enabled,this.zt=e),this.loadIfEnabled())}}reset(){var t;null==(t=this._conversationsManager)||t.reset(),this._conversationsManager=null,this.tf=void 0,this.zt=null,this.rf=void 0,this.if=!1}loadIfEnabled(){if(!(this._conversationsManager||this.ef||this._instance.config.disable_conversations||Ln(this._instance.config)||this._instance.config.cookieless_mode&&this._instance.consent.isOptedOut())){var t=null==b?void 0:b.__PosthogExtensions__;if(t&&!Ie(this.tf)&&this.tf)if(this.zt&&this.zt.token){this.ef=!0;try{var e=t.initConversations;if(e)return this.nf(e),void(this.ef=!1);var i=t.loadExternalDependency;if(!i)return void this.sf(Yt);i(this._instance,"conversations",e=>{e||!t.initConversations?this.sf("Could not load conversations script",e):this.nf(t.initConversations),this.ef=!1})}catch(t){this.sf("Error initializing conversations",t),this.ef=!1}}else Uw.error("Conversations enabled but missing token in remote config.")}}nf(t){if(this.zt)try{this._conversationsManager=t(this.zt,this._instance),this.if=!1,Uw.info("Conversations loaded successfully")}catch(t){this.sf("Error completing conversations initialization",t)}else Uw.error("Cannot complete initialization: remote config is null")}sf(t,e){Uw.error(t,e),this._conversationsManager=null,this.ef=!1,this.if=!0}show(){this._conversationsManager?this._conversationsManager.show():Uw.warn("Conversations not loaded yet.")}hide(){this._conversationsManager&&this._conversationsManager.hide()}isAvailable(){return!0===this.tf&&!Ae(this._conversationsManager)}getUnavailableReason(){return this.isAvailable()?null:this._instance.config.disable_conversations?"disabled_by_config":Ln(this._instance.config)?"disabled_for_toolbar":this._instance.config.cookieless_mode&&this._instance.consent.isOptedOut()?"consent_opted_out":!1===this.rf?"remote_config_failed":Ie(this.tf)?this.rf?"disabled_in_project":"remote_config_pending":this.tf?Pe(this.zt)||!this.zt.token?"missing_token":null!=b&&b.__PosthogExtensions__?this.ef?"initializing":this.if?"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 o(function*(){return r._conversationsManager?r._conversationsManager.sendMessage(t,e,i):(Uw.warn(Ww),null)})()}getMessages(t,e){var i=this;return o(function*(){return i._conversationsManager?i._conversationsManager.getMessages(t,e):(Uw.warn(Ww),null)})()}markAsRead(t){var e=this;return o(function*(){return e._conversationsManager?e._conversationsManager.markAsRead(t):(Uw.warn(Ww),null)})()}getTickets(t){var e=this;return o(function*(){return e._conversationsManager?e._conversationsManager.getTickets(t):(Uw.warn(Ww),null)})()}requestRestoreLink(t){var e=this;return o(function*(){return e._conversationsManager?e._conversationsManager.requestRestoreLink(t):(Uw.warn(Ww),null)})()}restoreFromToken(t){var e=this;return o(function*(){return e._conversationsManager?e._conversationsManager.restoreFromToken(t):(Uw.warn(Ww),null)})()}restoreFromUrlToken(){var t=this;return o(function*(){return t._conversationsManager?t._conversationsManager.restoreFromUrlToken():(Uw.warn(Ww),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}Lu(){var t;null==(t=this._conversationsManager)||t.setIdentity()}Nu(){var t;null==(t=this._conversationsManager)||t.clearIdentity()}}},{logs:class{constructor(t){var e,i=this;this._instance=t,this.name=Vf,this.af=!1,this.lf=!1,this.uf=!1,this.A=Cn("[logs]"),this.hf=n({},this.A,{error(){for(var t=arguments.length,e=new Array(t),r=0;t>r;r++)e[r]=arguments[r];e.some(Kw)||i.A.error(...e)}}),this.Aa=[],this.df=[],this.Td=0,this.Js=!1,this.vf=[],this.cf=[],this.ff=!1,this.pf=!1,this.gf=()=>{var t,e;this.Js||(this.Td=0,null==(t=this.mf)||t.onReconnect(),null==(e=this.yf)||e.onReconnect())},this._instance&&null!=(e=this._instance.config.logs)&&e.captureConsoleLogs&&(this.af=!0),a&&Dn(a,"online",this.gf)}bf(t,e,i,r){var n,s=Vw(null==(n=this._instance)||null==(n=n.config)?void 0:n.logs,i);return[new pn(this._f(t,e),s,this.hf,()=>this.wf(),t=>t(),void 0,r),s]}kf(){var t,e=null==(t=this._instance)||null==(t=t.config)?void 0:t.logs;if(!this.mf||this.Sf!==e){var i;null==(i=this.mf)||i.reset(),this.Sf=e;var r=this.bf(()=>this.Aa,t=>{this.Aa=t});this.mf=r[0],this.xf=r[1]}return this.mf}Cf(){var t,e=null==(t=this._instance)||null==(t=t.config)?void 0:t.logs;if(!this.yf||this.Tf!==e){var i;null==(i=this.yf)||i.reset(),this.Tf=e;var r=this.bf(()=>this.df,t=>{this.df=t},{serviceNameDefault:"posthog-browser-logs",consoleCapture:!0},Zw);this.yf=r[0],this.Mf=r[1]}return this.yf}setup(t){var e;if(!this.Js){this.Hs=t,null!=(e=this._instance)&&null!=(e=e.config)&&null!=(e=e.logs)&&e.captureConsoleLogs&&(this.af=!0),(this.af||this.If()&&this.Ef())&&this.Rf();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.Js?r.dispose():(this.Xs=r,i||this.loadIfEnabled())}}dispose(){var t,e,i,r;this.Js||(this.Js=!0,this.Af(),null==(t=this.Xs)||t.dispose(),this.Xs=void 0,this.Hs=void 0,this.uf=!1,null==a||a.removeEventListener("online",this.gf),null==(e=this.Pf)||e.call(this),this.Pf=void 0,null==(i=this.mf)||i.reset(),null==(r=this.yf)||r.reset())}onRemoteConfig(t){var e,i;if(!this.Js){var r=t.ok?null==(e=t.config.logs)?void 0:e.captureConsoleLogs:void 0;Pe(r)?this.Ff():(null==(i=this._instance)||null==(i=i.persistence)||i.register({[N]:!!r}),r?(this.af=!0,this.lf||this.Rf(),this.loadIfEnabled()):this.Ff())}}reset(){var t,e,i,r;this.Af(),null==(t=this.mf)||t.clearQueue(),this.Aa=[],null==(e=this.mf)||e.reset(),null==(i=this.yf)||i.clearQueue(),this.df=[],null==(r=this.yf)||r.reset(),this.Td=0}captureLog(t){this.Js||this.kf().captureLog(t)}captureConsoleLog(t){this.Js||this.Cf().captureLog(t)}captureBufferedConsoleLog(t,e,i){this.Js||this.Cf().captureLog(t,{context:e,occurredAtMs:i})}Ef(){var t;return!(null==(t=this._instance)||null==(t=t.persistence)||null==(t=t.props)||!t[N])}If(){var t,e;return null==(t=this._instance)||null==t.Ma||!t.Ma()||!(null==(e=b._POSTHOG_REMOTE_CONFIG)||null==(e=e[this._instance.config.token])||!e.config)}ju(){var t;this.Af(),null==(t=this.yf)||t.clearQueue(),this.df=[]}Ff(){this.af||this.Af()}Rf(){var t,e=this;if(!this.ff&&null!=b&&b.console){var i=Vw(null==(t=this._instance)||null==(t=t.config)?void 0:t.logs).maxBufferSize,r=function(t){var r;try{r=Bg(b.console[t])}catch(t){return 0}if(!r)return 0;e.cf.push(mv(b.console,t,n=>{var s=function(){for(var r=arguments.length,s=new Array(r),o=0;r>o;o++)s[o]=arguments[o];try{e.Of(t,s,i)}catch(t){}return n.apply(b.console,s)};return s.__rrweb_original__=r,s}))};for(var n of Gw)r(n);this.ff=!0,this.$f=setTimeout(()=>{this.Af()},3e4)}}Of(t,e,i){var r;if(this.ff&&!this.pf&&0!==e.length)if(null!=(r=this._instance)&&r.is_capturing()){if(i>this.vf.length){this.pf=!0;try{this.vf.push({level:t,args:e,occurredAtMs:Date.now(),context:this.wf()})}finally{this.pf=!1}}}else this.Af()}Af(){if(this.vf=[],this.ff){for(var t of(this.ff=!1,this.$f&&(clearTimeout(this.$f),this.$f=void 0),this.cf))t();this.cf=[]}}Df(){var t=this.vf;return this.Af(),t}get logger(){return this.Lf||(this.Lf={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.Lf}flushLogs(t){t?this.Nf(t):(this.mf&&this.mf.flush().catch(t=>this.qf(t)),this.yf&&this.yf.flush().catch(t=>this.qf(t)))}qf(t){Kw(t)||this.A.error("PostHog logs flush failed:",t)}loadIfEnabled(){if(!this.Js&&this.af&&!this.lf&&!this.uf){var t=null==b?void 0:b.__PosthogExtensions__;if(!t)return this.A.error("PostHog Extensions not found."),void this.Af();var e=t.loadExternalDependency;if(!e)return this.A.error(Yt),void this.Af();this.uf=!0;try{e(this._instance,"logs",e=>{if(this.uf=!1,!this.Js&&this.af){var i=t.logs;if(e||null==i||!i.initializeLogs)this.A.error("Could not load logs script",e),this.Af();else{var r,n,s=this.Df();this.Pf=i.initializeLogs(null!==(r=this.Hs)&&void 0!==r?r:this._instance),this.lf=!0,s.length>0&&(null==i.replayConsoleBuffer||i.replayConsoleBuffer(null!==(n=this.Hs)&&void 0!==n?n:this._instance,s))}}})}catch(t){throw this.uf=!1,t}}}_f(t,e){var i=this._instance;return{get isDisabled(){return!1},get optedOut(){return!i.is_capturing()},getPersistedProperty:e=>e===pe.LogsQueue?t():void 0,setPersistedProperty(t,i){t===pe.LogsQueue&&e(null!=i?i:[])},gs:t=>this.gs(t),getLibraryId:()=>ia.LIB_NAME,getLibraryVersion:()=>ia.LIB_VERSION}}gs(t){return new Promise(e=>{if(Wn(this.Td,3))e({kind:"fatal",error:Qw(void 0,"logs endpoint is unreachable, dropping batch")});else{var i=!1,r=t=>{i||(i=!0,clearTimeout(n),e(t))},n=setTimeout(()=>{this.A.warn("Logs request timed out before receiving a response"),r({kind:"retry-later",error:Qw(void 0,"logs request timed out")})},9e4);this._instance._send_request({method:"POST",url:this.jf(),data:t,compression:"best-available",batchKey:"logs",fireCallbackOnDrop:!0,callback:t=>{var e=t.statusCode;if(this.Bf(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.A.warn("Logs request failed before receiving an HTTP response"),r({kind:"retry-later",error:Qw(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)})}}})}})}Bf(t){(0!==t||this._instance.__loaded)&&(this.Td=Vn(t,this.Td,3,()=>this.A.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.")))}Nf(t){this.Aa.length>0&&this.Hf(t,this.Aa,this.xf,ia.LIB_NAME,t=>{this.Aa=t}),this.df.length>0&&this.Hf(t,this.df,this.Mf,Zw,t=>{this.df=t})}Hf(t,e,i,r,n){if(0!==e.length){var s=e.map(t=>t.record);n([]);var o=fn(s,cn(i,ia.LIB_NAME,ia.LIB_VERSION),r,ia.LIB_VERSION);this._instance._send_request({method:"POST",url:this.jf(),data:o,compression:"best-available",batchKey:"logs",transport:t})}}jf(){return this._instance.requestRouter.endpointFor("api","/i/v1/logs")+"?token="+encodeURIComponent(this._instance.config.token)}wf(){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,Pe(n)||(e.sessionStartTimestamp=n),Pe(s)||(e.lastActivityTimestamp=s)}if(null!=b&&null!=(t=b.location)&&t.href&&(e.currentUrl=this._instance.config.disable_capture_url_hashes?ar(b.location.href):b.location.href),this._instance.featureFlags){var o=this._instance.featureFlags.getFlags();o&&o.length>0&&(e.activeFeatureFlags=o)}return e}}},{metrics:class{constructor(t){this._instance=t,this.A=Cn("[metrics]")}initialize(){}kf(){var t,e,i=null==(t=this._instance)||null==(t=t.config)?void 0:t.metrics;return this.mf&&this.Sf===i||(null==(e=this.mf)||e.reset(),this.Sf=i,this.mf=new bn(this._f(),function(t){var e,i,r,n,s,o=null==t?void 0:t.resourceAttributes;return{serviceName:null!==(e=null==o?void 0:o["service.name"])&&void 0!==e?e:null==t?void 0:t.serviceName,serviceVersion:null!==(i=null==o?void 0:o["service.version"])&&void 0!==i?i:null==t?void 0:t.serviceVersion,environment:null!==(r=null==o?void 0:o["deployment.environment"])&&void 0!==r?r:null==t?void 0:t.environment,resourceAttributes:o,beforeSend:null==t?void 0:t.beforeSend,flushIntervalMs:null!==(n=null==t?void 0:t.flushIntervalMs)&&void 0!==n?n:1e4,maxSeriesPerFlush:null!==(s=null==t?void 0:t.maxSeriesPerFlush)&&void 0!==s?s:1e3}}(i),this.A)),this.mf}count(t,e,i){void 0===e&&(e=1),this.kf().count(t,e,i)}gauge(t,e,i){this.kf().gauge(t,e,i)}histogram(t,e,i){this.kf().histogram(t,e,i)}flush(t){if(!this.mf)return Promise.resolve();if(t){var e=this.mf.drainWindow();return e&&this.Fs(e,t),Promise.resolve()}return this.mf.flush().catch(t=>this.A.error("PostHog metrics flush failed:",t))}reset(){var t;null==(t=this.mf)||t.reset()}_f(){var t=this._instance,e=this;return{get isDisabled(){return!1},get optedOut(){return!t.is_capturing()},Fs:t=>e.Fs(t),getLibraryId:()=>ia.LIB_NAME,getLibraryVersion:()=>ia.LIB_VERSION}}Fs(t,e){return new Promise(i=>{var r=!1,s=t=>{r||(r=!0,clearTimeout(o),i(t))},o=setTimeout(()=>s({kind:"retry-later",error:new Error("metrics request timed out")}),9e4);this._instance._send_request(n({method:"POST",url:this.zf(),data:t,compression:"best-available",batchKey:"metrics"},e&&{transport:e},{fireCallbackOnDrop:!0,callback(t){var e,i=t.statusCode;s(i>=200&&300>i?{kind:"ok"}:413===i?{kind:"too-large"}:0!==i&&408!==i&&429!==i&&500>i?{kind:"fatal",error:new Error("metrics request failed with status "+i)}:{kind:"retry-later",error:null!==(e=t.error)&&void 0!==e?e:new Error("metrics request failed with status "+i)})}}))})}zf(){return this._instance.requestRouter.endpointFor("api","/i/v1/metrics")+"?token="+encodeURIComponent(this._instance.config.token)}}});sw.__defaultExtensionClasses=n({},lk),function(){ia.SDK_DIST_CHANNEL="cdn";var t=b.posthog;if(!t||xe(t._i)){var e=H_[X_]=new sw;if(t){var i=[];Mn(t._i,function(r){if(r&&xe(r)){var n=e.init(r[0],r[1],r[2]),s=t[r[2]]||t;n.__loaded&&-1===i.indexOf(s)&&(i.push(s),n._execute_array.call(n.people,s.people),n._execute_array(s))}})}e.__SV=1,b.posthog=e,function(){function t(){t.done||(t.done=!0,Y_=!1,Mn(H_,function(t){t._dom_loaded()}))}null!=h&&h.addEventListener?"complete"===h.readyState?t():Dn(h,"DOMContentLoaded",t,{capture:!1}):a&&xn.error("Browser doesn't support `document.addEventListener` so PostHog couldn't be initialized")}()}}()}()}();
2
2
  //# sourceMappingURL=array.full.js.map